[code-saturne] 56/70: Imported Upstream version 2.0.0.beta2
Gilles Filippini
pini at debian.org
Sun Jan 18 22:33:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to branch master
in repository code-saturne.
commit 4a5a9c5ee17798f83599e3ffa6f4f4fb4bf27c96
Author: Gilles Filippini <pini at debian.org>
Date: Sun Jan 18 22:52:40 2015 +0100
Imported Upstream version 2.0.0.beta2
---
ABOUT-NLS | 1068 +
AUTHORS | 89 +
COMPATIBILITY | 64 +
COPYING | 339 +
ChangeLog | 6261 ++++
INSTALL | 237 +
Makefile.am | 149 +
Makefile.in | 1118 +
NEWS | 0
QUALITY_ASSURANCE | 4 +
README | 0
TODO | 477 +
aclocal.m4 | 9092 ++++++
bin/SaturneGUI.in | 38 +
bin/cs.in | 125 +
bin/cs_check_consistency.py | 208 +
bin/cs_check_mesh.py | 124 +
bin/cs_compile.py | 310 +
bin/cs_config.py.in | 168 +
bin/cs_create.py | 385 +
bin/cs_info.py | 187 +
bin/cs_plot_probes.py | 107 +
bin/runcase.help | 284 +
bin/runcase.in | 1127 +
bin/runcase_coupling.in | 1029 +
bin/runcase_mpi_env | 165 +
bin/runcase_mpi_rank | 99 +
bin/runcase_syrthes | 326 +
config/config.guess | 1526 +
config/config.rpath | 666 +
config/config.sub | 1658 +
config/cs_auto_flags.sh | 858 +
config/cs_bft.m4 | 166 +
config/cs_blas.m4 | 353 +
config/cs_config_info.m4 | 125 +
config/cs_fvm.m4 | 194 +
config/cs_libxml2.m4 | 107 +
config/cs_mei.m4 | 109 +
config/cs_mpi.m4 | 260 +
config/cs_syrthes.m4 | 109 +
config/depcomp | 589 +
config/gettext.m4 | 381 +
config/iconv.m4 | 180 +
config/install-sh | 519 +
config/lib-ld.m4 | 110 +
config/lib-link.m4 | 709 +
config/lib-prefix.m4 | 185 +
config/libtool.m4 | 7357 +++++
config/ltmain.sh | 8406 +++++
config/ltoptions.m4 | 368 +
config/ltsugar.m4 | 123 +
config/ltversion.m4 | 23 +
config/lt~obsolete.m4 | 92 +
config/missing | 367 +
config/nls.m4 | 31 +
config/po.m4 | 449 +
config/progtest.m4 | 92 +
config/py-compile | 146 +
configure | 31615 +++++++++++++++++++
configure.ac | 584 +
cs_config.h.in | 204 +
data/mati/emm.dat | 287 +
data/mati/emm.geom | 246 +
data/mati/vault.dat | 325 +
data/mati/vault.geom | 263 +
data/thch/JANAF | 653 +
data/thch/dp_C3P | 18 +
data/thch/dp_C3PSJ | 30 +
data/thch/dp_C4P | 20 +
data/thch/dp_ELE | 259 +
data/thch/dp_FCP | 55 +
data/thch/dp_FUE | 38 +
data/thch/dp_transfo | 16 +
doc/Makefile.am | 31 +
doc/Makefile.in | 607 +
doc/howto/Makefile.am | 73 +
doc/howto/Makefile.in | 645 +
doc/howto/graphics/Makefile.am | 46 +
doc/howto/graphics/Makefile.in | 464 +
doc/howto/howto.tex | 87 +
doc/manpages/cs_check_consistency.1 | 58 +
doc/manpages/cs_check_mesh.1 | 149 +
doc/manpages/cs_compile.1 | 56 +
doc/manpages/cs_create.1 | 70 +
doc/manpages/cs_info.1 | 58 +
doc/manpages/cs_plot_probes.1 | 50 +
doc/manpages/cs_solver.1 | 89 +
doc/refcard/Makefile.am | 73 +
doc/refcard/Makefile.in | 645 +
doc/refcard/graphics/Makefile.am | 46 +
doc/refcard/graphics/Makefile.in | 464 +
doc/refcard/refcard.tex | 124 +
doc/style/csdoc.sty | 265 +
doc/style/csindex.sty | 35 +
doc/style/csmacros.sty | 111 +
doc/style/csvers.tex.in | 29 +
doc/style/logocs.png | Bin 0 -> 71551 bytes
doc/style/logoedf.png | Bin 0 -> 42848 bytes
doc/theory/Makefile.am | 104 +
doc/theory/Makefile.in | 677 +
doc/theory/bilsc2.tex | 635 +
doc/theory/cfbase.tex | 1059 +
doc/theory/cfener.tex | 427 +
doc/theory/cfmsvl.tex | 420 +
doc/theory/cfqdmv.tex | 289 +
doc/theory/cfxtcl.tex | 1819 ++
doc/theory/clptrg.tex | 816 +
doc/theory/clptur.tex | 1399 +
doc/theory/clsyvt.tex | 615 +
doc/theory/codits.tex | 391 +
doc/theory/combustion.tex | 196 +
doc/theory/condli.tex | 1199 +
doc/theory/covofi.tex | 1277 +
doc/theory/elbase.tex | 1351 +
doc/theory/gradmc.tex | 445 +
doc/theory/gradrc.tex | 644 +
doc/theory/graphics/Makefile.am | 65 +
doc/theory/graphics/Makefile.in | 483 +
doc/theory/graphics/bordortho.fig | 73 +
doc/theory/graphics/clthermique.dat | 300 +
doc/theory/graphics/clthermique.f | 12 +
doc/theory/graphics/clthermique.pdf | Bin 0 -> 5958 bytes
doc/theory/graphics/clthermique.xmgr | 736 +
doc/theory/graphics/condlimite.fig | 351 +
doc/theory/graphics/domaine1d.fig | 91 +
doc/theory/graphics/entree.fig | 116 +
doc/theory/graphics/facebord.fig | 33 +
doc/theory/graphics/facesym.fig | 113 +
doc/theory/graphics/facette.fig | 40 +
doc/theory/graphics/fluxbord.fig | 87 +
doc/theory/graphics/loilog.f | 8 +
doc/theory/graphics/loilog.pdf | Bin 0 -> 22317 bytes
doc/theory/graphics/loilog.xmgr | 10445 ++++++
doc/theory/graphics/support.fig | 50 +
doc/theory/inimas.tex | 233 +
doc/theory/introd.tex | 1012 +
doc/theory/itrmas.tex | 167 +
doc/theory/matrix.tex | 386 +
doc/theory/navsto.tex | 730 +
doc/theory/preduv.tex | 815 +
doc/theory/recvmc.tex | 186 +
doc/theory/resolp.tex | 525 +
doc/theory/summary.tex | 103 +
doc/theory/theory.tex | 159 +
doc/theory/turbke.tex | 534 +
doc/theory/turrij.tex | 955 +
doc/theory/viscfa.tex | 136 +
doc/theory/visort.tex | 195 +
doc/theory/vissec.tex | 195 +
doc/theory/vortex.tex | 445 +
doc/tutorial/Makefile.am | 92 +
doc/tutorial/Makefile.in | 668 +
doc/tutorial/case1.tex | 237 +
doc/tutorial/case2.tex | 387 +
doc/tutorial/case3.tex | 332 +
doc/tutorial/case4.tex | 364 +
doc/tutorial/case5.tex | 359 +
doc/tutorial/graphics/Makefile.am | 90 +
doc/tutorial/graphics/Makefile.in | 507 +
doc/tutorial/graphics/c1_capture01.jpg | Bin 0 -> 81837 bytes
doc/tutorial/graphics/c1_capture02.jpg | Bin 0 -> 82950 bytes
doc/tutorial/graphics/c1_capture03.jpg | Bin 0 -> 74018 bytes
doc/tutorial/graphics/c1_capture04.jpg | Bin 0 -> 91893 bytes
doc/tutorial/graphics/c1_capture05.jpg | Bin 0 -> 78951 bytes
doc/tutorial/graphics/c1_capture06.jpg | Bin 0 -> 78555 bytes
doc/tutorial/graphics/c1_capture07.jpg | Bin 0 -> 84472 bytes
doc/tutorial/graphics/c1_capture08.jpg | Bin 0 -> 67204 bytes
doc/tutorial/graphics/c1_capture09.jpg | Bin 0 -> 78259 bytes
doc/tutorial/graphics/c1_capture10.jpg | Bin 0 -> 69478 bytes
doc/tutorial/graphics/c1_capture11.jpg | Bin 0 -> 71693 bytes
doc/tutorial/graphics/c1_capture12.jpg | Bin 0 -> 69911 bytes
doc/tutorial/graphics/c1_capture13.jpg | Bin 0 -> 69205 bytes
doc/tutorial/graphics/c1_capture14.jpg | Bin 0 -> 87523 bytes
doc/tutorial/graphics/c1_capture15.jpg | Bin 0 -> 89818 bytes
doc/tutorial/graphics/c1_capture16.jpg | Bin 0 -> 90738 bytes
doc/tutorial/graphics/c1_capture17.jpg | Bin 0 -> 76209 bytes
doc/tutorial/graphics/c1_capture18.jpg | Bin 0 -> 89814 bytes
doc/tutorial/graphics/c1_capture19.jpg | Bin 0 -> 86324 bytes
doc/tutorial/graphics/c1_capture20.jpg | Bin 0 -> 94398 bytes
doc/tutorial/graphics/c1_capture21.jpg | Bin 0 -> 93784 bytes
doc/tutorial/graphics/c1_capture22.jpg | Bin 0 -> 93773 bytes
doc/tutorial/graphics/c1_capture23.jpg | Bin 0 -> 94149 bytes
doc/tutorial/graphics/c1_capture24.jpg | Bin 0 -> 101737 bytes
doc/tutorial/graphics/c1_capture25.jpg | Bin 0 -> 97951 bytes
doc/tutorial/graphics/c1_capture26.jpg | Bin 0 -> 85922 bytes
doc/tutorial/graphics/c1_capture27.jpg | Bin 0 -> 99037 bytes
doc/tutorial/graphics/c1_capture28.jpg | Bin 0 -> 89297 bytes
doc/tutorial/graphics/c1_capture29.jpg | Bin 0 -> 84859 bytes
doc/tutorial/graphics/c1_capture30.jpg | Bin 0 -> 95394 bytes
doc/tutorial/graphics/c1_capture31.jpg | Bin 0 -> 94190 bytes
doc/tutorial/graphics/c1_capture32.jpg | Bin 0 -> 85932 bytes
doc/tutorial/graphics/c1_capture33.jpg | Bin 0 -> 110744 bytes
doc/tutorial/graphics/c1_capture34.jpg | Bin 0 -> 109562 bytes
doc/tutorial/graphics/c1_capture35.jpg | Bin 0 -> 108929 bytes
doc/tutorial/graphics/c1_capture36.jpg | Bin 0 -> 102281 bytes
doc/tutorial/graphics/c1_capture37.jpg | Bin 0 -> 99877 bytes
doc/tutorial/graphics/c1_capture38.jpg | Bin 0 -> 103117 bytes
doc/tutorial/graphics/c1_capture39.jpg | Bin 0 -> 93936 bytes
doc/tutorial/graphics/c1_capture40.jpg | Bin 0 -> 89303 bytes
doc/tutorial/graphics/c1_capture41.jpg | Bin 0 -> 90937 bytes
doc/tutorial/graphics/c1_capture42.jpg | Bin 0 -> 110238 bytes
doc/tutorial/graphics/c1_capture43.jpg | Bin 0 -> 103061 bytes
doc/tutorial/graphics/c2_capture01.jpg | Bin 0 -> 77984 bytes
doc/tutorial/graphics/c2_capture02.jpg | Bin 0 -> 85994 bytes
doc/tutorial/graphics/c2_capture03.jpg | Bin 0 -> 92407 bytes
doc/tutorial/graphics/c2_capture04.jpg | Bin 0 -> 93377 bytes
doc/tutorial/graphics/c2_capture05.jpg | Bin 0 -> 87388 bytes
doc/tutorial/graphics/c2_capture06.jpg | Bin 0 -> 83439 bytes
doc/tutorial/graphics/c2_capture07.jpg | Bin 0 -> 70535 bytes
doc/tutorial/graphics/c2_capture08.jpg | Bin 0 -> 97867 bytes
doc/tutorial/graphics/c2_capture09.jpg | Bin 0 -> 86948 bytes
doc/tutorial/graphics/c2_capture10.jpg | Bin 0 -> 97985 bytes
doc/tutorial/graphics/c2_capture11.jpg | Bin 0 -> 98936 bytes
doc/tutorial/graphics/c2_capture12.jpg | Bin 0 -> 100202 bytes
doc/tutorial/graphics/c2_capture13.jpg | Bin 0 -> 107444 bytes
doc/tutorial/graphics/c2_capture14.jpg | Bin 0 -> 106415 bytes
doc/tutorial/graphics/c2_capture15.jpg | Bin 0 -> 108418 bytes
doc/tutorial/graphics/c2_capture152.jpg | Bin 0 -> 109097 bytes
doc/tutorial/graphics/c2_capture16.jpg | Bin 0 -> 109684 bytes
doc/tutorial/graphics/c2_capture17.jpg | Bin 0 -> 106669 bytes
doc/tutorial/graphics/c2_capture18.jpg | Bin 0 -> 107170 bytes
doc/tutorial/graphics/c2_capture19.jpg | Bin 0 -> 107151 bytes
doc/tutorial/graphics/c2_capture20.jpg | Bin 0 -> 107021 bytes
doc/tutorial/graphics/c2_capture21.jpg | Bin 0 -> 107372 bytes
doc/tutorial/graphics/c2_capture212.jpg | Bin 0 -> 107488 bytes
doc/tutorial/graphics/c2_capture22.jpg | Bin 0 -> 106995 bytes
doc/tutorial/graphics/c2_capture23.jpg | Bin 0 -> 95922 bytes
doc/tutorial/graphics/c2_capture24.jpg | Bin 0 -> 110505 bytes
doc/tutorial/graphics/c2_capture25.jpg | Bin 0 -> 99713 bytes
doc/tutorial/graphics/c2_capture26.jpg | Bin 0 -> 100493 bytes
doc/tutorial/graphics/c2_capture27.jpg | Bin 0 -> 101182 bytes
doc/tutorial/graphics/c2_capture28.jpg | Bin 0 -> 106528 bytes
doc/tutorial/graphics/c2_capture29.jpg | Bin 0 -> 112288 bytes
doc/tutorial/graphics/c2_capture30.jpg | Bin 0 -> 110373 bytes
doc/tutorial/graphics/c2_p1.jpg | Bin 0 -> 106831 bytes
doc/tutorial/graphics/c2_p2.jpg | Bin 0 -> 123222 bytes
doc/tutorial/graphics/c2_p3.jpg | Bin 0 -> 120243 bytes
doc/tutorial/graphics/c2_p4.jpg | Bin 0 -> 112784 bytes
doc/tutorial/graphics/c2_p5.jpg | Bin 0 -> 116241 bytes
doc/tutorial/graphics/c2_p6.jpg | Bin 0 -> 121499 bytes
doc/tutorial/graphics/c2_p7.jpg | Bin 0 -> 49736 bytes
doc/tutorial/graphics/c3_capture01.jpg | Bin 0 -> 89525 bytes
doc/tutorial/graphics/c3_capture02.jpg | Bin 0 -> 82631 bytes
doc/tutorial/graphics/c3_capture03.jpg | Bin 0 -> 105847 bytes
doc/tutorial/graphics/c3_capture04.jpg | Bin 0 -> 65600 bytes
doc/tutorial/graphics/c3_capture05.jpg | Bin 0 -> 84334 bytes
doc/tutorial/graphics/c3_capture06.jpg | Bin 0 -> 83782 bytes
doc/tutorial/graphics/c4_capture01.jpg | Bin 0 -> 102332 bytes
doc/tutorial/graphics/c4_capture02.jpg | Bin 0 -> 107539 bytes
doc/tutorial/graphics/c5_capture01.jpg | Bin 0 -> 87263 bytes
doc/tutorial/graphics/c5_capture02.jpg | Bin 0 -> 87993 bytes
doc/tutorial/graphics/c5_capture03.jpg | Bin 0 -> 83137 bytes
doc/tutorial/graphics/c5_capture04.jpg | Bin 0 -> 96374 bytes
doc/tutorial/graphics/c5_capture05.jpg | Bin 0 -> 98886 bytes
doc/tutorial/graphics/c5_capture06.jpg | Bin 0 -> 91631 bytes
doc/tutorial/graphics/c5_capture07.jpg | Bin 0 -> 101077 bytes
doc/tutorial/graphics/c5_capture08.jpg | Bin 0 -> 101728 bytes
doc/tutorial/graphics/c5_capture09.jpg | Bin 0 -> 96830 bytes
doc/tutorial/graphics/c5_capture10.jpg | Bin 0 -> 96680 bytes
doc/tutorial/graphics/c5_capture11.jpg | Bin 0 -> 105915 bytes
doc/tutorial/graphics/c5_capture12.jpg | Bin 0 -> 109385 bytes
doc/tutorial/graphics/c5_capture13.jpg | Bin 0 -> 106832 bytes
doc/tutorial/graphics/c5_config.jpg | Bin 0 -> 39021 bytes
doc/tutorial/graphics/capture10.jpg | Bin 0 -> 96680 bytes
doc/tutorial/graphics/capture11.jpg | Bin 0 -> 105915 bytes
doc/tutorial/graphics/capture12.jpg | Bin 0 -> 109385 bytes
doc/tutorial/graphics/capture13.jpg | Bin 0 -> 106832 bytes
doc/tutorial/graphics/cas1_t_1.jpg | Bin 0 -> 25357 bytes
doc/tutorial/graphics/cas1_t_10.jpg | Bin 0 -> 23686 bytes
doc/tutorial/graphics/cas1_t_20.jpg | Bin 0 -> 24624 bytes
doc/tutorial/graphics/cas1_t_29.jpg | Bin 0 -> 24013 bytes
doc/tutorial/graphics/case3.cmd | 734 +
doc/tutorial/graphics/case3_p1.jpg | Bin 0 -> 39130 bytes
doc/tutorial/graphics/case3_p10.jpg | Bin 0 -> 41595 bytes
doc/tutorial/graphics/case3_p2.jpg | Bin 0 -> 39738 bytes
doc/tutorial/graphics/case3_p3.jpg | Bin 0 -> 36178 bytes
doc/tutorial/graphics/case3_p4.jpg | Bin 0 -> 35238 bytes
doc/tutorial/graphics/case3_p5.jpg | Bin 0 -> 32921 bytes
doc/tutorial/graphics/case3_p6.jpg | Bin 0 -> 33660 bytes
doc/tutorial/graphics/case3_p7.jpg | Bin 0 -> 34955 bytes
doc/tutorial/graphics/case3_p8.jpg | Bin 0 -> 38515 bytes
doc/tutorial/graphics/case3_p9.jpg | Bin 0 -> 39979 bytes
doc/tutorial/graphics/case4_p1.jpg | Bin 0 -> 114211 bytes
doc/tutorial/graphics/case4_p2.jpg | Bin 0 -> 108597 bytes
doc/tutorial/graphics/case4_p3.jpg | Bin 0 -> 105089 bytes
doc/tutorial/graphics/case4_p4.jpg | Bin 0 -> 104141 bytes
doc/tutorial/graphics/case4_p5.jpg | Bin 0 -> 105738 bytes
doc/tutorial/graphics/case4_p6.jpg | Bin 0 -> 106987 bytes
doc/tutorial/graphics/case5_01.jpg | Bin 0 -> 19206 bytes
doc/tutorial/graphics/case5_02.jpg | Bin 0 -> 18914 bytes
doc/tutorial/graphics/case5_03.jpg | Bin 0 -> 28373 bytes
doc/tutorial/graphics/case5_04.jpg | Bin 0 -> 23288 bytes
doc/tutorial/graphics/case5_05.jpg | Bin 0 -> 21388 bytes
doc/tutorial/graphics/case5_06.jpg | Bin 0 -> 23150 bytes
doc/tutorial/graphics/case5_07.jpg | Bin 0 -> 22624 bytes
doc/tutorial/graphics/case5_08.jpg | Bin 0 -> 23758 bytes
doc/tutorial/graphics/case5_09.jpg | Bin 0 -> 23463 bytes
doc/tutorial/graphics/color_Snimbus.jpg | Bin 0 -> 10447 bytes
doc/tutorial/graphics/evotemp_case3.agr | 7585 +++++
doc/tutorial/graphics/evotemp_case3.png | Bin 0 -> 11659 bytes
doc/tutorial/graphics/fig01.jpg | Bin 0 -> 17933 bytes
doc/tutorial/graphics/fig02.jpg | Bin 0 -> 76580 bytes
doc/tutorial/graphics/fig03.jpg | Bin 0 -> 6275 bytes
doc/tutorial/graphics/fig04.jpg | Bin 0 -> 70934 bytes
doc/tutorial/graphics/fig05.jpg | Bin 0 -> 115053 bytes
doc/tutorial/graphics/fig06.jpg | Bin 0 -> 16841 bytes
doc/tutorial/graphics/fig07.jpg | Bin 0 -> 67760 bytes
doc/tutorial/graphics/fig08.jpg | Bin 0 -> 69445 bytes
doc/tutorial/graphics/fig09.jpg | Bin 0 -> 70599 bytes
doc/tutorial/graphics/moytemp.png | Bin 0 -> 3790 bytes
doc/tutorial/graphics/probe9.agr | 701 +
doc/tutorial/graphics/probe9.png | Bin 0 -> 6115 bytes
doc/tutorial/intro.tex | 69 +
doc/tutorial/tuto_case1.tex | 744 +
doc/tutorial/tuto_case2.tex | 434 +
doc/tutorial/tuto_case3.tex | 215 +
doc/tutorial/tuto_case4.tex | 78 +
doc/tutorial/tuto_case5.tex | 348 +
doc/tutorial/tutorial.tex | 133 +
doc/user/Makefile.am | 86 +
doc/user/Makefile.in | 660 +
doc/user/a1_autovalid.tex | 257 +
doc/user/biblio.tex | 106 +
doc/user/graphics/Makefile.am | 58 +
doc/user/graphics/Makefile.in | 476 +
doc/user/graphics/cs_components.fig | 655 +
doc/user/graphics/halo.pdf | Bin 0 -> 20605 bytes
doc/user/graphics/rota_perio_parall.jpg | Bin 0 -> 49785 bytes
doc/user/graphics/vortex.fig | 36 +
doc/user/input/addstudy.xml | 8 +
doc/user/input/autovalid.xml | 31 +
doc/user/saturne1.tex | 7678 +++++
doc/user/saturne2.tex | 3751 +++
doc/user/summary.tex | 94 +
doc/user/user.tex | 117 +
examples/1-simple_junction/case1/case1.xml | 183 +
examples/1-simple_junction/case1/runcase | 1125 +
examples/1-simple_junction/mesh/downcomer.des | Bin 0 -> 128292 bytes
examples/2-full_domain/case2/case2.xml | 322 +
examples/2-full_domain/case2/lance | 1612 +
examples/2-full_domain/case2/runcase | 1125 +
examples/2-full_domain/case3/case3.xml | 322 +
examples/2-full_domain/case3/runcase | 1125 +
examples/2-full_domain/case3/usclim.f90 | 578 +
examples/2-full_domain/case3/usphyv.f90 | 313 +
examples/2-full_domain/case4/case4.xml | 322 +
examples/2-full_domain/case4/runcase | 1125 +
examples/2-full_domain/case4/usclim.f90 | 578 +
examples/2-full_domain/case4/uskpdc.f90 | 409 +
examples/2-full_domain/case4/usphyv.f90 | 313 +
examples/2-full_domain/case4/usproj.f90 | 342 +
examples/2-full_domain/mesh/downcomer.des | Bin 0 -> 128292 bytes
examples/2-full_domain/mesh/fdc.des | Bin 0 -> 145812 bytes
examples/2-full_domain/mesh/pic.des | Bin 0 -> 27972 bytes
examples/3-stratified_junction/case5/case5.xml | 227 +
examples/3-stratified_junction/case5/runcase | 1125 +
examples/3-stratified_junction/case5/usdpst.f90 | 403 +
examples/3-stratified_junction/case5/usmpst.f90 | 270 +
examples/3-stratified_junction/case5/usphyv.f90 | 403 +
examples/3-stratified_junction/case5/usvpst.f90 | 431 +
examples/3-stratified_junction/mesh/sn_total.des | Bin 0 -> 1570788 bytes
extras/cs_component.py | 74 +
extras/validation/Autovalidation/Case.py | 550 +
extras/validation/Autovalidation/Chrono.py | 294 +
extras/validation/Autovalidation/CommandLine.py | 98 +
extras/validation/Autovalidation/Common.py | 34 +
extras/validation/Autovalidation/Listing.py | 129 +
extras/validation/Autovalidation/Parser.py | 181 +
extras/validation/Autovalidation/Study.py | 103 +
extras/validation/Autovalidation/__init__.py | 0
extras/validation/autovalid | 129 +
extras/validation/autovalid.xml | 90 +
gui/AUTHORS | 29 +
gui/Base/BrowserForm.ui | 27 +
gui/Base/BrowserView.py | 800 +
gui/Base/CommandLine.py | 209 +
gui/Base/Common.py | 68 +
gui/Base/IdForm.ui | 71 +
gui/Base/IdView.py | 114 +
gui/Base/MainForm.ui | 427 +
gui/Base/MainView.py | 1036 +
gui/Base/Makefile.am | 48 +
gui/Base/Makefile.in | 510 +
gui/Base/QtPage.py | 585 +
gui/Base/Toolbox.py | 374 +
gui/Base/XMLengine.py | 1877 ++
gui/Base/XMLinitialize.py | 324 +
gui/Base/XMLmodel.py | 242 +
gui/Base/XMLvariables.py | 704 +
gui/Base/__init__.py | 48 +
gui/Base/icons/22x22/application-certificate.png | Bin 0 -> 1289 bytes
gui/Base/icons/22x22/document-new.png | Bin 0 -> 692 bytes
gui/Base/icons/22x22/document-open.png | Bin 0 -> 1001 bytes
gui/Base/icons/22x22/document-properties.png | Bin 0 -> 688 bytes
gui/Base/icons/22x22/document-save-as.png | Bin 0 -> 1097 bytes
gui/Base/icons/22x22/document-save.png | Bin 0 -> 1150 bytes
gui/Base/icons/22x22/format-justify-fill.png | Bin 0 -> 495 bytes
gui/Base/icons/22x22/help-browser.png | Bin 0 -> 1359 bytes
gui/Base/icons/22x22/preferences-desktop-font.png | Bin 0 -> 882 bytes
.../icons/22x22/preferences-desktop-wallpaper.png | Bin 0 -> 1017 bytes
gui/Base/icons/22x22/process-stop.png | Bin 0 -> 1272 bytes
gui/Base/icons/22x22/system-log-out.png | Bin 0 -> 1084 bytes
gui/Base/icons/22x22/utilities-terminal.png | Bin 0 -> 1026 bytes
gui/Base/icons/22x22/view-refresh.png | Bin 0 -> 1364 bytes
gui/Base/icons/22x22/x-office-address-book.png | Bin 0 -> 860 bytes
gui/Base/icons/LICENSE.Tango | 97 +
gui/Base/icons/SplashScreen/logocs.png | Bin 0 -> 71551 bytes
gui/Base/resource_base.qrc | 18 +
gui/Makefile.am | 35 +
gui/Makefile.in | 679 +
gui/Pages/AnalysisFeaturesForm.ui | 357 +
gui/Pages/AnalysisFeaturesView.py | 481 +
gui/Pages/AtmosphericFlowsForm.ui | 137 +
gui/Pages/AtmosphericFlowsModel.py | 342 +
gui/Pages/AtmosphericFlowsView.py | 148 +
gui/Pages/BatchRunningAdvancedOptionsDialogForm.ui | 482 +
gui/Pages/BatchRunningForm.ui | 396 +
gui/Pages/BatchRunningModel.py | 705 +
.../BatchRunningPBSJobManagementDialogForm.ui | 255 +
gui/Pages/BatchRunningUserFilesDialogForm.ui | 271 +
gui/Pages/BatchRunningView.py | 1149 +
gui/Pages/BodyForcesForm.ui | 273 +
gui/Pages/BodyForcesModel.py | 194 +
gui/Pages/BodyForcesView.py | 181 +
gui/Pages/Boundary.py | 3707 +++
gui/Pages/BoundaryConditionsCoalInletForm.ui | 554 +
gui/Pages/BoundaryConditionsCoalInletView.py | 739 +
gui/Pages/BoundaryConditionsForm.ui | 183 +
gui/Pages/BoundaryConditionsMeteoForm.ui | 73 +
gui/Pages/BoundaryConditionsMeteoView.py | 180 +
gui/Pages/BoundaryConditionsMobileMeshForm.ui | 98 +
gui/Pages/BoundaryConditionsMobileMeshView.py | 201 +
gui/Pages/BoundaryConditionsParticlesModel.py | 755 +
gui/Pages/BoundaryConditionsParticlesView.py | 828 +
gui/Pages/BoundaryConditionsRoughWallForm.ui | 149 +
gui/Pages/BoundaryConditionsRoughWallView.py | 164 +
gui/Pages/BoundaryConditionsScalarsForm.ui | 39 +
gui/Pages/BoundaryConditionsScalarsView.py | 414 +
gui/Pages/BoundaryConditionsSlidingWallForm.ui | 189 +
gui/Pages/BoundaryConditionsSlidingWallView.py | 211 +
gui/Pages/BoundaryConditionsTurbulenceInletForm.ui | 211 +
gui/Pages/BoundaryConditionsTurbulenceInletView.py | 194 +
gui/Pages/BoundaryConditionsVelocityInletForm.ui | 316 +
gui/Pages/BoundaryConditionsVelocityInletView.py | 391 +
gui/Pages/BoundaryConditionsView.py | 267 +
.../BoundaryConditionsWallRadiativeTransferForm.ui | 186 +
.../BoundaryConditionsWallRadiativeTransferView.py | 299 +
gui/Pages/CoalCombustionForm.ui | 1287 +
gui/Pages/CoalCombustionModel.py | 1197 +
gui/Pages/CoalCombustionView.py | 1269 +
gui/Pages/CoalThermoChemistry.py | 1702 +
gui/Pages/CommonCombustion.py | 158 +
gui/Pages/CurrentSpeciesForm.ui | 207 +
gui/Pages/CurrentSpeciesModel.py | 107 +
gui/Pages/CurrentSpeciesView.py | 279 +
gui/Pages/DefineUserScalarsForm.ui | 166 +
gui/Pages/DefineUserScalarsModel.py | 992 +
gui/Pages/DefineUserScalarsView.py | 619 +
gui/Pages/ElectricalModelsModel.py | 192 +
gui/Pages/FacesSelectionForm.ui | 108 +
gui/Pages/FacesSelectionView.py | 475 +
gui/Pages/FluidCharacteristicsForm.ui | 628 +
gui/Pages/FluidCharacteristicsModel.py | 453 +
gui/Pages/FluidCharacteristicsView.py | 420 +
...tructureInteractionAdvancedOptionsDialogForm.ui | 329 +
gui/Pages/FluidStructureInteractionForm.ui | 1146 +
gui/Pages/FluidStructureInteractionModel.py | 443 +
gui/Pages/FluidStructureInteractionView.py | 859 +
gui/Pages/GasCombustionModel.py | 192 +
gui/Pages/HeadLossesForm.ui | 501 +
gui/Pages/HeadLossesModel.py | 420 +
gui/Pages/HeadLossesView.py | 223 +
gui/Pages/IdentityAndPathesForm.ui | 252 +
gui/Pages/IdentityAndPathesModel.py | 200 +
gui/Pages/IdentityAndPathesView.py | 241 +
gui/Pages/InitializationForm.ui | 837 +
gui/Pages/InitializationModel.py | 576 +
gui/Pages/InitializationView.py | 721 +
gui/Pages/LagrangianAdvancedOptionsDialogForm.ui | 307 +
gui/Pages/LagrangianBoundariesForm.ui | 1152 +
gui/Pages/LagrangianBoundariesModel.py | 740 +
gui/Pages/LagrangianBoundariesView.py | 827 +
gui/Pages/LagrangianForm.ui | 694 +
gui/Pages/LagrangianModel.py | 1241 +
gui/Pages/LagrangianOutputForm.ui | 584 +
gui/Pages/LagrangianOutputModel.py | 876 +
gui/Pages/LagrangianOutputView.py | 474 +
gui/Pages/LagrangianStatisticsForm.ui | 360 +
gui/Pages/LagrangianStatisticsModel.py | 469 +
gui/Pages/LagrangianStatisticsView.py | 553 +
gui/Pages/LagrangianView.py | 781 +
gui/Pages/LocalizationForm.ui | 189 +
gui/Pages/LocalizationModel.py | 1154 +
gui/Pages/LocalizationView.py | 881 +
gui/Pages/Makefile.am | 212 +
gui/Pages/Makefile.in | 673 +
gui/Pages/MatisseCustomForm.ui | 174 +
gui/Pages/MatisseCustomView.py | 979 +
gui/Pages/MatisseGeomForm.ui | 41 +
gui/Pages/MatisseGeomModel.py | 394 +
gui/Pages/MatisseGeomView.py | 389 +
gui/Pages/MatisseHydrauForm.ui | 41 +
gui/Pages/MatisseHydrauModel.py | 216 +
gui/Pages/MatisseHydrauView.py | 327 +
gui/Pages/MatisseModel.py | 374 +
gui/Pages/MatisseNetworkForm.ui | 213 +
gui/Pages/MatisseNetworkModel.py | 272 +
gui/Pages/MatisseNetworkView.py | 218 +
gui/Pages/MatisseRangeDescriptionForm.ui | 69 +
gui/Pages/MatisseRangeDescriptionModel.py | 229 +
gui/Pages/MatisseRangeDescriptionView.py | 110 +
gui/Pages/MatisseThermicForm.ui | 130 +
gui/Pages/MatisseThermicModel.py | 405 +
gui/Pages/MatisseThermicView.py | 279 +
gui/Pages/MatisseTypeForm.ui | 47 +
gui/Pages/MatisseTypeModel.py | 163 +
gui/Pages/MatisseTypeView.py | 128 +
gui/Pages/MemoryAllocationForm.ui | 336 +
gui/Pages/MemoryAllocationModel.py | 357 +
gui/Pages/MemoryAllocationView.py | 236 +
gui/Pages/MeshQualityCriteriaLogDialogForm.ui | 90 +
gui/Pages/MobileMeshForm.ui | 256 +
gui/Pages/MobileMeshModel.py | 438 +
gui/Pages/MobileMeshView.py | 244 +
gui/Pages/NumericalParamEquationForm.ui | 86 +
gui/Pages/NumericalParamEquationModel.py | 694 +
gui/Pages/NumericalParamEquationView.py | 550 +
gui/Pages/NumericalParamGlobalForm.ui | 701 +
gui/Pages/NumericalParamGlobalModel.py | 434 +
gui/Pages/NumericalParamGlobalView.py | 243 +
gui/Pages/OutputControlForm.ui | 690 +
gui/Pages/OutputControlModel.py | 632 +
gui/Pages/OutputControlView.py | 748 +
gui/Pages/OutputSurfacicVariablesForm.ui | 75 +
gui/Pages/OutputSurfacicVariablesModel.py | 256 +
gui/Pages/OutputSurfacicVariablesView.py | 229 +
gui/Pages/OutputVolumicVariablesForm.ui | 32 +
gui/Pages/OutputVolumicVariablesModel.py | 609 +
gui/Pages/OutputVolumicVariablesView.py | 465 +
gui/Pages/PreProcessingInformationsView.py | 230 +
gui/Pages/ProfilesForm.ui | 351 +
gui/Pages/ProfilesModel.py | 430 +
gui/Pages/ProfilesView.py | 625 +
gui/Pages/QMeiEditorForm.ui | 147 +
gui/Pages/QMeiEditorView.py | 337 +
gui/Pages/ReferenceValuesForm.ui | 299 +
gui/Pages/ReferenceValuesModel.py | 287 +
gui/Pages/ReferenceValuesView.py | 176 +
gui/Pages/SalomeHandler.py | 276 +
gui/Pages/SolutionDomainForm.ui | 1136 +
gui/Pages/SolutionDomainMeshFormatDialogForm.ui | 138 +
gui/Pages/SolutionDomainModel.py | 2572 ++
gui/Pages/SolutionDomainView.py | 1319 +
gui/Pages/SolutionVerifForm.ui | 383 +
gui/Pages/SolutionVerifView.py | 544 +
gui/Pages/StartRestartAdvancedDialogForm.ui | 191 +
gui/Pages/StartRestartForm.ui | 421 +
gui/Pages/StartRestartModel.py | 394 +
gui/Pages/StartRestartView.py | 393 +
gui/Pages/SteadyManagementForm.ui | 172 +
gui/Pages/SteadyManagementModel.py | 259 +
gui/Pages/SteadyManagementView.py | 164 +
gui/Pages/SyrthesForm.ui | 241 +
gui/Pages/SyrthesView.py | 195 +
gui/Pages/ThermalRadiationAdvancedDialogForm.ui | 271 +
gui/Pages/ThermalRadiationForm.ui | 465 +
gui/Pages/ThermalRadiationModel.py | 851 +
gui/Pages/ThermalRadiationView.py | 373 +
gui/Pages/ThermalScalarForm.ui | 103 +
gui/Pages/ThermalScalarModel.py | 247 +
gui/Pages/ThermalScalarView.py | 136 +
gui/Pages/TimeAveragesForm.ui | 295 +
gui/Pages/TimeAveragesModel.py | 391 +
gui/Pages/TimeAveragesView.py | 490 +
gui/Pages/TimeStepForm.ui | 561 +
gui/Pages/TimeStepModel.py | 671 +
gui/Pages/TimeStepView.py | 305 +
gui/Pages/TurbulenceAdvancedOptionsDialogForm.ui | 236 +
gui/Pages/TurbulenceForm.ui | 249 +
gui/Pages/TurbulenceModel.py | 615 +
gui/Pages/TurbulenceView.py | 294 +
gui/Pages/UserArraysForm.ui | 336 +
gui/Pages/UserArraysModel.py | 352 +
gui/Pages/UserArraysView.py | 236 +
gui/Pages/UserScalarPropertiesForm.ui | 99 +
gui/Pages/UserScalarPropertiesView.py | 382 +
gui/Pages/VerifyExistenceLabelDialogForm.ui | 91 +
gui/Pages/VerifyExistenceLabelDialogView.py | 118 +
gui/Pages/WelcomeForm.ui | 128 +
gui/Pages/WelcomeView.py | 64 +
gui/Pages/__init__.py | 45 +
gui/Pages/icons/22x22/bookmark-new.png | Bin 0 -> 939 bytes
gui/Pages/icons/22x22/document-new.png | Bin 0 -> 692 bytes
gui/Pages/icons/22x22/document-open.png | Bin 0 -> 1001 bytes
gui/Pages/icons/22x22/edit-find-replace.png | Bin 0 -> 1088 bytes
gui/Pages/icons/22x22/folder-open.png | Bin 0 -> 803 bytes
gui/Pages/icons/22x22/network-server.png | Bin 0 -> 878 bytes
gui/Pages/icons/22x22/preferences-system.png | Bin 0 -> 1151 bytes
gui/Pages/icons/22x22/user-trash-full.png | Bin 0 -> 1419 bytes
gui/Pages/icons/22x22/weather-few-clouds.png | Bin 0 -> 1191 bytes
gui/Pages/icons/32x32/go-next.png | Bin 0 -> 1219 bytes
gui/Pages/icons/welcome.gif | Bin 0 -> 103070 bytes
gui/Pages/resources_pages.qrc | 15 +
gui/VERSION | 1 +
gui/__init__.py | 39 +
gui/cs_gui.py | 143 +
gui/epydocConfig | 42 +
gui/sbin/mkpyqt.py | 270 +
gui/sbin/unittests.py | 279 +
gui/setup.py | 115 +
include/atmo/atincl.h | 155 +
include/base/alaste.h | 54 +
include/base/albase.h | 59 +
include/base/alstru.h | 87 +
include/base/cplsat.h | 53 +
include/base/cs_ale.h | 129 +
include/base/cs_ast_coupling.h | 205 +
include/base/cs_base.h | 485 +
include/base/cs_benchmark.h | 72 +
include/base/cs_blas.h | 282 +
include/base/cs_boundary_conditions.h | 126 +
include/base/cs_calcium.h | 275 +
include/base/cs_coupling.h | 108 +
include/base/cs_ext_neighborhood.h | 119 +
include/base/cs_gradient.h | 177 +
include/base/cs_grid.h | 312 +
include/base/cs_gui.h | 571 +
include/base/cs_gui_boundary_conditions.h | 312 +
include/base/cs_gui_matisse.h | 133 +
include/base/cs_gui_mobile_mesh.h | 245 +
include/base/cs_gui_particles.h | 231 +
include/base/cs_gui_radiative_transfer.h | 165 +
include/base/cs_gui_specific_physics.h | 265 +
include/base/cs_gui_util.h | 373 +
include/base/cs_gui_variables.h | 103 +
include/base/cs_halo.h | 356 +
include/base/cs_io.h | 545 +
include/base/cs_join.h | 144 +
include/base/cs_join_intersect.h | 345 +
include/base/cs_join_merge.h | 152 +
include/base/cs_join_mesh.h | 509 +
include/base/cs_join_post.h | 174 +
include/base/cs_join_set.h | 427 +
include/base/cs_join_split.h | 97 +
include/base/cs_join_update.h | 125 +
include/base/cs_join_util.h | 369 +
include/base/cs_matrix.h | 274 +
include/base/cs_mesh.h | 382 +
include/base/cs_mesh_coherency.h | 60 +
include/base/cs_mesh_connect.h | 153 +
include/base/cs_mesh_halo.h | 76 +
include/base/cs_mesh_quality.h | 95 +
include/base/cs_mesh_quantities.h | 205 +
include/base/cs_mesh_solcom.h | 127 +
include/base/cs_mesh_warping.h | 78 +
include/base/cs_multigrid.h | 161 +
include/base/cs_numbering.h | 160 +
include/base/cs_opts.h | 151 +
include/base/cs_parall.h | 599 +
include/base/cs_perio.h | 636 +
include/base/cs_post.h | 971 +
include/base/cs_preprocessor_data.h | 102 +
include/base/cs_prototypes.h | 720 +
include/base/cs_proxy_comm.h | 208 +
include/base/cs_renumber.h | 78 +
include/base/cs_restart.h | 415 +
include/base/cs_sat_coupling.h | 428 +
include/base/cs_search.h | 117 +
include/base/cs_selector.h | 137 +
include/base/cs_sles.h | 260 +
include/base/cs_sort.h | 137 +
include/base/cs_syr3_comm.h | 209 +
include/base/cs_syr3_coupling.h | 284 +
include/base/cs_syr3_messages.h | 127 +
include/base/cs_syr4_coupling.h | 255 +
include/base/cs_syr_coupling.h | 347 +
include/base/cs_tpar1d.h | 204 +
include/base/cs_ventil.h | 293 +
include/base/cstnum.h | 35 +
include/base/cstphy.h | 200 +
include/base/dimens.h | 50 +
include/base/dimfbr.h | 36 +
include/base/entsor.h | 341 +
include/base/ihmpre.h | 39 +
include/base/mltgrd.h | 46 +
include/base/numvar.h | 129 +
include/base/optcal.h | 617 +
include/base/parall.h | 64 +
include/base/paramx.h | 183 +
include/base/period.h | 44 +
include/base/pointe.h | 148 +
include/base/tcpumx.h | 71 +
include/base/tremai.h | 71 +
include/base/vector.h | 35 +
include/base/vortex.h | 178 +
include/cfbl/cfpoin.h | 45 +
include/cogz/coincl.h | 137 +
include/cplv/cpincl.h | 315 +
include/ctwr/cs_ctwr.h | 618 +
include/ctwr/cs_ctwr_air_props.h | 218 +
include/ctwr/cs_ctwr_halo.h | 85 +
include/ctwr/cs_ctwr_mesh.h | 104 +
include/ctwr/ctincl.h | 53 +
include/elec/elincl.h | 165 +
include/fuel/fuincl.h | 203 +
include/lagr/cs_lagr.h | 130 +
include/lagr/cs_lagr_perio.h | 113 +
include/lagr/lagdim.h | 84 +
include/lagr/lagpar.h | 152 +
include/lagr/lagran.h | 659 +
include/mati/matiss.h | 338 +
include/pprt/ppcpfu.h | 98 +
include/pprt/ppincl.h | 340 +
include/pprt/ppppar.h | 54 +
include/pprt/ppthch.h | 101 +
include/rayt/radiat.h | 217 +
libsyrcs/Makefile.am | 40 +
libsyrcs/Makefile.in | 601 +
libsyrcs/syr_comm.c | 1718 +
libsyrcs/syr_comm.h | 204 +
libsyrcs/syr_coupling.c | 1002 +
libsyrcs/syr_coupling.h | 143 +
libsyrcs/syr_cs.c | 686 +
libsyrcs/syr_defs.c | 582 +
libsyrcs/syr_defs.h | 183 +
patches/README | 7 +
po/LINGUAS | 3 +
po/Makefile.in.in | 429 +
po/Makevars | 41 +
po/Makevars.template | 41 +
po/POTFILES.in | 70 +
po/Rules-install | 3 +
po/Rules-quot | 47 +
po/boldquot.sed | 10 +
po/en at boldquot.header | 25 +
po/en at quot.header | 22 +
po/fr.po | 5097 +++
po/insert-header.sin | 23 +
po/quot.sed | 6 +
po/remove-potcdate.sin | 19 +
sbin/backup | 58 +
sbin/bootstrap | 49 +
sbin/clean | 9 +
sbin/rmb | 23 +
src/Makefile.am | 23 +
src/Makefile.in | 599 +
src/apps/Makefile.am | 66 +
src/apps/Makefile.in | 674 +
src/apps/cs_solver.c | 651 +
src/atmo/Makefile.am | 65 +
src/atmo/Makefile.in | 626 +
src/atmo/atini1.f90 | 272 +
src/atmo/atiniv.f90 | 274 +
src/atmo/atlecm.f90 | 553 +
src/atmo/atmcls.f90 | 350 +
src/atmo/atphyv.f90 | 367 +
src/atmo/atprke.f90 | 295 +
src/atmo/atprop.f90 | 163 +
src/atmo/attycl.f90 | 396 +
src/atmo/atvarp.f90 | 144 +
src/atmo/intprf.f90 | 150 +
src/atmo/mematm.f90 | 153 +
src/base/Makefile.am | 477 +
src/base/Makefile.in | 1161 +
src/base/alelap.f90 | 365 +
src/base/alemaj.f90 | 291 +
src/base/altycl.f90 | 533 +
src/base/armtps.f90 | 309 +
src/base/autmgr.f90 | 376 +
src/base/bilsc2.f90 | 1360 +
src/base/calgeo.f90 | 239 +
src/base/calhyd.f90 | 606 +
src/base/calmom.f90 | 180 +
src/base/caltri.f90 | 1862 ++
src/base/catsma.f90 | 147 +
src/base/causta.f90 | 209 +
src/base/clca66.f90 | 182 +
src/base/cldijp.f90 | 239 +
src/base/cldipo.f90 | 202 +
src/base/clipke.f90 | 304 +
src/base/clprij.f90 | 290 +
src/base/clpsca.f90 | 242 +
src/base/clptrg.f90 | 1210 +
src/base/clptur.f90 | 1539 +
src/base/clpv2f.f90 | 172 +
src/base/clsurn.f90 | 124 +
src/base/clsyvt.f90 | 530 +
src/base/clvolc.f90 | 190 +
src/base/codits.f90 | 757 +
src/base/condli.f90 | 1873 ++
src/base/cou1di.f90 | 176 +
src/base/cou1do.f90 | 300 +
src/base/coupbi.f90 | 294 +
src/base/coupbo.f90 | 339 +
src/base/covofi.f90 | 909 +
src/base/cregeo.f90 | 285 +
src/base/crstgr.f90 | 558 +
src/base/cs_ale.c | 289 +
src/base/cs_ast_coupling.c | 674 +
src/base/cs_base.c | 1639 +
src/base/cs_benchmark.c | 1649 +
src/base/cs_blas.c | 521 +
src/base/cs_boundary_conditions.c | 437 +
src/base/cs_calcium.c | 1274 +
src/base/cs_coupling.c | 190 +
src/base/cs_ext_neighborhood.c | 1363 +
src/base/cs_gradient.c | 636 +
src/base/cs_grid.c | 1773 ++
src/base/cs_gui.c | 5077 +++
src/base/cs_gui_boundary_conditions.c | 1973 ++
src/base/cs_gui_matisse.c | 567 +
src/base/cs_gui_mobile_mesh.c | 1321 +
src/base/cs_gui_particles.c | 1647 +
src/base/cs_gui_radiative_transfer.c | 1178 +
src/base/cs_gui_specific_physics.c | 986 +
src/base/cs_gui_util.c | 1099 +
src/base/cs_halo.c | 1268 +
src/base/cs_io.c | 3156 ++
src/base/cs_join.c | 1733 +
src/base/cs_join_f2c.f90 | 89 +
src/base/cs_join_intersect.c | 3129 ++
src/base/cs_join_merge.c | 3086 ++
src/base/cs_join_mesh.c | 3111 ++
src/base/cs_join_post.c | 728 +
src/base/cs_join_set.c | 1868 ++
src/base/cs_join_split.c | 2223 ++
src/base/cs_join_update.c | 3863 +++
src/base/cs_join_util.c | 2467 ++
src/base/cs_matrix.c | 2926 ++
src/base/cs_mesh.c | 1462 +
src/base/cs_mesh_coherency.c | 435 +
src/base/cs_mesh_connect.c | 611 +
src/base/cs_mesh_halo.c | 3571 +++
src/base/cs_mesh_quality.c | 1230 +
src/base/cs_mesh_quantities.c | 1323 +
src/base/cs_mesh_solcom.c | 433 +
src/base/cs_mesh_warping.c | 1409 +
src/base/cs_multigrid.c | 1984 ++
src/base/cs_numbering.c | 228 +
src/base/cs_opts.c | 727 +
src/base/cs_parall.c | 1371 +
src/base/cs_perio.c | 3002 ++
src/base/cs_post.c | 3577 +++
src/base/cs_post_f2c.f90 | 378 +
src/base/cs_preprocessor_data.c | 2716 ++
src/base/cs_proxy_comm.c | 909 +
src/base/cs_renumber.c | 929 +
src/base/cs_restart.c | 1823 ++
src/base/cs_sat_coupling.c | 1583 +
src/base/cs_search.c | 256 +
src/base/cs_selector.c | 325 +
src/base/cs_selector_f2c.f90 | 195 +
src/base/cs_sles.c | 2258 ++
src/base/cs_sort.c | 259 +
src/base/cs_syr3_comm.c | 1641 +
src/base/cs_syr3_coupling.c | 1748 +
src/base/cs_syr3_messages.c | 418 +
src/base/cs_syr4_coupling.c | 1242 +
src/base/cs_syr_coupling.c | 1098 +
src/base/cs_syr_f2c.f90 | 94 +
src/base/cs_tpar1d.c | 1047 +
src/base/cs_ventil.c | 1048 +
src/base/csc2cl.f90 | 385 +
src/base/csc2ts.f90 | 232 +
src/base/csccel.f90 | 379 +
src/base/cscfbr.f90 | 388 +
src/base/cscini.f90 | 219 +
src/base/csclli.f90 | 73 +
src/base/cscloc.f90 | 203 +
src/base/cscpce.f90 | 217 +
src/base/cscpfb.f90 | 1670 +
src/base/csflsh.f90 | 64 +
src/base/csinit.f90 | 157 +
src/base/csprnt.f90 | 85 +
src/base/distpr.f90 | 556 +
src/base/distyp.f90 | 910 +
src/base/divmas.f90 | 177 +
src/base/divrij.f90 | 310 +
src/base/dttvar.f90 | 1143 +
src/base/dvvpst.f90 | 1119 +
src/base/ecrava.f90 | 2767 ++
src/base/ecrhis.f90 | 414 +
src/base/ecrlis.f90 | 619 +
src/base/findpt.f90 | 110 +
src/base/gradmc.f90 | 1399 +
src/base/gradrc.f90 | 1068 +
src/base/grdcel.f90 | 366 +
src/base/haltyp.f90 | 84 +
src/base/hturbp.f90 | 144 +
src/base/idrbla.f90 | 88 +
src/base/impini.f90 | 2975 ++
src/base/iniini.f90 | 1526 +
src/base/inimas.f90 | 637 +
src/base/inipst.f90 | 121 +
src/base/initi1.f90 | 221 +
src/base/initi2.f90 | 162 +
src/base/iniusi.f90 | 570 +
src/base/iniva0.f90 | 723 +
src/base/inivar.f90 | 1401 +
src/base/invers.f90 | 273 +
src/base/iprbla.f90 | 88 +
src/base/itrgrp.f90 | 401 +
src/base/itrmas.f90 | 395 +
src/base/lecamo.f90 | 210 +
src/base/lecamp.f90 | 1887 ++
src/base/lecamx.f90 | 3595 +++
src/base/ledgeo.f90 | 408 +
src/base/letgeo.f90 | 872 +
src/base/majgeo.f90 | 196 +
src/base/matrdt.f90 | 336 +
src/base/matrix.f90 | 314 +
src/base/memale.f90 | 157 +
src/base/memcbr.f90 | 150 +
src/base/memclg.f90 | 129 +
src/base/memcli.f90 | 176 +
src/base/memcs1.f90 | 109 +
src/base/memcs2.f90 | 125 +
src/base/memdis.f90 | 156 +
src/base/memdtv.f90 | 160 +
src/base/memdyp.f90 | 179 +
src/base/memini.f90 | 207 +
src/base/memkep.f90 | 159 +
src/base/memkom.f90 | 159 +
src/base/memnav.f90 | 204 +
src/base/mempdc.f90 | 213 +
src/base/memphy.f90 | 154 +
src/base/memrij.f90 | 196 +
src/base/memsca.f90 | 155 +
src/base/memt1d.f90 | 231 +
src/base/memtri.f90 | 530 +
src/base/memtsm.f90 | 195 +
src/base/memv2f.f90 | 159 +
src/base/memvor.f90 | 136 +
src/base/modini.f90 | 1629 +
src/base/modpar.f90 | 143 +
src/base/navsto.f90 | 1601 +
src/base/newmrk.f90 | 223 +
src/base/numvec.f90 | 562 +
src/base/ordita.f90 | 89 +
src/base/pergra.f90 | 122 +
src/base/perinr.f90 | 296 +
src/base/perinu.f90 | 291 +
src/base/phyvar.f90 | 1379 +
src/base/precli.f90 | 296 +
src/base/preduv.f90 | 2033 ++
src/base/prmoy0.f90 | 128 +
src/base/prods2.f90 | 119 +
src/base/prods3.f90 | 124 +
src/base/prodsc.f90 | 96 +
src/base/projts.f90 | 351 +
src/base/promav.f90 | 213 +
src/base/proxav.f90 | 204 +
src/base/recvmc.f90 | 468 +
src/base/reseps.f90 | 923 +
src/base/resolp.f90 | 1557 +
src/base/resrij.f90 | 978 +
src/base/resssg.f90 | 780 +
src/base/resv2f.f90 | 981 +
src/base/rijech.f90 | 583 +
src/base/rijthe.f90 | 429 +
src/base/scalai.f90 | 743 +
src/base/schtmp.f90 | 711 +
src/base/stdtcl.f90 | 632 +
src/base/strdep.f90 | 466 +
src/base/strhis.f90 | 354 +
src/base/strini.f90 | 771 +
src/base/strpre.f90 | 374 +
src/base/tcpumx.c | 118 +
src/base/tdesi1.f90 | 131 +
src/base/testel.f90 | 533 +
src/base/tremai.c | 122 +
src/base/tridim.f90 | 2517 ++
src/base/tsepdc.f90 | 265 +
src/base/tstvec.f90 | 451 +
src/base/turbke.f90 | 1612 +
src/base/turbkw.f90 | 1363 +
src/base/turent.f90 | 207 +
src/base/turrij.f90 | 769 +
src/base/typecl.f90 | 1866 ++
src/base/undscr.f90 | 90 +
src/base/vandri.f90 | 227 +
src/base/varpos.f90 | 4523 +++
src/base/vectds.f90 | 166 +
src/base/vericl.f90 | 1241 +
src/base/verini.f90 | 6821 ++++
src/base/verlon.f90 | 80 +
src/base/vert1d.f90 | 443 +
src/base/viscfa.f90 | 240 +
src/base/visdyn.f90 | 738 +
src/base/vislmg.f90 | 369 +
src/base/visort.f90 | 293 +
src/base/vissec.f90 | 616 +
src/base/vissma.f90 | 377 +
src/base/vissst.f90 | 432 +
src/base/viswal.f90 | 418 +
src/base/vor2cl.f90 | 294 +
src/base/vordep.f90 | 330 +
src/base/vorimp.f90 | 259 +
src/base/vorin0.f90 | 143 +
src/base/vorini.f90 | 603 +
src/base/vorlgv.f90 | 148 +
src/base/vorpre.f90 | 386 +
src/base/vortex.f90 | 208 +
src/base/vorver.f90 | 1095 +
src/base/vorvit.f90 | 448 +
src/base/zufall.f90 | 446 +
src/cfbl/Makefile.am | 82 +
src/cfbl/Makefile.in | 646 +
src/cfbl/cfbsc2.f90 | 1354 +
src/cfbl/cfbsc3.f90 | 516 +
src/cfbl/cfcdts.f90 | 622 +
src/cfbl/cfdivs.f90 | 525 +
src/cfbl/cfdttv.f90 | 312 +
src/cfbl/cfener.f90 | 1121 +
src/cfbl/cfini1.f90 | 440 +
src/cfbl/cfiniv.f90 | 411 +
src/cfbl/cfmsfl.f90 | 839 +
src/cfbl/cfmsgs.f90 | 845 +
src/cfbl/cfmsvl.f90 | 805 +
src/cfbl/cfmsvs.f90 | 287 +
src/cfbl/cfphyv.f90 | 399 +
src/cfbl/cfprop.f90 | 251 +
src/cfbl/cfqdmv.f90 | 973 +
src/cfbl/cfrusb.f90 | 316 +
src/cfbl/cfvarp.f90 | 251 +
src/cfbl/cfxtcl.f90 | 1277 +
src/cfbl/memcfe.f90 | 120 +
src/cfbl/memcfm.f90 | 170 +
src/cfbl/memcft.f90 | 141 +
src/cfbl/memcfv.f90 | 124 +
src/cogz/Makefile.am | 94 +
src/cogz/Makefile.in | 665 +
src/cogz/coini1.f90 | 752 +
src/cogz/colecd.f90 | 685 +
src/cogz/coprop.f90 | 516 +
src/cogz/cothht.f90 | 207 +
src/cogz/covarp.f90 | 183 +
src/cogz/d3phst.f90 | 218 +
src/cogz/d3pini.f90 | 434 +
src/cogz/d3pint.f90 | 477 +
src/cogz/d3pphy.f90 | 466 +
src/cogz/d3ptcl.f90 | 579 +
src/cogz/d3pver.f90 | 176 +
src/cogz/ebuini.f90 | 519 +
src/cogz/ebuphy.f90 | 504 +
src/cogz/ebutcl.f90 | 622 +
src/cogz/ebutss.f90 | 344 +
src/cogz/ebuver.f90 | 196 +
src/cogz/lwcgfu.f90 | 103 +
src/cogz/lwcini.f90 | 549 +
src/cogz/lwcphy.f90 | 323 +
src/cogz/lwctcl.f90 | 663 +
src/cogz/lwctss.f90 | 543 +
src/cogz/lwcurl.f90 | 193 +
src/cogz/lwcver.f90 | 207 +
src/cogz/pdflwc.f90 | 777 +
src/cogz/pdfpp3.f90 | 645 +
src/cogz/pdfpp4.f90 | 971 +
src/cplv/Makefile.am | 96 +
src/cplv/Makefile.in | 648 +
src/cplv/cpcym2.f90 | 910 +
src/cplv/cpflux.f90 | 658 +
src/cplv/cpini1.f90 | 686 +
src/cplv/cpiniv.f90 | 431 +
src/cplv/cplecd.f90 | 1523 +
src/cplv/cplin1.f90 | 472 +
src/cplv/cplini.f90 | 350 +
src/cplv/cplph1.f90 | 369 +
src/cplv/cplphy.f90 | 448 +
src/cplv/cplpro.f90 | 162 +
src/cplv/cpltcl.f90 | 579 +
src/cplv/cpltss.f90 | 404 +
src/cplv/cpltsv.f90 | 433 +
src/cplv/cplvar.f90 | 137 +
src/cplv/cplver.f90 | 188 +
src/cplv/cplym1.f90 | 1134 +
src/cplv/cppdf4.f90 | 179 +
src/cplv/cppdfr.f90 | 318 +
src/cplv/cpphy1.f90 | 437 +
src/cplv/cpphy2.f90 | 361 +
src/cplv/cpphyv.f90 | 597 +
src/cplv/cpprop.f90 | 283 +
src/cplv/cpptcl.f90 | 761 +
src/cplv/cprays.f90 | 139 +
src/cplv/cpteh1.f90 | 335 +
src/cplv/cpteh2.f90 | 267 +
src/cplv/cptehm.f90 | 424 +
src/cplv/cpthp1.f90 | 523 +
src/cplv/cpthp2.f90 | 252 +
src/cplv/cptssc.f90 | 1327 +
src/cplv/cptsvc.f90 | 445 +
src/cplv/cptsvi.f90 | 283 +
src/cplv/cpvarp.f90 | 187 +
src/cplv/cpveri.f90 | 176 +
src/cplv/memcp1.f90 | 138 +
src/ctwr/Makefile.am | 77 +
src/ctwr/Makefile.in | 681 +
src/ctwr/cs_ctwr.c | 2677 ++
src/ctwr/cs_ctwr_air_props.c | 398 +
src/ctwr/cs_ctwr_f2c.f90 | 100 +
src/ctwr/cs_ctwr_halo.c | 1578 +
src/ctwr/cs_ctwr_mesh.c | 2215 ++
src/ctwr/ctini1.f90 | 196 +
src/ctwr/ctiniv.f90 | 253 +
src/ctwr/ctphyv.f90 | 475 +
src/ctwr/cttssc.f90 | 263 +
src/ctwr/ctvarp.f90 | 114 +
src/elec/Makefile.am | 73 +
src/elec/Makefile.in | 648 +
src/elec/elflux.f90 | 1037 +
src/elec/elini1.f90 | 522 +
src/elec/eliniv.f90 | 404 +
src/elec/ellecd.f90 | 369 +
src/elec/elphyv.f90 | 857 +
src/elec/elprop.f90 | 263 +
src/elec/elthht.f90 | 210 +
src/elec/eltssc.f90 | 404 +
src/elec/elvarp.f90 | 170 +
src/elec/elveri.f90 | 542 +
src/fuel/Makefile.am | 80 +
src/fuel/Makefile.in | 634 +
src/fuel/fucym1.f90 | 680 +
src/fuel/fucyno.f90 | 472 +
src/fuel/fuflux.f90 | 378 +
src/fuel/fuini1.f90 | 556 +
src/fuel/fuiniv.f90 | 378 +
src/fuel/fulecd.f90 | 729 +
src/fuel/fupdfr.f90 | 235 +
src/fuel/fuphy1.f90 | 365 +
src/fuel/fuphy2.f90 | 204 +
src/fuel/fuphyv.f90 | 552 +
src/fuel/fuprop.f90 | 250 +
src/fuel/fuptcl.f90 | 702 +
src/fuel/furays.f90 | 139 +
src/fuel/futeh1.f90 | 176 +
src/fuel/futeh2.f90 | 173 +
src/fuel/futhp1.f90 | 273 +
src/fuel/futhp2.f90 | 240 +
src/fuel/futssc.f90 | 895 +
src/fuel/futsvc.f90 | 433 +
src/fuel/futsvi.f90 | 235 +
src/fuel/fuvarp.f90 | 147 +
src/fuel/fuveri.f90 | 176 +
src/fuel/memfu1.f90 | 132 +
src/lagr/Makefile.am | 132 +
src/lagr/Makefile.in | 740 +
src/lagr/cs_lagr.c | 625 +
src/lagr/cs_lagr_perio.c | 262 +
src/lagr/diverv.f90 | 326 +
src/lagr/enslag.f90 | 877 +
src/lagr/enswaf.f90 | 812 +
src/lagr/lagaff.f90 | 458 +
src/lagr/lagcar.f90 | 702 +
src/lagr/lagcel.f90 | 1411 +
src/lagr/lagcou.f90 | 535 +
src/lagr/lagdeb.f90 | 423 +
src/lagr/lageli.f90 | 210 +
src/lagr/lagent.f90 | 2145 ++
src/lagr/lageqp.f90 | 508 +
src/lagr/lagerr.f90 | 85 +
src/lagr/lages1.f90 | 498 +
src/lagr/lages2.f90 | 540 +
src/lagr/lagesp.f90 | 357 +
src/lagr/lagfch.f90 | 495 +
src/lagr/laggra.f90 | 420 +
src/lagr/laghis.f90 | 505 +
src/lagr/lagich.f90 | 721 +
src/lagr/lagidp.f90 | 202 +
src/lagr/lagimp.f90 | 201 +
src/lagr/lagini.f90 | 228 +
src/lagr/lagipn.f90 | 254 +
src/lagr/lagitf.f90 | 329 +
src/lagr/lagitg.f90 | 231 +
src/lagr/lagitp.f90 | 252 +
src/lagr/laglec.f90 | 2097 ++
src/lagr/laglis.f90 | 600 +
src/lagr/lagnew.f90 | 485 +
src/lagr/lagnpr.f90 | 461 +
src/lagr/lagnwc.f90 | 509 +
src/lagr/lagopt.f90 | 3391 ++
src/lagr/lagout.f90 | 1242 +
src/lagr/lagphy.f90 | 366 +
src/lagr/lagpoi.f90 | 434 +
src/lagr/lagrus.f90 | 337 +
src/lagr/lagsta.f90 | 589 +
src/lagr/lagstf.f90 | 157 +
src/lagr/lagtri.f90 | 155 +
src/lagr/lagune.f90 | 1044 +
src/lagr/memla1.f90 | 189 +
src/lagr/memla2.f90 | 236 +
src/lagr/ouestu.f90 | 585 +
src/mati/Makefile.am | 52 +
src/mati/Makefile.in | 594 +
src/mati/memmat.f90 | 147 +
src/mati/mtimpi.f90 | 553 +
src/mati/mtini1.f90 | 681 +
src/mati/mtkpdc.f90 | 416 +
src/mati/mtphyv.f90 | 508 +
src/mati/mtproj.f90 | 395 +
src/mati/mttsns.f90 | 1159 +
src/mati/mttssc.f90 | 1350 +
src/mati/mttycl.f90 | 381 +
src/pprt/Makefile.am | 79 +
src/pprt/Makefile.in | 630 +
src/pprt/memppt.f90 | 126 +
src/pprt/ppcabs.f90 | 504 +
src/pprt/ppclim.f90 | 499 +
src/pprt/ppcsca.f90 | 260 +
src/pprt/ppini1.f90 | 144 +
src/pprt/ppinii.f90 | 593 +
src/pprt/ppiniv.f90 | 429 +
src/pprt/ppinv2.f90 | 294 +
src/pprt/pplecd.f90 | 129 +
src/pprt/pppdfr.f90 | 361 +
src/pprt/ppphyv.f90 | 520 +
src/pprt/ppprcl.f90 | 432 +
src/pprt/ppprop.f90 | 142 +
src/pprt/ppray4.f90 | 482 +
src/pprt/pptbht.f90 | 261 +
src/pprt/pptssc.f90 | 450 +
src/pprt/pptycl.f90 | 538 +
src/pprt/ppvarp.f90 | 140 +
src/rayt/Makefile.am | 76 +
src/rayt/Makefile.in | 641 +
src/rayt/memra1.f90 | 117 +
src/rayt/memra2.f90 | 187 +
src/rayt/memra3.f90 | 144 +
src/rayt/raycli.f90 | 1351 +
src/rayt/raydak.f90 | 175 +
src/rayt/raydir.f90 | 123 +
src/rayt/raydom.f90 | 1695 +
src/rayt/raylec.f90 | 390 +
src/rayt/rayopt.f90 | 792 +
src/rayt/rayout.f90 | 453 +
src/rayt/raypar.f90 | 1001 +
src/rayt/raypun.f90 | 518 +
src/rayt/raysca.f90 | 132 +
src/rayt/raysol.f90 | 579 +
src/rayt/rmodak.f90 | 964 +
users/atmo/usatcl.f90 | 822 +
users/atmo/usati1.f90 | 112 +
users/atmo/usativ.f90 | 379 +
users/base/usalcl.f90 | 636 +
users/base/usalin.f90 | 160 +
users/base/usaste.f90 | 263 +
users/base/usclim.f90 | 989 +
users/base/usdpst.f90 | 531 +
users/base/ushist.f90 | 423 +
users/base/usini1.f90 | 2154 ++
users/base/usiniv.f90 | 323 +
users/base/usjoin.f90 | 152 +
users/base/uskpdc.f90 | 456 +
users/base/usmodg.f90 | 174 +
users/base/usmpst.f90 | 384 +
users/base/usnpst.f90 | 236 +
users/base/usphyv.f90 | 876 +
users/base/usproj.f90 | 1864 ++
users/base/uspt1d.f90 | 333 +
users/base/ussatc.f90 | 185 +
users/base/ussmag.f90 | 274 +
users/base/usstru.f90 | 653 +
users/base/ussyrc.f90 | 139 +
users/base/usthht.f90 | 235 +
users/base/ustmgr.f90 | 390 +
users/base/ustske.f90 | 364 +
users/base/ustskw.f90 | 376 +
users/base/ustsma.f90 | 621 +
users/base/ustsns.f90 | 367 +
users/base/ustsri.f90 | 394 +
users/base/ustssc.f90 | 486 +
users/base/ustsv2.f90 | 401 +
users/base/usvima.f90 | 261 +
users/base/usvist.f90 | 346 +
users/base/usvort.f90 | 584 +
users/base/usvpst.f90 | 1138 +
users/cfbl/uscfcl.f90 | 783 +
users/cfbl/uscfpv.f90 | 872 +
users/cfbl/uscfth.f90 | 1996 ++
users/cfbl/uscfx1.f90 | 137 +
users/cfbl/uscfx2.f90 | 165 +
users/cfbl/uscfxi.f90 | 406 +
users/cogz/usd3p1.f90 | 230 +
users/cogz/usd3pc.f90 | 876 +
users/cogz/usd3pi.f90 | 315 +
users/cogz/usebu1.f90 | 241 +
users/cogz/usebuc.f90 | 941 +
users/cogz/usebui.f90 | 349 +
users/cogz/uslwc1.f90 | 315 +
users/cogz/uslwcc.f90 | 944 +
users/cogz/uslwci.f90 | 407 +
users/cplv/uscpcl.f90 | 906 +
users/cplv/uscpi1.f90 | 411 +
users/cplv/uscpiv.f90 | 452 +
users/cplv/uscpl1.f90 | 274 +
users/cplv/uscplc.f90 | 832 +
users/ctwr/usctcl.f90 | 704 +
users/ctwr/usctdz.f90 | 211 +
users/ctwr/uscti1.f90 | 194 +
users/ctwr/usctiv.f90 | 326 +
users/elec/uselcl.f90 | 1066 +
users/elec/uselen.f90 | 690 +
users/elec/useli1.f90 | 273 +
users/elec/useliv.f90 | 398 +
users/elec/uselph.f90 | 602 +
users/elec/uselrc.f90 | 775 +
users/elec/usetcl.f90 | 880 +
users/fuel/usfucl.f90 | 904 +
users/fuel/usfui1.f90 | 366 +
users/fuel/usfuiv.f90 | 395 +
users/lagr/uslabo.f90 | 1048 +
users/lagr/usladp.f90 | 298 +
users/lagr/uslaed.f90 | 337 +
users/lagr/uslaen.f90 | 427 +
users/lagr/uslafe.f90 | 279 +
users/lagr/uslag1.f90 | 1084 +
users/lagr/uslag2.f90 | 644 +
users/lagr/uslain.f90 | 394 +
users/lagr/uslapr.f90 | 357 +
users/lagr/uslaru.f90 | 307 +
users/lagr/uslast.f90 | 544 +
users/lagr/uslatc.f90 | 304 +
users/lagr/uslatp.f90 | 328 +
users/pprt/usppmo.f90 | 257 +
users/rayt/usray1.f90 | 342 +
users/rayt/usray2.f90 | 881 +
users/rayt/usray3.f90 | 386 +
users/rayt/usray4.f90 | 299 +
users/rayt/usray5.f90 | 616 +
1328 files changed, 660241 insertions(+)
diff --git a/ABOUT-NLS b/ABOUT-NLS
new file mode 100644
index 0000000..83bc72e
--- /dev/null
+++ b/ABOUT-NLS
@@ -0,0 +1,1068 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+ When reporting bugs in the `intl/' directory or bugs which may be
+related to internationalization, you should tell about the version of
+`gettext' which is used. The information can be found in the
+`intl/VERSION' file, in internationalized packages.
+
+1.1 Quick configuration advice
+==============================
+
+If you want to exploit the full power of internationalization, you
+should configure it using
+
+ ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed. So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation. Future versions of GNU `gettext' will
+very likely convey even more functionality. So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+ So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+1.2 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. If not, the included GNU
+`gettext' library will be used. This library is wholly contained
+within this package, usually in the `intl/' subdirectory, so prior
+installation of the GNU `gettext' package is _not_ required.
+Installers may use special options at configuration time for changing
+the default behaviour. The commands:
+
+ ./configure --with-included-gettext
+ ./configure --disable-nls
+
+will, respectively, bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this. This might not be desirable. You should use
+the more recent version of the GNU `gettext' library. I.e. if the file
+`intl/VERSION' shows that the library which comes with this package is
+more recent, you should use
+
+ ./configure --with-included-gettext
+
+to prevent auto-detection.
+
+ The configuration process will not test for the `catgets' function
+and therefore it will not be used. The reason is that even an
+emulation of `gettext' on top of `catgets' could not provide all the
+extensions of the GNU `gettext' library.
+
+ Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.3 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. If you happen to have the `LC_ALL' or some other
+`LC_xxx' environment variables set, you should unset them before
+setting `LANG', otherwise the setting of `LANG' will not have the
+desired effect. Here `LL' is an ISO 639 two-letter language code, and
+`CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.4 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://translationproject.org/', in the "Teams" area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `sv-request at li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `coordinator at translationproject.org' to
+reach the coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skills are praised more than
+programming skills, here.
+
+1.5 Available Packages
+======================
+
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of November
+2007. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo
+ +----------------------------------------------------+
+ Compendium | [] [] [] [] |
+ a2ps | [] [] [] [] [] |
+ aegis | () |
+ ant-phone | () |
+ anubis | [] |
+ ap-utils | |
+ aspell | [] [] [] [] [] |
+ bash | [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | [] [] |
+ bison-runtime | [] |
+ bluez-pin | [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] [] [] |
+ console-tools | [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cpplib | [] [] [] |
+ cryptonit | [] |
+ dialog | |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ fetchmail | [] [] () [] [] |
+ findutils | [] |
+ findutils_stable | [] [] [] |
+ flex | [] [] [] |
+ fslint | |
+ gas | |
+ gawk | [] [] [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] |
+ gettext-tools | [] [] |
+ gip | [] |
+ gliv | [] [] |
+ glunarclock | [] |
+ gmult | [] [] |
+ gnubiff | () |
+ gnucash | [] [] () () [] |
+ gnuedu | |
+ gnulib | [] |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | |
+ gpe-clock | [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | |
+ gpe-edit | [] |
+ gpe-filemanager | |
+ gpe-go | [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] |
+ gpe-taskmanager | [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] [] |
+ gpe-todo | |
+ gphoto2 | [] [] [] [] |
+ gprof | [] [] |
+ gpsdrive | |
+ gramadoir | [] [] |
+ grep | [] [] |
+ gretl | () |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] [] |
+ gst-plugins-ugly | [] [] |
+ gstreamer | [] [] [] [] [] [] [] |
+ gtick | () |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] |
+ herrie | [] |
+ hylafax | |
+ idutils | [] [] |
+ indent | [] [] [] [] |
+ iso_15924 | |
+ iso_3166 | [] [] [] [] [] [] [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] [] [] |
+ iso_639 | [] [] [] [] |
+ jpilot | [] |
+ jtag | |
+ jwhois | |
+ kbd | [] [] [] [] |
+ keytouch | [] [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | () |
+ ld | [] |
+ leafpad | [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | |
+ libiconv | [] [] |
+ libidn | [] [] [] |
+ lifelines | [] () |
+ lilypond | [] |
+ lingoteach | |
+ lprng | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailfromd | |
+ mailutils | [] |
+ make | [] [] |
+ man-db | [] [] [] |
+ minicom | [] [] [] |
+ nano | [] [] [] |
+ opcodes | [] |
+ parted | [] [] |
+ pilot-qof | |
+ popt | [] [] [] |
+ psmisc | [] |
+ pwdutils | |
+ qof | |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rpm | [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] |
+ shared-mime-info | [] [] [] [] () [] [] [] |
+ sharutils | [] [] [] [] [] [] |
+ shishi | |
+ skencil | [] () |
+ solfege | |
+ soundtracker | [] [] |
+ sp | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] [] |
+ texinfo | [] [] [] |
+ tin | () () |
+ tuxpaint | [] [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ util-linux-ng | [] [] [] [] |
+ vorbis-tools | [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] |
+ wget | [] [] [] |
+ xchat | [] [] [] [] [] [] [] |
+ xkeyboard-config | [] |
+ xpad | [] [] [] |
+ +----------------------------------------------------+
+ af am ar az be bg bs ca cs cy da de el en en_GB eo
+ 6 0 2 1 8 26 2 40 48 2 56 88 15 1 15 18
+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ +--------------------------------------------------+
+ Compendium | [] [] [] [] [] |
+ a2ps | [] [] [] () |
+ aegis | |
+ ant-phone | [] |
+ anubis | [] |
+ ap-utils | [] [] |
+ aspell | [] [] [] |
+ bash | [] |
+ bfd | [] [] |
+ bibshelf | [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] [] [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ console-tools | |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] [] |
+ cryptonit | [] |
+ dialog | [] [] [] |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ fetchmail | [] |
+ findutils | [] [] [] |
+ findutils_stable | [] [] [] [] |
+ flex | [] [] [] |
+ fslint | |
+ gas | [] [] |
+ gawk | [] [] [] [] () |
+ gcal | [] [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] |
+ gip | [] [] [] [] |
+ gliv | () |
+ glunarclock | [] [] [] |
+ gmult | [] [] [] |
+ gnubiff | () () |
+ gnucash | () () () |
+ gnuedu | [] |
+ gnulib | [] [] [] |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] [] [] [] |
+ gpe-filemanager | [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] |
+ gphoto2 | [] [] [] [] [] |
+ gprof | [] [] [] [] [] |
+ gpsdrive | [] |
+ gramadoir | [] [] |
+ grep | [] [] [] |
+ gretl | [] [] [] () |
+ gsasl | [] [] |
+ gss | [] [] |
+ gst-plugins-bad | [] [] [] [] |
+ gst-plugins-base | [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] |
+ gstreamer | [] [] [] |
+ gtick | [] [] [] |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ herrie | [] |
+ hylafax | |
+ idutils | [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] [] [] [] |
+ iso_15924 | [] |
+ iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ iso_3166_2 | [] |
+ iso_4217 | [] [] [] [] [] [] |
+ iso_639 | [] [] [] [] [] [] |
+ jpilot | [] [] |
+ jtag | [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] [] [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] [] |
+ latrine | [] [] |
+ ld | [] [] [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] [] [] |
+ libgpg-error | [] |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | [] [] |
+ libiconv | [] [] [] |
+ libidn | [] [] |
+ lifelines | () |
+ lilypond | [] [] [] |
+ lingoteach | [] [] [] |
+ lprng | |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] |
+ mailfromd | |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] |
+ man-db | [] |
+ minicom | [] [] [] [] |
+ nano | [] [] [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] |
+ pilot-qof | |
+ popt | [] [] [] [] |
+ psmisc | [] [] |
+ pwdutils | |
+ qof | [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] [] [] [] |
+ shared-mime-info | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] [] |
+ shishi | [] |
+ skencil | [] [] |
+ solfege | [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] [] |
+ texinfo | [] [] [] |
+ tin | [] () |
+ tuxpaint | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux | [] [] [] [] [] [] [] |
+ util-linux-ng | [] [] [] [] [] [] [] |
+ vorbis-tools | |
+ wastesedge | () |
+ wdiff | [] [] [] [] [] [] [] [] |
+ wget | [] [] [] [] [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ 85 22 14 2 48 101 61 12 2 8 2 6 53 29 1 52
+
+ ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn
+ +--------------------------------------------------+
+ Compendium | [] |
+ a2ps | () [] [] |
+ aegis | () |
+ ant-phone | [] |
+ anubis | [] [] [] |
+ ap-utils | [] |
+ aspell | [] [] |
+ bash | [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] |
+ bluez-pin | [] [] [] |
+ cflow | |
+ clisp | [] |
+ console-tools | |
+ coreutils | [] |
+ cpio | [] |
+ cpplib | [] |
+ cryptonit | [] |
+ dialog | [] [] |
+ diffutils | [] [] [] |
+ doodle | |
+ e2fsprogs | [] |
+ enscript | [] |
+ fetchmail | [] [] |
+ findutils | [] |
+ findutils_stable | [] |
+ flex | [] [] |
+ fslint | |
+ gas | |
+ gawk | [] [] |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] [] |
+ gettext-runtime | [] [] [] |
+ gettext-tools | [] [] |
+ gip | [] [] |
+ gliv | [] |
+ glunarclock | [] [] |
+ gmult | [] [] [] |
+ gnubiff | |
+ gnucash | () () () |
+ gnuedu | |
+ gnulib | [] [] |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] |
+ gpe-conf | [] [] [] |
+ gpe-contacts | [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] |
+ gpe-taskmanager | [] [] [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] [] |
+ gpe-todo | [] |
+ gphoto2 | [] [] |
+ gprof | [] |
+ gpsdrive | [] |
+ gramadoir | () |
+ grep | [] [] |
+ gretl | |
+ gsasl | [] |
+ gss | |
+ gst-plugins-bad | [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] |
+ gst-plugins-ugly | [] |
+ gstreamer | [] |
+ gtick | [] |
+ gtkam | [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] |
+ herrie | [] |
+ hylafax | |
+ idutils | [] |
+ indent | [] [] |
+ iso_15924 | [] |
+ iso_3166 | [] [] [] [] [] [] [] [] |
+ iso_3166_2 | [] |
+ iso_4217 | [] [] [] |
+ iso_639 | [] [] [] [] |
+ jpilot | () () |
+ jtag | |
+ jwhois | [] |
+ kbd | [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] |
+ libc | [] [] [] |
+ libexif | |
+ libextractor | |
+ libgpewidget | [] |
+ libgpg-error | |
+ libgphoto2 | [] |
+ libgphoto2_port | [] |
+ libgsasl | [] |
+ libiconv | [] |
+ libidn | [] [] |
+ lifelines | [] |
+ lilypond | [] |
+ lingoteach | [] |
+ lprng | |
+ lynx | [] [] |
+ m4 | [] [] |
+ mailfromd | |
+ mailutils | |
+ make | [] [] [] |
+ man-db | |
+ minicom | [] |
+ nano | [] [] [] |
+ opcodes | [] |
+ parted | [] [] |
+ pilot-qof | |
+ popt | [] [] [] |
+ psmisc | [] [] [] |
+ pwdutils | |
+ qof | |
+ radius | |
+ recode | [] |
+ rpm | [] [] |
+ screem | [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] |
+ shared-mime-info | [] [] [] [] [] [] [] |
+ sharutils | [] [] |
+ shishi | |
+ skencil | |
+ solfege | () () |
+ soundtracker | |
+ sp | () |
+ system-tools-ba... | [] [] [] [] |
+ tar | [] [] [] |
+ texinfo | [] [] |
+ tin | |
+ tuxpaint | () [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] |
+ util-linux-ng | [] [] |
+ vorbis-tools | |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] |
+ xchat | [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn
+ 51 2 25 3 2 0 6 0 2 2 20 0 11 1 103 6
+
+ or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ +--------------------------------------------------+
+ Compendium | [] [] [] [] [] |
+ a2ps | () [] [] [] [] [] [] |
+ aegis | () () |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ ap-utils | () |
+ aspell | [] [] [] |
+ bash | [] [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] [] |
+ bison | [] [] [] [] [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] |
+ console-tools | [] |
+ coreutils | [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] |
+ cryptonit | [] [] |
+ dialog | [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ fetchmail | [] [] [] |
+ findutils | [] [] [] |
+ findutils_stable | [] [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ fslint | [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gcal | [] |
+ gcc | [] [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] [] |
+ gip | [] [] [] [] |
+ gliv | [] [] [] [] [] [] |
+ glunarclock | [] [] [] [] [] [] |
+ gmult | [] [] [] [] |
+ gnubiff | () [] |
+ gnucash | () [] |
+ gnuedu | |
+ gnulib | [] [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] [] [] [] [] [] [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] [] [] [] [] [] |
+ gpe-login | [] [] [] [] [] [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] |
+ gphoto2 | [] [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] |
+ gretl | [] [] [] |
+ gsasl | [] [] [] |
+ gss | [] [] [] [] |
+ gst-plugins-bad | [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] |
+ gst-plugins-ugly | [] [] [] |
+ gstreamer | [] [] [] [] |
+ gtick | [] |
+ gtkam | [] [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] |
+ herrie | [] [] [] |
+ hylafax | |
+ idutils | [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | |
+ iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] [] [] [] [] [] [] |
+ iso_639 | [] [] [] [] [] [] [] |
+ jpilot | |
+ jtag | [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | |
+ ld | [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] |
+ libextractor | [] [] |
+ libgpewidget | [] [] [] [] [] [] [] [] |
+ libgpg-error | [] [] [] |
+ libgphoto2 | [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] |
+ libiconv | [] [] [] |
+ libidn | [] [] () |
+ lifelines | [] [] |
+ lilypond | |
+ lingoteach | [] |
+ lprng | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailfromd | [] |
+ mailutils | [] [] [] |
+ make | [] [] [] [] |
+ man-db | [] [] [] [] |
+ minicom | [] [] [] [] [] |
+ nano | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] |
+ pilot-qof | |
+ popt | [] [] [] [] |
+ psmisc | [] [] |
+ pwdutils | [] [] |
+ qof | [] [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] |
+ rpm | [] [] [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ shared-mime-info | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ skencil | [] [] [] |
+ solfege | [] |
+ soundtracker | [] [] |
+ sp | |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | () |
+ tuxpaint | [] [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ util-linux-ng | [] [] [] [] |
+ vorbis-tools | [] |
+ wastesedge | |
+ wdiff | [] [] [] [] [] [] [] |
+ wget | [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ 0 5 77 31 53 4 58 72 3 45 46 9 45 122 3
+
+ tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ +---------------------------------------------------+
+ Compendium | [] [] [] [] | 19
+ a2ps | [] [] [] | 19
+ aegis | [] | 1
+ ant-phone | [] [] | 6
+ anubis | [] [] [] | 11
+ ap-utils | () [] | 4
+ aspell | [] [] [] | 16
+ bash | [] | 6
+ bfd | | 2
+ bibshelf | [] | 7
+ binutils | [] [] [] [] | 9
+ bison | [] [] [] [] | 20
+ bison-runtime | [] [] [] [] | 18
+ bluez-pin | [] [] [] [] [] [] | 28
+ cflow | [] [] | 5
+ clisp | | 9
+ console-tools | [] [] | 5
+ coreutils | [] [] [] | 18
+ cpio | [] [] [] [] | 11
+ cpplib | [] [] [] [] [] | 12
+ cryptonit | [] | 6
+ dialog | [] [] [] | 9
+ diffutils | [] [] [] [] [] | 29
+ doodle | [] | 6
+ e2fsprogs | [] [] | 10
+ enscript | [] [] [] | 16
+ fetchmail | [] [] | 12
+ findutils | [] [] [] | 11
+ findutils_stable | [] [] [] [] | 18
+ flex | [] [] | 15
+ fslint | [] | 2
+ gas | [] | 3
+ gawk | [] [] [] | 16
+ gcal | [] | 5
+ gcc | [] [] [] | 7
+ gettext-examples | [] [] [] [] [] [] | 29
+ gettext-runtime | [] [] [] [] [] [] | 28
+ gettext-tools | [] [] [] [] [] | 20
+ gip | [] [] | 13
+ gliv | [] [] | 11
+ glunarclock | [] [] [] | 15
+ gmult | [] [] [] [] | 16
+ gnubiff | [] | 2
+ gnucash | () [] | 5
+ gnuedu | [] | 2
+ gnulib | [] | 10
+ gnunet | | 0
+ gnunet-gtk | [] [] | 3
+ gnutls | | 4
+ gpe-aerial | [] [] | 14
+ gpe-beam | [] [] | 14
+ gpe-calendar | [] [] | 7
+ gpe-clock | [] [] [] [] | 21
+ gpe-conf | [] [] [] | 16
+ gpe-contacts | [] [] | 10
+ gpe-edit | [] [] [] [] [] | 22
+ gpe-filemanager | [] [] | 7
+ gpe-go | [] [] [] [] | 19
+ gpe-login | [] [] [] [] [] | 21
+ gpe-ownerinfo | [] [] [] [] | 21
+ gpe-package | [] | 6
+ gpe-sketchbook | [] [] | 16
+ gpe-su | [] [] [] [] | 21
+ gpe-taskmanager | [] [] [] [] | 21
+ gpe-timesheet | [] [] [] [] | 18
+ gpe-today | [] [] [] [] [] | 21
+ gpe-todo | [] [] | 8
+ gphoto2 | [] [] [] [] | 21
+ gprof | [] [] | 13
+ gpsdrive | [] | 5
+ gramadoir | [] | 7
+ grep | [] | 12
+ gretl | | 6
+ gsasl | [] [] [] | 9
+ gss | [] | 7
+ gst-plugins-bad | [] [] [] | 13
+ gst-plugins-base | [] [] | 11
+ gst-plugins-good | [] [] [] [] [] | 16
+ gst-plugins-ugly | [] [] [] | 13
+ gstreamer | [] [] [] | 18
+ gtick | [] [] | 7
+ gtkam | [] | 16
+ gtkorphan | [] | 7
+ gtkspell | [] [] [] [] [] [] | 27
+ gutenprint | | 4
+ hello | [] [] [] [] [] | 38
+ herrie | [] [] | 8
+ hylafax | | 0
+ idutils | [] [] | 15
+ indent | [] [] [] [] [] | 28
+ iso_15924 | [] [] | 4
+ iso_3166 | [] [] [] [] [] [] [] [] [] | 54
+ iso_3166_2 | [] [] | 4
+ iso_4217 | [] [] [] [] [] | 24
+ iso_639 | [] [] [] [] [] | 26
+ jpilot | [] [] [] [] | 7
+ jtag | [] | 3
+ jwhois | [] [] [] | 13
+ kbd | [] [] [] | 13
+ keytouch | [] | 8
+ keytouch-editor | [] | 5
+ keytouch-keyboa... | [] | 5
+ latrine | [] [] | 5
+ ld | [] [] [] [] | 10
+ leafpad | [] [] [] [] [] | 24
+ libc | [] [] [] | 19
+ libexif | [] | 5
+ libextractor | [] | 5
+ libgpewidget | [] [] [] | 20
+ libgpg-error | [] | 6
+ libgphoto2 | [] [] | 9
+ libgphoto2_port | [] [] [] | 11
+ libgsasl | [] | 8
+ libiconv | [] [] | 11
+ libidn | [] [] | 11
+ lifelines | | 4
+ lilypond | [] | 6
+ lingoteach | [] | 6
+ lprng | [] | 2
+ lynx | [] [] [] | 15
+ m4 | [] [] [] | 18
+ mailfromd | [] [] | 3
+ mailutils | [] [] | 8
+ make | [] [] [] | 20
+ man-db | [] | 9
+ minicom | [] | 14
+ nano | [] [] [] | 20
+ opcodes | [] [] | 10
+ parted | [] [] [] | 11
+ pilot-qof | [] | 1
+ popt | [] [] [] [] | 18
+ psmisc | [] [] | 10
+ pwdutils | [] | 3
+ qof | [] | 4
+ radius | [] [] | 7
+ recode | [] [] [] | 25
+ rpm | [] [] [] [] | 13
+ screem | [] | 2
+ scrollkeeper | [] [] [] [] | 26
+ sed | [] [] [] [] | 23
+ shared-mime-info | [] [] [] | 29
+ sharutils | [] [] [] | 23
+ shishi | [] | 3
+ skencil | [] | 7
+ solfege | [] | 3
+ soundtracker | [] [] | 9
+ sp | [] | 3
+ system-tools-ba... | [] [] [] [] [] [] [] | 38
+ tar | [] [] [] | 17
+ texinfo | [] [] [] | 15
+ tin | | 1
+ tuxpaint | [] [] [] | 19
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux | [] [] [] | 20
+ util-linux-ng | [] [] [] | 20
+ vorbis-tools | [] [] | 4
+ wastesedge | | 1
+ wdiff | [] [] | 23
+ wget | [] [] [] | 20
+ xchat | [] [] [] [] | 29
+ xkeyboard-config | [] [] [] | 14
+ xpad | [] [] [] | 15
+ +---------------------------------------------------+
+ 76 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ 163 domains 0 3 1 74 51 0 143 21 1 57 7 45 0 2036
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If November 2007 seems to be old, you may fetch a more recent copy
+of this `ABOUT-NLS' file on most GNU archive sites. The most
+up-to-date matrix with full percentage details can be found at
+`http://translationproject.org/extra/matrix.html'.
+
+1.6 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`coordinator at translationproject.org' to make the `.pot' files available
+to the translation teams.
+
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..04e19c3
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,89 @@
+This file is the credits list for the Code_Saturne Kernel, element
+of the Code_Saturne CFD tool. The affiliation given for each contributor
+refers to the time when that contributor was active in the project,
+and does not necessarily correspond to his or her present affiliation.
+
+
+Code_Saturne is copyright (C) 1998-2007 EDF S.A., France
+
+
+Major contributions to the Code_Saturne Kernel have been provided by
+Archambeau Fr�d�ric (EDF, Chatou, France)
+B�chaud C�line (EDF, Chatou, France)
+Benhamadouche Sofiane (EDF, Chatou, France)
+Bonelle J�r�me (EDF, Chatou, France)
+Bosse Sophie (EDF, Chatou, France)
+Boucker Marc (EDF, Chatou, France)
+Douce Alexandre (EDF, Chatou, France)
+Escaich Alain (EDF, Chatou, France)
+Fournier Yvan (EDF, Chatou, France)
+Guimet Val�rie (CS-SI, Le Plessis Robinson, France)
+Lavieville J�r�me (EDF, Chatou, France)
+Mechitoua Namane (EDF, Chatou, France)
+Monfort David (EDF, Chatou, France)
+Ouraou Mehdi (INCKA, Boulogne-Billancourt, France)
+Pasutto Thomas (EDF, Chatou, France)
+Picard Nicole (EDF, Chatou, France)
+Plion Pierre (EDF, Chatou, France)
+Quemerais Eric (INCKA, Boulogne-Billancourt, France)
+Rousset Jean-Luc (EDF, Chatou, France)
+Sakiz Marc (EDF, Chatou, France)
+Vit Carole (INCKA, Boulogne-Billancourt, France)
+
+
+Other contributors to the Code_Saturne Kernel include
+Baudry Cyril (ENSIL, Limoges, France)
+Carissimo Bertrand (EDF, Chatou, France)
+Davroux Alexandre (EDF, Chatou, France)
+Delalondre Clarisse (EDF, Chatou, France)
+Gest Brigitte (EDF, Chatou, France)
+Howard Richard (EDF, Chatou, France)
+Huvelin Fabien (EDF, Chatou, France)
+Jusserand Fran�ois (EDF, Chatou, France)
+Lemoine Emmanuel (INCKA, Boulogne-Billancourt, France)
+Lucas J�r�me (INCKA, Boulogne-Billancourt, France)
+Milliez Maya (EDF, Chatou, France)
+Robin Vincent (ENSMA, Poitiers, France)
+Rupp Isabelle (EDF, Chatou, France)
+Schuck Ugo (EDF, Chatou, France)
+Tartar Michael (INCKA, Boulogne-Billancourt, France)
+Uribe Juan (University of Manchester, United Kingdom)
+
+
+The Code_Saturne Kernel may contain code by Olivier Devillers
+(INRIA, Sophia-Antipolis, France) for Lagrangian particle
+trajectory tracking (cs_lagrang.c routine)
+
+The Code_Saturne Kernel may contain code by Wes Petersen
+(ETHZ, Zurich, Switzerland) for random number generation
+(zufall.F routine)
+
+
+The following people should also be thanked for cooperating
+with the Code_Saturne development team by providing fresh
+ideas on theoretical or programming topics or major feedback on
+the code.
+Balestre Loic (Xanth Informatique, Issy les Moulineaux, France)
+Bournaud Sophie (EDF, Chatou, France)
+Dal Secco Sandro (EDF, Chatou, France)
+Decossin Etienne (EDF, Chatou, France)
+Guillaud Matthieu (INCKA, Boulogne-Billancourt, France)
+H�rard Jean-Marc (EDF, Chatou, France)
+Jamet Nicolas (INCKA, Boulogne-Billancourt, France)
+Jarrin Nicolas (University of Manchester, United Kingdom)
+Laurence Dominique (EDF, Chatou, France)
+Leclair Matthieu (EDF, Chatou, France)
+Longatte Lacazedieu Elisabeth (EDF, Chatou, France)
+Maas Ludovic (INCKA, Boulogne-Billancourt, France)
+Mattei Jean-Daniel (EDF, Chatou, France)
+Minier Jean-Pierre (EDF, Chatou, France)
+Ritz Jean-Benoit (EDF, Chatou, France)
+Thai-Van Dominique (EDF, Chatou, France)
+Vurpillot Christelle (EDF, Chatou, France)
+
+
+To the best of our knowledge, this list reflects the exact level of
+contribution of each among the many people who have approached
+Code_Saturne. It is made as objective and accurate as possible.
+However, if you feel you have been misplaced in the list, or completely
+forgotten, please contact saturne-support at edf.fr so we can update it.
diff --git a/COMPATIBILITY b/COMPATIBILITY
new file mode 100644
index 0000000..d928a38
--- /dev/null
+++ b/COMPATIBILITY
@@ -0,0 +1,64 @@
+CODE_SATURNE VERSION 1.4
+========================
+
+This is version 1.4.0 of the Code_Saturne CFD tool. It is composed of
+the following elements :
+* Code_Saturne Kernel version 1.4.0
+* Code_Saturne Preprocessor version 1.4.0
+* Code_Saturne Graphical User Interface version 1.4.0
+Other versions of these elements might not be compatible.
+
+
+Compulsory libraries
+--------------------
+The BFT (Base Functions and Types) and FVM (Finite Volume Mesh) libraries
+are compulsory. They are distributed under the LGPL licence
+(copyright EDF S.A., France). Code_Saturne version 1.4.0 is compliant with
+the following versions:
+* BFT 1.0.8 or newer
+* FVM 0.13.0 or newer
+Older versions might yet be compatible, possibly with limited features.
+
+
+Optionnal libraries
+-------------------
+Here is given the list of optionnal libraries that can be linked to
+Code_Saturne. The version number is the one used for developping and
+testing version 1.4.0 of Code_Saturne. Other versions (newer or older)
+might still be compatible.
+* python: > 2.3 - (necessary for the Code_Saturne GUI)
+* pyqt: > 4.3 - (necessary for the Code_Saturne GUI)
+* qt: > 4.3 - (necessary for the Code_Saturne GUI)
+* libxml2: > 2.6.19 - (necessary for the Code_Saturne GUI)
+* Metis: 4.0 - (for optimised domain decomposition)
+* CGNS: > 2.5
+* MED_fichier: > 2.3
+* hdf5: > 1.6.4 - (necessary for MED_fichier library)
+* Zlib: 1.2.3
+
+MPI libraries
+-------------
+In case of parallel computing, it is necessary to use a MPI library.
+The following libraries have been used with success, but no specific
+command is used in the code so any other MPI library should work.
+* LAM/MPI: 7.1.3
+* MPICH: 1.2.8
+* MPICH2: 1.0.6
+* Open-MPI: 1.2.5
+
+Specificities of the Matisse module of Code_Saturne
+---------------------------------------------------
+The Matisse module of Code_Saturne only works through the Graphical
+User Interface. Hence the libraries PyQt, python and libxml2
+become compulsory.
+Also, the Matisse module requires usage of the Simail mesh generator,
+distributed by Distene SAS (France). For more information on this
+product:
+ Distene S.A.S.
+ P�le Teratec - BARD-1
+ Domaine du Grand Ru�
+ 91680 Bruy�res-le-Chatel
+ FRANCE
+ Telephone : +33 (0) 1 69 26 62 10
+ Email : info at distene.com
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..7712ab8
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,6261 @@
+* 29/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix BLAS ESSL link on BlueGene systems.
+ modified scripts:
+ config/cs_auto_flags.sh
+ config/cs_blas.m4
+
+* 29/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix a spurious copy/paste un the runcase(s) scripts.
+ modified scripts:
+ bin/runcase.in
+ bin/runcase_coupling.in
+
+* 29/07/2009 - David Monfort <david.monfort at edf.fr>
+ Tagging version 2.0-beta2
+
+* 29/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Update tutorial examples to new Fortran format and Xml model.
+
+* 29/07/2009 - David Monfort <david.monfort at edf.fr>
+ Move loop on velocity/pressure system so that it includes
+ the boundary conditions calculation.
+ modified routines:
+ src/base/memnav.f90
+ src/base/tridim.f90
+ src/base/verini.f90
+
+* 28/07/2009 - Mickael Hassanaly <mickael.hassanaly at edf.fr>
+ Use selection mechanism for exchange zone definition.
+ added routine:
+ src/ctwr/cs_ctwr_f2c.f90
+ modified script:
+ src/ctwr/Makefile.am
+ modified routines:
+ include/ctwr/cs_ctwr.h
+ src/ctwr/cs_ctwr.c
+ src/ctwr/cs_ctwr_mesh.c
+ users/ctwr/usctdz.f90
+
+* 28/07/2009 - Mickael Hassanaly <mickael.hassanaly at edf.fr>
+ Make temperature difference setup available from uscti1.f90
+ modified routines:
+ include/ctwr/ctincl.h
+ users/ctwr/uscti1.f90
+
+* 28/07/2009 - Mickael Hassanaly <mickael.hassanaly at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Add a global structure in cooling tower module to store common
+ fluid properties and gravity vector.
+ modified routines:
+ include/ctwr/cs_ctwr_air_props.h
+ include/ctwr/cs_ctwr.h
+ include/ctwr/cs_ctwr_mesh.h
+ src/base/cregeo.f90
+ src/ctwr/cs_ctwr_air_props.c
+ src/ctwr/cs_ctwr.c
+ src/ctwr/cs_ctwr_mesh.c
+ users/ctwr/usctdz.f90
+ users/ctwr/uscti1.f90
+
+* 28/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Replace a goto statement with a do while loop.
+ Add an anisotropy criterion calculation for coarse matrices.
+ modified routines:
+ src/base/autmgr.f90
+ src/base/crstgr.f90
+
+* 28/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Comments translation and documentation update.
+ modifed files:
+ doc/user/saturne1.tex
+ src/base/autmgr.f90
+ src/base/crstgr.f90
+ src/base/iniini.f90
+ users/base/ustmgr.f90
+
+* 28/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor comments improvement.
+ modified files:
+ gui/Pages/BatchRunningAdvancedOptionsDialogForm.ui
+ gui/Pages/FacesSelectionView.py
+ gui/Pages/SolutionVerifForm.ui
+ gui/Pages/UserScalarPropertiesForm.ui
+
+* 28/07/2009 - David Monfort <david.monfort at edf.fr>
+ Modify libsyrcs code so that one can compile SYRTHES/Code_Saturne
+ coupling library without SYRTHES. Information on SYRTHES installation
+ and compilers could now be given after Code_Saturne installation.
+ modified scripts:
+ config/cs_syrthes.m4
+ libsyrcs/Makefile.am
+ Makefile.am
+ modified routines:
+ libsyrcs/syr_cs.c
+ libsyrcs/syr_defs.h
+
+* 28/07/2009 - David Monfort <david.monfort at edf.fr>
+ Change CFLAGS to gnu99 standard for compilation on Cygwin.
+ modified script:
+ config/cs_auto_flags.sh
+
+* 28/07/2009 - David Monfort <david.monfort at edf.fr>
+ Adapt main script so that it handles non standard directory for
+ MEI installation (precisely not the same as the kernel).
+ modified scripts:
+ bin/cs.in
+ confi/cs_mei.m4
+
+* 28/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Remove seemingly useless test for restart files writing. All files
+ are now written at the same moment (even for the last time-step).
+ modified routine:
+ src/base/caltri.f90
+
+* 27/07/2009 - David Monfort <david.monfort at edf.fr>
+ Add a trick to find MEI Python module when not in standard path.
+ modified script:
+ bin/cs.in
+
+* 27/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a wrong assumed behaviour on x86_64 and IA64 computers
+ in the particles tracking algorithm. One assumed that the internal
+ FP precision was always 80 bits (true for FPU x87 coprocessor on
+ x86 processors but wrong with SSE optimizations)...
+ This is a short term fix (assembler + compiler-dependent option).
+ modified scripts:
+ config/cs_auto_flags.sh
+ src/lagr/Makefile.am
+ configure.ac
+ modified routine:
+ src/lagr/cs_lagr.c
+
+* 27/07/2009 - J�rome Lucas <jerome.lucas at incka.fr>
+ David Monfort <david.monfort at edf.fr>
+ Add restarting capabilities for cooling-towers module.
+ modified routine:
+ bin/runcase_coupling.in
+ bin/runcase.in
+ include/base/entsor.h
+ include/base/optcal.h
+ include/ctwr/cs_ctwr.h
+ src/base/caltri.f90
+ src/base/cregeo.f90
+ src/base/iniini.f90
+ src/ctwr/cs_ctwr.c
+ users/ctwr/uscti1.f90
+
+* 23/07/2009 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Fix an issue in the parallel joining for specific cases.
+ modified routines:
+ src/base/cs_join_update.c
+
+* 23/07/2009 - J�rome Lucas <jerome.lucas at incka.fr>
+ Fix a bug in parallel simulations with cooling-tower module.
+ modified routine:
+ src/ctwr/cs_ctwr_halo.c
+
+* 23/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix a bug introduced a couple of rev. ago in listing output.
+ modified routine:
+ src/base/ecrlis.f90
+
+* 23/07/2009 - David Monfort <david.monfort at edf.fr>
+ Add Coriolis source terms in standard calculations.
+ modified routines:
+ include/base/cs_gui.h
+ include/base/cstphy.h
+ src/base/cs_gui.c
+ src/base/impini.f90
+ src/base/iniini.f90
+ src/base/iniusi.f90
+ src/base/preduv.f90
+ users/base/usini1.f90
+
+* 23/07/2009 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Fix an issue in the parallel joining for specific cases.
+ modified routines:
+ include/base/cs_join_util.h
+ src/base/cs_join_update.c
+ src/base/cs_join_util.c
+
+* 23/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Translation of the two main user subroutines (initialization
+ and boundary conditions).
+ modified routines:
+ users/base/usclim.f90
+ users/base/usini1.f90
+
+* 22/07/2009 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Fix a test on tolerance in the merge stage.
+ modified routine:
+ src/base/cs_join_merge.c
+
+* 22/07/2009 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Fix a possible uninitialized variable in joining algorithm.
+ modified routine:
+ src/base/cs_join_intersect.c
+
+* 22/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a possible uninitialized variable in benchmark routines.
+ modified routine:
+ src/base/cs_benchmark.c
+
+* 22/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a possible compilation issue on BlueGene systems.
+ modified script:
+ config/cs_fvm.m4
+
+* 22/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a long-standing bug when reducing extended neighborhood.
+ modified routines:
+ include/base/cs_ext_neighborhood.h
+ include/base/cs_mesh.h
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_mesh.c
+
+* 22/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Translation in English of magic strings in user files.
+ modified scripts:
+ bin/cs_create
+ Makefile.am
+
+* 22/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Update the translation files.
+ modified files:
+ po/POTFILES.in
+ po/fr.po
+
+* 22/07/2009 - J�rome Lucas <jerome.lucas at incka.fr>
+ David Monfort <david.monfort at edf.fr>
+ Fix several bugs in cooling-tower module and clean a few lines.
+ modified routines:
+ include/ctwr/cs_ctwr.h
+ src/ctwr/cs_ctwr.c
+ src/ctwr/cs_ctwr_halo.c
+ src/ctwr/cs_ctwr_mesh.c
+
+* 22/07/2009 - J�rome Lucas <jerome.lucas at incka.fr>
+ David Monfort <david.monfort at edf.fr>
+ Split main cooling-tower modelling routine in two for a better
+ understanding (mainly to move aside the mesh generation).
+ added routines:
+ include/ctwr/cs_ctwr_mesh.h
+ src/ctwr/cs_ctwr_mesh.c
+ modified script:
+ src/ctwr/Makefile.am
+ modified routines:
+ include/ctwr/cs_ctwr.h
+ src/ctwr/cs_ctwr.c
+
+* 22/07/2009 - David Monfort <david.monfort at edf.fr>
+ Move tutorial examples into a dedicated examples directory.
+
+* 22/07/2009 - David Monfort <david.monfort at edf.fr>
+ Add missing changes in tridim.f90 for GUI improvement... sorry!
+ modified routine:
+ src/base/tridim.f90
+
+* 22/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a minor failure in I/O management.
+ modified routine:
+ src/base/cs_io.c
+
+* 22/07/2009 - Sofiane Benhamadouche <sofiane.benhamadouche at edf.fr>
+ Do not relax turbulent variables (k/epsilon/omega) in unsteady
+ simulations.
+ modified routine:
+ src/base/modini.f90
+
+* 22/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix a bug in the P1 model for radiative transfer, where a local
+ variable "iel" was not defined.
+ modified routine:
+ src/rayt/raypun.f90
+
+* 22/07/2009 - Alexandre Douce <alexandre.douce at edf.fr>
+ Adapt 1d-profiles file to SALOME format for title and labels.
+ modified routine:
+ src/base/cs_gui.c
+
+* 20/07/2009 - David Monfort <david.monfort at edf.fr>
+ Add radiative transfert support for fuel combustion.
+ added routine:
+ src/fuel/furays.f90
+ modified script:
+ src/fuel/Makefile.am
+ modified routines:
+ src/base/covofi.f90
+
+* 20/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix a bug related to oxycombustion.
+ modified routine:
+ src/cplv/cptehm.f90
+
+* 20/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor modifications regarding code and comments cleaning.
+ modified routines:
+ src/base/cs_join.c
+ src/base/cs_join_intersect.c
+ src/base/cs_join_merge.c
+ src/base/cs_join_mesh.c
+
+* 20/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add a space-filling-curve algorithm for parallel partitioning.
+ This algorithm is based on a Morton curve and can be used by
+ setting the variable USE_SFC to 1 in the file.
+ modified routine:
+ src/base/cs_preprocessor_data.c
+
+* 20/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Change the name of a FVM function accordingly.
+ modified routine:
+ src/base/cs_restart.c
+
+* 20/07/2009 - David Monfort <david.monfort at edf.fr>
+ Scripts fixes and SYRTHES-related improvements.
+ modified scripts:
+ bin/cs_config.py.in
+ bin/cs_create.py
+ bin/runcase_coupling.in
+ config/cs_syrthes.m4
+
+* 20/07/2009 - Alexandre Douce <alexandre.douce at edf.fr>
+ Update particles tracking setup via the graphical interface.
+ modified routines:
+ gui/Pages/LagrangianBoundariesModel.py
+ gui/Pages/LagrangianBoundariesView.py
+ gui/Pages/LagrangianOutputForm.ui
+ gui/Pages/LagrangianStatisticsForm.ui
+ include/base/cs_gui_particles.h
+ include/base/cs_gui_radiative_transfer.h
+ src/base/cs_gui_boundary_conditions.c
+ src/base/cs_gui.c
+ src/base/cs_gui_mobile_mesh.c
+ src/base/cs_gui_particles.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/cs_gui_specific_physics.c
+ src/lagr/lagent.f90
+ src/lagr/lagopt.f90
+ src/rayt/raycli.f90
+ users/lagr/uslag1.f90
+ users/lagr/uslag2.f90
+
+* 17/07/2009 - David Monfort <david.monfort at edf.fr>
+ Merge code/code coupling feature from the development branch.
+ This feature is not yet functional as it has not been updated
+ to the new communications initialization for codes coupling.
+ added routines:
+ include/base/cplsat.h
+ src/base/csc2cl.f90
+ src/base/csc2ts.f90
+ src/base/csccel.f90
+ src/base/cscfbr.f90
+ src/base/cscini.f90
+ src/base/cscloc.f90
+ src/base/cscpce.f90
+ src/base/cscpfb.f90
+ src/base/cs_sat_coupling.c
+ src/base/memcs1.f90
+ src/base/memcs2.f90
+ users/base/ussatc.f90
+ modified routines:
+ include/base/cs_sat_coupling.h
+ include/base/paramx.h
+ src/base/caltri.f90
+ src/base/iniini.f90
+ src/base/navsto.f90
+ src/base/preduv.f90
+ src/base/tridim.f90
+ src/base/typecl.f90
+ modified script:
+ src/base/Makefile.am
+
+* 17/07/2009 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Improvements and fixes in the parallel join algorithm.
+ modified routines:
+ include/base/cs_join_post.h
+ include/base/cs_join_update.h
+ include/base/cs_join_util.h
+ include/base/cs_mesh.h
+ include/base/cs_mesh_quantities.h
+ include/base/cs_search.h
+ src/apps/cs_solver.c
+ src/base/cs_join.c
+ src/base/cs_join_intersect.c
+ src/base/cs_join_merge.c
+ src/base/cs_join_mesh.c
+ src/base/cs_join_post.c
+ src/base/cs_join_set.c
+ src/base/cs_join_split.c
+ src/base/cs_join_update.c
+ src/base/cs_join_util.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_search.c
+ users/base/usjoin.f90
+
+* 16/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix the behaviour of memory consumption output in case of error trapping.
+ modified routine:
+ src/base/cs_base.c
+
+* 16/07/2009 - Alexandre Douce <alexandre.douce at edf.fr>
+ Add particles tracking set-up within the graphical interface.
+ Code and comments cleaning, plus some fixes related to Xml file
+ management.
+ added routines:
+ gui/Pages/BoundaryConditionsParticlesModel.py
+ gui/Pages/BoundaryConditionsParticlesView.py
+ include/base/cs_gui_particles.h
+ src/base/cs_gui_particles.c
+ renamed routines:
+ include/base/cs_gui_mobile_mesh.h
+ src/base/cs_gui_mobile_mesh.c
+ modified script:
+ src/base/Makefile.am
+ modified routines:
+ gui/Base/BrowserView.py
+ gui/Base/BrowserView.py
+ gui/Base/QtPage.py
+ gui/Pages/AnalysisFeaturesView.py
+ gui/Pages/BatchRunningModel.py
+ gui/Pages/BoundaryConditionsVelocityInletView.py
+ gui/Pages/FluidCharacteristicsView.py
+ gui/Pages/LagrangianBoundariesForm.ui
+ gui/Pages/LagrangianBoundariesView.py
+ gui/Pages/Makefile.am
+ gui/Pages/MemoryAllocationForm.ui
+ gui/Pages/MobileMeshView.py
+ gui/Pages/NumericalParamGlobalForm.ui
+ gui/Pages/OutputVolumicVariablesModel.py
+ gui/Pages/ReferenceValuesModel.py
+ gui/Pages/SolutionDomainForm.ui
+ gui/Pages/SolutionVerifForm.ui
+ gui/Pages/SolutionVerifView.py
+ gui/Pages/ThermalRadiationView.py
+ gui/Pages/UserArraysForm.ui
+ gui/Pages/UserScalarPropertiesView.py
+ include/base/cs_gui.h
+ include/base/cs_gui_radiative_transfer.h
+ src/base/cs_gui_boundary_conditions.c
+ src/base/cs_gui.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/iniusi.f90
+ src/base/Makefile.am
+ src/base/strini.f90
+ src/lagr/lagent.f90
+ src/lagr/lagopt.f90
+ src/rayt/raycli.f90
+ src/rayt/rayopt.f90
+
+* 16/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Autotools machinery improvement for SYRTHES coupling and BLAS libraries.
+ modified scripts:
+ config/cs_blas.m4
+ config/cs_syrthes.m4
+ configure.ac
+
+* 10/07/2009 - Alexandre Douce <alexandre.douce at edf.fr>
+ Graphical interface update for radiative transfer modelling.
+ modified routines:
+ gui/Base/BrowserView.py
+ gui/Base/Toolbox.py
+ gui/Base/XMLinitialize.py
+ gui/Pages/BatchRunningModel.py
+ gui/Pages/BoundaryConditionsWallRadiativeTransferView.py
+ gui/Pages/Boundary.py
+ gui/Pages/CoalCombustionView.py
+ gui/Pages/CoalThermoChemistry.py
+ gui/Pages/ThermalRadiationModel.py
+ gui/Pages/ThermalRadiationView.py
+ gui/Pages/TimeStepView.py
+ gui/Pages/WelcomeView.py
+ include/base/cs_gui_radiative_transfer.h
+ include/base/cs_gui_variables.h
+ src/base/cs_gui.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/iniusi.f90
+ src/base/strini.f90
+ src/pprt/ppcsca.f90
+ src/rayt/raydom.f90
+ src/rayt/rayopt.f90
+ users/rayt/usray1.f90
+
+* 10/07/2009 - Fran�ois Jusserand <francois.jusserand at edf.fr>
+ Fix a bug when accounting for orthotropic mesh viscosity.
+ modified routine:
+ src/base/condli.f90
+
+* 10/07/2009 - David Monfort <david.monfort at edf.fr>
+ Remove exthis modification in usipes.
+ modified routine:
+ users/base/usini1.f90
+
+* 10/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix the calculation of the face-warping quality criterium.
+ modified routine:
+ src/base/cs_mesh_quality.c
+
+* 10/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ On Linux systems, use fenv library to trap floating point exceptions.
+ modified routine:
+ src/apps/cs_solver.c
+
+* 10/07/2009 - David Monfort <david.monfort at edf.fr>
+ Blank removal.
+
+* 10/07/2009 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Add parall mesh joining feature.
+ modified script:
+ src/base/Makefile.am
+ modified routines:
+ include/base/cs_prototypes.h
+ src/apps/cs_solver.c
+ added routines:
+ include/base/cs_join.h
+ include/base/cs_join_intersect.h
+ include/base/cs_join_merge.h
+ include/base/cs_join_mesh.h
+ include/base/cs_join_post.h
+ include/base/cs_join_set.h
+ include/base/cs_join_split.h
+ include/base/cs_join_update.h
+ include/base/cs_join_util.h
+ include/base/cs_search.h
+ include/base/cs_sort.h
+ src/base/cs_join.c
+ src/base/cs_join_f2c.f90
+ src/base/cs_join_intersect.c
+ src/base/cs_join_merge.c
+ src/base/cs_join_mesh.c
+ src/base/cs_join_post.c
+ src/base/cs_join_set.c
+ src/base/cs_join_split.c
+ src/base/cs_join_update.c
+ src/base/cs_join_util.c
+ src/base/cs_search.c
+ src/base/cs_sort.c
+ users/base/usjoin.f90
+
+* 10/07/2009 - David Monfort <david.monfort at edf.fr>
+ Rename cs_xxxx_util.f90 in cs_xxxx_f2c.f90 to highlight Fortran API.
+ added routines:
+ src/base/cs_post_f2c.f90
+ src/base/cs_selector_f2c.f90
+ src/base/cs_syr_f2c.f90
+ deleted routines:
+ src/base/cs_interpr_util.f90
+ src/base/cs_post_util.f90
+ src/base/cs_syr_util.f90
+ modified script:
+ src/base/Makefile.am
+
+* 08/07/2009 - David Monfort <david.monfort at edf.fr>
+ Add missing tests on Xml file presence.
+ modified routine:
+ src/base/iniusi.f90
+
+* 08/07/2009 - Alexandre Douce <alexandre.douce at edf.fr>
+ Numerous modifications in the Graphical User Interface.
+ - refactor of GUI reader.
+ - update coal combustion management for oxycombustion modelling
+ - update radiative transfer management (partly)
+ - activate formula management for b.c., phys. prop., ...
+ - activate atmospheric modelling
+ - activate mobile mesh and fluid structure interaction management
+ - several fixes
+ added file:
+ gui/Pages/icons/22x22/weather-few-clouds.png
+ added routines:
+ gui/Pages/BoundaryConditionsWallRadiativeTransferForm.ui
+ gui/Pages/BoundaryConditionsWallRadiativeTransferView.py
+ include/base/cs_gui_boundary_conditions.h
+ include/base/cs_gui_mobil_mesh.h
+ include/base/cs_gui_specific_physics.h
+ include/base/cs_gui_variables.h
+ src/base/cs_gui_boundary_conditions.c
+ src/base/cs_gui_mobil_mesh.c
+ src/base/cs_gui_specific_physics.c
+ modified scripts:
+ gui/Pages/Makefile.am
+ src/base/Makefile.am
+ modified routines:
+ gui/Base/BrowserView.py
+ gui/Base/MainView.py
+ gui/Base/Toolbox.py
+ gui/Base/XMLengine.py
+ gui/Pages/AnalysisFeaturesView.py
+ gui/Pages/AtmosphericFlowsForm.ui
+ gui/Pages/AtmosphericFlowsModel.py
+ gui/Pages/AtmosphericFlowsView.py
+ gui/Pages/BatchRunningModel.py
+ gui/Pages/BatchRunningView.py
+ gui/Pages/BoundaryConditionsCoalInletForm.ui
+ gui/Pages/BoundaryConditionsCoalInletView.py
+ gui/Pages/BoundaryConditionsForm.ui
+ gui/Pages/BoundaryConditionsMeteoForm.ui
+ gui/Pages/BoundaryConditionsMeteoView.py
+ gui/Pages/BoundaryConditionsMobileMeshView.py
+ gui/Pages/BoundaryConditionsSlidingWallView.py
+ gui/Pages/BoundaryConditionsTurbulenceInletView.py
+ gui/Pages/BoundaryConditionsVelocityInletForm.ui
+ gui/Pages/BoundaryConditionsVelocityInletView.py
+ gui/Pages/BoundaryConditionsView.py
+ gui/Pages/Boundary.py
+ gui/Pages/CoalCombustionForm.ui
+ gui/Pages/CoalCombustionModel.py
+ gui/Pages/CoalCombustionView.py
+ gui/Pages/CoalThermoChemistry.py
+ gui/Pages/FluidCharacteristicsModel.py
+ gui/Pages/FluidCharacteristicsView.py
+ gui/Pages/FluidStructureInteractionView.py
+ gui/Pages/LocalizationView.py
+ gui/Pages/MobileMeshView.py
+ gui/Pages/NumericalParamEquationModel.py
+ gui/Pages/NumericalParamGlobalView.py
+ gui/Pages/OutputVolumicVariablesModel.py
+ gui/Pages/ProfilesModel.py
+ gui/Pages/QMeiEditorView.py
+ gui/Pages/resources_pages.qrc
+ gui/Pages/SalomeHandler.py
+ gui/Pages/SolutionDomainView.py
+ gui/Pages/StartRestartForm.ui
+ gui/Pages/ThermalRadiationForm.ui
+ gui/Pages/ThermalRadiationView.py
+ gui/Pages/TimeAveragesModel.py
+ gui/Pages/TimeStepModel.py
+ include/base/cs_gui.h
+ include/base/cs_gui_matisse.h
+ include/base/cs_gui_radiative_transfer.h
+ include/base/cs_gui_util.h
+ src/atmo/atini1.f90
+ src/atmo/atprop.f90
+ src/atmo/atvarp.f90
+ src/base/cs_gui.c
+ src/base/cs_gui_matisse.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/cs_gui_util.c
+ src/base/iniusi.f90
+ src/base/phyvar.f90
+ src/base/strdep.f90
+ src/base/tridim.f90
+ src/base/varpos.f90
+ src/cplv/cpprop.f90
+ src/cplv/cpvarp.f90
+ src/rayt/rayopt.f90
+ users/base/usalcl.f90
+
+* 08/07/2009 - Bertrand Carissimo <bertrand.carissimo at edf.fr>
+ Maya Milliez <maya.milliez at edf.fr>
+ Add non-neutral atmosphere modelling (both dry and humid, though
+ humid atmosphere modelling is not yet fully functional).
+ added routines:
+ src/atmo/atmcls.f90
+ src/atmo/atphyv.f90
+ src/atmo/atprop.f90
+ src/atmo/atprke.f90
+ src/atmo/atvarp.f90
+ modified routines:
+ include/atmo/atincl.h
+ src/atmo/atini1.f90
+ src/atmo/atlecm.f90
+ src/atmo/attycl.f90
+ src/atmo/Makefile.am
+ src/base/clptrg.f90
+ src/base/turbke.f90
+ src/pprt/ppcsca.f90
+ src/pprt/ppphyv.f90
+ src/pprt/ppprop.f90
+ src/pprt/ppvarp.f90
+ users/atmo/usatcl.f90
+ users/atmo/usativ.f90
+ users/pprt/usppmo.f90
+
+* 08/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix a check on the multigrid algorithm. Convert the abort on
+ error from a test on the pressure to a test on the convection.
+ modified routine:
+ src/base/verini.f90
+
+* 07/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Add tags in the time-monitoring files for SALOME.
+ Change the files name in probes_XXXX.dat
+ modified script:
+ bin/runcase.in
+ modified routines:
+ include/base/entsor.h
+ src/base/ecrhis.f90
+ src/base/iniini.f90
+
+* 07/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a missing cs_config.h header and wrong MPI type.
+ modified routine:
+ src/base/cs_boundary_conditions.c
+
+* 07/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Use a Fortran 95 feature - advance=no - in writing formats instead of
+ the deprecating use of the dollar symbol.
+ modified routine:
+ src/base/csprnt.f90
+
+* 07/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ When detecting a divergence in the linear system solver stage, abort
+ and write graphical data of the given matrix (rhs, diagonal, ...).
+ modified routines:
+ include/base/cs_grid.h
+ include/base/cs_sles.h
+ src/base/cs_grid.c
+ src/base/cs_multigrid.c
+ src/base/cs_sles.c
+
+* 07/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add some management functions for post-processing writer definition
+ in case of one encounters an error.
+ modified routines:
+ include/base/cs_post.h
+ src/base/cs_post.c
+
+* 07/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Make easier the launch of a SYRTHES 3 / Code_Saturne coupling.
+ through sockets.
+ modified script:
+ bin/runcase.in
+ modified routines:
+ include/base/cs_opts.h
+ include/base/cs_syr3_comm.h
+ include/base/cs_syr_coupling.h
+ src/apps/cs_solver.c
+ src/base/cs_opts.c
+ src/base/cs_syr3_comm.c
+ src/base/cs_syr_coupling.c
+
+* 07/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ OpenMP-related modifications.
+ modified routines:
+ include/base/cs_grid.h
+ include/base/cs_prototypes.h
+ include/base/parall.h
+ include/base/paramx.h
+ src/apps/cs_solver.c
+ src/base/cs_grid.c
+ src/base/cs_multigrid.c
+ src/base/cs_renumber.c
+ src/base/csinit.f90
+ src/base/majgeo.f90
+
+* 06/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a wrong post-processing management for 2D SYRTHES-coupled meshes
+ with SYRTHES 4.
+ modified routines:
+ include/base/cs_post.h
+ src/base/cs_mesh_solcom.c
+ src/base/cs_post.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_syr4_coupling.c
+ src/ctwr/cs_ctwr.c
+
+* 06/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add a mesh category for an easier management of user-defined
+ post-processing.
+ modified routines:
+ include/base/cs_post.h
+ include/base/cs_prototypes.h
+ src/base/cs_post.c
+ src/base/dvvpst.f90
+
+* 06/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add a subroutine to control the behaviour of MPI I/O.
+ modified routines:
+ include/base/cs_io.h
+ src/apps/cs_solver.c
+ src/base/cs_io.c
+ src/base/cs_preprocessor_data.c
+ src/base/cs_restart.c
+
+* 06/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Refactor compiler detection to alleviate some issues with IBM
+ compilers (autodetection of xlc on non-BlueGene systems and
+ for two different BlueGene systems on the same frontal).
+ Add a MPI_TYPE autodetection for different MPI distribution.
+ Code improvement/cleaning.
+ modified scripts:
+ bin/cs_check_consistency.py
+ bin/cs_config.py.in
+ bin/runcase.help
+ bin/runcase.in
+ config/cs_auto_flags.sh
+ config/cs_mpi.m4
+
+* 06/07/2009 - David Monfort <david.monfort at edf.fr>
+ Remove call to the removed usruet subroutine.
+ modified routine:
+ src/base/clptrg.f90
+
+* 06/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Code and comment cleaning.
+ modified routines:
+ include/base/cs_boundary_conditions.h
+ include/base/cs_grid.h
+ include/base/cs_mesh.h
+ include/base/cs_mesh_quantities.h
+ include/base/cs_multigrid.h
+ include/base/cs_numbering.h
+ include/base/cs_post.h
+ include/base/cs_restart.h
+ include/base/cs_sles.h
+ src/base/cs_grid.c
+ src/base/cs_halo.c
+ src/base/cs_io.c
+ src/base/cs_matrix.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_quality.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_multigrid.c
+ src/base/cs_numbering.c
+ src/base/cs_opts.c
+ src/base/cs_post.c
+ src/base/cs_sles.c
+ src/base/ecrhis.f90
+ src/base/ecrlis.f90
+ src/base/typecl.f90
+ src/base/viswal.f90
+ users/base/usdpst.f90
+ users/base/ussyrc.f90
+
+* 06/07/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug in the grid coarsening in case of parallelism.
+ modified routine:
+ src/base/cs_grid.c
+
+* 06/07/2009 - David Monfort <david.monfort at edf.fr>
+ Remove nearly never used user subroutine for u* calculation.
+ removed routine:
+ users/base/usruet.f90
+ modified routine:
+ src/base/clptur.f90
+ modified documentation:
+ doc/theory/clptrg.tex
+ doc/theory/clptur.tex
+ doc/user/saturne1.tex
+ modified script:
+ src/base/Makefile.am
+
+* 03/07/2009 - Alexandre Douce <alexandre.douce at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Several modifications of radiative transfer module.
+ - Only one radiating phase is now possible
+ - Use of propce and propfb arrays to store most of the variables
+ - Use of standard routines for post-processing, leveraging the
+ need of single-processor simulation for boundary variables output
+ - Activation of the radiative transfer module from usray1, and no
+ more from the different dp_XXX data files for specific physics
+ modified thermochemistry data files:
+ data/thch/dp_C3P
+ data/thch/dp_C3PSJ
+ data/thch/dp_C4P
+ data/thch/dp_FCP
+ data/thch/dp_FUE
+ modified scripts:
+ src/fuel/Makefile.am
+ src/rayt/Makefile.am
+ removed routines:
+ src/rayt/raybrd.f90
+ src/rayt/rayens.f90
+ modified routines:
+ include/base/cs_gui.h
+ include/base/cs_gui_radiative_transfer.h
+ include/lagr/lagran.h
+ include/pprt/ppincl.h
+ include/rayt/radiat.h
+ src/base/caltri.f90
+ src/base/clptrg.f90
+ src/base/clptur.f90
+ src/base/condli.f90
+ src/base/covofi.f90
+ src/base/cs_gui.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/dvvpst.f90
+ src/base/impini.f90
+ src/base/iniusi.f90
+ src/base/memcli.f90
+ src/base/tridim.f90
+ src/base/varpos.f90
+ src/base/verini.f90
+ src/cogz/coini1.f90
+ src/cogz/colecd.f90
+ src/cogz/coprop.f90
+ src/cogz/d3pint.f90
+ src/cogz/d3pphy.f90
+ src/cogz/ebuphy.f90
+ src/cogz/pdflwc.f90
+ src/cogz/pdfpp4.f90
+ src/cplv/cpini1.f90
+ src/cplv/cplecd.f90
+ src/cplv/cplin1.f90
+ src/cplv/cplpro.f90
+ src/cplv/cpprop.f90
+ src/cplv/cprays.f90
+ src/elec/ellecd.f90
+ src/elec/elphyv.f90
+ src/elec/elveri.f90
+ src/fuel/fuini1.f90
+ src/fuel/fulecd.f90
+ src/fuel/fuprop.f90
+ src/lagr/lagcou.f90
+ src/lagr/lagent.f90
+ src/lagr/lagich.f90
+ src/lagr/lagitp.f90
+ src/lagr/laglec.f90
+ src/lagr/lagopt.f90
+ src/lagr/lagout.f90
+ src/pprt/ppcabs.f90
+ src/pprt/ppinii.f90
+ src/pprt/ppray4.f90
+ src/rayt/memra1.f90
+ src/rayt/memra2.f90
+ src/rayt/memra3.f90
+ src/rayt/raycli.f90
+ src/rayt/raydir.f90
+ src/rayt/raydom.f90
+ src/rayt/raylec.f90
+ src/rayt/rayopt.f90
+ src/rayt/rayout.f90
+ src/rayt/raypar.f90
+ src/rayt/raypun.f90
+ src/rayt/raysca.f90
+ src/rayt/raysol.f90
+ users/cogz/usd3p1.f90
+ users/cogz/usebu1.f90
+ users/cogz/uslwc1.f90
+ users/cplv/uscpl1.f90
+ users/elec/uselph.f90
+ users/lagr/uslaed.f90
+ users/lagr/uslast.f90
+ users/rayt/usray1.f90
+ users/rayt/usray2.f90
+ users/rayt/usray3.f90
+ users/rayt/usray4.f90
+ users/rayt/usray5.f90
+
+* 03/07/2009 - David Monfort <david.monfort at edf.fr>
+ Add a configure option to disable the graphical interface support.
+ modified scripts:
+ configure.ac
+ Makefile.am
+
+* 02/07/2009 - David Monfort <david.monfort at edf.fr>
+ Merge syr_cs library into the kernel package for an easier
+ maintenance and installation.
+ Move preprocessor serach macro in configure.ac script.
+ added script:
+ config/cs_syrthes.m4
+ removed script:
+ config/cs_tools.m4
+ modified scripts:
+ bin/cs_compile.py
+ bin/cs_config.py.in
+ bin/runcase_coupling.in
+ bin/runcase.in
+ bin/runcase_syrthes
+ configure.ac
+ Makefile.am
+ added routines:
+ libsyrcs
+ libsyrcs/Makefile.am
+ libsyrcs/syr_comm.c
+ libsyrcs/syr_comm.h
+ libsyrcs/syr_coupling.c
+ libsyrcs/syr_coupling.h
+ libsyrcs/syr_cs.c
+ libsyrcs/syr_defs.c
+ libsyrcs/syr_defs.h
+
+* 02/07/2009 - David Monfort <david.monfort at edf.fr>
+ Pass Fortran specific libraries only to executable link stage.
+ modified scripts:
+ configure.ac
+ bin/cs_config.py.in
+ src/apps/Makefile.am
+
+* 01/07/2009 - Richard Howard <richard.howard at edf.fr>
+ Add a new turbulence model for LES: the WALE model.
+ added routine:
+ src/base/viswal.f90
+ modified routines:
+ gui/Pages/NumericalParamEquationModel.py
+ gui/Pages/NumericalParamEquationView.py
+ gui/Pages/TimeStepModel.py
+ gui/Pages/TimeStepView.py
+ gui/Pages/TurbulenceModel.py
+ gui/Pages/TurbulenceView.py
+ include/base/cstphy.h
+ src/base/cs_gui.c
+ src/base/impini.f90
+ src/base/iniini.f90
+ src/base/Makefile.am
+ src/base/memphy.f90
+ src/base/modini.f90
+ src/base/phyvar.f90
+ src/base/tridim.f90
+ src/base/verini.f90
+ users/base/usini1.f90
+
+* 01/07/2009 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Fix a wrong division by the density in the norm calculation for
+ mass and lagrangian source terms.
+ modified routine:
+ src/base/resolp.f90
+
+* 01/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix a wrong test on radiative transfer modelling activated by
+ specific physics.
+ modified routine:
+ src/rayt/rayopt.f90
+
+* 01/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix a missing "if" when testing for radiative transfer.
+ modified routine:
+ src/base/covofi.f90
+
+* 01/07/2009 - David Monfort <david.monfort at edf.fr>
+ Fix minor bugs introduced when committing user script modifications.
+ modified scripts:
+ bin/cs_check_consistency.py
+ bin/runcase.in
+
+* 26/06/2009 - David Monfort <david.monfort at edf.fr>
+ Remove warning on padding.
+ modified script:
+ config/cs_auto_flags.sh
+
+* 16/06/2009 - David Monfort <david.monfort at edf.fr>
+ Remove executable bits for Python modules.
+ modified scripts:
+ bin/cs_check_consistency.py
+ bin/cs_check_mesh.py
+ bin/cs_compile.py
+ bin/cs_config.py.in
+ bin/cs_create.py
+ bin/cs_info.py
+ bin/cs_plot_probes.py
+ gui/cs_gui.py
+
+* 16/06/2009 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Fix bugs in the scalar source terms for pulverized coal combustion
+ with CO2 equation (wrong pointer, wrong use of unitialize arrays).
+ modified routine:
+ src/cplv/cptssc.f90
+
+* 15/06/2009 - David Monfort <david.monfort at edf.fr>
+ Enable the multigrid algorithm for the diffusion equation in
+ the electric arcs, Lagrangian, radiative transfert (P1 model)
+ and ALE modules.
+ modified scripts:
+ src/base/codits.f90
+ src/base/varpos.f90
+ src/elec/elini1.f90
+ src/lagr/lageqp.f90
+ src/rayt/raypun.f90
+
+* 15/06/2009 - J�r�me Lucas <jerome.lucas at incka.fr>
+ Fix a missing initialization in the halo structure.
+ modified routine:
+ src/base/cs_halo.c
+
+* 15/06/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Code cleaning.
+ modified routines:
+ include/base/cs_boundary_conditions.h
+ src/base/cs_boundary_conditions.c
+
+* 15/06/2009 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Fix a wrong array indirection in mass source term calculation.
+ modified routines:
+ src/base/mempdc.f90
+ src/base/resolp.f90
+
+* 15/06/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a tricky bug in Bull optimization for matrix/vector product,
+ often seen while using the multigrid algorithm (more occurences...)
+ modified routine:
+ src/base/cs_matrix.c
+
+* 15/06/2009 - David Monfort <david.monfort at edf.fr>
+ Fix mass flux calculation for fans modelling.
+ modified routine:
+ src/base/cs_ventil.c
+
+* 15/06/2009 - Fran�ois Jusserand <francois.jusserand at edf.fr>
+ Fix a missing variable initialization for Code_Aster coupling.
+ modified routine:
+ src/base/cs_ast_coupling.c
+
+* 15/06/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Update compiler flags for SX9 system and add -fbounds-check for gcc.
+ modified script:
+ config/cs_auto_flags.sh
+
+* 15/06/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix to avoid error in bounds checking with gcc.
+ modified routine:
+ src/base/covofi.f90
+
+* 15/06/2009 - David Monfort <david.monfort at edf.fr>
+ Use the default reader for pdf.
+ modified script:
+ bin/cs_info.py
+
+* 15/06/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Replace all the different user scripts by a single one.
+ modified scripts:
+ configure.ac
+ Makefile.am
+ doc/refcard/refcard.tex
+ gui/Makefile.am
+ gui/Base/MainView.py
+ added scripts:
+ bin/cs.in
+ bin/cs_check_consistency.py
+ bin/cs_check_mesh.py
+ bin/cs_compile.py
+ bin/cs_create.py
+ bin/cs_info.py
+ bin/cs_plot_probes.py
+ gui/cs_gui.py
+ removed scripts:
+ bin/cs_check_consistency.in
+ bin/cs_check_mesh.in
+ bin/cs_compile.in
+ bin/cs_config.py.in
+ bin/cs_create.in
+ bin/cs_info.in
+ bin/cs_plot_probes.in
+ bin/SaturneGUI.in
+ gui/cs_gui.in
+
+* 28/05/2009 - David Monfort <david.monfort at edf.fr>
+ Add a trick to by-pass the PYTHONPATH environment variable.
+ modified script:
+ gui/cs_gui.in
+
+* 28/05/2009 - David Monfort <david.monfort at edf.fr>
+ Update user scripts with respect to the GUI integration,
+ remove the ics_prefix references.
+ modified scripts:
+ bin/cs_info.in
+ bin/runcase.in
+ bin/runcase_coupling.in
+ bin/cs_config.py.in
+
+* 27/05/2009 - David Monfort <david.monfort at edf.fr>
+ Update to new mkpyqt.py script.
+ Remove two generated resources files.
+ modified script:
+ gui/sbin/mkpyqt.py
+ removed files:
+ gui/Base/resource_base_rc.py
+ gui/Pages/resources_pages_rc.py
+
+* 26/05/2009 - David Monfort <david.monfort at edf.fr>
+ Merge the Graphical User Interface module within the Kernel
+ module for a better consistency in development and maintenance.
+ See the ICS Subversion repository for previous ChangeLog.
+ added module:
+ gui
+ modified scripts:
+ configure.ac
+ config/cs_tools.m4
+ bin/SaturneGUI.in
+ Makefile.am
+
+* 26/05/2009 - David Monfort <david.monfort at edf.fr>
+ Tagging version 2.0 beta1
+
+* 20/04/2009 - David Monfort <david.monfort at edf.fr>
+ Mis-spelling of syr_cs_profile.
+ modified script:
+ bin/runcase_syrthes
+
+* 15/04/2009 - David Monfort <david.monfort at edf.fr>
+ Fix BG/L and /P ESSL BLAS detection.
+ modified script:
+ config/cs_auto_flags.sh
+ config/cs_blas.m4
+
+* 14/04/2009 - David Monfort <david.monfort at edf.fr>
+ Change the order of header directory search when compiling.
+ modified script:
+ bin/cs_compile.in
+
+* 14/04/2009 - David Monfort <david.monfort at edf.fr>
+ Make all Python scripts depend on the right Python interpreter.
+ Revert to 2.0.0-beta version number.
+ modified scripts:
+ bin/cs_check_consistency.in
+ bin/cs_check_mesh.in
+ bin/cs_compile.in
+ bin/cs_config.py.in
+ bin/cs_create.in
+ bin/cs_info.in
+ bin/cs_plot_probes.in
+ configure.ac
+
+* 14/04/2009 - David Monfort <david.monfort at edf.fr>
+ Add a quick reference card documentation.
+ Remove the reference to the VERS keyword in user subroutines.
+ Change the version number to 2.0-beta1.
+ modified files:
+ doc/refcard/refcard.tex
+ configure.ac
+ Makefile.am
+
+* 10/04/2009 - David Monfort <david.monfort at edf.fr>
+ Fix the opt-libs option parsing in the compilation script.
+ modified script:
+ bin/cs_compile
+
+* 08/04/2009 - David Monfort <david.monfort at edf.fr>
+ Fix data/results for SYRTHES coupling.
+ modified scritps:
+ bin/runcase.in
+ bin/runcase_syrthes
+
+* 08/04/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Merge debug and optimized LDFLAGS.
+ modified scripts:
+ configure.ac
+ src/*/Makefile.am
+
+* 08/04/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Add support for a future use of MEI library for function
+ interpretrer.
+ Corrections in compile and autoflags scripts.
+ added script:
+ config/cs_mei.m4
+ modified scripts:
+ configure.ac
+ bin/cs_config.py.in
+ config/cs_auto_flags.sh
+ src/apps/Makefile.am
+ src/base/Makefile.am
+
+* 08/04/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Missing common for OpenMP support and simplification
+ in boundary conditions output.
+ modified routines:
+ include/base/parall.h
+ src/base/typecl.f90
+
+* 30/03/2009 - David Monfort <david.monfort at edf.fr>
+ Update cs_auto_flags.sh (missing optimized flags)
+ modified script:
+ config/cs_auto_flags.sh
+
+* 27/03/2009 - David Monfort <david.monfort at edf.fr>
+ Correct way of handling a local Python installation.
+ Update to the new name of the GUI script: cs_gui.
+ bin/SaturneGUI.in
+ configure.ac
+ config/cs_tools.m4
+
+* 27/03/2009 - David Monfort <david.monfort at edf.fr>
+ Translation dictionary update.
+ modified files:
+ po/fr.po
+ po/POTFILES.in
+
+* 27/03/2009 - David Monfort <david.monfort at edf.fr>
+ Documentation update.
+ modified files:
+ doc/manpages/cs_check_consistency.1
+ doc/manpages/cs_create.1
+ doc/manpages/cs_info.1
+ doc/user/saturne1.tex
+ doc/user/saturne2.tex
+
+* 27/03/2009 - David Monfort <david.monfort at edf.fr>
+ Move from getopt to optparse module in Python scripts to handle
+ the command line.
+ Add a --force option to the compilation script (in case no source
+ files are present).
+ Change some missing classical short/long options in some scripts.
+ modified scripts:
+ bin/cs_check_consistency
+ bin/cs_check_mesh.in
+ bin/cs_compile.in
+ bin/cs_create.in
+ bin/cs_info.in
+ bin/cs_plot_probes
+ bin/runcase.in
+
+* 27/03/2009 - David Monfort <david.monfort at edf.fr>
+ Use the new cs_preprocess name for autoconf detection.
+ Add a PYTHONPATH variable export in order to be able to launch
+ the GUI correctly.
+ modified scripts:
+ bin/SaturneGUI
+ config/cs_tools.m4
+
+* 27/03/2009 - David Monfort <david.monfort at edf.fr>
+ Add a runcase_coupling script to launch code/code coupling
+ simulations (experimental, only the script works).
+ added scripts:
+ bin/runcase_coupling.in
+ modified scripts:
+ configure.ac
+ Makefile.am
+
+* 27/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Disable OpenMP by default.
+ Add a missing -DHAVE_CONFIG_H in the cs_compile script.
+ modified scripts:
+ bin/cs_compile
+ configure.ac
+
+* 27/03/2009 - David Monfort <david.monfort at edf.fr>
+ Add an "apps" directory in which the compilation of Code_Saturne
+ main library and applications is done.
+ Rename cs_main.c in cs_solver.c
+ Add the pre-requisite version of Python (2.3).
+ added files:
+ src/apps
+ src/apps/cs_solver.c
+ src/apps/Makefile.am
+ src/Makefile.am
+ removed routine:
+ src/base/cs_main.c
+ modified files:
+ src/base/Makefile.am
+ configure.ac
+ Makefile.am
+
+* 25/03/2009 - David Monfort <david.monfort at edf.fr>
+ Temporarily set the architecture name (for EDF purposes), this
+ part will be rewritten later on.
+ modified script:
+ bin/runcase_mpi_env
+
+* 25/03/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Add a trick in some Python user scripts so that one does not
+ have to set the PYTHONPATH variable in case the install path
+ is not standard.
+ modified scipts:
+ bin/cs_check_mesh
+ bin/cs_compile
+ bin/cs_create
+ bin/cs_info
+ configure.ac
+
+* 25/03/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Change the way one detects OpenMPI (version 1.3).
+ Two minor corrections in the runcase_syrthes scripts (some
+ results were not copied back).
+ Make the long options of the code use the double-hyphen style.
+ modified files:
+ bin/cs_check_mesh
+ bin/cs_compile
+ bin/runcase.help
+ bin/runcase.in
+ bin/runcase_mpi_rank
+ bin/runcase_syrthes
+ doc/manpages/cs_check_mesh.1
+ doc/manpages/cs_info.1
+ doc/manpages/cs_solver.1
+ doc/user/saturne1.tex
+ po/fr.po
+ src/base/cs_opts.c
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Add a trick to fool the Makefile.in.in from gettext support
+ so that it handles the install-pdf target.
+ Update the autoflags and cs_lagr.c accordingly.
+ Small modification in the documentation macros.
+ modified files:
+ config/cs_auto_flags.sh
+ doc/style/csmacros.sty
+ po/fr.po
+ po/Rules-install
+ src/lagr/cs_lagr.c
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Update French dictionnary.
+ Remove ale.tex, integrated in the user guide.
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Update Subversion ignore property.
+ modified directories:
+ config
+ doc/refcard
+ doc/refcard/graphics
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Several modifications and corrections related to missing
+ information (mostly).
+ Updated GUI-related scripts in order to use an installed
+ version of the GUI.
+ modified scripts:
+ bin/cs_config.py.in
+ bin/SaturneGUI.in
+ config/cs_auto_flags.sh
+ config/cs_tools.m4
+ configure.ac
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Remove standard user shell script by Python ones.
+ modified scripts:
+ bin/cs_check_consistency
+ bin/cs_check_mesh
+ bin/cs_create
+ bin/cs_info
+ bin/cs_plot_probes
+ bin/runcase.in
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Reorganize the test cases database in a simpler way.
+ Remove obsolete tex files.
+ removed files:
+ doc/theory/introd_fonc.save
+ doc/theory/introd_fonc.tex.last
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Lot of Makefile changes related to package distribution.
+ Add a refcard documentation and some missing manpages.
+ Add a csmacro and a csvers file containing all the macros
+ and version for Code_Saturne documentation.
+ Install cs_config.py in a Python site-package.
+ Rename TEST_CASES in test_cases.
+ modified files:
+ configure.ac
+ doc/howto/graphics/Makefile.am
+ doc/howto/howto.tex
+ doc/howto/Makefile.am
+ doc/Makefile.am
+ doc/manpages/cs_compile.1
+ doc/manpages/cs_config.1
+ doc/manpages/cs_create.1
+ doc/manpages/cs_info.1
+ doc/manpages/cs_plot_probes.1
+ doc/manpages/cs_solver.1
+ doc/refcard
+ doc/refcard/graphics
+ doc/refcard/graphics/Makefile.am
+ doc/refcard/Makefile.am
+ doc/refcard/refcard.tex
+ doc/style/csdoc.sty
+ doc/style/csindex.sty
+ doc/style/csmacros.sty
+ doc/style/csvers.tex.in
+ doc/theory/graphics/Makefile.am
+ doc/theory/Makefile.am
+ doc/theory/theory.tex
+ doc/tutorial/graphics/Makefile.am
+ doc/tutorial/Makefile.am
+ doc/tutorial/test_cases
+ doc/tutorial/tutorial.tex
+ doc/user/graphics/Makefile.am
+ doc/user/Makefile.am
+ doc/user/saturne1.tex
+ doc/user/saturne2.tex
+ doc/user/user.tex
+ Makefile.am
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Bug correction in SYRTHES coupling script.
+ modified script:
+ bin/runcase_syrthes
+
+* 23/03/2009 - David Monfort <david.monfort at edf.fr>
+ Remove the test on iasize in memory management routines where
+ one does not need anymore new integer arrays. Fix a potential
+ bug (introduced with the new multigrid algorithm) when
+ checking a non-initialized variable.
+ modified routines:
+ src/base/memale.f90
+ src/base/memdis.f90
+ src/base/memdyp.f90
+ src/base/memkep.f90
+ src/base/memkom.f90
+ src/base/memnav.f90
+ src/base/memrij.f90
+ src/base/memsca.f90
+ src/base/memv2f.f90
+ src/cfbl/memcfm.f90
+ src/rayt/memra2.f90
+
+* 20/03/2009 - David Monfort <david.monfort at edf.fr>
+ Minor corrections and improvements based on feedback from
+ Debian packager S. Ledru.
+ added scripts:
+ bin/runcase_mpi_env
+ bin/runcase_mpi_rank
+ bin/runcase_syrthes
+ deleted scripts:
+ bin/cs_runcase_mpi_env
+ bin/cs_runcase_mpi_rank
+ bin/cs_runcase_syrthes.in
+ sbin/compil
+ sbin/gettextize
+ sbin/install
+ modified scripts:
+ bin/cs_config.py.in
+ bin/runcase.in
+ config/cs_auto_flags.sh
+ configure.ac
+ Makefile.am
+ src/atmo/Makefile.am
+ src/base/Makefile.am
+ src/cfbl/Makefile.am
+ src/cogz/Makefile.am
+ src/cplv/Makefile.am
+ src/ctwr/Makefile.am
+ src/elec/Makefile.am
+ src/fuel/Makefile.am
+ src/lagr/Makefile.am
+ src/pprt/Makefile.am
+ src/rayt/Makefile.am
+
+* 20/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Port autotools build system to BlueGene and Itanium systems.
+ Add full BLAS and OpenMP support.
+ modified scripts:
+ config/cs_auto_flags.sh
+ config/cs_blas.m4
+ config/cs_fvm.m4
+ config/cs_libxml2.m4
+ config/cs_mpi.m4
+ config/cs_tools.m4
+ configure.ac
+
+* 20/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Upgrade to BFT 1.1.
+ Corrections and modifications for OpenMP support.
+ Other small fixes regarding autotools support.
+ modified script:
+ src/base/Makefile.am
+ modified routines:
+ include/base/cs_base.h
+ include/base/cs_blas.h
+ include/base/cs_opts.h
+ include/base/parall.h
+ src/base/cs_ast_coupling.c
+ src/base/cs_base.c
+ src/base/cs_blas.c
+ src/base/cs_main.c
+ src/base/cs_matrix.c
+ src/base/cs_opts.c
+ src/base/cs_syr3_coupling.c
+ src/base/majgeo.f90
+ src/ctwr/cs_ctwr.c
+ users/base/usdpst.f90
+
+* 17/03/2009 - David Monfort <david.monfort at edf.fr>
+ Add man pages for the main scripts to the documentation.
+ added files:
+ doc/manpages
+ doc/manpages/cs_info.1
+ doc/manpages/cs_check_consistency.1
+ doc/manpages/cs_create.1
+ doc/manpages/cs_config.1
+ doc/manpages/cs_plot_probes.1
+ doc/manpages/cs_check_mesh.1
+ modified script:
+ Makefile.am
+
+* 17/03/2009 - David Monfort <david.monfort at edf.fr>
+ Take into account the correct installation path for pdf documentation.
+ modified scripts:
+ bin/cs_create.in
+ bin/cs_info.in
+
+* 17/03/2009 - David Monfort <david.monfort at edf.fr>
+ Bug correction in the copy of SYRTHES results.
+ modified script:
+ bin/cs_runcase_syrthes.in
+
+* 17/03/2009 - David Monfort <david.monfort at edf.fr>
+ Rename all scripts to remain coherent throughout Code_Saturne
+ distribution.
+ modified scripts:
+ configure.ac
+ Makefile.am
+
+* 16/03/2009 - David Monfort <david.monfort at edf.fr>
+ Major overhauling of the documentation building to keep
+ automake rules.
+
+* 16/03/2009 - David Monfort <david.monfort at edf.fr>
+ Make lowercase documentation directories.
+
+* 11/03/2009 - David Monfort <david.monfort at edf.fr>
+ Remove (at last!) the cs_profile, Makefile and macros files.
+ removed scripts:
+ bin/cs_profile
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+ bin/macros_Darwin.mk
+ bin/macros_Linux.mk
+ bin/macros_Linux_IA64.mk
+ bin/macros_Linux_x86_64.mk
+ bin/macros_SX9.mk
+ bin/Makefile
+ extras/macros_old/macros_IRIX64.mk
+ extras/macros_old/macros_SunOS.mk
+ extras/macros_old/macros_OSF1.mk
+ extras/macros_old/macros_Linux_CCRT.mk
+ extras/macros_old/macros_HP-UX.mk
+ extras/macros_old/README
+ extras/macros_old
+
+* 11/03/2009 - David Monfort <david.monfort at edf.fr>
+ Add a --with-python option so that the Python executable used
+ by the SaturneGUI script can be set up at installation stage.
+ Minor modifications in the runcase script.
+ modified scripts:
+ bin/runcase.in
+ bin/SaturneGUI.in
+ config/cs_tools.m4
+ configure.ac
+
+* 11/03/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Add a cs_compile Python script to enable user compilation,
+ based on information provided by cs_config.py, and add rpath
+ handling in this latter script to be able to link even if the
+ library path is not standard.
+ Add a call to the new syr_cs_profile in SYRTHES coupling
+ handling.
+ Modify the behaviour of cs_create so that the comment removal
+ and version tag is done at the installation stage, and no more
+ at the study structure creation.
+ Minor correction and modification in the runcase script.
+ added scripts:
+ bin/cs_compile
+ bin/runcase_syrthes.in
+ removed scripts:
+ bin/runcase_syrthes
+ modified scripts:
+ bin/cs_config.py.in
+ bin/cs_create.in
+ bin/runcase.in
+ config/cs_auto_flags.sh
+ config/cs_tools.m4
+ configure.ac
+ Makefile.am
+
+* 10/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add a Python config files to enable the user scripts to
+ be aware of the build and install options.
+ added scripts:
+ bin/cs_config.py.in
+ configure.ac
+ modified scripts:
+ config/cs_auto_flags.sh
+ config/cs_config_info.m4
+
+* 09/03/2009 - David Monfort <david.monfort at edf.fr>
+ Do not compile the code if there is no user file.
+ modified script:
+ bin/runcase.in
+
+* 09/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Refactoring of the mesh renumbering feature in order
+ to account for OpenMP support. Still missing is the
+ correct numbering of interior and boundary faces.
+ Based on initial work of Pascal Vezolles from IBM.
+ added routines:
+ include/base/cs_numbering.h
+ src/base/cs_numbering.c
+ modified routines:
+ include/base/cs_base.h
+ include/base/cs_matrix.h
+ include/base/cs_mesh.h
+ include/base/cs_prototypes.h
+ include/base/cs_renumber.h
+ include/base/parall.h
+ include/base/paramx.h
+ include/base/vector.h
+ src/base/cs_base.c
+ src/base/cs_benchmark.c
+ src/base/cs_grid.c
+ src/base/csinit.f90
+ src/base/cs_main.c
+ src/base/cs_matrix.c
+ src/base/cs_mesh.c
+ src/base/cs_renumber.c
+ src/base/cs_sles.c
+ src/base/gradmc.f90
+ src/base/iniini.f90
+ src/base/majgeo.f90
+ src/base/numvec.f90
+ src/base/prods2.f90
+ src/base/prods3.f90
+ src/base/prodsc.f90
+ modified scripts:
+ po/POTFILES.in
+ src/base/Makefile.am
+
+* 09/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Create a graphical post-processing view of the boundary
+ conditions definition in case of error.
+ added routines:
+ include/base/cs_boundary_conditions.h
+ src/base/cs_boundary_conditions.c
+ modified scripts:
+ po/POTFILES.in
+ src/base/Makefile.am
+ modified routines:
+ include/base/cs_post.h
+ src/base/cs_post.c
+ src/base/typecl.f90
+
+* 09/03/2009 - David Monfort <david.monfort at edf.fr>
+ Replace CS_HOME fixed behaviour with autoconf handling
+ in check_mesh, cs_create, cs_info, runcase and SaturneGUI.
+ Remove unused scripts.
+ modified scripts:
+ bin/check_mesh
+ bin/cs_create
+ bin/cs_info
+ bin/mpi_rank.sh
+ bin/runcase
+ bin/runcase.help
+ bin/SaturneGUI
+ configure.ac
+ removed scripts:
+ bin/compiler_version
+ bin/cs.exe
+ bin/ecs
+
+* 09/03/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Change BFT and FVM behaviour wrt the _FLAGS handling.
+ modified scripts:
+ config/cs_bft.m4
+ config/cs_fvm.m4
+ configure.ac
+ src/base/Makefile.am
+ src/ctwr/Makefile.am
+ src/lagr/Makefile.am
+
+* 09/03/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Automatic detection of fvm_coupl library, along with
+ sockets and dlopen support, and some system calls.
+ Installation of user scripts in the proper directories.
+ Copyright correction and dictionnary update.
+ modified scripts:
+ config/cs_auto_flags.sh
+ config/cs_bft.m4
+ config/cs_blas.m4
+ config/cs_fvm.m4
+ config/cs_libxml2.m4
+ config/cs_mpi.m4
+ config/cs_tools.m4
+ configure.ac
+ Makefile.am
+ sbin/backup
+ modified routine:
+ include/base/cs_base.h
+ src/base/cs_base.c
+ updated dictionnary:
+ po/fr.po
+ po/remove-potcdate.sed
+
+* 06/03/2009 - David Monfort <david.monfort at edf.fr>
+ Rename cs_lagrang in cs_lagr.
+ modified files:
+ po/POTFILES.in
+ src/lagr/Makefile.am
+ removed routines:
+ include/lagr/cs_lagrang.h
+ src/lagr/cs_lagrang.c
+ added routines:
+ include/lagr/cs_lagr.h
+ src/lagr/cs_lagr.c
+
+* 06/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug when running in benchmark mode.
+ modified routine:
+ src/base/cs_main.c
+
+* 06/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Move from a global location to a local some specific
+ MPI types.
+ modified routines:
+ include/base/cs_base.h
+ src/base/cs_base.c
+ src/base/cs_parall.c
+
+* 06/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Rename cs_ecs_messages in cs_preprocessor_data.
+ modified files:
+ po/POTFILES.in
+ src/base/cs_main.c
+ src/base/Makefile.am
+ removed routines:
+ include/base/cs_ecs_messages.h
+ src/base/cs_ecs_messages.c
+ added routines:
+ include/base/cs_preprocessor_data.h
+ src/base/cs_preprocessor_data.c
+
+* 06/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Remove unnecessary specific exit handling.
+ modified routines:
+ include/base/cs_base.h
+ src/base/cs_base.c
+ src/base/cs_calcium.c
+
+* 05/03/2009 - David Monfort <david.monfort at edf.fr>
+ First integration of the autoconfiscation of the build
+ system.
+ Add a bootstrap script, config files, Makefile.am
+ files and configure.ac script.
+ Add a Makefile.am file in every src sub-directory and
+ modify C sources to account for the cs_config.h header.
+ Add also some mandatory files in the root directory.
+ added scripts:
+ config
+ config/cs_auto_flags.sh
+ config/cs_bft.m4
+ config/cs_blas.m4
+ config/cs_fvm.m4
+ config/cs_libxml2.m4
+ config/cs_mpi.m4
+ config/cs_tools.m4
+ configure.ac
+ INSTALL
+ Makefile.am
+ NEWS
+ README
+ sbin/bootstrap
+ src/atmo/Makefile.am
+ src/base/Makefile.am
+ src/cfbl/Makefile.am
+ src/cogz/Makefile.am
+ src/cplv/Makefile.am
+ src/ctwr/Makefile.am
+ src/elec/Makefile.am
+ src/fuel/Makefile.am
+ src/lagr/Makefile.am
+ src/mati/Makefile.am
+ src/pprt/Makefile.am
+ src/rayt/Makefile.am
+ modified routines:
+ src/base/cs_ale.c
+ src/base/cs_ast_coupling.c
+ src/base/cs_base.c
+ src/base/cs_benchmark.c
+ src/base/cs_blas.c
+ src/base/cs_calcium.c
+ src/base/cs_coupling.c
+ src/base/cs_ecs_messages.c
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_gradient.c
+ src/base/cs_grid.c
+ src/base/cs_gui.c
+ src/base/cs_gui_matisse.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/cs_gui_util.c
+ src/base/cs_halo.c
+ src/base/cs_io.c
+ src/base/cs_main.c
+ src/base/cs_matrix.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_coherency.c
+ src/base/cs_mesh_connect.c
+ src/base/cs_mesh_halo.c
+ src/base/cs_mesh_quality.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_mesh_solcom.c
+ src/base/cs_mesh_warping.c
+ src/base/cs_multigrid.c
+ src/base/cs_opts.c
+ src/base/cs_parall.c
+ src/base/cs_perio.c
+ src/base/cs_post.c
+ src/base/cs_proxy_comm.c
+ src/base/cs_renumber.c
+ src/base/cs_restart.c
+ src/base/cs_sat_coupling.c
+ src/base/cs_selector.c
+ src/base/cs_sles.c
+ src/base/cs_syr3_comm.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_syr3_messages.c
+ src/base/cs_syr4_coupling.c
+ src/base/cs_syr_coupling.c
+ src/base/cs_tpar1d.c
+ src/base/cs_ventil.c
+ src/base/tcpumx.c
+ src/base/tremai.c
+ src/ctwr/cs_ctwr_air_props.c
+ src/ctwr/cs_ctwr.c
+ src/ctwr/cs_ctwr_halo.c
+ src/lagr/cs_lagrang.c
+ src/lagr/cs_lagr_perio.c
+
+* 05/03/2009 - David Monfort <david.monfort at edf.fr>
+ Rename HAVE_XML macros to HAVE_LIBXML2 to give a better
+ view of what is needed in the code.
+ modified routines:
+ src/base/cs_gui.c
+ src/base/cs_gui_util.c
+ src/base/cs_opts.c
+
+* 04/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Cosmethic changes (committed in two revisions).
+ modified routines:
+ include/base/cs_base.h
+ include/base/cs_parall.h
+ include/base/cs_matrix.h
+ include/base/cs_halo.h
+ include/base/cs_mesh.h
+ src/base/caltri.f90
+ src/base/cs_benchmark.c
+ src/base/cs_base.c
+ src/base/cs_halo.c
+ src/base/cs_matrix.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_mesh_warping.c
+ src/base/cs_parall.c
+ src/base/cs_syr_coupling.c
+ users/base/usray3.F
+ users/base/usray4.F
+ users/base/usray5.F
+ modified script:
+ bin/runcase
+
+* 04/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Add a sleep function in error handling to avoid multiple output
+ in case of parallelism. Protect the cs_calcium.c sleep call with
+ a test on _POSIX_SOURCE.
+ modified routine:
+ src/base/cs_base.c
+ src/base/cs_calcium.c
+
+* 04/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug in cs_benchmark.c (n_faces instead of n_cells).
+ modified routine:
+ src/base/cs_benchmark.c
+
+* 04/03/2009 - David Monfort <david.monfort at edf.fr>
+ Rename every _CS_HAVE_xxx macro in the more standard HAVE_xxx
+
+* 04/03/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Refactoring the code in a stand-alone plug-in for YACS, thus
+ the complex part of the shared library build is removed.
+ modified routines:
+ include/base/cs_base.h
+ include/base/cs_calcium.h
+ include/base/cs_opts.h
+ src/base/cs_base.c
+ src/base/cs_calcium.c
+ src/base/cs_main.c
+ src/base/cs_opts.c
+ modified scripts:
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+ bin/macros_Darwin.mk
+ bin/macros_Linux_Ch.mk
+ bin/macros_Linux_IA64.mk
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+ bin/macros_SX9.mk
+ bin/Makefile
+ sbin/install
+ added file:
+ extras/cs_component.py
+
+* 04/03/2009 - Bertrand Sapa <bertrand-externe.sapa at edf.fr>
+ Correction on some missing "ipproc" indirections for several
+ arguments in the call to the "rmodak" subroutine.
+ modified routine:
+ src/pprt/ppcabs.f90
+
+* 04/03/2009 - David Monfort <david.monfort at edf.fr>
+ Fix wrong test when tagging user files with version number.
+ modified script:
+ bin/Makefile
+
+* 25/02/2009 - David Monfort <david.monfort at edf.fr>
+ Fix wrong commit of the cs_profile script.
+ modified script:
+ bin/cs_profile
+
+* 25/02/2009 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Conversion of all the Fortran files (headers included)
+ form fixed F77 format to free f90 format. A small-case
+ extension is used so that one can, in the future, skip the
+ preprocessing stage.
+ Moreover the herebelow scripts have been updated to take
+ into account the changes, especially the Makefile and macros
+ files (to enforce the preprocessing stage by a correct compiler
+ option).
+ modified scripts:
+ sbin/rmb
+ bin/compiler_version
+ bin/macros_Linux_Ch.mk
+ bin/cs_profile
+ bin/macros_Linux_x86_64.mk
+ bin/cs_create
+ bin/macros_Linux_IA64.mk
+ bin/macros_SX9.mk
+ bin/check_consistency
+ bin/macros_Darwin.mk
+ bin/runcase
+ bin/macros_Linux.mk
+ bin/macros_Blue_Gene_L.mk
+ bin/Makefile
+ bin/macros_Blue_Gene_P.mk
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Minor corrections in file list optimization.
+ modified scripts:
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+ bin/macros_Darwin.mk
+
+* 23/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction in the mesh structure update when renumbering cells.
+ modified routines:
+ src/base/cs_renumber.c
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Minor modifications on halos routines (no impact).
+ modified routines:
+ src/base/cs_mesh_halo.c
+ src/ctwr/cs_ctwr_halo.c
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Correction for tests based on IVERIF variable in usini1.F, bug
+ introduced when merging the different verification tests.
+ modified routine:
+ users/base/usini1.F
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Remove unused cs_mesh_select feature (replaced by fvm_selector
+ for SYRTHES coupling).
+ modified routines:
+ src/base/cs_sat_coupling.c
+ src/base/cs_syr_coupling.c
+ deleted routines:
+ include/base/cs_mesh_select.h
+ src/base/cs_mesh_select.c
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Porting to NEC SX9: replace VPP 5000 vectorization directives
+ by NEC ones (!OCL... => !CDIR...) and add a specific macros file.
+ Also add new AR and ARFLAGS variables in the Makefile so that one
+ can specify the archiver.
+ Thanks to HLRS for the modifications.
+ added script:
+ bin/macros_SX9.mk
+ modified scripts:
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+ bin/macros_Darwin.mk
+ bin/macros_Linux_Ch.mk
+ bin/macros_Linux_IA64.mk
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+ bin/Makefile
+ modified routines:
+ src/base/bilsc2.F
+ src/base/cs_sles.c
+ src/base/divmas.F
+ src/base/gradmc.F
+ src/base/gradrc.F
+ src/base/matrdt.F
+ src/base/matrix.F
+ src/base/promav.F
+ src/base/proxav.F
+ src/base/recvmc.F
+ src/base/tstvec.F
+ src/base/vissec.F
+ src/cfbl/cfbsc2.F
+ src/cfbl/cfbsc3.F
+ src/cfbl/cfdivs.F
+ src/cplv/cplym1.F
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Add a --version option to get Code_Saturne version number.
+ modified routine:
+ src/base/cs_opts.c
+ updated dictionary:
+ po/fr.po
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Install the user subroutines and the documentation within
+ a standard "arch/$NOM_ARCH/share" directory.
+ Minor corrections in these scripts as well.
+ modified scripts:
+ bin/cs_create
+ bin/cs_info
+ bin/Makefile
+ sbin/install
+
+* 23/02/2009 - David Monfort <david.monfort at edf.fr>
+ Typo in macro use (CS_ARCH_Linux instead of _CS_ARCH_Linux).
+ modified routine:
+ src/base/cs_proxy_comm.c
+
+* 18/02/2009 - David Monfort <david.monfort at edf.fr>
+ Minor modifications to make Fortran files to be compiled as
+ Fortran 95 source files after conversion (in three commits).
+ modified routines:
+ src/base/causta.F
+ src/base/crstgr.F
+ src/base/divrij.F
+ src/base/inimas.F
+ src/base/projts.F
+ src/cogz/pdfpp4.F
+ src/cplv/cpphy2.F
+ src/elec/elphyv.F
+ src/elec/eltssc.F
+ src/pprt/memppt.F
+
+* 16/02/2009 - David Monfort <david.monfort at edf.fr>
+ Change the mesh quality verification behaviour. The different
+ gradient calculation modes are now done in one pass. Thus, only
+ one option remains for the command line (-q, with no sub-option).
+ modified routines:
+ include/base/cs_opts.h
+ src/base/caltri.F
+ src/base/cs_main.c
+ src/base/cs_opts.c
+ src/base/initi1.F
+ src/base/memtri.F
+ src/base/modini.F
+ src/base/testel.F
+ modified documentation:
+ bin/runcase.help
+ doc/USER/latex/saturne1.tex
+ po/fr.po
+
+* 16/02/2009 - David Monfort <david.monfort at edf.fr>
+ Change cs_glob_base_nbr, cs_glob_base_rang and cs_glob_base_mpi_comm
+ in cs_glob_n_ranks, cs_glob_rank_id and cs_glob_mpi_comm (resp.).
+ modified routines:
+ include/base/cs_base.h
+ include/base/cs_sat_coupling.h
+ src/base/cs_ast_coupling.c
+ src/base/cs_base.c
+ src/base/cs_benchmark.c
+ src/base/cs_coupling.c
+ src/base/cs_ecs_messages.c
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_gradient.c
+ src/base/cs_grid.c
+ src/base/cs_gui.c
+ src/base/cs_halo.c
+ src/base/cs_io.c
+ src/base/cs_main.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_halo.c
+ src/base/cs_mesh_quality.c
+ src/base/cs_mesh_warping.c
+ src/base/cs_multigrid.c
+ src/base/cs_opts.c
+ src/base/cs_parall.c
+ src/base/cs_perio.c
+ src/base/cs_post.c
+ src/base/cs_proxy_comm.c
+ src/base/cs_renumber.c
+ src/base/cs_restart.c
+ src/base/cs_sat_coupling.c
+ src/base/cs_sles.c
+ src/base/cs_syr3_comm.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_syr3_messages.c
+ src/base/cs_syr4_coupling.c
+ src/base/cs_tpar1d.c
+ src/base/cs_ventil.c
+ src/ctwr/cs_ctwr.c
+ src/ctwr/cs_ctwr_halo.c
+ src/lagr/cs_lagr_perio.c
+
+* 16/02/2009 - Fran�ois Jusserand <francois.jusserand at edf.fr>
+ Fix Code_Aster coupling for sequential calculations.
+ modified routines:
+ include/base/cs_ast_coupling.h
+ src/base/cs_ast_coupling.c
+ src/base/cs_main.c
+ src/base/strdep.F
+ src/base/strini.F
+ src/base/strpre.F
+
+* 16/02/2009 - David Monfort <david.monfort at edf.fr>
+ Update of french dictionnary and list of gettextized files.
+ modified files:
+ po/fr.po
+ po/POTFILES.in
+
+* 16/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction in the MPI environment guess script.
+ modified script:
+ bin/runcase_mpi_env
+
+* 16/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction when closing files with MPI I/O enabled.
+ modified routine:
+ src/base/cs_io.c
+
+* 16/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ The kernel is now able to post-process edges for a given
+ mesh via the PSTEDG subroutine. This functionnality is
+ thus removed from the preprocessor.
+ modified routines:
+ include/base/cs_post.h
+ src/base/cs_post.c
+
+* 16/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ English translation of the post-processing management.
+ modified routines:
+ include/base/cs_post.h
+ include/base/cs_prototypes.h
+ src/base/cs_main.c
+ src/base/cs_mesh_quality.c
+ src/base/cs_mesh_solcom.c
+ src/base/cs_mesh_warping.c
+ src/base/cs_multigrid.c
+ src/base/cs_post.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_syr4_coupling.c
+ src/ctwr/cs_ctwr.c
+
+* 16/02/2009 - David Monfort <david.monfort at edf.fr>
+ Rename cs_suite.[hc] files in cs_restart.[hc]
+
+* 16/02/2009 - David Monfort <david.monfort at edf.fr>
+ Wrong commit for cs_suite.c
+ modified routine:
+ src/base/cs_suite.c
+
+* 16/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ English translation of the restart files management.
+ Also add a basic timer for the restart files process.
+ modified routines:
+ include/base/cs_tpar1d.c
+ src/base/cs_main.c
+ src/base/cs_suite.c
+ src/base/cs_tpar1d.c
+
+* 16/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ English translation of the SolCom format reader.
+ modified routines:
+ include/base/cs_mesh_solcom.h
+ src/base/cs_main.c
+ src/base/cs_mesh_solcom.c
+
+* 16/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add cell renumbering capability and re-organize face
+ renumbering process.
+ added routine:
+ src/base/tstvec.F
+ modified routines:
+ include/base/cs_halo.h
+ include/base/cs_mesh.h
+ include/base/cs_post.h
+ include/base/cs_prototypes.h
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_halo.c
+ src/base/cs_mesh.c
+ src/base/cs_post.c
+ src/base/cs_renumber.c
+ src/base/numvec.F
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Better english and french!
+ modified routines:
+ src/base/cs_multigrid.c
+ src/base/ecrava.F
+ src/base/ecrlis.F
+ users/base/usvpst.F
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ SYRTHES coupling change set. Correction for SYRTHES 4 coupling
+ and corresponding modifications for SYRTHES 3 coupling).
+ Upgrade to syr_cs 2.3.0
+ modified script:
+ bin/cs_profile
+ modified routines
+ include/base/cs_syr3_comm.h
+ include/base/cs_syr3_coupling.h
+ include/base/cs_syr3_messages.h
+ include/base/cs_syr4_coupling.h
+ include/base/cs_syr_coupling.h
+ src/base/caltri.F
+ src/base/cs_coupling.c
+ src/base/cs_syr3_comm.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_syr3_messages.c
+ src/base/cs_syr4_coupling.c
+ src/base/cs_syr_coupling.c
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Documentation update (mainly the mesh formats documentation
+ that have been removed from the preprocessor manual).
+ modified files:
+ doc/style/csdoc.sty
+ doc/USER/saturne1.tex
+ doc/USER/user.tex
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ From now on, use fvm_part_to_block/fvm_block_to_part
+ for restart files writing/reading.
+ Upgrade to FVM version 0.13.0
+ modified macros:
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+ bin/macros_Darwin.mk
+ bin/macros_Linux_Ch.mk
+ bin/macros_Linux_IA64.mk
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+ modified file:
+ COMPATIBILITY
+ modified routine:
+ src/base/cs_suite.c
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Free more memory (less valgrind errors...).
+ modified routine:
+ src/base/cs_gui.c
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor correction and new matrix.vector product tests.
+ modified routine:
+ src/base/cs_benchmark.c
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction in the MPI initialization in case of coupling.
+ modified routine:
+ src/base/cs_base.c
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ CS_MIN/MAX macros are now consistant with Bull's ones.
+ modified routines:
+ include/base/cs_base.h
+ src/base/cs_matrix.c
+
+* 13/02/2009 - Yvan Fournier <yvan.fournier at edf.fr>
+ Code_Aster coupling update (YACS side).
+ modified routines:
+ include/base/cs_calcium.h
+ src/base/cs_ast_coupling.c
+ src/base/cs_calcium.c
+ src/base/cs_main.c
+
+* 13/02/2009 - Marc Sakiz <marc.sakiz at edf.fr>
+ Minor corrections and updates in the documentation.
+ modified files:
+ doc/style/csdoc.sty
+ doc/TUTORIAL/latex/case5.tex
+
+* 13/02/2009 - Marc Sakiz <marc.sakiz at edf.fr>
+ Minor changes in the 1D-profile generation iva the GUI.
+ modified routine:
+ src/base/cs_gui.c
+
+* 13/02/2009 - David Monfort <david.monfort at edf.fr>
+ Upgrade to new compilers, drivers and librairies on BG/L
+ and BG/P architecture.
+ modified scripts:
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+
+* 13/02/2009 - David Monfort <david.monfort at edf.fr>
+ Add consistency checks for the atmospheric and cooling
+ towers modules.
+ modified script:
+ bin/check_consistency
+
+* 13/02/2009 - David Monfort <david.monfort at edf.fr>
+ Add the executable bit for runcase_syrthes.
+ modified script:
+ bin/runcase_syrthes
+
+* 02/02/2009 - David Monfort <david.monfort at edf.fr>
+ Minor correction in help output.
+ modified script:
+ bin/cs_create
+
+* 02/02/2009 - Marc Sakiz <marc.sakiz at edf.fr>
+ Fix a bug when no wall is present on a domain for the 1D
+ wall thermal module.
+ modified routine:
+ src/base/cs_tpar1d.c
+
+* 28/11/2008 - David Monfort <david.monfort at edf.fr>
+ Release of Code_Saturne version 1.4.0
+
+* 28/11/2008 - Fran�ois Jusserand <francois.jusserand at edf.fr>
+ Marc Sakiz <marc.sakiz at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ First integration of the Code_Aster coupling capability.
+ Not yet tested! Not ye compatible with parallelism.
+ added routines:
+ include/base/alaste.h
+ include/base/cs_ast_coupling.h
+ src/base/cs_ast_coupling.c
+ users/base/usaste.F
+ modified routines:
+ include/base/paramx.h
+ src/base/lecamx.F
+ src/base/ecrava.F
+ src/base/strdep.F
+ src/base/strini.F
+ src/base/iniini.F
+ src/base/strpre.F
+ src/base/tridim.F
+
+* 28/11/2008 - David Monfort <david.monfort at edf.fr>
+ Update french dictionnary.
+
+* 28/11/2008 - David Monfort <david.monfort at edf.fr>
+ Correction on a wrong test for boundary conditions settings
+ with specific physics.
+ modified routine:
+ src/base/tridim.F
+
+* 28/11/2008 - David Monfort <david.monfort at edf.fr>
+ J�r�me Lucas <jerome.lucas at incka.fr>
+ Complete the cooling towers feature.
+ Still not complet and no restarting or parallelism.
+ added routines:
+ include/ctwr/cs_ctwr_air_props.h
+ include/ctwr/cs_ctwr.h
+ include/ctwr/cs_ctwr_halo.h
+ src/ctwr/cs_ctwr_air_props.c
+ src/ctwr/cs_ctwr.c
+ src/ctwr/cs_ctwr_halo.c
+ users/ctwr/usctdz.F
+ modified routines:
+ src/base/cregeo.F
+ src/base/cs_main.c
+ src/ctwr/ctphyv.F
+ users/pprt/usppmo.F
+
+* 28/11/2008 - David Monfort <david.monfort at edf.fr>
+ Add a second routine for a second pass of initialization when
+ modelling gas combustion in order to avoid mis-understanding
+ of "variable initialization"...
+ added routine:
+ src/pprt/ppinv2.F
+ modified routine:
+ scr/base/scalai.F
+
+* 28/11/2008 - David Monfort <david.monfort at edf.fr>
+ Add the cstphy.h header in cregeo.F in order to ease
+ the cooling towers integration.
+ modified routines:
+ src/base/caltri.F
+ src/base/cregeo.F
+
+* 27/11/2008 - David Monfort <david.monfort at edf.fr>
+ Increase Code_Saturne version number to 1.4.0
+
+* 27/11/2008 - David Monfort <david.monfort at edf.fr>
+ Remove the splash screen at the GUI launch.
+ modified script:
+ bin/SaturneGUI
+
+* 27/11/2008 - David Monfort <david.monfort at edf.fr>
+ Add a QUALITY_ASSURANCE file which precises if the current
+ version of Code_Saturne is validated under EDF quality
+ assurance.
+ added file:
+ QUALITY_ASSURANCE
+
+* 26/11/2008 - David Monfort <david.monfort at edf.fr>
+ Add stubs for cooling towers subroutines and preparation
+ of the cooling towers modelling integration.
+ added routines:
+ include/ctwr/ctincl.h
+ src/ctwr/ctini1.F
+ src/ctwr/ctiniv.F
+ src/ctwr/ctphyv.F
+ src/ctwr/cttssc.F
+ src/ctwr/ctvarp.F
+ users/ctwr/usctcl.F
+ users/ctwr/uscti1.F
+ users/ctwr/usctiv.F
+ modified scripts:
+ bin/Makefile
+ sbin/install
+ updated dictionnary:
+ po/fr.po
+ modified routines:
+ include/base/cs_gui.h
+ include/base/entsor.h
+ include/pprt/ppincl.h
+ src/base/cs_gui.c
+ src/base/cs_post.c
+ src/base/haltyp.F
+ src/base/iniini.F
+ src/base/inipst.F
+ src/base/iniusi.F
+ src/base/varpos.F
+ src/pprt/ppclim.F
+ src/pprt/ppcsca.F
+ src/pprt/ppini1.F
+ src/pprt/ppiniv.F
+ src/pprt/ppphyv.F
+ src/pprt/ppprcl.F
+ src/pprt/pptssc.F
+ src/pprt/ppvarp.F
+ users/pprt/usppmo.F
+
+* 26/11/2008 - David Monfort <david.monfort at edf.fr>
+ Replace a test by an equivalent but simpler one.
+ modified routine:
+ src/rayt/rayopt.F
+
+* 26/11/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Change the behaviour of the boundary conditions handling
+ for the atmospheric module (let the user change the type
+ of boundary condition even when a meteo profile file is
+ read).
+ modified routines:
+ src/atmo/attycl.F
+ users/atmo/usatcl.F
+
+* 26/11/2008 - David Monfort <david.monfort at edf.fr>
+ Add missing modifications for the atmospheric modelling.
+ Without this patch, the code does not compile.
+ modified routines:
+ include/pprt/ppincl.h
+ src/base/caltri.F
+ src/base/varpos.F
+ src/rayt/rayopt.F
+
+* 25/11/2008 - Maya Milliez <maya.milliez at edf.fr>
+ Bertrand Carissimo <bertrand.carissimo at edf.fr>
+ Marc Sakiz <marc.sakiz at edf.fr>
+ Integration of the atmospheric flow modelling for neutral
+ atmosphere flows.
+ modified scripts:
+ bin/Makefile
+ bin/runcase
+ bin/runcase.help
+ sbin/install
+ modified routines:
+ include/base/entsor.h
+ include/base/cs_gui.h
+ src/base/cs_gui.c
+ src/base/iniini.F
+ src/base/iniusi.F
+ src/pprt/memppt.F
+ src/pprt/ppclim.F
+ src/pprt/ppcsca.F
+ src/pprt/ppini1.F
+ src/pprt/ppinii.F
+ src/pprt/ppiniv.F
+ src/pprt/ppprcl.F
+ src/pprt/pptycl.F
+ users/pprt/usppmo.F
+ added routines:
+ include/atmo
+ include/atmo/atincl.h
+ src/atmo
+ src/atmo/atini1.F
+ src/atmo/atiniv.F
+ src/atmo/atlecm.F
+ src/atmo/attycl.F
+ src/atmo/intprf.F
+ src/atmo/mematm.F
+ users/atmo
+ users/atmo/usatcl.F
+ users/atmo/usati1.F
+ users/atmo/usativ.F
+
+* 25/11/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Add a common whose value depends whether the simulation
+ uses a specific physics and if the radiative transfer
+ modelling is enabled with a parametric file or not,
+ preparing for the integration of the atmospheric modelling.
+ modified routines:
+ include/base/cs_gui.h
+ include/pprt/ppincl.h
+ src/base/caltri.F
+ src/base/condli.F
+ src/base/covofi.F
+ src/base/cs_gui.c
+ src/base/impini.F
+ src/base/inivar.F
+ src/base/memtri.F
+ src/base/phyvar.F
+ src/base/precli.F
+ src/base/scalai.F
+ src/base/tridim.F
+ src/base/varpos.F
+ src/base/verini.F
+ src/rayt/raycli.F
+ src/rayt/raydom.F
+ src/rayt/rayopt.F
+ users/rayt/usray1.F
+ users/rayt/usray3.F
+
+* 25/11/2008 - David Monfort <david.monfort at edf.fr>
+ Update AUTHORS file.
+
+* 25/11/2008 - David Monfort <david.monfort at edf.fr>
+ Activate the multigrid algorithm for pressure by default.
+ modified routine:
+ users/base/usini1.F
+
+* 24/11/2008 - David Monfort <david.monfort at edf.fr>
+ Upgrade to GUI 1.4.d
+
+* 24/11/2008 - Alexandre Douce <alexandre.douce at edf.fr>
+ Add an option for the multigrid algorithm in the GUI.
+ modified routines:
+ include/base/cs_gui.h
+ src/base/cs_gui.c
+ src/base/iniusi.F
+
+* 20/11/2008 - David Monfort <david.monfort at edf.fr>
+ Remove the -fbounds-check option (gfortran compiler)
+ as it seems to corrupt the stack.
+ modified scripts:
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+
+* 20/11/2008 - David Monfort <david.monfort at edf.fr>
+ English translation of most of the missing C sources.
+ modified routines:
+ include/base/cs_gui.h
+ include/base/cs_post.h
+ include/base/cs_sat_coupling.h
+ include/base/cs_tpar1d.h
+ include/base/cs_ventil.h
+ include/base/entsor.h
+ include/fuel/fuincl.h
+ include/mati/matiss.h
+ src/base/cs_gui.c
+ src/base/cs_gui_matisse.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/cs_gui_util.c
+ src/base/cs_main.c
+ src/base/cs_sat_coupling.c
+ src/base/cs_tpar1d.c
+ src/base/cs_ventil.c
+ updated french dictionnary:
+ po/fr.po
+ po/POTFILES.in
+
+* 19/11/2008 - David Monfort <david.monfort at edf.fr>
+ Rename cs_couplage* sources to cs_sat_coupling*
+ deleted routines:
+ cs_couplage.h
+ cs_couplage.c
+ added routines:
+ cs_sat_coupling.h
+ cs_sat_coupling.c
+ modified routines:
+ cs_main.c
+ cs_opts.c
+
+* 17/11/2008 - David Monfort <david.monfort at edf.fr>
+ Small correction on some output in cs_gui.c
+ modified files:
+ po/fr.po
+ src/base/cs_gui.c
+
+* 14/11/2008 - David Monfort <david.monfort at edf.fr>
+ Set the precision on coarsest mesh equal to the one
+ on finest mesh in the multigrid algorithm for better
+ efficiency (and scalability).
+ modified routine:
+ src/base/cs_multigrid.c
+
+* 14/11/2008 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Minor corrections and improvements.
+ modified routines:
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_ecs_messages.c
+ src/base/cs_mesh.c
+
+* 14/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Reformating comments and english translation.
+ modified routines:
+ include/base/cs_mesh_connect.h
+ include/base/cs_mesh_solcom.h
+ include/base/cs_prototypes.h
+ include/base/tcpumx.h
+ include/base/tremai.h
+ src/base/cs_mesh_solcom.c
+ src/base/tcpumx.c
+ src/base/tremai.c
+ modified dictionnary:
+ po/fr.po
+
+* 14/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add a backup script for developpers.
+ added script:
+ sbin/backup
+
+* 14/11/2008 - David Monfort <david.monfort at edf.fr>
+ Merge documentation changes form the 1.3 branch (-r 777:778).
+ modified documentation:
+ THEORY/latex/Base/bilsc2.tex
+ THEORY/latex/Base/clptrg.tex
+ THEORY/latex/Base/clptur.tex
+ THEORY/latex/Base/clsyvt.tex
+ THEORY/latex/Base/condli.tex
+ THEORY/latex/summary.tex
+ THEORY/latex/theory.tex
+ USER/latex/a1_autovalid.tex
+ USER/latex/saturne1.tex
+ USER/latex/saturne2.tex
+ added documentation:
+ THEORY/latex/Base/clptrg.tex
+
+* 13/11/2008 - David Monfort <david.monfort at edf.fr>
+ Updating Code_Saturne version number to 1.4.c and prerequisites.
+ modified files:
+ doc/style/csdoc.sty
+ doc/THEORY/latex/theory.tex
+ bin/cs_profile
+ bin/Makefile
+ bin/macros_Blue_Gene_P.mk
+ COMPATIBILITY
+
+* 13/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Minor modifications in scripts, macros and docs.
+ modified docs:
+ doc/USER/latex/saturne1.tex
+ modified scripts:
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+ bin/runcase_syrthes
+
+* 13/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction of the outputs english translation.
+ modified routine:
+ src/base/lecamx.F
+
+* 13/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction and english translation in the restart file code.
+ modified file:
+ po/fr.po
+ modified routines:
+ include/base/cs_suite.h
+ src/base/cs_suite.c
+
+* 07/11/2008 - David Monfort <david.monfort at edf.fr>
+ Updating the french dictionnary.
+ modified file:
+ po/fr.po
+
+* 07/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction in the restart file reading.
+ modified routine:
+ src/base/cs_suite.c
+
+* 07/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction in the SYRTHES coupling initialization.
+ modified routine:
+ src/base/cs_syr_coupling.c
+
+* 07/11/2008 - David Monfort <david.monfort at edf.fr>
+ Remove the dependency to BLAS in the Fortran dot products
+ because one always provides Fortran wrappers in the C code.
+ modified script:
+ bin/Makefile
+ modified routines:
+ src/base/prodsc.F
+ src/base/prods2.F
+ src/base/prods3.F
+
+* 07/11/2008 - David Monfort <david.monfort at edf.fr>
+ Replace depecrated references to Tcl/Tk/Tix by PyQt ones.
+ Update the wrapper around the Graphical User Interface.
+ modified files:
+ COMPATIBILITY
+ bin/SaturneGUI
+
+* 05/11/2008 - David Monfort <david.monfort at edf.fr>
+ Always set the head loss tensor to be a full symmetric tensor
+ in order to ease the setup within the Graphical User Interface
+ (NCKPDC has been removed and replaced by the constant 6).
+ modified documentation:
+ doc/TUTORIAL/latex/case4.tex
+ doc/USER/latex/saturne1.tex
+ modified routines:
+ include/base/pointe.h
+ src/base/caltri.F
+ src/base/covofi.F
+ src/base/dttvar.F
+ src/base/iniini.F
+ src/base/mempdc.F
+ src/base/navsto.F
+ src/base/phyvar.F
+ src/base/preduv.F
+ src/base/reseps.F
+ src/base/resolp.F
+ src/base/resrij.F
+ src/base/resssg.F
+ src/base/resv2f.F
+ src/base/scalai.F
+ src/base/tridim.F
+ src/base/tsepdc.F
+ src/base/turbke.F
+ src/base/turbkw.F
+ src/base/turrij.F
+ src/base/visdyn.F
+ src/base/vislmg.F
+ src/base/vissec.F
+ src/base/vissma.F
+ src/base/vissst.F
+ src/cfbl/cfdivs.F
+ src/cfbl/cfdttv.F
+ src/cfbl/cfener.F
+ src/cfbl/cfmsfl.F
+ src/cfbl/cfmsgs.F
+ src/cfbl/cfmsvl.F
+ src/cfbl/cfqdmv.F
+ src/cogz/ebutss.F
+ src/cogz/lwctss.F
+ src/cplv/cpltss.F
+ src/cplv/cpltsv.F
+ src/cplv/cptssc.F
+ src/cplv/cptsvc.F
+ src/elec/eltssc.F
+ src/fuel/futssc.F
+ src/fuel/futsvc.F
+ src/mati/mtkpdc.F
+ src/mati/mttsns.F
+ src/mati/mttssc.F
+ src/pprt/pptssc.F
+ users/base/uskpdc.F
+ users/base/ussmag.F
+ users/base/ustske.F
+ users/base/ustskw.F
+ users/base/ustsma.F
+ users/base/ustsns.F
+ users/base/ustsri.F
+ users/base/ustssc.F
+ users/base/ustsv2.F
+ users/base/usvist.F
+
+* 05/11/2008 - Alexandre Douce <alexandre.douce at edf.fr>
+ Nicole Picard <nicole-n.picard at edf.fr>
+ Modifications in the XML reader related to the upgrade of the
+ Graphical User Interface in version 1.4.c (now written in PyQt).
+ Improvements in some areas but the Interface is not complete yet.
+ modified script:
+ bin/cs_profile
+ modified routines:
+ include/base/cs_gui.h
+ include/base/cs_gui_util.h
+ include/base/cs_prototypes.h
+ src/base/caltri.F
+ src/base/cs_gui.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/cs_gui_util.c
+ src/base/iniusi.F
+ src/base/stdtcl.F
+ src/base/tridim.F
+ src/cplv/cpltcl.F
+ src/pprt/ppclim.F
+
+* 05/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug arising when the ratio between the number of
+ processors and the number of cells is two high.
+ modified routine:
+ src/base/cs_ecs_messages.c
+
+* 05/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Makefile simplifications.
+ modified script:
+ bin/Makefile
+
+* 05/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Major overhauling of the SYRTHES coupling: upgrade to
+ FVM 0.12.0 and its coupling library, coupling with SYRTHES 3
+ and in the future SYRTHES 4 available, definition of coupling
+ via a user subroutine instead of a script command, simpler
+ MPI initialization.
+ modified scripts:
+ bin/cs_profile
+ bin/Makefile
+ bin/runcase
+ bin/runcase.help
+ bin/runcase_syrthes
+ modified routines:
+ include/base/cs_base.h
+ include/base/cs_opts.h
+ include/base/cs_syr3_comm.h
+ include/base/cs_syr3_coupling.h
+ include/base/cs_syr3_messages.h
+ src/base/coupbi.F
+ src/base/coupbo.F
+ src/base/cregeo.F
+ src/base/cs_base.c
+ src/base/cs_couplage.c
+ src/base/cs_main.c
+ src/base/cs_opts.c
+ src/base/cs_syr3_comm.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_syr3_messages.c
+ src/base/initi1.F
+ added routines:
+ include/base/cs_coupling.h
+ include/base/cs_syr4_coupling.h
+ include/base/cs_syr_coupling.h
+ src/base/cs_coupling.c
+ src/base/cs_syr4_coupling.c
+ src/base/cs_syr_coupling.c
+ src/base/cs_syr_util.F
+ users/base/ussyrc.F
+
+* 05/11/2008 - David Monfort <david.monfort at edf.fr>
+ Upgrading to FVM 0.12.0 (fix a bug with MPI/IO) and BFT 1.0.8.
+ modified routine:
+ src/base/cs_base.c
+ modified scripts:
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+ bin/macros_Linux.mk
+ bin/macros_Linux_Ch.mk
+ bin/macros_Linux_IA64.mk
+ bin/macros_Linux_x86_64.mk
+
+* 04/11/2008 - David Monfort <david.monfort at edf.fr>
+ Ditto for vector synchronization.
+ modified routine:
+ src/base/cs_perio.c
+
+* 04/11/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug if the simulation has a periodicity of a translation
+ (missing test on the presence of rotation).
+ modified routine:
+ src/base/cs_perio.c
+
+* 31/10/2008 - Richard Howard <richard.howard at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Make the test on the convergence of the gradient reconstruction
+ method dimensionless if the maximum control volume is greater
+ than 1 (useful for some atmospheric simulations).
+ modified routines:
+ include/base/cstphy.h
+ src/base/alemaj.F
+ src/base/calgeo.F
+ src/base/caltri.F
+ src/base/clvolc.F
+ src/base/cregeo.F
+ src/base/gradrc.F
+
+* 31/10/2008 - David Monfort <david.monfort at edf.fr>
+ Fix a MPI blocking bug on the BlueGene/P system (from IBM).
+ modified file:
+ bin/macros_Blue_Gene_P.mk
+
+* 30/10/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 736:741, updating macros, runcase
+ adaptation for Salome, examples in uskpdc and usproj).
+
+* 29/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ English translation of code and comments in several files, along
+ with some minor improvements.
+ modified routines:
+ bin/runcase
+ include/base/cs_base.h
+ include/base/cs_ecs_messages.h
+ include/base/cs_grid.h
+ include/base/cs_mesh_connect.h
+ include/base/cs_mesh.h
+ include/base/cs_opts.h
+ include/base/cs_parall.h
+ include/base/cs_post.h
+ include/base/cs_prototypes.h
+ src/base/coupbi.F
+ src/base/coupbo.F
+ src/base/cs_base.c
+ src/base/cs_couplage.c
+ src/base/cs_main.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_connect.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_mesh_warping.c
+ src/base/cs_multigrid.c
+ src/base/cs_opts.c
+ src/base/cs_parall.c
+ src/base/cs_post.c
+ src/base/cs_sles.c
+ src/base/cs_suite.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_tpar1d.c
+
+* 29/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug when extracting part of the mesh if there is no
+ boundary face.
+ modified routine:
+ src/base/cs_ecs_messages.c
+
+* 29/10/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 731:732, minor lagopt bug fix)
+
+* 29/10/2008 - David Monfort <david.monfort at edf.fr>
+ Add a COMMAND_REORIENT variable in the runcase in order
+ to simplify the runcase setup by the GUI.
+ modified scritps:
+ bin/runcase
+ bin/runcase.help
+
+* 28/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor corrections and improvement in scripts.
+ modified scripts:
+ bin/cs_info
+ bin/mpi_rank.sh
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction on the use of shared arrays.
+ modified routine:
+ src/base/crstgr.F
+ src/base/cs_grid.c
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add C functions to deal with face/cell selection.
+ modified routines:
+ include/base/cs_selector.h
+ src/base/cs_selector.c
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Adding some Fortran prototypes for C callers.
+ modified routine:
+ include/base/cs_prototypes.h
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Several Makefile corrections and improvements.
+ modified script:
+ bin/Makefile
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug in the mesh coherency check in case of translation.
+ modified routine:
+ src/base/cs_mesh_coherency.c
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Remove inconsistent comments.
+ modified routine:
+ src/base/initi1.F
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Change size_t variables to fvm_file_offt in order
+ to bypass some possible limitations on BlueGene systems.
+ modified routines:
+ include/base/cs_io.h
+ src/base/cs_io.c
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fixing a bug when re-opening a file.
+ modified routine:
+ src/base/cs_io.c
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Remove the forcing to ASCII mode for post-processing when
+ the calculation is in verification mode.
+ modified routine:
+ src/base/initi1.F
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Correction on a warning output (IPERIO instead of IRANGP).
+ modified file:
+ src/base/verini.F
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Updating the dp_FUE file for fuel combustion to account
+ for the number of fuel classes.
+ modified file:
+ data/thch/dp_FUE
+
+* 27/10/2008 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Updating the dp_FCP file for coal combustion according
+ to the new oxycombustion model.
+ modified file:
+ data/thch/dp_FCP
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Move the autovalidation scripts to the extra directory.
+ moved scripts:
+ bin/Autovalidation
+ bin/autovalid
+ bin/autovalid.xml
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Remove a redundant verification on the ICHRVR, ... variables.
+ modified routine:
+ src/cplv/cplver.F
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Minor corrections in scripts.
+ modified scripts:
+ bin/check_consistency
+ bin/check_mesh
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ English translation of part of the autovalidation scripts.
+ modified scripts:
+ bin/Autovalidation/Case.py
+ bin/Autovalidation/Study.py
+
+* 27/10/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fixing a bug in cs_ecs_messages.c where all periodicities
+ were added as a rotation.
+ modified routine:
+ src/base/cs_ecs_messages.c
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Fixing a bug in cs_io.c where a file is closed twice.
+ modified routine:
+ src/base/cs_io.c
+
+* 27/10/2008 - David Monfort <david.monfort at edf.fr>
+ Remove the test on the number of cells in the restart files
+ in varpos.F, as it is unknown at this moment.
+ modified routine:
+ src/base/varpos.F
+
+* 10/10/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 705:706, minor lagopt bug fix)
+
+* 01/10/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 701:704, missing argument
+ and C89 syntax)
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Remove all occurences of the CCRT machines "Tantale".
+ modified files:
+ TODO
+ bin/cs_profile
+ doc/USER/latex/saturne1.tex
+ extras/macros_old/README
+ removed file:
+ bin/macros_Linux_CCRT.mk
+ added file:
+ extras/macros_old/macros_Linux_CCRT.mk
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Temporary fix to avoid building a void CTWR library.
+ modified scripts:
+ bin/Makefile
+ sbin/install
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Updating french dictionnary.
+ modified file:
+ po/fr.po
+
+* 12/09/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor correction on strings translation.
+ modified routine:
+ src/base/cs_multigrid.c
+
+* 12/09/2008 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Correction on periodicity transfer from the preprocessor.
+ modified routine:
+ src/base/cs_ecs_messages.c
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Replace all occurences of #if defined(__cplusplus) ...
+ with a macro defined in cs_base.h for all C headers.
+ The aim is to be able to compile the code with a C++
+ compiler (for testing only).
+ modified routines:
+ src/base/cs_ale.c
+ src/base/cs_base.c
+ src/base/cs_benchmark.c
+ src/base/cs_blas.c
+ src/base/cs_calcium.c
+ src/base/cs_couplage.c
+ src/base/cs_ecs_messages.c
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_gradient.c
+ src/base/cs_grid.c
+ src/base/cs_gui.c
+ src/base/cs_gui_matisse.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/cs_gui_util.c
+ src/base/cs_halo.c
+ src/base/cs_io.c
+ src/base/cs_main.c
+ src/base/cs_matrix.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_coherency.c
+ src/base/cs_mesh_connect.c
+ src/base/cs_mesh_halo.c
+ src/base/cs_mesh_quality.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_mesh_select.c
+ src/base/cs_mesh_solcom.c
+ src/base/cs_mesh_warping.c
+ src/base/cs_multigrid.c
+ src/base/cs_opts.c
+ src/base/cs_parall.c
+ src/base/cs_perio.c
+ src/base/cs_post.c
+ src/base/cs_proxy_comm.c
+ src/base/cs_renumber.c
+ src/base/cs_selector.c
+ src/base/cs_sles.c
+ src/base/cs_suite.c
+ src/base/cs_syr3_comm.c
+ src/base/cs_syr3_coupling.c
+ src/base/cs_syr3_messages.c
+ src/base/cs_tpar1d.c
+ src/base/cs_ventil.c
+ src/base/tcpumx.c
+ src/base/tremai.c
+ src/lagr/cs_lagrang.c
+ src/lagr/cs_lagr_perio.c
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Minor correction on the gettextize script (for old gettext tools).
+ modified script:
+ sbin/gettextize
+
+* 12/09/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Marc Sakiz <marc.sakiz at edf.fr>
+ Documentation improvement and corrections.
+ modified files:
+ doc/THEORY/latex/Base/introd.tex
+ doc/THEORY/latex/Base/turbke.tex
+ doc/USER/latex/saturne1.tex
+ doc/USER/latex/user.tex
+ removed file:
+ doc/USER/graphics/halo.eps
+ added files:
+ doc/USER/graphics/cs_components.fig
+ doc/USER/graphics/halo.pdf
+ doc/USER/graphics/rota_perio_parall.jpg
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Change char array initialization to comply with C++ error.
+ modified routine:
+ src/base/cs_proxy_commm.c
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Revert to malloc call in cs_base.c because memory
+ management has not been initialized before this call.
+ modified routines:
+ src/base/cs_base.c
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Preparation for the cooling tower specific physics.
+ modified script:
+ bin/Makefile
+ sbin/install
+ added directories:
+ include/ctwr
+ src/ctwr
+ users/ctwr
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Revert to old behaviour when multigrid options were separated
+ in two headers in order to use multigrid algorithm in codits
+ subroutine.
+ modified files:
+ include/base/optcal.h
+ src/base/calhyd.F
+ src/base/codits.F
+ src/base/distpr.F
+ src/base/impini.F
+ src/base/iniini.F
+ src/base/resolp.F
+ src/base/verini.F
+ added header:
+ include/base/mltgrd.h
+
+* 12/09/2008 - David Monfort <david.monfort at edf.fr>
+ Several corrections found with a C++ compiler (replace malloc
+ function with BFT_MALLOC macro, exchange arguments in function
+ call, replace false by NULL in a comparison). These issues had
+ no impact on the code.
+ modified routines:
+ src/base/cs_base.c
+ src/base/cs_matrix.c
+ src/base/cs_mesh_warping.c
+
+* 11/09/2008 - David Monfort <david.monfort at edf.fr>
+ Makefile modification so that one does not need anymore to
+ symlink all the headers in a user directory.
+ modified script:
+ bin/Makefile
+
+* 11/09/2008 - David Monfort <david.monfort at edf.fr>
+ Add a potential option for the Fortran preprocessor for CS_LANG.
+ modified script:
+ bin/Makefile
+
+* 10/09/2008 - David Monfort <david.monfort at edf.fr>
+ Remove unused variable (comm_buffer_size).
+ modified file:
+ src/base/cs_mesh_halo.c
+
+* 10/09/2008 - David Monfort <david.monfort at edf.fr>
+ Remove a comma at the end of an enum.
+ modified file:
+ include/base/cs_halo.h
+
+* 10/09/2008 - David Monfort <david.monfort at edf.fr>
+ Replace all occurences of #if defined(__cplusplus) ...
+ with a macro defined in cs_base.h for all C headers.
+ modified routines:
+ include/base/cs_ale.h
+ include/base/cs_base.h
+ include/base/cs_benchmark.h
+ include/base/cs_blas.h
+ include/base/cs_calcium.h
+ include/base/cs_couplage.h
+ include/base/cs_ecs_messages.h
+ include/base/cs_ext_neighborhood.h
+ include/base/cs_gradient.h
+ include/base/cs_grid.h
+ include/base/cs_gui.h
+ include/base/cs_gui_matisse.h
+ include/base/cs_gui_radiative_transfer.h
+ include/base/cs_gui_util.h
+ include/base/cs_halo.h
+ include/base/cs_io.h
+ include/base/cs_matrix.h
+ include/base/cs_mesh_coherency.h
+ include/base/cs_mesh_connect.h
+ include/base/cs_mesh.h
+ include/base/cs_mesh_halo.h
+ include/base/cs_mesh_quality.h
+ include/base/cs_mesh_quantities.h
+ include/base/cs_mesh_select.h
+ include/base/cs_mesh_solcom.h
+ include/base/cs_mesh_warping.h
+ include/base/cs_multigrid.h
+ include/base/cs_opts.h
+ include/base/cs_parall.h
+ include/base/cs_perio.h
+ include/base/cs_post.h
+ include/base/cs_prototypes.h
+ include/base/cs_proxy_comm.h
+ include/base/cs_renumber.h
+ include/base/cs_selector.h
+ include/base/cs_sles.h
+ include/base/cs_suite.h
+ include/base/cs_syr3_comm.h
+ include/base/cs_syr3_coupling.h
+ include/base/cs_syr3_messages.h
+ include/base/cs_tpar1d.h
+ include/base/cs_ventil.h
+ include/base/tcpumx.h
+ include/base/tremai.h
+ include/lagr/cs_lagrang.h
+ include/lagr/cs_lagr_perio.h
+
+* 09/09/2008 - David Monfort <david.monfort at edf.fr>
+ Remove unused headers in Fortran sources.
+ modified routines:
+ src/base/dvvpst.F
+ src/base/iniini.F
+ src/cogz/colecd.F
+ src/cogz/lwcurl.F
+ src/cplv/cplecd.F
+ src/cplv/cprays.F
+ src/cplv/cpthp2.F
+ src/elec/ellecd.F
+ src/fuel/fulecd.F
+ src/fuel/futhp2.F
+ src/lagr/lagaff.F
+ src/lagr/lagcar.F
+ src/lagr/lagcou.F
+ src/lagr/lageqp.F
+ src/lagr/lages1.F
+ src/lagr/lages2.F
+ src/lagr/lagesp.F
+ src/lagr/lagfch.F
+ src/lagr/lagich.F
+ src/lagr/lagitf.F
+ src/lagr/lagpoi.F
+ src/lagr/lagsta.F
+ src/lagr/lagune.F
+ src/mati/mtproj.F
+ src/mati/mttycl.F
+ src/pprt/pplecd.F
+
+* 09/09/2008 - David Monfort <david.monfort at edf.fr>
+ Replace deprecated socket structure with standard one.
+ modified routines:
+ src/base/cs_proxy_comm.c
+ src/base/cs_syr3_comm.c
+
+* 09/09/2008 - David Monfort <david.monfort at edf.fr>
+ Remove _CS_HAVE_XML dependency in Fortran files.
+ modified files:
+ bin/Makefile
+ ChangeLog
+ po/fr.po
+ src/base/caltri.F
+ src/base/cs_gui.c
+ src/base/cs_gui_matisse.c
+ src/base/cs_gui_radiative_transfer.c
+ src/base/cs_gui_util.c
+ src/base/cs_main.c
+ src/base/cs_opts.c
+ src/base/iniusi.F
+ src/base/inivar.F
+ src/base/memini.F
+ src/base/tridim.F
+ src/cplv/cpini1.F
+ src/cplv/cpprop.F
+ src/cplv/cpvarp.F
+ src/mati/mtimpi.F
+ src/mati/mtini1.F
+ src/pprt/ppclim.F
+ src/rayt/raycli.F
+ src/rayt/raydom.F
+ src/rayt/rayopt.F
+
+* 09/09/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Minor modifications in runcase output.
+ modified script:
+ bin/runcase
+
+* 09/09/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fix a bug in the new restart files handling.
+ modified routine:
+ src/base/cs_suite.c
+
+* 09/09/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correct wrong test and output string.
+ modified routine:
+ src/base/cs_tpar1d.c
+ modified file:
+ po/fr.po
+
+* 22/08/2008 - David Monfort <david.monfort at edf.fr>
+ Tagging of version 1.4.b
+
+* 22/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction on buffer definition and prototypes if the code
+ is compiled without MPI or sockets support.
+ modified routines:
+ src/base/cs_halo.c
+ src/base/cs_io.c
+ src/base/cs_syr3_comm.c
+
+* 22/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction on __STDC_VERSION__ detection for stdint include.
+ modified routines:
+ include/base/cs_base.h
+ src/base/cs_proxy_comm.c
+
+* 21/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 614:622, C output translation)
+
+* 21/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Remove the pipe communication mode for SYRTHES coupling.
+ modified routines:
+ include/base/cs_syr3_comm.h
+ src/base/cs_syr3_comm.c
+ src/base/cs_opts.c
+
+* 21/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Change the restart file format to comply with the new common
+ format file (with the Preprocessor output).
+ modified routines:
+ include/base/cs_io.h
+ include/base/cs_suite.h
+ src/base/cs_ecs_messages.c
+ src/base/cs_io.c
+ src/base/cs_main.c
+ src/base/cs_suite.c
+
+* 21/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 611:614, Fortran output translation)
+
+* 14/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 604:605, Lagrangian with rotation)
+
+* 13/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Force restart files in binary format, and remove
+ unused commons.
+ modified documentation:
+ doc/USER/latex/saturne1.tex
+ doc/USER/latex/saturne2.tex
+ modified routines:
+ include/base/cs_gui.h
+ include/base/cs_suite.h
+ include/base/cs_tpar1d.h
+ include/base/entsor.h
+ src/base/caltri.F
+ src/base/cs_gui.c
+ src/base/cs_suite.c
+ src/base/cs_tpar1d.c
+ src/base/ecrava.F
+ src/base/impini.F
+ src/base/iniini.F
+ src/base/iniusi.F
+ src/base/lecamp.F
+ src/base/lecamx.F
+ src/base/modini.F
+ src/base/varpos.F
+ src/base/verini.F
+ src/lagr/laglec.F
+ src/lagr/lagout.F
+ src/rayt/raybrd.F
+ src/rayt/raylec.F
+ src/rayt/rayout.F
+ users/base/usini1.F
+
+* 13/08/2008 - David Monfort <david.monfort at edf.fr>
+ Update the documentation according to the scripts translation.
+ modified files:
+ doc/USER/latex/saturne1.tex
+ doc/USER/latex/a1_autovalid.tex
+
+* 12/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Add a hint in cs_io_initialize for the file API,
+ and correct a type error.
+ modified routines:
+ include/base/cs_io.c
+ src/base/cs_ecs_messages.c
+ src/base/cs_io.c
+ src/base/cs_main.c
+
+* 12/08/2008 - David Monfort <david.monfort at edf.fr>
+ Replace all occurences of CS_FALSE and CS_TRUE
+ by the standard false and true.
+
+* 12/08/2008 - David Monfort <david.monfort at edf.fr>
+ Handle the interior face families when renumbering
+ or cutting warped faces.
+ modified routines:
+ include/base/cs_prototypes.h
+ src/base/cs_mesh_warping.c
+ src/base/cs_renumber.c
+ src/base/numvec.F
+
+* 11/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Temporary fix for rotation periodicity (especially
+ with extended neighborhood).
+ modified routines:
+ include/base/cs_halo.h
+ include/base/cs_perio.h
+ src/base/cs_gradient.c
+ src/base/cs_halo.c
+ src/base/cs_mesh.c
+ src/base/cs_parall.c
+ src/base/cs_perio.c
+ src/base/grdcel.F
+ src/base/promav.F
+
+* 11/08/2008 - Jerome Bonelle <jerome.bonelle at edf.fr>
+ Replace the algorithm used to defined periodic couples
+ in order to avoid a possible issue.
+ modfied routine:
+ src/base/cs_perio.c
+
+* 11/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Modifications related to the Code_Saturne I/O unification
+ between the preprocessor output and the solver restart files.
+ Only preprocessor output has been modified at the moment.
+ modified routines:
+ include/base/cs_io.h
+ src/base/cs_ecs_messages.c
+ src/base/cs_io.c
+ src/base/cs_main.c
+
+* 11/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 584:585, adding patches directory)
+
+* 11/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 580:583, several minor corrections)
+
+* 08/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 577:579, cutting warped faces corrections)
+
+* 08/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 573:574, updating on extended halos)
+
+* 07/08/2008 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Add oxycombustion and fuel classes management.
+ added routines:
+ include/pprt/ppcpfu.h
+ src/fuel/fucyno.F
+ deleted routines:
+ src/cplv/cpcym1.F
+ src/cplv/cppdf5.F
+ modified routines:
+ include/cplv/cpincl.h
+ include/fuel/fuincl.h
+ include/pprt/ppincl.h
+ src/base/covofi.F
+ src/base/iniusi.F
+ src/cplv/cpcym2.F
+ src/cplv/cpflux.F
+ src/cplv/cpini1.F
+ src/cplv/cpiniv.F
+ src/cplv/cplecd.F
+ src/cplv/cplin1.F
+ src/cplv/cplini.F
+ src/cplv/cplphy.F
+ src/cplv/cpltcl.F
+ src/cplv/cplym1.F
+ src/cplv/cppdf4.F
+ src/cplv/cpphy1.F
+ src/cplv/cpphyv.F
+ src/cplv/cpprop.F
+ src/cplv/cpptcl.F
+ src/cplv/cpteh1.F
+ src/cplv/cptehm.F
+ src/cplv/cptssc.F
+ src/cplv/cpvarp.F
+ src/fuel/fucym1.F
+ src/fuel/fuflux.F
+ src/fuel/fuini1.F
+ src/fuel/fuiniv.F
+ src/fuel/fulecd.F
+ src/fuel/fuphy1.F
+ src/fuel/fuphy2.F
+ src/fuel/fuphyv.F
+ src/fuel/fuprop.F
+ src/fuel/fuptcl.F
+ src/fuel/futeh2.F
+ src/fuel/futssc.F
+ src/fuel/futsvc.F
+ src/fuel/futsvi.F
+ src/fuel/fuvarp.F
+ src/pprt/ppcabs.F
+ src/pprt/ppcsca.F
+ src/pprt/ppinii.F
+ src/pprt/pppdfr.F
+ src/pprt/ppphyv.F
+ src/pprt/ppray4.F
+ src/rayt/raydom.F
+ src/rayt/rayopt.F
+ users/cplv/uscpcl.F
+ users/cplv/uscpi1.F
+ users/cplv/uscpiv.F
+ users/fuel/usfucl.F
+ users/fuel/usfui1.F
+ users/fuel/usfuiv.F
+ users/pprt/usppmo.F
+
+* 07/08/2008 - David Monfort <david.monfort at edf.fr>
+ Removing the compilation logs from versioning.
+ removed files:
+ aux/comparlist
+ aux/listing_*
+
+* 06/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Upgrading to Preprocessor 1.4 and FVM 0.11.0 in order
+ to separate the preprocessing from the partioning.
+ There is now a single preprocessor_output file, so that
+ mesh joining has not to be done again when one asks for
+ a different number of processors.
+ deleted script:
+ bin/lance_install
+ added script:
+ sbin/install
+ modified scripts:
+ bin/cs_profile
+ bin/macros_*.mk
+ bin/runcase
+ bin/runcase.help
+ modified routines:
+ include/base/cs_ecs_messages.h
+ include/base/cs_io.h
+ include/base/cs_mesh.h
+ include/base/parall.h
+ src/base/cs_ecs_messages.c
+ src/base/cs_io.c
+ src/base/cs_main.c
+ src/base/cs_mesh.c
+ src/base/cs_opts.c
+ src/base/impini.F
+ src/base/iniini.F
+ src/base/majgeo.F
+
+* 06/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Removing heap memory instrumentation.
+ modified routines:
+ src/base/cs_base.c
+
+* 05/08/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Scripts translation and improvements.
+ deleted scripts:
+ bin/cree_sat
+ bin/info_cs
+ bin/lance
+ bin/lance.help
+ added scripts:
+ bin/cs_create
+ bin/cs_info
+ bin/ecs
+ bin/runcase
+ bin/runcase.help
+ bin/runcase_mpi_env
+ bin/runcase_syrthes
+ modified scripts:
+ bin/compiler_version
+ bin/check_consistency
+ bin/check_mesh
+ bin/gracehst
+ bin/lance_install
+ bin/Makefile
+ bin/macros_Blue_Gene_L.mk
+ bin/macros_Blue_Gene_P.mk
+ bin/macros_Darwin.mk
+ bin/macros_Linux.mk
+ bin/macros_Linux_CCRT.mk
+ bin/macros_Linux_Ch.mk
+ bin/macros_Linux_IA.mk
+ bin/macros_Linux_x86_64.mk
+ bin/SaturneGUI
+ modified routine:
+ src/base/cs_base.c
+
+* 04/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 531:532, coherency test improvement)
+
+* 04/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 529:530, scripts translation)
+
+* 04/08/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 527:528, lagrangian bug fix)
+
+* 25/07/2008 - David Monfort <david.monfort at edf.fr>
+ Merging from the 1.3 branch (-r 523:524, Port to BlueGene/P system)
+
+* 24/07/2008 - David Monfort <david.monfort at edf.fr>
+ The reconstruction of the right-hand side has now its
+ own precision parameter (EPSRSM) instead of using EPSILO.
+ modified routines:
+ include/base/optcal.h
+ doc/USER/latex/saturne2.tex
+ src/rayt/raysol.F
+ src/rayt/raypun.F
+ src/lagr/lageqp.F
+ src/cfbl/cfener.F
+ src/cfbl/cfcdts.F
+ src/cfbl/cfqdmv.F
+ src/cfbl/cfmsvl.F
+ src/base/alelap.F
+ src/base/resrij.F
+ src/base/resolp.F
+ src/base/resv2f.F
+ src/base/turbkw.F
+ src/base/distyp.F
+ src/base/covofi.F
+ src/base/impini.F
+ src/base/reseps.F
+ src/base/resssg.F
+ src/base/turbke.F
+ src/base/iniini.F
+ src/base/preduv.F
+ src/base/modini.F
+ src/base/codits.F
+ src/base/calhyd.F
+
+* 24/07/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Extending support for restart files to extracted part
+ of the mesh
+ modfified routines:
+ include/base/cs_suite.h
+ src/base/cs_suite.c
+ src/base/cs_tpar1d.c
+
+* 24/07/2008 - David Monfort <david.monfort at edf.fr>
+ Removing cs_perio_sync_geo by cs_perio_sync_var
+ modified routines:
+ include/base/cs_perio.h
+ src/base/cs_mesh_quantities.c
+ src/base/cs_perio.c
+
+* 24/07/2008 - David Monfort <david.monfort at edf.fr>
+ Replacing all occurences of cs_parall_sync with cs_halo_sync
+ and removing this former function in cs_parall.
+ modified routines:
+ include/base/cs_parall.h
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_benchmark.c
+ src/base/cs_gradient.c
+ src/base/cs_grid.c
+ src/base/cs_matrix.c
+ src/base/cs_mesh_coherency.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_multigrid.c
+ src/base/cs_parall.c
+
+* 23/07/2008 - David Monfort <david.monfort at edf.fr>
+ Renaming cs_syr files and routines to cs_syr3 and
+ cs_comm files and routines to cs_syr3_comm in order
+ to prepare for SYRTHES 4 coupling.
+ renamed routines:
+ include/base/cs_comm.h
+ include/base/cs_syr_coupling.h
+ include/base/cs_syr_messages.h
+ src/base/cs_comm.c
+ src/base/cs_syr_coupling.c
+ src/base/cs_syr_messages.c
+ modified routines:
+ src/base/cs_main.c
+ src/base/cs_opts.c
+
+* 08/07/2008 - David Monfort <david.monfort at edf.fr>
+ Improving the gracehst wrapper to make it accept more than
+ 30 probes.
+ modified script:
+ bin/gracehst
+
+* 30/06/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Fixing some bugs in the multigrid algorithm when periodicity
+ is present.
+ modified routine:
+ src/base/cs_grid.c
+
+* 30/06/2008 - David Monfort <david.monfort at edf.fr>
+ Fixing a but in the call to CODITS in the non-dimensional
+ distance to the wall calculation.
+ modified routine:
+ src/base/distyp.F
+
+* 30/06/2008 - David Monfort <david.monfort at edf.fr>
+ Adding a test on the number of domains and the lagrangian
+ simulation in the launch script, and fixing a bug on the
+ radiation results copy.
+ modified scripts:
+ bin/check_consistency
+ bin/lance
+
+* 30/06/2008 - David Monfort <david.monfort at edf.fr>
+ Creating a directory structure for How-to documentation.
+ added directories:
+ doc/HOWTO
+ doc/HOWTO/graphics
+ doc/HOWTO/input
+ doc/HOWTO/latex
+ added scripts:
+ doc/HOWTO/graphics/Makefile
+ doc/HOWTO/latex/Makefile
+ doc/HOWTO/Makefile
+
+* 30/06/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Cosmethic changes in Fortran memory display.
+ modified routines:
+ src/base/cs_base.c
+ src/base/cs_main.c
+
+* 30/06/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Move a variable declaration to follow C89 standards.
+ modified routine:
+ src/base/cs_matrix.c
+
+* 30/06/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction on argument types (no impact as they are enum types).
+ modified routine:
+ src/base/cs_pp_io.c
+
+* 30/06/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Fixing a bug in error display in cs_gui_get_attribute_value.
+ modified routine:
+ src/base/cs_gui_util.c
+
+* 30/06/2008 - David Monfort <david.monfort at edf.fr>
+ Fixing a bug with cell selection.
+ modified routine:
+ src/base/cs_selector.c
+
+* 30/06/2008 - Alexandre Douce <alexandre.douce at edf.fr>
+ With periodicity, particule tracking can raise an issue.
+ One forces ISENSF to zero in order to avoid it temporarily.
+ modified routine:
+ src/lagr/ouestu.F
+
+* 30/06/2008 - David Monfort <david.monfort at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Correction on strings comparisons in the Makefile,
+ possibly source of failure on some systems (SunOS at least)
+ modified script:
+ bin/lance
+
+* 30/06/2008 - David Monfort <david.monfort at edf.fr>
+ Suppression of RUBENS references in the launch script
+ modified script:
+ bin/lance
+
+* 25/06/2008 - David Monfort <david.monfort at edf.fr>
+ Fixing a bug on coordinates synchronization when
+ periodicity is present.
+ modified routine:
+ src/base/cs_perio.c
+
+* 17/06/2008 - David Monfort <david.monfort at edf.fr>
+ Removing LD_LIBRARY_PATH related to libxml2 library
+ because all machines have it installed locally.
+ Adding a comment when the user need to have it
+ installed elsewhere.
+ modified scripts:
+ bin/cs_profile
+ modified macros:
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+
+* 17/06/2008 - David Monfort <david.monfort at edf.fr>
+ Tagging of version 1.4.a
+
+* 17/06/2008 - David Monfort <david.monfort at edf.fr>
+ Updating macros on Linux systems (use of local
+ libxml2 and ATLAS libraries whane available) and
+ upgrading to gcc 4.3.1
+ modified macros:
+ bin/macros_Linux_CCRT.mk
+ bin/macros_Linux_Ch.mk
+ bin/macros_Linux_IA64.mk
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+
+* 17/06/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Simplification of some scripts
+ modified scripts:
+ bin/cs_profile
+ bin/SaturneGUI
+
+* 17/06/2008 - David Monfort <david.monfort at edf.fr>
+ Add a warning when the number of preprocessor_output files
+ read by the kernel does not correspond to the number of MPI
+ processes.
+ modified routine:
+ src/base/cs_ecs_messages.c
+
+* 17/06/2008 - David Monfort <david.monfort at edf.fr>
+ Merging the correction on wrong arguments in RAYDAK
+ from Version1_3 branch.
+ modified routine:
+ src/rayt/raydak.F
+
+* 10/06/2008 - David Monfort <david.monfort at edf.fr>
+ Bug correction on an usued static array in FORTRAN
+ modified routines:
+ src/fuel/futsvi.F
+
+* 10/06/2008 - David Monfort <david.monfort at edf.fr>
+ Removing unused arrays related to multigrid algorithm:
+ IFACLG, IRESPR, DAG and XAG.
+ modified routines:
+ src/rayt/raydom.F
+ src/rayt/raysol.F
+ src/rayt/raypun.F
+ src/rayt/memra2.F
+ src/lagr/lageqp.F
+ src/lagr/lagpoi.F
+ src/cfbl/cfener.F
+ src/cfbl/memcfm.F
+ src/cfbl/cfcdts.F
+ src/cfbl/cfqdmv.F
+ src/cfbl/cfmsvl.F
+ src/base/memv2f.F
+ src/base/alelap.F
+ src/base/resrij.F
+ src/base/memdis.F
+ src/base/memale.F
+ src/base/resolp.F
+ src/base/resv2f.F
+ src/base/turbkw.F
+ src/base/turrij.F
+ src/base/navsto.F
+ src/base/distyp.F
+ src/base/memkep.F
+ src/base/memkom.F
+ src/base/covofi.F
+ src/base/memdyp.F
+ src/base/reseps.F
+ src/base/distpr.F
+ src/base/resssg.F
+ src/base/turbke.F
+ src/base/scalai.F
+ src/base/memsca.F
+ src/base/preduv.F
+ src/base/memnav.F
+ src/base/memrij.F
+ src/base/codits.F
+ src/base/calhyd.F
+ src/base/invers.F
+ src/base/tridim.F
+
+* 30/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Modification of Code_Saturne compilation with the
+ ElectricFence library.
+ modified routines:
+ bin/macros_Linux_x86_64.mk
+ bin/lance_install
+ bin/Makefile
+
+* 30/05/2008 - Namane Mechitoua <namane.mechitoua at edf.fr>
+ Sophie Bosse <sophie.bosse at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Modification of the algebric multigrid algorithm
+ adapted to the resolution of pressure equation.
+ The algorithm works in serial and parallel runs.
+ modified routines:
+ users/base/usini1.F
+ include/base/cs_prototypes.h
+ include/base/optcal.h
+ include/base/cs_sles.h
+ doc/USER/latex/saturne2.tex
+ src/cfbl/cfcdts.F
+ src/base/verini.F
+ src/base/resolp.F
+ src/base/impini.F
+ src/base/cs_main.c
+ src/base/cs_sles.c
+ src/base/calgeo.F
+ src/base/iniini.F
+ src/base/modini.F
+ src/base/codits.F
+ src/base/invers.F
+ added routines:
+ include/base/cs_grid.h
+ include/base/cs_multigrid.h
+ src/base/autmgr.F
+ src/base/crstgr.F
+ src/base/cs_grid.c
+ src/base/cs_multigrid.c
+ users/base/ustmgr.F
+ deleted routines:
+ include/base/mltgrd.h
+ src/base/calgrg.F
+ src/base/cgstab.F
+ src/base/clmlga.F
+ src/base/cycmgr.F
+ src/base/gradco.F
+ src/base/jacobi.F
+ src/base/memgrg.F
+ src/base/mempgr.F
+ src/base/premgr.F
+ src/base/prolon.F
+ src/base/resmgr.F
+
+* 29/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Translating memory checking from FORTRAN to C.
+ modified routines:
+ include/base/cs_base.h
+ include/base/cs_parall.h
+ src/base/cs_base.c
+ src/base/cs_parall.c
+ src/base/cs_main.c
+ src/base/caltri.F
+ src/base/memini.F
+ deleted routines:
+ include/base/memoir.h
+ src/base/rasize.F
+ src/base/iasize.F
+
+* 29/05/2008 - David Monfort <david.monfort at edf.fr>
+ The size of the work arrays IA and RA is now defined
+ with a FORTRAN user file and no more via the scripts,
+ making them independent of the number of sub-domains
+ in case of a parallel run.
+ modified routines:
+ users/base/usini1.F
+ include/base/cs_opts.h
+ include/base/dimens.h
+ include/base/memoir.h
+ doc/USER/latex/saturne1.tex
+ src/base/initi1.F
+ src/base/impini.F
+ src/base/cs_main.c
+ src/base/caltri.F
+ src/base/iniusi.F
+ src/base/cs_gui.c
+ src/base/iniini.F
+ src/base/cs_opts.c
+ src/base/memini.F
+ bin/lance
+ bin/lance.help
+ deleted routines:
+ users/base/ustbus.F
+
+* 29/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Adding communications with a proxy, in order to prepare
+ the Code_Saturne/Code_Aster coupling via Salom�/YACS.
+ modified routines:
+ include/base/cs_opts.h
+ include/base/cs_base.h
+ src/base/cs_base.c
+ src/base/cs_main.c
+ src/base/cs_opts.c
+ added routines:
+ include/base/cs_calcium.h
+ include/base/cs_proxy_comm.h
+ src/base/cs_proxy_comm.c
+ src/base/cs_calcium.c
+
+* 29/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Modification of the behaviour of renumbering.
+ modified routines:
+ include/base/cs_post.h
+ include/base/cs_mesh.h
+ src/base/numvec.F
+ src/base/cs_main.c
+ src/base/cs_post.c
+ src/base/cs_suite.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_warping.c
+ src/base/cs_mesh_connect.c
+
+* 28/05/2008 - David Monfort <david.monfort at edf.fr>
+ Removing the parts of the compilation scripts concerning
+ the Purify and Foresys tools, as they are no more used.
+ modified routines:
+ bin/lance_install
+ bin/lance.help
+ bin/Makefile
+ doc/USERS/latex/saturne1.tex
+
+* 27/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Simplifying the command line option for a parallel run.
+ modified routines:
+ bin/lance_install
+ src/base/cs_opts.c
+
+* 27/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Adding support for a shared library on Linux systems.
+ modified routines:
+ bin/lance_install
+ bin/Makefile
+ bin/macros_Linux.mk
+ bin/macros_Linux_x86_64.mk
+
+* 27/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Adding a sub-script to check FORTRAN user files consistency.
+ Adding a script to clean the directories.
+ Updating the compiler for EDF Calibre 5 workstations.
+ modified routines:
+ bin/lance
+ bin/lance_install
+ bin/macros_Linux_x86_64.mk
+ added routines:
+ bin/check_consistency
+ aux/clean
+
+* 27/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Adding a warning in case of rotation periodicity
+ modified routines:
+ src/base/cs_matrix.c
+
+* 27/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Adding two routines to save and restore the halos
+ with a rotation periodicity (before doing a matrix
+ vector product under certain circumstances)
+ modified routines:
+ include/base/cs_perio.h
+ src/base/promav.F
+ src/base/cs_perio.c
+
+* 27/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Updating the halo structure in order to prepare
+ for a parallel and periodic multigrid algorithm.
+ modified routines:
+ include/base/cs_matrix.h
+ include/base/cs_halo.h
+ include/base/cs_mesh.h
+ include/base/cs_mesh_quantities.h
+ include/base/cs_perio.h
+ src/lagr/cs_lagr_perio.c
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_benchmark.c
+ src/base/cs_mesh_coherency.c
+ src/base/cs_mesh_halo.c
+ src/base/cs_parall.c
+ src/base/cs_matrix.c
+ src/base/cs_gradient.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_perio.c
+ src/base/cs_sles.c
+ src/base/cs_halo.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_warping.c
+
+* 27/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Removing native matrix-vector product from C call.
+ Changing CSR matrix format behaviour.
+ modifified routine:
+ src/base/cs_matrix.c
+
+* 26/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Adding a routine to compute the minimum of an integer
+ over the domains in case of parallelism
+ modified routines:
+ include/base/cs_parall.h
+ src/base/cs_parall.c
+
+* 26/05/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Removing unused MSR matrix format
+ modified routines:
+ include/base/cs_matrix.h
+ src/base/cs_benchmark.c
+ src/base/cs_matrix.c
+
+* 21/05/2008 - Jerome Bonelle <jerome.bonelle at edf.fr>
+ Renaming and reshaping the halos structures in order
+ to prepare for multigrid integration
+
+ modified routines:
+ include/base/cs_halo.h
+ include/base/cs_mesh.h
+ include/base/cs_parall.h
+ include/base/cs_perio.h
+ src/lagr/cs_lagr_perio.c
+ src/base/cs_ext_neighborhood.c
+ src/base/cs_mesh_coherency.c
+ src/base/cs_parall.c
+ src/base/cs_matrix.c
+ src/base/cs_gradient.c
+ src/base/cs_mesh_quantities.c
+ src/base/cs_perio.c
+ src/base/cs_halo.c
+ src/base/cs_mesh.c
+ src/base/cs_mesh_warping.c
+
+ added subroutines:
+ include/base/cs_mesh_halo.h
+ src/base/cs_mesh_halo.c
+
+* 16/05/2008 - Alexandre Douce <alexandre.douce at edf.fr>
+ Corrections on Lagrangian module (wrong definition
+ of STATFB in dvvpst.F)
+ modified routines:
+ dvvpst.F
+ uslag1.F
+
+* 16/04/2008 - David Monfort <david.monfort at edf.fr>
+ Tagging of version 1.3.2
+
+* 10/04/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Several corrections on the user guide
+ modified routine:
+ saturne1.tex
+
+* 08/04/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Port to BlueGene/P and Cray XT
+ modified routines:
+ cs_base.c
+ cs_sles.c
+ cs_suite.c
+ tremai.c
+
+* 08/04/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Wrong index when setting the last character of a string
+ when parsing the groups name when coupling with SYRTHES
+ modified routines:
+ cs_mesh_select.c
+
+* 28/03/2008 - David Monfort <david.monfort at edf.fr>
+ Correction on the gradient limitation when a rotational
+ periodicity is present
+ modified routines:
+ cs_gradient.h
+ cs_gradient.c
+ grdcel.F
+
+* 28/03/2008 - David Monfort <david.monfort at edf.fr>
+ Correction on the gradient computation with IMRGRA = 4
+ modified routine:
+ grdcel.F
+
+* 28/03/2008 - David Monfort <david.monfort at edf.fr>
+ The indirection between a scalar of the electric module and
+ the whole scalars array was mis-used in the physical properties
+ initialisation of this module.
+ modified routines:
+ elphyv.F
+
+* 21/03/2008 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Corrected extended neighborhood reduction bug
+ modified routines:
+ cs_ext_neighborhood.c
+
+* 12/03/2008 - David Monfort <david.monfort at edf.fr>
+ Tagging of the Version1_3 branch
+ Trunk open for new commits.
+
+* 12/03/2008 - David Monfort <david.monfort at edf.fr>
+ Add a cleaning pass when installing the documentation
+ modified routines:
+ lance_install
+
+* 05/03/2008 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ David Monfort <david.monfort at edf.fr>
+ Tests on a specific array for the extended neighborhood instead of
+ halo_type, to avoid failing tests in sequential compuations.
+ Fix a bug in the gradient limitation when using the extended
+ neighborhood.
+ modified routines:
+ cs_gradient.c
+ cs_mesh.c
+ cs_mesh_coherency.c
+
+* 05/03/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Fixes a bug during the pressure sweeps while using the steady-state
+ algorithm.
+ modified routines:
+ resolp.F
+
+* 05/03/2008 - Yvan fournier <yvan.fournier at edf.fr>
+ Fixes an error when parsing arguments that arise in some
+ configuration
+ modified routines:
+ cs_opts.c
+
+* 05/03/2008 - David Monfort <david.monfort at edf.fr>
+ Adds a warning when using the dynamic model in LES along with a
+ least-squares method based on a reduced extended neighborhood for
+ the gradient computation
+ modified routine:
+ saturne2.tex
+ verini.F
+ ussmag.F
+
+
+* 04/03/2008 - David Monfort <david.monfort at edf.fr>
+ Update FVM API to take into account some particular cases
+ where two periodicities are not commutative
+ modified routines:
+ cs_mesh.c
+
+* 04/03/2008 - David Monfort <david.monfort at edf.fr>
+ Add a warning when changing the mesh vertices coordinates along
+ with periodicity, which can break the periodicity parameters.
+ modified routines:
+ saturne1.tex
+ usmodg.F
+
+* 04/03/2008 - David Monfort <david.monfort at edf.fr>
+ Remove no more used function _sync_var_scal_strided and update
+ consequently cs_perio_sync_var_scal. Remove prototype for PERCVE
+ as well.
+ modified routines:
+ cs_perio.h
+ cs_ext_neighborhood.c
+ cs_gradient.c
+ cs_matrix.c
+ cs_perio.c
+
+* 04/03/2008 - David Monfort <david.monfort at edf.fr>
+ Fix a rotational periodicity issue in mesh coherency checks.
+ A variable was treated as a scalar instead as a vector.
+ modified routines:
+ cs_mesh_coherency.c
+
+* 04/03/2008 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Fix a bug in the definition of the extended halo when one needs to
+ use the extended neighborhood
+ modified routines:
+ cs_halo.c
+
+* 04/03/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correct distance use at the first time-step when using the k-w SST
+ model and the old algorithm to compute the wall distance
+ modified routines:
+ vissst.F
+
+* 27/02/2008 - David Monfort <david.monfort at edf.fr>
+ Remove abort when checking for auxilliary sequel file and LES model
+
+* 26/02/2008 - David Monfort <david.monfort at edf.fr>
+ Change the behaviour when trying to get a list of cells or faces
+ with the selector. Revert to the old behaviour when the selection
+ was done through the mesh properties. A warning is issued instead
+ of an error when the criteria returns an empty selection.
+ modified routines:
+ cs_gui.c
+ cs_selector.c
+
+* 22/02/2008 - David Monfort <david.monfort at edf.fr>
+ Move unmaintained macros files to aux/macros_old
+ moved files:
+ macros_IRIX64.mk
+ macros_sunOS.mk
+
+* 22/02/2008 - David Monfort <david.monfort at edf.fr>
+ Add macros files for MacOSX and Linux x86_64 systems
+ Change wring optimisation -O6 to -O3 for GCC compilers
+ added routines:
+ macros_Darwin.mk
+ macros_Linux_x86_64.mk
+ modified routines:
+ macros_Linux.mk
+
+* 20/02/2008 - David Monfort <david.monfort at edf.fr>
+ Make Code_Saturne stop when a Lagrangian calculation is run with the
+ steady-state algorithm
+
+* 20/02/2008 - David Monfort <david.monfort at edf.fr>
+ Change the name Syrthes to SYRTHES following the deposit brand
+
+* 20/02/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Alexandre Douce <alexandre.douce at edf.fr>
+ Add documentation on faces/cells selection with GETxxx via fvm_selector
+
+* 20/02/2008 - David Monfort <david.monfort at edf.fr>
+ Add comments on steady-state algorithm IDTVAR=-1
+ modified routines:
+ saturne2.tex
+ usini1.F
+
+* 18/02/2008 - David Monfort <david.monfort at edf.fr>
+ Set the version number of Code_Saturne Kernel to 1.3.2
+ modified routines:
+ COMPATIBILITY
+ compil.exe
+ Makefile
+ autovalid.xml
+ cs_profile
+ csdoc.sty
+ cs_ops.c
+
+* 18/02/2008 - David Monfort <david.monfort at edf.fr>
+ Add a temporary "tmp_Saturne/$ETUDE.$CAS.$DATE" directory when running
+ a case in $TMPDIR (when defined by the system) to avoid an issue
+ with the linux distribution CAELinux
+ modified routines:
+ lance
+
+* 18/02/2008 - David Monfort <david.monfort at edf.fr>
+ Update the macros files to new version of BFT and FVM
+ modified routines:
+ cs_couplage.c
+ COMPATIBILITY
+
+* 18/02/2008 - David Monfort <david.monfort at edf.fr>
+ Make use of the "xspace" package in the documentation for intelligent spaces
+
+* 18/02/2008 - David Monfort <david.monfort at edf.fr>
+ Complete reorganisation of the theory documentation to follow the template
+ of the user and tutorial documents
+
+* 15/02/2008 - David Monfort <david.monfort at edf.fr>
+ Centralized EDF and Code_Saturne logos in the style directory
+
+* 12/02/2008 - David Monfort <david.monfort at edf.fr>
+ Correction of unitialized values in the vortex method when ICAS=4
+ modified routines:
+ vorini.F
+
+* 12/02/2008 - Alexandre Douce <alexandre.douce at edf.fr>
+ Global allocation of an auxilliary array, instead of local
+ modified routines:
+ caltri.F
+ lagcel.F
+ lagopt.F
+ lagune.F
+ ouestu.F
+ uslag1.F
+
+* 12/02/2008 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Bug fix in coal combustion
+ modified routines:
+ cpcym2.F
+
+* 07/02/2008 - David Monfort <david.monfort at edf.fr>
+ Keep the consistancy between the maximum number of phases
+ in cs_perio.h and paramx.h (both being set at 1 for the moment)
+
+* 07/02/2008 - Alexandre Douce <alexandre.douce at edf.fr>
+ Bug fixes for the computation of mean values of combustion
+ variables within the GUI
+ modified routines:
+ cs_gui.c
+ usini1.F
+
+* 07/02/2008 - David Monfort <david.monfort at edf.fr>
+ Inversion of argument of the user function PHIDAT,
+ according to how it called by the kernel
+ modified routines:
+ usvort.F
+
+* 07/02/2008 - Alexandre Douce <alexandre.douce at edf.fr>
+ Bug fixes when reading a sequel file
+ modified routines:
+ laglec.F
+ lagout.F
+
+* 07/02/2008 - Yvan Fournier <yvan.fournier at edf.fr>
+ Variant for Intel compiler on Itanium only, optimizations by BULL
+ modified routines:
+ cs_matrix.c
+ cs_sles.c
+
+* 07/02/2008 - David Monfort <david.monfort at edf.fr>
+ Wrong affectation for last element in an array in cs_post.c
+
+* 14/01/2008 - David Monfort <david.monfort at edf.fr>
+ Renaming the Preprocessor listing from listenv to listpre
+ modified routines:
+ lance
+ saturne1.tex
+
+* 14/01/2008 - David Monfort <david.monfort at edf.fr>
+ Minor correction of the Makefile for the target LINK
+
+* 14/01/2008 - David Monfort <david.monfort at edf.fr>
+ Correction in the macro definition of the keyword inline
+ modified routine:
+ cs_base.h
+ cs_lagrang.c
+
+* 14/01/2008 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Bug fix in face renumbering and ponderation algorithm
+ improvement
+ modified routines:
+ cs_syr_coupling.c
+
+* 14/01/2008 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Missing argument in printf function in cs_syr_mesages.c
+
+* 08/01/2008 - David Monfort <david.monfort at edf.fr>
+ Portability improvements in scripts
+ Thanks to Thierry Thomas for reporting the problems
+ modified routines:
+ Makefile
+ compiler_version
+ cree_sat
+ gracehst
+ grp
+
+* 28/11/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.1
+
+* 19/11/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Syntax and unused variables correction
+ deleted routines:
+ usrubm.F
+ postlc.F
+ modified routines:
+ calhyd.F
+ caltri.F
+ cfphyv.F
+ clptrg.F
+ cpcym2.F
+ cpflux.F
+ cplph1.F
+ cpphy1.F
+ cpphyv.F
+ cpteh1.F
+ cptssc.F
+ cptsvc.F
+ cregeo.F
+ cs_gui.c
+ cs_mesh.c
+ cs_mesh_warping.c
+ cs_parall.c
+ ebuphy.F
+ ebuver.F
+ enslag.F
+ fucym1.F
+ fuflux.F
+ fuincl.h
+ fuiniv.F
+ fulecd.F
+ fuphy1.F
+ fuphy2.F
+ fuphyv.F
+ fuptcl.F
+ futeh1.F
+ futeh2.F
+ futhp1.F
+ futssc.F
+ futsvc.F
+ futsvi.F
+ fuveri.F
+ iniusi.F
+ lagaff.F
+ lagcel.F
+ lagent.F
+ lagesp.F
+ lagfch.F
+ laghis.F
+ laglis.F
+ lagnpr.F
+ lagnwc.F
+ lagout.F
+ lagune.F
+ lwcver.F
+ optcal.h
+ pdflwc.F
+ pdfpp4.F
+ prods2.F
+ prods3.F
+ prodsc.F
+ resolp.F
+ strhis.F
+ usalcl.F
+ uscfcl.F
+ uscfpv.F
+ uscpcl.F
+ uscplc.F
+ usd3pc.F
+ usebuc.F
+ uselcl.F
+ usfucl.F
+ usfuiv.F
+ uslabo.F
+ usladp.F
+ uslafe.F
+ uslag2.F
+ uslwcc.F
+ usnpst.F
+ usray5.F
+
+* 15/11/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ Correction of inlet conditions in coal combustion
+ with GUI
+ modified routines:
+ cs_gui.c
+ cs_gui.h
+ ppclim.F
+
+
+* 15/11/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Passing of missing MAXELT/LSTELT arguments
+ for GETCEL selection in user routines
+ modified routines:
+ cfiniv.F
+ cfmsfl.F
+ cfmsgs.F
+ cfphyv.F
+ cfqdmv.F
+ cpiniv.F
+ cplini.F
+ d3pini.F
+ ebuini.F
+ eliniv.F
+ elphyv.F
+ fuiniv.F
+ inivar.F
+ lwcini.F
+ preduv.F
+ reseps.F
+ resrij.F
+ resssg.F
+ scalai.F
+ turbke.F
+ turbkw.F
+ uscfpv.F
+ uscfxi.F
+ uscpiv.F
+ usd3pi.F
+ usebui.F
+ useliv.F
+ uselph.F
+ usfuiv.F
+ usiniv.F
+ uslwci.F
+ ustske.F
+ ustskw.F
+ ustsns.F
+ ustsri.F
+ ustsv2.F
+
+
+* 14/11/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Bug correction in typecl.F on the setting
+ of the reference face for pressure when
+ some outlet boundary conditions are changed
+ from standard values (+ bug correction in
+ parallel when IPHYDR=1)
+
+* 14/11/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Misspelling of SRROM in info message
+ modified routines:
+ d3pver.F
+ ebuver.F
+ lwcver.F
+ cplver.F
+ elveri.F
+ fuveri.F
+
+
+
+* 14/11/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Modification of the launch script lance for
+ a correct copy of thermochemical files with
+ the pulverized coal module + correction of
+ error in the protecting test of uscpcl.F
+
+* 12/11/2007 - David Monfort <david.monfort at edf.fr>
+ Bug correction in an (unused!) function fo cs_blas.c
+
+* 07/11/07 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of intermediate version 1.3.1-rc1 before
+ second phase of validation campaign
+
+* 07/11/07 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Minor modification in fuphy1.F
+
+* 05/11/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ Bug correction for P1 radiative transfer in usray5.F
+
+* 31/10/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Correction of an erroneous assert in cs_halo.c
+
+* 31/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Storage on preprocessor files in a subdirectory of
+ the temporary execution directory + change of
+ BLAS libraries on Linux
+ modified routines
+ cs_main.c
+ cs_pp_io.c
+ cs_pp_io.h
+ modified script:
+ lance
+ macros_Linux.mk
+
+
+* 31/10/2007 - Nicole Picard <nicole-n.picard at edf.fr>
+ Alexandre Douce <alexandre.douce at edf.fr>
+ Modification and correction of GUI reader
+ modified routines:
+ caltri.F
+ cs_gui.c
+ cs_gui.h
+ cs_gui_radiative_transfer.c
+ cs_gui_radiative_transfer.h
+ cs_gui_util.c
+ cs_main.c
+ iniusi.F
+ ppclim.F
+ tridim.F
+
+* 31/10/2007 - Fabien Huvelin <fabien.huvelin at edf.fr>
+ Marc Sakiz <marc.sakiz at edf.fr>
+ Modification of strpre.F for correct handling of structure
+ initial displacement
+
+* 30/10/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ Suppression of unused variables in cptssc.F
+
+* 30/10/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Correction of automatic stop of calculation when
+ P1 radiative transfer assumptions are not met
+ modified routine:
+ caltri.F
+
+* 23/10/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Update of comments on GETFBR/GETFAC/GETCEL in user
+ routines
+ modified routines:
+ usalcl.F
+ usclim.F
+ uskpdc.F
+ usproj.F
+ uspt1d.F
+ usstru.F
+ ustsma.F
+ ustssc.F
+ usvort.F
+ uscfcl.F
+ usd3pc.F
+ usebuc.F
+ uslwcc.F
+ uscpcl.F
+ uscplc.F
+ uselcl.F
+ usetcl.F
+ usfucl.F
+ uslag2.F
+ usray2.F
+
+* 22/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Update of compilation commands for BlueGene
+ modified scripts:
+ macros_Blue_Gene_L.mk
+ Makefile
+
+* 22/10/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Bug correction in extended neighborhood (index error
+ in connectivity list and shunted use of ext_neighborhood
+ in gradient calculation)
+ modified routines:
+ cs_ext_neighborhood.c
+ cs_gradient.c
+
+* 22/10/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Correction of bug in rotation periodicity with lagrangian
+ module + minor comments and syntax modifications +
+ compilation options for CCRT machines
+ modified routines:
+ cs_benchmark.c
+ cs_lagr_perio.c
+ cs_perio.c
+ lagcel.F
+ modified cripts:
+ macros_Linux_CCRT.mk
+ macros_Linux_IA64.mk
+
+
+* 19/10/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Robustness modification in scalai.F: initialisation
+ of RTPA not done if NTCABS.EQ.1 but in IPASS.EQ.1
+ (in case a first iteration with NTCABS=0 is done).
+
+* 19/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction in cs_suite.c : floating point
+ exception on certain architectures in parallel
+ when a number of entities (cells, internal faces
+ or boundary faces) is zero
+ (e.g. triple periodicity box)
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction in the CPU time calculation
+ in cs_benchmark.c when compiling without
+ MPI
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor indentation modifications
+ modified routines:
+ covofi.F
+ cs_ext_neighborhood.c
+ cs_mesh.h
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Change in the syntax of tests to avoid a warning
+ on IA64 architecture with intel compilers
+ modified routines:
+ varpos.F
+ verini.F
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Use of MPI_RANK variable for MPICH2 in rang_mpi.sh
+ + minor change in file permissions in lance_install
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Bug correction in index shift in paragv routine
+ in cs_parall.c
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction of pragma commands for xlc compiler in
+ cs_matrix.c
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Move of obsolete macros_OSF1.mk and macros_HU-UX.mk
+ files in new aux/macros_old archive directory
+
+* 16/10/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Plugging of fvm-0.9.0 with extra argument in selector
+ routines
+ modified routines:
+ cs_gui.c
+ cs_mesh.c
+ cs_selector.c
+ modified scripts:
+ macros*.mk
+
+* 15/10/2007 - David Monfort <david.monfort at edf.fr>
+ Correction of compilation warnings
+ modified routines:
+ cs_gui_radiative_transfer.c
+ cs_halo.c
+
+* 11/10/2007 - David Monfort <david.monfort at edf.fr>
+ Correction fof IDIMTE coefficient in reseps.F for
+ rotation periodicity synchronization in standard Rij-eps
+ model
+
+* 09/10/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Use of bft-1.0.5
+ modified scripts : macros*.mk
+
+* 09/10/2008 - Marc Sakiz <marc.sakiz at edf.fr>
+ Matthieu Guillaud <matthieu.guillaud at edf.fr>
+ Code_Saturne tutorial
+
+* 09/10/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Correction of error in argument passing of NDIRCP
+ in covofi.F
+
+* 09/10/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Various modifications:
+ - synchronization with Syrthes only if ITRALE>0 in caltri.F
+ - change in the syntax of a test in covofi.F to avoid a warning
+ on IA64 architecture with intel compilers
+ - creation of erreur_n*** files only for processor 0 and the
+ processors receiving a segmentation fault or floating point
+ exception message
+ - correction fo benchmark mode with info on elapsed time
+ - correction in test on extended neighborhood detection
+ - correction of a problem depending on the order of exchange
+ of MPI messages for dimension calculation
+ - minor corrections in cs_mesh.c and cs_mesh_coherency.c
+ (unused variables, comments)
+ - change of kernel options "couleur" and "groupe" to "color"
+ and "group" for Syrthes options
+ - assert error in debug mode due to wrong initialization
+ on 64bits machine
+ - modification of residue test to detect when conjugate
+ gradient diverges
+ - memory management error when calling usray2.F in raycli.F
+ - global detection of boundary conditions errors in typecl.F
+ - example character strings in usdpst.F initialized to ' ' and
+ not '' (Fortran norm)
+ modified routines:
+ caltri.F
+ covofi.F
+ cs_base.c
+ cs_benchmark.c
+ cs_ext_neighborhood.c
+ cs_halo.c
+ cs_mesh.c
+ cs_mesh_coherency.c
+ cs_opts.c
+ cs_pp_io.c
+ cs_sles.c
+ raycli.F
+ typecl.F
+ usdpst.F
+
+
+* 08/10/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ Missing access to STATIV array in usproj.F
+ modified routines:
+ caltri.F
+ usproj.F
+
+* 08/10/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ Problem with pointer IIFRLA defined as real instead of
+ integer in memla1.F
+
+* 08/10/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Error in the example uselrc.F. Use of RTP(.,ISCALT(1))
+ instaed of RTP(.,ISCA(ISCALT(1)))
+
+
+* 08/10/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Initialization error on the incident flux QINCID for
+ non-wall boundaries
+ modified routines:
+ raycli.F
+
+
+* 08/10/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ No coherency between lagout and lagent on the rubrique name
+ for NBCLST + uninitialized argument in IASIZE in laglec.F
+ modified routines:
+ lagent.F
+ laglec.F
+
+* 21/08/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Correction of character chain length in inipst.F
+
+* 21/08/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Correction in DEPALE and CSMAGO initialisation
+ modified routines:
+ caltri.F
+ iniva0.F
+ memtri.F
+
+* 21/08/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Optimised debug options for IA64 architecture
+ modified script:
+ macros_Linux_IA64.mk
+
+* 21/08/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Correction of index error in mobile structures initialisation
+ modified routine:
+ iniini.F
+
+* 21/08/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Missing update of fortran commons after cutting of warped faces.
+ modified routines:
+ cs_main.c
+ iniini.F
+ majgeo.F
+
+* 17/08/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of intermediate version 1.3.1-dvp
+
+* 16/08/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Modification of coherency test in REDVSE in cs_ext_neighborhood.c
+ to allow the use of IMRGRA=3 when the extended neighborhood has
+ been calculated but is empty (1D meshes!!!).
+
+* 16/08/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Forgotten RELAXP argument in the CODITS call in cfmsvl.F
+
+
+* 14/08/2007 - Nicole Picard <nicole-n.picard at edf.fr>
+ Alexandre Douce <alexandre.douce at edf.fr>
+ Correction in pulverised coal data entry through GUI
+ modified routines:
+ cpini1.F
+ cpprop.F
+ cpvarp.F
+ cs_gui.c
+ cs_gui.h
+ cs_gui_matisse.c
+ cs_gui_radiative_transfer.c
+ cs_gui_util.c
+ iniusi.F
+
+
+* 13/08/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Erroneous dynamic allocation of work array in stdtcl.F
+ modified routines:
+ stdtcl.F
+ tridim.F
+
+* 08/08/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Bug correction in cptssc.F (test to avoid a 0/0 division)
+
+* 08/08/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Adaptation of lance.help to new english syntax of preprocessor
+ and kernel options
+
+* 07/08/2007 - Yannick Lecocq <yannick.lecocq at edf.fr>
+ Missing assignment of IDIMTE and ITENSO before PERCOM
+ in reseps.F
+
+* 06/08/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction of erroneous assert in cs_pp_io.c
+
+* 03/08/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction of unwanted ALE initialisation iteration when
+ IALE = 0
+ modified routines:
+ modini.F
+
+* 03/08/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Missing arguments to ustbus.F
+ modified routines:
+ caltri.F
+ ustbus.F
+
+
+===========================================================================
+
+* 26/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.0
+
+* 26/07/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor correction of fvm_selector in cs_mesh.c
+
+* 26/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Change in the location of the definition of
+ NIDEVE, NRDEVE, NITUSE and NRTUSE
+ added routine:
+ ustbus.F
+ modified routines:
+ caltri.F
+ cs_gui.c
+ cs_gui.h
+ dimens.h
+ impini.F
+ iniini.F
+ iniusi.F
+ usini1.F
+ verini.F
+
+* 26/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Modification of ALE initialisation step for
+ better continuity in calculation sequels.
+ modified routines:
+ albase.h
+ caltri.F
+ ecrava.F
+ iniini.F
+ lecamx.F
+ modini.F
+ strdep.F
+ strini.F
+ strpre.F
+ tridim.F
+ usalin.F
+ verini.F
+
+* 23/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Minor changes around stdtcl.F
+ modified routines:
+ stdtcl.F
+ tridim.F
+
+* 23/07/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ check_mesh routine, cleaning of lance_install script,
+ correction of cs_halo.c for safer geometrical
+ tests on halo creation
+ added script:
+ check_mesh
+ modified routine:
+ cs_halo.c
+ modified scripts:
+ info_cs
+ lance_install
+
+* 23/07/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Minor corrections in fuel module
+ modified data file:
+ JANAF
+ modified routines:
+ futsvi.F
+ usfucl.F
+
+
+* 23/07/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ Correction of dvvpst.F for lagrangian post-processing
+
+===========================================================================
+
+* 23/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.n
+
+* 23/07/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Translation of Code_Saturne arguments, renaming of Envelope into
+ Preprocesseur, suppression of useless "const" + various name modifications
+ and comments
+ modified scripts:
+ lance
+ lance.help
+ lance_install
+ verifmail
+ modified routines:
+ cs_ale.c
+ cs_ale.h
+ cs_base.c
+ cs_base.h
+ cs_benchmark.c
+ cs_comm.c
+ cs_comm.h
+ cs_couplage.c
+ cs_ecs_messages.c
+ cs_ecs_messages.h
+ cs_halo.c
+ cs_halo.h
+ cs_main.c
+ cs_mesh.c
+ cs_mesh.h
+ cs_mesh_coherency.c
+ cs_mesh_coherency.h
+ cs_mesh_quality.c
+ cs_mesh_quality.h
+ cs_mesh_quantities.c
+ cs_mesh_quantities.h
+ cs_mesh_select.c
+ cs_mesh_select.h
+ cs_mesh_solcom.c
+ cs_mesh_solcom.h
+ cs_mesh_warping.c
+ cs_mesh_warping.h
+ cs_opts.c
+ cs_opts.h
+ cs_parall.c
+ cs_parall.h
+ cs_perio.c
+ cs_perio.h
+ cs_post.c
+ cs_pp_io.c
+ cs_pp_io.h
+ cs_sles.c
+ cs_syr_coupling.c
+ cs_syr_coupling.h
+ cs_syr_messages.c
+ cs_syr_messages.h
+ csinit.F
+ entsor.h
+ iasize.F
+ iniini.F
+ parge1.F
+ rasize.F
+ rayens.F
+ rayopt.F
+
+* 23/07/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Externalisation of CGRDMC and CLMGRD in a specific routine
+ added routines:
+ cs_gradient.c
+ cs_gradient.h
+ modified routines
+ calgeo.F
+ cs_ext_neighborhood.c
+ cs_ext_neighborhood.h
+
+
+* 23/07/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ GUI bug corrections:
+ added routine:
+ stdtcl.F
+ modified routines:
+ cs_gui.c
+ cs_gui.h
+ memtri.F
+ ppclim.F
+ tridim.F
+
+
+* 23/07/2007 - Alexandre Douce <alexandre.douce at edf.fr>
+ Corrections in lagrangian module
+ modified routines:
+ caltri.F
+ dvvpst.F
+ impini.F
+ iniusi.F
+ lagent.F
+ lagfch.F
+ laghis.F
+ lagopt.F
+ lagran.h
+ memla1.F
+ memla2.F
+ uslabo.F
+ uslag1.F
+ uslag2.F
+ usray2.F
+
+
+
+===========================================================================
+
+* 13/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.m
+
+
+* 13/07/2007 - Carole Vit <carole.vit at edf.fr>
+ �ric Qu�merais <eric.quemerais at edf.fr>
+ Nicole Picard <nicole-n.picard at edf.fr>
+ Alexandre Douce <alexandre.douce at edf.fr>
+ Adaptation to new version of GUI, implementation
+ of fvm_selector potentialities
+ added routines:
+ cs_interpr_util.F
+ cs_selector.c
+ cs_selector.h
+ modified data file:
+ dp_FCP
+ modified routines
+ caltri.F
+ cfener.F
+ cou1do.F
+ covofi.F
+ cpini1.F
+ cplecd.F
+ cs_gui.c
+ cs_gui.h
+ cs_gui_util.c
+ cs_gui_util.h
+ cs_mesh.c
+ cs_mesh.h
+ cs_main.c
+ iniusi.F
+ inivar.F
+ lagent.F
+ ppclim.F
+ raycli.F
+ strini.F
+ tridim.F
+ usalcl.F
+ uscfcl.F
+ usclim.F
+ uscpcl.F
+ uscplc.F
+ usd3pc.F
+ usebuc.F
+ uselcl.F
+ usetcl.F
+ uskpdc.F
+ uslag2.F
+ uslwcc.F
+ usproj.F
+ uspt1d.F
+ usray2.F
+ usray3.F
+ usray5.F
+ usstru.F
+ ustsma.F
+ ustssc.F
+ usvort.F
+
+===========================================================================
+
+* 12/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.l
+
+* 09/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Partial compliance of rough wall with GUI
+ modified routines:
+ caltri.F
+ cs_gui.c
+ cs_gui.h
+
+* 09/07/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Yvan Fournier <yvan.fournier at edf.fr>
+ Creation of parallel and periodic halos by the kernel,
+ use of fvm-0.8.0 + internationalisation of C routines
+ added routines:
+ cs_halo.c
+ cs_halo.h
+ cs_mesh_coherency.c
+ cs_mesh_coherency.h
+ cs_mesh_warping.c
+ cs_mesh_warping.h
+ cs_pp_io.c
+ cs_pp_io.h
+ haltyp.F
+ majgeo.F
+ modified scripts:
+ macros*.mk
+ modified routines:
+ calgeo.F
+ caltri.F
+ cs_ale.c
+ cs_ale.h
+ cs_benchmark.c
+ cs_comm.c
+ cs_comm.h
+ cs_couplage.c
+ cs_couplage.h
+ cs_gui.c
+ cs_gui_matisse.c
+ cs_gui_radiative_transfer.c
+ cs_gui_util.c
+ cs_lagr_perio.c
+ cs_lagr_perio.h
+ cs_lagrang.c
+ cs_lagrang.h
+ cs_main.c
+ cs_matrix.c
+ cs_mesh_quality.c
+ cs_mesh_quality.h
+ cs_opts.c
+ cs_opts.h
+ cs_perio.c
+ cs_perio.h
+ cs_post.c
+ cs_post.h
+ cs_renumber.c
+ cs_renumber.h
+ cs_sles.c
+ cs_suite.c
+ cs_syr_coupling.c
+ cs_ventil.F
+ cs_ventil.h
+ grdcel.F
+ impini.F
+ iniini.F
+ initi1.F
+ lagcel.F
+ lagnwc.F
+ modified and renamed routines:
+ cs_maillage.c cs_mesh.c
+ cs_maillage.h cs_mesh.h
+ cs_maillage_connect.c cs_mesh_connect.c
+ cs_maillage_connect.h cs_mesh_connect.h
+ cs_maillage_grd.c cs_mesh_quantities.c
+ cs_maillage_grd.h cs_mesh_quantities.h
+ cs_maillage_select.c cs_mesh_select.c
+ cs_maillage_select.h cs_mesh_select.h
+ cs_maillage_solcom.c cs_mesh_solcom.c
+ cs_maillage_solcom.h cs_mesh_solcom.h
+ cs_messages_ecs.c cs_ecs_messages.c
+ cs_messages_ecs.h cs_ecs_messages.h
+ cs_parallel.c cs_parall.c
+ cs_parallel.h cs_parall.h
+ cs_voiset.c cs_ext_neighborhood.c
+ cs_voiset.h cs_ext_neighborhood.h
+ removed routines:
+ cs_msg.c
+ cs_msg.h
+ filtre.F
+ limgrd.F
+
+===========================================================================
+
+* 06/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.k
+
+
+* 04/07/2007 - Bertrand Carissimo <bertrand.carissimo at edf.fr>
+ Implementation of rough wall boundary conditions
+ added routines:
+ clptrg.F
+ modified routine:
+ cfxtcl.F
+ clptur.F
+ clsyvt.F
+ condli.F
+ cou1di.F
+ coupbi.F
+ cpltcl.F
+ cpptcl.F
+ d3ptcl.F
+ distpr.F
+ distyp.F
+ ebutcl.F
+ fuptcl.F
+ lageqp.F
+ lwctcl.F
+ paramx.h
+ ppclim.F
+ ppprcl.F
+ ppray4.F
+ pptycl.F
+ precli.F
+ raycli.F
+ raypun.F
+ rijech.F
+ tridim.F
+ typecl.F
+ usalcl.F
+ usclim.F
+ uscpcl.F
+ uscplc.F
+ usd3pc.F
+ usebuc.F
+ uselcl.F
+ usetcl.F
+ usfucl.F
+ uslwcc.F
+ usray2.F
+ usray4.F
+ usray5.F
+ usruet.F
+ vericl.F
+ vor2cl.F
+
+===========================================================================
+
+* 03/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.j
+
+* 02/07/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Implementation of fuel combustion, coal humidity and
+ reorganisation of pulverised coal combustion.
+ added data files:
+ dp_FUE
+ added routines:
+ cpcym2.F
+ fucym1.F
+ fuflux.F
+ fuincl.h
+ fuini1.F
+ fuiniv.F
+ fulecd.F
+ fupdfr.F
+ fuphy1.F
+ fuphy2.F
+ fuphyv.F
+ fuprop.F
+ fuptcl.F
+ futeh1.F
+ futeh2.F
+ futhp1.F
+ futhp2.F
+ futssc.F
+ futsvc.F
+ futsvi.F
+ fuvarp.F
+ fuveri.F
+ memfu1.F
+ usfucl.F
+ usfui1.F
+ usfuiv.F
+ modified data files:
+ dp_FCP
+ JAnAF
+ modified routines:
+ copdfr.F -> renamed pppdfr.F
+ covofi.F
+ cpflux.F
+ cpincl.h
+ cpini1.F
+ cpiniv.F
+ cplecd.F
+ cpphy1.F
+ cpphy2.F
+ cpphyv.F
+ cpprop.F
+ cpptcl.F
+ cprays.F
+ cpteh2.F
+ cpthp2.F
+ cptssc.F
+ cpvarp.F
+ cpveri.F
+ cs_gui.c
+ cs_gui.h
+ d3phst.F
+ d3pint.F
+ d3pphy.F
+ d3pver.F
+ ebuver.F
+ ecrava.F
+ impini.F
+ iniusi.F
+ lagcar.F
+ lagent.F
+ lages1.F
+ lages2.F
+ laggra.F
+ lagich.F
+ lagitf.F
+ laglec.F
+ lagopt.F
+ lagout.F
+ lecamx.F
+ lwcver.F
+ ppcabs.F
+ ppclim.F
+ ppcsca.F
+ ppincl.h
+ ppinii.F
+ ppiniv.F
+ pplecd.F
+ ppphyv.F
+ ppprcl.F
+ ppprop.F
+ ppray4.F
+ ppthch.h
+ pptssc.F
+ pptycl.F
+ ppvarp.F
+ raydom.F
+ rayopt.F
+ scalai.F
+ uscpi1.F
+ uscpiv.F
+ usppmo.F
+ modified scripts:
+ lance
+ lance_install
+ Makefile
+
+
+
+* 02/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Suppression of useless vide.h files
+
+* 02/07/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Update of macros_*.mk for Linux, Linux_IA64 and Linux_CCRT, definition of
+ C-Blas as default, suppression of some unused arguments in gradient
+ calculation to allow earlier call.
+ modified scripts:
+ macros_Linux.mk
+ macros_Linux_CCRT.mk
+ macros_Linux_IA64.mk
+ modified routines:
+ cs_blas.c
+ cs_blas.h
+ cs_voiset.c
+ cs_voiset.h
+ gradmc.F
+ gradrc.F
+ grdcel.F
+ tremai.c
+
+===========================================================================
+
+* 02/07/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.i
+
+* 29/06/2007 - Carole Vit <carole.vit at edf.fr>
+ Sofiane Benhamadouche <sofiane.benhaamdouche at edf.fr>
+ Marc Sakiz <marc.sakiz at edf.fr>
+ Implementation of steady-state algorithm
+ modified routines:
+ alelap.F
+ bilsc2.F
+ codits.F
+ covofi.F
+ cs_opts.c
+ distpr.F
+ distyp.F
+ dttvar.F
+ impini.F
+ iniini.F
+ iniusi.F
+ matrdt.F
+ modini.F
+ navsto.F
+ optcal.h
+ preduv.F
+ reseps.F
+ resolp.F
+ resrij.F
+ resssg.F
+ resv2f.F
+ tridim.F
+ turbke.F
+ turbkw.F
+ verini.F
+ cfmsvl.F
+ lageqp.F
+ raypun.F
+ raysol.F
+
+
+===========================================================================
+
+* 25/06/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.h
+
+* 25/06/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction of erroneous verification test on
+ time averages in varpos.F
+
+* 22/06/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Compatibility of ALE method with 2nd order time
+ scheme and velocity/pressure sub-iterations (but
+ it does not imply that the mesh movement and
+ inner structure coupling is 2nd order ...)
+ + full explicit treatment of the mass flux if
+ ISTMPF.EQ.0 in case of velocity/pressure sub-iterations
+ modified routines:
+ schtmp.F
+ strdep.F
+ strpre.F
+ tridim.F
+ verini.F
+
+* 11/06/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Update of macros*.mk, minor modifications to benchmarking
+ mode and BLAS porting, extension solver reorganisation
+ modified scripts:
+ macros_*.mk
+ modified routines:
+ cs_benchmark.c
+ cs_matrix.c
+ cs_sles.c
+ invers.F
+
+* 11/06/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Merge of base_1 and base_2 directories as base in src
+ and corresponding modification of Makefile
+
+* 06/06/2007 - David Monfort <david.monfort at edf.fr>
+ Correction of Makefile to avoid problems with *.F* files
+ that are not *.F nor *.F95
+
+* 27/04/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction of missing ITUSER/RTUSER/IDEVEL/RDEVEL arguments
+ in certain routines
+ modified routines:
+ caltri.F
+ cregeo.F
+ lagcar.F
+ lageli.F
+ lagent.F
+ lages1.F
+ lages2.F
+ lagesp.F
+ lagfch.F
+ lagipn.F
+ lagnew.F
+ lagnpr.F
+ lagnwc.F
+ lagrus.F
+ lagsta.F
+ lagune.F
+ usdpst.F
+ usladp.F
+ uslafe.F
+ uslain.F
+ uslatc.F
+ uslatp.F
+
+* 25/04/2007 - David Monfort <david.monfort at edf.fr>
+ Suppression of useless test on IISUIT before the second
+ call to ECRAVA in caltri.F
+
+* 25/04/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction of specific cases where "inline" commands
+ are banned
+ modified routines:
+ cs_base.h
+ cs_lagrang.c
+ cs_matrix.c
+ cs_sles.c
+
+===========================================================================
+
+* 18/04/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.g
+
+
+* 18/04/2007 - J�r�me Bonelle <jerome.bonelle at edf.fr>
+ Porting on Linux_Argent architecture (CCRT Bull Novascale
+ Itanium cluster), including BLAS compatibility
+ added script:
+ marcos_Linux_Argent.mk
+ modified scripts:
+ cs_profile
+ lance
+ rang_mpi.sh
+ modified routines:
+ cs_blas.c
+ cs_blas.h
+
+
+* 10/04/2007 - Yvan Fournier <yvan.fournier at edf.fr>
+ Reorganisation of the linear solvers, "matrix" structure,
+ adaptation to BLAS libraires, management of memory alignment
+ for BlueGene optimisation, benchmark mode for testing linear
+ solvers, change in the position of the renumbering of cells
+ for vector machines optimisation, adaptation to fvm-0.7.0,
+ optimisation of parallel/periodic synchronisations to avoid
+ redudancies, automatic supression of X or 1 in the post-processing
+ name of a vector variable with components labelled (...X,...Y,...Z)
+ or (...1, ...2, ...3)
+ modified scripts:
+ cs_profile
+ lance_install
+ macros_Blue_Gene_L.mk
+ macros_HP-UX.mk
+ macros_IRIX64.mk
+ macros_Linux.mk
+ macros_Linux_CCRT.mk
+ macros_Linux_Ch.mk
+ macros_OSF1.mk
+ macros_SunOS.mk
+ Makefile
+ rang_mpi.sh
+ added routines:
+ cs_benchmark.c
+ cs_benchmark.h
+ cs_blas.c
+ cs_blas.h
+ cs_matrix.c
+ cs_matrix.h
+ cs_prototypes.h
+ cs_renumber.c
+ cs_renumber.h
+ cs_sles.c
+ cs_sles.h
+ deleted routines:
+ memnvc.F
+ modified routines:
+ cfcdts.F
+ cgstab.F
+ codits.F
+ cregeo.F
+ cycmgr.F
+ cs_base.h
+ cs_couplage.c
+ cs_maillage_connect.c
+ cs_maillage_solcom.c
+ cs_main.c
+ cs_opts.c
+ cs_opts.h
+ cs_parallel.c
+ cs_perio.c
+ cs_perio.h
+ cs_post_util.F
+ dvvpst.F
+ gradco.F
+ iniini.F
+ invers.F
+ jacobi.F
+ numvec.F
+ prcpol.F
+ promav.F
+ proxav.F
+
+* 05/04/2007 - Fabien Huvelin <fabien.huvelin at edf.fr>
+ Chronological records of structure displacement, velocity
+ acceleration and forces + improved force and displacement
+ prediction for explicit internal structure coupling
+ modified routines:
+ albase.h
+ alstru.h
+ caltri.F
+ entsor.h
+ iniini.F
+ modini.F
+ paramx.h
+ strdep.F
+ strini.F
+ strpre.F
+ tridim.F
+ usalin.F
+ usstru.F
+ verini.F
+ added routine:
+ strhis.F
+
+* 26/03/2007 - Fabien Huvelin <fabien.huvelin at edf.fr>
+ Displacement based Newmark scheme for internal
+ structure coupling instead of acceleration based scheme
+ modified routines:
+ alstru.h
+ iniini.F
+ modini.F
+ newmrk.F
+ strdep.F
+ strini.F
+ verini.F
+
+* 26/03/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Implementation of an orthotropic mesh viscosity
+ for the ALE method
+ modified routines:
+ albase.h
+ alelap.F
+ condli.F
+ ecrava.F
+ iniini.F
+ iniva0.F
+ lecamx.F
+ modini.F
+ numvar.h
+ phyvar.F
+ usalin.F
+ usvima.F
+ varpos.F
+
+
+* 01/03/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Change in comments, initialisation and tests
+ on ITRSVR
+ modified routines:
+ entsor.h
+ iniini.F
+ modini.F
+ verini.F
+
+===========================================================================
+
+* 01/03/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.f
+
+* 01/03/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Bug correction in initialisation of IPRTOT pointer
+ in varpos.F
+ modified routines:
+ iniini.F
+ varpos.F
+
+* 14/02/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Modification of lance to limit its size (problem
+ with LSF with too large scripts)
+ added script:
+ lance.help
+ modified script:
+ cree_sat
+ lance
+
+* 13/02/2007 - Yvan Fournier - <yvan.fournier at edf.fr>
+ Modification of Makefile for BLAS on Blue Gene architecture
+
+* 13/02/2007 - Jerome Bonelle <jerome.bonelle at edf.fr>
+ Correction for Syrthes coupling with 2D solid meshes
+ modified routines:
+ cs_mesh_quality.c
+ cs_post.c
+ cs_syr_coupling.c
+
+* 10/02/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Change in the architecture of the libraries
+ (creation of the "arch" directory)
+ modified scripts:
+ lance_install
+ Makefile
+
+* 10/02/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Change of an ambiguous notation in the routines
+ for the specific physics source terms.
+ modified routines:
+ cpltss.F
+ cpltsv.F
+ cptssc.F
+ cptsvc.F
+ cptsvi.F
+ ebutss.F
+ eltssc.F
+ lwctss.F
+ pptssc.F
+
+* 09/02/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ - Alexandre Douce <alexandre.douce at edf.fr>
+ Modifications in the Lagrangian module: chemical forces
+ (van der Waals et al.), particule slugging and advanced
+ particle/wall interaction, compliance with periodic
+ boundaries, advanced statistics control (averages and
+ root mean squares) and post-processing.
+ added routines:
+ cs_lagr_perio.c
+ cs_lagr_perio.h
+ lagaff.F
+ lagfch.F
+ laghis.F
+ lagnpr.F
+ usladp.F
+ uslafe.F
+ uslapr.F
+ deleted routine:
+ lagraf.F
+ modified routines:
+ caltri.F
+ cs_post.c
+ cs_post.h
+ dvvpst.F
+ enslag.F
+ entsor.h
+ impini.F
+ iniini.F
+ lagcar.F
+ lagcel.F
+ lagdeb.F
+ lageli.F
+ lagent.F
+ lages1.F
+ lages2.F
+ lagesp.F
+ lagini.F
+ laglec.F
+ laglis.F
+ lagnwc.F
+ lagopt.F
+ lagout.F
+ lagpar.h
+ lagran.h
+ lagrus.F
+ lagsta.F
+ lagune.F
+ memla1.F
+ memla2.F
+ memtri.F
+ ouestu.F
+ uslabo.F
+ uslaen.F
+ uslag1.F
+ uslag2.F
+ uslaru.F
+ uslast.F
+ verini.F
+
+* 08/02/2007 - Mehdi Ouraou <mehdi.ouraou at edf.fr>
+ Changes in boundary conditions for compressible module
+ (Code_Saturne bug tracker ticket #57)
+ modified routines:
+ cfxtcl.F
+ uscfth.F
+
+* 31/01/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Deletion of the STUB ifdef and associated compilation
+ options
+ modified routines:
+ cfdttv.F
+ cfener.F
+ cfini1.F
+ cfiniv.F
+ cfmsvl.F
+ cfphyv.F
+ cfprop.F
+ cfqdmv.F
+ cfvarp.F
+ cfxtcl.F
+ coini1.F
+ colecd.F
+ coprop.F
+ cothht.F
+ covarp.F
+ cpflux.F
+ cpini1.F
+ cpiniv.F
+ cplecd.F
+ cplin1.F
+ cplini.F
+ cplphy.F
+ cplpro.F
+ cpltcl.F
+ cpltss.F
+ cplvar.F
+ cpphyv.F
+ cpprop.F
+ cpptcl.F
+ cprays.F
+ cpthp1.F
+ cpthp2.F
+ cptssc.F
+ cpvarp.F
+ d3pini.F
+ d3pphy.F
+ d3ptcl.F
+ ebuini.F
+ ebuphy.F
+ ebutcl.F
+ ebutss.F
+ elflux.F
+ elini1.F
+ eliniv.F
+ ellecd.F
+ elphyv.F
+ elprop.F
+ eltssc.F
+ elvarp.F
+ lagini.F
+ laglec.F
+ laglis.F
+ lagopt.F
+ lagout.F
+ lagune.F
+ lwcini.F
+ lwcphy.F
+ lwctcl.F
+ lwctss.F
+ memcfm.F
+ memla1.F
+ memla2.F
+ memmat.F
+ memra1.F
+ memra2.F
+ memra3.F
+ mtimpi.F
+ mtini1.F
+ mtkpdc.F
+ mtphyv.F
+ mtproj.F
+ mttsns.F
+ mttssc.F
+ mttycl.F
+ raycli.F
+ raydak.F
+ raydom.F
+ rayens.F
+ raylec.F
+ rayopt.F
+ rayout.F
+ raysca.F
+ uscfcl.F
+ uscfth.F
+ uscpcl.F
+ uscplc.F
+ usd3pc.F
+ usebuc.F
+ uselcl.F
+ uselen.F
+ uselrc.F
+ usetcl.F
+ uslaen.F
+ uslwcc.F
+ modified scripts:
+ lance
+ lance_install
+ macros_*.mk
+ Makefile
+
+* 29/01/2007 - Carole Vit <carole.vit at edf.fr>
+ Post-processing of the Courant and Fourier numbers
+ (listing, chronological records, 3D post-processing)
+
+* 09/01/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction of bug in argument passing of codits in raysol.F and raypun.F
+ (bug introduced in version 1.3.c with the change from IDIRCL to NDIRCL).
+
+* 08/01/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Writing of Cmu constant in listing with k-omega SST model (used
+ for epsilon/omega conversions)
+
+* 08/01/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Minor changes in comments of many files
+
+* 04/01/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Modification of the test on ICDPAR and parallelism/periodicity
+ in verini.F
+
+* 03/01/2007 - Marc Sakiz <marc.sakiz at edf.fr>
+ Suppression of useless ISTAT and NDIRCP in matrdt
+ modified routines:
+ distyp.F
+ dttvar.F
+ matrdt.F
+
+* 21/12/2006 - Yvan Fournier <yvan.fournier at edf.fr>
+ Link to BFT 1.0.3
+ modified scripts:
+ macros_*.mk
+
+* 21/12/2006 - Alexandre Douce <alexandre.douce at edf.fr>
+ Modifications for pulverised coal and radiative transfer
+ in GUI
+ added routine:
+ usray5.F
+ modified routines:
+ cpini1.F
+ cpveri.F
+ cs_gui.c
+ cs_gui.h
+ cs_gui_radiative_transfer.c
+ cs_gui_radiative_transfer.h
+ cs_gui_util.c
+ cs_gui_util.h
+ inivar.F
+ ppcabs.F
+ ppclim.F
+ raycli.F
+ raydom.F
+ rayopt.F
+ tridim.F
+ uscpi1.F
+ usray2.F
+ usray3.F
+
+* 21/12/2006 - Flavien Billard <flavien.billard at gmail.com>
+ Modification in source term for the fb equation
+ in resv2f.F
+
+* 21/12/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction of memory management in strini.F
+
+* 21/12/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Deletion of file v2nutp.F (unused routine, remnance
+ of tests on v2f model with IKEKOU=1)
+
+===========================================================================
+
+* 18/12/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Tagging of version 1.3.e
+
+* 18/12/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Adding of GPL licence tag on all files.
+
+* 15/12/2006 - Yvan Fournier <yvan.fournier at edf.fr>
+ Minor modification in user manual
+
+* 15/12/2006 - Yvan Fournier <yvan.fournier at edf.fr>
+ Finer CPU time analysis for post-processing in
+ cs_post.c
+
+* 15/12/2006 - Yvan Fournier <yvan.fournier at edf.fr>
+ Suppression of unused arguments in limgrd.F
+ modified routines:
+ cs_voiset.c
+ cs_voiset.h
+ grdcel.F
+ limgrd.F
+
+* 15/12/2006 - Yvan Fournier <yvan.fournier at edf.fr>
+ Corrected "assert" instructions + correction of
+ cs_syr_coupling.c (adaptation to fvm-0.6.2)
+ modified routines:
+ cs_maillage_connect.c
+ cs_mesh_quality.c
+ cs_syr_coupling.c
+
+
+* 15/12/2006 - Yvan Fournier <yvan.fournier at edf.fr>
+ Preparation for BLAS libraries and other optimisations
+ for Blue Gene
+ modified routines:
+ cs_base.c
+ cs_parallel.c
+ gradco.F
+ prodsc.F
+ promav.F
+ tremai.c
+ modified script:
+ Makefile
+
+* 07/12/2006 - Carole Vit <carole.vit at edf.fr>
+ Correction of debugging message format in iniusi.F
+
+* 07/12/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Deletion of unnecessary calls to include memoir.h
+ modified routines:
+ iniini.F
+ iniusi.F
+ modini.F
+ usini1.F
+ verini.F
+
+* 06/12/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Bug correction in dttvar.F (at the first time step, NDIRCL is initialised
+ to 0 which results in a slight shift of the diagonal of the matrix
+ used to calculate the time step when IDTVAR>0)
+
+* 01/12/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Bug correction in the ALE method (calculation of the flux with
+ imposed displacement of inner vertices + boundary conditions of
+ moving symmetry faces
+ modified routines:
+ navsto.F
+ tridim.F
+ typecl.F
+
+* 30/11/2006 - David Monfort <david.monfort at edf.fr>
+ Bug correction in the arguments of codits in distyp.F
+
+* 30/11/2006 - David Monfort <david.monfort at edf.fr>
+ Minor corrections of the examples in usvpst.F and comments
+ in usstru.F
+
+* 29/11/2006 - Frederic Archambeau <frederic.archambeau at edf.fr>
+ Correction of missing definition of IPCROM and IPBROM
+ in the last IPHAS loop of navsto.F
+ (Code_Saturne bug tracker ticket #59)
+
+
+* ../11/2006 - David Monfort <david.monfort at edf.fr>
+ Correction of verifmail due to new Envelope options
+ (Code_Saturne bug tracker ticket #53)
+
+* ../11/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Change of NSPHMX to 1 in paramx.h (since IPHAS is forced to 1)
+
+* ../11/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction of the display and the test on IPSTFO
+ modified routines:
+ impini.F
+ verini.F
+
+* ../11/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction in modini.F to have default post-processing of the mesh
+ viscosity with ALE
+
+* ../11/2006 - Jerome Bonelle <jerome.bonelle at edf.fr>
+ Correction of a bug in cs_base.c (dimension of cs_glob_base_chaine)
+
+* ../11/2006 - Marc Sakiz <marc.sakiz at edf.fr>
+ Correction of a bug in dttvar.F in case IPTLRO=1 (introduced un 1.3.d)
+ modified routines:
+ dttvar.F
+ memdtv.F
+ tridim.F
+
+* ../11/2006 - Yvan Fournier <yvan.fournier at edf.fr>
+ Correction of a bug in cs_suite.c (introduced in version 1.3.d)
+
+* ../11/2006 - David Monfort <david.monfort at edf.fr>
+ Correction of a "real.EQ.0.D0" test in visdyn.F and in ussmag.F
+ (Code_Saturne bug tracker ticket #56)
+
+* ../11/2006 - David Monfort <david.monfort at edf.fr>
+ Modification of gracehst to write the temporary file in /tmp
+ (Code_Saturne bug tracker ticket #55)
+
+* ../11/2006 - Marc Sakiz <marc.sakiz at edf.fr
+ Correction in navsto.F (RETURN added for IPRCO=0)
+
+* ../11/2006 - Emmanuel Lemoine <emmanuel.lemoine at incka.fr>
+ Corrections in strdep.F (PARSOM forgotten in the evaluation of FORSTR)
+ + no need to multiply by SURFBN in FORSTR
+
+* 21/11/2006 - Marc Sakiz < marc.sakiz at edf.fr>
+ Import of version ncs-1.3.d
+ For the history of earlier modifications, refer to the Synchronisation
+ file of version 1.3.d.
+
+===========================================================================
+===========================================================================
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..d3c5b40
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,237 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..4a1d2a1
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,149 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+if HAVE_GUI
+GUI = gui
+endif
+
+SUBDIRS = src libsyrcs po doc $(GUI)
+
+MAINTAINERCLEANFILES = \
+$(top_srcdir)/Makefile.in \
+$(top_srcdir)/aclocal.m4 \
+$(top_srcdir)/configure \
+$(top_srcdir)/cs_config-h.in \
+$(ac_aux_dir)/compile \
+$(ac_aux_dir)/config.guess \
+$(ac_aux_dir)/config.sub \
+$(ac_aux_dir)/depcomp \
+$(ac_aux_dir)/install-sh \
+$(ac_aux_dir)/ltmain.sh \
+$(ac_aux_dir)/missing \
+$(ac_aux_dir)/py-compile
+
+EXTRA_DIST = \
+COMPATIBILITY \
+QUALITY_ASSURANCE \
+sbin/backup \
+sbin/bootstrap \
+sbin/clean \
+sbin/rmb \
+$(ac_aux_dir)/cs_auto_flags.sh \
+$(ac_aux_dir)/cs_bft.m4 \
+$(ac_aux_dir)/cs_blas.m4 \
+$(ac_aux_dir)/cs_fvm.m4 \
+$(ac_aux_dir)/cs_libxml2.m4 \
+$(ac_aux_dir)/cs_mpi.m4 \
+$(ac_aux_dir)/cs_tools.m4
+
+# One adds two whole sub-directories and get rid of the .svn
+# directories with a dist-hook. The reason for this trick is that
+# the number of extra files or patches can grow and change a lot.
+EXTRA_DIST += examples extras patches
+
+nodist_include_HEADERS = cs_config.h
+
+DISTCLEANFILES = cs_config.h
+
+ACLOCAL_AMFLAGS = -I config
+
+# Install binary scripts
+
+nodist_bin_SCRIPTS = \
+bin/cs
+
+# Install Python library
+
+dist_pkgpython_PYTHON = \
+bin/cs_check_consistency.py \
+bin/cs_check_mesh.py \
+bin/cs_compile.py \
+bin/cs_config.py \
+bin/cs_create.py \
+bin/cs_info.py \
+bin/cs_plot_probes.py
+
+# Install user scripts
+
+nodist_pkgdata_DATA = \
+bin/runcase \
+bin/runcase_coupling \
+bin/SaturneGUI
+
+dist_pkgdata_DATA = \
+bin/runcase.help
+
+dist_pkgdata_SCRIPTS = \
+bin/runcase_mpi_env \
+bin/runcase_mpi_rank \
+bin/runcase_syrthes
+
+# Install thermochemistry and Matisse data files
+
+nobase_dist_pkgdata_DATA = \
+data/mati/emm.dat \
+data/mati/emm.geom \
+data/mati/vault.dat \
+data/mati/vault.geom \
+data/thch/dp_C3P \
+data/thch/dp_C3PSJ \
+data/thch/dp_C4P \
+data/thch/dp_ELE \
+data/thch/dp_FCP \
+data/thch/dp_FUE \
+data/thch/dp_transfo \
+data/thch/JANAF
+
+# Install man pages
+
+dist_man_MANS = \
+doc/manpages/cs_check_consistency.1 \
+doc/manpages/cs_check_mesh.1 \
+doc/manpages/cs_compile.1 \
+doc/manpages/cs_create.1 \
+doc/manpages/cs_info.1 \
+doc/manpages/cs_plot_probes.1 \
+doc/manpages/cs_solver.1
+
+# Finish user files installation
+# - tag with the package version number
+# - remove the test preventing from using a source file
+# Done with two sed passes (do not work otherwise)
+
+install-data-hook:
+ cd $(DESTDIR)$(pkgdatadir)/users && \
+ user_files=`ls */*.f90 2>/dev/null`; \
+ stubvers="^\!VERS\n"; \
+ version1="\! Code_Saturne version $(VERSION)\n"; \
+ version2="\! --------------------------"; \
+ comment1="^\! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START"; \
+ comment2="^\! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END"; \
+ for file in $${user_files}; do \
+ $(SED) -e "N;s/$${stubvers}/$${version1}$${version2}/" < "$${file}" | \
+ $(SED) -e "/$${comment1}/,/$${comment2}/d" > "$${file}.tmp" && \
+ mv "$${file}.tmp" "$${file}"; \
+ done
+
+dist-hook:
+ -rm -rf `find $(distdir)/examples -name .svn`
+ -rm -rf `find $(distdir)/extras -name .svn`
+ -rm -rf `find $(distdir)/patches -name .svn`
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..5c69ca6
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,1118 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \
+ $(dist_pkgdata_DATA) $(dist_pkgdata_SCRIPTS) \
+ $(dist_pkgpython_PYTHON) $(nobase_dist_pkgdata_DATA) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/cs_config.h.in $(top_srcdir)/bin/SaturneGUI.in \
+ $(top_srcdir)/bin/cs.in $(top_srcdir)/bin/cs_config.py.in \
+ $(top_srcdir)/bin/runcase.in \
+ $(top_srcdir)/bin/runcase_coupling.in $(top_srcdir)/configure \
+ $(top_srcdir)/doc/style/csvers.tex.in ABOUT-NLS AUTHORS \
+ COPYING ChangeLog INSTALL NEWS TODO config/config.guess \
+ config/config.rpath config/config.sub config/depcomp \
+ config/install-sh config/ltmain.sh config/missing \
+ config/py-compile
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = cs_config.h
+CONFIG_CLEAN_FILES = doc/style/csvers.tex bin/cs bin/cs_config.py \
+ bin/runcase bin/runcase_coupling bin/SaturneGUI
+am__installdirs = "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(pkgpythondir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" \
+ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)"
+dist_pkgdataSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+nodist_binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(dist_pkgdata_SCRIPTS) $(nodist_bin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+dist_pkgpythonPYTHON_INSTALL = $(INSTALL_DATA)
+py_compile = $(top_srcdir)/config/py-compile
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(dist_man_MANS)
+dist_pkgdataDATA_INSTALL = $(INSTALL_DATA)
+nobase_dist_pkgdataDATA_INSTALL = $(install_sh_DATA)
+nodist_pkgdataDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_pkgdata_DATA) $(nobase_dist_pkgdata_DATA) \
+ $(nodist_pkgdata_DATA)
+nodist_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(nodist_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = src libsyrcs po doc gui
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at HAVE_GUI_TRUE@GUI = gui
+SUBDIRS = src libsyrcs po doc $(GUI)
+MAINTAINERCLEANFILES = \
+$(top_srcdir)/Makefile.in \
+$(top_srcdir)/aclocal.m4 \
+$(top_srcdir)/configure \
+$(top_srcdir)/cs_config-h.in \
+$(ac_aux_dir)/compile \
+$(ac_aux_dir)/config.guess \
+$(ac_aux_dir)/config.sub \
+$(ac_aux_dir)/depcomp \
+$(ac_aux_dir)/install-sh \
+$(ac_aux_dir)/ltmain.sh \
+$(ac_aux_dir)/missing \
+$(ac_aux_dir)/py-compile
+
+
+# One adds two whole sub-directories and get rid of the .svn
+# directories with a dist-hook. The reason for this trick is that
+# the number of extra files or patches can grow and change a lot.
+EXTRA_DIST = COMPATIBILITY QUALITY_ASSURANCE sbin/backup \
+ sbin/bootstrap sbin/clean sbin/rmb \
+ $(ac_aux_dir)/cs_auto_flags.sh $(ac_aux_dir)/cs_bft.m4 \
+ $(ac_aux_dir)/cs_blas.m4 $(ac_aux_dir)/cs_fvm.m4 \
+ $(ac_aux_dir)/cs_libxml2.m4 $(ac_aux_dir)/cs_mpi.m4 \
+ $(ac_aux_dir)/cs_tools.m4 examples extras patches
+nodist_include_HEADERS = cs_config.h
+DISTCLEANFILES = cs_config.h
+ACLOCAL_AMFLAGS = -I config
+
+# Install binary scripts
+nodist_bin_SCRIPTS = \
+bin/cs
+
+
+# Install Python library
+dist_pkgpython_PYTHON = \
+bin/cs_check_consistency.py \
+bin/cs_check_mesh.py \
+bin/cs_compile.py \
+bin/cs_config.py \
+bin/cs_create.py \
+bin/cs_info.py \
+bin/cs_plot_probes.py
+
+
+# Install user scripts
+nodist_pkgdata_DATA = \
+bin/runcase \
+bin/runcase_coupling \
+bin/SaturneGUI
+
+dist_pkgdata_DATA = \
+bin/runcase.help
+
+dist_pkgdata_SCRIPTS = \
+bin/runcase_mpi_env \
+bin/runcase_mpi_rank \
+bin/runcase_syrthes
+
+
+# Install thermochemistry and Matisse data files
+nobase_dist_pkgdata_DATA = \
+data/mati/emm.dat \
+data/mati/emm.geom \
+data/mati/vault.dat \
+data/mati/vault.geom \
+data/thch/dp_C3P \
+data/thch/dp_C3PSJ \
+data/thch/dp_C4P \
+data/thch/dp_ELE \
+data/thch/dp_FCP \
+data/thch/dp_FUE \
+data/thch/dp_transfo \
+data/thch/JANAF
+
+
+# Install man pages
+dist_man_MANS = \
+doc/manpages/cs_check_consistency.1 \
+doc/manpages/cs_check_mesh.1 \
+doc/manpages/cs_compile.1 \
+doc/manpages/cs_create.1 \
+doc/manpages/cs_info.1 \
+doc/manpages/cs_plot_probes.1 \
+doc/manpages/cs_solver.1
+
+all: cs_config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+ cd $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+cs_config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/cs_config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status cs_config.h
+$(srcdir)/cs_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f cs_config.h stamp-h1
+doc/style/csvers.tex: $(top_builddir)/config.status $(top_srcdir)/doc/style/csvers.tex.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+bin/cs: $(top_builddir)/config.status $(top_srcdir)/bin/cs.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+bin/cs_config.py: $(top_builddir)/config.status $(top_srcdir)/bin/cs_config.py.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+bin/runcase: $(top_builddir)/config.status $(top_srcdir)/bin/runcase.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+bin/runcase_coupling: $(top_builddir)/config.status $(top_srcdir)/bin/runcase_coupling.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+bin/SaturneGUI: $(top_builddir)/config.status $(top_srcdir)/bin/SaturneGUI.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+install-dist_pkgdataSCRIPTS: $(dist_pkgdata_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
+ @list='$(dist_pkgdata_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(dist_pkgdataSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(dist_pkgdataSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-dist_pkgdataSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_pkgdata_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(nodist_bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(nodist_binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(nodist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-nodist_binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+install-dist_pkgpythonPYTHON: $(dist_pkgpython_PYTHON)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgpythondir)" || $(MKDIR_P) "$(DESTDIR)$(pkgpythondir)"
+ @list='$(dist_pkgpython_PYTHON)'; dlist=''; for p in $$list; do\
+ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
+ if test -f $$b$$p; then \
+ f=$(am__strip_dir) \
+ dlist="$$dlist $$f"; \
+ echo " $(dist_pkgpythonPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(pkgpythondir)/$$f'"; \
+ $(dist_pkgpythonPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(pkgpythondir)/$$f"; \
+ else :; fi; \
+ done; \
+ if test -n "$$dlist"; then \
+ if test -z "$(DESTDIR)"; then \
+ PYTHON=$(PYTHON) $(py_compile) --basedir "$(pkgpythondir)" $$dlist; \
+ else \
+ PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pkgpythondir)" $$dlist; \
+ fi; \
+ else :; fi
+
+uninstall-dist_pkgpythonPYTHON:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_pkgpython_PYTHON)'; dlist=''; for p in $$list; do\
+ f=$(am__strip_dir) \
+ rm -f "$(DESTDIR)$(pkgpythondir)/$$f"; \
+ rm -f "$(DESTDIR)$(pkgpythondir)/$${f}c"; \
+ rm -f "$(DESTDIR)$(pkgpythondir)/$${f}o"; \
+ done
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
+ done
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
+ done
+install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
+ @list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+
+uninstall-dist_pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+install-nobase_dist_pkgdataDATA: $(nobase_dist_pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_dist_pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ $(am__vpath_adj) \
+ echo " $(nobase_dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(nobase_dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+
+uninstall-nobase_dist_pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_dist_pkgdata_DATA)'; for p in $$list; do \
+ $(am__vpath_adj) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+install-nodist_pkgdataDATA: $(nodist_pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
+ @list='$(nodist_pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(nodist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(nodist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+
+uninstall-nodist_pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_pkgdata_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+ @list='$(nodist_include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(nodist_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+ $(nodist_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+ done
+
+uninstall-nodist_includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_include_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(includedir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) cs_config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) cs_config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) cs_config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) cs_config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) $(HEADERS) cs_config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgpythondir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-dist_pkgdataDATA install-dist_pkgdataSCRIPTS \
+ install-dist_pkgpythonPYTHON install-man \
+ install-nobase_dist_pkgdataDATA install-nodist_includeHEADERS \
+ install-nodist_pkgdataDATA
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-recursive
+
+install-exec-am: install-nodist_binSCRIPTS
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man: install-man1
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-dist_pkgdataDATA uninstall-dist_pkgdataSCRIPTS \
+ uninstall-dist_pkgpythonPYTHON uninstall-man \
+ uninstall-nobase_dist_pkgdataDATA uninstall-nodist_binSCRIPTS \
+ uninstall-nodist_includeHEADERS uninstall-nodist_pkgdataDATA
+
+uninstall-man: uninstall-man1
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-data-am install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+ dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
+ distcheck distclean distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-hook install-dist_pkgdataDATA \
+ install-dist_pkgdataSCRIPTS install-dist_pkgpythonPYTHON \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-man1 install-nobase_dist_pkgdataDATA \
+ install-nodist_binSCRIPTS install-nodist_includeHEADERS \
+ install-nodist_pkgdataDATA install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-dist_pkgdataDATA \
+ uninstall-dist_pkgdataSCRIPTS uninstall-dist_pkgpythonPYTHON \
+ uninstall-man uninstall-man1 uninstall-nobase_dist_pkgdataDATA \
+ uninstall-nodist_binSCRIPTS uninstall-nodist_includeHEADERS \
+ uninstall-nodist_pkgdataDATA
+
+
+# Finish user files installation
+# - tag with the package version number
+# - remove the test preventing from using a source file
+# Done with two sed passes (do not work otherwise)
+
+install-data-hook:
+ cd $(DESTDIR)$(pkgdatadir)/users && \
+ user_files=`ls */*.f90 2>/dev/null`; \
+ stubvers="^\!VERS\n"; \
+ version1="\! Code_Saturne version $(VERSION)\n"; \
+ version2="\! --------------------------"; \
+ comment1="^\! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START"; \
+ comment2="^\! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END"; \
+ for file in $${user_files}; do \
+ $(SED) -e "N;s/$${stubvers}/$${version1}$${version2}/" < "$${file}" | \
+ $(SED) -e "/$${comment1}/,/$${comment2}/d" > "$${file}.tmp" && \
+ mv "$${file}.tmp" "$${file}"; \
+ done
+
+dist-hook:
+ -rm -rf `find $(distdir)/examples -name .svn`
+ -rm -rf `find $(distdir)/extras -name .svn`
+ -rm -rf `find $(distdir)/patches -name .svn`
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
diff --git a/QUALITY_ASSURANCE b/QUALITY_ASSURANCE
new file mode 100644
index 0000000..c769b65
--- /dev/null
+++ b/QUALITY_ASSURANCE
@@ -0,0 +1,4 @@
+QUALITY ASSURANCE
+=================
+This version of Code_Saturne is a development version that
+has not been validated under EDF quality assurance.
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..d73a2cb
--- /dev/null
+++ b/TODO
@@ -0,0 +1,477 @@
+=======================================================================
+=======================================================================
+POINTS A PRIORITE ELEVEE
+=======================================================================
+=======================================================================
+
+LONG TERME
+==========
+
+* Multigrille et algebre lineaire en general. Resolution sur gros maillage,
+ mailles allongees, ... + interaction avec parallelisme, periodicite.
+
+
+
+MOYEN ET COURT TERME
+====================
+
+SCRIPTS ET DOC
+-------------
+* Documentation
+ - doc noyau sur les nouveaux modeles de turbulence + ordre 2 en temps des TS
+ - doc noyau sur LWC
+ - doc utilisateur (et noyau ?) sur les nouvelles fonctionnalites electriques
+ (module electrotechnique)
+ - doc utilisateur de l'interface (quand stabilise)
+ - ajouter si les tomes 1 a 5 en pdf sous doc/NOYAU
+ - traduction en anglais de la doc
+ - enrichir et refondre le tutorial, recuperer le tutorial Manchester
+ - reecrire la doc Inimas (notations non coherentes avec le reste au niveau des CL)
+ - doc noyau, resolp, revoir la formulation du paragraphe sur la definition de l'operateur L,
+ avant l'equation 11.
+ - doc noyau sur clipke
+ - doc noyau calcul du pas de temps en compressible
+ - doc noyau lois de paroi (IDEUCH=2) + MAJ de RCPROD et RCFLUX
+ - doc noyau gradients et limitation des gradients
+ - doc noyau distance � la paroi + y+
+
+* Le "commente_exemple" de cree_sat peut etre tres long
+
+* Reorganiser la base des cas tests
+
+* Script blue gene integre
+
+* Adapter les scripts d'autovalidation pour prendre en compte les fichier
+ de sortie binaire EnSight (changement ASCII => binaire du mode verif)
+
+IHM
+---
+* Quand on ne visite pas la page des physiques particulieres, meme si on n'a
+ rien a y faire, le code plante et demande de remplir usipph.
+
+* Modifier les tests sur les couleurs pour ne pas etre oblige de definir toutes
+ les faces dans l'interface (si on les definit dans le noyau)
+
+* Pb des "d" quand on rentre des 1.D0 par megarde
+
+* Phys part, Matisse, suivi des evolutions du noyau (CL de sortie, ...)
+
+* Blinder le cas ou on change le nombre de variables dans usini1 (scalaire de plus
+ ou changement de modele de turb). A priori, il y a seulement a relire nscaus
+ dans CSVNUM
+
+BASE
+----
+* Adapter la gestion des familles de faces internes si celles-ci n'existaient pas
+ (notamment en cas de renumerotation ou de decoupages des faces gauches)
+
+* Modifier les commentaires des routines utilisant le selector, rajouter
+ MAXELT et LSTELT aux autres routines usts* et traiter proprement usdpst.F
+
+* Remettre SRROM et DIFLT0 a -GRAND dans cpini1.F quand l'IHM leur redonnera une
+ valeur par defaut
+
+* Ordre 2 en temps en v2f -> terme en f_barre a modifier (il est en RTP et pas
+ RTPA donc ne doit pas etre extrapole mais interpole)
+
+* Dans jacobi et gradco (et bicgstab ?) on compare le residu en racine
+ carree, alors que ce n'est pas n�cessaire. Gain en temps ?
+
+* Loi de paroi + pb du jet impactant
+
+* Recuperer et tester le PISO du stage I85 (complements de tests)
+
+* Calcul de la distance a la paroi :
+ - Pb de calcul de la paroi pour les suites de lecture en k-omega
+ (calcul apres phyvar)
+ -> faire un premier passage dans usclim avant phyvar pour calculer ITYPFB ?
+ - Renforcer la robustesse du reperage des faces de paroi (parfois test sur
+ ITYPFB=IPAROI, parfois test sur ICODCL=5)
+
+* Dans le cas 2 echelles, on calcule y+ a partir de uk. Or cette relation
+ n'est pas vraiment valable dans la sous-couche visqueuse. Si le modele est
+ bas-Reynolds (comme le k-omega), k va fortement decroitre en paroi et le y+
+ base sur uk sera trop petit. Comme on calcule ensuite u*=u_tau/y+, on obtient
+ des valeurs tres fortes et non physiques de u*.
+ Ce n'est pas un reel probleme car dans la sous-couche visqueuse, on
+ n'utilise pas la valeur de u* dans les CL (vitesse, turbulence, scalaire).
+ Mais l'affichage de u*=1.D5 dans le listing fait curieux !!! En modele HR,
+ comme k est mauvais est decroit moins vite en paroi, on n'a moins ce
+ probleme.
+ On peut modifier clptur de la maniere suivante :
+ si y+(uk) < YPLULI, alors on recalcule u*=SQRT(nu*u_tau/y) et y+=y.u*/nu
+ ... a verifier qu'alors y+(u*) est toujours < YPLULI ?
+ ... a replacer dans le contexte du travail sur YPLULI ?
+
+* Evaluer et renforcer la robustesse vis-a-vis des ss-prg utilisateurs
+ -> par ex uselrc peut etre appele sans avoir ete mis dans FORT.
+ -> cf. mail FA du 01/03/06
+
+* Rajouter dans ustsns un exemple de forcage de debit. Ne pas utiliser la
+ methode de la valid 1.1.0 mais plutot :
+ save tsnm1
+ if(ntcabs.gt.1) then
+ tsn = tsnm1*(Debit_voulu/max(Debit_calcule,1D-12))
+ tsnm1 = tsn
+ else
+ tsn = Rho*Vitesse_moyenne**2*Lambda_Moody/(2*Diam_Hydraulique)
+ tsnm1 = tsn
+ endif
+ do iel = 1, ncel
+ crvexp(iel) = volume(iel)*tsn
+ enddo
+
+* En cas d'utilisation de van Driest, le Fourier max et le pas de temps sont
+ calcules avant l'amortissement -> peut etre limitant
+
+* PARCOM et PERCOM de CLVOLC peut-etre redondants par rapport a
+ cs_maillage_grd_calc
+
+* Dans ECRHIS, les fichiers .hst sont reecrits entierement au moment du dump
+ du fichier hst.tmp. Il suffirait de ne rajouter que ce qui est nouveau ...
+
+* Unifier les boucles de sous-iterations ALE et U/P. La boucle U/P doit etre remontee
+ pour pouvoir impliciter les CL (notamment pour MIGAL). Attention a ce qui est remis
+ aux anciennes valeurs en fin de boucle. Pour l'instant, dans le cas U/P on met la
+ nouvelle pression dans RTPA, alors que dans le cas ALE on remet au contraire tous les
+ RTPA dans RTP et on reprend l'ancien flux de masse.
+
+* Changer distyp et distpr pour utiliser l'algorithme stationnaire ?
+
+COGZ
+----
+* Suites partielles (sans suivax) -> verifier la coherence avec
+ les dernieres quantites stockees, i.e. verifier qu'on ne les
+ utilise pas si on ne les a pas relues
+ -> a faire en meme temps qu'une eventuelle possibilite de demarrage a froid
+
+* Modifs Libby-Williams (facteur 2 dans lwctss.F et correction dissipation associee)
+
+
+LAGR
+----
+* ICONFO est dimensionne en dur � 100 dans 3 sous-programmes (lagcel, lagnex, lagnwc)
+ -> centraliser son dimensionnement et tester si le nb de sommets est > � 100.
+
+* Prevoir le cas ILAGR=2 pour INEEDY (i.e. forces de paroi)
+
+* Verif commentaires lagraf.F et lagout.F sur Ensight apres modifs AD
+
+ELEC
+----
+* uselrc n'est pas standard. Il est activ� par IELCOR=1 et pas seulement par le fait
+ de le placer dans FORT -> eliminer le test sur IELCOR dans scalai.F. Il faudrait
+ cependant conserver un IELCOR dans uselrc pour activer le recalage par defaut prevu
+ dans uselrc sans avoir a placer le ss-prg dans FORT. Attention, uselrc est commun
+ a Joule et Arcs �lectriques.
+
+CFBL
+----
+* Stabiliser !
+
+RAYT
+----
+* Transferer vers fvm le raybrd.F qui ecrit sa part ensight tout seul tranquillement
+ sans se soucier du parall�lisme ....
+
+ALE
+---
+* Branchement de couplage avec Aster. Changement du numero de maillage fvm (10 par defaut)
+ pour l'envoi vers Calcium
+
+* Non compatible avec la periodicite de rotation (a cause de inimas
+ qui necessiterait de connaitre le gradient de w) -> au pire le changer
+ en ne reconstruisant pas a ces points la
+
+* Compatibilite avec le compressible (equation sur rho, IFLMB0 pour inimas
+ dans cfmsfl et cfmsgs ?)
+
+* Dans le cas de sous-iterations ALE implicite, on doit aussi stocker les CL
+ de P et U car dans condli on fait des appels a GRDCEL pour calculer les CL
+ reelles. Sinon, on ne revient pas exactement a l'etat precedent ... mais
+ est-ce grave (seule la reconstruction est modifiee) ?
+ De meme, au premier pas de temps d'une suite de calcul, a cause de l'iteration
+ d'initialisation ALE, les CL utilisees pour le GRDCEL avec ou sans ALE ne sont
+ pas les memes ... mais la encore, est-ce grave ?
+
+* Evaluer la necessite de combiner les boucles P/U avec implicitation des CL et les
+ boucles ALE .... -> faut-il reellement revenir a l'etat initial dans les boucles ALE ?
+
+
+INTEGRATION DVLPTS EXTERNES
+---------------------------
+* Integration a�ros
+
+* Integration ALE (IFS)
+
+* Integration de modifs issues de l'affaire Saturne dans Salome
+
+* Modifs couplage homard
+
+* Integrations couplages CS/CS et autres dvlpts DESIDER
+
+=======================================================================
+=======================================================================
+POINTS A PRIORITE MODEREE OU FAIBLE
+=======================================================================
+=======================================================================
+
+SCRIPTS ET DOC
+-------------
+* Refonte des Makefiles
+
+
+* Dans la doc, on pourrait creer un "apropos", par exemple "apropos gradient" qui
+ renverrait a un exemple de calcul de gradient dans un sous-programme utilisateur
+ -> on pourrait rajouter une ligne "c-apropos" suivi des mots clefs, sur lesquels on
+ ferait un "grep".
+
+BASE
+----
+* Ordre 2 en temps : est-il interessant de passer dans bilsc2 avec f(n+1/2)
+ plutot que de passer deux fois avec f(n) et f(n+1) ?
+
+* Dans codits, on ne prend pas en compte les TS positifs pour ne pas affaiblir
+ la diagonale. Mais on pourrait tout de meme les integrer dans la
+ reconstruction du second membre (dedoublement de ROVSDT, un pour la diago,
+ un pour le second membre)
+
+* Tester la normalisation dans resolp
+
+* Le decalage de la diagonale est-il necessaire ?
+
+* Rhie & Chow sur la pression :
+ - identifier un cas ou R&C a une influence reelle
+ - tester la methode de stabilisation par clusters (LETEM)
+
+* Tester Rhie & Chow sur convection (voir si traite par lot LES)
+
+* CL sur grad transpose est icoff, pourquoi pas icoef ?
+
+* On reserve de la luminance en charbon, meme si on ne fait pas de
+ rayonnement (en lagr, on ne teste pas si on rayonne) (?? a verifier)
+
+* Pour la diffusion, on reconstruit avec (gradI+gradJ)/2.(II'-JJ') au lieu de
+ gardI.II'-gradJ.JJ' -> repute plus stable, mais est-ce le cas ? Erreur sans doute + gde (meme
+ si l'ordre est identique)
+
+* Dans distyp, on initialise y+ par une valeur permettant d'obtenir une valeur
+ maximale dans les zones n'ayant eventuellement pas bien converge. Au premier
+ pas de temps, on met le max de u*/nu, ensuite on utilise la valeur de u*/nu
+ du pas de temps precedent. Lors d'une suite de calcul, on utilise aussi le
+ max de u*/nu car y+ n'est pas sauvegarde -> difference entre un calcul
+ 10iter+10iter et un calcul 20iter ... cela ne vaut cependant pas la peine
+ de stocker y+ (limitation de la taille du fichier suite). On peut
+ eventuellement tjs initialiser par le max de u*/nu.-> evaluer la perte de
+ temps CPU.
+
+* CL de paroi en temperature meme si le calcul est en enthalpie. Plus generalement,
+ est-il necessaire de definir systematique une variable temperature dans un calcul en
+ enthalpie (deja le cas pour certaines phys part).
+
+* Utilisation de gradrc/gradmc suivant les termes.
+
+* Plantage si VISLS0=0 car division par HINT dans clptur
+
+* Entrer lambda et rho cp separement ? Coherence avec l'interface ?
+
+* Voir si on peut modifier vissec pour entrer directement W7, W8, W9 et
+ eviter une double recopie.
+
+* Dans le test de pente, le terme DPDXA est reconstruit avec un gradient, donc il fait
+ intervenir des points plus lointains que C, U et D. On peut donc imaginer une variation
+ de la fonction entre U, C et D qui implique un passage en upwind mais que le test soit
+ compense par les valeurs en UU et DD et que du coup le passage en upwind ne se fasse pas.
+ -> A tester
+
+* Interpolation de la viscosite aux faces : en cas de discontinuite forte, l'interpol
+ arith est fausse mais l'interpol harmoniq est exacte. Dans le cas des PDC, on a dans
+ resolp une interpol de ce style avec forte discontinuite. -> a tester ?
+
+* Reperage des capteurs d'historiques qui sont hors domaine. On pourra se baser sur les
+ developpements de FVM et d'interpolation de maillage. On pourra ainsi definir une part
+ Ensight nodale et la visualiser. On peut reflechir a cette methode pour extraire des
+ points autrement que par FINDPT (qui est lourd en temps calcul si le nb de pts devient
+ grand ... mais seulement dans ce cas !!).
+
+* IRCFLU : separer la convection de la diffusion.
+
+* Estimateurs d'erreur :
+ - refaire une analyse du temps CPU
+ - verifier la doc
+ - si necessaire ne les calculer que si necessaire (impression listing, sortie
+ post, fin de calcul)
+ - estimateurs plus simples ? Utilisation des calculs deja faits dans le pas de
+ temps pour donner une valeur plus proche ?
+ - coherence avec iphydr, ordre en temps, ...
+
+* Prevoir un arret base sur le temps physique, pas juste sur NTCABS
+ (def d'un TTMABS ; en debut de pdt on regarde si TTCBAS>TTMABS et si oui on fixe
+ NTMABS=NTCABS, le reste est alors inchange. Si TTMABS<0 on ne teste pas)
+ -> attention a certaines periodicite comme la periodicite de sortie des fichiers
+ suite.
+
+* Et si on decoupait et reorganisait bilsc2.F ?
+
+* Pb de IPUCOU et Rij avec la periodicite de rotation a cause de la viscos orthotrope
+ (a priori OK donc en SSG qui a une viscos scalaire)
+
+* On pourrait peut etre economiser une vingtaine de percom/parcom en
+ modifiant un peu visdyn (moins elegant, a ne faire
+ que si il y a un gain effectif)
+
+* Dans vissec, le calcul du terme en div(u) a partir du flux de masse
+ (en n+theta) et de rho extrapole risque de n'etre pas coherent
+ et fournit en outre une valeur qui n'est pas en n (comme
+ le demanderait l'extrapolation des termes sources places
+ dans propce)
+
+* Tester le calcul d'un Hessien par approximation diffuse. Utilite pour un schema QUICK,
+ un schema de diffusion d'ordre 2 meme si on n'est pas en 1/2-1/2, ...
+
+* Tester le couplage vitesse/pression par lagrangien augmente.
+
+* TS de masse et variance
+
+* Interet et maturite du modele "strain stress lag"
+
+* Dans le cas d'un voisinage etendu traite separement (en parallele), les communications
+ necessitent un PARCVE en plus des PARCOM et PERCOM. Ces appels sont integres dans les
+ routines CFLITR, CGRDMC et CLMGRD. Or pour le cas du filtre LES, la communication du volume
+ des cellules pourrait n'etre faite qu'une fois dans CLVOLC, a condition que le voisinage
+ etendu y soit bien defini.
+
+* Supprimer les d�pendances croises entre cs_mesh.*, cs_mesh_connect.*, cs_halo.*,
+ et cs_ext_neighborhood.*, ou au moins faire apparaitre la hierarchie des structures
+ (peut necessiter la creation d'un fichier cs_mesh_priv.h, et le maintien d'un lien
+ entre les structures de maillage publiques et privees, ou le passage de certains
+ membres des structures par argument ou sous-structures de travail pour eviter qu'un
+ niveau ait besoin de connaitre les structures du niveau superieur).
+
+COGZ
+----
+* Analyser la pertinence et la complexite des suites en combustion d'un calcul sans
+ combustion.
+
+LAGR
+----
+* Definir un cas test analytique : chute de particules dans un ecoulement ascendant
+ uniforme, sur maillage regulier et/ou fortement deforme -> on doit pouvoir calculer
+ la vitesse limite theorique.
+
+* Sous-programme de gestion des forces exterieurs (type gravite)
+ et bien sur adapter lagcou et TSFEXT en consequence
+
+* Le traitement de la vitesse du fluide vu lors d'un rebond est une inversion de la
+ composante normale et une conservation de la compos tangentielle
+ -> cela correspond a une CL de flux nul et ne respecte pas le cisaillement
+ -> on peut peut-etre mieux faire en faisant intervenir la CL de vitesse a la paroi
+ (un truc genre VIT = CL + AA*(VIT_ini - CL) )
+
+* Post-processing des trajectoires via FVM ?
+
+* Amelioration du suivi des particules (cellules concaves, pertes de particules)
+
+* Prise en compte des polygones quelconques dans lagnew
+
+* Prise en compte de la granulo avec un profil log-normal
+
+* Prise en compte des collisions
+
+RAYT
+----
+* Analyser la pertinence et la complexite des suites en rayonnement d'un calcul
+ sans rayonnement (notamment faire intervenir ISUIRD dans le test autour de raypar
+ dans raycli).
+
+
+
+=======================================================================
+=======================================================================
+REMARQUES POUR MEMOIRE
+=======================================================================
+=======================================================================
+
+* csprnt.F : le format "$" n'est pas reconnu sur un compilateur sous ...
+ Windows !!!!!!!
+
+* Attention au recalage pression au deuxieme pas de temps.
+
+* Attention grdcel n'echange pas la variable ; peut etre problematique
+ pour les utilisateurs ; evite de dupliquer les echanges pour les
+ variables de calcul (on ne stocke pas les gradients)
+
+* Augmenter le nbre d'arg dans usthht (si utile)
+
+* Dans les TS de masse, les tableaux SMACEL sont dimensionnes a NCETSM*NVAR. Or
+ NVAR concerne toutes les variables de toutes les phases ... surdimensionne.
+ Mais a priori insoluble autrement !
+
+* On utilise pour le moment une approche "explicite" pour la
+ periodicite de rotation de QDMX, QDMY, QDMZ --> Il serait cependant
+ interessant de tester l'approche avec des neumann quand il y a une
+ periodicite de rotation sur un vecteur ou un tenseur (ca reviendrait
+ a une sorte de symetrie)
+
+* Ce qui sort d'invers n'a pas ete tourne (a priori ok mais a savoir)
+
+* Pour le clipping variance d'une variable seulement utile en combustion gaz il faudrait que
+ l'on soit sur que la variable soit resolue avant sa variance (detail : sinon, y a
+ la variable au t prec et c'est faux)
+
+* Pas de prise en compte du schema d'ordre 2 en temps pour les
+ physiques particulieres actuelles :
+ - pas de besoin avant plusieurs annees apres interview
+ - en particulier pas de LES en combustion avec saturne
+ - noter egalement que la masse volumique est determinee
+ de maniere complexe et que le traitment simple qu'on lui
+ applique entrainera sans doute des difficultes
+ On garde les sources sous le coude pour eviter de rendre ces
+ sous-programmes plus complexes qu'ils ne le sont deja
+
+* Attention au thetav dans le bilsc2 pour les estim
+
+
+
+=======================================================================
+=======================================================================
+BONNES PRATIQUES (POUR MEMOIRE)
+=======================================================================
+=======================================================================
+
+* Une routine par fichier (sauf eventuellement si elles
+ sont toutes "privees", sauf la premiere),
+ 6 lettre par nom de routine exactement
+ 6 lettres au plus et 2 lettres au moins par nom de variable
+ (bannir les variables I, N, J ou K )
+
+* Ne pas mettre de tabs dans les fortrans ou C (penser au script rmb.sh).
+
+* Eviter les lignes de fortran commentees dans les us* :
+ sinon jamais compile donc forcement faux
+
+* Continuation character : & et pas de + (on utilise un caractere
+ qui ne veut rien dire en fortran afin de ne pas le confondre)
+
+* Donner aux entiers des noms commencant par I, J, K, L, M, N
+
+* Eviter les goto a la mode case
+ Mettre des do enddo et pas de do continue
+ Virer les do while si possible (mettre un goto si necessaire)
+
+* Eviter l'acces a des pointeurs de pointeurs de pointeur dans les boucles
+ mettre un entier avant, c'est plus lisible et ca va plus vite.
+
+* Encadrer les write et print sauvages par ifdef debug
+ (ex de cpcym1 : le test doit il etre conserve ?)
+ Attention : verifier que ce qui est dans les tests
+ ne sert pas ailleurs
+
+
+* Mettre des reels en D et pas en E
+ Pas de E50 (ca n'existe pas sur IRIX : out of range)
+
+* Eviter a = 3.d0*b
+ preferer si possible double precision trois
+ trois = 3.d0
+ a = trois * b
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..3b11ae5
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,9092 @@
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# intlmacosx.m4 serial 1 (gettext-0.17)
+dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Checks for special options needed on MacOS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
+ dnl Check for API introduced in MacOS X 10.2.
+ AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+ gt_cv_func_CFPreferencesCopyAppValue,
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
+ [CFPreferencesCopyAppValue(NULL, NULL)],
+ [gt_cv_func_CFPreferencesCopyAppValue=yes],
+ [gt_cv_func_CFPreferencesCopyAppValue=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+ AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
+ [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+ fi
+ dnl Check for API introduced in MacOS X 10.3.
+ AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
+ [gt_cv_func_CFLocaleCopyCurrent=yes],
+ [gt_cv_func_CFLocaleCopyCurrent=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
+ [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+ fi
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+ AC_SUBST([INTL_MACOSX_LIBS])
+])
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+ ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+ lt_cl_success=:
+ test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+ exec AS_MESSAGE_LOG_FD>/dev/null
+ $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+ exec AS_MESSAGE_LOG_FD>>config.log
+ $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_XSI_SHELLFNS
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+[$]*
+_LT_EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+ [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC*)
+ # IBM XL 8.0 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(int foo(void) {},
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ )
+ LDFLAGS="$save_LDFLAGS"
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+ [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 will use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ xl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=echo
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${F77-"f77"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${FC-"f95"}
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]+=\$[2]"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+ ;;
+ esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
+
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
+
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# ---------------------------------------------------------------------------
+# Adds support for distributing Python modules and packages. To
+# install modules, copy them to $(pythondir), using the python_PYTHON
+# automake variable. To install a package with the same name as the
+# automake package, install to $(pkgpythondir), or use the
+# pkgpython_PYTHON automake variable.
+#
+# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
+# locations to install python extension modules (shared libraries).
+# Another macro is required to find the appropriate flags to compile
+# extension modules.
+#
+# If your package is configured with a different prefix to python,
+# users will have to add the install directory to the PYTHONPATH
+# environment variable, or create a .pth file (see the python
+# documentation for details).
+#
+# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
+# cause an error if the version of python installed on the system
+# doesn't meet the requirement. MINIMUM-VERSION should consist of
+# numbers and dots only.
+AC_DEFUN([AM_PATH_PYTHON],
+ [
+ dnl Find a Python interpreter. Python versions prior to 1.5 are not
+ dnl supported because the default installation locations changed from
+ dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
+ dnl in 1.5.
+ m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
+ [python python2 python2.5 python2.4 python2.3 python2.2 dnl
+python2.1 python2.0 python1.6 python1.5])
+
+ m4_if([$1],[],[
+ dnl No version check is needed.
+ # Find any Python interpreter.
+ if test -z "$PYTHON"; then
+ AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
+ fi
+ am_display_PYTHON=python
+ ], [
+ dnl A version check is needed.
+ if test -n "$PYTHON"; then
+ # If the user set $PYTHON, use it and don't search something else.
+ AC_MSG_CHECKING([whether $PYTHON version >= $1])
+ AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_ERROR(too old)])
+ am_display_PYTHON=$PYTHON
+ else
+ # Otherwise, try each interpreter until we find one that satisfies
+ # VERSION.
+ AC_CACHE_CHECK([for a Python interpreter with version >= $1],
+ [am_cv_pathless_PYTHON],[
+ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
+ test "$am_cv_pathless_PYTHON" = none && break
+ AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
+ done])
+ # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
+ if test "$am_cv_pathless_PYTHON" = none; then
+ PYTHON=:
+ else
+ AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
+ fi
+ am_display_PYTHON=$am_cv_pathless_PYTHON
+ fi
+ ])
+
+ if test "$PYTHON" = :; then
+ dnl Run any user-specified action, or abort.
+ m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
+ else
+
+ dnl Query Python for its version number. Getting [:3] seems to be
+ dnl the best way to do this; it's what "site.py" does in the standard
+ dnl library.
+
+ AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
+ [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
+ AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
+
+ dnl Use the values of $prefix and $exec_prefix for the corresponding
+ dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
+ dnl distinct variables so they can be overridden if need be. However,
+ dnl general consensus is that you shouldn't need this ability.
+
+ AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
+ AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+
+ dnl At times (like when building shared libraries) you may want
+ dnl to know which OS platform Python thinks this is.
+
+ AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
+ [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
+ AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
+
+
+ dnl Set up 4 directories:
+
+ dnl pythondir -- where to install python scripts. This is the
+ dnl site-packages directory, not the python standard library
+ dnl directory like in previous automake betas. This behavior
+ dnl is more consistent with lispdir.m4 for example.
+ dnl Query distutils for this directory. distutils does not exist in
+ dnl Python 1.5, so we fall back to the hardcoded directory if it
+ dnl doesn't work.
+ AC_CACHE_CHECK([for $am_display_PYTHON script directory],
+ [am_cv_python_pythondir],
+ [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
+ echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
+ AC_SUBST([pythondir], [$am_cv_python_pythondir])
+
+ dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
+ dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
+ dnl more consistent with the rest of automake.
+
+ AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
+
+ dnl pyexecdir -- directory for installing python extension modules
+ dnl (shared libraries)
+ dnl Query distutils for this directory. distutils does not exist in
+ dnl Python 1.5, so we fall back to the hardcoded directory if it
+ dnl doesn't work.
+ AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
+ [am_cv_python_pyexecdir],
+ [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
+ echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
+ AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
+
+ dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
+
+ AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
+
+ dnl Run any user-specified action.
+ $2
+ fi
+
+])
+
+
+# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# ---------------------------------------------------------------------------
+# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
+# Run ACTION-IF-FALSE otherwise.
+# This test uses sys.hexversion instead of the string equivalent (first
+# word of sys.version), in order to cope with versions such as 2.2c1.
+# hexversion has been introduced in Python 1.5.2; it's probably not
+# worth to support older versions (1.5.1 was released on October 31, 1998).
+AC_DEFUN([AM_PYTHON_CHECK_VERSION],
+ [prog="import sys, string
+# split strings by '.' and convert to numeric. Append some zeros
+# because we need at least 4 digits for the hex conversion.
+minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
+sys.exit(sys.hexversion < minverhex)"
+ AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([config/cs_bft.m4])
+m4_include([config/cs_blas.m4])
+m4_include([config/cs_config_info.m4])
+m4_include([config/cs_fvm.m4])
+m4_include([config/cs_libxml2.m4])
+m4_include([config/cs_mei.m4])
+m4_include([config/cs_mpi.m4])
+m4_include([config/cs_syrthes.m4])
+m4_include([config/gettext.m4])
+m4_include([config/iconv.m4])
+m4_include([config/lib-ld.m4])
+m4_include([config/lib-link.m4])
+m4_include([config/lib-prefix.m4])
+m4_include([config/nls.m4])
+m4_include([config/po.m4])
+m4_include([config/progtest.m4])
diff --git a/bin/SaturneGUI.in b/bin/SaturneGUI.in
new file mode 100644
index 0000000..1602de7
--- /dev/null
+++ b/bin/SaturneGUI.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+# @configure_input@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+
+prefix=@prefix@
+#
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+#
+${bindir}/cs gui $*
+
+exit
+
diff --git a/bin/cs.in b/bin/cs.in
new file mode 100644
index 0000000..f1d4da3
--- /dev/null
+++ b/bin/cs.in
@@ -0,0 +1,125 @@
+#!@cs_python@
+# @configure_input@
+#-------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Solver.
+#
+# Copyright (C) 2009 EDF
+#
+# The Code_Saturne Preprocessor 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.
+#
+# The Code_Saturne Preprocessor 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+import os
+import sys
+
+# Trick so that one doesn't have to set the PYTHONPATH variable
+prefix = "@prefix@"
+pythondir = os.path.join(prefix, "lib", "python at PYTHON_VERSION@", "site-packages")
+pkgpythondir = os.path.join(pythondir, "@PACKAGE@")
+sys.path.insert(0, pkgpythondir)
+
+# Same trick for the MEI library (supposed to be installed in site-packages/mei)
+meilibdir = "@mei_libdir@"
+pythondir = os.path.join(meilibdir, "python at PYTHON_VERSION@", "site-packages")
+meipythondir = os.path.join(pythondir, "mei")
+if os.path.isdir(meipythondir):
+ sys.path.insert(0, meipythondir)
+
+import cs_config
+
+#-------------------------------------------------------------------------------
+
+def usage(argv):
+ usage = \
+ """Usage: %(prog)s <topic>
+
+Topics:
+ help
+ check_consistency
+ check_mesh
+ config
+ create
+ gui
+ info
+ plot_probes
+
+Options:
+ -h, --help show this help message and exit"""
+
+ print usage % {'prog':sys.argv[0]}
+
+def check_consistency(argv):
+ import cs_check_consistency
+ cs_check_consistency.main(argv)
+
+def check_mesh(argv):
+ import cs_check_mesh
+ cs_check_mesh.main(argv)
+
+def compile(argv):
+ import cs_compile
+ cs_compile.main(argv)
+
+def config(argv):
+ import cs_config
+ cs_config.main(argv)
+
+def create(argv):
+ import cs_create
+ cs_create.main(argv)
+
+def gui(argv):
+ import cs_gui
+ cs_gui.main(argv)
+
+def info(argv):
+ import cs_info
+ cs_info.main(argv)
+
+def plot_probes(argv):
+ import cs_plot_probes
+ cs_plot_probes.main(argv)
+
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Main function.
+ """
+
+ commands = {'help':usage, '--help':usage, '-h':usage,
+ 'check_consistency':check_consistency,
+ 'check_mesh':check_mesh,
+ 'compile':compile,
+ 'config':config,
+ 'create':create,
+ 'gui':gui,
+ 'info':info,
+ 'plot_probes':plot_probes}
+
+ retcode = 1
+
+ if (len(argv) < 1) or (argv[0] not in commands):
+ usage(argv)
+ else:
+ command = argv[0]
+ sys.argv[0] = sys.argv[0] + ' ' + command
+ sys.argv.remove(command)
+ commands[command](argv[1:])
+
+ sys.exit(retcode)
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
diff --git a/bin/cs_check_consistency.py b/bin/cs_check_consistency.py
new file mode 100644
index 0000000..05eeed2
--- /dev/null
+++ b/bin/cs_check_consistency.py
@@ -0,0 +1,208 @@
+#-------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Solver.
+#
+# Copyright (C) 2009 EDF
+#
+# The Code_Saturne Preprocessor 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.
+#
+# The Code_Saturne Preprocessor 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import os, sys
+from optparse import OptionParser
+
+
+#-------------------------------------------------------------------------------
+# Process command line
+#-------------------------------------------------------------------------------
+
+def process_cmd_line(argv):
+ """
+ Processes the passed command line arguments.
+
+ Input Argument:
+ arg -- This can be either a list of arguments as in
+ sys.argv[1:] or a string that is similar to the one
+ passed on the command line. If it is a string the
+ string is split to create a list of arguments.
+ """
+
+ parser = OptionParser(usage="usage: %prog [options]")
+
+ parser.add_option("-p", "--param", dest="param", type="string",
+ metavar="<param>",
+ help="give the parameters file")
+
+ parser.add_option("-s", "--source", dest="src_dir", type="string",
+ metavar="<src_dir>",
+ help="choose source file directory")
+
+ parser.add_option("-n", "--nproc", dest="nproc", type="int",
+ metavar="<nproc>",
+ help="specify the number of processors")
+
+ parser.set_defaults(param="")
+ parser.set_defaults(src_dir=os.getcwd())
+ parser.set_defaults(nproc=1)
+
+ (options, args) = parser.parse_args(argv)
+
+ if len(args) > 0:
+ parser.print_help()
+ sys.exit(1)
+
+ param = options.param
+ if param != "":
+ param = os.path.expanduser(options.param)
+ param = os.path.expandvars(param)
+ param = os.path.abspath(param)
+ if not os.path.isfile(param):
+ print >> sys.stderr, "Error: cannot access parameter file %s" % param
+ sys.exit(1)
+
+ src_dir = os.path.expanduser(options.src_dir)
+ src_dir = os.path.expandvars(src_dir)
+ src_dir = os.path.abspath(src_dir)
+ if not os.path.isdir(src_dir):
+ print >> sys.stderr, "Error: %s is not a directory" % src_dir
+ sys.exit(1)
+
+ return options.nproc, param, src_dir
+
+
+#-------------------------------------------------------------------------------
+# Checking user files consistency
+#-------------------------------------------------------------------------------
+
+def check_consistency(param, src_dir, n_procs):
+ """
+ Return 0 if parameter file options and user subroutines are consistent,
+ or 1 if they are incompatible.
+ """
+
+ # List of the different available modules in Code_Saturne
+ modules = ['base', 'lagr', 'rayt', 'cplv', 'fuel', 'c3pt', 'cebu',
+ 'clwc', 'elec', 'cfbl', 'atmo', 'ctwr']
+
+ # Dictionnary of module's name
+ moduleName = {
+ 'base':'standard',
+ 'lagr':'lagrangian',
+ 'rayt':'radiative transfer',
+ 'cplv':'pulverized coal combustion',
+ 'fuel':'heavy-fuel oil combustion',
+ 'c3pt':'3-point chemistry combustion',
+ 'cebu':'EBU combustion',
+ 'clwc':'LWC combustion',
+ 'elec':'electric arcs',
+ 'cfbl':'compressible',
+ 'atmo':'atmospheric',
+ 'ctwr':'cooling towers'}
+
+ # Dictionnary for consistancy check (on boundary conditions definition)
+ moduleCheck = {
+ 'base':False, 'lagr':False, 'rayt':False,
+ 'cplv':True, 'fuel':True, 'c3pt':True, 'cebu':True, 'clwc':True,
+ 'elec':True, 'cfbl':True, 'atmo':True, 'ctwr':True}
+
+ # Dictionnary of the correspondance between a module and a specific user file
+ moduleFile = {
+ 'base':'usclim', 'lagr':'uslag2', 'rayt':'usray2', 'cplv':'uscpcl',
+ 'fuel':'usfucl', 'c3pt':'usd3pc', 'cebu':'usebuc', 'clwc':'uslwcc',
+ 'elec':'uselcl', 'cfbl':'uscfcl', 'atmo':'usatcl', 'ctwr':'usctcl'}
+
+ # Dictionnary to know if a module is used
+ moduleUse = {
+ 'base':True, 'lagr':False, 'rayt':False, 'cplv':False, 'fuel':False,
+ 'c3pt':False, 'cebu':False, 'clwc':False, 'elec':False, 'cfbl':False,
+ 'atmo':False, 'ctwr':False}
+
+
+ # Function returning a boolean according to the presence of the file given
+ # in argument
+ def isPresent(file):
+ filename = file + '.f90'
+ return os.path.isfile(os.path.join(src_dir, filename))
+
+
+ # Consistancy test, following the definition of the boundary conditions
+ errorMsg = """
+ --ERROR --
+ When %(f1)s is used, %(f2)s must not be
+ (%(mod)s module)
+ Boundary conditions are defined in %(f1)s.
+ """
+
+ if isPresent(moduleFile['base']):
+ for mod in modules:
+ if moduleCheck[mod] and isPresent(moduleFile[mod]):
+ print >> sys.stderr, errorMsg % {'f1':moduleFile[mod],
+ 'f2':moduleFile['base'],
+ 'mod':moduleName[mod]}
+ return 1
+
+
+ # Test on the module used (standard module is not considered here)
+ moduleMsg = """
+ Use the %(mod)s module
+ """
+
+ for mod in modules[1:]:
+ if isPresent(moduleFile[mod]):
+ print >> sys.stdout, moduleMsg % {'mod':moduleName[mod]}
+ moduleUse[mod] = True
+
+
+ # Check if current module is incompatible with parallel runs
+ errorMsg = """
+ The %(mod)s module is incompatible with
+ parallel runs as of the current version.
+ """
+
+ if n_procs != None:
+ if n_procs > 1:
+ for mod in ['ctwr','lagr']:
+ if moduleUse[mod]:
+ print >> sys.stderr, errorMsg % {'mod':moduleName[mod]}
+ return 1
+
+ return 0
+
+
+#-------------------------------------------------------------------------------
+# Main
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Main function.
+ """
+
+ n_procs, param, src_dir = process_cmd_line(argv)
+
+ ret_val = check_consistency(param, src_dir, n_procs)
+ sys.exit(ret_val)
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/bin/cs_check_mesh.py b/bin/cs_check_mesh.py
new file mode 100644
index 0000000..d4dac94
--- /dev/null
+++ b/bin/cs_check_mesh.py
@@ -0,0 +1,124 @@
+#-------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Solver.
+#
+# Copyright (C) 2009 EDF
+#
+# The Code_Saturne Preprocessor 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.
+#
+# The Code_Saturne Preprocessor 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+import optparse
+import os, re
+import sys, shutil
+import string
+import subprocess
+import tempfile
+
+import cs_config
+
+#-------------------------------------------------------------------------------
+
+def run_command(cmd):
+ """
+ Run a command.
+ """
+ p = subprocess.Popen(cmd,
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ output = p.communicate()
+ print output[0], output[1]
+
+ return p.returncode
+
+#-------------------------------------------------------------------------------
+
+def subst_name(s):
+
+ s_up = string.upper(s)
+
+ stdgeomfile = 'chr.geo'
+ stdcasefile = 'CHR.case'
+
+ geomfile = s + '.geo'
+ casefile = s_up + '.case'
+
+ fd = file(stdcasefile, 'r')
+ fdt = file(casefile, 'w')
+ kwd = re.compile('chr.geo')
+ for line in fd:
+ line = re.sub(kwd, s+'.geo', line)
+ fdt.write(line)
+ fd.close()
+ fdt.close()
+
+ os.remove(stdcasefile)
+ shutil.move(stdgeomfile, geomfile)
+
+
+#-------------------------------------------------------------------------------
+
+def run_check(opts):
+ """
+ Run Code_Saturne preprocessor and solver.
+ """
+ retval = 0
+
+ cur_dir = os.getcwd()
+
+ cmd = os.path.join(cs_config.dirs.ecs_bindir, 'cs_preprocess')
+ for o in opts:
+ cmd = cmd + " " + str(o)
+ cmd = cmd + " --ensight --case check_mesh"
+ retval = run_command(cmd)
+
+ os.chdir('check_mesh.ensight')
+ subst_name('preprocessor')
+ os.chdir(cur_dir)
+
+
+ retval = 0
+
+ cmd = os.path.join(cs_config.dirs.bindir, 'cs_solver')
+ cmd = cmd + " --quality --log 0"
+ retval = run_command(cmd)
+
+ dir_files = os.listdir('chr.ensight')
+ for f in dir_files:
+ shutil.move(os.path.join('chr.ensight',f), 'check_mesh.ensight')
+ os.rmdir('chr.ensight')
+
+ os.chdir('check_mesh.ensight')
+ subst_name('quality')
+ os.chdir(cur_dir)
+
+
+ os.remove('preprocessor_output')
+
+ return retval
+
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Main function.
+ """
+
+ retcode = run_check(argv)
+ sys.exit(retcode)
+
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
diff --git a/bin/cs_compile.py b/bin/cs_compile.py
new file mode 100644
index 0000000..b8c3dee
--- /dev/null
+++ b/bin/cs_compile.py
@@ -0,0 +1,310 @@
+#-------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Solver.
+#
+# Copyright (C) 2009 EDF
+#
+# The Code_Saturne Preprocessor 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.
+#
+# The Code_Saturne Preprocessor 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+import fnmatch
+import os
+import sys
+import subprocess
+import tempfile
+
+from optparse import OptionParser
+
+import cs_config
+
+#-------------------------------------------------------------------------------
+
+def process_cmd_line(argv):
+ """
+ Processes the passed command line arguments.
+
+ Input Argument:
+ arg -- This can be either a list of arguments as in
+ sys.argv[1:] or a string that is similar to the one
+ passed on the command line. If it is a string the
+ string is split to create a list of arguments.
+ """
+
+ parser = OptionParser(usage="usage: %prog [options]")
+
+ parser.add_option("-t", "--test", dest="test_mode",
+ action="store_true",
+ help="test only, discard compilation result")
+
+ parser.add_option("-f", "--force", dest="force_link",
+ action="store_true",
+ help="force link, even with no source files")
+
+ parser.add_option("-s", "--source", dest="src_dir", type="string",
+ metavar="<src_dir>",
+ help="choose source file directory")
+
+ parser.add_option("-d", "--dest", dest="dest_dir", type="string",
+ metavar="<dest_dir>",
+ help="choose executable file directory")
+
+ parser.add_option("--opt-libs", dest="opt_libs", type="string",
+ metavar="<libs>",
+ help="optional libraries")
+
+ parser.add_option("--syrthes", dest="link_syrthes",
+ action="store_true",
+ help="SYRTHES link")
+
+ parser.set_defaults(test_mode=False)
+ parser.set_defaults(force_link=False)
+ parser.set_defaults(src_dir=os.getcwd())
+ parser.set_defaults(dest_dir=os.getcwd())
+ parser.set_defaults(opt_libs="")
+ parser.set_defaults(link_syrthes=False)
+
+ (options, args) = parser.parse_args(argv)
+
+ if len(args) > 0:
+ parser.print_help()
+ sys.exit(1)
+
+ src_dir = os.path.expanduser(options.src_dir)
+ src_dir = os.path.expandvars(src_dir)
+ src_dir = os.path.abspath(src_dir)
+ if not os.path.isdir(src_dir):
+ print "Error: %s is not a directory" % src_dir
+ sys.exit(1)
+
+ dest_dir = os.path.expanduser(options.dest_dir)
+ dest_dir = os.path.expandvars(dest_dir)
+ dest_dir = os.path.abspath(dest_dir)
+ if not os.path.isdir(dest_dir):
+ print "Error: %s is not a directory" % dest_dir
+ sys.exit(1)
+
+ return options.test_mode, options.force_link, src_dir, dest_dir, options.opt_libs, options.link_syrthes
+
+#-------------------------------------------------------------------------------
+
+def so_dirs_path(flags):
+ """
+ Assemble path for shared libraries in nonstandard directories.
+ """
+ retval = ""
+ first = True
+
+ args = flags.split(" ")
+
+ for arg in args:
+ if arg[0:2] == '-L' and arg[0:6] != '-L/usr' and arg[0:6] != '-L/lib':
+ if first == True:
+ retval = " " + cs_config.build.rpath + ":" + arg[2:]
+ first = False
+ else:
+ retval = retval + ":" + arg[2:]
+
+ return retval
+
+#-------------------------------------------------------------------------------
+
+def run_command(cmd):
+ """
+ Run a command.
+ """
+ print cmd
+ p = subprocess.Popen(cmd,
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ output = p.communicate()
+ print output[0], output[1]
+
+ return p.returncode
+
+#-------------------------------------------------------------------------------
+
+def compile_and_link(srcdir, destdir, optlibs, force_link):
+ """
+ Compilation and link function.
+ """
+ retval = 0
+
+ exec_name = "cs_solver"
+ if destdir != None:
+ exec_name = os.path.join(destdir, exec_name)
+
+ # Change to temporary directory
+
+ call_dir = os.getcwd()
+ temp_dir = tempfile.mkdtemp(suffix=".cs_compile")
+ os.chdir(temp_dir)
+
+ # Find files to compile in source path
+
+ dir_files = os.listdir(srcdir)
+
+ c_files = fnmatch.filter(dir_files, '*.c')
+ h_files = fnmatch.filter(dir_files, '*.h')
+ f_files = fnmatch.filter(dir_files, '*.[fF]90')
+
+ for f in c_files:
+ cmd = cs_config.build.cc
+ if len(h_files) > 0:
+ cmd = cmd + " -I" + srcdir
+ cmd = cmd + " -I" + os.path.join(cs_config.dirs.prefix, "include")
+ cmd = cmd + " -DHAVE_CONFIG_H"
+ cmd = cmd + " " + cs_config.build.cppflags
+ cmd = cmd + " " + cs_config.build.cflags
+ cmd = cmd + " -c " + os.path.join(srcdir, f)
+ if run_command(cmd) != 0:
+ retval = 1
+
+ for f in f_files:
+ cmd = cs_config.build.fc
+ if len(h_files) > 0:
+ cmd = cmd + " -I" + srcdir
+ cmd = cmd + " -I" + os.path.join(cs_config.dirs.prefix, "include")
+ cmd = cmd + " " + cs_config.build.fcflags
+ cmd = cmd + " -c " + os.path.join(srcdir, f)
+ if run_command(cmd) != 0:
+ retval = 1
+
+ if retval == 0 and (force_link or (len(c_files) + len(f_files)) > 0):
+ cmd = cs_config.build.cc
+ cmd = cmd + " -o " + exec_name
+ if (len(c_files) + len(f_files)) > 0:
+ cmd = cmd + " *.o"
+ cmd = cmd + " -L" + os.path.join(cs_config.dirs.prefix, "lib")
+ cmd = cmd + " -lsaturne"
+ if len(optlibs) > 0:
+ cmd = cmd + " " + optlibs
+ cmd = cmd + " " + cs_config.build.ldflags + " " + cs_config.build.libs
+ if cs_config.build.rpath != "":
+ cmd = cmd + " " + so_dirs_path(cmd)
+ if run_command(cmd) != 0:
+ retval = 1
+
+ # Cleanup
+
+ for f in os.listdir(temp_dir):
+ os.remove(os.path.join(temp_dir, f))
+
+ # Return to original directory
+
+ os.chdir(call_dir)
+ os.rmdir(temp_dir)
+
+ return retval
+
+#-------------------------------------------------------------------------------
+
+def compile_and_link_syrthes(srcdir, destdir):
+ """
+ Compilation and link function.
+ """
+ retval = 0
+
+ exec_name = "syrthes"
+ if destdir != None:
+ exec_name = os.path.join(destdir, exec_name)
+
+ # Change to temporary directory
+
+ call_dir = os.getcwd()
+ temp_dir = tempfile.mkdtemp(suffix=".cs_compile_syrthes")
+ os.chdir(temp_dir)
+
+ # Find files to compile in source path
+
+ dir_files = os.listdir(srcdir)
+
+ c_files = fnmatch.filter(dir_files, '*.c')
+ h_files = fnmatch.filter(dir_files, '*.h')
+ f_files = fnmatch.filter(dir_files, '*.[fF]')
+
+ for f in c_files:
+ cmd = cs_config.build_syrthes.cc
+ if len(h_files) > 0:
+ cmd = cmd + " -I" + srcdir
+ cmd = cmd + " " + cs_config.build_syrthes.cppflags
+ cmd = cmd + " " + cs_config.build_syrthes.cflags
+ cmd = cmd + " -c " + os.path.join(srcdir, f)
+ if run_command(cmd) != 0:
+ retval = 1
+
+ for f in f_files:
+ cmd = cs_config.build_syrthes.fc
+ if len(h_files) > 0:
+ cmd = cmd + " -I" + srcdir
+ cmd = cmd + " " + cs_config.build_syrthes.cppflags
+ cmd = cmd + " " + cs_config.build_syrthes.fcflags
+ cmd = cmd + " -c " + os.path.join(srcdir, f)
+ if run_command(cmd) != 0:
+ retval = 1
+
+ if retval == 0:
+ # Link with Code_Saturne C compiler
+ cmd = cs_config.build.cc
+ cmd = cmd + " -o " + exec_name
+ if (len(f_files)) > 0:
+ cmd = cmd + " *.o"
+ cmd = cmd + " -L" + os.path.join(cs_config.dirs.prefix, "lib")
+ cmd = cmd + " -lsyrcs"
+ cmd = cmd + " " + cs_config.build_syrthes.ldflags
+ cmd = cmd + " " + cs_config.build_syrthes.libs
+ if cs_config.build.rpath != "":
+ cmd = cmd + " " + so_dirs_path(cmd)
+ if run_command(cmd) != 0:
+ retval = 1
+
+ # Cleanup
+
+ for f in os.listdir(temp_dir):
+ os.remove(os.path.join(temp_dir, f))
+
+ # Return to original directory
+
+ os.chdir(call_dir)
+ os.rmdir(temp_dir)
+
+#-------------------------------------------------------------------------------
+# Main
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Main function.
+ """
+
+ test_mode, force_link, src_dir, dest_dir, opt_libs, link_syrthes = process_cmd_line(argv)
+
+ if test_mode == True:
+ dest_dir = None
+
+ if link_syrthes == True:
+ retcode = compile_and_link_syrthes(src_dir, dest_dir)
+ else:
+ retcode = compile_and_link(src_dir, dest_dir, opt_libs, force_link)
+
+ sys.exit(retcode)
+
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/bin/cs_config.py.in b/bin/cs_config.py.in
new file mode 100644
index 0000000..5c7dd7c
--- /dev/null
+++ b/bin/cs_config.py.in
@@ -0,0 +1,168 @@
+#!@cs_python@
+# @configure_input@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel is distributed in the hope that it will be
+# 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+
+#-------------------------------------------------------------------------------
+
+ at cs_config_comments@
+
+#-------------------------------------------------------------------------------
+
+import os.path
+
+# Package Version
+#----------------
+
+class package:
+ name="@PACKAGE_NAME@"
+ version="@PACKAGE_VERSION@"
+
+# Installation directories
+#-------------------------
+
+class dirs:
+ prefix = "@prefix@"
+ exec_prefix = "@exec_prefix@"
+ if exec_prefix == "${prefix}":
+ exec_prefix = prefix
+ bindir = "@bindir@"
+ if bindir == "${exec_prefix}/bin":
+ bindir = os.path.join(exec_prefix, "bin")
+ includedir = "@includedir@"
+ if includedir == "${prefix}/include":
+ includedir = os.path.join(prefix, "include")
+ libdir = "@libdir@"
+ if libdir == "${exec_prefix}/lib":
+ libdir = os.path.join(exec_prefix, "lib")
+ datarootdir = "@datarootdir@"
+ if datarootdir == "${prefix}/share":
+ datarootdir = os.path.join(prefix, "share")
+ datadir = "@datadir@"
+ if datadir == "${datarootdir}":
+ datadir = datarootdir
+ pkgdatadir = os.path.join(datadir, "@PACKAGE@")
+ docdir = "@docdir@"
+ if docdir == "${datarootdir}/doc/${PACKAGE_TARNAME}":
+ docdir = os.path.join(datarootdir, "doc", "@PACKAGE_TARNAME@")
+ pdfdir = "@pdfdir@"
+ if pdfdir == "${docdir}":
+ pdfdir = docdir
+ ecs_prefix = "@ecs_prefix@"
+ ecs_exec_prefix = ecs_prefix
+ ecs_bindir = os.path.join(ecs_exec_prefix, "bin")
+ syrthes_prefix = "@syrthes_prefix@"
+
+# Optional MPI library info
+#--------------------------
+
+class mpi_lib:
+ type = "@MPI_TYPE@"
+ bindir = "@MPI_BIN@"
+
+# Build tools, option, and libraries
+#-----------------------------------
+
+class build:
+ cc="@CC@"
+ fc="@FC@"
+ cppflags="@CPPFLAGS@ @BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MEI_CPPFLAGS@ @MPI_CPPFLAGS@ @LIBXML2_CPPFLAGS@ @BLAS_CPPFLAGS@"
+ cflags="@CFLAGS@ @CFLAGS_DBG@ @CFLAGS_OPT@"
+ fcflags="@FCFLAGS@ @FCFLAGS_DBG@ @FCFLAGS_OPT@"
+ ldflags="@MEI_LDFLAGS@ @FVM_LDFLAGS@ @BFT_LDFLAGS@ @MPI_LDFLAGS@ @BLAS_LDFLAGS@ @LIBXML2_LDFLAGS@ @LDFLAGS@"
+ libs="@MEI_LIBS@ @FVM_LIBS@ @BFT_LIBS@ @MPI_LIBS@ @BLAS_LIBS@ @LIBXML2_LIBS@ @LIBS@ @FCLIBS@"
+ rpath="@LDRPATH@"
+
+class build_syrthes:
+ cc="@SYRTHES_CC@"
+ fc="@SYRTHES_FC@"
+ cppflags="@SYRTHES_CPPFLAGS@"
+ cflags="@SYRTHES_CFLAGS@"
+ fcflags="@SYRTHES_FCFLAGS@"
+ ldflags="@SYRTHES_LDFLAGS@"
+ libs="@SYRTHES_LIBS@ @SYRTHES_FCLIBS@"
+
+#-------------------------------------------------------------------------------
+
+def get_config():
+ """
+ Get the configuration information.
+ """
+ msg = """\
+Directories:
+ dirs.prefix = %(prefix)s
+ dirs.exec_prefix = %(exec_prefix)s
+ dirs.bindir = %(bin)s
+ dirs.includedir = %(include)s
+ dirs.libdir = %(lib)s
+ dirs.datarootdir = %(dataroot)s
+ dirs.datadir = %(data)s
+ dirs.pkgdatadir = %(pkgdata)s
+ dirs.docdir = %(doc)s
+ dirs.pdfdir = %(pdf)s
+
+Auxiliary information:
+ dirs.ecs_prefix = %(ecs)s
+ dirs.syrthes_prefix = %(syrthes)s
+
+MPI library information:
+ mpi_lib.type = %(mpi_type)s
+ mpi_lib.bindir = %(mpi_bindir)s
+
+Compilers and associated options:
+ cc = %(cc)s
+ fc = %(fc)s
+ cppflags = %(cppflags)s
+ cflags = %(cflags)s
+ fcflags = %(fcflags)s
+ ldflags = %(ldflags)s
+ libs = %(libs)s
+ rpath = %(rpath)s\
+"""
+
+ return msg \
+ % { 'prefix':dirs.prefix, 'exec_prefix':dirs.exec_prefix,
+ 'bin':dirs.bindir, 'include': dirs.includedir, 'lib':dirs.libdir,
+ 'dataroot':dirs.datarootdir, 'data':dirs.datadir,
+ 'pkgdata':dirs.pkgdatadir, 'doc':dirs.docdir, 'pdf':dirs.pdfdir,
+ 'ecs':dirs.ecs_prefix, 'syrthes':dirs.syrthes_prefix,
+ 'mpi_type':mpi_lib.type, 'mpi_bindir':mpi_lib.bindir,
+ 'cc':build.cc, 'fc':build.fc,
+ 'cppflags':build.cppflags, 'cflags':build.cflags,
+ 'fcflags':build.fcflags, 'ldflags':build.ldflags,
+ 'libs':build.libs, 'rpath':build.rpath }
+
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Main configuration info function.
+ """
+ print get_config()
+
+if __name__ == '__main__':
+ main(argv)
+
diff --git a/bin/cs_create.py b/bin/cs_create.py
new file mode 100644
index 0000000..26e52bc
--- /dev/null
+++ b/bin/cs_create.py
@@ -0,0 +1,385 @@
+#-------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Solver.
+#
+# Copyright (C) 2009 EDF
+#
+# The Code_Saturne Preprocessor 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.
+#
+# The Code_Saturne Preprocessor 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+
+"""
+This module describes the script used to create a study/case for Code_Saturne.
+
+This module defines the following functions:
+- usage
+- process_cmd_line
+- make_executable
+- comments
+and the following classes:
+- study
+- class
+"""
+
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, pwd, shutil, stat
+import types, string, re
+from optparse import OptionParser
+
+import cs_config
+
+
+#-------------------------------------------------------------------------------
+# Processes the passed command line arguments
+#-------------------------------------------------------------------------------
+
+
+def process_cmd_line(argv):
+ """
+ Processes the passed command line arguments.
+ """
+
+ parser = OptionParser(usage="usage: %prog [options]")
+
+ parser.add_option("-s", "--study", dest="study_name", type="string",
+ metavar="<study>",
+ help="create a new study")
+
+ parser.add_option("-c", "--case", dest="cases_name", type="string",
+ metavar="<case>", action="append",
+ help="create a new case")
+
+ parser.add_option("-n", "--nogui", dest="use_gui",
+ action="store_false",
+ help="don't use the GUI")
+
+ parser.add_option("--nsat", dest="n_sat", type="int",
+ metavar="<nsat>",
+ help="specify the number of Code_Saturne instances")
+
+ parser.add_option("--nsyr", dest="n_syr", type="int",
+ metavar="<nsyr>",
+ help="specify the number of SYRTHES instances")
+
+ parser.set_defaults(use_gui=True)
+ parser.set_defaults(study_name=os.path.basename(os.getcwd()))
+ parser.set_defaults(cases_name=[])
+ parser.set_defaults(n_sat=1)
+ parser.set_defaults(n_syr=0)
+
+ (options, args) = parser.parse_args(argv)
+
+ if options.cases_name == []:
+ if len(args) > 0:
+ options.cases_name = args
+ else:
+ options.cases_name = ["CASE1"]
+
+ return Study(options.study_name,
+ options.cases_name,
+ options.use_gui,
+ options.n_sat,
+ options.n_syr)
+
+
+#-------------------------------------------------------------------------------
+# Give executable mode (chmod +x) to a file
+#-------------------------------------------------------------------------------
+
+
+def make_executable(filename):
+ """
+ Give executable permission to a given file.
+ Equivalent to `chmod +x` shell function.
+ """
+
+ st = os.stat(filename)
+ mode = st[stat.ST_MODE]
+ os.chmod(filename, mode | stat.S_IEXEC)
+
+ return
+
+
+#-------------------------------------------------------------------------------
+# Comment or uncomment examples in user files
+#-------------------------------------------------------------------------------
+
+
+def comments(filename, use_gui):
+ """
+ Comment or uncomment examples in user files.
+ """
+
+ fd = file(filename, 'r')
+ fdt = file(filename+'.tmp','w')
+
+ kwd_beg = re.compile('EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START')
+ kwd_end = re.compile('EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END')
+
+
+ if use_gui:
+
+ comment_line = 0
+ for line in fd:
+ if kwd_beg.search(line): comment_line = 1
+ if comment_line == 0:
+ fdt.write(line)
+ else:
+ if len(line) > 1:
+ fdt.write('!ex '+line)
+ else:
+ fdt.write('!ex'+line)
+ if kwd_end.search(line): comment_line = 0
+
+ else:
+
+ for line in fd:
+ if not kwd_beg.search(line) and not kwd_end.search(line):
+ fdt.write(line)
+
+ fd.close()
+ fdt.close()
+
+ shutil.move(filename+'.tmp', filename)
+
+ return
+
+
+#-------------------------------------------------------------------------------
+# Definition of a class for a study
+#-------------------------------------------------------------------------------
+
+class Study:
+
+
+ def __init__(self, name, cases, use_gui, n_sat, n_syr):
+ """
+ Initialize the structure for a study.
+ """
+
+ self.name = string.upper(name)
+ self.cases = []
+ for c in cases:
+ self.cases.append(string.upper(c))
+ self.use_gui = use_gui
+ self.n_sat = n_sat
+ self.n_syr = n_syr
+
+
+ def create(self):
+ """
+ Create a study.
+ """
+
+ if self.name != os.path.basename(os.getcwd()):
+ os.mkdir(self.name)
+ os.chdir(self.name)
+ os.mkdir('MESH')
+ os.mkdir('POST')
+ # Creating cases
+ repbase = os.getcwd()
+ for c in self.cases:
+ os.chdir(repbase)
+ self.createCase(c)
+
+
+ def createCase(self, casename):
+ """
+ Create a case for a Code_Saturne study.
+ """
+
+ datadir = os.path.join(cs_config.dirs.pkgdatadir)
+ data_distpath = os.path.join(datadir, 'data')
+ users_distpath = os.path.join(datadir, 'users')
+
+ try:
+ os.mkdir(casename)
+ except:
+ sys.exit(1)
+
+ os.chdir(casename)
+
+ # Loop for dependency on the number of instances of Code_Saturne
+
+ for i in range(self.n_sat):
+
+ # Data directory
+
+ if self.n_sat == 1:
+ data = 'DATA'
+ else:
+ data = 'DATA.%(inst)d' % { 'inst' : i+1 }
+
+ os.mkdir(data)
+
+ thch_distpath = os.path.join(data_distpath, 'thch')
+ thch = os.path.join(data, 'THCH')
+ shutil.copytree(thch_distpath, thch)
+
+ if self.use_gui:
+
+ csguiname = 'SaturneGUI'
+ csguiscript = os.path.join(datadir, csguiname)
+
+ shutil.copy(csguiscript, data)
+ make_executable(os.path.join(data, csguiname))
+
+ # User source files directory
+
+ if self.n_sat == 1:
+ src = 'SRC'
+ else:
+ src = 'SRC.%(inst)d' % { 'inst' : i+1 }
+
+ os.mkdir(src)
+
+ users = os.path.join(src, 'REFERENCE')
+ shutil.copytree(users_distpath, users)
+
+ for file in ['usini1.f90','usalin.f90']:
+ f = os.path.join(users, 'base', file)
+ comments(f, self.use_gui)
+
+
+ # Loop for dependency on the number of instances of SYRTHES
+
+ for i in range(self.n_syr):
+
+ # Data directory
+
+ if self.n_syr == 1:
+ data_syr = 'DATA_SYR'
+ else:
+ data_syr = 'DATA_SYR.%(inst)d' % { 'inst' : i+1 }
+
+ os.mkdir(data_syr)
+
+ data_ref_syr = os.path.join(data_syr, 'REFERENCE')
+ shutil.copytree(os.path.join(cs_config.dirs.syrthes_prefix, 'data'), data_ref_syr)
+
+ # User source files directory
+
+ if self.n_syr == 1:
+ src_syr = 'SRC_SYR'
+ else:
+ src_syr = 'SRC_SYR.%(inst)d' % { 'inst' : i+1 }
+
+ os.mkdir(src_syr)
+
+ users_syr = os.path.join(src_syr, 'REFERENCE')
+ shutil.copytree(os.path.join(cs_config.dirs.syrthes_prefix, 'usr'), users_syr)
+
+
+ # Results directory (only one for all instances)
+
+ resu = 'RESU'
+ os.mkdir(resu)
+
+
+ # Script directory (only one for all instances)
+
+ scripts = 'SCRIPTS'
+ os.mkdir(scripts)
+
+ shutil.copy(os.path.join(datadir, 'runcase.help'), scripts)
+
+ if self.n_sat == 1:
+ shutil.copy(os.path.join(datadir, 'runcase'), scripts)
+ runcase = os.path.join(scripts, 'runcase')
+ else:
+ shutil.copy(os.path.join(datadir, 'runcase_coupling'), scripts)
+ runcase = os.path.join(scripts, 'runcase_coupling')
+
+ kwd1 = re.compile('nameandcase')
+ kwd2 = re.compile('STUDYNAME')
+ kwd3 = re.compile('CASENAME')
+ kwd4 = re.compile('CASEDIRNAME')
+
+ repbase = os.getcwd()
+ studyname = string.lower(self.name)
+ studycasename = studyname + string.lower(casename)
+ # In the cluster, names are limited to 15 caracters
+ studycasename = studycasename[:15]
+
+ runcase_tmp = runcase + '.tmp'
+
+ fd = open(runcase, 'r')
+ fdt = open(runcase_tmp,'w')
+
+ for line in fd:
+ line = re.sub(kwd1, studycasename, line)
+ line = re.sub(kwd2, self.name, line)
+ line = re.sub(kwd3, casename, line)
+ line = re.sub(kwd4, repbase, line)
+ fdt.write(line)
+
+ fd.close()
+ fdt.close()
+
+ shutil.move(runcase_tmp, runcase)
+
+ make_executable(runcase)
+
+
+ def dump(self):
+ """
+ Dump the structure of a study.
+ """
+
+ print "Name of the study:", self.name
+ print "Names of the cases:", self.cases
+ print "Use of the GUI:", self.use_gui
+ if self.n_sat > 1:
+ print "Number of Code_Saturne instances:", self.n_sat
+ if self.n_syr > 0:
+ print "Number of SYRTHES instances:", self.n_syr
+ print
+
+
+#-------------------------------------------------------------------------------
+# Creation of the study directory
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Main function.
+ """
+
+ welcome = """
+=================================================================
+ Code_Saturne study/case generation
+ Version %(csvers)s
+=================================================================
+ """ % { 'csvers': cs_config.package.version }
+
+ myStudy = process_cmd_line(argv)
+
+ print welcome
+
+ myStudy.dump()
+ myStudy.create()
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/bin/cs_info.py b/bin/cs_info.py
new file mode 100644
index 0000000..40a4582
--- /dev/null
+++ b/bin/cs_info.py
@@ -0,0 +1,187 @@
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+This module describes the script used to display information on Code_Saturne.
+
+This module defines the following functions:
+- process_cmd_line
+- print_version
+- launch_manual
+"""
+
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import os, sys, pwd, shutil, stat
+from optparse import OptionParser
+
+import cs_config
+
+
+#-------------------------------------------------------------------------------
+# Processes the passed command line arguments
+#-------------------------------------------------------------------------------
+
+
+def process_cmd_line(argv):
+ """
+ Processes the passed command line arguments.
+
+ Input Argument:
+ arg -- This can be either a list of arguments as in
+ sys.argv[1:] or a string that is similar to the one
+ passed on the command line. If it is a string the
+ string is split to create a list of arguments.
+ """
+
+ parser = OptionParser(usage="usage: %prog [options]")
+
+ parser.add_option("-r", "--reader", dest="pdf_reader", type="string",
+ metavar="<pdfreader>",
+ help="define a pdf reader")
+
+ parser.add_option("-g", "--guide", dest="guides", type="string",
+ metavar="<guide>", action="append",
+ help="open a given manual [user, theory, tutorial]")
+
+ parser.add_option("--version", dest="version",
+ action="store_true",
+ help="print Code_Saturne version number")
+
+ parser.set_defaults(pdf_reader=None)
+ parser.set_defaults(guides=[])
+ parser.set_defaults(version=False)
+
+ (options, args) = parser.parse_args(argv)
+
+ if len(args) > 0:
+ parser.print_help()
+ sys.exit(1)
+
+ return options.guides, options.pdf_reader, options.version
+
+
+#-------------------------------------------------------------------------------
+# Print Code_Saturne version
+#-------------------------------------------------------------------------------
+
+
+def print_version():
+ """
+ Print Code_Saturne version.
+ """
+
+ msg = """
+ Code_Saturne version: %(solver)s
+ Preprocessor version: %(prepro)s
+ """
+
+ print msg % {'solver':cs_config.dirs.prefix,
+ 'prepro':cs_config.dirs.ecs_prefix}
+
+
+#-------------------------------------------------------------------------------
+# Launch the PDF manual
+#-------------------------------------------------------------------------------
+
+
+def launch_manual(reader, m):
+ """
+ Launch the corresponding PDF manual.
+ """
+
+ sys_tools = ["xdg-open", # Generic
+ "gnome-open", # Gnome
+ "kfmclient exec", # KDE
+ "kde-open", # KDE 4
+ "exo-open"] # Xfce
+
+ readers = ["evince", "gpdf", "kpdf", "xpdf", "acroread"]
+
+ manual = os.path.join(cs_config.dirs.pdfdir, m) + '.pdf'
+
+ if not os.path.isfile(manual):
+ print "File %s not found." % manual
+ return
+
+ # First: use the reader specified by the user, if any
+ # Second: try the different tool that open with the default system reader
+ # Last: try some classical pdf viewers
+
+ if reader is not None:
+ cmd = reader + ' ' + manual + ' 2>/dev/null &'
+ os.system(cmd)
+
+ else:
+ if os.name == "nt":
+ os.filestart(manual)
+
+ elif os.name == "posix":
+
+ for t in sys_tools:
+ cmd = t + ' ' + manual + ' 2>/dev/null &'
+ try: os.system(cmd)
+ except: pass
+ return
+
+ for r in readers:
+ cmd = r + ' ' + manual + ' 2>/dev/null &'
+ try: os.system(cmd)
+ except: pass
+ return
+
+
+#-------------------------------------------------------------------------------
+# Creation of the study directory
+#-------------------------------------------------------------------------------
+
+
+def main(argv):
+ """
+ Main function.
+ """
+
+ manuals, reader, version = process_cmd_line(argv)
+
+ if version:
+ print_version()
+
+ for m in manuals:
+ launch_manual(reader, m)
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/bin/cs_plot_probes.py b/bin/cs_plot_probes.py
new file mode 100644
index 0000000..a9bc384
--- /dev/null
+++ b/bin/cs_plot_probes.py
@@ -0,0 +1,107 @@
+#-------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Solver.
+#
+# Copyright (C) 2009 EDF
+#
+# The Code_Saturne Preprocessor 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.
+#
+# The Code_Saturne Preprocessor 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+import os
+import sys
+import subprocess
+import tempfile
+from optparse import OptionParser
+
+#-------------------------------------------------------------------------------
+
+def process_cmd_line(argv):
+ """
+ Processes the passed command line arguments.
+
+ Input Argument:
+ arg -- This can be either a list of arguments as in
+ sys.argv[1:] or a string that is similar to the one
+ passed on the command line. If it is a string the
+ string is split to create a list of arguments.
+ """
+
+ parser = OptionParser(usage="Usage: %prog <monitoring file>")
+
+ (options, args) = parser.parse_args(argv)
+
+ if len(args) == 1:
+ file = args[0]
+ else:
+ parser.print_help()
+ sys.exit(1)
+
+ return file
+
+#-------------------------------------------------------------------------------
+
+def run_command(cmd):
+ """
+ Run a command.
+ """
+ p = subprocess.Popen(cmd,
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ p.wait()
+
+ return p.returncode
+
+#-------------------------------------------------------------------------------
+
+def plot(f):
+ """
+ Plot a monitoring file with XmGrace.
+ """
+ retval = 0
+
+ # Create a temporary file and correctly format the monitoring file
+
+ temp_file = tempfile.mkstemp(suffix=".hst")
+
+ cmd = "grep -v '#'" + " " + str(f) + "|cut -c9- >" + " " + temp_file[1]
+ run_command(cmd)
+
+ # Run XmGrace -nxy command
+
+ cmd = "xmgrace -nxy" + " " + temp_file[1]
+ run_command(cmd)
+
+ # Cleanup and exit
+
+ os.remove(temp_file[1])
+
+ return retval
+
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Main function.
+ """
+
+ file = process_cmd_line(argv)
+
+ retcode = plot(file)
+
+ sys.exit(retcode)
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
diff --git a/bin/runcase.help b/bin/runcase.help
new file mode 100644
index 0000000..6d6ec6c
--- /dev/null
+++ b/bin/runcase.help
@@ -0,0 +1,284 @@
+Setting runcase options
+=======================
+=======================
+
+The user may choose not to use the preprocessor
+ (only for meshes in .tlc or .slc format) by setting
+ SOLCOM=1
+otherwise set SOLCOM=0 as a standard
+WARNING: .slc and .tlc formats are obsolete and their use is deprecated.
+
+ -------------------------------
+
+The variable COMMAND_REORIENT is used by the preprocessor to reorient cells and
+faces in case of incorrect orientation.
+
+ COMMAND_REORIENT="--reorient"
+
+ If no correction is necessary, the variable COMMAND_REORIENT is left emtpy, as:
+
+ COMMAND_REORIENT=
+
+ -------------------------------
+
+To join meshes with the preprocessor, additional options must be defined:
+ - assign to the MESH variable the name of the meshes between " ".
+ - assign to the COMMAND_JOIN variable the joining option. It is recommended
+ to specify the color or group of the faces to be joined. If this can not
+ be done, the options -color or -group should not be used (but the cost of
+ the preprocessing will be higher and the process less robust). Selecting the
+ faces can be performed by other means (see the preprocessor help by ecs -h).
+ In the following example, the faces of color 3, 4 and 6 of the meshes
+ titi.des and toto.unv are joined as:
+
+ MESH="titi.des toto.unv"
+ COMMAND_JOIN="-j --color 3 4 6"
+
+ If no joining is necessary, the variable COMMAND_JOIN is left emtpy, as:
+
+ COMMAND_JOIN=
+
+ -------------------------------
+
+when the Code_Saturne GUI is used, the user assigns the name of the
+ xml file to the variable PARAM. The file should be placed in
+ the directory DATA of the case.
+
+ -------------------------------
+
+The variable COMMAND_CWF is used to cut the faces whose warp angle is larger
+ than a given tolerance (in degrees). For instance, if the tolerance
+ angle is 0.01 degrees (default value), the command reads:
+
+ COMMAND_CWF="--cwf 0.01"
+
+ If the user wants to use the mesh as obtained by the mesh generator,
+ COMMAND_CWF is left empty, as:
+
+ COMMAND_CWF=
+
+ -------------------------------
+
+When periodicity applies, COMMAND_PERIO is used by the preprocessor,
+ with the option --perio:
+
+ Two types of periodicity are possible: translation and rotation.
+ Translation : --perio --trans tx ty tz
+ (tx,ty,tz): vector components
+ Rotation : two methods are possible
+ - the angle, the direction and an invariant point are given:
+ --perio --rota --angle a --dir dx dy dz --invpt px py pz
+ a : angle in degrees (between -180 and +180)
+ (dx,dy,dz): rotation axis vector components
+ (px,py,pz): rotation invariant point components
+ - the matrix and an invariant point are given:
+ --perio --rota --matrix m11 m12 m13 m21 m22 m23 m31 m32 m33 --invpt px py pz
+ mij : matrix elements (line by line)
+ (px,py,pz): rotation invariant point components
+
+ Translation and rotation can be used together:
+ --perio --trans tx ty tz --rota --angle a
+ --dir dx dy dz -invpt px py pz
+ or --perio --trans tx ty tz --rota --matrix m11 m12 m13
+ m21 m22 m23
+ m31 m32 m33
+ --invpt px py pz
+ The result is RoT (whatever the order of the rotation and translation in
+ the command line).
+
+ Rotation and translation have to be consistant with each other.
+
+ It is better to use the faces where periodicity applies, by using the
+ property of these faces, with their color for instance (faces
+ can be selected by other means than their color: see ecs -h for more
+ details), for instance:
+ --perio --trans 10 0 0 --color 1 2
+
+ Up to 3 periodicity directions can be imposed (one per spacial direction),
+ for example:
+ --perio --trans 10 0 0 --perio --trans 0 1 0 --perio --trans 0 0 1
+
+ If periodicity does not apply, COMMAND_PERIO is left empty as:
+
+ COMMAND_PERIO=
+
+ Example ("\" shows the continuation of the command line):
+
+ COMMAND_PERIO="--perio --trans -10.2 0 0 --color 2 \
+ --perio --rota --angle 90 --dir 0 0 1 --invpt 0 0 0 \
+ --color 3 4 \
+ --perio --trans 0 1 0 \
+ --rota --matrix 1 0 0 \
+ 0 0 -1 \
+ 0 1 0 --invpt 0 0 -0.2"
+
+ -------------------------------
+
+If coupling with SYRTHES applies, (only one fluid simulation coupled
+ with only one solid simulation), the necessary information is determined
+ automatically by inspecting the user subroutines.
+
+ For more complex (multiple) couplings, the script will have to be changed.
+
+ -------------------------------
+
+If thermochemistry applies, the name of the thermochemistry data file
+ may be specified through THERMOCHEMISTRY_DATA. For example:
+ THERMOCHEMISTRY_DATA="dp_FCP"
+
+ -------------------------------
+
+If meteo profiles are used, the name of the meteo data file
+ may be specified through METEO_DATA. For example:
+ METEO_DATA="meteo"
+
+ -------------------------------
+
+
+User input files can be specified with the USER_INPUT_FILE variable
+ (left empty if none are used) and the files are located in DATA.
+
+ -------------------------------
+
+User output files to retrieve can be specified with USER_OUTPUT_FILE.
+
+ -------------------------------
+
+The NUMBER_OF_PROCESSORS option defines the number of MPI processes to use
+ (ideally equal to the physical number of processors or cores, but this
+ is not mandatory). If the variable is left empty, it is determined
+ automatically (for PC's or workstations, NUMBER_OF_PROCESSORS is set to 1
+ and for clusters or supercomputers, it is set to the number of processors
+ reserved for the batch job).
+ When running a calculation through a batch system, it is not recommended
+ to force NUMBER_OF_PROCESSORS to a value different from the number of
+ processors required for the batch job, as oversubscribing may lead to
+ strongly degraded performance (and may even fail depending on the system's
+ mpi policy), and under-subscribing means reserving unused processors.
+ When running the script interactively (such as on a Linux PC),
+ NUMBER_OF_PROCESSORS may be set to a lower value than the number of
+ physical processors (to limit system load), or to a higher value
+ (usually for testing, as this reduces performance).
+ When coupling with SYRTHES using MPI, one process/processor is reserved
+ for SYRTHES, so the number of processors used for the kernel is
+ equal to nproc_kernel = NUMBER_OF_PROCESSORS - 1.
+
+
+If we wish to specify distant machines (or are running on a cluster
+ with no batch system), the optional PROCESSOR_LIST string may be defined.
+ Running on multiple processors not reserved for this task is not recommended,
+ as load imbalance due to 1 processor running multiple jobs is enough to
+ degrade the performance for the whole job. Also, running in parallel without
+ a high performance network will lead to low performance (low latency being
+ even more important than high bandwidth).
+ Two simple examples:
+ PROCESSOR_LIST="machine1 cpu=nb_cpu1 user=userid1 & machine2 cpu=nb_cpu2 user=userid2"
+ PROCESSOR_LIST="machine1 & machine2"
+ The & separates 2 machines in the list. Fields are as follows:
+ machine1 and machine2 indicate machine names (as given by the
+ hostname command).
+ for example: chi80xx.der.edf.fr
+ nb_cpu1 and nb_cpu2 indicate the number of processors on hosts
+ machine1 and machine2
+ for example, on a dual-processor machine: cpu=2
+ userid1 and userid2 indicate the user's login on machine1 and machine2
+ Fields cpu= and user= are optional.
+ The machine from which the script is run will automatically be used with
+ most MPI environments.
+ Selected machines must use a shared filesystem (at least NFS) and all
+ be of the same general OS and architecture type.
+
+ -------------------------------
+
+The CS_TMP_PREFIX variable allows the user to specify in which temporary
+ directory the calculation will run. If left empty, a default directory
+ will be used (architecture dependent). If a value is specified,
+ the temporary directory will be:
+ RUN=$CS_TMP_PREFIX/tmp_Saturne/$STUDY.$CASE.$DATE
+
+Specifying CS_TMP_PREFIX may be useful for example on a workstation so
+ as to use a large local disk (CS_TMP_PREFIX=/local00/users/`whoami`
+ for example).
+ Under some batch systems, the default of TMPDIR may be destroyed after
+ each run, so to keep this temporary directory after the run,
+ another value must be specified (CS_TMP_PREFIX=$SCRATCHDIR for example).
+
+ -------------------------------
+
+The EXEC_PREPROCESS, EXEC_PARTITION, and EXEC_KERNEL variables allow running
+ only some specific stages of the calculation, and saving them for future use.
+ if EXEC_KERNEL is set to no, the Preprocessor's preprocessor_output file
+ is copied in RESU, and the Partitioner's output is copied in a
+ PARTITION_OUTPUT directory in RESU. note also that when partitioning with no
+ kernel execution, the number of processors required is not known in advance,
+ so the PARTITION_LIST variable must be used to indicate which partitionings
+ are required. For example, PARTITION_LIST="128 256" will generate
+ 2 partitionings, with files domain_number_128 and domain_number_256
+ in RESU/PARTITION_OUTPUT. The option "-no-perio" may also be added to
+ PARTITION_LIST if we do not want periodicity to be accounted for in the
+ connectivity graph.
+ If EXEC_PREPROCESS is set to no, a preprocessor_output file must be found in
+ DATA (typically, a symbolic link to a file in RESU).
+ If EXEC_PARTITION is set to no, a PARTITION_OUTPUT directory must be found
+ in DATA (typically, a symbolic link to a file in RESU). If no partitioning
+ is found, the calculation will continue, using an unoptimized partitioning,
+ which may impact performance.
+
+ -------------------------------
+
+Option CS_LIB_ADD is more advanced, mainly for developers.
+
+ CS_LIB_ADD allows specifying external libraries to link. In this
+ case, the whole option to pass to the linker must be given.
+ For example:
+ CS_LIB_ADD="-L/home/saturne/opt/foo/lib -lfoo"
+
+ VALGRIND enables running of the Kernel through Valgrind if this
+ memory-checking tool is available (usually under Linux) To
+ activate it:
+ VALGRIND=valgrind
+ possibly with specific options, such as for example
+ VALGRIND="valgrind --tool=memcheck"
+ If valgrind is not in the PATH, its full path must be specified.
+
+ ARG_CS_VERIF allows activation of elementary mesh quality tests,
+ as well as basic linear algebra operations micro-benchmarks.
+ ="-q" : mesh quality criteria and test precision of gradient for
+ sin(x+2y+3z) with each calculation mode (IMRGRA from 0 to 4)
+ ="--benchmark": basic linear algebra operation benchmark
+ ="--benchmark --mpitrace" : same as benchmark, with operations run
+ only once, for use with MPI trace tools.
+ In mesh quality or benchmark mode, no parameter file or user
+ subroutine is needed.
+
+ ARG_CS_OUTPUT allows redirection of output.
+ The "--log" option allows redirecting output for a single-processor
+ run or for rank 0 of a parallel run.
+ "--log 0" output redirected to standard output
+ "--log 1" output redirected to a "listing" file (default behavior)
+ The "--logp" option allows redirection of output for ranks 1 to n-1
+ for a parallel run on n processors:
+ "--logp -1" turns off output for ranks > 0 (default behavior)
+ "--logp 0" sends all output to the standard output (useful if every
+ rank is associated to a different console, such as when running
+ under a debugger).
+ "--logp 1" redirects all output from ranks 1 to n-1 to files
+ listing_n0002 to listing_n<N>.
+ Options --log and --logp may be specified together or separately
+ through the ARG_CS_OUTPUT variable.
+
+ ECHO_SYR_COMM allows for echo of communications on the SYRTHES 3 side.
+ This is only useful when debugging a coupled calculation.
+ To activate this options, assign a strictly positive value to
+ ECHO_SYR_COMM. For each message exchanged, the ECHO_SYR_COMM first
+ and last values will be printed (characters, integers, or doubles).
+ By default, the string is kept empty.
+ Reasonable activation value:
+ ECHO_SYR_COMM="10"
+
+ ADAPTATION allows use of mesh adaptation with the HOMARD tool.
+ If the variable is absent or empty, no adaptation occurs.
+ To activate adaptation, ADAPTATION will contain the name of a file
+ containing adaptation directives. To obtain the syntax of this
+ file, use ADAPTATION=help and run the script.
+ THIS FUNCTIONALITY IS NOT YET IN PRODUCTION
diff --git a/bin/runcase.in b/bin/runcase.in
new file mode 100644
index 0000000..b69ca97
--- /dev/null
+++ b/bin/runcase.in
@@ -0,0 +1,1127 @@
+#!/bin/sh
+# @configure_input@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# BATCH FILE FOR THE CCRT (Platine under LSF)
+# ===========================================
+#
+#BSUB -n 2
+#BSUB -W 00:05
+#BSUB -o nameandcaseo.%J
+#BSUB -e nameandcasee.%J
+#BSUB -J nameandcase
+#
+# -n : number of processors
+# -W : walltime as hh:mm
+# -o : output file name
+# -e : error file name
+# -J : job name
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE FOR THE Chatou CLUSTER (PBS)
+# =======================================
+#
+#PBS -l nodes=4:ppn=2
+#PBS -l walltime=1:00:00
+#PBS -l mem=320mb
+#
+#PBS -j eo
+#PBS -N nameandcase
+#
+# nodes : number of nodes
+# ppn : number of process per node
+# walltime : wall clock time (hh:mm:ss)
+# mem : memory
+#
+#WARNING: when coupling with SYRTHES, 1 processor will be reserved for each
+# instance of SYRTHES. The Kernel will be executed on the remaining
+# processors, so make sure to reserve a sufficiently high number
+# of processors.
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (University of Manchester Cluster)
+# =============================================
+#
+# set the name of the job
+##$ -N nameandcase
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (AIX, Loadlever)
+# ===========================
+#
+#@ shell = /bin/sh
+#
+#@ job_name = nameandcase
+#
+#@ job_type = parallel
+#@ cpus = 128
+#@ node_usage = not_shared
+#
+#@ network.MPI = csss,shared,US
+#@ bulkxfer = yes
+#
+#@ wall_clock_limit = 00:20:00
+#@ account_no = z001
+#
+#@ output = $(job_name).$(schedd_host).$(jobid).out
+#@ error = $(job_name).$(schedd_host).$(jobid).err
+#@ notification = never
+#
+#@ queue
+# suggested environment settings:
+# export MP_EAGER_LIMIT=65536
+# export MP_SHARED_MEMORY=yes
+# export MEMORY_AFFINITY=MCM
+# export MP_TASK_AFFINITY=MCM
+#
+########################################################################
+#
+# BEGINNING OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+# runcase.help gives more details about the different variables.
+#
+# -------------------------------
+#
+SOLCOM=0
+#
+# On some systems, some external libraries may require TERM to be defined.
+export TERM=xterm
+#
+STUDY=STUDYNAME
+CASE=CASENAME
+PARAM=
+MESH=
+COMMAND_REORIENT=
+COMMAND_JOIN=
+COMMAND_CWF=
+COMMAND_PERIO=
+THERMOCHEMISTRY_DATA=
+METEO_DATA=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS=
+PROCESSOR_LIST=
+#
+PARTITION_LIST=
+#
+USER_INPUT_FILES=""
+USER_OUTPUT_FILES=""
+#
+# Working directory (leave empty for automatic default directory)
+CS_TMP_PREFIX=
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+CS_LIB_ADD=
+VALGRIND=
+#
+ARG_CS_VERIF=""
+ARG_CS_OUTPUT=""
+#
+# Adaptation using HOMARD
+ADAPTATION=
+#
+summary=summary
+CASEDIR=CASEDIRNAME
+DATA=$CASEDIR/DATA
+RESU=$CASEDIR/RESU
+SRC=$CASEDIR/SRC
+SCRIPTS=$CASEDIR/SCRIPTS
+RESTART_IN=$DATA/RESTART
+PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+MESHDIR=$CASEDIR/../MESH
+#
+# The following variables are only used in case of coupling with SYRTHES.
+# DATA_SYR: directory where to find SYRTHES_ENV
+# SRC_SYR: directory where to find possible user source files
+DATA_SYR=$CASEDIR/DATA_SYR
+SRC_SYR=$CASEDIR/SRC_SYR
+SYRTHES_ENV=syrthes.env
+#
+# The possible coupling mode with SYRTHES may be chosen here.
+#
+# COUPLING_MODE=MPI : should work on most machines.
+# COUPLING_MODE=sockets : should be activated on clusters when the MPI rank
+# of a process is not determinable or if MPI can
+# not be used.
+COUPLING_MODE=MPI
+ECHO_SYR_COMM=""
+#
+# Indicate which steps should be executed; if both the Preprocessor and the
+# Kernel are executed, the "preprocessor_output" and eventual "domain_number_*"
+# files are not saved. If only the preprocessor and / or partitioner are
+# executed, the corresponding files will be saved in a RESU/PREPROCESSOR_OUTPUT
+# and RESU/PARTITION directory. If the Preprocessor is not executed,
+# "preprocessor_output" will be read from $PREPROCESSOR_OUTPUT_IN. If the
+# Partitioner is not executed, "domain_number_*" will be read from
+# $PARTITION_OUTPUT_IN if available (otherwise, unoptimized default
+# partitioning will be used).
+#
+# EXEC_PREPROCESS : should the Preprocessor be run ? (yes/no)
+# EXEC_PARTITION : should the Partitioner be run ? (yes/no)
+# EXEC_KERNEL : should the Kernel be run ? (yes/no)
+#
+EXEC_PREPROCESS=yes
+EXEC_PARTITION=yes
+EXEC_KERNEL=yes
+#
+#
+#
+########################################################################
+#
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Kernel installation parameters
+#
+prefix=@prefix@
+#
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+datarootdir=@datarootdir@
+datadir=@datadir@
+pkgdatadir=${datadir}/@PACKAGE@
+#
+# Preprocessor installation parameters
+#
+ecs_prefix=@ecs_prefix@
+#
+ecs_exec_prefix=${ecs_prefix}
+ecs_bindir=${ecs_exec_prefix}/bin
+#
+# HOMARD installation parameters (to be completed if needed)
+#
+homard_prefix=
+#
+########################################################################
+# Mesh Adaptation
+#
+if [ ! -z "${ADAPTATION}" ] ; then
+ if [ "${ADAPTATION}" = "-help" ] ; then
+ ${homard_prefix}/saturne_homard ${ADAPTATION}
+ exit 0
+ else
+ HOMARD_options=" -v"
+ ${homard_prefix}/saturne_homard -Saturne_Script $0 -Donnees_Calcul $CASEDIR \
+ -Pilotage_Adaptation $ADAPTATION $HOMARD_options || exit 1
+ fi
+fi
+#
+#########################################################################
+#
+N_SYRTHES_COUPLINGS=0
+if [ -f "${SRC}/ussyrc.f90" ] ; then
+ N_SYRTHES_COUPLINGS=`grep -e ^' ' ${SRC}/ussyrc.f90 | grep -i -c defsyr`
+fi
+#
+if [ $N_SYRTHES_COUPLINGS = 0 ] ; then
+ SYRTHES_COUPLING=no
+else
+ SYRTHES_COUPLING=yes
+ export SYRTHES
+ if [ $N_SYRTHES_COUPLINGS -gt 1 ] ; then
+ echo "This script can not handle multiple couplings with SYRTHES"
+ echo "Number of SYRTHES couplings requested: $N_SYRTHES_COUPLINGS"
+ fi
+fi
+#
+if [ $SYRTHES_COUPLING = yes ] ; then
+ if [ $SOLCOM -eq 1 ] ; then
+ echo "SYRTHES coupling is not compatible with SOLCOM-type meshes"
+ exit 1
+ fi
+else
+ COUPLING_MODE=
+fi
+#
+########################################################################
+#
+# Parameters for execution
+#
+# General variables
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIX=$DATE
+EXE=cs_solver
+EXE_SYR=syrthes
+#
+# Copy runcase before changing to the working directory
+# (as after that, the relative path will not be up to date).
+#
+cp $0 $RESU/runcase.$SUFFIX
+#
+# Execution directory (reachable by all the processors)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+else
+# Default if not specified by the user
+#
+# On the CCRT, there is no TMPDIR. We work by default in SCRATCHDIR
+ if [ "$SCRATCHDIR" != "" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+ else
+ RUN=$HOME/tmp_Saturne/$STUDY.$CASE.$DATE
+ fi
+fi
+#
+# Create directory if necessary
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "RUN=$RUN already exists."
+ echo "The simulation will not be run."
+ exit 1
+ fi
+fi
+#
+# Create a temporary file for Salome (equivalent to "ficstp")
+if [ "$ARG_CS_OUTPUT" = "--log 0" ] ; then
+ echo $RUN > $SCRIPTS/runningstd.$DATE
+else
+ echo $RUN > $SCRIPTS/runningext.$DATE
+fi
+#
+cd $RUN
+#
+########################################################################
+#
+# Set up MPI environment
+#
+# Use makefile query to obtain the path to MPI binaries if those are
+# not on the default path. This is a peculiar use of make, but allows
+# us to avoid defining the MPI configuration in multiple files.
+
+CS_MPI_PATH=@MPI_BIN@
+
+# NUMBER_OF_PROCESSORS is determined here if not already set;
+# MPIHOSTS, MPIRUN, MPIBOOT, MPIHALT, and NUMBER_OF_NODES are
+# defined by the sourced script, and PATH may be updated.
+#
+. ${pkgdatadir}/runcase_mpi_env
+#
+# Check for the number of requested processors
+nproc_kernel="${NUMBER_OF_PROCESSORS}"
+echo
+echo
+if [ $SYRTHES_COUPLING = yes ] ; then
+ echo "Coupling of Code_Saturne and SYRTHES activated."
+ # 1 processor is reserved for SYRTHES if coupled through MPI.
+ if [ "$COUPLING_MODE" = "MPI" ] ; then
+ (( nproc_kernel = nproc_kernel - N_SYRTHES_COUPLINGS ))
+ if [ $nproc_kernel -lt 1 ] ; then
+ echo
+ echo
+ echo " Warning, if COUPLING_MODE = MPI, SYRTHES reserves 1 processor"
+ echo " (which need not be a physical processor)."
+ echo " Here, NUMBER_OF_PROCESSORS=${NUMBER_OF_PROCESSORS}, while it must"
+ echo " be strictly greater than 1."
+ echo " Increase the number of requested processors."
+ echo
+ exit 1
+ fi
+ fi
+fi
+if [ $nproc_kernel -gt 1 ] ; then
+ echo "Parallel Code_Saturne with partitioning in $nproc_kernel sub-domains"
+ if [ $SOLCOM = 1 ] ; then
+ echo
+ echo
+ echo " Parallel run impossible with SOLCOM = $SOLCOM "
+ echo " Use SOLCOM = 0 "
+ echo
+ exit 1
+ fi
+else
+ echo "Single processor Code_Saturne simulation"
+fi
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "Total number of processors: $NUMBER_OF_PROCESSORS"
+fi
+#
+# In parallel mode, the corresponding argument must be set
+if [ $nproc_kernel -gt 1 ] ; then
+ ARG_CS_MPI=" --mpi"
+else
+ ARG_CS_MPI=""
+fi
+#
+#
+########################################################################
+#
+# Communications
+#
+# To help debug coupling problems, make communication more verbose
+if [ ! -z "$ECHO_SYR_COMM" ] ; then
+ ECHOCOMMSYR="-echo-comm $ECHO_SYR_COMM"
+else
+ ECHOCOMMSYR=""
+fi
+########################################################################
+# Greeting message
+#
+echo ' '
+echo ' Code_Saturne is running '
+echo ' *********************** '
+echo ' '
+echo ' Working directory (to be periodically cleaned) : '
+echo ' ' $RUN
+#
+########################################################################
+#
+# Compilation and link
+#
+# Note: we also check the for the presence of certain user subroutines here.
+#
+echo
+echo ' Kernel version: ' $prefix
+echo ' Preprocessor version: ' $ecs_prefix
+
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ cur_dir=`pwd`
+
+ source_cas=$SRC
+
+ #
+ # Copy of the parameter file
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMAND_PARAM="--param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The parameters file ' $var
+ echo ' can not be accessed.'
+ exit 1
+ fi
+ fi
+
+ src_files=`ls ${source_cas}/*.[fF]90 ${source_cas}/*.[ch] 2>/dev/null`
+
+ if [ ! -z "${src_files}" ] ; then
+
+ echo
+ echo " ***************************************************************"
+ echo " Compilation of user subroutines and linking of Code_Saturne"
+ echo " ***************************************************************"
+
+ if [ -f compil.log ] ; then
+ rm -f compil.log
+ fi
+
+ src_dir="src_saturne"
+
+ # Copy of the user source files
+ # (no links: the directory is copied later)
+ mkdir ${src_dir}
+ for f in ${src_files} ; do
+ if [ -f $f ] ; then
+ cp ${f} ${src_dir}/
+ fi
+ done
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --source=$src_dir --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ # Compilation
+ if [ ! -z "${CS_LIB_ADD}" ] ; then
+ OPTLIBS="--opt-libs=${CS_LIB_ADD}"
+ fi
+ ${bindir}/cs compile \
+ --source=$src_dir ${OPTLIBS} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ echo "COMPILE OR LINK ERROR"
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ fi
+
+ else
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ ln -s ${bindir}/$EXE .
+
+ fi
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+
+ ${pkgdatadir}/runcase_syrthes -compile \
+ -cs-bindir=${bindir} -src-syr=${SRC_SYR} \
+ -src-copy=${RESU}/SRC_SYR.${SUFFIX} -log=${RESU}/compil_syrthes.log.${SUFFIX}
+
+ fi
+
+fi # EXEC_KERNEL = yes
+
+#
+########################################################################
+#
+# Data setup
+#
+echo
+echo " ********************************************"
+echo " Preparing calculation "
+echo " ********************************************"
+echo
+#
+ERROR=false
+PREPROCESS_ERROR=false
+PARTITION_ERROR=false
+EXECUTION_ERROR=false
+#
+if [ $SOLCOM = 1 ]
+then
+ EXEC_PREPROCESS=no
+ EXEC_PARTITION=no
+ ln -s $MESHDIR/$MESH geomet || exit 1
+fi
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ]
+then
+ for var in $MESH ; do
+ ln -s $MESHDIR/$var $var || exit 1
+ # Special case for meshes in EnSight format: link to .geo file necessary
+ # (retrieve name through .case file)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $MESHDIR/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+else
+ if [ -f ${PREPROCESSOR_OUTPUT_IN} ] ; then
+ ln -s ${PREPROCESSOR_OUTPUT_IN} preprocessor_output || exit 1
+ else
+ echo "Error: no preprocessor output file is available;"
+ echo " (${PREPROCESSOR_OUTPUT_IN} does not exist."
+ echo " or is not a standard file."
+ exit 1
+ fi
+fi
+#
+if [ $nproc_kernel -eq 1 -a "${EXEC_KERNEL}" = "yes" ] ; then
+ EXEC_PARTITION=no
+elif [ "${EXEC_PARTITION}" = "no" -a "${PARTITION_OUTPUT_IN}" != "" ]
+then
+ if [ -f ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} ] ; then
+ ln -s ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} .
+ else
+ echo "Warning: no partitioning file is available;"
+ echo " (no ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel})."
+ echo
+ echo " Unoptimized partitioning will be used."
+ echo " Parallel performance may be degraded."
+ fi
+fi
+#
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ for var in ${RESTART_IN}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = ctwava ] ; then
+ vara=ctwamo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "$THERMOCHEMISTRY_DATA" != "" ] ; then
+ var=$DATA/$THERMOCHEMISTRY_DATA
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # Copy so as to have correct name upon backup
+ if [ "$THERMOCHEMISTRY_DATA" != "dp_tch" ] ; then
+ cp dp_tch $THERMOCHEMISTRY_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The thermochemistry file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ if [ "$METEO_DATA" != "" ] ; then
+ var=$DATA/$METEO_DATA
+ if [ -f $var ] ; then
+ cp $var meteo
+ # Copy so as to have correct name upon backup
+ if [ "$METEO_DATA" != "meteo" ] ; then
+ cp meteo $METEO_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The meteo profile file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ for f in uscpcl.f90 usd3pc.f90 usebuc.f90 uslwcc.f90 usfucl.f90
+ do
+ if [ -f "${SRC}/${f}" -a ! -f JANAF ] ; then
+ cp ${datadir}/data/thch/JANAF JANAF
+ fi
+ done
+ #
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ #
+ ${pkgdatadir}/runcase_syrthes -copy-data -syrthes-env=${DATA_SYR}/$SYRTHES_ENV
+ #
+ fi
+ #
+ if [ ! -z "$USER_INPUT_FILES" ] ; then
+ for f in $USER_INPUT_FILES ; do
+ cp $DATA/$f .
+ done
+ fi
+ #
+fi # EXEC_KERNEL = yes
+
+########################################################################
+# Maximum time for PBS (done here so as to leave time for PBS to
+# realize that things have started).
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Summary: start
+#
+CURDATE=`unset LANG ; date`
+#
+echo '========================================================'>>$summary
+echo ' Start time : ' $CURDATE >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Kernel : ' $prefix >>$summary
+echo ' Preprocessor : ' $ecs_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' HOMARD : ' $homard_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' CS_MPI_PATH : ' $CS_MPI_PATH >>$summary
+echo ' PATH : ' $PATH >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' User : ' $USER >>$summary
+echo '========================================================'>>$summary
+echo ' Machine : ' >>$summary
+ uname -a >>$summary
+if [ -z "$NUMBER_OF_PROCESSORS" ] ; then
+ echo ' N Procs : ' 1 >>$summary
+else
+ echo ' N Procs : ' $NUMBER_OF_PROCESSORS >>$summary
+fi
+if [ -z "$PROCESSOR_LIST" ] ; then
+ echo ' Processors : ' default >>$summary
+else
+ echo ' Processors : ' $PROCESSOR_LIST >>$summary
+fi
+echo '========================================================'>>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Case : ' $CASE >>$summary
+echo ' DATA : ' $DATA >>$summary
+echo ' SRC : ' $SRC >>$summary
+echo ' RESU : ' $RESU >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Exec. dir. : ' $RUN >>$summary
+echo ' ----------------------------------------------------' >>$summary
+if [ "$EXEC_PREPROCESSOR" = "yes" ] ; then
+ echo ' Preprocessor : ' ${ecs_bindir}/cs_preprocess >>$summary
+fi
+if [ "$EXEC_PARTITION" = "yes" ] ; then
+ echo ' Partitioner : ' ${ecs_bindir}/cs_partition >>$summary
+fi
+if [ "$EXEC_KERNEL" = "yes" ] ; then
+ echo ' Executable : ' $EXE >>$summary
+fi
+echo ' ----------------------------------------------------' >>$summary
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Starting calculation"
+echo " ********************************************"
+echo
+#
+# Preprocessor start
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ] ; then
+ #
+ ${ecs_bindir}/cs_preprocess --mesh $MESH "--case" $CASE \
+ $COMMAND_REORIENT $COMMAND_JOIN $COMMAND_PERIO \
+ > listpre 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error running the preprocessor."
+ echo "Check preprocessor log (listpre) for details."
+ echo
+ PREPROCESS_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PREPROCESSOR_OUTPUT_OUT=$RESU/preprocessor_output.$SUFFIX
+ cp preprocessor_output ${PREPROCESSOR_OUTPUT_OUT}
+ fi
+ #
+fi
+#
+# Partitioner start
+#
+if [ ! -f ${ecs_bindir}/cs_partition ] ; then
+ echo "Warning: ${ecs_bindir}/cs_partition not found."
+ echo
+ echo "The partitioner may not have been installed"
+ echo " (this is the case if neither METIS nor."
+ echo " SCOTCH are avaialable)."
+ echo
+ echo "Unoptimized partitioning will be used, so"
+ echo "parallel performance may be degraded."
+ echo
+ EXEC_PARTITION=no
+fi
+#
+if [ "${EXEC_PARTITION}" = "yes" ] ; then
+ #
+ if [ "${EXEC_KERNEL}" = "yes" ] ; then
+ ${ecs_bindir}/cs_partition $nproc_kernel > listpart 2>&1
+ else
+ if [ -z "$PARTITION_LIST" ] ; then
+ echo "Error running the partitioner."
+ echo "PARTITION_LIST is not set."
+ echo "This variable should contain the number of processors"
+ echo "for which we partition (or a list of such numbers)."
+ PARTITION_ERROR=true
+ ERROR=true
+ else
+ ${ecs_bindir}/cs_partition $PARTITION_LIST > listpart 2>&1
+ fi
+ fi
+ if [ $? != 0 -a $PARTITION_ERROR = false ] ; then
+ echo "Error running the partitioner."
+ echo "Check partitioner log (listpart) for details."
+ echo
+ PARTITION_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PARTITION_OUTPUT_OUT=$RESU/PARTITION_OUTPUT.$SUFFIX
+ mkdir $PARTITION_OUTPUT_OUT
+ cp -r domain_number_* ${PARTITION_OUTPUT_OUT}/
+ fi
+#
+fi
+#
+# Run calculation proper.
+#
+if [ "$ERROR" != "true" -a "$EXEC_KERNEL" = "yes" ] ; then
+#
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ # MPI Communication
+ #
+ # Make sure to transmit possible additional arguments assigned by mpirun to
+ # the executable with some MPI-1 implementations (vanilla MPICH 1.2 sets the
+ # parameters needed by MPI_Init through argc/argv): we use $@ to forward
+ # arguments passed to localexec to the true executable files.
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`${pkgdatadir}/runcase_mpi_rank \$@\`" >> $localexec
+ echo cd $RUN >> $localexec
+ echo "if [ \$MPI_RANK -eq 0 ] ; then" >> $localexec
+ echo " $RUN/$EXE_SYR \$@ -app-num 0 -comm-mpi 1 $ECHOCOMMSYR > listsyr 2>&1" >> $localexec
+ echo "else" >> $localexec
+ echo " $VALGRIND $RUN/$EXE \$@ --mpi 1 $COMMAND_CWF "\
+ "$ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM " >> $localexec
+ echo "fi" >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ #
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ elif [ $SYRTHES_COUPLING = yes ] ; then
+ # Socket communications
+ #
+ # We provide the executables with a "random" port number.
+ PORT=35623
+ SOCKETNCS="--syr-socket $PORT"
+ SOCKETSYR="-comm-socket $PORT"
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI $COMMAND_CWF "\
+ " $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM $SOCKETNCS " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true &
+ #
+ ./$EXE_SYR $ECHOCOMMSYR $SOCKETSYR > listsyr 2>&1
+ #
+ $MPIHALT
+ #
+ elif [ $SOLCOM = 0 ] ; then
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI "\
+ " $COMMAND_CWF $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ else # cas SOLCOM = 1
+ #
+ $VALGRIND $RUN/$EXE --solcom \
+ $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM \
+ || EXECUTION_ERROR=true
+ #
+ fi
+#
+fi
+#
+# Remove the Salome temporary files
+rm -f $SCRIPTS/running*.$DATE
+#
+########################################################################
+#
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ echo "Error running the coupled calculation."
+ echo "Either the Kernel or SYRTHES may have failed."
+ echo
+ echo "Check Kernel log (listing) and SYRTHES log (listsyr) for details,"
+ echo "as well as eventual error* files."
+ echo
+ else
+ echo "Error running the calculation."
+ echo
+ echo "Check Kernel log (listing) and error* files for details"
+ echo
+ fi
+ ERROR=true
+fi
+#
+# Treatment of the ouput files:
+# Starts with the restart files
+# (in case of full disk, increases chances of being able to continue).
+#
+if [ $EXEC_KERNEL = yes ] ; then
+
+ RESTART_OUT=$RESU/RESTART.$SUFFIX
+ iok=1
+ mkdir ${RESTART_OUT} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in suiava suiavx t1dava ctwava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f ${RESTART_OUT}
+ fi
+ done
+ else
+ for f in suiava suiavx t1dava ctwava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+
+ resuser=0
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIX
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f ${RES_USER}
+ fi
+ done
+ else
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+ fi
+
+ for f in $PARAM $THERMOCHEMISTRY_DATA $METEO_DATA ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+
+ for f in probes_*.dat ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+ for f in ush* ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+
+fi # output files
+
+for f in list* error* *.med *.cgns ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+done
+
+# Treatment of EnSight and MED files
+# The $dir (=*.ensight and/or *.med) directories are copied
+# to $DIR.$SUFFIX
+
+# We place directories $dir (=*.ensight and/or *.med)
+# in $DIR.$SUFFIX
+
+cas=`echo $CASE |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Creating $RESU/$DIR.$SUFFIX failed
+ else
+ for f in $dir/* ; do
+ if [ -f $f ] ; then
+ cp -R ${f} $RESU/$DIR.$SUFFIX/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ rayt_list=`ls bord* 2>/dev/null`
+ if [ ! -z "${rayt_list}" ] ; then
+ for f in $rayt_list ; do
+ if [ ! -d $RESU/CHR.$SUFFIX ] ; then
+ mkdir $RESU/CHR.$SUFFIX
+ fi
+ cp $f $RESU/CHR.$SUFFIX/.
+ done
+ fi
+
+ lagr_list=`ls debug* deplacement* trajectoire* frontiere* 2>/dev/null`
+ if [ ! -z "${lagr_list}" ] ; then
+ mkdir $RESU/LAGR.$SUFFIX
+ for f in $lagr_list ; do
+ cp $f $RESU/LAGR.$SUFFIX
+ done
+ fi
+
+ # Matisse output files
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # The date is added to the first line of resuMatisse
+ AFDATE="Date of the case : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIX
+ fi
+
+ for dir in src_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/SRC.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Failure creating $RESU/SRC.$SUFFIX
+ else
+ for f in $dir/*.[fF]90 $dir/*.[ch] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} $RESU/SRC.$SUFFIX/.
+ fbase=`basename ${f}`
+ chmod a-w $RESU/SRC.$SUFFIX/${fbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ ${pkgdatadir}/runcase_syrthes -copy-results \
+ -result-dir=${RESU}/RESU_SYR.${SUFFIX}
+ fi
+
+fi # input data and outputs
+#
+########################################################################
+#
+# Summary: end
+#
+if [ "$PREPROCESS_ERROR" = "true" ] ; then
+ EXEC_PREPROCESS="failed"
+fi
+echo " Preprocessing : " $EXEC_PREPROCESS >>$summary
+if [ "$PARTITION_ERROR" = "true" ] ; then
+ EXEC_PARTITION="failed"
+fi
+echo " Partitioning : " $EXEC_PARTITION >>$summary
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ EXEC_KERNEL="failed"
+fi
+echo " Calculation : " $EXEC_KERNEL >>$summary
+#
+CURDATE=`unset LANG ; date`
+#
+echo ' ----------------------------------------------------' >>$summary
+echo ' Finish time : ' $CURDATE >>$summary
+echo '========================================================'>>$summary
+#
+cp $summary $RESU/$summary.$SUFFIX
+#
+########################################################################
+#
+#
+# Finish
+#
+echo
+echo " ********************************************"
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ echo " Error in calculation stage."
+elif [ "$PARTITION_ERROR" = "true" ] ; then
+ echo " Error in partitioning stage."
+elif [ "$PREPROCESS_ERROR" = "true" ] ; then
+ echo " Error in preprocessing stage."
+else
+ echo " Normal simulation finish"
+fi
+echo " ********************************************"
+
+if [ "$ERROR" = "true" ] ; then
+ exit 1
+else
+ exit 0
+fi
+#
+########################################################################
diff --git a/bin/runcase_coupling.in b/bin/runcase_coupling.in
new file mode 100644
index 0000000..e087b6a
--- /dev/null
+++ b/bin/runcase_coupling.in
@@ -0,0 +1,1029 @@
+#!/bin/bash
+# @configure_input@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# BATCH FILE FOR THE CCRT (Platine under LSF)
+# ===========================================
+#
+#BSUB -n 2
+#BSUB -W 00:05
+#BSUB -o nameandcaseo.%J
+#BSUB -e nameandcasee.%J
+#BSUB -J nameandcase
+#
+# -n : number of processors
+# -W : walltime as hh:mm
+# -o : output file name
+# -e : error file name
+# -J : job name
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE FOR THE Chatou CLUSTER (PBS)
+# =======================================
+#
+#PBS -l nodes=4:ppn=2
+#PBS -l walltime=1:00:00
+#PBS -l mem=320mb
+#
+#PBS -j eo
+#PBS -N nameandcase
+#
+# nodes : number of nodes
+# ppn : number of process per node
+# walltime : wall clock time (hh:mm:ss)
+# mem : memory
+#
+#WARNING: when coupling with SYRTHES, 1 processor will be reserved for each
+# instance of SYRTHES. The Kernel will be executed on the remaining
+# processors, so make sure to reserve a sufficiently high number
+# of processors.
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (University of Manchester Cluster)
+# =============================================
+#
+# set the name of the job
+##$ -N nameandcase
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (AIX, Loadlever)
+# ===========================
+#
+#@ shell = /bin/sh
+#
+#@ job_name = nameandcase
+#
+#@ job_type = parallel
+#@ cpus = 128
+#@ node_usage = not_shared
+#
+#@ network.MPI = csss,shared,US
+#@ bulkxfer = yes
+#
+#@ wall_clock_limit = 00:20:00
+#@ account_no = z001
+#
+#@ output = $(job_name).$(schedd_host).$(jobid).out
+#@ error = $(job_name).$(schedd_host).$(jobid).err
+#@ notification = never
+#
+#@ queue
+# suggested environment settings:
+# export MP_EAGER_LIMIT=65536
+# export MP_SHARED_MEMORY=yes
+# export MEMORY_AFFINITY=MCM
+# export MP_TASK_AFFINITY=MCM
+#
+########################################################################
+#
+# BEGINNING OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+# runcase.help gives more details about the different variables.
+#
+# -------------------------------
+#
+NB_INSTANCES=2
+#
+# On some systems, some external libraries may require TERM to be defined.
+export TERM=xterm
+#
+STUDY=STUDYNAME
+CASE=CASENAME
+#
+# Parameters for the 1st instance
+# -------------------------------
+PARAM_1=
+MESH_1=
+COMMAND_REORIENT_1=
+COMMAND_JOIN_1=
+COMMAND_CWF_1=
+COMMAND_PERIO_1=
+THERMOCHEMISTRY_DATA_1=
+METEO_DATA_1=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS_1=1
+PROCESSOR_LIST_1=
+#
+PARTITION_LIST_1=
+#
+USER_INPUT_FILES_1=""
+USER_OUTPUT_FILES_1=""
+#
+# Parameters for the 2nd instance
+# -------------------------------
+PARAM_2=
+MESH_2=
+COMMAND_REORIENT_2=
+COMMAND_JOIN_2=
+COMMAND_CWF_2=
+COMMAND_PERIO_2=
+THERMOCHEMISTRY_DATA_2=
+METEO_DATA_2=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS_2=1
+PROCESSOR_LIST_2=
+#
+PARTITION_LIST_2=
+#
+USER_INPUT_FILES_2=""
+USER_OUTPUT_FILES_2=""
+#
+# Global parameters
+# -----------------
+# Working directory (leave empty for automatic default directory)
+CS_TMP_PREFIX=
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+CS_LIB_ADD=
+VALGRIND=
+#
+ARG_CS_VERIF=""
+ARG_CS_OUTPUT=""
+ECHOCOMM=""
+#
+summary=summary
+CASEDIR=CASEDIRNAME
+#DATA=$CASEDIR/DATA
+RESU=$CASEDIR/RESU
+#SRC=$CASEDIR/SRC
+SCRIPTS=$CASEDIR/SCRIPTS
+#RESTART_IN=$DATA/RESTART
+#PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+#PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+MESHDIR=$CASEDIR/../MESH
+#
+# Indicate which steps should be executed; if both the Preprocessor and the
+# Kernel are executed, the "preprocessor_output" and eventual "domain_number_*"
+# files are not saved. If only the preprocessor and / or partitioner are
+# executed, the corresponding files will be saved in a RESU/PREPROCESSOR_OUTPUT
+# and RESU/PARTITION directory. If the Preprocessor is not executed,
+# "preprocessor_output" will be read from $PREPROCESSOR_OUTPUT_IN. If the
+# Partitioner is not executed, "domain_number_*" will be read from
+# $PARTITION_OUTPUT_IN if available (otherwise, unoptimized default
+# partitioning will be used).
+#
+# EXEC_PREPROCESS : should the Preprocessor be run ? (yes/no)
+# EXEC_PARTITION : should the Partitioner be run ? (yes/no)
+# EXEC_KERNEL : should the Kernel be run ? (yes/no)
+#
+EXEC_PREPROCESS=yes
+EXEC_PARTITION=yes
+EXEC_KERNEL=yes
+#
+#
+#
+########################################################################
+#
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Kernel installation parameters
+#
+prefix=@prefix@
+#
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+datarootdir=@datarootdir@
+datadir=@datadir@
+pkgdatadir=${datadir}/@PACKAGE@
+#
+# Preprocessor installation parameters
+#
+ecs_prefix=@ecs_prefix@
+#
+ecs_exec_prefix=${ecs_prefix}
+ecs_bindir=${ecs_exec_prefix}/bin
+#
+########################################################################
+#
+# Parameters for execution
+#
+# General variables
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIX=$DATE
+EXE=cs_solver
+#
+# Copy runcase before changing to the working directory
+# (as after that, the relative path will not be up to date).
+#
+cp $0 $RESU/runcase.$SUFFIX
+#
+# Execution directory (reachable by all the processors)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+else
+# Default if not specified by the user
+#
+# On the CCRT, there is no TMPDIR. We work by default in SCRATCHDIR
+ if [ "$SCRATCHDIR" != "" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+ else
+ RUN=$HOME/tmp_Saturne/$STUDY.$CASE.$DATE
+ fi
+fi
+#
+# Create directory if necessary
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "RUN=$RUN already exists."
+ echo "The simulation will not be run."
+ exit 1
+ fi
+fi
+#
+cd $RUN
+#
+# Create a working directory for each instance
+I=0
+while [ $I -lt $NB_INSTANCES ]; do
+ (( I=I+1 ))
+ mkdir RUN.$I || exit 1
+done
+#
+########################################################################
+#
+# Set up MPI environment
+#
+# Use makefile query to obtain the path to MPI binaries if those are
+# not on the default path. This is a peculiar use of make, but allows
+# us to avoid defining the MPI configuration in multiple files.
+
+CS_MPI_PATH=@MPI_BIN@
+
+N_PROCS=0
+I=0
+while [ $I -lt $NB_INSTANCES ]; do
+ (( I=I+1 ))
+ N_PROCS=`eval echo '$NUMBER_OF_PROCESSORS_'$I`
+ (( NUMBER_OF_PROCESSORS=NUMBER_OF_PROCESSORS+$N_PROCS ))
+done
+
+# NUMBER_OF_PROCESSORS is determined here if not already set;
+# MPIHOSTS, MPIRUN, MPIBOOT, MPIHALT, and NUMBER_OF_NODES are
+# defined by the sourced script, and PATH may be updated.
+#
+. ${pkgdatadir}/runcase_mpi_env
+#
+echo
+echo
+#
+echo "Coupling of several Code_Saturne executables activated."
+#
+########################################################################
+# Greeting message
+#
+echo ' '
+echo ' Code_Saturne is running '
+echo ' *********************** '
+echo ' '
+echo ' Working directory (to be periodically cleaned) : '
+echo ' ' $RUN
+#
+########################################################################
+#
+# Compilation and link
+#
+# Note: we also check the for the presence of certain user subroutines here.
+#
+echo
+echo ' Kernel version: ' $prefix
+echo ' Preprocessor version: ' $ecs_prefix
+
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+I=0
+while [ $I -lt $NB_INSTANCES ]; do
+ (( I=I+1 ))
+
+ cur_dir=$RUN/RUN.$I
+ cd $cur_dir
+
+ PARAM=`eval echo '$PARAM_'$I`
+ SRC=$CASEDIR/SRC.$I
+
+ source_cas=$SRC
+
+ #
+ # Copy of the parameter file
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMAND_PARAM="--param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The parameters file ' $var
+ echo ' can not be accessed.'
+ exit 1
+ fi
+ fi
+
+ src_files=`ls ${source_cas}/*.[fF]90 ${source_cas}/*.[ch] 2>/dev/null`
+
+ if [ ! -z "${src_files}" ] ; then
+
+if [ $I -eq 1 ]; then
+ echo
+ echo " ***************************************************************"
+ echo " Compilation of user subroutines and linking of Code_Saturne"
+ echo " ***************************************************************"
+fi
+
+ if [ -f compil.log ] ; then
+ rm -f compil.log
+ fi
+
+ src_dir="src_saturne"
+
+ # Copy of the user source files
+ # (no links: the directory is copied later)
+ mkdir ${src_dir}
+ for f in ${src_files} ; do
+ if [ -f $f ] ; then
+ cp ${f} ${src_dir}/
+ fi
+ done
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --source=$src_dir --param=$PARAM
+ else
+ ${bindir}/cs check_consistency
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ # Compilation
+ if [ ! -z "${CS_LIB_ADD}" ] ; then
+ OPTLIBS="--opt-libs=${CS_LIB_ADD}"
+ fi
+ ${bindir}/cs compile \
+ --source=$src_dir ${OPTLIBS} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$I.$SUFFIX
+ echo "COMPILE OR LINK ERROR"
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$I.$SUFFIX
+ fi
+
+ else
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --param=$PARAM
+ else
+ ${bindir}/cs check_consistency
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ ln -s ${bindir}/$EXE .
+
+ fi
+
+done
+
+fi # EXEC_KERNEL = yes
+
+#
+########################################################################
+#
+# Data setup
+#
+echo
+echo " ********************************************"
+echo " Preparing calculation "
+echo " ********************************************"
+echo
+#
+ERROR=false
+PREPROCESS_ERROR=false
+PARTITION_ERROR=false
+EXECUTION_ERROR=false
+#
+I=0
+while [ $I -lt $NB_INSTANCES ]; do
+#
+ (( I=I+1 ))
+#
+ cur_dir=$RUN/RUN.$I
+ cd $cur_dir
+#
+
+ MESH=`eval echo '$MESH_'$I`
+ COMMAND_JOIN=`eval echo '$COMMAND_JOIN_'$I`
+ COMMAND_CWF=`eval echo '$COMMAND_CWF_'$I`
+ COMMAND_PERIO=`eval echo '$COMMAND_PERIO_'$I`
+
+ nproc_kernel=`eval echo '$NUMBER_OF_PROCESSORS_'$I`
+
+ SRC=$CASEDIR/SRC.$I
+ DATA=$CASEDIR/DATA.$I
+ RESTART_IN=$DATA/RESTART_IN
+ PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+ PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ]
+then
+ for var in $MESH ; do
+ ln -s $MESHDIR/$var $var || exit 1
+ # Special case for meshes in EnSight format: link to .geo file necessary
+ # (retrieve name through .case file)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $MESHDIR/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+else
+ if [ -f ${PREPROCESSOR_OUTPUT_IN} ] ; then
+ ln -s ${PREPROCESSOR_OUTPUT_IN} preprocessor_output || exit 1
+ else
+ echo "Error: no preprocessor output file is available;"
+ echo " (${PREPROCESSOR_OUTPUT_IN} does not exist."
+ echo " or is not a standard file."
+ exit 1
+ fi
+fi
+#
+if [ $nproc_kernel -eq 1 -a "${EXEC_KERNEL}" = "yes" ] ; then
+ EXEC_PARTITION=no
+elif [ "${EXEC_PARTITION}" = "no" -a "${PARTITION_OUTPUT_IN}" != "" ]
+then
+ if [ -f ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} ] ; then
+ ln -s ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} .
+ else
+ echo "Warning: no partitioning file is available;"
+ echo " (no ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel})."
+ echo
+ echo " Unoptimized partitioning will be used."
+ echo " Parallel performance may be degraded."
+ fi
+fi
+#
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ THERMOCHEMISTRY_DATA=`eval echo '$THERMOCHEMISTRY_DATA_'$I`
+ METEO_DATA=`eval echo '$METEO_DATA_'$I`
+ USER_INPUT_FILES=`eval echo '$USER_INPUT_FILES_'$I`
+
+ for var in ${RESTART_IN}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = ctwava ] ; then
+ vara=ctwamo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "$THERMOCHEMISTRY_DATA" != "" ] ; then
+ var=$DATA/$THERMOCHEMISTRY_DATA
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # Copy so as to have correct name upon backup
+ if [ "$THERMOCHEMISTRY_DATA" != "dp_tch" ] ; then
+ cp dp_tch $THERMOCHEMISTRY_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The thermochemistry file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ if [ "$METEO_DATA" != "" ] ; then
+ var=$DATA/$METEO_DATA
+ if [ -f $var ] ; then
+ cp $var meteo
+ # Copy so as to have correct name upon backup
+ if [ "$METEO_DATA" != "meteo" ] ; then
+ cp meteo $METEO_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The meteo profile file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ for f in uscpcl.f90 usd3pc.f90 usebuc.f90 uslwcc.f90 usfucl.f90
+ do
+ if [ -f "${SRC}/${f}" -a ! -f JANAF ] ; then
+ cp ${datadir}/data/thch/JANAF JANAF
+ fi
+ done
+ #
+ if [ ! -z "$USER_INPUT_FILES" ] ; then
+ for f in $USER_INPUT_FILES ; do
+ cp $DATA/$f .
+ done
+ fi
+ #
+fi # EXEC_KERNEL = yes
+
+if [ $I -eq 1 ]; then
+########################################################################
+# Maximum time for PBS (done here so as to leave time for PBS to
+# realize that things have started).
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Summary: start
+#
+CURDATE=`unset LANG ; date`
+#
+echo '========================================================'>>$summary
+echo ' Start time : ' $CURDATE >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Kernel : ' $prefix >>$summary
+echo ' Preprocessor : ' $ecs_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' HOMARD : ' $homard_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' CS_MPI_PATH : ' $CS_MPI_PATH >>$summary
+echo ' PATH : ' $PATH >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' User : ' $USER >>$summary
+echo '========================================================'>>$summary
+echo ' Machine : ' >>$summary
+ uname -a >>$summary
+if [ -z "$NUMBER_OF_PROCESSORS" ] ; then
+ echo ' N Procs : ' 1 >>$summary
+else
+ echo ' N Procs : ' $NUMBER_OF_PROCESSORS >>$summary
+fi
+if [ -z "$PROCESSOR_LIST" ] ; then
+ echo ' Processors : ' default >>$summary
+else
+ echo ' Processors : ' $PROCESSOR_LIST >>$summary
+fi
+echo '========================================================'>>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Case : ' $CASE >>$summary
+echo ' DATA : ' $DATA >>$summary
+echo ' SRC : ' $SRC >>$summary
+echo ' RESU : ' $RESU >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Exec. dir. : ' $RUN >>$summary
+echo ' ----------------------------------------------------' >>$summary
+if [ "$EXEC_PREPROCESSOR" = "yes" ] ; then
+ echo ' Preprocessor : ' ${ecs_bindir}/cs_preprocess >>$summary
+fi
+if [ "$EXEC_PARTITION" = "yes" ] ; then
+ echo ' Partitioner : ' ${ecs_bindir}/cs_partition >>$summary
+fi
+if [ "$EXEC_KERNEL" = "yes" ] ; then
+ echo ' Executable : ' $EXE >>$summary
+fi
+echo ' ----------------------------------------------------' >>$summary
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Starting calculation"
+echo " ********************************************"
+echo
+fi
+#
+# Preprocessor start
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ] ; then
+ #
+ ${ecs_bindir}/cs_preprocess --mesh $MESH "--case" $CASE \
+ $COMMAND_REORIENT $COMMAND_JOIN $COMMAND_PERIO \
+ > listpre 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error running the preprocessor."
+ echo "Check preprocessor log (listpre) for details."
+ echo
+ PREPROCESS_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PREPROCESSOR_OUTPUT_OUT=$RESU/preprocessor_output.$SUFFIX
+ cp preprocessor_output ${PREPROCESSOR_OUTPUT_OUT}
+ fi
+ #
+fi
+#
+# Partitioner start
+#
+if [ ! -f ${ecs_bindir}/cs_partition ] ; then
+ echo "Warning: ${ecs_bindir}/cs_partition not found."
+ echo
+ echo "The partitioner may not have been installed"
+ echo " (this is the case if neither METIS nor."
+ echo " SCOTCH are avaialable)."
+ echo
+ echo "Unoptimized partitioning will be used, so"
+ echo "parallel performance may be degraded."
+ echo
+ EXEC_PARTITION=no
+fi
+#
+if [ "${EXEC_PARTITION}" = "yes" ] ; then
+ #
+ if [ "${EXEC_KERNEL}" = "yes" ] ; then
+ ${ecs_bindir}/cs_partition $nproc_kernel > listpart 2>&1
+ else
+ if [ -z "$PARTITION_LIST" ] ; then
+ echo "Error running the partitioner."
+ echo "PARTITION_LIST is not set."
+ echo "This variable should contain the number of processors"
+ echo "for which we partition (or a list of such numbers)."
+ PARTITION_ERROR=true
+ ERROR=true
+ else
+ ${ecs_bindir}/cs_partition $PARTITION_LIST > listpart 2>&1
+ fi
+ fi
+ if [ $? != 0 -a $PARTITION_ERROR = false ] ; then
+ echo "Error running the partitioner."
+ echo "Check partitioner log (listpart) for details."
+ echo
+ PARTITION_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PARTITION_OUTPUT_OUT=$RESU/PARTITION_OUTPUT.$SUFFIX
+ mkdir $PARTITION_OUTPUT_OUT
+ cp -r domain_number_* ${PARTITION_OUTPUT_OUT}/
+ fi
+#
+fi
+done
+#
+# Run calculation proper.
+#
+if [ "$ERROR" != "true" -a "$EXEC_KERNEL" = "yes" ] ; then
+#
+NB_TOT=0
+I=0
+while [ $I -lt $NB_INSTANCES ]; do
+ (( I=I+1 ))
+ cur_dir=$RUN/RUN.$I
+
+ COMMAND_CWF=`eval echo '$COMMANDE_CWF_'$I`
+ NUMBER_OF_PROCESSORS=`eval echo '$NUMBER_OF_PROCESSORS_'$I`
+ (( NB_TOT=NB_TOT+$NUMBER_OF_PROCESSORS ))
+ #
+ cd $RUN
+
+ RUNCS="$VALGRIND $cur_dir/$EXE --mpi $I \
+ $COMMAND_CWF $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM"
+ CMD="cd $cur_dir && $RUNCS"
+
+ # MPI Communication
+ #
+ # Make sure to transmit possible additional arguments assigned by mpirun to
+ # the executable with some MPI-1 implementations (vanilla MPICH 1.2 sets the
+ # parameters needed by MPI_Init through argc/argv): we use $@ to forward
+ # arguments passed to localexec to the true executable files.
+ #
+ localexec=$RUN/localexec
+ if [ $I -eq 1 ]; then
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`${pkgdatadir}/runcase_mpi_rank \$@\`" >> $localexec
+ echo "if [ \$MPI_RANK -lt $NB_TOT ] ; then" >> $localexec
+ echo " $CMD" >> $localexec
+ elif [ $I -lt $NB_INSTANCES ]; then
+ echo "elif [ \$MPI_RANK -lt $NB_TOT ] ; then" >> $localexec
+ echo " $CMD" >> $localexec
+ else
+ echo "else" >> $localexec
+ echo " $CMD" >> $localexec
+ echo "fi" >> $localexec
+ fi
+ chmod 700 $localexec
+
+done
+
+$MPIBOOT
+$MPIRUN $localexec || EXECUTION_ERROR=true
+$MPIHALT
+
+fi
+#
+########################################################################
+#
+# Treatment of the ouput files:
+# Starts with the restart files
+# (in case of full disk, increases chances of being able to continue).
+#
+I=0
+while [ $I -lt $NB_INSTANCES ]; do
+ (( I=I+1 ))
+#
+ SUFFIX=$I.$DATE
+#
+ cur_dir=$RUN/RUN.$I
+ cd $cur_dir
+
+ USER_OUTPUT_FILES=`eval echo '$USER_OUTPUT_FILES_'$I`
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ RESTART_OUT=$RESU/RESTART.$SUFFIX
+ iok=1
+ mkdir ${RESTART_OUT} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in suiava suiavx t1dava ctwava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f ${RESTART_OUT}
+ fi
+ done
+ else
+ for f in suiava suiavx t1dava ctwava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+
+ resuser=0
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIX
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f ${RES_USER}
+ fi
+ done
+ else
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+ fi
+
+ for f in $PARAM $THERMOCHEMISTRY_DATA $METEO_DATA ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+
+ for f in probes_*.dat ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+ for f in ush* ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+
+fi # output files
+
+for f in list* error* *.med *.cgns ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+done
+
+# Treatment of EnSight and MED files
+# The $dir (=*.ensight and/or *.med) directories are copied
+# to $DIR.$SUFFIX
+
+# We place directories $dir (=*.ensight and/or *.med)
+# in $DIR.$SUFFIX
+
+cas=`echo $CASE |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Creating $RESU/$DIR.$SUFFIX failed
+ else
+ for f in $dir/* ; do
+ if [ -f $f ] ; then
+ cp -R ${f} $RESU/$DIR.$SUFFIX/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ rayt_list=`ls bord* 2>/dev/null`
+ if [ ! -z "${rayt_list}" ] ; then
+ for f in $rayt_list ; do
+ if [ ! -d $RESU/CHR.$SUFFIX ] ; then
+ mkdir $RESU/CHR.$SUFFIX
+ fi
+ cp $f $RESU/CHR.$SUFFIX/.
+ done
+ fi
+
+ lagr_list=`ls debug* deplacement* trajectoire* frontiere* 2>/dev/null`
+ if [ ! -z "${lagr_list}" ] ; then
+ mkdir $RESU/LAGR.$SUFFIX
+ for f in $lagr_list ; do
+ cp $f $RESU/LAGR.$SUFFIX
+ done
+ fi
+
+ # Matisse output files
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # The date is added to the first line of resuMatisse
+ AFDATE="Date of the case : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIX
+ fi
+
+ for dir in src_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/SRC.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Failure creating $RESU/SRC.$SUFFIX
+ else
+ for f in $dir/*.[fF]90 $dir/*.[ch] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} $RESU/SRC.$SUFFIX/.
+ fbase=`basename ${f}`
+ chmod a-w $RESU/SRC.$SUFFIX/${fbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+fi # input data and outputs
+done
+#
+########################################################################
+#
+# Summary: end
+#
+if [ "$PREPROCESS_ERROR" = "true" ] ; then
+ EXEC_PREPROCESS="failed"
+fi
+echo " Preprocessing : " $EXEC_PREPROCESS >>$summary
+if [ "$PARTITION_ERROR" = "true" ] ; then
+ EXEC_PARTITION="failed"
+fi
+echo " Partitioning : " $EXEC_PARTITION >>$summary
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ EXEC_KERNEL="failed"
+fi
+echo " Calculation : " $EXEC_KERNEL >>$summary
+#
+CURDATE=`unset LANG ; date`
+#
+echo ' ----------------------------------------------------' >>$summary
+echo ' Finish time : ' $CURDATE >>$summary
+echo '========================================================'>>$summary
+#
+cp $summary $RESU/$summary.$SUFFIX
+#
+########################################################################
+#
+#
+# Finish
+#
+echo
+echo " ********************************************"
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ echo " Error in calculation stage."
+elif [ "$PARTITION_ERROR" = "true" ] ; then
+ echo " Error in partitioning stage."
+elif [ "$PREPROCESS_ERROR" = "true" ] ; then
+ echo " Error in preprocessing stage."
+else
+ echo " Normal simulation finish"
+fi
+echo " ********************************************"
+
+if [ "$ERROR" = "true" ] ; then
+ exit 1
+else
+ exit 0
+fi
+#
+########################################################################
diff --git a/bin/runcase_mpi_env b/bin/runcase_mpi_env
new file mode 100755
index 0000000..4532e96
--- /dev/null
+++ b/bin/runcase_mpi_env
@@ -0,0 +1,165 @@
+#!/bin/sh
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+# Setup MPI environment, using the optional NUMBER_OF_PROCESSORS and
+# PROCESSOR_LIST environment variables, as well as other system-specific
+# environment variables.
+#
+if [ -f "$TMPDIR/machines" ] ; then # Univ Manchester queueing system
+ MPIHOSTS="$TMPDIR/machines"
+elif [ ! -z "$PBS_NODEFILE" ] ; then # PBS queueing system
+ MPIHOSTS="$PBS_NODEFILE"
+elif [ ! -z "$LSB_HOSTS" ] ; then # LSF queueing system
+ \rm -f $RUN/hostsfile
+ echo $LSB_HOSTS | awk '{ for (ii = 1; ii < NF+1; ++ii) print $ii }' >> $RUN/hostsfile
+ MPIHOSTS="$RUN/hostsfile"
+elif [ ! -z "$PROCESSOR_LIST" ] ; then
+ \rm -f $RUN/hostsfile
+ localproc=`hostname`
+ echo $PROCESSOR_LIST | grep -q $localproc || PROCESSOR_LIST="$localproc & $PROCESSOR_LIST"
+ echo $PROCESSOR_LIST | awk -F\& '{ for (ii = 1; ii < NF+1; ++ii) print $ii }' >> $RUN/hostsfile
+ MPIHOSTS="$RUN/hostsfile"
+fi
+# Check for the number of processors
+if [ -z "${NUMBER_OF_PROCESSORS}" ] ; then
+ if [ ! -z "${NSLOTS}" ] ; then
+ # Univ Manchester queueing system
+ NUMBER_OF_PROCESSORS=$NSLOTS
+ elif [ ! -z "${SLURM_NPROCS}" ] ; then
+ # LSF queueing system with Slurm
+ NUMBER_OF_PROCESSORS=$SLURM_NPROCS
+ elif [ ! -z "${LSB_HOSTS}" ] ; then
+ # LSF queueing system without Slurm
+ NUMBER_OF_PROCESSORS=`echo $LSB_HOSTS | wc -w`
+ elif [ ! -z "${MPIHOSTS}" ] ; then
+ # PBS queueing system
+ NUMBER_OF_PROCESSORS=`cat $MPIHOSTS | wc -l`
+ else
+ NUMBER_OF_PROCESSORS=1
+ fi
+fi
+#
+# Check the number of nodes if possible
+NUMBER_OF_NODES=1
+if [ ! -z "${MPIHOSTS}" ] ; then
+ NUMBER_OF_NODES=`sort $MPIHOSTS | sed -e 's/:/ /' | cut -f 1 -d" " | uniq | wc -l`
+fi
+#
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "Total number of processors: $NUMBER_OF_PROCESSORS"
+fi
+#
+# System-related parameters
+#
+if [ $NUMBER_OF_PROCESSORS -gt 1 ] ; then
+#
+# Temporarily set the architecture name (for EDF purposes)
+ NOM_ARCH=`uname -s`
+ if [ "$NOM_ARCH" = "Linux" ] ; then
+ if [ "`domainname 2>/dev/null`" = "cluster-chatou" ] ; then
+ NOM_ARCH=Linux_Ch
+ elif [ -d /bgl/BlueLight/ppcfloor ] ; then
+ NOM_ARCH=Blue_Gene_L
+ elif [ -d /bgsys/drivers/ppcfloor ] ; then
+ NOM_ARCH=Blue_Gene_P
+ else
+ MACHINE=`uname -m`
+ case "$MACHINE" in
+ *86) NOM_ARCH=Linux ;;
+ x86_64) NOM_ARCH=Linux_x86_64 ;;
+ ia64) NOM_ARCH=Linux_IA64 ;;
+ *) NOM_ARCH=Linux_$MACHINE ;;
+ esac
+ fi
+ fi
+# Default values
+ MPIBOOT=""
+ MPIHALT=""
+ MPIRUN="mpirun -np ${NUMBER_OF_PROCESSORS}"
+ if [ -d "$CS_MPI_PATH" ] ; then
+ export PATH=${CS_MPI_PATH}:$PATH
+ fi
+#
+ if [ "$NOM_ARCH" = "OSF1" ] ; then
+ MPIRUN="prun -n ${NUMBER_OF_PROCESSORS} -stv"
+#
+ elif [ "$NOM_ARCH" = "Linux_CCRT" ] ; then
+ MPIRUN="mpirun -srun"
+#
+ elif [ "$NOM_ARCH" = "Linux_IA64" ] ; then
+ MPIRUN="srun -n ${NUMBER_OF_PROCESSORS}"
+#
+ elif [ "$NOM_ARCH" = "Linux_Ch" ] ; then
+ MPIRUN="mpirun -np ${NUMBER_OF_PROCESSORS} -machinefile $PBS_NODEFILE"
+#
+ elif [ "$NOM_ARCH" = "AIX" ] ; then
+ MPIRUN="poe"
+#
+ else
+ if [ -d "$CS_MPI_PATH" ] ; then
+ if [ -f "${CS_MPI_PATH}/mpdboot" ] ; then # For MPICH2
+ MPIBOOT="${CS_MPI_PATH}/mpdboot"
+ MPIHALT="${CS_MPI_PATH}/mpdallexit"
+ MPIRUN="${CS_MPI_PATH}/mpiexec -n ${NUMBER_OF_PROCESSORS}"
+ if [ ! -z "$MPIHOSTS" ] ; then
+ MPIBOOT="$MPIBOOT -n ${NUMBER_OF_NODES} -v -f $MPIHOSTS"
+ fi
+ elif [ -f "${CS_MPI_PATH}/ompi_info" ] ; then # For Open MPI
+ MPIRUN="${CS_MPI_PATH}/mpiexec -n ${NUMBER_OF_PROCESSORS}"
+ if [ ! -z "$MPIHOSTS" ] ; then
+ MPIRUN="$MPIRUN -machinefile $MPIHOSTS"
+ fi
+ elif [ -f "${CS_MPI_PATH}/lamboot" ] ; then # For LAM MPI
+ MPIBOOT="${CS_MPI_PATH}/lamboot"
+ MPIHALT="${CS_MPI_PATH}/lamhalt"
+ MPIRUN="${CS_MPI_PATH}/mpirun -np ${NUMBER_OF_PROCESSORS}"
+ if [ ! -z "$MPIHOSTS" ] ; then
+ MPIBOOT="$MPIBOOT -v $MPIHOSTS"
+ MPIHALT="$MPIHALT -v $MPIHOSTS"
+ fi
+ elif [ -f "${CS_MPI_PATH}/mpichversion" ] ; then # For MPICH
+ MPIRUN="${CS_MPI_PATH}/mpirun -np ${NUMBER_OF_PROCESSORS}"
+ if [ ! -z "$TMPDIR/machines" ] ; then # For Univ Manchester queueing system
+ MPIRUN="$MPIRUN -machinefile $TMPDIR/machines"
+ elif [ ! -z "$MPIHOSTS" ] ; then
+ MPIRUN="$MPIRUN -machinefile $MPIHOSTS"
+ fi
+ fi
+ fi
+ fi
+#
+# In serial mode
+#
+else
+#
+ MPIRUN=""
+ MPIBOOT=""
+ MPIHALT=""
+fi
+#
+
diff --git a/bin/runcase_mpi_rank b/bin/runcase_mpi_rank
new file mode 100755
index 0000000..b02132e
--- /dev/null
+++ b/bin/runcase_mpi_rank
@@ -0,0 +1,99 @@
+#!/bin/sh
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+# A priori detection of the rank of a MPI process
+#================================================
+#
+# In order to get the MPI rank from a script launched
+# by mpirun (or prun, mpijob, or equivalent):
+#
+# MPI_RANK=`cs_runcase_mpi_rank $@`
+#
+# Mainly useful to launch MPMD applications
+# like coupling within MPI 1.2 environment
+# which does not have a command like mpiexec
+# (or some appschemes as LAM)
+
+# On HP AlphaServer cluster (CCRT: Chrome)
+if [ "$RMS_RANK" != "" ] ; then
+ MPI_RANK="$RMS_RANK"
+
+# On Opteron or Itanium cluster under Linux with Slurm (CCRT: Platine, Tantale)
+elif [ "$SLURM_PROCID" != "" ] ; then
+ MPI_RANK="$SLURM_PROCID"
+
+# On Opteron cluster under Linux MPICH-GM (EDF Chatou cluster)
+elif [ "$GMPI_ID" != "" ] ; then
+ MPI_RANK="$GMPI_ID"
+
+# On EDF MFTT cluster under Linux with MPI Scali (SCI network)
+elif [ "$SCAMPI_PROCESS_PARAM" != "" ] ; then
+ MPI_RANK=`echo $SCAMPI_PROCESS_PARAM | cut -f4 -d' '`
+
+# For MPICH2 (it also provides the mpiexec command)
+elif [ "$PMI_RANK" != "" ] ; then
+ MPI_RANK="$PMI_RANK"
+
+# For Open MPI (it also provides the mpiexec command)
+elif [ "$OMPI_MCA_ns_nds_vpid" != "" ] ; then # Open MPI 1.2
+ MPI_RANK="$OMPI_MCA_ns_nds_vpid"
+elif [ "$OMPI_COMM_WORLD_RANK" != "" ] ; then # Open MPI 1.3
+ MPI_RANK="$OMPI_COMM_WORLD_RANK"
+
+# For LAM 7.1 (an appschema can also be used)
+elif [ "$LAMRANK" != "" ] ; then
+ MPI_RANK="$LAMRANK"
+
+# On IBM machine with MVAPICH (following a test "Computing on Demand")
+elif [ "$SMPIRUN_RANK" != "" ] ; then
+ MPI_RANK="$MPIRUN_RANK"
+
+# On cluster with HP-MPI (CCRT: Tantale, old system)
+elif [ "$MPI_PROC" != "" ] ; then
+ MPI_RANK=`echo $MPI_PROC | cut -f 2 -d,`
+
+# For "standard" MPICH 1.2 (with "usual" chp4 communication)
+else
+ MPI_RANK=0
+ next_arg_is_rank=""
+ for arg in "$@" ; do
+ if [ "$arg" = "-p4rmrank" ] ; then
+ next_arg_is_rank="1"
+ elif [ "$next_arg_is_rank" = "1" ] ; then
+ MPI_RANK="$arg"
+ next_arg_is_rank="0"
+ fi
+ done
+
+# End of known cases
+fi
+
+# Output of the obtained rank
+
+echo "$MPI_RANK"
+
diff --git a/bin/runcase_syrthes b/bin/runcase_syrthes
new file mode 100755
index 0000000..68b3153
--- /dev/null
+++ b/bin/runcase_syrthes
@@ -0,0 +1,326 @@
+#!/bin/sh
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+# Handle SYRTHES files when coupled: compile, copy data, or copy results
+#
+# Command-line arguments are described by the usage message below.
+#
+########################################################################
+
+# Indicate usage
+
+if [ "$1" = "" -o "$1" = "-h" -o "$1" = "--help" ] ; then
+ echo "Usage:"
+ echo
+ echo " $0 -compile -cs-bindir=<dir> [-src-syr=<dir>] [-copy-dir=<dir>]"
+ echo " [-log-dir=<dir>] [-exec-dir=<dir>]"
+ echo
+ echo " Indicate where to find Code_Saturne main user script:"
+ echo " -cs-bindir: directory where is installed Code_Saturne binaries."
+ echo
+ echo " Compile and link SYRTHES, with the following optional arguments:"
+ echo " -src-syr: source code directory; if none, link only."
+ echo " -src-copy: directory in which sources are copied."
+ echo " -log: file to which the compilation/link log is copied."
+ echo " -exec-dir: SYRTHES execution diretory."
+ echo
+ echo "or:"
+ echo
+ echo " $0 -copy-data -syrthes-env=<dir> [-exec-dir=<dir>]"
+ echo
+ echo " Copy data to execution directory based on syrthes.env file:"
+ echo " -syrthes-env: full pathname for syrthes.env file."
+ echo " -exec-dir: SYRTHES execution directory."
+ echo
+ echo "or:"
+ echo
+ echo " $0 -copy-results -result-dir=<dir> [-exec-dir=<dir>]"
+ echo
+ echo " Copy results to result directory:"
+ echo " -result-dir: directory in which results are saved."
+ echo " -exec-dir: SYRTHES execution directory."
+ echo
+ exit 0
+fi
+
+# Parse secondary arguments
+
+unset CS_BINDIR
+unset SRC_SYR
+unset EXEC_DIR
+unset RESULT_DIR
+unset SYRTHES_ENV
+
+for arg in $*
+do
+
+ is_cs_bindir=`echo $arg | grep -e "-cs-bindir="`
+ if [ "$is_cs_bindir" != "" ] ; then
+ CS_BINDIR=`echo $arg | sed -e "s/-cs-bindir=//"`
+ fi
+
+ is_exec_dir=`echo $arg | grep -e "-exec-dir="`
+ if [ "$is_exec_dir" != "" ] ; then
+ EXEC_DIR=`echo $arg | sed -e "s/-exec-dir=//"`
+ fi
+
+ is_src_syr=`echo $arg | grep -e "-src-syr="`
+ if [ "$is_src_syr" != "" ] ; then
+ SRC_SYR=`echo $arg | sed -e "s/-src-syr=//"`
+ fi
+
+ is_log=`echo $arg | grep -e "-log="`
+ if [ "$is_log" != "" ] ; then
+ LOG_COPY=`echo $arg | sed -e "s/-log=//"`
+ fi
+
+ is_src_copy=`echo $arg | grep -e "-src-copy="`
+ if [ "$is_src_copy" != "" ] ; then
+ SRC_COPY=`echo $arg | sed -e "s/-src-copy=//"`
+ fi
+
+ is_syrthes_env=`echo $arg | grep -e "-syrthes-env="`
+ if [ "$is_syrthes_env" != "" ] ; then
+ SYRTHES_ENV=`echo $arg | sed -e "s/-syrthes-env=//"`
+ fi
+
+ is_result_dir=`echo $arg | grep -e "-result-dir="`
+ if [ "$is_result_dir" != "" ] ; then
+ RESULT_DIR=`echo $arg | sed -e "s/-result-dir=//"`
+ fi
+
+done
+
+if [ "${EXEC_DIR}" = "" ]
+then
+ EXEC_DIR="."
+fi
+
+########################################################################
+
+if [ "$1" = "-compile" ] ; then
+
+ echo
+ echo " **********************************************************"
+ echo " Compilation of the user subroutines and link of SYRTHES"
+ echo " **********************************************************"
+
+ cur_dir=`pwd`
+ user_files=no
+ mkdir $EXEC_DIR/src_syrthes
+ cd $EXEC_DIR/src_syrthes
+ if [ "${SRC_SYR}" != "" ]
+ then
+ for f in $SRC_SYR/*.[F,c,h] ; do
+ if [ -f $f ] ; then
+ cp ${f} .
+ user_files=yes
+ fi
+ done
+ fi
+
+ ${CS_BINDIR}/cs compile --syrthes > ./compil.log 2>&1
+ make_ret=$?
+
+ if [ "${LOG_COPY}" != "" ] ; then
+ cp ./compil.log ${LOG_COPY}
+ fi
+
+ if [ $user_files = yes -a "${SRC_COPY}" != "" ] ; then
+ if [ ! -d ${SRC_COPY} ] ; then
+ mkdir ${SRC_COPY}
+ fi
+ if [ -d ${SRC_COPY} ] ; then
+ for f in *.[f,F,c,h] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} ${SRC_COPY}/
+ fbase=`basename ${f}`
+ # chmod a-w $RESULT_DIR/${fbase}
+ fi
+ done
+ fi
+ fi
+
+ if [ $make_ret -ne 0 ] ; then
+ echo "SYRTHES compile or link error."
+ exit 1
+ fi
+
+ mv syrthes $cur_dir/
+ cd $cur_dir
+
+fi
+
+########################################################################
+
+# Extract information from the syrthes.env file
+
+if [ "$1" = "-copy-data" -o "$1" = "-copy-results" ] ; then
+
+ if [ "$1" = "-copy-results" ] ; then
+ SYRTHES_ENV="${EXEC_DIR}/syrthes.env.ref"
+ if [ ! -f $SYRTHES_ENV ] ; then
+ SYRTHES_ENV="${EXEC_DIR}/syrthes.env"
+ fi
+ if [ ! -f $SYRTHES_ENV ] ; then
+ echo "No syrthes.env in ${EXEC_DIR}; no results copied."
+ exit 1
+ fi
+ elif [ ! -f $SYRTHES_ENV ] ; then
+ echo "No syrthes.env defined; no data copied."
+ exit 1
+ fi
+
+ SYR_IN=`grep "AMONT :" $SYRTHES_ENV | awk -F: '{print $NF}' | sed -e "s/ //g"`
+ SYR_OUT=` grep "AVAL :" $SYRTHES_ENV | awk -F: '{print $NF}' | sed -e "s/ //g"`
+ SYR_RESTART=`grep "SUITE :" $SYRTHES_ENV | awk -F: '{print $NF}' | sed -e "s/ //g"`
+ SYRTHES_DATA=`grep "DONNEES DU CALCUL :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_GEOM=`grep "GEOMETRIE SOLIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_SUIT=`grep "SUITE SOLIDE RESU :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_DATA_RAY=`grep "DONNEES POUR LE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_MAIL_RAY=`grep "MAILLAGE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_CORR=`grep "STOCKAGE DES CORRESPONDANTS :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_FFOR_RAY=`grep "FACTEURS DE FORME RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_CORR_RAY=`grep "STOCKAGE DES CORRESPONDANTS RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_OUT_RES1=`grep "RESU SYRTHES 1 :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_OUT_RES2=`grep "RESU SYRTHES 2 :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_OUT_CHR2=`grep "CHRONO SYRTHES 2 :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_OUT_HIST=`grep "HISTORIQUE SOLIDE RESULTAT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_OUT_MAIL_PEAU_FLUIDE=`grep "MAILLAGE PEAU FLUIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_OUT_RESU_PEAU_FLUIDE=`grep "RESULTATS PEAU FLUIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_OUT_CHR_PEAU_FLUIDE=`grep "CHRONO PEAU FLUIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+
+ # if empty, we use default names for results:
+ if [ -z "$SYRTHES_CORR" ] ; then
+ SYRTHES_CORR="corresp"
+ fi
+ if [ -z "$SYRTHES_CORR_RAY" ] ; then
+ SYRTHES_CORR_RAY="corresp_ray"
+ fi
+ if [ -z "$SYRTHES_FFOR_RAY" ] ; then
+ SYRTHES_FFOR_RAY="fdf_ray"
+ fi
+ if [ -z "$SYRTHES_OUT_RES1" ] ; then
+ SYRTHES_OUT_RES1="geoms"
+ fi
+ if [ -z "$SYRTHES_OUT_RES2" ] ; then
+ SYRTHES_OUT_RES2="resus"
+ fi
+ if [ -z "$SYRTHES_OUT_CHR2" ] ; then
+ SYRTHES_OUT_CHR2="chronos"
+ fi
+ if [ -z "$SYRTHES_OUT_HIST" ] ; then
+ SYRTHES_OUT_HIST="histos"
+ fi
+ if [ -z "$SYRTHES_OUT_MAIL_PEAU_FLUIDE" ] ; then
+ SYRTHES_OUT_MAIL_PEAU_FLUIDE="geomf_ef"
+ fi
+ if [ -z "$SYRTHES_OUT_RESU_PEAU_FLUIDE" ] ; then
+ SYRTHES_OUT_RESU_PEAU_FLUIDE="resuf_ef"
+ fi
+ if [ -z "$SYRTHES_OUT_CHR_PEAU_FLUIDE" ] ; then
+ SYRTHES_OUT_CHR_PEAU_FLUIDE="chronof_ef"
+ fi
+ if [ -z "$SYRTHES_OUT_MAIL_RAY" ] ; then
+ SYRTHES_OUT_MAIL_RAY="resu_ray.geom"
+ fi
+ if [ -z "$SYRTHES_OUT_RESU_RAY" ] ; then
+ SYRTHES_OUT_RESU_RAY="resu_ray"
+ fi
+ if [ -z "$SYRTHES_OUT_CHR_RAY" ] ; then
+ SYRTHES_OUT_CHR_RAY="chrono_ray"
+ fi
+ if [ -z "$SYRTHES_OUT_HIST_RAY" ] ; then
+ SYRTHES_OUT_HIST_RAY="histor"
+ fi
+
+fi
+
+########################################################################
+
+# Build a local copy of the syrthes.env file in which all files are
+# local. The initial file is backed-up so that it may be copied with
+# results afterwards.
+
+if [ "$1" = "-copy-data" ] ; then
+
+ cp $SYRTHES_ENV ${EXEC_DIR}/syrthes.env.ref
+
+ sed -e "s/:.*\//: /" \
+ -e "s/AMONT :.*/AMONT : .\//" \
+ -e "s/AVAL :.*/AVAL : .\//" \
+ -e "s/SUITE :.*/SUITE : .\//" \
+ ${SYRTHES_ENV} > ${EXEC_DIR}/syrthes.env.tmp
+
+ mv ${EXEC_DIR}/syrthes.env.tmp ${EXEC_DIR}/syrthes.env
+
+ # Transfer SYRTHES files
+
+ for var in $SYRTHES_DATA $SYRTHES_GEOM $SYRTHES_SUIT $SYRTHES_DATA_RAY $SYRTHES_MAIL_RAY ; do
+ cp $SYR_IN/$var $EXEC_DIR/`echo $var | sed -e "s/.*\///"`
+ done
+ for var in $SYRTHES_CORR $SYRTHES_FFOR_RAY $SYRTHES_CORR_RAY ; do
+ cp $SYR_RESTART/$var $EXEC_DIR/`echo $var | sed -e "s/.*\///"`
+ done
+
+fi
+
+########################################################################
+
+if [ "$1" = "-copy-results" ] ; then
+
+ if [ "${RESULT_DIR}" = "" ] ; then
+ echo "No result directory defined; no results copied."
+ exit 1
+ elif [ "${RESULT_DIR}" = "${EXEC_DIR}" ] ; then
+ exit 0
+ fi
+
+ if [ ! -d "${RESULT_DIR}" ] ; then
+ mkdir $RESULT_DIR
+ if [ $? -ne 0 ] ; then
+ echo Failure creating ${RESULT_DIR}
+ exit 1
+ fi
+ fi
+ for var in $SYRTHES_ENV $SYRTHES_DATA $SYRTHES_DATA_RAY \
+ $SYRTHES_CORR $SYRTHES_CORR_RAY $SYRTHES_FFOR_RAY \
+ $SYRTHES_OUT_RES1 $SYRTHES_OUT_RES2 $SYRTHES_OUT_CHR2 \
+ $SYRTHES_OUT_HIST \
+ $SYRTHES_OUT_MAIL_PEAU_FLUIDE $SYRTHES_OUT_RESU_PEAU_FLUIDE \
+ $SYRTHES_OUT_CHR_PEAU_FLUIDE \
+ $SYRTHES_OUT_MAIL_RAY $SYRTHES_OUT_RESU_RAY \
+ $SYRTHES_OUT_CHR_RAY \
+ $SYRTHES_OUT_HIST_RAY ; do
+ f=$EXEC_DIR/`basename $var`
+ if [ -f $f ] ; then
+ cp $f ${RESULT_DIR}/
+ fi
+ done
+
+fi
diff --git a/config/config.guess b/config/config.guess
new file mode 100755
index 0000000..ca2a03c
--- /dev/null
+++ b/config/config.guess
@@ -0,0 +1,1526 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-08'
+
+# This file 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., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per at bothner.com>.
+# Please send patches to <config-patches at gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel at ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes at openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf at swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/config.rpath b/config/config.rpath
new file mode 100755
index 0000000..c547c68
--- /dev/null
+++ b/config/config.rpath
@@ -0,0 +1,666 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2007 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix4* | aix5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ library_names_spec='$libname.a'
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd1*)
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_os" in
+ freebsd[123]*)
+ library_names_spec='$libname$shrext$versuffix' ;;
+ *)
+ library_names_spec='$libname$shrext' ;;
+ esac
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ nto-qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/config/config.sub b/config/config.sub
new file mode 100755
index 0000000..6759825
--- /dev/null
+++ b/config/config.sub
@@ -0,0 +1,1658 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-16'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file 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., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/cs_auto_flags.sh b/config/cs_auto_flags.sh
new file mode 100644
index 0000000..67b7f75
--- /dev/null
+++ b/config/cs_auto_flags.sh
@@ -0,0 +1,858 @@
+# Shell script
+
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# This file should be sourced by configure, and sets the following
+# environment variables corresponding to the recommended settings for a
+# given OS/CPU/compiler combination:
+#
+# cppflags_default # Base CPPFLAGS (default: "")
+
+# cflags_default # Base CFLAGS (default: "")
+# cflags_default_dbg # Added to $CFLAGS for debugging (default: "-g")
+# cflags_default_opt # Added to $CFLAGS for optimization (default: "-O")
+# cflags_default_hot # Optimization for specific files (default: "-O")
+# cflags_default_prf # Added to $CFLAGS for profiling (default: "")
+# cflags_default_omp # Added to $CFLAGS for OpenMP (default: "")
+# cflags_default_ext # Added to $CFLAGS for extended (default: "")
+# # precision if available
+
+# fcflags_default # Base FCFLAGS (default: "")
+# fcflags_default_dbg # Added to $FCFLAGS for debugging (default: "-g")
+# fcflags_default_opt # Added to $FCFLAGS for optimization (default: "-O")
+# fcflags_default_hot # Optimization for specific files (default: "-O")
+# fcflags_default_prf # Added to $FCFLAGS for profiling (default: "")
+# fcflags_default_omp # Added to $FCFLAGS for OpenMP (default: "")
+#
+# ldflags_default # Base LDFLAGS (default: "")
+# ldflags_default_dbg # Added to $LDFLAGS for debugging (default: "-g")
+# ldflags_default_opt # Added to $LDFLAGS for optimization (default: "-O")
+# ldflags_default_prf # Added to $LDFLAGS for profiling (default: "")
+# ldflags_rpath # Added to $LDFLAGS for shared libs (default: "")
+
+# libs_default # Base LIBS (default: "")
+# libs_default_dbg # Added to $LDFLAGS for debugging (default: "")
+# libs_default_opt # Added to $LDFLAGS for optimization (default: "")
+# libs_default_prf # Added to $LDFLAGS for profiling (default: "")
+
+# cs_disable_shared # Disable shared librairies (default: "")
+
+# Two other environment variable strings are defined, containing possibly
+# more detailed compiler information:
+#
+# cs_ac_cc_version # Compiler version string, 1 line max.
+# cs_ac_cc_version_full # Compiler version string, 10 lines max.
+
+# The sourcing approach and some tests are borrowed from the HDF5 configure
+# environment.
+#
+# We choose to source this script rather than use a more classical m4 macro
+# for this functionality, so that a user may more easily modify
+# default compiler options or port to a new machine without requiring
+# any advanced knowledge of autoconf or m4 macros, or installation of
+# an autoconf environment on the target machine.
+
+# Initialize local variables
+#---------------------------
+
+outfile=cs_ac_env-tmp
+
+# Some compilers require a file to compile even for version info.
+
+cat > conftest.c <<\_______EOF
+int main()
+{
+ return 0;
+}
+_______EOF
+
+# Compiler version info may be localization dependent (especially for gcc)
+
+save_LANG=$LANG
+unset LANG;
+
+# Libraries only added on special cases (such as IBM Blue Gene),
+# so initialize empty variables here
+
+libs_default=""
+libs_default_dbg=""
+libs_default_opt=""
+libs_default_prf=""
+
+##################
+# #
+# Preprocessor #
+# #
+##################
+
+
+# Default pre-processor flags (not too dependent on compiler)
+#----------------------------
+
+case "$host_os" in
+ *)
+ cppflags_default=""
+ ;;
+esac
+
+
+################
+# #
+# C compiler #
+# #
+################
+
+cs_ac_cc_version=unknown
+cs_cc_compiler_known=no
+
+# Are we using gcc ?
+#-------------------
+
+cs_gcc=no
+
+if test "x$GCC" = "xyes"; then
+
+ # Intel compiler passes as GCC but may be recognized by version string
+ if test -n "`$CC --version | grep icc`" ; then
+ cs_gcc=icc
+ else
+ cs_gcc=gcc
+ fi
+
+fi
+
+if test "x$cs_gcc" = "xgcc"; then
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -v > $outfile 2>&1
+ cs_ac_cc_version=`$CC --version 2>&1 | head -1`
+ cs_cc_compiler_known=yes
+
+ # Practical version info for option setting
+ cs_cc_version="`$CC -v 2>&1 |grep 'gcc version' |\
+ sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
+ cs_cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'`
+ cs_cc_version=`echo $cs_cc_version |sed 's/[-a-z]//g'`
+
+ if test "x" = "x$cs_cc_vendor" -a "x" != "x$cs_cc_version"; then
+ cs_cc_vendor=gcc
+ fi
+ if test "-" != "$cs_cc_vendor-$cs_cc_version"; then
+ echo "compiler '$CC' is GNU $cs_cc_vendor-$cs_cc_version"
+ fi
+
+ # Some version numbers
+ cs_cc_vers_major=`echo $cc_version | cut -f1 -d.`
+ cs_cc_vers_minor=`echo $cc_version | cut -f2 -d.`
+ cs_cc_vers_patch=`echo $cc_version | cut -f3 -d.`
+ test -n "$cs_cc_vers_major" || cs_cc_vers_major=0
+ test -n "$cs_cc_vers_minor" || cs_cc_vers_minor=0
+ test -n "$cs_cc_vers_patch" || cs_cc_vers_patch=0
+
+ # Default compiler flags
+ cflags_default="-ansi -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused"
+ cflags_default_dbg="-g"
+ cflags_default_opt="-O2"
+ cflags_default_hot="-O3"
+ cflags_default_prf="-pg"
+ cflags_default_omp="-fopenmp"
+
+ # Modify default flags on certain systems
+
+ case "$host-os-$host_cpu" in
+
+ *i?86|*x86_64)
+ cflags_default_opt="-funroll-loops -O2 -Wuninitialized"
+ case "$host_cpu" in
+ i686)
+ case "$cs_cc_vendor-$cs_cc_version" in
+ gcc-2.9[56]*|gcc-3*|gcc-4*)
+ cflags_default_opt="$cflags_default_opt -march=i686"
+ ;;
+ esac
+ ;;
+
+ esac
+ ;;
+
+ *alphaev6|*alphaev67|*alphaev68|*alphaev7)
+ cflags_default_opt="-mcpu=ev6 -O"
+ ;;
+
+ esac
+
+ # Modify default flags depending on gcc version (as older versions
+ # may not handle all flags)
+
+ case "$cs_cc_vendor-$cs_cc_version" in
+
+ gcc-2.9[56]*)
+ cflags_default="$cflags_default -Wno-long-long"
+ ;;
+
+ gcc-3.*|gcc-4.*)
+ cflags_default="`echo $cflags_default | sed -e 's/-ansi/-std=c99/g'`"
+ cflags_default="$cflags_default -Wfloat-equal"
+ ;;
+
+ esac
+
+ case "$cs_cc_vendor-$cs_cc_version" in
+ gcc-2.*|gcc-3*|gcc-4.[012]*)
+ cflags_default_omp=""
+ ;;
+ esac
+
+ case "$host_os" in
+ *cygwin)
+ cflags_default="`echo $cflags_default | sed -e 's/c99/gnu99/g'`"
+ ;;
+ esac
+
+# Otherwise, are we using icc ?
+#------------------------------
+
+elif test "x$cs_gcc" = "xicc"; then
+
+ cs_cc_version=`echo $CC --version | grep icc |sed 's/[a-zA-Z()]//g'`
+
+ echo "compiler '$CC' is Intel ICC"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -V conftest.c > $outfile 2>&1
+ cs_ac_cc_version=`$CC --version 2>&1 | head -1`
+ cs_cc_compiler_known=yes
+
+ # Default compiler flags
+ cflags_default="-strict-ansi -std=c99 -funsigned-char -Wall -Wcheck -Wshadow -Wpointer-arith -Wmissing-prototypes -Wuninitialized -Wunused"
+ cflags_default_dbg="-g -O0 -traceback -w2 -Wp64 -ftrapuv"
+ cflags_default_opt="-O2"
+ cflags_default_hot="-O3"
+ cflags_default_prf="-p"
+ cflags_default_omp="-openmp"
+
+ # Modify default flags on certain systems
+
+ case "$host-os-$host_cpu" in
+ *ia64)
+ cflags_default_opt="-O2 -mcpu=itanium2-p9000"
+ cflags_default_ext="-fp-model extended"
+ ;;
+ esac
+
+fi
+
+# Otherwise, are we using pgcc ?
+#-------------------------------
+
+if test "x$cs_cc_compiler_known" != "xyes" ; then
+
+ $CC -V 2>&1 | grep 'The Portland Group' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$CC' is Portland Group pgcc"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -V conftest.c > $outfile 2>&1
+ cs_ac_cc_version=`grep -i pgcc $outfile`
+ cs_cc_compiler_known=yes
+
+ # Default compiler flags
+ cflags_default="-Xa"
+ cflags_default_dbg="-g -Mbounds"
+ cflags_default_opt="-fast -fastsse"
+ cflags_default_prf="-Mprof=func,lines"
+ cflags_default_omp="-mp"
+
+ fi
+
+fi
+
+# Otherwise, are we using xlc ?
+#------------------------------
+
+if test "x$cs_cc_compiler_known" != "xyes" ; then
+
+ $CC -qversion 2>&1 | grep 'XL C' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$CC' is IBM XL C compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -qversion > $outfile 2>&1
+ cs_ac_cc_version=`grep 'XL C' $outfile`
+ cs_cc_compiler_known=yes
+ cs_linker_set=yes
+
+ # Default compiler flags
+ cflags_default="-q64"
+ cflags_default_opt="-O3"
+ cflags_default_hot="-O3"
+ cflags_default_dbg="-g"
+ cflags_default_prf="-pg"
+ cflags_default_omp="-qsmp=omp"
+
+ # Default linker flags
+ ldflags_default=""
+ ldflags_default_opt="-O3"
+ ldflags_default_dbg="-g"
+ ldflags_default_prf="-pg"
+
+ # Adjust options for IBM Blue Gene cross-compiler
+
+ grep 'Blue Gene' $outfile > /dev/null
+ if test "$?" = "0" ; then
+ # Default compiler flags
+ cs_ibm_bg_type=`grep 'Blue Gene' $outfile | sed -e 's/.*Blue Gene\/\([A-Z]\).*/\1/'`
+ if test "$cs_ibm_bg_type" = "L" ; then
+ cppflags_default="-I/bgl/BlueLight/ppcfloor/bglsys/include"
+ cflags_default="-g -qmaxmem=-1 -qarch=440d -qtune=440"
+ cflags_default_opt="-O3"
+ cflags_default_hot="-O3 -qhot"
+ cflags_default_dbg=""
+ elif test "$cs_ibm_bg_type" = "P" ; then
+ cppflags_default="-I/bgsys/drivers/ppcfloor/comm/include"
+ cflags_default="-g -qmaxmem=-1 -qarch=450d -qtune=450"
+ cflags_default_opt="-O3"
+ cflags_default_hot="-O3 -qhot"
+ cflags_default_dbg=""
+ fi
+ fi
+
+ fi
+fi
+
+# Compiler still not identified
+#------------------------------
+
+if test "x$cs_cc_compiler_known" != "xyes" ; then
+
+ case "$host_os" in
+
+ osf*)
+
+ # Native Compaq Tru64 Unix C compiler
+ #------------------------------------
+
+ $CC -V 2>&1 | grep 'Compaq Tru64' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$CC' is Compaq Tru64 compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -V conftest.c > $outfile 2>&1
+ cs_ac_cc_version=`grep 'Compaq C' $outfile`
+ cs_cc_compiler_known=yes
+ cs_linker_set=yes
+
+ # Default compiler flags
+ case "$host_cpu" in
+ alphaev6|alphaev67|alphaev68|alphaev7)
+ cflags_default="-arch host -tune host -ansi_alias -std -check_bounds -trapuv -check -msg_enable alignment -msg_enable noansi -msg_enable performance -portable -msg_enable c_to_cxx"
+ cflags_default_opt="-O"
+ cflags_default_hot="-O"
+ cflags_default_dbg="-g"
+ cflags_default_prf="-pg"
+ cflags_default_omp="-omp"
+ ;;
+ esac
+
+ # Default linker flags
+ ldflags_default="-Wl,-call_shared"
+ ldflags_default_opt="-O0"
+ ldflags_default_dbg="-g"
+ ldflags_default_prf="-pg"
+ ldflags_rpath="-Wl,-rpath -Wl,"
+ fi
+ ;;
+
+ SUPER-UX* | superux*)
+
+ # Native NEC SX vectorizing C compiler (sxmpicc)
+ #-------------------------------------
+
+ $CC -V conftest.c 2>&1 | grep 'NEC' | grep 'SX' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$CC' is NEC SX compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -V conftest.c > $outfile 2>&1
+ cs_ac_cc_version=`grep ccom $outfile`
+ cs_cc_compiler_known=yes
+ cs_linker_set=yes
+
+ # Default compiler flags
+ cflags_default="-Kc99 -pvctl,loopcnt=2147483647"
+ cflags_default_opt=""
+ cflags_default_dbg=""
+ cflags_default_prf=""
+ cflags_default_omp=""
+
+ # Default linker flags
+ ldflags_default=""
+ ldflags_default_opt="-O"
+ ldflags_default_dbg="-g"
+ ldflags_default_prf="-pg"
+
+ fi
+ ;;
+
+ irix5.*|irix6.*)
+
+ # Native SGI IRIX C compiler
+ #---------------------------
+
+ $CC -version 2>&1 | grep 'MIPSpro' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$CC' is MIPSpro compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -version > $outfile 2>&1
+ cs_ac_cc_version=`grep MIPSpro $outfile`
+ cs_cc_compiler_known=yes
+
+ # Default compiler flags
+ cflags_default="-c99 -64"
+ cflags_default_opt="-O2 -woff 1521,1552,1096"
+ cflags_default_dbg="-g -woff 1429,1521,1209 -fullwarn"
+ cflags_default_prf="-fbexe"
+
+ fi
+ ;;
+
+ hpux*)
+
+ # Native HP-UX C compiler
+ #------------------------
+
+ $CC -V conftest.c 2>&1 | grep 'HP' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$CC' is HP compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -V conftest.c > $outfile 2>&1
+ cs_ac_cc_version=`grep ccom $outfile`
+ cs_cc_compiler_known=yes
+ cs_linker_set=yes
+
+ # Default compiler flags
+ cflags_default="-Aa +e +DA2.0W"
+ cflags_default_opt="+O2"
+ cflags_default_hot="+O3"
+ cflags_default_dbg="-g"
+ cflags_default_prf="-G"
+ cflags_default_omp="+Oopenmp" # most pragmas require +O3
+
+ # Default linker flags
+ ldflags_default="+DA2.0W +FPVZOUD +U77"
+ ldflags_default_opt="+O1"
+ ldflags_default_dbg="-g"
+ ldflags_default_prf="-fbexe"
+ cflags_default_omp="+Oopenmp"
+
+ fi
+ ;;
+
+ solaris2.*)
+
+ # Sun Workshop compiler
+ #----------------------
+
+ $CC -V 2>&1 | grep 'WorkShop Compilers' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$CC' is Sun WorkShop Compilers"
+
+ # Version strings for logging purposes and known compiler flag
+ $CC -V conftest.c > $outfile 2>&1
+ cs_ac_cc_version=`grep cc $outfile`
+ cs_cc_compiler_known=yes
+
+ # Default compiler flags
+ cflags_default="-Xa -Xc99"
+ cflags_default_opt="-xO2"
+ cflags_default_hot="-xO3"
+ cflags_default_dbg="-g"
+ cflags_default_prf="-pg"
+ cflags_default_omp="-xopenmp"
+
+ fi
+ ;;
+
+ *)
+
+ # Unknown
+ #--------
+
+ cflags_default=""
+ cflags_default_opt="-O"
+ cflags_default_dbg="-g"
+ cflags_default_prf=""
+ cflags_default_omp=""
+ ;;
+
+ esac
+
+fi
+
+if test "x$cflags_default_hot" = "x" ; then
+ cflags_default_hot=$cflags_default_opt
+fi
+
+if test -f $outfile ; then
+ cs_ac_cc_version_full=`sed -e '11,$d' $outfile`
+ rm -f $outfile
+fi
+
+
+######################
+# #
+# Fortran compiler #
+# #
+######################
+
+cs_ac_fc_version=unknown
+cs_fc_compiler_known=no
+
+# Are we using gfortran ?
+#------------------------
+
+cs_gfortran=no
+
+# Are we using gfortran ?
+#------------------------
+
+$FC --version 2>&1 | grep 'GNU Fortran' > /dev/null
+
+if test "$?" = "0" ; then
+
+ cs_fc_version=`echo $FC --version |sed 's/[a-zA-Z()]//g'`
+ cs_fc_version="`$FC -v 2>&1 |grep 'gcc version' |\
+ sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
+
+ echo "compiler '$FC' is gfortran"
+
+ cs_fc_compiler_known=yes
+ cs_gfortran=gfortran
+
+ # Version strings for logging purposes and known compiler flag
+ $FC -v > $outfile 2>&1
+ cs_ac_fc_version=`$FC --version 2>&1 | head -1`
+ cs_fc_compiler_known=yes
+
+ # Practical version info for option setting
+ cs_fc_version="`$FC -v 2>&1 |grep 'gcc version' |\
+ sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
+ cs_fc_vendor=`echo $fc_version |sed 's/\([a-z]*\).*/\1/'`
+ cs_fc_version=`echo $cs_fc_version |sed 's/[-a-z]//g'`
+
+ if test "x" = "x$cs_fc_vendor" -a "x" != "x$cs_fc_version"; then
+ cs_fc_vendor=gfortran
+ fi
+ if test "-" != "$cs_fc_vendor-$cs_fc_version"; then
+ echo "compiler '$FC' is GNU $cs_fc_vendor-$cs_fc_version"
+ fi
+
+ # Some version numbers
+ cs_fc_vers_major=`echo $cc_version | cut -f1 -d.`
+ cs_fc_vers_minor=`echo $cc_version | cut -f2 -d.`
+ cs_fc_vers_patch=`echo $cc_version | cut -f3 -d.`
+ test -n "$cs_fc_vers_major" || cs_fc_vers_major=0
+ test -n "$cs_fc_vers_minor" || cs_fc_vers_minor=0
+ test -n "$cs_fc_vers_patch" || cs_fc_vers_patch=0
+
+ # Default compiler flags
+ fcflags_default="-x f95-cpp-input"
+ fcflags_default_dbg="-g -fbounds-check"
+ fcflags_default_opt="-O"
+ fcflags_default_hot="-O2"
+ fcflags_default_prf="-pg"
+ fcflags_default_omp="-fopenmp"
+
+fi
+
+if test "x$cs_fc_compiler_known" != "xyes" ; then
+
+ # Are we using ifort ?
+ #---------------------
+
+ $FC --version 2>&1 | grep 'IFORT' > /dev/null
+ if test "$?" = "0" ; then
+
+ cs_fc_version=`echo $FC --version | grep ifort |sed 's/[a-zA-Z()]//g'`
+
+ echo "compiler '$FC' is Intel Fortran"
+
+ # Version strings for logging purposes and known compiler flag
+ $FC -V > $outfile 2>&1
+ cs_ac_fc_version=`$FC --version 2>&1 | head -1`
+ cs_fc_compiler_known=yes
+
+ # Default compiler flags
+ fcflags_default="-cpp -fpic -warn"
+ fcflags_default_dbg="-g -O0 -traceback -check all -fpe0 -ftrapuv"
+ fcflags_default_opt="-O2"
+ fcflags_default_hot="-O3"
+ fcflags_default_prf="-p"
+ fcflags_default_omp="-openmp"
+
+ # Modify default flags on certain systems
+
+ case "$host-os-$host_cpu" in
+ *ia64)
+ fcflags_default_opt="-O2 -mcpu=itanium2-p9000"
+ fcflags_default_hot="-O3 -mcpu=itanium2-p9000"
+ ;;
+ esac
+
+ fi
+fi
+
+if test "x$cs_fc_compiler_known" != "xyes" ; then
+
+ # Are we using xlf ?
+ #-------------------
+
+ $FC -qversion 2>&1 | grep 'XL Fortran' > /dev/null
+
+ if test "$?" = "0" ; then
+
+ echo "compiler '$FC' is IBM XL Fortran compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $FC -qversion > $outfile 2>&1
+ cs_ac_fc_version=`grep 'XL Fortran' $outfile`
+ cs_fc_compiler_known=yes
+
+ fcflags_default="-q64 -qextname -qsuffix=cpp=f90"
+ fcflags_default_opt="-O3"
+ fcflags_default_prf="-pg"
+ fcflags_default_omp="-qsmp=omp"
+
+ # Adjust options for IBM Blue Gene cross-compiler
+
+ grep 'Blue Gene' $outfile > /dev/null
+
+ if test "$?" = "0" ; then
+
+ # Default compiler flags
+ cs_ibm_bg_type=`grep 'Blue Gene' $outfile | sed -e 's/.*Blue Gene\/\([A-Z]\).*/\1/'`
+ if test "$cs_ibm_bg_type" = "L" ; then
+ fcflags_default="-g -qmaxmem=-1 -qarch=440d -qtune=440 -qextname -qsuffix=cpp=f90"
+ fcflags_default_dbg=""
+ fcflags_default_opt="-O3"
+ fcflags_default_hot="-O3 -qhot"
+ elif test "$cs_ibm_bg_type" = "P" ; then
+ fcflags_default="-g -qmaxmem=-1 -qarch=450d -qtune=450 -qextname -qsuffix=cpp=f90"
+ fcflags_default_dbg=""
+ fcflags_default_opt="-O3"
+ fcflags_default_hot="-O3 -qhot"
+ fi
+ fi
+
+ fi
+fi
+
+if test "x$cs_fc_compiler_known" != "xyes" ; then
+
+ case "$host_os" in
+
+ SUPER-UX* | superux*)
+
+ # Native NEC SX vectorizing Fortran compiler (sxmpif90)
+ #-------------------------------------------
+
+ $FC -V conftest.f 2>&1 | grep 'NEC' | grep 'SX' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$FC' is NEC SX compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $FC -V conftest.f > $outfile 2>&1
+ cs_ac_fc_version=`grep ccom $outfile`
+ cs_fc_compiler_known=yes
+
+ # Default compiler flags
+ fcflags_default="-Ep -C hopt -I. -Wf,-pvctl,loopcnt=2147483647"
+ fcflags_default_opt=""
+ fcflags_default_hot=""
+ fcflags_default_dbg=""
+ fcflags_default_prf=""
+ fcflags_default_omp=""
+
+ fi
+ ;;
+
+ hpux*)
+
+ # Native HP-UX Fortran compiler
+ #------------------------------
+
+ $FC +version 2>&1 | grep 'HP' > /dev/null
+ if test "$?" = "0" ; then
+
+ echo "compiler '$FC' is HP compiler"
+
+ # Version strings for logging purposes and known compiler flag
+ $FC -V conftest.f > $outfile 2>&1
+ cs_ac_fc_version=`$FC +version`
+ cs_fc_compiler_known=yes
+
+ # Default compiler flags
+ fcflags_default="+cpp=yes +fp_exception +FPVZOUD +U77 +DA2.0W +noppu"
+ fcflags_default_opt="+O1"
+ fcflags_default_hot="+O2"
+ fcflags_default_dbg="-g"
+ fcflags_default_prf="-G"
+ fcflags_default_omp="+Oopenmp" # most pragmas require +O3
+
+ fi
+ ;;
+
+ *)
+
+ # Unknown
+ #--------
+
+ fcflags_default=""
+ fcflags_default_opt="-O"
+ fcflags_default_hot="-O"
+ fcflags_default_dbg="-g"
+ fcflags_default_prf=""
+ ;;
+
+ esac
+
+fi
+
+if test "x$fcflags_default_hot" = "x" ; then
+ fcflags_default_hot=$fcflags_default_opt
+fi
+
+if test -f $outfile ; then
+ cs_ac_fc_version_full=`sed -e '11,$d' $outfile`
+fi
+
+
+############
+# #
+# Linker #
+# #
+############
+
+
+# Default linker flags
+#---------------------
+
+if test "x$cs_linker_set" != "xyes" ; then
+
+ case "$host_os" in
+
+ linux*)
+ ldflags_default="-rdynamic"
+ ldflags_default_opt="-O"
+ ldflags_default_dbg="-g"
+ ldflags_default_prf="-pg"
+ ldflags_rpath="-Wl,-rpath -Wl,"
+ if test "x$cs_gfortran" = "xgfortran"; then
+ libgfortran_path=`$FC --print-file-name=libgfortran.so`
+ libgfortran_dir=`dirname $libgfortran_path`
+ unset libgfortran_path
+ if test "`echo $libgfortran_dir | cut -c1-4`" != "/usr" ; then
+ ldflags_rpath="${ldflags_rpath}${libgfortran_dir}"
+ fi
+ libgfortran_path=`$FC --print-file-name=libgfortran.so`
+ libgfortran_dir=`dirname $libgfortran_path`
+ unset libgfortran_path
+ if test "`echo $libgfortran_dir | cut -c1-4`" != "/usr" ; then
+ ldflags_rpath="${ldflags_rpath}${libgfortran_dir}"
+ fi
+ unset libgfortran_dir
+ fi
+ ;;
+
+ osf*)
+ ldflags_default=""
+ ldflags_default_opt="-O"
+ ldflags_default_dbg="-g3"
+ ldflags_default_prf="-pg"
+ ;;
+
+ irix5.*|irix6.*)
+ ldflags_default="-64 -Wl,-woff,85"
+ ldflags_default_opt=""
+ ldflags_default_dbg="-g"
+ ldflags_default_prf=""
+ ;;
+
+ solaris2.*)
+ ldflags_default_opt=""
+ ldflags_default_dbg="-g"
+ ldflags_default_prf=""
+ ;;
+
+ *)
+ ldflags_default=""
+ ldflags_default_opt="-O"
+ ldflags_default_dbg="-g"
+ ldflags_default_prf="-pg"
+ ;;
+
+ esac
+
+fi
+
+# Additional libraries and options for specific systems
+#------------------------------------------------------
+
+if test "$cs_ibm_bg_type" = "L" ; then # For Blue Gene/L
+
+ bg_sys_ldflags="-L/bgl/BlueLight/ppcfloor/bglsys/lib"
+ bg_sys_libs="-lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts -lnss_files -lnss_dns -lresolv"
+ bg_trace="/bgl/local/lib/libmpitrace.a"
+
+ ldflags_default="${ldflags_default} -Wl,-allow-multiple-definition -L/opt/ibmcmp/xlmass/bg/4.3/blrts_lib ${bg_sys_ldflags}"
+ libs_default="-lmass -lmassv ${bg_trace} ${bg_sys_libs}"
+ cs_disable_shared=yes
+
+elif test "$cs_ibm_bg_type" = "P" ; then # For Blue Gene/P
+
+ bg_sys_ldflags="-L/bgsys/drivers/ppcfloor/comm/lib -L/bgsys/drivers/ppcfloor/runtime/SPI"
+ bg_sys_libs="-lmpich.cnk -ldcmfcoll.cnk -ldcmf.cnk -lSPI.cna -lrt -lpthread"
+ bg_trace="/bgsys/local/tools_ibm/lib/libmpitrace.a"
+
+ ldflags_default="${ldflags_default} -Wl,-allow-multiple-definition -L/opt/ibmcmp/xlmass/bg/4.4/bglib ${bg_sys_ldflags}"
+ libs_default="-lmass -lmassv ${bg_trace} ${bg_sys_libs}"
+ cs_disable_shared=yes
+
+fi
+
+# Finish
+
+export LANG=$save_LANG
+
+# Clean temporary files
+
+rm -f conftest* a.out $outfile
+
diff --git a/config/cs_bft.m4 b/config/cs_bft.m4
new file mode 100644
index 0000000..6095441
--- /dev/null
+++ b/config/cs_bft.m4
@@ -0,0 +1,166 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_TEST_BFT(Minimal Release string, [Maximal Release string])
+#-----------------------------------------------------------------
+# Check for BFT version ; defines BFT_CPPFLAGS, BFT_LDFLAGS, and BFT_LIBS
+# locally (i.e. as simple variables, not AC_SUBST)
+
+AC_DEFUN([CS_AC_TEST_BFT], [
+
+AC_ARG_WITH(bft, [AS_HELP_STRING([--with-bft=PATH], [specify prefix directory for BFT])])
+AC_ARG_WITH(bft-exec, [AS_HELP_STRING([--with-bft-exec=PATH], [specify directory for BFT executables])])
+AC_ARG_WITH(bft-include, [AS_HELP_STRING([--with-bft-include=PATH], [specify directory for BFT include files])])
+AC_ARG_WITH(bft-lib, [AS_HELP_STRING([--with-bft-lib=PATH], [specify directory for BFT library])])
+
+if test "x$with_bft_exec" != "x" ; then
+ bft_config="$with_bft_exec/bft-config"
+elif test "x$with_bft" != "x" ; then
+ bft_config="$with_bft/bin/bft-config"
+else
+ bft_config="bft-config"
+fi
+
+if test "x$with_bft_include" != "x" ; then
+ BFT_CPPFLAGS="-I$with_bft_include"
+elif test "x$with_bft" != "x" ; then
+ BFT_CPPFLAGS="-I$with_bft/include"
+else
+ BFT_CPPFLAGS=""
+fi
+
+if test "x$with_bft_lib" != "x" ; then
+ BFT_LDFLAGS="-L$with_bft_lib"
+elif test "x$with_bft" != "x" ; then
+ BFT_LDFLAGS="-L$with_bft/lib"
+else
+ BFT_LDFLAGS=""
+fi
+BFT_LIBS="-lbft"
+
+type "$bft_config" > /dev/null 2>&1
+if test "$?" = "0" ; then
+ BFT_CPPFLAGS="$BFT_CPPFLAGS `$bft_config --cppflags`"
+ BFT_LDFLAGS="$BFT_LDFLAGS `$bft_config --ldflags`"
+ BFT_LIBS="$BFT_LIBS `$bft_config --libs`"
+fi
+
+bft_version_min=$1
+bft_version_max=$2
+
+if test "x$bft_version_min" != "x" ; then
+ if test "x$bft_version_max" != "x" ; then
+ AC_MSG_CHECKING([for bft version >= $1 and <= $2])
+ else
+ AC_MSG_CHECKING([for bft version >= $1])
+ fi
+else
+ bft_version_min="0.0.0"
+fi
+
+bft_version_major_min=`echo "$bft_version_min" | cut -f1 -d.`
+bft_version_minor_min=`echo "$bft_version_min" | cut -f2 -d.`
+bft_version_release_min=`echo "$bft_version_min" | cut -f3 -d.`
+if test "$bft_version_major_min" = "" \
+ -o "$bft_version_minor_min" = "" \
+ -o "$bft_version_release_min" = ""; then
+ AC_MSG_FAILURE([bad BFT version definition in configure.ac: $bft_version_min])
+fi
+
+if test "x$bft_version_max" != "x" ; then
+ bft_version_major_max=`echo "$bft_version_max" | cut -f1 -d.`
+ bft_version_minor_max=`echo "$bft_version_max" | cut -f2 -d.`
+ bft_version_release_max=`echo "$bft_version_max" | cut -f3 -d.`
+ if test "$bft_version_major_max" = "" \
+ -o "$bft_version_minor_max" = "" \
+ -o "$bft_version_release_max" = ""; then
+ AC_MSG_FAILURE([bad BFT version definition in configure.ac: $bft_version_max])
+ fi
+else
+ bft_version_major_max=99999999
+ bft_version_minor_max=99999999
+ bft_version_release_max=99999999
+fi
+
+saved_CPPFLAGS=$CPPFLAGS
+saved_LDFLAGS=$LDFLAGS
+saved_LIBS=$LIBS
+
+CPPFLAGS="${CPPFLAGS} $BFT_CPPFLAGS"
+LDFLAGS="${LDFLAGS} $BFT_LDFLAGS"
+LIBS="${LIBS} $BFT_LIBS"
+
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <bft_config.h>
+]],
+[[#if BFT_MAJOR_VERSION < $bft_version_major_min
+# error BFT major version < $bft_version_major_min
+#elif BFT_MAJOR_VERSION == $bft_version_major_min
+# if BFT_MINOR_VERSION < $bft_version_minor_min
+# error BFT minor version < $bft_version_minor_min
+# elif BFT_MINOR_VERSION == $bft_version_minor_min
+# if BFT_RELEASE_VERSION < $bft_version_release_min
+# error BFT release version < $bft_version_release_min
+# endif
+# endif
+#endif
+#if BFT_MAJOR_VERSION > $bft_version_major_max
+# error BFT major version > $bft_version_major_max
+#elif BFT_MAJOR_VERSION == $bft_version_major_max
+# if BFT_MINOR_VERSION > $bft_version_minor_max
+# error BFT minor version > $bft_version_minor_max
+# elif BFT_MINOR_VERSION == $bft_version_minor_max
+# if BFT_RELEASE_VERSION > $bft_version_release_max
+# error BFT release version < $bft_version_release_max
+# endif
+# endif
+#endif
+]])],
+ [AC_MSG_RESULT([compatible bft version found])],
+ [AC_MSG_FAILURE([compatible bft version not found])])
+
+unset bft_version_major_min
+unset bft_version_minor_min
+unset bft_version_release_min
+unset bft_version_major_max
+unset bft_version_minor_max
+unset bft_version_release_max
+
+unset bft_version_min
+unset bft_version_max
+unset bft_config
+
+# Restore old LIBS to add $BFT_LIBS later, as other tests
+# might otherwise not run if a shared library is not found
+
+CPPFLAGS=$saved_CPPFLAGS
+LDFLAGS=$saved_LDFLAGS
+LIBS=$saved_LIBS
+
+unset saved_CPPFLAGS
+unset saved_LDFLAGS
+unset saved_LIBS
+
+AC_SUBST(BFT_CPPFLAGS)
+AC_SUBST(BFT_LDFLAGS)
+AC_SUBST(BFT_LIBS)
+
+])dnl
diff --git a/config/cs_blas.m4 b/config/cs_blas.m4
new file mode 100644
index 0000000..53fb9bd
--- /dev/null
+++ b/config/cs_blas.m4
@@ -0,0 +1,353 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_TEST_BLAS([use_threads])
+#----------------
+# modifies or sets cs_have_blas, BLAS_CPPFLAGS, BLAS_LDFLAGS, and BLAS_LIBS
+# depending on libraries found
+
+AC_DEFUN([CS_AC_TEST_BLAS], [
+
+cs_have_blas=no
+
+AC_ARG_ENABLE(blas,
+ [ --disable-blas do not use BLAS when available],
+ [
+ case "${enableval}" in
+ yes) blas=true ;;
+ no) blas=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-blas]) ;;
+ esac
+ ],
+ [ blas=true ]
+)
+
+AC_ARG_WITH(blas, [AS_HELP_STRING([--with-blas=PATH], [specify prefix directory for BLAS])])
+AC_ARG_WITH(blas-include, [AS_HELP_STRING([--with-blas-include=PATH], [specify directory for BLAS include files])])
+AC_ARG_WITH(blas-lib, [AS_HELP_STRING([--with-blas-lib=PATH], [specify directory for BLAS library])])
+AC_ARG_WITH(blas-type, [AS_HELP_STRING([--with-blas-type=NAME], [force ATLAS, ESSL, MKL, ...])])
+AC_ARG_WITH(blas-libs, [AS_HELP_STRING([--with-blas-libs=LIBS], [specify BLAS libraries])])
+
+if test "x$blas" = "xtrue" ; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ saved_LIBS="$LIBS"
+
+ BLAS_CPPFLAGS=""
+ BLAS_LDFLAGS=""
+
+ # Also add known paths and libraries for Blue Gene/L or P if not given
+
+ if test "x$with_blas_include" != "x" ; then
+ BLAS_CPPFLAGS="-I$with_blas_include"
+ elif test "x$with_blas" != "x" ; then
+ BLAS_CPPFLAGS="-I$with_blas/include"
+ fi
+
+ if test "x$with_blas_lib" != "x" ; then
+ BLAS_LDFLAGS="-L$with_blas_lib"
+ elif test "x$with_blas" != "x" ; then
+ BLAS_LDFLAGS="-L$with_blas/lib"
+ fi
+
+ if test "x$with_blas_type" = "x" ; then
+ if test "x$cs_ibm_bg_type" != "x" ; then
+ with_blas_type="ESSL"
+ fi
+ fi
+
+ # Test for ATLAS BLAS
+
+ if test "x$with_blas_type" = "x" -o "x$with_blas_type" = "xATLAS" ; then
+
+ if test "$1" = "yes" -o "x$with_blas_libs" = "x"; then # Threaded version ?
+
+ BLAS_LIBS="-lptcblas -latlas -lpthread"
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for threaded ATLAS BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cblas.h>]],
+ [[ cblas_ddot(0, 0, 0, 0, 0); ]])],
+ [ AC_DEFINE([HAVE_CBLAS], 1, [C BLAS support])
+ cs_have_blas=yes; with_blas_type=ATLAS ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+ fi
+
+ if test "$cs_have_blas" = "no" ; then # Test for non-threaded version
+ # or explicitely specified libs second
+ if test "x$with_blas_libs" != "x" -a "x$with_blas_type" = "xATLAS"; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lcblas -latlas"
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for ATLAS BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cblas.h>]],
+ [[ cblas_ddot(0, 0, 0, 0, 0); ]])],
+ [ AC_DEFINE([HAVE_CBLAS], 1, [C BLAS support])
+ cs_have_blas=yes; with_blas_type=ATLAS ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+ fi
+
+ fi
+
+ # Test for IBM ESSL BLAS
+
+ if test "x$with_blas_type" = "x" -o "x$with_blas_type" = "xESSL" ; then
+
+ # Test compilation/header separately from link, as linking may require
+ # Fortran libraries, and header is for C. Test library (link) first,
+ # as header is only useful if library is present.
+
+ if test "x$BLAS_CPPFLAGS" = "x" ; then
+ if test "x$cs_ibm_bg_type" = "xL" ; then
+ BLAS_CPPFLAGS="-I/opt/ibmmath/essl/4.2/include"
+ elif test "x$cs_ibm_bg_type" = "xP" ; then
+ BLAS_CPPFLAGS="-I/opt/ibmmath/essl/4.4/include"
+ fi
+ fi
+
+ if test "x$BLAS_LDFLAGS" = "x" ; then
+ if test "x$cs_ibm_bg_type" = "xL" ; then
+ BLAS_LDFLAGS="-L/opt/ibmmath/essl/4.2/lib"
+ elif test "x$cs_ibm_bg_type" = "xP" ; then
+ BLAS_LDFLAGS="-L/opt/ibmmath/essl/4.4/lib"
+ fi
+ fi
+
+ AC_LANG_PUSH([Fortran])
+
+ if test "$1" = "yes" -o "x$with_blas_libs" = "x"; then # Threaded version ?
+
+ if test "x$cs_ibm_bg_type" = "xP" ; then
+ BLAS_LIBS="-lesslsmpbg -lesslbg"
+ else
+ BLAS_LIBS="-lesslsmp"
+ fi
+
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for smp ESSL BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],
+ [[ call ddot(0, 0, 0, 0, 0) ]])],
+ [ AC_DEFINE([HAVE_ESSL], 1, [ESSL BLAS support])
+ cs_have_blas=yes; with_blas_type=ESSL ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+ fi
+
+ if test "$cs_have_blas" = "no" ; then # Test for non-threaded version
+ # or explicitely specified libs second
+
+ if test "x$cs_ibm_bg_type" != "x" ; then
+ BLAS_LIBS="-lesslbg"
+ elif test "x$with_blas_libs" != "x" -a "x$with_blas_type" = "xESSL"; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lessl"
+ fi
+
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for ESSL BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],
+ [[ call ddot(0, 0, 0, 0, 0) ]])],
+ [ AC_DEFINE([HAVE_ESSL], 1, [ESSL BLAS support])
+ cs_have_blas=yes; with_blas_type=ESSL ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+ fi
+
+ AC_LANG_POP([Fortran])
+
+ # Now check for header
+
+ if test "$cs_have_blas" = "yes" ; then
+
+ CPPFLAGS="${CPPFLAGS} ${BLAS_CPPFLAGS}"
+
+ AC_MSG_CHECKING([for ESSL BLAS headers])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <essl.h>]],
+ [[ ddot(0, 0, 0, 0, 0); ]])],
+ [ AC_DEFINE([HAVE_ESSL_H], 1, [ESSL BLAS headers])
+ cs_have_essl_h=yes ],
+ [cs_have_essl_h=no])
+ AC_MSG_RESULT($cs_have_essl_h)
+
+ fi
+
+ fi
+
+ # Test for Intel MKL BLAS
+
+ if test "x$with_blas_type" = "x" -o "x$with_blas_type" = "xMKL" ; then
+
+ if test "x$with_blas_lib" = "x" ; then
+ if test `uname -m` = ia64 ; then
+ mkl_sub_lib="/64"
+ elif test `uname -m` = x86_64 ; then
+ mkl_sub_lib="/64"
+ elif test `uname -m` = x86 ; then
+ mkl_sub_lib="/32"
+ fi
+ fi
+
+ if test "$1" = "yes" -o "x$with_blas_libs" = "x"; then # Threaded version ?
+
+ if test "`uname -m`" = "ia64" ; then
+ BLAS_LIBS="-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lguide -lpthread"
+ else
+ BLAS_LIBS="-lmkl_intel -lmkl_intel_thread -lmkl_core -lguide -lpthread"
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}${mkl_sub_lib}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for threaded MKL BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mkl_cblas.h>]],
+ [[ cblas_ddot(0, 0, 0, 0, 0); ]])],
+ [ AC_DEFINE([HAVE_MKL], 1, [MKL BLAS support])
+ cs_have_blas=yes; with_blas_type=MKL ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+ fi
+
+ if test "$cs_have_blas" = "no" ; then # Test for non-threaded version
+ # or explicitely specified libs second
+
+ if test "x$with_blas_libs" != "x" -a "x$with_blas_type" = "xMKL"; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ if test "`uname -m`" = "ia64" ; then
+ BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core"
+ else
+ BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core"
+ fi
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}${mkl_sub_lib}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for MKL BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mkl_blas.h>]],
+ [[ cblas_ddot(0, 0, 0, 0, 0); ]])],
+ [ AC_DEFINE([HAVE_MKL], 1, [MKL BLAS support])
+ cs_have_blas=yes; with_blas_type=MKL ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+ fi
+
+ if test "x$with_blas_type" = "xMKL" ; then
+ BLAS_LDFLAGS="${BLAS_LDFLAGS}${mkl_sub_lib}"
+ fi
+ unset mkl_sub_lib
+
+ fi
+
+ # Test for generic C BLAS
+
+ if test "x$with_blas_type" = "x" ; then
+
+ if test "x$with_blas_libs" != "x" ; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lblas"
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for legacy C BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cblas.h>]],
+ [[ cblas_ddot(0, 0, 0, 0, 0); ]])],
+ [ AC_DEFINE([HAVE_CBLAS], 1, [C BLAS support])
+ cs_have_blas=yes; with_blas_type=BLAS ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+ fi
+
+ # Test for generic Fortran BLAS
+
+ if test "x$with_blas_type" = "x" ; then
+
+ AC_LANG_PUSH([Fortran])
+
+ if test "x$with_blas_libs" != "x" ; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lblas"
+ fi
+
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ AC_MSG_CHECKING([for legacy Fortran BLAS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],
+ [[ call ddot(0, 0, 0, 0, 0) ]])],
+ [ AC_DEFINE([HAVE_FBLAS], 1, [Fortran BLAS support])
+ cs_have_blas=yes; with_blas_type=BLAS ],
+ [cs_have_blas=no])
+ AC_MSG_RESULT($cs_have_blas)
+
+ AC_LANG_POP([Fortran])
+
+ fi
+
+ # Cleanup if no BLAS found
+
+ if test "x$cs_have_blas" != "xyes"; then
+ BLAS_CPPFLAGS=""
+ BLAS_LDFLAGS=""
+ BLAS_LIBS=""
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+AC_SUBST(BLAS_CPPFLAGS)
+AC_SUBST(BLAS_LDFLAGS)
+AC_SUBST(BLAS_LIBS)
+
+])dnl
+
diff --git a/config/cs_config_info.m4 b/config/cs_config_info.m4
new file mode 100644
index 0000000..aa9c862
--- /dev/null
+++ b/config/cs_config_info.m4
@@ -0,0 +1,125 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_CONFIG_INFO_INIT([OUTPUT FILE NAME])
+#-----------------------
+# Write main config info file header.
+
+AC_DEFUN([CS_AC_CONFIG_INFO_INIT], [
+
+# First arg is output file name
+if test "$1" = "" ; then
+ cs_ac_config_info="cs-config"
+else
+ cs_ac_config_info=$1
+fi
+
+outfile="$cs_ac_config_info"-tmp
+
+rm -f $outfile
+
+AC_MSG_NOTICE([initializing $cs_ac_config_info])
+])
+
+# CS_AC_CONFIG_INFO_EXTRA([extra config info strings])
+#------------------------
+# Write extra info to config info file header.
+
+AC_DEFUN([CS_AC_CONFIG_INFO_EXTRA], [
+
+AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
+
+outfile="$cs_ac_config_info"-tmp
+
+echo "# Configuration:" >> $outfile
+echo "# --------------" >> $outfile
+echo "$1" >> $outfile
+
+])
+
+# CS_AC_CONFIG_INFO_CC([version], [version_full])
+#---------------------
+# Write available compiler info to config info file header.
+
+AC_DEFUN([CS_AC_CONFIG_INFO_CC], [
+
+AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
+
+outfile="$cs_ac_config_info"-tmp
+
+if test "$1" != "" -o "$2" != "" ; then
+ echo "" >> $outfile
+ echo "# C compiler used for build: $1" >> $outfile
+ echo "# --------------------------" >> $outfile
+ if test "$2" != "" ; then
+ echo "$2" | sed 's/^/# /' >> $outfile
+ fi
+else
+ AC_MSG_NOTICE([C compiler version info unavailable for configuration file])
+fi
+])
+
+# CS_AC_CONFIG_INFO_FC([version], [version_full])
+#---------------------
+# Write available compiler info to config info file header.
+
+AC_DEFUN([CS_AC_CONFIG_INFO_FC], [
+
+AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
+
+outfile="$cs_ac_config_info"-tmp
+
+if test "$1" != "" -o "$2" != "" ; then
+ echo "" >> $outfile
+ echo "# Fortran compiler used for build: $1" >> $outfile
+ echo "# --------------------------------" >> $outfile
+ if test "$2" != "" ; then
+ echo "$2" | sed 's/^/# /' >> $outfile
+ fi
+else
+ AC_MSG_NOTICE([Fortran compiler version info unavailable for configuration file])
+fi
+])
+
+# CS_AC_CONFIG_INFO_FINALIZE
+#---------------------------
+# Write main config info file body (script part).
+
+AC_DEFUN([CS_AC_CONFIG_INFO_FINALIZE], [
+
+AC_REQUIRE([CS_AC_CONFIG_INFO_INIT])dnl
+
+outfile="$cs_ac_config_info"-tmp
+
+AC_MSG_NOTICE([closing $cs_ac_config_info])
+
+diff $outfile $cs_ac_config_info > /dev/null 2>&1
+if test $? -eq 0 ; then
+ AC_MSG_NOTICE([$cs_ac_config_info is unchanged])
+ rm -f $outfile
+else
+ mv $outfile $cs_ac_config_info
+ chmod +x $cs_ac_config_info
+fi
+
+])dnl
+
diff --git a/config/cs_fvm.m4 b/config/cs_fvm.m4
new file mode 100644
index 0000000..a693e10
--- /dev/null
+++ b/config/cs_fvm.m4
@@ -0,0 +1,194 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_TEST_FVM(Minimal Release string, [Maximal Release string])
+#-----------------------------------------------------------------
+# Check for FVM version ; defines FVM_CPPFLAGS, FVM_LDFLAGS, and FVM_LIBS
+# locally (i.e. as simple variables, not AC_SUBST)
+
+AC_DEFUN([CS_AC_TEST_FVM], [
+
+AC_ARG_WITH(fvm, [AS_HELP_STRING([--with-fvm=PATH], [specify prefix directory for FVM])])
+AC_ARG_WITH(fvm-exec, [AS_HELP_STRING([--with-fvm-exec=PATH], [specify directory for FVM executables])])
+AC_ARG_WITH(fvm-include, [AS_HELP_STRING([--with-fvm-include=PATH], [specify directory for FVM include files])])
+AC_ARG_WITH(fvm-lib, [AS_HELP_STRING([--with-fvm-lib=PATH], [specify directory for FVM library])])
+
+if test "x$with_fvm_exec" != "x" ; then
+ fvm_config="$with_fvm_exec/fvm-config"
+elif test "x$with_fvm" != "x" ; then
+ fvm_config="$with_fvm/bin/fvm-config"
+else
+ fvm_config="fvm-config"
+fi
+
+if test "x$with_fvm_include" != "x" ; then
+ FVM_CPPFLAGS="-I$with_fvm_include"
+elif test "x$with_fvm" != "x" ; then
+ FVM_CPPFLAGS="-I$with_fvm/include"
+else
+ FVM_CPPFLAGS=""
+fi
+
+if test "x$with_fvm_lib" != "x" ; then
+ FVM_LDFLAGS="-L$with_fvm_lib"
+elif test "x$with_fvm" != "x" ; then
+ FVM_LDFLAGS="-L$with_fvm/lib"
+else
+ FVM_LDFLAGS=""
+fi
+FVM_LIBS="-lfvm"
+
+type "$fvm_config" > /dev/null 2>&1
+if test "$?" = "0" ; then
+ FVM_CPPFLAGS="$FVM_CPPFLAGS `$fvm_config --cppflags`"
+ FVM_DEP_LDFLAGS="`$fvm_config --ldflags`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags cgns`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags med`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags hdf5`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags mpi`"
+ FVM_DEP_LIBS="`$fvm_config --libs`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs cgns`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs med`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs hdf5`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs mpi`"
+fi
+
+fvm_version_min=$1
+fvm_version_max=$2
+
+if test "x$fvm_version_min" != "x" ; then
+ if test "x$fvm_version_max" != "x" ; then
+ AC_MSG_CHECKING([for fvm version >= $1 and <= $2])
+ else
+ AC_MSG_CHECKING([for fvm version >= $1])
+ fi
+else
+ fvm_version_min="0.0.0"
+fi
+
+fvm_version_major_min=`echo "$fvm_version_min" | cut -f1 -d.`
+fvm_version_minor_min=`echo "$fvm_version_min" | cut -f2 -d.`
+fvm_version_release_min=`echo "$fvm_version_min" | cut -f3 -d.`
+if test "$fvm_version_major_min" = "" \
+ -o "$fvm_version_minor_min" = "" \
+ -o "$fvm_version_release_min" = ""; then
+ AC_MSG_FAILURE([bad FVM version definition in configure.ac: $fvm_version_min])
+fi
+
+if test "x$fvm_version_max" != "x" ; then
+ fvm_version_major_max=`echo "$fvm_version_max" | cut -f1 -d.`
+ fvm_version_minor_max=`echo "$fvm_version_max" | cut -f2 -d.`
+ fvm_version_release_max=`echo "$fvm_version_max" | cut -f3 -d.`
+ if test "$fvm_version_major_max" = "" \
+ -o "$fvm_version_minor_max" = "" \
+ -o "$fvm_version_release_max" = ""; then
+ AC_MSG_FAILURE([bad FVM version definition in configure.ac: $fvm_version_max])
+ fi
+else
+ fvm_version_major_max=99999999
+ fvm_version_minor_max=99999999
+ fvm_version_release_max=99999999
+fi
+
+saved_CPPFLAGS=$CPPFLAGS
+saved_LDFLAGS=$LDFLAGS
+saved_LIBS=$LIBS
+
+CPPFLAGS="${CPPFLAGS} $FVM_CPPFLAGS"
+LDFLAGS="$FVM_LDFLAGS $FVM_DEP_LDFLAGS `$fvm_config --ldflags bft` ${LDFLAGS}"
+LIBS="$FVM_LIBS $FVM_DEP_LIBS `$fvm_config --libs bft` ${LIBS}"
+
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <fvm_config.h>
+]],
+[[#if FVM_MAJOR_VERSION < $fvm_version_major_min
+# error FVM major version < $fvm_version_major_min
+#elif FVM_MAJOR_VERSION == $fvm_version_major_min
+# if FVM_MINOR_VERSION < $fvm_version_minor_min
+# error FVM minor version < $fvm_version_minor_min
+# elif FVM_MINOR_VERSION == $fvm_version_minor_min
+# if FVM_RELEASE_VERSION < $fvm_version_release_min
+# error FVM release version < $fvm_version_release_min
+# endif
+# endif
+#endif
+#if FVM_MAJOR_VERSION > $fvm_version_major_max
+# error FVM major version > $fvm_version_major_max
+#elif FVM_MAJOR_VERSION == $fvm_version_major_max
+# if FVM_MINOR_VERSION > $fvm_version_minor_max
+# error FVM minor version > $fvm_version_minor_max
+# elif FVM_MINOR_VERSION == $fvm_version_minor_max
+# if FVM_RELEASE_VERSION > $fvm_version_release_max
+# error FVM release version < $fvm_version_release_max
+# endif
+# endif
+#endif
+]])],
+ [AC_MSG_RESULT([compatible fvm version found])],
+ [AC_MSG_FAILURE([compatible fvm version not found])])
+
+# Now check if fvm_coupl library is available (using MPI)
+
+AC_MSG_CHECKING([for fvm_coupling discovery functions])
+
+LIBS="$FVM_LIBS -lfvm_coupl $FVM_DEP_LIBS `$fvm_config --libs bft` ${saved_LIBS}"
+
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[int fvm_coupling_mpi_world_n_apps(void *);]],
+ [[fvm_coupling_mpi_world_n_apps(0); ]])],
+ [fvm_have_coupl=yes],
+ [fvm_have_coupl=no])
+
+AC_MSG_RESULT($fvm_have_coupl)
+if test "$fvm_have_coupl" = "yes"; then
+ FVM_LIBS="$FVM_LIBS -lfvm_coupl"
+fi
+FVM_LDFLAGS="$FVM_LDFLAGS $FVM_DEP_LDFLAGS"
+FVM_LIBS="$FVM_LIBS $FVM_DEP_LIBS"
+
+# Unset temporary variables
+
+unset fvm_version_major_min
+unset fvm_version_minor_min
+unset fvm_version_release_min
+unset fvm_version_major_max
+unset fvm_version_minor_max
+unset fvm_version_release_max
+
+unset fvm_version_min
+unset fvm_version_max
+unset fvm_config
+
+# Restore old LIBS to add $FVM_LIBS later, as other tests
+# might otherwise not run if a shared library is not found
+
+CPPFLAGS=$saved_CPPFLAGS
+LDFLAGS=$saved_LDFLAGS
+LIBS=$saved_LIBS
+
+unset saved_CPPFLAGS
+unset saved_LDFLAGS
+unset saved_LIBS
+
+AC_SUBST(FVM_CPPFLAGS)
+AC_SUBST(FVM_LDFLAGS)
+AC_SUBST(FVM_LIBS)
+
+])dnl
diff --git a/config/cs_libxml2.m4 b/config/cs_libxml2.m4
new file mode 100644
index 0000000..e5ef19d
--- /dev/null
+++ b/config/cs_libxml2.m4
@@ -0,0 +1,107 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_TEST_LIBXML2
+#-------------------
+# modifies or sets have_libxml2, LIBXML2_CPPFLAGS, LIBXML2_LDFLAGS, and LIBXML2_LIBS
+# depending on libraries found
+
+AC_DEFUN([CS_AC_TEST_LIBXML2], [
+
+have_libxml2=no
+
+AC_ARG_ENABLE(libxml2,
+ [ --disable-libxml2 do not use LIBXML2 when available],
+ [
+ case "${enableval}" in
+ yes) libxml2=true ;;
+ no) libxml2=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libxml2]) ;;
+ esac
+ ],
+ [ libxml2=true ]
+)
+
+AC_ARG_WITH(libxml2, [AS_HELP_STRING([--with-libxml2=PATH], [specify prefix directory for LIBXML2])])
+AC_ARG_WITH(libxml2-include, [AS_HELP_STRING([--with-libxml2-include=PATH], [specify directory for LIBXML2 include files])])
+AC_ARG_WITH(libxml2-lib, [AS_HELP_STRING([--with-libxml2-lib=PATH], [specify directory for LIBXML2 library])])
+
+if test "x$libxml2" = "xtrue" ; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ saved_LIBS="$LIBS"
+
+ if test "x$with_libxml2_include" != "x" ; then
+ LIBXML2_CPPFLAGS="-I$with_libxml2_include"
+ elif test "x$with_libxml2" != "x" ; then
+ LIBXML2_CPPFLAGS="-I$with_libxml2/include/libxml2"
+ else
+ LIBXML2_CPPFLAGS="-I/usr/include/libxml2"
+ fi
+
+ if test "x$with_libxml2_lib" != "x" ; then
+ LIBXML2_LDFLAGS="-L$with_libxml2_lib"
+ elif test "x$with_libxml2" != "x" ; then
+ LIBXML2_LDFLAGS="-L$with_libxml2/lib"
+ fi
+
+ LIBXML2_LIBS="-lxml2"
+
+ CPPFLAGS="${CPPFLAGS} ${LIBXML2_CPPFLAGS}"
+ LDFLAGS="${LDFLAGS} ${LIBXML2_LDFLAGS}"
+ LIBS="${LIBS} ${LIBXML2_LIBS}"
+
+ AC_CHECK_HEADER([libxml/parser.h])
+
+ AC_CHECK_LIB(xml2, xmlInitParser,
+ [ AC_DEFINE([HAVE_LIBXML2], 1, [LIBXML2 support])
+ have_libxml2=yes
+ ],
+ [ AC_MSG_WARN([no LIBXML2 support])
+ ],
+ )
+
+ if test "x$have_libxml2" != "xyes"; then
+ LIBXML2_CPPFLAGS=""
+ LIBXML2_LDFLAGS=""
+ LIBXML2_LIBS=""
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+AM_CONDITIONAL(HAVE_LIBXML2, test x$have_libxml2 = xyes)
+
+AC_SUBST(LIBXML2_CPPFLAGS)
+AC_SUBST(LIBXML2_LDFLAGS)
+AC_SUBST(LIBXML2_LIBS)
+
+])dnl
+
diff --git a/config/cs_mei.m4 b/config/cs_mei.m4
new file mode 100644
index 0000000..c5eb33d
--- /dev/null
+++ b/config/cs_mei.m4
@@ -0,0 +1,109 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_TEST_MEI
+#---------------
+# modifies or sets have_mei, MEI_CPPFLAGS, MEI_LDFLAGS, and MEI_LIBS
+# depending on libraries found
+
+AC_DEFUN([CS_AC_TEST_MEI], [
+
+have_mei=no
+
+AC_ARG_ENABLE(mei,
+ [ --disable-mei do not use MEI when available],
+ [
+ case "${enableval}" in
+ yes) mei=true ;;
+ no) mei=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-mei]) ;;
+ esac
+ ],
+ [ mei=true ]
+)
+
+AC_ARG_WITH(mei, [AS_HELP_STRING([--with-mei=PATH], [specify prefix directory for MEI])])
+AC_ARG_WITH(mei-include, [AS_HELP_STRING([--with-mei-include=PATH], [specify directory for MEI include files])])
+AC_ARG_WITH(mei-lib, [AS_HELP_STRING([--with-mei-lib=PATH], [specify directory for MEI library])])
+
+if test "x$mei" = "xtrue" ; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ saved_LIBS="$LIBS"
+
+ if test "x$with_mei_include" != "x" ; then
+ MEI_CPPFLAGS="-I$with_mei_include"
+ elif test "x$with_mei" != "x" ; then
+ MEI_CPPFLAGS="-I$with_mei/include"
+ fi
+
+ if test "x$with_mei_lib" != "x" ; then
+ MEI_LDFLAGS="-L$with_mei_lib"
+ mei_libdir=$with_mei_lib
+ elif test "x$with_mei" != "x" ; then
+ MEI_LDFLAGS="-L$with_mei/lib"
+ mei_libdir=$with_mei/lib
+ fi
+
+ MEI_LIBS="-lmei"
+
+ CPPFLAGS="${CPPFLAGS} ${MEI_CPPFLAGS} ${BFT_CPPFLAGS}"
+ LDFLAGS="${LDFLAGS} ${MEI_LDFLAGS} ${BFT_LDFLAGS}"
+ LIBS="${LIBS} ${MEI_LIBS} -lbft"
+
+ AC_CHECK_HEADER([mei_evaluate.h])
+
+ AC_CHECK_LIB(mei, mei_evaluate,
+ [ AC_DEFINE([HAVE_MEI], 1, [MEI support])
+ have_mei=yes
+ ],
+ [ AC_MSG_WARN([no MEI support])
+ ],
+ )
+
+ if test "x$have_mei" != "xyes"; then
+ MEI_CPPFLAGS=""
+ MEI_LDFLAGS=""
+ MEI_LIBS=""
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+AM_CONDITIONAL(HAVE_MEI, test x$have_mei = xyes)
+
+AC_SUBST(MEI_CPPFLAGS)
+AC_SUBST(MEI_LDFLAGS)
+AC_SUBST(MEI_LIBS)
+
+AC_SUBST(mei_libdir)
+
+])dnl
+
diff --git a/config/cs_mpi.m4 b/config/cs_mpi.m4
new file mode 100644
index 0000000..953823d
--- /dev/null
+++ b/config/cs_mpi.m4
@@ -0,0 +1,260 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_TEST_MPI
+#---------------
+# optional MPI support (use CC=mpicc with configure if necessary)
+# modifies or sets cs_have_mpi, MPI_CPPFLAGS, MPI_LDFLAGS, and MPI_LIBS
+# depending on libraries found
+
+AC_DEFUN([CS_AC_TEST_MPI], [
+
+saved_CPPFLAGS="$CPPFLAGS"
+saved_LDFLAGS="$LDFLAGS"
+saved_LIBS="$LIBS"
+
+cs_have_mpi=no
+
+AC_ARG_ENABLE(mpi,
+ [ --disable-mpi do not use MPI when available],
+ [
+ case "${enableval}" in
+ yes) mpi=true ;;
+ no) mpi=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-mpi]) ;;
+ esac
+ ],
+ [ mpi=true ]
+)
+
+AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi=PATH], [specify prefix directory for MPI])])
+AC_ARG_WITH(mpi-exec, [AS_HELP_STRING([--with-mpi-exec=PATH], [specify prefix directory for MPI executables])])
+AC_ARG_WITH(mpi-include, [AS_HELP_STRING([--with-mpi-include=PATH], [specify directory for MPI include files])])
+AC_ARG_WITH(mpi-lib, [AS_HELP_STRING([--with-mpi-lib=PATH], [specify directory for MPI library])])
+
+if test "x$mpi" = "xtrue" ; then
+ if test "x$with_mpi_exec" != "x" ; then
+ MPI_BIN="$with_mpi_exec"
+ elif test "x$with_mpi" != "x" ; then
+ MPI_BIN="$with_mpi/bin"
+ fi
+ if test "x$with_mpi_include" != "x" ; then
+ MPI_CPPFLAGS="$MPI_CPPFLAGS -I$with_mpi_include"
+ elif test "x$with_mpi" != "x" ; then
+ MPI_CPPFLAGS="$MPI_CPPFLAGS -I$with_mpi/include"
+ fi
+ if test "x$with_mpi_lib" != "x" ; then
+ MPI_LDFLAGS="$MPI_LDFLAGS -L$with_mpi_lib"
+ elif test "x$with_mpi" != "x" ; then
+ MPI_LDFLAGS="$MPI_LDFLAGS -L$with_mpi/lib"
+ fi
+fi
+
+# Just in case, remove excess whitespace from existing flag and libs variables.
+
+if test "$MPI_CPPFLAGS" != "" ; then
+ MPI_CPPFLAGS=`echo $MPI_CPPFLAGS | sed 's/^[ ]*//;s/[ ]*$//'`
+fi
+if test "$MPI_LDFLAGS" != "" ; then
+ MPI_LDFLAGS=`echo $MPI_LDFLAGS | sed 's/^[ ]*//;s/[ ]*$//'`
+fi
+if test "$MPI_LIBS" != "" ; then
+ MPI_LIBS=`echo $MPI_LIBS | sed 's/^[ ]*//;s/[ ]*$//'`
+fi
+
+# If we do not use an MPI compiler wrapper, we must add compilation
+# and link flags; we try to detect the correct flags to add.
+
+if test "x$mpi" = "xtrue" -a "x$cs_have_mpi" = "xno" ; then
+
+ # try several tests for MPI
+
+ # MPI Compiler wrapper test
+ AC_MSG_CHECKING([for MPI (MPI compiler wrapper test)])
+ CPPFLAGS="$saved_CPPFLAGS $MPI_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS $MPI_LDFLAGS"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h>]],
+ [[ MPI_Init(0, (void *)0); ]])],
+ [AC_DEFINE([HAVE_MPI], 1, [MPI support])
+ cs_have_mpi=yes],
+ [cs_have_mpi=no])
+ AC_MSG_RESULT($cs_have_mpi)
+
+ # If failed, basic test
+ if test "x$cs_have_mpi" = "xno"; then
+ # Basic test
+ AC_MSG_CHECKING([for MPI (basic test)])
+ if test "$MPI_LIBS" = "" ; then
+ MPI_LIBS="-lmpi $PTHREAD_LIBS"
+ fi
+ CPPFLAGS="$saved_CPPFLAGS $MPI_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS $MPI_LDFLAGS"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h>]],
+ [[ MPI_Init(0, (void *)0); ]])],
+ [AC_DEFINE([HAVE_MPI], 1, [MPI support])
+ cs_have_mpi=yes],
+ [cs_have_mpi=no])
+ AC_MSG_RESULT($cs_have_mpi)
+ fi
+
+ # If failed, test for mpich
+ if test "x$cs_have_mpi" = "xno"; then
+ AC_MSG_CHECKING([for MPI (mpich test)])
+ # First try (simplest)
+ MPI_LIBS="-lmpich $PTHREAD_LIBS"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h>]],
+ [[ MPI_Init(0, (void *)0); ]])],
+ [AC_DEFINE([HAVE_MPI], 1, [MPI support])
+ cs_have_mpi=yes],
+ [cs_have_mpi=no])
+ if test "x$cs_have_mpi" = "xno"; then
+ # Second try (with lpmpich)
+ MPI_LIBS="-Wl,-lpmpich -Wl,-lmpich -Wl,-lpmpich -Wl,-lmpich"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h>]],
+ [[ MPI_Init(0, (void *)0); ]])],
+ [AC_DEFINE([HAVE_MPI], 1, [MPI support])
+ cs_have_mpi=yes],
+ [cs_have_mpi=no])
+ fi
+ AC_MSG_RESULT($cs_have_mpi)
+ fi
+
+ # If failed, test for lam-mpi
+ if test "x$cs_have_mpi" = "xno"; then
+ AC_MSG_CHECKING([for MPI (lam-mpi test)])
+ # First try (without MPI-IO)
+ case $host_os in
+ freebsd*)
+ MPI_LIBS="-lmpi -llam $PTHREAD_LIBS";;
+ *)
+ MPI_LIBS="-lmpi -llam -lpthread";;
+ esac
+ LIBS="$saved_LIBS $MPI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h>]],
+ [[ MPI_Init(0, (void *)0); ]])],
+ [AC_DEFINE([HAVE_MPI], 1, [MPI support])
+ cs_have_mpi=yes],
+ [cs_have_mpi=no])
+ if test "x$cs_have_mpi" = "xno"; then
+ # Second try (with MPI-IO)
+ case $host_os in
+ freebsd*)
+ MPI_LIBS="-lmpi -llam -lutil -ldl $PTHREAD_LIBS";;
+ *)
+ MPI_LIBS="-lmpi -llam -lutil -ldl -lpthread";;
+ esac
+ LIBS="$saved_LIBS $MPI_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h>]],
+ [[ MPI_Init(0, (void *)0); ]])],
+ [AC_DEFINE([HAVE_MPI], 1, [MPI support])
+ cs_have_mpi=yes],
+ [cs_have_mpi=no])
+ fi
+ AC_MSG_RESULT($cs_have_mpi)
+ fi
+
+ if test "x$cs_have_mpi" = "xno"; then
+ MPI_CPPFLAGS=""
+ MPI_LDFLAGS=""
+ MPI_LIBS=""
+ else
+ # Try to detect MPI variants as this may be useful for the run scripts to
+ # determine the correct mpi startup syntax (especially when multiple
+ # librairies are installed on the same machine).
+ CPPFLAGS="$saved_CPPFLAGS $MPI_CPPFLAGS"
+ MPI_TYPE=""
+ if test "x$MPI_TYPE" = "x"; then
+ AC_EGREP_CPP([mpich2],
+ [
+ #include <mpi.h>
+ #ifdef MPICH2
+ mpich2
+ #endif
+ ],
+ [MPI_TYPE=MPICH2])
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ AC_EGREP_CPP([ompi],
+ [
+ #include <mpi.h>
+ #ifdef OMPI_MAJOR_VERSION
+ ompi
+ #endif
+ ],
+ [MPI_TYPE=OpenMPI])
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ AC_EGREP_CPP([mpibull2],
+ [
+ #include <mpi.h>
+ #ifdef MPIBULL2_NAME
+ mpibull2
+ #endif
+ ],
+ [MPI_TYPE=MPIBULL2])
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ AC_EGREP_CPP([lam_mpi],
+ [
+ #include <mpi.h>
+ #ifdef LAM_MPI
+ lam_mpi
+ #endif
+ ],
+ [MPI_TYPE=LAM_MPI])
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ AC_EGREP_CPP([hp_mpi],
+ [
+ #include <mpi.h>
+ #ifdef HP_MPI
+ hp_mpi
+ #endif
+ ],
+ [MPI_TYPE=HP_MPI])
+ fi
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+AM_CONDITIONAL(HAVE_MPI, test x$cs_have_mpi = xyes)
+
+AC_SUBST(MPI_CPPFLAGS)
+AC_SUBST(MPI_LDFLAGS)
+AC_SUBST(MPI_LIBS)
+AC_SUBST(MPI_BIN)
+AC_SUBST(MPI_TYPE)
+
+])dnl
+
diff --git a/config/cs_syrthes.m4 b/config/cs_syrthes.m4
new file mode 100644
index 0000000..f940e6f
--- /dev/null
+++ b/config/cs_syrthes.m4
@@ -0,0 +1,109 @@
+dnl----------------------------------------------------------------------------
+dnl This file is part of the Code_Saturne Kernel, element of the
+dnl Code_Saturne CFD tool.
+dnl
+dnl Copyright (C) 2009 EDF S.A., France
+dnl
+dnl The Code_Saturne Kernel is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2 of
+dnl the License, or (at your option) any later version.
+dnl
+dnl The Code_Saturne Kernel is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public Licence
+dnl along with the Code_Saturne Preprocessor; if not, write to the
+dnl Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+dnl-----------------------------------------------------------------------------
+
+# CS_AC_TEST_SYRTHES
+#-------------------
+# Check for SYRTHES version ;
+# defines SYRTHES_CPPFLAGS, SYRTHES_LDFLAGS, and SYRTHES_LIBS locally
+# (i.e. as simple variables, not AC_SUBST)
+
+AC_DEFUN([CS_AC_TEST_SYRTHES], [
+
+AC_ARG_WITH(syrthes, [AS_HELP_STRING([--with-syrthes=PATH], [specify prefix directory for SYRTHES])])
+
+if test -f $with_syrthes/bin/syrthes.profile ; then
+ have_syrthes=yes
+ syrthes_prefix=$with_syrthes
+ AC_MSG_NOTICE([sourcing $syrthes_prefix/bin/syrthes.profile])
+ . "$syrthes_prefix/bin/syrthes.profile"
+else
+ have_syrthes=no
+ AC_MSG_WARN([cannot find syrthes.profile])
+fi
+
+if test "x$have_syrthes" = "xyes"; then
+
+# Get SYRTHES compilers
+
+outfile=makefile-tmp
+cp $with_syrthes/bin/Makefile $outfile
+
+cat >> $outfile <<\_______EOF
+
+syr_info:
+ @echo $(VERSION) > syr-version-tmp
+ @echo $(CC) > syr-cc-tmp
+ @echo $(FC) > syr-fc-tmp
+ @echo $(CFLAGS) > syr-cflags-tmp
+ @echo $(FCFLAGS) > syr-fcflags-tmp
+_______EOF
+
+make -f $outfile syr_info > /dev/null
+
+SYRTHES_NOM_ARCH=${NOM_ARCH}
+SYRTHES_VERSION=`cat syr-version-tmp`
+SYRTHES_CC=`cat syr-cc-tmp`
+SYRTHES_FC=`cat syr-fc-tmp`
+SYRTHES_CFLAGS=`cat syr-cflags-tmp`
+SYRTHES_FCFLAGS=`cat syr-fcflags-tmp`
+
+rm -f $outfile syr-version-tmp syr-cc-tmp syr-fc-tmp syr-cflags-tmp syr-fcflags-tmp
+
+# Get mandatory Fortran libs for linking stage
+# We assume that only SYRTHES user subroutines written in Fortran 77
+# will need to be compiled (as versions older than 3.4 are not
+# supported, and version 4 will be coupled directly through FVM,
+# not through the syrcs wrapper).
+
+F77=$SYRTHES_FC
+AC_F77_LIBRARY_LDFLAGS
+SYRTHES_FCLIBS=$FLIBS
+
+SYRTHES_CPPFLAGS="-I$with_syrthes/include"
+SYRTHES_LDFLAGS="-L$with_syrthes/lib/${SYRTHES_NOM_ARCH}"
+SYRTHES_LIBS="-lsatsyrthes${SYRTHES_VERSION}_${SYRTHES_NOM_ARCH} -lsyrthes${SYRTHES_VERSION}_${SYRTHES_NOM_ARCH}"
+
+if test "x$cs_have_mpi" = "xyes"; then
+ FVM_COUPL_LDFLAGS="$FVM_LDFLAGS"
+ FVM_COUPL_LIBS="-lfvm_coupl"
+else
+ FVM_COUPL_LDFLAGS=
+ FVM_COUPL_LIBS=
+fi
+
+SYRTHES_LDFLAGS="$FVM_COUPL_LDFLAGS $BFT_LDFLAGS $MPI_LDFLAGS $SYRTHES_LDFLAGS"
+SYRTHES_LIBS="$FVM_COUPL_LIBS $BFT_LIBS $MPI_LIBS $SYRTHES_LIBS"
+
+AC_SUBST(syrthes_prefix)
+
+AC_SUBST(SYRTHES_CC)
+AC_SUBST(SYRTHES_FC)
+AC_SUBST(SYRTHES_CFLAGS)
+AC_SUBST(SYRTHES_FCFLAGS)
+AC_SUBST(SYRTHES_FCLIBS)
+AC_SUBST(SYRTHES_CPPFLAGS)
+AC_SUBST(SYRTHES_LDFLAGS)
+AC_SUBST(SYRTHES_LIBS)
+
+fi
+
+])dnl
diff --git a/config/depcomp b/config/depcomp
new file mode 100755
index 0000000..e5f9736
--- /dev/null
+++ b/config/depcomp
@@ -0,0 +1,589 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2007-03-29.01
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
+# Foundation, Inc.
+
+# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/config/gettext.m4 b/config/gettext.m4
new file mode 100644
index 0000000..c9ae1f7
--- /dev/null
+++ b/config/gettext.m4
@@ -0,0 +1,381 @@
+# gettext.m4 serial 60 (gettext-0.17)
+dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper at cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible at clisp.cons.org>, 2000-2006.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl default (if it is not specified or empty) is 'no-libtool'.
+dnl INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl depending on --{enable,disable}-{shared,static} and on the presence of
+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl implementations (in libc or libintl) without the ngettext() function
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries. If empty,
+dnl the value `$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl and used.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl Catalog format: none
+dnl Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+ dnl Argument checking.
+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+ define([gt_included_intl],
+ ifelse([$1], [external],
+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+ [yes]))
+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
+
+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
+ ifelse(gt_included_intl, yes, [
+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
+ ])
+
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+ dnl documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
+ dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+ gt_INTL_MACOSX
+
+ dnl Set USE_NLS.
+ AC_REQUIRE([AM_NLS])
+
+ ifelse(gt_included_intl, yes, [
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ ])
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+ ifelse(gt_included_intl, yes, [
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH(included-gettext,
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ ])
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If GNU gettext is available we use this. Else we have
+ dnl to fall back to GNU NLS library.
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;],
+ [bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ ifelse(gt_included_intl, yes, , [
+ AM_ICONV_LINK
+ ])
+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+ dnl even if libiconv doesn't exist.
+ AC_LIB_LINKFLAGS_BODY([intl])
+ AC_CACHE_CHECK([for GNU gettext in libintl],
+ [$gt_func_gnugettext_libintl],
+ [gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ dnl Now see whether libintl exists and does not depend on libiconv.
+ AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);],
+ [bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+ [eval "$gt_func_gnugettext_libintl=yes"],
+ [eval "$gt_func_gnugettext_libintl=no"])
+ dnl Now see whether libintl exists and depends on libiconv.
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);],
+ [bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+ [LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+ ])
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"])
+ fi
+
+ dnl If an already present or preinstalled GNU gettext() is found,
+ dnl use it. But if this macro is used in GNU gettext, and GNU
+ dnl gettext is already preinstalled in libintl, we update this
+ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ dnl Reset the values set by searching for libintl.
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+ dnl GNU gettext is not found in the C library.
+ dnl Fall back on included GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ BUILD_INCLUDED_LIBINTL=yes
+ USE_INCLUDED_LIBINTL=yes
+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ CATOBJEXT=
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions to use GNU gettext tools.
+ CATOBJEXT=.gmo
+ fi
+ ])
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Some extra flags are needed during linking.
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ AC_DEFINE(ENABLE_NLS, 1,
+ [Define to 1 if translation of program messages to the user's native language
+ is requested.])
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ AC_MSG_CHECKING([whether to use NLS])
+ AC_MSG_RESULT([$USE_NLS])
+ if test "$USE_NLS" = "yes"; then
+ AC_MSG_CHECKING([where the gettext function comes from])
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ AC_MSG_RESULT([$gt_source])
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ AC_MSG_CHECKING([how to link with libintl])
+ AC_MSG_RESULT([$LIBINTL])
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+ fi
+
+ dnl For backward compatibility. Some packages may be using this.
+ AC_DEFINE(HAVE_GETTEXT, 1,
+ [Define if the GNU gettext() function is already present or preinstalled.])
+ AC_DEFINE(HAVE_DCGETTEXT, 1,
+ [Define if the GNU dcgettext() function is already present or preinstalled.])
+ fi
+
+ dnl We need to process the po/ directory.
+ POSUB=po
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+ dnl to 'yes' because some of the testsuite requires it.
+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+ BUILD_INCLUDED_LIBINTL=yes
+ fi
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(BUILD_INCLUDED_LIBINTL)
+ AC_SUBST(USE_INCLUDED_LIBINTL)
+ AC_SUBST(CATOBJEXT)
+
+ dnl For backward compatibility. Some configure.ins may be using this.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ DATADIRNAME=share
+ AC_SUBST(DATADIRNAME)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INSTOBJEXT=.mo
+ AC_SUBST(INSTOBJEXT)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ GENCAT=gencat
+ AC_SUBST(GENCAT)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLOBJS=
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ INTLOBJS="\$(GETTOBJS)"
+ fi
+ AC_SUBST(INTLOBJS)
+
+ dnl Enable libtool support if the surrounding package wishes it.
+ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+ AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+ ])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLLIBS="$LIBINTL"
+ AC_SUBST(INTLLIBS)
+
+ dnl Make all documented variables known to autoconf.
+ AC_SUBST(LIBINTL)
+ AC_SUBST(LTLIBINTL)
+ AC_SUBST(POSUB)
+])
+
+
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
+[
+ m4_divert_text([DEFAULTS], [gt_needs=])
+ m4_define([gt_NEEDS_INIT], [])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/config/iconv.m4 b/config/iconv.m4
new file mode 100644
index 0000000..66bc76f
--- /dev/null
+++ b/config/iconv.m4
@@ -0,0 +1,180 @@
+# iconv.m4 serial AM6 (gettext-0.17)
+dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed libiconv and not disabled its use
+ dnl via --without-libiconv-prefix, he wants to use it. The first
+ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+ am_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+ AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
+ dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ AC_TRY_RUN([
+#include <iconv.h>
+#include <string.h>
+int main ()
+{
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ return 1;
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ return 1;
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+ /* Try IRIX, OSF/1 names. */
+ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+ /* Try AIX names. */
+ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ return 1;
+ return 0;
+}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
+ [case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac])
+ LIBS="$am_save_LIBS"
+ ])
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1,
+ [Define if you have the iconv() function and it works.])
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ AC_MSG_CHECKING([how to link with libiconv])
+ AC_MSG_RESULT([$LIBICONV])
+ else
+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+ dnl either.
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+ AC_SUBST(LIBICONV)
+ AC_SUBST(LTLIBICONV)
+])
+
+AC_DEFUN([AM_ICONV],
+[
+ AM_ICONV_LINK
+ if test "$am_cv_func_iconv" = yes; then
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+])
diff --git a/config/install-sh b/config/install-sh
new file mode 100755
index 0000000..a5897de
--- /dev/null
+++ b/config/install-sh
@@ -0,0 +1,519 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-12-25.00
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/config/lib-ld.m4 b/config/lib-ld.m4
new file mode 100644
index 0000000..96c4e2c
--- /dev/null
+++ b/config/lib-ld.m4
@@ -0,0 +1,110 @@
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes ;;
+*)
+ acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]* | [A-Za-z]:[\\/]*)]
+ [re_direlt='/[^/][^/]*/\.\./']
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break ;;
+ *)
+ test "$with_gnu_ld" != yes && break ;;
+ esac
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
diff --git a/config/lib-link.m4 b/config/lib-link.m4
new file mode 100644
index 0000000..e3d26fc
--- /dev/null
+++ b/config/lib-link.m4
@@ -0,0 +1,709 @@
+# lib-link.m4 serial 13 (gettext-0.17)
+dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ(2.54)
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+ dnl results of this search when this library appears as a dependency.
+ HAVE_LIB[]NAME=yes
+ undefine([Name])
+ undefine([NAME])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed lib[]Name and not disabled its use
+ dnl via --without-lib[]Name-prefix, he wants to use it.
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIB[]NAME"
+ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib[]Name" = yes; then
+ HAVE_LIB[]NAME=yes
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+ AC_MSG_CHECKING([how to link with lib[]$1])
+ AC_MSG_RESULT([$LIB[]NAME])
+ else
+ HAVE_LIB[]NAME=no
+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+ dnl $INC[]NAME either.
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
+ LIB[]NAME[]_PREFIX=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ undefine([Name])
+ undefine([NAME])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl acl_libext,
+dnl acl_shlibext,
+dnl acl_hardcode_libdir_flag_spec,
+dnl acl_hardcode_libdir_separator,
+dnl acl_hardcode_direct,
+dnl acl_hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+ m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+ ])
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE(rpath,
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ dnl Autoconf >= 2.61 supports dots in --with options.
+ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
+[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
+ --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ fi
+ fi
+])
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
+ LIB[]NAME[]_PREFIX=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='$1 $2'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ dir="$additional_libdir"
+ dnl The same code as in the loop below:
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+ dnl No hardcoding is needed.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+ if test "$acl_hardcode_direct" = yes; then
+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+ dnl resulting binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ dnl or the already constructed $LIBNAME
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ LIB[]NAME[]_PREFIX="$basedir"
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl Potentially add $additional_includedir to $INCNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl constructed $INCNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INC[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $INCNAME.
+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl constructed $LIBNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ dnl single library, but not when more than one $LIBNAMEs are used.
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+ done
+ fi
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+ for element in [$2]; do
+ haveit=
+ for x in $[$1]; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ [$1]="${[$1]}${[$1]:+ }$element"
+ fi
+ done
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+ AC_REQUIRE([AC_LIB_RPATH])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ $1=
+ if test "$enable_rpath" != no; then
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode directories into the resulting
+ dnl binary.
+ rpathdirs=
+ next=
+ for opt in $2; do
+ if test -n "$next"; then
+ dir="$next"
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next=
+ else
+ case $opt in
+ -L) next=yes ;;
+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next= ;;
+ *) next= ;;
+ esac
+ fi
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n ""$3""; then
+ dnl libtool is used for linking. Use -R options.
+ for dir in $rpathdirs; do
+ $1="${$1}${$1:+ }-R$dir"
+ done
+ else
+ dnl The linker is used for linking directly.
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user
+ dnl must pass all path elements in one option.
+ alldirs=
+ for dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="${$1}${$1:+ }$flag"
+ done
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([$1])
+])
diff --git a/config/lib-prefix.m4 b/config/lib-prefix.m4
new file mode 100644
index 0000000..a8684e1
--- /dev/null
+++ b/config/lib-prefix.m4
@@ -0,0 +1,185 @@
+# lib-prefix.m4 serial 5 (gettext-0.15)
+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib-prefix],
+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ fi
+ fi
+])
+ if test $use_additional = yes; then
+ dnl Potentially add $additional_includedir to $CPPFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's already present in $CPPFLAGS,
+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ for x in $CPPFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $CPPFLAGS.
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ dnl Potentially add $additional_libdir to $LDFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's already present in $LDFLAGS,
+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+ haveit=
+ for x in $LDFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LDFLAGS.
+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+ dnl Unfortunately, prefix and exec_prefix get only finally determined
+ dnl at the end of configure.
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ $1
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
+dnl the basename of the libdir, either "lib" or "lib64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64. The current
+ dnl practice is that on a system supporting 32-bit and 64-bit instruction
+ dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+ dnl libraries go under $prefix/lib. We determine the compiler's default
+ dnl mode by looking at the compiler's library search path. If at least
+ dnl of its elements ends in /lib64 or points to a directory whose absolute
+ dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+ dnl default, namely "lib".
+ acl_libdirstem=lib
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+])
diff --git a/config/libtool.m4 b/config/libtool.m4
new file mode 100644
index 0000000..39ba996
--- /dev/null
+++ b/config/libtool.m4
@@ -0,0 +1,7357 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+ ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+ lt_cl_success=:
+ test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+ exec AS_MESSAGE_LOG_FD>/dev/null
+ $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+ exec AS_MESSAGE_LOG_FD>>config.log
+ $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_XSI_SHELLFNS
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+[$]*
+_LT_EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+ [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC*)
+ # IBM XL 8.0 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(int foo(void) {},
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ )
+ LDFLAGS="$save_LDFLAGS"
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+ [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 will use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ xl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=echo
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${F77-"f77"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${FC-"f95"}
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]+=\$[2]"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+ ;;
+ esac
+])
diff --git a/config/ltmain.sh b/config/ltmain.sh
new file mode 100755
index 0000000..b36c4ad
--- /dev/null
+++ b/config/ltmain.sh
@@ -0,0 +1,8406 @@
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print informational messages (default)
+# --version print version information
+# -h, --help print short or long help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.2.6
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=2.2.6
+TIMESTAMP=""
+package_revision=1.3012
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# NLS nuisances: We save the old values to restore during execute mode.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/usr/bin/grep -E"}
+: ${FGREP="/usr/bin/grep -F"}
+: ${GREP="/usr/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/opt/local/bin/gsed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+ -*) progname=./$progname ;;
+esac
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=:
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "X$my_tmpdir" | $Xsed
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "X$1" | $Xsed \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $SED -n '/^# Usage:/,/# -h/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ $ECHO
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ func_error "missing argument for $1"
+ exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell, and then maybe $ECHO will work.
+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ $ECHO "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $ECHO "enable shared libraries"
+ else
+ $ECHO "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $ECHO "enable static libraries"
+ else
+ $ECHO "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# Parse options once, thoroughly. This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+ # Shorthand for --mode=foo, only valid as the first argument
+ case $1 in
+ clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+ compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+ execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+ finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+ link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+
+ # Parse non-mode specific arguments:
+ while test "$#" -gt 0; do
+ opt="$1"
+ shift
+
+ case $opt in
+ --config) func_config ;;
+
+ --debug) preserve_args="$preserve_args $opt"
+ func_echo "enabling shell trace mode"
+ opt_debug='set -x'
+ $opt_debug
+ ;;
+
+ -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ execute_dlfiles="$execute_dlfiles $1"
+ shift
+ ;;
+
+ --dry-run | -n) opt_dry_run=: ;;
+ --features) func_features ;;
+ --finish) mode="finish" ;;
+
+ --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ case $1 in
+ # Valid mode arguments:
+ clean) ;;
+ compile) ;;
+ execute) ;;
+ finish) ;;
+ install) ;;
+ link) ;;
+ relink) ;;
+ uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+
+ mode="$1"
+ shift
+ ;;
+
+ --preserve-dup-deps)
+ opt_duplicate_deps=: ;;
+
+ --quiet|--silent) preserve_args="$preserve_args $opt"
+ opt_silent=:
+ ;;
+
+ --verbose| -v) preserve_args="$preserve_args $opt"
+ opt_silent=false
+ ;;
+
+ --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ preserve_args="$preserve_args $opt $1"
+ func_enable_tag "$1" # tagname is set here
+ shift
+ ;;
+
+ # Separate optargs to long options:
+ -dlopen=*|--mode=*|--tag=*)
+ func_opt_split "$opt"
+ set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) opt_help=: ;;
+ --version) func_version ;;
+
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+
+ *) nonopt="$opt"
+ break
+ ;;
+ esac
+ done
+
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+ ;;
+ esac
+
+ # Having warned about all mis-specified options, bail out if
+ # anything was wrong.
+ $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+$opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_ltwrapper_scriptname_result=""
+ if func_ltwrapper_executable_p "$1"; then
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ case "$@ " in
+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ pie_flag="$pie_flag $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$arg"
+ lastarg="$lastarg $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_quote_for_eval "$lastarg"
+ base_compile="$base_compile $func_quote_for_eval_result"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ removelist="$removelist $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ removelist="$removelist $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$mode'"
+ ;;
+ esac
+
+ $ECHO
+ $ECHO "Try \`$progname --help' for more information about other modes."
+
+ exit $?
+}
+
+ # Now that we've collected a possible --mode arg, show help if necessary
+ $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_quote_for_eval "$file"
+ args="$args $func_quote_for_eval_result"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ $ECHO "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ $ECHO "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ $ECHO
+ $ECHO "If you ever happen to want to link against installed libraries"
+ $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+ $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $ECHO "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $ECHO " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
+ $ECHO " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $ECHO
+
+ $ECHO "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ $ECHO "pages."
+ ;;
+ *)
+ $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog$func_quote_for_eval_result"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ case " $install_prog " in
+ *[\\\ /]cp\ *) ;;
+ *) prev=$arg ;;
+ esac
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_verbose "extracting global C symbols from \`$progfile'"
+ $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs. */"
+ lt_dlsym_const= ;;
+ *osf5*)
+ echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+ lt_dlsym_const= ;;
+ *)
+ lt_dlsym_const=const ;;
+ esac
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) symtab_cflags="$symtab_cflags $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+ func_emit_wrapper_part1_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part1_arg1=$1
+ fi
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ ECHO=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$ECHO works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$ECHO will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $ECHO "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+ func_emit_wrapper_part2_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part2_arg1=$1
+ fi
+
+ $ECHO "\
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_arg1=$1
+ fi
+
+ # split this up so that func_emit_cwrapperexe_src
+ # can call each part independently.
+ func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+ func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin. Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+ func_to_host_path_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ case $build in
+ *mingw* ) # actually, msys
+ # awkward: cmd appends spaces to result
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_path_tmp1=`cygpath -w "$1"`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # Unfortunately, winepath does not exit with a non-zero
+ # error code, so we are forced to check the contents of
+ # stdout. On the other hand, if the command is not
+ # found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both
+ # error code of zero AND non-empty stdout, which explains
+ # the odd construction:
+ func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ # Allow warning below.
+ func_to_host_path_result=""
+ fi
+ ;;
+ esac
+ if test -z "$func_to_host_path_result" ; then
+ func_error "Could not determine host path corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_path_result="$1"
+ fi
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+ func_to_host_pathlist_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_to_host_pathlist_tmp2="$1"
+ # Once set for this call, this variable should not be
+ # reassigned. It is used in tha fallback case.
+ func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e 's|^:*||' -e 's|:*$||'`
+ case $build in
+ *mingw* ) # Actually, msys.
+ # Awkward: cmd appends spaces to result.
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # unfortunately, winepath doesn't convert pathlists
+ func_to_host_pathlist_result=""
+ func_to_host_pathlist_oldIFS=$IFS
+ IFS=:
+ for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+ IFS=$func_to_host_pathlist_oldIFS
+ if test -n "$func_to_host_pathlist_f" ; then
+ func_to_host_path "$func_to_host_pathlist_f"
+ if test -n "$func_to_host_path_result" ; then
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_to_host_pathlist_result="$func_to_host_path_result"
+ else
+ func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+ fi
+ fi
+ fi
+ IFS=:
+ done
+ IFS=$func_to_host_pathlist_oldIFS
+ ;;
+ esac
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_error "Could not determine the host path(s) corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This may break if $1 contains DOS-style drive
+ # specifications. The fix is not to complicate the expression
+ # below, but for the user to provide a working wine installation
+ # with winepath so that path translation in the cross-to-mingw
+ # case works properly.
+ lt_replace_pathsep_nix_to_dos="s|:|;|g"
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_replace_pathsep_nix_to_dos"`
+ fi
+ # Now, add the leading and trailing path separators back
+ case "$1" in
+ :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+ ;;
+ esac
+ case "$1" in
+ *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "$SHELL $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# define HAVE_SETENV
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+ va_list args;
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+ func_emit_wrapper_part1 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+ cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+ func_emit_wrapper_part2 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+
+ cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_pathlist "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_pathlist "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
+
+static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
+ /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
+ /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
+ /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+ /* very simple arg parsing; don't want to rely on getopt */
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ printf ("%s", script_text_part1);
+ printf ("%s", script_text_part2);
+ return 0;
+ }
+ }
+
+ newargz = XMALLOC (char *, argc + 1);
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal ("Couldn't find %s", argv[0]);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+ tmp_pathspec));
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+ actual_cwrapper_path));
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+ target_name));
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+ {
+ if (argv[i][env_set_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_set_opt_len + 1;
+ lt_opt_process_env_set (p);
+ }
+ else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_set (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_set_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+ {
+ if (argv[i][env_prepend_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_prepend_opt_len + 1;
+ lt_opt_process_env_prepend (p);
+ }
+ else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_prepend_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+ {
+ if (argv[i][env_append_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_append_opt_len + 1;
+ lt_opt_process_env_append (p);
+ }
+ else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_append (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_append_opt);
+ continue;
+ }
+ if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal ("Unrecognized option in %s namespace: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+ for (i = 0; i < newargc; i++)
+ {
+ LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
+ wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+ tmp_pathspec));
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ char *errstr = strerror (errno);
+ lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal ("Could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+ const char *p;
+ int len;
+ if (!arg || !*arg)
+ return 1;
+
+ p = strchr (arg, (int)'=');
+
+ if (!p)
+ return 1;
+
+ *value = xstrdup (++p);
+
+ len = strlen (arg) - strlen (*value);
+ *name = XMALLOC (char, len);
+ strncpy (*name, arg, len-1);
+ (*name)[len - 1] = '\0';
+
+ return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+ }
+
+ lt_setenv (name, value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 1);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ weak_libs="$weak_libs $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname '-L' '' "$arg"
+ dir=$func_stripname_result
+ if test -z "$dir"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+ linker_flags="$linker_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* pass through architecture-specific
+ # compiler args for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # @file GCC response files
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_duplicate_deps ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ case $lib in
+ *.la) func_source "$lib" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) deplibs="$deplibs $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ dir=$func_stripname_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ $ECHO
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because the file extensions .$libext of this argument makes me believe"
+ $ECHO "*** that it is just a static archive that I should not use here."
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) temp_rpath="$temp_rpath$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ $ECHO
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $ECHO
+ $ECHO "*** And there doesn't seem to be a static archive available"
+ $ECHO "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $ECHO
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $ECHO "*** But as you try to build a module library, libtool will still create "
+ $ECHO "*** a static module, that should work as long as the dlopening application"
+ $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_dirname "$deplib" "" "."
+ dir="$func_dirname_result"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ libobjs="$libobjs $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+ # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which I believe you do not have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+ $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+ $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ $ECHO "*** make it link in! You will probably need to install it or some"
+ $ECHO "*** library that it depends on before this library will be fully"
+ $ECHO "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+ done
+ fi
+ if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
+ $GREP . >/dev/null; then
+ $ECHO
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $ECHO "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $ECHO
+ $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ $ECHO "*** a static module, that should work as long as the dlopening"
+ $ECHO "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $ECHO "*** The inter-library dependencies that have been dropped here will be"
+ $ECHO "*** automatically added whenever a program is linked with this library"
+ $ECHO "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $ECHO
+ $ECHO "*** Since this library must not contain undefined symbols,"
+ $ECHO "*** because either the platform does not support them or"
+ $ECHO "*** it was explicitly requested with -no-undefined,"
+ $ECHO "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ delfiles="$delfiles $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ func_len " $cmd"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ $ECHO 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ $ECHO "$obj" >> $output
+ done
+ $ECHO ')' >> $output
+ delfiles="$delfiles $output"
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ $ECHO "$obj" >> $output
+ done
+ delfiles="$delfiles $output"
+ output=$firstobj\"$file_list_spec$output\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ delfiles="$delfiles $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *cegcc)
+ # Disable wrappers for cegcc, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $ECHO for shipping.
+ if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+ esac
+ qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ oldobjs="$oldobjs $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $addlibs
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $ECHO "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
+ ;;
+ *) oldobjs="$oldobjs $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlfiles="$newdlfiles $libdir/$name"
+ ;;
+ *) newdlfiles="$newdlfiles $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) RM="$RM $arg"; rmforce=yes ;;
+ -*) RM="$RM $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+ case "$mode" in
+ clean)
+ case " $library_names " in
+ # " " in the beginning catches empty $dlname
+ *" $dlname "*) ;;
+ *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ esac
+ test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/config/ltoptions.m4 b/config/ltoptions.m4
new file mode 100644
index 0000000..34151a3
--- /dev/null
+++ b/config/ltoptions.m4
@@ -0,0 +1,368 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/config/ltsugar.m4 b/config/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/config/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/config/ltversion.m4 b/config/ltversion.m4
new file mode 100644
index 0000000..b8e154f
--- /dev/null
+++ b/config/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/config/lt~obsolete.m4 b/config/lt~obsolete.m4
new file mode 100644
index 0000000..637bb20
--- /dev/null
+++ b/config/lt~obsolete.m4
@@ -0,0 +1,92 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/config/missing b/config/missing
new file mode 100755
index 0000000..1c8ff70
--- /dev/null
+++ b/config/missing
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake at gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/config/nls.m4 b/config/nls.m4
new file mode 100644
index 0000000..7967cc2
--- /dev/null
+++ b/config/nls.m4
@@ -0,0 +1,31 @@
+# nls.m4 serial 3 (gettext-0.15)
+dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper at cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible at clisp.cons.org>, 2000-2003.
+
+AC_PREREQ(2.50)
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+])
diff --git a/config/po.m4 b/config/po.m4
new file mode 100644
index 0000000..0734762
--- /dev/null
+++ b/config/po.m4
@@ -0,0 +1,449 @@
+# po.m4 serial 15 (gettext-0.17)
+dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper at cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible at clisp.cons.org>, 2000-2003.
+
+AC_PREREQ(2.50)
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Release version of the gettext macros. This is used to ensure that
+ dnl the gettext macros and po/Makefile.in.in are in sync.
+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
+
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+ dnl Search for GNU msgfmt in the PATH.
+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+ dnl The second test excludes FreeBSD msgfmt.
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+ dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([GMSGFMT_015])
+
+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+ dnl The second test excludes FreeBSD xgettext.
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+
+ dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([XGETTEXT_015])
+
+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+ dnl Installation directories.
+ dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+ dnl have to define it here, so that it can be used in po/Makefile.
+ test -n "$localedir" || localedir='${datadir}/locale'
+ AC_SUBST([localedir])
+
+ dnl Support for AM_XGETTEXT_OPTION.
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+ AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
+
+ AC_CONFIG_COMMANDS([po-directories], [[
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done]],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+ # When this code is run, in config.status, two variables have already been
+ # set:
+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+ # - LINGUAS is the value of the environment variable LINGUAS at configure
+ # time.
+
+changequote(,)dnl
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ # Find a way to echo strings without interpreting backslash.
+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='echo'
+ else
+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='printf %s\n'
+ else
+ echo_func () {
+ cat <<EOT
+$*
+EOT
+ }
+ gt_echo='echo_func'
+ fi
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+ sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^[ ]*VARIABLE[ ]*=/{
+ # Seen the first line of the variable definition.
+ s/^[ ]*VARIABLE[ ]*=//
+ ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+ # Set POTFILES to the value of the Makefile variable POTFILES.
+ sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+ # Compute POTFILES_DEPS as
+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+ POTFILES_DEPS=
+ for file in $POTFILES; do
+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+ done
+ POMAKEFILEDEPS=""
+
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+ fi
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ # Compute PROPERTIESFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+ # Compute CLASSFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+ # Compute QMFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+ # Compute MSGFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+ # Compute RESOURCESDLLFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ PROPERTIESFILES=
+ CLASSFILES=
+ QMFILES=
+ MSGFILES=
+ RESOURCESDLLFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+ QMFILES="$QMFILES $srcdirpre$lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ JAVACATALOGS=
+ QTCATALOGS=
+ TCLCATALOGS=
+ CSHARPCATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+ QTCATALOGS="$QTCATALOGS $lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ fi
+
+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCL [...]
+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+ @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+ \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+ @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+ \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if test -n "$POMAKEFILEDEPS"; then
+ cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+ fi
+ mv "$ac_file.tmp" "$ac_file"
+])
+
+dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
+AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
+[
+ XGETTEXT_EXTRA_OPTIONS=
+])
+
+dnl Registers an option to be passed to xgettext in the po subdirectory.
+AC_DEFUN([AM_XGETTEXT_OPTION],
+[
+ AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
+])
diff --git a/config/progtest.m4 b/config/progtest.m4
new file mode 100644
index 0000000..a56365c
--- /dev/null
+++ b/config/progtest.m4
@@ -0,0 +1,92 @@
+# progtest.m4 serial 4 (gettext-0.14.2)
+dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper at cygnus.com>, 1996.
+
+AC_PREREQ(2.50)
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ [[\\/]]* | ?:[[\\/]]*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
diff --git a/config/py-compile b/config/py-compile
new file mode 100755
index 0000000..d6e900b
--- /dev/null
+++ b/config/py-compile
@@ -0,0 +1,146 @@
+#!/bin/sh
+# py-compile - Compile a Python program
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+if [ -z "$PYTHON" ]; then
+ PYTHON=python
+fi
+
+basedir=
+destdir=
+files=
+while test $# -ne 0; do
+ case "$1" in
+ --basedir)
+ basedir=$2
+ if test -z "$basedir"; then
+ echo "$0: Missing argument to --basedir." 1>&2
+ exit 1
+ fi
+ shift
+ ;;
+ --destdir)
+ destdir=$2
+ if test -z "$destdir"; then
+ echo "$0: Missing argument to --destdir." 1>&2
+ exit 1
+ fi
+ shift
+ ;;
+ -h|--h*)
+ cat <<\EOF
+Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
+
+Byte compile some python scripts FILES. Use --destdir to specify any
+leading directory path to the FILES that you don't want to include in the
+byte compiled file. Specify --basedir for any additional path information you
+do want to be shown in the byte compiled file.
+
+Example:
+ py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v|--v*)
+ echo "py-compile $scriptversion"
+ exit $?
+ ;;
+ *)
+ files="$files $1"
+ ;;
+ esac
+ shift
+done
+
+if test -z "$files"; then
+ echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
+ exit 1
+fi
+
+# if basedir was given, then it should be prepended to filenames before
+# byte compilation.
+if [ -z "$basedir" ]; then
+ pathtrans="path = file"
+else
+ pathtrans="path = os.path.join('$basedir', file)"
+fi
+
+# if destdir was given, then it needs to be prepended to the filename to
+# byte compile but not go into the compiled file.
+if [ -z "$destdir" ]; then
+ filetrans="filepath = path"
+else
+ filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
+fi
+
+$PYTHON -c "
+import sys, os, string, py_compile
+
+files = '''$files'''
+
+print 'Byte-compiling python modules...'
+for file in string.split(files):
+ $pathtrans
+ $filetrans
+ if not os.path.exists(filepath) or not (len(filepath) >= 3
+ and filepath[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(filepath, filepath + 'c', path)
+print" || exit $?
+
+# this will fail for python < 1.5, but that doesn't matter ...
+$PYTHON -O -c "
+import sys, os, string, py_compile
+
+files = '''$files'''
+print 'Byte-compiling python modules (optimized versions) ...'
+for file in string.split(files):
+ $pathtrans
+ $filetrans
+ if not os.path.exists(filepath) or not (len(filepath) >= 3
+ and filepath[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(filepath, filepath + 'o', path)
+print" 2>/dev/null || :
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..bb88c9b
--- /dev/null
+++ b/configure
@@ -0,0 +1,31615 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for ncs 2.0.0-beta2.
+#
+# Report bugs to <saturne-support at edf.fr>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell bug-autoconf at gnu.org about your system,
+ echo including any error possibly output before this message.
+ echo This can help us improve future autoconf versions.
+ echo Configuration will now proceed without shell functions.
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+$*
+_LT_EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='ncs'
+PACKAGE_TARNAME='ncs'
+PACKAGE_VERSION='2.0.0-beta2'
+PACKAGE_STRING='ncs 2.0.0-beta2'
+PACKAGE_BUGREPORT='saturne-support at edf.fr'
+
+ac_unique_file="src/apps/cs_solver.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+gt_needs=
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+POSUB
+LTLIBINTL
+LIBINTL
+INTLLIBS
+LTLIBICONV
+LIBICONV
+INTL_MACOSX_LIBS
+XGETTEXT_EXTRA_OPTIONS
+MSGMERGE
+XGETTEXT_015
+XGETTEXT
+GMSGFMT_015
+MSGFMT_015
+GMSGFMT
+MSGFMT
+GETTEXT_MACRO_VERSION
+USE_NLS
+pkgpyexecdir
+pyexecdir
+pkgpythondir
+pythondir
+PYTHON_PLATFORM
+PYTHON_EXEC_PREFIX
+PYTHON_PREFIX
+PYTHON_VERSION
+PYTHON
+cs_python
+PYEXE
+HAVE_GUI_FALSE
+HAVE_GUI_TRUE
+ecs_prefix
+SYRTHES_LIBS
+SYRTHES_LDFLAGS
+SYRTHES_CPPFLAGS
+SYRTHES_FCLIBS
+SYRTHES_FCFLAGS
+SYRTHES_CFLAGS
+SYRTHES_FC
+SYRTHES_CC
+syrthes_prefix
+FLIBS
+ac_ct_F77
+FFLAGS
+F77
+MPI_TYPE
+MPI_BIN
+MPI_LIBS
+MPI_LDFLAGS
+MPI_CPPFLAGS
+HAVE_MPI_FALSE
+HAVE_MPI_TRUE
+BLAS_LIBS
+BLAS_LDFLAGS
+BLAS_CPPFLAGS
+LIBXML2_LIBS
+LIBXML2_LDFLAGS
+LIBXML2_CPPFLAGS
+HAVE_LIBXML2_FALSE
+HAVE_LIBXML2_TRUE
+mei_libdir
+MEI_LIBS
+MEI_LDFLAGS
+MEI_CPPFLAGS
+HAVE_MEI_FALSE
+HAVE_MEI_TRUE
+FVM_LIBS
+FVM_LDFLAGS
+FVM_CPPFLAGS
+BFT_LIBS
+BFT_LDFLAGS
+BFT_CPPFLAGS
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+lt_ECHO
+RANLIB
+AR
+OBJDUMP
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+LIBTOOL
+LDRPATH
+FCFLAGS_HOT
+FCFLAGS_OPT
+FCFLAGS_DBG
+CFLAGS_EXT
+CFLAGS_HOT
+CFLAGS_OPT
+CFLAGS_DBG
+FCLIBS
+SED
+LN_S
+ac_ct_FC
+FCFLAGS
+FC
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+ac_aux_dir
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files='cs_config_comments'
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_debug
+enable_auto_flags
+enable_french
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+enable_openmp
+with_bft
+with_bft_exec
+with_bft_include
+with_bft_lib
+with_fvm
+with_fvm_exec
+with_fvm_include
+with_fvm_lib
+enable_mei
+with_mei
+with_mei_include
+with_mei_lib
+enable_libxml2
+with_libxml2
+with_libxml2_include
+with_libxml2_lib
+enable_blas
+with_blas
+with_blas_include
+with_blas_lib
+with_blas_type
+with_blas_libs
+enable_mpi
+with_mpi
+with_mpi_exec
+with_mpi_include
+with_mpi_lib
+with_syrthes
+with_prepro
+enable_gui
+with_python_exec
+enable_sockets
+enable_dlloader
+enable_nls
+enable_rpath
+with_libiconv_prefix
+with_libintl_prefix
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+FC
+FCFLAGS
+CPP
+F77
+FFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+ { (exit 1); exit 1; }; } ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { $as_echo "$as_me: error: working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures ncs 2.0.0-beta2 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/ncs]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of ncs 2.0.0-beta2:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-debug enable debugging (reduces optimization)
+ --disable-auto-flags do not define *FLAGS on known systems
+ --enable-french enable French translation of Fortran logs
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-openmp disable OpenMP support
+ --disable-mei do not use MEI when available
+ --disable-libxml2 do not use LIBXML2 when available
+ --disable-blas do not use BLAS when available
+ --disable-mpi do not use MPI when available
+ --disable-gui disable the Graphical User Interface
+ --disable-sockets disable communications through IP sockets
+ --disable-dlloader disable dynamic shared library loading
+ --disable-nls do not use Native Language Support
+ --disable-rpath do not hardcode runtime library paths
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-bft=PATH specify prefix directory for BFT
+ --with-bft-exec=PATH specify directory for BFT executables
+ --with-bft-include=PATH specify directory for BFT include files
+ --with-bft-lib=PATH specify directory for BFT library
+ --with-fvm=PATH specify prefix directory for FVM
+ --with-fvm-exec=PATH specify directory for FVM executables
+ --with-fvm-include=PATH specify directory for FVM include files
+ --with-fvm-lib=PATH specify directory for FVM library
+ --with-mei=PATH specify prefix directory for MEI
+ --with-mei-include=PATH specify directory for MEI include files
+ --with-mei-lib=PATH specify directory for MEI library
+ --with-libxml2=PATH specify prefix directory for LIBXML2
+ --with-libxml2-include=PATH
+ specify directory for LIBXML2 include files
+ --with-libxml2-lib=PATH specify directory for LIBXML2 library
+ --with-blas=PATH specify prefix directory for BLAS
+ --with-blas-include=PATH
+ specify directory for BLAS include files
+ --with-blas-lib=PATH specify directory for BLAS library
+ --with-blas-type=NAME force ATLAS, ESSL, MKL, ...
+ --with-blas-libs=LIBS specify BLAS libraries
+ --with-mpi=PATH specify prefix directory for MPI
+ --with-mpi-exec=PATH specify prefix directory for MPI executables
+ --with-mpi-include=PATH specify directory for MPI include files
+ --with-mpi-lib=PATH specify directory for MPI library
+ --with-syrthes=PATH specify prefix directory for SYRTHES
+ --with-prepro=PATH specify prefix directory for the Preprocessor
+ --with-python-exec=PATH specify prefix directory for a Python interpreter
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
+ --without-libiconv-prefix don't search for libiconv in includedir and libdir
+ --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
+ --without-libintl-prefix don't search for libintl in includedir and libdir
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ FC Fortran compiler command
+ FCFLAGS Fortran compiler flags
+ CPP C preprocessor
+ F77 Fortran 77 compiler command
+ FFLAGS Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <saturne-support at edf.fr>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+ncs configure 2.0.0-beta2
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by ncs $as_me 2.0.0-beta2, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+gt_needs="$gt_needs "
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+# Use the config directory for libtool stuff ...
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$target_alias" = x; then
+ ac_cv_target=$ac_cv_host
+else
+ ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+ac_config_headers="$ac_config_headers cs_config.h"
+
+
+
+
+am__api_version='1.10'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='ncs'
+ VERSION='2.0.0-beta2'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+#------------------------------------------------------------------------------
+# Checks for programs.
+#------------------------------------------------------------------------------
+
+# Check for C and Fortran compilers
+#----------------------------------
+
+user_CPPFLAGS=$CPPFLAGS
+user_CFLAGS=$CFLAGS
+user_FCFLAGS=$FCFLAGS
+user_LDFLAGS=$LDFLAGS
+user_LIBS=$LIBS
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$FC"; then
+ ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+ { $as_echo "$as_me:$LINENO: result: $FC" >&5
+$as_echo "$FC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$FC" && break
+ done
+fi
+if test -z "$FC"; then
+ ac_ct_FC=$FC
+ for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_FC"; then
+ ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_FC="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_FC" >&5
+$as_echo "$ac_ct_FC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_FC" && break
+done
+
+ if test "x$ac_ct_FC" = x; then
+ FC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ FC=$ac_ct_FC
+ fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
+if test "${ac_cv_fc_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_fc_compiler_gnu" >&5
+$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FCFLAGS+set}
+ac_save_FFLAGS=$FCFLAGS
+FCFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $FC accepts -g" >&5
+$as_echo_n "checking whether $FC accepts -g... " >&6; }
+if test "${ac_cv_prog_fc_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ FCFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_fc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_prog_fc_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_fc_g" >&5
+$as_echo "$ac_cv_prog_fc_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+ FCFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+ if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+ FCFLAGS="-g -O2"
+ else
+ FCFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+ FCFLAGS="-O2"
+ else
+ FCFLAGS=
+ fi
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ $as_unset ac_script || ac_script=
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+
+
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $FC" >&5
+$as_echo_n "checking how to get verbose linking output from $FC... " >&6; }
+if test "${ac_cv_prog_fc_v+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_fc_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FCFLAGS
+FCFLAGS="$FCFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_fc_v_output=`eval $ac_link 5>&1 2>&1 |
+ grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_fc_v_output" >&5
+FCFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_fc_v_output="`echo $ac_fc_v_output |
+ grep 'LPATH is:' |
+ sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+# that detects unbalanced quotes in FLIBS should be implemented
+# and (ugh) tested at some point.
+case $ac_fc_v_output in
+ # If we are using xlf then replace all the commas with spaces.
+ *xlfentry*)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;;
+
+ # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+ # $LIBS confuse us, and the libraries appear later in the output anyway).
+ *mGLOB_options_string*)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+ # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+ # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+ # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+ *-cmdline\ * | *-ignore\ * | *-def\ *)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed "\
+ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g
+ s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g
+ s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;;
+
+ # If we are using Cray Fortran then delete quotes.
+ *cft90*)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;;
+esac
+
+
+ # look for -l* and *.a constructs in the output
+ for ac_arg in $ac_fc_v_output; do
+ case $ac_arg in
+ [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+ ac_cv_prog_fc_v=$ac_verb
+ break 2 ;;
+ esac
+ done
+done
+if test -z "$ac_cv_prog_fc_v"; then
+ { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $FC" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;}
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_fc_v" >&5
+$as_echo "$ac_cv_prog_fc_v" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for Fortran libraries of $FC" >&5
+$as_echo_n "checking for Fortran libraries of $FC... " >&6; }
+if test "${ac_cv_fc_libs+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$FCLIBS" != "x"; then
+ ac_cv_fc_libs="$FCLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FCFLAGS
+FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_fc_v_output=`eval $ac_link 5>&1 2>&1 |
+ grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_fc_v_output" >&5
+FCFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_fc_v_output="`echo $ac_fc_v_output |
+ grep 'LPATH is:' |
+ sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+# that detects unbalanced quotes in FLIBS should be implemented
+# and (ugh) tested at some point.
+case $ac_fc_v_output in
+ # If we are using xlf then replace all the commas with spaces.
+ *xlfentry*)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;;
+
+ # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+ # $LIBS confuse us, and the libraries appear later in the output anyway).
+ *mGLOB_options_string*)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+ # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+ # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+ # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+ *-cmdline\ * | *-ignore\ * | *-def\ *)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed "\
+ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g
+ s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g
+ s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;;
+
+ # If we are using Cray Fortran then delete quotes.
+ *cft90*)
+ ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_fc_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_fc_v_output
+while test $# != 1; do
+ shift
+ ac_arg=$1
+ case $ac_arg in
+ [\\/]*.a | ?:[\\/]*.a)
+ ac_exists=false
+ for ac_i in $ac_cv_fc_libs; do
+ if test x"$ac_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+fi
+
+ ;;
+ -bI:*)
+ ac_exists=false
+ for ac_i in $ac_cv_fc_libs; do
+ if test x"$ac_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ if test "$ac_compiler_gnu" = yes; then
+ for ac_link_opt in $ac_arg; do
+ ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt"
+ done
+else
+ ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+fi
+fi
+
+ ;;
+ # Ignore these flags.
+ -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
+ ;;
+ -lkernel32)
+ test x"$CYGWIN" != xyes && ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+ ;;
+ -[LRuYz])
+ # These flags, when seen by themselves, take an argument.
+ # We remove the space between option and argument and re-iterate
+ # unless we find an empty arg or a new option (starting with -)
+ case $2 in
+ "" | -*);;
+ *)
+ ac_arg="$ac_arg$2"
+ shift; shift
+ set X $ac_arg "$@"
+ ;;
+ esac
+ ;;
+ -YP,*)
+ for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+ ac_exists=false
+ for ac_i in $ac_cv_fc_libs; do
+ if test x"$ac_j" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ ac_arg="$ac_arg $ac_j"
+ ac_cv_fc_libs="$ac_cv_fc_libs $ac_j"
+fi
+
+ done
+ ;;
+ -[lLR]*)
+ ac_exists=false
+ for ac_i in $ac_cv_fc_libs; do
+ if test x"$ac_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+fi
+
+ ;;
+ -zallextract*| -zdefaultextract)
+ ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+ ;;
+ # Ignore everything else.
+ esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+ "SunOS 5"*)
+ ac_ld_run_path=`$as_echo "$ac_fc_v_output" |
+ sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+ test "x$ac_ld_run_path" != x &&
+ if test "$ac_compiler_gnu" = yes; then
+ for ac_link_opt in $ac_ld_run_path; do
+ ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt"
+ done
+else
+ ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path"
+fi
+ ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_fc_libs" >&5
+$as_echo "$ac_cv_fc_libs" >&6; }
+FCLIBS="$ac_cv_fc_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Debug or production compilation mode (debug by default) ?
+
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+ enableval=$enable_debug;
+ case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-debug" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ debug=false
+
+fi
+
+
+# Optionally deactivate automatic determination of flags on known systems
+
+# Check whether --enable-auto-flags was given.
+if test "${enable_auto_flags+set}" = set; then
+ enableval=$enable_auto_flags;
+ case "${enableval}" in
+ yes) auto_flags=true ;;
+ no) auto_flags=false ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-auto-flags" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-auto-flags" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ auto_flags=true
+
+fi
+
+
+# Optionally activate French translation of Fortran logs (compile-time)
+
+# Check whether --enable-french was given.
+if test "${enable_french+set}" = set; then
+ enableval=$enable_french;
+ case "${enableval}" in
+ yes) french=true ;;
+ no) french=false ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-french" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-french" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ french=false
+
+fi
+
+
+# Default compiler options (may be modified
+# by defining CFLAGS in the environment)
+#------------------------------------------
+
+if test "x$auto_flags" = "xtrue" ; then
+
+ # Source associated recommended compiler options
+
+ if test -f "$srcdir/config/cs_auto_flags.sh" ; then
+ { $as_echo "$as_me:$LINENO: sourcing config/cs_auto_flags.sh (test for known compilers)" >&5
+$as_echo "$as_me: sourcing config/cs_auto_flags.sh (test for known compilers)" >&6;}
+ . "$srcdir/config/cs_auto_flags.sh"
+ else
+ { $as_echo "$as_me:$LINENO: WARNING: config/cs_auto_flags.sh default configuration file not found" >&5
+$as_echo "$as_me: WARNING: config/cs_auto_flags.sh default configuration file not found" >&2;}
+ fi
+
+ # Default flags
+ CPPFLAGS="$cppflags_default $user_CPPFLAGS"
+ CFLAGS="$cflags_default $user_CFLAGS"
+ FCFLAGS="$fcflags_default $user_FCFLAGS"
+ LDFLAGS="$ldflags_default $user_LDFLAGS"
+ LIBS="$libs_default $user_LIBS"
+ LDRPATH="$ldflags_rpath"
+
+ if test "x$debug" = xtrue; then
+ # Debug flags
+ CFLAGS_DBG="$cflags_default_dbg"
+ FCFLAGS_DBG="$fcflags_default_dbg"
+ # Add debug flags for linker
+ LDFLAGS="$LDFLAGS $ldflags_default_dbg"
+ else
+ # Normal optimization flags
+ CFLAGS_OPT="$cflags_default_opt"
+ FCFLAGS_OPT="$fcflags_default_opt"
+ # Hot optimization flags
+ CFLAGS_HOT="$cflags_default_hot"
+ FCFLAGS_HOT="$fcflags_default_hot"
+ # Add optimization flags for linker
+ LDFLAGS="$LDFLAGS $ldflags_default_opt"
+ fi
+ CFLAGS_EXT="$cflags_default_ext"
+
+
+
+
+
+
+
+
+
+
+
+fi
+
+# Add some preprocessor flags to include additional system features
+#------------------------------------------------------------------
+
+case "$host_os" in
+ linux*)
+ CPPFLAGS="${CPPFLAGS} -D_POSIX_SOURCE"
+ ;;
+ *bsd* | solaris2.* | aix*)
+ ;;
+ darwin*)
+ CPPFLAGS="${CPPFLAGS} -D_DARWIN_C_SOURCE"
+ ;;
+ osf*)
+ CPPFLAGS="${CPPFLAGS} -D_OSF_SOURCE"
+ ;;
+ hpux*)
+ CPPFLAGS="${CPPFLAGS} -D_HPUX_SOURCE"
+ ;;
+ *)
+ ;;
+esac
+
+# Preprocessor flags for debugging purposes
+
+if test "x$debug" = "xtrue"; then
+ CPPFLAGS="${CPPFLAGS} -DDEBUG"
+else
+ CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+fi
+
+# Fortran flags for French translation
+
+if test "x$french" = "xtrue"; then
+ FCFLAGS="${FCFLAGS} -D_CS_LANG_FR"
+fi
+
+# We may only turn on processing for libtool now that the basic compiler
+# and linker flags are set (to avoid issues with linkers with different
+# modes such as 32 and 64 bit which may be modified by compiler or
+# linker flags).
+
+# AC_DISABLE_SHARED may not be used inside a test, as it seems to
+# take effect whether the result is true or not (maybe due to a bug),
+# so we directly use autoconf's enable_shared variable.
+
+if test "x$cs_disable_shared" = "xyes" ; then
+ enable_shared=no
+fi
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.6'
+macro_revision='1.3012'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ $as_unset ac_script || ac_script=
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:5527: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:5530: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:5533: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 6728 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ lt_cv_cc_needs_belf=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_cc_needs_belf=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ lt_cv_ld_exported_symbols_list=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_ld_exported_symbols_list=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$FC"; then
+ ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+ { $as_echo "$as_me:$LINENO: result: $FC" >&5
+$as_echo "$FC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$FC" && break
+ done
+fi
+if test -z "$FC"; then
+ ac_ct_FC=$FC
+ for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_FC"; then
+ ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_FC="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_FC" >&5
+$as_echo "$ac_ct_FC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_FC" && break
+done
+
+ if test "x$ac_ct_FC" = x; then
+ FC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ FC=$ac_ct_FC
+ fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
+if test "${ac_cv_fc_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_fc_compiler_gnu" >&5
+$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FCFLAGS+set}
+ac_save_FFLAGS=$FCFLAGS
+FCFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $FC accepts -g" >&5
+$as_echo_n "checking whether $FC accepts -g... " >&6; }
+if test "${ac_cv_prog_fc_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ FCFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_fc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_prog_fc_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_fc_g" >&5
+$as_echo "$ac_cv_prog_fc_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+ FCFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+ if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+ FCFLAGS="-g -O2"
+ else
+ FCFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+ FCFLAGS="-O2"
+ else
+ FCFLAGS=
+ fi
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:$LINENO: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:8849: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:8853: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:9188: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:9192: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:9293: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:9297: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:9348: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:9352: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+ else
+ archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+ shlibpath_overrides_runpath=yes
+fi
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_func_shl_load=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_func_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_svld_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_dld_link=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 12148 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 12244 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+archive_cmds_need_lc_FC=no
+allow_undefined_flag_FC=
+always_export_symbols_FC=no
+archive_expsym_cmds_FC=
+export_dynamic_flag_spec_FC=
+hardcode_direct_FC=no
+hardcode_direct_absolute_FC=no
+hardcode_libdir_flag_spec_FC=
+hardcode_libdir_flag_spec_ld_FC=
+hardcode_libdir_separator_FC=
+hardcode_minus_L_FC=no
+hardcode_automatic_FC=no
+inherit_rpath_FC=no
+module_cmds_FC=
+module_expsym_cmds_FC=
+link_all_deplibs_FC=unknown
+old_archive_cmds_FC=$old_archive_cmds
+no_undefined_flag_FC=
+whole_archive_flag_spec_FC=
+enable_shared_with_static_runtimes_FC=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+objext_FC=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+ # save warnings/boilerplate of simple test code
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${FC-"f95"}
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ compiler_FC=$CC
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+ if test -n "$compiler"; then
+ { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+ GCC_FC="$ac_cv_fc_compiler_gnu"
+ LD_FC="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ # Dependencies to place before and after the object being linked:
+predep_objects_FC=
+postdep_objects_FC=
+predeps_FC=
+postdeps_FC=
+compiler_lib_search_path_FC=
+
+cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_FC"; then
+ compiler_lib_search_path_FC="${prev}${p}"
+ else
+ compiler_lib_search_path_FC="${compiler_lib_search_path_FC} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_FC"; then
+ postdeps_FC="${prev}${p}"
+ else
+ postdeps_FC="${postdeps_FC} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_FC"; then
+ predep_objects_FC="$p"
+ else
+ predep_objects_FC="$predep_objects_FC $p"
+ fi
+ else
+ if test -z "$postdep_objects_FC"; then
+ postdep_objects_FC="$p"
+ else
+ postdep_objects_FC="$postdep_objects_FC $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling FC test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+
+
+case " $postdeps_FC " in
+*" -lc "*) archive_cmds_need_lc_FC=no ;;
+esac
+ compiler_lib_search_dirs_FC=
+if test -n "${compiler_lib_search_path_FC}"; then
+ compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lt_prog_compiler_wl_FC=
+lt_prog_compiler_pic_FC=
+lt_prog_compiler_static_FC=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_static_FC='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_FC='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_FC='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_FC='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_FC='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_FC='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_FC=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_FC='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_FC=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic_FC='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_FC='-Bstatic'
+ else
+ lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_FC='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_FC='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_FC='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_pic_FC='-fPIC'
+ lt_prog_compiler_static_FC='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_pic_FC='--shared'
+ lt_prog_compiler_static_FC='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_pic_FC='-fpic'
+ lt_prog_compiler_static_FC='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_FC='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_pic_FC='-qpic'
+ lt_prog_compiler_static_FC='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ lt_prog_compiler_wl_FC='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ lt_prog_compiler_wl_FC=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_FC='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_FC='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static_FC='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_FC='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_FC='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_FC='-Qoption ld '
+ lt_prog_compiler_pic_FC='-PIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_FC='-Kconform_pic'
+ lt_prog_compiler_static_FC='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_pic_FC='-KPIC'
+ lt_prog_compiler_static_FC='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl_FC='-Wl,'
+ lt_prog_compiler_can_build_shared_FC=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_FC='-pic'
+ lt_prog_compiler_static_FC='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_FC=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_FC=
+ ;;
+ *)
+ lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC"
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_FC" >&5
+$as_echo "$lt_prog_compiler_pic_FC" >&6; }
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_FC"; then
+ { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_FC=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_FC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13046: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:13050: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_FC=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_FC" = xyes; then
+ case $lt_prog_compiler_pic_FC in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;;
+ esac
+else
+ lt_prog_compiler_pic_FC=
+ lt_prog_compiler_can_build_shared_FC=no
+fi
+
+fi
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_FC=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_FC=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_FC=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_FC" = xyes; then
+ :
+else
+ lt_prog_compiler_static_FC=
+fi
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_FC=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13145: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:13149: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_FC=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_FC=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13197: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:13201: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_FC=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag_FC=
+ always_export_symbols_FC=no
+ archive_cmds_FC=
+ archive_expsym_cmds_FC=
+ compiler_needs_object_FC=no
+ enable_shared_with_static_runtimes_FC=no
+ export_dynamic_flag_spec_FC=
+ export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic_FC=no
+ hardcode_direct_FC=no
+ hardcode_direct_absolute_FC=no
+ hardcode_libdir_flag_spec_FC=
+ hardcode_libdir_flag_spec_ld_FC=
+ hardcode_libdir_separator_FC=
+ hardcode_minus_L_FC=no
+ hardcode_shlibpath_var_FC=unsupported
+ inherit_rpath_FC=no
+ link_all_deplibs_FC=unknown
+ module_cmds_FC=
+ module_expsym_cmds_FC=
+ old_archive_from_new_cmds_FC=
+ old_archive_from_expsyms_cmds_FC=
+ thread_safe_flag_spec_FC=
+ whole_archive_flag_spec_FC=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_FC=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_FC=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_FC='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_FC="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_FC=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_FC=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_FC=''
+ ;;
+ m68k)
+ archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ hardcode_minus_L_FC=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_FC=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ allow_undefined_flag_FC=unsupported
+ always_export_symbols_FC=no
+ enable_shared_with_static_runtimes_FC=yes
+ export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_FC=no
+ hardcode_shlibpath_var_FC=no
+ hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_FC='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_FC='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec_FC=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_FC='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_FC=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec_FC=
+ hardcode_libdir_flag_spec_ld_FC='-rpath $libdir'
+ archive_cmds_FC='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_FC=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_FC=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_FC=yes
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_FC" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_FC=
+ export_dynamic_flag_spec_FC=
+ whole_archive_flag_spec_FC=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_FC=unsupported
+ always_export_symbols_FC=yes
+ archive_expsym_cmds_FC='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_FC=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_FC=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_FC=''
+ hardcode_direct_FC=yes
+ hardcode_direct_absolute_FC=yes
+ hardcode_libdir_separator_FC=':'
+ link_all_deplibs_FC=yes
+ file_list_spec_FC='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_FC=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_FC=yes
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ hardcode_libdir_separator_FC=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec_FC='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_FC=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_FC='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_FC='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_FC="-z nodefs"
+ archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_FC=' ${wl}-bernotok'
+ allow_undefined_flag_FC=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_FC='$convenience'
+ archive_cmds_need_lc_FC=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_FC=''
+ ;;
+ m68k)
+ archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ hardcode_minus_L_FC=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec_FC=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_FC=' '
+ allow_undefined_flag_FC=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_FC='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds_FC='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_FC='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_FC=yes
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc_FC=no
+ hardcode_direct_FC=no
+ hardcode_automatic_FC=yes
+ hardcode_shlibpath_var_FC=unsupported
+ whole_archive_flag_spec_FC=''
+ link_all_deplibs_FC=yes
+ allow_undefined_flag_FC="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_FC="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_FC="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs_FC=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_FC=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_FC='-R$libdir'
+ hardcode_direct_FC=yes
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_FC=yes
+ hardcode_minus_L_FC=yes
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds_FC='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_FC='-R$libdir'
+ hardcode_direct_FC=yes
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_FC=:
+ hardcode_direct_FC=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_FC=yes
+ export_dynamic_flag_spec_FC='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_FC='+b $libdir'
+ hardcode_libdir_separator_FC=:
+ hardcode_direct_FC=yes
+ hardcode_direct_absolute_FC=yes
+ export_dynamic_flag_spec_FC='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_FC=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_FC='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_FC='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_FC=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_FC=no
+ hardcode_shlibpath_var_FC=no
+ ;;
+ *)
+ hardcode_direct_FC=yes
+ hardcode_direct_absolute_FC=yes
+ export_dynamic_flag_spec_FC='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_FC=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+ else
+ archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc_FC='no'
+ hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_FC=:
+ inherit_rpath_FC=yes
+ link_all_deplibs_FC=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_FC='-R$libdir'
+ hardcode_direct_FC=yes
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ newsos6)
+ archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_FC=yes
+ hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_FC=:
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_FC=yes
+ hardcode_shlibpath_var_FC=no
+ hardcode_direct_absolute_FC=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_FC='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_FC='-R$libdir'
+ ;;
+ *)
+ archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs_FC=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ hardcode_minus_L_FC=yes
+ allow_undefined_flag_FC=unsupported
+ archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_FC=' -expect_unresolved \*'
+ archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc_FC='no'
+ hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_FC=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_FC=' -expect_unresolved \*'
+ archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_FC='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_FC='-rpath $libdir'
+ fi
+ archive_cmds_need_lc_FC='no'
+ hardcode_libdir_separator_FC=:
+ ;;
+
+ solaris*)
+ no_undefined_flag_FC=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_FC='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds_FC='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds_FC='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec_FC='-R$libdir'
+ hardcode_shlibpath_var_FC=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_FC='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs_FC=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_FC='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ hardcode_direct_FC=yes
+ hardcode_minus_L_FC=yes
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_FC=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_FC='$CC -r -o $output$reload_objs'
+ hardcode_direct_FC=no
+ ;;
+ motorola)
+ archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_FC=no
+ export_dynamic_flag_spec_FC='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_FC=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_FC=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_FC='${wl}-z,text'
+ archive_cmds_need_lc_FC=no
+ hardcode_shlibpath_var_FC=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_FC='${wl}-z,text'
+ allow_undefined_flag_FC='${wl}-z,nodefs'
+ archive_cmds_need_lc_FC=no
+ hardcode_shlibpath_var_FC=no
+ hardcode_libdir_flag_spec_FC='${wl}-R,$libdir'
+ hardcode_libdir_separator_FC=':'
+ link_all_deplibs_FC=yes
+ export_dynamic_flag_spec_FC='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_FC='-L$libdir'
+ hardcode_shlibpath_var_FC=no
+ ;;
+
+ *)
+ ld_shlibs_FC=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec_FC='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_FC" >&5
+$as_echo "$ld_shlibs_FC" >&6; }
+test "$ld_shlibs_FC" = no && can_build_shared=no
+
+with_gnu_ld_FC=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_FC" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_FC=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_FC in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_FC
+ pic_flag=$lt_prog_compiler_pic_FC
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_FC
+ allow_undefined_flag_FC=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_FC=no
+ else
+ archive_cmds_need_lc_FC=yes
+ fi
+ allow_undefined_flag_FC=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_FC" >&5
+$as_echo "$archive_cmds_need_lc_FC" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_FC\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\""
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+ shlibpath_overrides_runpath=yes
+fi
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_FC=
+if test -n "$hardcode_libdir_flag_spec_FC" ||
+ test -n "$runpath_var_FC" ||
+ test "X$hardcode_automatic_FC" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_FC" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no &&
+ test "$hardcode_minus_L_FC" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_FC=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_FC=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_FC=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_FC" >&5
+$as_echo "$hardcode_action_FC" >&6; }
+
+if test "$hardcode_action_FC" = relink ||
+ test "$inherit_rpath_FC" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+#------------------------------------------------------------------------------
+# Checks for typedefs, structures, and compiler characteristics.
+#------------------------------------------------------------------------------
+
+{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if test "${ac_cv_c_const+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_c_const=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_c_const=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const /**/
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if test "${ac_cv_c_inline+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_c_inline=$ac_kw
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_size_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((size_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_size_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
+if test "x$ac_cv_type_size_t" = x""yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
+$as_echo_n "checking for pid_t... " >&6; }
+if test "${ac_cv_type_pid_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_pid_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (pid_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((pid_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_pid_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+$as_echo "$ac_cv_type_pid_t" >&6; }
+if test "x$ac_cv_type_pid_t" = x""yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if test "${ac_cv_header_time+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_time=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_time=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if test "${ac_cv_header_stdbool_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ bool e = &s;
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+# if defined __xlc__ || defined __GNUC__
+ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+ reported by James Lemley on 2005-10-05; see
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+ This test is not quite right, since xlc is allowed to
+ reject this program, as the initializer for xlcbug is
+ not one of the forms that C requires support for.
+ However, doing the test right would require a runtime
+ test, and that would make cross-compilation harder.
+ Let us hope that IBM fixes the xlc bug, and also adds
+ support for this kind of constant expression. In the
+ meantime, this test will reject xlc, which is OK, since
+ our stdbool.h substitute should suffice. We also test
+ this with GCC, where it should work, to detect more
+ quickly whether someone messes up the test in the
+ future. */
+ char digs[] = "0123456789";
+ int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+# endif
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main ()
+{
+
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdbool_h=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdbool_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for _Bool" >&5
+$as_echo_n "checking for _Bool... " >&6; }
+if test "${ac_cv_type__Bool+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type__Bool=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (_Bool))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((_Bool)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type__Bool=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
+$as_echo "$ac_cv_type__Bool" >&6; }
+if test "x$ac_cv_type__Bool" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STDBOOL_H 1
+_ACEOF
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for long long" >&5
+$as_echo_n "checking for long long... " >&6; }
+if test "${ac_cv_type_long_long+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_long_long=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (long long))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((long long)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_long_long=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+$as_echo "$ac_cv_type_long_long" >&6; }
+if test "x$ac_cv_type_long_long" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LONG_LONG 1
+_ACEOF
+
+
+fi
+{ $as_echo "$as_me:$LINENO: checking for unsigned long long" >&5
+$as_echo_n "checking for unsigned long long... " >&6; }
+if test "${ac_cv_type_unsigned_long_long+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_unsigned_long_long=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (unsigned long long))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((unsigned long long)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_unsigned_long_long=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
+$as_echo "$ac_cv_type_unsigned_long_long" >&6; }
+if test "x$ac_cv_type_unsigned_long_long" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNSIGNED_LONG_LONG 1
+_ACEOF
+
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for int32_t" >&5
+$as_echo_n "checking for int32_t... " >&6; }
+if test "${ac_cv_type_int32_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_int32_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (int32_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((int32_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_int32_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5
+$as_echo "$ac_cv_type_int32_t" >&6; }
+if test "x$ac_cv_type_int32_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT32_T 1
+_ACEOF
+
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for int64_t" >&5
+$as_echo_n "checking for int64_t... " >&6; }
+if test "${ac_cv_type_int64_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_int64_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (int64_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((int64_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_int64_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5
+$as_echo "$ac_cv_type_int64_t" >&6; }
+if test "x$ac_cv_type_int64_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT64_T 1
+_ACEOF
+
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for uint32_t" >&5
+$as_echo_n "checking for uint32_t... " >&6; }
+if test "${ac_cv_type_uint32_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_uint32_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (uint32_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((uint32_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_uint32_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5
+$as_echo "$ac_cv_type_uint32_t" >&6; }
+if test "x$ac_cv_type_uint32_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT32_T 1
+_ACEOF
+
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for uint64_t" >&5
+$as_echo_n "checking for uint64_t... " >&6; }
+if test "${ac_cv_type_uint64_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_uint64_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (uint64_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((uint64_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_uint64_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5
+$as_echo "$ac_cv_type_uint64_t" >&6; }
+if test "x$ac_cv_type_uint64_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT64_T 1
+_ACEOF
+
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
+$as_echo_n "checking for ptrdiff_t... " >&6; }
+if test "${ac_cv_type_ptrdiff_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_type_ptrdiff_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (ptrdiff_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((ptrdiff_t)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_ptrdiff_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5
+$as_echo "$ac_cv_type_ptrdiff_t" >&6; }
+if test "x$ac_cv_type_ptrdiff_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if test "${ac_cv_sizeof_void_p+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_void_p=$ac_lo;;
+'') if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (void *)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (void *)); }
+static unsigned long int ulongval () { return (long int) (sizeof (void *)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (void *))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (void *))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (void *))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_void_p=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (void *)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if test "${ac_cv_sizeof_short+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_short=$ac_lo;;
+'') if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_short=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (short)); }
+static unsigned long int ulongval () { return (long int) (sizeof (short)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (short))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (short))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (short))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_short=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_int=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (int)); }
+static unsigned long int ulongval () { return (long int) (sizeof (int)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (int))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (int))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (int))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_int=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (long)); }
+static unsigned long int ulongval () { return (long int) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (long))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (long))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (long))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of float" >&5
+$as_echo_n "checking size of float... " >&6; }
+if test "${ac_cv_sizeof_float+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_float=$ac_lo;;
+'') if test "$ac_cv_type_float" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (float)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_float=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (float)); }
+static unsigned long int ulongval () { return (long int) (sizeof (float)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (float))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (float))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (float))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_float=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_float" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (float)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_float=0
+ fi
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5
+$as_echo "$ac_cv_sizeof_float" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_FLOAT $ac_cv_sizeof_float
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of double" >&5
+$as_echo_n "checking size of double... " >&6; }
+if test "${ac_cv_sizeof_double+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_double=$ac_lo;;
+'') if test "$ac_cv_type_double" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (double)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_double=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (double)); }
+static unsigned long int ulongval () { return (long int) (sizeof (double)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (double))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (double))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (double))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_double=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_double" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (double)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+ else
+ ac_cv_sizeof_double=0
+ fi
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
+$as_echo "$ac_cv_sizeof_double" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DOUBLE $ac_cv_sizeof_double
+_ACEOF
+
+
+
+#------------------------------------------------------------------------------
+# Determine OpenMP support
+#------------------------------------------------------------------------------
+
+# It seems that we may not use AC_OPENMP both for C and Fortran, so
+# we use our own method here, based on flags already set by default
+# or by the user.
+
+# From this point, no runtime tests should be run, so no issues should
+# arise due to missing RPATH or LD_LIBRARY_PATH values in case of non-standard
+# compiler install paths, such as may happen with gcc's libgomp.
+
+cs_have_openmp=no
+
+# Check whether --enable-openmp was given.
+if test "${enable_openmp+set}" = set; then
+ enableval=$enable_openmp;
+ case "${enableval}" in
+ yes) cs_have_openmp=yes ;;
+ no) cs_have_openmp=no ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-openmp" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-openmp" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ cs_have_openmp=no
+
+fi
+
+
+if test "x$cs_have_openmp" = "xyes" ; then
+
+ saved_CFLAGS="$CFLAGS"
+ saved_FCFLAGS="$FCFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+
+ CFLAGS="${CFLAGS} ${cflags_default_omp}"
+ FCFLAGS="${FCFLAGS} ${fcflags_default_omp}"
+ LDFLAGS="${LDFLAGS} ${cflags_default_omp}"
+
+ { $as_echo "$as_me:$LINENO: checking for OpenMP (C)" >&5
+$as_echo_n "checking for OpenMP (C)... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <omp.h>
+int
+main ()
+{
+ omp_get_num_threads();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ cs_have_openmp=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_openmp=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_openmp" >&5
+$as_echo "$cs_have_openmp" >&6; }
+ if test "x$cs_have_openmp" = "xyes" ; then
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+ { $as_echo "$as_me:$LINENO: checking for OpenMP (Fortran)" >&5
+$as_echo_n "checking for OpenMP (Fortran)... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ integer n
+ n = omp_get_num_threads()
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ cs_have_openmp=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_openmp=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_openmp" >&5
+$as_echo "$cs_have_openmp" >&6; }
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ fi
+ if test "x$cs_have_openmp" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENMP 1
+_ACEOF
+
+ else
+ cs_have_openmp=no
+ CFLAGS="$saved_CFLAGS"
+ FCFLAGS="$saved_FCFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+fi
+
+#------------------------------------------------------------------------------
+# Checks for libraries.
+#------------------------------------------------------------------------------
+
+
+
+
+# Check whether --with-bft was given.
+if test "${with_bft+set}" = set; then
+ withval=$with_bft;
+fi
+
+
+# Check whether --with-bft-exec was given.
+if test "${with_bft_exec+set}" = set; then
+ withval=$with_bft_exec;
+fi
+
+
+# Check whether --with-bft-include was given.
+if test "${with_bft_include+set}" = set; then
+ withval=$with_bft_include;
+fi
+
+
+# Check whether --with-bft-lib was given.
+if test "${with_bft_lib+set}" = set; then
+ withval=$with_bft_lib;
+fi
+
+
+if test "x$with_bft_exec" != "x" ; then
+ bft_config="$with_bft_exec/bft-config"
+elif test "x$with_bft" != "x" ; then
+ bft_config="$with_bft/bin/bft-config"
+else
+ bft_config="bft-config"
+fi
+
+if test "x$with_bft_include" != "x" ; then
+ BFT_CPPFLAGS="-I$with_bft_include"
+elif test "x$with_bft" != "x" ; then
+ BFT_CPPFLAGS="-I$with_bft/include"
+else
+ BFT_CPPFLAGS=""
+fi
+
+if test "x$with_bft_lib" != "x" ; then
+ BFT_LDFLAGS="-L$with_bft_lib"
+elif test "x$with_bft" != "x" ; then
+ BFT_LDFLAGS="-L$with_bft/lib"
+else
+ BFT_LDFLAGS=""
+fi
+BFT_LIBS="-lbft"
+
+type "$bft_config" > /dev/null 2>&1
+if test "$?" = "0" ; then
+ BFT_CPPFLAGS="$BFT_CPPFLAGS `$bft_config --cppflags`"
+ BFT_LDFLAGS="$BFT_LDFLAGS `$bft_config --ldflags`"
+ BFT_LIBS="$BFT_LIBS `$bft_config --libs`"
+fi
+
+bft_version_min="1.1.0"
+bft_version_max=
+
+if test "x$bft_version_min" != "x" ; then
+ if test "x$bft_version_max" != "x" ; then
+ { $as_echo "$as_me:$LINENO: checking for bft version >= \"1.1.0\" and <= " >&5
+$as_echo_n "checking for bft version >= \"1.1.0\" and <= ... " >&6; }
+ else
+ { $as_echo "$as_me:$LINENO: checking for bft version >= \"1.1.0\"" >&5
+$as_echo_n "checking for bft version >= \"1.1.0\"... " >&6; }
+ fi
+else
+ bft_version_min="0.0.0"
+fi
+
+bft_version_major_min=`echo "$bft_version_min" | cut -f1 -d.`
+bft_version_minor_min=`echo "$bft_version_min" | cut -f2 -d.`
+bft_version_release_min=`echo "$bft_version_min" | cut -f3 -d.`
+if test "$bft_version_major_min" = "" \
+ -o "$bft_version_minor_min" = "" \
+ -o "$bft_version_release_min" = ""; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: bad BFT version definition in configure.ac: $bft_version_min
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: bad BFT version definition in configure.ac: $bft_version_min
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+if test "x$bft_version_max" != "x" ; then
+ bft_version_major_max=`echo "$bft_version_max" | cut -f1 -d.`
+ bft_version_minor_max=`echo "$bft_version_max" | cut -f2 -d.`
+ bft_version_release_max=`echo "$bft_version_max" | cut -f3 -d.`
+ if test "$bft_version_major_max" = "" \
+ -o "$bft_version_minor_max" = "" \
+ -o "$bft_version_release_max" = ""; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: bad BFT version definition in configure.ac: $bft_version_max
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: bad BFT version definition in configure.ac: $bft_version_max
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+ fi
+else
+ bft_version_major_max=99999999
+ bft_version_minor_max=99999999
+ bft_version_release_max=99999999
+fi
+
+saved_CPPFLAGS=$CPPFLAGS
+saved_LDFLAGS=$LDFLAGS
+saved_LIBS=$LIBS
+
+CPPFLAGS="${CPPFLAGS} $BFT_CPPFLAGS"
+LDFLAGS="${LDFLAGS} $BFT_LDFLAGS"
+LIBS="${LIBS} $BFT_LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <bft_config.h>
+
+int
+main ()
+{
+#if BFT_MAJOR_VERSION < $bft_version_major_min
+# error BFT major version < $bft_version_major_min
+#elif BFT_MAJOR_VERSION == $bft_version_major_min
+# if BFT_MINOR_VERSION < $bft_version_minor_min
+# error BFT minor version < $bft_version_minor_min
+# elif BFT_MINOR_VERSION == $bft_version_minor_min
+# if BFT_RELEASE_VERSION < $bft_version_release_min
+# error BFT release version < $bft_version_release_min
+# endif
+# endif
+#endif
+#if BFT_MAJOR_VERSION > $bft_version_major_max
+# error BFT major version > $bft_version_major_max
+#elif BFT_MAJOR_VERSION == $bft_version_major_max
+# if BFT_MINOR_VERSION > $bft_version_minor_max
+# error BFT minor version > $bft_version_minor_max
+# elif BFT_MINOR_VERSION == $bft_version_minor_max
+# if BFT_RELEASE_VERSION > $bft_version_release_max
+# error BFT release version < $bft_version_release_max
+# endif
+# endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ { $as_echo "$as_me:$LINENO: result: compatible bft version found" >&5
+$as_echo "compatible bft version found" >&6; }
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: compatible bft version not found
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: compatible bft version not found
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+
+unset bft_version_major_min
+unset bft_version_minor_min
+unset bft_version_release_min
+unset bft_version_major_max
+unset bft_version_minor_max
+unset bft_version_release_max
+
+unset bft_version_min
+unset bft_version_max
+unset bft_config
+
+# Restore old LIBS to add $BFT_LIBS later, as other tests
+# might otherwise not run if a shared library is not found
+
+CPPFLAGS=$saved_CPPFLAGS
+LDFLAGS=$saved_LDFLAGS
+LIBS=$saved_LIBS
+
+unset saved_CPPFLAGS
+unset saved_LDFLAGS
+unset saved_LIBS
+
+
+
+
+
+
+
+
+
+# Check whether --with-fvm was given.
+if test "${with_fvm+set}" = set; then
+ withval=$with_fvm;
+fi
+
+
+# Check whether --with-fvm-exec was given.
+if test "${with_fvm_exec+set}" = set; then
+ withval=$with_fvm_exec;
+fi
+
+
+# Check whether --with-fvm-include was given.
+if test "${with_fvm_include+set}" = set; then
+ withval=$with_fvm_include;
+fi
+
+
+# Check whether --with-fvm-lib was given.
+if test "${with_fvm_lib+set}" = set; then
+ withval=$with_fvm_lib;
+fi
+
+
+if test "x$with_fvm_exec" != "x" ; then
+ fvm_config="$with_fvm_exec/fvm-config"
+elif test "x$with_fvm" != "x" ; then
+ fvm_config="$with_fvm/bin/fvm-config"
+else
+ fvm_config="fvm-config"
+fi
+
+if test "x$with_fvm_include" != "x" ; then
+ FVM_CPPFLAGS="-I$with_fvm_include"
+elif test "x$with_fvm" != "x" ; then
+ FVM_CPPFLAGS="-I$with_fvm/include"
+else
+ FVM_CPPFLAGS=""
+fi
+
+if test "x$with_fvm_lib" != "x" ; then
+ FVM_LDFLAGS="-L$with_fvm_lib"
+elif test "x$with_fvm" != "x" ; then
+ FVM_LDFLAGS="-L$with_fvm/lib"
+else
+ FVM_LDFLAGS=""
+fi
+FVM_LIBS="-lfvm"
+
+type "$fvm_config" > /dev/null 2>&1
+if test "$?" = "0" ; then
+ FVM_CPPFLAGS="$FVM_CPPFLAGS `$fvm_config --cppflags`"
+ FVM_DEP_LDFLAGS="`$fvm_config --ldflags`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags cgns`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags med`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags hdf5`"
+ FVM_DEP_LDFLAGS="$FVM_DEP_LDFLAGS `$fvm_config --ldflags mpi`"
+ FVM_DEP_LIBS="`$fvm_config --libs`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs cgns`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs med`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs hdf5`"
+ FVM_DEP_LIBS="$FVM_DEP_LIBS `$fvm_config --libs mpi`"
+fi
+
+fvm_version_min="0.14.0"
+fvm_version_max=
+
+if test "x$fvm_version_min" != "x" ; then
+ if test "x$fvm_version_max" != "x" ; then
+ { $as_echo "$as_me:$LINENO: checking for fvm version >= \"0.14.0\" and <= " >&5
+$as_echo_n "checking for fvm version >= \"0.14.0\" and <= ... " >&6; }
+ else
+ { $as_echo "$as_me:$LINENO: checking for fvm version >= \"0.14.0\"" >&5
+$as_echo_n "checking for fvm version >= \"0.14.0\"... " >&6; }
+ fi
+else
+ fvm_version_min="0.0.0"
+fi
+
+fvm_version_major_min=`echo "$fvm_version_min" | cut -f1 -d.`
+fvm_version_minor_min=`echo "$fvm_version_min" | cut -f2 -d.`
+fvm_version_release_min=`echo "$fvm_version_min" | cut -f3 -d.`
+if test "$fvm_version_major_min" = "" \
+ -o "$fvm_version_minor_min" = "" \
+ -o "$fvm_version_release_min" = ""; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: bad FVM version definition in configure.ac: $fvm_version_min
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: bad FVM version definition in configure.ac: $fvm_version_min
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+if test "x$fvm_version_max" != "x" ; then
+ fvm_version_major_max=`echo "$fvm_version_max" | cut -f1 -d.`
+ fvm_version_minor_max=`echo "$fvm_version_max" | cut -f2 -d.`
+ fvm_version_release_max=`echo "$fvm_version_max" | cut -f3 -d.`
+ if test "$fvm_version_major_max" = "" \
+ -o "$fvm_version_minor_max" = "" \
+ -o "$fvm_version_release_max" = ""; then
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: bad FVM version definition in configure.ac: $fvm_version_max
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: bad FVM version definition in configure.ac: $fvm_version_max
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+ fi
+else
+ fvm_version_major_max=99999999
+ fvm_version_minor_max=99999999
+ fvm_version_release_max=99999999
+fi
+
+saved_CPPFLAGS=$CPPFLAGS
+saved_LDFLAGS=$LDFLAGS
+saved_LIBS=$LIBS
+
+CPPFLAGS="${CPPFLAGS} $FVM_CPPFLAGS"
+LDFLAGS="$FVM_LDFLAGS $FVM_DEP_LDFLAGS `$fvm_config --ldflags bft` ${LDFLAGS}"
+LIBS="$FVM_LIBS $FVM_DEP_LIBS `$fvm_config --libs bft` ${LIBS}"
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <fvm_config.h>
+
+int
+main ()
+{
+#if FVM_MAJOR_VERSION < $fvm_version_major_min
+# error FVM major version < $fvm_version_major_min
+#elif FVM_MAJOR_VERSION == $fvm_version_major_min
+# if FVM_MINOR_VERSION < $fvm_version_minor_min
+# error FVM minor version < $fvm_version_minor_min
+# elif FVM_MINOR_VERSION == $fvm_version_minor_min
+# if FVM_RELEASE_VERSION < $fvm_version_release_min
+# error FVM release version < $fvm_version_release_min
+# endif
+# endif
+#endif
+#if FVM_MAJOR_VERSION > $fvm_version_major_max
+# error FVM major version > $fvm_version_major_max
+#elif FVM_MAJOR_VERSION == $fvm_version_major_max
+# if FVM_MINOR_VERSION > $fvm_version_minor_max
+# error FVM minor version > $fvm_version_minor_max
+# elif FVM_MINOR_VERSION == $fvm_version_minor_max
+# if FVM_RELEASE_VERSION > $fvm_version_release_max
+# error FVM release version < $fvm_version_release_max
+# endif
+# endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ { $as_echo "$as_me:$LINENO: result: compatible fvm version found" >&5
+$as_echo "compatible fvm version found" >&6; }
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: compatible fvm version not found
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: compatible fvm version not found
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+
+# Now check if fvm_coupl library is available (using MPI)
+
+{ $as_echo "$as_me:$LINENO: checking for fvm_coupling discovery functions" >&5
+$as_echo_n "checking for fvm_coupling discovery functions... " >&6; }
+
+LIBS="$FVM_LIBS -lfvm_coupl $FVM_DEP_LIBS `$fvm_config --libs bft` ${saved_LIBS}"
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int fvm_coupling_mpi_world_n_apps(void *);
+int
+main ()
+{
+fvm_coupling_mpi_world_n_apps(0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ fvm_have_coupl=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ fvm_have_coupl=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+
+{ $as_echo "$as_me:$LINENO: result: $fvm_have_coupl" >&5
+$as_echo "$fvm_have_coupl" >&6; }
+if test "$fvm_have_coupl" = "yes"; then
+ FVM_LIBS="$FVM_LIBS -lfvm_coupl"
+fi
+FVM_LDFLAGS="$FVM_LDFLAGS $FVM_DEP_LDFLAGS"
+FVM_LIBS="$FVM_LIBS $FVM_DEP_LIBS"
+
+# Unset temporary variables
+
+unset fvm_version_major_min
+unset fvm_version_minor_min
+unset fvm_version_release_min
+unset fvm_version_major_max
+unset fvm_version_minor_max
+unset fvm_version_release_max
+
+unset fvm_version_min
+unset fvm_version_max
+unset fvm_config
+
+# Restore old LIBS to add $FVM_LIBS later, as other tests
+# might otherwise not run if a shared library is not found
+
+CPPFLAGS=$saved_CPPFLAGS
+LDFLAGS=$saved_LDFLAGS
+LIBS=$saved_LIBS
+
+unset saved_CPPFLAGS
+unset saved_LDFLAGS
+unset saved_LIBS
+
+
+
+
+
+
+
+
+have_mei=no
+
+# Check whether --enable-mei was given.
+if test "${enable_mei+set}" = set; then
+ enableval=$enable_mei;
+ case "${enableval}" in
+ yes) mei=true ;;
+ no) mei=false ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-mei" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-mei" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ mei=true
+
+fi
+
+
+
+# Check whether --with-mei was given.
+if test "${with_mei+set}" = set; then
+ withval=$with_mei;
+fi
+
+
+# Check whether --with-mei-include was given.
+if test "${with_mei_include+set}" = set; then
+ withval=$with_mei_include;
+fi
+
+
+# Check whether --with-mei-lib was given.
+if test "${with_mei_lib+set}" = set; then
+ withval=$with_mei_lib;
+fi
+
+
+if test "x$mei" = "xtrue" ; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ saved_LIBS="$LIBS"
+
+ if test "x$with_mei_include" != "x" ; then
+ MEI_CPPFLAGS="-I$with_mei_include"
+ elif test "x$with_mei" != "x" ; then
+ MEI_CPPFLAGS="-I$with_mei/include"
+ fi
+
+ if test "x$with_mei_lib" != "x" ; then
+ MEI_LDFLAGS="-L$with_mei_lib"
+ mei_libdir=$with_mei_lib
+ elif test "x$with_mei" != "x" ; then
+ MEI_LDFLAGS="-L$with_mei/lib"
+ mei_libdir=$with_mei/lib
+ fi
+
+ MEI_LIBS="-lmei"
+
+ CPPFLAGS="${CPPFLAGS} ${MEI_CPPFLAGS} ${BFT_CPPFLAGS}"
+ LDFLAGS="${LDFLAGS} ${MEI_LDFLAGS} ${BFT_LDFLAGS}"
+ LIBS="${LIBS} ${MEI_LIBS} -lbft"
+
+ if test "${ac_cv_header_mei_evaluate_h+set}" = set; then
+ { $as_echo "$as_me:$LINENO: checking for mei_evaluate.h" >&5
+$as_echo_n "checking for mei_evaluate.h... " >&6; }
+if test "${ac_cv_header_mei_evaluate_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mei_evaluate_h" >&5
+$as_echo "$ac_cv_header_mei_evaluate_h" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking mei_evaluate.h usability" >&5
+$as_echo_n "checking mei_evaluate.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <mei_evaluate.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking mei_evaluate.h presence" >&5
+$as_echo_n "checking mei_evaluate.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mei_evaluate.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: mei_evaluate.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: mei_evaluate.h: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------------- ##
+## Report this to saturne-support at edf.fr ##
+## ------------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for mei_evaluate.h" >&5
+$as_echo_n "checking for mei_evaluate.h... " >&6; }
+if test "${ac_cv_header_mei_evaluate_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_header_mei_evaluate_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mei_evaluate_h" >&5
+$as_echo "$ac_cv_header_mei_evaluate_h" >&6; }
+
+fi
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for mei_evaluate in -lmei" >&5
+$as_echo_n "checking for mei_evaluate in -lmei... " >&6; }
+if test "${ac_cv_lib_mei_mei_evaluate+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmei $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mei_evaluate ();
+int
+main ()
+{
+return mei_evaluate ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_mei_mei_evaluate=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_mei_mei_evaluate=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mei_mei_evaluate" >&5
+$as_echo "$ac_cv_lib_mei_mei_evaluate" >&6; }
+if test "x$ac_cv_lib_mei_mei_evaluate" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MEI 1
+_ACEOF
+
+ have_mei=yes
+
+else
+ { $as_echo "$as_me:$LINENO: WARNING: no MEI support" >&5
+$as_echo "$as_me: WARNING: no MEI support" >&2;}
+
+fi
+
+
+ if test "x$have_mei" != "xyes"; then
+ MEI_CPPFLAGS=""
+ MEI_LDFLAGS=""
+ MEI_LIBS=""
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+ if test x$have_mei = xyes; then
+ HAVE_MEI_TRUE=
+ HAVE_MEI_FALSE='#'
+else
+ HAVE_MEI_TRUE='#'
+ HAVE_MEI_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+
+have_libxml2=no
+
+# Check whether --enable-libxml2 was given.
+if test "${enable_libxml2+set}" = set; then
+ enableval=$enable_libxml2;
+ case "${enableval}" in
+ yes) libxml2=true ;;
+ no) libxml2=false ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libxml2" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-libxml2" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ libxml2=true
+
+fi
+
+
+
+# Check whether --with-libxml2 was given.
+if test "${with_libxml2+set}" = set; then
+ withval=$with_libxml2;
+fi
+
+
+# Check whether --with-libxml2-include was given.
+if test "${with_libxml2_include+set}" = set; then
+ withval=$with_libxml2_include;
+fi
+
+
+# Check whether --with-libxml2-lib was given.
+if test "${with_libxml2_lib+set}" = set; then
+ withval=$with_libxml2_lib;
+fi
+
+
+if test "x$libxml2" = "xtrue" ; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ saved_LIBS="$LIBS"
+
+ if test "x$with_libxml2_include" != "x" ; then
+ LIBXML2_CPPFLAGS="-I$with_libxml2_include"
+ elif test "x$with_libxml2" != "x" ; then
+ LIBXML2_CPPFLAGS="-I$with_libxml2/include/libxml2"
+ else
+ LIBXML2_CPPFLAGS="-I/usr/include/libxml2"
+ fi
+
+ if test "x$with_libxml2_lib" != "x" ; then
+ LIBXML2_LDFLAGS="-L$with_libxml2_lib"
+ elif test "x$with_libxml2" != "x" ; then
+ LIBXML2_LDFLAGS="-L$with_libxml2/lib"
+ fi
+
+ LIBXML2_LIBS="-lxml2"
+
+ CPPFLAGS="${CPPFLAGS} ${LIBXML2_CPPFLAGS}"
+ LDFLAGS="${LDFLAGS} ${LIBXML2_LDFLAGS}"
+ LIBS="${LIBS} ${LIBXML2_LIBS}"
+
+ if test "${ac_cv_header_libxml_parser_h+set}" = set; then
+ { $as_echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
+$as_echo_n "checking for libxml/parser.h... " >&6; }
+if test "${ac_cv_header_libxml_parser_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
+$as_echo "$ac_cv_header_libxml_parser_h" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking libxml/parser.h usability" >&5
+$as_echo_n "checking libxml/parser.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <libxml/parser.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking libxml/parser.h presence" >&5
+$as_echo_n "checking libxml/parser.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libxml/parser.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------------- ##
+## Report this to saturne-support at edf.fr ##
+## ------------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
+$as_echo_n "checking for libxml/parser.h... " >&6; }
+if test "${ac_cv_header_libxml_parser_h+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_header_libxml_parser_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
+$as_echo "$ac_cv_header_libxml_parser_h" >&6; }
+
+fi
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for xmlInitParser in -lxml2" >&5
+$as_echo_n "checking for xmlInitParser in -lxml2... " >&6; }
+if test "${ac_cv_lib_xml2_xmlInitParser+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char xmlInitParser ();
+int
+main ()
+{
+return xmlInitParser ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_xml2_xmlInitParser=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_xml2_xmlInitParser=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlInitParser" >&5
+$as_echo "$ac_cv_lib_xml2_xmlInitParser" >&6; }
+if test "x$ac_cv_lib_xml2_xmlInitParser" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBXML2 1
+_ACEOF
+
+ have_libxml2=yes
+
+else
+ { $as_echo "$as_me:$LINENO: WARNING: no LIBXML2 support" >&5
+$as_echo "$as_me: WARNING: no LIBXML2 support" >&2;}
+
+fi
+
+
+ if test "x$have_libxml2" != "xyes"; then
+ LIBXML2_CPPFLAGS=""
+ LIBXML2_LDFLAGS=""
+ LIBXML2_LIBS=""
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+ if test x$have_libxml2 = xyes; then
+ HAVE_LIBXML2_TRUE=
+ HAVE_LIBXML2_FALSE='#'
+else
+ HAVE_LIBXML2_TRUE='#'
+ HAVE_LIBXML2_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+cs_have_blas=no
+
+# Check whether --enable-blas was given.
+if test "${enable_blas+set}" = set; then
+ enableval=$enable_blas;
+ case "${enableval}" in
+ yes) blas=true ;;
+ no) blas=false ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-blas" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-blas" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ blas=true
+
+fi
+
+
+
+# Check whether --with-blas was given.
+if test "${with_blas+set}" = set; then
+ withval=$with_blas;
+fi
+
+
+# Check whether --with-blas-include was given.
+if test "${with_blas_include+set}" = set; then
+ withval=$with_blas_include;
+fi
+
+
+# Check whether --with-blas-lib was given.
+if test "${with_blas_lib+set}" = set; then
+ withval=$with_blas_lib;
+fi
+
+
+# Check whether --with-blas-type was given.
+if test "${with_blas_type+set}" = set; then
+ withval=$with_blas_type;
+fi
+
+
+# Check whether --with-blas-libs was given.
+if test "${with_blas_libs+set}" = set; then
+ withval=$with_blas_libs;
+fi
+
+
+if test "x$blas" = "xtrue" ; then
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ saved_LIBS="$LIBS"
+
+ BLAS_CPPFLAGS=""
+ BLAS_LDFLAGS=""
+
+ # Also add known paths and libraries for Blue Gene/L or P if not given
+
+ if test "x$with_blas_include" != "x" ; then
+ BLAS_CPPFLAGS="-I$with_blas_include"
+ elif test "x$with_blas" != "x" ; then
+ BLAS_CPPFLAGS="-I$with_blas/include"
+ fi
+
+ if test "x$with_blas_lib" != "x" ; then
+ BLAS_LDFLAGS="-L$with_blas_lib"
+ elif test "x$with_blas" != "x" ; then
+ BLAS_LDFLAGS="-L$with_blas/lib"
+ fi
+
+ if test "x$with_blas_type" = "x" ; then
+ if test "x$cs_ibm_bg_type" != "x" ; then
+ with_blas_type="ESSL"
+ fi
+ fi
+
+ # Test for ATLAS BLAS
+
+ if test "x$with_blas_type" = "x" -o "x$with_blas_type" = "xATLAS" ; then
+
+ if test "$cs_have_openmp" = "yes" -o "x$with_blas_libs" = "x"; then # Threaded version ?
+
+ BLAS_LIBS="-lptcblas -latlas -lpthread"
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for threaded ATLAS BLAS" >&5
+$as_echo_n "checking for threaded ATLAS BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <cblas.h>
+int
+main ()
+{
+ cblas_ddot(0, 0, 0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CBLAS 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=ATLAS
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+ fi
+
+ if test "$cs_have_blas" = "no" ; then # Test for non-threaded version
+ # or explicitely specified libs second
+ if test "x$with_blas_libs" != "x" -a "x$with_blas_type" = "xATLAS"; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lcblas -latlas"
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for ATLAS BLAS" >&5
+$as_echo_n "checking for ATLAS BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <cblas.h>
+int
+main ()
+{
+ cblas_ddot(0, 0, 0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CBLAS 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=ATLAS
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+ fi
+
+ fi
+
+ # Test for IBM ESSL BLAS
+
+ if test "x$with_blas_type" = "x" -o "x$with_blas_type" = "xESSL" ; then
+
+ # Test compilation/header separately from link, as linking may require
+ # Fortran libraries, and header is for C. Test library (link) first,
+ # as header is only useful if library is present.
+
+ if test "x$BLAS_CPPFLAGS" = "x" ; then
+ if test "x$cs_ibm_bg_type" = "xL" ; then
+ BLAS_CPPFLAGS="-I/opt/ibmmath/essl/4.2/include"
+ elif test "x$cs_ibm_bg_type" = "xP" ; then
+ BLAS_CPPFLAGS="-I/opt/ibmmath/essl/4.4/include"
+ fi
+ fi
+
+ if test "x$BLAS_LDFLAGS" = "x" ; then
+ if test "x$cs_ibm_bg_type" = "xL" ; then
+ BLAS_LDFLAGS="-L/opt/ibmmath/essl/4.2/lib"
+ elif test "x$cs_ibm_bg_type" = "xP" ; then
+ BLAS_LDFLAGS="-L/opt/ibmmath/essl/4.4/lib"
+ fi
+ fi
+
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+ if test "$cs_have_openmp" = "yes" -o "x$with_blas_libs" = "x"; then # Threaded version ?
+
+ if test "x$cs_ibm_bg_type" = "xP" ; then
+ BLAS_LIBS="-lesslsmpbg -lesslbg"
+ else
+ BLAS_LIBS="-lesslsmp"
+ fi
+
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for smp ESSL BLAS" >&5
+$as_echo_n "checking for smp ESSL BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+ call ddot(0, 0, 0, 0, 0)
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ESSL 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=ESSL
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+ fi
+
+ if test "$cs_have_blas" = "no" ; then # Test for non-threaded version
+ # or explicitely specified libs second
+
+ if test "x$cs_ibm_bg_type" != "x" ; then
+ BLAS_LIBS="-lesslbg"
+ elif test "x$with_blas_libs" != "x" -a "x$with_blas_type" = "xESSL"; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lessl"
+ fi
+
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for ESSL BLAS" >&5
+$as_echo_n "checking for ESSL BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+ call ddot(0, 0, 0, 0, 0)
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ESSL 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=ESSL
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+ fi
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ # Now check for header
+
+ if test "$cs_have_blas" = "yes" ; then
+
+ CPPFLAGS="${CPPFLAGS} ${BLAS_CPPFLAGS}"
+
+ { $as_echo "$as_me:$LINENO: checking for ESSL BLAS headers" >&5
+$as_echo_n "checking for ESSL BLAS headers... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <essl.h>
+int
+main ()
+{
+ ddot(0, 0, 0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ESSL_H 1
+_ACEOF
+
+ cs_have_essl_h=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_essl_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_essl_h" >&5
+$as_echo "$cs_have_essl_h" >&6; }
+
+ fi
+
+ fi
+
+ # Test for Intel MKL BLAS
+
+ if test "x$with_blas_type" = "x" -o "x$with_blas_type" = "xMKL" ; then
+
+ if test "x$with_blas_lib" = "x" ; then
+ if test `uname -m` = ia64 ; then
+ mkl_sub_lib="/64"
+ elif test `uname -m` = x86_64 ; then
+ mkl_sub_lib="/64"
+ elif test `uname -m` = x86 ; then
+ mkl_sub_lib="/32"
+ fi
+ fi
+
+ if test "$cs_have_openmp" = "yes" -o "x$with_blas_libs" = "x"; then # Threaded version ?
+
+ if test "`uname -m`" = "ia64" ; then
+ BLAS_LIBS="-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lguide -lpthread"
+ else
+ BLAS_LIBS="-lmkl_intel -lmkl_intel_thread -lmkl_core -lguide -lpthread"
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}${mkl_sub_lib}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for threaded MKL BLAS" >&5
+$as_echo_n "checking for threaded MKL BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mkl_cblas.h>
+int
+main ()
+{
+ cblas_ddot(0, 0, 0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MKL 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=MKL
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+ fi
+
+ if test "$cs_have_blas" = "no" ; then # Test for non-threaded version
+ # or explicitely specified libs second
+
+ if test "x$with_blas_libs" != "x" -a "x$with_blas_type" = "xMKL"; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ if test "`uname -m`" = "ia64" ; then
+ BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core"
+ else
+ BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core"
+ fi
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}${mkl_sub_lib}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for MKL BLAS" >&5
+$as_echo_n "checking for MKL BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mkl_blas.h>
+int
+main ()
+{
+ cblas_ddot(0, 0, 0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MKL 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=MKL
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+ fi
+
+ if test "x$with_blas_type" = "xMKL" ; then
+ BLAS_LDFLAGS="${BLAS_LDFLAGS}${mkl_sub_lib}"
+ fi
+ unset mkl_sub_lib
+
+ fi
+
+ # Test for generic C BLAS
+
+ if test "x$with_blas_type" = "x" ; then
+
+ if test "x$with_blas_libs" != "x" ; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lblas"
+ fi
+
+ CPPFLAGS="${saved_CPPFLAGS} ${BLAS_CPPFLAGS}"
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for legacy C BLAS" >&5
+$as_echo_n "checking for legacy C BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <cblas.h>
+int
+main ()
+{
+ cblas_ddot(0, 0, 0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CBLAS 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=BLAS
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+ fi
+
+ # Test for generic Fortran BLAS
+
+ if test "x$with_blas_type" = "x" ; then
+
+ ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+ if test "x$with_blas_libs" != "x" ; then
+ BLAS_LIBS="$with_blas_libs"
+ else
+ BLAS_LIBS="-lblas"
+ fi
+
+ LDFLAGS="${saved_LDFLAGS} ${BLAS_LDFLAGS}"
+ LIBS=" ${saved_LIBS} ${BLAS_LIBS}"
+
+ { $as_echo "$as_me:$LINENO: checking for legacy Fortran BLAS" >&5
+$as_echo_n "checking for legacy Fortran BLAS... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+ call ddot(0, 0, 0, 0, 0)
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_fc_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FBLAS 1
+_ACEOF
+
+ cs_have_blas=yes; with_blas_type=BLAS
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_blas=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_blas" >&5
+$as_echo "$cs_have_blas" >&6; }
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ fi
+
+ # Cleanup if no BLAS found
+
+ if test "x$cs_have_blas" != "xyes"; then
+ BLAS_CPPFLAGS=""
+ BLAS_LDFLAGS=""
+ BLAS_LIBS=""
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+
+
+
+
+
+
+
+saved_CPPFLAGS="$CPPFLAGS"
+saved_LDFLAGS="$LDFLAGS"
+saved_LIBS="$LIBS"
+
+cs_have_mpi=no
+
+# Check whether --enable-mpi was given.
+if test "${enable_mpi+set}" = set; then
+ enableval=$enable_mpi;
+ case "${enableval}" in
+ yes) mpi=true ;;
+ no) mpi=false ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-mpi" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-mpi" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ mpi=true
+
+fi
+
+
+
+# Check whether --with-mpi was given.
+if test "${with_mpi+set}" = set; then
+ withval=$with_mpi;
+fi
+
+
+# Check whether --with-mpi-exec was given.
+if test "${with_mpi_exec+set}" = set; then
+ withval=$with_mpi_exec;
+fi
+
+
+# Check whether --with-mpi-include was given.
+if test "${with_mpi_include+set}" = set; then
+ withval=$with_mpi_include;
+fi
+
+
+# Check whether --with-mpi-lib was given.
+if test "${with_mpi_lib+set}" = set; then
+ withval=$with_mpi_lib;
+fi
+
+
+if test "x$mpi" = "xtrue" ; then
+ if test "x$with_mpi_exec" != "x" ; then
+ MPI_BIN="$with_mpi_exec"
+ elif test "x$with_mpi" != "x" ; then
+ MPI_BIN="$with_mpi/bin"
+ fi
+ if test "x$with_mpi_include" != "x" ; then
+ MPI_CPPFLAGS="$MPI_CPPFLAGS -I$with_mpi_include"
+ elif test "x$with_mpi" != "x" ; then
+ MPI_CPPFLAGS="$MPI_CPPFLAGS -I$with_mpi/include"
+ fi
+ if test "x$with_mpi_lib" != "x" ; then
+ MPI_LDFLAGS="$MPI_LDFLAGS -L$with_mpi_lib"
+ elif test "x$with_mpi" != "x" ; then
+ MPI_LDFLAGS="$MPI_LDFLAGS -L$with_mpi/lib"
+ fi
+fi
+
+# Just in case, remove excess whitespace from existing flag and libs variables.
+
+if test "$MPI_CPPFLAGS" != "" ; then
+ MPI_CPPFLAGS=`echo $MPI_CPPFLAGS | sed 's/^ *//;s/ *$//'`
+fi
+if test "$MPI_LDFLAGS" != "" ; then
+ MPI_LDFLAGS=`echo $MPI_LDFLAGS | sed 's/^ *//;s/ *$//'`
+fi
+if test "$MPI_LIBS" != "" ; then
+ MPI_LIBS=`echo $MPI_LIBS | sed 's/^ *//;s/ *$//'`
+fi
+
+# If we do not use an MPI compiler wrapper, we must add compilation
+# and link flags; we try to detect the correct flags to add.
+
+if test "x$mpi" = "xtrue" -a "x$cs_have_mpi" = "xno" ; then
+
+ # try several tests for MPI
+
+ # MPI Compiler wrapper test
+ { $as_echo "$as_me:$LINENO: checking for MPI (MPI compiler wrapper test)" >&5
+$as_echo_n "checking for MPI (MPI compiler wrapper test)... " >&6; }
+ CPPFLAGS="$saved_CPPFLAGS $MPI_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS $MPI_LDFLAGS"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mpi.h>
+int
+main ()
+{
+ MPI_Init(0, (void *)0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+ cs_have_mpi=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_mpi=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_mpi" >&5
+$as_echo "$cs_have_mpi" >&6; }
+
+ # If failed, basic test
+ if test "x$cs_have_mpi" = "xno"; then
+ # Basic test
+ { $as_echo "$as_me:$LINENO: checking for MPI (basic test)" >&5
+$as_echo_n "checking for MPI (basic test)... " >&6; }
+ if test "$MPI_LIBS" = "" ; then
+ MPI_LIBS="-lmpi $PTHREAD_LIBS"
+ fi
+ CPPFLAGS="$saved_CPPFLAGS $MPI_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS $MPI_LDFLAGS"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mpi.h>
+int
+main ()
+{
+ MPI_Init(0, (void *)0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+ cs_have_mpi=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_mpi=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $cs_have_mpi" >&5
+$as_echo "$cs_have_mpi" >&6; }
+ fi
+
+ # If failed, test for mpich
+ if test "x$cs_have_mpi" = "xno"; then
+ { $as_echo "$as_me:$LINENO: checking for MPI (mpich test)" >&5
+$as_echo_n "checking for MPI (mpich test)... " >&6; }
+ # First try (simplest)
+ MPI_LIBS="-lmpich $PTHREAD_LIBS"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mpi.h>
+int
+main ()
+{
+ MPI_Init(0, (void *)0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+ cs_have_mpi=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_mpi=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "x$cs_have_mpi" = "xno"; then
+ # Second try (with lpmpich)
+ MPI_LIBS="-Wl,-lpmpich -Wl,-lmpich -Wl,-lpmpich -Wl,-lmpich"
+ LIBS="$saved_LIBS $MPI_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mpi.h>
+int
+main ()
+{
+ MPI_Init(0, (void *)0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+ cs_have_mpi=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_mpi=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ { $as_echo "$as_me:$LINENO: result: $cs_have_mpi" >&5
+$as_echo "$cs_have_mpi" >&6; }
+ fi
+
+ # If failed, test for lam-mpi
+ if test "x$cs_have_mpi" = "xno"; then
+ { $as_echo "$as_me:$LINENO: checking for MPI (lam-mpi test)" >&5
+$as_echo_n "checking for MPI (lam-mpi test)... " >&6; }
+ # First try (without MPI-IO)
+ case $host_os in
+ freebsd*)
+ MPI_LIBS="-lmpi -llam $PTHREAD_LIBS";;
+ *)
+ MPI_LIBS="-lmpi -llam -lpthread";;
+ esac
+ LIBS="$saved_LIBS $MPI_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mpi.h>
+int
+main ()
+{
+ MPI_Init(0, (void *)0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+ cs_have_mpi=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_mpi=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "x$cs_have_mpi" = "xno"; then
+ # Second try (with MPI-IO)
+ case $host_os in
+ freebsd*)
+ MPI_LIBS="-lmpi -llam -lutil -ldl $PTHREAD_LIBS";;
+ *)
+ MPI_LIBS="-lmpi -llam -lutil -ldl -lpthread";;
+ esac
+ LIBS="$saved_LIBS $MPI_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mpi.h>
+int
+main ()
+{
+ MPI_Init(0, (void *)0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+ cs_have_mpi=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cs_have_mpi=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ { $as_echo "$as_me:$LINENO: result: $cs_have_mpi" >&5
+$as_echo "$cs_have_mpi" >&6; }
+ fi
+
+ if test "x$cs_have_mpi" = "xno"; then
+ MPI_CPPFLAGS=""
+ MPI_LDFLAGS=""
+ MPI_LIBS=""
+ else
+ # Try to detect MPI variants as this may be useful for the run scripts to
+ # determine the correct mpi startup syntax (especially when multiple
+ # librairies are installed on the same machine).
+ CPPFLAGS="$saved_CPPFLAGS $MPI_CPPFLAGS"
+ MPI_TYPE=""
+ if test "x$MPI_TYPE" = "x"; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <mpi.h>
+ #ifdef MPICH2
+ mpich2
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "mpich2" >/dev/null 2>&1; then
+ MPI_TYPE=MPICH2
+fi
+rm -f conftest*
+
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <mpi.h>
+ #ifdef OMPI_MAJOR_VERSION
+ ompi
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "ompi" >/dev/null 2>&1; then
+ MPI_TYPE=OpenMPI
+fi
+rm -f conftest*
+
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <mpi.h>
+ #ifdef MPIBULL2_NAME
+ mpibull2
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "mpibull2" >/dev/null 2>&1; then
+ MPI_TYPE=MPIBULL2
+fi
+rm -f conftest*
+
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <mpi.h>
+ #ifdef LAM_MPI
+ lam_mpi
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "lam_mpi" >/dev/null 2>&1; then
+ MPI_TYPE=LAM_MPI
+fi
+rm -f conftest*
+
+ fi
+ if test "x$MPI_TYPE" = "x"; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <mpi.h>
+ #ifdef HP_MPI
+ hp_mpi
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "hp_mpi" >/dev/null 2>&1; then
+ MPI_TYPE=HP_MPI
+fi
+rm -f conftest*
+
+ fi
+ fi
+
+ CPPFLAGS="$saved_CPPFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+
+ unset saved_CPPFLAGS
+ unset saved_LDFLAGS
+ unset saved_LIBS
+
+fi
+
+ if test x$cs_have_mpi = xyes; then
+ HAVE_MPI_TRUE=
+ HAVE_MPI_FALSE='#'
+else
+ HAVE_MPI_TRUE='#'
+ HAVE_MPI_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+ { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$F77" && break
+ done
+fi
+if test -z "$F77"; then
+ ac_ct_F77=$F77
+ for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_F77="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_F77" && break
+done
+
+ if test "x$ac_ct_F77" = x; then
+ F77=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ F77=$ac_ct_F77
+ fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_f77_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-g -O2"
+ else
+ FFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-O2"
+ else
+ FFLAGS=
+ fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+ G77=yes
+else
+ G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+ { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$F77" && break
+ done
+fi
+if test -z "$F77"; then
+ ac_ct_F77=$F77
+ for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_F77="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_F77" && break
+done
+
+ if test "x$ac_ct_F77" = x; then
+ F77=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ F77=$ac_ct_F77
+ fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_f77_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-g -O2"
+ else
+ FFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-O2"
+ else
+ FFLAGS=
+ fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+ G77=yes
+else
+ G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_direct_absolute_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+inherit_rpath_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+ # save warnings/boilerplate of simple test code
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${F77-"f77"}
+ compiler=$CC
+ compiler_F77=$CC
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ GCC=$G77
+ if test -n "$compiler"; then
+ { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+ GCC_F77="$G77"
+ LD_F77="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_static_F77='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_F77='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_F77=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_F77='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_F77=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ else
+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-fPIC'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='--shared'
+ lt_prog_compiler_static_F77='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-fpic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-qpic'
+ lt_prog_compiler_static_F77='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_F77='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_F77='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_F77='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_F77='-Qoption ld '
+ lt_prog_compiler_pic_F77='-PIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_F77='-Kconform_pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_F77='-pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_F77=
+ ;;
+ *)
+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+$as_echo "$lt_prog_compiler_pic_F77" >&6; }
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+ { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_F77=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_F77"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:22430: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:22434: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_F77=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+ esac
+else
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_F77=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_F77=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_F77=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
+ :
+else
+ lt_prog_compiler_static_F77=
+fi
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_F77=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:22529: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:22533: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_F77=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_F77=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:22581: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:22585: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_F77=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag_F77=
+ always_export_symbols_F77=no
+ archive_cmds_F77=
+ archive_expsym_cmds_F77=
+ compiler_needs_object_F77=no
+ enable_shared_with_static_runtimes_F77=no
+ export_dynamic_flag_spec_F77=
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic_F77=no
+ hardcode_direct_F77=no
+ hardcode_direct_absolute_F77=no
+ hardcode_libdir_flag_spec_F77=
+ hardcode_libdir_flag_spec_ld_F77=
+ hardcode_libdir_separator_F77=
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=unsupported
+ inherit_rpath_F77=no
+ link_all_deplibs_F77=unknown
+ module_cmds_F77=
+ module_expsym_cmds_F77=
+ old_archive_from_new_cmds_F77=
+ old_archive_from_expsyms_cmds_F77=
+ thread_safe_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_F77=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_F77=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_F77=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77=''
+ ;;
+ m68k)
+ archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_F77=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=no
+ enable_shared_with_static_runtimes_F77=yes
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec_F77=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_F77=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec_F77=
+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+ archive_cmds_F77='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_F77=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_F77=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_F77" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=yes
+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_F77=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_F77=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_F77=''
+ hardcode_direct_F77=yes
+ hardcode_direct_absolute_F77=yes
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+ file_list_spec_F77='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_F77=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_F77=yes
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_libdir_separator_F77=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec_F77='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_F77=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_F77='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_F77='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_F77="-z nodefs"
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_F77=' ${wl}-bernotok'
+ allow_undefined_flag_F77=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_F77='$convenience'
+ archive_cmds_need_lc_F77=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77=''
+ ;;
+ m68k)
+ archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec_F77=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_F77=' '
+ allow_undefined_flag_F77=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds_F77='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_F77=yes
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc_F77=no
+ hardcode_direct_F77=no
+ hardcode_automatic_F77=yes
+ hardcode_shlibpath_var_F77=unsupported
+ whole_archive_flag_spec_F77=''
+ link_all_deplibs_F77=yes
+ allow_undefined_flag_F77="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs_F77=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_F77=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+ hardcode_direct_absolute_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ ;;
+ *)
+ hardcode_direct_F77=yes
+ hardcode_direct_absolute_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+ else
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc_F77='no'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ inherit_rpath_F77=yes
+ link_all_deplibs_F77=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ newsos6)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ hardcode_direct_absolute_F77=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ allow_undefined_flag_F77=unsupported
+ archive_cmds_F77='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc_F77='no'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_F77='-rpath $libdir'
+ fi
+ archive_cmds_need_lc_F77='no'
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ solaris*)
+ no_undefined_flag_F77=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_F77='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds_F77='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_shlibpath_var_F77=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs_F77=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_F77='$CC -r -o $output$reload_objs'
+ hardcode_direct_F77=no
+ ;;
+ motorola)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_F77=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_F77='${wl}-z,text'
+ archive_cmds_need_lc_F77=no
+ hardcode_shlibpath_var_F77=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_F77='${wl}-z,text'
+ allow_undefined_flag_F77='${wl}-z,nodefs'
+ archive_cmds_need_lc_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='${wl}-R,$libdir'
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec_F77='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+$as_echo "$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+with_gnu_ld_F77=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_F77=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_F77 in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_F77
+ pic_flag=$lt_prog_compiler_pic_F77
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+ allow_undefined_flag_F77=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_F77=no
+ else
+ archive_cmds_need_lc_F77=yes
+ fi
+ allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+$as_echo "$archive_cmds_need_lc_F77" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_F77\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\""
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+ shlibpath_overrides_runpath=yes
+fi
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" ||
+ test -n "$runpath_var_F77" ||
+ test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_F77" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+ test "$hardcode_minus_L_F77" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_F77=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_F77=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_F77=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+$as_echo "$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink ||
+ test "$inherit_rpath_F77" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+# Check whether --with-syrthes was given.
+if test "${with_syrthes+set}" = set; then
+ withval=$with_syrthes;
+fi
+
+
+if test -f $with_syrthes/bin/syrthes.profile ; then
+ have_syrthes=yes
+ syrthes_prefix=$with_syrthes
+ { $as_echo "$as_me:$LINENO: sourcing $syrthes_prefix/bin/syrthes.profile" >&5
+$as_echo "$as_me: sourcing $syrthes_prefix/bin/syrthes.profile" >&6;}
+ . "$syrthes_prefix/bin/syrthes.profile"
+else
+ have_syrthes=no
+ { $as_echo "$as_me:$LINENO: WARNING: cannot find syrthes.profile" >&5
+$as_echo "$as_me: WARNING: cannot find syrthes.profile" >&2;}
+fi
+
+if test "x$have_syrthes" = "xyes"; then
+
+# Get SYRTHES compilers
+
+outfile=makefile-tmp
+cp $with_syrthes/bin/Makefile $outfile
+
+cat >> $outfile <<\_______EOF
+
+syr_info:
+ @echo $(VERSION) > syr-version-tmp
+ @echo $(CC) > syr-cc-tmp
+ @echo $(FC) > syr-fc-tmp
+ @echo $(CFLAGS) > syr-cflags-tmp
+ @echo $(FCFLAGS) > syr-fcflags-tmp
+_______EOF
+
+make -f $outfile syr_info > /dev/null
+
+SYRTHES_NOM_ARCH=${NOM_ARCH}
+SYRTHES_VERSION=`cat syr-version-tmp`
+SYRTHES_CC=`cat syr-cc-tmp`
+SYRTHES_FC=`cat syr-fc-tmp`
+SYRTHES_CFLAGS=`cat syr-cflags-tmp`
+SYRTHES_FCFLAGS=`cat syr-fcflags-tmp`
+
+rm -f $outfile syr-version-tmp syr-cc-tmp syr-fc-tmp syr-cflags-tmp syr-fcflags-tmp
+
+# Get mandatory Fortran libs for linking stage
+# We assume that only SYRTHES user subroutines written in Fortran 77
+# will need to be compiled (as versions older than 3.4 are not
+# supported, and version 4 will be coupled directly through FVM,
+# not through the syrcs wrapper).
+
+F77=$SYRTHES_FC
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
+$as_echo_n "checking how to get verbose linking output from $F77... " >&6; }
+if test "${ac_cv_prog_f77_v+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_f77_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+ grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+ grep 'LPATH is:' |
+ sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+# that detects unbalanced quotes in FLIBS should be implemented
+# and (ugh) tested at some point.
+case $ac_f77_v_output in
+ # If we are using xlf then replace all the commas with spaces.
+ *xlfentry*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+ # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+ # $LIBS confuse us, and the libraries appear later in the output anyway).
+ *mGLOB_options_string*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+ # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+ # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+ # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+ *-cmdline\ * | *-ignore\ * | *-def\ *)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g
+ s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g
+ s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;;
+
+ # If we are using Cray Fortran then delete quotes.
+ *cft90*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+ # look for -l* and *.a constructs in the output
+ for ac_arg in $ac_f77_v_output; do
+ case $ac_arg in
+ [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+ ac_cv_prog_f77_v=$ac_verb
+ break 2 ;;
+ esac
+ done
+done
+if test -z "$ac_cv_prog_f77_v"; then
+ { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
+$as_echo "$ac_cv_prog_f77_v" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for Fortran 77 libraries of $F77" >&5
+$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; }
+if test "${ac_cv_f77_libs+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$FLIBS" != "x"; then
+ ac_cv_f77_libs="$FLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:$LINENO: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+ grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+ grep 'LPATH is:' |
+ sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+# that detects unbalanced quotes in FLIBS should be implemented
+# and (ugh) tested at some point.
+case $ac_f77_v_output in
+ # If we are using xlf then replace all the commas with spaces.
+ *xlfentry*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
+
+ # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+ # $LIBS confuse us, and the libraries appear later in the output anyway).
+ *mGLOB_options_string*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+ # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+ # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+ # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+ *-cmdline\ * | *-ignore\ * | *-def\ *)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g
+ s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g
+ s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;;
+
+ # If we are using Cray Fortran then delete quotes.
+ *cft90*)
+ ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_f77_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_f77_v_output
+while test $# != 1; do
+ shift
+ ac_arg=$1
+ case $ac_arg in
+ [\\/]*.a | ?:[\\/]*.a)
+ ac_exists=false
+ for ac_i in $ac_cv_f77_libs; do
+ if test x"$ac_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+ ;;
+ -bI:*)
+ ac_exists=false
+ for ac_i in $ac_cv_f77_libs; do
+ if test x"$ac_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ if test "$ac_compiler_gnu" = yes; then
+ for ac_link_opt in $ac_arg; do
+ ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+ done
+else
+ ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+fi
+
+ ;;
+ # Ignore these flags.
+ -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
+ ;;
+ -lkernel32)
+ test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+ ;;
+ -[LRuYz])
+ # These flags, when seen by themselves, take an argument.
+ # We remove the space between option and argument and re-iterate
+ # unless we find an empty arg or a new option (starting with -)
+ case $2 in
+ "" | -*);;
+ *)
+ ac_arg="$ac_arg$2"
+ shift; shift
+ set X $ac_arg "$@"
+ ;;
+ esac
+ ;;
+ -YP,*)
+ for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+ ac_exists=false
+ for ac_i in $ac_cv_f77_libs; do
+ if test x"$ac_j" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ ac_arg="$ac_arg $ac_j"
+ ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
+fi
+
+ done
+ ;;
+ -[lLR]*)
+ ac_exists=false
+ for ac_i in $ac_cv_f77_libs; do
+ if test x"$ac_arg" = x"$ac_i"; then
+ ac_exists=true
+ break
+ fi
+ done
+
+ if test x"$ac_exists" = xtrue; then
+ :
+else
+ ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+
+ ;;
+ -zallextract*| -zdefaultextract)
+ ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+ ;;
+ # Ignore everything else.
+ esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+ "SunOS 5"*)
+ ac_ld_run_path=`$as_echo "$ac_f77_v_output" |
+ sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+ test "x$ac_ld_run_path" != x &&
+ if test "$ac_compiler_gnu" = yes; then
+ for ac_link_opt in $ac_ld_run_path; do
+ ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+ done
+else
+ ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
+fi
+ ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
+$as_echo "$ac_cv_f77_libs" >&6; }
+FLIBS="$ac_cv_f77_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SYRTHES_FCLIBS=$FLIBS
+
+SYRTHES_CPPFLAGS="-I$with_syrthes/include"
+SYRTHES_LDFLAGS="-L$with_syrthes/lib/${SYRTHES_NOM_ARCH}"
+SYRTHES_LIBS="-lsatsyrthes${SYRTHES_VERSION}_${SYRTHES_NOM_ARCH} -lsyrthes${SYRTHES_VERSION}_${SYRTHES_NOM_ARCH}"
+
+if test "x$cs_have_mpi" = "xyes"; then
+ FVM_COUPL_LDFLAGS="$FVM_LDFLAGS"
+ FVM_COUPL_LIBS="-lfvm_coupl"
+else
+ FVM_COUPL_LDFLAGS=
+ FVM_COUPL_LIBS=
+fi
+
+SYRTHES_LDFLAGS="$FVM_COUPL_LDFLAGS $BFT_LDFLAGS $MPI_LDFLAGS $SYRTHES_LDFLAGS"
+SYRTHES_LIBS="$FVM_COUPL_LIBS $BFT_LIBS $MPI_LIBS $SYRTHES_LIBS"
+
+
+
+
+
+
+
+
+
+
+
+
+fi
+
+
+
+#------------------------------------------------------------------------------
+# Checks for Code_Saturne preprocessor
+#------------------------------------------------------------------------------
+
+
+# Check whether --with-prepro was given.
+if test "${with_prepro+set}" = set; then
+ withval=$with_prepro;
+fi
+
+
+# Extract the first word of "cs_preprocess", so it can be a program name with args.
+set dummy cs_preprocess; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ecs_prefix+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ecs_prefix"; then
+ ac_cv_prog_ecs_prefix="$ecs_prefix" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $with_prepro/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ecs_prefix="$with_prepro"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ecs_prefix=$ac_cv_prog_ecs_prefix
+if test -n "$ecs_prefix"; then
+ { $as_echo "$as_me:$LINENO: result: $ecs_prefix" >&5
+$as_echo "$ecs_prefix" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+#------------------------------------------------------------------------------
+# Enables Code_Saturne graphical user interface
+#------------------------------------------------------------------------------
+
+# Check whether --enable-gui was given.
+if test "${enable_gui+set}" = set; then
+ enableval=$enable_gui;
+ case "${enableval}" in
+ yes) have_gui=yes ;;
+ no) have_gui=no ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-gui" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-gui" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ have_gui=yes
+
+fi
+
+ if test "x$have_gui" = "xyes"; then
+ HAVE_GUI_TRUE=
+ HAVE_GUI_FALSE='#'
+else
+ HAVE_GUI_TRUE='#'
+ HAVE_GUI_FALSE=
+fi
+
+
+#------------------------------------------------------------------------------
+# Checks for Python support.
+#------------------------------------------------------------------------------
+
+
+# Check whether --with-python-exec was given.
+if test "${with_python_exec+set}" = set; then
+ withval=$with_python_exec; PYTHON_EXE=${withval}
+else
+ PYTHON_EXE=none
+fi
+
+if test "x${PYTHON_EXE}" == "xnone" ; then
+ cs_python="/usr/bin/env python"
+ # Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PYEXE+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $PYEXE in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PYEXE="$PYEXE" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PYEXE="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_PYEXE" && ac_cv_path_PYEXE=""no""
+ ;;
+esac
+fi
+PYEXE=$ac_cv_path_PYEXE
+if test -n "$PYEXE"; then
+ { $as_echo "$as_me:$LINENO: result: $PYEXE" >&5
+$as_echo "$PYEXE" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+else
+ cs_python="${PYTHON_EXE}/python"
+ # Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PYEXE+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $PYEXE in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PYEXE="$PYEXE" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in ${PYTHON_EXE}
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PYEXE="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_PYEXE" && ac_cv_path_PYEXE=""no""
+ ;;
+esac
+fi
+PYEXE=$ac_cv_path_PYEXE
+if test -n "$PYEXE"; then
+ { $as_echo "$as_me:$LINENO: result: $PYEXE" >&5
+$as_echo "$PYEXE" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+
+
+PYTHON=${PYEXE}
+
+
+
+
+ if test -n "$PYTHON"; then
+ # If the user set $PYTHON, use it and don't search something else.
+ { $as_echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.3" >&5
+$as_echo_n "checking whether $PYTHON version >= 2.3... " >&6; }
+ prog="import sys, string
+# split strings by '.' and convert to numeric. Append some zeros
+# because we need at least 4 digits for the hex conversion.
+minver = map(int, string.split('2.3', '.')) + [0, 0, 0]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i]
+sys.exit(sys.hexversion < minverhex)"
+ if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5
+ ($PYTHON -c "$prog") >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { { $as_echo "$as_me:$LINENO: error: too old" >&5
+$as_echo "$as_me: error: too old" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ am_display_PYTHON=$PYTHON
+ else
+ # Otherwise, try each interpreter until we find one that satisfies
+ # VERSION.
+ { $as_echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.3" >&5
+$as_echo_n "checking for a Python interpreter with version >= 2.3... " >&6; }
+if test "${am_cv_pathless_PYTHON+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+ for am_cv_pathless_PYTHON in python python2 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 none; do
+ test "$am_cv_pathless_PYTHON" = none && break
+ prog="import sys, string
+# split strings by '.' and convert to numeric. Append some zeros
+# because we need at least 4 digits for the hex conversion.
+minver = map(int, string.split('2.3', '.')) + [0, 0, 0]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i]
+sys.exit(sys.hexversion < minverhex)"
+ if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5
+ ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ break
+fi
+
+ done
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5
+$as_echo "$am_cv_pathless_PYTHON" >&6; }
+ # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
+ if test "$am_cv_pathless_PYTHON" = none; then
+ PYTHON=:
+ else
+ # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args.
+set dummy $am_cv_pathless_PYTHON; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PYTHON+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $PYTHON in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+ { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+ am_display_PYTHON=$am_cv_pathless_PYTHON
+ fi
+
+
+ if test "$PYTHON" = :; then
+ { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5
+$as_echo "$as_me: error: no suitable Python interpreter found" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+
+
+ { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5
+$as_echo_n "checking for $am_display_PYTHON version... " >&6; }
+if test "${am_cv_python_version+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"`
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5
+$as_echo "$am_cv_python_version" >&6; }
+ PYTHON_VERSION=$am_cv_python_version
+
+
+
+ PYTHON_PREFIX='${prefix}'
+
+ PYTHON_EXEC_PREFIX='${exec_prefix}'
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5
+$as_echo_n "checking for $am_display_PYTHON platform... " >&6; }
+if test "${am_cv_python_platform+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5
+$as_echo "$am_cv_python_platform" >&6; }
+ PYTHON_PLATFORM=$am_cv_python_platform
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5
+$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; }
+if test "${am_cv_python_pythondir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
+ echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5
+$as_echo "$am_cv_python_pythondir" >&6; }
+ pythondir=$am_cv_python_pythondir
+
+
+
+ pkgpythondir=\${pythondir}/$PACKAGE
+
+
+ { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5
+$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; }
+if test "${am_cv_python_pyexecdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
+ echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5
+$as_echo "$am_cv_python_pyexecdir" >&6; }
+ pyexecdir=$am_cv_python_pyexecdir
+
+
+
+ pkgpyexecdir=\${pyexecdir}/$PACKAGE
+
+
+
+ fi
+
+
+
+#------------------------------------------------------------------------------
+# Checks for header files.
+#------------------------------------------------------------------------------
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+
+
+
+for ac_header in sys/types.h sys/utsname.h sys/stat.h stddef.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------------- ##
+## Report this to saturne-support at edf.fr ##
+## ------------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+#------------------------------------------------------------------------------
+# Checks for library functions.
+#------------------------------------------------------------------------------
+
+
+for ac_func in snprintf
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in getcwd sleep
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in getpwuid geteuid
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in uname
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+#------------------------------------------------------------------------------
+# Checks for system services.
+#------------------------------------------------------------------------------
+
+# Optional socket support
+#------------------------
+
+have_socket=no
+
+# Check whether --enable-sockets was given.
+if test "${enable_sockets+set}" = set; then
+ enableval=$enable_sockets;
+ case "${enableval}" in
+ yes) have_socket=yes ;;
+ no) have_socket=no ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-sockets" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-sockets" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ have_socket=yes
+
+fi
+
+if test "x$have_socket" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKET 1
+_ACEOF
+
+fi
+
+# Optional shared library support
+#--------------------------------
+
+have_dlloader=no
+
+# Check whether --enable-dlloader was given.
+if test "${enable_dlloader+set}" = set; then
+ enableval=$enable_dlloader;
+ case "${enableval}" in
+ yes) have_dlloader=yes ;;
+ no) have_dlloader=no ;;
+ *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-dlloader" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-dlloader" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ have_dlloader=yes
+
+fi
+
+
+if test "x$have_dlloader" = "xyes" ; then
+
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS -ldl"
+
+ { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <dlfcn.h>
+int
+main ()
+{
+ dlopen("none.so", RTLD_LAZY);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ have_dlloader=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ have_dlloader=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $have_dlloader" >&5
+$as_echo "$have_dlloader" >&6; }
+ if test "x$have_dlloader" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DLOPEN 1
+_ACEOF
+
+ else
+ LIBS="$saved_LIBS"
+ have_dlloader=no
+ fi
+
+fi
+
+#------------------------------------------------------------------------------
+# Internationalization
+#------------------------------------------------------------------------------
+
+if test "${prefix}" = "NONE"; then
+ localedir="/usr/local/share/locale"
+else
+ localedir="${prefix}/share/locale"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define LOCALEDIR "${localedir}"
+_ACEOF
+
+
+# Set of available languages now in po/LINGUAS.
+
+
+ { $as_echo "$as_me:$LINENO: checking whether NLS is requested" >&5
+$as_echo_n "checking whether NLS is requested... " >&6; }
+ # Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval=$enable_nls; USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi
+
+ { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
+
+
+
+
+ GETTEXT_MACRO_VERSION=0.17
+
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case "$MSGFMT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5
+$as_echo "$MSGFMT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+ { $as_echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+$as_echo "$GMSGFMT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case "$XGETTEXT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+$as_echo "$XGETTEXT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ rm -f messages.po
+
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MSGMERGE+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case "$MSGMERGE" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+ ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+ ;;
+esac
+fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+ { $as_echo "$as_me:$LINENO: result: $MSGMERGE" >&5
+$as_echo "$MSGMERGE" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$localedir" || localedir='${datadir}/locale'
+
+
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+
+
+ ac_config_commands="$ac_config_commands po-directories"
+
+
+
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+$as_echo_n "checking for ld used by GCC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${acl_cv_path_LD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break ;;
+ *)
+ test "$with_gnu_ld" != yes && break ;;
+ esac
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${acl_cv_prog_gnu_ld+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes ;;
+*)
+ acl_cv_prog_gnu_ld=no ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5
+$as_echo "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5
+$as_echo_n "checking for shared library run path origin... " >&6; }
+if test "${acl_cv_rpath+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5
+$as_echo "$acl_cv_rpath" >&6; }
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+ enableval=$enable_rpath; :
+else
+ enable_rpath=yes
+fi
+
+
+
+ acl_libdirstem=lib
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then
+ withval=$with_libiconv_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ fi
+ fi
+
+fi
+
+ LIBICONV=
+ LTLIBICONV=
+ INCICONV=
+ LIBICONV_PREFIX=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='iconv '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ if test "$acl_hardcode_direct" = yes; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ haveit=
+ for x in $LDFLAGS $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
+ fi
+ fi
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ LIBICONV_PREFIX="$basedir"
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INCICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5
+$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
+if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <CoreFoundation/CFPreferences.h>
+int
+main ()
+{
+CFPreferencesCopyAppValue(NULL, NULL)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ gt_cv_func_CFPreferencesCopyAppValue=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ gt_cv_func_CFPreferencesCopyAppValue=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CFPREFERENCESCOPYAPPVALUE 1
+_ACEOF
+
+ fi
+ { $as_echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5
+$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
+if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <CoreFoundation/CFLocale.h>
+int
+main ()
+{
+CFLocaleCopyCurrent();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ gt_cv_func_CFLocaleCopyCurrent=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ gt_cv_func_CFLocaleCopyCurrent=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
+$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CFLOCALECOPYCURRENT 1
+_ACEOF
+
+ fi
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+
+
+
+
+
+
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ { $as_echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5
+$as_echo_n "checking for GNU gettext in libc... " >&6; }
+if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$gt_func_gnugettext_libc=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$gt_func_gnugettext_libc=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$gt_func_gnugettext_libc'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+
+
+
+
+
+ am_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCICONV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ { $as_echo "$as_me:$LINENO: checking for iconv" >&5
+$as_echo_n "checking for iconv... " >&6; }
+if test "${am_cv_func_iconv+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ am_cv_func_iconv=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5
+$as_echo "$am_cv_func_iconv" >&6; }
+ if test "$am_cv_func_iconv" = yes; then
+ { $as_echo "$as_me:$LINENO: checking for working iconv" >&5
+$as_echo_n "checking for working iconv... " >&6; }
+if test "${am_cv_func_iconv_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ if test "$cross_compiling" = yes; then
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <iconv.h>
+#include <string.h>
+int main ()
+{
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ return 1;
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ return 1;
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+ /* Try IRIX, OSF/1 names. */
+ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+ /* Try AIX names. */
+ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ return 1;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_func_iconv_works=yes
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+am_cv_func_iconv_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+ LIBS="$am_save_LIBS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv_works" >&5
+$as_echo "$am_cv_func_iconv_works" >&6; }
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ICONV 1
+_ACEOF
+
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5
+$as_echo_n "checking how to link with libiconv... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $LIBICONV" >&5
+$as_echo "$LIBICONV" >&6; }
+ else
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libintl-prefix was given.
+if test "${with_libintl_prefix+set}" = set; then
+ withval=$with_libintl_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ fi
+ fi
+
+fi
+
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ LIBINTL_PREFIX=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='intl '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ if test "$acl_hardcode_direct" = yes; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ haveit=
+ for x in $LDFLAGS $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
+ fi
+ fi
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ LIBINTL_PREFIX="$basedir"
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INCINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
+ done
+ fi
+
+ { $as_echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5
+$as_echo_n "checking for GNU gettext in libintl... " >&6; }
+if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ eval "$gt_func_gnugettext_libintl=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$gt_func_gnugettext_libintl=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"
+fi
+ac_res=`eval 'as_val=${'$gt_func_gnugettext_libintl'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ fi
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_NLS 1
+_ACEOF
+
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ { $as_echo "$as_me:$LINENO: checking whether to use NLS" >&5
+$as_echo_n "checking whether to use NLS... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
+ if test "$USE_NLS" = "yes"; then
+ { $as_echo "$as_me:$LINENO: checking where the gettext function comes from" >&5
+$as_echo_n "checking where the gettext function comes from... " >&6; }
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ { $as_echo "$as_me:$LINENO: result: $gt_source" >&5
+$as_echo "$gt_source" >&6; }
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ { $as_echo "$as_me:$LINENO: checking how to link with libintl" >&5
+$as_echo_n "checking how to link with libintl... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $LIBINTL" >&5
+$as_echo "$LIBINTL" >&6; }
+
+ for element in $INCINTL; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+ fi
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETTEXT 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DCGETTEXT 1
+_ACEOF
+
+ fi
+
+ POSUB=po
+ fi
+
+
+
+ INTLLIBS="$LIBINTL"
+
+
+
+
+
+
+
+#------------------------------------------------------------------------------
+# Pass compiler options to automake files and cs_config.py
+#------------------------------------------------------------------------------
+
+
+
+
+
+
+
+#------------------------------------------------------------------------------
+# Output
+#------------------------------------------------------------------------------
+
+# Output configuration info
+
+
+
+# First arg is output file name
+if test "cs_config_comments_include" = "" ; then
+ cs_ac_config_info="cs-config"
+else
+ cs_ac_config_info=cs_config_comments_include
+fi
+
+outfile="$cs_ac_config_info"-tmp
+
+rm -f $outfile
+
+{ $as_echo "$as_me:$LINENO: initializing $cs_ac_config_info" >&5
+$as_echo "$as_me: initializing $cs_ac_config_info" >&6;}
+
+
+
+
+
+outfile="$cs_ac_config_info"-tmp
+
+echo "# Configuration:" >> $outfile
+echo "# --------------" >> $outfile
+echo "
+# use debugging code: "$debug"
+# MPI (Message Passing Interface) support: "$cs_have_mpi"
+# OpenMP support: "$cs_have_openmp"
+# BLAS (Basic Linear Algebra Subprograms) support: "$cs_have_blas"
+# Libxml2 (XML Reader) support: "$have_libxml2"
+# IP socket support (for SYRTHES 3 or CFD_Proxy): "$have_socket"
+# Dynamic loader support (for YACS): "$have_dlloader"
+" >> $outfile
+
+
+
+
+
+
+outfile="$cs_ac_config_info"-tmp
+
+if test "${cs_ac_cc_version}" != "" -o "${cs_ac_cc_version_full}" != "" ; then
+ echo "" >> $outfile
+ echo "# C compiler used for build: ${cs_ac_cc_version}" >> $outfile
+ echo "# --------------------------" >> $outfile
+ if test "${cs_ac_cc_version_full}" != "" ; then
+ echo "${cs_ac_cc_version_full}" | sed 's/^/# /' >> $outfile
+ fi
+else
+ { $as_echo "$as_me:$LINENO: C compiler version info unavailable for configuration file" >&5
+$as_echo "$as_me: C compiler version info unavailable for configuration file" >&6;}
+fi
+
+
+
+
+outfile="$cs_ac_config_info"-tmp
+
+if test "${cs_ac_fc_version}" != "" -o "${cs_ac_fc_version_full}" != "" ; then
+ echo "" >> $outfile
+ echo "# Fortran compiler used for build: ${cs_ac_fc_version}" >> $outfile
+ echo "# --------------------------------" >> $outfile
+ if test "${cs_ac_fc_version_full}" != "" ; then
+ echo "${cs_ac_fc_version_full}" | sed 's/^/# /' >> $outfile
+ fi
+else
+ { $as_echo "$as_me:$LINENO: Fortran compiler version info unavailable for configuration file" >&5
+$as_echo "$as_me: Fortran compiler version info unavailable for configuration file" >&6;}
+fi
+
+
+
+
+
+outfile="$cs_ac_config_info"-tmp
+
+{ $as_echo "$as_me:$LINENO: closing $cs_ac_config_info" >&5
+$as_echo "$as_me: closing $cs_ac_config_info" >&6;}
+
+diff $outfile $cs_ac_config_info > /dev/null 2>&1
+if test $? -eq 0 ; then
+ { $as_echo "$as_me:$LINENO: $cs_ac_config_info is unchanged" >&5
+$as_echo "$as_me: $cs_ac_config_info is unchanged" >&6;}
+ rm -f $outfile
+else
+ mv $outfile $cs_ac_config_info
+ chmod +x $cs_ac_config_info
+fi
+
+
+
+
+cs_config_comments=cs_config_comments_include
+
+# Main configuration
+
+ac_config_files="$ac_config_files Makefile po/Makefile.in src/Makefile src/apps/Makefile src/base/Makefile src/atmo/Makefile src/cfbl/Makefile src/cogz/Makefile src/cplv/Makefile src/ctwr/Makefile src/elec/Makefile src/fuel/Makefile src/mati/Makefile src/pprt/Makefile src/lagr/Makefile src/rayt/Makefile libsyrcs/Makefile gui/Makefile gui/Base/Makefile gui/Pages/Makefile doc/Makefile doc/style/csvers.tex doc/howto/Makefile doc/howto/graphics/Makefile doc/refcard/Makefile doc/refcard/graph [...]
+
+
+#------------------------------------------------------------------------------
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MEI_TRUE}" && test -z "${HAVE_MEI_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_MEI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_MEI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_LIBXML2_TRUE}" && test -z "${HAVE_LIBXML2_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LIBXML2\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_LIBXML2\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MPI_TRUE}" && test -z "${HAVE_MPI_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_GUI_TRUE}" && test -z "${HAVE_GUI_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ncs $as_me 2.0.0-beta2, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+ncs config.status 2.0.0-beta2
+configured by $0, generated by GNU Autoconf 2.63,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`'
+predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`'
+postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`'
+LD_FC='`$ECHO "X$LD_FC" | $Xsed -e "$delay_single_quote_subst"`'
+LD_F77='`$ECHO "X$LD_F77" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds_FC='`$ECHO "X$old_archive_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds_F77='`$ECHO "X$old_archive_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_FC='`$ECHO "X$compiler_FC" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_F77='`$ECHO "X$compiler_F77" | $Xsed -e "$delay_single_quote_subst"`'
+GCC_FC='`$ECHO "X$GCC_FC" | $Xsed -e "$delay_single_quote_subst"`'
+GCC_F77='`$ECHO "X$GCC_F77" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_FC='`$ECHO "X$lt_prog_compiler_no_builtin_flag_FC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_F77='`$ECHO "X$lt_prog_compiler_no_builtin_flag_F77" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_FC='`$ECHO "X$lt_prog_compiler_wl_FC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_F77='`$ECHO "X$lt_prog_compiler_wl_F77" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_FC='`$ECHO "X$lt_prog_compiler_pic_FC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_F77='`$ECHO "X$lt_prog_compiler_pic_F77" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static_FC='`$ECHO "X$lt_prog_compiler_static_FC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static_F77='`$ECHO "X$lt_prog_compiler_static_F77" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_FC='`$ECHO "X$lt_cv_prog_compiler_c_o_FC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_F77='`$ECHO "X$lt_cv_prog_compiler_c_o_F77" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc_FC='`$ECHO "X$archive_cmds_need_lc_FC" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc_F77='`$ECHO "X$archive_cmds_need_lc_F77" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_FC='`$ECHO "X$enable_shared_with_static_runtimes_FC" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_F77='`$ECHO "X$enable_shared_with_static_runtimes_F77" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_FC='`$ECHO "X$export_dynamic_flag_spec_FC" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_F77='`$ECHO "X$export_dynamic_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec_FC='`$ECHO "X$whole_archive_flag_spec_FC" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec_F77='`$ECHO "X$whole_archive_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object_FC='`$ECHO "X$compiler_needs_object_FC" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object_F77='`$ECHO "X$compiler_needs_object_F77" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_FC='`$ECHO "X$old_archive_from_new_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_F77='`$ECHO "X$old_archive_from_new_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_FC='`$ECHO "X$old_archive_from_expsyms_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_F77='`$ECHO "X$old_archive_from_expsyms_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_FC='`$ECHO "X$archive_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_F77='`$ECHO "X$archive_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds_FC='`$ECHO "X$archive_expsym_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds_F77='`$ECHO "X$archive_expsym_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds_FC='`$ECHO "X$module_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds_F77='`$ECHO "X$module_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds_FC='`$ECHO "X$module_expsym_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds_F77='`$ECHO "X$module_expsym_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld_FC='`$ECHO "X$with_gnu_ld_FC" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld_F77='`$ECHO "X$with_gnu_ld_F77" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag_FC='`$ECHO "X$allow_undefined_flag_FC" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag_F77='`$ECHO "X$allow_undefined_flag_F77" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag_FC='`$ECHO "X$no_undefined_flag_FC" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag_F77='`$ECHO "X$no_undefined_flag_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_FC='`$ECHO "X$hardcode_libdir_flag_spec_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_F77='`$ECHO "X$hardcode_libdir_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_FC='`$ECHO "X$hardcode_libdir_flag_spec_ld_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_F77='`$ECHO "X$hardcode_libdir_flag_spec_ld_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator_FC='`$ECHO "X$hardcode_libdir_separator_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator_F77='`$ECHO "X$hardcode_libdir_separator_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_FC='`$ECHO "X$hardcode_direct_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_F77='`$ECHO "X$hardcode_direct_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute_FC='`$ECHO "X$hardcode_direct_absolute_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute_F77='`$ECHO "X$hardcode_direct_absolute_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L_FC='`$ECHO "X$hardcode_minus_L_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L_F77='`$ECHO "X$hardcode_minus_L_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_FC='`$ECHO "X$hardcode_shlibpath_var_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_F77='`$ECHO "X$hardcode_shlibpath_var_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic_FC='`$ECHO "X$hardcode_automatic_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic_F77='`$ECHO "X$hardcode_automatic_F77" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath_FC='`$ECHO "X$inherit_rpath_FC" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath_F77='`$ECHO "X$inherit_rpath_F77" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs_FC='`$ECHO "X$link_all_deplibs_FC" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs_F77='`$ECHO "X$link_all_deplibs_F77" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path_FC='`$ECHO "X$fix_srcfile_path_FC" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path_F77='`$ECHO "X$fix_srcfile_path_F77" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols_FC='`$ECHO "X$always_export_symbols_FC" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols_F77='`$ECHO "X$always_export_symbols_F77" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds_FC='`$ECHO "X$export_symbols_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds_F77='`$ECHO "X$export_symbols_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms_FC='`$ECHO "X$exclude_expsyms_FC" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms_F77='`$ECHO "X$exclude_expsyms_F77" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms_FC='`$ECHO "X$include_expsyms_FC" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms_F77='`$ECHO "X$include_expsyms_F77" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds_FC='`$ECHO "X$prelink_cmds_FC" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds_F77='`$ECHO "X$prelink_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec_FC='`$ECHO "X$file_list_spec_FC" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec_F77='`$ECHO "X$file_list_spec_F77" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action_FC='`$ECHO "X$hardcode_action_FC" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action_F77='`$ECHO "X$hardcode_action_F77" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_FC='`$ECHO "X$compiler_lib_search_dirs_FC" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_F77='`$ECHO "X$compiler_lib_search_dirs_F77" | $Xsed -e "$delay_single_quote_subst"`'
+predep_objects_FC='`$ECHO "X$predep_objects_FC" | $Xsed -e "$delay_single_quote_subst"`'
+predep_objects_F77='`$ECHO "X$predep_objects_F77" | $Xsed -e "$delay_single_quote_subst"`'
+postdep_objects_FC='`$ECHO "X$postdep_objects_FC" | $Xsed -e "$delay_single_quote_subst"`'
+postdep_objects_F77='`$ECHO "X$postdep_objects_F77" | $Xsed -e "$delay_single_quote_subst"`'
+predeps_FC='`$ECHO "X$predeps_FC" | $Xsed -e "$delay_single_quote_subst"`'
+predeps_F77='`$ECHO "X$predeps_F77" | $Xsed -e "$delay_single_quote_subst"`'
+postdeps_FC='`$ECHO "X$postdeps_FC" | $Xsed -e "$delay_single_quote_subst"`'
+postdeps_F77='`$ECHO "X$postdeps_F77" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_path_FC='`$ECHO "X$compiler_lib_search_path_FC" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_path_F77='`$ECHO "X$compiler_lib_search_path_F77" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_FC \
+LD_F77 \
+compiler_FC \
+compiler_F77 \
+lt_prog_compiler_no_builtin_flag_FC \
+lt_prog_compiler_no_builtin_flag_F77 \
+lt_prog_compiler_wl_FC \
+lt_prog_compiler_wl_F77 \
+lt_prog_compiler_pic_FC \
+lt_prog_compiler_pic_F77 \
+lt_prog_compiler_static_FC \
+lt_prog_compiler_static_F77 \
+lt_cv_prog_compiler_c_o_FC \
+lt_cv_prog_compiler_c_o_F77 \
+export_dynamic_flag_spec_FC \
+export_dynamic_flag_spec_F77 \
+whole_archive_flag_spec_FC \
+whole_archive_flag_spec_F77 \
+compiler_needs_object_FC \
+compiler_needs_object_F77 \
+with_gnu_ld_FC \
+with_gnu_ld_F77 \
+allow_undefined_flag_FC \
+allow_undefined_flag_F77 \
+no_undefined_flag_FC \
+no_undefined_flag_F77 \
+hardcode_libdir_flag_spec_FC \
+hardcode_libdir_flag_spec_F77 \
+hardcode_libdir_flag_spec_ld_FC \
+hardcode_libdir_flag_spec_ld_F77 \
+hardcode_libdir_separator_FC \
+hardcode_libdir_separator_F77 \
+fix_srcfile_path_FC \
+fix_srcfile_path_F77 \
+exclude_expsyms_FC \
+exclude_expsyms_F77 \
+include_expsyms_FC \
+include_expsyms_F77 \
+file_list_spec_FC \
+file_list_spec_F77 \
+compiler_lib_search_dirs_FC \
+compiler_lib_search_dirs_F77 \
+predep_objects_FC \
+predep_objects_F77 \
+postdep_objects_FC \
+postdep_objects_F77 \
+predeps_FC \
+predeps_F77 \
+postdeps_FC \
+postdeps_F77 \
+compiler_lib_search_path_FC \
+compiler_lib_search_path_F77; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+old_archive_cmds_FC \
+old_archive_cmds_F77 \
+old_archive_from_new_cmds_FC \
+old_archive_from_new_cmds_F77 \
+old_archive_from_expsyms_cmds_FC \
+old_archive_from_expsyms_cmds_F77 \
+archive_cmds_FC \
+archive_cmds_F77 \
+archive_expsym_cmds_FC \
+archive_expsym_cmds_F77 \
+module_cmds_FC \
+module_cmds_F77 \
+module_expsym_cmds_FC \
+module_expsym_cmds_F77 \
+export_symbols_cmds_FC \
+export_symbols_cmds_F77 \
+prelink_cmds_FC \
+prelink_cmds_F77; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+ ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+
+
+
+# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "cs_config.h") CONFIG_HEADERS="$CONFIG_HEADERS cs_config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "src/apps/Makefile") CONFIG_FILES="$CONFIG_FILES src/apps/Makefile" ;;
+ "src/base/Makefile") CONFIG_FILES="$CONFIG_FILES src/base/Makefile" ;;
+ "src/atmo/Makefile") CONFIG_FILES="$CONFIG_FILES src/atmo/Makefile" ;;
+ "src/cfbl/Makefile") CONFIG_FILES="$CONFIG_FILES src/cfbl/Makefile" ;;
+ "src/cogz/Makefile") CONFIG_FILES="$CONFIG_FILES src/cogz/Makefile" ;;
+ "src/cplv/Makefile") CONFIG_FILES="$CONFIG_FILES src/cplv/Makefile" ;;
+ "src/ctwr/Makefile") CONFIG_FILES="$CONFIG_FILES src/ctwr/Makefile" ;;
+ "src/elec/Makefile") CONFIG_FILES="$CONFIG_FILES src/elec/Makefile" ;;
+ "src/fuel/Makefile") CONFIG_FILES="$CONFIG_FILES src/fuel/Makefile" ;;
+ "src/mati/Makefile") CONFIG_FILES="$CONFIG_FILES src/mati/Makefile" ;;
+ "src/pprt/Makefile") CONFIG_FILES="$CONFIG_FILES src/pprt/Makefile" ;;
+ "src/lagr/Makefile") CONFIG_FILES="$CONFIG_FILES src/lagr/Makefile" ;;
+ "src/rayt/Makefile") CONFIG_FILES="$CONFIG_FILES src/rayt/Makefile" ;;
+ "libsyrcs/Makefile") CONFIG_FILES="$CONFIG_FILES libsyrcs/Makefile" ;;
+ "gui/Makefile") CONFIG_FILES="$CONFIG_FILES gui/Makefile" ;;
+ "gui/Base/Makefile") CONFIG_FILES="$CONFIG_FILES gui/Base/Makefile" ;;
+ "gui/Pages/Makefile") CONFIG_FILES="$CONFIG_FILES gui/Pages/Makefile" ;;
+ "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "doc/style/csvers.tex") CONFIG_FILES="$CONFIG_FILES doc/style/csvers.tex" ;;
+ "doc/howto/Makefile") CONFIG_FILES="$CONFIG_FILES doc/howto/Makefile" ;;
+ "doc/howto/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES doc/howto/graphics/Makefile" ;;
+ "doc/refcard/Makefile") CONFIG_FILES="$CONFIG_FILES doc/refcard/Makefile" ;;
+ "doc/refcard/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES doc/refcard/graphics/Makefile" ;;
+ "doc/theory/Makefile") CONFIG_FILES="$CONFIG_FILES doc/theory/Makefile" ;;
+ "doc/theory/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES doc/theory/graphics/Makefile" ;;
+ "doc/tutorial/Makefile") CONFIG_FILES="$CONFIG_FILES doc/tutorial/Makefile" ;;
+ "doc/tutorial/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES doc/tutorial/graphics/Makefile" ;;
+ "doc/user/Makefile") CONFIG_FILES="$CONFIG_FILES doc/user/Makefile" ;;
+ "doc/user/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES doc/user/graphics/Makefile" ;;
+ "bin/cs") CONFIG_FILES="$CONFIG_FILES bin/cs" ;;
+ "bin/cs_config.py") CONFIG_FILES="$CONFIG_FILES bin/cs_config.py" ;;
+ "bin/runcase") CONFIG_FILES="$CONFIG_FILES bin/runcase" ;;
+ "bin/runcase_coupling") CONFIG_FILES="$CONFIG_FILES bin/runcase_coupling" ;;
+ "bin/SaturneGUI") CONFIG_FILES="$CONFIG_FILES bin/SaturneGUI" ;;
+
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+ ac_cs_awk_getline=:
+ ac_cs_awk_pipe_init=
+ ac_cs_awk_read_file='
+ while ((getline aline < (F[key])) > 0)
+ print(aline)
+ close(F[key])'
+ ac_cs_awk_pipe_fini=
+else
+ ac_cs_awk_getline=false
+ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+ ac_cs_awk_read_file='
+ print "|#_!!_#|"
+ print "cat " F[key] " &&"
+ '$ac_cs_awk_pipe_init
+ # The final `:' finishes the AND list.
+ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+# Create commands to substitute file output variables.
+{
+ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
+ echo 'cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&' &&
+ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
+ echo "_ACAWK" &&
+ echo "_ACEOF"
+} >conf$$files.sh &&
+. ./conf$$files.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+rm -f conf$$files.sh
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+ \$ac_cs_awk_pipe_init
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+ if (nfields == 3 && !substed) {
+ key = field[2]
+ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
+ \$ac_cs_awk_read_file
+ next
+ }
+ }
+ print line
+}
+\$ac_cs_awk_pipe_fini
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+ { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+ $AWK -f "$tmp/subs.awk"
+else
+ $AWK -f "$tmp/subs.awk" | $SHELL
+fi >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$tmp/config.h" "$ac_file" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="FC F77 "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1+=\$2"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+ ;;
+ esac
+
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: FC
+
+# The linker used to build libraries.
+LD=$lt_LD_FC
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_FC
+
+# A language specific compiler.
+CC=$lt_compiler_FC
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_FC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_FC
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_FC
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_FC
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_FC
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_FC
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_FC
+archive_expsym_cmds=$lt_archive_expsym_cmds_FC
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_FC
+module_expsym_cmds=$lt_module_expsym_cmds_FC
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_FC
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_FC
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_FC
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_FC
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_FC
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_FC
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_FC
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_FC
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_FC
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_FC
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_FC
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path_FC
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_FC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_FC
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_FC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_FC
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_FC
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_FC
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_FC
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_FC
+postdep_objects=$lt_postdep_objects_FC
+predeps=$lt_predeps_FC
+postdeps=$lt_postdeps_FC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_FC
+
+# ### END LIBTOOL TAG CONFIG: FC
+_LT_EOF
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: F77
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_F77
+
+# A language specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_F77
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_F77
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_F77
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_F77
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path_F77
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_F77
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_F77
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_F77
+postdep_objects=$lt_postdep_objects_F77
+predeps=$lt_predeps_F77
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# ### END LIBTOOL TAG CONFIG: F77
+_LT_EOF
+
+ ;;
+ "po-directories":C)
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done ;;
+
+ esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+#------------------------------------------------------------------------------
+
+# Libtool configuration bug workaround (problem encountered with compilers
+# which do not recognize "-soname", so that "-Wl,-soname" is needed to pass
+# flags to the linker; Manually setting $wl to "-Wl" in libtool corrects
+# the problem, and so does this workaround borrowed from
+# the HDF5 configure.in, which does it automatically).
+
+if test "x$GCC" != "xyes"; then
+ echo 'fixing $wl in libtool'
+ed - libtool <<EOF 2> /dev/null
+/^wl=""/s//wl="-Wl,"/
+w
+q
+EOF
+fi
+
+#------------------------------------------------------------------------------
+
+rm -f cs_config_comments_include
+
+echo
+echo "Configuration options:"
+echo " use debugging code: "$debug""
+echo " MPI (Message Passing Interface) support: "$cs_have_mpi""
+echo " OpenMP support: "$cs_have_openmp""
+echo " BLAS (Basic Linear Algebra Subprograms) support: "$cs_have_blas""
+echo " Libxml2 (XML Reader) support: "$have_libxml2""
+echo " MEI (Mathematical Expressions Interpreter) support: "$have_mei""
+echo " SYRTHES 3 coupling support: "$have_syrthes""
+echo " IP socket support (for SYRTHES 3 or CFD_Proxy): "$have_socket""
+echo " Dynamic loader support (for YACS): "$have_dlloader""
+echo
+echo "The package has been configured. Type:"
+echo " make"
+echo " make install"
+echo
+echo "To generate and install the Code_Saturne kernel"
+echo
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..ef82fd6
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,584 @@
+# Process this file with autoconf to produce a configure script.
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Preprocessor; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#------------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+# Initialization
+#------------------------------------------------------------------------------
+
+m4_define([cs_licence_c_comment],
+[/*
+ This file is part of the Code_Saturne Kernel, element of the
+ Code_Saturne CFD tool.
+
+ Copyright (C) 2009 EDF S.A., France
+
+ The Code_Saturne Kernel 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.
+
+ The Code_Saturne Kernel 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 Licence
+ along with the Code_Saturne Preprocessor; if not, write to the
+ Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/])
+
+m4_define([cs_major_version], [2])
+m4_define([cs_minor_version], [0])
+m4_define([cs_release_version], [0])
+m4_define([cs_version_extra], [-beta2])
+m4_define([cs_version_string],
+ [cs_major_version.cs_minor_version.cs_release_version@&t at cs_version_extra])
+
+AC_INIT([ncs],[cs_version_string],[saturne-support at edf.fr])
+AC_CONFIG_SRCDIR([src/apps/cs_solver.c])
+
+# Use the config directory for libtool stuff ...
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR(config)
+AC_SUBST(ac_aux_dir)
+
+AC_CANONICAL_TARGET
+AC_CONFIG_HEADERS([cs_config.h])
+
+AM_GNU_GETTEXT_VERSION([0.17])
+
+AM_INIT_AUTOMAKE([-Wall])
+
+AM_MAINTAINER_MODE
+
+#------------------------------------------------------------------------------
+# Checks for programs.
+#------------------------------------------------------------------------------
+
+# Check for C and Fortran compilers
+#----------------------------------
+
+user_CPPFLAGS=$CPPFLAGS
+user_CFLAGS=$CFLAGS
+user_FCFLAGS=$FCFLAGS
+user_LDFLAGS=$LDFLAGS
+user_LIBS=$LIBS
+
+AC_PROG_CC
+AC_PROG_FC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_SED
+
+AC_FC_LIBRARY_LDFLAGS
+
+# Debug or production compilation mode (debug by default) ?
+
+AC_ARG_ENABLE(debug,
+ [ --enable-debug enable debugging (reduces optimization)],
+ [
+ case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+ esac
+ ],
+ [ debug=false ]
+)
+
+# Optionally deactivate automatic determination of flags on known systems
+
+AC_ARG_ENABLE(auto-flags,
+ [ --disable-auto-flags do not define *FLAGS on known systems],
+ [
+ case "${enableval}" in
+ yes) auto_flags=true ;;
+ no) auto_flags=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-auto-flags]) ;;
+ esac
+ ],
+ [ auto_flags=true ]
+)
+
+# Optionally activate French translation of Fortran logs (compile-time)
+
+AC_ARG_ENABLE(french,
+ [ --enable-french enable French translation of Fortran logs],
+ [
+ case "${enableval}" in
+ yes) french=true ;;
+ no) french=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-french]) ;;
+ esac
+ ],
+ [ french=false ]
+)
+
+# Default compiler options (may be modified
+# by defining CFLAGS in the environment)
+#------------------------------------------
+
+if test "x$auto_flags" = "xtrue" ; then
+
+ # Source associated recommended compiler options
+
+ if test -f "$srcdir/config/cs_auto_flags.sh" ; then
+ AC_MSG_NOTICE([sourcing config/cs_auto_flags.sh (test for known compilers)])
+ . "$srcdir/config/cs_auto_flags.sh"
+ else
+ AC_MSG_WARN([config/cs_auto_flags.sh default configuration file not found])
+ fi
+
+ # Default flags
+ CPPFLAGS="$cppflags_default $user_CPPFLAGS"
+ CFLAGS="$cflags_default $user_CFLAGS"
+ FCFLAGS="$fcflags_default $user_FCFLAGS"
+ LDFLAGS="$ldflags_default $user_LDFLAGS"
+ LIBS="$libs_default $user_LIBS"
+ LDRPATH="$ldflags_rpath"
+
+ if test "x$debug" = xtrue; then
+ # Debug flags
+ CFLAGS_DBG="$cflags_default_dbg"
+ FCFLAGS_DBG="$fcflags_default_dbg"
+ # Add debug flags for linker
+ LDFLAGS="$LDFLAGS $ldflags_default_dbg"
+ else
+ # Normal optimization flags
+ CFLAGS_OPT="$cflags_default_opt"
+ FCFLAGS_OPT="$fcflags_default_opt"
+ # Hot optimization flags
+ CFLAGS_HOT="$cflags_default_hot"
+ FCFLAGS_HOT="$fcflags_default_hot"
+ # Add optimization flags for linker
+ LDFLAGS="$LDFLAGS $ldflags_default_opt"
+ fi
+ CFLAGS_EXT="$cflags_default_ext"
+
+ AC_SUBST(CFLAGS_DBG)
+ AC_SUBST(CFLAGS_OPT)
+ AC_SUBST(CFLAGS_HOT)
+ AC_SUBST(CFLAGS_EXT)
+
+ AC_SUBST(FCFLAGS_DBG)
+ AC_SUBST(FCFLAGS_OPT)
+ AC_SUBST(FCFLAGS_HOT)
+
+ AC_SUBST(LDRPATH)
+fi
+
+# Add some preprocessor flags to include additional system features
+#------------------------------------------------------------------
+
+case "$host_os" in
+ linux*)
+ CPPFLAGS="${CPPFLAGS} -D_POSIX_SOURCE"
+ ;;
+ *bsd* | solaris2.* | aix*)
+ ;;
+ darwin*)
+ CPPFLAGS="${CPPFLAGS} -D_DARWIN_C_SOURCE"
+ ;;
+ osf*)
+ CPPFLAGS="${CPPFLAGS} -D_OSF_SOURCE"
+ ;;
+ hpux*)
+ CPPFLAGS="${CPPFLAGS} -D_HPUX_SOURCE"
+ ;;
+ *)
+ ;;
+esac
+
+# Preprocessor flags for debugging purposes
+
+if test "x$debug" = "xtrue"; then
+ CPPFLAGS="${CPPFLAGS} -DDEBUG"
+else
+ CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+fi
+
+# Fortran flags for French translation
+
+if test "x$french" = "xtrue"; then
+ FCFLAGS="${FCFLAGS} -D_CS_LANG_FR"
+fi
+
+# We may only turn on processing for libtool now that the basic compiler
+# and linker flags are set (to avoid issues with linkers with different
+# modes such as 32 and 64 bit which may be modified by compiler or
+# linker flags).
+
+# AC_DISABLE_SHARED may not be used inside a test, as it seems to
+# take effect whether the result is true or not (maybe due to a bug),
+# so we directly use autoconf's enable_shared variable.
+
+if test "x$cs_disable_shared" = "xyes" ; then
+ enable_shared=no
+fi
+
+LT_INIT
+
+#------------------------------------------------------------------------------
+# Checks for typedefs, structures, and compiler characteristics.
+#------------------------------------------------------------------------------
+
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+AC_TYPE_PID_T
+
+AC_HEADER_TIME
+AC_HEADER_STDBOOL
+
+AC_CHECK_TYPES([long long, unsigned long long])
+AC_CHECK_TYPES([int32_t])
+AC_CHECK_TYPES([int64_t])
+AC_CHECK_TYPES([uint32_t])
+AC_CHECK_TYPES([uint64_t])
+AC_CHECK_TYPES([ptrdiff_t])
+
+AC_CHECK_SIZEOF([void *], [cs])
+AC_CHECK_SIZEOF([short], [cs])
+AC_CHECK_SIZEOF([int], [cs])
+AC_CHECK_SIZEOF([long], [cs])
+AC_CHECK_SIZEOF([float], [cs])
+AC_CHECK_SIZEOF([double], [cs])
+
+#------------------------------------------------------------------------------
+# Determine OpenMP support
+#------------------------------------------------------------------------------
+
+# It seems that we may not use AC_OPENMP both for C and Fortran, so
+# we use our own method here, based on flags already set by default
+# or by the user.
+
+# From this point, no runtime tests should be run, so no issues should
+# arise due to missing RPATH or LD_LIBRARY_PATH values in case of non-standard
+# compiler install paths, such as may happen with gcc's libgomp.
+
+cs_have_openmp=no
+
+AC_ARG_ENABLE(openmp,
+ [ --disable-openmp disable OpenMP support],
+ [
+ case "${enableval}" in
+ yes) cs_have_openmp=yes ;;
+ no) cs_have_openmp=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-openmp]) ;;
+ esac
+ ],
+ [ cs_have_openmp=no ]
+)
+
+if test "x$cs_have_openmp" = "xyes" ; then
+
+ saved_CFLAGS="$CFLAGS"
+ saved_FCFLAGS="$FCFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+
+ CFLAGS="${CFLAGS} ${cflags_default_omp}"
+ FCFLAGS="${FCFLAGS} ${fcflags_default_omp}"
+ LDFLAGS="${LDFLAGS} ${cflags_default_omp}"
+
+ AC_MSG_CHECKING([for OpenMP (C)])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <omp.h>]],
+ [[ omp_get_num_threads();]])],
+ [cs_have_openmp=yes],
+ [cs_have_openmp=no])
+ AC_MSG_RESULT($cs_have_openmp)
+ if test "x$cs_have_openmp" = "xyes" ; then
+ AC_LANG_PUSH([Fortran])
+ AC_MSG_CHECKING([for OpenMP (Fortran)])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],
+ [[
+ integer n
+ n = omp_get_num_threads()
+]])],
+ [cs_have_openmp=yes],
+ [cs_have_openmp=no])
+ AC_MSG_RESULT($cs_have_openmp)
+ AC_LANG_POP([Fortran])
+ fi
+ if test "x$cs_have_openmp" = "xyes" ; then
+ AC_DEFINE([HAVE_OPENMP], 1, [openmp support])
+ else
+ cs_have_openmp=no
+ CFLAGS="$saved_CFLAGS"
+ FCFLAGS="$saved_FCFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+fi
+
+#------------------------------------------------------------------------------
+# Checks for libraries.
+#------------------------------------------------------------------------------
+
+CS_AC_TEST_BFT(["1.1.0"])
+CS_AC_TEST_FVM(["0.14.0"])
+CS_AC_TEST_MEI
+CS_AC_TEST_LIBXML2
+CS_AC_TEST_BLAS([$cs_have_openmp])
+CS_AC_TEST_MPI
+CS_AC_TEST_SYRTHES
+
+#------------------------------------------------------------------------------
+# Checks for Code_Saturne preprocessor
+#------------------------------------------------------------------------------
+
+AC_ARG_WITH(prepro, [AS_HELP_STRING([--with-prepro=PATH],
+ [specify prefix directory for the Preprocessor])])
+
+AC_CHECK_PROG(ecs_prefix, cs_preprocess, $with_prepro, , $with_prepro/bin, )
+AC_SUBST(ecs_prefix)
+
+#------------------------------------------------------------------------------
+# Enables Code_Saturne graphical user interface
+#------------------------------------------------------------------------------
+
+AC_ARG_ENABLE(gui, [AS_HELP_STRING([--disable-gui],
+ [disable the Graphical User Interface])],
+ [
+ case "${enableval}" in
+ yes) have_gui=yes ;;
+ no) have_gui=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-gui]) ;;
+ esac
+ ],
+ [ have_gui=yes ]
+)
+AM_CONDITIONAL(HAVE_GUI, [test "x$have_gui" = "xyes"])
+
+#------------------------------------------------------------------------------
+# Checks for Python support.
+#------------------------------------------------------------------------------
+
+AC_ARG_WITH(python-exec, [AS_HELP_STRING([--with-python-exec=PATH],
+ [specify prefix directory for a Python interpreter])],
+ [PYTHON_EXE=${withval}],
+ [PYTHON_EXE=none])dnl
+
+if test "x${PYTHON_EXE}" == "xnone" ; then
+ cs_python="/usr/bin/env python"
+ AC_PATH_PROG([PYEXE], [python], ["no"])
+else
+ cs_python="${PYTHON_EXE}/python"
+ AC_PATH_PROG([PYEXE], [python], ["no"], [${PYTHON_EXE}])
+fi
+AC_SUBST(cs_python)
+
+PYTHON=${PYEXE}
+AM_PATH_PYTHON([2.3])
+
+#------------------------------------------------------------------------------
+# Checks for header files.
+#------------------------------------------------------------------------------
+
+AC_HEADER_STDC
+AC_CHECK_HEADERS([sys/types.h sys/utsname.h sys/stat.h stddef.h])
+
+#------------------------------------------------------------------------------
+# Checks for library functions.
+#------------------------------------------------------------------------------
+
+AC_CHECK_FUNCS([snprintf])
+AC_CHECK_FUNCS([getcwd sleep])
+AC_CHECK_FUNCS([getpwuid geteuid])
+AC_CHECK_FUNCS([uname])
+
+#------------------------------------------------------------------------------
+# Checks for system services.
+#------------------------------------------------------------------------------
+
+# Optional socket support
+#------------------------
+
+have_socket=no
+
+AC_ARG_ENABLE(sockets,
+ [ --disable-sockets disable communications through IP sockets],
+ [
+ case "${enableval}" in
+ yes) have_socket=yes ;;
+ no) have_socket=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-sockets]) ;;
+ esac
+ ],
+ [ have_socket=yes ]
+)
+if test "x$have_socket" = "xyes" ; then
+ AC_DEFINE([HAVE_SOCKET], 1, [sockets support])
+fi
+
+# Optional shared library support
+#--------------------------------
+
+have_dlloader=no
+
+AC_ARG_ENABLE(dlloader,
+ [ --disable-dlloader disable dynamic shared library loading],
+ [
+ case "${enableval}" in
+ yes) have_dlloader=yes ;;
+ no) have_dlloader=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-dlloader]) ;;
+ esac
+ ],
+ [ have_dlloader=yes ]
+)
+
+if test "x$have_dlloader" = "xyes" ; then
+
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS -ldl"
+
+ AC_MSG_CHECKING([for dlopen])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dlfcn.h>]],
+ [[ dlopen("none.so", RTLD_LAZY);]])],
+ [have_dlloader=yes],
+ [have_dlloader=no])
+ AC_MSG_RESULT($have_dlloader)
+ if test "x$have_dlloader" = "xyes" ; then
+ AC_DEFINE([HAVE_DLOPEN], 1, [dlopen support])
+ else
+ LIBS="$saved_LIBS"
+ have_dlloader=no
+ fi
+
+fi
+
+#------------------------------------------------------------------------------
+# Internationalization
+#------------------------------------------------------------------------------
+
+if test "${prefix}" = "NONE"; then
+ localedir="/usr/local/share/locale"
+else
+ localedir="${prefix}/share/locale"
+fi
+AC_DEFINE_UNQUOTED(LOCALEDIR, "${localedir}", LOCALEDIR)
+
+# Set of available languages now in po/LINGUAS.
+
+AM_GNU_GETTEXT([external])
+
+#------------------------------------------------------------------------------
+# Pass compiler options to automake files and cs_config.py
+#------------------------------------------------------------------------------
+
+AC_SUBST(CPPFLAGS)
+AC_SUBST(CFLAGS)
+AC_SUBST(FCFLAGS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(LIBS)
+
+#------------------------------------------------------------------------------
+# Output
+#------------------------------------------------------------------------------
+
+# Output configuration info
+
+CS_AC_CONFIG_INFO_INIT([cs_config_comments_include])
+
+CS_AC_CONFIG_INFO_EXTRA([
+# use debugging code: "$debug"
+# MPI (Message Passing Interface) support: "$cs_have_mpi"
+# OpenMP support: "$cs_have_openmp"
+# BLAS (Basic Linear Algebra Subprograms) support: "$cs_have_blas"
+# Libxml2 (XML Reader) support: "$have_libxml2"
+# IP socket support (for SYRTHES 3 or CFD_Proxy): "$have_socket"
+# Dynamic loader support (for YACS): "$have_dlloader"
+])
+
+CS_AC_CONFIG_INFO_CC([${cs_ac_cc_version}], [${cs_ac_cc_version_full}])
+CS_AC_CONFIG_INFO_FC([${cs_ac_fc_version}], [${cs_ac_fc_version_full}])
+
+CS_AC_CONFIG_INFO_FINALIZE
+
+AC_SUBST_FILE([cs_config_comments])
+cs_config_comments=cs_config_comments_include
+
+# Main configuration
+
+AC_CONFIG_FILES([Makefile po/Makefile.in
+ src/Makefile src/apps/Makefile
+ src/base/Makefile src/atmo/Makefile src/cfbl/Makefile
+ src/cogz/Makefile src/cplv/Makefile src/ctwr/Makefile
+ src/elec/Makefile src/fuel/Makefile src/mati/Makefile
+ src/pprt/Makefile src/lagr/Makefile src/rayt/Makefile
+ libsyrcs/Makefile
+ gui/Makefile gui/Base/Makefile gui/Pages/Makefile
+ doc/Makefile doc/style/csvers.tex
+ doc/howto/Makefile doc/howto/graphics/Makefile
+ doc/refcard/Makefile doc/refcard/graphics/Makefile
+ doc/theory/Makefile doc/theory/graphics/Makefile
+ doc/tutorial/Makefile doc/tutorial/graphics/Makefile
+ doc/user/Makefile doc/user/graphics/Makefile
+ bin/cs bin/cs_config.py
+ bin/runcase bin/runcase_coupling bin/SaturneGUI])
+
+#------------------------------------------------------------------------------
+
+AC_OUTPUT
+
+#------------------------------------------------------------------------------
+
+# Libtool configuration bug workaround (problem encountered with compilers
+# which do not recognize "-soname", so that "-Wl,-soname" is needed to pass
+# flags to the linker; Manually setting $wl to "-Wl" in libtool corrects
+# the problem, and so does this workaround borrowed from
+# the HDF5 configure.in, which does it automatically).
+
+if test "x$GCC" != "xyes"; then
+ echo 'fixing $wl in libtool'
+ed - libtool <<EOF 2> /dev/null
+/^wl=""/s//wl="-Wl,"/
+w
+q
+EOF
+fi
+
+#------------------------------------------------------------------------------
+
+rm -f cs_config_comments_include
+
+echo
+echo "Configuration options:"
+echo " use debugging code: "$debug""
+echo " MPI (Message Passing Interface) support: "$cs_have_mpi""
+echo " OpenMP support: "$cs_have_openmp""
+echo " BLAS (Basic Linear Algebra Subprograms) support: "$cs_have_blas""
+echo " Libxml2 (XML Reader) support: "$have_libxml2""
+echo " MEI (Mathematical Expressions Interpreter) support: "$have_mei""
+echo " SYRTHES 3 coupling support: "$have_syrthes""
+echo " IP socket support (for SYRTHES 3 or CFD_Proxy): "$have_socket""
+echo " Dynamic loader support (for YACS): "$have_dlloader""
+echo
+echo "The package has been configured. Type:"
+echo " make"
+echo " make install"
+echo
+echo "To generate and install the Code_Saturne kernel"
+echo
+
diff --git a/cs_config.h.in b/cs_config.h.in
new file mode 100644
index 0000000..3a5e590
--- /dev/null
+++ b/cs_config.h.in
@@ -0,0 +1,204 @@
+/* cs_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
+
+/* C BLAS support */
+#undef HAVE_CBLAS
+
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYCURRENT
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* dlopen support */
+#undef HAVE_DLOPEN
+
+/* ESSL BLAS support */
+#undef HAVE_ESSL
+
+/* ESSL BLAS headers */
+#undef HAVE_ESSL_H
+
+/* Fortran BLAS support */
+#undef HAVE_FBLAS
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define to 1 if you have the `getpwuid' function. */
+#undef HAVE_GETPWUID
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define if you have the iconv() function and it works. */
+#undef HAVE_ICONV
+
+/* Define to 1 if the system has the type `int32_t'. */
+#undef HAVE_INT32_T
+
+/* Define to 1 if the system has the type `int64_t'. */
+#undef HAVE_INT64_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* LIBXML2 support */
+#undef HAVE_LIBXML2
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* MEI support */
+#undef HAVE_MEI
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* MKL BLAS support */
+#undef HAVE_MKL
+
+/* MPI support */
+#undef HAVE_MPI
+
+/* openmp support */
+#undef HAVE_OPENMP
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#undef HAVE_PTRDIFF_T
+
+/* Define to 1 if you have the `sleep' function. */
+#undef HAVE_SLEEP
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* sockets support */
+#undef HAVE_SOCKET
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#undef HAVE_UINT32_T
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#undef HAVE_UINT64_T
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the type `unsigned long long'. */
+#undef HAVE_UNSIGNED_LONG_LONG
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
+/* LOCALEDIR */
+#undef LOCALEDIR
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `double', as computed by sizeof. */
+#undef SIZEOF_DOUBLE
+
+/* The size of `float', as computed by sizeof. */
+#undef SIZEOF_FLOAT
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/data/mati/emm.dat b/data/mati/emm.dat
new file mode 100644
index 0000000..8fc5841
--- /dev/null
+++ b/data/mati/emm.dat
@@ -0,0 +1,287 @@
+'NoTitle'
+'GEOM'
+ 2 $ IMPRE
+ $ NOM DU FICHIER RESTAURE
+emm.geom
+'DIME'
+ 2 3 $ IMPRE NDIM
+'QC25'
+ 2 1 0 RTOP $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 11 $ NOLO
+ 12 $ NOLO
+ 13 $ NOLO
+ 14 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 2 0 RBOT $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 1 $ NOLO
+ 2 $ NOLO
+ 3 $ NOLO
+ 4 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 14 0 RTOP $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 91 $ NOLO
+ 92 $ NOLO
+ 83 $ NOLO
+ 94 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 12 0 RBOT $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 5 $ NOLO
+ 73 $ NOLO
+ 6 $ NOLO
+ 9 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 13 0 RTOP $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 15 $ NOLO
+ 71 $ NOLO
+ 16 $ NOLO
+ 10 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 25 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 6 -1 $ NBRELI NS1L
+ 32 $ NOLO
+ 51 $ NOLO
+ 29 $ NOLO
+ 52 $ NOLO
+ 34 $ NOLO
+ 10 $ NOLO
+ -2 1 $ IMAX NQUAD
+'QC25'
+ 2 24 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 6 -1 $ NBRELI NS1L
+ 59 $ NOLO
+ 31 $ NOLO
+ 39 $ NOLO
+ 33 $ NOLO
+ 60 $ NOLO
+ 9 $ NOLO
+ -2 1 $ IMAX NQUAD
+'QC25'
+ 2 26 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 46 $ NOLO
+ 45 $ NOLO
+ 48 $ NOLO
+ 47 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 4 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 86 $ NOLO
+ 85 $ NOLO
+ 88 $ NOLO
+ 87 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 27 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 51 $ NOLO
+ 29 $ NOLO
+ 52 $ NOLO
+ 55 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 23 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 53 $ NOLO
+ 13 $ NOLO
+ 54 $ NOLO
+ 30 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 28 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 35 $ NOLO
+ 3 $ NOLO
+ 37 $ NOLO
+ 40 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 29 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 41 $ NOLO
+ 44 $ NOLO
+ 43 $ NOLO
+ 42 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 3 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 81 $ NOLO
+ 84 $ NOLO
+ 83 $ NOLO
+ 82 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 30 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 30 $ NOLO
+ 54 $ NOLO
+ 13 $ NOLO
+ 53 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 31 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 73 $ NOLO
+ 68 $ NOLO
+ 1 $ NOLO
+ 67 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 15 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 71 $ NOLO
+ 64 $ NOLO
+ 11 $ NOLO
+ 63 $ NOLO
+ -1 1 $ IMAX NQUAD
+'INB3'
+ 2 $ IMPRE
+ 1 $ NIVEAI
+ 2 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 17 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RSTO NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1 ARIT 1 $ RAISON TYPRAI TYPREP
+
+'INB3'
+ 2 $ IMPRE
+ 13 $ NIVEAI
+ 12 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 18 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RAMO NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1 ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 14 $ NIVEAI
+ 1 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 6 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RBOT NCIEL 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 25 $ NIVEAI
+ 24 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 1 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RALI NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 26 $ NIVEAI
+ 4 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 2 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RIN $ NREF1
+ RCAL NALIM 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 0.25 ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 4 $ NIVEAI
+ 27 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 7 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RALI NCONV 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 23 $ NIVEAI
+ 28 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 4 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ REVA NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 29 $ NIVEAI
+ 3 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 8 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ ROUT $ NREF1
+ RCEV NEVAC 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 0.1 ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 3 $ NIVEAI
+ 30 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 5 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RBOT NCIEL 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 15 $ NIVEAI
+ 31 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 3 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ 0 NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'RECM'
+ 2 1.e-3 2 $ IMPRE EPS IOPT
+ $ LISTE
+18
+17
+1
+2
+3
+7
+8
+4
+5
+6
+ -1 $ FIN DE LISTE
+ 20 $ NIVEAU RESULTAT
+'VEMA'
+ 2 20 1.e-2 $ IMPRE NIVEAU EPS
+'EXTR'
+ 2 20 0 21 $ IMPRE NIVEA1 ICHOIX NIVEA2
+
+'RECM'
+ 2 1.e-3 2 $ IMPRE EPS IOPT
+ $ LISTE
+20
+21
+ -1 $ FIN DE LISTE
+ 22 $ NIVEAU RESULTAT
+
+'SAUV'
+ 2 22 $ IMPRE NIVEAU
+ $ NOM DU FICHIER DE SAUVEGARDE
+emm.des
+
+
+'VEMA'
+ 2 22 1.e-2 $ IMPRE NIVEAU EPS
+
+
+
diff --git a/data/mati/emm.geom b/data/mati/emm.geom
new file mode 100644
index 0000000..5ce8d5a
--- /dev/null
+++ b/data/mati/emm.geom
@@ -0,0 +1,246 @@
+--------------------
+------ vault storage
+--------------------
+
+
+-- profondeur
+!DEEP=PLTUB*NRANG
+!NDEP=NRANG*NCELL+1
+
+-- largeur
+!WIDE=PTTUB*NLIGN
+!NWID=NLIGN*NCELT+1
+
+-- hauteur
+!HIGHT=PVTUB*NZTUB
+!NHIG=NZTUB+1
+
+-- jeu amont 1
+!JAMU=-1*GAPGRE
+!NAMU=NELGRE+1
+
+-- grille amont
+!AMON=JAMU-ABAMON
+!NAMO=5
+
+-- epaisseur des cheminees
+!SCHEM=EPSCHEM
+!NCHEM=6
+
+-- jeu amont 2
+!JAMD=AMON-GAPCHEG
+!NJEU2=1+1
+
+-- mur amont
+!MAMO=JAMD-SCHEM
+
+-- mur aval
+!MAVA=DEEP+SCHEM
+!JAVD=DEEP
+
+-- hauteur cheminee d alimentation
+!HALIM=HCHALIM
+!NALIM=11
+
+-- cote cheminee
+!YMCH=WIDE*(1.-1./RCONVER)*0.5
+!YPCH=WIDE*(1.+1./RCONVER)*0.5
+
+-- hauteur convergent
+!HCONV=HCONVER
+!NCONV=11
+
+-- hauteur bord du toit
+!HTOIB=HTOITBAS
+!NCIEL=NCELCIEL
+-- hauteur fait du toit
+!HTOIH=HTOITHAU
+
+-- hauteur cheminee d evacuation
+!HEVAC=HCHEVAC
+!NEVAC=7
+
+-- reference point
+!RPOI=11
+
+-- reference surface
+!RIN=5
+!ROUT=1
+!RBOT=10
+!RTOP=11
+!RSYM=12
+!RMUR=13
+
+-- references cellules
+!RALI=0
+!REVA=0
+!RCAL=3
+!RCEV=6
+!RAMO=2
+!RAVA=4
+!RSTO=8
+
+POINTS
+ 2 CART 0 $ IMPRE TYPCOO ICONST
+$ NUM REF X Y Z
+ 1 RPOI 0 0 0
+ 2 RPOI WIDE 0 0
+ 3 RPOI WIDE DEEP 0
+ 4 RPOI 0 DEEP 0
+ 5 RPOI WIDE AMON 0
+ 6 RPOI 0 AMON 0
+
+ 11 RPOI 0 0 HIGHT
+ 12 RPOI WIDE 0 HIGHT
+ 13 RPOI WIDE DEEP HIGHT
+ 14 RPOI 0 DEEP HIGHT
+ 15 RPOI WIDE AMON HIGHT
+ 16 RPOI 0 AMON HIGHT
+
+ 91 RPOI 0 0 HTOIB
+ 92 RPOI WIDE 0 HTOIB
+
+ 21 RPOI WIDE MAMO HIGHT
+ 22 RPOI 0 MAMO HIGHT
+
+ 25 RPOI WIDE MAMO 0
+ 26 RPOI 0 MAMO 0
+
+ 36 RPOI YMCH JAMD HALIM
+ 35 RPOI YPCH JAMD HALIM
+ 41 RPOI YPCH MAMO HALIM
+ 42 RPOI YMCH MAMO HALIM
+
+ 44 RPOI 0 MAVA HEVAC
+ 43 RPOI WIDE MAVA HEVAC
+ 37 RPOI WIDE JAVD HEVAC
+ 38 RPOI 0 JAVD HEVAC
+ 84 RPOI 0 MAVA HTOIH
+ 83 RPOI WIDE MAVA HTOIH
+ 77 RPOI WIDE JAVD HTOIH
+ 78 RPOI 0 JAVD HTOIH
+ 23 RPOI WIDE MAVA HIGHT
+ 24 RPOI 0 MAVA HIGHT
+ 53 RPOI WIDE JAVD HIGHT
+ 54 RPOI 0 JAVD HIGHT
+ 28 RPOI 0 MAVA 0
+ 58 RPOI 0 JAVD 0
+ 57 RPOI WIDE JAVD 0
+ 27 RPOI WIDE MAVA 0
+
+ 76 RPOI YMCH JAMD HCONV
+ 75 RPOI YPCH JAMD HCONV
+ 81 RPOI YPCH MAMO HCONV
+ 82 RPOI YMCH MAMO HCONV
+
+ 51 RPOI WIDE JAMD HIGHT
+ 52 RPOI 0 JAMD HIGHT
+
+ 55 RPOI WIDE JAMD 0
+ 56 RPOI 0 JAMD 0
+
+ 59 RPOI WIDE JAMU HIGHT
+ 60 RPOI 0 JAMU HIGHT
+
+ 63 RPOI WIDE JAMU 0
+ 64 RPOI 0 JAMU 0
+ 0 $ FIN DES POINTS
+
+LIGNES
+ 2 0 $ IMPRE ICONST
+$ NO NOEUDS NP1 NP2 NREF NFFRON RAISON
+ 1 NWID 1 2 RBOT 0 1
+ 2 NDEP 2 3 RSYM 0 1
+ 3 NWID 3 4 RBOT 0 1
+ 4 NDEP 4 1 RSYM 0 1
+
+ 11 NWID 11 12 RTOP 0 1
+ 12 NDEP 12 13 RSYM 0 1
+ 13 NWID 13 14 RTOP 0 1
+ 14 NDEP 14 11 RSYM 0 1
+
+ 91 NWID 91 92 RTOP 0 1
+ 92 NDEP 92 77 RSYM 0 1
+ 94 NDEP 78 91 RSYM 0 1
+
+ 5 NAMO 63 5 RSYM 0 1
+ 6 NAMO 64 6 RSYM 0 1
+ 15 NAMO 59 15 RSYM 0 1
+ 16 NAMO 60 16 RSYM 0 1
+
+ 21 NHIG 1 11 RSYM 0 1
+ 22 NHIG 2 12 RSYM 0 1
+ 23 NHIG 3 13 RSYM 0 1
+ 24 NHIG 4 14 RSYM 0 1
+ 25 NHIG 5 15 RIN 0 1
+
+ 9 NWID 5 6 RMUR 0 1
+ 10 NWID 15 16 RMUR 0 1
+
+ 31 NCHEM 25 55 RSYM 0 1
+ 51 NCHEM 21 51 RSYM 0 1
+ 52 NCHEM 22 52 RSYM 0 1
+ 33 NCHEM 26 56 RSYM 0 1
+
+ 39 NWID 25 26 RMUR 0 1
+ 29 NWID 21 22 RMUR 0 1
+
+ 45 NWID 42 41 RMUR 0 1
+ 46 NCHEM 41 35 RSYM 0 1
+ 47 NWID 35 36 RMUR 0 1
+ 48 NCHEM 36 42 RSYM 0 1
+
+ 85 NWID 82 81 RMUR 0 1
+ 86 NCHEM 81 75 RSYM 0 1
+ 87 NWID 75 76 RMUR 0 1
+ 88 NCHEM 76 82 RSYM 0 1
+
+ 41 NWID 44 43 RMUR 0 1
+ 42 NCHEM 43 37 RSYM 0 1
+ 43 NWID 37 38 RMUR 0 1
+ 44 NCHEM 38 44 RSYM 0 1
+ 81 NWID 84 83 RMUR 0 1
+ 82 NCHEM 83 77 RSYM 0 1
+ 83 NWID 77 78 RMUR 0 1
+ 84 NCHEM 78 84 RSYM 0 1
+ 30 NWID 23 24 RMUR 0 1
+ 54 NCHEM 24 54 RSYM 0 1
+ 53 NCHEM 23 53 RSYM 0 1
+ 37 NCHEM 28 58 RSYM 0 1
+ 35 NCHEM 27 57 RSYM 0 1
+ 40 NWID 27 28 RMUR 0 1
+ 32 NJEU2 51 15 RSYM 0 1
+ 34 NJEU2 52 16 RSYM 0 1
+ 26 NHIG 6 16 RIN 0 1
+
+
+
+ 51 NCHEM 21 51 RSYM 0 1
+ 52 NCHEM 22 52 RSYM 0 1
+
+
+ 55 NWID 52 51 RMUR 0 1
+ 57 NWID 55 56 RMUR 0 1
+
+ 59 NJEU2 55 5 RSYM 0 1
+ 60 NJEU2 56 6 RSYM 0 1
+
+ 63 NAMU 12 59 RSYM 0 1
+ 64 NAMU 11 60 RSYM 0 1
+
+ 67 NAMU 2 63 RSYM 0 1
+ 68 NAMU 1 64 RSYM 0 1
+
+ 71 NWID 60 59 RMUR 0 1
+ 73 NWID 64 63 RMUR 0 1
+
+
+
+
+0 $ FIN DES LIGNES
+
+
+
+
+
+
diff --git a/data/mati/vault.dat b/data/mati/vault.dat
new file mode 100644
index 0000000..24e8299
--- /dev/null
+++ b/data/mati/vault.dat
@@ -0,0 +1,325 @@
+'NoTitle'
+'GEOM'
+ 2 $ IMPRE
+ $ NOM DU FICHIER RESTAURE
+vault.geom
+'DIME'
+ 2 3 $ IMPRE NDIM
+'QC25'
+ 2 1 0 RTOP $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 11 $ NOLO
+ 12 $ NOLO
+ 13 $ NOLO
+ 14 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 2 0 RBOT $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 1 $ NOLO
+ 2 $ NOLO
+ 3 $ NOLO
+ 4 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 9 0 RBOT $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 74 $ NOLO
+ 8 $ NOLO
+ 19 $ NOLO
+ 7 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 8 0 RTOP $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 72 $ NOLO
+ 18 $ NOLO
+ 20 $ NOLO
+ 17 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 12 0 RBOT $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 5 $ NOLO
+ 73 $ NOLO
+ 6 $ NOLO
+ 9 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 13 0 RTOP $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 15 $ NOLO
+ 71 $ NOLO
+ 16 $ NOLO
+ 10 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 25 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 6 -1 $ NBRELI NS1L
+ 32 $ NOLO
+ 51 $ NOLO
+ 29 $ NOLO
+ 52 $ NOLO
+ 34 $ NOLO
+ 10 $ NOLO
+ -2 1 $ IMAX NQUAD
+'QC25'
+ 2 24 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 6 -1 $ NBRELI NS1L
+ 59 $ NOLO
+ 31 $ NOLO
+ 39 $ NOLO
+ 33 $ NOLO
+ 60 $ NOLO
+ 9 $ NOLO
+ -2 1 $ IMAX NQUAD
+'QC25'
+ 2 26 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 46 $ NOLO
+ 45 $ NOLO
+ 48 $ NOLO
+ 47 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 4 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 86 $ NOLO
+ 85 $ NOLO
+ 88 $ NOLO
+ 87 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 27 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 51 $ NOLO
+ 29 $ NOLO
+ 52 $ NOLO
+ 55 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 23 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 6 1 $ NBRELI NS1L
+ 53 $ NOLO
+ 36 $ NOLO
+ 20 $ NOLO
+ 38 $ NOLO
+ 54 $ NOLO
+ 30 $ NOLO
+ -2 1 $ IMAX NQUAD
+'QC25'
+ 2 28 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 6 1 $ NBRELI NS1L
+ 35 $ NOLO
+ 61 $ NOLO
+ 19 $ NOLO
+ 62 $ NOLO
+ 37 $ NOLO
+ 40 $ NOLO
+ -2 1 $ IMAX NQUAD
+'QC25'
+ 2 29 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 41 $ NOLO
+ 44 $ NOLO
+ 43 $ NOLO
+ 42 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 3 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 -1 $ NBRELI NS1L
+ 81 $ NOLO
+ 84 $ NOLO
+ 83 $ NOLO
+ 82 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 30 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 30 $ NOLO
+ 54 $ NOLO
+ 56 $ NOLO
+ 53 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 31 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 73 $ NOLO
+ 68 $ NOLO
+ 1 $ NOLO
+ 67 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 32 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 70 $ NOLO
+ 74 $ NOLO
+ 69 $ NOLO
+ 3 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 14 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 66 $ NOLO
+ 72 $ NOLO
+ 65 $ NOLO
+ 13 $ NOLO
+ -1 1 $ IMAX NQUAD
+'QC25'
+ 2 15 0 0 $ IMPRE NIVEAU NSURF NDSDE
+ 4 1 $ NBRELI NS1L
+ 71 $ NOLO
+ 64 $ NOLO
+ 11 $ NOLO
+ 63 $ NOLO
+ -1 1 $ IMAX NQUAD
+'INB3'
+ 2 $ IMPRE
+ 1 $ NIVEAI
+ 2 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 17 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RSTO NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1 ARIT 1 $ RAISON TYPRAI TYPREP
+
+'INB3'
+ 2 $ IMPRE
+ 13 $ NIVEAI
+ 12 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 18 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RAMO NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1 ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 9 $ NIVEAI
+ 8 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 19 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RBOT $ NREF1
+ RAVA NHIG RTOP -1 $ NDSD NBSEC NREF2 NREFF
+ 1 ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 25 $ NIVEAI
+ 24 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 1 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RALI NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 26 $ NIVEAI
+ 4 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 2 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RIN $ NREF1
+ RCAL NALIM 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 0.25 ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 4 $ NIVEAI
+ 27 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 7 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RALI NCONV 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 23 $ NIVEAI
+ 28 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 4 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ REVA NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 29 $ NIVEAI
+ 3 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 8 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ ROUT $ NREF1
+ RCEV NEVAC 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 0.1 ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 3 $ NIVEAI
+ 30 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 5 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ REVA NCONV 0 -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 15 $ NIVEAI
+ 31 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 3 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RJM NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'INB3'
+ 2 $ IMPRE
+ 14 $ NIVEAI
+ 32 $ NIVEAI
+ 0 $ FIN DE LISTE
+ 6 $ RESULTAT
+ 1 0 -7 $ TYPELE TYPREF NFFRON
+ RTOP $ NREF1
+ RJV NHIG RBOT -1 $ NDSD NBSEC NREF2 NREFF
+ 1. ARIT 1 $ RAISON TYPRAI TYPREP
+'RECM'
+ 2 1.e-3 2 $ IMPRE EPS IOPT
+ $ LISTE
+19
+18
+17
+1
+2
+3
+7
+8
+4
+5
+6
+ -1 $ FIN DE LISTE
+ 20 $ NIVEAU RESULTAT
+'VEMA'
+ 2 20 1.e-2 $ IMPRE NIVEAU EPS
+'EXTR'
+ 2 20 0 21 $ IMPRE NIVEA1 ICHOIX NIVEA2
+
+'RECM'
+ 2 1.e-3 2 $ IMPRE EPS IOPT
+ $ LISTE
+20
+21
+ -1 $ FIN DE LISTE
+ 22 $ NIVEAU RESULTAT
+
+'SAUV'
+ 2 22 $ IMPRE NIVEAU
+ $ NOM DU FICHIER DE SAUVEGARDE
+vault.des
+
+
+'VEMA'
+ 2 22 1.e-2 $ IMPRE NIVEAU EPS
+
+
diff --git a/data/mati/vault.geom b/data/mati/vault.geom
new file mode 100644
index 0000000..99ea525
--- /dev/null
+++ b/data/mati/vault.geom
@@ -0,0 +1,263 @@
+--------------------
+------ vault storage
+--------------------
+
+
+-- profondeur
+!DEEP=PLTUB*NRANG
+!NDEP=NRANG*NCELL+1
+
+-- largeur
+!WIDE=PTTUB*NLIGN
+!NWID=NLIGN*NCELT+1
+
+-- hauteur
+!HIGHT=PVTUB*NZTUB
+!NHIG=NZTUB+1
+
+-- jeu amont 1
+!JAMU=-1*GAPGRE
+!NAMU=NELGRE+1
+
+-- jeu aval 1
+!JAVU=DEEP+GAPREG
+!NAVU=NELREG+1
+
+-- grille amont
+!AMON=JAMU-ABAMON
+!NAMO=5
+
+-- grille aval
+!AVAL=JAVU+ABAMON
+!NAVA=5
+
+-- epaisseur des cheminees
+!SCHEM=EPSCHEM
+!NCHEM=6
+
+-- jeu amont 2
+!JAMD=AMON-GAPCHEG
+!NJEU2=NELCHEG+1
+
+-- jeu aval 2
+!JAVD=AVAL+GAPGECH
+!NJEU3=NELGECH+1
+
+-- mur amont
+!MAMO=JAMD-SCHEM
+
+-- mur aval
+!MAVA=JAVD+SCHEM
+
+-- hauteur cheminee d alimentation
+!HALIM=HCHALIM
+!NALIM=11
+
+-- cote cheminee
+!YMCH=WIDE*(1.-1./RCONVER)*0.5
+!YPCH=WIDE*(1.+1./RCONVER)*0.5
+
+-- hauteur convergent
+!HCONV=HCONVER
+!NCONV=11
+
+-- hauteur cheminee d evacuation
+!HEVAC=HCHEVAC
+!NEVAC=13
+
+-- reference point
+!RPOI=11
+
+-- reference surface
+!RIN=5
+!ROUT=1
+!RBOT=10
+!RTOP=11
+!RSYM=12
+!RMUR=13
+
+-- references cellules
+!RALI=0
+!REVA=0
+!RCAL=3
+!RCEV=6
+!RAMO=2
+!RAVA=4
+!RSTO=8
+!RJM=7
+!RJV=9
+
+POINTS
+ 2 CART 0 $ IMPRE TYPCOO ICONST
+$ NUM REF X Y Z
+ 1 RPOI 0 0 0
+ 2 RPOI WIDE 0 0
+ 3 RPOI WIDE DEEP 0
+ 4 RPOI 0 DEEP 0
+ 5 RPOI WIDE AMON 0
+ 6 RPOI 0 AMON 0
+ 7 RPOI WIDE AVAL 0
+ 8 RPOI 0 AVAL 0
+ 11 RPOI 0 0 HIGHT
+ 12 RPOI WIDE 0 HIGHT
+ 13 RPOI WIDE DEEP HIGHT
+ 14 RPOI 0 DEEP HIGHT
+ 15 RPOI WIDE AMON HIGHT
+ 16 RPOI 0 AMON HIGHT
+ 17 RPOI WIDE AVAL HIGHT
+ 18 RPOI 0 AVAL HIGHT
+ 21 RPOI WIDE MAMO HIGHT
+ 22 RPOI 0 MAMO HIGHT
+ 23 RPOI WIDE MAVA HIGHT
+ 24 RPOI 0 MAVA HIGHT
+ 25 RPOI WIDE MAMO 0
+ 26 RPOI 0 MAMO 0
+ 27 RPOI WIDE MAVA 0
+ 28 RPOI 0 MAVA 0
+
+ 44 RPOI YMCH MAVA HEVAC
+ 43 RPOI YPCH MAVA HEVAC
+ 37 RPOI YPCH JAVD HEVAC
+ 38 RPOI YMCH JAVD HEVAC
+ 36 RPOI YMCH JAMD HALIM
+ 35 RPOI YPCH JAMD HALIM
+ 41 RPOI YPCH MAMO HALIM
+ 42 RPOI YMCH MAMO HALIM
+
+ 84 RPOI YMCH MAVA HCONV
+ 83 RPOI YPCH MAVA HCONV
+ 77 RPOI YPCH JAVD HCONV
+ 78 RPOI YMCH JAVD HCONV
+ 76 RPOI YMCH JAMD HCONV
+ 75 RPOI YPCH JAMD HCONV
+ 81 RPOI YPCH MAMO HCONV
+ 82 RPOI YMCH MAMO HCONV
+
+ 51 RPOI WIDE JAMD HIGHT
+ 52 RPOI 0 JAMD HIGHT
+ 53 RPOI WIDE JAVD HIGHT
+ 54 RPOI 0 JAVD HIGHT
+
+ 55 RPOI WIDE JAMD 0
+ 56 RPOI 0 JAMD 0
+ 57 RPOI WIDE JAVD 0
+ 58 RPOI 0 JAVD 0
+
+ 59 RPOI WIDE JAMU HIGHT
+ 60 RPOI 0 JAMU HIGHT
+ 61 RPOI WIDE JAVU HIGHT
+ 62 RPOI 0 JAVU HIGHT
+
+ 63 RPOI WIDE JAMU 0
+ 64 RPOI 0 JAMU 0
+ 65 RPOI WIDE JAVU 0
+ 66 RPOI 0 JAVU 0
+ 0 $ FIN DES POINTS
+
+LIGNES
+ 2 0 $ IMPRE ICONST
+$ NO NOEUDS NP1 NP2 NREF NFFRON RAISON
+ 1 NWID 1 2 RBOT 0 1
+ 2 NDEP 2 3 RSYM 0 1
+ 3 NWID 3 4 RBOT 0 1
+ 4 NDEP 4 1 RSYM 0 1
+
+ 11 NWID 11 12 RTOP 0 1
+ 12 NDEP 12 13 RSYM 0 1
+ 13 NWID 13 14 RTOP 0 1
+ 14 NDEP 14 11 RSYM 0 1
+
+ 5 NAMO 63 5 RSYM 0 1
+ 6 NAMO 64 6 RSYM 0 1
+ 15 NAMO 59 15 RSYM 0 1
+ 16 NAMO 60 16 RSYM 0 1
+
+ 7 NAVA 65 7 RSYM 0 1
+ 8 NAVA 66 8 RSYM 0 1
+ 17 NAVA 61 17 RSYM 0 1
+ 18 NAVA 62 18 RSYM 0 1
+
+ 21 NHIG 1 11 RSYM 0 1
+ 22 NHIG 2 12 RSYM 0 1
+ 23 NHIG 3 13 RSYM 0 1
+ 24 NHIG 4 14 RSYM 0 1
+ 25 NHIG 5 15 RIN 0 1
+ 26 NHIG 6 16 RIN 0 1
+ 27 NHIG 7 17 ROUT 0 1
+ 28 NHIG 8 18 ROUT 0 1
+
+ 9 NWID 5 6 RMUR 0 1
+ 10 NWID 15 16 RMUR 0 1
+ 19 NWID 7 8 RMUR 0 1
+ 20 NWID 17 18 RMUR 0 1
+
+ 31 NCHEM 25 55 RSYM 0 1
+ 32 NJEU2 51 15 RSYM 0 1
+ 51 NCHEM 21 51 RSYM 0 1
+ 33 NCHEM 26 56 RSYM 0 1
+ 34 NJEU2 52 16 RSYM 0 1
+ 52 NCHEM 22 52 RSYM 0 1
+ 35 NCHEM 27 57 RSYM 0 1
+ 36 NJEU3 53 17 RSYM 0 1
+ 53 NCHEM 23 53 RSYM 0 1
+ 37 NCHEM 28 58 RSYM 0 1
+ 38 NJEU3 54 18 RSYM 0 1
+ 54 NCHEM 24 54 RSYM 0 1
+
+ 39 NWID 25 26 RMUR 0 1
+ 40 NWID 27 28 RMUR 0 1
+ 29 NWID 21 22 RMUR 0 1
+ 30 NWID 23 24 RMUR 0 1
+
+ 41 NWID 44 43 RMUR 0 1
+ 42 NCHEM 43 37 RSYM 0 1
+ 43 NWID 37 38 RMUR 0 1
+ 44 NCHEM 38 44 RSYM 0 1
+
+ 81 NWID 84 83 RMUR 0 1
+ 82 NCHEM 83 77 RSYM 0 1
+ 83 NWID 77 78 RMUR 0 1
+ 84 NCHEM 78 84 RSYM 0 1
+
+ 45 NWID 42 41 RMUR 0 1
+ 46 NCHEM 41 35 RSYM 0 1
+ 47 NWID 35 36 RMUR 0 1
+ 48 NCHEM 36 42 RSYM 0 1
+
+ 85 NWID 82 81 RMUR 0 1
+ 86 NCHEM 81 75 RSYM 0 1
+ 87 NWID 75 76 RMUR 0 1
+ 88 NCHEM 76 82 RSYM 0 1
+
+ 55 NWID 52 51 RMUR 0 1
+ 56 NWID 53 54 RMUR 0 1
+ 57 NWID 55 56 RMUR 0 1
+ 58 NWID 57 58 RMUR 0 1
+
+ 59 NJEU2 55 5 RSYM 0 1
+ 60 NJEU2 56 6 RSYM 0 1
+ 61 NJEU3 57 7 RSYM 0 1
+ 62 NJEU3 58 8 RSYM 0 1
+
+ 63 NAMU 12 59 RSYM 0 1
+ 64 NAMU 11 60 RSYM 0 1
+ 65 NAVU 61 13 RSYM 0 1
+ 66 NAVU 62 14 RSYM 0 1
+
+ 67 NAMU 2 63 RSYM 0 1
+ 68 NAMU 1 64 RSYM 0 1
+ 69 NAVU 3 65 RSYM 0 1
+ 70 NAVU 4 66 RSYM 0 1
+
+ 71 NWID 60 59 RMUR 0 1
+ 72 NWID 61 62 RMUR 0 1
+ 73 NWID 64 63 RMUR 0 1
+ 74 NWID 65 66 RMUR 0 1
+
+0 $ FIN DES LIGNES
+
+
+
+
+
+
diff --git a/data/thch/JANAF b/data/thch/JANAF
new file mode 100644
index 0000000..c8950bb
--- /dev/null
+++ b/data/thch/JANAF
@@ -0,0 +1,653 @@
+thermo
+ 300.000 1000.000 5000.000
+C(S) J 3/61C 1.0 0.0 0.0 0.S 300.000 5000.000
+ .13604942E+01 .19182237E-02 -.84040389E-06 .16448707E-09 -.11672670E-13
+ -.65713870E+03 -.80070207E+01 -.44778053E+00 .53691002E-02 -.39775571E-06
+ -.40459298E-08 .21134939E-11 -.94280688E+02 .16840791E+01
+C J 3/61C 1.00 0.00 0.00 0.G 300.000 5000.000
+ .25810663E+01 -.14696202E-03 .74388084E-07 -.79481079E-11 .58900977E-16
+ .85216294E+05 .43128879E+01 .25328705E+01 -.15887641E-03 .30682082E-06
+ -.26770064E-09 .87488827E-13 .85240422E+05 .46062374E+01
+C+ L12/66C 1.E -1.00 0.00 0.G 300.000 5000.000
+ .25118274E+01 -.17359784E-04 .95042676E-08 -.22188518E-11 .18621892E-15
+ .21667721E+06 .42861298E+01 .25953840E+01 -.40686645E-03 .68923669E-06
+ -.52664878E-09 .15083377E-12 .21666281E+06 .38957298E+01
+C- J 9/65C 1.E 1.00 0.00 0.G 300.000 5000.000
+ .24470591E+01 .11286428E-03 -.78591462E-07 .19778614E-10 -.11105555E-14
+ .69972969E+05 .42356992E+01 .24925640E+01 .53153068E-04 -.13307994E-06
+ .13951379E-09 -.52150992E-13 .69955757E+05 .39811657E+01
+CCL J12/69C 1.CL 1.0 0.0 0.G 300.000 5000.000
+ .40984727E+01 .50077845E-03 -.20012833E-06 .38680992E-10 -.25441113E-14
+ .59076599E+05 .33370201E+01 .31953557E+01 .28076318E-02 -.16043845E-05
+ -.57744065E-09 .61409732E-12 .59325077E+05 .80220197E+01
+CCL2 J12/68C 1.CL 2.0 0.0 0.G 300.000 5000.000
+ .37184999E+01 .53449745E-02 -.23431284E-05 .41806177E-09 -.26765295E-13
+ .27554793E+05 .96328274E+01 .28588505E+01 .13957938E-01 -.20038898E-04
+ .13500726E-07 -.31669715E-11 .27363926E+05 .12230161E+02
+CCL2F2 J 6/70C 1.CL 2.F 2. 0.G 300.000 5000.000
+ .10381031E+02 .29646161E-02 -.13103005E-05 .25625459E-09 -.18449697E-13
+ -.62784386E+05 -.24829918E+02 .15974049E+01 .36382427E-01 -.51940779E-04
+ .36230035E-07 -.99959359E-11 -.60830787E+05 .18245759E+02
+CCL3 J 6/70C 1.CL 3.0 0.0 0.G 300.000 5000.000
+ .87815473E+01 .13516130E-02 -.58249453E-06 .11098697E-09 -.77937264E-14
+ .66344151E+04 -.15329284E+02 .37153357E+01 .19443796E-01 -.24627841E-04
+ .13786464E-07 -.26638934E-11 .77820020E+04 .97028910E+01
+CCL3F J 6/70C 1.CL 3.F 1. 0.G 300.000 5000.000
+ .10986599E+02 .22916018E-02 -.10162217E-05 .19917607E-09 -.14361911E-13
+ -.38468983E+05 -.26898289E+02 .23331266E+01 .37352373E-01 -.57591855E-04
+ .42746118E-07 -.12392969E-10 -.36648367E+05 .15017166E+02
+CCL4 J12/68C 1.CL 4.0 0.0 0.G 300.000 5000.000
+ .11601304E+02 .15550273E-02 -.67045280E-06 .12770337E-09 -.89616950E-14
+ -.15389852E+05 -.30063473E+02 .42667400E+01 .29452637E-01 -.40820650E-04
+ .25581544E-07 -.58756489E-11 -.13810816E+05 .57614468E+01
+CF J 6/70C 1.F 1.0 0.0 0.G 300.000 5000.000
+ .36869679E+01 .91143491E-03 -.36463855E-06 .67482854E-10 -.45269596E-14
+ .29478125E+05 .41613468E+01 .34655143E+01 -.68779805E-03 .56784766E-05
+ -.64582982E-08 .22988248E-11 .29655598E+05 .58681916E+01
+CF+ J12/70C 1.F 1.E -1.0 0.G 300.000 5000.000
+ .36089986E+01 .98627001E-03 -.39514130E-06 .73142716E-10 -.49773164E-14
+ .13704674E+06 .38918614E+01 .34305942E+01 -.77491625E-03 .58009484E-05
+ -.64435448E-08 .22552103E-11 .13721751E+06 .53945582E+01
+CF2 J 6/70C 1.F 2.0 0.0 0.G 300.000 5000.000
+ .52267142E+01 .20837680E-02 -.99037278E-06 .21264848E-09 -.15831114E-13
+ -.23755847E+05 -.19240670E+01 .27688821E+01 .72372962E-02 -.16028152E-05
+ -.45512379E-08 .26648011E-11 -.23015786E+05 .11124533E+02
+CF2+ J12/70C 1.F 2.E -1.0 0.G 300.000 5000.000
+ .51554230E+01 .20528310E-02 -.91173911E-06 .18272761E-09 -.13213640E-13
+ .11143122E+06 -.79191320E+00 .29783522E+01 .60336602E-02 .65858785E-09
+ -.52129449E-08 .26663021E-11 .11212675E+06 .10938410E+02
+CF3 J 6/69C 1.F 3.0 0.0 0.G 300.000 5000.000
+ .72012622E+01 .30663935E-02 -.13144181E-05 .24996925E-09 -.17550928E-13
+ -.59238631E+05 -.10958873E+02 .20650168E+01 .16424158E-01 -.10838146E-04
+ -.85317997E-09 .23878070E-11 -.57811976E+05 .15691530E+02
+CF3+ J12/71C 1.F 3.E -1. 0.G 300.000 5000.000
+ .70225406E+01 .32441271E-02 -.13864875E-05 .26323637E-09 -.18464402E-13
+ .48022318E+05 -.11219685E+02 .22605576E+01 .15422323E-01 -.98956674E-05
+ -.78345046E-09 .21211892E-11 .49365338E+05 .13565304E+02
+CF4 J 6/69C 1.F 4.0 0.0 0.G 300.000 5000.000
+ .91644298E+01 .41978941E-02 -.17971486E-05 .34132082E-09 -.23934115E-13
+ -.11571355E+06 -.23292961E+02 .11656107E+01 .27177786E-01 -.23317677E-04
+ .55706566E-08 .12861856E-11 -.11360052E+06 .17670656E+02
+CH J12/67C 1.H 1.0 0.0 0.G 300.000 5000.000
+ .22673116E+01 .22043000E-02 -.62250191E-06 .69689940E-10 -.21274952E-14
+ .70838037E+05 .87889352E+01 .35632752E+01 -.20031372E-03 -.40129814E-06
+ .18226922E-08 -.86768311E-12 .70405506E+05 .17628023E+01
+CH+ J12/71C 1.H 1.E -1. 0.G 300.000 5000.000
+ .27466401E+01 .15496991E-02 -.52858324E-06 .86132075E-10 -.50909775E-14
+ .19483672E+06 .46994695E+01 .35601593E+01 -.22478101E-03 -.26341623E-06
+ .16716214E-08 -.89478626E-12 .19460363E+06 .41570213E+00
+CH2 J12/72C 1.H 2. 0. 0.G 300.000 5000.000
+ .27525479E+01 .39782047E-02 -.14921731E-05 .25956899E-09 -.17110673E-13
+ .45547759E+05 .66534799E+01 .35883347E+01 .21724137E-02 -.13323408E-05
+ .19469445E-08 -.89431394E-12 .45315188E+05 .22627869E+01
+CH2O J 3/61C 1.H 2.O 1.0 0.G 300.000 5000.000
+ .28364249E+01 .68605298E-02 -.26882647E-05 .47971258E-09 -.32118406E-13
+ -.15236031E+05 .78531169E+01 .37963783E+01 -.25701785E-02 .18548815E-04
+ -.17869177E-07 .55504451E-11 -.15088947E+05 .47548163E+01
+CH3 J 6/69C 1.H 3.0 0.0 0.G 300.000 5000.000
+ .28400327E+01 .60869086E-02 -.21740338E-05 .36042576E-09 -.22725300E-13
+ .16449813E+05 .55056751E+01 .34666350E+01 .38301845E-02 .10116802E-05
+ -.18859236E-08 .66803182E-12 .16313104E+05 .24172192E+01
+CH3CL J 6/72C 1.H 3.CL 1. 0.G 300.000 5000.000
+ .33525395E+01 .91076335E-02 -.35803742E-05 .64717936E-09 -.44094205E-13
+ -.11654863E+05 .60251042E+01 .23187191E+01 .72750822E-02 .82029077E-05
+ -.13787596E-07 .54737706E-11 -.11127406E+05 .12539518E+02
+CH4 J 3/61C 1.H 4.00 0.00 0.G 300.000 5000.000
+ .15027072E+01 .10416798E-01 -.39181522E-05 .67777899E-09 -.44283706E-13
+ -.99787078E+04 .10707143E+02 .38261932E+01 -.39794581E-02 .24558340E-04
+ -.22732926E-07 .69626957E-11 -.10144950E+05 .86690073E+00
+CN J 6/69C 1.N 1.0 0.0 0.G 300.000 5000.000
+ .36036285E+01 .33644390E-03 .10028933E-06 -.16318166E-10 -.36286722E-15
+ .51159833E+05 .35454505E+01 .37386307E+01 -.19239224E-02 .47035189E-05
+ -.31113000E-08 .61675318E-12 .51270927E+05 .34490218E+01
+CN+ J12/70C 1.N 1.E -1.0 0.G 300.000 5000.000
+ .36522919E+01 .81427579E-03 -.20853348E-06 .29071604E-10 -.17865094E-14
+ .21560182E+06 .43916910E+01 .36175018E+01 -.20179550E-02 .79359855E-05
+ -.77300616E-08 .24798477E-11 .21578134E+06 .53579527E+01
+CN- J12/70C 1.N 1.E 1.0 0.G 300.000 5000.000
+ .29471725E+01 .14988427E-02 -.57579547E-06 .10177789E-09 -.67478503E-14
+ .63644338E+04 .63743952E+01 .37034310E+01 -.14896426E-02 .31864701E-05
+ -.14831305E-08 .48121663E-13 .62335826E+04 .27722843E+01
+CNN J 6/66C 1.N 2.00 0.00 0.G 300.000 5000.000
+ .48209077E+01 .24790014E-02 -.94644109E-06 .16548764E-09 -.10899129E-13
+ .68685948E+05 -.48484039E+00 .35077779E+01 .72023958E-02 -.75574589E-05
+ .42979217E-08 -.94257935E-12 .68994281E+05 .60234964E+01
+CN2 J12/70C 1.N 2.0 0.0 0.G 300.000 5000.000
+ .55626268E+01 .20860606E-02 -.88123724E-06 .16505783E-09 -.11366697E-13
+ .54897907E+05 -.55989355E+01 .32524003E+01 .70010737E-02 -.22653599E-05
+ -.28939808E-08 .18270077E-11 .55609085E+05 .66966778E+01
+CO J 9/65C 1.O 1.00 0.00 0.G 300.000 5000.000
+ .29840696E+01 .14891390E-02 -.57899684E-06 .10364577E-09 -.69353550E-14
+ -.14245228E+05 .63479156E+01 .37100928E+01 -.16190964E-02 .36923594E-05
+ -.20319674E-08 .23953344E-12 -.14356310E+05 .29555351E+01
+COCL J12/65C 1.O 1.CL 1.00 0.G 300.000 5000.000
+ .54291236E+01 .16121535E-02 -.66006280E-06 .12127114E-09 -.82858601E-14
+ -.93305007E+04 .36971816E+00 .42863792E+01 .50868980E-02 -.50729411E-05
+ .29647983E-08 -.77093453E-12 -.90125212E+04 .62380308E+01
+COCLF J 6/61C 1.O 1.CL 1.F 1.G 300.000 5000.000
+ .70881081E+01 .31816479E-02 -.13763316E-05 .26544005E-09 -.18928969E-13
+ -.53883781E+05 -.86981512E+01 .17066661E+01 .22722565E-01 -.30115639E-04
+ .20483566E-07 -.56572228E-11 -.52619902E+05 .17974468E+02
+COCL2 J 6/61C 1.O 1.CL 2.00 0.G 300.000 5000.000
+ .77318082E+01 .24089287E-02 -.10111133E-05 .18936214E-09 -.13139356E-13
+ -.29136566E+05 -.11221674E+02 .31156139E+01 .18478674E-01 -.22420544E-04
+ .12868184E-07 -.27360805E-11 -.28043884E+05 .11755299E+02
+COF J12/65C 1.O 1.F 1.00 0.G 300.000 5000.000
+ .48908214E+01 .22179703E-02 -.92550725E-06 .17270120E-09 -.11955343E-13
+ -.22357984E+05 .97962087E+00 .32019727E+01 .55837770E-02 -.14905481E-05
+ -.23126069E-08 .13614353E-11 -.21817043E+05 .10047576E+02
+COF2 J12/69C 1.O 1.F 2.0 0.G 300.000 5000.000
+ .65540365E+01 .36729542E-02 -.15470211E-05 .29065749E-09 -.20226548E-13
+ -.79321725E+05 -.81127751E+01 .17973047E+01 .16588712E-01 -.12553807E-04
+ .20091842E-08 .11090061E-11 -.78009422E+05 .16478049E+02
+COS J 3/61C 1.O 1.S 1.00 0.G 300.000 5000.000
+ .52392000E+01 .24100584E-02 -.96064522E-06 .17778347E-09 -.12235704E-13
+ -.18480455E+05 -.30910517E+01 .24625321E+01 .11947992E-01 -.13794370E-04
+ .80707736E-08 -.18327653E-11 -.17803987E+05 .10792556E+02
+CO2 J 9/65C 1.O 2.00 0.00 0.G 300.000 5000.000
+ .44608041E+01 .30981719E-02 -.12392571E-05 .22741325E-09 -.15525954E-13
+ -.48961442E+05 -.98635982E+00 .24007797E+01 .87350957E-02 -.66070878E-05
+ .20021861E-08 .63274039E-15 -.48377527E+05 .96951457E+01
+CO2- J12/66C 1.O 2.E 1.00 0.G 300.000 5000.000
+ .45454640E+01 .26054316E-02 -.10928732E-05 .20454421E-09 -.14184542E-13
+ -.54761968E+05 .18317369E+01 .34743737E+01 .16913805E-02 .73533803E-05
+ -.99554255E-08 .36846719E-11 -.54249049E+05 .83834329E+01
+CP J 6/62C 1.P 1.00 0.00 0.G 300.000 5000.000
+ .37436112E+01 .83811486E-03 -.34116216E-06 .63775863E-10 -.44094630E-14
+ .54969175E+05 .42305583E+01 .32385857E+01 .51754367E-03 .35657389E-05
+ -.48985936E-08 .18766551E-11 .55196565E+05 .72701279E+01
+CS J12/76C 1.S 1. 0. 0.G 300.000 5000.000
+ .36826012E+01 .90473203E-03 -.36436374E-06 .63854294E-10 -.36933982E-14
+ .32497490E+05 .38850496E+01 .34039344E+01 -.65773308E-03 .61712157E-05
+ -.73689604E-08 .27346738E-11 .32689393E+05 .58977001E+01
+CS2 J12/76C 1.S 2. 0. 0.G 300.000 5000.000
+ .59252610E+01 .18252996E-02 -.75585380E-06 .14605073E-09 -.10438595E-13
+ .12048071E+05 -.60723317E+01 .28326013E+01 .13290791E-01 -.18144694E-04
+ .12831681E-07 -.36800609E-11 .12766782E+05 .92087947E+01
+C2 J12/69C 2.0 0.0 0.0 0.G 300.000 5000.000
+ .40435359E+01 .20573654E-03 .10907575E-06 -.36427874E-10 .34127865E-14
+ .99709486E+05 .12775158E+01 .74518140E+01 -.10144686E-01 .85879735E-05
+ .87321100E-09 -.24429792E-11 .98911989E+05 -.15846678E+02
+C2- J12/69C 2.E 1.0 0.0 0.G 300.000 5000.000
+ .36926257E+01 .41576040E-03 .11654211E-07 .23755880E-11 -.14585314E-14
+ .52118953E+05 .22470173E+01 .37342914E+01 -.23034649E-02 .68417833E-05
+ -.58120827E-08 .16604296E-11 .52281427E+05 .27860423E+01
+C2CL2 J12/68C 2.CL 2.0 0.0 0.G 300.000 5000.000
+ .81728547E+01 .23659892E-02 -.96552505E-06 .17736148E-09 -.12135203E-13
+ .22510190E+05 -.14916744E+02 .50229482E+01 .14082667E-01 -.18095669E-04
+ .11610348E-07 -.28817478E-11 .23227482E+05 .59684170E+00
+C2F2 J12/67C 2.F 2.0 0.0 0.G 300.000 5000.000
+ .75164581E+01 .31686462E-02 -.13311385E-05 .24960049E-09 -.17342072E-13
+ -.16107655E+03 -.15081225E+02 .35345837E+01 .14445845E-01 -.12189692E-04
+ .36042985E-08 .19118951E-12 .92133562E+03 .54063023E+01
+C2F4 J 6/69C 2.F 4.0 0.0 0.G 300.000 5000.000
+ .11086468E+02 .52788429E-02 -.22354400E-05 .42166846E-09 -.29433914E-13
+ -.83292884E+05 -.29880044E+02 .36166183E+01 .26488618E-01 -.22433266E-04
+ .62286445E-08 .62149244E-12 -.81277242E+05 .85106010E+01
+C2H J 3/67C 2.H 1.00 0.00 0.G 300.000 5000.000
+ .44207650E+01 .22119303E-02 -.59294945E-06 .94195775E-10 -.68527594E-14
+ .55835444E+05 -.11588093E+01 .26499400E+01 .84919515E-02 -.98165375E-05
+ .65373629E-08 -.17356273E-11 .56275751E+05 .76898609E+01
+C2HF J12/67C 2.H 1.F 1.0 0.G 300.000 5000.000
+ .60949501E+01 .39432428E-02 -.14711438E-05 .25294641E-09 -.16446663E-13
+ .12976907E+05 -.83285075E+01 .26901770E+01 .17680853E-01 -.22749855E-04
+ .14920568E-07 -.37381925E-11 .13683223E+05 .81338073E+01
+C2H2 J 3/61C 2.H 2.00 0.00 0.G 300.000 5000.000
+ .45751083E+01 .51238358E-02 -.17452354E-05 .28673065E-09 -.17951426E-13
+ .25607428E+05 -.35737940E+01 .14102768E+01 .19057275E-01 -.24501390E-04
+ .16390872E-07 -.41345447E-11 .26188208E+05 .11393827E+02
+C2H4 J 9/65C 2.H 4.00 0.00 0.G 300.000 5000.000
+ .34552152E+01 .11491803E-01 -.43651750E-05 .76155095E-09 -.50123200E-13
+ .44773119E+04 .26987959E+01 .14256821E+01 .11383140E-01 .79890006E-05
+ -.16253679E-07 .67491256E-11 .53370755E+04 .14621819E+02
+C2H6 L 5/72C 2.H 6. 0. 0.G 300.000 1500.000
+ .21555281E+01 .14779861E-01 .23352804E-05 -.64146428E-08 .19036925E-11
+ -.11524517E+05 .10776316E+02 .21415788E+01 .10529720E-01 .18730274E-04
+ -.26691187E-07 .10049332E-10 -.11410486E+05 .11647757E+02
+C2N J 3/67C 2.N 1.00 0.00 0.G 300.000 5000.000
+ .61931308E+01 .14327539E-02 -.61255161E-06 .11578707E-09 -.80401339E-14
+ .64818372E+05 -.84132298E+01 .32670394E+01 .98211307E-02 -.83284733E-05
+ .17650559E-08 .59632768E-12 .65589057E+05 .65682304E+01
+C2N2 J 3/61C 2.N 2.00 0.00 0.G 300.000 5000.000
+ .65968935E+01 .38694131E-02 -.15516161E-05 .28141546E-09 -.19069442E-13
+ .34883726E+05 -.10001801E+02 .39141782E+01 .14011008E-01 -.17404350E-04
+ .12012779E-07 -.33565772E-11 .35514550E+05 .32384353E+01
+C2O J 9/66C 2.O 1.00 0.00 0.G 300.000 5000.000
+ .48990313E+01 .28430384E-02 -.10209669E-05 .16112165E-09 -.95542914E-14
+ .32800545E+05 -.91382280E+00 .35364815E+01 .69543872E-02 -.53071374E-05
+ .17030470E-08 -.14108072E-13 .33151572E+05 .60172370E+01
+C3 J12/69C 3.0 0.0 0.0 0.G 300.000 5000.000
+ .36815361E+01 .24165236E-02 -.84348112E-06 .14508198E-09 -.95697300E-14
+ .97413955E+05 .68377802E+01 .57408464E+01 -.84281238E-02 .18620198E-04
+ -.14510529E-07 .39676977E-11 .97157524E+05 -.23837376E+01
+C3O2 J 6/68C 3.O 2.0 0.0 0.G 300.000 5000.000
+ .81435964E+01 .54395018E-02 -.22192869E-05 .40778627E-09 -.27915974E-13
+ -.14230013E+05 -.15456769E+02 .37161005E+01 .19872164E-01 -.20935751E-04
+ .11750112E-07 -.26589416E-11 -.13089402E+05 .69298412E+01
+C4 J12/69C 4.0 0.0 0.0 0.G 300.000 5000.000
+ .65602101E+01 .40985234E-02 -.17000471E-05 .31615228E-09 -.21842144E-13
+ .11430434E+06 -.11820311E+02 .18432021E+01 .19343592E-01 -.20627502E-04
+ .10822626E-07 -.21289203E-11 .11550276E+06 .12006898E+02
+C5 J12/69C 5.0 0.0 0.0 0.G 300.000 5000.000
+ .82067016E+01 .54889888E-02 -.22694876E-05 .42073365E-09 -.28981924E-13
+ .11463647E+06 -.20246108E+02 .11012446E+01 .29513421E-01 -.33754342E-04
+ .19056534E-07 -.40989018E-11 .11637970E+06 .15360193E+02
+H J 3/77H 1. 0. 0. 0.G 300.000 5000.000
+ .25000000E+01 .00000000 .00000000 .00000000 .00000000
+ .25474390E+05 -.45989841E+00 .25000000E+01 .00000000 .00000000
+ .00000000 .00000000 .25474390E+05 -.45989841E+00
+H+ J 3/77H 1.E -1. 0. 0.G 300.000 5000.000
+ .25000000E+01 .00000000 .00000000 .00000000 .00000000
+ .18402589E+06 -.11538622E+01 .25000000E+01 .00000000 .00000000
+ .00000000 .00000000 .18402589E+06 -.11538622E+01
+H- J 3/77H 1.E 1. 0. 0.G 300.000 5000.000
+ .25000000E+01 .00000000 .00000000 .00000000 .00000000
+ .15976437E+05 -.11522295E+01 .25000000E+01 .00000000 .00000000
+ .00000000 .00000000 .15976437E+05 -.11522295E+01
+HALO J 3/64H 1.AL 1.O 1.00 0.G 300.000 5000.000
+ .48556053E+01 .28598933E-02 -.12152821E-05 .22966419E-09 -.16047592E-13
+ .21454053E+04 -.32954978E+01 .18980220E+01 .77763784E-02 .15224672E-05
+ -.86530734E-08 .41700380E-11 .31156301E+04 .12763795E+02
+HBO J12/75H 1.B 1.O 1. 0.G 300.000 5000.000
+ .37485181E+01 .36610859E-02 -.14635409E-05 .26519903E-09 -.17834275E-13
+ -.25225798E+05 .17332585E+01 .22143106E+01 .93718513E-02 -.10711074E-04
+ .76769774E-08 -.23586371E-11 -.24849246E+05 .93587977E+01
+HBO+ J12/75H 1.B 1.O 1.E -1.G 300.000 5000.000
+ .39475080E+01 .34315436E-02 -.12787084E-05 .22180604E-09 -.14757192E-13
+ .14135998E+06 .19857064E+01 .22544283E+01 .80301872E-02 -.59749072E-05
+ .24281950E-08 -.43051124E-12 .14185069E+06 .10799018E+02
+HBO- J12/75H 1.B 1.O 1.E 1.G 300.000 5000.000
+ .40869265E+01 .29784756E-02 -.12387107E-05 .24693335E-09 -.18455048E-13
+ -.30930026E+05 .27668939E+01 .39707955E+01 -.22100107E-02 .14535413E-04
+ -.15638925E-07 .53978966E-11 -.30589499E+05 .48117211E+01
+HBO2 J12/64H 1.B 1.O 2.00 0.G 300.000 5000.000
+ .47389519E+01 .47718771E-02 -.18063494E-05 .31492889E-09 -.20738312E-13
+ -.69248838E+05 -.33346713E-02 .28707866E+01 .78862644E-02 -.40736842E-06
+ -.47059022E-08 .23548893E-11 -.68624111E+05 .10167320E+02
+HBS J12/75H 1.B 1.S 1. 0.G 300.000 5000.000
+ .44412265E+01 .29979825E-02 -.11938230E-05 .21195832E-09 -.13466097E-13
+ .44402975E+04 -.66018681E+00 .15595903E+01 .13966838E-01 -.17988595E-04
+ .12315141E-07 -.34090957E-11 .50890936E+04 .13488495E+02
+HBS+ J12/75H 1.B 1.S 1.E -1.G 300.000 5000.000
+ .47097542E+01 .28187036E-02 -.11633088E-05 .21768839E-09 -.15108686E-13
+ .13419139E+06 -.85085708E+00 .22511561E+01 .12077168E-01 -.15322156E-04
+ .10494090E-07 -.29325292E-11 .13475476E+06 .11257385E+02
+HBR J 9/65H 1.BR 1. 0. 0.G 300.000 5000.000
+ .27935804E+01 .15655925E-02 -.56171064E-06 .95783142E-10 -.61813990E-14
+ -.52338384E+04 .76423703E+01 .36056690E+01 -.59529431E-03 .65029568E-06
+ .93781219E-09 -.71141852E-12 -.54389455E+04 .34831774E+01
+HCL J 9/64H 1.CL 1.00 0.00 0.G 300.000 5000.000
+ .27665884E+01 .14381883E-02 -.46993000E-06 .73499408E-10 -.43731106E-14
+ -.11917468E+05 .64583540E+01 .35248171E+01 .29984862E-04 -.86221891E-06
+ .20979721E-08 -.98658191E-12 -.12150509E+05 .23957713E+01
+HCN L12/69H 1.C 1.N 1.0 0.G 300.000 5000.000
+ .37068121E+01 .33382803E-02 -.11913320E-05 .19992917E-09 -.12826452E-13
+ .14962636E+05 .20794904E+01 .24513556E+01 .87208371E-02 -.10094203E-04
+ .67255698E-08 -.17626959E-11 .15213002E+05 .80830085E+01
+HCO J12/70H 1.C 1.O 1.0 0.G 300.000 5000.000
+ .34738348E+01 .34370227E-02 -.13632664E-05 .24928645E-09 -.17044331E-13
+ .39594005E+04 .60453340E+01 .38840192E+01 -.82974448E-03 .77900809E-05
+ -.70616962E-08 .19971730E-11 .40563860E+04 .48354133E+01
+HCO+ J12/70H 1.C 1.O 1.E -1.G 300.000 5000.000
+ .37411880E+01 .33441517E-02 -.12397121E-05 .21189388E-09 -.13704150E-13
+ .98884078E+05 .20654768E+01 .24739736E+01 .86715590E-02 -.10031500E-04
+ .67170527E-08 -.17872674E-11 .99146608E+05 .81625751E+01
+HCP J12/69H 1.C 1.P 1.0 0.G 300.000 5000.000
+ .44720009E+01 .26742145E-02 -.97089571E-06 .15708386E-09 -.88457131E-14
+ .18558085E+05 -.68781355E+00 .21111132E+01 .10707664E-01 -.10801743E-04
+ .49036970E-08 -.59717249E-12 .19110209E+05 .11067474E+02
+HF J12/68H 1.F 1.0 0.0 0.G 300.000 5000.000
+ .30019188E+01 .69528935E-03 -.56135180E-07 -.14767711E-10 .22140435E-14
+ -.33624997E+05 .37575868E+01 .34659720E+01 .33246861E-03 -.10063786E-05
+ .12078301E-08 -.37137269E-12 -.33821824E+05 .10758272E+01
+HI J 9/61H 1.I 1. 0. 0.G 300.000 5000.000
+ .29104008E+01 .15688188E-02 -.59227632E-06 .10537094E-09 -.70375116E-14
+ .22508659E+04 .78513074E+01 .36963722E+01 -.14224755E-02 .30131188E-05
+ -.12666403E-08 -.35098765E-13 .21073581E+04 .40749580E+01
+HNCO J12/70H 1.N 1.C 1.O 1.G 300.000 5000.000
+ .51300390E+01 .43551371E-02 -.16269022E-05 .28035605E-09 -.18276037E-13
+ -.14101787E+05 -.22010995E+01 .23722164E+01 .13664040E-01 -.13323158E-04
+ .64475457E-08 -.10402894E-11 -.13437059E+05 .11588263E+02
+HNO J 3/63H 1.N 1.O 1.0 0.G 300.000 5000.000
+ .35548619E+01 .32713182E-02 -.12734071E-05 .22602046E-09 -.15064827E-13
+ .10693734E+05 .51684901E+01 .37412008E+01 -.20067061E-03 .75409300E-05
+ -.79105713E-08 .25928389E-11 .10817845E+05 .50063473E+01
+HNO2 J 6/63H 1.N 1.O 2. 0.G 300.000 5000.000
+ .55144941E+01 .41394403E-02 -.15878702E-05 .27977639E-09 -.18584209E-13
+ -.11276885E+05 -.31425253E+01 .25098874E+01 .12171605E-01 -.78618375E-05
+ .35351571E-09 .11540858E-11 -.10450008E+05 .12399634E+02
+HNO3 J 6/63H 1.N 1.O 3. 0.G 300.000 5000.000
+ .70591100E+01 .56769446E-02 -.22348863E-05 .40155529E-09 -.27080510E-13
+ -.18920009E+05 -.10778285E+02 .14377135E+01 .20903552E-01 -.14574553E-04
+ .11972023E-08 .19117285E-11 -.17385368E+05 .18246253E+02
+HOF J12/72H 1.O 1.F 1. 0.G 300.000 5000.000
+ .40464336E+01 .24486283E-02 -.86283553E-06 .14209904E-09 -.89356915E-14
+ -.13209067E+05 .33367680E+01 .32310929E+01 .37389857E-02 .63009762E-06
+ -.36215002E-08 .17867133E-11 -.12954779E+05 .77377387E+01
+HO2 J 3/64H 1.O 2.00 0.00 0.G 300.000 5000.000
+ .37866280E+01 .27885404E-02 -.10168708E-05 .17183946E-09 -.11021852E-13
+ .11888500E+04 .48147611E+01 .35094850E+01 .11499670E-02 .58784259E-05
+ -.77795519E-08 .29607883E-11 .13803331E+04 .68276325E+01
+HSO3F J 6/72H 1.S 1.O 3.F 1.G 300.000 5000.000
+ .10364190E+02 .53861164E-02 -.21231572E-05 .38208343E-09 -.25807090E-13
+ -.94398334E+05 -.26018757E+02 .21192445E+01 .31545710E-01 -.31317888E-04
+ .12461507E-07 -.82514630E-12 -.92361596E+05 .15546442E+02
+H2 J 3/77H 2. 0. 0. 0.G 300.000 5000.000
+ .30558123E+01 .59740400E-03 -.16747471E-08 -.21247544E-10 .25195487E-14
+ -.86168476E+03 -.17207073E+01 .29432327E+01 .34815509E-02 -.77713819E-05
+ .74997496E-08 -.25203379E-11 -.97695413E+03 -.18186137E+01
+H2O(S) L11/65H 2.O 1.00 0.00 0.S 200.000 273.150
+ .00000000 .00000000 .00000000 .00000000 .00000000
+ .00000000 .00000000 -.39269330E-01 .16920420E-01 .00000000
+ .00000000 .00000000 -.35949581E+05 .56933784E+00
+H2O(L) L11/65H 2.O 1.00 0.00 0.L 273.150 1000.000
+ .00000000 .00000000 .00000000 .00000000 .00000000
+ .00000000 .00000000 .12712782E+02 -.17662790E-01 -.22556661E-04
+ .20820908E-06 -.24078614E-09 -.37483200E+05 -.59115345E+02
+H2O J 3/61H 2.O 1.00 0.00 0.G 300.000 5000.000
+ .27167633E+01 .29451374E-02 -.80224374E-06 .10226682E-09 -.48472145E-14
+ -.29905826E+05 .66305671E+01 .40701275E+01 -.11084499E-02 .41521180E-05
+ -.29637404E-08 .80702103E-12 -.30279722E+05 -.32270046E+00
+H2O2 L 2/69H 2.O 2.0 0.0 0.G 300.000 5000.000
+ .45731667E+01 .43361363E-02 -.14746888E-05 .23489037E-09 -.14316536E-13
+ -.18006961E+05 .50113696E+00 .33887536E+01 .65692260E-02 -.14850126E-06
+ -.46258055E-08 .24715147E-11 -.17663147E+05 .67853631E+01
+H2S J12/65H 2.S 1.00 0.00 0.G 300.000 5000.000
+ .28479103E+01 .38415990E-02 -.14099367E-05 .24278754E-09 -.15783283E-13
+ -.34469788E+04 .74781412E+01 .38811293E+01 -.13211856E-03 .36517726E-05
+ -.21820445E-08 .28783779E-12 -.36350917E+04 .25161511E+01
+H2SO4(L) J12/66H 2.S 1.O 4. 0.L 300.000 2000.000
+ .19537798E+02 .22764318E-02 -.46662669E-08 -.83314872E-09 .24879731E-12
+ -.10441888E+06 -.94525698E+02 .64979802E+01 .52939960E-01 -.76283829E-04
+ .51075960E-07 -.13004852E-10 -.10161098E+06 -.30963395E+02
+H2SO4 J12/66H 2.S 1.O 4. 0.G 300.000 5000.000
+ .10893733E+02 .73577938E-02 -.27934016E-05 .48889853E-09 -.32326917E-13
+ -.93185848E+05 -.30424431E+02 .10093716E+01 .39770886E-01 -.40434356E-04
+ .17110582E-07 -.15417850E-11 -.90814577E+05 .19098505E+02
+H3B3O6 J12/64H 3.B 3.O 6.00 0.G 300.000 5000.000
+ .20153579E+02 .13016286E-01 -.50669619E-05 .90308253E-09 -.60532410E-13
+ -.28104092E+06 -.79689531E+02 -.22705116E+01 .87024894E-01 -.91587714E-04
+ .39445392E-07 -.36666035E-11 -.27569523E+06 .32516454E+02
+N J 3/77N 1. 0. 0. 0.G 300.000 5000.000
+ .24370811E+01 .13233886E-03 -.90907754E-07 .22864054E-10 -.13762291E-14
+ .56128585E+05 .45211111E+01 .25000004E+01 -.31078154E-08 .83216097E-11
+ -.94278278E-14 .38108039E-17 .56106975E+05 .41806431E+01
+N+ J 3/77N 1.E -1. 0. 0.G 300.000 5000.000
+ .24967940E+01 .31252246E-04 -.33618729E-07 .11713948E-10 -.10312857E-14
+ .22563627E+06 .49930418E+01 .27903242E+01 -.13627563E-02 .25659418E-05
+ -.21911714E-08 .70277201E-12 .22558318E+06 .36179803E+01
+N- J 3/77N 1.E 1. 0. 0.G 300.000 5000.000
+ .25093227E+01 -.10571985E-04 .46391470E-08 -.89788329E-12 .63932728E-16
+ .56208578E+05 .49344823E+01 .26200113E+01 -.54322768E-03 .99735826E-06
+ -.83545659E-09 .26387064E-12 .56189188E+05 .44184034E+01
+NCO J12/70N 1.C 1.O 1.0 0.G 300.000 5000.000
+ .49964357E+01 .26250880E-02 -.10928387E-05 .20309111E-09 -.13915195E-13
+ .17379356E+05 -.17325320E+01 .31092021E+01 .66201022E-02 -.26070086E-05
+ -.14966380E-08 .10922032E-11 .17977514E+05 .83561334E+01
+NF J 6/65N 1.F 1.00 0.00 0.G 300.000 5000.000
+ .38624046E+01 .74409961E-03 -.29304178E-06 .55130022E-10 -.38317928E-14
+ .28669390E+05 .34570237E+01 .30480680E+01 .19566867E-02 .94322448E-06
+ -.29336643E-08 .13504454E-11 .28941688E+05 .79092363E+01
+NF2 J 3/64N 1.F 2.00 0.00 0.G 300.000 5000.000
+ .57186890E+01 .14102822E-02 -.60493969E-06 .11491911E-09 -.80536431E-14
+ .30992968E+04 -.34469259E+01 .25009872E+01 .10721062E-01 -.92064150E-05
+ .19027666E-08 .71249647E-12 .39376954E+04 .12994042E+02
+NF3 J 6/69N 1.F 3.0 0.0 0.G 300.000 5000.000
+ .79819180E+01 .22349897E-02 -.96301027E-06 .18357806E-09 -.12901442E-13
+ -.18673358E+05 -.15667394E+02 .12676904E+01 .24289231E-01 -.26835971E-04
+ .11994191E-07 -.12905657E-11 -.17059051E+05 .17977633E+02
+NH J12/71N 1.H 1. 0. 0.G 300.000 5000.000
+ .27789900E+01 .13266349E-02 -.41101218E-06 .69414505E-10 -.44536190E-14
+ .44567973E+05 .57593434E+01 .34938318E+01 .24529034E-03 -.12578521E-05
+ .22011922E-08 -.92288834E-12 .44326826E+05 .18451723E+01
+NH2 J12/65N 1.H 2.00 0.00 0.G 300.000 5000.000
+ .25769524E+01 .35896090E-02 -.12276328E-05 .19549576E-09 -.11873401E-13
+ .19335912E+05 .79074890E+01 .40385791E+01 -.10098163E-02 .40120903E-05
+ -.23085312E-08 .39022887E-12 .18973010E+05 .52464285E+00
+NH3 J 9/65N 1.H 3.00 0.00 0.G 300.000 5000.000
+ .24165177E+01 .61871211E-02 -.21785136E-05 .37599090E-09 -.24448856E-13
+ -.64747177E+04 .77043482E+01 .35912768E+01 .49388668E-03 .83449322E-05
+ -.83833385E-08 .27299092E-11 -.66717143E+04 .22520966E+01
+NO J 6/63N 1.O 1.00 0.00 0.G 300.000 5000.000
+ .31890000E+01 .13382281E-02 -.52899318E-06 .95919332E-10 -.64847932E-14
+ .98283290E+04 .67458126E+01 .40459521E+01 -.34181783E-02 .79819190E-05
+ -.61139316E-08 .15919076E-11 .97453934E+04 .29974988E+01
+NO+ J 6/66N 1.O 1.E -1.00 0.G 300.000 5000.000
+ .28885488E+01 .15217119E-02 -.57531241E-06 .10051081E-09 -.66044294E-14
+ .11819245E+06 .70027197E+01 .36685056E+01 -.11544580E-02 .21755608E-05
+ -.48227472E-09 -.27847906E-12 .11803369E+06 .31779324E+01
+NOCL J12/72N 1.O 1.CL 1. 0.G 300.000 5000.000
+ .54178186E+01 .17391415E-02 -.67354352E-06 .12747721E-09 -.88128378E-14
+ .44207903E+04 -.15287316E+00 .40453848E+01 .58322333E-02 -.54789276E-05
+ .27968775E-08 -.59348675E-12 .47980577E+04 .68935321E+01
+NOF J 6/61N 1.O 1.F 1.00 0.G 300.000 5000.000
+ .51906666E+01 .18924266E-02 -.78642361E-06 .14626364E-09 -.10097419E-13
+ -.96758164E+04 -.62298477E+00 .32902070E+01 .74045493E-02 -.66195803E-05
+ .26529282E-08 -.29526815E-12 -.91566645E+04 .91451185E+01
+NOF3 J 6/70N 1.O 1.F 3.0 0.G 300.000 5000.000
+ .98929009E+01 .33819898E-02 -.14438138E-05 .27381685E-09 -.19186406E-13
+ -.23185488E+05 -.24944299E+02 .14275875E+01 .32431849E-01 -.38573384E-04
+ .20510613E-07 -.37109560E-11 -.21189425E+05 .17224286E+02
+NO2 J 9/64N 1.O 2.00 0.00 0.G 300.000 5000.000
+ .46240771E+01 .25260332E-02 -.10609498E-05 .19879239E-09 -.13799384E-13
+ .22899900E+04 .13324138E+01 .34589236E+01 .20647064E-02 .66866067E-05
+ -.95556725E-08 .36195881E-11 .28152265E+04 .83116983E+01
+NO2- J 6/72N 1.O 2.E 1. 0.G 300.000 5000.000
+ .50160903E+01 .21884463E-02 -.94586144E-06 .17939789E-09 -.12052428E-13
+ -.26200160E+05 -.12861447E+01 .29818036E+01 .49398681E-02 .28557293E-05
+ -.78905297E-08 .35391483E-11 -.25501540E+05 .99161680E+01
+NO2CL J12/65N 1.O 2.CL 1.00 0.G 300.000 5000.000
+ .72062138E+01 .29949809E-02 -.12641260E-05 .23758750E-09 -.16524848E-13
+ -.11366123E+04 -.99256667E+01 .30302225E+01 .14538930E-01 -.11645930E-04
+ .25890139E-08 .64589481E-12 .76652034E+01 .11618599E+02
+NO2F J12/65N 1.O 2.F 1.00 0.G 300.000 5000.000
+ .68639166E+01 .33554437E-02 -.14158297E-05 .26622227E-09 -.18531606E-13
+ -.15621287E+05 -.95806218E+01 .22424380E+01 .16289716E-01 -.13344332E-04
+ .32719525E-08 .59144703E-12 -.14364205E+05 .14218996E+02
+NO3 J12/64N 1.O 3. 0. 0.G 300.000 5000.000
+ .72033289E+01 .30908791E-02 -.13329045E-05 .25461601E-09 -.17939047E-13
+ .58244016E+04 -.12608119E+02 .76867377E+00 .21181075E-01 -.16980256E-04
+ .22963836E-08 .19321041E-11 .75292921E+04 .20406284E+02
+N2 J 3/77N 2. 0. 0. 0.G 300.000 5000.000
+ .28532899E+01 .16022128E-02 -.62936893E-06 .11441022E-09 -.78057465E-14
+ -.89008093E+03 .63964897E+01 .37044177E+01 -.14218753E-02 .28670392E-05
+ -.12028885E-08 -.13954677E-13 -.10640795E+04 .22336285E+01
+N2H4 J12/65N 2.H 4.00 0.00 0.G 300.000 5000.000
+ .50947770E+01 .93296138E-02 -.33626986E-05 .56308304E-09 -.35859661E-13
+ .92996644E+04 -.35950952E+01 .79803836E+00 .21788097E-01 -.13456754E-04
+ -.12698753E-09 .25865213E-11 .10379887E+05 .18248696E+02
+N2O J12/64N 2.O 1.00 0.00 0.G 300.000 5000.000
+ .47306679E+01 .28258267E-02 -.11558115E-05 .21263683E-09 -.14564087E-13
+ .81617682E+04 -.17151073E+01 .26189196E+01 .86439616E-02 -.68110624E-05
+ .22275877E-08 -.80650330E-13 .87590123E+04 .92266952E+01
+N2O+ J12/70N 2.O 1.E -1.0 0.G 300.000 5000.000
+ .53926946E+01 .22337196E-02 -.93548832E-06 .17466166E-09 -.12059043E-13
+ .15847633E+06 -.36920186E+01 .34273064E+01 .63787690E-02 -.22585149E-05
+ -.20421800E-08 .13481477E-11 .15909237E+06 .67997616E+01
+N2O4 J 9/64N 2.O 4.00 0.00 0.G 300.000 5000.000
+ .10506637E+02 .58723267E-02 -.24766296E-05 .46556024E-09 -.32402082E-13
+ -.28609096E+04 -.26252230E+02 .36662865E+01 .23491748E-01 -.16007297E-04
+ .11845939E-08 .20001618E-11 -.90631797E+03 .93973337E+01
+N2O5 J12/64N 2.O 5. 0. 0.G 300.000 5000.000
+ .14413736E+02 .40494080E-02 -.17661640E-05 .33912224E-09 -.23926356E-13
+ -.38366062E+04 -.43313433E+02 .32144535E+01 .37992511E-01 -.36847600E-04
+ .12409293E-07 .24351911E-12 -.98609506E+03 .13555831E+02
+N3 J12/70N 3.0 0.0 0.0 0.G 300.000 5000.000
+ .51996828E+01 .24335678E-02 -.10192340E-05 .19062350E-09 -.13212412E-13
+ .47963131E+05 -.35547759E+01 .30624389E+01 .73590658E-02 -.38229374E-05
+ -.71824202E-09 .91110236E-12 .48614547E+05 .77570129E+01
+O J 3/77O 1. 0. 0. 0.G 300.000 5000.000
+ .25342961E+01 -.12478170E-04 -.12562724E-07 .69029862E-11 -.63797095E-15
+ .29231108E+05 .49628591E+01 .30309401E+01 -.22525853E-02 .39824540E-05
+ -.32604921E-08 .10152035E-11 .29136526E+05 .26099342E+01
+O+ J 3/77O 1.E -1. 0. 0.G 300.000 5000.000
+ .25016589E+01 -.59563416E-05 .71194526E-08 -.33646595E-11 .54268097E-15
+ .18793969E+06 .43720399E+01 .25000004E+01 -.31078073E-08 .83215893E-11
+ -.94278063E-14 .38107959E-17 .18794001E+06 .43801149E+01
+O- J 3/77O 1.E 1. 0. 0.G 300.000 5000.000
+ .25494971E+01 -.56262531E-04 .24902683E-07 -.48702865E-11 .35042005E-15
+ .11493119E+05 .44820553E+01 .29002546E+01 -.16354106E-02 .28202166E-05
+ -.22688058E-08 .69736252E-12 .11426745E+05 .28209917E+01
+OH J12/70O 1.H 1.0 0.0 0.G 300.000 5000.000
+ .29131230E+01 .95418248E-03 -.19084325E-06 .12730795E-10 .24803941E-15
+ .39647060E+04 .54288735E+01 .38365518E+01 -.10702014E-02 .94849757E-06
+ .20843575E-09 -.23384265E-12 .36715807E+04 .49805456E+00
+OH+ J12/70O 1.H 1.E -1.0 0.G 300.000 5000.000
+ .27381495E+01 .14613173E-02 -.46950536E-06 .73663560E-10 -.41410922E-14
+ .15761683E+06 .61343811E+01 .35365969E+01 -.47029254E-04 -.62344259E-06
+ .17601461E-08 -.82678699E-12 .15736677E+06 .18477172E+01
+OH- J12/70O 1.H 1.E 1.0 0.G 300.000 5000.000
+ .28881148E+01 .96560229E-03 -.19659254E-06 .14053802E-10 .12080617E-15
+ -.18086455E+05 .41896259E+01 .34621427E+01 .40525802E-03 -.13516992E-05
+ .17899459E-08 -.63434810E-12 -.18312355E+05 .92893220E+00
+O2 J 3/77O 2. 0. 0. 0.G 300.000 5000.000
+ .36122139E+01 .74853166E-03 -.19820647E-06 .33749008E-10 -.23907374E-14
+ -.11978151E+04 .36703307E+01 .37837135E+01 -.30233634E-02 .99492751E-05
+ -.98189101E-08 .33031825E-11 -.10638107E+04 .36416345E+01
+O2- J12/66O 2.E 1.00 0.00 0.G 300.000 5000.000
+ .38147234E+01 .77444546E-03 -.30677649E-06 .56618118E-10 -.38229492E-14
+ -.69910087E+04 .29587995E+01 .31440525E+01 .12127972E-02 .23812161E-05
+ -.40914092E-08 .16885304E-11 -.67369752E+04 .67688687E+01
+O3 J 6/61O 3.0 0.0 0.0 0.G 300.000 5000.000
+ .54665239E+01 .17326031E-02 -.72204889E-06 .13721660E-09 -.96233828E-14
+ .15214096E+05 -.34712616E+01 .24660617E+01 .91703209E-02 -.49698480E-05
+ -.20634230E-08 .20015595E-11 .16059556E+05 .12172130E+02
+C3H8 C 3.H 8. 0. 0.G 300.000 1500.000
+ .42948342E+01 .19538024E-01 .32109452E-05 -.84809778E-08 .24872618E-11
+ -.14850966E+05 .16012209E+01 .74188008E+00 .26778804E-01 .78425850E-05
+ -.25901330E-07 .11588147E-10 -.13927371E+05 .20119121E+02
+C6H6 L 4/69C 6.H 6. 0. 0.G 300.000 1000.000
+ .00000000 .00000000 .00000000 .00000000 .00000000
+ .00000000 .00000000 -.36592434E+01 .50995987E-01 -.14417162E-04
+ -.20338971E-07 .12665048E-10 .89598009E+04 .38817831E+02
+C6H6(L) L 4/69C 6.H 6. 0. 0.L 300.000 1000.000
+ -.15107840E+01 .53738751E-01 .20903744E-04 .00000000 .00000000
+ .37755265E+04 .12488106E+02 -.15107840E+01 .53738751E-01 .20903744E-04
+ .00000000 .00000000 .37755265E+04 .12488106E+02
+C7H8 C 7.H 8. 0. 0.G 300.000 1500.000
+ -.98056097E+01 .41766033E-01 .41713254E-04 -.61631624E-07 .19253585E-10
+ .92693711E+04 .85754852E+02 -.20565853E+01 .51095083E-01 .23094590E-05
+ -.39232358E-07 .19180060E-10 .44053164E+04 .35151306E+02
+C8H16 L 9/74C 8.H 16. 0. 0.G 300.000 1500.000
+ -.19137314E+02 .69371462E-01 .67576038E-04 -.10115679E-06 .31757513E-10
+ -.29994805E+04 .15213559E+03 .27015257E+01 .63744605E-01 .10288634E-04
+ -.51851664E-07 .23527721E-10 -.13609438E+05 .21171082E+02
+C8H18 L 4/69C 8.H 18. 0. 0.G 300.000 1000.000
+ .00000000 .00000000 .00000000 .00000000 .00000000
+ .00000000 .00000000 .21142864E+01 .80824231E-01 -.31247369E-04
+ .00000000 .00000000 -.29011939E+05 .21016129E+02
+C8H18(L) L 4/69C 8.H 18. 0. 0.L 300.000 1000.000
+ -.84282634E+02 .79481841E+00 -.13738980E-02 .00000000 .00000000
+ -.28129138E+05 .34774181E+03 -.84282634E+02 .79481841E+00 -.13738980E-02
+ .00000000 .00000000 -.28129138E+05 .34774181E+03
+C12H26 L 4/69C 12.H 26. 0. 0.G 300.000 1000.000
+ .00000000 .00000000 .00000000 .00000000 .00000000
+ .00000000 .00000000 .35890940E+01 .11929898E+00 -.46546312E-04
+ .00000000 .00000000 -.40949233E+05 .20296207E+02
+C2H5OH L12/73C 2.H 6.O 1. 0.G 300.000 1000.000
+ .00000000 .00000000 .00000000 .00000000 .00000000
+ .00000000 .00000000 .20453260E+01 .18097289E-01 .11356807E-04
+ -.25318665E-07 .10843493E-10 -.29665177E+05 .16637635E+02
+C3H8() L12/73C 3.H 8.O 1. 0.G 300.000 1000.000
+ .00000000 .00000000 .00000000 .00000000 .00000000
+ .00000000 .00000000 .28935102E+01 .22546234E-01 .18912669E-04
+ -.35990505E-07 .14751417E-10 -.32800045E+05 .15191566E+02
+C4H 121686C 4.H 1. 0. 0.G 300.000 5000.00
+ 6.24288178E+0 6.19368255E-3 -2.08593156E-6 3.08220338E-10 -1.63648256E-14
+ 7.56801875E+4 -7.21080589E+0 5.02324677E+0 7.09237531E-3 -6.07376194E-9
+-2.27575225E-9 8.08699407E-13 7.62381250E+4 -6.94259405E-2
+C4H2 121686C 4.H 2. 0. 0.G 300.000 5000.00
+ 9.03140736E+0 6.04725257E-3 -1.94878885E-6 2.75486300E-10 -1.38560801E-14
+ 5.29473555E+4 -2.38506775E+1 4.00519180E+0 1.98100023E-2 -9.86587747E-6
+-6.63515820E-9 6.07741288E-12 5.42406484E+4 1.84573650E+0
+C4H3 121686C 4.H 3. 0. 0.G 300.000 5000.00
+ 8.48742008E+0 8.69089365E-3 -2.85444367E-6 4.12007983E-10 -2.13010931E-14
+ 4.79705547E+4 -1.90185089E+1 3.55397129E+0 1.94619857E-2 -4.81024836E-6
+-9.73012249E-9 6.23905355E-12 4.94538633E+4 7.08298683E+0
+C4H4 121686C 4.H 4. 0. 0.G 300.00 5000.00
+ 8.89214897E+0 1.09088495E-2 -3.59495971E-6 5.19341903E-10 -2.68089214E-14
+ 3.32843477E+4 -2.17269440E+1 2.14033699E+0 2.46050470E-2 -3.63916570E-6
+-1.53040141E-8 8.89646083E-12 3.53740000E+4 1.42824774E+1
+C4H6 120186C 4.H 6. 0. 0.G 300.00 5000.00
+ 8.04658318E+0 1.64852515E-2 -5.52222718E-6 8.12359291E-10 -4.29507843E-14
+ 1.37013047E+4 -1.80045776E+1 3.19710827E+0 2.02559158E-2 6.51019218E-6
+-1.65844227E-8 6.40028221E-12 1.57152031E+4 9.89566040E+0
+C4H8 120386C 4.H 8. 0. 0.G 300.00 5000.00
+ 2.05358410E+0 3.43505070E-2 -1.58831972E-5 3.30896621E-9 -2.53610447E-13
+-2.13972315E+3 1.55432015E+1 1.18113804E+0 3.08533795E-2 5.08652465E-6
+-2.46548879E-8 1.11101926E-11 -1.79040039E+3 2.10624695E+1
+C4H7 AG87 C 4.H 7. 0. 0.G 300.000 5000.000
+ 0.46138570E+1 0.25610800E-1 -.10544010E-4 0.19418000E-8 -.13167620E-12
+ -.26730190E+4 0.15504400E+1 0.68388910E+1 0.21225990E-3 0.53886070E-4
+ -.57184410E-7 0.17736180E-10 -.24199150E+4 -.53194760E+1
+H8C4 KEINVC 4.H 8. 0. 0.G 300.00 5000.00
+ 2.05358410E+0 3.43505070E-2 -1.58831972E-5 3.30896621E-9 -2.53610447E-13
+-2.13972315E+3 1.55432015E+1 1.18113804E+0 3.08533795E-2 5.08652465E-6
+-2.46548879E-8 1.11101926E-11 -1.79040039E+3 2.10624695E+1
+C4H9 WARNZ C 4.H 9. 0. 0.G 300.000 5000.000
+ 0.93805494E+1 0.10011688E-1 -.30188721E-5 0.36665226E-9 -.12681418E-13
+ 0.33139949E+5 -.24441711E+2 0.32948971E+1 0.20137779E-1 0.77487982E-7
+ -.13250023E-7 0.64672590E-11 0.35238629E+5 0.88411312E+1
+H9C4 WARNZ C 4.H 9. 0. 0.G 300.000 5000.000
+ 0.77541008E+1 0.23770157E-1 -.80376340E-5 0.11938439E-8 -.63866501E-13
+ 0.74535205E+3 -.15286139E+2 0.14004288E+1 0.24845254E-1 0.15668920E-4
+ -.25635558E-7 0.83376197E-11 0.36863530E+4 0.22517868E+2
+C4H10 WARNZ C 4.H 10. 0. 0.G 300.000 5000.000
+ 0.10668672E+2 0.23357686E-1 -.77434970E-5 0.11380079E-8 -.60307445E-13
+ -.20635121E+5 -.33023392E+2 0.31141586E+1 0.28759062E-1 0.10943818E-4
+ -.24285349E-7 0.88289480E-11 -.17432398E+5 0.10668451E+2
+C4H2O C 4.H 2.O 1. 0.G 300.000 5000.000
+ 0.18250000E+1 0.03130000E+0 -.22500000E-4 0.58900000E-8 0.00000000
+ -.27053000E+5 0.58300000E+1 0.18250000E+1 0.03130000E+0 -.22500000E-4
+ 0.58900000E-8 0.00000000 -.27053000E+5 0.58300000E+1
+C5H 20387C 5.H 1. 0. 0.G 300.00 5000.00
+ 8.69574928E+0 6.05430082E-3 -2.01601051E-6 2.89289259E-10 -1.47009954E-14
+ 9.03106875E+4 -2.10159454E+1 1.63482475E+0 2.50953808E-2 -1.20663644E-5
+-1.04651106E-8 8.80998833E-12 9.21248750E+4 1.51219368E+1
+C5H12 20387C 5.H 12. 0. 0.G 300.00 4000.00
+ 1.66779785E+1 2.11448297E-2 -3.53332143E-6 -5.74220227E-10 1.51594828E-13
+-2.55366992E+4 -6.37294006E+1 1.87790775E+0 4.12164554E-2 1.25323368E-5
+-3.70153686E-8 1.52556856E-11 -2.00381563E+4 1.87725678E+1
+C5H2 20587C 5.H 2. 0. 0.G 300.00 5000.00
+ 1.13291750E+1 7.42405653E-3 -2.62818867E-6 4.08254097E-10 -2.30133261E-14
+ 7.87870625E+4 -3.61711731E+1 3.06232166E+0 2.70999819E-2 -1.00916968E-5
+-1.27274511E-8 9.16721907E-12 8.11496875E+4 7.07107830E+0
+C5H3 20387C 5.H 3. 0. 0.G 300.00 5000.00
+ 1.07876225E+1 9.53961909E-3 -3.20674462E-6 4.73332262E-10 -2.51213540E-14
+ 6.39290430E+4 -3.00544434E+1 4.32872009E+0 2.35248022E-2 -5.85672296E-6
+-1.21544943E-8 7.72647831E-12 6.58853125E+4 4.17325878E+0
+C5H6 20387C 5.H 6. 0. 0.G 300.00 5000.00
+ 9.68981457E+0 1.83826201E-2 -6.26488418E-6 9.39337719E-10 -5.08770814E-14
+ 1.10212422E+4 -3.12290802E+1 -3.19673920E+0 4.08136100E-2 6.81650533E-7
+-3.13745900E-8 1.57722307E-11 1.52906758E+4 3.86993866E+1
+CH3OH J 3/61C 1.H 4.O 1.0 0.G 300.000 5000.000
+ .38460000E+01 .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00
+ -.24151000E+06 .00000000E+00 .38460000E+01 .00000000E+00 .00000000E+00
+ .00000000E+00 .00000000E+00 -.24151000E+06 .00000000E+00
+CH3O J 3/61C 1.H 3.O 1.0 0.G 300.000 5000.000
+ .37260000E+01 .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00
+ .19610000E+04 .00000000E+00 .37260000E+01 .00000000E+00 .00000000E+00
+ .00000000E+00 .00000000E+00 .19610000E+04 .00000000E+00
+CHO J 3/61C 1.H 1.O 1.0 0.G 300.000 5000.000
+ .34850000E+01 .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00
+ .50480000E+04 .00000000E+00 .34850000E+01 .00000000E+00 .00000000E+00
+ .00000000E+00 .00000000E+00 .50480000E+04 .00000000E+00
+Fulven J 3/61C 1.H 4.O 1.0 0.G 300.000 5000.000
+ .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00
+ .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00
+ .00000000E+00 .00000000E+00 .00000000E+00 .00000000E+00
+uCH2 J12/72C 1.H 2. 0. 0.G 300.000 5000.000
+ .27525479E+01 .39782047E-02 -.14921731E-05 .25956899E-09 -.17110673E-13
+ .45547759E+05 .66534799E+01 .35883347E+01 .21724137E-02 -.13323408E-05
+ .19469445E-08 -.89431394E-12 .45315188E+05 .22627869E+01
+tCH2 J12/72C 1.H 2. 0. 0.G 300.000 5000.000
+ .27525479E+01 .39782047E-02 -.14921731E-05 .25956899E-09 -.17110673E-13
+ .45547759E+05 .66534799E+01 .35883347E+01 .21724137E-02 -.13323408E-05
+ .19469445E-08 -.89431394E-12 .45315188E+05 .22627869E+01
+SO2 CO2_modifie S 1.O 2.00 0.00 0.G 300.000 5000.000
+ .44608041E+01 .30981719E-02 -.12392571E-05 .22741325E-09 -.15525954E-13
+ -.48961442E+05 -.98635982E+00 .24007797E+01 .87350957E-02 -.66070878E-05
+ .20021861E-08 .63274039E-15 -.48377527E+05 .96951457E+01
+END 0. 0. 0. 0. .000 .000
+LAST
+
diff --git a/data/thch/dp_C3P b/data/thch/dp_C3P
new file mode 100644
index 0000000..7af7770
--- /dev/null
+++ b/data/thch/dp_C3P
@@ -0,0 +1,18 @@
+5 Nb especes courantes
+10 Nb de points de tabulation ENTH-TEMP
+300. TMIN
+3000. TMAX
+ Especes Gazeuses
+ C3H8 O2 CO2 H2O N2
+ .35 .35 .35 .35 .35 coeff absorption (ray)
+4 Nb especes elementaires / Composition CHON
+ .012 3 0 1 0 0
+ .001 8 0 0 2 0
+ .016 0 2 2 1 0
+ .014 0 0 0 0 2
+3 Nb d'especes globales (ici : / Fuel / Oxydant / Produits)/ composition en especes elementaires
+ 1. 0. 0. 0. 0.
+ 0. 1. 0. 0. 3.76
+ 0. 0. 3. 4. 18.80
+1 Nb de reactions mises en jeu pour les especes globales/stoechiometrie en nb de mole especes globales
+1 2 -1. -23.80 25.80
diff --git a/data/thch/dp_C3PSJ b/data/thch/dp_C3PSJ
new file mode 100644
index 0000000..8c115be
--- /dev/null
+++ b/data/thch/dp_C3PSJ
@@ -0,0 +1,30 @@
+25 Nombre de points de tabulation pour l'enthalpie
+ 50. -0.32115E+07 -0.22604E+06 -0.13883E+08
+ 250. -0.68320E+06 -0.44094E+05 -0.13513E+08
+ 450. 0.21930E+07 0.14222E+06 -0.13136E+08
+ 650. 0.50979E+07 0.33939E+06 -0.12739E+08
+ 850. 0.80296E+07 0.54797E+06 -0.12316E+08
+ 1050. 0.11009E+08 0.76412E+06 -0.11865E+08
+ 1250. 0.14066E+08 0.98555E+06 -0.11385E+08
+ 1450. 0.17210E+08 0.12110E+07 -0.10880E+08
+ 1650. 0.20438E+08 0.14400E+07 -0.10352E+08
+ 1850. 0.23745E+08 0.16723E+07 -0.98041E+07
+ 2050. 0.27124E+08 0.19077E+07 -0.92401E+07
+ 2250. 0.30571E+08 0.21460E+07 -0.85187E+07
+ 2450. 0.34081E+08 0.23870E+07 -0.78325E+07
+ 2650. 0.37649E+08 0.26306E+07 -0.70505E+07
+ 2850. 0.41269E+08 0.28767E+07 -0.61356E+07
+ 3050. 0.44939E+08 0.31251E+07 -0.50418E+07
+ 3250. 0.48653E+08 0.33757E+07 -0.37141E+07
+ 3450. 0.52410E+08 0.36285E+07 -0.20906E+07
+ 3650. 0.56207E+08 0.38833E+07 -0.10411E+06
+ 3850. 0.60042E+08 0.41399E+07 0.23123E+07
+ 4050. 0.63913E+08 0.43984E+07 0.52178E+07
+ 4250. 0.67820E+08 0.46586E+07 0.86506E+07
+ 4450. 0.71761E+08 0.49204E+07 0.12611E+08
+ 4650. 0.75737E+08 0.51837E+07 0.17042E+08
+ 4850. 0.79746E+08 0.54485E+07 0.21821E+08
+ .00219 .1387 .0159 Masse molaire fuel, oxydant, produit
+ 0.111111 Fraction de melange a la stoechiometrie
+.3 .78 .4 Coeff. d'absorption fuel, oxydant, produits (pour rayonnement)
+1. 2. Coeff. molaires de CO2 et H2O dans les produits (pour rayonnement)
diff --git a/data/thch/dp_C4P b/data/thch/dp_C4P
new file mode 100644
index 0000000..8054cb5
--- /dev/null
+++ b/data/thch/dp_C4P
@@ -0,0 +1,20 @@
+7 Nb especes courantes
+8 Nb de points de tabulation ENTH-TEMP
+300. TMIN
+3000. TMAX
+ Especes Gazeuses
+ CH4 C2H4 CO O2 CO2 H2O N2
+ .35 .35 .35 .35 .35 .35 .35 coeff absorption (ray)
+4 Nb especes elementaires / Composition CHON
+ .012 1 2 1 0 1 0 0
+ .001 4 4 0 0 0 2 0
+ .016 0 0 1 2 2 1 0
+ .014 0 0 0 0 0 0 2
+4 Nb d'especes globales (ici : / Fuel / Oxydant / Produits1 / Produits2)/ composition en especes elementaires
+ 1. 0. 0. 0. 0. 0. 0. CH4
+ 0. 0. 0. 1. 0. 0. 3.76 Air
+ 0. 0. 1. 0. 0. 2. 1.88 CH4+.5*Air=CO +2H2O+qspN2
+ 0. 0. 0. 0. 1. 2. 7.52 CH4+ 2*Air=CO2+2H2O+qspN2
+2 Nb de reactions mises en jeu pour les especes globales/stoechiometrie en nb de mole especes globales
+1 2 -1. -2.38 4.88 0.
+3 2 0. -7.14 -4.88 10.52
diff --git a/data/thch/dp_ELE b/data/thch/dp_ELE
new file mode 100644
index 0000000..0ca39ff
--- /dev/null
+++ b/data/thch/dp_ELE
@@ -0,0 +1,259 @@
+# Fichier ASCII format libre version electrique Code_Saturne (c) EDF 2003
+# Les lignes de commentaires sont obligatoires (leur nombre est fixe)
+#
+# Proprietes de l'Argon
+#
+# Nb d'especes NGAZG et Nb de points NPO (le fichier contient NGAZG blocs de NPO lignes chacun)
+# NGAZG NPO
+ 1 238
+#
+# Rayonnement : IXKABE = 0 -> XKABEL est lu mais pas utilise
+# IXKABE = 1 -> XKABEL represente le coefficient d'absorption
+# IXKABE = 2 -> XKABEL est le terme source radiatif en W/m3
+#
+ 0
+#
+# Proprietes
+# T H ROEL CPEL SIGEL VISEL XLABEL XKABEL
+# Temperature Enthalpie Masse vol. Chaleur Conductivite Viscosite Conductivite Coefficient
+# volumique massique electrique dynamique thermique d'absorption
+# K J/kg kg/m3 J/(kg K) Ohm/m kg/(m s) W/(m K) -
+#
+ 300.00 14000. 1.6225 520.33 0.13214E-03 0.34224E-04 0.26712E-01 0.0000
+ 400.00 65800. 1.2169 520.33 0.13214E-03 0.34224E-04 0.26712E-01 0.0000
+ 500.00 0.11699E+06 0.97353 520.33 0.13214E-03 0.34224E-04 0.26712E-01 0.0000
+ 600.00 0.16905E+06 0.81121 520.63 0.13214E-03 0.39245E-04 0.30631E-01 0.0000
+ 700.00 0.22110E+06 0.69530 520.53 0.13214E-03 0.44858E-04 0.35011E-01 0.0000
+ 800.00 0.27215E+06 0.60839 520.48 0.13214E-03 0.49742E-04 0.38823E-01 0.0000
+ 900.00 0.31319E+06 0.54079 520.44 0.13214E-03 0.53921E-04 0.42085E-01 0.0000
+ 1000.0 0.36524E+06 0.48672 520.41 0.13214E-03 0.57633E-04 0.44982E-01 0.0000
+ 1100.0 0.41727E+06 0.44248 520.39 0.13214E-03 0.61076E-04 0.47669E-01 0.0000
+ 1200.0 0.46931E+06 0.40561 520.38 0.13214E-03 0.64374E-04 0.50243E-01 0.0000
+ 1300.0 0.52135E+06 0.37441 520.37 0.13214E-03 0.67598E-04 0.52760E-01 0.0000
+ 1400.0 0.57339E+06 0.34767 520.36 0.13214E-03 0.70787E-04 0.55249E-01 0.0000
+ 1500.0 0.62542E+06 0.32450 520.36 0.13214E-03 0.73960E-04 0.57725E-01 0.0000
+ 1600.0 0.67746E+06 0.30422 520.35 0.13214E-03 0.77125E-04 0.60195E-01 0.0000
+ 1700.0 0.72949E+06 0.28633 520.35 0.13214E-03 0.80284E-04 0.62661E-01 0.0000
+ 1800.0 0.78152E+06 0.27042 520.34 0.13214E-03 0.83437E-04 0.65122E-01 0.0000
+ 1900.0 0.83356E+06 0.25619 520.34 0.13214E-03 0.86582E-04 0.67576E-01 0.0000
+ 2000.0 0.88559E+06 0.24338 520.34 0.13214E-03 0.89715E-04 0.70022E-01 0.0000
+ 2100.0 0.93763E+06 0.23179 520.34 0.13214E-03 0.92834E-04 0.72456E-01 0.0000
+ 2200.0 0.98966E+06 0.22126 520.34 0.13214E-03 0.95935E-04 0.74877E-01 0.0000
+ 2300.0 0.10417E+07 0.21164 520.33 0.13214E-03 0.99017E-04 0.77282E-01 0.0000
+ 2400.0 0.10937E+07 0.20282 520.33 0.13214E-03 0.10208E-03 0.79669E-01 0.0000
+ 2500.0 0.11458E+07 0.19471 520.33 0.13214E-03 0.10511E-03 0.82038E-01 0.0000
+ 2600.0 0.11978E+07 0.18722 520.33 0.13214E-03 0.10812E-03 0.84387E-01 0.0000
+ 2700.0 0.12498E+07 0.18029 520.33 0.13214E-03 0.11110E-03 0.86714E-01 0.0000
+ 2800.0 0.13019E+07 0.17385 520.33 0.13214E-03 0.11405E-03 0.89019E-01 0.0000
+ 2900.0 0.13539E+07 0.16786 520.33 0.13214E-03 0.11698E-03 0.91301E-01 0.0000
+ 3000.0 0.14059E+07 0.16226 520.33 0.13214E-03 0.11987E-03 0.93561E-01 0.0000
+ 3100.0 0.14580E+07 0.15703 520.33 0.13214E-03 0.12274E-03 0.95798E-01 0.0000
+ 3200.0 0.15100E+07 0.15212 520.33 0.30489E-03 0.12557E-03 0.98014E-01 0.0000
+ 3300.0 0.15620E+07 0.14751 520.33 0.67299E-03 0.12837E-03 0.10021 0.0000
+ 3400.0 0.16141E+07 0.14200 520.33 0.14257E-02 0.13114E-03 0.10240 0.0000
+ 3500.0 0.16661E+07 0.13700 520.33 0.29073E-02 0.13389E-03 0.10458 0.0000
+ 3600.0 0.17181E+07 0.13522 520.33 0.57210E-02 0.13660E-03 0.10679 0.0000
+ 3700.0 0.17702E+07 0.13157 520.33 0.10891E-01 0.13928E-03 0.10904 0.0000
+ 3800.0 0.18222E+07 0.12810 520.33 0.20098E-01 0.14193E-03 0.11140 0.0000
+ 3900.0 0.18742E+07 0.12482 520.33 0.36037E-01 0.14455E-03 0.11395 0.0000
+ 4000.0 0.19263E+07 0.12170 520.33 0.62885E-01 0.14715E-03 0.11682 0.0000
+ 4100.0 0.19783E+07 0.11873 520.33 0.10700 0.14972E-03 0.12019 0.0000
+ 4200.0 0.20303E+07 0.11590 520.33 0.17783 0.15226E-03 0.12435 0.0000
+ 4300.0 0.20824E+07 0.11321 520.33 0.28904 0.15477E-03 0.12570 0.0000
+ 4400.0 0.21344E+07 0.11064 520.34 0.46013 0.15726E-03 0.12680 0.0000
+ 4500.0 0.21864E+07 0.10818 520.34 0.71816 0.15972E-03 0.12739 0.0000
+ 4600.0 0.22385E+07 0.10583 520.35 1.1010 0.16216E-03 0.12853 0.0000
+ 4700.0 0.22905E+07 0.10358 520.36 1.6587 0.16458E-03 0.12954 0.0000
+ 4800.0 0.23425E+07 0.10142 520.38 2.4584 0.16697E-03 0.13019 0.0000
+ 4900.0 0.23946E+07 0.99348E-01 520.41 3.5882 0.16934E-03 0.13175 0.0000
+ 5000.0 0.24466E+07 0.97361E-01 520.50 5.1615 0.17169E-03 0.13200 0.0000
+ 5100.0 0.24987E+07 0.95452E-01 520.50 7.0610 0.17402E-03 0.13604 0.0000
+ 5200.0 0.25507E+07 0.93617E-01 520.57 9.7731 0.17632E-03 0.13793 0.0000
+ 5300.0 0.26028E+07 0.91850E-01 520.66 13.321 0.17861E-03 0.13985 0.0000
+ 5400.0 0.26549E+07 0.90149E-01 520.79 17.883 0.18088E-03 0.14179 0.0000
+ 5500.0 0.27070E+07 0.88510E-01 520.95 23.647 0.18314E-03 0.14378 0.0000
+ 5600.0 0.27591E+07 0.86930E-01 521.16 30.805 0.18537E-03 0.14582 0.0000
+ 5700.0 0.28112E+07 0.85404E-01 521.43 39.542 0.18759E-03 0.14794 0.0000
+ 5800.0 0.28634E+07 0.83932E-01 521.78 50.028 0.18979E-03 0.15015 0.0000
+ 5900.0 0.29156E+07 0.82509E-01 522.21 62.412 0.19198E-03 0.15248 0.0000
+ 6000.0 0.29679E+07 0.81133E-01 522.76 76.821 0.19415E-03 0.15494 0.0000
+ 6100.0 0.30202E+07 0.79803E-01 523.44 93.364 0.19631E-03 0.15756 0.0000
+ 6200.0 0.30727E+07 0.78515E-01 524.27 112.14 0.19845E-03 0.16037 0.0000
+ 6300.0 0.31252E+07 0.77268E-01 525.29 133.24 0.20056E-03 0.16338 0.0000
+ 6400.0 0.31779E+07 0.76059E-01 526.52 156.79 0.20270E-03 0.16663 0.0000
+ 6500.0 0.32307E+07 0.74888E-01 528.01 182.90 0.20481E-03 0.17012 0.0000
+ 6600.0 0.32836E+07 0.73752E-01 529.80 217.74 0.20690E-03 0.17388 0.0000
+ 6700.0 0.33368E+07 0.72649E-01 531.93 243.48 0.20899E-03 0.17793 0.0000
+ 6800.0 0.33903E+07 0.71578E-01 534.45 278.31 0.21106E-03 0.18229 0.0000
+ 6900.0 0.34440E+07 0.70538E-01 537.42 316.44 0.21312E-03 0.18696 0.0000
+ 7000.0 0.34981E+07 0.69527E-01 540.91 358.08 0.21517E-03 0.19199 0.0000
+ 7100.0 0.35526E+07 0.68544E-01 544.98 403.42 0.21721E-03 0.19734 0.0000
+ 7200.0 0.36076E+07 0.67587E-01 549.71 452.61 0.21925E-03 0.20308 0.0000
+ 7300.0 0.36631E+07 0.66656E-01 555.18 505.79 0.22127E-03 0.20922 0.0000
+ 7400.0 0.37192E+07 0.65749E-01 561.48 563.04 0.22328E-03 0.21578 0.0000
+ 7500.0 0.37761E+07 0.64865E-01 568.59 624.40 0.22529E-03 0.22278 0.0000
+ 7600.0 0.38338E+07 0.64003E-01 576.78 689.84 0.22729E-03 0.23026 0.0000
+ 7700.0 0.38924E+07 0.63162E-01 585.87 759.30 0.22927E-03 0.23823 0.0000
+ 7800.0 0.39520E+07 0.62342E-01 596.54 832.64 0.23125E-03 0.24675 0.0000
+ 7900.0 0.40129E+07 0.61540E-01 608.40 909.72 0.23322E-03 0.25586 0.0000
+ 8000.0 0.40750E+07 0.60757E-01 621.33 990.34 0.23518E-03 0.26555 0.0000
+ 8100.0 0.41386E+07 0.59991E-01 636.55 1074.2 0.23713E-03 0.27592 0.0000
+ 8200.0 0.42040E+07 0.59241E-01 653.19 1191.2 0.23906E-03 0.28698 0.0000
+ 8300.0 0.42711E+07 0.58507E-01 671.70 1251.0 0.24099E-03 0.29878 0.0000
+ 8400.0 0.43405E+07 0.57788E-01 693.15 1343.3 0.24290E-03 0.31142 0.0000
+ 8500.0 0.44120E+07 0.57083E-01 715.15 1437.8 0.24480E-03 0.32480 0.0000
+ 8600.0 0.44860E+07 0.56391E-01 740.24 1534.3 0.24668E-03 0.33902 0.0000
+ 8700.0 0.45628E+07 0.55711E-01 767.84 1632.6 0.24855E-03 0.35411 0.0000
+ 8800.0 0.46426E+07 0.55043E-01 798.13 1732.4 0.25040E-03 0.37011 0.0000
+ 8900.0 0.47259E+07 0.54387E-01 833.59 1833.6 0.25222E-03 0.38722 0.0000
+ 9000.0 0.48127E+07 0.53740E-01 867.85 1935.8 0.25402E-03 0.40512 0.0000
+ 9100.0 0.49035E+07 0.53103E-01 907.33 2039.0 0.25579E-03 0.42400 0.0000
+ 9200.0 0.49988E+07 0.52476E-01 953.81 2143.0 0.25754E-03 0.44416 0.0000
+ 9300.0 0.50986E+07 0.51856E-01 997.24 2247.6 0.25924E-03 0.46510 0.0000
+ 9400.0 0.52039E+07 0.51244E-01 1053.0 2352.8 0.26090E-03 0.48746 0.0000
+ 9500.0 0.53141E+07 0.50639E-01 1102.7 2458.4 0.26252E-03 0.51052 0.0000
+ 9600.0 0.54310E+07 0.50040E-01 1168.7 2564.3 0.26408E-03 0.53517 0.0000
+ 9700.0 0.55535E+07 0.49447E-01 1225.4 2670.5 0.26559E-03 0.56042 0.0000
+ 9800.0 0.56838E+07 0.48859E-01 1303.0 2776.9 0.26702E-03 0.58741 0.0000
+ 9900.0 0.58206E+07 0.48276E-01 1367.1 2883.4 0.26838E-03 0.61489 0.0000
+ 10000. 0.59663E+07 0.47696E-01 1457.7 2990.0 0.26965E-03 0.64428 0.0000
+ 10100. 0.61193E+07 0.47120E-01 1529.4 3096.6 0.27083E-03 0.67400 0.0000
+ 10200. 0.62827E+07 0.46546E-01 1634.5 3203.3 0.27189E-03 0.70582 0.0000
+ 10300. 0.64560E+07 0.45975E-01 1733.3 3309.9 0.27284E-03 0.73894 0.0000
+ 10400. 0.66376E+07 0.45406E-01 1816.1 3416.5 0.27365E-03 0.77204 0.0000
+ 10500. 0.68323E+07 0.44838E-01 1946.9 3523.1 0.27431E-03 0.80759 0.0000
+ 10600. 0.70389E+07 0.44271E-01 2065.6 3629.5 0.27481E-03 0.84446 0.0000
+ 10700. 0.72548E+07 0.43704E-01 2159.1 3735.9 0.27514E-03 0.88084 0.0000
+ 10800. 0.74868E+07 0.43137E-01 2319.8 3842.2 0.27527E-03 0.92007 0.0000
+ 10900. 0.77328E+07 0.42570E-01 2460.3 3948.4 0.27519E-03 0.96057 0.0000
+ 11000. 0.79937E+07 0.42003E-01 2608.7 4054.4 0.27489E-03 1.0023 0.0000
+ 11100. 0.82650E+07 0.41434E-01 2725.2 4160.3 0.27435E-03 1.0428 0.0000
+ 11200. 0.85572E+07 0.40864E-01 2922.1 4266.0 0.27355E-03 1.0867 0.0000
+ 11300. 0.88666E+07 0.40293E-01 3094.1 4371.6 0.27248E-03 1.1317 0.0000
+ 11400. 0.91940E+07 0.39720E-01 3274.5 4477.0 0.27113E-03 1.1779 0.0000
+ 11500. 0.95326E+07 0.39145E-01 3455.4 4582.2 0.26947E-03 1.2217 0.0000
+ 11600. 0.98976E+07 0.38568E-01 3650.3 4687.2 0.26751E-03 1.2696 0.0000
+ 11700. 0.10283E+08 0.37990E-01 3854.8 4792.0 0.26524E-03 1.3184 0.0000
+ 11800. 0.10690E+08 0.37410E-01 4067.6 4896.5 0.26265E-03 1.3680 0.0000
+ 11900. 0.11119E+08 0.36828E-01 4288.4 5000.8 0.25973E-03 1.4183 0.0000
+ 12000. 0.11558E+08 0.36243E-01 4504.2 5104.9 0.25646E-03 1.4650 0.0000
+ 12100. 0.12032E+08 0.35658E-01 4739.2 5208.6 0.25289E-03 1.5162 0.0000
+ 12200. 0.12530E+08 0.35072E-01 4981.2 5312.0 0.24900E-03 1.5679 0.0000
+ 12300. 0.13053E+08 0.34485E-01 5229.8 5415.0 0.24480E-03 1.6198 0.0000
+ 12400. 0.13602E+08 0.33897E-01 5484.1 5517.6 0.24030E-03 1.6719 0.0000
+ 12500. 0.14176E+08 0.33310E-01 5743.6 5619.9 0.23552E-03 1.7239 0.0000
+ 12600. 0.14777E+08 0.32723E-01 6007.3 5721.6 0.23048E-03 1.7758 0.0000
+ 12700. 0.15383E+08 0.32134E-01 6204.5 5823.3 0.22516E-03 1.8220 0.0000
+ 12800. 0.16036E+08 0.31549E-01 6525.2 5924.2 0.21966E-03 1.8729 0.0000
+ 12900. 0.16715E+08 0.30967E-01 6794.2 6024.5 0.21396E-03 1.9230 0.0000
+ 13000. 0.17421E+08 0.30387E-01 7062.5 6124.3 0.20811E-03 1.9722 0.0000
+ 13100. 0.18154E+08 0.29810E-01 7328.6 6223.5 0.20212E-03 2.0203 0.0000
+ 13200. 0.18913E+08 0.29238E-01 7590.7 6322.0 0.19603E-03 2.0870 0.0000
+ 13300. 0.19698E+08 0.28672E-01 7846.9 6419.9 0.18988E-03 2.1122 0.0000
+ 13400. 0.20507E+08 0.28111E-01 8095.2 6517.0 0.18368E-03 2.1556 0.0000
+ 13500. 0.21341E+08 0.27556E-01 8333.6 6613.4 0.17748E-03 2.1970 0.0000
+ 13600. 0.22197E+08 0.27010E-01 8559.9 6709.1 0.17130E-03 2.2362 0.0000
+ 13700. 0.23040E+08 0.26466E-01 8750.6 6804.7 0.16504E-03 2.2684 0.0000
+ 13800. 0.23935E+08 0.25936E-01 8953.9 6898.8 0.15897E-03 2.3028 0.0000
+ 13900. 0.24848E+08 0.25416E-01 9132.1 6992.0 0.15300E-03 2.3345 0.0000
+ 14000. 0.25777E+08 0.24906E-01 9289.8 7084.4 0.14715E-03 2.3633 0.0000
+ 14100. 0.26720E+08 0.24408E-01 9425.2 7175.8 0.14145E-03 2.3892 0.0000
+ 14200. 0.27674E+08 0.23922E-01 9536.4 7266.4 0.13591E-03 2.4121 0.0000
+ 14300. 0.28636E+08 0.23443E-01 9622.0 7355.9 0.13054E-03 2.4320 0.0000
+ 14400. 0.29604E+08 0.22987E-01 9680.8 7444.6 0.12536E-03 2.4488 0.0000
+ 14500. 0.30575E+08 0.22539E-01 9711.8 7532.2 0.12038E-03 2.4625 0.0000
+ 14600. 0.31546E+08 0.22105E-01 9714.5 7618.9 0.11561E-03 2.4733 0.0000
+ 14700. 0.32515E+08 0.21685E-01 9688.8 7704.7 0.11105E-03 2.4813 0.0000
+ 14800. 0.33479E+08 0.21279E-01 9634.8 7789.4 0.10670E-03 2.4866 0.0000
+ 14900. 0.34434E+08 0.20887E-01 9553.1 7873.2 0.10257E-03 2.4894 0.0000
+ 15000. 0.35379E+08 0.20510E-01 9444.7 7956.1 0.98656E-04 2.4899 0.0000
+ 15100. 0.36310E+08 0.20147E-01 9311.1 8038.0 0.94960E-04 2.4884 0.0000
+ 15200. 0.37225E+08 0.19797E-01 9153.8 8118.9 0.91476E-04 2.4851 0.0000
+ 15300. 0.38123E+08 0.19462E-01 8974.8 8199.0 0.88201E-04 2.4803 0.0000
+ 15400. 0.39000E+08 0.19140E-01 8776.2 8278.2 0.85131E-04 2.4742 0.0000
+ 15500. 0.39856E+08 0.18432E-01 8560.5 8356.5 0.82258E-04 2.4671 0.0000
+ 15600. 0.40689E+08 0.18537E-01 8330.2 8434.0 0.79577E-04 2.4593 0.0000
+ 15700. 0.41498E+08 0.18254E-01 8087.6 8510.7 0.77081E-04 2.4511 0.0000
+ 15800. 0.42282E+08 0.17984E-01 7835.3 8586.6 0.74762E-04 2.4427 0.0000
+ 15900. 0.43039E+08 0.17725E-01 7576.0 8661.7 0.72613E-04 2.4343 0.0000
+ 16000. 0.43770E+08 0.17477E-01 7311.9 8736.1 0.70625E-04 2.4262 0.0000
+ 16100. 0.44475E+08 0.17241E-01 7045.3 8809.9 0.68791E-04 2.4186 0.0000
+ 16200. 0.45153E+08 0.17014E-01 6778.3 8882.9 0.67103E-04 2.4116 0.0000
+ 16300. 0.45804E+08 0.16798E-01 6512.9 8955.4 0.65553E-04 2.4054 0.0000
+ 16400. 0.46429E+08 0.16590E-01 6250.7 9027.2 0.64134E-04 2.4000 0.0000
+ 16500. 0.47028E+08 0.16392E-01 5993.3 9098.5 0.62838E-04 2.3958 0.0000
+ 16600. 0.47603E+08 0.16202E-01 5742.1 9169.2 0.61657E-04 2.3926 0.0000
+ 16700. 0.48152E+08 0.16020E-01 5498.1 9239.4 0.60585E-04 2.3906 0.0000
+ 16800. 0.48679E+08 0.15845E-01 5262.1 9309.0 0.59616E-04 2.3898 0.0000
+ 16900. 0.49182E+08 0.15677E-01 5035.3 9378.2 0.58741E-04 2.3902 0.0000
+ 17000. 0.49664E+08 0.15516E-01 4817.8 9447.0 0.57957E-04 2.3920 0.0000
+ 17100. 0.50125E+08 0.15361E-01 4610.4 9515.3 0.57255E-04 2.3950 0.0000
+ 17200. 0.50566E+08 0.15211E-01 4413.2 9583.1 0.56632E-04 2.3993 0.0000
+ 17300. 0.50989E+08 0.15068E-01 4226.5 9650.6 0.56081E-04 2.4048 0.0000
+ 17400. 0.51394E+08 0.14929E-01 4050.3 9717.6 0.55597E-04 2.4116 0.0000
+ 17500. 0.51782E+08 0.14795E-01 3884.6 9784.3 0.55177E-04 2.4197 0.0000
+ 17600. 0.52155E+08 0.14666E-01 3729.5 9850.5 0.54815E-04 2.4288 0.0000
+ 17700. 0.52514E+08 0.14540E-01 3584.8 9916.4 0.54506E-04 2.4392 0.0000
+ 17800. 0.52859E+08 0.14419E-01 3450.3 9981.8 0.54248E-04 2.4506 0.0000
+ 17900. 0.53191E+08 0.14301E-01 3325.8 10047. 0.54035E-04 2.4631 0.0000
+ 18000. 0.53513E+08 0.14187E-01 3211.1 10111. 0.53865E-04 2.4767 0.0000
+ 18100. 0.53823E+08 0.14076E-01 3106.1 10176. 0.53734E-04 2.4912 0.0000
+ 18200. 0.54124E+08 0.13968E-01 3010.5 10240. 0.53639E-04 2.5066 0.0000
+ 18300. 0.54417E+08 0.13863E-01 2924.0 10303. 0.53576E-04 2.5230 0.0000
+ 18400. 0.54701E+08 0.13760E-01 2846.5 10366. 0.53543E-04 2.5402 0.0000
+ 18500. 0.54979E+08 0.13660E-01 2777.7 10428. 0.53537E-04 2.5582 0.0000
+ 18600. 0.55251E+08 0.13562E-01 2717.5 10490. 0.53554E-04 2.5769 0.0000
+ 18700. 0.55517E+08 0.13466E-01 2665.7 10551. 0.53592E-04 2.5964 0.0000
+ 18800. 0.55780E+08 0.13372E-01 2622.1 10612. 0.53649E-04 2.6166 0.0000
+ 18900. 0.56038E+08 0.13280E-01 2586.5 10672. 0.53722E-04 2.6375 0.0000
+ 19000. 0.56273E+08 0.13207E-01 2564.9 10728. 0.54238E-04 2.6584 0.0000
+ 19100. 0.56526E+08 0.13118E-01 2535.3 10787. 0.54333E-04 2.6805 0.0000
+ 19200. 0.56779E+08 0.13030E-01 2523.9 10845. 0.54437E-04 2.7031 0.0000
+ 19300. 0.57031E+08 0.12944E-01 2520.1 10902. 0.54547E-04 2.7263 0.0000
+ 19400. 0.57283E+08 0.12859E-01 2524.0 10958. 0.54662E-04 2.7499 0.0000
+ 19500. 0.57537E+08 0.12775E-01 2535.8 11014. 0.54778E-04 2.7740 0.0000
+ 19600. 0.57792E+08 0.12692E-01 2555.2 11068. 0.54893E-04 2.7986 0.0000
+ 19700. 0.58050E+08 0.12610E-01 2582.5 11122. 0.55005E-04 2.8235 0.0000
+ 19800. 0.58312E+08 0.12529E-01 2617.6 11174. 0.55113E-04 2.8489 0.0000
+ 19900. 0.58578E+08 0.12448E-01 2660.6 11225. 0.55213E-04 2.8746 0.0000
+ 20000. 0.58849E+08 0.12369E-01 2711.6 11275. 0.55304E-04 2.9006 0.0000
+ 20100. 0.59126E+08 0.12289E-01 2770.7 11323. 0.55382E-04 2.9270 0.0000
+ 20200. 0.59410E+08 0.12211E-01 2838.0 11371. 0.55447E-04 2.9536 0.0000
+ 20300. 0.59702E+08 0.12132E-01 2913.6 11416. 0.55496E-04 2.9805 0.0000
+ 20400. 0.60001E+08 0.12054E-01 2997.6 11460. 0.55527E-04 3.0076 0.0000
+ 20500. 0.60310E+08 0.11977E-01 3090.1 11502. 0.55537E-04 3.0350 0.0000
+ 20600. 0.60630E+08 0.11899E-01 3191.2 11543. 0.55525E-04 3.0626 0.0000
+ 20700. 0.60960E+08 0.11822E-01 3301.1 11582. 0.55489E-04 3.0904 0.0000
+ 20800. 0.61302E+08 0.11745E-01 3419.7 11619. 0.55428E-04 3.1183 0.0000
+ 20900. 0.61656E+08 0.11667E-01 3547.2 11654. 0.55338E-04 3.1464 0.0000
+ 21000. 0.62025E+08 0.11590E-01 3683.7 11687. 0.55219E-04 3.1747 0.0000
+ 21100. 0.62408E+08 0.11513E-01 3829.0 11718. 0.55069E-04 3.2030 0.0000
+ 21200. 0.62806E+08 0.11435E-01 3983.3 11746. 0.54888E-04 3.2315 0.0000
+ 21300. 0.63221E+08 0.11357E-01 4146.5 11773. 0.54673E-04 3.2600 0.0000
+ 21400. 0.63652E+08 0.11279E-01 4318.6 11797. 0.54424E-04 3.2886 0.0000
+ 21500. 0.64102E+08 0.11201E-01 4499.4 11819. 0.54140E-04 3.3173 0.0000
+ 21600. 0.64571E+08 0.11122E-01 4688.7 11838. 0.53820E-04 3.3460 0.0000
+ 21700. 0.65060E+08 0.11043E-01 4886.5 11856. 0.53465E-04 3.3747 0.0000
+ 21800. 0.65569E+08 0.10963E-01 5092.4 11871. 0.53074E-04 3.4035 0.0000
+ 21900. 0.66100E+08 0.10883E-01 5306.2 11883. 0.52648E-04 3.4322 0.0000
+ 22000. 0.66653E+08 0.10802E-01 5527.5 11893. 0.52186E-04 3.4610 0.0000
+ 22100. 0.67228E+08 0.10721E-01 5755.9 11901. 0.51690E-04 3.4897 0.0000
+ 22200. 0.67827E+08 0.10640E-01 5991.0 11907. 0.51160E-04 3.5185 0.0000
+ 22300. 0.68450E+08 0.10558E-01 6232.2 11911. 0.50598E-04 3.5472 0.0000
+ 22400. 0.69098E+08 0.10475E-01 6479.1 11912. 0.50005E-04 3.5758 0.0000
+ 22500. 0.69771E+08 0.10392E-01 6730.9 11912. 0.49382E-04 3.6044 0.0000
+ 22600. 0.70470E+08 0.10308E-01 6987.1 11909. 0.48732E-04 3.6330 0.0000
+ 22700. 0.71195E+08 0.10224E-01 7246.8 11905. 0.48056E-04 3.6616 0.0000
+ 22800. 0.71946E+08 0.10140E-01 7509.4 11899. 0.47357E-04 3.6900 0.0000
+ 22900. 0.72723E+08 0.10055E-01 7774.1 11891. 0.46636E-04 3.7185 0.0000
+ 23000. 0.73527E+08 0.99693E-02 8039.9 11882. 0.45896E-04 3.7468 0.0000
+ 23100. 0.74358E+08 0.98835E-02 8305.9 11872. 0.45139E-04 3.7751 0.0000
+ 23200. 0.75215E+08 0.97973E-02 8571.4 11860. 0.44368E-04 3.8034 0.0000
+ 23300. 0.76059E+08 0.97200E-02 8800.0 11841. 0.43898E-04 3.8331 0.0000
+ 23400. 0.76968E+08 0.96331E-02 9091.5 11828. 0.43100E-04 3.8613 0.0000
+ 23500. 0.77903E+08 0.95460E-02 9349.5 11813. 0.42296E-04 3.8895 0.0000
+ 23600. 0.78864E+08 0.94588E-02 9600.0 11798. 0.41487E-04 3.9176 0.0000
+ 23700. 0.79849E+08 0.93716E-02 9850.9 11783. 0.40676E-04 3.9456 0.0000
+ 23800. 0.80858E+08 0.92844E-02 10092. 11767. 0.39864E-04 3.9736 0.0000
+ 23900. 0.81891E+08 0.91973E-02 10327. 11751. 0.39055E-04 4.0016 0.0000
+ 24000. 0.82946E+08 0.91103E-02 10553. 11735. 0.38500E-04 4.0294 0.0000
diff --git a/data/thch/dp_FCP b/data/thch/dp_FCP
new file mode 100644
index 0000000..6180438
--- /dev/null
+++ b/data/thch/dp_FCP
@@ -0,0 +1,55 @@
+THERMOCHIMIE
+8 Nb especes courantes
+8 Nb de points de tabulation ENTH-TEMP
+ESPECES COURANTES
+CH4 C2H4 CO O2 CO2 H2O N2 C(S)
+300. Tmin
+4000. Tmax
+4 Nb especes elementaires / Composition C,H,O,N
+ .012 1 2 1 0 1 0 0 1
+ .001 4 4 0 0 0 2 0 0
+ .016 0 0 1 2 2 1 0 0
+ .014 0 0 0 0 0 0 2 0
+RAYONNEMENT
+0.1 Coeff absorption pour le melange gazeux constant
+CARACTERISTIQUES CHARBONS
+2 Nb de charbons
+1 1 Nb de classes
+50.E-6 50.E-6 Diametre initial de la classe (m)
+74.8 60.5 Composition C (%) sur sec
+5.1 4.14 Composition H (%) sur sec
+12.01 5.55 Composition O (%) sur sec
+0 31524000. 0 31524000. PCI (J/kg) sur pur (0) sur sec 1
+1800. 1800. CP moyen du charbon (J/kg/K)
+1200. 1200. Masse volumique (kg/m3)
+Coke
+0. 0. Composition C (%) sur sec
+0. 0. Composition H (%) sur sec
+0. 0. Composition O (%) sur sec
+0. 0. PCI sur sec (J/kg)
+Cendres
+6.3 6.3 Taux de cendres en masse (%)
+0. 0. Enthalpie de formation des cendres (J/kg)
+1800. 1800. CP des cendres (J/kg/K)
+0. 0. Humidite du charbon(%)
+Parametres de devolatilisation (modele de Kobayashi)
+1 0.37 1 0.37 Coef. stoe. (adim) Y1 si = 0 calcul automatique
+1 0.74 1 0.74 Coef. stoe. (adim) Y2 si = 0 calcul automatique
+370000. 370000. Facteur pre-exponentielle A1 (s-1)
+1.3E13 1.3E13 Facteur pre-exponentielle A2 (s-1)
+74000. 74000. Energie d'activation E1 (J/mol)
+250000. 250000. Energie d'activation E2 (J/mol)
+Parametres de combustion heterogene O2 (modele a sphere retrecissante)
+17.88 17.88 Constante pre-exponentielle (kg/m2/s/atm)
+16.55 16.55 Energie d'activation (kcal/mol)
+1 1 Ordre de la reaction 0.5 si = 0 1 si = 1
+Parametres de combustion heterogene CO2 (modele a sphere retrecissante)
+1.788 1.788 Constante pre-exponentielle (kg/m2/s/atm)
+1.655 1.655 Energie d'activation (kcal/mol)
+1 1 Ordre de la reaction 0.5 si = 0 1 si = 1
+CARACTERISTIQUES OXYDANTS (O2,N2,H2O,CO2)
+3
+1. 0. 1.
+0 0. 0.
+0. 0. 0.
+2.39 1. 0.
diff --git a/data/thch/dp_FUE b/data/thch/dp_FUE
new file mode 100644
index 0000000..844563d
--- /dev/null
+++ b/data/thch/dp_FUE
@@ -0,0 +1,38 @@
+THERMOCHIMIE
+10 Nb especes courantes
+15 Nb de points de tabulation ENTH-TEMP
+ESPECES COURANTES
+CH4 C2H4 CO O2 CO2 H2O N2 C(S) H2S SO2
+298. Tmin
+3798. Tmax
+5 Nb especes elementaires / Composition C,H,O,N,S
+ .012 1 2 1 0 1 0 0 1 0 0
+ .001 4 4 0 0 0 2 0 0 2 0
+ .016 0 0 1 2 2 1 0 0 0 2
+ .014 0 0 0 0 0 0 2 0 0 0
+ .032 0 0 0 0 0 0 0 0 1 1
+RAYONNEMENT
+0.1 Coeff absorption pour le melange gazeux constant
+CARACTERISTIQUES FUEL
+2 Nb de classes
+25.E-3 50.E-3 Diametre (mm)
+84.67 Composition C (%) sur sec
+13.79 Composition H (%) sur sec
+0.50 Composition O (%) sur sec
+0.05 Composition S (%) sur sec
+40467310. PCI (J/kg) sur pur (0) sur sec 1
+1800. CP moyen du fuel (J/kg/K)
+844. Masse volumique (kg/m3)
+Coke
+100. Composition C (%) sur pur
+0. Composition H (%) sur pur
+0. Composition O (%) sur pur
+0. Composition S (%) sur pur
+7.77 PCI sur sec (J/kg)
+0.2 FKC (r�f 0.2)
+423. TEMP debut evaporation (K)
+723. TEMP fin evaporation (K)
+Parametres de combustion heterogene (modele a sphere retrecissante)
+17.88 Constante pre-exponentielle (kg/m2/s/atm)
+16.55 Energie d'activation (kcal/mol)
+1 Ordre de la reaction 0.5 si = 0 1 si = 1
diff --git a/data/thch/dp_transfo b/data/thch/dp_transfo
new file mode 100644
index 0000000..d0b1e0e
--- /dev/null
+++ b/data/thch/dp_transfo
@@ -0,0 +1,16 @@
+1 Numero du Transfo de Reference (0 : la reference n'est pas un transfo)
+Liste des transfo
+=================
+1 Nombre de Transfo
+Transfo 1
+10000. Tension Primaire
+296. Rapport des Nombres de Spires
+61. 168.4 Impedances complexes
+0 Branch. primaire (valeur 0= Triangle, =1 etoile, =2 mono)
+0 Branch. secondaire (valeur 0= Triangle, =1 etoile, =2 mono/mono , =3 mono/tri)
+Definition des electrodes
+=========================
+3 Nombre d'electrode totale
+7 1 1 Couleur de l'electrode , Numero du Transfo , Numero de la borne
+8 1 2
+9 1 3
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..ab9889c
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,31 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+SUBDIRS = howto refcard theory tutorial user
+
+EXTRA_DIST = \
+style/csdoc.sty \
+style/csindex.sty \
+style/csmacros.sty \
+style/csvers.tex.in \
+style/logocs.png \
+style/logoedf.png
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..cc99897
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,607 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = howto refcard theory tutorial user
+EXTRA_DIST = \
+style/csdoc.sty \
+style/csindex.sty \
+style/csmacros.sty \
+style/csvers.tex.in \
+style/logocs.png \
+style/logoedf.png
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/howto/Makefile.am b/doc/howto/Makefile.am
new file mode 100644
index 0000000..5ab3132
--- /dev/null
+++ b/doc/howto/Makefile.am
@@ -0,0 +1,73 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+
+TEXMAIN = howto.tex
+
+# Other LaTex document
+
+TEXOTHERS =
+
+TEXINPUTFILES =
+
+# Distributed files
+
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
diff --git a/doc/howto/Makefile.in b/doc/howto/Makefile.in
new file mode 100644
index 0000000..4bdb058
--- /dev/null
+++ b/doc/howto/Makefile.in
@@ -0,0 +1,645 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/howto
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TEXMAIN = howto.tex
+
+# Other LaTex document
+TEXOTHERS =
+TEXINPUTFILES =
+
+# Distributed files
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/howto/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/howto/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am: install-pdf-local
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am: pdf-local
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-local ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pdf-local install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ pdf-local ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/howto/graphics/Makefile.am b/doc/howto/graphics/Makefile.am
new file mode 100644
index 0000000..aa1469b
--- /dev/null
+++ b/doc/howto/graphics/Makefile.am
@@ -0,0 +1,46 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+
+FIGFILES =
+
+# Generated documents (pdf files)
+
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+
+SUFFIXES = .fig .pdf
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
diff --git a/doc/howto/graphics/Makefile.in b/doc/howto/graphics/Makefile.in
new file mode 100644
index 0000000..526eb97
--- /dev/null
+++ b/doc/howto/graphics/Makefile.in
@@ -0,0 +1,464 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/howto/graphics
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+FIGFILES =
+
+# Generated documents (pdf files)
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+SUFFIXES = .fig .pdf
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .fig .pdf
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/howto/graphics/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/howto/graphics/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am: pdf-local
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distclean-local distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am pdf-local \
+ ps ps-am uninstall uninstall-am
+
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/howto/howto.tex b/doc/howto/howto.tex
new file mode 100644
index 0000000..1b9c632
--- /dev/null
+++ b/doc/howto/howto.tex
@@ -0,0 +1,87 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\documentclass[a4paper,10pt,twoside]{article}
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES OBLIGATOIRES
+\usepackage{csdoc}
+% MACROS SUPPLEMENTAIRES
+\usepackage{csmacros}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES ET COMMANDES POUR LE DOCUMENTS PDF ET LES HYPERLIENS
+\hypersetup{%
+ pdftitle = {CodeSaturne howto's},
+ pdfauthor = {MFEE},
+ pdfpagemode = UseOutlines
+}
+\pdfinfo{/CreationDate (D:20030429000000-01 00 )}
+%
+% To have thumbnails upon opening the document under ACROREAD
+% pdfpagemode = UseThumbs
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% INFO POUR PAGES DE GARDES
+\titreCS{\CS version~\verscs howto-'s}
+
+\docassociesCS{}
+\resumeCS{This document presents all a list of quick How-To's for
+\CS version~\verscs.
+
+\begin{center}
+\large{WORK IN PROGRESS}
+\end{center}
+}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DEBUT DU DOCUMENT
+\begin{document}
+
+\def\contentsname{\textbf{\normalsize TABLE OF CONTENTS}\pdfbookmark[1]{Table of
+contents}{contents}}
+
+\pdfbookmark[1]{Flyleaf}{pdg}
+\large
+\makepdgCS
+\normalsize
+
+\passepage
+
+\begin{center}\begin{singlespace}
+\tableofcontents
+\end{singlespace}\end{center}
+%
+%
+\end{document}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/doc/manpages/cs_check_consistency.1 b/doc/manpages/cs_check_consistency.1
new file mode 100644
index 0000000..4c5d8f2
--- /dev/null
+++ b/doc/manpages/cs_check_consistency.1
@@ -0,0 +1,58 @@
+.\"
+.\" This file is part of the Code_Saturne Kernel, element of the
+.\" Code_Saturne CFD tool.
+.\"
+.\" Copyright (C) 2009 EDF S.A., France
+.\"
+.\" contact: saturne-support at edf.fr
+.\"
+.\" The Code_Saturne Kernel 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.
+.\"
+.\" The Code_Saturne Kernel 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 the Code_Saturne Preprocessor; if not, write to the
+.\" Free Software Foundation, Inc.,
+.\" 51 Franklin St, Fifth Floor,
+.\" Boston, MA 02110-1301 USA
+.\"
+.TH CS_CHECK_CONSISTENCY 1 2009-03-15 "" "Code_Saturne commands"
+.SH NAME
+cs_check_consistency \- Check the consistency of Code_Saturne input data
+(user files, Xml file from the gui).
+.SH SYNOPSIS
+.B cs_check_consistency
+.RI [--source
+.RI <dir>]
+.RI [--param
+.RI <param.xml>]
+.RI [--nproc
+.RI <n_procs>]
+.br
+.SH DESCRIPTION
+The
+.B cs_check_consistency
+script checks the consistency between the user files and the Xml file
+(from the Graphical User Interface) provided by the user and, if
+needed, that the chosen options are compatible with parallel
+calculations. Lastly, it prints the chosen specific physics.
+.SH OPTIONS
+.B
+.IP "-s, --source"
+To specify the directory where the user files are.
+.B
+.IP "-p, --param"
+To specify the name of the Xml file written by the Graphical User
+Interface.
+.B
+.IP "-n, --nproc"
+To specify the number of processors used by the solver.
+.SH SEE ALSO
+.BR cs_check_mesh (1),
+.BR cs_create (1)
diff --git a/doc/manpages/cs_check_mesh.1 b/doc/manpages/cs_check_mesh.1
new file mode 100644
index 0000000..236fd9f
--- /dev/null
+++ b/doc/manpages/cs_check_mesh.1
@@ -0,0 +1,149 @@
+.\"
+.\" This file is part of the Code_Saturne Kernel, element of the
+.\" Code_Saturne CFD tool.
+.\"
+.\" Copyright (C) 2009 EDF S.A., France
+.\"
+.\" contact: saturne-support at edf.fr
+.\"
+.\" The Code_Saturne Kernel 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.
+.\"
+.\" The Code_Saturne Kernel 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 the Code_Saturne Preprocessor; if not, write to the
+.\" Free Software Foundation, Inc.,
+.\" 51 Franklin St, Fifth Floor,
+.\" Boston, MA 02110-1301 USA
+.\"
+.TH CS_CHECK_MESH 1 2009-03-15 "" "Code_Saturne commands"
+.SH NAME
+cs_check_mesh \- Launch Code_Saturne preprocessor and solver in
+verification mode on a given mesh.
+.SH SYNOPSIS
+.B cs_check_mesh
+.RI -m
+.RI <file>
+.RI [preprocessor_options]
+.br
+.SH DESCRIPTION
+The
+.B cs_check_mesh
+script verify the quality of a given mesh. The following options will
+be passed to Code_Saturne preprocessor.
+.SH OPTIONS
+.B
+.IP "-m, --mesh <file>"
+Preprocessor input mesh file (mesh file format determined
+automatically by filename extension or forced by
+.B -format
+sub-option)
+
+.PP
+.I General options
+.B
+.IP "-h, --help"
+Print a usage message and exit.
+.B
+.IP "-i, --in [<file>]"
+Command line completed by a file (default file: standard input)
+.B
+.IP "--int-face [<sub-options>]"
+Count and display interior faces these faces may be selected with
+face-selection sub-options
+.B
+.IP "-j, --join [<sub-options>]"
+Join non-conforming faces; select faces to join with face-selection
+sub-options
+.B
+.IP "-p, --perio <sub-options>"
+Mesh periodicity defined by argument; joining sub-options for
+tolerances and selection of periodic faces with face-selection
+sub-options
+.B
+.IP "--reorient"
+If necessary, correct orientation of cells and faces
+
+.PP
+.I Mesh selection sub-options (-m, --mesh)
+.B
+.IP "--format <keyword>"
+Selection of mesh file format
+.B
+.IP "--num <n>"
+Selection of mesh number in file (if the format allows it)
+.B
+.IP "--grp-cel <keyword>"
+Add groups of cells (based on format features/conventions)
+ * based on sections: keyword "section"
+ * based on zones: keyword "zone"
+.B
+.IP "--grp-fac <keyword>"
+Add groups of faces (based on format features/conventions)
+ * based on sections: keyword "section"
+ * based on zones: keyword "zone"
+
+.PP
+.I Available mesh formats (-m, --mesh; --format)
+
+ Extension Keyword
+
+ CGNS .cgns cgns
+ pro-STAR/STAR4 .ngeom ngeom
+ EnSight (6 or Gold) .case ensight
+ GAMBIT Neutral .neu gambit
+ GMSH .msh gmsh
+ NUMECA Hex .hex hex
+ I-deas universal .unv unv
+ MED .med med
+ Simail (NOPO) .des des
+ Meta-mesh file .mesh meta
+
+.PP
+.I Periodicity sub-options (-p, --perio)
+.B
+.IP "--trans <tx ty tz>"
+Translation vector
+.B
+.IP "--rota --angle <alpha> --dir <dx dy dz> [--invpt <px py pz>]"
+Rotation defined by an angle (in degrees) and a direction vector, and
+eventually by an invariant point (origin by default)
+.B
+.IP "--rota --matrix <mij> [--invpt <px py pz>]"
+Rotation defined by the rotation matrix (given line by line), and
+eventually by an invariant point (origin by default)
+
+.PP
+.I Non-conformal face joining sub-options (-j, --join, -p, --perio)
+.B
+.IP "--fraction <real number>"
+Fraction of the length of the smallest edge under which we consider
+that vertices may be fused (default value: 0.1)
+.B
+.IP "--plane <real number>"
+Minimal cosine of the normals of 2 coplanar faces (default value: 0.8)
+.B
+.IP "--semi-conf"
+Fast joining algorithm (allowed if faces already share vertices)
+
+.PP
+.I Face selection sub-options (for joining, selection, and periodicity)
+.B
+.IP "--color <number(s)>"
+Color numbers of faces to select
+.B
+.IP "--group <name(s)>"
+Group names of faces to select
+.B
+.IP "--invsel"
+Invert selection
+.SH SEE ALSO
+.BR cs_check_consistency (1),
+.BR cs_create (1),
+.BR cs_preprocess (1)
diff --git a/doc/manpages/cs_compile.1 b/doc/manpages/cs_compile.1
new file mode 100644
index 0000000..5efbc0c
--- /dev/null
+++ b/doc/manpages/cs_compile.1
@@ -0,0 +1,56 @@
+.\"
+.\" This file is part of the Code_Saturne Kernel, element of the
+.\" Code_Saturne CFD tool.
+.\"
+.\" Copyright (C) 2009 EDF S.A., France
+.\"
+.\" contact: saturne-support at edf.fr
+.\"
+.\" The Code_Saturne Kernel 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.
+.\"
+.\" The Code_Saturne Kernel 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 the Code_Saturne Preprocessor; if not, write to the
+.\" Free Software Foundation, Inc.,
+.\" 51 Franklin St, Fifth Floor,
+.\" Boston, MA 02110-1301 USA
+.\"
+.TH CS_COMPILE 1 2009-03-15 "" "Code_Saturne commands"
+.SH NAME
+cs_compile \- Code_Saturne wrapper for user files compilation.
+.SH SYNOPSIS
+.B cs_compile
+.RI [--test]
+.RI [--source=<src_dir>]
+.RI [--dest=<dest_dir>]
+.RI [--opt-libs=<libs>]
+.br
+.SH DESCRIPTION
+The
+.B cs_compile
+script can be used to generate the
+.B cs_solver
+executable needed for running a Code_Saturne study.
+.SH OPTIONS
+.B
+.IP "-t, --test"
+Test only, discard compilation result.
+.B
+.IP "--source"
+Choose source file directory.
+.B
+.IP "--dest"
+Choose executable file directory.
+.B
+.IP "-h, --help"
+Print a usage message and exit.
+.SH SEE ALSO
+.BR cs_create (1),
+.BR cs_solver (1)
diff --git a/doc/manpages/cs_create.1 b/doc/manpages/cs_create.1
new file mode 100644
index 0000000..24307ce
--- /dev/null
+++ b/doc/manpages/cs_create.1
@@ -0,0 +1,70 @@
+.\"
+.\" This file is part of the Code_Saturne Kernel, element of the
+.\" Code_Saturne CFD tool.
+.\"
+.\" Copyright (C) 2009 EDF S.A., France
+.\"
+.\" contact: saturne-support at edf.fr
+.\"
+.\" The Code_Saturne Kernel 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.
+.\"
+.\" The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+.\" Free Software Foundation, Inc.,
+.\" 51 Franklin St, Fifth Floor,
+.\" Boston, MA 02110-1301 USA
+.\"
+.TH CS_CREATE 1 2009-03-15 "" "Code_Saturne commands"
+.SH NAME
+cs_create \- Generate a Code_Saturne study/case.
+.SH SYNOPSIS
+.B cs_create
+.RI [--nogui]
+.RI [--study
+.RI <study_name>
+.RI <case_name>]
+.RI [--case
+.RI <case_name>]
+.br
+.SH DESCRIPTION
+The
+.B cs_create
+script sets up a directory structure for a Code_Saturne study or
+case. The different directories created are MESH for meshes, POST for
+user post-processing and a case directory (or several) containing a
+DATA, SRC (to store user files), RESU (to store results) and SCRIPTS
+directory.
+.SH OPTIONS
+.B
+.IP "-s, --study"
+To specify the name of the study when creating a full study.
+.B
+.IP "-c, --case"
+To specify the name(s) of the case(s) when created in an existing
+study.
+.B
+.IP "-n, --nogui"
+To force non use of the Graphical User Interface. This option has to
+be used only once at the beginning or at the end of the option list.
+.B
+.IP -h
+Print a usage message and exit.
+.SH EXAMPLE
+cs_create --study study_name
+.P
+cs_create --study study_name case_name_1 case_name_2
+.P
+cs_create --case case_name_1 case_name2
+.P
+cs_create --nogui --case case_name_1
+.SH SEE ALSO
+.BR cs_check_consistency (1),
+.BR cs_check_mesh (1)
diff --git a/doc/manpages/cs_info.1 b/doc/manpages/cs_info.1
new file mode 100644
index 0000000..968f82d
--- /dev/null
+++ b/doc/manpages/cs_info.1
@@ -0,0 +1,58 @@
+.\"
+.\" This file is part of the Code_Saturne Kernel, element of the
+.\" Code_Saturne CFD tool.
+.\"
+.\" Copyright (C) 2009 EDF S.A., France
+.\"
+.\" contact: saturne-support at edf.fr
+.\"
+.\" The Code_Saturne Kernel 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.
+.\"
+.\" The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+.\" Free Software Foundation, Inc.,
+.\" 51 Franklin St, Fifth Floor,
+.\" Boston, MA 02110-1301 USA
+.\"
+.TH CS_INFO 1 2009-03-15 "" "Code_Saturne commands"
+.SH NAME
+cs_info \- Wrapper for Code_Saturne documentation.
+.SH SYNOPSIS
+.B cs_info
+.RI [--version]
+.RI [--reader
+.RI <pdf_reader>]
+.RI [--guide
+.RI <guide>]
+.br
+.SH DESCRIPTION
+The
+.B cs_info
+script is a wrapper for an easier look at Code_Saturne documentation.
+.SH OPTIONS
+.B
+.IP --version
+Print Code_Saturne version (preprocessor, kernel, interface).
+.B
+.IP "-g, --guide <guide>"
+Open a pdf manual amongst: user, theory, tutorial
+.B
+.IP "-r, --reader <pdf_reader>"
+Specify a pdf reader
+.B
+.IP -h
+Print a usage message and exit.
+.SH SEE ALSO
+.BR cs_check_consistency (1),
+.BR cs_check_mesh (1),
+.BR cs_create (1),
+.BR cs_plot_probes (1),
+.BR cs_preprocess (1)
diff --git a/doc/manpages/cs_plot_probes.1 b/doc/manpages/cs_plot_probes.1
new file mode 100644
index 0000000..5b280a7
--- /dev/null
+++ b/doc/manpages/cs_plot_probes.1
@@ -0,0 +1,50 @@
+.\"
+.\" This file is part of the Code_Saturne Kernel, element of the
+.\" Code_Saturne CFD tool.
+.\"
+.\" Copyright (C) 2009 EDF S.A., France
+.\"
+.\" contact: saturne-support at edf.fr
+.\"
+.\" The Code_Saturne Kernel 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.
+.\"
+.\" The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+.\" Free Software Foundation, Inc.,
+.\" 51 Franklin St, Fifth Floor,
+.\" Boston, MA 02110-1301 USA
+.\"
+.TH CS_PLOT_PROBES 1 2009-03-15 "" "Code_Saturne commands"
+.SH NAME
+cs_plot_probes \- Wrapper around XmGrace visualization tool to plot
+Code_Saturne variables at monitoring probes.
+.SH SYNOPSIS
+.B cs_plot_probes
+.RI <monitoring_file>
+.br
+.SH DESCRIPTION
+The
+.B cs_plot_probes
+script runs
+.B xmgrace -nxy
+command on a Code_Saturne time monitoring file (chronological records)
+after removing the first column (in order to have physical time on the
+X axis).
+.SH OPTIONS
+.B
+.IP -h
+Print a usage message and exit.
+.SH EXAMPLES
+cs_plot_probes VelocitU.hst
+.SH SEE ALSO
+.BR cs_check_consistency (1),
+.BR cs_check_mesh (1),
+.BR cs_create (1)
diff --git a/doc/manpages/cs_solver.1 b/doc/manpages/cs_solver.1
new file mode 100644
index 0000000..1b7a40a
--- /dev/null
+++ b/doc/manpages/cs_solver.1
@@ -0,0 +1,89 @@
+.\"
+.\" This file is part of the Code_Saturne Kernel, element of the
+.\" Code_Saturne CFD tool.
+.\"
+.\" Copyright (C) 2009 EDF S.A., France
+.\"
+.\" contact: saturne-support at edf.fr
+.\"
+.\" The Code_Saturne Kernel 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.
+.\"
+.\" The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+.\" Free Software Foundation, Inc.,
+.\" 51 Franklin St, Fifth Floor,
+.\" Boston, MA 02110-1301 USA
+.\"
+.TH CS_SOLVER 1 2009-03-20 "" "Code_Saturne commands"
+.SH NAME
+cs_solver \- Main program of Code_Saturne.
+.SH SYNOPSIS
+.B cs_solver
+.R [options]
+.br
+.SH DESCRIPTION
+The
+.B cs_solver
+program is the main part of Code_Saturne. It solves the Navier-Stokes
+equations, on a mesh given by the
+.B preprocessor_output
+created by the Code_Saturne preprocessor.
+.SH OPTIONS
+.B
+.IP --solcom
+Stand-alone kernel with "geomet" mesh in SolCom format (obsolete).
+.B
+.IP "--mpi [appnum]"
+Use MPI for parallelism or coupling. In case of code coupling,
+.B appnum
+gives the number of this application (default: 0).
+.B
+.IP "-q, --quality"
+Mesh quality verification mode.
+.B
+.IP "--cwf <criterion> [--post]"
+Cut warped faces. Set the
+.B post
+option to activate the post-processing related to the cutting of
+warped faces.
+.B
+.IP "--benchmark [--mpitrace]"
+Elementary operations performance. If the
+.B mpitrace
+option is set, operations are done only once for light MPI traces.
+.B
+.IP --log
+Output redirection for rank -1 or 0. Differents possibilities are: 0
+for standard output and 1 for output in
+.B listing
+(default)
+.B
+.IP --logp
+Output redirection for rank > 0. Differents possibilities are: -1 to
+remove output (default), 0 for no redirection (if independant
+terminal, debugger type) and 1 for output in
+.B listing_n<rank>
+.B
+.IP "-p, --param <file_name>"
+Parameter file.
+.B
+.IP --version
+Print version number.
+.B
+.IP "-h, --help"
+Print a usage message and exit.
+.SH ENVIRONMENT
+.IP CS_FIC_MEM
+Name of memory operations trace file.
+.SH SEE ALSO
+.BR cs_create (1),
+.BR cs_preprocess (1)
+
diff --git a/doc/refcard/Makefile.am b/doc/refcard/Makefile.am
new file mode 100644
index 0000000..a524bbd
--- /dev/null
+++ b/doc/refcard/Makefile.am
@@ -0,0 +1,73 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+
+TEXMAIN = refcard.tex
+
+# Other LaTex document
+
+TEXOTHERS =
+
+TEXINPUTFILES =
+
+# Distributed files
+
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
diff --git a/doc/refcard/Makefile.in b/doc/refcard/Makefile.in
new file mode 100644
index 0000000..112635f
--- /dev/null
+++ b/doc/refcard/Makefile.in
@@ -0,0 +1,645 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/refcard
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TEXMAIN = refcard.tex
+
+# Other LaTex document
+TEXOTHERS =
+TEXINPUTFILES =
+
+# Distributed files
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/refcard/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/refcard/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am: install-pdf-local
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am: pdf-local
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-local ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pdf-local install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ pdf-local ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/refcard/graphics/Makefile.am b/doc/refcard/graphics/Makefile.am
new file mode 100644
index 0000000..aa1469b
--- /dev/null
+++ b/doc/refcard/graphics/Makefile.am
@@ -0,0 +1,46 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+
+FIGFILES =
+
+# Generated documents (pdf files)
+
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+
+SUFFIXES = .fig .pdf
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
diff --git a/doc/refcard/graphics/Makefile.in b/doc/refcard/graphics/Makefile.in
new file mode 100644
index 0000000..9d537f4
--- /dev/null
+++ b/doc/refcard/graphics/Makefile.in
@@ -0,0 +1,464 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/refcard/graphics
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+FIGFILES =
+
+# Generated documents (pdf files)
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+SUFFIXES = .fig .pdf
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .fig .pdf
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/refcard/graphics/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/refcard/graphics/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am: pdf-local
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distclean-local distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am pdf-local \
+ ps ps-am uninstall uninstall-am
+
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/refcard/refcard.tex b/doc/refcard/refcard.tex
new file mode 100644
index 0000000..596f3e8
--- /dev/null
+++ b/doc/refcard/refcard.tex
@@ -0,0 +1,124 @@
+\documentclass[a4paper,11pt]{article}
+
+\usepackage{hyperref}
+\usepackage[landscape]{geometry}
+\usepackage{fullpage}
+\usepackage{multicol}
+\usepackage{graphicx}
+\usepackage{xspace}
+\input{csvers}
+
+\pagestyle{empty}
+
+\setlength\columnseprule{0.4pt}
+\addtolength\columnsep{2pt}
+
+\newcommand{\refword}[1]{\texttt{$\bullet$ \bf{#1}}}
+
+\begin{document}
+
+\begin{multicols*}{3}
+
+\begin{center}
+ \includegraphics[width=5cm]{logocs}
+ {\Large {\bf \CS~\verscs\\Quick reference card}}
+\end{center}
+
+% User scripts
+% ------------
+
+\section*{User scripts}
+
+All \CS commands are available under a single script: \texttt{cs}.
+Here below are the most useful commands for a \CS user from the study
+creation to the post-processing. Complete information for each
+\texttt{command} can be obtained by typing:\\
+\texttt{cs <command> --help}.\\
+
+\refword{info}\\
+Get information on \CS. Open the documentation (user, theory,
+tutorial).\\
+\textit{e.g.} \texttt{cs info --guide=\emph{user}}\\
+
+\refword{config}\\
+Get information on the configuration and installation of \CS.\\
+\textit{e.g.} \texttt{cs config}\\
+
+\refword{create}\\
+Create a \CS template study or case.\\
+\textit{e.g.} \texttt{cs create --nogui --study=\emph{test}}\\
+
+\refword{gui}\\
+Launch \CS graphical user interface.\\
+\textit{e.g.} \texttt{cs gui --file=\emph{xmlfile}}\\
+
+\refword{check\_mesh}\\
+Check the mesh quality.\\
+\textit{e.g.} \texttt{cs check\_mesh -m \emph{mesh}}\\
+
+\refword{compile}\\
+Create a specific solver executable when some user subroutines are
+present.\\
+\textit{e.g.} \texttt{cs compile --test}\\
+
+\refword{plot\_probes}\\
+Wrapper around XmGrace for plotting probes monitoring.\\
+\textit{e.g.} \texttt{cs plot\_probes \emph{VitesseX.hst}}
+
+% User subroutines
+% ----------------
+
+\section*{Main user subroutines}
+
+Here below are the most useful user subroutines to run a standard
+simulation. Some of them are useless if the graphical user interface
+is used.\\
+
+\refword{usini1.f90}\\
+Initialization of the main keywords.\\
+
+\refword{usclim.f90}\\
+Management of the boundary conditions.\\
+
+\refword{usphyv.f90}\\
+Management of the variable physical properties.\\
+
+\refword{usiniv.f90}\\
+Non-standard initialization of the variables.\\
+
+\refword{usproj.f90}\\
+User project files.\\
+
+\refword{uskpdc.f90}\\
+Management of the head loss.\\
+
+\refword{usts**.f90}\\
+User source terms related subroutines.\\
+
+\refword{us*pst.f90}\\
+Post-processing related subroutines.\\
+
+% Main variables
+% --------------
+
+%\section*{Main variables}
+
+% Practical information
+% ---------------------
+
+\section*{Practical information}
+
+\url{http://www.code-saturne.org}\\
+
+Related software:\\
+\url{http://www.syrthes.org}\\
+\url{http://www.code-aster.org}\\
+\url{http://www.salome-platform.org}
+
+\begin{center}
+ \includegraphics[width=2cm]{logoedf}
+\end{center}
+
+\end{multicols*}
+
+\end{document}
diff --git a/doc/style/csdoc.sty b/doc/style/csdoc.sty
new file mode 100644
index 0000000..75faa58
--- /dev/null
+++ b/doc/style/csdoc.sty
@@ -0,0 +1,265 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\NeedsTeXFormat{LaTeX2e}
+\def \filename {csdoc.sty}
+\def \filedate {2009/01/16}
+\def \fileversion {0.5}
+\ProvidesPackage {csdoc}[\filedate\space\fileversion\space
+ Code_Saturne documentation format package]
+\typeout {Package: `csdoc' \fileversion\space <\filedate>}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Chargement des Packages utiles
+\RequirePackage{ifpdf}
+
+\ifpdf
+ \pdfcompresslevel=9
+ \RequirePackage[pdftex]{graphicx}
+ \DeclareGraphicsExtensions{.png,.pdf,.jpg}
+\else
+ \RequirePackage{graphicx}
+\fi
+
+\RequirePackage{amsmath}
+\RequirePackage{amssymb}
+\RequirePackage{setspace}
+\RequirePackage{xspace}
+
+\RequirePackage{tabularx}
+\RequirePackage{wasysym}
+\RequirePackage{fancyhdr}
+\RequirePackage{lastpage}
+\RequirePackage{ifthen}
+
+\RequirePackage[latin1]{inputenc}
+\RequirePackage[OT1]{fontenc} % \RequirePackage[T1]{fontenc} Attention: Liste des symboles
+
+% Keep the hyperref package at the end of the required packages list
+\RequirePackage[pdftex,
+ bookmarksopen=true,
+ colorlinks=true,
+ linkcolor=blue,
+ filecolor=blue,
+ urlcolor=blue,
+ citecolor=blue]{hyperref}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Mise en page : D�finitions des MACROS
+\newcommand{\titreCS}[1]{\def\titre{#1}}
+\newcommand{\docassociesCS}[1]{\def\docassocies{#1}}
+\newcommand{\resumeCS}[1]{\def\resume{#1}}
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Horizontal margins
+%-------------------
+\setlength{\voffset}{0pt}
+\setlength{\topmargin}{0pt}
+\addtolength{\topmargin}{-13mm}
+\setlength{\headheight}{15mm}
+\setlength{\headsep}{6mm}
+\setlength{\textheight}{233mm}
+\setlength{\footskip}{15mm}
+
+% Vertical margins
+%-----------------
+\setlength{\hoffset}{0pt}
+\setlength{\evensidemargin}{7mm}
+\setlength{\oddsidemargin}{7mm}
+\setlength{\textwidth}{156mm}
+\setlength{\parindent}{0mm}
+\setlength{\parskip}{6pt}
+\setlength{\tabcolsep}{1mm}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Renew title styles for sections and others
+\DeclareFixedFont{\polsec}{OT1}{phv}{b}{n}{16}
+\DeclareFixedFont{\polssec}{OT1}{phv}{b}{n}{14}
+\DeclareFixedFont{\polsssec}{OT1}{phv}{b}{n}{12}
+\renewcommand{\section}{\@startsection {section}{1}{-5mm}
+ {12pt plus2pt minus1pt}
+ {6pt}
+ {\bfseries\fontsize{16}{18}\selectfont\polsec}}
+\renewcommand{\subsection}{\@startsection {subsection}{2}{-5mm}
+ {12pt plus2pt minus1pt}
+ {6pt}
+ {\bfseries\fontsize{14}{16}\polssec}}
+\renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{-5mm}
+ {12pt plus2pt minus1pt}
+ {6pt}
+ {\bfseries\fontsize{12}{14}\polsssec}}
+\newcommand{\subsubsubsection}{\@startsection {paragraph}{3}{-5mm}
+ {12pt plus2pt minus1pt}
+ {6pt}
+ {\bfseries\fontsize{10}{12}\polsssec}}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Contents
+%
+\renewcommand*\l at section{\upshape\bfseries \@dottedtocline{1}{0mm}{1.5em}}
+\renewcommand*\l at subsection{\mdseries\scshape \@dottedtocline{2}{0mm}{2.4em}}
+\renewcommand*\l at subsubsection{\itshape \@dottedtocline{3}{3mm}{3.6em}}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Input Code_Saturne name and version macros
+\input{csvers}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Bibliography
+%-------------
+% Remove the references title
+
+\renewenvironment{thebibliography}[1]
+ {\list{\@biblabel{\@arabic\c at enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \@openbib at code
+ \usecounter{enumiv}%
+ \let\p at enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c at enumiv}}%
+ \sloppy\clubpenalty4000\widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex at warning{Empty `thebibliography' environment}}%
+ \endlist}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Warning: \passepage does not work before a \chapter ('report' class)
+\newcommand{\passepage}{%
+\ifthenelse{\isodd{\arabic{page}}}
+{\newpage\hspace*{6.cm}\newpage}{\newpage}}
+\newcommand{\passepart}{%
+\hspace*{6.cm}\ifthenelse{\isodd{\value{page}}}
+{\newpage}{\hspace*{-6.cm}}}
+%
+\newcommand{\minititre}[1]{\bigskip\noindent \underline{\sc #1}\\}
+%
+% Headers and footpages
+% =====================
+\pagestyle{fancy}
+\fancyhead{}
+\fancyhead[LE,LO]{\cartouche}
+\fancyfoot{}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+
+% CARTOUCHE
+% =========
+\newcommand{\cartouche}{%
+\hspace*{-5mm}
+\begin{tabularx}{162mm}
+{|>{\small\centering\arraybackslash}p{2.7cm}|>{\small\centering\arraybackslash}X|>
+{\small\centering\arraybackslash}p{3.5cm}|}
+\hline
+\vspace{2mm}\textbf{EDF R\&D}
+&
+\vspace{2mm}\textbf{\large\titre}
+&
+\CS \par
+documentation \par
+Page \thepage/\pageref{LastPage} \\
+\hline
+\end{tabularx}}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Title page
+\newcount\hour \newcount\minute
+\hour=\time \divide \hour by 60
+\minute=\time
+\loop \ifnum \minute > 59 \advance \minute by -60 \repeat
+\newcommand\now{\number\hour\ h
+ \ifnum \minute<10 0\fi
+ \number\minute}
+
+\def\monthyear{%
+ \ifcase\month\or
+ JANUARY\or FEBRUARY\or MARCH\or APRIL\or MAY\or JUNE\or
+ JULY\or AUGUST\or SEPTEMBER\or OCTOBER\or NOVEMBER\or
+ DECEMBER\fi
+ \space \number\year}
+
+\newcommand{\makepdgCS}
+{%
+
+\begin{titlepage}
+
+\thispagestyle{empty}
+
+\enlargethispage{4.5cm} % Enlarge the \textheight for the current page
+\unitlength=1cm
+
+\begin{center}
+\vspace*{-32mm}
+
+\begin{picture}(16,8.5)
+ \put(7,5.7){\includegraphics*[width=1.95cm]{logoedf}}
+ \put(0,7.1){\textsf{\textbf{EDF R\&D}}}
+ \put(0,4.6){\scriptsize\textsc{\textsf{Fluid Dynamics, Power Generation and Environment Department}}}
+ \put(0,4.3){\scriptsize\textsc{\textsf{Single Phase Thermal-Hydraulics Group}}}
+ \put(0,3.6){\scriptsize\textsc{\textsf{6, quai Watier}}}
+ \put(0,3.3){\scriptsize\textsc{\textsf{F-78401 Chatou Cedex}}}
+ \put(0,2.5){\scriptsize\textsc{\textsf{Tel: 33 1 30 87 75 40}}}
+ \put(0,2.2){\scriptsize\textsc{\textsf{\parbox[t]{16cm}{Fax: 33 1 30 87 79 16 \hfill \monthyear}}}}
+\end{picture}
+\begin{picture}(16,4.4)
+ \put(2.5,0){\framebox(11,4.4){\ }}
+ \put(2.75,3.8){\CS\ documentation}
+ \put(2.75,2.5){\parbox[t]{10.5cm}{\centering\textbf{{\titre}}}}
+ \put(2.75,0.4){contact: saturne-support at edf.fr}
+\end{picture}
+\begin{picture}(16,13)
+\put(1,3){\includegraphics*[width=14cm]{logocs}}
+\end{picture}
+\end{center}
+
+{ http://www.code-saturne.org/\hfill\copyright{} EDF \number\year}
+
+\passepart
+
+\end{titlepage}
+\normalsize
+}
diff --git a/doc/style/csindex.sty b/doc/style/csindex.sty
new file mode 100644
index 0000000..222940d
--- /dev/null
+++ b/doc/style/csindex.sty
@@ -0,0 +1,35 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2009 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+headings_flag 3
+heading_prefix "{\\large \\bf \\hfil--\\ "
+heading_suffix " --\\ \\hfil}\\nopagebreak\n"
+symhead_negative "symboles"
+symhead_positive "Symboles"
+
+delim_0 " \\dotfill \ "
+delim_1 " \\dotfill \ "
+delim_2 " \\dotfill \ "
diff --git a/doc/style/csmacros.sty b/doc/style/csmacros.sty
new file mode 100644
index 0000000..b8e10d9
--- /dev/null
+++ b/doc/style/csmacros.sty
@@ -0,0 +1,111 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2009 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+% Name of classical tools of the Code_Saturne environment
+% (note that Code_Saturne itself is defined in csvers.tex)
+%
+\newcommand{\ensight}{EnSight\xspace}
+\newcommand{\ensightg}{EnSight Gold\xspace}
+\newcommand{\fluent}{FLUENT\xspace}
+\newcommand{\bft}{BFT\xspace}
+\newcommand{\fvm}{FVM\xspace}
+\newcommand{\gambit}{GAMBIT\xspace}
+\newcommand{\gmsh}{Gmsh\xspace}
+\newcommand{\harpoon}{Harpoon\xspace}
+\newcommand{\hexpress}{\emph{HexPress}\xspace}
+\newcommand{\icemcfd}{ICEM~CFD\xspace}
+\newcommand{\ideas}{I-deas\xspace}
+\newcommand{\med}{MED\xspace}
+\newcommand{\metis}{METIS\xspace}
+\newcommand{\nopo}{{\sc nopp}\xspace}
+\newcommand{\paraview}{ParaView\xspace}
+\newcommand{\pcs}{Preprocessor\xspace}
+\newcommand{\salome}{SALOME\xspace}
+\newcommand{\simail}{S\textsc{IMAIL}\xspace}
+\newcommand{\starcd}{\textbf{STAR-CD}\xspace}
+\newcommand{\starccmp}{\textbf{STAR-CCM+}\xspace}
+\newcommand{\syrthes}{SYRTHES\xspace}
+\newcommand{\vtk}{VTK\xspace}
+%
+% Mathematical operators (and other useful related macros)
+%
+\newcommand{\dive}{\text{div}}
+\newcommand{\divs}{\text{div}}
+\newcommand{\divv}{\underline{\text{div}}}
+\newcommand{\grad}{\text{g}\underline{\text{rad}}\ }
+\newcommand{\ggrad}{\text{g}\underline{\underline{\text{rad}}}\ }
+\newcommand{\gradv}{\text{g}\underline{\text{rad}}\ }
+\newcommand{\gradt}{\text{g}\underline{\underline{\text{rad}}}\ }
+\newcommand{\mat}[1]{\underline{\textrm{#1}}}
+\newcommand{\matt}[1]{\underline{\underline{\textrm{#1}}}}
+\newcommand{\rot}{\underline{\text{rot}}\ }
+\newcommand{\vect}[1]{\underline{#1}}
+\newcommand{\tens}[1]{\underline{\underline{#1}}}
+%
+\newcommand{\bm}[1]{\text{\boldmath $#1$ \unboldmath} \! \!}
+\newcommand{\comp}[1]{\textrm{#1}}
+\newcommand{\degresC}{$^\circ$C}
+\newcommand{\etape}[1]{\vspace{0.3cm}$\bullet\ ${\bf #1}\\}
+\newcommand{\fort}[1]{\texttt{#1}}
+\newcommand{\grandN}{\mbox{I\hspace{-.15em}N}}
+\newcommand{\grandC}{\mbox{l\hspace{-.47em}C}}
+\newcommand{\ind}[1]{\text{$_{#1}$}}
+\newcommand{\Max}{\text{Max}}
+\newcommand{\Min}{\text{Min}}
+\newcommand{\nl}{\vspace{1ex}}
+\newcommand{\var}[1]{\ensuremath{\text{\texttt{#1}}}}
+%
+% Definition of variables and keywords (used in the different tables)
+%
+\newbox\tempbox
+\newcommand{\motcle}[7]{%
+ \noindent
+ \setbox\tempbox\hbox{\hspace*{2.5cm}}
+ \makebox[2.5cm][l]{#1}\index{#1}\makebox[1.3cm][l]{#2}\makebox[6.cm][l]{#3}%
+ \makebox[4.cm][l]{[#4]}#5\hspace{1cm}#6\\
+ \hangindent\wd\tempbox\quad\ignorespaces#7\bigskip}
+\newcommand{\motcleb}[7]{%
+ \noindent
+ \setbox\tempbox\hbox{\hspace*{2.5cm}}
+ \makebox[2.5cm][l]{\bf #1}\index{#1}\makebox[1.3cm][l]{#2}\makebox[6.cm][l]{#3}%
+ \makebox[4.cm][l]{[#4]}#5\hspace{1cm}#6\\
+ \hangindent\wd\tempbox\quad\ignorespaces#7\bigskip}
+%
+\newcommand{\variab}[4]{%
+ \setbox\tempbox\hbox{ifacel [e]: }
+ \hangindent\wd\tempbox\noindent{{\tt #2\index{#1}} [#3]:\quad}\ignorespaces#4.}
+\newcommand{\variabsize}[2]{%
+ \noindent
+ \makebox[.12\linewidth][l]{\tt #1:}\index{#1}\parbox[t]{.88\linewidth}{#2.}}
+\newcommand{\variablist}[4]{%
+ \setbox\tempbox\hbox{ifacel [e]: }
+ \hangindent\wd\tempbox\noindent{{\tt #2\index{#1}} [#3]:\quad}\ignorespaces#4\quad}
+%
+% Other useful macros (for \raggedright in tabular, for a Unix tilde)
+%
+\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
+\newcommand{\tildeunix}{{\huge$_{_{\widetilde{\ }}}$}\hspace*{0.1mm}}
diff --git a/doc/style/csvers.tex.in b/doc/style/csvers.tex.in
new file mode 100644
index 0000000..304a609
--- /dev/null
+++ b/doc/style/csvers.tex.in
@@ -0,0 +1,29 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2009 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\newcommand{\CS}{%
+ {\fontfamily{ppl}\fontshape{it}\selectfont Code\_Saturne}\xspace}
+\newcommand{\verscs}{@VERSION@\xspace}
diff --git a/doc/style/logocs.png b/doc/style/logocs.png
new file mode 100644
index 0000000..d47a4f9
Binary files /dev/null and b/doc/style/logocs.png differ
diff --git a/doc/style/logoedf.png b/doc/style/logoedf.png
new file mode 100644
index 0000000..a8be8c4
Binary files /dev/null and b/doc/style/logoedf.png differ
diff --git a/doc/theory/Makefile.am b/doc/theory/Makefile.am
new file mode 100644
index 0000000..424dab5
--- /dev/null
+++ b/doc/theory/Makefile.am
@@ -0,0 +1,104 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+
+TEXMAIN = theory.tex
+
+# Other LaTex document
+
+TEXOTHERS = \
+bilsc2.tex \
+cfbase.tex \
+cfener.tex \
+cfmsvl.tex \
+cfqdmv.tex \
+cfxtcl.tex \
+clptrg.tex \
+clptur.tex \
+clsyvt.tex \
+codits.tex \
+combustion.tex \
+condli.tex \
+covofi.tex \
+elbase.tex \
+gradmc.tex \
+gradrc.tex \
+inimas.tex \
+introd.tex \
+itrmas.tex \
+matrix.tex \
+navsto.tex \
+preduv.tex \
+recvmc.tex \
+resolp.tex \
+summary.tex \
+turbke.tex \
+turrij.tex \
+viscfa.tex \
+visort.tex \
+vissec.tex \
+vortex.tex
+
+TEXINPUTFILES =
+
+# Distributed files
+
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
diff --git a/doc/theory/Makefile.in b/doc/theory/Makefile.in
new file mode 100644
index 0000000..f70efd3
--- /dev/null
+++ b/doc/theory/Makefile.in
@@ -0,0 +1,677 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/theory
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TEXMAIN = theory.tex
+
+# Other LaTex document
+TEXOTHERS = \
+bilsc2.tex \
+cfbase.tex \
+cfener.tex \
+cfmsvl.tex \
+cfqdmv.tex \
+cfxtcl.tex \
+clptrg.tex \
+clptur.tex \
+clsyvt.tex \
+codits.tex \
+combustion.tex \
+condli.tex \
+covofi.tex \
+elbase.tex \
+gradmc.tex \
+gradrc.tex \
+inimas.tex \
+introd.tex \
+itrmas.tex \
+matrix.tex \
+navsto.tex \
+preduv.tex \
+recvmc.tex \
+resolp.tex \
+summary.tex \
+turbke.tex \
+turrij.tex \
+viscfa.tex \
+visort.tex \
+vissec.tex \
+vortex.tex
+
+TEXINPUTFILES =
+
+# Distributed files
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/theory/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/theory/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am: install-pdf-local
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am: pdf-local
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-local ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pdf-local install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ pdf-local ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/theory/bilsc2.tex b/doc/theory/bilsc2.tex
new file mode 100644
index 0000000..b12e2bd
--- /dev/null
+++ b/doc/theory/bilsc2.tex
@@ -0,0 +1,635 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{bilsc2}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+In this subroutine, called by \texttt{codits} and \texttt{turbke}, the
+contributions to the explicit budget of the reconstructed (on
+non-orthogonal meshes and if the user chooses to) convective and
+diffusive terms of the right-hand side of a convection/diffusion
+equation for a scalar $a$ are computed. These terms
+write \footnote{They appear on the right-hand side of the incremental
+system for cell $I$ of the momentum prediction step:
+$\mathcal{EM}(\delta\vect{u}^{k+1},I) =
+\mathcal{E}(\vect{u}^{n+1/2,k},I)$ (see \fort{navsto} for more details)}:
+
+\begin{equation}\label{Base_Bilsc2_eq_continue}
+\begin{array}{ll}
+\mathcal{B_{\mathcal{\beta}}}((\rho\,\vect{u})^{n},a)
+&=\underbrace{-\dive(\,(\rho \vect{u})^{n}a)}_{\text {convective part}}
++\underbrace{\dive(\,\beta\,\grad a)}_{\text{diffusive part}}\\
+\end{array}
+\end{equation}
+
+with $\rho$, $\vect{u}$, $\beta$ and $a$ the variables at time ${t^n}$.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discretization}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{\bf Convective Part}
+Using the notations adopted in the subroutine \fort{navsto}, the
+explicit budget corresponding to the integration over a cell
+$\Omega_i$ of the convective part $-{\dive(\,(\rho\,\vect{u})^n a)}$
+of $\mathcal{B_{\mathcal{\beta}}}$ can be written as a sum of the
+numerical fluxes $F_{\,ij}$ calculated at the faces of the internal
+cells, and the numerical fluxes $F_{\,b_{ik}}$ calculated at the
+boundary faces of the computational domain $\Omega$. Let's take
+$Vois(i)$ the set of the centres of the neighbouring cells of
+${\Omega_i}$ and $\gamma_b(i)$ the set of the centres of the boundary
+faces of ${\Omega_i}$ (if they exist). Thus we can write
+
+\begin{equation}\notag
+\int_{\Omega_i}{\dive( (\rho \vect{u})^n a )\, d\Omega} =
+\sum_{j\in Vois(i)}{F_{\,ij}((\rho \vect{u})^n, a)}
++\sum_{k\in {\gamma_b(i)}} {F_{\,{b}_{ik}}((\rho \vect{u})^n,a)}
+\end{equation}
+
+with :
+\begin{equation}
+F_{\,ij}((\rho \vect{u})^n,a) = \left[{(\rho \vect{u})_{\,ij}^n} \text{.}\, \vect{S}_{\,ij}\right]\ a_{\,f,ij}
+\end{equation}
+
+\begin{equation}
+F_{\,{b}_{ik}}((\rho \vect{u})^n, a) = \left[{(\rho \vect{u})_{\,{b}_{ik}}^n} \text{.}\, \vect{S}_{\,{b}_{ik}}\right]\ {a_f}_{\,{b}_{ik}}
+\end{equation}
+where $a_{\,f,ij}$ and ${a_f}_{\,{b}_{ik}}$ represent the values of
+$a$ at the internal and boundary faces of ${\Omega_i}$, respectively.
+
+repr\'esentent les valeurs aux faces
+internes et de bord respectivement.\\
+
+Before presenting the different convection schemes available in \CS, we define:\\
+\begin{figure}[h]
+\hspace*{1cm}\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facebord}}}
+\caption{\label{Base_Bilsc2_fig_geom}Definition of the geometric entities for internal (left) and a boundary faces (right).}
+\end{figure}
+\begin{equation}\notag
+\displaystyle\alpha_{ij}=\frac{\overline{FJ'}}{\overline{I'J'}} \text{\ defined at the internal faces only and}
+\end{equation}
+\begin{equation}\notag
+\vect{u}_{K'} = \vect{u}_{K}+(\ggrad{\vect{u}})_K\text{.}\, \vect{KK'}\, \text{\ at the first order in space, for ${K = I \,\text{or}\, J}$}
+\end{equation}\\
+The value of the convective flux ${F_{\,ij}}$ depends on the numerical scheme. Three different types of convection schemes are available in this subroutine:
+
+
+\renewcommand{\arraystretch}{2.}
+\begin{tabular}{ll}
+\multicolumn{2}{l}{$\bullet\ $a $1^{st}$ order upwind scheme:}\\
+&$F_{\,ij}((\rho \vect{u})^n,a)=
+F^{\it{ upstream}}_{\,ij}((\rho \vect{u})^n,a)$\\
+o\`u :&
+$a_{\,f,ij}= \left\lbrace\begin{array}{l}
+a_I \text{ si }(\rho \vect{u})_{\,ij}^n\,.\,\vect{S}_{\,ij}\geqslant 0\\
+a_J \text{ si }(\rho \vect{u})_{\,ij}^n\,.\,\vect{S}_{\,ij} < 0
+\end{array}\right.$\\
+
+\multicolumn{2}{l}{$\bullet\ $a centered scheme:}\\
+&$F_{\,ij}((\rho \vect{u})^n,a)=
+F^{\text{\it{ centered}}}_{\,ij}((\rho \vect{u})^n,a)$\\
+with :&$a_{\,f,ij}= \alpha_{ij} a_{I'}+(1-\alpha_{ij}) a_{J'}$\\
+\multicolumn{2}{l}{$\bullet\ $a Second Order Linear Upwind scheme (SOLU):}\\
+&$F_{\,ij}((\rho \vect{u})^n,a)=
+F^{\text{\it { SOLU}}}_{\,ij}((\rho \vect{u})^n,a)$ \\
+with :&
+$a_{\,f,ij}=\left\lbrace\begin{array}{l}
+a_I +\vect{IF}\,.\,(\grad a)_{\,I}
+\text{\ \ si }(\rho \vect{u})_{\,ij}^n.\ \vect{S}_{\,ij}\geqslant 0\\
+a_J + \vect{JF}\,.\,(\grad a)_{\,J}
+\text{\ \ si }(\rho \vect{u})_{\,ij}^n.\ \vect{S}_{\,ij} < 0
+\end{array}\right.$\\
+\end{tabular}\\
+\renewcommand{\arraystretch}{1.}
+\footnotetext{Extrapolation of the upwind value at the faces centre.}
+
+The value of $F_{\,b_{ik}}$ is calculated as :
+\begin{equation}\notag
+{a_f}_{\,{b}_{ik}}=\left\lbrace\begin{array}{l}
+a_I \text{ \ \ \ \ if }(\rho \vect{u})_{\,{b}_{ik}}^n
+\text{.}\, \vect{S}_{\,{b}_{ik}}\geqslant 0\\
+a_{\,{b}_{ik}}\text{ \ \ if } (\rho \vect{u})_{\,{b}_{ik}}^n
+\text{.}\, \vect{S}_{\,{b}_{ik}} < 0
+\end{array}\right.
+\end{equation}
+$a_{\,{b}_{ik}}$ is the boundary value directly computed from the prescribed boundary conditions.
+\minititre{Remark 1}
+
+When a centered scheme is used, we actually write (to ensure first order discretization in space for $a$)
+
+\begin{equation}\notag
+a_{\,f,ij} = \alpha_{ij} a_I + (1-\alpha_{ij}) a_J + \displaystyle
+\frac{1}{2}\left[(\grad a)_I+(\grad a)_J\right] \text{.}\, \vect{OF}
+\end{equation}
+
+A factor $\displaystyle \frac{1}{2}$ is used for numerical stability reasons.
+
+\minititre{Remark 2}
+A slope test (which may introduce non-linearities in the convection operator) allows to switch from
+the centered or SOLU scheme to the first order upwind scheme (without blending). Additionally, in standard mode $a_{\,f,ij}$ is computed as a weighted average between the upstream value and the centered value (blending), according to users' choice (variable $\var{BLENCV}$ in the subroutine \fort{usini1}).
+
+
+\subsection{\bf Diffusive Part}
+
+Similarly, the diffusive part writes :
+
+\begin{equation}\notag
+\int_{\Omega_i}{\dive(\,\beta\ \grad a)\ d\Omega} =
+\sum_{j\in Vois(i)}{D_{\,ij}(\,\beta, a)}
++\sum_{k\in {\gamma_b(i)}} {D_{\,{b}_{ik}}(\beta, a)}
+\end{equation}
+with:
+\begin{equation}
+D_{\,ij}(\,\beta, a) = \beta_{\,ij}
+\frac{a_{\,J'}- a_{\,I'}}{\overline{I'J'}} S_{\,ij}
+\end{equation}
+and :
+\begin{equation}
+D_{\,b_{ik}}(\,\beta, a) = \beta_{\,b_{ik}}
+\frac{a_{\,b_{ik}}-a_{\,I'}}{\overline{I'F}} S_{\,b_{ik}}
+\end{equation}
+using the same notations as before, and with $S_{\,ij}$ and $S_{\,b_{ik}}$ being the norms of vectors
+$\vect{S}_{\,ij}$, $S_{\,b_{ik}}$ and $\vect{S}_{\,b_{ik}}$,
+${a_{\,{b}_{ik}}}$, respectively.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Implementation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+In the following, the reader is reminded of the role of the variables used in the different tests:
+$\bullet \ $ \var{IRCFLP}, from array \var{IRCFLU} ; indicates for the considered variables wether
+or not the convective and diffusive fluxes are reconstructed \\
+\hspace*{1cm}$ = 0$ : no reconstruction\\
+\hspace*{1cm}$ = 1$ : reconstruction\\
+$\bullet \ $ \var{ICONVP}, from array \var{ICONV} ; indicates if the considered variables is convected or not.\\
+\hspace*{1cm}$ = 0$ : no convection\\
+\hspace*{1cm}$ = 1$ : convection\\
+$\bullet \ $ \var{IDIFFP}, from array \var{IDIFF} ; indicates if the diffusion of the considered variables is
+taken into account or not.\\
+\hspace*{1cm}$ = 0$ : no diffusion\\
+\hspace*{1cm}$ = 1$ : diffusion\\
+ $\bullet \ $ \var{IUPWIN} indicates locally, in \fort{bilsc2} (to avoid unnecessary calculations) whether a pure upwind scheme is chosen or not for the considered variables to be convected. \\
+\hspace*{1cm}$ = 0$ : no pure upwind\\
+\hspace*{1cm}$ = 1$ : pure upwind is used\\
+$\bullet \ $ \var{ISCHCP}, from array \var{ISCHCV} ; indicates which type of second order convection scheme is used on orthogonal meshes for the considered variable to convect (only useful if $\var{BLENCP}>0\ $).\\
+\hspace*{1cm}$ = 0$ : we use the SOLU scheme (Second Order Linear
+Upwind ) \\
+\hspace*{1cm}$ = 1$ : we use a centered scheme\\
+In both cases the blending coefficient \var{BLENCP} needs to be given in \fort{usini1}.\\
+$\bullet \ $ \var{BLENCP}, from array \var{BLENCV} ; indicates the percentage of centered or SOLU convection scheme that one wants to use. This weighting coefficient is between $0$ and $1$.\\
+$\bullet \ $ \var{ISSTPP}, from array \var{ISSTPC} ; indicates if one wants to remove the slope test that switches the convection scheme from second order to upwind if the test is positive.\\
+\hspace*{1cm}$ = 0$ : a slope test is systematically used\\
+\hspace*{1cm}$ = 1$ : no slope test
+\subsection{\bf Computation of the gradient $\vect{G}_{\,c,i}$ of variable $a$}
+The computation of the gradient of variable $a$ is necessary for the computation of the explicit budget. \fort{grdcel} is called everytime this gradient is needed, and it is stored in the array (\var{DPDX}, \var{DPDY}, \var{DPDZ}). The computation of the gradient is necessary in the following situations:
+\hspace*{0.5cm}$\bullet \ $ if the convection is activated with a non pure upwind scheme
+ ($\var{ICONVP} \ne {0}$ and $\var{IUPWIN} =~0$) {\bf and},\\
+\hspace*{1cm} if we want to reconstruct the fluxes ($\var{IRCFLP} = {1}$),\\
+\hspace*{1cm}{\bf or} if we want to use the SOLU scheme
+($\var{ISCHCP} = {0}$),\\
+\hspace*{1cm}{\bf or} if we use the slope test ($\var{ISSTPP} = {0}$),\\
+or :\\
+\hspace*{0.5cm}$\bullet \ $ if there is diffusion and we want to reconstruct the fluxes ($\var{IDIFFP} \ne {0}$ and $\var{IRCFLP} =~1$).\\\\
+In all other cases, the array (\var{DPDX}, \var{DPDY}, \var{DPDZ}) is set to zero.
+
+\subsection{\bf Computation of the upwind gradient $\vect{G}^{\,amont}_{\,c,i}$ of variable $a$}
+
+$\vect{G}^{\,amont}_{\,c,i}$ refers to the upwind gradient of variable $a$, for cell $\Omega_i$.
+It is stored in the array ($\var{DPDXA}, \var{DPDYA}, \var{DPDZA}$).\\
+We also define the scalars $a^{\,amont}_{\,ij}$
+and $a^{\,amont}_{\,b_{ik}}$ as:
+
+\begin{equation}\label{Base_Bilsc2_Eq_grad_decentre}
+\begin{array}{ll}
+|\Omega_i|\,\vect{G}^{\,upwind}_{\,c,i}&\overset{\text{\it\small def}}{=}
+\sum\limits_{j\in Vois(i)}a^{\,upwind}_{\,ij}\,{\vect S_{\,ij}} + \sum\limits_{k\in {\gamma_b(i)}}a^{\,upwind}_{\,b_{ik}}\,\vect{S}_{\,{b}_{ik}} \\
+\end{array}
+\end{equation}
+
+After initializing it to zero, {\bf $\vect{G}^{\,amont}_{\,c,i}$ is only computed} when
+the user wishes to compute {\bf a convection term with a centered or SOLU method, and a slope test}.\\
+$\bullet \ $ For each cell $\Omega_i$, the face values $a_{IF}$ (variable \var{PIF}) and $a_{JF}$~ (variable \var{PJF}), are computed as:\\
+\begin{equation}\notag
+\begin{array}{ll}
+a_{IF}= a_I + \vect {IF}\,.\,(\grad a)_{\,I} \\
+a_{JF}= a_J + \vect {JF}\,.\,(\grad a)_{\,J} \\
+\end{array}
+\end{equation}
+
+Depending on the sign $s^n_{ij}$ of the mass flux $(\rho \vect{u})_{\,ij}^n.\ \vect{S}_{\,ij}$,
+we give $a_{IF}$ or $a_{JF}$ the value $a^{\,upwind}_{\,ij}$ of the expression
+ $\sum\limits_{j\in Vois(i)}a^{\,upwind}_{\,ij}\,{\vect S_{\,ij}}$.\\
+\begin{equation}\notag
+a^{\,upwind}_{\,ij}=\left\lbrace\begin{array}{l}
+a_I +\vect{IF}\,.\,(\grad a)_{\,I}
+\text{\ \ si } s^n_{ij} = 1\\
+a_J + \vect{JF}\,.\,(\grad a)_{\,J}
+\text{\ \ si } s^n_{ij} = - 1
+\end{array}\right.
+\end{equation}
+
+$\bullet \ $The boundary terms are computed in a classic manner as follows (keeping the same notations as in the other subroutines):
+\begin{equation}\notag
+\begin{array}{ll}
+\sum\limits_{k\in {\gamma_b(i)}}a^{\,upwind}_{\,b_{ik}}\,\vect{S}_{\,{b}_{ik}}
+& = \sum\limits_{k\in {\gamma_b(i)}}(\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,a_{I'})\,\vect{S}_{\,{b}_{ik}}\\
+&=\sum\limits_{k\in {\gamma_b(i)}}\left[ \var{INC}\,A_{\,b,ik} +
+B_{\,b,ik}\,a_{I} + B_{\,b,ik}\,\vect {II'}\,.\,\vect{G}_{\,c,i}
+\right]\,\vect{S}_{\,{b}_{ik}}
+\end{array}
+\end{equation}
+$(A_{\,b,ik},
+B_{\,b,ik})_{k\in {\gamma_b(i)}}$ are stored in the arrays (\var{COEFAP}, \var{COEFBP}). The vector $\vect{II'}$ is stored in the array (\var{DIIPBX}, \var{DIIPBY},
+\var{DIIPBZ}). The surfaces $(\vect{S}_{\,{b}_{ik}})_{k\in {\gamma_b(i)}}$ are stored in the array \var{SURFBO} .
+
+\subsection{\bf Summation of the numerical convective and diffusive fluxes}
+The contributions to the explicit budget $[-\dive(\,(\rho \vect{u})^{n}a)
++\dive(\,\beta\,\grad a)]$ are computed and added to the right-hand side array \var{SMBR},
+which has already been initialized before the call to
+\fort{BILSC2} (with the explicit source terms for instance, etc.).\\
+The variable \var{FLUX} gathers the convective and diffusive parts of the numerical fluxes. It is computed in a classic manner, first on the internal faces, and then on the boundary faces.
+The indices $i$ and $j$ are represented by \var{II} and \var{JJ}, respectively.\\
+In order to take into account (when necessary) the sign $s^n_{ij}$ of
+the mass flux $(\rho\vect{u})_{\,ij}^n.\ \vect{S}_{\,ij}$, the following equations are used :
+
+For any real $b$, we have :
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+ b &= b^{+} + b^{-} \text{ with } b^{+} = max\ (b,0),\ \ b^{-} = min\ (b,0)\\
+|\,b |&= b^{+} - b^{-}\\
+b^{+}& =\displaystyle\frac{1}{2}\,[\ b + |\,b |\ ]\\
+b^{-}& =\displaystyle\frac{1}{2}\,[\ b - |\,b\ |\ ]\\
+\end{array}\right.
+\end{equation}
+In this subroutine, $b$ represents the mass flux $\var{FLUMAS(IFAC)}$
+on an internal face $\var{IFAC}$ ($\var{FLUMAB(IFAC)}$ for a boundary face \var{IFAC})
+; $b^{+}$ is stored in $\var{FLUI}$ and $b^{-}$ in $\var{FLUJ}$.\\\\
+\hspace*{1cm}{\tiny$\blacksquare$}\, for an internal face $ij$ (\var{IFAC})\\
+We calculate :
+\begin{equation}\notag
+\sum_{j\in Vois(i)}{F_{\,ij}((\rho \vect{u})^n, a)}
+- \sum_{j\in Vois(i)}{D_{\,ij}(\,\beta, a)}\\
+= \sum_{j\in Vois(i)}\displaystyle\left({ \left[{(\rho \vect{u})_{\,ij}^n} \text{.}\,
+\vect{S}_{\,ij}\right]\ a_{\,f,ij}
+- \beta_{\,ij}\frac{a_{\,J'}- a_{\,I'}}{\overline{I'J'}} S_{\,ij}}\right)
+\end{equation}
+The above sum corresponds to the numerical operation:
+\begin{equation}\label{Base_Bilsc2_eq_flux_interne}
+\begin{array}{ll}
+\var{FLUX}& = \var{ICONVP} \,.\,[\ \var{FLUI}\,.\, \var{PIF} + \var{FLUJ}\,.\, \var{PJF}\ ]\\
+&+\,\var{IDIFFP}\,.\,\var{VISCF(IFAC)}\,.\,[\ \var{PIP} - \var{PJP}\ ]
+\end{array}
+\end{equation}
+The above equation does not depend on the chosen convective scheme, since the latter only affects the quantities \var{PIF} (face value of $a$ used
+when $b$ is positive) and \var{PJF} (face value of $a$ used
+when $b$ is n\'egative). \var{PIP} represents $a_{I'}$, \var{PJP} $a_{J'}$ and \var{VISCF(IFAC)}
+ $ \beta_{\,ij} \displaystyle \frac{S_{\,ij}}{\overline{I'J'}}$ .\\
+The treatment of diffusive part is identical (either with or without reconstruction). Consequently, only the numerical scheme relative to the convection differs.\\\\
+\hspace*{1cm}{\tiny$\blacksquare$}\, for a boundary face $ik$ (\var{IFAC})\\
+We compute the terms :
+\begin{equation}\notag
+\sum_{k\in {\gamma_b(i)}} {F_{\,{b}_{ik}}((\rho \vect{u})^n,a)}
+- \sum_{k\in {\gamma_b(i)}} {D_{\,{b}_{ik}}(\beta, a)}
+=\sum_{k\in {\gamma_b(i)}}\displaystyle\left(\left[{(\rho
+\vect{u})_{\,{b}_{ik}}^n} \text{.}\, \vect{S}_{\,{b}_{ik}}\right]\
+{a_f}_{\,{b}_{ik}}- \beta_{\,b_{ik}}
+\frac{a_{\,b_{ik}}-a_{\,I'}}{\overline{I'F}} S_{\,b_{ik}}\right)
+\end{equation}
+with:
+\begin{equation}\notag
+\begin{array}{lll}
+a_{I'}& = a_I + \vect{II'}\,.\,\vect{G}_{\,c,i}\\
+a_{\,{b1}_{ik}} &= \var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,a_{I'}\\
+a_{\,b_{ik}}& = \var{INC}\,A^{diff}_{\,b,ik} + B^{diff}_{\,b,ik}\,a_{I'}\\
+\end{array}
+\end{equation}
+The coefficients $( A_{\,b,ik}, B_{\,b,ik} )_{k\in {\gamma_b(i)}}$ $\left(\ \text{resp.} ( A^{diff}_{\,b,ik}, B^{diff}_{\,b,ik} )_{k\in
+{\gamma_b(i)}}\ \right)$ represent the boundary conditions associated with
+$a$ (resp. the diffusive fluxes \footnote { see
+\var{clptur} for more details. The difference is actually only effective when the $k-\epsilon$ model is used, and for the velocity only.} of $a$).\\
+The above sum corresponds to the numerical operation::
+\begin{equation}\label{Base_Bilsc2_eq_flux_bord}
+\begin{array}{ll}
+\var{FLUX}& = \var{ICONVP} \,.\,[\ \var{FLUI}\,.\, \var{PVAR(II)} + \var{FLUJ}\,.\, \var{PFAC}\ ]\\
+&+\,\var{IDIFFP}\,.\,\var{VISCB(IFAC)}\,.\,[\ \var{PIP} - \var{PFACD}\ ]
+\end{array}
+\end{equation}
+where \var{PFAC} represents $a_{\,{b1}_{ik}}$, \var{PIP} $a_{I'}$, $\var{PFACD}$ $a_{\,b_{ik}}$ and $\var{VISCB(IFAC)}$
+$ \beta_{\,b_{ik}} \displaystyle\frac{S_{\,b_{ik}}}{\overline{I'F}} $.\\
+This treatment is common to all schemes, because boundary values only depend on boundary conditions, and because a very simplified expression of $F_{\,{b}_{ik}}$ is used (upwind)
+\footnote{Actually, ${a_f}_{\,{b}_{ik}}$ is $a_I$ if ${(\rho
+\vect{u})_{\,{b}_{ik}}^n} \text{.}\, \vect{S}_{\,{b}_{ik}}\,\geqslant \,0$, $a_{\,{b1}_{ik}}$ otherwise.}.\\\\
+We still have to compute, when the convection option is activated ($\var{ICONVP} = 1$),
+the values of variables \var{PIF} and
+\var{PJF}, for any internal face \var{IFAC} between cell
+$\Omega_i$ and $\Omega_j$.
+\subsubsection{\bf Calculation of the flux in pure upwind $\var{IUPWIN} = 1$}
+
+In this case, there is no reconstruction since only
+the values \var{PVAR(II)} and \var{PVAR(JJ)} at the cell centres are needed.
+\begin{equation}
+\begin{array}{ll}
+\var{PIF} &= \var{PVAR(II)} \\
+\var{PJF} &= \var{PVAR(JJ)} \\
+\end{array}
+\end{equation}
+The variable \var{INFAC} counts the number of calculations in pure upwind,
+in order to be printed in the listing file.
+In order to obtain the global numerical flux \var{FLUX} (convective + diffusive)
+associated, the following operations are performed :\\
+$\bullet$ calculation of vectors \vect{II'} and \vect{JJ'},\\
+$\bullet$ calculation of the face gradient (\var{DPXF}, \var{DPYF}, \var{DPZF}) with the half-sum of the cell gradients $\vect{G}_{\,c,i}$ et $\vect{G}_{\,c,j}$,\\
+$\bullet$ calculation of the reconstructed (if necessary) values $a_{I'}$ and $a_{J'}$ (variables \var {PIP} and \var{PJP}, respectively) given by :
+\begin{equation}\label{Base_Bilsc2_Eq_Rec_Dif1}
+\begin{array}{lll}
+a_{K'}&= a_K + \var{IRCFLP}\,.\,\vect {KK'}\,.\,\displaystyle\frac{1}{2}\,(\,\vect{G}_{\,c,i}\,+\,\vect{G}_{\,c,j}\,)&\text{ K = I et J}\\
+\end{array}
+\end{equation}
+$\bullet$ calculation of the quantities \var{FLUI} and \var{FLUJ},\\
+$\bullet$ calculation of the flux \var{FLUX} using (\ref{Base_Bilsc2_eq_flux_interne}).\\
+The computation of the sum in \var{SMBR} is straight-forward, following (\ref{Base_Bilsc2_eq_continue})
+\footnote{ taking into account the negative sign of $\mathcal{B_{\mathcal{\beta}}}$.} .
+\subsubsection{\bf Calculation of the flux with a centered or SOLU scheme ($\var{IUPWIN} = 0$)}
+
+The two available second order schemes on orthogonal meshes are the centered scheme and the SOLU scheme.
+\\ In both cases, the following operations are performed:\\
+$\bullet$ calculation of the vector \vect{II'}, the array (\var{DIIPFX}, \var{DIIPFY}, \var{DIIPFZ}) and the vector \vect{JJ'}, the array (\var{DJJPFX}, \var{DJJPFY}, \var{DJJPFZ})\\
+$\bullet$ calculation of the face gradient (\var{DPXF}, \var{DPYF}, \var{DPZF})
+haff-sum of the cell gradients $\vect{G}_{\,c,i}$ and $\vect{G}_{\,c,j}$,\\
+$\bullet$ calculation of the possibly reconstructed (if \var{IRCFLP} = 1) values $a_{I'}$ and $a_{J'}$ (variables \var {PIP} and \var{PJP}, respectively) given by :
+\begin{equation}\label{Base_Bilsc2_Eq_Rec_Dif2}
+\begin{array}{lll}
+a_{K'}&= a_K + \var{IRCFLP}\,.\,\vect {KK'}\,.\,\displaystyle\frac{1}{2}\,(\,\vect{G}_{\,c,i}\,+\,\vect{G}_{\,c,j}\,)&\text{ K = I and J}\\
+\end{array}
+\end{equation}
+$\bullet$ calculation of \var{FLUI} and \var{FLUJ}.\\\\
+%\hspace*{2.5cm}{\tiny$\clubsuit$} en centr\'e ($\var{ISCHCP} = 1$)\\
+\hspace*{2cm}{\tiny$\blacksquare$} \underline{ without slope test ($\var{ISSTPP} = 1$)}\\\\
+\hspace*{2.5cm}{\tiny$\bigstar$} with a centered scheme ($\var{ISCHCP} = 1$)\\
+The values of the variables \var{PIF} and \var{PJF} are equal, and calculated
+using the weighting coefficient $\displaystyle\alpha_{ij}$ as follows:
+\begin{equation}
+\begin{array}{ll}
+P_{IF} &=\displaystyle\alpha_{ij}\,.\, P_{I'} + (1 - \displaystyle\alpha_{ij})\,.\, P_{J'}\\
+P_{JF} &= P_{IF}
+\end{array}
+\end{equation}
+\hspace*{2.5cm}{\tiny$\bigstar$} with a SOLU scheme ($\var{ISCHCP} = 0$)\\\\
+After calculating the vectors $\vect{IF}$ and $\vect{JF}$, the values of the variables \var{PIF} and \var{PJF} are computed as follows:
+\begin{equation}
+\begin{array}{ll}
+P_{IF} &= P_I + \vect{IF}\,.\,\vect{G}_{\,c,i}\\
+P_{JF} &= P_J + \vect{JF}\,.\,\vect{G}_{\,c,j}\\
+\end{array}
+\end{equation}
+ \var{PIF} and \var{PJF} are systematically reconstructed in order to avoid
+using pure upwind, {\it i.e.} this formulae is applied even when the user
+chooses not to reconstruct ($\var{IRCFLP} = 0$).\\\\
+\hspace*{2cm}{\tiny$\blacksquare$} \underline{ with slope test ($\var{ISSTPP}
+= 0$)}\\\\
+The procedure is quite similar to the one described in the previous paragraph.
+There is, in addition to hte previous procedure, a slope test that makes under
+certain conditions the scheme switch locally (but systematically) from the chosen
+ centered or SOLU scheme to a pure upwind scheme. \\\\
+\hspace*{2.5cm}$\rightsquigarrow$\ \ calculation of the slope test\\
+Equation (\ref{Base_Bilsc2_Eq_grad_decentre}) writes on an internal cell
+$\Omega_i$, with
+$ s^n_{ij} = sgn \left[(\rho\vect{u})_{\,ij}^n\,.\,\vect{S}_{\,ij}\right]$ :\\
+\begin{equation}\notag
+\begin{array}{lll}
+|\Omega_i|\,\vect{G}^{\,upwind}_{\,c,i}&=
+\sum\limits_{j\in Vois(i)}a^{\,upwind}_{\,ij}\,{\vect S_{\,ij}} \\
+&=\sum\limits_{j\in
+Vois(i)}\left[\displaystyle\frac{1}{2}(\ s^n_{ij} + 1\ )\right.&a_{IF} +
+\left.\displaystyle\frac{1}{2}(\ s^n_{ij} - 1\ )\,a_{JF}\right]\ \vect{S}_{\,ij}\\
+&=\sum\limits_{j\in
+Vois(i)}\left[\displaystyle\frac{1}{2}(\ s^n_{ij} + 1\ )\right.&(\ a_I + \vect {IF}\,.\,(\grad a)_{\,I}\ ) \\
+& &
++\displaystyle\frac{1}{2}\ \left.(\ s^n_{ij} - 1\ )\,(\ a_I + \vect{JF}\,.\,(\grad a)_{\,J}\ )\right]\ \vect{S}_{\,ij}
+\end{array}
+\end{equation}\\
+On a cell $\Omega_i$ with neighbours $(\Omega_j)_{j\in Vois(i)}$, the classic slope test
+consists in locating where a variable $a$ is non-monotonic by studying the sign of
+the scalar product of the cell gradients of $\vect{G}_{\,c,i}$
+and $\vect{G}_{\,c,j}$. If this product is negative, we switch to an upwind scheme, if it is
+positive, we use a centered or SOLU scheme.\\
+Another technique which also ensures the monotonicity of the solution is
+to apply this criterion to the upwind gradients
+$\,\vect{G}^{\,amont}_{\,c,k}\,$ or to their normal projection on
+face $(\,\vect{G}^{\,amont}_{\,c,k}\,.\,\vect{S}_{\,kl}\,)$.\\
+We then study the sign of the product
+$\,\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{G}^{\,amont}_{\,c,j}\,$ or of the product
+$(\,\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{S}_{\,ij}\,)\,.\,(\,\vect{G}^{\,amont}_{\,c,j}\,.\,\vect{S}_{\,ij}\,)\,$.
+The slope test implemented is based on the first quantity,
+$\,\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{G}^{\,amont}_{\,c,j}\,$
+(the second one was abandonned because it was found to be less general). The
+choice of a slope test based on
+$\,\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{G}^{\,amont}_{\,c,j}\,$
+comes from the following line of argument in one-dimension \footnote{Information
+on the second derivative would permit to study more finely the behaviour and the strong
+variations of $a$.}:
+
+Let's take $p$ a second order in $x$ polynomial function. Its value at points $I-1$, $I$, $I+1$ of coordinates $x_{I-1}$, $x_I$ and $x_{I+1}$ are $p_{I-1}$, $p_I$, and
+$p_{I+1}$, respectively. To simplify, we
+suppose that $I$ is the origin $O$ (~$x_I = 0$~), and that the grid spacing $h$ is constant,
+which results in $ x_{I+1} = - x_{I-1} = h $. Additionally, we suppose that the
+velocity is orientated from point $I$ towards point $I+1$, {\it i.e.} $s^n_{ij} =
+1$. Therefore we consider the points $I-1$, $I$ and $I+1$ for the face
+$ij$ which is located between $I$ and $I+1$.\\
+The sign of the product $ p'(x_{I-1})\,.\,p'(x_{I+1}) $ inidicates the monotonicity
+of function $p$. If this product it positive, the function is monotonic and
+we use a centered or a SOLU scheme, otherwise, we switch to an upwind scheme. By identifying
+the polynomial coefficients using the equations $\ p\,(x_{I-1}) = p_{I-1}\
+$, $\ p\,(x_I) = p_I\ $, $\ p\,(x_{I+1}) = p_{I+1}\ $, we obtain :\\
+\begin{equation}
+\begin{array}{lll}
+p'(x_{I-1})& = + \displaystyle \frac{p_{I+1} - p_{I-1}}{2h} & +
+\left[\displaystyle {\ \frac{p_I - p_{I-1}}{h} - \frac{p_{I+1} - p_I}{h} }\right]\\
+p'(x_{I+1})& = + \displaystyle \frac{p_{I+1} - p_{I-1}}{2h} & -
+\left[\displaystyle {\ \frac{p_I - p_{I-1}}{h} - \frac{p_{I+1} - p_I}{h} }\right] \\
+\end{array}
+\end{equation}
+or after simplification :
+\begin{equation}
+\begin{array}{lll}
+p'(x_{I-1}) = G_{\,c,i} + \left(\ G^{\,amont}_{\,c,i} - \displaystyle \frac{p_{I+1} - p_I}{h}\right)\\
+p'(x_{I+1}) = G_{\,c,i} - \left(\ G^{\,amont}_{\,c,i} - \displaystyle \frac{p_{I+1} - p_I}{h}\right)\\
+\end{array}
+\end{equation}
+We know that :\\
+{\tiny $\clubsuit$} $\displaystyle \frac{p_{I+1} - p_I}{h}$ representes the
+upwind derivative at point $I+1$, directly accessible by the
+values of $p$ in the neighbouring cells of face $ij$,\\
+{\tiny $\clubsuit$} $\displaystyle \frac{p_{I+1} - p_{I-1}}{2h}$ represents the
+centered derivative (in finite volume) at point $I$, namely $ G_{\,c,i}$,\\
+{\tiny $\clubsuit$} $\displaystyle\frac{p_I - p_{I-1}}{h}$ represents the value of the
+upwind derivative (in finite volume) at point $I$, namely $ G^{\,amont}_{\,c,i}$.\\
+The slope test relative to $ p'(x_{I-1})\,.\,p'(x_{I+1}) $ reduces
+to studying the sign of $\mathcal{TP}_{1d}$ :\\
+\begin{equation}
+\begin{array}{ll}
+\mathcal{TP}_{1d}
+&= \left(G_{\,c,i}\ +\ [\ G^{\,amont}_{\,c,i}
+-\displaystyle \frac{p_{I+1} - p_I}{h}]\right).\left(G_{\,c,i}\ -\ [\ G^{\,amont}_{\,c,i}
+-\displaystyle \frac{p_{I+1} - p_I}{h}]\right) \\
+ &= |G_{\,c,i}|^2 - (\ G^{\,amont}_{\,c,i}
+-\displaystyle \frac{p_{I+1} - p_I}{h})^2\\
+\end{array}
+\end{equation}
+Using a similar line of argument, a possible extension to higher dimensions
+ consists in replacing the values $ G_{\,c,k} $ and $ G^{\,amont}_{\,c,k} $ by
+$(\,\vect{G}_{\,c,k}\,.\,\vect{S}_{\,kl}\,)$ eand
+$(\,\vect{G}^{\,amont}_{\,c,k}\,.\,\vect{S}_{\,kl}\,)$ respectively. After simplifications, this leads us
+to the formulae $\mathcal{TP}^{+}_{3d}$ :
+\begin{equation}
+\mathcal{TP}^{+}_{3d} = (\vect{G}_{\,c,i}\,.\, \vect{S}_{\,ij})^2 -
+(\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{S}_{\,ij} - \displaystyle\frac{a_{\,J}- a_{\,I}}{\overline{I'J'}} S_{\,ij})^2
+\end{equation}
+for $(\rho \vect{u})_{\,ij}^n.\ \vect{S}_{\,ij} > 0$.\\
+Similarly, we can deduce a $\mathcal{TP}^{-}_{3d}$
+associated with $(\rho \vect{u})_{\,ij}^n.\ \vect{S}_{\,ij} < 0$, defined by
+:\\
+\begin{equation}
+\mathcal{TP}^{-}_{3d} = (\vect{G}_{\,c,j}\,.\, \vect{S}_{\,ij})^2 -
+(\vect{G}^{\,amont}_{\,c,j}\,.\,\vect{S}_{\,ij} - \displaystyle\frac{a_{\,J}- a_{\,I}}{\overline{I'J'}} S_{\,ij})^2
+\end{equation}
+\\
+We introduce the variables \var{TESTI}, \var{TESTJ} and \var{TESTIJ} computed as:
+\begin{equation}
+\begin{array}{lll}
+\var{TESTI}&=\vect{G}^{\,amont}_{\,c,i}\,.\, \vect{S}_{\,ij}\\
+\var{TESTJ}&=\vect{G}^{\,amont}_{\,c,j}\,.\, \vect{S}_{\,ij}\\
+\var{TESTIJ}&=\vect{G}^{\,amont}_{\,c,i}\,.\, \vect{G}^{\,amont}_{\,c,j}\\
+\end{array}
+\end{equation}
+The quantity \var{TESQCK} corresponding to $\mathcal{TP}_{3d}$, is
+computed dynamically, depending on the sign of the mass flux $s^n_{ij}$.\\
+\hspace*{2.5cm}$\rightsquigarrow$\ \ consequently :\\\\
+\hspace*{1.5cm}{\tiny$\diamond$} if $(\rho \vect{u})_{\,ij}^n.\ \vect{S}_{\,ij} > 0$ and \\
+\hspace*{2cm} if $\underbrace{(\vect{G}_{\,c,i}\,.\, \vect{S}_{\,ij})^2 - (\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{S}_{\,ij} - \displaystyle\frac{a_{\,J}-
+a_{\,I}}{\overline{I'J'}} S_{\,ij})^2}_{\var{TESQCK}} < 0 \text{ or } (\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{G}^{\,amont}_{\,c,j}) < 0$,\\\\
+%$
+\hspace*{1.5cm} or~:\\
+\hspace*{1.5cm} if $(\rho \vect{u})_{\,ij}^n.\ \vect{S}_{\,ij} < 0$ and \\
+\hspace*{2cm} if $\underbrace{(\vect{G}_{\,c,j}\,.\, \vect{S}_{\,ij})^2 -
+(\vect{G}^{\,amont}_{\,c,j}\,.\,\vect{S}_{\,ij} - \displaystyle\frac{a_{\,J}-
+a_{\,I}}{\overline{I'J'}} S_{\,ij})^2}_{\var{TESQCK}} < 0 \text{ or }
+(\vect{G}^{\,amont}_{\,c,i}\,.\,\vect{G}^{\,amont}_{\,c,j}) < 0$,\\\\
+%$
+\hspace*{1.5cm}then we switch to a pure upwind scheme:
+\begin{equation}
+\begin{array}{ll}
+\var{PIF} &= \var{PVAR(II)} \\
+\var{PJF} &= \var{PVAR(JJ)} \\
+\end{array}
+\end{equation}
+\hspace*{1.5cm} and \var{INFAC} is incremented.\\\\
+\hspace*{1.5cm}{\tiny$\diamond$} otherwise :\\
+\hspace*{1.5cm} the centered or the SOLU scheme values values are used as before :\\\\
+\hspace*{2.5cm}{\tiny$\bigstar$} with a centered scheme ($\var{ISCHCP} = 1$)\\
+\hspace*{1.5cm} The values of the variables \var{PIF} and \var{PJF} are equal and calculated
+using the weighting coefficient $\displaystyle\alpha_{ij}$ :
+\begin{equation}
+\begin{array}{ll}
+P_{IF} &=\displaystyle\alpha_{ij}\,.\, P_{I'} + (1 - \displaystyle\alpha_{ij})\,.\, P_{J'}\\
+P_{JF} &= P_{IF}
+\end{array}
+\end{equation}
+\hspace*{2.5cm}{\tiny$\bigstar$} with a SOLU scheme ($\var{ISCHCP} = 0$)\\
+\hspace*{1.5cm} After calculating the vectors $\vect{IF}$ and $\vect{JF}$, the values of the variables \var{PIF} and \var{PJF} are computed as follows:
+\begin{equation}
+\begin{array}{ll}
+P_{IF} &= P_I + \vect{IF}\,.\,\vect{G}_{\,c,i}\\
+P_{JF} &= P_J + \vect{JF}\,.\,\vect{G}_{\,c,j}\\
+\end{array}
+\end{equation}
+\hspace*{1.5cm} \var{PIF} and \var{PJF} are systematically reconstructed in order to avoid
+using pure upwind, {\it i.e.} this formulae is applied even when the user
+chooses not to reconstruct ($\var{IRCFLP} = 0$).\\\\
+
+Wether the slope test is activated or not, when the centered or the SOLU schemes are activated,
+a blending coefficient (\var{BLENCP}) between 0 and 1, provided by the user, enables to blend, if desired, the chosen scheme and the pure upwind scheme following the formulae:
+\begin{equation}
+\begin{array}{ll}
+P_{IF} &= \var{BLENCP} P^{\,\it (centre\ ou\ SOLU) }_{\,IF} + (1 - \var{BLENCP})\ P_{II}\\
+P_{JF} &= \var{BLENCP} P^{\,\it (centre\ ou\ SOLU) }_{\,JF} + (1 - \var{BLENCP})\ P_{JJ}\\
+\end{array}
+\end{equation}
+$\bullet$ calculation of \var{FLUI} and \var{FLUJ},\\
+$\bullet$ calculation of the flux \var{FLUX} using equation (\ref{Base_Bilsc2_eq_flux_interne}).\\
+The computation of the sum in \var{SMBR} is straight-forward, following (\ref{Base_Bilsc2_eq_continue})\footnote{ taking into account the negative sign of $\mathcal{B_{\mathcal{\beta}}}$.}
+
+\noindent\minititre{Remark}
+For more information on the convection schemes and the slope test in \CS
+(version 1.1), the reader is referred to EDF internal report EDF HI-83/04/020 (F. Archambeau,
+2004).
+
+\newpage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points to treat}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Convection scheme}
+\hspace*{1cm}$\rightsquigarrow$\ \underline {Upwind scheme}\\
+As all first-order schemes, it is robust, but introduces severe numerical diffusion. \\
+\hspace*{1cm}$\rightsquigarrow$\ \underline {Centered or SOLU scheme}\\
+This type of schemes can generate numerical oscillations, that can cause the calculation
+to blow up. It can also lead to physical scalars taking unphysical values.\\
+Considering these limitations, other schemes are currently being tested and implemented
+in order to improve the quality of the schemes available to the users.\\\\
+\etape{Diffusion scheme}
+The formulae :
+\begin{equation}
+D_{\,ij}(\,\beta, a) = \beta_{\,ij} \frac{a_{\,J'}- a_{\,I'}}{\overline{I'J'}} S_{\,ij}
+\end{equation}
+is second-order accurate only for $\alpha_{ij}\ = \displaystyle\frac{1}{2}$.
+A possible correction may be to write :\\
+\begin{equation}
+\vect{G}_{\,f,ij}\,.\,\vect{S}_{\,ij} = (\grad a)_{\,ij} = \frac{a_{\,J'}- a_{\,I'}}{\overline{I'J'}}\,.\,\vect{S}_{\,ij} + (\displaystyle\frac{1}{2} -
+\alpha_{ij}\ )\left[(\grad a)_{I'} - (\grad a)_{J'}\right]\,.\,\vect{S}_{\,ij}
+\end{equation}
+with a gradient limiter and a computation of $\beta_{ij}$ which does not
+alter the order of accuracy.\\\\
+\etape{Implementation}
+In order to improve the CPU time, an effort on loops can be done.
+More particularly, there is a test \var{IF} inside of a loop on variable \var{IFAC} that needs
+to be checked.\\\\
+\etape{Calculation of the gradient used during the reconstruction of the diffusive fluxes}
+Why do we use $\displaystyle\frac{1}{2}\,(\,\vect{G}_{\,c,i}\,+\,\vect{G}_{\,c,j}\,)$ instead of $\,\vect{G}_{\,c,k}\,$, for $k=i$ or for $k=j$ in the reconstructed values $a_{I'}$ or $a_{J'}$ of (\ref{Base_Bilsc2_Eq_Rec_Dif1}) and (\ref{Base_Bilsc2_Eq_Rec_Dif2})?
diff --git a/doc/theory/cfbase.tex b/doc/theory/cfbase.tex
new file mode 100644
index 0000000..9408232
--- /dev/null
+++ b/doc/theory/cfbase.tex
@@ -0,0 +1,1059 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{cfbl**}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+On s'int�resse � la r�solution des �quations de Navier-Stokes en compressible,
+en particulier pour des configurations sans choc. Le sch�ma global correspond � une
+extension des algorithmes volumes finis mis en \oe uvre pour simuler les
+�quations de Navier-Stokes en incompressible.
+
+Dans les grandes lignes, le sch\'ema est constitu\'e d'une \'etape
+``acoustique'' fournissant la masse volumique (ainsi qu'une pr\'ediction de
+pression et un d\'ebit acoustique), suivie de la r\'esolution de l'\'equation de
+la quantit\'e de mouvement~; on r\'esout ensuite l'\'equation de l'\'energie
+et, pour terminer, la pression est mise \`a jour.
+Moyennant une contrainte sur la valeur du pas de temps, le sch\'ema permet
+d'assurer la positivit\'e de la masse volumique.
+
+La thermodynamique prise en compte \`a ce jour est celle des gaz parfaits, mais
+l'organisation du code \`a \'et\'e pr\'evue pour permettre \`a l'utilisateur de
+fournir ses propres lois.
+
+Pour compl�ter la pr�sentation, on pourra se reporter � la r�f�rence
+suivante~: \\
+\textbf{[Mathon]} P. Mathon, F. Archambeau, J.-M. H�rard : "Implantation d'un
+algorithme compressible dans \CS", HI-83/03/016/A
+
+Le cas de validation "tube \`a choc" de la version 1.2 de \CS permettra
+\'egalement d'apporter quelques compl\'ements (tube \`a choc de Sod,
+discontinuit\'e de contact instationnaire, double d\'etente sym\'etrique,
+double choc sym\'etrique).
+
+\newpage
+%=================================
+\subsection{Notations}
+%=================================
+
+\begin{table}[h!]
+\begin{tabular}{ccp{10,5cm}}
+
+{\bf Symbole} & {\bf Unit\'e} & {\bf Signification}\\
+
+\phantom{$C_v$, ${C_v}_i$} & \phantom{$\lbrack f\rbrack.\,kg/(m^3.\,s)$} & \\
+
+$C_p$, ${C_p}_i$ & $J/(kg.\,K)$ & capacit� calorifique \`a pression constante
+ $C_p = \left.\frac{\partial h}{\partial T}\right)_P$\\
+$C_v$, ${C_v}_i$ & $J/(kg.\,K)$ & capacit� calorifique \`a volume constant
+ $C_v = \left.\frac{\partial \varepsilon}{\partial T}\right)_\rho$\\
+$\mathcal{D}_{f/b}$ & $m^2/s$ & diffusivit\'e mol\'eculaire du composant $f$
+ dans le bain\\
+$E$ & $J/m^3$ & \'energie totale volumique $E = \rho e$\\
+$F$ & & centre de gravit\'e d'une face\\
+$H$ & $J/kg$ & enthalpie totale massique
+ $H = \frac{E+P}{\rho}$\\
+$I$ & & point de co-location de la cellule $i$\\
+$I'$ & & pour une face $ij$ partag\'ee entre les
+ cellules $i$ et $j$, $I'$
+ est le projet\'e de $I$ sur la
+ normale \`a la $ij$ passant
+ par $F$, centre de $ij$\\
+$K$ & $kg/(m.\,s)$ & diffusivit\'e thermique\\
+$M$, $M_i$ & $kg/mol$ & masse molaire ($M_i$ pour le constituant $i$)\\
+$P$ & $Pa$ & pression\\
+$\vect{Q}$ & $kg/(m^2.\,s)$& vecteur quantit\'e de mouvement
+ $\vect{Q} = \rho\vect{u}$\\
+$\vect{Q}_{ac}$ & $kg/(m^2.\,s)$& vecteur quantit\'e de mouvement issu
+ de l'\'etape acoustique\\
+$Q$ & $kg/(m^2.\,s)$& norme de $\vect{Q}$\\
+$R$ & $J/(mol.\,K)$ & constante universelle des gaz parfaits\\
+$S$ & $J/(K.\,m^3)$ & entropie volumique\\
+$\mathcal{S}$ & $\lbrack f\rbrack.\,kg/(m^3.\,s)$
+ & Terme de production/dissipation volumique
+ pour le scalaire $f$\\
+$T$ & $K$ & temp\'erature ($>0$)\\
+$Y_i$ & & fraction massique du compos\'e $i$
+ ($0 \leqslant Y_i \leqslant 1$)\\
+\end{tabular}
+\end{table}
+
+\clearpage
+
+\begin{table}[htp]
+\begin{tabular}{ccp{10,5cm}}
+
+{\bf Symbole} & {\bf Unit\'e} & {\bf Signification}\\
+
+\phantom{$C_v$, ${C_v}_i$} & \phantom{$\lbrack f\rbrack.\,kg/(m^3.\,s)$} & \\
+
+$c^2$ & $(m/s)^2$ & carr\'e de la vitesse du son
+ $c^2 = \left.\frac{\partial P}{\partial \rho}\right)_s$\\
+$e$ & $J/kg$ & \'energie totale massique
+ $e = \varepsilon + \frac{1}{2}u^2$\\
+$\vect{f}_v$ & $N/kg$ & $\rho\vect{f}_v$ repr\'esente le terme
+ source volumique pour la quantit\'e
+ de mouvement~: gravit\'e, pertes
+ de charges, tenseurs des contraintes
+ turbulentes, forces de Laplace...\\
+$\vect{g}$ & $m/s^2$ & acc\'el\'eration de la pesanteur\\
+$h$ & $J/kg$ & enthalpie massique
+ $h=\varepsilon + \frac{P}{\rho}$\\
+$i$ & & indice faisant r\'ef\'erence \`a la
+ cellule $i$~; $f_i$ est la valeur
+ de la variable $f$ associ\'ee
+ au point de co-location $I$\\
+$I'$ & & indice faisant r\'ef\'erence \`a la
+ cellule $i$~; $f_I'$ est la valeur
+ de la variable $f$ associ\'ee
+ au point $I'$\\
+$\vect{j}\wedge\vect{B}$
+ & $N/m^3$ & forces de Laplace\\
+$r$, $r_i$ & $J/(kg.\,K)$ & constante massique des gaz parfaits
+ $r = \frac{R}{M}$
+ (pour le constituant $i$, on a $r_i=\frac{R}{M_i}$)\\
+$s$ & $J/(K.\,kg)$ & entropie massique\\
+$t$ & $s$ & temps\\
+$\vect{u}$ & $m/s$ & vecteur vitesse\\
+$u$ & $m/s$ & norme de $\vect{u}$\\
+
+\end{tabular}
+\end{table}
+
+
+\newpage
+
+\begin{table}[htp]
+\begin{tabular}{ccp{10,5cm}}
+
+{\bf Symbole} & {\bf Unit\'e} & {\bf Signification}\\
+
+\phantom{$C_v$, ${C_v}_i$} & \phantom{$\lbrack f\rbrack.\,kg/(m^3.\,s)$} & \\
+
+$\beta$ & $kg/(m^3.\,K)$ &
+ $\beta = \left.\frac{\partial P}{\partial s}\right)_\rho$\\
+$\gamma$ & $kg/(m^3.\,K)$ & constante caract\'eristique
+ d'un gaz parfait
+ $\gamma = \frac{C_p}{C_v}$\\
+$\varepsilon$ & $J/kg$ & \'energie interne massique\\
+$\kappa$ & $kg/(m.\,s)$ & viscosit\'e dynamique en volume\\
+$\lambda$ & $W/(m.\,K)$ & conductivit\'e thermique\\
+$\mu$ & $kg/(m.\,s)$ & viscosit\'e dynamique ordinaire\\
+$\rho$ & $kg/m^3$ & densit\'e\\
+$\vect{\varphi}_f$
+ & $\lbrack f\rbrack.\,kg/(m^2.\,s)$
+ & vecteur flux diffusif du compos\'e $f$\\
+$\varphi_f$ & $\lbrack f\rbrack.\,kg/(m^2.\,s)$
+ & norme de $\vect{\varphi}_f$\\
+
+\phantom{ouden} & & \\
+
+$\tens{\Sigma}^v$ &$kg/(m^2.\,s^2)$& tenseur des contraintes visqueuses\\
+$\vect{\Phi}_s$ & $W/m^2$ & vecteur flux conductif de chaleur\\
+$\Phi_s$ & $W/m^2$ & norme de $\vect{\Phi}_s$\\
+$\Phi_v$ & $W/kg$ & $\rho\Phi_v$ repr\'esente le terme
+ source volumique d'\'energie,
+ comprenant par exemple
+ l'effet Joule $\vect{j}\cdot\vect{E}$,
+ le rayonnement...\\
+\end{tabular}
+\end{table}
+\clearpage
+
+%=================================
+\subsection{Syst\`eme d'\'equations laminaires de r\'ef\'erence}
+%=================================
+
+L'algorithme d\'evelopp\'e propose de r\'esoudre
+l'\'equation de continuit\'e, les \'equations de Navier-Stokes
+ainsi que l'\'equation d'\'energie totale de mani\`ere conservative,
+pour des \'ecoulements compressibles.
+
+\begin{equation}\label{Cfbl_Cfbase_eq_ref_laminaire_cfbase}
+\left\{\begin{array}{l}
+
+\displaystyle\frac{\partial\rho}{\partial t} + \divs(\vect{Q}) = 0 \\
+\\
+\displaystyle\frac{\partial\vect{Q}}{\partial t}
++ \divv(\vect{u} \otimes \vect{Q}) + \gradv{P}
+= \rho \vect{f}_v + \divv(\tens{\Sigma}^v) \\
+\\
+\displaystyle\frac{\partial E}{\partial t} + \divs( \vect{u} (E+P) )
+= \rho\vect{f}_v\cdot\vect{u} + \divs(\tens{\Sigma}^v \vect{u})
+- \divs{\,\vect{\Phi}_s} + \rho\Phi_v
+
+\end{array}\right.
+\end{equation}
+
+Nous avons pr�sent� ici le syst�me d'�quations laminaires, mais il faut pr�ciser
+que la turbulence ne pose pas de probl�me particulier dans la mesure o� les
+�quations suppl\'ementaires sont d�coupl�es du syst\`eme~(\ref{Cfbl_Cfbase_eq_ref_laminaire_cfbase}).
+
+%=================================
+\subsection{Expression des termes intervenant dans les \'equations}
+%=================================
+
+\begin{itemize}
+
+\item{\'Energie totale volumique :
+ \begin{equation}
+ E = \rho e = \rho\varepsilon + \frac{1}{2} \rho u^2
+ \end{equation}
+ avec l'\'energie interne $\varepsilon(P,\rho)$ donn\'ee par l'\'equation d'\'etat}
+\\
+\item{Forces volumiques : $\rho\vect{f}_v$ (dans la plupart des cas
+ $\rho\vect{f}_v= \rho\vect{g}$)}
+\\
+\item{Tenseur des contraintes visqueuses pour un fluide Newtonien :
+ \begin{equation}
+ \tens{\Sigma}^v = \mu (\gradt{\vect{u}} +\ ^t\gradt{\vect{u}})
+ + (\kappa - \frac{2}{3}\mu) \divs\,{\vect{u}}\ \tens{Id}
+ \end{equation}
+ avec $\mu(T,\ldots)$ et $\kappa(T,\ldots)$ mais souvent $\kappa =0$}
+\\
+\item{Flux de conduction de la chaleur : loi de Fourier
+ \begin{equation}
+ \vect{\Phi}_s = -\lambda \gradv{T}
+ \end{equation}
+ avec $\lambda(T,\ldots)$}
+\\
+\item{Source de chaleur volumique : $\rho\Phi_v$}
+
+\end{itemize}
+
+
+%=================================
+\subsection{\'Equations d'\'etat et expressions de l'\'energie interne}
+\label{Cfbl_Cfbase_equations_etat_cfbase}
+%=================================
+
+%---------------------------------
+\subsubsection{Gaz parfait}
+%---------------------------------
+
+\'Equation d'\'etat : $P = \rho r T$\\
+
+
+\'Energie interne massique :
+$\varepsilon = \displaystyle\frac{P}{(\gamma -1) \rho}$
+
+Soit~:
+\begin{equation}\label{Cfbl_Cfbase_eq_pression_gp_cfbase}
+P = (\gamma -1) \rho (e - \frac{1}{2} u^2)
+\end{equation}
+
+
+%---------------------------------
+\subsubsection{M\'elange de gaz parfaits}
+%---------------------------------
+
+On consid\`ere un m\'elange de $N$ constituants de fractions massiques
+$(Y_i)_{i=1 \ldots N}$\\
+
+\'Equation d'\'etat : $P = \rho\ r_{m\acute elange}\ T$\\
+
+\'Energie interne massique :
+$\varepsilon = \displaystyle\frac{P}{(\gamma_{m\acute elange} -1)\rho}$
+
+Soit~:
+\begin{equation}\label{Cfbl_Cfbase_eq_pression_melange_gp_cfbase}
+P = (\gamma_{m\acute elange} -1) \rho (e - \frac{1}{2} u^2)
+\end{equation}
+
+avec $\gamma_{m\acute elange}
+= \displaystyle\frac{\sum\limits_{i=1}^{N} {Y_i C_{pi}}}
+{\sum\limits_{i=1}^{N} {Y_i C_{vi}}}$\ \
+et\ \ $r_{m\acute elange} = \displaystyle\sum\limits_{i=1}^{N} {Y_i r_i}$
+
+
+%---------------------------------
+\subsubsection{Equation d'\'etat de Van der Waals}
+%---------------------------------
+
+Cette \'equation est une correction de l'\'equation d'\'etat
+des gaz parfaits pour tenir compte des forces intermol\'eculaires
+et du volume des mol\'ecules constitutives du gaz.
+On introduit deux coefficients correctifs~:
+$a$ [$Pa.\,m^6 / kg^2$] est li\'e aux forces intermol\'eculaires
+et $b$ [$m^3/kg$] est le covolume (volume occup\'e par les mol\'ecules).\\
+
+\'Equation d'\'etat : $(P+a\rho^2)(1-b\rho) = \rho r T$\\
+
+\'Energie interne massique :
+$\varepsilon = \displaystyle\frac{(P+a\rho^2)(1-b\rho)}
+{(\hat{\gamma} -1)\rho} - a \rho$
+
+Soit~:
+\begin{equation}\label{Cfbl_Cfbase_eq_pression_vdw_cfbase}
+P = (\hat{\gamma} -1) \displaystyle\frac{\rho}{(1-b\rho)}
+(e - \frac{1}{2} u^2 + a\rho) - a \rho^2
+\end{equation}
+
+avec $\hat{\gamma} = 1 + \displaystyle\frac{r}{C_v}
+= \displaystyle\frac{C_p}{C_v}
+\displaystyle\left(\frac{P-a\rho^2 (1-2b\rho)}{P+a\rho^2}\right)
++ \displaystyle\frac{2a\rho^2 (1-b\rho)}{P+a\rho^2}$
+
+
+
+%=================================
+\subsection{Calcul des grandeurs thermodymamiques}
+%=================================
+
+%---------------------------------
+\subsubsection{Pour un gaz parfait \`a $\gamma$ constant}
+%---------------------------------
+
+%`````````````````````````````````
+\paragraph{Equation d'\'etat~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$P = \rho r T$
+
+On suppose connues la chaleur massique \`a pression constante $C_p$
+et la masse molaire $M$ du gaz, ainsi que les variables d'\'etat.
+
+%`````````````````````````````````
+\paragraph{Chaleur massique \`a volume constant~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$C_v = C_p - \displaystyle\frac{R}{M} = C_p - r$
+
+
+%`````````````````````````````````
+\paragraph{Constante caract\'eristique du gaz~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$\gamma = \displaystyle\frac{C_p}{C_v} = \displaystyle\frac{C_p}{C_p - r}$
+
+
+%`````````````````````````````````
+\paragraph{Vitesse du son~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$c^2 = \gamma \displaystyle\frac{P}{\rho}$
+
+
+%`````````````````````````````````
+\paragraph{Entropie~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$s = \displaystyle\frac{P}{\rho^{\gamma}}$
+\quad et
+$\beta = \left.\displaystyle\frac{\partial P}{\partial s}\right)_{\rho}
+= \rho^{\gamma}$
+
+\noindent\textit{Remarque~:} L'entropie choisie ici n'est pas l'entropie
+physique, mais une entropie math\'ematique qui v\'erifie \quad
+$c^2 \left.\displaystyle\frac{\partial s}{\partial P}\right)_{\rho}
++ \left.\displaystyle\frac{\partial s}{\partial \rho}\right)_{P} = 0$
+
+
+%`````````````````````````````````
+\paragraph{Pression~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$P = (\gamma-1) \rho \varepsilon$
+
+
+%`````````````````````````````````
+\paragraph{Energie interne~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$\varepsilon = C_v T
+= \displaystyle\frac{1}{\gamma-1} \displaystyle\frac{P}{\rho}$\qquad\text{\ \ avec\ \ }
+$\varepsilon_{sup} = 0$
+
+%`````````````````````````````````
+\paragraph{Enthalpie~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$h = C_p T
+= \displaystyle\frac{\gamma}{\gamma-1} \displaystyle\frac{P}{\rho}$
+
+
+%---------------------------------
+\subsubsection{Pour un m\'elange de gaz parfaits}
+%---------------------------------
+
+Une intervention de l'utilisateur dans le sous-programme utilisateur
+\fort{uscfth} est n�cessaire pour pouvoir utiliser ces lois.
+
+%`````````````````````````````````
+\paragraph{Equation d'\'etat~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$P = \rho\ r_{m\acute el}\ T$
+\quad avec $r_{m\acute el} = \displaystyle\sum\limits_{i=1}^{N} {Y_i r_i}
+= \displaystyle\sum\limits_{i=1}^{N} Y_i \displaystyle\frac{R}{M_i}$
+
+
+On suppose connues la chaleur massique \`a pression constante
+des diff\'erents constituants ${C_p}_i$,
+la masse molaire $M_i$ des constituants du gaz,
+ainsi que les variables d'\'etat (dont les fractions massiques $Y_i$).
+
+%`````````````````````````````````
+\paragraph{Masse molaire du m\'elange~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$M_{m\acute el} = \left(\displaystyle\sum\limits_{i=1}^{N}
+\displaystyle\frac{Y_i}{M_i} \right)^{-1}$
+
+%`````````````````````````````````
+\paragraph{Chaleur massique \`a pression constante du m\'elange~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+$\\$
+${C_p}_{m\acute el} = \displaystyle\sum\limits_{i=1}^{N} Y_i {C_p}_i$
+
+
+%`````````````````````````````````
+\paragraph{Chaleur massique \`a volume constant du m\'elange~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+$\\$
+${C_v}_{m\acute el} = \displaystyle\sum\limits_{i=1}^{N} Y_i {C_v}_i
+= {C_p}_{m\acute el} - \displaystyle\frac{R}{M_{m\acute el}}
+= {C_p}_{m\acute el} - r_{m\acute el}$
+
+
+%`````````````````````````````````
+\paragraph{Constante caract\'eristique du gaz~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$\gamma_{m\acute el} = \displaystyle\frac{{C_p}_{m\acute el}}
+{{C_v}_{m\acute el}}
+= \displaystyle\frac{{C_p}_{m\acute el}}{{C_p}_{m\acute el} - r_{m\acute el}}$
+
+
+%`````````````````````````````````
+\paragraph{Vitesse du son~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$c^2 = \gamma_{m\acute el} \displaystyle\frac{P}{\rho}$
+
+
+%`````````````````````````````````
+\paragraph{Entropie~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$s = \displaystyle\frac{P}{\rho^{\gamma_{m\acute el}}}$
+\quad et
+$\beta = \left.\displaystyle\frac{\partial P}{\partial s}\right)_{\rho}
+= \rho^{\gamma_{m\acute el}}$
+
+
+%`````````````````````````````````
+\paragraph{Pression~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$P = (\gamma_{m\acute el}-1) \rho \varepsilon$
+
+
+%`````````````````````````````````
+\paragraph{Energie interne~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$\varepsilon = {C_v}_{m\acute el}\ T$\qquad\text{\ \ avec\ \ }
+$\varepsilon_{sup} = 0$
+
+
+%`````````````````````````````````
+\paragraph{Enthalpie~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$h = {C_p}_{m\acute el}\ T
+= \displaystyle\frac{\gamma_{m\acute el}}{\gamma_{m\acute el}-1}
+\displaystyle\frac{P}{\rho}$
+
+%---------------------------------
+\subsubsection{Pour un gaz de Van der Waals}
+%---------------------------------
+
+Ces lois n'ont pas �t� programm�es, mais l'utilisateur peut intervenir
+dans le sous-programme utilisateur \fort{uscfth} s'il souhaite le faire.
+
+%`````````````````````````````````
+\paragraph{Equation d'\'etat~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$(P+a\rho^2)(1-b\rho) = \rho r T$
+
+avec $a$ [$Pa.\,m^6 / kg^2$] li\'e aux forces intermol\'eculaires
+et $b$ [$m^3/kg$] le covolume (volume occup\'e par les mol\'ecules).
+
+On suppose connus les coefficients $a$ et $b$,
+la chaleur massique \`a pression constante $C_p$,
+la masse molaire $M$ du gaz et
+les variables d'\'etat.
+
+
+%`````````````````````````````````
+\paragraph{Chaleur massique \`a volume constant~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$C_v = C_p - r
+\displaystyle\frac{P+a\rho^2}{P-a\rho^2 (1-2b\rho)}$
+
+
+%`````````````````````````````````
+\paragraph{Constante ``\'equivalente'' du gaz~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$\hat{\gamma} = 1 + \displaystyle\frac{r}{C_v}
+= \displaystyle\frac{C_p}{C_v}
+\displaystyle\left(\frac{P-a\rho^2 (1-2b\rho)}{P+a\rho^2}\right)
++ \displaystyle\frac{2a\rho^2 (1-b\rho)}{P+a\rho^2}$
+
+%`````````````````````````````````
+\paragraph{Vitesse du son~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$c^2 = \hat{\gamma} \displaystyle\frac{P+a\rho^2}{\rho(1-b\rho)} - 2a\rho$
+
+
+%`````````````````````````````````
+\paragraph{Entropie~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$s = (P+a\rho^2)
+\left(\displaystyle\frac{1-b\rho}{\rho}\right)^{\hat{\gamma}}$
+\quad et
+$\beta = \left.\displaystyle\frac{\partial P}{\partial s}\right)_{\rho}
+= \left(\displaystyle\frac{\rho}{1-b\rho}\right)^{\hat{\gamma}}$
+
+
+%`````````````````````````````````
+\paragraph{Pression~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$P = (\hat{\gamma} -1) \displaystyle\frac{\rho}{(1-b\rho)}
+(\varepsilon + a\rho) - a \rho^2$
+
+%`````````````````````````````````
+\paragraph{Energie interne~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$\varepsilon = C_v T - a \rho$\qquad\text{\ \ avec\ \ }
+$\varepsilon_{sup} = - a \rho$
+
+
+%`````````````````````````````````
+\paragraph{Enthalpie~:}
+%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+$h = \displaystyle\frac{\hat{\gamma}-b\rho}{\hat{\gamma}-1}
+ \displaystyle\frac{P+a\rho^2}{\rho} - 2a\rho$
+
+
+%=================================
+\subsection{Algorithme de base}
+%=================================
+
+On suppose connues toutes les variables au temps $t^n$ et on cherche
+\`a les d\'eterminer \`a l'instant $t^{n+1}$.
+On r\'esout en deux blocs principaux~: d'une part le syst\`eme masse-quantit\'e
+de mouvement, de l'autre l'\'equation portant sur l'\'energie et les scalaires
+transport\'es.
+Dans le premier bloc, on distingue le traitement du syst\`eme (coupl\'e)
+acoustique et le traitement de l'\'equation de la quantit\'e de mouvement
+compl\`ete.
+
+Au d\'ebut du pas de temps, on commence par mettre \`a jour
+les propri\'et\'es physiques variables (par exemple $\mu(T)$, $\kappa(T)$,
+$C_p(Y_1,\ldots ,Y_N)$ ou $\lambda(T)$), puis on
+r\'esout les \'etapes suivantes~:
+
+\begin{enumerate}
+
+ \item {\bf Acoustique~: sous-programme \fort{cfmsvl}} \\
+ R�solution d'une �quation de convection-diffusion portant sur $\rho^{n+1}$.\\
+ On obtient � la fin de l'�tape $\rho^{n+1}$, $Q^{n+1}_{ac}$ et
+�ventuellement une
+pr\'ediction de la pression $P^{pred}(\rho^{n+1},e^{n})$.\\
+
+ \item {\bf Quantit\'e de mouvement~: sous-programme \fort{cfqdmv}}\\
+ R�solution d'une �quation de convection-diffusion portant sur $u^{n+1}$ qui
+ fait intervenir $Q^{n+1}_{ac}$ et $P^{pred}$.\\
+ On obtient � la fin de l'�tape $u^{n+1}$.\\
+
+ \item {\bf \'Energie totale~: sous-programme \fort{cfener}}\\
+ R�solution d'une �quation de convection-diffusion portant sur $e^{n+1}$ qui
+ fait intervenir $Q^{n+1}_{ac}$, $P^{pred}$ et $u^{n+1}$.\\
+ On obtient \`a la fin de l'�tape $e^{n+1}$ et une valeur actualis�e de la
+pression $P(\rho^{n+1},e^{n+1})$.\\
+
+ \item {\bf Scalaires passifs}\\
+ R�solution d'une �quation de convection-diffusion standard par
+ scalaire, avec $Q^{n+1}_{ac}$ pour flux convectif.
+\end{enumerate}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+On se reportera aux sections relatives aux sous-programmes
+\fort{cfmsvl} (masse volumique), \fort{cfqdmv}
+(quantit\'e de mouvement) et \fort{cfener} (\'energie).
+La documentation du sous-programme
+\fort{cfxtcl} fournit des \'el\'ements relatifs aux
+conditions
+aux limites.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Le module compressible est une ``physique particuli\`ere'' activ\'ee lorsque le
+mot-cl\'e \var{IPPMOD(ICOMPF)} est positif ou nul.
+
+Dans ce qui suit, on pr\'ecise les inconnues et les propri\'et\'es
+principales utilis\'ees dans le module.
+On fournit \'egalement un arbre d'appel simplifi\'e des sous-programmes du
+module~: initialisation avec \fort{initi1} puis (\fort{iniva0} et) \fort{inivar} et
+enfin, boucle en temps avec \fort{tridim}.
+
+
+\subsection{Inconnues et propri\'et\'es}
+
+Les \var{NSCAPP} inconnues scalaires associ\'ees \`a la physique
+particuli\`ere sont d\'efinies dans \fort{cfvarp} dans l'ordre
+suivant~:
+\begin{itemize}
+\item la masse volumique \var{RTP(*,ISCA(IRHO(IPHAS)))},
+\item l'�nergie totale \var{RTP(*,ISCA(IENERG(IPHAS)))},
+\item la temp�rature \var{RTP(*,ISCA(ITEMPK(IPHAS)))}
+\end{itemize}
+
+On souligne que la temp\'erature est d\'efinie en tant que variable ``\var{RTP}'' et
+non pas en tant que propri\'et\'e physique ``\var{PROPCE}''. Ce choix a \'et\'e
+motiv\'e par la volont\'e de simplifier la gestion des conditions aux limites,
+au prix cependant d'un encombrement m\'emoire l\'eg\`erement sup\'erieur (une
+grandeur \var{RTP} consomme plus qu'une grandeur \var{PROPCE}).
+
+La pression et la vitesse sont classiquement associ\'ees aux tableaux suivants~:
+\begin{itemize}
+\item pression~: \var{RTP(*,IPR(IPHAS))}
+\item vitesse~: \var{RTP(*,IU(IPHAS))}, \var{RTP(*,IV(IPHAS))}, \var{RTP(*,IW(IPHAS))}.
+\end{itemize}
+
+
+\bigskip
+Outre les propri\'et\'es associ\'ees en standard aux variables
+identifi\'ees ci-dessus, le
+tableau \var{PROPCE} contient \'egalement~:
+ \begin{itemize}
+\item la chaleur massique � volume constant $C_v$, stock\'ee dans
+\var{PROPCE(*,IPPROC(ICV(IPHAS)))},
+ si l'utilisateur a indiqu� dans \fort{uscfth} qu'elle \'etait variable.
+\item la viscosit� en volume \var{PROPCE(*,IPPROC(IVISCV(IPHAS)))}
+ si l'utilisateur a indiqu� dans \fort{uscfx2} qu'elle \'etait variable.
+\end{itemize}
+
+
+\bigskip
+Pour la gestion des conditions aux limites et en particulier pour le calcul du
+flux convectif par le sch\'ema de Rusanov
+aux entr\'ees et sorties (hormis en sortie supersonique), on
+dispose des tableaux suivants dans \var{PROPFB}~:
+\begin{itemize}
+\item flux convectif de quantit\'e de mouvement au bord pour les trois
+composantes dans les tableaux
+\var{PROPFB(*,IPPROB(IFBRHU(IPHAS)))} (composante $x$),
+\var{PROPFB(*,IPPROB(IFBRHV(IPHAS)))} (composante $y$) et
+\var{PROPFB(*,IPPROB(IFBRHW(IPHAS)))} (composante $z$)
+\item flux convectif d'\'energie au bord
+\var{PROPFB(*,IPPROB(IFBENE(IPHAS)))}
+\end{itemize}
+et on dispose \'egalement dans \var{IA}~:
+\begin{itemize}
+\item d'un tableau d'entiers dont la premi\`ere ``case'' est \var{IA(IIFBRU)}, dimensionn\'e au nombre de faces de bord
+et permettant de rep\'erer les faces de bord pour lesquelles on calcule
+le flux convectif par le sch\'ema de Rusanov,
+\item d'un tableau d'entiers dont la premi\`ere ``case'' est \var{IA(IIFBET)}, dimensionn\'e au nombre de faces de bord
+et permettant de rep\'erer les faces de paroi \`a temp\'erature ou \`a flux
+thermique impos\'e.
+\end{itemize}
+
+
+
+\newpage
+
+\subsection{Arbre d'appel simplifi\'e}
+\nopagebreak
+\begin{table}[h!]
+\begin{center}
+\begin{tabular}{lllllp{8cm}}
+\fort{usini1} & & & &
+ & Initialisation des mots-cl\'es utilisateur g\'en\'eraux et positionnement des variables\\
+ &\fort{usppmo} & & &
+ & D\'efinition du module ``physique particuli\`ere'' employ\'e\\
+ &\fort{varpos} & & &
+ & Positionnement des variables \\
+ & & \fort{pplecd} & &
+ & Branchement des physiques particuli\`eres pour la lecture du fichier de donn\'ees \'eventuel \\
+ & & \fort{ppvarp} & &
+ & Branchement des physiques particuli\`eres pour le positionnement des inconnues \\
+ & & & \fort{cfvarp} &
+ & Positionnement des inconnues sp\'ecifiques au module compressible \\
+ & & & & \fort{uscfth}
+ & Appel� avec ICCFTH=-1, pour indiquer que $C_p$ et $C_v$ sont constants ou variables\\
+ & & & & \fort{uscfx2}
+ & Conductivit� thermique mol\'eculaire constante ou variable et viscosit� en volume
+ constante ou variable (ainsi que leur valeur, si elles sont constantes)\\
+ & & \fort{ppprop} & &
+ & Branchement des physiques particuli\`eres pour le positionnement des propri\'et\'es\\
+ & & & \fort{cfprop} &
+ & Positionnement des propri\'et\'es sp\'ecifiques au module compressible \\
+%
+\fort{ppini1} & & & &
+ & Branchement des physiques particuli\`eres pour l'initialisation des
+mots-cl\'es sp\'ecifiques \\
+ &\fort{cfini1} & & &
+ & Initialisation des mots-cl\'es sp\'ecifiques au module compressible\\
+ &\fort{uscfi1} & & &
+ & Initialisation des mots-cl\'es utilisateur sp\'ecifiques au module compressible\\
+\end{tabular}
+\caption{Sous-programme \fort{initi1}~: initialisation des mots-cl\'es et
+positionnement des variables}
+\end{center}
+\end{table}
+
+\newpage
+
+\begin{table}[h!]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{ppiniv} & & &
+ & Branchement des physiques particuli\`eres pour l'initialisation des variables \\
+ & \fort{cfiniv} & &
+ & Initialisation des variables sp\'ecifiques au module compressible \\
+ & & \fort{memcfv} &
+ & R\'eservation de tableaux de travail locaux \\
+ & & \fort{uscfth} &
+ & Initialisation des variables par d�faut (en calcul suite~: seulement
+$C_v$~; si le calcul n'est pas une suite~: $C_v$, la masse volumique et l'\'energie) \\
+ & & \fort{uscfxi} &
+ & Initialisation des variables par l'utilisateur (seulement si le calcul
+n'est pas une suite) \\
+\end{tabular}
+\caption{Sous-programme \fort{inivar}~: initialisation des variables}
+\end{center}
+\end{table}
+
+
+\begin{table}[h!]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{phyvar} & & &
+ & Calcul des propri\'et\'es physiques variables \\
+ & \fort{ppphyv} & &
+ & Branchement des physiques particuli\`eres pour le calcul des
+ propri\'et\'es physiques variables \\
+ & & \fort{cfphyv} &
+ & Calcul des propri\'et\'es physiques variables pour le module
+ compressible \\
+ & & & \fort{uscfpv}
+ & Calcul par l'utilisateur des propri\'et\'es physiques variables pour
+ le module
+ compressible ($C_v$ est calcul\'e dans \fort{uscfth} qui est
+ appel\'e par \fort{uscfpv}) \\
+\end{tabular}
+\caption{Sous-programme \fort{tridim}~: partie 1 (propri\'et\'es physiques)}
+\end{center}
+\end{table}
+
+\newpage
+
+\begin{table}[h!]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{dttvar} & & &
+ & Calcul du pas de temps variable \\
+ & \fort{cfdttv} & &
+ & Calcul de la contrainte li�e au CFL en compressible \\
+ & &\fort{memcft} &
+ & Gestion de la m\'emoire pour le calcul de la contrainte en CFL \\
+ & &\fort{cfmsfl} &
+ & Calcul du flux associ\'e \`a la contrainte en CFL \\
+
+\fort{precli} & & &
+ & Initialisation des tableaux avant calcul des conditions aux
+ limites (\var{IITYPF}, \var{ICODCL}, \var{RCODCL})\\
+ & \fort{ppprcl} & &
+ & Initialisations sp\'ecifiques aux diff\'erentes physiques
+ particuli\`eres avant calcul des conditions aux limites
+ (pour le module compressible~: \var{IZFPPP}, \var{IA(IIFBRU)},
+ \var{IA(IIFBET)}, \var{RCODCL}, flux convectifs pour la
+ quantit\'e de mouvement et l'\'energie)\\
+
+\fort{ppclim} & & &
+ & Branchement des physiques particuli\`eres pour les conditions aux limites (en lieu et place de \fort{usclim})\\
+ & \fort{uscfcl} & &
+ & Intervention de l'utilisateur pour les conditions aux limites (en lieu
+ et place de \fort{usclim}, m\^eme pour les variables qui ne sont
+ pas sp\'ecifiques au module compressible) \\
+
+\fort{condli} & & &
+ & Traitement des conditions aux limites\\
+ & \fort{pptycl} & &
+ & Branchement des physiques particuli\`eres pour le traitement des conditions aux limites \\
+ & &\fort{cfxtcl} &
+ & Traitement des conditions aux limites pour le compressible \\
+ & & &\fort{uscfth}
+ & Calculs de thermodynamique pour le calcul des conditions aux limites \\
+ & & &\fort{cfrusb}
+ & Flux de Rusanov (entr\'ees ou sorties sauf sortie supersonique) \\
+\end{tabular}
+\caption{Sous-programme \fort{tridim}~: partie 2 (pas de temps variable et conditions
+ aux limites)}
+\end{center}
+\end{table}
+
+\newpage
+
+\begin{table}[h!]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{memcfm} & & &
+ & Gestion de la m\'emoire pour la r\'esolution de l'\'etape ``acoustique'' \\
+\fort{cfmsvl} & & &
+ & R\'esolution de l'�tape ``acoustique'' \\
+ & \fort{cfmsfl} & &
+ & Calcul du "flux de masse" aux faces
+ (not\'e $\rho\,\vect{w}\cdot\vect{n}\,S$ dans la documentation
+ du sous-programme \fort{cfmsvl}) \\
+ & & \fort{cfdivs}&
+ & Calcul du terme en divergence du tenseur des contraintes visqueuses
+ (trois appels), �ventuellement \\
+ & & &
+ & Apr\`es \fort{cfmsfl}, on impose le flux de masse aux faces de bord
+ \`a partir des conditions aux limites \\
+ & \fort{cfmsvs} & &
+ & Calcul de la "viscosit�" aux faces
+ (not\'ee $\Delta\,t\,c^2\frac{S}{d}$ dans la documentation
+ du sous-programme \fort{cfmsvl}) \\
+ & & &
+ & Apr\`es \fort{cfmsvs}, on annule la viscosit\'e aux faces de bord
+ pour que le flux de masse soit bien celui souhait\'e \\
+ & \fort{codits} & &
+ & R\'esolution du syst\`eme portant sur la masse volumique \\
+ & \fort{clpsca} & &
+ & Impression des bornes et clipping \'eventuel (pas de clipping en standard) \\
+ & \fort{uscfth} & &
+ & Gestion \'eventuelle des bornes par l'utilisateur \\
+ & \fort{cfbsc3} & &
+ & Calcul du flux de masse acoustique aux faces
+ (not\'e $\vect{Q}_{ac}\cdot\vect{n}$ dans la documentation
+ du sous-programme \fort{cfmsvl}) \\
+ & \fort{uscfth} & &
+ & Actualisation de la pression, �ventuellement \\
+\fort{cfqdmv} & & &
+ & R\'esolution de la quantit� de mouvement\\
+ & \fort{cfcdts} & &
+ & R�solution du syst\`eme\\
+ & & \fort{cfbsc2}&
+ & Calcul des termes de convection et de diffusion au second membre\\
+\end{tabular}
+\caption{Sous-programme \fort{tridim}~: partie 3 (Navier-Stokes)}
+\end{center}
+\end{table}
+
+\newpage
+
+\begin{table}[h!]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{scalai} & & &
+ & R\'esolution des \'equations sur les scalaires \\
+ & \fort{cfener} & &
+ & R\'esolution de l'�quation sur l'�nergie totale\\
+ & & \fort{memcfe}&
+ & Gestion de la m\'emoire locale\\
+ & & \fort{cfdivs}&
+ & Calcul du terme en divergence du produit
+ ``tenseur des contraintes par vitesse''\\
+ & & \fort{uscfth}&
+ & Calcul de l'\'ecart ``\'energie interne - $C_v\,T$''
+ ($\varepsilon_{sup}$)\\
+ & & \fort{cfcdts}&
+ & R�solution du syst\`eme\\
+ & & &\fort{cfbsc2}
+ & Calcul des termes de convection et de diffusion au second membre\\
+ & & \fort{clpsca}&
+ & Impression des bornes et clipping \'eventuel (pas de clipping en standard) \\
+ & & \fort{uscfth}&
+ & Gestion \'eventuelle des bornes par l'utilisateur \\
+ & & \fort{uscfth}&
+ & Mise \`a jour de la pression \\
+\end{tabular}
+\caption{Sous-programme \fort{tridim}~: partie 4 (scalaires)}
+\end{center}
+\end{table}
+
+%\newpage
+
+Le sous-programme \fort{cfbsc3} est similaire \`a \fort{bilsc2}, mais il produit
+des flux aux faces et n'est \'ecrit que pour un sch\'ema upwind, \`a l'ordre 1
+en temps (ce qui est coh\'erent avec les choix faits dans l'algorithme compressible).
+
+Le sous-programme \fort{cfbsc2} est similaire \`a \fort{bilsc2}, mais
+n'est \'ecrit que pour un sch\'ema d'ordre 1 en
+temps.
+%et fait encore appara\^itre la variable IITURB au lieu de IITYTU (il
+%faudrait corriger ce dernier point).
+Le sous-programme \fort{cfbsc2} permet d'effectuer un traitement
+sp\'ecifique aux faces de bord pour lesquelles on a appliqu\'e
+un sch\'ema de Rusanov pour calculer le flux convectif total.
+Ce sous-programme est appel\'e pour la r\'esolution de l'\'equation de
+la quantit\'e de mouvement et de l'\'equation de l'\'energie.
+On pourra se reporter \`a la documentation du sous-programme \fort{cfxtcl}.
+
+Le sous-programme \fort{cfcdts} est similaire \`a \fort{codits} mais fait appel
+\`a \fort{cfbsc2} et non pas \`a \fort{bilsc2}.
+Il diff\`ere de \fort{codits} par quelques autres d\'etails qui ne sont pas
+g\^enants dans l'imm\'ediat~:
+initialisation de PVARA et de SMBINI,
+%nombre d'it\'erations pour le second membre (NSWRSM-1 au lieu de NSWRSM),
+%mode de d\'etermination du solveur (IRESLP),
+%test de convergence sur RNORM (compar\'e \`a 0.D0 au lieu de EPZERO),
+ordre en temps (ordre 2 non pris en compte).
+%Mis \`a part pour l'ordre en temps (l'algorithme
+%compressible est \`a l'ordre 1), il serait bon de modifier \fort{cfcdts} pour
+%qu'il soit conforme \`a \fort{codits}.
+
+\newpage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Des actions compl\'ementaires sont identifi\'ees ci-apr\`es, dans l'ordre
+d'urgence d\'ecroissante (on se reportera
+\'egalement \`a la section "Points \`a traiter" de la documentation
+des autres sous-programmes du module compressible).
+
+\begin{itemize}
+\item Assurer la coh\'erence des sous-programmes suivants (ou, \'eventuellement,
+les fusionner pour \'eviter qu'ils ne divergent)~:
+ \begin{itemize}
+ \item \fort{cfcdts} et \fort{codits},
+%(actuellement pour PVARA et
+% SMBINI, mais \`a plus long terme pour \'eviter que les
+% deux sous-programmes ne divergent),
+% propose en patch 1.2.1
+% \item \fort{cfcdts} et \fort{codits}
+% (au moins pour PVARA, SMBINI, NSWRSM,
+% IRESLP, RNORM),
+ \item \fort{cfbsc2} et \fort{bilsc2},
+ \item \fort{cfbsc3} et \fort{bilsc2}.
+ \end{itemize}
+% propose en patch 1.2.1
+% \item Remplacer la valeur 100 par 90 pour ICCFTH dans \fort{uscfth}
+% (plus grande coh\'erence avec les choix faits dans le reste de ce
+% sous-programme).
+% propose en patch 1.2.1
+% \item \'Eliminer \fort{memcff} qui ne sert plus.
+\item Permettre les suites de calcul incompressible/compressible et
+ compressible/incompressible.
+\item Apporter un compl\'ement de validation (exemple~: IPHYDR).
+\item Assurer la compatibilit\'e avec certaines physiques particuli\`eres, selon
+ les besoins. Par exemple~: arc \'electrique, rayonnement, combustion.
+\item Identifier les causes des difficult\'es rencontr\'ees sur certains cas
+acad\'emiques, en particulier~:
+ \begin{itemize}
+ \item canal subsonique (comment s'affranchir des effets ind\'esirables
+ associ\'es aux conditions d'entr\'ee et de sortie, comment r\'ealiser un
+ calcul p\'eriodique, en particulier pour la temp\'erature dont le
+ gradient dans la direction de l'\'ecoulement n'est pas nul, si
+ les parois sont adiabatiques),
+ \item cavit\'e ferm\'ee sans vitesse ni effets de gravit\'e,
+ avec temp\'erature ou flux thermique impos\'e en paroi (il pourrait
+ \^etre utile d'extrapoler le gradient de pression au bord~:
+ la pression d\'epend de la temp\'erature et une simple condition de
+ Neumann homog\`ene est susceptible de cr\'eer un terme source de
+ quantit\'e de mouvement parasite),
+ \item maillage non conforme (non conformit\'e dans la direction
+ transverse d'un canal),
+ \item ``tube � choc'' avec terme source d'�nergie.
+ \end{itemize}
+\item Compl\'eter certains points de documentation, en particulier les
+ conditions aux limites thermiques pour le couplage avec \syrthes.
+\item Am\'eliorer la rapidit\'e \`a faible nombre de Mach (est-il
+possible de lever la limite
+actuelle sur la valeur du pas de temps~?).
+\item Enrichir, au besoin~:
+ \begin{itemize}
+ \item les thermodynamiques prises en compte (multiconstituant,
+ gamma variable, Van der Waals...),
+ \item la gamme des conditions aux limites d'entr\'ee
+ disponibles (condition \`a d\'ebit massique et d\'ebit enthalpique
+ impos\'es par exemple).
+ \end{itemize}
+\item Tester des variantes de l'algorithme~:
+ \begin{itemize}
+ \item prise en compte des termes sources de l'\'equation de la
+ quantit\'e de mouvement autres que la gravit\'e dans l'\'equation de la
+ masse r\'esolue lors de l'\'etape ``acoustique'' (les tests r\'ealis\'es
+ avec cette variante de l'algorithme devront \^etre repris dans la
+ mesure o\`u, dans \fort{cfmsfl}, IIROM et IIROMB n'\'etaient pas
+ initialis\'es),
+ \item implicitation du terme de convection dans
+ l'\'equation de la masse (\'eliminer cette possibilit\'e si
+ elle n'apporte rien),
+ \item \'etape de pr\'ediction de la pression,
+ \item non reconstruction de la masse volumique pour le terme convectif
+ (actuellement, les termes convectifs sont trait\'es avec
+ d\'ecentrement amont, d'ordre 1 en espace~;
+ pour l'\'equation de la quantit\'e de mouvement et l'\'equation de
+ l'\'energie, on utilise les valeurs prises au centre des cellules
+ sans reconstruction~: c'est l'approche standard de \CS, traduite
+ dans \fort{cfbsc2}~; par contre, dans \fort{cfmsvl}, on reconstruit
+ les valeurs de la masse volumique utilis\'ees pour le terme
+ convectif~; il n'y a pas de raison d'adopter des strat\'egies
+ diff\'erentes, d'autant plus que la reconstruction de la masse
+ volumique ne permet pas de monter en ordre et augmente le risque
+ de d\'epassement des bornes physiques),
+ \item mont\'ee en ordre en espace (en v\'erifier l'utilit\'e et
+ la robustesse, en particulier relativement au principe du
+ maximum pour la masse volumique),
+ \item mont\'ee en ordre en temps (en v\'erifier l'utilit\'e et
+ la robustesse).
+ \end{itemize}
+\item Optimiser l'encombrement m\'emoire.
+\end{itemize}
+
diff --git a/doc/theory/cfener.tex b/doc/theory/cfener.tex
new file mode 100644
index 0000000..0392640
--- /dev/null
+++ b/doc/theory/cfener.tex
@@ -0,0 +1,427 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{cfener}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Pour les notations et l'algorithme dans son ensemble,
+on se reportera \`a \fort{cfbase}.
+
+Apr\`es masse (acoustique) et quantit\'e de mouvement,
+on consid\`ere un dernier pas fractionnaire (de $t^{**}$ \`a $t^{***}$)
+au cours duquel seule varie l'\'energie totale $E = \rho e$.
+
+\begin{equation}\label{Cfbl_Cfener_eq_energie_cfener}
+\left\{\begin{array}{l}
+\rho^{***}=\rho^{**}=\rho^{n+1}\\
+\\
+\vect{Q}^{***}=\vect{Q}^{**}=\vect{Q}^{n+1}\\
+\\
+\displaystyle\frac{\partial \rho e}{\partial t}
++ \divs\left( \vect{Q}_{ac} \left(e+\displaystyle\frac{P}{\rho}\right) \right)
+= \rho\vect{f}_v\cdot\vect{u}
++ \divs(\tens{\Sigma}^v \vect{u})
+- \divs{\,\vect{\Phi}_s} + \rho\Phi_v
+\end{array}\right.
+\end{equation}
+
+Pour conserver la positivit\'e de l'\'energie, il est indispensable ici,
+comme pour les scalaires, d'utiliser le flux de masse convectif acoustique
+$\vect{Q}_{ac}^{n+1}$ compatible avec l'\'equation de la masse.
+De plus, pour obtenir des propri\'et\'es de positivit\'e sur les scalaires,
+un sch\'ema upwind pour le terme convectif doit \^etre utilis\'e
+(mais les termes sources introduisent des contraintes suppl\'ementaires
+qui peuvent \^etre pr\'epond\'erantes et g\^enantes).
+
+\vspace{0.5cm}
+
+\`A la fin de cette \'etape, on actualise �ventuellement
+(mais par d�faut non)
+une deuxi\`eme et derni\`ere fois la pression
+en utilisant la loi d'\'etat pour obtenir la pression finale~:
+\begin{equation}
+\displaystyle P^{n+1}=P(\rho^{n+1},\varepsilon^{n+1})
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%---------------------------------
+\subsection{Discr\'etisation en temps}
+%---------------------------------
+
+La mod\'elisation des flux de chaleur choisie jusqu'\`a pr\'esent est de la
+forme $-\divs(\,\vect{\Phi}_s) = \divs(\lambda \gradv{T})$.
+
+Pour faire appara\^itre un terme diffusif stabilisant dans la
+matrice de r\'esolution, on cherche \`a exprimer le flux diffusif de chaleur
+($-\divs(\,\vect{\Phi}_s)$)
+en fonction de la variable r\'esolue (l'\'energie totale).
+
+Avec $\varepsilon_{sup}(P,\rho)$
+d\'ependant de la loi d'\'etat, on exprime l'\'energie totale de la fa\c con suivante~:
+\begin{equation}
+e = \varepsilon + \frac{1}{2} u^2
+= (C_v T + \varepsilon_{sup}) + \frac{1}{2} u^2
+\end{equation}
+
+En supposant $C_v$ constant\footnote{Pour $C_v$ non constant, les
+d\'eveloppements restent \`a faire~: on pourra se
+reporter \`a P. Mathon, F. Archambeau, J.-M. H�rard : "Implantation d'un
+algorithme compressible dans \CS", HI-83/03/016/A}, on a alors~:
+\begin{equation}\label{Cfbl_Cfener_eq_flux_thermique_cfener}
+-\divs(\,\vect{\Phi}_s)
+= \divs(K \gradv(e - \frac{1}{2} u^2 - \varepsilon_{sup}))\qquad
+\text{avec } K=\lambda / C_v
+\end{equation}
+
+Lorsqu'un mod\`ele de turbulence est activ\'e, on conserve la m\^eme forme
+de mod\'elisation pour les flux thermiques et $K$ int\`egre alors
+la diffusivit\'e turbulente. On pourra se reporter \`a
+la documentation de \fort{cfxtcl} \`a ce sujet.
+
+Avec la formulation~(\ref{Cfbl_Cfener_eq_flux_thermique_cfener}),
+on peut donc impliciter le terme en $\gradv{e}$.
+
+\bigskip
+De plus, puisque la vitesse a
+d\'ej\`a \'et\'e r\'esolue, on implicite \'egalement le terme en
+$\gradv{\frac{1}{2} u^2}$. L'exposant $n+\frac{1}{2}$ de $\varepsilon_{sup}$
+indique que l'implicitation de ce terme est partielle (elle d\'epend de la forme
+de la loi d'\'etat).
+
+Par ailleurs, on implicite le terme de convection, le terme de puissance
+des forces volumiques, �ventuellement le terme de puissance des forces de
+pression (suivant la valeur de \var{IGRDPP}, on utilise la pr\'ediction de
+pression obtenue apr\`es r\'esolution de l'\'equation portant sur la masse
+volumique ou bien la pression du pas de temps pr�c�dent)
+et le terme de puissance des forces visqueuses. On implicite le terme de puissance
+volumique en utilisant $\rho^{n+1}$.
+
+\bigskip
+On obtient alors l'\'equation discr\`ete portant sur $e$~:
+\begin{equation}\label{Cfbl_Cfener_eq_energie_totale_cfener}
+\begin{array}{l}
+\displaystyle\frac{(\rho e)^{n+1} - (\rho e)^n}{\Delta t^n}
++ \divs(\vect{Q}_{ac}^{n+1} e^{n+1}) - \divs(K^n \gradv{e^{n+1}})
+= \rho^{n+1} \vect{f}_v \cdot \vect{u}^{n+1}
+- \divs(\vect{Q}_{ac}^{n+1} \displaystyle\frac{\widetilde{P}}{\rho^{n+1}} )\\
+\text{\ \ \ \ }+ \divs((\tens{\Sigma}^v)^{n+1} \vect{u}^{n+1})
+- \divs(K^n \gradv(\frac{1}{2} (u^2)^{n+1}
++ \varepsilon_{sup}^{n+\frac{1}{2}}))
++ \rho^{n+1}\Phi_v\\
+\end{array}
+\end{equation}
+avec $\widetilde{P}=P^{Pred}\text{ ou }P^n$ suivant la valeur de \var{IGRDPP}
+($P^n$ par d�faut).
+
+En pratique, dans \CS, on r\'esout cette \'equation en faisant appara\^itre \`a
+gauche l'\'ecart $e^{n+1} - e^n$. Pour cela, on \'ecrit la d\'eriv\'ee
+en temps discr\`ete sous la forme suivante~:
+
+\begin{equation}
+\begin{array}{ll}
+\displaystyle
+\frac{(\rho e)^{n+1} - (\rho e)^n}{\Delta t^n}
+& =
+\displaystyle
+\frac{\rho^{n+1}\, e^{n+1} - \rho^n\, e^n}{\Delta t^n}\\
+& =
+\displaystyle
+\frac{\rho^{n}\, e^{n+1} - \rho^n\, e^n}{\Delta t^n}+
+\frac{\rho^{n+1}\, e^{n+1} - \rho^n\, e^{n+1}}{\Delta t^n}\\
+& =
+\displaystyle
+\frac{\rho^{n}}{\Delta t^n}\left(e^{n+1} - e^n\right)+
+e^{n+1}\frac{\rho^{n+1} - \rho^n}{\Delta t^n}
+\end{array}
+\end{equation}
+
+et l'on utilise l'\'equation de la masse discr\`ete pour \'ecrire~:
+\begin{equation}
+\displaystyle
+\frac{(\rho e)^{n+1} - (\rho e)^n}{\Delta t^n}
+=
+\frac{\rho^{n}}{\Delta t^n}\left(e^{n+1} - e^n\right)-
+e^{n+1}\dive\,\vect{Q}_{ac}^{n+1}
+\end{equation}
+
+
+
+%---------------------------------
+\subsection{Discr\'etisation en espace}
+%---------------------------------
+
+
+%.................................
+\subsubsection{Introduction}
+%.................................
+
+On int\`egre l'\'equation (\ref{Cfbl_Cfener_eq_energie_totale_cfener})
+sur la cellule $i$ de volume $\Omega_i$ et l'on proc\`ede comme
+pour l'\'equation de la masse et de la quantit\'e de mouvement.
+
+On obtient alors l'\'equation discr\`ete
+suivante~:
+\begin{equation}\label{Cfbl_Cfener_eq_energie_totale_discrete_cfener}
+\begin{array}{l}
+\displaystyle\frac{\Omega_i}{\Delta t^n}
+(\rho_i^{n+1} e_i^{n+1}-\rho_i^n e_i^n)
++ \displaystyle\sum\limits_{j\in V(i)}
+\left(e^{n+1} \vect{Q}_{ac}^{n+1}\right)_{ij} \cdot \vect{S}_{ij}
+- \displaystyle\sum\limits_{j\in V(i)}
+\left(K^n\gradv(e^{n+1})\right)_{ij}\cdot\vect{S}_{ij}\\
+\\
+\text{\ \ \ \ } = \Omega_i\rho_i^{n+1} {\vect{f}_v}_i \cdot \vect{u}_i^{n+1}
+- \displaystyle\sum\limits_{j\in V(i)}
+\left(\displaystyle\frac{P^{Pred}}{\rho^{n+1}}\
+\vect{Q}_{ac}^{n+1}\right)_{ij} \cdot \vect{S}_{ij}
++ \displaystyle\sum\limits_{j\in V(i)}
+\left((\tens{\Sigma}^v)^{n+1} \vect{u}^{n+1} \right)_{ij}\cdot \vect{S}_{ij}\\
+\\
+\text{\ \ \ \ } - \displaystyle\sum\limits_{j\in V(i)}
+\left(K^n \gradv\left(\frac{1}{2}(u^2)^{n+1}
++ \varepsilon_{sup}^{n+\frac{1}{2}}\right)\right)_{ij}\cdot\vect{S}_{ij}
++ \Omega_i\rho_i^{n+1}{\Phi_v}_i\\
+\end{array}
+\end{equation}
+
+
+%.................................
+\subsubsection{Discr\'etisation de la partie ``convective''}
+%.................................
+
+La valeur \`a la face s'\'ecrit~:
+\begin{equation}
+\left(e^{n+1} \vect{Q}_{ac}^{n+1}\right)_{ij} \cdot \vect{S}_{ij}
+= e_{ij}^{n+1}(\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij}
+\end{equation}
+avec un d\'ecentrement sur la valeur de $e^{n+1}$ aux faces~:
+\begin{equation}
+\begin{array}{lllll}
+e_{ij}^{n+1}
+& = & e_i^{n+1}
+& \text{si\ } & (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} \geqslant 0 \\
+& = & e_j^{n+1}
+& \text{si\ } & (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} < 0 \\
+\end{array}
+\end{equation}
+que l'on peut noter~:
+\begin{equation}
+ e_{ij}^{n+1}
+ = \beta_{ij}e_i^{n+1} + (1-\beta_{ij})e_j^{n+1}
+\end{equation}
+avec
+\begin{equation}
+\left\{\begin{array}{lll}
+\beta_{ij} = 1 & \text{si\ }
+& (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} \geqslant 0 \\
+\beta_{ij} = 0 & \text{si\ }
+& (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} < 0 \\
+\end{array}\right.
+\end{equation}
+
+
+%.................................
+\subsubsection{Discr\'etisation de la partie ``diffusive''}
+%.................................
+
+La valeur \`a la face s'\'ecrit~:
+\begin{equation}
+\begin{array}{c}
+\left(K^n\gradv(e^{n+1})\right)_{ij}\cdot\vect{S}_{ij}
+= K_{ij}^n
+\displaystyle \left( \frac{\partial e}{\partial n} \right)^{n+1}_{ij}S_{ij}\\
+\text{et}\\
+\left(K^n \gradv\left(\frac{1}{2}(u^2)^{n+1}
++ \varepsilon_{sup}^{n+\frac{1}{2}}\right)\right)_{ij}\cdot\vect{S}_{ij}
+= K_{ij}^n
+\displaystyle \left( \frac{\partial \left(\frac{1}{2} u^2
++ \varepsilon_{sup}\right)}{\partial n} \right)^{n+\frac{1}{2}}_{ij}S_{ij}
+\end{array}
+\end{equation}
+avec une interpolation lin\'eaire pour
+$K^n$ aux faces (et en pratique, $\alpha_{ij}=\frac{1}{2}$)~:
+\begin{equation}
+K_{ij}^n
+= \alpha_{ij}K_{i}^n+(1-\alpha_{ij})K_{j}^n
+\end{equation}
+et un sch\'ema centr\'e avec reconstruction pour le gradient normal aux faces~:
+\begin{equation}
+\displaystyle \left( \frac{\partial e}{\partial n} \right)^{n+1}_{ij}
+= \displaystyle\frac{e_{J'}^{n+1} - e_{I'}^{n+1}}{\overline{I'J'}}
+\quad \text{et} \quad
+\displaystyle \left( \frac{\partial \left(\frac{1}{2} u^2
++ \varepsilon_{sup}\right)}{\partial n} \right)^{n+\frac{1}{2}}_{ij}
+= \displaystyle\frac{(\frac{1}{2} u^2
++ \varepsilon_{sup})_{J'}^{n+\frac{1}{2}} - (\frac{1}{2} u^2
++ \varepsilon_{sup})_{I'}^{n+\frac{1}{2}}}{\overline{I'J'}}
+\end{equation}
+
+
+
+%.................................
+\subsubsection{Discr\'etisation de la puissance des forces de pression}
+%.................................
+
+Ce terme
+est issu du terme convectif, on le discr\'etise donc de la m\^eme fa\c con.
+
+\begin{equation}
+\left(\displaystyle\frac{\widetilde{P}}{\rho^{n+1}}\
+\vect{Q}_{ac}^{n+1}\right)_{ij} \cdot \vect{S}_{ij}
+= \left(\displaystyle\frac{\widetilde{P}}{\rho^{n+1}}\right)_{ij}
+(\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij}
+\end{equation}
+
+avec un d\'ecentrement sur la valeur de
+$\displaystyle\frac{P}{\rho}$ aux faces~:
+\begin{equation}
+\begin{array}{lll}
+\left(\displaystyle\frac{\widetilde{P}}{\rho^{n+1}}\right)_{ij}
+ = \beta_{ij}\displaystyle\frac{\widetilde{P}_i}{\rho^{n+1}_i}
++ (1-\beta_{ij})\displaystyle\frac{\widetilde{P}_j}{\rho^{n+1}_j}
+& \text{avec}
+& \left\{\begin{array}{lll}
+\beta_{ij} = 1 & \text{si\ }
+& (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} \geqslant 0 \\
+\beta_{ij} = 0 & \text{si\ }
+& (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} < 0 \\
+\end{array}\right.
+\end{array}
+\end{equation}
+
+
+
+%.................................
+\subsubsection{Discr\'etisation de la puissance des forces visqueuses}
+%.................................
+
+On calcule les termes dans les cellules puis on utilise une
+interpolation lin\'eaire (on utilise
+$\alpha_{ij}=\frac{1}{2}$ dans la relation ci-dessous)~:
+\begin{equation}
+\left((\tens{\Sigma}^v)^{n+1} \vect{u}^{n+1} \right)_{ij}\cdot \vect{S}_{ij}
+= \left\{\alpha_{ij} \left((\tens{\Sigma}^v)^{n+1} \vect{u}^{n+1}\right)_i
++ (1-\alpha_{ij}) \left((\tens{\Sigma}^v)^{n+1} \vect{u}^{n+1}\right)_j
+\right\} \cdot \vect{S}_{ij}
+\end{equation}
+
+
+%.................................
+\subsubsection{Remarques}
+%.................................
+
+
+Les termes ``convectifs'' associ\'es \`a
+$\displaystyle\dive\left(\left(e^{n+1}+\frac{\widetilde{P}}{\rho^{n+1}}\right)\,
+\vect{Q}_{ac}^{n+1}\right)$ sont calcul\'es avec un d\'ecentrement amont
+(consistant, d'ordre 1 en espace). Les valeurs utilis\'ees sont bien prises au
+centre de la cellule amont ($e_i$, $P_i$, $\rho_i$) et non pas au projet\'e $I'$
+du centre de la cellule sur la normale \`a la face passant par son centre de
+gravit\'e (sur un cas test en triangles, l'utilisation de $P_I'$ et de $\rho_I'$
+pour le terme de transport de pression a conduit \`a un r\'esultat
+insatisfaisant, mais des corrections ont \'et\'e apport\'ees aux sources depuis
+et il serait utile de v\'erifier que cette conclusion n'est pas remise en question).
+
+Les termes diffusifs associ\'es \`a
+$\displaystyle\dive\left(K\,\grad\left(e+\frac{1}{2} u^2 +
+\varepsilon_{sup}\right)\right)$ sont calcul\'es en utilisant des valeurs aux
+faces reconstruites pour s'assurer de la consistance du sch\'ema.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+Apr\`es une \'etape de gestion de la m\'emoire (\fort{memcfe}), on calcule les
+diff\'erents termes sources (au centre des cellules)~:
+\begin{itemize}
+\item source volumique de chaleur (\fort{ustssc}),
+\item source associ\'ee aux sources de masse (\fort{catsma}),
+\item source associ\'ee \`a l'accumulation de masse $\dive\,\vect{Q}_{ac}$ (directement dans \fort{cfener}),
+\item dissipation visqueuse (\fort{cfdivs}),
+\item transport de pression (directement dans \fort{cfener}),
+\item puissance de la pesanteur (directement dans \fort{cfener}),
+\item termes diffusifs en $\displaystyle\dive\left(K\,\grad\left(\frac{1}{2} u^2 +
+\varepsilon_{sup}\right)\right)$ (calcul de $\varepsilon_{sup}$ par
+\fort{uscfth}, puis calcul du terme diffusif directement dans \fort{cfener}).
+\end{itemize}
+
+\bigskip
+Le syst\`eme (\ref{Cfbl_Cfener_eq_energie_totale_discrete_cfener}) est r\'esolu par une m\'ethode
+d'incr\'ement et r\'esidu en utilisant une m\'ethode de Jacobi (\fort{cfcdts}).
+
+L'impression des bornes et
+la limitation \'eventuelle de l'\'energie sont ensuite effectu\'ees par
+\fort{clpsca} suivi de \fort{uscfth} (intervention utilisateur optionnelle).
+
+On actualise enfin la pression et on calcule la
+temp\'erature (\fort{uscfth}).
+
+Pour
+terminer, en parall\`ele ou en p\'eriodique, on \'echange les variables
+pression, \'energie et temp\'erature.
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% propose en patch 1.2.1
+
+%Corriger \fort{cfener} dans lequel \var{W1} produit par \fort{uscfth} est
+%\'ecras\'e par \fort{grdcel}, causant probablement des d\'eg\^ats
+%dans les cas o\`u le gradient de l'\'energie cin\'etique dans la direction $x$
+%est sensiblement non nul sur des faces de bord dont la normale a une
+%composante en $x$ et lorsque la conductivit\'e n'est pas n\'egligeable.
+
+
+\etape{Choix de $\widetilde{P}$}
+En standard, on utilise $\widetilde{P}=P^n$, mais ce n'est pas le seul choix
+possible. On pourrait �tudier le comportement de l'algorithme avec $P^{Pred}$ et
+$P^{n+1}$ (avec $P^{n+1}$, en particulier,
+$\displaystyle\frac{\widetilde{P}}{\rho^{n+1}}$
+est �valu� avec la masse volumique et l'�nergie prises au m�me instant).
+
+\etape{Terme source dans l'�quation de l'�nergie}
+La pr�sence d'un terme source externe dans l'�quation de l'�nergie g�n�re des
+oscillations de vitesse qu'il est important d'analyser et de comprendre.
diff --git a/doc/theory/cfmsvl.tex b/doc/theory/cfmsvl.tex
new file mode 100644
index 0000000..9b5e343
--- /dev/null
+++ b/doc/theory/cfmsvl.tex
@@ -0,0 +1,420 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{cfmsvl}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Pour les notations et l'algorithme dans son ensemble,
+on se reportera \`a \fort{cfbase}.
+
+On consid\`ere un premier pas fractionnaire au cours duquel l'\'energie totale
+est fixe. Seules varient la masse volumique et le flux de masse acoustique
+normal aux faces (d\'efini et calcul\'e aux faces).
+
+On a donc le syst\`eme suivant, entre $t^n$ et $t^*$~:
+\begin{equation}\label{Cfbl_Cfmsvl_eq_acoustique_cfmsvl}
+\left\{\begin{array}{l}
+
+\displaystyle\frac{\partial\rho}{\partial t}+\divs{\vect{Q}_{ac}} = 0 \\
+\\
+\displaystyle\frac{\partial\vect{Q}_{ac}}{\partial t}+\gradv{P} =
+\rho \vect{f}\\
+\\
+\vect{Q}^*=\vect{Q}^n\\
+\\
+e^*=e^n\\
+
+\end{array}\right.
+\end{equation}
+
+Une partie des termes sources de l'\'equation de la
+quantit\'e de mouvement peut \^etre prise en compte dans cette \'etape
+(les termes les plus importants, en pr\^etant attention aux sous-\'equilibres).
+
+Il faut noter que si $\vect{f}$ est effectivement nul, on aura bien un
+syst\`eme ``acoustique'', mais que si l'on place des termes suppl\'ementaires
+dans $\vect{f}$, la d\'enomination est abusive (on la conservera cependant).
+
+On obtient $\rho^* = \rho^{n+1}$ en r\'esolvant (\ref{Cfbl_Cfmsvl_eq_acoustique_cfmsvl}),
+et l'on actualise alors le flux de masse acoustique $\vect{Q}_{ac}^{n+1}$,
+qui servira pour la convection (en particulier pour la convection de
+l'enthalpie totale et de tous les scalaires transport\'es).
+
+Suivant la valeur de \var{IGRDPP}, on actualise �ventuellement la pression, en
+utilisant la loi d'\'etat :
+$$
+\displaystyle P^{Pred}=P(\rho^{n+1},\varepsilon^{n})
+$$
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%---------------------------------
+\subsection{Discr\'etisation en temps}
+%---------------------------------
+
+Le syst\`eme (\ref{Cfbl_Cfmsvl_eq_acoustique_cfmsvl}) discr\'etis\'e en temps donne :
+\begin{equation}\label{Cfbl_Cfmsvl_eq_acoustique_discrete_cfmsvl}
+\left\{\begin{array}{l}
+
+\displaystyle\frac{\rho^{n+1}-\rho^n}{\Delta t^n}
++ \divs{\vect{Q}_{ac}^{n+1}} = 0 \\
+\\
+\displaystyle\frac{\vect{Q}_{ac}^{n+1}-\vect{Q}^n}{\Delta t^n}+\gradv{P^*} =
+\rho^n \vect{f}^n\\
+\\
+Q^*=Q^n\\
+\\
+e^*=e^n\\
+
+\end{array}\right.
+\end{equation}
+
+\begin{equation}\label{Cfbl_Cfmsvl_eq_forces_supplementaires_cfmsvl}
+\begin{array}{llll}
+\text{avec\ }&\vect{f}^n &=& \vect{0} \\
+\text{ou\ }&\vect{f}^n &=& \vect{g} \\
+\text{ou m\^eme\ }&\vect{f}^n &=& \vect{f}_v
+ + \displaystyle\frac{1}{\rho^n}
+\left( - \divs(\vect{u} \otimes \vect{Q}) + \divv(\tens{\Sigma}^v)
+ + \vect{j}\wedge\vect{B} \right)^n
+\end{array}
+\end{equation}
+
+Dans la pratique nous avons d�cid� de prendre $\vect{f}^n=\vect{g}$~:
+\begin{itemize}
+ \item le terme $\vect{j}\wedge\vect{B}$ n'a pas �t� test�,
+ \item le terme $\divv(\tens{\Sigma}^v)$ \'etait n�gligeable sur les tests
+ r�alis�s,
+ \item le terme $\divs(\vect{u} \otimes \vect{Q})$ a paru d�stabiliser les
+ calculs (mais au moins une partie des tests a \'et\'e r\'ealis\'ee
+ avec une erreur de programmation et il faudrait donc les reprendre).
+\end{itemize}
+\bigskip
+
+Le terme $\vect{Q}^n$ dans la 2\textsuperscript{\`eme} \'equation
+de (\ref{Cfbl_Cfmsvl_eq_acoustique_discrete_cfmsvl}) est le vecteur ``quantit\'e de mouvement''
+qui provient de l'\'etape de r\'esolution de la quantit\'e de mouvement du pas
+de temps pr\'ec\'edent, $\vect{Q}^n = \rho^n \vect{u}^n$.
+On pourrait th�oriquement utiliser un vecteur quantit\'e de mouvement issu
+de l'\'etape acoustique du pas de temps pr\'ec\'edent, mais il ne constitue
+qu'un ``pr\'edicteur'' plus ou moins satisfaisant (il n'a pas ``vu'' les termes
+sources qui ne sont pas dans $\vect{f}^n$) et cette solution
+n'a pas �t� test�e.
+
+\bigskip
+On \'ecrit alors la pression sous la forme~:
+\begin{equation}
+\gradv{P}=c^2\,\gradv{\rho}+\beta\,\gradv{s}
+\end{equation}
+
+avec $c^2 = \left.\displaystyle\frac{\partial P}{\partial \rho}\right|_s$
+et $\beta = \left.\displaystyle\frac{\partial P}{\partial s}\right|_\rho$
+tabul\'es ou analytiques \`a partir de la loi d'\'etat.
+
+On discr\'etise l'expression pr\'ec\'edente en~:
+\begin{equation}
+\gradv{P^*}=(c^2)^n\gradv(\rho^{n+1})+\beta^n\gradv(s^n)
+\end{equation}
+
+On obtient alors une \'equation
+portant sur $\rho^{n+1}$ en substituant l'expression de $\vect{Q}_{ac}^{n+1}$
+issue de la 2\textsuperscript{\`eme} \'equation
+de~(\ref{Cfbl_Cfmsvl_eq_acoustique_discrete_cfmsvl})
+dans la 1\textsuperscript{\`ere} \'equation
+de~(\ref{Cfbl_Cfmsvl_eq_acoustique_discrete_cfmsvl})~:
+\begin{equation}\label{Cfbl_Cfmsvl_eq_densite_cfmsvl}
+\displaystyle\frac{\rho^{n+1}-\rho^n}{\Delta t^n}
++\divs(\vect{w}^n \rho^n)
+-\divs\left(\Delta t^n (c^2)^n \gradv(\rho^{n+1})\right) = 0
+\end{equation}
+
+o\`u~:
+\begin{equation}
+\begin{array}{lll}
+\vect{w}^n&=& \vect{u}^n + \Delta t^n
+\displaystyle\left(\vect{f}^n-\frac{\beta^n}{\rho^n}\gradv(s^n)\right)
+\end{array}
+\end{equation}
+
+Formulation alternative (programm\'ee mais non test\'ee)
+avec le terme de convection implicite~:
+\begin{equation}\label{Cfbl_Cfmsvl_eq_densite_bis_cfmsvl}
+\displaystyle\frac{\rho^{n+1}-\rho^n}{\Delta t^n}
++\divs(\vect{w}^n \rho^{n+1})
+-\divs\left(\Delta t^n (c^2)^n \gradv(\rho^{n+1})\right) = 0
+\end{equation}
+
+
+%---------------------------------
+\subsection{Discr\'etisation en espace}
+%---------------------------------
+
+
+%.................................
+\subsubsection{Introduction}
+%.................................
+
+On int\`egre l'\'equation pr\'ec\'edente ( (\ref{Cfbl_Cfmsvl_eq_densite_cfmsvl})
+ou (\ref{Cfbl_Cfmsvl_eq_densite_bis_cfmsvl}) ) sur la cellule $i$ de volume $\Omega_i$.
+On transforme les int\'egrales de volume en int\'egrales surfaciques
+et l'on discr\'etise ces int\'egrales. Pour simplifier l'expos�, on se
+place sur une cellule $i$ dont aucune face n'est sur le bord du domaine.
+
+On obtient alors l'\'equation discr\`ete
+suivante\footnote{L'exposant $^{n+\frac{1}{2}}$ signifie que le terme
+peut \^etre implicite ou explicite. En pratique on a choisi
+$\rho^{n+\frac{1}{2}} = \rho^{n}$.}~:
+\begin{equation}\label{Cfbl_Cfmsvl_eq_densite_discrete_cfmsvl}
+\Omega_i \displaystyle\frac{\rho_i^{n+1}-\rho_i^n}{\Delta t^n}
++\sum\limits_{j\in Vois(i)}(\rho^{n+\frac{1}{2}} \vect{w}^n)_{ij} \cdot \vect{S}_{ij}
+-\sum\limits_{j\in Vois(i)} \left(\Delta t^n (c^2)^n
+\gradv(\rho^{n+1})\right)_{ij} \cdot \vect{S}_{ij}
+= 0
+\end{equation}
+
+%.................................
+\subsubsection{Discr\'etisation de la partie ``convective''}
+%.................................
+
+La valeur \`a la face s'\'ecrit~:
+\begin{equation}
+(\rho^{n+\frac{1}{2}} \vect{w}^n)_{ij} \cdot \vect{S}_{ij}
+= \rho^{n+\frac{1}{2}}_{ij} \vect{w}^n_{ij} \cdot \vect{S}_{ij}
+\end{equation}
+avec, pour $\vect{w}^n_{ij}$,
+une simple interpolation lin\'eaire~:
+\begin{equation}
+\vect{w}^n_{ij}
+= \alpha_{ij} \vect{w}^n_i + (1-\alpha_{ij}) \vect{w}^n_j
+\end{equation}
+et un d\'ecentrement sur la valeur de $\rho^{n+\frac{1}{2}}$ aux faces~:
+\begin{equation}
+\begin{array}{lllll}
+\displaystyle\rho_{ij}^{n+\frac{1}{2}} &=& \rho_{I'}^{n+\frac{1}{2}}
+ &\text{si\ }& \vect{w}^n_{ij} \cdot \vect{S}_{ij} \geqslant 0 \\
+ &=& \rho_{J'}^{n+\frac{1}{2}}
+ &\text{si\ }& \vect{w}^n_{ij} \cdot \vect{S}_{ij} < 0 \\
+\end{array}
+\end{equation}
+que l'on peut noter~:
+\begin{equation}
+\displaystyle\rho_{ij}^{n+\frac{1}{2}}
+ = \beta_{ij}\rho_{I'}^{n+\frac{1}{2}} + (1-\beta_{ij})\rho_{J'}^{n+\frac{1}{2}}
+\end{equation}
+avec
+\begin{equation}
+\left\{\begin{array}{lll}
+\beta_{ij} = 1 & \text{si\ } & \vect{w}^n_{ij} \cdot \vect{S}_{ij} \geqslant 0 \\
+\beta_{ij} = 0 & \text{si\ } & \vect{w}^n_{ij} \cdot \vect{S}_{ij} < 0 \\
+\end{array}\right.
+\end{equation}
+
+%.................................
+\subsubsection{Discr\'etisation de la partie ``diffusive''}
+%.................................
+
+La valeur \`a la face s'\'ecrit~:
+\begin{equation}
+\left(\Delta t^n (c^2)^n \gradv(\rho^{n+1})\right)_{ij}\cdot \vect{S}_{ij}
+= \Delta t^n (c^2)^n_{ij}
+\displaystyle \left( \frac{\partial \rho}{\partial n} \right)^{n+1}_{ij}S_{ij}
+\end{equation}
+avec, pour assurer la continuit\'e du flux normal \`a l'interface,
+une interpolation harmonique de $(c^2)^n$~:
+\begin{equation}\label{Cfbl_Cfmsvl_eq_harmonique_cfmsvl}
+\displaystyle(c^2)_{ij}^n
+= \frac{(c^2)_{i}^n (c^2)_{j}^n}
+{\alpha_{ij}(c^2)_{i}^n+(1-\alpha_{ij})(c^2)_{j}^n}
+\end{equation}
+et un sch\'ema centr\'e pour le gradient normal aux faces~:
+\begin{equation}
+\displaystyle \left( \frac{\partial \rho}{\partial n} \right)^{n+1}_{ij}
+= \displaystyle\frac{\rho_{J'}^{n+1}-\rho_{I'}^{n+1}}{\overline{I'J'}}
+\end{equation}
+
+%.................................
+\subsubsection{Syst\`eme final}
+%.................................
+
+On obtient maintenant le syst\`eme final, portant sur
+$(\rho_i^{n+1})_{i=1 \ldots N}$~:
+\begin{equation}\label{Cfbl_Cfmsvl_eq_densite_finale_cfmsvl}
+\displaystyle\frac{\Omega_i}{\Delta t^n} (\rho_i^{n+1}-\rho_i^n)
++\sum\limits_{j\in Vois(i)}\rho_{ij}^{n+\frac{1}{2}}
+\vect{w}_{ij}^n \cdot \vect{S}_{ij}
+-\sum\limits_{j\in Vois(i)} \Delta t^n (c^2)_{ij}^n
+\displaystyle\frac{\rho_{J'}^{n+1}-\rho_{I'}^{n+1}}{\overline{I'J'}}\ S_{ij}
+= 0
+\end{equation}
+
+
+
+%.................................
+\subsubsection{Remarque~: interpolation aux faces pour le terme de diffusion}
+%.................................
+
+Le choix de la forme de la moyenne pour le cofacteur du flux
+normal n'est pas sans cons\'equence sur la vitesse de convergence, surtout
+lorsque l'on est en pr\'esence de fortes inhomog\'en\'eit\'es.
+
+On utilise une interpolation harmonique pour $c^2$
+afin de conserver la continuit\'e du flux diffusif normal
+$\Delta t (c^2) \displaystyle\frac{\partial \rho}{\partial n}$
+\`a l'interface $ij$. En effet, on suppose que le flux est d\'erivable \`a
+l'interface. Il doit donc y \^etre continu.\\
+%
+\'Ecrivons la continuit\'e du flux normal \`a l'interface,
+avec la discr\'etisation
+suivante\footnote{On ne reconstruit pas les valeurs de $\Delta\,t\,c^2$
+aux points $I'$ et
+$J'$.}~:
+\begin{equation}
+\left(\Delta t (c^2)\displaystyle\frac{\partial \rho}{\partial n}\right)_{ij}
+= \Delta t (c^2)_i \displaystyle\frac{\rho_{ij} - \rho_{I'} }{\overline{I'F}}
+= \Delta t (c^2)_j \displaystyle\frac{\rho_{J'} - \rho_{ij}}{\overline{FJ'}}
+\end{equation}
+En \'egalant les flux \`a gauche et \`a droite de l'interface, on obtient
+\begin{equation}
+\rho_{ij} = \displaystyle\frac{\overline{I'F}\,(c^2)_j\rho_{J'} + \overline{FJ'}\,(c^2)_i\rho_{I'}}
+{\overline{I'F}\,(c^2)_j + \overline{FJ'}\,(c^2)_i}
+\end{equation}
+On introduit cette formulation dans la d\'efinition du flux (par exemple, du
+flux \`a gauche)~:
+\begin{equation}
+\left(\Delta t (c^2)\displaystyle\frac{\partial \rho}{\partial n}\right)_{ij}
+= \Delta t (c^2)_i \displaystyle\frac{\rho_{ij} - \rho_{I'} }{\overline{I'F}}
+\end{equation}
+et on utilise la d\'efinition de $(c^2)_{ij}$ en fonction de ce m\^eme flux
+\begin{equation}
+\left(\Delta t (c^2)\displaystyle\frac{\partial \rho}{\partial n}\right)_{ij}
+ \stackrel{\text{d\'ef}}{=}
+ \Delta t (c^2)_{ij} \displaystyle\frac{\rho_{J'} - \rho_{I'} }{\overline{I'J'}}
+\end{equation}
+pour obtenir la valeur de $(c^2)_{ij}$ correspondant \`a l'\'equation (\ref{Cfbl_Cfmsvl_eq_harmonique_cfmsvl})~:
+\begin{equation}
+(c^2)_{ij} = \displaystyle\frac{\overline{I'J'}\,(c^2)_i(c^2)_j}{\overline{FJ'}\,(c^2)_i + \overline{I'F}\,(c^2)_j}
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le syst\`eme (\ref{Cfbl_Cfmsvl_eq_densite_finale_cfmsvl}) est r\'esolu par une m\'ethode
+d'incr\'ement et r\'esidu en utilisant
+une m\'ethode de Jacobi pour inverser le syst\`eme si le terme convectif
+est implicite et en utilisant une m\'ethode de gradient conjugu\'e
+si le terme convectif est explicite (qui est le cas par d�faut).
+
+Attention, les valeurs du flux de masse $\rho\,\vect{w}\cdot\vect{S}$ et
+de la viscosit\'e $\Delta\,t\,c^2\frac{S}{d}$ aux faces de
+bord, qui sont calcul\'ees dans \fort{cfmsfl} et \fort{cfmsvs} respectivement,
+sont modifi\'ees imm\'ediatement apr\`es l'appel \`a ces sous-programmes.
+En effet, il est indispensable que la contribution de bord de
+$\left(\rho\,\vect{w}-\Delta\,t\,(c^2)\,\gradv\,\rho\right)\cdot\vect{S}$
+repr\'esente exactement $\vect{Q}_{ac}\cdot\vect{S}$.
+Pour cela,
+\begin{itemize}
+\item imm\'ediatement apr\`es l'appel \`a
+\fort{cfmsfl}, on remplace la contribution de bord de
+$\rho\,\vect{w}\cdot\vect{S}$
+par le flux de masse exact, $\vect{Q}_{ac}\cdot\vect{S}$,
+d\'etermin\'e \`a partir des conditions aux limites,
+\item puis, imm\'ediatement apr\`es l'appel \`a
+\fort{cfmsvs}, on annule la viscosit\'e au bord $\Delta\,t\,(c^2)$ pour
+\'eliminer la contribution de $-\Delta\,t\,(c^2)\,(\gradv\,\rho)\cdot\vect{S}$
+(l'annulation de la viscosit\'e n'est pas probl\'ematique pour la matrice,
+puisqu'elle porte sur des incr\'ements).
+\end{itemize}
+
+\bigskip
+
+Une fois qu'on a obtenu $\rho^{n+1}$,
+on peut actualiser le flux de masse acoustique
+aux faces $(\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij}$,
+qui servira pour la convection des autres variables~:
+\begin{equation}\label{Cfbl_Cfmsvl_eq_flux_masse_acoustique_cfmsvl}
+\displaystyle(\vect{Q}_{ac}^{n+1})_{ij}\cdot\vect{S}_{ij}=
+-\left(\Delta t^n (c^2)^n \gradv(\rho^{n+1})\right)_{ij}\cdot\vect{S}_{ij}
++\left(\rho^{n+\frac{1}{2}} \vect{w}^n\right)_{ij}\cdot\vect{S}_{ij}\\
+\end{equation}
+Ce calcul de flux est r\'ealis\'e par \fort{cfbsc3}.
+Si l'on a choisi l'algorithme standard, \'equation~(\ref{Cfbl_Cfmsvl_eq_densite_cfmsvl}),
+on compl\`ete le flux dans \fort{cfmsvl} imm\'ediatement apr\`es l'appel
+\`a \fort{cfbsc3}.
+En effet, dans ce cas,
+la convection est explicite ($\rho^{n+\frac{1}{2}}=\rho^{n}$,
+obtenu en imposant \var{ICONV(ISCA(IRHO(IPHAS)))=0})
+et le sous-programme \fort{cfbsc3},
+qui calcule le flux de masse aux faces,
+ne prend pas en compte la contribution du terme
+$\rho^{n+\frac{1}{2}}\,\vect{w}^n\cdot\vect{S}$. On ajoute donc cette
+contribution dans \fort{cfmsvl}, apr\`es l'appel \`a \fort{cfbsc3}.
+Au bord, en particulier, c'est bien le flux de masse calcul\'e \`a partir
+des conditions aux limites que l'on obtient.
+
+On actualise la pression \`a la fin de l'\'etape, en utilisant la loi d'\'etat~:
+\begin{equation}
+\displaystyle P_i^{pred}=P(\rho_i^{n+1},\varepsilon_i^{n})
+\end{equation}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le calcul du flux de masse au bord n'est pas enti\`erement satisfaisant
+si la convection est trait\'ee de mani\`ere implicite
+(algorithme non standard, non test\'e,
+associ\'e \`a l'\'equation~(\ref{Cfbl_Cfmsvl_eq_densite_bis_cfmsvl}),
+correspondant au choix $\rho^{n+\frac{1}{2}}=\rho^{n+1}$ et
+obtenu en imposant \var{ICONV(ISCA(IRHO(IPHAS)))=1}).
+En effet, apr\`es \fort{cfmsfl}, il faut d\'eterminer la vitesse de
+convection $\vect{w}^n$ pour qu'apparaisse
+$\rho^{n+1} \vect{w}^n\cdot\vect{n}$
+au cours de la r\'esolution par \fort{codits}. De ce fait, on doit d\'eduire
+une valeur de $\vect{w}^n$ \`a partir de la valeur
+du flux de masse. Au bord, en particulier, il faut
+donc diviser le flux de masse
+issu des conditions aux limites par la valeur de bord de $\rho^{n+1}$.
+Or, lorsque des conditions de Neumann sont appliqu\'ees \`a la
+masse volumique,
+la valeur de $\rho^{n+1}$ au bord n'est pas connue avant la r\'esolution du
+syst\`eme. On utilise donc, au lieu de la valeur de bord inconnue de
+$\rho^{n+1}$ la valeur de bord prise au pas de temps
+pr\'ec\'edent $\rho^{n}$. Cette approximation est susceptible
+d'affecter la valeur du flux de masse au bord.
diff --git a/doc/theory/cfqdmv.tex b/doc/theory/cfqdmv.tex
new file mode 100644
index 0000000..a70a86c
--- /dev/null
+++ b/doc/theory/cfqdmv.tex
@@ -0,0 +1,289 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{cfqdmv}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Pour les notations et l'algorithme dans son ensemble,
+on se reportera \`a \fort{cfbase}.
+
+Dans le premier pas fractionnaire (\fort{cfmsvl}), on a r\'esolu une
+\'equation sur la masse volumique, obtenu une pr\'ediction de la pression
+et un flux convectif "acoustique".
+On consid\`ere ici un second pas fractionnaire au cours duquel seul varie
+le vecteur flux de masse $\vect{Q}=\rho\vect{u}$
+(seule varie la vitesse au centre des cellules).
+On r\'esout l'\'equation de Navier-Stokes ind\'ependamment
+pour chaque direction d'espace, et l'on utilise le flux de masse acoustique
+calcul\'e pr\'ec\'edemment comme flux convecteur (on pourrait aussi utiliser
+le vecteur quantit\'e de mouvement du pas de temps pr\'ec\'edent).
+De plus, on r\'esout en variable $\vect{u}$ et non $\vect{Q}$.
+
+Le syst\`eme \`a r\'esoudre entre $t^*$ et $t^{**}$ est (on exclut
+la turbulence, dont le traitement n'a rien de particulier dans le
+module compressible)~:
+
+\begin{equation}\label{Cfbl_Cfqdmv_eq_qdm_cfqdmv}
+\left\{\begin{array}{l}
+
+\rho^{**}=\rho^{*}=\rho^{n+1}\\
+\\
+\displaystyle\frac{\partial \rho\vect{u}}{\partial t}+
+\divv(\vect{u} \otimes \vect{Q}_{ac}) + \gradv{P}
+= \rho \vect{f}_v + \divv(\tens{\Sigma}^v)\\
+\\
+e^{**}=e^{*}=e^n\\
+
+\end{array}\right.
+\end{equation}
+
+La r\'esolution de cette \'etape est similaire \`a l'\'etape
+de pr\'ediction des vitesses du sch\'ema de base de \CS.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%---------------------------------
+\subsection{Discr\'etisation en temps}
+%---------------------------------
+
+On implicite le terme de convection, �ventuellement
+le gradient de pression (suivant la valeur de \var{IGRDPP}, en utilisant la
+pression pr\'edite lors de l'\'etape acoustique) et le terme en gradient
+du tenseur des contraintes visqueuses.
+On explicite les autres termes du tenseur des contraintes visqueuses.
+On implicite les forces
+volumiques en utilisant $\rho^{n+1}$.
+
+On obtient alors l'\'equation discr\`ete suivante~:
+\begin{equation}\label{Cfbl_Cfqdmv_eq_vitesse_cfqdmv}
+\begin{array}{l}
+\displaystyle\frac{(\rho\vect{u})^{n+1}-(\rho\vect{u})^n}{\Delta t^n}
++ \divv(\vect{u}^{n+1} \otimes \vect{Q}_{ac}^{n+1})
+- \divv(\mu^n \gradt{\vect{u}^{n+1}})\\
+\\
+\text{\ \ \ \ }= \rho^{n+1} \vect{f}_v - \gradv{\widetilde{P}}
++ \divv\left(\mu^n\ ^t\gradt{\vect{u}^n}
++ (\kappa^n-\frac{2}{3}\mu^n)\divs{\vect{u}^n}\ \tens{Id}\right)\\
+\end{array}
+\end{equation}
+avec $\widetilde{P}=P^n\text{ ou }P^{Pred}$ suivant la valeur de \var{IGRDPP}
+($P^n$ par d�faut).
+
+En pratique, dans \CS, on r\'esout cette \'equation en faisant appara\^itre \`a
+gauche l'\'ecart $\vect{u}^{n+1} - \vect{u}^n$. Pour cela, on \'ecrit la
+d\'eriv\'ee en temps discr\`ete sous la forme suivante~:
+
+\begin{equation}
+\begin{array}{ll}
+\displaystyle
+\frac{(\rho \vect{u})^{n+1} - (\rho \vect{u})^n}{\Delta t^n}
+& =
+\displaystyle
+\frac{\rho^{n+1}\, \vect{u}^{n+1} - \rho^n\, \vect{u}^n}{\Delta t^n}\\
+& =
+\displaystyle
+\frac{\rho^{n}\, \vect{u}^{n+1} - \rho^n\, \vect{u}^n}{\Delta t^n}+
+\frac{\rho^{n+1}\, \vect{u}^{n+1} - \rho^n\, \vect{u}^{n+1}}{\Delta t^n}\\
+& =
+\displaystyle
+\frac{\rho^{n}}{\Delta t^n}\left(\vect{u}^{n+1} - \vect{u}^n\right)+
+\vect{u}^{n+1}\frac{\rho^{n+1} - \rho^n}{\Delta t^n}
+\end{array}
+\end{equation}
+
+et l'on utilise alors l'\'equation de la masse discr\`ete pour \'ecrire~:
+\begin{equation}
+\displaystyle
+\frac{(\rho \vect{u})^{n+1} - (\rho \vect{u})^n}{\Delta t^n}
+=
+\frac{\rho^{n}}{\Delta t^n}\left(\vect{u}^{n+1} - \vect{u}^n\right)-
+\vect{u}^{n+1}\dive\,\vect{Q}_{ac}^{n+1}
+\end{equation}
+
+
+
+%---------------------------------
+\subsection{Discr\'etisation en espace}
+%---------------------------------
+
+%.................................
+\subsubsection{Introduction}
+%.................................
+
+On int\`egre l'\'equation (\ref{Cfbl_Cfqdmv_eq_vitesse_cfqdmv})
+sur la cellule $i$ de volume $\Omega_i$ et
+on obtient l'\'equation discr\'etis\'ee en espace~:
+
+\begin{equation}\label{Cfbl_Cfqdmv_eq_vitesse_discrete_cfqdmv}
+\begin{array}{l}
+\displaystyle\frac{\Omega_i}{\Delta t^n}
+(\rho_i^{n+1}\vect{u}_i^{n+1}-\rho_i^n\vect{u}_i^n)
++ \displaystyle\sum\limits_{j\in V(i)}
+(\vect{u}^{n+1} \otimes \vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij}
+- \displaystyle\sum\limits_{j\in V(i)}
+\left(\mu^n\gradt{\vect{u}^{n+1}}\right)_{ij} \cdot \vect{S}_{ij}\\
+\\
+= \Omega_i\rho_i^{n+1} {\vect{f}_v}_i
+- \Omega_i(\gradv{\widetilde{P}})_i
++ \displaystyle\sum\limits_{j\in V(i)}
+\left(\mu^n\ ^t\gradt{\vect{u}^n} + (\kappa^n-\frac{2}{3}\mu^n)
+\divs{\vect{u}^n}\ \tens{Id}\right)_{ij}\vect{S}_{ij}\\
+\end{array}
+\end{equation}
+
+%.................................
+\subsubsection{Discr\'etisation de la partie ``convective''}
+%.................................
+
+La valeur \`a la face s'\'ecrit~:
+\begin{equation}
+(\vect{u}^{n+1} \otimes \vect{Q}_{ac}^{n+1})_{ij}\cdot \vect{S}_{ij}
+= \vect{u}_{ij}^{n+1}(\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij}
+\end{equation}
+avec un d\'ecentrement sur la valeur de $\vect{u}^{n+1}$ aux faces~:
+\begin{equation}
+\begin{array}{lllll}
+\vect{u}_{ij}^{n+1}
+& = & \vect{u}_i^{n+1}
+& \text{si\ } & (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} \geqslant 0 \\
+& = & \vect{u}_j^{n+1}
+& \text{si\ } & (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} < 0 \\
+\end{array}
+\end{equation}
+que l'on peut noter~:
+\begin{equation}
+\vect{u}_{ij}^{n+1}
+ = \beta_{ij}\vect{u}_i^{n+1} + (1-\beta_{ij})\vect{u}_j^{n+1}
+\end{equation}
+avec
+\begin{equation}
+\left\{\begin{array}{lll}
+\beta_{ij} = 1 & \text{si\ }
+& (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} \geqslant 0 \\
+\beta_{ij} = 0 & \text{si\ }
+& (\vect{Q}_{ac}^{n+1})_{ij} \cdot \vect{S}_{ij} < 0 \\
+\end{array}\right.
+\end{equation}
+
+%.................................
+\subsubsection{Discr\'etisation de la partie ``diffusive''}
+%.................................
+
+La valeur \`a la face s'\'ecrit~:
+\begin{equation}
+\left(\mu^n\gradt{\vect{u}^{n+1}}\right)_{ij}\vect{S}_{ij}
+= \mu_{ij}^n
+\displaystyle \left( \frac{\partial \vect{u}}{\partial n} \right)^{n+1}_{ij}
+S_{ij}
+\end{equation}
+avec une interpolation lin\'eaire pour $\mu^n$ aux faces (en pratique avec
+$\alpha_{ij}=\frac{1}{2}$)~:
+\begin{equation}
+\mu_{ij}^n
+= \alpha_{ij}\mu_{i}^n+(1-\alpha_{ij})\mu_{j}^n
+\end{equation}
+et un sch\'ema centr\'e pour le gradient normal aux faces~:
+\begin{equation}
+\displaystyle \left( \frac{\partial \vect{u}}{\partial n} \right)^{n+1}_{ij}
+= \displaystyle\frac{\vect{u}_{J'}^{n+1}-\vect{u}_{I'}^{n+1}}{\overline{I'J'}}
+\end{equation}
+
+%.................................
+\subsubsection{Discr\'etisation du gradient de pression}
+%.................................
+
+On utilise \fort{grdcel} standard. Suivant la valeur de \var{IMRGRA},
+cela correspond � une reconstruction it�rative ou par moindres carr�s.
+
+%.................................
+\subsubsection{Discr\'etisation du ``reste'' du tenseur des contraintes visqueuses}
+%.................................
+
+On calcule des gradients aux cellules et on utilise une
+interpolation lin\'eaire aux
+faces (avec, en pratique, $\alpha_{ij}=\frac{1}{2}$)~:
+\begin{equation}
+\begin{array}{r}
+\left(\mu^n\ ^t\gradt{\vect{u}^n} + (\kappa^n-\frac{2}{3}\mu^n)
+\divs{\vect{u}^n}\ \tens{Id}\right)_{ij}\cdot\vect{S}_{ij}
+= \left\{\alpha_{ij} \left(\mu^n\ ^t\gradt{\vect{u}^n}
++ (\kappa^n-\frac{2}{3}\mu^n)\divs{\vect{u}^n}\ \tens{Id}\right)_i\right.\\
+\\
+\left.+ (1-\alpha_{ij}) \left(\mu^n\ ^t\gradt{\vect{u}^n}
++ (\kappa^n-\frac{2}{3}\mu^n)\divs{\vect{u}^n}\ \tens{Id}\right)_j
+\right\} \cdot\vect{S}_{ij}\\
+\end{array}
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On r\'esout les trois directions d'espace du syst\`eme
+(\ref{Cfbl_Cfqdmv_eq_vitesse_discrete_cfqdmv}) successivement et ind\'ependamment~:
+\begin{equation}\label{Cfbl_Cfqdmv_eq_vitesse_finale_cfqdmv}
+\left\{\begin{array}{l}
+\displaystyle\frac{\Omega_i}{\Delta t^n}
+(\rho_i^{n+1}{u_i}_{(\alpha)}^{n+1}-\rho_i^n{u_i}_{(\alpha)}^n)
++ \displaystyle\sum\limits_{j\in V(i)}
+{u_{ij}}_{(\alpha)}^{n+1}(\vect{Q}_{ac}^{n+1})_{ij}\cdot\vect{S}_{ij}
+- \displaystyle\sum\limits_{j\in V(i)}
+\mu_{ij}^n\frac{{u_j}_{(\alpha)}^{n+1}-{u_i}_{(\alpha)}^{n+1}}{\overline{I'J'}}S_{ij}\\
+\qquad\qquad\qquad\qquad= \Omega_i\rho_i^{n+1} {{f_v}_i}_{(\alpha)}
+- \Omega_i{(\gradv{\widetilde{P}})_{i}}_{(\alpha)}\\
+\qquad\qquad\qquad\qquad + \displaystyle\sum\limits_{j\in V(i)}
+\left((\mu^n\ ^t\gradt{\vect{u}^n})_{ij}\cdot\vect{S}_{ij}\right)_{(\alpha)}
+ + \displaystyle\sum\limits_{j\in V(i)} \left((\kappa^n-\frac{2}{3}\mu^n)
+\divs{\vect{u}^n}\right)_{ij}{S_{ij}}_{(\alpha)}\\
+i = 1\ldots N \qquad \text{et} \qquad (\alpha) = x,\ y,\ z\\
+\end{array}\right.
+\end{equation}
+
+Chaque syst\`eme associ\'e \`a une direction est r\'esolu par une m\'ethode
+d'incr\'ement et r\'esidu en utilisant une m\'ethode de Jacobi.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% propose en patch 1.2.1
+
+%Compl\'eter le commentaire en ent\^ete de \fort{vissec} pour prendre en compte
+%la viscosit\'e en volume.
diff --git a/doc/theory/cfxtcl.tex b/doc/theory/cfxtcl.tex
new file mode 100644
index 0000000..f89114c
--- /dev/null
+++ b/doc/theory/cfxtcl.tex
@@ -0,0 +1,1819 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+
+\programme{cfxtcl}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Pour le traitement des conditions aux limites, on consid\`ere
+le syst\`eme (\ref{Cfbl_Cfxtcl_eq_ref_laminaire_cfxtcl})
+
+\begin{equation}\label{Cfbl_Cfxtcl_eq_ref_laminaire_cfxtcl}
+\left\{\begin{array}{l}
+
+\displaystyle\frac{\partial\rho}{\partial t} + \divs(\vect{Q}) = 0 \\
+\\
+\displaystyle\frac{\partial\vect{Q}}{\partial t}
++ \divv(\vect{u} \otimes \vect{Q}) + \gradv{P}
+= \rho \vect{f}_v + \divv(\tens{\Sigma}^v) \\
+\\
+\displaystyle\frac{\partial E}{\partial t} + \divs( \vect{u} (E+P) )
+= \rho\vect{f}_v\cdot\vect{u} + \divs(\tens{\Sigma}^v \vect{u})
+- \divs{\,\vect{\Phi}_s} + \rho\Phi_v
+
+\end{array}\right.
+\end{equation}
+
+en tant que syst\`eme hyperbolique portant sur la variable vectorielle
+$\vect{W}=\ ^t(\rho,\vect{Q},E)$.
+
+Le syst\`eme s'\'ecrit alors~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_hyperbolique_cfxtcl}
+\displaystyle\frac{\partial \vect{W}}{\partial t}
++ \displaystyle\sum\limits_{i=1}^3
+\frac{\partial}{\partial x_i}\vect{F}_i(\vect{W})
+= \displaystyle\sum\limits_{i=1}^3
+\frac{\partial}{\partial x_i}\vect{F}_i^D(\vect{W},\nabla \vect{W})
++ \vect{\mathcal{S}}
+\end{equation}
+o\`u les $\vect{F}_i(\vect{W})$ sont les vecteurs flux convectifs
+et les $\vect{F}_i^D(\vect{W})$ sont les vecteurs flux diffusifs
+dans les trois directions d'espace,
+et $\vect{\mathcal{S}}$ est un terme source.
+
+La d\'emarche classique de \CS est adopt\'ee~: on impose les conditions
+aux limites en d\'eterminant, pour chaque variable, des valeurs num\'eriques
+de bord. Ces valeurs sont calcul\'ees de telle fa\c con que, lorsqu'on
+les utilise dans les formules standard donnant les flux discrets, on obtienne
+les contributions souhait\'ees au bord.
+
+Pour rendre compte des flux convectifs (aux entr\'ees et aux sorties en particulier),
+on fait abstraction des flux diffusifs et des termes
+sources pour r\'esoudre un probl\`eme de Riemann qui
+fournit un vecteur d'\'etat au bord. Celui-ci permet de calculer un flux,
+soit directement (par les formules discr\`etes standard),
+soit en appliquant un sch\'ema de Rusanov (sch\'ema de flux d\'ecentr\'e).
+
+En paroi, on r\'esout \'egalement, dans certains cas, un probl\`eme de
+Riemann pour d\'eterminer une pression au bord.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%=================================
+\subsection{Introduction}
+%=================================
+
+%---------------------------------
+\subsubsection{Objectif}
+%---------------------------------
+
+On r\'esume ici les diff\'erentes conditions aux limites utilis\'ees pour l'algorithme
+compressible afin de fournir une vue d'ensemble. Pour atteindre cet objectif,
+il est n\'ecessaire de faire r\'ef\'erence \`a des \'el\'ements relatifs
+\`a la discr\'etisation et au mode d'implantation des conditions aux limites.
+
+Lors de l'implantation, on a cherch\'e \`a pr\'eserver la coh\'erence avec l'approche
+utilis\'ee dans le cadre standard de l'algorithme incompressible de \CS.
+Il est donc conseill\'e d'avoir pris connaissance du mode de traitement des conditions
+aux limites incompressibles avant d'aborder les d\'etails de l'algorithme compressible.
+
+Comme pour l'algorithme incompressible, les conditions aux limites sont impos\'ees
+par le biais d'une valeur de bord associ\'ee \`a chaque variable. De plus,
+pour certaines
+fronti\`eres (parois \`a temp\'erature impos\'ee ou \`a flux thermique impos\'e),
+on dispose de deux valeurs de bord pour la m\^eme variable, l'une d'elles \'etant d\'edi\'ee au calcul du
+flux diffusif.
+Enfin, sur certains types d'entr\'ee et de sortie, on d\'efinit \'egalement
+une valeur du flux convectif au bord.
+
+Comme pour l'algorithme incompressible, l'utilisateur peut d\'efinir,
+pour chaque face
+de bord, des conditions aux limites pour chaque variable, mais on conseille cependant
+d'utiliser uniquement les types pr\'ed\'efinis
+d\'ecrits ci-apr\`es (entr\'ee,
+sortie, paroi, sym\'etrie) qui ont l'avantage d'assurer la coh\'erence entre
+les diff\'erentes variables et les diff\'erentes \'etapes de calcul.
+
+
+%---------------------------------
+\subsubsection{Parois}
+%---------------------------------
+
+{\bf Pression} : on doit disposer d'une condition pour le calcul du gradient
+qui intervient dans l'\'etape de quantit\'e de mouvement.
+On dispose de deux types de condition, au choix de l'utilisateur~:
+\begin{itemize}
+\item par d\'efaut, la pression impos\'ee au bord est proportionnelle
+\`a la valeur interne (la pression au bord est obtenue comme solution
+d'un probl\`eme de Riemann sur les \'equations d'Euler
+avec un \'etat miroir~; on distingue les cas de choc et de
+d\'etente et, dans le cas d'une d\'etente trop forte, une condition de
+Dirichlet homog\`ene est utilis\'ee pour \'eviter de voir appara\^itre une
+pression n\'egative),
+\item si l'utilisateur le souhaite (\var{ICFGRP(IPHAS)=1}), le gradient de
+pression est impos\'e \`a partir du profil de pression hydrostatique.
+\end{itemize}
+\bigskip
+
+{\bf Vitesse et turbulence}~: traitement standard (voir la documentation des
+sous-programmes \fort{condli}
+et \fort{clptur}).
+
+{\bf Scalaires passifs}~: traitement standard
+(flux nul par d\'efaut impos\'e dans \fort{typecl}).
+
+{\bf Masse volumique}~: traitement standard des scalaires
+(flux nul par d\'efaut impos\'e dans \fort{typecl}).
+
+{\bf \'Energie et temp\'erature\footnote{Le gradient de temp\'erature est
+{\it a priori} inutile, mais peut \^etre requis par l'utilisateur.}}~:
+traitement standard des scalaires
+(flux nul par d\'efaut impos\'e dans \fort{typecl}), hormis pour le
+calcul du flux diffusif dans le cas de parois \`a temp\'erature impos\'ee
+ou \`a flux thermique impos\'e.
+
+{\bf Flux diffusif pour l'\'energie en paroi}~:
+l'utilisateur peut choisir (dans \fort{uscfcl}) entre une temp\'erature de paroi impos\'ee
+et un flux thermique diffusif (ou "conductif") impos\'e.
+S'il ne pr\'ecise rien, on consid\`ere que la paroi est adiabatique
+(flux thermique diffusif impos\'e et de valeur nulle).
+Dans tous les cas, il faut donc disposer d'un moyen d'imposer le flux diffusif
+souhait\'e. Pour cela, on d\'etermine une valeur de bord pour l'\'energie
+qui, introduite dans la formule donnant le flux discret, permettra
+d'obtenir la contribution attendue
+(voir le paragraphe~\ref{Cfbl_Cfxtcl_section_cl_flux_diffusif_energie_cfener}).
+Conform\'ement \`a l'approche classique de \CS, cette valeur est
+stock\'ee sous la forme d'un couple de coefficients
+(de type \var{COEFAF}, \var{COEFBF}).
+Il est important de souligner que cette valeur de bord
+ne doit \^etre utilis\'ee que pour le calcul
+du flux diffusif~: dans les autres situations pour lesquelles
+une valeur de bord de l'\'energie ou de la temp\'erature est requise
+(calcul de gradient par exemple), on utilise une condition de flux nul
+(traitement standard des scalaires). Pour cela, on dispose d'une
+seconde valeur de bord qui est stock\'ee au moyen d'un
+couple de coefficients (\var{COEFA}, \var{COEFB}) distinct du pr\'ec\'edent.
+
+{\bf Flux convectifs}~: le flux de masse dans la direction normale \`a la paroi est
+pris nul. De ce fait, les flux convectifs seront nuls quelle que soit les valeurs
+de bord impos\'ees pour les diff\'erentes variables transport\'ees.
+
+%---------------------------------
+\subsubsection{Sym\'etrie}
+%---------------------------------
+
+Les conditions appliqu\'ees sont les conditions classiques de l'algorithme
+incompressible (vitesse normale nulle, flux nul pour les autres variables).
+
+Elles sont impos\'ees dans le sous-programme \fort{typecl} essentiellement. Pour
+la pression, la condition de flux nul est impos\'ee dans \fort{cfxtcl}
+(au d\'ebut des d\'eveloppements, on appliquait le m\^eme traitement qu'en paroi,
+mais une condition de flux nul a \'et\'e pr\'ef\'er\'ee afin de s'affranchir des
+probl\`emes potentiels dans les configurations 2D).
+
+
+%---------------------------------
+\subsubsection{Entr\'ees et sorties}
+%---------------------------------
+
+On obtient, par r\'esolution d'un probl\`eme de Riemann au bord, compl\'et\'e par
+des relations de thermodynamique (\fort{uscfth}), des valeurs de bord pour toutes
+les variables (on suppose qu'en entr\'ee, toutes les composantes de la vitesse
+sont fournies~; elles sont suppos\'ees nulles par d\'efaut, hormis pour les
+entr�es � $(\rho,\vect{u})$ impos�s, \var{IERUCF}, pour lesquelles il faut
+fournir la vitesse explicitement).
+
+Ces valeurs de bord sont utilis\'ees de deux fa\c cons~:
+\begin{itemize}
+\item elles sont utilis\'ees pour calculer les flux convectifs, en faisant
+appel au sch\'ema de Rusanov (sauf en sortie supersonique)~; ces flux sont
+directement int\'egr\'es au second membre des \'equations \`a r\'esoudre.
+\item elles servent de valeur de Dirichlet dans toutes les autres configurations
+pour lesquelles une valeur de bord est requise (calcul de flux diffusif,
+calcul de gradient...)
+\end{itemize}
+
+Deux cas particuliers~:
+\begin{itemize}
+\item aux entr\'ees ou sorties pour lesquelles toutes les variables sont impos\'ees
+(\var{IESICF}), on utilise une condition de Neumann homog\`ene pour la pression
+(hormis pour le calcul du gradient intervenant dans l'\'equation de la quantit\'e
+de mouvement, qui est pris en compte par le flux convectif d\'etermin\'e par le
+sch\'ema de Rusanov). Ce choix est arbitraire (on n'a pas test\'e le comportement
+de l'algorithme si l'on conserve une condition de Dirichlet sur la pression), mais
+a \'et\'e fait en supposant qu'une condition de Neumann homog\`ene serait {\it a
+priori} moins d\'estabilisante, dans la mesure o\`u, pour ce type de fronti\`ere,
+l'utilisateur peut imposer une valeur de pression tr\`es diff\'erente de
+celle r\'egnant \`a l'int\'erieur du domaine (la valeur impos�e est utilis�e
+pour le flux convectif).
+\item pour les grandeurs turbulentes et les scalaires utilisateur, si
+le flux de masse est entrant et que l'on a fourni
+une valeur de Dirichlet (\var{RCODCL(*,*,1)} dans \fort{uscfcl}),
+on l'utilise, pour le calcul du flux convectif et du flux diffusif~;
+sinon, on utilise une condition de Neumann homog\`ene (le concept
+de sortie de type 9 ou 10 est couvert par cette approche).
+\end{itemize}
+
+
+
+%=================================
+\subsection{Probl\`eme de Riemann au bord}
+\label{Cfbl_Cfxtcl_section_pb_riemann_cfener}
+%=================================
+
+%---------------------------------
+\subsubsection{Introduction}
+%---------------------------------
+
+On cherche \`a obtenir un \'etat au bord,
+pour les entr\'ees, les sorties et les parois.
+
+Pour cela, on fait abstraction des flux diffusifs et des sources.
+Le syst\`eme r\'esultant est alors appel\'e syst\`eme
+d'\'equations d'Euler. On se place de plus dans un
+rep\`ere orient\'e suivant la normale au bord consid\'er\'e
+$(\vect{\tau}_1,\vect{\tau}_2,\vect{n})$
+et l'on ne consid\`ere que les variations suivant cette normale.
+Le syst\`eme devient donc~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_euler_cfxtcl}
+\begin{array}{lllll}
+\displaystyle\frac{\partial \vect{W}}{\partial t}
++ \frac{\partial}{\partial n}\vect{F}_n(\vect{W})
+= 0
+&\text{avec}
+& \vect{F}_n(\vect{W})
+ = \displaystyle\sum\limits_{i=1}^3 n_i \vect{F}_i(\vect{W})
+& \text{et}
+& \displaystyle\frac{\partial}{\partial n}
+= \displaystyle\sum\limits_{i=1}^3 n_i \frac{\partial}{\partial x_i}
+\end{array}
+\end{equation}
+
+Pour d\'eterminer les valeurs des variables au bord, on recherche
+l'\'evolution du probl\`eme instationnaire suivant,
+appel\'e probl\`eme de Riemann~:
+
+\unitlength=1cm
+\begin{picture}(20,2.6)
+\put(1.5,0){\framebox(12,2.5){}}
+\put(7.5,0){\line(0,1){2.5}}
+\put(7.5,2.2){bord}
+\put(7.5,1.7){\vector(1,0){0.7}}
+\put(8.25,1.65){$\vect{n}$}
+\multiput(7.5,0)(0,0.5){4}{\line(2,3){.4}}
+\put(2,1.2){$\begin{array}{c}
+\text{int\'erieur}\\
+\vect{W}_{\,i}\\
+\text{\'etat constant dans la cellule $i$}
+\end{array}$}
+\put(9.5,1.2){$\begin{array}{c}
+\text{ext\'erieur}\\
+\vect{W}_{\,\infty}\\
+\text{\'etat constant}
+\end{array}$}
+\end{picture}
+
+avec $\vect{W}_{\,\infty}$ d\'ependant du type de bord et diff\'erent
+de $\vect{W}_{\,i}$ {\it a priori}.
+
+\vspace{0.3cm}
+
+Pour r\'esoudre ce probl\`eme de Riemann, on utilisera les variables
+non-conservatives $\widetilde{\vect{W}}=\ ^t(\rho, \vect{u}, P)$
+et l'on retrouvera l'\'energie gr\^ace \`a l'\'equation d'\'etat.
+
+Pour all\'eger l'\'ecriture, dans le pr\'esent
+paragraphe~\ref{Cfbl_Cfxtcl_section_pb_riemann_cfener},
+on notera aussi $\vect{W}$ le vecteur
+$^t(\rho, \vect{u}, P)$ et $\vect{u} = \vect{u}_\tau + u\,\vect{n}$
+(en posant $u=\vect{u} \cdot \vect{n}$
+et $\vect{u}_\tau = \vect{u} - (\vect{u} \cdot \vect{n})\vect{n}$).
+
+La solution est une suite d'\'etats constants, dont les valeurs
+d\'ependent de $\vect{W}_{\,i}$ et $\vect{W}_{\,\infty}$,
+s\'epar\'es par des ondes se d\'epla\c cant \`a des vitesses donn\'ees
+par les valeurs propres du syst\`eme $(\lambda_i)_{i=1\ldots 5}$.
+On repr\'esente les caract\'eristiques du syst\`eme sur le sch\'ema suivant~:
+
+\unitlength=1cm
+\begin{picture}(20,3.5)
+\put(3,0){\vector(1,0){8}}
+\put(7,0){\vector(0,1){3}}
+\put(11,0.1){$x$}
+\put(6.8,2.9){$t$}
+\put(7,3.1){bord}
+\put(7,2.6){\vector(1,0){0.5}}
+\put(7.55,2.65){$\vect{n}$}
+\multiput(7,0)(0,0.5){5}{\line(2,3){.4}}
+\put(7,0){\line(-1,2){1.4}}
+\put(4,2.9){$\lambda_1=u-c$}
+\put(7,0){\qbezier[15](0,0)(0.7,1.4)(1.4,2.8)}
+\put(8.3,2.9){$\lambda_{2,3,4}=u$}
+\put(7,0){\line(2,1){3}}
+\put(9.5,1.6){$\lambda_5=u+c$}
+\put(5,1.5){$\vect{W}_{\,i}$}
+\put(6.3,2){$\vect{W}_{\,1}$}
+\put(8.4,1.6){$\vect{W}_{\,2}$}
+\put(9.5,0.5){$\vect{W}_{\,\infty}$}
+\end{picture}
+
+Comme valeurs des variables au bord, on prendra les valeurs correspondant \`a
+l'\'etat constant qui contient le bord ($\vect{W}_1$ dans l'exemple
+pr\'ec\'edent).
+
+Il faut remarquer que la solution du probl\`eme de Riemann d\'epend de la
+thermodynamique et devra donc \^etre calcul\'ee et cod\'ee
+par l'utilisateur si la thermodynamique n'a pas \'et\'e pr\'evue
+(en version 1.2, la seule
+thermodynamique pr\'evue est celle des gaz parfaits).
+
+
+
+%---------------------------------
+\subsubsection{En paroi, pour la condition de pression (sans effet de gravit\'e)}
+%---------------------------------
+
+Pour les faces de paroi, on d\'efinit \`a l'ext\'erieur du domaine
+un \'etat miroir $\vect{W}_{\,\infty}$ par~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_paroi_cfxtcl}
+\begin{array}{lllll}
+\vect{W}_{\,i} &=&
+\left(\begin{array}{l}
+\rho_i\\ {\vect{u}_\tau}_i\\ u_i\\ P_i
+\end{array}\right)
+\qquad
+\vect{W}_{\,\infty} &=&
+\left(\begin{array}{lll}
+\rho_\infty &=& \rho_i\\
+{\vect{u}_\tau}_\infty &=& {\vect{u}_\tau}_i\\
+u_\infty &=& -u_i\\
+P_\infty &=& P_i
+\end{array}\right)
+\end{array}
+\end{equation}
+
+\vspace{0.5cm}
+
+Les solutions d\'ependent de l'orientation de la vitesse dans la cellule
+de bord~:
+
+\vspace{0.5cm}
+
+\begin{enumerate}
+
+\item Si $u_i \leqslant 0$,
+la solution est une double d\'etente sym\'etrique.
+
+\unitlength=1cm
+\begin{picture}(20,4)
+\put(0,0.5){\vector(1,0){8}}
+\put(4,0.5){\vector(0,1){3}}
+\put(8,0.6){$x$}
+\put(3.8,3.4){$t$}
+\put(4,3.7){paroi}
+\put(4,3.2){\vector(1,0){0.5}}
+\put(4.55,3.15){$\vect{n}$}
+\multiput(4,0.5)(0,0.5){5}{\line(2,3){.4}}
+\put(4,0.5){\line(-1,1){2.5}}
+\put(4,0.5){\line(-5,4){2.8}}
+\put(4,0.5){\line(-4,5){2}}
+\put(0,3.1){$\lambda_1=u-c\ (<0)$}
+\put(4.2,2.7){$\lambda_{2,3,4}=0$}
+\put(4,0.5){\line(1,1){2.5}}
+\put(4,0.5){\line(5,4){2.8}}
+\put(4,0.5){\line(4,5){2}}
+\put(6.5,3.1){$\lambda_5=u+c\ (>0)$}
+\put(1.5,1.5){$\vect{W}_{\,i}$}
+\put(3.1,2){$\vect{W}_{\,1}$}
+\put(4.5,2){$\vect{W}_{\,2}$}
+\put(6,1.5){$\vect{W}_{\,\infty}$}
+\put(8.5,2){$\vect{W}_{\,paroi} = \vect{W}_{\,1} = \vect{W}_{\,2}$}
+\put(12,2)
+{$\left\{\begin{array}{l}
+\rho_p = \rho_1 = \rho_2\\
+u_p = u_1 = u_2\\
+P_p = P_1 = P_2
+\end{array}\right.$}
+\end{picture}
+
+La conservation de la vitesse tangentielle \`a travers la 1-onde donne
+${\vect{u}_\tau}_p = {\vect{u}_\tau}_i$.
+Par des consid\'erations de sym\'etrie on trouve $u_p = 0$.
+Puis on obtient $\rho_p$ et $P_p$ en \'ecrivant la conservation
+des invariants de Riemann \`a travers la 1-d\'etente~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_invariants_detente_cfxtcl}
+\begin{array}{lll}
+\left\{\begin{array}{l}
+u_1 + \displaystyle\int_0^{\rho_1} \frac{c}{\rho} d\rho
+= u_i + \displaystyle\int_0^{\rho_i} \frac{c}{\rho} d\rho\\
+\\
+s_1 = s_i
+\end{array}\right.
+&
+\Rightarrow
+\left\{\begin{array}{ll}
+\displaystyle\int_{\rho_i}^{\rho_1} \frac{c}{\rho} d\rho = u_i
+& \Rightarrow \rho_p=\rho_1\\
+\\
+s(P_1,\rho_1) = s(P_i,\rho_i)
+& \Rightarrow P_p=P_1
+\end{array}\right.
+\end{array}
+\end{equation}
+
+\vspace{0.5cm}
+
+\item Si $u_i > 0$,
+la solution est un double choc sym\'etrique.
+
+\unitlength=1cm
+\begin{picture}(20,4)
+\put(0,0.5){\vector(1,0){8}}
+\put(4,0.5){\vector(0,1){3}}
+\put(8,0.6){$x$}
+\put(3.8,3.4){$t$}
+\put(4,3.7){paroi}
+\put(4,3.2){\vector(1,0){0.5}}
+\put(4.55,3.15){$\vect{n}$}
+\multiput(4,0.5)(0,0.5){5}{\line(2,3){.4}}
+\put(4,0.5){\line(-1,1){2.5}}
+\put(0,3.1){$\lambda_1=u-c\ (<0)$}
+\put(4.4,2.7){$\lambda_{2,3,4}=0$}
+\put(4,0.5){\line(1,1){2.5}}
+\put(6.5,3.1){$\lambda_5=u+c\ (>0)$}
+\put(1.5,1.5){$\vect{W}_{\,i}$}
+\put(3,2){$\vect{W}_{\,1}$}
+\put(4.7,2){$\vect{W}_{\,2}$}
+\put(6,1.5){$\vect{W}_{\,\infty}$}
+\put(8.5,2){$\vect{W}_{\,paroi} = \vect{W}_{\,1} = \vect{W}_{\,2}$}
+\put(12,2)
+{$\left\{\begin{array}{l}
+\rho_p = \rho_1 = \rho_2\\
+u_p = u_1 = u_2\\
+P_p = P_1 = P_2
+\end{array}\right.$}
+\end{picture}
+
+De m\^eme que pr\'ec\'edemment,
+on trouve ${\vect{u}_\tau}_p = {\vect{u}_\tau}_i$ et $u_p = 0$,
+puis $\rho_p$ et $P_p$ en \'ecrivant les relations de saut
+\`a travers le 1-choc~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_saut_choc_cfxtcl}
+\begin{array}{lll}
+\left\{\begin{array}{l}
+\rho_1 \rho_i (u_1 - u_i)^2
+= (P_1 - P_i)(\rho_1 - \rho_i)\\
+\\
+2\rho_1 \rho_i (\varepsilon_1 - \varepsilon_i)
+= (P_1 + P_i)(\rho_1 - \rho_i)
+\end{array}\right.
+& \text{avec } \varepsilon = \varepsilon(P,\rho)
+&
+\Rightarrow
+\left\{\begin{array}{l}
+\rho_p=\rho_1\\
+\\
+P_p=P_1
+\end{array}\right.
+\end{array}
+\end{equation}
+
+\bigskip
+Pour les gaz parfaits,
+avec $M_i = \displaystyle\frac{\vect{u}_i \cdot \vect{n}}{c_i}$
+(Nombre de Mach de paroi), on a~:
+
+\begin{itemize}
+
+\item Cas d\'etente ($M_i \leqslant 0$)~:\\
+$$
+\begin{array}{l}
+\left\{\begin{array}{lll}
+P_p=0 & \text{si} & 1 + \displaystyle\frac{\gamma-1}{2}M_i<0\\
+P_p = P_i \left(1 + \displaystyle\frac{\gamma-1}{2}M_i\right)
+^{\frac{2\gamma}{\gamma-1}} & \text{sinon}\\
+\end{array}\right.\\
+\\
+\rho_p=\rho_i \left(\displaystyle\frac{P_p}{P_i}\right)^{\frac{1}{\gamma}}\\
+\end{array}
+$$
+
+\item Cas choc ($M_i > 0$)~:\\
+$$
+\begin{array}{l}
+P_p = P_i \left(1 + \displaystyle\frac{\gamma(\gamma+1)}{4}M_i^2
++\gamma M_i \displaystyle\sqrt{1+\displaystyle\frac{(\gamma+1)^2}{16}M_i^2}\right)
+\\
+\\
+\rho_p=\rho_i \left(\displaystyle\frac{P_p-P_i}
+{P_p-P_i-\rho_i (\vect{u}_i \cdot \vect{n})^2}\right)\\
+\end{array}
+$$
+
+\end{itemize}
+
+\end{enumerate}
+
+En pratique, le flux convectif normal \`a la paroi est nul et seule
+la condition de pression d\'etermin\'ee ci-dessus est effectivement
+utilis\'ee (pour le calcul du gradient sans effet de gravit\'e).
+
+%---------------------------------
+\subsubsection{En sortie}
+%---------------------------------
+
+Il existe deux cas de traitement des conditions en sortie,
+selon le nombre de Mach normal \`a la face de bord
+($c_i$ est la vitesse du son dans la cellule de bord)~:
+$$M_i = \displaystyle\frac{u_i}{c_i}
+= \displaystyle\frac{\vect{u}_i \cdot \vect{n}}{c_i}$$
+
+\paragraph{Sortie supersonique (condition ISSPCF de
+\fort{uscfcl})~:}
+$M_i \geqslant 1 \Rightarrow u_i - c_i \geqslant 0$
+\nopagebreak
+\linebreak
+\unitlength=1cm
+\begin{picture}(20,4.5)
+\put(0,0.5){\vector(1,0){8}}
+\put(4,0.5){\vector(0,1){3}}
+\put(8,0.6){$x$}
+\put(3.8,3.4){$t$}
+\put(4,3.7){bord}
+\put(4,3.2){\vector(1,0){0.5}}
+\put(4.55,3.15){$\vect{n}$}
+\multiput(4,0.5)(0,0.5){5}{\line(2,3){.4}}
+\put(4,0.5){\line(1,2){1.4}}
+\put(5.3,3.4){$\lambda_1=u-c\ (\geqslant 0)$}
+\put(4,0.5){\qbezier[20](0,0)(1.2,1.2)(2.4,2.4)}
+\put(6.5,2.9){$\lambda_{2,3,4}=u$}
+\put(4,0.5){\line(2,1){3}}
+\put(7.1,2){$\lambda_5=u+c$}
+\put(2,2){$\vect{W}_{\,i}$}
+\put(5.2,2.5){$\vect{W}_{\,1}$}
+\put(6,2){$\vect{W}_{\,2}$}
+\put(6.5,1){$\vect{W}_{\,\infty}$}
+\put(10,2){$\vect{W}_{\,bord} = \vect{W}_{\,i}$}
+\end{picture}
+
+Toutes les caract\'eristiques sont sortantes,
+on conna\^it donc toutes les conditions au bord~:
+
+\begin{equation}
+\left\{\begin{array}{l}
+\rho_b = \rho_i\\
+{\vect{u}_\tau}_b = {\vect{u}_\tau}_i\\
+u_b = u_i\\
+P_b = P_i
+\end{array}\right.
+\end{equation}
+
+\paragraph{Sortie subsonique (condition ISOPCF de
+\fort{uscfcl})~:}
+$0 \leqslant M_i < 1 \Rightarrow (u_i \geqslant 0 \text{ et } u_i - c_i < 0)$
+
+\unitlength=1cm
+\begin{picture}(20,4.5)
+\put(0,0.5){\vector(1,0){8}}
+\put(4,0.5){\vector(0,1){3}}
+\put(8,0.6){$x$}
+\put(3.8,3.4){$t$}
+\put(4,3.7){bord}
+\put(4,3.2){\vector(1,0){0.5}}
+\put(4.55,3.15){$\vect{n}$}
+\multiput(4,0.5)(0,0.5){5}{\line(2,3){.4}}
+\put(4,0.5){\line(-1,2){1.4}}
+\put(1,3.4){$\lambda_1=u-c\ (<0)$}
+\put(4,0.5){\qbezier[15](0,0)(0.7,1.4)(1.4,2.8)}
+\put(5.3,3.4){$\lambda_{2,3,4}=u\ (\geqslant 0)$}
+\put(4,0.5){\line(2,1){3}}
+\put(6.5,2.1){$\lambda_5=u+c$}
+\put(2,2){$\vect{W}_{\,i}$}
+\put(3.3,2.5){$\vect{W}_{\,1}$}
+\put(5.4,2.1){$\vect{W}_{\,2}$}
+\put(6.5,1){$\vect{W}_{\,\infty}$}
+\put(10,2){$\vect{W}_{\,bord} = \vect{W}_{\,1}$}
+\put(12.5,2)
+{$\left\{\begin{array}{l}
+\rho_b = \rho_1\\
+u_b = u_1\\
+P_b = P_1
+\end{array}\right.$}
+\end{picture}
+
+On a une caract\'eristique entrante,
+on doit donc imposer une seule condition au bord
+(en g\'en\'eral la pression de sortie $P_{ext}$).
+
+On conna\^it alors $P_b = P_{ext}$ et ${\vect{u}_\tau}_b = {\vect{u}_\tau}_i$
+(par conservation de la vitesse tangentielle \`a travers la 1-onde).
+Pour trouver les inconnues manquantes ($\rho_b$ et $u_b$)
+on doit r\'esoudre le passage de la 1-onde~:
+
+\begin{enumerate}
+
+\item Si $P_{ext} \leqslant P_i$,
+on a une 1-d\'etente.
+
+On \'ecrit la conservation
+des invariants de Riemann \`a travers la 1-d\'etente~:
+\begin{equation}
+\begin{array}{lll}
+\left\{\begin{array}{l}
+s_1 = s_i\\
+\\
+u_1 + \displaystyle\int_0^{\rho_1} \frac{c}{\rho} d\rho
+= u_i + \displaystyle\int_0^{\rho_i} \frac{c}{\rho} d\rho
+\end{array}\right.
+&
+\Rightarrow
+\left\{\begin{array}{ll}
+s(P_{ext},\rho_1) = s(P_i,\rho_i)
+& \Rightarrow \rho_b=\rho_1\\
+\\
+u_1 = u_i - \displaystyle\int_{\rho_i}^{\rho_1} \frac{c}{\rho} d\rho
+& \Rightarrow u_b = u_1
+\end{array}\right.
+\end{array}
+\end{equation}
+
+\item Si $P_{ext} > P_i$,
+on a un 1-choc.
+
+On \'ecrit les relations de saut \`a travers le 1-choc~:
+\begin{equation}
+\begin{array}{lll}
+\left\{\begin{array}{l}
+\rho_1 \rho_i (u_1 - u_i)^2
+= (P_{ext} - P_i)(\rho_1 - \rho_i)\\
+\\
+2\rho_1 \rho_i (\varepsilon(P_{ext},\rho_1) - \varepsilon(P_i,\rho_i))
+= (P_{ext} + P_i)(\rho_1 - \rho_i)
+\end{array}\right.
+&
+\Rightarrow
+\left\{\begin{array}{l}
+\rho_b=\rho_1\\
+\\
+u_b = u_1
+\end{array}\right.
+\end{array}
+\end{equation}
+
+\bigskip
+Pour les gaz parfaits, on a~:
+\begin{itemize}
+
+\item Cas d\'etente ($P_{ext} \leqslant P_i$)~:\\
+$$
+\begin{array}{l}
+P_b=P_{ext}\\
+\\
+\rho_b=\rho_i \left(\displaystyle\frac{P_{ext}}{P_i}\right)^{\frac{1}{\gamma}}
+\end{array}
+$$
+
+\item Cas choc ($P_{ext} > P_i$)~:\\
+$$
+\begin{array}{l}
+P_b=P_{ext}\\
+\\
+\rho_b=\rho_i \left(\displaystyle\frac{P_{ext}-P_i}{P_{ext}-P_i-\rho_i
+(\vect{u}_i \cdot \vect{n} - \vect{u}_b \cdot \vect{n})^2}\right)
+= \rho_i \left(\displaystyle\frac{(\gamma+1)P_{ext}+(\gamma-1)P_i}
+{(\gamma-1)P_{ext}+(\gamma+1)P_i}\right)\\
+\end{array}
+$$
+
+\end{itemize}
+
+\end{enumerate}
+
+La valeur de la masse volumique au bord intervient en particulier
+dans le flux de masse.
+
+
+%---------------------------------
+\subsubsection{En entr\'ee}
+%---------------------------------
+
+L'utilisateur impose les valeurs qu'il souhaite pour les variables
+en entr\'ee~:
+$$
+\begin{array}{lllll}
+\vect{W}_{\,ext} &=&
+\left(\begin{array}{l}
+\rho_{ext}\\ {\vect{u}_\tau}_{ext}\\ u_{ext}\\ P_{ext}
+\end{array}\right)
+\end{array}
+$$
+
+De m\^eme que pr\'ec\'edemment, il existe deux cas de traitement
+des conditions en entr\'ee,
+pilot\'es par le nombre de Mach entrant, normalement \`a la face de bord
+(avec $c_{ext}$ la vitesse du son en entr\'ee)~:
+$$M_{ext} = \displaystyle\frac{u_{ext}}{c_{ext}}
+= \displaystyle\frac{\vect{u}_{ext} \cdot \vect{n}}{c_{ext}}$$
+
+\paragraph{Entr\'ee supersonique (condition IESICF de
+\fort{uscfcl})~:}
+$M_{ext} \leqslant -1 \Rightarrow u_{ext} + c_{ext} \leqslant 0$
+
+\unitlength=1cm
+\begin{picture}(20,4.5)
+\put(0,0.5){\vector(1,0){8}}
+\put(4,0.5){\vector(0,1){3}}
+\put(8,0.6){$x$}
+\put(3.8,3.4){$t$}
+\put(4,3.7){bord}
+\put(4,3.2){\vector(1,0){0.5}}
+\put(4.55,3.15){$\vect{n}$}
+\multiput(4,0.5)(0,0.5){5}{\line(2,3){.4}}
+\put(4,0.5){\line(-2,1){3}}
+\put(0,2.1){$\lambda_1=u-c$}
+\put(4,0.5){\qbezier[20](0,0)(-1.2,1.2)(-2.4,2.4)}
+\put(0,2.9){$\lambda_{2,3,4}=u$}
+\put(4,0.5){\line(-1,2){1.4}}
+\put(1,3.4){$\lambda_5=u+c\ (\leqslant 0)$}
+\put(1.5,1){$\vect{W}_{\,i}$}
+\put(2,1.7){$\vect{W}_{\,1}$}
+\put(2.2,2.5){$\vect{W}_{\,2}$}
+\put(6,2){$\vect{W}_{\,\infty}$}
+\put(10,2){$\vect{W}_{\,bord} = \vect{W}_{\,\infty} = \vect{W}_{\,ext}$}
+\end{picture}
+
+Toutes les caract\'eristiques sont entrantes,
+toutes les conditions au bord sont donc impos\'ees par l'utilisateur.
+
+\begin{equation}
+\left\{\begin{array}{l}
+\rho_b = \rho_{ext}\\
+{\vect{u}_\tau}_b = {\vect{u}_\tau}_{ext}\\
+u_b = u_{ext}\\
+P_b = P_{ext}
+\end{array}\right.
+\end{equation}
+
+
+\paragraph{Entr\'ee subsonique (condition IERUCF de
+\fort{uscfcl})~: }
+$$-1 < M_{ext} \leqslant 0
+\Rightarrow (u_{ext} \leqslant 0 \text{ et } u_{ext} + c_{ext} > 0)$$
+
+
+\unitlength=1cm
+\begin{picture}(20,4.5)
+\put(0,0.5){\vector(1,0){8}}
+\put(4,0.5){\vector(0,1){3}}
+\put(8,0.6){$x$}
+\put(3.8,3.4){$t$}
+\put(4,3.7){bord}
+\put(4,3.2){\vector(1,0){0.5}}
+\put(4.55,3.15){$\vect{n}$}
+\multiput(4,0.5)(0,0.5){5}{\line(2,3){.4}}
+\put(4,0.5){\line(-2,1){3}}
+\put(0,2.1){$\lambda_1=u-c$}
+\put(4,0.5){\qbezier[15](0,0)(-0.7,1.4)(-1.4,2.8)}
+\put(1.1,3.4){$\lambda_{2,3,4}=u\ (\leqslant 0)$}
+\put(4,0.5){\line(1,2){1.4}}
+\put(5.3,3.4){$\lambda_5=u+c\ (>0)$}
+\put(1.5,1){$\vect{W}_{\,i}$}
+\put(2,2.1){$\vect{W}_{\,1}$}
+\put(3.3,2.5){$\vect{W}_{\,2}$}
+\put(6,2){$\vect{W}_{\,\infty}$}
+\put(10,2){$\vect{W}_{\,bord} = \vect{W}_{\,2}$}
+\put(12.5,2)
+{$\left\{\begin{array}{l}
+\rho_b = \rho_2\\
+u_b = u_2\\
+P_b = P_2
+\end{array}\right.$}
+\end{picture}
+
+
+On a une caract\'eristique sortante.
+L'utilisateur doit donc laisser un degr\'e de libert\'e.
+
+En g\'en\'eral, on impose le flux de masse en entr\'ee, donc $\rho_{ext}$
+et $u_{ext}$, et l'on calcule la pression au bord en r\'esolvant
+le passage des 1$\sim$4-ondes.
+On conna\^it aussi ${\vect{u}_\tau}_b = {\vect{u}_\tau}_{ext}$,
+par conservation de la vitesse tangentielle \`a travers la 5-onde.
+
+\begin{enumerate}
+
+\item Si $u_{ext} \geqslant u_i$,
+on a une 1-d\'etente.
+
+On \'ecrit la conservation
+des invariants de Riemann \`a travers la 1-d\'etente
+et la conservation de la vitesse et de la pression \`a travers le contact~:
+\begin{equation}
+\begin{array}{lll}
+\begin{array}{l}
+\left\{\begin{array}{l}
+u_1 + \displaystyle\int_0^{\rho_1} \frac{c}{\rho} d\rho
+= u_i + \displaystyle\int_0^{\rho_i} \frac{c}{\rho} d\rho\\
+\\
+s_1 = s_i
+\end{array}\right.\\
+\\
+\left\{\begin{array}{l}
+u_1 = u_2 = u_{ext}\\
+\\
+P_1 = P_2
+\end{array}\right.
+\end{array}
+&
+\Rightarrow
+\left\{\begin{array}{ll}
+\displaystyle\int_{\rho_i}^{\rho_1} \frac{c}{\rho} d\rho
+= u_i - u_{ext}
+& \Rightarrow \rho_1\\
+\\
+s(P_2,\rho_1) = s(P_i,\rho_i)
+& \Rightarrow P_b = P_2
+\end{array}\right.
+\end{array}
+\end{equation}
+
+\item Si $u_{ext} < u_i$,
+on a un 1-choc.
+
+On \'ecrit les relations de saut \`a travers le 1-choc
+et la conservation de la vitesse et de la pression \`a travers le contact~:
+\begin{equation}
+\begin{array}{lll}
+\begin{array}{l}
+\left\{\begin{array}{l}
+\rho_1 \rho_i (u_1 - u_i)^2
+= (P_1 - P_i)(\rho_1 - \rho_i)\\
+\\
+2\rho_1 \rho_i (\varepsilon_1 - \varepsilon_i)
+= (P_1 + P_i)(\rho_1 - \rho_i)\\
+\\
+\varepsilon = \varepsilon(P,\rho)
+\end{array}\right.\\
+\\
+\left\{\begin{array}{l}
+u_1 = u_2 = u_{ext}\\
+\\
+P_1 = P_2
+\end{array}\right.
+\end{array}
+&
+\Rightarrow
+\left\{\begin{array}{l}
+\rho_1\\
+\\
+P_b = P_2
+\end{array}\right.
+\end{array}
+\end{equation}
+
+\bigskip
+Pour les gaz parfaits, on a~:
+
+\begin{itemize}
+
+\item Cas d\'etente ($\delta M \leqslant 0$)~:\\
+$$
+\begin{array}{l}
+\left\{\begin{array}{lll}
+P_b=0 & \text{si} & 1 + \displaystyle\frac{\gamma-1}{2}\delta M<0\\
+P_b = P_i \left(1 + \displaystyle\frac{\gamma-1}{2}\delta M\right)
+^{\frac{2\gamma}{\gamma-1}} & \text{sinon}\\
+\end{array}\right.\\
+\\
+\rho_b= \rho_{ext}\\
+\end{array}
+$$
+
+\item Cas choc ($\delta M > 0$)~:\\
+$$
+\begin{array}{l}
+P_b = P_i \left(1 + \displaystyle\frac{\gamma(\gamma+1)}{4}\delta M^2
++\gamma \delta M \displaystyle\sqrt{1+\displaystyle\frac{(\gamma+1)^2}{16}\delta M^2}\right)
+\\
+\\
+\rho_b=\rho_{ext}\\
+\end{array}
+$$
+
+\end{itemize}
+
+\end{enumerate}
+
+
+%=================================
+\subsection{Condition de pression en paroi avec effets de gravit\'e}
+%=================================
+
+Le probl\`eme de Riemann consid\'er\'e pr\'ec\'edemment
+ne prend pas en compte les effets de la gravit\'e.
+Or, dans certains cas, si l'on ne prend pas en compte le gradient de
+pression ``hydrostatique'', on peut obtenir une solution erron\'ee
+(en particulier, par exemple,
+on peut cr\'eer une source de quantit\'e de mouvement
+non physique dans un milieu initialement au repos).
+
+\'Ecrivons l'\'equilibre local dans la maille de bord~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_equilibre_local_cfxtcl}
+\gradv{P} = \rho \vect{g}
+\end{equation}
+
+Pour simplifier la r\'esolution, on peut utiliser la formulation
+de (\ref{Cfbl_Cfxtcl_eq_equilibre_local_cfxtcl}) en incompressible
+(c'est cette approche qui a \'et\'e adopt\'ee dans \CS)~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_equilibre_incompressible_cfxtcl}
+\begin{array}{lll}
+\left(\gradv{P}\right)_i = \rho_i \vect{g}
+& \text{ce qui donne}
+& P_{paroi} = P_i + \rho_i \vect{g} \cdot (\vect{x}_{paroi} - \vect{x}_i)
+\end{array}
+\end{equation}
+
+
+Une autre approche (d\'ependante de l'\'equation d'\'etat)
+consiste \`a r\'esoudre l'\'equilibre local avec la formulation
+compressible (\ref{Cfbl_Cfxtcl_eq_equilibre_local_cfxtcl}), en supposant de plus que
+la maille est isentropique~:
+\begin{equation}
+\left\{\begin{array}{lll}
+\gradv{P} = \rho \vect{g}\\
+\\
+P = P(\rho,s_i)
+\end{array}\right.
+\end{equation}
+Ce qui donne, pour un gaz parfait~:
+\begin{equation}
+\label{Cfbl_Cfxtcl_eq_equilibre_compressible_cfxtcl}
+ P_{paroi} = P_i \left( 1+ \displaystyle\frac{\gamma -1}{\gamma}
+\displaystyle\frac{\rho_i}{P_i} \vect{g} \cdot (\vect{x}_{paroi} - \vect{x}_i)
+\right)^{\frac{\gamma}{\gamma -1}}
+\end{equation}
+
+\paragraph{Remarque~:}
+la formule issue de l'incompressible (\ref{Cfbl_Cfxtcl_eq_equilibre_incompressible_cfxtcl})
+est une lin\'earisation de la formule (\ref{Cfbl_Cfxtcl_eq_equilibre_compressible_cfxtcl}).
+Dans les cas courants elle s'\'eloigne tr\`es peu de la formule exacte.
+Dans des conditions extr\^emes,
+si l'on consid\`ere par exemple
+de l'air \`a $1000K$ et $10bar$, avec une acc\'el\'eration
+de la pesanteur $g=1000m/s^2$ et une diff\'erence de hauteur entre
+le centre de la cellule et le centre de la face de bord de $10m$,
+l'expression (\ref{Cfbl_Cfxtcl_eq_equilibre_compressible_cfxtcl}) donne $P_{paroi} = 1034640,4Pa$
+et l'expression (\ref{Cfbl_Cfxtcl_eq_equilibre_incompressible_cfxtcl}) donne $P_{paroi} = 1034644,7Pa$,
+soit une diff\'erence relative de moins de $0,001\%$.
+On voit aussi que la diff\'erence entre la pression calcul\'ee au centre
+de la cellule et celle calcul\'ee au bord est de l'ordre de~$3\%$.
+
+%=================================
+\subsection{Sch\'ema de Rusanov pour le calcul de flux convectifs au bord}
+%=================================
+
+
+%---------------------------------
+\subsubsection{Introduction}
+%---------------------------------
+
+Le sch\'ema de Rusanov est utilis\'e pour certains types de conditions aux
+limites afin de passer du vecteur d'\'etat calcul\'e au bord comme indiqu\'e
+pr\'ec\'edemment (solution du probl\`eme de Riemann) \`a un flux convectif de
+bord (pour la masse, la quantit\'e de
+mouvement et l'\'energie). L'utilisation de ce sch\'ema (d\'ecentr\'e amont)
+permet de gagner en stabilit\'e.
+
+Le sch\'ema de Rusanov est appliqu\'e aux fronti\`eres auxquelles on consid\`ere
+qu'il est le plus probable de rencontrer des conditions en accord imparfait
+avec l'\'etat r\'egnant dans le domaine, conditions qui sont donc susceptibles de
+d\'estabiliser le calcul~: il s'agit des entr\'ees et des sorties (fronti\`eres
+de type IESICF, ISOPCF, IERUCF, IEQHCF). En sortie
+supersonique (ISSPCF) cependant, le sch\'ema de Rusanov est inutile et
+n'est donc pas appliqu\'e~:
+en effet, pour ce type de fronti\`ere, l'\'etat impos\'e au bord est exactement
+l'\'etat amont et le d\'ecentrement du sch\'ema de Rusanov n'apporterait donc
+rien.
+
+%---------------------------------
+\subsubsection{Principe}
+%---------------------------------
+
+Pour le calcul du flux d\'ecentr\'e de Rusanov, on consid\`ere
+le syst\`eme hyperbolique
+constitu\'e des seuls termes convectifs issus
+des \'equations de masse, quantit\'e de mouvement et \'energie. Ce
+syst\`eme est \'ecrit, par changement de variable, en non conservatif
+(on utilise la relation
+$\displaystyle P=\frac{\rho\varepsilon}{\gamma-1}$ et
+on note $u_\xi$ les composantes de $\vect{u}$)~:
+
+\begin{equation}
+\left\{\begin{array}{lllll}
+\displaystyle\frac{\partial\rho}{\partial t}
+&+&\rho\divv{\,\vect{u}} + \vect{u}\,\grad{\,\rho}&=& 0 \\
+\displaystyle\frac{\partial u_\xi}{\partial t}
+&+& \vect{u}\,\grad{u_\xi}+\displaystyle\frac{1}{\rho}\,\frac{\partial
+P}{\partial \xi} &=& 0 \\
+\displaystyle\frac{\partial P}{\partial t}
+&+&\gamma\,P\,\dive{\vect{u}}+\vect{u}\,\grad{P}&=& 0
+\end{array}\right.
+\end{equation}
+
+En notant le vecteur d'\'etat $\vect{W}= (\rho,\vect{u},P)^t$,
+ce syst\`eme est not\'e~:
+\begin{equation}
+\displaystyle\frac{\partial \vect{W}}{\partial t} +\dive{\,\vect{F}(\vect{W})} = 0
+\end{equation}
+
+Avec $\delta\,\vect{W}$ l'incr\'ement temporel du vecteur d'\'etat, $\vect{n}$ la
+normale \`a une face, $ij$ la face interne partag\'ee par les cellules $i$ et
+$j$ et $ik$ la face de bord $k$ associ\'ee \`a la cellule $i$,
+la discr\'etisation spatiale conduit \`a~:
+\begin{equation}
+\displaystyle\frac{|\Omega_i|}{\Delta t}\delta\,\vect{W}_i
++\sum\limits_{j\in\,Vois(i)}\int_{S_{ij}} \vect{F}(\vect{W})\,\vect{n}\,dS
++\sum\limits_{k\in {\gamma_b(i)}}\int_{S_{\,{b}_{ik}}} \vect{F}(\vect{W})\,\vect{n}\,dS
+=0
+\end{equation}
+
+Sur une face de bord donn\'ee,
+on applique le sch\'ema de Rusanov pour calculer le flux
+comme suit~:
+\begin{equation}
+\frac{1}{|S_{\,{b}_{ik}}|}\int_{S_{\,{b}_{ik}}} \vect{F}(\vect{W})\,\vect{n}\,dS
+=\frac{1}{2}\left(\vect{F}(\vect{W}_i)+\vect{F}(\vect{W}_{\,{b}_{ik}})\right)\cdot\vect{n}_{\,{b}_{ik}}
+-\frac{1}{2}\rho_{rus\,{b}_{ik}}\left(\vect{W}_{\,{b}_{ik}}-\vect{W}_i\right)=\vect{F}_{rus\,{b}_{ik}}(\vect{W})
+\end{equation}
+
+Dans cette relation, $\vect{W}_{\,{b}_{ik}}$ est le vecteur d'\'etat
+$\vect{W}_{\infty}$, connu au bord (tel
+qu'il r\'esulte de la r\'esolution du probl\`eme de Riemann au bord
+pr\'esent\'ee plus haut pour chaque type de fronti\`ere consid\'er\'e).
+
+%---------------------------------
+\subsubsection{Param\`etre de d\'ecentrement $\rho_{rus\,{b}_{ik}}$}
+%---------------------------------
+
+Pour chaque face de bord, le scalaire $\rho_{rus\,{b}_{ik}}$ est la
+plus grande valeur du rayon spectral de la matrice jacobienne
+$\displaystyle\frac{\partial\,\vect{F}_n(\vect{W})}{\partial \vect{W}}$
+obtenu pour les vecteurs d'\'etat $\vect{W}_i$ et $\vect{W}_{\,{b}_{ik}}$.
+
+$\vect{F}_n$ est la composante du
+flux $\vect{F}$ dans la direction de la normale \`a la face de bord,
+$\vect{n}_{\,{b}_{ik}}$. Utiliser $\vect{F}_n$
+pour la d\'etermination du
+param\`etre de d\'ecentrement $\rho_{rus\,{b}_{ik}}$
+rel\`eve d'une approche classique qui consiste
+\`a remplacer le syst\`eme tridimensionnel
+initial par le syst\`eme unidimensionnel projet\'e dans la direction
+normale \`a la face, en n\'egligeant les variations du vecteur d'\'etat
+$\vect{W}$ dans la direction tangeante \`a la face~:
+\begin{equation}
+\displaystyle\frac{\partial \vect{W}}{\partial t} +\frac{\partial\,\vect{F}_n(\vect{W})}{\partial
+\vect{W}}\,\frac{\partial \vect{W}}{\partial n} = 0
+\end{equation}
+
+De mani\`ere plus explicite, si l'on se place dans un rep\`ere de calcul ayant
+$\vect{n}_{\,{b}_{ik}}$ comme vecteur de base, et si l'on note $u$ la
+composante de vitesse associ\'ee, le syst\`eme est le suivant (les \'equations
+portant sur les composantes transverses de la vitesse sont d\'ecoupl\'ees,
+associ\'ees \`a la valeur propre $u$, comme le serait un scalaire simplement
+convect\'e et ne sont pas \'ecrites ci-apr\`es)~:
+\begin{equation}
+\left\{\begin{array}{lllll}
+\displaystyle\frac{\partial\rho}{\partial t}
+&+&\displaystyle\rho\frac{\partial\,u}{\partial\,n} + u\,\frac{\partial\,\rho}{\partial\,n}&=& 0 \\
+\displaystyle\frac{\partial u}{\partial t}
+&+&\displaystyle u\,\frac{\partial\,u}{\partial\,n}+\frac{1}{\rho}\,\frac{\partial
+P}{\partial n} &=& 0 \\
+\displaystyle\frac{\partial P}{\partial t}
+&+&\displaystyle\gamma\,P\,\frac{\partial\,u}{\partial\,n}+u\,\frac{\partial\,P}{\partial\,n}&=& 0
+\end{array}\right.
+\end{equation}
+
+La matrice jacobienne associ\'ee est donc~:
+\begin{equation}
+\left(\begin{array}{lll}
+\displaystyle u & \rho & 0 \\
+\displaystyle 0 & u & \displaystyle\frac{1}{\rho} \\
+\displaystyle 0 & \gamma\, P & 0 \\
+\end{array}\right)
+\end{equation}
+
+Les valeurs propres sont $u$ et $\displaystyle\,u\pm c$ (avec
+$c=\sqrt\frac{\gamma\,P}{\rho}$). Le rayon spectral est donc
+$|u|+c$ et le param\`etre de d\'ecentrement s'en d\'eduit~:
+\begin{equation}
+\rho_{rus\,{b}_{ik}} = max\left(|u_i|+c_i,|u_{{b}_{ik}}|+c_{{b}_{ik}}\right)
+\end{equation}
+
+
+%---------------------------------
+\subsubsection{Expression des flux convectifs}
+%---------------------------------
+
+Les flux convectifs calcul\'es par le sch\'ema de Rusanov
+pour les variables masse, quantit\'e de mouvement
+et \'energie repr\'esentent donc la discr\'etisation des termes suivants~:
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle\dive(\vect{Q})\\
+\displaystyle\divv(\vect{u}\otimes\vect{Q})+\grad\,P\\
+\displaystyle\dive\left(\vect{Q}\,(e+\frac{P}{\rho})\right)
+\end{array}\right.
+\end{equation}
+
+Pour une face de bord $ik$ adjacente \`a la cellule $i$ et
+avec la valeur pr\'ec\'edente de $\rho_{rus\,{b}_{ik}}$, on a~:
+\begin{equation}
+\left\{\begin{array}{lll}
+\displaystyle\int_{S_{\,{b}_{ik}}}\vect{Q}\cdot\vect{n}\,dS
+&=&
+\displaystyle\frac{1}{2}\left(
+(\vect{Q}_i+\vect{Q}_{\,{b}_{ik}})\cdot\vect{n}_{\,{b}_{ik}}\right)\,S_{\,{b}_{ik}}\\
+&&\displaystyle \qquad\qquad\qquad\qquad\qquad\qquad
+-\frac{1}{2}\,\rho_{rus\,{b}_{ik}}
+\left(\rho_{\,{b}_{ik}}-\rho_i \right)\,S_{\,{b}_{ik}}\\
+%
+\displaystyle\int_{S_{\,{b}_{ik}}}(\vect{u}\otimes\vect{Q}+\grad\,P)\cdot\vect{n}\,dS
+&=&
+\displaystyle\frac{1}{2}\left(
+ \vect{u}_i(\vect{Q}_i\cdot\vect{n}_{\,{b}_{ik}})
++P_i\,\vect{n}_{\,{b}_{ik}}
++\vect{u}_{\,{b}_{ik}}(\vect{Q}_{\,{b}_{ik}}\cdot\vect{n}_{\,{b}_{ik}})
++P_{\,{b}_{ik}}\,\vect{n}_{\,{b}_{ik}}\right)\,S_{\,{b}_{ik}}\\
+&&\displaystyle \qquad\qquad\qquad\qquad\qquad\qquad
+-\frac{1}{2}\,\rho_{rus\,{b}_{ik}}
+\left(\vect{Q}_{\,{b}_{ik}}-\vect{Q}_i \right)\,S_{\,{b}_{ik}}\\
+%
+\displaystyle\int_{S_{\,{b}_{ik}}}(e+\frac{P}{\rho})\,\vect{Q}\cdot\vect{n}\,dS
+&=&
+\displaystyle\frac{1}{2}\left(
+(e_i+\frac{P_i}{\rho_i})\,(\vect{Q}_i\cdot\vect{n}_{\,{b}_{ik}})
++(e_{\,{b}_{ik}}+\frac{P_{\,{b}_{ik}}}{\rho_{\,{b}_{ik}}})(\vect{Q}_{\,{b}_{ik}}\cdot\vect{n}_{\,{b}_{ik}})
+\right)\,S_{\,{b}_{ik}}\\
+&&\displaystyle \qquad\qquad\qquad\qquad\qquad\qquad
+-\frac{1}{2}\,\rho_{rus\,{b}_{ik}}
+\left(\rho_{\,{b}_{ik}}\,e_{\,{b}_{ik}}-\rho_i\,e_i \right)\,S_{\,{b}_{ik}}\\
+\end{array}\right.
+\end{equation}
+
+
+
+%=================================
+\subsection{Conditions aux limites pour le flux diffusif d'\'energie}
+\label{Cfbl_Cfxtcl_section_cl_flux_diffusif_energie_cfener}
+%=================================
+
+%---------------------------------
+\subsubsection{Rappel}
+%---------------------------------
+
+Pour le flux de diffusion d'\'energie, les conditions aux limites sont
+impos\'ees de mani\`ere similaire \`a ce qui est d\'ecrit dans
+la documentation de \fort{clptur} et de
+\fort{condli}. La figure~(\ref{Cfbl_Cfxtcl_fig_flux_cfxtcl}) rappelle quelques notations
+usuelles et l'\'equation~(\ref{Cfbl_Cfxtcl_eq_flux_cfxtcl}) traduit la conservation du flux
+normal au bord pour la variable $f$.
+
+\begin{figure}[htp]
+\centerline{\includegraphics[height=7cm]{fluxbord}}
+\caption{\label{Cfbl_Cfxtcl_fig_flux_cfxtcl}Cellule de bord.}
+\end{figure}
+
+\begin{equation}\label{Cfbl_Cfxtcl_eq_flux_cfxtcl}
+\begin{array}{l}
+ \underbrace{h_{int}(f_{b,int}-f_{I'})}_{\phi_{int}}
+ = \underbrace{h_{b}(f_{b,ext}-f_{I'})}_{\phi_{b}}
+ = \left\{\begin{array}{ll}
+ \underbrace{h_{imp,ext}(f_{imp,ext}-f_{b,ext})}_{\phi_{\text{\it r\'eel
+impos\'e}}} &\text{(condition de Dirichlet)}\\
+ \underbrace{\phi_{\text{\it imp,ext}}}_{\phi_{\text{\it r\'eel impos\'e}}}
+ &\text{(condition de Neumann)}
+ \end{array}\right.
+\end{array}
+\end{equation}
+
+
+L'\'equation~(\ref{Cfbl_Cfxtcl_eq_fbint_cfxtcl}) rappelle la formulation des
+conditions aux limites pour une variable $f$.
+\begin{equation}\label{Cfbl_Cfxtcl_eq_fbint_cfxtcl}
+f_{b,int}
+ = \left\{\begin{array}{cccccl}
+ \displaystyle\frac{h_{imp,ext}}{h_{int}+h_r h_{imp,ext} }&f_{imp,ext}&+&
+ \displaystyle\frac{h_{int}+h_{imp,ext}(h_r-1)}{h_{int}+h_r h_{imp,ext} }&f_{I'}
+ &\text{(condition de Dirichlet)}\\
+ \displaystyle\frac{1}{h_{int}}&\phi_{\text{\it imp,ext}}&+&
+ \ &f_{I'}
+ &\text{(condition de Neumann)}
+ \end{array}\right.
+\end{equation}
+
+Les coefficients d'\'echange sont d\'efinis comme suit\footnote{On rappelle que, comme
+dans \fort{condli}, $\alpha$ d\'esigne $\lambda+C_p\,\frac{\mu_t}{\sigma_t}$
+si $f$ est la temp\'erature,
+$\frac{\lambda}{C_p}+\frac{\mu_t}{\sigma_t}$ si $f$ repr\'esente l'enthalpie.
+Le coefficient $C$ repr\'esente $C_p$ pour la temp\'erature et vaut
+$1$ pour l'enthalpie. La grandeur adimensionnelle $f^+$ est obtenue par
+application d'un principe de similitude en paroi~: pour la temp\'erature,
+elle d\'epend du nombre de
+Prandlt mol\'eculaire, du nombre de Prandtl turbulent et de la distance adimensionnelle \`a la paroi $y^+$ dans la cellule de bord.}~:
+\begin{equation}
+\left\{\begin{array}{lll}
+h_{int}&=&\displaystyle\frac{\alpha}{\overline{I'F}}\\
+h_r&=&\displaystyle\frac{h_{int}}{h_{b}} \\
+h_b&=&\displaystyle\frac{\phi_b}{f_{b,ext}-f_{I'}}=\frac{\rho\,C\,u_k}{f^+_{I'}}
+\end{array}\right.
+\end{equation}
+
+Dans \CS, on note les conditions aux limites de mani\`ere g\'en\'erale sous
+la forme suivante~:
+\begin{equation}
+f_{b,int}=A_b + B_b\,f_{I'}
+\end{equation}
+avec $A_b$ et $B_b$ d\'efinis selon le type des conditions~:
+\begin{equation}
+\begin{array}{c}
+\text{Dirichlet}\left\{\begin{array}{ll}
+ A_b = &\displaystyle\frac{h_{imp,ext}}{h_{int}+h_r h_{imp,ext} } f_{imp,ext}\\
+ B_b = &\displaystyle\frac{h_{int}+h_{imp,ext}(h_r-1)}{h_{int}+h_r h_{imp,ext} }
+ \end{array}\right.
+\text{\ \ Neumann}\left\{\begin{array}{ll}
+ A_b = &\displaystyle\frac{1}{h_{int}}\phi_{\text{\it imp,ext}}\\
+ B_b = &1
+ \end{array}\right.
+\end{array}
+\end{equation}
+
+%---------------------------------
+\subsubsection{Flux diffusif d'\'energie}
+%---------------------------------
+
+Dans le module compressible, on r\'esout une \'equation sur l'\'energie, qui s'\'ecrit, si
+l'on excepte tous les termes hormis le flux de diffusion et le terme
+instationnaire, pour faciliter la pr\'esentation~:
+
+\begin{equation}
+\begin{array}{lll}
+\displaystyle\frac{\partial \rho e}{\partial t} &=& - \dive{\,\vect{\Phi}_s}\\
+&=& \displaystyle\dive{(K\,\grad{T})} \text{\ \ avec \ \ } K=\lambda+C_p\,\frac{\mu_t}{\sigma_t}\\
+&=& \displaystyle\dive{\left(K\,\grad{\frac{e-\frac{1}{2}\,u^2-\varepsilon_{sup}}{C_v}}\right)} \\
+&=& \displaystyle\dive{\left(\frac{K}{C_v}\,\grad{(e-\frac{1}{2}\,u^2-\varepsilon_{sup})}\right)} \text{\ \
+si \ \ } C_v \text{\ est constant}\\
+&=& \displaystyle\dive{\left(\frac{K}{C_v}\,\grad\,e\right)}
+-\dive{\left(\frac{K}{C_v}\,\grad{(\frac{1}{2}\,u^2+\varepsilon_{sup})}\right)} \\
+
+\end{array}
+\end{equation}
+
+La d\'ecomposition en $e$ et $\frac{1}{2}\,u^2+\varepsilon_{sup}$ est purement
+math\'ematique (elle r\'esulte du fait que l'on r\'esout en \'energie alors que
+le flux thermique s'exprime en fonction de la temp\'erature). Aussi, pour imposer un
+flux de bord ou une temp\'erature de bord (ce qui revient au m\^eme puisque l'on
+impose toujours finalement la conservation du flux normal), on {\it choisit}
+de reporter la totalit\'e de la condition \`a la limite sur le terme
+$\displaystyle\frac{K}{C_v}\,\grad\,e$
+et donc d'annuler le flux associ\'e au terme
+$\displaystyle\frac{K}{C_v}\,\grad{(\frac{1}{2}\,u^2+\varepsilon_{sup})}$
+(en pratique, pour l'annuler, on se contente de ne pas l'ajouter
+au second membre de l'\'equation). Conform\'ement \`a l'approche retenue dans \CS et
+rappel\'ee pr\'ec\'edemment, on d\'eterminera donc une valeur de bord {\it
+fictive} de l'\'energie qui permette de reconstruire le flux diffusif total
+attendu \`a partir
+de la discr\'etisation du seul terme $\displaystyle\frac{K}{C_v}\,\grad\,e$.
+
+Remarque : dans la version 1.2.0,
+on utilise $\displaystyle
+\frac{K}{C_v}=\left(\frac{\lambda}{C_v}+\frac{\mu_t}{\sigma_t}\right)$, \`a
+partir de 1.2.1, on utilise la valeur $\displaystyle
+\frac{K}{C_v}=\left(\frac{\lambda}{C_v}+\frac{C_p}{C_v}\frac{\mu_t}{\sigma_t}\right)$.
+On notera que le nombre de Prandtl turbulent $\sigma_t$ est associ\'e \`a la variable
+r\'esolue et peut \^etre fix\'e par l'utilisateur.
+
+
+%---------------------------------
+\subsubsection{Condition de Neumann}
+%---------------------------------
+
+La conservation du flux s'\'ecrit~:
+
+\begin{equation}
+ \underbrace{h_{int}(e_{b,int}-e_{I'})}_{\phi_{int}}
+ =\underbrace{\phi_{\text{\it imp,ext}}}_{\phi_{\text{\it r\'eel impos\'e}}}
+\end{equation}
+
+On a donc dans ce cas~:
+\begin{equation}
+\left\{\begin{array}{lll}
+ A_b &= &\displaystyle\frac{1}{h_{int}}\phi_{\text{\it imp,ext}}\\
+ B_b &= &1
+\end{array}\right.
+\end{equation}
+
+
+%---------------------------------
+\subsubsection{Condition de Dirichlet}
+%---------------------------------
+
+On suppose que la condition de Dirichlet porte sur la temp\'erature $T_{b,ext}$.
+
+
+La conservation du flux s'\'ecrit~:
+\begin{equation}\label{Cfbl_Cfxtcl_eq_conservation_flux_cfxtcl}
+ \underbrace{h_{int}(e_{b,int}-e_{I'})}_{\phi_{int}\text{\ (forme num\'erique
+du flux)}}
+ = \underbrace{h_{b}(T_{b,ext}-T_{I'})}_{\phi_{b}\text{ qui int\`egre l'effet
+de couche limite}}
+ =
+ \underbrace{h'_{imp,ext}(T_{imp,ext}-T_{b,ext})}_{\phi_{\text{\it r\'eel
+impos\'e}}}
+\end{equation}
+
+Avec pour les coefficients d'\'echange~:
+\begin{equation}
+\left\{\begin{array}{lll}
+h_{int}&=&\displaystyle\frac{K}{C_v\,\overline{I'F}}\\
+h_b&=&\displaystyle\frac{\phi_b}{T_{b,ext}-T_{I'}}=\frac{\rho\,C_p\,u_k}{T^+_{I'}}
+\end{array}\right.
+\end{equation}
+
+On tire $T_{b,ext}$
+de la seconde partie de l'\'egalit\'e~(\ref{Cfbl_Cfxtcl_eq_conservation_flux_cfxtcl})
+traduisant la conservation du flux~:
+\begin{equation}
+\displaystyle T_{b,ext} = \frac{h'_{imp,ext}\,T_{imp,ext}+h_b\,T_{I'}}{h_b+h'_{imp,ext}}
+\end{equation}
+
+En utilisant cette valeur et la premi\`ere partie de l'\'equation de conservation
+du flux~(\ref{Cfbl_Cfxtcl_eq_conservation_flux_cfxtcl}), on obtient~:
+\begin{equation}
+e_{b,int} = \frac{h_b\,h'_{imp,ext}}{h_{int}\,(h_b+h'_{imp,ext})}\,(T_{imp,ext}-T_{I'})+e_{I'}
+\end{equation}
+
+On utilise alors
+$\displaystyle T_{I'}=\frac{1}{C_v}\left(e_{I'}-\frac{1}{2}u^2_{i}-\varepsilon_{sup,i}\right)$ pour
+\'ecrire (sans reconstruction pour la vitesse et $\varepsilon_{sup}$)~:
+\begin{equation}
+\displaystyle e_{b,int} =
+\frac{ -\frac{h_b\,h'_{imp,ext}}{C_v}+h_{int}\,(h_b+h'_{imp,ext}) }
+ { h_{int}\,(h_b+h'_{imp,ext}) } \,e_{I'}
++\frac{h_b\,h'_{imp,ext}}{h_{int}\,(h_b+h'_{imp,ext})}\,
+ \left(T_{imp,ext}+\frac{\frac{1}{2}u^2_{i}+\varepsilon_{sup,i}}{C_v}\right)
+\end{equation}
+
+
+Et on a donc, avec $\displaystyle h'_r=\frac{h_{int}}{\frac{h_b}{C_v}}$~:
+\begin{equation}
+\displaystyle e_{b,int} =
+\underbrace{\frac{ h'_{imp,ext} }{ C_v\,h_{int}+h'_r\,h'_{imp,ext} }\,
+ \left(C_v\,T_{imp,ext}+\frac{1}{2}u^2_{i}+\varepsilon_{sup,i}\right)}_{A_b}
++\underbrace{\frac{ C_v\,h_{int}+h'_{imp,ext}(h'_r-1) }{ C_v\,h_{int}+h'_r\,h'_{imp,ext} }}_{B_b}\,e_{I'}
+\end{equation}
+
+Avec ces notations, $h_b$ est le coefficient habituellement calcul\'e pour la
+temp\'erature.
+
+Le coefficient $h'_{imp,ext}$ est le coefficient d'\'echange externe qui est
+impos\'e pour la temp\'erature\footnote{Le coefficient $h'_{imp,ext}$
+est utile pour les cas o\`u l'on
+souhaite relaxer la condition \`a la limite~:
+pour la temp\'erature, cela correspond \`a imposer une valeur sur la face
+externe d'une paroi unidimensionnelle id\'eale, sans inertie,
+caract\'eris\'ee par un simple coefficient d'\'echange.}.
+Pour obtenir l'\'equivalent dimensionnel de $h'_{imp,ext}$ pour l'\'energie,
+il faut diviser sa valeur par $C_v$ (ce qui ne fait pas de diff\'erence dans
+la majorit\'e des cas, car il est habituellement pris infini).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%=================================
+\subsection{Introduction}
+%=================================
+
+Les conditions aux limites sont impos\'ees par une suite de sous-programmes,
+dans la mesure o\`u l'on a cherch\'e \`a rester coh\'erent avec la structure
+standard de \CS.
+
+Dans \fort{ppprcl} (appel\'e par \fort{precli}), on initialise les tableaux
+avant le calcul des conditions aux limites~:
+\begin{itemize}
+\item \var{IZFPPP} (num\'ero de zone, inutilis\'e, fix\'e \`a z\'ero),
+\item \var{IA(IIFBRU)} (rep\'erage des faces de bord pour
+lesquelles on applique un sch\'ema de Rusanov~: initialis\'e \`a z\'ero,
+on imposera la valeur 1 dans \fort{cfrusb} pour les faces auxquelles on applique le sch\'ema
+de Rusanov)
+\item \var{IA(IIFBET)} (rep\'erage des faces de paroi \`a temp\'erature ou
+\`a flux thermique impos\'e~: initialis\'e \`a 0, on imposera la valeur 1
+dans \fort{cfxtcl} lorsque la temp�rature ou le flux est impos�),
+\item \var{RCODCL(*,*,1)} (initialis\'e \`a \var{-RINFIN} en pr\'evision
+du traitement des sorties r\'eentrantes pour lesquelles l'utilisateur
+aurait fourni une valeur \`a imposer en Dirichlet),
+\item flux convectifs de bord pour la quantit\'e de mouvement et l'\'energie
+(initialis\'es \`a z\'ero).
+\end{itemize}
+
+
+\bigskip
+Les types de fronti\`ere (\var{ITYPFB}) et les valeurs n\'ecessaires
+(\var{ICODCL}, \var{RCODCL}) sont impos\'es par l'utilisateur dans \fort{uscfcl}.
+
+On convertit ensuite ces donn\'ees dans \fort{condli} pour qu'elles
+soient directement utilisables lors du calcul des matrices et des seconds membres.
+
+Pour cela, \fort{cfxtcl} permet de r\'ealiser le calcul des valeurs de bord et,
+pour certaines fronti\`eres, des flux convectifs. On fait appel,
+en particulier,
+\`a \fort{uscfth} (utilisation de la thermodynamique) et \`a \fort{cfrusb}
+(flux convectifs par le sch\'ema de Rusanov). Lors de ces calculs, on utilise
+\var{COEFA} et \var{COEFB} comme tableaux de travail (transmission de valeurs
+\`a \fort{uscfth} en particulier) afin de renseigner \var{ICODCL} et
+\var{RCODCL}.
+Apr\`es \fort{cfxtcl},
+le sous-programme \fort{typecl} compl\`ete quelques valeurs par d\'efaut
+de \var{ICODCL} et de \var{RCODCL}, en particulier pour les scalaires passifs.
+
+Apr\`es \fort{cfxtcl} et \fort{typecl}, les tableaux \var{ICODCL} et \var{RCODCL}
+sont complets. Ils sont utilis\'es dans la suite de \fort{condli} et en particulier
+dans \fort{clptur} pour construire les tableaux \var{COEFA} et \var{COEFB}
+(pour l'\'energie, on dispose de deux couples (\var{COEFA}, \var{COEFB}) afin de
+traiter les parois).
+
+On pr\'esente ci-apr\`es les points dont l'implantation diff\`ere
+de l'approche standard. Il s'agit de
+l'utilisation d'un sch\'ema de Rusanov pour le calcul des flux convectifs
+en entr\'ee et sortie (hormis sortie supersonique)
+et du mode de calcul des flux diffusifs d'\'energie en paroi.
+On insiste en particulier sur l'impact des conditions aux limites
+sur la construction des seconds membres de l'\'equation de la quantit\'e
+de mouvement et de l'\'equation de l'\'energie (\fort{cfqdmv} et \fort{cfener}).
+
+%=================================
+\subsection{Flux de Rusanov pour le calcul des flux convectifs en entr\'ee et sortie}
+%=================================
+
+Le sch\'ema de Rusanov est utilis\'e pour calculer des flux convectifs de bord
+(masse, quantit\'e de mouvement et \'energie) aux entr\'ees et des sorties
+de type IESICF, ISOPCF, IERUCF, IEQHCF.
+
+La gestion des conditions aux limites est diff\'erente de celle adopt\'ee
+classiquement dans \CS, bien que l'on se soit efforc\'e de s'y conformer le
+mieux possible.
+
+En volumes finis, il faut disposer de conditions aux
+limites pour trois utilisations principales au moins~:
+ \begin{itemize}
+ \item imposer les flux de convection,
+ \item imposer les flux de diffusion,
+ \item calculer les gradients pour les reconstructions.
+ \end{itemize}
+Dans l'approche standard de \CS, les conditions aux limites sont d\'efinies par
+variable et non pas par terme discret\footnote{Par exemple, pour un scalaire
+convect\'e et diffus\'e, on d\'efinit une valeur de bord unique {\it pour le scalaire}
+et non pas une valeur de bord pour le {\it flux convectif} et une valeur de bord
+pour le {\it flux diffusif}.}. On dispose donc, {\it pour chaque variable},
+d'une valeur de bord dont devront \^etre d\'eduits les flux de
+convection, les flux de diffusion et les gradients\footnote{N\'eanmoins, pour
+certaines variables comme la vitesse par exemple, \CS dispose de deux valeurs
+de bord (et non pas d'une seule) afin de pouvoir imposer de mani\`ere
+ind\'ependante le gradient normal et le flux de diffusion.}.
+Ici, avec l'utilisation d'un sch\'ema de
+Rusanov, dans lequel le flux convectif est trait\'e dans son ensemble,
+il est imp\'eratif
+de disposer d'un moyen d'imposer directement sa valeur au bord\footnote{Il
+serait possible de calculer une valeur de bord fictive des variables d'\'etat qui
+permette de retrouver le flux convectif calcul\'e par le sch\'ema de Rusanov,
+mais cette valeur ne permettrait pas d'obtenir
+un flux de diffusion et un gradient satisfaisants.}.
+
+Le flux convectif calcul\'e par le sch\'ema de Rusanov
+sera ajout\'e directement au second membre
+des \'equations de masse, de quantit\'e de mouvement et d'\'energie. Comme ce
+flux contient, outre la contribution des termes convectifs ``usuels''
+($\dive(\vect{Q})$, $\dive(\vect{u}\otimes\vect{Q})$ et
+$\dive(\vect{Q}\,e)$), celle des termes en $\grad\,P$ (quantit\'e de
+mouvement) et $\dive(\vect{Q}\,\frac{P}{\rho})$
+(\'energie), il faut veiller \`a ne pas
+ajouter une seconde fois les termes de bord issus de $\grad\,P$ et de
+$\dive(\vect{Q}\,\frac{P}{\rho})$
+au second membre des \'equations de quantit\'e de
+mouvement et d'\'energie.
+
+
+Pour la masse, le flux convectif calcul\'e par le sch\'ema de Rusanov
+d\'efinit simplement le flux de masse au bord
+(\var{PROPFB(IFAC,IPPROB(IFLUMA(ISCA(IENERG(IPHAS)))))}).
+
+Pour la quantit\'e de mouvement, le flux convectif calcul\'e par le sch\'ema de
+Rusanov est stock\'e dans les tableaux
+\var{PROPFB(IFAC,IPPROB(IFBRHU(IPHAS)))}, \var{PROPFB(IFAC,IPPROB(IFBRHV(IPHAS)))} et
+\var{PROPFB(IFAC,IPPROB(IFBRHW(IPHAS)))}. Il est ensuite ajout\'e au second membre de
+l'\'equation directement dans \fort{cfqdmv} (boucle sur les faces de bord).
+Comme ce flux contient la contribution du terme convectif usuel
+$\divv(\vect{u}\otimes\vect{Q})$, il ne faut pas l'ajouter dans
+le sous-programme \fort{cfbsc2}.
+De plus, le flux convectif calcul\'e par le sch\'ema de Rusanov
+contient la contribution du
+gradient de pression. Or, le gradient de pression est calcul\'e dans
+\fort{cfqdmv} au moyen de \fort{grdcel} et ajout\'e au second membre
+sous forme de contribution volumique (par cellule)~: il faut donc retirer
+la contribution des faces de bord auxquelles est appliqu\'e le sch\'ema de
+Rusanov, pour ne pas la compter deux fois (cette op\'eration est r\'ealis\'ee
+dans \fort{cfqdmv}).
+
+Pour l'\'energie, le flux convectif calcul\'e par le sch\'ema de
+Rusanov est stock\'e dans le tableau
+\var{PROPFB(IFAC,IPPROB(IFBENE(IPHAS)))}. Pour les faces auxquelles n'est pas
+appliqu\'e le sch\'ema de Rusanov, on ajoute la contribution
+du terme de transport de pression $\dive(\vect{Q}\,\frac{P}{\rho})$
+au second membre de l'\'equation dans \fort{cfener}
+et on compl\`ete le second membre dans \fort{cfbsc2} avec la contribution du
+terme convectif usuel $\dive(\vect{Q}\,e)$. Pour les faces auxquelles est
+appliqu\'e le sch\'ema de Rusanov, on ajoute directement le flux de Rusanov au second
+membre de l'\'equation dans \fort{cfener}, en lieu et place de la contribution
+du terme de transport de pression et l'on prend garde de ne pas
+comptabiliser une seconde fois le flux convectif usuel
+$\divv(\vect{Q}\,e)$ dans le sous-programme \fort{cfbsc2}.
+
+C'est l'indicateur \var{IA(IIFBRU)}
+(renseign\'e dans \fort{cfrusb}) qui permet, dans \fort{cfbsc2},
+\fort{cfqdmv} et \fort{cfener},
+de rep\'erer les faces de bord pour lesquelles on a calcul\'e
+un flux convectif avec le sch\'ema de Rusanov.
+
+
+%=================================
+\subsection{Flux diffusif d'\'energie}
+%=================================
+
+%---------------------------------
+\subsubsection{Introduction}
+%---------------------------------
+
+Une condition doit \^etre fournie sur toutes les fronti\`eres pour le calcul du
+flux diffusif d'\'energie.
+
+Il n'y a pas lieu de
+s'\'etendre particuli\`erement sur le traitement de certaines fronti\`eres.
+Ainsi, aux entr\'ees et sorties, on dispose
+d'une valeur de bord (issue de la r\'esolution du probl\`eme
+de Riemann)
+que l'on utilise dans la formule discr\`ete classique donnant le
+flux\footnote{Les valeurs de $u^2$ et de $\varepsilon_{sup}$ ne sont pas
+reconstruites pour le calcul du gradient au bord dans
+$\displaystyle\dive{\left(\frac{K}{C_v}\,\grad{(\frac{1}{2}\,u^2+\varepsilon_{sup})}\right)}$}.
+La situation est simple aux sym\'etries \'egalement, o\`u un flux nul est impos\'e.
+
+Par contre, en paroi, les conditions de temp\'erature ou de flux thermique
+impos\'e doivent \^etre trait\'ees avec plus d'attention, en particulier
+lorsqu'une couche limite turbulente est pr\'esente.
+
+%---------------------------------
+\subsubsection{Coexistence de deux conditions de bord}
+%---------------------------------
+
+Comme indiqu\'e dans la partie "discr\'etisation",
+les conditions de temp\'erature ou de flux conductif
+impos\'e en paroi se traduisent,
+pour le flux d'\'energie, au travers du terme
+$\displaystyle\dive{\left(\frac{K}{C_v}\,\grad\,e\right)}$,
+en imposant une condition de flux nul sur le terme
+$\displaystyle-\dive{\left(\frac{K}{C_v}\,\grad{(\frac{1}{2}\,u^2+\varepsilon_{sup})}\right)}$.
+Les faces IFAC
+concern\'ees sont rep\'er\'ees dans \fort{cfxtcl} par l'indicateur
+\var{IA(IIFBET+IFAC-1+(IPHAS-1)*NFABOR) = 1} (qui vaut 0 sinon, initialis\'e
+dans \fort{ppprcl}).
+
+Sur ces faces,
+on calcule une valeur de bord de l'\'energie, qui, introduite dans la
+formule g\'en\'erale de flux utilis\'ee au bord dans \CS, permettra de retouver le
+flux souhait\'e. La valeur de bord est une simple valeur num\'erique sans
+signification physique et ne doit \^etre utilis\'ee que pour calculer le flux
+diffusif.
+
+En plus de cette valeur de bord destin\'ee \`a retrouver le
+flux diffusif, il est n\'ecessaire de disposer
+d'une seconde valeur de bord de l'\'energie afin de pouvoir en calculer le
+gradient.
+
+Ainsi, comme pour la vitesse en $k-\varepsilon$, il est n\'ecessaire de
+disposer pour l'\'energie de deux couples de coefficients
+(\var{COEFA},\var{COEFB}), correspondant \`a deux valeurs de bord distinctes,
+dont l'une est utilis\'ee pour le calcul du flux diffusif sp\'ecifiquement.
+
+%---------------------------------
+\subsubsection{Calcul des \var{COEFA} et \var{COEFB} pour les faces de paroi
+\`a temp\'erature impos\'ee}
+%---------------------------------
+
+Les faces de paroi \var{IFAC} \`a temp�rature impos\'ee sont identif\'ees par
+l'utilisateur dans \fort{uscfcl} au moyen de l'indicateur
+\var{ICODCL(IFAC,ISCA(ITEMPK(IPHAS)))=5} (noter que
+ce tableau est associ\'e \`a la temp\'erature).
+
+Dans \fort{cfxtcl}, on impose alors \var{ICODCL(IFAC,ISCA(IENERG(IPHAS)))=5} et
+on calcule la quantit\'e
+$C_v\,T_{imp,ext}+\frac{1}{2}u^2_{I}+\varepsilon_{sup,I}$, que l'on
+stocke dans \var{RCODCL(IFAC,ISCA(IENERG(IPHAS)),1)} (on ne reconstruit pas les
+valeurs de $u^2$ et $\varepsilon_{sup}$ au bord, cf. \S\ref{Cfbl_Cfxtcl_prg_a_traiter}).
+
+\`A partir de ces valeurs de \var{ICODCL} et \var{RCODCL},
+on renseigne ensuite dans \fort{clptur}
+les tableaux de conditions aux limites permettant le calcul du flux~:
+\var{COEFA(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} et
+\var{COEFB(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} (noter
+l'indicateur \var{ICOEFF} qui renvoie aux coefficients d\'edi\'es au flux
+diffusif).
+
+
+%---------------------------------
+\subsubsection{Calcul des \var{COEFA} et \var{COEFB} pour les faces de paroi
+\`a flux thermique impos\'e}
+%---------------------------------
+
+Les faces de paroi \var{IFAC} \`a flux thermique
+impos\'e sont identif\'ees par
+l'utilisateur dans \fort{uscfcl} au moyen de l'indicateur
+\var{ICODCL(IFAC,ISCA(ITEMPK(IPHAS)))=3} (noter que le tableau est
+associ\'e \`a la temp\'erature).
+
+Dans \fort{cfxtcl}, on impose alors \var{ICODCL(IFAC,ISCA(IENERG(IPHAS)))=3} et
+on transf\`ere la valeur du flux de \var{RCODCL(IFAC,ISCA(ITEMPK(IPHAS)),3)}
+\`a \var{RCODCL(IFAC,ISCA(IENERG(IPHAS)),3)}.
+
+\`A partir de ces valeurs de \var{ICODCL} et \var{RCODCL},
+on renseigne ensuite dans \fort{condli} les tableaux de conditions aux limites
+permettant le calcul du flux,
+\var{COEFA(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} et
+\var{COEFB(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} (noter
+l'indicateur \var{ICOEFF} qui renvoie aux coefficients d\'edi\'es au flux
+diffusif).
+
+%---------------------------------
+\subsubsection{Gradient de l'\'energie en paroi \`a temp\'erature ou \`a flux thermique impos\'e}
+%---------------------------------
+
+Dans les deux cas (paroi \`a temp\'erature ou \`a flux thermique impos\'e),
+on utilise les tableaux
+\var{COEFA(*,ICLRTP(ISCA(II),ICOEF))},
+\var{COEFB(*,ICLRTP(ISCA(II),ICOEF))} (noter le \var{ICOEF}) pour disposer d'une
+condition de flux nul pour l'\'energie (avec \var{II=IENERG(IPHAS)}) et
+pour la temp\'erature (avec \var{II=ITEMPK(IPHAS)})
+si un calcul de gradient est requis.
+
+Un gradient est en particulier utile pour les reconstructions
+de l'\'energie sur maillage non orthogonal.
+Pour la temp\'erature, il s'agit d'une pr\'ecaution, au cas
+o\`u l'utilisateur aurait besoin d'en calculer le gradient.
+
+%---------------------------------
+\subsubsection{Autres fronti\`eres que les parois \`a temp\'erature ou \`a flux thermique impos\'e}
+%---------------------------------
+
+Pour les fronti\`eres qui ne sont pas des parois \`a temp\'erature ou
+\`a flux thermique impos\'e, les conditions aux limites de l'\'energie et
+de la temp\'erature sont compl\'et\'ees classiquement dans \fort{condli} selon
+les choix faits dans \fort{cfxtcl} pour \var{ICODCL} et \var{RCODCL}.
+
+En particulier,
+dans le cas de conditions de Dirichlet sur l'\'energie (entr\'ees, sorties), les
+deux jeux de conditions aux limites sont identiques (tableaux
+\var{COEFA}, \var{COEFB} avec \var{ICOEFF} et \var{ICOEF}).
+
+Si un flux est impos\'e pour l'\'energie totale (condition assez rare,
+l'utilisateur ne raisonnant pas,
+d'ordinaire, en \'energie totale), on le stocke au moyen de
+\var{COEFA(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} et
+\var{COEFB(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} (tableaux associ\'es au flux
+diffusif). Pour le gradient, une condition de flux nul est stock\'ee
+dans
+\var{COEFA(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEF))} et
+\var{COEFB(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEF))}. On peut remarquer que les deux
+jeux de conditions aux limites sont identiques pour les faces de sym\'etrie.
+
+%---------------------------------
+\subsubsection{Impact dans \fort{cfener}}
+%---------------------------------
+
+Lors de la construction des seconds membres, dans \fort{cfener}, on utilise les
+conditions aux limites stock\'ees dans les tableaux associ\'es au flux
+diffusif
+\var{COEFA(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} et
+\var{COEFB(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEFF))} pour le terme de flux diffusif
+$\displaystyle\dive{\left(\frac{K}{C_v}\,\grad\,e\right)}$
+en prenant soin d'annuler la contribution de bord du terme
+$\displaystyle-\dive{\left(\frac{K}{C_v}\,\grad{(\frac{1}{2}\,u^2+\varepsilon_{sup})}\right)}$
+sur les faces pour lesquelles cette condition
+prend les deux termes en compte, c'est-\`a-dire sur les faces pour lesquelles
+\var{IA(IIFBET+IFAC-1+(IPHAS-1)*NFABOR) = 1}.
+
+Pour tous les autres termes qui requi\`erent une valeur de bord, on utilise les
+conditions aux limites que l'on a stock\'ees au moyen des deux tableaux
+\var{COEFA(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEF))} et
+\var{COEFB(*,ICLRTP(ISCA(IENERG(IPHAS)),ICOEF))}. Ces conditions sont
+donc en particulier utilis\'ees pour le calcul du gradient de l'\'energie,
+lors des reconstructions sur maillage non orthogonal.
+
+
+\newpage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\label{Cfbl_Cfxtcl_prg_a_traiter}%
+% propose en patch 1.2.1
+%Corriger \fort{ppprcl} pour que l'indicateur
+%\var{IA(IIFBET+IFAC-1+(IPHAS-1)*NFABOR)} soit
+%initialis\'e \`a 0, positionn\'e \`a 1 aux faces de paroi \`a temp\'erature
+%ou flux thermique impos\'e. Dans \fort{cfener}, lorsque l'indicateur vaudra 1,
+%on ne prendra pas en compte le flux correspondant \`a
+%$\displaystyle-\dive{\left(\frac{K}{C_v}\,\grad{(\frac{1}{2}\,u^2+\varepsilon_{sup})}\right)}$.
+
+% propose en patch 1.2.1
+%Pour l'\'energie, on utilise comme diffusivit\'e turbulente la valeur
+%$\displaystyle \frac{K}{C_v}=\frac{\lambda}{C_v}+\frac{\mu_t}{\sigma_t}$.
+%Par coh\'erence avec une \'equation
+%portant sur la temp\'erature, il serait plus logique d'utiliser
+%$\displaystyle \frac{K}{C_v}=\frac{\lambda}{C_v}+\frac{C_p}{C_v}\,\frac{\mu_t}{\sigma_t}$.
+%On peut temporairement utiliser le nombre de Prandtl turbulent pour prendre en compte
+%le rapport $\displaystyle\frac{C_p}{C_v}$, mais il serait
+%souhaitable de corriger en ce sens le calcul de \var{W1} pour \fort{viscfa} dans
+%le sous-programme \fort{cfener} et le calcul similaire de \var{HINT} dans
+%\fort{condli} et \fort{clptur} (RAS pour les conversions en couplage avec \syrthes).
+
+Apporter un compl\'ement de test sur une cavit\'e ferm\'ee
+sans vitesse et sans gravit\'e, avec flux de bord ou temp\'erature de bord impos\'ee.
+Il semble que le transfert d'\'energie {\it via} les termes de pression g\'en\`ere de
+fortes vitesses non physiques dans la premi\`ere maille de paroi et que la
+conduction thermique ne parvienne pas \`a \'etablir le profil de temp\'erature
+recherch\'e. Il est \'egalement possible que la condition de bord sur la pression
+g\'en\`ere une perturbation (une extrapolation pourrait se r\'ev\'eler
+indispensable).
+
+Il pourrait \^etre utile de g\'en\'eraliser \`a l'incompressible l'approche
+utilis\'ee en compressible pour unifier simplement le traitement
+des sorties de type 9 et 10.
+
+Il pourrait \^etre utile d'\'etudier plus en d\'etail l'influence de la non
+orthogonalit\'e des mailles en sortie supersonique (pas de reconstruction,
+ce qui n'est pas consistant pour les flux de diffusion).
+
+De m\^eme, il serait utile d'\'etudier l'influence de l'absence de
+reconstruction pour la vitesse et $\varepsilon_{sup}$ dans la relation
+$\displaystyle T_{I'}=\frac{1}{C_v}\left(e_{I'}-\frac{1}{2}u^2_{i}-\varepsilon_{sup,i}\right)$
+utilis\'ee pour les parois \`a temp\'erature impos\'ee.
+
+Apporter un compl\'ement de documentation pour le couplage avec \syrthes (conversion
+\'energie temp\'erature). Ce n'est pas une priorit\'e.
+
+Pour les thermodynamiques \`a $\gamma$ variable, il sera n\'ecessaire de
+modifier non
+seulement \fort{uscfth} mais \'egalement \fort{cfrusb} qui doit disposer de
+$\gamma$ en argument.
+
+Pour les thermodynamiques \`a $C_v$ variable, il sera n\'ecessaire de
+prendre en compte un terme en $\grad\,C_v$, issu des flux diffusifs,
+au second membre de l'\'equation de
+l'\'energie (on pourra cependant remarquer qu'actuellement, en incompressible,
+on n\'eglige le terme en $\grad\,C_p$ dans l'\'equation de l'enthalpie).
diff --git a/doc/theory/clptrg.tex b/doc/theory/clptrg.tex
new file mode 100644
index 0000000..5899047
--- /dev/null
+++ b/doc/theory/clptrg.tex
@@ -0,0 +1,816 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+
+\programme{clptrg}
+
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Ce sous-programme est d�di� au calcul des conditions aux limites en paroi
+rugueuse. On utilise le
+formalisme introduit dans \var{CONDLI} pour les conditions
+aux limites g\'en\'erales.
+
+Par conditions aux limites en paroi, on entend ici l'ensemble des conditions aux
+limites pour la vitesse, les grandeurs turbulentes ($k$, $\varepsilon$),
+la temp\'erature lorsqu'elle a une valeur de paroi impos\'ee
+(ou l'enthalpie et plus g\'en\'eralement les
+{\it VarScalaires}\footnote{Comme dans \fort{condli}, on d\'esignera ici par
+{\it VarScalaire} toute variable solution
+d'une \'equation de convection-diffusion autre que la
+vitesse, la pression et les grandeurs turbulentes $k$, $\varepsilon$. La
+d\'enomination {\it VarScalaire} pourra en particulier se rapporter
+\`a la temp\'erature, \`a l'enthalpie ou \`a un scalaire passif.}
+\`a traiter en paroi en prenant en compte une loi de similitude
+pour la couche limite associ\'ee). Pour les {\it VarScalaires}, en particulier,
+lorsque les conditions aux limites de paroi sont du type Neumann (homog\`ene ou non),
+elles sont trait\'ees dans \fort{condli} et on ne s'y int\'eresse donc pas
+ici. En particulier, les conditions aux limites des {\it VarScalaires}
+repr\'esentant la variance de fluctuations d'autres {\it VarScalaires} ne
+sont pas trait\'ees ici car leur traitement en paroi est de type Neumann homog\`ene.
+
+On indique comment sont calcul\'es les couples de coefficients
+$A_b$ et $B_b$ qui sont utilis\'es pour le calcul de certains
+termes discrets des \'equations \`a r\'esoudre et qui
+permettent en particulier de d\'eterminer une valeur associ\'ee aux faces
+de bord $f_{b,int}$ (en un point localis\'e au ``centre'' de la face de bord,
+barycentre de ses sommets) par la
+relation $f_{b,int} = A_b+B_b\,f_{I'}$ ($f_{I'}$ est la valeur de
+la variable au point
+$I'$, projet\'e du centre de la cellule jouxtant le bord sur la droite
+normale \`a
+la face de bord et passant par son centre~: voir la figure~\ref{fig_flux_clptur}).
+
+\begin{figure}[h]
+\centerline{\includegraphics[height=7cm]{fluxbord}}
+\caption{\label{fig_flux_clptur}Cellule de bord.}
+\end{figure}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\etape{Notations\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+La vitesse de la paroi est not\'ee
+$\vect{v}_p$. On la suppose projet\'ee dans le plan tangent \`a la paroi (si
+elle ne l'est pas, le code la projette).
+
+La vitesse du fluide est not\'ee $\vect{u}$. L'indice $I$, $I'$ ou $F$ d\'esigne le
+point auquel elle est estim\'ee. La composante tangentielle par rapport \`a la
+paroi est not\'ee $u_\tau$.
+ La vitesse du fluide dans le rep\`ere li\'e \`a la paroi (vitesse
+``relative'') est not\'ee $\vect{u}^r=\vect{u} - \vect{v}_p$.
+
+Le rep\`ere orthonorm\'e li\'e \`a la paroi est not\'e
+$\hat {\mathcal R}=(\vect{\tau},\vect{\tilde{n}},\vect{b})$.
+\begin{itemize}
+\item [$\bullet$] $\vect{\tilde{n}}=-\vect{n}$ est le vecteur norm\'e
+orthogonal \`a la paroi et dirig\'e vers l'int\'erieur du domaine de calcul.
+\item [$\bullet$] $\vect{\tau} = \displaystyle\frac{1}{\|\vect{u}^r_{I'}-(\vect{u}^r_{I'}\,.\,\vect{\tilde{n}})\|}\left[\vect{u}^r_{I'}-(\vect{u}^r_{I'}\,.\,\vect{\tilde{n}})\right]$ est le vecteur norm\'e port\'e par la projection de la vitesse
+relative en $I'$, $\vect{u}^r_{I'}$, dans le plan tangent \`a la
+paroi ({\it i.e.} orthogonal \`a $\vect{\tilde{n}}$)~: voir la
+figure~\ref{fig_flux_clptur}.
+\item [$\bullet$] $\vect{b}$ est le vecteur norm\'e compl\'etant le rep\`ere direct.
+\end{itemize}
+
+\vspace{0.5cm}
+
+Dans le cas du {\bf mod\`ele \`a deux \'echelles de vitesse}, on note~:
+\begin{itemize}
+\item [-] $u_k$ la
+vitesse de frottement en paroi obtenue \`a partir de l'\'energie turbulente.
+
+\item [-] $u^*$ la vitesse de frottement en paroi d\'etermin\'ee \`a
+partir de la relation $ \displaystyle\frac{u^r_{\tau,I'}}{u^*} = f(z_p)$.
+
+\item [-] $z_p$ repr�sente une distance � la paroi
+ (c'est � dire la distance depuis le bord du domaine de calcul), soit
+$z_p= I'F$ (voir la figure~\ref{fig_flux_clptur}). La fonction $f$ traduit la forme id�ale du profil de
+ vitesse. Dans l'atmosph�re, cette fonction est donn�e par
+ une loi de type logarithmique faisant intervenir la rugosit� dynamique de
+ la paroi $z_0$~:
+
+$f(z_p)= \displaystyle\frac{1}{\kappa} ln \left ( \displaystyle \frac
+ {z_p+z_0}{z_0} \right ) $
+
+
+\item [-] Les deux \'echelles de vitesse $u_k$ et $u^*$ sont simples \`a
+ calculer mais leur obtention
+n\'ecessite la connaissance de l'\'energie turbulente $k_I$ au centre de la
+maille jouxtant la face de bord.
+
+\item [-] Le mod\`ele \`a deux \'echelles
+est le mod\`ele par d\'efaut dans \CS. Il permet souvent, et en particulier
+dans les cas avec transfert thermique, de diminuer les effets de certains
+d\'efaut li\'es au mod\`ele $k-\varepsilon$ (exemple classique du jet impactant).
+\end{itemize}
+
+On se sert plus bas de $u^*$ et $u_k$ pour les conditions aux limites portant
+sur la vitesse et les scalaires (temp\'erature en particulier).
+
+
+\begin{equation}
+\label{Eq_Mod_'2ech_Vit}
+\begin{array}{l}
+\text{\bf Mod\`ele \`a deux \'echelles de vitesse}\\
+\left\{\begin{array}{l}
+u_k = C_\mu^\frac{1}{4}k_I^\frac{1}{2}\\
+u^* \text{solution de } \displaystyle\frac{u^r_{\tau,I'}}{u^*} =
+\displaystyle\frac{1}{\kappa}ln(z_k)\\
+z_k=\displaystyle\frac{I'F+z_0}{z_0} = \displaystyle\frac{z_p+z_0}{z_0}\\
+\text{ avec } C_\mu =0,09 \text{ et } \kappa = 0,42
+\end{array}\right.\\
+\end{array}
+\end{equation}
+
+
+\vspace{0.5cm}
+
+Dans le cas du {\bf mod\`ele \`a une \'echelle de vitesse}, on note $u^*$ l'unique vitesse
+de frottement en paroi solution de l'\'equation
+$\displaystyle\frac{u^r_{\tau,I'}}{u^*} = f(z_p)$. La grandeur
+$z_p$ repr\'esente une distance \`a la paroi, soit
+$z_p=I'F$. La fonction $f$ traduit la forme id\'eale du profil de vitesse comme
+pour le mod\`ele \`a deux \'echelles de vitesses. On peut
+noter que cette vitesse de frottement, d'un calcul plus d\'elicat (point fixe),
+s'obtient cependant sans faire r\'ef\'erence aux
+variables turbulentes ($k$, $\varepsilon$). Par commodit\'e, on posera
+dans le cas du mod\`ele \`a une \'echelle $u_k=u^*$.
+
+On se sert plus bas de $u^*$ et $u_k$ pour les conditions aux limites portant
+sur la vitesse et les scalaires (temp\'erature en particulier).
+
+\begin{equation}
+\begin{array}{l}
+\text{\bf Mod\`ele \`a une \'echelle de vitesse}\\
+\left\{\begin{array}{l}
+u_k = u^*\\
+u^* \text{solution de } \displaystyle\frac{u^r_{\tau,I'}}{u^*} =
+\displaystyle\frac{1}{\kappa}ln(z_k)\\
+z_k=\displaystyle\frac{I'F+z_0}{z_0} = \displaystyle\frac{z_p+z_0}{z_0}\\
+\text{ avec } C_\mu =0,09 \text{ et } \kappa = 0,42
+\end{array}\right.\\
+\end{array}
+\end{equation}
+
+\etape{Conditions aux limites pour la vitesse en $k-\varepsilon$\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On consid\`ere tout d'abord les conditions utilis\'ees dans le cas d'un calcul
+r\'ealis\'e avec le mod\`ele $k-\varepsilon$. Ce sont en effet les plus
+complexes et les plus g\'en\'erales.
+
+Les conditions aux limites sont n�cessaires pour imposer au bord la contrainte
+tangentielle $\sigma_\tau=\rho_Iu^*u_k$ ad�quate dans l'\'equation de quantit\'e de
+mouvement\footnote{Proposition de modification des conditions aux limites de
+paroi turbulente pour le Solveur Commun dans le cadre du mod\`ele
+$k-\varepsilon$ standard, rapport EDF HI-81/00/019/A, 2000, M. Boucker, J.-D. Mattei.}
+($\rho_I$ est la masse volumique au centre de la
+cellule $I$). Le terme qui n\'ecessite des conditions aux limites est celui qui contient la
+d\'eriv\'ee de la vitesse dans la direction normale \`a la paroi,
+soit\footnote{Le terme en gradient transpos\'e est trait\'e dans \fort{vissec}
+et ne sera pas consid\'er\'e ici.}~:
+$(\mu_I+\mu_{t,I})\ggrad{\vect{u}}\,\vect{n}$. Il appara\^\i t au second membre
+de l'\'equation de quantit\'e de mouvement usuelle (voir \fort{bilsc2} et \fort{preduv}).
+
+Dans le cas o\`u le mod\`ele $k-\varepsilon$ a tendance \`a surestimer la
+production de l'\'energie turbulente, l'\'echelle de longueur du mod\`ele,
+$L_{k-\varepsilon}$,
+peut devenir significativement plus grande que l'\'echelle th\'eorique maximale
+des tourbillons de la couche limite turbulente $L_{\text{th\'eo}}$. On note :
+\begin{equation}
+\left\{\begin{array}{l}
+L_{k-\varepsilon} = C_{\mu}\displaystyle\frac{k^\frac{3}{2}}{\varepsilon}\\
+L_{\text{th\'eo}} = \kappa\, \left( I'F+z_0 \right) = \kappa\, \left(z_p+z_0 \right)
+\end{array}\right.
+\end{equation}
+
+Dans le cas o\`u $L_{k-\varepsilon}>L_{\text{th\'eo}}$, on a donc
+$\mu_{t,I}>\mu_{t}^{lm}$ avec $\mu_{t,I}$ la viscosit\'e turbulente du mod\`ele
+$k-\varepsilon$ au point $I$ et $\mu_{t}^{lm}=\rho_I L_{\text{th\'eo}}u_k$ la
+viscosit\'e turbulente du mod\`ele de longueur de m\'elange. En outre, la
+contrainte tangentielle peut s'\'ecrire en faisant appara\^\i tre la viscosit\'e
+turbulente, soit~:
+\begin{equation}
+\sigma_\tau = \rho_Iu^*u_k = \displaystyle\frac{u^*}{\kappa\,
+ \left(I'F+z_0 \right)}
+\underbrace{\rho_I\kappa\, \left( I'F+z_0 \right) u_k}_{\mu^{lm}_t}
+\end{equation}
+L'\'echelle de viscosit\'e introduite dans la contrainte est alors en
+contradiction avec celle d\'eduite de la turbulence calcul\'ee alentour par le
+mod\`ele. On pr\'ef\`ere d\`es lors \'ecrire, en utilisant l'\'echelle de
+longueur du $k-\varepsilon$ chaque fois qu'elle est inf\'erieure \`a la limite
+$L_{\text{th\'eo}}$~:
+\begin{equation}
+\sigma_\tau = \displaystyle\frac{u^*}{\kappa\, \left(I'F+z_0 \right)} max(\mu_{t}^{lm},\mu_{t,I})
+\end{equation}
+
+On peut alors utiliser cette valeur pour le calcul du flux
+diffusif qui en d\'epend dans l'\'equation de Navier-Stokes~:
+\begin{equation}\label{eq_grad_sigma_clptur}
+(\mu_I+\mu_{t,I})\ggrad{\vect{u}}\,\vect{n}=-\sigma_\tau \vect{\tau}
+\end{equation}
+
+Or, le gradient de vitesse (gradient \`a la face de bord) est calcul\'e dans le
+code sous la forme suivante~:
+\begin{equation}\label{eq_grad_uf_clptur}
+(\mu_I+\mu_{t,I})\ggrad{\vect{u}}\,\vect{n}=
+\displaystyle\frac{(\mu_I+\mu_{t,I})}{\overline{I'F}}(\vect{u}_F-\vect{u}_{I'})
+\end{equation}
+
+Du rapprochement de (\ref{eq_grad_sigma_clptur}) et de
+(\ref{eq_grad_uf_clptur}) on tire alors la valeur de $\vect{u}_F$ \`a
+imposer, soit $\vect{u}_{F,flux}$~(respect du flux de quantit\'e de mouvement)~:
+\begin{equation}\label{eq_uf_flux_clptur}
+\begin{array}{ll}
+\vect{u}_{F,flux}&=\vect{u}_{I'}-\displaystyle\frac{\overline{I'F}}{\mu_I+\mu_{t,I}}\sigma_\tau \vect{\tau}\\
+ &=\vect{u}_{I'}-\displaystyle\frac{u^*}{\kappa\,
+ (\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I})
+ \, \displaystyle\frac {I'F} {\left(I'F+z_0 \right)} \vect{\tau}
+\end{array}
+\end{equation}
+
+En r\'ealit\'e, une approximation suppl\'ementaire est r\'ealis\'ee, qui
+consiste \`a imposer la vitesse normale nulle \`a la paroi et \`a utiliser
+l'\'equation (\ref{eq_uf_flux_clptur}) projet\'ee sur le plan tangent \`a la
+paroi, soit~:
+\begin{equation}
+\vect{u}_{F,flux}=\left[u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa\,
+(\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I}) \, \displaystyle\frac {I'F} {\left(I'F+z_0 \right)} \right]\vect{\tau}
+\end{equation}
+
+Enfin, on peut \'egalement faire appara\^\i tre la vitesse de la paroi
+dans l'expression finale~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Conditions aux limites sur la vitesse de type ``flux''}\,(k-\varepsilon)\\
+\left\{\begin{array}{l}
+\vect{u}_{F,flux}=\vect{v}_p+\left[u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa\,
+(\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I}) \, \displaystyle\frac {I'F} {\left(I'F+z_0 \right)}\right]\vect{\tau}
+\end{array}\right.\\
+\end{array}
+\end{equation}
+
+Un premier couple de coefficients $A_{flux}$ et $B_{flux}$ s'en d\'eduit (pour
+chaque composante de vitesse s\'epar\'ement) et il n'est utilis\'e que pour le
+calcul du terme d\'ependant de la contrainte tangentielle (voir \fort{bilsc2})~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associ\'es aux conditions aux limites sur la vitesse de
+type ``flux''} (k-\varepsilon)\\
+\left\{\begin{array}{l}
+\vect{A}_{flux}=\vect{v}_p+\left[u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa\,
+(\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I}) \, \displaystyle\frac {I'F} {\left(I'F+z_0 \right)} \right]\vect{\tau} \\
+\vect{B}_{flux} = \vect{0}
+\end{array}\right.
+\end{array}
+\end{equation}
+
+On a vu ci-dessus comment imposer une condition \`a la limite permettant de
+calculer correctement le terme en contrainte. Une analyse suppl\'ementaire est
+n\'ecessaire pour le calcul des gradients de vitesse. On cherche \`a trouver une
+valeur en face de bord qui permette d'obtenir, avec la formulation adopt\'ee pour le gradient, la valeur de la production turbulente la
+plus proche possible de la valeur th\'eorique, elle-m\^eme d\'etermin\'ee
+en utilisant la loi
+logarithmique, pour \'evaluer la d\'eriv\'ee normale de la vitesse tangentielle.
+Ainsi, on d\'efinit (au point $I$)~:
+\begin{equation}\label{eq_ptheo_clptur}
+P_{\text{th\'eo}} = \rho_I u^* u_k
+\|\displaystyle\frac{\partial u_\tau}{\partial\vect{n}}\|_{I} =
+\rho_I \displaystyle\frac{u_k(u^*)^2}{\kappa\, \left(I'F+z_0 \right)}
+\end{equation}
+
+Par ailleurs, le terme pr\'epond\'erant de la production calcul\'ee dans la
+cellule $I$ est, pour les situations classiques ($z$ est l'ordonn\'ee sur l'axe
+de vecteur directeur $\vect{\tilde{n}}$),
+\begin{equation}
+P_{\text{calc}} =
+\mu_{t,I}\left(\displaystyle\frac{\partial u_\tau}{\partial z}\right)^2_{I}
+\end{equation}
+
+\begin{figure}[h]
+\centerline{\includegraphics[height=7cm]{bordortho}}
+\caption{\label{fig_bord_ortho_clptur}Cellule de bord - Maillage orthogonal.}
+\end{figure}
+
+Or, le gradient normal de la vitesse tangentielle (gradient cellule) est
+calcul\'e dans le code en volumes finis et son expression dans le cas d'un
+maillage orthogonal et r\'egulier est la suivante (voir les notations sur la figure~\ref{fig_bord_ortho_clptur})~:
+\begin{equation}
+P_{\text{calc}} =
+\mu_{t,I}\left(\displaystyle\frac{u_{\tau,G}-u_{\tau,F}}{2d}\right)^2 =
+\mu_{t,I}\left(\displaystyle\frac{u_{\tau,I}+u_{\tau,J}-2u_{\tau,F}}{4d}\right)^2
+\end{equation}
+On suppose alors que $u_{\tau,J}$ peut \^etre obtenu \`a partir de $u_{\tau,I}$
+et du gradient normal de $u_{\tau}$ \'evalu\'e en G \`a partir de la loi
+logarithmique, soit~:
+\begin{equation}
+\label{eq_dvp_lim_utau}
+u_{\tau,J}=u_{\tau,I}+ IJ\,.\,(\partial_z u_{\tau})_G+\mathcal{O} (IJ^{\,2}) \approx
+u_{\tau,I}+ IJ\,.\,\left[\partial_z \left(\displaystyle
+\frac{u^*}{\kappa}\,ln{ (z)} \right)\right]_G=
+u_{\tau,I}+2d \, \displaystyle\frac{u^*}{\kappa \left(2d + z_0\right)}
+\end{equation}
+et l'on obtient alors~:
+\begin{equation}\label{eq_pcalc_clptur}
+\begin{array}{lll}
+P_{\text{calc}}
+&=&\mu_{t,I}\left(\displaystyle\frac{2u_{\tau,I}+2d \, \displaystyle\frac{\,u^*}{\kappa
+ \left(2d + z_0\right) } -2u_{\tau,F}}{4d}\right)^2 \\
+&=&
+\mu_{t,I}\left(\displaystyle\frac{u_{\tau,I}+d \,\displaystyle\frac{\,u^*}{\kappa
+ \left(2d + z_0\right)} -u_{\tau,F}}{2d}\right)^2
+\end{array}
+\end{equation}
+
+On rapproche alors les \'equations (\ref{eq_ptheo_clptur}) et
+(\ref{eq_pcalc_clptur}) pour imposer que la production calcul\'ee soit \'egale
+\`a la la production th\'eorique. On \'etend sans pr\'ecaution les formules
+pr\'ec\'edentes aux maillages non orthogonaux (la vitesse en $I$ est
+alors simplement prise en $I'$).
+On obtient alors l'expression suivante pour $u_{\tau,F}$~:
+\begin{equation}
+u_{\tau,F,grad} =u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left(
+2d\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k }{\mu_{t,I} \left(I'F
+ +z_0\right) }
+}-\displaystyle\frac{1}{2 + z_0/I'F}\right)
+\end{equation}
+
+On impose d'autre part que le gradient reste au moins aussi raide que celui
+donn\'e par la d\'eriv\'ee normale du profil de vitesse th\'eorique
+(logarithmique) en $I'$~:\\
+$\partial_z u_{\tau} = \partial_z (\displaystyle
+\frac{u^*}{\kappa}\,ln{ (z)} ) =\displaystyle\frac{u^*}{\kappa\,\left(I'F + z_0\right) }$, soit
+donc~:
+\begin{equation}
+u_{\tau,F,grad} =u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}max\left(1,
+2d\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k }{\mu_{t,I} \left(I'F + z_0\right)}}-\displaystyle\frac{1}{2 + z_0/I'F}\right)
+\end{equation}
+
+
+La vitesse normale \`a la paroi est impos\'ee nulle.
+De plus, si la vitesse tangentielle en $I'$ est
+nulle (de valeur absolue inf\'erieure \`a une limite num\'erique arbitraire de
+$10^{-12}$) une condition d'adh\'erence est appliqu\'ee. Enfin, on peut
+\'egalement faire appara\^\i tre la vitesse de la paroi dans l'expression finale~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Conditions aux limites sur la vitesse de type ``gradient''} (k-\varepsilon)\\
+\left\{\begin{array}{l}
+\vect{u}_{F,grad}=\vect{v}_p
+ \qquad\qquad\text{ si } u^r_{\tau,I'} < 10^{-12} \\
+\vect{u}_{F,grad}=\vect{v}_p +
+u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left[max\left(1,2d\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k }{\mu_{t,I}
+\left(I'F + z_0\right)}}-\displaystyle\frac{1}{2 + z_0/I'F}\right)\right] \vect{\tau}
+\end{array}\right.
+\end{array}
+\end{equation}
+
+Un second couple de coefficients $A_{grad}$ et $B_{grad}$ s'en d\'eduit (pour
+chaque composante de vitesse s\'epar\'ement) et est utilis\'e chaque fois que le
+gradient de la vitesse est n\'ecessaire (hormis pour les termes d\'ependant de
+la contrainte tangentielle, trait\'es dans \fort{bilsc2} au moyen des
+coefficients $A_{flux}$ et $B_{flux}$)~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associ\'es aux conditions aux limites sur la vitesse }\\
+\qquad\qquad\qquad\qquad\text{\bf de type ``gradient''} (k-\varepsilon)\\
+\left\{\begin{array}{l}
+\vect{A}_{grad}=\vect{v}_p
+ \qquad\qquad\text{ \ si\ } u^r_{\tau,I'} < 10^{-12} \\
+\vect{A}_{grad}=\vect{v}_p+
+ u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left[max\left(1,2d\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k }{\mu_{t,I}
+\left(I'F + z_0\right)}}-\displaystyle\frac{1}{2 + z_0/I'F}\right)\right] \vect{\tau}\\
+\vect{B}_{grad} = \vect{0}
+\end{array}\right.
+\end{array}
+\end{equation}
+
+\newpage
+
+\etape{Conditions aux limites pour les variables $k$ et $\varepsilon$ (mod\`ele
+$k-\varepsilon$ standard)\vspace{0,3cm}}
+
+On impose sur $k$ une condition de Dirichlet tir\'ee de la vitesse de frottement
+$u_k$ (se reporter \`a l'\'equation~(\ref{Eq_Mod_'2ech_Vit})), soit :
+\begin{equation}
+k= \displaystyle\frac{u_k^2}{C_\mu^\frac{1}{2}}
+\end{equation}
+
+
+On cherche \`a imposer la d\'eriv\'ee normale de $\varepsilon$ \`a partir de la
+loi th\'eorique suivante (voir les notations sur la figure \ref{fig_bord_ortho_clptur})~:
+\begin{equation}\label{eq_partialep_theo_clptur}
+G_{\text{th\'eo},\varepsilon} = \displaystyle\frac{\partial}{\partial z}
+ \left[ \displaystyle\frac{u_k^3}{\kappa\, \left(z + z_0\right)}\right]
+\end{equation}
+
+
+
+On utilise le point $M$ pour imposer une condition \`a la limite avec un ordre plus
+\'elev\'e en espace. En effet, la simple utilisation de la relation
+$\varepsilon_F=\varepsilon_I+d\partial_z\varepsilon_I + O(d^2)$ conduit \`a une
+pr\'ecision d'ordre 1.
+En utilisant les d\'eveloppements limit\'es suivants, on peut
+obtenir une pr\'ecision \`a l'ordre 2~:
+\begin{equation}
+\left\{\begin{array}{ll}
+\varepsilon_M&=\varepsilon_I-\displaystyle\frac{d}{2}\partial_z\varepsilon_I+\displaystyle\frac{d^2}{8}\partial^2_z\varepsilon_I+O(d^3)\\
+\varepsilon_M&=\varepsilon_F+\displaystyle\frac{d}{2}\partial_z\varepsilon_F+\displaystyle\frac{d^2}{8}\partial^2_z\varepsilon_F+O(d^3)
+\end{array}\right.
+\end{equation}
+Par diff\'erence, ces relations conduisent \`a
+\begin{equation}\label{eq_epsf_clptur}
+\varepsilon_F=\varepsilon_I-\displaystyle\frac{d}{2}(\partial_z\varepsilon_I+\partial_z\varepsilon_F)+O(d^3)
+\end{equation}
+De plus, on a
+\begin{equation}
+\left\{\begin{array}{ll}
+\partial_z\varepsilon_I&=\partial_z\varepsilon_M+d\partial^2_z\varepsilon_M+O(d^2)\\
+\partial_z\varepsilon_F&=\partial_z\varepsilon_M-d\partial^2_z\varepsilon_M+O(d^2)
+\end{array}\right.
+\end{equation}
+La somme de ces deux derni\`eres relations permet d'\'etablir
+$\partial_z\varepsilon_I+\partial_z\varepsilon_F=2\partial_z\varepsilon_M+O(d^2)$ et, en reportant dans
+(\ref{eq_epsf_clptur}), on obtient alors une expression de $\varepsilon_F$ \`a
+l'ordre 2, comme souhait\'e~:
+\begin{equation}
+\varepsilon_F=\varepsilon_I-d\partial_z\varepsilon_M+O(d^3)
+\end{equation}
+On utilise alors la valeur th\'eorique (\ref{eq_partialep_theo_clptur}) pour
+\'evaluer $\partial_z\varepsilon_M$ et on obtient alors la valeur \`a imposer au bord ($d=I'F$)~:
+\begin{equation}
+\varepsilon_F=\varepsilon_I+d\displaystyle\frac{ u_k^3}{\kappa\, (d/2+ z_0)^2}
+\end{equation}
+
+
+Cette relation est \'etendue au cas de maillages non orthogonaux sans
+pr\'ecaution (ce qui doit d\'egrader l'ordre en espace).
+
+On a finalement~:
+
+\begin{equation}
+\begin{array}{l}
+\text{\bf Conditions aux limites sur les variables } k \text { \bf et } \varepsilon \\
+\left\{\begin{array}{ll}
+k_F&= \displaystyle\frac{u_k^2}{C_\mu^\frac{1}{2}}\\
+\varepsilon_F&=\varepsilon_{I'}+I'F\displaystyle\frac{ u_k^3}{\kappa\,
+ (I'F/2 + z_0)^2}
+\end{array}\right. \\
+\end{array}
+\end{equation}
+et les coefficients associ\'es
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associ\'es aux conditions aux limites sur les variables }
+k \text { \bf et } \varepsilon \\
+\left\{\begin{array}{llll}
+A_k&= \displaystyle\frac{u_k^2}{C_\mu^\frac{1}{2}} &\text{ et } B_k&= 0 \\
+A_\varepsilon&=I'F\displaystyle\frac{ u_k^3}{\kappa\, (I'F/2 + z_0)^2}&\text{ et } B_\varepsilon&= 1
+\end{array}\right.\\
+\end{array}
+\end{equation}
+
+\newpage
+\etape{Conditions aux limites pour les {\it VarScalaires}\vspace{0,3cm}}
+On ne traite ici que les conditions se pr\'esentant sous la forme d'une valeur
+impos\'ee (\`a la paroi ou en retrait de celle-ci avec un coefficient
+d'\'echange externe \'eventuel). On se reporte aux notations de la figure
+\ref{fig_flux_clptur} et \`a la pr\'esentation g\'en\'erale disponible dans
+\fort{condli} dont on ne reprend que la partie essentielle ci-dessous.
+
+La conservation du flux normal au bord pour la variable $f$ s'\'ecrit sous la forme~:
+\begin{equation}\label{eq_flux_clptur}
+\begin{array}{l}
+ \underbrace{h_{int}(f_{b,int}-f_{I'})}_{\phi_{int}}
+ = \underbrace{h_{b}(f_{b,ext}-f_{I'})}_{\phi_{b}}
+ = \left\{\begin{array}{ll}
+ \underbrace{h_{imp,ext}(f_{imp,ext}-f_{b,ext})}_{\phi_{\text{\it r\'eel
+impos\'e}}} &\text{(condition de Dirichlet)}\\
+ \underbrace{\phi_{\text{\it imp,ext}}}_{\phi_{\text{\it r\'eel impos\'e}}}
+ &\text{(condition de Neumann)}
+ \end{array}\right.
+\end{array}
+\end{equation}
+
+
+On r\'earrange ces deux \'equations afin d'obtenir la valeur num\'erique
+$f_{b,int}=f_{F}$ \`a imposer en face de paroi, \'etant donn\'ees les valeurs de
+$f_{imp,ext}$ et de $h_{imp,ext}$ fix\'ees par l'utilisateur et la valeur $h_{b}$
+dict\'ee par les lois de similitude qui seront d\'etaill\'ees plus bas. On
+pr\'ecise les coefficients $A$ et $B$ qui s'en d\'eduisent naturellement.
+
+\begin{equation}\label{eq_fbint_clptur}
+\begin{array}{l}
+\text{\bf Conditions aux limites sur les {\it VarScalaires} }\\
+f_{b,int} =
+\underbrace{\displaystyle\frac{h_{imp,ext}}{h_{int}+h_r h_{imp,ext} } f_{imp,ext}}_{A} +
+\underbrace{\displaystyle\frac{h_{int}+h_{imp,ext}(h_r-1)}{h_{int}+h_r h_{imp,ext} }}_{B} f_{I'}
+\text{ avec } h_r=\displaystyle\frac{h_{int}}{h_{b}}
+\end{array}
+\end{equation}
+
+
+\newpage
+{\bf Principe de similitude~: calcul de } $h_b$.
+
+Dans l'expression (\ref{eq_fbint_clptur}), seule reste �
+d\'eterminer la valeur de $h_{b}$, celle de $h_{int}$ \'etant une valeur
+num\'erique coh\'erente avec le mode de calcul des gradients aux faces et
+pr\'ecis\'ee dans \fort{condli} ($h_{int}=\displaystyle\frac{\alpha}{\overline{I'F}}$). La
+valeur de $h_{b}$ doit permettre de
+relier le flux \`a l'\'ecart entre les valeurs $f_{I'}$ et $f_{b,ext}$ en
+prenant en compte la couche limite (le profil de $f$ n'est pas toujours
+lin\'eaire)~:
+\begin{equation}
+\phi_b=h_b\,(f_{b,ext}-f_{I'})
+\end{equation}
+
+Les consid\'erations suivantes sont pr\'esent\'ees en adoptant des notations
+g\'en\'erales. En particulier, le nombre de Prandtl-Schmidt est not\'e
+$\sigma=\displaystyle\frac{\nu\,\rho\,C}{\alpha}$.
+Lorsque le scalaire $f$ consid\'er\'e est la temp\'erature,
+on a (voir \fort{condli})~:
+\begin{list}{$\bullet$}{}
+\item $C=C_p$ (chaleur massique),
+\item $\alpha=\lambda$ (conductivit\'e mol\'eculaire),
+\item $\sigma = \displaystyle\frac{\nu\,\rho\,C_p}{\lambda} = Pr$
+ (nombre de Prandtl),
+\item $\sigma_t = Pr_t$ (nombre de Prandtl turbulent),
+\item $\phi=\left(\lambda+\displaystyle\frac{C_p\mu_t}{\sigma_t}\right)
+ \displaystyle\frac{\partial T}{\partial z}$ (flux en $Wm^{-2}$).
+\end{list}
+
+On s'est appuy� sur la r\'ef\'erence "The atmospheric boundary layer",
+J. R. Garratt, Cambridge University Press.
+
+Le flux en paroi s'�crit, pour le scalaire $f$ (le flux est positif s'il est
+entrant dans le domaine fluide, comme l'indique l'orientation de l'axe $z$)~:
+\begin{equation}\label{Eq_Flux_scalaire}
+\phi = -\left(\alpha+C\,\frac{\mu_t}{\sigma_t}\right)
+ \frac{\partial f}{\partial z}
+ = -\rho\,C \left(\displaystyle\frac{\alpha}{\rho\,C}+
+ \frac{\mu_t}{\rho\sigma_t}\right)
+ \frac{\partial f}{\partial z}
+\end{equation}
+
+\noindent Pour la temp�rature, avec $a=\displaystyle\frac{\lambda}{\rho\,C_p}$ et
+$a_t=\displaystyle\frac{\mu_t}{\rho\,\sigma_t}$,
+on a donc, de mani�re �quivalente~:
+\begin{equation}
+\phi = -\rho\,C_p(a+a_t)\frac{\partial T}{\partial z}
+\end{equation}
+
+\noindent On introduit $f^*$ afin d'adimensionner $f$, en utilisant la valeur du flux
+au bord $\phi_b$~:
+\begin{equation}
+f^* = -\displaystyle\frac{\phi_b}{\rho\,C\,u_k}
+\end{equation}
+Pour la temp\'erature, on a donc~:
+\begin{equation}
+T^* = -\displaystyle\frac{\phi_b}{\rho\,C_p\,u_k}
+\end{equation}
+
+\noindent On rappelle que dans le cas du mod\`ele \`a deux \'echelles de vitesse, $u_k$ est la
+vitesse de frottement en paroi obtenue \`a partir de l'\'energie
+cin�tique moyenne du mouvement turbulent\footnote{$u_k = C_\mu^\frac{1}{4}k_I^\frac{1}{2}$}. Dans le
+cas du mod�le � une �chelle de vitesse, on pose $u_k=u^*$ avec $u^*$
+la vitesse de frottement en paroi d�termin�e � partir de la loi logarithmique.
+
+On divise alors les membres de l'\'equation~(\ref{Eq_Flux_scalaire})
+par $\phi_b$. Pour le membre de gauche, on simplifie en utilisant le fait
+que le flux se conserve et donc que $\phi=\phi_b$. Pour le membre de droite,
+on remplace $\phi_b$ par sa valeur $-\rho\,C\,u_k\,f^*$. Avec les notations~:
+\begin{equation}
+ \nu=\displaystyle\frac{\mu}{\rho}
+\qquad \nu_t=\displaystyle\frac{\mu_t}{\rho}
+\qquad f^+=\displaystyle\frac{f-f_{b,ext}}{f^*}
+\end{equation}
+on a~:
+\begin{equation}\label{Eq_Flux_scalaire_adim}
+1 = \left(\displaystyle\frac{\nu}{\sigma}+
+ \displaystyle\frac{\nu_t} {\sigma_t}\right)
+ \displaystyle\frac{\partial f^+}{\partial z} \displaystyle\frac{1}{u_k}
+\end{equation}
+
+Remarquons d\`es \`a pr\'esent qu'avec les notations pr\'ec\'edentes,
+$h_b$ s'exprime en fonction de $f^+_{I'}$~:
+\begin{equation}
+h_b=\displaystyle\frac{\phi_b}{f_{b,ext}-f_{I'}}=\frac{\rho\,C\,u_k}{f^+_{I'}}
+\end{equation}
+
+Pour d\'eterminer $h_b$, on int\`egre alors
+l'\'equation~(\ref{Eq_Flux_scalaire_adim}) afin de disposer de $f^+_{I'}$.
+L'unique difficult\'e consiste alors \`a prescrire une loi de variation de
+$\mathcal{K}=\displaystyle\frac{\nu}{\sigma}+
+ \displaystyle\frac{\nu_t} {\sigma_t}$
+
+
+Dans la zone turbulente pleinement d�velopp\'ee, une hypoth\`ese de
+longueur de m\'elange permet de mod\'eliser les variations de $\nu_t$~:
+\begin{equation}
+\nu_t = l^2 \arrowvert \frac{\partial U}{\partial z} \arrowvert =
+\kappa\,u^* \left(z + z_0\right)
+\end{equation}
+De plus, les effets de diffusion de $f$
+(ou effets "conductifs" lorsque $f$ repr\'esente la temp\'erature)
+sont n\'egligeables devant les effets turbulents~: on n\'eglige alors
+$\displaystyle\frac{\nu}{\sigma}$ devant
+$\displaystyle\frac{\nu_t}{\sigma_t}$. On a donc
+finalement~:
+\begin{equation}
+\mathcal{K}= \displaystyle\frac{\kappa \,u_k}{\sigma_t} \left(z+z_0\right)
+\end{equation}
+
+
+On int\`egre l'�quation adimensionnelle~(\ref{Eq_Flux_scalaire_adim})
+sous la m\^eme hypoth\`ese et on obtient alors la loi donnant $f^+$~:
+\begin{equation}
+f^+ = \displaystyle\frac{\sigma_t}{\kappa}\,
+ ln\left(\displaystyle\frac{z+z_0}{z_{o_T}}\right)
+\end{equation}
+o� $z_{o_T}$ est la longueur de rugosit� thermique. Son ordre de
+grandeur compar� � la rugosit� dynamique est donn� par la
+relation $ln\left(\displaystyle\frac{z_0}{z_{o_T}}\right) \approx 2$ (r�f�rence J. R. Garratt).
+
+Pour r\'esumer, le calcul de $h_b$ est r\'ealis\'e en d\'eterminant~:
+\begin{eqnarray}
+f^+_{I'}&=& \displaystyle\frac{\sigma_t}{\kappa}\,
+ ln\left(\displaystyle\frac{I'F+z_0}{z_{o_T}}\right) \\
+h_b&=&\displaystyle\frac{\phi_b}{f_{b,ext}-f_{I'}}=\frac{\rho\,C\,u_k}{f^+_{I'}}
+\end{eqnarray}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\etape{Mode de prescription des conditions aux limites\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On traite ici les variables \var{IVAR} sur les faces \var{IFAC}
+telles que \var{ICODCL(IFAC,IVAR)}=5.
+
+La vitesse de d\'efilement (\'eventuellement nulle) de la paroi est tout d'abord
+projet\'ee dans le plan tangent \`a la paroi. Ses trois composantes dans le
+rep\`ere de calcul sont stock\'ees dans les
+tableaux\\ \var{RCODCL(IFAC,IUIPH,1),RCODCL(IFAC,IVIPH,1)RCODCL(IFAC,IWIPH,1)}.
+
+On d\'etermine ensuite le
+rep\`ere local $\hat{\mathcal R}$. Pour chaque face, il est disponible dans les
+vecteurs $\vect{\tau}$ \var{(TX, TY, TZ)}, $\vect{\tilde{n}}$ \var{(-RNX, -RNY,
+-RNZ)}, et $\vect{b}$ \var{(T2X, -T2Y,-T2Z)}. Par ailleurs, si la norme de la vitesse
+tangentielle est inf\'erieure \`a la valeur arbitraire \var{EPZERO}
+($10^{-12}$), l'indicateur \var{TXN0} est positionn\'e \`a 0 (il vaut 1 sinon)
+et le vecteur $\vect{\tau}$ est pris
+\begin{itemize}
+\item [-] arbitraire, dans le plan perpendiculaire \`a $\vect{\tilde{n}}$ en
+$R_{ij}-\varepsilon$ (on utilise les composantes de $\vect{\tilde{n}}$ pour
+construire $\vect{\tau}$~; si $\vect{\tilde{n}}$ est identiquement nul, le
+code s'arr\^ete)~;
+\item [-] identiquement nul sinon.
+\end{itemize}
+
+On calcule ensuite les vitesses de frottement qui sont stock\'ees dans
+\var{UET} ($=u^*$) et dans \var{UK} ($=u_k$). Le sous-programme \fort{causta}
+ permet de calculer la vitesse de
+frottement pour le mod\`ele \`a une \'echelle
+de vitesse (\var{IDEUCH}=0). Pour le mod\`ele \`a deux \'echelles
+(\var{IDEUCH}=1), le calcul (plus simple) de \var{UET} et de \var{UK} est fait directement
+dans \fort{clptur}.
+
+Dans le cas ou le mod\`ele \`a une \'echelle de vitesse est actif, on impose
+\var{UK=UET} afin de conserver la coh\'erence du codage dans la suite du
+sous-programme.
+
+Les conditions aux limites pour la vitesse sont ensuite compl\'et\'ees.
+\begin{itemize}
+
+\item [-] En $k-\varepsilon$, on affecte, pour les trois composantes de vitesse
+respectivement, \`a $$\var{COEFA(IFAC,ICLU)}, \var{COEFA(IFAC,ICLV)} \,\text{ et
+}\,\var{COEFA(IFAC,ICLW)}$$ les coefficients $A_{flux}$
+issus de l'analyse relative \`a la contrainte tangentielle.\\
+ De m\^eme, les coefficients $B_{flux}$ sont affect\'es \`a
+$$\var{COEFB(IFAC,ICLU)}, \var{COEFB(IFAC,ICLV)} \,\text{ et
+}\,\var{COEFB(IFAC,ICLW)}.$$ Les conditions aux limites
+issues de l'analyse portant directement sur le gradient de vitesse $A_{grad}$ et
+$B_{grad}$ sont affect\'ees \`a $$\var{COEFA(IFAC,ICLUF)},
+\var{COEFA(IFAC,ICLVF)}, \var{COEFA(IFAC,ICLWF)}$$ et
+$$\var{COEFB(IFAC,ICLUF)}, \var{COEFB(IFAC,ICLVF)}, \var{COEFB(IFAC,ICLWF)}.$$
+
+\item [-] Lorsque la vitesse tangentielle en $I'$ est inf\'erieure \`a
+\var{EPZERO}, l'indicateur \var{TXN0} est annul\'e (sinon, \var{TXN0} vaut 1).
+ Cet indicateur est utilis\'e pour annuler les coefficients $A$ et
+ imposer des conditions d'adh\'erence.
+
+\item [-] la vitesse de d\'efilement de la paroi est prise en compte dans les
+conditions aux limites (coefficients \var{COEFA}).
+
+\end{itemize}
+
+Les conditions sur les grandeurs turbulentes sont ensuite
+compl\'et\'ees.
+
+
+Les conditions aux limites pour les scalaires sont ensuite compl\'et\'ees. Les
+coefficients \var{COEFA} et \var{COEFB} sont simplement renseign\'es en
+utilisant les conditions aux limites d\'ecrites pr\'ec\'edemment. La seule
+difficult\'e consiste \`a g\'erer correctement les diff\'erentes grandeurs
+permettant de calculer le coefficient d'\'echange $h_b$ sans erreur.
+
+L'indicateur \var{ISCSTH} sert, pour chaque {\it VarScalaires} \`a indiquer
+quelle valeur de $C$ utiliser
+au moment du traitement des conditions aux limites. Ainsi, pour \var{ISCSTH}=1,
+la variable doit \^etre trait\'ee comme une temp\'erature, avec $C=C_p$. Pour
+\var{ISCSTH}=0 ou 2, la variable doit \^etre trait\'ee comme un scalaire passif
+ou une enthalpie respectivement, avec $C=1$ (constante sans dimension) dans les deux cas.
+
+Par ailleurs, une valeur strictement positive de l'entier \var{IPCCP}
+indique que $C_p$ est variable en espace
+et disponible dans le tableau \var{PROPCE(IEL,IPCCP )} (renseign\'e dans
+\var{USPHYV}). Lorsque \var{IPCCP} est
+nul, $C_p$ est constant et disponible sous
+forme du r\'eel \var{CP0(IPHAS)}.
+
+L'indicateur \var{IHCP} permet de rassembler ces informations~:
+\begin{itemize}
+\item [-] \var{IHCP} = 0 : \var{CPP} = $C=1$
+\item [-] \var{IHCP} = 1 : \var{CPP} = $C=C_p$ uniforme en espace
+\item [-] \var{IHCP} = 2 : \var{CPP} = $C=C_p$ variable en espace
+\end{itemize}
+
+Pour la {\it VarScalaire} \var{LL}, l'indicateur \var{IVISLS(LL)}
+permet \'egalement de rep\'erer si $\displaystyle\frac{\alpha_m}{C}$
+est variable en espace et disponible dans le tableau \var{PROPCE(IEL,IPCVSL)}
+(\var{IVISLS} $> 0$) ou uniforme en espace et disponible sous forme du r\'eel
+\var{VISLS0(LL)} (\var{IVISLS} $= 0$). On pose \var{RKL}$ =
+\displaystyle\frac{\alpha_m}{C}$
+
+Le nombre de Prandtl local est alors calcul\'e \var{PRDTL} $ =
+\displaystyle\frac{\mu}{\alpha_m/C}$ ($\mu$ est la viscosit\'e dynamique mol\'eculaire
+disponible dans \var{VISCLC}).
+
+Le coefficient $h_{int}=\displaystyle\frac{\alpha}{\overline{I'F}}$ est ensuite
+d\'etermin\'e et conserv\'e
+dans \var{HINT}.
+
+Lorsqu'un mod\`ele de turbulence est activ\'e,
+on calcule \var{HFLUI} $ = h_b = \displaystyle\frac{\rho C u_k}{T^+}$.
+Si le calcul est r\'ealis\'e en laminaire, on a
+simplement \var{HFLUI} = \var{HINT} ($ = h_b = h_{int}=\displaystyle\frac{\alpha}{\overline{I'F}}$)
+
+Dans les cas o\`u l'on souhaite stocker le coefficient d'\'echange (couplage
+avec SYRTHES), \var{HFLUI} est conserv\'e dans le tableau \var{HBORD}.
+Dans les cas o\`u l'on utilise le module de rayonnement, \var{HFLUI} est
+stock\'e dans le tableau de travail \var{RA(IHCONV)}.
+
+On dispose alors de tous les \'elements pour calculer les coefficients $A$ et
+$B$ (\var{COEFA} et \var{COEFB}) relatif \`a la variable trait\'ee. Noter pour
+terminer les
+correspondances suivantes qui permettent de rapprocher le code source de la
+relation (\ref{eq_fbint_clptur})~:
+\begin{eqnarray}
+\var{HEXT} &=& h_{imp,ext}
+\nonumber \\
+\var{PIMP} &=& f_{imp,ext}
+\nonumber \\
+\var{HREDUI} &=& h_r
+\nonumber \\
+ \var{HINT} &=& h_{int}
+\nonumber \\
+\var{HFLUI} &=& h_b
+\nonumber
+\end{eqnarray}
diff --git a/doc/theory/clptur.tex b/doc/theory/clptur.tex
new file mode 100644
index 0000000..e8b6373
--- /dev/null
+++ b/doc/theory/clptur.tex
@@ -0,0 +1,1399 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{clptur}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Function}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+This subroutine is dedicated to the calculation of the wall boundary conditions. The notations introduced in \var{CONDLI} for the general boundary conditions will be used.
+
+The wall boundary conditions refer to all the boundary conditions for the velocity, the turbulent variables ($k$, $\varepsilon$, $R_{ij}$), the temperature when it has a prescribed value at the wall (or the enthalpy and more generally the {\it VarScalaires}\footnote{As in \fort{condli} the {\it VarScalaire} are any solution of a convection-diffusion equation apart from the velocity, the pressure and the turbulent variables $k$, $\varepsilon$ and $R_{ij}$. More specifically, the name {\i [...]
+
+We present the calculation of the pair of coefficients $A_b$ and $B_b$ which are used during the computation of certain discretized terms of the equations to solve, and which allow in particular to determine a value associated with the boundary faces $f_{b,int}$ (at a point located at the "centre" of the boundary face, the barycentre of its vertices) using the formulae $f_{b,int} = A_b+B_b\,f_{I'}$ ($f_{I'}$ is the value of the variable at point $I'$, the projection of the centre of th [...]
+
+
+\begin{figure}[h]
+\centerline{\includegraphics[height=7cm]{fluxbord}}
+\caption{\label{Base_Clptur_fig_flux_clptur}Boundary cell.}
+\end{figure}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discretisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\etape{Notations\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+The velocity of the wall is noted
+$\vect{v}_p$. We assume it is projected onto the plane tangent to the wall (if it is not, then the code projects it).
+
+
+The velocity of the fluid is noted $\vect{u}$. Index $I$, $I'$ or $F$ denotes the point at which the velocity is estimated. The component tangent to the wall writes $u_\tau$. The fluid velocity in the coordinate system attached to the wall ("relative" velocity) writes $\vect{u}^r=\vect{u} - \vect{v}_p$.
+
+
+
+The orthonormal coordinate system attached to the wall writes
+$\hat {\mathcal R}=(\vect{\tau},\vect{\tilde{n}},\vect{b})$.
+\begin{itemize}
+\item [$\bullet$] $\vect{\tilde{n}}=-\vect{n}$ is the unit vector orthogonal to the wall and directed towards the interior of the computational domain.
+\item [$\bullet$] $\vect{\tau} = \displaystyle\frac{1}{\|\vect{u}^r_{I'}-(\vect{u}^r_{I'}\,.\,\vect{\tilde{n}})\|}\left[\vect{u}^r_{I'}-(\vect{u}^r_{I'}\,.\,\vect{\tilde{n}})\right]$ is the unit vector parallel to the projection of the relative velocity at $I'$, $\vect{u}^r_{I'}$, in the plane tangent to the wall
+ ({\it i.e.} orthogonal to $\vect{\tilde{n}}$)~: see
+figure~\ref{Base_Clptur_fig_flux_clptur}.
+\item [$\bullet$] $\vect{b}$ is the unit vector which completes the positively oriented coordinate system.
+\end{itemize}
+\vspace{0.2cm}
+
+The dimensionless limit distance which separates the viscous sublayer from the logarithmic region writes $y^+_{lim}$. Its value is $1/\kappa$ (with $\kappa = 0,42$) in general (to ensure the continuity of the velocity gradient) and 10.88 in LES (to ensure the continuity of the velocity).
+
+In the case of the {\bf two velocity scale model},
+\begin{itemize}
+\item [-] $u_k$ is the friction velocity at the wall obtained from the turbulent kinetic energy.
+We write $u^*$ the friction velocity at the wall calculated from the equation
+ $ \displaystyle\frac{u^r_{\tau,I'}}{u^*} = f(y^+_k)$.
+
+\item [-]
+$y^+_k$ represents a dimensionless wall distance,
+$y^+_k= \displaystyle\frac{u_k\,I'F}{\nu}$ ($\nu$ is the molecular kinematic viscosity
+taken at the centre $I$ of the boundary cell).
+The function $f$ gives the ideal shape of the velocity profile.
+It is piecewisely approximated by the logarithmic law
+ $f(z)=f_1(z)= \displaystyle\frac{1}{\kappa}ln(z)+5,2$ for
+$z> y^+_{lim}$
+and by the linear law $f(z)=f_2(z)=z$ otherwise.
+
+\item [-] The two velocity scale $u_k$ and $u^*$ are simple to compute
+but their computation requires the knowledge of the turbulent kinetic energy $k_I$
+at the centre of cell adjoint to the boundary face (with the $R_{ij}-\varepsilon$ model, we use half the trace of the Reynolds stress tensor).
+
+
+\item [-] The two velocity scale model is the default model in \CS.
+It often permits, and in particular in cases with heat transfer, to reduce the
+effects of certain flaws associated to the $k-\varepsilon$ model.
+\end{itemize}
+
+
+Later on, we will use $u^*$ and $u_k$ for the boundary conditions of the velocity and scalars (in particular the temperature).
+
+
+\begin{equation}\label{Base_Clptur_Eq_Mod_'2ech_Vit}
+\begin{array}{l}
+\text{\bf Two velocity scale model}\\
+\left\{\begin{array}{l}
+u_k = C_\mu^\frac{1}{4}k_I^\frac{1}{2}\\
+u^* \text{is solution of }
+\left\{\begin{array}{lll}
+\displaystyle\frac{u^r_{\tau,I'}}{u^*} &=
+\displaystyle\frac{1}{\kappa}ln(y^+_k)+5,2 &\text { for }y^+_k>y^+_{lim}\\
+\displaystyle\frac{u^r_{\tau,I'}}{u^*} &= y^+_k &\text { for }
+y^+_k \leqslant y^+_{lim}
+\end{array}\right. \\
+\qquad\qquad
+\text{ with } C_\mu =0,09\qquad y^+_k=\displaystyle\frac{u_k\,I'F}{\nu}
+ \text{ and }\kappa = 0,42
+\end{array}\right.
+\end{array}
+\end{equation}
+
+
+
+In the case of the {\bf one velocity scale model},
+
+we write $u^*$ the only
+friction velocity at the wall solution of the equation
+$\displaystyle\frac{u^r_{\tau,I'}}{u^*} = f(y^+)$.
+$y^+$ represents a dimensionless wall distance
+$y^+=\displaystyle\frac{u^*\,I'F}{\nu}$ ($\nu$ is the molecular kinematic viscosity
+taken at the centre $I$ of the boundary cell).
+The function $f$ gives the ideal shape of the velocity profile, as in the case of the two velocity scale model. One can note that this friction velocity, calculated using a more complicated approach (Newton method), can however be obtained without making any reference to the turbulent variables ($k$, $\varepsilon$, $R_{ij}$). For convenience in the case of the one velocity scale model, we write $u_k=u^*$.
+
+Later on, we will use $u^*$ and $u_k$ for the boundary conditions of the velocity and scalars (in particular the temperature).
+
+\begin{equation}
+\begin{array}{l}
+\text{\bf Mod\`ele \`a une \'echelle de vitesse}\\
+\left\{\begin{array}{l}
+u_k = u^*\\
+u^* \text{ solution de } \left\{\begin{array}{lll}
+\displaystyle\frac{u^r_{\tau,I'}}{u^*} &=
+\displaystyle\frac{1}{\kappa}ln(y^+)+5,2 &\text { pour }y^+>y^+_{lim}\\
+\displaystyle\frac{u^r_{\tau,I'}}{u^*} &= y^+ &\text
+{pour } y^+\leqslant y^+_{lim}
+\end{array}\right.\\
+\qquad\qquad\text{ avec } y^+=\displaystyle\frac{u^*\,I'F}{\nu}
+ \text{ et }\kappa=0,42
+\end{array}\right.
+\end{array}
+\end{equation}
+
+
+{\bf Remark~:} Hereafter, we provide three exemples
+based on the two velocity scale model.
+\begin{itemize}
+\item In this way, one can implement a specific wall function~:
+$$\displaystyle\frac{u_{\tau,I'}}{u^*}=g(y^+)$$
+by simply imposing
+$\displaystyle{u^*}=u_{\tau,I'}/g(y^+)$.
+\item It is also possible to use a rough-wall wall function such as~:
+$$\displaystyle\frac{u_{\tau,I'}}{u^*}=\displaystyle\frac{1}{\kappa}\,ln(\frac{y}{\xi})+8,5$$
+where $\xi$ is the height of the roughness elements at the wall~: one just has to impose
+$\displaystyle u^*=u_{\tau,I'}/\left[\frac{1}{\kappa}ln(\frac{y}{\xi})+8,5\right]$,
+ $y$ being deduced from $y^+$, available as an argument, by the equation
+$\displaystyle y=y^+\frac{\nu}{u_k}$.
+\item Even a more general correlation could be used of
+Colebrook type~:
+$$u^*=u_{deb}/\left[-4\sqrt{2}log_{10}\left(\displaystyle\frac{2,51}{2\sqrt{2}D_H^+}+\frac{\xi}{3,7\,D_H}\right)\right]$$
+where $D_H^+$ is the hydraulic diameter made dimensionless using $u_k$, $\nu$,
+$u_{deb}$ the mean streamwise velocity
+and $\displaystyle\frac{\xi}{D_H}$ the relative roughness.
+\end{itemize}
+
+
+
+\etape{Boundary conditions for the velocity in $k-\varepsilon$\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+We first consider the boundary conditions used in the case of calculation using the
+ $k-\varepsilon$ model. Indeed these cases are the most complex and general.
+
+The boundary conditions are necessary to prescribe at the boundary
+ the correct tangential stress $\sigma_\tau=\rho_Iu^*u_k$ in the momentum
+equation\footnote{Proposition de modification des conditions aux limites de
+paroi turbulente pour le Solveur Commun dans le cadre du mod\`ele
+$k-\varepsilon$ standard, rapport EDF HI-81/00/019/A, 2000, M. Boucker, J.-D. Mattei.}
+($\rho_I$ is the density at the centre of cell $I$).
+The term which requires boundary conditions is the one containing the
+velocity derivative in the normal direction to the wall\footnote{The transpose gradient term is treated in \fort{vissec}
+and thus will not be considered here.}~:
+$(\mu_I+\mu_{t,I})\ggrad{\vect{u}}\,\vect{n}$. It appears on the
+right-hand side of the usual momentum equation (see \fort{bilsc2} and \fort{preduv}).
+
+In the case where the $k-\varepsilon$ model tends to surestimate
+the production of turbulent kinetic energy, the length scale of the model,
+$L_{k-\varepsilon}$,
+can become significantly larger than the maximum theoretical length scale
+of the turbulent boundary layer eddies $L_{\text{theo}}$. We write~:
+\begin{equation}
+\left\{\begin{array}{l}
+L_{k-\varepsilon} = C_{\mu}\displaystyle\frac{k^\frac{3}{2}}{\varepsilon}\\
+L_{\text{theo}} = \kappa\, I'F
+\end{array}\right.
+\end{equation}
+
+In the case where $L_{k-\varepsilon}>L_{\text{th\'eo}}$, we thus have
+$\mu_{t,I}>\mu_{t}^{lm}$ with $\mu_{t,I}$ the turbulent viscosity of the
+$k-\varepsilon$ model at point $I$ and $\mu_{t}^{lm}=\rho_I L_{\text{theo}}u_k$
+the turbulent viscosity of the mixing length model. Additionally, the
+tangential stress can write by making the turbulent viscosity appear~:
+\begin{equation}
+\sigma_\tau = \rho_Iu^*u_k = \displaystyle\frac{u^*}{\kappa\, I'F}\underbrace{\rho_I\kappa\, I'F\, u_k}_{\mu^{lm}_t}
+\end{equation}
+The viscosity scale introduced in the stress thus contradicts the one deduced
+from the neighbouring turbulence calculated by the model.
+Consequently we prefer to write the stress, by using the velocity scale of the $k-\varepsilon$ model when it is lower than
+the limit $L_{\text{th\'eo}}$~:
+\begin{equation}
+\sigma_\tau = \displaystyle\frac{u^*}{\kappa\, I'F} max(\mu_{t}^{lm},\mu_{t,I})
+\end{equation}
+
+One can then use this value to calculate the diffusive flux
+which depends upon it in the Navier-Stokes equations~:
+\begin{equation}\label{Base_Clptur_eq_grad_sigma_clptur}
+(\mu_I+\mu_{t,I})\ggrad{\vect{u}}\,\vect{n}=-\sigma_\tau \vect{\tau}.
+\end{equation}
+
+But the velocity gradient (face gradient) is computed in the code as~:
+\begin{equation}\label{Base_Clptur_eq_grad_uf_clptur}
+(\mu_I+\mu_{t,I})\ggrad{\vect{u}}\,\vect{n}=
+\displaystyle\frac{(\mu_I+\mu_{t,I})}{\overline{I'F}}(\vect{u}_F-\vect{u}_{I'})
+\end{equation}
+
+Using (\ref{Base_Clptur_eq_grad_sigma_clptur}) and
+(\ref{Base_Clptur_eq_grad_uf_clptur}) we obtain the value of $\vect{u}_F$
+to be prescribed, referred to as $\vect{u}_{F,flux}$~(conservation of the momentum flux)~:
+\begin{equation}\label{Base_Clptur_eq_uf_flux_clptur}
+\begin{array}{ll}
+\vect{u}_{F,flux}&=\vect{u}_{I'}-\displaystyle\frac{\overline{I'F}}{\mu_I+\mu_{t,I}}\sigma_\tau \vect{\tau}\\
+ &=\vect{u}_{I'}-\displaystyle\frac{u^*}{\kappa\, (\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I}) \vect{\tau}
+\end{array}
+\end{equation}
+
+In reality, an extra approximation is made. It consists in imposing a zero
+ normal velocity at the wall and in using equation (\ref{Base_Clptur_eq_uf_flux_clptur})
+ projected on the plane parallel to the wall~:
+\begin{equation}
+\vect{u}_{F,flux}=\left[u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa\,
+(\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I}) \right]\vect{\tau}
+\end{equation}
+
+Moreover, if the value obtained for $y^+$ is
+lower than $y^+_{lim}$ a no-slip condition is applied.
+Finally, one can also make the wall velocity appear in the final expression~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf "Flux" boundary conditions of the velocity}\,(k-\varepsilon)\\
+\left\{\begin{array}{llr}
+\vect{u}_{F,flux}&=\vect{v}_p& \text{ if\ } y^+\leqslant
+ y^+_{lim} \\
+\vect{u}_{F,flux}&=\vect{v}_p+&\left[u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa\,
+(\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I}) \right]\vect{\tau}
+\text{ otherwise }
+\end{array}\right.
+\end{array}
+\end{equation}
+
+A first pair of coefficients $A_{flux}$ and $B_{flux}$ can then be deduced
+(for each component of the velocity separately) and it is used only
+ to compute the tangential stress dependent term (see \fort{bilsc2})~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associated with the "flux" boundary conditions of the velocity } (k-\varepsilon)\\
+\left\{\begin{array}{l}
+\left\{\begin{array}{llr}
+\vect{A}_{flux}&=\vect{v}_p& \text{ if\ } y^+\leqslant y^+_{lim} \\
+\vect{A}_{flux}&=\vect{v}_p+&\left[u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa\,
+(\mu_I+\mu_{t,I})} max(\mu_{t}^{lm},\mu_{t,I}) \right]\vect{\tau} \text{ otherwise }
+\end{array}\right. \\
+\vect{B}_{flux} = \vect{0}
+\end{array}\right.
+\end{array}
+\end{equation}
+
+We saw above how to impose a boundary condition to compute directly the stress term.
+Further analysis is necessary to calculate correctly the velocity gradients. We
+want to find a boundary face value which permits to obtain,
+with the chosen expression for the gradient,
+ the value the turbulent production as close as possible to its theoretical value
+(determined by using the logarithmic law), in order to evaluate the normal
+derivative the tangential velocity.
+Thus, we define (at point $I$)~:
+\begin{equation}\label{Base_Clptur_eq_ptheo_clptur}
+P_{\text{th\'eo}} = \rho_I u^* u_k
+\|\displaystyle\frac{\partial u_\tau}{\partial\vect{n}}\|_{I} =
+\rho_I \displaystyle\frac{u_k(u^*)^2}{\kappa\, I'F}
+\end{equation}
+
+Morevoer, the dominant term of the production computed in cell $I$ is,
+in classical situations ($y$ is the coordinate on the axis
+whose direction vector is $\vect{\tilde{n}}$),
+\begin{equation}
+P_{\text{calc}} =
+\mu_{t,I}\left(\displaystyle\frac{\partial u_\tau}{\partial y}\right)^2_{I}
+\end{equation}
+
+The normal gradient of the tangential velocity (cell gradient)
+is calculated in the code using finite volume, and its expression
+on regular orthogonal meshes is (see the notations on
+figure \ref{Base_Clptur_fig_bord_ortho_clptur})~:
+\begin{equation}
+P_{\text{calc}} =
+\mu_{t,I}\left(\displaystyle\frac{u_{\tau,G}-u_{\tau,F}}{2d}\right)^2 =
+\mu_{t,I}\left(\displaystyle\frac{u_{\tau,I}+u_{\tau,J}-2u_{\tau,F}}{4d}\right)^2
+\end{equation}
+We then assume that $u_{\tau,J}$ can be obtained from $u_{\tau,I}$
+and from the normal gradient of $u_{\tau}$ calculated in G
+from the logarithmic law~:
+\begin{equation}
+\label{Base_Clptur_eq_dvp_lim_utau}
+u_{\tau,J}=u_{\tau,I}+ IJ\,.\,(\partial_y u_{\tau})_G+\mathcal{O} (IJ^{\,2}) \approx
+u_{\tau,I}+ IJ\,.\,\left[\partial_y \left(\displaystyle
+\frac{u^*}{\kappa}\,ln{ (y^+)} + 5,2 \right)\right]_G=
+u_{\tau,I}+2d\displaystyle\frac{u^*}{\kappa\, 2d}
+\end{equation}
+and thus we obtain~:
+\begin{equation}\label{Base_Clptur_eq_pcalc_clptur}
+\begin{array}{lll}
+P_{\text{calc}} &=&
+\mu_{t,I}\left(\displaystyle\frac{u_{\tau,I}+u_{\tau,I}+2d\frac{u^*}{\kappa\, 2d}-2u_{\tau,F}}{4d}\right)^2 \\
+&=&\mu_{t,I}\left(\displaystyle\frac{2u_{\tau,I}+2\frac{u^*}{2\kappa}-2u_{\tau,F}}{4d}\right)^2 =
+\mu_{t,I}\left(\displaystyle\frac{u_{\tau,I}+\frac{u^*}{2\kappa}-u_{\tau,F}}{2d}\right)^2
+\end{array}
+\end{equation}
+
+\begin{figure}[h]
+\centerline{\includegraphics[height=7cm]{bordortho}}
+\caption{\label{Base_Clptur_fig_bord_ortho_clptur}Cellule de bord - Maillage orthogonal.}
+\end{figure}
+
+We then use (\ref{Base_Clptur_eq_ptheo_clptur}) and
+(\ref{Base_Clptur_eq_pcalc_clptur}) to impose that the calculated
+production is equal to the theoretical production. The preceeding
+formulae are extended with no precaution to non-orthogonal meshes (the velocity
+at $I$ is then simply computed at $I'$).
+The following expression for $u_{\tau,F}$ is then obtained~:
+\begin{equation}
+u_{\tau,F,grad} =u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left(
+2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}} }-\displaystyle\frac{1}{2}\right)
+\end{equation}
+
+Additionally, we force the gradient to remain as stiff as the one
+given by the normal derivative of the theoretical velocity profile
+(logarithmic) at $I'$~:\\
+$\partial_y u_{\tau} = \partial_y (\displaystyle
+\frac{u^*}{\kappa}\,ln{ (y^+)} + 5,2 ) =\displaystyle\frac{u^*}{\kappa\, \overline{I'F}}$, thus~:
+\begin{equation}
+u_{\tau,F,grad} =u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}max\left(1,
+2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}} }-\displaystyle\frac{1}{2}\right)
+\end{equation}
+
+Finally, we clip the velocity at the wall with a minimum value calculated
+assuming that we are in the logarithmic layer~:
+\begin{equation}\label{Base_Clptur_eq_ugrad_clptur}
+u_{\tau,F,grad} =
+max\left(u^*\left(\displaystyle\frac{1}{\kappa}ln(y^+_{lim})+5,2\right),
+u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left[max\left(1,
+2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}}
+}-\displaystyle\frac{1}{2}\right)\right]\right)
+\end{equation}
+
+
+The normal derivative at the wall is prescribed to zero.
+If the $y^+$ value at the wall is lower than $y^+_{lim}$,
+a no-slip condition is prescribed. Finally, one can also
+make explicit the velocity of the wall in the final expression~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf "Gradient" boundary conditions of the velocity} (k-\varepsilon)\\
+\left\{\begin{array}{l}
+\vect{u}_{F,grad}=\vect{v}_p
+ \qquad\qquad\text{ if } y^+\leqslant y^+_{lim} \\
+\vect{u}_{F,grad}=\vect{v}_p+\\
+ \left\{
+max\left(u^*\left(\displaystyle\frac{1}{\kappa}ln(y^+_{lim})+5,2\right),
+u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left[max\left(1,
+2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}}
+}-\displaystyle\frac{1}{2}\right)\right]\right)
+\right\}\vect{\tau}
+ \text{ otherwise }
+\end{array}\right.
+\end{array}
+\end{equation}
+
+A second pair of coefficients $A_{grad}$ and $B_{grad}$ can then be deduced
+(for each velocity component separately). It is used when the velocity
+gradient is necessary (except for the terms depending on the tangential shear,
+those being treated in \fort{bilsc2} using $A_{flux}$ and $B_{flux}$)~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associated to the "gradient" boundary conditions of }\\
+\qquad\qquad\qquad\qquad\text{\bf the velocity} (k-\varepsilon)\\
+\left\{\begin{array}{l}
+\left\{\begin{array}{l}
+\vect{A}_{grad}=\vect{v}_p
+ \qquad\qquad\text{ \ if\ } y^+\leqslant y^+_{lim} \\
+\vect{A}_{grad}=\vect{v}_p+\\
+\left\{
+max\left(u^*\left(\displaystyle\frac{1}{\kappa}ln(y^+_{lim})+5,2\right),
+u^r_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left[max\left(1,
+2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}}
+}-\displaystyle\frac{1}{2}\right)\right]\right)
+\right\}\vect{\tau}
+ \text{ otherwise }
+\end{array}\right. \\
+\vect{B}_{grad} = \vect{0}
+\end{array}\right.
+\end{array}
+\end{equation}
+
+
+\etape{Boundary conditions of the velocity in $R_{ij}-\varepsilon$\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+The boundary conditions of the velocity with the $R_{ij}-\varepsilon$ model are
+more simple, since there are only of one type.
+Keeping the same notations as above, we want the tangential velocity gradient
+(calculated at $I$, and to be used to evaluate the turbulent production)
+to be consistent with the logarithmic law giving the ideal tangential
+velocity profile. The theoretical gradient is~:
+
+\begin{equation}\label{Base_Clptur_eq_grad_theo_clptur}
+G_{\text{theo}} = \left(\displaystyle\frac{\partial u_\tau}{\partial y}\right)_{I'}=\frac{u^*}{\kappa\, I'F}
+\end{equation}
+
+The normal gradient of the tangential velocity (cell gradient) is
+calculated in the code using finite volumes, and its expression in the case
+of regular orthogonal meshes is (see notations in figure
+\ref{Base_Clptur_fig_bord_ortho_clptur})~:
+\begin{equation}
+G_{\text{calc}}=\displaystyle\frac{u_{\tau,G}-u_{\tau,F}}{2d} =
+\displaystyle\frac{u_{\tau,I}+u_{\tau,J}-2u_{\tau,F}}{4d}
+\end{equation}
+We then assume that $u_{\tau,J}$ can be obtained from $u_{\tau,I}$
+and from the normal gradient of $u_{\tau}$ calculated in G
+from the logarithmic law (see equation (\ref{Base_Clptur_eq_dvp_lim_utau}))
+$u_{\tau,J}=u_{\tau,I}+2d\displaystyle\frac{u^*}{\kappa\, 2d}$ and we thus
+obtain~:
+\begin{equation}\label{Base_Clptur_eq_grad_calc_clptur}
+G_{\text{calc}}=\displaystyle\frac{u_{\tau,I}+u_{\tau,I}+2d\displaystyle\frac{u^*}{\kappa\, 2d}-2u_{\tau,F}}{4d}=
+\displaystyle\frac{2u_{\tau,I}+2\displaystyle\frac{u^*}{2\kappa}-2u_{\tau,F}}{4d}=
+\displaystyle\frac{u_{\tau,I}+\displaystyle\frac{u^*}{2\kappa}-u_{\tau,F}}{2d}
+\end{equation}
+We then use the equations (\ref{Base_Clptur_eq_grad_theo_clptur}) and
+(\ref{Base_Clptur_eq_grad_calc_clptur}) to derive an expression for
+$u_{\tau,F}$ (the preceeding
+formulae are extended with no precaution to the case non-orthogonal meshes,
+the velocity at $I$ being simply computed at $I'$)~:
+\begin{equation}
+u_{\tau,F}= u_{\tau,I'}-\displaystyle\frac{3u^*}{2\kappa }
+\end{equation}
+The normal derivative at the wall is prescribed to zero.
+If the value obtained for $y^+$ at the wall is lower than $y^+_{lim}$,
+a no-slip condition is prescribed. Finally, one can also
+make explicit the velocity of the wall in the final expression~:
+\begin{equation}\label{Base_Clptur_eq_CL_vitesse_rij_clptur}
+\begin{array}{l}
+\text{\bf Boundary conditions of the velocity }(R_{ij}-\varepsilon)\\
+\left\{\begin{array}{lll}
+\vect{u}_{F}&=\vect{v}_p& \text{ \ if\ } y^+\leqslant
+ y^+_{lim} \\
+\vect{u}_{F}&=\left[u^r_{\tau,I'}-\displaystyle\frac{3u^*}{2\kappa } \right]\vect{\tau} +\vect{v}_p &\text{ otherwise }
+\end{array}\right.
+\end{array}
+\end{equation}
+
+
+Un couple de coefficients $A$ et $B$ s'en d\'eduit (pour
+chaque composante de vitesse s\'epar\'ement)~:
+\begin{equation}\label{Base_Clptur_eq_AB_vitesse_rij_clptur}
+\begin{array}{l}
+\text{\bf Coefficients associ\'es aux conditions aux limites sur la vitesse }(R_{ij}-\varepsilon)\\
+\left\{\begin{array}{l}
+\left\{\begin{array}{lll}
+\vect{A}&=\vect{v}_p& \text{ \ si\ } y^+\leqslant y^+_{lim} \\
+\vect{A}&=\left[u^r_{\tau,I'}-\displaystyle\frac{3u^*}{2\kappa } \right]\vect{\tau}
++\vect{v}_p &\text{ sinon }
+\end{array}\right.\\
+\vect{B}= \vect{0}
+\end{array}\right.
+\end{array}
+\end{equation}
+A pair of coefficients $A_{grad}$ and $B_{grad}$ can be deduced
+from the above equation
+(for each velocity component separately).
+
+
+\etape{Boundary conditions of the velocity in laminar\vspace{0,3cm}}
+When no turbulence model is activated, we implicitly use a one velocity
+scale model (there is no turbulent variables to compute $u_k$), and the same
+conditions
+\footnote{In other words; the boundary conditions are given by
+ (\ref{Base_Clptur_eq_CL_vitesse_rij_clptur}) and
+(\ref{Base_Clptur_eq_AB_vitesse_rij_clptur}).}
+ as in $R_{ij}-\varepsilon$ are used~: the model degenerates automatically.
+
+
+
+\newpage
+
+\etape{Boundary conditions for $k$ and $\varepsilon$ (standard
+$k-\varepsilon$ model)\vspace{0,3cm}}
+
+We impose $k$ with a Dirichlet condition using the friction velocity
+$u_k$ (see equation~(\ref{Base_Clptur_Eq_Mod_'2ech_Vit})) :
+\begin{equation}
+k= \displaystyle\frac{u_k^2}{C_\mu^\frac{1}{2}}
+\end{equation}
+
+We want to impose the normal derivative of $\varepsilon$ from
+of the following theoretical law
+ (see the notations in figure \ref{Base_Clptur_fig_bord_ortho_clptur})~:
+\begin{equation}\label{Base_Clptur_eq_partialep_theo_clptur}
+G_{\text{theo},\varepsilon} = \displaystyle\frac{\partial \left(u_k^3/(\kappa\, y)\right)}{\partial y}
+\end{equation}
+
+
+
+We use point $M$ to impose a boundary condition with a higher order of
+accuracy in space.
+ Indeed, using the simple expression
+$\varepsilon_F=\varepsilon_I+d\partial_y\varepsilon_I + O(d^2)$ leads to
+first order accuracy.
+ A second order accuracy can be reached
+ using the following Taylor series expansion:
+\begin{equation}
+\left\{\begin{array}{ll}
+\varepsilon_M&=\varepsilon_I-\displaystyle\frac{d}{2}\partial_y\varepsilon_I+\displaystyle\frac{d^2}{8}\partial^2_y\varepsilon_I+O(d^3)\\
+\varepsilon_M&=\varepsilon_F+\displaystyle\frac{d}{2}\partial_y\varepsilon_F+\displaystyle\frac{d^2}{8}\partial^2_y\varepsilon_F+O(d^3)
+\end{array}\right.
+\end{equation}
+By substracting these twxo expression, we obtain
+\begin{equation}\label{Base_Clptur_eq_epsf_clptur}
+\varepsilon_F=\varepsilon_I-\displaystyle\frac{d}{2}(\partial_y\varepsilon_I+\partial_y\varepsilon_F)+O(d^3)
+\end{equation}
+Additionally, we have
+\begin{equation}
+\left\{\begin{array}{ll}
+\partial_y\varepsilon_I&=\partial_y\varepsilon_M+d\partial^2_y\varepsilon_M+O(d^2)\\
+\partial_y\varepsilon_F&=\partial_y\varepsilon_M-d\partial^2_y\varepsilon_M+O(d^2)
+\end{array}\right.
+\end{equation}
+The sum of these last two expressions gives
+$\partial_y\varepsilon_I+\partial_y\varepsilon_F=2\partial_y\varepsilon_M+O(d^2)$ and,
+using equation
+(\ref{Base_Clptur_eq_epsf_clptur}), we finally obtain a second order
+approximation for $\varepsilon_F$~:
+\begin{equation}
+\varepsilon_F=\varepsilon_I-d\partial_y\varepsilon_M+O(d^3)
+\end{equation}
+The theoretical value (see equation \ref{Base_Clptur_eq_partialep_theo_clptur})
+is then used in order to evaluate
+ $\partial_y\varepsilon_M$ and thus the value to prescribe at
+the boundary is obtained ($d=I'F$)~:
+\begin{equation}
+\varepsilon_F=\varepsilon_I+d\displaystyle\frac{ u_k^3}{\kappa\, (d/2)^2}
+\end{equation}
+
+This expression is extended to non-orthogonal mesh without any precautions
+(which is bound to deteriorate the spatial accuracy ot the method).
+
+Additionally, the velocity $u_k$ is set to zero for $y^+\leqslant y^+_{lim}$.
+Consequently, the value of $k$ and the flux of $\varepsilon$ are both zero.
+
+Finally we have~:
+
+\begin{equation}
+\begin{array}{l}
+\text{\bf Boundary conditions for } k \text { \bf and } \varepsilon \\
+\left\{\begin{array}{ll}
+k_F&= \displaystyle\frac{u_k^2}{C_\mu^\frac{1}{2}}\\
+\varepsilon_F&=\varepsilon_{I'}+I'F\displaystyle\frac{ u_k^3}{\kappa\, (I'F/2)^2}
+\end{array}\right. \\
+\text{with } u_k = 0 \text { if } y^+\leqslant y^+_{lim}
+\end{array}
+\end{equation}
+and the associated pair of coefficients
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associated to the boundary conditions of }
+k \text { \bf et } \varepsilon \\
+\left\{\begin{array}{llll}
+A_k&= \displaystyle\frac{u_k^2}{C_\mu^\frac{1}{2}} &\text{ and } B_k&= 0 \\
+A_\varepsilon&=I'F\displaystyle\frac{ u_k^3}{\kappa\, (I'F/2)^2}&\text{ and } B_\varepsilon&= 1
+\end{array}\right.\\
+\text{with } u_k = 0 \text { if } y^+\leqslant y^+_{lim}
+\end{array}
+\end{equation}
+
+
+
+
+
+
+
+\etape{Boundary conditions for $R_{ij}$ and $\varepsilon$
+(standard $R_{ij}-\varepsilon$ model)\vspace{0,3cm}}
+
+The boundary conditions for the Reynolds stresses in the coordinate system
+attached to the wall write ($\hat R$ refers to the local coordinate system)~:
+\begin{equation}
+\begin{array}{lll}
+\partial_{\tilde{n}} \hat R_{\tau\tau} = \partial_{\tilde{n}} \hat R_{\tilde{n}\tilde{n}}=\partial_{\tilde{n}} \hat R_{bb}=0 &
+\text { et } \hat R_{\tau\tilde{n}} = -u^*u_k &\text { et } \hat R_{\tau b} = \hat R_{\tilde{n} b}
+= 0
+\end{array}
+\end{equation}
+
+
+Additionally, if the value obtained for $y^+$ is lower
+than $y^+_{lim}$, all Reynolds stresses are set to zero
+(we assume that the turbulent stresses are negligible
+compared to the viscous stresses).
+
+Although it is done systematically in the code,
+expressing the above boundary conditions in the computation coordinate
+system is relatively complex (rotation of a tensor):~
+the reader is referred to the documentation of \fort{clsyvt}
+where more details are provided. In what follows,
+the boundary conditions will only be presented in the local
+coordinate system.
+
+Thus we want to impose the boundary values~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Boundary conditions of } R_{ij} \\
+\left\{\begin{array}{lll}
+\text{ if }y^+\leqslant y^+_{lim}&\hat R_{\alpha\alpha,F} = \hat R_{\alpha\beta,F} = 0 \\
+\text { otherwise } &\left\{\begin{array}{l}
+\hat R_{\alpha\alpha,F} = \hat R_{\alpha\alpha,I'} \text{ with }\alpha \in \{\tau,\tilde{n},b\}\text{ (without summation)}\\
+\hat R_{\tau\tilde{n}} = -u^*u_k \text { and } \hat R_{\tau b} = \hat
+R_{\tilde{n} b} =0
+\end{array}\right.
+\end{array}\right.
+\end{array}
+\end{equation}
+
+For the dissipation, the boundary condition applied is identical to the
+one applied with the $k-\varepsilon$ model~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Boundary conditions of } \varepsilon \text{ }(R_{ij}-\varepsilon) \\
+\left\{
+\begin{array}{l}
+\varepsilon_F=\varepsilon_{I'}+I'F\displaystyle\frac{ u_k^3}{\kappa\, (I'F/2)^2}\\
+\text{with } u_k = 0 \text { if } y^+\leqslant y^+_{lim}
+\end{array}\right.
+\end{array}
+\end{equation}
+
+
+These boundary conditions can be imposed explicitly (by default, ICLPTR=0)
+or (semi-)implicitly ( ICLPTR=1). The standard option (explicit) leads to
+the following values\footnote{It can be noticed
+that the value of $\varepsilon$ is not reconstructed at $I'$. We thus wish
+to improve the ''stability'' since $\varepsilon$ has a very steep gradient
+at the wall ($\varepsilon \approx \displaystyle\frac{1}{y}$), and thus
+only weak recontruction errors at $I'$ could lead to important
+deterioration of the results. However, it would be necessary to
+check if stability is altered with the gradient reconstruction of
+\fort{gradrc}.}
+of the coefficients $A$ and $B$~:
+
+
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associated to the explicit boundary conditions of }
+R_{ij} \text{\bf et } \varepsilon \\
+\left\{\begin{array}{l}
+\begin{array}{l}
+\text{If }y^+\leqslant y^+_{lim}\text{~:}\\
+\qquad\begin{array}{lll}
+ A_{\hat R_{\alpha\alpha}} = A_{\hat R_{\alpha\beta}} = 0 &\text{ and } B_{\hat R_{\alpha\alpha}} =B_{\hat R_{\alpha\beta}}= 0 &
+ \end{array}\\
+\text{Otherwise~:}\\
+\qquad\left\{\begin{array}{lll}
+ A_{\hat R_{\alpha\alpha}} = (R_{\alpha\alpha})_I &\text{ and } B_{\hat R_{\alpha\alpha}} = 0
+ &\text{ with }\alpha \in \{\tau,\tilde{n},b\}\text{ (without summation)}\\
+ A_{\hat R_{\tau \tilde{n}}} = -u^*u_k &\text{ and } B_{\hat R_{\tau \tilde{n}}} = 0 &\\
+ A_{\hat R_{\tau b}} = A_{\hat R_{\tilde{n} b}} = 0 &\text{ and } B_{\hat R_{\tau b}} =B_{\hat R_{\tilde{n} b}} = 0 &\\
+ \end{array}\right.
+\end{array}\\
+\text{And for all cases~:}\\
+\qquad A_\varepsilon=\varepsilon_{I}+I'F\displaystyle\frac{ u_k^3}{\kappa\, (I'F/2)^2} \text{ and } B_\varepsilon= 0
+\end{array}\right.\\
+\text{with } u_k = 0 \text { if } y^+\leqslant y^+_{lim}
+\end{array}
+\end{equation}
+
+The semi-implicit option leads to the following values for the
+coefficients $A$ and $B$. They differ from the preceeding ones, only
+as regards as the diagonal Reynolds stresses and dissipation.
+In the general case, impliciting of some components of the tensor
+in the local coordinate system leads to partially impliciting
+all the components in the global computation coordinate system~:
+\begin{equation}
+\begin{array}{l}
+\text{\bf Coefficients associated to the semi-implicit boundary conditions of}\\
+\qquad\qquad\qquad\qquad\text {\bf sur les variables } R_{ij} \text{\bf et } \varepsilon \\
+\left\{\begin{array}{l}
+\begin{array}{l}
+\text{If }y^+\leqslant y^+_{lim}\text{~:}\\
+\qquad\begin{array}{lll}
+ A_{\hat R_{\alpha\alpha}} = A_{\hat R_{\alpha\beta}} = 0 &\text{ and } B_{\hat R_{\alpha\alpha}} =B_{\hat R_{\alpha\beta}}= 0 &
+ \end{array}\\
+\text{Sinon~:}\\
+\qquad\left\{\begin{array}{lll}
+ A_{\hat R_{\alpha\alpha}} = 0 &\text{ and } B_{\hat R_{\alpha\alpha}} = 1 &\text{ with }\alpha \in \{\tau,\tilde{n},b\}\text{ (without summation)}\\
+ A_{\hat R_{\tau \tilde{n}}} = -u^*u_k &\text{ and } B_{\hat R_{\tau \tilde{n}}} = 0 &\\
+ A_{\hat R_{\tau b}} = A_{\hat R_{\tilde{n} b}} = 0 &\text{ and } B_{\hat R_{\tau b}} =B_{\hat R_{\tilde{n} b}} = 0 &\\
+ \end{array}\right.
+\end{array}\\
+\text{And for all cases~:}\\
+\qquad A_\varepsilon=I'F\displaystyle\frac{ u_k^3}{\kappa\, (I'F/2)^2}\text{ and } B_\varepsilon= 1
+\end{array}\right.\\
+\text{with } u_k = 0 \text { if } y^+\leqslant y^+_{lim}
+\end{array}
+\end{equation}
+
+
+
+
+\newpage
+\etape{Boundary conditions of the {\it VarScalaires}\vspace{0,3cm}}
+Only the boundary conditions when a boundary value is imposed
+(at the wall or away from the wall with a possible external exchange coefficient)
+are treated here.
+The reader is referred to the notations in figure
+\ref{Base_Clptur_fig_flux_clptur} and to the general presentation provided in
+\fort{condli} (in what follows only the most essential part of the
+presentation is repeated).
+
+The conservation of the normal flux at the boundary for variable $f$ writes~:
+\begin{equation}\label{Base_Clptur_eq_flux_clptur}
+\begin{array}{l}
+ \underbrace{h_{int}(f_{b,int}-f_{I'})}_{\phi_{int}}
+ = \underbrace{h_{b}(f_{b,ext}-f_{I'})}_{\phi_{b}}
+ = \left\{\begin{array}{ll}
+ \underbrace{h_{imp,ext}(f_{imp,ext}-f_{b,ext})}_{\phi_{\text{\it real
+imposed}}} &\text{(Dirichlet condition)}\\
+ \underbrace{\phi_{\text{\it imp,ext}}}_{\phi_{\text{\it real imposed}}}
+ &\text{(Neumann condition)}
+ \end{array}\right.
+\end{array}
+\end{equation}
+
+The above two equation are rearranged in order to obtain the value of the
+numerical flux $f_{b,int}=f_{F}$ to impose at the wall boundary face,
+according to the values of $f_{imp,ext}$ and $h_{imp,ext}$ set by the user,
+and to the value of $h_{b}$ set by the similarity laws detailed hereafter.
+The coefficients $A$ and $B$ can then be readily derived, and are presented here.
+
+\begin{equation}\label{Base_Clptur_eq_fbint_clptur}
+\begin{array}{l}
+\text{\bf Boundary conditions of the {\it VarScalaires} }\\
+f_{b,int} =
+\underbrace{\displaystyle\frac{h_{imp,ext}}{h_{int}+h_r h_{imp,ext} } f_{imp,ext}}_{A} +
+\underbrace{\displaystyle\frac{h_{int}+h_{imp,ext}(h_r-1)}{h_{int}+h_r h_{imp,ext} }}_{B} f_{I'}
+\text{ with } h_r=\displaystyle\frac{h_{int}}{h_{b}}
+\end{array}
+\end{equation}
+
+
+\newpage
+{\bf Similarity principle~: calculation of } $h_b$.
+
+The only remaining unknown in expression (\ref{Base_Clptur_eq_fbint_clptur})
+is the value of $h_{b}$, since $h_{int}$ has a numerical value which
+is coherent with the face gradient computation options detailed in
+ \fort{condli} ($h_{int}=\displaystyle\frac{\alpha}{\overline{I'F}}$).
+The value of $h_{b}$ must relate the flux to the values
+$f_{I'}$ and $f_{b,ext}$ by taking into account the boundary layer
+(the profile of $f$ is not always linear)~:
+\begin{equation}
+\phi_b=h_b\,(f_{b,ext}-f_{I'})
+\end{equation}
+
+
+The following considerations are presented using the general notations.
+In particular, the Prandtl-Schmidt number writes
+$\sigma=\displaystyle\frac{\nu\,\rho\,C}{\alpha}$.
+When the considered scalar $f$ is the temperature,
+we have (see \fort{condli})
+\begin{list}{$\bullet$}{}
+\item $C=C_p$ (specific heat capacity),
+\item $\alpha=\lambda$ (molecular conductivity),
+\item $\sigma = \displaystyle\frac{\nu\,\rho\,C_p}{\lambda} = Pr$
+ (Prandtl number),
+\item $\sigma_t = Pr_t$ (turbulent Prandtl number),
+\item $\phi=\left(\lambda+\displaystyle\frac{C_p\mu_t}{\sigma_t}\right)
+ \displaystyle\frac{\partial T}{\partial y}$ (flux in $Wm^{-2}$).
+\end{list}
+
+The reference "Convection Heat Transfer",
+Vedat S. Arpaci and Poul S. Larsen, Prentice-Hall, Inc was used.
+
+The flux at the wall writes for the scalar $f$ (the flux is positive
+if it enters the fluid domain, as shown by the orientation of the
+$y$ axis)~:
+\begin{equation}\label{Base_Clptur_Eq_Flux_scalaire}
+\phi = -\left(\alpha+C\,\frac{\mu_t}{\sigma_t}\right)
+ \frac{\partial f}{\partial y}
+ = -\rho\,C \left(\displaystyle\frac{\alpha}{\rho\,C}+
+ \frac{\mu_t}{\rho\sigma_t}\right)
+ \frac{\partial f}{\partial y}
+\end{equation}
+
+Similarly for the temperature, with
+ $a=\displaystyle\frac{\lambda}{\rho\,C_p}$ and
+$a_t=\displaystyle\frac{\mu_t}{\rho\,\sigma_t}$,
+we have~:
+\begin{equation}
+\phi = -\rho\,C_p(a+a_t)\frac{\partial T}{\partial y}
+\end{equation}
+
+In order to make $f$ dimensionless, we introduce $f^*$ defined using
+the flux at the boundary $\phi_b$~:
+\begin{equation}
+f^* = -\displaystyle\frac{\phi_b}{\rho\,C\,u_k}
+\end{equation}
+For the temperature, we thus have~:
+\begin{equation}
+T^* = -\displaystyle\frac{\phi_b}{\rho\,C_p\,u_k}
+\end{equation}
+
+We then divide both sides of equation~(\ref{Base_Clptur_Eq_Flux_scalaire})
+by $\phi_b$. For the left-hand side, we simplify using the conservation
+of the flux (and thus the fact that $\phi=\phi_b$). For the right-hand
+side, we replace $\phi_b$ by its value $-\rho\,C\,u_k\,f^*$.
+With the notations~:
+\begin{equation}
+ \nu=\displaystyle\frac{\mu}{\rho}
+\qquad \nu_t=\displaystyle\frac{\mu_t}{\rho}
+\qquad y^+=\displaystyle\frac{y\,u_k}{\nu}
+\qquad f^+=\displaystyle\frac{f-f_{b,ext}}{f^*}
+\end{equation}
+we have~:
+\begin{equation}\label{Base_Clptur_Eq_Flux_scalaire_adim}
+1 = \left(\displaystyle\frac{1}{\sigma}+
+ \displaystyle\frac{1}{\sigma_t}\frac{\nu_t}{\nu}\right)
+ \displaystyle\frac{\partial f^+}{\partial y^+}
+\end{equation}
+
+One can remark at this stage that with the notations used in the
+preceeding, $h_b$ can be expressed as a function of $f^+_{I'}$~:
+\begin{equation}
+h_b=\displaystyle\frac{\phi_b}{f_{b,ext}-f_{I'}}=\frac{\rho\,C\,u_k}{f^+_{I'}}
+\end{equation}
+
+In order to compute $h_b$, we integrate
+equation ~(\ref{Base_Clptur_Eq_Flux_scalaire_adim}) to obtain
+$f^+_{I'}$.
+The only difficulty then consists in prescribing a variation law
+$\mathcal{K}=\displaystyle\frac{1}{\sigma}+
+ \displaystyle\frac{1}{\sigma_t}\frac{\nu_t}{\nu}$.
+
+
+In the fully developed turbulent region
+(far enough from the wall, for $y^+\geqslant y^+_2$),
+a mixing length hypothesis models the variations of
+$\nu_t$~:
+\begin{equation}
+\nu_t = l^2 \arrowvert \frac{\partial U}{\partial y} \arrowvert =
+\kappa \,y\,u^*
+\end{equation}
+Additionally, the molecular diffusion of $f$
+(or the conduction when $f$ represents the temperature)
+is negligible compared to its turbulent diffusion~: therefore
+we neglect
+$\displaystyle\frac{1}{\sigma}$ compared to
+$\displaystyle\frac{1}{\sigma_t}\frac{\nu_t}{\nu}$.
+Finally we have
+\footnote{We make the approximation that the definitions of $y^+$
+from $u^*$ and $u_k$ are equivalent.}~:
+\begin{equation}
+\mathcal{K}= \displaystyle\frac{\kappa \,y^+}{\sigma_t}
+\end{equation}
+
+On the contrary, in the near-wall region (for $y^+ < y^+_1$)
+the turbulent contribution becomes negligible
+compared to the molecular contribution and we thus neglect
+$\displaystyle\frac{1}{\sigma_t}\frac{\nu_t}{\nu}$ compared to
+$\displaystyle\frac{1}{\sigma}$.
+
+It would be possible to restrict ourselves to these
+two regions, but Arpaci and Larsen suggest the model
+can be improved by introducing an intermediate
+region ($y^+_1 \leqslant y^+ < y^+_2$)
+in which the following hypothesis is made~:
+\begin{equation}
+\frac{\nu_t}{\nu} = a_1 (y^+)^3
+\end{equation}
+where $a_1$ is a constant whose value is obtained from
+experimental correlations~:
+\begin{equation}
+a_1 =\displaystyle\frac{\sigma_t}{1000}
+\end{equation}
+
+Thus the following model is used for $\mathcal{K}$
+(see a sketch
+in figure~\ref{Base_Clptur_Fig_a_plus_at_fonction_yplus})~:
+\begin{equation}
+\mathcal{K}=\left\{
+\begin{array}{ll}
+\displaystyle\frac{1}{\sigma}
+ &\text{if } y^+ < y^+_1\\
+\displaystyle\frac{1}{\sigma}
++\displaystyle\frac{a_1 (y^+)^3}{\sigma_t}
+ &\text{if } y^+_1 \leqslant y^+ < y^+_2\\
+\displaystyle\frac{\kappa \,y^+}{\sigma_t}
+ &\text{if } y^+_2\leqslant y^+\\
+\end{array}
+\right.
+\end{equation}
+
+\begin{figure}[htp]\label{Base_Clptur_Fig_a_plus_at_fonction_yplus}
+\centerline{\includegraphics[height=8cm]{clthermique}}
+\caption{$(a+a_t)/\nu$ as a function of $y^+$ obtained
+ for $\sigma=1$ and $\sigma_t=1$.}
+\end{figure}
+
+
+The values of $y^+_1$ and $y^+_2$ are obtained by calculating
+the intersection points of the variations laws used
+for $\mathcal{K}$.
+
+The existence of an intermediate region depends upon the
+values of $\sigma$.
+Let's first consider the case where $\sigma$ cannot be neglected
+compared to 1. In practise we consider $\sigma > 0,1$
+(this is the common case when scalar $f$ represents
+the air or the water temperature in normal temperature
+and pressure conditions). It is assumed that
+$\displaystyle\frac{1}{\sigma}$ can be neglected compared to
+$\displaystyle\frac{a_1 (y^+)^3}{\sigma_t}$ in the
+intermediate region.
+We thus obtain~:
+\begin{equation}
+ y^+_1 =\left(\displaystyle\frac{1000}{\sigma}\right)^\frac{1}{3} \qquad\qquad
+ y^+_2 = \sqrt{\displaystyle\frac{1000\kappa}{\sigma_t}}
+\end{equation}
+The dimensionless equation~(\ref{Base_Clptur_Eq_Flux_scalaire_adim})
+is integrated under the same hypothesis and we obtain the law of $f^+$~:
+\begin{equation}
+\left\{
+\begin{array}{ll}
+f^+ = \sigma \,y^+ & \text{if } y^+ < y^+_1 \\
+f^+ = a_2 -\displaystyle\frac{\sigma_t}{2\,a_1\,(y^+)^2}& \text{if } y_1^+ \leqslant y^+ < y_2^+ \\
+f^+ = \displaystyle\frac{\sigma_t}{\kappa}\,ln(y^+)+a_3& \text{if } y^+_2 \leqslant y^+\\
+\end{array}
+\right.
+\end{equation}
+where $a_2$ and $a_3$ are integration constants,
+which have been chosen to obtain
+a continuous profile of $f^+$~:
+\begin{equation}
+a_2=15\sigma^{\frac{2}{3}}\qquad\qquad
+a_3=15\sigma^{\frac{2}{3}}-\displaystyle\frac{\sigma_t}{2\kappa}
+\left(1+
+ln\left(\displaystyle\frac{1000\kappa}{\sigma_t}\right)\right)
+\end{equation}
+
+Let's now study the case where $\sigma$ is much smaller than 1.
+In practise it is assumed that $\sigma \leqslant 0,1$ (this is for
+instance the case for liquid metals whose thermal conductivity is very
+large, and who have Prandtl number of values of the order of 0.01).
+The intermediate region then disappears and the coordinate of the
+interface between the law used in the near-wall region and the one
+used away from the wall is given by~:
+\begin{equation}
+y^+_0= \displaystyle\frac{\sigma_t}{\kappa\sigma}
+\end{equation}
+
+The dimensionless equation~(\ref{Base_Clptur_Eq_Flux_scalaire_adim})
+is then integrated under the same hypothesis, and the law of
+ $f^+$ is obtained~:
+\begin{equation}
+\left\{
+\begin{array}{ll}
+f^+ = \sigma \,y^+ & \text{if } y^+ \leqslant y^+_0 \\
+f^+ = \displaystyle\frac{\sigma_t}{\kappa}\,
+ ln\left(\displaystyle\frac{y^+}{y^+_0}\right)+\sigma \,y^+_0
+ & \text{if } y^+_0 < y^+\\
+\end{array}
+\right.
+\end{equation}
+
+
+\newpage
+To summarize, the computation of $h_b$
+\begin{equation}
+h_b=\displaystyle\frac{\phi_b}{f_{b,ext}-f_{I'}}=\frac{\rho\,C\,u_k}{f^+_{I'}}
+\end{equation}
+is performed by calculating $f^+_{I'}$ from $y^+=y^+_{I'}$
+using the following laws.
+
+If $\sigma\leqslant 0,1$, a two-layer model is used~:
+\begin{equation}
+\left\{
+\begin{array}{ll}
+f^+ = \sigma \,y^+ & \text{if } y^+ \leqslant y^+_0 \\
+f^+ = \displaystyle\frac{\sigma_t}{\kappa}\,
+ ln\left(\displaystyle\frac{y^+}{y^+_0}\right)+\sigma \,y^+_0
+ & \text{if } y^+_0 < y^+\\
+\end{array}
+\right.
+\end{equation}
+with
+\begin{equation}
+y^+_0= \displaystyle\frac{\sigma_t}{\kappa\sigma}
+\end{equation}
+
+
+If $\sigma > 0,1$, a three-layer model is used~:
+\begin{equation}
+\left\{
+\begin{array}{ll}
+f^+ = \sigma \,y^+ & \text{if } y^+ < y^+_1 \\
+f^+ = a_2 -\displaystyle\frac{\sigma_t}{2\,a_1\,(y^+)^2}& \text{if } y_1^+ \leqslant y^+ < y_2^+ \\
+f^+ = \displaystyle\frac{\sigma_t}{\kappa}\,ln(y^+)+a_3& \text{if } y^+_2 \leqslant y^+\\
+\end{array}
+\right.
+\end{equation}
+with
+\begin{equation}
+ y^+_1 =\left(\displaystyle\frac{1000}{\sigma}\right)^\frac{1}{3} \qquad\qquad
+ y^+_2 = \sqrt{\displaystyle\frac{1000\kappa}{\sigma_t}}
+\end{equation}
+and
+\begin{equation}
+a_2=15\sigma^{\frac{2}{3}}\qquad\qquad
+a_3=15\sigma^{\frac{2}{3}}-\displaystyle\frac{\sigma_t}{2\kappa}
+\left(1+
+ln\left(\displaystyle\frac{1000\kappa}{\sigma_t}\right)\right)
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Implementation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\etape{Mode de prescription des conditions aux limites\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+This subroutines treats the variables \var{IVAR} on the faces \var{IFAC}
+for which \var{ICODCL(IFAC,IVAR)}=5.
+
+First the velocity of the wall (possibly zero) is projected onto
+the plane parallel to the wall. Its three components in the
+computation coordinate system are stored in the arrays
+\\ \var{RCODCL(IFAC,IUIPH,1),RCODCL(IFAC,IVIPH,1)RCODCL(IFAC,IWIPH,1)}.
+
+We then compute the local coordinate system $\hat{\mathcal R}$.
+For each face, it is stored in the vectors $\vect{\tau}$ \var{(TX, TY, TZ)},
+ $\vect{\tilde{n}}$ \var{(-RNX, -RNY,-RNZ)},
+and $\vect{b}$ \var{(T2X, -T2Y,-T2Z)}.
+It should be noticed that the third vector is only needed (and thus
+only calculated) when the $R_{ij}-\varepsilon$ model is used (for the
+second order tensor projection). Additionally, if the norm of the tangential
+velocity is lower than the arbitrary value \var{EPZERO}
+($10^{-12}$), the indicator \var{TXN0} is set to 0 (it is 0 otherwise)
+and the vector $\vect{\tau}$ is
+\begin{itemize}
+\item [-] chosen arbritrarily, in the plane orthogonal to $\vect{\tilde{n}}$ in
+$R_{ij}-\varepsilon$ (the components of $\vect{\tilde{n}}$ are used
+to construct $\vect{\tau}$~; if $\vect{\tilde{n}}$ is the zero vector,
+ the code stops)~;
+\item [-] zero, otherwise.
+\end{itemize}
+
+Once the local coordinate system has been calculated,
+the subroutine \fort{clca66} is called with
+\footnote{\var{CLSYME} = 0 indicates that we consider wall boundary conditions
+and not symmetry boundary conditions. One is referred to \var{CLSYVT} for
+more details on \fort{clca66}.} \var{CLSYME} =0
+(if the $R_{ij}-\varepsilon$ model is activated) in order to compute
+the matrix \var{ALPHA}. The latter will be used to compute the values to
+prescribe at the boundary, using the the values of the Reynolds stress
+tensor at the points $I'$.
+
+The friction velocities are then computed and stored in
+\var{UET} ($=u^*$) and \var{UK} ($=u_k$). The subroutine \fort{causta}
+ computes the friction velocity for the one velocity scale model
+(\var{IDEUCH}=0). Fot the two velocity scale model (\var{IDEUCH}=1),
+the (more simple) computation of \var{UET} and \var{UK} is performed
+directly in \fort{clptur}.
+
+If one velocity scale model is activated, we impose \var{UK=UET} to
+keep the coherence of the coding in the following of the subroutine.
+However, if we are in the viscous sublayer, we force \var{UK=0} to
+obtain a zero value for $k$ and a zero flux for $\varepsilon$
+(the value \var{UET} is not used, because the condition of the velocity
+is a no-slip condition and the Reynolds stresses are zero).
+
+If we are in the viscous sublayer, we compute \var{UET} again (and
+\var{YPLUS} if we use the one velocity scale model) since the previous
+derivation has been made under the assumption that we were in the
+logarithmic region.
+
+
+The boundary conditions for the velocity are then completed.
+\begin{itemize}
+
+\item [-] In $k-\varepsilon$, the coefficients $A_{flux}$
+(coming from the analysis of the tangential velocity) for the three
+components of the velocity are stored in
+ $$\var{COEFA(IFAC,ICLUF)}, \var{COEFA(IFAC,ICLVF)} \,\text{ et
+}\,\var{COEFA(IFAC,ICLWF)}$$, respectively.\\
+ Similarly, the coefficients $B_{flux}$ are stored in
+$$\var{COEFB(IFAC,ICLUF)}, \var{COEFB(IFAC,ICLVF)} \,\text{ et
+}\,\var{COEFB(IFAC,ICLWF)}.$$ The boundary conditions
+coming from the analysis of the velocity gradient $A_{grad}$ and
+$B_{grad}$ are stored in $$\var{COEFA(IFAC,ICLU)},
+\var{COEFA(IFAC,ICLV)}, \var{COEFA(IFAC,ICLW)}$$ and
+$$\var{COEFB(IFAC,ICLU)}, \var{COEFB(IFAC,ICLV)}, \var{COEFB(IFAC,ICLW)}.$$
+
+\item [-] When the tangential velocity at $I'$ is lower than
+\var{EPZERO}, the indicator \var{TXN0} is set to zero (otherwise,
+\var{TXN0} is 1).
+Likewise, when the value of
+$y^+$ is lower or equal to $10,88$, the indicator
+\var{UNTURB} is set to 0 (otherwise, it is 1). Both these indicators
+are used to set to zero the coefficients $A$, and thus to prescribe no-slip
+boundary conditions.
+
+\item [-] the velocity of the wall is taken into account in the
+boundary conditions (coefficients \var{COEFA}).
+
+\end{itemize}
+
+The conditions of the turbulent variables are then filled in.
+Additional details are provided for the Reynolds tensor
+in $R_{ij}-\varepsilon$.
+Using tensorial notation, we want to obtain
+$\tens{R}_F = E_{loglo}\,\hat{\tens{R}}_F\,E^t_{loglo}$, where
+$\hat{\tens{R}}_F$ is the stress tensor to impose in the local
+coordinate system and $E_{loglo}$ is the transformation matrix.
+The tensor in the local coordinate system is defined by the boundary
+conditions detailed above, $\hat{\tens{R}}_F=\hat{\tens{R}}^{B=1}_F$,
+with \footnote{The parameter
+$B$ permits to set to zero two terms if needed.}~:
+\begin{equation}
+\hat{\tens{R}}^B_{F}=\left[\begin{array}{lll}
+\hat{R}_{\tau\tau,I'}&-Bu^*u_k &0\\
+-Bu^*u_k &\hat{R}_{\tilde{n}\tilde{n},I'}&0\\
+0 &0 &\hat{R}_{bb,I'}
+\end{array}\right]
+\end{equation}
+
+The Reynolds tensor is stored in a vector with 6 components (at points $I'$
+of the boundary faces, these values are stored in \var{RIJIPB(IFAC,II)},
+with \var{IFAC} the index of the face and \var{II} the index of the stress,
+from 1 to 6 \var{II} refers to $R_{11},R_{22}, R_{33}$,
+$R_{12}, R_{13}$ and $R_{23}$, respectively. The array \var{IFAC} of
+dimension $6\times 6$ (calculated by \fort{clca66}) is used to perform
+the necessary change of coordinate system computations, and to obtain
+the values of $\hat{\tens{R}}^{B=0}_F$ from the values stored in
+\var{RIJIPB(IFAC,II)}.
+Thus,
+\begin{itemize}
+\item[-] for each Reynolds stress \var{ISOU},
+in case of explicit boundary conditions (\var{ICLPTR}=0), we set
+\var{COEFA(IFAC,ISOU)} to the corresponding value of
+$\tens{R}^{B=1}_F$ obtained by first computing
+$\tens{R}^{B=0}_F$ by
+$\sum_{II=1,6}$\var{ALPHA(ISOU,II)*RIJIPB(IFAC,II)}, and then by adding
+the quantity factorised by B in the previous sum, in order to obtain
+the complete value of $\tens{R}^{B=1}_F$. Since the boundary conditions
+are explicit, \var{COEFB} is set to 0.
+\item[-] in case of semi-implicit boundary conditions (\var{ICLPTR}=1),
+for each Reynolds stress \var{ISOU},
+we store in the array \var{COEFA(IFAC,ISOU)} the corresponding value
+$\tens{R}^{B=1}_F$ minus the terms which depend upon
+\var{RIJIPB(IFAC,ISOU)} (which will be implicited)
+This value is obtained by first calculating \\
+$\sum_{II=1,6|II\neq ISOU}$\var{ALPHA(ISOU,II)*RIJIPB(IFAC,II)},
+and then by adding the quantity factorised by B in order to obtain
+the value of $\tens{R}^{B=1}_F$ minus the term \\
+\var{ALPHA(ISOU,ISOU) RIJIPB(IFAC,ISOU)}.
+\var{ALPHA(ISOU,ISOU)} is then stored in \var{COEFB} (implicit part of
+the boundary conditions)\footnote{the implicit part does not include
+the tangential stress due to the friction velocities and thus the boundary
+conditions are not fully implicit.}.
+\end{itemize}
+
+The boundary conditions of the scalars are then completed. The coefficients
+\var{COEFA} and \var{COEFB} are simply calculated using the boundary
+conditions previously described. The only difficulty consists in dealing
+adequatly with the various values necessary to compute the exchange
+coefficient $h_b$ without any mistake.
+
+
+The indicator \var{ISCSTH} gives for each {\it VarScalaires} the value
+of $C$ to use in the treatment of the boundary conditions.
+Thus, for \var{ISCSTH}=1,
+the variable should be treated as a temp\'erature, with $C=C_p$. For
+\var{ISCSTH}=0 or 2, the variable should be treated as a passive scalar
+or as an enthalpy, respectively, with $C=1$ (dimensionless constant)
+in both cases. For \var{ISCSTH}=3, the variables is the resolved energy
+in the framework of the compressible module (see \fort{cfxtcl}). We then
+have $C=1$.
+
+Additionally, a strictly positive value of the integer \var{IPCCP}
+indicates that $C_p$ varies in space and that it is available in the
+array \var{PROPCE(IEL,IPCCP )} (filled in \var{USPHYV}). When \var{IPCCP}
+is zero, $C_p$ is constant and it is available
+as a real number \var{CP0(IPHAS)}.
+
+
+The indicator \var{IHCP} gathers these informations~:
+\begin{itemize}
+\item [-] \var{IHCP} = 0 : \var{CPP} = $C=1$
+\item [-] \var{IHCP} = 1 : \var{CPP} = $C=C_p$ uniform in space
+\item [-] \var{IHCP} = 2 : \var{CPP} = $C=C_p$ variable in space
+\end{itemize}
+
+For {\it VarScalaire} \var{LL}, the indicator \var{IVISLS(LL)}
+indicates if $\displaystyle\frac{\alpha_m}{C}$
+is variable in space and available in
+the array \var{PROPCE(IEL,IPCVSL)}
+(\var{IVISLS} $> 0$) or if is uniform in space and available
+as a real number
+\var{VISLS0(LL)} (\var{IVISLS} $= 0$). We take \var{RKL}$ =
+\displaystyle\frac{\alpha_m}{C}$.
+
+The local Prandtl number is then calculated as \var{PRDTL} $ =
+\displaystyle\frac{\mu}{\alpha_m/C}$ ($\mu$ is the molecular dynamic viscosity
+available in \var{VISCLC}).
+
+The coefficient $h_{int}=\displaystyle\frac{\alpha}{\overline{I'F}}$ is
+then calculated and stored in \var{HINT}.
+
+When a turbulence model is activated,
+the subroutine \var{HTURBP} computes \var{HFLUI} $ =
+Pr\displaystyle\frac{y^+}{T^+}$ (or \var{HFLUI}~$ = 1$
+in the viscous sublayer),
+which is then immediately multiplied by \var{CPP*RKL/DISTBF}$ =
+\displaystyle\frac{\alpha_m}{\overline{I'F}}$ to obtain \var{HFLUI} $ = h_b =
+\displaystyle\frac{\rho C u_k}{T^+}$ (or \var{HFLUI} $ = h_b = \displaystyle\frac{\alpha_m}{\overline{I'F}}$ in the viscous sublayer).
+If the calculation is performed in laminar, we simply have
+ \var{HFLUI} = \var{HINT} ($ = h_b = h_{int}=\displaystyle\frac{\alpha}{\overline{I'F}}$)
+
+In case we wish to store the exchange coefficient (coupling with SYRTHES),
+\var{HFLUI} is kept in the array \var{HBORD}. In case the raditation module
+is used, \var{HFLUI} is stored in the work array \var{RA(IHCONV)}.
+
+We then have all the information necessary to compute the coefficients
+$A$ and $B$ (\var{COEFA} and \var{COEFB}) relative to the treated variable.
+Finally one can give the following correspondances
+to relate the source code implementation to
+expression (\ref{Base_Clptur_eq_fbint_clptur})~:
+\var{HEXT} $ = h_{imp,ext}$, \var{PIMP} $ = f_{imp,ext}$,
+\var{HREDUI} $ = h_r$, \var{HINT} $ = h_{int}$, \var{HFLUI} $ = h_b$.
+
+
+
+
+\newpage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points to treat}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+The use of \var{HFLUI/CPP} when \var{ISCSTH} is 2 (case with
+radiation) needs to be checked (\var{CPP} is actually 1 in this case).
+
+The boundary conditions of the velocity are based on derivations
+focusing on only one term of the tangential stress
+$(\mu_I+\mu_{t,I})(\ggrad{\vect{u}})\,\vect{n}$ without taking
+into account the tranpose gradient.
+
+In order to establish the boundary conditions of the velocity in
+$k-\varepsilon$ based on the constraint , a projection onto the plane
+tangent to the wall and an arbitrary zero normal velocity
+are introduced.
+
+The hypothesis made in order to establish formulae for the different types
+of boundary conditions (dissipation, velocities) are based on the assumption
+that the mesh is orthogonal at the wall. This assumption is extended
+without any caution to the case of non-orthogonal meshes.
+
+The one velocity scale (\fort{causta}) wall function requires
+solving an equation using a Newton algorithm.
+The computational cost of the latter is low. One can also used
+a $1/7$ power law (Werner et Wengle) which yields results which are as
+accurate as the logarithmic law in the logarithmic region, and which permits
+analytical resolutions (chosen option in LES mode). Be careful however,
+since with this law, the intersection with the linear law is
+slightly different, which thus requires some adaptations (intersection
+around 11.81 instead of 10.88 for the law adopted here
+$U^+=8,3\,(y^+)^\frac{1}{7}$).
+
+
+The values of all the physical properties are taken at the cell centres,
+without any reconstruction. Without modifying this approach, it would be
+useful to keep this in mind.
+
+%
+%
+%
+%Pb de continuite si YPLULI.NE.10.88
+%
+% Le mode de r\'esolution permettant d'obtenir $u^*$ est particulier. Avec le
+%mod\`ele \`a une \'echelle de vitesse, on \'evalue
+%tout d'abord la vitesse de frottement $u^*$ issue de la loi logarithmique. On
+%pose $u_k=u^*$, puis on calcule la valeur de $y^+$. Avec le
+%mod\`ele \`a deux \'echelles, on calcule tout d'abord $u_k$, on en d\'eduit
+%$y^+$ puis $u^*$. Dans les deux cas, si
+%$y^+\leqslant y^+_{lim}=\displaystyle\frac{2}{\kappa}$, on applique une condition
+%d'adh\'erence (vitesse impos\'ee nulle \`a la paroi, \'energie turbulente et
+%tensions de Reynolds impos\'ees nulles, flux nul pour la dissipation).
+%Il serait bon de v\'erifier que cette m\'ethode, qui utilise une loi
+%logarithmique jusqu'\`a de tr\`es petites
+%valeurs de $y^+$, ne conduit pas \`a des valeurs trop faibles de la
+%vitesse de frottement lorsqu'on s'approche de la paroi ($y^+ \leqslant 10$).
+%La figure \ref{Base_Clptur_fig_loi_log_clptur} propose une illustration~: supposons qu'en un
+%point on obtienne, avec la m\'ethode actuelle, $u+\approx 8,6$ et
+%$y^+\approx 4,3$. On en d\'eduit alors que la vitesse de frottement est
+%$u^*\approx 1$ (courbe logarithmique en trait plein (noire) repr\'esentant
+%$ln(y^+)/0,42+5,2$).
+%Toutes choses \'egales par ailleurs (ce qui constitue une
+%hypoth\`ese en soi), avec une m\'ethode prenant en compte une loi lin\'eaire en
+%dessous de $y^+\approx 10$, on aurait obtenu $u^*\approx 2$
+%(courbe lin\'eaire en trait plein (rouge) repr\'esentant $2y^+$). Bien
+%entendu, cette analyse est relativement na\"\i ve et ne prend pas en compte le
+%caract\`ere implicite des r\'esolutions ainsi que le fait qu'il est d'ordinaire
+%peu recommand\'e de placer la premi\`ere maille \`a des valeurs aussi faibles de
+%$y^+$ avec les mod\`eles de type haut Reynolds.
+%
+%\begin{figure}[h]
+%\centerline{\includegraphics[height=7cm]{loilog}}
+%\caption{\label{Base_Clptur_fig_loi_log_clptur}D\'etermination de $y^+$.}
+%\end{figure}
+
+
+
+% Plus d'actualite a priori, mais pistes de reflexion quand meme
+%La limitation par valeur minimale de la vitesse dans (\ref{Base_Clptur_eq_ugrad_clptur})
+%a \'et\'e corrig\'ee dans la version 1.1.0.q.
+%Auparavant, la formulation \'etait susceptible de conduire
+%\`a une valeur trop faible du gradient de vitesse et donc de la production
+%turbulente en paroi. Elle s'\'ecrivait~:
+%\begin{equation}
+%u_{\tau,F,grad} =u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}min\left[max\left(1,
+%2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}}
+%}-\displaystyle\frac{1}{2}\right),ln\frac{2}{\kappa}+5,2\kappa\right]
+%\end{equation}
+%La formulation a \'et\'e modifi\'ee~:
+%\begin{equation}\notag
+%u_{\tau,F,grad} =max\left(u^*(\frac{1}{\kappa}ln\displaystyle\frac{2}{\kappa}+5,2),
+%u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left[max\left(1,
+%2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}}
+%}-\displaystyle\frac{1}{2}\right)\right]\right)
+%\end{equation}
+%Elle a \'et\'e adopt\'ee apr\`es des tests sur des
+%configurations de validation (canal, marche descendante, jet impactant, dune,
+%echo, rra) qui n'ont montr\'e aucune influence de la modification.
+%\`A partir de la version 1.1.0.t, on a utilis\'e la valeur
+%$y^+_\text{lim}=10,88$ et non plus $\frac{2}{\kappa}$ pour caract\'eriser le
+%passage de la loi lin\'eaire \`a la loi logarithmique et la
+%relation a donc \'et\'e modifi\'ee comme suit~:
+%\begin{equation}\notag
+%u_{\tau,F,grad} =max\left(u^*(\frac{1}{\kappa}ln(y^+_\text{lim})+5,2),
+%u_{\tau,I'}-\displaystyle\frac{u^*}{\kappa}\left[max\left(1,
+%2\sqrt{\displaystyle\frac{\rho_I\kappa\, u_k I'F}{\mu_{t,I}}
+%}-\displaystyle\frac{1}{2}\right)\right]\right)
+%\end{equation}
+%Comme, pour des $y^+$ inf\'erieurs \`a $y^+_\text{lim}$, on applique une
+%condition d'adh\'erence, cette approche n'est pas continue au voisinage de
+%$y^+_\text{lim}$. Il serait utile de se pencher sur la question.
+%Il faut cependant garder \`a l'esprit que la condition
+%de Dirichlet pour $k$ est prise nulle quand $y^+$ est inf\'erieur \`a
+%$y^+_\text{lim}$, ce qui tend \'egalement \`a annuler la production,
+%quelle que soit la condition \`a la limite utilis\'ee pour la vitesse.
+
+
+For the thermal law with very small Prandtl numbers compared to 1,
+Arpaci and Larsen suggest $y_0^+ \simeq 5/Pr$ (with proof from
+experimental data) rather than $Pr_t/(Pr\,\kappa)$ (current value,
+computed as the analytical intersection of the linear and logarithmic
+laws considered). One should address this question.
+
+
diff --git a/doc/theory/clsyvt.tex b/doc/theory/clsyvt.tex
new file mode 100644
index 0000000..1708d68
--- /dev/null
+++ b/doc/theory/clsyvt.tex
@@ -0,0 +1,615 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{clsyvt}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Function}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The aim of this subroutine is to fill the arrays of boundary conditions
+ (\var{COEFA} and \var{COEFB}) of the velocity and of the Reynolds stress tensor,
+for the symmetry boundary faces.
+These conditions are express relatively naturally in the local coordinate system
+of the boundary face. The function of \fort{clsyvt} is then to transform these
+natural boundary conditions (expressed in the local coordinate sytem) in the
+general coordinate sytem, and then to possibly partly implicit them.
+
+It should be noted that the part of the subroutine \fort{clptur} (for the wall
+boundary conditions) relative to the writing in the local coordinate system and to
+the rotation is totally identical.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discretisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Figure \ref{Base_Clsyvt_fig_facesym} presents the notations used at the face.
+The local coordinate system is defined from the normal at the face and
+the velocity at $I'$ :\\
+$\bullet\ \displaystyle\vect{t}
+=\frac{1}{|\vect{u}_{I',\tau}|}\vect{u}_{I',\tau}$ is the first
+vector of the local coordinate system.\\
+$\bullet\ \vect{\tilde{n}}=-\vect{n}$ is the second
+vector of the local coordinate system.\\
+$\bullet\ \vect{b}=\vect{t}\wedge\vect{\tilde{n}}=\vect{n}\wedge\vect{t}$
+is the third
+vector of the local coordinate system.\\
+
+\begin{figure}[h]
+\centerline{\includegraphics[width=8cm]{facesym}}
+\caption{\label{Base_Clsyvt_fig_facesym}Definition of the vectors forming the local coordinate system.}
+\end{figure}
+
+Here, $\vect{n}$ is the normalized normal vector to the boundary face
+in the sense of \CS ({\em i.e.}
+directed towards the outside of the computational domain)
+and $\vect{u}_{I',\tau}$ is the projection of the velocity at $I'$
+in the plane of the face :
+$\vect{u}_{I',\tau}=\vect{u}_{I'}-(\vect{u}_{I'}.\vect{n})\vect{n}$.\\
+If $\vect{u}_{I',\tau}=\vect{0}$, the direction of $\vect{t}$ in the plane
+normal to $\vect{n}$ is irrelevant. thus it is defined as :
+$\displaystyle\vect{t}=\frac{1}{\sqrt{n_y^2+n_z^2}}(n_z\vect{e}_y-n_y\vect{e}_z)$
+where
+$\displaystyle\vect{t}=\frac{1}{\sqrt{n_x^2+n_z^2}}(n_z\vect{e}_x-n_x\vect{e}_z)$
+along the non-zero components of $\vect{n}$ (components in the global
+coordinate system $(\vect{e}_x,\vect{e}_y,\vect{e}_z)$).
+
+
+For sake of clarity, the following notations will be used :\\
+$\bullet\ $The general coordinate system will write
+$\mathcal{R}=(\vect{e}_x,\vect{e}_y,\vect{e}_z)$.\\
+$\bullet\ $The local coordinate system will write
+$\hat{\mathcal{R}}=(\vect{t},-\vect{n},\vect{b})=(\vect{t},\vect{\tilde{n}},\vect{b})$.\\
+$\bullet\ $The matrices of the components of a vector $\vect{u}$
+in the coordinate systems
+$\mathcal{R}$ and $\hat{\mathcal{R}}$ will write
+$\mat{U}$ and $\hat{\mat{U}}$, respectively.\\
+$\bullet\ $The matrices of the components of a tensor $\tens{R}$ (2$^{nd}$ order)
+in the coordinate systems $\mathcal{R}$ and $\hat{\mathcal{R}}$ will write
+ $\matt{R}$ and $\hat{\matt{R}}$, respectively.\\
+$\bullet\ $ $\matt{P}$ refers to the (orthogonal) matrix transforming
+ $\mathcal{R}$ into $\hat{\mathcal{R}}$.
+\begin{equation}
+\matt{P}=\left[
+\begin{array}{ccc}
+t_x & -n_x & b_x\\
+t_y & -n_y & b_y\\
+t_z & -n_z & b_z
+\end{array}\right]
+\end{equation}
+
+($\matt{P}$ being orthogonal, $\matt{P}^{-1}=\,^t\matt{P}$).
+
+In particular, we have for any vector $\vect{u}$
+and for any second order tensor $\tens{R}$ :\\
+\begin{equation}
+\left\{\begin{array}{l}
+\mat{U} = \matt{P}\,.\,\hat{\mat{U}}\\
+\matt{R}= \matt{P}\,.\,\hat{\matt{R}}\,.\,^t\matt{P}
+\end{array}\right.
+\end{equation}
+
+\minititre{Treatment of the velocity}
+In the local coordinate system, the boundary conditions for $\vect{u}$
+naturally write :\\
+\begin{equation}
+\left\{\begin{array}{lcl}
+u_{F,t} & = & u_{I',t}\\
+u_{F,\tilde{n}} & = & 0\\
+u_{F,b} & = & u_{I',b}
+\end{array}\right.
+\end{equation}
+or
+\begin{equation}
+\mat{U}_F = \matt{P}\,.\,\hat{\mat{U}}_F
+= \matt{P}\,.\,\left[
+\begin{array}{ccc}
+1 & 0 & 0\\
+0 & 0 & 0\\
+0 & 0 & 1
+\end{array}
+\right]\,.\,\hat{\mat{U}}_{I'}
+=\matt{P}\,.\,\left[
+\begin{array}{ccc}
+1 & 0 & 0\\
+0 & 0 & 0\\
+0 & 0 & 1
+\end{array}
+\right]\,.\,^t\matt{P}\,.\,\mat{U}_{I'}
+\end{equation}
+
+
+Let's take
+$\matt{A}=\matt{P}\,.\,\left[
+\begin{array}{ccc}
+1 & 0 & 0\\
+0 & 0 & 0\\
+0 & 0 & 1
+\end{array}
+\right]\,.\,^t\matt{P}\qquad$ (matrix in the coordinate system $\mathcal{R}$
+of the projector orthogonal to the face).
+
+The boundary conditions for $\vect{u}$ thus write :
+\begin{equation}
+\mat{U}_F = \matt{A}\,.\,\mat{U}_{I'}
+\end{equation}
+
+Since the matrix $\matt{P}$ is orthogonal, it can be shown that
+\begin{equation}
+\matt{A}=\left[
+\begin{array}{ccc}
+1-\tilde{n}_x^2 & -\tilde{n}_x\tilde{n}_y & -\tilde{n}_x\tilde{n}_z\\
+-\tilde{n}_x\tilde{n}_y & 1-\tilde{n}_y^2 & -\tilde{n}_y\tilde{n}_z\\
+-\tilde{n}_x\tilde{n}_z & -\tilde{n}_y\tilde{n}_z & 1-\tilde{n}_z^2
+\end{array}\right]
+\end{equation}
+
+The boundary conditions can then be partially implicited:
+\begin{equation}
+\label{Base_Clsyvt_eq_clU}
+u_{F,x}^{(n+1)} = \underbrace{1-\tilde{n}_x^2}_{\var{COEFB}}u_{I',x}^{(n+1)}
+\underbrace{-\tilde{n}_x\tilde{n}_y u_{I',y}^{(n)}
+-\tilde{n}_x\tilde{n}_z u_{I',z}^{(n)}}_{\var{COEFA}}
+\end{equation}
+
+The other components have a similar treatment. Since only the coordinates
+of $\vect{n}$ are useful, we do not need (for $\vect{u}$) to define
+explicitly the vectors $\vect{t}$ and $\vect{b}$.
+
+\vspace{1cm}
+\minititre{Treatment of the Reynolds stress tensor}
+We saw that we have the following relation:
+\begin{equation}
+\label{Base_Clsyvt_eq_chgtrepR}
+\matt{R}= \matt{P}\,.\,\hat{\matt{R}}\,.\,^t\matt{P}
+\end{equation}
+
+The boundary conditions we want to write are relations of the type:
+\begin{equation}
+\comp{R}_{F,ij}=\sum_{k,l}\alpha_{ijkl}\comp{R}_{I',kl}
+\end{equation}
+We are then naturally brought to introduce the column matrices of the
+components of $\tens{R}$ in the different coordinate systems.
+
+We write
+\begin{equation}
+\mat{S}=\,^t[\comp{R}_{11},\comp{R}_{12},\comp{R}_{13},
+\comp{R}_{21},\comp{R}_{22},\comp{R}_{23},
+\comp{R}_{31},\comp{R}_{32},\comp{R}_{33}]
+\end{equation}
+and
+\begin{equation}
+\hat{\mat{S}}=\,^t[\hat{\comp{R}}_{11},\hat{\comp{R}}_{12},\hat{\comp{R}}_{13},
+\hat{\comp{R}}_{21},\hat{\comp{R}}_{22},\hat{\comp{R}}_{23},
+\hat{\comp{R}}_{31},\hat{\comp{R}}_{32},\hat{\comp{R}}_{33}]
+\end{equation}
+
+Two functions $q$ and $r$ from $\{1,2,3,4,5,6,7,8,9\}$ to
+$\{1,2,3\}$ are defined. Their values are given in the following table :
+\begin{center}
+\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
+\hline
+$i$&1&2&3&4&5&6&7&8&9\\
+\hline
+$q(i)$&1&1&1&2&2&2&3&3&3\\
+\hline
+$r(i)$&1&2&3&1&2&3&1&2&3\\
+\hline
+\end{tabular}
+\end{center}
+$i\longmapsto (q(i),r(i))$ is then a bijection from $\{1,2,3,4,5,6,7,8,9\}$
+to $\{1,2,3\}^2$, and we have :
+\begin{equation}
+\left\{\begin{array}{l}
+\comp{R}_{ij}=\comp{S}_{3(i-1)+j}\\
+\comp{S}_i=\comp{R}_{q(i)r(i)}
+\end{array}\right.
+\end{equation}
+
+Using equation \ref{Base_Clsyvt_eq_chgtrepR}, we thus have :
+\begin{eqnarray}
+\comp{S}_{F,i} & = & \comp{R}_{F,q(i)r(i)} =
+\sum_{(m,n)\in\{1,2,3\}^2}\comp{P}_{q(i)m}\hat{\comp{R}}_{F,mn}\comp{P}_{r(i)n}\nonumber\\
+&=&\sum_{j=1}^9\comp{P}_{q(i)q(j)}\hat{\comp{R}}_{F,q(j)r(j)}\comp{P}_{r(i)r(j)}
+\quad\text{(d'apr\`es la bijectivit\'e de $(q,r)$)}\nonumber\\
+&=&\sum_{j=1}^9\comp{P}_{q(i)q(j)}\comp{P}_{r(i)r(j)}\hat{\comp{S}}_{F,j}
+\end{eqnarray}
+
+Or
+\begin{equation}
+\mat{S}_{F}=\matt{A}\,.\,\hat{\mat{S}}_F\quad\text{avec }
+\comp{A}_{ij}=\comp{P}_{q(i)q(j)}\comp{P}_{r(i)r(j)}
+\end{equation}
+
+It can be shown that $\matt{A}$ is an orthogonal matrix (see Annexe A).
+
+
+In the local coordinate system, the boundary conditions of $\tens{R}$
+write naturally\footnote{cf. Davroux A., Archambeau F., {\em Le
+$R_{ij}-\varepsilon$ dans \CS (version $\beta$)}, HI-83/00/030/A}.
+\begin{equation}
+\label{Base_Clsyvt_eq_clRij}%
+\left\{\begin{array}{lll}
+\hat{\comp{R}}_{F,11}=\hat{\comp{R}}_{I',11} \qquad\qquad&
+\hat{\comp{R}}_{F,21}=0 \qquad\qquad&
+\hat{\comp{R}}_{F,31}=B\hat{\comp{R}}_{I',31} \\
+\hat{\comp{R}}_{F,12}=0 \qquad\qquad&
+\hat{\comp{R}}_{F,22}=\hat{\comp{R}}_{I',22} \qquad\qquad&
+\hat{\comp{R}}_{F,32}=0 \\
+\hat{\comp{R}}_{F,13}=B\hat{\comp{R}}_{I',13} \qquad\qquad&
+\hat{\comp{R}}_{F,23}=0 \qquad\qquad&
+\hat{\comp{R}}_{F,33}=\hat{\comp{R}}_{I',33}
+\end{array}\right.
+\end{equation}
+
+or
+\renewcommand{\arraystretch}{0.5}
+\begin{equation}
+\hat{\mat{S}}_F=\matt{B}\,.\,\hat{\mat{S}}_{I'}
+\qquad\text{avec }\matt{B}=
+\left[\begin{array}{ccccccccc}
+1&0&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&0\\
+0&0&\ddots&&&&&&\vdots\\
+\vdots&\ddots&B&\ddots&&&&&\vdots\\
+\vdots&&\ddots&0&\ddots&&&&\vdots\\
+\vdots&&&\ddots&1&\ddots&&&\vdots\\
+\vdots&&&&\ddots&0&\ddots&&\vdots\\
+\vdots&&&&&\ddots&B&\ddots&\vdots\\
+\vdots&&&&&&\ddots&0&0\\
+0&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots&0&1
+\end{array}\right]
+\end{equation}
+\renewcommand{\arraystretch}{1.}
+
+
+For the symmetry faces which are treated by \fort{clsyvt}, the
+coefficient $B$ is 1. However a similar treatment is applied in
+\fort{clptur} for the wall faces, and in this $B$ is zero. This
+parameter has to be specified when \fort{clca66} is called
+(see \S\ref{Base_Clsyvt_prg_meo}).
+
+Back in the global coordinate system, the following formulae is
+finally obtained~:
+\begin{equation}
+\label{Base_Clsyvt_eq_clsurS}
+\mat{S}_F=\matt{C}\,.\,\mat{S}_{I'}\qquad
+\text{avec }\matt{C}=\matt{A}\,.\,\matt{B}\,.\,^t\matt{A}
+\end{equation}
+
+It can be shown that the components of the matrix $\matt{C}$ are :
+\begin{equation}
+\comp{C}_{ij}=\sum_{k=1}^9
+\comp{P}_{q(i)q(k)}\comp{P}_{r(i)r(k)}\comp{P}_{q(j)q(k)}\comp{P}_{r(j)r(k)}
+(\delta_{k1}+B\delta_{k3}+\delta_{k5}+B\delta_{k7}+\delta_{k9})
+\end{equation}
+
+To conclude, it can be noted that, due to the symmetries of the tensor $\tens{R}$,
+ the matrix $\mat{S}$.
+Thus only the simplified matrices
+$\mat{S}^\prime$ and $\hat{\mat{S}}^\prime$ will be used:
+\begin{equation}
+\mat{S}^\prime=\,^t[\comp{R}_{11},\comp{R}_{22},\comp{R}_{33},
+\comp{R}_{12},\comp{R}_{13},\comp{R}_{23}]
+\end{equation}
+\begin{equation}
+\hat{\mat{S}}^\prime=\,^t[\hat{\comp{R}}_{11},\hat{\comp{R}}_{22},\hat{\comp{R}}_{33},
+\hat{\comp{R}}_{12},\hat{\comp{R}}_{13},\hat{\comp{R}}_{23}]
+\end{equation}
+
+By gathering different lines of matrix $\matt{C}$, equation
+\ref{Base_Clsyvt_eq_clsurS} is transformed into the final equation~:
+\begin{equation}
+\mat{S}_F^\prime=\matt{D}\,.\,\mat{S}_{I'}^\prime
+\end{equation}
+
+The computation of the matrix $\matt{D}$ is performed in the subroutine
+\fort{clca66}. The methodology is described in annexe B.
+
+From $\matt{D}$, the coefficients of the boundary conditions can be
+ partially implicited ($\var{ICLSYR}=1$) or totally explicited
+($\var{ICLSYR}=0$).
+
+$\bullet\ ${\sc Partial implicitation}\\
+\begin{equation}
+\label{Base_Clsyvt_eq_clRimp}
+{\comp{S}_{F,i}^\prime}^{(n+1)} =
+\underbrace{\comp{D}_{ii}}_{\var{COEFB}}{\comp{S}_{I',i}^\prime}^{(n+1)}
++\underbrace{\sum_{j\ne i}\comp{D}_{ij}{\comp{S}_{I',j}^\prime}^{(n)}}_{\var{COEFA}}
+\end{equation}
+
+$\bullet\ ${\sc Total explicitation}\\
+\begin{equation}
+\label{Base_Clsyvt_eq_clRexp}
+{\comp{S}_{F,i}^\prime}^{(n+1)} =
+\underbrace{\sum_j\comp{D}_{ij}{\comp{S}_{I',j}^\prime}^{(n)}}_{\var{COEFA}}
+\qquad(\var{COEFB}=0)
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Implementation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\label{Base_Clsyvt_prg_meo}%
+\etape{Beginning of the loop}
+
+Beginnning of the loop on all the boundary faces \var{IFAC} with
+symmetry conditions.
+A face is considered as a symmetry face if
+\var{ICODCL(IFAC,IU(IPHAS))} is 4. The tests in \fort{vericl} are designed
+ for \var{ICODCL} to be equal to 4 for \var{IU} if and only if it is equal
+to 4 for the other components of the velocity and for the components of $\tens{R}$
+(if necessary)\\.
+
+The value 0 is given to \var{ISYMPA}, which identifies the face as a
+wall or symmetry face (a face where the mass flux will be set to zero as
+explained in \fort{inimas}).
+
+\etape{Calculation of the basis vectors}
+The normal vector $\vect{n}$ is stored in \var{(RNX,RNY,RNZ)}.\\
+$\vect{u}_{I'}$ is calculated in \fort{CONDLI}, passed {\em via} \var{COEFU},
+and stored in \var{(UPX,UPY,UPZ)}.
+
+\etape{Case with $R_{ij}-\varepsilon$}
+With the $R_{ij}-\varepsilon$ model (\var{ITURB}=30 or 31), the vectors
+ $\vect{t}$ and $\vect{b}$ must be calculated explicitly
+(we use $\matt{P}$, not simply $\matt{A}$).
+The are stored in \var{(TX,TY,TZ)} and
+\var{(T2X,T2Y,T2Z)}, respectively.\\
+The transform matrix $\matt{P}$ is then calculated and stored in the array \var{ELOGLO}.\\
+The subroutine \fort{clca66} is then called to calculate the reduced
+matrix $\matt{D}$. It is stored in \var{ALPHA}. \fort{clca66} is called
+with a parameter \var{CLSYME} which is 1, and which corresponds to the parameter
+$\omega$ of equation \ref{Base_Clsyvt_eq_clRij}.
+
+
+\etape{Filling the arrays \var{COEFA} and \var{COEFB}}
+The arrays \var{COEFA} and \var{COEFB} are filled following directly
+equations \ref{Base_Clsyvt_eq_clU}, \ref{Base_Clsyvt_eq_clRimp} and \ref{Base_Clsyvt_eq_clRexp}.\\
+\var{RIJIPB(IFAC,.)} corresponds to the vector $\mat{S}_{I'}^\prime$, computed in
+\fort{condli}, and passed as an argument to \var{clsyvt}.
+
+\etape{Filling the arrays \var{COEFAF} and \var{COEFBF}}
+If they are defined, the arrays \var{COEFAF} and \var{COEFBF}
+are filled. They contain the same values as \var{COEFA} and
+\var{COEFB}, respectively.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Annexe A}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\minititre{Proof of the orthogonality of matrix $\matt{A}$}
+
+All the notations used in paragraphe 2 are kept. We have :
+\begin{eqnarray}
+(^t\matt{A}\,.\,\matt{A})_{ij}
+& = & \sum_{k=1}^9\comp{A}_{ki}\comp{A}_{kj}\nonumber\\
+& = & \sum_{k=1}^9
+\comp{P}_{q(k)q(i)}\comp{P}_{r(k)r(i)}\comp{P}_{q(k)q(j)}\comp{P}_{r(k)r(j)}
+\end{eqnarray}
+When $k$ varies from 1 to 3, $q(k)$ remains equal to 1 and $r(k)$ varies from 1
+to 3. We thus have :
+\begin{eqnarray}
+\sum_{k=1}^3
+\comp{P}_{q(k)q(i)}\comp{P}_{r(k)r(i)}\comp{P}_{q(k)q(j)}\comp{P}_{r(k)r(j)}
+&=&\comp{P}_{1q(i)}\comp{P}_{1q(j)}\sum_{k=1}^3
+\comp{P}_{r(k)r(i)}\comp{P}_{r(k)r(j)}\nonumber\\
+&=&\comp{P}_{1q(i)}\comp{P}_{1q(j)}\sum_{k=1}^3
+\comp{P}_{kr(i)}\comp{P}_{kr(j)}\\
+&=&\comp{P}_{1q(i)}\comp{P}_{1q(j)}\delta_{r(i)r(j)}\qquad\text{(by
+orthogonality of $\matt{P}$)}\nonumber
+\end{eqnarray}
+Likewise for $k$ varying from 4 to 6 or from 7 to 9, $q(k)$ being 2 or 3, respectively,
+ we obtain :
+\begin{eqnarray}
+(^t\matt{A}\,.\,\matt{A})_{ij}
+&=&
+\sum_{k=1}^9
+\comp{P}_{q(k)q(i)}\comp{P}_{r(k)r(i)}\comp{P}_{q(k)q(j)}\comp{P}_{r(k)r(j)}
+\nonumber\\
+&=&
+\sum_{k=1}^3\comp{P}_{kq(i)}\comp{P}_{kq(j)}\delta_{r(i)r(j)}\\
+&=&\delta_{q(i)q(j)}\delta_{r(i)r(j)}\nonumber\\
+&=&\delta_{ij}\qquad
+\text{(by the bijectivity of $(q,r)$)}\nonumber
+\end{eqnarray}
+
+Thus $^t\matt{A}\,.\,\matt{A}=\matt{Id}$. Similarly, it can be shown that
+$\matt{A}\,.\,^t\matt{A}=\matt{Id}$. Thus $\matt{A}$ is an orthogonal matrix.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Annexe B}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\minititre{Calculation of the matrix $\matt{D}$}
+
+The relation between the matrices of dimension $9\times1$
+of the components of $\tens{R}$ in the coordinate system $\mathcal{R}$ at $F$ and at $I'$
+(matrices $\mat{S}_F$ and $\mat{S}_{I'}$) :
+\begin{equation}
+\mat{S}_F=\matt{C}\,.\,\mat{S}_{I'}
+\end{equation}
+with
+\begin{equation}
+\comp{C}_{ij}=\sum_{k=1}^9
+\comp{P}_{q(i)q(k)}\comp{P}_{r(i)r(k)}\comp{P}_{q(j)q(k)}\comp{P}_{r(j)r(k)}
+(\delta_{k1}+\omega\delta_{k3}+\delta_{k5}+\omega\delta_{k7}+\delta_{k9})
+\end{equation}
+
+To transform $\mat{S}$ into the matrix $6\times 1$ $\mat{S}^\prime$,
+the function $s$ from $\{1,2,3,4,5,6,7,8,9\}$ to
+$\{1,2,3,4,5,6\}$ is defined. It takes the following values :
+\begin{center}
+\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
+\hline
+$i$&1&2&3&4&5&6&7&8&9\\
+\hline
+$s(i)$&1&4&5&4&2&6&5&6&3\\
+\hline
+\end{tabular}
+\end{center}
+By construction, we have $\comp{S}_i=\comp{S}^\prime_{s(i)}$ for all $i$ between 1
+and 9.
+
+To compute $\comp{D}_{ij}$, we can choose a value of $m$ to satisfy
+$s(m)=i$ and sum all the $\comp{C}_{mn}$ to have $s(n)=j$. The choice of $m$
+is irrelevent. We can also compute the sum over all $m$ so that $s(m)=i$ and then
+divide by the number of such values of $m$. We will use this method.
+
+We define $N(i)$ the number of integers between 1 and 9 so that $s(m)=i$.
+According to the preceeding, we thus have
+
+\begin{eqnarray}
+\comp{D}_{ij}&=&\frac{1}{N(i)}\sum_{s(m)=i \atop s(n)=j}\comp{C}_{mn}\nonumber\\
+&=&\frac{1}{N(i)}\sum_{{s(m)=i \atop s(n)=j}\atop 1\leqslant k\leqslant 9}
+\comp{P}_{q(m)q(k)}\comp{P}_{r(m)r(k)}\comp{P}_{q(n)q(k)}\comp{P}_{r(n)r(k)}
+(\delta_{k1}+\omega\delta_{k3}+\delta_{k5}+\omega\delta_{k7}+\delta_{k9})
+\end{eqnarray}
+
+\vspace{1cm}
+$\bullet\ ${\sc First case} : $i\leqslant 3$ and $j\leqslant 3$\\
+In this case, we have $N(i)=N(j)=1$. Additionally, if $s(m)=i$ and $s(n)=j$,
+then $q(m)=r(m)=i$ and $q(n)=r(n)=j$. Thus \\
+\begin{equation}
+\comp{D}_{ij}=\sum_{k=1}^9
+\comp{P}_{iq(k)}\comp{P}_{ir(k)}\comp{P}_{jq(k)}\comp{P}_{jr(k)}
+(\delta_{k1}+\omega\delta_{k3}+\delta_{k5}+\omega\delta_{k7}+\delta_{k9})
+\end{equation}
+When $k$ belongs to $\{1,5,9\}$, $q(k)=r(k)$ belongs to $\{1,2,3\}$. And for $k=3$ or
+$k=7$, $q(k)=1$ and $r(k)=3$, or the inverse (and for $k$ even the
+the sum of Kronecker symbol is zero). Finally we have :
+\begin{equation}
+\comp{D}_{ij}=\sum_{k=1}^3\comp{P}_{ik}^2\comp{P}_{jk}^2
++2\omega\comp{P}_{j1}\comp{P}_{i3}\comp{P}_{i1}\comp{P}_{j3}
+\end{equation}
+
+\vspace{1cm}
+$\bullet\ ${\sc Second case} : $i\leqslant 3$ and $j\geqslant 4$\\
+Again we have $N(i)=1$, and if $s(m)=i$ then $q(m)=r(m)=i$.\\
+On the contrary, we have $N(j)=2$, the two possibilities being $m_1$ and $m_2$.\\
+\begin{itemize}
+\item[-] if $j=4$, then $m_1=2$ and $m_2=4$,
+$q(m_1)=r(m_2)=1$ and $r(m_1)=q(m_2)=2$. We then have
+$m=1$ and $n=2$.
+
+\item[-] if $j=5$, then $m_1=3$ and $m_2=7$,
+$q(m_1)=r(m_2)=1$ and $r(m_1)=q(m_2)=3$. We then have
+$m=1$ and $n=3$.
+
+\item[-] if $j=6$, then $m_1=6$ and $m_2=8$,
+$q(m_1)=r(m_2)=2$ and $r(m_1)=q(m_2)=3$. We then have
+$m=2$ and $n=3$.
+\end{itemize}
+
+And we have :
+\begin{equation}
+\comp{D}_{ij}=\sum_{k=1}^9
+\comp{P}_{iq(k)}\comp{P}_{ir(k)}\left[
+\comp{P}_{mq(k)}\comp{P}_{nr(k)}+\comp{P}_{nq(k)}\comp{P}_{mr(k)}\right]
+(\delta_{k1}+\omega\delta_{k3}+\delta_{k5}+\omega\delta_{k7}+\delta_{k9})
+\end{equation}
+
+But when $k$ is in $\{1,5,9\}$, $q(k)=r(k)$ is in $\{1,2,3\}$. Thus :
+\begin{equation}
+\comp{D}_{ij}=2\sum_{k=1}^3
+\comp{P}_{ik}^2\comp{P}_{mk}\comp{P}_{nk}
++\omega\sum_{k=1}^9
+\comp{P}_{iq(k)}\comp{P}_{ir(k)}\left[
+\comp{P}_{mq(k)}\comp{P}_{nr(k)}+\comp{P}_{nq(k)}\comp{P}_{mr(k)}\right]
+(\delta_{k3}+\delta_{k7})
+\end{equation}
+
+And for $k=3$ or $k=7$, $q(k)=1$ and $r(k)=3$, or the opposite. We finally have :
+\begin{equation}
+\comp{D}_{ij}=2\left[\sum_{k=1}^3
+\comp{P}_{ik}^2\comp{P}_{mk}\comp{P}_{nk}
++\omega\comp{P}_{i1}\comp{P}_{i3}\left(
+\comp{P}_{m1}\comp{P}_{n3}+\comp{P}_{n1}\comp{P}_{m3}\right)
+\right]
+\end{equation}
+with $(m,n)=(1,2)$ if $j=4$, $(m,n)=(1,3)$ if $j=5$ and $(m,n)=(2,3)$ if
+$j=6$.
+
+\vspace{1cm}
+$\bullet\ ${\sc Third case} : $i\geqslant 4$ and $j\leqslant 3$\\
+By symmetry of $\matt{C}$, we obtain a result which is the symmetric of
+the second case, except that $N(i)$ is now 2. Thus :
+\begin{equation}
+\comp{D}_{ij}=\sum_{k=1}^3
+\comp{P}_{jk}^2\comp{P}_{mk}\comp{P}_{nk}
++\omega\comp{P}_{j1}\comp{P}_{j3}\left(
+\comp{P}_{m1}\comp{P}_{n3}+\comp{P}_{n1}\comp{P}_{m3}\right)
+\end{equation}
+with $(m,n)=(1,2)$ if $i=4$, $(m,n)=(1,3)$ if $i=5$ and $(m,n)=(2,3)$ if
+$i=6$.
+
+\vspace{1cm}
+$\bullet\ ${\sc Fourth case} : $i\geqslant 4$ and $j\geqslant 4$\\
+Then $N(i)=N(j)=2$.\\
+We have $(m,n)=(1,2)$ if $i=4$, $(m,n)=(1,3)$ if $i=5$ and
+$(m,n)=(2,3)$ if $i=6$. Likewise we define $m^\prime$ and
+$n^\prime$ as a function of $j$. We then obtain :
+\begin{eqnarray}
+\comp{D}_{ij}&=&\frac{1}{2}\sum_{k=1}^9
+\left(\comp{P}_{mq(k)}\comp{P}_{nr(k)}+\comp{P}_{nq(k)}\comp{P}_{mr(k)}\right)
+\left(\comp{P}_{m^\prime q(k)}\comp{P}_{n^\prime r(k)}
++\comp{P}_{n^\prime q(k)}\comp{P}_{m^\prime r(k)}\right)\nonumber\\
+&&\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\times
+(\delta_{k1}+\omega\delta_{k3}+\delta_{k5}+\omega\delta_{k7}+\delta_{k9})\nonumber\\
+&=&\frac{1}{2}\left[
+\sum_{k=1}^3 4\comp{P}_{mk}\comp{P}_{nk}
+\comp{P}_{m^\prime k}\comp{P}_{n^\prime k}
++2\omega\left(\comp{P}_{m1}\comp{P}_{n3}+\comp{P}_{n1}\comp{P}_{m3}\right)
+\left(\comp{P}_{m^\prime 1}\comp{P}_{n^\prime 3}
++\comp{P}_{n^\prime 1}\comp{P}_{m^\prime 3}\right)\right]
+\end{eqnarray}
+
+and finally :
+\begin{equation}
+\comp{D}_{ij}=
+2\sum_{k=1}^3 \comp{P}_{mk}\comp{P}_{nk}
+\comp{P}_{m^\prime k}\comp{P}_{n^\prime k}
++\omega\left(\comp{P}_{m1}\comp{P}_{n3}+\comp{P}_{n1}\comp{P}_{m3}\right)
+\left(\comp{P}_{m^\prime 1}\comp{P}_{n^\prime 3}
++\comp{P}_{n^\prime 1}\comp{P}_{m^\prime 3}\right)
+\end{equation}
+with $(m,n)=(1,2)$ if $i=4$, $(m,n)=(1,3)$ if $i=5$ and $(m,n)=(2,3)$ if
+$i=6$\\
+and $(m^\prime ,n^\prime )=(1,2)$ if $j=4$, $(m^\prime ,n^\prime )=(1,3)$
+if $j=5$ and $(m^\prime ,n^\prime )=(2,3)$ if $j=6$.
+
+
diff --git a/doc/theory/codits.tex b/doc/theory/codits.tex
new file mode 100644
index 0000000..f41b127
--- /dev/null
+++ b/doc/theory/codits.tex
@@ -0,0 +1,391 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{codits}
+%
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Ce sous-programme, appel� entre autre par \fort{preduv}, \fort{turbke}, \fort{covofi},
+\fort{resrij}, \fort{reseps}, ..., r�sout les �quations de convection-diffusion
+d'un scalaire $a$ avec termes sources du type :
+\begin{equation}\label{Base_Codits_eq_ref}
+\begin{array}{c}
+\displaystyle f_s^{\,imp} (a^{n+1} - a^{n}) +
+\theta \ \underbrace{\dive((\rho \underline{u})\,a^{n+1})}_{\text{convection implicite}}
+-\theta \ \underbrace{\dive(\mu_{\,tot}\,\grad a^{n+1})}_{\text{diffusion implicite}}
+\\\\
+= f_s^{\,exp}-(1-\theta) \ \underbrace{\dive((\rho \underline{u})\,a^{n})}_{\text{convection explicite}}
+ + (1-\theta) \ \underbrace{\dive(\mu_{\,tot}\,\grad a^{n})}_{\text{diffusion explicite}}
+\end{array}
+\end{equation}
+o� $\rho \underline{u}$, $f_s^{exp}$ et $f_s^{imp}$ d�signent respectivement le flux de masse, les termes sources explicites et les termes lin�aris�s en $a^{n+1}$.
+$a$ est un scalaire d�fini sur toutes les cellules\footnote{$a$, sous forme discr\`ete en espace, correspond \`a un vecteur dimensionn\'e \`a \var{NCELET} de composante $a_I$, I d\'ecrivant l'ensemble des cellules.}.
+Par souci de clart� on suppose, en l'absence d'indication, les propri�tes
+physiques $\Phi$ (viscosit� totale $\mu_{tot}$,...) et le flux de masse $(\rho
+\underline{u})$ pris respectivement aux instants $n+\theta_\Phi$ et
+$n+\theta_F$, o� $\theta_\Phi$ et $\theta_F$ d�pendent des sch�mas en temps
+sp�cifiquement utilis�s pour ces grandeurs\footnote{cf. \fort{introd}}.
+\\
+L'�criture des termes de convection et diffusion en maillage non orthogonal
+engendre des difficult�s (termes de reconstruction et test de pente) qui sont
+contourn�es en utilisant une m\'ethode it\'erative dont la limite, si elle
+existe, est la solution de l'�quation pr�c�dente.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Afin d'expliquer la proc�dure utilis�e pour traiter les difficult�s dues aux
+termes de reconstruction et de test de pente dans les termes de
+convection-diffusion, on note, de fa\c con analogue \`a ce qui est d\'efini dans
+\fort{navsto} mais sans discr\'etisation spatiale associ\'ee, $\mathcal{E}_{n}$ l'op\'erateur :
+\begin{equation}\label{Base_Codits_Eq_ref_small}
+\begin{array}{c}
+\mathcal{E}_{n}(a) = f_s^{\,imp}\,a + \theta\,\, \dive((\rho
+\underline{u})\,a) - \theta\,\, \dive(\mu_{\,tot}\,\grad a)\\
+- f_s^{\,exp} - f_s^{\,imp}\,a^{n} +(1-\theta)\,\,\dive((\rho
+\underline{u})\, a^n) - (1-\theta)\,\, \dive(\mu_{\,tot}\,\grad a^n)
+\end{array}
+\end{equation}
+L'\'equation (\ref{Base_Codits_eq_ref}) s'\'ecrit donc :
+\begin{equation}
+\mathcal{E}_{n}(a^{n+1}) = 0
+\end{equation}
+La quantit\'e $\mathcal{E}_{n}(a^{n+1})$ comprend donc :\\
+\hspace*{1.cm} $\rightsquigarrow$ $f_s^{\,imp}\,a^{n+1}$, contribution des
+termes diff\'erentiels d'ordre $0$ lin\'eaire en $a^{n+1}$,\\
+\hspace*{1.cm} $\rightsquigarrow$ $\theta\,\,
+\dive((\rho\underline{u})\,a^{n+1})
+- \theta\,\, \dive(\mu_{\,tot}\,\grad a^{n+1})$, termes de convection-diffusion
+implicites complets (termes non reconstruits + termes de reconstruction)
+lin\'eaires\footnote{Lors de la discr�tisation en espace, le caract�re lin�aire
+de ces termes pourra cependant �tre perdu, notamment � cause du test de pente.}
+en $a^{n+1}$,\\
+\hspace*{1.cm} $\rightsquigarrow$ $f_s^{\,exp}- f_s^{\,imp}\,a^n$ et
+$(1-\theta)\,\,\dive((\rho
+\underline{u})\,a^n) - (1-\theta)\,\, \dive(\mu_{\,tot}\,\grad a^n)$ l'ensemble
+des termes explicites (y compris la partie explicite provenant du sch\'ema en
+temps appliqu\'e \`a la convection diffusion).\\\\
+
+De m\^eme, on introduit un op\'erateur $\mathcal{EM}_{n}$ approch\'e de
+$\mathcal{E}_{n}$, lin\'eaire et simplement inversible, tel que son
+expression contient :\\
+\hspace*{1.cm}$\rightsquigarrow$ la prise en compte des termes lin\'eaires en $a$,\\
+\hspace*{1.cm}$\rightsquigarrow$ la convection int�gr�e par un sch�ma d�centr� amont
+(upwind) du premier ordre en espace,\\
+\hspace*{1.cm}$\rightsquigarrow$ les flux diffusifs non reconstruits.\\
+\begin{equation}
+\mathcal{EM}_{n}(a) = f_s^{\,imp}\,a + \theta\,\,[\dive((\rho
+\underline{u})\,a)]^{\textit{amont}} - \theta\,\, [\dive(\mu_{\,tot}\,\grad a)]^{\textit{N Rec}}
+\end{equation}
+Cet op\'erateur permet donc de contourner la difficult\'e induite par la pr\'esence d'\'eventuelles non lin\'earit\'es introduites par l'activation du test de pente lors du sch\'ema convectif, et par le remplissage important de la structure de la matrice d\'ecoulant de la pr\'esence des gradients propres \`a la reconstruction.\\
+On a la relation\footnote{On pourra se reporter au sous-programme
+\fort{matrix} pour plus de d\'etails relativement \`a
+$\mathcal{EM_{\it{disc}}}$, op\'erateur discret agissant sur un scalaire $a$.}, pour toute cellule $\Omega_I$ de centre $I$ :
+\begin{equation}\notag
+\mathcal{EM_{\it{disc}}}(a,I) = \int_{\Omega_i}\mathcal{EM}_{n}(a) \, d\Omega
+\end{equation}
+On cherche � r�soudre :
+\begin{equation}
+0 =\mathcal{E}_{n}(a^{n+1}) = \mathcal{EM}_{n}(a^{n+1}) + \mathcal{E}_{n}(a^{n+1}) - \mathcal{EM}_{n}(a^{n+1})
+\end{equation}
+Soit :
+\begin{equation}
+\mathcal{EM}_{n}(a^{n+1}) = \mathcal{EM}_{n}(a^{n+1}) - \mathcal{E}_{n}(a^{n+1})
+\end{equation}
+On va pour cela utiliser un algorithme de type point fixe en d�finissant la
+suite $(a^{n+1,\,k})_{k\in \grandN}$\footnote{Dans le cas ou le point fixe en
+vitesse-pression est utilis� (\var{NTERUP}$>$ 1) $a^{n+1,0}$ est initialis� par
+la derni�re valeur obtenue de $a^{n+1}$.}:
+\begin{equation}\notag
+\left\{\begin{array}{l}
+a^{n+1,\,0} = a^{n}\\
+a^{n+1,\,k+1} = a^{n+1,\,k} + \delta a^{n+1,\,k+1}
+\end{array}\right.
+\end{equation}
+o� $\delta a^{n+1,\,k+1}$ est solution de :
+\begin{equation}
+\mathcal{EM}_{n}(a^{n+1,\,k} + \delta a^{n+1,\,k+1}) = \mathcal{EM}_{n}(a^{n+1,\,k}) - \mathcal{E}_{n}(a^{n+1,\,k})
+\end{equation}
+Soit encore, par lin�arit� de $\mathcal{EM}_{n}$ :
+\begin{equation}
+\mathcal{EM}_{n}(\delta a^{n+1,\,k+1}) = - \mathcal{E}_{n}(a^{n+1,\,k})
+\label{Base_Codits_Eq_Codits}
+\end{equation}
+
+Cette suite, coupl\'ee avec le choix de l'op\'erateur $\mathcal{E}_{n}$, permet donc de lever la difficult� induite par la
+pr\'esence de la convection (discr\'etis\'ee \`a l'aide de sch\'emas num\'eriques
+qui peuvent introduire des non lin\'earit\'es) et les termes de
+reconstruction. Le sch\'ema r\'eellement choisi par l'utilisateur pour la
+convection (donc \'eventuellement non lin\'eaire si le test de pente est activ\'e) ainsi que les termes de
+reconstruction vont \^etre pris \`a l'it�ration $k$ et trait\'es au second membre {\it via} le sous-programme \fort{bilsc2}, alors que les termes
+non reconstruits sont pris � l'it�ration $k+1$ et repr\'esentent donc les
+inconnues du syst\`eme lin\'eaire r\'esolu par \fort{codits}\footnote{cf. le sous-programme
+\fort{navsto}.}.\\
+
+On suppose de plus que cette suite $(a^{n+1,\,k})_k$ converge vers la solution
+$a^{n+1}$ de l'\'equation (\ref{Base_Codits_Eq_ref_small}), {\it i.e.}
+$\lim\limits_{k\rightarrow\infty} \delta a^{n+1,\,k}\,=\,0$, ceci pour tout $n$ donn\'e.\\
+(\ref{Base_Codits_Eq_Codits}) correspond \`a l'\'equation r\'esolue par \fort{codits}. La
+matrice $\tens{EM}_{\,n}$, matrice associ\'ee \`a $\mathcal{EM}_{n}$ est
+ \`a inverser, les termes non lin\'eaires sont mis au second membre mais sous forme
+ explicite (indice $k$ de $a^{n+1,\,k}$) et ne posent donc plus de probl\`eme.
+
+\minititre{Remarque 1}
+La viscosit� $\mu_{\,tot}$ prise dans $\mathcal{EM}_{n}$ et dans
+$\mathcal{E}_{n}$ d�pend du mod�le de turbulence utilis�. Ainsi on a
+ $\mu_{\,tot}=\mu_{\,laminaire} + \mu_{\,turbulent}$
+dans $\mathcal{EM}_{n}$ et dans $\mathcal{E}_{n}$ sauf lorsque l'on
+utilise un mod�le $R_{ij}-\varepsilon$, auquel cas on a
+$\mu_{\,tot}=\mu_{\,laminaire}$.\\
+Le choix de $\mathcal{EM}_{n}$ �tant {\it a
+priori} arbitraire ($\mathcal{EM}_{n}$ doit \^etre lin\'eaire et la suite
+ $(a^{n+1,\,k})_{k\in\grandN}$ doit converger pour tout $n$ donn\'e), une option des mod�les
+$R_{ij}-\varepsilon$ ($\var{IRIJNU}=1$) consiste \`a for\c cer $\mu_{\,tot}^n$
+dans l'expression de $\mathcal{EM}_{n}$ \`a la
+valeur $\mu_{\,laminaire}^n + \mu_{\,turbulent}^n$ lors de l'appel \`a
+\fort{codits} dans le sous-programme \fort{navsto}, pour l'\'etape de
+pr\'ediction de la vitesse. Ceci n'a pas de sens
+physique (seul $\mu_{\,laminaire}^n$ �tant cens� intervenir), mais cela peut
+dans certains cas avoir un effet stabilisateur, sans que cela modifie pour
+autant les valeurs de la limite de la suite $(a^{n+1,\,k})_k$.\\
+
+\minititre{Remarque 2}
+Quand \fort{codits} est utilis\'e pour le couplage instationnaire renforc�
+vitesse-pression (\var{IPUCOU}=1), on fait une seule it�ration $k$ en initialisant la suite $(a^{n+1,\,k})_{k\in\grandN}$ � z�ro. Les conditions de type Dirichlet sont
+annul�es (on a $\var{INC}\,=\,0$) et le second membre est �gal � $\rho |\Omega_i|$.
+Ce qui permet d'obtenir une approximation de type diagonal de
+$\tens{EM}_{n}$
+n\'ecessaire lors de l'�tape de correction de la vitesse\footnote{cf. le sous-programme \fort{resolp}.}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+L'algorithme de ce sous-programme est le suivant :\\
+- d�termination des propri�t�s de la matrice $\tens{EM}_{n}$ (sym\'etrique
+si pas de convection, non sym\'etrique sinon)\\
+- choix automatique de la m�thode de r�solution pour l'inverser si l'utilisateur
+ne l'a pas sp\'ecifi\'e pour la variable trait\'ee. La m\'ethode de Jacobi est utilis\'ee par d\'efaut pour toute variable scalaire $a$ convect\'ee. Les m\'ethodes
+disponibles sont la m\'ethode du gradient conjugu\'e, celle de Jacobi, et le
+bi-gradient conjugu\'e stabilis\'e ($BICGStab$) pour les matrices non
+sym\'etriques. Un pr\'econditionnement diagonal est possible et utilis\'e par
+d\'efaut pour tous ces solveurs except� Jacobi.\\
+- prise en compte de la p\'eriodicit\'e (translation ou rotation d'un scalaire, vecteur ou tenseur),\\
+- construction de la matrice $\tens{EM}_{n}$ correspondant � l'op\'erateur
+lin\'eaire $\mathcal{EM}_{n}$ par appel au sous-programme
+\fort{matrix}\footnote{ On rappelle que dans \fort{matrix}, la convection est
+trait�e, quelque soit le choix de l'utilisateur, avec un sch�ma d�centr� amont d'ordre 1 en espace et qu'il n'y a pas de reconstruction
+pour la diffusion. Le choix de l'utilisateur quant au
+sch�ma num�rique pour la convection intervient uniquement lors de l'int�gration
+des termes de convection de $\mathcal{E}_{n}$, au second membre de
+(\ref{Base_Codits_Eq_Codits}) dans le sous-programme \fort{bilsc2}.}. Les termes implicites correspondant �
+la partie diagonale de la matrice et donc aux contributions diff\'erentielles
+d'ordre $0$ lin\'eaires en $a^{n+1}$,({\it i.e} $f_s^{imp}$), sont stock�s dans le tableau \var{ROVSDT} (r\'ealis\'e en amont du sous-programme appelant \fort{codits}).\\
+- cr�ation de la hi�rarchie de maillage si on utilise le multigrille
+($ \var{IMGRP}\,>0 $).\\
+- appel � \fort{bilsc2} pour une �ventuelle prise en compte de la
+convection-diffusion explicite lorsque $\theta \ne 0$.\\
+- boucle sur le nombre d'it�rations de 1 \`a $\var{NSWRSM}$ (appel� $\var{NSWRSP}$ dans \fort{codits}).
+ Les it�rations sont repr�sent�es par $k$ appel�
+\var{ISWEEP} dans le code et d\'efinissent les indices de la suite $(a^{n+1,\,k})_k$
+et de $(\delta a^{n+1,\,k})_k$.\\
+Le second membre est scind\'e en deux parties :\\
+\hspace*{1cm}{\tiny$\blacksquare$}\ un terme, affine
+en $a^{n+1,\,k-1}$, facile \`a mettre \`a jour dans le cadre de la r\'esolution
+par incr\'ement, et qui s'\'ecrit :
+\begin{equation}\notag
+ -f_s^{\,imp} \left(\,a^{n+1,\,k-1} - a^{n+1,0}\right) + f_s^{\,exp}- (1-\theta)\,\left[\,\dive((\rho \underline{u})\,a^{n+1,0}) - \dive(\mu_{\,tot}\,\grad a^{n+1,0})\,\right]\\
+\end{equation}
+\\
+\hspace*{1cm}{\tiny$\blacksquare$}\ les termes issus de la
+convection/diffusion (avec reconstruction) calcul�e par \fort{bilsc2}.\\
+\begin{equation}\notag
+- \theta\,\left[\,\dive\left((\rho \underline{u})\,a^{n+1,\,k-1}\right)- \dive\left(\mu_{\,tot}\,\grad a^{n+1,\,k-1}\right)\right]
+\end{equation}
+
+La boucle en $k$ est alors la suivante :
+\begin{itemize}
+\item Calcul du second membre, hors contribution des termes de
+convection-diffusion explicite $\var{SMBINI}$; le second membre complet correspondant
+\`a $\mathcal{E}_{n}(a^{n+1,\,k-1})$ est, quant \`a lui, stock\'e dans le
+tableau $\var{SMBRP}$, initialis\'e par $\var{SMBINI}$ et compl\'et\'e par les
+termes reconstruits de convection-diffusion par appel au sous-programme
+\fort{bilsc2}.\\
+\`A l'it\'eration $k$, $\var{SMBINI}$ not\'e $\var{SMBINI}^{\,k}$ vaut :\\
+\begin{equation}\notag
+\var{SMBINI}^{\,k}\ = f_s^{\,exp}-(1-\theta)\,\left[\,\dive((\rho \underline{u})\,a^n) - \dive(\mu_{\,tot}\,\grad a^n)\,\right]-\,f_s^{\,imp}(\,a^{n+1,\,k-1} - a^n\,) \\
+\end{equation}
+\\
+$\bullet$ Avant de boucler sur $k$,un premier appel au sous-programme \fort{bilsc2} avec $\var{THETAP}=1-\theta$ permet de prendre
+en compte la partie explicite des termes de convection-diffusion provenant du sch\'ema en temps.
+\begin{equation}\notag
+\displaystyle
+\var{SMBRP}^{\,0} = f_s^{\,exp} -(1-\theta)\,[\,\dive((\rho \underline{u})\,a^n) - \dive(\mu_{\,tot}\,\grad a^n)\,]\\
+\end{equation}
+Avant de boucler sur $k$, le second membre $\var{SMBRP}^{\,0}$ est stock\'e dans le tableau $\var{SMBINI}^{\,0}$ et sert pour l'initialisation du reste du calcul.
+\begin{equation}\notag
+\var{SMBINI}^{\,0} =\var{SMBRP}^{\,0}
+\end{equation}
+\\
+$\bullet$ pour $k = 1$,
+\begin{equation}\notag
+\begin{array}{ll}
+\var{SMBINI}^{\,1}\ &=f_s^{\,exp}-(1-\theta)\,\left[\,\dive((\rho \underline{u})\,a^n) - \dive(\mu_{\,tot}\,\grad a^n)\,\right]-\,f_s^{\,imp}\,(\,a^{n+1,\,0} - a^n\,)\\
+&=f_s^{\,exp}- (1-\theta)\,\left[\,\dive((\rho \underline{u})\,a^{n+1,\,0}) - \dive(\mu_{\,tot}\,\grad a^{n+1,\,0})\,\right]-f_s^{\,imp}\,\delta a^{n+1,\,0} \\
+\end{array}
+\end{equation}
+On a donc :
+\begin{equation}\notag
+\var{SMBINI}^{\,1}\ =\ \var{SMBINI}^{\,0} - \var{ROVSDT}\,*(\,\var{PVAR}-\,\var{PVARA})
+\end{equation}
+et $\var{SMBRP}^{\,1}$ est compl\'et\'e par un second appel au sous-programme \fort{bilsc2} avec $\var{THETAP}=\theta$, de mani\`ere \`a ajouter dans le second membre la partie de la convection-diffusion implicite.
+\begin{equation}\notag
+\begin{array}{ll}
+\var{SMBRP}^{\,1} & = \var{SMBINI}^{\,1} -\theta\,\left[\,\dive((\rho \underline{u})\,a^{n+1,\,0}) - \dive(\mu_{\,tot}\,\grad a^{n+1,\,0})\,\right]\\
+& = f_s^{\,exp}\ - (1-\theta)\,\left[\,\dive((\rho \underline{u})\,a^{n}) - \dive(\mu_{\,tot}\,\grad a^{n})\,\right]- f_s^{\,imp}\,(a^{n+1,\,0} -a^{n}) \\
+& -\theta\,\left[\,\dive((\rho \underline{u})\,a^{n+1,\,0}) - \dive(\mu_{\,tot}\,\grad a^{n+1,\,0})\,\right]\\
+\end{array}
+\end{equation}
+$\bullet$ pour $k = 2$,\\
+de fa\c con analogue, on obtient :
+\begin{equation}\notag
+\begin{array}{ll}
+\var{SMBINI}^{\,2}\ &=f_s^{\,exp}-(1-\theta)\,\left[\,\dive((\rho \underline{u})\,a^n) - \dive(\mu_{\,tot}\,\grad a^n)\,\right]-\,f_s^{\,imp}\,(\,a^{n+1,\,1} - a^n\,)\\
+\end{array}
+\end{equation}
+Soit :
+\begin{equation}\notag
+\var{SMBINI}^{\,2}\ =\ \var{SMBINI}^{\,1} - \var{ROVSDT}\,*\,\var{DPVAR}^{\,1}
+\end{equation}
+l'appel au sous-programme \fort{bilsc2}, \'etant syst\'ematiquement fait par la suite avec $\var{THETAP}=\theta$, on obtient de m\^eme :
+\begin{equation}\notag
+\begin{array}{ll}
+\var{SMBRP}^{\,2}\ &=\ \var{SMBINI}^{\,2}-\theta\left[\dive\left((\rho \underline{u})\,a^{n+1,\,1}\right)- \dive\left(\mu_{\,tot}\,\grad \,a^{n+1,\,1}\right)\right]\\
+\end{array}
+\end{equation}
+o\`u
+\begin{equation}\notag
+a^{n+1,\,1}=\var{PVAR}^{\,1}=\var{PVAR}^{\,0}+\var{DPVAR}^{\,1}=a^{n+1,\,0}+\delta a^{n+1,\,1}
+\end{equation}
+$\bullet$ pour l'it\'eration $k+1$,\\
+Le tableau $\var{SMBINI}^{\,k+1}$ initialise le second membre complet
+$\var{SMBRP}^{\,k+1}$ auquel vont \^etre rajout\'ees les contributions
+convectives et diffusives {\it via} le sous-programme \fort{bilsc2}.\\
+on a la formule :
+\begin{equation}\notag
+\begin{array}{ll}
+\var{SMBINI}^{\,k+1}\ &= \var{SMBINI}^{\,k} - \var{ROVSDT}\,*\,\var{DPVAR}^{\,k}\\
+\end{array}
+\end{equation}
+Puis suit le calcul et l'ajout des termes de convection-diffusion reconstruits de $-\ \mathcal{E}_{n}(a^{n+1,\,k})$, par appel au sous-programme
+\fort{bilsc2}. On rappelle que la convection est prise en compte � cette �tape
+par le sch�ma num�rique choisi par l'utilisateur (sch�ma d�centr� amont du
+premier ordre en espace, sch�ma centr� du second ordre en espace, sch�ma
+d�centr� amont du second ordre S.O.L.U. ou une
+pond�ration (blending) des sch�mas dits du second ordre (centr� ou S.O.L.U.) avec le sch�ma
+amont du premier ordre, utilisation \'eventuelle d'un test de pente).\\
+Cette contribution (convection-diffusion) est alors
+ajout�e dans le second membre $\var{SMBRP}^{\,k+1}$ (initialis\'e par $\var{SMBINI}^{\,k+1}$).
+\begin{equation}\notag
+\begin{array}{ll}
+\var{SMBRP}^{\,k+1}\ &= \var{SMBINI}^{\,k+1} - \theta\,\left[\,\dive\left((\rho \underline{u})\,a^{n+1,\,k}\right)- \dive\left(\mu_{\,tot}\,\grad a^{n+1,\,k}\right)\right]\\
+& = f_s^{\,exp}-(1-\theta)\,\left[\,\dive((\rho \underline{u})\,a^n) - \dive(\mu_{\,tot}\,\grad a^n)\,\right]- f_s^{\,imp}\,(a^{n+1,\,k} -a^{n}) \\
+&-\theta\,\left[\,\dive((\rho \underline{u})\,a^{n+1,k}) - \dive(\mu_{\,tot}\,\grad a^{n+1,k})\,\right]\\
+\end{array}
+\end{equation}
+
+\item R\'esolution du syst�me lin�aire en $\delta a^{n+1,\,k+1}$ correspondant
+\`a l'\'equation (\ref{Base_Codits_Eq_Codits}) par inversion de la matrice
+$\tens{EM}_{n}$, en appelant le sous programme \fort{invers}.
+On calcule $a^{n+1,\,k+1}$ gr\^ace \`a la formule :
+\begin{equation}\notag
+a^{n+1,\,k+1} = a^{n+1,\,k} + \delta a^{n+1,\,k+1}
+\end{equation}
+Soit :
+\begin{equation}\notag
+\var{PVAR}^{\,k+1} = \var{PVAR}^{\,k} + \var{DPVAR}^{\,k+1}
+\end{equation}
+
+\item Traitement de la p\'eriodicit\'e et du parall�lisme.
+\item Test de convergence :\\
+Il porte sur la quantit\'e $||\var{SMBRP}^{\,k+1}|| < \varepsilon
+||\tens{EM}_{n}(a^{n}) + \var{SMBRP}^{\,1}|| $, o\`u $||\,.\,||$ repr\'esente la
+norme euclidienne.
+Si le test est v\'erifi\'e, la convergence est atteinte et on sort de la
+boucle sur les it�rations. La solution recherch�e est $a^{\,n+1} = a^{n+1,\,k+1}$.\\
+Sinon, on continue d'it\'erer dans la limite des it�rations impos�es par $\var{NSWRSM}$ dans \fort{usini1}.\\
+En ``continu'' ce test de convergence s'�crit aussi :
+\begin{equation}\notag
+\begin{array}{ll}
+||\var{SMBRP}^{\,k+1}||& < \varepsilon ||f_s^{\,exp}\ - \dive((\rho \underline{u})\,a^{n}) + \dive(\mu_{\,tot}\,\grad a^{n}) \\
+& +[\dive((\rho \underline{u})\,a^{n})]^{\textit{amont}} + [\dive(\mu_{\,tot}\,\grad a^{n})]^{\textit{N Rec}}||\\
+\end{array}
+\end{equation}
+Si bien que sur maillage orthogonal avec sch�ma de convection upwind et en l'absence de terme source, la suite converge en th�orie en une unique it�ration puisque par construction~:
+\begin{equation}\notag
+\begin{array}{ll}
+||\var{SMBRP}^{\,2}||=\,0\,& < \varepsilon ||f_s^{\,exp}||
+\end{array}
+\end{equation}
+\end{itemize}
+Fin de la boucle.
+\\
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}\label{Base_Codits_section4}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Approximation $\mathcal{EM}_{n}$ de l'op\'erateur
+$\mathcal{E}_{n}$}
+D'autres approches visant soit \`a modifier la d\'efinition de l'approxim\'ee, prise en compte du sch\'ema centr\'e sans reconstruction par exemple,
+soit \`a abandonner cette voie seraient \`a \'etudier.\\
+
+\etape{Test de convergence}
+La quantit\'e d\'efinissant le test de convergence est �galement � revoir, �ventuellement � simplifier.
+
+\etape{Prise en compte de $T_s^{imp}$}
+Lors de la r�solution de l'�quation par \fort{codits}, le tableau \var{ROVSDT} a
+deux fonctions : il sert � calculer la diagonale de la matrice (par appel de
+\fort{matrix}) et il sert � mettre � jour le second membre � chaque
+sous-it�ration de la r�solution en incr�ments. Or, dans le cas o� $T_s^{imp}$
+est positif, on ne l'int�gre pas dans \var{ROVSDT}, afin de ne pas affaiblir la
+diagonale de la matrice. De ce fait, on ne l'utilise pas pour mettre � jour le
+second membre, alors que ce serait tout � fait possible. Au final, on obtient
+donc un terme source trait� totalement en explicite ($T_s^{exp}+T_s^{imp}a^n$),
+alors que la r�solution en incr�ments nous permettrait justement de l'impliciter
+quasiment totalement ($T_s^{exp}+T_s^{imp}a^{n+1,k_{fin}-1}$, o� $k_{fin}$ est
+la derni�re sous-it�ration effectu�e).\\
+Pour ce faire, il faudrait d�finir deux tableaux \var{ROVSDT} dans \fort{codits}.
diff --git a/doc/theory/combustion.tex b/doc/theory/combustion.tex
new file mode 100644
index 0000000..903cb0f
--- /dev/null
+++ b/doc/theory/combustion.tex
@@ -0,0 +1,196 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{co**, cp**, fu** and so ... d3p*, ebu*, lwc*, pdf*}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+From a CFD point of vue combustion is a (somestimes very) complicated
+way to determine $\rho$. Models needs few extra fields of scalar with
+regular transport equation, somes of them with a reactive or
+interfacial source term.
+
+Modeling of combustion is able to deal with gaz phase combustion
+(diffusion, premix, partial premix), and with solid or liquid fuels.
+
+Combustion of condensed fuels involves one-way interfacial flux due to
+phenomenon in the condensed phase (evaporation or pyrolisis) and
+reciprocal ones (heterogeneous combustion). Many of the species
+injected in the gaz phase are afterwards involved in gaz phase
+combsution.
+
+That is the reason why a lot of modules are similar for gaz, coal and
+fuel combusiton modelling. Obviously, the thermodynamical description
+of gaz species is similar in every version as close as possible of the
+JANAF rules.
+
+Every models are developped in both an adiabatic version and an
+undiabatic (permeatic) one, so in addition with standard, the rule to
+call models is :
+IPPMOd(index model) = -1 unused
+IPPMOD(index model) = 0 simplest adiabatic version
+IPPMOD(index model) = 1 simplest permeatic version
+Eventually
+IPPMOD(index model) = 2.p p� adiabatic version
+IPPMOD(index model) = 2.p+1 P� permeatic version
+
+Every permeatic version involves the transport of enthalpy (one more variable).
+
+%=================================
+\subsection{Gaz combustion modelling}
+%=================================
+
+Combustion of gaz is limited by disponibility (in the same fluid
+particle) of both fuel and oxidant and by kinetic effects (a lot of
+chemical reactions involved can be described using an Arrhenius law
+with an high activation energy). The mixing of mass (atoms) incoming
+with fuel and oxydant is described by a mixture fraction (mass
+fraction of mass incoming with fuel), this variable is not affected by
+combustion. A progress variabl is used to describe the transformation
+of the mixture from fuel and oxydant to product (carbon dioxyde and so
+on).
+
+Combsution of gaz is, traditionnaly, splitted in premix and diffusion.
+In premix combustion process a first stage of mixing have been
+realised (without blast ...) and the mixture is introduced in the
+boiler (or combustion can). In industrial common conditions the
+combustion is mainly limited by the mixing of fresh gaz (inert) and
+burnt ones resulting in the inflammation of the first and their
+conversion to burnt ones ; so an assumption of chemistry much faster
+than mixing induces an intermittent regime. The gaz flow is
+constituted of totally fresh and totally burnt gaz (the flamme
+containing the gaz during their transformation) is "extremuly"
+%thin. With previous assumptions, Spalding \ref{Comb} have established
+thin. With previous assumptions, Spalding have established
+the "Eddy Break Up" model, wich allows a complete descrition with only
+one progress variable (mixture fraction is homogeneous). In diffusion
+flame the fuel and the oxydant are introduced by two (at least)
+inlets, in common industiral conditions, their mixing is the main
+limitation and the mixture fraction is enough to qualify a fluid
+particle, but in turbulent flow a probability density function of the
+mixture fraction is needed to qualify the thermodynamical state of the
+bulk. So both the mean and the variance of the mixture fraction are
+needed (two variables).
+
+In the real world the chemistry is not so fast and, often, the mixing
+is not as homogeneous as wished. Then the industrial combustion occurs
+in partial premix combsution. Partial premix occurs if the mixing is
+not finished (at molecular level) when the mixing is introduced, or if
+air, or fuel, are staggered, or if a diffusion flame is blowed
+off. For these situations, and specifically for lean premix gaz
+%turbines Libby \& Williams \ref{Comb} have developped a model allowing
+turbines Libby \& Williams have developped a model allowing
+a descirption of both mixing and chemical limitations. A collaboration
+%between the LCD Poitiers \ref {Comb} and EDF R\&D allows a simpler
+between the LCD Poitiers and EDF R\&D allows a simpler
+version of their algorithm. Not only the mean and the variance of both
+mixture fraction and progress variable are needed but so the
+covariance (five variables).
+
+
+%=================================
+\subsection{Coal combustion modelling}
+%=================================
+
+Combustion of coal is the main way to produce electricity in the
+world. The coal is a natural product with a very complex composition,
+during the industrial process of milling the raw coal is broken in
+tiny particles of different sizes. After its introduction in the
+boiler, the caol particles undergoes drying, devolatilisation (heating
+of coal turn it in a mixture of char and gases), heterogenous
+combustion (of char leaving to carbone monoxide) leaving an ash
+particle. Each of therse phenomena are taken in account for some class
+of particles : a class is caracterised by a coal (it is useful to burn
+mixture of coals with differents ranks or mixture of coal with
+biomasse ...) and an initla diameter. For each class, \CS computes the
+number and the mass of particles by unit mass of mixture. The main
+assumption is to solve only one speed (and pressure) field : it means
+the discrepancy of speed between coal particles and gases is supposed
+negligible. Due to the radiation and heterogeneous combustion,
+temperature can be different for gas and different size particles : so
+the specific enthalpy of each particle class is solved. The
+%description of coal pyrolisis proposed by Kobayashi \cite{Comb} and
+%bhayakar \cite{Comb} is used, leaving at two source terms for light
+descripton of coal pyrolisis proposed by Kobayashi and
+bhayakar is used, leaving at two source terms for light
+and heavy volatile matters (the moderate temperature reaction produces
+gases with low molecular mass, the high temperature reaction produces
+heavier gases and less char) represented by passive scalar : mixture
+fraction. The description of heterogeneous reaction (who produce
+carbon monoxide) leads to a source term for the carbon : a mixture
+fraction who can't be greater than the results of stoechiometric
+oxydation of char by air. The retained model for the gaz phase
+combusiton is diffusion flammelets surrounding each particle, so the
+previous gaseous fuels are mixed in a local mean fuel and the mixing
+with air is represented by a pdf between air and mean local fuel
+constructed with the variance of a passive scalar linked with air
+(interfacial mass flux produce a source term for this scalar).
+
+
+
+
+%=================================
+\subsection{Heavy Fuel Oil combustion modelling}
+%=================================
+
+Combustion of heavy fuel oil have been hugely used to produced
+electrical energy. Environemental regulation turns it more difficult
+and less acceptable, a focus is needed on pollutant emission mainly
+soulphur oxide and particles (condensation of sulphuric acid can
+aggregate soot). The description of fuel evaporation is done with
+respect of its heaviness : after a minimum temperature is reached, the
+gain of enthalpy is distributed between heating and evaporation. This
+way the evaporation takes place on a range of temperature (which can
+be large). The "total" evaporation is common for light oil but
+impossible for heavy ones, so a particle similar to char is leaved ;
+the heterogeneous oxydation of this char particle is very similar to
+coal char ones. Injection of fuel is described (2006 version) with
+only one class of particle, the number and mass of particles is
+calculated eveywhere. And so the enthalpy. So three variables are used
+to describe the condensed pahse. Like for coal, only one speed field
+is solved. The model for gas combustion is very similar to coal ones
+but a special is paid to sulphur (assumed to leave the particle as H2S
+during evaporation and to be converted to SO2 during gas combustion).
+
+
+%==================================
+%==================================
+%\section{Bibliography}
+%==================================
+%==================================
+%\begin{thebibliography}{3}
+
+%\bibitem{Comb} {\sc Plion P., {\em et al.}},\\
+%{\em Le titre},\\
+%Les r�f�rence.
+
+
+%\end{thebibliography}
diff --git a/doc/theory/condli.tex b/doc/theory/condli.tex
new file mode 100644
index 0000000..c611ae5
--- /dev/null
+++ b/doc/theory/condli.tex
@@ -0,0 +1,1199 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{condli}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Function}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Boundary conditions are required in at least three principal cases~:
+\begin{itemize}
+\item calculation of the convection terms (first order derivative in space) at
+the boundary~: the calculation uses a flux at the boundary and requires the
+value of the convected variable at the boundary when the latter is entering
+the domain in the sens of the characteristic curves of the system (in the sens
+of the velocity, in the case of the single equation of a simple scalar~:
+ sufficient interpretation in the current framework of
+\CS\footnote{except with the compressible module, see. \fort{cfxtcl}})~;
+\item calculation of the diffusion terms (second order derivative
+in space)~:
+a method to determine the value of the first order spatial derivatives
+at the boundary is then required
+ (more exactly, the terms that depend upon it are required,
+ such as the stresses of the thermal fluxes at the wall)~:
+\item calculation of the cell gradients~: the variable at the boundary faces
+ are required (more generally, the discrete terms of the equations which depend
+upon the gradient inside boundary cells are required, such as the transpose
+gradient terms in the Navier-Stokes equations).
+\end{itemize}
+These considerations only concern the computation variables
+(velocity, pressure, Reynolds tensor,
+scalars solution of a convection-diffussion equation). For these variables
+
+Les consid\'erations pr\'esentes concernent uniquement les variables de calcul
+(vitesse, pression, tenseur de Reynolds, scalaires solution d'une \'equation
+de convection-diffusion). Pour ces grandeurs
+\footnote{
+The other variables
+(the physical properties for instance) have a different treatment which will
+not be detailed here (for instance, for the density, the user defines
+directly the values at the boundary. This information is then stored~; one
+is referred to \fort{usphyv} or \fort{phyvar} for more information).
+},
+the user has to define the boundary conditions at every boundary face
+(\fort{usclim}).
+
+
+The subroutine \fort{condli} transforms the data provided by the user
+(in \fort{usclim}) into an internal format of representation of the boundary
+ conditions. Verifications of the completeness and coherence are also
+performed (in \fort{vericl}). More particularly, the smooth-wall boundary conditions
+ (\fort{clptur}), the rough-wall boundary conditions (\fort{clptrg})
+and the symmetry boundary conditions for the velocities and
+the Reynolds stress tensor (\fort{clsyvt}) are treated in dedicated subroutines.
+
+The subroutine \fort{condli}
+provides as an output pairs of coefficients
+$A_b$ and $B_b$
+for each variable~$f$ and for each boudary face.
+These are used for the calculation of the discrete terms in the equations
+to be solved. More specifically, these coefficients are used to calculate
+a value at the boundary faces $f_{b,int}$ (localised at the centre of the
+boundary face, barycentre of its vertices) by the relation
+ $f_{b,int} = A_b+B_b\,f_{I'}$, where $f_{I'}$ is the value of the variable
+at point $I'$. $I'$ is the projection onto the centre of the cell
+adjoin to the boundary on the line normal to the boundary face and passing
+by its centre
+(see figure~\ref{Base_Condli_fig_flux_condli}).
+
+\begin{figure}[h]
+\centerline{\includegraphics[height=8cm]{fluxbord}}
+\caption{\label{Base_Condli_fig_flux_condli}Boundary cell.}
+\end{figure}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discretisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\etape{Notation}
+%%%%%%%%%%%%%%%%
+On d\'esignera dans la suite par {\it VarScalaire} toute variable
+\begin{itemize}
+\item [-] autre que la
+vitesse, la pression, les grandeurs turbulentes $k$, $\varepsilon$,
+$R_{ij}$, $\varphi$, $\bar{f}$ et $\omega$,
+\item [-] solution d'une \'equation de convection-diffusion.
+\end{itemize}
+La d\'enomination {\it VarScalaire} pourra en particulier d\'esigner
+la temp\'erature, un scalaire
+passif, une fraction massique ou (sauf mention contraire explicite) la variance des fluctuations
+d'une autre {\it VarScalaire}. Les variables d'\'etat d\'eduites (masse
+volumique, viscosit\'e...) ne seront pas d\'esign\'ees par {\it VarScalaire}.
+
+
+\etape{Repr\'esentation des conditions aux limites standard dans \fort{usclim} \vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Des conditions aux limites standardis\'ees peuvent \^etre fournies par
+l'utilisateur dans \fort{usclim}. Il est pour cela n\'ecessaire d'affecter un
+type aux
+faces de bord des cellules concern\'ees\footnote{L'affectation d'un type se fait
+en renseignant le tableau
+\var{ITYPFB}.}. Les conditions pr\'evues par d\'efaut sont les suivantes~:
+
+
+
+\begin{itemize}
+\item [$\bullet$] {\bf Entr\'ee}~: correspond \`a une condition de Dirichlet sur
+toutes les variables transport\'ees (vitesse, variables turbulentes,
+{\it VarScalaires}...), et \`a
+une condition de Neumann homog\`ene (flux nul) sur la pression.
+\item [$\bullet$] {\bf Sortie}\label{Base_Condli_Sortie_Pression}~:
+ \begin{itemize}
+ \item [-] lorsque le flux de masse est effectivement dirig\'e vers
+l'ext\'erieur du domaine, ce choix correspond \`a une condition de Neumann
+homog\`ene sur toutes les variables transport\'ees et \`a
+$\displaystyle\frac{\partial^2P}{\partial \vect{n}\partial\vect{\tau}_i}=0$, pris en compte sous forme
+de Dirichlet pour la pression
+($\vect{n}$ et $(\vect{\tau}_i)_{i \in \{1,2\}}$
+d\'esignent respectivement le vecteur normal de la face de sortie consid\'er\'ee
+et deux vecteurs norm\'es, orthogonaux entre eux et dans le plan de la face de
+sortie). Cette condition est appliqu\'ee de
+mani\`ere explicite en utilisant le champ de pression et son gradient
+au pas de temps pr\'ec\'edent.
+En outre, la pression \'etant d\'efinie \`a une
+constante pr\`es, elle est recal\'ee en un point de
+sortie pour y conserver la valeur \var{P0} (on \'evite ainsi toute d\'erive
+vers des valeurs tr\`es grandes relativement \`a l'\'ecart maximal de
+pression sur le domaine)\footnote{Lorsqu'il n'y a pas de sortie, le spectre des
+valeurs propres de la matrice est d\'ecal\'e d'une valeur constante
+afin de rendre le syst\`eme inversible~: voir \fort{matrix}.}.
+ \item [-] lorsque le flux de masse est dirig\'e vers l'int\'erieur du
+domaine, situation peu souhaitable {\it a priori}\footnote{Un message indique
+\`a l'utilisateur combien de faces de sortie voient un flux de masse entrer dans
+le domaine.
+},
+on impose une condition de
+Dirichlet homog\`ene sur la vitesse (pas sur le flux de masse),
+\`a d\'efaut de conna\^\i tre sa valeur en aval du domaine. La pression est
+trait\'ee comme dans le cas pr\'ec\'edent o\`u le flux de masse est
+dirig\'e vers l'ext\'erieur du domaine. Pour les variables autres que
+la vitesse et la pression, deux cas se
+pr\'esentent~:
+ \begin{itemize}
+ \item[-] on peut imposer une condition de Dirichlet
+ pour repr\'esenter la valeur du scalaire introduit dans le domaine par
+ les faces de bord concern\'ees.
+ \item[-] on peut imposer, comme lorsque
+ le flux de masse est sortant, une condition de Neumann homog\`ene
+ (ceci n'est pas une situation souhaitable, puisque l'information
+ port\'ee sur les faces de bord provient alors de {\it l'aval} de
+ l'\'ecoulement local). C'est le cas par d\'efaut si l'on ne donne pas
+ de valeur pour le Dirichlet.
+ \end{itemize}
+\end{itemize}
+\item [$\bullet$] {\bf Paroi}~: on se reportera \`a \fort{clptur} (ou \`a \fort{clptrg} pour les
+parois rugueuses) pour une description du
+traitement des conditions aux limites de paroi (suppos\'ees imperm\'eables au
+fluide). Bri\`evement, on peut dire ici
+qu'une approche par lois de paroi est utilis\'ee afin d'imposer la contrainte
+tangentielle sur la vitesse. La paroi peut \^etre d\'efilante\footnote{On doit alors fournir
+les composantes de la vitesse de la paroi.}. Les {\it VarScalaires} re\c coivent par
+d\'efaut une condition de Neumann homog\`ene (flux nul). Si l'on souhaite
+imposer une valeur en paroi pour ces variables (par exemple, dans le cas d'une
+paroi \`a temp\'erature impos\'ee) une loi de similitude est utilis\'ee
+pour d\'eterminer le flux au bord en tenant compte de la couche limite.
+Dans le cas des couplages avec \syrthes, \CS
+re\c coit une temp\'erature de paroi et fournit un flux thermique. La condition
+de pression standard est une condition de Neumann homog\`ene\footnote{On pourra
+se reporter \`a \fort{gradrc} pour la condition conduisant \`a l'extrapolation de
+la pression au bord, condition pilotable par l'utilisation de la variable \var{EXTRAP}.}
+\item [$\bullet$] {\bf Sym\'etrie}~: correspond \`a des conditions de Neumann homog\`enes pour les
+grandeurs scalaires et \`a des conditions de sym\'etrie classiques pour les vecteurs
+(vitesse) et les tenseurs (tensions de Reynolds)~: voir \fort{clsyvt}.
+\end{itemize}
+
+\newpage
+
+\etape{Repr\'esentation des conditions aux limites sp\'ecifiques dans \fort{usclim}\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On a vu que l'affectation \`a une face de bord d'un type standard
+(entr\'ee, sortie, paroi, sym\'etrie) permettait d'appliquer simplement
+\`a l'ensemble des variables un assortiment de conditions aux limites
+coh\'erentes entre elles pour les types usuels de fronti\`ere physique.
+
+Une solution consiste \`a d\'efinir dans \fort{usclim},
+pour chaque face de bord et chaque variable, des conditions aux limites
+sp\'ecifiques\footnote{Les conditions
+aux limites sp\'ecifiques sont cod\'ees en
+renseignant directement les tableaux \var{ICODCL} et \var{RCODCL} pour chaque face de
+bord et chaque variable~: des exemples sont fournis dans \fort{usclim}.}
+(celles-ci, comme les conditions standards, se ram\`enent
+finalement \`a des conditions de type mixte).
+
+Les deux approches ne sont pas n\'ecessairement incompatibles et peuvent m\^eme
+se r\'ev\'eler compl\'ementaires. En effet, les conditions aux limites standards
+peuvent \^etre surcharg\'ees par l'utilisateur pour une ou plusieurs
+variables donn\'ees. Il convient cependant de s'assurer que, d'une fa\c con ou
+d'une autre, une condition \`a la limite a \'et\'e d\'efinie pour chaque face
+de bord et chaque variable.
+
+Des conditions de compatibilit\'e existent \'egalement entre les diff\'erentes
+variables~(voir \fort{vericl}): \begin{itemize}
+\item [-] en entr\'ee, paroi, sym\'etrie ou sortie libre, il est important que toutes les
+composantes de la vitesse aient le m\^eme type de condition~;
+\item [-] lorsque la vitesse re\c coit une condition de sortie, il est important
+que la pression re\c coive une condition de type Dirichlet. Pour plus de
+d\'etails, on se reportera au paragraphe relatif \`a la condition de sortie pour
+la pression, page \pageref{Base_Condli_Sortie_Pression}~;
+\item [-] lorsqu'une des variables de vitesse ou de turbulence
+re\c coit une condition de paroi, il doit en \^etre de m\^eme pour toutes~;
+\item [-] lorsqu'une des composantes $R_{ij}$ re\c coit une condition de sym\'etrie,
+il doit en \^etre de m\^eme pour toutes~;
+\item [-] lorsqu'une {\it VarScalaire} re\c coit une condition de paroi, la
+vitesse doit avoir le m\^eme type de condition.
+\end{itemize}
+
+\newpage
+\etape{Repr\'esentation interne des conditions aux limites}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+{\bf Objectif}
+
+Les conditions fournies par l'utilisateur sont
+retraduites sous forme de couples de coefficients $A_b$ et $B_b$
+pour chaque variable~$f$ et chaque face de bord. Ces coefficients
+sont utilis\'es pour le calcul des
+termes discrets intervenant dans les \'equations \`a r\'esoudre et
+permettent en particulier de d\'eterminer une valeur de face
+de bord $f_{b,int}$. Il est important d'insister d\`es \`a pr\'esent sur le fait
+que cette valeur est, de mani\`ere g\'en\'erale, une simple valeur num\'erique
+qui ne refl\`ete pas n\'ecessairement une r\'ealit\'e physique (en particulier
+ aux parois, pour les grandeurs affect\'ees par la couche limite turbulente).
+On d\'etaille ci-dessous le calcul de $A_b$, $B_b$ et de $f_{b,int}$.
+
+{\bf Notations}
+\begin{itemize}
+
+\item[-] On consid\`ere l'\'equation (\ref{Base_Condli_eq_conv_diff_condli})
+portant sur le scalaire $f$, dans laquelle
+$\rho$ repr\'esente la masse volumique, $\vect{u}$ la vitesse, $\alpha$ la
+conductivit\'e et
+$S$ les termes sources additionnels. $C$ est d\'efini plus bas.
+\begin{equation}\label{Base_Condli_eq_conv_diff_condli}
+\displaystyle\rho\frac{\partial f}{\partial t} + div(\rho \vect{u} f)=div\left(\displaystyle\frac{\alpha}{C}\, \grad f\right)+S
+\end{equation}
+
+\item[-] Le coefficient $\alpha$ repr\'esente la somme des
+conductivit\'es mol\'eculaire et turbulente (selon les mod\`eles utilis\'es), soit
+$\alpha=\alpha_m+\alpha_t$, avec, pour une mod\'elisation de type viscosit\'e
+turbulente, $\displaystyle\alpha_t=C\,\frac{\mu_t}{\sigma_t}$, o\`u $\sigma_t$ est le nombre de
+Prandtl turbulent\footnote{Le nombre de Prandtl turbulent est sans dimension et,
+dans certains cas usuels, pris \'egal \`a $0,7$.}.
+
+\item[-] \`A titre d'exemple, on pr\'ecise dans le tableau \ref{Base_Condli_table_alpha_condli}
+la valeur et l'unit\'e de $\alpha$ pour
+quelques cas particuliers de $f$ (certains termes de l'\'equation peuvent alors
+dispara\^\i tre~: pour la pression, en particulier, l'\'equation est
+stationnaire et les termes convectifs sont absents).
+
+\item[-] Le coefficient $C_p$ repr\'esente la chaleur sp\'ecifique, d'unit\'e
+ $m^{2}\,s^{-2}\,K^{-1}=J\,kg^{-1}\,K^{-1}$.
+
+\item[-] On note $\lambda$ la conductivit\'e thermique, d'unit\'e
+$kg\,m\,s^{-3}\,K^{-1}=W\,m^{-1}\,K^{-1}$.
+
+\item[-] Il convient de pr\'eciser que $C=1$ pour toutes les variables hormis
+pour la temp\'erature, cas dans lequel on a\footnote{Plus exactement, on a
+$C=C_p$ pour toutes les {\it VarScalaires} $f$ que l'on souhaite traiter comme la
+temp\'erature pour les conditions aux limites. Ces {\it VarScalaires} sont
+rep\'erables par l'utilisateur au moyen de l'indicateur \var{ISCSTH=1}. Par
+d\'efaut cet indicateur est positionn\'e \`a la valeur 0 pour toutes les
+{\it VarScalaires} (qui sont alors trait\'ees comme des scalaires passifs
+avec $C=1$) hormis pour la variable
+thermique \'eventuelle (\var{ISCALT}$^\text{i\`eme}$ {\it VarScalaire}), pour laquelle on a
+\var{ISCSTH=1}~: on suppose par d\'efaut que la variable thermique est la temp\'erature et non
+l'enthalpie. Si l'on souhaite r\'esoudre en enthalpie, il faut positionner
+\var{ISCSTH} \`a la valeur 2 pour la variable thermique. Pour le compressible,
+la variable thermique est l'�nergie, identifi�e par \var{ISCSTH=3}. On se
+reportera � \fort{cfxtcl} pour le traitement des conditions aux limites.}
+$C=C_p$. Dans le code, c'est la valeur de
+$\displaystyle\frac{\alpha_m}{C}$ que l'utilisateur doit fournir (si la propri\'et\'e est
+constante, les valeurs sont affect\'ees dans \fort{usini1} \`a \var{VISCL0} pour
+la vitesse et \`a \var{VISLS0} pour les {\it VarScalaires}~; si la propri\'et\'e
+est variable, ce sont des tableaux \'equivalents qui doivent \^etre renseign\'es
+dans \fort{usphyv}).
+
+\item[-] Pour la variance des fluctuations d'une {\it VarScalaire}, la
+conductivit\'e $\alpha$ et le coefficient $C$ sont h\'erit\'es de la
+{\it VarScalaire} associ\'ee.
+
+\end{itemize}
+
+
+
+\begin{table}
+{\scriptsize
+\begin{center}
+\begin{tabular}{||l|l|l||l|l|l||}
+\hline
+\multicolumn{3}{||c||}{$f$}&\multicolumn{3}{|c||}{$\alpha$}\\
+\hline
+symbole & nom & unit\'e &
+symbole & nom & unit\'e \\
+\hline
+$u_i$ & vitesse & $m\,s^{-1}$ &
+$\mu$ ou $\mu+\mu_t$ & viscosit\'e dynamique & $kg\,m^{-1}\,s^{-1}$ \\
+$p$ & pression & $kg\,m^{-1}\,s^{-2}$ &
+$\Delta t$ & pas de temps & $s$ \\
+$T$ & temp\'erature & $K$ &
+$\lambda$ & conductivit\'e thermique & $kg\,m\,s^{-3}\,K^{-1}$ \\
+ & & &
+ & & $=W\,m^{-1}\,K^{-1}$\\
+$H$ & enthalpie & $m^{2}\,s^{-2}$&
+$\lambda/C_p$ & conductivit\'e thermique/$C_p$ & $kg\,m^{-1}\,s^{-1}$ \\
+ & & $=J\,kg^{-1}$&
+ & & \\
+$f$ & {\it VarScalaire} & unit\'e($f$) &
+$\alpha$ & conductivit\'e ou diffusivit\'e & $kg\,m^{-1}\,s^{-1}$ \\
+\hline
+\end{tabular}
+\end{center}
+}
+\caption{Valeurs et unit\'es de $\alpha$ dans
+quelques cas particuliers usuels.}\label{Base_Condli_table_alpha_condli}
+\end{table}
+
+%\newpage
+
+{\bf Condition de type Dirichlet simple}~: lorsque la condition est une condition de Dirichlet simple, on
+obtient naturellement (cas particulier de (\ref{Base_Condli_eq_fbord_condli}))~:
+\begin{equation}
+\underbrace{\ \ f_{b,int}\ \ }_{\text{valeur de bord utilis\'ee par le calcul}}
+= \underbrace{\ \ f_{\text{\it r\'eel}}\ \ }_{\text{valeur r\'eelle impos\'ee au bord}}
+\end{equation}
+{\bf Autres cas}~: lorsque la condition \`a la limite porte
+sur la donn\'ee d'un flux, il s'agit
+d'un flux diffusif\footnote{En effet, le flux total sortant du domaine est
+donn\'e par la
+somme du flux convectif (si la variable est effectivement convect\'ee)
+et du flux diffusif. N\'eanmoins, pour les parois
+\'etanches et les sym\'etries, le flux de masse est nul et la condition se
+r\'eduit \`a une contrainte sur le flux diffusif. De plus, pour les
+sorties (flux de masse sortant), la condition \`a la limite ne porte que sur le
+flux diffusif (souvent une condition de Neumann homog\`ene), le flux convectif
+d\'ependant des conditions amont (il n'a donc pas besoin de
+condition \`a la limite). Enfin, aux entr\'ees, c'est le plus souvent une
+condition de Dirichlet simple qui est appliqu\'ee et le flux diffusif s'en d\'eduit.}.
+On a alors~:
+\begin{equation}
+\underbrace{\ \ \phi_{int}\ \ }_{\text{flux diffusif transmis au domaine interne}}
+= \underbrace{\ \ \phi_{\text{\it r\'eel}}\ \ }_{\text{flux diffusif r\'eel impos\'e au bord}}
+\end{equation}
+
+Le flux diffusif r\'eel impos\'e peut \^etre donn\'e
+\begin{itemize}
+\item [-] directement (condition de Neumann), soit
+$\phi_{\text{\it r\'eel}}=\phi_{\text{\it imp,ext}}$ ou
+\item [-] d\'eduit implicitement de deux informations impos\'ees~: une valeur
+externe $f_{imp,ext}$ et un coefficient d'\'echange $h_{imp,ext}$
+(condition de Dirichlet g\'en\'eralis\'ee).
+\end{itemize}
+
+\vspace{1cm}
+Selon le type de condition (Dirichlet ou Neumann) et en prenant pour hypoth\`ese
+la conservation du flux dans la direction normale au bord,
+on peut alors \'ecrire (voir figure \ref{Base_Condli_fig_flux_condli})~:
+\begin{equation}\label{Base_Condli_eq_flux_condli}
+\begin{array}{l}
+ \underbrace{h_{int}(f_{b,int}-f_{I'})}_{\phi_{int}}
+ = \underbrace{h_{b}(f_{b,ext}-f_{I'})}_{\phi_{b}}
+ = \left\{\begin{array}{ll}
+ \underbrace{h_{imp,ext}(f_{imp,ext}-f_{b,ext})}_{\phi_{\text{\it r\'eel
+impos\'e}}} &\text{(condition de Dirichlet)}\\
+ \underbrace{\phi_{\text{\it imp,ext}}}_{\phi_{\text{\it r\'eel impos\'e}}}
+ &\text{(condition de Neumann)}
+ \end{array}\right.
+\end{array}
+\end{equation}
+
+Le rapport entre le coefficient $h_{b}$ et le coefficient $h_{int}$ rend compte
+de l'importance de la travers\'ee de la zone proche du bord et
+rev\^et une importance particuli\`ere dans le
+cas des parois le long desquelles se d\'eveloppe une couche limite (dont les
+propri\'et\'es sont alors prises en compte par $h_{b}$~: se reporter \`a
+\fort{clptur}). Dans le cadre plus simple consid\'er\'e ici, on se limitera au
+cas $h_{b}=h_{int}$ et $f_{b,ext}=f_{b,int}=f_{b}$.
+La relation (\ref{Base_Condli_eq_flux_condli}) s'\'ecrit alors~:
+
+\begin{equation}
+\underbrace{h_{int}(f_{b}-f_{I'})}_{\phi_{int}}
+ = \left\{\begin{array}{ll}
+ \underbrace{h_{imp,ext}(f_{imp,ext}-f_{b})}_{\phi_{\text{\it r\'eel
+impos\'e}}} &\text{(condition de Dirichlet)}\\
+ \underbrace{\phi_{\text{\it imp,ext}}}_{\phi_{\text{\it r\'eel impos\'e}}}
+ &\text{(condition de Neumann)}
+ \end{array}\right.
+\end{equation}
+
+En r\'earrangeant, on obtient la valeur de bord~:
+\begin{equation}\label{Base_Condli_eq_fbord_condli}
+f_{b}
+ = \left\{\begin{array}{cccccl}
+ \displaystyle\frac{h_{imp,ext}}{h_{int}+h_{imp,ext}}&f_{imp,ext}&+&
+ \displaystyle\frac{h_{int}}{h_{int}+h_{imp,ext}} &f_{I'}
+ &\text{(condition de Dirichlet)}\\
+ \displaystyle\frac{1}{h_{int}}&\phi_{\text{\it imp,ext}}&+&
+ \ &f_{I'}
+ &\text{(condition de Neumann)}
+ \end{array}\right.
+\end{equation}
+
+
+{\bf Conclusion}~: on notera donc les conditions aux limites
+de mani\`ere g\'en\'erale sous la forme~:
+\begin{equation}
+f_{b}=A_b + B_b\,f_{I'}
+\end{equation}
+avec $A_b$ et $B_b$ d\'efinis selon le type des conditions~:
+\begin{equation}
+\begin{array}{c}
+\text{Dirichlet}\left\{\begin{array}{ll}
+ A_b = &\displaystyle\frac{h_{imp,ext}}{h_{int}+h_{imp,ext}}f_{imp,ext}\\
+ B_b = &\displaystyle\frac{h_{int}}{h_{int}+h_{imp,ext}}
+ \end{array}\right.
+\text{\ \ Neumann}\left\{\begin{array}{ll}
+ A_b = &\displaystyle\frac{1}{h_{int}}\phi_{\text{\it imp,ext}}\\
+ B_b = &1
+ \end{array}\right.
+\end{array}
+\end{equation}
+
+
+\newpage
+
+{\bf Remarques }
+\begin{itemize}
+\item [-] La valeur $f_{I'}$ est calcul\'ee en utilisant le gradient cellule de $f$,
+soit~: $f_{I'}=f_{I}+\vect{II'}\grad{f}_I$.
+\item [-] Il reste \`a pr\'eciser la valeur de $h_{int}$. Il s'agit d'une valeur {\it
+num\'erique}, n'ayant {\it a priori} aucun rapport avec un coefficient d'\'echange
+physique, et d\'ependante du mode de calcul du flux diffusif dans la premi\`ere
+maille de bord. Ainsi~$\displaystyle h_{int}=\displaystyle\frac{\alpha}{\overline{I'F}}$
+(l'unit\'e s'en d\'eduit naturellement).
+\item [-] On rappelle que dans le code, c'est la valeur de
+$\displaystyle\frac{\alpha_m}{C}$ que l'utilisateur doit fournir. Si la propri\'et\'e est
+constante, les valeurs sont affect\'ees dans \fort{usini1} \`a \var{VISCL0} pour
+la vitesse (viscosit\'e dynamique mol\'eculaire $\mu$ en $kg\,m^{-1}\,s^{-1}$)
+et \`a \var{VISLS0} pour les {\it VarScalaires} (par exemple, pour la
+temp\'erature et l'enthalpie, $\displaystyle\frac{\lambda}{C_p}$ en $kg\,m^{-1}\,s^{-1}$).
+Si la propri\'et\'e est variable en espace ou en temps, ce sont des tableaux \'equivalents
+qui doivent \^etre renseign\'es dans \fort{usphyv}. En outre, la variance
+des fluctuations d'une {\it VarScalaire} h\'erite automatiquement la valeur
+de $\displaystyle\frac{\alpha_m}{C}$ de la {\it VarScalaire} associ\'ee
+(\CS~1.1 et suivantes).
+\item [-] On rappelle \'egalement, car ce peut \^etre source d'erreur, que dans
+le code, on a~:
+ \begin{itemize}
+ \item [-] pour la temp\'erature $\alpha_m=\lambda$ et $C=C_p$
+ \item [-] pour l'enthalpie $\alpha_m=\displaystyle\frac{\lambda}{C_p}$ et $C=1$
+ \end{itemize}
+\end{itemize}
+
+
+{\bf Exemples de cas particuliers}
+\begin{itemize}
+\item [-] Dans le cas d'une condition de Dirichlet,
+l'utilisateur est donc conduit \`a
+fournir deux donn\'ees : $f_{imp,ext}$ et $h_{imp,ext}$.
+Pour obtenir une condition de Dirichlet simple (sans coefficient d'\'echange)
+il suffit d'imposer $h_{imp,ext}=+\infty$. C'est le cas d'utilisation le plus
+courant (en pratique, $h_{imp,ext}=10^{30}$ ).
+\item [-] Dans le cas d'une condition de Neumann, l'utilisateur fournit une seule valeur
+$\phi_{\text{\it imp,ext}}$ (nulle pour les conditions de Neumann homog\`enes).
+\end{itemize}
+
+
+{\bf Valeur et unit\'e des donn\'ees \`a fournir}\\
+Le tableau \ref{Base_Condli_table_h_phi_condli}
+permet d'identifier les unit\'es de $h$ ($h_{imp,ext}$ ou
+$h_{int}$) et $\phi_{\text{\it imp,ext}}$ pour quelques variables classiques. La
+variable $d$ repr\'esente une longueur (\'egale, pour $h_{int}$, \`a
+$\overline{I'F}$).
+Il est \'egalement important de noter qu'un flux ``sortant'' doit \^etre positif.
+
+\begin{table}
+%{\tiny
+\begin{center}
+\begin{tabular}{||l|l|l||l|l||}
+\hline
+\multicolumn{3}{||c||}{$f$}&
+\multicolumn{2}{c||}{$h$} \\
+\hline
+symbole & nom & unit\'e &
+homog\`ene \`a & unit\'e \\
+\hline
+$u_i$ & vitesse & $m\,s^{-1}$ &
+$(\mu+\mu_t)/d$ & $kg\,m^{-2}\,s^{-1}$ \\
+$p$ & pression & $kg\,m^{-1}\,s^{-2}$ &
+$(\Delta t)/d$ & $s\,m^{-1}$ \\
+$T$ & temp\'erature & $K$ &
+$(\lambda+C_p\mu_t/\sigma_t)/d$ &$kg\,s^{-3}\,K^{-1}$\\
+ & & &
+ & \ \ $=W\,m^{-2}\,K^{-1}$\\
+$H$ & enthalpie & $m^{2}\,s^{-2}=J\,kg^{-1}$&
+$(\lambda/C_p+\mu_t/\sigma_t)/d$ &$kg\,m^{-2}\,s^{-1}$\\
+$f$ & scalaire & unit\'e($f$) &
+$\alpha/d$ & $kg\,m^{-2}\,s^{-1}$ \\
+\hline
+\end{tabular}
+\end{center}
+%}
+
+%{\tiny
+\begin{center}
+\begin{tabular}{||l|l|l||l|l||}
+\hline
+\multicolumn{3}{||c||}{$f$}&
+\multicolumn{2}{c||}{$\phi_{\text{\it imp,ext}}$} \\
+\hline
+symbole & nom & unit\'e &
+homog\`ene \`a & unit\'e \\
+\hline
+$u_i$ & vitesse & $m\,s^{-1}$ &
+$(\mu+\mu_t)\,\grad{(\vect{u}_i)}.\vect{n}$ & $kg\,m^{-1}\,s^{-2} $ \\
+$p$ & pression & $kg\,m^{-1}\,s^{-2}$ &
+$(\Delta t)\,\grad{(p)}.\vect{n}$ & $kg\,m^{-2}\,s^{-1}$ \\
+$T$ & temp\'erature & $K$ &
+$(\lambda+C_p\mu_t/\sigma_t)\,\grad{(T)}.\vect{n}$ &$kg\,s^{-3}=W\,m^{-2}$ \\
+$H$ & enthalpie & $m^{2}\,s^{-2}=J\,kg^{-1}$&
+$(\lambda/C_p+\mu_t/\sigma_t)\,\grad{(H)}.\vect{n}$ &$kg\,s^{-3}=W\,m^{-2}$ \\
+$f$ & scalaire & unit\'e($f$) &
+$\alpha\,\grad{(f)}.\vect{n}$ & $kg\,m^{-2}\,s^{-1}$ unit\'e($f$) \\
+\hline
+\end{tabular}
+\end{center}
+%}
+\caption{Valeur et unit\'e de $h$ et $\phi_{\text{\it imp,ext}}$ dans
+quelques cas particuliers usuels.}\label{Base_Condli_table_h_phi_condli}
+\end{table}
+
+\newpage
+\etape{Condition de sortie pour la pression\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On pr\'ecise ici la condition de sortie appliqu\'ee
+\`a la pression dans le cas des sorties standards.
+Il est n\'ecessaire d'imposer une condition de type Dirichlet (accompagn\'ee d'une
+condition
+de type Neumann homog\`ene sur les composantes de la vitesse). On la
+calcule \`a partir des valeurs de la variable au pas de temps pr\'ec\'edent.
+\begin{itemize}
+\item [-] En raisonnant sur une configuration simple (de type canal, avec une sortie
+plane, perpendiculaire \`a l'\'ecoulement),
+on peut faire l'hypoth\`ese que la forme des profils de pression pris
+sur les surfaces parall\`eles \`a la sortie est inchang\'ee aux alentours de
+celle-ci (hypoth\`ese d'un \'ecoulement \'etabli, loin de toute
+perturbation). Dans cette situation, on peut \'ecrire
+$\displaystyle\frac{\partial^2P}{\partial\vect{n}\partial\vect{\tau}_i}=0$
+($\vect{n}$ est le vecteur normal \`a la sortie, $\vect{\tau}_i$ repr\'esente
+une base du plan de sortie).
+
+\item [-] Si, de plus,
+on peut supposer que le gradient de pression pris dans la direction
+perpendiculaire aux faces de sortie est uniforme au
+voisinage de celle-ci, le profil \`a imposer en sortie (valeurs $p_b$)
+se d\'eduit du profil
+pris sur un plan amont (valeurs $p_{amont}$) en ajoutant simplement la constante
+$R=d\,\grad{(p)}.\vect{n}$ (o\`u $d$ est la distance entre le plan amont
+et la sortie), soit $p_b=p_{amont}+R$ (le fait que $R$ soit identique pour
+toutes les faces de sortie est important afin de pouvoir l'\'eliminer dans
+l'\'equation (\ref{Base_Condli_eq_psortie_condli}) ci-dessous).
+
+\item [-] Avec l'hypoth\`ese
+suppl\'ementaire que les points $I'$ relatifs aux faces de sortie sont
+sur un plan parall\`ele \`a la sortie, on peut utiliser les
+valeurs en ces points ($p_{I'}$) pour valeurs amont soit
+$p_{amont}=p_{I'}=p_{I}+\vect{II'}.\grad{p}$.
+
+\item [-] Par ailleurs, la
+pression \'etant d\'efinie \`a une constante pr\`es (\'ecoulement
+incompressible) on peut fixer sa valeur arbitrairement en un point $A$ (centre
+d'une face de sortie choisie arbitrairement\footnote{premi\`ere face de
+sortie rencontr\'ee en parcourant les faces de bord dans l'ordre naturel induit
+par la num\'erotation interne au code}) \`a $p_0$ (valeur fix\'ee par
+l'utilisateur, \'egale \`a \var{P0} et nulle par d\'efaut),
+et donc d\'ecaler le profil impos\'e en sortie en ajoutant~:\\
+$R_0=p_0-(p_{amont,A}+R)=p_0-(p_{I',A}+R)$.
+
+\item [-] On obtient donc finalement~:
+\begin{equation}\label{Base_Condli_eq_psortie_condli}
+\begin{array}{lll}
+p_b&=&p_{I'}+R+R_0\\
+ &=&p_{I'}+R+p_0-(p_{I',A}+R)\\
+ &=&p_{I'}+\underbrace{p_0-p_{I',A}}_{\text{valeur constante $R_1$}}\\
+ &=&p_{I'}+R_1
+\end{array}
+\end{equation}
+\end{itemize}
+On constate donc que la condition de pression en sortie est une condition de
+Dirichlet dont les valeurs sont \'egales aux valeurs de la pression (prises au
+pas de temps pr\'ec\'edent) sur le plan amont des points $I'$ et recal\'ees pour obtenir \var{P0} en
+un point de sortie arbitraire.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\etape{Mode de prescription des conditions aux limites dans \fort{usclim}\vspace{0,3cm}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+L'utilisateur fournit pour chaque face un moyen de d\'eterminer les
+conditions aux limites de toutes les variables de calcul. Comme on l'a vu,
+plusieurs m\'ethodes sont envisageables.
+
+La plus simple consiste \`a renseigner, pour chaque face, un code
+d\'esignant une condition \`a la limite standard (dans le tableau \var{ITYPFB}
+de dimension \var{NFABOR}) et les
+informations compl\'emen\-tai\-res \'eventuelles. Les
+valeurs de \var{ITYPFB} suivantes sont
+pr\'ed\'efinies\footnote{L'utilisateur peut d\'efinir d'autres types ({\it i.e.}
+affecter \`a
+\var{ITYPFB} d'autres valeurs enti\`eres), mais elles ne recouvrent pas de
+conditions aux limites par d\'efaut. Les faces de bord ainsi
+rep\'er\'ees sont cependant trait\'ees comme un ensemble particulier
+lors de l'impression
+d'informations de type flux de masse par exemple.}~:
+\var{IENTRE} (entr\'ee), \var{ISOLIB}
+(sortie libre), \var{ISYMET} (sym\'etrie),
+\var{IPAROI} (paroi lisse), \var{IPARUG} (paroi rugueuse). Dans le cas des entr\'ees (et des sorties de type 10), il
+est n\'ecessaire de fournir une valeur de Dirichlet.
+
+L'utilisateur peut \'egalement renseigner un entier
+(tableau \var{ICODCL} de dimension \var{NFABOR}$\times$\var{NVAR})
+d\'esignant le type de condition \`a appliquer \`a une variable
+donn\'ee~: les valeurs 1 (pour Dirichlet) et 3 (pour Neumann) sont
+souvent utilis\'ees, plus rarement 5 (pour les conditions de paroi
+lisse) ou 6 (pour les conditions de paroi rugueuse) et
+exceptionnellement 4 (pour la sym\'etrie d'une vitesse ou du tenseur
+de Reynolds), 9 (pour la sortie libre, uniquement pour les
+vitesses). Lorsque \var{ICODCL} est renseign\'e pour une variable
+donn\'ee, il prend alors le pas sur
+\var{ITYPFB} sur la face consid\'er\'ee.
+L'utilisateur doit dans ce cas \'egalement fournir, suivant les
+cas, z\'ero, un ou deux r\'eels (dans le tableau \var{RCODCL}
+de dimension \var{NFABOR}$\times$\var{NVAR}$\times 3$). Pour une face et une
+variable~$f$ donn\'ees, les 3 valeurs de
+\var{RCODCL} d\'esignent respectivement les grandeurs $f_{imp,ext}$,
+$h_{imp,ext}$ et~$\phi_{\text{\it imp,ext}}$.
+
+On indique dans le tableau \ref{Base_Condli_table_ITYPFB_condli} le mode de traitement des
+variables pour les diff\'erents types de conditions aux limites standards. La
+liste des valeurs compl\'ementaires \`a fournir est \'egalement pr\'ecis\'ee.
+Le tableau \ref{Base_Condli_table_ICODCL_condli} propose le m\^eme type d'information pour
+les conditions aux limites sp\'ecifiques plus complexes, d\'efinies \`a partir
+de la valeur de \var{ICODCL}. Enfin, le tableau \ref{Base_Condli_table_ICODCLadm_condli}
+synth\'etise les valeurs admissibles de \var{ICODCL} pour chaque variable de
+calcul.
+
+\begin{table}
+{\scriptsize
+\begin{center}
+\begin{tabular}{||l|l||l|l|lll||}
+\hline
+\var{ITYPFB} & type & variables trait\'ees
+ & type de condition
+ &\multicolumn{3}{c||}{donn\'ees compl\'ementaires}\\
+\hline
+\hline
+\var{IENTRE} & entr\'ee & variables transport\'ees
+ &Dirichlet
+ &RCODCL(.,.,1)&valeur d'entr\'ee& nulle par d\'efaut\\
+\cline{3-7}
+ & & pression
+ &Neumann homog\`ene
+ & & & \\
+\hline
+\hline
+\var{ISYMET} & sym\'etrie & vitesse
+ &sym\'etrie vecteur
+ & & & \\
+\cline{3-7}
+ & & tensions de Reynolds
+ &sym\'etrie tenseur
+ & & & \\
+\cline{3-7}
+ & & autres variables
+ &Neumann homog\`ene
+ & & & \\
+\hline
+\hline
+\var{IPAROI} & paroi & pression
+ &Neumann homog\`ene$^{a}$
+ & & & \\
+\cline{3-7}
+ & lisse & vitesses
+ &lois de paroi (Dirichlet)$^{b}$
+ &RCODCL(.,.,1)&vitesse de d\'efilement & nulle par d\'efaut\\
+\cline{3-7}
+ & & grandeurs turbulentes
+ &lois de paroi$^{c}$
+ & & & \\
+\cline{3-7}
+ & & autres variables
+ &
+ & & & \\
+ & &\ \ transport\'ees
+ &Neumann homog\`ene$^{d}$
+ & & & \\
+\hline
+\hline
+\var{IPARUG} & paroi & pression
+ &Neumann homog\`ene$^{a}$
+ & & & \\
+\cline{3-7}
+ & rugueuse & vitesses
+ &lois de paroi (Dirichlet)$^{b}$
+ &RCODCL(.,.,1)&vitesse de d\'efilement & nulle par d\'efaut\\
+ & &
+ & &RCODCL(.,.,3)$^{f}$&hauteur de rugosit\'e & nulle par d\'efaut\\
+\cline{3-7}
+ & & grandeurs turbulentes
+ &lois de paroi$^{c}$
+ & & & \\
+\cline{3-7}
+ & & autres variables
+ &
+ & & & \\
+ & &\ \ transport\'ees
+ &Neumann homog\`ene$^{d}$
+ & & & \\
+\hline
+\hline
+\var{ISOLIB} & sortie & pression
+ &$\displaystyle\frac{\partial^2P}{\partial
+\vect{n}\partial\vect{\tau}_i}=0$
+ & & & \\
+\cline{3-7}
+ & libre & vitesses
+ &Neumann homog\`ene
+ & & & \\
+ & &
+ &\ \ (flux de masse sortant)
+ & & & \\
+\cline{4-7}
+ & &
+ &Dirichlet homog\`ene
+ & & & \\
+ & &
+ &\ \ (flux de masse entrant)
+ & & & \\
+\cline{3-7}
+ & & autres variables
+ &Neumann homog\`ene
+ & & & \\
+ & &\ \ transport\'ees
+ &\ \ ou
+ & & & \\
+ & &
+ &Dirichlet$^{e}$
+ &RCODCL(.,.,1)&valeur d'entr\'ee& nulle par d\'efaut\\
+ & &
+ &\ \ (flux de masse entrant)
+ & & & \\
+\hline
+\end{tabular}
+\end{center}
+$^{a}$Le gradient peut \^etre
+extrapol\'e en paroi selon les valeurs de \var{EXTRAP}~: voir \fort{gradrc}\\
+$^{b}$voir \fort{clptur} pour une paroi lisse ou \fort{clptrg} pour une paroi rugueuse\\
+$^{c}$voir \'egalement \fort{clptur} ou \fort{clptrg}\\
+$^{d}$La condition de Neumann
+homog\`ene est obtenue lorsque l'utilisateur ne pr\'ecise rien d'autre que le
+type de fronti\`ere \var{IPAROI} ou \var{IPARUG}~; d'autres conditions sont possibles~: le
+tableau \ref{Base_Condli_table_ICODCL_condli} les pr\'ecise.\\
+$^{e}$La valeur est impos\'ee par l'utilisateur. Il n'y a pas d'implicitation
+temporelle.\\
+$^{f}$Seule la valeur pour IU(IPHAS) est utilis\'ee.
+}
+\caption{Conditions aux limites standards.}\label{Base_Condli_table_ITYPFB_condli}
+\end{table}
+
+
+
+
+\begin{table}
+{\scriptsize
+\begin{center}
+\begin{tabular}{||c|l||l|llll||}
+\hline
+\var{ICODCL} & variables & type de condition
+ &\multicolumn{4}{c||}{donn\'ees compl\'ementaires n\'ecessaires et suffisantes}\\
+\hline
+\hline
+1 & toutes & Dirichlet
+ &\var{RCODCL(.,.,1)} &$f_{imp,ext}$ & valeur &nulle par d\'efaut\\
+ & &
+ &\var{RCODCL(.,.,2)} &$h_{imp,ext}$ & coef. d'\'echange&=\var{RINFIN}$=10^{30}$ par d\'efaut\\
+\hline
+\hline
+3 & toutes & Neumann
+ &\var{RCODCL(.,.,3)} &$\phi_{imp,ext}$ &valeur &nulle par d\'efaut\\
+\hline
+\hline
+4 & vitesse & Sym\'etrie vecteur
+ & & & & \\
+\cline{2-7}
+ & $R_{ij}$ & Sym\'etrie tenseur
+ & & & & \\
+\hline
+\hline
+5 & vitesse & Loi de paroi
+ &\var{RCODCL(.,.,1)} & & vitesse de d\'efilement &nulle par d\'efaut\\
+\cline{2-7}
+ & $k$, $R_{ij}$, $\varepsilon$, $\varphi$, $\bar{f}$, $\omega$ & Loi de paroi
+ & & & & \\
+\cline{2-7}
+ & {\it VarScalaire} & Loi de paroi
+ &\var{RCODCL(.,.,1)} &$f_{imp,ext}$ & valeur en paroi &nulle par d\'efaut\\
+ & \ (sauf variance) &
+ &\var{RCODCL(.,.,2)} &$h_{imp,ext}$ & coef. d'\'echange&=\var{RINFIN}$=10^{30}$ par d\'efaut\\
+\hline
+\hline
+6 & vitesse & Loi de paroi rugueuse
+ &\var{RCODCL(.,.,1)} & & vitesse de d\'efilement &nulle par d\'efaut\\
+ & &
+ &\var{RCODCL(.,.,3)} & & rugosit\'e dynamique &nulle par d\'efaut\\
+\cline{2-7}
+ & $k$, $R_{ij}$, $\varepsilon$, $\varphi$, $\bar{f}$, $\omega$ & Loi de paroi rugueuse
+ & & & & \\
+ & &
+ &\var{RCODCL(.,.,3)} & & rugosit\'e dynamique &nulle par d\'efaut\\
+\cline{2-7}
+ & {\it VarScalaire} & Loi de paroi rugueuse
+ &\var{RCODCL(.,.,1)} &$f_{imp,ext}$ & valeur en paroi &nulle par d\'efaut\\
+ & \ (sauf variance) &
+ &\var{RCODCL(.,.,2)} &$h_{imp,ext}$ & coef. d'\'echange&=\var{RINFIN}$=10^{30}$ par d\'efaut\\
+ & &
+ &\var{RCODCL(.,.,3)} & & rugosit\'e thermique &nulle par d\'efaut\\
+\hline
+\hline
+9 & vitesse & Neumann homog\`ene
+ & & & & \\
+ & & \ \ (flux de masse sortant)
+ & & & & \\
+\cline{3-7}
+ & & Dirichlet homog\`ene
+ & & & & \\
+ & & \ \ (flux de masse entrant)
+ & & & & \\
+\hline
+\end{tabular}
+\end{center}
+}
+\caption{Conditions aux limites sp\'ecifiques.}\label{Base_Condli_table_ICODCL_condli}
+\end{table}
+
+
+\begin{table}
+%{\tiny
+\begin{center}
+\begin{tabular}{||c|c||p{0,6cm}|p{0,6cm}|p{0,6cm}|p{0,6cm}|p{0,6cm}|p{0,6cm}||}
+\hline
+\multicolumn{2}{||c||}{Variable}
+ &\multicolumn{6}{c||}{Valeurs de \var{ICODCL} admissibles}\\
+%\multicolumn{2}{||c||}{}
+% &\multicolumn{6}{c||}{admissibles}\\
+%\cline{3-8}
+% & &
+%1& 3& 4& 5& 9& 10 \\
+\hline
+Vitesse & $U$ & 1& 3& 4& 5& 6& 9 \\
+Pression & $p$ & 1& 3& & & & \\
+Variable scalaire de turbulence & $k$, $\varepsilon$, $\varphi$, $\bar{f}$, $\omega$ & 1& 3& & 5& 6& \\
+Tenseur de Reynolds & $R_{ij}$ & 1& 3& 4& 5& 6& \\
+{\it VarScalaire} (hormis variances) & & 1& 3& & 5& 6& \\
+Variance des fluctuations d'une {\it VarScalaire} & & 1& 3& & & & \\
+\hline
+\end{tabular}
+\end{center}
+%}
+\caption{Valeurs admissibles de \var{ICODCL} pour chaque variable.}\label{Base_Condli_table_ICODCLadm_condli}
+\end{table}
+
+
+\newpage
+Il est important de conna\^\i tre \'egalement les compatibilit\'es \`a assurer
+entre les valeurs de \var{ICODCL} associ\'ees aux diff\'erentes variables ({\it
+Cf.} Points \`a traiter).
+\begin{itemize}
+\item [-] Si \var{ICODCL} vaut 4, 5 ou 9 pour une composante de la vitesse,
+la m\^eme valeur de \var{ICODCL} doit \^etre associ\'ee \`a toutes les
+composantes (sym\'etrie, paroi ou sortie libre).
+\item [-] Si \var{ICODCL} vaut 9 pour une composante de la vitesse,
+la valeur de \var{ICODCL} associ\'ee \`a la pression doit \^etre 1 (sortie libre).
+\item [-] Si \var{ICODCL} vaut 5 pour une composante de la vitesse, pour $k$,
+$\varepsilon$, $\varphi$, $\bar{f}$, $\omega$ ou pour une des composantes du
+tenseur de Reynolds $R_{ij}$,
+la valeur de \var{ICODCL} associ\'ee \`a toutes ces variables doit \^etre 5 (paroi).
+La m\^eme remarque vaut pour \var{ICODCL} \'egal \`a 6.
+\item [-] Si \var{ICODCL} vaut 4 pour une composante de la vitesse
+ou pour une des composantes du tenseur de Reynolds $R_{ij}$,
+la valeur de \var{ICODCL} associ\'ee \`a toutes ces variables doit \^etre 4 (sym\'etrie).
+\item [-] Si \var{ICODCL} vaut 5 pour une variable {\it VarScalaire},
+la valeur de \var{ICODCL} associ\'ee \`a toutes les composantes de la vitesse
+doit \^etre 5 (paroi lisse), idem si \var{ICODCL} vaut 6 (paroi rugueuse).
+\end{itemize}
+
+\etape{Conversion des donn\'ees utilisateur}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Une premi\`ere \'etape (\var{TYPECL}) permet essentiellement de convertir les
+donn\'ees des utilisateurs. Plus pr\'ecis\'ement, les actions suivantes sont
+r\'ealis\'ees~:
+\begin{itemize}
+\item[-] les faces de bord sont tri\'ees selon le
+type de condition \`a la limite qui leur a \'eventuellement \'et\'e affect\'e
+(valeurs de \var{ITYPFB})~;
+\item[-] les types \var{ITYPFB} (si l'utilisateur en a d\'efini)
+sont convertis en quadruplets d\'efinis pour
+chaque face \var{IFAC} et chaque variable \var{IVAR} (hormis lorsque
+l'utilisateur a affect\'e une valeur \`a \var{ICODCL})~:\\
+(\var{ICODCL}, \var{RCODCL(IFAC,IVAR,1)},
+ \var{RCODCL(IFAC,IVAR,2)}, \var{RCODCL(IFAC,IVAR,3)})
+\item[-] pour la pression, la condition de sortie se traduit par une condition
+de type Dirichlet~: on impose aux faces de bord la valeur de la pression $p$ au
+point $I'$, calcul\'ee \`a partir des donn\'ees du pas de temps
+pr\'ec\'edent (et le calcul du gradient de pression est donc r\'ealis\'e au
+pr\'ealable). Cette valeur $p_{I'}$ est conserv\'ee
+dans le tableau \var{COEFU(.,1)}, de dimension \var{NFABOR}, puis
+affect\'ee \`a \var{RCODCL(.,IPR,1)} accompagn\'ee d'un recalage (identique pour
+toutes les faces) destin\'e
+\`a assurer une valeur de Dirichlet de pression fixe \var{P0} sur la
+premi\`ere face de sortie rencontr\'ee ({\it Cf.} Points \`a traiter).
+\item[-] L'indicateur \var{IDIRCL} (tableau de dimension
+\var{NVAR}) est annul\'e pour rep\'erer les variables pour lesquelles
+le syst\`eme diffusif \`a r\'esoudre n'est pas n\'ecessairement inversible (le
+probl\`eme sera trait\'e dans \fort{matrix}). Il
+s'agit en pratique, dans le cadre actuel, de la variable pression lorsqu'il n'y a aucune
+face de sortie (cavit\'e ferm\'ee par exemple). Plus pr\'ecis\'ement,
+\var{IDIRCL} est annul\'e pour les variables qui n'ont aucune condition de
+Dirichlet\footnote{Le test contient une r\'ef\'erence \`a
+\var{ICODCL}~$= 2$ qui est un h\'eritage d'une version dans laquelle les
+conditions de Dirichlet avec coefficient d'\'echange \'etaient distingu\'ees des
+conditions de Dirichlet sans coefficient d'\'echange.} et
+pour lesquelles l'indicateur \var{ISTAT} est positionn\'e \`a z\'ero. Cet
+indicateur (de valeur 0 ou 1) est, dans le bilan explicite,
+le coefficient multiplicatif du terme
+de d\'eriv\'ee temporelle de la variable r\'esolue~; il est
+nul pour la pression.
+\item[-] la valeur du flux de masse est imprim\'ee
+pour les ensembles de faces de bord de m\^eme type \var{ITYPFB} (il existe un
+type par d\'efaut appliqu\'e aux faces de bord pour lesquelles l'utilisateur
+n'a pas renseign\'e \var{ITYPFB}).
+\end{itemize}
+
+\etape{V\'erifications}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Une v\'erification des conditions aux limites est ensuite men\'ee
+(\fort{vericl}) (l'utilisateur est pr\'evenu et le programme interrompu en cas de
+probl\`eme).
+\begin{itemize}
+\item[-] Le sous-programme s'assure que toutes les faces de bord ont re\c cu une
+condition \`a la limite pour toutes les variables.
+\item[-] L'admissibilit\'e des conditions aux limites (selon la nature de la
+variable \`a laquelle elles sont appliqu\'ees) est v\'erifi\'ee.
+\item[-] La coh\'erence des conditions aux limites entre les diff\'erentes
+variables est v\'erifi\'ee (voir les tableaux \ref{Base_Condli_table_ICODCL_condli} et
+\ref{Base_Condli_table_ICODCLadm_condli}).
+\end{itemize}
+
+
+\etape{Calculs pr\'eliminaires}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Diff\'erentes grandeurs sont ensuite construites
+pour pr\'eparer le traitement ult\'erieur des conditions aux limites.
+\begin{itemize}
+\item[-] quand la connaissance de la distance � la paroi est n�cessaire
+($R_{ij}-\varepsilon$ avec termes d'\'echo de paroi, mod�le LES de Smagorinsky
+avec amortissement de van Driest, mod�le $k-\omega$ SST) et que la m�thode de
+calcul ``ancienne'' a �t� choisie (\var{|ICDPAR|=2}, non compatible avec le
+parall�lisme et la p�riodicit�), pour chaque phase \var{IPHAS},
+ on d\'etermine, pour chaque cellule \var{IEL}, le num\'ero de la face
+de paroi la plus proche (cette information est stock\'ee dans
+\var{IA(IIFAPA(IPHAS)-1+IEL)})~; cette distance est inutile pour le traitement
+des conditions aux limites, mais \fort{condli} est le sous-programme dans lequel
+la r\'ealisation de ce calcul est la plus simple.
+\item[-] en cas de couplage avec \syrthes, on d\'etermine, pour le scalaire
+coupl\'e $f$ (habituellement la temp\'erature),
+les valeurs $f_{I'}$ dans les cellules de bord au moyen de la formule
+$f_{I'}=f_{I}+\vect{II'}\grad{f}_I$ (ou au moyen de $f_{I'}=f_{I}$ si on traite
+le premier pas de temps\footnote{On ne dispose pas encore de conditions aux
+limites permettant le calcul du gradient lors du passage dans \fort{condli}
+au premier pas de temps.} ou que la
+reconstruction a \'et\'e desactiv\'ee par \var{ITBRRB}=0\footnote{ce qui est le
+cas par d�faut}). Ces valeurs sont
+stock\'ees dans \var{TBORD} (tableau de dimension \var{NFABOR}) qui est
+utilis\'e en sortie de \fort{condli} pour transmission d'information \`a
+\syrthes.
+\item[-] si des faces portent des conditions de sym\'etrie ou de paroi, on
+construit les composantes de la vitesse $u_{j,I'}$ dans les cellules de
+bord (valeurs stock\'ees dans le tableau local \var{COEFU} de dimension
+\var{NFABOR}$\times 3$) au moyen de la formule $u_{j,I'}=u_{j,I}+\vect{II'}\grad{u_j}_I$
+(ou au moyen de $u_{j,I'}=u_{j,I}$ au premier pas de temps)~; en outre, si le
+mod\`ele de turbulence est le $R_{ij}-\varepsilon$, on construit les composantes
+du tenseur de Reynolds dans les cellules de
+bord (valeurs stock\'ees dans le tableau local \var{RIJIPB} de dimension
+\var{NFABOR}$\times 6$) de la m\^eme mani\`ere. Les deux tableaux \var{COEFU}
+et \var{RIJIPB} sont utilis\'es dans \fort{clptur} et \fort{clsyvt}.
+\end{itemize}
+
+\etape{Conditions aux limites de paroi}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On d\'etermine alors (\fort{clptur}) les conditions aux limites de paroi pour
+la vitesse et les grandeurs turbulentes. Les {\it VarScalaires} (except\'e les
+variances) peuvent
+\'egalement recevoir un traitement particulier prenant en compte la couche
+limite si la condition qui leur est appliqu\'ee est de type Dirichlet
+(\var{ICODCL}=5). On traite donc en particulier
+dans \fort{clptur} les conditions portant sur la temp\'erature lorsque la paroi est
+\`a temp\'erature impos\'ee. Par contre, les conditions de flux sont trait\'ees plus tard
+dans \fort{condli}.
+
+Le sous-programme \fort{clptur} remplit les
+tableaux \var{COEFA} et \var{COEFB} pour les faces de paroi et les variables
+trait\'ees. Ces tableaux repr\'esentent les coefficients $A_b$ et
+$B_b$. Plus pr\'ecis\'ement, pour une face \var{IFAC} et une variable \var{IVAR} donn\'ee,
+les valeurs renseign\'ees sont \var{COEFA(IFAC,ICLVAF)} et \var{COEFB(IFAC,ICLVAF)} avec
+\var{ICLVAF=ICLRTP(IVAR,ICOEFF)}. Deux autres valeurs sont \'egalement renseign\'ees~:\\
+\var{COEFA(IFAC,ICLVAR)} et \var{COEFB(IFAC,ICLVAR)} avec
+\var{ICLVAR=ICLRTP(IVAR,ICOEF)}.\\
+Elles ne diff\`erent des pr\'ec\'edentes qu'en
+$k-\varepsilon$ et repr\'esentent des coefficients $A_b$ et
+$B_b$ particuliers pour le calcul des gradients intervenant dans le terme de
+production turbulente (il y a donc bien deux types de conditions aux limites
+pour la vitesse dans ce cas, et chacun est utilis\'e lors du traitement d'un
+terme particulier~: on se reportera \`a \fort{clptur}).
+
+\etape{Conditions aux limites de sym\'etrie}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On d\'etermine \'egalement (\fort{clsyvt}) les conditions aux limites de sym\'etrie pour
+les vecteurs (vitesse) et les tenseurs (de Reynolds). Elles n\'ecessitent des
+rotations pour s'exprimer dans le rep\`ere li\'e au bord et le traitement lourd
+qui en r\'esulte a donc \'et\'e encapsul\'e. Le sous-programme compl\`ete les
+tableaux \var{COEFA} et \var{COEFB} aux faces de sym\'etries pour la vitesse
+et les tensions de Reynolds (contrairement aux faces de paroi en
+$k-\varepsilon$, les valeurs \var{COEFA(IFAC,ICLVAF)} et
+\var{COEFB(IFAC,ICLVAF)} sont \'egales \`a \var{COEFA(IFAC,ICLVAR)} et
+\var{COEFB(IFAC,ICLVAR)}).
+
+
+\etape{Autres conditions aux limites pour la vitesse}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On d\'etermine, pour la vitesse, les conditions aux limites en sortie. On traite
+en outre les conditions restantes de type
+Dirichlet et Neumann. Ici \'egalement, on fournit une valeur de
+\var{COEFA} et de \var{COEFB} pour chaque face concern\'ee
+(les valeurs \var{COEFA(IFAC,ICLVAF)} et
+\var{COEFB(IFAC,ICLVAF)} sont \'egales \`a \var{COEFA(IFAC,ICLVAR)} et
+\var{COEFB(IFAC,ICLVAR)}).
+Notons que, si le flux de masse est entrant \`a
+travers une face de sortie, on impose un Dirichlet homog\`ene sur la vitesse
+(\var{COEFA(IFAC,ICLVAF)}=0, \var{COEFB(IFAC,ICLVAF)}=0) au
+lieu de la condition de Neumann homog\`ene
+(\var{COEFA(IFAC,ICLVAF)}=0, \var{COEFB(IFAC,ICLVAF)}=1), lorsque le flux de
+masse est sortant.
+
+
+\etape{Autres conditions aux limites}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On d\'etermine enfin, pour la pression, les grandeurs turbulentes et les autres
+scalaires, les conditions aux limites de type Dirichlet et Neumann restantes. Ici \'egalement, on fournit donc une valeur de
+\var{COEFA} et de \var{COEFB} pour chaque face concern\'ee
+(les valeurs \var{COEFA(IFAC,ICLVAF)} et
+\var{COEFB(IFAC,ICLVAF)} sont \'egales \`a \var{COEFA(IFAC,ICLVAR)} et
+\var{COEFB(IFAC,ICLVAR)}).
+
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Repr\'esentation des conditions par une valeur de face}
+Bien que la m\'ethode utilis\'ee permette une simplicit\'e et une
+homog\'en\'eit\'e de traitement de toutes les conditions aux limites,
+elle est relativement
+restrictive au sens o\`u une seule valeur ne suffit pas toujours pour
+repr\'esenter les conditions \`a appliquer lors du calcul de termes
+diff\'erents.
+
+Ainsi, en $k-\varepsilon$ a-t-il \'et\'e n\'ecessaire, lors du
+calcul des conditions aux limites de paroi, de disposer de deux couples
+($A_b$, $B_b$) afin de prendre en compte les
+conditions \`a appliquer pour le calcul de la contrainte tangentielle
+ et celles \`a utiliser lors du calcul du terme
+de production (et un troisi\`eme jeu de coefficients serait n\'ecessaire pour
+permettre le traitement des gradients intervenant dans les termes de gradient
+transpos\'e, dans \fort{vissec}).
+
+Peut-\^etre pourrait-il \^etre utile de mettre en place une m\'ethode
+permettant d'utiliser (au moins en certains points strat\'egiques du code)
+directement des forces, des contraintes ou des flux, sans passer
+n\'ecessairement par le calcul d'une valeur de face.
+
+\etape{Difficult\'es li\'ees \`a la donn\'ee d'un flux (entr\'ee des donn\'ees
+peu intuitive)}
+L'utilisateur est invit\'e \`a fournir, dans le cas d'une condition de Neumann,
+une valeur de flux en $W\,m^{-2}$ pour la temp\'erature ou l'enthalpie. Par
+souci de coh\'erence, lorsqu'il souhaite fournir une condition de Neumann sur
+une autre variable, il est amen\'e \`a fournir une grandeur similaire (en
+fait homog\`ene \`a $\alpha\,\grad{f}.\vect{n}$, si $f$ est la variable), ce qui est
+peu naturel pour la vitesse, la pression ou un scalaire, dans le cas o\`u l'on
+souhaite imposer la valeur du gradient normal \`a la face et non pas la valeur
+de $(\mu+\mu_t)\grad{\vect{u}_j}.\vect{n}$, de $\Delta t \grad{(p)}.\vect{n}$ ou
+de $\displaystyle\frac{\alpha}{C} \grad{(f)}.\vect{n}$.
+
+\etape{Condition de sortie en pression}
+La condition de pression en sortie se traduit par
+$p_f=p_{I'}+R1$ et le profil obtenu correspond au
+profil amont pris aux points $I'$ et recal\'e pour obtenir $p_0$ en un point
+$A$ arbitraire. Ce type de condition est appliqu\'e sans pr\'ecautions, mais
+n'est pas toujours justifi\'e (une condition de Dirichlet bas\'ee sur la valeur calcul\'ee
+directement aux faces de bord pourrait \^etre plus adapt\'ee).
+Les hypoth\`eses sont en particulier mises en d\'efaut
+dans les cas suivants~:
+\begin{itemize}
+\item [-] la sortie est proche d'une zone o\`u l'\'ecoulement n'est pas \'etabli
+en espace (ou varie en temps)~;
+\item [-] la sortie n'est pas une surface perpendiculaire \`a l'\'ecoulement~;
+\item [-] le gradient de pression dans la direction normale \`a la sortie n'est
+pas le m\^eme pour toutes les faces de sortie
+(dans le cas de sortie multiples, par exemple, le gradient n'est
+probablement pas le m\^eme au travers de toutes les sorties)~;
+\item [-] les points $I'$ ne sont pas sur une surface parall\`ele \`a la sortie
+(cas des maillage irr\'eguliers par exemple).
+\end{itemize}
+
+On pourrait \'egalement tester la m\'ethode d'Orlansky (\'equation de convection
+sur la pression).
+
+Par ailleurs, en l'absence de condition de sortie, il pourrait peut-\^etre se
+r\'ev\'eler utile de fixer une valeur de r\'ef\'erence sur une cellule donn\'ee
+ou de ramener la moyenne de la pression \`a une valeur de r\'ef\'erence (avec le
+d\'ecalage du spectre, on assure l'inversibilit\'e de la matrice \`a chaque pas
+de temps, mais il
+faudrait v\'erifier si la pression n'est pas susceptible de d\'eriver au cours
+du calcul).
+
+\etape{Termes non pris en compte}
+Les conditions aux limites actuelles
+semblent causer des difficult\'es lors du traitement du terme
+de gradient transpos\'e de la vitesse dans l'\'equation de Navier-Stokes (terme
+trait\'e de mani\`ere explicite en temps). Il est possible de ``d\'ebrancher'' ce terme en positionnant le mot cl\'e \var{IVISSE} \`a $0$. Sa valeur par
+d\'efaut est $1$ (les termes en gradient transpos\'e sont pris en compte).\\
+%\minititre{Remarque}
+On remarquera que l'indicateur \var{IVISSE} active non seulement les termes de gradient
+transpos\'e en
+$(\ ^t\ggrad \underline {v})$, mais \'egalement le terme en
+ $-\,\displaystyle\frac{2}{3}\,\grad(\,\mu_{\,tot}\,\dive\,{\vect{v}})$ avec~:\\
+\begin{equation}
+\mu_{\,tot}=
+\begin{cases}
+\mu_{\,l} & \text{en laminaire ou en mod\`ele $R_{ij}-\varepsilon$}\\
+\mu_{\,l} + \mu_t & \text{en mod\`ele $k-\varepsilon$}.
+\end{cases}
+\end{equation}
diff --git a/doc/theory/covofi.tex b/doc/theory/covofi.tex
new file mode 100644
index 0000000..ecd2e8e
--- /dev/null
+++ b/doc/theory/covofi.tex
@@ -0,0 +1,1277 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{covofi}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Dans ce sous-programme, on r�sout : \\
+{\tiny$\bigstar$} soit l'�quation de convection-diffusion d'un scalaire en
+pr�sence de termes sources :
+%\begin{equation}\label{Base_Covofi_EQ_cvd)
+\begin{equation}
+\frac {\partial (\rho a)}{\partial t} +
+\underbrace{\,\dive\,((\rho \underline{u})\,a)}_{\text{convection}}
+- \underbrace{\,\dive\,(K \grad a)}_{\text{diffusion}} = T_s^{\,imp} a
++T_s^{\,exp} +\Gamma\,a_i
+\end{equation}
+Ici $a$ repr�sente la valeur instantan�e du scalaire en approche laminaire ou,
+en approche RANS, sa moyenne de Reynolds $\widetilde{a}$. Les deux approches
+�tant exclusives et les �quations obtenues similaires, on utilisera le plus
+souvent aussi la notation $a$ pour $\widetilde{a}$.\\
+{\tiny$\bigstar$} soit, dans le cas d'une mod�lisation RANS, la variance de la
+fluctuation d'un scalaire en pr�sence de termes sources\footnote{Davroux A. et
+Archambeau F. : Calcul de la variance des fluctuations
+d'un scalaire dans le solveur commun. Application � l'exp�rience du CEGB dite
+``Jet in Pool'', HE-41/99/043.} :
+\begin{equation}
+\begin{array}{lcl}
+&\displaystyle
+ \frac {\partial (\rho \widetilde{{a"}^2})}{\partial t} +
+\underbrace{\dive\,((\rho\,\underline{u})\ \widetilde{{a"}^2})}_{\text{convection}}
+- \underbrace{\dive\,(K\ \grad \widetilde{{a"}^2})}_{\text{diffusion}} = T_s^{\,imp} \widetilde{{a"}^2}
++T_s^{\,exp} +\ \Gamma\,\widetilde{{a"}^2}_i \\
+&\displaystyle \underbrace {+ 2\,\frac{\mu_t}{\sigma_t}(\grad \widetilde{a})^2 -
+\frac{\rho\,\varepsilon}{R_f k}\ \widetilde{{a"}^2}}_{\text{termes de production et
+de dissipation dus � la turbulence moyenne}}
+\end{array}
+\end{equation}
+$\widetilde{{a"}^2}$ repr\'esente ici la moyenne du carr\'e des fluctuations\footnote{$a$ et
+$\widetilde{{a"}^2}$, sous forme discr\`ete en espace, correspondent donc en
+fait \`a des vecteurs dimensionn\'es \`a \var{NCELET} de composantes $a_I$ et $\widetilde{{a"}^2}_{I}$
+respectivement, I d\'ecrivant l'ensemble des cellules.} de $a$. $K$, $\Gamma$,
+$T_s^{imp}$ et $T_s^{exp}$ repr�sentent respectivement le coefficient de
+diffusion, la valeur du terme source de masse, les termes sources implicite et
+explicite du scalaire $a$ ou $\widetilde{{a"}^2}$. $\mu_t$ et $\sigma_t$
+sont respectivement la viscosit� turbulente et le nombre de Schmidt ou de
+Prandtl turbulent, $\varepsilon$ est la dissipation de l'�nergie turbulente $k$
+et $R_f$ d�finit le rapport constant entre les �chelles dissipatives de $k$ et
+de $\widetilde{{a"}^2}$ ($R_f$ est constant selon le mod�le assez simple adopt� ici).\\
+On �crit les deux �quations pr�c�dentes sous la forme commune suivante~:
+\begin{equation}
+\frac {\partial (\rho f)}{\partial t} + \dive\,((\rho\,\underline{u}) f)
+- \dive\,(K \grad f) = T_s^{\,imp} f + T_s^{\,exp} + \Gamma\,f_i + T_s^{\,pd}
+\end{equation}
+avec, pour $f=a$ ou $f=\widetilde{{a"}^2}$ :\\
+\begin{equation}
+\begin{array}{lll}
+&\displaystyle
+T_s^{\,pd}=
+\begin{cases}
+0 & \text{pour $f=a$}, \\
+2\ \displaystyle \frac{\mu_t}{\sigma_t}(\grad \widetilde{a})^2 -
+\displaystyle \frac{\rho\,\varepsilon}{R_f k}\ \widetilde{{a"}^2} & \text{pour $f=\widetilde{{a"}^2}$ }
+\end{cases}
+\end{array}
+\end{equation}
+
+Le terme $\displaystyle \frac {\partial (\rho f)}{\partial t}$ est d�compos� de la sorte :
+\begin{equation}
+\frac {\partial (\rho f)}{\partial t}=\rho \frac {\partial f}{\partial t} + f
+\frac {\partial \rho}{\partial t}
+\end{equation}
+En utilisant l'�quation de conservation de la masse (cf. \fort{preduv}),
+l'�quation pr�c�dente s'�crit finalement :\\
+\begin{equation}\label{Base_Covofi_Eq_cv_scal}
+\rho\ \displaystyle \frac {\partial f}{\partial t} +
+\dive\,((\rho\,\underline{u})\,f) - \dive\,(K\ \grad f)
+= T_s^{\,imp} f + T_s^{\,exp} + \Gamma (f_i - f) + T_s^{\,pd} + f\,\dive\,(\rho\,\underline{u})
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Pour int�grer l'�quation (\ref{Base_Covofi_Eq_cv_scal}), une discr�tisation temporelle de
+type $\theta$-sch�ma est appliqu�e � la variable r�solue\footnote{Si
+$\theta=1/2$, ou qu'une extrapolation est utilis�e, le pas de temps $\Delta t$
+est suppos� uniforme en temps et en espace.}~:
+\begin{equation}
+f^{n+\theta} = \theta \,\, f^{n+1} + (1-\theta)\,\, f^{n}
+\end{equation}
+
+L'�quation (\ref{Base_Covofi_Eq_cv_scal}) est discr\'etis\'ee au temps $n+\theta$ en
+supposant les termes sources explicites pris au temps $n+\theta_{S}$, et ceux
+implicites en $n+\theta$.
+Par souci de clart�, on suppose, en l'absence d'indication, que les propri�tes
+physiques $\Phi$ ($K,\,\rho$,...) et le flux de masse $(\rho\,\underline{u})$
+sont pris respectivement aux instants $n+\theta_\Phi$ et $n+\theta_F$, o�
+$\theta_\Phi$ et $\theta_F$ d�pendent des sch�mas en temps sp�cifiquement
+utilis�s pour ces grandeurs\footnote{cf. \fort{introd}}.
+
+\begin{equation}
+\begin{array}{lcl}
+&\displaystyle
+ \rho \frac {f^{n+1}-f^{n}}{\Delta t} +
+\underbrace{\dive\,((\rho\,\underline{u})\,f^{n+\theta})}_{\text{convection}}
+- \underbrace{\dive\,(\,K\,\grad f^{n+\theta})}_{\text{diffusion}} =
+T_s^{\,imp}\,f^{n+\theta} + T_s^{\,exp,\,n+\theta_{S}}\\
+& + (\Gamma\,f_i)^{n+\theta_{S}}-\Gamma^{n}\,f^{n+\theta} +\
+T_s^{\,pd,\,n+\theta_S} + f^{n+\theta}\,\dive\,(\rho\underline{u})
+\end{array}
+\end{equation}
+o� :
+\begin{equation}
+ T_s^{\,pd,\,n+\theta_S} =
+\begin{cases}
+0 & \text{pour $f=a$}, \\
+2 \displaystyle \left[\frac{\mu_t}{\sigma_t}(\grad \widetilde{a})^2\right]^{n+\theta_S}-\frac{\rho\,
+\varepsilon^{n}}{R_f\,k^{n}}(\widetilde{{a"}^2})^{n+\theta}& \text{pour $f=\widetilde{{a"}^2}$ }
+\end{cases}
+\end{equation}
+Le terme de production affect� d'un indice $n+\theta_{S}$ est un terme source
+explicite et il est donc trait� comme tel :
+\begin{equation}
+\begin{array}{rll}
+\displaystyle
+\left[\frac{\mu_t}{\sigma_t}(\grad
+\widetilde{a})^2\right]^{n+\theta_{S}}&=&\displaystyle
+(1+\theta_{S})\,\,\frac{\mu_t^{n}}{\sigma_t}(\grad
+\widetilde{a}^{n})^2-\theta_{S}\,\,\frac{\mu_t^{n-1}}{\sigma_t}(\grad
+\widetilde{a}^{n-1})^2\\
+\end{array}
+\end{equation}
+\\
+
+L'�quation (\ref{Base_Covofi_Eq_cv_scal}) s'\'ecrit :
+\begin{equation}\label{Base_Covofi_Eq_scal_tempo}
+\begin{array}{c}
+\displaystyle
+ \rho\,\frac {f^{n+1}-f^{n}}{\Delta t} +
+\theta \,\,\dive\,((\rho\,\underline{u})\,f^{n+1})- \theta \,\,\dive\,(\,K\ \grad f^{n+1})
+\\
+-\left[ \theta\,\, T_s^{\,imp}\,- \theta\,\, \Gamma^{n} + \theta\,\, T_s^{\,pd,\,imp}+\theta\,\,
+\dive\,(\rho\ \underline{u})\right]\,f^{n+1}
+\\
+= (1-\theta)\,\,T_s^{\,imp}\,f^{n} + T_s^{\,exp,\,n+\theta_S} +
+(\Gamma\,f_i)^{n+\theta_S}-(1-\theta)\,\,\Gamma^{n}\,
+f^{n}+ T_s^{\,pd,\,exp}-\theta\,T_s^{\,pd,\,imp}\,f^{n}
+\\
++ (1-\theta) \,\, f^{n}\,\dive\,(\rho\ \underline{u})- (1-\theta) \,\, \dive\,((\rho\,\underline{u})\,f^{n})
++ (1-\theta)\,\, \dive\,(\,K\ \grad f^{n})
+\end{array}
+\end{equation}
+avec :
+\begin{equation}
+T_s^{\,pd,\,imp} =
+\begin{cases}
+0 & \text{pour $f=a$}, \\
+- \displaystyle \frac{\rho\,\varepsilon^n}{R_f \,k^n} & \text{pour $f=\widetilde{{a"}^2}$}
+\end{cases}
+\end{equation}
+\begin{equation}
+T_s^{\,pd,\,exp}=
+\begin{cases}
+0 & \text{pour $f=a$}, \\
+2\ \displaystyle\left[\frac{\mu_t}{\sigma_t}(\grad
+\widetilde{a})^2\right]^{n+\theta_S} -
+\frac{\rho\,\varepsilon^n}{R_f\,k^n}(\widetilde{{a"}^2})^n & \text{pour
+$f=\widetilde{{a"}^2}$}
+\end{cases}
+\end{equation}
+On rappelle que, pour un scalaire $f$, le sous-programme \fort{codits}
+r�sout une �quation du type suivant
+\label{Base_Covofi_Eq_Codits}
+\begin{equation}
+\begin{array}{c}
+\displaystyle f_s^{\,imp} (f^{n+1} - f^{n}) +
+\theta \,\, \dive((\rho\,\underline{u})\,f^{n+1})- \theta \,\, \dive\,(\,K\,\grad f^{n+1})
+\\
+= f_s^{\,exp} -\underbrace{(1-\theta) \,\, \dive((\rho\,\underline{u})\,f^{n}) + (1-\theta)
+\,\, \dive\,(\,K\,\grad f^{n})}_{\text{convection diffusion explicite}}
+\end{array}
+\end{equation}
+$f_s^{exp}$ repr�sente les termes sources discr\'etis\'es de mani\`ere explicite
+en temps (hormis contributions de la convection diffusion explicite provenant du
+$\theta$-sch\'ema) et $f_s^{imp}\,f^{n+1}$ repr\'esente les termes lin\'eaires
+en $f^{n+1}$ dans l'\'equation discr\'etis\'ee en temps.\\
+On r��crit l'�quation (\ref{Base_Covofi_Eq_scal_tempo}) sous la forme (\ref{Base_Covofi_Eq_scal_final})
+qui est ensuite r�solue par \fort{codits}.
+\begin{equation}
+\label{Base_Covofi_Eq_scal_final}
+\begin{array}{c}
+\displaystyle
+\underbrace{\left(\frac {\rho}{\Delta t}- \theta\,\, T_s^{\,imp}+ \theta\,\,
+\Gamma^{n} -\theta\,\, T_s^{\,pd,\,imp} - \theta\,\,
+\dive\,(\rho\,\underline{u})\right)}_{\text {$f_s^{\,imp}$}}\ \delta f^{n+1}
+\\
++\theta\,\, \dive(\,(\rho \underline{u})\,f^{n+1}\,)
+-\theta\,\, \dive\,(K\,\grad \,f^{n+1}) = \\
+\underbrace{T_s^{\,imp}\,f^n + T_s^{\,exp,\,n+\theta_S}
++\,(\Gamma f_i)^{n+\theta_S}\, - \Gamma^{n}\,f^n +\ T_s^{\,pd,\,exp} +
+ f^{n}\,\dive(\rho\,\underline{u})}_{\text{$f_s^{exp}$}}\\
+-(1-\theta)\,\dive(\,(\rho \underline{u})\,f^{n}\,)
++(1-\theta)\,\dive\,(K\,\grad f^{n})
+\end{array}
+\end{equation}
+\\
+%Pour la discr�tisation spatiale de ce syst�me, on pourra se reporter au
+%sous-programme \fort{navsto}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On distingue deux cas suivant le type de sch�ma en temps choisi pour les termes sources :
+\\
+$\bullet$ Si les temres sources ne sont pas extrapol�s, toutes les contributions
+du second membre vont directement dans le vecteur
+\var{SMBRS}.\\
+$\bullet$ Sinon, un vecteur suppl�mentaire est n�cessaire afin de stocker les
+contributions du pas de temps pr�cedent (\var{PROPCE}). Dans ce cas :
+\begin{itemize}
+\item [-] le vecteur \var{PROPCE} sert � stocker les contributions explicites du
+second menbre au temps $n-1$ (pour l'extrapolation en $n+\theta_S$).
+\item [-] le vecteur \var{SMBRS} est compl�t� au fur et � mesure.
+\\
+\end{itemize}
+L'algorithme de ce sous-programme est le suivant :
+\begin{itemize}
+\item mise � z�ro des vecteurs repr�sentants le second membre (\var{SMBRS}) et
+de la diagonale de la matrice (\var{ROVSDT}).
+\item calcul des termes sources du scalaire d�finis par l'utilisateur en
+appelant le sous-programme \fort{ustssc}.
+\\\\
+$\star$ Si les termes sources sont extrapol�s, \var{SMBRS} re�oit $-\theta_S$
+fois la contribution au temps $n-1$ des termes sources qui sont extrapol�s
+(stock�s dans \var{PROPCE}). La contribution des termes sources utisateurs (au
+pas temps courant) est r�partie entre \var{PROPCE} (pour la partie $T_s^{exp}$
+qui est � stocker en vue de l'extrapolation) et \var{SMBRS} (pour la partie
+explicite provenant de l'utilisation du $\theta$ sch�ma pour $T_s^{imp}$). La
+contribution implicite est alors mise dans \var{ROVSDT} (apr�s multiplication
+par $\theta$) quel que soit son signe, afin de ne pas utiliser des
+discr�tisations temporelles diff�rentes entre deux pas de temps successifs, dans
+le cas par exemple o� $T_s^{imp}$ change de signe\footnote{cf. \fort{preduv}}.
+\\\\
+$\star$ Sinon la contibution de $T_s^{exp}$ est directement mise dans
+\var{SMBRS}. Celle de $T_s^{imp}$ est ajout�e � \var{ROVSDT} si elle est
+positive (de mani�re � conserver la dominance de la diagonale), ou explicit�e et
+mise dans le second membre sinon.
+\\
+\item prise en compte des physiques particuli�res : arc �lectrique, rayonnement,
+combustion gaz et charbon pulv�ris�. Seuls les vecteurs \var{ROVSDT} et
+\var{SMBRS} sont compl�t�s (sch�ma d'ordre 1 sans extrapolation).
+\item ajout des termes sources de masse en $\Gamma\,(f_i-f)$ par appel au sous-programme \fort{catsma}.
+\\\\
+$\star$ Si les termes sources sont extrapol�s, le terme explicite en
+$\Gamma\,f_i$ est stock� dans \var{PROPCE}. Le $\theta$-sch�ma est appliqu� au
+terme implicite, puis les contributions implicite et explicite r�parties entre
+\var{ROVSDT} et \var{SMBRS}.
+\\\\
+$\star$ Sinon, la partie implicte en $-\Gamma\,f$ va dans \var{ROVSDT}, et tout le reste dans \var{SMBRS}.
+\\
+\item calcul du terme d'accumulation de masse en $\dive(\rho \underline{u})$ par
+appel \`a \fort{divmas} et ajout de sa contribution dans \var{SMBRS}, et dans
+\var{ROVSDT} apr�s multiplication par $\theta$\footnote{cette op�ration est
+faite quel que soit le sch�ma en temps de fa�on � rester coh�rent avec ce qui
+est fait dans \fort{bilsc2}}.
+
+\item ajout du terme instationnaire � \var{ROVSDT}.
+
+\item calcul des termes de production ($2
+\displaystyle\frac{\mu_t}{\sigma_t}(\grad \widetilde{a})^2$) et de dissipation
+($\displaystyle - \frac{\rho
+\varepsilon}{R_f k}\widetilde{{a"}^2}$) si on �tudie la variance des
+fluctuations d'un scalaire avec un mod�le de turbulence de type
+RANS. Ce calcul s'effectue en calculant pr�alablement
+le gradient du scalaire $f$ par appel au sous-programme \fort{grdcel}.
+\\\\
+$\star$ Si les termes sources sont extrapol�s, la production est mise dans
+\var{PROPCE} puis l'�nergie cin�tique $k$ et la dissipation turbulentes
+$\varepsilon$ sont calcul�es (\var{XK} et \var{XE}) en
+fonction du mod�le de turbulence utilis�. \var{SMBRS} re�oit
+$\displaystyle - \frac{\rho \varepsilon}{R_f k}\widetilde{{a"}^2}$ au temps $n$
+et \var{ROVSDT} le coefficient d'implicitation
+$\displaystyle \frac{\rho \varepsilon}{R_f k}$ apr�s multiplication par
+\var{THETAP} = $\theta$.
+\\\\
+$\star$ Sinon, la production va dans \var{SMBRS}, et la dissipation est r�partie
+de la m\^eme mani�re que pr�c�demment avec \var{THETAP} = 1.
+\\
+\item une fois la contribution de tous les termes sources calcul�s, le second
+membre est assembl�, et le vecteur \var{PROPCE} ajout� apr�s multiplication par
+$1+\theta_S$ � \var{SMBRS}, dans le cas o� les termes sources sont extrapol�s.
+
+\item calcul du coefficient de diffusion $K$ au centre des cellules, et des
+valeurs aux faces par appel au sous-programme \fort{viscfa}.
+
+\item r�solution de l'�quation compl�te (avec les termes de convection
+diffusion) par un appel au sous-programme \fort{codits} avec
+$f_s^{exp}=\var{SMBRS}$ et $f_s^{imp}=\var{ROVSDT}$.
+
+\item ajustement (clipping) du scalaire ou de la fluctuation du scalaire en
+appelant le sous-programme \fort{clpsca}.
+
+\item impression du bilan explicite d'expression
+$||\mathcal{E}_{n}(f^n)\,- \displaystyle \frac {\rho^n}{\Delta t} (\,f^{\,n+1} -
+f^n\,)|| $ , o\`u $|| . ||$ d\'esigne la norme euclidienne.
+\\\\
+\end{itemize}
+
+On r�sume dans les tableaux \ref{Base_Covofi_tab_ext} et \ref{Base_Covofi_tab_exp} les diff�rentes
+contributions (hors convection-diffusion) affect�es � chacun des vecteurs
+\var{PROPCE}, \var{SMBRS} et \var{ROVSDT} suivant le sch�ma en temps choisi pour
+les termes sources. En l'absence d'indication, les propri�t�s physiques
+$\rho,\mu,\,...$ sont suppos�es prises en au temps $n+\theta_\Phi$, et le flux
+de masse $(\,\rho \underline{u})$ pris au temps $n+\theta_F$, les valeurs de
+$\theta_F$ et de $\theta_\Phi$ d�pendant du type de sch�ma s�lectionn�
+sp�cifiquement pour ces grandeurs\footnote{cf. \fort{introd}}.
+\\
+
+\minititre{Avec extrapolation des termes sources :}
+\begin{equation}\label{Base_Covofi_tab_ext}
+\begin{array}{|l|c|}
+\hline
+\var{ROVSDT}^{n} &
+\displaystyle
+\frac{\rho}{\Delta t}-\theta\,T_s^{\,imp}- \theta\,\dive(\,\rho \underline{u}) +
+\theta\,\Gamma^{n}+\theta\,\frac{\rho\,\varepsilon^{n}}{R_f\,k^{n}} \\
+\hline
+\var{PROPCE}^{n} &
+\displaystyle
+T_s^{\,exp,\,n} + \Gamma^{n}\,f_i^{n} + 2\, \frac{\mu_t^{n}}{\sigma_t}(\grad f^{n})^2\\
+\hline
+\var{SMBRS}^{n} &
+\displaystyle
+(1+\theta_S)\,\var{PROPCE}^{n}-\theta_S\,\var{PROPCE}^{n-1}+ T_s^{\,imp}\,f^{n}
++\dive(\,\rho \underline{u})\,f^{n}-\Gamma^{n}\,f^{n} -
+\frac{\rho\,\varepsilon^{n}}{R_f\,k^{n}}\,f^{n}\\
+\hline
+\end{array}
+\end{equation}
+
+\minititre{Sans extrapolation des termes sources :}
+\begin{equation}\label{Base_Covofi_tab_exp}
+\begin{array} {|l|c|}
+\hline
+\var{ROVSDT}^{n} &
+\displaystyle
+\frac{\rho}{\Delta t} + Max(-T_s^{\,imp},0) - \theta\,\dive(\,\rho
+\underline{u}) + \Gamma^{n} + \frac{\rho\,\varepsilon^{n}}{R_f\,k^{n}} \\
+\hline
+\var{SMBRS}^{n} &
+\displaystyle
+T_s^{\,exp} + T_s^{\,imp}\,f^{n}+\dive(\,\rho
+\underline{u})\,f^{n}+\Gamma^{n}\,(\,f_i^{n}-f^{n}) -
+\frac{\rho\,\varepsilon^{n}}{R_f\,k^{n}}\,f^{n} + 2\,
+\frac{\mu_t}{\sigma_t}(\grad f^{n})^2 \\
+\hline
+\end{array}
+\end{equation}
+%\underline{Remarque :}
+%\\
+%Le $\theta$ en facteur du terme de compressibilt� provient de la fa�on dont est compl�t� le second membre lors de l'appel au sous-programme \fort{bilcs2}.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points � traiter}\label{Base_Covofi_section4}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Int�gration du terme de convection-diffusion}
+Dans ce sous-programme, les points litigieux sont dus � l'int�gration du
+terme de convection-diffusion. On renvoie donc le lecteur au sous-programme
+\fort{bilsc2} qui les explicite.
+%\pagebreak
+\clearpage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{ Annexe 1 : Inversibilit\'e de la matrice $\tens{EM}_{\,n}$}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Dans cette section, on va \'etudier plus particuli�rement l'inversibilit\'e de
+la matrice $\tens{EM}_{\,n}$, matrice du syst\`eme lin\'eaire
+\`a r\'esoudre associ\'ee \`a $\mathcal{EM}_{n}$ pour le cas d'un sch�ma en temps
+de type Euler implicite d'ordre un ($\theta=1$). Pour toutes les notations, on
+se reportera � la documentation sur le sous-programme \fort{covofi}.
+On va montrer que la d\'emarche adopt\'ee permet de
+s'assurer que la matrice des syst\`emes de convection-diffusion dans les cas
+courants est toujours inversible.
+
+%%%%%%%%%%%%%%%%
+\subsection{\bf Introduction }
+%%%%%%%%%%%%%%%%
+
+Pour montrer l'inversibilit\'e, on va utiliser le fait que la dominance
+stricte de la diagonale l'implique\footnote{Ce faisant, on choisit cependant une condition forte
+et la d\'emonstration n'est probablement pas optimale.}. On cherche donc \`a
+d\'eterminer sous quelles conditions les matrices de convection diffusion sont
+\`a diagonale strictement dominante.
+
+On va montrer qu'en incluant
+dans la matrice le terme en $\dive(\rho \,\vect{u})$
+issu de $\displaystyle \frac {{\partial}\,\rho}{{\partial}\,t}$, on peut
+\'etablir directement et exactement\footnote{Hormis
+dans le cas de conditions aux limites mixtes, qu'il conviendrait d'examiner plus
+en d\'etail.} la propri\'et\'e. Par contre, si ce terme n'est pas pris en compte dans la matrice,
+il est n\'ecessaire de faire intervenir le pendant discret de la relation~:
+\begin{equation}\label{Base_Covofi_Eq_Div_Int}
+\displaystyle \int_{\Omega_i} \dive (\rho\,\vect{u})\, d\Omega = 0
+\end{equation}
+Cette relation n'est cependant v\'erifi\'ee au niveau discret qu'\`a la pr\'ecision du
+solveur de pression pr\`es (et, en tous les cas, ne peut \^etre approch\'ee au
+mieux
+qu'\`a la pr\'ecision machine pr\`es). Il para\^\i t donc pr\'ef\'erable de s'en
+affranchir. \\
+
+
+Avant d'entrer dans les d\'etails de l'analyse, on rappelle quelques
+propri\'et\'es et d\'efinitions.
+
+Soit $\tens{C}$ une matrice carr\'ee d'ordre N,
+d'\'el\'ement g\'en\'erique $C_{ij}$. On a par d\'efinition~:
+
+$\underline{\text{D\'efinition~:}}$
+La matrice $\tens{C}$ est � diagonale {\bf strictement dominante} {\it ssi}
+\begin{equation}\label{Base_Covofi_Eq_Propriete_1}
+\forall i \in [1,N],\ \ \ |C_{ii}| > \sum\limits_{j=1,\,j\neq i}^{j=N}|C_{ij}|
+\end{equation}
+
+On convient de dire que $\tens{C}$ est � diagonale {\bf simplement dominante} {\it
+ssi} l'in\'egalit\'e n'est pas stricte, soit~:
+\begin{equation}
+\forall i \in [1,N],\ \ \ |C_{ii}| \geqslant \sum\limits_{j=1,\,j\neq i}^{j=N}|C_{ij}|
+\end{equation}
+
+\underline{Remarque :} Si, sur chaque ligne, la somme des \'el\'ements d'une
+matrice est nulle, que les \'el\'ements extradiagonaux sont
+n\'egatifs et que les \'el\'ements diagonaux sont positifs, alors la matrice est
+\`a diagonale simplement dominante. Si la somme est strictement positive, la
+diagonale est strictement dominante.
+
+On a l'implication suivante~:
+
+$\underline{\text{Propri\'et\'e~:}}$
+Si la matrice $\tens{C}$ est � diagonale strictement dominante, elle est
+inversible. \\
+
+Cette propri\'et\'e\footnote{Lascaux, P. et Th�odor,
+R. : Analyse Num�rique Matricielle Appliqu�e � l'art de l'Ing�nieur, Tome 2,
+Ed. Masson.} se d\'emontre simplement si l'on admet le th\'eor\`eme de
+Gerschg\"orin ci-dessous~:
+
+$\underline{\text{Th\'eor\`eme~:}}$
+Soit $\tens{B}$ une matrice carr\'ee d'ordre N dans $\grandC\,\times\,\grandC$,
+d'\'el\'ement g\'en\'erique $B_{\,ij}$, les valeurs propres $\lambda_l$ de $B$ sont, dans
+le plan complexe, telles que
+$||\lambda_l - B_{ii}||_{\,\grandC} \leqslant \sum\limits_{j=1,\,j\neq
+i}^{j=N}{||B_{ij}||_{\,\grandC}}$
+
+Si $B$ est \`a \'el\'ements r\'eels, on \'ecrira $||\lambda_l - B_{ii}||_{\,\grandC}
+\leqslant \sum\limits_{j=1,\,j\neq i}^{j=N}|B_{ij}|$
+
+$\underline{\text{D\'emontration de la propri\'et\'e pr\'ec\'edente~:}}$
+
+Soit $C$ \`a diagonale strictement dominante \`a \'el\'ements r\'eels.
+On montre qu'il est possible
+d'inverser le syst\`eme $CX=S$ d'inconnue $X$, quel que soit le second membre
+$S$. Pour cela, on d\'ecompose $C$ en partie
+diagonale ($D$) et extradiagonale ($-E$) soit~:
+$$C=D-E$$
+$C$ \'etant \`a diagonale strictement dominante, tous
+ses \'el\'ements diagonaux sont non nuls. $D$ est donc inversible (et
+les \'elements de l'inverse sont r\'eels). On
+consid\`ere alors la suite\footnote{On reconna\^\i t la m\'ethode de Jacobi}~:
+
+$$(X^n)_{n\in\grandN}, \text{\hspace*{1cm}avec\hspace*{1cm}} X^0=D^{-1}S
+\text{\hspace*{1cm}et\hspace*{1cm}} DX^n=S+EX^{n-1}$$
+On peut \'ecrire~:
+$$X^n = \sum\limits_{k=0}^{k=n} \left(D^{-1}E\right)^k D^{-1}S$$
+Cette somme converge si
+le rayon spectral de $B=D^{-1}E$ est strictement inf\'erieur \`a 1. Or, la
+matrice $C$ est \`a diagonale strictement dominante. On a donc pour tout $i\in\grandN$
+(\`a partir de la relation (\ref{Base_Covofi_Eq_Propriete_1}) et en
+divisant par $|C_{ii}|$)~:
+$$\forall i \in [1,N],\ \ \ \frac{|C_{ii}|}{|C_{ii}|} > \sum\limits_{j=1,\,j\neq
+i}^{j=N}\frac{|C_{ij}|}{|C_{ii}|}$$ ce qui s'\'ecrit encore~:
+$$\forall i \in [1,N],\ \ \ \frac{|D_{ii}|}{|D_{ii}|} > \sum\limits_{j=1,\,j\neq
+i}^{j=N}\frac{|E_{ij}|}{|D_{ii}|}=\sum\limits_{j=1,\,j\neq
+i}^{j=N}|\left[D^{-1}E\right]_{ij}|$$ ou bien~:
+$$\forall i \in [1,N],\ \ \ 1 > \sum\limits_{j=1,\,j\neq
+i}^{j=N}|B_{ij}|$$ d'o\`u, avec le th\'eor\`eme de Gerschg\"orin, une
+relation sur les valeurs propres $\lambda_l$ de $B$~:
+$$\forall i \in [1,N],\ \ \ ||\lambda_l - B_{ii}||_{\,\grandC} \leqslant \sum\limits_{j=1,\,j\neq i}^{j=N}|B_{ij}| < 1 $$
+et comme $B_{ii}=0$~:
+$$ ||\lambda_l ||_{\,\grandC} < 1 $$
+en particulier, la valeur propre dont la norme est la plus grande v\'erifie
+\'egalement cette
+\'equation. Ceci implique que le rayon spectral de $B$ est strictement
+inf\'erieur \`a 1. La suite $(X^n)_{n\in\grandN}$ converge donc (et la m\'ethode
+de Jacobi converge). Il existe donc une solution \`a l'\'equation $CX=S$. Cette
+solution est unique\footnote{On peut le voir ``par l'absurde''.
+En effet, supposons qu'il existe deux solutions
+distinctes $X_1$ et $X_2$ \`a l'\'equation $CX=S$. Alors $Y=X_2-X_1$ v\'erifie
+$CY=0$, soit $DY=-EY$, donc $D^{-1}EY=-Y$. Ceci signifie que $Y$
+(qui n'est pas nul, par
+hypoth\`ese) est vecteur propre de $D^{-1}E$ avec $\lambda=-1$ pour valeur
+propre associ\'ee. Or, le rayon spectral de $D^{-1}E$ est strictement
+inf\'erieur \`a 1 et $\lambda=-1$ ne peut donc pas \^etre une valeur propre de
+$D^{-1}E$. En cons\'equence, il ne peut exister qu'une seule solution
+\`a l'\'equation $CX=S$.} et la matrice $C$ est donc inversible.
+
+
+%%%%%%%%%%%%%%%%
+\subsection{\bf Avec prise en compte des termes issus de
+$\displaystyle \frac {{\partial}\,\rho}{{\partial}\,t}$ dans $\tens{EM}_{\,n}$}
+%%%%%%%%%%%%%%%%
+\label{Base_Covofi_Avecdrhodt}
+%---------------
+\subsubsection{Introduction}
+%---------------
+Pour montrer que la matrice $\tens{EM}_{\,n}$ est inversible, on va
+montrer qu'elle est \`a diagonale strictement dominante. Pour cela, on
+va consid\'erer successivement les contributions~:\\
+\hspace*{1cm}- des termes diff\'erentiels
+d'ordre 0 lin\'eaires en $\delta f^{\,n+1,k+1}$,\\
+\hspace*{1cm}- des termes issus de la prise en compte de
+$\displaystyle \frac {{\partial}\,\rho}{{\partial}\,t}$,\\
+\hspace*{1cm}- des termes diff\'erentiels d'ordre 1 (convection),\\
+\hspace*{1cm}- des termes diff\'erentiels d'ordre 2 (diffusion).
+
+Pour chacune de ces contributions, on va examiner la
+dominance de la diagonale de l'op\'erateur lin\'eaire associ\'e.
+Si, pour chaque contribution, la dominance de la diagonale est acquise, on pourra
+alors conclure \`a la dominance de la diagonale pour la matrice (somme)
+compl\`ete\footnote{Ce raisonnement n'est pas optimal (la somme de valeurs
+absolues \'etant sup\'erieure \`a la valeur absolue de la somme), mais permet
+d'obtenir des conclusions dans le cas pr\'esent (condition
+suffisante).}
+$\tens{EM}_{\,n}$ et donc \`a son inversibilit\'e.
+
+
+%---------------
+\subsubsection{Contributions des termes diff\'erentiels d'ordre 0 lin\'eaires en
+$\delta f^{\,n+1,k+1}$}
+%---------------
+\label{Base_Covofi_ContributionTermesdOrdre0}
+L'unique contribution est sur la diagonale~: il faut donc v\'erifier qu'elle
+est strictement positive.
+
+Pour chaque ligne $I$, ${f_s^{\,imp}}_I $
+ (cf. (\ref{Base_Covofi_Eq_scal_final})) contient au minimum la quantit\'e strictement
+positive\footnote{Ceci permettra de conclure \`a la stricte dominance de la
+diagonale de la matrice somme compl\`ete $\tens{EM}_{\,n}$.}
+ $\displaystyle \frac {\rho_I^n\ |\Omega_i|}{\Delta t}$.
+Les autres expressions,
+($-\,|\Omega_i|\,(T_s^{\,imp})_I\ $, $\ +|\Omega_i|\, \Gamma_I\ $, $\
+-\,|\Omega_i|\,{(T_s^{\,pd,imp})}_{\,I}$),
+lorsqu'elles existent, contribuent toutes positivement\footnote{Le terme de
+dissipation $\rho\frac{1}{R_f}\,\frac{\varepsilon}{k}$, sp\'ecifique \`a l'�tude de la
+variance des fluctuations, est positif par d�finition et ne remet donc pas en cause la
+conclusion.}.
+
+L'op\'erateur lin\'eaire associ\'e \`a ces contributions
+v\'erifie donc bien la {\bf dominance stricte} de la diagonale (propri\'et\'e
+1). Ce n'est cependant pas vrai si on extrapole les termes source, � cause de
+$T_s^{\,imp}$. Il en r�sulte une contrainte sur la valeur du pas de temps.
+
+%
+%---------------
+\subsubsection{Contributions des termes
+diff\'erentiels d'ordre 1 et des termes issus de la prise en compte de
+$\displaystyle \frac {{\partial}\,\rho}{{\partial}\,t}$}
+%---------------
+\label{Base_Covofi_Contributionsdrhodtconvection}
+Les termes consid\'er\'es sont au nombre de deux dans
+(\ref{Base_Covofi_Eq_scal_tempo})~:\\
+\hspace*{1cm}- la contribution issue de la prise en compte de $\displaystyle
+\frac
+{{\partial}\,\rho}{{\partial}\,t}$ se retrouve dans ${f_s^{\,imp}}_I $
+(\'equation \ref{Base_Covofi_Eq_scal_final}),\\
+\hspace*{1cm}- la contribution du terme de convection
+lin\'earis\'e.
+
+
+Apr\`es int�gration spatiale, la somme de ces deux termes discrets s'\'ecrit~:\\
+%$C^{int}_{IJ}+C^{bord}_{b_{IK}}$, avec~:\\
+\begin{equation}
+\begin{array}{lll}\label{Base_Covofi_Eq_Avec_Faces_Int}
+&\displaystyle \frac{1}{2}\sum\limits_{j\in Vois(i)}\left[(\ -\,m_{\,ij}^n + |\
+m_{\,ij}^n|\ )\,\delta f_I^{\,n+1,k+1}+ (\ m_{\,ij}^n - |\ m_{\,ij}^n|)\,\delta f_J^{\,n+1,k+1}\right]\\
+\end{array}
+\end{equation}
+\begin{equation}\label{Base_Covofi_Eq_Avec_Faces_Bord}
+\begin{array}{lll}
+&+\displaystyle\frac{1}{2}\sum\limits_{k\in {\gamma_b(i)}}\left[(\ -\,
+m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\,\delta f_I^{\,n+1,k+1} + (\
+m_{\,{b}_{ik}}^n - |m_{\,{b}_{ik}}^n|)\,\delta f_{\,{b}_{ik}}^{\,n+1,k+1}\right]\\
+\end{array}
+\end{equation}
+
+Pour chaque ligne $I$, on va chercher les propri\'et\'es de dominance de la
+diagonale en traitant s\'epar\'ement les faces internes (\'equation
+(\ref{Base_Covofi_Eq_Avec_Faces_Int})) et les faces de bord
+(\'equation~(\ref{Base_Covofi_Eq_Avec_Faces_Bord})).
+
+\hspace*{0.5cm}$\bullet$ la contribution des {\bf faces internes} $ij$ (facteur de $\delta
+f_I^{\,n+1,k+1}$) � la diagonale est positive ; la contribution aux
+extradiagonales est n�gative (facteur de $\delta f_J^{\,n+1,k+1}$)
+et la somme de ces contributions est exactement nulle (\'equation~
+(\ref{Base_Covofi_Eq_Avec_Faces_Int})). Si l'on note $C_{IJ}$ les coefficients de la matrice
+issus de la contribution de ces termes, on a donc $|C_{II}| \geqslant
+\sum\limits_{J=1,\,J\neq I}^{J=N}|C_{IJ}|$ qui traduit la {\bf dominance ``simple''}
+(l'in\'egalit\'e n'est pas ``stricte'') de la diagonale et r\`egle la question
+des contributions des faces internes.
+
+\hspace*{0.5cm}$\bullet$ la contribution des {\bf faces de bord} doit \^etre
+r\'e\'ecrite en utilisant l'expression des conditions aux limites sur $f$
+pour pr\'eciser la valeur de $\delta f_{\,b_{ik}}$ (on omet
+l'exposant $(\,n+1,k+1)$ pour all\'eger les notations)~: \\
+$\hspace*{1.5cm}$ - pour une condition de Dirichlet : $\delta f_{\,b_{ik}}\,=\,0$,\\
+$\hspace*{1.5cm}$ - pour une condition de Neumann : $\delta f_{\,b_{ik}}\,=\,\delta f_I$, \\
+$\hspace*{1.5cm}$ - pour une condition mixte ($f_{\,b_{ik}}\,=\,\alpha\,+\,\beta f_i$) : $\delta
+f_{\,b_{ik}}\,=\,\beta\ \delta f_I$.\\
+
+\hspace*{1cm}Pour la contribution des faces de bord, il faut alors consid\'erer deux cas de
+figure possibles.
+\begin{itemize}
+
+\item {\bf Le flux de masse au bord est positif ou nul}
+($\ m_{\,{b}_{ik}}^n = (\rho\
+\underline{u})^{n}_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}} \geqslant 0$). Cette
+situation correspond par exemple aux sorties standards (fluide sortant du
+domaine), aux sym\'etries ou aux parois \'etanches (flux de masse nul). Les contributions aux
+faces de bord sont alors toutes nulles, quelles que soient les conditions aux limites
+portant sur la variable $f$. En cons\'equence, la diagonale issue de ces
+contribution est {\bf simplement dominante}.
+\hspace*{0.5cm}
+\item {\bf Le flux de masse au bord est strictement n�gatif}. Cette situation
+correspond \`a une entr\'ee de fluide dans
+le domaine. Les contributions consid\'er\'ees s'\'ecrivent alors~:
+\begin{equation}
+\displaystyle\sum\limits_{k\in {\gamma_b(i)}}\left[(\ -\,
+m_{\,{b}_{ik}}^n\ )\,\delta f_I^{\,n+1,k+1} + (\
+m_{\,{b}_{ik}}^n\ )\,\delta f_{\,{b}_{ik}}^{\,n+1,k+1}\right]
+\end{equation}
+Il convient alors de distinguer plusieurs situations, selon le type de condition
+\`a la limite portant sur $f$~: \\
+\hspace*{1.cm} {\tiny$\bigstar$} si la condition � la limite de $f$ est de type
+{\bf Dirichlet}, seule subsiste une contribution positive ou nulle � la diagonale, qui assure
+donc la {\bf dominance simple}~:
+\begin{equation}
+\displaystyle\sum\limits_{k\in {\gamma_b(i)}}(\ -\,
+m_{\,{b}_{ik}}^n\ )\,\delta f_I^{\,n+1,k+1}
+\end{equation}
+\hspace*{1.cm} {\tiny$\bigstar$} si la condition � la limite de $f$ est de type
+ {\bf Neumann}, la somme des contributions dues aux faces de bord
+est alors nulle, ce qui assure
+donc la {\bf dominance simple}.\\
+\hspace*{1.cm} {\tiny$\bigstar$} si la condition � la limite de $f$ est de type
+{\bf mixte}, la contribution des faces de bord est sur la diagonale et vaut~:
+\begin{equation}
+\displaystyle \frac{1}{2}\sum\limits_{k \in \gamma_b(i)}(1-\beta)
+(\ -\,m_{\,{b}_{ik}}^n\ )\,\delta f_I^{\,n+1,k+1}
+\end{equation}
+On ne peut pas se prononcer quand \`a la dominance de la diagonale, \`a
+cause de la pr\'esence de $(1-\beta)$ (la valeur de $\beta$ est fix\'ee par
+l'utilisateur) et la d\'emarche adopt\'ee ici
+{\bf ne permet donc pas de conclure}. Il faut n\'eanmoins noter que cette
+situation est rare dans les calculs standards. Elle demande un
+compl\'ement d'analyse et sera pour le moment exclue des
+consid�rations expos\'ees dans le pr\'esent document.\\
+\end{itemize}
+
+{\bf On peut conclure}, quand il n'y a pas de condition \`a la limite de type mixte,
+que la matrice associ\'ee aux contributions des termes
+diff\'erentiels d'ordre 1 (convectifs) et \`a la prise en compte des termes
+issus de $\displaystyle \frac{{\partial}\,\rho}{{\partial}\,t}$ et est \`a
+diagonale {\bf simplement dominante}.
+
+
+
+
+%---------------
+\subsubsection{Contributions des termes diff\'erentiels d'ordre 2}
+%---------------
+
+On va consid\'erer enfin les contributions des termes diff\'erentiels
+d'ordre 2 (issus du terme \\
+$-\ \dive\,(K^n\ \grad \delta f^{\,n+1,k+1})$).
+Pour ces termes, la contribution � la
+diagonale est positive\footnote{\label{Base_Covofi_transmittivite}Ceci n'est en fait pas
+toujours
+vrai. En effet, pour chaque face $ij$, la transmittivit\'e
+$\frac{K^n}{\overline{I'J'}}S_{ij}$
+fait intervenir la mesure alg\'ebrique du segment $I'J'$, o\`u $I'$ et $J'$
+sont les projet\'es orthogonaux sur la normale \`a la face du centre
+des cellules voisines. Cette
+grandeur est une valeur alg\'ebrique et peut th\'eoriquement devenir
+n\'egative sur certains maillages pathologiques, contenant par exemple des
+mailles non convexes. On pourra se reporter au dernier point \`a traiter du sous-programme
+\fort{matrix}.},
+n�gative aux extradiagonales$^{\text{\scriptsize \thefootnote}}$, compte tenu de~:
+\begin{equation}
+\begin{array}{ll}
+&\int_{\Omega_i}-\ \dive\,(K^n\ \grad \delta f^{\,n+1,k+1})\,d\Omega\\
+&= -\sum\limits_{j \in Vois(i)} K_{\,ij}^n
+\displaystyle \frac{\delta f_{J}^{\,n+1,k+1} -\,\delta f_{I}^{\,n+1,k+1}}{\overline{I'J'}}\,.\,S_{ij}
+-\sum\limits_{k \in \gamma_b(i)} K_{\,b_{ik}}^n
+\displaystyle\frac{\delta f_{\,b_{ik}}^{\,n+1,k+1} -\,\delta f_{I}^{\,n+1,k+1}}{\overline{I'F}}\,.\,
+S_{b_{ik}}
+\end{array}
+\end{equation}
+
+
+
+Consid\'erons deux cas~:\\
+\hspace*{1cm}- la cellule courante $I$ n'a {\bf que des faces internes} au domaine de
+calcul (pas de faces de bord). La somme des contributions est nulle. On a donc
+{\bf dominance simple} de la diagonale. \\
+\hspace*{1cm}- la cellule courante $I$ a {\bf des faces de bord}. La somme des
+contributions diagonales et extradiagonales est positive quand on a une
+condition \`a la limite de type {\bf Dirichlet} ou de type {\bf Neumann} sur $f$. La
+diagonale est alors {\bf strictement dominante}.
+Lorsqu'il y a des conditions � la limite de type mixte, il n'est plus possible
+de conclure (situation \'ecart\'ee pr\'ec\'edemment).\\
+
+{\bf On peut conclure}, quand il n'y a pas de condition \`a la limite de type mixte,
+que la matrice associ\'ee aux contributions des termes diff\'erentiels d'ordre 2
+ est au moins \`a diagonale {\bf simplement dominante}.
+
+
+
+%---------------
+\subsubsection{Conclusion}
+%---------------
+En travaillant sur
+des maillages non pathologiques (\`a transmittivit\'e positive, voir la note de
+bas de page num\'ero \ref{Base_Covofi_transmittivite}) et en n'imposant pas de condition \`a la limite
+de type mixte sur les variables, on peut donc conclure que
+$\tens{EM}_{\,n}$ est la somme de matrices \`a diagonale simplement
+dominante et d'une matrice \`a diagonale strictement dominante (paragraphe
+\ref{Base_Covofi_ContributionTermesdOrdre0}). Elle est donc \`a {\bf diagonale strictement
+dominante}, et donc {\bf inversible} (de plus, la
+m\'ethode it\'erative de Jacobi converge).
+
+
+\subsection{\bf Sans prise en compte des termes issus de
+$\displaystyle \frac {{\partial}\,\rho}{{\partial}\,t}$ dans
+$\tens{EM}_{\,n}$}
+
+
+%---------------
+\subsubsection{Introduction}
+%---------------
+
+Pour identifier les cas dans lesquels la matrice $\tens{EM}_{\,n}$ est
+inversible, on va rechercher les
+conditions qui assurent la dominance de la diagonale. Par rapport \`a l'analyse
+pr\'esent\'ee au paragraphe \ref{Base_Covofi_Avecdrhodt}, seules diff\`erent les
+consid\'erations relatives aux contributions des termes diff\'erentiels d'ordre
+1, puisqu'elles sont trait\'ees au paragraphe
+\ref{Base_Covofi_Contributionsdrhodtconvection} avec les termes issus de la prise en compte
+de $\displaystyle\frac {{\partial}\,\rho}{{\partial}\,t}$.
+
+%---------------
+\subsubsection{Contributions des termes diff\'erentiels d'ordre 1}
+%---------------
+
+La contribution du terme de convection est la seule \`a prendre en compte. Elle
+s'\'ecrit, d'apr�s les �quations (\ref{Base_Covofi_Eq_scal_final}) et la discr�tisation
+explicit�e pour le sous-programme \fort{covofi} :
+\begin{equation}\label{Base_Covofi_Eq_Sans_Faces_Int}
+\displaystyle\frac{1}{2}\sum\limits_{j\in Vois(i)}\left[(\ +\,m_{\,ij}^n + |\
+m_{\,ij}^n|\ )\,\delta f_I^{\,n+1,k+1}+ (\ m_{\,ij}^n - |\ m_{\,ij}^n|)\,\delta f_J^{\,n+1,k+1}\right]
+\end{equation}
+\begin{equation}\label{Base_Covofi_Eq_Sans_Faces_Bord}
+\displaystyle\frac{1}{2}\sum\limits_{k\in {\gamma_b(i)}}\left[(\ +\,
+m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\,\delta f_I^{\,n+1,k+1} + (\
+m_{\,{b}_{ik}}^n - |m_{\,{b}_{ik}}^n|)\,\delta f_{\,{b}_{ik}}^{\,n+1,k+1}\right]
+\end{equation}
+
+
+On constate que pour chaque ligne $I$, la contribution des faces
+internes (facteur de $\delta f_I^{\,n+1,k+1}$) \`a la diagonale est positive et
+qu'elle est n\'egative aux extradiagonales (facteur de $\delta
+f_J^{\,n+1,k+1}$). {\bf Cependant}, contrairement au cas pr\'esent\'e au
+paragraphe~\ref{Base_Covofi_Contributionsdrhodtconvection}, la
+somme de ces contributions n'est pas nulle dans le cas g\'en\'eral. Pour obtenir
+un r\'esultat quant \`a la dominance de la diagonale, il faut faire intervenir
+la version discr\`ete de la propri\'et\'e (\ref{Base_Covofi_Eq_Div_Int})
+rappel\'ee ci-dessous~: $$\displaystyle \int_{\Omega_i} \dive (\rho\,\vect{u})\,
+d\Omega = 0$$
+Soit, sous forme discr\`ete~:
+\begin{equation}\label{Base_Covofi_Eq_Continuite_discrete}
+\sum\limits_{j\in Vois(i)}\,m_{\,ij}^n
++ \sum\limits_{k\in {\gamma_b(i)}}\,m_{\,{b}_{ik}}^n\ = 0
+\end{equation}
+
+Il n'est donc pas possible d'analyser
+s\'epar\'ement les contributions des faces internes et celles des faces
+de bord (contrairement \`a la situation rencontr\'ee au
+paragraphe~\ref{Base_Covofi_Contributionsdrhodtconvection}). On se place ci-apr\`es dans le
+cas g\'en\'eral d'une cellule qui a des faces internes {\em et} des faces de
+bord (si elle n'a que des faces internes, la d\'emonstration est la m\^eme, mais
+plus simple. On peut l'\'ecrire en consid\'erant formellement que la cellule
+``a z\'ero faces de bord'', c'est \`a dire que $\gamma_b(i)$ est l'ensemble vide). \\
+
+Il faut alors consid\'erer deux cas de figure, selon la valeur du flux de masse
+aux faces de bord (\'eventuelles) de la cellule~:
+\begin{itemize}
+
+\item {\bf Le flux de masse au bord est positif ou nul} ($\ m_{\,{b}_{ik}}^n = (\rho\
+\underline{u})^{n}_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}} \geqslant 0$). Cette
+situation correspond \`a des cellules qui ont des faces de bord de sortie
+standard (fluide sortant du
+domaine), de sym\'etrie ou de paroi \'etanche (flux de masse nul). Les
+contributions s'\'ecrivent alors~:
+\begin{equation}
+\displaystyle\frac{1}{2}\sum\limits_{j\in Vois(i)}\left[(\ +\,m_{\,ij}^n + |\
+m_{\,ij}^n|\ )\,\delta f_I^{\,n+1,k+1}+ (\ m_{\,ij}^n - |\ m_{\,ij}^n|)\,\delta f_J^{\,n+1,k+1}\right]
++\sum\limits_{k\in {\gamma_b(i)}}\ m_{\,{b}_{ik}}^n \,\delta f_I^{\,n+1,k+1}
+\end{equation}
+Dans ce cas, la somme des contributions \`a la diagonale est positive, les
+contributions aux extradiagonales sont n\'egatives et, avec la relation
+(\ref{Base_Covofi_Eq_Continuite_discrete}), on v\'erifie que la somme des contributions
+diagonales et extradiagonales est nulle. On a donc {\bf dominance simple} de la
+diagonale.
+\item {\bf Le flux de masse au bord est strictement n�gatif}. Cette situation
+correspond \`a des cellules qui ont des faces de bord d'entr\'ee standard
+(entr\'ee de fluide dans le domaine).
+Les contributions consid\'er\'ees s'\'ecrivent alors~:
+\begin{equation}
+\displaystyle\frac{1}{2}\sum\limits_{j\in Vois(i)}\left[(\ +\,m_{\,ij}^n + |\
+m_{\,ij}^n|\ )\,\delta f_I^{\,n+1,k+1}+ (\ m_{\,ij}^n - |\ m_{\,ij}^n|)\,\delta f_J^{\,n+1,k+1}\right]
++\sum\limits_{k\in {\gamma_b(i)}}\ m_{\,{b}_{ik}}^n \,\delta f_{\,{b}_{ik}}^{\,n+1,k+1}
+\end{equation}
+Il convient alors de distinguer plusieurs situations, selon le type de condition
+\`a la limite portant sur $f$ (on omet
+l'exposant $(\,n+1,k+1)$ pour all\'eger les notations)~:\\
+$\hspace*{1.cm}$- pour une condition de Dirichlet : $\delta f_{\,b_{ik}}\,=\,0$, \\
+$\hspace*{1.cm}$- pour une condition de Neumann : $\delta f_{\,b_{ik}}\,=\,\delta f_I$, \\
+$\hspace*{1.cm}$- pour une condition mixte
+($f_{\,b_{ik}}\,=\,\alpha\,+\,\beta f_I$) : $\delta f_{\,b_{ik}}\,=\,\beta\
+\delta f_I$.\\
+Selon le cas on se trouve dans une des situations suivantes~:\\
+\hspace*{1.cm} {\tiny$\bigstar$} si la condition � la limite de $f$ est de type
+{\bf Dirichlet}, la contribution des faces de bord est nulle dans la matrice. La
+contribution des faces internes \`a la diagonale est positive, la contribution
+aux extradiagonales n\'egative et la somme de ces contributions vaut
+$\sum\limits_{j\in Vois(i)}\,m_{\,ij}^n$, soit avec la relation
+(\ref{Base_Covofi_Eq_Continuite_discrete})~:
+$$\sum\limits_{j\in Vois(i)}\,m_{\,ij}^n=-\sum\limits_{k\in {\gamma_b(i)}}\
+m_{\,{b}_{ik}}^n $$ Elle est strictement positive et la diagonale est donc
+{\bf strictement dominante}.\\
+\hspace*{1.cm} {\tiny$\bigstar$} si la condition � la limite de $f$ est de type
+{\bf Neumann}, la contribution des faces de bord se r�duit au terme~:
+$
+\sum\limits_{k\in {\gamma_b(i)}}\ m_{\,{b}_{ik}}^n \,\delta f_I^{\,n+1,k+1}
+$.
+La somme des contributions \`a la diagonale est alors~$SC_{i}$:
+$$SC_{i}=\frac{1}{2}\sum\limits_{j\in Vois(i)}(\ +\,m_{\,ij}^n + |\ m_{\,ij}^n|\ )
++\sum\limits_{k\in {\gamma_b(i)}}\ m_{\,{b}_{ik}}^n $$
+En utilisant deux fois la relation (\ref{Base_Covofi_Eq_Continuite_discrete}), on obtient donc pour la
+diagonale~:
+$$SC_{i}=\frac{1}{2}\left[\sum\limits_{j\in Vois(i)}|\ m_{\,ij}^n|
++\sum\limits_{k\in {\gamma_b(i)}}\
+m_{\,{b}_{ik}}^n\right]=\frac{1}{2}\left[\sum\limits_{j\in Vois(i)}(\ |\ m_{\,ij}^n|-\ m_{\,ij}^n\ )\right]$$
+Cette grandeur est positive et \'egale \`a l'oppos\'e de la somme des termes
+extradiagonaux qui sont tous n\'egatifs. La diagonale est donc
+{\bf simplement dominante}.\\
+\hspace*{1.cm} {\tiny$\bigstar$} si la condition � la limite de $f$ est de type
+{\bf mixte}, la somme des contributions dues aux faces de bord est~:\\
+\begin{equation}
+\sum\limits_{k \in \gamma_b(i)}\beta \ m_{\,{b}_{ik}}^n \ \delta f_I^{\,n+1,k+1}
+\end{equation}
+On ne peut donc {\bf pas conclure} quant au signe de cette contribution, le facteur
+$\beta$ \'etant choisi librement par l'utilisateur. Cette situation a \'et\'e
+\'ecart\'ee dans le paragraphe \ref{Base_Covofi_Avecdrhodt}.\\
+
+\end{itemize}
+
+{\bf On peut donc conclure}, quand il n'y a pas de condition \`a la limite de type mixte,
+que la matrice associ\'ee aux contributions
+ des termes
+diff\'erentiels d'ordre 1 (convectifs) est \`a diagonale {\bf simplement
+dominante}, \`a condition que la relation (\ref{Base_Covofi_Eq_Continuite_discrete}) soit
+v\'erifi\'ee exactement.
+
+
+%---------------
+\subsubsection{Conclusion}
+%---------------
+En travaillant sur
+des maillages non pathologiques (\`a transmittivit\'e positive, voir la note de
+bas de page num\'ero \ref{Base_Covofi_transmittivite}) et en n'imposant pas de condition \`a la limite
+de type mixte sur les variables, on peut donc conclure que
+$\tens{EM}_{\,n}$
+est \`a {\bf diagonale strictement dominante}, donc {\bf inversible} (et la
+m\'ethode it\'erative de Jacobi converge) \`a condition que la relation
+(\ref{Base_Covofi_Eq_Continuite_discrete}) soit
+v\'erifi\'ee exactement. Ce n'est g\'en\'eralement pas le cas (la pr\'ecision du
+solveur de pression et la pr\'ecision machine sont finies). M\^eme si
+la contribution diagonale en
+$\displaystyle \frac {\rho_I^n\ |\Omega_i|}{\Delta t}$ peut suffire \`a
+assurer la dominance, on a cependant souhait\'e, dans \CS, s'affranchir du
+probl\`eme potentiel en prenant en compte les termes issus de $\displaystyle \frac
+{{\partial}\,\rho}{{\partial}\,t}$ dans la matrice.
+
+\newpage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{ Annexe 2 : Remarques \`a propos du respect du principe du maximum discret}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%---------------
+\subsection{Introduction}
+%---------------
+%
+Les consid\'erations expos\'ees ici sont relatives au fait que, en continu,
+une variable qui n'est {\em que} convect\'ee par un champ de d\'ebit \`a
+divergence nulle doit rester dans les bornes minimales et maximales d\'efinies
+par les conditions initiales et par les conditions aux limites en espace. Ainsi,
+les valeurs d'un scalaire passif initialement nul
+dont les conditions aux limites sont des conditions de Neumann homog\`ene
+et des conditions de Dirichlet de valeur 1 devront n\'ecessairement rester
+comprises dans l'intervalle $[0\,;\,1]$. C'est ce que l'on entend ici par
+``principe du maximum''.
+
+Soient $\vect{u}$ un champ de vitesse fig\'e et connu et $t$ un r\'eel
+positif. On consid\`ere le
+probl\`eme mod\`ele $\mathcal{P}$ de convection des variables scalaires $\rho$ et $\rho\,f$, d\'efini par :
+\begin{equation}
+\left\{\begin{array}{ll}
+&\displaystyle \frac {\partial \rho}{\partial t} + \,\dive\,(\rho\,\underline{u}) = 0\\
+&\displaystyle \frac {\partial (\rho f)}{\partial t} + \,\dive\,((\rho\,\underline{u})\,f) = 0
+\end{array}\right.
+\end{equation}
+avec une condition initiale $f^0$ donn\'ee ainsi que des conditions aux
+limites associ\'ees sur $f$ de type Dirichlet ou Neumann.\\
+Dans \CS , la deuxi\`eme \'equation de $\mathcal{P}$ est r\'e\'ecrite en
+continu, en utilisant la premi\`ere, sous la forme :\\
+\begin{equation}
+\displaystyle \rho\,\frac {\partial f}{\partial t} -
+f\,\dive\,(\rho\,\underline{u}) + \,\dive\,((\rho\,\underline{u})\,f) = 0
+\end{equation}
+et discr\'etis\'ee temporellement comme suit :
+\begin{equation}\label{Base_Covofi_Eq_Avec_Temp}
+\displaystyle \rho^n \,\frac {\,f^{n+1} -\,f^n}{\Delta t} -
+f^{n+1}\,\dive\,(\rho\,\underline{u})^n + \,\dive\,((\rho\,\underline{u})^n\,f^{n+1}) = 0
+\end{equation}
+Dans un premier temps, on va \'etudier la discr\'etisation spatiale associ\'ee
+\`a (\ref{Base_Covofi_Eq_Avec_Temp}), qui correspond donc \`a la prise en compte de la
+contribution de $\displaystyle\frac{\partial \rho}{\partial t}$ dans
+l'\'equation en continu (et se traduit par la pr\'esence de
+$-\dive((\rho\,\underline{u})^{n})$ dans l'expression de ${f_s^{\,imp}}_I $),
+puis dans un deuxi\`eme temps, la discr\'etisation spatiale de l'expression ;\\
+\begin{equation}\label{Base_Covofi_Eq_Sans_Temp}
+\displaystyle \rho^n \,\frac {\,f^{n+1} -\,f^n}{\Delta t} +
+\,\dive\,((\rho\,\underline{u})^n\,f^{n+1}) = 0
+\end{equation}
+qui correspond \`a un probl\`eme de convection pure classique.
+
+On \'etudiera ensuite un exemple simplifi\'e (monodimensionnel \`a masse
+volumique constante).
+
+
+Les consid\'erations pr\'esentes m\'eriteraient d'\^etre approfondies.
+
+
+%==============
+\subsection{Cas g\'en\'eral}
+%==============
+
+
+%-------------
+\subsubsection {Discr\'etisation spatiale de $ \displaystyle \rho^n \,\frac {\,f^{n+1} -\,f^n}{\Delta t} -
+f^{n+1}\,\dive\,(\rho\,\underline{u})^n +
+\,\dive\,((\rho\,\underline{u})^n\,f^{n+1}) = 0$}
+%-------------
+
+En int\'egrant sur une cellule $\Omega_i$ \`a l'aide de la formulation volumes
+finis habituelle, on obtient :
+\begin{equation}
+\begin{array}{lll}
+&\displaystyle\int_{\Omega_i}[\displaystyle \rho^n \,\frac {\,f^{n+1} -\,f^n}{\Delta t} -
+f^{n+1}\,\dive\,(\rho\,\underline{u})^n +
+\,\dive\,((\rho\,\underline{u})^n\,f^{n+1})]\ d\Omega \\
+&= \left[\rho_I^n\ \displaystyle\ \frac{|\Omega_i|}{\Delta t} -
+(\sum\limits_{j\in Vois(i)}(\rho\
+\underline{u})^{n}_{ij}\,.\,\underline{S}_{ij} + \sum\limits_{k\in
+{\gamma_b(i)}}(\rho\
+\underline{u})^{n}_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}}\,)\right]\, f_I^{\,n+1} \\
+&+\sum\limits_{j\in Vois(i)} (\rho\
+\underline{u})^{n}_{ij}\,.\,\underline{S}_{ij}\,
+f^{\,n+1}_{f\,ij}+\sum\limits_{k\in {\gamma_b(i)}} (\rho\
+\underline{u})^{n}_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}}\,f^{\,n+1}_{f\,{b_{\,ik}}}
+\\
+&-\rho_I^n\ \displaystyle\ \frac{|\Omega_i|}{\Delta t}\,f_I^n \\
+\end{array}
+\end{equation}
+o� $f^{\,n+1}_{f\,ij}$ et $f^{\,n+1}_{f\,{b_{\,ik}}}$ sont les valeurs de $f$
+aux faces internes et de bord issues du choix du sch�ma convectif.
+
+En reprenant les notations pr\'ec\'edentes, en imposant un sch\'ema d\'ecentr\'e
+amont au premier membre ({\it i.e.} en exprimant $\delta f_{\,ij}^{\,n+1,k+1}$ et
+$\delta f_{\,{b}_{ik}}^{\,n+1,k+1}$) et en raisonnant en incr\'ements
+(cf. sous-programme \fort{navsto}), on aboutit \`a :
+\begin{equation}
+\begin{array}{lll}
+&\rho_I^n\,\displaystyle\ \frac{|\Omega_i|}{\Delta
+t}\,\delta f_I^{\,n+1,k}\\
+& +\displaystyle\frac{1}{2}\sum\limits_{j\in Vois(i)}\left[(\
+-\,m_{\,ij}^n + |\ m_{\,ij}^n|\ )\,\delta f_I^{\,n+1,k+1}+ (\ m_{\,ij}^n - |\ m_{\,ij}^n|)\,\delta f_J^{\,n+1,k+1}\right]\\
+&+\displaystyle\frac{1}{2}\sum\limits_{k\in {\gamma_b(i)}}\left[(\ -\,
+m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\,\delta f_I^{\,n+1,k+1} + (\
+m_{\,{b}_{ik}}^n - |m_{\,{b}_{ik}}^n|)\,\delta
+f_{\,{b}_{ik}}^{\,n+1,k+1}\right]\\
+& =\ -\ \displaystyle \rho^n \,\frac {|\Omega_i| }{\Delta t}\,(\,f_I^{\,n+1,k}
+-\,f_I^n\,)\\
+& - \left[\sum\limits_{j\in Vois(i)} (\rho\ \underline{u})^{n}_{ij}\,.\,\underline{S}_{ij}\, f^{\,n+1,k}_{\,ij}+\sum\limits_{k\in {\gamma_b(i)}} (\rho\
+\underline{u})^{n}_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}}\,f^{\,n+1,k}_{\,{b_{ik}}}\right]\\
+&-\left(\sum\limits_{j\in Vois(i)} (\rho\ \underline{u})^{n}_{ij}\,.\,\underline{S}_{ij}+\sum\limits_{k\in {\gamma_b(i)}} (\rho\
+\underline{u})^{n}_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}}\right)\,f_I^{\,n+1,k}
+\end{array}
+\end{equation}
+avec :
+\begin{equation}
+\left\{\begin{array}{ll}
+f_I^{\,n+1,0} = f_I^{\,n}\\
+\delta f_I^{\,n+1,k+1} = f_I^{\,n+1,k+1} - f_I^{\,n+1,k},{\text {$k\in \grandN$}}
+\end{array}\right.
+\end{equation}
+et $(f^{\,n+1,k})_{k\in \grandN}$ suite convergeant vers $f^{\,n+1}$, $n$
+entier donn\'e, solution de (\ref{Base_Covofi_Eq_Avec_Temp}) .\\
+
+ \newpage
+%-------------
+\subsubsection {Discr\'etisation spatiale de
+ $ \displaystyle \rho^n \,\frac {\,f^{n+1} -\,f^n}{\Delta t} +\,\dive\,((\rho\,\underline{u})^n\,f^{n+1}) = 0$}
+%-------------
+
+En proc\'edant de fa\c con analogue et en adoptant les m\^emes hypoth\`eses, on
+obtient :
+\begin{equation}
+\begin{array}{lll}
+&\rho^n\,\displaystyle\ \frac{|\Omega_i|}{\Delta
+t}\,\delta f_I^{\,n+1,k+1}\\
+& +\displaystyle\frac{1}{2}\sum\limits_{j\in Vois(i)}\left[(\
++\,m_{\,ij}^n + |\ m_{\,ij}^n|\ )\,\delta f_I^{\,n+1,k+1}+ (\ m_{\,ij}^n - |\
+m_{\,ij}^n|)\,\delta f_J^{\,n+1,k+1}\right]\\
+&+\displaystyle\frac{1}{2}\sum\limits_{k\in {\gamma_b(i)}}\left[(\ +\,
+m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\,\delta f_I^{\,n+1,k+1} + (\
+m_{\,{b}_{ik}}^n - |m_{\,{b}_{ik}}^n|)\,\delta
+f_{\,{b}_{ik}}^{\,n+1,k+1}\right]\\
+& =\ -\ \displaystyle \rho^n \,\frac {|\Omega_i| }{\Delta t}\,(\,f_I^{\,n+1,k}
+-\,f_I^n\,)\\
+& - \left[\sum\limits_{j\in Vois(i)} (\rho\
+\underline{u})^{n}_{ij}\,.\,\underline{S}_{ij}\,
+f^{\,n+1,k}_{f\,ij}+\sum\limits_{k\in {\gamma_b(i)}} (\rho\
+\underline{u})^{n}_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}}\,f^{\,n+1,k}_{f\,{b_{ik}}}\right]
+\end{array}
+\end{equation}
+(o� $f^{\,n+1}_{f\,ij}$ et $f^{\,n+1}_{f\,{b_{\,ik}}}$ sont les valeurs de $f$
+aux faces internes et de bord issues du choix du sch�ma convectif)
+
+avec :
+\begin{equation}
+\left\{\begin{array}{ll}
+f_I^{\,n+1,0} = f_I^{\,n}\\
+\delta f_I^{\,n+1,k+1} = f_I^{\,n+1,k+1} - f_I^{\,n+1,k},{\text {$k\in \grandN$}}
+\end{array}\right.
+\end{equation}
+et $(f^{\,n+1,k})_{k\in \grandN}$ suite convergeant vers $f^{\,n+1}$, $n$
+entier donn\'e, solution de (\ref{Base_Covofi_Eq_Sans_Temp}) .\\
+
+%=============
+\subsection{Exemple pour le principe du maximum}
+%=============
+
+On va maintenant se placer en monodimensionnel, sur un maillage r\'egulier
+form\'e de trois cellules de pas $h$ constant (figure \ref{Base_Covofi_domaine1d_fig}) et \'etudier le comportement
+du premier membre pour les deux types d'expressions, entre le pas de temps
+ $n\,\Delta t$ et le pas de temps $(n+1)\,\Delta t$, avec, comme condition
+initiale $f_1^0 = f_2^0 =f_3^0 = 0$ et comme conditions aux limites, une de type
+Dirichlet et l'autre de type Neumann homog\`ene :
+\begin{equation}
+\left\{\begin{array}{ll}
+&f_{\,b_1} = 1 \\
+&\displaystyle \left.\frac{\partial f}{\partial x} \right|_{\,b_2} = 0
+\end{array}\right.
+\end{equation}
+
+On supposera de plus que~:\\
+\hspace*{1cm}{\tiny$\bigstar$} le sch\'ema convectif utilis\'e est le sch\'ema upwind\\
+\hspace*{1cm}{\tiny$\bigstar$} la masse volumique est constante\\
+\hspace*{1cm}{\tiny$\bigstar$} $(\rho\ u)^n_{\,b_1}\,>\,0,\ (\rho\ u)^n_{\,12}\,>\,0\ ,\
+(\rho\ u)^n_{\,23}\,>\, 0\ ,\ (\rho\ u)^n_{\,b_2}\,>\,0$\ \ \
+et\ \ \ \ \ $S_{\,b_1}\,<\,0$.
+
+\begin{figure}[htp]
+\centerline{\includegraphics[width=3.5cm,angle=-90]{domaine1d}}
+\caption{\label{Base_Covofi_domaine1d_fig}D\'efinition du domaine de calcul unidimensionnel
+consid\'er\'e.}
+\end{figure}
+
+
+On s'int\'eresse \`a l'influence sur le respect du principe du maximum discret
+de la pr\'ecision avec laquelle est v\'erifi\'ee sous forme discr\`ete la
+relation~:
+$$\forall i \in [1,N],\ \ \ \displaystyle\int_{\Omega_i}\dive\,(\rho\,\underline{u})\ d\Omega = 0$$
+soit, ici~:
+\begin{equation}
+\label{Base_Covofi_ContinuiteDiscreteExemple}
+-\,(\rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}\,=\,(\rho\ u)^n_{\,12}\,.\,S_{\,12}\,
+=\,(\rho\ u)^n_{\,23}\,.\,S_{\,23}\,=\,(\rho\ u)^n_{\,b_2}\,.\,S_{\,b_2}
+\end{equation}
+
+%-------------
+\subsubsection{Prise en compte de la contribution de
+$\displaystyle\frac{\partial \rho}{\partial t}$ dans la matrice}
+%-------------
+\label{Base_Covofi_PpmaxAvecDrhoDt}
+Le syst\`eme \`a r\'esoudre est alors, en omettant pour simplifier l'exposant $(\,n+1,k+1)$ :
+\begin{equation}
+\begin{array}{lllllllll}
+&\displaystyle \rho_1^{\,n}\ \displaystyle\ \frac{|\Omega_1|}{\Delta
+t}\,\delta f_1&&\ \ \ \ \ \ \ \ &-&(\rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}\,\delta
+f_1 &= &-(\rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}\,f_{\,b_1}\\
+&\displaystyle\rho_2^{\,n}\ \displaystyle\ \frac{|\Omega_2|}{\Delta
+t}\,\delta f_2 &+&(\rho\ u)^n_{\,12}\,.\,S_{\,12}\,\delta f_2 &-&(\rho\
+u)^n_{\,12}\,.\,S_{\,12}\,\delta f_1 &= &0\\
+&\displaystyle\ \rho_3^{\,n} \displaystyle\ \frac{|\Omega_3|}{\Delta
+t}\,\delta f_3 &+&(\rho\ u)^n_{\,23}\,.\,S_{\,23}\,\delta f_3 &-&(\rho\
+u)^n_{\,23}\,.\,S_{\,23}\,\delta f_2 &= &0\\
+\end{array}
+\end{equation}
+ce qui donne :
+\begin{equation}
+\left\{\begin{array}{lll}
+&\delta f_1 =& \,f_{\,b_1}\displaystyle\ \frac{-(\rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}}{\rho_1^{\,n}\ \displaystyle\ \frac{|\Omega_1|}{\Delta
+t} - (\rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}}\\
+&\delta f_2 =&+ \,\delta f_1 \displaystyle\ \frac{(\rho\
+u)^n_{\,12}\,.\,S_{\,12}}{\rho_2^{\,n}\ \displaystyle\ \frac{|\Omega_2|}{\Delta t} + (\rho\ u)^n_{\,12}\,.\,S_{\,12}}\\
+&\delta f_3 =&+ \,\delta f_2 \displaystyle\ \frac{(\rho\
+u)^n_{\,23}\,.\,S_{\,23}}{\rho_3^{\,n}\ \displaystyle\ \frac{|\Omega_3|}{\Delta
+t} + (\rho\ u)^n_{\,23}\,.\,S_{\,23}}\\
+\end{array}\right.
+\end{equation}
+d'o\`u :
+\begin{equation}
+\left\{\begin{array}{lll}
+& \delta f_1 & <\ 1 \\
+& \delta f_2 & <\ 1 \\
+& \delta f_3 & <\ 1 \\
+\end{array}\right.
+\end{equation}
+On obtient donc bien une solution qui v\'erifie le principe du maximum discret,
+m\^eme pour des grands pas de temps $\Delta t$, et ce, quelle que soit la
+pr\'ecision avec laquelle est v\'erifi\'ee, \`a l'\'etape de correction, la
+forme discr\`ete (\ref{Base_Covofi_ContinuiteDiscreteExemple}) de la conservation de la
+masse $\displaystyle\int_{\Omega_i}\dive\,(\rho\,\underline{u})\ d\Omega = 0$
+dont on ne s'est pas servi ici.
+
+
+%-------------
+\subsubsection{Sans la contribution de
+$\displaystyle\frac{\partial \rho}{\partial t}$ dans la matrice}
+%-------------
+
+
+On obtient de m\^eme :
+\begin{equation}
+\begin{array}{lllllllll}
+&\displaystyle \rho_1^{\,n}\ \displaystyle\ \frac{|\Omega_1|}{\Delta t}\,\delta f_1&+& (\rho\ u)^n_{\,12}\,.\,S_{\,12}\,\delta f_1& &\ \ \ \ \ &= &-(\rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}\,f_{\,b_1}\\
+&\displaystyle\rho_2^{\,n}\ \displaystyle\ \frac{|\Omega_2|}{\Delta
+t}\,\delta f_2 &+&(\rho\ u)^n_{\,23}\,.\,S_{\,23}\,\delta f_2 &-&(\rho\
+u)^n_{\,12}\,.\,S_{\,12}\,\delta f_1 &= &0\\
+&\displaystyle\rho_3^{\,n}\ \displaystyle\ \frac{|\Omega_3|}{\Delta t}\,\delta
+f_3 &-&(\rho\ u)^n_{\,23}\,.\,S_{\,23}\,\delta f_2 &+&(\rho\
+u)^n_{\,b_2}\,.\,S_{\,b_2}\,\delta f_3 &= &0\\
+\end{array}
+\end{equation}
+
+soit :
+
+\begin{equation}
+\left\{\begin{array}{lll}
+&\delta f_1 =& \,f_{\,b_1}\displaystyle\ \frac{- ( \rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}}{\rho_1^{\,n}\ \displaystyle\ \frac{|\Omega_1|}{\Delta
+t} + (\rho\ u)^n_{\,12}\,.\,S_{\,12}}\\
+&\delta f_2 =&\ \,\delta f_1 \displaystyle\ \frac{(\rho\
+u)^n_{\,12}\,.\,S_{\,12}}{\rho_2^{\,n}\ \displaystyle\ \frac{|\Omega_2|}{\Delta t} + (\rho\ u)^n_{\,23}\,.\,S_{\,23}}\\
+&\delta f_3 =&\ \,\delta f_2 \displaystyle\ \frac{(\rho\
+u)^n_{\,23}\,.\,S_{\,23}}{\rho_3^{\,n}\ \displaystyle\ \frac{|\Omega_3|}{\Delta
+t} + (\rho\ u)^n_{\,b_2}\,.\,S_{\,b_2}}\\
+\end{array}\right.
+\end{equation}
+Ici, on constate que le respect du principe du maximum discret :\\
+\begin{equation}
+\left\{\begin{array}{lll}
+&\delta f_1 &\leqslant \ 1 \\
+&\delta f_2 &\leqslant \ 1 \\
+&\delta f_3 &\leqslant \ 1 \\
+\end{array}\right.
+\end{equation}
+est \'equivalent \`a la condition :
+\begin{equation}
+\left\{\begin{array}{lll}
+- &( \rho\ u)^n_{\,b_1}\,.\,S_{\,b_1}&\leqslant \displaystyle\ \rho_1^{\,n}
+\,\frac{|\Omega_1|}{\Delta t} + (\rho\ u)^n_{\,12}\,.\,S_{\,12}\\
+&(\rho\ u)^n_{\,12}\,.\,S_{\,12}&\leqslant \displaystyle\ \rho_2^{\,n}
+\frac{|\Omega_2|}{\Delta t} + (\rho\ u)^n_{\,23}\,.\,S_{\,23}\\
+& (\rho\ u)^n_{\,23}\,.\,S_{\,23}&\leqslant \ \displaystyle\ \rho_3^{\,n}
+\frac{|\Omega_3|}{\Delta t} + (\rho\ u)^n_{\,b_2}\,.\,S_{\,b_2}\\
+\end{array}\right.
+\end{equation}
+Contrairement \`a la situation du paragraphe
+\ref{Base_Covofi_PpmaxAvecDrhoDt}, on ne peut obtenir ici un r\'esultat qu'en
+faisant intervenir l'\'egalit\'e (\ref{Base_Covofi_ContinuiteDiscreteExemple}), forme
+discr\`ete de la conservation de la masse. On obtient bien alors, \`a partir du
+syst\`eme pr\'ec\'edent~:
+\begin{equation}
+\left\{\begin{array}{lll}
+&\delta f_1 &< \ 1 \\
+&\delta f_2 &< \ 1 \\
+&\delta f_3 &< \ 1 \\
+\end{array}\right.
+\end{equation}
+
+Si l'on s'int\'eresse \`a la cellule $\Omega_1$ et que l'on
+suppose $(\rho\ u)^n_{\,12}\,.\,S_{\,12}=-\,(\rho\
+u)^n_{\,b_1}\,.\,S_{\,b_1}-\varepsilon (\rho\ u)^n_{\,12}\,.\,S_{\,12}$ (o\`u
+$\varepsilon$ est la pr\'ecision locale relative pour l'\'equation de
+conservation de la masse discr\`ete), on constate que l'on obtient $\delta\,f_1
+> f_{b_1} = 1 $ (valeur non admissible) d\`es lors que~:
+ $$\frac{1}{\varepsilon} < \frac{(\rho\
+u)^n_{\,12}\,.\,S_{\,12}\Delta t}{\rho_1|\Omega_1|}$$
+c'est-\`a-dire d\`es que
+le nombre de CFL local $\displaystyle\frac{(\rho\
+u)^n_{\,12}\,.\,S_{\,12}\Delta t}{\rho_1|\Omega_1|}$ exc\`ede l'inverse de la
+pr\'ecision relative locale $\varepsilon$.
+
+%=============
+\subsection{Conclusion}
+%=============
+
+Prendre en compte la contribution de
+$\displaystyle\frac{\partial \rho}{\partial t}$ dans la matrice permet un meilleur respect du principe du maximum discret, lorsque la
+pr\'ecision de $\displaystyle\int_{\Omega_i}\dive\,(\rho\,\underline{u})\
+d\Omega = 0$ n'est pas exactement v\'erifi\'ee.
diff --git a/doc/theory/elbase.tex b/doc/theory/elbase.tex
new file mode 100644
index 0000000..daf2f75
--- /dev/null
+++ b/doc/theory/elbase.tex
@@ -0,0 +1,1351 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+
+\programme{elec**}
+
+\vspace{0,5cm}
+On s'int\'eresse \`a la r\'esolution des \'equations de la
+magn\'etohydrodynamique, constitu\'ees de la r\'eunion des \'equations de
+l'a\'erothermodynamique et des \'equations de Maxwell.
+
+On se place dans deux cadres d'utilisation bien sp\'ecifiques et distincts,
+qui permettront chacun de r\'ealiser des simplifications~: les \'etudes dites
+``d'arc
+\'electrique'' (dans lesquelles sont prises en compte les forces de Laplace et
+l'effet Joule) et les \'etudes dites ``Joule'' (dans lesquelles seul
+l'effet Joule est pris en compte).
+
+Les \'etudes d'arc \'electrique sont associ\'ees en grande partie, pour EDF, aux
+probl\'ematiques relatives aux transformateurs. Les \'etudes Joule sont plus
+s\'ecifiquement li\'ees aux ph\'enom\`enes rencontr\'es dans les fours verriers.
+
+Outre la prise en compte ou non des forces de Laplace, ces deux types d'\'etudes
+se diff\'erencient \'egalement par le mode de d\'etermination de l'effet Joule
+(utilisation d'un potentiel complexe pour les \'etudes Joule faisant intervenir
+un courant alternatif non monophas\'e).
+
+On d\'ecrit tout d'abord les \'equations r\'esolues pour les \'etudes d'arc
+\'electrique. Les sp\'ecificit\'es des \'etudes Joule seront abord\'ees ensuite.
+
+
+Pour l'arc \'electrique,
+les r\'ef\'erences [douce] et [delalondre] pourront compl\'eter la
+pr\'esentation~:
+
+\noindent{\bf [delalondre] }Delalondre, Clarisse~: ``Mod\'elisation a\'erothermodynamique d'arcs
+\'electriques \`a forte intensit\'e avec prise en compte du d\'es\'equilibre
+thermodynamique local et du transfert thermique \`a la cathode'', Th\`ese de
+l'Universit\'e de Rouen, 1990
+
+\noindent{\bf [douce]} Douce, Alexandre~: ``Mod�lisation 3-D du chauffage d'un
+bain m�tallique par plasma d'arc transf\'er\'e. Application \`a un r\'eacteur
+axisym\'etrique'', HE-26/99/027A, HE-44/99/043A, Th\`ese de l'Ecole Centrale
+Paris et EDF, 1999
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{Notations}
+
+{\bf Variables utilis\'ees}
+\nopagebreak
+
+\begin{tabular}{lp{6cm}l}
+$\vect{A}$ &potentiel vecteur r\'eel &$kg\,m\,s^{-2}\,A^{-1}$ \\
+$\vect{B}$ &champ magn\'etique &$T$ (ou $kg\,s^{-2}\,A^{-1}$) \\
+$\vect{D}$ &d\'eplacement \'electrique &$A\,s\,m^{-2}$ \\
+$\vect{E}$ &champ \'electrique &$V\,m^{-1}$ \\
+$E$ &\'energie totale massique &$J\,kg^{-1}$ (ou $m^{2}\,s^{-2}$) \\
+$e$ &\'energie interne massique &$J\,kg^{-1}$ (ou $m^{2}\,s^{-2}$) \\
+$e_c$ &\'energie cin\'etique massique &$J\,kg^{-1}$ (ou $m^{2}\,s^{-2}$) \\
+$\vect{H}$ &excitation magn\'etique &$A\,m^{-1}$ \\
+$h$ &enthalpie massique &$J\,kg^{-1}$ (ou $m^{2}\,s^{-2}$) \\
+$\vect{j}$ &densit\'e de courant &$A\,m^{-2}$ \\
+$P$ &pression &$kg\,m^{-1}\,s^{-2}$ \\
+$P_R$, $P_I$ &potentiel scalaire r\'eel, imaginaire
+ &$V$ (ou $kg\,m^{2}\,s^{-3}\,A^{-1}$) \\
+$\vect{u}$ &vitesse &$m\,s^{-1}$ \\
+ & & \\
+$\varepsilon$ &permittivit\'e \'electrique
+ &$F\,m^{-1}$ (ou $m^{-3}\,kg^{-1}\,s^{4}\,A^{2}$) \\
+$\varepsilon_0$ &permittivit\'e \'electrique du vide
+ &$8,854\,10^{-12}\,\,F\,m^{-1}$ (ou $m^{-3}\,kg^{-1}\,s^{4}\,A^{2}$) \\
+$\mu$ &perm\'eabilit\'e \'electrique
+ &$H\,m^{-1}$ (ou $m\,kg\,s^{-2}\,A^{-2}$)\\
+$\mu_0$ &perm\'eabilit\'e \'electrique du vide
+ &$4\,\pi\,10^{-7}\,\,H\,m^{-1}$ (ou $m\,kg\,s^{-2}\,A^{-2}$)\\
+$\sigma$ &conductivit\'e \'electrique &$S\,m^{-1}$ (ou $m^{-3}\,kg^{-1}\,s^3\,A^2$)\\
+\end{tabular}
+
+\vspace*{0,5cm}
+{\bf Notations d'analyse vectorielle}
+\nopagebreak
+
+On rappelle \'egalement la d\'efinition des notations employ\'ees\footnote{en
+utilisant la convention de sommation d'Einstein.}~:
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+\left[\ggrad{\vect{a}}\right]_{ij} &=& \partial_j a_i\\
+\left[\dive(\tens{\sigma})\right]_i &=& \partial_j \sigma_{ij}\\
+\left[\vect{a}\otimes\vect{b}\right]_{ij} &= &
+a_i\,b_j\\
+\end{array}\right.
+\end{equation}
+et donc :
+\begin{equation}\notag
+\begin{array}{lll}
+\left[\dive(\vect{a}\otimes\vect{b})\right]_i &= &
+\partial_j (a_i\,b_j)
+\end{array}
+\end{equation}
+
+
+\subsection{Arcs \'electriques}
+
+\subsubsection{Introduction}
+
+Pour les \'etudes d'arc \'electrique, on calcule,
+\`a un pas de temps donn\'e~:
+\begin{itemize}
+\item la vitesse $\vect{u}$, la pression $P$, la variable \'energ\'etique
+enthalpie $h$ (et les grandeurs turbulentes),
+\item un potentiel scalaire r\'eel $P_R$
+(dont le gradient permet d'obtenir le champ \'electrique $\vect{E}$ et
+la densit\'e de courant $\vect{j}$),
+\item un potentiel vecteur r\'eel $\vect{A}$ (dont
+le rotationnel permet d'obtenir le champ magn\'etique $\vect{B}$).
+\end{itemize}
+
+\bigskip
+Le champ \'electrique, la
+densit\'e de courant et le champ magn\'etique sont utilis\'es pour calculer les
+termes sources d'effet Joule et les forces de Laplace qui interviennent
+respectivement dans l'\'equation de l'enthalpie et dans celle
+de la quantit\'e de mouvement.
+
+
+\subsubsection{\'Equations continues}
+
+{\bf Syst\`eme d'\'equations}
+\nopagebreak
+
+Les \'equations continues qui sont r\'esolues sont les suivantes~:
+\begin{equation}
+\left\{\begin{array}{l}
+{\color{blue}\dive(\rho \vect{u}) = 0}\\
+{\color{blue}\displaystyle\frac{\partial}{\partial t}(\rho \vect{u})
++\dive(\rho\, \vect{u} \otimes \vect{u})
+=\dive(\tens{\sigma}) + \vect{TS} + {\color{red}\vect{j} \times \vect{B}}}\\
+{\color{blue}\displaystyle\frac{\partial}{\partial t}(\rho h)
++\dive(\rho\, \vect{u} h)
+=\Phi_v -
+\dive{\left(\left(\frac{\lambda}{C_p}+\frac{\mu_t}{\sigma_t}\right)\grad{h}\right)}
++ {\color{red}P_J}}\\
+{\color{red}\dive(\sigma\,\grad{P_R})=0}\\
+{\color{red}\dive(\ggrad{\vect{A}})=-\mu_0\vect{j}}
+\end{array}\right.
+\end{equation}
+
+avec les relations suivantes~:
+\begin{equation}
+\left\{\begin{array}{l}
+{\color{red}P_J=\vect{j}\cdot\vect{E}}\\
+{\color{red}\vect{E}=-\grad{P_R}}\\
+{\color{red}\vect{j}=\sigma\vect{E}}\\
+\end{array}\right.
+\end{equation}
+
+%On donne ci-apr\`es diff\'erents \'el\'ements permettant de pr\'eciser le mode
+%d'obtention de ces \'equations.
+
+\vspace*{0,5cm}
+{\bf \'Equation de la masse}
+\nopagebreak
+
+C'est l'\'equation r\'esolue en standard par \CS (contrainte
+stationnaire).
+Elle n'a pas de traitement particulier dans
+le cadre du module pr\'esent. Un terme source de masse peut \^etre pris en
+compte au second membre si l'utilisateur le souhaite. Pour simplifier l'expos\'e
+le terme source sera suppos\'e nul ici, dans la mesure o\`u il n'est pas
+sp\'ecifique au module \'electrique.
+
+\vspace*{0,5cm}
+{\bf \'Equation de la quantit\'e de mouvement}
+\nopagebreak
+
+Elle pr\'esente, par rapport \`a
+l'\'equation standard r\'esolue par \CS, un seul terme additionnel
+($\vect{j} \times \vect{B}$) qui rend compte des forces de Laplace.
+Pour l'obtenir, on fait l'hypoth\`ese que le milieu est
+\'electriquement neutre.
+
+En effet, une charge $q_i$ (Coulomb) anim\'ee d'une
+vitesse $\vect{v}_i$ subit,
+sous l'effet du champ \'electrique $\vect{E}$ ($V\,m^{-1}$) et du champ magn\'etique
+$\vect{B}$ (Tesla), une force $\vect{f}_i$ ($kg\,m\,s^{-2}$)~:
+\begin{equation}
+\vect{f}_i=q_i\left(\vect{E} + \vect{v}_i \times \vect{B}\right)
+\end{equation}
+Avec $n_i$ charges de type $q_i$ par unit\'e de volume et en sommant sur tous
+les types de charge $i$ (\'electrons, ions, mol\'ecules ionis\'ees...), on
+obtient la force de Laplace totale $\vect{F}_L$ ($kg\,m^{-2}\,s^{-2}$) subie par unit\'e de
+volume~:
+\begin{equation}
+\vect{F}_L=\sum\limits_i\left[{n_i\,q_i\left(\vect{E} + \vect{v}_i \times \vect{B}\right)}\right]
+\end{equation}
+On introduit alors la densit\'e de courant $\vect{j}$ ($A\,m^{-2}$)~:
+\begin{equation}
+\vect{j}=\sum\limits_i n_i\,q_i\,\vect{v}_i
+\end{equation}
+Avec l'hypoth\`ese que le milieu est \'electriquement neutre (\`a un
+niveau macroscopique)~:
+\begin{equation}
+\sum\limits_i n_i\,q_i = 0
+\end{equation}
+la force totale $\vect{F}_L$ s'\'ecrit alors~:
+\begin{equation}
+\vect{F}_L=\vect{j} \times \vect{B}
+\end{equation}
+et on peut donc \'ecrire l'\'equation de la quantit\'e de mouvement~:
+\begin{equation}
+\displaystyle{\color{blue}\frac{\partial}{\partial t}(\rho \vect{u})
++\dive(\rho\, \vect{u} \otimes \vect{u})
+=\dive(\tens{\sigma}) + \vect{TS} + {\color{red}\vect{j} \times \vect{B}}}
+\end{equation}
+
+\vspace*{0,5cm}
+{\bf \'Equation de l'enthalpie}
+\nopagebreak
+
+Elle est obtenue \`a partir de l'�quation de
+l'\'energie apr\`es plusieurs approximations utilis\'ees en standard dans \CS et en
+prenant en compte le terme d'effet Joule li\'e \`a l'\'energie
+\'electromagn\'etique.
+
+\underline{\'Energie \'electromagn\'etique}
+\nopagebreak
+
+Avec les m\^emes notations que pr\'ec\'edemment mais sans qu'il soit
+besoin de supposer que le milieu est \'electriquement neutre,
+la puissance re\c cue par une charge $q_i$ (particule dou\'ee de masse)
+de vitesse $\vect{v}_i$ (vitesse du porteur de charge, contenant \'eventuellement
+l'effet de la vitesse du fluide) sous l'effet
+du champ \'electrique $\vect{E}$ ($V\,m^{-1}$)
+et du champ magn\'etique $\vect{B}$ ($T$) est (sans
+sommation sur $i$)~:
+\begin{equation}
+P_i=\vect{f}_i\cdot\vect{v}_i=
+q_i(\vect{E}+\vect{v}_i\times\vect{B})\cdot\vect{v}_i
+= q_i\vect{v}_i\cdot\vect{E}
+\end{equation}
+Avec $n_i$ charges par unit\'e de volume et en sommant sur tous les types
+de charges $i$, on obtient la puissance totale par unit\'e de volume~:
+\begin{equation}
+P_J=
+\sum\limits_i n_i\,q_i\,\vect{v}_i\cdot\vect{E}
+\end{equation}
+On introduit alors la densit\'e de courant $\vect{j}=\sum\limits_i n_i\,q_i\,\vect{v}_i$ (en $A\,m^{-2}$) et on obtient l'expression usuelle de la puissance
+\'electromagn\'etique dissip\'ee par effet Joule (en $W\,m^{-3}$)~:
+\begin{equation}
+P_J=\vect{j}\cdot\vect{E}
+\end{equation}
+
+Pour reformuler la puissance dissip\'ee par effet Joule et obtenir
+une \'equation d'\'evolution de l'\'energie \'electromagn\'etique, on utilise
+alors les \'equations de Maxwell.
+Les \'equations s'\'ecrivent (lois d'Amp\`ere
+et de Faraday)~:
+\begin{equation}
+\left\{
+\begin{array}{l}
+\displaystyle\frac{\partial \vect{D}}{\partial t} - \rot\vect{H} = -\vect{j}\\
+\displaystyle\frac{\partial \vect{B}}{\partial t} + \rot\vect{E} = 0
+\end{array}
+\right.
+\end{equation}
+
+On a donc~:
+\begin{equation}
+P_J=\vect{j}\cdot\vect{E}=\left(-\frac{\partial \vect{D}}{\partial t} +\rot\vect{H}\right)\cdot\vect{E}
+\end{equation}
+On utilise alors la relation suivante~:
+\begin{equation}
+\rot\vect{H}\cdot\vect{E}=\vect{H}\cdot\rot\vect{E}-\dive(\vect{E}\times\vect{H})
+\end{equation}
+En effet, elle permet de faire appara\^\i tre un
+terme en divergence, caract\'eristique d'une redistribution spatiale~:
+\begin{equation}
+\begin{array}{lll}
+\vect{j}\cdot\vect{E}&=&
+\displaystyle-\frac{\partial \vect{D}}{\partial t}\cdot\vect{E}
++\vect{H}\cdot\rot\vect{E}-\dive(\vect{E}\times\vect{H})\\
+\end{array}
+\end{equation}
+Et en utilisant la loi de Faraday pour faire appara\^\i tre la d\'eriv\'ee en temps du champ magn\'etique~:
+\begin{equation}
+\begin{array}{lll}
+\vect{j}\cdot\vect{E}&=&
+\displaystyle-\frac{\partial \vect{D}}{\partial t}\cdot\vect{E}
+-\vect{H}\cdot\frac{\partial \vect{B}}{\partial t}-\dive(\vect{E}\times\vect{H})\\
+\end{array}
+\end{equation}
+
+Dans le cadre de \CS, on fait les hypoth\`eses suivantes~:
+\begin{itemize}
+\item la perm\'eabilit\'e $\varepsilon$ et la permittivit\'e $\mu$
+sont constantes et uniformes (pour les gaz, en pratique, on utilise
+les propri\'et\'es du vide $\varepsilon_0$ et $\mu_0$).
+\item on utilise $\vect{B} = \mu \vect{H}$ et $\vect{D} = \varepsilon \vect{E}$
+\end{itemize}
+
+On a alors~:
+
+\begin{equation}
+\begin{array}{lll}
+\displaystyle\vect{j}\cdot\vect{E}&=&
+\displaystyle-\frac{\varepsilon_0}{2}\frac{\partial E^2}{\partial t}
+-\frac{1}{2\,\mu_0}\frac{\partial B^2}{\partial t}
+-\frac{1}{\mu_0}\dive(\vect{E}\times\vect{B})
+\end{array}
+\end{equation}
+
+\underline{\'Energie totale}
+\nopagebreak
+
+On \'etablit l'\'equation de l'\'energie totale en prenant en compte la
+puissance des forces de Laplace et le terme
+d'effet Joule.
+
+Sans prendre en compte l'\'energie \'electromagn\'etique,
+le premier principe de la thermodynamique s'\'ecrit d'ordinaire sous la
+forme suivante (pour un volume mat\'eriel suivi sur une unit\'e de temps)~:
+\begin{equation}\label{Elec_Elbase_premier_ppe_eq}
+d\int_V \rho E dV=\delta Q+\delta W
+\end{equation}
+Dans cette relation, $E$ est l'\'energie totale par unit\'e de masse\footnote{Ne pas
+confondre le scalaire $E$, \'energie totale, avec le vecteur $\vect{E}$, champ
+\'electrique.}, soit $E=e+e_c$, $e$ \'etant l'\'energie interne massique et
+$e_c=\frac{1}{2}\,\vect{u}\cdot\vect{u}$ l'\'energie cin\'etique massique. Le terme
+$\delta Q$ repr\'esente la chaleur re\c cue au travers des fronti\`eres du
+domaine consid\'er\'e tandis que le terme $\delta W$ repr\'esente le travail
+des forces ext\'erieures re\c cu par le syst\`eme (y compris les forces
+d\'erivant d'une \'energie potentielle).
+
+Pour prendre en compte l'\'energie \'electromagn\'etique, il suffit d'int\'egrer
+\`a la relation (\ref{Elec_Elbase_premier_ppe_eq}) la puissance des forces de Laplace $(\vect{j} \times
+\vect{B})\cdot\vect{u}$ et le terme d'effet Joule $\vect{j}\cdot\vect{E}$
+(transformation volumique d'\'energie \'electromagn\'etique en \'energie
+totale\footnote{Le terme en divergence
+$-\frac{1}{\mu_0}\dive(\vect{E}\times\vect{B})$
+traduit une redistribution spatiale d'\'energie \'electromagn\'etique~:
+ce n'est donc pas un terme source pour l'\'energie totale.}).
+Dans cette relation, la vitesse $\vect{u}$ est la vitesse du fluide et non pas
+celle des porteurs de charge~: elle n'est donc pas n\'ecessairement coli\'eaire
+au vecteur \vect{j} (par exemple, si le courant est d\^u \`a des \'electrons,
+la vitesse du fluide pourra \^etre consid\'er\'ee comme d\'ecorr\'el\'ee de la
+vitesse des porteurs de charges~; par contre, si le courant est d\^u \`a des ions,
+la vitesse du fluide pourra \^etre plus directement influenc\'ee par
+le d\'eplacement des porteurs de charge).
+Ainsi, le premier principe de la thermodynamique s'\'ecrit~:
+\begin{equation}
+d\int_V \rho E dV=\delta Q+\delta W+\vect{j}\cdot\vect{E}\,V\,dt +(\vect{j} \times
+\vect{B})\cdot\vect{u}\,V\,dt
+\end{equation}
+et l'\'equation locale pour l'\'energie totale est alors~:
+\begin{equation}
+\displaystyle\frac{\partial}{\partial t}(\rho E)
++\dive(\rho\, \vect{u} E)
+=\dive(\tens{\sigma}\,\vect{u}) + \vect{TS}\cdot\vect{u} + {\color{red}(\vect{j} \times
+\vect{B})\cdot\vect{u}} + \Phi_v - \dive{\vect{\Phi}_s} + {\color{red}\vect{j}\cdot \vect{E}}
+\end{equation}
+Le terme $\Phi_v$ repr\'esente les termes sources volumiques d'\'energie
+autres que l'effet Joule (par exemple, il inclut le terme source de
+rayonnement, pour un milieu optiquement non transparent). Le terme $\vect{\Phi}_s$ est
+le flux d'\'energie surfacique\footnote{Dans \CS, il est mod\'elis\'e par
+une hypoth\`ese de gradient et inclut �galement la ``diffusion'' turbulente.}.
+
+\underline{Enthalpie}
+\nopagebreak
+
+Pour obtenir une \'equation sur l'enthalpie, qui est la variable \'energ\'etique
+choisie dans \CS dans le module \'electrique, on
+soustrait tout d'abord \`a l'\'equation de l'\'energie totale celle de l'\'energie
+cin\'etique pour obtenir une \'equation sur l'\'energie interne.
+
+L'\'equation de l'\'energie
+cin\'etique (obtenue \`a partir de l'\'equation de la quantit\'e de mouvement
+\'ecrite sous forme non conservative) est~:
+\begin{equation}
+\displaystyle\frac{\partial}{\partial t}(\rho e_c)
++\dive(\rho\, \vect{u} e_c)
+=\dive(\tens{\sigma}\,\vect{u}) - \tens{\sigma}:\left(\ggrad(\vect{u})\right)^t +
+\vect{TS}\cdot\vect{u} + (\vect{j} \times \vect{B})\cdot\vect{u}
+\end{equation}
+de sorte que, pour l'\'energie interne, on a~:
+\begin{equation}
+\displaystyle\frac{\partial}{\partial t}(\rho e)
++\dive(\rho\, \vect{u} e)
+=\tens{\sigma}:\left(\ggrad(\vect{u})\right)^t + \Phi_v - \dive{\Phi_s} + \vect{j}\cdot \vect{E}
+\end{equation}
+et enfin, pour l'enthalpie $h=e+\frac{P}{\rho}$~:
+\begin{equation}
+\displaystyle\frac{\partial}{\partial t}(\rho h)
++\dive(\rho\, \vect{u} h)
+=\tens{\sigma}:\left(\ggrad(\vect{u})\right)^t + \Phi_v - \dive{\Phi_s} + \vect{j}\cdot \vect{E}+\rho\frac{d}{dt}\left(\frac{P}{\rho}\right)
+\end{equation}
+En faisant appara\^itre la pression dans le tenseur des contraintes
+$\tens{\sigma}=-P\tens{Id}+\tens{\tau}$, on peut \'ecrire~:
+\begin{equation}
+\displaystyle\frac{\partial}{\partial t}(\rho h)
++\dive(\rho\, \vect{u} h)
+=\tens{\tau}:\left(\ggrad(\vect{u})\right)^t + \Phi_v - \dive{\Phi_s}
++ \vect{j}\cdot\vect{E} + \frac{dP}{dt}
+\end{equation}
+
+Les approximations habituelles de \CS consistent alors
+\`a n\'egliger le terme ``d'\'echauffement'' issu du tenseur des contraintes
+$\tens{\tau}:\left(\ggrad(\vect{u})\right)^t$ et le terme en d\'eriv\'ee totale de la
+pression $\frac{dP}{dt}$, suppos\'es faibles en comparaison des autres termes
+dans les applications trait\'ees (exemple~: terme d'effet Joule important, effets de
+compressibilit\'e faibles...).
+De plus, le terme de flux est mod\'elis\'e en suivant
+une hypoth\`ese de gradient appliqu\'e \`a l'enthalpie (et non pas \`a la
+temp\'erature), soit donc~:
+\begin{equation}
+{\color{blue}\displaystyle\frac{\partial}{\partial t}(\rho h)
++\dive(\rho\, \vect{u} h)
+=\Phi_v -
+\dive{\left(\left(\frac{\lambda}{C_p}+\frac{\mu_t}{\sigma_t}\right)\grad h\right)} + {\color{red}\vect{j}\cdot\vect{E}}}
+\end{equation}
+
+
+\vspace*{0,5cm}
+{\bf \'Equations \'electromagn\'etiques}
+\nopagebreak
+
+Elles sont obtenues \`a partir des
+\'equations de Maxwell sous les hypoth\`eses d\'etaill\'ees dans [douce],
+paragraphe 3.3.
+
+\underline{Densit\'e de courant}
+\nopagebreak
+
+La relation liant la densit\'e de courant et le champ \'electrique est issue de
+la loi d'Ohm que l'on suppose pouvoir utiliser sous la forme
+simplifi\'ee suivante~:
+\begin{equation}\label{Elec_Elbase_ohm_eq}
+{\color{red}\vect{j}=\sigma\,\vect{E}}
+\end{equation}
+
+\underline{Champ \'electrique}
+\nopagebreak
+
+Le champ \'electrique s'obtient \`a partir d'un potentiel vecteur.
+
+En effet, la loi de Faraday s'\'ecrit~:
+\begin{equation}
+\frac{\partial\vect{B}}{\partial t}+\rot\vect{E}=0
+\end{equation}
+Avec une hypoth\`ese quasi-stationnaire, il reste~:
+\begin{equation}
+\rot\vect{E}=0
+\end{equation}
+Il est donc possible de postuler l'existence d'un potentiel scalaire $P_R$
+tel que~:
+\begin{equation}\label{Elec_Elbase_e_eq}
+{\color{red}\vect{E}=-\grad{P_R}}
+\end{equation}
+
+\underline{Potentiel scalaire}
+\nopagebreak
+
+Le potentiel scalaire est solution d'une \'equation de Poisson.
+
+En effet, la conservation de la charge $q$ s'\'ecrit~:
+\begin{equation}
+\displaystyle\frac{\partial q}{\partial t}
++\dive(\vect{j}) = 0
+\end{equation}
+Pour un milieu \'electriquement neutre (\`a l'\'echelle macroscopique), on a
+$\displaystyle\frac{\partial q}{\partial t}=0$ soit donc~:
+\begin{equation}
+\dive(\vect{j}) = 0
+\end{equation}
+C'est-\`a-dire, avec la loi d'Ohm (\ref{Elec_Elbase_ohm_eq}),
+\begin{equation} \label{Elec_Elbase_div_sigma_e_eq}
+\dive(\sigma\,\vect{E}) = 0
+\end{equation}
+Avec (\ref{Elec_Elbase_e_eq}), on obtient donc une \'equation permettant de
+calculer le potentiel scalaire~:
+\begin{equation}
+{\color{red}\dive(\sigma\,\grad{P_R}) = 0}
+\end{equation}
+
+\underline{Champ magn\'etique}
+\nopagebreak
+
+Le champ magn\'etique s'obtient \`a partir d'un potentiel vecteur.
+
+En effet, la loi d'Amp\`ere s'\'ecrit~:
+\begin{equation}
+\displaystyle\frac{\partial\vect{D}}{\partial t}-\rot\vect{H}=-\vect{j}
+\end{equation}
+Sous les hypoth\`eses indiqu\'ees pr\'ec\'edemment, on \'ecrit~:
+\begin{equation}
+\displaystyle\varepsilon_0\,\mu_0\,\frac{\partial\vect{E}}{\partial t}-\rot\vect{B}=-\mu_0\vect{j}
+\end{equation}
+Avec une hypoth\`ese quasi-stationnaire, il reste~:
+\begin{equation}\label{Elec_Elbase_rot_b_eq}
+\rot\vect{B}=\mu_0\vect{j}
+\end{equation}
+De plus, la conservation du flux magn\'etique s'\'ecrit\footnote{Prendre la
+divergence de la loi de Faraday, avec $\dive(\rot\vect{E})=0$ (par analyse
+vectorielle) donne $\dive\vect{B} = \text{cst}$.}~:
+\begin{equation}
+\dive\,\vect{B} = 0
+\end{equation}
+et on peut donc postuler l'existence d'un potentiel vecteur $\vect{A}$ tel que~:
+\begin{equation}\label{Elec_Elbase_b_eq}
+{\color{red}\vect{B} = \rot{\vect{A}}}
+\end{equation}
+
+\underline{Potentiel vecteur}
+\nopagebreak
+
+Le potentiel vecteur est solution d'une \'equation de Poisson.
+
+En prenant le rotationnel de (\ref{Elec_Elbase_b_eq}) et avec (\ref{Elec_Elbase_rot_b_eq}), on obtient~:
+\begin{equation}
+-\rot(\rot{\vect{A}}) = -\mu_0\vect{j}
+\end{equation}
+Avec la relation donnant le Laplacien\footnote{En
+coordonn\'ees cart\'esiennes, le
+Laplacien du vecteur $\vect{a}$ est le vecteur dont les
+composantes sont \'egales au Laplacien de chacune des composantes de $\vect{a}$.}
+d'un vecteur $\dive(\ggrad\vect{a})=\grad(\dive{\vect{a}})-\rot(\rot\vect{a})$ et sous
+la contrainte\footnote{La condition $\dive\vect{A}=0$, dite ``jauge de
+Coulomb'', est n\'ecessaire pour assurer
+l'unicit\'e du potentiel vecteur.}
+que $\dive\vect{A}=0$, on obtient finalement une \'equation
+permettant de calculer le potentiel vecteur~:
+\begin{equation}
+{\color{red}\dive\,(\ggrad{\vect{A}}) = -\mu_0\vect{j}}
+\end{equation}
+
+
+
+\subsection{Effet Joule}
+
+\subsubsection{Introduction}
+
+Pour les \'etudes Joule, on calcule,
+\`a un pas de temps donn\'e~:
+\begin{itemize}
+\item la vitesse $\vect{u}$, la pression $P$, la variable \'energ\'etique
+enthalpie $h$ (et les grandeurs turbulentes \'eventuelles),
+\item un potentiel scalaire r\'eel $P_R$,
+\item et, si le courant n'est ni continu, ni alternatif
+monophas\'e, un potentiel scalaire imaginaire $P_I$.
+\end{itemize}
+
+\bigskip
+Le gradient du potentiel permet d'obtenir le champ \'electrique $\vect{E}$ et
+la densit\'e de courant $\vect{j}$ (partie r\'eelle et, \'eventuellement, partie
+imaginaire). Le champ \'electrique et la
+densit\'e de courant sont utilis\'es pour calculer le
+terme source d'effet Joule qui intervient dans l'\'equation de l'enthalpie.
+
+{\bf La puissance instantan\'ee dissip\'ee par effet Joule} est \'egale
+au produit instantan\'e $\vect{j}\cdot\vect{E}$.
+Dans le cas g\'en\'eral, $\vect{j}$ et $\vect{E}$ sont des signaux alternatifs
+($\vect{j}=\vect{|j|}cos(\omega\,t+\phi_j)$ et
+$\vect{E}=\vect{|E|}cos(\omega\,t+\phi_E)$) que l'on peut repr\'esenter
+par des complexes
+($\vect{j}=\vect{|j|}\,e^{i\,(\omega\,t+\phi_j)}$ et
+$\vect{E}=\vect{|E|}\,e^{i\,(\omega\,t+\phi_E)}$).
+La puissance instantan\'ee s'\'ecrit alors
+$(\vect{|j|}\cdot\vect{|E|})cos(\omega\,t+\phi_j)cos(\omega\,t+\phi_E)$.
+
+\begin{itemize}
+
+\item {\bf En courant continu} ($\omega=\phi_j=\phi_E=0$),
+la puissance se calcule donc simplement comme
+le produit scalaire $P_J=\vect{|j|}\cdot\vect{|E|}$.
+Le calcul de la puissance
+dissip\'ee par effet Joule ne pose donc pas de probl\`eme particulier
+car les variables densit\'e de courant et champ \'electrique r\'esolues
+par \CS sont pr\'ecis\'ement $\vect{|j|}$ et $\vect{|E|}$ (les variables sont r\'eelles).
+
+\item {\bf En courant alternatif}, la periode du courant est beaucoup plus petite que
+les \'echelles de temps des ph\'enom\`enes thermohydrauliques pris en compte.
+Il n'est donc pas utile de disposer de la puissance instantan\'ee dissip\'ee
+par effet Joule~: la moyenne sur une p\'eriode est suffisante et elle
+s'\'ecrit\footnote{L'int\'egrale de $cos^2 x$ sur un intervalle de longueur
+$2\,\pi$ est $\pi$.}~:
+% eh oui, car l'integrale de cos^2+sin^2 (qui vaut 1), c'est 2 \pi !!
+$P_J=\frac{1}{2}(\vect{|j|}\cdot\vect{|E|})cos(\phi_j-\phi_E)$. Cette formule
+peut \'egalement s'\'ecrire de mani\`ere \'equivalente sous forme complexe~:
+$P_J=\frac{1}{2}\vect{j}\cdot\vect{E}^*$, o\`u $\vect{E}^*$ est le complexe
+conjugu\'e de $\vect{E}$.
+
+ \begin{itemize}
+ \item En courant alternatif monophas\'e ($\phi_j=\phi_E$), en particulier,
+la formule donnant la puissance se simplifie sous la forme
+$P_J=\frac{1}{2}(\vect{|j|}\cdot\vect{|E|})$, ou encore~:
+$P_J=\frac{1}{\sqrt{2}}\vect{|j|}\cdot\frac{1}{\sqrt{2}}\vect{|E|}$.
+Il s'agit donc du produit des valeurs efficaces. Or, les variables r\'esolues
+par \CS en courant alternatif monophas\'e sont pr\'ecis\'ement les
+valeurs efficaces (valeurs que l'on
+d\'enomme abusivement "valeurs r\'eelles" dans le code source).
+
+ \item En courant alternatif non monophas\'e (triphas\'e, en particulier),
+la formule donnant la puissance est utilis\'ee directement sous la forme
+$P_J=\frac{1}{2}\vect{j}\cdot\vect{E}^*$.
+On utilise pour la calculer les variables r\'esolues qui sont
+la partie r\'eelle et la partie imaginaire de $\vect{j}$ et $\vect{E}$.
+
+ \end{itemize}
+
+\item {\bf En conclusion},
+
+ \begin{itemize}
+ \item en continu, les variables r\'esolues
+$\vect{j}_{Res}$ et $\vect{E}_{Res}$
+sont les variables r\'eelles continues
+et la puissance se calcule par la formule suivante~:
+$P_J=\vect{j}_{Res}\cdot\vect{E}_{Res}$
+ \item en alternatif monophas\'e, les variables r\'esolues
+$\vect{j}_{Res}$ et $\vect{E}_{Res}$
+sont les valeurs efficaces
+et la puissance se calcule par la formule suivante~:
+$P_J=\vect{j}_{Res}\cdot\vect{E}_{Res}$
+ \item en alternatif non monophas\'e, les variables r\'esolues
+$\vect{j}_{Res,R}$, $\vect{j}_{Res,I}$ et $\vect{E}_{Res,R}$, $\vect{E}_{Res,I}$
+sont la partie r\'eelle et la partie imaginaire de $\vect{j}$ et $\vect{E}$,
+et la puissance se calcule par la formule suivante~:
+$P_J=\frac{1}{2}(\vect{j}_{Res,R}\cdot\vect{E}_{Res,R}-\vect{j}_{Res,I}\vect{E}_{Res,I})$
+ \end{itemize}
+
+\end{itemize}
+
+
+{\bf Le potentiel imaginaire n'est donc utilis\'e dans le code que lorsque
+le courant est alternatif et non monophas\'e.}
+En particulier, le potentiel imaginaire n'est pas utilis\'e lorsque le courant est
+continu ou alternatif monophas\'e.
+En effet, la partie imaginaire n'est introduite en compl\'ement de la partie
+r\'eelle que dans le cas o\`u il est n\'ecessaire de disposer de deux grandeurs
+pour d\'efinir le potentiel, c'est-\`a-dire lorsqu'il importe de conna\^itre son
+amplitude et sa phase.
+En courant continu, on n'a naturellement besoin que d'une seule information. En
+alternatif monophas\'e, la valeur de la phase importe peu
+(on ne travaille pas sur des grandeurs \'electriques instantan\'ees)~:
+il suffit de conna\^itre l'amplitude du potentiel et il est donc inutile
+d'introduire une variable imaginaire.
+
+
+{\bf La variable d\'enomm\'ee ``potentiel r\'eel'', $P_R$, repr\'esente une
+valeur efficace
+si le courant est monophas\'e et une partie r\'eelle sinon.}
+De mani\`ere plus explicite, pour un potentiel physique alternatif sinuso\"idal
+$Pp$, de valeur maximale not\'ee $Pp_\text{max}$, de phase not\'ee $\phi$, la
+variable $P_R$ repr\'esente $\frac{1}{\sqrt{2}}\,Pp_\text{max}$ en
+monophas\'e et $Pp_\text{max}\,cos\phi$ sinon. En courant continu, $P_R$
+repr\'esente naturellement le potentiel (r\'eel, continu).
+{\bf Il est donc indispensable de pr\^eter une attention particuli\`ere aux
+valeurs de potentiel impos\'ees aux limites} (facteur $\frac{1}{\sqrt{2}}$ ou
+$cos\phi$).
+
+\subsubsection{\'Equations continues}
+
+{\bf Syst\`eme d'\'equations}
+\nopagebreak
+
+Les \'equations continues qui sont r\'esolues sont les suivantes~:
+\begin{equation}
+\left\{\begin{array}{l}
+{\color{blue}\dive(\rho \vect{u}) = 0}\\
+{\color{blue}\displaystyle\frac{\partial}{\partial t}(\rho \vect{u})
++\dive(\rho\, \vect{u} \otimes \vect{u})
+=\dive(\tens{\sigma}) + \vect{TS}} \\
+{\color{blue}\displaystyle\frac{\partial}{\partial t}(\rho h)
++\dive(\rho\, \vect{u} h)
+=\Phi_v -
+\dive{\left(\left(\frac{\lambda}{C_p}+\frac{\mu_t}{\sigma_t}\right)\grad{h}\right)}
++ {\color{red}P_J}}\\
+{\color{red}\dive(\sigma\,\grad{P_R})=0}\\
+{\color{red}\dive(\sigma\,\grad{P_I})=0}\text{\ \ \ en alternatif non monophas\'e uniquement}\\
+\end{array}\right.
+\end{equation}
+
+avec, en continu ou alternatif monophas\'e~:
+\begin{equation}
+\left\{\begin{array}{l}
+{\color{red}P_J=\vect{j}\cdot\vect{E}} \\
+{\color{red}\vect{E}=-\grad{P_R}}\\
+{\color{red}\vect{j}=\sigma\vect{E}}\\
+\end{array}\right.
+\end{equation}
+
+et, en alternatif non monophas\'e (avec $i^2=-1$)~:
+\begin{equation}
+\left\{\begin{array}{l}
+{\color{red}\displaystyle P_J=\frac{1}{2}\,\vect{j}\cdot\vect{E}^*}\\
+{\color{red}\vect{E}=-\grad{(P_R+i\,P_I)}}\\
+{\color{red}\vect{j}=\sigma\vect{E}}\\
+\end{array}\right.
+\end{equation}
+
+\vspace*{0,5cm}
+{\bf \'Equation de la masse}
+\nopagebreak
+
+C'est l'\'equation r\'esolue en standard par \CS (contrainte
+stationnaire d'incompressibilit\'e). Elle n'a pas de traitement particulier dans
+le cadre du module pr\'esent. Un terme source de masse peut \^etre pris en
+compte au second membre si l'utilisateur le souhaite. Pour simplifier
+l'expos\'e,
+le terme source sera suppos\'e nul ici, dans la mesure o\`u il n'est pas
+sp\'ecifique au module \'electrique.
+
+\vspace*{0,5cm}
+{\bf \'Equation de la quantit\'e de mouvement}
+\nopagebreak
+
+C'est l'\'equation r\'esolue en standard par \CS (les forces de Laplace
+($\vect{j} \times \vect{B}$) sont suppos\'ees n\'egligeables).
+
+\vspace*{0,5cm}
+{\bf \'Equation de l'enthalpie}
+\nopagebreak
+
+On l'\'etablit comme dans le cas des arcs \'electriques\footnote{\`A ceci pr\`es
+que la puissance des
+forces de Laplace n'appara\^it pas du tout, au lieu de dispara\^itre lorsque
+l'on soustrait l'\'equation de l'\'energie cin\'etique \`a celle de l'\'energie
+totale.} \`a partir de l'�quation de
+l'\'energie apr\`es plusieurs approximations utilis\'ees en standard dans \CS et en
+prenant en compte le terme d'effet Joule li\'e \`a l'\'energie
+\'electromagn\'etique.
+
+Par rapport \`a l'\'equation utilis\'ee pour les \'etudes d'arc \'electrique,
+seule l'expression de l'effet Joule diff\`ere lorsque le courant est
+alternatif non monophas\'e.
+
+\vspace*{0,5cm}
+{\bf \'Equations \'electromagn\'etiques}
+\nopagebreak
+
+Elles sont obtenues comme indiqu\'e dans la partie relative aux arcs
+\'electriques, mais on ne conserve que les relations associ\'ees \`a la
+densit\'e de courant, au champ \'electrique et au potentiel dont il d\'erive.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+La discr\'etisation des \'equations ne pose pas de probl\`eme particulier
+(ajout de termes sources explicites pour l'effet Joule et les forces de Laplace,
+\'equations de Poisson pour la d\'etermination des potentiels).
+
+Un point sur les conditions aux limites doit cependant \^etre fait ici, en
+particulier pour pr\'eciser la m\'ethode de recalage automatique des
+potentiels.
+
+
+
+\subsection{Arcs \'electriques}
+
+\subsubsection{Conditions aux limites}
+
+Seules les conditions aux limites pour les potentiels sont \`a pr\'eciser.
+
+{\bf Les conditions aux limites sur le potentiel scalaire} sont des conditions de
+Neumann homog\`enes sur toutes les fronti\`eres hormis \`a la cathode et \`a
+l'anode. \`A la cathode, on impose une condition de Dirichlet homog\`ene (potentiel nul par convention). \`A l'anode, on impose une
+condition de Dirichlet permettant de fixer la diff\'erence de potentiel
+souhait\'ee entre l'anode et la cathode.
+L'utilisateur peut fixer le potentiel de l'anode directement ou
+demander qu'un recalage automatique du potentiel soit effectu\'e pour atteindre
+une intensit\'e de courant pr\'ed\'etermin\'ee.
+
+Lorsque le recalage automatique est demand\'e (\var{IELCOR}=1), l'utilisateur doit fixer la
+valeur cible de l'intensit\'e, \var{COUIMP}, ($A$) et une valeur \'elev\'ee
+de d\'epart
+de la diff\'erence de potentiel entre l'anode et la cathode\footnote{Plus pr\'ecis\'ement, l'utilisateur doit imposer un potentiel nul
+en cathode et le potentiel \var{DPOT} \`a l'anode, en utilisant explicitement,
+dans le sous-programme utilisateur \fort{uselcl}, la variable \var{DPOT} qui
+sera automatiquement recal\'ee au cours du calcul.}, \var{DPOT}, ($V$).
+Le recalage est effectu\'e en fin de pas temps et permet de disposer, pour le pas
+de temps suivant, de valeurs recal\'ees des forces de Laplace et de l'effet
+Joule.
+\begin{itemize}
+\item Pour effectuer le recalage, \CS d\'etermine l'int\'egrale de l'effet Joule
+estim\'e sur le domaine (en $W$) et en compare la
+valeur au produit de l'intensit\'e \var{COUIMP} par la diff\'erence de
+potentiel\footnote{\var{DPOT} est la diff\'erence de
+potentiel impos\'ee entre l'anode et la cathode au
+pas de temps qui s'ach\`eve. \var{DPOT} a conditionn\'e le champ \'electrique et
+la densit\'e de courant utilis\'es pour le calcul de l'effet Joule.} \var{DPOT}.
+Un coefficient multiplicatif de recalage \var{COEPOT} en
+est d\'eduit (pour \'eviter des variations trop brusques,
+on s'assure qu'il reste born\'e). % entre 0,75 et 1,5).
+\item On multiplie alors par \var{COEPOT} la
+diff\'erence de potentiel entre l'anode et la cathode, \var{DPOT}, et le vecteur $\vect{j}$. L'effet
+Joule, produit de $\vect{j}$ par $\vect{E}$, est multipli\'e par
+le carr\'e de \var{COEPOT}. Pour assurer la coh\'erence du post-traitement des
+variables, le potentiel vecteur et le potentiel scalaire sont \'egalement
+multipli\'es par \var{COEPOT}.
+\item Le champ \'electrique n'\'etant pas explicitement
+stock\'e, on ne le recale pas. Le potentiel vecteur et les forces de Laplace seront d\'eduits de la
+densit\'e de courant et int\'egreront donc naturellement le recalage.
+\end{itemize}
+
+\bigskip
+{\bf Les conditions aux limites sur le potentiel vecteur} sont des conditions de
+Neumann homog\`ene sur toutes les fronti\`eres hormis sur une zone de bord
+arbitrairement choisie (paroi par exemple) pour laquelle une condition de
+Dirichlet est utilis\'ee afin que le syst\`eme soit inversible
+(la valeur impos\'ee est la valeur du potentiel vecteur
+calcul\'ee au pas de temps pr\'ec\'edent).
+
+
+
+\subsection{Effet Joule}
+
+\subsubsection{Conditions aux limites}
+
+Seules les conditions aux limites pour les potentiels sont \`a pr\'eciser.
+
+{\bf Les conditions aux limites sur le potentiel scalaire} sont \`a pr\'eciser
+au cas par cas selon la configuration des \'electrodes. Ainsi, on dispose
+classiquement de conditions de Neumann homog\`enes ou de Dirichlet (potentiel
+impos\'e). On peut \'egalement avoir besoin d'imposer des conditions
+d'antisym\'etrie (en utilisant des conditions de Dirichlet homog\`enes par exemple).
+L'utilisateur peut \'egalement souhaiter qu'un recalage automatique du potentiel
+soit effectu\'e pour atteindre une valeur pr\'ed\'etermin\'ee de la puissance
+dissip\'ee par effet Joule.
+
+Lorsque le recalage automatique est demand\'e (\var{IELCOR}=1), l'utilisateur doit fixer la
+valeur cible de la puissance dissip\'ee dans le domaine, \var{PUISIM}, ($V.A$).
+Il doit en outre, sur les fronti\`eres o\`u il
+souhaite que le potentiel (r\'eel ou complexe) s'adapte automatiquement, fournir en
+condition \`a la limite une valeur initiale du potentiel et la multiplier par
+la variable \var{COEJOU} qui sera automatiquement recal\'ee au cours du calcul
+(\var{COEJOU} vaut 1 au premier pas de temps).
+Le recalage est effectu\'e en fin de pas temps et permet de disposer, pour le pas
+de temps suivant, d'une valeur recal\'ee de l'effet
+Joule.
+\begin{itemize}
+\item Pour effectuer le recalage, \CS d\'etermine l'int\'egrale de l'effet Joule
+estim\'e sur le domaine (en $W$) et en compare la
+valeur \`a la puissance cible. Un coefficient multiplicatif de recalage \var{COEPOT} en
+est d\'eduit (pour \'eviter des variations trop brusques,
+on s'assure qu'il reste born\'e entre 0,75 et 1,5).
+\item On multiplie alors par
+\var{COEPOT} le facteur multiplicatif \var{COEJOU} utilis\'e pour les conditions aux
+limites. La puissance dissip\'ee par effet
+Joule est multipli\'ee par
+le carr\'e de \var{COEPOT}. Pour assurer la coh\'erence du post-traitement des
+variables, le potentiel est \'egalement
+multipli\'e par \var{COEPOT}.
+\item Le champ \'electrique n'\'etant pas explicitement
+stock\'e, on ne le recale pas.
+\end{itemize}
+
+\bigskip
+On notera que la variable \var{DPOT} est \'egalement recal\'ee et qu'elle
+peut donc \^etre utilis\'ee si besoin pour imposer les conditions aux limites.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\subsection{Introduction}
+
+Le module \'electrique est une ``physique particuli\`ere'' activ\'ee lorsque les
+mots-cl\'es \var{IPPMOD(IELARC)} (arc \'electrique) ou \var{IPPMOD(IELJOU)}
+(Joule) sont strictement positifs. Les d\'eveloppements concernant la conduction ionique
+(mot-cl\'e \var{IPPMOD(IELION)}) ont \'et\'e pr\'evus dans le code mais restent \`a
+r\'ealiser. Pour l'arc \'electrique, dans la version actuelle
+de \CS, seule est op\'erationnelle l'option \var{IPPMOD(IELARC)}=2~: la version 2D axisym\'etrique qui permettrait de
+ s'affranchir du potentiel vecteur (option \var{IPPMOD(IELARC)}=1) n'est pas
+ activable.
+Pour l'effet Joule, lorsqu'il n'est pas utile d'introduire un potentiel scalaire
+complexe
+(en courant continu ou alternatif monophas\'e), on utilise
+\var{IPPMOD(IELJOU)}=1. Lorsqu'un potentiel scalaire complexe est indispensable (courant
+alternatif triphas\'e, par exemple), on utilise
+\var{IPPMOD(IELJOU)}=2.
+
+Dans ce qui suit, on pr\'ecise les inconnues et les propri\'et\'es
+principales utilis\'ees dans le module.
+On fournit \'egalement un arbre d'appel simplifi\'e des sous-programmes du module
+(initialisation avec \fort{initi1} puis \fort{inivar} et boucle en temps avec \fort{tridim}).
+Les sous-programmes marqu\'es d'un ast\'erisque sont d\'etaill\'es ensuite.
+
+\newpage
+
+\subsection{Inconnues et propri\'et\'es}
+
+Les d\'eveloppements ont \'et\'e r\'ealis\'es pour une unique phase (\var{NPHAS}=1).
+
+Les \var{NSCAPP} inconnues scalaires associ\'ees \`a la physique
+particuli\`ere sont d\'efinies dans \fort{elvarp} dans l'ordre
+suivant (en particulier afin de limiter le stockage en m\'emoire lors de
+la r\'esolution s\'equentielle des
+scalaires par \fort{scalai})~:
+\begin{itemize}
+\item l'enthalpie \var{RTP(*,ISCA(IHM))},
+\item un potentiel scalaire r\'eel \var{RTP(*,ISCA(IPOTR))},
+\item un potentiel scalaire imaginaire \var{RTP(*,ISCA(IPOTI))} {\it ssi}
+ \var{IPPMOD(IELJOU)}=2 (\'etudes Joule en courant alternatif non monophas\'e),
+\item les trois composantes d'un potentiel vecteur r\'eel
+ \var{RTP(*,ISCA(IPOTVA(i)))} (avec \var{i} variant de 1 \`a 3) {\it ssi}
+ \var{IPPMOD(IELARC)}=2 (arc \'electrique),
+\item \var{NGAZG}-1 fractions massiques \var{RTP(*,ISCA(IYCOEL(j)))}
+ (avec \var{j} variant de 1 \`a \var{NGAZG}-1) pour un fluide \`a \var{NGAZG}
+ constituants (avec \var{NGAZG} strictement sup\'erieur \`a 1).
+ En arc \'electrique, la composition est fournie dans le fichier de donn\'ees
+ \fort{dp\_ELE}. La fraction massique du
+ dernier constituant n'est pas stock\'ee en m\'emoire. Elle est
+ d\'etermin\'ee chaque fois que n\'ecessaire en calculant le compl\'ement \`a l'unit\'e
+ des autres fractions massiques (et, en particulier, lorsque \fort{elthht} est
+ utilis\'e pour le calcul des propri\'et\'es physiques).
+\end{itemize}
+
+\bigskip
+Outre les propri\'et\'es associ\'ees en standard aux variables scalaires
+identifi\'ees ci-dessus, le
+tableau \var{PROPCE} contient \'egalement~:
+ \begin{itemize}
+\item la temp\'erature, \var{PROPCE(*,IPPROC(ITEMP))}. En th\'eorie, on
+ pourrait \'eviter de stocker cette variable, mais l'utilisateur est
+ presque toujours int\'eress\'e par sa valeur en post-traitement et
+ les propri\'et\'es physiques sont souvent donn\'ees par des lois qui en
+ d\'ependent explicitement.
+ Son unit\'e (Kelvin ou Celsius) d\'epend des tables
+ enthalpie-temp\'erature fournies par l'utilisateur.
+\item la puissance \'electromagn\'etique dissip\'ee par effet Joule,
+ \var{PROPCE(*,IPPROC(IEFJOU))} (terme source positif pour l'enthalpie),
+\item les trois composantes des forces de Laplace,
+ \var{PROPCE(*,IPPROC(ILAPLA(i)))} (avec \var{i} variant de 1 \`a 3)
+ en arc \'electrique (\var{IPPMOD(IELARC)}=2).
+\end{itemize}
+
+\bigskip
+La conductivit\'e \'electrique est {\it a priori} variable et
+conserv\'ee dans le tableau de propri\'et\'es aux cellules
+\var{PROPCE(*,IPPROC(IVISLS(IPOTR)))}. Elle intervient dans l'\'equation de
+Poisson portant sur le potentiel scalaire. Lorsque le potentiel scalaire a une
+partie imaginaire, la conductivit\'e n'est pas dupliqu\'ee~:
+les entiers \var{IPPROC(IVISLS(IPOTI))} et \var{IPPROC(IVISLS(IPOTR))} pointent sur la
+m\^eme case du tableau \var{PROPCE}. La conductivit\'e associ\'ee au potentiel
+vecteur est uniforme et de valeur unit\'e (\var{VISLS0(IPOTVA(i))}=1.D0
+avec \var{i} variant de 1 \`a 3).
+
+Le champ \'electrique, la densit\'e de courant et le champ magn\'etique ne sont
+stock\'es que de mani\`ere temporaire (voir \fort{elflux}).
+
+
+\newpage
+
+\subsection{Arbre d'appel simplifi\'e}
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{usini1} & & &
+ & Initialisation des mots-cl\'es utilisateur g\'en\'eraux et positionnement des variables\\
+ &\fort{usppmo} & &
+ & D\'efinition du module ``physique particuli\`ere'' employ\'e\\
+ &\fort{varpos} & &
+ & Positionnement des variables \\
+ & & \fort{pplecd} &
+ & Branchement des physiques particuli\`eres pour la lecture de fichier de donn\'ees \\
+ & & & \fort{ellecd}*
+ & Lecture du fichier de donn\'ees pour les arcs \'electriques \fort{dp\_ELE} \\
+ & & \fort{ppvarp} &
+ & Branchement des physiques particuli\`eres pour le positionnement des inconnues \\
+ & & & \fort{elvarp}*
+ & Positionnement des inconnues (enthalpie, potentiels, fractions massiques) \\
+ & & \fort{ppprop} &
+ & Branchement des physiques particuli\`eres pour le positionnement des propri\'et\'es\\
+ & & & \fort{elprop}*
+ & Positionnement des propri\'et\'es (temp\'erature, effet Joule, forces de Laplace) \\
+%
+\fort{ppini1} & & &
+ & Branchement des physiques particuli\`eres pour l'initialisation des
+mots-cl\'es sp\'ecifiques \\
+ &\fort{elini1} & &
+ & Initialisation des mots-cl\'es pour le module \'electrique\\
+ &\fort{useli1} & &
+ & Initialisation des mots-cl\'es utilisateur pour le module \'electrique\\
+ &\fort{elveri} & &
+ & V\'erification des mots-cl\'es pour le module \'electrique\\
+\end{tabular}
+\caption{Sous-programme \fort{initi1}~: initialisation des mots-cl\'es et
+positionnement des variables}
+\end{center}
+\end{table}
+
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{ppiniv} & & &
+ & Branchement des physiques particuli\`eres pour l'initialisation des variables \\
+ & \fort{eliniv}*& &
+ & Initialisation des variables sp\'ecifiques au module \'electrique \\
+ & & \fort{elthht}*&
+ & Transformation temp\'erature-enthalpie et enthalpie-temp\'erature par
+ interpolation sur la base du fichier de donn\'ees \fort{dp\_ELE}
+ (arc \'electrique uniquement) \\
+ & & \fort{useliv} &
+ & Initialisation des variables par l'utilisateur \\
+ & & & \fort{elthht}*
+ & Transformation temp\'erature-enthalpie et enthalpie-temp\'erature par
+ interpolation sur la base du fichier de donn\'ees \fort{dp\_ELE}
+ (arc \'electrique uniquement) \\
+\end{tabular}
+\caption{Sous-programme \fort{inivar}~: initialisation des variables}
+\end{center}
+\end{table}
+
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{phyvar} & & &
+ & Calcul des propri\'et\'es physiques variables \\
+ & \fort{ppphyv} & &
+ & Branchement des physiques particuli\`eres pour le calcul des
+ propri\'et\'es physiques variables \\
+ & \fort{elphyv} & &
+ & Calcul des propri\'et\'es physiques variables pour le module
+ \'electrique. En arc \'electrique, les propri\'et\'es sont
+ calcul\'ees par interpolation \`a partir des tables fournies
+ dans le fichier de donn\'ees \fort{dp\_ELE}\\
+ & & \fort{elthht}*&
+ & Transformation temp\'erature-enthalpie et enthalpie-temp\'erature par
+ interpolation sur la base du fichier de donn\'ees \fort{dp\_ELE}
+ (arc \'electrique uniquement) \\
+ & & \fort{uselph} &
+ & Calcul par l'utilisateur des propri\'et\'es physiques variables pour le module
+ \'electrique. Pour les \'etudes Joule, en particulier, les propri\'et\'es
+ doivent \^etre fournies ici sous forme de loi (des exemples sont
+ disponibles)\\
+ & & & \fort{usthht}
+ & Transformation temp\'erature-enthalpie et enthalpie-temp\'erature
+ fournie par l'utilisateur (plus sp\'ecifiquement pour les
+ \'etudes Joule, pour lesquelles on ne dispose pas d'un fichier
+ de donn\'ees \`a partir duquel r\'ealiser des interpolations avec \fort{elthht}) \\
+\end{tabular}
+\caption{Sous-programme \fort{tridim}~: partie 1 (propri\'et\'es physiques)}
+\end{center}
+\end{table}
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{ppclim} & & &
+ & Branchement des physiques particuli\`eres pour les conditions aux limites\\
+ & \fort{uselcl} & &
+ & Intervention de l'utilisateur pour les conditions aux limites (en lieu
+ et place de \fort{usclim}, m\^eme pour les variables qui ne sont
+ pas sp\'ecifiques au module \'electrique). Si un recalage
+ automatique des potentiels est demand\'e (\var{IELCOR=1}), il
+ doit \^etre pris en compte ici par le biais des variables
+ \var{DPOT} ou \var{COEJOU} (voir la description des
+ conditions aux limites). \\
+\fort{navsto} & & &
+ & R\'esolution des \'equations de Navier-Stokes\\
+ & \fort{preduv} & &
+ & Pr\'ediction de la vitesse~: prise en compte des forces de Laplace
+ calcul\'ees dans \fort{elflux} au pas de temps pr\'ec\'edent\\
+\fort{``turb''} & & &
+ & Turbulence : r\'esolution des \'equations pour les mod\`eles
+ n\'ecessitant des \'equations de convection-diffusion\\
+\fort{scalai}* & & &
+ & R\'esolution des \'equations portant sur les scalaires associ\'es aux
+ physiques particuli\`eres et des scalaires ``utilisateur'' \\
+ & \fort{covofi} & &
+ & R\'esolution successive de l'enthalpie, du potentiel scalaire
+ r\'eel et, si \var{IPPMOD(IELJOU)=2}, de la partie imaginaire du
+ potentiel scalaire (appels successifs \`a \fort{covofi} qui appelle
+ \fort{eltssc} pour le calcul du terme d'effet Joule au second
+ membre de l'\'equation de l'enthalpie)\\
+ & \fort{elflux}* & &
+ & Calcul du champ \'electrique, de la densit\'e de courant et de l'effet
+ Joule (premier de deux appels au cours du pas de temps courant) \\
+ & \fort{uselrc}* & &
+ & Recalage automatique \'eventuel
+ de
+ la densit\'e de courant, de l'effet Joule, des potentiels et
+ des coefficients \var{DPOT} et \var{COEJOU}.
+ Ce recalage, s'il a \'et\'e demand\'e
+ par l'utilisateur (\var{IELCOR}=1), est effectu\'e \`a partir
+ du deuxi\`eme pas de temps. \\
+ & \fort{covofi} & &
+ & R\'esolution successive, si \var{IPPMOD(IELARC)=2}, des trois
+ composantes du potentiel vecteur. On proc\`ede par
+ appels successifs \`a \fort{covofi} qui appelle
+ \fort{eltssc} pour le calcul du second membre de l'\'equation de
+ Poisson portant sur chaque composante du potentiel. \\
+ & \fort{covofi} & &
+ & R\'esolution successive des \var{NGAZG-1} fractions massiques
+ caract\'erisant la composition du fluide, s'il est
+ multiconstituant.
+ On proc\`ede par appels successifs \`a \fort{covofi}. \\
+ & \fort{elflux}* & &
+ & En arc \'electrique, calcul du champ magn\'etique et
+ des trois composantes des forces de
+ Laplace (deuxi\`eme et dernier appel au cours du pas de temps courant)\\
+ & \fort{covofi} & &
+ & R\'esolution des scalaires ``utilisateur''\\
+\end{tabular}
+\caption{Sous-programme \fort{tridim}~: partie 2 (conditions aux limites,
+Navier-Stokes, turbulence et scalaires)}
+\end{center}
+\end{table}
+
+\newpage
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{llllp{10cm}}
+\fort{postlc} & & &
+ & Post-traitement\\
+ & \fort{ecrevo} & &
+ & \'Ecriture des variables \`a post-traiter\\
+ & & \fort{uselen}&
+ & Ajout au post-traitement de variables calcul\'ees par
+ l'utilisateur. En exemple activ\'e standard sont post-trait\'es,
+ s'ils existent, l'oppos\'e du champ \'electrique ({\it i.e.} le
+ gradient du potentiel scalaire, r\'eel ou complexe), le vecteur
+ densit\'e de courant imaginaire (en effet Joule), le champ
+ magn\'etique (en arc \'electrique) et enfin le module et l'argument
+ du potentiel (en effet Joule, avec \var{IPPMOD(IELJOU)=4})\\
+\end{tabular}
+\caption{Sous-programme \fort{tridim}~: partie 3 (post-traitement)}
+\end{center}
+\end{table}
+
+\newpage
+
+\subsection{Pr\'ecisions}
+
+\etape{\fort{ellecd}}
+
+Ce sous-programme r\'ealise la lecture du fichier de donn\'ees sp\'ecifique
+aux arcs \'electriques. On donne ci-dessous, \`a titre d'exemple, l'ent\^ete
+explicative et deux lignes de donn\'ees d'un fichier type. Ces valeurs sont interpol\'ees chaque
+fois que n\'ecessaire par \fort{elthht} pour d\'eterminer les propri\'et\'es
+physiques du fluide \`a une temp\'erature (une enthalpie) donn\'ee.
+
+{\scriptsize
+\begin{verbatim}
+# Nb d'especes NGAZG et Nb de points NPO (le fichier contient NGAZG blocs de NPO lignes chacun)
+# NGAZG NPO
+ 1 238
+#
+# Proprietes
+# T H ROEL CPEL SIGEL VISEL XLABEL XKABEL
+# Temperature Enthalpie Masse vol. Chaleur Conductivite Viscosite Conductivite Coefficient
+# volumique massique electrique dynamique thermique d'absorption
+# K J/kg kg/m3 J/(kg K) Ohm/m kg/(m s) W/(m K) -
+#
+ 300.00 14000. 1.6225 520.33 0.13214E-03 0.34224E-04 0.26712E-01 0.0000
+ 400.00 65800. 1.2169 520.33 0.13214E-03 0.34224E-04 0.26712E-01 0.0000
+\end{verbatim}
+}
+
+
+\etape{\fort{elvarp}}
+
+Ce sous-programme permet de positionner les inconnues de calcul list\'ees
+pr\'ec\'edemment. On y pr\'ecise \'egalement que la chaleur massique \`a
+pression constante est variable, ainsi que la conductivit\'e de tous les
+scalaires associ\'es au module \'electrique, hormis la conductivit\'e de
+l'\'eventuel potentiel vecteur (celle-ci est uniforme et de valeur unit\'e).
+
+
+\etape{\fort{elprop}}
+
+C'est dans ce sous-programme que sont positionn\'ees les propri\'et\'es stock\'ees
+dans le tableau \var{PROPCE}, et en particulier la temp\'erature, l'effet Joule
+et les forces de Laplace.
+
+\etape{\fort{eliniv}}
+
+Ce sous-programme permet de r\'ealiser les initialisations par d\'efaut
+sp\'ecifiques au module.
+
+En particulier, en $k-\varepsilon$, les deux variables
+turbulentes sont initialis\'ees \`a $10^{-10}$ (choix historique arbitraire,
+mais r\'eput\'e, lors de tests non r\'ef\'erenc\'es, permettre le d\'emarrage de
+certains calculs qui \'echouaient avec une initialisation classique).
+
+Les potentiels sont initialis\'es \`a z\'ero, de m\^eme que l'effet Joule. En
+arc \'electrique, les forces de Laplace sont initialis\'ees \`a z\'ero.
+
+Le fluide est suppos\'e monoconstituant (seule est pr\'esente la premi\`ere
+esp\`ece).
+
+En arc \'electrique, l'enthalpie est initialis\'ee \`a la valeur de l'enthalpie du m\'elange
+suppos\'e monoconstituant \`a la temp\'erature \var{T0(IPHAS)} donn\'ee
+dans \fort{usini1}. En effet Joule, l'enthalpie est initialis\'ee \`a z\'ero
+(mais l'utilisateur peut fournir une valeur diff\'erente dans \fort{useliv}).
+
+\etape{\fort{elthht}}
+
+Ce sous-programme permet de r\'ealiser (en arc \'electrique) les interpolations
+n\'ecessaires \`a la d\'e\-ter\-mi\-na\-tion des propri\'et\'es physiques du fluide, \`a
+partir des tables fournies dans le fichier de donn\'ees \fort{dp\_ELE}.
+
+On notera en particulier que ce sous-programme prend en argument le tableau
+\var{YESP(NESP)} qui repr\'esente la fraction massique des \var{NGAZG}
+constituants du fluide. Dans le code, on ne r\'esout que la fraction massique
+des \var{NGAZG}-1 premiers constituants. Avant chaque appel \`a \fort{elthht},
+la fraction massique du dernier constituant doit \^etre calcul\'ee comme le
+compl\'ement \`a l'unit\'e des autres fractions massiques.
+
+\etape{\fort{scalai}, \fort{elflux}, \fort{uselrc}}
+
+Le sous-programme \fort{scalai} permet de calculer, dans l'ordre souhait\'e,
+les \var{NSCAPP} scalaires ``physique particuli\`ere'' associ\'es au module
+\'electrique, puis de calculer les grandeurs interm\'ediaires n\'e\-ces\-sai\-res et
+enfin de
+r\'ealiser les op\'erations qui permettent d'assurer le recalage automatique
+des potentiels, lorsqu'il est requis par l'utilisateur ({\it i.e.} si \var{IELCOR=1}).
+
+Les \var{NSCAPP} scalaires ``physique particuli\`ere'' sont calcul\'es successivement par un
+appel \`a \fort{covofi} plac\'e dans une boucle portant sur les \var{NSCAPP}
+scalaires. L'algorithme tire profit de l'ordre sp\'ecifique dans lequel ils sont d\'efinis et donc
+r\'esolus (dans l'ordre~: enthalpie, potentiel scalaire, potentiel vecteur, fractions massiques).
+
+Pour \'eviter des variations trop brutales en d\'ebut de calcul, le terme source
+d'effet Joule n'est pris en compte dans l'\'equation de l'enthalpie qu'\`a
+partir du troisi\`eme pas de temps.
+
+Apr\`es la r\'esolution de l'enthalpie et du potentiel scalaire
+(r\'eel ou complexe), le sous-programme \fort{elflux} permet de calculer
+les trois composantes du champ \'electrique
+(que l'on stocke dans des tableaux de travail), puis la densit\'e de courant
+et enfin l'effet Joule, que l'on conserve dans le tableau \var{PROPCE(*,IPPROC(IEFJOU))}
+pour le pas temps suivant (apr\`es recalage \'eventuel dans \fort{uselrc} comme
+indiqu\'e ci-apr\`es).
+Lorsque \var{IPPMOD(IELJOU)=2}, l'apport de la partie imaginaire est pris en
+compte pour le calcul de l'effet Joule. Lorsque \var{IPPMOD(IELARC)=2}
+(arc \'electrique), le vecteur densit\'e de courant est
+conserv\'e dans \var{PROPCE}, en lieu et place des forces de Laplace
+\var{PROPCE(*,IPPROC(ILAPLA(i)))}~: il est utilis\'e pour le calcul du potentiel vecteur dans le
+second appel \`a \fort{elflux},
+apr\`es recalage \'eventuel par \fort{uselrc} (en effet, il n'est plus
+n\'ecessaire de conserver les forces de Laplace \`a ce stade puisque
+la seule \'equation dans laquelle elles interviennent est l'\'equation de la
+quantit\'e de mouvement et qu'elle a d\'ej\`a \'et\'e r\'esolue).
+
+\`A la suite de \fort{elflux},
+le sous-programme \fort{uselrc} effectue le recalage permettant d'adapter automatiquement
+les conditions aux limites portant sur les potentiels, si l'utilisateur l'a
+demand\'e ({\it i.e.} si \var{IELCOR=1}).
+On se reportera au paragraphe relatif aux conditions aux limites. On pr\'ecise
+ici que le coefficient de recalage \var{COEPOT} permet d'adapter l'effet Joule
+\var{PROPCE(*,IPPROC(IEFJOU))} et la diff\'erence de potentiel \var{DPOT}
+(utile pour les conditions aux limites portant sur le potentiel scalaire au pas
+de temps suivant\footnote{{\it A priori}, \var{DPOT} n'est pas n\'ecessaire pour les
+cas Joule.}).
+Pour les cas d'arc \'electrique, \var{COEPOT} permet \'egalement de
+recaler le vecteur densit\'e de courant que l'on vient
+de stocker temporairement dans \var{PROPCE(*,IPPROC(ILAPLA(i)))} et qui va
+servir imm\'ediatement \`a calculer le potentiel vecteur.
+Pour les cas Joule, on recale en outre le coefficient \var{COEJOU} (utile
+pour les conditions aux limites portant sur le potentiel scalaire au pas de
+temps suivant).
+
+Pour les cas d'arc \'electrique (\var{IPPMOD(IELARC)=2}),
+apr\`es \fort{elflux} et \fort{uselrc},
+la r\'esolution s\'equentielle des inconnues scalaires se poursuit dans
+\fort{scalai} avec le calcul des trois composantes du potentiel vecteur. Le second membre de
+l'\'equation de Poisson consid\'er\'ee d\'epend de la densit\'e de courant qui,
+dans \fort{elflux}, a \'et\'e temporairement stock\'ee dans le tableau
+\var{PROPCE(*,IPPROC(ILAPLA(i)))} et qui, dans \fort{uselrc}, vient d'\^etre
+recal\'ee si \var{IELCOR=1}.
+Les valeurs du potentiel vecteur obtenues int\`egrent donc naturellement l'\'eventuel
+recalage.
+
+Pour les cas d'arc \'electrique (\var{IPPMOD(IELARC)=2}), un second appel \`a
+\fort{elflux} permet alors de calculer le champ magn\'etique
+que l'on stocke dans des tableaux de travail et les forces de Laplace que l'on stocke dans
+\var{PROPCE(*,IPPROC(ILAPLA(i)))} pour le pas de temps suivant (la densit\'e de
+courant, que l'on avait temporairement conserv\'ee dans ce tableau, ne servait
+qu'\`a calculer le second membre de l'\'equation de Poisson portant sur le
+potentiel vecteur~: il n'est donc plus n\'ecessaire de la conserver).
+
+La r\'esolution s\'equentielle des inconnues scalaires sp\'ecifiques au module se poursuit dans
+\fort{scalai}, avec le calcul des \var{NGAZG}-1 fractions massiques permettant
+de d\'efinir la composition du fluide.
+
+Pour terminer, \fort{scalai} permet la r\'esolution des scalaires
+``utilisateurs'' (appel \`a \fort{covofi} dans une boucle portant sur les
+\var{NSCAUS} scalaires utilisateur).
+
+On peut remarquer pour finir que les termes sources des \'equations de la quantit\'e de
+mouvement (forces de Laplace) et de l'enthalpie (effet Joule) sont disponibles
+\`a la fin du pas de temps $n$ pour une utilisation au pas de temps $n+1$ (de ce
+fait, pour permettre les reprises de calcul, ces termes sources sont stock\'es dans le fichier suite auxiliaire, ainsi que \var{DPOT}
+et \var{COEJOU}).
+
+\newpage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\etape{Mobilit\'e ionique} Le module est \`a d\'evelopper.
+
+\etape{Conditions aux limite en Joule} La prise en compte de conditions aux
+limites coupl\'ees entre \'electrodes reste \`a faire.
+
+\etape{Compressible en arc \'electrique} Les d\'eveloppements du module
+compressible de \CS doivent \^etre rendus compatibles avec le module arc \'electrique.
diff --git a/doc/theory/gradmc.tex b/doc/theory/gradmc.tex
new file mode 100644
index 0000000..1d81745
--- /dev/null
+++ b/doc/theory/gradmc.tex
@@ -0,0 +1,445 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{gradmc}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le but de ce sous-programme est de calculer, au centre des cellules, le gradient
+d'une fonction scalaire, \'egalement connue au centre des cellules.
+Pour obtenir la valeur de toutes les composantes du gradient, une m\'ethode de
+minimisation par moindres carr\'es est mise en
+\oe uvre~: elle utilise l'estimation d'une composante du gradient aux faces,
+obtenue \`a partir des
+valeurs de la fonction au centre des cellules voisines. Cette m\'ethode est
+activ\'ee lorsque l'indicateur IMRGRA vaut~1 et on l'utilise alors pour le calcul
+des gradients de toutes les grandeurs. Elle est beaucoup plus rapide que la m\'ethode
+utilis\'ee par d\'efaut (\var{IMRGRA}=0), mais pr\'esente l'inconv\'enient
+d'\^etre moins robuste
+sur des maillages non orthogonaux, le gradient produit \'etant moins r\'egulier.
+% (bien que de m\^eme ordre en espace) J'en sais rien dans l'absolu !.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{figure}[h]
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facebord}}}
+\caption{\label{Base_Gradmc_fig_geom_gradmc}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+
+On se reportera aux notations de la figure \ref{Base_Gradmc_fig_geom_gradmc}.
+On cherche \`a calculer $\vect{G}_{c,i}$, gradient au centre de la cellule $i$ de la
+fonction scalaire $P$. Soit $\vect{G}_{f,ij}\,.\,\vect{d}_{ij}$ une estimation
+\`a la face $ij$ (dont les voisins sont les cellules $i$ et $j$)
+du gradient projet\'e dans la direction du vecteur $\vect{d}_{ij}$ (\`a pr\'eciser).
+De m\^eme, on note
+$\vect{G}_{fb,ik}\,.\,\vect{d}_{b,ik}$ une estimation \`a la face de bord $ik$
+($k^{\text{i\`eme}}$ face de bord appuy\'ee sur la cellule $i$) du gradient projet\'e dans
+la direction du vecteur $\vect{d}_{b,ik}$ (\`a pr\'eciser).
+L'id\'eal serait de pouvoir trouver un vecteur $\vect{G}_{c,i}$ tel que, pour toute
+face interne $ij$ ($j\in Vois(i)$) et toute face de bord $ik$
+($k\in\gamma_b(i))$, on ait~:
+\begin{equation}
+\left\{\begin{array}{c}
+\vect{G}_{c,i}\,.\,\vect{d}_{ij}=\vect{G}_{f,ij}\,.\,\vect{d}_{ij}\\
+\vect{G}_{c,i}\,.\,\vect{d}_{b,ik}=\vect{G}_{f,b,ik}\,.\,\vect{d}_{b,ik}
+\end{array}\right.
+\end{equation}
+
+
+
+
+Comme il est g\'en\'eralement impossible d'obtenir l'\'egalit\'e, on cherche
+\`a minimiser la fonctionnelle~$\mathcal{F}_i$ suivante~:
+\begin{equation}\label{Base_Gradmc_eq_fonctionnelle_gradmc}
+\mathcal{F}_i(\vect{G}_{c,i},\vect{G}_{c,i})=
+\frac{1}{2}\sum\limits_{j\in Vois(i)}\left[
+\vect{G}_{c,i}\,.\,\vect{d}_{ij}-\vect{G}_{f,ij}\,.\,\vect{d}_{ij}
+\right]^2+
+\frac{1}{2}\sum\limits_{k\in \gamma_b(i)}\left[
+\vect{G}_{c,i}\,.\,\vect{d}_{b,ik}-\vect{G}_{f,b,ik}\,.\,\vect{d}_{b,ik}
+\right]^2
+\end{equation}
+
+Pour ce faire, on annule la d\'eriv\'ee de
+$\mathcal{F}_i(\vect{G}_{c,i},\vect{G}_{c,i})$
+par rapport \`a
+chacune des trois composantes ($G_{c,i,x}, G_{c,i,y}, G_{c,i,z}$) du vecteur
+inconnu $\vect{G}_{c,i}$ et l'on r\'esout le syst\`eme qui en r\'esulte.
+
+Pour pouvoir inverser le syst\`eme localement et donc \`a faible co\^ut, on
+cherche \`a \'eviter les d\'ependances de $\vect{G}_{f,ij}\,.\,\vect{d}_{ij}$ et
+de $\vect{G}_{f,b,ik}\,.\,\vect{d}_{b,ik}$ au gradient $\vect{G}_{c,j}$
+(gradient pris dans les cellules voisines). Un choix particulier du vecteur
+$\vect{d}$ permet d'atteindre ce but~:
+\begin{equation}
+\vect{d}_{ij} = \frac{\vect{IJ}}{||\vect{IJ}||} \text{\ \ et\ \ } \vect{d}_{b,ik} = \frac{(\vect{I'F})_l}{||\vect{I'F}||}=\vect{n}_{b,ik}
+\end{equation}
+
+
+Ainsi, pour les faces internes, le vecteur $\vect{d}$ est le vecteur norm\'e joignant
+le centre des cellules voisines. La quantit\'e
+$\vect{G}_{f,ij}\,.\,\vect{d}_{ij}$ est reli\'ee directement aux
+valeurs de la variable $P$ prises au centre des cellules, sans faire intervenir
+de gradient~:
+\begin{equation}
+\vect{G}_{f,ij}\,.\,\vect{d}_{ij}=\frac{P_j-P_i}{||\vect{IJ}||}
+\end{equation}
+
+Pour les faces de bord, il est possible d'opter pour un choix plus naturel sans pour
+autant faire intervenir le gradient des cellules voisines~: on utilise pour
+$\vect{d}$ le vecteur
+norm\'e orthogonal \`a la face, dirig\'e vers l'ext\'erieur (le gradient le
+mieux connu, en particulier au bord, \'etant le gradient normal aux faces).
+On a alors~:
+\begin{equation}
+\vect{G}_{f,b,ik}\,.\,\vect{d}_{b,ik}=\frac{P_{b,ik}-P_{i'}}{||\vect{I'F}||}
+\end{equation}
+
+On utilise alors les relations (\ref{Base_Gradmc_eq_val_bord_gradmc}) au bord ($A_{ik}$ et $B_{ik}$
+permettent de
+repr\'esenter les conditions aux limites impos\'ees, $P_{b,ik}$ en est issue et
+repr\'esente la valeur \`a la face de bord)~:
+\begin{equation}
+\left\{\begin{array}{ll}\label{Base_Gradmc_eq_val_bord_gradmc}
+P_{i'}&=P_{i}+\vect{II'}.\vect{G}_{c,i}\\
+P_{b,ik}&=A_{ik}+B_{ik}\,P_{i'}=A_{ik}+B_{ik}\,(P_{i}+\vect{II'}.\vect{G}_{c,i})
+\end{array}\right.
+\end{equation}
+
+On obtient finalement~:
+\begin{equation}\label{Base_Gradmc_eq_grad_bord_gradmc}
+\vect{G}_{f,b,ik}\,.\,\vect{d}_{b,ik}
+=\frac{1}{||\vect{I'F}||}\left[A_{ik}+(B_{ik}-1)\,(P_{i}+\vect{II'}.\vect{G}_{c,i})\right]
+\end{equation}
+
+L'\'equation (\ref{Base_Gradmc_eq_grad_bord_gradmc}), qui fait intervenir $\vect{G}_{c,i}$,
+doit \^etre utilis\'ee pour modifier
+l'expression (\ref{Base_Gradmc_eq_fonctionnelle_gradmc}) de la fonctionnelle avant de prendre sa
+diff\'erentielle. Ainsi~:
+\begin{equation}\label{Base_Gradmc_eq_fonctionnelle_mod_gradmc}
+\begin{array}{ll}
+\mathcal{F}_i(\vect{G}_{c,i},\vect{G}_{c,i})=&
+\displaystyle\frac{1}{2}\sum\limits_{j\in Vois(i)}\left[
+\vect{G}_{c,i}\,.\,\vect{d}_{ij}-\vect{G}_{f,ij}\,.\,\vect{d}_{ij}
+\right]^2+\\
+&\displaystyle\frac{1}{2}\sum\limits_{k\in \gamma_b(i)}\left[
+\vect{G}_{c,i}\,.\,(\vect{d}_{b,ik}-\frac{B_{ik}-1}{||\vect{I'F}||}\,\vect{II'})
+-\frac{1}{||\vect{I'F}||}\left(A_{ik}+(B_{ik}-1)\,P_{i}\right)
+\right]^2
+\end{array}
+\end{equation}
+
+
+
+
+
+On annule alors la d\'eriv\'ee de
+$\mathcal{F}_i(\vect{G}_{c,i},\vect{G}_{c,i})$
+par rapport \`a
+chacune des trois composantes ($G_{c,i,x}, G_{c,i,y}, G_{c,i,z}$) du vecteur
+inconnu $\vect{G}_{c,i}$. On
+obtient, pour chaque cellule $i$, le syst\`eme $3\times3$ local
+(\ref{Base_Gradmc_eq_systeme_matriciel_gradmc})~:
+\begin{equation}\label{Base_Gradmc_eq_systeme_matriciel_gradmc}
+\underbrace{
+\left[\begin{array}{ccc}
+\displaystyle
+C_{i,x\,x}
+& C_{i,x\,y}
+& C_{i,x\,z}\\
+\displaystyle
+C_{i,y\,x}
+& C_{i,y\,y}
+& C_{i,y\,z}\\
+\displaystyle
+C_{i,z\,x}
+& C_{i,z\,y}
+& C_{i,z\,z}
+\end{array}\right]
+}_{\tens{C}_i}
+\underbrace{
+\left[\begin{array}{c}
+G_{c,i,x} \\ G_{c,i,y} \\ G_{c,i,z}
+\end{array}\right]
+}_{\vect{G}_{c,i}}
+=
+\underbrace{
+\left[\begin{array}{c}
+\displaystyle
+T_{i,x}\\
+\displaystyle
+T_{i,y}\\
+\displaystyle
+T_{i,z}
+\end{array}\right]
+}_{\vect{T}_{i}}
+\end{equation}
+
+avec
+
+
+\begin{equation}
+\left\{\begin{array}{ll}
+C_{i,l\,m} &=\displaystyle
+ \sum\limits_{j\in Vois(i)}(\vect{d}_{ij})_{l}(\vect{d}_{ij})_{m}
++\sum\limits_{k\in\gamma_b(i)}\left(\vect{d}_{b,ik}-\frac{B_{ik}-1}{||\vect{I'F}||}\,\vect{II'}\right)_{l}
+ \left(\vect{d}_{b,ik}-\frac{B_{ik}-1}{||\vect{I'F}||}\,\vect{II'}\right)_{m} \\
+T_{i,l} &=\displaystyle
+ \sum\limits_{j\in Vois(i)}(\vect{G}_{f,ij}\,.\,\vect{d}_{ij})(\vect{d}_{ij})_l
++\sum\limits_{k\in \gamma_b(i)}\frac{1}{||\vect{I'F}||}\left(A_{ik}+(B_{ik}-1)\,P_{i}\right)
+ \left(\vect{d}_{b,ik}-\frac{B_{ik}-1}{||\vect{I'F}||}\,\vect{II'}\right)_l
+\end{array}\right.
+\end{equation}
+
+On obtient finalement~:
+\begin{equation}
+\begin{array}{ll}
+C_{i,l\,m} &= \displaystyle
+\sum\limits_{j\in Vois(i)}\frac{1}{||\vect{IJ}||^2}(\vect{IJ})_l(\vect{IJ})_m
++\sum\limits_{k\in \gamma_b(i)}\left(\vect{n}_{b,ik}+\frac{1-B_{ik}}{||\vect{I'F}||}\,\vect{II'}\right)_{l}
+ \left(\vect{n}_{b,ik}+\frac{1-B_{ik}}{||\vect{I'F}||}\,\vect{II'}\right)_{m}\\
+T_{i,l} &=\displaystyle
+\sum\limits_{j\in Vois(i)}\left(P_j-P_i\right)\frac{(\vect{IJ})_l}{||\vect{IJ}||^2}
++\sum\limits_{k\in\gamma_b(i)}\frac{1}{||\vect{I'F}||}\left(A_{ik}+(B_{ik}-1)\,P_i\right)
+ \left(\vect{n}_{b,ik}-\frac{B_{ik}-1}{||\vect{I'F}||}\,\vect{II'}\right)_{l}
+\end{array}
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+La variable dont il faut calculer le gradient est contenue dans le tableau
+\var{PVAR}. Les conditions aux limites associ\'ees sont disponibles au travers
+des tableaux \var{COEFAP} et \var{COEFBP} qui repr\'esentent respectivement les
+grandeurs $A$ et $B$ utilis\'ees ci-dessus. Les trois composantes du gradient
+seront contenues, en sortie du sous-programme, dans les tableaux \var{DPDX},
+\var{DPDY} et \var{DPDZ}.
+
+
+\etape{Calcul de la matrice}
+Les \var{NCEL} matrices $\tens{C}_{i}$ (matrices $3\times 3$) sont
+stock\'ees dans le tableau \var{COCG},
+(de dimension $\text{\var{NCELET}}\times 3\times 3$). Ce dernier est initialis\'e \`a z\'ero,
+puis son remplissage est r\'ealis\'e dans des boucles sur les faces internes et
+les faces de bord. Les matrices $\tens{C}_{i}$ \'etant sym\'etriques, ces boucles ne
+servent qu'\`a remplir la partie triangulaire sup\'erieure, le reste \'etant
+compl\'et\'e \`a la fin par sym\'etrie.
+
+Pour \'eviter de r\'ealiser plusieurs fois les m\^emes calculs
+g\'eom\'etriques, on conserve, en sortie de sous-programme,
+dans le tableau \var{COCG}, l'inverse des \var{NCEL} matrices $\tens{C}_{i}$.
+De plus, pour les \var{NCELBR} cellules qui ont au moins une face
+de bord, on conserve dans tableau \var{COCGB}, de dimension
+$\text{\var{NCELBR}}\times 3\times 3$, la contribution aux matrices $\tens{C}_{i}$
+des termes purement g\'eom\'etriques. On pr\'ecise ces points ci-dessous.
+Notons donc d\`es \`a pr\'esent qu'il ne faut pas utiliser les tableaux
+\var{COCG} et \var{COCGB} par ailleurs comme tableaux de travail.
+
+
+\hspace*{1cm}{\bf Cellule ne poss\'edant pas de face de bord}\\
+Lorsque, pour une cellule, aucune des faces n'est une face de bord du domaine,
+l'expression de la matrice $\tens{C}_{i}$ ne fait intervenir que des grandeurs
+g\'eom\'etriques et elle reste inchang\'ee tant que le maillage n'est
+pas d\'eform\'e. Son inverse n'est donc calcul\'e qu'une seule
+fois, au premier appel de \var{GRADMC} avec \var{ICCOCG=1} (l'indicateur
+\var{INICOC}, local \`a \var{GRADMC}, est positionn\'e \`a 0
+d\`es lors que ces calculs g\'eom\'etriques ont \'et\'e r\'ealis\'es une fois).
+Le tableau \var{COCG} est ensuite
+r\'eutilis\'e lors des appels ult\'erieurs au sous-programme
+\var{GRADMC}.
+
+\hspace*{1cm}{\bf Cellule poss\'edant au moins une face de bord}\\
+Lorsque l'ensemble des faces d'une cellule contient au moins une face de bord
+du domaine, un terme contributeur aux matrices $\tens{C}_{i}$ est
+sp\'ecifique \`a la variable dont on cherche
+\`a calculer le gradient, au travers du coefficient $B_{ik}$
+issu des conditions aux limites. Il s'agit de~:
+
+\begin{equation}\label{Base_Gradmc_eq_termes_de_bord_de_C_gradmc}
+\sum\limits_{k\in \gamma_b(i)}\left(\vect{n}_{b,ik}+\frac{1-B_{ik}}{||\vect{I'F}||}\,\vect{II'}\right)_{l}
+ \left(\vect{n}_{b,ik}+\frac{1-B_{ik}}{||\vect{I'F}||}\,\vect{II'}\right)_{m}
+\end{equation}
+
+
+
+Au premier appel r\'ealis\'e avec \var{ICCOCG=1}, on calcule la contribution des faces
+internes et on les stocke dans le tableau \var{COCGB}, qui
+sera disponible lors des appels ult\'erieurs. En effet, la
+contribution des faces internes est de nature purement g\'eom\'etrique et reste
+donc inchang\'ee tant que le maillage ne subit pas de d\'eformation. Elle s'\'ecrit~:
+\begin{equation}\notag
+\displaystyle\sum\limits_{j\in Vois(i)}\frac{1}{||\vect{IJ}||^2}(\vect{IJ})_l(\vect{IJ})_m
+\end{equation}
+\`A tous les appels r�alis�s avec \var{ICCOCG=1}, les termes
+qui d\'ependent des faces de bord (\ref{Base_Gradmc_eq_termes_de_bord_de_C_gradmc}) sont ensuite
+calcul\'es et on additionne cette contribution et \var{COCGB} qui contient celle
+des faces internes : on obtient ainsi les matrices $\tens{C}_i$ dans le tableau
+\var{COCG}. Leur inverse se calcule ind\'ependamment pour chaque
+cellule et on le conserve dans \var{COCG} qui sera disponible lors des appels
+ult\'erieurs.
+
+Lorsque \var{GRADMC} a \'et\'e appel\'e une fois avec \var{ICCOCG=1},
+des calculs peuvent \^etre \'evit\'es en
+positionnant l'indicateur \var{ICCOCG} \`a 0 (si
+\var{ICCOCG} est positionn\'e \`a 1, tous les calculs relatifs aux cellules
+ayant au moins une face de bord sont refaits).
+
+\begin{itemize}
+\item [-] Si \var{GRADMC} est utilis\'e pour
+calculer le gradient de la m\^eme variable (ou, plus g\'en\'eralement, d'une
+variable dont les conditions aux limites conduisent aux m\^emes valeurs du
+coefficient $B_{ik}$), les matrices $\tens{C}_{i}$ sont inchang\'ees et leur
+inverse est disponible dans \var{COCG} (on positionne \var{ICCOCG} \`a 0 pour
+\'eviter de refaire les calculs).
+\item [-] Dans le cas contraire, les termes relatifs aux faces de
+bord (\ref{Base_Gradmc_eq_termes_de_bord_de_C_gradmc}) sont recalcul\'es et on additionne
+cette contribution et \var{COCGB} qui fournit celle
+des faces internes : on obtient ainsi les matrices $\tens{C}_{i}$ dans
+\var{COCG}. Il reste alors \`a inverser ces matrices.
+\end{itemize}
+
+\hspace*{1cm}{\bf Remarque~:}\\
+Pour sauvegarder les contributions g\'eom\'etriques dans \var{COCGB}, on a
+recours a une boucle portant sur les \var{NCELBR} cellules
+dont au moins une face est une face de bord du domaine. Le num\'ero de ces
+cellules est donn\'e par \var{IEL = ICELBR(II)} (\var{II} variant de 1 \`a
+\var{NCELBR}). Les op\'erations r\'ealis\'ees dans cette
+boucle sont du type \var{COCGB(II,1,1) = COCG(IEL,1,1)}. La structure
+(injective) de \var{ICELBR} permet de forcer la vectorisation de la boucle.
+
+
+\etape{Inversion de la matrice}
+On calcule les coefficients de la comatrice, puis l'inverse.
+Pour des questions de vectorisation, la boucle sur les \var{NCEL} \'el\'ements
+est remplac\'ee par une
+s\'erie de boucles en vectorisation forc\'ee sur des blocs de \var{NBLOC=1024}
+\'el\'ements. Le reliquat ($\var{NCEL}-E(\var{NCEL}/1024)\times 1024$) est
+trait\'e apr\`es les boucles.
+La matrice inverse est ensuite stock\'ee dans \var{COCG}
+(toujours en utilisant sa propri\'et\'e de sym\'etrie).
+
+\etape{Calcul du second membre et r\'esolution}
+Le second membre est stock\'e dans \var{BX}, \var{BY} et \var{BZ}. Le gradient
+obtenu par r\'esolution des syst\`emes locaux est stock\'e dans \var{DPDX},
+\var{DPDY} et \var{DPDZ}.
+
+
+\etape{Remarque : gradient sans reconstruction} (non consistant sur maillage non
+orthogonal)\\
+Dans le cas o\`u l'utilisateur souhaite ne pas reconstruire le gradient ({\it
+i.e.} ne pas inclure les termes de non orthogonalit\'e au calcul du gradient),
+une m\'ethode sp\'ecifique est mise en \oe uvre, qui n'a pas de rapport avec la
+m\'ethode de moindres carr\'es pr\'esent\'ee ci-dessus.
+
+Le volume de la cellule $i$ est not\'e $\Omega_i$.
+$P_{ij}$ (resp. $P_{b,ik}$) repr\'esente la valeur
+estim\'ee de la variable $P$ \`a la
+face interne $ij$ (resp. \`a la face de bord $ik$) de vecteur normal associ\'e
+$\vect{S}_{ij}$ (resp. $\vect{S}_{b,ik}$). Le gradient est
+simplement calcul\'e en utilisant la formule suivante~:
+\begin{equation}
+\begin{array}{ll}
+\vect{G}_{c,i}=
+&=\displaystyle\frac{1}{\Omega_i}\left[
+\sum\limits_{j\in Vois(i)}P_{ij}\vect{S}_{ij} +
+\sum\limits_{k\in\gamma_b(i)}P_{b,ik}\vect{S}_{b,ik}\right]
+\end{array}
+\end{equation}
+
+Les valeurs aux faces sont obtenues simplement comme suit (avec $\displaystyle\alpha_{ij}=\frac{\overline{FJ'}}{\overline{I'J'}}$)~:
+\begin{equation}
+\left\{\begin{array}{ll}
+P_{ij}
+&= \alpha_{ij}P_i+(1-\alpha_{ij})P_j\\
+P_{b,ik}
+&=A_{ik} +B_{ik}\,P_i
+\end{array}\right.
+\end{equation}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Vectorisation forc\'ee}
+Il est peut-\^etre possible de s'affranchir du d\'ecoupage en boucles de 1024 si
+les compilateurs sont capables
+d'effectuer la vectorisation sans cette aide. On note cependant que ce
+d\'ecoupage en boucles de 1024 n'a pas de co\^ut CPU suppl\'ementaire, et que
+le co\^ut m\'emoire associ\'e est n\'egligeable.
+Le seul inconv\'enient r\'eside dans la relative complexit\'e de l'\'ecriture.
+
+\etape{Choix du vecteur $d$}
+Le choix $\vect{d}_{ij}= \frac{\vect{IJ}}{||\vect{IJ}||}$ permet de calculer
+simplement une composante du gradient \`a la face en ne faisant intervenir que
+les valeurs de la variable au centre des cellules voisines. Le choix
+$\vect{d}_{ij}= \frac{\vect{I'J'}}{||\vect{I'J'}||}$ serait \'egalement
+possible, et peut-\^etre meilleur, mais conduirait naturellement \`a faire
+intervenir, pour le calcul de la composante du gradient normale aux faces, les
+valeurs de la variable aux points $I'$ et $J'$, et donc les valeurs du gradient
+dans les cellules voisines. Il en r\'esulterait donc un syst\`eme coupl\'e,
+auquel un algorithme it\'eratif (voir \var{GRADRC}) pourrait \^etre appliqu\'e.
+L'aspect temps calcul, atout majeur de la m\'ethode actuelle,
+s'en ressentirait sans doute.
+
+\etape{Am\'elioration de la m\'ethode}
+Cette m\'ethode rencontre des difficult\'es dans le cas de maillages assez ``non
+orthogonaux'' (cas de la voiture maill\'e en t\'etra\`edres par exemple). Une
+voie d'am\'elioration possible est d'utiliser un support \'etendu (le support est
+l'ensemble des cellules utilis\'ees pour calculer le gradient en une cellule
+donn\'ee). Un exemple est fourni sur la figure \ref{Base_Gradmc_fig_support_gradmc} ci-dessous~: si la cellule $I$
+est la cellule courante, on choisit pour
+support les cellules de centre $J$ telles que la droite $(IJ)$ soit la plus
+orthogonale possible \`a une face de la cellule $I$.
+
+
+\begin{figure}[htp]
+\centerline{\includegraphics[height=8cm]{support}}
+\caption{\label{Base_Gradmc_fig_support_gradmc}Diff\'erents supports pour le calcul du gradient.}
+\end{figure}
+
+
+
diff --git a/doc/theory/gradrc.tex b/doc/theory/gradrc.tex
new file mode 100644
index 0000000..6125511
--- /dev/null
+++ b/doc/theory/gradrc.tex
@@ -0,0 +1,644 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{gradrc}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Le but de ce sous-programme est de calculer, au centre des cellules, le gradient
+d'une fonction scalaire, \'egalement connue au centre des cellules.
+Pour obtenir la valeur du gradient, une m\'ethode it\'erative de
+reconstruction pour les maillages non orthogonaux est mise en
+\oe uvre~: elle fait appel \`a un d\'eveloppement limit\'e d'ordre 1 en espace
+sur la variable, obtenu \`a partir de la
+valeur de la fonction et de son gradient au centre de la cellule. Cette
+m\'ethode,
+choisie comme option par d\'efaut, correspond \`a \var{IMRGRA}\,=\,0 et est utilis\'ee pour le calcul
+des gradients de toutes les grandeurs. Cette technique est plus robuste mais beaucoup plus lente que la m\'ethode
+ par moindres carr\'es correspondant \`a \var{IMRGRA}\,=\,1.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\subsection{\bf M\'ethode g\'en\'erale}
+\begin{figure}[h]
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facebord}}}
+\caption{\label{Base_Gradrc_fig_geom_gradmc}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+
+On se reportera aux notations de la figure \ref{Base_Gradrc_fig_geom_gradmc}, qui
+correspondent \`a celles employ\'ees dans le sous-programme \fort{gradmc}.
+On cherche \`a calculer $\vect{G}_{\,c,i}$, gradient au centre de la cellule $i$ de la
+fonction scalaire $P$. Le volume de la cellule $i$ est not\'e $\Omega_i$.
+ Soit $\vect{G}_{\,f,ij}$ la valeur du gradient \`a la face $ij$ dont les voisins sont les cellules $i$ et $j$.
+%De m\^eme, on note $\vect{G}_{\,f,b_{\,ik}}$ la valeur du gradient \`a la face de
+%bord $ik$ ($k^{\text{i\`eme}}$ face de bord appuy\'ee sur la cellule $i$).
+$P_{ij}$ (resp. $P_{b,ik}$) repr\'esente la valeur estim\'ee de la variable $P$
+\`a la face interne $ij$ (resp. \`a la face de bord $ik$, $k^{\text{i\`eme}}$
+face de bord appuy\'ee sur la cellule $i$) de vecteur normal associ\'e
+$\vect{S}_{ij}$ (resp. $\vect{S}_{b_{\,ik}}$).
+
+Par d\'efinition~:\\
+\begin{equation}\notag
+\begin{array}{ll}
+\vect{G}_{\,c,i}&= (\grad {P})_{\,I} \\
+\vect{G}_{\,f,ij}&= (\grad P)_{\,f,ij}\\
+\end{array}
+\end{equation}
+On a~:
+\begin{equation}\notag
+\vect{G}_{\,f,ij}=(\grad {P})_{\,{O_{ij}}}= (\grad {P})_{\,{F_{ij}}}
+ \text{ (\`a l'ordre 1 en $P$)}
+\end{equation}
+Afin de prendre en compte les non orthogonalit\'es \'eventuelles du maillage, on calcule le
+gradient $\vect{G}_{\,c,i}$ en effectuant un d\'eveloppement limit\'e d'ordre
+1 en espace. On obtient alors~:
+\begin{equation}
+\begin{array}{llll}
+|\Omega_i|\,(\grad P)_{\,I}&\overset{\text{\it\small d\'ef}}{=}\displaystyle\int_{\Omega_i}{\grad{P}\, d\Omega}
+=\sum\limits_{j\in Vois(i)}P_{\,ij}\,{\vect S_{\,ij}} + \sum\limits_{k\in {\gamma_b(i)}} P_{\,b_{ik}}\,\vect{S}_{\,{b}_{ik}} \\
+ &= \sum\limits_{j\in Vois(i)}[P_{O_{ij}}+ \vect{O_{\,ij}F_{\,ij}}\,.\,(\grad
+P)_{\,{O_{ij}}}] \,{\vect S_{\,ij}}+ \sum\limits_{k\in {\gamma_b(i)}} (\var {INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_{I'} )\,\vect{S}_{\,{b}_{ik}}\\
+ &= \sum\limits_{j\in Vois(i)}\left[\,(\alpha_{\,ij}\,P_I +
+(1 - \alpha_{\,ij})\,P_J)\,\right]\,{\vect S_{\,ij}}
+ +\sum\limits_{j\in Vois(i)}\left[\vect{O_{\,ij}F_{\,ij}}\,.\,(\grad
+P)_{\,f,ij}\right]\,{\vect S_{\,ij}}\\
+&+ \sum\limits_{k\in {\gamma_b(i)}} (\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_{I'})\,\vect{S}_{\,{b}_{ik}}\\
+\end{array}
+\end{equation}
+
+La variable $\var{INC}$ permet d'affecter correctement les conditions aux limites des
+quantit\'es dont on veut prendre le gradient. En effet,\\
+$\bullet\ $ $\var{INC} = 1$ correspond \`a un calcul de gradient de variable totale et
+donc \`a des conditions aux limites standards,\\
+$\bullet\ $ $\var{INC} = 0$ correspond \`a un calcul de variable en incr\'ement et donc
+\`a des conditions aux limites associ\'ees homog\`enes.\\
+
+En faisant une approximation sur $P$ d'ordre 1 en espace \`a nouveau~:
+\begin{equation}\notag
+\left\{\begin{array}{ll}
+(\grad P)_{\,f,ij}& = \displaystyle\frac{1}{2}\left[(\grad P)_{\,I} +(\grad P)_{\,J}\right]\\
+P_{I'}&= P_I + \vect {II'}\,.\,(\grad P)_{\,I}\\
+\end{array}\right .
+\end{equation}
+
+d'o\`u :
+
+\begin{multline}\notag
+|\Omega_i|\,\vect{G}_{\,c,i}= \sum\limits_{j\in Vois(i)}\left[(\alpha_{\,ij}\,P_I
++ (1 - \alpha_{\,ij})\,P_J)\, + \frac{1}{2}\,\vect{O_{\,ij}F_{\,ij}}\,.\,
+\left(\,\vect{G}_{\,c,i} +\vect{G}_{\,c,j}\right)\right]\,{\vect S_{\,ij}}\\
++\sum\limits_{k\in {\gamma_b(i)}}\left[ \var{INC}\,A_{\,b,ik} +
+B_{\,b,ik}\,P_{I} + B_{\,b,ik}\,\vect {II'}\,.\,\vect{G}_{\,c,i}
+\right]\,\vect{S}_{\,{b}_{ik}}
+\end{multline}
+en notant $\displaystyle\alpha_{ij}=\frac{\overline{FJ'}}{\overline{I'J'}}$.
+
+On regroupe \`a gauche les termes en $\vect{G}_{\,c,i}$ et on obtient~:
+\begin{multline}\label{Base_Gradrc_eq_reconstruction}
+|\Omega_i|\,\vect{G}_{\,c,i} -
+\sum\limits_{j\in Vois(i)}\frac{1}{2}\,(\vect{O_{\,ij}F_{\,ij}}\,.\,\vect{G}_{\,c,i})\vect{S}_{\,ij}
+-\sum\limits_{k\in {\gamma_b(i)}} B_{\,b,ik}\,(\vect{II'}\,.\,\vect{G}_{\,c,i})\,\vect{S}_{\,b_{ik}}
+= \\
+\sum\limits_{j\in Vois(i)}\left[
+(\alpha_{\,ij}\,P_I + (1 - \alpha_{\,ij})\,P_J)\right]\,{\vect{S}_{\,ij}}
++\sum\limits_{j\in Vois(i)}\frac{1}{2}\,(\vect{O_{\,ij}F_{\,ij}}\,.\,\vect{G}_{\,c,j})\vect{S}_{\,ij}\\
++\sum\limits_{k\in {\gamma_b(i)}}(\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_{I})\,\vect{S}_{\,{b}_{ik}}
+\end{multline}
+
+ce qui donne pour la direction $\eta$ ($\eta ,\,\beta = \, x, \,y\,\, \text{ou} \, z$) :
+\begin{multline}\label{Base_Gradrc_eq_reconstruction_comp}
+|\Omega_i|\,{G}_{\,c,i,\eta} -
+\sum\limits_{j\in Vois(i)}\frac{1}{2}\,\left(\sum\limits_{\beta}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,{G}_{\,c,i,\,\beta}\right){S}_{\,ij,\,\eta}
+-\sum\limits_{k\in {\gamma_b(i)}} B_{\,b,ik}\,\left(\sum\limits_{\beta}(\vect{II'})_{,\,\beta}\,{G}_{\,c,i,\,\beta}\right)\,{S}_{\,b_{ik},\,\eta}
+= \\
+\sum\limits_{j\in Vois(i)}\left[
+(\alpha_{\,ij}\,P_I + (1 - \alpha_{\,ij})\,P_J)\right]\,{{S}_{\,ij,\,\eta}}
++\sum\limits_{j\in Vois(i)}\frac{1}{2}\,\left(\sum\limits_{\beta}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,{G}_{\,c,j,\,\beta}\right){S}_{\,ij,\,\eta}\\
++\sum\limits_{k\in {\gamma_b(i)}}(\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_{I})\,{S}_{\,{b}_{ik},\,\eta}
+\end{multline}
+\subsection{\bf Cas sans reconstruction des non orthogonalit\'es}
+Lorsque le maillage est orthogonal ou lorsqu'on ne veut pas reconstruire, seules
+les contributions d'ordre 0 au centre des cellules interviennent dans le
+calcul du gradient ($\vect{II'} = \vect{0}$, $\vect{OF} = \vect{0}$)~:
+\begin{equation}\notag
+\begin{array}{ll}
+|\Omega_i|\,\vect{G}_{\,c,i}&\overset{\text{\it\small d\'ef}}{=} \displaystyle\int_{\Omega_i}{\grad{P}\, d\Omega}
+=\sum\limits_{j\in Vois(i)}P_{\,ij}\,{\vect S_{\,ij}} + \sum\limits_{k\in {\gamma_b(i)}} P_{\,b,ik}\,\vect{S}_{\,{b}_{ik}} \\
+ &= \sum\limits_{j\in Vois(i)}\left[\,(\alpha_{\,ij}\,P_I +
+(1 - \alpha_{\,ij})\,P_J)\,\right]\,{\vect S_{\,ij}}
++ \sum\limits_{k\in {\gamma_b(i)}} (\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_I )\,\vect{S}_{\,{b}_{ik}}\\
+\end{array}
+\end{equation}
+d'o\`u :
+\begin{multline}\label{Base_Gradrc_eq_nonreconstruction}
+\vect{G}_{\,c,i}=\frac{1}{|\Omega_i|}\,.\left[\sum\limits_{j\in
+Vois(i)}\left[\alpha_{\,ij}\,P_I + (1 - \alpha_{\,ij})\,P_J)\, \right]\,{\vect S_{\,ij}}\right.
++\left.\sum\limits_{k\in {\gamma_b(i)}}(\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_I
+)\,\vect{S}_{\,{b}_{ik}} \right]
+\end{multline}
+
+\minititre{Remarque}
+Le gradient non reconstruit $ \vect{G}_{\,c,i}^{NRec} $ se calcule donc tr\`es
+facilement et directement {\it via} l'\'equation~(\ref{Base_Gradrc_eq_nonreconstruction}).
+Il n'est cependant pas consistant sur maillage non orthogonal.
+
+\subsection{\bf Reconstruction}
+\subsubsection{\bf M\'ethode de r\'esolution}
+
+Afin de pouvoir r\'esoudre le syst\`eme (\ref{Base_Gradrc_eq_reconstruction}), on va
+impliciter les termes en $\vect{G}_{\,c,i}$, expliciter ceux en
+$\vect{G}_{\,c,j}$ et raisonner de facon it\'erative en introduisant une suite
+d'incr\'ements~$(\delta\,\vect{G}^{\,k}_{\,i})_{k\in \grandN}$ d\'efinie par~:\\
+\begin{equation}
+\left\{\begin{array}{l}
+\delta\,\vect{G}^{\,0}_{\,i} = \vect{G}_{\,c,i}^{NRec}\\
+\delta\,\vect{G}^{\,k+1}_{\,i} = \vect{G}^{k+1}_{\,c,i}-\vect{G}^k_{\,c,i} \end{array}\right.
+\end{equation}
+
+et de syst\`eme associ\'e, dans la direction $\eta$~:
+
+\begin{multline}\label{Base_Gradrc_eq_reconstruction_comp2}
+|\Omega_i|\,{G}^{\,k+1}_{\,c,i,\eta} -
+\sum\limits_{j\in Vois(i)}\frac{1}{2}\,\left(\sum\limits_{\beta}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,{G}^{\,k+1}_{\,c,i,\,\beta}\right){S}_{\,ij,\,\eta}
+-\sum\limits_{k\in {\gamma_b(i)}} B_{\,b,ik}\,\left(\sum\limits_{\beta}(\vect{II'})_{,\,\beta}\,{G}^{\,k+1}_{\,c,i,\,\beta}\right)\,{S}_{\,b_{ik},\,\eta}\\
+= \sum\limits_{j\in Vois(i)}\left[
+(\alpha_{\,ij}\,P_I + (1 - \alpha_{\,ij})\,P_J)\right]\,{{S}_{\,ij,\,\eta}}
++\sum\limits_{j\in Vois(i)}\frac{1}{2}\,\left(\sum\limits_{\beta}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,{G}^{\,k}_{\,c,j,\,\beta}\right){S}_{\,ij,\,\eta}\\
++\sum\limits_{k\in {\gamma_b(i)}}(\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_{I})\,{S}_{\,{b}_{ik},\,\eta}
+\end{multline}\\
+ou, comme :
+\begin{equation}\notag
+ \vect{G}^{k+1}_{\,c,i}= \vect{G}^k_{\,c,i}+ \delta\,\vect{G}^{\,k+1}_{\,i}
+\end{equation}
+
+\begin{multline}\label{Base_Gradrc_eq_reconstruction_increment}
+|\Omega_i|\,{\delta\,G}^{\,k+1}_{\,i,\,\eta} -
+\sum\limits_{j\in Vois(i)}\frac{1}{2}\,\left(\sum\limits_{\beta}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,{\delta\,G}^{\,k+1}_{\,c,i,\,\beta}\right){S}_{\,ij,\,\eta}
+-\sum\limits_{k\in {\gamma_b(i)}} B_{\,b,ik}\,\left(\sum\limits_{\beta}(\vect{II'})_{,\,\beta}\,{\delta\,G}^{\,k+1}_{\,c,i,\,\beta}\right)\,{S}_{\,b_{ik},\,\eta}\\
+= -|\Omega_i|\,{G}^{\,k}_{\,c,i,\eta}
+ + \sum\limits_{j\in Vois(i)}\left[
+(\alpha_{\,ij}\,P_I + (1 - \alpha_{\,ij})\,P_J)\right]\,{{S}_{\,ij,\,\eta}}\\
++ \sum\limits_{j\in Vois(i)}\left(\sum\limits_{\beta}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,\,\frac{1}{2}\,({G}^{\,k}_{\,c,i,\,\beta}+\,{G}^{\,k}_{\,c,j,\,\beta})\right){S}_{\,ij,\,\eta}\\
++\sum\limits_{k\in {\gamma_b(i)}}(\var{INC}\,A_{\,b,ik} +
+B_{\,b,ik}\,(P_{I} + \,\left(\sum\limits_{\beta}(\vect{II'})_{,\,\beta}\,{G}^{\,k}_{\,c,i,\,\beta}\right)))\,{S}_{\,{b}_{ik},\,\eta}
+\end{multline}\\
+
+
+L'\'equation (\ref{Base_Gradrc_eq_reconstruction_increment}) conduit \`a un syst\`eme matriciel local par rapport \`a chacune des trois composantes (${\delta\,G}^{\,k+1}_{\,i,x},{\delta\,G}^{\,k+1}_{\,i,y},{\delta\,G}^{\,k+1}_{\,i,z}$) du vecteur
+inconnu $ \delta\,\vect{G}^{\,k+1}_{\,i}$. On obtient donc, pour chaque cellule~$i$, le syst\`eme $3\times3$ suivant~:
+\begin{equation}\label{Base_Gradrc_eq_systeme_matriciel_gradrc}
+\underbrace{
+\left[\begin{array}{ccc}
+\displaystyle
+C_{i,x\,x}
+& C_{i,x\,y}
+& C_{i,x\,z}\\
+\displaystyle
+C_{i,y\,x}
+& C_{i,y\,y}
+& C_{i,y\,z}\\
+\displaystyle
+C_{i,z\,x}
+& C_{i,z\,y}
+& C_{i,z\,z}
+\end{array}\right]
+}_{\tens{C}_{\,i}}
+\underbrace{
+\left[\begin{array}{c}
+{\delta\,G}^{\,k+1}_{\,i,x}\\{\delta\,G}^{\,k+1}_{\,i,y} \\ {\delta\,G}^{\,k+1}_{\,i,z}
+\end{array}\right]
+}_{\delta\,\vect{G}^{\,k+1}_{\,i}}
+=
+\underbrace{
+\left[\begin{array}{c}
+\displaystyle
+R^{\,k+1}_{i,x}\\
+\displaystyle
+R^{\,k+1}_{i,y}\\
+\displaystyle
+R^{\,k+1}_{i,z}
+\end{array}\right]
+}_{\vect{R}^{\,k+1}_{i}}
+\end{equation}
+
+avec, ($\eta ,\,\beta = \, x, \,y\,\, \text{ou} \, z$) :
+
+\begin{equation}\label{Base_Gradrc_eq_second_membre}
+\left\{\begin{array}{lll}
+C_{i,\eta\,\eta} &= |\Omega _i| - \displaystyle \frac{1}{2}\sum\limits_{j\in
+Vois(i)}(\vect{O_{\,ij}F_{\,ij}})_{,\,\eta}\,S_{\,ij,\,\eta} -\sum\limits_{k\in
+\gamma_b(i)} B_{\,b,ik}\,(\vect{II'})_{,\,\eta}\,S_{\,{b}_{ik},\,\eta}\\
+C_{i,\eta\,\beta} &= - \displaystyle \frac{1}{2}\sum\limits_{j\in
+Vois(i)}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,S_{\,{ij},\,\eta}
+ -\sum\limits_{k\in \gamma_b(i)}
+B_{\,b,ik}\,(\vect{II'})_{,\,\beta}\,S_{\,{b}_{ik},\,\eta} &\text{ pour $\eta
+\ne \beta$}\\
+R^{\,k+1}_{i,\eta} &= -|\Omega_i|\,{G}^{\,k}_{\,c,i,\eta}
+ + \sum\limits_{j\in Vois(i)}\left[
+(\alpha_{\,ij}\,P_I + (1 - \alpha_{\,ij})\,P_J)\right]\,{{S}_{\,ij,\,\eta}}\\
+&+ \sum\limits_{j\in Vois(i)}\left(\sum\limits_{\beta}(\vect{O_{\,ij}F_{\,ij}})_{,\,\beta}\,\,\displaystyle\frac{1}{2}\,({G}^{\,k}_{\,c,i,\,\beta}+\,{G}^{\,k}_{\,c,j,\,\beta})\right){S}_{\,ij,\,\eta}\\
+&+\displaystyle{\sum\limits_{k\in {\gamma_b(i)}}(\var{INC}\,A_{\,b,ik} +
+B_{\,b,ik}\,\left(P_{I} + \,\left(\sum\limits_{\beta}(\vect{II'})_{,\,\beta}\,{G}^{\,k}_{\,c,i,\,\beta}\right)\right))\,{S}_{\,{b}_{ik},\,\eta}}
+\end{array}\right.
+\end{equation}
+
+L'inversion de la matrice $\tens{C}_{\,i}$ permet de calculer
+$(\delta\,\vect{G}^{\,k+1}_{\,i})$ et donc $(\vect{G}^{\,k+1}_{\,i})$. Les
+it\'erations s'arr\^etent lorsque la norme euclidienne du second membre
+$\vect{R}^{\,k+1}_{\,i}$ tend vers z\'ero ({\it i.e.} lorsque la norme
+euclidienne de
+$(\delta\,\vect{G}^{\,k}_{\,i})$ tend vers z\'ero) ou lorsque le nombre
+d'it\'erations en $k$ fix\'e maximal est atteint.
+
+\minititre{Remarque 3}
+Pour les conditions aux limites en pression, un traitement particulier est mis
+en \oe uvre, surtout utile dans les cas o\`u un gradient de pression (hydrostatique
+ou autre) n\'ecessite une attention sp\'ecifique aux bords, o\`u une condition
+\`a la limite de type Neumann homog\`ene est g\'en\'eralement inadapt\'ee. Soit
+$P_{F_{\,b_{\,ik}}}$ la valeur de la pression \`a la face associ\'ee, que
+l'on veut calculer.
+
+On note que ~:
+\begin{equation}\notag
+\vect{I'F}_{\,b_{\,ik}} \,.\,(\grad P)_I = \vect{I'F}_{\,b_{\,ik}}
+\,.\,\vect{G}_{\,c,i} = \overline{I'F}_{\,b_{\,ik}} \,.\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{F_{\,b_{\,ik}}}
+\end{equation}
+avec les conventions pr\'ec\'edentes.\\
+\paragraph{\bf Sur maillage orthogonal }
+On se place dans le cas d'un maillage orthogonal , {\it i.e.} pour
+toute cellule $\Omega_I$, $I$ et son projet\'e $I'$ sont identiques.
+Soit $M_{\,b_{\,ik}}$ le milieu du segment $IF_{\,b_{\,ik}}$.\\
+On peut \'ecrire les \'egalit\'es suivantes~:
+\begin{equation}\notag
+\begin{array}{ll}
+P_{F_{\,b_{\,ik}}} & = P_{M_{\,b_{\,ik}}} + \overline{M_{\,b_{\,ik}}F_{\,b_{\,ik}}}\,.\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{M_{\,b_{\,ik}}} +
+\overline{M_{\,b_{\,ik}}F_{\,b_{\,ik}}}^{\,2}\,.\left.\displaystyle\frac{1}{2}\frac{{\delta}^{2} P}{\delta
+n^2}\right|_{M_{\,b_{\,ik}}} + \mathcal{O}(h^3)\\
+P_I & = P_{M_{\,b_{\,ik}}} + \overline{M_{\,b_{\,ik}}I}\,.
+\left. \displaystyle\frac{\delta P}{\delta n}\right|_{M_{\,b_{\,ik}}} +
+\overline{M_{\,b_{\,ik}}I}^{\,2}\,.\left.\displaystyle\frac{1}{2}
+\frac{{\delta}^{2} P}{\delta n^2}\right|_{M_{\,b_{\,ik}}} + \mathcal{O}(h^3)
+\end{array}
+\end{equation}
+avec $\overline{M_{\,b_{\,ik}}I} = - \overline{M_{\,b_{\,ik}}F_{\,b_{\,ik}}}$.\\
+On obtient donc~:
+\begin{equation}\label{Base_Gradrc_eq_orthogonal}
+P_{F_{\,b_{\,ik}}} - P_I = \overline{IF}_{\,b_{\,ik}}\,.\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{M_{\,b_{\,ik}}} + \mathcal{O}(h^3)
+\end{equation}
+Gr\^ace \`a la formule des accroissements finis :
+\begin{equation}\label{Base_Gradrc_eq_derivee_normale}
+\left. \displaystyle\frac{\delta P}{\delta n}\right|_{M_{\,b_{\,ik}}} =
+\displaystyle\frac{1}{2}\left[\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{I} + \left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{F_{\,b_{\,ik}}}\right] + \mathcal{O}(h^2)
+\end{equation}\\
+On s'int\'eresse aux cas suivants :\\\\
+\hspace*{0.5cm}{ $\bullet${\underline { condition \`a la limite de type Dirichlet}}}\\
+$P_{F_{\,b_{\,ik}}} = P_{IMPOSE}$, aucun traitement particulier\\\\
+\hspace*{0.5cm}{ $\bullet ${\underline { condition \`a la limite de type Neumann
+homog\`ene standard}}}\\
+On veut imposer :
+\begin{equation}
+\left. \displaystyle\frac{\delta P}{\delta n}\right|_{F_{\,b_{\,ik}}} = 0 + \mathcal{O}(h)
+\end{equation}
+On a~:
+\begin{equation}\notag
+\left. \displaystyle\frac{\delta P}{\delta n}\right|_{I} =
+\displaystyle\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{F_{\,b_{\,ik}}} + \mathcal{O}(h)
+\end{equation}
+et comme :
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = P_I + \overline{IF}_{\,b_{\,ik}}\,.\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_I + \mathcal{O}(h^2)
+\end{equation}
+on en d\'eduit :
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = P_I + \overline{IF}_{\,b_{\,ik}}\,.\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{F_{\,b_{\,ik}}} + \mathcal{O}(h^2)
+\end{equation}
+soit~:
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = P_I + \mathcal{O}(h^2)
+\end{equation}
+On obtient donc une approximation d'ordre 1.\\
+\hspace*{0.5cm}{ $\bullet ${\underline { condition \`a la limite de type Neumann homog\`ene am\'elior\'ee}}}\\
+Des \'egalit\'es (\ref{Base_Gradrc_eq_orthogonal}, \ref{Base_Gradrc_eq_derivee_normale}), on tire~:
+\begin{equation}\notag
+P_{F_{\,b_{\,ik}}} = P_I +
+\displaystyle\frac{1}{2}\,\overline{IF}_{\,b_{\,ik}}\,.\,\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{I} + \mathcal{O}(h^3)
+\end{equation}
+On obtient donc une approximation d'ordre 2.\\
+\hspace*{0.5cm}{$\bullet $ {\underline { condition \`a la limite de type
+extrapolation du gradient}}$\ \ \left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{F_{\,b_{\,ik}}} = \displaystyle\left. \displaystyle\frac{\delta
+P}{\delta n}\right|_{I}$}\\
+Des deux \'egalit\'es (\ref{Base_Gradrc_eq_orthogonal}, \ref{Base_Gradrc_eq_derivee_normale}), on d\'eduit~:
+\begin{equation}
+P_{F_{\,b_{\,ik}}}= P_I + \overline{IF}_{\,b_{\,ik}}\,.\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{I} + \mathcal{O}(h^3)
+\end{equation}
+On obtient donc \'egalement une approximation d'ordre 2.\\
+\paragraph{\bf Sur maillage non orthogonal}
+Dans ce cas, on peut seulement \'ecrire~:\\
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = P_{I'} +
+\displaystyle\frac{1}{2}\,\vect{I'F}_{\,b_{\,ik}}\,.\,[\,(\grad P)_{I'} + (\grad
+P)_{F_{\,b_{\,ik}}}\,] + \mathcal{O}(h^3)
+\end{equation}
+\hspace*{0.5cm}{ $\bullet ${\underline { condition \`a la limite de type Dirichlet}}\\
+$P_{F_{\,b_{\,ik}}} = P_{IMPOSE}$, toujours aucun traitement particulier\\\\
+\hspace*{0.5cm}{ $\bullet ${\underline { condition \`a la limite de type Neumann
+homog\`ene standard}}}\\
+On veut :
+\begin{equation}
+\left. \displaystyle\frac{\delta P}{\delta n}\right|_{F_{\,b_{\,ik}}} = 0 + \mathcal{O}(h)
+\end{equation}
+ce qui entra\^\i ne :
+\begin{equation}\label{Base_Gradrc_eq_ortho}
+\vect{I'F}_{\,b_{\,ik}} \,.\,(\grad P)_{F_{\,b_{\,ik}}} = \mathcal{O}(h^2)
+\end{equation}
+On peut \'ecrire :
+\begin{equation}\notag
+(\grad P)_{I'} = (\grad P)_{F_{\,b_{\,ik}}} + \mathcal{O}(h)
+\end{equation}
+d'o\`u~:
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = P_{I'} + \mathcal{O}(h^2)
+\end{equation}
+On obtient donc une approximation d'ordre 1.\\
+
+\hspace*{0.5cm}{$\bullet $ {\underline { condition \`a la limite de type Neumann homog\`ene am\'elior\'ee}}}\\
+Le gradient n'est connu qu'au centre des cellules $I$ et non aux points $I'$.
+\begin{equation}\notag
+(\grad P)_{I'} = (\grad P)_I + \mathcal{O}(h)
+\end{equation}
+d'o\`u :
+\begin{equation}
+\begin{array}{ll}
+P_{F_{\,b_{\,ik}}} & = P_{I'} + \displaystyle\frac{1}{2}\,\vect{I'F}_{\,b_{\,ik}}\,.\,[\,(\grad P)_{I'} +
+(\grad P)_{F_{\,b_{\,ik}}}\,] + \mathcal{O}(h^3)\\
+& = P_{I'} + \displaystyle\frac{1}{2}\,\vect{I'F}_{\,b_{\,ik}}\,.\,[\,(\grad P)_{I} +
+(\grad P)_{F_{\,b_{\,ik}}}\,] + \mathcal{O}(h^2)\
+\end{array}
+\end{equation}
+Compte-tenu de la condition impos\'ee et de l'\'equation ($\ref{Base_Gradrc_eq_ortho}$), seule la contribution en $I$ reste.
+\begin{equation}
+\begin{array}{ll}
+P_{F_{\,b_{\,ik}}} = P_{I'} + \displaystyle\frac{1}{2}\,\vect{I'F}_{\,b_{\,ik}}\,.\,(\grad P)_{I}
+ + \mathcal{O}(h^2)\\
+\end{array}
+\end{equation}
+On obtient donc une approximation d'ordre 1.\\
+\hspace*{0.5cm}{ $\bullet $ {\underline { condition \`a la limite de type extrapolation du gradient}} $\ \ \left. \displaystyle\frac{\delta P}{\delta n}\right|_{F_{\,b_{\,ik}}} =
+\displaystyle\left. \displaystyle\frac{\delta P}{\delta n}\right|_{I}$}\\
+En tenant compte de cette \'egalit\'e, l'expression de $P_{F_{\,b_{\,ik}}}$ devient :
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = P_{I'} + \displaystyle\,\vect{I'F}_{\,b_{\,ik}}\,.\,(\grad P)_{I}
+ + \mathcal{O}(h^2)
+\end{equation}
+On obtient \'egalement une approximation d'ordre 1.\\
+
+\hspace*{0.5cm}{\bf $\bullet $ Conclusion }\\
+On peut r\'ecapituler toutes ces situations {\it via} la formule :
+\begin{equation}\notag
+P_{F_{\,b_{\,ik}}}\,=\,P_{I'}+ \,\var{EXTRAP}\,\,(\vect{I'F}_{\,b_{\,ik}}\,.\,(\grad P)_{I})
+\end{equation}
+avec $\var{EXTRAP}$ valant $0$, $0.5$ ou $1$.\\
+
+Il ne faut en aucun cas utiliser $\var{EXTRAP}$ avec des conditions de type
+Neumann non homog\`enes $\left. \displaystyle\frac{\delta P}{\delta
+n}\right|_{F}$ = $g_{\,bord}$ , $g_{\,bord}$ donn\'ee non nulle ou de type
+Robin (mixtes) plus g\'en\'eralement \\ $a P_{F_{\,b_{\,ik}}} + b \left. \displaystyle\frac{\delta
+P}{\delta n}\right|_{F_{\,b_{\,ik}}} = g_{\,bord}$, le recours \`a $
+\var{EXTRAP}$ n'ayant plus aucun sens.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+La variable dont il faut calculer le gradient est contenue dans le tableau
+\var{PVAR}. Les conditions aux limites associ\'ees sont disponibles au travers
+des tableaux \var{COEFAP} et \var{COEFBP} qui repr\'esentent respectivement les
+grandeurs $A$ et $B$ utilis\'ees ci-dessus. Les trois composantes du gradient
+sont contenues, en sortie du sous-programme, dans les tableaux \var{DPDX},
+\var{DPDY} et \var{DPDZ}.\\
+
+\etape{Initialisations}
+Le tableau (\var{BX}, \var{BY}, \var{BZ}) du second membre $\vect{R}_{\,i}$ est initialis\'e \`a
+z\'ero.\\
+Le calcul du gradient cellule non reconstruit $\vect{G}^{NRec}_{\,c,i}$ est
+r\'ealis\'e et stock\'e dans les tableaux \var{DPDX}, \var{DPDY} et \var{DPDZ}. Si
+aucune reconstruction n'est \`a faire, on a fini.\\
+\hspace*{1cm}\subsection{\bf Reconstruction}
+Sinon, on cherche \`a r\'esoudre le syst\`eme (\ref{Base_Gradrc_eq_reconstruction_increment}) en incr\'ements de
+gradient ${\delta\,\vect{G}}^{\,k+1}_{\,i}$. Le gradient non reconstruit
+constitue alors une premi\`ere estimation du gradient \`a calculer par
+incr\'ements.\\
+On effectue les op\'erations suivantes~:
+\hspace*{1cm}\subsubsection{\bf Phase pr\'eliminaire}
+\hspace*{1,5cm}{\bf Calcul de la matrice, hors boucle en $k$}\\
+Les \var{NCEL} matrices $\tens{C}_{\,i}$ (matrices non sym\'etriques $3\times 3$) sont
+stock\'ees dans le tableau \var{COCG},
+(de dimension $\text{\var{NCELET}}\times 3\times 3$). Ce dernier est initialis\'e \`a z\'ero,
+puis son remplissage est r\'ealis\'e dans des boucles sur les faces internes et
+les faces de bord. Pour \'eviter de r\'ealiser plusieurs fois les m\^emes
+calculs g\'eom\'etriques, on conserve, en sortie de sous-programme, dans le
+tableau \var{COCG}, l'inverse des \var{NCEL} matrices $\tens{C}_{\,i}$.
+
+
+\hspace*{2cm}{\bf Cellule ne poss\'edant pas de face de bord }\\
+Lorsque, pour une cellule, aucune des faces n'est une face de bord du domaine,
+l'expression de la matrice $\tens{C}_{\,i}$ ne fait intervenir que des grandeurs
+g\'eom\'etriques. Son inverse peut \^etre donc calcul\'e une seule fois, stock\'e dans
+\var{COCG} et r\'eutilis\'e si l'on rappelle \fort{gradrc} s\'equentiellement et
+si on est sur un maillage fixe (indicateur \var{ICCOCG} positionn\'e \`a 0).
+
+\hspace*{2cm}{\bf Cellule poss\'edant au moins une face de bord }\\
+Lorsque l'ensemble des faces d'une cellule contient au moins une face de bord
+du domaine, un terme contributeur aux matrices $\tens{C}_{\,i}$ est
+sp\'ecifique \`a la variable dont on cherche
+\`a calculer le gradient, au travers du coefficient $B_{\,b,ik}$
+issu des conditions aux limites. Il s'agit de~:
+
+\begin{equation}\notag
+- \displaystyle\sum\limits_{k\in\gamma_b(i)}
+B_{\,b,ik}\,(\vect{II'})_{\,\beta} \,S_{\,{b}_{ik},\,\eta}
+\end{equation}
+
+Si, lors de l'appel pr\'ec\'edent\footnote{donc, \`a partir du second appel au
+moins} \`a \fort{gradrc},
+les conditions aux limites relatives \`a la
+variable $P$ trait\'ee conduisaient \`a des valeurs identiques de $B_{\,b,ik}$, les
+matrices $\tens{C}_{\,i}$ sont donc inchang\'ees et l'inverse est encore
+disponible dans \var{COCG}. Pour \'eviter de refaire les calculs associ\'es,
+l'indicateur \var{ICCOCG}, pass\'e en argument, est alors positionn\'e \`a 0.
+
+Si, au contraire, les valeurs de $B_{\,b,ik}$ sont diff\'erentes de celles de
+l'appel pr\'ec\'edent, il est alors
+indispensable de recalculer le terme et l'indicateur \var{ICCOCG} doit \^etre
+positionn\'e \`a 1.\\\\
+Toutefois compte-tenu du co\^ut total de l'inversion de ces matrices relativement
+au co\^ut global du sous-programme, cette d\'emarche de stockage et donc
+d'\'economie de temps C.P.U. est un peu
+superflue et risque d'engendrer des erreurs (indicateur \var{ICCOCG}
+positionn\'e \`a 0 au lieu de 1) beaucoup plus p\'enalisantes que l'\'eventuel
+gain escompt\'e.\\\\
+\hspace*{1,5cm}{\bf Inversion de la matrice}\\
+%\hspace*{1,5cm}\etape{Inversion de la matrice}
+On calcule les coefficients de la comatrice, puis l'inverse.
+Pour des questions de vectorisation, la boucle sur les \var{NCEL} \'el\'ements
+est remplac\'ee par une
+s\'erie de boucles en vectorisation forc\'ee sur des blocs de \var{NBLOC=1024}
+\'el\'ements. Le reliquat ($\var{NCEL}-E(\var{NCEL}/1024)\times 1024$) est
+trait\'e apr\`es les boucles.
+La matrice inverse est ensuite stock\'ee dans \var{COCG}.\\
+\hspace*{1cm}\subsubsection{\bf Phase it\'erative $k$, $k\in \grandN$}
+On suppose $\delta\,\vect{G}^{\,k}_{\,i}$ connu et donc $\vect{G}^{k}_{\,c,i}$ pour $k$ donn\'e et sur
+toute cellule $\Omega_{i}$ et on veut calculer
+$\delta\,\vect{G}^{\,k+1}_{\,i}$ et $\vect{G}^{k+1}_{\,c,i}$ .\\
+
+\hspace*{1,5cm}{\bf Calcul du second membre ${\vect{R}^{\,k+1}_{\,i}}$ et
+r\'esolution}\\
+Le calcul proprement dit du second membre ${\vect{R}^{\,k+1}_{\,i}} $
+correspondant au syst\`eme (\ref{Base_Gradrc_eq_second_membre}) est effectu\'e et stock\'e
+dans le tableau (\var{BX}, \var{BY}, \var{BZ}). Il est initialis\'e, \`a chaque
+pas $k$, par la
+valeur du gradient $\vect{G}^{k}_{\,c,i}$ multipli\'e par le
+volume de la cellule $|\Omega_i|$, avec $\vect{G}^{0}_{\,c,i} = \vect{G}^{Nrec}_{\,c,i}$ . L'incr\'ement $(\delta\,\vect{G}^{\,k+1}_{\,i})$
+de gradient est obtenu par $ {\tens{C}_{\,i}}^{-1}{\vect{R}^{\,k+1}_{\,i}}$ et
+ajout\'e dans les tableaux \var{DPDX},
+\var{DPDY} et \var{DPDZ} pour obtenir $\vect{G}^{k+1}_{\,c,i}$.\\
+
+En ce qui concerne les conditions aux limites en pression, elles sont
+trait\'ees comme suit dans \CS :
+\begin{equation}\notag
+\left\{\begin{array}{llll}
+P_{I'}&=P_{I}+\vect{II'}.\vect{G}_{c,i}\\
+P_{b,ik}& =\var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,P_{I'} = \var{INC}\,A_{\,b,ik} + B_{\,b,ik}(P_{I}+\vect{II'}.\,\vect{G}_{\,c,i}) \\
+P_{b_{1},ik}&= P_{I}+\vect{I{F_{\,ij}}}.\,\vect{G}_{\,c,i}\\
+P_{f,\,b_{\,ik}}&= B_{\,b,ik}(\var{EXTRAP}\,P_{b_{1},ik} + (1 -\var{EXTRAP})\,P_{b,ik}) + (1 -
+B_{\,b,ik})P_{b,ik}
+\end{array}\right.
+\end{equation}
+ce qui correspond \`a :\\\\
+\hspace*{1cm}{\tiny$\blacksquare$}\, lorsqu'on veut imposer des conditions de Dirichlet ($A_{\,b,ik} =
+P_{F_{\,b_{\,ik}}}$, $B_{\,b,ik} = 0$),
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = P_{IMPOSE}
+\end{equation}
+pour toute valeur de \var{EXTRAP}.\\\\
+\hspace*{1cm}{\tiny$\blacksquare$}\, lorsqu'on veut imposer des conditions de
+flux ($A_{\,b,ik} = 0$, $B_{\,b,ik} = 1$) (condition de type Neumann)
+\begin{equation}
+P_{F_{\,b_{\,ik}}} = \,\var{EXTRAP}\,\ (P_{I} + (\vect{IF}_{\,b_{\,ik}}\,.\,(\grad P)_{I}) + (1 -\,\var{EXTRAP}) P_{I'}
+\end{equation}
+seules trois valeurs de \var{EXTRAP} sont licites.\\\\
+\hspace*{2cm}$\bullet $ avec un maillage non orthogonal \\\\
+L'ordre obtenu est \'egal \`a 1 dans tous les cas.
+\begin{equation}\notag
+\begin{array}{llll}
+\var{EXTRAP}&= 0 &\text{Neumann homog\`ene}&\ \ P_{F_{\,b_{\,ik}}} = P_{I'} + \mathcal{O}(h^2)\\
+\var{EXTRAP}&= \displaystyle\frac{1}{2} &\text{Neumann homog\`ene am\'elior\'e}&\ \
+P_{F_{\,b_{\,ik}}} = P_{I'} + \displaystyle\frac{1}{2}\,\vect{I'F}_{\,b_{\,ik}}\,.\,(\grad P)_{I}
++ \mathcal{O}(h^2)\\
+\var{EXTRAP} &= 1&\text{extrapolation du gradient}&\ \
+P_{F_{\,b_{\,ik}}} = P_{I'} + \vect{I'F}_{\,b_{\,ik}}\,.\,(\grad P)_{I} + \mathcal{O}(h^2)\\
+\end{array}
+\end{equation}\\\\
+\hspace*{2cm}$\bullet $ avec un maillage orthogonal \\\\
+On peut atteindre l'ordre deux.\\
+\begin{equation}\notag
+\begin{array}{lllll}
+\var{EXTRAP} &= 0 &\text{Neumann homog\`ene}&
+P_{F_{\,b_{\,ik}}} = P_{I'} + \mathcal{O}(h^2)\\
+&\ &\text{on est \`a l'ordre 1}\\
+\var{EXTRAP} &= \displaystyle\frac{1}{2} &\text{Neumann homog\`ene am\'elior\'e}&\ \
+P_{F_{\,b_{\,ik}}} = P_{I} + \displaystyle\frac{1}{2}\,\vect{IF}_{\,b_{\,ik}}\,.\,(\grad P)_{I}
++ \mathcal{O}(h^3)\\
+&\ &\text{on est \`a l'ordre 2}\\
+\var{EXTRAP} &= 1 &\text{extrapolation du gradient}&\ \
+P_{F_{\,b_{\,ik}}} = P_{I} + \vect{IF}_{\,b_{\,ik}}\,.\,(\grad P)_{I} +
+\mathcal{O}(h^3)\\
+&\ &\text{on est \`a l'ordre 2}\\
+\end{array}
+\end{equation}
+
+\hspace*{1,5cm}{\bf Test de convergence de la m\'ethode it\'erative de r\'esolution}\\
+On calcule la norme euclidienne $\var {RESIDU}$ du second membre (\var{BX},
+\var{BY}, \var{BZ}).\\
+On arr\^ete les it\'erations sur $k$ si le test de
+convergence pour cette norme ou le nombre de
+sweeps maximal \var{NSWRGP} est atteint. La valeur par d\'efaut de \var{NSWRGP} est fix\'ee \`a 100, ce
+qui permet un calcul suffisamment pr\'ecis pour l'ordre d'espace
+consid\'er\'e.\\
+Sinon, on continue d'it\'erer sur $k$.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Vectorisation forc\'ee}
+Il est peut-\^etre possible de s'affranchir du d\'ecoupage en boucles de 1024 si
+les compilateurs sont capables
+d'effectuer la vectorisation sans cette aide. On note cependant que ce
+d\'ecoupage en boucles de 1024 n'a pas de co\^ut CPU suppl\'ementaire, et que
+le co\^ut m\'emoire associ\'e est n\'egligeable.
+Le seul inconv\'enient r\'eside dans la relative complexit\'e de l'\'ecriture.
+
+\etape{Traitement des conditions aux limites de pression}
+Actuellement, l'ordre deux d\'ecrit dans le cas $\var{EXTRAP} = \displaystyle \frac{1}{2}$ relativement
+aux conditions aux limites de pression n'existe pas dans \CS \ en non
+orthogonal. Mais en a-t-on vraiment besoin ?
+
+\etape{M\'ethode it\'erative de r\'esolution}
+La m\'ethode it\'erative de r\'esolution adopt\'ee dans ce sous-programme marche, {\it
+i.e.} converge, mais ne rentre dans aucun cadre th\'eorique pr\'ecis. Des
+r\'eflexions sur le sujet pourraient \'eventuellement permettre d'exhiber certaines propri\'et\'es
+des matrices consid\'er\'ees, cerner les limites d'application ou expliquer
+certains comportements.
diff --git a/doc/theory/graphics/Makefile.am b/doc/theory/graphics/Makefile.am
new file mode 100644
index 0000000..62f8c6b
--- /dev/null
+++ b/doc/theory/graphics/Makefile.am
@@ -0,0 +1,65 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+
+FIGFILES = \
+bordortho.fig \
+condlimite.fig \
+domaine1d.fig \
+entree.fig \
+facebord.fig \
+facesym.fig \
+facette.fig \
+fluxbord.fig \
+support.fig
+
+# Other files
+
+OTHERFILES = \
+clthermique.pdf \
+loilog.pdf
+
+# Distributed files
+
+EXTRA_DIST = $(FIGFILES) $(OTHERFILES)
+
+# Generated documents (pdf files)
+
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+
+SUFFIXES = .fig .pdf
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
diff --git a/doc/theory/graphics/Makefile.in b/doc/theory/graphics/Makefile.in
new file mode 100644
index 0000000..1b38079
--- /dev/null
+++ b/doc/theory/graphics/Makefile.in
@@ -0,0 +1,483 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/theory/graphics
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+FIGFILES = \
+bordortho.fig \
+condlimite.fig \
+domaine1d.fig \
+entree.fig \
+facebord.fig \
+facesym.fig \
+facette.fig \
+fluxbord.fig \
+support.fig
+
+
+# Other files
+OTHERFILES = \
+clthermique.pdf \
+loilog.pdf
+
+
+# Distributed files
+EXTRA_DIST = $(FIGFILES) $(OTHERFILES)
+
+# Generated documents (pdf files)
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+SUFFIXES = .fig .pdf
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .fig .pdf
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/theory/graphics/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/theory/graphics/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am: pdf-local
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distclean-local distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am pdf-local \
+ ps ps-am uninstall uninstall-am
+
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/theory/graphics/bordortho.fig b/doc/theory/graphics/bordortho.fig
new file mode 100644
index 0000000..292596a
--- /dev/null
+++ b/doc/theory/graphics/bordortho.fig
@@ -0,0 +1,73 @@
+#FIG 3.1
+Portrait
+Center
+Inches
+1200 2
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 5625 2925 75 75 5625 2925 5700 3000
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 2025 2925 75 75 2025 2925 2100 3000
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7500 975 7500 5400
+2 3 0 0 -1 7 10 0 44 0.000 0 0 -1 0 0 7
+ 7500 975 7800 1275 7800 1875 7800 4350 7725 4875 7500 5400
+ 7500 975
+2 2 0 1 -1 0 0 0 20 0.000 0 0 -1 0 0 5
+ 7500 975 7275 975 7275 5400 7500 5400 7500 975
+2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 7275 1200 3825 1200 3825 4800 7275 4800 7275 1200
+2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 3825 1200 375 1200 375 4800 3825 4800 3825 1200
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 5550 5175 7275 5175
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 3825 3825 3825 5550
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 2025 2325 2025 5550
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 5625 2175 5625 5550
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 2025 5175 3750 5175
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 6750 525 7350 900
+2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7875 1875 8100 1875
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 7500 2925 8700 2925
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 6525 2850 6525 3675
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 5625 3600 6525 3600
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 6525 3600 7200 3600
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 3825 5175 5625 5175
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 75 2925 8550 2925
+4 0 -1 0 0 0 24 0.0000 4 255 120 5775 2850 I\001
+4 0 -1 0 0 0 24 0.0000 4 255 165 2175 2850 J\001
+4 0 -1 0 0 0 24 0.0000 4 255 270 3975 2850 G\001
+4 0 -1 0 0 0 24 0.0000 4 255 2745 2550 1125 Domaine de calcul\001
+4 0 -1 0 0 0 24 0.0000 4 255 3945 3600 375 Bord du domaine de calcul\001
+4 0 -1 0 0 0 24 0.0000 4 180 195 7875 1800 n\001
+4 0 -1 0 0 0 18 0.0000 4 195 1905 7800 2175 normale sortante\001
+4 0 -1 0 0 0 18 0.0000 4 195 1245 8475 2400 de norme 1\001
+4 0 -1 0 0 0 24 0.0000 4 255 210 6975 2850 F\001
+4 0 -1 0 0 0 18 0.0000 4 195 240 6375 2850 M\001
+4 0 -1 0 0 1 24 0.0000 4 255 195 2775 5100 d\001
+4 0 -1 0 0 1 24 0.0000 4 255 195 4500 5100 d\001
+4 0 -1 0 0 1 24 0.0000 4 255 195 6375 5100 d\001
+4 0 -1 0 0 1 18 0.0000 4 195 360 6000 3300 d/2\001
+4 0 -1 0 0 1 18 0.0000 4 195 360 6675 3300 d/2\001
+4 0 -1 0 0 1 24 0.0000 4 240 165 75 3300 y\001
diff --git a/doc/theory/graphics/clthermique.dat b/doc/theory/graphics/clthermique.dat
new file mode 100644
index 0000000..4463f77
--- /dev/null
+++ b/doc/theory/graphics/clthermique.dat
@@ -0,0 +1,300 @@
+ 0.100000000E+00 0.100000000E-05
+ 0.200000000E+00 0.800000000E-05
+ 0.300000000E+00 0.270000000E-04
+ 0.400000000E+00 0.640000000E-04
+ 0.500000000E+00 0.125000000E-03
+ 0.600000000E+00 0.216000000E-03
+ 0.700000000E+00 0.343000000E-03
+ 0.800000000E+00 0.512000000E-03
+ 0.900000000E+00 0.729000000E-03
+ 0.100000000E+01 0.100000000E-02
+ 0.110000000E+01 0.133100000E-02
+ 0.120000000E+01 0.172800000E-02
+ 0.130000000E+01 0.219700000E-02
+ 0.140000000E+01 0.274400000E-02
+ 0.150000000E+01 0.337500000E-02
+ 0.160000000E+01 0.409600000E-02
+ 0.170000000E+01 0.491300000E-02
+ 0.180000000E+01 0.583200000E-02
+ 0.190000000E+01 0.685900000E-02
+ 0.200000000E+01 0.800000000E-02
+ 0.210000000E+01 0.926100000E-02
+ 0.220000000E+01 0.106480000E-01
+ 0.230000000E+01 0.121670000E-01
+ 0.240000000E+01 0.138240000E-01
+ 0.250000000E+01 0.156250000E-01
+ 0.260000000E+01 0.175760000E-01
+ 0.270000000E+01 0.196830000E-01
+ 0.280000000E+01 0.219520000E-01
+ 0.290000000E+01 0.243890000E-01
+ 0.300000000E+01 0.270000000E-01
+ 0.310000000E+01 0.297910000E-01
+ 0.320000000E+01 0.327680000E-01
+ 0.330000000E+01 0.359370000E-01
+ 0.340000000E+01 0.393040000E-01
+ 0.350000000E+01 0.428750000E-01
+ 0.360000000E+01 0.466560000E-01
+ 0.370000000E+01 0.506530000E-01
+ 0.380000000E+01 0.548720000E-01
+ 0.390000000E+01 0.593190000E-01
+ 0.400000000E+01 0.640000000E-01
+ 0.410000000E+01 0.689210000E-01
+ 0.420000000E+01 0.740880000E-01
+ 0.430000000E+01 0.795070000E-01
+ 0.440000000E+01 0.851840000E-01
+ 0.450000000E+01 0.911250000E-01
+ 0.460000000E+01 0.973360000E-01
+ 0.470000000E+01 0.103823000E+00
+ 0.480000000E+01 0.110592000E+00
+ 0.490000000E+01 0.117649000E+00
+ 0.500000000E+01 0.125000000E+00
+ 0.510000000E+01 0.132651000E+00
+ 0.520000000E+01 0.140608000E+00
+ 0.530000000E+01 0.148877000E+00
+ 0.540000000E+01 0.157464000E+00
+ 0.550000000E+01 0.166375000E+00
+ 0.560000000E+01 0.175616000E+00
+ 0.570000000E+01 0.185193000E+00
+ 0.580000000E+01 0.195112000E+00
+ 0.590000000E+01 0.205379000E+00
+ 0.600000000E+01 0.216000000E+00
+ 0.610000000E+01 0.226981000E+00
+ 0.620000000E+01 0.238328000E+00
+ 0.630000000E+01 0.250047000E+00
+ 0.640000000E+01 0.262144000E+00
+ 0.650000000E+01 0.274625000E+00
+ 0.660000000E+01 0.287496000E+00
+ 0.670000000E+01 0.300763000E+00
+ 0.680000000E+01 0.314432000E+00
+ 0.690000000E+01 0.328509000E+00
+ 0.700000000E+01 0.343000000E+00
+ 0.710000000E+01 0.357911000E+00
+ 0.720000000E+01 0.373248000E+00
+ 0.730000000E+01 0.389017000E+00
+ 0.740000000E+01 0.405224000E+00
+ 0.750000000E+01 0.421875000E+00
+ 0.760000000E+01 0.438976000E+00
+ 0.770000000E+01 0.456533000E+00
+ 0.780000000E+01 0.474552000E+00
+ 0.790000000E+01 0.493039000E+00
+ 0.800000000E+01 0.512000000E+00
+ 0.810000000E+01 0.531441000E+00
+ 0.820000000E+01 0.551368000E+00
+ 0.830000000E+01 0.571787000E+00
+ 0.840000000E+01 0.592704000E+00
+ 0.850000000E+01 0.614125000E+00
+ 0.860000000E+01 0.636056000E+00
+ 0.870000000E+01 0.658503000E+00
+ 0.880000000E+01 0.681472000E+00
+ 0.890000000E+01 0.704969000E+00
+ 0.900000000E+01 0.729000000E+00
+ 0.910000000E+01 0.753571000E+00
+ 0.920000000E+01 0.778688000E+00
+ 0.930000000E+01 0.804357000E+00
+ 0.940000000E+01 0.830584000E+00
+ 0.950000000E+01 0.857375000E+00
+ 0.960000000E+01 0.884736000E+00
+ 0.970000000E+01 0.912673000E+00
+ 0.980000000E+01 0.941192000E+00
+ 0.990000000E+01 0.970299000E+00
+ 0.100000000E+02 0.100000000E+01
+ 0.101000000E+02 0.103030100E+01
+ 0.102000000E+02 0.106120800E+01
+ 0.103000000E+02 0.109272700E+01
+ 0.104000000E+02 0.112486400E+01
+ 0.105000000E+02 0.115762500E+01
+ 0.106000000E+02 0.119101600E+01
+ 0.107000000E+02 0.122504300E+01
+ 0.108000000E+02 0.125971200E+01
+ 0.109000000E+02 0.129502900E+01
+ 0.110000000E+02 0.133100000E+01
+ 0.111000000E+02 0.136763100E+01
+ 0.112000000E+02 0.140492800E+01
+ 0.113000000E+02 0.144289700E+01
+ 0.114000000E+02 0.148154400E+01
+ 0.115000000E+02 0.152087500E+01
+ 0.116000000E+02 0.156089600E+01
+ 0.117000000E+02 0.160161300E+01
+ 0.118000000E+02 0.164303200E+01
+ 0.119000000E+02 0.168515900E+01
+ 0.120000000E+02 0.172800000E+01
+ 0.121000000E+02 0.177156100E+01
+ 0.122000000E+02 0.181584800E+01
+ 0.123000000E+02 0.186086700E+01
+ 0.124000000E+02 0.190662400E+01
+ 0.125000000E+02 0.195312500E+01
+ 0.126000000E+02 0.200037600E+01
+ 0.127000000E+02 0.204838300E+01
+ 0.128000000E+02 0.209715200E+01
+ 0.129000000E+02 0.214668900E+01
+ 0.130000000E+02 0.219700000E+01
+ 0.131000000E+02 0.224809100E+01
+ 0.132000000E+02 0.229996800E+01
+ 0.133000000E+02 0.235263700E+01
+ 0.134000000E+02 0.240610400E+01
+ 0.135000000E+02 0.246037500E+01
+ 0.136000000E+02 0.251545600E+01
+ 0.137000000E+02 0.257135300E+01
+ 0.138000000E+02 0.262807200E+01
+ 0.139000000E+02 0.268561900E+01
+ 0.140000000E+02 0.274400000E+01
+ 0.141000000E+02 0.280322100E+01
+ 0.142000000E+02 0.286328800E+01
+ 0.143000000E+02 0.292420700E+01
+ 0.144000000E+02 0.298598400E+01
+ 0.145000000E+02 0.304862500E+01
+ 0.146000000E+02 0.311213600E+01
+ 0.147000000E+02 0.317652300E+01
+ 0.148000000E+02 0.324179200E+01
+ 0.149000000E+02 0.330794900E+01
+ 0.150000000E+02 0.337500000E+01
+ 0.151000000E+02 0.344295100E+01
+ 0.152000000E+02 0.351180800E+01
+ 0.153000000E+02 0.358157700E+01
+ 0.154000000E+02 0.365226400E+01
+ 0.155000000E+02 0.372387500E+01
+ 0.156000000E+02 0.379641600E+01
+ 0.157000000E+02 0.386989300E+01
+ 0.158000000E+02 0.394431200E+01
+ 0.159000000E+02 0.401967900E+01
+ 0.160000000E+02 0.409600000E+01
+ 0.161000000E+02 0.417328100E+01
+ 0.162000000E+02 0.425152800E+01
+ 0.163000000E+02 0.433074700E+01
+ 0.164000000E+02 0.441094400E+01
+ 0.165000000E+02 0.449212500E+01
+ 0.166000000E+02 0.457429600E+01
+ 0.167000000E+02 0.465746300E+01
+ 0.168000000E+02 0.474163200E+01
+ 0.169000000E+02 0.482680900E+01
+ 0.170000000E+02 0.491300000E+01
+ 0.171000000E+02 0.500021100E+01
+ 0.172000000E+02 0.508844800E+01
+ 0.173000000E+02 0.517771700E+01
+ 0.174000000E+02 0.526802400E+01
+ 0.175000000E+02 0.535937500E+01
+ 0.176000000E+02 0.545177600E+01
+ 0.177000000E+02 0.554523300E+01
+ 0.178000000E+02 0.563975200E+01
+ 0.179000000E+02 0.573533900E+01
+ 0.180000000E+02 0.583200000E+01
+ 0.181000000E+02 0.592974100E+01
+ 0.182000000E+02 0.602856800E+01
+ 0.183000000E+02 0.612848700E+01
+ 0.184000000E+02 0.622950400E+01
+ 0.185000000E+02 0.633162500E+01
+ 0.186000000E+02 0.643485600E+01
+ 0.187000000E+02 0.653920300E+01
+ 0.188000000E+02 0.664467200E+01
+ 0.189000000E+02 0.675126900E+01
+ 0.190000000E+02 0.685900000E+01
+ 0.191000000E+02 0.696787100E+01
+ 0.192000000E+02 0.707788800E+01
+ 0.193000000E+02 0.718905700E+01
+ 0.194000000E+02 0.730138400E+01
+ 0.195000000E+02 0.741487500E+01
+ 0.196000000E+02 0.752953600E+01
+ 0.197000000E+02 0.764537300E+01
+ 0.198000000E+02 0.776239200E+01
+ 0.199000000E+02 0.788059900E+01
+ 0.200000000E+02 0.800000000E+01
+ 0.201000000E+02 0.812060100E+01
+ 0.202000000E+02 0.824240800E+01
+ 0.203000000E+02 0.836542700E+01
+ 0.204000000E+02 0.848966400E+01
+ 0.205000000E+02 0.861512500E+01
+ 0.206000000E+02 0.874181600E+01
+ 0.207000000E+02 0.886974300E+01
+ 0.208000000E+02 0.899891200E+01
+ 0.209000000E+02 0.912932900E+01
+ 0.210000000E+02 0.926100000E+01
+ 0.211000000E+02 0.939393100E+01
+ 0.212000000E+02 0.952812800E+01
+ 0.213000000E+02 0.966359700E+01
+ 0.214000000E+02 0.980034400E+01
+ 0.215000000E+02 0.993837500E+01
+ 0.216000000E+02 0.100776960E+02
+ 0.217000000E+02 0.102183130E+02
+ 0.218000000E+02 0.103602320E+02
+ 0.219000000E+02 0.105034590E+02
+ 0.220000000E+02 0.106480000E+02
+ 0.221000000E+02 0.107938610E+02
+ 0.222000000E+02 0.109410480E+02
+ 0.223000000E+02 0.110895670E+02
+ 0.224000000E+02 0.112394240E+02
+ 0.225000000E+02 0.113906250E+02
+ 0.226000000E+02 0.115431760E+02
+ 0.227000000E+02 0.116970830E+02
+ 0.228000000E+02 0.118523520E+02
+ 0.229000000E+02 0.120089890E+02
+ 0.230000000E+02 0.121670000E+02
+ 0.231000000E+02 0.123263910E+02
+ 0.232000000E+02 0.124871680E+02
+ 0.233000000E+02 0.126493370E+02
+ 0.234000000E+02 0.128129040E+02
+ 0.235000000E+02 0.129778750E+02
+ 0.236000000E+02 0.131442560E+02
+ 0.237000000E+02 0.133120530E+02
+ 0.238000000E+02 0.134812720E+02
+ 0.239000000E+02 0.136519190E+02
+ 0.240000000E+02 0.138240000E+02
+ 0.241000000E+02 0.139975210E+02
+ 0.242000000E+02 0.141724880E+02
+ 0.243000000E+02 0.143489070E+02
+ 0.244000000E+02 0.145267840E+02
+ 0.245000000E+02 0.147061250E+02
+ 0.246000000E+02 0.148869360E+02
+ 0.247000000E+02 0.150692230E+02
+ 0.248000000E+02 0.152529920E+02
+ 0.249000000E+02 0.154382490E+02
+ 0.250000000E+02 0.156250000E+02
+ 0.251000000E+02 0.158132510E+02
+ 0.252000000E+02 0.160030080E+02
+ 0.253000000E+02 0.161942770E+02
+ 0.254000000E+02 0.163870640E+02
+ 0.255000000E+02 0.165813750E+02
+ 0.256000000E+02 0.167772160E+02
+ 0.257000000E+02 0.169745930E+02
+ 0.258000000E+02 0.171735120E+02
+ 0.259000000E+02 0.173739790E+02
+ 0.260000000E+02 0.175760000E+02
+ 0.261000000E+02 0.177795810E+02
+ 0.262000000E+02 0.179847280E+02
+ 0.263000000E+02 0.181914470E+02
+ 0.264000000E+02 0.183997440E+02
+ 0.265000000E+02 0.186096250E+02
+ 0.266000000E+02 0.188210960E+02
+ 0.267000000E+02 0.190341630E+02
+ 0.268000000E+02 0.192488320E+02
+ 0.269000000E+02 0.194651090E+02
+ 0.270000000E+02 0.196830000E+02
+ 0.271000000E+02 0.199025110E+02
+ 0.272000000E+02 0.201236480E+02
+ 0.273000000E+02 0.203464170E+02
+ 0.274000000E+02 0.205708240E+02
+ 0.275000000E+02 0.207968750E+02
+ 0.276000000E+02 0.210245760E+02
+ 0.277000000E+02 0.212539330E+02
+ 0.278000000E+02 0.214849520E+02
+ 0.279000000E+02 0.217176390E+02
+ 0.280000000E+02 0.219520000E+02
+ 0.281000000E+02 0.221880410E+02
+ 0.282000000E+02 0.224257680E+02
+ 0.283000000E+02 0.226651870E+02
+ 0.284000000E+02 0.229063040E+02
+ 0.285000000E+02 0.231491250E+02
+ 0.286000000E+02 0.233936560E+02
+ 0.287000000E+02 0.236399030E+02
+ 0.288000000E+02 0.238878720E+02
+ 0.289000000E+02 0.241375690E+02
+ 0.290000000E+02 0.243890000E+02
+ 0.291000000E+02 0.246421710E+02
+ 0.292000000E+02 0.248970880E+02
+ 0.293000000E+02 0.251537570E+02
+ 0.294000000E+02 0.254121840E+02
+ 0.295000000E+02 0.256723750E+02
+ 0.296000000E+02 0.259343360E+02
+ 0.297000000E+02 0.261980730E+02
+ 0.298000000E+02 0.264635920E+02
+ 0.299000000E+02 0.267308990E+02
+ 0.300000000E+02 0.270000000E+02
diff --git a/doc/theory/graphics/clthermique.f b/doc/theory/graphics/clthermique.f
new file mode 100644
index 0000000..582c6a5
--- /dev/null
+++ b/doc/theory/graphics/clthermique.f
@@ -0,0 +1,12 @@
+ integer i
+ double precision x
+ do i = 1, 300
+ x=float(i)/10.d0
+ write(*,'(6E18.9)')x, x*x*x/1000
+ enddo
+c
+c restera a placer deux points pour (a+at)/nu = 1/Pr = 1
+c dont un a x = 0
+c et a placer deux points pour (a+at)/nu = 0.42 x / Prt = 0.42 x
+c dont un a x = 30
+ end
diff --git a/doc/theory/graphics/clthermique.pdf b/doc/theory/graphics/clthermique.pdf
new file mode 100644
index 0000000..d948aec
Binary files /dev/null and b/doc/theory/graphics/clthermique.pdf differ
diff --git a/doc/theory/graphics/clthermique.xmgr b/doc/theory/graphics/clthermique.xmgr
new file mode 100644
index 0000000..83d9d7b
--- /dev/null
+++ b/doc/theory/graphics/clthermique.xmgr
@@ -0,0 +1,736 @@
+# ACE/gr parameter file
+#
+ at page layout free
+ at ps linewidth begin 1
+ at ps linewidth increment 2
+ at hardcopy device 1
+ at page 5
+ at page inout 5
+ at link page off
+ at default linestyle 1
+ at default linewidth 1
+ at default color 1
+ at default char size 1.000000
+ at default font 4
+ at default font source 0
+ at default symbol size 1.000000
+ at timestamp off
+ at timestamp 0.03, 0.03
+ at timestamp linewidth 1
+ at timestamp color 1
+ at timestamp rot 0
+ at timestamp font 4
+ at timestamp char size 1.000000
+ at timestamp def "Mon Jun 16 08:48:22 2003"
+ at with string
+@ string on
+@ string loctype view
+@ string 0.642857142857, 0.555189456343
+@ string linewidth 1
+@ string color 1
+@ string rot 0
+@ string font 4
+@ string just 0
+@ string char size 1.000000
+@ string def "y+"
+ at with string
+@ string on
+@ string loctype view
+@ string 0.659340659341, 0.525535420099
+@ string linewidth 1
+@ string color 1
+@ string rot 0
+@ string font 4
+@ string just 0
+@ string char size 0.610000
+@ string def "2"
+ at with string
+@ string on
+@ string loctype view
+@ string 0.368131868132, 0.222405271829
+@ string linewidth 1
+@ string color 1
+@ string rot 0
+@ string font 4
+@ string just 0
+@ string char size 0.600000
+@ string def "1"
+ at with string
+@ string on
+@ string loctype view
+@ string 0.353021978022, 0.255354200988
+@ string linewidth 1
+@ string color 1
+@ string rot 0
+@ string font 4
+@ string just 0
+@ string char size 1.000000
+@ string def "y+"
+ at with g0
+ at g0 on
+ at g0 label off
+ at g0 hidden false
+ at g0 type xy
+ at g0 autoscale type AUTO
+ at g0 fixedpoint off
+ at g0 fixedpoint type 0
+ at g0 fixedpoint xy 0.000000, 0.000000
+ at g0 fixedpoint format general general
+ at g0 fixedpoint prec 6, 6
+@ world xmin 0
+@ world xmax 30
+@ world ymin 0
+@ world ymax 14
+@ stack world 0, 0, 0, 0 tick 0, 0, 0, 0
+@ view xmin 0.150000
+@ view xmax 0.850000
+@ view ymin 0.150000
+@ view ymax 0.850000
+@ title ""
+@ title font 4
+@ title size 1.500000
+@ title color 1
+@ title linewidth 1
+@ subtitle ""
+@ subtitle font 4
+@ subtitle size 1.000000
+@ subtitle color 1
+@ subtitle linewidth 1
+@ s0 symbol 0
+@ s0 symbol size 1.000000
+@ s0 symbol fill 0
+@ s0 symbol color 2
+@ s0 symbol linewidth 1
+@ s0 symbol linestyle 1
+@ s0 symbol center false
+@ s0 symbol char 0
+@ s0 skip 0
+@ s0 linestyle 1
+@ s0 linewidth 1
+@ s0 color 2
+@ s0 fill 0
+@ s0 fill with color
+@ s0 fill color 1
+@ s0 fill pattern 0
+@ s0 errorbar type BOTH
+@ s0 errorbar length 1.000000
+@ s0 errorbar linewidth 1
+@ s0 errorbar linestyle 1
+@ s0 errorbar riser on
+@ s0 errorbar riser linewidth 1
+@ s0 errorbar riser linestyle 1
+@ s0 xyz 0.000000, 0.000000
+@ s0 comment "/home/archambe/SOL_COM/FA_V1.1/V1.1.0.t/doc/NOYAU/Src/Base/Clptur/Images/un.dat"
+@ s1 symbol 0
+@ s1 symbol size 1.000000
+@ s1 symbol fill 0
+@ s1 symbol color 1
+@ s1 symbol linewidth 1
+@ s1 symbol linestyle 1
+@ s1 symbol center false
+@ s1 symbol char 0
+@ s1 skip 0
+@ s1 linestyle 2
+@ s1 linewidth 1
+@ s1 color 1
+@ s1 fill 0
+@ s1 fill with color
+@ s1 fill color 1
+@ s1 fill pattern 0
+@ s1 errorbar type BOTH
+@ s1 errorbar length 1.000000
+@ s1 errorbar linewidth 1
+@ s1 errorbar linestyle 1
+@ s1 errorbar riser on
+@ s1 errorbar riser linewidth 1
+@ s1 errorbar riser linestyle 1
+@ s1 xyz 0.000000, 0.000000
+@ s1 comment "/home/archambe/SOL_COM/FA_V1.1/V1.1.0.t/doc/NOYAU/Src/Base/Clptur/Images/lin.dat"
+@ s2 symbol 0
+@ s2 symbol size 1.000000
+@ s2 symbol fill 0
+@ s2 symbol color 1
+@ s2 symbol linewidth 1
+@ s2 symbol linestyle 1
+@ s2 symbol center false
+@ s2 symbol char 0
+@ s2 skip 0
+@ s2 linestyle 4
+@ s2 linewidth 1
+@ s2 color 1
+@ s2 fill 0
+@ s2 fill with color
+@ s2 fill color 1
+@ s2 fill pattern 0
+@ s2 errorbar type BOTH
+@ s2 errorbar length 1.000000
+@ s2 errorbar linewidth 1
+@ s2 errorbar linestyle 1
+@ s2 errorbar riser on
+@ s2 errorbar riser linewidth 1
+@ s2 errorbar riser linestyle 1
+@ s2 xyz 0.000000, 0.000000
+@ s2 comment "clthermique.dat"
+@ xaxis tick on
+@ xaxis tick major 10
+@ xaxis tick minor 5
+@ xaxis tick offsetx 0.000000
+@ xaxis tick offsety 0.000000
+@ xaxis label "y+"
+@ xaxis label layout para
+@ xaxis label place auto
+@ xaxis label char size 1.000000
+@ xaxis label font 4
+@ xaxis label color 1
+@ xaxis label linewidth 1
+@ xaxis ticklabel on
+@ xaxis ticklabel type auto
+@ xaxis ticklabel prec 5
+@ xaxis ticklabel format general
+@ xaxis ticklabel append ""
+@ xaxis ticklabel prepend ""
+@ xaxis ticklabel layout horizontal
+@ xaxis ticklabel place on ticks
+@ xaxis ticklabel skip 0
+@ xaxis ticklabel stagger 0
+@ xaxis ticklabel op bottom
+@ xaxis ticklabel sign normal
+@ xaxis ticklabel start type auto
+@ xaxis ticklabel start 0.000000
+@ xaxis ticklabel stop type auto
+@ xaxis ticklabel stop 0.000000
+@ xaxis ticklabel char size 1.000000
+@ xaxis ticklabel font 4
+@ xaxis ticklabel color 1
+@ xaxis ticklabel linewidth 1
+@ xaxis tick major on
+@ xaxis tick minor on
+@ xaxis tick default 6
+@ xaxis tick in
+@ xaxis tick major color 1
+@ xaxis tick major linewidth 1
+@ xaxis tick major linestyle 1
+@ xaxis tick minor color 1
+@ xaxis tick minor linewidth 1
+@ xaxis tick minor linestyle 1
+@ xaxis tick log off
+@ xaxis tick size 1.000000
+@ xaxis tick minor size 0.500000
+@ xaxis bar off
+@ xaxis bar color 1
+@ xaxis bar linestyle 1
+@ xaxis bar linewidth 1
+@ xaxis tick major grid off
+@ xaxis tick minor grid off
+@ xaxis tick op both
+@ xaxis tick type auto
+@ xaxis tick spec 0
+@ yaxis tick on
+@ yaxis tick major 2
+@ yaxis tick minor 1
+@ yaxis tick offsetx 0.000000
+@ yaxis tick offsety 0.000000
+@ yaxis label "K"
+@ yaxis label layout para
+@ yaxis label place auto
+@ yaxis label char size 1.000000
+@ yaxis label font 4
+@ yaxis label color 1
+@ yaxis label linewidth 1
+@ yaxis ticklabel on
+@ yaxis ticklabel type auto
+@ yaxis ticklabel prec 5
+@ yaxis ticklabel format general
+@ yaxis ticklabel append ""
+@ yaxis ticklabel prepend ""
+@ yaxis ticklabel layout horizontal
+@ yaxis ticklabel place on ticks
+@ yaxis ticklabel skip 0
+@ yaxis ticklabel stagger 0
+@ yaxis ticklabel op left
+@ yaxis ticklabel sign normal
+@ yaxis ticklabel start type auto
+@ yaxis ticklabel start 0.000000
+@ yaxis ticklabel stop type auto
+@ yaxis ticklabel stop 0.000000
+@ yaxis ticklabel char size 1.000000
+@ yaxis ticklabel font 4
+@ yaxis ticklabel color 1
+@ yaxis ticklabel linewidth 1
+@ yaxis tick major on
+@ yaxis tick minor on
+@ yaxis tick default 6
+@ yaxis tick in
+@ yaxis tick major color 1
+@ yaxis tick major linewidth 1
+@ yaxis tick major linestyle 1
+@ yaxis tick minor color 1
+@ yaxis tick minor linewidth 1
+@ yaxis tick minor linestyle 1
+@ yaxis tick log off
+@ yaxis tick size 1.000000
+@ yaxis tick minor size 0.500000
+@ yaxis bar off
+@ yaxis bar color 1
+@ yaxis bar linestyle 1
+@ yaxis bar linewidth 1
+@ yaxis tick major grid off
+@ yaxis tick minor grid off
+@ yaxis tick op both
+@ yaxis tick type auto
+@ yaxis tick spec 0
+@ zeroxaxis tick on
+@ zeroxaxis tick major 10
+@ zeroxaxis tick minor 5
+@ zeroxaxis tick offsetx 0.000000
+@ zeroxaxis tick offsety 0.000000
+@ zeroxaxis label ""
+@ zeroxaxis label layout para
+@ zeroxaxis label place auto
+@ zeroxaxis label char size 1.000000
+@ zeroxaxis label font 4
+@ zeroxaxis label color 1
+@ zeroxaxis label linewidth 1
+@ zeroxaxis ticklabel off
+@ zeroxaxis ticklabel type auto
+@ zeroxaxis ticklabel prec 5
+@ zeroxaxis ticklabel format general
+@ zeroxaxis ticklabel append ""
+@ zeroxaxis ticklabel prepend ""
+@ zeroxaxis ticklabel layout horizontal
+@ zeroxaxis ticklabel place on ticks
+@ zeroxaxis ticklabel skip 0
+@ zeroxaxis ticklabel stagger 0
+@ zeroxaxis ticklabel op bottom
+@ zeroxaxis ticklabel sign normal
+@ zeroxaxis ticklabel start type auto
+@ zeroxaxis ticklabel start 0.000000
+@ zeroxaxis ticklabel stop type auto
+@ zeroxaxis ticklabel stop 0.000000
+@ zeroxaxis ticklabel char size 1.000000
+@ zeroxaxis ticklabel font 4
+@ zeroxaxis ticklabel color 1
+@ zeroxaxis ticklabel linewidth 1
+@ zeroxaxis tick major off
+@ zeroxaxis tick minor on
+@ zeroxaxis tick default 6
+@ zeroxaxis tick in
+@ zeroxaxis tick major color 1
+@ zeroxaxis tick major linewidth 1
+@ zeroxaxis tick major linestyle 1
+@ zeroxaxis tick minor color 1
+@ zeroxaxis tick minor linewidth 1
+@ zeroxaxis tick minor linestyle 1
+@ zeroxaxis tick log off
+@ zeroxaxis tick size 1.000000
+@ zeroxaxis tick minor size 0.500000
+@ zeroxaxis bar off
+@ zeroxaxis bar color 1
+@ zeroxaxis bar linestyle 1
+@ zeroxaxis bar linewidth 1
+@ zeroxaxis tick major grid off
+@ zeroxaxis tick minor grid off
+@ zeroxaxis tick op both
+@ zeroxaxis tick type auto
+@ zeroxaxis tick spec 0
+@ zeroyaxis tick on
+@ zeroyaxis tick major 10
+@ zeroyaxis tick minor 5
+@ zeroyaxis tick offsetx 0.000000
+@ zeroyaxis tick offsety 0.000000
+@ zeroyaxis label ""
+@ zeroyaxis label layout para
+@ zeroyaxis label place auto
+@ zeroyaxis label char size 1.000000
+@ zeroyaxis label font 4
+@ zeroyaxis label color 1
+@ zeroyaxis label linewidth 1
+@ zeroyaxis ticklabel off
+@ zeroyaxis ticklabel type auto
+@ zeroyaxis ticklabel prec 5
+@ zeroyaxis ticklabel format general
+@ zeroyaxis ticklabel append ""
+@ zeroyaxis ticklabel prepend ""
+@ zeroyaxis ticklabel layout horizontal
+@ zeroyaxis ticklabel place on ticks
+@ zeroyaxis ticklabel skip 0
+@ zeroyaxis ticklabel stagger 0
+@ zeroyaxis ticklabel op left
+@ zeroyaxis ticklabel sign normal
+@ zeroyaxis ticklabel start type auto
+@ zeroyaxis ticklabel start 0.000000
+@ zeroyaxis ticklabel stop type auto
+@ zeroyaxis ticklabel stop 0.000000
+@ zeroyaxis ticklabel char size 1.000000
+@ zeroyaxis ticklabel font 4
+@ zeroyaxis ticklabel color 1
+@ zeroyaxis ticklabel linewidth 1
+@ zeroyaxis tick major off
+@ zeroyaxis tick minor on
+@ zeroyaxis tick default 6
+@ zeroyaxis tick in
+@ zeroyaxis tick major color 1
+@ zeroyaxis tick major linewidth 1
+@ zeroyaxis tick major linestyle 1
+@ zeroyaxis tick minor color 1
+@ zeroyaxis tick minor linewidth 1
+@ zeroyaxis tick minor linestyle 1
+@ zeroyaxis tick log off
+@ zeroyaxis tick size 1.000000
+@ zeroyaxis tick minor size 0.500000
+@ zeroyaxis bar off
+@ zeroyaxis bar color 1
+@ zeroyaxis bar linestyle 1
+@ zeroyaxis bar linewidth 1
+@ zeroyaxis tick major grid off
+@ zeroyaxis tick minor grid off
+@ zeroyaxis tick op both
+@ zeroyaxis tick type auto
+@ zeroyaxis tick spec 0
+@ legend on
+@ legend loctype view
+@ legend layout 0
+@ legend vgap 2
+@ legend hgap 1
+@ legend length 4
+@ legend box off
+@ legend box fill off
+@ legend box fill with color
+@ legend box fill color 0
+@ legend box fill pattern 1
+@ legend box color 1
+@ legend box linewidth 1
+@ legend box linestyle 1
+@ legend x1 0.208791
+@ legend y1 0.756178
+@ legend font 4
+@ legend char size 1.000000
+@ legend linestyle 1
+@ legend linewidth 1
+@ legend color 1
+@ legend string 0 "1/Pr"
+@ legend string 1 "0.42 y+/Prt"
+@ legend string 2 "a1 (y+)**3/Prt"
+@ frame on
+@ frame type 0
+@ frame linestyle 1
+@ frame linewidth 1
+@ frame color 1
+@ frame fill off
+@ frame background color 0
+ at WITH G0
+ at G0 ON
+ at TARGET S0
+ at TYPE xy
+ 0 1
+ 15 1
+&
+ at TARGET S1
+ at TYPE xy
+ 17 7.14
+ 20 8.4
+ 30 12.6
+&
+ at TARGET S2
+ at TYPE xy
+ 0.1 1e-06
+ 0.2 8e-06
+ 0.3 2.7e-05
+ 0.4 6.4e-05
+ 0.5 0.000125
+ 0.6 0.000216
+ 0.7 0.000343
+ 0.8 0.000512
+ 0.9 0.000729
+ 1 0.001
+ 1.1 0.001331
+ 1.2 0.001728
+ 1.3 0.002197
+ 1.4 0.002744
+ 1.5 0.003375
+ 1.6 0.004096
+ 1.7 0.004913
+ 1.8 0.005832
+ 1.9 0.006859
+ 2 0.008
+ 2.1 0.009261
+ 2.2 0.010648
+ 2.3 0.012167
+ 2.4 0.013824
+ 2.5 0.015625
+ 2.6 0.017576
+ 2.7 0.019683
+ 2.8 0.021952
+ 2.9 0.024389
+ 3 0.027
+ 3.1 0.029791
+ 3.2 0.032768
+ 3.3 0.035937
+ 3.4 0.039304
+ 3.5 0.042875
+ 3.6 0.046656
+ 3.7 0.050653
+ 3.8 0.054872
+ 3.9 0.059319
+ 4 0.064
+ 4.1 0.068921
+ 4.2 0.074088
+ 4.3 0.079507
+ 4.4 0.085184
+ 4.5 0.091125
+ 4.6 0.097336
+ 4.7 0.103823
+ 4.8 0.110592
+ 4.9 0.117649
+ 5 0.125
+ 5.1 0.132651
+ 5.2 0.140608
+ 5.3 0.148877
+ 5.4 0.157464
+ 5.5 0.166375
+ 5.6 0.175616
+ 5.7 0.185193
+ 5.8 0.195112
+ 5.9 0.205379
+ 6 0.216
+ 6.1 0.226981
+ 6.2 0.238328
+ 6.3 0.250047
+ 6.4 0.262144
+ 6.5 0.274625
+ 6.6 0.287496
+ 6.7 0.300763
+ 6.8 0.314432
+ 6.9 0.328509
+ 7 0.343
+ 7.1 0.357911
+ 7.2 0.373248
+ 7.3 0.389017
+ 7.4 0.405224
+ 7.5 0.421875
+ 7.6 0.438976
+ 7.7 0.456533
+ 7.8 0.474552
+ 7.9 0.493039
+ 8 0.512
+ 8.1 0.531441
+ 8.2 0.551368
+ 8.3 0.571787
+ 8.4 0.592704
+ 8.5 0.614125
+ 8.6 0.636056
+ 8.7 0.658503
+ 8.8 0.681472
+ 8.9 0.704969
+ 9 0.729
+ 9.1 0.753571
+ 9.2 0.778688
+ 9.3 0.804357
+ 9.4 0.830584
+ 9.5 0.857375
+ 9.6 0.884736
+ 9.7 0.912673
+ 9.8 0.941192
+ 9.9 0.970299
+ 10 1
+ 10.1 1.0303
+ 10.2 1.06121
+ 10.3 1.09273
+ 10.4 1.12486
+ 10.5 1.15762
+ 10.6 1.19102
+ 10.7 1.22504
+ 10.8 1.25971
+ 10.9 1.29503
+ 11 1.331
+ 11.1 1.36763
+ 11.2 1.40493
+ 11.3 1.4429
+ 11.4 1.48154
+ 11.5 1.52087
+ 11.6 1.5609
+ 11.7 1.60161
+ 11.8 1.64303
+ 11.9 1.68516
+ 12 1.728
+ 12.1 1.77156
+ 12.2 1.81585
+ 12.3 1.86087
+ 12.4 1.90662
+ 12.5 1.95312
+ 12.6 2.00038
+ 12.7 2.04838
+ 12.8 2.09715
+ 12.9 2.14669
+ 13 2.197
+ 13.1 2.24809
+ 13.2 2.29997
+ 13.3 2.35264
+ 13.4 2.4061
+ 13.5 2.46037
+ 13.6 2.51546
+ 13.7 2.57135
+ 13.8 2.62807
+ 13.9 2.68562
+ 14 2.744
+ 14.1 2.80322
+ 14.2 2.86329
+ 14.3 2.92421
+ 14.4 2.98598
+ 14.5 3.04862
+ 14.6 3.11214
+ 14.7 3.17652
+ 14.8 3.24179
+ 14.9 3.30795
+ 15 3.375
+ 15.1 3.44295
+ 15.2 3.51181
+ 15.3 3.58158
+ 15.4 3.65226
+ 15.5 3.72388
+ 15.6 3.79642
+ 15.7 3.86989
+ 15.8 3.94431
+ 15.9 4.01968
+ 16 4.096
+ 16.1 4.17328
+ 16.2 4.25153
+ 16.3 4.33075
+ 16.4 4.41094
+ 16.5 4.49212
+ 16.6 4.5743
+ 16.7 4.65746
+ 16.8 4.74163
+ 16.9 4.82681
+ 17 4.913
+ 17.1 5.00021
+ 17.2 5.08845
+ 17.3 5.17772
+ 17.4 5.26802
+ 17.5 5.35938
+ 17.6 5.45178
+ 17.7 5.54523
+ 17.8 5.63975
+ 17.9 5.73534
+ 18 5.832
+ 18.1 5.92974
+ 18.2 6.02857
+ 18.3 6.12849
+ 18.4 6.2295
+ 18.5 6.33162
+ 18.6 6.43486
+ 18.7 6.5392
+ 18.8 6.64467
+ 18.9 6.75127
+ 19 6.859
+ 19.1 6.96787
+ 19.2 7.07789
+ 19.3 7.18906
+ 19.4 7.30138
+ 19.5 7.41488
+ 19.6 7.52954
+ 19.7 7.64537
+ 19.8 7.76239
+ 19.9 7.8806
+ 20 8
+ 20.1 8.1206
+ 20.2 8.24241
+ 20.3 8.36543
+ 20.4 8.48966
+ 20.5 8.61513
+ 20.6 8.74182
+ 20.7 8.86974
+ 20.8 8.99891
+ 20.9 9.12933
+ 21 9.261
+ 21.1 9.39393
+ 21.2 9.52813
+ 21.3 9.6636
+ 21.4 9.80034
+ 21.5 9.93838
+ 21.6 10.0777
+ 21.7 10.2183
+ 21.8 10.3602
+ 21.9 10.5035
+ 22 10.648
+ 22.1 10.7939
+ 22.2 10.941
+ 22.3 11.0896
+ 22.4 11.2394
+ 22.5 11.3906
+ 22.6 11.5432
+ 22.7 11.6971
+ 22.8 11.8524
+ 22.9 12.009
+ 23 12.167
+ 23.1 12.3264
+ 23.2 12.4872
+ 23.3 12.6493
+ 23.4 12.8129
+ 23.5 12.9779
+ 23.6 13.1443
+ 23.7 13.3121
+ 23.8 13.4813
+ 23.9 13.6519
+ 24 13.824
+ 24.1 13.9975
+ 24.2 14.1725
+ 24.3 14.3489
+ 24.4 14.5268
+ 24.5 14.7061
+ 24.6 14.8869
+ 24.7 15.0692
+ 24.8 15.253
+ 24.9 15.4382
+ 25 15.625
+ 25.1 15.8133
+ 25.2 16.003
+ 25.3 16.1943
+ 25.4 16.3871
+ 25.5 16.5814
+ 25.6 16.7772
+ 25.7 16.9746
+ 25.8 17.1735
+ 25.9 17.374
+ 26 17.576
+ 26.1 17.7796
+ 26.2 17.9847
+ 26.3 18.1914
+ 26.4 18.3997
+ 26.5 18.6096
+ 26.6 18.8211
+ 26.7 19.0342
+ 26.8 19.2488
+ 26.9 19.4651
+ 27 19.683
+ 27.1 19.9025
+ 27.2 20.1236
+ 27.3 20.3464
+ 27.4 20.5708
+ 27.5 20.7969
+ 27.6 21.0246
+ 27.7 21.2539
+ 27.8 21.485
+ 27.9 21.7176
+ 28 21.952
+ 28.1 22.188
+ 28.2 22.4258
+ 28.3 22.6652
+ 28.4 22.9063
+ 28.5 23.1491
+ 28.6 23.3937
+ 28.7 23.6399
+ 28.8 23.8879
+ 28.9 24.1376
+ 29 24.389
+ 29.1 24.6422
+ 29.2 24.8971
+ 29.3 25.1538
+ 29.4 25.4122
+ 29.5 25.6724
+ 29.6 25.9343
+ 29.7 26.1981
+ 29.8 26.4636
+ 29.9 26.7309
+ 30 27
+&
diff --git a/doc/theory/graphics/condlimite.fig b/doc/theory/graphics/condlimite.fig
new file mode 100644
index 0000000..ba6bff5
--- /dev/null
+++ b/doc/theory/graphics/condlimite.fig
@@ -0,0 +1,351 @@
+#FIG 3.2 Produced by xfig version 3.2.5-alpha5
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+0 32 #b3afa9
+6 2205 2610 6075 2835
+6 2250 2610 6030 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 2610 2430 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2430 2610 2610 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2610 2610 2790 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2790 2610 2970 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3150 2610 3330 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3510 2610 3690 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3690 2610 3870 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3870 2610 4050 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4050 2610 4230 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4230 2610 4410 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4410 2610 4590 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4590 2610 4770 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4770 2610 4950 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4950 2610 5130 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5130 2610 5310 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5310 2610 5490 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5490 2610 5670 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5670 2610 5850 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5850 2610 6030 2790
+-6
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 2250 2790 6030 2790
+-6
+6 2250 2925 6030 5130
+6 2250 4950 6030 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2970 4950 3150 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3150 4950 3330 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3330 4950 3510 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3510 4950 3690 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3690 4950 3870 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3870 4950 4050 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4050 4950 4230 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4230 4950 4410 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4410 4950 4590 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4590 4950 4770 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4770 4950 4950 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4950 4950 5130 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5130 4950 5310 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5310 4950 5490 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5490 4950 5670 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5670 4950 5850 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 5850 4950 6030 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 4950 2430 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2430 4950 2610 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2610 4950 2790 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2790 4950 2970 5130
+-6
+1 4 0 1 0 7 50 -1 -1 4.000 1 0.0000 4591 4415 269 269 4415 4213 4767 4618
+1 4 0 1 0 7 50 -1 -1 4.000 1 0.0000 5220 3397 437 437 4860 3150 5580 3645
+1 4 0 1 0 7 50 -1 -1 4.000 1 0.0000 3262 3442 356 356 2970 3240 3555 3645
+-6
+6 7785 2610 15705 6165
+6 7785 2610 15705 6165
+6 7785 2610 15660 6165
+6 7785 2610 15660 5130
+6 7785 2610 13725 5130
+6 7785 2610 13725 5130
+6 7785 2610 13725 5130
+6 9855 2610 13635 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10575 2610 10755 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10755 2610 10935 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10935 2610 11115 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11115 2610 11295 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11295 2610 11475 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11475 2610 11655 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11655 2610 11835 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11835 2610 12015 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12015 2610 12195 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12195 2610 12375 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12375 2610 12555 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12555 2610 12735 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12735 2610 12915 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12915 2610 13095 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 13095 2610 13275 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 13275 2610 13455 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 13455 2610 13635 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 9855 2610 10035 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10035 2610 10215 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10215 2610 10395 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10395 2610 10575 2790
+-6
+6 9855 4950 13635 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10575 4950 10755 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10755 4950 10935 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10935 4950 11115 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11115 4950 11295 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11295 4950 11475 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11475 4950 11655 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11655 4950 11835 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 11835 4950 12015 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12015 4950 12195 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12195 4950 12375 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12375 4950 12555 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12555 4950 12735 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12735 4950 12915 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 12915 4950 13095 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 13095 4950 13275 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 13275 4950 13455 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 13455 4950 13635 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 9855 4950 10035 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10035 4950 10215 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10215 4950 10395 5130
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 10395 4950 10575 5130
+-6
+1 4 0 1 0 7 50 -1 -1 4.000 1 0.0000 12196 4415 269 269 12020 4213 12372 4618
+1 4 0 1 0 7 50 -1 -1 4.000 1 0.0000 12825 3397 437 437 12465 3150 13185 3645
+1 4 1 1 32 7 50 -1 -1 2.000 1 0.0000 8462 4372 269 269 8193 4372 8731 4372
+1 4 1 1 32 7 50 -1 -1 2.000 1 0.0000 9134 3405 437 437 8697 3405 9571 3405
+2 1 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 13680 2835 13680 4905
+2 1 1 2 32 7 51 -1 -1 3.000 0 0 -1 0 0 2
+ 7875 4950 9855 4950
+2 1 1 2 32 7 51 -1 -1 3.000 0 0 -1 0 0 2
+ 7830 2790 9810 2790
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 12915 2925 12780 2970 12915 3060
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 9225 2925 9090 2970 9225 3015
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 8370 4050 8505 4095 8415 4185
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 12105 4095 12240 4140 12150 4230
+4 0 32 51 -1 0 14 0.0000 4 165 150 13410 3780 L\001
+-6
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 9900 4950 13680 4950
+2 1 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 9855 2835 9855 4905
+2 1 1 2 32 7 50 -1 -1 3.000 0 0 -1 0 0 2
+ 7830 2835 7830 4905
+-6
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 9855 2790 13635 2790
+-6
+2 1 1 2 32 7 51 -1 -1 3.000 0 0 -1 0 0 2
+ 13635 2790 15615 2790
+-6
+6 10125 2745 14670 6165
+6 10125 2745 14670 6165
+6 10485 2745 14670 4995
+1 4 0 1 0 7 50 -1 -1 4.000 1 0.0000 10867 3442 356 356 10575 3240 11160 3645
+2 1 1 2 0 7 51 -1 -1 6.000 0 0 -1 0 0 2
+ 11790 2790 11790 4950
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 10800 3015 10935 3105 10800 3150
+2 1 0 2 32 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 1 2.00 120.00 240.00
+ 10845 3465 14625 3465
+-6
+4 0 0 51 -1 0 20 0.0000 4 300 3225 10125 6075 Condition de p\351riodicit\351\001
+-6
+-6
+4 0 0 51 -1 0 14 0.0000 4 165 135 10620 3465 P\001
+-6
+2 1 1 2 32 7 51 -1 -1 3.000 0 0 -1 0 0 2
+ 13680 4950 15660 4950
+2 1 1 2 32 7 50 -1 -1 3.000 0 0 -1 0 0 2
+ 15615 2835 15615 4905
+-6
+6 14220 3060 15210 3825
+6 14220 3060 15210 3825
+1 4 1 1 0 7 50 -1 -1 2.000 1 0.0000 14604 3454 356 356 14248 3454 14960 3454
+4 0 0 51 -1 0 14 0.0000 4 165 180 15030 3240 P'\001
+-6
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 14535 3060 14625 3105 14535 3150
+-6
+-6
+6 7425 5220 8550 6345
+6 7425 5490 8550 6345
+2 1 0 2 0 7 50 -1 -1 6.000 0 0 -1 1 0 2
+ 1 1 2.00 120.00 240.00
+ 7515 6255 8235 6255
+2 1 0 2 0 7 50 -1 -1 6.000 0 0 -1 1 0 2
+ 1 1 2.00 120.00 240.00
+ 7515 6255 7515 5535
+4 0 0 50 -1 0 20 0.0000 4 150 150 8370 6345 z\001
+-6
+4 0 0 50 -1 0 20 0.0000 4 225 165 7425 5400 y\001
+-6
+1 4 1 1 0 7 50 -1 -1 2.000 1 0.0000 5103 2178 356 356 4747 2178 5459 2178
+1 4 1 1 32 7 50 -1 -1 2.000 1 0.0000 3181 2226 437 437 2744 2226 3618 2226
+1 4 1 1 32 7 50 -1 -1 2.000 1 0.0000 3825 997 269 269 3556 997 4094 997
+2 1 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 2790 2250 4860
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2970 2610 3150 2790
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 3330 2610 3510 2790
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 3150 6030 3150
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 3870 6030 3870
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 4230 6030 4230
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 4590 6030 4590
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 2250 4950 6030 4950
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 2790 2790 2790 4950
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 3330 2790 3330 4950
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 3870 2790 3870 4950
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 4410 2835 4410 4995
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 4950 2790 4950 4950
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 5490 2790 5490 4950
+2 1 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 6030 2790 6030 4860
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 4095 2970 4185 2970
+2 1 1 1 0 7 51 -1 -1 1.000 0 0 -1 0 0 2
+ 4140 2970 4140 2790
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 4140 2925 4140 3015
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 3510 6030 3510
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 4545 4410 4635 4410
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 4590 4365 4590 4455
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 5175 3375 5265 3375
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 5220 3330 5220 3420
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 3195 3420 3285 3420
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 3240 3375 3240 3465
+2 1 1 1 0 7 51 -1 -1 1.000 0 0 -1 0 0 2
+ 3240 3420 5130 2160
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 3555 3420 3600 3510 3690 3420
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 5400 2250 5445 2160 5490 2250
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 5085 2160 5175 2160
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 5130 2115 5130 2205
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 3
+ 3555 2160 3600 2250 3690 2160
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 4725 3330 4770 3420 4860 3330
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 4545 4095 4680 4140 4590 4230
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 3
+ 3825 1215 3915 1260 3870 1305
+4 0 0 50 -1 0 14 0.0000 4 165 135 2700 3375 P\001
+4 0 0 51 -1 0 14 0.0000 4 165 90 4230 2475 J\001
+4 0 0 51 -1 0 14 0.0000 4 165 180 5490 1935 P'\001
+4 0 32 51 -1 0 16 0.0000 4 255 2865 4275 1440 Vortex images au point M\001
+4 0 0 51 -1 0 14 0.0000 4 165 210 4500 3060 M\001
+4 0 0 51 -1 0 20 0.0000 4 300 2490 3060 6075 Condition de paroi\001
diff --git a/doc/theory/graphics/domaine1d.fig b/doc/theory/graphics/domaine1d.fig
new file mode 100644
index 0000000..969e73c
--- /dev/null
+++ b/doc/theory/graphics/domaine1d.fig
@@ -0,0 +1,91 @@
+#FIG 3.1
+Landscape
+Center
+Inches
+1200 2
+6 1950 2550 2250 2850
+4 0 -1 0 0 0 12 0.0000 4 135 105 1950 2700 S\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 2025 2775 b\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 2100 2850 1\001
+-6
+6 2475 2850 3000 3450
+4 0 -1 0 0 0 12 0.0000 4 180 165 2625 3300 u)\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 2775 3375 b\001
+4 0 -1 0 0 0 12 0.0000 4 180 75 2475 3300 (\001
+4 0 -1 0 0 32 12 0.0000 4 135 105 2550 3300 r\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 2850 3450 1\001
+-6
+6 4500 2925 5025 3525
+4 0 -1 0 0 0 12 0.0000 4 180 165 4650 3375 u)\001
+4 0 -1 0 0 0 12 0.0000 4 180 75 4500 3375 (\001
+4 0 -1 0 0 32 12 0.0000 4 135 105 4575 3375 r\001
+4 0 -1 0 0 0 12 0.0000 4 135 180 4800 3525 12\001
+-6
+6 6525 2925 7050 3525
+4 0 -1 0 0 0 12 0.0000 4 180 165 6675 3375 u)\001
+4 0 -1 0 0 0 12 0.0000 4 180 75 6525 3375 (\001
+4 0 -1 0 0 32 12 0.0000 4 135 105 6600 3375 r\001
+4 0 -1 0 0 0 12 0.0000 4 135 180 6825 3525 23\001
+-6
+6 8550 3225 9075 3525
+4 0 -1 0 0 0 12 0.0000 4 180 165 8700 3375 u)\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 8850 3450 b\001
+4 0 -1 0 0 0 12 0.0000 4 180 75 8550 3375 (\001
+4 0 -1 0 0 32 12 0.0000 4 135 105 8625 3375 r\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 8925 3525 2\001
+-6
+6 3750 3375 4125 3600
+4 0 -1 0 0 32 12 0.0000 4 135 150 3750 3525 W\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 3975 3600 1\001
+-6
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 3384 3098 33 33 3384 3098 3417 3132
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 7434 3098 33 33 7434 3098 7467 3132
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 5409 3098 33 33 5409 3098 5442 3132
+2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 3.00 60.00 120.00
+ 2025 3075 2700 3075
+2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 3.00 60.00 120.00
+ 4050 3075 4725 3075
+2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 3.00 60.00 120.00
+ 6075 3075 6750 3075
+2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 3.00 60.00 120.00
+ 8100 3075 8775 3075
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 1725 3000 2400 3000
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 4425 3000 5100 3000
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 6450 3000 7125 3000
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 8475 3000 9150 3000
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 2325 3975 9225 3975
+2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 4425 2400 6463 2400 6463 3750 4425 3750 4425 2400
+2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 6450 2400 8488 2400 8488 3750 6450 3750 6450 2400
+2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 2400 2400 4425 2400 4425 3750 2400 3750 2400 2400
+4 0 -1 0 0 0 12 0.0000 4 135 180 4650 2925 12\001
+4 0 -1 0 0 0 12 0.0000 4 135 180 6750 2850 23\001
+4 0 -1 0 0 0 14 0.0000 4 150 120 4575 2775 S\001
+4 0 -1 0 0 0 14 0.0000 4 150 120 6600 2775 S\001
+4 0 -1 0 0 0 12 0.0000 4 135 105 8625 2700 S\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 8700 2775 b\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 8775 2850 2\001
+4 0 -1 0 0 0 12 0.0000 4 90 90 9150 4200 x\001
+4 0 -1 0 0 32 12 0.0000 4 135 150 5625 3525 W\001
+4 0 -1 0 0 32 12 0.0000 4 135 150 7800 3525 W\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 5850 3600 2\001
+4 0 -1 0 0 0 12 0.0000 4 135 90 8025 3600 3\001
+4 0 -1 0 0 0 12 0.0000 4 135 240 3450 3000 i=1\001
+4 0 -1 0 0 0 12 0.0000 4 135 240 5475 3000 i=2\001
+4 0 -1 0 0 0 12 0.0000 4 135 240 7500 3000 i=3\001
diff --git a/doc/theory/graphics/entree.fig b/doc/theory/graphics/entree.fig
new file mode 100644
index 0000000..187236a
--- /dev/null
+++ b/doc/theory/graphics/entree.fig
@@ -0,0 +1,116 @@
+#FIG 3.2 Produced by xfig version 3.2.5-alpha5
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+0 32 #bfb7b7
+1 2 0 1 0 7 50 -1 -1 4.000 1 0.0000 3397 2835 112 315 3285 2520 3510 3150
+1 2 0 1 0 7 50 -1 -1 4.000 1 0.0000 2632 3442 68 157 2700 3285 2565 3600
+1 2 0 1 0 7 50 -1 -1 4.000 1 0.0000 3510 2025 90 180 3600 1845 3420 2205
+1 2 0 1 0 7 50 -1 -1 4.000 1 0.0000 2655 2662 135 292 2520 2370 2790 2955
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 2250 2160 2250 4050
+2 1 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2251 4052 4050 3195
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 2250 4050 3780 4050
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 2250 1575 2250 2160
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 1755 2160 2250 2160
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 1755 4050 2250 4050
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+ 1 1 2.00 120.00 240.00
+ 1 1 2.00 120.00 240.00
+ 1800 2160 1800 4050
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 1 2
+ 1 1 2.00 120.00 240.00
+ 1 1 2.00 120.00 240.00
+ 2250 1620 4050 765
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 3
+ 3240 2970 3285 2835 3375 2970
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 3
+ 3375 1980 3420 2115 3465 1980
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 3
+ 2655 3510 2700 3420 2745 3555
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 2250 2160 3825 2160
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 2970 1845 2970 3735
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 3330 1665 3330 3555
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 3690 1485 3690 3375
+2 1 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4050 1350 4050 3195
+2 1 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4050 3195 5400 3195
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2
+ 4050 810 4050 1350
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 4050 1305 5445 1305
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 2245 2150 4044 1293
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 2246 3591 4045 2734
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 2249 3146 4048 2289
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 2249 2696 4048 1839
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 3870 3015 3870 3150
+2 1 0 1 32 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 3825 3105 3915 3060
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 4680 1350 4680 3150
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 4680 1620 5220 1620
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 4680 1980 5355 1980
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 4680 2340 5355 2340
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 4680 2700 5265 2700
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 4680 2970 5085 2970
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 5535 1710 5715 1710
+2 1 0 1 0 7 51 -1 -1 4.000 0 0 -1 0 0 2
+ 2662 2632 2662 2767
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 3
+ 2752 2580 2797 2715 2842 2580
+2 1 0 1 32 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 2610 1980 2610 3870
+2 1 0 1 0 7 51 -1 -1 0.000 0 0 -1 0 0 2
+ 2610 2715 2700 2670
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 1 2.00 120.00 240.00
+ 900 4725 900 3870
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 1 2.00 120.00 240.00
+ 900 4725 1755 4725
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 1 2
+ 1 1 2.00 120.00 240.00
+ 66 5086 876 4726
+3 0 0 1 0 7 51 -1 -1 4.000 0 0 0 4
+ 4680 1350 5400 1530 5400 2925 4725 3195
+ 0.000 1.000 1.000 0.000
+4 0 0 50 -1 0 20 0.0000 4 300 525 1080 3105 Lyy\001
+4 0 0 50 -1 0 20 0.0000 4 225 495 2610 990 Lzz\001
+4 0 0 51 -1 0 14 0.0000 4 165 135 2385 2790 P\001
+4 0 32 51 -1 0 14 0.0000 4 165 210 4140 2970 M\001
+4 0 0 51 -1 0 16 0.0000 4 195 195 5535 2025 U\001
+4 0 0 50 -1 0 20 0.0000 4 150 165 1845 4995 x\001
+4 0 0 50 -1 0 20 0.0000 4 225 165 585 3780 y\001
+4 0 0 50 -1 0 20 0.0000 4 225 165 1035 4590 0\001
+4 0 0 50 -1 0 20 0.0000 4 150 150 360 5355 z\001
diff --git a/doc/theory/graphics/facebord.fig b/doc/theory/graphics/facebord.fig
new file mode 100644
index 0000000..a9ea880
--- /dev/null
+++ b/doc/theory/graphics/facebord.fig
@@ -0,0 +1,33 @@
+#FIG 3.1
+Portrait
+Center
+Metric
+1200 2
+2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 2250 2250 2250 5400
+2 2 1 0 0 7 1 0 42 2.000 0 0 -1 0 0 5
+ 2025 2250 2250 2250 2250 5400 2025 5400 2025 2250
+2 1 1 1 0 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 2250 3825 5400 3825
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 2250 3825 5400 2475
+2 1 1 1 0 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 5400 2475 5400 3825
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 3
+ 5385 3645 5250 3645 5250 3825
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 3
+ 2295 4020 2430 4020 2430 3840
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 2295 2250 6885 1800 8100 4095 5715 6795 2250 5355
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 1665 2295 1665 5400
+4 0 -1 0 0 3 24 0.0000 0 255 225 5505 3975 I'\001
+4 0 -1 0 0 3 24 0.0000 0 255 120 5520 2595 I\001
+4 0 -1 0 0 3 24 0.0000 0 255 225 2325 3660 F\001
+4 0 -1 0 0 3 24 0.0000 0 255 180 1155 3705 S\001
+4 0 -1 0 0 3 20 0.0000 0 210 150 1290 3840 b\001
+4 0 -1 0 0 3 18 0.0000 0 195 195 1425 3975 ik\001
+4 0 -1 0 0 32 24 0.0000 4 255 270 5205 5235 W\001
+4 0 -1 0 0 3 24 0.0000 0 240 105 5475 5340 i\001
diff --git a/doc/theory/graphics/facesym.fig b/doc/theory/graphics/facesym.fig
new file mode 100644
index 0000000..7c91b9f
--- /dev/null
+++ b/doc/theory/graphics/facesym.fig
@@ -0,0 +1,113 @@
+#FIG 3.1
+Portrait
+Center
+Metric
+1200 2
+6 4050 2235 9150 6285
+6 4170 4710 4365 4950
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 4170 4950 4350 4950
+4 0 -1 0 0 3 26 0.0000 0 165 195 4170 4875 n\001
+-6
+6 5925 4575 7110 4980
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 5925 4980 6105 4980
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 6855 4965 7035 4965
+4 0 -1 0 0 3 26 0.0000 0 165 1140 5970 4905 n = -n\001
+4 0 -1 0 0 3 26 0.0000 0 60 210 5955 4710 ~\001
+-6
+6 5355 2970 5535 3285
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 5355 3285 5535 3285
+4 0 -1 0 0 3 26 0.0000 0 210 105 5430 3180 t\001
+-6
+6 7680 5550 9150 5940
+6 8610 5655 8790 5835
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8610 5835 8700 5655
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8790 5835 8700 5655
+-6
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7680 5940 7860 5940
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8325 5910 8505 5910
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8880 5925 9060 5925
+4 0 -1 0 0 3 26 0.0000 0 270 1395 7725 5835 b = t n\001
+4 0 -1 0 0 3 26 0.0000 0 60 210 8940 5685 ~\001
+-6
+6 7485 3225 7710 3495
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7485 3495 7665 3495
+4 0 -1 0 0 3 26 0.0000 0 180 195 7515 3405 u\001
+-6
+6 7215 5595 7485 5865
+1 3 0 1 -1 7 0 0 -1 0.000 1 0.0000 7350 5730 135 135 7350 5730 7350 5865
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7260 5640 7440 5820
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7260 5820 7440 5640
+-6
+2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 4795 3248 5872 6208
+2 1 1 1 0 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 5334 4728 8294 3651
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 5334 4728 7832 2382
+2 1 1 1 0 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 7832 2382 8294 3651
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 3
+ 8218 3487 8091 3533 8153 3702
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 3
+ 5443 4896 5570 4850 5508 4680
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 5334 4728 4065 5190
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 5334 4728 6602 4266
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 5526 3940 5064 2671
+2 3 0 0 0 7 1 0 42 0.000 0 0 -1 0 0 6
+ 4584 3325 4795 3248 5872 6208 5661 6285 4584 3325 4584 3325
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 1 1 1.00 60.00 120.00
+ 8282 3642 7263 2816
+4 0 -1 0 0 3 24 0.0000 0 255 225 5340 4530 F\001
+4 0 -1 0 0 3 24 0.0000 0 255 225 8445 3780 I'\001
+4 0 -1 0 0 3 24 0.0000 0 255 120 8070 2490 I\001
+-6
+6 885 4020 2490 5490
+6 2212 5010 2490 5265
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 2212 5265 2392 5265
+4 0 -1 0 0 3 26 0.0000 0 180 180 2212 5190 e\001
+4 0 -1 0 0 3 20 0.0000 0 135 120 2370 5250 x\001
+-6
+6 1357 4020 1650 4275
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1357 4275 1537 4275
+4 0 -1 0 0 3 26 0.0000 0 180 180 1357 4200 e\001
+4 0 -1 0 0 3 20 0.0000 0 135 105 1545 4245 z\001
+-6
+6 885 5070 1155 5340
+1 3 0 1 -1 7 0 0 -1 0.000 1 0.0000 1020 5205 135 135 1020 5205 1020 5340
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 930 5115 1110 5295
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 930 5295 1110 5115
+-6
+6 1267 5197 1575 5490
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1267 5452 1447 5452
+4 0 -1 0 0 3 26 0.0000 0 180 180 1267 5377 e\001
+4 0 -1 0 0 3 20 0.0000 0 195 120 1455 5430 y\001
+-6
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 3
+ 1 1 1.00 60.00 120.00
+ 1 1 1.00 60.00 120.00
+ 1230 4080 1230 4965 2145 4965
+-6
diff --git a/doc/theory/graphics/facette.fig b/doc/theory/graphics/facette.fig
new file mode 100644
index 0000000..bdeb38a
--- /dev/null
+++ b/doc/theory/graphics/facette.fig
@@ -0,0 +1,40 @@
+#FIG 3.1
+Portrait
+Center
+Metric
+1200 2
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 1800 3600 6300 3600
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1800 5400 6300 3150
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 6300 3600 6300 3150
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 1800 3600 1800 5400
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 3
+ 1845 3780 1980 3780 1980 3600
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 3
+ 4455 3780 4320 3780 4320 3600
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 3
+ 6300 3420 6165 3420 6165 3600
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 14
+ 4500 1800 7290 2655 8865 3825 7740 5805 4950 6390 4500 5400
+ 4500 5400 2610 6750 540 6030 540 3285 2385 2295 4500 1800
+ 4500 1845 4500 1800
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 4545 2700 6075 900
+2 1 0 4 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 4500 1800 4500 5400
+4 0 -1 0 0 3 24 0.0000 0 255 120 1560 5595 I\001
+4 0 -1 0 0 3 24 0.0000 0 255 225 1575 3675 I'\001
+4 0 -1 0 0 3 24 0.0000 0 255 165 6390 3255 J\001
+4 0 -1 0 0 3 24 0.0000 0 255 270 6345 3765 J'\001
+4 0 -1 0 0 3 24 0.0000 0 255 225 4185 3495 F\001
+4 0 -1 0 0 3 24 0.0000 0 255 270 4650 4365 O\001
+4 0 -1 0 0 3 24 0.0000 0 255 180 6300 840 S\001
+4 0 -1 0 0 32 24 0.0000 4 255 270 6390 5340 W\001
+4 0 -1 0 0 32 24 0.0000 4 255 270 2520 2865 W\001
+4 0 -1 0 0 3 24 0.0000 0 240 105 2835 3000 i\001
+4 0 -1 0 0 3 24 0.0000 0 315 90 6705 5520 j\001
+4 0 -1 0 0 3 20 0.0000 0 255 150 6480 975 ij\001
diff --git a/doc/theory/graphics/fluxbord.fig b/doc/theory/graphics/fluxbord.fig
new file mode 100644
index 0000000..fd8d23e
--- /dev/null
+++ b/doc/theory/graphics/fluxbord.fig
@@ -0,0 +1,87 @@
+#FIG 3.1
+Portrait
+Center
+Inches
+1200 2
+6 2700 3675 7725 4275
+4 0 -1 0 0 1 24 0.0000 4 330 105 4575 4050 f\001
+4 0 -1 0 0 1 24 0.0000 4 330 105 6525 4050 f\001
+4 0 -1 0 0 1 24 0.0000 4 330 105 2700 4050 f\001
+4 0 -1 0 0 1 24 0.0000 4 255 225 2775 4200 I'\001
+4 0 -1 0 0 1 24 0.0000 4 300 690 4650 4200 b,ext\001
+4 0 -1 0 0 1 24 0.0000 4 300 675 3450 4200 b,int\001
+4 0 -1 0 0 1 24 0.0000 4 330 105 3450 3975 f\001
+4 0 -1 0 0 1 24 0.0000 4 315 1095 6600 4200 imp,ext\001
+-6
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 2550 2475 75 75 2550 2475 2625 2550
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 4425 1350 4425 5775
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 4425 1500 1350 825 225 2475 2100 5175 4425 5025
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 2550 1950 2550 3750
+2 3 0 0 -1 7 10 0 44 0.000 0 0 -1 0 0 7
+ 4425 1350 5850 1500 6300 2175 6300 4950 5100 5925 4425 5775
+ 4425 1350
+2 2 0 1 -1 0 0 0 20 0.000 0 0 -1 0 0 5
+ 4425 1350 4200 1350 4200 5775 4425 5775 4425 1350
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 4200 5775 4200 6975
+2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 4425 5775 4425 7500
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 2475 6675 4200 6675
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 4500 6675 6225 6675
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 3600 1200 4125 2175
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 4800 825 4350 1275
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2
+ 0 0 1.00 60.00 120.00
+ 4425 2925 6825 2925
+2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 6525 2625 6750 2625
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 2625 3375 2775 3750
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 4125 3375 3750 3825
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 4500 3375 4800 3825
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 6375 3375 6900 3825
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 1 2
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+ 2475 7425 4425 7425
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 1 2
+ 0 0 1.00 60.00 120.00
+ 300 3300 8850 3300
+4 0 -1 0 0 0 24 0.0000 4 255 120 2250 2325 I\001
+4 0 -1 0 0 0 24 0.0000 4 255 240 2250 3225 I'\001
+4 0 -1 0 0 1 24 0.0000 4 255 195 3075 7050 h\001
+4 0 -1 0 0 1 24 0.0000 4 255 195 5100 7050 h\001
+4 0 -1 0 0 1 24 0.0000 4 315 1095 5250 7200 imp,ext\001
+4 0 -1 0 0 0 24 0.0000 4 255 195 3075 1050 S\001
+4 0 -1 0 0 0 24 0.0000 4 255 180 3300 1200 b\001
+4 0 -1 0 0 0 24 0.0000 4 255 210 3900 3150 F\001
+4 0 -1 0 0 0 24 0.0000 4 255 2745 300 1650 Domaine de calcul\001
+4 0 -1 0 0 0 24 0.0000 4 255 3945 4500 750 Bord du domaine de calcul\001
+4 0 -1 0 0 0 24 0.0000 4 180 195 6525 2550 n\001
+4 0 -1 0 0 0 24 0.0000 4 255 2490 6900 2550 normale sortante\001
+4 0 -1 0 0 0 24 0.0000 4 255 1665 7800 2850 de norme 1\001
+4 0 -1 0 0 1 24 0.0000 4 240 405 3225 7275 int\001
+4 0 -1 0 0 1 24 0.0000 4 255 195 3075 7725 h\001
+4 0 -1 0 0 1 24 0.0000 4 255 180 3300 7950 b\001
+4 0 -1 0 0 1 24 0.0000 4 240 165 375 3675 y\001
+4 0 -1 0 0 1 24 0.0000 4 345 3360 375 6525 Coefficients d'echange\001
diff --git a/doc/theory/graphics/loilog.f b/doc/theory/graphics/loilog.f
new file mode 100644
index 0000000..1db7efd
--- /dev/null
+++ b/doc/theory/graphics/loilog.f
@@ -0,0 +1,8 @@
+ integer i
+ double precision x
+ do i = 1, 2000
+ x=float(i)/100.d0
+ write(*,'(6E18.9)')x, 1/0.42*log(x)+5.2,x,
+ & 2/0.42*log(x)+5.2,2*x,2/0.42
+ enddo
+ end
diff --git a/doc/theory/graphics/loilog.pdf b/doc/theory/graphics/loilog.pdf
new file mode 100644
index 0000000..5c99861
Binary files /dev/null and b/doc/theory/graphics/loilog.pdf differ
diff --git a/doc/theory/graphics/loilog.xmgr b/doc/theory/graphics/loilog.xmgr
new file mode 100644
index 0000000..c269cee
--- /dev/null
+++ b/doc/theory/graphics/loilog.xmgr
@@ -0,0 +1,10445 @@
+# ACE/gr parameter file
+#
+ at page layout free
+ at ps linewidth begin 1
+ at ps linewidth increment 2
+ at hardcopy device 1
+ at page 5
+ at page inout 5
+ at link page off
+ at default linestyle 1
+ at default linewidth 1
+ at default color 1
+ at default char size 1.000000
+ at default font 4
+ at default font source 0
+ at default symbol size 1.000000
+ at timestamp off
+ at timestamp 0.03, 0.03
+ at timestamp linewidth 1
+ at timestamp color 1
+ at timestamp rot 0
+ at timestamp font 4
+ at timestamp char size 1.000000
+ at timestamp def "Mon Mar 25 19:00:19 2002"
+ at with g0
+ at g0 on
+ at g0 label off
+ at g0 hidden false
+ at g0 type xy
+ at g0 autoscale type AUTO
+ at g0 fixedpoint off
+ at g0 fixedpoint type 0
+ at g0 fixedpoint xy 0.000000, 0.000000
+ at g0 fixedpoint format general general
+ at g0 fixedpoint prec 6, 6
+@ world xmin 0
+@ world xmax 12
+@ world ymin -4
+@ world ymax 20
+@ stack world 0, 0, 0, 0 tick 0, 0, 0, 0
+@ view xmin 0.150000
+@ view xmax 0.850000
+@ view ymin 0.150000
+@ view ymax 0.850000
+@ title ""
+@ title font 4
+@ title size 1.500000
+@ title color 1
+@ title linewidth 1
+@ subtitle ""
+@ subtitle font 4
+@ subtitle size 1.000000
+@ subtitle color 1
+@ subtitle linewidth 1
+@ s0 symbol 0
+@ s0 symbol size 1.000000
+@ s0 symbol fill 0
+@ s0 symbol color 1
+@ s0 symbol linewidth 1
+@ s0 symbol linestyle 1
+@ s0 symbol center false
+@ s0 symbol char 0
+@ s0 skip 0
+@ s0 linestyle 1
+@ s0 linewidth 1
+@ s0 color 1
+@ s0 fill 0
+@ s0 fill with color
+@ s0 fill color 1
+@ s0 fill pattern 0
+@ s0 errorbar type BOTH
+@ s0 errorbar length 1.000000
+@ s0 errorbar linewidth 1
+@ s0 errorbar linestyle 1
+@ s0 errorbar riser on
+@ s0 errorbar riser linewidth 1
+@ s0 errorbar riser linestyle 1
+@ s0 xyz 0.000000, 0.000000
+@ s0 comment "loilog.xmgr:1"
+@ s1 symbol 0
+@ s1 symbol size 1.000000
+@ s1 symbol fill 0
+@ s1 symbol color 6
+@ s1 symbol linewidth 1
+@ s1 symbol linestyle 1
+@ s1 symbol center false
+@ s1 symbol char 0
+@ s1 skip 0
+@ s1 linestyle 4
+@ s1 linewidth 2
+@ s1 color 6
+@ s1 fill 0
+@ s1 fill with color
+@ s1 fill color 1
+@ s1 fill pattern 0
+@ s1 errorbar type BOTH
+@ s1 errorbar length 1.000000
+@ s1 errorbar linewidth 1
+@ s1 errorbar linestyle 1
+@ s1 errorbar riser on
+@ s1 errorbar riser linewidth 1
+@ s1 errorbar riser linestyle 1
+@ s1 xyz 0.000000, 0.000000
+@ s1 comment "loilog.xmgr:2"
+@ s2 symbol 0
+@ s2 symbol size 1.000000
+@ s2 symbol fill 0
+@ s2 symbol color 4
+@ s2 symbol linewidth 1
+@ s2 symbol linestyle 1
+@ s2 symbol center false
+@ s2 symbol char 0
+@ s2 skip 0
+@ s2 linestyle 3
+@ s2 linewidth 1
+@ s2 color 4
+@ s2 fill 0
+@ s2 fill with color
+@ s2 fill color 1
+@ s2 fill pattern 0
+@ s2 errorbar type BOTH
+@ s2 errorbar length 1.000000
+@ s2 errorbar linewidth 1
+@ s2 errorbar linestyle 1
+@ s2 errorbar riser on
+@ s2 errorbar riser linewidth 1
+@ s2 errorbar riser linestyle 1
+@ s2 xyz 0.000000, 0.000000
+@ s2 comment "loilog.xmgr:3"
+@ s3 symbol 0
+@ s3 symbol size 1.000000
+@ s3 symbol fill 0
+@ s3 symbol color 2
+@ s3 symbol linewidth 1
+@ s3 symbol linestyle 1
+@ s3 symbol center false
+@ s3 symbol char 0
+@ s3 skip 0
+@ s3 linestyle 1
+@ s3 linewidth 2
+@ s3 color 2
+@ s3 fill 0
+@ s3 fill with color
+@ s3 fill color 1
+@ s3 fill pattern 0
+@ s3 errorbar type BOTH
+@ s3 errorbar length 1.000000
+@ s3 errorbar linewidth 1
+@ s3 errorbar linestyle 1
+@ s3 errorbar riser on
+@ s3 errorbar riser linewidth 1
+@ s3 errorbar riser linestyle 1
+@ s3 xyz 0.000000, 0.000000
+@ s3 comment "loilog.xmgr:4"
+@ s4 symbol 0
+@ s4 symbol size 1.000000
+@ s4 symbol fill 0
+@ s4 symbol color 8
+@ s4 symbol linewidth 1
+@ s4 symbol linestyle 1
+@ s4 symbol center false
+@ s4 symbol char 0
+@ s4 skip 0
+@ s4 linestyle 1
+@ s4 linewidth 1
+@ s4 color 8
+@ s4 fill 0
+@ s4 fill with color
+@ s4 fill color 1
+@ s4 fill pattern 0
+@ s4 errorbar type BOTH
+@ s4 errorbar length 1.000000
+@ s4 errorbar linewidth 1
+@ s4 errorbar linestyle 1
+@ s4 errorbar riser on
+@ s4 errorbar riser linewidth 1
+@ s4 errorbar riser linestyle 1
+@ s4 xyz 0.000000, 0.000000
+@ s4 comment "loilog.xmgr:5"
+@ xaxis tick on
+@ xaxis tick major 2
+@ xaxis tick minor 1
+@ xaxis tick offsetx 0.000000
+@ xaxis tick offsety 0.000000
+@ xaxis label "y+"
+@ xaxis label layout para
+@ xaxis label place auto
+@ xaxis label char size 1.000000
+@ xaxis label font 4
+@ xaxis label color 1
+@ xaxis label linewidth 1
+@ xaxis ticklabel on
+@ xaxis ticklabel type auto
+@ xaxis ticklabel prec 5
+@ xaxis ticklabel format general
+@ xaxis ticklabel append ""
+@ xaxis ticklabel prepend ""
+@ xaxis ticklabel layout horizontal
+@ xaxis ticklabel place on ticks
+@ xaxis ticklabel skip 0
+@ xaxis ticklabel stagger 0
+@ xaxis ticklabel op bottom
+@ xaxis ticklabel sign normal
+@ xaxis ticklabel start type auto
+@ xaxis ticklabel start 0.000000
+@ xaxis ticklabel stop type auto
+@ xaxis ticklabel stop 0.000000
+@ xaxis ticklabel char size 1.000000
+@ xaxis ticklabel font 4
+@ xaxis ticklabel color 1
+@ xaxis ticklabel linewidth 1
+@ xaxis tick major on
+@ xaxis tick minor on
+@ xaxis tick default 6
+@ xaxis tick in
+@ xaxis tick major color 1
+@ xaxis tick major linewidth 1
+@ xaxis tick major linestyle 1
+@ xaxis tick minor color 1
+@ xaxis tick minor linewidth 1
+@ xaxis tick minor linestyle 1
+@ xaxis tick log off
+@ xaxis tick size 1.000000
+@ xaxis tick minor size 0.500000
+@ xaxis bar off
+@ xaxis bar color 1
+@ xaxis bar linestyle 1
+@ xaxis bar linewidth 1
+@ xaxis tick major grid off
+@ xaxis tick minor grid off
+@ xaxis tick op both
+@ xaxis tick type auto
+@ xaxis tick spec 0
+@ yaxis tick on
+@ yaxis tick major 2
+@ yaxis tick minor 1
+@ yaxis tick offsetx 0.000000
+@ yaxis tick offsety 0.000000
+@ yaxis label "u+"
+@ yaxis label layout para
+@ yaxis label place auto
+@ yaxis label char size 1.000000
+@ yaxis label font 4
+@ yaxis label color 1
+@ yaxis label linewidth 1
+@ yaxis ticklabel on
+@ yaxis ticklabel type auto
+@ yaxis ticklabel prec 5
+@ yaxis ticklabel format general
+@ yaxis ticklabel append ""
+@ yaxis ticklabel prepend ""
+@ yaxis ticklabel layout horizontal
+@ yaxis ticklabel place on ticks
+@ yaxis ticklabel skip 0
+@ yaxis ticklabel stagger 0
+@ yaxis ticklabel op left
+@ yaxis ticklabel sign normal
+@ yaxis ticklabel start type auto
+@ yaxis ticklabel start 0.000000
+@ yaxis ticklabel stop type auto
+@ yaxis ticklabel stop 0.000000
+@ yaxis ticklabel char size 1.000000
+@ yaxis ticklabel font 4
+@ yaxis ticklabel color 1
+@ yaxis ticklabel linewidth 1
+@ yaxis tick major on
+@ yaxis tick minor on
+@ yaxis tick default 6
+@ yaxis tick in
+@ yaxis tick major color 1
+@ yaxis tick major linewidth 1
+@ yaxis tick major linestyle 1
+@ yaxis tick minor color 1
+@ yaxis tick minor linewidth 1
+@ yaxis tick minor linestyle 1
+@ yaxis tick log off
+@ yaxis tick size 1.000000
+@ yaxis tick minor size 0.500000
+@ yaxis bar off
+@ yaxis bar color 1
+@ yaxis bar linestyle 1
+@ yaxis bar linewidth 1
+@ yaxis tick major grid off
+@ yaxis tick minor grid off
+@ yaxis tick op both
+@ yaxis tick type auto
+@ yaxis tick spec 0
+@ zeroxaxis tick on
+@ zeroxaxis tick major 5
+@ zeroxaxis tick minor 2.5
+@ zeroxaxis tick offsetx 0.000000
+@ zeroxaxis tick offsety 0.000000
+@ zeroxaxis label ""
+@ zeroxaxis label layout para
+@ zeroxaxis label place auto
+@ zeroxaxis label char size 1.000000
+@ zeroxaxis label font 4
+@ zeroxaxis label color 1
+@ zeroxaxis label linewidth 1
+@ zeroxaxis ticklabel off
+@ zeroxaxis ticklabel type auto
+@ zeroxaxis ticklabel prec 5
+@ zeroxaxis ticklabel format general
+@ zeroxaxis ticklabel append ""
+@ zeroxaxis ticklabel prepend ""
+@ zeroxaxis ticklabel layout horizontal
+@ zeroxaxis ticklabel place on ticks
+@ zeroxaxis ticklabel skip 0
+@ zeroxaxis ticklabel stagger 0
+@ zeroxaxis ticklabel op bottom
+@ zeroxaxis ticklabel sign normal
+@ zeroxaxis ticklabel start type auto
+@ zeroxaxis ticklabel start 0.000000
+@ zeroxaxis ticklabel stop type auto
+@ zeroxaxis ticklabel stop 0.000000
+@ zeroxaxis ticklabel char size 1.000000
+@ zeroxaxis ticklabel font 4
+@ zeroxaxis ticklabel color 1
+@ zeroxaxis ticklabel linewidth 1
+@ zeroxaxis tick major off
+@ zeroxaxis tick minor on
+@ zeroxaxis tick default 6
+@ zeroxaxis tick in
+@ zeroxaxis tick major color 1
+@ zeroxaxis tick major linewidth 1
+@ zeroxaxis tick major linestyle 1
+@ zeroxaxis tick minor color 1
+@ zeroxaxis tick minor linewidth 1
+@ zeroxaxis tick minor linestyle 1
+@ zeroxaxis tick log off
+@ zeroxaxis tick size 1.000000
+@ zeroxaxis tick minor size 0.500000
+@ zeroxaxis bar off
+@ zeroxaxis bar color 1
+@ zeroxaxis bar linestyle 1
+@ zeroxaxis bar linewidth 1
+@ zeroxaxis tick major grid off
+@ zeroxaxis tick minor grid off
+@ zeroxaxis tick op both
+@ zeroxaxis tick type auto
+@ zeroxaxis tick spec 0
+@ zeroyaxis tick on
+@ zeroyaxis tick major 20
+@ zeroyaxis tick minor 10
+@ zeroyaxis tick offsetx 0.000000
+@ zeroyaxis tick offsety 0.000000
+@ zeroyaxis label ""
+@ zeroyaxis label layout para
+@ zeroyaxis label place auto
+@ zeroyaxis label char size 1.000000
+@ zeroyaxis label font 4
+@ zeroyaxis label color 1
+@ zeroyaxis label linewidth 1
+@ zeroyaxis ticklabel off
+@ zeroyaxis ticklabel type auto
+@ zeroyaxis ticklabel prec 5
+@ zeroyaxis ticklabel format general
+@ zeroyaxis ticklabel append ""
+@ zeroyaxis ticklabel prepend ""
+@ zeroyaxis ticklabel layout horizontal
+@ zeroyaxis ticklabel place on ticks
+@ zeroyaxis ticklabel skip 0
+@ zeroyaxis ticklabel stagger 0
+@ zeroyaxis ticklabel op left
+@ zeroyaxis ticklabel sign normal
+@ zeroyaxis ticklabel start type auto
+@ zeroyaxis ticklabel start 0.000000
+@ zeroyaxis ticklabel stop type auto
+@ zeroyaxis ticklabel stop 0.000000
+@ zeroyaxis ticklabel char size 1.000000
+@ zeroyaxis ticklabel font 4
+@ zeroyaxis ticklabel color 1
+@ zeroyaxis ticklabel linewidth 1
+@ zeroyaxis tick major off
+@ zeroyaxis tick minor on
+@ zeroyaxis tick default 6
+@ zeroyaxis tick in
+@ zeroyaxis tick major color 1
+@ zeroyaxis tick major linewidth 1
+@ zeroyaxis tick major linestyle 1
+@ zeroyaxis tick minor color 1
+@ zeroyaxis tick minor linewidth 1
+@ zeroyaxis tick minor linestyle 1
+@ zeroyaxis tick log off
+@ zeroyaxis tick size 1.000000
+@ zeroyaxis tick minor size 0.500000
+@ zeroyaxis bar off
+@ zeroyaxis bar color 1
+@ zeroyaxis bar linestyle 1
+@ zeroyaxis bar linewidth 1
+@ zeroyaxis tick major grid off
+@ zeroyaxis tick minor grid off
+@ zeroyaxis tick op both
+@ zeroyaxis tick type auto
+@ zeroyaxis tick spec 0
+@ legend on
+@ legend loctype view
+@ legend layout 0
+@ legend vgap 2
+@ legend hgap 1
+@ legend length 4
+@ legend box off
+@ legend box fill off
+@ legend box fill with color
+@ legend box fill color 0
+@ legend box fill pattern 1
+@ legend box color 1
+@ legend box linewidth 1
+@ legend box linestyle 1
+@ legend x1 0.197802
+@ legend y1 0.797364
+@ legend font 4
+@ legend char size 1.000000
+@ legend linestyle 1
+@ legend linewidth 1
+@ legend color 1
+@ legend string 0 "ln(y+)/0.42+5.2"
+@ legend string 1 "y+"
+@ legend string 2 "2ln(y+)/0.42+5.2"
+@ legend string 3 "2y+"
+@ legend string 4 "2/0.42"
+@ frame on
+@ frame type 0
+@ frame linestyle 1
+@ frame linewidth 1
+@ frame color 1
+@ frame fill off
+@ frame background color 0
+ at WITH G0
+ at G0 ON
+ at TARGET S0
+ at TYPE xy
+ 0.01 -5.76469
+ 0.02 -4.11434
+ 0.03 -3.14895
+ 0.04 -2.46399
+ 0.05 -1.9327
+ 0.06 -1.4986
+ 0.07 -1.13157
+ 0.08 -0.81364
+ 0.09 -0.533204
+ 0.1 -0.282345
+ 0.11 -0.0554164
+ 0.12 0.151754
+ 0.13 0.342331
+ 0.14 0.518779
+ 0.15 0.683048
+ 0.16 0.836711
+ 0.17 0.981055
+ 0.18 1.11715
+ 0.19 1.24588
+ 0.2 1.36801
+ 0.21 1.48417
+ 0.22 1.59493
+ 0.23 1.70077
+ 0.24 1.8021
+ 0.25 1.8993
+ 0.26 1.99268
+ 0.27 2.08254
+ 0.28 2.16913
+ 0.29 2.25268
+ 0.3 2.3334
+ 0.31 2.41147
+ 0.32 2.48706
+ 0.33 2.56033
+ 0.34 2.63141
+ 0.35 2.70042
+ 0.36 2.7675
+ 0.37 2.83273
+ 0.38 2.89623
+ 0.39 2.95807
+ 0.4 3.01836
+ 0.41 3.07715
+ 0.42 3.13452
+ 0.43 3.19055
+ 0.44 3.24528
+ 0.45 3.29879
+ 0.46 3.35112
+ 0.47 3.40233
+ 0.48 3.45245
+ 0.49 3.50155
+ 0.5 3.54965
+ 0.51 3.5968
+ 0.52 3.64303
+ 0.53 3.68839
+ 0.54 3.73289
+ 0.55 3.77658
+ 0.56 3.81948
+ 0.57 3.86162
+ 0.58 3.90303
+ 0.59 3.94373
+ 0.6 3.98375
+ 0.61 4.0231
+ 0.62 4.06182
+ 0.63 4.09992
+ 0.64 4.13741
+ 0.65 4.17433
+ 0.66 4.21068
+ 0.67 4.24648
+ 0.68 4.28176
+ 0.69 4.31652
+ 0.7 4.35077
+ 0.71 4.38455
+ 0.72 4.41785
+ 0.73 4.45069
+ 0.74 4.48308
+ 0.75 4.51504
+ 0.76 4.54658
+ 0.77 4.5777
+ 0.78 4.60843
+ 0.79 4.63876
+ 0.8 4.66871
+ 0.81 4.69828
+ 0.82 4.7275
+ 0.83 4.75636
+ 0.84 4.78487
+ 0.85 4.81305
+ 0.86 4.8409
+ 0.87 4.86842
+ 0.88 4.89563
+ 0.89 4.92254
+ 0.9 4.94914
+ 0.91 4.97545
+ 0.92 5.00147
+ 0.93 5.02721
+ 0.94 5.05268
+ 0.95 5.07787
+ 0.96 5.1028
+ 0.97 5.12748
+ 0.98 5.1519
+ 0.99 5.17607
+ 1 5.2
+ 1.01 5.22369
+ 1.02 5.24715
+ 1.03 5.27038
+ 1.04 5.29338
+ 1.05 5.31617
+ 1.06 5.33874
+ 1.07 5.36109
+ 1.08 5.38324
+ 1.09 5.40518
+ 1.1 5.42693
+ 1.11 5.44848
+ 1.12 5.46983
+ 1.13 5.49099
+ 1.14 5.51197
+ 1.15 5.53277
+ 1.16 5.55338
+ 1.17 5.57382
+ 1.18 5.59408
+ 1.19 5.61417
+ 1.2 5.6341
+ 1.21 5.65386
+ 1.22 5.67345
+ 1.23 5.69289
+ 1.24 5.71217
+ 1.25 5.73129
+ 1.26 5.75027
+ 1.27 5.76909
+ 1.28 5.78776
+ 1.29 5.80629
+ 1.3 5.82468
+ 1.31 5.84292
+ 1.32 5.86103
+ 1.33 5.879
+ 1.34 5.89683
+ 1.35 5.91453
+ 1.36 5.93211
+ 1.37 5.94955
+ 1.38 5.96687
+ 1.39 5.98406
+ 1.4 6.00112
+ 1.41 6.01807
+ 1.42 6.0349
+ 1.43 6.05161
+ 1.44 6.0682
+ 1.45 6.08468
+ 1.46 6.10104
+ 1.47 6.11729
+ 1.48 6.13343
+ 1.49 6.14947
+ 1.5 6.16539
+ 1.51 6.18121
+ 1.52 6.19693
+ 1.53 6.21254
+ 1.54 6.22805
+ 1.55 6.24346
+ 1.56 6.25878
+ 1.57 6.27399
+ 1.58 6.28911
+ 1.59 6.30413
+ 1.6 6.31906
+ 1.61 6.33389
+ 1.62 6.34863
+ 1.63 6.36329
+ 1.64 6.37785
+ 1.65 6.39232
+ 1.66 6.40671
+ 1.67 6.42101
+ 1.68 6.43522
+ 1.69 6.44935
+ 1.7 6.4634
+ 1.71 6.47737
+ 1.72 6.49125
+ 1.73 6.50505
+ 1.74 6.51877
+ 1.75 6.53242
+ 1.76 6.54599
+ 1.77 6.55948
+ 1.78 6.57289
+ 1.79 6.58623
+ 1.8 6.59949
+ 1.81 6.61268
+ 1.82 6.6258
+ 1.83 6.63885
+ 1.84 6.65182
+ 1.85 6.66473
+ 1.86 6.67756
+ 1.87 6.69033
+ 1.88 6.70303
+ 1.89 6.71566
+ 1.9 6.72822
+ 1.91 6.74072
+ 1.92 6.75316
+ 1.93 6.76552
+ 1.94 6.77783
+ 1.95 6.79007
+ 1.96 6.80225
+ 1.97 6.81437
+ 1.98 6.82642
+ 1.99 6.83842
+ 2 6.85035
+ 2.01 6.86223
+ 2.02 6.87404
+ 2.03 6.8858
+ 2.04 6.8975
+ 2.05 6.90914
+ 2.06 6.92073
+ 2.07 6.93226
+ 2.08 6.94373
+ 2.09 6.95515
+ 2.1 6.96652
+ 2.11 6.97783
+ 2.12 6.98909
+ 2.13 7.00029
+ 2.14 7.01144
+ 2.15 7.02254
+ 2.16 7.03359
+ 2.17 7.04459
+ 2.18 7.05554
+ 2.19 7.06643
+ 2.2 7.07728
+ 2.21 7.08808
+ 2.22 7.09883
+ 2.23 7.10953
+ 2.24 7.12018
+ 2.25 7.13079
+ 2.26 7.14134
+ 2.27 7.15186
+ 2.28 7.16232
+ 2.29 7.17274
+ 2.3 7.18312
+ 2.31 7.19345
+ 2.32 7.20373
+ 2.33 7.21397
+ 2.34 7.22417
+ 2.35 7.23432
+ 2.36 7.24443
+ 2.37 7.2545
+ 2.38 7.26452
+ 2.39 7.27451
+ 2.4 7.28445
+ 2.41 7.29435
+ 2.42 7.30421
+ 2.43 7.31403
+ 2.44 7.3238
+ 2.45 7.33354
+ 2.46 7.34324
+ 2.47 7.3529
+ 2.48 7.36252
+ 2.49 7.3721
+ 2.5 7.38164
+ 2.51 7.39115
+ 2.52 7.40062
+ 2.53 7.41005
+ 2.54 7.41944
+ 2.55 7.42879
+ 2.56 7.43811
+ 2.57 7.44739
+ 2.58 7.45664
+ 2.59 7.46585
+ 2.6 7.47503
+ 2.61 7.48417
+ 2.62 7.49327
+ 2.63 7.50234
+ 2.64 7.51138
+ 2.65 7.52038
+ 2.66 7.52935
+ 2.67 7.53828
+ 2.68 7.54718
+ 2.69 7.55605
+ 2.7 7.56489
+ 2.71 7.57369
+ 2.72 7.58246
+ 2.73 7.59119
+ 2.74 7.5999
+ 2.75 7.60857
+ 2.76 7.61722
+ 2.77 7.62583
+ 2.78 7.63441
+ 2.79 7.64296
+ 2.8 7.65147
+ 2.81 7.65996
+ 2.82 7.66842
+ 2.83 7.67685
+ 2.84 7.68525
+ 2.85 7.69362
+ 2.86 7.70196
+ 2.87 7.71027
+ 2.88 7.71855
+ 2.89 7.7268
+ 2.9 7.73503
+ 2.91 7.74322
+ 2.92 7.75139
+ 2.93 7.75953
+ 2.94 7.76764
+ 2.95 7.77573
+ 2.96 7.78378
+ 2.97 7.79181
+ 2.98 7.79982
+ 2.99 7.80779
+ 3 7.81574
+ 3.01 7.82367
+ 3.02 7.83156
+ 3.03 7.83943
+ 3.04 7.84728
+ 3.05 7.8551
+ 3.06 7.86289
+ 3.07 7.87066
+ 3.08 7.8784
+ 3.09 7.88612
+ 3.1 7.89381
+ 3.11 7.90148
+ 3.12 7.90913
+ 3.13 7.91675
+ 3.14 7.92434
+ 3.15 7.93191
+ 3.16 7.93946
+ 3.17 7.94698
+ 3.18 7.95448
+ 3.19 7.96195
+ 3.2 7.96941
+ 3.21 7.97684
+ 3.22 7.98424
+ 3.23 7.99162
+ 3.24 7.99898
+ 3.25 8.00632
+ 3.26 8.01364
+ 3.27 8.02093
+ 3.28 8.0282
+ 3.29 8.03545
+ 3.3 8.04267
+ 3.31 8.04988
+ 3.32 8.05706
+ 3.33 8.06422
+ 3.34 8.07136
+ 3.35 8.07848
+ 3.36 8.08557
+ 3.37 8.09265
+ 3.38 8.0997
+ 3.39 8.10674
+ 3.4 8.11375
+ 3.41 8.12074
+ 3.42 8.12772
+ 3.43 8.13467
+ 3.44 8.1416
+ 3.45 8.14851
+ 3.46 8.1554
+ 3.47 8.16227
+ 3.48 8.16912
+ 3.49 8.17596
+ 3.5 8.18277
+ 3.51 8.18956
+ 3.52 8.19634
+ 3.53 8.20309
+ 3.54 8.20983
+ 3.55 8.21654
+ 3.56 8.22324
+ 3.57 8.22992
+ 3.58 8.23658
+ 3.59 8.24322
+ 3.6 8.24984
+ 3.61 8.25645
+ 3.62 8.26303
+ 3.63 8.2696
+ 3.64 8.27615
+ 3.65 8.28268
+ 3.66 8.2892
+ 3.67 8.29569
+ 3.68 8.30217
+ 3.69 8.30863
+ 3.7 8.31508
+ 3.71 8.3215
+ 3.72 8.32791
+ 3.73 8.33431
+ 3.74 8.34068
+ 3.75 8.34704
+ 3.76 8.35338
+ 3.77 8.3597
+ 3.78 8.36601
+ 3.79 8.3723
+ 3.8 8.37857
+ 3.81 8.38483
+ 3.82 8.39107
+ 3.83 8.3973
+ 3.84 8.40351
+ 3.85 8.4097
+ 3.86 8.41587
+ 3.87 8.42203
+ 3.88 8.42818
+ 3.89 8.43431
+ 3.9 8.44042
+ 3.91 8.44652
+ 3.92 8.4526
+ 3.93 8.45867
+ 3.94 8.46472
+ 3.95 8.47075
+ 3.96 8.47677
+ 3.97 8.48278
+ 3.98 8.48877
+ 3.99 8.49474
+ 4 8.5007
+ 4.01 8.50665
+ 4.02 8.51258
+ 4.03 8.51849
+ 4.04 8.52439
+ 4.05 8.53028
+ 4.06 8.53615
+ 4.07 8.54201
+ 4.08 8.54785
+ 4.09 8.55368
+ 4.1 8.55949
+ 4.11 8.56529
+ 4.12 8.57108
+ 4.13 8.57685
+ 4.14 8.58261
+ 4.15 8.58835
+ 4.16 8.59408
+ 4.17 8.5998
+ 4.18 8.6055
+ 4.19 8.61119
+ 4.2 8.61687
+ 4.21 8.62253
+ 4.22 8.62818
+ 4.23 8.63381
+ 4.24 8.63944
+ 4.25 8.64505
+ 4.26 8.65064
+ 4.27 8.65622
+ 4.28 8.66179
+ 4.29 8.66735
+ 4.3 8.67289
+ 4.31 8.67842
+ 4.32 8.68394
+ 4.33 8.68945
+ 4.34 8.69494
+ 4.35 8.70042
+ 4.36 8.70589
+ 4.37 8.71134
+ 4.38 8.71678
+ 4.39 8.72221
+ 4.4 8.72763
+ 4.41 8.73303
+ 4.42 8.73843
+ 4.43 8.74381
+ 4.44 8.74918
+ 4.45 8.75453
+ 4.46 8.75988
+ 4.47 8.76521
+ 4.48 8.77053
+ 4.49 8.77584
+ 4.5 8.78114
+ 4.51 8.78642
+ 4.52 8.7917
+ 4.53 8.79696
+ 4.54 8.80221
+ 4.55 8.80745
+ 4.56 8.81267
+ 4.57 8.81789
+ 4.58 8.82309
+ 4.59 8.82829
+ 4.6 8.83347
+ 4.61 8.83864
+ 4.62 8.8438
+ 4.63 8.84894
+ 4.64 8.85408
+ 4.65 8.85921
+ 4.66 8.86432
+ 4.67 8.86943
+ 4.68 8.87452
+ 4.69 8.8796
+ 4.7 8.88467
+ 4.71 8.88973
+ 4.72 8.89478
+ 4.73 8.89982
+ 4.74 8.90485
+ 4.75 8.90987
+ 4.76 8.91488
+ 4.77 8.91987
+ 4.78 8.92486
+ 4.79 8.92983
+ 4.8 8.9348
+ 4.81 8.93975
+ 4.82 8.9447
+ 4.83 8.94963
+ 4.84 8.95456
+ 4.85 8.95947
+ 4.86 8.96438
+ 4.87 8.96927
+ 4.88 8.97416
+ 4.89 8.97903
+ 4.9 8.98389
+ 4.91 8.98875
+ 4.92 8.99359
+ 4.93 8.99843
+ 4.94 9.00325
+ 4.95 9.00807
+ 4.96 9.01287
+ 4.97 9.01767
+ 4.98 9.02245
+ 4.99 9.02723
+ 5 9.03199
+ 5.01 9.03675
+ 5.02 9.0415
+ 5.03 9.04624
+ 5.04 9.05097
+ 5.05 9.05569
+ 5.06 9.0604
+ 5.07 9.0651
+ 5.08 9.06979
+ 5.09 9.07447
+ 5.1 9.07914
+ 5.11 9.08381
+ 5.12 9.08846
+ 5.13 9.09311
+ 5.14 9.09775
+ 5.15 9.10237
+ 5.16 9.10699
+ 5.17 9.1116
+ 5.18 9.1162
+ 5.19 9.12079
+ 5.2 9.12538
+ 5.21 9.12995
+ 5.22 9.13452
+ 5.23 9.13907
+ 5.24 9.14362
+ 5.25 9.14816
+ 5.26 9.15269
+ 5.27 9.15722
+ 5.28 9.16173
+ 5.29 9.16623
+ 5.3 9.17073
+ 5.31 9.17522
+ 5.32 9.1797
+ 5.33 9.18417
+ 5.34 9.18863
+ 5.35 9.19309
+ 5.36 9.19753
+ 5.37 9.20197
+ 5.38 9.2064
+ 5.39 9.21082
+ 5.4 9.21524
+ 5.41 9.21964
+ 5.42 9.22404
+ 5.43 9.22843
+ 5.44 9.23281
+ 5.45 9.23718
+ 5.46 9.24154
+ 5.47 9.2459
+ 5.48 9.25025
+ 5.49 9.25459
+ 5.5 9.25892
+ 5.51 9.26325
+ 5.52 9.26757
+ 5.53 9.27188
+ 5.54 9.27618
+ 5.55 9.28047
+ 5.56 9.28476
+ 5.57 9.28904
+ 5.58 9.29331
+ 5.59 9.29757
+ 5.6 9.30183
+ 5.61 9.30607
+ 5.62 9.31031
+ 5.63 9.31455
+ 5.64 9.31877
+ 5.65 9.32299
+ 5.66 9.3272
+ 5.67 9.3314
+ 5.68 9.3356
+ 5.69 9.33979
+ 5.7 9.34397
+ 5.71 9.34814
+ 5.72 9.35231
+ 5.73 9.35647
+ 5.74 9.36062
+ 5.75 9.36476
+ 5.76 9.3689
+ 5.77 9.37303
+ 5.78 9.37715
+ 5.79 9.38127
+ 5.8 9.38538
+ 5.81 9.38948
+ 5.82 9.39357
+ 5.83 9.39766
+ 5.84 9.40174
+ 5.85 9.40581
+ 5.86 9.40988
+ 5.87 9.41394
+ 5.88 9.41799
+ 5.89 9.42204
+ 5.9 9.42608
+ 5.91 9.43011
+ 5.92 9.43413
+ 5.93 9.43815
+ 5.94 9.44216
+ 5.95 9.44617
+ 5.96 9.45017
+ 5.97 9.45416
+ 5.98 9.45814
+ 5.99 9.46212
+ 6 9.46609
+ 6.01 9.47006
+ 6.02 9.47402
+ 6.03 9.47797
+ 6.04 9.48191
+ 6.05 9.48585
+ 6.06 9.48979
+ 6.07 9.49371
+ 6.08 9.49763
+ 6.09 9.50154
+ 6.1 9.50545
+ 6.11 9.50935
+ 6.12 9.51324
+ 6.13 9.51713
+ 6.14 9.52101
+ 6.15 9.52489
+ 6.16 9.52875
+ 6.17 9.53262
+ 6.18 9.53647
+ 6.19 9.54032
+ 6.2 9.54416
+ 6.21 9.548
+ 6.22 9.55183
+ 6.23 9.55566
+ 6.24 9.55948
+ 6.25 9.56329
+ 6.26 9.5671
+ 6.27 9.5709
+ 6.28 9.57469
+ 6.29 9.57848
+ 6.3 9.58226
+ 6.31 9.58604
+ 6.32 9.58981
+ 6.33 9.59357
+ 6.34 9.59733
+ 6.35 9.60108
+ 6.36 9.60483
+ 6.37 9.60857
+ 6.38 9.6123
+ 6.39 9.61603
+ 6.4 9.61976
+ 6.41 9.62347
+ 6.42 9.62719
+ 6.43 9.63089
+ 6.44 9.63459
+ 6.45 9.63829
+ 6.46 9.64197
+ 6.47 9.64566
+ 6.48 9.64933
+ 6.49 9.65301
+ 6.5 9.65667
+ 6.51 9.66033
+ 6.52 9.66399
+ 6.53 9.66764
+ 6.54 9.67128
+ 6.55 9.67492
+ 6.56 9.67855
+ 6.57 9.68218
+ 6.58 9.6858
+ 6.59 9.68941
+ 6.6 9.69302
+ 6.61 9.69663
+ 6.62 9.70023
+ 6.63 9.70382
+ 6.64 9.70741
+ 6.65 9.71099
+ 6.66 9.71457
+ 6.67 9.71814
+ 6.68 9.72171
+ 6.69 9.72527
+ 6.7 9.72883
+ 6.71 9.73238
+ 6.72 9.73592
+ 6.73 9.73946
+ 6.74 9.743
+ 6.75 9.74653
+ 6.76 9.75005
+ 6.77 9.75357
+ 6.78 9.75709
+ 6.79 9.7606
+ 6.8 9.7641
+ 6.81 9.7676
+ 6.82 9.77109
+ 6.83 9.77458
+ 6.84 9.77807
+ 6.85 9.78154
+ 6.86 9.78502
+ 6.87 9.78849
+ 6.88 9.79195
+ 6.89 9.79541
+ 6.9 9.79886
+ 6.91 9.80231
+ 6.92 9.80575
+ 6.93 9.80919
+ 6.94 9.81262
+ 6.95 9.81605
+ 6.96 9.81947
+ 6.97 9.82289
+ 6.98 9.82631
+ 6.99 9.82972
+ 7 9.83312
+ 7.01 9.83652
+ 7.02 9.83991
+ 7.03 9.8433
+ 7.04 9.84669
+ 7.05 9.85007
+ 7.06 9.85344
+ 7.07 9.85681
+ 7.08 9.86018
+ 7.09 9.86354
+ 7.1 9.86689
+ 7.11 9.87024
+ 7.12 9.87359
+ 7.13 9.87693
+ 7.14 9.88027
+ 7.15 9.8836
+ 7.16 9.88693
+ 7.17 9.89025
+ 7.18 9.89357
+ 7.19 9.89688
+ 7.2 9.90019
+ 7.21 9.9035
+ 7.22 9.9068
+ 7.23 9.91009
+ 7.24 9.91338
+ 7.25 9.91667
+ 7.26 9.91995
+ 7.27 9.92323
+ 7.28 9.9265
+ 7.29 9.92977
+ 7.3 9.93303
+ 7.31 9.93629
+ 7.32 9.93955
+ 7.33 9.9428
+ 7.34 9.94604
+ 7.35 9.94929
+ 7.36 9.95252
+ 7.37 9.95576
+ 7.38 9.95898
+ 7.39 9.96221
+ 7.4 9.96543
+ 7.41 9.96864
+ 7.42 9.97185
+ 7.43 9.97506
+ 7.44 9.97826
+ 7.45 9.98146
+ 7.46 9.98466
+ 7.47 9.98785
+ 7.48 9.99103
+ 7.49 9.99421
+ 7.5 9.99739
+ 7.51 10.0006
+ 7.52 10.0037
+ 7.53 10.0069
+ 7.54 10.0101
+ 7.55 10.0132
+ 7.56 10.0164
+ 7.57 10.0195
+ 7.58 10.0227
+ 7.59 10.0258
+ 7.6 10.0289
+ 7.61 10.0321
+ 7.62 10.0352
+ 7.63 10.0383
+ 7.64 10.0414
+ 7.65 10.0445
+ 7.66 10.0476
+ 7.67 10.0508
+ 7.68 10.0539
+ 7.69 10.057
+ 7.7 10.06
+ 7.71 10.0631
+ 7.72 10.0662
+ 7.73 10.0693
+ 7.74 10.0724
+ 7.75 10.0755
+ 7.76 10.0785
+ 7.77 10.0816
+ 7.78 10.0847
+ 7.79 10.0877
+ 7.8 10.0908
+ 7.81 10.0938
+ 7.82 10.0969
+ 7.83 10.0999
+ 7.84 10.1029
+ 7.85 10.106
+ 7.86 10.109
+ 7.87 10.112
+ 7.88 10.1151
+ 7.89 10.1181
+ 7.9 10.1211
+ 7.91 10.1241
+ 7.92 10.1271
+ 7.93 10.1301
+ 7.94 10.1331
+ 7.95 10.1361
+ 7.96 10.1391
+ 7.97 10.1421
+ 7.98 10.1451
+ 7.99 10.1481
+ 8 10.1511
+ 8.01 10.154
+ 8.02 10.157
+ 8.03 10.16
+ 8.04 10.1629
+ 8.05 10.1659
+ 8.06 10.1688
+ 8.07 10.1718
+ 8.08 10.1747
+ 8.09 10.1777
+ 8.1 10.1806
+ 8.11 10.1836
+ 8.12 10.1865
+ 8.13 10.1894
+ 8.14 10.1924
+ 8.15 10.1953
+ 8.16 10.1982
+ 8.17 10.2011
+ 8.18 10.204
+ 8.19 10.2069
+ 8.2 10.2098
+ 8.21 10.2127
+ 8.22 10.2156
+ 8.23 10.2185
+ 8.24 10.2214
+ 8.25 10.2243
+ 8.26 10.2272
+ 8.27 10.2301
+ 8.28 10.233
+ 8.29 10.2358
+ 8.3 10.2387
+ 8.31 10.2416
+ 8.32 10.2444
+ 8.33 10.2473
+ 8.34 10.2502
+ 8.35 10.253
+ 8.36 10.2559
+ 8.37 10.2587
+ 8.38 10.2615
+ 8.39 10.2644
+ 8.4 10.2672
+ 8.41 10.2701
+ 8.42 10.2729
+ 8.43 10.2757
+ 8.44 10.2785
+ 8.45 10.2813
+ 8.46 10.2842
+ 8.47 10.287
+ 8.48 10.2898
+ 8.49 10.2926
+ 8.5 10.2954
+ 8.51 10.2982
+ 8.52 10.301
+ 8.53 10.3038
+ 8.54 10.3066
+ 8.55 10.3094
+ 8.56 10.3121
+ 8.57 10.3149
+ 8.58 10.3177
+ 8.59 10.3205
+ 8.6 10.3232
+ 8.61 10.326
+ 8.62 10.3288
+ 8.63 10.3315
+ 8.64 10.3343
+ 8.65 10.337
+ 8.66 10.3398
+ 8.67 10.3425
+ 8.68 10.3453
+ 8.69 10.348
+ 8.7 10.3508
+ 8.71 10.3535
+ 8.72 10.3562
+ 8.73 10.359
+ 8.74 10.3617
+ 8.75 10.3644
+ 8.76 10.3671
+ 8.77 10.3698
+ 8.78 10.3726
+ 8.79 10.3753
+ 8.8 10.378
+ 8.81 10.3807
+ 8.82 10.3834
+ 8.83 10.3861
+ 8.84 10.3888
+ 8.85 10.3915
+ 8.86 10.3942
+ 8.87 10.3968
+ 8.88 10.3995
+ 8.89 10.4022
+ 8.9 10.4049
+ 8.91 10.4076
+ 8.92 10.4102
+ 8.93 10.4129
+ 8.94 10.4156
+ 8.95 10.4182
+ 8.96 10.4209
+ 8.97 10.4235
+ 8.98 10.4262
+ 8.99 10.4288
+ 9 10.4315
+ 9.01 10.4341
+ 9.02 10.4368
+ 9.03 10.4394
+ 9.04 10.442
+ 9.05 10.4447
+ 9.06 10.4473
+ 9.07 10.4499
+ 9.08 10.4526
+ 9.09 10.4552
+ 9.1 10.4578
+ 9.11 10.4604
+ 9.12 10.463
+ 9.13 10.4656
+ 9.14 10.4682
+ 9.15 10.4708
+ 9.16 10.4734
+ 9.17 10.476
+ 9.18 10.4786
+ 9.19 10.4812
+ 9.2 10.4838
+ 9.21 10.4864
+ 9.22 10.489
+ 9.23 10.4916
+ 9.24 10.4941
+ 9.25 10.4967
+ 9.26 10.4993
+ 9.27 10.5019
+ 9.28 10.5044
+ 9.29 10.507
+ 9.3 10.5096
+ 9.31 10.5121
+ 9.32 10.5147
+ 9.33 10.5172
+ 9.34 10.5198
+ 9.35 10.5223
+ 9.36 10.5249
+ 9.37 10.5274
+ 9.38 10.53
+ 9.39 10.5325
+ 9.4 10.535
+ 9.41 10.5376
+ 9.42 10.5401
+ 9.43 10.5426
+ 9.44 10.5451
+ 9.45 10.5477
+ 9.46 10.5502
+ 9.47 10.5527
+ 9.48 10.5552
+ 9.49 10.5577
+ 9.5 10.5602
+ 9.51 10.5627
+ 9.52 10.5652
+ 9.53 10.5677
+ 9.54 10.5702
+ 9.55 10.5727
+ 9.56 10.5752
+ 9.57 10.5777
+ 9.58 10.5802
+ 9.59 10.5827
+ 9.6 10.5852
+ 9.61 10.5876
+ 9.62 10.5901
+ 9.63 10.5926
+ 9.64 10.5951
+ 9.65 10.5975
+ 9.66 10.6
+ 9.67 10.6024
+ 9.68 10.6049
+ 9.69 10.6074
+ 9.7 10.6098
+ 9.71 10.6123
+ 9.72 10.6147
+ 9.73 10.6172
+ 9.74 10.6196
+ 9.75 10.6221
+ 9.76 10.6245
+ 9.77 10.6269
+ 9.78 10.6294
+ 9.79 10.6318
+ 9.8 10.6342
+ 9.81 10.6367
+ 9.82 10.6391
+ 9.83 10.6415
+ 9.84 10.6439
+ 9.85 10.6464
+ 9.86 10.6488
+ 9.87 10.6512
+ 9.88 10.6536
+ 9.89 10.656
+ 9.9 10.6584
+ 9.91 10.6608
+ 9.92 10.6632
+ 9.93 10.6656
+ 9.94 10.668
+ 9.95 10.6704
+ 9.96 10.6728
+ 9.97 10.6752
+ 9.98 10.6776
+ 9.99 10.68
+ 10 10.6823
+ 10.01 10.6847
+ 10.02 10.6871
+ 10.03 10.6895
+ 10.04 10.6919
+ 10.05 10.6942
+ 10.06 10.6966
+ 10.07 10.699
+ 10.08 10.7013
+ 10.09 10.7037
+ 10.1 10.706
+ 10.11 10.7084
+ 10.12 10.7107
+ 10.13 10.7131
+ 10.14 10.7154
+ 10.15 10.7178
+ 10.16 10.7201
+ 10.17 10.7225
+ 10.18 10.7248
+ 10.19 10.7272
+ 10.2 10.7295
+ 10.21 10.7318
+ 10.22 10.7342
+ 10.23 10.7365
+ 10.24 10.7388
+ 10.25 10.7411
+ 10.26 10.7435
+ 10.27 10.7458
+ 10.28 10.7481
+ 10.29 10.7504
+ 10.3 10.7527
+ 10.31 10.755
+ 10.32 10.7573
+ 10.33 10.7596
+ 10.34 10.762
+ 10.35 10.7643
+ 10.36 10.7666
+ 10.37 10.7689
+ 10.38 10.7711
+ 10.39 10.7734
+ 10.4 10.7757
+ 10.41 10.778
+ 10.42 10.7803
+ 10.43 10.7826
+ 10.44 10.7849
+ 10.45 10.7871
+ 10.46 10.7894
+ 10.47 10.7917
+ 10.48 10.794
+ 10.49 10.7962
+ 10.5 10.7985
+ 10.51 10.8008
+ 10.52 10.803
+ 10.53 10.8053
+ 10.54 10.8076
+ 10.55 10.8098
+ 10.56 10.8121
+ 10.57 10.8143
+ 10.58 10.8166
+ 10.59 10.8188
+ 10.6 10.8211
+ 10.61 10.8233
+ 10.62 10.8256
+ 10.63 10.8278
+ 10.64 10.83
+ 10.65 10.8323
+ 10.66 10.8345
+ 10.67 10.8368
+ 10.68 10.839
+ 10.69 10.8412
+ 10.7 10.8434
+ 10.71 10.8457
+ 10.72 10.8479
+ 10.73 10.8501
+ 10.74 10.8523
+ 10.75 10.8545
+ 10.76 10.8568
+ 10.77 10.859
+ 10.78 10.8612
+ 10.79 10.8634
+ 10.8 10.8656
+ 10.81 10.8678
+ 10.82 10.87
+ 10.83 10.8722
+ 10.84 10.8744
+ 10.85 10.8766
+ 10.86 10.8788
+ 10.87 10.881
+ 10.88 10.8832
+ 10.89 10.8853
+ 10.9 10.8875
+ 10.91 10.8897
+ 10.92 10.8919
+ 10.93 10.8941
+ 10.94 10.8963
+ 10.95 10.8984
+ 10.96 10.9006
+ 10.97 10.9028
+ 10.98 10.9049
+ 10.99 10.9071
+ 11 10.9093
+ 11.01 10.9114
+ 11.02 10.9136
+ 11.03 10.9158
+ 11.04 10.9179
+ 11.05 10.9201
+ 11.06 10.9222
+ 11.07 10.9244
+ 11.08 10.9265
+ 11.09 10.9287
+ 11.1 10.9308
+ 11.11 10.933
+ 11.12 10.9351
+ 11.13 10.9372
+ 11.14 10.9394
+ 11.15 10.9415
+ 11.16 10.9437
+ 11.17 10.9458
+ 11.18 10.9479
+ 11.19 10.95
+ 11.2 10.9522
+ 11.21 10.9543
+ 11.22 10.9564
+ 11.23 10.9585
+ 11.24 10.9607
+ 11.25 10.9628
+ 11.26 10.9649
+ 11.27 10.967
+ 11.28 10.9691
+ 11.29 10.9712
+ 11.3 10.9733
+ 11.31 10.9754
+ 11.32 10.9776
+ 11.33 10.9797
+ 11.34 10.9818
+ 11.35 10.9839
+ 11.36 10.9859
+ 11.37 10.988
+ 11.38 10.9901
+ 11.39 10.9922
+ 11.4 10.9943
+ 11.41 10.9964
+ 11.42 10.9985
+ 11.43 11.0006
+ 11.44 11.0027
+ 11.45 11.0047
+ 11.46 11.0068
+ 11.47 11.0089
+ 11.48 11.011
+ 11.49 11.013
+ 11.5 11.0151
+ 11.51 11.0172
+ 11.52 11.0192
+ 11.53 11.0213
+ 11.54 11.0234
+ 11.55 11.0254
+ 11.56 11.0275
+ 11.57 11.0296
+ 11.58 11.0316
+ 11.59 11.0337
+ 11.6 11.0357
+ 11.61 11.0378
+ 11.62 11.0398
+ 11.63 11.0419
+ 11.64 11.0439
+ 11.65 11.046
+ 11.66 11.048
+ 11.67 11.0501
+ 11.68 11.0521
+ 11.69 11.0541
+ 11.7 11.0562
+ 11.71 11.0582
+ 11.72 11.0602
+ 11.73 11.0623
+ 11.74 11.0643
+ 11.75 11.0663
+ 11.76 11.0683
+ 11.77 11.0704
+ 11.78 11.0724
+ 11.79 11.0744
+ 11.8 11.0764
+ 11.81 11.0784
+ 11.82 11.0805
+ 11.83 11.0825
+ 11.84 11.0845
+ 11.85 11.0865
+ 11.86 11.0885
+ 11.87 11.0905
+ 11.88 11.0925
+ 11.89 11.0945
+ 11.9 11.0965
+ 11.91 11.0985
+ 11.92 11.1005
+ 11.93 11.1025
+ 11.94 11.1045
+ 11.95 11.1065
+ 11.96 11.1085
+ 11.97 11.1105
+ 11.98 11.1125
+ 11.99 11.1145
+ 12 11.1164
+ 12.01 11.1184
+ 12.02 11.1204
+ 12.03 11.1224
+ 12.04 11.1244
+ 12.05 11.1263
+ 12.06 11.1283
+ 12.07 11.1303
+ 12.08 11.1323
+ 12.09 11.1342
+ 12.1 11.1362
+ 12.11 11.1382
+ 12.12 11.1401
+ 12.13 11.1421
+ 12.14 11.1441
+ 12.15 11.146
+ 12.16 11.148
+ 12.17 11.1499
+ 12.18 11.1519
+ 12.19 11.1538
+ 12.2 11.1558
+ 12.21 11.1578
+ 12.22 11.1597
+ 12.23 11.1616
+ 12.24 11.1636
+ 12.25 11.1655
+ 12.26 11.1675
+ 12.27 11.1694
+ 12.28 11.1714
+ 12.29 11.1733
+ 12.3 11.1752
+ 12.31 11.1772
+ 12.32 11.1791
+ 12.33 11.181
+ 12.34 11.183
+ 12.35 11.1849
+ 12.36 11.1868
+ 12.37 11.1887
+ 12.38 11.1907
+ 12.39 11.1926
+ 12.4 11.1945
+ 12.41 11.1964
+ 12.42 11.1984
+ 12.43 11.2003
+ 12.44 11.2022
+ 12.45 11.2041
+ 12.46 11.206
+ 12.47 11.2079
+ 12.48 11.2098
+ 12.49 11.2117
+ 12.5 11.2136
+ 12.51 11.2155
+ 12.52 11.2174
+ 12.53 11.2193
+ 12.54 11.2212
+ 12.55 11.2231
+ 12.56 11.225
+ 12.57 11.2269
+ 12.58 11.2288
+ 12.59 11.2307
+ 12.6 11.2326
+ 12.61 11.2345
+ 12.62 11.2364
+ 12.63 11.2383
+ 12.64 11.2402
+ 12.65 11.242
+ 12.66 11.2439
+ 12.67 11.2458
+ 12.68 11.2477
+ 12.69 11.2496
+ 12.7 11.2514
+ 12.71 11.2533
+ 12.72 11.2552
+ 12.73 11.2571
+ 12.74 11.2589
+ 12.75 11.2608
+ 12.76 11.2627
+ 12.77 11.2645
+ 12.78 11.2664
+ 12.79 11.2682
+ 12.8 11.2701
+ 12.81 11.272
+ 12.82 11.2738
+ 12.83 11.2757
+ 12.84 11.2775
+ 12.85 11.2794
+ 12.86 11.2812
+ 12.87 11.2831
+ 12.88 11.2849
+ 12.89 11.2868
+ 12.9 11.2886
+ 12.91 11.2905
+ 12.92 11.2923
+ 12.93 11.2942
+ 12.94 11.296
+ 12.95 11.2978
+ 12.96 11.2997
+ 12.97 11.3015
+ 12.98 11.3034
+ 12.99 11.3052
+ 13 11.307
+ 13.01 11.3089
+ 13.02 11.3107
+ 13.03 11.3125
+ 13.04 11.3143
+ 13.05 11.3162
+ 13.06 11.318
+ 13.07 11.3198
+ 13.08 11.3216
+ 13.09 11.3234
+ 13.1 11.3253
+ 13.11 11.3271
+ 13.12 11.3289
+ 13.13 11.3307
+ 13.14 11.3325
+ 13.15 11.3343
+ 13.16 11.3361
+ 13.17 11.338
+ 13.18 11.3398
+ 13.19 11.3416
+ 13.2 11.3434
+ 13.21 11.3452
+ 13.22 11.347
+ 13.23 11.3488
+ 13.24 11.3506
+ 13.25 11.3524
+ 13.26 11.3542
+ 13.27 11.356
+ 13.28 11.3578
+ 13.29 11.3596
+ 13.3 11.3613
+ 13.31 11.3631
+ 13.32 11.3649
+ 13.33 11.3667
+ 13.34 11.3685
+ 13.35 11.3703
+ 13.36 11.3721
+ 13.37 11.3738
+ 13.38 11.3756
+ 13.39 11.3774
+ 13.4 11.3792
+ 13.41 11.381
+ 13.42 11.3827
+ 13.43 11.3845
+ 13.44 11.3863
+ 13.45 11.388
+ 13.46 11.3898
+ 13.47 11.3916
+ 13.48 11.3934
+ 13.49 11.3951
+ 13.5 11.3969
+ 13.51 11.3986
+ 13.52 11.4004
+ 13.53 11.4022
+ 13.54 11.4039
+ 13.55 11.4057
+ 13.56 11.4074
+ 13.57 11.4092
+ 13.58 11.4109
+ 13.59 11.4127
+ 13.6 11.4145
+ 13.61 11.4162
+ 13.62 11.418
+ 13.63 11.4197
+ 13.64 11.4214
+ 13.65 11.4232
+ 13.66 11.4249
+ 13.67 11.4267
+ 13.68 11.4284
+ 13.69 11.4302
+ 13.7 11.4319
+ 13.71 11.4336
+ 13.72 11.4354
+ 13.73 11.4371
+ 13.74 11.4388
+ 13.75 11.4406
+ 13.76 11.4423
+ 13.77 11.444
+ 13.78 11.4458
+ 13.79 11.4475
+ 13.8 11.4492
+ 13.81 11.4509
+ 13.82 11.4527
+ 13.83 11.4544
+ 13.84 11.4561
+ 13.85 11.4578
+ 13.86 11.4595
+ 13.87 11.4613
+ 13.88 11.463
+ 13.89 11.4647
+ 13.9 11.4664
+ 13.91 11.4681
+ 13.92 11.4698
+ 13.93 11.4715
+ 13.94 11.4732
+ 13.95 11.475
+ 13.96 11.4767
+ 13.97 11.4784
+ 13.98 11.4801
+ 13.99 11.4818
+ 14 11.4835
+ 14.01 11.4852
+ 14.02 11.4869
+ 14.03 11.4886
+ 14.04 11.4903
+ 14.05 11.492
+ 14.06 11.4937
+ 14.07 11.4953
+ 14.08 11.497
+ 14.09 11.4987
+ 14.1 11.5004
+ 14.11 11.5021
+ 14.12 11.5038
+ 14.13 11.5055
+ 14.14 11.5072
+ 14.15 11.5088
+ 14.16 11.5105
+ 14.17 11.5122
+ 14.18 11.5139
+ 14.19 11.5156
+ 14.2 11.5172
+ 14.21 11.5189
+ 14.22 11.5206
+ 14.23 11.5223
+ 14.24 11.5239
+ 14.25 11.5256
+ 14.26 11.5273
+ 14.27 11.529
+ 14.28 11.5306
+ 14.29 11.5323
+ 14.3 11.534
+ 14.31 11.5356
+ 14.32 11.5373
+ 14.33 11.5389
+ 14.34 11.5406
+ 14.35 11.5423
+ 14.36 11.5439
+ 14.37 11.5456
+ 14.38 11.5472
+ 14.39 11.5489
+ 14.4 11.5505
+ 14.41 11.5522
+ 14.42 11.5538
+ 14.43 11.5555
+ 14.44 11.5571
+ 14.45 11.5588
+ 14.46 11.5604
+ 14.47 11.5621
+ 14.48 11.5637
+ 14.49 11.5654
+ 14.5 11.567
+ 14.51 11.5687
+ 14.52 11.5703
+ 14.53 11.5719
+ 14.54 11.5736
+ 14.55 11.5752
+ 14.56 11.5769
+ 14.57 11.5785
+ 14.58 11.5801
+ 14.59 11.5818
+ 14.6 11.5834
+ 14.61 11.585
+ 14.62 11.5866
+ 14.63 11.5883
+ 14.64 11.5899
+ 14.65 11.5915
+ 14.66 11.5931
+ 14.67 11.5948
+ 14.68 11.5964
+ 14.69 11.598
+ 14.7 11.5996
+ 14.71 11.6013
+ 14.72 11.6029
+ 14.73 11.6045
+ 14.74 11.6061
+ 14.75 11.6077
+ 14.76 11.6093
+ 14.77 11.6109
+ 14.78 11.6126
+ 14.79 11.6142
+ 14.8 11.6158
+ 14.81 11.6174
+ 14.82 11.619
+ 14.83 11.6206
+ 14.84 11.6222
+ 14.85 11.6238
+ 14.86 11.6254
+ 14.87 11.627
+ 14.88 11.6286
+ 14.89 11.6302
+ 14.9 11.6318
+ 14.91 11.6334
+ 14.92 11.635
+ 14.93 11.6366
+ 14.94 11.6382
+ 14.95 11.6398
+ 14.96 11.6414
+ 14.97 11.643
+ 14.98 11.6446
+ 14.99 11.6462
+ 15 11.6477
+ 15.01 11.6493
+ 15.02 11.6509
+ 15.03 11.6525
+ 15.04 11.6541
+ 15.05 11.6557
+ 15.06 11.6572
+ 15.07 11.6588
+ 15.08 11.6604
+ 15.09 11.662
+ 15.1 11.6636
+ 15.11 11.6651
+ 15.12 11.6667
+ 15.13 11.6683
+ 15.14 11.6699
+ 15.15 11.6714
+ 15.16 11.673
+ 15.17 11.6746
+ 15.18 11.6761
+ 15.19 11.6777
+ 15.2 11.6793
+ 15.21 11.6808
+ 15.22 11.6824
+ 15.23 11.684
+ 15.24 11.6855
+ 15.25 11.6871
+ 15.26 11.6887
+ 15.27 11.6902
+ 15.28 11.6918
+ 15.29 11.6933
+ 15.3 11.6949
+ 15.31 11.6964
+ 15.32 11.698
+ 15.33 11.6996
+ 15.34 11.7011
+ 15.35 11.7027
+ 15.36 11.7042
+ 15.37 11.7058
+ 15.38 11.7073
+ 15.39 11.7089
+ 15.4 11.7104
+ 15.41 11.7119
+ 15.42 11.7135
+ 15.43 11.715
+ 15.44 11.7166
+ 15.45 11.7181
+ 15.46 11.7197
+ 15.47 11.7212
+ 15.48 11.7227
+ 15.49 11.7243
+ 15.5 11.7258
+ 15.51 11.7273
+ 15.52 11.7289
+ 15.53 11.7304
+ 15.54 11.7319
+ 15.55 11.7335
+ 15.56 11.735
+ 15.57 11.7365
+ 15.58 11.7381
+ 15.59 11.7396
+ 15.6 11.7411
+ 15.61 11.7426
+ 15.62 11.7442
+ 15.63 11.7457
+ 15.64 11.7472
+ 15.65 11.7487
+ 15.66 11.7503
+ 15.67 11.7518
+ 15.68 11.7533
+ 15.69 11.7548
+ 15.7 11.7563
+ 15.71 11.7579
+ 15.72 11.7594
+ 15.73 11.7609
+ 15.74 11.7624
+ 15.75 11.7639
+ 15.76 11.7654
+ 15.77 11.7669
+ 15.78 11.7684
+ 15.79 11.7699
+ 15.8 11.7715
+ 15.81 11.773
+ 15.82 11.7745
+ 15.83 11.776
+ 15.84 11.7775
+ 15.85 11.779
+ 15.86 11.7805
+ 15.87 11.782
+ 15.88 11.7835
+ 15.89 11.785
+ 15.9 11.7865
+ 15.91 11.788
+ 15.92 11.7895
+ 15.93 11.791
+ 15.94 11.7925
+ 15.95 11.7939
+ 15.96 11.7954
+ 15.97 11.7969
+ 15.98 11.7984
+ 15.99 11.7999
+ 16 11.8014
+ 16.01 11.8029
+ 16.02 11.8044
+ 16.03 11.8059
+ 16.04 11.8073
+ 16.05 11.8088
+ 16.06 11.8103
+ 16.07 11.8118
+ 16.08 11.8133
+ 16.09 11.8148
+ 16.1 11.8162
+ 16.11 11.8177
+ 16.12 11.8192
+ 16.13 11.8207
+ 16.14 11.8221
+ 16.15 11.8236
+ 16.16 11.8251
+ 16.17 11.8266
+ 16.18 11.828
+ 16.19 11.8295
+ 16.2 11.831
+ 16.21 11.8324
+ 16.22 11.8339
+ 16.23 11.8354
+ 16.24 11.8369
+ 16.25 11.8383
+ 16.26 11.8398
+ 16.27 11.8412
+ 16.28 11.8427
+ 16.29 11.8442
+ 16.3 11.8456
+ 16.31 11.8471
+ 16.32 11.8486
+ 16.33 11.85
+ 16.34 11.8515
+ 16.35 11.8529
+ 16.36 11.8544
+ 16.37 11.8558
+ 16.38 11.8573
+ 16.39 11.8587
+ 16.4 11.8602
+ 16.41 11.8616
+ 16.42 11.8631
+ 16.43 11.8645
+ 16.44 11.866
+ 16.45 11.8674
+ 16.46 11.8689
+ 16.47 11.8703
+ 16.48 11.8718
+ 16.49 11.8732
+ 16.5 11.8747
+ 16.51 11.8761
+ 16.52 11.8776
+ 16.53 11.879
+ 16.54 11.8804
+ 16.55 11.8819
+ 16.56 11.8833
+ 16.57 11.8847
+ 16.58 11.8862
+ 16.59 11.8876
+ 16.6 11.8891
+ 16.61 11.8905
+ 16.62 11.8919
+ 16.63 11.8934
+ 16.64 11.8948
+ 16.65 11.8962
+ 16.66 11.8976
+ 16.67 11.8991
+ 16.68 11.9005
+ 16.69 11.9019
+ 16.7 11.9034
+ 16.71 11.9048
+ 16.72 11.9062
+ 16.73 11.9076
+ 16.74 11.9091
+ 16.75 11.9105
+ 16.76 11.9119
+ 16.77 11.9133
+ 16.78 11.9147
+ 16.79 11.9162
+ 16.8 11.9176
+ 16.81 11.919
+ 16.82 11.9204
+ 16.83 11.9218
+ 16.84 11.9232
+ 16.85 11.9246
+ 16.86 11.9261
+ 16.87 11.9275
+ 16.88 11.9289
+ 16.89 11.9303
+ 16.9 11.9317
+ 16.91 11.9331
+ 16.92 11.9345
+ 16.93 11.9359
+ 16.94 11.9373
+ 16.95 11.9387
+ 16.96 11.9401
+ 16.97 11.9415
+ 16.98 11.9429
+ 16.99 11.9443
+ 17 11.9457
+ 17.01 11.9471
+ 17.02 11.9485
+ 17.03 11.9499
+ 17.04 11.9513
+ 17.05 11.9527
+ 17.06 11.9541
+ 17.07 11.9555
+ 17.08 11.9569
+ 17.09 11.9583
+ 17.1 11.9597
+ 17.11 11.9611
+ 17.12 11.9625
+ 17.13 11.9639
+ 17.14 11.9653
+ 17.15 11.9667
+ 17.16 11.9681
+ 17.17 11.9694
+ 17.18 11.9708
+ 17.19 11.9722
+ 17.2 11.9736
+ 17.21 11.975
+ 17.22 11.9764
+ 17.23 11.9777
+ 17.24 11.9791
+ 17.25 11.9805
+ 17.26 11.9819
+ 17.27 11.9833
+ 17.28 11.9846
+ 17.29 11.986
+ 17.3 11.9874
+ 17.31 11.9888
+ 17.32 11.9901
+ 17.33 11.9915
+ 17.34 11.9929
+ 17.35 11.9943
+ 17.36 11.9956
+ 17.37 11.997
+ 17.38 11.9984
+ 17.39 11.9998
+ 17.4 12.0011
+ 17.41 12.0025
+ 17.42 12.0039
+ 17.43 12.0052
+ 17.44 12.0066
+ 17.45 12.008
+ 17.46 12.0093
+ 17.47 12.0107
+ 17.48 12.012
+ 17.49 12.0134
+ 17.5 12.0148
+ 17.51 12.0161
+ 17.52 12.0175
+ 17.53 12.0188
+ 17.54 12.0202
+ 17.55 12.0216
+ 17.56 12.0229
+ 17.57 12.0243
+ 17.58 12.0256
+ 17.59 12.027
+ 17.6 12.0283
+ 17.61 12.0297
+ 17.62 12.031
+ 17.63 12.0324
+ 17.64 12.0337
+ 17.65 12.0351
+ 17.66 12.0364
+ 17.67 12.0378
+ 17.68 12.0391
+ 17.69 12.0405
+ 17.7 12.0418
+ 17.71 12.0432
+ 17.72 12.0445
+ 17.73 12.0459
+ 17.74 12.0472
+ 17.75 12.0485
+ 17.76 12.0499
+ 17.77 12.0512
+ 17.78 12.0526
+ 17.79 12.0539
+ 17.8 12.0552
+ 17.81 12.0566
+ 17.82 12.0579
+ 17.83 12.0592
+ 17.84 12.0606
+ 17.85 12.0619
+ 17.86 12.0632
+ 17.87 12.0646
+ 17.88 12.0659
+ 17.89 12.0672
+ 17.9 12.0686
+ 17.91 12.0699
+ 17.92 12.0712
+ 17.93 12.0726
+ 17.94 12.0739
+ 17.95 12.0752
+ 17.96 12.0765
+ 17.97 12.0779
+ 17.98 12.0792
+ 17.99 12.0805
+ 18 12.0818
+ 18.01 12.0832
+ 18.02 12.0845
+ 18.03 12.0858
+ 18.04 12.0871
+ 18.05 12.0884
+ 18.06 12.0898
+ 18.07 12.0911
+ 18.08 12.0924
+ 18.09 12.0937
+ 18.1 12.095
+ 18.11 12.0963
+ 18.12 12.0977
+ 18.13 12.099
+ 18.14 12.1003
+ 18.15 12.1016
+ 18.16 12.1029
+ 18.17 12.1042
+ 18.18 12.1055
+ 18.19 12.1068
+ 18.2 12.1081
+ 18.21 12.1095
+ 18.22 12.1108
+ 18.23 12.1121
+ 18.24 12.1134
+ 18.25 12.1147
+ 18.26 12.116
+ 18.27 12.1173
+ 18.28 12.1186
+ 18.29 12.1199
+ 18.3 12.1212
+ 18.31 12.1225
+ 18.32 12.1238
+ 18.33 12.1251
+ 18.34 12.1264
+ 18.35 12.1277
+ 18.36 12.129
+ 18.37 12.1303
+ 18.38 12.1316
+ 18.39 12.1329
+ 18.4 12.1342
+ 18.41 12.1355
+ 18.42 12.1368
+ 18.43 12.138
+ 18.44 12.1393
+ 18.45 12.1406
+ 18.46 12.1419
+ 18.47 12.1432
+ 18.48 12.1445
+ 18.49 12.1458
+ 18.5 12.1471
+ 18.51 12.1484
+ 18.52 12.1496
+ 18.53 12.1509
+ 18.54 12.1522
+ 18.55 12.1535
+ 18.56 12.1548
+ 18.57 12.1561
+ 18.58 12.1573
+ 18.59 12.1586
+ 18.6 12.1599
+ 18.61 12.1612
+ 18.62 12.1625
+ 18.63 12.1637
+ 18.64 12.165
+ 18.65 12.1663
+ 18.66 12.1676
+ 18.67 12.1689
+ 18.68 12.1701
+ 18.69 12.1714
+ 18.7 12.1727
+ 18.71 12.1739
+ 18.72 12.1752
+ 18.73 12.1765
+ 18.74 12.1778
+ 18.75 12.179
+ 18.76 12.1803
+ 18.77 12.1816
+ 18.78 12.1828
+ 18.79 12.1841
+ 18.8 12.1854
+ 18.81 12.1866
+ 18.82 12.1879
+ 18.83 12.1892
+ 18.84 12.1904
+ 18.85 12.1917
+ 18.86 12.193
+ 18.87 12.1942
+ 18.88 12.1955
+ 18.89 12.1967
+ 18.9 12.198
+ 18.91 12.1993
+ 18.92 12.2005
+ 18.93 12.2018
+ 18.94 12.203
+ 18.95 12.2043
+ 18.96 12.2056
+ 18.97 12.2068
+ 18.98 12.2081
+ 18.99 12.2093
+ 19 12.2106
+ 19.01 12.2118
+ 19.02 12.2131
+ 19.03 12.2143
+ 19.04 12.2156
+ 19.05 12.2168
+ 19.06 12.2181
+ 19.07 12.2193
+ 19.08 12.2206
+ 19.09 12.2218
+ 19.1 12.2231
+ 19.11 12.2243
+ 19.12 12.2256
+ 19.13 12.2268
+ 19.14 12.228
+ 19.15 12.2293
+ 19.16 12.2305
+ 19.17 12.2318
+ 19.18 12.233
+ 19.19 12.2343
+ 19.2 12.2355
+ 19.21 12.2367
+ 19.22 12.238
+ 19.23 12.2392
+ 19.24 12.2405
+ 19.25 12.2417
+ 19.26 12.2429
+ 19.27 12.2442
+ 19.28 12.2454
+ 19.29 12.2466
+ 19.3 12.2479
+ 19.31 12.2491
+ 19.32 12.2503
+ 19.33 12.2516
+ 19.34 12.2528
+ 19.35 12.254
+ 19.36 12.2553
+ 19.37 12.2565
+ 19.38 12.2577
+ 19.39 12.2589
+ 19.4 12.2602
+ 19.41 12.2614
+ 19.42 12.2626
+ 19.43 12.2639
+ 19.44 12.2651
+ 19.45 12.2663
+ 19.46 12.2675
+ 19.47 12.2687
+ 19.48 12.27
+ 19.49 12.2712
+ 19.5 12.2724
+ 19.51 12.2736
+ 19.52 12.2749
+ 19.53 12.2761
+ 19.54 12.2773
+ 19.55 12.2785
+ 19.56 12.2797
+ 19.57 12.2809
+ 19.58 12.2822
+ 19.59 12.2834
+ 19.6 12.2846
+ 19.61 12.2858
+ 19.62 12.287
+ 19.63 12.2882
+ 19.64 12.2894
+ 19.65 12.2907
+ 19.66 12.2919
+ 19.67 12.2931
+ 19.68 12.2943
+ 19.69 12.2955
+ 19.7 12.2967
+ 19.71 12.2979
+ 19.72 12.2991
+ 19.73 12.3003
+ 19.74 12.3015
+ 19.75 12.3027
+ 19.76 12.304
+ 19.77 12.3052
+ 19.78 12.3064
+ 19.79 12.3076
+ 19.8 12.3088
+ 19.81 12.31
+ 19.82 12.3112
+ 19.83 12.3124
+ 19.84 12.3136
+ 19.85 12.3148
+ 19.86 12.316
+ 19.87 12.3172
+ 19.88 12.3184
+ 19.89 12.3196
+ 19.9 12.3208
+ 19.91 12.322
+ 19.92 12.3232
+ 19.93 12.3243
+ 19.94 12.3255
+ 19.95 12.3267
+ 19.96 12.3279
+ 19.97 12.3291
+ 19.98 12.3303
+ 19.99 12.3315
+ 20 12.3327
+&
+ at TARGET S1
+ at TYPE xy
+ 0.01 0.01
+ 0.02 0.02
+ 0.03 0.03
+ 0.04 0.04
+ 0.05 0.05
+ 0.06 0.06
+ 0.07 0.07
+ 0.08 0.08
+ 0.09 0.09
+ 0.1 0.1
+ 0.11 0.11
+ 0.12 0.12
+ 0.13 0.13
+ 0.14 0.14
+ 0.15 0.15
+ 0.16 0.16
+ 0.17 0.17
+ 0.18 0.18
+ 0.19 0.19
+ 0.2 0.2
+ 0.21 0.21
+ 0.22 0.22
+ 0.23 0.23
+ 0.24 0.24
+ 0.25 0.25
+ 0.26 0.26
+ 0.27 0.27
+ 0.28 0.28
+ 0.29 0.29
+ 0.3 0.3
+ 0.31 0.31
+ 0.32 0.32
+ 0.33 0.33
+ 0.34 0.34
+ 0.35 0.35
+ 0.36 0.36
+ 0.37 0.37
+ 0.38 0.38
+ 0.39 0.39
+ 0.4 0.4
+ 0.41 0.41
+ 0.42 0.42
+ 0.43 0.43
+ 0.44 0.44
+ 0.45 0.45
+ 0.46 0.46
+ 0.47 0.47
+ 0.48 0.48
+ 0.49 0.49
+ 0.5 0.5
+ 0.51 0.51
+ 0.52 0.52
+ 0.53 0.53
+ 0.54 0.54
+ 0.55 0.55
+ 0.56 0.56
+ 0.57 0.57
+ 0.58 0.58
+ 0.59 0.59
+ 0.6 0.6
+ 0.61 0.61
+ 0.62 0.62
+ 0.63 0.63
+ 0.64 0.64
+ 0.65 0.65
+ 0.66 0.66
+ 0.67 0.67
+ 0.68 0.68
+ 0.69 0.69
+ 0.7 0.7
+ 0.71 0.71
+ 0.72 0.72
+ 0.73 0.73
+ 0.74 0.74
+ 0.75 0.75
+ 0.76 0.76
+ 0.77 0.77
+ 0.78 0.78
+ 0.79 0.79
+ 0.8 0.8
+ 0.81 0.81
+ 0.82 0.82
+ 0.83 0.83
+ 0.84 0.84
+ 0.85 0.85
+ 0.86 0.86
+ 0.87 0.87
+ 0.88 0.88
+ 0.89 0.89
+ 0.9 0.9
+ 0.91 0.91
+ 0.92 0.92
+ 0.93 0.93
+ 0.94 0.94
+ 0.95 0.95
+ 0.96 0.96
+ 0.97 0.97
+ 0.98 0.98
+ 0.99 0.99
+ 1 1
+ 1.01 1.01
+ 1.02 1.02
+ 1.03 1.03
+ 1.04 1.04
+ 1.05 1.05
+ 1.06 1.06
+ 1.07 1.07
+ 1.08 1.08
+ 1.09 1.09
+ 1.1 1.1
+ 1.11 1.11
+ 1.12 1.12
+ 1.13 1.13
+ 1.14 1.14
+ 1.15 1.15
+ 1.16 1.16
+ 1.17 1.17
+ 1.18 1.18
+ 1.19 1.19
+ 1.2 1.2
+ 1.21 1.21
+ 1.22 1.22
+ 1.23 1.23
+ 1.24 1.24
+ 1.25 1.25
+ 1.26 1.26
+ 1.27 1.27
+ 1.28 1.28
+ 1.29 1.29
+ 1.3 1.3
+ 1.31 1.31
+ 1.32 1.32
+ 1.33 1.33
+ 1.34 1.34
+ 1.35 1.35
+ 1.36 1.36
+ 1.37 1.37
+ 1.38 1.38
+ 1.39 1.39
+ 1.4 1.4
+ 1.41 1.41
+ 1.42 1.42
+ 1.43 1.43
+ 1.44 1.44
+ 1.45 1.45
+ 1.46 1.46
+ 1.47 1.47
+ 1.48 1.48
+ 1.49 1.49
+ 1.5 1.5
+ 1.51 1.51
+ 1.52 1.52
+ 1.53 1.53
+ 1.54 1.54
+ 1.55 1.55
+ 1.56 1.56
+ 1.57 1.57
+ 1.58 1.58
+ 1.59 1.59
+ 1.6 1.6
+ 1.61 1.61
+ 1.62 1.62
+ 1.63 1.63
+ 1.64 1.64
+ 1.65 1.65
+ 1.66 1.66
+ 1.67 1.67
+ 1.68 1.68
+ 1.69 1.69
+ 1.7 1.7
+ 1.71 1.71
+ 1.72 1.72
+ 1.73 1.73
+ 1.74 1.74
+ 1.75 1.75
+ 1.76 1.76
+ 1.77 1.77
+ 1.78 1.78
+ 1.79 1.79
+ 1.8 1.8
+ 1.81 1.81
+ 1.82 1.82
+ 1.83 1.83
+ 1.84 1.84
+ 1.85 1.85
+ 1.86 1.86
+ 1.87 1.87
+ 1.88 1.88
+ 1.89 1.89
+ 1.9 1.9
+ 1.91 1.91
+ 1.92 1.92
+ 1.93 1.93
+ 1.94 1.94
+ 1.95 1.95
+ 1.96 1.96
+ 1.97 1.97
+ 1.98 1.98
+ 1.99 1.99
+ 2 2
+ 2.01 2.01
+ 2.02 2.02
+ 2.03 2.03
+ 2.04 2.04
+ 2.05 2.05
+ 2.06 2.06
+ 2.07 2.07
+ 2.08 2.08
+ 2.09 2.09
+ 2.1 2.1
+ 2.11 2.11
+ 2.12 2.12
+ 2.13 2.13
+ 2.14 2.14
+ 2.15 2.15
+ 2.16 2.16
+ 2.17 2.17
+ 2.18 2.18
+ 2.19 2.19
+ 2.2 2.2
+ 2.21 2.21
+ 2.22 2.22
+ 2.23 2.23
+ 2.24 2.24
+ 2.25 2.25
+ 2.26 2.26
+ 2.27 2.27
+ 2.28 2.28
+ 2.29 2.29
+ 2.3 2.3
+ 2.31 2.31
+ 2.32 2.32
+ 2.33 2.33
+ 2.34 2.34
+ 2.35 2.35
+ 2.36 2.36
+ 2.37 2.37
+ 2.38 2.38
+ 2.39 2.39
+ 2.4 2.4
+ 2.41 2.41
+ 2.42 2.42
+ 2.43 2.43
+ 2.44 2.44
+ 2.45 2.45
+ 2.46 2.46
+ 2.47 2.47
+ 2.48 2.48
+ 2.49 2.49
+ 2.5 2.5
+ 2.51 2.51
+ 2.52 2.52
+ 2.53 2.53
+ 2.54 2.54
+ 2.55 2.55
+ 2.56 2.56
+ 2.57 2.57
+ 2.58 2.58
+ 2.59 2.59
+ 2.6 2.6
+ 2.61 2.61
+ 2.62 2.62
+ 2.63 2.63
+ 2.64 2.64
+ 2.65 2.65
+ 2.66 2.66
+ 2.67 2.67
+ 2.68 2.68
+ 2.69 2.69
+ 2.7 2.7
+ 2.71 2.71
+ 2.72 2.72
+ 2.73 2.73
+ 2.74 2.74
+ 2.75 2.75
+ 2.76 2.76
+ 2.77 2.77
+ 2.78 2.78
+ 2.79 2.79
+ 2.8 2.8
+ 2.81 2.81
+ 2.82 2.82
+ 2.83 2.83
+ 2.84 2.84
+ 2.85 2.85
+ 2.86 2.86
+ 2.87 2.87
+ 2.88 2.88
+ 2.89 2.89
+ 2.9 2.9
+ 2.91 2.91
+ 2.92 2.92
+ 2.93 2.93
+ 2.94 2.94
+ 2.95 2.95
+ 2.96 2.96
+ 2.97 2.97
+ 2.98 2.98
+ 2.99 2.99
+ 3 3
+ 3.01 3.01
+ 3.02 3.02
+ 3.03 3.03
+ 3.04 3.04
+ 3.05 3.05
+ 3.06 3.06
+ 3.07 3.07
+ 3.08 3.08
+ 3.09 3.09
+ 3.1 3.1
+ 3.11 3.11
+ 3.12 3.12
+ 3.13 3.13
+ 3.14 3.14
+ 3.15 3.15
+ 3.16 3.16
+ 3.17 3.17
+ 3.18 3.18
+ 3.19 3.19
+ 3.2 3.2
+ 3.21 3.21
+ 3.22 3.22
+ 3.23 3.23
+ 3.24 3.24
+ 3.25 3.25
+ 3.26 3.26
+ 3.27 3.27
+ 3.28 3.28
+ 3.29 3.29
+ 3.3 3.3
+ 3.31 3.31
+ 3.32 3.32
+ 3.33 3.33
+ 3.34 3.34
+ 3.35 3.35
+ 3.36 3.36
+ 3.37 3.37
+ 3.38 3.38
+ 3.39 3.39
+ 3.4 3.4
+ 3.41 3.41
+ 3.42 3.42
+ 3.43 3.43
+ 3.44 3.44
+ 3.45 3.45
+ 3.46 3.46
+ 3.47 3.47
+ 3.48 3.48
+ 3.49 3.49
+ 3.5 3.5
+ 3.51 3.51
+ 3.52 3.52
+ 3.53 3.53
+ 3.54 3.54
+ 3.55 3.55
+ 3.56 3.56
+ 3.57 3.57
+ 3.58 3.58
+ 3.59 3.59
+ 3.6 3.6
+ 3.61 3.61
+ 3.62 3.62
+ 3.63 3.63
+ 3.64 3.64
+ 3.65 3.65
+ 3.66 3.66
+ 3.67 3.67
+ 3.68 3.68
+ 3.69 3.69
+ 3.7 3.7
+ 3.71 3.71
+ 3.72 3.72
+ 3.73 3.73
+ 3.74 3.74
+ 3.75 3.75
+ 3.76 3.76
+ 3.77 3.77
+ 3.78 3.78
+ 3.79 3.79
+ 3.8 3.8
+ 3.81 3.81
+ 3.82 3.82
+ 3.83 3.83
+ 3.84 3.84
+ 3.85 3.85
+ 3.86 3.86
+ 3.87 3.87
+ 3.88 3.88
+ 3.89 3.89
+ 3.9 3.9
+ 3.91 3.91
+ 3.92 3.92
+ 3.93 3.93
+ 3.94 3.94
+ 3.95 3.95
+ 3.96 3.96
+ 3.97 3.97
+ 3.98 3.98
+ 3.99 3.99
+ 4 4
+ 4.01 4.01
+ 4.02 4.02
+ 4.03 4.03
+ 4.04 4.04
+ 4.05 4.05
+ 4.06 4.06
+ 4.07 4.07
+ 4.08 4.08
+ 4.09 4.09
+ 4.1 4.1
+ 4.11 4.11
+ 4.12 4.12
+ 4.13 4.13
+ 4.14 4.14
+ 4.15 4.15
+ 4.16 4.16
+ 4.17 4.17
+ 4.18 4.18
+ 4.19 4.19
+ 4.2 4.2
+ 4.21 4.21
+ 4.22 4.22
+ 4.23 4.23
+ 4.24 4.24
+ 4.25 4.25
+ 4.26 4.26
+ 4.27 4.27
+ 4.28 4.28
+ 4.29 4.29
+ 4.3 4.3
+ 4.31 4.31
+ 4.32 4.32
+ 4.33 4.33
+ 4.34 4.34
+ 4.35 4.35
+ 4.36 4.36
+ 4.37 4.37
+ 4.38 4.38
+ 4.39 4.39
+ 4.4 4.4
+ 4.41 4.41
+ 4.42 4.42
+ 4.43 4.43
+ 4.44 4.44
+ 4.45 4.45
+ 4.46 4.46
+ 4.47 4.47
+ 4.48 4.48
+ 4.49 4.49
+ 4.5 4.5
+ 4.51 4.51
+ 4.52 4.52
+ 4.53 4.53
+ 4.54 4.54
+ 4.55 4.55
+ 4.56 4.56
+ 4.57 4.57
+ 4.58 4.58
+ 4.59 4.59
+ 4.6 4.6
+ 4.61 4.61
+ 4.62 4.62
+ 4.63 4.63
+ 4.64 4.64
+ 4.65 4.65
+ 4.66 4.66
+ 4.67 4.67
+ 4.68 4.68
+ 4.69 4.69
+ 4.7 4.7
+ 4.71 4.71
+ 4.72 4.72
+ 4.73 4.73
+ 4.74 4.74
+ 4.75 4.75
+ 4.76 4.76
+ 4.77 4.77
+ 4.78 4.78
+ 4.79 4.79
+ 4.8 4.8
+ 4.81 4.81
+ 4.82 4.82
+ 4.83 4.83
+ 4.84 4.84
+ 4.85 4.85
+ 4.86 4.86
+ 4.87 4.87
+ 4.88 4.88
+ 4.89 4.89
+ 4.9 4.9
+ 4.91 4.91
+ 4.92 4.92
+ 4.93 4.93
+ 4.94 4.94
+ 4.95 4.95
+ 4.96 4.96
+ 4.97 4.97
+ 4.98 4.98
+ 4.99 4.99
+ 5 5
+ 5.01 5.01
+ 5.02 5.02
+ 5.03 5.03
+ 5.04 5.04
+ 5.05 5.05
+ 5.06 5.06
+ 5.07 5.07
+ 5.08 5.08
+ 5.09 5.09
+ 5.1 5.1
+ 5.11 5.11
+ 5.12 5.12
+ 5.13 5.13
+ 5.14 5.14
+ 5.15 5.15
+ 5.16 5.16
+ 5.17 5.17
+ 5.18 5.18
+ 5.19 5.19
+ 5.2 5.2
+ 5.21 5.21
+ 5.22 5.22
+ 5.23 5.23
+ 5.24 5.24
+ 5.25 5.25
+ 5.26 5.26
+ 5.27 5.27
+ 5.28 5.28
+ 5.29 5.29
+ 5.3 5.3
+ 5.31 5.31
+ 5.32 5.32
+ 5.33 5.33
+ 5.34 5.34
+ 5.35 5.35
+ 5.36 5.36
+ 5.37 5.37
+ 5.38 5.38
+ 5.39 5.39
+ 5.4 5.4
+ 5.41 5.41
+ 5.42 5.42
+ 5.43 5.43
+ 5.44 5.44
+ 5.45 5.45
+ 5.46 5.46
+ 5.47 5.47
+ 5.48 5.48
+ 5.49 5.49
+ 5.5 5.5
+ 5.51 5.51
+ 5.52 5.52
+ 5.53 5.53
+ 5.54 5.54
+ 5.55 5.55
+ 5.56 5.56
+ 5.57 5.57
+ 5.58 5.58
+ 5.59 5.59
+ 5.6 5.6
+ 5.61 5.61
+ 5.62 5.62
+ 5.63 5.63
+ 5.64 5.64
+ 5.65 5.65
+ 5.66 5.66
+ 5.67 5.67
+ 5.68 5.68
+ 5.69 5.69
+ 5.7 5.7
+ 5.71 5.71
+ 5.72 5.72
+ 5.73 5.73
+ 5.74 5.74
+ 5.75 5.75
+ 5.76 5.76
+ 5.77 5.77
+ 5.78 5.78
+ 5.79 5.79
+ 5.8 5.8
+ 5.81 5.81
+ 5.82 5.82
+ 5.83 5.83
+ 5.84 5.84
+ 5.85 5.85
+ 5.86 5.86
+ 5.87 5.87
+ 5.88 5.88
+ 5.89 5.89
+ 5.9 5.9
+ 5.91 5.91
+ 5.92 5.92
+ 5.93 5.93
+ 5.94 5.94
+ 5.95 5.95
+ 5.96 5.96
+ 5.97 5.97
+ 5.98 5.98
+ 5.99 5.99
+ 6 6
+ 6.01 6.01
+ 6.02 6.02
+ 6.03 6.03
+ 6.04 6.04
+ 6.05 6.05
+ 6.06 6.06
+ 6.07 6.07
+ 6.08 6.08
+ 6.09 6.09
+ 6.1 6.1
+ 6.11 6.11
+ 6.12 6.12
+ 6.13 6.13
+ 6.14 6.14
+ 6.15 6.15
+ 6.16 6.16
+ 6.17 6.17
+ 6.18 6.18
+ 6.19 6.19
+ 6.2 6.2
+ 6.21 6.21
+ 6.22 6.22
+ 6.23 6.23
+ 6.24 6.24
+ 6.25 6.25
+ 6.26 6.26
+ 6.27 6.27
+ 6.28 6.28
+ 6.29 6.29
+ 6.3 6.3
+ 6.31 6.31
+ 6.32 6.32
+ 6.33 6.33
+ 6.34 6.34
+ 6.35 6.35
+ 6.36 6.36
+ 6.37 6.37
+ 6.38 6.38
+ 6.39 6.39
+ 6.4 6.4
+ 6.41 6.41
+ 6.42 6.42
+ 6.43 6.43
+ 6.44 6.44
+ 6.45 6.45
+ 6.46 6.46
+ 6.47 6.47
+ 6.48 6.48
+ 6.49 6.49
+ 6.5 6.5
+ 6.51 6.51
+ 6.52 6.52
+ 6.53 6.53
+ 6.54 6.54
+ 6.55 6.55
+ 6.56 6.56
+ 6.57 6.57
+ 6.58 6.58
+ 6.59 6.59
+ 6.6 6.6
+ 6.61 6.61
+ 6.62 6.62
+ 6.63 6.63
+ 6.64 6.64
+ 6.65 6.65
+ 6.66 6.66
+ 6.67 6.67
+ 6.68 6.68
+ 6.69 6.69
+ 6.7 6.7
+ 6.71 6.71
+ 6.72 6.72
+ 6.73 6.73
+ 6.74 6.74
+ 6.75 6.75
+ 6.76 6.76
+ 6.77 6.77
+ 6.78 6.78
+ 6.79 6.79
+ 6.8 6.8
+ 6.81 6.81
+ 6.82 6.82
+ 6.83 6.83
+ 6.84 6.84
+ 6.85 6.85
+ 6.86 6.86
+ 6.87 6.87
+ 6.88 6.88
+ 6.89 6.89
+ 6.9 6.9
+ 6.91 6.91
+ 6.92 6.92
+ 6.93 6.93
+ 6.94 6.94
+ 6.95 6.95
+ 6.96 6.96
+ 6.97 6.97
+ 6.98 6.98
+ 6.99 6.99
+ 7 7
+ 7.01 7.01
+ 7.02 7.02
+ 7.03 7.03
+ 7.04 7.04
+ 7.05 7.05
+ 7.06 7.06
+ 7.07 7.07
+ 7.08 7.08
+ 7.09 7.09
+ 7.1 7.1
+ 7.11 7.11
+ 7.12 7.12
+ 7.13 7.13
+ 7.14 7.14
+ 7.15 7.15
+ 7.16 7.16
+ 7.17 7.17
+ 7.18 7.18
+ 7.19 7.19
+ 7.2 7.2
+ 7.21 7.21
+ 7.22 7.22
+ 7.23 7.23
+ 7.24 7.24
+ 7.25 7.25
+ 7.26 7.26
+ 7.27 7.27
+ 7.28 7.28
+ 7.29 7.29
+ 7.3 7.3
+ 7.31 7.31
+ 7.32 7.32
+ 7.33 7.33
+ 7.34 7.34
+ 7.35 7.35
+ 7.36 7.36
+ 7.37 7.37
+ 7.38 7.38
+ 7.39 7.39
+ 7.4 7.4
+ 7.41 7.41
+ 7.42 7.42
+ 7.43 7.43
+ 7.44 7.44
+ 7.45 7.45
+ 7.46 7.46
+ 7.47 7.47
+ 7.48 7.48
+ 7.49 7.49
+ 7.5 7.5
+ 7.51 7.51
+ 7.52 7.52
+ 7.53 7.53
+ 7.54 7.54
+ 7.55 7.55
+ 7.56 7.56
+ 7.57 7.57
+ 7.58 7.58
+ 7.59 7.59
+ 7.6 7.6
+ 7.61 7.61
+ 7.62 7.62
+ 7.63 7.63
+ 7.64 7.64
+ 7.65 7.65
+ 7.66 7.66
+ 7.67 7.67
+ 7.68 7.68
+ 7.69 7.69
+ 7.7 7.7
+ 7.71 7.71
+ 7.72 7.72
+ 7.73 7.73
+ 7.74 7.74
+ 7.75 7.75
+ 7.76 7.76
+ 7.77 7.77
+ 7.78 7.78
+ 7.79 7.79
+ 7.8 7.8
+ 7.81 7.81
+ 7.82 7.82
+ 7.83 7.83
+ 7.84 7.84
+ 7.85 7.85
+ 7.86 7.86
+ 7.87 7.87
+ 7.88 7.88
+ 7.89 7.89
+ 7.9 7.9
+ 7.91 7.91
+ 7.92 7.92
+ 7.93 7.93
+ 7.94 7.94
+ 7.95 7.95
+ 7.96 7.96
+ 7.97 7.97
+ 7.98 7.98
+ 7.99 7.99
+ 8 8
+ 8.01 8.01
+ 8.02 8.02
+ 8.03 8.03
+ 8.04 8.04
+ 8.05 8.05
+ 8.06 8.06
+ 8.07 8.07
+ 8.08 8.08
+ 8.09 8.09
+ 8.1 8.1
+ 8.11 8.11
+ 8.12 8.12
+ 8.13 8.13
+ 8.14 8.14
+ 8.15 8.15
+ 8.16 8.16
+ 8.17 8.17
+ 8.18 8.18
+ 8.19 8.19
+ 8.2 8.2
+ 8.21 8.21
+ 8.22 8.22
+ 8.23 8.23
+ 8.24 8.24
+ 8.25 8.25
+ 8.26 8.26
+ 8.27 8.27
+ 8.28 8.28
+ 8.29 8.29
+ 8.3 8.3
+ 8.31 8.31
+ 8.32 8.32
+ 8.33 8.33
+ 8.34 8.34
+ 8.35 8.35
+ 8.36 8.36
+ 8.37 8.37
+ 8.38 8.38
+ 8.39 8.39
+ 8.4 8.4
+ 8.41 8.41
+ 8.42 8.42
+ 8.43 8.43
+ 8.44 8.44
+ 8.45 8.45
+ 8.46 8.46
+ 8.47 8.47
+ 8.48 8.48
+ 8.49 8.49
+ 8.5 8.5
+ 8.51 8.51
+ 8.52 8.52
+ 8.53 8.53
+ 8.54 8.54
+ 8.55 8.55
+ 8.56 8.56
+ 8.57 8.57
+ 8.58 8.58
+ 8.59 8.59
+ 8.6 8.6
+ 8.61 8.61
+ 8.62 8.62
+ 8.63 8.63
+ 8.64 8.64
+ 8.65 8.65
+ 8.66 8.66
+ 8.67 8.67
+ 8.68 8.68
+ 8.69 8.69
+ 8.7 8.7
+ 8.71 8.71
+ 8.72 8.72
+ 8.73 8.73
+ 8.74 8.74
+ 8.75 8.75
+ 8.76 8.76
+ 8.77 8.77
+ 8.78 8.78
+ 8.79 8.79
+ 8.8 8.8
+ 8.81 8.81
+ 8.82 8.82
+ 8.83 8.83
+ 8.84 8.84
+ 8.85 8.85
+ 8.86 8.86
+ 8.87 8.87
+ 8.88 8.88
+ 8.89 8.89
+ 8.9 8.9
+ 8.91 8.91
+ 8.92 8.92
+ 8.93 8.93
+ 8.94 8.94
+ 8.95 8.95
+ 8.96 8.96
+ 8.97 8.97
+ 8.98 8.98
+ 8.99 8.99
+ 9 9
+ 9.01 9.01
+ 9.02 9.02
+ 9.03 9.03
+ 9.04 9.04
+ 9.05 9.05
+ 9.06 9.06
+ 9.07 9.07
+ 9.08 9.08
+ 9.09 9.09
+ 9.1 9.1
+ 9.11 9.11
+ 9.12 9.12
+ 9.13 9.13
+ 9.14 9.14
+ 9.15 9.15
+ 9.16 9.16
+ 9.17 9.17
+ 9.18 9.18
+ 9.19 9.19
+ 9.2 9.2
+ 9.21 9.21
+ 9.22 9.22
+ 9.23 9.23
+ 9.24 9.24
+ 9.25 9.25
+ 9.26 9.26
+ 9.27 9.27
+ 9.28 9.28
+ 9.29 9.29
+ 9.3 9.3
+ 9.31 9.31
+ 9.32 9.32
+ 9.33 9.33
+ 9.34 9.34
+ 9.35 9.35
+ 9.36 9.36
+ 9.37 9.37
+ 9.38 9.38
+ 9.39 9.39
+ 9.4 9.4
+ 9.41 9.41
+ 9.42 9.42
+ 9.43 9.43
+ 9.44 9.44
+ 9.45 9.45
+ 9.46 9.46
+ 9.47 9.47
+ 9.48 9.48
+ 9.49 9.49
+ 9.5 9.5
+ 9.51 9.51
+ 9.52 9.52
+ 9.53 9.53
+ 9.54 9.54
+ 9.55 9.55
+ 9.56 9.56
+ 9.57 9.57
+ 9.58 9.58
+ 9.59 9.59
+ 9.6 9.6
+ 9.61 9.61
+ 9.62 9.62
+ 9.63 9.63
+ 9.64 9.64
+ 9.65 9.65
+ 9.66 9.66
+ 9.67 9.67
+ 9.68 9.68
+ 9.69 9.69
+ 9.7 9.7
+ 9.71 9.71
+ 9.72 9.72
+ 9.73 9.73
+ 9.74 9.74
+ 9.75 9.75
+ 9.76 9.76
+ 9.77 9.77
+ 9.78 9.78
+ 9.79 9.79
+ 9.8 9.8
+ 9.81 9.81
+ 9.82 9.82
+ 9.83 9.83
+ 9.84 9.84
+ 9.85 9.85
+ 9.86 9.86
+ 9.87 9.87
+ 9.88 9.88
+ 9.89 9.89
+ 9.9 9.9
+ 9.91 9.91
+ 9.92 9.92
+ 9.93 9.93
+ 9.94 9.94
+ 9.95 9.95
+ 9.96 9.96
+ 9.97 9.97
+ 9.98 9.98
+ 9.99 9.99
+ 10 10
+ 10.01 10.01
+ 10.02 10.02
+ 10.03 10.03
+ 10.04 10.04
+ 10.05 10.05
+ 10.06 10.06
+ 10.07 10.07
+ 10.08 10.08
+ 10.09 10.09
+ 10.1 10.1
+ 10.11 10.11
+ 10.12 10.12
+ 10.13 10.13
+ 10.14 10.14
+ 10.15 10.15
+ 10.16 10.16
+ 10.17 10.17
+ 10.18 10.18
+ 10.19 10.19
+ 10.2 10.2
+ 10.21 10.21
+ 10.22 10.22
+ 10.23 10.23
+ 10.24 10.24
+ 10.25 10.25
+ 10.26 10.26
+ 10.27 10.27
+ 10.28 10.28
+ 10.29 10.29
+ 10.3 10.3
+ 10.31 10.31
+ 10.32 10.32
+ 10.33 10.33
+ 10.34 10.34
+ 10.35 10.35
+ 10.36 10.36
+ 10.37 10.37
+ 10.38 10.38
+ 10.39 10.39
+ 10.4 10.4
+ 10.41 10.41
+ 10.42 10.42
+ 10.43 10.43
+ 10.44 10.44
+ 10.45 10.45
+ 10.46 10.46
+ 10.47 10.47
+ 10.48 10.48
+ 10.49 10.49
+ 10.5 10.5
+ 10.51 10.51
+ 10.52 10.52
+ 10.53 10.53
+ 10.54 10.54
+ 10.55 10.55
+ 10.56 10.56
+ 10.57 10.57
+ 10.58 10.58
+ 10.59 10.59
+ 10.6 10.6
+ 10.61 10.61
+ 10.62 10.62
+ 10.63 10.63
+ 10.64 10.64
+ 10.65 10.65
+ 10.66 10.66
+ 10.67 10.67
+ 10.68 10.68
+ 10.69 10.69
+ 10.7 10.7
+ 10.71 10.71
+ 10.72 10.72
+ 10.73 10.73
+ 10.74 10.74
+ 10.75 10.75
+ 10.76 10.76
+ 10.77 10.77
+ 10.78 10.78
+ 10.79 10.79
+ 10.8 10.8
+ 10.81 10.81
+ 10.82 10.82
+ 10.83 10.83
+ 10.84 10.84
+ 10.85 10.85
+ 10.86 10.86
+ 10.87 10.87
+ 10.88 10.88
+ 10.89 10.89
+ 10.9 10.9
+ 10.91 10.91
+ 10.92 10.92
+ 10.93 10.93
+ 10.94 10.94
+ 10.95 10.95
+ 10.96 10.96
+ 10.97 10.97
+ 10.98 10.98
+ 10.99 10.99
+ 11 11
+ 11.01 11.01
+ 11.02 11.02
+ 11.03 11.03
+ 11.04 11.04
+ 11.05 11.05
+ 11.06 11.06
+ 11.07 11.07
+ 11.08 11.08
+ 11.09 11.09
+ 11.1 11.1
+ 11.11 11.11
+ 11.12 11.12
+ 11.13 11.13
+ 11.14 11.14
+ 11.15 11.15
+ 11.16 11.16
+ 11.17 11.17
+ 11.18 11.18
+ 11.19 11.19
+ 11.2 11.2
+ 11.21 11.21
+ 11.22 11.22
+ 11.23 11.23
+ 11.24 11.24
+ 11.25 11.25
+ 11.26 11.26
+ 11.27 11.27
+ 11.28 11.28
+ 11.29 11.29
+ 11.3 11.3
+ 11.31 11.31
+ 11.32 11.32
+ 11.33 11.33
+ 11.34 11.34
+ 11.35 11.35
+ 11.36 11.36
+ 11.37 11.37
+ 11.38 11.38
+ 11.39 11.39
+ 11.4 11.4
+ 11.41 11.41
+ 11.42 11.42
+ 11.43 11.43
+ 11.44 11.44
+ 11.45 11.45
+ 11.46 11.46
+ 11.47 11.47
+ 11.48 11.48
+ 11.49 11.49
+ 11.5 11.5
+ 11.51 11.51
+ 11.52 11.52
+ 11.53 11.53
+ 11.54 11.54
+ 11.55 11.55
+ 11.56 11.56
+ 11.57 11.57
+ 11.58 11.58
+ 11.59 11.59
+ 11.6 11.6
+ 11.61 11.61
+ 11.62 11.62
+ 11.63 11.63
+ 11.64 11.64
+ 11.65 11.65
+ 11.66 11.66
+ 11.67 11.67
+ 11.68 11.68
+ 11.69 11.69
+ 11.7 11.7
+ 11.71 11.71
+ 11.72 11.72
+ 11.73 11.73
+ 11.74 11.74
+ 11.75 11.75
+ 11.76 11.76
+ 11.77 11.77
+ 11.78 11.78
+ 11.79 11.79
+ 11.8 11.8
+ 11.81 11.81
+ 11.82 11.82
+ 11.83 11.83
+ 11.84 11.84
+ 11.85 11.85
+ 11.86 11.86
+ 11.87 11.87
+ 11.88 11.88
+ 11.89 11.89
+ 11.9 11.9
+ 11.91 11.91
+ 11.92 11.92
+ 11.93 11.93
+ 11.94 11.94
+ 11.95 11.95
+ 11.96 11.96
+ 11.97 11.97
+ 11.98 11.98
+ 11.99 11.99
+ 12 12
+ 12.01 12.01
+ 12.02 12.02
+ 12.03 12.03
+ 12.04 12.04
+ 12.05 12.05
+ 12.06 12.06
+ 12.07 12.07
+ 12.08 12.08
+ 12.09 12.09
+ 12.1 12.1
+ 12.11 12.11
+ 12.12 12.12
+ 12.13 12.13
+ 12.14 12.14
+ 12.15 12.15
+ 12.16 12.16
+ 12.17 12.17
+ 12.18 12.18
+ 12.19 12.19
+ 12.2 12.2
+ 12.21 12.21
+ 12.22 12.22
+ 12.23 12.23
+ 12.24 12.24
+ 12.25 12.25
+ 12.26 12.26
+ 12.27 12.27
+ 12.28 12.28
+ 12.29 12.29
+ 12.3 12.3
+ 12.31 12.31
+ 12.32 12.32
+ 12.33 12.33
+ 12.34 12.34
+ 12.35 12.35
+ 12.36 12.36
+ 12.37 12.37
+ 12.38 12.38
+ 12.39 12.39
+ 12.4 12.4
+ 12.41 12.41
+ 12.42 12.42
+ 12.43 12.43
+ 12.44 12.44
+ 12.45 12.45
+ 12.46 12.46
+ 12.47 12.47
+ 12.48 12.48
+ 12.49 12.49
+ 12.5 12.5
+ 12.51 12.51
+ 12.52 12.52
+ 12.53 12.53
+ 12.54 12.54
+ 12.55 12.55
+ 12.56 12.56
+ 12.57 12.57
+ 12.58 12.58
+ 12.59 12.59
+ 12.6 12.6
+ 12.61 12.61
+ 12.62 12.62
+ 12.63 12.63
+ 12.64 12.64
+ 12.65 12.65
+ 12.66 12.66
+ 12.67 12.67
+ 12.68 12.68
+ 12.69 12.69
+ 12.7 12.7
+ 12.71 12.71
+ 12.72 12.72
+ 12.73 12.73
+ 12.74 12.74
+ 12.75 12.75
+ 12.76 12.76
+ 12.77 12.77
+ 12.78 12.78
+ 12.79 12.79
+ 12.8 12.8
+ 12.81 12.81
+ 12.82 12.82
+ 12.83 12.83
+ 12.84 12.84
+ 12.85 12.85
+ 12.86 12.86
+ 12.87 12.87
+ 12.88 12.88
+ 12.89 12.89
+ 12.9 12.9
+ 12.91 12.91
+ 12.92 12.92
+ 12.93 12.93
+ 12.94 12.94
+ 12.95 12.95
+ 12.96 12.96
+ 12.97 12.97
+ 12.98 12.98
+ 12.99 12.99
+ 13 13
+ 13.01 13.01
+ 13.02 13.02
+ 13.03 13.03
+ 13.04 13.04
+ 13.05 13.05
+ 13.06 13.06
+ 13.07 13.07
+ 13.08 13.08
+ 13.09 13.09
+ 13.1 13.1
+ 13.11 13.11
+ 13.12 13.12
+ 13.13 13.13
+ 13.14 13.14
+ 13.15 13.15
+ 13.16 13.16
+ 13.17 13.17
+ 13.18 13.18
+ 13.19 13.19
+ 13.2 13.2
+ 13.21 13.21
+ 13.22 13.22
+ 13.23 13.23
+ 13.24 13.24
+ 13.25 13.25
+ 13.26 13.26
+ 13.27 13.27
+ 13.28 13.28
+ 13.29 13.29
+ 13.3 13.3
+ 13.31 13.31
+ 13.32 13.32
+ 13.33 13.33
+ 13.34 13.34
+ 13.35 13.35
+ 13.36 13.36
+ 13.37 13.37
+ 13.38 13.38
+ 13.39 13.39
+ 13.4 13.4
+ 13.41 13.41
+ 13.42 13.42
+ 13.43 13.43
+ 13.44 13.44
+ 13.45 13.45
+ 13.46 13.46
+ 13.47 13.47
+ 13.48 13.48
+ 13.49 13.49
+ 13.5 13.5
+ 13.51 13.51
+ 13.52 13.52
+ 13.53 13.53
+ 13.54 13.54
+ 13.55 13.55
+ 13.56 13.56
+ 13.57 13.57
+ 13.58 13.58
+ 13.59 13.59
+ 13.6 13.6
+ 13.61 13.61
+ 13.62 13.62
+ 13.63 13.63
+ 13.64 13.64
+ 13.65 13.65
+ 13.66 13.66
+ 13.67 13.67
+ 13.68 13.68
+ 13.69 13.69
+ 13.7 13.7
+ 13.71 13.71
+ 13.72 13.72
+ 13.73 13.73
+ 13.74 13.74
+ 13.75 13.75
+ 13.76 13.76
+ 13.77 13.77
+ 13.78 13.78
+ 13.79 13.79
+ 13.8 13.8
+ 13.81 13.81
+ 13.82 13.82
+ 13.83 13.83
+ 13.84 13.84
+ 13.85 13.85
+ 13.86 13.86
+ 13.87 13.87
+ 13.88 13.88
+ 13.89 13.89
+ 13.9 13.9
+ 13.91 13.91
+ 13.92 13.92
+ 13.93 13.93
+ 13.94 13.94
+ 13.95 13.95
+ 13.96 13.96
+ 13.97 13.97
+ 13.98 13.98
+ 13.99 13.99
+ 14 14
+ 14.01 14.01
+ 14.02 14.02
+ 14.03 14.03
+ 14.04 14.04
+ 14.05 14.05
+ 14.06 14.06
+ 14.07 14.07
+ 14.08 14.08
+ 14.09 14.09
+ 14.1 14.1
+ 14.11 14.11
+ 14.12 14.12
+ 14.13 14.13
+ 14.14 14.14
+ 14.15 14.15
+ 14.16 14.16
+ 14.17 14.17
+ 14.18 14.18
+ 14.19 14.19
+ 14.2 14.2
+ 14.21 14.21
+ 14.22 14.22
+ 14.23 14.23
+ 14.24 14.24
+ 14.25 14.25
+ 14.26 14.26
+ 14.27 14.27
+ 14.28 14.28
+ 14.29 14.29
+ 14.3 14.3
+ 14.31 14.31
+ 14.32 14.32
+ 14.33 14.33
+ 14.34 14.34
+ 14.35 14.35
+ 14.36 14.36
+ 14.37 14.37
+ 14.38 14.38
+ 14.39 14.39
+ 14.4 14.4
+ 14.41 14.41
+ 14.42 14.42
+ 14.43 14.43
+ 14.44 14.44
+ 14.45 14.45
+ 14.46 14.46
+ 14.47 14.47
+ 14.48 14.48
+ 14.49 14.49
+ 14.5 14.5
+ 14.51 14.51
+ 14.52 14.52
+ 14.53 14.53
+ 14.54 14.54
+ 14.55 14.55
+ 14.56 14.56
+ 14.57 14.57
+ 14.58 14.58
+ 14.59 14.59
+ 14.6 14.6
+ 14.61 14.61
+ 14.62 14.62
+ 14.63 14.63
+ 14.64 14.64
+ 14.65 14.65
+ 14.66 14.66
+ 14.67 14.67
+ 14.68 14.68
+ 14.69 14.69
+ 14.7 14.7
+ 14.71 14.71
+ 14.72 14.72
+ 14.73 14.73
+ 14.74 14.74
+ 14.75 14.75
+ 14.76 14.76
+ 14.77 14.77
+ 14.78 14.78
+ 14.79 14.79
+ 14.8 14.8
+ 14.81 14.81
+ 14.82 14.82
+ 14.83 14.83
+ 14.84 14.84
+ 14.85 14.85
+ 14.86 14.86
+ 14.87 14.87
+ 14.88 14.88
+ 14.89 14.89
+ 14.9 14.9
+ 14.91 14.91
+ 14.92 14.92
+ 14.93 14.93
+ 14.94 14.94
+ 14.95 14.95
+ 14.96 14.96
+ 14.97 14.97
+ 14.98 14.98
+ 14.99 14.99
+ 15 15
+ 15.01 15.01
+ 15.02 15.02
+ 15.03 15.03
+ 15.04 15.04
+ 15.05 15.05
+ 15.06 15.06
+ 15.07 15.07
+ 15.08 15.08
+ 15.09 15.09
+ 15.1 15.1
+ 15.11 15.11
+ 15.12 15.12
+ 15.13 15.13
+ 15.14 15.14
+ 15.15 15.15
+ 15.16 15.16
+ 15.17 15.17
+ 15.18 15.18
+ 15.19 15.19
+ 15.2 15.2
+ 15.21 15.21
+ 15.22 15.22
+ 15.23 15.23
+ 15.24 15.24
+ 15.25 15.25
+ 15.26 15.26
+ 15.27 15.27
+ 15.28 15.28
+ 15.29 15.29
+ 15.3 15.3
+ 15.31 15.31
+ 15.32 15.32
+ 15.33 15.33
+ 15.34 15.34
+ 15.35 15.35
+ 15.36 15.36
+ 15.37 15.37
+ 15.38 15.38
+ 15.39 15.39
+ 15.4 15.4
+ 15.41 15.41
+ 15.42 15.42
+ 15.43 15.43
+ 15.44 15.44
+ 15.45 15.45
+ 15.46 15.46
+ 15.47 15.47
+ 15.48 15.48
+ 15.49 15.49
+ 15.5 15.5
+ 15.51 15.51
+ 15.52 15.52
+ 15.53 15.53
+ 15.54 15.54
+ 15.55 15.55
+ 15.56 15.56
+ 15.57 15.57
+ 15.58 15.58
+ 15.59 15.59
+ 15.6 15.6
+ 15.61 15.61
+ 15.62 15.62
+ 15.63 15.63
+ 15.64 15.64
+ 15.65 15.65
+ 15.66 15.66
+ 15.67 15.67
+ 15.68 15.68
+ 15.69 15.69
+ 15.7 15.7
+ 15.71 15.71
+ 15.72 15.72
+ 15.73 15.73
+ 15.74 15.74
+ 15.75 15.75
+ 15.76 15.76
+ 15.77 15.77
+ 15.78 15.78
+ 15.79 15.79
+ 15.8 15.8
+ 15.81 15.81
+ 15.82 15.82
+ 15.83 15.83
+ 15.84 15.84
+ 15.85 15.85
+ 15.86 15.86
+ 15.87 15.87
+ 15.88 15.88
+ 15.89 15.89
+ 15.9 15.9
+ 15.91 15.91
+ 15.92 15.92
+ 15.93 15.93
+ 15.94 15.94
+ 15.95 15.95
+ 15.96 15.96
+ 15.97 15.97
+ 15.98 15.98
+ 15.99 15.99
+ 16 16
+ 16.01 16.01
+ 16.02 16.02
+ 16.03 16.03
+ 16.04 16.04
+ 16.05 16.05
+ 16.06 16.06
+ 16.07 16.07
+ 16.08 16.08
+ 16.09 16.09
+ 16.1 16.1
+ 16.11 16.11
+ 16.12 16.12
+ 16.13 16.13
+ 16.14 16.14
+ 16.15 16.15
+ 16.16 16.16
+ 16.17 16.17
+ 16.18 16.18
+ 16.19 16.19
+ 16.2 16.2
+ 16.21 16.21
+ 16.22 16.22
+ 16.23 16.23
+ 16.24 16.24
+ 16.25 16.25
+ 16.26 16.26
+ 16.27 16.27
+ 16.28 16.28
+ 16.29 16.29
+ 16.3 16.3
+ 16.31 16.31
+ 16.32 16.32
+ 16.33 16.33
+ 16.34 16.34
+ 16.35 16.35
+ 16.36 16.36
+ 16.37 16.37
+ 16.38 16.38
+ 16.39 16.39
+ 16.4 16.4
+ 16.41 16.41
+ 16.42 16.42
+ 16.43 16.43
+ 16.44 16.44
+ 16.45 16.45
+ 16.46 16.46
+ 16.47 16.47
+ 16.48 16.48
+ 16.49 16.49
+ 16.5 16.5
+ 16.51 16.51
+ 16.52 16.52
+ 16.53 16.53
+ 16.54 16.54
+ 16.55 16.55
+ 16.56 16.56
+ 16.57 16.57
+ 16.58 16.58
+ 16.59 16.59
+ 16.6 16.6
+ 16.61 16.61
+ 16.62 16.62
+ 16.63 16.63
+ 16.64 16.64
+ 16.65 16.65
+ 16.66 16.66
+ 16.67 16.67
+ 16.68 16.68
+ 16.69 16.69
+ 16.7 16.7
+ 16.71 16.71
+ 16.72 16.72
+ 16.73 16.73
+ 16.74 16.74
+ 16.75 16.75
+ 16.76 16.76
+ 16.77 16.77
+ 16.78 16.78
+ 16.79 16.79
+ 16.8 16.8
+ 16.81 16.81
+ 16.82 16.82
+ 16.83 16.83
+ 16.84 16.84
+ 16.85 16.85
+ 16.86 16.86
+ 16.87 16.87
+ 16.88 16.88
+ 16.89 16.89
+ 16.9 16.9
+ 16.91 16.91
+ 16.92 16.92
+ 16.93 16.93
+ 16.94 16.94
+ 16.95 16.95
+ 16.96 16.96
+ 16.97 16.97
+ 16.98 16.98
+ 16.99 16.99
+ 17 17
+ 17.01 17.01
+ 17.02 17.02
+ 17.03 17.03
+ 17.04 17.04
+ 17.05 17.05
+ 17.06 17.06
+ 17.07 17.07
+ 17.08 17.08
+ 17.09 17.09
+ 17.1 17.1
+ 17.11 17.11
+ 17.12 17.12
+ 17.13 17.13
+ 17.14 17.14
+ 17.15 17.15
+ 17.16 17.16
+ 17.17 17.17
+ 17.18 17.18
+ 17.19 17.19
+ 17.2 17.2
+ 17.21 17.21
+ 17.22 17.22
+ 17.23 17.23
+ 17.24 17.24
+ 17.25 17.25
+ 17.26 17.26
+ 17.27 17.27
+ 17.28 17.28
+ 17.29 17.29
+ 17.3 17.3
+ 17.31 17.31
+ 17.32 17.32
+ 17.33 17.33
+ 17.34 17.34
+ 17.35 17.35
+ 17.36 17.36
+ 17.37 17.37
+ 17.38 17.38
+ 17.39 17.39
+ 17.4 17.4
+ 17.41 17.41
+ 17.42 17.42
+ 17.43 17.43
+ 17.44 17.44
+ 17.45 17.45
+ 17.46 17.46
+ 17.47 17.47
+ 17.48 17.48
+ 17.49 17.49
+ 17.5 17.5
+ 17.51 17.51
+ 17.52 17.52
+ 17.53 17.53
+ 17.54 17.54
+ 17.55 17.55
+ 17.56 17.56
+ 17.57 17.57
+ 17.58 17.58
+ 17.59 17.59
+ 17.6 17.6
+ 17.61 17.61
+ 17.62 17.62
+ 17.63 17.63
+ 17.64 17.64
+ 17.65 17.65
+ 17.66 17.66
+ 17.67 17.67
+ 17.68 17.68
+ 17.69 17.69
+ 17.7 17.7
+ 17.71 17.71
+ 17.72 17.72
+ 17.73 17.73
+ 17.74 17.74
+ 17.75 17.75
+ 17.76 17.76
+ 17.77 17.77
+ 17.78 17.78
+ 17.79 17.79
+ 17.8 17.8
+ 17.81 17.81
+ 17.82 17.82
+ 17.83 17.83
+ 17.84 17.84
+ 17.85 17.85
+ 17.86 17.86
+ 17.87 17.87
+ 17.88 17.88
+ 17.89 17.89
+ 17.9 17.9
+ 17.91 17.91
+ 17.92 17.92
+ 17.93 17.93
+ 17.94 17.94
+ 17.95 17.95
+ 17.96 17.96
+ 17.97 17.97
+ 17.98 17.98
+ 17.99 17.99
+ 18 18
+ 18.01 18.01
+ 18.02 18.02
+ 18.03 18.03
+ 18.04 18.04
+ 18.05 18.05
+ 18.06 18.06
+ 18.07 18.07
+ 18.08 18.08
+ 18.09 18.09
+ 18.1 18.1
+ 18.11 18.11
+ 18.12 18.12
+ 18.13 18.13
+ 18.14 18.14
+ 18.15 18.15
+ 18.16 18.16
+ 18.17 18.17
+ 18.18 18.18
+ 18.19 18.19
+ 18.2 18.2
+ 18.21 18.21
+ 18.22 18.22
+ 18.23 18.23
+ 18.24 18.24
+ 18.25 18.25
+ 18.26 18.26
+ 18.27 18.27
+ 18.28 18.28
+ 18.29 18.29
+ 18.3 18.3
+ 18.31 18.31
+ 18.32 18.32
+ 18.33 18.33
+ 18.34 18.34
+ 18.35 18.35
+ 18.36 18.36
+ 18.37 18.37
+ 18.38 18.38
+ 18.39 18.39
+ 18.4 18.4
+ 18.41 18.41
+ 18.42 18.42
+ 18.43 18.43
+ 18.44 18.44
+ 18.45 18.45
+ 18.46 18.46
+ 18.47 18.47
+ 18.48 18.48
+ 18.49 18.49
+ 18.5 18.5
+ 18.51 18.51
+ 18.52 18.52
+ 18.53 18.53
+ 18.54 18.54
+ 18.55 18.55
+ 18.56 18.56
+ 18.57 18.57
+ 18.58 18.58
+ 18.59 18.59
+ 18.6 18.6
+ 18.61 18.61
+ 18.62 18.62
+ 18.63 18.63
+ 18.64 18.64
+ 18.65 18.65
+ 18.66 18.66
+ 18.67 18.67
+ 18.68 18.68
+ 18.69 18.69
+ 18.7 18.7
+ 18.71 18.71
+ 18.72 18.72
+ 18.73 18.73
+ 18.74 18.74
+ 18.75 18.75
+ 18.76 18.76
+ 18.77 18.77
+ 18.78 18.78
+ 18.79 18.79
+ 18.8 18.8
+ 18.81 18.81
+ 18.82 18.82
+ 18.83 18.83
+ 18.84 18.84
+ 18.85 18.85
+ 18.86 18.86
+ 18.87 18.87
+ 18.88 18.88
+ 18.89 18.89
+ 18.9 18.9
+ 18.91 18.91
+ 18.92 18.92
+ 18.93 18.93
+ 18.94 18.94
+ 18.95 18.95
+ 18.96 18.96
+ 18.97 18.97
+ 18.98 18.98
+ 18.99 18.99
+ 19 19
+ 19.01 19.01
+ 19.02 19.02
+ 19.03 19.03
+ 19.04 19.04
+ 19.05 19.05
+ 19.06 19.06
+ 19.07 19.07
+ 19.08 19.08
+ 19.09 19.09
+ 19.1 19.1
+ 19.11 19.11
+ 19.12 19.12
+ 19.13 19.13
+ 19.14 19.14
+ 19.15 19.15
+ 19.16 19.16
+ 19.17 19.17
+ 19.18 19.18
+ 19.19 19.19
+ 19.2 19.2
+ 19.21 19.21
+ 19.22 19.22
+ 19.23 19.23
+ 19.24 19.24
+ 19.25 19.25
+ 19.26 19.26
+ 19.27 19.27
+ 19.28 19.28
+ 19.29 19.29
+ 19.3 19.3
+ 19.31 19.31
+ 19.32 19.32
+ 19.33 19.33
+ 19.34 19.34
+ 19.35 19.35
+ 19.36 19.36
+ 19.37 19.37
+ 19.38 19.38
+ 19.39 19.39
+ 19.4 19.4
+ 19.41 19.41
+ 19.42 19.42
+ 19.43 19.43
+ 19.44 19.44
+ 19.45 19.45
+ 19.46 19.46
+ 19.47 19.47
+ 19.48 19.48
+ 19.49 19.49
+ 19.5 19.5
+ 19.51 19.51
+ 19.52 19.52
+ 19.53 19.53
+ 19.54 19.54
+ 19.55 19.55
+ 19.56 19.56
+ 19.57 19.57
+ 19.58 19.58
+ 19.59 19.59
+ 19.6 19.6
+ 19.61 19.61
+ 19.62 19.62
+ 19.63 19.63
+ 19.64 19.64
+ 19.65 19.65
+ 19.66 19.66
+ 19.67 19.67
+ 19.68 19.68
+ 19.69 19.69
+ 19.7 19.7
+ 19.71 19.71
+ 19.72 19.72
+ 19.73 19.73
+ 19.74 19.74
+ 19.75 19.75
+ 19.76 19.76
+ 19.77 19.77
+ 19.78 19.78
+ 19.79 19.79
+ 19.8 19.8
+ 19.81 19.81
+ 19.82 19.82
+ 19.83 19.83
+ 19.84 19.84
+ 19.85 19.85
+ 19.86 19.86
+ 19.87 19.87
+ 19.88 19.88
+ 19.89 19.89
+ 19.9 19.9
+ 19.91 19.91
+ 19.92 19.92
+ 19.93 19.93
+ 19.94 19.94
+ 19.95 19.95
+ 19.96 19.96
+ 19.97 19.97
+ 19.98 19.98
+ 19.99 19.99
+ 20 20
+&
+ at TARGET S2
+ at TYPE xy
+ 0.01 -16.7294
+ 0.02 -13.4287
+ 0.03 -11.4979
+ 0.04 -10.128
+ 0.05 -9.06539
+ 0.06 -8.19719
+ 0.07 -7.46314
+ 0.08 -6.82728
+ 0.09 -6.26641
+ 0.1 -5.76469
+ 0.11 -5.31083
+ 0.12 -4.89649
+ 0.13 -4.51534
+ 0.14 -4.16244
+ 0.15 -3.8339
+ 0.16 -3.52658
+ 0.17 -3.23789
+ 0.18 -2.96571
+ 0.19 -2.70824
+ 0.2 -2.46399
+ 0.21 -2.23166
+ 0.22 -2.01013
+ 0.23 -1.79846
+ 0.24 -1.59579
+ 0.25 -1.4014
+ 0.26 -1.21464
+ 0.27 -1.03492
+ 0.28 -0.861741
+ 0.29 -0.69464
+ 0.3 -0.533204
+ 0.31 -0.377062
+ 0.32 -0.225877
+ 0.33 -0.0793458
+ 0.34 0.0628112
+ 0.35 0.200847
+ 0.36 0.334994
+ 0.37 0.465465
+ 0.38 0.592457
+ 0.39 0.71615
+ 0.4 0.836711
+ 0.41 0.954295
+ 0.42 1.06904
+ 0.43 1.18109
+ 0.44 1.29057
+ 0.45 1.39758
+ 0.46 1.50224
+ 0.47 1.60465
+ 0.48 1.70491
+ 0.49 1.8031
+ 0.5 1.8993
+ 0.51 1.9936
+ 0.52 2.08606
+ 0.53 2.17677
+ 0.54 2.26578
+ 0.55 2.35316
+ 0.56 2.43896
+ 0.57 2.52324
+ 0.58 2.60606
+ 0.59 2.68746
+ 0.6 2.7675
+ 0.61 2.84621
+ 0.62 2.92364
+ 0.63 2.99983
+ 0.64 3.07482
+ 0.65 3.14865
+ 0.66 3.22136
+ 0.67 3.29296
+ 0.68 3.36351
+ 0.69 3.43303
+ 0.7 3.50155
+ 0.71 3.56909
+ 0.72 3.63569
+ 0.73 3.70138
+ 0.74 3.76617
+ 0.75 3.83009
+ 0.76 3.89316
+ 0.77 3.95541
+ 0.78 4.01685
+ 0.79 4.07751
+ 0.8 4.13741
+ 0.81 4.19657
+ 0.82 4.255
+ 0.83 4.31272
+ 0.84 4.36975
+ 0.85 4.4261
+ 0.86 4.4818
+ 0.87 4.53685
+ 0.88 4.59127
+ 0.89 4.64508
+ 0.9 4.69828
+ 0.91 4.7509
+ 0.92 4.80294
+ 0.93 4.85443
+ 0.94 4.90536
+ 0.95 4.95575
+ 0.96 5.00561
+ 0.97 5.05496
+ 0.98 5.1038
+ 0.99 5.15214
+ 1 5.2
+ 1.01 5.24738
+ 1.02 5.2943
+ 1.03 5.34076
+ 1.04 5.38677
+ 1.05 5.43233
+ 1.06 5.47747
+ 1.07 5.52218
+ 1.08 5.56648
+ 1.09 5.61037
+ 1.1 5.65386
+ 1.11 5.69695
+ 1.12 5.73966
+ 1.13 5.78199
+ 1.14 5.82394
+ 1.15 5.86553
+ 1.16 5.90676
+ 1.17 5.94764
+ 1.18 5.98816
+ 1.19 6.02835
+ 1.2 6.0682
+ 1.21 6.10772
+ 1.22 6.14691
+ 1.23 6.18578
+ 1.24 6.22434
+ 1.25 6.26259
+ 1.26 6.30053
+ 1.27 6.33818
+ 1.28 6.37552
+ 1.29 6.41258
+ 1.3 6.44935
+ 1.31 6.48584
+ 1.32 6.52206
+ 1.33 6.55799
+ 1.34 6.59366
+ 1.35 6.62907
+ 1.36 6.66421
+ 1.37 6.6991
+ 1.38 6.73373
+ 1.39 6.76811
+ 1.4 6.80225
+ 1.41 6.83614
+ 1.42 6.86979
+ 1.43 6.90321
+ 1.44 6.9364
+ 1.45 6.96935
+ 1.46 7.00208
+ 1.47 7.03458
+ 1.48 7.06687
+ 1.49 7.09893
+ 1.5 7.13079
+ 1.51 7.16243
+ 1.52 7.19386
+ 1.53 7.22508
+ 1.54 7.25611
+ 1.55 7.28693
+ 1.56 7.31755
+ 1.57 7.34798
+ 1.58 7.37821
+ 1.59 7.40826
+ 1.6 7.43811
+ 1.61 7.46778
+ 1.62 7.49727
+ 1.63 7.52657
+ 1.64 7.5557
+ 1.65 7.58464
+ 1.66 7.61342
+ 1.67 7.64202
+ 1.68 7.67045
+ 1.69 7.69871
+ 1.7 7.7268
+ 1.71 7.75473
+ 1.72 7.7825
+ 1.73 7.8101
+ 1.74 7.83755
+ 1.75 7.86484
+ 1.76 7.89197
+ 1.77 7.91895
+ 1.78 7.94578
+ 1.79 7.97246
+ 1.8 7.99898
+ 1.81 8.02537
+ 1.82 8.0516
+ 1.83 8.0777
+ 1.84 8.10365
+ 1.85 8.12946
+ 1.86 8.15513
+ 1.87 8.18066
+ 1.88 8.20606
+ 1.89 8.23132
+ 1.9 8.25645
+ 1.91 8.28144
+ 1.92 8.30631
+ 1.93 8.33105
+ 1.94 8.35566
+ 1.95 8.38014
+ 1.96 8.4045
+ 1.97 8.42873
+ 1.98 8.45284
+ 1.99 8.47683
+ 2 8.5007
+ 2.01 8.52445
+ 2.02 8.54808
+ 2.03 8.5716
+ 2.04 8.595
+ 2.05 8.61828
+ 2.06 8.64146
+ 2.07 8.66452
+ 2.08 8.68747
+ 2.09 8.71031
+ 2.1 8.73303
+ 2.11 8.75566
+ 2.12 8.77817
+ 2.13 8.80058
+ 2.14 8.82288
+ 2.15 8.84508
+ 2.16 8.86718
+ 2.17 8.88918
+ 2.18 8.91107
+ 2.19 8.93286
+ 2.2 8.95456
+ 2.21 8.97615
+ 2.22 8.99765
+ 2.23 9.01906
+ 2.24 9.04036
+ 2.25 9.06157
+ 2.26 9.08269
+ 2.27 9.10371
+ 2.28 9.12464
+ 2.29 9.14548
+ 2.3 9.16623
+ 2.31 9.18689
+ 2.32 9.20746
+ 2.33 9.22794
+ 2.34 9.24834
+ 2.35 9.26864
+ 2.36 9.28886
+ 2.37 9.309
+ 2.38 9.32905
+ 2.39 9.34902
+ 2.4 9.3689
+ 2.41 9.3887
+ 2.42 9.40842
+ 2.43 9.42805
+ 2.44 9.44761
+ 2.45 9.46709
+ 2.46 9.48648
+ 2.47 9.5058
+ 2.48 9.52504
+ 2.49 9.5442
+ 2.5 9.56329
+ 2.51 9.5823
+ 2.52 9.60123
+ 2.53 9.62009
+ 2.54 9.63888
+ 2.55 9.65759
+ 2.56 9.67623
+ 2.57 9.69479
+ 2.58 9.71328
+ 2.59 9.7317
+ 2.6 9.75005
+ 2.61 9.76833
+ 2.62 9.78654
+ 2.63 9.80468
+ 2.64 9.82276
+ 2.65 9.84076
+ 2.66 9.8587
+ 2.67 9.87656
+ 2.68 9.89437
+ 2.69 9.9121
+ 2.7 9.92977
+ 2.71 9.94737
+ 2.72 9.96491
+ 2.73 9.98239
+ 2.74 9.9998
+ 2.75 10.0171
+ 2.76 10.0344
+ 2.77 10.0517
+ 2.78 10.0688
+ 2.79 10.0859
+ 2.8 10.1029
+ 2.81 10.1199
+ 2.82 10.1368
+ 2.83 10.1537
+ 2.84 10.1705
+ 2.85 10.1872
+ 2.86 10.2039
+ 2.87 10.2205
+ 2.88 10.2371
+ 2.89 10.2536
+ 2.9 10.2701
+ 2.91 10.2864
+ 2.92 10.3028
+ 2.93 10.3191
+ 2.94 10.3353
+ 2.95 10.3515
+ 2.96 10.3676
+ 2.97 10.3836
+ 2.98 10.3996
+ 2.99 10.4156
+ 3 10.4315
+ 3.01 10.4473
+ 3.02 10.4631
+ 3.03 10.4789
+ 3.04 10.4946
+ 3.05 10.5102
+ 3.06 10.5258
+ 3.07 10.5413
+ 3.08 10.5568
+ 3.09 10.5722
+ 3.1 10.5876
+ 3.11 10.603
+ 3.12 10.6183
+ 3.13 10.6335
+ 3.14 10.6487
+ 3.15 10.6638
+ 3.16 10.6789
+ 3.17 10.694
+ 3.18 10.709
+ 3.19 10.7239
+ 3.2 10.7388
+ 3.21 10.7537
+ 3.22 10.7685
+ 3.23 10.7832
+ 3.24 10.798
+ 3.25 10.8126
+ 3.26 10.8273
+ 3.27 10.8419
+ 3.28 10.8564
+ 3.29 10.8709
+ 3.3 10.8853
+ 3.31 10.8998
+ 3.32 10.9141
+ 3.33 10.9284
+ 3.34 10.9427
+ 3.35 10.957
+ 3.36 10.9711
+ 3.37 10.9853
+ 3.38 10.9994
+ 3.39 11.0135
+ 3.4 11.0275
+ 3.41 11.0415
+ 3.42 11.0554
+ 3.43 11.0693
+ 3.44 11.0832
+ 3.45 11.097
+ 3.46 11.1108
+ 3.47 11.1245
+ 3.48 11.1382
+ 3.49 11.1519
+ 3.5 11.1655
+ 3.51 11.1791
+ 3.52 11.1927
+ 3.53 11.2062
+ 3.54 11.2197
+ 3.55 11.2331
+ 3.56 11.2465
+ 3.57 11.2598
+ 3.58 11.2732
+ 3.59 11.2864
+ 3.6 11.2997
+ 3.61 11.3129
+ 3.62 11.3261
+ 3.63 11.3392
+ 3.64 11.3523
+ 3.65 11.3654
+ 3.66 11.3784
+ 3.67 11.3914
+ 3.68 11.4043
+ 3.69 11.4173
+ 3.7 11.4302
+ 3.71 11.443
+ 3.72 11.4558
+ 3.73 11.4686
+ 3.74 11.4814
+ 3.75 11.4941
+ 3.76 11.5068
+ 3.77 11.5194
+ 3.78 11.532
+ 3.79 11.5446
+ 3.8 11.5571
+ 3.81 11.5697
+ 3.82 11.5821
+ 3.83 11.5946
+ 3.84 11.607
+ 3.85 11.6194
+ 3.86 11.6317
+ 3.87 11.6441
+ 3.88 11.6564
+ 3.89 11.6686
+ 3.9 11.6808
+ 3.91 11.693
+ 3.92 11.7052
+ 3.93 11.7173
+ 3.94 11.7294
+ 3.95 11.7415
+ 3.96 11.7535
+ 3.97 11.7656
+ 3.98 11.7775
+ 3.99 11.7895
+ 4 11.8014
+ 4.01 11.8133
+ 4.02 11.8252
+ 4.03 11.837
+ 4.04 11.8488
+ 4.05 11.8606
+ 4.06 11.8723
+ 4.07 11.884
+ 4.08 11.8957
+ 4.09 11.9074
+ 4.1 11.919
+ 4.11 11.9306
+ 4.12 11.9422
+ 4.13 11.9537
+ 4.14 11.9652
+ 4.15 11.9767
+ 4.16 11.9882
+ 4.17 11.9996
+ 4.18 12.011
+ 4.19 12.0224
+ 4.2 12.0337
+ 4.21 12.0451
+ 4.22 12.0564
+ 4.23 12.0676
+ 4.24 12.0789
+ 4.25 12.0901
+ 4.26 12.1013
+ 4.27 12.1124
+ 4.28 12.1236
+ 4.29 12.1347
+ 4.3 12.1458
+ 4.31 12.1568
+ 4.32 12.1679
+ 4.33 12.1789
+ 4.34 12.1899
+ 4.35 12.2008
+ 4.36 12.2118
+ 4.37 12.2227
+ 4.38 12.2336
+ 4.39 12.2444
+ 4.4 12.2553
+ 4.41 12.2661
+ 4.42 12.2769
+ 4.43 12.2876
+ 4.44 12.2984
+ 4.45 12.3091
+ 4.46 12.3198
+ 4.47 12.3304
+ 4.48 12.3411
+ 4.49 12.3517
+ 4.5 12.3623
+ 4.51 12.3728
+ 4.52 12.3834
+ 4.53 12.3939
+ 4.54 12.4044
+ 4.55 12.4149
+ 4.56 12.4253
+ 4.57 12.4358
+ 4.58 12.4462
+ 4.59 12.4566
+ 4.6 12.4669
+ 4.61 12.4773
+ 4.62 12.4876
+ 4.63 12.4979
+ 4.64 12.5082
+ 4.65 12.5184
+ 4.66 12.5286
+ 4.67 12.5389
+ 4.68 12.549
+ 4.69 12.5592
+ 4.7 12.5693
+ 4.71 12.5795
+ 4.72 12.5896
+ 4.73 12.5996
+ 4.74 12.6097
+ 4.75 12.6197
+ 4.76 12.6298
+ 4.77 12.6397
+ 4.78 12.6497
+ 4.79 12.6597
+ 4.8 12.6696
+ 4.81 12.6795
+ 4.82 12.6894
+ 4.83 12.6993
+ 4.84 12.7091
+ 4.85 12.7189
+ 4.86 12.7288
+ 4.87 12.7385
+ 4.88 12.7483
+ 4.89 12.7581
+ 4.9 12.7678
+ 4.91 12.7775
+ 4.92 12.7872
+ 4.93 12.7969
+ 4.94 12.8065
+ 4.95 12.8161
+ 4.96 12.8257
+ 4.97 12.8353
+ 4.98 12.8449
+ 4.99 12.8545
+ 5 12.864
+ 5.01 12.8735
+ 5.02 12.883
+ 5.03 12.8925
+ 5.04 12.9019
+ 5.05 12.9114
+ 5.06 12.9208
+ 5.07 12.9302
+ 5.08 12.9396
+ 5.09 12.9489
+ 5.1 12.9583
+ 5.11 12.9676
+ 5.12 12.9769
+ 5.13 12.9862
+ 5.14 12.9955
+ 5.15 13.0047
+ 5.16 13.014
+ 5.17 13.0232
+ 5.18 13.0324
+ 5.19 13.0416
+ 5.2 13.0508
+ 5.21 13.0599
+ 5.22 13.069
+ 5.23 13.0781
+ 5.24 13.0872
+ 5.25 13.0963
+ 5.26 13.1054
+ 5.27 13.1144
+ 5.28 13.1235
+ 5.29 13.1325
+ 5.3 13.1415
+ 5.31 13.1504
+ 5.32 13.1594
+ 5.33 13.1683
+ 5.34 13.1773
+ 5.35 13.1862
+ 5.36 13.1951
+ 5.37 13.2039
+ 5.38 13.2128
+ 5.39 13.2216
+ 5.4 13.2305
+ 5.41 13.2393
+ 5.42 13.2481
+ 5.43 13.2569
+ 5.44 13.2656
+ 5.45 13.2744
+ 5.46 13.2831
+ 5.47 13.2918
+ 5.48 13.3005
+ 5.49 13.3092
+ 5.5 13.3178
+ 5.51 13.3265
+ 5.52 13.3351
+ 5.53 13.3438
+ 5.54 13.3524
+ 5.55 13.3609
+ 5.56 13.3695
+ 5.57 13.3781
+ 5.58 13.3866
+ 5.59 13.3951
+ 5.6 13.4037
+ 5.61 13.4121
+ 5.62 13.4206
+ 5.63 13.4291
+ 5.64 13.4375
+ 5.65 13.446
+ 5.66 13.4544
+ 5.67 13.4628
+ 5.68 13.4712
+ 5.69 13.4796
+ 5.7 13.4879
+ 5.71 13.4963
+ 5.72 13.5046
+ 5.73 13.5129
+ 5.74 13.5212
+ 5.75 13.5295
+ 5.76 13.5378
+ 5.77 13.5461
+ 5.78 13.5543
+ 5.79 13.5625
+ 5.8 13.5708
+ 5.81 13.579
+ 5.82 13.5871
+ 5.83 13.5953
+ 5.84 13.6035
+ 5.85 13.6116
+ 5.86 13.6198
+ 5.87 13.6279
+ 5.88 13.636
+ 5.89 13.6441
+ 5.9 13.6522
+ 5.91 13.6602
+ 5.92 13.6683
+ 5.93 13.6763
+ 5.94 13.6843
+ 5.95 13.6923
+ 5.96 13.7003
+ 5.97 13.7083
+ 5.98 13.7163
+ 5.99 13.7242
+ 6 13.7322
+ 6.01 13.7401
+ 6.02 13.748
+ 6.03 13.7559
+ 6.04 13.7638
+ 6.05 13.7717
+ 6.06 13.7796
+ 6.07 13.7874
+ 6.08 13.7953
+ 6.09 13.8031
+ 6.1 13.8109
+ 6.11 13.8187
+ 6.12 13.8265
+ 6.13 13.8343
+ 6.14 13.842
+ 6.15 13.8498
+ 6.16 13.8575
+ 6.17 13.8652
+ 6.18 13.8729
+ 6.19 13.8806
+ 6.2 13.8883
+ 6.21 13.896
+ 6.22 13.9037
+ 6.23 13.9113
+ 6.24 13.919
+ 6.25 13.9266
+ 6.26 13.9342
+ 6.27 13.9418
+ 6.28 13.9494
+ 6.29 13.957
+ 6.3 13.9645
+ 6.31 13.9721
+ 6.32 13.9796
+ 6.33 13.9871
+ 6.34 13.9947
+ 6.35 14.0022
+ 6.36 14.0097
+ 6.37 14.0171
+ 6.38 14.0246
+ 6.39 14.0321
+ 6.4 14.0395
+ 6.41 14.0469
+ 6.42 14.0544
+ 6.43 14.0618
+ 6.44 14.0692
+ 6.45 14.0766
+ 6.46 14.0839
+ 6.47 14.0913
+ 6.48 14.0987
+ 6.49 14.106
+ 6.5 14.1133
+ 6.51 14.1207
+ 6.52 14.128
+ 6.53 14.1353
+ 6.54 14.1426
+ 6.55 14.1498
+ 6.56 14.1571
+ 6.57 14.1644
+ 6.58 14.1716
+ 6.59 14.1788
+ 6.6 14.186
+ 6.61 14.1933
+ 6.62 14.2005
+ 6.63 14.2076
+ 6.64 14.2148
+ 6.65 14.222
+ 6.66 14.2291
+ 6.67 14.2363
+ 6.68 14.2434
+ 6.69 14.2505
+ 6.7 14.2577
+ 6.71 14.2648
+ 6.72 14.2718
+ 6.73 14.2789
+ 6.74 14.286
+ 6.75 14.2931
+ 6.76 14.3001
+ 6.77 14.3071
+ 6.78 14.3142
+ 6.79 14.3212
+ 6.8 14.3282
+ 6.81 14.3352
+ 6.82 14.3422
+ 6.83 14.3492
+ 6.84 14.3561
+ 6.85 14.3631
+ 6.86 14.37
+ 6.87 14.377
+ 6.88 14.3839
+ 6.89 14.3908
+ 6.9 14.3977
+ 6.91 14.4046
+ 6.92 14.4115
+ 6.93 14.4184
+ 6.94 14.4252
+ 6.95 14.4321
+ 6.96 14.4389
+ 6.97 14.4458
+ 6.98 14.4526
+ 6.99 14.4594
+ 7 14.4662
+ 7.01 14.473
+ 7.02 14.4798
+ 7.03 14.4866
+ 7.04 14.4934
+ 7.05 14.5001
+ 7.06 14.5069
+ 7.07 14.5136
+ 7.08 14.5204
+ 7.09 14.5271
+ 7.1 14.5338
+ 7.11 14.5405
+ 7.12 14.5472
+ 7.13 14.5539
+ 7.14 14.5605
+ 7.15 14.5672
+ 7.16 14.5739
+ 7.17 14.5805
+ 7.18 14.5871
+ 7.19 14.5938
+ 7.2 14.6004
+ 7.21 14.607
+ 7.22 14.6136
+ 7.23 14.6202
+ 7.24 14.6268
+ 7.25 14.6333
+ 7.26 14.6399
+ 7.27 14.6465
+ 7.28 14.653
+ 7.29 14.6595
+ 7.3 14.6661
+ 7.31 14.6726
+ 7.32 14.6791
+ 7.33 14.6856
+ 7.34 14.6921
+ 7.35 14.6986
+ 7.36 14.705
+ 7.37 14.7115
+ 7.38 14.718
+ 7.39 14.7244
+ 7.4 14.7309
+ 7.41 14.7373
+ 7.42 14.7437
+ 7.43 14.7501
+ 7.44 14.7565
+ 7.45 14.7629
+ 7.46 14.7693
+ 7.47 14.7757
+ 7.48 14.7821
+ 7.49 14.7884
+ 7.5 14.7948
+ 7.51 14.8011
+ 7.52 14.8075
+ 7.53 14.8138
+ 7.54 14.8201
+ 7.55 14.8264
+ 7.56 14.8327
+ 7.57 14.839
+ 7.58 14.8453
+ 7.59 14.8516
+ 7.6 14.8578
+ 7.61 14.8641
+ 7.62 14.8704
+ 7.63 14.8766
+ 7.64 14.8828
+ 7.65 14.8891
+ 7.66 14.8953
+ 7.67 14.9015
+ 7.68 14.9077
+ 7.69 14.9139
+ 7.7 14.9201
+ 7.71 14.9263
+ 7.72 14.9324
+ 7.73 14.9386
+ 7.74 14.9448
+ 7.75 14.9509
+ 7.76 14.9571
+ 7.77 14.9632
+ 7.78 14.9693
+ 7.79 14.9754
+ 7.8 14.9815
+ 7.81 14.9876
+ 7.82 14.9937
+ 7.83 14.9998
+ 7.84 15.0059
+ 7.85 15.012
+ 7.86 15.018
+ 7.87 15.0241
+ 7.88 15.0301
+ 7.89 15.0362
+ 7.9 15.0422
+ 7.91 15.0482
+ 7.92 15.0542
+ 7.93 15.0603
+ 7.94 15.0663
+ 7.95 15.0722
+ 7.96 15.0782
+ 7.97 15.0842
+ 7.98 15.0902
+ 7.99 15.0961
+ 8 15.1021
+ 8.01 15.1081
+ 8.02 15.114
+ 8.03 15.1199
+ 8.04 15.1259
+ 8.05 15.1318
+ 8.06 15.1377
+ 8.07 15.1436
+ 8.08 15.1495
+ 8.09 15.1554
+ 8.1 15.1613
+ 8.11 15.1671
+ 8.12 15.173
+ 8.13 15.1789
+ 8.14 15.1847
+ 8.15 15.1906
+ 8.16 15.1964
+ 8.17 15.2022
+ 8.18 15.2081
+ 8.19 15.2139
+ 8.2 15.2197
+ 8.21 15.2255
+ 8.22 15.2313
+ 8.23 15.2371
+ 8.24 15.2429
+ 8.25 15.2486
+ 8.26 15.2544
+ 8.27 15.2602
+ 8.28 15.2659
+ 8.29 15.2717
+ 8.3 15.2774
+ 8.31 15.2831
+ 8.32 15.2889
+ 8.33 15.2946
+ 8.34 15.3003
+ 8.35 15.306
+ 8.36 15.3117
+ 8.37 15.3174
+ 8.38 15.3231
+ 8.39 15.3288
+ 8.4 15.3344
+ 8.41 15.3401
+ 8.42 15.3458
+ 8.43 15.3514
+ 8.44 15.3571
+ 8.45 15.3627
+ 8.46 15.3683
+ 8.47 15.374
+ 8.48 15.3796
+ 8.49 15.3852
+ 8.5 15.3908
+ 8.51 15.3964
+ 8.52 15.402
+ 8.53 15.4076
+ 8.54 15.4131
+ 8.55 15.4187
+ 8.56 15.4243
+ 8.57 15.4298
+ 8.58 15.4354
+ 8.59 15.4409
+ 8.6 15.4465
+ 8.61 15.452
+ 8.62 15.4575
+ 8.63 15.4631
+ 8.64 15.4686
+ 8.65 15.4741
+ 8.66 15.4796
+ 8.67 15.4851
+ 8.68 15.4906
+ 8.69 15.4961
+ 8.7 15.5015
+ 8.71 15.507
+ 8.72 15.5125
+ 8.73 15.5179
+ 8.74 15.5234
+ 8.75 15.5288
+ 8.76 15.5343
+ 8.77 15.5397
+ 8.78 15.5451
+ 8.79 15.5505
+ 8.8 15.556
+ 8.81 15.5614
+ 8.82 15.5668
+ 8.83 15.5722
+ 8.84 15.5776
+ 8.85 15.5829
+ 8.86 15.5883
+ 8.87 15.5937
+ 8.88 15.5991
+ 8.89 15.6044
+ 8.9 15.6098
+ 8.91 15.6151
+ 8.92 15.6205
+ 8.93 15.6258
+ 8.94 15.6311
+ 8.95 15.6364
+ 8.96 15.6418
+ 8.97 15.6471
+ 8.98 15.6524
+ 8.99 15.6577
+ 9 15.663
+ 9.01 15.6683
+ 9.02 15.6735
+ 9.03 15.6788
+ 9.04 15.6841
+ 9.05 15.6894
+ 9.06 15.6946
+ 9.07 15.6999
+ 9.08 15.7051
+ 9.09 15.7104
+ 9.1 15.7156
+ 9.11 15.7208
+ 9.12 15.726
+ 9.13 15.7313
+ 9.14 15.7365
+ 9.15 15.7417
+ 9.16 15.7469
+ 9.17 15.7521
+ 9.18 15.7573
+ 9.19 15.7625
+ 9.2 15.7676
+ 9.21 15.7728
+ 9.22 15.778
+ 9.23 15.7831
+ 9.24 15.7883
+ 9.25 15.7934
+ 9.26 15.7986
+ 9.27 15.8037
+ 9.28 15.8089
+ 9.29 15.814
+ 9.3 15.8191
+ 9.31 15.8242
+ 9.32 15.8293
+ 9.33 15.8345
+ 9.34 15.8396
+ 9.35 15.8446
+ 9.36 15.8497
+ 9.37 15.8548
+ 9.38 15.8599
+ 9.39 15.865
+ 9.4 15.87
+ 9.41 15.8751
+ 9.42 15.8802
+ 9.43 15.8852
+ 9.44 15.8903
+ 9.45 15.8953
+ 9.46 15.9003
+ 9.47 15.9054
+ 9.48 15.9104
+ 9.49 15.9154
+ 9.5 15.9204
+ 9.51 15.9254
+ 9.52 15.9305
+ 9.53 15.9355
+ 9.54 15.9404
+ 9.55 15.9454
+ 9.56 15.9504
+ 9.57 15.9554
+ 9.58 15.9604
+ 9.59 15.9653
+ 9.6 15.9703
+ 9.61 15.9753
+ 9.62 15.9802
+ 9.63 15.9852
+ 9.64 15.9901
+ 9.65 15.995
+ 9.66 16
+ 9.67 16.0049
+ 9.68 16.0098
+ 9.69 16.0147
+ 9.7 16.0196
+ 9.71 16.0246
+ 9.72 16.0295
+ 9.73 16.0344
+ 9.74 16.0392
+ 9.75 16.0441
+ 9.76 16.049
+ 9.77 16.0539
+ 9.78 16.0588
+ 9.79 16.0636
+ 9.8 16.0685
+ 9.81 16.0733
+ 9.82 16.0782
+ 9.83 16.083
+ 9.84 16.0879
+ 9.85 16.0927
+ 9.86 16.0976
+ 9.87 16.1024
+ 9.88 16.1072
+ 9.89 16.112
+ 9.9 16.1168
+ 9.91 16.1216
+ 9.92 16.1264
+ 9.93 16.1312
+ 9.94 16.136
+ 9.95 16.1408
+ 9.96 16.1456
+ 9.97 16.1504
+ 9.98 16.1552
+ 9.99 16.1599
+ 10 16.1647
+ 10.01 16.1695
+ 10.02 16.1742
+ 10.03 16.179
+ 10.04 16.1837
+ 10.05 16.1884
+ 10.06 16.1932
+ 10.07 16.1979
+ 10.08 16.2026
+ 10.09 16.2074
+ 10.1 16.2121
+ 10.11 16.2168
+ 10.12 16.2215
+ 10.13 16.2262
+ 10.14 16.2309
+ 10.15 16.2356
+ 10.16 16.2403
+ 10.17 16.245
+ 10.18 16.2496
+ 10.19 16.2543
+ 10.2 16.259
+ 10.21 16.2637
+ 10.22 16.2683
+ 10.23 16.273
+ 10.24 16.2776
+ 10.25 16.2823
+ 10.26 16.2869
+ 10.27 16.2916
+ 10.28 16.2962
+ 10.29 16.3008
+ 10.3 16.3054
+ 10.31 16.3101
+ 10.32 16.3147
+ 10.33 16.3193
+ 10.34 16.3239
+ 10.35 16.3285
+ 10.36 16.3331
+ 10.37 16.3377
+ 10.38 16.3423
+ 10.39 16.3469
+ 10.4 16.3515
+ 10.41 16.356
+ 10.42 16.3606
+ 10.43 16.3652
+ 10.44 16.3697
+ 10.45 16.3743
+ 10.46 16.3788
+ 10.47 16.3834
+ 10.48 16.3879
+ 10.49 16.3925
+ 10.5 16.397
+ 10.51 16.4016
+ 10.52 16.4061
+ 10.53 16.4106
+ 10.54 16.4151
+ 10.55 16.4196
+ 10.56 16.4242
+ 10.57 16.4287
+ 10.58 16.4332
+ 10.59 16.4377
+ 10.6 16.4422
+ 10.61 16.4467
+ 10.62 16.4511
+ 10.63 16.4556
+ 10.64 16.4601
+ 10.65 16.4646
+ 10.66 16.469
+ 10.67 16.4735
+ 10.68 16.478
+ 10.69 16.4824
+ 10.7 16.4869
+ 10.71 16.4913
+ 10.72 16.4958
+ 10.73 16.5002
+ 10.74 16.5046
+ 10.75 16.5091
+ 10.76 16.5135
+ 10.77 16.5179
+ 10.78 16.5223
+ 10.79 16.5268
+ 10.8 16.5312
+ 10.81 16.5356
+ 10.82 16.54
+ 10.83 16.5444
+ 10.84 16.5488
+ 10.85 16.5532
+ 10.86 16.5576
+ 10.87 16.5619
+ 10.88 16.5663
+ 10.89 16.5707
+ 10.9 16.5751
+ 10.91 16.5794
+ 10.92 16.5838
+ 10.93 16.5881
+ 10.94 16.5925
+ 10.95 16.5969
+ 10.96 16.6012
+ 10.97 16.6055
+ 10.98 16.6099
+ 10.99 16.6142
+ 11 16.6185
+ 11.01 16.6229
+ 11.02 16.6272
+ 11.03 16.6315
+ 11.04 16.6358
+ 11.05 16.6401
+ 11.06 16.6445
+ 11.07 16.6488
+ 11.08 16.6531
+ 11.09 16.6574
+ 11.1 16.6616
+ 11.11 16.6659
+ 11.12 16.6702
+ 11.13 16.6745
+ 11.14 16.6788
+ 11.15 16.683
+ 11.16 16.6873
+ 11.17 16.6916
+ 11.18 16.6958
+ 11.19 16.7001
+ 11.2 16.7044
+ 11.21 16.7086
+ 11.22 16.7128
+ 11.23 16.7171
+ 11.24 16.7213
+ 11.25 16.7256
+ 11.26 16.7298
+ 11.27 16.734
+ 11.28 16.7382
+ 11.29 16.7425
+ 11.3 16.7467
+ 11.31 16.7509
+ 11.32 16.7551
+ 11.33 16.7593
+ 11.34 16.7635
+ 11.35 16.7677
+ 11.36 16.7719
+ 11.37 16.7761
+ 11.38 16.7803
+ 11.39 16.7845
+ 11.4 16.7886
+ 11.41 16.7928
+ 11.42 16.797
+ 11.43 16.8011
+ 11.44 16.8053
+ 11.45 16.8095
+ 11.46 16.8136
+ 11.47 16.8178
+ 11.48 16.8219
+ 11.49 16.8261
+ 11.5 16.8302
+ 11.51 16.8344
+ 11.52 16.8385
+ 11.53 16.8426
+ 11.54 16.8468
+ 11.55 16.8509
+ 11.56 16.855
+ 11.57 16.8591
+ 11.58 16.8632
+ 11.59 16.8673
+ 11.6 16.8715
+ 11.61 16.8756
+ 11.62 16.8797
+ 11.63 16.8838
+ 11.64 16.8878
+ 11.65 16.8919
+ 11.66 16.896
+ 11.67 16.9001
+ 11.68 16.9042
+ 11.69 16.9083
+ 11.7 16.9123
+ 11.71 16.9164
+ 11.72 16.9205
+ 11.73 16.9245
+ 11.74 16.9286
+ 11.75 16.9326
+ 11.76 16.9367
+ 11.77 16.9407
+ 11.78 16.9448
+ 11.79 16.9488
+ 11.8 16.9529
+ 11.81 16.9569
+ 11.82 16.9609
+ 11.83 16.9649
+ 11.84 16.969
+ 11.85 16.973
+ 11.86 16.977
+ 11.87 16.981
+ 11.88 16.985
+ 11.89 16.989
+ 11.9 16.993
+ 11.91 16.997
+ 11.92 17.001
+ 11.93 17.005
+ 11.94 17.009
+ 11.95 17.013
+ 11.96 17.017
+ 11.97 17.021
+ 11.98 17.0249
+ 11.99 17.0289
+ 12 17.0329
+ 12.01 17.0369
+ 12.02 17.0408
+ 12.03 17.0448
+ 12.04 17.0487
+ 12.05 17.0527
+ 12.06 17.0566
+ 12.07 17.0606
+ 12.08 17.0645
+ 12.09 17.0685
+ 12.1 17.0724
+ 12.11 17.0763
+ 12.12 17.0803
+ 12.13 17.0842
+ 12.14 17.0881
+ 12.15 17.092
+ 12.16 17.096
+ 12.17 17.0999
+ 12.18 17.1038
+ 12.19 17.1077
+ 12.2 17.1116
+ 12.21 17.1155
+ 12.22 17.1194
+ 12.23 17.1233
+ 12.24 17.1272
+ 12.25 17.1311
+ 12.26 17.135
+ 12.27 17.1388
+ 12.28 17.1427
+ 12.29 17.1466
+ 12.3 17.1505
+ 12.31 17.1543
+ 12.32 17.1582
+ 12.33 17.1621
+ 12.34 17.1659
+ 12.35 17.1698
+ 12.36 17.1736
+ 12.37 17.1775
+ 12.38 17.1813
+ 12.39 17.1852
+ 12.4 17.189
+ 12.41 17.1929
+ 12.42 17.1967
+ 12.43 17.2005
+ 12.44 17.2044
+ 12.45 17.2082
+ 12.46 17.212
+ 12.47 17.2158
+ 12.48 17.2197
+ 12.49 17.2235
+ 12.5 17.2273
+ 12.51 17.2311
+ 12.52 17.2349
+ 12.53 17.2387
+ 12.54 17.2425
+ 12.55 17.2463
+ 12.56 17.2501
+ 12.57 17.2539
+ 12.58 17.2577
+ 12.59 17.2614
+ 12.6 17.2652
+ 12.61 17.269
+ 12.62 17.2728
+ 12.63 17.2765
+ 12.64 17.2803
+ 12.65 17.2841
+ 12.66 17.2878
+ 12.67 17.2916
+ 12.68 17.2954
+ 12.69 17.2991
+ 12.7 17.3029
+ 12.71 17.3066
+ 12.72 17.3104
+ 12.73 17.3141
+ 12.74 17.3178
+ 12.75 17.3216
+ 12.76 17.3253
+ 12.77 17.329
+ 12.78 17.3328
+ 12.79 17.3365
+ 12.8 17.3402
+ 12.81 17.3439
+ 12.82 17.3476
+ 12.83 17.3514
+ 12.84 17.3551
+ 12.85 17.3588
+ 12.86 17.3625
+ 12.87 17.3662
+ 12.88 17.3699
+ 12.89 17.3736
+ 12.9 17.3773
+ 12.91 17.381
+ 12.92 17.3846
+ 12.93 17.3883
+ 12.94 17.392
+ 12.95 17.3957
+ 12.96 17.3994
+ 12.97 17.403
+ 12.98 17.4067
+ 12.99 17.4104
+ 13 17.414
+ 13.01 17.4177
+ 13.02 17.4214
+ 13.03 17.425
+ 13.04 17.4287
+ 13.05 17.4323
+ 13.06 17.436
+ 13.07 17.4396
+ 13.08 17.4433
+ 13.09 17.4469
+ 13.1 17.4505
+ 13.11 17.4542
+ 13.12 17.4578
+ 13.13 17.4614
+ 13.14 17.4651
+ 13.15 17.4687
+ 13.16 17.4723
+ 13.17 17.4759
+ 13.18 17.4795
+ 13.19 17.4831
+ 13.2 17.4867
+ 13.21 17.4904
+ 13.22 17.494
+ 13.23 17.4976
+ 13.24 17.5012
+ 13.25 17.5048
+ 13.26 17.5083
+ 13.27 17.5119
+ 13.28 17.5155
+ 13.29 17.5191
+ 13.3 17.5227
+ 13.31 17.5263
+ 13.32 17.5298
+ 13.33 17.5334
+ 13.34 17.537
+ 13.35 17.5406
+ 13.36 17.5441
+ 13.37 17.5477
+ 13.38 17.5512
+ 13.39 17.5548
+ 13.4 17.5584
+ 13.41 17.5619
+ 13.42 17.5655
+ 13.43 17.569
+ 13.44 17.5725
+ 13.45 17.5761
+ 13.46 17.5796
+ 13.47 17.5832
+ 13.48 17.5867
+ 13.49 17.5902
+ 13.5 17.5938
+ 13.51 17.5973
+ 13.52 17.6008
+ 13.53 17.6043
+ 13.54 17.6078
+ 13.55 17.6114
+ 13.56 17.6149
+ 13.57 17.6184
+ 13.58 17.6219
+ 13.59 17.6254
+ 13.6 17.6289
+ 13.61 17.6324
+ 13.62 17.6359
+ 13.63 17.6394
+ 13.64 17.6429
+ 13.65 17.6464
+ 13.66 17.6499
+ 13.67 17.6534
+ 13.68 17.6568
+ 13.69 17.6603
+ 13.7 17.6638
+ 13.71 17.6673
+ 13.72 17.6707
+ 13.73 17.6742
+ 13.74 17.6777
+ 13.75 17.6811
+ 13.76 17.6846
+ 13.77 17.6881
+ 13.78 17.6915
+ 13.79 17.695
+ 13.8 17.6984
+ 13.81 17.7019
+ 13.82 17.7053
+ 13.83 17.7088
+ 13.84 17.7122
+ 13.85 17.7156
+ 13.86 17.7191
+ 13.87 17.7225
+ 13.88 17.7259
+ 13.89 17.7294
+ 13.9 17.7328
+ 13.91 17.7362
+ 13.92 17.7397
+ 13.93 17.7431
+ 13.94 17.7465
+ 13.95 17.7499
+ 13.96 17.7533
+ 13.97 17.7567
+ 13.98 17.7601
+ 13.99 17.7635
+ 14 17.7669
+ 14.01 17.7703
+ 14.02 17.7737
+ 14.03 17.7771
+ 14.04 17.7805
+ 14.05 17.7839
+ 14.06 17.7873
+ 14.07 17.7907
+ 14.08 17.7941
+ 14.09 17.7975
+ 14.1 17.8008
+ 14.11 17.8042
+ 14.12 17.8076
+ 14.13 17.811
+ 14.14 17.8143
+ 14.15 17.8177
+ 14.16 17.8211
+ 14.17 17.8244
+ 14.18 17.8278
+ 14.19 17.8311
+ 14.2 17.8345
+ 14.21 17.8378
+ 14.22 17.8412
+ 14.23 17.8445
+ 14.24 17.8479
+ 14.25 17.8512
+ 14.26 17.8546
+ 14.27 17.8579
+ 14.28 17.8612
+ 14.29 17.8646
+ 14.3 17.8679
+ 14.31 17.8712
+ 14.32 17.8746
+ 14.33 17.8779
+ 14.34 17.8812
+ 14.35 17.8845
+ 14.36 17.8878
+ 14.37 17.8912
+ 14.38 17.8945
+ 14.39 17.8978
+ 14.4 17.9011
+ 14.41 17.9044
+ 14.42 17.9077
+ 14.43 17.911
+ 14.44 17.9143
+ 14.45 17.9176
+ 14.46 17.9209
+ 14.47 17.9242
+ 14.48 17.9275
+ 14.49 17.9308
+ 14.5 17.934
+ 14.51 17.9373
+ 14.52 17.9406
+ 14.53 17.9439
+ 14.54 17.9472
+ 14.55 17.9504
+ 14.56 17.9537
+ 14.57 17.957
+ 14.58 17.9602
+ 14.59 17.9635
+ 14.6 17.9668
+ 14.61 17.97
+ 14.62 17.9733
+ 14.63 17.9765
+ 14.64 17.9798
+ 14.65 17.983
+ 14.66 17.9863
+ 14.67 17.9895
+ 14.68 17.9928
+ 14.69 17.996
+ 14.7 17.9993
+ 14.71 18.0025
+ 14.72 18.0057
+ 14.73 18.009
+ 14.74 18.0122
+ 14.75 18.0154
+ 14.76 18.0187
+ 14.77 18.0219
+ 14.78 18.0251
+ 14.79 18.0283
+ 14.8 18.0316
+ 14.81 18.0348
+ 14.82 18.038
+ 14.83 18.0412
+ 14.84 18.0444
+ 14.85 18.0476
+ 14.86 18.0508
+ 14.87 18.054
+ 14.88 18.0572
+ 14.89 18.0604
+ 14.9 18.0636
+ 14.91 18.0668
+ 14.92 18.07
+ 14.93 18.0732
+ 14.94 18.0764
+ 14.95 18.0796
+ 14.96 18.0828
+ 14.97 18.0859
+ 14.98 18.0891
+ 14.99 18.0923
+ 15 18.0955
+ 15.01 18.0987
+ 15.02 18.1018
+ 15.03 18.105
+ 15.04 18.1082
+ 15.05 18.1113
+ 15.06 18.1145
+ 15.07 18.1176
+ 15.08 18.1208
+ 15.09 18.124
+ 15.1 18.1271
+ 15.11 18.1303
+ 15.12 18.1334
+ 15.13 18.1366
+ 15.14 18.1397
+ 15.15 18.1429
+ 15.16 18.146
+ 15.17 18.1491
+ 15.18 18.1523
+ 15.19 18.1554
+ 15.2 18.1585
+ 15.21 18.1617
+ 15.22 18.1648
+ 15.23 18.1679
+ 15.24 18.1711
+ 15.25 18.1742
+ 15.26 18.1773
+ 15.27 18.1804
+ 15.28 18.1835
+ 15.29 18.1867
+ 15.3 18.1898
+ 15.31 18.1929
+ 15.32 18.196
+ 15.33 18.1991
+ 15.34 18.2022
+ 15.35 18.2053
+ 15.36 18.2084
+ 15.37 18.2115
+ 15.38 18.2146
+ 15.39 18.2177
+ 15.4 18.2208
+ 15.41 18.2239
+ 15.42 18.227
+ 15.43 18.2301
+ 15.44 18.2332
+ 15.45 18.2362
+ 15.46 18.2393
+ 15.47 18.2424
+ 15.48 18.2455
+ 15.49 18.2485
+ 15.5 18.2516
+ 15.51 18.2547
+ 15.52 18.2578
+ 15.53 18.2608
+ 15.54 18.2639
+ 15.55 18.267
+ 15.56 18.27
+ 15.57 18.2731
+ 15.58 18.2761
+ 15.59 18.2792
+ 15.6 18.2822
+ 15.61 18.2853
+ 15.62 18.2883
+ 15.63 18.2914
+ 15.64 18.2944
+ 15.65 18.2975
+ 15.66 18.3005
+ 15.67 18.3036
+ 15.68 18.3066
+ 15.69 18.3096
+ 15.7 18.3127
+ 15.71 18.3157
+ 15.72 18.3187
+ 15.73 18.3218
+ 15.74 18.3248
+ 15.75 18.3278
+ 15.76 18.3308
+ 15.77 18.3339
+ 15.78 18.3369
+ 15.79 18.3399
+ 15.8 18.3429
+ 15.81 18.3459
+ 15.82 18.3489
+ 15.83 18.3519
+ 15.84 18.3549
+ 15.85 18.3579
+ 15.86 18.361
+ 15.87 18.364
+ 15.88 18.367
+ 15.89 18.37
+ 15.9 18.3729
+ 15.91 18.3759
+ 15.92 18.3789
+ 15.93 18.3819
+ 15.94 18.3849
+ 15.95 18.3879
+ 15.96 18.3909
+ 15.97 18.3939
+ 15.98 18.3968
+ 15.99 18.3998
+ 16 18.4028
+ 16.01 18.4058
+ 16.02 18.4088
+ 16.03 18.4117
+ 16.04 18.4147
+ 16.05 18.4177
+ 16.06 18.4206
+ 16.07 18.4236
+ 16.08 18.4266
+ 16.09 18.4295
+ 16.1 18.4325
+ 16.11 18.4354
+ 16.12 18.4384
+ 16.13 18.4413
+ 16.14 18.4443
+ 16.15 18.4472
+ 16.16 18.4502
+ 16.17 18.4531
+ 16.18 18.4561
+ 16.19 18.459
+ 16.2 18.462
+ 16.21 18.4649
+ 16.22 18.4678
+ 16.23 18.4708
+ 16.24 18.4737
+ 16.25 18.4766
+ 16.26 18.4796
+ 16.27 18.4825
+ 16.28 18.4854
+ 16.29 18.4883
+ 16.3 18.4913
+ 16.31 18.4942
+ 16.32 18.4971
+ 16.33 18.5
+ 16.34 18.5029
+ 16.35 18.5058
+ 16.36 18.5088
+ 16.37 18.5117
+ 16.38 18.5146
+ 16.39 18.5175
+ 16.4 18.5204
+ 16.41 18.5233
+ 16.42 18.5262
+ 16.43 18.5291
+ 16.44 18.532
+ 16.45 18.5349
+ 16.46 18.5378
+ 16.47 18.5407
+ 16.48 18.5436
+ 16.49 18.5464
+ 16.5 18.5493
+ 16.51 18.5522
+ 16.52 18.5551
+ 16.53 18.558
+ 16.54 18.5609
+ 16.55 18.5637
+ 16.56 18.5666
+ 16.57 18.5695
+ 16.58 18.5724
+ 16.59 18.5752
+ 16.6 18.5781
+ 16.61 18.581
+ 16.62 18.5838
+ 16.63 18.5867
+ 16.64 18.5896
+ 16.65 18.5924
+ 16.66 18.5953
+ 16.67 18.5981
+ 16.68 18.601
+ 16.69 18.6039
+ 16.7 18.6067
+ 16.71 18.6096
+ 16.72 18.6124
+ 16.73 18.6153
+ 16.74 18.6181
+ 16.75 18.6209
+ 16.76 18.6238
+ 16.77 18.6266
+ 16.78 18.6295
+ 16.79 18.6323
+ 16.8 18.6351
+ 16.81 18.638
+ 16.82 18.6408
+ 16.83 18.6436
+ 16.84 18.6465
+ 16.85 18.6493
+ 16.86 18.6521
+ 16.87 18.6549
+ 16.88 18.6578
+ 16.89 18.6606
+ 16.9 18.6634
+ 16.91 18.6662
+ 16.92 18.669
+ 16.93 18.6718
+ 16.94 18.6747
+ 16.95 18.6775
+ 16.96 18.6803
+ 16.97 18.6831
+ 16.98 18.6859
+ 16.99 18.6887
+ 17 18.6915
+ 17.01 18.6943
+ 17.02 18.6971
+ 17.03 18.6999
+ 17.04 18.7027
+ 17.05 18.7055
+ 17.06 18.7083
+ 17.07 18.7111
+ 17.08 18.7138
+ 17.09 18.7166
+ 17.1 18.7194
+ 17.11 18.7222
+ 17.12 18.725
+ 17.13 18.7278
+ 17.14 18.7305
+ 17.15 18.7333
+ 17.16 18.7361
+ 17.17 18.7389
+ 17.18 18.7416
+ 17.19 18.7444
+ 17.2 18.7472
+ 17.21 18.75
+ 17.22 18.7527
+ 17.23 18.7555
+ 17.24 18.7582
+ 17.25 18.761
+ 17.26 18.7638
+ 17.27 18.7665
+ 17.28 18.7693
+ 17.29 18.772
+ 17.3 18.7748
+ 17.31 18.7775
+ 17.32 18.7803
+ 17.33 18.783
+ 17.34 18.7858
+ 17.35 18.7885
+ 17.36 18.7913
+ 17.37 18.794
+ 17.38 18.7968
+ 17.39 18.7995
+ 17.4 18.8022
+ 17.41 18.805
+ 17.42 18.8077
+ 17.43 18.8104
+ 17.44 18.8132
+ 17.45 18.8159
+ 17.46 18.8186
+ 17.47 18.8214
+ 17.48 18.8241
+ 17.49 18.8268
+ 17.5 18.8295
+ 17.51 18.8322
+ 17.52 18.835
+ 17.53 18.8377
+ 17.54 18.8404
+ 17.55 18.8431
+ 17.56 18.8458
+ 17.57 18.8485
+ 17.58 18.8512
+ 17.59 18.854
+ 17.6 18.8567
+ 17.61 18.8594
+ 17.62 18.8621
+ 17.63 18.8648
+ 17.64 18.8675
+ 17.65 18.8702
+ 17.66 18.8729
+ 17.67 18.8756
+ 17.68 18.8783
+ 17.69 18.8809
+ 17.7 18.8836
+ 17.71 18.8863
+ 17.72 18.889
+ 17.73 18.8917
+ 17.74 18.8944
+ 17.75 18.8971
+ 17.76 18.8998
+ 17.77 18.9024
+ 17.78 18.9051
+ 17.79 18.9078
+ 17.8 18.9105
+ 17.81 18.9131
+ 17.82 18.9158
+ 17.83 18.9185
+ 17.84 18.9212
+ 17.85 18.9238
+ 17.86 18.9265
+ 17.87 18.9292
+ 17.88 18.9318
+ 17.89 18.9345
+ 17.9 18.9371
+ 17.91 18.9398
+ 17.92 18.9425
+ 17.93 18.9451
+ 17.94 18.9478
+ 17.95 18.9504
+ 17.96 18.9531
+ 17.97 18.9557
+ 17.98 18.9584
+ 17.99 18.961
+ 18 18.9637
+ 18.01 18.9663
+ 18.02 18.969
+ 18.03 18.9716
+ 18.04 18.9742
+ 18.05 18.9769
+ 18.06 18.9795
+ 18.07 18.9822
+ 18.08 18.9848
+ 18.09 18.9874
+ 18.1 18.9901
+ 18.11 18.9927
+ 18.12 18.9953
+ 18.13 18.9979
+ 18.14 19.0006
+ 18.15 19.0032
+ 18.16 19.0058
+ 18.17 19.0084
+ 18.18 19.0111
+ 18.19 19.0137
+ 18.2 19.0163
+ 18.21 19.0189
+ 18.22 19.0215
+ 18.23 19.0241
+ 18.24 19.0267
+ 18.25 19.0294
+ 18.26 19.032
+ 18.27 19.0346
+ 18.28 19.0372
+ 18.29 19.0398
+ 18.3 19.0424
+ 18.31 19.045
+ 18.32 19.0476
+ 18.33 19.0502
+ 18.34 19.0528
+ 18.35 19.0554
+ 18.36 19.058
+ 18.37 19.0606
+ 18.38 19.0632
+ 18.39 19.0657
+ 18.4 19.0683
+ 18.41 19.0709
+ 18.42 19.0735
+ 18.43 19.0761
+ 18.44 19.0787
+ 18.45 19.0813
+ 18.46 19.0838
+ 18.47 19.0864
+ 18.48 19.089
+ 18.49 19.0916
+ 18.5 19.0941
+ 18.51 19.0967
+ 18.52 19.0993
+ 18.53 19.1019
+ 18.54 19.1044
+ 18.55 19.107
+ 18.56 19.1096
+ 18.57 19.1121
+ 18.58 19.1147
+ 18.59 19.1173
+ 18.6 19.1198
+ 18.61 19.1224
+ 18.62 19.1249
+ 18.63 19.1275
+ 18.64 19.13
+ 18.65 19.1326
+ 18.66 19.1352
+ 18.67 19.1377
+ 18.68 19.1403
+ 18.69 19.1428
+ 18.7 19.1454
+ 18.71 19.1479
+ 18.72 19.1504
+ 18.73 19.153
+ 18.74 19.1555
+ 18.75 19.1581
+ 18.76 19.1606
+ 18.77 19.1631
+ 18.78 19.1657
+ 18.79 19.1682
+ 18.8 19.1707
+ 18.81 19.1733
+ 18.82 19.1758
+ 18.83 19.1783
+ 18.84 19.1809
+ 18.85 19.1834
+ 18.86 19.1859
+ 18.87 19.1884
+ 18.88 19.191
+ 18.89 19.1935
+ 18.9 19.196
+ 18.91 19.1985
+ 18.92 19.201
+ 18.93 19.2036
+ 18.94 19.2061
+ 18.95 19.2086
+ 18.96 19.2111
+ 18.97 19.2136
+ 18.98 19.2161
+ 18.99 19.2186
+ 19 19.2211
+ 19.01 19.2236
+ 19.02 19.2261
+ 19.03 19.2287
+ 19.04 19.2312
+ 19.05 19.2337
+ 19.06 19.2362
+ 19.07 19.2386
+ 19.08 19.2411
+ 19.09 19.2436
+ 19.1 19.2461
+ 19.11 19.2486
+ 19.12 19.2511
+ 19.13 19.2536
+ 19.14 19.2561
+ 19.15 19.2586
+ 19.16 19.2611
+ 19.17 19.2636
+ 19.18 19.266
+ 19.19 19.2685
+ 19.2 19.271
+ 19.21 19.2735
+ 19.22 19.276
+ 19.23 19.2784
+ 19.24 19.2809
+ 19.25 19.2834
+ 19.26 19.2859
+ 19.27 19.2883
+ 19.28 19.2908
+ 19.29 19.2933
+ 19.3 19.2957
+ 19.31 19.2982
+ 19.32 19.3007
+ 19.33 19.3031
+ 19.34 19.3056
+ 19.35 19.3081
+ 19.36 19.3105
+ 19.37 19.313
+ 19.38 19.3154
+ 19.39 19.3179
+ 19.4 19.3203
+ 19.41 19.3228
+ 19.42 19.3253
+ 19.43 19.3277
+ 19.44 19.3302
+ 19.45 19.3326
+ 19.46 19.3351
+ 19.47 19.3375
+ 19.48 19.3399
+ 19.49 19.3424
+ 19.5 19.3448
+ 19.51 19.3473
+ 19.52 19.3497
+ 19.53 19.3522
+ 19.54 19.3546
+ 19.55 19.357
+ 19.56 19.3595
+ 19.57 19.3619
+ 19.58 19.3643
+ 19.59 19.3668
+ 19.6 19.3692
+ 19.61 19.3716
+ 19.62 19.374
+ 19.63 19.3765
+ 19.64 19.3789
+ 19.65 19.3813
+ 19.66 19.3837
+ 19.67 19.3862
+ 19.68 19.3886
+ 19.69 19.391
+ 19.7 19.3934
+ 19.71 19.3958
+ 19.72 19.3983
+ 19.73 19.4007
+ 19.74 19.4031
+ 19.75 19.4055
+ 19.76 19.4079
+ 19.77 19.4103
+ 19.78 19.4127
+ 19.79 19.4151
+ 19.8 19.4175
+ 19.81 19.4199
+ 19.82 19.4223
+ 19.83 19.4247
+ 19.84 19.4271
+ 19.85 19.4295
+ 19.86 19.4319
+ 19.87 19.4343
+ 19.88 19.4367
+ 19.89 19.4391
+ 19.9 19.4415
+ 19.91 19.4439
+ 19.92 19.4463
+ 19.93 19.4487
+ 19.94 19.4511
+ 19.95 19.4535
+ 19.96 19.4559
+ 19.97 19.4582
+ 19.98 19.4606
+ 19.99 19.463
+ 20 19.4654
+&
+ at TARGET S3
+ at TYPE xy
+ 0.01 0.02
+ 0.02 0.04
+ 0.03 0.06
+ 0.04 0.08
+ 0.05 0.1
+ 0.06 0.12
+ 0.07 0.14
+ 0.08 0.16
+ 0.09 0.18
+ 0.1 0.2
+ 0.11 0.22
+ 0.12 0.24
+ 0.13 0.26
+ 0.14 0.28
+ 0.15 0.3
+ 0.16 0.32
+ 0.17 0.34
+ 0.18 0.36
+ 0.19 0.38
+ 0.2 0.4
+ 0.21 0.42
+ 0.22 0.44
+ 0.23 0.46
+ 0.24 0.48
+ 0.25 0.5
+ 0.26 0.52
+ 0.27 0.54
+ 0.28 0.56
+ 0.29 0.58
+ 0.3 0.6
+ 0.31 0.62
+ 0.32 0.64
+ 0.33 0.66
+ 0.34 0.68
+ 0.35 0.7
+ 0.36 0.72
+ 0.37 0.74
+ 0.38 0.76
+ 0.39 0.78
+ 0.4 0.8
+ 0.41 0.82
+ 0.42 0.84
+ 0.43 0.86
+ 0.44 0.88
+ 0.45 0.9
+ 0.46 0.92
+ 0.47 0.94
+ 0.48 0.96
+ 0.49 0.98
+ 0.5 1
+ 0.51 1.02
+ 0.52 1.04
+ 0.53 1.06
+ 0.54 1.08
+ 0.55 1.1
+ 0.56 1.12
+ 0.57 1.14
+ 0.58 1.16
+ 0.59 1.18
+ 0.6 1.2
+ 0.61 1.22
+ 0.62 1.24
+ 0.63 1.26
+ 0.64 1.28
+ 0.65 1.3
+ 0.66 1.32
+ 0.67 1.34
+ 0.68 1.36
+ 0.69 1.38
+ 0.7 1.4
+ 0.71 1.42
+ 0.72 1.44
+ 0.73 1.46
+ 0.74 1.48
+ 0.75 1.5
+ 0.76 1.52
+ 0.77 1.54
+ 0.78 1.56
+ 0.79 1.58
+ 0.8 1.6
+ 0.81 1.62
+ 0.82 1.64
+ 0.83 1.66
+ 0.84 1.68
+ 0.85 1.7
+ 0.86 1.72
+ 0.87 1.74
+ 0.88 1.76
+ 0.89 1.78
+ 0.9 1.8
+ 0.91 1.82
+ 0.92 1.84
+ 0.93 1.86
+ 0.94 1.88
+ 0.95 1.9
+ 0.96 1.92
+ 0.97 1.94
+ 0.98 1.96
+ 0.99 1.98
+ 1 2
+ 1.01 2.02
+ 1.02 2.04
+ 1.03 2.06
+ 1.04 2.08
+ 1.05 2.1
+ 1.06 2.12
+ 1.07 2.14
+ 1.08 2.16
+ 1.09 2.18
+ 1.1 2.2
+ 1.11 2.22
+ 1.12 2.24
+ 1.13 2.26
+ 1.14 2.28
+ 1.15 2.3
+ 1.16 2.32
+ 1.17 2.34
+ 1.18 2.36
+ 1.19 2.38
+ 1.2 2.4
+ 1.21 2.42
+ 1.22 2.44
+ 1.23 2.46
+ 1.24 2.48
+ 1.25 2.5
+ 1.26 2.52
+ 1.27 2.54
+ 1.28 2.56
+ 1.29 2.58
+ 1.3 2.6
+ 1.31 2.62
+ 1.32 2.64
+ 1.33 2.66
+ 1.34 2.68
+ 1.35 2.7
+ 1.36 2.72
+ 1.37 2.74
+ 1.38 2.76
+ 1.39 2.78
+ 1.4 2.8
+ 1.41 2.82
+ 1.42 2.84
+ 1.43 2.86
+ 1.44 2.88
+ 1.45 2.9
+ 1.46 2.92
+ 1.47 2.94
+ 1.48 2.96
+ 1.49 2.98
+ 1.5 3
+ 1.51 3.02
+ 1.52 3.04
+ 1.53 3.06
+ 1.54 3.08
+ 1.55 3.1
+ 1.56 3.12
+ 1.57 3.14
+ 1.58 3.16
+ 1.59 3.18
+ 1.6 3.2
+ 1.61 3.22
+ 1.62 3.24
+ 1.63 3.26
+ 1.64 3.28
+ 1.65 3.3
+ 1.66 3.32
+ 1.67 3.34
+ 1.68 3.36
+ 1.69 3.38
+ 1.7 3.4
+ 1.71 3.42
+ 1.72 3.44
+ 1.73 3.46
+ 1.74 3.48
+ 1.75 3.5
+ 1.76 3.52
+ 1.77 3.54
+ 1.78 3.56
+ 1.79 3.58
+ 1.8 3.6
+ 1.81 3.62
+ 1.82 3.64
+ 1.83 3.66
+ 1.84 3.68
+ 1.85 3.7
+ 1.86 3.72
+ 1.87 3.74
+ 1.88 3.76
+ 1.89 3.78
+ 1.9 3.8
+ 1.91 3.82
+ 1.92 3.84
+ 1.93 3.86
+ 1.94 3.88
+ 1.95 3.9
+ 1.96 3.92
+ 1.97 3.94
+ 1.98 3.96
+ 1.99 3.98
+ 2 4
+ 2.01 4.02
+ 2.02 4.04
+ 2.03 4.06
+ 2.04 4.08
+ 2.05 4.1
+ 2.06 4.12
+ 2.07 4.14
+ 2.08 4.16
+ 2.09 4.18
+ 2.1 4.2
+ 2.11 4.22
+ 2.12 4.24
+ 2.13 4.26
+ 2.14 4.28
+ 2.15 4.3
+ 2.16 4.32
+ 2.17 4.34
+ 2.18 4.36
+ 2.19 4.38
+ 2.2 4.4
+ 2.21 4.42
+ 2.22 4.44
+ 2.23 4.46
+ 2.24 4.48
+ 2.25 4.5
+ 2.26 4.52
+ 2.27 4.54
+ 2.28 4.56
+ 2.29 4.58
+ 2.3 4.6
+ 2.31 4.62
+ 2.32 4.64
+ 2.33 4.66
+ 2.34 4.68
+ 2.35 4.7
+ 2.36 4.72
+ 2.37 4.74
+ 2.38 4.76
+ 2.39 4.78
+ 2.4 4.8
+ 2.41 4.82
+ 2.42 4.84
+ 2.43 4.86
+ 2.44 4.88
+ 2.45 4.9
+ 2.46 4.92
+ 2.47 4.94
+ 2.48 4.96
+ 2.49 4.98
+ 2.5 5
+ 2.51 5.02
+ 2.52 5.04
+ 2.53 5.06
+ 2.54 5.08
+ 2.55 5.1
+ 2.56 5.12
+ 2.57 5.14
+ 2.58 5.16
+ 2.59 5.18
+ 2.6 5.2
+ 2.61 5.22
+ 2.62 5.24
+ 2.63 5.26
+ 2.64 5.28
+ 2.65 5.3
+ 2.66 5.32
+ 2.67 5.34
+ 2.68 5.36
+ 2.69 5.38
+ 2.7 5.4
+ 2.71 5.42
+ 2.72 5.44
+ 2.73 5.46
+ 2.74 5.48
+ 2.75 5.5
+ 2.76 5.52
+ 2.77 5.54
+ 2.78 5.56
+ 2.79 5.58
+ 2.8 5.6
+ 2.81 5.62
+ 2.82 5.64
+ 2.83 5.66
+ 2.84 5.68
+ 2.85 5.7
+ 2.86 5.72
+ 2.87 5.74
+ 2.88 5.76
+ 2.89 5.78
+ 2.9 5.8
+ 2.91 5.82
+ 2.92 5.84
+ 2.93 5.86
+ 2.94 5.88
+ 2.95 5.9
+ 2.96 5.92
+ 2.97 5.94
+ 2.98 5.96
+ 2.99 5.98
+ 3 6
+ 3.01 6.02
+ 3.02 6.04
+ 3.03 6.06
+ 3.04 6.08
+ 3.05 6.1
+ 3.06 6.12
+ 3.07 6.14
+ 3.08 6.16
+ 3.09 6.18
+ 3.1 6.2
+ 3.11 6.22
+ 3.12 6.24
+ 3.13 6.26
+ 3.14 6.28
+ 3.15 6.3
+ 3.16 6.32
+ 3.17 6.34
+ 3.18 6.36
+ 3.19 6.38
+ 3.2 6.4
+ 3.21 6.42
+ 3.22 6.44
+ 3.23 6.46
+ 3.24 6.48
+ 3.25 6.5
+ 3.26 6.52
+ 3.27 6.54
+ 3.28 6.56
+ 3.29 6.58
+ 3.3 6.6
+ 3.31 6.62
+ 3.32 6.64
+ 3.33 6.66
+ 3.34 6.68
+ 3.35 6.7
+ 3.36 6.72
+ 3.37 6.74
+ 3.38 6.76
+ 3.39 6.78
+ 3.4 6.8
+ 3.41 6.82
+ 3.42 6.84
+ 3.43 6.86
+ 3.44 6.88
+ 3.45 6.9
+ 3.46 6.92
+ 3.47 6.94
+ 3.48 6.96
+ 3.49 6.98
+ 3.5 7
+ 3.51 7.02
+ 3.52 7.04
+ 3.53 7.06
+ 3.54 7.08
+ 3.55 7.1
+ 3.56 7.12
+ 3.57 7.14
+ 3.58 7.16
+ 3.59 7.18
+ 3.6 7.2
+ 3.61 7.22
+ 3.62 7.24
+ 3.63 7.26
+ 3.64 7.28
+ 3.65 7.3
+ 3.66 7.32
+ 3.67 7.34
+ 3.68 7.36
+ 3.69 7.38
+ 3.7 7.4
+ 3.71 7.42
+ 3.72 7.44
+ 3.73 7.46
+ 3.74 7.48
+ 3.75 7.5
+ 3.76 7.52
+ 3.77 7.54
+ 3.78 7.56
+ 3.79 7.58
+ 3.8 7.6
+ 3.81 7.62
+ 3.82 7.64
+ 3.83 7.66
+ 3.84 7.68
+ 3.85 7.7
+ 3.86 7.72
+ 3.87 7.74
+ 3.88 7.76
+ 3.89 7.78
+ 3.9 7.8
+ 3.91 7.82
+ 3.92 7.84
+ 3.93 7.86
+ 3.94 7.88
+ 3.95 7.9
+ 3.96 7.92
+ 3.97 7.94
+ 3.98 7.96
+ 3.99 7.98
+ 4 8
+ 4.01 8.02
+ 4.02 8.04
+ 4.03 8.06
+ 4.04 8.08
+ 4.05 8.1
+ 4.06 8.12
+ 4.07 8.14
+ 4.08 8.16
+ 4.09 8.18
+ 4.1 8.2
+ 4.11 8.22
+ 4.12 8.24
+ 4.13 8.26
+ 4.14 8.28
+ 4.15 8.3
+ 4.16 8.32
+ 4.17 8.34
+ 4.18 8.36
+ 4.19 8.38
+ 4.2 8.4
+ 4.21 8.42
+ 4.22 8.44
+ 4.23 8.46
+ 4.24 8.48
+ 4.25 8.5
+ 4.26 8.52
+ 4.27 8.54
+ 4.28 8.56
+ 4.29 8.58
+ 4.3 8.6
+ 4.31 8.62
+ 4.32 8.64
+ 4.33 8.66
+ 4.34 8.68
+ 4.35 8.7
+ 4.36 8.72
+ 4.37 8.74
+ 4.38 8.76
+ 4.39 8.78
+ 4.4 8.8
+ 4.41 8.82
+ 4.42 8.84
+ 4.43 8.86
+ 4.44 8.88
+ 4.45 8.9
+ 4.46 8.92
+ 4.47 8.94
+ 4.48 8.96
+ 4.49 8.98
+ 4.5 9
+ 4.51 9.02
+ 4.52 9.04
+ 4.53 9.06
+ 4.54 9.08
+ 4.55 9.1
+ 4.56 9.12
+ 4.57 9.14
+ 4.58 9.16
+ 4.59 9.18
+ 4.6 9.2
+ 4.61 9.22
+ 4.62 9.24
+ 4.63 9.26
+ 4.64 9.28
+ 4.65 9.3
+ 4.66 9.32
+ 4.67 9.34
+ 4.68 9.36
+ 4.69 9.38
+ 4.7 9.4
+ 4.71 9.42
+ 4.72 9.44
+ 4.73 9.46
+ 4.74 9.48
+ 4.75 9.5
+ 4.76 9.52
+ 4.77 9.54
+ 4.78 9.56
+ 4.79 9.58
+ 4.8 9.6
+ 4.81 9.62
+ 4.82 9.64
+ 4.83 9.66
+ 4.84 9.68
+ 4.85 9.7
+ 4.86 9.72
+ 4.87 9.74
+ 4.88 9.76
+ 4.89 9.78
+ 4.9 9.8
+ 4.91 9.82
+ 4.92 9.84
+ 4.93 9.86
+ 4.94 9.88
+ 4.95 9.9
+ 4.96 9.92
+ 4.97 9.94
+ 4.98 9.96
+ 4.99 9.98
+ 5 10
+ 5.01 10.02
+ 5.02 10.04
+ 5.03 10.06
+ 5.04 10.08
+ 5.05 10.1
+ 5.06 10.12
+ 5.07 10.14
+ 5.08 10.16
+ 5.09 10.18
+ 5.1 10.2
+ 5.11 10.22
+ 5.12 10.24
+ 5.13 10.26
+ 5.14 10.28
+ 5.15 10.3
+ 5.16 10.32
+ 5.17 10.34
+ 5.18 10.36
+ 5.19 10.38
+ 5.2 10.4
+ 5.21 10.42
+ 5.22 10.44
+ 5.23 10.46
+ 5.24 10.48
+ 5.25 10.5
+ 5.26 10.52
+ 5.27 10.54
+ 5.28 10.56
+ 5.29 10.58
+ 5.3 10.6
+ 5.31 10.62
+ 5.32 10.64
+ 5.33 10.66
+ 5.34 10.68
+ 5.35 10.7
+ 5.36 10.72
+ 5.37 10.74
+ 5.38 10.76
+ 5.39 10.78
+ 5.4 10.8
+ 5.41 10.82
+ 5.42 10.84
+ 5.43 10.86
+ 5.44 10.88
+ 5.45 10.9
+ 5.46 10.92
+ 5.47 10.94
+ 5.48 10.96
+ 5.49 10.98
+ 5.5 11
+ 5.51 11.02
+ 5.52 11.04
+ 5.53 11.06
+ 5.54 11.08
+ 5.55 11.1
+ 5.56 11.12
+ 5.57 11.14
+ 5.58 11.16
+ 5.59 11.18
+ 5.6 11.2
+ 5.61 11.22
+ 5.62 11.24
+ 5.63 11.26
+ 5.64 11.28
+ 5.65 11.3
+ 5.66 11.32
+ 5.67 11.34
+ 5.68 11.36
+ 5.69 11.38
+ 5.7 11.4
+ 5.71 11.42
+ 5.72 11.44
+ 5.73 11.46
+ 5.74 11.48
+ 5.75 11.5
+ 5.76 11.52
+ 5.77 11.54
+ 5.78 11.56
+ 5.79 11.58
+ 5.8 11.6
+ 5.81 11.62
+ 5.82 11.64
+ 5.83 11.66
+ 5.84 11.68
+ 5.85 11.7
+ 5.86 11.72
+ 5.87 11.74
+ 5.88 11.76
+ 5.89 11.78
+ 5.9 11.8
+ 5.91 11.82
+ 5.92 11.84
+ 5.93 11.86
+ 5.94 11.88
+ 5.95 11.9
+ 5.96 11.92
+ 5.97 11.94
+ 5.98 11.96
+ 5.99 11.98
+ 6 12
+ 6.01 12.02
+ 6.02 12.04
+ 6.03 12.06
+ 6.04 12.08
+ 6.05 12.1
+ 6.06 12.12
+ 6.07 12.14
+ 6.08 12.16
+ 6.09 12.18
+ 6.1 12.2
+ 6.11 12.22
+ 6.12 12.24
+ 6.13 12.26
+ 6.14 12.28
+ 6.15 12.3
+ 6.16 12.32
+ 6.17 12.34
+ 6.18 12.36
+ 6.19 12.38
+ 6.2 12.4
+ 6.21 12.42
+ 6.22 12.44
+ 6.23 12.46
+ 6.24 12.48
+ 6.25 12.5
+ 6.26 12.52
+ 6.27 12.54
+ 6.28 12.56
+ 6.29 12.58
+ 6.3 12.6
+ 6.31 12.62
+ 6.32 12.64
+ 6.33 12.66
+ 6.34 12.68
+ 6.35 12.7
+ 6.36 12.72
+ 6.37 12.74
+ 6.38 12.76
+ 6.39 12.78
+ 6.4 12.8
+ 6.41 12.82
+ 6.42 12.84
+ 6.43 12.86
+ 6.44 12.88
+ 6.45 12.9
+ 6.46 12.92
+ 6.47 12.94
+ 6.48 12.96
+ 6.49 12.98
+ 6.5 13
+ 6.51 13.02
+ 6.52 13.04
+ 6.53 13.06
+ 6.54 13.08
+ 6.55 13.1
+ 6.56 13.12
+ 6.57 13.14
+ 6.58 13.16
+ 6.59 13.18
+ 6.6 13.2
+ 6.61 13.22
+ 6.62 13.24
+ 6.63 13.26
+ 6.64 13.28
+ 6.65 13.3
+ 6.66 13.32
+ 6.67 13.34
+ 6.68 13.36
+ 6.69 13.38
+ 6.7 13.4
+ 6.71 13.42
+ 6.72 13.44
+ 6.73 13.46
+ 6.74 13.48
+ 6.75 13.5
+ 6.76 13.52
+ 6.77 13.54
+ 6.78 13.56
+ 6.79 13.58
+ 6.8 13.6
+ 6.81 13.62
+ 6.82 13.64
+ 6.83 13.66
+ 6.84 13.68
+ 6.85 13.7
+ 6.86 13.72
+ 6.87 13.74
+ 6.88 13.76
+ 6.89 13.78
+ 6.9 13.8
+ 6.91 13.82
+ 6.92 13.84
+ 6.93 13.86
+ 6.94 13.88
+ 6.95 13.9
+ 6.96 13.92
+ 6.97 13.94
+ 6.98 13.96
+ 6.99 13.98
+ 7 14
+ 7.01 14.02
+ 7.02 14.04
+ 7.03 14.06
+ 7.04 14.08
+ 7.05 14.1
+ 7.06 14.12
+ 7.07 14.14
+ 7.08 14.16
+ 7.09 14.18
+ 7.1 14.2
+ 7.11 14.22
+ 7.12 14.24
+ 7.13 14.26
+ 7.14 14.28
+ 7.15 14.3
+ 7.16 14.32
+ 7.17 14.34
+ 7.18 14.36
+ 7.19 14.38
+ 7.2 14.4
+ 7.21 14.42
+ 7.22 14.44
+ 7.23 14.46
+ 7.24 14.48
+ 7.25 14.5
+ 7.26 14.52
+ 7.27 14.54
+ 7.28 14.56
+ 7.29 14.58
+ 7.3 14.6
+ 7.31 14.62
+ 7.32 14.64
+ 7.33 14.66
+ 7.34 14.68
+ 7.35 14.7
+ 7.36 14.72
+ 7.37 14.74
+ 7.38 14.76
+ 7.39 14.78
+ 7.4 14.8
+ 7.41 14.82
+ 7.42 14.84
+ 7.43 14.86
+ 7.44 14.88
+ 7.45 14.9
+ 7.46 14.92
+ 7.47 14.94
+ 7.48 14.96
+ 7.49 14.98
+ 7.5 15
+ 7.51 15.02
+ 7.52 15.04
+ 7.53 15.06
+ 7.54 15.08
+ 7.55 15.1
+ 7.56 15.12
+ 7.57 15.14
+ 7.58 15.16
+ 7.59 15.18
+ 7.6 15.2
+ 7.61 15.22
+ 7.62 15.24
+ 7.63 15.26
+ 7.64 15.28
+ 7.65 15.3
+ 7.66 15.32
+ 7.67 15.34
+ 7.68 15.36
+ 7.69 15.38
+ 7.7 15.4
+ 7.71 15.42
+ 7.72 15.44
+ 7.73 15.46
+ 7.74 15.48
+ 7.75 15.5
+ 7.76 15.52
+ 7.77 15.54
+ 7.78 15.56
+ 7.79 15.58
+ 7.8 15.6
+ 7.81 15.62
+ 7.82 15.64
+ 7.83 15.66
+ 7.84 15.68
+ 7.85 15.7
+ 7.86 15.72
+ 7.87 15.74
+ 7.88 15.76
+ 7.89 15.78
+ 7.9 15.8
+ 7.91 15.82
+ 7.92 15.84
+ 7.93 15.86
+ 7.94 15.88
+ 7.95 15.9
+ 7.96 15.92
+ 7.97 15.94
+ 7.98 15.96
+ 7.99 15.98
+ 8 16
+ 8.01 16.02
+ 8.02 16.04
+ 8.03 16.06
+ 8.04 16.08
+ 8.05 16.1
+ 8.06 16.12
+ 8.07 16.14
+ 8.08 16.16
+ 8.09 16.18
+ 8.1 16.2
+ 8.11 16.22
+ 8.12 16.24
+ 8.13 16.26
+ 8.14 16.28
+ 8.15 16.3
+ 8.16 16.32
+ 8.17 16.34
+ 8.18 16.36
+ 8.19 16.38
+ 8.2 16.4
+ 8.21 16.42
+ 8.22 16.44
+ 8.23 16.46
+ 8.24 16.48
+ 8.25 16.5
+ 8.26 16.52
+ 8.27 16.54
+ 8.28 16.56
+ 8.29 16.58
+ 8.3 16.6
+ 8.31 16.62
+ 8.32 16.64
+ 8.33 16.66
+ 8.34 16.68
+ 8.35 16.7
+ 8.36 16.72
+ 8.37 16.74
+ 8.38 16.76
+ 8.39 16.78
+ 8.4 16.8
+ 8.41 16.82
+ 8.42 16.84
+ 8.43 16.86
+ 8.44 16.88
+ 8.45 16.9
+ 8.46 16.92
+ 8.47 16.94
+ 8.48 16.96
+ 8.49 16.98
+ 8.5 17
+ 8.51 17.02
+ 8.52 17.04
+ 8.53 17.06
+ 8.54 17.08
+ 8.55 17.1
+ 8.56 17.12
+ 8.57 17.14
+ 8.58 17.16
+ 8.59 17.18
+ 8.6 17.2
+ 8.61 17.22
+ 8.62 17.24
+ 8.63 17.26
+ 8.64 17.28
+ 8.65 17.3
+ 8.66 17.32
+ 8.67 17.34
+ 8.68 17.36
+ 8.69 17.38
+ 8.7 17.4
+ 8.71 17.42
+ 8.72 17.44
+ 8.73 17.46
+ 8.74 17.48
+ 8.75 17.5
+ 8.76 17.52
+ 8.77 17.54
+ 8.78 17.56
+ 8.79 17.58
+ 8.8 17.6
+ 8.81 17.62
+ 8.82 17.64
+ 8.83 17.66
+ 8.84 17.68
+ 8.85 17.7
+ 8.86 17.72
+ 8.87 17.74
+ 8.88 17.76
+ 8.89 17.78
+ 8.9 17.8
+ 8.91 17.82
+ 8.92 17.84
+ 8.93 17.86
+ 8.94 17.88
+ 8.95 17.9
+ 8.96 17.92
+ 8.97 17.94
+ 8.98 17.96
+ 8.99 17.98
+ 9 18
+ 9.01 18.02
+ 9.02 18.04
+ 9.03 18.06
+ 9.04 18.08
+ 9.05 18.1
+ 9.06 18.12
+ 9.07 18.14
+ 9.08 18.16
+ 9.09 18.18
+ 9.1 18.2
+ 9.11 18.22
+ 9.12 18.24
+ 9.13 18.26
+ 9.14 18.28
+ 9.15 18.3
+ 9.16 18.32
+ 9.17 18.34
+ 9.18 18.36
+ 9.19 18.38
+ 9.2 18.4
+ 9.21 18.42
+ 9.22 18.44
+ 9.23 18.46
+ 9.24 18.48
+ 9.25 18.5
+ 9.26 18.52
+ 9.27 18.54
+ 9.28 18.56
+ 9.29 18.58
+ 9.3 18.6
+ 9.31 18.62
+ 9.32 18.64
+ 9.33 18.66
+ 9.34 18.68
+ 9.35 18.7
+ 9.36 18.72
+ 9.37 18.74
+ 9.38 18.76
+ 9.39 18.78
+ 9.4 18.8
+ 9.41 18.82
+ 9.42 18.84
+ 9.43 18.86
+ 9.44 18.88
+ 9.45 18.9
+ 9.46 18.92
+ 9.47 18.94
+ 9.48 18.96
+ 9.49 18.98
+ 9.5 19
+ 9.51 19.02
+ 9.52 19.04
+ 9.53 19.06
+ 9.54 19.08
+ 9.55 19.1
+ 9.56 19.12
+ 9.57 19.14
+ 9.58 19.16
+ 9.59 19.18
+ 9.6 19.2
+ 9.61 19.22
+ 9.62 19.24
+ 9.63 19.26
+ 9.64 19.28
+ 9.65 19.3
+ 9.66 19.32
+ 9.67 19.34
+ 9.68 19.36
+ 9.69 19.38
+ 9.7 19.4
+ 9.71 19.42
+ 9.72 19.44
+ 9.73 19.46
+ 9.74 19.48
+ 9.75 19.5
+ 9.76 19.52
+ 9.77 19.54
+ 9.78 19.56
+ 9.79 19.58
+ 9.8 19.6
+ 9.81 19.62
+ 9.82 19.64
+ 9.83 19.66
+ 9.84 19.68
+ 9.85 19.7
+ 9.86 19.72
+ 9.87 19.74
+ 9.88 19.76
+ 9.89 19.78
+ 9.9 19.8
+ 9.91 19.82
+ 9.92 19.84
+ 9.93 19.86
+ 9.94 19.88
+ 9.95 19.9
+ 9.96 19.92
+ 9.97 19.94
+ 9.98 19.96
+ 9.99 19.98
+ 10 20
+ 10.01 20.02
+ 10.02 20.04
+ 10.03 20.06
+ 10.04 20.08
+ 10.05 20.1
+ 10.06 20.12
+ 10.07 20.14
+ 10.08 20.16
+ 10.09 20.18
+ 10.1 20.2
+ 10.11 20.22
+ 10.12 20.24
+ 10.13 20.26
+ 10.14 20.28
+ 10.15 20.3
+ 10.16 20.32
+ 10.17 20.34
+ 10.18 20.36
+ 10.19 20.38
+ 10.2 20.4
+ 10.21 20.42
+ 10.22 20.44
+ 10.23 20.46
+ 10.24 20.48
+ 10.25 20.5
+ 10.26 20.52
+ 10.27 20.54
+ 10.28 20.56
+ 10.29 20.58
+ 10.3 20.6
+ 10.31 20.62
+ 10.32 20.64
+ 10.33 20.66
+ 10.34 20.68
+ 10.35 20.7
+ 10.36 20.72
+ 10.37 20.74
+ 10.38 20.76
+ 10.39 20.78
+ 10.4 20.8
+ 10.41 20.82
+ 10.42 20.84
+ 10.43 20.86
+ 10.44 20.88
+ 10.45 20.9
+ 10.46 20.92
+ 10.47 20.94
+ 10.48 20.96
+ 10.49 20.98
+ 10.5 21
+ 10.51 21.02
+ 10.52 21.04
+ 10.53 21.06
+ 10.54 21.08
+ 10.55 21.1
+ 10.56 21.12
+ 10.57 21.14
+ 10.58 21.16
+ 10.59 21.18
+ 10.6 21.2
+ 10.61 21.22
+ 10.62 21.24
+ 10.63 21.26
+ 10.64 21.28
+ 10.65 21.3
+ 10.66 21.32
+ 10.67 21.34
+ 10.68 21.36
+ 10.69 21.38
+ 10.7 21.4
+ 10.71 21.42
+ 10.72 21.44
+ 10.73 21.46
+ 10.74 21.48
+ 10.75 21.5
+ 10.76 21.52
+ 10.77 21.54
+ 10.78 21.56
+ 10.79 21.58
+ 10.8 21.6
+ 10.81 21.62
+ 10.82 21.64
+ 10.83 21.66
+ 10.84 21.68
+ 10.85 21.7
+ 10.86 21.72
+ 10.87 21.74
+ 10.88 21.76
+ 10.89 21.78
+ 10.9 21.8
+ 10.91 21.82
+ 10.92 21.84
+ 10.93 21.86
+ 10.94 21.88
+ 10.95 21.9
+ 10.96 21.92
+ 10.97 21.94
+ 10.98 21.96
+ 10.99 21.98
+ 11 22
+ 11.01 22.02
+ 11.02 22.04
+ 11.03 22.06
+ 11.04 22.08
+ 11.05 22.1
+ 11.06 22.12
+ 11.07 22.14
+ 11.08 22.16
+ 11.09 22.18
+ 11.1 22.2
+ 11.11 22.22
+ 11.12 22.24
+ 11.13 22.26
+ 11.14 22.28
+ 11.15 22.3
+ 11.16 22.32
+ 11.17 22.34
+ 11.18 22.36
+ 11.19 22.38
+ 11.2 22.4
+ 11.21 22.42
+ 11.22 22.44
+ 11.23 22.46
+ 11.24 22.48
+ 11.25 22.5
+ 11.26 22.52
+ 11.27 22.54
+ 11.28 22.56
+ 11.29 22.58
+ 11.3 22.6
+ 11.31 22.62
+ 11.32 22.64
+ 11.33 22.66
+ 11.34 22.68
+ 11.35 22.7
+ 11.36 22.72
+ 11.37 22.74
+ 11.38 22.76
+ 11.39 22.78
+ 11.4 22.8
+ 11.41 22.82
+ 11.42 22.84
+ 11.43 22.86
+ 11.44 22.88
+ 11.45 22.9
+ 11.46 22.92
+ 11.47 22.94
+ 11.48 22.96
+ 11.49 22.98
+ 11.5 23
+ 11.51 23.02
+ 11.52 23.04
+ 11.53 23.06
+ 11.54 23.08
+ 11.55 23.1
+ 11.56 23.12
+ 11.57 23.14
+ 11.58 23.16
+ 11.59 23.18
+ 11.6 23.2
+ 11.61 23.22
+ 11.62 23.24
+ 11.63 23.26
+ 11.64 23.28
+ 11.65 23.3
+ 11.66 23.32
+ 11.67 23.34
+ 11.68 23.36
+ 11.69 23.38
+ 11.7 23.4
+ 11.71 23.42
+ 11.72 23.44
+ 11.73 23.46
+ 11.74 23.48
+ 11.75 23.5
+ 11.76 23.52
+ 11.77 23.54
+ 11.78 23.56
+ 11.79 23.58
+ 11.8 23.6
+ 11.81 23.62
+ 11.82 23.64
+ 11.83 23.66
+ 11.84 23.68
+ 11.85 23.7
+ 11.86 23.72
+ 11.87 23.74
+ 11.88 23.76
+ 11.89 23.78
+ 11.9 23.8
+ 11.91 23.82
+ 11.92 23.84
+ 11.93 23.86
+ 11.94 23.88
+ 11.95 23.9
+ 11.96 23.92
+ 11.97 23.94
+ 11.98 23.96
+ 11.99 23.98
+ 12 24
+ 12.01 24.02
+ 12.02 24.04
+ 12.03 24.06
+ 12.04 24.08
+ 12.05 24.1
+ 12.06 24.12
+ 12.07 24.14
+ 12.08 24.16
+ 12.09 24.18
+ 12.1 24.2
+ 12.11 24.22
+ 12.12 24.24
+ 12.13 24.26
+ 12.14 24.28
+ 12.15 24.3
+ 12.16 24.32
+ 12.17 24.34
+ 12.18 24.36
+ 12.19 24.38
+ 12.2 24.4
+ 12.21 24.42
+ 12.22 24.44
+ 12.23 24.46
+ 12.24 24.48
+ 12.25 24.5
+ 12.26 24.52
+ 12.27 24.54
+ 12.28 24.56
+ 12.29 24.58
+ 12.3 24.6
+ 12.31 24.62
+ 12.32 24.64
+ 12.33 24.66
+ 12.34 24.68
+ 12.35 24.7
+ 12.36 24.72
+ 12.37 24.74
+ 12.38 24.76
+ 12.39 24.78
+ 12.4 24.8
+ 12.41 24.82
+ 12.42 24.84
+ 12.43 24.86
+ 12.44 24.88
+ 12.45 24.9
+ 12.46 24.92
+ 12.47 24.94
+ 12.48 24.96
+ 12.49 24.98
+ 12.5 25
+ 12.51 25.02
+ 12.52 25.04
+ 12.53 25.06
+ 12.54 25.08
+ 12.55 25.1
+ 12.56 25.12
+ 12.57 25.14
+ 12.58 25.16
+ 12.59 25.18
+ 12.6 25.2
+ 12.61 25.22
+ 12.62 25.24
+ 12.63 25.26
+ 12.64 25.28
+ 12.65 25.3
+ 12.66 25.32
+ 12.67 25.34
+ 12.68 25.36
+ 12.69 25.38
+ 12.7 25.4
+ 12.71 25.42
+ 12.72 25.44
+ 12.73 25.46
+ 12.74 25.48
+ 12.75 25.5
+ 12.76 25.52
+ 12.77 25.54
+ 12.78 25.56
+ 12.79 25.58
+ 12.8 25.6
+ 12.81 25.62
+ 12.82 25.64
+ 12.83 25.66
+ 12.84 25.68
+ 12.85 25.7
+ 12.86 25.72
+ 12.87 25.74
+ 12.88 25.76
+ 12.89 25.78
+ 12.9 25.8
+ 12.91 25.82
+ 12.92 25.84
+ 12.93 25.86
+ 12.94 25.88
+ 12.95 25.9
+ 12.96 25.92
+ 12.97 25.94
+ 12.98 25.96
+ 12.99 25.98
+ 13 26
+ 13.01 26.02
+ 13.02 26.04
+ 13.03 26.06
+ 13.04 26.08
+ 13.05 26.1
+ 13.06 26.12
+ 13.07 26.14
+ 13.08 26.16
+ 13.09 26.18
+ 13.1 26.2
+ 13.11 26.22
+ 13.12 26.24
+ 13.13 26.26
+ 13.14 26.28
+ 13.15 26.3
+ 13.16 26.32
+ 13.17 26.34
+ 13.18 26.36
+ 13.19 26.38
+ 13.2 26.4
+ 13.21 26.42
+ 13.22 26.44
+ 13.23 26.46
+ 13.24 26.48
+ 13.25 26.5
+ 13.26 26.52
+ 13.27 26.54
+ 13.28 26.56
+ 13.29 26.58
+ 13.3 26.6
+ 13.31 26.62
+ 13.32 26.64
+ 13.33 26.66
+ 13.34 26.68
+ 13.35 26.7
+ 13.36 26.72
+ 13.37 26.74
+ 13.38 26.76
+ 13.39 26.78
+ 13.4 26.8
+ 13.41 26.82
+ 13.42 26.84
+ 13.43 26.86
+ 13.44 26.88
+ 13.45 26.9
+ 13.46 26.92
+ 13.47 26.94
+ 13.48 26.96
+ 13.49 26.98
+ 13.5 27
+ 13.51 27.02
+ 13.52 27.04
+ 13.53 27.06
+ 13.54 27.08
+ 13.55 27.1
+ 13.56 27.12
+ 13.57 27.14
+ 13.58 27.16
+ 13.59 27.18
+ 13.6 27.2
+ 13.61 27.22
+ 13.62 27.24
+ 13.63 27.26
+ 13.64 27.28
+ 13.65 27.3
+ 13.66 27.32
+ 13.67 27.34
+ 13.68 27.36
+ 13.69 27.38
+ 13.7 27.4
+ 13.71 27.42
+ 13.72 27.44
+ 13.73 27.46
+ 13.74 27.48
+ 13.75 27.5
+ 13.76 27.52
+ 13.77 27.54
+ 13.78 27.56
+ 13.79 27.58
+ 13.8 27.6
+ 13.81 27.62
+ 13.82 27.64
+ 13.83 27.66
+ 13.84 27.68
+ 13.85 27.7
+ 13.86 27.72
+ 13.87 27.74
+ 13.88 27.76
+ 13.89 27.78
+ 13.9 27.8
+ 13.91 27.82
+ 13.92 27.84
+ 13.93 27.86
+ 13.94 27.88
+ 13.95 27.9
+ 13.96 27.92
+ 13.97 27.94
+ 13.98 27.96
+ 13.99 27.98
+ 14 28
+ 14.01 28.02
+ 14.02 28.04
+ 14.03 28.06
+ 14.04 28.08
+ 14.05 28.1
+ 14.06 28.12
+ 14.07 28.14
+ 14.08 28.16
+ 14.09 28.18
+ 14.1 28.2
+ 14.11 28.22
+ 14.12 28.24
+ 14.13 28.26
+ 14.14 28.28
+ 14.15 28.3
+ 14.16 28.32
+ 14.17 28.34
+ 14.18 28.36
+ 14.19 28.38
+ 14.2 28.4
+ 14.21 28.42
+ 14.22 28.44
+ 14.23 28.46
+ 14.24 28.48
+ 14.25 28.5
+ 14.26 28.52
+ 14.27 28.54
+ 14.28 28.56
+ 14.29 28.58
+ 14.3 28.6
+ 14.31 28.62
+ 14.32 28.64
+ 14.33 28.66
+ 14.34 28.68
+ 14.35 28.7
+ 14.36 28.72
+ 14.37 28.74
+ 14.38 28.76
+ 14.39 28.78
+ 14.4 28.8
+ 14.41 28.82
+ 14.42 28.84
+ 14.43 28.86
+ 14.44 28.88
+ 14.45 28.9
+ 14.46 28.92
+ 14.47 28.94
+ 14.48 28.96
+ 14.49 28.98
+ 14.5 29
+ 14.51 29.02
+ 14.52 29.04
+ 14.53 29.06
+ 14.54 29.08
+ 14.55 29.1
+ 14.56 29.12
+ 14.57 29.14
+ 14.58 29.16
+ 14.59 29.18
+ 14.6 29.2
+ 14.61 29.22
+ 14.62 29.24
+ 14.63 29.26
+ 14.64 29.28
+ 14.65 29.3
+ 14.66 29.32
+ 14.67 29.34
+ 14.68 29.36
+ 14.69 29.38
+ 14.7 29.4
+ 14.71 29.42
+ 14.72 29.44
+ 14.73 29.46
+ 14.74 29.48
+ 14.75 29.5
+ 14.76 29.52
+ 14.77 29.54
+ 14.78 29.56
+ 14.79 29.58
+ 14.8 29.6
+ 14.81 29.62
+ 14.82 29.64
+ 14.83 29.66
+ 14.84 29.68
+ 14.85 29.7
+ 14.86 29.72
+ 14.87 29.74
+ 14.88 29.76
+ 14.89 29.78
+ 14.9 29.8
+ 14.91 29.82
+ 14.92 29.84
+ 14.93 29.86
+ 14.94 29.88
+ 14.95 29.9
+ 14.96 29.92
+ 14.97 29.94
+ 14.98 29.96
+ 14.99 29.98
+ 15 30
+ 15.01 30.02
+ 15.02 30.04
+ 15.03 30.06
+ 15.04 30.08
+ 15.05 30.1
+ 15.06 30.12
+ 15.07 30.14
+ 15.08 30.16
+ 15.09 30.18
+ 15.1 30.2
+ 15.11 30.22
+ 15.12 30.24
+ 15.13 30.26
+ 15.14 30.28
+ 15.15 30.3
+ 15.16 30.32
+ 15.17 30.34
+ 15.18 30.36
+ 15.19 30.38
+ 15.2 30.4
+ 15.21 30.42
+ 15.22 30.44
+ 15.23 30.46
+ 15.24 30.48
+ 15.25 30.5
+ 15.26 30.52
+ 15.27 30.54
+ 15.28 30.56
+ 15.29 30.58
+ 15.3 30.6
+ 15.31 30.62
+ 15.32 30.64
+ 15.33 30.66
+ 15.34 30.68
+ 15.35 30.7
+ 15.36 30.72
+ 15.37 30.74
+ 15.38 30.76
+ 15.39 30.78
+ 15.4 30.8
+ 15.41 30.82
+ 15.42 30.84
+ 15.43 30.86
+ 15.44 30.88
+ 15.45 30.9
+ 15.46 30.92
+ 15.47 30.94
+ 15.48 30.96
+ 15.49 30.98
+ 15.5 31
+ 15.51 31.02
+ 15.52 31.04
+ 15.53 31.06
+ 15.54 31.08
+ 15.55 31.1
+ 15.56 31.12
+ 15.57 31.14
+ 15.58 31.16
+ 15.59 31.18
+ 15.6 31.2
+ 15.61 31.22
+ 15.62 31.24
+ 15.63 31.26
+ 15.64 31.28
+ 15.65 31.3
+ 15.66 31.32
+ 15.67 31.34
+ 15.68 31.36
+ 15.69 31.38
+ 15.7 31.4
+ 15.71 31.42
+ 15.72 31.44
+ 15.73 31.46
+ 15.74 31.48
+ 15.75 31.5
+ 15.76 31.52
+ 15.77 31.54
+ 15.78 31.56
+ 15.79 31.58
+ 15.8 31.6
+ 15.81 31.62
+ 15.82 31.64
+ 15.83 31.66
+ 15.84 31.68
+ 15.85 31.7
+ 15.86 31.72
+ 15.87 31.74
+ 15.88 31.76
+ 15.89 31.78
+ 15.9 31.8
+ 15.91 31.82
+ 15.92 31.84
+ 15.93 31.86
+ 15.94 31.88
+ 15.95 31.9
+ 15.96 31.92
+ 15.97 31.94
+ 15.98 31.96
+ 15.99 31.98
+ 16 32
+ 16.01 32.02
+ 16.02 32.04
+ 16.03 32.06
+ 16.04 32.08
+ 16.05 32.1
+ 16.06 32.12
+ 16.07 32.14
+ 16.08 32.16
+ 16.09 32.18
+ 16.1 32.2
+ 16.11 32.22
+ 16.12 32.24
+ 16.13 32.26
+ 16.14 32.28
+ 16.15 32.3
+ 16.16 32.32
+ 16.17 32.34
+ 16.18 32.36
+ 16.19 32.38
+ 16.2 32.4
+ 16.21 32.42
+ 16.22 32.44
+ 16.23 32.46
+ 16.24 32.48
+ 16.25 32.5
+ 16.26 32.52
+ 16.27 32.54
+ 16.28 32.56
+ 16.29 32.58
+ 16.3 32.6
+ 16.31 32.62
+ 16.32 32.64
+ 16.33 32.66
+ 16.34 32.68
+ 16.35 32.7
+ 16.36 32.72
+ 16.37 32.74
+ 16.38 32.76
+ 16.39 32.78
+ 16.4 32.8
+ 16.41 32.82
+ 16.42 32.84
+ 16.43 32.86
+ 16.44 32.88
+ 16.45 32.9
+ 16.46 32.92
+ 16.47 32.94
+ 16.48 32.96
+ 16.49 32.98
+ 16.5 33
+ 16.51 33.02
+ 16.52 33.04
+ 16.53 33.06
+ 16.54 33.08
+ 16.55 33.1
+ 16.56 33.12
+ 16.57 33.14
+ 16.58 33.16
+ 16.59 33.18
+ 16.6 33.2
+ 16.61 33.22
+ 16.62 33.24
+ 16.63 33.26
+ 16.64 33.28
+ 16.65 33.3
+ 16.66 33.32
+ 16.67 33.34
+ 16.68 33.36
+ 16.69 33.38
+ 16.7 33.4
+ 16.71 33.42
+ 16.72 33.44
+ 16.73 33.46
+ 16.74 33.48
+ 16.75 33.5
+ 16.76 33.52
+ 16.77 33.54
+ 16.78 33.56
+ 16.79 33.58
+ 16.8 33.6
+ 16.81 33.62
+ 16.82 33.64
+ 16.83 33.66
+ 16.84 33.68
+ 16.85 33.7
+ 16.86 33.72
+ 16.87 33.74
+ 16.88 33.76
+ 16.89 33.78
+ 16.9 33.8
+ 16.91 33.82
+ 16.92 33.84
+ 16.93 33.86
+ 16.94 33.88
+ 16.95 33.9
+ 16.96 33.92
+ 16.97 33.94
+ 16.98 33.96
+ 16.99 33.98
+ 17 34
+ 17.01 34.02
+ 17.02 34.04
+ 17.03 34.06
+ 17.04 34.08
+ 17.05 34.1
+ 17.06 34.12
+ 17.07 34.14
+ 17.08 34.16
+ 17.09 34.18
+ 17.1 34.2
+ 17.11 34.22
+ 17.12 34.24
+ 17.13 34.26
+ 17.14 34.28
+ 17.15 34.3
+ 17.16 34.32
+ 17.17 34.34
+ 17.18 34.36
+ 17.19 34.38
+ 17.2 34.4
+ 17.21 34.42
+ 17.22 34.44
+ 17.23 34.46
+ 17.24 34.48
+ 17.25 34.5
+ 17.26 34.52
+ 17.27 34.54
+ 17.28 34.56
+ 17.29 34.58
+ 17.3 34.6
+ 17.31 34.62
+ 17.32 34.64
+ 17.33 34.66
+ 17.34 34.68
+ 17.35 34.7
+ 17.36 34.72
+ 17.37 34.74
+ 17.38 34.76
+ 17.39 34.78
+ 17.4 34.8
+ 17.41 34.82
+ 17.42 34.84
+ 17.43 34.86
+ 17.44 34.88
+ 17.45 34.9
+ 17.46 34.92
+ 17.47 34.94
+ 17.48 34.96
+ 17.49 34.98
+ 17.5 35
+ 17.51 35.02
+ 17.52 35.04
+ 17.53 35.06
+ 17.54 35.08
+ 17.55 35.1
+ 17.56 35.12
+ 17.57 35.14
+ 17.58 35.16
+ 17.59 35.18
+ 17.6 35.2
+ 17.61 35.22
+ 17.62 35.24
+ 17.63 35.26
+ 17.64 35.28
+ 17.65 35.3
+ 17.66 35.32
+ 17.67 35.34
+ 17.68 35.36
+ 17.69 35.38
+ 17.7 35.4
+ 17.71 35.42
+ 17.72 35.44
+ 17.73 35.46
+ 17.74 35.48
+ 17.75 35.5
+ 17.76 35.52
+ 17.77 35.54
+ 17.78 35.56
+ 17.79 35.58
+ 17.8 35.6
+ 17.81 35.62
+ 17.82 35.64
+ 17.83 35.66
+ 17.84 35.68
+ 17.85 35.7
+ 17.86 35.72
+ 17.87 35.74
+ 17.88 35.76
+ 17.89 35.78
+ 17.9 35.8
+ 17.91 35.82
+ 17.92 35.84
+ 17.93 35.86
+ 17.94 35.88
+ 17.95 35.9
+ 17.96 35.92
+ 17.97 35.94
+ 17.98 35.96
+ 17.99 35.98
+ 18 36
+ 18.01 36.02
+ 18.02 36.04
+ 18.03 36.06
+ 18.04 36.08
+ 18.05 36.1
+ 18.06 36.12
+ 18.07 36.14
+ 18.08 36.16
+ 18.09 36.18
+ 18.1 36.2
+ 18.11 36.22
+ 18.12 36.24
+ 18.13 36.26
+ 18.14 36.28
+ 18.15 36.3
+ 18.16 36.32
+ 18.17 36.34
+ 18.18 36.36
+ 18.19 36.38
+ 18.2 36.4
+ 18.21 36.42
+ 18.22 36.44
+ 18.23 36.46
+ 18.24 36.48
+ 18.25 36.5
+ 18.26 36.52
+ 18.27 36.54
+ 18.28 36.56
+ 18.29 36.58
+ 18.3 36.6
+ 18.31 36.62
+ 18.32 36.64
+ 18.33 36.66
+ 18.34 36.68
+ 18.35 36.7
+ 18.36 36.72
+ 18.37 36.74
+ 18.38 36.76
+ 18.39 36.78
+ 18.4 36.8
+ 18.41 36.82
+ 18.42 36.84
+ 18.43 36.86
+ 18.44 36.88
+ 18.45 36.9
+ 18.46 36.92
+ 18.47 36.94
+ 18.48 36.96
+ 18.49 36.98
+ 18.5 37
+ 18.51 37.02
+ 18.52 37.04
+ 18.53 37.06
+ 18.54 37.08
+ 18.55 37.1
+ 18.56 37.12
+ 18.57 37.14
+ 18.58 37.16
+ 18.59 37.18
+ 18.6 37.2
+ 18.61 37.22
+ 18.62 37.24
+ 18.63 37.26
+ 18.64 37.28
+ 18.65 37.3
+ 18.66 37.32
+ 18.67 37.34
+ 18.68 37.36
+ 18.69 37.38
+ 18.7 37.4
+ 18.71 37.42
+ 18.72 37.44
+ 18.73 37.46
+ 18.74 37.48
+ 18.75 37.5
+ 18.76 37.52
+ 18.77 37.54
+ 18.78 37.56
+ 18.79 37.58
+ 18.8 37.6
+ 18.81 37.62
+ 18.82 37.64
+ 18.83 37.66
+ 18.84 37.68
+ 18.85 37.7
+ 18.86 37.72
+ 18.87 37.74
+ 18.88 37.76
+ 18.89 37.78
+ 18.9 37.8
+ 18.91 37.82
+ 18.92 37.84
+ 18.93 37.86
+ 18.94 37.88
+ 18.95 37.9
+ 18.96 37.92
+ 18.97 37.94
+ 18.98 37.96
+ 18.99 37.98
+ 19 38
+ 19.01 38.02
+ 19.02 38.04
+ 19.03 38.06
+ 19.04 38.08
+ 19.05 38.1
+ 19.06 38.12
+ 19.07 38.14
+ 19.08 38.16
+ 19.09 38.18
+ 19.1 38.2
+ 19.11 38.22
+ 19.12 38.24
+ 19.13 38.26
+ 19.14 38.28
+ 19.15 38.3
+ 19.16 38.32
+ 19.17 38.34
+ 19.18 38.36
+ 19.19 38.38
+ 19.2 38.4
+ 19.21 38.42
+ 19.22 38.44
+ 19.23 38.46
+ 19.24 38.48
+ 19.25 38.5
+ 19.26 38.52
+ 19.27 38.54
+ 19.28 38.56
+ 19.29 38.58
+ 19.3 38.6
+ 19.31 38.62
+ 19.32 38.64
+ 19.33 38.66
+ 19.34 38.68
+ 19.35 38.7
+ 19.36 38.72
+ 19.37 38.74
+ 19.38 38.76
+ 19.39 38.78
+ 19.4 38.8
+ 19.41 38.82
+ 19.42 38.84
+ 19.43 38.86
+ 19.44 38.88
+ 19.45 38.9
+ 19.46 38.92
+ 19.47 38.94
+ 19.48 38.96
+ 19.49 38.98
+ 19.5 39
+ 19.51 39.02
+ 19.52 39.04
+ 19.53 39.06
+ 19.54 39.08
+ 19.55 39.1
+ 19.56 39.12
+ 19.57 39.14
+ 19.58 39.16
+ 19.59 39.18
+ 19.6 39.2
+ 19.61 39.22
+ 19.62 39.24
+ 19.63 39.26
+ 19.64 39.28
+ 19.65 39.3
+ 19.66 39.32
+ 19.67 39.34
+ 19.68 39.36
+ 19.69 39.38
+ 19.7 39.4
+ 19.71 39.42
+ 19.72 39.44
+ 19.73 39.46
+ 19.74 39.48
+ 19.75 39.5
+ 19.76 39.52
+ 19.77 39.54
+ 19.78 39.56
+ 19.79 39.58
+ 19.8 39.6
+ 19.81 39.62
+ 19.82 39.64
+ 19.83 39.66
+ 19.84 39.68
+ 19.85 39.7
+ 19.86 39.72
+ 19.87 39.74
+ 19.88 39.76
+ 19.89 39.78
+ 19.9 39.8
+ 19.91 39.82
+ 19.92 39.84
+ 19.93 39.86
+ 19.94 39.88
+ 19.95 39.9
+ 19.96 39.92
+ 19.97 39.94
+ 19.98 39.96
+ 19.99 39.98
+ 20 40
+&
+ at TARGET S4
+ at TYPE xy
+ 0.01 4.7619
+ 0.02 4.7619
+ 0.03 4.7619
+ 0.04 4.7619
+ 0.05 4.7619
+ 0.06 4.7619
+ 0.07 4.7619
+ 0.08 4.7619
+ 0.09 4.7619
+ 0.1 4.7619
+ 0.11 4.7619
+ 0.12 4.7619
+ 0.13 4.7619
+ 0.14 4.7619
+ 0.15 4.7619
+ 0.16 4.7619
+ 0.17 4.7619
+ 0.18 4.7619
+ 0.19 4.7619
+ 0.2 4.7619
+ 0.21 4.7619
+ 0.22 4.7619
+ 0.23 4.7619
+ 0.24 4.7619
+ 0.25 4.7619
+ 0.26 4.7619
+ 0.27 4.7619
+ 0.28 4.7619
+ 0.29 4.7619
+ 0.3 4.7619
+ 0.31 4.7619
+ 0.32 4.7619
+ 0.33 4.7619
+ 0.34 4.7619
+ 0.35 4.7619
+ 0.36 4.7619
+ 0.37 4.7619
+ 0.38 4.7619
+ 0.39 4.7619
+ 0.4 4.7619
+ 0.41 4.7619
+ 0.42 4.7619
+ 0.43 4.7619
+ 0.44 4.7619
+ 0.45 4.7619
+ 0.46 4.7619
+ 0.47 4.7619
+ 0.48 4.7619
+ 0.49 4.7619
+ 0.5 4.7619
+ 0.51 4.7619
+ 0.52 4.7619
+ 0.53 4.7619
+ 0.54 4.7619
+ 0.55 4.7619
+ 0.56 4.7619
+ 0.57 4.7619
+ 0.58 4.7619
+ 0.59 4.7619
+ 0.6 4.7619
+ 0.61 4.7619
+ 0.62 4.7619
+ 0.63 4.7619
+ 0.64 4.7619
+ 0.65 4.7619
+ 0.66 4.7619
+ 0.67 4.7619
+ 0.68 4.7619
+ 0.69 4.7619
+ 0.7 4.7619
+ 0.71 4.7619
+ 0.72 4.7619
+ 0.73 4.7619
+ 0.74 4.7619
+ 0.75 4.7619
+ 0.76 4.7619
+ 0.77 4.7619
+ 0.78 4.7619
+ 0.79 4.7619
+ 0.8 4.7619
+ 0.81 4.7619
+ 0.82 4.7619
+ 0.83 4.7619
+ 0.84 4.7619
+ 0.85 4.7619
+ 0.86 4.7619
+ 0.87 4.7619
+ 0.88 4.7619
+ 0.89 4.7619
+ 0.9 4.7619
+ 0.91 4.7619
+ 0.92 4.7619
+ 0.93 4.7619
+ 0.94 4.7619
+ 0.95 4.7619
+ 0.96 4.7619
+ 0.97 4.7619
+ 0.98 4.7619
+ 0.99 4.7619
+ 1 4.7619
+ 1.01 4.7619
+ 1.02 4.7619
+ 1.03 4.7619
+ 1.04 4.7619
+ 1.05 4.7619
+ 1.06 4.7619
+ 1.07 4.7619
+ 1.08 4.7619
+ 1.09 4.7619
+ 1.1 4.7619
+ 1.11 4.7619
+ 1.12 4.7619
+ 1.13 4.7619
+ 1.14 4.7619
+ 1.15 4.7619
+ 1.16 4.7619
+ 1.17 4.7619
+ 1.18 4.7619
+ 1.19 4.7619
+ 1.2 4.7619
+ 1.21 4.7619
+ 1.22 4.7619
+ 1.23 4.7619
+ 1.24 4.7619
+ 1.25 4.7619
+ 1.26 4.7619
+ 1.27 4.7619
+ 1.28 4.7619
+ 1.29 4.7619
+ 1.3 4.7619
+ 1.31 4.7619
+ 1.32 4.7619
+ 1.33 4.7619
+ 1.34 4.7619
+ 1.35 4.7619
+ 1.36 4.7619
+ 1.37 4.7619
+ 1.38 4.7619
+ 1.39 4.7619
+ 1.4 4.7619
+ 1.41 4.7619
+ 1.42 4.7619
+ 1.43 4.7619
+ 1.44 4.7619
+ 1.45 4.7619
+ 1.46 4.7619
+ 1.47 4.7619
+ 1.48 4.7619
+ 1.49 4.7619
+ 1.5 4.7619
+ 1.51 4.7619
+ 1.52 4.7619
+ 1.53 4.7619
+ 1.54 4.7619
+ 1.55 4.7619
+ 1.56 4.7619
+ 1.57 4.7619
+ 1.58 4.7619
+ 1.59 4.7619
+ 1.6 4.7619
+ 1.61 4.7619
+ 1.62 4.7619
+ 1.63 4.7619
+ 1.64 4.7619
+ 1.65 4.7619
+ 1.66 4.7619
+ 1.67 4.7619
+ 1.68 4.7619
+ 1.69 4.7619
+ 1.7 4.7619
+ 1.71 4.7619
+ 1.72 4.7619
+ 1.73 4.7619
+ 1.74 4.7619
+ 1.75 4.7619
+ 1.76 4.7619
+ 1.77 4.7619
+ 1.78 4.7619
+ 1.79 4.7619
+ 1.8 4.7619
+ 1.81 4.7619
+ 1.82 4.7619
+ 1.83 4.7619
+ 1.84 4.7619
+ 1.85 4.7619
+ 1.86 4.7619
+ 1.87 4.7619
+ 1.88 4.7619
+ 1.89 4.7619
+ 1.9 4.7619
+ 1.91 4.7619
+ 1.92 4.7619
+ 1.93 4.7619
+ 1.94 4.7619
+ 1.95 4.7619
+ 1.96 4.7619
+ 1.97 4.7619
+ 1.98 4.7619
+ 1.99 4.7619
+ 2 4.7619
+ 2.01 4.7619
+ 2.02 4.7619
+ 2.03 4.7619
+ 2.04 4.7619
+ 2.05 4.7619
+ 2.06 4.7619
+ 2.07 4.7619
+ 2.08 4.7619
+ 2.09 4.7619
+ 2.1 4.7619
+ 2.11 4.7619
+ 2.12 4.7619
+ 2.13 4.7619
+ 2.14 4.7619
+ 2.15 4.7619
+ 2.16 4.7619
+ 2.17 4.7619
+ 2.18 4.7619
+ 2.19 4.7619
+ 2.2 4.7619
+ 2.21 4.7619
+ 2.22 4.7619
+ 2.23 4.7619
+ 2.24 4.7619
+ 2.25 4.7619
+ 2.26 4.7619
+ 2.27 4.7619
+ 2.28 4.7619
+ 2.29 4.7619
+ 2.3 4.7619
+ 2.31 4.7619
+ 2.32 4.7619
+ 2.33 4.7619
+ 2.34 4.7619
+ 2.35 4.7619
+ 2.36 4.7619
+ 2.37 4.7619
+ 2.38 4.7619
+ 2.39 4.7619
+ 2.4 4.7619
+ 2.41 4.7619
+ 2.42 4.7619
+ 2.43 4.7619
+ 2.44 4.7619
+ 2.45 4.7619
+ 2.46 4.7619
+ 2.47 4.7619
+ 2.48 4.7619
+ 2.49 4.7619
+ 2.5 4.7619
+ 2.51 4.7619
+ 2.52 4.7619
+ 2.53 4.7619
+ 2.54 4.7619
+ 2.55 4.7619
+ 2.56 4.7619
+ 2.57 4.7619
+ 2.58 4.7619
+ 2.59 4.7619
+ 2.6 4.7619
+ 2.61 4.7619
+ 2.62 4.7619
+ 2.63 4.7619
+ 2.64 4.7619
+ 2.65 4.7619
+ 2.66 4.7619
+ 2.67 4.7619
+ 2.68 4.7619
+ 2.69 4.7619
+ 2.7 4.7619
+ 2.71 4.7619
+ 2.72 4.7619
+ 2.73 4.7619
+ 2.74 4.7619
+ 2.75 4.7619
+ 2.76 4.7619
+ 2.77 4.7619
+ 2.78 4.7619
+ 2.79 4.7619
+ 2.8 4.7619
+ 2.81 4.7619
+ 2.82 4.7619
+ 2.83 4.7619
+ 2.84 4.7619
+ 2.85 4.7619
+ 2.86 4.7619
+ 2.87 4.7619
+ 2.88 4.7619
+ 2.89 4.7619
+ 2.9 4.7619
+ 2.91 4.7619
+ 2.92 4.7619
+ 2.93 4.7619
+ 2.94 4.7619
+ 2.95 4.7619
+ 2.96 4.7619
+ 2.97 4.7619
+ 2.98 4.7619
+ 2.99 4.7619
+ 3 4.7619
+ 3.01 4.7619
+ 3.02 4.7619
+ 3.03 4.7619
+ 3.04 4.7619
+ 3.05 4.7619
+ 3.06 4.7619
+ 3.07 4.7619
+ 3.08 4.7619
+ 3.09 4.7619
+ 3.1 4.7619
+ 3.11 4.7619
+ 3.12 4.7619
+ 3.13 4.7619
+ 3.14 4.7619
+ 3.15 4.7619
+ 3.16 4.7619
+ 3.17 4.7619
+ 3.18 4.7619
+ 3.19 4.7619
+ 3.2 4.7619
+ 3.21 4.7619
+ 3.22 4.7619
+ 3.23 4.7619
+ 3.24 4.7619
+ 3.25 4.7619
+ 3.26 4.7619
+ 3.27 4.7619
+ 3.28 4.7619
+ 3.29 4.7619
+ 3.3 4.7619
+ 3.31 4.7619
+ 3.32 4.7619
+ 3.33 4.7619
+ 3.34 4.7619
+ 3.35 4.7619
+ 3.36 4.7619
+ 3.37 4.7619
+ 3.38 4.7619
+ 3.39 4.7619
+ 3.4 4.7619
+ 3.41 4.7619
+ 3.42 4.7619
+ 3.43 4.7619
+ 3.44 4.7619
+ 3.45 4.7619
+ 3.46 4.7619
+ 3.47 4.7619
+ 3.48 4.7619
+ 3.49 4.7619
+ 3.5 4.7619
+ 3.51 4.7619
+ 3.52 4.7619
+ 3.53 4.7619
+ 3.54 4.7619
+ 3.55 4.7619
+ 3.56 4.7619
+ 3.57 4.7619
+ 3.58 4.7619
+ 3.59 4.7619
+ 3.6 4.7619
+ 3.61 4.7619
+ 3.62 4.7619
+ 3.63 4.7619
+ 3.64 4.7619
+ 3.65 4.7619
+ 3.66 4.7619
+ 3.67 4.7619
+ 3.68 4.7619
+ 3.69 4.7619
+ 3.7 4.7619
+ 3.71 4.7619
+ 3.72 4.7619
+ 3.73 4.7619
+ 3.74 4.7619
+ 3.75 4.7619
+ 3.76 4.7619
+ 3.77 4.7619
+ 3.78 4.7619
+ 3.79 4.7619
+ 3.8 4.7619
+ 3.81 4.7619
+ 3.82 4.7619
+ 3.83 4.7619
+ 3.84 4.7619
+ 3.85 4.7619
+ 3.86 4.7619
+ 3.87 4.7619
+ 3.88 4.7619
+ 3.89 4.7619
+ 3.9 4.7619
+ 3.91 4.7619
+ 3.92 4.7619
+ 3.93 4.7619
+ 3.94 4.7619
+ 3.95 4.7619
+ 3.96 4.7619
+ 3.97 4.7619
+ 3.98 4.7619
+ 3.99 4.7619
+ 4 4.7619
+ 4.01 4.7619
+ 4.02 4.7619
+ 4.03 4.7619
+ 4.04 4.7619
+ 4.05 4.7619
+ 4.06 4.7619
+ 4.07 4.7619
+ 4.08 4.7619
+ 4.09 4.7619
+ 4.1 4.7619
+ 4.11 4.7619
+ 4.12 4.7619
+ 4.13 4.7619
+ 4.14 4.7619
+ 4.15 4.7619
+ 4.16 4.7619
+ 4.17 4.7619
+ 4.18 4.7619
+ 4.19 4.7619
+ 4.2 4.7619
+ 4.21 4.7619
+ 4.22 4.7619
+ 4.23 4.7619
+ 4.24 4.7619
+ 4.25 4.7619
+ 4.26 4.7619
+ 4.27 4.7619
+ 4.28 4.7619
+ 4.29 4.7619
+ 4.3 4.7619
+ 4.31 4.7619
+ 4.32 4.7619
+ 4.33 4.7619
+ 4.34 4.7619
+ 4.35 4.7619
+ 4.36 4.7619
+ 4.37 4.7619
+ 4.38 4.7619
+ 4.39 4.7619
+ 4.4 4.7619
+ 4.41 4.7619
+ 4.42 4.7619
+ 4.43 4.7619
+ 4.44 4.7619
+ 4.45 4.7619
+ 4.46 4.7619
+ 4.47 4.7619
+ 4.48 4.7619
+ 4.49 4.7619
+ 4.5 4.7619
+ 4.51 4.7619
+ 4.52 4.7619
+ 4.53 4.7619
+ 4.54 4.7619
+ 4.55 4.7619
+ 4.56 4.7619
+ 4.57 4.7619
+ 4.58 4.7619
+ 4.59 4.7619
+ 4.6 4.7619
+ 4.61 4.7619
+ 4.62 4.7619
+ 4.63 4.7619
+ 4.64 4.7619
+ 4.65 4.7619
+ 4.66 4.7619
+ 4.67 4.7619
+ 4.68 4.7619
+ 4.69 4.7619
+ 4.7 4.7619
+ 4.71 4.7619
+ 4.72 4.7619
+ 4.73 4.7619
+ 4.74 4.7619
+ 4.75 4.7619
+ 4.76 4.7619
+ 4.77 4.7619
+ 4.78 4.7619
+ 4.79 4.7619
+ 4.8 4.7619
+ 4.81 4.7619
+ 4.82 4.7619
+ 4.83 4.7619
+ 4.84 4.7619
+ 4.85 4.7619
+ 4.86 4.7619
+ 4.87 4.7619
+ 4.88 4.7619
+ 4.89 4.7619
+ 4.9 4.7619
+ 4.91 4.7619
+ 4.92 4.7619
+ 4.93 4.7619
+ 4.94 4.7619
+ 4.95 4.7619
+ 4.96 4.7619
+ 4.97 4.7619
+ 4.98 4.7619
+ 4.99 4.7619
+ 5 4.7619
+ 5.01 4.7619
+ 5.02 4.7619
+ 5.03 4.7619
+ 5.04 4.7619
+ 5.05 4.7619
+ 5.06 4.7619
+ 5.07 4.7619
+ 5.08 4.7619
+ 5.09 4.7619
+ 5.1 4.7619
+ 5.11 4.7619
+ 5.12 4.7619
+ 5.13 4.7619
+ 5.14 4.7619
+ 5.15 4.7619
+ 5.16 4.7619
+ 5.17 4.7619
+ 5.18 4.7619
+ 5.19 4.7619
+ 5.2 4.7619
+ 5.21 4.7619
+ 5.22 4.7619
+ 5.23 4.7619
+ 5.24 4.7619
+ 5.25 4.7619
+ 5.26 4.7619
+ 5.27 4.7619
+ 5.28 4.7619
+ 5.29 4.7619
+ 5.3 4.7619
+ 5.31 4.7619
+ 5.32 4.7619
+ 5.33 4.7619
+ 5.34 4.7619
+ 5.35 4.7619
+ 5.36 4.7619
+ 5.37 4.7619
+ 5.38 4.7619
+ 5.39 4.7619
+ 5.4 4.7619
+ 5.41 4.7619
+ 5.42 4.7619
+ 5.43 4.7619
+ 5.44 4.7619
+ 5.45 4.7619
+ 5.46 4.7619
+ 5.47 4.7619
+ 5.48 4.7619
+ 5.49 4.7619
+ 5.5 4.7619
+ 5.51 4.7619
+ 5.52 4.7619
+ 5.53 4.7619
+ 5.54 4.7619
+ 5.55 4.7619
+ 5.56 4.7619
+ 5.57 4.7619
+ 5.58 4.7619
+ 5.59 4.7619
+ 5.6 4.7619
+ 5.61 4.7619
+ 5.62 4.7619
+ 5.63 4.7619
+ 5.64 4.7619
+ 5.65 4.7619
+ 5.66 4.7619
+ 5.67 4.7619
+ 5.68 4.7619
+ 5.69 4.7619
+ 5.7 4.7619
+ 5.71 4.7619
+ 5.72 4.7619
+ 5.73 4.7619
+ 5.74 4.7619
+ 5.75 4.7619
+ 5.76 4.7619
+ 5.77 4.7619
+ 5.78 4.7619
+ 5.79 4.7619
+ 5.8 4.7619
+ 5.81 4.7619
+ 5.82 4.7619
+ 5.83 4.7619
+ 5.84 4.7619
+ 5.85 4.7619
+ 5.86 4.7619
+ 5.87 4.7619
+ 5.88 4.7619
+ 5.89 4.7619
+ 5.9 4.7619
+ 5.91 4.7619
+ 5.92 4.7619
+ 5.93 4.7619
+ 5.94 4.7619
+ 5.95 4.7619
+ 5.96 4.7619
+ 5.97 4.7619
+ 5.98 4.7619
+ 5.99 4.7619
+ 6 4.7619
+ 6.01 4.7619
+ 6.02 4.7619
+ 6.03 4.7619
+ 6.04 4.7619
+ 6.05 4.7619
+ 6.06 4.7619
+ 6.07 4.7619
+ 6.08 4.7619
+ 6.09 4.7619
+ 6.1 4.7619
+ 6.11 4.7619
+ 6.12 4.7619
+ 6.13 4.7619
+ 6.14 4.7619
+ 6.15 4.7619
+ 6.16 4.7619
+ 6.17 4.7619
+ 6.18 4.7619
+ 6.19 4.7619
+ 6.2 4.7619
+ 6.21 4.7619
+ 6.22 4.7619
+ 6.23 4.7619
+ 6.24 4.7619
+ 6.25 4.7619
+ 6.26 4.7619
+ 6.27 4.7619
+ 6.28 4.7619
+ 6.29 4.7619
+ 6.3 4.7619
+ 6.31 4.7619
+ 6.32 4.7619
+ 6.33 4.7619
+ 6.34 4.7619
+ 6.35 4.7619
+ 6.36 4.7619
+ 6.37 4.7619
+ 6.38 4.7619
+ 6.39 4.7619
+ 6.4 4.7619
+ 6.41 4.7619
+ 6.42 4.7619
+ 6.43 4.7619
+ 6.44 4.7619
+ 6.45 4.7619
+ 6.46 4.7619
+ 6.47 4.7619
+ 6.48 4.7619
+ 6.49 4.7619
+ 6.5 4.7619
+ 6.51 4.7619
+ 6.52 4.7619
+ 6.53 4.7619
+ 6.54 4.7619
+ 6.55 4.7619
+ 6.56 4.7619
+ 6.57 4.7619
+ 6.58 4.7619
+ 6.59 4.7619
+ 6.6 4.7619
+ 6.61 4.7619
+ 6.62 4.7619
+ 6.63 4.7619
+ 6.64 4.7619
+ 6.65 4.7619
+ 6.66 4.7619
+ 6.67 4.7619
+ 6.68 4.7619
+ 6.69 4.7619
+ 6.7 4.7619
+ 6.71 4.7619
+ 6.72 4.7619
+ 6.73 4.7619
+ 6.74 4.7619
+ 6.75 4.7619
+ 6.76 4.7619
+ 6.77 4.7619
+ 6.78 4.7619
+ 6.79 4.7619
+ 6.8 4.7619
+ 6.81 4.7619
+ 6.82 4.7619
+ 6.83 4.7619
+ 6.84 4.7619
+ 6.85 4.7619
+ 6.86 4.7619
+ 6.87 4.7619
+ 6.88 4.7619
+ 6.89 4.7619
+ 6.9 4.7619
+ 6.91 4.7619
+ 6.92 4.7619
+ 6.93 4.7619
+ 6.94 4.7619
+ 6.95 4.7619
+ 6.96 4.7619
+ 6.97 4.7619
+ 6.98 4.7619
+ 6.99 4.7619
+ 7 4.7619
+ 7.01 4.7619
+ 7.02 4.7619
+ 7.03 4.7619
+ 7.04 4.7619
+ 7.05 4.7619
+ 7.06 4.7619
+ 7.07 4.7619
+ 7.08 4.7619
+ 7.09 4.7619
+ 7.1 4.7619
+ 7.11 4.7619
+ 7.12 4.7619
+ 7.13 4.7619
+ 7.14 4.7619
+ 7.15 4.7619
+ 7.16 4.7619
+ 7.17 4.7619
+ 7.18 4.7619
+ 7.19 4.7619
+ 7.2 4.7619
+ 7.21 4.7619
+ 7.22 4.7619
+ 7.23 4.7619
+ 7.24 4.7619
+ 7.25 4.7619
+ 7.26 4.7619
+ 7.27 4.7619
+ 7.28 4.7619
+ 7.29 4.7619
+ 7.3 4.7619
+ 7.31 4.7619
+ 7.32 4.7619
+ 7.33 4.7619
+ 7.34 4.7619
+ 7.35 4.7619
+ 7.36 4.7619
+ 7.37 4.7619
+ 7.38 4.7619
+ 7.39 4.7619
+ 7.4 4.7619
+ 7.41 4.7619
+ 7.42 4.7619
+ 7.43 4.7619
+ 7.44 4.7619
+ 7.45 4.7619
+ 7.46 4.7619
+ 7.47 4.7619
+ 7.48 4.7619
+ 7.49 4.7619
+ 7.5 4.7619
+ 7.51 4.7619
+ 7.52 4.7619
+ 7.53 4.7619
+ 7.54 4.7619
+ 7.55 4.7619
+ 7.56 4.7619
+ 7.57 4.7619
+ 7.58 4.7619
+ 7.59 4.7619
+ 7.6 4.7619
+ 7.61 4.7619
+ 7.62 4.7619
+ 7.63 4.7619
+ 7.64 4.7619
+ 7.65 4.7619
+ 7.66 4.7619
+ 7.67 4.7619
+ 7.68 4.7619
+ 7.69 4.7619
+ 7.7 4.7619
+ 7.71 4.7619
+ 7.72 4.7619
+ 7.73 4.7619
+ 7.74 4.7619
+ 7.75 4.7619
+ 7.76 4.7619
+ 7.77 4.7619
+ 7.78 4.7619
+ 7.79 4.7619
+ 7.8 4.7619
+ 7.81 4.7619
+ 7.82 4.7619
+ 7.83 4.7619
+ 7.84 4.7619
+ 7.85 4.7619
+ 7.86 4.7619
+ 7.87 4.7619
+ 7.88 4.7619
+ 7.89 4.7619
+ 7.9 4.7619
+ 7.91 4.7619
+ 7.92 4.7619
+ 7.93 4.7619
+ 7.94 4.7619
+ 7.95 4.7619
+ 7.96 4.7619
+ 7.97 4.7619
+ 7.98 4.7619
+ 7.99 4.7619
+ 8 4.7619
+ 8.01 4.7619
+ 8.02 4.7619
+ 8.03 4.7619
+ 8.04 4.7619
+ 8.05 4.7619
+ 8.06 4.7619
+ 8.07 4.7619
+ 8.08 4.7619
+ 8.09 4.7619
+ 8.1 4.7619
+ 8.11 4.7619
+ 8.12 4.7619
+ 8.13 4.7619
+ 8.14 4.7619
+ 8.15 4.7619
+ 8.16 4.7619
+ 8.17 4.7619
+ 8.18 4.7619
+ 8.19 4.7619
+ 8.2 4.7619
+ 8.21 4.7619
+ 8.22 4.7619
+ 8.23 4.7619
+ 8.24 4.7619
+ 8.25 4.7619
+ 8.26 4.7619
+ 8.27 4.7619
+ 8.28 4.7619
+ 8.29 4.7619
+ 8.3 4.7619
+ 8.31 4.7619
+ 8.32 4.7619
+ 8.33 4.7619
+ 8.34 4.7619
+ 8.35 4.7619
+ 8.36 4.7619
+ 8.37 4.7619
+ 8.38 4.7619
+ 8.39 4.7619
+ 8.4 4.7619
+ 8.41 4.7619
+ 8.42 4.7619
+ 8.43 4.7619
+ 8.44 4.7619
+ 8.45 4.7619
+ 8.46 4.7619
+ 8.47 4.7619
+ 8.48 4.7619
+ 8.49 4.7619
+ 8.5 4.7619
+ 8.51 4.7619
+ 8.52 4.7619
+ 8.53 4.7619
+ 8.54 4.7619
+ 8.55 4.7619
+ 8.56 4.7619
+ 8.57 4.7619
+ 8.58 4.7619
+ 8.59 4.7619
+ 8.6 4.7619
+ 8.61 4.7619
+ 8.62 4.7619
+ 8.63 4.7619
+ 8.64 4.7619
+ 8.65 4.7619
+ 8.66 4.7619
+ 8.67 4.7619
+ 8.68 4.7619
+ 8.69 4.7619
+ 8.7 4.7619
+ 8.71 4.7619
+ 8.72 4.7619
+ 8.73 4.7619
+ 8.74 4.7619
+ 8.75 4.7619
+ 8.76 4.7619
+ 8.77 4.7619
+ 8.78 4.7619
+ 8.79 4.7619
+ 8.8 4.7619
+ 8.81 4.7619
+ 8.82 4.7619
+ 8.83 4.7619
+ 8.84 4.7619
+ 8.85 4.7619
+ 8.86 4.7619
+ 8.87 4.7619
+ 8.88 4.7619
+ 8.89 4.7619
+ 8.9 4.7619
+ 8.91 4.7619
+ 8.92 4.7619
+ 8.93 4.7619
+ 8.94 4.7619
+ 8.95 4.7619
+ 8.96 4.7619
+ 8.97 4.7619
+ 8.98 4.7619
+ 8.99 4.7619
+ 9 4.7619
+ 9.01 4.7619
+ 9.02 4.7619
+ 9.03 4.7619
+ 9.04 4.7619
+ 9.05 4.7619
+ 9.06 4.7619
+ 9.07 4.7619
+ 9.08 4.7619
+ 9.09 4.7619
+ 9.1 4.7619
+ 9.11 4.7619
+ 9.12 4.7619
+ 9.13 4.7619
+ 9.14 4.7619
+ 9.15 4.7619
+ 9.16 4.7619
+ 9.17 4.7619
+ 9.18 4.7619
+ 9.19 4.7619
+ 9.2 4.7619
+ 9.21 4.7619
+ 9.22 4.7619
+ 9.23 4.7619
+ 9.24 4.7619
+ 9.25 4.7619
+ 9.26 4.7619
+ 9.27 4.7619
+ 9.28 4.7619
+ 9.29 4.7619
+ 9.3 4.7619
+ 9.31 4.7619
+ 9.32 4.7619
+ 9.33 4.7619
+ 9.34 4.7619
+ 9.35 4.7619
+ 9.36 4.7619
+ 9.37 4.7619
+ 9.38 4.7619
+ 9.39 4.7619
+ 9.4 4.7619
+ 9.41 4.7619
+ 9.42 4.7619
+ 9.43 4.7619
+ 9.44 4.7619
+ 9.45 4.7619
+ 9.46 4.7619
+ 9.47 4.7619
+ 9.48 4.7619
+ 9.49 4.7619
+ 9.5 4.7619
+ 9.51 4.7619
+ 9.52 4.7619
+ 9.53 4.7619
+ 9.54 4.7619
+ 9.55 4.7619
+ 9.56 4.7619
+ 9.57 4.7619
+ 9.58 4.7619
+ 9.59 4.7619
+ 9.6 4.7619
+ 9.61 4.7619
+ 9.62 4.7619
+ 9.63 4.7619
+ 9.64 4.7619
+ 9.65 4.7619
+ 9.66 4.7619
+ 9.67 4.7619
+ 9.68 4.7619
+ 9.69 4.7619
+ 9.7 4.7619
+ 9.71 4.7619
+ 9.72 4.7619
+ 9.73 4.7619
+ 9.74 4.7619
+ 9.75 4.7619
+ 9.76 4.7619
+ 9.77 4.7619
+ 9.78 4.7619
+ 9.79 4.7619
+ 9.8 4.7619
+ 9.81 4.7619
+ 9.82 4.7619
+ 9.83 4.7619
+ 9.84 4.7619
+ 9.85 4.7619
+ 9.86 4.7619
+ 9.87 4.7619
+ 9.88 4.7619
+ 9.89 4.7619
+ 9.9 4.7619
+ 9.91 4.7619
+ 9.92 4.7619
+ 9.93 4.7619
+ 9.94 4.7619
+ 9.95 4.7619
+ 9.96 4.7619
+ 9.97 4.7619
+ 9.98 4.7619
+ 9.99 4.7619
+ 10 4.7619
+ 10.01 4.7619
+ 10.02 4.7619
+ 10.03 4.7619
+ 10.04 4.7619
+ 10.05 4.7619
+ 10.06 4.7619
+ 10.07 4.7619
+ 10.08 4.7619
+ 10.09 4.7619
+ 10.1 4.7619
+ 10.11 4.7619
+ 10.12 4.7619
+ 10.13 4.7619
+ 10.14 4.7619
+ 10.15 4.7619
+ 10.16 4.7619
+ 10.17 4.7619
+ 10.18 4.7619
+ 10.19 4.7619
+ 10.2 4.7619
+ 10.21 4.7619
+ 10.22 4.7619
+ 10.23 4.7619
+ 10.24 4.7619
+ 10.25 4.7619
+ 10.26 4.7619
+ 10.27 4.7619
+ 10.28 4.7619
+ 10.29 4.7619
+ 10.3 4.7619
+ 10.31 4.7619
+ 10.32 4.7619
+ 10.33 4.7619
+ 10.34 4.7619
+ 10.35 4.7619
+ 10.36 4.7619
+ 10.37 4.7619
+ 10.38 4.7619
+ 10.39 4.7619
+ 10.4 4.7619
+ 10.41 4.7619
+ 10.42 4.7619
+ 10.43 4.7619
+ 10.44 4.7619
+ 10.45 4.7619
+ 10.46 4.7619
+ 10.47 4.7619
+ 10.48 4.7619
+ 10.49 4.7619
+ 10.5 4.7619
+ 10.51 4.7619
+ 10.52 4.7619
+ 10.53 4.7619
+ 10.54 4.7619
+ 10.55 4.7619
+ 10.56 4.7619
+ 10.57 4.7619
+ 10.58 4.7619
+ 10.59 4.7619
+ 10.6 4.7619
+ 10.61 4.7619
+ 10.62 4.7619
+ 10.63 4.7619
+ 10.64 4.7619
+ 10.65 4.7619
+ 10.66 4.7619
+ 10.67 4.7619
+ 10.68 4.7619
+ 10.69 4.7619
+ 10.7 4.7619
+ 10.71 4.7619
+ 10.72 4.7619
+ 10.73 4.7619
+ 10.74 4.7619
+ 10.75 4.7619
+ 10.76 4.7619
+ 10.77 4.7619
+ 10.78 4.7619
+ 10.79 4.7619
+ 10.8 4.7619
+ 10.81 4.7619
+ 10.82 4.7619
+ 10.83 4.7619
+ 10.84 4.7619
+ 10.85 4.7619
+ 10.86 4.7619
+ 10.87 4.7619
+ 10.88 4.7619
+ 10.89 4.7619
+ 10.9 4.7619
+ 10.91 4.7619
+ 10.92 4.7619
+ 10.93 4.7619
+ 10.94 4.7619
+ 10.95 4.7619
+ 10.96 4.7619
+ 10.97 4.7619
+ 10.98 4.7619
+ 10.99 4.7619
+ 11 4.7619
+ 11.01 4.7619
+ 11.02 4.7619
+ 11.03 4.7619
+ 11.04 4.7619
+ 11.05 4.7619
+ 11.06 4.7619
+ 11.07 4.7619
+ 11.08 4.7619
+ 11.09 4.7619
+ 11.1 4.7619
+ 11.11 4.7619
+ 11.12 4.7619
+ 11.13 4.7619
+ 11.14 4.7619
+ 11.15 4.7619
+ 11.16 4.7619
+ 11.17 4.7619
+ 11.18 4.7619
+ 11.19 4.7619
+ 11.2 4.7619
+ 11.21 4.7619
+ 11.22 4.7619
+ 11.23 4.7619
+ 11.24 4.7619
+ 11.25 4.7619
+ 11.26 4.7619
+ 11.27 4.7619
+ 11.28 4.7619
+ 11.29 4.7619
+ 11.3 4.7619
+ 11.31 4.7619
+ 11.32 4.7619
+ 11.33 4.7619
+ 11.34 4.7619
+ 11.35 4.7619
+ 11.36 4.7619
+ 11.37 4.7619
+ 11.38 4.7619
+ 11.39 4.7619
+ 11.4 4.7619
+ 11.41 4.7619
+ 11.42 4.7619
+ 11.43 4.7619
+ 11.44 4.7619
+ 11.45 4.7619
+ 11.46 4.7619
+ 11.47 4.7619
+ 11.48 4.7619
+ 11.49 4.7619
+ 11.5 4.7619
+ 11.51 4.7619
+ 11.52 4.7619
+ 11.53 4.7619
+ 11.54 4.7619
+ 11.55 4.7619
+ 11.56 4.7619
+ 11.57 4.7619
+ 11.58 4.7619
+ 11.59 4.7619
+ 11.6 4.7619
+ 11.61 4.7619
+ 11.62 4.7619
+ 11.63 4.7619
+ 11.64 4.7619
+ 11.65 4.7619
+ 11.66 4.7619
+ 11.67 4.7619
+ 11.68 4.7619
+ 11.69 4.7619
+ 11.7 4.7619
+ 11.71 4.7619
+ 11.72 4.7619
+ 11.73 4.7619
+ 11.74 4.7619
+ 11.75 4.7619
+ 11.76 4.7619
+ 11.77 4.7619
+ 11.78 4.7619
+ 11.79 4.7619
+ 11.8 4.7619
+ 11.81 4.7619
+ 11.82 4.7619
+ 11.83 4.7619
+ 11.84 4.7619
+ 11.85 4.7619
+ 11.86 4.7619
+ 11.87 4.7619
+ 11.88 4.7619
+ 11.89 4.7619
+ 11.9 4.7619
+ 11.91 4.7619
+ 11.92 4.7619
+ 11.93 4.7619
+ 11.94 4.7619
+ 11.95 4.7619
+ 11.96 4.7619
+ 11.97 4.7619
+ 11.98 4.7619
+ 11.99 4.7619
+ 12 4.7619
+ 12.01 4.7619
+ 12.02 4.7619
+ 12.03 4.7619
+ 12.04 4.7619
+ 12.05 4.7619
+ 12.06 4.7619
+ 12.07 4.7619
+ 12.08 4.7619
+ 12.09 4.7619
+ 12.1 4.7619
+ 12.11 4.7619
+ 12.12 4.7619
+ 12.13 4.7619
+ 12.14 4.7619
+ 12.15 4.7619
+ 12.16 4.7619
+ 12.17 4.7619
+ 12.18 4.7619
+ 12.19 4.7619
+ 12.2 4.7619
+ 12.21 4.7619
+ 12.22 4.7619
+ 12.23 4.7619
+ 12.24 4.7619
+ 12.25 4.7619
+ 12.26 4.7619
+ 12.27 4.7619
+ 12.28 4.7619
+ 12.29 4.7619
+ 12.3 4.7619
+ 12.31 4.7619
+ 12.32 4.7619
+ 12.33 4.7619
+ 12.34 4.7619
+ 12.35 4.7619
+ 12.36 4.7619
+ 12.37 4.7619
+ 12.38 4.7619
+ 12.39 4.7619
+ 12.4 4.7619
+ 12.41 4.7619
+ 12.42 4.7619
+ 12.43 4.7619
+ 12.44 4.7619
+ 12.45 4.7619
+ 12.46 4.7619
+ 12.47 4.7619
+ 12.48 4.7619
+ 12.49 4.7619
+ 12.5 4.7619
+ 12.51 4.7619
+ 12.52 4.7619
+ 12.53 4.7619
+ 12.54 4.7619
+ 12.55 4.7619
+ 12.56 4.7619
+ 12.57 4.7619
+ 12.58 4.7619
+ 12.59 4.7619
+ 12.6 4.7619
+ 12.61 4.7619
+ 12.62 4.7619
+ 12.63 4.7619
+ 12.64 4.7619
+ 12.65 4.7619
+ 12.66 4.7619
+ 12.67 4.7619
+ 12.68 4.7619
+ 12.69 4.7619
+ 12.7 4.7619
+ 12.71 4.7619
+ 12.72 4.7619
+ 12.73 4.7619
+ 12.74 4.7619
+ 12.75 4.7619
+ 12.76 4.7619
+ 12.77 4.7619
+ 12.78 4.7619
+ 12.79 4.7619
+ 12.8 4.7619
+ 12.81 4.7619
+ 12.82 4.7619
+ 12.83 4.7619
+ 12.84 4.7619
+ 12.85 4.7619
+ 12.86 4.7619
+ 12.87 4.7619
+ 12.88 4.7619
+ 12.89 4.7619
+ 12.9 4.7619
+ 12.91 4.7619
+ 12.92 4.7619
+ 12.93 4.7619
+ 12.94 4.7619
+ 12.95 4.7619
+ 12.96 4.7619
+ 12.97 4.7619
+ 12.98 4.7619
+ 12.99 4.7619
+ 13 4.7619
+ 13.01 4.7619
+ 13.02 4.7619
+ 13.03 4.7619
+ 13.04 4.7619
+ 13.05 4.7619
+ 13.06 4.7619
+ 13.07 4.7619
+ 13.08 4.7619
+ 13.09 4.7619
+ 13.1 4.7619
+ 13.11 4.7619
+ 13.12 4.7619
+ 13.13 4.7619
+ 13.14 4.7619
+ 13.15 4.7619
+ 13.16 4.7619
+ 13.17 4.7619
+ 13.18 4.7619
+ 13.19 4.7619
+ 13.2 4.7619
+ 13.21 4.7619
+ 13.22 4.7619
+ 13.23 4.7619
+ 13.24 4.7619
+ 13.25 4.7619
+ 13.26 4.7619
+ 13.27 4.7619
+ 13.28 4.7619
+ 13.29 4.7619
+ 13.3 4.7619
+ 13.31 4.7619
+ 13.32 4.7619
+ 13.33 4.7619
+ 13.34 4.7619
+ 13.35 4.7619
+ 13.36 4.7619
+ 13.37 4.7619
+ 13.38 4.7619
+ 13.39 4.7619
+ 13.4 4.7619
+ 13.41 4.7619
+ 13.42 4.7619
+ 13.43 4.7619
+ 13.44 4.7619
+ 13.45 4.7619
+ 13.46 4.7619
+ 13.47 4.7619
+ 13.48 4.7619
+ 13.49 4.7619
+ 13.5 4.7619
+ 13.51 4.7619
+ 13.52 4.7619
+ 13.53 4.7619
+ 13.54 4.7619
+ 13.55 4.7619
+ 13.56 4.7619
+ 13.57 4.7619
+ 13.58 4.7619
+ 13.59 4.7619
+ 13.6 4.7619
+ 13.61 4.7619
+ 13.62 4.7619
+ 13.63 4.7619
+ 13.64 4.7619
+ 13.65 4.7619
+ 13.66 4.7619
+ 13.67 4.7619
+ 13.68 4.7619
+ 13.69 4.7619
+ 13.7 4.7619
+ 13.71 4.7619
+ 13.72 4.7619
+ 13.73 4.7619
+ 13.74 4.7619
+ 13.75 4.7619
+ 13.76 4.7619
+ 13.77 4.7619
+ 13.78 4.7619
+ 13.79 4.7619
+ 13.8 4.7619
+ 13.81 4.7619
+ 13.82 4.7619
+ 13.83 4.7619
+ 13.84 4.7619
+ 13.85 4.7619
+ 13.86 4.7619
+ 13.87 4.7619
+ 13.88 4.7619
+ 13.89 4.7619
+ 13.9 4.7619
+ 13.91 4.7619
+ 13.92 4.7619
+ 13.93 4.7619
+ 13.94 4.7619
+ 13.95 4.7619
+ 13.96 4.7619
+ 13.97 4.7619
+ 13.98 4.7619
+ 13.99 4.7619
+ 14 4.7619
+ 14.01 4.7619
+ 14.02 4.7619
+ 14.03 4.7619
+ 14.04 4.7619
+ 14.05 4.7619
+ 14.06 4.7619
+ 14.07 4.7619
+ 14.08 4.7619
+ 14.09 4.7619
+ 14.1 4.7619
+ 14.11 4.7619
+ 14.12 4.7619
+ 14.13 4.7619
+ 14.14 4.7619
+ 14.15 4.7619
+ 14.16 4.7619
+ 14.17 4.7619
+ 14.18 4.7619
+ 14.19 4.7619
+ 14.2 4.7619
+ 14.21 4.7619
+ 14.22 4.7619
+ 14.23 4.7619
+ 14.24 4.7619
+ 14.25 4.7619
+ 14.26 4.7619
+ 14.27 4.7619
+ 14.28 4.7619
+ 14.29 4.7619
+ 14.3 4.7619
+ 14.31 4.7619
+ 14.32 4.7619
+ 14.33 4.7619
+ 14.34 4.7619
+ 14.35 4.7619
+ 14.36 4.7619
+ 14.37 4.7619
+ 14.38 4.7619
+ 14.39 4.7619
+ 14.4 4.7619
+ 14.41 4.7619
+ 14.42 4.7619
+ 14.43 4.7619
+ 14.44 4.7619
+ 14.45 4.7619
+ 14.46 4.7619
+ 14.47 4.7619
+ 14.48 4.7619
+ 14.49 4.7619
+ 14.5 4.7619
+ 14.51 4.7619
+ 14.52 4.7619
+ 14.53 4.7619
+ 14.54 4.7619
+ 14.55 4.7619
+ 14.56 4.7619
+ 14.57 4.7619
+ 14.58 4.7619
+ 14.59 4.7619
+ 14.6 4.7619
+ 14.61 4.7619
+ 14.62 4.7619
+ 14.63 4.7619
+ 14.64 4.7619
+ 14.65 4.7619
+ 14.66 4.7619
+ 14.67 4.7619
+ 14.68 4.7619
+ 14.69 4.7619
+ 14.7 4.7619
+ 14.71 4.7619
+ 14.72 4.7619
+ 14.73 4.7619
+ 14.74 4.7619
+ 14.75 4.7619
+ 14.76 4.7619
+ 14.77 4.7619
+ 14.78 4.7619
+ 14.79 4.7619
+ 14.8 4.7619
+ 14.81 4.7619
+ 14.82 4.7619
+ 14.83 4.7619
+ 14.84 4.7619
+ 14.85 4.7619
+ 14.86 4.7619
+ 14.87 4.7619
+ 14.88 4.7619
+ 14.89 4.7619
+ 14.9 4.7619
+ 14.91 4.7619
+ 14.92 4.7619
+ 14.93 4.7619
+ 14.94 4.7619
+ 14.95 4.7619
+ 14.96 4.7619
+ 14.97 4.7619
+ 14.98 4.7619
+ 14.99 4.7619
+ 15 4.7619
+ 15.01 4.7619
+ 15.02 4.7619
+ 15.03 4.7619
+ 15.04 4.7619
+ 15.05 4.7619
+ 15.06 4.7619
+ 15.07 4.7619
+ 15.08 4.7619
+ 15.09 4.7619
+ 15.1 4.7619
+ 15.11 4.7619
+ 15.12 4.7619
+ 15.13 4.7619
+ 15.14 4.7619
+ 15.15 4.7619
+ 15.16 4.7619
+ 15.17 4.7619
+ 15.18 4.7619
+ 15.19 4.7619
+ 15.2 4.7619
+ 15.21 4.7619
+ 15.22 4.7619
+ 15.23 4.7619
+ 15.24 4.7619
+ 15.25 4.7619
+ 15.26 4.7619
+ 15.27 4.7619
+ 15.28 4.7619
+ 15.29 4.7619
+ 15.3 4.7619
+ 15.31 4.7619
+ 15.32 4.7619
+ 15.33 4.7619
+ 15.34 4.7619
+ 15.35 4.7619
+ 15.36 4.7619
+ 15.37 4.7619
+ 15.38 4.7619
+ 15.39 4.7619
+ 15.4 4.7619
+ 15.41 4.7619
+ 15.42 4.7619
+ 15.43 4.7619
+ 15.44 4.7619
+ 15.45 4.7619
+ 15.46 4.7619
+ 15.47 4.7619
+ 15.48 4.7619
+ 15.49 4.7619
+ 15.5 4.7619
+ 15.51 4.7619
+ 15.52 4.7619
+ 15.53 4.7619
+ 15.54 4.7619
+ 15.55 4.7619
+ 15.56 4.7619
+ 15.57 4.7619
+ 15.58 4.7619
+ 15.59 4.7619
+ 15.6 4.7619
+ 15.61 4.7619
+ 15.62 4.7619
+ 15.63 4.7619
+ 15.64 4.7619
+ 15.65 4.7619
+ 15.66 4.7619
+ 15.67 4.7619
+ 15.68 4.7619
+ 15.69 4.7619
+ 15.7 4.7619
+ 15.71 4.7619
+ 15.72 4.7619
+ 15.73 4.7619
+ 15.74 4.7619
+ 15.75 4.7619
+ 15.76 4.7619
+ 15.77 4.7619
+ 15.78 4.7619
+ 15.79 4.7619
+ 15.8 4.7619
+ 15.81 4.7619
+ 15.82 4.7619
+ 15.83 4.7619
+ 15.84 4.7619
+ 15.85 4.7619
+ 15.86 4.7619
+ 15.87 4.7619
+ 15.88 4.7619
+ 15.89 4.7619
+ 15.9 4.7619
+ 15.91 4.7619
+ 15.92 4.7619
+ 15.93 4.7619
+ 15.94 4.7619
+ 15.95 4.7619
+ 15.96 4.7619
+ 15.97 4.7619
+ 15.98 4.7619
+ 15.99 4.7619
+ 16 4.7619
+ 16.01 4.7619
+ 16.02 4.7619
+ 16.03 4.7619
+ 16.04 4.7619
+ 16.05 4.7619
+ 16.06 4.7619
+ 16.07 4.7619
+ 16.08 4.7619
+ 16.09 4.7619
+ 16.1 4.7619
+ 16.11 4.7619
+ 16.12 4.7619
+ 16.13 4.7619
+ 16.14 4.7619
+ 16.15 4.7619
+ 16.16 4.7619
+ 16.17 4.7619
+ 16.18 4.7619
+ 16.19 4.7619
+ 16.2 4.7619
+ 16.21 4.7619
+ 16.22 4.7619
+ 16.23 4.7619
+ 16.24 4.7619
+ 16.25 4.7619
+ 16.26 4.7619
+ 16.27 4.7619
+ 16.28 4.7619
+ 16.29 4.7619
+ 16.3 4.7619
+ 16.31 4.7619
+ 16.32 4.7619
+ 16.33 4.7619
+ 16.34 4.7619
+ 16.35 4.7619
+ 16.36 4.7619
+ 16.37 4.7619
+ 16.38 4.7619
+ 16.39 4.7619
+ 16.4 4.7619
+ 16.41 4.7619
+ 16.42 4.7619
+ 16.43 4.7619
+ 16.44 4.7619
+ 16.45 4.7619
+ 16.46 4.7619
+ 16.47 4.7619
+ 16.48 4.7619
+ 16.49 4.7619
+ 16.5 4.7619
+ 16.51 4.7619
+ 16.52 4.7619
+ 16.53 4.7619
+ 16.54 4.7619
+ 16.55 4.7619
+ 16.56 4.7619
+ 16.57 4.7619
+ 16.58 4.7619
+ 16.59 4.7619
+ 16.6 4.7619
+ 16.61 4.7619
+ 16.62 4.7619
+ 16.63 4.7619
+ 16.64 4.7619
+ 16.65 4.7619
+ 16.66 4.7619
+ 16.67 4.7619
+ 16.68 4.7619
+ 16.69 4.7619
+ 16.7 4.7619
+ 16.71 4.7619
+ 16.72 4.7619
+ 16.73 4.7619
+ 16.74 4.7619
+ 16.75 4.7619
+ 16.76 4.7619
+ 16.77 4.7619
+ 16.78 4.7619
+ 16.79 4.7619
+ 16.8 4.7619
+ 16.81 4.7619
+ 16.82 4.7619
+ 16.83 4.7619
+ 16.84 4.7619
+ 16.85 4.7619
+ 16.86 4.7619
+ 16.87 4.7619
+ 16.88 4.7619
+ 16.89 4.7619
+ 16.9 4.7619
+ 16.91 4.7619
+ 16.92 4.7619
+ 16.93 4.7619
+ 16.94 4.7619
+ 16.95 4.7619
+ 16.96 4.7619
+ 16.97 4.7619
+ 16.98 4.7619
+ 16.99 4.7619
+ 17 4.7619
+ 17.01 4.7619
+ 17.02 4.7619
+ 17.03 4.7619
+ 17.04 4.7619
+ 17.05 4.7619
+ 17.06 4.7619
+ 17.07 4.7619
+ 17.08 4.7619
+ 17.09 4.7619
+ 17.1 4.7619
+ 17.11 4.7619
+ 17.12 4.7619
+ 17.13 4.7619
+ 17.14 4.7619
+ 17.15 4.7619
+ 17.16 4.7619
+ 17.17 4.7619
+ 17.18 4.7619
+ 17.19 4.7619
+ 17.2 4.7619
+ 17.21 4.7619
+ 17.22 4.7619
+ 17.23 4.7619
+ 17.24 4.7619
+ 17.25 4.7619
+ 17.26 4.7619
+ 17.27 4.7619
+ 17.28 4.7619
+ 17.29 4.7619
+ 17.3 4.7619
+ 17.31 4.7619
+ 17.32 4.7619
+ 17.33 4.7619
+ 17.34 4.7619
+ 17.35 4.7619
+ 17.36 4.7619
+ 17.37 4.7619
+ 17.38 4.7619
+ 17.39 4.7619
+ 17.4 4.7619
+ 17.41 4.7619
+ 17.42 4.7619
+ 17.43 4.7619
+ 17.44 4.7619
+ 17.45 4.7619
+ 17.46 4.7619
+ 17.47 4.7619
+ 17.48 4.7619
+ 17.49 4.7619
+ 17.5 4.7619
+ 17.51 4.7619
+ 17.52 4.7619
+ 17.53 4.7619
+ 17.54 4.7619
+ 17.55 4.7619
+ 17.56 4.7619
+ 17.57 4.7619
+ 17.58 4.7619
+ 17.59 4.7619
+ 17.6 4.7619
+ 17.61 4.7619
+ 17.62 4.7619
+ 17.63 4.7619
+ 17.64 4.7619
+ 17.65 4.7619
+ 17.66 4.7619
+ 17.67 4.7619
+ 17.68 4.7619
+ 17.69 4.7619
+ 17.7 4.7619
+ 17.71 4.7619
+ 17.72 4.7619
+ 17.73 4.7619
+ 17.74 4.7619
+ 17.75 4.7619
+ 17.76 4.7619
+ 17.77 4.7619
+ 17.78 4.7619
+ 17.79 4.7619
+ 17.8 4.7619
+ 17.81 4.7619
+ 17.82 4.7619
+ 17.83 4.7619
+ 17.84 4.7619
+ 17.85 4.7619
+ 17.86 4.7619
+ 17.87 4.7619
+ 17.88 4.7619
+ 17.89 4.7619
+ 17.9 4.7619
+ 17.91 4.7619
+ 17.92 4.7619
+ 17.93 4.7619
+ 17.94 4.7619
+ 17.95 4.7619
+ 17.96 4.7619
+ 17.97 4.7619
+ 17.98 4.7619
+ 17.99 4.7619
+ 18 4.7619
+ 18.01 4.7619
+ 18.02 4.7619
+ 18.03 4.7619
+ 18.04 4.7619
+ 18.05 4.7619
+ 18.06 4.7619
+ 18.07 4.7619
+ 18.08 4.7619
+ 18.09 4.7619
+ 18.1 4.7619
+ 18.11 4.7619
+ 18.12 4.7619
+ 18.13 4.7619
+ 18.14 4.7619
+ 18.15 4.7619
+ 18.16 4.7619
+ 18.17 4.7619
+ 18.18 4.7619
+ 18.19 4.7619
+ 18.2 4.7619
+ 18.21 4.7619
+ 18.22 4.7619
+ 18.23 4.7619
+ 18.24 4.7619
+ 18.25 4.7619
+ 18.26 4.7619
+ 18.27 4.7619
+ 18.28 4.7619
+ 18.29 4.7619
+ 18.3 4.7619
+ 18.31 4.7619
+ 18.32 4.7619
+ 18.33 4.7619
+ 18.34 4.7619
+ 18.35 4.7619
+ 18.36 4.7619
+ 18.37 4.7619
+ 18.38 4.7619
+ 18.39 4.7619
+ 18.4 4.7619
+ 18.41 4.7619
+ 18.42 4.7619
+ 18.43 4.7619
+ 18.44 4.7619
+ 18.45 4.7619
+ 18.46 4.7619
+ 18.47 4.7619
+ 18.48 4.7619
+ 18.49 4.7619
+ 18.5 4.7619
+ 18.51 4.7619
+ 18.52 4.7619
+ 18.53 4.7619
+ 18.54 4.7619
+ 18.55 4.7619
+ 18.56 4.7619
+ 18.57 4.7619
+ 18.58 4.7619
+ 18.59 4.7619
+ 18.6 4.7619
+ 18.61 4.7619
+ 18.62 4.7619
+ 18.63 4.7619
+ 18.64 4.7619
+ 18.65 4.7619
+ 18.66 4.7619
+ 18.67 4.7619
+ 18.68 4.7619
+ 18.69 4.7619
+ 18.7 4.7619
+ 18.71 4.7619
+ 18.72 4.7619
+ 18.73 4.7619
+ 18.74 4.7619
+ 18.75 4.7619
+ 18.76 4.7619
+ 18.77 4.7619
+ 18.78 4.7619
+ 18.79 4.7619
+ 18.8 4.7619
+ 18.81 4.7619
+ 18.82 4.7619
+ 18.83 4.7619
+ 18.84 4.7619
+ 18.85 4.7619
+ 18.86 4.7619
+ 18.87 4.7619
+ 18.88 4.7619
+ 18.89 4.7619
+ 18.9 4.7619
+ 18.91 4.7619
+ 18.92 4.7619
+ 18.93 4.7619
+ 18.94 4.7619
+ 18.95 4.7619
+ 18.96 4.7619
+ 18.97 4.7619
+ 18.98 4.7619
+ 18.99 4.7619
+ 19 4.7619
+ 19.01 4.7619
+ 19.02 4.7619
+ 19.03 4.7619
+ 19.04 4.7619
+ 19.05 4.7619
+ 19.06 4.7619
+ 19.07 4.7619
+ 19.08 4.7619
+ 19.09 4.7619
+ 19.1 4.7619
+ 19.11 4.7619
+ 19.12 4.7619
+ 19.13 4.7619
+ 19.14 4.7619
+ 19.15 4.7619
+ 19.16 4.7619
+ 19.17 4.7619
+ 19.18 4.7619
+ 19.19 4.7619
+ 19.2 4.7619
+ 19.21 4.7619
+ 19.22 4.7619
+ 19.23 4.7619
+ 19.24 4.7619
+ 19.25 4.7619
+ 19.26 4.7619
+ 19.27 4.7619
+ 19.28 4.7619
+ 19.29 4.7619
+ 19.3 4.7619
+ 19.31 4.7619
+ 19.32 4.7619
+ 19.33 4.7619
+ 19.34 4.7619
+ 19.35 4.7619
+ 19.36 4.7619
+ 19.37 4.7619
+ 19.38 4.7619
+ 19.39 4.7619
+ 19.4 4.7619
+ 19.41 4.7619
+ 19.42 4.7619
+ 19.43 4.7619
+ 19.44 4.7619
+ 19.45 4.7619
+ 19.46 4.7619
+ 19.47 4.7619
+ 19.48 4.7619
+ 19.49 4.7619
+ 19.5 4.7619
+ 19.51 4.7619
+ 19.52 4.7619
+ 19.53 4.7619
+ 19.54 4.7619
+ 19.55 4.7619
+ 19.56 4.7619
+ 19.57 4.7619
+ 19.58 4.7619
+ 19.59 4.7619
+ 19.6 4.7619
+ 19.61 4.7619
+ 19.62 4.7619
+ 19.63 4.7619
+ 19.64 4.7619
+ 19.65 4.7619
+ 19.66 4.7619
+ 19.67 4.7619
+ 19.68 4.7619
+ 19.69 4.7619
+ 19.7 4.7619
+ 19.71 4.7619
+ 19.72 4.7619
+ 19.73 4.7619
+ 19.74 4.7619
+ 19.75 4.7619
+ 19.76 4.7619
+ 19.77 4.7619
+ 19.78 4.7619
+ 19.79 4.7619
+ 19.8 4.7619
+ 19.81 4.7619
+ 19.82 4.7619
+ 19.83 4.7619
+ 19.84 4.7619
+ 19.85 4.7619
+ 19.86 4.7619
+ 19.87 4.7619
+ 19.88 4.7619
+ 19.89 4.7619
+ 19.9 4.7619
+ 19.91 4.7619
+ 19.92 4.7619
+ 19.93 4.7619
+ 19.94 4.7619
+ 19.95 4.7619
+ 19.96 4.7619
+ 19.97 4.7619
+ 19.98 4.7619
+ 19.99 4.7619
+ 20 4.7619
+&
diff --git a/doc/theory/graphics/support.fig b/doc/theory/graphics/support.fig
new file mode 100644
index 0000000..e6e5092
--- /dev/null
+++ b/doc/theory/graphics/support.fig
@@ -0,0 +1,50 @@
+#FIG 3.1
+Portrait
+Center
+Inches
+1200 2
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 3645 4905 42 42 3645 4905 3687 4947
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 4815 5730 42 42 4815 5730 4857 5772
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 5670 3915 42 42 5670 3915 5712 3957
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 5025 1920 42 42 5025 1920 5067 1962
+1 3 0 1 -1 0 0 0 20 0.000 1 0.0000 7350 3600 42 42 7350 3600 7392 3642
+2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 3075 7425 3075 7425 3075 7425 3075 7425 3075 7425
+2 2 0 1 -1 7 0 0 41 0.000 0 0 -1 0 0 5
+ 3300 3525 3525 3525 3525 3750 3300 3750 3300 3525
+2 2 0 1 -1 7 0 0 41 0.000 0 0 -1 0 0 5
+ 3750 1950 3975 1950 3975 2175 3750 2175 3750 1950
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 13
+ 5625 2175 4275 3150 4125 6300 5625 2175 6450 3525 4875 6600
+ 4125 6300 3450 6450 3000 4725 4275 3150 4500 1875 5925 450
+ 5625 2175
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 6
+ 3000 4725 3000 3375 4275 3150 3300 1800 4125 1200 4500 1875
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 4650 4800 5550 5250
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3000 3375 3300 1800
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 4125 1200 5925 450 6450 3525
+2 1 1 1 -1 7 0 0 -1 12.000 0 0 -1 0 0 2
+ 4725 3450 1590 3870
+2 1 1 1 -1 7 0 0 -1 12.000 0 0 -1 0 0 2
+ 7200 4500 4725 3450
+2 1 1 1 -1 7 0 0 -1 12.000 0 0 -1 0 0 2
+ 3345 1200 4725 3450
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5190 3480 5325 3525 5280 3690
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 4650 2925 4725 3075 4590 3180
+2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 4110 3555 4110 3705 4260 3705
+2 2 0 1 -1 7 10 0 41 0.000 0 0 -1 0 0 5
+ 5550 3825 5775 3825 5775 4050 5550 4050 5550 3825
+2 2 0 1 -1 7 0 0 41 0.000 0 0 -1 0 0 5
+ 7275 3975 7500 3975 7500 4200 7275 4200 7275 3975
+2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 7050 3375 9525 3375 9525 4275 7050 4275 7050 3375
+4 0 -1 0 0 0 20 0.0000 4 195 2205 6375 5250 Cellule courante : I\001
+4 0 -1 0 0 0 20 0.0000 4 255 1680 7650 3675 Support actuel\001
+4 0 -1 0 0 0 20 0.0000 4 255 1755 7650 4125 Support etendu\001
+4 0 -1 0 0 0 20 0.0000 4 195 90 4800 3375 I\001
diff --git a/doc/theory/inimas.tex b/doc/theory/inimas.tex
new file mode 100644
index 0000000..715ad91
--- /dev/null
+++ b/doc/theory/inimas.tex
@@ -0,0 +1,233 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{inimas}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le but de ce sous-programme est principalement de calculer le flux de masse aux
+faces. Il prend une variable vectorielle associ\'ee au centre des cellules
+(g\'en\'eralement la vitesse), la projette aux faces en la multipliant par la
+masse volumique, et la multiplie scalairement par le vecteur surface.
+Plus g\'en\'eralement, \fort{inimas} est aussi appel\'e comme premi\`ere \'etape
+du calcul d'une divergence (terme en $\dive(\rho\tens{R})$ en
+$R_{ij}-\varepsilon$, filtre Rhie \& Chow, ...).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+La figure \ref{Base_Inimas_fig_geom} rappelle les diverses d\'efinitions g\'eom\'etriques
+pour les faces internes et les faces de bord. On notera
+$\displaystyle \alpha=\frac{\overline{FJ^\prime}}{\overline{I^\prime J^\prime}}$ (d\'efini aux faces
+internes uniquement).
+
+\begin{figure}[h]
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facebord}}}
+\caption{\label{Base_Inimas_fig_geom}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+
+
+\subsection{Faces internes}
+On ne conna\^\i t pas la masse volumique \`a la face, cette derni\`ere doit donc
+aussi \^etre interpol\'ee. On utilise la discr\'etisation suivante :
+
+\begin{equation}
+(\rho \vect{u})_F = \alpha(\rho_I \vect{u}_I)
++(1-\alpha)(\rho_J \vect{u}_J)
++\ggrad\!(\rho\vect{u})_O.\vect{OF}
+\end{equation}
+La partie en $\alpha(\rho_I \vect{u}_I)
++(1-\alpha)(\rho_J \vect{u}_J)$ correspondant en fait \`a
+$(\rho\vect{u})_O$. Le gradient en $O$ est calcul\'e par interpolation :
+$\displaystyle\ggrad\!(\rho\vect{u})_O=
+\frac{1}{2}\left[\ggrad\!(\rho\vect{u})_I+\ggrad\!(\rho\vect{u})_J\right]$. La
+valeur $\displaystyle\frac{1}{2}$ s'est impos\'ee de mani\`ere heuristique au
+fil des tests
+comme apportant plus de stabilit\'e \`a l'algorithme global qu'une interpolation
+faisant intervenir $\alpha$. L'erreur commise sur $\rho\vect{u}$ est en
+$O(h^2)$.
+
+
+\subsection{Faces de bord}
+Le traitement des faces de bord est n\'ecessaire pour y calculer le flux de
+masse, bien s\^ur, mais aussi pour obtenir des conditions aux limites pour le
+calcul du $\ggrad\!(\rho \vect{u})$ utilis\'e pour les faces internes.
+
+Pour les faces de bord, on conna\^\i t la valeur de $\rho_F$, qui est stock\'ee
+dans la variable \var{ROMB}. De plus, les conditions aux limites pour $\vect{u}$
+sont donn\'ees par des coefficients $A$ et $B$ tels que :
+\begin{equation}
+u_{k,F} = A_k + B_ku_{k,I^\prime} =
+A_k + B_k\left(u_{k,I} + \grad\!(u_k)_I.\vect{II^\prime}\right)
+\end{equation}
+($k\in\{1,2,3\}$ est la composante de la vitesse, l'erreur est en $O(B_kh)$)
+
+On a donc \`a l'ordre 1 :
+\begin{equation}
+(\rho u_k)_F = \rho_F\left[A_k + B_k\left(u_{k,I} +
+\grad\!(u_k)_I.\vect{II^\prime}\right)\right]
+\end{equation}
+
+Mais pour utiliser cette formule, il faudrait calculer $\ggrad\!(\vect{u})$ (trois
+appels \`a \fort{GRDCEL}), alors qu'on a d\'ej\`a calcul\'e
+$\ggrad\!(\rho\vect{u})$ pour les faces internes. Le surco\^ut en temps serait alors
+important. On r\'e\'ecrit donc :
+\begin{eqnarray}
+(\rho u_k)_F & = & \rho_F A_k + \rho_F B_ku_{k,I^\prime}\\
+& = & \rho_F A_k + B_k\frac{\rho_F}{\rho_{I^\prime}}(\rho u_k)_{I^\prime}
+\label{Base_Inimas_eq_rhoufacea}\\
+& = & \rho_F A_k + B_k\frac{\rho_F}{\rho_{I^\prime}}(\rho u_k)_I
++B_k\frac{\rho_F}{\rho_{I^\prime}}\grad\!(\rho u_k)_I.\vect{II^\prime}
+\label{Base_Inimas_eq_rhoufaceb}
+\end{eqnarray}
+
+Pour calculer les gradients de $\rho\vect{u}$, il faudrait donc en th\'eorie
+utiliser les coefficients de conditions aux limites \'equivalents :\\
+$\tilde{A}_k = \rho_F A_k$\\
+$\displaystyle \tilde{B}_k = B_k\frac{\rho_F}{\rho_{I^\prime}}$
+
+Ceci para\^\i t d\'elicat, \`a cause du terme en
+$\displaystyle \frac{\rho_F}{\rho_{I^\prime}}$, et en particulier \`a l'erreur
+que l'on peut commettre sur $\rho_{I^\prime}$ si la reconstruction des gradients
+est imparfaite (sur des maillages fortement non orthogonaux par exemple).
+On r\'e\'ecrit donc l'\'equation
+(\ref{Base_Inimas_eq_rhoufaceb}) sous la forme suivante :
+\begin{equation}
+(\rho u_k)_F=\rho_F A_k + B_k\frac{\rho_I\rho_F}{\rho_{I^\prime}}u_{k,I}
++B_k\frac{\rho_F}{\rho_{I^\prime}}\grad\!(\rho u_k)_I.\vect{II^\prime}
+\end{equation}
+
+
+Pour le calcul du flux de masse au bord, on va faire deux approximations. Pour
+le deuxi\`eme terme, on va supposer $\rho_{I^\prime}\approx\rho_I$ (ce qui
+conduit \`a une erreur en $O(B_kh)$ sur $\rho\vect{u}$ si
+$\rho_{I^\prime}\ne \rho_I$). Pour le
+troisi\`eme terme, on va supposer $\rho_{I^\prime}\approx\rho_F$. Cette
+derni\`ere approximation est plus forte, mais elle n'intervient que dans la
+reconstruction des non-orthogonalit\'es ; l'erreur finale reste donc faible
+(erreur en $O(B_kh^2)$ sur $\rho\vect{u}$ si
+$\rho_{I^\prime}\ne \rho_F$).
+Et au final, le flux de masse au bord est calcul\'e par :
+\begin{equation}
+\dot{m}_F = \sum\limits_{k=1}^{3}\left[\rho_F A_k + B_k\rho_Fu_{k,I}
++B_k\grad\!(\rho u_k)_I.\vect{II^\prime}\right]S_k
+\end{equation}
+
+Pour le calcul des gradients, on repart de l'\'equation (\ref{Base_Inimas_eq_rhoufacea}), sur
+laquelle on fait l'hypoth\`ese que $\rho_{I^\prime}\approx\rho_F$. Encore une
+fois, cette hypoth\`ese peut \^etre assez forte, mais les gradients obtenus ne
+sont utilis\'es que pour des reconstructions de non-orthogonalit\'es ; l'erreur
+finale reste donc l\`a encore assez faible.
+Au final, les gradients sont calcul\'es \`a partir de la formule suivante :
+\begin{equation}
+(\rho u_k)_F = \rho_F A_k + B_k(\rho u_k)_{I^\prime}
+\end{equation}
+ce qui revient \`a utiliser les conditions aux limites suivantes pour
+$\rho \vect{u}$:\\
+$\tilde{A}_k = \rho_F A_k$\\
+$\tilde{B}_k = B_k$
+
+\minititre{Remarque}
+
+Dans la plupart des cas, les approximations effectu\'ees n'engendrent aucune
+erreur. En effet :\\
+- dans le cas d'une entr\'ee on a g\'en\'eralement $B_k=0$, avec un flux de
+masse impos� par la condition � la limite.\\
+- dans le cas d'une sortie, on a g\'en\'eralement flux nul sur les scalaires
+donc sur $\rho$, soit \mbox{$\rho_F=\rho_{I^\prime}=\rho_I$}.\\
+- dans le cas d'une paroi, on a g\'en\'eralement $B_k=0$ et le flux de masse
+est impos� nul.\\
+- dans le cas d'une sym\'etrie, on a g\'en\'eralement
+$\rho_F=\rho_{I^\prime}=\rho_I$ et le flux de masse est impos� nul.\\
+Pour sentir un effet de ces approximations, il faudrait par exemple une paroi
+glissante ($B_k\ne0$) avec un gradient de temp\'erature ($\rho_F\ne\rho_I$).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+La vitesse est pass\'ee par les arguments \var{UX}, \var{UY} et \var{UZ}. Les
+conditions aux limites de la vitesse sont \var{COEFAX}, \var{COEFBX}, ... Le
+flux de masse r\'esultat est stock\'e dans les variables \var{FLUMAS} (faces
+internes) et \var{FLUMAB} (faces de bord). \var{QDMX}, \var{QDMY} et \var{QDMZ}
+sont des variables de travail qui serviront \`a stocker $\rho\vect{u}$, et
+\var{COEFQA} servira \`a stocker les $\tilde{A}$.
+
+\etape{Initialisation \'eventuelle du flux de masse}
+Si \var{INIT} vaut 1, le flux de masse est remis \`a z\'ero. Sinon, le
+sous-programme rajoute aux variables \var{FLUMAS} et \var{FLUMAB} existantes le
+flux de masse calcul\'e.
+
+
+\etape{Remplissage des tableaux de travail}
+$\rho\vect{u}$ est stock\'e dans \var{QDM}, et $\tilde{A}$ dans \var{COEFQA}.
+
+
+\etape{Cas sans reconstruction}
+On calcule alors directement\\
+$\displaystyle \var{FLUMAS}=\sum\limits_{k=1}^{3}\left[
+\alpha(\rho_I u_{k,I})+(1-\alpha)(\rho_J u_{k,J})\right]S_k$\\
+et\\
+$\displaystyle \var{FLUMAB}=\sum\limits_{k=1}^{3}\left[
+\rho_F A_k + B_k\rho_Fu_{k,I}\right]S_k$
+
+
+\etape{Cas avec reconstruction}
+On r\'ep\`ete trois fois de suite les op\'erations suivantes, pour $k=1$, 2 et 3
+:\\
+- Appel de \fort{GRDCEL} pour le calcul de $\grad\!(\rho u_k)$.\\
+- Mise \`a jour du flux de masse\\
+$\displaystyle \var{FLUMAS}=\var{FLUMAS} + \left[
+\alpha(\rho_I u_{k,I})+(1-\alpha)(\rho_J u_{k,J})
++\frac{1}{2}\left[\grad\!(\rho u_k)_I+\grad\!(\rho u_k)_J\right]
+.\vect{OF}\right]S_k$\\
+et\\
+$\displaystyle \var{FLUMAB}=\var{FLUMAB}+\left[
+\rho_F A_k + B_k\rho_Fu_{k,I}
++B_k\grad\!(\rho u_k)_I.\vect{II^\prime}\right]S_k$
+
+
+\etape{Annulation du flux de masse au bord}
+Quand le sous-programme a \'et\'e appel\'e avec la valeur \var{IFLMB0=1}
+(c'est-\`a-dire quand il est r\'eellement appel\'e pour calculer un flux de
+masse, et pas pour calculer le terme en $\dive(\rho\tens{R})$ par exemple), le flux
+de masse au bord \var{FLUMAB} est forc\'e \`a 0, pour les faces de paroi et de
+sym\'etrie (identifi\'ees par \var{ISYMPA=0}).
diff --git a/doc/theory/introd.tex b/doc/theory/introd.tex
new file mode 100644
index 0000000..6d729bc
--- /dev/null
+++ b/doc/theory/introd.tex
@@ -0,0 +1,1012 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\begin{center}
+\underline{{\Huge \textbf{Introduction}}}
+\end{center}
+
+\vspace{1cm}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Disclaimer}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\CS 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.
+
+\CS 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.\footnote{You should have
+received a copy of the GNU General Public License
+along with \CS; if not, write to the
+Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor,
+Boston, MA 02110-1301 USA}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Aims of the document}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This chapter constitutes an introduction to the theory and developer's guide
+associated with the kernel of \CS.
+The system of equations considered consists of the
+Navier-Stokes equations, with turbulence and passive scalars. First, the
+continuous equations for mass, momentum, turbulence and passive scalars are
+presented. Then, information related to the time scheme is supplied.
+Finally, the spatial discretisation is detailed: it is based on a co-located%
+\footnote{%
+All the variables are located at the centres of the cells.} finite volume
+scheme for unstructured meshes.
+
+To make the documentation immediately suitable to the developers' needs, it
+has been organized into sub-sections corresponding to the major steps of the
+algorithm and to some important subroutines of the code.
+
+In each sub-section (for each subroutine), the \textbf{function} of the
+piece of code considered is indicated. Then, a description of the \textbf{%
+discretisation} follows. Finally, and more oriented towards the developers,
+details of the \textbf{implementation} are provided and a list of open
+problems is given (improvements, limitations...).
+
+Several accessibility levels have been defined for the documentation, so
+that it is possible to choose the information level best suited to the
+intended use. At the present time, on UNIX and Linux platforms, free access
+is granted to all information (level called ''\texttt{Complet}''). The most
+restrictive level provides only the function of the subroutines (''\texttt{%
+Fonction}'' level). The intermediate level provides the function of the
+subroutines and the associated discretisation (''\texttt{Discret}'' level).
+
+% fa modification (no more 1.1.0.m, no more "only basic")
+%The current version of this documentation details the basic algorithms
+%of the code and it was therefore important to be well explained by an EDF report.
+During the development process of the code, the documentation is naturally
+updated as and when required by the evolution of the source code itself.
+Suggestions for improvement are welcome. In particular, it will be necessary
+to deal with some transverse subjects (such as parallelism, periodicity or
+memory management) which were voluntarily left out of the first versions, to
+focus on the algorithms and their implementation.
+
+To make it easier for the developers to keep the documentation up to date
+during the development process, the files have been associated "physically"
+with the release of the code (each release of the code includes a directory
+containing the whole documentation). In practice,
+% fa modification : discard (from the development version 1.1.0.n on),
+the users of \CS will find the documentation at the following location
+% fa modification (MFTT-MFEE)
+(UNIX and Linux server at MFEE): % fa modification (SC -> CS)
+
+\begin{center}
+\texttt{\$CS\_HOME/doc/NOYAU/Postscripts/Base},
+\end{center}
+
+The general command \texttt{info\_cs [noyau]} also provides this
+information.
+
+\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Continuous equations}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This section presents the continuous equations. It is no substitutes for the
+specific sub-sections of this documentation: the purpose here is mainly to
+provide an overview before more detailed reading.
+
+In the following, $\rho $ stands for the density, $\vect{u}$ for the
+velocity field. A mass source term, $\Gamma $ , may present, but in most
+cases the right-hand side of the Masss equation is $\Gamma =0$
+
+%\clearpage
+\textbf{Mass}\newline
+\begin{equation}
+\dive(\rho \vect{u})=\Gamma
+\end{equation}
+
+In fact, to compute a given unknown $\phi$ (and in particular for the
+velocity prediction), the equation $\displaystyle \frac{\partial \rho}{%
+\partial t} + \dive(\rho \vect{u}) = \Gamma$ is used to re-write the term $%
+\displaystyle \frac{\partial \rho\,\phi}{\partial t}$ as follows:
+\mbox{$\displaystyle \rho\frac{\partial \phi}{\partial t} - \phi\,\dive(\rho \vect{u})
++ \Gamma\,\phi$}. The possible variations in time of the density are however
+not taken into account in the pressure correction step.
+
+\clearpage \textbf{Momentum}
+\begin{equation}
+\left\{
+\begin{array}{l}
+\displaystyle\frac{\partial }{\partial t}(\rho \vect{u})+\dive(\rho \,%
+\vect{u}\otimes \vect{u})=\dive(\tens{\sigma})+\vect{ST}-\tens{K}\,\vect{u}
+\\
+\dive(\rho \vect{u})=0%
+\end{array}%
+\right.
+\end{equation}
+
+$[\,\vect{ST}-\tens{K}\,\vect{u}\,]$ stands for the additional momentum
+Source Terms which may be prescribed by the user (head loss, $\Gamma \vect{u}%
+^{i}$ contribution associated with a user-prescribed mass source term...).
+
+$\tens{K}$ is a positive diagonal tensor, by definition (derived, for
+example, from the diagonal source term of the head loss tensor).
+
+$\bullet $ For laminar flow, $\tens{\sigma}$ is the stress tensor:
+\begin{equation}
+\tens{\sigma}=\tens{\tau}-P\tens{Id}
+\end{equation}%
+where $\tens{\tau}$ is the viscous stress tensor, defined from $\mu =\mu
+_{l} $ (dynamic molecular viscosity) and $\tens{S}$ (strain rate tensor) as:
+\begin{equation}
+\tens{\tau}=2\,\mu \ \tens{S}-\frac{2}{3}\mu \ tr(\tens{S})\ \tens{Id}\text{
+\hspace*{1cm}with \hspace*{1cm} }\tens{S}=\frac{1}{2}(\ggrad\vect{u}+\,^{t}%
+\ggrad\vect{u}) \label{Base_Introd_tau_eq}
+\end{equation}
+
+$\bullet$ For turbulent flow, $\displaystyle \tens{\sigma}$ also accounts
+for the turbulent Reynolds stress tensor (correlations of the velocity
+fluctuations arising from the non linear convective term). The modelling of
+the latter depends upon the turbulence model adopted:
+
+\hspace*{1cm} - with an eddy-viscosity model (EVM) such as the $%
+k-\varepsilon $ model, the closure requires a turbulent viscosity $\mu _{t}$%
+. With formally the same definition for $\tens{\tau}$ as in equation~(\ref%
+{Base_Introd_tau_eq}), but with $\mu =\mu _{l}+\mu _{t}$, $\tens{\sigma}$ reads:
+\begin{equation}
+\tens{\sigma}=\tens{\tau}-(P+\frac{2}{3}\rho k)\tens{Id}
+\end{equation}
+
+\hspace*{1cm} - with the $LES$ approach, the definition for $\tens{\sigma}$
+remains the same as for the EVM, above, but the turbulent viscosity $\mu
+_{t} $ now accounts only for the sub-grid effects.
+
+\hspace*{1cm} - with a Differential Reynolds Stress Model (DRSM), the
+components of the Reynolds stress tensor $\tens{R}$ are solved as extra
+variables during the simulation, and are readily available for the momentum
+equation, so one obtains, with $\mu =\mu _{l}$ in the definition of $%
+\tens{\tau}$ (equation~(\ref{Base_Introd_tau_eq}))~:
+\begin{equation}
+\tens{\sigma}=\tens{\tau}-P\tens{Id}-\rho \tens{R}
+\end{equation}
+
+\hspace*{1cm}
+
+In the following, only three standard types of turbulence models are
+described, as representatives of the types of equations that need to be
+dicretised. A more detailed description of available turbulence models is
+described in section (?? Turbulence Models??)
+
+\clearpage \textbf{Equations for the variables $k$ and $\varepsilon$
+(standard $k-\varepsilon$ model)}
+
+\begin{equation}
+\left\{
+\begin{array}{l}
+\displaystyle\frac{\partial }{\partial t}(\rho k)+\dive\left[ \rho \vect{u}%
+\,k-(\mu +\frac{\mu _{t}}{\sigma _{k}})\grad{k}\right] =\mathcal{P}+\mathcal{%
+G}-\rho \varepsilon +\Gamma k^{i}+ST_{k} \\
+\displaystyle\frac{\partial }{\partial t}(\rho \varepsilon )+\dive\left[
+\rho \vect{u}\,\varepsilon -(\mu +\frac{\mu _{t}}{\sigma _{\varepsilon }})%
+\grad{\varepsilon}\right] =C_{\varepsilon _{1}}\frac{\varepsilon }{k}\left[
+\mathcal{P}+(1-C_{\varepsilon _{3}})\mathcal{G}\right] -\rho C_{\varepsilon
+_{2}}\frac{\varepsilon ^{2}}{k}+\Gamma \varepsilon ^{i}+TS_{\varepsilon }%
+\end{array}%
+\right.
+\end{equation}
+
+$\mathcal{P}$ is the production term created by mean shear:
+\[
+\begin{array}{rcl}
+\mathcal{P} & = & \displaystyle -\rho R_{ij}\frac{\partial u_i}{\partial x_j}
+= -\left[-\mu_t \left(\frac{\partial u_i}{\partial x_j} + \frac{\partial u_j%
+}{\partial x_i}\right) +\frac{2}{3}\mu_t\frac{\partial u_k}{\partial x_k}%
+\delta_{ij} +\frac{2}{3}\rho k\delta_{ij}\right] \frac{\partial u_i}{%
+\partial x_j} \\
+& = & \displaystyle \mu_t \left(\frac{\partial u_i}{\partial x_j} + \frac{%
+\partial u_j}{\partial x_i}\right)\frac{\partial u_i}{\partial x_j} -\frac{2%
+}{3}\mu_t(\dive\vect{u})^2-\frac{2}{3}\rho k \dive(\vect{u}) \\
+& = & \displaystyle \mu_t \left[ 2\left(\frac{\partial u}{\partial x}%
+\right)^2+ 2\left(\frac{\partial v}{\partial y}\right)^2+ 2\left(\frac{%
+\partial w}{\partial z}\right)^2+ \left(\frac{\partial u}{\partial y}+\frac{%
+\partial v}{\partial x}\right)^2+ \left(\frac{\partial u}{\partial z}+\frac{%
+\partial w}{\partial x}\right)^2+ \left(\frac{\partial v}{\partial z}+\frac{%
+\partial w}{\partial y}\right)^2 \right] \\
+\multicolumn{3}{r}{\displaystyle -\frac{2}{3}\mu_t(\dive\vect{u})^2-\frac{2}{%
+3}\rho k \dive(\vect{u})}%
+\end{array}
+\]
+
+$\mathcal{G}$ is the production term created by gravity effects: $%
+\displaystyle \mathcal{G}=-\frac{1}{\rho}\frac{\mu_t}{\sigma_t} \frac{%
+\partial\rho}{\partial x_i}g_i$
+
+The turbulent viscosity is: $\displaystyle \mu_t=\rho C_\mu\frac{k^2}{%
+\varepsilon}$.
+
+$ST_{\varphi }$ ($\varphi =k$ or $\varepsilon $) stands for the additional
+source terms prescribed by the user (in rare cases only).
+
+The constants of the model are given below:\newline
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|}
+\hline
+$C_\mu$ & $C_{\varepsilon_1}$ & $C_{\varepsilon_2}$ & $\sigma_k$ & $%
+\sigma_\varepsilon$ \\ \hline
+$0,09$ & $1,44$ & $1,92$ & $1$ & $1,3$ \\ \hline
+\end{tabular}%
+\end{center}
+\end{table}
+
+$C_{\varepsilon_3}=0$ if $\mathcal{G}\geqslant0$ (unstable stratification)
+and $C_{\varepsilon_3}=1$ if $\mathcal{G}\leqslant0$ (stable stratification).
+
+\clearpage \textbf{Equations for the Reynolds stress tensor components $%
+R_{ij}$ and $\varepsilon$ (LRR model)}
+
+\begin{equation}
+\left\{
+\begin{array}{lll}
+\displaystyle\frac{\partial }{\partial t}(\rho R_{ij})+\dive(\rho \vect{u}%
+\,R_{ij}-\mu \grad{R_{ij}}) & =\mathcal{P}_{ij}+G_{ij}+\Phi _{ij}+\mathit{{d}%
+_{ij}-\rho \varepsilon _{ij}} & \displaystyle+\Gamma R_{ij}^{i}+ST_{R_{ij}}
+\\
+\displaystyle\frac{\partial }{\partial t}(\rho \varepsilon )+\dive\left[
+\rho \vect{u}\,\varepsilon -(\mu \grad{\varepsilon})\right] & =\displaystyle%
+\mathit{{d}+C_{\varepsilon _{1}}\frac{\varepsilon }{k}\left[ \mathcal{P}%
++G_{\varepsilon }\right] -\rho C_{\varepsilon _{2}}\frac{\varepsilon ^{2}}{k}%
+} & \displaystyle+\Gamma \varepsilon ^{i}+ST_{\varepsilon }%
+\end{array}%
+\right.
+\end{equation}
+
+$\tens{\mathcal{P}}$ stands for the turbulence production tensor associated
+with mean flow strain-rate and $\tens{\mathcal{G}}$ is stands for the
+production- tensor associated with buoyancy effects:
+\begin{equation}
+\displaystyle P_{ij}=\displaystyle-\rho \left[ R_{ik}\frac{\partial u_{j}}{%
+\partial x_{k}}+R_{jk}\frac{\partial u_{i}}{\partial x_{k}}\right] \text{%
+\hspace*{1cm}and\hspace*{1cm}}G_{ij}=-\frac{3}{2}\frac{C_{\mu }}{\sigma _{t}}%
+\frac{k}{\varepsilon }(r_{i}g_{j}+r_{j}g_{i})
+\end{equation}
+
+\begin{eqnarray}
+\text{with\hspace*{0cm}}\displaystyle k &=&\frac{1}{2}R_{ll}\text{%
+\hspace*{0cm}and\hspace*{0cm}}\displaystyle r_{i}=R_{ik}\frac{\partial \rho
+}{\partial x_{k}} \\
+\text{moreover, }\mathcal{P} &=&\frac{1}{2}\mathcal{P}_{kk}\text{%
+\hspace*{1cm}and\hspace*{1cm}}G_{\varepsilon }=max(0,\frac{1}{2}G_{kk})
+\end{eqnarray}
+
+$\tens{\Phi}$ is the term representing pressure-velocity correlations:
+\begin{equation}
+\displaystyle\Phi _{ij}=\phi _{ij,1}+\phi _{ij,2}+\phi _{ij,3}+\phi _{ij,w}
+\end{equation}%
+\begin{equation}
+\text{with\hspace*{0cm}}\phi _{ij,1}=-\rho \,C_{1}\frac{\varepsilon }{k}%
+(R_{ij}-\frac{2}{3}k\delta _{ij})\text{\ \ , \ }\phi _{ij,2}=-\rho \,C_{2}(%
+\mathcal{P}_{ij}-\frac{2}{3}\mathcal{P})\delta _{ij}\text{\ \ \ and\ \ }\phi
+_{ij,3}=-C_{3}(G_{ij}-\frac{1}{3}\delta _{ij}G_{kk})
+\end{equation}
+
+The term $\phi _{ij,w}$ is called ``wall echo term'' (by default, it is not
+accounted for~: see \fort{turrij}).
+
+The dissipation term, $\varepsilon _{ij}$ , is considered isotropic:
+
+\begin{equation}
+\displaystyle\varepsilon _{ij}=\frac{2}{3}\ \delta _{ij}\varepsilon
+\end{equation}
+
+The turbulent diffusion terms are~:
+\begin{equation}
+d_{ij}=C_{S}\frac{\partial }{\partial x_{k}}(\rho \frac{k}{\varepsilon }%
+R_{km}\frac{\partial R_{ij}}{\partial x_{m}})\text{\hspace*{1cm}and%
+\hspace*{1cm}}{d}=C_{\varepsilon }\displaystyle\frac{\partial }{\partial
+x_{k}}\left( \rho \frac{k}{\varepsilon }R_{km}\frac{\partial \varepsilon }{%
+\partial x_{m}}\right)
+\end{equation}
+
+In the rare event of masse sources, $\Gamma R_{ij}^{i}$ and $\Gamma
+\varepsilon ^{i}$ are the corresponding injection terms. $ST_{R_{ij}}$ and $%
+ST_{\varepsilon }$ are also rarely used additional source terms that can
+prescribed by the user.
+
+%\begin{table}[htp]
+
+\begin{center}
+\begin{tabular}{|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|p{0,8cm}|}
+\hline
+$C_\mu$ & $C_{\varepsilon}$ & $C_{\varepsilon_1}$ & $C_{\varepsilon_2}$ & $%
+C_1$ & $C_2$ & $C_3$ & $C_S$ & $C^{\prime}_1$ & $C^{\prime}_2$ \\ \hline
+$0,09$ & $0,18$ & $1,44$ & $1,92$ & $1,8$ & $0,6$ & $0,55$ & $0.22$ & $0,5$
+& $0,3$ \\ \hline
+\end{tabular}
+\end{center}
+
+%\end{table}
+
+\clearpage \textbf{Definition of $\mu_t$ for $LES$}
+
+{\tiny $\bigstar $} \underline{Smagorinsky model}
+\begin{equation}
+\mu _{t}=\rho \,(C_{s}\,\overline{\Delta })^{2}\sqrt{2\overline{S_{ij}}\,%
+\overline{S_{ij}}}
+\end{equation}%
+With $\overline{S_{ij}}$ the filtered strain rate tensor components:
+\begin{equation}
+\overline{S_{ij}}=\frac{1}{2}\left( \frac{\partial \,\overline{u_{i}}}{%
+\partial \,x_{j}}+\frac{\partial \,\overline{u_{j}}}{\partial \,x_{i}}%
+\right)
+\end{equation}%
+Here, $\overline{u_{i}}$ stands for the $i^{th}$ resolved velocity component%
+\footnote{%
+In the case of implicit filtering, the discretisation in space introduces a
+spectral low pass filter: only the structures larger that twice the size of
+the cells are accounted for. Those structures are called ''the resolved
+scales'', whereas the rest, $u_{i}-\overline{u_{i}}$, is referred to as
+''unresolved scales'' or ''sub-grid scales''. The influence of the
+unresolved scales on the resolved scales have to be modelled.}. \newline
+\newline
+$C$ is the Smagorinsky constant. Its theoretical value is $0.18$ for
+homogenous isotropic turbulence, but the value $0.065$ is classic for
+channel flow. \newline
+\newline
+$\overline{\Delta }$ is the filter width associated with the finite volume
+formulation (implicit filtering which corresponds to the integration over a
+cell). The value recommended for hexahedral cells is: $\overline{\Delta }%
+=2\,|\Omega |^{\frac{1}{3}}$where $|\Omega |$ is the volume of the cell.
+
+{\tiny $\bigstar $} \underline{Classic dynamic model} \ \ \ (??this should
+be moved to chapter turbulence models??) \newline
+\newline
+A second filter is introduced: it is an explicit filter with a
+characteristic width $\widetilde{\Delta }$ superior to that of the implicit
+filter ($\overline{\Delta }$). If $a$ is a discrete variable defined over
+the computational domain, the variable obtained after applying the explicit
+filter to $a$ is noted $\tilde{a}$. Moreover, with:
+\[
+L_{ij}=\widetilde{\overline{u_{i}}\ \overline{u_{j}}}-\widetilde{\overline{%
+u_{i}}}\ \widetilde{\overline{u_{j}}}
+\]%
+\[
+\tau _{ij}=\overline{u_{i}u_{j}}-\overline{u_{i}}\ \overline{u_{j}}
+\]%
+\[
+T_{ij}=\widetilde{\overline{u_{i}u_{j}}}-\widetilde{\overline{u_{i}}}\
+\widetilde{\overline{u_{j}}}
+\]%
+Germano identity reads:
+\[
+L_{ij}=T_{ij}-\widetilde{\tau _{ij}}
+\]
+
+Both dynamic models described herafter rely on the estimation of the tensors
+$\tens{T}$ and $\tens{\tau}$ as functions of the filter widths and of the
+strain rate tensor (Smagorinsky model). The following modelling is adopted%
+\footnote{$\delta_{ij}$ stands for the Kroeneker symbol.}:
+
+\[
+T_{ij}-\frac{1}{3}\delta_{ij} T_{kk}= -2 C \widetilde{\Delta}^2 |\widetilde{%
+\overline{D_{ij}}}| \widetilde{\overline{D_{ij}}}
+\]
+\[
+\tau_{ij}-\frac{1}{3}\delta_{ij} \tau_{kk}= -2 C^* \overline{\Delta}^2 |%
+\overline{D_{ij}}| \overline{D_{ij}}
+\]
+
+$\overline{u}$ stands for the "implicit-filtered" value of a variable $u$
+defined at the centres of the cells and $\overline{u}$ represents the
+"explicit-filtered" value associated with the variable $u$. It follows that
+the numerical computation of $L_{ij}$ is possible, since it requires the
+explicit filtering to be applied to implicitly filtered variables only (%
+\textit{i.e.} to the variables explicitly computed).
+
+On the following assumption:
+
+\[
+C = C^*
+\]
+
+and assuming that $C^*$ is only slightly non-uniform, so that it can be
+taken out of the explicit filtering operator, the following equation is
+obtained:
+
+\[
+L_{ij} -\frac{1}{3} \delta_{ij} L_{kk}= C (\alpha_{ij}-\widetilde{\beta}%
+_{ij})
+\]
+
+with:
+
+\[
+\alpha_{ij} = -2 \widetilde{\Delta}^2 |\widetilde{\overline{D_{ij}}}|
+\widetilde{\overline{D_{ij}}}
+\]
+\[
+\beta_{ij} = -2 \overline{\Delta}^2 |\overline{D_{ij}}| \overline{D_{ij}}
+\]
+
+Since we are left with six equations to determine one single variable, the
+least square method is used\footnote{$L_{kk}$ has no effect for
+incompressible flows.}. With:
+\[
+E_{ij} = L_{ij}-C(\alpha_{ij} - \widetilde{\beta}_{ij})
+\]
+the value for $C$ is obtained by solving the following equation:
+\[
+\frac {\partial E_{ij}E_{ij}}{\partial C} = 0
+\]
+
+Finally:
+\[
+C = \frac{M_{ij}L_{ij}} {M_{kl}M_{kl}}
+\]
+with
+\[
+M_{ij} = \alpha_{ij} - \widetilde{\beta}_{ij}
+\]
+
+This method allows to calculate the Smagorinsky "constant" dynamically at
+each time step and at each cell. However, the value obtained for $C$ can be
+subjected to strong variations. Hence, this approach is often restricted to
+flows presenting one or more homogeneous directions (Homogeneous Isotropic
+Turbulence, 2D flows presenting an homogeneous spanwise direction...):
+indeed, in such cases, the model can be (and is) stabilized by replacing $C$
+by an average value of $C$ computed over the homogeneous direction(s).
+
+For a general case (without any homogeneous direction), a specific averaging
+is introduced to stabilize the model: for any given cell of the mesh, the
+averaged Smagorinsky constant is obtained as an average of $C$ over the
+"extended neighbourhood" of the cell (the set of cells that share at least
+one vertex with the cell considered). More precisely, the average value
+(also denoted $C$ hereafter) is calculated as indicated below:
+
+\[
+C = \frac{\widetilde{M_{ij}L_{ij}}} {\widetilde{M_{kl}M_{kl}}}
+\]
+
+\clearpage \textbf{Equations for the scalars}
+
+Two types of transport equations are considered: \newline
+{\tiny $\bigstar $} advection of a scalar with additional source terms:
+\begin{equation}
+\frac{\partial (\rho a)}{\partial t}+\underbrace{\,\dive\,((\rho \underline{u%
+})\,a)}_{\text{convection}}-\underbrace{\,\dive\,(K\grad a)}_{\text{diffusion%
+}}=TS_{a}+\Gamma \,a^{i}
+\end{equation}%
+{\tiny $\bigstar $} advection of the variance $\widetilde{{a"}^{2}}$ with
+additional source terms ~:
+\begin{equation}
+\begin{array}{lcl}
+& \displaystyle\frac{\partial (\rho \widetilde{{a"}^{2}})}{\partial t}+%
+\underbrace{\dive\,((\rho \,\underline{u})\ \widetilde{{a"}^{2}})}_{\text{%
+convection}}-\underbrace{\dive\,(K\ \grad\widetilde{{a"}^{2}})}_{\text{%
+diffusion}}=TS_{\widetilde{{a"}^{2}}}+\ \Gamma \,\widetilde{{a"}^{2}}^{i} &
+\\
+& \displaystyle\underbrace{+2\,\frac{\mu _{t}}{\sigma _{t}}(\grad\widetilde{a%
+})^{2}-\frac{\rho \,\varepsilon }{R_{f}k}\ \widetilde{{a"}^{2}}}_{\text{%
+production and dissipation}} &
+\end{array}%
+\end{equation}%
+The two previous equations can be unified formally as:
+\begin{equation}
+\frac{\partial (\rho f)}{\partial t}+\dive\,((\rho \,\underline{u})f)-\dive%
+\,(K\grad f)=TS_{f}+\Gamma \,f^{i}+T_{s}^{\,pd} \label{Base_Introd_depart}
+\end{equation}%
+with:
+\begin{equation}
+\begin{array}{lll}
+& \displaystyle T_{s}^{\,pd}=\begin{cases} 0 & \text{for $f=a$}, \\ 2\
+\displaystyle \frac{\mu_t}{\sigma_t}(\grad \widetilde{a})^2 - \displaystyle
+\frac{\rho\,\varepsilon}{R_f k}\ \widetilde{{a"}^2} & \text{for
+$f=\widetilde{{a"}^2}$ } \end{cases} &
+\end{array}%
+\end{equation}
+
+$TS_f$ represents the additional source terms that may be prescribed by the
+user.
+
+\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Discretisation in time}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+At first, the physical properties of the flow are computed (density,
+viscosity, specific heat...): indeed, they may depend upon the variables
+(such as the temperature for example).
+
+The time scheme is a $\theta$-scheme:
+\begin{equation}
+\left\{%
+\begin{array}{ll}
+\theta = 1 & \text{for an implicit first order Euler scheme} \\
+\theta = 1/2 & \text{for second order Crank-Nicolson scheme}%
+\end{array}
+\right.
+\end{equation}
+
+For the second order scheme, the time step is assumed to be constant.
+
+A fractional step scheme is used to solve the mass and momentum equations
+(Chorin). The first step (predictor step) provides predicted velocity
+components: they are determined sequentially and without coupling between
+each other. The mass equation is taken into account during the second step
+(corrector step): a pressure Poisson equation is solved and the mass fluxes
+at the cell faces are updated.
+
+If required, the equations for the turbulent variables are solved (turbulent
+kinetic energy and dissipation or Reynolds stresses and dissipation), using
+a $\theta$-scheme again. For the $k-\varepsilon$ model, an additional step
+is carried out to couple the source terms. For the Reynolds stress model,
+the variables (turbulent stresses and dissipation) are solved sequentially,
+without coupling.
+
+Next, the equations for the ``scalars'' (enthalpy, temperature, tracers,
+concentrations, mass fractions...) are solved, also with a $\theta$-scheme.
+
+Finally, all the variables are updated and another time step may start.
+
+The general equation for advection (valid for the velocity components, the
+turbulent variables and the scalars) is re-written as follows in a condensed
+form; the mass equation ($\frac{\partial \rho } {\partial t}+ \dive(\rho
+\underline{u}) = \Gamma$) has been used to split the time derivative:
+\begin{equation} \label{Base_Introd_simple}
+\rho \frac {\partial f}{\partial t} + \dive\,((\rho\,\underline{u}) f) - %
+\dive\,(K \grad f) = S_{i}(\Phi,\varphi)\,f + S_{e}(\Phi,\varphi) + \dive%
+\,(\rho\,\underline{u})\,f
+\end{equation}
+In this equation:\newline
+\begin{tabular}{ll}
+$\Phi$ & : represents the physical properties $(\rho,K,\mu_{t},...)$ \\
+$\varphi$ & : represents the variables of the problem $(\vect{u}%
+,k,\epsilon,...)$ \\
+$S_{i}(\Phi,\varphi)\,f$ & : represents the linear part of the source terms
+\\
+$S_{e}(\Phi,\varphi)$ & : includes all other source terms \\
+$\dive\,(\rho\,\underline{u})\,f$ & : is the term associated with ``mass
+accumulation''%
+\end{tabular}
+\newline
+\newline
+
+The time at which the different quantities are evaluated is indicated below:%
+\newline
+$\bullet$ $\Phi$: the time considered is defined by the time scheme applied
+to the physical properties.\newline
+$\bullet$ $(\rho\,\underline{u})$: the time considered is defined by the
+time scheme applied to the mass flux.\newline
+$\bullet$ $S_{e}(\Phi,\varphi)$: the time considered is defined by the time
+scheme applied to the explicit source terms.
+
+If $\theta=1/2$, or if an extrapolation is used, the time step $\Delta t$ is
+constant in time and uniform in space.
+
+\subsection{Physical properties}
+
+The physical properties of the flow (density, viscosity, specific heat...)
+are:
+
+\begin{itemize}
+\item[-] either explicit, defined at the time step $n$.
+
+\item[-] or extrapolated at $n+\theta _{\Phi }$ using the Adam-Bashforth
+time scheme (in this case, the time step is assumed to be constant).
+\end{itemize}
+
+Under a more general form, this reads:
+\begin{equation}
+\Phi \equiv \Phi^{n+\theta_{\Phi}}=(1+\theta_{\Phi})\,\Phi^{n}-
+\theta_{\Phi}\,\Phi^{n-1}
+\end{equation}
+
+\begin{equation}
+\left\{%
+\begin{array}{ll}
+\theta_{\Phi} = 0 & \text{standard explicit formulation} \\
+\theta_{\Phi} = 1/2 & \text{second order extrapolation at } n+1/2 \\
+\theta_{\Phi} = 1 & \text{first order extrapolation at } n+1%
+\end{array}
+\right.
+\end{equation}
+
+\subsection{Mass flux}
+
+For the mass flux, three time schemes are available. The mass flux may be:
+
+\begin{itemize}
+\item[-] explicit, taken at time step $n$ for the momentum equations and
+updated with its value at time step $n+1$ for the equations for turbulence
+and scalars (standard scheme).\newline
+
+\item[-] explicit, taken at time step $n$ for the momentum equations and
+also for the equations for turbulence and scalars.
+
+\item[-] taken at $n+\theta_{F}$ (second order if $\theta_{F}=1/2$). To
+solve the momentum equations, $(\rho\,\underline{u})^{n-2+\theta_{F}}$ and $%
+(\rho\,\underline{u})^{n-1+\theta_{F}}$ are known. Hence, the value at $%
+n+\theta_{F}$ is obtained as a result of the following extrapolation:
+\begin{equation}
+(\rho\,\underline{u})^{n+\theta_{F}}= 2\,\,(\rho\,\underline{u}%
+)^{n-1+\theta_{F}} -\,\,(\rho\,\underline{u})^{n-2+\theta_{F}}
+\end{equation}
+At the end of this phase (after the pressure correction step), $(\rho\,%
+\underline{u})^{n+1}$ is known and the following interpolation is used to
+determine the mass flux at $n+\theta_{F}$ that will be adopted for the
+equations for turbulence and scalars:
+\begin{equation}
+(\rho\,\underline{u})^{n+\theta_{F}}= \frac{1}{2-\theta_{F}}\,(\rho\,%
+\underline{u})^{n+1} +\frac{1-\theta_{F}}{2-\theta_{F}}\,(\rho\,\underline{u}%
+)^{n-1+\theta_{F}}
+\end{equation}
+\end{itemize}
+
+\subsection{Source terms}
+
+As for the physical properties, the \textbf{explicit} source terms are:
+
+\begin{itemize}
+\item[-] explicit:
+\begin{equation}
+\lbrack S_{e}(\Phi ,\varphi )]^{n}=S_{e}(\Phi ^{n+\theta _{\Phi }},\varphi
+^{n})
+\end{equation}
+
+\item[-] extrapolated at $n+\theta _{S}$ using the Adams-Bashforth scheme:
+\begin{equation}
+\lbrack S_{e}(\Phi ,\varphi )]^{n+\theta _{S}}=(1+\theta _{S})\,S_{e}(\Phi
+^{n},\varphi ^{n})-\theta _{S}\,S_{e}(\Phi ^{n-1},\varphi ^{n-1})
+\end{equation}
+\end{itemize}
+
+By default, to be consistent and preserve the order of convergence in time,
+the implicit source terms are discretized with the same scheme as that used
+for convection-diffusion of the unknown considered, \textit{i.e.} taken at $%
+n+\theta $:
+\begin{equation}
+\lbrack S_{i}(\Phi ,\varphi )\,f]^{n+\theta }=S_{i}(\Phi ^{n+\theta _{\Phi
+}},\varphi ^{n})\,[\theta \,f^{n+1}+(1-\theta )\,f^{n}]
+\end{equation}
+
+\underline{Note:}\newline
+The \textbf{implicit} source terms taken also at $n+\theta $ for $\theta
+_{S}\neq 0$, while for $\theta _{S}=0$, the implicit source terms are taken
+at $n+1$ , this to enhance stability.
+
+\subsection{General discrete form}
+
+For the sake of clarity, it is assumed hereafter that, unless otherwise
+explicitly stated, the mass flux is taken at $n+\theta_F$ and the physical
+properties are taken at $n+\theta_\Phi$, with $\theta_F$ and $\theta_\Phi$
+dependant upon the specific schemes selected for the mass flux and the
+physical properties respectively.
+
+Under a general form, the discrete counterpart of equation~(\ref{Base_Introd_simple}) at
+$n+\theta$ reads:
+\begin{equation}
+\begin{array}{c}
+\displaystyle \frac{\rho}{\Delta t}(f^{n+1}-f^{n})+ \dive\,((\rho\,%
+\underline{u}) f^{n+\theta})-\dive\,(K \grad f^{n+\theta}) = \\
+\left[S_{i}(\Phi,\varphi)\,f\right]^{n+\theta} + \left[S_{e}(\Phi,\varphi)%
+\right]^{n+\theta_{S}} + \dive\,(\rho\,\underline{u})\,f^{n+\theta}%
+\end{array}%
+\end{equation}
+
+Using the standard $\theta$-scheme $f^{n+\theta}=\theta\,f^{n+1}+(1-\theta)%
+\,f^{n}$, the equation reads:
+\begin{equation}
+\begin{array}{c}
+\displaystyle \frac{\rho}{\Delta t}(f^{n+1}-f^{n})+ \theta\,\dive\,((\rho\,%
+\underline{u}) f^{n+1})-\theta\, \dive\,(K \grad f^{n+1}) = \\
+- (1-\theta)\,\dive\,((\rho\,\underline{u}) f^{n})+(1-\theta)\,\dive\,(K %
+\grad \,f^{n}) + \\
+S_{i}(\Phi,\varphi^n)\left[\theta\,f^{n+1}+(1-\theta)\,f^{n}\right] + \left[%
+S_{e}(\Phi,\varphi)\right]^{n+\theta_{S}} + \dive\,(\rho\,\underline{u}%
+)\,(\theta\,f^{n+1}+(1-\theta)\,f^{n})%
+\end{array}%
+\end{equation}
+
+For numerical reasons, the system is solved in an iterative and incremental
+manner, with the help of the series $\delta f^{n+1,k+1}=f^{n+1,k+1}-f^{n+1,k}
+$ (with, by definition, $f^{n+1,0}=f^{n}$). In particular, this method
+allows to treat implicitly a portion of the advection-diffusion terms
+associated correction terms for non orthogonal meshes. Hence, the system
+actually solved reads:
+\begin{equation}
+\begin{array}{c}
+\displaystyle\underbrace{\left[ \frac{\rho }{\Delta t}-\theta \,S_{i}(\Phi
+,\varphi ^{n})-\theta \,\dive\,(\rho \,\underline{u})\,\right] }_{%
+\displaystyle\var{ROVSDT}}\,(f^{n+1,k+1}-f^{n+1,k}) \\
++\theta \,\dive\,((\rho \,\underline{u})\,(f^{n+1,k+1}-f^{n+1,k}))-\theta \,%
+\dive\,(K\grad\,(f^{n+1,k+1}-f^{n+1,k}))= \\
+\var{SMBRS}\left\{
+\begin{array}{c}
+-\theta \,\dive\,((\rho \,\underline{u})\,f^{n+1,k})+\theta \,\dive\,(K\grad%
+\,f^{n+1,k}) \\
+-(1-\theta )\,\dive\,((\rho \,\underline{u})\,f^{n})+(1-\theta )\,\dive\,(K%
+\grad\,f^{n}) \\
+\displaystyle-\frac{\rho }{\Delta t}(f^{n+1,k}-f^{n})+S_{i}(\Phi ,\varphi
+^{n})\left[ \theta \,f^{n+1,k}+(1-\theta )\,f^{n}\right] \\
++\dive\,(\rho \,\underline{u})\,(\theta \,f^{n+1,k}+(1-\theta )\,f^{n})+%
+\left[ S_{e}(\Phi ,\varphi )\right] ^{n+\theta _{S}}%
+\end{array}%
+\right.
+\end{array}%
+\end{equation}
+
+Whatever the equation considered (momentum equation, equations for
+turbulence or scalars,...) the system representation is always the same: a
+right-hand side (stored in the vector-array \var{SMBRS}) and a vector-array %
+\var{ROVSDT} for the part linear with respect to $\delta f^{n+1,k+1}$.%
+\newline
+
+\begin{description}
+\item The vector-array \var{ROVSDT} is computed by the subroutine %
+\fort{covofi} for the scalars, by \fort{preduv} for the velocity and by %
+\fort{turbke} or \fort{turrij} for the turbulence.
+
+\item The vector-array \var{SMBRS} is not computed at one go, but in two
+successive steps.\newline
+\end{description}
+
+The first part is calculated by the subroutines \fort{covofi}, \fort{preduv}%
+, \fort{turbke} and \fort{turrij} (respectively for the scalars, the
+velocity and the turbulence). At that point, the vector \var{SMBRS} is
+defined as follows:
+\begin{equation}
+\begin{array}{c}
+\var{SMBRS}=S_{i}(\Phi ,\varphi ^{n})\,f^{n}+\dive\,(\rho \,\underline{u}%
+)\,f^{n}+\left[ S_{e}(\Phi ,\varphi )\right] ^{n+\theta _{S}}%
+\end{array}%
+\end{equation}%
+then, the calculation of \var{SMBRS} is complemented at each sub-iteration
+during the resolution of the equation by the subroutine \fort{codits} as
+follows:
+\begin{equation}
+\begin{array}{c}
+\var{SMBRS}=\var{SMBRS}-\var{ROVSDT}\,(f^{n+1,k}-\,f^{n}) \\
+-\theta \,\dive\,((\rho \,\underline{u})\,f^{n+1,k})+\theta \,\dive\,(K\grad%
+\,f^{n+1,k}) \\
+-(1-\theta )\,\dive\,((\rho \,\underline{u})\,f^{n})+(1-\theta )\,\dive\,(K%
+\grad\,f^{n})%
+\end{array}%
+\end{equation}
+
+\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Discretisation in space}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Within the framework of the finite volume approach, the equations are
+integrated over each cell of the mesh (or "control volume" $\Omega_i$). This
+section is limited to a brief description of the way the terms appearing in
+the equations are integrated. Specific attention is devoted to the
+calculation of gradients, since it is a major characteristic of the
+co-located finite volume method (all the variables are associated with the
+same point, namely the cell centre\footnote{%
+The centre of a cell is a geometric point associated with the cell and
+located preferably inside the cell. Nevertheless, the word "centre" shall
+not be taken literally,
+%The use of the word "centre" is not absolutely correct,
+especially in the case of polyhedral cells that do not have a regular shape.}%
+).
+
+The terms of \textbf{order 0} (\textit{i.e.} the terms that are not a space
+derivative) are integrated to introduce their average over the cell. For
+example, $\rho g$ becomes $|\Omega _{i}|\overline{\rho }_{i}\,g$. In this
+expression, $|\Omega _{i}|$ is the volume of cell $\Omega _{i}$ and $%
+\overline{\rho }_{i}$ denotes the average of $\rho $ over the control volume
+(the cell) $\Omega _{i}$. For less clumsy notations, $|\Omega _{i}|\overline{%
+\rho }_{i}\,g$ is simply written as $|\Omega _{i}|\rho _{i}\,g$. When
+``reconstructions'' (in fact Taylor series) are required to reach a higher
+order in space, the average value $\rho _{i}$ is assumed to be associated
+with the centre I of $\Omega _{i}$.
+
+The ''divergence'' terms (or ``flux'' terms, or again ``conservative''
+terms) are integrated using the Green relation to introduce cell faces
+values (and so, ''fluxes'' appear naturally). For example, a term such as $%
+div(p)$ becomes\footnote{%
+If the cell $i$ is at the domain boundary, the sum becomes $%
+\sum\limits_{j\in Vois(i)}\overline{p}_{ij}S_{ij}+\sum\limits_{k\in \gamma
+(i)}\overline{p}_{b_{ik}}S_{b_{ik}}$, with $b_{ik}$ referring to the faces
+of the cell $i$ which are at the domain boundary.} $\sum\limits_{j\in
+Neibr(i)}\overline{p}_{ij}S_{ij}$. In this expression, $\overline{p}_{ij}$
+is the average of $p$ on the interface between the neighbouring cells $i$
+and $j$. The summation is carried out for $j\in Neibr(i)$, that is, all
+cells in the neighbourhood of $\Omega _{i}$ thus sharing a cell face with
+it. As for the cell-average above, the overbar is omitted: the sum is simply
+written $\sum\limits_{j\in Neibr(i)}p_{ij}S_{ij}$. The value $p_{ij}$ is
+assumed to be associated with the centre F of the face $ij$ when
+``reconstructions'' are needed to reach a higher order in space.
+
+The precision of the value $p_{ij}$ determines the precision of the
+calculation of $div(p)$. For $p_{ij}$, it is possible to take a non-centred
+and non-interpolated value (upwind scheme for convection) or a linear
+interpolation between the values at the centres I and J of the neighbouring
+cells. Both methods are relatively straighforward but may lack consistence
+and precision for arbitrary meshes (and in particular on non-orthogonal
+meshes). A higher order in space may be reached if reconstruction techniques
+are used. The idea is to compute the value for $p_{ij}$ more precisely: to
+do so, $p$ is interpolated at $F_{ij}$ (the centre of the face) using the
+values for $p$ at I and J and... the gradients of $p$ calculated at I and J.
+The reader will notice that it is precisely the calculation of the space
+derivatives\footnote{%
+The first derivatives in space are required to obtain $div(p)$ in each cell.}
+of $p$ that motivated the need for a good interpolation of $p$ at $F_{ij}$.
+Hence, the computation of the space derivatives of $p$ requires to solve a
+system: this is done in an iterative manner.
+
+Doing so allows to calculate the \textbf{"cell gradient"} of the variables.
+It is important to keep in mind that the "cell gradient" of a given variable
+represents the gradient of the variable in the cell and that it is obtained
+from the values of the variable interpolated at the cell faces.
+
+Similarly, the terms written as \textbf{``divergence of gradient''} are
+integrated to introduce face values. One has to calculate the gradient at
+each face (or "face gradient") in the direction normal to the face. This
+concept of "face gradient" is extremely important. The ``face gradient''
+normal to a face can be easily calculated with just the values at the
+centres of the two cells that share the face (points I and J on figure~\ref%
+{Base_Introd_fig_geom}), but this method is limited to orthogonal meshes.
+% fa modification : reconstruction is compulsory for consistence
+For consistence and to reach a higher order in space, the values of the
+variables at points I' and J' have to be used. These are calculated by a
+Taylor series from the values at I and J and from the "cell gradient"
+previously determined.
+
+\begin{figure}[t]
+\parbox{8cm}{\centerline{\includegraphics[height=4.5cm]{facette}}}
+\parbox{8cm}{\centerline{%
+\includegraphics[height=4.5cm]{facebord}}}
+\caption{Identification of the geometric entities for internal (left) and
+boundary faces (right).}
+\label{Base_Introd_fig_geom}
+\end{figure}
+
+\clearpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Calling tree}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+Each sub-section of this document is associated with an important
+subroutine. The full list of the subroutines described here is the
+following: \fort{bilsc2} \fort{clptur} \fort{clsyvt} \fort{codits} %
+\fort{condli} \fort{covofi} \fort{gradmc} \fort{gradrc} \fort{inimas} %
+\fort{itrmas} \fort{matrix} \fort{navsto} \fort{preduv} \fort{recvmc} %
+\fort{resolp} \fort{turbke} \fort{turrij} \fort{viscfa} \fort{visort} %
+\fort{vissec}.
+
+The table~\ref{Base_Introd_simple_calling_tree} presents their sequence within a time
+step. This calling tree is only partial. In particular, it does not account
+for the number of calls to each subroutine. Also, for the sake of clarity,
+no reference has been made to the subroutines dedicated to the gradient
+calculation (\fort{gradmc}, \fort{gradrc}), which are called very often. For
+the same reason, the calls to \fort{bilsc2} (advection fluxes) and %
+\fort{matrix} (matrix calculation) which are made from within \fort{codits}
+(treatment of an advection equation with source terms) have not been
+reported.
+
+The sub-sections where important information can be found are indicated
+below:\newline
+\newline
+\nl \newline
+\textbf{Calculation of gradients}\newline
+\hspace*{1cm}\fort{gradrc}\newline
+\hspace*{1cm}\fort{gradmc}\newline
+\textbf{Least square method}\newline
+\hspace*{1cm}\fort{recvmc}\newline
+\hspace*{1cm}\fort{gradmc}\newline
+\textbf{Convective schemes}\newline
+\hspace*{1cm}\fort{bilsc2}\newline
+\textbf{Wall-laws} (for velocity and temperature)\newline
+\hspace*{1cm}\fort{clptur}\newline
+\hspace*{1cm}\fort{condli}\newline
+\textbf{System solve} (incremental method)\newline
+\hspace*{1cm}\fort{codits}\newline
+\textbf{Calculation of the values at the faces} (not exhaustive)\newline
+\hspace*{1cm}\fort{viscfa}\newline
+\hspace*{1cm}\fort{visort}\newline
+
+Finally, for the reader wishing to become more familiar with the methods
+implemented in \CS, it is recommended to begin with the study of the
+advection equation for a scalar (\fort{covofi}) which is solved iteratively
+using an incremental method (\fort{codits}). It will then be useful to look
+at \fort{navsto} which briefly presents the solution of the system made up
+of the mass and momentum equations.
+
+\begin{table}[htp]
+\underline{\textbf{Calculation of the physical properties}}\newline
+\underline{\textbf{Boundary Conditions}}\newline
+\hspace*{1cm}\fort{condli} \newline
+\hspace*{1,5cm}\fort{clptur} \hspace*{1cm} ``turbulent'' conditions at the
+wall\newline
+\hspace*{1,5cm}\fort{clsyvt} \hspace*{1cm} symmetry conditions for the
+vectors and the tensors\newline
+\underline{\textbf{Navier-Stokes solution}}\newline
+\hspace*{1cm}\fort{navsto}\newline
+\hspace*{1,5cm}\textbf{Velocity prediction}\newline
+\hspace*{2,0cm}\fort{preduv} \newline
+\hspace*{2,5cm}\fort{vissec} \hspace*{1cm} momentum source terms related to
+the \newline
+\hspace*{4,5cm} \hspace*{1cm} transposed gradient of the velocity\newline
+\hspace*{2,5cm}\fort{viscfa} \hspace*{1cm} calculation of the viscosity at
+the faces\newline
+\hspace*{2,5cm}\fort{codits} \hspace*{1cm} iterative solution of the system
+using an incremental method\newline
+\hspace*{1,5cm}\textbf{Pressure correction}\newline
+\hspace*{2,0cm}\fort{resolp} \newline
+\hspace*{2,5cm}\fort{viscfa} \hspace*{1cm}calculation of the time step at
+the faces...\newline
+\hspace*{2,5cm}\fort{visort} \hspace*{1,5cm} ...according to the selected
+options\newline
+\hspace*{2,5cm}\fort{matrix} \hspace*{1cm}calculation of the Poisson
+equation matrix\newline
+\hspace*{2,5cm}\fort{inimas} \hspace*{1cm}initialisation of the mass flow
+rate\newline
+\hspace*{2,5cm}\fort{itrmas} \hspace*{1cm}update of the mass flow rate%
+\newline
+\hspace*{1,5cm} \textbf{Velocity correction}\newline
+\hspace*{3,2cm} \hspace*{1cm}standard method or...\newline
+\hspace*{2,0cm}\fort{recvmc} \hspace*{1cm}least square method\newline
+\underline{\textbf{$k-\varepsilon$ model}}\newline
+\hspace*{1cm}\fort{turbke}\newline
+\hspace*{1,5cm}\fort{viscfa} \hspace*{1cm}preliminary steps before...\newline
+\hspace*{1,5cm}\fort{bilsc2} \hspace*{1,5cm}...source terms coupling\newline
+\hspace*{1,5cm}\fort{viscfa} \hspace*{1cm}calculation of the viscosity at
+the faces\newline
+\hspace*{1,5cm}\fort{codits} \hspace*{1cm}iterative solution of the systems
+using an incremental method\newline
+\underline{\textbf{Reynolds stress model}}\newline
+\hspace*{1cm}\fort{turrij}\newline
+\hspace*{1,5cm}\fort{visort} \hspace*{1cm}calculation of the viscosity at
+the faces\newline
+\hspace*{1,5cm}\fort{codits} \hspace*{1cm}iterative solution of the systems
+using an incremental method\newline
+\underline{\textbf{Equations for the scalars}}\newline
+\hspace*{1cm}\fort{covofi}\newline
+\hspace*{1,5cm}\fort{viscfa} \hspace*{1cm}calculation of the viscosity at
+the faces\newline
+\hspace*{1,5cm}\fort{codits} \hspace*{1cm}iterative solution of the systems
+using an incremental method\newline
+\caption{Partial and simplified calling tree associated with the successive
+stages within a time step.}
+\label{Base_Introd_simple_calling_tree}
+\end{table}
diff --git a/doc/theory/itrmas.tex b/doc/theory/itrmas.tex
new file mode 100644
index 0000000..3dfae8e
--- /dev/null
+++ b/doc/theory/itrmas.tex
@@ -0,0 +1,167 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{itrmas/itrgrp}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le but du sous-programme \fort{itrmas} est de calculer un gradient de pression
+``facette''. Il est utilis\'e dans la phase de correction de pression
+(deuxi\`eme phase de \fort{navsto}) o\`u le flux de masse est mis \`a jour \`a l'aide de termes en $-\Delta t_{\,ij}(\grad_f P)_{\,ij}.\vect{S}_{\,ij}$ et en $-\Delta t_{\,b_{ik}}(\grad_f P)_{\,b_{ik}}\,.\,\vect{S}_{\,b_{ik}}$.
+
+Le sous-programme \fort{itrgrp} calcule un gradient ``facette'' de pression et
+en prend la divergence, c'est-\`a-dire calcule le terme :
+\begin{displaymath}
+-\sum\limits_{j\in Vois(i)}\Delta t_{\,ij}(\grad_f P)_{\,ij}.\vect{S}_{\,ij}
+-\sum\limits_{k\in\gamma_b(i)}\Delta t_{\,b_{ik}}(\grad_f P)_{\,b_{ik}}\,.\,\vect{S}_{\,b_{ik}}
+\end{displaymath}
+En pratique \fort{itrgrp} correspond \`a la combinaison de \fort{itrmas} et de
+\fort{divmas}, mais permet par son traitement en un seul bloc d'\'eviter la
+d\'efinition de tableaux de travail de taille \var{NFAC} et \var{NFABOR}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+La figure \ref{Base_Itrmas_fig_geom} rappelle les diverses d\'efinitions g\'eom\'etriques
+pour les faces internes et les faces de bord.
+
+\begin{figure}[h]
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facebord}}}
+\caption{\label{Base_Itrmas_fig_geom}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+
+
+\subsection{Calcul sans reconstruction des non orthogonalit\'es}
+Pour les faces internes, on \'ecrit simplement :
+\begin{equation}
+\label{Base_Itrmas_eq_intssrec}
+-\Delta t_{\,ij}(\grad_f P)_{\,ij}\,.\,\vect{S}_{\,ij}=
+\frac{\Delta t_{\,ij}S_{\,ij}}{\overline{I^\prime J^\prime}}(P_I-P_J)
+\end{equation}
+
+Pour les faces de bord, on \'ecrit :
+\begin{equation}
+\label{Base_Itrmas_eq_brdssrec}
+-\Delta t_{b_{ik}}(\grad_f P)_{\,b_{ik}}\,.\,\vect{S}_{\,b_{ik}}=
+\frac{\Delta t_{\,b_{ik}}S_{\,b_{ik}}}{\overline{I^\prime F}}
+\left((1-B_{b,ik})P_I-\var{INC}\times A_{b,ik}\right)
+\end{equation}
+
+Les pas de temps aux faces $\Delta t_{\,ij}$ et $\Delta t_{\,b_{ik}}$ sont calcul\'es
+par interpolation par les sous-programmes \fort{viscfa} (cas isotrope,
+\var{IPUCOU=0}) ou \fort{visort} (cas anisotrope, \var{IPUCOU=1}).
+
+
+\subsection{Calcul avec reconstruction des non orthogonalit\'es}
+Plusieurs discr\'etisations peuvent \^etre propos\'ees pour le traitement des
+non orthogonalit\'es. Celle retenue dans le code est issue des premiers tests
+r\'ealis\'es sur le prototype, et fait intervenir non seulement le pas de temps
+interpol\'e \`a la face, mais aussi les pas de temps dans chaque
+cellule. Il
+serait sans doute bon de revenir sur cette \'ecriture et \'evaluer d'autres
+solutions. La forme utilis\'ee pour les faces internes est :
+\begin{multline}
+\label{Base_Itrmas_eq_intavcrec}
+-\Delta t_{\,ij}(\grad_f P)_{\,ij}\,.\,\vect{S}_{\,ij}=
+\frac{\Delta t_{\,ij}S_{\,ij}}{\overline{I^\prime J^\prime}}(P_I-P_J)\\
++(\vect{II}^\prime-\vect{JJ}^\prime).\frac{1}{2}\left[
+\Delta t_I(\grad P)_I+\Delta t_J(\grad P)_J\right]
+\frac{S_{\,ij}}{\overline{I^\prime J^\prime}}
+\end{multline}
+
+Pour les faces de bord, on \'ecrit :
+\begin{equation}
+\label{Base_Itrmas_eq_brdavcrec}
+-\Delta t_{\,b_{ik}}(\grad_f P)_{\,b_{ik}}\,.\,\vect{S}_{\,b_{ik}}=
+\frac{\Delta t_{\,b_{ik}} S_{\,b_{ik}}}{\overline{I^\prime F}}
+\left[(1-B_{b,ik})(P_I+\vect{II}^\prime.(\grad P)_I)-\var{INC}\times A_{b,ik}\right]
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Les principaux arguments pass\'es \`a \fort{itrmas} et \fort{itrgrp} sont la
+variable trait\'ee \var{PVAR} (la pression), ses conditions aux limites, le pas
+de temps projet\'e aux faces\footnote{%
+Plus pr\'ecis\'ement, le pas de temps projet\'e aux faces, multipli\'e par la
+surface et divis\'e par $\overline{I^\prime J^\prime}$ ou $\overline{I^\prime F}$, cf. \fort{viscfa}}
+(\var{VISCF} et \var{VISCB}), le pas de temps au
+centre des cellules, \'eventuellement anisotrope (\var{VISELX}, \var{VISELY},
+\var{VISELZ}). \fort{itrmas} retourne les tableaux \var{FLUMAS} et \var{FLUMAB}
+(flux de masse aux faces) mis \`a jour. \fort{itrgrp} retourne directement la
+divergence du flux de masse mis \`a jour, dans le tableau \var{DIVERG}.
+
+\etape{Initialisation}
+Si \var{INIT} vaut 1, les variables \var{FLUMAS} et \var{FLUMAB} ou \var{DIVERG}
+sont mises \`a z\'ero.
+
+\etape{Cas sans reconstruction}
+La prise en compte ou non des non orthogonalit\'es est d\'etermin\'ee par
+l'indicateur \var{NSWRGR} de la variable trait\'ee (nombre de sweeps de
+reconstruction des non orthogonalit\'es dans le calcul des gradients), pass\'e
+par la variable \var{NSWRGP}. Une valeur inf\'erieure ou \'egale \`a 1 enclenche
+le traitement sans reconstruction.\\
+Des boucles sur les faces internes et les faces de bord utilisent directement
+les formules (\ref{Base_Itrmas_eq_intssrec}) et (\ref{Base_Itrmas_eq_brdssrec}) pour remplir les
+tableaux \var{FLUMAS} et \var{FLUMAB} (\fort{itrmas}) ou des variables de
+travail \var{FLUMAS} et \var{FLUMAB} qui servent \`a mettre \`a jour le tableau
+\var{DIVERG} (\fort{itrgrp}).
+
+\`A noter que les tableaux \var{VISCF} et \var{VISCB} contiennent respectivement
+$\displaystyle\frac{\Delta t_{\,ij}S_{\,ij}}{\overline{I^\prime J^\prime}}$ et
+$\displaystyle\frac{\Delta t_{\,b_{ik}}S_{\,b_{ik}}}{\overline{I^\prime F}}$.
+
+\etape{Cas avec reconstruction}
+Apr\`es un appel \`a \fort{GRDCEL} pour calculer le gradient cellule de
+pression, on remplit les tableaux \var{FLUMAS} et \var{FLUMAB} ou \var{DIVERG}
+l\`a encore par une application directe des formules (\ref{Base_Itrmas_eq_intavcrec}) et
+(\ref{Base_Itrmas_eq_brdavcrec}).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Il est un peu redondant de passer en argument \`a la fois le pas de temps
+projet\'e aux faces et le pas de temps au centre des cellules. Il faudrait
+s'assurer de la r\'eelle n\'ecessit\'e de cela, ou alors \'etudier des
+formulations plus simples de la partie reconstruction.
+
diff --git a/doc/theory/matrix.tex b/doc/theory/matrix.tex
new file mode 100644
index 0000000..231a94a
--- /dev/null
+++ b/doc/theory/matrix.tex
@@ -0,0 +1,386 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{matrix}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Le but de ce sous-programme, appel\'e par \fort{codits} et \fort{covofi}, est de construire la
+matrice de convection/diffusion, incluant les contributions ad\'equates des termes sources,
+intervenant dans le membre de gauche d'\'equations discr\'etis\'ees telles que
+celle de la
+quantit\'e de mouvement, d'une \'equation de convection diffusion d'un scalaire
+ou de mod\`ele de turbulence.\\
+Le type d'\'equation consid\'er\'ee est, pour la variable scalaire $a$ :
+\begin{equation}\notag
+\displaystyle \frac{\partial a}{\partial t} + \dive (\,(\rho \vect{u})\, a) -
+\displaystyle \frac{\partial }{\partial x}\left(\beta\,\frac{\partial a}{\partial x}\right) = 0
+\end{equation}
+La matrice ne s'applique qu'aux termes non reconstruits, les autres \'etant pris en compte au second membre et
+trait\'es dans le sous-programme \fort{bilsc2}. La partie
+convective, lorsqu'elle existe, est issue du sch\'ema upwind pur, quelque soit
+le type de sch\'ema convectif choisi par l'utilisateur. En effet, c'est, \`a
+l'heure actuelle, la seule fa\c con d'obtenir un op\'erateur lin\'eaire �
+diagonale dominante.\\\\
+La matrice est donc associ\'ee \`a $\mathcal{EM_{\it{scal}}}$, op\'erateur
+agissant sur un scalaire $a$ (inspir\'e de celui vectoriel $\mathcal{EM}$
+d\'efini dans \fort{navsto}) d'expression actuelle, pour tout cellule $\Omega_i$ de
+centre $I$ :
+\begin{equation}\notag
+\begin{array}{lll}
+\mathcal{EM_{\it{scal}}}(a,I) &= f_s^{imp}\ a_I\ \\
+&+\sum\limits_{j\in Vois(i)}{F^{\,amont}_{\,ij}((\rho\vect{u})^n,a)}
++\sum\limits_{k\in {\gamma_b(i)}} {F^{\,amont}_{\,{b}_{ik}}((\rho
+\vect{u})^n,a)}\\
+&-\sum\limits_{j\in Vois(i)}{D^{NRec}_{\,ij}(\beta,a)}
+-\sum\limits_{k\in {\gamma_b(i)}} {D^{NRec}_{\,{b}_{ik}}(\beta,a)}\\
+\end{array}
+\end{equation}
+avec~:\\
+$\bullet$ $f_s^{imp}$ le coefficient issu du terme instationnaire
+$\displaystyle\frac{\rho \ |\Omega_i|}{\Delta t}$, s'il y a lieu, et de
+l'implicitation de certains termes sources (contribution d\'ecoulant de la prise
+en compte de la
+variation $\displaystyle\frac{\partial \rho }{\partial t}$ de
+la masse volumique $\rho$ au cours du temps, diagonale du tenseur de pertes de
+charges par exemple...): cette initialisation est en fait effectu\'ee en amont
+de ce sous-programme, \\
+$\bullet$ $F^{\,amont}_{\,ij}$ le flux num\'erique convectif scalaire
+d\'ecentr\'e amont calcul\'e \`a la face interne $ij$ de la cellule $\Omega_i$,\\
+$\bullet$ $F^{\,amont}_{\,b_{ik}}$ le flux num\'erique convectif scalaire
+d\'ecentr\'e amont associ\'e calcul\'e \`a la face de bord $ik$ de la cellule $\Omega_i$
+jouxtant le bord du domaine $\Omega$,\\
+$\bullet$ $D^{\,NRec}_{\,ij}$ le flux num\'erique diffusif scalaire non
+reconstruit associ\'e calcul\'e \`a la face interne $ij$ de la cellule $\Omega_i$,\\
+$\bullet$ $D^{\,NRec}_{\,{b}_{ik}}$ le flux num\'erique diffusif scalaire non
+reconstruit associ\'e calcul\'e \`a la face de bord $ik$ de la cellule $\Omega_i$ jouxtant le bord du domaine $\Omega$,\\
+$\bullet$ $Vois(i)$ repr\'esente toujours l'ensemble des cellules
+voisines de ${\Omega_i}$ et $\gamma_b(i)$ l'ensemble des faces de
+bord de ${\Omega_i}$.\\
+Du fait de la r\'esolution en incr\'ements, $a$ est un incr\'ement et ses
+conditions aux limites associ\'ees sont donc de type Dirichlet homog\`ene ou de
+type
+Neumann homog\`ene.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{figure}[h]
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facebord}}}
+\caption{\label{Base_Matrix_fig_geom_gradmc}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+
+L'op\'erateur $\mathcal{EM_{\it{scal}}}$ s'\'ecrit, pour tout $I$ centre de cellule :
+\begin{equation}
+\begin{array}{lll}
+\mathcal{EM_{\it{scal}}}(a,I) &= f_s^{imp}\ a_I \\
+&+\sum\limits_{j\in Vois(i)}\left[{(\rho \vect{u})_{\,ij}^n} \text{.}\, \vect{S}_{\,ij}\right]\ a_{\,f,ij}
++\sum\limits_{k\in {\gamma_b(i)}} \left[{(\rho \vect{u})_{\,{b}_{ik}}^n}
+\text{.}\, \vect{S}_{\,{b}_{ik}}\right]\ {a_f}_{\,{b}_{ik}} \\
+&-\sum\limits_{j\in Vois(i)} \beta_{\,ij}\displaystyle
+\frac{a_{\,J}- a_{\,I}}{\overline{I'J'}} S_{\,ij}
+-\sum\limits_{k\in {\gamma_b(i)}} \beta_{\,b_{ik}}\displaystyle
+\frac{a_{\,b_{ik}}-a_{\,I}}{\overline{I'F}} S_{\,b_{ik}} \\
+\end{array}
+\end{equation}
+o\`u
+$a_{\,f,ij} = a_{\,I} \text{ ou } a_{\,J}$
+selon le signe de $(\rho \vect{u})_{\,ij}^n.\vect{S}_{\,ij}$ (sch�ma
+convectif upwind syst�matique),
+et avec $\overline{I'J'}$, mesure alg\'ebrique, orient\'ee comme la
+normale sortante \`a la face, {\it i.e.} allant de $I$ vers $J$ pour la cellule
+$\Omega_i$ de centre $I$. On la
+notera ${\overline{I'J'}^{\tiny {\,I}}}$ lorsqu'on aura besoin d'expliciter
+clairement l'orientation.\\
+${a_f}_{\,{b}_{ik}} = a_I \text{ ou }
+a_{\ {b}_{ik}}$ selon le signe de
+${(\rho \vect{u})_{\,{b}_{ik}}^n}\text{.}\, \vect{S}_{\,{b}_{ik}}$ (sch�ma
+upwind syst�matique)
+et $a_{\ {b}_{ik}}$ valeur au bord est donn\'ee directement par les conditions
+aux limites (valeur non reconstruite). $\overline{I'F}$, mesure alg\'ebrique, orient\'ee relativement \`a la
+normale sortante \`a la face, {\it i.e.} allant de $I$ vers l'ext\'erieur du domaine.\\
+En g\'en\'eral, sauf cas pathologiques, les mesures alg\'ebriques
+$\overline{I'J'}$ et $\overline{I'F}$
+sont positives et correspondent aux distances $I'J'$ et $I'F$. On se reportera
+au paragraphe Points \`a traiter pour plus de d\'etails.\\
+Soit ${\tens{EM}}_{\,scal}$ la matrice associ\'ee ; sa taille est {\it a priori} de
+$\var{NCEL} * \var{NCEL}$, mais compte-tenu de la nature de la structure de
+donn\'ees, seuls deux tableaux \var{DA(NCEL)} contenant les valeurs
+diagonales et \var{XA(NFAC,*)} les contributions des termes extra-diagonaux sont n\'ecessaires, avec \var{NCEL} nombre de
+cellules du maillage consid\'er\'e et \var{NFAC} nombre de faces internes associ\'e.\\
+Du fait des simplifications effectu\'ees sur la matrice (non reconstruction des
+termes), les composantes extradiagonales de la ligne $I$ ne sont diff\'erentes de z\'ero que pour
+les indices $J$ des cellules voisines de $I$. On peut donc stocker toutes les
+contributions non nulles de la matrice dans deux tableaux \var{DA(NCEL)} et \var{XA(NFAC,2)} :\\
+$\bullet$ \var{DA(I)} est le coefficient de la colonne $I$ dans la ligne $I$,\\
+$\bullet$ si \var{IFAC} est une face qui s\'epare les cellules $\Omega_i$
+et $\Omega_j$, orient\'ee de $I$ vers $J$, alors :\\
+$\var{XA(IFAC,1)}$ est le coefficient de la colonne $J$ dans la ligne $I$ et
+$\var{XA(IFAC,2)}$ est le coefficient de la colonne $I$ dans la ligne $J$.
+Lorsque la matrice est sym\'etrique, {\it
+i.e.} lorsqu'il n'y a pas de convection (\var{ICONVP} = 0) et que seule la
+diffusion est \`a prendre en compte, alors $\var{XA(IFAC,1)} = \var{XA(IFAC,2)}
+$ et on r\'eduit \var{XA} \`a $\var{XA(NFAC,1)}$.\\\\
+Soit $m_{\,ij}^n$ (\ $m_{\,{b}_{ik}}^n$\ ) la valeur de $(\rho
+\vect{u})_{\,ij}^n.\vect{S}_{\,ij}$ (respectivement $(\rho
+\vect{u})_{\,{b}_{ik}}^n\text{.}\,\vect{S}_{\,{b}_{ik}}$).\\
+Alors~:\\
+\hspace*{1cm}{\tiny$\blacksquare$}\ \underline{contribution volumique} : $ f_s^{\,imp}\ a_I $\\\\
+\hspace*{1cm}{\tiny$\blacksquare$}\ \underline{contribution d'une face purement interne $ij$} \\
+L'expression \\
+\begin{equation}\notag
++ \sum\limits_{j\in Vois(i)}{F^{\,amont}_{\,ij}((\rho \vect{u})^n, a)}
+- \sum\limits_{j\in Vois(i)}{D^{NRec}_{\,ij}(\,\beta, a)}
+\end{equation}
+ s'\'ecrit :
+\begin{equation}\label{Base_Matrix_eq_face_int}
+\begin{array}{ll}
+&\ \sum\limits_{j\in Vois(i)}\displaystyle\left({ \left[{(\rho \vect{u})_{\,ij}^n} \text{.}\,
+\vect{S}_{\,ij}\right]\ \ a_{\,f,ij} - \beta_{\,ij}\frac{a_J - a_I}{\overline{I'J'}} S_{\,ij}}\right)\\
+&=\sum\limits_{j\in Vois(i)}\left[\displaystyle\frac{1}{2}(\ m_{\,ij}^n + |\
+m_{\,ij}^n|\ )\,a_I + \displaystyle\frac{1}{2}(\ m_{\,ij}^n - |\
+m_{\,ij}^n|)\,a_J\right] - \sum\limits_{j\in Vois(i)}\displaystyle \beta_{\,ij}\frac{a_J - a_I}{\overline{I'J'}} S_{\,ij}
+\end{array}
+\end{equation}\\
+Ici, $\overline{I'J'} = {\overline{I'J'}^{\tiny {\,I}}}$.\\\\
+\hspace*{1cm}{\tiny$\blacksquare$}\ \underline{contribution d'une face de bord $ik$} \\
+De m\^eme :
+\begin{equation}\label{Base_Matrix_eq_face_bord}
+\begin{array}{ll}
+&\ \sum\limits_{k\in {\gamma_b(i)}} {F^{\,amont}_{\,{b}_{ik}}((\rho \vect{u})^n,a)}
+- \sum\limits_{k\in {\gamma_b(i)}} {D^{NRec}_{\,{b}_{ik}}(\beta, a)}\\
+&=\sum\limits_{k\in {\gamma_b(i)}}\displaystyle\left(\left[{(\rho
+\vect{u})_{\,{b}_{ik}}^n} \text{.}\, \vect{S}_{\,{b}_{ik}}\right]\
+{a_f}_{\,{b}_{ik}} - \beta_{\,b_{ik}}
+\frac{a_{\,b_{ik}}- a_I}{\overline{I'F}} S_{\,b_{ik}}\right)\\
+&=\sum\limits_{k\in {\gamma_b(i)}}\left[\displaystyle\frac{1}{2}(\ m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\,a_I +
+\displaystyle\frac{1}{2}(\ m_{\,{b}_{ik}}^n -
+|m_{\,{b}_{ik}}^n|)\,a_{\,{b}_{ik}}\right] - \sum\limits_{k\in {\gamma_b(i)}}\displaystyle\beta_{\,b_{ik}}
+\frac{a_{\,b_{ik}}- a_I}{\overline{I'F}} S_{\,b_{ik}}
+\end{array}
+\end{equation}
+avec~:
+\begin{equation}\notag
+a_{\,{b}_{ik}} = \var{INC}\,A_{\,b,ik} + B_{\,b,ik}\,a_I = B_{\,b,ik}\,a_I
+\end{equation}
+$a$ n'\'etant associ\'ee qu'\`a des conditions aux limites de type Dirichlet
+homog\`ene ou de type Neumann homog\`ene.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{\bf Initialisations}
+L'indicateur de sym\'etrie \var{ISYM} de la matrice consid\'er\'ee est affect\'e comme suit :\\
+\hspace*{1cm}$\bullet$ $\var{ISYM}$ = 1 , si la matrice est sym\'etrique ;
+on travaille en diffusion pure , \var{ICONVP} = 0 et \var{IDIFFP} = 1,\\
+\hspace*{1cm}$\bullet$ $\var{ISYM}$ = 2 , si la matrice est non sym\'etrique ;
+on travaille soit en convection pure (~\var{ICONVP}~=~1, \var{IDIFFP}~=~0~), soit en
+convection/diffusion (~\var{ICONVP}~=~1,~\var{IDIFFP}~=~1~).\\
+Les termes diagonaux de la matrice sont stock\'es dans le tableau
+$\var{DA(NCEL)}$. Ceux extra-diagonaux le sont dans $\var{XA(NFAC,1)}$ si la
+matrice est sym\'etrique, dans $\var{XA(NFAC,2)}$ sinon.
+
+
+Le tableau $\var{DA}$ est initialis\'e \`a z\'ero pour un calcul avec
+$ \var{ISTATP} = 0 $ (en fait, ceci ne concerne que les calculs relatifs \`a la
+pression). Sinon, on lui affecte la valeur \var{ROVSDT} comprenant la partie instationnaire, la contribution du terme continu en $-\ a\ \dive(\rho \vect{u})^n$
+et la partie diagonale des termes sources implicit\'es. Le tableau
+$\var{XA(NFAC,*)}$ est initialis\'e \`a z\'ero.\\
+\subsection{\bf Calcul des termes extradiagonaux stock\'es dans \var{XA} }
+Ils ne se calculent que pour des faces purement internes \var{IFAC}, les faces
+de bord ne contribuant qu'\`a la diagonale.
+\subsubsection{matrice non sym\'etrique ( pr\'esence de convection ) }
+%\hspace*{1cm}{\tiny$\blacksquare$}\ \underline{pour une face purement interne
+%$ij\ ( \var{IFAC} )$} \\
+Pour chaque face interne \var{IFAC}, les contributions extradiagonales relatives
+au terme $a_I$ et \`a son voisin associ\'e $a_J$ sont calcul\'ees dans
+$\var{XA(IFAC,1)}$ et $\var{XA(IFAC,2)}$ respectivement (pour une face orient�e
+de I vers J).\\
+On a les relations suivantes :\\
+\begin{equation}\label{Base_Matrix_eq_extra}
+\begin{array}{ll}
+\var{XA(IFAC,1)}& = \var{ICONVP}\,*\,\var{FLUI} - \var{IDIFFP}\,*\,\var{VISCF(IFAC)}\\
+\var{XA(IFAC,2)}& = \var{ICONVP}\,*\,\var{FLUJ} - \var{IDIFFP}\,*\,\var{VISCF(IFAC)}\\
+\end{array}
+\end{equation}
+avec $\var{FLUMAS(IFAC)}$ correspondant \`a $\ m_{\,ij}^n$, $\var{FLUI}$ \`a $ \displaystyle\frac{1}{2}\,(\ m_{\,ij}^n - |\
+m_{\,ij}^n|\ )$, $\var{VISCF(IFAC)} $ \`a $ \ \displaystyle \beta_{\,ij}\frac {
+S_{\,ij}}{\overline{I'J'}} $.\\\\
+$\var{XA(IFAC,1)}$ repr\'esente le facteur de $a_J$ dans la
+derni\`ere expression de (\ref{Base_Matrix_eq_face_int}).\\
+
+$\var{FLUJ}$ correspond \`a $\ -\displaystyle\frac{1}{2}\,(\ m_{\,ij}^n + |\
+m_{\,ij}^n|\ )$. En effet, $\var{XA(IFAC,2)}$ est le facteur de $a_I$ dans l'expression \'equivalente de
+la derni\`ere ligne de (\ref{Base_Matrix_eq_face_int}), mais \'ecrite en J.\\
+Ce qui donne :\\
+\begin{equation}\label{Base_Matrix_eq_extra_J}
+\sum\limits_{i\in
+Vois(j)}\left[\displaystyle\frac{1}{2}(\ m_{\,ji}^n + |\ m_{\,ji}^n|\ )\,a_J +
+\displaystyle\frac{1}{2}(\ m_{\,ji}^n - |\ m_{\,ji}^n|)\,a_I\right]
+ - \sum\limits_{i\in Vois(j)}\displaystyle \beta_{\,ji}\frac{a_I - a_J}{\overline{J'I'}} S_{\,ji}
+\end{equation}\\
+Le terme recherch\'e est donc :
+$\ \displaystyle\frac{1}{2}(\ m_{\,ji}^n - |\ m_{\,ji}^n|\ )-\displaystyle
+\beta_{\,ji}\frac {S_{\,ji}}{\overline{J'I'}}$ .\\
+Or :\\ $ m_{\,ji}^n $ = $\ - m_{\,ij}^n $ ($\vect{S}_{\,ji} = -
+\vect{S}_{\,ij}$ et $(\rho \vect{u})_{\,ji}^n\ =\ (\rho \vect{u})_{\,ij}^n\
+$), avec $\overline{J'I'}$ mesure alg\'ebrique, orient\'ee relativement \`a la
+normale sortante \`a la face, {\it i.e.} allant de $J$ vers $I$. On la note
+${\overline{J'I'}^{\tiny {\,J}}}$. \\
+On a la relation :\\
+\begin{equation}\label{Base_Matrix_Eq_mesure_alg}
+\overline{J'I'}^{\tiny {\,J}}=\ \overline{I'J'}^{\tiny {\,I}} = (\ \overline{I'J'})
+\end{equation}
+d'o\`u la deuxi\`eme \'egalit\'e dans (\ref{Base_Matrix_eq_extra}).
+\subsubsection{matrice sym\'etrique ( diffusion pure ) }
+Pour chaque face interne \var{IFAC}, la contribution extradiagonale relative au
+terme $a_I$ est calcul\'ee dans
+$\var{XA(IFAC,1)}$ par la relation suivante :\\
+\begin{equation}
+\var{XA(IFAC,1)} = - \var{IDIFFP}\,*\,\var{VISCF(IFAC)}\\
+\end{equation}
+avec $\var{VISCF(IFAC)} $ \`a $ \ \displaystyle \beta_{\,ij}\frac {
+S_{\,ij}}{\overline{I'J'}} $.
+\subsection{\bf Calcul des termes diagonaux stock\'es dans \var{DA} }
+\subsubsection{matrice non sym\'etrique ( pr\'esence de convection ) }
+Pour chaque face interne $ij\ ( \var{IFAC} )$ s\'eparant les cellules $\Omega_i$
+de centre $I$ et $\Omega_j$ de centre $J$, $\var{DA(II)}$ est la quantit\'e en facteur de $a_I$ dans la
+derni\`ere expression de (\ref{Base_Matrix_eq_face_int}), soit :
+\begin{equation}\label{Base_Matrix_eq_diag_II}
+\displaystyle\frac{1}{2}(\ m_{\,ij}^n + |\ m_{\,ij}^n|\ )+\displaystyle
+\beta_{\,ij}\frac {S_{\,ij}}{\overline{I'J'}}
+\end{equation}
+De m\^eme, pour \var{DA(JJ)}, on a :
+\begin{equation}\label{Base_Matrix_eq_diag_JJ}
+\displaystyle\frac{1}{2}(\ - m_{\,ij}^n + |\ m_{\,ij}^n|\ )+\displaystyle
+\beta_{\,ji}\frac {S_{\,ij}}{\overline{I'J'}}
+\end{equation}
+d'apr\`es l'expression de (\ref{Base_Matrix_eq_extra_J}) et l'\'egalit\'e (\ref{Base_Matrix_Eq_mesure_alg}).\\
+L'implantation dans \CS associ\'ee est la suivante~:\\
+pour toute face \var{IFAC} d'\'el\'ements voisins $\var{II} =
+\var{IFACEL(1,IFAC)}$ et $\var{JJ} = \var{IFACEL(2,IFAC)}$,\\
+on ajoute \`a
+$\var{DA(II)}$ la contribution crois\'ee $-\var{XA(IFAC,2)}$ ({\it cf.}
+(\ref{Base_Matrix_eq_diag_II})) et
+\`a
+$\var{DA(JJ)}$ la contribution $-\var{XA(IFAC,1)}$ ({\it cf.}
+(\ref{Base_Matrix_eq_diag_JJ})).
+\subsection{\bf Prise en compte des conditions aux limites}
+Elles interviennent juste dans le tableau \var{DA}, compte-tenu de leur
+\'ecriture et d\'efinition. Elles se calculent {\it via} la derni\`ere
+expression de (\ref{Base_Matrix_eq_face_bord}). Pour chaque face \var{IFAC}, de l'\'el\'ement
+de centre $I$, jouxtant le bord, on s'int\'eresse \`a :
+\begin{equation}
+\begin{array}{ll}
+\sum\limits_{k\in {\gamma_b(i)}}\left[\displaystyle\frac{1}{2}(\ m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\,a_I +
+\displaystyle\frac{1}{2}(\ m_{\,{b}_{ik}}^n -
+|m_{\,{b}_{ik}}^n|)\,a_{\,{b}_{ik}}\right] - \sum\limits_{k\in {\gamma_b(i)}}\displaystyle\beta_{\,b_{ik}}
+\frac{a_{\,b_{ik}}- a_I}{\overline{I'F}} S_{\,b_{ik}}
+\end{array}
+\end{equation}
+avec~:
+\begin{equation}\notag
+a_{\,{b}_{ik}} = B_{\,b,ik}\,a_I\\
+\end{equation}
+soit :
+\begin{equation}
+\begin{array}{ll}
+\left(\sum\limits_{k\in {\gamma_b(i)}}\left[\displaystyle\frac{1}{2}(\ m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\,+
+\displaystyle\frac{1}{2}(\ m_{\,{b}_{ik}}^n -
+|m_{\,{b}_{ik}}^n|)B_{\,b,ik}\,\right] + \sum\limits_{k\in {\gamma_b(i)}}\displaystyle\beta_{\,b_{ik}}
+\frac{1 -\ B_{\,b,ik}}{\overline{I'F}} S_{\,b_{ik}}\right) a_I
+\end{array}
+\end{equation}
+ce qui, pour le terme sur lequel porte la somme, se traduit par :\\
+$\var{ICONVP} * (- \var{FLUJ} + \var{FLUI} * \var{COEFBP(IFAC)} + \var{IDIFFP} *
+\var{VISCB(IFAC)} * (\ 1 -\ \var{COEFBP(IFAC)})$ \\ avec,
+$\ m_{\,{b}_{ik}}^n\ $ repr\'esent\'e par $\ \var{FLUMAB(IFAC)}\ $,
+$\ \displaystyle\frac{1}{2}\ (\
+m_{\,{b}_{ik}}^n + |\ m_{\,{b}_{ik}}^n|\ )\ $ par $\ \var{-\ FLUJ}\ $,\\
+$\ \displaystyle\frac{1}{2}\ (\ m_{\,{b}_{ik}}^n -
+|m_{\,{b}_{ik}}^n|)B_{\,b,ik}\ $ par $\ \var{FLUI}\ $,
+$B_{\,b,ik}$ par $\var{COEFBP(IFAC)}$, $\beta_{\,b_{ik}}\displaystyle\frac
+{S_{\,b_{ik}}}{\overline{I'F}} $ par $\var{VISCB(IFAC)}$.\\
+\subsection{\bf D\'ecalage du spectre}
+Lorsqu'il n'existe aucune condition \`a la limite de type Dirichlet et que
+$\var{ISTATP} = 0 $ (c'est-\`a-dire pour la pression uniquement), on
+d\'eplace le spectre de la matrice ${\tens{EM}}_{\,scal}$ de $\var{EPSI}$ ({\it i.e.} on multiplie chaque terme diagonal par $(1 + \var{EPSI})$ ) afin
+de la rendre inversible. \var{EPSI} est fix\'e en dur dans \fort{matrix} \`a
+ ${10}^{-7}$.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Initialisation}
+Le tableau \var{XA} est initialis\'e \`a z\'ero lorsqu'on veut annuler la
+contribution du terme en
+$\displaystyle\frac{\rho \ |\Omega_i|}{\Delta t}$, {\it i.e.} $\var{ISTATP} = 0 $ . Ce qui ne permet donc pas la prise en
+compte effective des parties diagonales des termes sources \`a impliciter,
+d\'ecid\'ee par l'utilisateur. Actuellement, ceci ne sert que pour la variable
+pression et reste donc {\it a priori} correct, mais cette d\'emarche est \`a
+corriger dans l'absolu.\\\\
+\etape{Nettoyage}
+La contribution $\var{ICONVP}\ \var{FLUI}$, dans le calcul du terme
+\var{XA(IFAC,1)} lorsque la matrice est sym\'etrique est inutile, car
+$\var{ICONVP}\ = 0$. \\\\
+\etape{Prise en compte du type de sch\'ema de convection dans
+${\tens{EM}}_{\,scal}$}
+Actuellement, les contributions des flux convectifs non reconstruits sont
+trait\'ees par sch\'ema d\'ecentr\'e amont, quelque soit le sch\'ema choisi par
+l'utilisateur. Ceci peut \^etre handicapant. Par exemple, m\^eme sur
+maillage orthogonal, on est oblig\'e de faire plusieurs sweeps pour obtenir une
+vitesse pr\'edite correcte. Un sch\'ema centr\'e sans test de pente peut
+\^etre implant\'e facilement, mais cette \'ecriture pourrait, dans l'\'etat
+actuel des connaissances, entra\^\i ner des instabilit\'es
+num\'eriques. Il serait souhaitable d'avoir d'autres sch\'emas tout aussi
+robustes, mais plus adapt\'es \`a certaines configurations.\\\\
+\etape{Maillage localement pathologique}
+Il peut arriver, notamment au bord, que les mesures alg\'ebriques,
+$\overline{I'J'}$ ou $\overline{I'F}$ soient n\'egatives (en cas de maillages
+non convexes par exemple). Ceci peut engendrer des probl\`emes plus ou moins
+graves : perte de l'existence et l'unicit\'e de la solution (l'op\'erateur associ\'e n'ayant plus les bonnes propri\'et\'es de r\'egularit\'e
+ou de coercivit\'e), d\'egradation de la matrice (perte de la positivit\'e) et donc r\'esolution par solveur lin\'eaire
+associ\'e non appropri\'e (gradient conjugu\'e par exemple).\\
+Une impression permettant de signaler et de localiser le probl\`eme serait souhaitable.
+
+
diff --git a/doc/theory/navsto.tex b/doc/theory/navsto.tex
new file mode 100644
index 0000000..65178ee
--- /dev/null
+++ b/doc/theory/navsto.tex
@@ -0,0 +1,730 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+
+\programme{navsto}
+
+\vspace{1cm}
+On s'int\'eresse \`a la r\'esolution du syst\`eme d'\'equations de Navier-Stokes
+tridimensionnelles monophasiques, \`a une pression, instationnaires, en
+incompressible ou faiblement dilatable, bas\'ees sur une discr\'etisation
+temporelle de type Euler implicite d'ordre 1 ou Crank-Nicolson d'ordre 2 et sur
+une discr\'etisation spatiale par volumes finis colocalis\'ee.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Dans ce sous-programme sont calcul\'ees, \`a un pas de temps donn\'e, les
+variables vitesse et pression de ce probl\`eme en proc\'edant en
+deux \'etapes issues d'une d\'ecomposition des op\'erateurs (m\'ethode \`a
+pas fractionnaires).\\
+Les variables sont donc suppos\'ees connues \`a
+l'instant ${t^n}$ et on cherche \`a les d\'eterminer \`a l'instant\footnote{La pression est suppos�e connue � l'instant $t^{n-1+\theta}$ et recherch�e en $t^{n+\theta}$, avec $\theta=1$ ou $1/2$ suivant le sch�ma en temps consid�r�.} ${t^{n+1}}$. Soit ${\Delta {t^n} ={t^{n+1}- {t^n}}}$ le pas de temps associ\'e. Dans un premier temps, on r\'ealise l'\'etape de
+pr\'ediction de la vitesse en r\'esolvant l'\'equation de quantit\'e de
+mouvement avec une pression explicite. Suit l'\'etape de correction de la
+pression (ou projection de la vitesse) qui permet d'obtenir un champ de vitesse \`a divergence nulle.\\\\
+Les \'equations en continu sont donc :
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle\frac{\partial}{\partial t}(\rho \vect{u}) + \dive(\rho\, \vect{u} \otimes \vect{u})
+=\dive(\tens{\sigma}) + \vect{TS} - \tens{K}\,\vect{u}\\
+\dive(\rho \vect{u}) = \Gamma
+\end{array}\right.
+\end{equation}
+
+%(plus tard $\frac{\partial \rho}{\partial t} + \dive(\rho \vect{u}) = \Gamma$)
+
+
+
+avec $\rho$ la masse volumique, $\vect{u}$ le champ de vitesse,
+$[\,\vect{TS}-\tens{K}\,\vect{u}\,]$ les autres termes sources ($\tens{K}$~est un
+tenseur diagonal positif par d\'efinition), $\tens{\sigma}$ le tenseur
+de contraintes, $\tens{\tau}$ le tenseur des contraintes visqueuses, $\mu$ la
+viscosit\'e dynamique (mol\'eculaire et \'eventuellement turbulente), $\kappa$
+la viscosit� de
+volume (usuellement nulle et n�glig�e dans le code et dans la suite du document,
+sauf en compressible),
+$\tens{D}$ le tenseur taux de d\'eformation\footnote{\`A ne pas confondre, malgr\'e la m\^eme notation $D$,
+avec les flux diffusifs $\vect{D}_{\,ij}$ et $\vect{D}_{\,{b}_{ik}}$ d\'ecrits par la suite dans ce
+sous-programme.}, $\Gamma$ le terme source de masse.
+\begin{equation}
+\left\{\begin{array}{l}
+\tens{\sigma} = \tens{\tau} - P\tens{Id} \\
+\tens{\tau} = 2\,\mu\ \tens{D} +\ (\kappa\ - \frac{2}{3}\mu)\ tr({\tens{D}})\
+\tens{Id} \\
+\tens{D} = \frac{1}{2}(\ggrad\vect{u}+\,^{t}\ggrad\vect{u})
+\end{array}\right.
+\end{equation}
+ \\
+
+On rappelle la d\'efinition des notations employ\'ees\footnote{en
+utilisant la convention de sommation d'Einstein.}~:
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+\left[\ggrad{\vect{a}}\right]_{ij} &=& \partial_j a_i\\
+\left[\dive(\tens{\sigma})\right]_i &=& \partial_j \sigma_{ij}\\
+\left[\vect{a}\otimes\vect{b}\right]_{ij} &= &
+a_i\,b_j\\
+\end{array}\right.
+\end{equation}
+et donc :
+\begin{equation}\notag
+\begin{array}{lll}
+\left[\dive(\vect{a}\otimes\vect{b})\right]_i &= &
+\partial_j (a_i\,b_j)
+\end{array}
+\end{equation}
+
+\minititre{Remarque}
+Dans le cas de la prise en compte d'une masse volumique variable, l'�quation de continuit� s'�crit :
+$$\frac{\partial \rho}{\partial t} + \dive{\,(\rho\,\vect{u})} = \Gamma $$
+Cette �quation n'est pas prise en compte dans l'�tape de projection (on continue � r�soudre
+seulement
+$\displaystyle \dive(\,{\rho\,\vect{u}}) = \Gamma$) alors que le terme
+$\displaystyle \frac{\partial \rho}{\partial t}$ appara\^{\i}t lors de l'�tape de pr\'ediction de la vitesse
+dans le sous-programme \fort{preduv}. Si ce terme joue un r�le sensible, l'algorithme compressible
+de \CS (qui r�sout l'�quation compl�te) est alors sans doute plus adapt�.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+On pose :
+
+\begin{equation}\notag
+\displaystyle\alpha_{ij}=\frac{\overline{FJ'}}{\overline{I'J'}} \text{\ d\'efini aux faces internes uniquement et}
+\end{equation}
+\begin{equation}\notag
+\vect{u}_{K'} = \vect{u}_{K}+(\ggrad{\vect{u}})_K\text{.}\, \vect{KK'}\, \text{\ \`a l'ordre
+1 en espace, pour ${K = I \,\text{ou}\, J}$}
+\end{equation}
+
+\begin{figure}[h]
+\hspace*{1cm}\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4cm]{facebord}}}
+\caption{\label{Base_Navsto_fig_geom}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+
+\subsection{\bf M\'ethode \`a pas fractionnaires}
+\subsubsection{\bf Introduction}
+Une des m\'ethodes permettant de r\'esoudre num\'eriquement les \'equations de
+Navier-Stokes est de d\'ecomposer les op\'erateurs s'y rattachant en
+op\'erateurs moins complexes (qui peuvent \^etre trait\'es \`a l'aide d'algorithmes
+efficaces), moyennant des sous-pas interm\'ediaires dans un m\^eme pas de
+temps. Ici, deux sous-pas sont r\'ealis\'es : le premier reprend les
+parties convective, diffusive et termes sources de l'\'equation de quantit\'e de mouvement et
+constitue l'\'etape dite de pr\'ediction de la vitesse, le
+second traite l'\'equation de continuit\'e et est
+d\'esign\'e comme l'\'etape de correction de pression ou de projection de la vitesse.
+
+\subsubsection{\bf \'Etape de pr\'ediction des vitesses}
+La discr\'etisation en temps se fait en appliquant \`a la variable r\'esolue un $\theta$-sch\'ema au temps $n+\theta$ s'inspirant de la d\'emarche utilis\'ee pour l'\'equation de transport d'un scalaire\footnote{cf. \fort{covofi}}.\\ La vitesse au temps $n+1$ n'\'etant disponible qu'apr\`es l'\'etape de projection, c'est ici une vitesse pr\'edite au temps $n+1$ que l'on utilise pour interpoler :
+\begin{equation}
+\label{Base_Navsto_thetaschema}
+\vect{\widetilde{u}}^{n+\theta} = \theta\, {\vect{\widetilde{u}}}^{n+1}+(1-\theta)\, \vect{u}^{n}
+\end{equation}
+Avec\footnote{Dans le cas o� $\theta = 1/2$, le pas de temps $\Delta t$ est suppos� uniforme en temps et en espace.} :
+\begin{equation}
+\left\{
+\begin{array}{ll}
+\theta = 1 & \text{Pour un sch\'ema de type Euler implicite d'ordre 1.}\\
+\theta = 1/2 & \text{Pour un sch\'ema de type Cranck-Nicolson d'ordre 2.}\\
+\end{array}
+\right.
+\end{equation}
+
+Le champ de vitesse ${\vect{\widetilde{u}}^{n+1}}$ pr\'edit est alors obtenu par
+:\\
+$\bullet\ $ Lin\'earisation partielle de l'op\'erateur de convection engendrant
+un d\'ecouplage des composantes de la vitesse.\\
+$\bullet\ $ Explicitation de la pression.\\
+$\bullet\ $ Explicitation ou extrapolation des grandeurs physiques ({\it i.e}
+$\rho,\,\mu,\,Cp\,...$) et du flux de masse.\\
+$\bullet\ $ Explicitation ou extrapolation des termes sources explicites au
+temps $n+\theta_{S}$ tels que les contributions du gradient transpos\'e, de la
+viscosit� secondaire, de la partie extradiagonale des pertes de charges, de la
+masse inject�e $\Gamma\,\underline{u_i}$, ...\\
+$\bullet$ Les termes sources implicites lin�aires par rapport � la vitesse
+(termes sources utilisateurs implicite, partie diagonale des pertes de charge
+$\tens{K_d}\,\underline{u}$, sources de masse $\Gamma\,\underline{u}$, etc...)
+sont suppos�s pris au temps $n+\theta$ et sont rattach\'es au tenseur
+$\tens{K}$\footnote{En r�alit�, les composantes de la vitesse �tant d�coupl�es,
+seuls les termes lin�aires par rapport � la composante r�solue sont factoris�s de la
+sorte. Les autres termes �tant trait�s comme des termes explicites. On pourra se
+rapporter � \fort{preduv} pour plus de d�tail.}.\\
+
+Par souci de clart�, on suppose qu'en l'absence d'indication, les propri�tes
+physiques $\Phi\,=\,\rho,\,\mu\,...$ et le flux de masse $(\rho\vect{u})$ pris
+respectivement aux instants $n+\theta_\Phi$ et $n+\theta_F$, o� $\theta_\Phi$ et
+$\theta_F$ d�pendent des sch�mas en temps sp�cifiquement utilis�s pour ces
+grandeurs\footnote{cf. \fort{introd}}.
+\\
+On r\'esout donc le syst\`eme suivant, apr�s r��criture des termes instationnaires � l'aide de la conservation de la masse :
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+\rho\,\left(\displaystyle\frac{\vect{\widetilde{u}}^{n+1}-\vect {u}^{n}}{\Delta t}\right) +
+\dive \,\left(\vect{\widetilde{u}}^{n+\theta} \otimes (\rho\vect{u})\right) =
+\dive(\tens{\sigma}^{n+\theta})+\vect{TS}^{n+\theta_{S}}-\tens{K}^{n}\,\vect{u}^{n+\theta} +\vect{\widetilde{u}}^{n+\theta}\,\dive{(\rho\vect{u})}\\
+\label{Base_Navsto_eq_prediction_continue}
+\end{array}
+\end{equation}
+avec ~:
+\begin{equation}
+\begin{array}{l}
+\displaystyle
+\tens{\sigma}^{n+\theta}=\mu\,\,\ggrad\vect{\widetilde{u}}^{n+\theta}\underbrace{-P^{n-1+\theta}\tens{Id}+(\,\mu\,\,^{t}\ggrad\vect{u})^{n+\theta_{S}}- \frac{2}{3}\,(\,\mu\, \dive\,\vect{u})^{n+\theta_{S}}\tens{Id}}_{\text{termes sources explicites}}\\
+\end{array}
+\end{equation}
+
+\subsubsection{\bf \'Etape de correction de la pression (ou projection des vitesses)}
+Le champ de vitesse pr\'edit est {\it a priori} \`a divergence non nulle. La seconde
+\'etape corrige la pression en imposant la nullit\'e de la contrainte
+stationnaire pour la vitesse prise \`a l'instant ${t^{n+1}}$.
+On r\'esout donc :
+\begin{equation}\label{Base_Navsto_eq_correction_continue}
+\left\{\begin{array}{l}
+\displaystyle\frac{(\rho\vect{u})^{n+1}-(\rho\vect{\widetilde{u}})^{n+1}}{\Delta t} =
+-\grad{\delta P^{n+\theta}} \\
+\displaystyle
+\dive(\rho\vect{u})^{n+1} = \Gamma\\
+\end{array}\right.
+\end{equation}
+
+o\`u l'incr\'ement de pression $\delta P^{n+\theta}$ vaut~:
+\begin{equation}
+\delta P^{n+\theta}=P^{n+\theta}-P^{n-1+\theta}
+\end{equation}
+\minititre{Remarque}
+Les quantit\'es $\rho$ et $\mu$ sont constantes lors de ces
+deux \'etapes. Leur variation \'eventuelle est effectu\'ee au d�but du pas de temps suivant, apr�s r�actualisation des scalaires (temp�rature, fraction massique,...).
+
+\subsection{\bf Discr\'etisation spatiale}
+On int\`egre classiquement sur les volumes de contr\^ole ${\Omega_i}$ (ou cellules) les
+\'equations discr\'etis\'ees en temps.
+\subsubsection{\bf \'Etape de pr\'ediction des vitesses}
+\paragraph{\bf Second membre\\ }
+Si l'on ne tient pas compte des termes de convection et de diffusion issus du $\theta$-sch�ma, les termes sources volumiques explicites de l'\'equation (\ref{Base_Navsto_eq_prediction_continue}) s'�crivent pour le syst\`eme portant sur la quantit� $(\vect{\widetilde{u}}^{n+1}-\vect {u}^{n})$ :\\
+\begin{equation}\notag
+\begin{array}{c}
+\displaystyle
+ -\grad P^{n-1+\theta} + \dive \left[ (\,\mu\,\,^{t}\ggrad\vect{u})^{n+\theta_{S}}- \frac{2}{3}\,(\,\mu\, \dive\,\vect{u})^{n+\theta_{S}}\tens{Id} \,\right]+\vect{TS}^{n+\theta_{S}}- \,\tens{K}^{n} \vect{u}^{n}+\vect{u}^{n}\,\dive{(\rho\vect{u})}\\
+\end{array}
+\end{equation}
+Pour int\'egrer ces termes sur une cellule ${\Omega_i}$, on multiplie leur valeur locale au centre par le volume de la cellule.
+
+\paragraph{\bf Convection \\}
+
+Apr\`es d\'ecomposition de $\vect{\widetilde{u}}$ \`a l'aide de la relation (\ref{Base_Navsto_thetaschema}), l'int\'egration spatiale des parties convectives $\theta\,{\dive\left(\vect{\widetilde{u}}^{n+1}\otimes (\rho \vect{u})\right)}$ et $(1-\theta)\,{\dive\left(
+\vect{u}^{n}\otimes (\rho \vect{u})\right)}$ conduit � une somme de flux num\'eriques ${\vect{F}\,_{\,ij}}$ calcul\'es aux faces des cellules purement internes et de flux num\'eriques ${\vect{F}_{\,b_{ik}}}$ calcul\'es aux faces de bord du domaine $\Omega$.
+Soient $Vois(i)$ l'ensemble des centres des cellules voisines de ${\Omega_i}$ et
+$\gamma_b(i)$ l'ensemble des centres des faces de bord de ${\Omega_i}$, on a :
+
+\begin{equation}\notag
+\int_{\Omega_i}{\dive\left(\vect{u}\otimes (\rho \vect{u})\right)\, d\Omega} =
+\sum_{j\in Vois(i)}{\vect{F}_{\,ij}((\rho \vect{u}), \vect{u})} \\
++\sum_{k\in {\gamma_b(i)}} {\vect{F}_{\,{b}_{ik}}((\rho \vect{u}),\vect{u})}
+\end{equation}
+
+en posant :
+\begin{equation}
+\vect{F}_{\,ij}((\rho \vect{u}), \vect{u}) = \left[{(\rho \vect{u})_{\,ij}} \text{.}\, \vect{S}_{\,ij}\right]
+\ \vect{u}_{\,f,ij}
+\end{equation}
+
+\begin{equation}
+{\vect{F}_{\,{b}_{ik}}}((\rho \vect{u}),\vect{u}) = \left[{(\rho \vect{u})_{\,{b}_{ik}}} \text{.}\, \vect{S}_{\,{b}_{ik}}\right]\,{\vect{u}_f}_{\,{b}_{ik}}
+\end{equation}
+La valeur de ${\vect{F}_{\,ij}}$ d\'epend du type de sch\'ema num\'erique
+choisi. Il en existe trois dans \CS \ :
+\begin{tabular}{ll}
+\multicolumn{2}{l}{$\bullet\ $un sch\'ema d\'ecentr\'e amont d'ordre 1 (upwind)~:}\\
+&$\vect{F}_{\,ij}((\rho \vect{u}), \vect{u})=
+\vect{F}^{\it{ amont}}_{\,ij}((\rho \vect{u}),\vect{u})$\\
+o\`u :&$\vect{u}_{\,f,ij}=\vect{u}_{\,I}$ si $(\rho
+\vect{u})_{\,ij}.\vect{S}_{\,ij}\,\geqslant 0$\\
+&$\vect{u}_{\,f,ij}=\vect{u}_{\,J}$ si $(\rho
+\vect{u})_{\,ij}.\vect{S}_{\,ij}\,< 0$ ,\\
+\multicolumn{2}{l}{$\bullet\ $un sch\'ema centr\'e d'ordre 2:}\\
+&$\vect{F}_{\,ij}((\rho \vect{u}), \vect{u})=
+\vect{F}^{\text{\it{centr\'e}}}_{\,ij}((\rho\vect{u}),\vect{u})$\\
+avec :&$\vect{u}_{\,f,ij}=
+\alpha_{ij} \vect{u}_{\,I'}+(1-\alpha_{ij}) \vect{u}_{\,J'}$ et $\vect{u}_{K'} = \vect{u}_{K}+(\ggrad{\vect{u}})_K\text{.}\, \vect{KK'}$ pour ${K = I \,\text{ou}\, J}$\\
+\multicolumn{2}{l}{$\bullet\ $un sch\'ema d\'ecentr\'e amont d'ordre 2 SOLU (Second Order Linear Upwind)~:}\\
+&$\vect{F}_{\,ij}((\rho \vect{u}), \vect{u})=
+\vect{F}^{\text{\it { SOLU}}}_{\,ij}((\rho \vect{u}),\vect{u})$ \\
+\multicolumn{2}{l}{\begin {tabular}{lll}
+avec :&$\vect{u}_{\,f,ij}=$&$
+\vect{u}_{\,I} +\vect{IF}.\,(\ggrad\vect{u})_{\,I}$ \ si $(\rho
+\vect{u})_{\,ij}.\vect{S}_{\,ij}\,\geqslant 0$\\
+&&$\vect{u}_{\,J} + \vect{JF}.\,(\ggrad\vect{u})_J$ \ si $(\rho
+\vect{u})_{\,ij}.\vect{S}_{\,ij}\,< 0$.
+\end{tabular}}
+\end{tabular}\\
+
+
+La valeur de ${\vect{F}_{\,b_{ik}}}$ est calcul\'ee avec :\\
+\begin{equation}
+\begin{array}{ll}
+{\vect{u}_f}_{\,{b}_{ik}} &=\vect{u}_{\,I}
+\ \text{si $(\rho \vect{u})_{\,{b}_{ik}}\,.\,\vect{S}_{\,{b}_{ik}}\,\geqslant 0$}\\
+&={\vect{u}_{\,{b}_{ik}}}
+\ \text{si $(\rho \vect{u})_{\,{b}_{ik}}\,.\, \vect{S}_{\,{b}_{ik}}\,< 0$}
+\end{array}
+\end{equation}
+
+avec ${\vect{u}_{\ {b}_{ik}}}$ valeur au bord donn\'ee directement par les
+conditions aux limites.\\
+
+\noindent\minititre{Remarque 2}
+En centr\'e, on \'ecrit en r\'ealit\'e (\'egalit\'e
+conservant l'ordre un en espace) :
+
+\begin{equation}\notag
+\vect{u}_{\,f,ij} = \alpha_{ij} \vect{u}_{\,I} + (1-\alpha_{ij})
+\vect{u}_{\,J} +
+\frac{1}{2}\left[(\ggrad{\vect{u}})_I+(\ggrad{\vect{u}})_J\right] \text{.}\, \vect{OF}
+\end{equation}
+
+pour des raisons de stabilit\'e purement num\'erique.\\
+\minititre{Remarque 3 }
+Un test de pente (qui peut introduire des non lin\'earit\'es dans l'op\'erateur
+de convection) permet de
+basculer entre un sch\'ema d'ordre deux et le sch\'ema d\'ecentr\'e amont
+d'ordre un.
+De plus, en mode standard, on utilise en tout point une valeur de
+$\vect{\widetilde{u}}_{\,f,ij}$ issue d'une moyenne barycentrique entre la valeur
+d\'ecentr\'ee amont et la valeur d'ordre 2 (blending, sp�cifi� par l'utilisateur).
+\paragraph{\bf Diffusion\\}
+De m\^eme, les parties diffusives $\theta\,\,\dive(\mu\,\ggrad{\vect{\widetilde{u}}}^{n+1})$ et $(1-\theta)\,\,\dive(\mu \ggrad{\vect{u}}^{n})$ s'\'ecrivent :
+\begin{equation}\notag
+\int_{\Omega_i}{\dive(\mu\, \ggrad{\vect{u}}) d\Omega} =
+\sum_{j\in Vois(i)}{\vect{D}_{\,ij}(\mu, \vect{u})}
++\sum_{k\in {\gamma_b(i)}} {\vect{D}_{\,{b}_{ik}}(\mu,\vect{u})}
+\end{equation}
+avec~:
+\begin{equation}
+\vect{D}_{\,ij}(\mu, \vect{u}) = \mu_{ij}
+\frac{\vect{u}_{\,J'}-\vect{u}_{\,I'}}{\overline{I'J'}} S_{\,ij}
+\end{equation}
+et :
+\begin{equation}
+\vect{D}_{\,b_{ik}}(\mu, \vect{u}) = \mu_{\,b_{ik}}
+\frac{\vect{u}_{\,b_{ik}}-\vect{u}_{\,I'}}{\overline{I'F}} S_{\,b_{ik}}
+\end{equation}
+en conservant les notations pr\'ec\'edentes et avec
+${\vect{u}_{\,{b}_{ik}}}$ la valeur au bord donn\'ee directement par les conditions aux limites.\\
+La viscosit\'e $\mu_{\,ij}$ \`a la face est calcul\'ee \`a l'aide des valeurs
+aux centres selon une fonction $f$ donn\'ee :
+\begin{equation}\notag
+\mu_{\,ij} = f(\mu_I,\mu_J)
+\end{equation}
+qui est, soit une moyenne arithm\'etique~:
+\begin{equation}
+f(\mu_I,\mu_J)= \frac{1}{2}(\mu_I+\mu_J)
+\end{equation}
+soit une moyenne g\'eom\'etrique~:
+\begin{equation}
+f(\mu_I,\mu_J) =\displaystyle \frac{\mu_I \mu_J}{\alpha_{\,ij}
+\mu_I+(1-\alpha_{\,ij}) \mu_J}
+\end{equation}
+et la viscosit\'e $\mu_{\,b_{ik}}$ est \'egale \`a :
+\begin{equation}
+\mu_{\,b_{ik}}=\mu_I
+\end{equation}
+On introduit en outre, pour une utilisation ult\'erieure,
+les notations suivantes~:
+\begin{equation}
+\vect{D}^{NRec}_{\,ij}(\mu, \vect{u}) = \mu_{\,ij}
+\frac{\vect{u}_{\,J}-\vect{u}_{\,I}}{\overline{I'J'}} S_{\,ij}
+\end{equation}
+\begin{equation}
+\vect{D}^{NRec}_{\,b_{ik}}(\mu, \vect{u}) = \mu_{\,b_{ik}}
+\frac{\vect{u}_{\,b_{ik}}-\vect{u}_{\,I}}{\overline{I'F}} S_{\,b_{ik}}
+\end{equation}
+
+qui correspondent chacune \`a une valeur non reconstruite aux faces internes et de bord.
+
+\paragraph{\bf R\'esolution\\}
+Le syst\`eme (\ref{Base_Navsto_eq_prediction_continue}) pouvant comporter des non
+lin\'earit\'es dues au recours au test de pente ou pouvant conduire {\it via} la
+reconstruction du gradient (cellule) \`a une matrice quasiment pleine en
+pr\'esence de non orthogonalit\'es, on le r\'esout de mani\`ere it\'erative avec
+la suite $(\vect{\widetilde{u}}^{n+1,k})_{k\in \grandN}$ d\'efinie par :
+\begin{equation}
+\left\{\begin{array}{l}
+\vect{\widetilde{u}}^{n+1,0} = \vect{u}^{n}\\
+\vect{\widetilde{u}}^{n+1,k+1} = \vect{\widetilde{u}}^{n+1,k} + \delta\vect{\widetilde{u}}^{k+1}\\
+\mathcal{EM}(\delta\vect{\widetilde{u}}^{k+1},I) = -\mathcal{E}(\vect{\widetilde{u}}^{n+1,k},I) \\
+\end{array}\right.
+\end{equation}
+ce qui d\'efinit \'egalement la suite $(\delta\vect{\widetilde{u}}^{k+1})
+_{k\in \grandN}$.\\
+Les deux op\'erateurs $\mathcal{E}$ et $\mathcal{EM}$ ont pour expression respective~:
+\begin{equation}\notag
+\begin{array}{ll}\label{Base_Navsto_eq_pred_exacte}
+\mathcal{E}(\vect{\widetilde{u}},I) &= \theta\, \mathcal{J}(\vect{\widetilde{u}},I)\,+\,(1-\theta)\,\mathcal{J}(\vect{u}^{n},I)\,+ |{\Omega_I}|\displaystyle\frac{\rho_I}{\Delta t}\,(\vect{\widetilde{u}}_{I}-\vect{u}^n_{I}) \\
+& +\,|{\Omega_I}|\left[(\vect{TS})^{n+\theta_{S}}_I-(\grad{P})^{n-1+\theta}_I \, \right]\\
+%-\theta\,(\tens{K}^{n})_{I}\,-\theta\,(\dive(\rho \vect{u}))_{I}\right)\,(\vect{\widetilde{u}_{I}}-\vect{u}^n)_I \\
+&+\sum\limits_{j\in Vois(i)}{ \underbrace{\left((\,\mu\,\,^{t}\ggrad\vect{u})^{n+\theta_{S}}- \frac{2}{3}\,(\,\mu\, \dive\,\vect{u})^{n+\theta_{S}}\tens{Id}\right)_{ij}}_{\text{moyenne ou interpolation lin\'eaire entre
+I' et J'}}\text{.}\,\vect{S}_{\,ij}}\\
+&+\sum\limits_{k\in {\gamma_b(i)}}{ \underbrace{\left((\,\mu\,\,^{t}\ggrad\vect{u})^{n+\theta_{S}}- \frac{2}{3}\,(\,\mu\, \dive\,\vect{u})^{n+\theta_{S}}\tens{Id}\right)_{\,{b}_{ik}}}_\text{issu des conditions aux limites}\text{.}\,\vect{S}_{\,{b}_{ik}}}\\
+&\\
+\end{array}
+\end{equation}
+avec :
+\begin{equation}\notag
+\begin{array}{ll}
+\mathcal{J}(\vect{v},I) & = |{\Omega_I}|\,\,[\tens{K}^{n}-\dive(\rho \vect{u})\,]_{I}\,\,\vect{v}_{I} \\
+& + \left(\,\sum\limits_{j\in Vois(i)}{\vect{F}_{\,ij}((\rho\vect{u}),\vect{v})}
++\,\,\sum\limits_{k\in {\gamma_b(i)}} {\vect{F}_{\,{b}_{ik}}((\rho \vect{u}),\vect{v})}\right)\\
+&-\left(\,\sum\limits_{j\in Vois(i)}{\vect{D}_{\,ij}(\mu,\vect{v})}
++\,\,\sum\limits_{k\in {\gamma_b(i)}} {\vect{D}_{\,{b}_{ik}}(\mu,\vect{v})}\right)\\
+\end{array}
+\end{equation}
+
+\begin{equation}\notag
+\begin{array}{ll}
+\mathcal{EM}(\delta\vect{u},I) & =
+|{\Omega_I}| \left( \displaystyle\frac{\rho_I}{\Delta t} +\theta\,[\tens{K}^{n}-\dive(\rho \vect{u})\,]_{I}\,\right)\,\delta\vect{u}_{I}\\
+&+\theta\,\left(\,\sum\limits_{j\in Vois(i)}{\vect{F}^{\,amont}_{\,ij}((\rho\vect{u}),\delta\vect{u})}
++\,\,\sum\limits_{k\in {\gamma_b(i)}} {\vect{F}^{\,amont}_{\,{b}_{ik}}((\rho \vect{u}),\delta\vect{u})}\right)\\
+&-\theta\,\left(\,\sum\limits_{j\in Vois(i)}{\vect{D}^{NRec}_{\,ij}(\mu,\delta\vect{u})}
++\,\,\sum\limits_{k\in {\gamma_b(i)}} {\vect{D}^{NRec}_{\,{b}_{ik}}(\mu,\delta\vect{u})}\right)\\
+\end{array}
+\end{equation}
+
+
+De plus, on suppose que cette suite $(\vect{\widetilde{u}}^{n+1,k})_{k\in \grandN}$
+converge %(au sens de la norme L2 discr\`ete) vers la bonne solution
+vers $\vect{\widetilde{u}}^{n+1}$.\\
+
+\minititre{Remarque 4}
+Les conditions aux limites associ\'ees aux op\'erateurs $\mathcal{E}$ et
+$\mathcal{EM}$ du syst\`eme (\ref{Base_Navsto_eq_pred_exacte}) sont celles portant sur la
+vitesse $\vect{u}$. Elles sont de type Dirichlet homog\`ene ou de type Neumann
+homog\`ene sur $\delta\vect{u}$ si $\vect{u}$ a une condition de type Dirichlet
+ou de type Neumann respectivement. Elles sont mixtes dans le cas d'une condition
+de sym\'etrie sur une face en biais par rapport aux axes.
+
+\minititre{Remarque 5}
+Les deux premi\`eres sommes de type $(\sum\limits_{k\in {\gamma_b(i)}})$,
+{\it i.e.} comportant les termes en $\vect{F}_{\,{b}_{ik}}((\rho \vect{u}),\vect{u})$ et $\vect{D}_{\,{b}_{ik}}(\mu,\vect{u})$, utilisent les conditions aux limites de la vitesse.\\
+Le terme volumique :
+\begin{equation}\notag
+\sum\limits_{j\in Vois(i)}{ \underbrace{\left((\,\mu\,\,^{t}\ggrad\vect{u})^{n+\theta_{S}}- \frac{2}{3}\,(\,\mu\, \dive\,\vect{u})^{n+\theta_{S}}\tens{Id}\right)_{ij}}_{\text{moyenne ou interpolation lin\'eaire entre
+I' et J'}}\text{.}\,\vect{S}_{\,ij}}\\
+\end{equation}
+de terme de bord associ\'e :
+\begin{equation}\notag
+\sum\limits_{k\in {\gamma_b(i)}}{ \underbrace{\left((\,\mu\,\,^{t}\ggrad\vect{u})^{n+\theta_{S}}- \frac{2}{3}\,(\,\mu\, \dive\,\vect{u})^{n+\theta_{S}}\tens{Id}\right)_{\,{b}_{ik}}}_\text{issu des conditions aux limites}\text{.}\,\vect{S}_{\,{b}_{ik}}}
+\end{equation}
+a un traitement particulier. En effet, pour une cellule $\Omega_i$ jouxtant le
+bord, la contribution du premier terme (en gradient transpos\'e) est annul\'ee, aucune condition \`a la limite correcte ne lui \'etant attribu\'ee pour le moment.
+
+\minititre{Remarque 6}
+L'op\'erateur $\mathcal{EM}$ approche $\mathcal{E}$ (aucun terme n'est
+reconstruit et la partie convective est trait\'ee syst\'ematiquement en sch\'ema
+d\'ecentr\'e amont). Ceci peut g\'en\'erer des
+impr\'ecisions num\'eriques non n\'egligeables si la suite
+$(\vect{\widetilde{u}}^{n+1,k})_{k\in \grandN}$ n'a pas converg\'e.
+
+\subsubsection{\bf \'Etape de correction de la pression}
+En prenant la divergence de la premi\`ere \'equation du syst\`eme
+(\ref{Base_Navsto_eq_correction_continue}), on obtient~:
+\begin{equation}
+\dive\left[(\rho\vect{u})^{n+1}-(\rho\vect{\widetilde{u}})^{n+1}\right]
+=\dive(-\Delta t\, \grad \delta P^{n+\theta}) \\
+\end{equation}
+
+En utilisant la contrainte stationnaire $\dive(\rho\vect{u})^{n+1}=\Gamma$,
+on a donc~:
+
+\begin{equation}
+\dive(\Delta t\, \grad\ \delta P^{n+\theta})=\dive((\rho \vect{\widetilde{u}})^{n+1})-\Gamma
+\end{equation}
+
+soit :
+\begin{equation}
+\left\{\begin{array}{l}
+\dive(\Delta t\, \grad\ \delta P^{n+\theta})=\dive((\rho \vect{\widetilde{u}})^{n+1})-\Gamma\\
+(\rho\vect{u})^{n+1} = (\rho\vect{\widetilde{u}})^{n+1}-\Delta t\, \grad \delta P^{n+\theta}
+\end{array}\right.
+\end{equation}
+et :
+\begin{equation}
+\label{Base_Navsto_corrvit}
+\vect{u}^{n+1} = \vect{\widetilde{u}}^{n+1}-\frac{\Delta t}{\rho}\, \grad\delta
+P^{n+\theta}
+\end{equation}
+
+En int\'egrant sur une cellule :
+\begin{equation}
+\int_{\Omega_i}{\dive(\Delta t \grad\ \delta P^{n+\theta})\, d\Omega} =
+\sum\limits_{j\in Vois(i)}{\vect{D}_{\,ij}(\Delta t, \delta P^{n+\theta})}
++\sum_{k\in {\gamma_b(i)}} {\vect{D}_{\,{b}_{ik}}(\Delta t, \delta P^{n+\theta})}
+\label{Base_Navsto_eq_correction_discrete}
+\end{equation}
+et :
+\begin{equation}
+\int_{\Omega_i}{\dive(\rho \vect{\widetilde{u}})^{n+1} d\Omega} =
+\sum_{j\in Vois{(i)}}{\left[ (\rho
+\vect{\widetilde{u}})^{n+1}_{ij}\text{.}\,\vect{S}_{ij}\right]}
++\sum_{k\in {\gamma_b(i)}} \left[{(\rho \vect{\widetilde{u}})^{n+1}_{\,{b}_{ik}}} \text{.}\, \vect{S}_{\,{b}_{ik}}\right]
+\end{equation}
+On utilise le m\^eme formalisme que pr\'ec\'edemment pour l'int\'egration du
+terme de diffusion de l'\'etape de pr\'ediction. Les conditions aux limites sont
+de type Dirichlet homog\`ene ou de type Neumann homog\`ene sur $\delta P$ si $P$ a une condition de
+type Dirichlet ou de type Neumann respectivement.
+
+\paragraph{\bf Calcul du second membre de l'\'equation portant sur l'incr\'ement
+de pression.\\\\ }
+
+La discr\'etisation de $\sum\limits_{j\in Vois{(i)}}{\left[ (\rho
+\vect{\widetilde{u}})^{n+1}_{ij}\text{.}\,\vect{S}_{\,ij}\right]} + \sum\limits_{k\in {\gamma_b(i)}} \left[{(\rho \vect{\widetilde{u}})^{n+1}_{\,{b}_{ik}}} \text{.}\, \vect{S}_{\,{b}_{ik}}\right]$ est particuli\`ere. Le
+choix suivant not\'e $\left[{\ \ }\right]^{Init}$, pour une cellule ne touchant pas
+le bord par exemple, est insatisfaisant avec la discr\'etisation et le sch\'ema utilis\'es ici, en particulier avec l'\'equation
+(\ref{Base_Navsto_corrvit}) :\\
+\begin{equation}
+(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}.\,\vect{S}_{\,ij}=
+\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}.\,\vect{S}_{\,ij}\right]^{Init}=
+\left[\alpha_{ij} (\rho\vect{\widetilde{u}})^{n+1}_{\,I'} +
+(1-\alpha_{ij}) (\rho\vect{\widetilde{u}})^{n+1}_{\,J'}\right].\,\vect{S}_{\,ij}
+\end{equation}
+
+Tout comme pour le calcul du flux num\'erique en centr\'e, on
+utilise de fa\c con licite l'approximation suivante :
+\begin{equation}
+\begin{array}{ll}
+(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}&=
+\alpha_{ij} \rho_{I} \vect{\widetilde{u}}^{n+1}_{\,I} +
+(1-\alpha_{ij}) \rho_{J} \vect{\widetilde{u}}^{n+1}_{\,J}\\
+&+\displaystyle \frac{1}{2}\left[(\ggrad{(\rho\vect{\widetilde{u}})^{n+1}})_I
++ (\ggrad{(\rho\vect{\widetilde{u}})^{n+1}})_J\right]\text{.}\, \vect{OF}
+\end{array}
+\end{equation}
+mais ce n'est pas elle qui pose probl\`eme.\\\\
+En fait, $ \left[(\rho\vect{\widetilde{u}})^{n+1}_{\,ij}\right]^{Init}$ contient le terme
+$\vect{G}^{\,n}_{\,cel,ij}$, h\'erit\'e de l'\'etape de pr\'ediction, qui vaut :\\
+\begin{equation}\notag
+\vect{G}^{\,n-1+\theta}_{\,cel,ij}=\alpha_{\,ij}\, \grad{P}^{\,n-1+\theta}_{I'} +
+(1-\alpha_{\,ij})\, \grad{P}^{\,n-1+\theta}_{J'}
+\end{equation}
+
+Or, sur un maillage orthogonal r\'egulier cart\'esien, \`a partir d'une
+vitesse $\vect{\widetilde{u}}^{n+1}=\vect{0}$
+et d'une pression $P^{\,n-1+\theta}_I=(-1)^{I}$, on
+obtient $\vect{G}^{\,n-1+\theta}_{\,cel,ij}=0$ d'o\`u $\delta P^{n+\theta}=0$~:
+l'irr\'egularit\'e initiale de pression ne peut donc jamais \^etre
+corrig\'ee.
+
+Pour rem\'edier \`a cela, on modifie l'\'ecriture $\left[{\ \ }\right]^{Init}$
+de $(\rho
+\vect{\widetilde{u}})^{n+1}_{\,ij}$ et de $(\rho \vect{\widetilde{u}})^{n+1}_{\,{b}_{ik}}$ en
+adoptant la valeur $\left[{\ \ }\right]^{Corr}$ :
+\begin{equation}
+\begin{array}{ll}
+(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}.\ \vect{S}_{\,ij}&=
+\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}\right]^{Corr}.\ \vect{S}_{\,ij}\\
+&= \left(\left[(\rho \vect{\widetilde{u}})^{n+1}-\beta(-\Delta t \grad P^{n-1+\theta})\right]^{Init}_{\,ij}
++\beta\ (-\vect{D}_{\,ij}(\Delta t, P^{n-1+\theta}))\right).\ \vect{S}_{\,ij}
+\end{array}
+\end{equation}
+et,
+pour les conditions aux limites d'entr\'ee, de sym\'etrie (quelconque) ou de
+paroi :
+\begin{equation}\notag
+(\rho \vect{\widetilde{u}})^{n+1}_{\,{b}_{ik}}.\ \vect{S}_{\,b_{ik}}=\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,{b}_{ik}}\right]^{Corr}.\ \vect{S}_{\,b_{ik}}=
+\rho _{\,{b}_{ik}}\vect{u}^{n+1}_{\,{b}_{ik}}.\ \vect{S}_{\,b_{ik}}
+\end{equation}
+
+pour les conditions aux limites de sortie :
+\begin{equation}\notag
+\begin{array}{ll}
+(\rho \vect{\widetilde{u}})^{n+1}_{\,{b}_{ik}}.\ \vect{S}_{\,b_{ik}}& =
+\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,{b}_{ik}}\right]^{Corr}.\vect{S}_{\,b_{ik}}
+\\&= \left( \left[\rho _{\,{b}_{ik}}\vect{u}^{n+1}_{\,{b}_{ik}}-\beta(-\Delta t
+\grad P^{n-1+\theta})_{I'}\right]+\beta\ (-\vect{D}_{\,{b}_{ik}}(\Delta t,
+P^{n-1+\theta}))\right).\ \vect{S}_{\,b_{ik}}
+\end{array}
+\end{equation}
+
+$\beta$ est appel\'e coefficient d'Arakawa. Lorsqu'il vaut 1 (valeur par
+d\'efaut), il s'agit du filtre Rhie~\&~Chow.
+
+
+\minititre{Remarque 7}
+On peut g\'en\'eraliser cette d\'emarche \`a d'autres
+termes sources du m\^eme type, par exemple pour le mod\`ele
+$R_{ij}-\varepsilon$.
+%{\it i.e.} comportant la quantit\'e
+%$\vect{G}^{\,n}_{\,cel,ij}$.\\
+
+\paragraph{\bf R\'esolution\\}
+On construit une suite $(\delta P^{n+1,k})_{k\in \grandN}$ pour r\'esoudre
+l'\'equation (\ref{Base_Navsto_eq_correction_discrete}), qui peut conduire {\it via} la
+reconstruction du gradient cellule \`a une matrice quasiment pleine en
+pr\'esence de non orthogonalit\'es, d\'efinie par :
+\begin{equation}
+\left\{\begin{array}{l}
+\delta P^{n+\theta,0} = 0\\
+\delta P^{n+\theta,k+1} = \delta P^{n+\theta,k} + C_{relax} \delta (\delta P)^{n+\theta,k+1}\\
+\mathcal{FM}(\delta(\delta P)^{n+\theta,k+1},I) = \mathcal{F}(\delta P^{n+\theta,k},I) \\\end{array}\right.
+\end{equation}\\
+ce qui d\'efinit \'egalement la suite $({\delta(\delta P)^{n+\theta,k+1}})_{k\in
+\grandN}$.\\
+Les op\'erateurs $\mathcal{F}$ et $\mathcal{FM}$ ont pour expression :
+\begin{equation}
+\begin{array}{ll}
+\mathcal{F}(\delta P,I) &=
+ \sum\limits_{j\in Vois(i)}{\left[\vect{D}_{\,ij}(\Delta t,\delta
+P)-\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}\right]^{Corr}\right]}\\
+&+\sum\limits_{k\in {\gamma_b(i)}} {\left[\vect{D}_{\,{b}_{ik}}(\Delta
+t^n,\delta P)-\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,b_{ik}}\right]^{Corr}\right]\,+\,\Gamma} \end{array}
+\end{equation}
+
+et :
+\begin{equation}
+\begin{array}{ll}
+\mathcal{FM}(\delta (\delta P),I) =
+ \sum\limits_{j\in Vois(i)}{\left[-\vect{D}^{NRec}_{\,ij}(\Delta t,\delta
+(\delta P))\right]} +\sum\limits_{k\in {\gamma_b(i)}}
+\left[-\vect{D}^{NRec}_{\,{b}_{ik}}(\Delta t,\delta(\delta P))\right]
+\end{array}
+\end{equation}
+
+respectivement.\\
+$C_{relax}$ est un coefficient de relaxation donn\'e et fix\'e \`a 1 en standard.
+On suppose que la suite $(\delta P^{n+\theta,k})_{k\in \grandN}$
+converge
+%(au sens de la norme L2 discr\`ete) vers la bonne solution
+vers $\delta P^{n+\theta}$.
+
+Au fur et � mesure des it�rations, le flux de masse est mis � jour, en utilisant $\delta(\delta P)$. \`A convergence, le flux de masse actualis� obtenu est :
+\begin{equation}
+(\rho \vect{u})^{n+1}_{\,ij}\text{.}\vect{S}_{\,ij} =
+\left[(\rho
+\vect{\widetilde{u}})^{n+1}_{\,ij}\right]^{Corr}\text{.}\,\vect{S}_{\,ij}-\vect{D}_{\,ij}(\Delta
+t^n,\delta P^{n+\theta})
+\end{equation}
+et on calcule le nouveau champ de vitesse au centre des cellules gr\^ace \`a l'\'egalit\'e :
+%
+% et en fait c'est chiant parcque on ne peut pas ecrire ca justement
+% a cause de Arak !
+%\begin{equation}
+%\vect{u}^{n+1} =
+%\frac{\rho^{n+1/2}}{\rho^{n+1}}\vect{u}^{n+1/2}
+%-\frac{\Delta t}{\rho^{n+1}}\grad \,\delta P^{n+1}
+%\end{equation}
+\begin{equation}
+\vect{u}^{n+1} =
+\vect{\widetilde{u}}^{n+1}-\frac{\Delta t}{\rho}\grad \,\delta P^{n+\theta}
+\end{equation}
+\minititre{Remarque 8}
+Un traitement sp\'ecifique permet d'assurer que la conservation de la masse portant sur le bilan des flux
+de masse aux faces est toujours parfaitement v\'erifi\'ee \`a l'issue de
+l'\'etape de correction, que la suite $(\delta P^{n+\theta,k+1})_{k\in \grandN}$ ait
+ou non atteint la convergence.
+En effet, $\delta P^{n+\theta,k_{fin}+1}$,
+dernier terme \'evalu\'e de la suite, est donn\'e par :
+
+\begin{equation}\notag
+\mathcal{FM}(\delta(\delta P)^{n+\theta,k_{fin}+1},I) = \mathcal{F}(\delta P^{n+\theta,k_{fin}},I)
+\end{equation}
+Au lieu de r\'eactualiser classiquement le flux de masse, on le calcule comme
+suit :
+\begin{equation}\notag
+(\rho \vect{u})^{n+1}_{\,ij}\text{.}\ \vect{S}_{\,ij} =
+\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}\right]^{Corr}\text{.}\,\vect{S}_{\,ij}
+-\vect{D}_{\,ij}(\Delta t,\delta P^{n+\theta,k_{fin}})
+-\vect{D}^{NRec}_{\,ij}(\Delta t,\delta (\delta P)^{n+\theta,k_{fin}+1})
+\end{equation}
+et :
+\begin{equation}\notag
+(\rho \vect{u})^{n+1}_{\,b_{ik}}\text{.}\ \vect{S}_{\,b_{ik}} =
+\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,b_{ik}}\right]^{Corr}\text{.}\,\vect{S}_{\,b_{ik}}
+-\vect{D}_{\,b_{ik}}(\Delta t,\delta P^{n+\theta,k_{fin}})
+-\vect{D}^{NRec}_{\,b_{ik}}(\Delta t,\delta (\delta P)^{n+\theta,k_{fin}+1})
+\end{equation}
+
+ce qui conduit bien \`a~:
+\begin{equation}\notag
+\begin{array}{ll}
+\multicolumn{2}{l}{\sum\limits_{j\in Vois(i)}(\rho
+\vect{u})^{n+1}_{\,ij}\text{.}\ \vect{S}_{\,ij}
++\sum\limits_{k\in {\gamma_b(i)}}(\rho\vect{u})^{n+1}_{\,b_{ik}}.\
+\vect{S}_{\,b_{ik}}}\\
+\hspace*{2cm}=&
+\sum\limits_{j\in Vois(i)}{\left[(\rho \vect{\widetilde{u}})^{n+1}_{\,ij}\right]^{Corr}.\,
+\vect{S}_{\,ij}}
++ \sum\limits_{k\in {\gamma_b(i)}}\left[(\rho\vect{\widetilde{u}})^{n+1}_{\,b_{ik}}\right]^{Corr}\text{.}\,\vect{S}_{\,b_{ik}} \\
+\hspace*{2cm}-&\sum\limits_{j\in Vois(i)}
+\vect{D}_{\,ij}(\Delta t,\delta P^{n+\theta,k_{fin}})
+-\sum\limits_{k\in {\gamma_b(i)}}\vect{D}_{\,b_{ik}}(\Delta t,\delta
+P^{n+\theta,k_{fin}})\\
+\hspace*{2cm}-&{\sum\limits_{j\in Vois(i)}\vect{D}^{NRec}_{\,ij}(\Delta t,\delta (\delta
+P)^{n+\theta,k_{fin}+1})}
+-\sum\limits_{k\in {\gamma_b(i)}}\vect{D}^{NRec}_{\,b_{ik}}(\Delta t,\delta
+(\delta P)^{n+\theta,k_{fin}+1})
+\end{array}
+\end{equation}
+
+
+soit :
+\begin{equation}\notag
+\sum\limits_{j\in Vois(i)}(\rho \vect{u})^{n+1}_{\,ij}\text{.}\vect{S}_{\,ij}
++\sum\limits_{k\in {\gamma_b(i)}}(\rho\vect{u})^{n+1}_{\,b_{ik}}.\
+\vect{S}_{\,b_{ik}}= -\mathcal{F}(\delta
+P^{n+\theta,k_{fin}},I)+\mathcal{FM}(\delta(\delta P)^{n+\theta,k_{fin}+1},I) + \Gamma
+\end{equation}
+
+et donc :
+\begin{equation}\notag
+\int_{\Omega_i}{\dive(\rho \vect{u})^{n+1} d\Omega} = \Gamma
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+On se reportera aux sections relatives aux sous-programmes
+\fort{Preduv} (pr\'ediction des vitesses) et \fort{Resolp}
+(correction de pression). Pour la reconstruction des vitesses
+par moindres carr\'es \`a partir des flux de masse aux faces, on
+pourra voir \fort{Recvmc}.
diff --git a/doc/theory/preduv.tex b/doc/theory/preduv.tex
new file mode 100644
index 0000000..fcc0213
--- /dev/null
+++ b/doc/theory/preduv.tex
@@ -0,0 +1,815 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{preduv}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Dans ce sous-programme, on effectue l'\'etape de pr\'ediction de la vitesse
+$\vect{u}$. Ceci consiste � r\'esoudre l'�quation de quantit\'e de
+mouvement (Q.D.M.) en traitant la pression $p$ de mani�re explicite. La solution en vitesse-pression est obtenue apr�s une �tape de correction sur la pression
+effectu�e dans le sous-programme \fort{resolp}, en utilisant la loi de conservation de la masse :
+\begin{equation}
+\frac{\partial \rho } {\partial t}+ \dive(\rho \underline{u}) = \Gamma,
+\end{equation}
+o\`u $\Gamma$ est le terme source de masse\footnote{ en $kg.m^{-3}.s^{-1}$ }.\\
+L'�quation de conservation de la quantit� de mouvement moyenne obtenue par application
+du th�or�me fondamental de la dynamique est :
+\begin{equation}
+\frac {\partial (\rho \underline {u})} {\partial t }+
+\dive(\rho \underline{u} \otimes \underline{u}) =
+\dive(\underline{\underline{\sigma}}) + \underline{S} - \dive{(\rho\,\tens{R})}\end{equation}
+o� :
+\begin{equation}
+\underline{\underline{\sigma}} = - p \underline{\underline{Id}} + \underline{\underline{\tau }}
+\end{equation}
+avec pour les �coulements newtoniens, la relation lin�aire suivante :
+\begin{equation}
+\begin{array}{lcl}
+&\displaystyle \underline{\underline{\tau}} = 2\ \mu\ \underline{\underline{D}}
++\,
+ \lambda\ tr(\underline{\underline{D }})\ \underline{\underline{Id}} &\\
+&\displaystyle \underline{\underline{D}}=\frac{1}{2}\ (\ggrad \underline
+{u} +\ ^t\ggrad \underline {u})
+\end{array}
+\end{equation}
+
+
+$\tens{\sigma}$ repr\'esente le tenseur de contraintes, $\tens{\tau}$ le tenseur
+des contraintes visqueuses, $\mu$ la viscosit\'e dynamique (mol\'eculaire et
+\'eventuellement turbulente), $\tens{D}$
+ le tenseur taux de d\'eformation\footnote{\`A ne pas confondre, malgr\'e la m\^eme notation $D$, avec les flux
+diffusifs d\'ecrits dans le sous-programme \fort{navsto}},
+$\tens{R}$ le tenseur de Reynolds qui appara\^\i t lors de l'application de
+l'op\'erateur moyenne \`a l'\'equation instantan\'ee, $\underline{S}$ les termes
+sources.\\
+$\lambda$ est le second coefficient de viscosit�. Il est reli� � la viscosit� de
+volume $\kappa$ par la relation
+\begin{equation}
+\lambda=\kappa-\frac{2}{3}\mu
+\end{equation}
+Quand l'hypoth�se de Stokes est v�rifi�e, la viscosit� de volume $\kappa$ est
+nulle, soit $3\lambda+2\mu=0$. Cette hypoth�se est implicite dans le code et
+dans le reste du doument, sauf en compressible.\\
+
+
+L'\'equation de conservation de la quantit� de mouvement s'\'ecrit finalement
+ :
+\begin{equation}
+\begin{array}{lcl}
+&\displaystyle \rho\,
+\frac{\partial \underline {u} } {\partial t} = -\
+\underbrace {\dive(\rho \underline{u} \otimes \underline{u})}_{\text{
+convection}} +\ \underbrace {\dive (\mu\ \ggrad \underline {u})}_{\text{
+diffusion}} &\\
+&\displaystyle \underbrace { +\ \dive (\mu \,^t\ggrad \underline {u}) }_{\text{
+terme en gradient transpos\'e}}
+\underbrace { - \ \frac {2} {3}\ \grad (\mu\ \dive \underline {u})}_{\text{
+viscosit� secondaire}}\ \ - \dive{(\rho \tens{R})}
+ -\ \grad(p) + (\rho -\rho_0)\,\underline {g} +
+\underline{u}\,\dive (\rho\,\underline {u})&\\
+&\displaystyle +\underbrace {\Gamma
+(\underline{u}_{\,i}-\underline{u})}_{\text{terme source de Q.D.M. d� � la source
+de masse}}- \underbrace {\rho\
+\tens{K}_{\,pdc} \underline {u}}_{\text{perte
+de charge}} + \underbrace { \underline{T}_{\,s}^{\,exp}+
+T_{s}^{\,imp}\ \underline{u}}_{\text{autres termes sources de
+Q.D.M.}}
+\label{Base_Preduv_eqqdm}
+
+\end{array}
+\end{equation}
+avec $p$ d�finissant l'�cart � la pression hydrostatique de r\'ef\'erence (la
+pression hydrostatique r\'eelle \'etant calcul\'ee avec la masse volumique $\rho$
+et non $\rho_{\,0}$) :
+\begin{equation}
+p=p^*-\rho_{\,0}\ \underline{g}\,.\,\underline{X}
+\end{equation}
+(\underline{X} \'etant le vecteur de composantes $x$, $y$ et $z$).\\
+$\mu_t$, $\tens{K}_{\,pdc}$, $\underline{u}_{\,i}$ repr\'esentent respectivement
+la viscosit� dynamique turbulente, le tenseur des pertes de charge et la valeur de la variable associ�e � la source de
+masse.\\
+La divergence du tenseur des contraintes de Reynolds s'\'ecrit :
+\begin{equation}
+-\dive{(\rho\,\tens{R})}=
+\begin{cases}
+\vect{0} & \text{en laminaire}, \\
+ -\displaystyle\frac {2} {3}\, \grad (\mu_t\ \dive \underline {u})+\dive (\mu_t\ (\ggrad \underline {u}+ \,^t\ggrad \underline {u}))-\frac {2}{3}\,\grad (\rho\, k) & \text{pour les mod�les}\\
+ & \text{� viscosit� turbulente}, \\
+ -\dive(\rho\,\tens{R})& \text{pour les mod�les}\\
+ & \text{au second ordre},\\
+-\displaystyle\frac {2} {3}\, \grad (\mu_t\ \dive \underline {u})+\dive (\mu_t\ (\ggrad \underline {u}+ \,^t\ggrad \underline {u})) & \text{en LES}\\
+\end{cases}
+\end{equation}
+Le terme source de masse fait intervenir la vitesse locale $\underline {u}$ et
+aussi une vitesse $\underline {u}_{\,i}$ associ\'ee \`a la masse inject\'ee (ou retir\'ee).
+Lorsque $\Gamma<0$, on \^ote de la masse au syst\`eme et on a donc
+$\underline{u}_{\,i} = \underline{u}$. Le terme est nul (\emph{i.e.} $\Gamma
+(\underline{u}_{\,i}-\underline{u})= \underline{0} $). Quand $\Gamma>0$, on a un
+terme non nul si $\underline{u}_{\,i} \ne \underline{u}$.
+Dans ce sous-programme, tous les termes intervenant dans
+l'�quation de conservation de la
+quantit� de mouvement, except� les termes de convection et diffusion, sont
+calcul�s et transmis au sous-programme \fort{codits} qui r�sout l'�quation compl�te
+(convection-diffusion avec termes sources).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Le terme convectif en $\dive(\underline{u} \otimes \rho\,\underline{u})$
+introduit une non lin\'earit\'e et un couplage des composantes de la vitesse
+$\vect{u}$ dans l'�quation (\ref{Base_Preduv_eqqdm}). Une lin\'earisation et un d\'ecouplage
+des trois composantes de la
+vitesse sont r\'ealis\'es lors de la discr\'etisation de cette \'etape de
+pr\'ediction.\\
+En effet, soit :
+\begin{equation}
+\vect{\widetilde{u}}= \vect{u}^n + \delta \vect{u}
+\end{equation}
+La contribution exacte du terme convectif \`a prendre en compte dans cette
+\'etape de pr\'ediction serait :\\
+\begin{equation}\label{Base_Preduv_Conv_exact}
+\begin{array}{ll}
+\dive(\vect{\widetilde{u}} \otimes \rho\,\vect{\widetilde{u}}) =
+\dive(\vect{u}^{n} \otimes \rho\,\vect{u}^{n}) + \dive(\delta \vect{u} \otimes
+\rho\,\vect{u}^{n}) + \underbrace { \dive(\vect{u}^{n} \otimes
+\rho\,\delta \vect{u})}_{\text {terme couplant lin\'eaire}} + \underbrace { \dive(\delta \vect{u} \otimes
+\rho\,\delta \vect{u})}_{\text {terme couplant et non lin\'eaire}}\\
+\end{array}
+\end{equation}
+Les deux derniers termes de l'expression (\ref{Base_Preduv_Conv_exact}) sont {\em a priori} n�glig�s
+de mani�re � obtenir un syst\`eme en vitesse qui soit d\'ecoupl\'e et donc,
+�viter l'inversion d'une matrice pouvant \^etre de tr\`es grande taille. Ces
+deux termes peuvent n�anmoins �tre pris en compte de mani�re plus ou moins
+approch�e par extrapolation explicite du flux de masse en $n+\theta_F$ (pour le
+terme couplant lin�aire provenant de la convection de $\vect{u}^{n}$ par $\delta
+\vect{u}$) et utilisation d'un point-fixe par sous it�ration sur le sous
+programme \fort{navsto} (pour le terme non-lin�aire, en sp�cifiant $\var{NTERUP}>1$).
+
+L'�quation (\ref{Base_Preduv_eqqdm}) est discr�tis�e au temps $n+\theta$ � l'aide d'un
+$\theta$-sch�ma, et le tenseur des pertes de charges d�compos� en une partie
+diagonale $\tens{K}_{d}$ et une extradiagonale $\tens{K}_{e}$ (soit
+ $\tens{K}_{pdc}=\tens{K}_{d}+\tens{K}_{e}$).\\
+$\bullet$ La pression est suppos�e connue en $n-1+\theta$ (d�calage temporel
+pression-vitesse) et le gradient naturellement calcul� � cet instant.\\
+$\bullet$ Les termes sources de viscosit� secondaire, de gradient transpos\'e,
+ceux provenant du mod�le de turbulence\footnote{except� $\dive (\mu_t\ (\ggrad
+\underline {u}))$}, $\rho\,\tens{K}_{\,e}\ \underline{u}$, $(\rho -\rho_0)
+\underline {g}$ ainsi que $\underline{T}_{s}^{\,exp}$ et
+$\Gamma\,\underline{u}_{\,i}$ sont pris de mani�re explicite au temps $n$, ou
+extrapol�s suivant le sch�ma en temps choisi pour les propri�t�s physique et les
+termes sources.\\
+$\bullet$ Les termes sources $\underline{u}\,\,\dive (\rho\,\underline {u})$,
+$\Gamma\,\,\underline{u}$, $T_{s}^{\,imp}\,\,\underline{u}$ et
+$-\rho\,\tens{K}_{\,d}\,\,\underline{u}$ sont implicit�s est calcul�s �
+l'instant $n+\theta$.\\
+$\bullet$ Le terme de diffusion $\dive (\mu_{\,tot}\,\ggrad \underline{u})$ est
+implicit� : la vitesse est prise � l'instant $n+\theta$ et la viscosit�
+explicit�e ou extrapol�e.\\
+$\bullet$ Enfin, le terme de convection en $\dive(\,\underline{u} \otimes
+(\rho\underline{u})\,)$ est implicit� : la composante r�solue de la vitesse est
+prise en $n+\theta$, et le flux de masse, explicit�, ou extrapol� en
+$n+\theta_F$.
+
+Par souci de clart�, on suppose, en l'absence d'indication, que les propri�tes
+physiques $\Phi$ ($\rho,\,\mu_{tot},\,...$) et le flux de masse
+$(\rho\underline{u})$ sont pris respectivement aux instants $n+\theta_\Phi$ et
+$n+\theta_F$, o� $\theta_\Phi$ et $\theta_F$ d�pendent des sch�mas en temps
+sp�cifiquement utilis�s pour ces grandeurs\footnote{cf. \fort{introd}}.
+
+La discr�tisation temporelle de l'�quation (\ref{Base_Preduv_eqqdm}) s'�crit alors comme suit :
+
+\begin{equation}\label{Base_Preduv_eq_di1}
+ \begin{array}{c}
+\displaystyle \rho\,\ \frac{ \underline {\widetilde{u}}^{n+1} -\underline {u}^{n} }
+{\Delta t} + \dive(\,\underline{\widetilde{u}}^{n+\theta} \otimes (\rho\underline{u})\,) -\dive
+(\mu_{\,tot}\,\ggrad \underline{\widetilde{u}}^{n+\theta}) =
+\\
+\displaystyle
+ - \grad p^{n-1+\theta} + \dive (\rho\,\underline {u})\,\underline{\widetilde{u}}^{n+\theta} +(\Gamma\,\underline{u}_{\,i})^{n+\theta_S}-\Gamma^n\,\,\underline{\widetilde{u}}^{n+\theta}
+\\
+\begin{array}{c}
+\displaystyle
+- \rho\,\tens{K}_{\,d}^{n}\,\,\underline{\widetilde{u}}^{n+\theta} - (\rho\,\tens{K}_{\,e}\ \underline{u})^{n+\theta_S} + (\underline{T}_{s}^{\,exp})^{\,n+\theta_S} + T_{s}^{\,imp}\,\,\underline{\widetilde{u}}^{n+\theta}
+\\
+\displaystyle
++[\dive (\mu_{\,tot}\,^t\ggrad \underline {u})]^{n+\theta_S}-\frac {2} {3}[\,\grad (\mu_{\,tot}\,\dive \underline {u})]^{n+\theta_S} + (\rho -\rho_0) \underline {g}
+ - (\underline{turb})^{n+\theta_S}
+\end{array}
+\end{array}
+\end{equation}
+o\`u, par souci de simplification, on a pos\'e :
+\begin{equation}
+\mu_{\,tot}=
+\begin{cases}
+\mu+\mu_t & \text{pour les mod�les � viscosit� turbulente ou en LES}, \\
+\mu & \text{pour les mod�les au second ordre ou en laminaire}
+\end{cases} \
+\end{equation}
+\\
+et :
+\begin{equation}
+\underline{turb}^{n}=
+\begin{cases}
+\displaystyle\frac {2}{3}\grad (\rho^{n}\,k^{n}) & \text{pour les mod�les � viscosit� turbulente}, \\
+\dive(\rho^{n}\,\tens{R}^n) & \text{pour les mod�les au second ordre},\\
+0 & \text{en laminaire ou en LES}\\
+\end{cases}
+\end{equation}
+Par analogie avec l'�criture du $\theta$-sch�ma pour une variable scalaire, $\,
+\underline {\widetilde{u}}^{n+\theta}$ est interpol�e � partir de la vitesse
+pr�dite $\underline {\widetilde{u}}^{n+1}$ de la mani\`ere suivante\footnote{si
+$\theta=1/2$, ou qu'une extrapolation est utilis�e, l'ordre 2 n'est obtenu que si
+le pas de temps $\Delta t$ est uniforme en temps et en espace.}~:
+\begin{equation}
+\underline {\widetilde{u}}^{n+\theta}=\theta\, \underline
+{\widetilde{u}}^{n+1}+(1-\theta)\, \underline {u}^{n}\\
+\end{equation}
+Avec :
+\begin{equation}
+\left\{
+\begin{array}{ll}
+\theta = 1 & \text{Pour un sch\'ema de type Euler implicite d'ordre 1.}\\
+\theta = 1/2 & \text{Pour un sch\'ema de type Cranck-Nicolson d'ordre 2.}\\
+\end{array}
+\right.
+\end{equation}
+
+L'�quation (\ref{Base_Preduv_eq_di1}) est alors r��crite sous la forme :
+
+\begin{equation}\label{Base_Preduv_eq_di2}
+\begin{array}{c}
+\displaystyle \underbrace{\left(\frac{\rho}{\Delta t} -\theta \,\dive (\rho\,\underline {u}) +\theta \,\, \Gamma^n +
+\theta \,\, \rho\,\tens{K}_{\,d}^n-\theta \,T_s^{\,imp} \right)}_{\displaystyle f_s^{imp}}\, (\underline {\,\widetilde{u}}^{n+1} -\underline {u}^{n})
+\\
+ +\, \theta\, \dive(\underline {\widetilde{u}}^{n+1} \otimes (\rho\underline{u}))-\, \theta\,\dive (\mu_{\,tot}\,\ggrad \underline {\widetilde{u}}^{n+1}) =
+\\
+-\,(1-\theta)\, \dive(\underline {u}^{n} \otimes (\rho\underline{u})) +\,(1-\theta)\,\dive (\mu_{\,tot}\,\ggrad \underline {u}^{n})
+\\
+f_s^{exp}\left\{
+\begin{array}{c}
+\displaystyle
+- \grad p^{n-1+\theta} + \dive (\rho\,\underline {u})\,\underline{u}^{n} +\,(\,\Gamma^{n}\,\underline{u}_{\,i}\,)^{n+\theta_S}- \Gamma^n\,\,\underline{u}^{n}
+\\
+\displaystyle
+-(\,\rho\,\tens{K}_{\,e}\ \underline{u}\,)^{n+\theta_S} -\rho\,\tens{K}_{\,d}^n\ \underline{u}^{n}+ (\underline{T}_{s}^{\,exp})^{\,n+\theta_S} + T_s^{\,imp}\,\,\underline {u}^{n}
+\\
+\displaystyle
++[\dive (\mu_{\,tot}\,^t\ggrad \underline {u}\,)]^{n+\theta_S}-\frac {2} {3}[\,\grad (\mu_{\,tot}\,\dive \underline {u}\,)]^{n+\theta_S} + (\rho -\rho_0) \underline {g}-(\underline{turb})^{n+\theta_S}
+\end{array}
+\right.
+\end{array}
+\end{equation}
+
+d'o� l'�quation r�solue par le sous-programme \fort{codits} :
+\begin{equation}\begin{array}{c}
+\displaystyle
+f_s^{\,imp}(\underline {\widetilde{u}}^{n+1}-\underline {u}^{n}) + \theta\, \dive(\underline{\widetilde{u}}^{n+1} \otimes (\rho
+\underline{u})) - \theta\,\dive (\,\mu_{\,tot}\,\ggrad \underline{\widetilde{u}}^{n+1}) =
+\\\\
+\displaystyle
+-(1-\theta)\,\dive(\underline{u}^{n} \otimes (\rho \underline{u}))+(1-\theta)\,\dive (\,\mu_{\,tot}\,\ggrad \underline{u}^{n})
++ \underline{f}_{\,s}^{\,exp}
+\end{array}
+\end{equation}
+La m\'ethode de discr\'etisation spatiale est d\'evelopp\'ee dans le sous-programme \fort{codits}.\\
+
+
+
+\minititre{Remarques :}
+{\tiny$\blacksquare$} Dans le cas standard sans extrapolation, le terme
+$-\,T_s^{\,imp}$ n'est ajout� � $f_s^{\,imp}$ que s'il est positif afin de ne
+pas affaiblir la dominance de la diagonale de la matrice � inverser.\\
+{\tiny$\blacksquare$} Si une extrapolation est utilis�e, par contre,
+$\,T_s^{\,imp}$ est ajout� � $f_s^{\,imp}$ quel que soit son signe. En effet, l'id�e intuitive qui
+consiste � prendre~:
+\begin{equation}
+\begin{cases}
+\displaystyle
+(\underline{T}_{s}^{\,exp} + T_{s}^{\,imp}\,\underline {u})^{\,n+\theta_S} &
+\text{si } T_{s}^{\,imp} > 0\\
+\displaystyle
+(\underline{T}_{s}^{\,exp})^{\,n+\theta_S} + T_{s}^{\,imp}\,\underline{u}^{n+\theta} &\text{sinon}\\
+\end{cases}
+\end{equation}
+aboutit � une incoh�rence dans le traitement si $T_s^{imp}$ change de signe
+entre deux pas de temps.\\
+{\tiny$\blacksquare$} la partie diagonale $\tens{K}_{\,d}$ du terme
+de perte de charge est utilis�e dans $f_s^{\,imp}$. En fait, pour \^etre rigoureux,
+il faudrait ne retenir que les contributions positives (point signal\'e dans le
+sous-programme utilisateur associ\'e \fort{uskpdc}). Cette prise en compte sera \`a am\'eliorer.\\
+{\tiny$\blacksquare$} Le terme $\theta\,\Gamma^{n}-\theta\,\dive
+(\rho\,\underline {u})$ ne pose pas de probl�me pour la
+dominance de la diagonale de la matrice car il est exactement compens� par le
+terme de convection (cf. \fort{covofi}).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+L'�quation de conservation de la quantit� de mouvement est donc r�solue de fa�on
+d�coupl�e. Ainsi, l'int�gration des diff�rents termes a �t� effectu�e afin de
+traiter s�par�ment l'�quation obtenue pour chaque composante de la vitesse.\\
+Dans le sous-programme \fort{preduv}, on calcule pour chaque
+composante le second membre $f_s^{exp}$ du syst�me (\ref{Base_Preduv_eq_di2}), les termes implicites du syst�me (� l'exception des termes de convection-diffusion), et le terme de viscosit� totale aux faces internes\footnote{valeur n�cessaire pour l'int�gration du terme de diffusion dans \fort{codits}, $\displaystyle(\mu_{\,tot})_{ij}\frac{\var{SURFN}}{\var{DIST}}$} et de
+bord. Ces termes sont alors transmis au sous-programme \fort{codits} qui construit et
+r�sout le syst�me complet obtenu pour chaque composante de la vitesse avec les termes de convection-diffusion.
+\\\\
+Le r\'esidu de normalisation pour la r\'esolution du syst\`eme en pression (\fort{resolp}) est calcul\'e dans
+\fort{preduv}. Il est d\'efini par la norme de la
+grandeur $$\dive(\rho\,\widetilde{\vect{u}}^{n+1}+\Delta t \grad{P^{n-1+\theta}})-\Gamma$$
+int\'egr\'ee sur chaque cellule \var{IEL} du maillage ($\Omega_{iel}$) soit, symboliquement, par la racine carr\'ee de la
+somme sur les cellules du maillage de la quantit\'e
+\begin{center}
+\var{XNORMP(IEL)}=
+$\int\limits_{\Omega_{iel}}[{\dive(\rho\,\widetilde{\vect{u}}^{n+1}+\Delta\,t\,\grad{P^{n-1+\theta}})
+-\Gamma\,]\,d\Omega}$.
+\end{center}
+
+Il repr\'esente le second membre du syst\`eme qui porterait sur la pression si
+le gradient de pression n'\'etait pas pris en compte lors de l'\'etape de pr\'ediction des vitesses. On note que si l'on utilisait directement le second membre de
+l'\'equation portant sur l'incr\'ement de pression, on obtiendrait, pour un calcul
+stationnaire men\'e \`a convergence, un r\'esidu de normalisation tendant vers z\'ero, ce qui serait p\'enalisant et
+peu utile.
+
+Au d\'ebut de \fort{preduv}, on ne dispose pas encore de $\widetilde{\vect{u}}^{n+1}$
+et il n'est donc pas possible de calculer le r\'esidu de normalisation en
+totalit\'e. Cependant, le calcul du r\'esidu complet \`a la fin de \fort{preduv}
+n'est pas souhaitable non plus, car on devrait alors monopoliser un tableau de
+travail pour conserver le gradient de pression tout au long de \fort{preduv}.
+Le calcul du r\'esidu de normalisation est donc r\'ealis\'e en deux fois.
+
+La quantit\'e $\int\limits_{\Omega_{iel}}{\dive(\Delta\,t\,\grad{P^{n-1+\theta}}) -\Gamma d\Omega}$ est calcul\'ee au d\'ebut de \fort{preduv} et on y ajoute le compl\'ement $\int\limits_{\Omega_{iel}}{\dive(\rho\,\widetilde{\vect{u}}^{n+1})d\Omega}$ \`a la fin de \fort{preduv}.
+
+On calcule donc tout d'abord le gradient de pression aux cellules \`a l'instant
+$n-1+\theta$ par un appel \`a \fort{grdcel}. On utilise alors \fort{inimas} pour
+\'evaluer $\Delta\,t\,S\,\grad{P^{n-1+\theta}}\cdot\vect{n}$ aux faces (de surface $S$ et de normale $\vect{n}$). Pour cela, en entr\'ee de \fort{inimas} , le tableau de travail \var{TRAV} contient $\frac{\Delta\,t}{\rho}\,\grad{P^{n-1+\theta}}$~; en sortie, les tableaux \var{VISCF} et \var{VISCB} contiennent la valeur de $\Delta\,t\,S\,\grad{P^{n-1+\theta}}\cdot\vect{n}$ aux faces internes et de bord respectivement.
+
+On utilise ensuite \fort{divmas} qui place alors dans \var{XNORMP} la valeur de $\int\limits_{\Omega_{iel}}{\dive(\Delta\,t\,\grad{P^{n-1+\theta}}) d\Omega}$ aux cellules
+\`a partir des tableaux \var{VISCF} et \var{VISCB}.
+
+On ajoute enfin \`a \var{XNORMP} la contribution $\int\limits_{\Omega_{iel}}{ -\Gamma^{n} d\Omega}$ du terme source de masse.
+
+On applique pour $\rho\,\widetilde{\vect{u}} + \Delta t \grad{P}$ les conditions
+aux limites de la vitesse. Les conditions aux limites utilis�es pour le gradient
+de pression (ou
+plut\^ot pour $\frac{\Delta\,t}{\rho}\,\grad{P^{n-1+\theta}}$) pour le calcul de
+$\int\limits_{\Omega_{iel}}{\dive(\Delta\,t\,\grad{P^{n-1+\theta}}) d\Omega}$
+sont donc les conditions aux limites de la vitesse homog\'en\'eis\'ees~: ainsi,
+on suppose
+que dans la direction normale aux entr\'ees et aux parois, le gradient de
+pression (ou plut\^ot $\frac{\Delta\,t}{\rho}\,\grad{P^{n-1+\theta}}$) est nul
+et que dans la direction normale aux sym\'etries et aux sorties, il reste
+inchang\'e.
+
+De plus, pour gagner du temps calcul lors du passage par \fort{inimas},
+on se contente, sur les maillages non orthogonaux,
+d'une \'evaluation des valeurs aux faces \`a l'ordre 1 en espace (pas de
+reconstruction~: \var{NSWRP=1}). En effet, on cherche \`a \'evaluer un simple
+r\'esidu de normalisation global~: la pr\'ecision locale n'a donc pas
+d'int\'er\^et.
+
+Le calcul du r\'esidu sera compl\'et\'e \`a la fin de \fort{preduv}.
+
+
+\etape{Calcul en partie du r\'esidu de normalisation pour l'\'etape de pression}
+
+Dans cette premi�re �tape on calcule dans le tableau \var{XNORMP(NCELET)} la
+grandeur $$\dive(\Delta t \,\grad{P^{n-1+\theta}})-\Gamma$$ int\'egr\'ee sur chaque cellule \var{IEL} du maillage ($\Omega_{iel}$)
+soit, symboliquement,
+$$\var{XNORMP(IEL)}=\int\limits_{\Omega_{iel}}{\dive(\Delta\,t\,\grad{P^{n-1+\theta}})-\Gamma
+d\Omega}$$
+On r\'ealise cette op\'eration en utilisant successivement \fort{inimas}
+(calcul aux faces dans \var{VISCF} et \var{VISCB} de $\Delta t\,\grad{P^{n-1+\theta}}$ \`a
+partir du tableau de travail \var{TRAV}=$\frac{\Delta t}{\rho}
+\grad{P^{n-1+\theta}}$, assorti des conditions aux limites de vitesse
+homog\`enes et sans reconstruction) et \fort{divmas} (calcul dans \var{XNORMP}
+de l'int\'egrale sur les cellules). Par une simple boucle, on
+ajoute ensuite la contribution du terme source de masse $\Gamma$.
+Ce calcul est compl�t� \`a la fin de \fort{preduv}.\\
+
+\etape{Calcul en partie du terme $\underline{f}_s^{\,exp}$}
+
+Pour repr�senter le second membre correspondant � chaque composante de la
+vitesse, on utilise les tableaux \var{TRAV}(\var{IEL},\var{DIR}),
+\var{TRAVA}(\var{IEL},\var{DIR}) et \var{PROPCE},
+o� \var{IEL} est le num�ro de la cellule et \var{DIR} la direction (x, y,
+z). Quatre cas sont � consid�rer suivant que les termes sources sont extrapol�s
+en $n+\theta_S$, ou que l'on it�re par un point fixe sur le syst�me en
+vitesse-pression (\var{NTERUP}$>1$).
+\\
+$\bullet$ Si on extrapole les termes sources et que l'on it�re sur \fort{navsto}\\
+\begin{itemize}
+\item [-]\var{TRAV} re�oit les termes sources qui sont recalcul�s au cours de
+toutes les it�rations sur \fort{navsto} et qui ne sont pas extrapol�s
+($\grad{P^{n-1+\theta}}$ et $(\rho -\rho_0) \underline {g}$\footnote{en r�alit�
+$(\rho -\rho_0) \underline {g}$ ne change pas, mais il est rapide � calculer ce
+qui �vite d'avoir un traitement suppl�mentaire pour ce terme.}).\\
+\item [-]\var{TRAVA} re�oit les termes sources qui ne changent pas au cours des
+it�rations sur \fort{navsto} et qui ne sont pas extrapol�s
+($T_s^{imp}\,u^n\,,-\rho\,\tens{K}_{d}\,u^n\,,\,-\Gamma^n\,u^n,...$).\\
+\item [-]\var{PROPCE} re�oit les termes sources devant \^etre extrapol�s.\\
+\\
+\end{itemize}
+$\bullet$ Sans it�ration sur \fort{navsto}, \var{TRAVA} est inutile et son contenu est directement stock� dans \var{TRAV}.\\
+\\
+$\bullet$ Sans extrapolation des termes sources, \var{PROPCE} est inutile et son contenu est directement stock� dans \var{TRAVA} (ou dans \var{TRAV} si \var{TRAVA} est inutile).\\
+Ainsi, sans extrapolation des termes sources, et sans it�ration sur \fort{navsto}, tout les termes sources vont directement dans \var{TRAV}.\\
+\\
+\begin{itemize}
+\item On dispose d\'ej\`a du gradient de pression sur les cellules \`a l'instant $n-1+\theta$. Le terme de gravit\'e est alors ajout� au vecteur \var{TRAV} qui contient d�j� le gradient de pression. Ainsi, on a par exemple pour la direction x :
+\begin{equation}
+\var{TRAV}(\var{IEL},1) = |\Omega_{IEL}| (-\displaystyle (\frac {\partial p}
+{\partial x})_{\var{IEL}}+(\rho(\var{IEL})-\rho_0)g_x)
+\end{equation}
+
+\item Si une extrapolation des termes sources est utilis�e, le vecteur
+\var{TRAV} (ou \var{TRAVA}) re�oit � la premi�re it�ration sur \fort{navsto},
+$-\theta_S$ fois la contribution au temps $n-1$ des termes sources devant \^etre
+extrapol�s\footnote{car
+$(\underline{T}_s^{exp})^{n+\theta_S}=(1+\theta_S)\,(\underline{T}_s^{exp})^n
+-\,\theta_S\, (\underline{T}_s^{exp})^{n-1}$} (stock�e dans
+\var{PROPCE}). \var{PROPCE} est ensuite r�initialis� � z�ro de fa�on � pouvoir
+recevoir plus tard la contribution au pas de temps courant des termes sources qui
+sont extrapol�s.
+
+\item Le terme correspondant au mod�le de turbulence n'est calcul� que lors de la premiere it�ration sur \fort{navsto} puis ajout� � \var{TRAVA}, \var{TRAV} ou \var{PROPCE} suivant que les termes sources sont extrapol�s, ou que l'on it�re sur \fort{navsto}.\\
+
+{\tiny$\blacksquare$} Mod�les � viscosit� turbulente :\\
+Si $\var{IGRHOK}=1$, alors on calcule $-\displaystyle \frac{2}{3}\ \rho\ \grad k$ (et non, comme on devrait,
+$-\displaystyle \frac{2}{3}\grad (\rho k)$) par simplification
+(cf. paragraphe~\ref{Base_Preduv_section4}). Le gradient de $k$ est calcul� sur la cellule
+par le
+sous-programme \fort{grdcel}. \\
+Si $\var{IGRHOK}=0$, ce terme est suppos\'e \^etre implicitement pris en compte
+dans la pression.\\
+{\tiny$\blacksquare$} Mod�les au second ordre :\\
+Le calcul du terme $-\dive(\rho \tens{R})$ s'effectue en deux temps. Tout
+d'abord, on appelle le sous-programme \fort{divrij} qui projette le vecteur
+$\tens{R}.\underline{e}_{\var{DIR}}$ aux faces, pour la direction \var{DIR}. Puis, on
+appelle le sous-programme \fort{divmas} qui en calcule la divergence.\\
+\linebreak
+\item Les termes de viscosit� secondaire $- \displaystyle \frac {2} {3}\grad (\mu_{\,tot} \dive \underline\,{u})$ et de gradient
+transpos� $ \dive (\mu_{\,tot} \,^t\ggrad \underline {u})$ sont calcul�s (s'ils sont pris en compte \emph{i.e.} \var{IVISSE}\,(\var{IPHAS})\ = 1, o� \var{IPHAS} est le
+num�ro de la phase trait�e) par le sous-programme \fort{vissec}. Il ne sont calcul�s qu'� la premi�re it�ration sur \fort{navsto}. Au cours de cette �tape, le tableau \var{TRAV} est utilis� comme tableau de travail lors de l'appel au sous-programme \fort{vissec}. Il retrouve sa valeur � la fin de cet appel, son contenu �tant temporairement stock� dans les vecteurs \var{W7} � \var{W9}.
+\\
+\item Les termes correspondant aux pertes de charges ($\rho \tens{K}_{\,pdc}
+{u}$), s'ils existent (\ $\var{NCEPDP}> 0$\ ), sont calcul�s par le
+sous-programme \fort{tsepdc} � la premi�re it�ration sur \fort{navsto}. Ils sont
+d�compos�s en deux parties :\\
+{\tiny$\blacksquare$} Une premi�re, correspondant � la contribution des termes
+diagonaux ($-\rho\,\tens{K}_{\,d}\underline{u}$) qui n'est pas extrapol�e.\\
+{\tiny$\blacksquare$} Une seconde, correspondant aux termes extradiagonaux
+($-\rho\,\tens{K}_{\,e}\underline{u}$) qui peut l'\^etre ou non.\\
+Au cours de cette �tape, le tableau \var{TRAV} est utilis� comme tableau de
+travail lors de l'appel au sous-programme \fort{tsepdc}. Il retrouve sa valeur �
+la fin de cet appel, son contenu �tant temporairement stock� dans les vecteurs
+\var{W7} � \var{W9}.
+
+\end{itemize}
+
+\etape{Calcul du terme de viscosit� aux faces
+$\displaystyle(\mu_{\,tot})_{ij}\frac{\var{SURFN}}{\var{DIST}}$}
+Le calcul du terme de viscosit� totale aux faces est effectu� par le
+sous-programme \fort{viscfa} et stock� dans les tableaux \var{VISCF} et
+\var{VISCB} pour les faces internes et faces de bord respectivement.\\
+Lors de l'int�gration des termes de convection-diffusion dans le sous-programme
+\fort{codits}, on distingue les termes non reconstruits, int\'egr\'es dans la
+matrice $\tens{EM}$ , de l'ensemble des termes (non reconstruits +
+gradients de reconstruction) associ\'es \`a l'op\'erateur $\mathcal{E}$ (non
+lin\'eaire)\footnote{ par coh\'erence avec les op\'erateurs $\mathcal{EM}$ et $\mathcal{E}$ d\'efinis dans \fort{navsto} }.
+De la m�me mani�re, on distingue la viscosit� totale aux faces utilis�e dans
+$\mathcal{E}$, tableaux \var{VISCF} et \var{VISCB}, de la viscosit� totale aux
+faces utilis�e dans $\tens{EM}$, tableaux \var{VISCFI} et
+\var{VISCBI}.\\
+Pour les mod�les � viscosit� turbulente et en LES, ces deux tableaux sont identiques et contiennent $\mu_t+\mu$.
+Pour les mod�les au second ordre, ils contiennent normalement $\mu$, mais pour des simples raisons de stabilit�
+num�rique, on peut choisir de mettre $\mu_t+\mu$ dans la matrice (\textit{i.e.} dans $\tens{EM}$) en
+conservant $\mu$ au second menbre (\textit{i.e.} dans $\mathcal{E}$). De par la r�solution par incr�ments, cette
+ manipulation ne change pas le r�sultat. Cette option est activ�e par l'indicateur $\var{IRIJNU}\ =\ 1$\\
+Si la vitesse n'est pas diffus�e (\ \var{IDIFF}(\var{IUIPH})\ $<$\ 1), alors les termes \var{VISCF} et \var{VISCB} sont mis � z�ro.
+\linebreak
+
+\etape{Calcul du second membre complet, de $f_s^{\,imp}$ et r�solution de l'�quation}
+Les �quations d'�volution des composantes de la quantit� de mouvement sont
+r�solues de fa�on d�coupl�e. On utilise, par cons�quent, un seul tableau
+\var{ROVSDT} pour repr�senter la partie diagonale de la matrice obtenue pour chaque composante de la vitesse.\\
+Pour chaque composante de la vitesse :\\
+
+\begin{itemize}
+\item Lors de la premi�re it�ration sur le sous-programme \fort{navsto}, les parties implicites et explicites des termes sources utilisateurs sont calcul�es par appel au sous-programme \fort{ustsns}.\\
+{\tiny$\blacksquare$} La partie implicite ($T_s^{imp}$) est conserv�e dans le vecteur \var{XIMPA} pour les it�rations suivantes en cas d'utilisation du point-fixe sur le syst�me en vitesse-pression, et la contribution issue des m\^emes termes implicites ($T_s^{imp}\,\underline{u}^n$) ajout�e � \var{TRAVA} ou � \var{TRAV}.\\
+{\tiny$\blacksquare$} La partie explicite ($T_s^{exp}$) est ajout�e � \var{TRAVA}, \var{TRAV} ou \var{PROPCE} suivant que les termes sources sont extrapol�s, ou que l'on it�re sur \fort{navsto}.\\
+
+\item Le terme d'accumulation de masse ($\dive(\rho \underline {u})$) est
+calcul� en appelant le sous-programme \fort{divmas} avec en argument le flux de
+masse. Lors de la premi�re it�ration faite sur le sous-programme \fort{navsto},
+le terme correspondant � la contribution explicite de l'accumulation de masse
+($\underline{u}^{n}\ \dive(\rho \underline{u})$) est ajout� \`a \var{TRAVA} ou �
+\var{TRAV}. Le vecteur \var{ROVSDT} est initialis� par $\theta\,\dive(\rho
+\underline{u})$ (par coh�rence avec ce qui est fait dans le sous-programme
+\fort{bilsc2}) puis la contribution du terme instationnaire ($\displaystyle
+\frac{\rho}{\Delta t}$) ajout�e � ce dernier.\\
+
+\item Le vecteur \var{ROVSDT} est ensuite compl�t� avec la contribution des termes sources implicites utilisateur (stock�e dans \var{XIMPA}) et avec celle des perte de charge ($\rho\,\tens{K}_{\,d}$) si $\var{NCEPDP}>0$.\\
+{\tiny$\blacksquare$} Dans le cas ou les termes sources ne sont pas extrapol�s, la partie implicite des termes sources utilisateur n'est ajout�e � \var{ROVSDT} que si elle est n�gative de fa\c con � ne pas affaiblir la diagonale du syt�me.\\
+{\tiny$\blacksquare$} Dans le cas ou ils sont extrapol�s par contre, elle est prise en compte quel que soit son signe.\\
+
+\item Les termes sources implicite et explicite de masse, s'ils existent
+(~$\var{NCESMP}>0$~), sont calcul�s � la premi�re it�ration sur \fort{navsto}
+par le sous-programme \fort{catsma}. $\Gamma\,\underline{u}_i$ est ajout� �
+\var{TRAV}, \var{TRAVA} ou \var{PROPCE} pour �tre �ventuellement
+extrapol�. $\Gamma\,\underline{u}^n$ est rajout� � \var{TRAV} ou \var{TRAVA} et
+$-\Gamma$ � \var{ROVSDT}.
+\\
+\item Le second membre est enfin assembl� en tenant compte de toutes les
+contributions stock�es dans les tableaux \var{PROPCE}, \var{TRAVA} et
+\var{TRAV}.\\
+{\tiny$\blacksquare$} Si les termes sources sont extrapol�s alors :
+$$\var{SMBR}=(1-\theta_S)\,\var{PROPCE}+\var{TRAVA}+\var{TRAV}$$
+{\tiny$\blacksquare$} Sinon on a directement :
+$$\var{SMBR}=\var{TRAVA}+\var{TRAV}$$
+
+\item Prise en compte des physiques particuli�res (lagrangien, arc �lectrique,
+...) ajout�s directement � \var{SMBR}.
+\\
+\item La resolution du syst�me lin�aire est faite par le sous-programme
+\fort{codits} avec pour argument \var{ROVSDT} et \var{SMBR}.\\
+
+\item Si on utilise le couplage instationnaire renforc� vitesse-pression ($\ \var{IPUCOU} = 1\ $) (uniquement disponible avec l'ordre 1, sans extrapolation des termes sources et sans it�ration sur \fort{navsto}) on r�sout, en utilisant pour \fort{codits} :
+\begin{equation}\label{Base_Preduv_Eq_Tdir}
+\tens{EM}_{\,\var{DIR}}\,.\, (\tens{RHO}^{\,n})^{-1}\,.\,\underline{T}_{\,\var{DIR}} =
+\tens{\Omega}\,.\,\vect{1}
+\end{equation}
+avec $\tens{RHO}^n$ le tenseur diagonal d'\'el\'ement $\rho^{n}_{IEL}$,
+$\tens{\Omega}$ le tenseur diagonal d'\'el\'ement $|\Omega_{IEL}|$, $\vect{1}$ le
+vecteur de composantes toutes \'egales \`a 1.\\
+ L'inversion du syst�me par \fort{codits} fournit
+$(\tens{RHO}^{\,n})^{-1}\,.\,\underline{T}_{\,\var{DIR}}$, qui est ensuite multipli� par $\tens{RHO}^{\,n}$
+pour obtenir $\underline{T}_{\,\var{DIR}}$.
+Ceci est r\'ealis\'e pour chaque composante \var{DIR} de la vitesse. $\underline{T}_{\,\var{DIR}}$
+est alors une approximation de type matrice diagonale de
+$\tens{RHO}^{\,n}\,.\,\tens{EM}_{\,\var{DIR}}^{-1}$, avec
+$\tens{EM}_{\,\var{DIR}}$ repr�sentant toujours la partie implicite de l'�quation de quantit� de mouvement
+(\emph{i.e.} \var{ROVSDT} + contribution des
+termes de convection-diffusion pris en compte dans le sous-programme
+\fort{matrix}). $\underline{T}_{\,\var{DIR}}$
+intervient dans l'�tape corrective (cf. sous-programme \fort{resolp}).\\
+\end{itemize}
+Fin de la boucle sur les composantes de la vitesse.\\
+
+\etape{Fin du calcul du r\'esidu de normalisation pour l'\'etape de pression}
+
+Comme indiqu\'e pr\'ec\'edemment, on peut maintenant compl\'eter le calcul du
+r\'esidu de normalisation pour l'\'etape de pression de \fort{resolp}.
+
+Le tableau \var{XNORMP} contient d\'ej\`a
+$\int\limits_{\Omega_{iel}}{\dive(\Delta\,t\,\grad{P^{n-1+\theta}}) -\Gamma d\Omega}$ . On
+lui ajoute donc
+$\int\limits_{\Omega_{iel}}{\dive(\rho\,\widetilde{\vect{u^{n+1}}})d\Omega}$.
+
+Pour
+cela, on proc\`ede comme pr\'ec\'edemment pour le calcul de
+$\int\limits_{\Omega_{iel}}{\dive(\Delta\,t\,\grad{P^{n-1+\theta}}) d\Omega}$. Un appel \`a
+\fort{inimas} permet d'obtenir
+$\rho\,S\,\widetilde{\vect{u}}^{n+1}\cdot\widetilde{\vect{n}}$ aux faces \`a partir de
+$\widetilde{\vect{u}}^{n+1}$ connu aux cellules (tableau \var{RTP}). Les conditions
+aux limites pour \fort{inimas} sont naturellement celles de la vitesse. Comme
+pr\'ec\'edemment, on se contente pour gagner du temps calcul lors du passage par
+\fort{inimas}, d'une \'evaluation des valeurs aux faces \`a l'ordre 1 en espace
+sur les maillages non orthogonaux (pas de
+reconstruction~: \var{NSWRP=1}). On utilise ensuite \fort{divmas} pour calculer
+aux cellules la divergence
+$\int\limits_{\Omega_{iel}}{\dive(\rho\,\widetilde{\vect{u}}^{n+1})d\Omega}$ et
+l'ajouter directement \`a \var{XNORMP}.
+
+Pour finir, le r\'esidu de normalisation est d\'etermin\'e et stock\'e dans \var{RNORMP(IIPHAS)} par un appel \`a \fort{prodsc} (qui r\'ealise le calcul de la somme sur les cellules du
+carr\'e des valeurs de \var{XNORMP} et en prend la racine carr\'ee).\\
+
+
+\newpage
+
+On r�sume dans les tableaux (\ref{Base_Preduv_tab_ext0}), (\ref{Base_Preduv_tab_ext1}), (\ref{Base_Preduv_tab_exp0})
+et (\ref{Base_Preduv_tab_exp1}) les diff�rentes contributions (hors convection-diffusion)
+affect�es � chacun des vecteurs \var{TRAV}, \var{TRAVA}, \var{PROPCE} et
+\var{ROVSDT} � l'it�ration $n$. On diff�rencie pour chacun des sch�mas en temps
+appliqu�s aux les termes sources, deux cas suivant qu'un point fixe sur le
+syst�me en vitesse-pression est utilis� ou non (it�ration sur \fort{navsto} pour
+\var{NTERUP}$>1$). En l'absence d'indication les propri�t�s physiques $\Phi$
+($\rho$,$\mu$,etc...) sont suppos�es prises au temps $n+\theta_\Phi$, et le flux
+de masse $(\,\rho \underline{u})$ pris au temps $n+\theta_F$, o� $\theta_\Phi$
+et $\theta_F$ d�pendent des sch�mas en temps sp�cifiquement utilis�s pour ces
+grandeurs (cf. \fort{introd}).
+\\\\
+Les termes figurant dans ces tableaux sont �crits tels qu'ils ont �t� implant�s
+dans le code, d'o� l'origine de certaines diff�rences par rapport � l'�criture
+adopt�e dans l'�quation (\ref{Base_Preduv_eq_di2}).
+\\\\
+Par souci de simplification, on pose~:
+\begin{equation}\notag
+\mu_{\,tot}=
+\begin{cases}
+\mu+\mu_t & \text{pour les mod�les � viscosit� turbulente ou en LES}, \\
+\mu & \text{pour les mod�les au second ordre ou en laminaire}\\
+\end{cases} \
+\end{equation}
+
+\minititre{Avec extrapolation des termes sources}
+\begin{equation}\notag
+\underline{turb}^{n}=
+\begin{cases}
+\displaystyle\frac {2}{3}\,\rho^{n}\,\grad (\,k^{n}) &
+\text{pour les mod�les � viscosit� turbulente}, \\
+\dive(\rho^{n}\,\tens{R}^n) & \text{pour les mod�les au second ordre},\\
+0 & \text{en laminaire ou en LE.}\\
+\end{cases}
+\end{equation}
+$\bullet$ \var{NTERUP} $=$ 1 : $\var{SMBR}^n=(1-\theta_S)\,\var{PROPCE}^n+\var{TRAV}^n$
+\begin{equation}\label{Base_Preduv_tab_ext0}
+\begin{array}{|l|c|}
+\hline
+\var{ROVSDT}^{n}
+& \displaystyle
+\frac{\rho}{\Delta t} -\theta \,\dive (\rho\,\underline {u}) +\theta \,\, \Gamma^n + \theta \,\, \rho\,\tens{K}_{\,d}^n-\theta \,T_s^{\,imp} \\
+\hline
+\var{PROPCE}^{n}
+& \displaystyle
+\underline{T}_{s}^{\,exp,\,n}-\,\rho^{n}\,\tens{K}_{\,e}^{n}\ \underline{u}^{n} + \,\Gamma^{n}\,\underline{u}_{\,i}^{n}\\
+& \displaystyle
+-\underline{turb}^{n}+ \dive (\mu_{\,tot}^{n}\,^t\ggrad \underline {u}^{n}\,)+ \frac {2} {3}\,\grad (\mu_{\,tot}^{n}\,\dive \frac{(\rho \underline {u})}{\rho^{n}}\,)\\
+\hline
+\var{TRAV}^{n} & \displaystyle
+- \grad p^{n-1+\theta} + (\rho -\rho_0) \underline {g} \\
+& \displaystyle
+-\theta_S\,\var{PROPCE}^{n-1} -\rho\,\tens{K}_{\,d}^n\ \underline{u}^{n} \\
+& \displaystyle
++ T_s^{\,imp}\,\,\underline {u}^{n} + \dive (\rho\,\underline {u})\,\underline{u}^{n} - \Gamma^n\,\,\underline{u}^{n}\\
+\hline
+\end{array}
+\end{equation}
+\\\\
+$\bullet$ \var{NTERUP} $>$ 1 (sous-it�ration $k$) : $\var{SMBR}^n=(1-\theta_S)\,\var{PROPCE}^n+\var{TRAVA}^n+\var{TRAV}^n$
+\begin{equation}\label{Base_Preduv_tab_ext1}
+\begin{array}{|l|c|}
+\hline
+\var{ROVSDT}^{n}
+& \displaystyle
+\frac{\rho}{\Delta t} -\theta \,\dive (\rho\,\underline {u}) +\theta \,\, \Gamma^n + \theta \,\, \rho\,\tens{K}_{\,d}^n-\theta \,T_s^{\,imp} \\
+\hline
+\var{PROPCE}^{n}
+& \displaystyle
+\underline{T}_{s}^{\,exp,\,n}-\,\rho^{n}\,\tens{K}_{\,e}^{n}\ \underline{u}^{n} + \,\Gamma^{n}\,\underline{u}_{\,i}^{n}\\
+& \displaystyle
+-\underline{turb}^{n}+ \dive (\mu_{\,tot}^{n}\,^t\ggrad \underline {u}^{n}\,)+ \frac {2} {3}\,\grad (\mu_{\,tot}^{n}\,\dive \frac{(\rho \underline {u})}{\rho^{n}}\,)\\
+\hline
+\var{TRAVA}^{n} &
+\displaystyle
+-\theta_S\,\var{PROPCE}^{n-1} -\rho\,\tens{K}_{\,d}^n\ \underline{u}^{n} + T_s^{\,imp}\,\,\underline {u}^{n} + \dive (\rho\,\underline {u})\,\underline{u}^{n} - \Gamma^n\,\,\underline{u}^{n}\\
+\hline
+\var{TRAV}^{n}
+& \displaystyle
+- \grad (p^{n+\theta})^{(k-1)} + (\rho -\rho_0) \underline {g} \\
+\hline
+\end{array}
+\end{equation}
+
+\minititre{Sans extrapolation des termes sources}
+
+\begin{equation}\notag
+\underline{turb}^{n}=
+\begin{cases}
+\displaystyle\frac {2}{3}\,\rho\,\grad (\,k^{n}) &
+\text{pour les mod�les � viscosit� turbulente}, \\
+\dive(\rho\,\tens{R}^n) & \text{pour les mod�les au second ordre},\\
+0 & \text{en laminaire ou en LES.}\\
+\end{cases}
+\end{equation}
+$\bullet$ \var{NTERUP} $=$ 1 : $\var{SMBR}^n=\var{TRAV}^n$
+\\\\
+\begin{equation}\label{Base_Preduv_tab_exp0}
+\begin{array}{|l|c|}
+\hline
+\var{ROVSDT}^{n} &
+\displaystyle \frac{\rho}{\Delta t} -\theta \,\dive (\rho\,\underline {u}) +\, \Gamma^n + \, \rho\,\tens{K}_{\,d}^n+Max(-\,T_s^{\,imp},0)\\
+\hline
+\var{TRAV}^{n}
+& \displaystyle
+- \grad p^{n-1+\theta} + (\rho -\rho_0) \underline {g} \\
+& \displaystyle
++ \underline{T}_{s}^{\,exp}-\,\rho\,\tens{K}_{\,e}^{n}\ \underline{u}^{n} + \,\Gamma^{n}\,\underline{u}_{\,i}^{n}\\
+& \displaystyle
+-\underline{turb}^{n}+ \dive (\mu_{\,tot}\,^t\ggrad \underline {u}^{n}\,)+ \frac {2} {3}\,\grad (\mu_{\,tot}\,\dive \frac{(\rho \underline {u})}{\rho}\,)\\
+& \displaystyle
+-\rho\,\tens{K}_{\,d}^n\ \underline{u}^{n}+ T_s^{\,imp}\,\,\underline {u}^{n} + \dive (\rho\,\underline {u})\,\underline{u}^{n} - \,\Gamma^{n}\,\underline{u}^{n}\\
+\hline
+\end{array}
+\end{equation}
+\\\\
+$\bullet$ \var{NTERUP} $>$ 1 (sous-it�ration $k$) : $\var{SMBR}^n=\var{TRAVA}^n+\var{TRAV}^n$
+\begin{equation}\label{Base_Preduv_tab_exp1}
+\begin{array}{|l|c|}
+\hline
+\var{ROVSDT}^{n} &
+\displaystyle \frac{\rho}{\Delta t} -\theta \,\dive (\rho\,\underline {u}) +\, \Gamma^n + \, \rho\,\tens{K}_{\,d}^n+Max(-\,T_s^{\,imp},0)\\
+\hline
+\var{TRAVA}^{n} &
+\displaystyle
+\underline{T}_{s}^{\,exp}-\,\rho\,\tens{K}_{\,e}^{n}\ \underline{u}^{n} + \,\Gamma^{n}\,\underline{u}_{\,i}^{n}\\
+& \displaystyle
+-\underline{turb}^{n}+ \dive (\mu_{\,tot}\,^t\ggrad \underline {u}^{n}\,)+ \frac {2} {3}\,\grad (\mu_{\,tot}\,\dive \frac{(\rho \underline {u})}{\rho}\,)\\
+& \displaystyle
+-\rho\,\tens{K}_{\,d}^n\ \underline{u}^{n}+ T_s^{\,imp}\,\,\underline {u}^{n} + \dive (\rho\,\underline {u})\,\underline{u}^{n} - \Gamma^n\,\,\underline{u}^{n}\\
+\hline
+\var{TRAV}^{n} &
+\displaystyle
+- \grad (p^{n+\theta})^{(k-1)} + (\rho -\rho_0) \underline {g} \\
+\hline
+\end{array}
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}\label{Base_Preduv_section4}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Prise en compte du terme $\grad(\rho k)$ pour les mod�les � viscosit� turbulente}
+Pour les mod�les � viscosit� turbulente, on calcule $\rho\ \grad k$ au lieu de $\grad(\rho k)$. Cette
+approximation, historique, provient du fait que les conditions aux limites de
+$\rho k$ ne sont pas directement accessibles, contrairement \`a celles de
+$k$.\\
+
+\etape{Prise en compte de la diagonale de $\tens{K}_{\,pdc}$}
+Actuellement, dans le sous-programme utilisateur \fort{uskpdc}, une mise en
+garde explicite est \'ecrite, mais en commentaire.
+% \footnote{Son contenu est : Veillez
+%\`a ce que les coefficients diagonaux (du tenseur de pertes de charge consid\'er\'e) soient positifs. Vous risquez un PLANTAGE
+%si ce n'est pas le cas. AUCUN contr\^ole ult\'erieur ne sera effectu\'e.}.
+ La partie diagonale $\tens{K}_{\,d}$ du tenseur de pertes de charge
+$\tens{K}_{\,pdc}$ peut donc intervenir syst\'ematiquement dans le calcul du
+coefficient $f_s^{\,imp}$, que sa contribution $K_{\,d}$ soit positive ou non, si
+l'utilisateur n'y prend garde. Un test de positivit\'e sur les \'el\'ements de
+$\tens{K}_{\,d}$ assurant une prise en compte correcte (contribution renfor\c
+cant r\'eellement la diagonale de la matrice globale) devrait \^etre implant\'e.
+
+\etape{\'Ecriture de $\tens{EM}$}
+Dans la r\'esolution proc\'edant par incr\'ements, il n'est pas indispensable
+\`a convergence
+que la viscosit\'e utilis\'ee pour l'\'ecriture de l'op\'erateur $\mathcal{E}$ soit la m\^eme que celle prise en
+compte dans $\tens{EM}$, matrice du syst\`eme en incr\'ements. Ainsi, en $R_{ij}-\varepsilon$, la
+viscosit\'e totale utilis\'ee dans $\tens{EM}$ contient la viscosit\'e mol\'eculaire mais aussi la
+viscosit\'e turbulente si l'on choisit l'option \var{IRIJNU = 1 }, alors que
+dans $\mathcal{E}$ intervient seule la viscosit\'e mol\'eculaire. Cet ajout de
+la viscosit\'e turbulente qui n'a pas de raison d'appara\^\i tre en
+$R_{ij}-\varepsilon$, a \'et\'e h\'erit\'e des pratiques mises en \oe uvre dans
+ESTET et N3S-EF pour renforcer la stabilit\'e (lissage \'eventuel de l'incr\'ement). Mais, ce
+n'est peut \^etre pas le seul effet produit. En outre, cette pratique n'a pas aujourd'hui montr\'e son absolue
+n\'ecessit\'e dans \CS. Par cons\'equent, une \'etude approfondie serait int\'eressante.
+
+
+\etape{R\'esidu de normalisation de l'\'etape de pression}
+On pourra v\'erifier le calcul du r\'esidu de normalisation et en
+particulier l'utilisation des conditions aux limites de vitesse.
+
+\etape{Calcul des pertes de charges}
+Avec extrapolation des termes sources on a :
+\begin{equation}\notag
+(\tens{K}_{\,e}\underline{u})^{n+\theta_S} + \tens{K}_{\,d}^{n}\ \underline{u}^{n+\theta}
+\end{equation}
+Il serait aussi envisageable d'utiliser~:
+\begin{equation}\notag
+(\tens{K}_{\,e}\underline{u})^{n+\theta_S} + \tens{K}_{\,d}^{n+\theta_S}\ \underline{u}^{n+\theta}
+\end{equation}
diff --git a/doc/theory/recvmc.tex b/doc/theory/recvmc.tex
new file mode 100644
index 0000000..8b896ef
--- /dev/null
+++ b/doc/theory/recvmc.tex
@@ -0,0 +1,186 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{recvmc}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le but de ce sous-programme est de calculer la vitesse au centre des cellules
+\`a partir du flux de masse aux faces, par moindres carr\'es. Utilis\'ee apr\`es
+l'\'etape de correction de pression ({\it cf.}~\fort{navsto}) cette m\'ethode est une
+alternative \`a la technique de reconstruction \`a partir du gradient de
+l'incr\'ement de pression (technique standard).
+Elle est activ\'ee quand l'indicateur \var{IREVMC} vaut~1 ou 2.
+
+On rappelle que, � la fin de l'�tape de correction de pression, le flux de masse aux faces vaut :
+\begin{equation}
+(\rho \vect{u})^{n+1}_{\,ij}\text{.}\vect{S}_{\,ij} =
+(\rho
+\vect{\widetilde{u}})^{n+1}_{\,ij}.\,\vect{S}_{\,ij}
+-\vect{D}_{\,ij}(\Delta t^n,\delta P^{n+\theta})
++\text{RC}_{\,ij}
+\end{equation}
+o� $\vect{\widetilde{u}}$ est la vitesse issue de l'�tape de pr�diction, $D_{\,ij}$ un op�rateur de gradient aux faces
+et $\text{RC}_{\,ij}$ le terme d'Arakawa (cf. \fort{navsto} pour une d�finition pr�cise des notations).
+Une premi�re m�thode, activ�e par \var{IREVMC} = 2, consiste � partir directement de
+$(\rho \vect{u})^{n+1}_{\,ij}\text{.}\vect{S}_{\,ij}$ pour calculer $\vect{u}^{n+1}$ par moindres carr�s. Son utilisation a
+montr\'e qu'elle semblait plus diffusive que la m\'ethode standard (par exemple, dans le cas de la cavit\'e entra\^\i n\'ee)
+et pouvait conduire � des r�sultats erron�s sur des maillages ne comportant pas uniquement des t�tra�dres
+(ou des prismes � base triangulaire en ``2D'') et des pav�s (hexa�dres orthogonaux).\\
+On note que, dans la m�thode ci-dessus, on est parti d'une vitesse $\vect{\widetilde{u}}$ au centre des cellules, qu'on a projet�e aux faces pour obtenir le flux de masse, et qu'on ram�ne au centre des cellules par moindres carr�s. Fort de cette constatation, une m�thode alternative est disponible, activ�e par \var{IREVMC} = 1. Elle consiste � n'appliquer la m�thode des moindres carr�s qu'� la partie $-\vect{D}_{\,ij}(\Delta t^n,\delta P^{n+\theta}) +\text{RC}_{\,ij}$ du flux de masse et [...]
+$\vect{\widetilde{u}}$ (connu au centre des cellules) au r�sultat obtenu\footnote{cette derni�re �tape est faite dans
+\fort{navsto}.}. Cette m�thode donne des r�sultats sensiblement meilleurs.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Soit une cellule $\Omega_i$, $\phi_{ij}$ le flux de masse (total ou uniquement la partie en
+gradient de pression) \`a travers la face la
+s\'eparant d'une cellule voisine $\Omega_j$ et $\phi_{\,b_ik}$ le flux de masse (total ou uniquement la partie en
+gradient de pression)\`a travers la face de bord $\,b_{ik}$.
+L'id\'eal serait de pouvoir trouver un vecteur $\vect{v}_i$ telle que, pour toute cellule voisine $\Omega_j$ on ait :
+\begin{equation}
+\rho_i\vect{v}_i.\vect{S}_{ij} = \phi_{ij}
+\end{equation}
+et l'\'equivalent aux faces de bords, {\it i.e.} :
+\begin{equation}
+\rho_i \vect{v}_i.\vect{S}_{\,b_{ik}} = \phi_{\,b_{ik}}
+\end{equation}
+Comme c'est g\'en\'eralement impossible d'obtenir les deux \'egalit\'es pr\'ec\'edentes\footnote{%
+sauf en incompressible pour des triangles en 2D et des
+t\'etra\`edres en 3D}, on va simplement chercher \`a minimiser la fonction $F_i$ :
+\begin{equation}
+F_i=\sum\limits_{j\in Vois(i)}\left[
+\rho_i\vect{v}_i.\vect{S}_{ij}-\phi_{ij}\right]^2 + \sum\limits_{k\in {\gamma_b(i)}}\left[\rho_i\vect{v}_i.\vect{S}_{\,b_{ik}}-\phi_{\,b_{ik}}\right]^2
+\end{equation}
+
+Pour ce faire, on d\'erive $F_i$ par rapport aux trois composantes du vecteur $\vect{v}_i$,
+et on r\'esout le syst\`eme $3\times3$ local qui r\'esulte :\\
+\begin{equation}
+\begin{array}{lll}
+&\displaystyle \tens{\mathcal{S}}^{\,i} \,
+\left[\begin{array}{c}
+v_{i,x} \\ v_{i,y} \\ v_{i,z}
+\end{array}\right]
+&=\left[\begin{array}{c}
+\displaystyle
+\frac{1}{\rho_i}(\sum\limits_{j\in Vois(i)}\phi_{ij}S_{ij,x} +\sum\limits_{k\in {\gamma_b(i)}}\phi_{\,b_{ik}}S_{{\,b_{ik}},x})\\
+\displaystyle
+\frac{1}{\rho_i}(\sum\limits_{j\in Vois(i)}\phi_{ij}S_{ij,y} +\sum\limits_{k\in {\gamma_b(i)}}\phi_{\,b_{ik}}S_{{\,b_{ik}},y})\\
+\displaystyle
+\frac{1}{\rho_i}(\sum\limits_{j\in Vois(i)}\phi_{ij}S_{ij,z} +\sum\limits_{k\in {\gamma_b(i)}}\phi_{\,b_{ik}}S_{{\,b_{ik}},z})
+\end{array}\right]
+\end{array}
+\end{equation}
+
+avec $\tens{\mathcal{S}}^{\,i}$ matrice carr\'ee $3\times3$ d'\'el\'ement $S^{\,i}_{\,ml}$ courant d\'efini par :\\
+\begin{equation}
+S^{\,i}_{\,ml} = \sum\limits_{j\in Vois(i)}S_{ij,\,l}\,S_{ij,\,m} + \sum\limits_{k\in {\gamma_b(i)}}S_{{\,b_{ik}},\,l}\,S_{{\,b_{ik}},\,m}
+\end{equation}
+
+%\begin{equation}
+%\left[\begin{array}{ccc}
+%\displaystyle
+%\sum\limits_jS_{ij,x}S_{ij,x} & \sum\limits_jS_{ij,x}S_{ij,y}
+%& \sum\limits_jS_{ij,x}S_{ij,z}\\
+%\displaystyle
+%\sum\limits_jS_{ij,x}S_{ij,y} & \sum\limits_jS_{ij,y}S_{ij,y}
+%& \sum\limits_jS_{ij,y}S_{ij,z}\\
+%\displaystyle
+%\sum\limits_jS_{ij,x}S_{ij,z} & \sum\limits_jS_{ij,y}S_{ij,z}
+%& \sum\limits_jS_{ij,z}S_{ij,z}
+%\end{array}\right]
+%\left[\begin{array}{c}
+%u_{i,x} \\ u_{i,y} \\ u_{i,z}
+%\end{array}\right]
+%=\left[\begin{array}{c}
+%\displaystyle
+%\frac{1}{\rho_i}\sum\limits_j\phi_{ij}S_{ij,x}\\
+%\displaystyle
+%\frac{1}{\rho_i}\sum\limits_j\phi_{ij}S_{ij,y}\\
+%\displaystyle
+%\frac{1}{\rho_i}\sum\limits_j\phi_{ij}S_{ij,z}
+%\end{array}\right]
+%\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le flux de masse est pass\'e par les arguments \var{FLUMAS} et \var{FLUMAB}.
+
+\etape{Calcul de la matrice}
+Les \var{NCEL} matrices $3\times 3$ sont stock\'ees dans le tableau de travail
+\var{COCG},
+de dimension $NCELET\times 3\times 3$. Ce dernier est d'abord mis \`a z\'ero, puis
+son remplissage se fait dans des boucles sur les faces internes et les faces de
+bord. La matrice \'etant sym\'etrique, ces boucles ne
+servent qu'\`a remplir la partie triangulaire sup\'erieure, le reste \'etant
+rempli par sym\'etrie \`a la fin.
+
+\etape{Inversion de la matrice}
+On calcule les coefficients de la comatrice, puis l'inverse.
+Pour des questions de vectorisation, la boucle sur les \var{NCEL} \'el\'ements
+est remplac\'ee par une
+s\'erie de boucles en vectorisation forc\'ee sur des blocs de \var{NBLOC=1024}
+\'el\'ements. Le reliquat ($\var{NCEL}-E(\var{NCEL}/1024)\times 1024$) est
+trait\'e apr\`es les boucles.
+\`A la fin, la matrice inverse est stock\'ee dans \var{COCG}
+(toujours en utilisant sa propri\'et\'e de sym\'etrie).
+
+\etape{Calcul du second membre et r\'esolution}
+Le second membre est stock\'e dans \var{BX}, \var{BY} et \var{BZ}. La vitesse
+finale est stock\'ee dans \var{UX}, \var{UY} et \var{UZ}.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\etape{Vectorisation forc\'ee}
+Le d\'ecoupage en boucles de 1024 est-il vraiment n\'ecessaire ? Les machines
+vectorielles et les compilateurs sont-ils aujourd'hui capables
+d'effectuer la vectorisation sans cette aide ? On note cependant que ce
+d\'ecoupage en boucles de 1024 n'a pas de co\^ut CPU suppl\'ementaire, et un
+co\^ut m\'emoire n\'egligeable. Le seul inconv\'enient r\'eside dans la
+complexit\'e de l'\'ecriture.
+
+\etape{Suppression de la m�thode \var{IREVMC} = 2}
+Sur un maillage ``1D'' d'hexa�dres tous orthogonaux sauf une face, on peut montrer que la m�thode fait appara�tre
+une composante de vitesse aberrante non nulle et directement d�termin�e par l'angle de non orthogonalit� de la
+face (non consistance). On pourrait donc songer � supprimer purement cette m�thode, dans la mesure o� elle n'est
+{\em a priori} consistante que sur une classe r�duite de maillages.
+
diff --git a/doc/theory/resolp.tex b/doc/theory/resolp.tex
new file mode 100644
index 0000000..c21656b
--- /dev/null
+++ b/doc/theory/resolp.tex
@@ -0,0 +1,525 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{resolp}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Dans ce sous-programme appel� dans \fort{navsto}, on effectue l'�tape de projection de la vitesse (ou de correction de pression). L'�quation de quantit� de mouvement (pr\'ediction) est r�solue dans \fort{preduv} avec une pression totalement explicite. Il en r�sulte un champ de vitesse qui ne satisfait pas l'\'equation de continuit\'e. Deux algorithmes de correction sont propos�s :
+\begin{enumerate}
+\item L'algorithme que l'on appellera "couplage faible vitesse-pression". C'est un algorithme largement implant� dans les codes industriels. Il ne couple la vitesse et la pression qu'� travers le terme de masse (c'est l'algorithme propos� par d�faut). C'est un algorithme de type \textit{SIMPLEC} proche du \textit{SIMPLE}. Ce dernier prend en compte, en plus du terme de masse, les diagonales simplifi\'ees de la convection, de la diffusion et des termes source implicites.
+\item L'algorithme de couplage vitesse-pression renforc� (option \var{IPUCOU = 1}). C'est un algorithme qui couple la vitesse et la pression � travers tous les termes (convection, diffusion et termes source implicites) de l'�quation de quantit� de mouvement sans pour autant �tre exact. Il permet en pratique de prendre de grands pas de temps sans d�coupler totalement la vitesse et la pression.
+\end{enumerate}
+
+Si $\delta p$ est l'incr�ment de pression ({\it i.e.} $p^{n+1} = p^n+\delta p$) et $\widetilde{u}$ la vitesse issue de l'�tape de pr\'ediction, l'�tape de projection revient d'un point de vue continu � r�soudre une �quation de Poisson :
+
+\begin{equation}
+\dive(\,{\tens{T}^n\ \grad{\delta p}}) = \dive(\,{\rho \,\widetilde{u}})
+\end{equation}
+
+et \`a corriger la vitesse :
+
+\begin{equation}
+\vect{u}^{n+1} = \vect{u}^n - \frac{1}{\rho}\ \tens{T}^n\ \grad{\delta p}
+\end{equation}
+
+$\tens{T}^n$ est un tenseur d'ordre 2 dont les termes sont homog�nes � un pas de temps.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+L'�tape de pr\'ediction de la vitesse est d�crite dans \fort{preduv}. On adopte ici une notation d'op�rateurs pour simplifier la compr�hension des algorithmes implant�s.
+L'�quation discr\`ete de quantit� de mouvement s'�crit, � un instant de r\'esolution interm\'ediaire, dans chaque direction d'espace $\alpha$ ($\alpha \in \{1,2,3\}$) :
+
+\begin{equation}
+\displaystyle
+\tens{M}_{\,\alpha}^n\ \tens{R}^n\ (\widetilde{\vect{V_\alpha}} - \vect{V_\alpha}^n) +
+\tens{A_\alpha}^n\ \widetilde{\vect{V_\alpha}} =
+-\ \tens{G_\alpha}\ \vect{P}^n + \vect{S_\alpha}^n + \tens{I}_{\,s,\alpha}\ \widetilde{\vect{V_\alpha}}
+\label{Base_Resolp_QDM}
+\end{equation}
+\begin{itemize}
+\item[$\star$] $\tens{M}_{\,\alpha}^n$, de dimension $ \var{NCEL} \times \var{NCEL}$, est une matrice diagonale contenant le rapport du volume d'une cellule et du pas de temps local ($\ \displaystyle {\tens{M}_{\,\alpha}^n}(i,i) = \frac{|\Omega_i|}{{\Delta t}_{\,\alpha,I}^n} $\ ), ${\Delta t}_{\alpha,I}^n$ repr�sente le pas de temps dans la direction d'espace $\alpha$ � la cellule $\Omega_i$ et au pas de temps $n$,
+\item[$\star$] $ \tens{R}^n $, de dimension $\var{NCEL} \times \var{NCEL}$, est la matrice diagonale contenant la masse volumique (on la s�pare de la matrice de masse pour l'�tape de projection de $\rho \vect{u} $). Par d\'efinition, $ \tens{R}^n(i,i) = \rho^{\,n}_{\,I}$ et l'apparition du vide \'etant exclue, cette matrice est naturellement inversible,
+\item[$\star$] $\widetilde{\vect{V_\alpha}}$, de dimension $\var{NCEL}$, est un tableau o� est stock�e la $\alpha^{\text{�me}}$ composante de la vitesse pr�dite $\widetilde{\vect{u}}$,
+\item[$\star$] $\vect{V_\alpha}^n$, de dimension $\var{NCEL}$, est un tableau o� est stock�e la $\alpha^{\text{\`eme}}$ composante de la vitesse $\vect{u}^n$ � l'instant pr�c�dent $n$,
+\item[$\star$] $\tens{A_\alpha}^n$ d�signe l'op�rateur de convection/diffusion (cet op�rateur n'est pas forc�ment lin�aire � cause des tests de pente �ventuels dans le terme de convection, il peut d\'ependre de $\vect{V_\alpha}$),
+
+\item[$\star$] $\tens{G_\alpha}$ est l'op�rateur lin�aire\footnote{en toute rigueur, � cause des limitations �ventuelles de gradient qui peuvent �tre activ�e par l'utilisateur, cet op�rateur peut ne plus �tre vraiment lin�aire} gradient "cellules" dans la direction $\alpha$ (il est donc appliqu\'e \`a des vecteurs de dimension \var{NCEL}),
+\item[$\star$] $\vect{P}^n$, de dimension $\var{NCEL}$, est un tableau o� est
+stock�e la pression $p^n$ du pas de temps pr\'ec\'edent � chaque cellule,
+
+\item[$\star$] $\vect{S_\alpha}^{\,n}$ est le tableau de dimension $\var{NCEL}$ qui contient tous les termes source explicites (voir \fort{preduv} pour plus de d�tails),
+
+\item[$\star$] $\tens{I}_{\,s,\alpha}$ est le tenseur diagonal relatif aux termes source implicites des composantes de la vitesse.
+\end{itemize}
+
+L'\'etape de correction consiste \`a imposer :
+\begin{equation}\label{Base_Resolp_Eq_Cont}
+\dive(\,{\rho\,\vect{u}}\,) = \Gamma
+\end{equation}
+o\`u $\Gamma$ est un terme source de masse \'eventuel.
+%($\Gamma = 0$ pour un \'ecoulement incompressible et non dilatable).
+
+Soit $\vect W$ le tableau de dimension $3 \times \var{NCEL}$ qui contient toutes les composantes de la quantit� de mouvement ($\vect{V}$ d\'esigne $\vect{V}^n$, $\vect{V}^{n+1}$ ou $\widetilde{\vect{V}}$).
+$$ \vect{W} = \tens{R}^n\ \vect{V} = \left(
+ \begin{array} {c}
+ \rho^n\ \vect{V_1} \\
+ \rho^n\ \vect{V_2} \\
+ \rho^n\ \vect{V_3}
+ \end{array}
+ \right)
+$$
+
+Soit $\tens{D}$ l'op�rateur de divergence.
+L'�quation de continuit� (\ref{Base_Resolp_Eq_Cont}) s'�crit :
+\begin{equation}\notag
+\tens{D}\ \vect{W} = \vect{\Gamma}
+\end{equation}
+$\vect{\Gamma}$ contient la valeur de $\Gamma$ au centre des cellules.
+
+D'apr�s l'�quation discr\`ete (\ref{Base_Resolp_QDM}), on �crit pour tout $\alpha \in \{1,2,3\}$ :
+\begin{equation}
+\displaystyle
+(\tens{M}_{\,\alpha}^n + \tens{A_{\,\alpha}}^n\ {(\tens{R}^{n})}^{-1} -\ \tens{I}_{\,s,\alpha}\ {(\tens{R}^n)}^{-1})\ \tens{R}^n\ \widetilde{\vect{V_\alpha}} = -\ \tens{G_\alpha}\ \vect{P}^n + \vect{S_{\,\alpha}}^n + \tens{M_{\,\alpha}}\ \tens{R}^n\ \vect{V_\alpha}^n
+\label{Base_Resolp_eqn2}
+\end{equation}
+
+On pose :
+$$ \tens{B_{\,\alpha}} = \tens{M}_{\,\alpha}^n + \tens{A_{\,\alpha}}^n\ {(\tens{R}^n)}^{-1} - \tens{I}_{\,s,\alpha}\ {(\tens{R}^n)}^{-1}$$
+$$ \tens{B} = \left(
+ \begin{array} {ccc}
+ \tens{B_1} & 0 & 0 \\
+ 0 & \tens{B_2} & 0 \\
+ 0 & 0 & \tens{B_3}
+ \end{array}
+ \right)
+$$
+$$ \tens{G} = \left(
+ \begin{array} {c}
+ \tens{G_1} \\
+ \tens{G_2} \\
+ \tens{G_3}
+ \end{array}
+ \right)
+$$
+$$ \vect{S}^{\,n} = \left(
+ \begin{array} {c}
+ \vect{S_1}^n+\ \tens{M}_{\,1}\ \tens{R}^n\ \vect{V_1}^n\\
+ \vect{S_2}^n+\ \tens{M}_{\,2}\ \tens{R}^n\ \vect{V_2}^n\\
+ \vect{S_3}^n+\ \tens{M}_{\,3}\ \tens{R}^n\ \vect{V_3}^n
+ \end{array}
+ \right)
+$$
+
+On peut donc �crire :
+\begin{equation}
+\tens{B}\ \widetilde{\vect{W}} = -\ \tens{G}\ \vect{P}^{\,n} + \vect{S}^{\,n}
+\label{Base_Resolp_eqn3}
+\end{equation}
+
+La m\'ethode des pas fractionnaires se d\'ecompose en deux \'etapes :
+\begin{enumerate}
+\item r\'esolution de l'\'equation (\ref{Base_Resolp_QDM}) (cette \'equation nous donne l'\'equation(\ref{Base_Resolp_eqn3})), soit :
+\begin{equation}
+\displaystyle
+\tens{M}_{\,\alpha}^n\ \tens{R}^n\ (\widetilde{\vect{V_\alpha}} - \vect{V_\alpha}^n) +
+\tens{A_{\,\alpha}}^n\ \widetilde{\vect{V_\alpha}} - \tens{I}_{\,s,\alpha}\ \widetilde{\vect{V_\alpha}}
+ =
+-\ \tens{G_\alpha}\ \vect{P}^{\,n} + \vect{S_\alpha}^n
+\label{Base_Resolp_QDM2}
+\end{equation}
+
+\item soustraction\footnote{On n�glige la variation des termes sources explicites $\vect{S_\alpha}^n$ qui sont toujours estim\'es en $n$.} de l'\'equation de quantit\'e de mouvement prise \`a l'instant $(n+1)$ de (\ref{Base_Resolp_QDM2}) :
+\begin{equation}
+\displaystyle
+\tens{M}_{\,\alpha}^n\ \tens{R}^n\ (\vect{V_\alpha}^{n+1} - \widetilde{\vect{V_\alpha}}) +
+\tens{A_{\,\alpha}}^n\ (\vect{V_\alpha}^{n+1} - \widetilde{\vect{V_\alpha}}) - \tens{I}_{\,s,\alpha}\ (\vect{V_\alpha}^{n+1} - \widetilde{\vect{V_\alpha}})
+ =
+-\ \tens{G_{\,\alpha}}\ (\vect{P}^{\,n+1}- \vect{P}^{\,n})
+\label{Base_Resolp_frac2}
+\end{equation}
+\end{enumerate}
+
+L'\'equation (\ref{Base_Resolp_frac2}) nous donne :
+
+\begin{equation}
+\tens{B}\ (\vect{W}^{n+1}-\widetilde{\vect{W}}) = -\ \tens{G}\ (\vect{P}^{\,n+1}-\vect{P}^{\,n})
+\label{Base_Resolp_eqn5}
+\end{equation}
+
+avec :
+$$ \vect{W}^{\,n+1} = \tens{R}^n\ \vect{V}^{\,n+1}
+$$
+
+Or :
+$$\tens{D}\ \vect{W}^{\,n+1} = \vect{\Gamma} $$
+
+D'o�, en posant $ \delta \vect{P} = \vect{P}^{\,n+1} - \vect{P}^{\,n}$,
+
+\begin{equation}
+ \tens{D}\ \tens{B}^{-1}\,\tens{G}\ \,\delta \vect{P} =\ \tens{D}\ \widetilde{W} -\ \vect{\Gamma}
+\label{Base_Resolp_eqn5bis}
+\end{equation}
+
+Il nous reste donc � inverser le syst�me (\ref{Base_Resolp_eqn5bis}) pour d\'eterminer
+$\delta p$ (donc $p^{\,n+1}$) et corriger la vitesse pour obtenir
+$\vect{u}^{\,n+1}$. La correction de la vitesse se fait dans \fort{navsto}, soit
+en incr�mentant la vitesse par le gradient de l'incr�ment de pression $\delta p$
+calcul�, soit en reconstruisant la vitesse � partir du flux de masse actualis�
+par une m\'ethode de moindres carr\'es (en appelant le sous-programme \fort{recvmc}).
+
+Le probl�me provient tout d'abord du calcul de $\tens{B}^{-1}$. En effet, il a �t� jug� trop co�teux de calculer l'inverse de $\tens{B}$. Les algorithmes "couplage faible vitesse-pression" et celui du "couplage vitesse-pression renforc\'e" correspondent � une approximation de cet op�rateur.
+
+Dans le cas de l'algorithme "couplage faible vitesse-pression", on suppose $\tens{B}_{\,\alpha}^{-1} = \tens{M}_{\,\alpha}^{-1}$ (on pourrait inclure aussi les termes diagonaux issus de la convection, de la diffusion et des termes source implicites).
+
+Pour le "couplage vitesse-pression renforc\'e", on inverse le syst�me\footnote{$\vect{\Omega} = (|\Omega_1|,...,|\Omega_{\var{NCEL}}|,|\Omega_1|,...,|\Omega_{\var{NCEL}}|,|\Omega_1|,...,|\Omega_{\var{NCEL}}|)$.} $\tens{B}\ \vect{T} = \vect{\Omega} $ et on pose $\tens{B}_{\,\alpha}^{-1}~=~\text{diag}(T_\alpha) $. Cette �tape a lieu dans le sous-programme \fort{preduv}.
+
+Les �critures � l'aide des op�rateurs posent un inconv�nient majeur avec la
+discr�tisation colocalis�e. En effet, l'op�rateur\footnote{On insiste sur le
+fait que l'op\'erateur $\tens{G}$ est l'op\'erateur "gradients cellules"
+appliqu\'e \`a la pression explicite lors de la pr\'ediction de la vitesse.}
+$\tens{D}\ \tens{B}^{-1}\ \tens{G}$ peut d�coupler les n{\oe}uds pairs et impairs sur
+un maillage cart�sien et r\'egulier\footnote{Si $u_i$ est la valeur d'une
+variable aux centres des cellules sur un maillage cart\'esien 1D, le Laplacien
+de $u$ calcul\'e par cet op\'erateur en $i$ s'\'ecrit : $\displaystyle
+\frac{u_{i-2}+2u_i-u_{i+2}}{4h^2}$, o\`u $\displaystyle h$ est le pas
+d'espace. D'o\`u le d\'ecouplage des cellules.}.
+Pour \'eviter ce probl\`eme, on utilise l'op�rateur $\tens{L}$ (issu
+naturellement de la formulation volumes finis colocalis\'ee de l'op\'erateur
+$\dive(\,\grad\,))$ d�fini en chaque cellule\footnote{On rappelle que $Vois(i)$ est l'ensemble des centres des cellules voisines de ${\Omega_i}$ et
+$\gamma_b(i)$ l'ensemble des centres \'eventuels des faces de bord de ${\Omega_i}$.} $\Omega_i$ de centre $I$ par\footnote{Si $u_i$ est la valeur d'une variable aux centres des cellules sur un maillage cart\'esien 1D, le Laplacien de $u$ par ce dernier op\'erateur en $i$ s'\'ecrit : $\displaystyle \frac{u_{i-1}+2u_i-u_{i+1}}{4h^2}$, o\`u $\displaystyle h$ est le pas d'espace.}:
+\begin{equation}\label{Base_Resolp_eqn7}
+\begin{array}{ll}
+&(\tens{L}\ \delta \vect{P})_I = \sum\limits_{j\in Vois(i)}[\ \tens{T}^{\,n}_{\,ij}\ (\grad{\delta p})_{\,f_{\,ij}}]\,.\,\vect{S}_{\,ij}
++ \sum\limits_{k\in {\gamma_b(i)}}[\ \tens{T}^{\,n}_{\,b_{\,ik}}\ (\grad{\delta p})_{\,f_{\,b_{\,ik}}}]\,.\,\vect{S}_{\,b_{\,ik}}
+\end{array}
+\end{equation}
+$\tens{T}^n$ un tenseur diagonal d'ordre 2 contenant les pas de temps dans les trois directions d'espace et $\vect{S}_{\,ij}$ (respectivement $\vect{S}_{\,b_{\,ik}}$) le vecteur surface de la face purement interne $ij$ (resp. de la face de bord $ik$). Le gradient $(\grad{ \delta p})_{\,f_{ }}$ pr�sent dans l'�quation (\ref{Base_Resolp_eqn7}) est un gradient facette\footnote{Sur maillage orthogonal, $\displaystyle (\grad{p})_{\,f_{\,ij}} \ . \ \vect{S}_{\,ij} = \frac{ p_J - p_I }{\overl [...]
+
+D'un point de vue continu, on peut �crire\footnote{Dans le cas de l'algorithme "couplage faible vitesse-pression", $\widetilde{T}^n_I = \Delta t^{\,n}_I$.}:
+$$(\tens{L}\ \vect{P}^{n+1})_I = \int_{\Omega_i}\dive{(\ {\tens{T}}^n \ \grad{p^{n+1}})} \ d\Omega $$
+%$$(\tens{L}\ \vect{P}^{n+1})_I = \int_{\Omega_i}\dive{(\ \widetilde{\tens{T}}^n \ \grad%{p^{n+1}})} \ d\Omega $$
+L'op�rateur $\tens{L}$ ne pose pas de probl�me de d�couplage pair/impair sur les maillages cart\'esiens et r\'eguliers.
+
+Avec l'algorithme "couplage faible vitesse-pression" :
+$ \tens{T}_{\,I}^{\,n} = \left(
+ \begin{array} {ccc}
+ \Delta t_I^{\,n} & 0 & 0 \\
+ 0 & \Delta t_I^{\,n} & 0 \\
+ 0 & 0 & \Delta t_I^{\,n}
+ \end{array}
+ \right) $\\
+et avec l'algorithme "couplage vitesse-pression renforc\'e" :
+$ \tens{T}_{\,I}^{\,n} = \left(
+ \begin{array} {ccc}
+ T_{\,11,\,I}^{\,n} & 0 & 0 \\
+ 0 & T_{\,22,\,I}^{\,n}&0 \\
+ 0 & 0 & T_{\,33,\,I}^{\,n}
+ \end{array}
+ \right) $
+
+La matrice du syst\`eme de pression, dans le cas de l'utilisation du "couplage vitesse-pression renforc\'e", n'est pas facilement calculable \`a cause du terme :
+$$[\ \tens{T}^{\,n}_{\,ij}\ (\grad{\delta
+p})_{\,f_{\,ij}}]\,.\,\vect{S}_{\,ij}$$ pour une face interne $ij$ et du terme : $$[\ \tens{T}^{\,n}_{\,b_{\,ik}}\ (\grad{\delta p})_{\,f_{\,b_{\,ik}}}]\,.
+\,\vect{S}_{\,b_{\,ik}}$$ pour une face de bord.\\
+En effet, \`a cause du changement de la viscosit\'e suivant la direction de l'espace du fait de l'anisotropie de $\tens{T}^n$, il faudrait calculer les gradients directionnels en fonction du gradient normal.
+%(\delta p) = \tens{T}^{\,n}\ (\grad{(\delta p)})_{\,f } =
+
+On pose pour tout scalaire $a$, sans pr\'eciser pour le moment la nature du gradient $\grad$ :
+$$ \vect{\widetilde{G}}\ a = \tens{T}^{\,n}\ \grad{a} =
+ \left(
+ \begin{array} {c}
+ \displaystyle T_{11}^{\,n}\ \frac{\partial a}{\partial x}\\
+ \displaystyle T_{22}^{\,n}\ \frac{\partial a}{\partial y}\\
+ \displaystyle T_{33}^{\,n}\ \frac{\partial a}{\partial z}
+ \end{array}
+ \right)
+$$
+On peut \'egalement d\'efinir :\\
+$$ \left[(\vect{\widetilde{G}}\ a )_{\,cell}\right]_{\,ij}\,.\,\vect{S}_{\,ij} \overset{\text{\it\small d\'ef}}{=} \left[\tens{T}^{\,n}\ (\grad{a})\right]_{\,ij}\,.\,\vect{S}_{\,ij} $$ o\`u
+$\grad{a}$ est le gradient cellule classique de $a$.\\
+
+De m\^eme , on pose :
+$$ \left[(\vect{\widetilde{G}}\ a )_{\,f}\right]_{\,ij}\,.\,\vect{S}_{\,ij} \overset{\text{\it\small d\'ef}}{=} \left[\tens{T}^{\,n}\ ((\grad{a}))_{\,f}\right]_{\,ij}\,.\,\vect{S}_{\,ij} $$
+o\`u $(\grad{a})_{\,f}$ est le gradient facette de $a$.\\
+
+On doit calculer $\vect{\widetilde{G}}\ (\delta p)\,.\,\vect{S}$ \`a la face.\\
+S'il s'agit d'un gradient cellule, cela n'engendre aucune difficult\'e, les composantes du gradient cellule \'etant toutes parfaitement calculables.\\
+Par contre, s'il s'agit d'un gradient facette, seule la d\'ecomposition sur la normale \`a la face est exploitable\footnote{D'apr\`es la formule $ \displaystyle\frac { p_{\,J'} - p_{\,I'}}{\overline{I'J'}} S_{\,ij}$.}. On a besoin, explicitement et s\'epar\'ement, des quantit\'es $\displaystyle \frac{\partial (\delta p)}{\partial x}$, $\displaystyle \frac{\partial (\delta p)}{\partial y}$ et $\displaystyle \frac{\partial (\delta p)}{\partial z}$ ce qui rend difficile l'utilisation du gr [...]
+On fait donc une approximation sur le gradient de l'incr\'ement de la pression en supposant qu'il est \'egal \`a sa composante normale\footnote{{\it i.e.} on ne prend pas en compte la composante tangentielle $((\grad{(\delta p)})_{\,f}\,.\,\vect{\tau}).\vect{\tau}$, $\vect{\tau}$ \'etant un vecteur tangentiel unitaire.}, c'est \`a dire :
+\begin{equation}
+(\grad{(\delta p)})_{\,f} \approx ((\grad{(\delta p)})_{\,f}\,.\,\vect{n})\ \vect{n}
+\end{equation}
+o\`u $\vect{n}$ est la normale ext\'erieure unitaire.
+On a donc :
+$$ \vect{\widetilde{G}}\ (\delta p) \approx ((\grad{(\delta p)})_{\,f}\,.\,\vect{n})\ (\tens{T}^n\ \vect{n})$$
+On peut donc se ramener au cas d'un pas de temps scalaire $\widetilde{T}^n_{\,ij}$ en posant :
+\begin{equation}
+\widetilde{T}^n_{\,ij} = (\tens{T}^n_{\,ij}\ \vect{n})\,.\,\vect{n}
+\label{Base_Resolp_approx2}
+\end{equation}
+En effet :
+\begin{equation}
+\begin{array} {lll}
+[\ \tens{T}^{\,n}_{\,ij}\ (\grad{\delta p})_{\,f_{\,ij}}]\,.\,\vect{S}_{\,ij}& \approx (\tens{T}^n_{\,ij}\ \vect{n})\,.\,\vect{S}_{\,ij}\ (\grad{(\delta p)}_{f_{\,ij}}\,.\,\vect{n}) \\
+ & = (\tens{T}^n_{\,ij}\ \vect{n})\,.\,\vect{n} \ ({\grad{(\delta p)}}_{f_{\,ij}}\,.\,\vect{n}) \ S_{\,ij} \\
+ & = \widetilde{T}^n_{\,ij} \ ({\grad{(\delta p)}}_{f_{\,ij}}\,.\,\vect{n}) \ S_{\,ij}
+ \end{array}
+\label{Base_Resolp_approximation}
+\end{equation}
+or :
+\begin{equation}
+\begin{array} {lll}\label{Base_Resolp_Eq_Exacte}
+\widetilde{T}^n_{\,ij} \ ({\grad{(\delta p)}}_{f_{\,ij}}\,.\,\vect{n}) \ S_{\,ij} &= \widetilde{T}^n_{\,ij} \ {\grad{(\delta p)}}_{f_{\,ij}}\,.\,\vect{S}_{\,ij}\\
+&=\,\widetilde{T}^n_{\,ij}\ \left[ P_J - P_I
+ + (\ \vect{JJ'} - \vect{II'}\ )\,\displaystyle \frac{1}{2}\ (\,{\grad P}_I + \,{\grad P}_J\,)\right]\, \displaystyle \frac{S_{\,ij}}{\overline{I'J'}}
+\end{array}
+\end{equation}
+Ceci intervient lors de la reconstruction des gradients au second membre du syst\`eme final \`a r\'esoudre, par appel aux sous-programmes \fort{itrmas} et \fort{itrgrp}.\\
+En fait, l'approximation ($\displaystyle \widetilde{T}^n_{\,ij}=(\tens{T}^n_{\,ij}\ \vect{n})\,.\,\vect{n}$) n'y est pas utilis\'ee. En effet, puisqu'on calcule un gradient directionnel de l'incr\'ement de pression avec le sous-programme \fort{grdcel}, on se permet d'utiliser le tenseur $\tens{T}$ pour corriger le terme $[\ \tens{T}^{\,n}_{\,ij}\ (\grad{\delta p})_{\,f_{\,ij}}]\,.\,\vect{S}_{\,ij}$ .\\
+En pratique, on le discr\'etise, pour une face interne $ij$, par\footnote{Le coefficient $\displaystyle \frac{1}{2}$ dans (\ref{Base_Resolp_grad1}) est mis pour des raisons de stabilit\'e. En effet, l'utilisation des coefficients de pond\'eration aux faces serait plus exact mais probablement moins stable.}
+ :
+\begin{equation}\label{Base_Resolp_grad1}
+\begin{array} {lll}
+&[\ \tens{T}^{\,n}_{\,ij}\ (\grad{\delta p})_{\,f_{\,ij}}]\,.\,\vect{S}_{\,ij}
+&=\left[\widetilde{T}^n_{\,ij}\ \displaystyle \frac{P_J - P_I}{\overline{I'J'}} + \displaystyle
+ \frac{\vect{JJ'} -\vect{II'}}{\overline{I'J'}} \, \frac{1}{2}\ (\,\tens{T}^{\,n}_{\,I}\ {\grad P}_I + \tens{T}^{\,n}_{\,J}\ {\grad P}_J\,)\right]\,S_{\,ij}
+\end{array}
+\end{equation}
+au lieu de (\ref{Base_Resolp_Eq_Exacte}).
+On proc\`ede de m\^eme pour les termes de bord.\\
+Par la suite, on notera quand m\^eme cette expression $\widetilde{T}^n_{\,ij} \ ({\grad{(\delta p)}}_{f_{\,ij}}\,.\,\vect{S}_{\,ij})$.\\
+Il reste le terme $\tens{D}\ \widetilde{\vect{W}}$, qui \textit{via} les gradients cellule de la pression pr�sents dans l'�quation de quantit� de mouvement, d�couple les cellules paires et impaires sur une grille cart�sienne.
+On utilise pour �viter ce probl�me un filtre de type Rhie \& Chow qui permet de lisser la contribution de la pression de l'�quation de quantit� de mouvement.
+On �crit :
+\begin{equation}\label{Base_Resolp_eqn8}
+\begin{array}{lll}
+(\tens{D}\ \widetilde{\vect{W}})_I = &\sum\limits_{j\in Vois(i)}[\rho^{\,n} \widetilde{\vect{u}} + \alpha_{\,Arak}\ (\vect{\widetilde{G}}\ (p^n))_{\,cell}]_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij} - \alpha_{\,Arak}\sum\limits_{j\in Vois(i)}\ \widetilde{T}^n_{\,ij}\ (\grad{p^{n}})_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij} \\
+&+ \sum\limits_{k\in {\gamma_b(i)}}[\rho^{\,n} \widetilde{\vect{u}} + \alpha_{\,Arak}\ (\vect{\widetilde{G}}\ (p^n))_{\,cell}]_{\,f_{\,b_{\,ik}}}\,.\,\vect{S}_{\,b_{\,ik}} - \alpha_{\,Arak}\sum\limits_{k\in {\gamma_b(i)}}\widetilde{T}^n_{\,b_{\,ik}}\ (\grad{p^{n}})_{\,f_{b_{\,ik}}}\,.\,\vect{S}_{\,b_{\,ik}}\\
+&= \sum\limits_{j\in Vois(i)} \widetilde{m}_{\,ij} + \sum\limits_{k\in {\gamma_b(i)}}\widetilde{m}_{\,b_{\,ik}}
+\end{array}
+\end{equation}
+$\widetilde{m}_{\,ij}$ (resp. $\widetilde{m}_{\,b_{\,ik}}$) est le flux de masse � la face purement interne $ij$ (resp.\`a la face de bord $ik$) modifi� par le filtre Rhie \& Chow.\\
+$(\grad{p^{n}})_{f_{\,ij}}$ est un gradient facette alors que $[\rho^{\,n} \widetilde{\vect{u}} + \alpha_{\,Arak}\ (\vect{\widetilde{G}}\ (p^n))_{\,cell}]_{\,f_{\,ij}}$ est une valeur \`a la face interpol\'ee \`a partir des valeurs estim\'ees aux cellules (le gradient de pression dans ce terme est un gradient cellule). Cette pr\'ecision s'applique \'egalement aux termes de bord.\\
+Dans \CS, $ \alpha_{\,Arak} $ est appel� pour des raisons historiques "le coefficient d'Arakawa". Il est not� \var{ARAK}.
+
+Il faut remarquer, encore une fois, que pour le filtre Rhie \& Chow, le tenseur $\tens{T}^n$ est utilis\'e dans le terme volumique $\widetilde{\vect{G}}$ alors que l'approximation (\ref{Base_Resolp_approx2}) est appliqu\'ee lors du calcul du gradient facette.
+
+Finalement, d'apr\`es (\ref{Base_Resolp_eqn5bis}) et (\ref{Base_Resolp_eqn7}), on r�sout :
+\begin{equation}
+\sum\limits_{j\in Vois(i)}\ \widetilde{T}^n_{\,ij}\ (\grad{(\delta p)})_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij} + \sum\limits_{k\in {\gamma_b(i)}}\widetilde{T}^n_{\,b_{\,ik}}\ (\grad{(\delta p)})_{\,f_{b_{\,ik}}}\,.\,\vect{S}_{\,b_{\,ik}} = \sum\limits_{j\in Vois(i)} \widetilde{m}_{\,ij} + \sum\limits_{k\in {\gamma_b(i)}}\widetilde{m}_{\,b_{\,ik}} -\ \Gamma_I
+\label{Base_Resolp_Poisson}
+\end{equation}
+Pour la prise en compte des non orthogonalit�s, on r�sout ce syst�me lin�aire par incr�ment, en ajoutant au second membre les termes de reconstruction. Si $\delta(\delta p)$ est l'incr�ment de l'incr�ment (l'incr�ment de la variable $\delta p$ � calculer) et $k$ l'indice d'it�ration sur le point fixe, on r�sout exactement :
+\begin{equation}
+\begin{array}{lcl}
+&\sum\limits_{j\in Vois(i)}\ \widetilde{T}^n_{\,ij}\ \displaystyle \frac{(\delta(\delta p))_I^{\,k+1}-(\delta(\delta p))_J^{\,k+1}}{\overline{I'J'}}\ S_{\,ij} + \sum\limits_{k\in {\gamma_b(i)}}\widetilde{T}^n_{\,b_{\,ik}}\ \displaystyle\frac{(\delta(\delta p))_I^{\,k+1}-(\delta(\delta p))_{\,b_{ik}}^{\,k+1}}{\overline{I'F}}\ S_{\,b_{\,ik}} \\
+&= \sum\limits_{j\in Vois(i)} \widetilde{m}_{\,ij} + \sum\limits_{k\in {\gamma_b(i)}}\widetilde{m}_{\,b_{\,ik}}\\
+& - \sum\limits_{j\in Vois(i)}\,\widetilde{T}^n_{\,ij}\ (\grad{(\delta{p})^k})_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij} - \sum\limits_{k\in {\gamma_b(i)}}\,\widetilde{T}^n_{\,b_{\,ik}}\ (\grad{(\delta{p})^k})_{\,f_{b_{\,ik}}}\,.\,\vect{S}_{\,b_{\,ik}}
+- \ \Gamma_I\\
+&= \sum\limits_{j\in Vois(i)} m^{\,k}_{\,ij} + \sum\limits_{k\in {\gamma_b(i)}}m^{\,k}_{\,b_{\,ik}} - \ \Gamma_I
+\end{array}
+\label{Base_Resolp_equation resolue}
+\end{equation}
+avec :
+\begin{equation}\label{Base_Resolp_increment}
+\left\{\begin{array}{lll}
+(\delta(\delta p))^{0} &= 0\\
+(\delta(\delta p))^{k+1} &= (\delta p)^{k+1}-(\delta p)^k &\text {$\forall k \in \grandN$}\\
+\end{array}\right.
+\end{equation}
+Ce sont les gradients facette $(\grad{(\delta{p})^k})_{\,f_{\,ij}}$ et $(\grad{(\delta{p})^k})_{\,f_{b_{\,ik}}}$ qui seront reconstruits.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On expose dans ce qui suit l'algorithme tel qu'il est �crit dans \fort{resolp}.
+
+$\vect{T}^n$ d�signera un tableau de dimension $3$ contenant les pas de temps locaux dans chaque direction (pour l'utilisation du "couplage vitesse-pression renforc\'e"). Dans le cas de l'algorithme "couplage faible vitesse-pression", on garde cette notation, les pas de temps �tant �gaux dans les trois directions de l'espace.
+
+\etape {Calcul de la matrice du syst�me � r�soudre}
+\begin{itemize}
+\item calcul du coefficient de diffusion aux faces pour le Laplacien de pression (le coefficient de diffusion utilise le pas de temps de calcul ou celui du "couplage vitesse-pression renforc\'e"). Deux cas se pr�sentent suivant l'algorithme de couplage vitesse/pression choisi par l'utilisateur :
+
+\begin{enumerate}
+\item Appel de \fort{viscfa} avec une viscosit� totale �gale au pas de temps $\Delta t_I^n$ pour l'algorithme "couplage faible vitesse-pression" (\var{IPUCOU} = 0),
+\item Appel de \fort{visort} avec une viscosit� totale diagonale pour l'algorithme du "couplage vitesse-pression renforc\'e" (\var{IPUCOU} = 1). C'est \`a ce niveau qu'est calcul\'e $\widetilde{T}^n_{\,ij}$. Les pas de temps �quivalents calcul�s auparavant dans la subroutine \fort{preduv} sont stock�s dans le tableau \var{TPUCOU}.
+\end{enumerate}
+
+\item Appel de \fort{matrix} pour la construction de la matrice de diffusion de la pression (sans les termes de reconstruction qui ne peuvent pas �tre pris en compte si on veut garder une structure de matrice creuse) avec la viscosit� calcul�e pr�c\'edemment et le tableau \var{COEFB} des conditions aux limites de la pression $p^n$ (on impose une condition de Neumann homog\`ene (resp. Dirichlet homog\`ene) sur $\delta p$ pour une condition de Neumann (resp. Dirichlet) pour $p$).
+
+\end{itemize}
+
+\etape{Calcul du r�sidu de normalisation \var{RNORMP}}
+Cette \'etape est r\'ealis\'ee directement dans \fort{preduv} \`a partir de la version
+1.1.0.s, et le r\'esidu de normalisation est transmis par l'interm\'ediaire de
+la variable RNORMP(IPHAS).
+
+Le tableau \var{TRAV} contient � ce niveau de \CS \ le second membre issu de \fort{preduv} sans les termes source utilisateur. Le calcul de \var{RNORMP} se fait de la fa�on suivante :
+
+\begin{enumerate}
+
+\item $\displaystyle \var{TRAV}(I) = \widetilde{\vect{u}}_{\,I} - \frac {\Delta t^n_I} {\rho_I \ |\Omega_i|} \var{TRAV}(I) + \frac{(\rho_I - \rho_0 ) \Delta t^n_I }{\rho_I} \vect{g}$,
+\item Appel de \fort{inimas} pour calculer le flux de masse du vecteur $\var{TRAV}$ (on calcule � chaque face $\displaystyle \rho_{\,ij} \ \var{TRAV}_{\,ij}\,.\,\vect{S}_{\,ij}$, o� $\vect{S}$ est le vecteur surface). On impose le nombre de \textit{sweeps} (ou d'it\'erations) total \`a $1$ (\var{NSWRP} = 1), ce qui signifie que l'on ne recontruit pas les gradients lors de ce passage dans \fort{inimas} (pour des raisons de gain de temps de calcul). Les tableaux des conditions aux limites [...]
+\item Appel de \fort{divmas} pour calculer la divergence par cellule du flux de masse pr�c�dent. La divergence est stock�e dans le tableau de travail \var{W1}.
+\item Les termes source de masse stock�s dans le tableau \var{SMACEL} sont ajout�s \`a \var{W1}.
+\begin{equation}
+\var{W1}(I) = \var{W1}(I) - \frac{|\Omega_i|}{\rho_I} \var{SMACEL}(I)
+\label {SM1}
+\end{equation}
+\item Appel de \fort{prodsc} ($\var{RNORMP} = \sqrt{\var{W1}.\var{W1}}$). \var{RNORMP} servira dans le test d'arr�t du solveur de pression pour normaliser le r�sidu (voir la routine \fort{gradco} pour l'inversion par gradient conjugu�).
+
+\end{enumerate}
+
+\etape{pr�paration de la r�solution du syst�me}
+
+\begin{itemize}
+
+\item Appel de \fort{grdcel} pour le calcul du gradient de la pression $p^n$. Le r�sultat est stock� dans \var{TRAV}. \var{TRAV} contient donc � ce niveau $\displaystyle \frac{\partial p^n}{\partial x}$, $\displaystyle \frac{\partial p^n}{\partial y}$, $\displaystyle \frac{\partial p^n}{\partial z}$.
+
+\item Introduction du gradient cellule de la pression explicite $p^n$ pour l'utilisation du filtre Rhie~\&~Chow.
+
+$$ \var{TRAV}(I) = \widetilde{\vect{u}}_{\,I} + \frac{\var{ARAK}}{\rho_I} \ \tens{T}^n_{\,I}\ \grad{p^n}_{\,I}$$
+
+\var{ARAK} repr�sente le coefficient dit "d'Arakawa" que l'utilisateur peut modifier dans \fort{usini1} et qui vaut $1$ par d�faut. Pour simplifier les notations, on pose $\var{ARAK} = \alpha_{\,Arak}$.
+
+\item Appel de \fort{inimas} pour calculer le flux de masse de \var{TRAV}. Les conditions aux limites appliqu�es sont celles de la vitesse (voir sous-programme \fort{navsto}). Ceci reste une approximation des conditions aux limites de \var{TRAV}. Le flux de masse est donc �gal � (voir sous-programme \fort{inimas} pour plus de d�tails sur le calcul aux faces de bord) :
+
+$$m_{\,ij} = \left[\rho \widetilde{\vect{u}}+ \displaystyle \alpha_{\,Arak}\ \tens{T}^n\ \grad(p^n)\right]_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij}$$
+
+\item Appel de \fort{itrmas} pour incr�menter le flux de masse aux faces\footnote{$(\grad{p^n})_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij}$ est le gradient normal � la face �gal, sur un maillage orthogonal, � $\displaystyle \frac{ p^n_J - p^n_I}{\overline{IJ}} S_{\,ij}$.} de $$- \alpha_{\,Arak}\ \widetilde{T}^{\,n}_{\,ij}\ (\grad{p}^n)_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij}.$$
+
+\item Appel de \fort{clmlga} pour l'utilisation d'un algorithme de multigrille alg�brique pour l'inversion de la matrice de pression.
+
+\item initialisation de $\delta p$, $\delta(\delta p)$ et \var{SMBR} � 0. \var{SMBR} servira � stocker le second membre. Dans le code, \var{RTP(*,IPRIPH)} et \var{DRTP} contiennent respectivement $\delta p$ et $\delta(\delta p)$.
+\item Appel de \fort{divmas} pour le calcul de la divergence du flux de masse issu du dernier appel de \fort{itrmas}. Cette divergence est stock�e dans le tableau de travail \var{W7}.
+\item Ajout des contributions des termes source de masse\footnote{Le tableau \var{W7} contient le second membre sans le gradient de $\delta p$. Il reste donc inchang\'e \`a chaque \textit{sweep}. En revanche, \var{SMBR} contient le second membre complet qui varie \`a chaque \textit{sweep}.} � \var{W7}.
+\begin{equation}
+\var{W7}(I) = \var{W7}(I) - |\Omega_i|\ \var{SMACEL}(I)
+\label {SM2}
+\end{equation}
+\end{itemize}
+
+\etape{Boucle sur les non orthogonalit�s}
+Une seule inversion permettrait de r�soudre le probl�me en supposant que le maillage soit orthogonal. On d�crit ci-dessous la boucle sur les non orthogonalit�s.
+
+\begin{itemize}
+
+\item d�but de la boucle sur $k$ (dans ce qui suit, on est en $k+1$)
+
+\begin{itemize}
+
+\item[$\star$] Actualisation de \var{SMBR} au d�but de la boucle\footnote{Le signe "-" r�sulte de la construction de la matrice.}.
+$$ \var{SMBR}(I) = -\var{W7}(I) - \var{SMBR}(I) $$
+
+\item[$\star$] Calcul de la norme de \var{SMBR} dans \fort{prodsc}. On l'appelle \var{RESIDU}. Comme on r�sout le syst�me par incr�ment, le second membre doit s'annuler � convergence.
+\item[$\star$] Si $ \var{RESIDU} < 10 \times \varepsilon \times \var{RNORMP}$, la
+convergence est atteinte\footnote{$\varepsilon$ est la tol�rance associ�e � la pression qui peut �tre
+modifi�e par l'utilisateur dans \fort{usini1}, {\it via} le tableau \var{EPSILO}.}.
+\begin{itemize}
+\item[$\Rightarrow$] Appel de \fort{itrmas} pour la r�actualisation du flux de masse avec le gradient facette $(\grad (\delta p)^k)_{\,f}$. On calcule donc � chaque face $\widetilde{T}^{\,n}_{\,ij}\ (\grad(\delta p)^k)_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij}$ et $\widetilde{T}^{\,n}_{\,b_{\,ik}}\ (\grad(\delta p)^k)_{\,f_{\,b_{\,ik}}}\,.\,\vect{S}_{\,b_{\,ik}}$.
+
+\item[$\Rightarrow$] r�actualisation\footnote{$(\delta p)^k = \sum\limits_{l=1}^{l=k} (\delta(\delta p))^l $ est stock�e dans \var{RTP(*,IPRIPH)}.} de la pression $p^{n+1} = p^{n} + \sum\limits_{l=1}^{l=k} (\delta(\delta p))^l$.
+\end{itemize}
+
+\item[$\star$] Sinon,
+\begin{itemize}
+\item[$\Rightarrow$] $(\delta(\delta p))^{k+1} = 0$,
+\item[$\Rightarrow$] Appel de \fort{invers} pour l'inversion du syst�me (\ref{Base_Resolp_equation resolue}). Le test d'arr�t de l'algorithme d'inversion \var{RESIDU} est normalis� par \var{RNORMP} (voir \fort{gradco} pour l'inversion de la pression).
+\end{itemize}
+\item[$\star$] Si on atteint le nombre de \textit{sweeps} maximal,
+\begin{itemize}
+\item[$\Rightarrow$] Appel de \fort{itrmas} pour l'incr�mentation du flux de masse par le gradient de la pression $(\delta p)^{k}$.
+\item[$\Rightarrow$] Second appel de \fort{itrmas} pour l'incr�mentation du flux de masse avec le gradient de $(\delta(\delta p))^{k+1}$ non reconstruit pour assurer une divergence finale nulle, ceci pour rester coh�rent avec la matrice de pression qui ne prend pas en compte les non orthogonalit�s\footnote{On pourra se r\'ef\'erer au sous-programme \fort{navsto} pour plus de d\'etails.}.
+\item[$\Rightarrow$] mise � jour de l'incr�ment de pression $(\delta p)^{k+1} = (\delta p)^{k} + (\delta(\delta p))^{k+1}$.
+\end{itemize}
+\item[$\star$] Sinon,
+\begin{itemize}
+\item[$\Rightarrow$] Incr�mentation du flux de masse en prenant en compte un coefficient de relaxation. $ (\delta p)^{k+1} = (\delta p)^{k} + \var{RELAX} \times (\delta(\delta) p)^{k+1}$. Le coefficient de relaxation est mis par d�faut � $1$ et peut �tre modifi� dans \fort{usini1}.
+\item[$\Rightarrow$] Appel de \fort{itrgrp} pour le calcul de la partie en $\tens{T}^n\ \grad{(\delta p)}$ du second membre (auquel sera ajout\'e le tableau \var{W7} en d\'ebut de boucle).
+$$\var{SMBR}(I) = \sum\limits_{j\in Vois(i)}\,\widetilde{T}^{\,n}_{\,ij}\ (\grad(\delta p)^k)_{\,f_{\,ij}}\,.\,\vect{S}_{\,ij} + \sum\limits_{k\in {\gamma_b(i)}} \,\widetilde{T}^n_{\,b_{\,ik}}\ (\grad{(\delta p)^k})_{\,f_{b_{\,ik}}}\,.\,\vect{S}_{\,b_{\,ik}}$$
+\end{itemize}
+\end{itemize}
+
+\item fin de la boucle
+\end{itemize}
+\etape {r�actualisation de la pression}
+On r�actualise la pression par la somme des incr�ments de $\delta p$.
+$$p^{n+1} = p^n + (\delta p)_{k_{conv}}$$
+avec,
+$$(\delta p)_{k_{conv}} = \sum\limits_{k=1}^{k=k_{conv}}{(\delta(\delta p))^k} $$
+
+En pratique, \var{RTP} contient $(\delta p)^k_{conv}$. On incr\'emente donc $p^n$ par \var{RTP} :
+
+$$\var{RTP} = \var{RTPA} + \var{RTP} $$
+
+\clearpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Il reste plusieurs probl\`emes \`a r\'esoudre :
+\begin{enumerate}
+
+\item L'approximation du gradient de l'incr\'ement de la pression par le gradient normal peut poser des probl\`emes de consistance, notamment avec la remarque ci-dessous.
+\item L'approximation $\ \widetilde{T}^n \approx (\tens{T}^n \ \vect{n})\,.\,\vect{n}\ $ n'est pas faite lors de la reconstruction des gradients au second membre de l'\'equation de pression. Elle n'est pas faite non plus pour le calcul du gradient cellule lors de l'application du filtre Rhie \& Chow.
+
+\item Utilisation de pond\'eration $\displaystyle \frac {1}{2}$ lors de calculs de valeurs aux faces pour des raisons de stabilit\'e num\'erique (ex. dans \fort{itrmas} ou \fort{itrgrp} lors de la reconstruction du gradient de l'incr\'ement de pression \`a la face).
+
+\item On pourra v\'erifier le calcul du r\'esidu de normalisation (voir \fort{preduv}).
+
+\item Lors du calcul du flux de masse de $\displaystyle \widetilde{u}+
+\frac{\alpha}{\rho}\ \tens{T}\ \grad{p^n}$ dans \fort{inimas}, on utilise les
+conditions aux limites de la vitesse au temps $n$. Ceci reste un point peu clair
+particuli\`erement pour les conditions aux limites de sortie. Il faudra plus
+g\'en\'eralement analyser les conditions aux limites des variables dans
+\fort{navsto}. Ce probl\`eme est \`a relier \`a celui signal\'e pour \fort{vissec}.
+
+\item Lors du test de convergence de la boucle sur les non orthogonalit\'es, on multiplie la tol\'erance par 10. Est-ce r�ellement n�cessaire ?
+
+\item Il faudrait revoir le probl\`eme de relaxation lors de l'actualisation de
+la pression dans la boucle sur les non orthogonalit\'es (un coefficient de relaxation dynamique serait peut-�tre int\'eressant).
+
+\item Le filtre de Rhie \& Chow peut s'av�rer assez g�nant dans certaines configurations. Il serait int�ressant, avant toute
+travail de modification, de v�rifier
+qu'il est vraiment utile, en identifiant clairement une configuration o� il joue un r�le positif certain, si une telle configuration
+existe.
+
+\end{enumerate}
+
diff --git a/doc/theory/summary.tex b/doc/theory/summary.tex
new file mode 100644
index 0000000..b183228
--- /dev/null
+++ b/doc/theory/summary.tex
@@ -0,0 +1,103 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% SYNTH�SE
+\vspace*{0.1cm}
+\begin{center}
+\medskip
+\textit{ABSTRACT}
+\end{center}
+\vspace*{1cm}
+\pdfbookmark[1]{Summary}{summary}
+
+\CS solves the Navier-Stokes equations for 2D, 2D axisymmetric, or 3D,
+steady or unsteady, laminar or turbulent, incompressible or dilatable
+flows, with or without heat transfer, and with possible scalar
+fluctuations. The code also includes a Lagrangian module, a
+semi-transparent radiation module, a gas combustion module, a coal
+combustion module, an electric module (Joule effect and electric arc)
+and a compressible module. In the present document, the "gas
+combustion", "coal combustion", "electric" and "compressible"
+capabilities of the code will be referred to as "particular
+physics". The code uses a finite volume discretization. A wide range
+of unstructured meshes, either hybrid (containing elements of
+different types) and/or non-conform, can be used.
+
+
+This document constitutes the theory and developer's guide associated
+with the kernel of \CS. Combustion, electric and compressible modules
+are also presented.
+
+To make the documentation immediately suitable to the developers' needs, it
+has been organized into sub-sections corresponding to the major steps of the
+algorithm and to some important subroutines of the code.
+In each sub-section (for each subroutine), the \textbf{function} of the
+piece of code considered is indicated. Then, a description of the \textbf{%
+discretisation} follows. Finally, and more oriented towards the developers,
+details of the \textbf{implementation} are provided and a list of open
+problems is given (improvements, limitations...).
+
+To make it easier for the developers to keep the documentation up to date
+during the development process, the files have been associated "physically"
+with the release of the code (each release of the code includes a directory
+containing the whole documentation). In practice,
+% fa modification : discard (from the development version 1.1.0.n on),
+the users of \CS can access the documentation at the following location \texttt{\$CS\_HOME/doc/NOYAU/}.
+The general command \texttt{info\_cs [theory]} also provides this
+information.
+
+
+\CS 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.
+\CS 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.
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% EXECUTIVE SUMMARY
+%\passepage
+%\vspace*{0.1cm}
+%\begin{center}
+%\textbf{\large \titreang}\\
+%\medskip
+%\textit{EXECUTIVE SUMMARY}
+%\end{center}
+%\vspace*{1cm}
+%\pdfbookmark[1]{Excutive summary}{executive summary}
+%
+%This is the executive summary of the report.
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/doc/theory/theory.tex b/doc/theory/theory.tex
new file mode 100644
index 0000000..4f40df9
--- /dev/null
+++ b/doc/theory/theory.tex
@@ -0,0 +1,159 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\documentclass[a4paper,10pt,twoside]{report}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES OBLIGATOIRES
+\usepackage{csdoc}
+% MACROS SUPPLEMENTAIRES
+\usepackage{csmacros}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES ET COMMANDES POUR LE DOCUMENTS PDF ET LES HYPERLIENS
+\hypersetup{%
+ pdftitle = {CodeSaturne Theory and Programmer's Guide},
+ pdfauthor = {MFEE},
+ pdfpagemode = UseOutlines
+}
+\pdfinfo{/CreationDate (D:20030429000000-01 00 )}
+%
+% Pour avoir les Thumbnails a l'ouverture du document sous ACROREAD :
+% pdfpagemode = UseThumbs
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% MACROS SUPPLEMENTAIRES
+% \newcommand{/...}{...}
+%
+\setcounter{tocdepth}{0}
+%Compteur de ``programme'' remis a jour dans les part.
+\newcounter{prog}[part]
+\renewcommand{\theprog}{\arabic{prog}}
+\renewcommand{\thesection}{\theprog.\arabic{section}}
+\renewcommand{\theequation}{\thepart.\theprog.\arabic{equation}}
+\renewcommand{\thefigure}{\thepart.\theprog.\arabic{figure}}
+\newcommand{\programme}[1]{%
+\passepage
+\refstepcounter{prog}
+\stepcounter{chapter}
+\setcounter{section}{0}
+\setcounter{equation}{0}
+\setcounter{figure}{0}
+\begin{center}
+\Huge \bf \theprog - \underline{Sous-programme \fort{#1}}
+\end{center}
+\addcontentsline{toc}{chapter}{\theprog- Sous-programme #1}}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% INFO POUR PAGES DE GARDES
+\titreCS{\CS \verscs Theory and Programmer's Guide}
+\docassociesCS{}
+\resumeCS{Ce document constitue la documentation th\'eorique et
+informatique des parties centrales du noyau de \CS~\verscs.
+La documentation est attach\'ee \`a la version du code
+correspondante pour favoriser les mises \`a jour. En pratique, les
+utilisateurs de \CS
+peuvent acc\'eder \`a la documentation sous
+\texttt{\$CS\_HOME/doc/NOYAU/}, information qui leur est rappel\'ee par la
+commande d'information g\'en\'erale \texttt{info\_cs [theory]}.}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DEBUT DU DOCUMENT
+\begin{document}
+
+%\def\bibname{R�f�rences}
+\def\contentsname{\textbf{\normalsize SOMMAIRE}\pdfbookmark[1]{Sommaire}{contents}}
+\def\indexname{Index des variables principales et des mots cl\'es}
+
+\pdfbookmark[1]{Pages de garde}{pdg}
+\large
+\makepdgCS
+\normalsize
+
+\passepage
+\input summary
+
+\passepart
+\begin{center}\begin{singlespace}
+\tableofcontents
+\end{singlespace}\end{center}
+
+
+%\passepage
+%\printsymliste\
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% CORPS DU DOCUMENT
+%
+\passepage
+\part{Introduction}
+\stepcounter{prog}
+\include{introd}
+\part{Module de base}
+\include{bilsc2}
+\include{clptur}
+\include{clptrg}
+\include{clsyvt}
+\include{codits}
+\include{condli}
+\include{covofi}
+\include{gradmc}
+\include{gradrc}
+\include{inimas}
+\include{itrmas}
+\include{matrix}
+\include{navsto}
+\include{preduv}
+\include{recvmc}
+\include{resolp}
+\include{turbke}
+\include{turrij}
+\include{viscfa}
+\include{visort}
+\include{vissec}
+\include{vortex}
+\part{Module compressible}
+\include{cfbase}
+\include{cfener}
+\include{cfmsvl}
+\include{cfqdmv}
+\include{cfxtcl}
+\part{Module �lectrique}
+\include{elbase}
+\part{Module combustion}
+\include{combustion}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FIN DU DOCUMENT
+\end{document}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/doc/theory/turbke.tex b/doc/theory/turbke.tex
new file mode 100644
index 0000000..ae5b4f4
--- /dev/null
+++ b/doc/theory/turbke.tex
@@ -0,0 +1,534 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{turbke}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le but de ce sous-programme est de r\'esoudre le syst\`eme des \'equations de
+$k$ et $\varepsilon$ de mani\`ere semi-coupl\'ee.\\
+Le syst\`eme d'\'equations r\'esolu est le suivant :
+
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+\rho\frac{\partial k}{\partial t} +
+\dive\left[\rho \vect{u}\,k-(\mu+\frac{\mu_t}{\sigma_k})\grad{k}\right] =
+\mathcal{P}+\mathcal{G}-\rho\varepsilon+k\dive(\rho\vect{u})
++\Gamma(k_i-k)\\
+\multicolumn{1}{c}{+\alpha_k k +\beta_k}\\
+\displaystyle
+\rho\frac{\partial \varepsilon}{\partial t} +
+\dive\left[\rho \vect{u}\,\varepsilon-
+(\mu+\frac{\mu_t}{\sigma_\varepsilon})\grad{\varepsilon}\right] =
+C_{\varepsilon_1}\frac{\varepsilon}{k}\left[\mathcal{P}
++(1-C_{\varepsilon_3})\mathcal{G}\right]
+-\rho C_{\varepsilon_2}\frac{\varepsilon^2}{k}
++\varepsilon\dive(\rho\vect{u})\\
+\multicolumn{1}{c}{+\Gamma(\varepsilon_i-\varepsilon)
++\alpha_\varepsilon \varepsilon +\beta_\varepsilon}
+\end{array}\right.
+\end{equation}
+
+$\mathcal{P}$ est le terme de production par cisaillement moyen :
+\begin{displaymath}
+\begin{array}{rcl}
+\mathcal{P} & = & \displaystyle -\rho R_{ij}\frac{\partial u_i}{\partial x_j}
+= -\left[-\mu_t \left(\frac{\partial u_i}{\partial x_j} +
+\frac{\partial u_j}{\partial x_i}\right)
++\frac{2}{3}\mu_t\frac{\partial u_k}{\partial x_k}\delta_{ij}
++\frac{2}{3}\rho k\delta_{ij}\right]
+\frac{\partial u_i}{\partial x_j}\\
+& = & \displaystyle \mu_t \left(\frac{\partial u_i}{\partial x_j} +
+\frac{\partial u_j}{\partial x_i}\right)\frac{\partial u_i}{\partial x_j}
+-\frac{2}{3}\mu_t(\dive\vect{u})^2-\frac{2}{3}\rho k \dive(\vect{u})\\
+& = & \displaystyle \mu_t \left[
+2\left(\frac{\partial u}{\partial x}\right)^2+
+2\left(\frac{\partial v}{\partial y}\right)^2+
+2\left(\frac{\partial w}{\partial z}\right)^2+
+\left(\frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right)^2+
+\left(\frac{\partial u}{\partial z}+\frac{\partial w}{\partial x}\right)^2+
+\left(\frac{\partial v}{\partial z}+\frac{\partial w}{\partial y}\right)^2
+\right]\\
+\multicolumn{3}{r}%
+{\displaystyle -\frac{2}{3}\mu_t(\dive\vect{u})^2-\frac{2}{3}\rho k \dive(\vect{u})}
+\end{array}
+\end{displaymath}
+
+$\mathcal{G}$ est le terme de production par gravit\'e :
+$\displaystyle
+\mathcal{G}=-\frac{1}{\rho}\frac{\mu_t}{\sigma_t}
+\frac{\partial\rho}{\partial x_i}g_i$
+
+La viscosit\'e turbulente est
+$\displaystyle \mu_t=\rho C_\mu\frac{k^2}{\varepsilon}$.
+
+Les constantes sont :\\
+$C_\mu=0,09$ ;
+$C_{\varepsilon_2}=1,92$ ; $\sigma_k=1$ ; $\sigma_\varepsilon=1,3$\\
+$C_{\varepsilon_3}=0$ si $\mathcal{G}\geqslant0$ (stratification instable) et
+$C_{\varepsilon_3}=1$ si $\mathcal{G}\leqslant0$ (stratification stable).
+
+$\Gamma$ est un \'eventuel terme source de masse (tel que l'\'equation de
+conservation de masse devienne
+$\displaystyle \frac{\partial \rho}{\partial t}+\dive(\rho\vect{u})=\Gamma$).
+$\varphi_i$ ($\varphi=k$ ou $\varepsilon$) est la valeur de $\varphi$
+associ\'ee \`a la masse inject\'ee ou retir\'ee. Dans le cas o\`u on retire de
+la masse ($\Gamma<0$), on a forc\'ement $\varphi_i=\varphi$. De m\^eme, quand on
+injecte de la masse, on sp\'ecifie souvent aussi $\varphi_i=\varphi$. Dans ces
+deux cas, le terme dispara\^\i t de l'\'equation. Dans la suite du document, on
+qualifiera d'{\em injection forc\'ee} les cas o\`u on a $\Gamma>0$ et
+$\varphi_i\ne\varphi$.
+
+$\alpha_k$, $\beta_k$, $\alpha_\varepsilon$, $\beta_\varepsilon$ sont des termes
+sources utilisateur \'eventuels, conduisant \`a une implicitation partielle, impos\'es le cas
+\'ech\'eant par le sous-programme \fort{ustske}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+La r\'esolution se fait en trois \'etapes, afin de coupler partiellement les
+deux variables $k$ et $\varepsilon$. Pour simplifier, r\'e\'ecrivons le
+syst\`eme de la fa\c con suivante :
+
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+\rho\frac{\partial k}{\partial t} =
+D(k) + S_k(k,\varepsilon)+k\dive(\rho\vect{u})+\Gamma(k_i-k)+\alpha_k k +\beta_k\\
+\displaystyle
+\rho\frac{\partial \varepsilon}{\partial t} =
+D(\varepsilon) + S_\varepsilon(k,\varepsilon)
++\varepsilon\dive(\rho\vect{u})
++\Gamma(\varepsilon_i-\varepsilon)+\alpha_\varepsilon \varepsilon +\beta_\varepsilon
+\end{array}\right.
+\end{equation}
+
+$D$ est l'op\'erateur de convection/diffusion.
+$S_k$ (resp. $S_\varepsilon$) est le terme source de $k$ (resp. $\varepsilon$).
+
+\minititre{Premi\`ere phase : bilan explicite}
+
+On r\'esout le bilan explicite :
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+\rho^{(n)}\frac{k_e-k^{(n)}}{\Delta t} =
+D(k^{(n)}) + S_k(k^{(n)},\varepsilon^{(n)})
++k^{(n)}\dive(\rho\vect{u})+\Gamma(k_i-k^{(n)})+\alpha_k k^{(n)} +\beta_k\\
+\displaystyle
+\rho^{(n)}\frac{\varepsilon_e-\varepsilon^{(n)}}{\Delta t} =
+D(\varepsilon^{(n)}) + S_\varepsilon(k^{(n)},\varepsilon^{(n)})
++\varepsilon^{(n)}\dive(\rho\vect{u})
++\Gamma(\varepsilon_i-\varepsilon^{(n)})
++\alpha_\varepsilon \varepsilon^{(n)} +\beta_\varepsilon
+\end{array}\right.
+\end{equation}
+
+(le terme en $\Gamma$ n'est pris en compte que dans le cas de l'injection forc\'ee)
+
+\minititre{Deuxi\`eme phase : couplage des termes sources}
+
+On implicite les termes sources de mani\`ere coupl\'ee :
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+\rho^{(n)}\frac{k_{ts}-k^{(n)}}{\Delta t} =
+D(k^{(n)}) + S_k(k_{ts},\varepsilon_{ts})
++k^{(n)}\dive(\rho\vect{u})+\Gamma(k_i-k^{(n)})+\alpha_k k^{(n)} +\beta_k\\
+\displaystyle
+\rho^{(n)}\frac{\varepsilon_{ts}-\varepsilon^{(n)}}{\Delta t} =
+D(\varepsilon^{(n)}) + S_\varepsilon(k_{ts},\varepsilon_{ts})
++\varepsilon^{(n)}\dive(\rho\vect{u})
++\Gamma(\varepsilon_i-\varepsilon^{(n)})
++\alpha_\varepsilon \varepsilon^{(n)} +\beta_\varepsilon
+\end{array}\right.
+\end{equation}
+soit
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+\rho^{(n)}\frac{k_{ts}-k^{(n)}}{\Delta t} =
+\rho^{(n)}\frac{k_e-k^{(n)}}{\Delta t}
++S_k(k_{ts},\varepsilon_{ts})-S_k(k^{(n)},\varepsilon^{(n)})\\
+\displaystyle
+\rho^{(n)}\frac{\varepsilon_{ts}-\varepsilon^{(n)}}{\Delta t} =
+\rho^{(n)}\frac{\varepsilon_e-\varepsilon^{(n)}}{\Delta t}
++S_\varepsilon(k_{ts},\varepsilon_{ts})-S_\varepsilon(k^{(n)},\varepsilon^{(n)})
+\end{array}\right.
+\end{equation}
+
+Le terme en $\dive(\rho\vect{u})$ n'est pas implicit\'e car il est li\'e au
+terme $D$ pour assurer que la matrice d'implicitation sera \`a diagonale
+dominante. Le terme en $\Gamma$ et les termes sources utilisateur ne sont
+pas implicit\'es non plus, mais ils le seront dans la troisi\`eme phase.
+
+Et on \'ecrit (pour $\varphi=k$ ou $\varepsilon$)
+\begin{equation}
+S_\varphi(k_{ts},\varepsilon_{ts})-S_\varphi(k^{(n)},\varepsilon^{(n)})
+=(k_{ts}-k^{(n)})
+\left.\frac{\partial S_\varphi}{\partial k}\right|_{k^{(n)},\varepsilon^{(n)}}
++(\varepsilon_{ts}-\varepsilon^{(n)})
+\left.\frac{\partial S_\varphi}{\partial \varepsilon}\right|_{k^{(n)},\varepsilon^{(n)}}
+\end{equation}
+
+On r\'esout donc finalement le syst\`eme $2\times 2$ :
+\begin{equation}
+\left(\begin{array}{cc}
+\displaystyle \frac{\rho^{(n)}}{\Delta t}
+-\left.\frac{\partial S_k}{\partial k}\right|_{k^{(n)},\varepsilon^{(n)}}
+&\displaystyle
+-\left.\frac{\partial S_k}{\partial \varepsilon}\right|_{k^{(n)},\varepsilon^{(n)}}\\
+\displaystyle
+-\left.\frac{\partial S_\varepsilon}{\partial k}\right|_{k^{(n)},\varepsilon^{(n)}}
+&\displaystyle
+\displaystyle \frac{\rho^{(n)}}{\Delta t}
+-\left.\frac{\partial S_\varepsilon}{\partial \varepsilon}\right|_{k^{(n)},\varepsilon^{(n)}}
+\end{array}\right)
+\left(\begin{array}{c}
+(k_{ts}-k^{(n)})\\(\varepsilon_{ts}-\varepsilon^{(n)})
+\end{array}\right)
+=\left(\begin{array}{c}
+\displaystyle\rho^{(n)}\frac{k_e-k^{(n)}}{\Delta t}\\
+\displaystyle\rho^{(n)}\frac{\varepsilon_e-\varepsilon^{(n)}}{\Delta t}
+\end{array}\right)
+\end{equation}
+
+\vspace*{0.2cm}
+
+\minititre{Troisi\`eme phase : implicitation de la convection/diffusion}
+
+On r\'esout le syst\`eme :
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+\rho^{(n)}\frac{k^{(n+1)}-k^{(n)}}{\Delta t} =
+D(k^{(n+1)}) + S_k(k_{ts},\varepsilon_{ts})
++k^{(n+1)}\dive(\rho\vect{u})+\Gamma(k_i-k^{(n+1)})\\
+\multicolumn{1}{r}{+\alpha_k k^{(n+1)} +\beta_k}\\
+\displaystyle
+\rho^{(n)}\frac{\varepsilon^{(n+1)}-\varepsilon^{(n)}}{\Delta t} =
+D(\varepsilon^{(n+1)}) + S_\varepsilon(k_{ts},\varepsilon_{ts})
++\varepsilon^{(n+1)}\dive(\rho\vect{u})
++\Gamma(\varepsilon_i-\varepsilon^{(n+1)})\\
+\multicolumn{1}{r}{+\alpha_\varepsilon \varepsilon^{(n+1)} +\beta_\varepsilon}
+\end{array}\right.
+\end{equation}
+soit
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+\rho^{(n)}\frac{k^{(n+1)}-k^{(n)}}{\Delta t} =
+D(k^{(n+1)})-D(k^{(n)})+\rho^{(n)}\frac{k_{ts}-k^{(n)}}{\Delta t}
++(k^{(n+1)}-k^{(n)})\dive(\rho\vect{u})\\
+\multicolumn{1}{r}{-\Gamma(k^{(n+1)}-k^{(n)})+\alpha_k(k^{(n+1)}-k^{(n)})}\\
+\displaystyle
+\rho^{(n)}\frac{\varepsilon^{(n+1)}-\varepsilon^{(n)}}{\Delta t} =
+D(\varepsilon^{(n+1)})-D(\varepsilon^{(n)})
++\rho^{(n)}\frac{\varepsilon_{ts}-\varepsilon^{(n)}}{\Delta t}
++(\varepsilon^{(n+1)}-\varepsilon^{(n)})\dive(\rho\vect{u})\\
+\multicolumn{1}{r}{-\Gamma(\varepsilon^{(n+1)}-\varepsilon^{(n)})
++\alpha_\varepsilon(\varepsilon^{(n+1)}-\varepsilon^{(n)})}
+\end{array}\right.
+\end{equation}
+
+Le terme en $\Gamma$ n'est l\`a encore pris en compte que dans le cas de
+l'injection forc\'ee. Le terme en $\alpha$ n'est pris en compte que si $\alpha$ est
+n\'egatif, pour \'eviter d'affaiblir la diagonale de la matrice qu'on va
+inverser.
+
+
+\minititre{Pr\'ecisions sur le couplage}
+Lors de la phase de couplage, afin de privil\'egier la stabilit\'e et la
+r\'ealisabilit\'e du r\'esultat, tous les termes ne sont pas pris en
+compte. Plus pr\'ecis\'ement, on peut \'ecrire :
+
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle
+S_k =
+\rho C_\mu\frac{k^2}{\varepsilon}\left(\tilde{\mathcal{P}}+\tilde{\mathcal{G}}\right)
+-\frac{2}{3}\rho k \dive(\vect{u})
+-\rho\varepsilon\\
+\displaystyle
+S_\varepsilon =
+\rho C_{\varepsilon_1} C_\mu k\left(\tilde{\mathcal{P}}
++(1-C_{\varepsilon_3})\tilde{\mathcal{G}}\right)
+-\frac{2}{3}C_{\varepsilon_1}\rho \varepsilon \dive(\vect{u})
+-\rho C_{\varepsilon_2}\frac{\varepsilon^2}{k}
+\end{array}\right.
+\end{equation}
+
+en notant
+$\displaystyle\tilde{\mathcal{P}}
+= \left(\frac{\partial u_i}{\partial x_j} +
+\frac{\partial u_j}{\partial x_i}\right)\frac{\partial u_i}{\partial x_j}
+-\frac{2}{3}(\dive\vect{u})^2$\\
+et
+$\displaystyle\tilde{\mathcal{G}}
+= -\frac{1}{\rho\sigma_t}
+\frac{\partial\rho}{\partial x_i}g_i$
+
+On a donc en th\'eorie
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle \frac{\partial S_k}{\partial k}=
+2\rho C_\mu\frac{k}{\varepsilon}\left(\tilde{\mathcal{P}}+\tilde{\mathcal{G}}\right)
+-\frac{2}{3}\rho \dive(\vect{u})\\
+\displaystyle \frac{\partial S_k}{\partial \varepsilon}= -\rho\\
+\displaystyle \frac{\partial S_\varepsilon}{\partial k}=
+\rho C_{\varepsilon_1} C_\mu \left(\tilde{\mathcal{P}}
++(1-C_{\varepsilon_3})\tilde{\mathcal{G}}\right)
++\rho C_{\varepsilon_2}\frac{\varepsilon^2}{k^2}\\
+\displaystyle \frac{\partial S_\varepsilon}{\partial \varepsilon}=
+-\frac{2}{3}C_{\varepsilon_1}\rho \dive(\vect{u})
+-2\rho C_{\varepsilon_2}\frac{\varepsilon}{k}
+\end{array}\right.
+\end{equation}
+
+En pratique, on va chercher \`a assurer $k_{ts}>0$ et $\varepsilon_{ts}>0$. En se
+basant sur un calcul simplifi\'e, ainsi que sur le retour d'exp\'erience
+d'ESTET, on montre qu'il est pr\'ef\'erable de ne pas prendre en compte
+certains termes. Au final, on r\'ealise le couplage suivant :
+
+\begin{equation}
+\left(\begin{array}{cc}
+A_{11}&A_{12}\\
+A_{21}&A_{22}
+\end{array}\right)
+\left(\begin{array}{c}
+(k_{ts}-k^{(n)})\\(\varepsilon_{ts}-\varepsilon^{(n)})
+\end{array}\right)
+=\left(\begin{array}{c}
+\displaystyle\frac{k_e-k^{(n)}}{\Delta t}\\
+\displaystyle\frac{\varepsilon_e-\varepsilon^{(n)}}{\Delta t}
+\end{array}\right)
+\end{equation}
+avec
+\begin{equation}
+\left\{\begin{array}{l}
+\displaystyle A_{11}=\frac{1}{\Delta t}
+-2 C_\mu\frac{k^{(n)}}{\varepsilon^{(n)}}
+\Min\left[\left(\tilde{\mathcal{P}}+\tilde{\mathcal{G}}\right),0\right]
++\frac{2}{3}\Max\left[\dive(\vect{u}),0\right]\\
+\displaystyle A_{12}= 1\\
+\displaystyle A_{21}=
+- C_{\varepsilon_1} C_\mu \left(\tilde{\mathcal{P}}
++(1-C_{\varepsilon_3})\tilde{\mathcal{G}}\right)
+- C_{\varepsilon_2}\left(\frac{\varepsilon^{(n)}}{k^{(n)}}\right)^2\\
+\displaystyle A_{22}=\frac{1}{\Delta t}
++\frac{2}{3}C_{\varepsilon_1}\Max\left[\dive(\vect{u}),0\right]
++2 C_{\varepsilon_2}\frac{\varepsilon^{(n)}}{k^{(n)}}
+\end{array}\right.
+\end{equation}
+
+(par d\'efinition de $C_{\varepsilon_3}$,
+$\tilde{\mathcal{P}}+(1-C_{\varepsilon_3})\tilde{\mathcal{G}}$
+est toujours positif)
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\etape{Calcul du terme de production}
+On appelle trois fois \fort{grdcel} pour calculer les gradients de $u$, $v$ et
+$w$. Au final, on a \\
+$\displaystyle \var{TINSTK}=
+2\left(\frac{\partial u}{\partial x}\right)^2+
+2\left(\frac{\partial v}{\partial y}\right)^2+
+2\left(\frac{\partial w}{\partial z}\right)^2+
+\left(\frac{\partial u}{\partial y}+\frac{\partial v}{\partial x}\right)^2+
+\left(\frac{\partial u}{\partial z}+\frac{\partial w}{\partial x}\right)^2+
+\left(\frac{\partial v}{\partial z}+\frac{\partial w}{\partial y}\right)^2$\\
+et\\
+$\displaystyle \var{DIVU}=
+\frac{\partial u}{\partial x}+\frac{\partial v}{\partial y}
++\frac{\partial w}{\partial z}$
+
+(le terme $div(\vect{u})$ n'est pas calcul\'e par \fort{divmas}, pour
+correspondre exactement \`a la trace du tenseur des d\'eformations qui est
+calcul\'e pour la production)
+
+
+\etape{Lecture des termes sources utilisateur}
+Appel de \fort{ustske} pour charger les termes sources utilisateurs. Ils sont
+stock\'es dans les tableaux suivants :\\
+$\var{W7}=\Omega\beta_k$\\
+$\var{W8}=\Omega\beta_\varepsilon$\\
+$\var{DAM}=\Omega\alpha_k$\\
+$\var{W9}=\Omega\alpha_\varepsilon$
+
+Puis on ajoute le terme en $(div\vect{u})^2$ \`a \var{TINSTK}. On a donc \\
+$\var{TINSTK}=\tilde{\mathcal{P}}$
+
+\etape{Calcul du terme de gravit\'e}
+Calcul uniquement si $\var{IGRAKE}=1$.\\
+On appelle \fort{grdcel} pour \var{ROM}, avec comme conditions aux limites
+$\var{COEFA}=\var{ROMB}$ et \mbox{$\var{COEFB}=\var{VISCB}=0$}.\\
+$\var{PRDTUR}=\sigma_t$ est mis \`a 1 si on n'a pas de scalaire temp\'erature.
+
+$\tilde{\mathcal{G}}$ est calcul\'e et les termes sources sont mis \`a jour :\\
+$\var{TINSTK}=\tilde{\mathcal{P}}+\tilde{\mathcal{G}}$\\
+$\var{TINSTE}=\tilde{\mathcal{P}}+\Max\left[\tilde{\mathcal{G}},0\right]
+=\tilde{\mathcal{P}}+(1-C_{\varepsilon_3})\tilde{\mathcal{G}}$
+
+Si $\var{IGRAKE}=0$, on a simplement\\
+$\var{TINSTK}=\var{TINSTE}=\tilde{\mathcal{P}}$
+
+\etape{Calcul du terme d'accumulation de masse}
+On stocke
+$\displaystyle \var{W1}=\Omega\dive(\rho\vect{u})$
+calcul\'e par \fort{divmas} (pour correspondre aux termes de convection de la
+matrice).
+
+\etape{Calcul des termes sources explicites}
+On affecte les termes sources explicites de $k$ et $\varepsilon$ pour la
+premi\`ere \'etape.\\
+$\displaystyle\var{SMBRK}=\Omega\left(\mu_t(\tilde{\mathcal{P}}+\tilde{\mathcal{G}})
+-\frac{2}{3}\rho^{(n)} k^{(n)}\dive{\vect{u}}
+-\rho^{(n)} \varepsilon^{(n)}\right)+\Omega k^{(n)}\dive(\rho\vect{u})$\\
+$\displaystyle\var{SMBRE}=\Omega\frac{\varepsilon^{(n)}}{k^{(n)}}
+\left(C_{\varepsilon_1}\left(
+\mu_t(\tilde{\mathcal{P}}+(1-C_{\varepsilon_3})\tilde{\mathcal{G}})
+-\frac{2}{3}\rho^{(n)} k^{(n)}\dive{\vect{u}}\right)
+-C_{\varepsilon_2}\rho^{(n)}\varepsilon^{(n)}\right)
++\Omega\varepsilon^{(n)}\dive(\rho\vect{u})$
+
+soit $\var{SMBRK}=\Omega S_k^{(n)}+\Omega k^{(n)}\dive(\rho\vect{u})$
+et $\var{SMBRE}=\Omega S_\varepsilon^{(n)}+\Omega\varepsilon^{(n)}\dive(\rho\vect{u})$.
+
+
+\etape{Calcul des termes sources utilisateur}
+On ajoute les termes sources utilisateur explicites \`a \var{SMBRK} et
+\var{SMBRE}, soit :\\
+$\var{SMBRK}=\Omega S_k^{(n)}+\Omega k^{(n)}\dive(\rho\vect{u})+\Omega\alpha_k k^{(n)} +\Omega\beta_k$\\
+$\var{SMBRE}=\Omega S_\varepsilon^{(n)}+\Omega\varepsilon^{(n)}\dive(\rho\vect{u})
++\Omega\alpha_\varepsilon \varepsilon^{(n)} +\Omega\beta_\varepsilon$
+
+Les tableaux \var{W7} et \var{W8} sont lib\'er\'es, \var{DAM} et \var{W9} sont
+conserv\'es pour \^etre utilis\'es dans la troisi\`eme phase de r\'esolution.
+
+\etape{Calcul des termes de convection/diffusion explicites}
+\fort{bilsc2} est appel\'e deux fois, pour $k$ et pour $\varepsilon$, afin
+d'ajouter \`a \var{SMBRK} et \var{SMBRE} les termes de convection/diffusion
+explicites $D(k^{(n)})$ et $D(\varepsilon^{(n)})$. Ces termes sont d'abord
+stock\'es dans \var{W7} et \var{W8}, pour \^etre conserv\'es et r\'eutilis\'es
+dans la troisi\`eme phase de r\'esolution.
+
+
+\etape{Termes source de masse}
+Dans le cas d'une injection forc\'ee de mati\`ere, on passe deux fois dans
+\fort{catsma} pour ajouter les termes en
+$\Omega \Gamma (k_i-k^{(n)})$ et
+$\Omega \Gamma (\varepsilon_i-\varepsilon^{(n)})$ \`a \var{SMBRK} et
+\var{SMBRE}. La partie implicite ($\Omega\Gamma$) est stock\'ee dans les
+variables \var{W2} et \var{W3}, qui seront utilis\'ees lors de la troisi\`eme
+phase (les deux variables sont bien n\'ecessaires, au cas o\`u on aurait une
+injection forc\'ee sur $k$ et pas sur $\varepsilon$, par exemple).
+
+\etape{Fin de la premi\`ere phase}
+Ceci termine la premi\`ere phase. On a \\
+$\displaystyle \var{SMBRK}=\Omega \rho^{(n)}\frac{k_e-k^{(n)}}{\Delta t}$\\
+$\displaystyle \var{SMBRE}=\Omega \rho^{(n)}\frac{\varepsilon_e-\varepsilon^{(n)}}{\Delta t}$
+
+\etape{Phase de couplage}
+(uniquement si $\var{IKECOU}=1$)
+
+On renormalise \var{SMBRK} et \var{SMBRE} qui deviennent les seconds membres du
+syst\`eme de couplage.\\
+$\displaystyle \var{SMBRK}=\frac{1}{\Omega\rho^{(n)}}\var{SMBRK}
+=\frac{k_e-k^{(n)}}{\Delta t}$\\
+$\displaystyle \var{SMBRE}=\frac{1}{\Omega\rho^{(n)}}\var{SMBRE}
+=\frac{\varepsilon_e-\varepsilon^{(n)}}{\Delta t}$\\
+et $\displaystyle \var{DIVP23}=\frac{2}{3}\Max\left[\dive(\vect{u}),0\right]$.
+
+On remplit la matrice de couplage\\
+$\displaystyle \var{A11}=\frac{1}{\Delta t}
+-2 C_\mu\frac{k^{(n)}}{\varepsilon^{(n)}}
+\Min\left[\left(\tilde{\mathcal{P}}+\tilde{\mathcal{G}}\right),0\right]
++\frac{2}{3}\Max\left[\dive(\vect{u}),0\right]$\\
+$\displaystyle \var{A12}= 1$\\
+$\displaystyle \var{A21}=
+- C_{\varepsilon_1} C_\mu \left(\tilde{\mathcal{P}}
++(1-C_{\varepsilon_3})\tilde{\mathcal{G}}\right)
+- C_{\varepsilon_2}\left(\frac{\varepsilon^{(n)}}{k^{(n)}}\right)^2$\\
+$\displaystyle \var{A22}=\frac{1}{\Delta t}
++\frac{2}{3}C_{\varepsilon_1}\Max\left[\dive(\vect{u}),0\right]
++2 C_{\varepsilon_2}\frac{\varepsilon^{(n)}}{k^{(n)}}$
+
+On inverse le syst\`eme $2\times 2$, et on r\'ecup\`ere :\\
+$\displaystyle \var{DELTK}=k_{ts}-k^{(n)}$\\
+$\displaystyle \var{DELTE}=\varepsilon_{ts}-\varepsilon^{(n)}$
+
+\etape{Fin de la deuxi\`eme phase}
+On met \`a jour les variables \var{SMBRK} et \var{SMBRE}.\\
+$\displaystyle \var{SMBRK}=\Omega \rho^{(n)}\frac{k_{ts}-k^{(n)}}{\Delta t}$\\
+$\displaystyle \var{SMBRE}=
+\Omega \rho^{(n)}\frac{\varepsilon_{ts}-\varepsilon^{(n)}}{\Delta t}$
+
+Dans le cas o\`u on ne couple pas ($\var{IKECOU}=0$), ces deux variables gardent
+la m\^eme valeur qu'\`a la fin de la premi\`ere \'etape.
+
+\etape{Calcul des termes implicites}
+On retire \`a \var{SMBRK} et \var{SMBRE} la partie en convection diffusion au
+temps $n$, qui \'etait stock\'ee dans \var{W7} et \var{W8}.\\
+$\displaystyle \var{SMBRK}=\Omega \rho^{(n)}\frac{k_{ts}-k^{(n)}}{\Delta t}
+-\Omega D(k^{(n)})$\\
+$\displaystyle \var{SMBRE}=
+\Omega \rho^{(n)}\frac{\varepsilon_{ts}-\varepsilon^{(n)}}{\Delta t}
+-\Omega D(\varepsilon^{(n)})$
+
+
+On calcule les termes implicites, hors convection/diffusion, qui correspondent
+\`a la diagonale de la matrice.\\
+$\displaystyle \var{TINSTK}=\frac{\Omega \rho^{(n)}}{\Delta t}
+-\Omega\dive(\rho\vect{u})+\Omega\Gamma+\Omega\Max[-\alpha_k,0]$\\
+$\displaystyle \var{TINSTE}=\frac{\Omega \rho^{(n)}}{\Delta t}
+-\Omega\dive(\rho\vect{u})+\Omega\Gamma+\Omega\Max[-\alpha_\varepsilon,0]$\\
+($\Gamma$ n'est pris en compte qu'en injection forc\'ee, c'est-\`a-dire qu'il
+est forc\'ement positif et ne risque pas d'affaiblir la diagonale de la matrice).
+
+\etape{R\'esolution finale}
+On passe alors deux fois dans \fort{codits}, pour $k$ et $\varepsilon$,
+pour r\'esoudre les \'equations du type :
+
+$\var{TINST}\times(\varphi^{(n+1)}-\varphi^{(n)}) = D(\varphi^{(n+1)})+\var{SMBR}$.
+
+\etape{clipping final}
+On passe enfin dans la routine \fort{clipke} pour faire un clipping \'eventuel
+de $k^{(n+1)}$ et $\varepsilon^{(n+1)}$.
+
+
+
diff --git a/doc/theory/turrij.tex b/doc/theory/turrij.tex
new file mode 100644
index 0000000..2310ef3
--- /dev/null
+++ b/doc/theory/turrij.tex
@@ -0,0 +1,955 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{turrij}
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Le but de ce sous-programme est de r\'esoudre le syst\`eme des \'equations des
+tensions de Reynolds et de la dissipation $\varepsilon$ de mani\`ere totalement d\'ecoupl\'ee dans le cadre de l'utilisation du mod\`ele $R_{ij}-\varepsilon$ LRR\footnote{la description du SSG est pr�vue pour une version ult�rieure de la documentation} (option $\var{ITURB}=30$ dans \fort{usini1}).\\
+Le tenseur sym\'etrique des tensions de Reynolds est not\'e $\tens{R}$. Les composantes de ce tenseur repr\'esentent le moment d'ordre deux de la vitesse : $R_{ij} = \overline{u_iu_j}$.
+
+Pour chaque composante $R_{ij}$, on r\'esout :
+
+\begin{equation}
+\begin{array}{ll}
+\displaystyle
+\rho\frac{\partial R_{ij}}{\partial t} +
+\dive(\rho \vect{u}\,R_{ij} - \mu\,\grad{R_{ij}}) = &
+\mathcal{P}_{ij} + \mathcal{G}_{ij}+\Phi_{ij} + \it{d}_{ij} - \varepsilon_{ij} +
+R_{ij}\,\dive{(\rho \vect{u})} \\
+& \displaystyle + \Gamma(R^{\,in}_{ij}-R_{ij}) + \alpha_{R_{ij}} R_{ij} + \beta_{R_{ij}}
+\end{array}
+\end{equation}
+
+$\tens{\mathcal{P}}$ est le tenseur de production par cisaillement moyen :
+
+\begin{equation}
+\displaystyle \mathcal{P}_{ij} = \displaystyle -\rho \left[ R_{ik} \frac{\partial u_j}{\partial x_k} + R_{jk} \frac{\partial u_i}{\partial x_k} \right]
+\end{equation}
+
+
+$\tens{\mathcal{G}}$ est le tenseur de production par gravit\'e :
+
+\begin{equation}
+\displaystyle
+\mathcal{G}_{ij}= \left[ G_{ij} - C_3 (G_{ij}-\frac{1}{3} \delta_{ij} G_{kk}) \right]
+\end{equation}
+
+avec
+
+\begin{equation}
+\left\{
+\begin{array} {c}
+\displaystyle G_{ij} = - \frac{3}{2} \frac{C_{\mu}}{\sigma_{t}} \frac{k}{\varepsilon} (r_i g_j + r_j g_i) \\
+\displaystyle k = \frac{1}{2} R_{ll} \\
+\displaystyle r_i = R_{ik} \frac{\partial \rho}{\partial x_k}
+\end{array}\right.
+\end{equation}
+
+Dans ce qui pr\'ec\`ede, $k$ repr\'esente l'\'energie turbulente\footnote{Les
+sommations se font sur l'indice $l$ et on applique plus
+g\'en\'eralement la convention de sommation d'Einstein.}, $g_i$ la composante de
+la gravit\'e dans la direction $i$, $\sigma_{t}$ le nombre de Prandlt turbulent et $C_{\mu}$, $C_3$ des constantes d\'efinies dans Tab.~\ref{Base_Turrij_table_Cstes}.
+
+
+$\tens{\Phi}$ est le terme de corr\'elations pression-d\'eformation. Il est mod\'elis\'e avec le terme de dissipation $\tens{\varepsilon}$ de la mani\`ere suivante :
+
+\begin{equation}
+\displaystyle
+\Phi_{ij} - [\varepsilon_{ij}- \frac{2}{3} \rho \ \delta_{ij} \varepsilon] = \phi_{ij,1} + \phi_{ij,2} + \phi_{ij,w}
+\end{equation}
+
+Il en r\'esulte :
+
+\begin{equation}
+\displaystyle
+\Phi_{ij} - \varepsilon_{ij} = \phi_{ij,1} + \phi_{ij,2} + \phi_{ij,w} -\frac{2}{3} \rho \ \delta_{ij} \varepsilon
+\end{equation}
+
+Le terme $\phi_{ij,1}$ est un terme "lent" de retour \`a l'isotropie. Il est donn\'e par :
+
+\begin{equation}
+\displaystyle
+\phi_{ij,1} = -\rho\,C_1 \frac{\varepsilon}{k} (R_{ij} - \frac{2}{3} k \delta_{ij})
+\end{equation}
+
+Le terme $\phi_{ij,2}$ est un terme "rapide" d'isotropisation de la production. Il est donn\'e par :
+\begin{equation}
+\displaystyle
+\phi_{ij,2} = -\rho\,C_2 (\mathcal{P}_{ij} - \frac{2}{3} \mathcal{P} \delta_{ij})
+\end{equation}
+
+avec,
+
+$$\displaystyle \mathcal{P} = \frac{1}{2} \mathcal{P}_{kk}$$
+
+Le terme $\phi_{ij,w}$ est appel\'e "terme d'echo de paroi". Il n'est pas
+utilis\'e par d\'efaut dans \CS, mais peut \^etre activ\'e avec $\var{IRIJEC} = 1$. Si $y$ repr\'esente la distance \`a la paroi :
+
+\begin{equation}
+\begin{array} {ll}
+\displaystyle
+\phi_{ij,w} = &
+\displaystyle \rho\,C'_1 \frac{k}{\varepsilon} \left[ R_{km} n_k n_m \delta_{ij} -
+\frac{3}{2} R_{ki} n_k n_j -
+\frac{3}{2} R_{kj} n_k n_i \right] f(\frac{l}{y}) \\
+&
++\displaystyle \rho\,C'_2 \left[ \phi_{km,2} n_k n_m \delta_{ij} -
+\frac{3}{2} \phi_{ki,2} n_k n_j -
+\frac{3}{2} \phi_{kj,2} n_k n_i \right] f(\frac{l}{y})
+\end{array}
+\end{equation}
+
+$f$ est une fonction d'amortissement construite pour valoir 1 en paroi et tendre
+vers 0 en s'\'eloignant des parois.\\
+La longueur $l$ repr\'esente
+$\displaystyle\frac{k^{\,\frac{3}{2}}}{\varepsilon}$, caract\'eristique de la turbulence. On prend :
+
+\begin{equation}
+f(\frac{l}{y}) = min(1, \ C^{\,0,75}_{\mu} \
+\frac{k^{\,\frac{3}{2}}}{\varepsilon\ \kappa y})
+\end{equation}
+
+
+$\it{d}_{ij}$ est un terme de diffusion turbulente\footnote{Dans la litt\'erature, ce terme contient en g\'en\'eral la dissipation par viscosit\'e mol\'eculaire.} qui vaut :
+
+\begin{equation}
+\it{d}_{ij} = C_{S} \frac{\partial}{\partial x_k} (\rho \frac{k}{\varepsilon} R_{km} \frac{\partial R_{ij}}{\partial x_m})
+\end{equation}
+
+On notera par la suite $\displaystyle \tens{A} = C_S\,\rho\,\frac{k}{\varepsilon}\,\tens{R}$. Ainsi, $\displaystyle d_{ij} = \dive(\,\tens{A}\,\grad(R_{ij}))$ est une diffusion avec un coefficient tensoriel.
+
+Le terme de dissipation turbulente $\tens{\varepsilon}$ est trait\'e dans ce qui pr\'ec\`ede avec le terme $\tens{\Phi}$.
+
+$\Gamma$ est le terme source de masse\footnote{Dans ce cas, l'\'equation de continuit\'e s'\'ecrit : $\displaystyle \frac{\partial \rho}{\partial t} + \dive{(\rho \vect{u})} = \Gamma$.}, $R^{\,in}_{ij}$ est la valeur de $R_{ij}$ associ\'ee \`a la masse inject\'ee ou retir\'ee.
+
+($\alpha_{R_{ij}}\,R_{ij} + \beta_{R_{ij}}$) repr\'esente le terme source
+utilisateur (sous-programme \fort{ustsri}) \'eventuel avec une d\'ecomposition
+permettant d'impliciter la partie $\alpha_{R_{ij}}\,R_{ij}$ si $\alpha_{R_{ij}} \geqslant 0$.
+
+De m\^eme, on r\'esout une \'equation de convection/diffusion/termes sources pour la dissipation $\varepsilon$. Cette \'equation est tr\`es semblable \`a celle du mod\`ele $k-\varepsilon$ (voir \fort{turbke}), seuls les termes de viscosit\'e turbulente et de gravit\'e changent. On r\'esout :
+
+\begin{equation}
+\begin{array} {ll}
+\displaystyle \rho\frac{\partial \varepsilon}{\partial t} +
+\dive\left[\rho \vect{u}\,\varepsilon-
+(\mu \grad{\varepsilon})\right] = &
+\displaystyle \it{d}_{\,\varepsilon}
++ C_{\varepsilon_1}\frac{\varepsilon}{k}\left[\mathcal{P}
++\mathcal{G}_{\varepsilon}\right]
+-\rho C_{\varepsilon_2}\frac{\varepsilon^2}{k}
++\varepsilon\dive(\rho\vect{u})\\
+&
+\displaystyle
++\Gamma(\varepsilon^{\,in}-\varepsilon)
++\alpha_\varepsilon \varepsilon +\beta_\varepsilon
+\end{array}
+\end{equation}
+
+
+$\it{d}_{\,\varepsilon}$ est le terme de diffusion turbulente :
+\begin{equation}
+\displaystyle
+\it{d}_{\,\varepsilon} = C_{\varepsilon} \displaystyle \frac{\partial}{\partial x_k} \left( \rho \frac{k}{\varepsilon} R_{km} \frac{\partial \varepsilon}{\partial x_m} \right)
+\end{equation}
+On notera par la suite $\tens{A'} = \displaystyle \rho \,C_{\varepsilon} \frac{k}{\varepsilon} \tens{R}$.
+Le terme de diffusion turbulente est donc mod\'elis\'e par : $$\it{d}_{\,\varepsilon} =
+\dive(\tens{A'}\,\grad(\varepsilon))$$
+La viscosit\'e turbulente usuelle ($\nu_t$) en mod\`ele $k-\varepsilon$ est remplac\'ee par le tenseur visqueux~$\tens{A'}$.
+
+$\mathcal{P}$ est le terme de production par cisaillement moyen :
+$\mathcal{P} =\displaystyle \frac{1}{2} \mathcal{P}_{kk}$. Ce terme est
+mod\'elis\'e avec la notion de viscosit\'e turbulente dans le cadre du mod\`ele
+$k-\varepsilon$. Dans le cas pr\'esent, il est calcul\'e \`a l'aide des tensions
+de Reynolds (\`a partir de $\mathcal{P}_{ij}$).
+
+$\mathcal{G}_{\varepsilon}$ est le terme de production des effets de gravit\'e pour la variable $\varepsilon$.
+\begin{equation}
+\mathcal{G}_{\varepsilon} = max(0,\frac{1}{2}G_{kk})
+\end{equation}
+\begin{table}
+{\scriptsize
+\begin{center}
+\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}
+\hline
+$C_\mu$ & $C_{\varepsilon}$ & $C_{\varepsilon_1}$ &
+$C_{\varepsilon_2}$ & $C_1$ & $C_2$ & $C_3$ & $C_S$
+& $C'_1$ & $C'_2$ \\
+\hline
+$0,09$ & $ 0,18$ & $1,44$ & $1,92$ & $1,8$ & $0,6$ & $0,55$ & $0,22$ & $0,5$ &
+$0,3$ \\
+\hline
+\end{tabular}
+\end{center}
+}
+\caption{D\'efinition des constantes utilis\'ees.}\label{Base_Turrij_table_Cstes}
+\end{table}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+La r\'esolution se fait en d\'ecouplant totalement les tensions de Reynolds
+entre elles et la dissipation $\varepsilon$. On r\'esout ainsi une \'equation de
+convection/diffusion/termes sources pour chaque variable. Les variables sont
+r\'esolues dans l'ordre suivant : $R_{11}$, $R_{22}$, $R_{33}$, $R_{12}$,
+$R_{13}$, $R_{23}$ et $ \varepsilon$. L'ordre de la r\'esolution n'est pas
+important puisque l'on a opt\'e pour une r\'esolution totalement d\'ecoupl\'ee
+en n'implicitant que les termes pouvant \^etre lin\'earis\'es par rapport \`a la
+variable courante\footnote{En effet, aucune variable n'est actualis\'ee pour la r\'esolution de la suivante.}.
+
+Les \'equations sont r\'esolues \`a l'instant $n+1$.
+\subsection{\bf Variables tensions de Reynolds}
+Pour chaque composante $R_{ij}$, on \'ecrit :
+\begin{equation}\label{Base_Turrij_Eq_Temp_Rij}
+\begin{array}{ll}
+\displaystyle
+\rho^n\ \frac {R_{ij}^{\,n+1}-R_{ij}^{\,n}}{\Delta t^n}
++\ \dive\left[ (\rho \underline{u})^{n} R_{ij}^{\,n+1}
+- \mu^n\ \grad{R}_{ij}^{\,n+1} \right]
+= &
+\displaystyle
+\mathcal{P}^{\,n}_{ij}
++ \mathcal{G}^n_{ij} \\
+&
+\displaystyle
++ \phi^{\,n,n+1}_{ij,1} + \phi^{\,n}_{ij,2} + \phi^{\,n}_{ij,w} \\
+&
+\displaystyle
++ \text{\it{d}}^{\,n,n+1}_{ij}
+- \displaystyle \frac{2}{3} \rho^n \varepsilon^n \delta_{ij}
++ R^{\,n+1}_{ij} \dive{(\rho \underline{u})^n} \\
+&
+\displaystyle
++ \Gamma(R^{\,in}_{ij} - R^{\,n+1}_{ij}) \\
+&
+\displaystyle
++ \alpha^n_{R_{ij}} R^{\,n+1}_{ij} + \beta^n_{R_{ij}}
+\end{array}
+\end{equation}
+$\mu^n$ est la viscosit\'e mol\'eculaire\footnote{La viscosit\'e peut
+d\'ependre \'eventuellement de la temp\'erature ou d'autres variables.}.\\
+L'indice $(\,n,n+1)$ est relatif \`a une semi implicitation des termes (voir ci-dessous). Quand seul l'indice $(n)$ est utilis\'e, il suffit de reprendre l'expression des termes et de consid\'erer que toutes les variables sont explicites.
+
+Dans le terme $\phi^{n,n+1}_{ij,1}$ donn\'e ci-dessous, la tension de Reynolds
+ $R_{ij}$ est implicite (les tensions diagonales apparaissent aussi dans l'\'energie
+turbulente $k$). Ainsi :
+\begin{equation}
+\displaystyle
+\phi^{\,n,n+1}_{ij,1} = -\rho^n \,C_1\,\frac{\varepsilon^n}{k^n}\left[
+(1-\frac{\delta_{ij}}{3}) R^{\,n+1}_{ij}- \delta_{ij} \frac{2}{3} (k^n-\frac{1}{2} R^{\,n}_{ii}) \right]
+\end{equation}
+
+Le terme de diffusion turbulente $\tens{\it{d}}$ s'\'ecrit : $\it{d}_{ij} = \dive{\left[ \tens{A}\,\grad{R}_{ij} \right]}$.
+Le tenseur $\tens{A}$ est toujours explicite.
+En int\'egrant sur un volume de contr\^ole (cellule) $\Omega_l$, le terme $\tens{\it{d}}$ de diffusion turbulente de $R_{ij}$ s'\'ecrit :
+
+\begin{equation}
+\displaystyle\int_{\Omega_l} \it{d}^{\,n,n+1}_{ij}\ d\Omega =
+\sum\limits_{m\in
+Vois(l)} \left[
+\tens{A}^n\,\grad{R}^{\,n+1}_{ij} \right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}
+\end{equation}
+
+$\vect{n}_{\,lm}$ est la normale unitaire \`a la face\footnote{La notion de
+face purement interne ou de bord n'est pas explicit\'ee ici, pour all\'eger l'expos\'e. Pour \^etre rigoureux et homog\`ene avec les notations
+adopt\'ees, il faudrait distinguer $ m\in {Vois(l)} $ et $ m\in {\gamma_b(l)}$.}
+$ \partial \Omega_{\,lm} = \Gamma_{\,lm}$ de la fronti\`ere
+ $\partial \Omega_{\,l} = \underset{\text{\it m}}{\cup}\ \partial
+\Omega_{\,lm}$ de $\Omega_l$, face d\'esign\'ee par abus par $lm$ et $S_{\,lm}$ sa surface associ\'ee.
+
+On d\'ecompose $\tens{A}^n$ en partie diagonale $\tens{D}^n$ et
+extra-diagonale $\tens{E}^n$ :\\
+$$\tens{A}^n =\tens{D}^n + \tens{E}^n$$
+Ainsi,
+\begin{equation}
+\begin{array}{l}
+\displaystyle \int_{\Omega_l} \it{d}_{ij}\ d\Omega =
+\sum\limits_{m\in
+Vois(l)} \underbrace{ \left[
+\tens{D}^n\,\grad{R}_{ij}\right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm} }
+_{\text {partie diagonale}}\\
++ \displaystyle\sum\limits_{m\in
+Vois(l)} \underbrace{ \left[
+\tens{E}^n\,\grad{R}_{ij} \right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}\ }
+_{\text {partie extra-diagonale}}
+\end{array}
+\end{equation}
+
+La partie extra-diagonale sera prise totalement explicite et interviendra donc
+dans l'expression regroupant les termes purement explicites $f_s^{\,exp}$ du
+second membre de \fort{codits}.\\
+Pour la partie diagonale, on introduit la composante normale du gradient de la
+variable principale $R_{ij}$. Cette contribution normale sera trait\'ee en
+implicite pour la variable et interviendra \`a la fois dans l'expression de la matrice simplifi\'ee du syst\`eme r\'esolu par \fort{codits} et dans
+le second membre trait\'e par \fort{bilsc2}. La
+contribution tangentielle sera, elle, purement explicite et donc prise en compte
+dans $f_s^{\,exp}$ intervenant dans le second membre de \fort{codits}.\\
+On a :
+\begin{equation}
+\displaystyle
+\grad{R}_{ij} = \grad{R}_{ij} - (\grad{R}_{ij}\,.\,\vect{n}_{\,lm})\,\vect{n}_{\,lm} + (\grad{R}_{ij}\,.\,\vect{n}_{\,lm})\,\vect{n}_{\,lm}
+\end{equation}
+
+Comme $$\left[ \tens{D}^n\,\left[ (\grad{R}_{ij}\,.\,\vect{n}_{\,lm})\,\vect{n}_{\,lm}
+\right] \right]\,.\,\vect{n}_{\,lm} = \gamma^n_{\,lm} (\grad{R}_{ij}\,.\,\vect{n}_{\,lm})$$
+ avec :
+$$\gamma^n_{\,lm} = (D^n_{11})\,n^2_{\,1,\,lm} + (D^n_{22})\,n^2_{\,2,\,lm} +
+(D^n_{33})\,n^2_{\,3,\,lm}$$
+ on peut traiter ce terme $\gamma^n_{\,lm}$ comme une diffusion avec un
+coefficient de diffusion ind\'ependant de la direction.\\
+
+Finalement, on \'ecrit :
+\begin{equation}
+\begin{array} {lll}
+&\displaystyle\int_{\Omega_l} \it{d}_{ij}^{\,n,n+1}\ d\Omega =\\
+&\displaystyle
++ \sum\limits_{m\in
+Vois(l)} \left[\ \tens{E}^n\,\grad{R}^{\,n}_{ij} \right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}\\
+&+ \sum\limits_{m\in Vois(l)} \left[\
+\tens{D}^n\,\grad{R}^{\,n}_{ij} \right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}\\
+& - \sum\limits_{m\in Vois(l)} \gamma^n_{\,lm} \left(
+\grad{R}^{\,n}_{ij}\,.\,\vect{n}_{\,lm} \right) S_{\,lm} + \sum\limits_{m\in
+Vois(l)} \gamma^n_{\,lm} \left( \grad{R}^{\,n+1}_{ij}\,.\,\vect{n}_{\,lm} \right) S_{\,lm}
+\end{array}
+\end{equation}
+Les trois premiers termes sont totalement explicites et correspondent \`a la
+discr\'etisation de l'op\'erateur continu :
+$$\dive(\,\tens{E}^n\,\grad{R}^{\,n}_{ij}) + \dive(\,\tens{D}^n\,[\,\grad{R}^{\,n}_{ij} - ( \grad{R}^{\,n}_{ij}\,.\,\vect{n}
+)\,\vect{n}\,]\,)$$ en omettant la notion de face.\\
+Le dernier terme est implicite relativement \`a la variable $R_{ij}$ et correspond \`a l'op\'erateur continu :
+ $$\dive(\,\tens{D}^n\,(\grad{R}^{\,n+1}_{ij}\,.\,\vect{n} )\,\vect{n})$$
+\subsection{\bf Variable $\varepsilon$ }
+On r\'esout l'\'equation de $\varepsilon$ de fa\c con analogue \`a celle de
+$R_{ij}$.
+\begin{equation}
+\begin{array}{ll}
+\displaystyle
+\rho^n\ \frac {\varepsilon^{n+1}-\varepsilon^{n}}{\Delta t^n} +
+\dive((\rho\,\underline{u})^{n} \varepsilon^{n+1})
+- \dive(\mu^n\ \grad \varepsilon^{n+1})
+= &
+\displaystyle
+d_{\,\varepsilon}^{\,n,n+1} \\
+&
+\displaystyle
++ C_{\varepsilon_1} \frac{k^n}{\varepsilon^n} \left[ \mathcal{P}^n + \mathcal{G}^n_{\varepsilon} \right]
+- \rho^n C_{\varepsilon_2} \frac{(\varepsilon^n)^2}{k^n} \\
+&
+\displaystyle
++ \varepsilon^{n+1} \dive{(\rho \underline{u})^n} \\
+&
+\displaystyle
++ \Gamma(\varepsilon^{\,in} - \varepsilon^{n+1})
++ \alpha^n_{\varepsilon} \varepsilon^{n+1} + \beta^n_{\varepsilon}
+\end{array}
+\end{equation}
+
+Le terme de diffusion turbulente $\it{d}^{\,n,n+1}_{\,\varepsilon}$ est trait\'e comme celui des
+variables $R_{ij}$ et s'\'ecrit : $$\it{d}_{\,\varepsilon}^{\,n,n+1} = \dive{\left[
+\tens{A'}^{\,n}\,\grad {\varepsilon^{\,n+1}} \right]}$$
+Le tenseur $\tens{A'}$ est toujours explicite.
+On le d\'ecompose en une partie diagonale $\tens{D'}^{\,n}$ et une partie
+extra-diagonale $\tens{E'}^{\,n}$ :\\
+$$\tens{A'}^{\,n} =\tens{D'}^{\,n} + \tens{E'}^{\,n}$$
+Ainsi :
+\begin{equation}
+\begin{array} {lcl}
+&\displaystyle \int_{\Omega_l} \it{d}_{\,\varepsilon}^{\,n,n+1}\ d\Omega =
+\sum\limits_{m\in Vois(l)} \left[
+\tens{E'}^{\,n}\,\grad{\varepsilon}^n
+\right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}\\
+& + \sum\limits_{m\in Vois(l)} \left[
+\tens{D'}^{\,n}\,\grad{\varepsilon}^n
+\right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}\
+- \sum\limits_{m\in Vois(l)}
+ \eta^n_{\,lm} \left(\grad{\varepsilon}^{n}\,.\,\vect{n}_{\,lm} \right) S_{\,lm}\\
+&+ \sum\limits_{m\in Vois(l)} \eta^n_{\,lm} \left( \grad{\varepsilon}^{n+1}\,.\,\vect{n}_{\,lm} \right) S_{\,lm}
+\end{array}
+\end{equation}
+avec :
+$$\eta^n_{\,lm} = (D'^{\,n}_{11})\,n^2_{\,1,\,lm} + (D'^{\,n}_{22})\,n^2_{\,2,\,lm} +
+(D'^{\,n}_{33})\,n^2_{\,3,\,lm}.$$
+On peut traiter ce terme $\eta^n_{\,lm}$ comme une diffusion avec un coefficient de diffusion ind\'ependant de la direction.\\
+Les trois premiers termes sont totalement explicites et correspondent \`a l'op\'erateur :
+$$\dive (\,\tens{E'}^{\,n}\,\varepsilon^{\,n}) +
+\dive (\,\tens{D'}^{\,n}\,[\grad{\varepsilon^{\,n}} - (\grad{\varepsilon^{\,n}}.\,\vect{n})\,\vect{n}]\,)$$ en omettant la notion de face.\\
+Le dernier terme est implicite relativement \`a la variable $\varepsilon$ et correspond \`a l'op\'erateur :
+ $$\dive (\,\tens{D'}^{\,n}\,(\grad{\varepsilon^{\,n+1}}.\,\vect{n} )\,\vect{n})$$
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+La num\'ero de la phase trait\'ee fait partie des arguments de \fort{turrij}. On
+omettra volontairement de le pr\'eciser dans ce qui suit, on indiquera par $(\ )$ la
+notion de tableau s'y rattachant.
+
+\etape{Calcul des termes de production $\tens{\mathcal{P}}$}
+\begin{itemize}
+\item [$\star$] Initialisation \`a z\'ero du tableau \var{PRODUC} dimensionn\'e \`a $\var{NCEL}\times 6$.
+\item [$\star$] On appelle trois fois \fort{grdcel} pour calculer les gradients des composantes de la vitesse $u$, $v$ et
+$w$ prises au temps $n$.
+
+Au final, on a :\\
+$\displaystyle
+\begin{array} {ll}
+\var{PRODUC(1,IEL)} = & \displaystyle - 2 \left[ R_{11}^{\,n} \frac{\partial u^{\,n}} {\partial x} +R_{12}^{\,n} \frac{\partial u^{\,n}} {\partial y}+R_{13}^{\,n} \frac{\partial u^{\,n}} {\partial z} \right] \text{ (production de $R_{11}^{\,n}$)}\\
+\var{PRODUC(2,IEL)} = & \displaystyle - 2 \left[ R_{12}^{\,n} \frac{\partial v^{\,n}} {\partial x} +R_{22}^{\,n} \frac{\partial v^{\,n}} {\partial y}+R_{23}^{\,n} \frac{\partial v^{\,n}} {\partial z} \right] \text{ (production de $R_{22}^{\,n}$)}\\
+\var{PRODUC(3,IEL)} = & \displaystyle - 2 \left[ R_{13}^{\,n} \frac{\partial w^{\,n}} {\partial x} +R_{23}^{\,n} \frac{\partial w^{\,n}} {\partial y}+R_{33}^{\,n} \frac{\partial w^{\,n}} {\partial z} \right] \text{ (production de $R_{33}^{\,n}$)}\\
+\var{PRODUC(4,IEL)} = & \displaystyle - \left[ R_{12}^{\,n} \frac{\partial u^{\,n}} {\partial x} +R_{22}^{\,n} \frac{\partial u^{\,n}} {\partial y}+R_{23}^{\,n} \frac{\partial u^{\,n}} {\partial z} \right] \\
+& \displaystyle - \left[ R_{11}^{\,n} \frac{\partial v^{\,n}} {\partial x} +R_{12}^{\,n} \frac{\partial v^{\,n}} {\partial y}+R_{13}^{\,n} \frac{\partial v^{\,n}} {\partial z} \right] \text{ (production de $R_{12}^{\,n}$)} \\
+\var{PRODUC(5,IEL)} = & \displaystyle - \left[ R_{13}^{\,n} \frac{\partial u^{\,n}} {\partial x} +R_{23}^{\,n} \frac{\partial u^{\,n}} {\partial y}+R_{33}^{\,n} \frac{\partial u^{\,n}} {\partial z} \right] \\
+& \displaystyle - \left[ R_{11}^{\,n} \frac{\partial w^{\,n}} {\partial x} +R_{12}^{\,n} \frac{\partial w^{\,n}} {\partial y}+R_{13}^{\,n} \frac{\partial w^{\,n}} {\partial z} \right] \text{ (production de $R_{13}^{\,n}$)} \\
+\var{PRODUC(6,IEL)} = & \displaystyle - \left[ R_{13}^{\,n} \frac{\partial v^{\,n}} {\partial x} +R_{23}^{\,n} \frac{\partial v^{\,n}} {\partial y}+R_{33}^{\,n} \frac{\partial v^{\,n}} {\partial z} \right] \\
+& \displaystyle - \left[ R_{12}^{\,n} \frac{\partial w^{\,n}} {\partial x} +R_{22}^{\,n} \frac{\partial w^{\,n}} {\partial y}+R_{23}^{\,n} \frac{\partial w^{\,n}} {\partial z} \right] \text{ (production de $R_{23}^{\,n}$)}
+\end{array}
+$
+\end{itemize}
+
+\etape{Calcul du gradient de la masse volumique $\rho^n$ prise au d\'ebut du pas
+de temps courant\footnote{{\it i.e.} calcul\'ee \`a partir des
+variables du pas de temps pr\'ec\'edent $n$ si n\'ecessaire.} $(n+1)$}
+Ce calcul n'a lieu que si les termes de gravit\'e doivent \^etre pris en compte
+($\var{IGRARI()} =1$).
+\begin{itemize}
+\item [$\star$] Appel de \fort{grdcel} pour calculer le gradient de $\rho^n$
+dans les trois directions de l'espace. Les conditions aux limites sur $\rho^n$
+sont des conditions de Dirichlet puisque la valeur de $\rho^n$ aux faces de bord
+$ik$ (variable \var{IFAC}) est connue et vaut $\rho_{\,b_{\,ik}}$. Pour \'ecrire les conditions aux limites
+sous la forme habituelle, $$\rho_{\,b_{\,ik}} = \var{COEFA} + \var{COEFB}
+\,\rho^n_{\,I'}$$ on pose alors $\var{COEFA}=
+\var{PROPCE(IFAC,IPPROB(IROM(IPHAS)))}$ et $\var{COEFB} = \var{VISCB} = 0$.\\
+$\var{PROPCE(1,IPPROB(IROM(IPHAS)))}$ (resp.$\var{VISCB}$) est utilis\'e en lieu
+et place de l'habituel \var{COEFA} ($\var{COEFB}$), lors de l'appel \`a \fort{grdcel}.\\
+On a donc :\\
+$\displaystyle \var{GRAROX}= \frac{\partial \rho^n}{\partial x}\ $,$\displaystyle \ \var{GRAROY}= \frac{\partial
+\rho^n}{\partial y}$ et $
+\displaystyle \ \var{GRAROZ}= \frac{\partial \rho^n}{\partial z}\ $.
+
+\end{itemize}
+
+Le gradient de $\rho^n$ servira \`a calculer les termes de production par effets de gravit\'e si ces derniers sont pris en compte.
+
+\etape{Boucle \var{ISOU} de $1$ \`a $6$ sur les tensions de Reynolds}
+Pour $\var{ISOU} = 1,2,3,4,5,6$, on r\'esout respectivement et dans
+l'ordre les
+\'equations de $R_{11}$, $R_{22}$, $R_{33}$, $R_{12}$, $R_{13}$ et $R_{23}$ par
+l'appel au sous-programme \fort{resrij}.\\
+La r\'esolution se fait par incr\'ement $\delta {R}_{ij}^{\,n+1,k+1}$ , en utilisant la m\^eme m\'ethode que
+celle d\'ecrite dans le sous-programme \fort{codits}. On adopte ici les m\^emes notations.
+\var{SMBR} est le second membre du syst\`eme \`a inverser, syst\`eme portant sur
+les incr\'ements de la variable. \var{ROVSDT} repr\'esente la diagonale de la
+matrice, hors convection/diffusion.\\
+On va r\'esoudre l'\'equation (\ref{Base_Turrij_Eq_Temp_Rij}) sous forme incr\'ementale en
+utilisant \fort{codits}, soit :
+\begin{equation}\label{Base_Turrij_Eq_Temp_deltaRij}
+\begin{array}{ll}
+&\displaystyle \underbrace{\left(\frac {\rho^n_L}{\Delta t^n}
++ \rho^n_L \,C_1\,\frac{\varepsilon^n_L}{k^n_L}(1-\frac{\delta_{ij}}{3})
+ - m^n_{\,lm} + \Gamma_L\,+ max(-\alpha^n_{R_{ij}},0)\right)\,|\Omega_l|}
+_{\text {$\var{ROVSDT}$ contribuant
+\`a la diagonale de la matrice simplifi\'ee de \fort{matrix}}}\,(\delta{R}_{ij}^{\,n+1,p+1})_{\,L}\\\\
+& \underbrace{+\sum\limits_{m\in Vois(l)}\displaystyle \left[
+ m^n_{\,lm} \delta R_{ij,\,f_{\,lm}}^{\,n+1,p+1}
+- (\mu^n_{\,lm} + \gamma^n_{\,lm})\
+\frac{({\delta R}_{ij}^{\,n+1,p+1})_{M}-({\delta R}_{ij}^{\,n+1,p+1})_{L})}{\overline{L'M'}}\,
+S_{\,lm} \right]}_{\text { convection upwind pur et diffusion non reconstruite
+relatives \`a la matrice simplifi\'ee de \fort{matrix}\footnotemark}} \\
+% voir le texte de la footmark plus bas
+&= - \displaystyle\frac {\rho^n_L}{\Delta t^n}\,\left(\,(R^{\,n+1,p}_{ij})_L - (R^{\,n}_{ij})_L\,\right)\\
+&-\,\underbrace{\displaystyle\int_{\Omega_l} \left(
+\dive\,[\,(\rho\,\vect{u})^n\,R^{\,n+1,p}_{ij} - (\mu^n\,+ \gamma^n\,)\,
+\grad{R^{\,n+1,p}_{ij}}\,]\right)\,d\Omega}_{\text {convection et diffusion
+trait\'ees par \fort{bilsc2}}}\\
+&+\displaystyle \int_{\Omega_l} \left[\,\mathcal{P}^{\,n+1,p}_{ij} + \mathcal{G}^{\,n+1,p}_{ij}
+- \displaystyle\rho^n \,C_1\,\frac{\varepsilon^n}{k^n}\left[R^{\,n+1,p}_{ij}-
+\frac{2}{3}\,k^n\,\delta_{ij}\right] + \phi^{\,n+1,p}_{ij,2} +
+\phi^{\,n+1,p}_{ij,w}\,\right]\, d\Omega \\
+& + \displaystyle\int_{\Omega_l} \left[- \frac{2}{3} \rho^n \varepsilon^n \delta_{ij}
+ + \Gamma\,(\,R^{\,in}_{ij} - R^{\,n+1,p}_{ij}\,) +
+\alpha^n_{R_{ij}}\,R^{\,n+1,p}_{ij}+ \beta^n_{R_{ij}}\right]\, d\Omega\\
+&+ \sum\limits_{m\in
+Vois(l)}\displaystyle \left[\ \tens{E}^n\,\grad{R}^{\,n+1,p}_{ij} \right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}\\
+&+ \sum\limits_{m\in Vois(l)}\displaystyle \left[\
+\tens{D}^n\,\grad{R}^{\,n+1,p}_{ij} \right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}\\
+&- \sum\limits_{m\in Vois(l)} \gamma^n_{\,lm} \left( \grad{R}^{\,n+1,p}_{ij}\,.\,\vect{n}_{\,lm} \right) S_{\,lm}\\
+&+ \sum\limits_{m\in Vois(l)} m^n_{\,lm}\,(R^{\,n+1,p}_{ij})_L\\
+\end{array}
+\end{equation}
+% si on ne fait pas comme ca, il n'apparait pas
+\footnotetext[\thefootnote]{Si $\var{IRIJNU} = 1$, on remplace $\mu^n_{\,lm}$ par $(\mu +
+\mu_t)^n_{\,lm}$ dans l'expression de la diffusion non reconstruite
+associ\'ee \`a la matrice simplifi\'ee de \fort{matrix} ($\mu_t$ d\'esigne la
+viscosit\'e turbulente calcul\'ee comme en $k-\varepsilon$).}
+
+o\`u on rappelle :\\
+pour $n$ donn\'e entier positif, on d\'efinit la suite
+ $({R}_{ij}^{\,n+1,p})_{p \in \grandN}$
+ par :
+\begin{equation}\notag
+\left\{\begin{array}{l}
+{R}_{ij}^{\,n+1,0} = {R}_{ij}^{\,n}\\
+{R}_{ij}^{\,n+1,p+1} = {R}_{ij}^{\,n+1,p} + \delta{R}_{ij}^{\,n+1,p+1} \\
+\end{array}\right.
+\end{equation}
+$(\delta{R}_{ij}^{\,n+1,p+1})_{\,L}$ d\'esigne la valeur sur l'\'el\'ement
+$\Omega_l$ du $\text{$(\,p+1\,)$-i\`eme}$ incr\'ement de ${R}_{ij}^{\,n+1}$,
+$ m^n_{\,lm}$ le flux de masse \`a l'instant $n$ \`a travers la face $lm$,
+$\delta R_{ij,\,f_{\,lm}}^{\,n+1,p+1}$ vaut $({\delta
+R}_{ij}^{\,n+1,p+1})_{L}$ si $ m^n_{\,lm} \geqslant 0$, $({\delta
+R}_{ij}^{\,n+1,p+1})_{M}$ sinon,
+$\mathcal{P}^{\,n+1,p}_{ij}$, $\phi^{\,n+1,p}_{ij,2}$, $\phi^{\,n+1,p}_{ij,w}$ les valeurs
+des quantit\'es associ\'ees correspondant \`a l'incr\'ement
+$(\delta{R}_{ij}^{\,n+1,p})$.\\
+
+
+
+Tous ces termes sont calcul\'es comme suit :
+\begin{itemize}
+\item Terme de gauche de l'\'equation (\ref{Base_Turrij_Eq_Temp_deltaRij})\\
+Dans \fort{resrij} est calcul\'ee la variable \var{ROVSDT}. Les autres
+termes sont compl\'et\'es par \fort{codits}, lors de la construction de la matrice simplifi\'ee , {\it via} un
+appel au sous-programme \fort{matrix}. La quantit\'e
+ $(\mu^n_{\,lm} + \gamma^n_{\,lm})$ \`a la face $lm$ est calcul\'ee lors de l'appel \`a
+\fort{visort}.\\
+\item Second membre de l'\'equation (\ref{Base_Turrij_Eq_Temp_deltaRij})\\
+Le premier terme non d\'etaill\'e est calcul\'e par le sous-programme
+\fort{bilsc2}, qui applique le sch\'ema convectif choisi par l'utilisateur, qui
+reconstruit ou non selon le souhait de l'utilisateur les gradients intervenants
+dans la convection-diffusion.\\
+Les termes sans accolade sont, eux, compl\`etement explicites et ajout\'es au fur et
+\`a mesure dans \var{SMBR} pour former
+l'expression $f^{\,exp}_s$ de \fort{codits}.
+\end{itemize}
+On d\'ecrit ci-dessous les \'etapes de \fort{resrij} :
+\begin{itemize}
+
+\item DELTIJ = 1, pour $\var{ISOU} \leqslant 3$ et DELTIJ = 0 Si $\var{ISOU} >
+3$. Cette valeur repr\'esente le symbole de Kroeneker $\delta_{ij}$.
+
+\item Initialisation \`a z\'ero de \var{SMBR} (tableau contenant le second
+membre) et \var{ROVSDT} (tableau contenant la diagonale de la matrice sauf celle
+relative \`a la contribution de la
+diagonale des op\'erateurs de convection et de diffusion lin\'earis\'es
+\footnote{qui correspondent aux sch\'emas convectif upwind pur et diffusif sans
+reconstruction.}), tous deux de dimension $\var{NCEL}$.
+
+\item Lecture et prise en compte des termes sources utilisateur pour la variable $R_{ij}$
+
+Appel \`a \fort{ustsri} pour charger les termes sources utilisateurs. Ils sont
+stock\'es comme suit. Pour la cellule $\Omega_l$ de centre $L$, repr\'esent\'ee par $\var{IEL}$, on a :\\
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\var{ROVSDT(IEL)}&= |\Omega_l| \ \alpha_{R_{ij}}\\
+&\var{SMBR(IEL)}&=|\Omega_l| \ \beta_{R_{ij}}\\
+\end{array}\right.
+\end{equation}
+On affecte alors les valeurs ad\'equates au second membre \var{SMBR} et \`a la
+diagonale \var{ROVSDT} comme suit :
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\var{SMBR(IEL)} &= \var{SMBR(IEL)} +\ |\Omega_l| \ \alpha_{R_{ij}} \ (R^n_{ij})_L \\
+&\var{ROVSDT(IEL)}&= \text{max }(-\ |\Omega_l| \ \alpha_{R_{ij}},0)\\
+\end{array}\right.
+\end{equation}
+La valeur de $ \var{ROVSDT}$ est ainsi calcul\'ee pour des raisons de stabilit\'e
+num\'erique. En effet, on ne rajoute sur la diagonale que les valeurs positives,
+ce qui correspond physiquement \`a impliciter les termes de rappel uniquement.
+\item{Calcul du terme source de masse si $\Gamma_L > 0$}
+
+Appel de \fort{catsma} et incr\'ementation si n\'ecessaire de \var{SMBR} et
+\var{ROVSDT} {\it via} :\\
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+\displaystyle \var{SMBR(IEL)} = \var{SMBR(IEL)} + |\Omega_l| \ \Gamma_L \
+\left[(R^{\,in}_{ij})_L - (R^{\,n}_{ij})_L \right] \\
+\displaystyle \var{ROVSDT(IEL)}=\var{ROVSDT(IEL)} + |\Omega_l| \ \Gamma_L
+\end{array}\right.
+\end{equation}
+\item Calcul du terme d'accumulation de masse et du terme instationnaire
+
+On stocke $\displaystyle \var{W1}= \int_{\Omega_l}\dive\,(\rho\,\vect{u})\,d\Omega$
+calcul\'e par \fort{divmas} \`a l'aide des flux de masse aux faces internes
+$ m^n_{\,lm}=\sum\limits_{m\in Vois(l)}{(\rho \vect{u})_{\,lm}^n} \text{.}\,
+\vect{S}_{\,lm} $ (tableau \var{FLUMAS}) et des flux de masse aux bords $ m^n_{\,b_{lk}} = \sum\limits_{k\in{\gamma_b(l)}}{(\rho \vect{u})_{\,{b}_{lk}}^n} \text{.}\,
+\vect{S}_{\,{b}_{lk}} $ (tableau \var{FLUMAB}).
+On incr\'emente ensuite \var{SMBR} et \var{ROVSDT}.
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\var{SMBR(IEL)} &= \var{SMBR(IEL)} + \var{ICONV}\ (R^n_{ij})_L\,(\displaystyle
+\int_{\Omega_l}\dive\,(\rho\,\vect{u})\ d\Omega) \\
+&\var{ROVSDT(IEL)}& = \var{ROVSDT(IEL)} + \var{ISTAT}\,\displaystyle
+\frac{\rho^n_L \ |\Omega_l|}{\Delta t^n} - \var{ICONV}\ (\displaystyle
+\int_{\Omega_l}\dive\,(\rho\,\vect{u})\ d\Omega) \\
+\end{array}\right.
+\end{equation}
+\item Calcul des termes sources de production, des termes $\displaystyle
+\phi_{\,ij,1}+\phi_{\,ij,2}$ et de la dissipation~$\displaystyle-\frac{2}{3} \varepsilon\,\delta_{\,ij}$ :
+
+On effectue une boucle d'indice \var{IEL} sur les cellules $\Omega_l$ de centre $L$ :
+\begin{itemize}
+\item [$\Rightarrow$] $\displaystyle \var{TRPROD}= \frac{1}{2} (\mathcal{P}^n_{ii})_L = \frac{1}{2} \left[ \var{PRODUC(1,IEL)} + \var{PRODUC(2,IEL)} + \var{PRODUC(3,IEL)} \right] $
+\item [$\Rightarrow$] $\displaystyle \var{TRRIJ }= \frac{1}{2} (R^n_{ii})_L $
+\item [$\Rightarrow$] $\displaystyle \var{SMBR(IEL)} =\ \var{SMBR(IEL)}\ +$\\
+$\ \displaystyle\rho^n_L |\Omega_l| \left[ \displaystyle
+\frac{2}{3}\,\delta_{\,ij} \left( \ \displaystyle \frac{ C_2}{2}\,(\mathcal{P}^n_{ii})_L\ +
+(C_1-1)\ \varepsilon^n_L\, \right)\right.$\\
+$ + \left.\ (1-C_2) \ \var{PRODUC(ISOU,IEL)} -
+\displaystyle C_1\ \frac{2\,\varepsilon^n_L}{(R^n_{ii})_L}\ (R^n_{ij})_L \right]$
+\item [$\Rightarrow$] $\displaystyle \var{ROVSDT(IEL)} = \var{ROVSDT(IEL)} +
+\rho^n_L \ |\Omega_l| \ (- \displaystyle \frac{1}{3} \ \,\delta_{\,ij} + 1) \ C_1
+\ \frac{2\ \varepsilon^n_L}{(R^n_{ii})_L}$
+\end{itemize}
+\item Appel de \fort{rijech} pour le calcul des termes d'\'echo de paroi
+ $\phi^n_{ij,w}$ si $\var{IRIJEC()}=1$ et ajout dans \var{SMBR}.\\
+$\var{SMBR} = \var{SMBR} + \phi^n_{ij,w}$\\
+Suivant son mode de calcul (\var{ICDPAR}), la distance � la paroi est directement accessible
+par \var{RA(IDIPAR+IEL-1)} (\var{|ICDPAR|} = 1) ou bien
+est calcul\'ee \`a partir de $\var{IA(IIFAPA(IPHAS)+IEL - 1)}$,
+qui donne pour l'\'el\'ement $\var{IEL}$ le num\'ero de la face de bord
+paroi la plus proche (\var{|ICDPAR|} = 2). Ces tableaux ont \'et\'e renseign\'e une fois pour toutes au
+d\'ebut de calcul.
+
+\item Appel de \fort{rijthe} pour le calcul des termes de gravit\'e $\mathcal{G}^n_{ij}$ et ajout dans \var{SMBR}.
+
+Ce calcul n'a lieu que si $\var{IGRARI()} = 1$.
+$ \var{SMBR} = \var{SMBR} + \mathcal{G}^n_{ij}$
+\item Calcul de la partie explicite du terme de diffusion
+ $\dive{\,\left[\tens{A}\,\grad{R}^{\,n}_{ij}\right]}$, plus pr\'ecis\'ement
+des contributions du terme extradiagonal pris aux faces purement internes
+(remplissage du tableau \var{VISCF}), puis aux faces de bord (remplissage du
+tableau \var{VISCB}).
+\begin{itemize}
+\item [$\star$] Appel de \fort{grdcel} pour le calcul du gradient de
+$R^{\,n}_{ij}$ dans chaque direction. Ces gradients sont respectivement
+stock\'es dans les tableaux de travail \var{W1}, \var{W2} et \var{W3}.
+
+\item [$\star$] boucle d'indice \var{IEL} sur les cellules $\Omega_l$ de centre
+$L$ pour le
+calcul de $\tens{E}^n\,\grad{R}^{\,n}_{ij}$ aux cellules dans un premier temps :\\
+\begin{itemize}
+\item [$\Rightarrow$] $\displaystyle \var{TRRIJ}= \frac{1}{2} (R^{\,n}_{ii})_L $
+\item [$\Rightarrow$] $\displaystyle \var{CSTRIJ} = \rho^n_L\ C_S \ \displaystyle\frac{(R^n_{ii})_L}{2\,\varepsilon^n_L}$
+\item [$\Rightarrow$] $\displaystyle \var{W4(IEL)} = \rho^n_L\ C_S\
+\displaystyle\frac{(R^n_{ii})_L}{2\,\varepsilon^n_L} \left[\,(R^{\,n}_{12})_L \ \var{W2(IEL)} +
+(R^{\,n}_{13})_L \ \var{W3(IEL)}\,\right]$
+\item [$\Rightarrow$] $\displaystyle \var{W5(IEL)} = \rho^n_L\ C_S\
+\displaystyle\frac{(R^n_{ii})_L}{2\,\varepsilon^n_L} \left[\,(R^{\,n}_{12})_L \ \var{W1(IEL)} +
+(R^{\,n}_{23})_L \ \var{W3(IEL)}\,\right]$
+\item [$\Rightarrow$] $\displaystyle \var{W6(IEL)} = \rho^n_L\ C_S\
+\displaystyle\frac{(R^n_{ii})_L}{2\,\varepsilon^n_L} \left[\,(R^{\,n}_{13})_L \ \var{W1(IEL)} + (R^{\,n}_{23})_L \ \var{W2(IEL)}\,\right]$
+\end{itemize}
+
+
+
+\item [$\star$] Appel de \fort{vectds}\footnote{Le r\'esultat est stock\'e dans
+\var{VISCF} et \var{VISCB}. Dans \fort{vectds}, les valeurs aux faces internes
+sont interpol\'ees lin\'eairement sans reconstruction et \var{VISCB} est mis \`a
+z\'ero.} pour assembler $\displaystyle\left[ \tens{E}^n\,\grad{R}^{\,n}_{ij}
+\right]\,.\,\vect{n}_{\,lm}S_{\,lm}$ aux faces $lm$.
+\item [$\star$] Appel de \fort{divmas} pour calculer la divergence du flux d\'efini par \var{VISCF} et \var{VISCB}.
+Le r\'esultat est stock\'e dans \var{W4}.\\
+Ajout au second membre \var{SMBR}.\\
+\var{SMBR} = \var{SMBR} + \var{W4}
+\end{itemize}
+
+A l'issue de cette \'etape, seule la partie extradiagonale de la diffusion prise
+enti\`erement explicite~:
+ $$\sum\limits_{m\in
+Vois(l)}\left[\ \tens{E}^n\,\grad{R}^{\,n}_{ij} \right]_{\,lm}\,.\,\vect{n}_{\,lm}S_{\,lm}$$ a \'et\'e calcul\'ee.\\
+
+\item Calcul de la partie diagonale du terme de diffusion\footnote{Seule la
+composante normale du gradient de $R_{ij}$ aux faces sera implicite.} :\\
+Comme on l'a d\'eja vu, une partie de cette contribution sera trait\'ee en
+implicite (celle relative \`a la composante normale du gradient) et donc
+ajout\'ee au second membre par \fort{bilsc2} ; l'autre
+partie sera explicite et prise en compte dans $f_s^{\,exp}$.
+\begin{itemize}
+\item [$\star$] On effectue une boucle d'indice \var{IEL} sur les cellules
+$\Omega_l$ de centre $L$ :
+\begin{itemize}
+\item [$\Rightarrow$] $\displaystyle \var{TRRIJ }= \frac{1}{2} (R^{\,n}_{ii})_L $
+\item [$\Rightarrow$] $\displaystyle \var{CSTRIJ} = \rho^n_L \ C_S \ \frac{(R^{\,n}_{ii})_L}{2\,\varepsilon^n_L}$
+\item [$\Rightarrow$] $\displaystyle \var{W4(IEL)} = \rho^n_L \ C_S \
+\frac{(R^{\,n}_{ii})_L}{2\,\varepsilon^n_L} \ (R^{\,n}_{11})_L$
+\item [$\Rightarrow$] $\displaystyle \var{W5(IEL)} = \rho^n_L \ C_S \ \frac{(R^{\,n}_{ii})_L}{2\,\varepsilon^n_L}\ (R^n_{22})_L$
+\item [$\Rightarrow$] $\displaystyle \var{W6(IEL)} = \rho^n_L \ C_S \ \frac{(R^{\,n}_{ii})_L}{2\,\varepsilon^n_L} \ (R^n_{33})_L$
+\end{itemize}
+
+%\item Traitement du parall\'elisme et de la p\'eriodicit\'e.
+
+\item [$\star$] On effectue une boucle d'indice \var{IFAC} sur les faces
+purement internes $lm$ pour remplir le tableau \var{VISCF} :
+\begin{itemize}
+\item [$\Rightarrow$] Identification des cellules $\Omega_l$ et $\Omega_m$ de
+centre respectif $L$ (variable \var{II}) et $M$ (variable \var{JJ}), se trouvant de chaque c\^ot\'e de la face
+$lm$\footnote{La normale \`a la face est orient\'ee de L vers M.}.
+\item [$\Rightarrow$] Calcul du carr\'e de la surface de la face. La valeur est
+stock\'ee dans le tableau \var{SURFN2}.
+\item [$\Rightarrow$] Interpolation du gradient de $R^{\,n}_{ij}$ \`a la face
+$lm$ (gradient facette $\left[\grad{R}^{\,n}_{ij}\right]_{\,lm}$) :
+\begin{equation}\notag
+\left\{\begin{array}{ll}
+\var{GRDPX} &= \displaystyle \frac{1}{2} \left(\var{W1(II)} + \var{W1(JJ)}
+\right) \\
+&\\
+\var{GRDPY} &= \displaystyle \frac{1}{2} \left(\var{W2(II)} + \var{W2(JJ)} \right) \\
+&\\
+\var{GRDPZ} &= \displaystyle \frac{1}{2} \left(\var{W3(II)} + \var{W3(JJ)} \right)
+\end{array}\right.
+\end{equation}
+\item [$\Rightarrow$] Calcul du gradient de $R^{\,n}_{ij}$ normal \`a la face
+$lm$, $\left[\grad{R}^{\,n}_{ij}\right]_{\,lm}.\vect{n}_{\,lm}\,S_{\,lm}$.\\
+
+$\displaystyle \var{GRDSN} = \var{GRDPX} \ \var{SURFAC(1,IFAC)} + \var{GRDPY} \ \var{SURFAC(2,IFAC)} + \var{GRDPZ} \ \var{SURFAC(3,IFAC)}$
+$\var{SURFAC}$ est le vecteur surface de la face \var{IFAC}.
+
+
+\item [$\Rightarrow$] calcul de
+ $\left[\grad{R^{\,n}_{ij}} - (\grad
+R^{\,n}_{ij}\,.\,\vect{n}_{\,lm})\vect{n}_{\,lm}\right]$, les vecteurs \'etant
+calcul\'es \`a la face $lm$ :
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\displaystyle \var{GRDPX} &= \var{GRDPX} - \displaystyle\frac{\var{GRDSN}}{\var{SURFN2}} \ \var{SURFAC(1,IFAC)}\\
+&&\\
+&\displaystyle \var{GRDPY} &= \var{GRDPY} - \displaystyle\frac{\var{GRDSN}}{\var{SURFN2}} \ \var{SURFAC(2,IFAC)} \\
+&&\\
+&\displaystyle \var{GRDPZ} &= \var{GRDPZ} - \displaystyle\frac{\var{GRDSN}}{\var{SURFN2}} \ \var{SURFAC(3,IFAC)}
+\end{array}\right.
+\end{equation}
+\item [$\Rightarrow$] finalisation du calcul de l'expression totalement
+explicite
+ $$\left[ \tens{D}^n\,\left( \grad{R^{\,n}_{ij}} - (\grad R^{\,n}_{ij}\,.\,\vect{n}_{\,lm})\,\vect{n}_{\,lm}\right) \right]\,.\,\vect{n}_{\,lm}$$
+\begin{equation}\notag
+\begin{array} {ll}
+\displaystyle \var{VISCF} = &
+ \displaystyle\frac{1}{2} (\ \var{W4(II)} +\ \var{W4(JJ)}) \ \var{GRDPX} \
+\var{SURFAC(1,IFAC)})\ + \\
+&\\
+& \displaystyle\frac{1}{2} (\ \var{W5(II)} +\ \var{W5(JJ)}) \ \var{GRDPY} \
+\var{SURFAC(2,IFAC)})\ + \\
+&\\
+& \displaystyle\frac{1}{2} (\ \var{W6(II)} +\ \var{W6(JJ)}) \ \var{GRDPZ} \ \var{SURFAC(3,IFAC)})
+\end{array}
+\end{equation}
+\end{itemize}
+
+\item [$\star$] Mise \`a z\'ero du tableau \var{VISCB}.
+
+\item [$\star$] Appel de \fort{divmas} pour calculer la divergence de~:
+ $$\tens{D}^{\,n}\,\left( \grad{R^{\,n}_{ij}} - (\grad R^{\,n}_{ij}\,.\,\vect{n}_{\,lm})\vect{n}_{\,lm}\right)$$ d\'efini aux faces dans \var{VISCF} et \var{VISCB}.
+
+Le r\'esultat est stock\'e dans le tableau \var{W1}.\\
+Ajout au second membre \var{SMBR}.\\
+$\var{SMBR} = \var{SMBR} + \var{W1}$
+\end{itemize}
+\item Calcul de la viscosit\'e orthotrope $\gamma^n_{\,lm}$ \`a la face $lm$ de la variable principale
+$R^{\,n}_{ij}$\\
+Ce calcul permet au sous-programme \fort{codits} de compl\'eter le second membre
+\var{SMBR} par :
+\begin{equation}
+\begin{array} {ll}
+& \sum\limits_{m\in Vois(l)}
+\mu^n_{\,lm}\,\left(\grad{R}^{\,n}_{ij}\,.\,\vect{n}_{\,lm}\right)S_{\,lm}
+ + \sum\limits_{m\in Vois(l)} \left(\grad{R}^{\,n}_{ij}
+\,.\,\vect{n}_{\,lm}\right)\left[\tens{D}^{\,n}\,\vect{n}_{\,lm}\right]_{\,lm}\,.\,\vect{n}_{\,lm}\
+S_{\,lm}\\
+& = \sum\limits_{m\in Vois(l)}(\,\mu^n_{\,lm}\, + \,\gamma^n_{\,lm}\,)\,\left(\grad{R}^{\,n}_{ij}\,.\,\vect{n}_{\,lm}\right)S_{\,lm}
+\end{array}
+\end{equation}
+sans pr\'eciser la nature de la face $lm$, {\it via} l'appel \`a \fort{bilsc2} et de disposer de la quantit\'e
+$(\mu^n_{\,lm}\, + \gamma^n_{\,lm})$ pour construire sa
+matrice simplifi\'ee.\\
+\begin{itemize}
+\item [$\star$] On effectue une boucle d'indice \var{IEL} sur les cellules
+$\Omega_l$ :
+\begin{itemize}
+\item [$\Rightarrow$] $\displaystyle \var{TRRIJ }= \frac{1}{2} (R^{\,n}_{ii})_L $
+\item [$\Rightarrow$] $\displaystyle \var{RCSTE} = \rho^n_L \ C_S \ \frac{ (R^{\,n}_{ii})_L}{2\,\varepsilon^n_L} $
+\item [$\Rightarrow$] $\displaystyle \var{W1(IEL)} = \mu^n +\rho^n_L \ C_S \ \frac{
+(R^{\,n}_{ii})_L}{2\,\varepsilon^n_L}\ (R^n_{11})_L$
+\item [$\Rightarrow$] $\displaystyle \var{W2(IEL)} = \mu^n + \rho^n_L \ C_S \ \frac{ (R^{\,n}_{ii})_L}{2\,\varepsilon^n_L}\ (R^n_{22})_L$
+\item [$\Rightarrow$] $\displaystyle \var{W3(IEL)} = \mu^n + \rho^n_L \ C_S \ \frac{ (R^{\,n}_{ii})_L}{2\,\varepsilon^n_L}\ (R^n_{33})_L$
+\end{itemize}
+
+\item [$\star$] Appel de \fort{visort} pour calculer la viscosit\'e orthotrope
+\footnote{Comme dans le sous-programme \fort{viscfa}, on multiplie la viscosit\'e par
+$\displaystyle \frac{S_{\,lm}}{\overline{L'M'}}$, o\`u $S_{\,lm}$ et
+$\overline{L'M'}$ repr\'esentent respectivement la surface de la face $lm$ et la
+mesure alg\'ebrique du segment reliant les projections des centres des cellules
+voisines sur la normale \`a la face. On garde dans ce sous-programme la possibilit\'e d'interpoler la viscosit\'e aux cellules lin\'eairement ou d'utiliser une moyenne harmonique. La viscosit\'e au bord est celle de la cellule de bord correspondante.}
+$ \gamma^n_{\,lm} = (\tens{D}^{\,n}\,\vect{n}_{\,lm}).\vect{n}_{\,lm}$ aux faces $lm$
+
+Le r\'esultat est stock\'e dans les tableaux \var{VISCF} et \var{VISCB}.
+\end{itemize}
+
+\item appel de \fort{codits} pour la r\'esolution de l'\'equation de
+convection/diffusion/termes sources de la variable $R_{ij}$. Le terme source est
+\var{SMBR}, la viscosit\'e \var{VISCF} aux faces purement internes (
+resp. \var{VISCB} aux faces de bord) et \var{FLUMAS} le flux de masse interne
+ ( resp. \var{FLUMAB} flux de masse au bord). Le r\'esultat est la variable $R_{ij}$ au temps
+$n+1$, donc $R^{\,n+1}_{ij}$. Elle est stock\'ee dans le tableau \var{RTP} des
+variables mises \`a jour.
+
+\end{itemize}
+
+\etape{Appel de \fort{reseps} pour la r\'esolution de la variable $\varepsilon$}
+
+On d\'ecrit ci-dessous le sous-programme \fort{reseps}, les commentaires du sous-programme \fort{resrij} ne seront pas r\'ep\'et\'es puisque les deux sous-programmes ne diff\`erent que par leurs termes sources.
+
+\begin{itemize}
+\item Initialisation \`a z\'ero de \var{SMBR} et \var{ROVSDT}.
+
+\item{Lecture et prise en compte des termes sources utilisateur pour la variable $\varepsilon$ :}
+
+Appel de \fort{ustsri} pour charger les termes sources utilisateurs. Ils sont
+stock\'es dans les tableaux suivants :\\
+pour la cellule $\Omega_l$ repr\'esent\'ee par $\var{IEL}$ de centre $L$, on a :
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\var{ROVSDT(IEL)}&= |\Omega_l| \ \alpha_{\varepsilon}\\
+&\var{SMBR(IEL)}&=|\Omega_l| \ \beta_{\varepsilon}\\
+\end{array}\right.
+\end{equation}
+On affecte alors les valeurs ad\'equates au second membre \var{SMBR} et \`a la
+diagonale \var{ROVSDT} comme suit :
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\var{SMBR(IEL)} &= \var{SMBR(IEL)} +\ |\Omega_l| \ \alpha_{\,\varepsilon} \
+\varepsilon^n_L \\
+&\var{ROVSDT(IEL)}&= \text{max }(-\ |\Omega_l| \ \alpha_{\,\varepsilon},0)\\
+\end{array}\right.
+\end{equation}
+
+\item{Calcul du terme source de masse si $\Gamma_L > 0$ :
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\displaystyle \var{SMBR(IEL)} = \var{SMBR(IEL)} + |\Omega_l| \ \Gamma_L \
+(\varepsilon^{\,in}_L -\varepsilon^n_L) \\
+&\displaystyle \var{ROVSDT(IEL)}= \var{ROVSDT(IEL)} + |\Omega_l| \ \Gamma_L
+\end{array}\right.
+\end{equation}
+\item Calcul du terme d'accumulation de masse et du terme instationnaire \\
+On stocke $\displaystyle \var{W1}= \int_{\Omega_l}\dive\,(\rho\,\vect{u})\,d\Omega$
+calcul\'e par \fort{divmas} \`a l'aide des flux de masse internes et aux bords.\\
+On incr\'emente ensuite \var{SMBR} et \var{ROVSDT}.
+\begin{equation}\notag
+\left\{\begin{array}{lll}
+&\var{SMBR(IEL)} &= \var{SMBR(IEL)} + \var{ICONV}\ \varepsilon^n_L\,(\displaystyle
+\int_{\Omega_l}\dive\,(\rho\,\vect{u})\ d\Omega) \\
+&\var{ROVSDT(IEL)}& = \var{ROVSDT(IEL)} + \var{ISTAT}\,\displaystyle
+\frac{\rho^n_L \ |\Omega_l|}{\Delta t^n} - \var{ICONV}\ (\displaystyle
+\int_{\Omega_l}\dive\,(\rho\,\vect{u})\ d\Omega) \\
+\end{array}\right.
+\end{equation}
+
+\item Traitement du terme de production
+ $\displaystyle \rho\,C_{\varepsilon_1}\,\frac{\varepsilon}{k}\,\mathcal{P}$
+ et du terme de dissipation $-\,\displaystyle \rho\,C_{\varepsilon_2}\,\frac{\varepsilon}{k}\,\varepsilon$ \\
+pour cela, on effectue une boucle d'indice \var{IEL} sur les cellules $\Omega_l$
+de centre $L$ :
+\begin{itemize}
+\item [$\Rightarrow$] $\displaystyle \var{TRPROD}= \frac{1}{2} (\mathcal{P}^n_{ii})_L = \frac{1}{2} \left[ \var{PRODUC(1,IEL)} + \var{PRODUC(2,IEL)} + \var{PRODUC(3,IEL)} \right] $
+\item [$\Rightarrow$] $\displaystyle \var{TRRIJ }= \frac{1}{2} (R^n_{ii})_L $
+\item [$\Rightarrow$] $\displaystyle \var{SMBR(IEL)} = \var{SMBR(IEL)} + \rho^n_L
+|\Omega_l| \left[ -C_{\varepsilon_2} \ \frac{2\,(\varepsilon^n_L)^2}{(R^n_{ii})_L} + C_{\varepsilon_1} \ \frac{\varepsilon^n_L}{(R^n_{ii})_L}\ (\mathcal{P}^n_{ii})_L \right] $
+\item [$\Rightarrow$] $\displaystyle \var{ROVSDT(IEL)} = \var{ROVSDT(IEL)} + C_{\varepsilon_2} \ \rho^n_L \ |\Omega_l| \ \frac{2\,\varepsilon^n_L}{(R^n_{ii})_L}$
+\end{itemize}
+
+\item Appel de \fort{rijthe} pour le calcul des termes de gravit\'e $\mathcal{G}^n_{\varepsilon}$ et ajout dans \var{SMBR}.
+
+$ \var{SMBR} = \var{SMBR} + \mathcal{G}^n_{\varepsilon}$\\
+Ce calcul n'a lieu que si $\var{IGRARI()} = 1$.
+
+\item Calcul de la diffusion de $\varepsilon$ \\
+ Le terme $\dive \left[\mu\, \grad(\varepsilon) + \tens{A'}\,\grad(\varepsilon)
+\right]$ est calcul\'e exactement de la m\^eme mani\`ere que pour les tensions
+de Reynolds $R_{ij}$ en rempla\c cant $\tens{A}$ par $\tens{A'}$.
+
+\item Appel de \fort{codits} pour la r\'esolution de l'\'equation de
+convection/diffusion/termes sources de la variable principale $\varepsilon$. Le
+r\'esultat $\varepsilon^{\,n+1}$ est stock\'e dans le tableau \var{RTP} des
+variables mises \`a jour.
+}
+\end{itemize}
+
+\etape{clippings finaux}
+On passe enfin dans le sous-programme \fort{clprij} pour faire un clipping \'eventuel
+des variables $R^{\,n+1}_{ij}$ et $\varepsilon^{\,n+1}$. Le sous-programme
+\fort{clprij} est appel\'e\footnote{L'option
+$\var{ICLIP} = 1$ consiste en un clipping minimal des variables $R_{ii}$ et
+$\varepsilon$ en prenant la valeur absolue de ces variables puisqu'elles ne
+peuvent \^etre que positives.} avec $\var{ICLIP} = 2$ . Cette option
+\footnote{Quand la valeur des grandeurs $R_{ii}$ ou $\varepsilon$ est
+n\'egative, on la remplace par le minimum entre sa valeur absolue et (1,1)
+fois la valeur obtenue au pas de temps pr\'ec\'edent.} contient l'option $\var{ICLIP} = 1$ et permet de v\'erifier l'in\'egalit\'e de Cauchy-Schwarz sur les grandeurs extra-diagonales du tenseur $\tens{R}$ (pour $i \neq j$, $|R_{ij}|^2 \le R_{ii} R_{jj}$).
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Sauf mention explicite, $\phi$ repr\'esentera une tension de Reynolds ou la dissipation turbulente ($\phi = R_{ij} \ \text{ou} \ \varepsilon$).
+
+\begin{itemize}
+\item {La vitesse utilis\'ee pour le calcul de la production est explicite. Est-ce qu'une implicitation peut am\'eliorer la pr\'ecision temporelle de $\phi$ \footnote{Cette remarque peut \^etre g\'en\'eralis\'ee. En effet, peut-on envisager d'actualiser les variables d\'ej\`a r\'esolues (sans r\'eactualiser les variables turbulentes apr\`es leur r\'esolution)? Ceci obligerait \`a modifier les sous-programmes tels que \fort{condli} qui sont appel\'es au d\'ebut de la boucle en temps.} ?}
+\item {Dans quelle mesure le terme d'\'echo de paroi est-il valide ? En effet, ce terme est remis en question par certains auteurs.}
+\item {On peut envisager la r\'esolution d'un syst\`eme hyperbolique pour les
+tensions de Reynolds afin d'introduire un couplage avec le champ de vitesse.}
+\item {Le flux au bord \var{VISCB} est annul\'e dans le sous-programme
+\fort{vectds}. Peut-on envisager de mettre au bord la valeur de la variable
+concern\'ee \`a la cellule de bord correspondant? De m\^eme, il faudrait se
+pencher sur les hypoth\`eses sous-jacentes \`a l'annulation des contributions
+aux bords de \var{VISCB} lors du calcul de : $$\left[ \tens{D}^n\,\left( \grad{R^{\,n}_{ij}} - (\grad R^{\,n}_{ij}\,.\,\vect{n}_{\,lm})\,\vect{n}_{\,lm}\right) \right]\,.\,\vect{n}_{\,lm}.$$}
+\item {Un probl\`eme de pond\'eration appara\^\i t plus g\'en\'eralement. Si on prend la partie explicite de $\tens{D}\,\grad(\phi)$, la pond\'eration aux faces internes utilise le coefficient $\displaystyle\frac{1}{2}$ avec pond\'eration s\'epar\'ee de $\tens{D}$ et $\grad(\phi)$, alors que pour $\tens{E}\,\grad(\phi)$, on calcule d'abord ce terme aux cellules pour ensuite l'interpoler lin\'eairement aux faces \footnote{Cette interpolation se fait dans \fort{vectds} avec des coefficient [...]
+\item {On laisse la possibilit\'e dans \fort{visort} d'utiliser une moyenne
+harmonique aux faces. Est-ce que ceci est valable puisque les interpolations
+utilis\'ees lors du calcul de la partie explicite de $\tens{A}\,\grad{\phi}$
+sont des moyennes arithm\'etiques ?}
+\item {Les techniques adopt\'ees lors du clipping sont \`a revoir.}
+\item {On utilise dans le cadre du mod\`ele $\displaystyle R_{ij}-\varepsilon $ une semi-implicitation de termes comme $\displaystyle \phi_{ij,1}$ ou $\displaystyle -\rho\,C_{\varepsilon_2}\,\frac{\varepsilon}{k}\,\varepsilon$. On peut envisager le m\^eme type d'implicitation dans \fort{turbke} m\^eme en pr\'esence du couplage $\displaystyle k-\varepsilon$.}
+\item L'adoption d'une r\'esolution d\'ecoupl\'ee fait perdre l'invariance par rotation.
+\item La formulation et l'implantation des conditions aux limites de paroi
+devront \^etre v\'erifi\'ees. En effet, il semblerait que, dans certains cas, des ph\'enom\`enes
+``oscillatoires'' apparaissent, sans qu'il soit ais\'e d'en d\'eterminer la cause.
+\item L'implicitation partielle (du fait de la r\'esolution d\'ecoupl\'ee) des
+conditions aux limites conduit souvent \`a des calculs instables. Il
+conviendrait d'en conna\^\i tre la raison. L'implicitation partielle avait
+\'et\'e mise en \oe uvre afin de tenter d'utiliser un pas de temps plus grand
+dans le cas de jets axisym\'etriques en particulier.
+
+\end{itemize}
diff --git a/doc/theory/viscfa.tex b/doc/theory/viscfa.tex
new file mode 100644
index 0000000..95136c3
--- /dev/null
+++ b/doc/theory/viscfa.tex
@@ -0,0 +1,136 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{viscfa}
+%
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Dans ce sous-programme est calcul\'e le coefficient de diffusion isotrope aux
+faces. Ce coefficient fait intervenir la valeur de la viscosit� aux faces
+multipli�e par le rapport surface de la face sur la distance alg\'ebrique $\overline{I'J'}$ ou $\overline{I'F}$({\it cf.} figure \ref{Base_Viscfa_fig_geom}),
+rapport r�sultant de l'int�gration du terme de diffusion.
+ Par analogie du terme calcul�, ce sous-programme est aussi appel� par le
+sous-programme \fort{resolp} pour calculer le coefficient ``diffusif'' de la pression faisant intervenir le pas de temps.\\
+La valeur de la viscosit� aux faces est d�termin�e soit par une moyenne
+arithm�tique, soit par une moyenne harmonique de la viscosit� au centre des
+cellules, suivant le choix de l'utilisateur. Par d�faut, cette valeur est calcul�e par une moyenne arithm�tique.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation} \label{Base_Viscfa_paragraphe2}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+On rappelle dans la figure \ref{Base_Viscfa_fig_geom}, la d�finition des diff�rents
+points g�om�triques utilis�s par la suite.
+
+\begin{figure}[h]
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4.5cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4.5cm]{facebord}}}
+\caption{\label{Base_Viscfa_fig_geom}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+
+L'int�gration du terme de diffusion sur une cellule $\Omega_i$ est la suivante :
+\begin{equation}
+\int_{\Omega_i}\dive (\mu\,\grad(f))\,d\Omega= \sum\limits_{j \in
+Vois(i)}\mu_{\,ij} \frac{f_{J'}-f_{I'}}{\overline{I'J'}}\,.\, S_{\,ij} + \sum\limits_{k \in
+\gamma_b(i)}\mu_{\,b_{ik}} \frac{f_{\,b_{ik}}- f_{I'}}{\overline{I'F}}\,.\,S_{\,b_{ik}}
+\end{equation}
+Dans ce sous-programme, on calcule les termes de diffusion
+$\displaystyle \mu_{\,ij}\frac{S_{\,ij}}{\overline{I'J'}}$ et $\displaystyle
+\mu_{\,b_{ik}}\,.\,\frac{S_{\,b_{ik}}}{\overline{I'F}}$.\\
+
+La valeur de la viscosit� sur la face interne $ij$, $\mu_{\,ij}$, est calcul�e :\\
+\hspace*{1.cm} {\tiny$\bigstar$} soit par moyenne arithm�tique :
+\begin{equation}
+\mu_{\,ij}=\alpha_{\,ij}\mu_{\,i}+(1-\alpha_{\,ij})\mu_{\,j}
+\end{equation}
+avec $\alpha_{\,ij} = 0.5$ car ce choix semble stabiliser, bien que cette
+interpolation soit d'ordre 1 en espace en convergence.\\
+\hspace*{1.cm} {\tiny$\bigstar$} soit par moyenne harmonique :
+\begin{equation}\notag
+\mu_{\,ij}=\frac{\mu_{\,i}\ \mu_{\,j}}{\alpha_{\,ij}\mu_{\,i}+(1-\alpha_{\,ij})\mu_{\,j}}
+\end{equation}
+avec $\alpha_{\,ij}=\displaystyle \frac{\overline{FJ'}}{\overline{I'J'}}$.\\
+
+La valeur de la viscosit� sur la face de bord $ik$, $\mu_{\,b_{ik}}$, est d�finie
+ainsi :\\
+\begin{equation}\notag
+\mu_{\,b_{ik}}=\mu_I.
+\end{equation}
+\minititre{Remarque}
+Lors de l'appel de \fort{viscfa} par le sous-programme \fort{resolp}, le terme
+\`a consid\'erer est :
+\begin{equation}\notag
+\dive (\,\Delta t^n \ \grad(\delta p)\,)
+\end{equation}
+soit :
+\begin{equation}\notag
+\mu = \mu^n = \Delta t
+\end{equation}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+La valeur de la viscosit� au centre des cellules est entr�e en argument {\it
+via} la variable \var{VISTOT}. On calcule sa valeur moyenne aux faces et on la
+multiplie par le rapport surface \var{SURFN} sur la distance alg\'ebrique
+\var{DIST} pour une face interne (\var{SURFBN} et \var{DISTBR} respectivement
+pour une face de bord). La valeur du terme de diffusion r�sultant est mise dans le vecteur \var{VISCF} pour une face interne et \var{VISCB} pour une face de bord.\\
+La variable \var{IMVISF} d�termine quel type de moyenne est utilis� pour
+calculer la viscosit� aux faces.\\
+Si \var{IMVISF}$=0$, la moyenne est arithm�tique, sinon la moyenne est harmonique.\\
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+L'obtention des interpolations utilis�es dans le code \CS du paragraphe \ref{Base_Viscfa_paragraphe2} est r�sum�e dans le rapport de Davroux et
+al\footnote{Davroux A., Archambeau F. et H�rard J.M., Tests num�riques sur
+quelques m�thodes de r�solution d'une �quation de diffusion en volumes finis,
+HI-83/00/027/A.}.
+Les auteurs de ce rapport ont montr� que, pour un maillage monodimensionnel irr�gulier et avec une
+viscosit� non constante, la convergence mesur�e est d'ordre 2 en espace avec
+l'interpolation harmonique et d'ordre 1 en espace avec l'interpolation
+lin�aire (pour des solution r�guli�res).\\
+Par cons�quent, il serait pr�f�rable d'utiliser l'interpolation harmonique pour
+calculer la valeur de la viscosit� aux faces. Des tests de stabilit� seront n�cessaires au pr�alable.
+\\
+De m�me, on envisage d'extrapoler la viscosit� sur les faces de bord plut�t que
+de prendre la valeur de la viscosit� au centre de la cellule jouxtant cette face.\\
+Dans le cas de la moyenne arithm\'etique, l'utilisation de la valeur $0.5$ pour les coefficients $\alpha_{\,ij}$ serait \`a revoir.
diff --git a/doc/theory/visort.tex b/doc/theory/visort.tex
new file mode 100644
index 0000000..2f82a2b
--- /dev/null
+++ b/doc/theory/visort.tex
@@ -0,0 +1,195 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{visort}
+%
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Dans ce sous-programme est calcul\'e le coefficient de diffusion ``orthotrope'' aux faces. Ce type de coefficient se rencontre pour la diffusion de $R_{\,ij}$ et
+$\varepsilon$ en $R_{\,ij}-\varepsilon$ ( {\it cf.} \fort{turrij}), ainsi que pour la
+correction de pression dans le cadre de l'algorithme avec couplage
+vitesse-pression renforc� (\fort{resolp}).\\
+Ce coefficient fait intervenir la valeur de la viscosit� aux faces multipli�e par
+le rapport surface de la face sur la distance alg\'ebrique $\overline{I'J'}$,
+rapport r�sultant de l'int�gration du terme de diffusion.
+La valeur de la viscosit� aux faces est bas�e soit sur une moyenne
+arithm�tique, soit sur une moyenne harmonique de la viscosit� au centre des
+cellules.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation} \label{Base_Visort_paragraphe2}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+La figure \ref{Base_Visort_fig_geom} rappelle les diverses d\'efinitions g\'eom\'etriques
+pour les faces internes et les faces de bord.
+
+\begin{figure}[h]
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4.5cm]{facette}}}
+\parbox{8cm}{%
+\centerline{\includegraphics[height=4.5cm]{facebord}}}
+\caption{\label{Base_Visort_fig_geom}D\'efinition des diff\'erentes entit\'es
+g\'eom\'etriques pour les faces internes (gauche) et de bord (droite).}
+\end{figure}
+L'int�gration du terme de diffusion ``orthotrope'' sur une cellule est la
+suivante :
+\begin{equation}
+\int_{\Omega_i}\dive \,(\tens{\mu}\ \grad f)\,d\Omega =\sum\limits_{j \in
+Vois(i)}( \tens{\mu}\ \grad f)_{\,ij}\,.\,\underline{S}_{\,ij} + \sum\limits_{k \in
+\gamma_b(i)}( \tens{\mu}\ \grad f)_{\,b_{ik}}\,.\,\underline{S}_{\,b_{ik}}
+\end{equation}
+avec :
+\begin{equation}
+\tens{\mu}=\begin{bmatrix}\mu_x & 0 & 0 \\ 0 & \mu_y & 0 \\ 0 & 0 & \mu_z \end{bmatrix}
+\end{equation}
+et :
+\begin{equation}
+\begin{array}{ll}
+&\underline{S}_{\,ij} = S_{\,ij} \underline{n}_{\,ij} \\
+&\underline{S}_{\,b_{ik}} = S_{\,b_{ik}} \underline{n}_{\,b_{ik}}
+\end{array}
+\end{equation}
+Le terme $(\tens{\mu}\ \grad(f))_{\,ij}\underline{n}_{\,ij}$ est calcul� �
+l'aide de la d�composition suivante :
+\begin{equation}
+(\tens{\mu}\ \grad f)_{\,ij} = (\grad f \,.\,\underline{n}_{\,ij})\ \tens{\mu}\
+\underline{n}_{\,ij}+
+(\grad f .\underline{\tau}_{ij})\ \tens{\mu}\ \underline{\tau}_{\,ij}
+\end{equation}
+o\`u $\underline{\tau}_{ij}$ repr�sente un vecteur tangent (unitaire) �
+la face. Une d�composition similaire est utilis�e aux faces de bord.\\
+Dans la matrice, seul le terme
+$(\grad f \,.\,\underline{n}_{\,ij})\ \tens{\mu}\ \underline{n}_{\,ij}$ est
+int\'egrable facilement en implicite. Par cons\'equent, la partie projet\'ee sur $\underline{\tau}_{\,ij}$
+est :
+\begin{itemize}
+\item n\'eglig\'ee dans le cas du calcul des �chelles de temps relatives au
+couplage vitesse-pression renforc�,
+\item trait\'ee en explicite dans les termes de diffusion de
+$R_{\,ij}-\varepsilon$ (\emph{cf.} \fort{turrij}).\\
+\end{itemize}
+L'int�gration implicite du terme de diffusion s'\'ecrit :
+\begin{equation}
+\int_{\Omega_i}\dive\,(\tens{\mu}\ \grad f )\,d\Omega = \sum\limits_{j \in
+Vois(i)}(\tens{\mu}\ \underline{n}_{\,ij})\,.\,\underline{S}_{\,ij}\,
+\frac{f_{J'}-f_{I'}}{\overline{I'J'}} + \sum\limits_{k \in
+\gamma_b(i)}(\tens{\mu}\ \underline{n}_{\,b_{ik}})\,.\,\underline{S}_{\,b_{ik}}
+\,\frac{f_{\,b_{ik}}-f_{I'}}{\overline{I'F}}
+\end{equation}
+Dans ce sous-programme, on calcule le terme
+$\displaystyle \frac{(\tens{\mu}\
+\underline{n}_{\,ij})\,.\,\underline{S}_{\,ij}}{\overline{I'J'}}$ \`a l'aide la
+formule :
+\begin{equation}\notag
+(\tens{\mu}\ \underline{n}_{\,ij})\,.\,\underline{n}_{\,ij} =
+\mu_{\,ij}^{\,moy}=\mu_{\,ij}^{\,x} ( n_{\,ij}^{\,x})^2 + \mu_{\,ij}^{\,y} (n_{\,ij}^{\,y})^2 + \mu_{\,ij}^{\,z}(n_{\,ij}^{\,z})^2
+\end{equation}
+soit encore :
+\begin{equation}\notag
+\mu_{\,ij}^{\,moy}=\frac{\mu_{\,ij}^{\,x}
+(S_{\,ij}^{\,x})^2 + \mu_{\,ij}^{\,y} (S_{\,ij}^{\,y})^2 +
+\mu_{\,ij}^{\,z} (S_{\,ij}^{\,z})^2}{S_{\,ij}^2}
+\end{equation}
+Au bord, on calcule de m�me :
+\begin{equation}\notag
+\displaystyle \frac{(\tens{\mu}\
+\underline{n}_{\,b_{ik}})\,.\,\underline{S}_{\,b_{ik}}}{\overline{I'F}}
+\end{equation}
+
+ avec :
+\begin{equation}\notag
+(\tens{\mu}\ \underline{n}_{\,b_{ik}})\,.\,\underline{n}_{\,b_{ik}} =
+\mu_{\,b_{ik}}^{\,moy} = \displaystyle \frac{\mu_{I}^{\,x}
+(S_{\,b_{ik}}^{\,x})^2 + \mu_{I}^{\,y} (S_{\,b_{ik}}^{\,y})^2 +
+\mu_{I}^{\,z} (S_{\,b_{ik}}^{\,z})^2}{S_{\,b_{ik}}^2}
+\end{equation}
+
+La valeur de la viscosit� dans une direction $l$ sur la face, $\mu_{\,ij}^{\,l}$,
+est calcul�e :
+\begin{itemize}
+\item soit par interpolation lin\'eaire :
+\begin{equation}
+\mu_{\,ij}^{\,l}=\alpha_{\,ij}\mu_{i}^{\,l}+(1-\alpha_{\,ij})\mu_{j}^{\,l}
+\end{equation}
+avec $\alpha_{\,ij}= 0.5$ car ce choix semble stabiliser bien que cette
+interpolation soit d'ordre 1 en espace en convergence,
+\item soit par interpolation harmonique :
+\begin{equation}\notag
+\mu_{\,ij}^{\,l}=\displaystyle
+\frac{\mu_{i}^{\,l}\ \mu_{j}^{\,l}}{\alpha_{\,ij}\mu_{i}^{\,l}+(1-\alpha_{\,ij}) \mu_{j}^{\,l}}
+\end{equation}
+o� :
+\begin{equation}\notag
+\displaystyle \alpha_{\,ij}=\frac{\overline{FJ'}}{\overline{I'J'}}
+\end{equation}
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+La viscosit� orthotrope au centre des cellules est entr�e en argument {\it via}
+les variables $\var{W}_1$, $\var{W}_2$ et $\var{W}_3$. On calcule la valeur
+moyenne de chaque viscosit� aux faces de fa�on arithm�tique ou
+harmonique. Ensuite, on calcule la viscosit� �quivalente correspondant �
+$\displaystyle (\tens{\mu}\ \underline{n}_{\,ij})\,.\,\frac{\underline{S}_{\,ij}}{\overline{I'J'}}$ pour les
+faces internes et � $\displaystyle (\tens{\mu}\ \underline{n}_{\,b_{ik}})\,.\,
+\frac{\underline{S}_{\,b_{ik}}}{\overline{I'F}}$ pour les faces de bord.\\
+
+Cette \'ecriture fait intervenir les vecteurs surface stock\'es dans le tableau
+\var{SURFAC}, la norme de la surface \var{SURFN}
+ et la distance alg\'ebrique \var{DIST} pour une face interne (\var{SURFBO},
+\var{SURFBN} et \var{DISTBR} respectivement pour une face de bord). La valeur du
+terme de diffusion r�sultant est mise dans le vecteur \var{VISCF} (\var{VISCB} aux faces de bord).\\
+La variable \var{IMVISF} d�termine quel type de moyenne est utilis� pour
+calculer la viscosit� dans une direction \`a la face. Si \var{IMVISF}$=0$, alors
+la moyenne est arithm�tique, sinon la moyenne est harmonique).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+L'obtention des interpolations utilis�es dans le code \CS \ du paragraphe
+\ref{Base_Visort_paragraphe2} est r�sum�e dans le rapport de Davroux et al\footnote{Davroux A., Archambeau F. et H�rard J.M., Tests num�riques sur
+quelques m�thodes de r�solution d'une �quation de diffusion en volumes finis,
+HI-83/00/027/A.}.
+Les auteurs de ce rapport ont montr� que, pour un maillage monodimensionnel irr�gulier et avec une
+viscosit� non constante, la convergence mesur�e est d'ordre 2 en espace avec
+l'interpolation harmonique et d'ordre 1 en espace avec l'interpolation
+lin�aire (pour des solutions r�guli�res). Par cons�quent, il serait pr�f�rable d'utiliser l'interpolation
+harmonique pour calculer la valeur de la viscosit� aux faces. Des tests de stabilit� seront n�cessaires au pr�alable.\\
+De m�me, on envisage d'extrapoler la viscosit� sur les faces de bord plut�t que
+de prendre la valeur de la viscosit� de la cellule jouxtant cette face.\\
+Dans le cas de la moyenne arithm\'etique, l'utilisation de la valeur $0.5$ pour les coefficients $\alpha_{\,ij}$ serait \`a revoir.
diff --git a/doc/theory/vissec.tex b/doc/theory/vissec.tex
new file mode 100644
index 0000000..47b2a3e
--- /dev/null
+++ b/doc/theory/vissec.tex
@@ -0,0 +1,195 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+
+\programme{vissec}
+%
+
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Dans ce sous-programme sont calcul\'es les termes de gradient transpos� et de viscosit�
+secondaire (fluide newtonien). Ils seront trait�s en explicite
+pur. En effet, si on traitait ces termes en implicite, cela reviendrait
+� coupler les �quations des diff�rentes composantes de la vitesse, ce qui n'est
+pas compatible avec le sch\'ema de r\'esolution actuel ({\it cf. } sous-programme \fort{navsto}).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+L'int�gration des termes de gradient transpos�
+ $\dive\,(\mu_{\,tot}\,^t\,\ggrad(\underline{v}))$ et de viscosit�
+secondaire \\
+$-\displaystyle \frac{2}{3}\,\grad (\mu_{\,tot}\,\dive(\underline{v}))$ est la suivante\footnote{la viscosit� de volume
+$\kappa$ est suppos�e nulle, cf. \fort{navsto}} :
+\begin{equation}\notag
+\begin{array}{llll}
+&\displaystyle \int_{\Omega_i}\dive (\mu_{\,tot}
+\,^t\,\ggrad(\underline{v})\,)\,d\Omega \\
+&= \sum\limits_{l=x,y,z}\left[ \sum\limits_{j \in
+Vois(i)} \mu_{\,tot,ij} ((\displaystyle \frac {\partial v_x}{\partial
+l})_{\,moy,ij}\,n_{\,ij}^{\,x} +(\frac {\partial v_y}
+ {\partial l})_{\,moy,ij}\,n_{\,ij}^{\,y}+ \displaystyle(\frac {\partial v_z}
+{\partial l})_{\,moy,ij}\,n_{\,ij}^{\,z}) S_{\,ij}\right.\\
+&+\left.\displaystyle \sum\limits_{k \in \gamma_b(i)} \mu_{\,tot,\,b_{ik}}
+((\frac {\partial v_x}{\partial l})_{\,moy,\,b_{ik}}\,n_{\,b_{ik}}^{\,x} +(\frac
+{\partial v_y}{\partial l})_{\,moy,\,b_{ik}}\,n_{\,b_{ik}}^{\,y}+
+\displaystyle(\frac {\partial v_z}{\partial
+l})_{\,moy,\,b_{ik}}\,n_{\,b_{ik}}^{\,z}) S_{\,b_{ik}}\right] \underline
+{e}_{\,l} \\\\
+&-\displaystyle \frac{2}{3}\,\int_{\Omega_i}\grad (\mu_{\,tot} \dive\,(\underline{v}))
+\,d\Omega \\
+&= -\displaystyle \frac{2}{3}\,\sum\limits_{l=x,y,z}\left[\sum\limits_{j \in Vois(i)}(\mu_{\,tot}\,\dive(\underline{v}))_{\,ij} S_{\,ij}^{\,l} + \displaystyle \sum_{k \in \gamma_b(i)}(\mu_{\,tot}\,\dive(\underline{v}))_{\,b_{ik}} S_{\,b_{ik}}^{\,l}\right]\,\underline {e}_{\,l}
+\end{array}
+\end{equation}
+Le terme de viscosit� $\mu_{\,tot}$ est calcul� en fonction du mod�le de turbulence utilis� :
+\begin{equation}\notag
+\mu_{\,tot}=
+\begin{cases}
+\mu + \mu_t & \text{pour les mod�les � viscosit� turbulente ou en LES}, \\
+\mu& \text{pour les mod�les au second ordre ou en laminaire}.
+\end{cases}
+\end{equation}
+o� $\mu$ et $\mu_t$ repr\'esentent respectivement la viscosit\'e dynamique mol�culaire et la viscosit� dynamique turbulente.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{Terme de gradient transpos�}
+Avant de calculer l'int�gration des deux termes, on calcule dans un premier
+temps la viscosit� totale en fonction du mod�le de turbulence consid�r�.\\
+Les termes calcul�s dans ce sous-programme, appel� par \fort{preduv}, interviennent dans le second membre
+de l'�quation de quantit� de mouvement, et sont donc directement stock�s dans le
+tableau correspondant \var{TRAV}.\\
+Le terme $\dive\,(\mu_{\,tot}\,^t\ggrad(\underline{v}))$ est calcul� en
+op�rant comme suit.\\
+On effectue une boucle sur les composantes $v_\alpha$ o� $\alpha=x,y,z$ de la
+vitesse ($\alpha$ correspond � \var{ISOU} dans le code) :
+\begin{itemize}
+\item on calcule le gradient cellule de $v_{\,\alpha}$ par un appel au
+sous-programme \fort{grdcel}.
+\item on initialise un tableau nomm� $\var{W}_6$ � la valeur $1$ pour les cellules
+internes, et � la valeur $0$ pour les cellules de bord. Ce tableau sert par la suite � ne
+pas consid�rer la contribution du terme de gradient transpos� sur les cellules
+de bord. En effet, on ne sait pas \'ecrire de conditions aux limites correctes
+pour le gradient transpos\'e. On pr\'ef\`ere donc tout simplement annuler son
+effet sur les cellules de bord (\emph{cf.} paragraphe \ref{Base_Vissec_paragraphe4}).
+\item pour chaque direction $l$ ($l=x,y,z$), $l$ correspondant � \var{IDIM}
+dans le code, on calcule pour chaque cellule $\Omega_i$ dont le centre
+correspond � la variable \var{II} ou
+\var{JJ} (pour les centres voisins) dans le code :\\
+\begin{equation}\notag
+\begin{array}{ll}
+&\var{TRAV}(i,l)=\var{TRAV}(i,l)\\
+&+\var{W}_6(i)\ \left[\displaystyle \sum\limits_{j \in
+Vois(i)} \mu_{\,tot,\,ij}\,(\frac {\partial v_{\,\alpha}}{\partial l}
+)_{\,moy,ij}\,S_{\,ij}^{\,\alpha}\ + \displaystyle \sum_{k \in
+\gamma_b(i)} \mu_{\,tot,\, {b_{\,ik}}}\,(\frac {\partial v_{\,\alpha}}{\partial
+l})_{\,moy,{b_{\,ik}}}\,S_{\,{b_{\,ik}}}^{\,\alpha}\ \right]\\
+&\displaystyle\text{avec }
+(\frac{\partial v_{\,\alpha}}{\partial l})_{\,moy,ij}=\frac{1}{2}\left[
+(\frac{\partial v_{\,\alpha}}{\partial l})_i
++(\frac{\partial v_{\,\alpha}}{\partial l})_j\right]
+\end{array}
+\end{equation}
+\end{itemize}
+Fin de la boucle sur les composantes de la vitesse.\\
+\\
+\subsection{Terme de viscosit� secondaire}
+Le terme de seconde viscosit�
+ $-\displaystyle \frac{2}{3}\grad (\mu_{\,tot} \dive\,(\underline{v}))$
+ est calcul� de la fa�on suivante :
+\begin{itemize}
+\item on calcule la valeur de la vitesse sur la face $ij$ en divisant le flux
+masse connu � la face par la densit� moyenne $\rho_{\,moy,\,ij}$ de la face
+($\rho_{\,moy,\,ij}=\displaystyle \frac{\rho_{\,i}+\rho_{\,j}}{2}$).
+\item on calcule ensuite l'int�grale volumique de la divergence de la vitesse sur chaque cellule en appelant le sous-programme
+\fort{divmas}.
+\item on calcule alors pour chaque cellule $\Omega_i$ le terme $-\displaystyle
+\frac{2}{3}(\mu_{\,tot}\,\dive(\underline{v}))_{\,i}$ que l'on met dans le
+tableau de travail $\var{W}_4$. La valeur de ce terme sur la face interne $ij$
+ est obtenue en prenant la moyenne arithm�tique des valeurs des deux cellules
+avoisinantes (tableau \var{VISCF}) et celle sur la face de bord est prise �gale
+la valeur de la cellule avoisinante (tableau \var{VISCB}).
+\item on calcule alors pour chaque direction $l$ le terme final,
+\emph{i.e.} :\\
+\begin{equation}\notag
+\var{TRAV}(i,l)= \var{TRAV}(i,l)-\displaystyle \frac{2}{3}\left[\sum\limits_{j \in Vois(i)} (\mu_{\,tot}\,\dive(\underline{v}))_{\,moy,\,ij}\ S_{\,ij}^{\,l}
++\sum\limits_{k \in \gamma_b(i)} (\mu_{\,tot}
+\dive\,(\underline{v}))_{\,moy,{b_{\,ik}}}\ S_{\,b_{ik}}^{\,l}\right]
+\end{equation}
+\end{itemize}
+
+\vspace{0.5cm}
+Le traitement est similaire pour le terme de viscosit� de volume dans le module compressible.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter} \label{Base_Vissec_paragraphe4}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+L'int�gration du terme de gradient transpos� pose un probl�me de compatibilit�.
+En effet, le gradient transpos� provient de l'�criture de la divergence
+du tenseur des contraintes (\emph{cf.} \fort{preduv}), soit :
+\begin{equation}\notag
+\dive\,(\tens{\sigma}) = \dive\,(- p \tens{Id} + \tens{\tau })
+\end{equation}
+o� :
+\begin{equation}\notag
+\tens{\tau} = 2 \mu\ [\underbrace{\displaystyle \frac{1}{2}\,(\ggrad \underline
+{v}\ +\ ^t\ggrad \underline {v})}_{\text{partie 1}} -\underbrace{\displaystyle \frac{2}{3}\,tr(\,\frac{1}{2}\,(\ggrad \underline
+{v}\ +\ ^t\ggrad \underline {v}))\ \tens {Id}\ }_{\text{partie 2}}]
+\end{equation}
+Or, lorsque l'on int�gre la premi�re partie de la divergence de
+$\tens{\tau}$, on implicite le terme $\dive\,(\mu\,\ggrad \underline{v})$ et on
+explicite le gradient transpos� $\dive\,(\mu ^t\ggrad \underline{v})$.
+ Ce traitement fait intervenir la vitesse au centre des cellules. Elle ne
+v�rifie pas exactement la condition $\dive\,(\rho \underline{v})\,=\,0$. En
+effet, au cours de l'�tape de correction, on utilise un filtre Rhie et Chow
+(\emph{cf.} \fort{resolp}) et la vitesse n'est mise � jour qu'� la fin de
+l'�tape. Par contre, lorsque l'on int�gre la deuxi�me partie de
+la divergence de $\tens{\tau}$ de fa�on explicite, on utilise
+la vitesse issue du flux masse aux faces qui v�rifie la condition $\dive\,(\rho
+\underline{v})\,=\,0$ (du moins � $\rho$ constant, l'interpolation de $\rho$ �
+la face �tant �galement un point � consid�rer). Ainsi, la discr�tisation de ces
+deux parties n'est pas totalement coh�rente. Il serait utile de baser la
+discr�tisation de ces termes sur une vitesse v�rifiant la contrainte
+$\dive\,(\rho \underline{v})\,=\,0$.\\
+Pour la m�me raison, il est difficile de conna�tre les conditions aux limites du
+terme en gradient transpos�. Sur les cellules de bord, on sait uniquement que la
+contrainte totale normale doit �quilibrer le frottement et toutes les autres
+forces. Or, le tenseur des contraintes est scind� en une partie explicite et une partie implicite, donc c'est un peu difficile d'utiliser cette condition physique.\\
+Actuellement, la contribution aux cellules de bord du terme de gradient transpos� est
+annul�e, ce qui �limine l'influence des conditions aux limites mais n'est naturellement pas satisfaisant. Quelques essais d'int�gration des conditions aux limites pour ce terme n'ont pas �t� concluants jusqu'� pr�sent. Cependant, des essais suppl�mentaires
+sont envisageables.
diff --git a/doc/theory/vortex.tex b/doc/theory/vortex.tex
new file mode 100644
index 0000000..20d16b4
--- /dev/null
+++ b/doc/theory/vortex.tex
@@ -0,0 +1,445 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+\programme{vortex}
+%
+\vspace{1cm}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Fonction}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+Ce sous-programme est d�di� � la g�n�ration des conditions d'entr�e
+turbulente utilis�es en LES.
+
+
+La m�thode des vortex est bas�e sur une approche de tourbillons
+ponctuels. L'id�e de la m�thode consiste � injecter des tourbillons 2D dans le
+plan d'entr�e du calcul, puis � calculer le champ de vitesse induit par ces
+tourbillons au centre des faces d'entr�e.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Discr\'etisation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Pour utiliser la m�thode, on se place tout d'abord dans un rep�re local d�fini
+de mani�re � ce que le plan $(0yz)$, o� sont inject�s les vortex, soit confondu
+avec le plan d'entr�e du calcul (voir figure \ref{Base_Vortex_entree}).
+
+\begin{figure}[h]
+\centerline{\includegraphics[height=6cm]{entree}}
+\caption{\label{Base_Vortex_entree} D�finiton des diff�rentes grandeurs dans le rep�re local
+correspondant � l'entr�e d'une conduite de section carr�e.}
+\end{figure}
+
+$u$, $v$ et $w$ sont les composantes de la vitesse fluctuante (principale et
+transverse) dans ce plan, et
+$\displaystyle \omega(y,z) = \frac{\partial w}{\partial y}-\frac{\partial v}{\partial z}$
+la vorticit� dans la direction
+normale au plan d'entr�e. $\overline{U}(y,z)$ repr�sente ici la vitesse
+principale moyenne impos�e par l'utilisateur dans le plan d'entr�e.
+
+Chaque vortex $p$ va �tre caract�ris� par sa fonction de forme $\xi$ (identique
+pour tous les vortex), sa
+circulation $\Gamma_p$, son rayon $\sigma_p$ et les coordonn�es $(y_p,z_p)$ du
+point $P$ o� est situ� le vortex dans le plan $(0yz)$.
+
+Pour cela, on suppose que la vorticit� g�n�r�e par un vortex $p$ au point $M$ de
+coordonn�e $(y,z)$ s'�crit :
+\begin{equation}\notag
+\omega_p(y,z)= \Gamma_p \, \xi_{\sigma_p}(r)
+\end{equation}
+o� $r = \sqrt{(y-y_p)^2+(z-z_p)^2}$ est la distance s�parant le point $M$ du point $P$.
+
+Dans la m�thode implant�e, la fonction de forme est de type gaussienne modifi�e :
+\begin{equation}\notag
+\displaystyle
+\xi_\sigma (r) = \frac{1}{2\pi \sigma^2}
+\left(2 e^{-\frac{r^2}{2\sigma^2}}-1\right) e^{-\frac{r^2}{2\sigma^2}}
+\end{equation}
+
+Le champ de vitesse induit par cette distribution de vorticit� s'obtient par
+inversion des deux �quations de poisson suivantes qui sont d�duites de la
+condition d'incompressibilit� dans la plan\footnote{\textit{i.e}
+$\displaystyle \frac{\partial v}{\partial y}+\frac{\partial w}{\partial w} = 0$} :
+\begin{equation}\notag
+\begin{array}{lcr}
+\displaystyle
+\frac{\partial \omega}{\partial y} = \Delta w
+&
+\text{ et }
+&
+\displaystyle
+\frac{\partial \omega}{\partial y} = -\Delta v
+\\
+\end{array}
+\end{equation}
+
+Dans le cas g�n�ral, ce syst�me peut �tre int�gr� � l'aide de la formule de Biot et Savart.
+
+Dans le cas d'une distribution de vorticit� de type gaussienne modifi�e, les
+composantes de vitesse v�rifient :
+\begin{equation}\notag
+\left\{
+\begin{array}{c}
+\displaystyle
+v_p(y,x) = - \frac{1}{2\pi} \frac{(z-z_p)}{r^2}\left(1 -
+e^{-\frac{r^2}{2\sigma^2}}\right)\,e^{-\frac{r^2}{2\sigma^2}}
+\\
+\displaystyle
+w_p(y,z) = \frac{1}{2\pi} \frac{(y-y_p)}{r^2}\left(1 -e^{-\frac{r^2}{2\sigma^2}}
+\right)\,e^{-\frac{r^2}{2\sigma^2}}
+\end{array}
+\right.
+\end{equation}
+
+Ces relations s'�tendent de fa�on imm�diate au cas de $N$ vortex distincts.
+Le champ de vitesse induit par la distribution de vorticit�
+\begin{equation}
+\omega(y,z) = \sum_{p=1}^N \Gamma_p \, \xi_{\sigma_p}(r)
+\end{equation}
+vaut au point $M$ :
+\begin{equation}\notag
+\begin{array}{lcr}
+v(x,y) = \sum_{p=1}^N \Gamma_p\, v_p(y,z)
+&
+\text{ et }
+&
+w(y,z) = \sum_{p=1}^N \Gamma_p\, w_p(y,z)
+\\
+\label{Base_Vortex_compvit}
+\end{array}
+\end{equation}
+%================================
+\subsection{Param�tres physiques}
+%================================
+
+%-------------------------------
+\subsubsection{Marche en temps}
+%-------------------------------
+La position initiale de chaque vortex est tir�e de mani�re al�atoire. On calcul
+les d�placements successifs de chacun des vortex dans le plan d'entr�e par
+int�gration explicite du champ de vitesse lagrangien :
+\begin{equation}\notag
+\begin{array}{lcr}
+\displaystyle
+\frac{dy_p}{dt} = V(y,z)
+&
+\text{ et }
+&
+\displaystyle
+\frac{dz_p}{dt} = W(y,z)
+\\
+\end{array}
+\end{equation}
+Les vortex sont alors assimil�s � des particules ponctuelles qui sont convect�es
+par le champ $(V,W)$. Ce champ peut �tre impos� par des tirages al�atoires ou
+bien d�duit de la vitesse induite par les vortex dans le plan d'entr�e. Dans ce
+cas $V(x,y) = \overline{V}(y,z) + v (y,z)$ et $W(y,z)= \overline{W}(y,z) +
+w(y,z)$ o� $\overline{V}$ et $\overline{W}$ sont les composantes de la vitesse
+transverse moyenne qu'impose l'utilisateur � l'aide des fichiers de donn�es.
+
+%---------------------------------------------------
+\subsubsection{Intensit� et dur�e de vie des vortex}
+%---------------------------------------------------
+Il serait possible, � partir de l'�quation de transport de la vorticit�,
+d'obtenir un mod�le d'�volution pour l'intensit� du vecteur tourbillon
+$\omega_p$ associ� � chacun des vortex. En pratique, on pr�f�re utiliser un
+mod�le simplifi� dans lequel la circulation des tourbillons ne d�pend que de la
+postion de ces derniers � l'instant consid�r�. La circulation initiale de chaque
+vortex est alors obtenue � partir de la relation :
+\begin{equation}\notag
+|\Gamma_p| = 4 \sqrt{\frac{\pi\,S\,k}{3N\,[2ln(3)-3ln(2)]}}
+\end{equation}
+o� $S$ est la surface du plan d'entr�e, $N$ le nombre de vortex, et $k$
+l'�nergie cin�tique turbulente au point o� se trouve le vortex � l'instant
+consid�r�. Le signe de $\Gamma_p$ correspond au sens de rotation du vortex et
+est tir� al�atoirement.
+
+Ce param�tre est celui qui contr�le l'intensit� des fluctuations. Sa d�pendance
+en $k$ exprime que, plus l'�coulement est turbulent, plus les vortex sont
+intenses. La valeur de $k$ est sp�cifi�e par
+l'utilisateur. Elle peut �tre constante ou impos�e � partir de profils d'�nergie
+cin�tique turbulente en entr�e.
+
+Pour �viter que des structures trop allong�es ne se d�veloppent au niveau de
+l'entr�e, l'utilisateur doit �galement sp�cifier un temps limites $\tau_p$ au
+bout duquel le vortex $p$ va �tre d�truit. Ce temps $\tau_p$ peut �tre pris
+constant ou estim� au moyen de la relation :
+\begin{equation}\notag
+\tau_p = \frac{5 C_{\mu}k^{\frac{3}{2}}}{\varepsilon\,\overline{U}}
+\end{equation}
+
+$\overline{U}$ et $\varepsilon$ repr�sentent respectivement la vitesse moyenne
+principale et la dissipation turbulente au point o� est initialement g�n�r� le
+vortex ($C_{\mu}=0,09$).
+\\
+Lorsque le temps �coul� depuis la cr�ation du vortex $p$ est sup�rieur �
+$\tau_p$, le vortex est d�truit et un nouveau vortex g�n�r� (sa position et le
+signe de $\Gamma_p$ sont tir�s de fa�on al�atoire).
+
+%--------------------------------
+\subsubsection{Taille des vortex}
+%--------------------------------
+La taille des vortex peut �tre prise constante, ou calcul�e � partir des
+relations :
+\begin{equation}\notag
+\begin{array}{ccc}
+\displaystyle
+\sigma = \frac{C_{\mu}^{\frac{3}{4}}k^{\frac{3}{2}}}{\varepsilon}
+& \text{ ou } &
+\sigma = max[L_t,L_k]
+\\
+\end{array}
+\end{equation}
+avec:
+\begin{equation}\notag
+\begin{array}{ccc}
+\displaystyle
+L_t = \sqrt{\left( \frac{5 \nu k}{\varepsilon} \right)}
+& \text{ et } &
+\displaystyle
+L_k = 200\, \left(\frac{\nu^3}{\varepsilon}\right)^{\frac{1}{4}}
+\end{array}
+\end{equation}
+o� $\nu$, $k$ et $\varepsilon$ sont la viscosit� dynamique, l'�nergie cin�tique
+turbulente et la dissipation turbulente au point o� se trouve le vortex.
+
+Dans tous les cas, la taille du vortex doit �tre sup�rieure � la taille des
+mailles en entr�e afin que le vortex soit effectivement simul�.
+
+%==================================
+\subsection{Conditions aux limites}
+%==================================
+Le champ de vitesse g�n�r� � l'aide de la relation \ref{Base_Vortex_compvit} ne tient pas
+compte {\em a priori} des conditions aux limites appliqu�es sur les bords du plan
+d'entr�e. Pour obtenir des valeurs de la vitesse qui soient coh�rentes sur les
+fronti�res du domaine d'entr�e, des ``vortex images'', pseudo-vortex situ�s en
+dehors du domaine d'entr�e, sont g�n�r�s � des positions particuli�res et leur
+champ de vitesse associ� est superpos� au champ pr�c�demment calcul�.\\
+Seuls les cas d'une conduite rectangulaire et d'une conduite circulaire
+permettent la g�n�ration de ces pseudo-vortex.
+On distingue pour cela trois types de conditions aux limites.
+
+\begin{figure}[h]
+\centerline{\includegraphics[height=6cm]{condlimite}}
+\caption{\label{Base_Vortex_condli} Principe de g�n�ration des ``vortex images'' suivant le
+type de conditions aux limites dans une conduite carr�e.}
+\end{figure}
+
+%----------------------------------
+\subsubsection{Condition de paroi}
+%----------------------------------
+On cr�e, pour chaque vortex $P$ contenu dans le plan d'entr�e, un vortex image
+$P'$ identique � $P$ (\textit{i.e} de m�me caract�ristiques) et sym�trique de $P$
+par rapport au
+point $J$ ($J$ �tant la projection orthogonalement � la paroi du point $M$
+correspondant au centre de la face o� l'on cherche � calculer la vitesse). La
+figure \ref{Base_Vortex_condli} illustre la technique dans le cas d'une conduite
+carr�e. Dans ce cas les coordonn�es du vortex situ� en $P'$ v�rifient
+$(y_{p'}+y_{p})/2 = y_{J}$ et $(z_{p'}+ z_{p})/2 = z_{J}$. Le champ de vitesse
+per�u depuis le point $M$ au niveau du point $J$ est nul, ce qui est bien
+l'effet recherch�.
+
+%------------------------------------
+\subsubsection{Condition de sym�trie}
+%-------------------------------------
+La technique est identique � celle utilis�e pour les conditions de paroi, mais
+seule la composante pour la vitesse normale au bord est modifi�e dans ce cas.
+
+%---------------------------------------
+\subsubsection{Condition de p�riodicit�}
+%---------------------------------------
+On cr�e pour chaque vortex, un vortex images $P'$ identique � $P$ mais translat�
+d'une quantit� $L$ correspondant � la longueur qui s�pare les deux plans de la
+section d'entr�e o� sont appliqu�es les conditions de p�riodicit�. Dans le cas
+o� il y a deux directions de p�riodicit�, on cr�e deux vortex image.
+
+%=============================================
+\subsection{Composante de vitesse principale}
+%=============================================
+La m�thode des vortex ne g�n�rant pas de fluctuation $u$ de la vitesse dans la
+direction principale, la derni�re composante est calcul�e � partir d'une
+�quation de Langevin. Les coefficients de cette �quation sont d�termin�s par
+identification des expressions obtenues pour les contraintes de Reynolds en
+$R_{ij}-\varepsilon$. Dans le cas d'un �coulement en canal plan, cette technique
+conduit � l'�quation :
+\begin{equation}\notag
+\displaystyle
+\frac{du}{dt} = - \frac{C_1}{2T} u + \left(\frac{2}{3}C_2-1\right)\frac{\partial
+U}{\partial y} v + \sqrt{C_0\varepsilon} dW_i
+\end{equation}
+
+avec $\displaystyle T=\frac{k}{\varepsilon}$, $C_1 = 1,8$, $C_2 = 0,6$,
+$C_0=\frac{14}{15}$, et $dW_i$ une variable al�toire Gaussienne de variance
+$\sqrt{dt}$.
+
+En pratique, l'�quation de Langevin n'am�liore pas vraiment les r�sultats. Elle
+n'est utilis�e que dans le cas de conduites circulaires.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Mise en \oe uvre}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\begin{itemize}
+\item[$\star$] Apr�s une �tape de pr�paration de la m�moire (\fort{memvor}), on
+rep�re dans \fort{usvort} les faces d'entr�e pour lesquelles la m�thode va �tre
+utilis�e.
+\item[$\star$] V�rification des dimensions rentr�es (\fort{vervor}).
+\\
+\item[$\star$] Le sous-programme \fort{vorpre} se charge ensuite de pr�parer le
+calcul (transmission de la g�om�trie des entr�es � tous les processeurs en cas
+de parall�lisme, et construction d'un tableau de connectivit�). Le
+sous-programme proc�de ainsi :
+\\
+\begin{itemize}
+
+\item[$\bullet$] On compte, pour chaque entr�e \var{IENT}, le nombre de faces o�
+est appliqu�e la m�thode. Celui-ci est stock� dans le tableau
+\var{ICVOR(IENT)}. Un passage dans la sous-routine \fort{memvor} (avec
+\var{IAPPEL = 2}) permet d'allouer la m�moire n�cessaire � cette phase de
+pr�paration.
+
+\item[$\bullet$] Pour chaque processeur, on stocke les coordonn�es des faces
+d'entr�e rep�r�es pr�c�demment dans les tableaux de travail
+\var{RA(IW1X),RA(IW1Y),RA(IW1Z),...}
+
+\item[$\bullet$] On regarde ensuite pour chaque processeur (boucle
+\var{IPROC=1, NRANGP-1}), si le processeur \var{IPROC} a des donn�es � envoyer
+aux autres processeurs (afin que tous disposent des coordonn�es).
+\begin{itemize}
+\item Si c'est le cas : \var{ICVOR(IENT)>0}, et on place les donn�es � envoyer
+dans les tableaux de travail \var{RA(IW2X),RA(IW2Y),RA(IW2Z),...}. La valeur
+\var{NCOMV = ICVOR(IENT)} correspond alors � la longueur des tableaux � envoyer.
+\item Sinon, on ne fait rien et \var{NCOM=0}.
+\end{itemize}
+\item[$\bullet$] Le processeur num�ro \var{IPROC} distribue � tous les autres
+processeurs la valeur \var{NCOM}. Si \var{NCOM > 0}, il envoie �galement les
+donn�es contenues dans les tableaux de travails \var{RA(IW2X),...}. Ces donn�es
+sont ensuite stock�es par tous les processeurs dans les tableaux
+\var{RA(IXYZV+III),...} afin de lib�rer les tableaux de travail pour la
+communication suivante, et l'indice \var{III = III + NCOM} est incr�ment� de
+mani�re � ranger les valeurs de fa�on chronologique.
+\\\\
+$\rightarrow$ Au final de la boucle sur \var{IPROC}, chaque processeur dispose
+des coordonn�es des faces d'entr�e pour lesquelles la m�thode va �tre utilis�e,
+et il est donc simple de construire la connectivit�.
+\\
+\item[$\bullet$] Construction de la connectivit�. Au final, la vitesse au centre
+de la \var{II} �me face d'entr�e utilisant la m�thode est contenue � la
+\var{IA(IIFAGL+II)} �me ligne du tableau \var{RA(IUVORT)}.
+
+\item[$\bullet$] La routine se termine par un appel au sous-programme
+\fort{memvor} ( avec \var{IAPPEL = 3}) afin de r�server la m�moire utile � la
+m�thode des vortex.
+\end{itemize}
+\end{itemize}
+\bigskip
+
+Cette phase d'initialisation est r�alis�e une seule fois au d�but du
+calcul. C'est apr�s cette phase seulement que commence la m�thode des vortex
+proprement dite.
+\\
+\begin{itemize}
+\item[$\star$] Initialisation des variables avant intervention utilisateur (\fort{inivor}).
+\item[$\star$] Appel au sous-programme utilisateur \fort{usvort} (\var{IAPPEL = 2}).
+\item[$\star$] V�rification des param�tres rentr�s (\fort{vervor}).
+\item[$\star$] Calcul de la vitesse par la m�thode des vortex (\fort{vortex})
+\begin{itemize}
+\item[$\bullet$] Initialisation du calcul g�n�ration du champ initial par appel
+au sous-programme \fort{vorini} :
+
+\begin{itemize}
+\item Construction du rep�re local (et calcul de l'�quation du plan d'entr�e
+suivant les cas), localisation du centre de l'entr�e, et transformation des
+coordonn�es de l'entr�e dans le rep�re local. Les tableaux \var{YZCEL(II,1)} et
+\var{YZCEL(II,2)} contiennent les coordonn�es des faces du plan d'entr�e une
+fois ramen�es dans le rep�re $(0yz)$ (\var{II} est compris entre 1 et
+\var{NCEVOR} o� \var{NCEVOR}=\var{ICVOR} repr�sente le nombre de faces pour
+lesquelles la m�thode va �tre utilis�e a cette entr�e).
+\item Lecture du fichier de donn�es, et initialisation des tableaux \var{XDAT},
+\var{YDAT}, \var{UDAT}, \var{VDAT}, \var{WDAT}, \var{DUYDAT}, \var{KDAT},
+\var{EPSDAT}, ...
+\item Si on ne fait pas de suite (\var{ISUIVO=0}) ou que l'on r�initialise le
+calcul (\var{INITVO=1}), tirage al�atoire de la position des vortex et de leur
+sens de rotation, ainsi que calcul de leur dur�e de vie. Les positions sont
+stock�es dans les tableaux \var{YZVOR(IVOR,1)} et \var{YZVOR(IVOR,2)}
+(\var{IVOR} d�signant le num�ro du vortex).
+\item Stockage de la vitesse principale moyenne au centre de la cellule dans le
+tableau \var{XU}, et recherche pour chaque vortex, de la face d'entr�e qui lui
+est la plus proche.
+\end{itemize}
+
+\item[$\bullet$] D�placement des vortex par appel au sous-programme \fort{vordep} :
+\begin{itemize}
+\item Convection des vortex.
+\item Traitement des conditions aux limites. Les vortex qui sortent du domaine
+de calcul sont replac�s � leur position d'origine.
+\item R�g�n�ration des vortex ``morts''. Si le temps de vie cumul�
+\var{TEMPS(II)} du vortex \var{II} est sup�rieur � sont temps de vie limite
+\var{TPSLIM(II)}, alors le vortex est d�truit, et un nouveau vortex est g�n�r�.
+\item Recherche pour chaque vortex de la face d'entr�e qui lui est la plus
+proche apr�s d�placement (mise � jour du tableau \var{IVORCE}).
+\end{itemize}
+
+\item[$\bullet$] Calcul du champ de vitesse induit par appel au sous-programme \fort{vorvit} :
+\begin{itemize}
+\item Calcul de l'intensit� du vortex.
+\item Calcul de la taille du vortex.
+\item Calcul du champ de vitesse induit par l'ensemble des vortex au centre des
+faces d'entr�e.
+\item Traitement suivant les cas, des conditions de p�riodicit� de sym�trie et
+des conditions de paroi par g�n�ration de vortex images.
+\item Ajout de la vitesse moyenne dans les directions transverse aux tableaux
+\var{XV} et \var{XW}.
+\end{itemize}
+
+\item[$\bullet$] G�n�ration des fluctuations de vitesse dans la direction
+principale par appel au sous-programme \fort{vorlgv}.
+\end{itemize}
+
+\item[$\star$] appel au sous-programme \fort{vor2cl} :
+\item[$\bullet$] Communication en cas de parall�lisme de la vitesse calcul�e en
+entr�e par le processeur 0 aux autres processeurs.
+\item[$\bullet$] Application des conditions aux limites apr�s utilisation d'un
+changement de rep�re �ventuel.
+\end{itemize}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Points \`a traiter}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Il serait possible de gagner de la m�moire en liberant l'espace alou� aux
+tableaux \var{IW1X},...,\var{IW2V} apr�s le passage dans \fort{vorpre}.
diff --git a/doc/tutorial/Makefile.am b/doc/tutorial/Makefile.am
new file mode 100644
index 0000000..afbeb11
--- /dev/null
+++ b/doc/tutorial/Makefile.am
@@ -0,0 +1,92 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+
+TEXMAIN = tutorial.tex
+
+# Other LaTex document
+
+TEXOTHERS = \
+case1.tex \
+case2.tex \
+case3.tex \
+case4.tex \
+case5.tex \
+intro.tex \
+tuto_case1.tex \
+tuto_case2.tex \
+tuto_case3.tex \
+tuto_case4.tex \
+tuto_case5.tex
+
+TEXINPUTFILES =
+
+# Distributed files
+
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# One adds the whole directory of test cases and get rid of the .svn
+# directories with a dist-hook. The reason for this trick is that
+# the number of test cases can grow and change a lot.
+EXTRA_DIST += test_cases
+
+# Subdirectories (order is important)
+
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
+
+dist-hook:
+ -rm -rf `find $(distdir)/test_cases -name .svn`
diff --git a/doc/tutorial/Makefile.in b/doc/tutorial/Makefile.in
new file mode 100644
index 0000000..f8678e4
--- /dev/null
+++ b/doc/tutorial/Makefile.in
@@ -0,0 +1,668 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/tutorial
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TEXMAIN = tutorial.tex
+
+# Other LaTex document
+TEXOTHERS = \
+case1.tex \
+case2.tex \
+case3.tex \
+case4.tex \
+case5.tex \
+intro.tex \
+tuto_case1.tex \
+tuto_case2.tex \
+tuto_case3.tex \
+tuto_case4.tex \
+tuto_case5.tex
+
+TEXINPUTFILES =
+
+# Distributed files
+
+# One adds the whole directory of test cases and get rid of the .svn
+# directories with a dist-hook. The reason for this trick is that
+# the number of test cases can grow and change a lot.
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES) test_cases
+
+# Subdirectories (order is important)
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+
+# Generated documents (pdf and index files)
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/tutorial/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/tutorial/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am: install-pdf-local
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am: pdf-local
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-local ctags ctags-recursive dist-hook distclean \
+ distclean-generic distclean-libtool distclean-local \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-pdf-local install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am pdf-local ps ps-am tags \
+ tags-recursive uninstall uninstall-am
+
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
+
+dist-hook:
+ -rm -rf `find $(distdir)/test_cases -name .svn`
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/tutorial/case1.tex b/doc/tutorial/case1.tex
new file mode 100644
index 0000000..9d04602
--- /dev/null
+++ b/doc/tutorial/case1.tex
@@ -0,0 +1,237 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{General description}
+%----------------
+
+
+ \subsection{Objective}
+%-----------------------------
+The aim of this case is to train the user of \CS on an oversimplified 2D junction
+including an inlet, an outlet, walls and symmetries.
+
+ \subsection{Description of the configuration}
+%-----------------------------------------------
+
+The configuration is two-dimensional.\\
+It consists of a simple junction as shown on figure \ref{figante11}.
+The flow enters through a hot inlet into a cold
+environment and exits as indicated on the same figure. This geometry can be
+considered as a very rough approximation of the cold branch and the downcomer of
+the vessel in a nuclear pressurized water reactor. The effect of temperature on
+the fluid density is not taken into account in this first example.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=9cm,height=8cm]{fig01}
+\caption{Geometry of the downcomer}
+\label{figante11}
+\end{center}
+\end{figure}
+
+ \subsection{Characteristics}
+%----------------------------------
+
+Characteristics of the geometry and the flow:
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+Height of downcomer & $H = 3.00\ m$ \\
+\hline
+Thickness of downcomer & $E_{d} = 0.10\ m$ \\
+\hline
+Diameter of the cold branch & $D_{b} = 0.50\ m$ \\
+\hline
+Inlet velocity of fluid & $V = 1\ m.s^{-1}$ \\
+\hline
+\end{tabular}\\
+\end{center}
+
+Physical characteristics of fluid:\\
+The initial water temperature in the domain is equal to 20\degresC.
+The inlet temperature of water in the cold branch is 300\degresC.
+Water characteristics are considered constant and their values taken at
+300\degresC\ and $150\times 10^{5}\ Pa$:
+\begin{itemize}
+ \item density: $\rho = 725.735\ kg.m^{-3}$
+ \item dynamic viscosity: $\mu = 0.895\times10^{-4}\ kg.m^{-1}.s^{-1}$
+ \item specific heat: $C_{p} = 5\,483\ J.kg^{-1}.\mbox{\degresC}^{-1}$
+ \item Thermal Conductivity $ = 0.02495\ W.m^{-1}.K^{-1}$
+\end{itemize}
+
+
+ \subsection{Mesh characteristics}
+%---------------------------------------
+
+Figure \ref{figante12} shows a global view of the downcomer mesh. This
+two-dimensional mesh is composed
+of 700 cells, which is very small compared to those used in real
+studies. This is
+a deliberate choice so that tutorial calculations run fast.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=8cm,height=7cm]{fig02}
+\caption{Geometry of the downcomer}
+\label{figante12}
+\end{center}
+\end{figure}
+
+Note that here the case is two-dimensional but \CS always operates on three-dimensional
+mesh elements (cells). The present mesh is composed of a layer of hexahedrons
+created from the 2D mesh shown on figure \ref{figante12} by
+extrusion (elevation) in the $Z$ direction. The virtual planes
+parallel to $Oxy$ will have ``sliding'' (``symmetry'') conditions to account for
+the two-dimensional character of the configuration.\\
+
+{\bfseries Type}: structured mesh
+
+{\bfseries Coordinates system}: cartesian, origin on the edge of the main
+pipe at the outlet level, on the nozzle side (figure \ref{figante11})
+
+{\bfseries Mesh generator used}: SIMAIL
+
+{\bfseries Color definition}: see figure \ref{figante13}. To specifiy boundary
+conditions on the boundary faces of the mesh, the latter have to be
+identified. It is commonly done by assigning an integer to each of them,
+characteristic of the boundary region they belong to. This integer is refered to
+as "color" or "reference".
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=2.5cm,height=6cm]{fig03}
+\caption{Colors of the boundary faces}
+\label{figante13}
+\end{center}
+\end{figure}
+
+
+%-----------------------------------
+\section{CASE 1: Basic calculation}
+%-----------------------------------
+
+ \subsection{Calculation options}
+%-----------------------------------------
+
+Most of the options used in this calculation are default options of \CS.
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Flow type: steady flow
+ \item Turbulence model: $k-\epsilon$
+ \item Scalar(s): 1 - temperature
+ \item Physical properties: uniform and constant
+\end{itemize}
+
+
+ \subsection{Initial and boundary conditions}
+%---------------------------------------------------
+
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Initialization: none (default values)
+\end{itemize}
+
+
+The boundary conditions are defined as follows:
+\begin{itemize}
+ \item {\bfseries Flow inlet}: Dirichlet condition, an inlet velocity of
+$1\ m.s^{-1}$ and an inlet temperature of 300\degresC\ are imposed
+ \item {\bfseries Outlet}: default values
+ \item {\bfseries Walls}: default values
+\end{itemize}
+
+Figure \ref{figante13} shows the colors used for boundary conditions and
+table \ref{tabante11} defines the correspondance between the colors and
+the type of boundary condition to use.
+
+Do not forget to enter the value of the hydraulic diameter, adapted to the
+current inlet (used for turbulence entry conditions).\\
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+Colors & Conditions \\
+\hline
+1 & Inlet \\
+\hline
+5 & Outlet \\
+\hline
+2 3 4 6 7 & Wall \\
+\hline
+8 9 & Symmetry\\
+\hline
+\end{tabular}
+\caption{\label{tabante11}Boundary conditions and associated references}
+\end{center}
+\end{table}
+
+ \subsection{Parameters and User routines}
+%------------------------------------------------
+
+All parameters necessary to this study can be defined through the Graphical
+Interface without using any user Fortran files.
+
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+\multicolumn{2}{|c|}{Calculation control parameters} \\
+\hline
+Number of iterations & $30$ \\
+\hline
+Relaxation coefficient & $0.9$ \\
+\hline
+Output period for post-processing files& $1$ \\
+\hline
+\end{tabular}
+\end{center}
+
+
+
+ \subsection{Results}
+%---------------------------
+
+Figure \ref{fige1_e1} presents the results obtained at different iterations in the
+calculation. They were plotted from the post-processing files, with EnSight.
+
+\textbf{Note:} since the ``steady flow'' option has been chosen, the evolution
+of the flow iteration after iteration has no physical meaning. It is merely an
+indication of the rapidity of convergence towards the (physical) steady state.
+
+\begin{figure}[h]
+\parbox{0.5\textwidth}{%
+\includegraphics[width=4cm]{cas1_t_1}}
+\parbox{0.5\textwidth}{%
+\includegraphics[width=4cm]{cas1_t_10}}
+\vspace*{0.5cm}
+\parbox{0.5\textwidth}{%
+\includegraphics[width=4cm]{cas1_t_20}}
+\parbox{0.5\textwidth}{%
+\includegraphics[width=4cm]{cas1_t_29}}
+\caption{\label{fige1_e1}Water velocity field colored by temperature at different time steps}
+\end{figure}
+
+
diff --git a/doc/tutorial/case2.tex b/doc/tutorial/case2.tex
new file mode 100644
index 0000000..90fb588
--- /dev/null
+++ b/doc/tutorial/case2.tex
@@ -0,0 +1,387 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{General description}
+%----------------
+
+ \subsection{Objective}
+%-----------------------------
+
+This aim of this case is to tackle the merging of initially separate meshes into
+a single fluid domain. The questions of mesh pasting and hanging nodes will be
+addressed. The test case will then be used to present more complex calculations,
+with time dependent variables and Fortran user routines.
+
+
+ \subsection{Description of the configuration}
+%-----------------------------------------------
+
+The fluid domain is composed of three separate meshes, very roughly representing
+elements of a nuclear pressurized water reactor vessel:
+\begin{itemize}
+ \item the downcomer
+ \item the vessel's bottom
+ \item the lower core plate and core
+\end{itemize}
+
+Figure \ref{figante21} represents the complete domain. The flow circulates from
+the top left horizontal junction to the right vertical outlet.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=9cm,height=6cm]{fig04}
+\caption{Geometry of the complete domain}
+\label{figante21}
+\end{center}
+\end{figure}
+
+
+ \subsection{Characteristics}
+%----------------------------------
+
+The characteristics of the geometry and the flow are:
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+Height of downcomer & $H = 3.00\ m$ \\
+\hline
+Thickness of downcomer & $E_{d} = 0.10\ m$ \\
+\hline
+Diameter of the inlet cold branch & $D_{b} = 0.50\ m$ \\
+\hline
+Height of vessel's bottom & $H_{fc} = 1.00\ m$ \\
+\hline
+Width of vessel's bottom & $l_{fc} = 1.00\ m$ \\
+\hline
+Height of core above the lower core plate & $H_{pic} = 1.00\ m$ \\
+\hline
+Width of core above the lower core plate & $l_{pic} = 0.50\ m$ \\
+\hline
+Inlet velocity of fluid & $V = 1\ m.s^{-1}$ \\
+\hline
+\end{tabular}\\
+\end{center}
+
+Physical characteristics of fluid:\\
+The initial water temperature in the domain is equal to 20\degresC.
+The inlet temperature of water in the cold branch is 300\degresC.
+Water characteristics are considered constant\footnote{which makes temperature a
+passive scalar ... but it is only for simplification purposes} and their values taken at
+300\degresC\ and $150\times 10^{5}\ Pa$, except density which is considered
+variable in cases 3 and 4:
+\begin{itemize}
+ \item density: $\rho = 725.735\ kg.m^{-3}$
+ \item dynamic viscosity: $\mu = 0.895\times10^{-4}\ kg.m^{-1}.s^{-1}$
+ \item heat capacity: $C_{p} = 5\,483\ J.kg^{-1}.\mbox{\degresC}^{-1}$
+ \item Thermal Conductivity $ = 0.02495\ W.m^{-1}.K^{-1}$
+\end{itemize}
+
+
+
+ \subsection{Mesh characteristics}
+%---------------------------------------
+
+Figure \ref{figante22} shows a global view of the mesh and some details of
+the pasting zones, to show that \CS can deal with hanging nodes.
+This mesh is composed of 1\,650 cells, which is very small compared to those used in real
+studies. This is a deliberate choice so that tutorial calculations run fast.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=8.65cm,height=7.4cm]{fig05}
+\caption{View of the full domain mesh with zoom on the pasting regions}
+\label{figante22}
+\end{center}
+\end{figure}
+
+{\bfseries Type}: block structured mesh
+
+{\bfseries Coordinates system}: cartesian, origin on the edge of the main
+pipe at the outlet level, on the nozzle side (figure \ref{figante22})
+
+{\bfseries Mesh generator used}: SIMAIL and mesh pasting with the Preprocessor
+of \CS (in order to deal with hanging nodes)
+
+{\bfseries Color definition}: see figure \ref{figante23}
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=3.6cm,height=6.4cm]{fig06}
+\caption{Colors of the boundary faces}
+\label{figante23}
+\end{center}
+\end{figure}
+
+
+ \subsection{Summary of the different calculations}
+%---------------------------------------------------------
+
+Three cases will be studied with this geometry. The following table gives a
+summary of their different characteristics.
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+CASE & characteristics \\
+\hline
+CASE 2 & unsteady flow, additionnal passive scalar, output management \\
+\hline
+CASE 3 & same as case 2 with time dependent boundary conditions, \\
+ & fluid density depending on the temperature and calculation restart\\
+\hline
+CASE 4 & same as case 3 with head loss, parallelism and spatial average \\
+\hline
+\end{tabular}
+\end{center}
+
+
+%--------------------------------------------------------------------------------------
+\section{CASE 2: Passive scalar with various boundary conditions and output management}
+%--------------------------------------------------------------------------------------
+
+ \subsection{Calculation options}
+%-----------------------------------------
+
+Some options are similar to case 1:
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Turbulence model: $k-\epsilon$
+ \item Scalar(s): 1 - temperature
+ \item Physical properties: uniform and constant
+\end{itemize}
+
+The new options are:
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Flow type: unsteady flow
+ \item Time step: uniform and constant
+ \item Scalar(s): 2 - passive scalar\footnote{could correspond to a tracer
+concentration for instance}
+ \item Management of monitoring points
+\end{itemize}
+
+
+ \subsection{Initial and boundary conditions}
+%---------------------------------------------------
+
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Initialization: 20\degresC\ for temperature (default value) \\
+ \hspace*{2.1cm} 10 for the passive scalar
+\end{itemize}
+
+
+The boundary conditions are defined in the user interface and depend on the
+boundary zone.
+
+\begin{itemize}
+ \item {\bfseries Flow inlet}: Dirichlet condition, an inlet velocity of
+$1\ m.s^{-1}$, an inlet temperature of 300\degresC\ and an inlet value of 200
+for the passive scalar are imposed
+ \item {\bfseries Outlet}: default value
+ \item {\bfseries Walls}: velocity, pressure and thermal scalar: default value \\
+ \hspace*{1.25cm} passive scalar: different conditions
+depending on the color and geometric parameters
+\end{itemize}
+
+In order to test the ability to specify boundary condition regions in the
+Graphical Interface, various conditions will be imposed for the passive scalar,
+as specified in the following table:
+
+\begin{center}
+\begin{tabular}{|c|c|c|}
+\hline
+Wall & Nature & Value \\
+\hline
+wall\_1 & Dirichlet & 0 \\
+\hline
+wall\_2 & Dirichlet & 5 \\
+\hline
+wall\_3 & Dirichlet & 0 \\
+\hline
+wall\_4 & Dirichlet & 25 \\
+\hline
+wall\_5 & Dirichlet & 320 \\
+\hline
+wall\_6 & Dirichlet & 40 \\
+\hline
+\end{tabular}
+\end{center}
+
+The ``wall\_1'' to ``wall\_6'' regions are defined as follows, through color
+references and geometric localization:
+\begin{center}
+\begin{tabular}{c|c}
+Label & Color and geometric parameters \\
+\hline
+wall\_1 & 24 and $0.1\leqslant X$ and $X\leqslant 0.5$ \\
+wall\_2 & 2 or 3 \\
+wall\_3 & 4 or 7 or 21 or 22 or 23 \\
+wall\_4 & 6 and $Y>1$ \\
+wall\_5 & 6 and $Y\leqslant1$ \\
+wall\_6 & 31 or 33 \\
+\end{tabular}
+\end{center}
+
+Figure \ref{figante23} shows the colors used for boundary conditions and
+table \ref{tabante21} defines the correspondance between the colors and
+the type of boundary condition to use.
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+Colors & Conditions \\
+\hline
+1 & Inlet \\
+\hline
+34 & Outlet \\
+\hline
+2 3 4 6 7 21 22 23 24 31 33 & Wall \\
+\hline
+8 9 28 29 38 39 & Symmetry \\
+\hline
+\end{tabular}
+\caption{Boundary faces colors and associated references}
+\label{tabante21}
+\end{center}
+\end{table}
+
+
+ \subsection{Parameters and User routines}
+%------------------------------------------------
+
+All parameters necessary to this study can be defined through the Graphical
+Interface without using any user Fortran files.
+
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+\multicolumn{2}{|c|}{Calculation control parameters} \\
+\hline
+Number of iterations & $300$ \\
+\hline
+Reference time step & $0.05$ \\
+\hline
+Output period for post-processing files& $2$ \\
+\hline
+\end{tabular}\\
+\end{center}
+
+In order to paste the separate meshes into a single domain, colors 5, 24 and 32
+will have to be pasted through the Graphical Interface.
+
+
+
+ \subsection{Output management}
+%-------------------------------------
+
+In this case, different aspects of output management will be addressed.
+
+By default in the Graphical Interface, all variables are set to appear in the
+listing, the post-processing and the chronological records. This default choice
+can be modified by the user.
+
+In this case, the {\itshape Pressure}, the {\itshape Tubulent energy} and the
+{\itshape Dissipation} will be removed from the listing file.
+
+The {\itshape Courant number} (CFL) and {\itshape Fourier number} will be
+removed from the
+post-processing results\footnote{this can be very useful to save some disk space
+if some variables are of no interest, as post-processing files can be large}.
+
+Eventually, probes will be defined for chronological records, folowing the data
+given in figure \ref{figante25}. Then the {\itshape total pressure} will be
+deactivated for all probes and the {\itshape Velocity U} will only be activated
+on probes 1, 2, 6, 7 and 8.
+
+\begin{figure}[htp]
+\parbox{8cm}{%
+\centerline{\includegraphics[width=4cm,height=6.8cm]{fig07}}}
+\parbox{7cm}{%
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Points & X(m) & Y(m) & Z(m)\\
+\hline
+1 & -0.25 & 2.25 & 0 \\
+\hline
+2 & 0.05 & 2.25 & 0 \\
+\hline
+3 & 0.05 & 2.75 & 0 \\
+\hline
+4 & 0.05 & 0.5 & 0 \\
+\hline
+5 & 0.05 & -0.25 & 0 \\
+\hline
+6 & 0.75 & -0.25 & 0 \\
+\hline
+7 & 0.75 & 0.25 & 0 \\
+\hline
+8 & 0.75 & 0.75 & 0 \\
+\hline
+\end{tabular}
+\end{center}
+}
+\caption{Position and coordinates of probes in the full domain}
+\label{figante25}
+\end{figure}
+
+In addition the domain boundary will be post-processed. This allows to check the
+boundary conditions, and especially that of the passive scalar.
+
+
+ \subsection{Results}
+%---------------------------
+
+Figure \ref{fige1_e2} shows the boundary domain colored by the passive
+scalar boundary conditions. The different regions of boundary
+conditions defined earlier can be checked.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=14cm,height=11cm]{c2_p7}
+\caption{View of the boundary domain colored by the scalar\_2 variable - Case 2}
+\label{fige1_e2}
+\end{center}
+\end{figure}
+
+Figure \ref{fige2_e2} presents results obtained at different times of the
+calculation. They were plotted from the post-processing files, with EnSight.
+
+\begin{figure}
+\begin{center}
+\begin{tabular}{cc}
+\includegraphics[width=6cm,height=6cm]{c2_p1} &
+\includegraphics[width=6cm,height=6cm]{c2_p2} \\
+\includegraphics[width=6cm,height=6cm]{c2_p3} &
+\includegraphics[width=6cm,height=6cm]{c2_p4} \\
+\includegraphics[width=6cm,height=6cm]{c2_p5} &
+\includegraphics[width=6cm,height=6cm]{c2_p6} \\
+\end{tabular}
+\caption{Water velocity field colored by temperature at different time steps - Case 2}
+\label{fige2_e2}
+\end{center}
+\end{figure}
diff --git a/doc/tutorial/case3.tex b/doc/tutorial/case3.tex
new file mode 100644
index 0000000..d8b868b
--- /dev/null
+++ b/doc/tutorial/case3.tex
@@ -0,0 +1,332 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\newpage
+%-----------------------------------------------------------------------------------------------------------------
+\section{CASE 3: Time dependent boundary conditions and variable fluid density}
+%-----------------------------------------------------------------------------------------------------------------
+In this case some boundary conditions will be time dependent and some physycal
+characteristics of the fluid will be dependent on the temperature.
+
+ \subsection{Calculation options}
+%-----------------------------------------
+
+The options for this case are the same as in case 2, except for the variable fluid density:
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Flow type: unsteady flow
+ \item Time step: uniform and constant
+ \item Turbulence model: $k-\epsilon$
+ \item Scalar(s): 1 - temperature\\
+ \hspace*{1.6cm} 2 - passive scalar
+ \item Physical properties: uniform and constant (except density)
+ \item Management of monitoring points
+\end{itemize}
+
+
+ \subsection{Initial and boundary conditions}
+%---------------------------------------------------
+
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Initialization: 20\degresC\ for temperature (default value) \\
+ \hspace*{2.1cm} 10 for the passive scalar
+\end{itemize}
+
+The boundary conditions are defined in the user interface and depend on the
+boundary zone. The time dependence of the temperature boundary condition implies
+the use of a Fortran user routine (see below).
+
+\begin{itemize}
+ \item {\bfseries Flow inlet}: Dirichlet condition, an inlet velocity of
+$1\ m.s^{-1}$, a time dependent inlet temperature and a value of 200 for the
+passive scalar are imposed
+ \item {\bfseries Outlet}: default value
+ \item {\bfseries Walls}: velocity, pressure and thermal scalar: default value \\
+ \hspace*{1.25cm} passive scalar: different conditions
+depending on the color and geometric parameters
+\end{itemize}
+
+The boundary conditions for the passive scalar are identical as in case 2,
+as specified in the following table:
+
+\begin{center}
+\begin{tabular}{|c|c|c|}
+\hline
+Wall & Nature & Value \\
+\hline
+wall\_1 & Dirichlet & 0 \\
+\hline
+wall\_2 & Dirichlet & 5 \\
+\hline
+wall\_3 & Dirichlet & 0 \\
+\hline
+wall\_4 & Dirichlet & 25 \\
+\hline
+wall\_5 & Dirichlet & 320 \\
+\hline
+wall\_6 & Dirichlet & 40 \\
+\hline
+\end{tabular}
+\end{center}
+
+The ``wall\_1'' to ``wall\_6'' regions are defined as follows, through color
+references and geometric localization:
+\begin{center}
+\begin{tabular}{c|c}
+Label & Color and geometric parameters \\
+\hline
+wall\_1 & 24 and $0.1\leqslant X$ and $X\leqslant 0.5$ \\
+wall\_2 & 2 or 3 \\
+wall\_3 & 4 or 7 or 21 or 22 or 23 \\
+wall\_4 & 6 and $Y>1$ \\
+wall\_5 & 6 and $Y\leqslant1$ \\
+wall\_6 & 31 or 33 \\
+\end{tabular}
+\end{center}
+
+Figure \ref{figante23} shows the colors used for boundary conditions and
+table \ref{tabante31} defines the correspondance between the colors and
+the type of boundary condition to use.
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+Colors & Conditions \\
+\hline
+1 & Inlet \\
+\hline
+34 & Outlet \\
+\hline
+2 3 4 6 7 21 22 23 31 33 & Wall \\
+\hline
+24 for $0.1 \leq X \leq 0.5$ & Wall \\
+\hline
+8 9 28 29 38 39 & Symmetry \\
+\hline
+\end{tabular}
+\caption{Boundary faces colors and associated references}
+\label{tabante31}
+\end{center}
+\end{table}
+
+
+ \subsection{Parameters}
+%------------------------------
+
+All the parameter necessary to this study can be defined through the Graphical
+Interface, except the time dependent boundary conditions and the variable
+density that have to be specified in user routines.
+
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+\multicolumn{2}{|c|}{Parameters of calculation control} \\
+\hline
+Number of iterations & $300$ \\
+\hline
+Reference time step & $0.05$ \\
+\hline
+Output period for post-processing files& $2$ \\
+\hline
+\end{tabular}\\
+\end{center}
+
+In order to paste the separate meshes into a single domain, colors 5, 24 and 32
+will have to be pasted through the Graphical Interface.
+
+
+ \subsection{User routines}
+%---------------------------------
+
+The following routines have to be copied from the folder FORT/USER/base into the
+folder FORT\footnote{only when they appear in the FORT directory will they be
+taken into account by the code}: usclim.F and usphyv.F.
+
+$\bullet$ {\bfseries usclim.F}\\
+This routine allows to define advanced boundary conditions on the boundary
+faces. Even if usclim.F is used, all boundary conditions have to be defined in
+the Graphical User Interface. Only the conditions that differ from this first
+definition need appear in usclim.F. The boundary conditions defined in usclim.F
+will replace those specified in the Graphical Interface.
+
+In this case, the temperature at entry is supposed variable in time, following
+the law:
+\begin{equation}
+\left\{\begin{array}{ll}
+T = 20 + 100t & \text{for }0\leqslant t \leqslant 3.8\\
+T = 400 & \text{for } t > 3.8
+\end{array}\right.
+\end{equation}
+where $T$ is the temperature in \degresC\ and $t$ is the time in $s$.
+
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=9cm,height=6.4cm]{probe9.png}
+\caption{Time evolution of the temperature at inlet}
+\label{figp9_e3}
+\end{center}
+\end{figure}
+
+
+$\bullet$ {\bfseries usphyv.F}\\
+This routine allows to specify variable physical properties, density in
+particular. In this case, the variation law given as an example in the routine
+will be appropriate:
+\begin{equation}
+\rho = T.(A.T + B) + C
+\end{equation}
+where $\rho$ is the density, $T$ is the temperature, $A = -4.0668\times10^{-3}$,
+$B =-5.0754\times 10^{-2}$ and $C = 1\,000.9$
+
+\textbf{Note:} in the example routine, the example is protected by a test to prevent any
+undesired use. Do not forget to deactivate it.
+
+In order for the variable density to have an effect on the flow, gravity must be
+set to a non-zero value. $\vect{g} = -9.81 \vect{e}_y$ will be specified in the
+Graphical Interface.
+
+ \subsection{Output management}
+%-------------------------------------
+
+The output management is the same as in case 2, except that a nineth monitoring
+point will be added, just at the entry, to monitor the temperature evolution at inlet.
+
+\begin{figure}[htp]
+\parbox{8cm}{%
+\centerline{\includegraphics[width=4cm,height=6.8cm]{fig08}}}
+\parbox{7cm}{%
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Points & X(m) & Y(m) & Z(m)\\
+\hline
+1 & -0.25 & 2.25 & 0 \\
+\hline
+2 & 0.05 & 2.25 & 0 \\
+\hline
+3 & 0.05 & 2.75 & 0 \\
+\hline
+4 & 0.05 & 0.5 & 0 \\
+\hline
+5 & 0.05 & -0.25 & 0 \\
+\hline
+6 & 0.75 & -0.25 & 0 \\
+\hline
+7 & 0.75 & 0.25 & 0 \\
+\hline
+8 & 0.75 & 0.75 & 0 \\
+\hline
+9 & -0.5 & 2.25 & 0 \\
+\hline
+\end{tabular}
+\end{center}
+}
+\caption{Position and coordinates of probes in the full domain}
+\label{figante32}
+\end{figure}
+
+In this case, the {\itshape Pressure}, the {\itshape Tubulent energy} and the
+{\itshape Dissipation} will be removed from the listing file.
+
+The {\itshape Courant number} (CFL) and {\itshape Fourier number} will be
+removed from the
+post-processing results\footnote{this can be very useful to save some disk space
+if some variables are of no interest, as post-processing files can be large}.
+
+Eventually, probes will be defined for chronological records, folowing the data
+given in figure \ref{figante25}. Then the {\itshape total pressure} will be
+deactivated from all probes and the {\itshape Velocity U} will be only activated
+on probes 1, 2, 6, 7 and 8.
+
+
+In addition the domain boundary will be post-processed. This allows to check the
+boundary conditions, and especially that of the temperature and passive scalar.
+
+
+ \subsection{Calculation restart}
+%---------------------------------------
+
+After the first run, the calculation will be continued for another 400 time
+steps. The calculation restart is managed through the Graphical Interface.
+
+
+ \subsection{Results}
+%---------------------------
+Figure \ref{fige3_e3} shows the time evolution of temperature recorded on each
+monitoring probe.
+\begin{figure}[hb]
+\begin{center}
+\begin{tabular}{cc}
+\includegraphics[width=11cm]{evotemp_case3.png} \\
+\end{tabular}
+\caption{Time evolution of temperature at monitoring probes for case 3}
+\label{fige3_e3}
+\end{center}
+\end{figure}
+
+Figure \ref{fige1_e3} shows the velocity fields colored by temperature in the
+first run of calculation. Figure \ref{fige2_e3} shows the velocity fields in the
+second calculation (restart of the first one).
+
+\begin{figure}
+\begin{center}
+\begin{tabular}{cc}
+\includegraphics[height=6cm]{case3_p1} &
+\includegraphics[height=6cm]{case3_p2} \\
+\includegraphics[height=6cm]{case3_p3} &
+\includegraphics[height=6cm]{case3_p4} \\
+\includegraphics[height=6cm]{case3_p5} &
+\includegraphics[height=6cm]{case3_p6} \\
+\end{tabular}
+\caption{Water velocity field colored by temperature and inlet temperature value
+at different time steps (first calculation)}
+\label{fige1_e3}
+\end{center}
+\end{figure}
+
+
+\begin{figure}
+\begin{center}
+\begin{tabular}{cc}
+\includegraphics[height=7.5cm]{case3_p7} &
+\includegraphics[height=7.5cm]{case3_p8} \\
+\includegraphics[height=7.5cm]{case3_p9} &
+\includegraphics[height=7.5cm]{case3_p10} \\
+\end{tabular}
+\caption{Water velocity field colored by temperature and inlet temperature value
+at different time steps (second calculation)}
+\label{fige2_e3}
+\end{center}
+\end{figure}
+
+
+
+
+
+
diff --git a/doc/tutorial/case4.tex b/doc/tutorial/case4.tex
new file mode 100644
index 0000000..277ace5
--- /dev/null
+++ b/doc/tutorial/case4.tex
@@ -0,0 +1,364 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\newpage
+%-------------------------------------------------------------
+\section{CASE 4: Head loss, parallelism and spatial average}
+%-------------------------------------------------------------
+\label{prg_case4}%
+This case will be run in parallel on two processors. Head loss will be used to
+simulate the presence of an obstacle in the flow and the spatial average of the
+temperature will be calculated at each time step.
+
+ \subsection{Calculation options}
+%-----------------------------------------
+
+The options for this case are the same as in case 3:
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Flow type: unsteady flow
+ \item Time step: uniform and constant
+ \item Turbulence model: $k-\epsilon$
+ \item Scalar(s): 1 - temperature\\
+ \hspace*{1.6cm} 2 - passive scalar
+ \item Physical properties: uniform and constant (except density)
+ \item Management of monitoring points
+\end{itemize}
+
+
+ \subsection{Initial and boundary conditions}
+%---------------------------------------------------
+
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Initialization: 20\degresC\ for temperature (default value) \\
+ \hspace*{2.1cm} 10 for the passive scalar
+\end{itemize}
+
+The boundary conditions are defined in the user interface and depend on the
+boundary zone.
+
+\begin{itemize}
+ \item {\bfseries Flow inlet}: Dirichlet condition, an inlet velocity of
+$1\ m.s^{-1}$ and a time dependent inlet temperature are imposed
+ \item {\bfseries Outlet}: default value
+ \item {\bfseries Walls}: velocity, pressure and thermal scalar: default value \\
+ \hspace*{1.25cm} passive scalar: different conditions
+depending on the color and geometric parameters
+\end{itemize}
+
+The boundary conditions for the passive scalar are identical as in case 2,
+as specified in the following table:
+
+\begin{center}
+\begin{tabular}{|c|c|c|}
+\hline
+Wall & Nature & Value \\
+\hline
+wall\_1 & Dirichlet & 0 \\
+\hline
+wall\_2 & Dirichlet & 5 \\
+\hline
+wall\_3 & Dirichlet & 0 \\
+\hline
+wall\_4 & Dirichlet & 25 \\
+\hline
+wall\_5 & Dirichlet & 320 \\
+\hline
+wall\_6 & Dirichlet & 40 \\
+\hline
+\end{tabular}
+\end{center}
+
+The ``wall\_1'' to ``wall\_6'' regions are defined as follows, through color
+references and geometric localization:
+\begin{center}
+\begin{tabular}{c|c}
+Label & Color and geometric parameters \\
+\hline
+wall\_1 & 24 and $0.1\leqslant X$ and $X\leqslant 0.5$ \\
+wall\_2 & 2 or 3 \\
+wall\_3 & 4 or 7 or 21 or 22 or 23 \\
+wall\_4 & 6 and $Y>1$ \\
+wall\_5 & 6 and $Y\leqslant1$ \\
+wall\_6 & 31 or 33 \\
+\end{tabular}
+\end{center}
+
+Figure \ref{figante23} shows the colors used for boundary conditions and
+table \ref{tabante41} defines the correspondance between the colors and
+the type of boundary condition to use.
+
+\begin{table}[htp]
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+Colors & Conditions \\
+\hline
+1 & Inlet \\
+\hline
+34 & Outlet \\
+\hline
+2 3 4 6 7 21 22 23 31 33 & Wall \\
+\hline
+24 for $0.1 \leq X \leq 0.5$ & Wall \\
+\hline
+8 9 28 29 38 39 & Symmetry \\
+\hline
+\end{tabular}
+\caption{Boundary faces colors and associated references}
+\label{tabante41}
+\end{center}
+\end{table}
+
+
+
+ \subsection{Head loss}
+%-----------------------------
+
+To simulate the presence of an obstacle $0.20\ m$ large and $0.5\ m$ high in the
+vessel, a zone of head loss will be created in the domain (fig \ref{figante41}).
+The head loss zone is situated between the coordinates $X=0.2\ m$ and $X=0.4\ m$,
+and $Y=-0.75\ m$ and $Y=-0.25\ m$. The head loss coefficient to apply is $10^4$
+and is isotropic.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=10cm,height=8cm]{fig09}
+\caption{Full domain geometry with the obstacle}
+\label{figante41}
+\end{center}
+\end{figure}
+
+
+
+ \subsection{Parameters}
+%------------------------------
+
+All the parameter necessary to this study can be defined through the Graphical
+Interface, except the time dependent boundary conditions, the variable
+density and the head loss that have to be specified in user routines. The
+calculation of the spatial average is also defined by a user routine.
+
+
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+\multicolumn{2}{|c|}{Parameters of calculation control} \\
+\hline
+Number of iterations & $300$ \\
+\hline
+Reference time step & $0.05$ \\
+\hline
+Output period for post-processing files& $2$ \\
+\hline
+The calculation will be run in parallel on 2 processors \\
+\end{tabular}\\
+\end{center}
+
+In order to paste the separate meshes into a single domain, colors 5, 24 and 32
+will have to be pasted through the Graphical Interface.
+
+
+ \subsection{User routines}
+%---------------------------------
+
+The following routines have to be copied from the folder FORT/USER/base into the
+folder FORT\footnote{only when they appear in the FORT directory will they be
+taken into account by the code}: usclim.F, usphyv.F, usproj.F and uskpdc.F.
+
+$\bullet$ {\bfseries usclim.F}\\
+This routine allows to define advanced boundary conditions on the boundary
+faces. Even if usclim.F is used, all boundary conditions have to be defined in
+the Graphical User Interface. Only the conditions that differ from this first
+definition need appear in usclim.F. The boundary conditions defined in usclim.F
+will replace those specified in the Graphical Interface.
+
+In this case, the temperature at entry is supposed variable in time, following
+the law:
+\begin{equation}
+\left\{\begin{array}{ll}
+T = 20 + 100t & \text{for }0\leqslant t \leqslant 3.8\\
+T = 400 & \text{for } t > 3.8
+\end{array}\right.
+\end{equation}
+where $T$ is the temperature in \degresC\ and $t$ is the time in $s$.
+
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=9cm,height=6.4cm]{probe9.png}
+\caption{Time evolution of the temperature at inlet}
+\label{figp9_e4}
+\end{center}
+\end{figure}
+
+
+$\bullet$ {\bfseries usphyv.F}\\
+This routine allows to specify variable physical properties, density in
+particular. In this case, the variation law given as an example in the routine
+will be appropriate:
+\begin{equation}
+\rho = T.(A.T + B) + C
+\end{equation}
+where $\rho$ is the density, $T$ is the temperature, $A = -4.0668\times10^{-3}$,
+$B =-5.0754\times 10^{-2}$ and $C = 1\,000.9$
+
+\textbf{Note:} in the example routine, the example is protected by a test to prevent any
+undesired use. Do not forget to deactivate it.
+
+In order for the variable density to have an effect on the flow, gravity must be
+set to a non-zero value. $\vect{g} = -9.81 \vect{e}_y$ will be specified in the
+Graphical Interface.
+
+
+$\bullet$ {\bfseries usproj.F}\\
+This routine is called at the end of each time step and has access to the whole
+set of variables of the code. It is therefore useful for many user-specific
+post-processing, including the calculation of a spatial average in the present
+case.\\
+The spatial average of the temperature will be calculated at each time step and
+the result wrote in a file named ``moy.dat''. The values are saved in order
+to draw the time evolution of the average temperature.
+
+Beware when calculating the average. Since the calculation is running in
+parallel, computing the sum of the temperatures on ``all the cells'' will only
+yield for each processor the sum on the cells managed by this processor. In
+order to obtain the full sum, the parallelism routine PARSOM must be used (see
+example).
+
+\textbf{Note:} usproj.F contains many examples. They should be removed before
+running the case.
+
+
+$\bullet$ {\bfseries uskpdc.F}
+
+This routine allows to apply head loss on the fluid domain.
+
+The localization of the obstacle is made geometrically, using the
+coordinates of the centers of the cells.
+
+
+If $XYZCEN(1,IEL) \leq 0.40$ and $XYZCEN(1,IEL) \geq 0.20$ \\
+and $XYZCEN(2,IEL) \geq -0.75$ and $XYZCEN(2,IEL) \leq -0.25$\\
+then an isotropic head loss coefficient $K = 10^{4}$ is applied:\\
+
+$CKUPDC(IELPDC,1) = K*ABS(RTPA(IEL,IU(IPHAS)))$ \\
+$CKUPDC(IELPDC,2) = K*ABS(RTPA(IEL,IV(IPHAS)))$ \\
+$CKUPDC(IELPDC,3) = K*ABS(RTPA(IEL,IW(IPHAS)))$ \\
+$CKUPDC(IELPDC,4) = 0.$ \\
+$CKUPDC(IELPDC,5) = 0.$ \\
+$CKUPDC(IELPDC,6) = 0.$
+
+ \subsection{Output management}
+%-------------------------------------
+
+The output management is the same as in case 3.
+
+\begin{figure}[htp]
+\parbox{8cm}{%
+\centerline{\includegraphics[width=4cm,height=6.8cm]{fig08}}}
+\parbox{7cm}{%
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Points & X(m) & Y(m) & Z(m)\\
+\hline
+1 & -0.25 & 2.25 & 0 \\
+\hline
+2 & 0.05 & 2.25 & 0 \\
+\hline
+3 & 0.05 & 2.75 & 0 \\
+\hline
+4 & 0.05 & 0.5 & 0 \\
+\hline
+5 & 0.05 & -0.25 & 0 \\
+\hline
+6 & 0.75 & -0.25 & 0 \\
+\hline
+7 & 0.75 & 0.25 & 0 \\
+\hline
+8 & 0.75 & 0.75 & 0 \\
+\hline
+9 & -0.5 & 2.25 & 0 \\
+\hline
+\end{tabular}
+\end{center}
+}
+\caption{Position and coordinates of probes in the full domain}
+\label{figante42}
+\end{figure}
+
+In this case, the {\itshape Pressure}, the {\itshape Tubulent energy} and the
+{\itshape Dissipation} will be removed from the listing file.
+
+The {\itshape Courant number} (CFL) and {\itshape Fourier number} will be
+removed from the
+post-processing results\footnote{this can be very useful to save some disk space
+if some variables are of no interest, as post-processing files can be large}.
+
+Eventually, probes will be defined for chronological records, folowing the data
+given in figure \ref{figante25}. Then the {\itshape total pressure} will be
+deactivated from all probes and the {\itshape Velocity U} will be only activated
+on probes 1, 2, 6, 7 and 8.
+
+
+In addition the domain boundary will be post-processed. This allows to check the
+boundary conditions, and especially that of the temperature and passive scalar.
+
+
+
+ \subsection{Results}
+%---------------------------
+Figure \ref{fige2_e4} shows the evolution of the spatial average of the temperature.
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=9cm]{moytemp.png}
+\caption{Evolution of spatial average of the temperature as a function of time}
+\label{fige2_e4}
+\end{center}
+\end{figure}
+
+Figure \ref{fige1_e4} shows velocity fields colored by temperature. The effect
+of the head loss modeling the obstacle is clearly visible.
+
+\begin{figure}
+\begin{center}
+\begin{tabular}{cc}
+\includegraphics[height=6cm]{case4_p1} &
+\includegraphics[height=6cm]{case4_p2} \\
+\includegraphics[height=6cm]{case4_p3} &
+\includegraphics[height=6cm]{case4_p4} \\
+\includegraphics[height=6cm]{case4_p5} &
+\includegraphics[height=6cm]{case4_p6} \\
+\end{tabular}
+\caption{Water velocity field colored by temperature}
+\label{fige1_e4}
+\end{center}
+\end{figure}
+
+
diff --git a/doc/tutorial/case5.tex b/doc/tutorial/case5.tex
new file mode 100644
index 0000000..1fb7bb9
--- /dev/null
+++ b/doc/tutorial/case5.tex
@@ -0,0 +1,359 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{General description}
+%----------------------------
+
+ \subsection{Objective}
+%-----------------------------
+
+The aim of this case is to train the \CS user on a simplified but real 3D
+computation. It corresponds to a stratified flow in a T-junction. The test case
+will be used to present some advanced post-processing techniques.
+
+
+ \subsection{Description of the configuration}
+%-----------------------------------------------
+
+The configuration is based on a real mock-up designed to characterize thermal
+stratification phenomena and associated fluctuations. The geometry is shown on
+figure \ref{config}.
+
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=9cm,height=4.5cm]{c5_config}
+\caption{Geometry of the case}
+\label{config}
+\end{center}
+\end{figure}
+
+There are two inlets, a hot one in the main pipe and a cold one in the vertical nozzle.
+The volumic flow rate is identical in both inlets. It is chosen small enough so that
+gravity effects are important with respect to inertia forces. Therefore
+cold water creeps backwards from the nozzle towards the elbow until the flow
+reaches a stable stratified state.
+
+
+ \subsection{Characteristics}
+%----------------------------------
+
+Characteristics of the geometry: \\
+
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+Diameter of the pipe & $D_{b} = 0.40\ m$ \\
+\hline
+\end{tabular}\\
+\end{center}
+
+Characteristics of flow:
+
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+Cold branch volume flow rate & $Dv_{cb} = 4\ l.s^{-1}$ \\
+\hline
+Hot branch volume flow rate & $Dv_{hb} = 4\ l.s^{-1}$ \\
+\hline
+Cold branch temperature & $T_{cb} = 18.26$\degresC \\
+\hline
+Hot branch temperature & $T_{hb} = 38.5$\degresC \\
+\hline
+\end{tabular}\\
+\end{center}
+
+The initial water temperature in the domain is equal to 38.5\degresC.
+
+Water specific heat and thermal conductivity are considered constant and
+calculated at 18.26\degresC\ and $10^{5}\ Pa$:
+\begin{itemize}
+ \item heat capacity: $C_{p} = 4_,182.88\ J.kg^{-1}.\mbox{\degresC}^{-1}$
+ \item thermal conductivity: $\lambda = 0.601498\ W.m^{-1}.\mbox{\degresC}^{-1}$
+\end{itemize}
+
+The water density and dynamic viscosity are variable with the temperature. The
+functions are given below.
+
+
+ \subsection{Mesh characteristics}
+%---------------------------------------
+The mesh used in the actual study had 125\,000 elements. It has been coarsened
+for this example in order for calculations to run faster. The mesh used here
+contains 16\,320 elements.
+
+{\bfseries Type}: unstructured mesh
+
+{\bfseries Coordinates system}: cartesian, origin on the middle of the horizontal pipe at the intersection with the nozzle.
+
+{\bfseries Mesh generator used}: SIMAIL
+
+{\bfseries Color definition}: see figure \ref{fige1_e5}.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=10cm]{color_Snimbus}
+\caption{Colors of the boundary faces}
+\label{fige1_e5}
+\end{center}
+\end{figure}
+
+
+%-----------------------------
+\section{CASE 5: Stratified junction}
+%-----------------------------
+In this case, advanced post-processing features will be used. A specific
+pos-processing sub-mesh will be created, containing all the cells with a
+temperature lower than 21\degresC, so that it can be visualized (with EnSight
+for instance). The variable ``temperature'' will be post-processed on this
+sub-mesh. A 2D clip plane will also be extracted along the symmetry plane of the
+domain and temperature will be written on it.
+
+
+ \subsection{Calculation options}
+%-----------------------------------------
+
+The following options are considered for the case:
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Flow type: unsteady flow
+ \item Time step: variable in time and uniform in space
+ \item Turbulence model: $k-\epsilon$
+ \item Scalar(s): temperature
+ \item Physical properties: uniform and constant for specific heat and
+thermal conductivity and variable for density and dynamic viscosity
+ \item Pressure interpolation in stratified fows : improved
+\end{itemize}
+
+
+ \subsection{Initial and boundary conditions}
+%---------------------------------------------------
+
+\begin{itemize}
+\renewcommand{\labelitemi}{$\rightarrow$}
+ \item Initialization: temperature initialization at 38.5\degresC
+\end{itemize}
+
+The boundary conditions are defined as follows:
+
+\begin{itemize}
+ \item {\bfseries Flow inlet}: Dirichlet condition
+ \begin{itemize}
+ \item velocity of $0.03183\ m.s^{-1}$ for both inlets
+ \item temperature of 38.5\degresC\ for the hot inlet
+ \item temperature of 18.6\degresC\ for the cold inlet
+ \end{itemize}
+ \item {\bfseries Outlet}: default value
+ \item {\bfseries Walls}: default value
+\end{itemize}
+
+Figure \ref{fige1_e5} shows the colors used for boundary conditions and
+table \ref{tabante51} defines the correspondance between the colors and
+the type of boundary condition to use.
+
+\begin{table}
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+Colors & Conditions \\
+\hline
+2 & Cold inlet \\
+\hline
+6 & Hot inlet \\
+\hline
+7 & Outlet \\
+\hline
+5 & Wall \\
+\hline
+\end{tabular}
+\caption{Boundary faces colors and associated references}
+\label{tabante51}
+\end{center}
+\end{table}
+
+
+ \subsection{Parameters}
+%------------------------------
+All the parameter necessary to this study can be defined through the Graphical
+Interface, except the variable fluid characteristics and the advanced
+post-processing features that have to be specified in user routines.
+
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+\multicolumn{2}{|c|}{Parameters of calculation control} \\
+\hline
+Reference time step & $1\ s $ \\
+\hline
+Number of iterations & 100 \\
+\hline
+Maximal CFL number & 20 \\
+\hline
+Maximal Fourier number & 60 \\
+\hline
+Minimal time step factor & $0.01\ s$ \\
+\hline
+Maximal time step factor & $70\ s$ \\
+\hline
+Time step maximal variation & $0.1$ \\
+\hline
+Period of output chronological files & $10$ \\
+\hline
+\end{tabular}\\
+\end{center}
+
+The time step limitation by gravity effects will also be activated.
+
+
+ \subsection{Output management}
+%-------------------------------------
+The standard options for output management will be used. Four monitoring points
+will be created at the following coordinates:
+
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Points & X(m) & Y(m) & Z(m)\\
+\hline
+1 & 0.010025 & 0.01534 & -0.011765 \\
+\hline
+2 & 1.625 & 0.01534 & -0.031652 \\
+\hline
+3 & 3.225 & 0.01534 & -0.031652 \\
+\hline
+4 & 3.8726 & 0.047481 & 7.25 \\
+\hline
+\end{tabular}
+\end{center}
+
+
+Two vertical temperature profiles will be extracted, at the following locations:\\
+\begin{tabular}{llll}
+profil16: & $x=1.6\qquad$ & $y=0\qquad$ & $-0.2 \leqslant z \leqslant 0.2$ ($m$)\\
+profil32: & $x=3.2\qquad$ & $y=0\qquad$ & $-0.2 \leqslant z \leqslant 0.2$ ($m$)
+\end{tabular}
+
+
+ \subsection{User routines}
+%---------------------------------
+
+The following routines have to be copied from the folder SRC/REFERENCE/base into the
+folder SRC\footnote{only when they appear in the SRC directory will they be
+taken into account by the code}: usphyv.F, usdpst.F, usvpst.F and usmpst.F
+
+
+$\bullet$ {\bfseries usphyv.F}\\
+This routine allows to specify variable physical properties, density and
+viscosity in particular. In this case, the following variation laws are specified:
+\begin{equation}
+\rho = T.(A.T + B) + C
+\end{equation}
+where $\rho$ is the density, $T$ is the temperature, $A = -4.0668\times10^{-3}$,
+$B =-5.0754\times 10^{-2}$ and $C = 1\,000.9$
+
+
+For the dynamic viscosity, the variation law is:
+
+\begin{equation}
+\mu = T.(T.(AM.T + BM) + CM) + DM
+\end{equation}
+where $\mu$ is the dynamic viscosity, $T$ is the temperature,
+$AM=-3.4016\times 10^{-9}$, $BM = 6.2332\times 10^{-7}$,
+$CM = -4.5577\times 10^{-5}$ and $DM = 1.6935\times 10^{-3}$
+
+
+\textbf{Note:} in the example routine, the examples are protected by a test to prevent any
+undesired use. Do not forget to deactivate them.
+
+In order for the variable density to have an effect on the flow, gravity must be
+set to a non-zero value. $\vect{g} = -9.81 \vect{e}_y$ will be specified in the
+Graphical Interface.
+
+
+In this test case, advanced post-processing features will be used. A clip
+plane will be created, along the symmetry plane of the domain, on which the
+temperature will be written. This plane will be added to the standard
+``writer'' ({\em i.e.} it will be an extra part in the standard CHR.ENSIGHT
+case). The periodicity of output on the standard writer will be 10 iterations.\\
+An additional writer will also be created, with a periodicity of 5
+iterations. It will only contain one part ({\em i.e.} one sub-mesh): the set
+cells where the temperature is lower than 21\degresC. The temperature will be
+written on this part. The interest of this part is that it is time dependent
+as for the cells it contains.
+
+Three Fortran routines will be used:
+
+$\bullet$ {\bfseries usdpst.F}\\
+This routine is called only once, at the beginning of the calculation. It allows
+to define the different writers and parts.
+
+$\bullet$ {\bfseries usmpst.F}\\
+This routine is called at each time step. It allows to redefine the content of
+certain parts using any variable, especially the temperature for this case.
+
+$\bullet$ {\bfseries usvpst.F}\\
+This routine is called at each time step. It allows to specify which variable
+will be written on which part.
+
+
+ \subsection{Results}
+%---------------------------
+
+Figure \ref{fige2_e5} shows the evolution of the temperature in the domain at
+different time steps. The evolution of the stratification is clearly visible.
+
+
+\begin{figure}
+\begin{center}
+\begin{tabular}{c}
+\includegraphics[width=10cm]{case5_05} \\
+\includegraphics[width=10cm]{case5_06} \\
+\includegraphics[width=10cm]{case5_07} \\
+\includegraphics[width=10cm]{case5_08} \\
+\includegraphics[width=10cm]{case5_09} \\
+\end{tabular}
+\caption{Evolution of temperature}
+\label{fige2_e5}
+\end{center}
+\end{figure}
+
+
+
+Figure \ref{fige4_e5} shows the cells where the temperature
+is lower than 21\degresC. It is not an isosurface created from the full domain,
+but a visualization of the full sub-domain created through the post-processing
+routines.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=10cm]{case5_03}
+\includegraphics[width=10cm]{case5_04}
+\caption{Sub-domain where the temperature is lower than 21\degresC\ (upper figure)
+and localization in the full domain (lower figure)}
+\label{fige4_e5}
+\end{center}
+\end{figure}
diff --git a/doc/tutorial/graphics/Makefile.am b/doc/tutorial/graphics/Makefile.am
new file mode 100644
index 0000000..863d808
--- /dev/null
+++ b/doc/tutorial/graphics/Makefile.am
@@ -0,0 +1,90 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+
+FIGFILES =
+
+# Other files
+
+OTHERFILES = \
+c1_capture01.jpg c1_capture02.jpg c1_capture03.jpg c1_capture04.jpg \
+c1_capture05.jpg c1_capture06.jpg c1_capture07.jpg c1_capture08.jpg \
+c1_capture09.jpg c1_capture10.jpg c1_capture11.jpg c1_capture12.jpg \
+c1_capture13.jpg c1_capture14.jpg c1_capture15.jpg c1_capture16.jpg \
+c1_capture17.jpg c1_capture18.jpg c1_capture19.jpg c1_capture20.jpg \
+c1_capture21.jpg c1_capture22.jpg c1_capture23.jpg c1_capture24.jpg \
+c1_capture25.jpg c1_capture26.jpg c1_capture27.jpg c1_capture28.jpg \
+c1_capture29.jpg c1_capture30.jpg c1_capture31.jpg c1_capture32.jpg \
+c1_capture33.jpg c1_capture34.jpg c1_capture35.jpg c1_capture36.jpg \
+c1_capture37.jpg c1_capture38.jpg c1_capture39.jpg c1_capture40.jpg \
+c1_capture41.jpg c1_capture42.jpg c1_capture43.jpg \
+c2_capture01.jpg c2_capture02.jpg c2_capture03.jpg c2_capture04.jpg \
+c2_capture05.jpg c2_capture06.jpg c2_capture07.jpg c2_capture08.jpg \
+c2_capture09.jpg c2_capture10.jpg c2_capture11.jpg c2_capture12.jpg \
+c2_capture13.jpg c2_capture14.jpg c2_capture152.jpg c2_capture15.jpg \
+c2_capture16.jpg c2_capture17.jpg c2_capture18.jpg c2_capture19.jpg \
+c2_capture20.jpg c2_capture212.jpg c2_capture21.jpg c2_capture22.jpg \
+c2_capture23.jpg c2_capture24.jpg c2_capture25.jpg c2_capture26.jpg \
+c2_capture27.jpg c2_capture28.jpg c2_capture29.jpg c2_capture30.jpg \
+c2_p1.jpg c2_p2.jpg c2_p3.jpg c2_p4.jpg c2_p5.jpg c2_p6.jpg c2_p7.jpg \
+c3_capture01.jpg c3_capture02.jpg c3_capture03.jpg c3_capture04.jpg \
+c3_capture05.jpg c3_capture06.jpg c4_capture01.jpg c4_capture02.jpg \
+c5_capture01.jpg c5_capture02.jpg c5_capture03.jpg c5_capture04.jpg \
+c5_capture05.jpg c5_capture06.jpg c5_capture07.jpg c5_capture08.jpg \
+c5_capture09.jpg c5_capture10.jpg c5_capture11.jpg c5_capture12.jpg \
+c5_capture13.jpg c5_config.jpg \
+capture10.jpg capture11.jpg capture12.jpg capture13.jpg \
+cas1_t_10.jpg cas1_t_1.jpg cas1_t_20.jpg cas1_t_29.jpg \
+case3_p10.jpg case3_p1.jpg case3_p2.jpg case3_p3.jpg case3_p4.jpg \
+case3_p5.jpg case3_p6.jpg case3_p7.jpg case3_p8.jpg case3_p9.jpg \
+case4_p1.jpg case4_p2.jpg case4_p3.jpg case4_p4.jpg case4_p5.jpg \
+case4_p6.jpg case5_01.jpg case5_02.jpg case5_03.jpg case5_04.jpg \
+case5_05.jpg case5_06.jpg case5_07.jpg case5_08.jpg case5_09.jpg \
+color_Snimbus.jpg evotemp_case3.png \
+fig01.jpg fig02.jpg fig03.jpg fig04.jpg fig05.jpg fig06.jpg \
+fig07.jpg fig08.jpg fig09.jpg moytemp.png probe9.png
+
+# Distributed files
+
+EXTRA_DIST = $(FIGFILES) $(OTHERFILES)
+
+# Generated documents (pdf files)
+
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+
+SUFFIXES = .fig .pdf
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
diff --git a/doc/tutorial/graphics/Makefile.in b/doc/tutorial/graphics/Makefile.in
new file mode 100644
index 0000000..fba0c5e
--- /dev/null
+++ b/doc/tutorial/graphics/Makefile.in
@@ -0,0 +1,507 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/tutorial/graphics
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+FIGFILES =
+
+# Other files
+OTHERFILES = \
+c1_capture01.jpg c1_capture02.jpg c1_capture03.jpg c1_capture04.jpg \
+c1_capture05.jpg c1_capture06.jpg c1_capture07.jpg c1_capture08.jpg \
+c1_capture09.jpg c1_capture10.jpg c1_capture11.jpg c1_capture12.jpg \
+c1_capture13.jpg c1_capture14.jpg c1_capture15.jpg c1_capture16.jpg \
+c1_capture17.jpg c1_capture18.jpg c1_capture19.jpg c1_capture20.jpg \
+c1_capture21.jpg c1_capture22.jpg c1_capture23.jpg c1_capture24.jpg \
+c1_capture25.jpg c1_capture26.jpg c1_capture27.jpg c1_capture28.jpg \
+c1_capture29.jpg c1_capture30.jpg c1_capture31.jpg c1_capture32.jpg \
+c1_capture33.jpg c1_capture34.jpg c1_capture35.jpg c1_capture36.jpg \
+c1_capture37.jpg c1_capture38.jpg c1_capture39.jpg c1_capture40.jpg \
+c1_capture41.jpg c1_capture42.jpg c1_capture43.jpg \
+c2_capture01.jpg c2_capture02.jpg c2_capture03.jpg c2_capture04.jpg \
+c2_capture05.jpg c2_capture06.jpg c2_capture07.jpg c2_capture08.jpg \
+c2_capture09.jpg c2_capture10.jpg c2_capture11.jpg c2_capture12.jpg \
+c2_capture13.jpg c2_capture14.jpg c2_capture152.jpg c2_capture15.jpg \
+c2_capture16.jpg c2_capture17.jpg c2_capture18.jpg c2_capture19.jpg \
+c2_capture20.jpg c2_capture212.jpg c2_capture21.jpg c2_capture22.jpg \
+c2_capture23.jpg c2_capture24.jpg c2_capture25.jpg c2_capture26.jpg \
+c2_capture27.jpg c2_capture28.jpg c2_capture29.jpg c2_capture30.jpg \
+c2_p1.jpg c2_p2.jpg c2_p3.jpg c2_p4.jpg c2_p5.jpg c2_p6.jpg c2_p7.jpg \
+c3_capture01.jpg c3_capture02.jpg c3_capture03.jpg c3_capture04.jpg \
+c3_capture05.jpg c3_capture06.jpg c4_capture01.jpg c4_capture02.jpg \
+c5_capture01.jpg c5_capture02.jpg c5_capture03.jpg c5_capture04.jpg \
+c5_capture05.jpg c5_capture06.jpg c5_capture07.jpg c5_capture08.jpg \
+c5_capture09.jpg c5_capture10.jpg c5_capture11.jpg c5_capture12.jpg \
+c5_capture13.jpg c5_config.jpg \
+capture10.jpg capture11.jpg capture12.jpg capture13.jpg \
+cas1_t_10.jpg cas1_t_1.jpg cas1_t_20.jpg cas1_t_29.jpg \
+case3_p10.jpg case3_p1.jpg case3_p2.jpg case3_p3.jpg case3_p4.jpg \
+case3_p5.jpg case3_p6.jpg case3_p7.jpg case3_p8.jpg case3_p9.jpg \
+case4_p1.jpg case4_p2.jpg case4_p3.jpg case4_p4.jpg case4_p5.jpg \
+case4_p6.jpg case5_01.jpg case5_02.jpg case5_03.jpg case5_04.jpg \
+case5_05.jpg case5_06.jpg case5_07.jpg case5_08.jpg case5_09.jpg \
+color_Snimbus.jpg evotemp_case3.png \
+fig01.jpg fig02.jpg fig03.jpg fig04.jpg fig05.jpg fig06.jpg \
+fig07.jpg fig08.jpg fig09.jpg moytemp.png probe9.png
+
+
+# Distributed files
+EXTRA_DIST = $(FIGFILES) $(OTHERFILES)
+
+# Generated documents (pdf files)
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+SUFFIXES = .fig .pdf
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .fig .pdf
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/tutorial/graphics/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/tutorial/graphics/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am: pdf-local
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distclean-local distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am pdf-local \
+ ps ps-am uninstall uninstall-am
+
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/tutorial/graphics/c1_capture01.jpg b/doc/tutorial/graphics/c1_capture01.jpg
new file mode 100644
index 0000000..df71eed
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture01.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture02.jpg b/doc/tutorial/graphics/c1_capture02.jpg
new file mode 100644
index 0000000..2a66e3b
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture02.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture03.jpg b/doc/tutorial/graphics/c1_capture03.jpg
new file mode 100644
index 0000000..8ff7285
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture03.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture04.jpg b/doc/tutorial/graphics/c1_capture04.jpg
new file mode 100644
index 0000000..56f2d03
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture04.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture05.jpg b/doc/tutorial/graphics/c1_capture05.jpg
new file mode 100644
index 0000000..e2b23e2
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture05.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture06.jpg b/doc/tutorial/graphics/c1_capture06.jpg
new file mode 100644
index 0000000..c8b462a
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture06.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture07.jpg b/doc/tutorial/graphics/c1_capture07.jpg
new file mode 100644
index 0000000..e97ad60
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture07.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture08.jpg b/doc/tutorial/graphics/c1_capture08.jpg
new file mode 100644
index 0000000..e28b38a
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture08.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture09.jpg b/doc/tutorial/graphics/c1_capture09.jpg
new file mode 100644
index 0000000..649cef1
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture09.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture10.jpg b/doc/tutorial/graphics/c1_capture10.jpg
new file mode 100644
index 0000000..42edc01
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture10.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture11.jpg b/doc/tutorial/graphics/c1_capture11.jpg
new file mode 100644
index 0000000..8b48dbf
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture11.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture12.jpg b/doc/tutorial/graphics/c1_capture12.jpg
new file mode 100644
index 0000000..f73f04e
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture12.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture13.jpg b/doc/tutorial/graphics/c1_capture13.jpg
new file mode 100644
index 0000000..46b371f
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture13.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture14.jpg b/doc/tutorial/graphics/c1_capture14.jpg
new file mode 100644
index 0000000..12649ec
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture14.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture15.jpg b/doc/tutorial/graphics/c1_capture15.jpg
new file mode 100644
index 0000000..bf7d896
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture15.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture16.jpg b/doc/tutorial/graphics/c1_capture16.jpg
new file mode 100644
index 0000000..d561132
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture16.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture17.jpg b/doc/tutorial/graphics/c1_capture17.jpg
new file mode 100644
index 0000000..ddf586c
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture17.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture18.jpg b/doc/tutorial/graphics/c1_capture18.jpg
new file mode 100644
index 0000000..3733f5c
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture18.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture19.jpg b/doc/tutorial/graphics/c1_capture19.jpg
new file mode 100644
index 0000000..e6c0fbb
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture19.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture20.jpg b/doc/tutorial/graphics/c1_capture20.jpg
new file mode 100644
index 0000000..cd76668
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture20.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture21.jpg b/doc/tutorial/graphics/c1_capture21.jpg
new file mode 100644
index 0000000..f60e1d1
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture21.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture22.jpg b/doc/tutorial/graphics/c1_capture22.jpg
new file mode 100644
index 0000000..5e07997
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture22.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture23.jpg b/doc/tutorial/graphics/c1_capture23.jpg
new file mode 100644
index 0000000..63df8fe
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture23.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture24.jpg b/doc/tutorial/graphics/c1_capture24.jpg
new file mode 100644
index 0000000..4180774
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture24.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture25.jpg b/doc/tutorial/graphics/c1_capture25.jpg
new file mode 100644
index 0000000..846a8ab
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture25.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture26.jpg b/doc/tutorial/graphics/c1_capture26.jpg
new file mode 100644
index 0000000..e159fe4
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture26.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture27.jpg b/doc/tutorial/graphics/c1_capture27.jpg
new file mode 100644
index 0000000..bcf458b
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture27.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture28.jpg b/doc/tutorial/graphics/c1_capture28.jpg
new file mode 100644
index 0000000..f788aaa
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture28.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture29.jpg b/doc/tutorial/graphics/c1_capture29.jpg
new file mode 100644
index 0000000..921d575
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture29.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture30.jpg b/doc/tutorial/graphics/c1_capture30.jpg
new file mode 100644
index 0000000..f298d2b
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture30.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture31.jpg b/doc/tutorial/graphics/c1_capture31.jpg
new file mode 100644
index 0000000..5da39de
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture31.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture32.jpg b/doc/tutorial/graphics/c1_capture32.jpg
new file mode 100644
index 0000000..40c6bac
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture32.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture33.jpg b/doc/tutorial/graphics/c1_capture33.jpg
new file mode 100644
index 0000000..f8b3e33
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture33.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture34.jpg b/doc/tutorial/graphics/c1_capture34.jpg
new file mode 100644
index 0000000..e74ec92
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture34.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture35.jpg b/doc/tutorial/graphics/c1_capture35.jpg
new file mode 100644
index 0000000..e97b7c6
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture35.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture36.jpg b/doc/tutorial/graphics/c1_capture36.jpg
new file mode 100644
index 0000000..08080f3
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture36.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture37.jpg b/doc/tutorial/graphics/c1_capture37.jpg
new file mode 100644
index 0000000..586497e
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture37.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture38.jpg b/doc/tutorial/graphics/c1_capture38.jpg
new file mode 100644
index 0000000..b6f0a41
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture38.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture39.jpg b/doc/tutorial/graphics/c1_capture39.jpg
new file mode 100644
index 0000000..25c2672
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture39.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture40.jpg b/doc/tutorial/graphics/c1_capture40.jpg
new file mode 100644
index 0000000..7f0f7de
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture40.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture41.jpg b/doc/tutorial/graphics/c1_capture41.jpg
new file mode 100644
index 0000000..7c0d09b
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture41.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture42.jpg b/doc/tutorial/graphics/c1_capture42.jpg
new file mode 100644
index 0000000..0075168
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture42.jpg differ
diff --git a/doc/tutorial/graphics/c1_capture43.jpg b/doc/tutorial/graphics/c1_capture43.jpg
new file mode 100644
index 0000000..4aa5bc8
Binary files /dev/null and b/doc/tutorial/graphics/c1_capture43.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture01.jpg b/doc/tutorial/graphics/c2_capture01.jpg
new file mode 100644
index 0000000..461d8c4
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture01.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture02.jpg b/doc/tutorial/graphics/c2_capture02.jpg
new file mode 100644
index 0000000..431d4c8
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture02.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture03.jpg b/doc/tutorial/graphics/c2_capture03.jpg
new file mode 100644
index 0000000..85231e6
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture03.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture04.jpg b/doc/tutorial/graphics/c2_capture04.jpg
new file mode 100644
index 0000000..ae8bb66
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture04.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture05.jpg b/doc/tutorial/graphics/c2_capture05.jpg
new file mode 100644
index 0000000..374774c
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture05.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture06.jpg b/doc/tutorial/graphics/c2_capture06.jpg
new file mode 100644
index 0000000..3b0de67
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture06.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture07.jpg b/doc/tutorial/graphics/c2_capture07.jpg
new file mode 100644
index 0000000..c9fd440
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture07.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture08.jpg b/doc/tutorial/graphics/c2_capture08.jpg
new file mode 100644
index 0000000..57f9f6c
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture08.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture09.jpg b/doc/tutorial/graphics/c2_capture09.jpg
new file mode 100644
index 0000000..9a27326
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture09.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture10.jpg b/doc/tutorial/graphics/c2_capture10.jpg
new file mode 100644
index 0000000..a74f23b
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture10.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture11.jpg b/doc/tutorial/graphics/c2_capture11.jpg
new file mode 100644
index 0000000..74ece69
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture11.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture12.jpg b/doc/tutorial/graphics/c2_capture12.jpg
new file mode 100644
index 0000000..1c6f239
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture12.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture13.jpg b/doc/tutorial/graphics/c2_capture13.jpg
new file mode 100644
index 0000000..d27dec2
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture13.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture14.jpg b/doc/tutorial/graphics/c2_capture14.jpg
new file mode 100644
index 0000000..31b3e7a
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture14.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture15.jpg b/doc/tutorial/graphics/c2_capture15.jpg
new file mode 100644
index 0000000..237f349
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture15.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture152.jpg b/doc/tutorial/graphics/c2_capture152.jpg
new file mode 100644
index 0000000..193ddb3
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture152.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture16.jpg b/doc/tutorial/graphics/c2_capture16.jpg
new file mode 100644
index 0000000..8f8595d
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture16.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture17.jpg b/doc/tutorial/graphics/c2_capture17.jpg
new file mode 100644
index 0000000..586c124
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture17.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture18.jpg b/doc/tutorial/graphics/c2_capture18.jpg
new file mode 100644
index 0000000..ecee4d0
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture18.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture19.jpg b/doc/tutorial/graphics/c2_capture19.jpg
new file mode 100644
index 0000000..74c438e
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture19.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture20.jpg b/doc/tutorial/graphics/c2_capture20.jpg
new file mode 100644
index 0000000..ba8a0ae
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture20.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture21.jpg b/doc/tutorial/graphics/c2_capture21.jpg
new file mode 100644
index 0000000..79e0348
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture21.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture212.jpg b/doc/tutorial/graphics/c2_capture212.jpg
new file mode 100644
index 0000000..c83c88d
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture212.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture22.jpg b/doc/tutorial/graphics/c2_capture22.jpg
new file mode 100644
index 0000000..1d8c15d
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture22.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture23.jpg b/doc/tutorial/graphics/c2_capture23.jpg
new file mode 100644
index 0000000..bf816db
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture23.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture24.jpg b/doc/tutorial/graphics/c2_capture24.jpg
new file mode 100644
index 0000000..39abc29
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture24.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture25.jpg b/doc/tutorial/graphics/c2_capture25.jpg
new file mode 100644
index 0000000..5e526f9
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture25.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture26.jpg b/doc/tutorial/graphics/c2_capture26.jpg
new file mode 100644
index 0000000..691ee20
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture26.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture27.jpg b/doc/tutorial/graphics/c2_capture27.jpg
new file mode 100644
index 0000000..5c477d0
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture27.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture28.jpg b/doc/tutorial/graphics/c2_capture28.jpg
new file mode 100644
index 0000000..e2c1ad5
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture28.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture29.jpg b/doc/tutorial/graphics/c2_capture29.jpg
new file mode 100644
index 0000000..26589db
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture29.jpg differ
diff --git a/doc/tutorial/graphics/c2_capture30.jpg b/doc/tutorial/graphics/c2_capture30.jpg
new file mode 100644
index 0000000..43f6144
Binary files /dev/null and b/doc/tutorial/graphics/c2_capture30.jpg differ
diff --git a/doc/tutorial/graphics/c2_p1.jpg b/doc/tutorial/graphics/c2_p1.jpg
new file mode 100644
index 0000000..517f57c
Binary files /dev/null and b/doc/tutorial/graphics/c2_p1.jpg differ
diff --git a/doc/tutorial/graphics/c2_p2.jpg b/doc/tutorial/graphics/c2_p2.jpg
new file mode 100644
index 0000000..57409c4
Binary files /dev/null and b/doc/tutorial/graphics/c2_p2.jpg differ
diff --git a/doc/tutorial/graphics/c2_p3.jpg b/doc/tutorial/graphics/c2_p3.jpg
new file mode 100644
index 0000000..c7cade2
Binary files /dev/null and b/doc/tutorial/graphics/c2_p3.jpg differ
diff --git a/doc/tutorial/graphics/c2_p4.jpg b/doc/tutorial/graphics/c2_p4.jpg
new file mode 100644
index 0000000..86d6c75
Binary files /dev/null and b/doc/tutorial/graphics/c2_p4.jpg differ
diff --git a/doc/tutorial/graphics/c2_p5.jpg b/doc/tutorial/graphics/c2_p5.jpg
new file mode 100644
index 0000000..131ef67
Binary files /dev/null and b/doc/tutorial/graphics/c2_p5.jpg differ
diff --git a/doc/tutorial/graphics/c2_p6.jpg b/doc/tutorial/graphics/c2_p6.jpg
new file mode 100644
index 0000000..ca6064a
Binary files /dev/null and b/doc/tutorial/graphics/c2_p6.jpg differ
diff --git a/doc/tutorial/graphics/c2_p7.jpg b/doc/tutorial/graphics/c2_p7.jpg
new file mode 100644
index 0000000..2cf3aea
Binary files /dev/null and b/doc/tutorial/graphics/c2_p7.jpg differ
diff --git a/doc/tutorial/graphics/c3_capture01.jpg b/doc/tutorial/graphics/c3_capture01.jpg
new file mode 100644
index 0000000..07bced7
Binary files /dev/null and b/doc/tutorial/graphics/c3_capture01.jpg differ
diff --git a/doc/tutorial/graphics/c3_capture02.jpg b/doc/tutorial/graphics/c3_capture02.jpg
new file mode 100644
index 0000000..5cb3edd
Binary files /dev/null and b/doc/tutorial/graphics/c3_capture02.jpg differ
diff --git a/doc/tutorial/graphics/c3_capture03.jpg b/doc/tutorial/graphics/c3_capture03.jpg
new file mode 100644
index 0000000..f0b4bc1
Binary files /dev/null and b/doc/tutorial/graphics/c3_capture03.jpg differ
diff --git a/doc/tutorial/graphics/c3_capture04.jpg b/doc/tutorial/graphics/c3_capture04.jpg
new file mode 100644
index 0000000..578f5f7
Binary files /dev/null and b/doc/tutorial/graphics/c3_capture04.jpg differ
diff --git a/doc/tutorial/graphics/c3_capture05.jpg b/doc/tutorial/graphics/c3_capture05.jpg
new file mode 100644
index 0000000..bb5019c
Binary files /dev/null and b/doc/tutorial/graphics/c3_capture05.jpg differ
diff --git a/doc/tutorial/graphics/c3_capture06.jpg b/doc/tutorial/graphics/c3_capture06.jpg
new file mode 100644
index 0000000..f2d197d
Binary files /dev/null and b/doc/tutorial/graphics/c3_capture06.jpg differ
diff --git a/doc/tutorial/graphics/c4_capture01.jpg b/doc/tutorial/graphics/c4_capture01.jpg
new file mode 100644
index 0000000..0cebd61
Binary files /dev/null and b/doc/tutorial/graphics/c4_capture01.jpg differ
diff --git a/doc/tutorial/graphics/c4_capture02.jpg b/doc/tutorial/graphics/c4_capture02.jpg
new file mode 100644
index 0000000..fd9e4c8
Binary files /dev/null and b/doc/tutorial/graphics/c4_capture02.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture01.jpg b/doc/tutorial/graphics/c5_capture01.jpg
new file mode 100644
index 0000000..418706d
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture01.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture02.jpg b/doc/tutorial/graphics/c5_capture02.jpg
new file mode 100644
index 0000000..bad2cef
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture02.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture03.jpg b/doc/tutorial/graphics/c5_capture03.jpg
new file mode 100644
index 0000000..b086666
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture03.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture04.jpg b/doc/tutorial/graphics/c5_capture04.jpg
new file mode 100644
index 0000000..e157c8a
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture04.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture05.jpg b/doc/tutorial/graphics/c5_capture05.jpg
new file mode 100644
index 0000000..17b405b
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture05.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture06.jpg b/doc/tutorial/graphics/c5_capture06.jpg
new file mode 100644
index 0000000..7e72e32
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture06.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture07.jpg b/doc/tutorial/graphics/c5_capture07.jpg
new file mode 100644
index 0000000..64cd581
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture07.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture08.jpg b/doc/tutorial/graphics/c5_capture08.jpg
new file mode 100644
index 0000000..0e21cc6
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture08.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture09.jpg b/doc/tutorial/graphics/c5_capture09.jpg
new file mode 100644
index 0000000..bbeaf2d
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture09.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture10.jpg b/doc/tutorial/graphics/c5_capture10.jpg
new file mode 100644
index 0000000..21eeefc
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture10.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture11.jpg b/doc/tutorial/graphics/c5_capture11.jpg
new file mode 100644
index 0000000..e47d64f
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture11.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture12.jpg b/doc/tutorial/graphics/c5_capture12.jpg
new file mode 100644
index 0000000..3689d63
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture12.jpg differ
diff --git a/doc/tutorial/graphics/c5_capture13.jpg b/doc/tutorial/graphics/c5_capture13.jpg
new file mode 100644
index 0000000..bb6914f
Binary files /dev/null and b/doc/tutorial/graphics/c5_capture13.jpg differ
diff --git a/doc/tutorial/graphics/c5_config.jpg b/doc/tutorial/graphics/c5_config.jpg
new file mode 100644
index 0000000..ef95759
Binary files /dev/null and b/doc/tutorial/graphics/c5_config.jpg differ
diff --git a/doc/tutorial/graphics/capture10.jpg b/doc/tutorial/graphics/capture10.jpg
new file mode 100644
index 0000000..21eeefc
Binary files /dev/null and b/doc/tutorial/graphics/capture10.jpg differ
diff --git a/doc/tutorial/graphics/capture11.jpg b/doc/tutorial/graphics/capture11.jpg
new file mode 100644
index 0000000..e47d64f
Binary files /dev/null and b/doc/tutorial/graphics/capture11.jpg differ
diff --git a/doc/tutorial/graphics/capture12.jpg b/doc/tutorial/graphics/capture12.jpg
new file mode 100644
index 0000000..3689d63
Binary files /dev/null and b/doc/tutorial/graphics/capture12.jpg differ
diff --git a/doc/tutorial/graphics/capture13.jpg b/doc/tutorial/graphics/capture13.jpg
new file mode 100644
index 0000000..bb6914f
Binary files /dev/null and b/doc/tutorial/graphics/capture13.jpg differ
diff --git a/doc/tutorial/graphics/cas1_t_1.jpg b/doc/tutorial/graphics/cas1_t_1.jpg
new file mode 100644
index 0000000..24beede
Binary files /dev/null and b/doc/tutorial/graphics/cas1_t_1.jpg differ
diff --git a/doc/tutorial/graphics/cas1_t_10.jpg b/doc/tutorial/graphics/cas1_t_10.jpg
new file mode 100644
index 0000000..17a4c4d
Binary files /dev/null and b/doc/tutorial/graphics/cas1_t_10.jpg differ
diff --git a/doc/tutorial/graphics/cas1_t_20.jpg b/doc/tutorial/graphics/cas1_t_20.jpg
new file mode 100644
index 0000000..8faf26f
Binary files /dev/null and b/doc/tutorial/graphics/cas1_t_20.jpg differ
diff --git a/doc/tutorial/graphics/cas1_t_29.jpg b/doc/tutorial/graphics/cas1_t_29.jpg
new file mode 100644
index 0000000..fe1b514
Binary files /dev/null and b/doc/tutorial/graphics/cas1_t_29.jpg differ
diff --git a/doc/tutorial/graphics/case3.cmd b/doc/tutorial/graphics/case3.cmd
new file mode 100644
index 0000000..4e1d790
--- /dev/null
+++ b/doc/tutorial/graphics/case3.cmd
@@ -0,0 +1,734 @@
+VERSION 8.07
+data: binary_files_are big_endian
+data: format case
+data: path /local00/users/guillaud/TUTO_CS/COMPLET_DOMAIN/CAS3/RESU/CHR.ENSIGHT.09051728
+data: geometry CHR.case
+data: shift_time 1.000000 0.000000 0.000000
+data: read
+data_partbuild: begin
+data_partbuild: data_type unstructured
+data_partbuild: select_all
+data_partbuild: description
+data_partbuild: create
+data_partbuild: end
+part: select_begin
+ 2
+part: select_end
+part: modify_begin
+part: visible OFF
+part: modify_end
+variables: activate Temp.C
+part: select_begin
+ 1
+part: select_end
+part: modify_begin
+part: colorby_palette Temp.C
+part: modify_end
+part: modify_begin
+part: colorby_palette Temp.C
+part: modify_end
+function: palette Temp.C
+view_transf: rotate 1.799999e+01 2.541173e+00 0.000000e+00
+function: range 120.16 400
+function: set_palette_to_partminmax
+view_transf: rotate -1.462500e+01 -4.235294e+00 0.000000e+00
+view: hidden_surface ON
+view_transf: rotate 1.996875e+01 1.842352e+01 0.000000e+00
+view_transf: zoom 6.362835e-01
+view_transf: zoom 1.228703e+00
+query_interact: select_varname_begin
+Temp.C
+query_interact: select_varname_end
+query_interact: query surface
+query_interact: create 0.378378 0.739470
+solution_time: current_step 0.000000
+solution_time: update_to_current
+function: range 20 24.803
+function: set_palette_to_partminmax
+solution_time: play_forward
+solution_time: stop
+solution_time: current_step 0.000000
+solution_time: update_to_current
+solution_time: time_annotation ON
+solution_time: current_step 1.000000
+solution_time: update_to_current
+solution_time: current_step 2.000000
+solution_time: update_to_current
+solution_time: current_step 3.000000
+solution_time: update_to_current
+solution_time: current_step 4.000000
+solution_time: update_to_current
+solution_time: current_step 5.000000
+solution_time: update_to_current
+solution_time: current_step 6.000000
+solution_time: update_to_current
+solution_time: current_step 7.000000
+solution_time: update_to_current
+solution_time: current_step 8.000000
+solution_time: update_to_current
+solution_time: current_step 9.000000
+solution_time: update_to_current
+solution_time: current_step 10.000000
+solution_time: update_to_current
+solution_time: current_step 11.000000
+solution_time: update_to_current
+solution_time: current_step 12.000000
+solution_time: update_to_current
+solution_time: current_step 13.000000
+solution_time: update_to_current
+solution_time: current_step 14.000000
+solution_time: update_to_current
+solution_time: current_step 15.000000
+solution_time: update_to_current
+solution_time: current_step 16.000000
+solution_time: update_to_current
+solution_time: current_step 17.000000
+solution_time: update_to_current
+solution_time: current_step 18.000000
+solution_time: update_to_current
+solution_time: current_step 19.000000
+solution_time: update_to_current
+solution_time: current_step 20.000000
+solution_time: update_to_current
+solution_time: current_step 21.000000
+solution_time: update_to_current
+solution_time: current_step 22.000000
+solution_time: update_to_current
+solution_time: current_step 23.000000
+solution_time: update_to_current
+solution_time: current_step 24.000000
+solution_time: update_to_current
+solution_time: current_step 25.000000
+solution_time: update_to_current
+solution_time: current_step 26.000000
+solution_time: update_to_current
+solution_time: current_step 27.000000
+solution_time: update_to_current
+solution_time: current_step 28.000000
+solution_time: update_to_current
+solution_time: current_step 29.000000
+solution_time: update_to_current
+solution_time: current_step 30.000000
+solution_time: update_to_current
+solution_time: current_step 31.000000
+solution_time: update_to_current
+solution_time: current_step 32.000000
+solution_time: update_to_current
+solution_time: current_step 33.000000
+solution_time: update_to_current
+solution_time: current_step 34.000000
+solution_time: update_to_current
+solution_time: current_step 35.000000
+solution_time: update_to_current
+solution_time: current_step 36.000000
+solution_time: update_to_current
+solution_time: current_step 37.000000
+solution_time: update_to_current
+solution_time: current_step 38.000000
+solution_time: update_to_current
+solution_time: current_step 39.000000
+solution_time: update_to_current
+solution_time: current_step 40.000000
+solution_time: update_to_current
+solution_time: current_step 41.000000
+solution_time: update_to_current
+solution_time: current_step 42.000000
+solution_time: update_to_current
+solution_time: current_step 43.000000
+solution_time: update_to_current
+solution_time: current_step 44.000000
+solution_time: update_to_current
+solution_time: current_step 45.000000
+solution_time: update_to_current
+solution_time: current_step 46.000000
+solution_time: update_to_current
+solution_time: current_step 47.000000
+solution_time: update_to_current
+solution_time: current_step 48.000000
+solution_time: update_to_current
+solution_time: current_step 49.000000
+solution_time: update_to_current
+solution_time: current_step 50.000000
+solution_time: update_to_current
+solution_time: current_step 51.000000
+solution_time: update_to_current
+solution_time: current_step 52.000000
+solution_time: update_to_current
+solution_time: current_step 53.000000
+solution_time: update_to_current
+solution_time: current_step 54.000000
+solution_time: update_to_current
+solution_time: current_step 55.000000
+solution_time: update_to_current
+solution_time: current_step 56.000000
+solution_time: update_to_current
+solution_time: current_step 57.000000
+solution_time: update_to_current
+solution_time: current_step 58.000000
+solution_time: update_to_current
+solution_time: current_step 59.000000
+solution_time: update_to_current
+solution_time: current_step 60.000000
+solution_time: update_to_current
+solution_time: current_step 61.000000
+solution_time: update_to_current
+solution_time: play_forward
+solution_time: stop
+solution_time: current_step 149.000000
+solution_time: update_to_current
+solution_time: end_step 149
+function: range 120.16 400
+function: set_palette_to_partminmax
+view_transf: rotate -3.937499e+00 -1.058823e+00 0.000000e+00
+solution_time: current_step 0.000000
+solution_time: update_to_current
+solution_time: end_step 149
+solution_time: play_forward
+solution_time: stop
+solution_time: current_step 149.000000
+solution_time: update_to_current
+solution_time: end_step 149
+function: range 120.16 400
+function: set_palette_to_partminmax
+view_transf: rotate -2.165625e+01 3.388231e+00 0.000000e+00
+view_transf: rotate 2.109375e+01 9.529411e+00 0.000000e+00
+view_transf: rotate -9.281259e+00 -4.023528e+00 0.000000e+00
+view_transf: rotate 1.125000e+01 2.117647e+00 0.000000e+00
+view_transf: rotate -2.109375e+01 -2.964707e+00 0.000000e+00
+view_transf: rotate 1.828125e+01 1.080000e+01 0.000000e+00
+part: select_begin
+ 2
+part: select_end
+part: modify_begin
+part: visible ON
+part: modify_end
+part: select_begin
+ 1
+part: select_end
+part: modify_begin
+part: visible OFF
+part: modify_end
+solution_time: play_forward
+solution_time: stop
+part: select_begin
+ 2
+part: select_end
+part: modify_begin
+part: colorby_palette Temp.C
+part: modify_end
+solution_time: play_forward
+solution_time: stop
+part: modify_begin
+part: visible OFF
+part: modify_end
+part: select_begin
+ 1
+part: select_end
+part: modify_begin
+part: visible ON
+part: modify_end
+solution_time: current_step 0.000000
+solution_time: update_to_current
+view_transf: rotate 1.687496e+00 1.694121e+00 0.000000e+00
+view_transf: rotate 6.468750e+00 -2.329412e+01 0.000000e+00
+variables: activate VelocitU
+part: select_begin
+ 1
+part: select_end
+vctarrow: begin
+vctarrow: variable VelocitU
+vctarrow: end
+vctarrow: create
+part: select_begin
+ 3
+part: select_end
+part: delete
+clip: select_default
+part: modify_begin
+clip: mesh_plane Z
+clip: tool xyz
+part: modify_end
+part: select_begin
+ 1
+part: select_end
+clip: begin
+clip: value MID-RANGE
+clip: domain intersect
+clip: tool xyz
+clip: end
+clip: create
+part: select_begin
+ 3
+part: select_end
+part: select_begin
+ 3
+part: select_end
+part: modify_begin
+part: colorby_palette Temp.C
+part: modify_end
+vctarrow: select_default
+part: modify_begin
+vctarrow: tip_shape triangle
+part: modify_end
+part: select_begin
+ 3
+part: select_end
+vctarrow: begin
+vctarrow: variable VelocitU
+vctarrow: end
+vctarrow: create
+part: select_begin
+ 4
+part: select_end
+view_transf: rotate -5.203125e+01 -2.329413e+00 0.000000e+00
+view_transf: rotate 3.768750e+01 -1.397648e+01 0.000000e+00
+view_transf: rotate 1.321875e+01 1.207058e+01 0.000000e+00
+part: select_begin
+ 1
+part: select_end
+part: modify_begin
+part: visible OFF
+part: modify_end
+part: select_begin
+ 1
+part: select_end
+clip: begin
+clip: value MID-RANGE
+clip: domain intersect
+clip: tool xyz
+clip: end
+clip: create
+part: select_begin
+ 5
+part: select_end
+part: select_begin
+ 3
+part: select_end
+part: modify_begin
+part: visible OFF
+part: modify_end
+part: select_begin
+ 5
+part: select_end
+part: modify_begin
+part: colorby_palette Temp.C
+part: modify_end
+part: modify_begin
+part: elt_representation border
+part: modify_end
+view_transf: rotate -2.475000e+01 3.811768e+00 0.000000e+00
+view_transf: rotate 9.281253e+00 -1.228236e+01 0.000000e+00
+part: modify_begin
+part: colorby_palette none
+part: modify_end
+view_transf: rotate 7.312507e+00 -9.741177e+00 0.000000e+00
+view_transf: view_recall +Z
+view_transf: zoom 6.968464e-01
+view_transf: zoom 1.006609e+00
+text: select_begin
+ 0
+text: select_end
+view_transf: function global
+text: select_default
+view_transf: function global
+part: select_begin
+ 3
+part: select_end
+part: modify_begin
+part: visible ON
+part: modify_end
+solution_time: play_forward
+solution_time: stop
+part: modify_begin
+part: colorby_palette Temp.C
+part: modify_end
+function: palette Temp.C
+function: range 20 400
+solution_time: current_step 0.000000
+solution_time: update_to_current
+solution_time: play_forward
+solution_time: stop
+solution_time: current_step 149.000000
+solution_time: update_to_current
+solution_time: end_step 149
+part: modify_begin
+part: visible OFF
+part: modify_end
+part: select_begin
+ 4
+part: select_end
+part: modify_begin
+vctarrow: scale_factor 5.000000e-01
+part: modify_end
+part: modify_begin
+vctarrow: scale_factor 5.000000e-02
+part: modify_end
+part: modify_begin
+vctarrow: scale_factor 7.000000e-02
+part: modify_end
+part: modify_begin
+part: colorby_palette Temp.C
+part: modify_end
+view_transf: function global
+view_transf: function global
+view_transf: function global
+view_transf: function global
+viewport: select_begin
+ 0
+viewport: select_end
+view_transf: function global
+viewport: origin_x 0.000000e+00
+viewport: origin_y 0.000000e+00
+viewport: width 1.000000e+00
+viewport: height 1.000000e+00
+viewport: origin_x 0.000000e+00
+viewport: origin_y 0.000000e+00
+viewport: width 1.000000e+00
+viewport: height 1.000000e+00
+viewport: origin_x 0.000000e+00
+viewport: origin_y 0.000000e+00
+viewport: width 1.000000e+00
+viewport: height 1.000000e+00
+view_transf: function global
+view_transf: rotate 1.125004e+00 -2.117604e-01 0.000000e+00
+view_transf: view_recall +Z
+view_transf: zoom 7.071587e-01
+query_interact: marker_size_normalized 5.000000e+00
+query_interact: marker_size_normalized 2.000000e+00
+query_interact: label_always_on_top ON
+query_interact: label_always_on_top OFF
+query_interact: label_visible OFF
+solution_time: current_step 0.000000
+solution_time: update_to_current
+solution_time: end_step 149
+part: select_begin
+ 5
+part: select_end
+part: modify_begin
+part: visible OFF
+part: modify_end
+part: select_begin
+ 1
+part: select_end
+clip: begin
+clip: value MID-RANGE
+clip: domain intersect
+clip: tool xyz
+clip: end
+clip: create
+part: select_begin
+ 6
+part: select_end
+part: modify_begin
+part: elt_representation border
+part: modify_end
+part: modify_begin
+part: elt_representation feature_angle
+part: modify_end
+part: modify_begin
+part: elt_representation 3D_feature_2D_full
+part: modify_end
+part: delete
+part: select_begin
+ 2
+part: select_end
+clip: begin
+clip: value MID-RANGE
+clip: domain intersect
+clip: tool xyz
+clip: end
+clip: create
+part: select_begin
+ 6
+part: select_end
+part: select_begin
+ 6
+part: select_end
+part: modify_begin
+part: elt_representation border
+part: modify_end
+view_transf: function global
+text: select_begin
+ 0
+text: select_end
+text: change_text t = <\\ cnst C1 "%.3f" Analysis_Time \\>s
+text: change_text t = <\\ cnst C1 "%.1f" Analysis_Time \\>s
+text: new_text T_entree = 24.8C
+text: select_begin
+ 1
+text: select_end
+text: select_begin
+ 1
+text: select_end
+text: modify_begin
+text: location_x 1.571680e-01
+text: location_y 8.194228e-01
+text: modify_end
+text: select_begin
+ 1
+text: select_end
+legend: select_palette_begin
+Temp.C
+legend: select_palette_end
+legend: format %.0f
+line: new_line
+text: select_default
+line: select_begin
+ 0
+line: select_end
+legend: select_default
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 4.905993e-02
+line: location_y 1 6.041342e-01
+line: location_x 2 5.490599e-01
+line: location_y 2 6.041342e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: arrowhead on_first_end
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 2.523502e-01
+line: location_y 1 3.264431e-01
+line: location_x 2 5.490599e-01
+line: location_y 2 6.041342e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 2.523502e-01
+line: location_y 1 3.264431e-01
+line: location_x 2 3.586957e-01
+line: location_y 2 7.757411e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 2.511751e-01
+line: location_y 1 3.280032e-01
+line: location_x 2 3.575206e-01
+line: location_y 2 7.773012e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 2.664512e-01
+line: location_y 1 7.086584e-01
+line: location_x 2 3.575206e-01
+line: location_y 2 7.773012e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: select_default
+view_transf: function global
+view_transf: translate 4.566318e-01 1.158415e-01 0.000000e+00
+view_transf: rotate 1.968752e+00 2.329413e+00 0.000000e+00
+view_transf: view_recall +Z
+view_transf: zoom 7.144552e-01
+view_transf: function global
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 3.099295e-01
+line: location_y 1 8.459439e-01
+line: location_x 2 3.575206e-01
+line: location_y 2 7.773012e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 3.099295e-01
+line: location_y 1 8.459439e-01
+line: location_x 2 4.045241e-01
+line: location_y 2 8.459439e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 3.146299e-01
+line: location_y 1 8.381435e-01
+line: location_x 2 4.092245e-01
+line: location_y 2 8.381436e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+line: width 3
+line: select_begin
+ 0
+line: select_end
+line: select_default
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 3.169800e-01
+line: location_y 1 8.334633e-01
+line: location_x 2 4.115747e-01
+line: location_y 2 8.334634e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+view_transf: function global
+view_transf: translate 3.265690e-01 6.884513e-02 0.000000e+00
+view_transf: function global
+text: select_begin
+ 1
+text: select_end
+line: select_default
+text: select_begin
+ 1
+text: select_end
+text: modify_begin
+text: location_x 1.548178e-01
+text: location_y 7.819813e-01
+text: modify_end
+text: select_begin
+ 1
+text: select_end
+text: select_default
+line: select_begin
+ 0
+line: select_end
+line: select_begin
+ 0
+line: select_end
+line: modify_begin
+line: location_x 1 3.181551e-01
+line: location_y 1 7.991419e-01
+line: location_x 2 4.127497e-01
+line: location_y 2 7.991420e-01
+line: modify_end
+line: select_begin
+ 0
+line: select_end
+text: select_begin
+ 0
+text: select_end
+line: select_default
+text: select_begin
+ 0
+text: select_end
+text: modify_begin
+text: location_x 1.117509e-02
+text: location_y 8.906396e-01
+text: modify_end
+text: select_begin
+ 0
+text: select_end
+view_transf: function global
+view_transf: zoom 9.717489e-01
+view_transf: translate 3.526038e-02 -4.014001e-02 0.000000e+00
+file: image_format jpeg
+file: image_quality 100
+file: image_file case3_p1
+file: image_convert ON
+file: save_image
+file: image_convert OFF
+solution_time: current_step 14.000000
+solution_time: update_to_current
+view_transf: function global
+text: select_begin
+ 1
+text: select_end
+text: change_text T_entree = 165C
+view_transf: function global
+file: image_file case3_p2
+file: image_convert ON
+file: save_image
+file: image_convert OFF
+solution_time: current_step 35.000000
+solution_time: update_to_current
+solution_time: current_step 36.000000
+solution_time: update_to_current
+solution_time: current_step 40.000000
+solution_time: update_to_current
+solution_time: current_step 38.000000
+solution_time: update_to_current
+solution_time: current_step 39.000000
+solution_time: update_to_current
+solution_time: current_step 31.000000
+solution_time: update_to_current
+solution_time: current_step 29.000000
+solution_time: update_to_current
+text: change_text T_entree = 315C
+file: image_file case3_p3
+file: image_convert ON
+file: save_image
+file: image_convert OFF
+solution_time: current_step 35.000000
+solution_time: update_to_current
+solution_time: current_step 36.000000
+solution_time: update_to_current
+solution_time: current_step 42.000000
+solution_time: update_to_current
+solution_time: current_step 41.000000
+solution_time: update_to_current
+solution_time: current_step 38.000000
+solution_time: update_to_current
+solution_time: current_step 39.000000
+solution_time: update_to_current
+text: change_text T_entree = 400C
+file: image_file case3_p4
+file: image_convert ON
+file: save_image
+file: image_convert OFF
+solution_time: current_step 82.000000
+solution_time: update_to_current
+solution_time: play_forward
+solution_time: stop
+solution_time: current_step 87.000000
+solution_time: update_to_current
+solution_time: current_step 88.000000
+solution_time: update_to_current
+solution_time: current_step 89.000000
+solution_time: update_to_current
+file: image_file case3_p5
+file: image_convert ON
+file: save_image
+file: image_convert OFF
+solution_time: current_step 149.000000
+solution_time: update_to_current
+solution_time: end_step 149
+file: image_file case3_p6
+file: image_convert ON
+file: save_image
+file: image_convert OFF
diff --git a/doc/tutorial/graphics/case3_p1.jpg b/doc/tutorial/graphics/case3_p1.jpg
new file mode 100644
index 0000000..944c87b
Binary files /dev/null and b/doc/tutorial/graphics/case3_p1.jpg differ
diff --git a/doc/tutorial/graphics/case3_p10.jpg b/doc/tutorial/graphics/case3_p10.jpg
new file mode 100644
index 0000000..9552fa6
Binary files /dev/null and b/doc/tutorial/graphics/case3_p10.jpg differ
diff --git a/doc/tutorial/graphics/case3_p2.jpg b/doc/tutorial/graphics/case3_p2.jpg
new file mode 100644
index 0000000..ce33da1
Binary files /dev/null and b/doc/tutorial/graphics/case3_p2.jpg differ
diff --git a/doc/tutorial/graphics/case3_p3.jpg b/doc/tutorial/graphics/case3_p3.jpg
new file mode 100644
index 0000000..c789224
Binary files /dev/null and b/doc/tutorial/graphics/case3_p3.jpg differ
diff --git a/doc/tutorial/graphics/case3_p4.jpg b/doc/tutorial/graphics/case3_p4.jpg
new file mode 100644
index 0000000..4bf8fe2
Binary files /dev/null and b/doc/tutorial/graphics/case3_p4.jpg differ
diff --git a/doc/tutorial/graphics/case3_p5.jpg b/doc/tutorial/graphics/case3_p5.jpg
new file mode 100644
index 0000000..00f6068
Binary files /dev/null and b/doc/tutorial/graphics/case3_p5.jpg differ
diff --git a/doc/tutorial/graphics/case3_p6.jpg b/doc/tutorial/graphics/case3_p6.jpg
new file mode 100644
index 0000000..dece2b6
Binary files /dev/null and b/doc/tutorial/graphics/case3_p6.jpg differ
diff --git a/doc/tutorial/graphics/case3_p7.jpg b/doc/tutorial/graphics/case3_p7.jpg
new file mode 100644
index 0000000..bc37a9e
Binary files /dev/null and b/doc/tutorial/graphics/case3_p7.jpg differ
diff --git a/doc/tutorial/graphics/case3_p8.jpg b/doc/tutorial/graphics/case3_p8.jpg
new file mode 100644
index 0000000..848c4f7
Binary files /dev/null and b/doc/tutorial/graphics/case3_p8.jpg differ
diff --git a/doc/tutorial/graphics/case3_p9.jpg b/doc/tutorial/graphics/case3_p9.jpg
new file mode 100644
index 0000000..b3401cb
Binary files /dev/null and b/doc/tutorial/graphics/case3_p9.jpg differ
diff --git a/doc/tutorial/graphics/case4_p1.jpg b/doc/tutorial/graphics/case4_p1.jpg
new file mode 100644
index 0000000..a9b4379
Binary files /dev/null and b/doc/tutorial/graphics/case4_p1.jpg differ
diff --git a/doc/tutorial/graphics/case4_p2.jpg b/doc/tutorial/graphics/case4_p2.jpg
new file mode 100644
index 0000000..47f771f
Binary files /dev/null and b/doc/tutorial/graphics/case4_p2.jpg differ
diff --git a/doc/tutorial/graphics/case4_p3.jpg b/doc/tutorial/graphics/case4_p3.jpg
new file mode 100644
index 0000000..e792f11
Binary files /dev/null and b/doc/tutorial/graphics/case4_p3.jpg differ
diff --git a/doc/tutorial/graphics/case4_p4.jpg b/doc/tutorial/graphics/case4_p4.jpg
new file mode 100644
index 0000000..cca0328
Binary files /dev/null and b/doc/tutorial/graphics/case4_p4.jpg differ
diff --git a/doc/tutorial/graphics/case4_p5.jpg b/doc/tutorial/graphics/case4_p5.jpg
new file mode 100644
index 0000000..51b5eaf
Binary files /dev/null and b/doc/tutorial/graphics/case4_p5.jpg differ
diff --git a/doc/tutorial/graphics/case4_p6.jpg b/doc/tutorial/graphics/case4_p6.jpg
new file mode 100644
index 0000000..9df5c93
Binary files /dev/null and b/doc/tutorial/graphics/case4_p6.jpg differ
diff --git a/doc/tutorial/graphics/case5_01.jpg b/doc/tutorial/graphics/case5_01.jpg
new file mode 100644
index 0000000..38c9dfe
Binary files /dev/null and b/doc/tutorial/graphics/case5_01.jpg differ
diff --git a/doc/tutorial/graphics/case5_02.jpg b/doc/tutorial/graphics/case5_02.jpg
new file mode 100644
index 0000000..adaa194
Binary files /dev/null and b/doc/tutorial/graphics/case5_02.jpg differ
diff --git a/doc/tutorial/graphics/case5_03.jpg b/doc/tutorial/graphics/case5_03.jpg
new file mode 100644
index 0000000..32b79c0
Binary files /dev/null and b/doc/tutorial/graphics/case5_03.jpg differ
diff --git a/doc/tutorial/graphics/case5_04.jpg b/doc/tutorial/graphics/case5_04.jpg
new file mode 100644
index 0000000..64552da
Binary files /dev/null and b/doc/tutorial/graphics/case5_04.jpg differ
diff --git a/doc/tutorial/graphics/case5_05.jpg b/doc/tutorial/graphics/case5_05.jpg
new file mode 100644
index 0000000..4c1521a
Binary files /dev/null and b/doc/tutorial/graphics/case5_05.jpg differ
diff --git a/doc/tutorial/graphics/case5_06.jpg b/doc/tutorial/graphics/case5_06.jpg
new file mode 100644
index 0000000..09eba2d
Binary files /dev/null and b/doc/tutorial/graphics/case5_06.jpg differ
diff --git a/doc/tutorial/graphics/case5_07.jpg b/doc/tutorial/graphics/case5_07.jpg
new file mode 100644
index 0000000..1f9928e
Binary files /dev/null and b/doc/tutorial/graphics/case5_07.jpg differ
diff --git a/doc/tutorial/graphics/case5_08.jpg b/doc/tutorial/graphics/case5_08.jpg
new file mode 100644
index 0000000..7e20765
Binary files /dev/null and b/doc/tutorial/graphics/case5_08.jpg differ
diff --git a/doc/tutorial/graphics/case5_09.jpg b/doc/tutorial/graphics/case5_09.jpg
new file mode 100644
index 0000000..7fd8ac0
Binary files /dev/null and b/doc/tutorial/graphics/case5_09.jpg differ
diff --git a/doc/tutorial/graphics/color_Snimbus.jpg b/doc/tutorial/graphics/color_Snimbus.jpg
new file mode 100644
index 0000000..e12e6d4
Binary files /dev/null and b/doc/tutorial/graphics/color_Snimbus.jpg differ
diff --git a/doc/tutorial/graphics/evotemp_case3.agr b/doc/tutorial/graphics/evotemp_case3.agr
new file mode 100644
index 0000000..c6c4ea5
--- /dev/null
+++ b/doc/tutorial/graphics/evotemp_case3.agr
@@ -0,0 +1,7585 @@
+# Grace project file
+#
+ at version 50118
+ at page size 792, 612
+ at page scroll 5%
+ at page inout 5%
+ at link page off
+ at map font 8 to "Courier", "Courier"
+ at map font 10 to "Courier-Bold", "Courier-Bold"
+ at map font 11 to "Courier-BoldOblique", "Courier-BoldOblique"
+ at map font 9 to "Courier-Oblique", "Courier-Oblique"
+ at map font 4 to "Helvetica", "Helvetica"
+ at map font 6 to "Helvetica-Bold", "Helvetica-Bold"
+ at map font 7 to "Helvetica-BoldOblique", "Helvetica-BoldOblique"
+ at map font 15 to "Helvetica-Narrow", "Helvetica-Narrow"
+ at map font 16 to "Helvetica-Narrow-Bold", "Helvetica-Narrow-Bold"
+ at map font 17 to "Helvetica-Narrow-BoldOblique", "Helvetica-Narrow-BoldOblique"
+ at map font 18 to "Helvetica-Narrow-Oblique", "Helvetica-Narrow-Oblique"
+ at map font 5 to "Helvetica-Oblique", "Helvetica-Oblique"
+ at map font 20 to "NewCenturySchlbk-Bold", "NewCenturySchlbk-Bold"
+ at map font 21 to "NewCenturySchlbk-BoldItalic", "NewCenturySchlbk-BoldItalic"
+ at map font 22 to "NewCenturySchlbk-Italic", "NewCenturySchlbk-Italic"
+ at map font 23 to "NewCenturySchlbk-Roman", "NewCenturySchlbk-Roman"
+ at map font 24 to "Palatino-Bold", "Palatino-Bold"
+ at map font 25 to "Palatino-BoldItalic", "Palatino-BoldItalic"
+ at map font 26 to "Palatino-Italic", "Palatino-Italic"
+ at map font 27 to "Palatino-Roman", "Palatino-Roman"
+ at map font 12 to "Symbol", "Symbol"
+ at map font 2 to "Times-Bold", "Times-Bold"
+ at map font 3 to "Times-BoldItalic", "Times-BoldItalic"
+ at map font 1 to "Times-Italic", "Times-Italic"
+ at map font 0 to "Times-Roman", "Times-Roman"
+ at map font 33 to "ZapfChancery-MediumItalic", "ZapfChancery-MediumItalic"
+ at map font 13 to "ZapfDingbats", "ZapfDingbats"
+ at map font 35 to "LMCaps10-Italic", "LMCaps10-Italic"
+ at map font 36 to "LMCaps10-Regular", "LMCaps10-Regular"
+ at map font 37 to "LMRoman10-Bold", "LMRoman10-Bold"
+ at map font 38 to "LMRoman10-BoldItalic", "LMRoman10-BoldItalic"
+ at map font 39 to "LMRoman10-Italic", "LMRoman10-Italic"
+ at map font 40 to "LMRoman10-Regular", "LMRoman10-Regular"
+ at map font 41 to "LMRomanDemi10-Italic", "LMRomanDemi10-Italic"
+ at map font 42 to "LMRomanDemi10-Regular", "LMRomanDemi10-Regular"
+ at map font 43 to "LMSans10-Bold", "LMSans10-Bold"
+ at map font 44 to "LMSans10-BoldItalic", "LMSans10-BoldItalic"
+ at map font 45 to "LMSans10-Italic", "LMSans10-Italic"
+ at map font 46 to "LMSans10-Regular", "LMSans10-Regular"
+ at map font 47 to "LMSansDemiCond10-Italic", "LMSansDemiCond10-Italic"
+ at map font 48 to "LMSansDemiCond10-Regular", "LMSansDemiCond10-Regular"
+ at map font 49 to "LMSlanted10-BoldItalic", "LMSlanted10-BoldItalic"
+ at map font 50 to "LMSlanted10-Italic", "LMSlanted10-Italic"
+ at map font 51 to "LMTypewriter10", "LMTypewriter10"
+ at map font 52 to "LMTypewriter10-Italic", "LMTypewriter10-Italic"
+ at map font 53 to "LMTypewriterCaps10-Regular", "LMTypewriterCaps10-Regular"
+ at map font 54 to "LMTypewriterSlanted10-Italic", "LMTypewriterSlanted10-Italic"
+ at map font 55 to "LMTypewriterVarWd10", "LMTypewriterVarWd10"
+ at map font 56 to "LMTypewriterVarWd10-Italic", "LMTypewriterVarWd10-Italic"
+ at map font 57 to "TeX-tipa10", "TeX-tipa10"
+ at map font 58 to "TeX-tipa12", "TeX-tipa12"
+ at map font 59 to "TeX-tipa17", "TeX-tipa17"
+ at map font 60 to "TeX-tipa8", "TeX-tipa8"
+ at map font 61 to "TeX-tipa9", "TeX-tipa9"
+ at map font 62 to "TeX-tipab10", "TeX-tipab10"
+ at map font 63 to "TeX-tipabs10", "TeX-tipabs10"
+ at map font 64 to "TeX-tipabx10", "TeX-tipabx10"
+ at map font 65 to "TeX-tipabx12", "TeX-tipabx12"
+ at map font 66 to "TeX-tipabx8", "TeX-tipabx8"
+ at map font 67 to "TeX-tipabx9", "TeX-tipabx9"
+ at map font 68 to "TeX-tipasb10", "TeX-tipasb10"
+ at map font 69 to "TeX-tipasi10", "TeX-tipasi10"
+ at map font 70 to "TeX-tipasl10", "TeX-tipasl10"
+ at map font 71 to "TeX-tipasl12", "TeX-tipasl12"
+ at map font 72 to "TeX-tipasl8", "TeX-tipasl8"
+ at map font 73 to "TeX-tipasl9", "TeX-tipasl9"
+ at map font 74 to "TeX-tipass10", "TeX-tipass10"
+ at map font 75 to "TeX-tipass12", "TeX-tipass12"
+ at map font 76 to "TeX-tipass17", "TeX-tipass17"
+ at map font 77 to "TeX-tipass8", "TeX-tipass8"
+ at map font 78 to "TeX-tipass9", "TeX-tipass9"
+ at map font 79 to "TeX-tipats10", "TeX-tipats10"
+ at map font 80 to "TeX-tipatt10", "TeX-tipatt10"
+ at map font 81 to "TeX-tipatt12", "TeX-tipatt12"
+ at map font 82 to "TeX-tipatt8", "TeX-tipatt8"
+ at map font 83 to "TeX-tipatt9", "TeX-tipatt9"
+ at map font 84 to "TeX-tipx10", "TeX-tipx10"
+ at map font 85 to "TeX-tipx12", "TeX-tipx12"
+ at map font 86 to "TeX-tipx17", "TeX-tipx17"
+ at map font 87 to "TeX-tipx8", "TeX-tipx8"
+ at map font 88 to "TeX-tipx9", "TeX-tipx9"
+ at map font 89 to "TeX-tipxb10", "TeX-tipxb10"
+ at map font 90 to "TeX-tipxbs10", "TeX-tipxbs10"
+ at map font 91 to "TeX-tipxbx10", "TeX-tipxbx10"
+ at map font 92 to "TeX-tipxbx12", "TeX-tipxbx12"
+ at map font 93 to "TeX-tipxbx8", "TeX-tipxbx8"
+ at map font 94 to "TeX-tipxbx9", "TeX-tipxbx9"
+ at map font 95 to "TeX-tipxsb10", "TeX-tipxsb10"
+ at map font 96 to "TeX-tipxsi10", "TeX-tipxsi10"
+ at map font 97 to "TeX-tipxsl10", "TeX-tipxsl10"
+ at map font 98 to "TeX-tipxsl12", "TeX-tipxsl12"
+ at map font 99 to "TeX-tipxsl8", "TeX-tipxsl8"
+ at map font 100 to "TeX-tipxsl9", "TeX-tipxsl9"
+ at map font 101 to "TeX-tipxss10", "TeX-tipxss10"
+ at map font 102 to "TeX-tipxss12", "TeX-tipxss12"
+ at map font 103 to "TeX-tipxss17", "TeX-tipxss17"
+ at map font 104 to "TeX-tipxss8", "TeX-tipxss8"
+ at map font 105 to "TeX-tipxss9", "TeX-tipxss9"
+ at map font 106 to "TeX-tipxts10", "TeX-tipxts10"
+ at map font 107 to "TeX-tipxtt10", "TeX-tipxtt10"
+ at map font 108 to "TeX-tipxtt12", "TeX-tipxtt12"
+ at map font 109 to "TeX-tipxtt8", "TeX-tipxtt8"
+ at map font 110 to "TeX-tipxtt9", "TeX-tipxtt9"
+ at map font 111 to "TeX-xipa10", "TeX-xipa10"
+ at map font 112 to "TeX-xipab10", "TeX-xipab10"
+ at map font 113 to "TeX-xipabs10", "TeX-xipabs10"
+ at map font 114 to "TeX-xipasb10", "TeX-xipasb10"
+ at map font 115 to "TeX-xipasi10", "TeX-xipasi10"
+ at map font 116 to "TeX-xipasl10", "TeX-xipasl10"
+ at map font 117 to "TeX-xipass10", "TeX-xipass10"
+ at map font 118 to "TeX-xipx10", "TeX-xipx10"
+ at map font 119 to "TeX-xipxb10", "TeX-xipxb10"
+ at map font 120 to "TeX-xipxbs10", "TeX-xipxbs10"
+ at map font 121 to "TeX-xipxsb10", "TeX-xipxsb10"
+ at map font 122 to "TeX-xipxsi10", "TeX-xipxsi10"
+ at map font 123 to "TeX-xipxsl10", "TeX-xipxsl10"
+ at map font 124 to "TeX-xipxss10", "TeX-xipxss10"
+ at map color 0 to (255, 255, 255), "white"
+ at map color 1 to (0, 0, 0), "black"
+ at map color 2 to (255, 0, 0), "red"
+ at map color 3 to (0, 255, 0), "green"
+ at map color 4 to (0, 0, 255), "blue"
+ at map color 5 to (255, 255, 0), "yellow"
+ at map color 6 to (188, 143, 143), "brown"
+ at map color 7 to (220, 220, 220), "grey"
+ at map color 8 to (148, 0, 211), "violet"
+ at map color 9 to (0, 255, 255), "cyan"
+ at map color 10 to (255, 0, 255), "magenta"
+ at map color 11 to (255, 165, 0), "orange"
+ at map color 12 to (114, 33, 188), "indigo"
+ at map color 13 to (103, 7, 72), "maroon"
+ at map color 14 to (64, 224, 208), "turquoise"
+ at map color 15 to (0, 139, 0), "green4"
+ at reference date 0
+ at date wrap off
+ at date wrap year 1950
+ at default linewidth 1.0
+ at default linestyle 1
+ at default color 1
+ at default pattern 1
+ at default font 0
+ at default char size 1.000000
+ at default symbol size 1.000000
+ at default sformat "%.8g"
+ at background color 0
+ at page background fill on
+ at timestamp off
+ at timestamp 0.03, 0.03
+ at timestamp color 1
+ at timestamp rot 0
+ at timestamp font 0
+ at timestamp char size 1.000000
+ at timestamp def "Thu Sep 6 10:45:38 2007"
+ at r0 off
+ at link r0 to g0
+ at r0 type above
+ at r0 linestyle 1
+ at r0 linewidth 1.0
+ at r0 color 1
+ at r0 line 0, 0, 0, 0
+ at r1 off
+ at link r1 to g0
+ at r1 type above
+ at r1 linestyle 1
+ at r1 linewidth 1.0
+ at r1 color 1
+ at r1 line 0, 0, 0, 0
+ at r2 off
+ at link r2 to g0
+ at r2 type above
+ at r2 linestyle 1
+ at r2 linewidth 1.0
+ at r2 color 1
+ at r2 line 0, 0, 0, 0
+ at r3 off
+ at link r3 to g0
+ at r3 type above
+ at r3 linestyle 1
+ at r3 linewidth 1.0
+ at r3 color 1
+ at r3 line 0, 0, 0, 0
+ at r4 off
+ at link r4 to g0
+ at r4 type above
+ at r4 linestyle 1
+ at r4 linewidth 1.0
+ at r4 color 1
+ at r4 line 0, 0, 0, 0
+ at g0 on
+ at g0 hidden false
+ at g0 type XY
+ at g0 stacked false
+ at g0 bar hgap 0.000000
+ at g0 fixedpoint off
+ at g0 fixedpoint type 0
+ at g0 fixedpoint xy 0.000000, 0.000000
+ at g0 fixedpoint format general general
+ at g0 fixedpoint prec 6, 6
+ at with g0
+@ world 0, 0, 35, 420
+@ stack world 0, 0, 0, 0
+@ znorm 1
+@ view 0.150000, 0.150000, 1.150000, 0.850000
+@ title ""
+@ title font 0
+@ title size 1.500000
+@ title color 1
+@ subtitle ""
+@ subtitle font 0
+@ subtitle size 1.000000
+@ subtitle color 1
+@ xaxes scale Normal
+@ yaxes scale Normal
+@ xaxes invert off
+@ yaxes invert off
+@ xaxis on
+@ xaxis type zero false
+@ xaxis offset 0.000000 , 0.000000
+@ xaxis bar on
+@ xaxis bar color 1
+@ xaxis bar linestyle 1
+@ xaxis bar linewidth 1.0
+@ xaxis label "Time (s)"
+@ xaxis label layout para
+@ xaxis label place auto
+@ xaxis label char size 1.000000
+@ xaxis label font 0
+@ xaxis label color 1
+@ xaxis label place normal
+@ xaxis tick on
+@ xaxis tick major 10
+@ xaxis tick minor ticks 1
+@ xaxis tick default 6
+@ xaxis tick place rounded true
+@ xaxis tick in
+@ xaxis tick major size 1.000000
+@ xaxis tick major color 1
+@ xaxis tick major linewidth 1.0
+@ xaxis tick major linestyle 1
+@ xaxis tick major grid off
+@ xaxis tick minor color 1
+@ xaxis tick minor linewidth 1.0
+@ xaxis tick minor linestyle 1
+@ xaxis tick minor grid off
+@ xaxis tick minor size 0.500000
+@ xaxis ticklabel on
+@ xaxis ticklabel format general
+@ xaxis ticklabel prec 5
+@ xaxis ticklabel formula ""
+@ xaxis ticklabel append ""
+@ xaxis ticklabel prepend ""
+@ xaxis ticklabel angle 0
+@ xaxis ticklabel skip 0
+@ xaxis ticklabel stagger 0
+@ xaxis ticklabel place normal
+@ xaxis ticklabel offset auto
+@ xaxis ticklabel offset 0.000000 , 0.010000
+@ xaxis ticklabel start type auto
+@ xaxis ticklabel start 0.000000
+@ xaxis ticklabel stop type auto
+@ xaxis ticklabel stop 0.000000
+@ xaxis ticklabel char size 1.000000
+@ xaxis ticklabel font 0
+@ xaxis ticklabel color 1
+@ xaxis tick place both
+@ xaxis tick spec type none
+@ yaxis on
+@ yaxis type zero false
+@ yaxis offset 0.000000 , 0.000000
+@ yaxis bar on
+@ yaxis bar color 1
+@ yaxis bar linestyle 1
+@ yaxis bar linewidth 1.0
+@ yaxis label "Temperature (�C)"
+@ yaxis label layout para
+@ yaxis label place auto
+@ yaxis label char size 1.000000
+@ yaxis label font 0
+@ yaxis label color 1
+@ yaxis label place normal
+@ yaxis tick on
+@ yaxis tick major 100
+@ yaxis tick minor ticks 1
+@ yaxis tick default 6
+@ yaxis tick place rounded true
+@ yaxis tick in
+@ yaxis tick major size 1.000000
+@ yaxis tick major color 1
+@ yaxis tick major linewidth 1.0
+@ yaxis tick major linestyle 1
+@ yaxis tick major grid off
+@ yaxis tick minor color 1
+@ yaxis tick minor linewidth 1.0
+@ yaxis tick minor linestyle 1
+@ yaxis tick minor grid off
+@ yaxis tick minor size 0.500000
+@ yaxis ticklabel on
+@ yaxis ticklabel format general
+@ yaxis ticklabel prec 5
+@ yaxis ticklabel formula ""
+@ yaxis ticklabel append ""
+@ yaxis ticklabel prepend ""
+@ yaxis ticklabel angle 0
+@ yaxis ticklabel skip 0
+@ yaxis ticklabel stagger 0
+@ yaxis ticklabel place normal
+@ yaxis ticklabel offset auto
+@ yaxis ticklabel offset 0.000000 , 0.010000
+@ yaxis ticklabel start type auto
+@ yaxis ticklabel start 0.000000
+@ yaxis ticklabel stop type auto
+@ yaxis ticklabel stop 0.000000
+@ yaxis ticklabel char size 1.000000
+@ yaxis ticklabel font 0
+@ yaxis ticklabel color 1
+@ yaxis tick place both
+@ yaxis tick spec type none
+@ altxaxis off
+@ altyaxis off
+@ legend on
+@ legend loctype view
+@ legend 0.75, 0.6
+@ legend box color 1
+@ legend box pattern 1
+@ legend box linewidth 1.0
+@ legend box linestyle 1
+@ legend box fill color 0
+@ legend box fill pattern 1
+@ legend font 0
+@ legend char size 1.000000
+@ legend color 1
+@ legend length 4
+@ legend vgap 1
+@ legend hgap 1
+@ legend invert false
+@ frame type 0
+@ frame linestyle 1
+@ frame linewidth 1.0
+@ frame color 1
+@ frame pattern 1
+@ frame background color 0
+@ frame background pattern 0
+@ s0 hidden false
+@ s0 type xy
+@ s0 symbol 0
+@ s0 symbol size 1.000000
+@ s0 symbol color 1
+@ s0 symbol pattern 1
+@ s0 symbol fill color 1
+@ s0 symbol fill pattern 0
+@ s0 symbol linewidth 1.0
+@ s0 symbol linestyle 1
+@ s0 symbol char 65
+@ s0 symbol char font 0
+@ s0 symbol skip 0
+@ s0 line type 1
+@ s0 line linestyle 1
+@ s0 line linewidth 1.5
+@ s0 line color 1
+@ s0 line pattern 1
+@ s0 baseline type 0
+@ s0 baseline off
+@ s0 dropline off
+@ s0 fill type 0
+@ s0 fill rule 0
+@ s0 fill color 1
+@ s0 fill pattern 1
+@ s0 avalue off
+@ s0 avalue type 2
+@ s0 avalue char size 1.000000
+@ s0 avalue font 0
+@ s0 avalue color 1
+@ s0 avalue rot 0
+@ s0 avalue format general
+@ s0 avalue prec 3
+@ s0 avalue prepend ""
+@ s0 avalue append ""
+@ s0 avalue offset 0.000000 , 0.000000
+@ s0 errorbar on
+@ s0 errorbar place both
+@ s0 errorbar color 1
+@ s0 errorbar pattern 1
+@ s0 errorbar size 1.000000
+@ s0 errorbar linewidth 1.0
+@ s0 errorbar linestyle 1
+@ s0 errorbar riser linewidth 1.0
+@ s0 errorbar riser linestyle 1
+@ s0 errorbar riser clip off
+@ s0 errorbar riser clip length 0.100000
+@ s0 comment "Cols 2:3"
+@ s0 legend "Probe 1"
+@ s1 hidden false
+@ s1 type xy
+@ s1 symbol 0
+@ s1 symbol size 1.000000
+@ s1 symbol color 2
+@ s1 symbol pattern 1
+@ s1 symbol fill color 2
+@ s1 symbol fill pattern 0
+@ s1 symbol linewidth 1.0
+@ s1 symbol linestyle 1
+@ s1 symbol char 65
+@ s1 symbol char font 0
+@ s1 symbol skip 0
+@ s1 line type 1
+@ s1 line linestyle 1
+@ s1 line linewidth 1.5
+@ s1 line color 2
+@ s1 line pattern 1
+@ s1 baseline type 0
+@ s1 baseline off
+@ s1 dropline off
+@ s1 fill type 0
+@ s1 fill rule 0
+@ s1 fill color 1
+@ s1 fill pattern 1
+@ s1 avalue off
+@ s1 avalue type 2
+@ s1 avalue char size 1.000000
+@ s1 avalue font 0
+@ s1 avalue color 1
+@ s1 avalue rot 0
+@ s1 avalue format general
+@ s1 avalue prec 3
+@ s1 avalue prepend ""
+@ s1 avalue append ""
+@ s1 avalue offset 0.000000 , 0.000000
+@ s1 errorbar on
+@ s1 errorbar place both
+@ s1 errorbar color 2
+@ s1 errorbar pattern 1
+@ s1 errorbar size 1.000000
+@ s1 errorbar linewidth 1.0
+@ s1 errorbar linestyle 1
+@ s1 errorbar riser linewidth 1.0
+@ s1 errorbar riser linestyle 1
+@ s1 errorbar riser clip off
+@ s1 errorbar riser clip length 0.100000
+@ s1 comment "Cols 2:4"
+@ s1 legend "Probe 2"
+@ s2 hidden false
+@ s2 type xy
+@ s2 symbol 0
+@ s2 symbol size 1.000000
+@ s2 symbol color 3
+@ s2 symbol pattern 1
+@ s2 symbol fill color 3
+@ s2 symbol fill pattern 0
+@ s2 symbol linewidth 1.0
+@ s2 symbol linestyle 1
+@ s2 symbol char 65
+@ s2 symbol char font 0
+@ s2 symbol skip 0
+@ s2 line type 1
+@ s2 line linestyle 1
+@ s2 line linewidth 1.5
+@ s2 line color 3
+@ s2 line pattern 1
+@ s2 baseline type 0
+@ s2 baseline off
+@ s2 dropline off
+@ s2 fill type 0
+@ s2 fill rule 0
+@ s2 fill color 1
+@ s2 fill pattern 1
+@ s2 avalue off
+@ s2 avalue type 2
+@ s2 avalue char size 1.000000
+@ s2 avalue font 0
+@ s2 avalue color 1
+@ s2 avalue rot 0
+@ s2 avalue format general
+@ s2 avalue prec 3
+@ s2 avalue prepend ""
+@ s2 avalue append ""
+@ s2 avalue offset 0.000000 , 0.000000
+@ s2 errorbar on
+@ s2 errorbar place both
+@ s2 errorbar color 3
+@ s2 errorbar pattern 1
+@ s2 errorbar size 1.000000
+@ s2 errorbar linewidth 1.0
+@ s2 errorbar linestyle 1
+@ s2 errorbar riser linewidth 1.0
+@ s2 errorbar riser linestyle 1
+@ s2 errorbar riser clip off
+@ s2 errorbar riser clip length 0.100000
+@ s2 comment "Cols 2:5"
+@ s2 legend "Probe 3"
+@ s3 hidden false
+@ s3 type xy
+@ s3 symbol 0
+@ s3 symbol size 1.000000
+@ s3 symbol color 4
+@ s3 symbol pattern 1
+@ s3 symbol fill color 4
+@ s3 symbol fill pattern 0
+@ s3 symbol linewidth 1.0
+@ s3 symbol linestyle 1
+@ s3 symbol char 65
+@ s3 symbol char font 0
+@ s3 symbol skip 0
+@ s3 line type 1
+@ s3 line linestyle 1
+@ s3 line linewidth 1.5
+@ s3 line color 4
+@ s3 line pattern 1
+@ s3 baseline type 0
+@ s3 baseline off
+@ s3 dropline off
+@ s3 fill type 0
+@ s3 fill rule 0
+@ s3 fill color 1
+@ s3 fill pattern 1
+@ s3 avalue off
+@ s3 avalue type 2
+@ s3 avalue char size 1.000000
+@ s3 avalue font 0
+@ s3 avalue color 1
+@ s3 avalue rot 0
+@ s3 avalue format general
+@ s3 avalue prec 3
+@ s3 avalue prepend ""
+@ s3 avalue append ""
+@ s3 avalue offset 0.000000 , 0.000000
+@ s3 errorbar on
+@ s3 errorbar place both
+@ s3 errorbar color 4
+@ s3 errorbar pattern 1
+@ s3 errorbar size 1.000000
+@ s3 errorbar linewidth 1.0
+@ s3 errorbar linestyle 1
+@ s3 errorbar riser linewidth 1.0
+@ s3 errorbar riser linestyle 1
+@ s3 errorbar riser clip off
+@ s3 errorbar riser clip length 0.100000
+@ s3 comment "Cols 2:6"
+@ s3 legend "Probe 4"
+@ s4 hidden false
+@ s4 type xy
+@ s4 symbol 0
+@ s4 symbol size 1.000000
+@ s4 symbol color 5
+@ s4 symbol pattern 1
+@ s4 symbol fill color 5
+@ s4 symbol fill pattern 0
+@ s4 symbol linewidth 1.0
+@ s4 symbol linestyle 1
+@ s4 symbol char 65
+@ s4 symbol char font 0
+@ s4 symbol skip 0
+@ s4 line type 1
+@ s4 line linestyle 1
+@ s4 line linewidth 1.5
+@ s4 line color 5
+@ s4 line pattern 1
+@ s4 baseline type 0
+@ s4 baseline off
+@ s4 dropline off
+@ s4 fill type 0
+@ s4 fill rule 0
+@ s4 fill color 1
+@ s4 fill pattern 1
+@ s4 avalue off
+@ s4 avalue type 2
+@ s4 avalue char size 1.000000
+@ s4 avalue font 0
+@ s4 avalue color 1
+@ s4 avalue rot 0
+@ s4 avalue format general
+@ s4 avalue prec 3
+@ s4 avalue prepend ""
+@ s4 avalue append ""
+@ s4 avalue offset 0.000000 , 0.000000
+@ s4 errorbar on
+@ s4 errorbar place both
+@ s4 errorbar color 5
+@ s4 errorbar pattern 1
+@ s4 errorbar size 1.000000
+@ s4 errorbar linewidth 1.0
+@ s4 errorbar linestyle 1
+@ s4 errorbar riser linewidth 1.0
+@ s4 errorbar riser linestyle 1
+@ s4 errorbar riser clip off
+@ s4 errorbar riser clip length 0.100000
+@ s4 comment "Cols 2:7"
+@ s4 legend "Probe 5"
+@ s5 hidden false
+@ s5 type xy
+@ s5 symbol 0
+@ s5 symbol size 1.000000
+@ s5 symbol color 6
+@ s5 symbol pattern 1
+@ s5 symbol fill color 6
+@ s5 symbol fill pattern 0
+@ s5 symbol linewidth 1.0
+@ s5 symbol linestyle 1
+@ s5 symbol char 65
+@ s5 symbol char font 0
+@ s5 symbol skip 0
+@ s5 line type 1
+@ s5 line linestyle 1
+@ s5 line linewidth 1.5
+@ s5 line color 6
+@ s5 line pattern 1
+@ s5 baseline type 0
+@ s5 baseline off
+@ s5 dropline off
+@ s5 fill type 0
+@ s5 fill rule 0
+@ s5 fill color 1
+@ s5 fill pattern 1
+@ s5 avalue off
+@ s5 avalue type 2
+@ s5 avalue char size 1.000000
+@ s5 avalue font 0
+@ s5 avalue color 1
+@ s5 avalue rot 0
+@ s5 avalue format general
+@ s5 avalue prec 3
+@ s5 avalue prepend ""
+@ s5 avalue append ""
+@ s5 avalue offset 0.000000 , 0.000000
+@ s5 errorbar on
+@ s5 errorbar place both
+@ s5 errorbar color 6
+@ s5 errorbar pattern 1
+@ s5 errorbar size 1.000000
+@ s5 errorbar linewidth 1.0
+@ s5 errorbar linestyle 1
+@ s5 errorbar riser linewidth 1.0
+@ s5 errorbar riser linestyle 1
+@ s5 errorbar riser clip off
+@ s5 errorbar riser clip length 0.100000
+@ s5 comment "Cols 2:8"
+@ s5 legend "Probe 6"
+@ s6 hidden false
+@ s6 type xy
+@ s6 symbol 0
+@ s6 symbol size 1.000000
+@ s6 symbol color 7
+@ s6 symbol pattern 1
+@ s6 symbol fill color 7
+@ s6 symbol fill pattern 0
+@ s6 symbol linewidth 1.0
+@ s6 symbol linestyle 1
+@ s6 symbol char 65
+@ s6 symbol char font 0
+@ s6 symbol skip 0
+@ s6 line type 1
+@ s6 line linestyle 1
+@ s6 line linewidth 1.5
+@ s6 line color 7
+@ s6 line pattern 1
+@ s6 baseline type 0
+@ s6 baseline off
+@ s6 dropline off
+@ s6 fill type 0
+@ s6 fill rule 0
+@ s6 fill color 1
+@ s6 fill pattern 1
+@ s6 avalue off
+@ s6 avalue type 2
+@ s6 avalue char size 1.000000
+@ s6 avalue font 0
+@ s6 avalue color 1
+@ s6 avalue rot 0
+@ s6 avalue format general
+@ s6 avalue prec 3
+@ s6 avalue prepend ""
+@ s6 avalue append ""
+@ s6 avalue offset 0.000000 , 0.000000
+@ s6 errorbar on
+@ s6 errorbar place both
+@ s6 errorbar color 7
+@ s6 errorbar pattern 1
+@ s6 errorbar size 1.000000
+@ s6 errorbar linewidth 1.0
+@ s6 errorbar linestyle 1
+@ s6 errorbar riser linewidth 1.0
+@ s6 errorbar riser linestyle 1
+@ s6 errorbar riser clip off
+@ s6 errorbar riser clip length 0.100000
+@ s6 comment "Cols 2:9"
+@ s6 legend "Probe 7"
+@ s7 hidden false
+@ s7 type xy
+@ s7 symbol 0
+@ s7 symbol size 1.000000
+@ s7 symbol color 8
+@ s7 symbol pattern 1
+@ s7 symbol fill color 8
+@ s7 symbol fill pattern 0
+@ s7 symbol linewidth 1.0
+@ s7 symbol linestyle 1
+@ s7 symbol char 65
+@ s7 symbol char font 0
+@ s7 symbol skip 0
+@ s7 line type 1
+@ s7 line linestyle 1
+@ s7 line linewidth 1.5
+@ s7 line color 8
+@ s7 line pattern 1
+@ s7 baseline type 0
+@ s7 baseline off
+@ s7 dropline off
+@ s7 fill type 0
+@ s7 fill rule 0
+@ s7 fill color 1
+@ s7 fill pattern 1
+@ s7 avalue off
+@ s7 avalue type 2
+@ s7 avalue char size 1.000000
+@ s7 avalue font 0
+@ s7 avalue color 1
+@ s7 avalue rot 0
+@ s7 avalue format general
+@ s7 avalue prec 3
+@ s7 avalue prepend ""
+@ s7 avalue append ""
+@ s7 avalue offset 0.000000 , 0.000000
+@ s7 errorbar on
+@ s7 errorbar place both
+@ s7 errorbar color 8
+@ s7 errorbar pattern 1
+@ s7 errorbar size 1.000000
+@ s7 errorbar linewidth 1.0
+@ s7 errorbar linestyle 1
+@ s7 errorbar riser linewidth 1.0
+@ s7 errorbar riser linestyle 1
+@ s7 errorbar riser clip off
+@ s7 errorbar riser clip length 0.100000
+@ s7 comment "Cols 2:10"
+@ s7 legend "Probe 8"
+@ s8 hidden false
+@ s8 type xy
+@ s8 symbol 0
+@ s8 symbol size 1.000000
+@ s8 symbol color 9
+@ s8 symbol pattern 1
+@ s8 symbol fill color 9
+@ s8 symbol fill pattern 0
+@ s8 symbol linewidth 1.0
+@ s8 symbol linestyle 1
+@ s8 symbol char 65
+@ s8 symbol char font 0
+@ s8 symbol skip 0
+@ s8 line type 1
+@ s8 line linestyle 1
+@ s8 line linewidth 1.5
+@ s8 line color 9
+@ s8 line pattern 1
+@ s8 baseline type 0
+@ s8 baseline off
+@ s8 dropline off
+@ s8 fill type 0
+@ s8 fill rule 0
+@ s8 fill color 1
+@ s8 fill pattern 1
+@ s8 avalue off
+@ s8 avalue type 2
+@ s8 avalue char size 1.000000
+@ s8 avalue font 0
+@ s8 avalue color 1
+@ s8 avalue rot 0
+@ s8 avalue format general
+@ s8 avalue prec 3
+@ s8 avalue prepend ""
+@ s8 avalue append ""
+@ s8 avalue offset 0.000000 , 0.000000
+@ s8 errorbar on
+@ s8 errorbar place both
+@ s8 errorbar color 9
+@ s8 errorbar pattern 1
+@ s8 errorbar size 1.000000
+@ s8 errorbar linewidth 1.0
+@ s8 errorbar linestyle 1
+@ s8 errorbar riser linewidth 1.0
+@ s8 errorbar riser linestyle 1
+@ s8 errorbar riser clip off
+@ s8 errorbar riser clip length 0.100000
+@ s8 comment "Cols 2:11"
+@ s8 legend "Probe 9"
+@ s9 hidden false
+@ s9 type xy
+@ s9 symbol 0
+@ s9 symbol size 1.000000
+@ s9 symbol color 1
+@ s9 symbol pattern 1
+@ s9 symbol fill color 1
+@ s9 symbol fill pattern 0
+@ s9 symbol linewidth 1.0
+@ s9 symbol linestyle 1
+@ s9 symbol char 65
+@ s9 symbol char font 0
+@ s9 symbol skip 0
+@ s9 line type 1
+@ s9 line linestyle 1
+@ s9 line linewidth 1.5
+@ s9 line color 1
+@ s9 line pattern 1
+@ s9 baseline type 0
+@ s9 baseline off
+@ s9 dropline off
+@ s9 fill type 0
+@ s9 fill rule 0
+@ s9 fill color 1
+@ s9 fill pattern 1
+@ s9 avalue off
+@ s9 avalue type 2
+@ s9 avalue char size 1.000000
+@ s9 avalue font 0
+@ s9 avalue color 1
+@ s9 avalue rot 0
+@ s9 avalue format general
+@ s9 avalue prec 3
+@ s9 avalue prepend ""
+@ s9 avalue append ""
+@ s9 avalue offset 0.000000 , 0.000000
+@ s9 errorbar on
+@ s9 errorbar place both
+@ s9 errorbar color 1
+@ s9 errorbar pattern 1
+@ s9 errorbar size 1.000000
+@ s9 errorbar linewidth 1.0
+@ s9 errorbar linestyle 1
+@ s9 errorbar riser linewidth 1.0
+@ s9 errorbar riser linestyle 1
+@ s9 errorbar riser clip off
+@ s9 errorbar riser clip length 0.100000
+@ s9 comment "Cols 2:3"
+@ s9 legend ""
+@ s10 hidden false
+@ s10 type xy
+@ s10 symbol 0
+@ s10 symbol size 1.000000
+@ s10 symbol color 2
+@ s10 symbol pattern 1
+@ s10 symbol fill color 2
+@ s10 symbol fill pattern 0
+@ s10 symbol linewidth 1.0
+@ s10 symbol linestyle 1
+@ s10 symbol char 65
+@ s10 symbol char font 0
+@ s10 symbol skip 0
+@ s10 line type 1
+@ s10 line linestyle 1
+@ s10 line linewidth 1.5
+@ s10 line color 2
+@ s10 line pattern 1
+@ s10 baseline type 0
+@ s10 baseline off
+@ s10 dropline off
+@ s10 fill type 0
+@ s10 fill rule 0
+@ s10 fill color 1
+@ s10 fill pattern 1
+@ s10 avalue off
+@ s10 avalue type 2
+@ s10 avalue char size 1.000000
+@ s10 avalue font 0
+@ s10 avalue color 1
+@ s10 avalue rot 0
+@ s10 avalue format general
+@ s10 avalue prec 3
+@ s10 avalue prepend ""
+@ s10 avalue append ""
+@ s10 avalue offset 0.000000 , 0.000000
+@ s10 errorbar on
+@ s10 errorbar place both
+@ s10 errorbar color 2
+@ s10 errorbar pattern 1
+@ s10 errorbar size 1.000000
+@ s10 errorbar linewidth 1.0
+@ s10 errorbar linestyle 1
+@ s10 errorbar riser linewidth 1.0
+@ s10 errorbar riser linestyle 1
+@ s10 errorbar riser clip off
+@ s10 errorbar riser clip length 0.100000
+@ s10 comment "Cols 2:4"
+@ s10 legend ""
+@ s11 hidden false
+@ s11 type xy
+@ s11 symbol 0
+@ s11 symbol size 1.000000
+@ s11 symbol color 3
+@ s11 symbol pattern 1
+@ s11 symbol fill color 3
+@ s11 symbol fill pattern 0
+@ s11 symbol linewidth 1.0
+@ s11 symbol linestyle 1
+@ s11 symbol char 65
+@ s11 symbol char font 0
+@ s11 symbol skip 0
+@ s11 line type 1
+@ s11 line linestyle 1
+@ s11 line linewidth 1.5
+@ s11 line color 3
+@ s11 line pattern 1
+@ s11 baseline type 0
+@ s11 baseline off
+@ s11 dropline off
+@ s11 fill type 0
+@ s11 fill rule 0
+@ s11 fill color 1
+@ s11 fill pattern 1
+@ s11 avalue off
+@ s11 avalue type 2
+@ s11 avalue char size 1.000000
+@ s11 avalue font 0
+@ s11 avalue color 1
+@ s11 avalue rot 0
+@ s11 avalue format general
+@ s11 avalue prec 3
+@ s11 avalue prepend ""
+@ s11 avalue append ""
+@ s11 avalue offset 0.000000 , 0.000000
+@ s11 errorbar on
+@ s11 errorbar place both
+@ s11 errorbar color 3
+@ s11 errorbar pattern 1
+@ s11 errorbar size 1.000000
+@ s11 errorbar linewidth 1.0
+@ s11 errorbar linestyle 1
+@ s11 errorbar riser linewidth 1.0
+@ s11 errorbar riser linestyle 1
+@ s11 errorbar riser clip off
+@ s11 errorbar riser clip length 0.100000
+@ s11 comment "Cols 2:5"
+@ s11 legend ""
+@ s12 hidden false
+@ s12 type xy
+@ s12 symbol 0
+@ s12 symbol size 1.000000
+@ s12 symbol color 4
+@ s12 symbol pattern 1
+@ s12 symbol fill color 4
+@ s12 symbol fill pattern 0
+@ s12 symbol linewidth 1.0
+@ s12 symbol linestyle 1
+@ s12 symbol char 65
+@ s12 symbol char font 0
+@ s12 symbol skip 0
+@ s12 line type 1
+@ s12 line linestyle 1
+@ s12 line linewidth 1.5
+@ s12 line color 4
+@ s12 line pattern 1
+@ s12 baseline type 0
+@ s12 baseline off
+@ s12 dropline off
+@ s12 fill type 0
+@ s12 fill rule 0
+@ s12 fill color 1
+@ s12 fill pattern 1
+@ s12 avalue off
+@ s12 avalue type 2
+@ s12 avalue char size 1.000000
+@ s12 avalue font 0
+@ s12 avalue color 1
+@ s12 avalue rot 0
+@ s12 avalue format general
+@ s12 avalue prec 3
+@ s12 avalue prepend ""
+@ s12 avalue append ""
+@ s12 avalue offset 0.000000 , 0.000000
+@ s12 errorbar on
+@ s12 errorbar place both
+@ s12 errorbar color 4
+@ s12 errorbar pattern 1
+@ s12 errorbar size 1.000000
+@ s12 errorbar linewidth 1.0
+@ s12 errorbar linestyle 1
+@ s12 errorbar riser linewidth 1.0
+@ s12 errorbar riser linestyle 1
+@ s12 errorbar riser clip off
+@ s12 errorbar riser clip length 0.100000
+@ s12 comment "Cols 2:6"
+@ s12 legend ""
+@ s13 hidden false
+@ s13 type xy
+@ s13 symbol 0
+@ s13 symbol size 1.000000
+@ s13 symbol color 5
+@ s13 symbol pattern 1
+@ s13 symbol fill color 5
+@ s13 symbol fill pattern 0
+@ s13 symbol linewidth 1.0
+@ s13 symbol linestyle 1
+@ s13 symbol char 65
+@ s13 symbol char font 0
+@ s13 symbol skip 0
+@ s13 line type 1
+@ s13 line linestyle 1
+@ s13 line linewidth 1.5
+@ s13 line color 5
+@ s13 line pattern 1
+@ s13 baseline type 0
+@ s13 baseline off
+@ s13 dropline off
+@ s13 fill type 0
+@ s13 fill rule 0
+@ s13 fill color 1
+@ s13 fill pattern 1
+@ s13 avalue off
+@ s13 avalue type 2
+@ s13 avalue char size 1.000000
+@ s13 avalue font 0
+@ s13 avalue color 1
+@ s13 avalue rot 0
+@ s13 avalue format general
+@ s13 avalue prec 3
+@ s13 avalue prepend ""
+@ s13 avalue append ""
+@ s13 avalue offset 0.000000 , 0.000000
+@ s13 errorbar on
+@ s13 errorbar place both
+@ s13 errorbar color 5
+@ s13 errorbar pattern 1
+@ s13 errorbar size 1.000000
+@ s13 errorbar linewidth 1.0
+@ s13 errorbar linestyle 1
+@ s13 errorbar riser linewidth 1.0
+@ s13 errorbar riser linestyle 1
+@ s13 errorbar riser clip off
+@ s13 errorbar riser clip length 0.100000
+@ s13 comment "Cols 2:7"
+@ s13 legend ""
+@ s14 hidden false
+@ s14 type xy
+@ s14 symbol 0
+@ s14 symbol size 1.000000
+@ s14 symbol color 6
+@ s14 symbol pattern 1
+@ s14 symbol fill color 6
+@ s14 symbol fill pattern 0
+@ s14 symbol linewidth 1.0
+@ s14 symbol linestyle 1
+@ s14 symbol char 65
+@ s14 symbol char font 0
+@ s14 symbol skip 0
+@ s14 line type 1
+@ s14 line linestyle 1
+@ s14 line linewidth 1.5
+@ s14 line color 6
+@ s14 line pattern 1
+@ s14 baseline type 0
+@ s14 baseline off
+@ s14 dropline off
+@ s14 fill type 0
+@ s14 fill rule 0
+@ s14 fill color 1
+@ s14 fill pattern 1
+@ s14 avalue off
+@ s14 avalue type 2
+@ s14 avalue char size 1.000000
+@ s14 avalue font 0
+@ s14 avalue color 1
+@ s14 avalue rot 0
+@ s14 avalue format general
+@ s14 avalue prec 3
+@ s14 avalue prepend ""
+@ s14 avalue append ""
+@ s14 avalue offset 0.000000 , 0.000000
+@ s14 errorbar on
+@ s14 errorbar place both
+@ s14 errorbar color 6
+@ s14 errorbar pattern 1
+@ s14 errorbar size 1.000000
+@ s14 errorbar linewidth 1.0
+@ s14 errorbar linestyle 1
+@ s14 errorbar riser linewidth 1.0
+@ s14 errorbar riser linestyle 1
+@ s14 errorbar riser clip off
+@ s14 errorbar riser clip length 0.100000
+@ s14 comment "Cols 2:8"
+@ s14 legend ""
+@ s15 hidden false
+@ s15 type xy
+@ s15 symbol 0
+@ s15 symbol size 1.000000
+@ s15 symbol color 8
+@ s15 symbol pattern 1
+@ s15 symbol fill color 8
+@ s15 symbol fill pattern 0
+@ s15 symbol linewidth 1.0
+@ s15 symbol linestyle 1
+@ s15 symbol char 65
+@ s15 symbol char font 0
+@ s15 symbol skip 0
+@ s15 line type 1
+@ s15 line linestyle 1
+@ s15 line linewidth 1.5
+@ s15 line color 8
+@ s15 line pattern 1
+@ s15 baseline type 0
+@ s15 baseline off
+@ s15 dropline off
+@ s15 fill type 0
+@ s15 fill rule 0
+@ s15 fill color 1
+@ s15 fill pattern 1
+@ s15 avalue off
+@ s15 avalue type 2
+@ s15 avalue char size 1.000000
+@ s15 avalue font 0
+@ s15 avalue color 1
+@ s15 avalue rot 0
+@ s15 avalue format general
+@ s15 avalue prec 3
+@ s15 avalue prepend ""
+@ s15 avalue append ""
+@ s15 avalue offset 0.000000 , 0.000000
+@ s15 errorbar on
+@ s15 errorbar place both
+@ s15 errorbar color 8
+@ s15 errorbar pattern 1
+@ s15 errorbar size 1.000000
+@ s15 errorbar linewidth 1.0
+@ s15 errorbar linestyle 1
+@ s15 errorbar riser linewidth 1.0
+@ s15 errorbar riser linestyle 1
+@ s15 errorbar riser clip off
+@ s15 errorbar riser clip length 0.100000
+@ s15 comment "Cols 2:10"
+@ s15 legend ""
+@ s16 hidden false
+@ s16 type xy
+@ s16 symbol 0
+@ s16 symbol size 1.000000
+@ s16 symbol color 9
+@ s16 symbol pattern 1
+@ s16 symbol fill color 9
+@ s16 symbol fill pattern 0
+@ s16 symbol linewidth 1.0
+@ s16 symbol linestyle 1
+@ s16 symbol char 65
+@ s16 symbol char font 0
+@ s16 symbol skip 0
+@ s16 line type 1
+@ s16 line linestyle 1
+@ s16 line linewidth 1.5
+@ s16 line color 9
+@ s16 line pattern 1
+@ s16 baseline type 0
+@ s16 baseline off
+@ s16 dropline off
+@ s16 fill type 0
+@ s16 fill rule 0
+@ s16 fill color 1
+@ s16 fill pattern 1
+@ s16 avalue off
+@ s16 avalue type 2
+@ s16 avalue char size 1.000000
+@ s16 avalue font 0
+@ s16 avalue color 1
+@ s16 avalue rot 0
+@ s16 avalue format general
+@ s16 avalue prec 3
+@ s16 avalue prepend ""
+@ s16 avalue append ""
+@ s16 avalue offset 0.000000 , 0.000000
+@ s16 errorbar on
+@ s16 errorbar place both
+@ s16 errorbar color 9
+@ s16 errorbar pattern 1
+@ s16 errorbar size 1.000000
+@ s16 errorbar linewidth 1.0
+@ s16 errorbar linestyle 1
+@ s16 errorbar riser linewidth 1.0
+@ s16 errorbar riser linestyle 1
+@ s16 errorbar riser clip off
+@ s16 errorbar riser clip length 0.100000
+@ s16 comment "Cols 2:11"
+@ s16 legend ""
+@ s17 hidden false
+@ s17 type xy
+@ s17 symbol 0
+@ s17 symbol size 1.000000
+@ s17 symbol color 7
+@ s17 symbol pattern 1
+@ s17 symbol fill color 7
+@ s17 symbol fill pattern 0
+@ s17 symbol linewidth 1.0
+@ s17 symbol linestyle 1
+@ s17 symbol char 65
+@ s17 symbol char font 0
+@ s17 symbol skip 0
+@ s17 line type 1
+@ s17 line linestyle 1
+@ s17 line linewidth 1.5
+@ s17 line color 7
+@ s17 line pattern 1
+@ s17 baseline type 0
+@ s17 baseline off
+@ s17 dropline off
+@ s17 fill type 0
+@ s17 fill rule 0
+@ s17 fill color 1
+@ s17 fill pattern 1
+@ s17 avalue off
+@ s17 avalue type 2
+@ s17 avalue char size 1.000000
+@ s17 avalue font 0
+@ s17 avalue color 1
+@ s17 avalue rot 0
+@ s17 avalue format general
+@ s17 avalue prec 3
+@ s17 avalue prepend ""
+@ s17 avalue append ""
+@ s17 avalue offset 0.000000 , 0.000000
+@ s17 errorbar on
+@ s17 errorbar place both
+@ s17 errorbar color 7
+@ s17 errorbar pattern 1
+@ s17 errorbar size 1.000000
+@ s17 errorbar linewidth 1.0
+@ s17 errorbar linestyle 1
+@ s17 errorbar riser linewidth 1.0
+@ s17 errorbar riser linestyle 1
+@ s17 errorbar riser clip off
+@ s17 errorbar riser clip length 0.100000
+@ s17 comment "Cols 2:9"
+@ s17 legend ""
+ at target G0.S0
+ at type xy
+0.05 20.1401
+0.1 20.59495
+0.15 21.50844
+0.2 22.97118
+0.25 25.01873
+0.3 27.6336
+0.35 30.39092
+0.4 33.52182
+0.45 37.0277
+0.5 40.90465
+0.55 45.12454
+0.6 49.66051
+0.65 54.46231
+0.7 59.48398
+0.75 64.66577
+0.8 69.95488
+0.85 75.29349
+0.9 80.64616
+0.95 85.96968
+1 91.24152
+1.05 96.43513
+1.1 101.5685
+1.15 106.6436
+1.2 111.6568
+1.25 116.6258
+1.3 121.5642
+1.35 126.4811
+1.4 131.3978
+1.45 136.3189
+1.5 141.2469
+1.55 146.2013
+1.6 151.1593
+1.65 156.1309
+1.7 161.1219
+1.75 166.118
+1.8 171.1196
+1.85 176.1206
+1.9 181.1174
+1.95 186.1255
+2 191.1331
+2.05 196.1308
+2.1 201.1543
+2.15 206.1313
+2.2 211.1422
+2.25 216.1422
+2.3 221.1118
+2.35 226.0953
+2.4 231.0723
+2.45 236.044
+2.5 241.0191
+2.55 245.9912
+2.6 250.962
+2.65 255.9379
+2.7 260.9073
+2.75 265.8781
+2.8 270.8531
+2.85 275.8319
+2.9 280.8085
+2.95 285.7842
+3 290.7506
+3.05 295.7264
+3.1 300.6961
+3.15 305.6571
+3.2 310.608
+3.25 315.5552
+3.3 320.4979
+3.35 325.4299
+3.4 330.3565
+3.45 335.2793
+3.5 340.2102
+3.55 345.1397
+3.6 350.0692
+3.65 354.9955
+3.7 359.9185
+3.75 364.8465
+3.8 369.7664
+3.85 374.6804
+3.9 379.5969
+3.95 385.1987
+4 390.7068
+4.05 396.734
+4.1 400
+4.15 400
+4.2 400
+4.25 400
+4.3 400
+4.35 400
+4.4 400
+4.45 400
+4.5 400
+4.55 400
+4.6 400
+4.65 400
+4.7 400
+4.75 400
+4.8 400
+4.85 400
+4.9 400
+4.95 400
+5 400
+5.05 400
+5.1 400
+5.15 400
+5.2 400
+5.25 400
+5.3 400
+5.35 400
+5.4 400
+5.45 400
+5.5 400
+5.55 400
+5.6 400
+5.65 400
+5.7 400
+5.75 400
+5.8 400
+5.85 400
+5.9 400
+5.95 400
+6 400
+6.05 400
+6.1 400
+6.15 400
+6.2 400
+6.25 400
+6.3 400
+6.35 400
+6.4 400
+6.45 400
+6.5 400
+6.55 400
+6.6 400
+6.65 400
+6.7 400
+6.75 400
+6.8 400
+6.85 400
+6.9 400
+6.95 400
+7 400
+7.05 400
+7.1 400
+7.15 400
+7.2 400
+7.25 400
+7.3 400
+7.35 400
+7.4 400
+7.45 400
+7.5 400
+7.55 400
+7.6 400
+7.65 400
+7.7 400
+7.75 400
+7.8 400
+7.85 400
+7.9 400
+7.95 400
+8 400
+8.05 400
+8.1 400
+8.15 400
+8.2 400
+8.25 400
+8.3 400
+8.35 400
+8.4 400
+8.45 400
+8.5 400
+8.55 400
+8.6 400
+8.65 400
+8.7 400
+8.75 400
+8.8 400
+8.85 400
+8.9 400
+8.95 400
+9 400
+9.05 400
+9.1 400
+9.15 400
+9.2 400
+9.25 400
+9.3 400
+9.35 400
+9.4 400
+9.45 400
+9.5 400
+9.55 400
+9.6 400
+9.65 400
+9.7 400
+9.75 400
+9.8 400
+9.85 400
+9.9 400
+9.95 400
+10 400
+10.05 400
+10.1 400
+10.15 400
+10.2 400
+10.25 400
+10.3 400
+10.35 400
+10.4 400
+10.45 400
+10.5 400
+10.55 400
+10.6 400
+10.65 400
+10.7 400
+10.75 400
+10.8 400
+10.85 400
+10.9 400
+10.95 400
+11 400
+11.05 400
+11.1 400
+11.15 400
+11.2 400
+11.25 400
+11.3 400
+11.35 400
+11.4 400
+11.45 400
+11.5 400
+11.55 400
+11.6 400
+11.65 400
+11.7 400
+11.75 400
+11.8 400
+11.85 400
+11.9 400
+11.95 400
+12 400
+12.05 400
+12.1 400
+12.15 400
+12.2 400
+12.25 400
+12.3 400
+12.35 400
+12.4 400
+12.45 400
+12.5 400
+12.55 400
+12.6 400
+12.65 400
+12.7 400
+12.75 400
+12.8 400
+12.85 400
+12.9 400
+12.95 400
+13 400
+13.05 400
+13.1 400
+13.15 400
+13.2 400
+13.25 400
+13.3 400
+13.35 400
+13.4 400
+13.45 400
+13.5 400
+13.55 400
+13.6 400
+13.65 400
+13.7 400
+13.75 400
+13.8 400
+13.85 400
+13.9 400
+13.95 400
+14 400
+14.05 400
+14.1 400
+14.15 400
+14.2 400
+14.25 400
+14.3 400
+14.35 400
+14.4 400
+14.45 400
+14.5 400
+14.55 400
+14.6 400
+14.65 400
+14.7 400
+14.75 400
+14.8 400
+14.85 400
+14.9 400
+14.95 400
+15 400
+&
+ at target G0.S1
+ at type xy
+0.05 20.00038
+0.1 20.00255
+0.15 20.01032
+0.2 20.03151
+0.25 20.07869
+0.3 20.17186
+0.35 20.33517
+0.4 20.61559
+0.45 21.04536
+0.5 21.68829
+0.55 22.51038
+0.6 23.59834
+0.65 24.9158
+0.7 26.56559
+0.75 28.45916
+0.8 30.62969
+0.85 33.00342
+0.9 35.7925
+0.95 38.82291
+1 42.23923
+1.05 45.90125
+1.1 49.93533
+1.15 54.32786
+1.2 58.66019
+1.25 63.39361
+1.3 68.51459
+1.35 73.27096
+1.4 78.51093
+1.45 83.65583
+1.5 88.74329
+1.55 94.08339
+1.6 99.17776
+1.65 104.0678
+1.7 109.3045
+1.75 114.3581
+1.8 119.2737
+1.85 124.1349
+1.9 129.0083
+1.95 134.1663
+2 139.2537
+2.05 143.7961
+2.1 148.6447
+2.15 153.6347
+2.2 158.7355
+2.25 163.6539
+2.3 168.5693
+2.35 173.5706
+2.4 178.5635
+2.45 183.2448
+2.5 188.3118
+2.55 193.1133
+2.6 198.0647
+2.65 203.1614
+2.7 208.0824
+2.75 213.4106
+2.8 218.6801
+2.85 223.4996
+2.9 228.3967
+2.95 233.3879
+3 238.2548
+3.05 243.2814
+3.1 248.2097
+3.15 253.4228
+3.2 258.4618
+3.25 263.6143
+3.3 268.6261
+3.35 273.8266
+3.4 278.7927
+3.45 283.7494
+3.5 288.5345
+3.55 293.4746
+3.6 298.2672
+3.65 303.1812
+3.7 308.0637
+3.75 313.0267
+3.8 317.8303
+3.85 322.6359
+3.9 327.6432
+3.95 332.8036
+4 338.3459
+4.05 344.2843
+4.1 350.3644
+4.15 356.6353
+4.2 362.951
+4.25 369.0812
+4.3 375.061
+4.35 380.5816
+4.4 385.4353
+4.45 389.5231
+4.5 392.8048
+4.55 395.3126
+4.6 397.0406
+4.65 398.1761
+4.7 398.8388
+4.75 399.1389
+4.8 399.2384
+4.85 399.0504
+4.9 398.6987
+4.95 398.1463
+5 397.3971
+5.05 396.9154
+5.1 396.8972
+5.15 397.0467
+5.2 397.6056
+5.25 397.959
+5.3 398.347
+5.35 397.6836
+5.4 398.5015
+5.45 398.4876
+5.5 398.376
+5.55 398.2383
+5.6 398.2773
+5.65 398.2008
+5.7 398.2541
+5.75 398.4683
+5.8 398.4024
+5.85 398.4868
+5.9 398.5885
+5.95 398.3881
+6 398.3593
+6.05 398.6583
+6.1 398.9574
+6.15 399.3256
+6.2 398.9826
+6.25 399.2896
+6.3 399.4609
+6.35 399.6476
+6.4 399.4935
+6.45 399.7119
+6.5 399.7877
+6.55 399.838
+6.6 399.7156
+6.65 399.695
+6.7 399.6041
+6.75 399.5123
+6.8 399.2466
+6.85 398.8884
+6.9 398.3453
+6.95 397.4741
+7 396.2761
+7.05 395.0846
+7.1 393.8553
+7.15 393.1586
+7.2 392.8987
+7.25 393.8502
+7.3 395.6602
+7.35 397.1278
+7.4 398.6672
+7.45 398.2718
+7.5 399.3399
+7.55 399.7405
+7.6 399.6387
+7.65 399.8457
+7.7 399.7911
+7.75 399.8789
+7.8 399.8796
+7.85 399.7121
+7.9 399.6318
+7.95 399.384
+8 399.057
+8.05 398.3858
+8.1 397.4421
+8.15 396.0222
+8.2 394.5066
+8.25 393.2204
+8.3 392.5078
+8.35 392.6429
+8.4 394.1659
+8.45 395.2099
+8.5 397.5047
+8.55 398.9918
+8.6 398.8187
+8.65 399.6837
+8.7 399.6593
+8.75 399.8022
+8.8 399.8444
+8.85 399.9519
+8.9 399.8902
+8.95 399.8632
+9 399.8309
+9.05 399.7475
+9.1 399.5788
+9.15 399.3241
+9.2 398.8679
+9.25 398.0581
+9.3 397.0078
+9.35 395.5639
+9.4 393.9725
+9.45 392.7207
+9.5 392.2941
+9.55 392.0653
+9.6 393.1329
+9.65 394.2821
+9.7 397.1259
+9.75 398.9913
+9.8 398.6792
+9.85 399.6089
+9.9 399.4824
+9.95 399.788
+10 399.784
+10.05 399.8462
+10.1 399.8344
+10.15 399.9618
+10.2 399.9085
+10.25 399.9308
+10.3 399.8291
+10.35 399.7695
+10.4 399.6365
+10.45 399.4334
+10.5 398.9997
+10.55 398.4004
+10.6 397.5195
+10.65 396.6179
+10.7 395.9621
+10.75 395.3442
+10.8 395.3897
+10.85 396.4463
+10.9 397.2134
+10.95 398.6399
+11 399.3792
+11.05 399.058
+11.1 399.6583
+11.15 399.6755
+11.2 399.8729
+11.25 399.8054
+11.3 399.9466
+11.35 399.8954
+11.4 399.9111
+11.45 399.8167
+11.5 399.7663
+11.55 399.6387
+11.6 399.4377
+11.65 399.1427
+11.7 398.7209
+11.75 398.0746
+11.8 397.4104
+11.85 396.9449
+11.9 396.8585
+11.95 397.0171
+12 397.1871
+12.05 397.883
+12.1 398.6102
+12.15 399.3069
+12.2 399.2163
+12.25 399.7813
+12.3 399.6266
+12.35 399.8176
+12.4 399.7484
+12.45 399.8709
+12.5 399.8166
+12.55 399.8772
+12.6 399.7905
+12.65 399.7928
+12.7 399.745
+12.75 399.6122
+12.8 399.3934
+12.85 399.0726
+12.9 398.6639
+12.95 398.3451
+13 397.9725
+13.05 397.6931
+13.1 397.8542
+13.15 397.8997
+13.2 398.4432
+13.25 398.761
+13.3 399.2229
+13.35 398.9516
+13.4 399.4185
+13.45 399.7299
+13.5 399.5865
+13.55 399.8276
+13.6 399.7147
+13.65 399.8522
+13.7 399.8138
+13.75 399.8977
+13.8 399.828
+13.85 399.8122
+13.9 399.7544
+13.95 399.6232
+14 399.494
+14.05 399.3395
+14.1 399.0969
+14.15 398.7509
+14.2 398.577
+14.25 398.2438
+14.3 398.3303
+14.35 398.4361
+14.4 398.8797
+14.45 399.0099
+14.5 399.2015
+14.55 399.5031
+14.6 399.2735
+14.65 399.729
+14.7 399.6187
+14.75 399.8128
+14.8 399.7689
+14.85 399.894
+14.9 399.8409
+14.95 399.9129
+15 399.8489
+&
+ at target G0.S2
+ at type xy
+0.05 20
+0.1 20
+0.15 20
+0.2 20
+0.25 20
+0.3 20
+0.35 20
+0.4 20
+0.45 20
+0.5 20
+0.55 20
+0.6 20
+0.65 20
+0.7 20
+0.75 20
+0.8 20
+0.85 20
+0.9 20
+0.95 20
+1 20
+1.05 20
+1.1 20
+1.15 20
+1.2 20
+1.25 20
+1.3 20
+1.35 20
+1.4 20
+1.45 20
+1.5 20
+1.55 20
+1.6 20
+1.65 20
+1.7 20
+1.75 20
+1.8 20
+1.85 20
+1.9 20
+1.95 20
+2 20
+2.05 20
+2.1 20
+2.15 20
+2.2 20
+2.25 20
+2.3 20
+2.35 20
+2.4 20
+2.45 20
+2.5 20
+2.55 20
+2.6 20
+2.65 20
+2.7 20
+2.75 20
+2.8 20
+2.85 20
+2.9 20.00001
+2.95 20.00001
+3 20.00002
+3.05 20.00004
+3.1 20.00006
+3.15 20.00009
+3.2 20.00014
+3.25 20.00023
+3.3 20.00038
+3.35 20.00061
+3.4 20.00102
+3.45 20.00187
+3.5 20.00385
+3.55 20.00845
+3.6 20.01901
+3.65 20.04213
+3.7 20.08073
+3.75 20.13663
+3.8 20.29055
+3.85 20.45605
+3.9 20.73878
+3.95 21.20915
+4 21.93249
+4.05 22.67528
+4.1 23.54737
+4.15 24.53461
+4.2 25.62413
+4.25 27.03589
+4.3 28.54587
+4.35 30.0485
+4.4 31.47326
+4.45 32.75327
+4.5 33.5949
+4.55 34.26352
+4.6 34.72522
+4.65 34.99885
+4.7 35.06346
+4.75 35.00075
+4.8 34.85099
+4.85 34.65094
+4.9 34.43667
+4.95 34.25236
+5 34.14603
+5.05 34.16683
+5.1 34.38714
+5.15 34.87284
+5.2 35.68575
+5.25 36.8556
+5.3 38.41944
+5.35 40.33163
+5.4 42.74311
+5.45 45.5159
+5.5 48.56894
+5.55 51.70913
+5.6 54.82931
+5.65 57.10738
+5.7 59.11336
+5.75 60.85178
+5.8 62.32123
+5.85 63.54318
+5.9 64.55424
+5.95 65.34262
+6 65.96075
+6.05 66.43473
+6.1 66.78239
+6.15 67.03628
+6.2 67.20597
+6.25 67.30574
+6.3 67.34685
+6.35 67.33317
+6.4 67.25734
+6.45 67.13764
+6.5 66.97969
+6.55 66.78886
+6.6 66.57137
+6.65 66.3326
+6.7 66.07718
+6.75 65.82153
+6.8 65.60848
+6.85 65.51303
+6.9 65.60788
+6.95 66.09677
+7 67.1427
+7.05 68.50403
+7.1 70.58754
+7.15 73.44456
+7.2 76.84064
+7.25 80.47227
+7.3 83.93456
+7.35 86.98123
+7.4 89.47488
+7.45 91.4092
+7.5 92.84543
+7.55 93.83453
+7.6 94.45345
+7.65 94.79481
+7.7 95.0029
+7.75 95.16243
+7.8 95.34472
+7.85 95.61615
+7.9 96.03728
+7.95 96.65077
+8 97.46533
+8.05 98.46552
+8.1 99.58859
+8.15 100.8228
+8.2 102.0751
+8.25 103.2853
+8.3 104.3808
+8.35 105.3923
+8.4 106.3359
+8.45 107.2728
+8.5 108.2187
+8.55 109.1954
+8.6 110.196
+8.65 111.2456
+8.7 112.3668
+8.75 113.5653
+8.8 114.8539
+8.85 116.239
+8.9 117.7305
+8.95 119.3572
+9 121.1951
+9.05 123.2165
+9.1 125.4917
+9.15 128.0863
+9.2 130.953
+9.25 133.8831
+9.3 136.9269
+9.35 139.8741
+9.4 142.634
+9.45 144.9529
+9.5 146.8065
+9.55 148.24
+9.6 149.3149
+9.65 150.0968
+9.7 150.6461
+9.75 151.0078
+9.8 151.2336
+9.85 151.3601
+9.9 151.428
+9.95 151.4724
+10 151.5179
+10.05 151.5838
+10.1 151.6836
+10.15 151.8411
+10.2 152.0813
+10.25 152.441
+10.3 152.9633
+10.35 153.6945
+10.4 154.6778
+10.45 155.9574
+10.5 157.538
+10.55 159.3989
+10.6 161.4545
+10.65 163.5855
+10.7 165.5916
+10.75 167.3555
+10.8 168.7879
+10.85 169.8781
+10.9 170.6622
+10.95 171.2088
+11 171.6034
+11.05 171.904
+11.1 172.1606
+11.15 172.4132
+11.2 172.6898
+11.25 173.0235
+11.3 173.439
+11.35 173.9617
+11.4 174.6143
+11.45 175.4157
+11.5 176.3752
+11.55 177.5118
+11.6 178.8198
+11.65 180.2829
+11.7 181.8448
+11.75 183.4333
+11.8 184.9905
+11.85 186.4281
+11.9 187.6513
+11.95 188.6659
+12 189.4603
+12.05 190.0903
+12.1 190.5996
+12.15 191.0317
+12.2 191.4153
+12.25 191.7722
+12.3 192.1373
+12.35 192.521
+12.4 192.933
+12.45 193.3884
+12.5 193.8976
+12.55 194.4784
+12.6 195.1487
+12.65 195.8977
+12.7 196.7638
+12.75 197.7365
+12.8 198.816
+12.85 200.0175
+12.9 201.2801
+12.95 202.5651
+13 203.8526
+13.05 205.0651
+13.1 206.139
+13.15 207.0327
+13.2 207.7393
+13.25 208.3
+13.3 208.7529
+13.35 209.1294
+13.4 209.4568
+13.45 209.7557
+13.5 210.0448
+13.55 210.3441
+13.6 210.6733
+13.65 211.0509
+13.7 211.4955
+13.75 212.0261
+13.8 212.6632
+13.85 213.4266
+13.9 214.3276
+13.95 215.3676
+14 216.5411
+14.05 217.8084
+14.1 219.1102
+14.15 220.3969
+14.2 221.5861
+14.25 222.5874
+14.3 223.379
+14.35 223.9596
+14.4 224.3775
+14.45 224.6735
+14.5 224.8848
+14.55 225.0458
+14.6 225.1845
+14.65 225.3234
+14.7 225.4759
+14.75 225.6574
+14.8 225.8807
+14.85 226.1609
+14.9 226.5096
+14.95 226.9427
+15 227.4701
+&
+ at target G0.S3
+ at type xy
+0.05 20.00004
+0.1 20.00043
+0.15 20.00237
+0.2 20.00932
+0.25 20.02886
+0.3 20.07535
+0.35 20.17336
+0.4 20.3594
+0.45 20.68012
+0.5 21.1818
+0.55 21.90205
+0.6 22.86141
+0.65 24.06324
+0.7 25.50552
+0.75 27.18392
+0.8 29.1006
+0.85 31.26339
+0.9 33.68227
+0.95 36.36399
+1 39.30821
+1.05 42.50742
+1.1 45.94723
+1.15 49.60855
+1.2 53.46995
+1.25 57.50881
+1.3 61.70035
+1.35 66.02007
+1.4 70.4432
+1.45 74.94778
+1.5 79.51639
+1.55 84.13411
+1.6 88.78775
+1.65 93.46353
+1.7 98.14949
+1.75 102.8372
+1.8 107.5212
+1.85 112.1987
+1.9 116.8699
+1.95 121.5364
+2 126.199
+2.05 130.8561
+2.1 135.5028
+2.15 140.1352
+2.2 144.7534
+2.25 149.3611
+2.3 153.9634
+2.35 158.5623
+2.4 163.1567
+2.45 167.7447
+2.5 172.3249
+2.55 176.8964
+2.6 181.4574
+2.65 186.0049
+2.7 190.5354
+2.75 195.0466
+2.8 199.5376
+2.85 204.0089
+2.9 208.4596
+2.95 212.887
+3 217.2878
+3.05 221.6595
+3.1 226.0018
+3.15 230.3158
+3.2 234.6021
+3.25 238.8582
+3.3 243.0796
+3.35 247.26
+3.4 251.3932
+3.45 255.4747
+3.5 259.5013
+3.55 263.471
+3.6 267.3817
+3.65 271.23
+3.7 275.0113
+3.75 278.7187
+3.8 282.3438
+3.85 285.8771
+3.9 289.3166
+3.95 292.8392
+4 296.4646
+4.05 300.2012
+4.1 304.0618
+4.15 308.066
+4.2 312.2423
+4.25 316.6322
+4.3 321.2927
+4.35 326.2993
+4.4 331.743
+4.45 337.7183
+4.5 344.2955
+4.55 351.4741
+4.6 359.1258
+4.65 366.9519
+4.7 374.4963
+4.75 381.2416
+4.8 386.7673
+4.85 390.8879
+4.9 393.6798
+4.95 395.3929
+5 396.3222
+5.05 396.713
+5.1 396.7279
+5.15 396.4575
+5.2 395.9547
+5.25 395.2502
+5.3 394.3961
+5.35 393.4642
+5.4 392.5481
+5.45 391.7478
+5.5 391.1445
+5.55 390.7907
+5.6 390.6934
+5.65 390.8257
+5.7 391.1358
+5.75 391.5596
+5.8 392.032
+5.85 392.4962
+5.9 392.9113
+5.95 393.2555
+6 393.5285
+6.05 393.7471
+6.1 393.9403
+6.15 394.1389
+6.2 394.3655
+6.25 394.6306
+6.3 394.9346
+6.35 395.2722
+6.4 395.6355
+6.45 396.0179
+6.5 396.4122
+6.55 396.8099
+6.6 397.2003
+6.65 397.5721
+6.7 397.9139
+6.75 398.2171
+6.8 398.4766
+6.85 398.6884
+6.9 398.8485
+6.95 398.9504
+7 398.9836
+7.05 398.9319
+7.1 398.7727
+7.15 398.4794
+7.2 398.0215
+7.25 397.3798
+7.3 396.554
+7.35 395.5734
+7.4 394.5032
+7.45 393.4409
+7.5 392.505
+7.55 391.8163
+7.6 391.4798
+7.65 391.5414
+7.7 391.9984
+7.75 392.7822
+7.8 393.7771
+7.85 394.8477
+7.9 395.872
+7.95 396.7634
+8 397.48
+8.05 398.0155
+8.1 398.382
+8.15 398.5937
+8.2 398.6559
+8.25 398.56
+8.3 398.2848
+8.35 397.805
+8.4 397.1003
+8.45 396.1705
+8.5 395.0501
+8.55 393.8173
+8.6 392.5897
+8.65 391.5104
+8.7 390.7239
+8.75 390.3563
+8.8 390.4663
+8.85 391.0531
+8.9 392.0312
+8.95 393.2531
+9 394.5472
+9.05 395.7612
+9.1 396.7936
+9.15 397.6027
+9.2 398.1934
+9.25 398.5945
+9.3 398.8373
+9.35 398.9419
+9.4 398.9121
+9.45 398.7358
+9.5 398.3894
+9.55 397.8413
+9.6 397.0674
+9.65 396.0678
+9.7 394.8812
+9.75 393.5918
+9.8 392.3236
+9.85 391.2216
+9.9 390.4295
+9.95 390.0653
+10 390.1817
+10.05 390.7722
+10.1 391.7513
+10.15 392.9751
+10.2 394.2743
+10.25 395.4983
+10.3 396.5472
+10.35 397.3827
+10.4 398.0134
+10.45 398.4722
+10.5 398.7948
+10.55 399.0083
+10.6 399.127
+10.65 399.1536
+10.7 399.0815
+10.75 398.8977
+10.8 398.5869
+10.85 398.1395
+10.9 397.5573
+10.95 396.867
+11 396.1232
+11.05 395.403
+11.1 394.796
+11.15 394.3889
+11.2 394.2473
+11.25 394.3927
+11.3 394.8015
+11.35 395.4072
+11.4 396.1186
+11.45 396.8433
+11.5 397.5062
+11.55 398.0624
+11.6 398.497
+11.65 398.8153
+11.7 399.0318
+11.75 399.1594
+11.8 399.2044
+11.85 399.1649
+11.9 399.0336
+11.95 398.8012
+12 398.4618
+12.05 398.0216
+12.1 397.5048
+12.15 396.9546
+12.2 396.429
+12.25 395.992
+12.3 395.7052
+12.35 395.6028
+12.4 395.6993
+12.45 395.9759
+12.5 396.3883
+12.55 396.8794
+12.6 397.3915
+12.65 397.8764
+12.7 398.3008
+12.75 398.6479
+12.8 398.9137
+12.85 399.1023
+12.9 399.2199
+12.95 399.2713
+13 399.2575
+13.05 399.1758
+13.1 399.0214
+13.15 398.7922
+13.2 398.4907
+13.25 398.1336
+13.3 397.7491
+13.35 397.374
+13.4 397.0482
+13.45 396.8113
+13.5 396.692
+13.55 396.7045
+13.6 396.8444
+13.65 397.0898
+13.7 397.4064
+13.75 397.7567
+13.8 398.107
+13.85 398.4325
+13.9 398.7178
+13.95 398.9558
+14 399.1445
+14.05 399.2849
+14.1 399.3782
+14.15 399.4248
+14.2 399.4227
+14.25 399.3689
+14.3 399.2602
+14.35 399.0956
+14.4 398.8787
+14.45 398.6201
+14.5 398.3363
+14.55 398.0524
+14.6 397.7994
+14.65 397.6092
+14.7 397.5052
+14.75 397.4983
+14.8 397.5848
+14.85 397.75
+14.9 397.9718
+14.95 398.2254
+15 398.4872
+&
+ at target G0.S4
+ at type xy
+0.05 20
+0.1 20.00003
+0.15 20.00023
+0.2 20.00114
+0.25 20.0043
+0.3 20.01313
+0.35 20.03435
+0.4 20.07919
+0.45 20.16399
+0.5 20.30961
+0.55 20.53903
+0.6 20.89404
+0.65 21.43733
+0.7 22.2286
+0.75 23.27855
+0.8 24.51357
+0.85 25.91242
+0.9 27.47725
+0.95 29.25363
+1 31.28378
+1.05 33.57091
+1.1 36.11045
+1.15 38.92959
+1.2 42.00923
+1.25 45.32443
+1.3 48.85047
+1.35 52.56421
+1.4 56.43417
+1.45 60.45739
+1.5 64.60069
+1.55 68.87619
+1.6 73.23275
+1.65 77.67704
+1.7 82.16985
+1.75 86.72824
+1.8 91.33475
+1.85 95.95347
+1.9 100.5696
+1.95 105.1763
+2 109.7936
+2.05 114.4239
+2.1 119.0397
+2.15 123.6488
+2.2 128.2326
+2.25 132.8061
+2.3 137.3485
+2.35 141.8842
+2.4 146.3944
+2.45 150.886
+2.5 155.35
+2.55 159.8258
+2.6 164.2784
+2.65 168.702
+2.7 173.1114
+2.75 177.4983
+2.8 181.8581
+2.85 186.1981
+2.9 190.5207
+2.95 194.8171
+3 199.092
+3.05 203.3467
+3.1 207.5694
+3.15 211.7424
+3.2 215.8959
+3.25 220.0173
+3.3 224.0893
+3.35 228.1298
+3.4 232.1185
+3.45 236.049
+3.5 239.9241
+3.55 243.7468
+3.6 247.4665
+3.65 251.1584
+3.7 254.7548
+3.75 258.2569
+3.8 261.6923
+3.85 265.027
+3.9 268.2194
+3.95 271.4389
+4 274.6869
+4.05 277.9875
+4.1 281.4112
+4.15 284.8899
+4.2 288.4971
+4.25 292.2359
+4.3 296.1329
+4.35 300.2224
+4.4 304.529
+4.45 309.0678
+4.5 313.9126
+4.55 319.1221
+4.6 324.7549
+4.65 330.9007
+4.7 337.6381
+4.75 344.9103
+4.8 352.701
+4.85 360.7837
+4.9 368.8074
+4.95 376.4034
+5 383.1449
+5.05 388.6063
+5.1 392.0699
+5.15 394.794
+5.2 396.4856
+5.25 396.7646
+5.3 396.7145
+5.35 396.5808
+5.4 396.219
+5.45 395.7618
+5.5 395.1708
+5.55 394.5612
+5.6 393.9668
+5.65 393.3348
+5.7 392.9652
+5.75 392.7619
+5.8 392.6804
+5.85 392.8267
+5.9 393.0724
+5.95 393.4371
+6 393.7902
+6.05 394.1839
+6.1 394.5659
+6.15 394.8814
+6.2 395.0912
+6.25 395.3363
+6.3 395.5472
+6.35 395.7473
+6.4 395.9198
+6.45 396.1779
+6.5 396.3824
+6.55 396.6339
+6.6 396.8351
+6.65 397.1407
+6.7 397.4437
+6.75 397.7236
+6.8 397.9966
+6.85 398.2798
+6.9 398.495
+6.95 398.7059
+7 398.8716
+7.05 398.9959
+7.1 399.0728
+7.15 399.1044
+7.2 399.0603
+7.25 398.9048
+7.3 398.6637
+7.35 398.2751
+7.4 397.7525
+7.45 397.123
+7.5 396.3759
+7.55 395.6036
+7.6 394.8486
+7.65 394.1235
+7.7 393.6278
+7.75 393.3468
+7.8 393.2359
+7.85 393.4584
+7.9 393.9498
+7.95 394.4953
+8 395.3023
+8.05 396.1253
+8.1 396.8606
+8.15 397.5333
+8.2 398.0287
+8.25 398.3476
+8.3 398.6322
+8.35 398.7014
+8.4 398.6596
+8.45 398.4685
+8.5 398.0921
+8.55 397.5241
+8.6 396.8104
+8.65 395.9143
+8.7 395.005
+8.75 394.0515
+8.8 393.1667
+8.85 392.4599
+8.9 392.0537
+8.95 391.9436
+9 392.2204
+9.05 392.791
+9.1 393.8375
+9.15 394.7998
+9.2 395.6939
+9.25 396.6582
+9.3 397.5158
+9.35 398.0939
+9.4 398.534
+9.45 398.792
+9.5 398.9396
+9.55 398.9205
+9.6 398.7831
+9.65 398.4871
+9.7 397.942
+9.75 397.2435
+9.8 396.3922
+9.85 395.4155
+9.9 394.3488
+9.95 393.3666
+10 392.5214
+10.05 391.865
+10.1 391.5886
+10.15 391.5977
+10.2 391.9378
+10.25 392.5048
+10.3 393.4206
+10.35 394.4008
+10.4 395.4444
+10.45 396.4114
+10.5 397.1863
+10.55 397.8452
+10.6 398.3601
+10.65 398.6946
+10.7 398.9351
+10.75 399.0581
+10.8 399.1111
+10.85 399.0035
+10.9 398.8371
+10.95 398.514
+11 398.1144
+11.05 397.555
+11.1 396.9477
+11.15 396.3434
+11.2 395.6781
+11.25 395.168
+11.3 394.7865
+11.35 394.6667
+11.4 394.72
+11.45 395.0816
+11.5 395.556
+11.55 396.1846
+11.6 396.7688
+11.65 397.3765
+11.7 397.9227
+11.75 398.3711
+11.8 398.6739
+11.85 398.9419
+11.9 399.0305
+11.95 399.063
+12 399.0084
+12.05 398.8187
+12.1 398.5464
+12.15 398.1771
+12.2 397.743
+12.25 397.2881
+12.3 396.8048
+12.35 396.4274
+12.4 396.1243
+12.45 395.9393
+12.5 395.872
+12.55 395.9798
+12.6 396.1214
+12.65 396.4318
+12.7 396.7853
+12.75 397.1706
+12.8 397.5988
+12.85 398.0582
+12.9 398.3525
+12.95 398.6633
+13 398.8901
+13.05 399.0244
+13.1 399.0921
+13.15 399.0991
+13.2 398.977
+13.25 398.8113
+13.3 398.5588
+13.35 398.2205
+13.4 397.8228
+13.45 397.4166
+13.5 397.0258
+13.55 396.6255
+13.6 396.3902
+13.65 396.4458
+13.7 396.4701
+13.75 396.6341
+13.8 396.9358
+13.85 397.2548
+13.9 397.5916
+13.95 397.9071
+14 398.2252
+14.05 398.4808
+14.1 398.7114
+14.15 398.8977
+14.2 399.0256
+14.25 399.0913
+14.3 399.1434
+14.35 399.1288
+14.4 399.088
+14.45 399.0011
+14.5 398.8345
+14.55 398.6053
+14.6 398.3364
+14.65 398.0539
+14.7 397.7561
+14.75 397.4866
+14.8 397.238
+14.85 397.0901
+14.9 397.0416
+14.95 397.1213
+15 397.3194
+&
+ at target G0.S5
+ at type xy
+0.05 20
+0.1 20
+0.15 20
+0.2 20
+0.25 20
+0.3 20
+0.35 20
+0.4 20
+0.45 20.00001
+0.5 20.00003
+0.55 20.0001
+0.6 20.00027
+0.65 20.0007
+0.7 20.0017
+0.75 20.00392
+0.8 20.00859
+0.85 20.018
+0.9 20.03611
+0.95 20.06954
+1 20.12875
+1.05 20.22914
+1.1 20.3917
+1.15 20.64164
+1.2 21.00422
+1.25 21.49371
+1.3 22.09646
+1.35 22.77244
+1.4 23.46318
+1.45 24.03436
+1.5 24.34554
+1.55 24.35405
+1.6 24.06383
+1.65 23.57081
+1.7 22.96095
+1.75 22.34954
+1.8 21.82075
+1.85 21.76956
+1.9 22.14597
+1.95 22.32832
+2 22.5598
+2.05 22.85861
+2.1 23.1671
+2.15 23.45936
+2.2 23.72568
+2.25 23.96824
+2.3 24.18156
+2.35 24.37495
+2.4 24.55781
+2.45 24.73347
+2.5 24.9281
+2.55 25.14185
+2.6 25.38634
+2.65 25.67772
+2.7 26.01503
+2.75 26.39423
+2.8 26.81167
+2.85 27.26737
+2.9 27.75402
+2.95 28.26536
+3 28.80616
+3.05 29.3711
+3.1 29.95979
+3.15 30.57053
+3.2 31.19459
+3.25 31.82736
+3.3 32.47853
+3.35 33.14233
+3.4 33.81199
+3.45 34.48862
+3.5 35.16937
+3.55 35.86958
+3.6 36.58546
+3.65 37.31242
+3.7 38.06077
+3.75 38.8287
+3.8 39.6052
+3.85 40.42154
+3.9 41.26148
+3.95 42.09138
+4 42.90515
+4.05 43.71141
+4.1 44.5081
+4.15 45.29936
+4.2 46.07791
+4.25 46.84855
+4.3 47.60446
+4.35 48.3474
+4.4 49.07337
+4.45 49.77555
+4.5 50.45689
+4.55 51.11455
+4.6 51.74539
+4.65 52.3479
+4.7 52.9214
+4.75 53.46663
+4.8 53.9864
+4.85 54.486
+4.9 54.97724
+4.95 55.48478
+5 56.04738
+5.05 56.727
+5.1 57.67896
+5.15 59.18839
+5.2 61.6223
+5.25 65.45877
+5.3 71.69253
+5.35 81.74055
+5.4 97.60055
+5.45 121.7442
+5.5 156.7288
+5.55 201.435
+5.6 251.8687
+5.65 292.6503
+5.7 316.5489
+5.75 305.1967
+5.8 294.1456
+5.85 280.7185
+5.9 268.0689
+5.95 256.2506
+6 244.5565
+6.05 232.924
+6.1 221.0355
+6.15 208.5866
+6.2 197.1157
+6.25 185.6442
+6.3 176.4235
+6.35 168.9571
+6.4 170.8253
+6.45 168.2245
+6.5 166.1913
+6.55 165.7627
+6.6 164.2338
+6.65 163.6246
+6.7 163.6667
+6.75 164.5176
+6.8 166.4995
+6.85 169.5522
+6.9 174.1446
+6.95 180.647
+7 188.8978
+7.05 198.8349
+7.1 210.3651
+7.15 222.4822
+7.2 235.7646
+7.25 248.5935
+7.3 258.1248
+7.35 265.4964
+7.4 270.7963
+7.45 273.5236
+7.5 274.3467
+7.55 273.8427
+7.6 272.0341
+7.65 268.792
+7.7 264.6695
+7.75 260.0951
+7.8 254.9891
+7.85 249.2691
+7.9 243.4274
+7.95 237.5339
+8 231.2494
+8.05 224.847
+8.1 218.4266
+8.15 212.0871
+8.2 206.1357
+8.25 200.71
+8.3 196.0737
+8.35 192.451
+8.4 189.533
+8.45 187.6225
+8.5 186.9148
+8.55 187.7049
+8.6 189.7651
+8.65 193.5875
+8.7 199.4381
+8.75 207.2623
+8.8 216.7973
+8.85 227.804
+8.9 239.1878
+8.95 249.455
+9 258.3344
+9.05 264.5805
+9.1 268.4678
+9.15 270.1151
+9.2 269.8954
+9.25 268.2713
+9.3 265.4683
+9.35 262.0299
+9.4 258.1432
+9.45 253.9669
+9.5 249.6576
+9.55 245.5404
+9.6 241.8239
+9.65 238.6888
+9.7 236.2471
+9.75 234.6978
+9.8 234.1118
+9.85 234.2547
+9.9 236.5131
+9.95 238.5919
+10 241.1884
+10.05 244.0251
+10.1 247.1659
+10.15 250.3313
+10.2 253.438
+10.25 256.2455
+10.3 258.7445
+10.35 260.8291
+10.4 262.3358
+10.45 263.5268
+10.5 264.3702
+10.55 265.0003
+10.6 265.4794
+10.65 265.8806
+10.7 266.2471
+10.75 266.6431
+10.8 267.023
+10.85 267.3446
+10.9 267.7215
+10.95 268.2179
+11 269.0676
+11.05 270.0523
+11.1 271.3456
+11.15 273.1016
+11.2 275.1097
+11.25 277.485
+11.3 280.0794
+11.35 282.915
+11.4 285.3783
+11.45 287.5177
+11.5 289.3349
+11.55 290.6975
+11.6 291.4933
+11.65 291.8758
+11.7 291.905
+11.75 291.6255
+11.8 291.1469
+11.85 290.4949
+11.9 289.7553
+11.95 289.0548
+12 288.5203
+12.05 288.1751
+12.1 288.1186
+12.15 288.4666
+12.2 289.1167
+12.25 290.1459
+12.3 291.413
+12.35 292.9537
+12.4 294.5748
+12.45 296.225
+12.5 297.897
+12.55 299.4494
+12.6 300.8064
+12.65 302.0272
+12.7 303.1875
+12.75 304.1275
+12.8 305.0016
+12.85 305.8295
+12.9 306.7241
+12.95 307.6978
+13 308.7937
+13.05 310.0244
+13.1 311.2639
+13.15 312.4362
+13.2 313.5043
+13.25 314.342
+13.3 314.9207
+13.35 315.3303
+13.4 315.4935
+13.45 315.4954
+13.5 315.4763
+13.55 315.4958
+13.6 315.5609
+13.65 315.7846
+13.7 316.1861
+13.75 316.7114
+13.8 317.4777
+13.85 318.4344
+13.9 319.5468
+13.95 320.7345
+14 321.9275
+14.05 323.038
+14.1 324.0018
+14.15 324.755
+14.2 325.3177
+14.25 325.7691
+14.3 326.1274
+14.35 326.5327
+14.4 326.9696
+14.45 327.4806
+14.5 328.0478
+14.55 328.816
+14.6 329.6288
+14.65 330.4792
+14.7 331.3115
+14.75 332.0823
+14.8 332.7478
+14.85 333.3092
+14.9 333.8195
+14.95 334.189
+15 334.5043
+&
+ at target G0.S6
+ at type xy
+0.05 20
+0.1 20
+0.15 20
+0.2 20
+0.25 20
+0.3 20
+0.35 20
+0.4 20
+0.45 20
+0.5 20
+0.55 20
+0.6 20.00001
+0.65 20.00001
+0.7 20.00004
+0.75 20.00008
+0.8 20.00019
+0.85 20.00041
+0.9 20.00086
+0.95 20.00175
+1 20.00347
+1.05 20.00667
+1.1 20.01252
+1.15 20.02291
+1.2 20.04097
+1.25 20.07162
+1.3 20.12232
+1.35 20.20413
+1.4 20.33234
+1.45 20.52843
+1.5 20.81937
+1.55 21.23482
+1.6 21.80223
+1.65 22.55105
+1.7 23.50297
+1.75 24.65831
+1.8 26.06635
+1.85 27.61508
+1.9 29.23791
+1.95 31.12952
+2 32.83108
+2.05 34.3999
+2.1 35.59684
+2.15 36.74392
+2.2 37.82824
+2.25 38.86107
+2.3 39.79021
+2.35 40.58691
+2.4 41.25147
+2.45 41.79748
+2.5 42.21845
+2.55 42.52505
+2.6 42.72396
+2.65 42.82499
+2.7 42.86162
+2.75 42.87108
+2.8 42.89077
+2.85 42.96236
+2.9 43.11726
+2.95 43.37495
+3 43.74869
+3.05 44.24435
+3.1 44.86067
+3.15 45.58528
+3.2 46.40946
+3.25 47.32234
+3.3 48.30968
+3.35 49.36392
+3.4 50.46569
+3.45 51.60788
+3.5 52.78657
+3.55 53.98182
+3.6 55.18658
+3.65 56.38849
+3.7 57.56989
+3.75 58.73586
+3.8 59.86843
+3.85 60.97309
+3.9 62.03674
+3.95 63.04835
+4 63.99919
+4.05 64.88322
+4.1 65.69671
+4.15 66.44339
+4.2 67.12221
+4.25 67.73413
+4.3 68.28474
+4.35 68.77882
+4.4 69.2187
+4.45 69.60882
+4.5 69.9524
+4.55 70.25176
+4.6 70.50747
+4.65 70.72576
+4.7 70.90606
+4.75 71.05
+4.8 71.16107
+4.85 71.24105
+4.9 71.29188
+4.95 71.31648
+5 71.31545
+5.05 71.29094
+5.1 71.24393
+5.15 71.17706
+5.2 71.09145
+5.25 70.99067
+5.3 70.8778
+5.35 70.75967
+5.4 70.64542
+5.45 70.55036
+5.5 70.49087
+5.55 70.53018
+5.6 70.67954
+5.65 71.15479
+5.7 72.05568
+5.75 73.5135
+5.8 75.85855
+5.85 79.44881
+5.9 84.72675
+5.95 92.17955
+6 102.2695
+6.05 115.3071
+6.1 131.9564
+6.15 151.7042
+6.2 172.7089
+6.25 195.0923
+6.3 217.0543
+6.35 231.604
+6.4 238.6608
+6.45 239.2044
+6.5 238.2077
+6.55 235.7158
+6.6 231.9476
+6.65 227.1705
+6.7 221.9209
+6.75 216.0989
+6.8 210.7352
+6.85 205.8851
+6.9 201.4965
+6.95 197.5122
+7 193.9341
+7.05 190.7046
+7.1 187.8162
+7.15 185.2756
+7.2 183.0939
+7.25 181.2873
+7.3 179.8773
+7.35 178.9167
+7.4 178.4641
+7.45 178.541
+7.5 179.1307
+7.55 180.2345
+7.6 181.7404
+7.65 183.7024
+7.7 185.9202
+7.75 188.3361
+7.8 190.894
+7.85 193.4508
+7.9 195.9517
+7.95 198.3507
+8 200.6178
+8.05 202.7338
+8.1 204.6968
+8.15 206.4915
+8.2 208.1593
+8.25 209.7451
+8.3 211.2258
+8.35 212.5985
+8.4 213.8821
+8.45 215.0749
+8.5 216.1741
+8.55 217.174
+8.6 218.0661
+8.65 218.8378
+8.7 219.4958
+8.75 220.052
+8.8 220.5302
+8.85 220.9686
+8.9 221.4207
+8.95 221.943
+9 222.5993
+9.05 223.4521
+9.1 224.5477
+9.15 225.9631
+9.2 227.7195
+9.25 229.7764
+9.3 232.1492
+9.35 234.7124
+9.4 237.4457
+9.45 240.21
+9.5 242.9455
+9.55 245.5213
+9.6 247.9208
+9.65 250.0989
+9.7 252.0443
+9.75 253.7439
+9.8 255.2342
+9.85 256.5498
+9.9 257.7171
+9.95 258.784
+10 259.7632
+10.05 260.6777
+10.1 261.5381
+10.15 262.3478
+10.2 263.1111
+10.25 263.8215
+10.3 264.4866
+10.35 265.1081
+10.4 265.7058
+10.45 266.2998
+10.5 266.909
+10.55 267.5527
+10.6 268.246
+10.65 268.9921
+10.7 269.7944
+10.75 270.663
+10.8 271.601
+10.85 272.6003
+10.9 273.6731
+10.95 274.8109
+11 276.0115
+11.05 277.2796
+11.1 278.6091
+11.15 279.9755
+11.2 281.371
+11.25 282.7751
+11.3 284.1663
+11.35 285.5282
+11.4 286.8524
+11.45 288.1355
+11.5 289.3754
+11.55 290.5782
+11.6 291.7492
+11.65 292.8937
+11.7 294.0229
+11.75 295.1298
+11.8 296.222
+11.85 297.3148
+11.9 298.3905
+11.95 299.4657
+12 300.5284
+12.05 301.5806
+12.1 302.6155
+12.15 303.627
+12.2 304.6122
+12.25 305.5691
+12.3 306.496
+12.35 307.3849
+12.4 308.2383
+12.45 309.0579
+12.5 309.8502
+12.55 310.6218
+12.6 311.3794
+12.65 312.1331
+12.7 312.8864
+12.75 313.6376
+12.8 314.3858
+12.85 315.1235
+12.9 315.8453
+12.95 316.5465
+13 317.2284
+13.05 317.8953
+13.1 318.5577
+13.15 319.2256
+13.2 319.9287
+13.25 320.6812
+13.3 321.4957
+13.35 322.3925
+13.4 323.3737
+13.45 324.4242
+13.5 325.5204
+13.55 326.6222
+13.6 327.6952
+13.65 328.7036
+13.7 329.6008
+13.75 330.3729
+13.8 331.0134
+13.85 331.5248
+13.9 331.9194
+13.95 332.2237
+14 332.4709
+14.05 332.6877
+14.1 332.9031
+14.15 333.135
+14.2 333.402
+14.25 333.7086
+14.3 334.0657
+14.35 334.4631
+14.4 334.8851
+14.45 335.3332
+14.5 335.7972
+14.55 336.2747
+14.6 336.7692
+14.65 337.2764
+14.7 337.8103
+14.75 338.3754
+14.8 338.9748
+14.85 339.5997
+14.9 340.2204
+14.95 340.8373
+15 341.4086
+&
+ at target G0.S7
+ at type xy
+0.05 20
+0.1 20
+0.15 20
+0.2 20
+0.25 20
+0.3 20
+0.35 20
+0.4 20
+0.45 20
+0.5 20
+0.55 20
+0.6 20
+0.65 20
+0.7 20
+0.75 20
+0.8 20
+0.85 20.00001
+0.9 20.00002
+0.95 20.00004
+1 20.00008
+1.05 20.00016
+1.1 20.00031
+1.15 20.0006
+1.2 20.00112
+1.25 20.00205
+1.3 20.00368
+1.35 20.00647
+1.4 20.01113
+1.45 20.01877
+1.5 20.03104
+1.55 20.05034
+1.6 20.08005
+1.65 20.12479
+1.7 20.19078
+1.75 20.286
+1.8 20.42063
+1.85 20.607
+1.9 20.85976
+1.95 21.19603
+2 21.6337
+2.05 22.19238
+2.1 22.89304
+2.15 23.75485
+2.2 24.79522
+2.25 26.03091
+2.3 27.47016
+2.35 29.1141
+2.4 30.97557
+2.45 33.03498
+2.5 35.26712
+2.55 37.72061
+2.6 40.28298
+2.65 42.89054
+2.7 45.8916
+2.75 48.66838
+2.8 51.14335
+2.85 53.26054
+2.9 54.76358
+2.95 56.07986
+3 57.29878
+3.05 58.38556
+3.1 59.33049
+3.15 60.11545
+3.2 60.68643
+3.25 61.04862
+3.3 61.22085
+3.35 61.22677
+3.4 61.10533
+3.45 60.90996
+3.5 60.71217
+3.55 60.55226
+3.6 60.47494
+3.65 60.53086
+3.7 60.73971
+3.75 61.12064
+3.8 61.61015
+3.85 62.23583
+3.9 62.94038
+3.95 63.71562
+4 64.53907
+4.05 65.3929
+4.1 66.22483
+4.15 67.07966
+4.2 67.91831
+4.25 68.72099
+4.3 69.4945
+4.35 70.24376
+4.4 70.9689
+4.45 71.67064
+4.5 72.34933
+4.55 73.00487
+4.6 73.59087
+4.65 74.1681
+4.7 74.69303
+4.75 75.16257
+4.8 75.59581
+4.85 75.98155
+4.9 76.31496
+4.95 76.61567
+5 76.8686
+5.05 77.09267
+5.1 77.27424
+5.15 77.43154
+5.2 77.55125
+5.25 77.65056
+5.3 77.71669
+5.35 77.76484
+5.4 77.78474
+5.45 77.78746
+5.5 77.76823
+5.55 77.73306
+5.6 77.67882
+5.65 77.61298
+5.7 77.53262
+5.75 77.4456
+5.8 77.35178
+5.85 77.25993
+5.9 77.17672
+5.95 77.11509
+6 77.08889
+6.05 77.12696
+6.1 77.24368
+6.15 77.52272
+6.2 78.01458
+6.25 78.75943
+6.3 79.87648
+6.35 81.49775
+6.4 83.77871
+6.45 86.92691
+6.5 91.18597
+6.55 96.81492
+6.6 104.1316
+6.65 113.3857
+6.7 124.6633
+6.75 138.0188
+6.8 153.0737
+6.85 169.1791
+6.9 184.9646
+6.95 199.323
+7 210.2057
+7.05 218.1279
+7.1 221.7758
+7.15 222.2469
+7.2 221.6644
+7.25 220.2757
+7.3 218.2222
+7.35 215.7877
+7.4 213.3766
+7.45 210.9429
+7.5 208.9611
+7.55 207.5275
+7.6 206.6955
+7.65 206.4753
+7.7 206.8289
+7.75 207.6888
+7.8 208.9694
+7.85 210.5628
+7.9 212.3638
+7.95 214.2765
+8 216.2174
+8.05 218.1198
+8.1 219.9309
+8.15 221.6163
+8.2 223.1568
+8.25 224.5488
+8.3 225.7966
+8.35 226.9135
+8.4 227.9157
+8.45 228.819
+8.5 229.6423
+8.55 230.4027
+8.6 231.1172
+8.65 231.8017
+8.7 232.4704
+8.75 233.1318
+8.8 233.7934
+8.85 234.4629
+8.9 235.1466
+8.95 235.8525
+9 236.5895
+9.05 237.3684
+9.1 238.2007
+9.15 239.099
+9.2 240.0742
+9.25 241.1353
+9.3 242.2908
+9.35 243.5417
+9.4 244.8824
+9.45 246.3021
+9.5 247.7837
+9.55 249.2996
+9.6 250.824
+9.65 252.3269
+9.7 253.795
+9.75 255.2165
+9.8 256.5771
+9.85 257.8714
+9.9 259.1002
+9.95 260.2734
+10 261.4002
+10.05 262.5055
+10.1 263.6099
+10.15 264.7408
+10.2 265.9072
+10.25 267.1429
+10.3 268.4583
+10.35 269.8546
+10.4 271.325
+10.45 272.8522
+10.5 274.3979
+10.55 275.911
+10.6 277.3554
+10.65 278.703
+10.7 279.9306
+10.75 281.0334
+10.8 282.0099
+10.85 282.8712
+10.9 283.6385
+10.95 284.3355
+11 284.9907
+11.05 285.6313
+11.1 286.2826
+11.15 286.9687
+11.2 287.7117
+11.25 288.5305
+11.3 289.4393
+11.35 290.4424
+11.4 291.5404
+11.45 292.7284
+11.5 293.9956
+11.55 295.323
+11.6 296.6875
+11.65 298.0616
+11.7 299.4239
+11.75 300.7438
+11.8 301.996
+11.85 303.1668
+11.9 304.2568
+11.95 305.2617
+12 306.186
+12.05 307.0422
+12.1 307.84
+12.15 308.5931
+12.2 309.3161
+12.25 310.0243
+12.3 310.7304
+12.35 311.4458
+12.4 312.1778
+12.45 312.9333
+12.5 313.7139
+12.55 314.5258
+12.6 315.3605
+12.65 316.2127
+12.7 317.0777
+12.75 317.9428
+12.8 318.7962
+12.85 319.6277
+12.9 320.425
+12.95 321.1712
+13 321.8715
+13.05 322.5197
+13.1 323.1155
+13.15 323.6527
+13.2 324.1456
+13.25 324.5948
+13.3 325.0124
+13.35 325.4093
+13.4 325.7996
+13.45 326.1915
+13.5 326.6007
+13.55 327.034
+13.6 327.5005
+13.65 328.0062
+13.7 328.5557
+13.75 329.1385
+13.8 329.7513
+13.85 330.3839
+13.9 331.0239
+13.95 331.6583
+14 332.2758
+14.05 332.8621
+14.1 333.4101
+14.15 333.9072
+14.2 334.3501
+14.25 334.7354
+14.3 335.0611
+14.35 335.341
+14.4 335.5621
+14.45 335.7609
+14.5 335.9271
+14.55 336.0785
+14.6 336.2225
+14.65 336.3648
+14.7 336.5102
+14.75 336.6639
+14.8 336.8304
+14.85 337.0142
+14.9 337.219
+14.95 337.4469
+15 337.6983
+&
+ at target G0.S8
+ at type xy
+0.05 21.87448
+0.1 24.80304
+0.15 28.3831
+0.2 32.39843
+0.25 36.7148
+0.3 41.24174
+0.35 47.0577
+0.4 52.91886
+0.45 58.73529
+0.5 64.44579
+0.55 70.01413
+0.6 75.4281
+0.65 80.6935
+0.7 85.82727
+0.75 90.8539
+0.8 95.80162
+0.85 100.6981
+0.9 105.5688
+0.95 110.4339
+1 115.3096
+1.05 120.2044
+1.1 125.1252
+1.15 130.0725
+1.2 135.0429
+1.25 140.0325
+1.3 145.0361
+1.35 150.0488
+1.4 155.0671
+1.45 160.0867
+1.5 165.1042
+1.55 170.1196
+1.6 175.1301
+1.65 180.1363
+1.7 185.1394
+1.75 190.1393
+1.8 195.137
+1.85 200.1334
+1.9 205.1295
+1.95 210.1257
+2 215.1232
+2.05 220.1204
+2.1 225.1174
+2.15 230.1149
+2.2 235.1141
+2.25 240.1126
+2.3 245.1108
+2.35 250.1087
+2.4 255.1068
+2.45 260.1027
+2.5 265.0978
+2.55 270.0923
+2.6 275.0854
+2.65 280.0775
+2.7 285.071
+2.75 290.0646
+2.8 295.0594
+2.85 300.0547
+2.9 305.0518
+2.95 310.0487
+3 315.0497
+3.05 320.0545
+3.1 325.0626
+3.15 330.0715
+3.2 335.0844
+3.25 340.0989
+3.3 345.1112
+3.35 350.1249
+3.4 355.1394
+3.45 360.154
+3.5 365.17
+3.55 370.1837
+3.6 375.1967
+3.65 380.21
+3.7 385.2255
+3.75 390.2438
+3.8 395.2595
+3.85 400
+3.9 400
+3.95 400
+4 400
+4.05 400
+4.1 400
+4.15 400
+4.2 400
+4.25 400
+4.3 400
+4.35 400
+4.4 400
+4.45 400
+4.5 400
+4.55 400
+4.6 400
+4.65 400
+4.7 400
+4.75 400
+4.8 400
+4.85 400
+4.9 400
+4.95 400
+5 400
+5.05 400
+5.1 400
+5.15 400
+5.2 400
+5.25 400
+5.3 400
+5.35 400
+5.4 400
+5.45 400
+5.5 400
+5.55 400
+5.6 400
+5.65 400
+5.7 400
+5.75 400
+5.8 400
+5.85 400
+5.9 400
+5.95 400
+6 400
+6.05 400
+6.1 400
+6.15 400
+6.2 400
+6.25 400
+6.3 400
+6.35 400
+6.4 400
+6.45 400
+6.5 400
+6.55 400
+6.6 400
+6.65 400
+6.7 400
+6.75 400
+6.8 400
+6.85 400
+6.9 400
+6.95 400
+7 400
+7.05 400
+7.1 400
+7.15 400
+7.2 400
+7.25 400
+7.3 400
+7.35 400
+7.4 400
+7.45 400
+7.5 400
+7.55 400
+7.6 400
+7.65 400
+7.7 400
+7.75 400
+7.8 400
+7.85 400
+7.9 400
+7.95 400
+8 400
+8.05 400
+8.1 400
+8.15 400
+8.2 400
+8.25 400
+8.3 400
+8.35 400
+8.4 400
+8.45 400
+8.5 400
+8.55 400
+8.6 400
+8.65 400
+8.7 400
+8.75 400
+8.8 400
+8.85 400
+8.9 400
+8.95 400
+9 400
+9.05 400
+9.1 400
+9.15 400
+9.2 400
+9.25 400
+9.3 400
+9.35 400
+9.4 400
+9.45 400
+9.5 400
+9.55 400
+9.6 400
+9.65 400
+9.7 400
+9.75 400
+9.8 400
+9.85 400
+9.9 400
+9.95 400
+10 400
+10.05 400
+10.1 400
+10.15 400
+10.2 400
+10.25 400
+10.3 400
+10.35 400
+10.4 400
+10.45 400
+10.5 400
+10.55 400
+10.6 400
+10.65 400
+10.7 400
+10.75 400
+10.8 400
+10.85 400
+10.9 400
+10.95 400
+11 400
+11.05 400
+11.1 400
+11.15 400
+11.2 400
+11.25 400
+11.3 400
+11.35 400
+11.4 400
+11.45 400
+11.5 400
+11.55 400
+11.6 400
+11.65 400
+11.7 400
+11.75 400
+11.8 400
+11.85 400
+11.9 400
+11.95 400
+12 400
+12.05 400
+12.1 400
+12.15 400
+12.2 400
+12.25 400
+12.3 400
+12.35 400
+12.4 400
+12.45 400
+12.5 400
+12.55 400
+12.6 400
+12.65 400
+12.7 400
+12.75 400
+12.8 400
+12.85 400
+12.9 400
+12.95 400
+13 400
+13.05 400
+13.1 400
+13.15 400
+13.2 400
+13.25 400
+13.3 400
+13.35 400
+13.4 400
+13.45 400
+13.5 400
+13.55 400
+13.6 400
+13.65 400
+13.7 400
+13.75 400
+13.8 400
+13.85 400
+13.9 400
+13.95 400
+14 400
+14.05 400
+14.1 400
+14.15 400
+14.2 400
+14.25 400
+14.3 400
+14.35 400
+14.4 400
+14.45 400
+14.5 400
+14.55 400
+14.6 400
+14.65 400
+14.7 400
+14.75 400
+14.8 400
+14.85 400
+14.9 400
+14.95 400
+15 400
+&
+ at target G0.S9
+ at type xy
+15.05 400
+15.1 400
+15.15 400
+15.2 400
+15.25 400
+15.3 400
+15.35 400
+15.4 400
+15.45 400
+15.5 400
+15.55 400
+15.6 400
+15.65 400
+15.7 400
+15.75 400
+15.8 400
+15.85 400
+15.9 400
+15.95 400
+16 400
+16.05 400
+16.1 400
+16.15 400
+16.2 400
+16.25 400
+16.3 400
+16.35 400
+16.4 400
+16.45 400
+16.5 400
+16.55 400
+16.6 400
+16.65 400
+16.7 400
+16.75 400
+16.8 400
+16.85 400
+16.9 400
+16.95 400
+17 400
+17.05 400
+17.1 400
+17.15 400
+17.2 400
+17.25 400
+17.3 400
+17.35 400
+17.4 400
+17.45 400
+17.5 400
+17.55 400
+17.6 400
+17.65 400
+17.7 400
+17.75 400
+17.8 400
+17.85 400
+17.9 400
+17.95 400
+18 400
+18.05 400
+18.1 400
+18.15 400
+18.2 400
+18.25 400
+18.3 400
+18.35 400
+18.4 400
+18.45 400
+18.5 400
+18.55 400
+18.6 400
+18.65 400
+18.7 400
+18.75 400
+18.8 400
+18.85 400
+18.9 400
+18.95 400
+19 400
+19.05 400
+19.1 400
+19.15 400
+19.2 400
+19.25 400
+19.3 400
+19.35 400
+19.4 400
+19.45 400
+19.5 400
+19.55 400
+19.6 400
+19.65 400
+19.7 400
+19.75 400
+19.8 400
+19.85 400
+19.9 400
+19.95 400
+20 400
+20.05 400
+20.1 400
+20.15 400
+20.2 400
+20.25 400
+20.3 400
+20.35 400
+20.4 400
+20.45 400
+20.5 400
+20.55 400
+20.6 400
+20.65 400
+20.7 400
+20.75 400
+20.8 400
+20.85 400
+20.9 400
+20.95 400
+21 400
+21.05 400
+21.1 400
+21.15 400
+21.2 400
+21.25 400
+21.3 400
+21.35 400
+21.4 400
+21.45 400
+21.5 400
+21.55 400
+21.6 400
+21.65 400
+21.7 400
+21.75 400
+21.8 400
+21.85 400
+21.9 400
+21.95 400
+22 400
+22.05 400
+22.1 400
+22.15 400
+22.2 400
+22.25 400
+22.3 400
+22.35 400
+22.4 400
+22.45 400
+22.5 400
+22.55 400
+22.6 400
+22.65 400
+22.7 400
+22.75 400
+22.8 400
+22.85 400
+22.9 400
+22.95 400
+23 400
+23.05 400
+23.1 400
+23.15 400
+23.2 400
+23.25 400
+23.3 400
+23.35 400
+23.4 400
+23.45 400
+23.5 400
+23.55 400
+23.6 400
+23.65 400
+23.7 400
+23.75 400
+23.8 400
+23.85 400
+23.9 400
+23.95 400
+24 400
+24.05 400
+24.1 400
+24.15 400
+24.2 400
+24.25 400
+24.3 400
+24.35 400
+24.4 400
+24.45 400
+24.5 400
+24.55 400
+24.6 400
+24.65 400
+24.7 400
+24.75 400
+24.8 400
+24.85 400
+24.9 400
+24.95 400
+25 400
+25.05 400
+25.1 400
+25.15 400
+25.2 400
+25.25 400
+25.3 400
+25.35 400
+25.4 400
+25.45 400
+25.5 400
+25.55 400
+25.6 400
+25.65 400
+25.7 400
+25.75 400
+25.8 400
+25.85 400
+25.9 400
+25.95 400
+26 400
+26.05 400
+26.1 400
+26.15 400
+26.2 400
+26.25 400
+26.3 400
+26.35 400
+26.4 400
+26.45 400
+26.5 400
+26.55 400
+26.6 400
+26.65 400
+26.7 400
+26.75 400
+26.8 400
+26.85 400
+26.9 400
+26.95 400
+27 400
+27.05 400
+27.1 400
+27.15 400
+27.2 400
+27.25 400
+27.3 400
+27.35 400
+27.4 400
+27.45 400
+27.5 400
+27.55 400
+27.6 400
+27.65 400
+27.7 400
+27.75 400
+27.8 400
+27.85 400
+27.9 400
+27.95 400
+28 400
+28.05 400
+28.1 400
+28.15 400
+28.2 400
+28.25 400
+28.3 400
+28.35 400
+28.4 400
+28.45 400
+28.5 400
+28.55 400
+28.6 400
+28.65 400
+28.7 400
+28.75 400
+28.8 400
+28.85 400
+28.9 400
+28.95 400
+29 400
+29.05 400
+29.1 400
+29.15 400
+29.2 400
+29.25 400
+29.3 400
+29.35 400
+29.4 400
+29.45 400
+29.5 400
+29.55 400
+29.6 400
+29.65 400
+29.7 400
+29.75 400
+29.8 400
+29.85 400
+29.9 400
+29.95 400
+30 400
+30.05 400
+30.1 400
+30.15 400
+30.2 400
+30.25 400
+30.3 400
+30.35 400
+30.4 400
+30.45 400
+30.5 400
+30.55 400
+30.6 400
+30.65 400
+30.7 400
+30.75 400
+30.8 400
+30.85 400
+30.9 400
+30.95 400
+31 400
+31.05 400
+31.1 400
+31.15 400
+31.2 400
+31.25 400
+31.3 400
+31.35 400
+31.4 400
+31.45 400
+31.5 400
+31.55 400
+31.6 400
+31.65 400
+31.7 400
+31.75 400
+31.8 400
+31.85 400
+31.9 400
+31.95 400
+32 400
+32.05 400
+32.1 400
+32.15 400
+32.2 400
+32.25 400
+32.3 400
+32.35 400
+32.4 400
+32.45 400
+32.5 400
+32.55 400
+32.6 400
+32.65 400
+32.7 400
+32.75 400
+32.8 400
+32.85 400
+32.9 400
+32.95 400
+33 400
+33.05 400
+33.1 400
+33.15 400
+33.2 400
+33.25 400
+33.3 400
+33.35 400
+33.4 400
+33.45 400
+33.5 400
+33.55 400
+33.6 400
+33.65 400
+33.7 400
+33.75 400
+33.8 400
+33.85 400
+33.9 400
+33.95 400
+34 400
+34.05 400
+34.1 400
+34.15 400
+34.2 400
+34.25 400
+34.3 400
+34.35 400
+34.4 400
+34.45 400
+34.5 400
+34.55 400
+34.6 400
+34.65 400
+34.7 400
+34.75 400
+34.8 400
+34.85 400
+34.9 400
+34.95 400
+35 400
+&
+ at target G0.S10
+ at type xy
+15.05 399.8833
+15.1 399.7557
+15.15 399.73
+15.2 399.6626
+15.25 399.5363
+15.3 399.3758
+15.35 399.1756
+15.4 399.0652
+15.45 398.8313
+15.5 398.6467
+15.55 398.7962
+15.6 398.9779
+15.65 399.0709
+15.7 399.2433
+15.75 399.4994
+15.8 399.2292
+15.85 399.5434
+15.9 399.7124
+15.95 399.6259
+16 399.8713
+16.05 399.8004
+16.1 399.9135
+16.15 399.8721
+16.2 399.9588
+16.25 399.8819
+16.3 399.9074
+16.35 399.8008
+16.4 399.7898
+16.45 399.7255
+16.5 399.6061
+16.55 399.4882
+16.6 399.4164
+16.65 399.2404
+16.7 399.1344
+16.75 399.0321
+16.8 399.1302
+16.85 399.1689
+16.9 399.1333
+16.95 399.2312
+17 399.2245
+17.05 399.4351
+17.1 399.6276
+17.15 399.4997
+17.2 399.7577
+17.25 399.6978
+17.3 399.847
+17.35 399.7998
+17.4 399.9344
+17.45 399.8962
+17.5 399.8939
+17.55 399.9703
+17.6 399.9126
+17.65 399.8752
+17.7 399.8747
+17.75 399.7233
+17.8 399.6893
+17.85 399.604
+17.9 399.5356
+17.95 399.4148
+18 399.3413
+18.05 399.2656
+18.1 399.3402
+18.15 399.3008
+18.2 399.3264
+18.25 399.3239
+18.3 399.5141
+18.35 399.6839
+18.4 399.4185
+18.45 399.6421
+18.5 399.7847
+18.55 399.7196
+18.6 399.8625
+18.65 399.8167
+18.7 399.9616
+18.75 399.9203
+18.8 399.9248
+18.85 400
+18.9 399.9596
+18.95 399.9398
+19 399.9034
+19.05 399.9371
+19.1 399.8069
+19.15 399.7893
+19.2 399.7511
+19.25 399.6716
+19.3 399.5748
+19.35 399.5093
+19.4 399.4872
+19.45 399.4965
+19.5 399.5038
+19.55 399.4988
+19.6 399.6069
+19.65 399.3898
+19.7 399.619
+19.75 399.7232
+19.8 399.6033
+19.85 399.7932
+19.9 399.724
+19.95 399.8992
+20 399.8553
+20.05 399.9995
+20.1 399.9542
+20.15 399.9776
+20.2 400
+20.25 399.9902
+20.3 399.9594
+20.35 399.957
+20.4 399.9403
+20.45 399.8875
+20.5 399.9089
+20.55 399.7803
+20.6 399.7982
+20.65 399.7414
+20.7 399.685
+20.75 399.6375
+20.8 399.6409
+20.85 399.5967
+20.9 399.5807
+20.95 399.5916
+21 399.6513
+21.05 399.3937
+21.1 399.5415
+21.15 399.6484
+21.2 399.785
+21.25 399.6657
+21.3 399.8369
+21.35 399.7591
+21.4 399.9271
+21.45 399.9164
+21.5 399.9388
+21.55 399.9422
+21.6 399.9806
+21.65 400
+21.7 400
+21.75 400
+21.8 400
+21.85 400
+21.9 399.9763
+21.95 399.9538
+22 399.9153
+22.05 399.8321
+22.1 399.8411
+22.15 399.8115
+22.2 399.6511
+22.25 399.6839
+22.3 399.6617
+22.35 399.6833
+22.4 399.6758
+22.45 399.6722
+22.5 399.6981
+22.55 399.5322
+22.6 399.7076
+22.65 399.8253
+22.7 399.6889
+22.75 399.7917
+22.8 399.7471
+22.85 399.8917
+22.9 399.8633
+22.95 399.8931
+23 399.939
+23.05 399.9828
+23.1 400
+23.15 400
+23.2 400
+23.25 400
+23.3 400
+23.35 400
+23.4 400
+23.45 400
+23.5 400
+23.55 400
+23.6 399.992
+23.65 399.9612
+23.7 399.8998
+23.75 399.8487
+23.8 399.8994
+23.85 399.7858
+23.9 399.8122
+23.95 399.6876
+24 399.7084
+24.05 399.7381
+24.1 399.7293
+24.15 399.5659
+24.2 399.6879
+24.25 399.7502
+24.3 399.638
+24.35 399.7454
+24.4 399.8338
+24.45 399.7456
+24.5 399.9483
+24.55 399.8939
+24.6 399.9039
+24.65 399.942
+24.7 399.9811
+24.75 400
+24.8 400
+24.85 400
+24.9 400
+24.95 400
+25 400
+25.05 400
+25.1 400
+25.15 400
+25.2 400
+25.25 400
+25.3 400
+25.35 400
+25.4 400
+25.45 400
+25.5 400
+25.55 400
+25.6 400
+25.65 400
+25.7 400
+25.75 399.9878
+25.8 399.9501
+25.85 399.9144
+25.9 399.8665
+25.95 399.9279
+26 399.8067
+26.05 399.8495
+26.1 399.7435
+26.15 399.8672
+26.2 399.8123
+26.25 399.9216
+26.3 399.8921
+26.35 399.8597
+26.4 399.9745
+26.45 399.9502
+26.5 399.9781
+26.55 400
+26.6 400
+26.65 400
+26.7 400
+26.75 400
+26.8 400
+26.85 400
+26.9 400
+26.95 400
+27 400
+27.05 400
+27.1 400
+27.15 400
+27.2 400
+27.25 400
+27.3 400
+27.35 400
+27.4 400
+27.45 400
+27.5 400
+27.55 400
+27.6 400
+27.65 400
+27.7 399.9919
+27.75 399.9941
+27.8 399.9891
+27.85 399.9925
+27.9 399.9936
+27.95 400
+28 400
+28.05 400
+28.1 400
+28.15 400
+28.2 400
+28.25 400
+28.3 400
+28.35 400
+28.4 400
+28.45 400
+28.5 400
+28.55 400
+28.6 400
+28.65 400
+28.7 400
+28.75 400
+28.8 400
+28.85 400
+28.9 400
+28.95 400
+29 400
+29.05 400
+29.1 400
+29.15 400
+29.2 400
+29.25 400
+29.3 400
+29.35 400
+29.4 400
+29.45 400
+29.5 400
+29.55 400
+29.6 400
+29.65 400
+29.7 400
+29.75 400
+29.8 400
+29.85 400
+29.9 400
+29.95 400
+30 400
+30.05 400
+30.1 400
+30.15 400
+30.2 400
+30.25 400
+30.3 400
+30.35 400
+30.4 400
+30.45 400
+30.5 400
+30.55 400
+30.6 400
+30.65 400
+30.7 400
+30.75 400
+30.8 400
+30.85 400
+30.9 400
+30.95 400
+31 400
+31.05 400
+31.1 400
+31.15 400
+31.2 400
+31.25 400
+31.3 400
+31.35 400
+31.4 400
+31.45 400
+31.5 400
+31.55 400
+31.6 400
+31.65 400
+31.7 400
+31.75 400
+31.8 400
+31.85 400
+31.9 400
+31.95 400
+32 400
+32.05 400
+32.1 400
+32.15 400
+32.2 400
+32.25 400
+32.3 400
+32.35 400
+32.4 400
+32.45 400
+32.5 400
+32.55 400
+32.6 400
+32.65 400
+32.7 400
+32.75 400
+32.8 400
+32.85 400
+32.9 400
+32.95 400
+33 400
+33.05 400
+33.1 400
+33.15 400
+33.2 400
+33.25 400
+33.3 400
+33.35 400
+33.4 400
+33.45 400
+33.5 400
+33.55 400
+33.6 400
+33.65 400
+33.7 400
+33.75 400
+33.8 400
+33.85 400
+33.9 400
+33.95 400
+34 400
+34.05 400
+34.1 400
+34.15 400
+34.2 400
+34.25 400
+34.3 400
+34.35 400
+34.4 400
+34.45 400
+34.5 400
+34.55 400
+34.6 400
+34.65 400
+34.7 400
+34.75 400
+34.8 400
+34.85 400
+34.9 400
+34.95 400
+35 400
+&
+ at target G0.S11
+ at type xy
+15.05 228.1007
+15.1 228.8404
+15.15 229.6865
+15.2 230.6375
+15.25 231.6699
+15.3 232.7336
+15.35 233.8497
+15.4 234.9258
+15.45 235.9058
+15.5 236.7426
+15.55 237.4413
+15.6 237.9956
+15.65 238.4414
+15.7 238.8024
+15.75 239.1081
+15.8 239.3758
+15.85 239.6215
+15.9 239.8595
+15.95 240.1014
+16 240.3564
+16.05 240.639
+16.1 240.9607
+16.15 241.3346
+16.2 241.7751
+16.25 242.2972
+16.3 242.9169
+16.35 243.6457
+16.4 244.489
+16.45 245.4505
+16.5 246.513
+16.55 247.6302
+16.6 248.7626
+16.65 249.8336
+16.7 250.7608
+16.75 251.5189
+16.8 252.0941
+16.85 252.5165
+16.9 252.8191
+16.95 253.0286
+17 253.1767
+17.05 253.2842
+17.1 253.3736
+17.15 253.4607
+17.2 253.5571
+17.25 253.6731
+17.3 253.8203
+17.35 254.0121
+17.4 254.2595
+17.45 254.5746
+17.5 254.9753
+17.55 255.4745
+17.6 256.0847
+17.65 256.8147
+17.7 257.6632
+17.75 258.6243
+17.8 259.6901
+17.85 260.7863
+17.9 261.8769
+17.95 262.8859
+18 263.7576
+18.05 264.4582
+18.1 264.9847
+18.15 265.3702
+18.2 265.6555
+18.25 265.8632
+18.3 266.0197
+18.35 266.1406
+18.4 266.2407
+18.45 266.3344
+18.5 266.4367
+18.55 266.5593
+18.6 266.707
+18.65 266.8854
+18.7 267.1043
+18.75 267.374
+18.8 267.7042
+18.85 268.0955
+18.9 268.5695
+18.95 269.1361
+19 269.7899
+19.05 270.5374
+19.1 271.3716
+19.15 272.2578
+19.2 273.1991
+19.25 274.1344
+19.3 275.0112
+19.35 275.7809
+19.4 276.4126
+19.45 276.8989
+19.5 277.2607
+19.55 277.5288
+19.6 277.7273
+19.65 277.8721
+19.7 277.9816
+19.75 278.0711
+19.8 278.1536
+19.85 278.2396
+19.9 278.3349
+19.95 278.4506
+20 278.5891
+20.05 278.7614
+20.1 278.9759
+20.15 279.2354
+20.2 279.5568
+20.25 279.9468
+20.3 280.4196
+20.35 280.9844
+20.4 281.646
+20.45 282.407
+20.5 283.2487
+20.55 284.1698
+20.6 285.1068
+20.65 286.0111
+20.7 286.8027
+20.75 287.4527
+20.8 287.9483
+20.85 288.3097
+20.9 288.5744
+20.95 288.7492
+21 288.8657
+21.05 288.9353
+21.1 288.9748
+21.15 288.9951
+21.2 289.0078
+21.25 289.031
+21.3 289.075
+21.35 289.1402
+21.4 289.2328
+21.45 289.358
+21.5 289.5244
+21.55 289.7406
+21.6 290.0171
+21.65 290.3557
+21.7 290.7801
+21.75 291.3026
+21.8 291.9229
+21.85 292.6494
+21.9 293.4743
+21.95 294.3596
+22 295.2765
+22.05 296.2181
+22.1 297.0689
+22.15 297.7917
+22.2 298.3612
+22.25 298.7913
+22.3 299.1083
+22.35 299.3278
+22.4 299.4672
+22.45 299.547
+22.5 299.5819
+22.55 299.5854
+22.6 299.5699
+22.65 299.5565
+22.7 299.5453
+22.75 299.545
+22.8 299.5622
+22.85 299.5994
+22.9 299.6587
+22.95 299.7416
+23 299.8486
+23.05 299.9836
+23.1 300.1514
+23.15 300.3567
+23.2 300.6092
+23.25 300.9189
+23.3 301.2979
+23.35 301.7364
+23.4 302.2695
+23.45 302.8918
+23.5 303.6126
+23.55 304.4146
+23.6 305.2724
+23.65 306.1889
+23.7 307.0554
+23.75 307.8086
+23.8 308.4298
+23.85 308.9175
+23.9 309.2903
+23.95 309.5486
+24 309.7223
+24.05 309.8244
+24.1 309.8698
+24.15 309.873
+24.2 309.8459
+24.25 309.7976
+24.3 309.7424
+24.35 309.6981
+24.4 309.6615
+24.45 309.6398
+24.5 309.6364
+24.55 309.6529
+24.6 309.6891
+24.65 309.7463
+24.7 309.8247
+24.75 309.9271
+24.8 310.0544
+24.85 310.2117
+24.9 310.4015
+24.95 310.6302
+25 310.9044
+25.05 311.2311
+25.1 311.6026
+25.15 312.0407
+25.2 312.5474
+25.25 313.1142
+25.3 313.7387
+25.35 314.3978
+25.4 315.0844
+25.45 315.7968
+25.5 316.4521
+25.55 317.011
+25.6 317.4767
+25.65 317.854
+25.7 318.1424
+25.75 318.3536
+25.8 318.4996
+25.85 318.5916
+25.9 318.6413
+25.95 318.6594
+26 318.6535
+26.05 318.6339
+26.1 318.6145
+26.15 318.5874
+26.2 318.563
+26.25 318.5448
+26.3 318.5358
+26.35 318.5389
+26.4 318.5556
+26.45 318.5856
+26.5 318.6288
+26.55 318.6853
+26.6 318.7546
+26.65 318.8371
+26.7 318.9326
+26.75 319.0422
+26.8 319.1682
+26.85 319.3126
+26.9 319.4775
+26.95 319.6651
+27 319.8796
+27.05 320.1254
+27.1 320.3958
+27.15 320.7022
+27.2 321.0446
+27.25 321.4203
+27.3 321.8309
+27.35 322.2672
+27.4 322.7123
+27.45 323.1462
+27.5 323.5653
+27.55 323.9356
+27.6 324.2453
+27.65 324.5039
+27.7 324.7141
+27.75 324.8815
+27.8 325.0105
+27.85 325.1067
+27.9 325.1737
+27.95 325.218
+28 325.2443
+28.05 325.2575
+28.1 325.2597
+28.15 325.2594
+28.2 325.2559
+28.25 325.2596
+28.3 325.2663
+28.35 325.2769
+28.4 325.2925
+28.45 325.3142
+28.5 325.3423
+28.55 325.3766
+28.6 325.4173
+28.65 325.4643
+28.7 325.5176
+28.75 325.5765
+28.8 325.6413
+28.85 325.7117
+28.9 325.7872
+28.95 325.8676
+29 325.953
+29.05 326.0433
+29.1 326.1389
+29.15 326.2393
+29.2 326.345
+29.25 326.4559
+29.3 326.5726
+29.35 326.6962
+29.4 326.8264
+29.45 326.9638
+29.5 327.109
+29.55 327.26
+29.6 327.4201
+29.65 327.5904
+29.7 327.7721
+29.75 327.9658
+29.8 328.1731
+29.85 328.3942
+29.9 328.6293
+29.95 328.8798
+30 329.1526
+30.05 329.4326
+30.1 329.7158
+30.15 329.9918
+30.2 330.2558
+30.25 330.4924
+30.3 330.697
+30.35 330.8689
+30.4 331.0087
+30.45 331.1191
+30.5 331.2033
+30.55 331.2664
+30.6 331.3092
+30.65 331.3395
+30.7 331.3612
+30.75 331.3799
+30.8 331.3972
+30.85 331.4231
+30.9 331.4499
+30.95 331.4808
+31 331.5179
+31.05 331.5632
+31.1 331.6172
+31.15 331.6809
+31.2 331.7547
+31.25 331.8382
+31.3 331.9313
+31.35 332.0333
+31.4 332.145
+31.45 332.2685
+31.5 332.4055
+31.55 332.5575
+31.6 332.7258
+31.65 332.9136
+31.7 333.1232
+31.75 333.357
+31.8 333.6164
+31.85 333.8954
+31.9 334.1982
+31.95 334.5277
+32 334.875
+32.05 335.2268
+32.1 335.5707
+32.15 335.8796
+32.2 336.1603
+32.25 336.3969
+32.3 336.5911
+32.35 336.7469
+32.4 336.8683
+32.45 336.9604
+32.5 337.026
+32.55 337.0734
+32.6 337.1062
+32.65 337.1282
+32.7 337.1519
+32.75 337.1718
+32.8 337.1927
+32.85 337.2186
+32.9 337.2518
+32.95 337.2941
+33 337.3466
+33.05 337.4104
+33.1 337.4877
+33.15 337.5815
+33.2 337.6937
+33.25 337.8271
+33.3 337.9859
+33.35 338.1749
+33.4 338.3996
+33.45 338.6516
+33.5 338.9555
+33.55 339.3184
+33.6 339.7403
+33.65 340.2308
+33.7 340.789
+33.75 341.4025
+33.8 342.075
+33.85 342.7941
+33.9 343.4637
+33.95 344.0382
+34 344.4848
+34.05 344.8168
+34.1 345.0293
+34.15 345.1535
+34.2 345.2018
+34.25 345.1927
+34.3 345.1442
+34.35 345.063
+34.4 344.9704
+34.45 344.875
+34.5 344.7845
+34.55 344.7095
+34.6 344.6439
+34.65 344.5901
+34.7 344.5483
+34.75 344.5203
+34.8 344.5071
+34.85 344.5089
+34.9 344.5251
+34.95 344.5546
+35 344.5953
+&
+ at target G0.S12
+ at type xy
+15.05 398.7379
+15.1 398.9637
+15.15 399.1565
+15.2 399.3124
+15.25 399.4301
+15.3 399.5098
+15.35 399.5524
+15.4 399.5587
+15.45 399.5289
+15.5 399.4623
+15.55 399.3581
+15.6 399.2167
+15.65 399.0422
+15.7 398.8427
+15.75 398.6316
+15.8 398.427
+15.85 398.2505
+15.9 398.1215
+15.95 398.056
+16 398.0605
+16.05 398.1321
+16.1 398.2593
+16.15 398.4261
+16.2 398.6148
+16.25 398.8094
+16.3 398.9969
+16.35 399.1678
+16.4 399.3169
+16.45 399.4411
+16.5 399.5389
+16.55 399.6096
+16.6 399.6523
+16.65 399.6662
+16.7 399.6504
+16.75 399.6039
+16.8 399.5266
+16.85 399.4192
+16.9 399.285
+16.95 399.1284
+17 398.9584
+17.05 398.7878
+17.1 398.6332
+17.15 398.511
+17.2 398.435
+17.25 398.4118
+17.3 398.4408
+17.35 398.5163
+17.4 398.6297
+17.45 398.77
+17.5 398.9253
+17.55 399.0839
+17.6 399.2357
+17.65 399.3734
+17.7 399.4924
+17.75 399.5905
+17.8 399.6672
+17.85 399.7225
+17.9 399.7568
+17.95 399.7701
+18 399.7623
+18.05 399.733
+18.1 399.6816
+18.15 399.6074
+18.2 399.5105
+18.25 399.3939
+18.3 399.264
+18.35 399.1317
+18.4 399.009
+18.45 398.9078
+18.5 398.8366
+18.55 398.8016
+18.6 398.8057
+18.65 398.8476
+18.7 398.9219
+18.75 399.0201
+18.8 399.1331
+18.85 399.2517
+18.9 399.3689
+18.95 399.479
+19 399.5781
+19.05 399.6636
+19.1 399.7338
+19.15 399.7873
+19.2 399.8238
+19.25 399.8435
+19.3 399.8472
+19.35 399.8355
+19.4 399.8087
+19.45 399.7664
+19.5 399.7084
+19.55 399.6352
+19.6 399.5492
+19.65 399.4545
+19.7 399.3573
+19.75 399.2649
+19.8 399.1853
+19.85 399.1255
+19.9 399.0911
+19.95 399.086
+20 399.111
+20.05 399.1638
+20.1 399.239
+20.15 399.329
+20.2 399.4254
+20.25 399.5212
+20.3 399.6112
+20.35 399.6924
+20.4 399.7626
+20.45 399.8207
+20.5 399.8656
+20.55 399.8973
+20.6 399.9166
+20.65 399.9243
+20.7 399.9216
+20.75 399.909
+20.8 399.8865
+20.85 399.8534
+20.9 399.8085
+20.95 399.7523
+21 399.6855
+21.05 399.6106
+21.1 399.5317
+21.15 399.4541
+21.2 399.3841
+21.25 399.3272
+21.3 399.2878
+21.35 399.2693
+21.4 399.2731
+21.45 399.299
+21.5 399.3452
+21.55 399.4079
+21.6 399.4818
+21.65 399.5611
+21.7 399.6401
+21.75 399.7149
+21.8 399.7822
+21.85 399.84
+21.9 399.887
+21.95 399.9227
+22 399.948
+22.05 399.964
+22.1 399.9722
+22.15 399.9736
+22.2 399.9688
+22.25 399.9578
+22.3 399.9393
+22.35 399.9123
+22.4 399.8762
+22.45 399.8308
+22.5 399.7774
+22.55 399.7185
+22.6 399.6576
+22.65 399.5994
+22.7 399.5482
+22.75 399.508
+22.8 399.4815
+22.85 399.4705
+22.9 399.4758
+22.95 399.4967
+23 399.5315
+23.05 399.5771
+23.1 399.6297
+23.15 399.686
+23.2 399.7427
+23.25 399.7971
+23.3 399.8469
+23.35 399.8904
+23.4 399.9268
+23.45 399.9559
+23.5 399.9775
+23.55 399.9921
+23.6 400
+23.65 400
+23.7 400
+23.75 400
+23.8 400
+23.85 399.9984
+23.9 399.9925
+23.95 399.9817
+24 399.9656
+24.05 399.9432
+24.1 399.9143
+24.15 399.8794
+24.2 399.8395
+24.25 399.7964
+24.3 399.7523
+24.35 399.7103
+24.4 399.6737
+24.45 399.6458
+24.5 399.6289
+24.55 399.6242
+24.6 399.6322
+24.65 399.652
+24.7 399.6821
+24.75 399.7196
+24.8 399.761
+24.85 399.8033
+24.9 399.8439
+24.95 399.8811
+25 399.9144
+25.05 399.943
+25.1 399.9663
+25.15 399.9846
+25.2 399.9975
+25.25 400
+25.3 400
+25.35 400
+25.4 400
+25.45 400
+25.5 400
+25.55 400
+25.6 400
+25.65 400
+25.7 400
+25.75 400
+25.8 400
+25.85 400
+25.9 400
+25.95 399.9996
+26 399.9938
+26.05 399.9841
+26.1 399.9702
+26.15 399.9525
+26.2 399.9319
+26.25 399.9096
+26.3 399.8874
+26.35 399.867
+26.4 399.8504
+26.45 399.8396
+26.5 399.8357
+26.55 399.8392
+26.6 399.8493
+26.65 399.8653
+26.7 399.8851
+26.75 399.907
+26.8 399.929
+26.85 399.9502
+26.9 399.9688
+26.95 399.9842
+27 399.9957
+27.05 400
+27.1 400
+27.15 400
+27.2 400
+27.25 400
+27.3 400
+27.35 400
+27.4 400
+27.45 400
+27.5 400
+27.55 400
+27.6 400
+27.65 400
+27.7 400
+27.75 400
+27.8 400
+27.85 400
+27.9 400
+27.95 400
+28 399.9991
+28.05 399.9978
+28.1 399.9965
+28.15 399.9952
+28.2 399.9949
+28.25 399.9962
+28.3 399.9977
+28.35 400
+28.4 400
+28.45 400
+28.5 400
+28.55 400
+28.6 400
+28.65 400
+28.7 400
+28.75 400
+28.8 400
+28.85 400
+28.9 400
+28.95 400
+29 400
+29.05 400
+29.1 400
+29.15 400
+29.2 400
+29.25 400
+29.3 400
+29.35 400
+29.4 400
+29.45 400
+29.5 400
+29.55 400
+29.6 400
+29.65 400
+29.7 400
+29.75 400
+29.8 400
+29.85 400
+29.9 400
+29.95 400
+30 400
+30.05 400
+30.1 400
+30.15 400
+30.2 400
+30.25 400
+30.3 400
+30.35 400
+30.4 400
+30.45 400
+30.5 400
+30.55 400
+30.6 400
+30.65 400
+30.7 400
+30.75 400
+30.8 400
+30.85 400
+30.9 400
+30.95 400
+31 400
+31.05 400
+31.1 400
+31.15 400
+31.2 400
+31.25 400
+31.3 400
+31.35 400
+31.4 400
+31.45 400
+31.5 400
+31.55 400
+31.6 400
+31.65 400
+31.7 400
+31.75 400
+31.8 400
+31.85 400
+31.9 400
+31.95 400
+32 400
+32.05 400
+32.1 400
+32.15 400
+32.2 400
+32.25 400
+32.3 400
+32.35 400
+32.4 400
+32.45 400
+32.5 400
+32.55 400
+32.6 400
+32.65 400
+32.7 400
+32.75 400
+32.8 400
+32.85 400
+32.9 400
+32.95 400
+33 400
+33.05 400
+33.1 400
+33.15 400
+33.2 400
+33.25 400
+33.3 400
+33.35 400
+33.4 400
+33.45 400
+33.5 400
+33.55 400
+33.6 400
+33.65 400
+33.7 400
+33.75 400
+33.8 400
+33.85 400
+33.9 400
+33.95 400
+34 400
+34.05 400
+34.1 400
+34.15 400
+34.2 400
+34.25 400
+34.3 400
+34.35 400
+34.4 400
+34.45 400
+34.5 400
+34.55 400
+34.6 400
+34.65 400
+34.7 400
+34.75 400
+34.8 400
+34.85 400
+34.9 400
+34.95 400
+35 400
+&
+ at target G0.S13
+ at type xy
+15.05 397.5885
+15.1 397.904
+15.15 398.2372
+15.2 398.5398
+15.25 398.7577
+15.3 398.9592
+15.35 399.1157
+15.4 399.2288
+15.45 399.2756
+15.5 399.2922
+15.55 399.2589
+15.6 399.2063
+15.65 399.1105
+15.7 399.013
+15.75 398.8984
+15.8 398.7564
+15.85 398.5827
+15.9 398.3743
+15.95 398.1672
+16 397.9572
+16.05 397.7875
+16.1 397.6578
+16.15 397.5909
+16.2 397.6177
+16.25 397.7613
+16.3 397.9575
+16.35 398.2265
+16.4 398.5337
+16.45 398.8231
+16.5 398.9749
+16.55 399.1335
+16.6 399.274
+16.65 399.3546
+16.7 399.402
+16.75 399.4065
+16.8 399.3738
+16.85 399.33
+16.9 399.2659
+16.95 399.2057
+17 399.1419
+17.05 399.0287
+17.1 398.891
+17.15 398.7325
+17.2 398.5478
+17.25 398.3575
+17.3 398.1661
+17.35 398.0113
+17.4 397.9081
+17.45 397.9434
+17.5 398.019
+17.55 398.2066
+17.6 398.4419
+17.65 398.7117
+17.7 398.9196
+17.75 399.0841
+17.8 399.2156
+17.85 399.3211
+17.9 399.3918
+17.95 399.4369
+18 399.4645
+18.05 399.4832
+18.1 399.4926
+18.15 399.5283
+18.2 399.5712
+18.25 399.5048
+18.3 399.4287
+18.35 399.3197
+18.4 399.1698
+18.45 398.9802
+18.5 398.769
+18.55 398.5636
+18.6 398.4531
+18.65 398.3745
+18.7 398.3919
+18.75 398.4735
+18.8 398.601
+18.85 398.7251
+18.9 398.8161
+18.95 398.9127
+19 399.0043
+19.05 399.0934
+19.1 399.1874
+19.15 399.2926
+19.2 399.4126
+19.25 399.5455
+19.3 399.6542
+19.35 399.6988
+19.4 399.6951
+19.45 399.6885
+19.5 399.6558
+19.55 399.5923
+19.6 399.5068
+19.65 399.4207
+19.7 399.3258
+19.75 399.2178
+19.8 399.0995
+19.85 398.9715
+19.9 398.8553
+19.95 398.7538
+20 398.6772
+20.05 398.6316
+20.1 398.6281
+20.15 398.6505
+20.2 398.7165
+20.25 398.8208
+20.3 398.9456
+20.35 399.0716
+20.4 399.2055
+20.45 399.326
+20.5 399.3922
+20.55 399.5132
+20.6 399.5937
+20.65 399.6413
+20.7 399.6943
+20.75 399.7347
+20.8 399.7402
+20.85 399.7724
+20.9 399.7697
+20.95 399.7264
+21 399.6807
+21.05 399.6348
+21.1 399.5679
+21.15 399.4903
+21.2 399.407
+21.25 399.3262
+21.3 399.2501
+21.35 399.183
+21.4 399.1332
+21.45 399.1022
+21.5 399.0913
+21.55 399.1008
+21.6 399.1295
+21.65 399.1772
+21.7 399.2423
+21.75 399.318
+21.8 399.4047
+21.85 399.4912
+21.9 399.576
+21.95 399.6543
+22 399.7223
+22.05 399.7814
+22.1 399.8286
+22.15 399.8643
+22.2 399.889
+22.25 399.9023
+22.3 399.9028
+22.35 399.8909
+22.4 399.8709
+22.45 399.8372
+22.5 399.7909
+22.55 399.732
+22.6 399.6622
+22.65 399.5853
+22.7 399.5065
+22.75 399.4314
+22.8 399.3651
+22.85 399.3107
+22.9 399.2742
+22.95 399.2529
+23 399.248
+23.05 399.2597
+23.1 399.2849
+23.15 399.3219
+23.2 399.369
+23.25 399.4256
+23.3 399.4923
+23.35 399.5651
+23.4 399.6427
+23.45 399.716
+23.5 399.785
+23.55 399.8417
+23.6 399.8825
+23.65 399.9151
+23.7 399.9407
+23.75 399.9567
+23.8 399.9642
+23.85 399.9643
+23.9 399.9615
+23.95 399.9563
+24 399.9452
+24.05 399.9354
+24.1 399.915
+24.15 399.889
+24.2 399.8572
+24.25 399.8168
+24.3 399.7647
+24.35 399.6987
+24.4 399.624
+24.45 399.5491
+24.5 399.4941
+24.55 399.4486
+24.6 399.4271
+24.65 399.4393
+24.7 399.4665
+24.75 399.4801
+24.8 399.5097
+24.85 399.5475
+24.9 399.5773
+24.95 399.6066
+25 399.6428
+25.05 399.6833
+25.1 399.7304
+25.15 399.7848
+25.2 399.8478
+25.25 399.9015
+25.3 399.9316
+25.35 399.9533
+25.4 399.9705
+25.45 399.9798
+25.5 399.9798
+25.55 399.9812
+25.6 399.9807
+25.65 399.9785
+25.7 399.9872
+25.75 400
+25.8 399.9956
+25.85 399.9987
+25.9 399.995
+25.95 399.9895
+26 399.9825
+26.05 399.9684
+26.1 399.9496
+26.15 399.9258
+26.2 399.901
+26.25 399.8825
+26.3 399.8687
+26.35 399.8481
+26.4 399.8252
+26.45 399.7987
+26.5 399.7663
+26.55 399.7305
+26.6 399.6972
+26.65 399.6789
+26.7 399.6818
+26.75 399.7059
+26.8 399.75
+26.85 399.7958
+26.9 399.829
+26.95 399.859
+27 399.8888
+27.05 399.9052
+27.1 399.92
+27.15 399.9309
+27.2 399.9395
+27.25 399.9499
+27.3 399.9655
+27.35 399.9891
+27.4 399.9991
+27.45 399.9966
+27.5 399.9985
+27.55 399.9967
+27.6 399.9947
+27.65 399.9911
+27.7 399.9852
+27.75 399.9787
+27.8 399.9721
+27.85 399.9748
+27.9 399.9878
+27.95 399.9848
+28 399.9829
+28.05 399.978
+28.1 399.9719
+28.15 399.9617
+28.2 399.9487
+28.25 399.9338
+28.3 399.9241
+28.35 399.92
+28.4 399.9341
+28.45 399.9561
+28.5 399.967
+28.55 399.9721
+28.6 399.9772
+28.65 399.9776
+28.7 399.9759
+28.75 399.9715
+28.8 399.9663
+28.85 399.9667
+28.9 399.9828
+28.95 400
+29 400
+29.05 399.9998
+29.1 399.9996
+29.15 399.9993
+29.2 399.9963
+29.25 399.9949
+29.3 399.9887
+29.35 399.9814
+29.4 399.9722
+29.45 399.9887
+29.5 400
+29.55 400
+29.6 400
+29.65 399.9997
+29.7 399.9992
+29.75 399.9958
+29.8 399.9931
+29.85 399.9819
+29.9 399.9674
+29.95 399.9754
+30 400
+30.05 400
+30.1 400
+30.15 400
+30.2 399.9997
+30.25 399.998
+30.3 399.9943
+30.35 399.9878
+30.4 399.9741
+30.45 399.9678
+30.5 399.9857
+30.55 400
+30.6 400
+30.65 400
+30.7 400
+30.75 399.9994
+30.8 399.9965
+30.85 399.9923
+30.9 399.9818
+30.95 399.9628
+31 399.9634
+31.05 399.9902
+31.1 400
+31.15 400
+31.2 400
+31.25 400
+31.3 399.9993
+31.35 399.9956
+31.4 399.9921
+31.45 399.9784
+31.5 399.9733
+31.55 399.9794
+31.6 400
+31.65 400
+31.7 400
+31.75 400
+31.8 400
+31.85 399.9982
+31.9 399.9959
+31.95 399.9884
+32 399.9732
+32.05 399.9721
+32.1 399.9917
+32.15 400
+32.2 400
+32.25 400
+32.3 400
+32.35 399.9995
+32.4 399.9966
+32.45 399.9937
+32.5 399.9834
+32.55 399.9795
+32.6 399.984
+32.65 400
+32.7 400
+32.75 400
+32.8 400
+32.85 399.9996
+32.9 399.9976
+32.95 399.9946
+33 399.9863
+33.05 399.9734
+33.1 399.9699
+33.15 399.9907
+33.2 400
+33.25 400
+33.3 399.9999
+33.35 399.9995
+33.4 399.9993
+33.45 399.9965
+33.5 399.9942
+33.55 399.9864
+33.6 399.9832
+33.65 399.9842
+33.7 400
+33.75 400
+33.8 400
+33.85 400
+33.9 400
+33.95 399.9993
+34 399.9977
+34.05 399.9938
+34.1 399.9853
+34.15 399.9846
+34.2 399.9936
+34.25 400
+34.3 400
+34.35 400
+34.4 400
+34.45 400
+34.5 399.9984
+34.55 399.9973
+34.6 399.9903
+34.65 399.9861
+34.7 399.9856
+34.75 400
+34.8 400
+34.85 400
+34.9 400
+34.95 400
+35 399.9991
+&
+ at target G0.S14
+ at type xy
+15.05 334.7814
+15.1 335.0492
+15.15 335.3559
+15.2 335.8087
+15.25 336.4104
+15.3 337.2411
+15.35 338.2547
+15.4 339.3183
+15.45 340.2815
+15.5 341.1319
+15.55 341.8943
+15.6 342.4771
+15.65 342.8093
+15.7 342.9941
+15.75 343.1339
+15.8 343.248
+15.85 343.4327
+15.9 343.7377
+15.95 344.1188
+16 344.6417
+16.05 345.2455
+16.1 345.846
+16.15 346.3653
+16.2 346.7273
+16.25 346.9438
+16.3 346.9555
+16.35 346.7906
+16.4 346.5518
+16.45 346.3396
+16.5 346.2842
+16.55 346.466
+16.6 346.966
+16.65 347.5435
+16.7 348.2998
+16.75 349.2008
+16.8 350.1198
+16.85 351.0571
+16.9 351.8661
+16.95 352.5767
+17 353.1127
+17.05 353.5446
+17.1 353.9501
+17.15 354.2377
+17.2 354.547
+17.25 354.934
+17.3 355.4805
+17.35 356.2344
+17.4 356.9576
+17.45 357.5851
+17.5 358.1153
+17.55 358.4768
+17.6 358.6866
+17.65 358.6782
+17.7 358.6425
+17.75 358.6151
+17.8 358.6992
+17.85 358.8625
+17.9 359.3017
+17.95 360.0207
+18 360.873
+18.05 361.7753
+18.1 362.6573
+18.15 363.3549
+18.2 363.8389
+18.25 364.2049
+18.3 364.4704
+18.35 364.8857
+18.4 365.4568
+18.45 366.1216
+18.5 366.9949
+18.55 367.8999
+18.6 368.8049
+18.65 369.6262
+18.7 370.3702
+18.75 370.9053
+18.8 371.3332
+18.85 371.6922
+18.9 372.0129
+18.95 372.4443
+19 372.9505
+19.05 373.5252
+19.1 374.1869
+19.15 374.805
+19.2 374.6431
+19.25 375.8631
+19.3 375.3964
+19.35 376.2332
+19.4 375.5643
+19.45 375.9691
+19.5 375.9467
+19.55 376.0222
+19.6 376.889
+19.65 377.2788
+19.7 378.2205
+19.75 378.6759
+19.8 379.209
+19.85 379.6964
+19.9 380.1433
+19.95 379.9244
+20 380.0888
+20.05 379.8214
+20.1 379.742
+20.15 379.5362
+20.2 379.2625
+20.25 379.0058
+20.3 378.5243
+20.35 377.899
+20.4 377.2205
+20.45 377.0445
+20.5 376.0356
+20.55 374.8405
+20.6 373.5413
+20.65 372.2444
+20.7 370.3837
+20.75 369.3858
+20.8 368.3526
+20.85 369.0515
+20.9 368.4593
+20.95 367.9624
+21 367.5322
+21.05 367.3229
+21.1 367.3448
+21.15 367.0956
+21.2 366.7161
+21.25 366.3217
+21.3 365.9268
+21.35 365.6116
+21.4 365.3743
+21.45 365.2147
+21.5 365.1406
+21.55 365.075
+21.6 365.0295
+21.65 364.9751
+21.7 364.9115
+21.75 364.7984
+21.8 364.734
+21.85 364.6491
+21.9 364.6171
+21.95 364.5975
+22 364.6314
+22.05 364.7702
+22.1 364.8971
+22.15 365.1098
+22.2 365.3738
+22.25 365.7044
+22.3 366.1111
+22.35 366.5976
+22.4 367.147
+22.45 367.7792
+22.5 368.4824
+22.55 369.1995
+22.6 369.9415
+22.65 370.683
+22.7 371.4235
+22.75 372.1022
+22.8 372.7032
+22.85 373.2176
+22.9 373.6452
+22.95 373.9891
+23 374.2716
+23.05 374.5125
+23.1 374.7348
+23.15 374.9523
+23.2 375.1834
+23.25 375.438
+23.3 375.7302
+23.35 376.0603
+23.4 376.4247
+23.45 376.8161
+23.5 377.2345
+23.55 377.6675
+23.6 378.1171
+23.65 378.5712
+23.7 379.0237
+23.75 379.4757
+23.8 379.9268
+23.85 380.3738
+23.9 380.8196
+23.95 381.2602
+24 381.6945
+24.05 382.1153
+24.1 382.5173
+24.15 382.8957
+24.2 383.2458
+24.25 383.5677
+24.3 383.8607
+24.35 384.1289
+24.4 384.3748
+24.45 384.6028
+24.5 384.8157
+24.55 385.0152
+24.6 385.2038
+24.65 385.3828
+24.7 385.5494
+24.75 385.7067
+24.8 385.853
+24.85 385.9902
+24.9 386.1199
+24.95 386.2436
+25 386.3629
+25.05 386.4782
+25.1 386.5894
+25.15 386.6962
+25.2 386.7967
+25.25 386.8892
+25.3 386.9722
+25.35 387.0471
+25.4 387.1153
+25.45 387.1792
+25.5 387.2423
+25.55 387.3074
+25.6 387.3772
+25.65 387.4522
+25.7 387.5315
+25.75 387.6133
+25.8 387.6948
+25.85 387.7739
+25.9 387.8507
+25.95 387.9256
+26 388.0001
+26.05 388.0765
+26.1 388.1578
+26.15 388.246
+26.2 388.341
+26.25 388.4417
+26.3 388.5459
+26.35 388.6517
+26.4 388.757
+26.45 388.8609
+26.5 388.9633
+26.55 389.0658
+26.6 389.1696
+26.65 389.2758
+26.7 389.3839
+26.75 389.4934
+26.8 389.6032
+26.85 389.7109
+26.9 389.8148
+26.95 389.9133
+27 390.0063
+27.05 390.0956
+27.1 390.1826
+27.15 390.2707
+27.2 390.3611
+27.25 390.4546
+27.3 390.5499
+27.35 390.6477
+27.4 390.7441
+27.45 390.8376
+27.5 390.9262
+27.55 391.0108
+27.6 391.0918
+27.65 391.172
+27.7 391.2532
+27.75 391.3375
+27.8 391.4238
+27.85 391.5123
+27.9 391.6004
+27.95 391.6863
+28 391.767
+28.05 391.8424
+28.1 391.9129
+28.15 391.9816
+28.2 392.0494
+28.25 392.1205
+28.3 392.1953
+28.35 392.2751
+28.4 392.3582
+28.45 392.4419
+28.5 392.5227
+28.55 392.5989
+28.6 392.6686
+28.65 392.7333
+28.7 392.7943
+28.75 392.855
+28.8 392.9175
+28.85 392.9836
+28.9 393.0525
+28.95 393.124
+29 393.195
+29.05 393.2635
+29.1 393.3271
+29.15 393.3862
+29.2 393.4411
+29.25 393.4947
+29.3 393.5492
+29.35 393.6075
+29.4 393.6702
+29.45 393.7373
+29.5 393.806
+29.55 393.8734
+29.6 393.9367
+29.65 393.9942
+29.7 394.0451
+29.75 394.0914
+29.8 394.1355
+29.85 394.1812
+29.9 394.2306
+29.95 394.2856
+30 394.3449
+30.05 394.4072
+30.1 394.4686
+30.15 394.5271
+30.2 394.5808
+30.25 394.6304
+30.3 394.6773
+30.35 394.7248
+30.4 394.7755
+30.45 394.8312
+30.5 394.8919
+30.55 394.956
+30.6 395.0196
+30.65 395.0802
+30.7 395.1352
+30.75 395.185
+30.8 395.2307
+30.85 395.2753
+30.9 395.3227
+30.95 395.3752
+31 395.4357
+31.05 395.5016
+31.1 395.569
+31.15 395.6344
+31.2 395.6933
+31.25 395.7434
+31.3 395.7843
+31.35 395.8186
+31.4 395.8491
+31.45 395.8811
+31.5 395.9168
+31.55 395.9606
+31.6 396.0094
+31.65 396.0618
+31.7 396.1137
+31.75 396.1629
+31.8 396.2074
+31.85 396.2478
+31.9 396.2856
+31.95 396.324
+32 396.365
+32.05 396.4116
+32.1 396.4621
+32.15 396.5143
+32.2 396.5644
+32.25 396.6092
+32.3 396.6462
+32.35 396.6752
+32.4 396.6982
+32.45 396.7186
+32.5 396.7395
+32.55 396.764
+32.6 396.7938
+32.65 396.8283
+32.7 396.8655
+32.75 396.9031
+32.8 396.9383
+32.85 396.9703
+32.9 396.9993
+32.95 397.0273
+33 397.0565
+33.05 397.0884
+33.1 397.1251
+33.15 397.1651
+33.2 397.206
+33.25 397.2446
+33.3 397.2785
+33.35 397.3061
+33.4 397.3278
+33.45 397.3458
+33.5 397.3626
+33.55 397.3812
+33.6 397.4048
+33.65 397.434
+33.7 397.4676
+33.75 397.503
+33.8 397.5374
+33.85 397.5685
+33.9 397.5951
+33.95 397.6175
+34 397.6378
+34.05 397.658
+34.1 397.6805
+34.15 397.7065
+34.2 397.7358
+34.25 397.7665
+34.3 397.7962
+34.35 397.8228
+34.4 397.8447
+34.45 397.8623
+34.5 397.877
+34.55 397.8905
+34.6 397.9055
+34.65 397.9243
+34.7 397.9475
+34.75 397.9737
+34.8 398.0013
+34.85 398.0278
+34.9 398.0516
+34.95 398.0718
+35 398.089
+&
+ at target G0.S15
+ at type xy
+15.05 337.9724
+15.1 338.2657
+15.15 338.5728
+15.2 338.8866
+15.25 339.1986
+15.3 339.4999
+15.35 339.7819
+15.4 340.0373
+15.45 340.2608
+15.5 340.4495
+15.55 340.6043
+15.6 340.7272
+15.65 340.824
+15.7 340.9007
+15.75 340.9659
+15.8 341.0263
+15.85 341.0884
+15.9 341.1588
+15.95 341.2419
+16 341.3386
+16.05 341.4498
+16.1 341.5739
+16.15 341.7089
+16.2 341.851
+16.25 341.9974
+16.3 342.1453
+16.35 342.2927
+16.4 342.4369
+16.45 342.578
+16.5 342.7119
+16.55 342.8371
+16.6 342.9511
+16.65 343.0491
+16.7 343.1298
+16.75 343.1896
+16.8 343.2272
+16.85 343.2421
+16.9 343.2358
+16.95 343.2102
+17 343.1694
+17.05 343.1191
+17.1 343.0652
+17.15 343.0139
+17.2 342.9707
+17.25 342.9405
+17.3 342.9268
+17.35 342.9322
+17.4 342.9569
+17.45 343.0004
+17.5 343.0609
+17.55 343.1362
+17.6 343.2243
+17.65 343.3228
+17.7 343.4299
+17.75 343.5429
+17.8 343.6598
+17.85 343.7783
+17.9 343.8975
+17.95 344.0151
+18 344.1288
+18.05 344.2367
+18.1 344.3418
+18.15 344.4168
+18.2 344.4927
+18.25 344.562
+18.3 344.6211
+18.35 344.6643
+18.4 344.7004
+18.45 344.7339
+18.5 344.7656
+18.55 344.7975
+18.6 344.8344
+18.65 344.8819
+18.7 344.9434
+18.75 345.0193
+18.8 345.1097
+18.85 345.2119
+18.9 345.324
+18.95 345.4454
+19 345.5693
+19.05 345.69
+19.1 345.8022
+19.15 345.8981
+19.2 345.9732
+19.25 346.02
+19.3 346.0313
+19.35 345.9996
+19.4 345.9231
+19.45 345.8
+19.5 345.6342
+19.55 345.4318
+19.6 345.1979
+19.65 344.9425
+19.7 344.6737
+19.75 344.3996
+19.8 344.1272
+19.85 343.8589
+19.9 343.595
+19.95 343.3427
+20 343.1032
+20.05 342.8795
+20.1 342.6761
+20.15 342.4936
+20.2 342.3335
+20.25 342.1959
+20.3 342.0814
+20.35 341.9912
+20.4 341.9235
+20.45 341.8833
+20.5 341.87
+20.55 341.8881
+20.6 341.9401
+20.65 342.0274
+20.7 342.1457
+20.75 342.2966
+20.8 342.4777
+20.85 342.6952
+20.9 342.9362
+20.95 343.2028
+21 343.4881
+21.05 343.7857
+21.1 344.0793
+21.15 344.3885
+21.2 344.6771
+21.25 344.943
+21.3 345.1788
+21.35 345.3981
+21.4 345.5613
+21.45 345.9939
+21.5 346.1374
+21.55 346.5849
+21.6 346.8554
+21.65 347.4449
+21.7 348.1191
+21.75 348.9267
+21.8 349.8542
+21.85 351.1726
+21.9 352.8518
+21.95 354.9174
+22 357.3897
+22.05 360.7465
+22.1 364.506
+22.15 368.5857
+22.2 374.3854
+22.25 380.0773
+22.3 384.937
+22.35 388.9222
+22.4 389.2759
+22.45 389.3755
+22.5 389.1383
+22.55 388.6881
+22.6 387.9987
+22.65 387.052
+22.7 385.7822
+22.75 384.3775
+22.8 383.1983
+22.85 382.2164
+22.9 381.5452
+22.95 381.5383
+23 381.7303
+23.05 382.1148
+23.1 382.5808
+23.15 383.0719
+23.2 383.5846
+23.25 384.0765
+23.3 384.5424
+23.35 384.9777
+23.4 385.3785
+23.45 385.7424
+23.5 386.0709
+23.55 386.3664
+23.6 386.6311
+23.65 386.8685
+23.7 387.0812
+23.75 387.2742
+23.8 387.4511
+23.85 387.6126
+23.9 387.7635
+23.95 387.9092
+24 388.0489
+24.05 388.1901
+24.1 388.3299
+24.15 388.4748
+24.2 388.621
+24.25 388.7746
+24.3 388.9339
+24.35 389.0958
+24.4 389.2628
+24.45 389.4361
+24.5 389.6175
+24.55 389.7978
+24.6 389.9761
+24.65 390.1506
+24.7 390.3236
+24.75 390.4937
+24.8 390.6591
+24.85 390.8185
+24.9 390.9716
+24.95 391.1183
+25 391.2584
+25.05 391.3913
+25.1 391.5165
+25.15 391.6364
+25.2 391.7459
+25.25 391.8561
+25.3 391.9601
+25.35 392.0429
+25.4 392.1456
+25.45 392.2332
+25.5 392.3192
+25.55 392.3857
+25.6 392.4716
+25.65 392.5461
+25.7 392.6121
+25.75 392.6869
+25.8 392.7611
+25.85 392.8217
+25.9 392.9015
+25.95 392.9645
+26 393.0443
+26.05 393.1081
+26.1 393.1852
+26.15 393.246
+26.2 393.3247
+26.25 393.3887
+26.3 393.4534
+26.35 393.5318
+26.4 393.5953
+26.45 393.6717
+26.5 393.7345
+26.55 393.802
+26.6 393.8672
+26.65 393.9333
+26.7 393.9959
+26.75 394.0601
+26.8 394.1208
+26.85 394.1834
+26.9 394.2433
+26.95 394.3035
+27 394.3612
+27.05 394.4192
+27.1 394.4758
+27.15 394.5309
+27.2 394.5843
+27.25 394.637
+27.3 394.6856
+27.35 394.7344
+27.4 394.7818
+27.45 394.8293
+27.5 394.8755
+27.55 394.9222
+27.6 394.9686
+27.65 395.0151
+27.7 395.06
+27.75 395.1058
+27.8 395.1519
+27.85 395.1989
+27.9 395.2453
+27.95 395.2936
+28 395.3427
+28.05 395.3927
+28.1 395.443
+28.15 395.4935
+28.2 395.5424
+28.25 395.5913
+28.3 395.6392
+28.35 395.6866
+28.4 395.7324
+28.45 395.7787
+28.5 395.8244
+28.55 395.8702
+28.6 395.9154
+28.65 395.9601
+28.7 396.0027
+28.75 396.0449
+28.8 396.0858
+28.85 396.1259
+28.9 396.1641
+28.95 396.2024
+29 396.2403
+29.05 396.2783
+29.1 396.3152
+29.15 396.3523
+29.2 396.3888
+29.25 396.4247
+29.3 396.4588
+29.35 396.4927
+29.4 396.526
+29.45 396.559
+29.5 396.5912
+29.55 396.6242
+29.6 396.6573
+29.65 396.691
+29.7 396.7238
+29.75 396.7568
+29.8 396.7892
+29.85 396.8212
+29.9 396.8516
+29.95 396.8819
+30 396.9116
+30.05 396.9412
+30.1 396.9701
+30.15 396.9994
+30.2 397.0283
+30.25 397.0569
+30.3 397.0839
+30.35 397.1106
+30.4 397.1358
+30.45 397.1608
+30.5 397.1849
+30.55 397.2094
+30.6 397.2336
+30.65 397.2588
+30.7 397.2842
+30.75 397.3093
+30.8 397.3344
+30.85 397.3592
+30.9 397.3825
+30.95 397.4056
+31 397.4277
+31.05 397.4502
+31.1 397.4725
+31.15 397.4959
+31.2 397.5195
+31.25 397.5441
+31.3 397.5691
+31.35 397.5942
+31.4 397.6181
+31.45 397.6418
+31.5 397.6643
+31.55 397.6867
+31.6 397.7082
+31.65 397.7301
+31.7 397.752
+31.75 397.7737
+31.8 397.7954
+31.85 397.8171
+31.9 397.8376
+31.95 397.858
+32 397.8775
+32.05 397.897
+32.1 397.9162
+32.15 397.936
+32.2 397.956
+32.25 397.9771
+32.3 397.9988
+32.35 398.0209
+32.4 398.0426
+32.45 398.0644
+32.5 398.0855
+32.55 398.1061
+32.6 398.1255
+32.65 398.1449
+32.7 398.1636
+32.75 398.1826
+32.8 398.2015
+32.85 398.2203
+32.9 398.2382
+32.95 398.2558
+33 398.2724
+33.05 398.2889
+33.1 398.3045
+33.15 398.3204
+33.2 398.336
+33.25 398.3524
+33.3 398.3693
+33.35 398.3868
+33.4 398.404
+33.45 398.4216
+33.5 398.4388
+33.55 398.4557
+33.6 398.4716
+33.65 398.4874
+33.7 398.5025
+33.75 398.5179
+33.8 398.5332
+33.85 398.5487
+33.9 398.564
+33.95 398.5793
+34 398.5943
+34.05 398.6089
+34.1 398.6228
+34.15 398.6365
+34.2 398.6497
+34.25 398.6633
+34.3 398.677
+34.35 398.6911
+34.4 398.7051
+34.45 398.7194
+34.5 398.7336
+34.55 398.7476
+34.6 398.7607
+34.65 398.7737
+34.7 398.786
+34.75 398.7983
+34.8 398.8104
+34.85 398.8226
+34.9 398.8346
+34.95 398.8468
+35 398.8589
+&
+ at target G0.S16
+ at type xy
+15.05 400
+15.1 400
+15.15 400
+15.2 400
+15.25 400
+15.3 400
+15.35 400
+15.4 400
+15.45 400
+15.5 400
+15.55 400
+15.6 400
+15.65 400
+15.7 400
+15.75 400
+15.8 400
+15.85 400
+15.9 400
+15.95 400
+16 400
+16.05 400
+16.1 400
+16.15 400
+16.2 400
+16.25 400
+16.3 400
+16.35 400
+16.4 400
+16.45 400
+16.5 400
+16.55 400
+16.6 400
+16.65 400
+16.7 400
+16.75 400
+16.8 400
+16.85 400
+16.9 400
+16.95 400
+17 400
+17.05 400
+17.1 400
+17.15 400
+17.2 400
+17.25 400
+17.3 400
+17.35 400
+17.4 400
+17.45 400
+17.5 400
+17.55 400
+17.6 400
+17.65 400
+17.7 400
+17.75 400
+17.8 400
+17.85 400
+17.9 400
+17.95 400
+18 400
+18.05 400
+18.1 400
+18.15 400
+18.2 400
+18.25 400
+18.3 400
+18.35 400
+18.4 400
+18.45 400
+18.5 400
+18.55 400
+18.6 400
+18.65 400
+18.7 400
+18.75 400
+18.8 400
+18.85 400
+18.9 400
+18.95 400
+19 400
+19.05 400
+19.1 400
+19.15 400
+19.2 400
+19.25 400
+19.3 400
+19.35 400
+19.4 400
+19.45 400
+19.5 400
+19.55 400
+19.6 400
+19.65 400
+19.7 400
+19.75 400
+19.8 400
+19.85 400
+19.9 400
+19.95 400
+20 400
+20.05 400
+20.1 400
+20.15 400
+20.2 400
+20.25 400
+20.3 400
+20.35 400
+20.4 400
+20.45 400
+20.5 400
+20.55 400
+20.6 400
+20.65 400
+20.7 400
+20.75 400
+20.8 400
+20.85 400
+20.9 400
+20.95 400
+21 400
+21.05 400
+21.1 400
+21.15 400
+21.2 400
+21.25 400
+21.3 400
+21.35 400
+21.4 400
+21.45 400
+21.5 400
+21.55 400
+21.6 400
+21.65 400
+21.7 400
+21.75 400
+21.8 400
+21.85 400
+21.9 400
+21.95 400
+22 400
+22.05 400
+22.1 400
+22.15 400
+22.2 400
+22.25 400
+22.3 400
+22.35 400
+22.4 400
+22.45 400
+22.5 400
+22.55 400
+22.6 400
+22.65 400
+22.7 400
+22.75 400
+22.8 400
+22.85 400
+22.9 400
+22.95 400
+23 400
+23.05 400
+23.1 400
+23.15 400
+23.2 400
+23.25 400
+23.3 400
+23.35 400
+23.4 400
+23.45 400
+23.5 400
+23.55 400
+23.6 400
+23.65 400
+23.7 400
+23.75 400
+23.8 400
+23.85 400
+23.9 400
+23.95 400
+24 400
+24.05 400
+24.1 400
+24.15 400
+24.2 400
+24.25 400
+24.3 400
+24.35 400
+24.4 400
+24.45 400
+24.5 400
+24.55 400
+24.6 400
+24.65 400
+24.7 400
+24.75 400
+24.8 400
+24.85 400
+24.9 400
+24.95 400
+25 400
+25.05 400
+25.1 400
+25.15 400
+25.2 400
+25.25 400
+25.3 400
+25.35 400
+25.4 400
+25.45 400
+25.5 400
+25.55 400
+25.6 400
+25.65 400
+25.7 400
+25.75 400
+25.8 400
+25.85 400
+25.9 400
+25.95 400
+26 400
+26.05 400
+26.1 400
+26.15 400
+26.2 400
+26.25 400
+26.3 400
+26.35 400
+26.4 400
+26.45 400
+26.5 400
+26.55 400
+26.6 400
+26.65 400
+26.7 400
+26.75 400
+26.8 400
+26.85 400
+26.9 400
+26.95 400
+27 400
+27.05 400
+27.1 400
+27.15 400
+27.2 400
+27.25 400
+27.3 400
+27.35 400
+27.4 400
+27.45 400
+27.5 400
+27.55 400
+27.6 400
+27.65 400
+27.7 400
+27.75 400
+27.8 400
+27.85 400
+27.9 400
+27.95 400
+28 400
+28.05 400
+28.1 400
+28.15 400
+28.2 400
+28.25 400
+28.3 400
+28.35 400
+28.4 400
+28.45 400
+28.5 400
+28.55 400
+28.6 400
+28.65 400
+28.7 400
+28.75 400
+28.8 400
+28.85 400
+28.9 400
+28.95 400
+29 400
+29.05 400
+29.1 400
+29.15 400
+29.2 400
+29.25 400
+29.3 400
+29.35 400
+29.4 400
+29.45 400
+29.5 400
+29.55 400
+29.6 400
+29.65 400
+29.7 400
+29.75 400
+29.8 400
+29.85 400
+29.9 400
+29.95 400
+30 400
+30.05 400
+30.1 400
+30.15 400
+30.2 400
+30.25 400
+30.3 400
+30.35 400
+30.4 400
+30.45 400
+30.5 400
+30.55 400
+30.6 400
+30.65 400
+30.7 400
+30.75 400
+30.8 400
+30.85 400
+30.9 400
+30.95 400
+31 400
+31.05 400
+31.1 400
+31.15 400
+31.2 400
+31.25 400
+31.3 400
+31.35 400
+31.4 400
+31.45 400
+31.5 400
+31.55 400
+31.6 400
+31.65 400
+31.7 400
+31.75 400
+31.8 400
+31.85 400
+31.9 400
+31.95 400
+32 400
+32.05 400
+32.1 400
+32.15 400
+32.2 400
+32.25 400
+32.3 400
+32.35 400
+32.4 400
+32.45 400
+32.5 400
+32.55 400
+32.6 400
+32.65 400
+32.7 400
+32.75 400
+32.8 400
+32.85 400
+32.9 400
+32.95 400
+33 400
+33.05 400
+33.1 400
+33.15 400
+33.2 400
+33.25 400
+33.3 400
+33.35 400
+33.4 400
+33.45 400
+33.5 400
+33.55 400
+33.6 400
+33.65 400
+33.7 400
+33.75 400
+33.8 400
+33.85 400
+33.9 400
+33.95 400
+34 400
+34.05 400
+34.1 400
+34.15 400
+34.2 400
+34.25 400
+34.3 400
+34.35 400
+34.4 400
+34.45 400
+34.5 400
+34.55 400
+34.6 400
+34.65 400
+34.7 400
+34.75 400
+34.8 400
+34.85 400
+34.9 400
+34.95 400
+35 400
+&
+ at target G0.S17
+ at type xy
+15.05 341.9238
+15.1 342.3562
+15.15 342.6915
+15.2 342.9151
+15.25 343.0588
+15.3 343.1568
+15.35 343.2187
+15.4 343.2759
+15.45 343.3562
+15.5 343.4934
+15.55 343.6972
+15.6 343.9849
+15.65 344.3355
+15.7 344.7545
+15.75 345.2134
+15.8 345.6927
+15.85 346.1602
+15.9 346.5762
+15.95 346.9293
+16 347.214
+16.05 347.4523
+16.1 347.6464
+16.15 347.8456
+16.2 348.0308
+16.25 348.2214
+16.3 348.4208
+16.35 348.6123
+16.4 348.7865
+16.45 348.9134
+16.5 348.9517
+16.55 348.9462
+16.6 348.8773
+16.65 348.7679
+16.7 348.6348
+16.75 348.5182
+16.8 348.4597
+16.85 348.4792
+16.9 348.6036
+16.95 348.8325
+17 349.1469
+17.05 349.5236
+17.1 349.9177
+17.15 350.2922
+17.2 350.6126
+17.25 350.8496
+17.3 350.9731
+17.35 351.0143
+17.4 350.9899
+17.45 350.9182
+17.5 350.8249
+17.55 350.7291
+17.6 350.638
+17.65 350.538
+17.7 350.4062
+17.75 350.2141
+17.8 349.9364
+17.85 349.556
+17.9 349.0683
+17.95 348.473
+18 347.8156
+18.05 347.1193
+18.1 346.4382
+18.15 345.7786
+18.2 345.1809
+18.25 344.6282
+18.3 344.114
+18.35 343.6216
+18.4 343.1312
+18.45 342.6459
+18.5 342.1215
+18.55 341.5829
+18.6 341.0353
+18.65 340.4864
+18.7 339.9602
+18.75 339.4587
+18.8 338.9861
+18.85 338.5378
+18.9 338.1213
+18.95 337.71
+19 337.3277
+19.05 336.9707
+19.1 336.6468
+19.15 336.3578
+19.2 336.1048
+19.25 335.8871
+19.3 335.7005
+19.35 335.5495
+19.4 335.423
+19.45 335.3118
+19.5 335.2239
+19.55 335.1418
+19.6 335.0482
+19.65 334.9557
+19.7 334.8556
+19.75 334.7621
+19.8 334.684
+19.85 334.6713
+19.9 334.6642
+19.95 334.6762
+20 334.7102
+20.05 334.79
+20.1 334.9265
+20.15 335.1291
+20.2 335.3006
+20.25 335.6466
+20.3 336.0678
+20.35 336.5963
+20.4 337.1942
+20.45 337.8928
+20.5 338.6893
+20.55 339.55
+20.6 340.5326
+20.65 341.6905
+20.7 342.9689
+20.75 344.3855
+20.8 345.9888
+20.85 347.7203
+20.9 349.643
+20.95 351.953
+21 354.5579
+21.05 357.5429
+21.1 360.7829
+21.15 364.3718
+21.2 370.2314
+21.25 375.7451
+21.3 380.7235
+21.35 385.1398
+21.4 387.2479
+21.45 388.178
+21.5 388.6388
+21.55 388.6312
+21.6 388.6671
+21.65 388.3852
+21.7 387.8309
+21.75 386.9997
+21.8 385.1975
+21.85 383.2885
+21.9 381.2079
+21.95 379.056
+22 376.9317
+22.05 374.907
+22.1 373.1643
+22.15 371.9951
+22.2 371.3544
+22.25 371.3107
+22.3 371.4145
+22.35 371.7729
+22.4 372.3151
+22.45 372.9283
+22.5 373.5737
+22.55 374.2826
+22.6 375.0251
+22.65 375.7942
+22.7 376.579
+22.75 377.367
+22.8 378.1458
+22.85 378.9076
+22.9 379.642
+22.95 380.3353
+23 380.9847
+23.05 381.5842
+23.1 382.1243
+23.15 382.6064
+23.2 383.0322
+23.25 383.4026
+23.3 383.7251
+23.35 384.0062
+23.4 384.2509
+23.45 384.4672
+23.5 384.6603
+23.55 384.8387
+23.6 385.0062
+23.65 385.1688
+23.7 385.3295
+23.75 385.4949
+23.8 385.6674
+23.85 385.8502
+23.9 386.046
+23.95 386.2555
+24 386.479
+24.05 386.7155
+24.1 386.9629
+24.15 387.2175
+24.2 387.4758
+24.25 387.7347
+24.3 387.9911
+24.35 388.2417
+24.4 388.4856
+24.45 388.7212
+24.5 388.9487
+24.55 389.1659
+24.6 389.3721
+24.65 389.568
+24.7 389.7518
+24.75 389.9246
+24.8 390.0839
+24.85 390.2311
+24.9 390.3669
+24.95 390.4926
+25 390.6095
+25.05 390.719
+25.1 390.8225
+25.15 390.9208
+25.2 391.0144
+25.25 391.1008
+25.3 391.1828
+25.35 391.2576
+25.4 391.327
+25.45 391.3901
+25.5 391.4497
+25.55 391.5057
+25.6 391.5622
+25.65 391.6188
+25.7 391.6784
+25.75 391.7394
+25.8 391.8033
+25.85 391.8665
+25.9 391.9306
+25.95 391.9924
+26 392.0538
+26.05 392.1141
+26.1 392.1759
+26.15 392.238
+26.2 392.3031
+26.25 392.3688
+26.3 392.4378
+26.35 392.5071
+26.4 392.5775
+26.45 392.6453
+26.5 392.7129
+26.55 392.7785
+26.6 392.8441
+26.65 392.9081
+26.7 392.9747
+26.75 393.0428
+26.8 393.1116
+26.85 393.1823
+26.9 393.2512
+26.95 393.318
+27 393.3822
+27.05 393.4417
+27.1 393.4994
+27.15 393.554
+27.2 393.608
+27.25 393.6604
+27.3 393.7152
+27.35 393.7714
+27.4 393.8282
+27.45 393.8864
+27.5 393.9439
+27.55 393.9995
+27.6 394.055
+27.65 394.1094
+27.7 394.165
+27.75 394.2206
+27.8 394.2795
+27.85 394.3396
+27.9 394.4016
+27.95 394.4645
+28 394.5268
+28.05 394.5873
+28.1 394.6451
+28.15 394.6997
+28.2 394.752
+28.25 394.8031
+28.3 394.8543
+28.35 394.9064
+28.4 394.9596
+28.45 395.0129
+28.5 395.0669
+28.55 395.1188
+28.6 395.169
+28.65 395.217
+28.7 395.2612
+28.75 395.3044
+28.8 395.3465
+28.85 395.3894
+28.9 395.4322
+28.95 395.4766
+29 395.522
+29.05 395.5661
+29.1 395.6091
+29.15 395.6503
+29.2 395.6883
+29.25 395.7254
+29.3 395.7613
+29.35 395.7977
+29.4 395.8345
+29.45 395.8735
+29.5 395.9148
+29.55 395.9564
+29.6 395.9978
+29.65 396.0382
+29.7 396.0753
+29.75 396.1109
+29.8 396.1443
+29.85 396.1772
+29.9 396.2091
+29.95 396.2425
+30 396.2769
+30.05 396.3115
+30.1 396.3462
+30.15 396.3802
+30.2 396.4116
+30.25 396.442
+30.3 396.4706
+30.35 396.4989
+30.4 396.5269
+30.45 396.5566
+30.5 396.5889
+30.55 396.6222
+30.6 396.6564
+30.65 396.6903
+30.7 396.7236
+30.75 396.7545
+30.8 396.7836
+30.85 396.8112
+30.9 396.8383
+30.95 396.8661
+31 396.8956
+31.05 396.9276
+31.1 396.9616
+31.15 396.9969
+31.2 397.0321
+31.25 397.0665
+31.3 397.0982
+31.35 397.1274
+31.4 397.1542
+31.45 397.1801
+31.5 397.2052
+31.55 397.2307
+31.6 397.2569
+31.65 397.284
+31.7 397.3113
+31.75 397.3382
+31.8 397.3639
+31.85 397.3886
+31.9 397.4125
+31.95 397.4363
+32 397.4609
+32.05 397.4875
+32.1 397.5161
+32.15 397.5467
+32.2 397.5785
+32.25 397.6104
+32.3 397.6409
+32.35 397.6696
+32.4 397.6955
+32.45 397.7191
+32.5 397.741
+32.55 397.762
+32.6 397.7828
+32.65 397.804
+32.7 397.8255
+32.75 397.8469
+32.8 397.8675
+32.85 397.8872
+32.9 397.9059
+32.95 397.9239
+33 397.9417
+33.05 397.9605
+33.1 397.981
+33.15 398.0038
+33.2 398.0284
+33.25 398.0538
+33.3 398.0793
+33.35 398.1036
+33.4 398.1262
+33.45 398.1462
+33.5 398.1643
+33.55 398.1814
+33.6 398.1979
+33.65 398.2148
+33.7 398.2324
+33.75 398.2509
+33.8 398.2698
+33.85 398.2887
+33.9 398.3069
+33.95 398.324
+34 398.3403
+34.05 398.3561
+34.1 398.3722
+34.15 398.3889
+34.2 398.4067
+34.25 398.4254
+34.3 398.4446
+34.35 398.4637
+34.4 398.482
+34.45 398.4989
+34.5 398.5142
+34.55 398.528
+34.6 398.5413
+34.65 398.5544
+34.7 398.568
+34.75 398.5823
+34.8 398.5974
+34.85 398.6128
+34.9 398.6279
+34.95 398.6425
+35 398.6562
+&
diff --git a/doc/tutorial/graphics/evotemp_case3.png b/doc/tutorial/graphics/evotemp_case3.png
new file mode 100644
index 0000000..1c6b7bc
Binary files /dev/null and b/doc/tutorial/graphics/evotemp_case3.png differ
diff --git a/doc/tutorial/graphics/fig01.jpg b/doc/tutorial/graphics/fig01.jpg
new file mode 100644
index 0000000..dcd9e1c
Binary files /dev/null and b/doc/tutorial/graphics/fig01.jpg differ
diff --git a/doc/tutorial/graphics/fig02.jpg b/doc/tutorial/graphics/fig02.jpg
new file mode 100644
index 0000000..15fb265
Binary files /dev/null and b/doc/tutorial/graphics/fig02.jpg differ
diff --git a/doc/tutorial/graphics/fig03.jpg b/doc/tutorial/graphics/fig03.jpg
new file mode 100644
index 0000000..73bb696
Binary files /dev/null and b/doc/tutorial/graphics/fig03.jpg differ
diff --git a/doc/tutorial/graphics/fig04.jpg b/doc/tutorial/graphics/fig04.jpg
new file mode 100644
index 0000000..614afc2
Binary files /dev/null and b/doc/tutorial/graphics/fig04.jpg differ
diff --git a/doc/tutorial/graphics/fig05.jpg b/doc/tutorial/graphics/fig05.jpg
new file mode 100644
index 0000000..96eb327
Binary files /dev/null and b/doc/tutorial/graphics/fig05.jpg differ
diff --git a/doc/tutorial/graphics/fig06.jpg b/doc/tutorial/graphics/fig06.jpg
new file mode 100644
index 0000000..52661e4
Binary files /dev/null and b/doc/tutorial/graphics/fig06.jpg differ
diff --git a/doc/tutorial/graphics/fig07.jpg b/doc/tutorial/graphics/fig07.jpg
new file mode 100644
index 0000000..2e07d69
Binary files /dev/null and b/doc/tutorial/graphics/fig07.jpg differ
diff --git a/doc/tutorial/graphics/fig08.jpg b/doc/tutorial/graphics/fig08.jpg
new file mode 100644
index 0000000..a8545c1
Binary files /dev/null and b/doc/tutorial/graphics/fig08.jpg differ
diff --git a/doc/tutorial/graphics/fig09.jpg b/doc/tutorial/graphics/fig09.jpg
new file mode 100644
index 0000000..7720572
Binary files /dev/null and b/doc/tutorial/graphics/fig09.jpg differ
diff --git a/doc/tutorial/graphics/moytemp.png b/doc/tutorial/graphics/moytemp.png
new file mode 100644
index 0000000..28cb4b7
Binary files /dev/null and b/doc/tutorial/graphics/moytemp.png differ
diff --git a/doc/tutorial/graphics/probe9.agr b/doc/tutorial/graphics/probe9.agr
new file mode 100644
index 0000000..5bf4c5b
--- /dev/null
+++ b/doc/tutorial/graphics/probe9.agr
@@ -0,0 +1,701 @@
+# Grace project file
+#
+ at version 50118
+ at page size 792, 612
+ at page scroll 5%
+ at page inout 5%
+ at link page off
+ at map font 8 to "Courier", "Courier"
+ at map font 10 to "Courier-Bold", "Courier-Bold"
+ at map font 11 to "Courier-BoldOblique", "Courier-BoldOblique"
+ at map font 9 to "Courier-Oblique", "Courier-Oblique"
+ at map font 4 to "Helvetica", "Helvetica"
+ at map font 6 to "Helvetica-Bold", "Helvetica-Bold"
+ at map font 7 to "Helvetica-BoldOblique", "Helvetica-BoldOblique"
+ at map font 15 to "Helvetica-Narrow", "Helvetica-Narrow"
+ at map font 16 to "Helvetica-Narrow-Bold", "Helvetica-Narrow-Bold"
+ at map font 17 to "Helvetica-Narrow-BoldOblique", "Helvetica-Narrow-BoldOblique"
+ at map font 18 to "Helvetica-Narrow-Oblique", "Helvetica-Narrow-Oblique"
+ at map font 5 to "Helvetica-Oblique", "Helvetica-Oblique"
+ at map font 20 to "NewCenturySchlbk-Bold", "NewCenturySchlbk-Bold"
+ at map font 21 to "NewCenturySchlbk-BoldItalic", "NewCenturySchlbk-BoldItalic"
+ at map font 22 to "NewCenturySchlbk-Italic", "NewCenturySchlbk-Italic"
+ at map font 23 to "NewCenturySchlbk-Roman", "NewCenturySchlbk-Roman"
+ at map font 24 to "Palatino-Bold", "Palatino-Bold"
+ at map font 25 to "Palatino-BoldItalic", "Palatino-BoldItalic"
+ at map font 26 to "Palatino-Italic", "Palatino-Italic"
+ at map font 27 to "Palatino-Roman", "Palatino-Roman"
+ at map font 12 to "Symbol", "Symbol"
+ at map font 2 to "Times-Bold", "Times-Bold"
+ at map font 3 to "Times-BoldItalic", "Times-BoldItalic"
+ at map font 1 to "Times-Italic", "Times-Italic"
+ at map font 0 to "Times-Roman", "Times-Roman"
+ at map font 33 to "ZapfChancery-MediumItalic", "ZapfChancery-MediumItalic"
+ at map font 13 to "ZapfDingbats", "ZapfDingbats"
+ at map font 35 to "LMCaps10-Italic", "LMCaps10-Italic"
+ at map font 36 to "LMCaps10-Regular", "LMCaps10-Regular"
+ at map font 37 to "LMRoman10-Bold", "LMRoman10-Bold"
+ at map font 38 to "LMRoman10-BoldItalic", "LMRoman10-BoldItalic"
+ at map font 39 to "LMRoman10-Italic", "LMRoman10-Italic"
+ at map font 40 to "LMRoman10-Regular", "LMRoman10-Regular"
+ at map font 41 to "LMRomanDemi10-Italic", "LMRomanDemi10-Italic"
+ at map font 42 to "LMRomanDemi10-Regular", "LMRomanDemi10-Regular"
+ at map font 43 to "LMSans10-Bold", "LMSans10-Bold"
+ at map font 44 to "LMSans10-BoldItalic", "LMSans10-BoldItalic"
+ at map font 45 to "LMSans10-Italic", "LMSans10-Italic"
+ at map font 46 to "LMSans10-Regular", "LMSans10-Regular"
+ at map font 47 to "LMSansDemiCond10-Italic", "LMSansDemiCond10-Italic"
+ at map font 48 to "LMSansDemiCond10-Regular", "LMSansDemiCond10-Regular"
+ at map font 49 to "LMSlanted10-BoldItalic", "LMSlanted10-BoldItalic"
+ at map font 50 to "LMSlanted10-Italic", "LMSlanted10-Italic"
+ at map font 51 to "LMTypewriter10", "LMTypewriter10"
+ at map font 52 to "LMTypewriter10-Italic", "LMTypewriter10-Italic"
+ at map font 53 to "LMTypewriterCaps10-Regular", "LMTypewriterCaps10-Regular"
+ at map font 54 to "LMTypewriterSlanted10-Italic", "LMTypewriterSlanted10-Italic"
+ at map font 55 to "LMTypewriterVarWd10", "LMTypewriterVarWd10"
+ at map font 56 to "LMTypewriterVarWd10-Italic", "LMTypewriterVarWd10-Italic"
+ at map font 57 to "TeX-tipa10", "TeX-tipa10"
+ at map font 58 to "TeX-tipa12", "TeX-tipa12"
+ at map font 59 to "TeX-tipa17", "TeX-tipa17"
+ at map font 60 to "TeX-tipa8", "TeX-tipa8"
+ at map font 61 to "TeX-tipa9", "TeX-tipa9"
+ at map font 62 to "TeX-tipab10", "TeX-tipab10"
+ at map font 63 to "TeX-tipabs10", "TeX-tipabs10"
+ at map font 64 to "TeX-tipabx10", "TeX-tipabx10"
+ at map font 65 to "TeX-tipabx12", "TeX-tipabx12"
+ at map font 66 to "TeX-tipabx8", "TeX-tipabx8"
+ at map font 67 to "TeX-tipabx9", "TeX-tipabx9"
+ at map font 68 to "TeX-tipasb10", "TeX-tipasb10"
+ at map font 69 to "TeX-tipasi10", "TeX-tipasi10"
+ at map font 70 to "TeX-tipasl10", "TeX-tipasl10"
+ at map font 71 to "TeX-tipasl12", "TeX-tipasl12"
+ at map font 72 to "TeX-tipasl8", "TeX-tipasl8"
+ at map font 73 to "TeX-tipasl9", "TeX-tipasl9"
+ at map font 74 to "TeX-tipass10", "TeX-tipass10"
+ at map font 75 to "TeX-tipass12", "TeX-tipass12"
+ at map font 76 to "TeX-tipass17", "TeX-tipass17"
+ at map font 77 to "TeX-tipass8", "TeX-tipass8"
+ at map font 78 to "TeX-tipass9", "TeX-tipass9"
+ at map font 79 to "TeX-tipats10", "TeX-tipats10"
+ at map font 80 to "TeX-tipatt10", "TeX-tipatt10"
+ at map font 81 to "TeX-tipatt12", "TeX-tipatt12"
+ at map font 82 to "TeX-tipatt8", "TeX-tipatt8"
+ at map font 83 to "TeX-tipatt9", "TeX-tipatt9"
+ at map font 84 to "TeX-tipx10", "TeX-tipx10"
+ at map font 85 to "TeX-tipx12", "TeX-tipx12"
+ at map font 86 to "TeX-tipx17", "TeX-tipx17"
+ at map font 87 to "TeX-tipx8", "TeX-tipx8"
+ at map font 88 to "TeX-tipx9", "TeX-tipx9"
+ at map font 89 to "TeX-tipxb10", "TeX-tipxb10"
+ at map font 90 to "TeX-tipxbs10", "TeX-tipxbs10"
+ at map font 91 to "TeX-tipxbx10", "TeX-tipxbx10"
+ at map font 92 to "TeX-tipxbx12", "TeX-tipxbx12"
+ at map font 93 to "TeX-tipxbx8", "TeX-tipxbx8"
+ at map font 94 to "TeX-tipxbx9", "TeX-tipxbx9"
+ at map font 95 to "TeX-tipxsb10", "TeX-tipxsb10"
+ at map font 96 to "TeX-tipxsi10", "TeX-tipxsi10"
+ at map font 97 to "TeX-tipxsl10", "TeX-tipxsl10"
+ at map font 98 to "TeX-tipxsl12", "TeX-tipxsl12"
+ at map font 99 to "TeX-tipxsl8", "TeX-tipxsl8"
+ at map font 100 to "TeX-tipxsl9", "TeX-tipxsl9"
+ at map font 101 to "TeX-tipxss10", "TeX-tipxss10"
+ at map font 102 to "TeX-tipxss12", "TeX-tipxss12"
+ at map font 103 to "TeX-tipxss17", "TeX-tipxss17"
+ at map font 104 to "TeX-tipxss8", "TeX-tipxss8"
+ at map font 105 to "TeX-tipxss9", "TeX-tipxss9"
+ at map font 106 to "TeX-tipxts10", "TeX-tipxts10"
+ at map font 107 to "TeX-tipxtt10", "TeX-tipxtt10"
+ at map font 108 to "TeX-tipxtt12", "TeX-tipxtt12"
+ at map font 109 to "TeX-tipxtt8", "TeX-tipxtt8"
+ at map font 110 to "TeX-tipxtt9", "TeX-tipxtt9"
+ at map font 111 to "TeX-xipa10", "TeX-xipa10"
+ at map font 112 to "TeX-xipab10", "TeX-xipab10"
+ at map font 113 to "TeX-xipabs10", "TeX-xipabs10"
+ at map font 114 to "TeX-xipasb10", "TeX-xipasb10"
+ at map font 115 to "TeX-xipasi10", "TeX-xipasi10"
+ at map font 116 to "TeX-xipasl10", "TeX-xipasl10"
+ at map font 117 to "TeX-xipass10", "TeX-xipass10"
+ at map font 118 to "TeX-xipx10", "TeX-xipx10"
+ at map font 119 to "TeX-xipxb10", "TeX-xipxb10"
+ at map font 120 to "TeX-xipxbs10", "TeX-xipxbs10"
+ at map font 121 to "TeX-xipxsb10", "TeX-xipxsb10"
+ at map font 122 to "TeX-xipxsi10", "TeX-xipxsi10"
+ at map font 123 to "TeX-xipxsl10", "TeX-xipxsl10"
+ at map font 124 to "TeX-xipxss10", "TeX-xipxss10"
+ at map color 0 to (255, 255, 255), "white"
+ at map color 1 to (0, 0, 0), "black"
+ at map color 2 to (255, 0, 0), "red"
+ at map color 3 to (0, 255, 0), "green"
+ at map color 4 to (0, 0, 255), "blue"
+ at map color 5 to (255, 255, 0), "yellow"
+ at map color 6 to (188, 143, 143), "brown"
+ at map color 7 to (220, 220, 220), "grey"
+ at map color 8 to (148, 0, 211), "violet"
+ at map color 9 to (0, 255, 255), "cyan"
+ at map color 10 to (255, 0, 255), "magenta"
+ at map color 11 to (255, 165, 0), "orange"
+ at map color 12 to (114, 33, 188), "indigo"
+ at map color 13 to (103, 7, 72), "maroon"
+ at map color 14 to (64, 224, 208), "turquoise"
+ at map color 15 to (0, 139, 0), "green4"
+ at reference date 0
+ at date wrap off
+ at date wrap year 1950
+ at default linewidth 1.0
+ at default linestyle 1
+ at default color 1
+ at default pattern 1
+ at default font 0
+ at default char size 1.000000
+ at default symbol size 1.000000
+ at default sformat "%.8g"
+ at background color 0
+ at page background fill on
+ at timestamp off
+ at timestamp 0.03, 0.03
+ at timestamp color 1
+ at timestamp rot 0
+ at timestamp font 0
+ at timestamp char size 1.000000
+ at timestamp def "Wed Sep 5 18:03:42 2007"
+ at r0 off
+ at link r0 to g0
+ at r0 type above
+ at r0 linestyle 1
+ at r0 linewidth 1.0
+ at r0 color 1
+ at r0 line 0, 0, 0, 0
+ at r1 off
+ at link r1 to g0
+ at r1 type above
+ at r1 linestyle 1
+ at r1 linewidth 1.0
+ at r1 color 1
+ at r1 line 0, 0, 0, 0
+ at r2 off
+ at link r2 to g0
+ at r2 type above
+ at r2 linestyle 1
+ at r2 linewidth 1.0
+ at r2 color 1
+ at r2 line 0, 0, 0, 0
+ at r3 off
+ at link r3 to g0
+ at r3 type above
+ at r3 linestyle 1
+ at r3 linewidth 1.0
+ at r3 color 1
+ at r3 line 0, 0, 0, 0
+ at r4 off
+ at link r4 to g0
+ at r4 type above
+ at r4 linestyle 1
+ at r4 linewidth 1.0
+ at r4 color 1
+ at r4 line 0, 0, 0, 0
+ at g0 on
+ at g0 hidden false
+ at g0 type XY
+ at g0 stacked false
+ at g0 bar hgap 0.000000
+ at g0 fixedpoint off
+ at g0 fixedpoint type 0
+ at g0 fixedpoint xy 0.000000, 0.000000
+ at g0 fixedpoint format general general
+ at g0 fixedpoint prec 6, 6
+ at with g0
+@ world 0, 0, 15, 410
+@ stack world 0, 0, 0, 0
+@ znorm 1
+@ view 0.150000, 0.150000, 1.150000, 0.850000
+@ title ""
+@ title font 0
+@ title size 1.500000
+@ title color 1
+@ subtitle ""
+@ subtitle font 0
+@ subtitle size 1.000000
+@ subtitle color 1
+@ xaxes scale Normal
+@ yaxes scale Normal
+@ xaxes invert off
+@ yaxes invert off
+@ xaxis on
+@ xaxis type zero false
+@ xaxis offset 0.000000 , 0.000000
+@ xaxis bar on
+@ xaxis bar color 1
+@ xaxis bar linestyle 1
+@ xaxis bar linewidth 1.0
+@ xaxis label "Time (s)"
+@ xaxis label layout para
+@ xaxis label place auto
+@ xaxis label char size 1.000000
+@ xaxis label font 0
+@ xaxis label color 1
+@ xaxis label place normal
+@ xaxis tick on
+@ xaxis tick major 1
+@ xaxis tick minor ticks 1
+@ xaxis tick default 6
+@ xaxis tick place rounded true
+@ xaxis tick in
+@ xaxis tick major size 1.000000
+@ xaxis tick major color 1
+@ xaxis tick major linewidth 1.0
+@ xaxis tick major linestyle 1
+@ xaxis tick major grid off
+@ xaxis tick minor color 1
+@ xaxis tick minor linewidth 1.0
+@ xaxis tick minor linestyle 1
+@ xaxis tick minor grid off
+@ xaxis tick minor size 0.500000
+@ xaxis ticklabel on
+@ xaxis ticklabel format general
+@ xaxis ticklabel prec 5
+@ xaxis ticklabel formula ""
+@ xaxis ticklabel append ""
+@ xaxis ticklabel prepend ""
+@ xaxis ticklabel angle 0
+@ xaxis ticklabel skip 0
+@ xaxis ticklabel stagger 0
+@ xaxis ticklabel place normal
+@ xaxis ticklabel offset auto
+@ xaxis ticklabel offset 0.000000 , 0.010000
+@ xaxis ticklabel start type auto
+@ xaxis ticklabel start 0.000000
+@ xaxis ticklabel stop type auto
+@ xaxis ticklabel stop 0.000000
+@ xaxis ticklabel char size 1.000000
+@ xaxis ticklabel font 0
+@ xaxis ticklabel color 1
+@ xaxis tick place both
+@ xaxis tick spec type none
+@ yaxis on
+@ yaxis type zero false
+@ yaxis offset 0.000000 , 0.000000
+@ yaxis bar on
+@ yaxis bar color 1
+@ yaxis bar linestyle 1
+@ yaxis bar linewidth 1.0
+@ yaxis label "Temperatue (�C)"
+@ yaxis label layout para
+@ yaxis label place auto
+@ yaxis label char size 1.000000
+@ yaxis label font 0
+@ yaxis label color 1
+@ yaxis label place normal
+@ yaxis tick on
+@ yaxis tick major 25
+@ yaxis tick minor ticks 1
+@ yaxis tick default 6
+@ yaxis tick place rounded true
+@ yaxis tick in
+@ yaxis tick major size 1.000000
+@ yaxis tick major color 1
+@ yaxis tick major linewidth 1.0
+@ yaxis tick major linestyle 1
+@ yaxis tick major grid off
+@ yaxis tick minor color 1
+@ yaxis tick minor linewidth 1.0
+@ yaxis tick minor linestyle 1
+@ yaxis tick minor grid off
+@ yaxis tick minor size 0.500000
+@ yaxis ticklabel on
+@ yaxis ticklabel format general
+@ yaxis ticklabel prec 5
+@ yaxis ticklabel formula ""
+@ yaxis ticklabel append ""
+@ yaxis ticklabel prepend ""
+@ yaxis ticklabel angle 0
+@ yaxis ticklabel skip 0
+@ yaxis ticklabel stagger 0
+@ yaxis ticklabel place normal
+@ yaxis ticklabel offset auto
+@ yaxis ticklabel offset 0.000000 , 0.010000
+@ yaxis ticklabel start type auto
+@ yaxis ticklabel start 0.000000
+@ yaxis ticklabel stop type auto
+@ yaxis ticklabel stop 0.000000
+@ yaxis ticklabel char size 1.000000
+@ yaxis ticklabel font 0
+@ yaxis ticklabel color 1
+@ yaxis tick place both
+@ yaxis tick spec type none
+@ altxaxis off
+@ altyaxis off
+@ legend on
+@ legend loctype view
+@ legend 0.7, 0.6
+@ legend box color 1
+@ legend box pattern 1
+@ legend box linewidth 1.0
+@ legend box linestyle 1
+@ legend box fill color 0
+@ legend box fill pattern 1
+@ legend font 0
+@ legend char size 1.000000
+@ legend color 1
+@ legend length 4
+@ legend vgap 1
+@ legend hgap 1
+@ legend invert false
+@ frame type 0
+@ frame linestyle 1
+@ frame linewidth 1.0
+@ frame color 1
+@ frame pattern 1
+@ frame background color 0
+@ frame background pattern 0
+@ s0 hidden false
+@ s0 type xy
+@ s0 symbol 0
+@ s0 symbol size 1.000000
+@ s0 symbol color 2
+@ s0 symbol pattern 1
+@ s0 symbol fill color 2
+@ s0 symbol fill pattern 0
+@ s0 symbol linewidth 1.0
+@ s0 symbol linestyle 1
+@ s0 symbol char 65
+@ s0 symbol char font 0
+@ s0 symbol skip 0
+@ s0 line type 1
+@ s0 line linestyle 1
+@ s0 line linewidth 2.0
+@ s0 line color 2
+@ s0 line pattern 1
+@ s0 baseline type 0
+@ s0 baseline off
+@ s0 dropline off
+@ s0 fill type 0
+@ s0 fill rule 0
+@ s0 fill color 1
+@ s0 fill pattern 1
+@ s0 avalue off
+@ s0 avalue type 2
+@ s0 avalue char size 1.000000
+@ s0 avalue font 0
+@ s0 avalue color 1
+@ s0 avalue rot 0
+@ s0 avalue format general
+@ s0 avalue prec 3
+@ s0 avalue prepend ""
+@ s0 avalue append ""
+@ s0 avalue offset 0.000000 , 0.000000
+@ s0 errorbar on
+@ s0 errorbar place both
+@ s0 errorbar color 2
+@ s0 errorbar pattern 1
+@ s0 errorbar size 1.000000
+@ s0 errorbar linewidth 1.0
+@ s0 errorbar linestyle 1
+@ s0 errorbar riser linewidth 1.0
+@ s0 errorbar riser linestyle 1
+@ s0 errorbar riser clip off
+@ s0 errorbar riser clip length 0.100000
+@ s0 comment "Cols 2:11"
+@ s0 legend "Probe 9 (on the inlet)"
+ at target G0.S0
+ at type xy
+0.05 21.87448
+0.1 24.80304
+0.15 28.3831
+0.2 32.39843
+0.25 36.7148
+0.3 41.24174
+0.35 47.0577
+0.4 52.91886
+0.45 58.73529
+0.5 64.44579
+0.55 70.01413
+0.6 75.4281
+0.65 80.6935
+0.7 85.82727
+0.75 90.8539
+0.8 95.80162
+0.85 100.6981
+0.9 105.5688
+0.95 110.4339
+1 115.3096
+1.05 120.2044
+1.1 125.1252
+1.15 130.0725
+1.2 135.0429
+1.25 140.0325
+1.3 145.0361
+1.35 150.0488
+1.4 155.0671
+1.45 160.0867
+1.5 165.1042
+1.55 170.1196
+1.6 175.1301
+1.65 180.1363
+1.7 185.1394
+1.75 190.1393
+1.8 195.137
+1.85 200.1334
+1.9 205.1295
+1.95 210.1257
+2 215.1232
+2.05 220.1204
+2.1 225.1174
+2.15 230.1149
+2.2 235.1141
+2.25 240.1126
+2.3 245.1108
+2.35 250.1087
+2.4 255.1068
+2.45 260.1027
+2.5 265.0978
+2.55 270.0923
+2.6 275.0854
+2.65 280.0775
+2.7 285.071
+2.75 290.0646
+2.8 295.0594
+2.85 300.0547
+2.9 305.0518
+2.95 310.0487
+3 315.0497
+3.05 320.0545
+3.1 325.0626
+3.15 330.0715
+3.2 335.0844
+3.25 340.0989
+3.3 345.1112
+3.35 350.1249
+3.4 355.1394
+3.45 360.154
+3.5 365.17
+3.55 370.1837
+3.6 375.1967
+3.65 380.21
+3.7 385.2255
+3.75 390.2438
+3.8 395.2595
+3.85 400
+3.9 400
+3.95 400
+4 400
+4.05 400
+4.1 400
+4.15 400
+4.2 400
+4.25 400
+4.3 400
+4.35 400
+4.4 400
+4.45 400
+4.5 400
+4.55 400
+4.6 400
+4.65 400
+4.7 400
+4.75 400
+4.8 400
+4.85 400
+4.9 400
+4.95 400
+5 400
+5.05 400
+5.1 400
+5.15 400
+5.2 400
+5.25 400
+5.3 400
+5.35 400
+5.4 400
+5.45 400
+5.5 400
+5.55 400
+5.6 400
+5.65 400
+5.7 400
+5.75 400
+5.8 400
+5.85 400
+5.9 400
+5.95 400
+6 400
+6.05 400
+6.1 400
+6.15 400
+6.2 400
+6.25 400
+6.3 400
+6.35 400
+6.4 400
+6.45 400
+6.5 400
+6.55 400
+6.6 400
+6.65 400
+6.7 400
+6.75 400
+6.8 400
+6.85 400
+6.9 400
+6.95 400
+7 400
+7.05 400
+7.1 400
+7.15 400
+7.2 400
+7.25 400
+7.3 400
+7.35 400
+7.4 400
+7.45 400
+7.5 400
+7.55 400
+7.6 400
+7.65 400
+7.7 400
+7.75 400
+7.8 400
+7.85 400
+7.9 400
+7.95 400
+8 400
+8.05 400
+8.1 400
+8.15 400
+8.2 400
+8.25 400
+8.3 400
+8.35 400
+8.4 400
+8.45 400
+8.5 400
+8.55 400
+8.6 400
+8.65 400
+8.7 400
+8.75 400
+8.8 400
+8.85 400
+8.9 400
+8.95 400
+9 400
+9.05 400
+9.1 400
+9.15 400
+9.2 400
+9.25 400
+9.3 400
+9.35 400
+9.4 400
+9.45 400
+9.5 400
+9.55 400
+9.6 400
+9.65 400
+9.7 400
+9.75 400
+9.8 400
+9.85 400
+9.9 400
+9.95 400
+10 400
+10.05 400
+10.1 400
+10.15 400
+10.2 400
+10.25 400
+10.3 400
+10.35 400
+10.4 400
+10.45 400
+10.5 400
+10.55 400
+10.6 400
+10.65 400
+10.7 400
+10.75 400
+10.8 400
+10.85 400
+10.9 400
+10.95 400
+11 400
+11.05 400
+11.1 400
+11.15 400
+11.2 400
+11.25 400
+11.3 400
+11.35 400
+11.4 400
+11.45 400
+11.5 400
+11.55 400
+11.6 400
+11.65 400
+11.7 400
+11.75 400
+11.8 400
+11.85 400
+11.9 400
+11.95 400
+12 400
+12.05 400
+12.1 400
+12.15 400
+12.2 400
+12.25 400
+12.3 400
+12.35 400
+12.4 400
+12.45 400
+12.5 400
+12.55 400
+12.6 400
+12.65 400
+12.7 400
+12.75 400
+12.8 400
+12.85 400
+12.9 400
+12.95 400
+13 400
+13.05 400
+13.1 400
+13.15 400
+13.2 400
+13.25 400
+13.3 400
+13.35 400
+13.4 400
+13.45 400
+13.5 400
+13.55 400
+13.6 400
+13.65 400
+13.7 400
+13.75 400
+13.8 400
+13.85 400
+13.9 400
+13.95 400
+14 400
+14.05 400
+14.1 400
+14.15 400
+14.2 400
+14.25 400
+14.3 400
+14.35 400
+14.4 400
+14.45 400
+14.5 400
+14.55 400
+14.6 400
+14.65 400
+14.7 400
+14.75 400
+14.8 400
+14.85 400
+14.9 400
+14.95 400
+15 400
+&
diff --git a/doc/tutorial/graphics/probe9.png b/doc/tutorial/graphics/probe9.png
new file mode 100644
index 0000000..7ab3ee8
Binary files /dev/null and b/doc/tutorial/graphics/probe9.png differ
diff --git a/doc/tutorial/intro.tex b/doc/tutorial/intro.tex
new file mode 100644
index 0000000..0e1b452
--- /dev/null
+++ b/doc/tutorial/intro.tex
@@ -0,0 +1,69 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% SYNTH�SE
+\section{Introduction}
+
+\CS is a system designed to solve the Navier-Stokes
+equations in the cases of 2D, 2D axisymmetric or 3D flows. Its main module is
+designed for the simulation of flows which may be steady or
+unsteady, laminar or turbulent, incompressible or potentially dilatable,
+isothermal or not. Scalars and turbulent fluctuations of scalars can be taken into
+account. The code includes specific modules, referred to as ``specific physics'',
+for the treatment of lagrangian particle tracking, semi-transparent radiative transfer,
+gas, pulverized coal and heavy fuel oil combustion,
+electricity effects (Joule effect and electric arcs) and compressible flows.
+The code also includes an engineering module, Matisse, for the simulation of nuclear waste
+surface storage.\\
+\CS relies on a finite volume discretization and allows the use of
+various mesh types which may be hybrid (containing several kinds of
+elements) and may have structural non-conformities (hanging nodes).
+
+The present document is a tutorial for \CS version \verscs.
+It presents five simple test cases and guides the future \CS user step by step
+into the preparation and the computation of the cases.
+
+The test case directories, containing the necessary meshes and data
+are available in the \CS Kernel directory:\\
+\texttt{\$CS\_HOME/doc/TUTORIAL/TEST\_CASES}
+
+This tutorial focuses on the procedure and the preparation of the \CS
+computations. For more elements on the structure of the code and the definition
+of the different variables, it is higly recommended to refer to the user
+manual.
+
+\CS 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.
+\CS 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.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/doc/tutorial/tuto_case1.tex b/doc/tutorial/tuto_case1.tex
new file mode 100644
index 0000000..b64d3d0
--- /dev/null
+++ b/doc/tutorial/tuto_case1.tex
@@ -0,0 +1,744 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{SOLUTION FOR CASE 1}
+The first thing to do before running \CS is to prepare the computation
+directories. In this first example, the study directory ``T\_JUNCTION'' will be
+created, containing a single calculation directory CAS1. This is done by typing
+the command {\itshape cree\_sat -etude T\_JUNCTION CAS1}.
+
+The mesh files should be copied in the directory MAILLAGE.
+
+The \CS Graphical Interface is launched by typing the command
+{\itshape ./SaturneGUI} in the DATA subdirectory of the CAS1 directory.
+The following graphic window opens (fig \ref{fig1_e1}).
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture01}
+\caption{User interface}
+\label{fig1_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Go to the {\itshape File} menu and click on {\itshape New file} to open a new
+calculation data file, as shown in the figure
+\ref{fig2_e1}.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture02}
+\caption{Opening a new file}
+\label{fig2_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The interface automatically updates the following information:
+\begin{itemize}
+ \item Study name
+ \item Case name
+ \item Directory of the case
+ \item Associated sub-directories of the case
+\end{itemize}
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture03}
+\caption{Identity and paths}
+\label{fig3_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Save the case to give a name to the new {\itshape XML file} by opening the
+{\itshape File} menu and clicking on {\itshape Save as...}. A new window will
+appear, enter the name of the case in {\itshape File Name} then click on
+{\itshape Save}.
+
+Remember to save the case regularly throughout the preparation of the calculation.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture04}
+\caption{Saving the {\itshape XML} file}
+\label{fig4_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The next step is to specify the mesh(es) to be used for the calculation.
+Click on the item {\itshape Solution Domain}
+under the heading {\itshape Analysis environment}. The list of all
+meshes available in the folder {\itshape MAILLAGE} appears in the
+window {\itshape List of meshes}. Delete the mesh(es) you will not
+use\footnote{this operation only deletes the selected entries from the list, it
+does not delete the mesh file in the MAILLAGE directory}. In this case only the
+mesh {\itshape downcomer.des} is needed.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture05}
+\caption{Meshes: list of meshes}
+\label{fig5_e1}
+\end{center}
+\end{figure}
+
+On this item ({\itshape Solution Domain}) there are three other tabs:
+\begin{itemize}
+ \item PERIODIC BOUNDARIES
+ \item SYRTHES COUPLING
+ \item STAND-ALONES RUNNING
+\end{itemize}
+They are not used in this case. Keep the default values.
+
+\clearpage
+The item {\itshape Analysis features} under the heading {\itshape Thermophysical
+environment} allows to define the type of flow to be simulated. In this case, a
+steady flow will be chosen.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture07}
+\caption{Flow type}
+\label{fig7_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The turbulence model is selected in the following list:\\
+\hspace*{1cm}$\bullet\ $laminar flow (no model)\\
+\hspace*{1cm}$\bullet\ $mixing length\\
+\hspace*{1cm}$\bullet\ $k-$\varepsilon$\\
+\hspace*{1cm}$\bullet\ $k-$\varepsilon$ Linear Production\\
+\hspace*{1cm}$\bullet\ $Rij-$\varepsilon$ LLR\\
+\hspace*{1cm}$\bullet\ $Rij-$\varepsilon$ SSG\\
+\hspace*{1cm}$\bullet\ $v2f ($\varphi$ model)\\
+\hspace*{1cm}$\bullet\ $k-$\omega$ SST\\
+\hspace*{1cm}$\bullet\ $LES (Smagorinsky)\\
+\hspace*{1cm}$\bullet\ $LES (dynamic model)
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture09}
+\caption{Turbulence model: list of models}
+\label{fig9_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+In this case, the k-$\varepsilon$ model is used.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture10}
+\caption{Turbulence model: choice of a model}
+\label{fig10_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+For this study the equation for temperature must be solved. Click on the item
+{\itshape Thermal model} to
+choose between:\\
+\hspace*{1cm}$\bullet\ $No thermal scalar\\
+\hspace*{1cm}$\bullet\ $Temperature (Celsius degrees)\\
+\hspace*{1cm}$\bullet\ $Temperature (Kelvin)\\
+\hspace*{1cm}$\bullet\ $Enthalpy
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture11}
+\caption{Thermal scalar conservation: list of models}
+\label{fig11_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+In the present case, select {\itshape Temperature (Celsius degrees)}.
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture12}
+\caption{Thermal scalar conservation: choice of a model}
+\label{fig12_e1}
+\end{center}
+\end{figure}
+
+There are no radiative transfers in our case, so the item is ignored.
+
+\clearpage
+To initialize variables at the instant $t=0\ s$, go to the item {\itshape Initialization}.
+Here the velocity, the thermal scalar and the turbulence can be initialized. In
+this case, the default values can be kept: zero velocity, an initial temperature
+of 20\degresC\ and a turbulence level based on a reference velocity of $1\
+m.s^{-1}$. Specific zones can be defined with different initializations. In this
+case, only the default ``all cells'' is used.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture14}
+\caption{Initialization of dynamic variables}
+\label{fig14_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The initial value for the thermal scalar also appears in the item
+{\itshape Definition and Initialization} under the heading
+{\itshape Additional scalars}, where more options concerning the scalars can be
+specified. The value of the initial value can be modified in any of the two
+pages. But in case there are additional scalars ({\em i.e.} other than the
+thermal scalar), their initialization is only possible in the {\itshape
+Additional scalars} page.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture15}
+\caption{Initialization of the scalar}
+\label{fig15_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Click on the thermal scalar in the list, to change:
+\begin{itemize}
+ \item its name
+ \item its initial value
+ \item its minimal value
+ \item its maximal value
+\end{itemize}
+In this case the temperature can vary between 0\degresC\ and 400\degresC.
+After entering the new values, click on {\itshape Modify} in order to validate
+these changes.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture16}
+\caption{Initialization of the scalar}
+\label{fig16_e1}
+\end{center}
+\end{figure}
+
+The item {\itshape Physicals properties} under the heading {\itshape Additional
+scalars}\footnote{not to be confused with the heading {\itshape Physical
+properties} in the main list} is used to specify the physical properties
+of the additional scalars, {\em i.e.} those that are not the thermal scalar. In
+this case there are no additional scalars, the item is therefore unused.
+
+
+\clearpage
+Under the heading {\itshape Physical properties} in the main list,
+the item {\itshape Reference values} allows to set the reference pressure.
+Use the default value of $101\,300\ Pa$.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture17}
+\caption{Physical properties: reference pressure}
+\label{fig17_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Specify the fluid physical characteristics in the item {\itshape Fluid
+properties}:
+\begin{itemize}
+ \item Density
+ \item Viscosity
+ \item Specific Heat
+ \item Thermal Conductivity
+\end{itemize}
+
+In this case they are all constant.
+\begin{itemize}
+ \item Density $ = 725.735\ kg.m^{-3}$
+ \item Viscosity $ = 0.895\times 10^{-4}\ kg.m^{-1}.s^{-1}$
+ \item Specific Heat $ = 5\,483\ J.kg^{-1}.\mbox{\degresC}^{-1}$
+ \item Thermal Conductivity $ = 0.02495\ W.m^{-1}.K^{-1}$
+\end{itemize}
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture18}
+\caption{Physical properties: fluid properties}
+\label{fig18_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Set the three components of gravity in the
+{\itshape Gravity, hydrostatic pressure} item.
+In this case, since the gravity doesn't have
+any influence on the flow, gravity can be set to 0.
+As for the pressure interpolation interpolation method, keep the standard
+default value.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture19}
+\caption{Physical properties: gravity, hydrostatic pressure}
+\label{fig19_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Boundary conditions now need to be defined. Go to the item {\itshape Define
+boundary regions} under the heading {\itshape Boundary conditions}.
+The following window opens (fig \ref{fig20_e1}).
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture20}
+\caption{Creation of a boundary region}
+\label{fig20_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Each boundary must be defined. The boundary faces will be grouped in
+user-defined zones, based on their color or on geometrical conditions. For each
+zone, a reference number, a label, a nature and a localization condition must be
+assigned.
+The different natures that can be assigned are:\\
+\hspace*{1cm}$\bullet\ $wall\\
+\hspace*{1cm}$\bullet\ $inlet\\
+\hspace*{1cm}$\bullet\ $symmetry\\
+\hspace*{1cm}$\bullet\ $outlet
+
+The {\itshape Label} can be any character string. It is used to identify the
+zone more easily. It usually corresponds to the nature of the zone.
+
+The {\itshape Zone} number can be any integer. It will be used by the code to
+identify the zone. No specific order or continuity in the numbering is needed.
+
+The {\itshape Localization} is used to define the faces that belong to the
+zone. It can be a color number, a group reference, geometrical conditions, on a
+combination of them, related by ``or'' or ``and'' keywords.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture21}
+\caption{Creation of a boundary region}
+\label{fig21_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The specification of the inlet condition is detailled in the following
+pages. The settings will be as follows:\\
+\hspace*{1cm}$\bullet\ ${\itshape Label}: inlet\\
+\hspace*{1cm}$\bullet\ ${\itshape Zone}: 1\\
+\hspace*{1cm}$\bullet\ ${\itshape Nature}: inlet\\
+\hspace*{1cm}$\bullet\ ${\itshape Localization}: 1
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture22}
+\caption{Creation of a boundary region: inlet region}
+\label{fig22_e1}
+\end{center}
+\end{figure}
+
+
+
+\clearpage
+After typing all the information, click on {\itshape Create} to
+create the boundary zone. It appears in the
+{\itshape Define Boundary regions} list above.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture23}
+\caption{Creation of a boundary region: inlet region}
+\label{fig23_e1}
+\end{center}
+\end{figure}
+
+Remember to save the Xml file regularly!
+
+
+\clearpage
+Do the same thing for the other boundaries.
+
+In our case, colors 8 and 9 are symmetry boundaries. One option can be to define
+a separate zone for each color, as follows:
+\begin{center}
+\begin{tabular}{lcp{2cm}c}
+Label & symmetry\_1 & & symmetry\_2 \\
+Zone & 3 & & 4 \\
+Nature & symmetry & & symmetry \\
+Localization & 8 & & 9 \\
+\end{tabular}
+\end{center}
+
+But it is usually faster to regroup the different colors in one single zone, as
+shown on figure \ref{fig24_e1}. In our case, the localization for this zone is
+the string ``8 or 9''.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture24}
+\caption{Creation of boundary regions: symmetry region}
+\label{fig24_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The same treatment must be done for the wall conditions. All colors 2, 3, 4, 6
+and 7 can be grouped in a single boundary zone.
+
+After defining all the boundary zones, the Interface window will look as in
+figure \ref{fig25_e1}.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture25}
+\caption{Creation of boundary regions}
+\label{fig25_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Now that the boundary zones are defined, the boundary conditions assigned to
+them will be specified. Click on the item
+{\itshape Dynamic variables boundary} to set the boundary conditions for
+velocity and turbulence. As shown on figure \ref{fig26_e1}, only the inlet and
+wall boundary zones appear in the window. Indeed, symmetry and outlet conditions
+do not need any user-defined data.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture26}
+\caption{Dynamic variables boundary conditions}
+\label{fig26_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Click on the label {\itshape inlet}. Enter the three components of the inlet
+velocity. For the turbulence, chose the inlet condition based on a hydraulic
+diameter and specify it.\\
+\hspace*{1cm}$\bullet\ U = 1\ m.s^{-1}$\\
+\hspace*{1cm}$\bullet\ V = 0\ m.s^{-1}$\\
+\hspace*{1cm}$\bullet\ W = 0\ m.s^{-1}$\\
+\hspace*{1cm}$\bullet\ D = 0.5\ m$
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture27}
+\caption{Dynamic variables boundary: inlet}
+\label{fig27_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+As for the wall boundary zone, the only specification the user might have to
+give is when the wall is sliding. In this case, the walls are fixed so the
+option is left ``off''.
+
+Note that if one of the walls had been sliding, it would have been necessary to
+isolate the corresponding boundary faces in a specific boundary region.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture28}
+\caption{Dynamic variables boundary: walls}
+\label{fig28_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+click on the item {\itshape Scalars boundaries} to set the boundary conditions
+on the scalar. Only inlets, outlets and walls are concerned.
+
+For the walls, three conditions are available:\\
+\hspace*{1cm}$\bullet\ ${\itshape Dirichlet}\\
+\hspace*{1cm}$\bullet\ ${\itshape Neumann}\\
+\hspace*{1cm}$\bullet\ ${\itshape Exchange Coefficient}
+
+For the outlet, only Dirichlet and Neumann conditions are available, but they are
+taken into account only when the flow re-enters from the oultet. Otherwise,
+homogeneous Neumann is considered by \CS.
+
+For the inlets, only a Dirichlet condition is available.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture29}
+\caption{Scalars boundaries}
+\label{fig29_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+In this case all walls are adiabatic. So the boundary condition for the
+temperature will be a {\itshape Neumann} condition with 0 for the value.
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture30}
+\caption{Scalars boundaries: walls}
+\label{fig30_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Click on {\itshape inlet} to choose the temperature inlet
+value. Here this value is 300\degresC.
+The default value is left for the outlet.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture31}
+\caption{Scalars boundaries: inlet}
+\label{fig31_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The calculation parameters need then to be specified, under the header {\itshape
+Analysis control}.
+
+Go to the item {\itshape Steady management} to specify the number of iterations,
+30 in this case. The default value of the relaxation
+coefficient will be kept and the
+{\itshape Option zero iteration} will not be activated.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture32}
+\caption{Steady flow management}
+\label{fig32_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Click on the item {\itshape Output control} to change the frequency for the
+printing of information in the output listing.
+The options are:\\
+\hspace*{1cm}$\bullet\ ${\itshape No output}\\
+\hspace*{1cm}$\bullet\ ${\itshape Output listing at each time step}\\
+\hspace*{1cm}$\bullet\ ${\itshape Output at each 'n' time step} (the value of
+'n' must then be specified)\\
+Here and in most cases, the second option should be chosen.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture33}
+\caption{Output control: output listing}
+\label{fig33_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+For the post-processing (by default EnSight format files), there are two options:\\
+\hspace*{1cm}$\bullet\ ${\itshape Only at the end of calculation}\\
+\hspace*{1cm}$\bullet\ ${\itshape Chronologics at each 'n' time steps}
+
+In this case, we are interested in the evolution of the variables during the
+calculation, so the second option is chosen with a value of 1 for 'n'.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture34}
+\caption{Output control: post-processing}
+\label{fig34_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The other options are kept to their default value.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture35}
+\caption{Output control}
+\label{fig35_e1}
+\end{center}
+\end{figure}
+
+The {\itshape Monitoring points management} tab allows to define specific points
+in the domain (monitoring probes) where the time evolution of the different
+variables will be stored in historic files. In this case no monitoring points
+are defined.
+
+
+\clearpage
+The item {\itshape Solution control} allows to specify which variable will
+appear in the output listing, in the post-processing files or on the
+monitoring probes. In this case, the default value is kept, where every variable
+is activated.
+
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture36}
+\caption{Solution control}
+\label{fig36_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The heading {\itshape Numerical parameters} allows to change different more
+advanced numerical parameters. In this case none of them should be changed from
+their default value.
+
+\begin{figure}[!h]
+\begin{center}
+\begin{tabular}{c}
+\includegraphics[width=9cm]{c1_capture37}\\
+\includegraphics[width=9cm]{c1_capture38}
+\end{tabular}
+\caption{Numerical parameters}
+\label{fig3738_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+When using Fortran routines, it is sometimes useful to allocate pre-defined user
+arrays, that are present in every sub-routine. This allocation can be specified
+in the {\itshape User arrays} item, under the {\itshape Calculation management}
+heading. It is not the case in the present calculation.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture39}
+\caption{User arrays}
+\label{fig39_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The item {\itshape Start/Restart} allows to start a new calculation from the
+results of a former one. It is not the case in the present calculation so
+nothing has to be modified.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture40}
+\caption{Start/Restart}
+\label{fig40_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+The final item, {\itshape Prepare batch analysis}, is used to prepare the launch
+script and, on certain architectures, launch the calculation.
+
+Calculations can be launched from the Graphical Interface in interactive mode
+({\itshape Workstation}) or in a PBS batch queue ({\itshape Management of chart
+PBS}). In this simple case, choose the Workstation.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture41}
+\caption{Prepare batch analysis: Computer selection}
+\label{fig41_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+Click on the icon to {\itshape Select the batch script file} to select the
+launch script. The default launch script is named {\itshape lance} and is
+situated in the SCRIPTS directory. Select it and click on {\itshape Open}.
+
+Remember to save the Xml file before opening the launch script.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture42}
+\caption{Prepare batch analysis: Batch script file selection}
+\label{fig42_e1}
+\end{center}
+\end{figure}
+
+
+\clearpage
+When the script is selected, new options will appear. They allow to give the
+memory size for the calculation. It is the size of the integer and real arrays
+that will be used to store most of the variables in the Fortran parts of \CS.
+It is dependent on the number of cells in the mesh. In parallel mode, it depends
+on the number of cells treated by each processor, and not the total number of
+cells. For this simple case, the default values are appropriate.
+
+On this calculation, the number of processors used will be left to 1.
+
+When launching a calculation, a temporary directory is created on the machine,
+where the script copies and creates temporary files and from where the \CS
+executable is launched. Should some user routines read or write case-specific
+files, they must be copied in the temporary directory, or from the temporary
+directory into the RESU directory. The {\itshape User files} icon allows the
+user to specify user data files (in the DATA directory) or user result files,
+that will then be copied automatically to or from the temporary directory.
+In this example, no user file is needed.
+
+Finally, the {\itshape Advanced options} icon allows to change some more
+advanced parameters that will not be needed in this simple case.
+
+Eventually, save the Xml file and execute it by clicking on
+{\itshape \CS batch running}. The results will be copied in the RESU
+directory.
+
+\begin{figure}[ht]
+\begin{center}
+\includegraphics[width=12cm]{c1_capture43}
+\caption{Prepare batch analysis: Execution}
+\label{fig43_e1}
+\end{center}
+\end{figure}
+
+
diff --git a/doc/tutorial/tuto_case2.tex b/doc/tutorial/tuto_case2.tex
new file mode 100644
index 0000000..105dd49
--- /dev/null
+++ b/doc/tutorial/tuto_case2.tex
@@ -0,0 +1,434 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{SOLUTION FOR CASE 2}
+This case corresponds to a new study, in which there will be three calculation
+cases (cases 2, 3 and 4). All of them can be created in a single {\itshape
+cree\_sat} command, or additional cases can be added later. To test both
+possibilities, first create the study directory, with cases directories CAS2
+and CAS4:\\
+{\itshape cree\_sat -etude FULL\_DOMAIN CAS2 CAS4}\\
+then go in the study directory and add the CAS3 directory:\\
+{\itshape cd FULL\_DOMAIN}\\
+{\itshape cree\_sat -cas CAS3}
+
+Go to the SCRIPT directory in CAS2,
+open a new case and select the meshes to use. Click on the
+item {\itshape Solution Domain}. In this case the three meshes have to be
+pasted. So don't delete any mesh and activate the {\itshape Paste mesh} option by
+clicking it {\itshape on}. Additional information appears on the page. If it is
+left untouched, the \CS Preprocessor will test all the boundary faces for
+potential pasting (based on geometrical criteria). To make mesh pasting more
+efficient, this analysis can be restricted to a sub-set of boundary faces. This
+is the case in the present calculation, since only faces of colors 5, 24 and 34
+are liable to be pasted.
+
+Click on the {\itshape Add} icon to enter the list of colors to be pasted.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture02}
+\caption{Meshes: list of meshes}
+\label{fig2_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Clicking on {\itshape Add} opens a new window. Fill in the
+{\itshape Input references} for the color reference to be pasted: 5, 24 and 32.
+(different colors can be entered on a single line, separated by blanks). They
+will appear in the area above. Then click on {\itshape Validate}.
+
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture04}
+\caption{Meshes: Join a mesh}
+\label{fig4_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+The Preprocessor command for mesh pasting is now visible in the window (Fig
+\ref{fig5_e2}). It will automatically be transfered into the launch script when
+it is edited by the Interface.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture05}
+\caption{Meshes}
+\label{fig5_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+In this case ``Unsteady flow'' must be selected in the
+{\itshape Analysis features} item.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture06}
+\caption{Thermophysical models - Analysis features - Unsteady flow}
+\label{fig6_e2}
+\end{center}
+\end{figure}
+
+The rest of the heading {\itshape Thermophysical models} is identical to case
+1.
+
+
+\newpage
+To add an additional scalar, click on the
+{\itshape Definition and Initialization} item under the
+{\itshape Additional scalars} heading.
+The characteristics of the thermal scalar are still the
+same. Its initial value is 20\degresC\ and it can vary between
+0\degresC\ and 400\degresC.
+
+To create an additional scalar, enter:\\
+\hspace*{1cm}$\bullet\ $its {\itshape Name}: scalar\_2\\
+\hspace*{1cm}$\bullet\ $its {\itshape Initial value}: 10\\
+\hspace*{1cm}$\bullet\ $its {\itshape Minimal value}: 0\\
+\hspace*{1cm}$\bullet\ $its {\itshape Maximal value}: 400
+
+Then click on {\itshape Create}; the scalar will appear on the list,
+below the thermal scalar.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture08}
+\caption{Additional scalar - User scalar definition}
+\label{fig8_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+In the item {\itshape Physical properties}, still under the heading
+{\itshape Additional scalars}, specify the diffusion coefficient of this new
+scalar. Click on the scalar name to highlight it, then enter the value in the
+box. In this case, the value is
+$0.895\times 10^{-4}\ m^{2}.s^{-1}$
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture09}
+\caption{Additional scalar - User scalar physical properties}
+\label{fig9_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Create the boundary zones. The procedure is the same as in case 1, but the
+colors are different. Note that colors 5 and 32 have completely disappeared in
+the pasting process (they are now internal faces and are not considered as
+boundaries), while some boundary faces of color 24 remain.\\
+Create the inlet, outlet
+and symmetry boundary zones with the following colors:\\
+\hspace*{1cm}$\bullet\ $inlet: color 1\\
+\hspace*{1cm}$\bullet\ $outlet: color 34\\
+\hspace*{1cm}$\bullet\ $symmetry: colors 8 9 28 29 38 39\\
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture10}
+\caption{Creation of the boundary zones}
+\label{fig10_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+In this case, different conditions are applied for the walls. Separate
+corresponding wall boundary regions must therefore be created, following the
+data in the following table.
+
+\begin{center}
+\begin{tabular}{cccc}
+Label & Zone & Nature & Localization \\
+wall\_2 & 5 & wall & 2 or 3 \\
+wall\_3 & 6 & wall & 4 or 7 or 21 or 22 or 23 \\
+wall\_4 & 7 & wall & 6 and Y$>$1 \\
+wall\_5 & 8 & wall & 6 and Y$\leqslant$1 \\
+wall\_6 & 9 & wall & 31 or 33 \\
+\end{tabular}
+\end{center}
+
+The ``wall\_1'' region combines color and geometrical criteria. The associated
+character string to enter in the ``Localization'' box is as follows:\\
+``24 and 0.1$<$=X and 0.5$>$=X''\footnote{Note that, due to the pasting process,
+there are in fact no boundary faces of color 24 with X coordinate outside the
+[0.1;0.5] intervalle. The geometrical criterium is therefore not
+necessary. It is presented here to show the capacity of the face selection
+module}.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture11}
+\caption{Creation of a wall boundary region}
+\label{fig11_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Define the other wall boundary zones. The faces of color 6 have to be divided in
+two separate zones, based on a geometrical criterium on $Y$.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture152}
+\caption{Creation of wall boundary regions}
+\label{fig152_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+The dynamic boundary conditions are the same as in case 1 for the inlet, and
+there are still no sliding walls.
+
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture16}
+\caption{Dynamic variables boundary: inlet}
+\label{fig16_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+To configure the scalar boundary conditions, click on the item
+{\itshape Scalars boundaries}.
+On all the walls, a default homogeneous Neumann condition is set for
+temperature, and Dirichlet conditions are specified for the passive scalar,
+according to the following table:
+\begin{center}
+\begin{tabular}{|c|c|c|}
+\hline
+Wall & Nature & Value \\
+\hline
+wall\_1 & Dirichlet & 0 \\
+\hline
+wall\_2 & Dirichlet & 5 \\
+\hline
+wall\_3 & Dirichlet & 0 \\
+\hline
+wall\_4 & Dirichlet & 25 \\
+\hline
+wall\_5 & Dirichlet & 320 \\
+\hline
+wall\_6 & Dirichlet & 40 \\
+\hline
+\end{tabular}
+\end{center}
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture21}
+\caption{Scalars boundaries: wall\_5}
+\label{fig21_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Click on {\itshape inlet}, to set the inlet values for the scalars: 300\degresC\
+for temperature and 200 for the passive scalar.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture22}
+\caption{Scalars boundaries: inlet}
+\label{fig22_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Some calculation parameters now need to be defined.
+Go to the item {\itshape Time step} under the heading
+{\itshape Analysis control}. In our case the time step is
+{\itshape Uniform and constant}. Set the number of iterations to 300 and the
+reference time step to $0.05\ s$.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture23}
+\caption{Time step setting}
+\label{fig23_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Go to the item {\itshape Output control} to set the output parameters.
+
+Keep the default value for the output listing frequency.
+
+For the Post-processing, select the second option (output every 'n' time steps)
+and set the value of 'n' to 2.
+
+Activate the post-processing on the boundary faces by ticking the
+{\itshape Domain boundary post processing} box. The EnSight format file will
+contain an additional part, composed of the boundary faces, on which boundary
+conditions and some other variables can be visualized. This allows to check if
+the boundary conditions for the passive scalar have been properly set.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture24}
+\caption{Output control: post-processing}
+\label{fig24_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+In this case, chronological records on specified monitoring probes are needed.
+To define the probes, click on the
+{\itshape Monitoring points management} tab.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture25}
+\caption{Output control: monitoring points}
+\label{fig25_e2}
+\end{center}
+\end{figure}
+
+
+
+\newpage
+Enter the coordinates of the monitoring points you want to define. For the first point:\\
+\hspace*{1cm}$\bullet\ X = -0.25\ m$\\
+\hspace*{1cm}$\bullet\ Y = 2.25\ m$\\
+\hspace*{1cm}$\bullet\ Z = 0\ m$
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture26}
+\caption{Output controls: monitoring points - $1^{st}$ point}
+\label{fig26_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Then click on the {\itshape Add} button. The newly created point will appear in
+the window above.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture27}
+\caption{Output controls: monitoring points - $1^{st}$ point}
+\label{fig27_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Repeat the procedure for the other probes. Their coordinates are indicated in
+the following table (the Z coordinate is always 0).
+\begin{center}
+\begin{tabular}{|c|c|c|}
+\hline
+Points & X(m) & Y(m) \\
+\hline
+2 & 0.05 & 2.25 \\
+\hline
+3 & 0.05 & 2.75 \\
+\hline
+4 & 0.05 & 0.5 \\
+\hline
+5 & 0.05 & -0.25 \\
+\hline
+6 & 0.75 & -0.25 \\
+\hline
+7 & 0.75 & 0.25 \\
+\hline
+8 & 0.75 & 0.75 \\
+\hline
+\end{tabular}
+\end{center}
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture28}
+\caption{Output control: monitoring points}
+\label{fig28_e2}
+\end{center}
+\end{figure}
+
+Remember to save the Xml file regularly.
+
+
+\newpage
+Go to the item {\itshape Solution control} to define which variables will
+appear in the listing, the post-processing and the chronological records.
+
+Uncheck the boxes in front of the {\itshape Pressure}, {\itshape Tubulent energy}
+and {\itshape Dissipation} variables, in the {\itshape Print in listing}
+column. Information on these three variables will not appear in the output
+listing anymore.
+
+Uncheck the boxes in front of the {\itshape Courant number} and {\itshape
+Fourier number} variables in the {\itshape Post-processing} column. These
+variables will be removed from the post-processing results.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture29}
+\caption{Solution control - Output configuration}
+\label{fig29_e2}
+\end{center}
+\end{figure}
+
+
+\newpage
+Delete all the probe numbers for the {\itshape total\_pressure} variable. No
+chronological record will be created for this variable. As for the
+{\itshape VelocitU} variable, only select probes 1, 2, 6, 7 and 8. Time
+evolution on the other probes will not be recorded.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c2_capture30}
+\caption{Solution control - Probes}
+\label{fig30_e2}
+\end{center}
+\end{figure}
+
+
+No change is needed under the {\itshape Numerical parameters} heading.
+Switch to the {\itshape Calculation management} heading to prepare the launch
+script and run the calculation.
+
diff --git a/doc/tutorial/tuto_case3.tex b/doc/tutorial/tuto_case3.tex
new file mode 100644
index 0000000..46ede71
--- /dev/null
+++ b/doc/tutorial/tuto_case3.tex
@@ -0,0 +1,215 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{SOLUTION FOR CASE 3}
+
+Only a few elements are different from case 2.
+
+In this case the density becomes variable. Go to the item
+{\itshape Fluid properties} under the heading
+{\itshape Physical properties} and change the nature of the density from
+{\itshape constant} to {\itshape variable}.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c3_capture01}
+\caption{Fluid properties - Variable density}
+\label{fig1_e3}
+\end{center}
+\end{figure}
+
+
+\newpage
+As the density is variable, the influence of gravity has to be considered. In the
+heading {\itshape Physical properties} go to
+{\itshape Gravity, hydrostatic pressure} and set the value of each component of
+the gravity vector. If the norm of gravity is the standard $9.81\ m.s^{-2}$, a
+alternative way to define gravity is to specify its direction in the component
+boxes, (0;-1;0) in our case, and click on the icon below to renormalize the
+vector to 9.81.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c3_capture02}
+\caption{Fluid properties - Gravity}
+\label{fig2_e3}
+\end{center}
+\end{figure}
+
+
+\newpage
+Add a monitoring point close to the entry boundary condition in the
+{\itshape Output control} item.
+
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Points & X(m) & Y(m) & Z(m)\\
+\hline
+9 & -0.5 & 2.25 & 0 \\
+\hline
+\end{tabular}
+\end{center}
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c3_capture03}
+\caption{New monitoring probe}
+\label{fig3_e3}
+\end{center}
+\end{figure}
+
+
+\newpage
+After completing the interface, before running the calculation,
+some Fortran user routines need to be modified.
+
+Go to the folder FORT/USERS/base and copy {\itshape usclim.F} and
+{\itshape usphyv.F} in the FORT directory.
+
+$\bullet\ $\textbf{usclim.F}\\
+In this case, {\itshape usclim.F} is used to specify the time dependent boundary
+condition for
+the temperature. Refer to the comments in the routine or to the \CS user manual
+for more information on this routine.\\
+In our case, you need to identify the boundary faces of color 1. The command\\
+CALL GETFBR('1',NLELT,LSTELT)
+will return an integer NLELT, corresponding to the number of boundary faces of
+color 1, and an integer array LSTELT containing the list of the NLELT boundary
+faces of color 1. Note that the string '1' can be more complex and combine
+different colors, group references or geometrical criteria, with the same syntax
+as in the Graphical Interface.
+
+For each boundary face IFAC in the list, the Dirichlet value is given in the
+multi-dimension array RCODCL as follows:
+\begin{verbatim}
+IF (TTCABS.LT.3.8D0) THEN
+ DO IELT = 1, NLELT
+ IFAC = LSTELT(IELT)
+ RCODCL(IFAC,ISCA(1),1) = 20.D0+100.D0*TTCABS
+ ENDDO
+ELSE
+ DO IELT = 1, NLELT
+ IFAC = LSTELT(IELT)
+ RCODCL(IFAC,ISCA(1),1) = 400.D0
+ ENDDO
+ENDIF
+\end{verbatim}
+ISCA(1) refers to the first scalar and TTCABS is the current physical time.
+
+See the example file in the directory TEST\_CASES for the complete
+{\itshape usclim.F} file.
+
+Note that, although the inlet boundary conditions for temperature are specified
+in the {\itshape usclim.F} file, it is necessary to specify them also in the
+Graphical Interface. The value given in the Interface can be anything, it will
+be overwritten by the Fortran routine.
+
+
+$\bullet\ $\textbf{usphyv.F}\\
+In this case, {\itshape usphyv.F} is used to specify the law that governs the
+variation of density as a function of the temperature. The physical
+characteristics at the center of the cells are stored in the array PROPCE
+(respectively PROPFA for the internal faces and PROPFB for the boundary faces).
+The index of the physical characteristic ``density'' among the other
+characteristics is IROM(IPHAS) for the phase IPHAS.
+Not all the physical characteristics are stored at the center of the cells and
+some characteristics are stored both at the centers of the cells and on the
+boundary faces, for instance.
+Therefore, another array is used, to specify, for a given physical
+characteristics stored at the centers of the cells, its index among the other
+physical characteristics stored at the centers of the cells. It is the array
+IPPROC (IPPROF for the internal faces and IPPROB for the boundary faces).\\
+Hence, the fluid density at the center of cell IEL, for phase IPHAS(=1) is:\\
+PROPCE(IEL,IPPROC(IROM(IPHAS)))
+
+It is this array that has to be modified. The variable density in the cell IEL
+is calculated from the fluid temperature in this cell, stored in\\
+RTP(IEL,ISCA(1))
+
+See the example file in the directory TEST\_CASES for the complete
+{\itshape usphyv.F} file.
+
+
+After updating these two Fortran files, run the calculation as explained in case
+2.
+
+
+\newpage
+When a calculation is finished, \CS stores all the necessary elements to
+continue the computation in another execution, with total continuity. These
+elements are stored in several files, grouped in a SUITE.xxxxxxxx directory, in
+the RESU directory.
+
+In this case, after the first calculation is finished, a second calculation will
+be run, starting from the results of the first one.
+
+
+Go directly on the item {\itshape Start/Restart} under the heading
+{\itshape Calcul management}. Activate the {\itshape Analysis restart}
+by ticking the ``on'' box. Then click on the folder icon next to it to specify
+the restart files to use.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c3_capture04}
+\caption{Start / Restart}
+\label{fig4_e3}
+\end{center}
+\end{figure}
+
+
+\newpage
+A window opens, with the architecture of the study sub-directories. Open the
+RESU folder and click on the folder SUITE.xxxxxxxx (where xxxxxxxx corresponds
+to the reference of the first calculation). Then click on {\itshape Validate}.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c3_capture05}
+\caption{Start / Restart - Selection of the restart directory}
+\label{fig5_e3}
+\end{center}
+\end{figure}
+
+
+\newpage
+Go to the {\itshape Time step} item under the heading {\itshape Analysis
+control} and change the number of iterations. It must be the total number of
+iterations, from the beginning of the first calculation.\\
+
+The first calculation was done with 300 iterations and another 400 iterations
+are needed for the present case. Therefore the value 700 must be entered.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c3_capture06}
+\caption{Time step}
+\label{fig6_e3}
+\end{center}
+\end{figure}
+
+Eventually, run the calculation.
diff --git a/doc/tutorial/tuto_case4.tex b/doc/tutorial/tuto_case4.tex
new file mode 100644
index 0000000..84b7bf7
--- /dev/null
+++ b/doc/tutorial/tuto_case4.tex
@@ -0,0 +1,78 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{SOLUTION FOR CASE 4}
+This case is similar to case 3, with the following differences:\\
+\hspace*{1cm}$\bullet\ $parallel computation on 2 processors\\
+\hspace*{1cm}$\bullet\ $head loss\\
+\hspace*{1cm}$\bullet\ $calculation of a spatial average\\
+\hspace*{1cm}$\bullet\ $dealing with a user results file
+
+The head loss is controlled by the {\itshape uskpdc.F} routine. Some elements
+are given in paragraph \ref{prg_case4}. Refer to the example file in the
+directory TEST\_CASES for the complete {\itshape uskpdc.F} file.
+
+The calculation of the spatial average is done in the {\itshape usproj.F}
+routine. Refer to the example file in the
+directory TEST\_CASES for the complete {\itshape usproj.F} file.
+
+The other two changes are controlled in the item
+{\itshape Prepare batch analysis}.
+
+To run the calculation on two processors, simply change the number of processors
+indicator to 2. The launch script will automatically deal with the rest.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c4_capture01}
+\caption{Number of processors}
+\label{fig1_e4}
+\end{center}
+\end{figure}
+
+
+\newpage
+As seen in paragraph \ref{prg_case4}, the file ``moy.dat'' created by
+{\itshape usproj.F} will be written in the temporary execution directory. It
+must be identified in the launch script in order to be automatically copied in
+the RESU directory (More precisely, a RES\_USERS.xxxxxxxx directory will be
+created in the RESU folder, in which the file will be copied).
+
+Click on the icon {\itshape User files} to open the associated dialog window.
+Enter the file name ``moy.dat'' in the field {\itshape New results files}
+and press the return''Enter'' key on the keyboard. The file name moves to the
+list in the above window, so further file names can be added. When finished,
+click on {\itshape Validate}.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c4_capture02}
+\caption{User results files}
+\label{fig2_e4}
+\end{center}
+\end{figure}
+
+
diff --git a/doc/tutorial/tuto_case5.tex b/doc/tutorial/tuto_case5.tex
new file mode 100644
index 0000000..a43c2ed
--- /dev/null
+++ b/doc/tutorial/tuto_case5.tex
@@ -0,0 +1,348 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\section{SOLUTION FOR CASE 5}
+The preparation of the calculation for case 5 is very similar to the other cases.
+\begin{itemize}
+ \item Open the \CS interface
+ \item Open a new case
+ \item Check the name of the mesh
+ \item Select a k-$\varepsilon$ model
+ \item Use a thermal scalar in Celsius degrees
+\end{itemize}
+
+In the item {\itshape Initialization}, set the initial value of the temperature
+in the domain to 38.5\degresC. Initialize the turbulence with the reference
+velocity $0.03183\ m.s^{-1}$.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c5_capture01}
+\caption{Thermophysical models - Initialization}
+\label{fig1_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+In the item {\itshape Fluid properties}, under the heading {\itshape Physical
+properties}, enter the following information:
+
+\begin{center}
+\begin{tabular}{c|c|c}
+Variable & Type & Value \\
+\hline
+Density & Variable & $998.671\ kg.m^{-3} $ \\
+\hline
+Viscosity & Variable & $0.445\times 10^{-4}\ kg.m^{-1}.s^{-1} $ \\
+\hline
+Specific Heat & Constant & $4\,182.88\ J.kg^{-1}.\mbox{\degresC}^{-1} $ \\
+\hline
+Thermal Conductivity & Constant & $0.601498\ W.m^{-1}.K^{-1}$
+\end{tabular}
+\end{center}
+
+For density and viscosity, the value given here will serve as a reference
+value (see user manual for details).
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c5_capture02}
+\caption{Physical properties: fluid properties}
+\label{fig2_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+The aim of the calculation is to simulate a stratified flow. It is therefore
+necessary to have gravity. Set it to the right value in the item
+{\itshape Gravity, hydrostatic pressure}. In order to have a sharper
+stratification, the pressure interpolation method will be set to
+{\itshape improved}.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c5_capture03}
+\caption{Fluid properties - Gravity}
+\label{fig3_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+
+Go to the item {\itshape Definition and initialization} under the heading
+{\itshape Additional scalars} to specify the minimal and maximal values for the
+temperature: 18.26\degresC\ and 38.5\degresC. Note that the initial value of
+38.5\degresC\ set earlier is properly taken into account.
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c5_capture04}
+\caption{Scalar initialization}
+\label{fig4_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+Create the boundary regions.
+
+\begin{center}
+\begin{tabular}{|c|c|}
+\hline
+Colors & Conditions \\
+\hline
+2 & inlet \\
+\hline
+6 & inlet \\
+\hline
+7 & outlet \\
+\hline
+5 & wall \\
+\hline
+\end{tabular}
+\end{center}
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c5_capture05}
+\caption{Boundary regions}
+\label{fig5_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+For the dynamic boundary conditions, the velocity is $0.03183\ m.s^{-1}$ in the
+$z$ direction and the hydraulic diameter $0.4\ m$ for both inlets.
+
+
+\begin{figure}[h!]
+\begin{center}
+\begin{tabular}{c}
+\includegraphics[width=8.5cm]{c5_capture07} \\
+\\
+\includegraphics[width=8.5cm]{c5_capture08}
+\end{tabular}
+\caption{Dynamic boundary conditions}
+\label{fig6_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+For the scalar boundary conditions, the temperature of the cold inlet is
+18.6\degresC\ and that of the hot inlet is 38.5\degresC.
+
+\begin{figure}[h!]
+\begin{center}
+\begin{tabular}{c}
+\includegraphics[width=8.5cm]{c5_capture09} \\
+\\
+\includegraphics[width=8.5cm]{c5_capture10}
+\end{tabular}
+\caption{Temperature boundary conditions}
+\label{fig8_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+Tick the appropriate box for the time step to be variable in time and uniform in
+space. In the boxes below, enter the following parameters:
+\begin{center}
+\begin{tabular}{|l|c|}
+\hline
+\multicolumn{2}{|c|}{Parameters of calculation control} \\
+\hline
+Number of iterations & 100 \\
+\hline
+Reference time step & $1\ s$ \\
+\hline
+Maximal CFL number & 20 \\
+\hline
+Maximal Fourier number & 60 \\
+\hline
+Minimal time step & $0.01\ s$ \\
+\hline
+Maximal time step & $70\ s$ \\
+\hline
+Time step maximal variation & $0.1$ \\
+\hline
+\end{tabular}\\
+\end{center}
+
+And activate the option
+{\itshape Time step limitation with the local thermal time step}
+
+\begin{figure}[h!]
+\begin{center}
+\includegraphics[width=12cm]{c5_capture11}
+\caption{Time step}
+\label{fig11_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+Set the frequency of post-processing files to 10.
+
+Create four monitoring probes at the following coordinates:
+\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+Points & X(m) & Y(m) & Z(m)\\
+\hline
+1 & 0.010025 & 0.01534 & -0.011765 \\
+\hline
+2 & 1.625 & 0.01534 & -0.031652 \\
+\hline
+3 & 3.225 & 0.01534 & -0.031652 \\
+\hline
+4 & 3.8726 & 0.047481 & 7.25 \\
+\hline
+\end{tabular}
+\end{center}
+
+\begin{figure}[h!]
+\begin{center}
+\begin{tabular}{c}
+\includegraphics[width=7cm]{c5_capture12} \\
+\\
+\includegraphics[width=7cm]{c5_capture13}
+\end{tabular}
+\caption{Outpput management and monitoring points}
+\label{fig12_e5}
+\end{center}
+\end{figure}
+
+
+\newpage
+Before running the calculation, fill the {\itshape usphyv.F} file to specify the
+variation of the density and the viscosity with the temperature. Refer to the
+other cases or the example in the TEST\_CASES directory for more
+information.
+
+For the advanced post-processing features, copy the three routines
+{\itshape usdpst.F}, {\itshape usmpst.F} and {\itshape usvpst.F} in the FORT
+directory. The general content of these routines is described in the user manual
+or in the examples available in the directory FORT/USERS/base. The modified
+routines adapted to this test case are available in the TEST\_CASES
+directory. Only the main elements are mentionned here.
+
+
+
+$\bullet$ {\bfseries usdpst.F}\\
+This routine is called only once, at the beginning of the calculation. It allows
+to define the different writers and parts.
+
+The first writer is the standard writer (which creates the directory
+CHR.ENSIGHT.xxxxxxxx). It is created by default and has the number -1.
+
+Set the number of additional writers NBCAS to 1. For the first (and unique)
+additional writer, specify the following elements :\\
+\begin{tabular}{@{$\bullet\ $}l@{$\quad$}p{10cm}}
+NOMCAS = 'chr' & prefix of the EnSight files\\
+NOMREP = 'Tinf21.ensight' & name of the directory\\
+NOMFMT = 'EnSight Gold' & format of the post-processing\\
+OPTFMT = 'binary' & format options (here binary files)\\
+INDMOD = 2 & indicates that the parts in this writer will be time dependent in its content\\
+NTCHRL = 5 & periodicity of output\\
+\end{tabular}
+A directory TINF21.ENSIGHT.xxxxxxxx will be created with the post-processing
+results associated to this writer.
+
+Set the number of additional parts NBPART to 2.\\
+For each part, set the number of cells, internal faces and boundary faces
+(respectively NLCEL, NLFAC, NLFBR) and the lists LSTCEL, LSTFAC and LSTFBR of
+the elements in the part\footnote{parts can only contain similar elements,
+{\em i.e.} combinations of internal and boundary faces are allowed, but
+combinations of cells and faces are not}.\\
+The first part, the clip plane, will be created by detecting the internal faces
+which have a center of gravity (CDGFAC) between -0.01 and 0.01.\\
+The second part, the cells where the temperature is lower than 21\degresC, will
+be specified in {\itshape usmpst.F}. Yet it must be initialized in
+{\itshape usdpst.F}. The easiest is to set \mbox{NLCEL=NCEL}, total number of
+cells (and when doing so, there is no need to specify the LSTCEL array).
+
+Eventually, the different parts must be associated with the different writers,
+through the PSTASS routine. Part 1 is associated to the writer -1, and part 2 to
+the writer 1.
+
+
+$\bullet$ {\bfseries usmpst.F}\\
+This routine is called at each time step. It allows to redefine the content of
+certain parts using any variable, especially the temperature for this case.
+
+Only part 2 is concerned. A DO/ENDDO loop on all the cells allows to identify those
+where the temperature is lower than 21\degresC\ and hence calculate the number
+of cells NCELPS in the part and the list of cells LSTCEL.
+
+
+$\bullet$ {\bfseries usvpst.F}\\
+This routine is called at each time step. It allows to specify which variable
+will be written on which part.
+
+The writing in the post-processing files is triggered by the routine PSTEVA,
+that must be called for each part and each variable to write. The arguments for
+PSTEVA are:
+
+\begin{tabular}{@{$\bullet\ $}l@{$\quad$}p{10cm}}
+IPART & part number\\
+NAMVER & character string of the name under which the variable will be written\\
+IDIMT & dimension of the variable (1 or 3 for scalars or vectors)\\
+IENTLA & for vectors, indicates if the components are interlaced (=1) or not
+(=0)\\
+IVARPR & shortcut option for specific situations, set to 0 here\\
+NTCABS & current time step (passed to {\itshape usvpst.F} with the right value)\\
+TTCABS & current physical time (passed to {\itshape usvpst.F} with the right
+value)\\
+TRACEL & array for variables on cells\\
+TRAFAC & array for variables on internal faces\\
+TRAFBR & array for boundary faces
+\end{tabular}
+
+
+Part 1 only contains internal faces, so only TRAFAC needs to be filled. Execute
+a loop on all the faces from the LSTFAC list. For each of them, the temperature
+will be stored in TRAFAC.\\
+The temperature at each face will be calculated by interpolation from the value
+at the centers of the two neighboring cells. The numbers of the neighbors of
+face IFAC are \mbox{IFACEL(IFAC,1)} and \mbox{IFACEL(IFAC,2)}. For a proper
+linear interpolation, see in the TEST\_CASES directory for the use of the POND
+parameter, yielding the fractionnal position of the face on the line joining the
+two cell centers.\\
+Note that in parallel computing, the cells on both side of the face can be
+managed by different processors. In order for the interpolation to be correct, a
+parallel synchronization must be done before the loop. A similar problem happens
+with periodic boundary conditions. Hence the calling of routines PARCOM and
+PERCOM shown in the example in the TEST\_CASES directory.
+
+As for part 2, it contains only cells so only TRACEL need be filled. For each
+cell in the LSTCEL list, just set TRACEL to the value of the temperature at the
+center of the cell.
diff --git a/doc/tutorial/tutorial.tex b/doc/tutorial/tutorial.tex
new file mode 100644
index 0000000..b57fbdd
--- /dev/null
+++ b/doc/tutorial/tutorial.tex
@@ -0,0 +1,133 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\documentclass[a4paper,10pt,twoside]{report}
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES OBLIGATOIRES
+\usepackage{csdoc}
+% MACROS SUPPLEMENTAIRES
+\usepackage{csmacros}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES ET COMMANDES POUR LE DOCUMENTS PDF ET LES HYPERLIENS
+\hypersetup{%
+ pdftitle = {CodeSaturne tutorial},
+ pdfauthor = {MFEE},
+ pdfpagemode = UseOutlines
+}
+\pdfinfo{/CreationDate (D:20030429000000-01 00 )}
+%
+% Pour avoir les Thumbnails a l'ouverture du document sous ACROREAD :
+% pdfpagemode = UseThumbs
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% MACROS SUPPLEMENTAIRES
+% \newcommand{/...}{...}
+%
+\renewcommand{\thefigure}{\Roman{part}.\arabic{figure}}
+\renewcommand{\thetable}{\Roman{part}.\arabic{table}}
+\renewcommand{\theequation}{\Roman{part}.\arabic{equation}}
+\renewcommand{\thesection}{\arabic{section}}
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% INFO POUR PAGES DE GARDES
+\titreCS{\CS version~\verscs tutorial}
+\docassociesCS{}
+\resumeCS{}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DEBUT DU DOCUMENT
+\begin{document}
+
+\def\contentsname{\textbf{\normalsize TABLE OF CONTENTS}\pdfbookmark[1]{Table of
+contents}{contents}}
+\def\indexname{Index of the main variables and keywords}
+
+\pdfbookmark[1]{Flyleaf}{pdg}
+\large
+\makepdgCS
+\normalsize
+
+\begin{center}\begin{singlespace}
+\tableofcontents
+\end{singlespace}\end{center}
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% CORPS DU DOCUMENT
+%
+\passepage
+\stepcounter{chapter}
+\part{INTRODUCTION}
+\include{intro}
+\setcounter{section}{0}
+\stepcounter{chapter}
+\part{SIMPLE JUNCTION TEST CASE}
+\include{case1}
+\setcounter{section}{0}
+\stepcounter{chapter}
+\part{FULL DOMAIN}
+\include{case2}
+\include{case3}
+\include{case4}
+\setcounter{section}{0}
+\stepcounter{chapter}
+\part{STRATIFIED JUNCTION}
+\include{case5}
+\setcounter{section}{0}
+\stepcounter{chapter}
+\part{STEP BY STEP SOLUTION}
+\include{tuto_case1}
+\include{tuto_case2}
+\include{tuto_case3}
+\include{tuto_case4}
+\include{tuto_case5}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FIN DU DOCUMENT
+\end{document}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/doc/user/Makefile.am b/doc/user/Makefile.am
new file mode 100644
index 0000000..ea1f1fe
--- /dev/null
+++ b/doc/user/Makefile.am
@@ -0,0 +1,86 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+
+TEXMAIN = user.tex
+
+# Other LaTex document
+
+TEXOTHERS = \
+a1_autovalid.tex \
+ale.tex \
+biblio.tex \
+saturne1.tex \
+saturne2.tex \
+summary.tex
+
+TEXINPUTFILES = \
+input/addstudy.xml \
+input/autovalid.xml
+
+# Distributed files
+
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+INDEXSTYLE = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+MAKEINDEX = export INDEXSTYLE="$(INDEXSTYLE)"; makeindex
+
+# Generated documents (pdf and index files)
+
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+IDXMAIN = $(TEXMAIN:.tex=.idx)
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(MAKEINDEX) $(IDXMAIN) -s csindex.sty
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
diff --git a/doc/user/Makefile.in b/doc/user/Makefile.in
new file mode 100644
index 0000000..a30950b
--- /dev/null
+++ b/doc/user/Makefile.in
@@ -0,0 +1,660 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main LaTeX document
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/user
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TEXMAIN = user.tex
+
+# Other LaTex document
+TEXOTHERS = \
+a1_autovalid.tex \
+ale.tex \
+biblio.tex \
+saturne1.tex \
+saturne2.tex \
+summary.tex
+
+TEXINPUTFILES = \
+input/addstudy.xml \
+input/autovalid.xml
+
+
+# Distributed files
+EXTRA_DIST = $(TEXMAIN) $(TEXOTHERS) $(TEXINPUTFILES)
+
+# Subdirectories (order is important)
+SUBDIRS = graphics .
+
+# Environment variables for LaTeX
+TEXINPUTS = $(top_srcdir)/doc/style/:$(top_builddir)/doc/style/:$(srcdir)//:$(builddir)//:
+BIBINPUTS = $(top_srcdir)/doc/style/:
+BSTINPUTS = $(top_srcdir)/doc/style/:
+INDEXSTYLE = $(top_srcdir)/doc/style/:
+
+# LaTeX commands
+PDFLATEX = export TEXINPUTS="$(TEXINPUTS)"; pdflatex
+BIBTEX = export BIBINPUTS="$(BIBINPUTS)"; bibtex
+MAKEINDEX = export INDEXSTYLE="$(INDEXSTYLE)"; makeindex
+
+# Generated documents (pdf and index files)
+PDFMAIN = $(TEXMAIN:.tex=.pdf)
+IDXMAIN = $(TEXMAIN:.tex=.idx)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/user/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/user/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am: install-pdf-local
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am: pdf-local
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-local ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pdf-local install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ pdf-local ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local:
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(MAKEINDEX) $(IDXMAIN) -s csindex.sty
+ @$(PDFLATEX) $(TEXMAIN)
+ @$(PDFLATEX) $(TEXMAIN)
+
+clean-local:
+ -rm -f *.out *.log *.aux *.toc *.lof *.lot \
+ *.ilg *.idx *.bbl *.blg *.ind *.sym *.nsy
+
+install-pdf-local:
+ $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
+ cp -p $(PDFMAIN) $(DESTDIR)$(pdfdir)
+
+distclean-local: clean-local
+ -rm -f $(PDFMAIN)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/user/a1_autovalid.tex b/doc/user/a1_autovalid.tex
new file mode 100644
index 0000000..a7171de
--- /dev/null
+++ b/doc/user/a1_autovalid.tex
@@ -0,0 +1,257 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%==================================
+%==================================
+\section{Appendix 1 : automatic validation procedure}
+%==================================
+%==================================
+\label{prg_autovalid}
+%=====================
+\subsection{Introduction}
+%=====================
+
+This document is the practical user guide for the autovalidation
+procedure associated with \CS version \verscs.
+The aim of this document is to guide the user through all the steps
+necessary for the running and the user-understanding of the autovalidation
+procedure.
+The guide describes the selected test cases, the modifiable settings
+and the procedure to add a case in the reference base.
+
+The procedure is written in python language and a XML file containing the
+data settings is necessary.
+
+%================================================
+\subsection{Practical informations on the procedure}
+%================================================
+
+This procedure aims to run automatically all the selected cases and to
+compare the obtained results with those of the reference base. All the
+comparisons are summarized in a report file.
+If the discrepancies between the reference and the test overpass a
+determined tolerance, the procedure creates an EnSight part containing
+the variable differences.
+
+For each test cases, the detailed actions are the following:
+\begin{list}{$\bullet$}{}
+\item preparation of the study with the {\it cs\_create} utility,
+\item copy of all the necessary files (meshes, XML data file, user
+ fortran files) from the reference base,
+\item execution of the case with the {\it runcase} utility,
+\item comparison between the reference results and the test results,
+\item update of the report file.
+\end{list}
+
+First, an empty directory named BASETEST is generated by the user.
+In this directory, the command to launch the script is the following:
+\begin{center}
+{\it autovalid -f [xml file name] [-d [tmp directory]] }
+\end{center}
+where {\it xml file name} is the data file containing the settings
+necessary to the autovalidation. The reference base has to be easily
+updatable. The user has to copy this file, initially associated to the
+directory BASEREF, in the directory BASETEST in order to modify it (for
+example, if the user doesn't want to execute all the tests or if he
+wants to compare only some variables).
+
+
+%==================================
+\subsection{Directories architecture}
+%==================================
+
+The typical architecture is given in the following section:
+
+\begin{list}{$\bullet$}{}
+\item a directory BASEREF containing all the reference studies
+ (five elementary tests GRADIENT and LAPLACIEN) and the XML data
+ file {\it autovalid.xml},
+\item the user has to create a directory BASETEST and to copy
+ the XML data file {\it autovalid.xml} in this directory before
+ launching the script,
+\item a directory Autovalid containing all the python source files.
+\end{list}
+
+
+
+%==================================
+\subsection{Validation base}
+%==================================
+
+The selected cases in the reference directory are:
+\begin{list}{$\bullet$}{}
+\item GRADIENT : elementary tests of gradient calculation using the
+ different methods proposed by \CS,
+\item LAPLACIEN : resolution of a laplacian equation.
+\end{list}
+
+%==================================
+\subsubsection{Elementary tests : gradient calculations}
+%==================================
+The elementary tests are performed on a cubical mesh composed by
+hexahedrons and tetrahedrons with non-conforming merging. The mesh is
+generated using Simail-6.4 mesher (file with extension {\it .des}).
+
+All the tests are contained in the fortran file {\it testel.F} called by
+the fortran file {\it caltri.F}. To activate the elementary tests,
+we use the existing parameter IVERIF in the main program {\it
+cs\_main.c}. IVERIF is initialised to -1 (no action). If IVERIF takes
+the value 0, there is no difference with the standard version. If
+IVERIF $>$ 0, {\it testel.F} will be called with :
+\begin{list}{$\bullet$}{}
+\item IVERIF = 1: IMRGRA = 0
+\item IVERIF = 2: IMRGRA = 1
+\item IVERIF = 3: IMRGRA = 2
+\item IVERIF = 4: IMRGRA = 3
+\item IVERIF = 5: IMRGRA = 4
+\end{list}
+
+A new keyword ARG\_CS\_VERIF refering to IVERIF is added in the
+universal launch script {\it lance}, so that the command line is:
+{\it cs14.exe -v ARG\_CS\_VERIF}.
+
+The test case consists in calculating the gradient of sin(x+2y+3z)
+with the different methods implemented in \CS (boundary conditions
+are treated with Dirichlet condition). We compare the result to the
+reference solution (not to the exact solution).
+
+
+%==================================
+\subsubsection{Laplacien calculation}
+%==================================
+
+The mesh is the same as for the previous elementary tests.
+
+The case consists in the resolution of a stationary equation without
+convection terms for a passive scalar. The source term and Dirichlet
+boundary conditions are specified so that the solution is sin(x+2y+3z).
+The source term is imposed in the fortran file {\it ustssc.F}.
+We compare the result with the reference solution (not with the exact
+solution).
+
+
+
+%==================================
+\subsection{Architecture description}
+%==================================
+
+In the directory Autovalid, the user finds all the python source
+files necessary to the execution of the procedure. The main file
+{\it autovalid} runs the autovalidation and manages the general
+printouts.
+
+
+%==================================
+\subsubsection{Python files in the modules directory}
+%==================================
+
+All the python files are listed here:
+
+\begin{list}{$\bullet$}{}
+\item {\it Common.py}: this file contains the global variables (XML
+ file name, reference version, reference path, temporary directory
+ and local directory),
+\item {\it CommandLine.py}: this file manages the command line usage,
+\item {\it Parser.py}: this file defines the parser class which loads
+ and reads the XML data file,
+\item {\it Study.py}: this file defines the study class which contains
+ case objects,
+\item {\it Case.py}: this file defines the case class which contains
+ the launch script and the listing and chrono comparisons,
+\item {\it Listing.py}: this file defines the listing class which
+ contains minima/maxima variables and clippings,
+\item {\it Chrono.py}: this file defines the chrono class which
+ contains a list of values and creates, if necessary, a part
+ EnSight (if tolerance $>$ specified value).
+\end{list}
+
+
+%================================
+\subsubsection{XML file description}
+%================================
+
+The XML file contains all the data to run the different cases.
+It is important to note the definitions of the following attributes:
+\begin{list}{$\bullet$}{}
+\item {\it label} refers to the name of the study, the name of the case,
+the name of the variable or the name of the post-treatment script,
+\item {\it status} is 'on' or 'off' to activate or not the action,
+\item {\it compute} is 'on' or 'off' to run or not the calculation,
+\item {\it tolerance} is the maximum allowed value for the norm of the
+ variable X defined by
+ $$\frac{\vert{X_{Ref}-X_{Test}}\vert}{\vert{X_{max_{Ref}}-X_{min_{Ref}}}+\varepsilon\vert}$$ .
+\end{list}
+
+An example of XML data file is given below:
+
+\begin{alltt}
+\input{autovalid.xml}
+\end{alltt}
+
+Note : If {\it status} is 'on' and {\it compute} is 'off', we compare
+listing files and chrono files but if there isn't result available,
+{\it compute} becomes 'on'.
+
+
+%==============================
+\subsubsection{To add a new study}
+%==============================
+
+To add a new study in the reference base, the user has to create and run
+a calculation in the directory BASEREF. He also has to add the following
+typical section in the XML data file:
+\begin{alltt}
+\input{addstudy.xml}
+\end{alltt}
+For example, this previous sequence means that the user wants to run
+(compute is 'on') and compare the variable 'gradient' with a tolerance
+0.1 for the case CAS1 of the study GRADIENT.
+
+
+%========================
+\subsubsection{Report files}
+%========================
+
+There are three kinds of report file :
+\begin{list}{$\bullet$}{}
+\item {\it report.txt}: this general file contains just OK, NOK,
+ 'Execution error' or 'Compilation error' for each case of
+ each study,
+\item {\it STUDY\_listing.report}: this file depends on the study
+ and contains the listing files comparison for each selected
+ variable at the last time step (min/max values, min/max norms,
+ min/max clippings),
+ $$Norm_{X_{max}}=\frac{\vert{X_{max_{Ref}}-X_{max_{Test}}}\vert}{\vert{X_{max_{Ref}}-X_{min_{Ref}}}+\varepsilon\vert}$$
+ $$Norm_{X_{min}}=\frac{\vert{X_{min_{Ref}}-X_{min_{Test}}}\vert}{\vert{X_{max_{Ref}}-X_{min_{Ref}}}+\varepsilon\vert}$$
+\item {\it STUDY\_chrono.report}: this file depends on the study
+ and contains the chrono files comparison for each selected
+ variable at the last time step (maximum difference, mean
+ difference and norm),
+ $$\delta_{max}= max \vert{X_{Ref}-X_{Test}\vert}$$
+ $$\delta_{mean}= \frac{\sum \vert{X_{Ref}-X_{Test}}\vert}{Nb_{values}} $$
+ $$Norm = \frac{\delta_{max}}{\vert{X_{max_{Ref}}-X_{min_{Ref}}}+\varepsilon\vert}$$
+
+\end{list}
diff --git a/doc/user/biblio.tex b/doc/user/biblio.tex
new file mode 100644
index 0000000..b516047
--- /dev/null
+++ b/doc/user/biblio.tex
@@ -0,0 +1,106 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%==================================
+%==================================
+\section{Bibliography}
+%==================================
+%==================================
+\begin{thebibliography}{3}
+
+\bibitem{valid110} {\sc Archambeau F., {\em et al.}},\\
+{\em Note de validation de \CS version 1.1.0},\\
+Rapport EDF HI-83/04/003/A, 2004 (in french).
+
+\bibitem{benhamadouche01} {\sc Benhamadouche S.},\\
+{\em Mod\'elisation de sous-maille pour la LES - Validation avec la Turbulence
+Homog\`ene Isotrope (THI) dans une version de d\'eveloppement de \CS},\\
+Rapport EDF HI-83/01/033/A, 2001 (in french).
+
+\bibitem{boucker00} {\sc Boucker M., Archambeau F., M\'echitoua N.},\\
+{\em Quelques \'el\'ements concernant la structure informatique du Solveur Commun -
+Version 1.0\_init0},\\
+Compte-rendu express EDF I81-00-8, 2000 (in french).
+
+\bibitem{bouckermattei00} {\sc Boucker M., Matt\'ei J.D.},\\
+{\em Proposition de modification des conditions aux limites de paroi turbulente pour
+le Solveur Commun dans le cadre du mod\`ele $k-\varepsilon$
+standard},\\
+Rapport EDF HI-81/00/019/A, 2000 (in french).
+
+\bibitem{Douce02} {\sc Douce A., \sc M\'echitoua N.},\\
+{\em Mise en {\oe}uvre dans \CS des physiques particuli\`eres. Tome3 :
+Transfert thermique radiatif en milieu gris semi-transparent},\\
+Rapport EDF HI-81/02/019/A, 2002 (in french).
+
+\bibitem {ref_intro_LAGR} {\sc Douce A.},\\
+{\em Physiques particuli\`eres dans \CS 1.1, Tome 5 : mod�lisation
+stochastique lagrangienne d'�coulements turbulents diphasiques polydispers�s},\\
+Rapport EDF, HI-81/04/03/A, 2005 (in french).
+
+\bibitem {Escaich01}{\sc Escaich A., Plion P.},
+{\em Mise en {\oe}uvre dans \CS des mod\'elisations physiques
+particuli\`eres. Tome 1 : Combustion en phase gaz}, \\
+Rapport EDF, HI-81/02/03/A, 2002 (in french).
+
+\bibitem {Escaich02}{\sc Escaich A.},
+{\em Mise en {\oe}uvre dans \CS des mod\'elisations physiques
+particuli\`eres. Tome 2 : Combustion du charbon pulv\'eris\'e}, \\
+Rapport EDF, HI-81/02/09/A, 2002 (in french).
+
+
+\bibitem{ecsmu} {\sc Fournier Y.},\\
+{\em \CS \verscs guide pratique et th�orique du Preprocesseur},\\
+on line with the release of \CS \verscs (\texttt{info\_cs ecsmu}).
+
+\bibitem{mechitoua98} {\sc M\'echitoua N., Archambeau F.},\\
+{\em Prototype de solveur volumes finis co-localis\'e sur maillage non-structur\'e
+pour les \'equations de Navier-Stokes 3D incompressibles et dilatables avec
+turbulence et scalaire passif},\\
+Rapport EDF HE-41/98/010/B, 1998 (in french).
+
+\bibitem{theory} {\sc \CS documentation},\\
+{\em \CS \verscs Theory and Programmer's guide},\\
+on line with the release of \CS \verscs (\texttt{info\_cs theory}).
+
+\bibitem{valid120} {\sc Sakiz M., \'Equipe de validation},\\
+{\em Validation de \CS version 1.2 : note de synth�se},\\
+Rapport EDF H-I83-2006-00818-FR, 2006 (in french).
+
+
+\bibitem{ref_intro_RAY2} {\sc Tagorti M., Dal-Secco S., Douce A., M\'echitoua N.},\\
+{\em Physiques particuli\`eres dans \CS,
+tome 4~: le mod\`ele P-1 pour la mod\'elisation des transferts thermiques
+radiatifs en milieu gris semi-transparent},\\
+Rapport EDF HI-81/03/017/A, 2003 (in french).
+
+\bibitem{tutorial} {\sc \CS documentation},\\
+{\em \CS version \verscs turorial},
+on line with the release of \CS \verscs (\texttt{info\_cs tutorial}).
+
+
+\end{thebibliography}
+
diff --git a/doc/user/graphics/Makefile.am b/doc/user/graphics/Makefile.am
new file mode 100644
index 0000000..7a46419
--- /dev/null
+++ b/doc/user/graphics/Makefile.am
@@ -0,0 +1,58 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+
+FIGFILES = \
+cs_components.fig \
+vortex.fig
+
+# Other files
+
+OTHERFILES = \
+halo.pdf \
+rota_perio_parall.jpg
+
+# Distributed files
+
+EXTRA_DIST = $(FIGFILES) $(OTHERFILES)
+
+# Generated documents (pdf files)
+
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+
+SUFFIXES = .fig .pdf
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
diff --git a/doc/user/graphics/Makefile.in b/doc/user/graphics/Makefile.in
new file mode 100644
index 0000000..9b816ca
--- /dev/null
+++ b/doc/user/graphics/Makefile.in
@@ -0,0 +1,476 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Xfig files to process
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = doc/user/graphics
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+FIGFILES = \
+cs_components.fig \
+vortex.fig
+
+
+# Other files
+OTHERFILES = \
+halo.pdf \
+rota_perio_parall.jpg
+
+
+# Distributed files
+EXTRA_DIST = $(FIGFILES) $(OTHERFILES)
+
+# Generated documents (pdf files)
+PDF_FIGFILES = $(FIGFILES:.fig=.pdf)
+
+# New suffixes and targets
+SUFFIXES = .fig .pdf
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .fig .pdf
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/user/graphics/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/user/graphics/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am: pdf-local
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distclean-local distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am pdf-local \
+ ps ps-am uninstall uninstall-am
+
+
+.fig.pdf:
+ fig2dev -L pdf $< > $@
+
+# One redefines here the standard pdf targets of automake
+# so that they handle generation from LaTeX documents.
+
+pdf-local: $(PDF_FIGFILES)
+
+clean-local:
+ -rm -f $(PDF_FIGFILES)
+
+distclean-local: clean-local
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/user/graphics/cs_components.fig b/doc/user/graphics/cs_components.fig
new file mode 100644
index 0000000..63ae22d
--- /dev/null
+++ b/doc/user/graphics/cs_components.fig
@@ -0,0 +1,655 @@
+#FIG 3.2 Produced by xfig version 3.2.5-alpha5
+Landscape
+Center
+Metric
+A4
+200.00
+Single
+-2
+1200 2
+0 32 #bfb38c
+0 33 #e5f1f5
+0 34 #d5c19c
+0 35 #e5f1f5
+0 36 #868286
+0 37 #d5c19c
+0 38 #d5d9d5
+0 39 #868286
+0 40 #d5d9d5
+0 41 #595559
+0 42 #414141
+0 43 #868286
+0 44 #bbbfbb
+0 45 #868286
+0 46 #bbbfbb
+0 47 #d5d9d5
+0 48 #868686
+0 49 #868686
+0 50 #414141
+0 51 #868286
+0 52 #bbbfbb
+0 53 #d5d9d5
+0 54 #414141
+0 55 #868286
+0 56 #bbbfbb
+0 57 #d5d9d5
+0 58 #868286
+0 59 #bbbfbb
+0 60 #d5d9d5
+0 61 #bfb38c
+0 62 #e5f1f5
+0 63 #d5c19c
+0 64 #bfb38c
+0 65 #e5f1f5
+0 66 #d5c19c
+0 67 #a4a0a4
+0 68 #595559
+0 69 #868686
+0 70 #414141
+0 71 #868286
+0 72 #bbbfbb
+0 73 #d5d9d5
+0 74 #414141
+0 75 #868286
+0 76 #bbbfbb
+0 77 #d5d9d5
+0 78 #868286
+0 79 #bbbfbb
+0 80 #d5d9d5
+0 81 #414141
+0 82 #868286
+0 83 #bbbfbb
+0 84 #414141
+0 85 #bbbfbb
+0 86 #d5d9d5
+0 87 #414141
+0 88 #868286
+0 89 #bbbfbb
+0 90 #868686
+0 91 #414141
+0 92 #868286
+0 93 #bbbfbb
+0 94 #d5d9d5
+0 95 #414141
+0 96 #868286
+0 97 #bbbfbb
+0 98 #d5d9d5
+0 99 #bbbbbb
+0 100 #515151
+0 101 #ddd9dd
+0 102 #000049
+0 103 #797979
+0 104 #303430
+0 105 #414541
+0 106 #414141
+0 107 #868286
+0 108 #bbbfbb
+0 109 #d5d9d5
+0 110 #bfb790
+0 111 #e8f1f8
+0 112 #d5c49f
+0 113 #404040
+0 114 #808080
+0 115 #bfbfbf
+0 116 #d9d9d9
+0 117 #878887
+0 118 #a3a3a3
+0 119 #555555
+0 120 #bfbfbf
+0 121 #bfbfbf
+0 122 #d9d9d9
+0 123 #878887
+0 124 #878887
+0 125 #bfbfbf
+0 126 #d9d9d9
+0 127 #bfbfbf
+0 128 #d9d9d9
+0 129 #bfbfbf
+0 130 #d9d9d9
+0 131 #bfb790
+0 132 #e8f1f8
+0 133 #d5c49f
+0 134 #bfb790
+0 135 #e8f1f8
+0 136 #d5c49f
+0 137 #c0bfc0
+0 138 #e0dce0
+0 139 #bfbfbf
+0 140 #d9d9d9
+0 141 #878787
+0 142 #878887
+0 143 #444444
+0 144 #868686
+0 145 #c0c0c0
+0 146 #e0e0e0
+0 147 #f0f0f0
+0 148 #979797
+0 149 #717571
+0 150 #565151
+0 151 #e8f4f8
+0 152 #a3a3a3
+0 153 #666666
+0 154 #dbdbe7
+0 155 #8d8d93
+0 156 #d4d4d4
+0 157 #9a9ab7
+0 158 #950000
+0 159 #e6e6e6
+0 160 #86a5f8
+0 161 #7070f8
+0 162 #bfb790
+0 163 #e8f1f8
+0 164 #d5c49f
+0 165 #bbbbbb
+0 166 #c0b38f
+0 167 #d0d0d0
+0 168 #a7a7a7
+0 169 #a3a3a3
+0 170 #878787
+0 171 #d0d0d0
+0 172 #878887
+0 173 #bfbfbf
+0 174 #d9d9d9
+0 175 #82807d
+0 176 #cbcbcb
+0 177 #3a3a3a
+0 178 #4573a3
+0 179 #000000
+0 180 #bfb790
+0 181 #e8f1f8
+0 182 #d5c49f
+0 183 #bfbfbf
+0 184 #d9d9d9
+0 185 #878887
+0 186 #c0bfc0
+0 187 #e0dce0
+0 188 #878787
+0 189 #c0c0c0
+0 190 #e0e0e0
+0 191 #f0f0f0
+0 192 #8d8d93
+0 193 #d4d4d4
+0 194 #9a9ab7
+0 195 #950000
+0 196 #e6e6e6
+0 197 #86a5f8
+0 198 #7070f8
+0 199 #bbbbbb
+0 200 #c0b38f
+0 201 #d0d0d0
+0 202 #a7a7a7
+0 203 #a3a3a3
+0 204 #a7a7a7
+0 205 #bfbfbf
+0 206 #d9d9d9
+0 207 #bfbfbf
+0 208 #d9d9d9
+0 209 #bfbfbf
+0 210 #a7a7a7
+0 211 #878787
+0 212 #878787
+0 213 #878787
+0 214 #bfbfbf
+0 215 #d9d9d9
+0 216 #bfbfbf
+0 217 #cfd0cf
+0 218 #7b799e
+0 219 #bfb790
+0 220 #e8f1f8
+0 221 #bfbfbf
+0 222 #d9d9d9
+0 223 #878887
+0 224 #a3a3a3
+0 225 #d5c49f
+0 226 #c0bfc0
+0 227 #e0dce0
+0 228 #878787
+0 229 #c0c0c0
+0 230 #e0e0e0
+0 231 #dbdbe7
+0 232 #8d8d93
+0 233 #d4d4d4
+0 234 #9a9ab7
+0 235 #950000
+0 236 #e6e6e6
+0 237 #86a5f8
+0 238 #7070f8
+0 239 #bbbbbb
+0 240 #c0b38f
+0 241 #d0d0d0
+0 242 #a7a7a7
+0 243 #82807d
+0 244 #cbcbcb
+0 245 #4573a3
+0 246 #f0f0f0
+0 247 #e8f4f8
+0 248 #979797
+0 249 #737586
+0 250 #635dc7
+0 251 #82807d
+0 252 #cbcbcb
+0 253 #4573a3
+0 254 #bfb790
+0 255 #e8f1f8
+0 256 #d5c49f
+0 257 #bfbfbf
+0 258 #d9d9d9
+0 259 #878887
+0 260 #c0bfc0
+0 261 #e0dce0
+0 262 #878787
+0 263 #c0c0c0
+0 264 #e0e0e0
+0 265 #f0f0f0
+0 266 #8d8d93
+0 267 #d4d4d4
+0 268 #9a9ab7
+0 269 #950000
+0 270 #e6e6e6
+0 271 #86a5f8
+0 272 #7070f8
+0 273 #bbbbbb
+0 274 #c0b38f
+0 275 #d0d0d0
+0 276 #a7a7a7
+0 277 #a3a3a3
+0 278 #979797
+0 279 #e8f4f8
+0 280 #dbdbe7
+0 281 #cfd0cf
+0 282 #737586
+0 283 #bfb790
+0 284 #e8f1f8
+0 285 #d5c49f
+0 286 #bfbfbf
+0 287 #d9d9d9
+0 288 #878887
+0 289 #a3a3a3
+0 290 #c0bfc0
+0 291 #e0dce0
+0 292 #878787
+0 293 #e8f4f8
+0 294 #dbdbe7
+0 295 #8d8d93
+0 296 #d4d4d4
+0 297 #9a9ab7
+0 298 #950000
+0 299 #e6e6e6
+0 300 #86a5f8
+0 301 #7070f8
+0 302 #bbbbbb
+0 303 #c0b38f
+0 304 #d0d0d0
+0 305 #a7a7a7
+0 306 #82807d
+0 307 #cbcbcb
+0 308 #4573a3
+0 309 #c0c0c0
+0 310 #e0e0e0
+0 311 #f0f0f0
+0 312 #979797
+0 313 #cfd0cf
+0 314 #737586
+0 315 #bfb790
+0 316 #e8f1f8
+0 317 #d5c49f
+0 318 #bfbfbf
+0 319 #d9d9d9
+0 320 #878887
+0 321 #a3a3a3
+0 322 #c0bfc0
+0 323 #e0dce0
+0 324 #878787
+0 325 #e8f4f8
+0 326 #dbdbe7
+0 327 #8d8d93
+0 328 #d4d4d4
+0 329 #9a9ab7
+0 330 #950000
+0 331 #e6e6e6
+0 332 #86a5f8
+0 333 #7070f8
+0 334 #bbbbbb
+0 335 #c0b38f
+0 336 #d0d0d0
+0 337 #a7a7a7
+0 338 #82807d
+0 339 #cbcbcb
+0 340 #4573a3
+0 341 #c0c0c0
+0 342 #e0e0e0
+0 343 #f0f0f0
+0 344 #979797
+0 345 #cfd0cf
+0 346 #737586
+0 347 #635dc7
+0 348 #878887
+0 349 #bfbfbf
+0 350 #d9d9d9
+0 351 #bfbfbf
+0 352 #d9d9d9
+0 353 #bbbbbb
+0 354 #e0dce0
+0 355 #bbbbbb
+0 356 #bbbbbb
+0 357 #e0dce0
+0 358 #c0b38f
+0 359 #bbbbbb
+0 360 #878787
+0 361 #878787
+0 362 #bbbbbb
+0 363 #bbbbbb
+0 364 #bfbfbf
+0 365 #d9d9d9
+0 366 #c0bfc0
+0 367 #e0dce0
+0 368 #bfbfbf
+0 369 #d9d9d9
+0 370 #878787
+0 371 #878887
+0 372 #878887
+0 373 #878787
+0 374 #878787
+0 375 #c0c0c0
+0 376 #e0e0e0
+0 377 #f0f0f0
+0 378 #979797
+0 379 #e0dce0
+0 380 #c0c0c0
+0 381 #757575
+0 382 #979797
+0 383 #c0bfc0
+0 384 #878787
+0 385 #878787
+0 386 #c0bfc0
+0 387 #e0dce0
+0 388 #e8f4f8
+0 389 #e0dce0
+0 390 #878787
+0 391 #c0bfc0
+0 392 #878787
+0 393 #bfbfbf
+0 394 #d9d9d9
+0 395 #ececec
+0 396 #ececec
+0 397 #a3a3a3
+0 398 #878787
+0 399 #878787
+0 400 #a3a3a3
+0 401 #878787
+0 402 #c0bfc0
+0 403 #bfbfbf
+0 404 #d9d9d9
+0 405 #878787
+0 406 #878787
+0 407 #878787
+0 408 #d0ccd0
+0 409 #a7a3a7
+0 410 #bfbfbf
+0 411 #e0e0e0
+0 412 #e0e0e0
+0 413 #ececec
+0 414 #e0e0e0
+0 415 #e0e0e0
+0 416 #bfbfbf
+0 417 #e0e0e0
+0 418 #e0e0e0
+0 419 #ececec
+0 420 #e0e0e0
+0 421 #e0e0e0
+0 422 #303030
+0 423 #515551
+0 424 #878787
+0 425 #c0c0c0
+0 426 #c0c0c0
+0 427 #878787
+0 428 #f0ecf0
+0 429 #878787
+0 430 #878787
+0 431 #d9d9d9
+0 432 #878887
+0 433 #c0bfc0
+0 434 #e0dce0
+0 435 #c0c0c0
+0 436 #c0c0c0
+0 437 #878787
+0 438 #c0bfc0
+0 439 #e0dce0
+0 440 #c0bfc0
+0 441 #717171
+0 442 #e0dce0
+0 443 #c0bfc0
+0 444 #e0dce0
+0 445 #ececec
+0 446 #878787
+0 447 #878787
+0 448 #bfbfbf
+0 449 #d9d9d9
+0 450 #bfbfbf
+0 451 #d9d9d9
+0 452 #878787
+0 453 #c5b796
+0 454 #eef7fe
+0 455 #dbcaa5
+0 456 #8d8e8d
+0 457 #a9a9a9
+0 458 #8d8e8d
+0 459 #8d8e8d
+0 460 #c5b796
+0 461 #eef7fe
+0 462 #dbcaa5
+0 463 #c5b796
+0 464 #eef7fe
+0 465 #dbcaa5
+0 466 #c6c2c6
+0 467 #a9a9a9
+0 468 #8d8d8d
+0 469 #d6d6d6
+0 470 #8d8e8d
+0 471 #84807d
+0 472 #d1d1d1
+0 473 #4573a9
+0 474 #adadad
+0 475 #adadad
+0 476 #8d8d8d
+0 477 #8d8d8d
+0 478 #8d8d8d
+0 479 #7b79a4
+0 480 #73758b
+0 481 #73758b
+0 482 #f6f6f6
+0 483 #635dcd
+0 484 #8d8e8d
+0 485 #bdbdbd
+0 486 #e6e2e6
+0 487 #bdbdbd
+0 488 #bdbdbd
+0 489 #e6e2e6
+0 490 #c6b595
+0 491 #bdbdbd
+0 492 #8d8d8d
+0 493 #8d8d8d
+0 494 #bdbdbd
+0 495 #bdbdbd
+0 496 #8d8d8d
+6 5985 0 8640 990
+2 2 0 0 0 44 54 0 20 0.000 0 0 -1 0 0 5
+ 6210 0 7785 0 7785 315 6210 315 6210 0
+2 4 0 0 0 18 50 0 20 0.000 0 0 7 0 0 5
+ 8505 855 6120 855 6120 450 8505 450 8505 855
+2 4 0 1 0 34 52 0 20 0.000 0 0 7 0 0 5
+ 8640 990 5985 990 5985 315 8640 315 8640 990
+4 0 0 50 0 16 14 0.0000 4 165 1095 6255 225 Partitioner\001
+4 0 6 50 0 2 12 0.0000 4 180 1515 6210 675 Mesh partitioning\001
+-6
+6 2430 0 5085 2250
+6 2610 495 4950 900
+2 4 0 0 0 9 50 0 20 0.000 0 0 7 0 0 5
+ 4950 900 2625 900 2625 500 4950 500 4950 900
+4 0 6 50 0 2 12 0.0000 4 180 2100 2700 765 Read and append meshes\001
+-6
+6 2610 1080 4950 2070
+2 4 0 0 0 21 50 0 20 0.000 0 0 7 0 0 5
+ 4950 2070 2625 2070 2625 1085 4950 1085 4950 2070
+4 0 7 50 0 0 12 0.0000 4 180 2040 2715 1310 Descending connectivity\001
+4 0 6 50 0 2 12 0.0000 4 180 1575 2715 1670 Conformal joining\001
+4 0 6 50 0 2 12 0.0000 4 180 1770 2805 1940 and periodicity setup\001
+-6
+2 2 0 0 0 44 54 0 20 0.000 0 0 -1 0 0 5
+ 2670 5 4245 5 4245 320 2670 320 2670 5
+2 4 0 1 0 34 52 0 20 0.000 0 0 7 0 0 5
+ 5085 2250 2445 2250 2445 320 5085 320 5085 2250
+4 0 0 50 0 16 14 0.0000 4 210 1425 2715 230 Preprocessor\001
+-6
+6 720 315 1665 1620
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 1185.000 -92.500 735 590 1185 725 1635 590
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 1185.000 762.500 735 1445 1185 1580 1635 1445
+1 2 0 1 -1 -1 0 0 -1 0.000 1 0.0000 1185 455 450 135 735 320 1635 590
+2 1 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 2
+ 1635 455 1635 1445
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 735 1445 735 455
+4 1 -1 0 0 0 12 0.0000 6 135 615 1185 1130 Meshes\001
+-6
+6 720 1935 1665 3240
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 1198.000 1531.500 748 2214 1198 2349 1648 2214
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 1198.000 2386.500 748 3069 1198 3204 1648 3069
+1 2 0 1 -1 -1 0 0 -1 0.000 1 0.0000 1198 2079 450 135 748 1944 1648 2214
+2 1 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 2
+ 1648 2079 1648 3069
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 748 3069 748 2079
+4 1 -1 0 0 0 10 0.0000 6 105 765 1198 2649 Verification\001
+4 1 -1 0 0 0 10 0.0000 6 105 855 1198 2889 Visualization\001
+-6
+6 5985 1440 6930 2745
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 6459.000 1035.500 6009 1718 6459 1853 6909 1718
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 6459.000 1890.500 6009 2573 6459 2708 6909 2573
+1 2 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6459 1583 450 135 6009 1448 6909 1718
+2 1 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 2
+ 6909 1583 6909 2573
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 6009 2573 6009 1583
+4 1 -1 0 0 0 10 0.0000 6 105 795 6464 2081 Intermediate\001
+4 1 -1 0 0 0 10 0.0000 6 105 345 6459 2348 Mesh\001
+4 1 -1 0 0 0 10 0.0000 6 90 570 6459 2573 structure\001
+-6
+6 7740 1440 8685 2745
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 8226.000 1065.500 7776 1748 8226 1883 8676 1748
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 8226.000 1920.500 7776 2603 8226 2738 8676 2603
+1 2 0 1 -1 -1 0 0 -1 0.000 1 0.0000 8226 1613 450 135 7776 1478 8676 1748
+2 1 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 2
+ 8676 1613 8676 2603
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 7776 2603 7776 1613
+4 1 -1 0 0 0 10 0.0000 6 105 285 8231 2111 Cell\001
+4 1 -1 0 0 0 10 0.0000 6 105 450 8226 2378 domain\001
+4 1 -1 0 0 0 10 0.0000 6 105 465 8226 2603 number\001
+-6
+6 9720 0 12600 3015
+6 9900 495 12420 810
+2 4 0 1 0 36 50 0 20 0.000 0 0 7 0 0 5
+ 12420 810 9915 810 9915 500 12420 500 12420 810
+4 0 7 50 0 0 12 0.0000 4 180 1665 10005 725 Mesh and data setup\001
+-6
+6 9900 2250 12420 2610
+2 4 0 1 0 36 50 0 20 0.000 0 0 7 0 0 5
+ 12420 2610 9900 2610 9900 2250 12420 2250 12420 2610
+4 0 7 50 0 0 12 0.0000 4 180 1860 9990 2520 Post-processing output\001
+-6
+2 2 0 0 0 44 53 0 20 0.000 0 0 -1 0 0 5
+ 10095 0 10845 0 10845 320 10095 320 10095 0
+2 4 0 1 0 15 50 0 20 0.000 0 0 7 0 0 5
+ 12420 2115 9915 2115 9915 995 12420 995 12420 2115
+2 4 0 1 0 34 52 0 20 0.000 0 0 7 0 0 5
+ 12600 3015 9720 3015 9720 315 12600 315 12600 3015
+4 0 0 50 0 0 14 0.0000 4 165 645 10140 230 Kernel\001
+4 0 7 50 0 0 12 0.0000 4 180 1320 10005 1220 Specific physics\001
+4 0 6 50 0 2 12 0.0000 4 135 2085 9990 1755 Navier-Stokes resolution\001
+4 0 7 50 0 0 12 0.0000 4 135 930 9990 1485 Turbulence\001
+4 0 7 50 0 0 12 0.0000 4 135 1845 9990 2025 User-defined functions\001
+4 0 0 50 0 0 12 0.0000 4 135 1665 10305 2880 MPI communication\001
+-6
+6 13500 0 14445 1305
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 13988.000 -382.500 13538 300 13988 435 14438 300
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 13988.000 472.500 13538 1155 13988 1290 14438 1155
+1 2 0 1 -1 -1 0 0 -1 0.000 1 0.0000 13988 165 450 135 13538 30 14438 300
+2 1 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 2
+ 14438 165 14438 1155
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 13538 1155 13538 165
+4 1 -1 0 0 0 11 0.0000 6 135 825 13988 1000 and restart\001
+4 1 -1 0 0 0 11 0.0000 6 180 855 13983 773 Checkpoint\001
+-6
+6 13462 1683 14452 3033
+6 13506 1726 14451 3031
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 13983.000 1334.500 13533 2017 13983 2152 14433 2017
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 13983.000 2189.500 13533 2872 13983 3007 14433 2872
+1 2 0 1 -1 -1 0 0 -1 0.000 1 0.0000 13983 1882 450 135 13533 1747 14433 2017
+2 1 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 2
+ 14433 1882 14433 2872
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 13533 2872 13533 1882
+4 1 -1 0 0 0 12 0.0000 6 180 870 13983 2692 processing\001
+4 1 -1 0 0 0 12 0.0000 6 135 345 13938 2467 Post\001
+-6
+-6
+6 11655 -1620 12600 -315
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 12141.000 -1994.500 11691 -1312 12141 -1177 12591 -1312
+5 1 0 1 -1 -1 0 0 -1 0.000 0 1 0 0 12141.000 -1139.500 11691 -457 12141 -322 12591 -457
+1 2 0 1 -1 -1 0 0 -1 0.000 1 0.0000 12141 -1447 450 135 11691 -1582 12591 -1312
+2 1 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 2
+ 12591 -1447 12591 -457
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 11691 -457 11691 -1447
+4 1 -1 0 0 0 10 0.0000 6 105 690 12146 -949 Simulation\001
+4 1 -1 0 0 0 10 0.0000 6 135 480 12141 -457 (XML)\001
+4 1 -1 0 0 0 10 0.0000 6 150 465 12150 -720 options\001
+-6
+6 8325 -1620 10935 -360
+6 8460 -1170 10800 -495
+2 4 0 0 0 36 50 0 20 0.000 0 0 7 0 0 5
+ 10800 -495 8475 -495 8475 -1165 10800 -1165 10800 -495
+4 0 7 50 0 0 12 0.0000 4 180 1635 8565 -940 Configure run script\001
+4 0 6 50 0 2 12 0.0000 4 180 2145 8550 -675 Define simulation options\001
+-6
+2 2 0 0 0 44 54 0 20 0.000 0 0 -1 0 0 5
+ 8565 -1615 10140 -1615 10140 -1300 8565 -1300 8565 -1615
+2 4 0 1 0 34 52 0 20 0.000 0 0 7 0 0 5
+ 10935 -360 8340 -360 8340 -1300 10935 -1300 10935 -360
+4 0 0 50 0 16 14 0.0000 4 165 435 8610 -1390 GUI\001
+-6
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+ 1 0 1.00 60.00 120.00
+ 1665 720 2430 720
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 0 1.00 60.00 120.00
+ 5085 1890 6030 1890
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 0 1.00 60.00 120.00
+ 6480 1440 6480 990
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 0 1.00 60.00 120.00
+ 8190 990 8190 1440
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 4
+ 1 0 1.00 60.00 120.00
+ 8685 2025 9000 2025 9000 630 9720 630
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 5
+ 1 0 1.00 60.00 120.00
+ 6480 2745 6480 3015 9180 3015 9180 810 9720 810
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4
+ 1 0 1.00 60.00 120.00
+ 2437 1845 2070 1845 2070 2565 1665 2565
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+ 1 0 1.00 60.00 120.00
+ 12592 2430 13550 2430
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2
+ 1 0 1.00 60.00 120.00
+ 1 0 1.00 60.00 120.00
+ 12586 650 13544 650
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 0 1.00 60.00 120.00
+ 12105 -315 12105 270
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+ 1 0 1.00 60.00 120.00
+ 10935 -900 11700 -900
diff --git a/doc/user/graphics/halo.pdf b/doc/user/graphics/halo.pdf
new file mode 100644
index 0000000..b8b1f9b
Binary files /dev/null and b/doc/user/graphics/halo.pdf differ
diff --git a/doc/user/graphics/rota_perio_parall.jpg b/doc/user/graphics/rota_perio_parall.jpg
new file mode 100644
index 0000000..f5da98c
Binary files /dev/null and b/doc/user/graphics/rota_perio_parall.jpg differ
diff --git a/doc/user/graphics/vortex.fig b/doc/user/graphics/vortex.fig
new file mode 100644
index 0000000..5ff3119
--- /dev/null
+++ b/doc/user/graphics/vortex.fig
@@ -0,0 +1,36 @@
+#FIG 3.2 Produced by xfig version 3.2.5-alpha5
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 3315 4485 192 192 3315 4485 3507 4485
+1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 5943 6120 192 192 5943 6120 6135 6120
+1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 5869 2814 192 192 5869 2814 6061 2814
+1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 8370 4500 192 192 8370 4500 8562 4500
+2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3600 3150 8100 3150 8100 5850 3600 5850 3600 3150
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 1 1 2
+ 1 1 1.00 60.00 120.00
+ 1 1 1.00 60.00 120.00
+ 3600 2250 8100 2250
+2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 1 1 2
+ 1 1 1.00 60.00 120.00
+ 1 1 1.00 60.00 120.00
+ 9000 3150 9000 5850
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 3
+ 1 1 1.00 60.00 120.00
+ 1 1 1.00 60.00 120.00
+ 5850 3600 5850 4500 6750 4500
+4 0 0 50 -1 1 16 0.0000 0 195 510 9225 4500 LLY\001
+4 0 0 50 -1 1 16 0.0000 0 195 510 5400 1800 LLZ\001
+4 0 0 50 -1 1 16 0.0000 0 195 135 5895 6230 3\001
+4 0 0 50 -1 1 16 0.0000 0 195 135 5820 2910 1\001
+4 0 0 50 -1 1 16 0.0000 0 195 135 3240 4590 4\001
+4 0 0 50 -1 1 16 0.0000 0 195 135 8325 4635 2\001
+4 0 0 50 -1 1 16 0.0000 0 195 540 5355 4770 CEN\001
+4 0 0 50 -1 1 16 0.0000 0 195 600 6525 4815 DIR2\001
+4 0 0 50 -1 1 16 0.0000 0 195 600 5985 3780 DIR1\001
diff --git a/doc/user/input/addstudy.xml b/doc/user/input/addstudy.xml
new file mode 100644
index 0000000..f022fcd
--- /dev/null
+++ b/doc/user/input/addstudy.xml
@@ -0,0 +1,8 @@
+ <study label='GRADIENT' status='on'>
+ <variable label='gradient' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+
+ <case label='CAS1' status='on' compute='on'>
+ </case>
+ </study>
diff --git a/doc/user/input/autovalid.xml b/doc/user/input/autovalid.xml
new file mode 100644
index 0000000..0672d5e
--- /dev/null
+++ b/doc/user/input/autovalid.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<autovalid name="Validation Code_Saturne V1.4">
+ <referencepath>/home/saturne/BASEREF</referencepath>
+ <referenceversion>SaturneV1.4</referenceversion>
+
+ <study label='LAPLACIEN' status='on'>
+ <variable label='passif' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+ <variable label='Pression' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+ <variable label='VitesseX' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+
+ <case label='CAS1' status='on' compute='on'>
+ <post label='depou_elargb' status='off'> </post>
+ </case>
+
+ <case label='VERIF' status='on' compute='on'>
+ <post label='depou_elargb' status='off'> </post>
+ </case>
+
+ <case label='2PROCS' status='on' compute='on'>
+ <post label='depou_elargb' status='off'> </post>
+ <nproc>2</nproc>
+ </case>
+ </study>
+
+</autovalid>
diff --git a/doc/user/saturne1.tex b/doc/user/saturne1.tex
new file mode 100644
index 0000000..05d3a42
--- /dev/null
+++ b/doc/user/saturne1.tex
@@ -0,0 +1,7678 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2009 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\nopagebreak
+%==================================
+%==================================
+\section{Introduction}
+%==================================
+%==================================
+
+\CS is a system designed to solve the Navier-Stokes
+equations in the cases of 2D, 2D axisymmetric or 3D flows. Its main module is
+designed for the simulation of flows which may be steady or
+unsteady, laminar or turbulent, incompressible or potentially dilatable,
+isothermal or not. Scalars and turbulent fluctuations of scalars can be taken into
+account. The code includes specific modules, referred to as ``specific physics'',
+for the treatment of lagrangian particle tracking, semi-transparent radiative transfer,
+gas combustion, pulverised coal combustion,
+electricity effects (Joule effect and electric arcs) and compressible flows.
+The code also includes an engineering module, Matisse, for the simulation of
+nuclear waste surface storage.
+
+\CS 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.
+\CS 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.\footnote{You should have
+received a copy of the GNU General Public License
+along with \CS; if not, write to the
+Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor,
+Boston, MA 02110-1301 USA}
+
+
+\CS relies on a finite volume discretisation and allows the use of
+various mesh types which may be hybrid (containing several kinds of
+elements) and may have structural non-conformities (hanging nodes).
+
+
+\CS is composed of three main elements and an optional GUI,
+as shown on figure \ref{Fig_elements}:
+\begin{itemize}
+\item the Kernel module is the numerical solver
+\item the Preprocessor module is in charge of mesh import,
+mesh joining (arbitrary interfaces), and definition of periodicity
+boundary conditions (translation and/or rotation)
+\item the Partitioner is in charge of optimizing domain decomposition
+for parallel computing (optional, but highly recommended for parallel
+performance)\\
+\end{itemize}
+
+\begin{figure}[!h]
+\centerline{
+\includegraphics*[width=14cm]{cs_components}}
+\caption{\CS elements}\label{Fig_elements}
+\end{figure}
+
+\indent\CS also relies on two libraries (by the same team, under LGPL licence),
+which can also be used independently:
+\begin{itemize}
+\item BFT (Base Functions and Types) for the management of memory and input/output
+as well as specific utilities (estimation of time and memory usage for instance)
+\item FVM (Finite Volume Mesh) for the post-processing output and the management
+of code coupling
+\end{itemize}
+
+The present document is a practical user's guide for \CS version \verscs.
+It is the result of the joint effort of
+all the members in the development team.
+
+The aim of this document is to give practical information to the users of
+\CS. It is therefore strictly oriented towards the usage of the code.
+For more details about the algorithms and their numerical
+implementation, please refer to the reports \cite{mechitoua98} and
+\cite{boucker00}, and to the theoretical documentation \cite{theory},
+which is newer and more detailed
+(the latest updated version of this document
+is available on-line with the version of \CS and accessible through the command
+\texttt{cs\_info --guide theory}).
+
+The present document first
+presents all the necessary elements to run a calculation
+with \CS version \verscs. It then lists all the variables of the code
+which may be useful for more advanced utilisation.
+The user subroutines of all the modules within the code are then documented.
+Eventually, for each key word and user-modifiable parameter in the code,
+their definition, allowed values, default values and conditions for use are given.
+These key words and parameters are grouped under headings
+based on their function. An alphabetical index list is also given at the end of
+the document for easier consultation.
+
+
+
+%==================================
+%==================================
+\section{Practical information about \CS}
+%==================================
+%==================================
+
+%==================================
+\subsection{System Environment for \CS}
+%==================================
+
+%==================================
+\subsubsection{Preliminary settings}
+%==================================
+\label{prg_environnementCS}
+At the install procedure of \CS, a directory is dedicated to the code and
+its components. It is stored in the environment variable \texttt{PATHCS}.
+It is usually the root of a specific account \texttt{/home/saturne}.
+For installs outside EDF R\&D, please refer to the administrator who
+installed the code for the \texttt{PATHCS} location.
+
+The current version of \CS (\verscs) is located in the directory
+\texttt{\$PATHCS/Code\_Saturne/\verscs}.
+
+In order to use \CS, every user must add the following line in their file
+``\texttt{.profile}''\footnote{or \texttt{.monprofile} if the
+ modifications of the \texttt{.profile} file are reserved for the
+ administrators, as is the case in the MFEE department of EDF}:
+
+\hspace*{2cm}\texttt{export PATH=/path/to/saturne/\verscs/bin:\$PATH}\\
+where \texttt{xxxxxxx} represents the PATHCS directory where
+\CS and its components have been installed (refer to the administrator
+responsible for \CS).
+
+After adding this line to the \texttt{.profile}, it is necessary to
+logout of the session and relog in (simply reading the file by typing
+``\texttt{. \tildeunix/.profile}'' is usually not enough and might not
+set the \texttt{PATH} variable correctly for the whole session).
+
+{\em WARNING: Other pieces of information related
+to \CS must not be included in \texttt{.profile}. In particular,
+lines referring to previous versions of the code must be suppressed}
+
+
+%==================================
+\subsubsection{Standard architecture of the directories}
+%==================================
+\label{prg_architecture}%
+The standard architecture for the simulation studies is:
+
+\noindent
+A study directory containing:
+\begin{list}{$\bullet$}{}
+\item A directory \texttt{MESH} containing the mesh(es)
+ necessary for the study
+\item A directory \texttt{POST} for the potential post-processing routines (not
+used directly by the code)
+\item One or several calculation directories
+\end{list}
+
+\noindent
+Every calculation directory contains:
+\begin{list}{$\bullet$}{}
+\item A directory \texttt{SRC} for the potential user subroutines
+ necessary for the calculation
+\item A directory \texttt{DATA} for the calculation data (data
+ file from the interface, input profiles, thermo-chemical data, ...)
+\item A directory \texttt{SCRIPTS} for the launch script
+\item A directory \texttt{RESU} for the results\\
+To improve the calculation traceability, the files and directories
+sent to \texttt{RESU} after a calculation are given a suffix
+identifying the calculation start date and time by an eight-digit
+number (two digits for each month, day, hour and minute; the result of a
+calculation started at 14h03 on December 31$^{\text{st}}$ will therefore be indexed
+12311403)
+\end{list}
+
+\noindent
+In the standard cases, \texttt{RESU} contains a directory
+\texttt{CHR.ENSIGHT.mmddhhmm} with the post-processing files in {\em EnSight} format,
+a directory \texttt{RESTART.mmddhhmm} for the calculation
+ restart files,
+a directory \texttt{HIST.mmddhhmm} for the files of chronological
+ record of the results at specific locations (probes),\\
+\texttt{listpre.mmddhhmm} and \texttt{listing.mmddhhmm} files reporting the
+Preprocessor and the Kernel execution. For an easier follow-up of the modifications
+in former calculations, the user-subroutines used in a calculation are stored in
+a directory \texttt{SRC.mmddhhmm} in the directory \texttt{RESU}. The {\em Xml}
+Interface data file, thermo-chemical data files and launch script are also
+copied into the directory \texttt{RESU} with the appropriate suffix (whatever
+its name, the launch script appears in the directory \texttt{RESU} as
+\texttt{runcase.mmddhhmm}). \texttt{compil.log.mmddhhmm} and
+\texttt{summary.mmddhhmm} are respectively reports of the compilation phase and
+general information on the calculation (which kind of machine, which user, which
+version of the code, ...). Eventually, when the user subroutines produce
+specific result files (extraction of 1D profiles for instance), a
+directory \texttt{RES\_USERS.mmddhhmm} is created in the directory \texttt{RESU}
+for these files\footnote{in order for the script to copy them properly, their
+names have to be given in the variable \texttt{USER\_OUTPUT\_FILES}
+of the launch script, see \S\ref{prg_runcase}}.
+
+
+During calculations coupled with \syrthes (option specified in the launch
+script of \CS or {\em via} the Interface) the same organisation is used for the
+files related to \CS. For the files related
+ to \syrthes, the location of the upstream files is specified in the
+\texttt{syrthes.env} file. Yet, the launch script is built presuming that the
+following organisation is applied:
+\begin{list}{$\bullet$}{}
+\item a directory \texttt{SRC\_SYR} for the potential \syrthes user subroutines
+\item a directory \texttt{DATA\_SYR} containing the configuration file \texttt{syrthes.env}
+(location of files specific to \syrthes). The file defining the \syrthes
+calculation options (\texttt{syrthes.data}) and the potential restart files can
+also be placed in this directory.
+\end{list}
+
+The \syrthes result files (geometry file, chronological result files, calculation
+restart files and the historic file) are placed in a sub-directory
+\texttt{RESU\_SYR.mmddhhmm} of the \texttt{RESU} directory, where
+\texttt{mmddhhmm} corresponds to the calculation identification suffix.
+
+\sloppy
+
+\noindent
+The \syrthes execution report file is placed in the \texttt{RESU} directory (same as
+for the \CS review) under the name \texttt{listsyr.mmddhhmm} and the compilation
+report file is under the name \texttt{compil\_syrthes.log.mmddhhmm}.
+For an easier follow-up of the modifications
+in former calculations, the potential \syrthes user-subroutines used in a
+calculation are stored in a directory \texttt{SRC\_SYR.mmddhhmm} in the
+directory \texttt{RESU}.
+
+\fussy
+
+
+\begin{table}[!t]
+\begin{tabular}{lll}
+\multicolumn{3}{l}{Below are typical contents of a case directory CASE1 in a study STUDY} \\
+\multicolumn{3}{l}{(\CS calculation coupled with \syrthes):}\\
+\multicolumn{2}{l}{\texttt{STUDY/CASE1/DATA:}}&{\bf \CS data}\\
+& \texttt{SaturneGUI} &Graphical User Interface launch script\\
+& \texttt{study.xml} &Graphical User Interface parameter file\\
+& \texttt{THCH} &example of thermochemical files
+ (used with the specific\\
+& & physics modules for gas combustion,
+ pulverised coal \\
+& & or electric arcs)\\
+
+\multicolumn{2}{l}{\texttt{STUDY/CASE1/DATA\_SYR:}}&{\bf \syrthes data}\\
+& \texttt{syrthes.data} &\syrthes data file \\
+& \texttt{syrthes.env} &\syrthes configuration file\\
+\multicolumn{2}{l}{\texttt{STUDY/CASE1/SRC:}}&{\bf \CS user subroutines }\\
+& \texttt{REFERENCE} & examples of a user subroutines\\
+& \texttt{usclim.F} &user subroutines used for the present the calculation\\
+& \texttt{usini1.F} &\\
+\multicolumn{2}{l}{\texttt{STUDY/CASE1/RESU:}}&{\bf results}\\
+& \texttt{CHR.ENSIGHT.08211921} &directory containing the \CS
+ post-processing results\\
+& &in the {\em EnSight} format for the
+ calculation 08211921\\
+& &(contains both volume and boundary results;\\
+& &the contents of the directory are user
+ modifiable)\\
+& \texttt{SRC.08211921} &\CS user subroutines
+ used for the\\
+& &calculation 08211921\\
+& \texttt{SRC\_SYR.08211921} &\syrthes user subroutines
+ used in the calculation 08211921\\
+& \texttt{HIST.08211921} &directory containing the chronological
+ records for \CS\\
+& \texttt{RES\_USERS.08211921} &optional directory containing the
+ user results files\\
+& \texttt{RESTART.08211921} &directory containing the \CS restart files \\
+& \texttt{compil.log.08211921} &compilation report\\
+& \texttt{study.xml.08211921} &Graphical User Interface parameter file
+ used for the\\
+& &calculation 08211921\\
+& \texttt{runcase.08211921} &launch script used for the calculation 08211921\\
+& &(whatever the name given to the file in the
+ \texttt{SCRIPT} directory,\\
+& & the file will be referred as
+ ``\texttt{runcase.*}'' in the
+ \texttt{RESU} directory)\\
+& \texttt{listpre.08211921} &execution report for the Preprocessor module of
+ \CS\\
+& \texttt{listing.08211921} &execution report for the Kernel module of \CS\\
+& \texttt{listsyr.08211921} &execution report for \syrthes\\
+& \texttt{summary.08211921} &general information (machine, user, version, ...)\\
+& \texttt{RESU\_SYR.08211921:} &{\bf \syrthes results (file names given in
+the
+ \texttt{syrthes.env} file)}\\
+& \hspace*{0.3cm}\texttt{geoms} &\syrthes \ solid geometry file\\
+& \hspace*{0.3cm}\texttt{histos1}&\syrthes chronological records at
+ specified probes\\
+& \hspace*{0.3cm}\texttt{resus1}&\syrthes calculation restart file (1
+ time step)\\
+& \hspace*{0.3cm}\texttt{resusc1}&\syrthes chronological solid
+ post-processing file (may be transformed \\
+& &into the {\em EnSight} format with the
+ {\em syrthes2ensight} utility)\\
+\multicolumn{2}{l}{\texttt{STUDY/CASE1/SCRIPTS:}}&{\bf launch script}\\
+& \texttt{runcase} &launch script (compliant with all
+ architectures on which \\
+& & \CS has been ported)\\
+\end{tabular}
+\end{table}
+
+\clearpage
+
+
+%==================================
+\subsubsection{\CS Kernel library files}
+%==================================
+\label{prg_library}%
+Below are given information about the content of the \CS base directories. They
+are not of vital interest for the user, but given only as general
+information. Indeed, the case preparer \texttt{cs\_create} automatically extracts the
+necessary files and prepares the launch script without the user having to go
+directly into the \CS base directories (see \S\ref{prg_cscreate}).
+The \texttt{cs\_info} gives direct
+access to the most needed information (especially the user and programmer's
+guides and the tutorial) without the user having to look for them in the \CS
+directories.
+
+
+The subdirectory \texttt{arch} contains the libraries and compiled
+executables, followed by a subdirectory allowing to distinguished the
+architectures (named as referenced here after):
+\begin{list}{$\bullet$}{}
+\item\texttt{Blue\_Gene\_L} for the EDF BlueGene/L machine
+\item\texttt{Blue\_Gene\_P} for the EDF BlueGene/P machine
+\item\texttt{Linux} for general 32-bit Intel or AMD machines under Linux
+\item\texttt{Linux\_x86\_64} for general 64-bit Intel or AMD machines under Linux
+\item\texttt{Linux\_Ch} for the Chatou cluster
+\item\texttt{Linux\_IA64} for Itanium clusters (Platine cluster at the CCRT)
+\end{list}
+
+For each architecture, a subdirectory (named after \texttt{NOM\_ARCH})
+stores the compiled library (\texttt{libsaturne.so} in \texttt{lib}
+and executable in
+\texttt{bin}\footnote{This executable is used only for standalone mesh
+analysis or when no user routines are defined. In a standard \CS run,
+the executable is recompiled to allow for user routines to be taken
+into account.}).
+
+The data files (for instance thermochemical data) are located in the
+directory \texttt{data}.
+
+The source files, when available, are stored in the directory \texttt{src},
+under subdirectories corresponding to each module: \texttt{base} (general
+routines), \texttt{cfbl} (compressible flows),
+\texttt{cogz} (gas combustion),
+\texttt{cplv} (pulverised coal combustion), \texttt{elec} (electric module),
+\texttt{fuel} (heavy fuel oil combustion module),
+\texttt{lagr} (lagrangian module,
+\texttt{mati} (Matisse module),
+\texttt{pprt} (general specific physics routines) and \texttt{rayt} (radiative heat
+transfer).
+
+The user subroutines are available in the directory \texttt{users},
+under similar subdirectories corresponding to each module: \texttt{base},
+\texttt{cfbl}, \texttt{cogz}, \texttt{cplv}, \texttt{elec},
+\texttt{fuel}, \texttt{lagr}, \texttt{pprt} and \texttt{rayt}.
+The case preparer \texttt{cs\_create} copies all these files in the
+user directory \texttt{SRC/REFERENCE} during the case preparation.
+
+The ``include'' files are available in the directory
+\texttt{include}, under similar subdirectories corresponding to each module:
+\texttt{base}, \texttt{cfbl}, \texttt{cogz}, \texttt{cplv}, \texttt{elec},
+\texttt{fuel}, \texttt{lagr}, \texttt{mati}, \texttt{pprt} and \texttt{rayt}.
+
+The directory \texttt{bin} contains an example of the launch script, the
+compilation parameter files and various utility programs.
+
+%==================================
+\subsection{Setting up and running of a calculation}
+%==================================
+
+%==================================
+\subsubsection{Step by step calculation}
+%==================================
+
+This paragraph summarises the different steps which are necessary to
+prepare and run a standard case:
+
+\begin{list}{$\bullet$}{}
+
+\item Check the version of \CS set for use in the environment variables
+(\texttt{cs info --version}). If it does not correspond to the desired version,
+update the \texttt{.profile} file to set the environment
+variables correctly. Log out of the session and
+log in again to take the modifications into account properly (cf.
+\S\ref{prg_environnementCS}).
+
+\item Prepare the different directories using \texttt{cs create}(see
+\S\ref{prg_cscreate}) and, when needed, add the directories \texttt{DATA\_SYR}
+and \texttt{SRC\_SYR} which are required to accomodate the \syrthes files.
+
+\item Place the mesh(es) in the directory \texttt{MESH}. Make sure they are
+in a format compliant with \CS (see \S\ref{prg_maillages}). There can be
+several meshes in case of mesh joining or coupling with
+\syrthes\footnote{\syrthes uses meshes composed of 10-node tetrahedra (vertices
+and centers of edges)}.
+
+\item Go to the directory \texttt{DATA} and launch the
+ Graphical User Interface using the command \texttt{./SaturneGUI} (see
+\S\ref{prg_gui}).
+
+\item Place the necessary user subroutines in the directory \texttt{SRC} (see
+\S\ref{prg_ssprgutilis}). When not using the Interface, some subroutines are
+compulsory.
+
+\begin{list}{}{}
+
+\item {\bf For the standard physics:}
+
+ \begin{list}{}{}
+ \item {\em compulsory without Graphical User Interface:}
+ \begin{list}{-}{}
+ \item \texttt{usini1} to specify the calculation parameters
+
+ \item \texttt{usclim} to manage the boundary conditions
+ \end{list}
+
+ \item {\em very useful:}
+ \begin{list}{-}{}
+ \item \texttt{usphyv} to manage the variable physical
+ properties (fluid density, viscosity ...)
+
+ \item \texttt{usiniv} to manage the non-standard initialisations
+ \end{list}
+ \end{list}
+
+ \item{\bf For the specific physics ``gas combustion'':}
+
+(not compliant with the Graphical User Interface in version \verscs)
+ \begin{list}{}{}
+ \item {\em compulsory:}
+ \begin{list}{-}{}
+ \item \texttt{usini1} to specify the calculation parameters
+
+ \item \texttt{usppmo} to select a specific physics module and
+ combustion model
+
+ \item \texttt{usebuc}, \texttt{usd3pc} or \texttt{uslwcc}
+ (depending on the selected combustion model) to manage the
+ boundary conditions of {\em all variables} ({\em i.e.} not only
+ the ones related to the combustion model)
+ \end{list}
+
+ \item {\em very useful:}
+ \begin{list}{-}{}
+ \item \texttt{usebu1}, \texttt{usd3p1} or \texttt{uslwc1}
+ (depending on the selected combustion model)
+ to specify the calculation options
+ for the variables
+ corresponding to combustion model
+
+ \item \texttt{usebui}, \texttt{usd3pi} or \texttt{uslwci}
+ (depending on the selected combustion model)
+ to manage the initialisation of the variables
+ corresponding to the combustion model
+ \end{list}
+ \end{list}
+
+ \item{\bf For the specific physics ``coal combustion'':}
+
+ \begin{list}{}{}
+ \item {\em compulsory without Graphical User Interface:}
+ \begin{list}{-}{}
+ \item \texttt{usini1} to specify the calculation parameters
+
+ \item \texttt{usppmo} to select the specific physics module
+
+ \item \texttt{uscpcl} or \texttt{uscplc} (depending on the
+ specific physics module) to manage the
+ boundary conditions of {\em all variables} ({\em i.e.} not only
+ the ones related to the specific physics module)
+ \end{list}
+
+ \item {\em very useful:}
+ \begin{list}{-}{}
+ \item \texttt{uscpi1}
+ to specify the calculation options
+ for the variables
+ corresponding to the specific physics module
+
+ \item \texttt{uscpiv} to manage the initialisation of the
+ variables corresponding to the specific physics module
+ \end{list}
+ \end{list}
+
+ \item{\bf For the specific physics ``electric module''
+ (Joule effect and electric arc):}
+
+(not compliant with the Graphical User Interface in version \verscs)
+ \begin{list}{}{}
+ \item {\em compulsory:}
+ \begin{list}{-}{}
+ \item \texttt{usini1} to specify the calculation parameters
+
+ \item \texttt{usppmo} to select the specific physics module
+
+ \item \texttt{uselcl} to manage the boundary conditions of {\em all
+ variables} ({\em i.e.} not only
+ the ones related to the electric module)
+
+ \item \texttt{useliv} to initialise the enthalpy in
+ case of Joule effect
+
+ \item \texttt{uselph} to define the physical
+ properties in case of Joule effect
+ \end{list}
+
+ \item {\em very useful:}
+ \begin{list}{-}{}
+ \item \texttt{useli1} to manage the options related
+ to the variables corresponding to the electric module
+
+ \item \texttt{useliv} to manage the initialisation of the
+ variables corresponding to the electric module
+ \end{list}
+ \end{list}
+
+ \item{\bf For the specific physics ``heavy fuel oil combustion module'':)}
+
+(not compliant with the Graphical User Interface in version \verscs)
+ \begin{list}{}{}
+ \item {\em compulsory:}
+ \begin{list}{-}{}
+ \item \texttt{usini1} to specify the calculation parameters
+
+ \item \texttt{usppmo} to select the specific physics module
+
+ \item \texttt{usfucl} to manage the
+ boundary conditions of {\em all variables} ({\em i.e.} not only
+ the ones related to the specific physics module)
+ \end{list}
+
+ \item {\em very useful:}
+ \begin{list}{-}{}
+ \item \texttt{usfui1}
+ to specify the calculation options
+ for the variables
+ corresponding to the specific physics module
+
+ \item \texttt{usfuiv} to manage the initialisation of the
+ variables corresponding to the specific physics module
+ \end{list}
+ \end{list}
+
+
+ \item{\bf For the Lagrangian module (dispersed phase):}
+
+(the continuous phase is managed in the same way as for a case of standard
+physics)\\
+(the Lagrangian module is not compliant with the Graphical User Interface in
+version \verscs)
+ \begin{list}{}{}
+ \item {\em compulsory:}
+ \begin{list}{-}{}
+ \item \texttt{uslag1} to manage the calculation conditions
+
+ \item \texttt{uslag2} to manage the boundary conditions for the
+ dispersed phase
+
+ \end{list}
+
+ \item {\em very useful:}
+ \begin{list}{-}{}
+ \item \texttt{uslabo} to manage potential specific treatments at the
+ boundaries (rebound conditions, specific statistics, ...)
+ \end{list}
+ \end{list}
+
+ \item {\bf For the compressible module:}
+
+(not compliant with the Graphical User Interface in version \verscs)
+ \begin{list}{}{}
+ \item {\em compulsory:}
+ \begin{list}{-}{}
+ \item \texttt{uscfx1} et \texttt{uscfx2} to manage the
+ calculation parameters
+
+ \item \texttt{uscfcl} to manage the boundary conditions
+
+ \item \texttt{uscfth} to define the thermodynamics.
+ \end{list}
+
+ \item {\em very useful:}
+ \begin{list}{-}{}
+ \item \texttt{uscfxi} to manage non-standard initialisations of the variables
+ \end{list}
+ \end{list}
+
+\end{list}
+
+
+The comprehensive list of the user subroutines and their instructions
+ for use are given in \S\ref{prg_ssprgutilis}.
+
+\item If necessary, place in the directory \texttt{DATA} the different
+ external data (input profiles, thermochemical data files, ...)
+
+\item Prepare the launch script \texttt{runcase}, directly or through the
+ Graphical Interface (see \S\ref{prg_runcase})
+
+\item Run the calculation and analyse the results
+
+\item Purge the temporary files (in the directory \texttt{RUN} defined
+ in the launch script, see \S\ref{prg_runcase})
+\end{list}
+
+
+%==================================
+\subsubsection{Temporary execution directory}
+%==================================
+\label{prg_temporarydirectory}%
+During a calculation, \CS uses a temporary directory for the compilation and
+the execution, the result files being only copied at the end in the directory
+\texttt{RESU}. This temporary directory is defined in the variable \texttt{RUN}
+of the launch script. This variable is set top a default value in the non-user
+section of the launch script, depending on the architecture:\\
+\texttt{RUN=\$HOME/tmp\_Saturne/\$STUDY/\$CASE.mmddhhmm} for stand-alone
+workstations or for the Chatou cluster\\
+\texttt{RUN=\$SCRATCHDIR/tmp\_Saturne/\$STUDY/\$CASE.mmddhhmm} for
+Platine at the CCRT\\
+where \texttt{\$STUDY} and \texttt{\$CASE} are the names of the study and the
+case. The usual suffix with the date and time is added so that successive
+calculations will not get mixed-up.
+
+This default value might not always be the optimal choice. Indeed, on a
+stand-alone machine, it might be useful to take advantage of large sized local
+disks on a machine when the \texttt{\$HOME} account is on an NFS disk.
+
+For this matter, the variable \texttt{CS\_TMP\_PREFIX} of the launch script (see
+\S\ref{prg_runcase}) allows the user to change this directory.
+If the variable is empty, the default
+\texttt{RUN} directory will be used. If it is not empty, the launch script will
+set the \texttt{RUN} directory to
+\texttt{\$CS\_TMP\_PREFIX/tmp\_Saturne/\$STUDY/\$CASE.mmddhhmm}.
+
+\noindent
+{\em WARNING: in most cases, the temporary directories are not deleted
+after a calculation. They will accumulate and may hinder the correct running of
+the machine.\\
+\centerline{\bf It is therefore essential to remove them regularly.}}
+
+
+%==================================
+\subsubsection{Execution modes}
+%==================================
+\label{prg_executionmodes}%
+As explained before, \CS is composed of two main modules, the Preprocessor and the
+Kernel, and an optional Partitioner. The Preprocessor reads the meshes and
+performs the necessary joinings. The Partitioner optimizes domain decomposition
+for parallel runs. The resulting data is transfered to the Kernel through specific
+files, named \texttt{preprocessor\_output} and \texttt{domain\_number\_*}, where
+\texttt{*} is the number of processors used. In a standard calculation, the files
+are not copied from the temporary execution directory to the results directory,
+as they have no interest for data analysis, and are considered ``internal''
+files, whose format or contents is not guaranteed not to change between \CS versions.
+
+Yet, the Preprocessor and Partitioner do not work in parallel and may require a
+large amount of memory. Hence it is sometimes useful to run them
+separately, on a machine or in batch queues with extended memory, and to run the
+proper parallel calculation on another machine or in another batch
+queue. The launch scripts therefore allows specifically choosing
+which modules to run, using the variables \texttt{EXEC\_PREPROCESS},
+\texttt{EXEC\_PARTITION}, and \texttt{EXEC\_KERNEL} (see \S\ref{prg_runcase}).
+
+\sloppy
+
+\hspace*{0.5cm} If \texttt{EXEC\_PREPROCESS=no}, the Partitioner and Kernel will
+copy or link the file defined by the \texttt{PREPROCESSOR\_OUTPUT\_IN}
+variable to \texttt{preprocessor\_output}.
+
+\hspace*{0.5cm} If \texttt{EXEC\_PARTITION=no}, the Kernel will search for a
+corresponding \texttt{domain\_number\_*} file in the directory defined by
+\texttt{PARTITION\_OUTPUT\_IN}.
+
+\hspace*{0.5cm} If \texttt{EXEC\_KERNEL=no}, the Preprocessor and Partitioner
+output will be saved respectively to a
+\texttt{\$RESU/preprocessor\_output.\$SUFFIX} file
+and to a \texttt{\$RESU/PARTITION\_OUTPUT.\$SUFFIX} directory.
+In this case, the number of processors for which partitioning is required
+is given by the \texttt{PARTITION\_LIST} variable of the launch script
+(multiple partitionings may be done in one run).
+
+\fussy
+
+%==================================
+\subsubsection{Interactive modification of the target time step}
+%==================================
+\label{prg_ficstp}%
+During a calculation, it is possible to change the limit time step number
+(\texttt{ntmabs}) specified through the Interface or in \texttt{usini1}.
+To do so, a file named \texttt{ficstp} must be placed in the temporary
+execution directory (see \S\ref{prg_temporarydirectory}).
+This file must contain a blank first line and
+the second line indicating the value of the new limit number of time steps.\\
+If this new limit has already been passed in the calculation, \CS will stop
+properly at the end of the current time step (the results and restart files
+will be written correctly).\\
+This procedure allows the user to stop a calculation in a clean and interactive
+way whenever they wish.
+
+
+%==================================
+\subsection{Case preparer}
+%==================================
+\label{prg_cscreate}%
+The case preparer \texttt{cs create} automatically creates a
+study directory according to the typical architecture and copies and
+pre-fills an example of calculation launch script.
+
+The syntax of \texttt{cs create} is as follows:
+
+\noindent
+\texttt{cs create --study STUDY CASE\_NAME1 CASE\_NAME2...}\\
+creates a study directory \texttt{STUDY} with case subdirectories
+\texttt{CASE\_NAME1} and \texttt{CASE\_NAME2}...
+If no case name is given, a default case directory called \texttt{CASE1} is
+created.
+
+\noindent
+\texttt{cs create --case DEBIT3 --case DEBIT4}\\
+executed in the directory \texttt{STUDY} adds the case directories
+\texttt{DEBIT3} and \texttt{DEBIT4}.
+
+An option \texttt{--nogui} is available for the use of \CS
+without Graphic Interface (see \S\ref{prg_gui}). This option must
+be either the first or the last argument and appear only once.
+
+In the directory \texttt{DATA}, \texttt{cs create} places a
+subdirectory \texttt{THCH} containing examples of thermochemical data
+files used for pulverised coal combustion,
+gas combustion or electric arc. The file to be used for the calculation must be
+copied directly in the \texttt{DATA} directory and its name must be referenced
+in the launch script in the variable THERMOCHEMISTRY\_DATA. All other files in
+the \texttt{DATA} or in the \texttt{THCH} will be ignored.\\
+\texttt{cs create} also places in the directory \texttt{DATA} the launch script
+for the Graphical User Interface: \texttt{SaturneGUI}.
+
+
+In the directory \texttt{SRC}, \texttt{cs create} creates a
+subdirectory \texttt{REFERENCE} containing all the user subroutines,
+classified by module type: \texttt{base},
+\texttt{cfbl}, \texttt{cogz}, \texttt{cplv}, \texttt{elec}, \texttt{fuel},
+\texttt{lagr}, \texttt{pprt} and \texttt{rayt}.
+Only the user subroutines placed directly under
+the directory \texttt{SRC} will be considered. The others will be ignored.
+
+In the directory \texttt{SCRIPTS}, \texttt{cs create} copies and pre-fills an
+example of the launch script: \texttt{runcase}.
+The study, case and user name are filled
+automatically in the launch script, as are the paths leading to the
+different directories. Other parameters must be specified in the script
+(see \S\ref{prg_runcase}),
+especially the mesh file(s) to use, but everything can be specified
+through the Graphical Interface.
+
+\smallskip \noindent
+
+%==================================
+\subsection{Supported mesh and post-processing output formats
+\label{sec:formats}}
+%==================================
+
+\CS supports multiple mesh formats, all of these having been requested
+at some time by users or projects based on their meshing or post-processing
+tools. All of these formats have advantages and disadvantages (in terms
+of simplicity, functionality, longevity, and popularity) when compared to
+each other. The following formats are currently supported by \CS:
+
+\begin{list}{-}{}
+
+\item \hyperref[fmtdesc:des]{\simail (NOPO)}
+\item \hyperref[fmtdesc:unv]{\ideas universal}
+\item \hyperref[fmtdesc:igghexa]{NUMECA IGG/Hexa}
+\item \hyperref[fmtdesc:med]{\med}
+\item \hyperref[fmtdesc:cgns]{CGNS}
+\item \hyperref[fmtdesc:ensight6]{\ensight 6}
+\item \hyperref[fmtdesc:ensightg]{\ensightg}
+\item \hyperref[fmtdesc:neu]{\gambit neutral}
+\item \hyperref[fmtdesc:gmsh]{\gmsh}
+\item \hyperref[fmtdesc:ngeom]{pro-STAR/STAR4}
+\item \hyperref[fmtdesc:ccm]{STAR-CCM+}
+\end{list}
+
+These formats are described in greater detail in the following sections.
+Unless a specific option is used, the \pcs determines the mesh format directly
+from the file suffix: %
+{\em``\texttt{.case}''} for the \ensight (6 or Gold),
+{\em``\texttt{.ccm}''} for STAR-CCM+,
+{\em``\texttt{.cgns}''} for CGNS,
+{\em``\texttt{.des}''} for \simail,
+{\em``\texttt{.hex}''} fot IGG/Hexa,
+{\em``\texttt{.med}''} for \med,
+{\em``\texttt{.msh}''} for \gmsh,
+{\em``\texttt{.neu}''} for \gambit neutral,
+{\em``\texttt{.ngeom}''} for pro-STAR/STAR4,
+{\em``\texttt{.unv}''} for I-deas universal.
+
+Note that the preprocessor can read zipped mesh files directly (for Formats
+other than MED or CGNS, which use specific external libraries) on most machines.
+
+%==================================
+\subsubsection{Formats supported for input\label{sec:formats_in}}
+%==================================
+
+\subsubsubsection{NOPO/\simail (INRIA/SIMULOG)%
+\label{fmtdesc:des}}
+
+This format output by \simail is still heavily used at MFEE. We do not
+currently handle cylindrical or spherical coordinate, but it seems that
+\simail always outputs meshes in cartesian coordinates, even if points
+have been defined in another system. Most ``classical'' element types
+are usable, except for pyramids.
+
+Note that depending on the architecture on which a file was
+produced by \simail,\footnote{``little endian'' on Intel or AMD processors, or
+``big endian'' on most others, and starting with \simail 7, 32-bit or 64-bit
+ integer and floating-point numbers depending on architecture},
+it may not be directly readable by \simail on a different machine, while
+this is not a problem for the \pcs, which automatically detects the
+byte ordering and the 32/64 bit variant and adjusts accordingly.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .des}\\
+\hline
+File type: & semi-portable ``Fortran'' binary (IEEE integer and
+ floating-point numbers on 4 or 8 bytes, depending on
+ 32 or 64 bit \simail version, bytes also ordered based
+ on the architecture)\\
+\hline
+Surface elements: & triangles, quadrangles
+ (+ volume element face references)\\
+\hline
+Volume elements: & tetrahedra, prisms, hexahedra\\
+\hline
+Zone selection: & element face references and volume sub-domains\\
+ & (interpreted as numbered colors)\\
+\hline
+Compatibility: & all files of this type as long as the coordinate
+ system used is cartesian and not cylindrical or
+ spherical\\
+\hline
+Documentation: & Simail user documentation and release notes or
+ MODULEF documentation:
+ \url{http://www-rocq.inria.fr/modulef} \par
+ Especially: \par
+ \url{http://www-rocq.inria.fr/modulef/Doc/FR/Guide2-14/node49.html} \\
+\hline
+\end{tabular}
+
+\subsubsubsection{\ideas universal file%
+\label{fmtdesc:unv}}
+
+This format was heavily used in the 1990's and early 2000's, and though
+the I-deas tool has not focused on the CFD (or even meshing) market since
+many years, it is handled (at least in part) by many tools, and may
+be considered as a major ``legacy'' format. It may contain many different
+datasets, relative to CAD, meshing, materials, calculation results,
+or part representation. Most of these datasets are ignored by CS,
+and only those relative to vertex, element, group, and coordinate system
+definitions are handled.
+
+This format's definition evolves with \ideas versions, albeit in a limited
+manner: some datasets are declared obsolete, and are replaced by others,
+but the definition of a given dataset type is never modified. Element and
+Vertex definitions have not changed for many years, but group definitions
+have gone through several dataset variants through the same period,
+usually adding minor additional group types not relevant to meshing.
+If one were to read a file generated with a more recent version of \ideas
+for which this definitions would have changed with no update in the \pcs,
+as the new dataset would be unknown, it would simply be ignored.
+
+Note that this is a text format. Most element types are handled, except
+for pyramids.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .unv}\\
+\hline
+File type: & text\\
+\hline
+Surface elements: & triangles, quadrangles\\
+\hline
+Volume elements: & tetrahedra, prisms, hexahedra\\
+\hline
+Zone selection: & colors (systematic) and named groups\\
+\hline
+Compatibility: & \ideas (\emph{Master Series} 5 to 9, \emph{NX Series} 10 to 12)
+ at least\\
+\hline
+Documentation: & Online I-deas NX Series documentation\\
+\hline
+\end{tabular}
+
+\subsubsubsection{\gambit neutral%
+\label{fmtdesc:neu}}
+
+This format may be produced by Ansys \fluent's GAMBIT meshing tool.
+As this tool does not export meshes to other formats directly handled
+by the \pcs (though \fluent itself may export files to the CGNS or
+\ideas universal formats), it was deemed useful to enable the \pcs
+to directly read files in \gambit neutral format.
+
+Note that this is a text format. ``Classical'' element types are usable.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .neu}\\
+\hline
+File type: & text\\
+\hline
+Surface elements: & triangles, quadrangles\\
+\hline
+Volume elements: & tetrahedra, pyramids, prisms, hexahedra\\
+\hline
+Zone selection: & boundary conditions for faces, element groups for cells\\
+ & (interpreted as named groups)\\
+\hline
+Documentation: & GAMBIT on-line documentation\\
+\hline
+\end{tabular}
+
+\subsubsubsection{pro-STAR%
+\label{fmtdesc:ngeom}}
+
+This polyhedral format from CD-Adapco seems to be usable both with the
+\starcd et \starccmp tools, and the \textbf{pro-STAR} tool should be able to
+generate it. The test meshes we have were generated by the
+\textbf{Comet-Design} tool, which has since been replaced by other
+CD-Adapco tools, especially \starcd V4 and \starccmp. The available
+test cases are thus not extensive in terms of functionality (especially
+when considering definition of descriptions), so support for this format
+is lightly tested.
+
+Currently, geometric entity numbers are converted to ``color'' numbers.
+This tends to lead to a large number of colors.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .ngeom}\\
+\hline
+File type: & binary file using portable XDR encoding.\\
+\hline
+Surface elements: & polygons\\
+\hline
+Volume elements: & polyhedra\\
+\hline
+Zone selection: & face and cell sets\\
+ & (interpreted as numbered colors)\\
+\hline
+Compatibility: & all files of this type ? (tested on purely polyhedral meshes)\\
+\hline
+Documentation: & documentation accompanying and source code provided by CD-adapco in
+ the context of a collaboration with UMIST (now
+ University of Manchester) and EDF R\&D/MFEE\\
+\hline
+\end{tabular}
+
+\subsubsubsection{\starccmp%
+\label{fmtdesc:ccm}}
+
+This polyhedral format is the current CD-Adapco format, and is based on
+CD-Adapco's libccmio, which also requires a modified ADF library (ADF
+is the low-level file format used by CGNS prior to the shift to HDF-5).
+
+Currently, geometric entity numbers are converted to ``color'' numbers,
+with the corresponding names printed to the \pcs log. Depending on whether
+the names were generated automatically or set by the user, it would be
+preferable to interpret such sets as named ``groups'' rather than numbered
+``colors''.
+
+The CCMIO library may also be downloaded through the VisIt visualization
+tool's third party library at \url{https://wci.llnl.gov/codes/visit/source.html}.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .ccm}\\
+\hline
+File type: & binary file using modified ADF library.\\
+\hline
+Surface elements: & polygons\\
+\hline
+Volume elements: & polyhedra\\
+\hline
+Zone selection: & named face and cell sets\\
+ & (interpreted as numbered colors, with names appearing in log)\\
+\hline
+Compatibility: & all files of this type ? (tested on purely polyhedral meshes)\\
+\hline
+Documentation: & documentation and source code provided by CD-adapco\\
+\hline
+\end{tabular}
+
+\subsubsubsection{\ensight 6%
+\label{fmtdesc:ensight6}}
+
+This format is used for output by the \emph{Harpoon} meshing tool, developed
+by Sharc Ltd (also the distributor of \ensight for the United Kingdom).
+It is also the default output format for some older tools developed or used
+at MFEE (including versions 1.0 and 1.1 of \CS).
+This format may represent all ``classical'' element types.
+
+Designed for post processing, it does not explicit handle the definition
+of surface patches or volume zones, but allows the use of many \emph{parts}
+(i.e. groups of elements) which use a common vertex list.
+A possible convention (used at least by \emph{Harpoon}) is to add surface
+elements to the volume mesh, using one \emph{part} per group. The volume
+mesh may also be separated into several \emph{parts} so as to identify
+different zones. As \emph{part} names may contain up to 80 characters,
+we do not transform them into groups (whose names could be unwieldy),
+so we simply interpret their number as a color.
+
+Also note that files produced by \emph{Harpoon} may contain badly oriented
+prisms, so the Preprocessor orientation correction option
+(\texttt{--reorient})may need to be used. Meshes built by this tool also
+contain hanging nodes, with non-conforming elements sharing some vertices.
+The \texttt{--join --semi-conf} preprocessor option must thus be used.
+This option is not set automatically, as the user may prefer to specify
+which surfaces should be joined, and which ones should not (i.e. to
+conserve thin walls).
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .case}\\
+\hline
+File type: & text file (extension \emph{.case}), and text,
+ binary, or Fortran binary file with
+ (\emph{.geo} extension), describing the integers
+ describing integers and floats in the IEEE format,
+ using 32 bits\\
+\hline
+Surface elements: & triangles, quadrangles\\
+\hline
+Volume elements: & tetrahedra, pyramids, prisms, hexahedra\\
+\hline
+Zone selection: & part numbers interpreted as color numbers\\
+\hline
+Compatibility: & All files of this type\\
+\hline
+Documentation: & online documentation, also available at:
+ \href{http://www.ensight.com/downloads/cat\_view-5.html}
+ {http://www.ensight.com/downloads/cat\_view-5.html}\\
+\hline
+\end{tabular}
+
+\subsubsubsection{\gmsh%
+\label{fmtdesc:gmsh}}
+
+This format is used by the free \href{http://www.geuz.org/gmsh}{\gmsh}
+tool. This tool has both meshing and post-processing functionality,
+but \CS only imports meshes.
+
+Note that some meshes produced by\gmsh man contain some badly oriented
+elements, so the Preprocessor's \texttt{-reorient} option may be necessary.
+
+The Preprocessor handles versions 1 and 2 of this array. In version 1,
+two labels are associated with each element: the first defines the
+element's physical entity number, the second defines it' elementary
+entity number. Using version 2, it is possible to associate an
+arbitrary number of labels with each element, but files produced
+by \gmsh use 2 labels, with the same meanings as with version 1.
+
+We chose to convert physical entity numbers to colors. It is possible
+to build a mesh using \gmsh without defining any physical entities
+(in which case all elements will have the same color, but the \gmsh
+documentation clearly says that geometric entities are to be used
+so as to group elementary entities having similar ``physical'' meanings.
+
+So as to obtain distinct colors with a mesh generated by \gmsh, it
+is thus necessary for the user to define physical entities.
+This requires an extra step, but allows for fine-grained control
+over the colors associated with the mesh, while using only elementary
+entities could lead to a high number of colors.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .msh}\\
+\hline
+Type de fichier~: & text or binary file\\
+\hline
+Surface elements: & triangles, quadrangles\\
+\hline
+Volume elements: & tetrahedra, pyramids, prisms, hexahedra\\
+\hline
+Zone selection: & physical entity numbers interpreted as color numbers\\
+\hline
+Compatibility: & all files of this type\\
+\hline
+Documentation: & included documentation, also available at:
+ \href{http://www.geuz.org/gmsh}
+ {http://www.geuz.org/gmsh}\\
+\hline
+\end{tabular}
+
+\subsubsubsection{IGG/Hexa (NUMECA)%
+\label{fmtdesc:igghexa}}
+
+This format is quite peculiar in the sense that it defines a hierarchical mesh
+built exclusively of hexahedra, of quadrangular faces, and of edges, in which
+edges may be split in 2, faces in 2 or 4, and cells in 2, 4, or 8. Two
+neighboring elements are thus not always conforming. The \pcs only keeps the
+finest mesh level, and uses the hierarchical information so as to
+automatically build the appropriate conformal joining. CAD face
+information is transformed into color numbers.
+
+\noindent
+\parbox[t]{.15\linewidth}{{\bf Remark}:}
+\parbox[t]{.85\linewidth}{
+ The reader is based on the IGG/Hexa format as it was defined at the end of
+ 2001. Since that time, the mesher seems to have been renamed $HEXPRESS^{TM}$, and
+ we do not have any recent documentation or test file. For this reason,
+ support for this format is not directly included in the main \pcs executable,
+ but requires conversion using the \texttt{igghexa\_to\_med} tool.
+}
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .hex}\\
+\hline
+File type: & portable binary by default
+ (4-byte integers, 8-byte IEEE double-precision reals,
+ big-endian), or text\\
+\hline
+Surface elements: & quadrangles\\
+\hline
+Volume elements: & hexahedra\\
+\hline
+Zone selection: & no volume selection, CAD surface numbers interpreted as
+ colors\\
+\hline
+Compatibility: & unknown (at least files from late 2001 are readable)\\
+\hline
+Documentation: & elements provided by NUMECA (\href{http://www.numeca.be}
+ {http://www.numeca.be})
+ in 2001.\\
+\hline
+\end{tabular}
+
+%==================================
+\subsubsection{Formats supported for input or output\label{cha:formats_inout}}
+%==================================
+
+\subsubsubsection{\ensightg%
+\label{fmtdesc:ensightg}}
+
+This format may represent all ``classical'' element types, as well as
+arbitrary polygons and convex polyhedra.
+
+This format evolves slightly from one \ensight version to another, keeping
+backwards compatibility. For example, polygons could not be used in the
+same \emph{part} as other element types prior to version 7.4, which removed
+this restriction and added support for polyhedra. Version 7.6 added support
+for material type definitions.
+
+This format offers many possibilities not used by \CS, such as defining
+values on part of a mesh only (using ``undefined'' marker values or
+partial values), assigning materials to elements, defining rigid
+motion, or defining per-processor mesh parts with ghost cells for
+parallel runs. Note that some libraries allowing direct \ensightg support
+do not necessarily support the whole format specification.
+Especially, VTK does not support material types, and has only recently
+added support for polyhedral elements in \ensightg files (interpreted
+as convex point sets, and not true polyhedra, but at least usable).
+Also, both \ensightg 8.2 and VTK allow for automatic distribution, reducing
+the usefulness of pre-distributed meshes with per-processor files.
+
+This format may be used as an input format, similar to \ensight 6.
+Compared to the latter, each \emph{part} has its own coordinates and vertex
+connectivity, so as a convention, we consider that surface or
+volume zones may only be considered to be part of the same mesh
+if the file defines vertex IDs (which we consider to be
+unique vertex labels). In this case, \emph{part} numbers
+are interpreted as colors. Without vertex IDs, only one part is read,
+and no colors are assigned.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {directory {\tt{{\it \{case\_name\}}.ensight}},
+ containing a file with the \tt .case} extension\\
+\hline
+File type: & multiple binary or text files\\
+\hline
+Surface elements: & triangles, quadrangles, polygons\\
+\hline
+Volume elements: & tetrahedra, pyramids, prisms, hexahedra, convex polyhedra\\
+\hline
+Zone selection: & possibility of defining element materials (not used), or
+ interpret part number as color number if vertex IDs are
+ given\\
+\hline
+Compatibility: & files readable by \ensight 7.4 to 8.2, as well as tools
+ based on the \href{http://www.vtk.org}{\vtk} library,
+ especially \paraview\ (\url{http://www.paraview.org})\\
+\hline
+Documentation: & online documentation, also available at:
+ \url{http://www.ensight.com/downloads/cat\_view-5.html}\\
+\hline
+\end{tabular}
+
+\subsubsubsection{\med 2.3}\hyperdef{sec}{med}{}
+\label{fmtdesc:med}
+
+Initially defined by EDF R\&D, this format (\emph{Mod�le d'�changes de Donn�es},
+or \emph{Model for Exchange of Data}) has been defined and maintained through
+a \med working group comprising members of EDF R\&D and CEA (the \CS team
+being represented). This is the reference format for the
+\href{http://www.opencascade.org/SALOME/Salome.html}{\emph SALOME} environment.
+This format is quite complete, allowing the definition of all ``classical''
+element types, in nodal or descending connectivity. Since \med 2.2 in the
+autumn of 2003, this format may handle polygonal faces and polyhedral cells,
+as well as the definition of structured meshes.
+
+This format, which requires a library also depending on the free HDF5 library,
+allows both for reading and writing meshes with their attributes (``families'' of
+color/attribute and group combinations), as well as handling calculation data,
+with the possibility (unused by \CS) of defining variables only on a subset
+(``profile'') of a mesh.
+
+The \med library is available under a \href{http://www.gnu.org}{LGPL} licence
+since version 2.1.5, and is even packaged in some Linux distributions
+(at least Debian and Ubuntu).
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .med}\\
+\hline
+File type: & portable binary, based on the HDF5 library
+ (\url{http://www.hdfgroup.org/HDF5/index.html})\\
+\hline
+Surface elements: & triangles, quadrangles, simple polygons\\
+\hline
+Volume elements: & tetrahedra, pyramids, prisms, hexahedra, simple polyhedra\\
+\hline
+Zone selection: & element families ({\it i.e.} colors and groups)\\
+\hline
+Compatibility: & all versions of \med 2.2 or 2.3 (only unstructured
+ nodal connectivity is supported)\\
+\hline
+Documentation: & online documentation of EDF \med (intranet) site:
+ \url{http://pal.der.edf.fr/pal/projets/pal/med}\\
+\hline
+\end{tabular}
+
+\subsubsubsection{CGNS 2.5}\hyperdef{sec}{cgns}{}
+\label{fmtdesc:cgns}
+
+Promoted especially by NASA, Boeing, and ICEM~CFD (as well as ONERA in France),
+this format(\emph{CFD General Notation System}) is quite well established in
+the world of CFD. The concept is similar to that of \med, with a bigger
+emphasis on normalization of variable names or calculation information, and
+even richer possibilities. The opposite of \med, the first version of this format
+was limited to multibloc structured meshes, unstructured meshes having been
+added in CGNS 2.
+
+Slightly older than \med, this library was free from the start, with a good
+English documentation, and is thus much better known. It is more focused
+on CFD, where \med is more generic. A certain number of tools accompany
+the CGNS distribution, including a mesh visualizer (which does not handle
+polygonale faces although the format defines them), and an interpolation
+tool.
+
+We should be able to read almost any mesh written in this format, though
+meshes with overset interfaces may not be usable for a calculation.
+Other (abutting) interfaces are not handled automatically (as there are
+at least 3 or 4 ways of defining them, and some mesh tools do not export
+them\footnote{For example, \icemcfd can join non-conforming meshes, but it
+exports joining surfaces as simple boundary faces with user-defined boundary
+conditions.}), so the user is simply informed of their existence in the
+\pcs's log file, with a suggestion to use an appropriate conformal joining
+option. Structured zones are converted to unstructured zones immediately after
+being read.
+
+Boundary condition information is interpreted as groups with the same
+name. The format does not yet provide for selection of volume elements,
+as only boundary conditions defined in the model (and can be assigned to
+faces in the case of unstructured meshes, or vertices in any case).
+Note that boundary conditions defined at vertices are not ignored by
+the \pcs, but are assigned to the faces of which all vertices bear
+the same condition.\footnote{If one of a face's vertices does not bear
+a boundary condition, that condition is not transferred to the face.}
+
+The \pcs also has the capability of building additional volume or surface groups,
+based on the mesh sections to which cells or faces belong. This may be
+activated using a sub-option of the mesh selection, and allows obtaining
+zone selection information from meshes that do not have explicit
+boundary condition information but that are subdivided in appropriate zones or
+sections (which depends on the tool used to build the mesh).
+
+When outputting to CGNS, an unstructured connectivity is used for the calculation
+domain, with no face joining information or face boundary condition
+information.\footnote{Older versions of the documentation specified that
+a field must be defined on all elements of a zone, so that adding faces
+on which to base boundary conditions to a volume mesh would have required
+also defining volume fields on these faces. More recent versions of the
+documentation make it clear that a field must be defined on all elements
+of maximum dimension in a zone, not on all elements.}
+
+Though many tools support CGNS, that support is often quite dissapointing,
+at least for unstructured meshes. Thus, some editors seem to use
+different means to mark zones to associate with boundary conditions than
+the ones recommended in the CGNS documentation, and some behaviors
+are worse: for example, under \ensightg 8, whenever a mesh
+contains multiple element types, variables are assigned to the wrong cells.
+Regarding support of polygons (\emph{ngons} in the CGNS standard), even the
+verification tools published alongside the CGNS library are unable
+to handle them, and report errors in valid files containing such elements.
+VisIt 1.11.1 reports an error when a mesh contains such faces, while
+\ensightg 8 ignores them.
+
+\smallskip \noindent
+\begin{tabular}[top]{|p{4.5cm}%
+ |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
+\hline
+Default extension: & {\tt .cgns}\\
+\hline
+File type: & portable binary (uses the ADF library specific to CGNS, or HDF5)\\
+\hline
+Surface elements: & triangles, quadrangles, simple polygons\\
+\hline
+Volume elements: & tetrahedra, pyramids, prisms, hexahedra\\
+\hline
+Zone selection: & Surface zone selection using boundary conditions, no volume zone
+ selection, but the \pcs allows creation of groups associated to
+ zones or sections in the mesh using mesh selection sub-options\\
+\hline
+Compatibility: & CGNS 2.0 to 2.5 on input, CGNS 2.5 on output\\
+\hline
+Documentation: & See CGNS site: \url{http://www.cgns.org}\\
+\hline
+\end{tabular}
+
+%==================================
+\subsubsection{Mesh meta-files}
+%==================================
+
+The \pcs allows use of text files (preferably with a {\tt .mesh} extension)
+describing a set of meshes and their transformations, in place of (or
+combined with) ``true'' mesh files. These meta-files are
+described here:
+
+Empty lines are ignored, and the \# character may be used to define
+comments (the part of a line following this character is ignored).
+
+One may request the reading of as many meshes as one needs, using
+for each mesh a section such as:
+
+\noindent
+\verb+read_mesh:+ {\it filename}
+
+or:
+
+\noindent
+\verb+read_mesh:+ {\it filename} {\tt <sub-options>}
+
+If this section type appears more than once, the corresponding meshes
+are automatically appended. If needed, a mesh meta-file may itself
+declare another meta-file as a mesh file.
+Possible sub-options associated with a file may be separated by commas,
+semicolumns, or spaces, and are of the following form:
+
+\noindent
+\begin{tabular}[top]{ p{2.5cm}%
+ >{\PreserveBackslash\raggedright\hspace{0pt}}p{12.5cm} }
+{\tt format=} & {format name (identical to command-line options)}\\
+{\tt num=} & {mesh number (useful when a file contains multiple meshes)}\\
+{\tt grp\_cel=} & {{\tt <section} or {\tt zone>}, useful only for files in
+ CGNS format}\\
+{\tt grp\_fac=} & {{\tt <section} or {\tt zone>}, useful only for files in
+ CGNS format}\\
+\end{tabular}
+
+\smallskip
+It is also possible to define a geometric transformation to apply to a mesh,
+using a homogeneous coordinates transformation matrix (3 lines, 4 columns,
+with the 3 first columns describing a rotation/scaling factor,
+and the last column describing a translation. The corresponding section
+is as follows (values may be spread over several lines):
+
+\noindent
+\verb+transformation_matrix:+ $t_{11}$ $t_{12}$ $t_{13}$ $t_{14}$
+$t_{21}$ $t_{22}$ $t_{23}$ $t_{24}$ $t_{31}$ $t_{32}$ $t_{33}$ $t_{34}$\\
+
+Note that the order in which multiple meshes are declared defines the
+order in which they are read and appended, but the geometric transformation
+is only applied at the end (this is a description file, not a command file).
+If multiple transformations are needed, a hierarchy of mesh meta-files
+may be used.
+
+%==================================
+\subsubsection{Meshing tools and associated formats}
+%==================================
+
+Most often, the choice of a mesh format is linked to the choice of
+a meshing tool. Still, some tools allow exporting a mesh under several
+formats handled by \CS. This is the case of \fluent and \icemcfd,
+which can export meshes to both the \ideas universal and CGNS formats
+(\fluent's \gambit is also able to export to \ideas universal format).
+
+Traditionally, users exported files to the \ideas universal format,
+but it does not handle pyramid elements, which are often used by these
+tools to transition from hexahedral to tetralhedral cells in the case
+of hybrid meshes. The user is encouraged to export to CGNS, which
+does not have this limitation.
+
+Tools related to the \salome platform should preferably use
+\salome{}'s native \med format (export to \ideas universal is
+also possible, but has some limitations).
+
+The use of files of the ``Common Solver'' type\footnote{File type specifically
+developped for the early prototype versions of \CS (\texttt{tlc}) extension}
+is still possible but is deprecated. Such files are read directly from the
+Kernel, without the Preprocessor.
+The variable SOLCOM must
+ be set to 1 in the launch scripts. Many potentialities of \CS are not
+usable with this file format (mesh joining with hanging nodes, periodicity,
+parallel computing, ...).
+For all the other formats, the Preprocessor must be used (SOLCOM=0).
+
+%==================================
+\subsubsection{Meshing remarks}
+%==================================
+\label{prg_maillages}%
+
+{\em WARNING: }
+Some turbulence models ($k-\varepsilon$, $R_{ij}-\varepsilon$ SSG, ...) used in
+\CS are ``High-Reynolds'' models. Therefore the size of the cells
+neighboring the wall needs to be greater than the thickness of the viscous
+sublayer (at the wall, $y^+>2.5$ is required, and $30<y^+<100$ is
+preferable). If the mesh does not match this constraint, the results may
+be false (particularly if thermal phenomena are involved). For more details
+on these constraints, see the keyword \texttt{ITURB}.
+
+%==================================
+\subsection{Preprocessing}
+%==================================
+The Preprocessor module of \CS reads the
+mesh file(s) (under any supported format) and transfers the necessary
+information to the Kernel. Mesh joining and domain partitioning for parallel
+calculations are made during this phase. In case of periodic boundary
+conditions, the Preprocessor module also identifies the boundary faces that are
+related through periodicity and creates the corresponding connectivity table.
+
+For a complete information on the Preprocessor module, please refer to the
+corresponding user's guide \cite{ecsuser}.
+
+%==================================
+\subsubsection{Preprocessor command line options}
+%==================================
+\label{prg_optappelecs}%
+A complete description of the Preprocessor command line options can be found in
+\cite{ecsmu}. The executable of the Preprocessor module is \texttt{cs\_preprocess},
+accessible directly once the environment variables of \CS are set
+properly. A summary of the command line options is also given by the
+command \texttt{cs\_preprocess --help}.
+
+For the main options, the launch script \texttt{runcase} contains
+corresponding environment variables at its beginning, that are used
+later when the executable is called. This way, the user only has to
+fill these variables and doesn't need to search deep in the script for
+the Preprocessor command line.
+
+The main options are:
+\begin{list}{$\bullet$}{}
+\item \texttt{--help}: gives a summary of the different command line options
+
+\item \texttt{-m mesh1 mesh2}: used to specify the names of the different meshes
+used. The launch script automatically calls the Preprocessor with the option
+\texttt{-m \$MESH}, where \texttt{MESH} is the variable where the user has
+specified the different meshes to be used.
+
+\item \texttt{--join}: triggers the mesh joining functions. If nothing more is
+specified, every area of contact between two meshes will be pasted together. The
+joining can be limited to certain selected faces. For instance, to paste only
+the faces of colors 6 and 7, the full option will be \mbox{\texttt{--join --color
+6 7}}. These options are to be specified in the \texttt{COMMAND\_JOIN} variable in
+the launch script, to be automatically passed to the command line.
+
+\item \texttt{--perio}: triggers periodic boundary conditions. Two types of
+periodic boundaries are possible: translation or rotation (see
+\S\ref{prg_paralperio} for additional details). For the translation, the basic
+option line is \texttt{--perio --trans tx ty tz}\\
+where \texttt{tx}, \texttt{ty} and \texttt{tz} are the coordinates of the
+translation vector. For the rotation, there are two possibilities. The
+transformation can be defined with a rotation angle (in degrees, between -180
+and 180), a direction and an
+invariant point\\
+\texttt{--perio --rota --angle a --dir dx dy dz --invpt px py pz}\\
+(with obvious notations), or by giving the rotation matrix and an invariant point\\
+\texttt{--perio --rota --matrix m11 m12 m13 m21 m22 m23 m31 m32 m33 --invpt px py
+pz}\\
+A rotation and a translation can be combined, by giving both \texttt{--rota} and
+\texttt{--trans} specifications. The translation will always be applied first,
+whatever the order in which the rotation and the translation have been given.\\
+The orientation of the transformations is not important since both the
+transformation and its inverse will be used to connect faces. Yet, when
+combining a translation and a rotation, the orientations given for both have to
+be consistent.\\
+It is possible (and usually recommended) to restrict the search for periodic
+connections between faces to a certain group of faces, by adding selection
+arguments like \texttt{--color}. It is also possible to specify up to 3
+independent periodicities, simply by repeating the \texttt{--perio} option. Below
+is given a example of the option line for a triple periodicity (the \verb+\+
+indicates the continuation of the command line):\\
+\texttt{--perio --trans -10.2 0 0 --color 2} \verb+\+\\
+\texttt{--perio --rota --angle 90 --dir 0 0 1 --invpt 0 0 0 --color 3 4} \verb+\+\\
+\texttt{--perio --trans 0 1 0 --rota --matrix 1 0 0 0 0 -1 0 1 0 --invpt 0 0 -0.2}\\
+This option is to be specified in the \texttt{COMMAND\_PERIO} variable in
+the launch script, to be automatically passed to the command line.
+
+\item \texttt{--reorient}: try to re-orient badly-oriented cells
+if it is necessary to compensate for mesh-generation software
+whose output does not conform to the format specifications.
+
+\end{list}
+
+%==================================
+\subsection{Kernel command line options}
+%==================================
+\label{prg_optappelnoy}%
+In the standard cases, the compilation of \CS and its execution are entirely
+controlled by the launch script. The potential command line options are passed
+through user modifiable variables at the beginning of the script. This way, the
+user only has to fill these variables and doesn't need
+to search deep in the script for the Kernel command line. Yet, below is given
+the complete list of options, with the variables in which they should be
+specified in the script.
+
+\begin{list}{$\bullet$}{}
+\item \texttt{--solcom}: this option indicates that the Kernel will read the
+mesh directly, not using the Preprocessor output files. This is only possible
+with ``Common Solver'' type of mesh files (see \S\ref{prg_maillages} for
+restrictions).\\
+This option is triggered by the \texttt{SOLCOM} variable in the launch
+script. If \texttt{SOLCOM} is set to 1, the \texttt{-solcom} option is
+automatically added to the Kernel command line. The variable
+IFOENV\index{IFOENV} in the FORTRAN code will be set to 0 if the
+\texttt{--solcom} option has been used, otherwise it will be set to 1.
+
+\item \texttt{--mpi}: specifies that the calculation is running
+with MPI communications. The number of processors used will be determined
+automatically by the Kernel. If necessary, the launch script automatically
+passes the \texttt{--mpi} option to the Kernel command line
+(see \ref{prg_runcase}).
+
+\item \texttt{-q} or \texttt{--quality}: triggers the verification mode.
+The code runs without any Interface parameter file nor any user subroutine.
+The mesh is read and elementary tests are performed:\\
+\begin{list}{-}{}
+\item the quality criteria of the mesh are calculated (non-orthogonality angles,
+internal faces off-set, \ldots) and corresponding EnSight
+post-processing parts are created.\\
+\item test calculation of the gradient of $sin(x+2y+3z)$. The calculated
+value is compared to the exact value, and an EnSight part for the
+corresponding error is created. The gradient is calculated with each
+option IMRGRA from $0$ to $4$.\\
+\end{list}
+The command \texttt{-q} is to be placed in the \texttt{ARG\_CS\_VERIF}
+variable in the launch script to be added automatically to the Kernel
+command line.\\
+
+\item \texttt{--cwf}: triggers the cutting of boundary and internal faces which
+have a warp angle larger than a certain limit\footnote{the warp angle is an
+indicator of the non-coplanarity of the different vertices of the face}. The
+concerned faces are divided into triangles. This option is to handle with care,
+since the division of the faces increases the non-orthogonalities of the mesh,
+but it is sometimes required (for the Lagrangian modeling, for instance, where
+non-plane faces lead to noticeable particle loss). By default, the faces are
+divided if their warp angle is larger than 0.01 degrees. This default value can
+be changed by adding an optional angle value to the command. For instance, to
+devide faces with a warp angle larger than 0.02 degrees, the full option will
+be \mbox{\texttt{-cwf 0.02}}.\\
+This option is to be specified in the \texttt{COMMAND\_CWF} variable in
+the launch script, to be automatically passed to the command line.
+
+\item \texttt{--benchmark}: triggers the benchmark mode, for a timing
+of elementary operations on the machine. A secondary option
+\texttt{--mpitrace} can be added. It is to be activated when the benchmark mode
+is used in association with a MPI trace utility. It restricts the elementary
+operations to those implying MPI communications and does only one of each
+elementary operation, to avoid overfilling the MPI trace report.\\
+This command is to be placed in the \texttt{ARG\_CS\_VERIF} variable
+in the launch script to be added automatically to the Kernel command line.
+
+\item \texttt{--log n}: specifies the destination of the output for a
+monoprocessor calculation or for the processor of rank 0 in a parallel
+calculation.\\
+\hspace*{0.5cm}\texttt{n=0}: output directed towards the standard output\\
+\hspace*{0.5cm}\texttt{n=1}: output redirected towards a file \texttt{listing}
+(default behaviour)\\
+This option can be specified in the \texttt{ARG\_CS\_OUTPUT} variable of the
+launch script.
+
+\item \texttt{--logp n}: specifies the destination of the output for the
+processors of rank 1 to $N-1$ in a calculation in parallel on $N$ processors
+({\em i.e.} the redirection of all but the first processor).\\
+\hspace*{0.5cm}\texttt{n=-1}: no output for the processors of rank 1 to $N-1$
+(default behaviour).\\
+\hspace*{0.5cm}\texttt{n=0}: no redirection. Every processor will write to the
+standard output. This might be useful in case a debugger is used, with separate
+terminals for each processor.\\
+\hspace*{0.5cm}\texttt{n=1}: one file for the output of each processor. The
+output of the processors of rank 1 to $N-1$ are directed to the files
+\texttt{listing\_n0002} to \texttt{listing\_n$N$}.
+This option can be specified in the \texttt{ARG\_CS\_OUTPUT} variable of the
+launch script.
+
+\item \texttt{-p xxx} or \texttt{--param xxx}: specifies the name of the GUI
+parameter file to use for the calculation.\\
+The value of \texttt{xxx} is to be placed in the \texttt{PARAM} variable in the launch
+script (the file will be looked for in the directory \texttt{DATA}).
+The option \mbox{\texttt{-param \$PARAM}} is automatically added to the
+Kernel command line.
+
+\item \texttt{-h} or \texttt{--help}: to display a summary of the different
+command line options.
+\end{list}
+
+%==================================
+\subsection{Parameters in the launch script}
+%==================================
+\label{prg_runcase}%
+
+The case preparer \texttt{cs create} places an example of launch script,
+\texttt{runcase}, in the \texttt{SCRIPTS} directory. This script is quite general
+and known to work on every architecture \CS has been tested on. The beginning
+if the script contains the definition of certain parameters (environment
+variables) necessary to set the calculation. The second part of the script
+contains the commands for the preparation and execution of the calculation. No
+user intervention should be necessary in this second part.\\
+The Graphical User Interface allows to fill in the major
+parameters of the script without having to edit the file.
+
+Below is a list of the different variables and parameters that might be modified
+for a calculation, in their order of apparition in the script:
+\begin{list}{$\bullet$}{}
+\item LSF headers: definition of the headers for an LSF batch system, as can be
+found on the machines of the CCRT (Platine). The data expected are
+the number of processors reserved (\texttt{\#BSUB -n}), the CPU time limit
+(\texttt{\#BSUB -W}), the name of the standard output file (\texttt{\#BSUB -o}),
+the name of the standard error file (\texttt{\#BSUB -e}) and the name of
+the job (\texttt{\#BSUB -J}).
+
+\item PBS headers: definition of the headers for a PBS batch system, as can be
+found on the machines of the Chatou cluster. The data expected are the number of
+nodes reserved (\texttt{nodes}), the number of processors per node
+(\texttt{ppn}), the total CPU time (\texttt{walltime}), the memory reserved
+(\texttt{mem}), and the name of the job (\texttt{\#PBS -N}).
+
+\item Manchester headers: definition of the headers for the batch system
+specific to the cluster of the University of Manchester
+
+\item \texttt{SOLCOM}: a value of 1 will pass the \texttt{-solcom} option to the
+Kernel (see \ref{prg_optappelnoy})
+\end{list}
+
+\begin{list}{$\bullet$}{}
+\item \texttt{STUDY}: name of the study directory (automatically set by
+\texttt{cs create}, see \S\ref{prg_architecture})
+
+\item \texttt{CASE}: name of the case directory (automatically set by
+\texttt{cs create}, see \S\ref{prg_architecture})
+
+\item \texttt{PARAM}: name of the Interface parameter file, if necessary (see
+\ref{prg_optappelnoy})
+
+\item \texttt{MESH}: name(s) of the mesh(es) used for the calculation (see
+\ref{prg_optappelecs} and \ref{prg_maillages}). The files will be looked for in
+the directory \texttt{MESHDIR} (see below).
+
+\item \texttt{COMMAND\_JOIN}: Preprocessor command line option for mesh joining (see
+\ref{prg_optappelecs})
+
+\item \texttt{COMMAND\_CWF}: Kernel command line option for the division of
+faces with too large a warp angle (see \ref{prg_optappelnoy})
+
+\item \texttt{COMMAND\_PERIO}: Preprocessor command line option for the definition
+of periodic boundary conditions (see \ref{prg_optappelecs})
+
+\item \texttt{THERMOCHEMISTRY\_DATA}: name of the thermochemical data file, if
+necessary (the file is looked for in the directory \texttt{DATA}, see
+\S\ref{prg_usppmo})
+
+\item \texttt{NUMBER\_OF\_PROCESSORS}: number of processors (potentially virtual)
+to be used for the calculation.\\
+If the variable is left empty, the launch script
+will fill it automatically: on a batch system, \texttt{NUMBER\_OF\_PROCESSORS}
+will be equal to the number of processors reserved; in case of an
+interactive calculation, it will be set to 1.\\
+When using a batch system,
+\texttt{NUMBER\_OF\_PROCESSORS} should ideally be equal to the number of
+processors reserved, and can never be larger (one executable per
+processor). With an interactive calculation (like a Linux PC),
+\texttt{NUMBER\_OF\_PROCESSORS} can be larger than the total number of processors
+available, although it is not recommended (loss of efficiency because several
+executables share the same processor).\\
+In case of
+coupling with \syrthes, one processor is reserved for \syrthes, and the Kernel
+of \CS will therefore automatically be set to run on
+\texttt{NUMBER\_OF\_PROCESSORS-1} processors.
+
+\item \texttt{PROCESSOR\_LIST}: list of nodes on which the calculation is to
+be run. On batch systems, this list is set automatically by the batch
+manager. For calculations on a stand-alone machine, the list is not used. Hence,
+except for very specific test (mainly for developing purposes), it is
+recommended to leave this variable empty.
+
+\item \texttt{USER\_INPUT\_FILES}: list of the user data files to be
+copied in the temporary execution directory before the calculation (input
+profiles for instance). The files will
+be looked for in the directory \texttt{DATA}. The thermochemical data files,
+Interface parameter file and calculation restart files are specified in other
+variables and do not need to appear here. When using the vortex method for LES
+entry conditions, the corresponding data files have to be specified in
+\texttt{USER\_INPUT\_FILES} (see \S\ref{prg_usvort})
+
+\item \texttt{USER\_OUTPUT\_FILES}: list of user result files to be
+copied in the directory \texttt{RESU} at the end of the calculation. A directory
+\texttt{RES\_USERS.mmddhhmm} will be created in the directory \texttt{RESU} and
+all the files will be stored in it. The files automatically created by the code
+(listings, post-processing, automatic chronological records\footnote{when using
+\texttt{ushist} for user-defined chronological records, the files created need
+to be specified in \texttt{USER\_OUTPUT\_FILES}},
+restart files) do not need to be specified in
+\texttt{USER\_OUTPUT\_FILES}.
+
+\item \texttt{CS\_TMP\_PREFIX}: alternate temporary directory for the
+calculation (see \S\ref{prg_temporarydirectory})
+
+\item \texttt{OPTIMIZATION}: optimisation level for compilation
+ (LO, DBG, EF or PROF; see \S\ref{prg_library}). This optimisation
+level will be applied to all the modules of \CS (BASE, CFBL, COGZ, CPLV, ELEC,
+FUEL, LAGR, MATI, RAYT).
+Leaving the variable empty stands for ``standard''
+optimisation.
+
+\item \texttt{CS\_LIB\_ADD}: additional commands for the link stage of the
+compilation. This can be especially useful if the user subroutines call routines
+provided by external libraries. To link with an external library ``foo'', the
+variable would be for instance\\
+\texttt{CS\_LIB\_ADD=``-L/opt/foo/lib -lfoo''}
+
+\item \texttt{VALGRIND}: command to be placed before the \CS executable name on
+the execution command line ({\em i.e.} the launch script will execute the
+command \texttt{\$VALGRIND cs\_solver ...}). It is especially designed to use the
+valgrind debugging and profiling tool. The usual value to use valgrind is
+\texttt{VALGRIND=``valgrind --tool=memcheck''}
+
+\item \texttt{ARG\_CS\_VERIF}: verification mode to be used for \CS (see
+\ref{prg_optappelnoy}). An empty variable implies standard calculation mode
+(IVERIF=0).
+
+\item \texttt{ARG\_CS\_OUTPUT}: options for the redirection of the standard
+output (see \ref{prg_optappelnoy})
+
+\item \texttt{ECHOCOMM}: level for the \texttt{--echo-comm} option of the Kernel
+command line (see \ref{prg_optappelnoy})
+
+\item \texttt{ADAPTATION}: commands to trigger the automatic mesh
+adaptation with the software Homard. This option is still under development and
+restricted to developpers use.
+
+\item \texttt{CASEDIR}: root directory of the calculation. This variable is
+automatically set by \texttt{cs create} and should not be changed.
+
+\item \texttt{DATA}: DATA directory of the case (see \ref{prg_architecture}).
+This variable is automatically set by \texttt{cs create} and should not be
+changed.
+
+\item \texttt{RESU}: RESU directory of the case (see \ref{prg_architecture}).
+This variable is automatically set by \texttt{cs create} and should not be
+changed.
+
+\item \texttt{SRC}: SRC directory of the case (see \ref{prg_architecture}).
+This variable is automatically set by \texttt{cs create} and should not be
+changed.
+
+\item \texttt{SCRIPTS}: SCRIPTS directory of the case (see
+\ref{prg_architecture}). This variable is automatically set by
+\texttt{cs create} and should not be changed.
+
+\item \texttt{RESTART\_IN}: directory containing the files for calculation
+restart.
+
+\item \texttt{PREPROCESSOR\_OUTPUT\_IN}: \texttt{preprocessor\_ouput} file for a calculation in ``calculation'' mode (see \ref{prg_executionmodes})
+
+\item \texttt{MESHDIR}: directory containing the mesh files (see
+\ref{prg_architecture}). This variable is automatically set by
+\texttt{cs create} and should generally not be changed.
+
+\item \texttt{DATA\_SYR}: directory for the \syrthes data. This directory has
+to be created by the user. It is advised to keep the location proposed
+in the launch script, which complies with the standard architecture
+of \CS (see
+\ref{prg_architecture}).
+
+\item \texttt{SYRTHES\_ENV}: name of the environment file for \syrthes (usually
+\texttt{syrthes.env}, as proposed in the launch script).
+
+\item \texttt{SRC\_SYR}: directory for the \syrthes user subroutines.
+This directory has to be created by the user. It is advised to keep the location
+proposed in the launch script, which complies with the standard architecture
+of \CS (see \ref{prg_architecture}).
+
+\item \texttt{COUPLING\_MODE}: coupling mode between \CS and \syrthes 3.4, when
+such coupling is activated (see \texttt{COMMAND\_SYRTHES}). Two options are
+available:\\
+\hspace*{0.5cm}\texttt{MPI}: for a coupling based on MPI messages (requires a
+MPI library)\\
+\hspace*{0.5cm}\texttt{sockets}: for a coupling based on sockets
+
+\item \texttt{EXEC\_PREPROCESSOR}: execution mode for \CS preprocessor (see \ref{prg_executionmodes})
+
+\item \texttt{EXEC\_PARTITION}: execution mode for \CS partitionner (see \ref{prg_executionmodes})
+
+\item \texttt{EXEC\_KERNEL}: execution mode for \CS kernel (see \ref{prg_executionmodes})
+
+\end{list}
+
+
+%==================================
+\subsection{Graphical User Interface}
+%==================================
+\label{prg_ihm}%
+A Graphical User Interface is available with \CS.
+This Interface creates or reads an XML file according to
+a specific \CS syntax which is then interpreted by the code.
+
+In version \verscs, the Graphical Interface manages calculation parameters,
+standard initialisation values and boundary
+conditions for standard physics, pulverised coal combustion and radiative
+transfers. The other specific
+physics are not yet managed by the Graphical
+Interface. In these particular cases, user subroutines have to be completed.
+
+The Interface is optionnal. Every data that can be specified through the
+Interface can also still be specified in the user subroutines. In case of
+conflict, all calculation parameters, initialisation value or boundary condition
+set directly in the user subroutines will prevail over what is defined by the
+Interface. However, it is no longer necessary to redefine everything in the
+user subroutines. Only what was not set or could not be set using the Graphical
+Interface should be specified.
+
+{\em WARNING: }
+There are some limitations to the changes that can be made between the Interface
+and the user routines. In particular, it is not possible to specify a certain
+number of solved variables in the Interface and change it in the user routines
+(for example, it is not possible to specify the use of a $k-\varepsilon$ model
+in the Interface and change it to $R_{ij}-\varepsilon$ in \texttt{usini1.F}, or
+to define additional scalars in \texttt{usini1} with respect to the
+Interface). Also, all boundaries should be referenced in the Interface, even if
+the associated conditions are intended to be modified in \texttt{usclim}, and
+their nature (entry, outlet, wall\footnote{smooth and rough walls are considered
+of the same nature}, symmetry) should not be changed.
+
+For example, in order to set the boundary conditions of a calculation
+corresponding to a channel flow with a given inlet velocity profile, one
+should:\\
+- set the boundary conditions corresponding to the wall and the output
+using the Graphical Interface\\
+- set a dummy boundary condition for the inlet (uniform velocity for instance)
+- set the proper velocity profile at inlet in \texttt{usclim}. The wall and
+output areas do not need to appear in \texttt{usclim}. The dummy velocity
+entered in the Interface will not be taken into account.
+
+The Graphical User Interface is launched with the \texttt{./SaturneGUI} command
+in the directory \texttt{DATA}. The first step is
+then to load an existing parameter file (in order to modify it) or to
+open a new one. The headings to be filled for a standard calculation are the
+followings:
+
+\begin{list}{-}{}
+\item Analysis environment: definition of the calculation directories
+ (STUDY, CASE), mesh file(s), periodicity, coupling with \syrthes,
+ stand-alone execution of the
+ Preprocessor module (used by the Interface to get the colors of the boundary
+ faces).
+
+\item Thermophysical models: physical model, ALE mobile mesh features,
+ turbulence model, thermal model,
+ initialisation of the variables.
+
+\item Physical properties: reference pressure, fluid characteristics, gravity.
+
+\item Additional scalars: definition, physical characteristics and
+ initialisation of the scalars (apart from the temperature, which
+ is treated separately in the Interface).
+
+\item Boundary conditions: definition of the boundary conditions for
+ each variable. The colors of the boundary faces may be read
+ directly from a ``listing'' file created by the Preprocessor. This
+ file can be generated directly by the Interface under the heading\\
+ ``Analysis environment $\rightarrow$ Solution Domain $\rightarrow$
+ Stand-alone running''.
+
+\item Analysis control: parameters concerning the time averages, time step,
+ location of
+ the probes where some variables will be monitored over time,
+ definition of the frequency of the outputs in the calculation
+ listing and in the chronological records and of the EnSight outputs.
+
+\item Numerical parameters: advanced parameters for the numerical solution of
+ the equations
+
+\item Calculation management: management of the calculation restarts,
+ updating of the launch script (temporary execution directory, parallel
+ computing, user data or result files, ...), interactive launch of the
+ calculation and user arrays definition.
+
+\end{list}
+
+The \CS tutorial \cite{tutorial} offers a step-by-step guidance to the setting
+up of some simple calculations with the \CS Interface.
+
+To launch \CS using an XML parameter file,
+the name of the file must
+be given to the variable \texttt{PARAM} in the launch script (see
+\S\ref{prg_runcase}). When the launch
+script is edited from the Interface (Calculation management $\rightarrow$
+Prepare batch analysis), the PARAM section is filled automatically as are the
+other parameters specified through the Interface.
+
+
+\minititre{Note: option \texttt{--nogui} of cs create}
+When a calculation is using the Interface but, for some reason, some extra
+parameters need to be specified in the subroutine \texttt{usini1}, the latter
+must be placed in the directory \texttt{SRC}. But, while doing this, all the
+parameters appearing in \texttt{usini1} will also be taken into account. In
+order to prevent the user from having to respecify in \texttt{usini1} all that
+he has already specified through the Interface, \texttt{cs create} automatically
+comments out the examples in \texttt{usini1} (\texttt{Cex} at the beginning of
+each line) while copying it in the directory \texttt{REFERENCE}. Therefore, the user
+only needs to uncomment the specific parts of \texttt{usini1} he wants to modify,
+and the rest of the examples will be ignored.\\
+On the contrary, if the Interface will not be used, then all the parameters in
+\texttt{usini1} have to be specified. In that case, using the \texttt{--nogui}
+option of \texttt{cs create} will prevent it from commenting \texttt{usini1}
+out, thus saving the user the tedious task of uncommenting all the lines (and
+the risk of skipping some of them).
+
+
+%==================================
+\subsection{Face and cell mesh-defined properties and selection}
+%==================================
+\label{selection_criteria}
+
+The mesh entities may be referenced by the user during the mesh
+creation. These references may then be used to mark out some mesh entities
+according to the need (specification of boundary conditions, pressure
+drop zones ...). The references are generally of one of the two
+following types:
+\begin{list}{$\bullet$}{}
+\item color.
+A color is an integer possibly associated with boundary faces and
+volume elements by the mesh generator. Depending on the tool,
+this concept may have different names, which \CS interprets
+as colors. Most tools allow only one color per face or element.
+ \begin{list}{-}{}
+ \item I-deas uses a color number with a default of
+ 7 (green) for elements, be they volume elements or boundary
+ ``surface coating'' elements. Color 11 (red) is used for
+ for vertices, but vertex properties are ignored by \CS.
+ \item SIMAIL uses the equivalent notions of ``reference''
+ for element faces, and ``subdomain'' for volume elements.
+ By default, element faces are assigned no reference (0),
+ and volume elements domain 1.
+ \item Gmsh uses ``physical property'' numbers.
+ \item EnSight has no similar notion, but if several parts
+ are present in an EnSight 6 file, or several parts
+ are present \emph{and} vertex ids are given in an
+ Ensight Gold file, the part number is interpreted as
+ a color number by the Preprocessor.
+ \item The Comet Design (pro-STAR/STAR4) and NUMECA Hex file
+ formats have a CAD section id that is interpreted
+ as a color number. In the latter case, this notion
+ only applies to faces, so volume elements are given
+ color.
+ \item The MED format allow integer ``attributes'', though
+ many tools working with this format ignore those
+ and only handle groups.
+ \end{list}
+\item groups.
+Named ``groups'' of mesh entities may also be used with many
+mesh generators or formats. In some cases, a given cell or face may belong
+to multiple groups (as some tools allow new groups to be defined
+by boolean operations on existing groups).
+In \CS, every group is assigned a group number (base on alphabetical
+ordering of groups).
+ \begin{list}{-}{}
+ \item I-deas assigns a group number with each
+ group, but by default, this number is just a counter.
+ Only the group name is considered by \CS (so that elements
+ belonging to two groups with identical names and different
+ numbers are considered as belonging to the same group).
+ \item CGNS allows both for named boundary conditions and mesh
+ sections. If present, boundary condition names are
+ interpreted as group names, and groups may also be defined
+ based on element section or zone names using additional
+ Preprocessor options (\texttt{-grp-cel} or
+ \texttt{-grp-fac} followed by \texttt{section} or
+ \texttt{zone}).
+ \item Using the MED format, it is preferable to use ``groups''
+ to colors, as many tools ignore the latter.
+ \end{list}
+\end{list}
+
+Selection criteria may be defined in a similar fashion whether
+using the GUI or in user subroutines.
+Typically, a selection criteria is simply a string containing
+the required color numbers or group names, possibly combined
+using boolean expressions. Simple geometric criteria are also
+possible.
+
+A few examples are given below:
+
+\verb+ENTRY+\\
+\verb+1 or 7+\\
+\verb+all[]+\\
+\verb+3.1 >= z >= -2 or not (15 or entry)+\\
+\verb+range[04, 13, attribute]+\\
+\verb+sphere[0, 0, 0, 2] and (not no_group[])+
+
+Strings such as group names containing whitespace
+or having names similar to reserved operators may be protected
+using ``escape characters''.\footnote{Note that for defining a
+string in Fortran, double quotes are easier to use, as they do not
+conflict with Fortran's single quotes delimiting a string.
+In C, the converse is true. Also, in C, to define a string
+such as \texttt{{$\backslash$}plane}, the string
+\texttt{{$\backslash$}{$\backslash$}plane} must be
+used, as the first $\backslash$ character is used by the
+compiler itself. Using the GUI, either notation is easy.}
+More complex examples of strings whith protected strings are given here:
+
+\verb+"First entry" or Wall\ or\ sym+\\
+\verb+entry or \plane or "noone's output"+
+
+The following operators and syntaxes are allowed (fully capitalized
+versions of keywords are also allowed, but mixed capitals/lowercase
+versions are not):
+
+\begin{tabular}[top]{p{6cm} l}
+\multicolumn{2}{l}{\bf escape characters }\\
+protect next character only: & \texttt{$\backslash$} \\
+protect string: & \texttt{{'}$string${'}} \quad \texttt{"$string$"}\\
+\end{tabular}
+
+\begin{tabular}[top]{p{6cm} l}
+\multicolumn{2}{l}{\bf basic operators }\\
+priority: & \texttt{(} \quad \texttt{)} \\
+not: & \texttt{not} \quad \texttt{!} \quad \texttt{!=} \\
+and: & \texttt{and} \quad \texttt{\&} \quad \texttt{\&\&} \\
+or: & \texttt{or} \quad \texttt{|} \quad \texttt{||} \quad \texttt{,} \quad \texttt{;} \\
+xor: & \texttt{xor} \quad \texttt{\^} \\
+\end{tabular}
+
+\begin{tabular}[top]{p{6cm} l}
+\multicolumn{2}{l}{\bf general functions }\\
+select all: & \texttt{all[]}\\
+entities having no group or color: & \texttt{no\_group[]} \\
+select a range of groups or colors: & \texttt{range[$first$, $last$]} \\
+ & \texttt{range[$first$, $last$, group]} \\
+ & \texttt{range[$first$, $last$, attribute]} \\
+\end{tabular}
+
+For the range operator, $first$ and $last$ values are inclusive.
+For attribute (color) numbers, natural integer value ordering is used,
+while for group names, alphabetical ordering is used. Note also that in
+the bizarre (not recommended) case in which a mesh would contain for
+example both a color number 15 and a group named ``15'', using
+\texttt{range[15, 15, group]} or \texttt{range[15, 15, attribute]}
+could be used to distinguish the two.
+
+Geometric functions are also available. The coordinates considered are
+those of the cell or face centers. Normals are of course
+usable only for face selections, not cell selections.
+
+\begin{tabular}[top]{p{6cm} l}
+\multicolumn{2}{l}{\bf geometric functions }\\
+face normals: & \texttt{normal[$x$, $y$, $z$, $epsilon$]} \\
+ & \texttt{normal[$x$, $y$, $z$, epsilon = $epsilon$]} \\
+plane, $ax + by + cz + d = 0$ form: & \texttt{plane[$a$, $b$, $c$, $d$, $epsilon$]} \\
+ & \texttt{plane[$a$, $b$, $c$, $d$, epsilon = $epsilon$]} \\
+ & \texttt{plane[$a$, $b$, $c$, $d$, inside]} \\
+ & \texttt{plane[$a$, $b$, $c$, $d$, outside]} \\
+plane, normal + point in plane form: & \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, $epsilon$]} \\
+ & \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, epsilon = $epsilon$]} \\
+ & \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, inside]} \\
+ & \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, outside]} \\
+box, extents form: & \texttt{box[$x_{min}$, $y_{min}$, $z_{min}$,
+ $x_{max}$, $y_{max}$, $z_{max}$]} \\
+box, origin + axes form: & \texttt{box[$x_0$, $y_0$, $z_0$,}\\
+ & \texttt{\qquad $dx_1$, $dy_1$, $dz_1$,
+ $dx_2$, $dy_2$, $dz_2$,
+ $dx_3$, $dy_3$, $dz_3$]} \\
+ & \texttt{plane[$a$, $b$, $c$, $d$, epsilon = $epsilon$]} \\
+ & \texttt{plane[$a$, $b$, $c$, $d$, inside]} \\
+ & \texttt{plane[$a$, $b$, $c$, $d$, outside]} \\
+cylinder: & \texttt{cylinder[$x_0$, $y_0$, $z_0$, $x_1$, $y_1$, $z_1$, $radius$]} \\
+sphere: & \texttt{sphere[$x_c$, $y_c$, $z_c$, $radius$]} \\
+inequalities: & \texttt{>}, \texttt{<}, \texttt{>=}, \texttt{<=} associated
+ with \texttt{x}, \texttt{y}, \texttt{z} or
+ \texttt{X}, \texttt{Y}, \texttt{Z} keywords\\
+ & and coordinate value; \\
+ & \texttt{$x_{min}$ <= x < $x_{max}$} type syntax is allowed. \\
+\end{tabular}
+
+In the current version of \CS, all selection criteria used
+are maintained in a list, so that re-interpreting a criterion already
+encountered (such as at the previous time step) is avoided.
+Lists of entities corresponding to a criteria containing no geometric
+functions are also saved in a compact manner, so re-using a previously
+used selection should be very fast. For criteria containing geometric
+functions, the full list of corresponding entities is not maintained,
+so each entity must be compared to the criterion at each time step.
+Heavy use of many selection criteria containing geometric functions
+may thus lead to reduced performance.
+
+%==================================
+\section{Main variables}
+%==================================
+
+This section presents a non-exhaustive list of the main variables which
+may be encountered by the user. Most of them should not be modified by the
+user. They are calculated automatically from the data. However it may be
+useful to know what they represent.
+Developpers can also refer to \cite{boucker00} and \cite{theory}.
+
+These variables are listed in the alphabetical index at the end of this
+document.
+
+The type of each variable is given: integer [i], real number [r],
+integer array [ia], real array [ra].
+
+%==================================
+\subsection{Array sizes}
+%==================================
+\label{prg_dimensions}
+
+\variabsize{ndim}{Space dimension (ndim=3)}
+
+\bigskip
+
+\variabsize{ncel}{Number of real cells in the mesh}
+
+\variabsize{ncelet}{Number of cells in the mesh, including the
+ghost cells of the ``halos'' (see note 1)}
+
+\variabsize{nfac}{Number of internal faces (see note 2)}
+
+\variabsize{nfabor}{Number of boundary faces (see note 2)}
+
+\variabsize{ncelbr}{Number of cells with at least one boundary
+face (see note 2)}
+
+\bigskip
+
+\variabsize{lndfac}{Size of the array \texttt{nodfac}\index{nodfac} of
+internal faces - nodes connectivity (see note 3)}
+
+\variabsize{lndfbr}{Size of the array \texttt{nodfbr}\index{nodfbr} of
+boundary faces - nodes connectivity (see note 3)}
+
+\variabsize{nnod}{Number of vertices in the mesh}
+
+\bigskip
+
+\variabsize{nfml}{Number of referenced families of entities (boundary
+faces, elements, ...)}
+
+\variabsize{nprfml}{Number of properties per referenced entity family}
+
+\bigskip
+
+\variabsize{nphas}{Effective number of phases. \texttt{nphas} must be
+inferior or equal to \texttt{nphsmx}. In the current version, \texttt{nphas}
+is forced to 1 and should not be changed.}
+
+\variabsize{nphsmx}{Maximum number of phases (default value:
+1)\footnote{the data structure of \CS is ready for a multiphase description,
+however no multiphase model has been implemented. Moreover, some options of the
+code are not compatible with \texttt{nphas} different from 1.}}
+
+\variabsize{nvar}{Number of solved variables (must be lower than
+\texttt{nvrmax})}
+
+\variabsize{nscamx}{Maximum number of scalars solutions of an
+advection equation, apart from the variables of the turbulence model ($k$,
+$\varepsilon$, $R_{ij}$, $\omega$, $\varphi$, $\overline{f}$). That is
+to say the temperature and other scalars (passive or not, user-defined or not)}
+
+\variabsize{nscal}{Effective number of scalars solutions of an
+advection equation, apart from the variables of the turbulence model ($k$,
+$\varepsilon$, $R_{ij}$, $\omega$, $\varphi$, $\overline{f}$). That is
+to say the temperature and other scalars (passive or not, user-defined or
+not). These scalars can be divided into two distinct groups: \texttt{nscaus}
+user-defined scalars and \texttt{nscapp} scalars related to a ``specific
+physics''. \texttt{nscal=nscaus+nscapp}, and \texttt{nscal}
+must be inferior or equal to \texttt{nscamx}}
+
+\variabsize{nscapp}{Effective number of scalars related to a
+``specific physics''. These scalars are solutions of an advection
+equation and distinct from the scalars of the turbulence model ($k$,
+$\varepsilon$, $R_{ij}$, $\omega$, $\varphi$, $\overline{f}$). They are
+automatically defined by the choice of the selected specific physics
+model (gas combustion with Eddy Break-Up model, pulverised coal
+combustion, ...). For example: mass fractions, enthalpy, ...}
+
+\variabsize{nscaus}{Effective number of user-defined scalars. These
+scalars are solutions of an advection equation and distinct from the
+scalars of the turbulence model ($k$, $\varepsilon$, $R_{ij}$, $\omega$,
+$\varphi$, $\overline{f}$) and from the \texttt{nscapp} scalars related to the
+``specific physics''. For example: passive tracers, temperature (when no
+specific physics model is selected), ...}
+
+\variabsize{nestmx}{Maximum number of error estimators for
+Navier-Stokes}
+
+\bigskip
+
+\variabsize{longia}{Size of the macro array of integer \texttt{ia}}
+
+\variabsize{longra}{Size of the macro array of real \texttt{ra}}
+
+\variabsize{npromx}{Maximum number of physical properties. They will
+be stored in the arrays \texttt{propce}, \texttt{propfa} or \texttt{propfb}}
+
+\variabsize{nproce}{Number of properties defined at the
+cells. They will be stored in the array \texttt{propce}}
+
+\variabsize{nprofa}{Number of properties defined at the internal
+faces. They will be stored in the array \texttt{propfa}}
+
+\variabsize{nprofb}{Number of properties defined at the boundary
+faces. They will be stored in the array \texttt{propfb}}
+
+\variabsize{nvisls}{Number of scalars with variable diffusivity}
+
+
+\bigskip
+
+\variabsize{nushmx}{Maximum number of user chronological files
+(in the case where \texttt{ushist} is used)}
+
+\variabsize{nbmomt}{Effective number of calculated time-averages.
+NBMOMT must be inferior or equal to \texttt{nbmomx}}
+
+\variabsize{nbmomx}{Maximum number of calculated time-averages (default
+value: 50)}
+
+
+\variabsize{ndgmox}{Maximum degree of the time-averages (default value:
+5)}
+
+
+\bigskip
+
+\variabsize{nclacp}{Number of coal classes for the pulverised
+coal combustion module. It is the total number of classes, {\it i.e.}
+the sum of the number of classes for every represented coal. \texttt{nclacp} must
+be inferior or equal to \texttt{nclcpm}}
+
+\variabsize{nclcpm}{Maximum number of coal classes for the
+pulverised coal combustion module}
+
+
+\minititre{Note 1: ghost cells - ``halos''}
+A cell (real cell) is an elementary mesh element of the spatial
+discretisation of the calculation domain. The mesh is made of NCEL cells.\\
+When using periodicity and parallelism, extra ``ghost'' cells
+( called ``halo'' cells) are defined for temporary storage of some information
+(on a given processor).
+The total number of real and ghost cells is \texttt{ncelet}. \\
+\hspace*{1cm} Indeed, when periodicity is enabled, the cells with
+periodic faces do not have any real neighboring cell across these
+particular faces. Their neighboring cell is elsewhere in the calculation
+domain (its position is determined by the periodicity). In order to
+temporarily store the information coming from this ``distant''
+neighboring cell, a ghost cell (``halo'') is created. \\
+\hspace*{1cm} The same kind of problem exists in the case of a
+calculation on parallel machines: due to the decomposition of the
+calculation domain, some cells no longer have access to all
+their neighboring cells, some of them being treated by another processor. The
+creation of ghost cells allows to temporarily store the information
+coming from real neighboring cells treated by other processors.\\
+The variables are generally arrays of size \texttt{ncelet} (number of real and
+fictitious cells). The calculations (loops) are made on \texttt{ncel} cells (only
+the real cells, the fictitious cells are only used to store information).
+
+\minititre{Note 2: internal faces}
+An internal face is an inferface shared by two cells (real or ghost
+ones) of the mesh. A boundary face is a face which has only one real
+neighboring cell. In the case of periodic calculations, a periodic face
+is an internal face. In the case of parallel running calculations, the
+faces situated at the boundary of a partition may be internal faces or
+boundary faces (of the whole mesh);
+
+\minititre{Note 3: faces-nodes connectivity}\label{prg_nodfac}
+The faces - nodes connectivity is stored by
+means of four integer arrays: \texttt{ipnfac} and \texttt{nodfac} for the
+internal faces, \texttt{ipnfbr} and \texttt{nodfbr} for the boundary faces.
+\texttt{nodfac} (size \texttt{lndfac})
+contains the list of all the nodes of all the internal faces; first the nodes of
+the first face, then the nodes of the second face, and so on.
+\texttt{ipnfac} (size: \texttt{nfac+1}) gives the position \texttt{ipnfac(ifac)}
+in \texttt{nodfac} of the first node of each internal face \texttt{ifac}.
+Therefore, the reference numbers of all
+the nodes of the internal face \texttt{ifac} are: \texttt{nodfac(ipnfac(ifac))},
+\texttt{nodfac(ipnfac(ifac)+1)}, ..., \texttt{nodfac(ipnfac(ifac+1)-1)}.
+In order for this last formula to be valid even for \texttt{ifac=nfac},
+\texttt{ipnfac} is of size \texttt{nfac+1} and \texttt{ipnfac(nfac+1)}
+is equal to \texttt{lndfac+1}.\\
+The composition of the arrays \texttt{nodfbr} and \texttt{ipnfbr} is similar.
+
+\minititre{Note 4: commons}
+{\bf The user will not modify the existing ``commons''.} This would require the
+recompilation of the complete version, operation which is not allowed in
+standard use.
+
+%==================================
+\subsection{Geometric variables}
+%==================================
+
+The main geometric variables are available in most of the
+subroutines and directly accessible through the following arrays.
+
+\variab{cdgfac}{cdgfac(ndim,nfac)}{ra}{Coordinates of the
+centers of the internal faces}
+
+\variab{cdgfbo}{cdgfbo(ndim,nfabor)}{ra}{Coordinates of the centers of the
+boundary face}
+
+
+\variab{ifacel}{ifacel(2,nfac)}{ia}{Index-numbers of the two (only) neighboring
+cells for each internal face}
+
+\variab{ifabor}{ifabor(nfabor)}{ia}{Index-number of the (unique) neighboring
+cell for each boundary face}
+
+
+\variab{ipnfac}{ipnfac(nfac+1)}{ia}{Position of the first node of the each internal
+face in the array \texttt{nodfac} (see note 3 in paragraph \ref{prg_dimensions}).}
+
+\variab{ipnfbr}{ipnfbr(nfabor+1)}{ia}{Position of the first node of the each boundary
+face in the array \texttt{nodfbr} (see note 3 in paragraph \ref{prg_dimensions}).}
+
+
+\variab{nodfac}{nodfac(lndfac)}{ia} {Index-numbers of the nodes of each
+internal face (see note 3 in paragraph \ref{prg_dimensions}).}
+
+\variab{nodfbr}{nodfbr(lndfbr)}{ia}{Index-numbers of the nodes of each
+boundary face (see note 3 in paragraph \ref{prg_dimensions}).}
+
+\variab{surfac}{surfac(ndim,nfac)}{ra}{Surface vector of the internal
+faces. Its norm is the surface of the face and it is oriented from \texttt{ifacel(1,.)}
+to \texttt{ifacel(2,.)}.}
+
+\variab{surfbo}{surfbo(ndim,nfabor)}{ra}{Surface vector of the boundary
+faces. Its norm is the surface of the face and it is oriented outwards}
+
+\variab{volume}{volume(ncelet)}{ra}{Volume of each cell}
+
+\variab{xyzcen}{xyzcen(ndim,ncelet)}{ra}{Coordinates of the cell centers}
+
+\variab{xyznod}{xyznod(ndim,nnod)}{ra}{Coordinates of the mesh vertices}
+
+In addition, other geometric variables are accessible in sections of
+the unidimensional macro-arrays IA (for integers) and RA (for real numbers)
+which are passed as arguments
+in every subroutine (apart from a few ones of very low level). The
+index-number of the first element of these sections is stored in a ``common''
+(in the file \texttt{pointe.h}), passed to most of the routines. Hence, the
+surface of an internal face \texttt{ifac} is stored in
+\texttt{ra(isrfan+ifac-1)}.
+Or, the coordinate of vector $\vect{OF}$ (see below for
+definition) in the II$^{th}$ direction for face \texttt{ifac} is stored in
+\texttt{ra(idofij+(ifac-1)*ndim+ii-1)}\footnote{in Fortran, a multidimensional
+array \texttt{a(3,2)} is in fact a unidimensional array containing the elements
+\texttt{a(1,1)}, \texttt{a(2,1)}, \texttt{a(3,1)}, \texttt{a(1,2)},
+\texttt{a(2,2)}
+and \texttt{a(3,2)} in this order.}.
+
+The main variables of this type are the following:
+
+\variab{idijpf}{idijpf}{i}{In \texttt{ra}, pointer to
+\texttt{dijpf(ndim,nfac)}, real array giving, for every internal face,
+the three components of the vector $\vect{I'J'}$, where I' and J' are
+respectively the orthogonal projections of the neighboring cell centers I and J
+on a straight line orthogonal to the face and passing through its center.}
+
+\variab{idiipb}{idiipb}{i}{In \texttt{ra}, pointer to
+\texttt{diipb(ndim,nfabor)}, real array giving, for every boundary
+face, the three components of the vector $\vect{II'}$. I' is the
+orthogonal projection of I, center of the neighboring cell, on the
+straight line perpendicular to the face and passign through its center}
+
+\variab{idist}{idist}{i}{In \texttt{ra}, pointer to \texttt{dist(nfac)}, real
+array giving, for every internal face, the scalar product between the
+vectors $\vect{IJ}$ and $\vect{n}$. I and J are respectively the centers
+of the first and the second neighboring cell. The vector $\vect{n}$ is
+the unit vector normal to the face and oriented from the first to the
+second cell}
+
+\variab{idistb}{idistb}{i}{In \texttt{ra}, pointer to \texttt{distbr(nfabor)},
+real array giving, for every boundary face, the scalar product between
+the vectors $\vect{IF}$ and $\vect{n}$. I is the center of the
+neighboring cell. F is the face center. The vector $\vect{n}$ is the
+unit vector normal to the face and oriented to the exterior of the
+domain}
+
+\variab{idofij}{idofij}{i}{In \texttt{ra}, pointer to \texttt{dofij(ndim,nfac)},
+real array giving, for every internal face, the components of the
+vector $\vect{OF}$. O is the intersection point between the face and
+the straight line joining the centers of the two neighboring cells. F
+is the face center}
+
+\variab{iicelb}{iicelb}{i}{In \texttt{ia}, pointer to \texttt{icelbr(ncelbr)},
+integer array giving the list of cells having at least one boundary face}
+
+\variab{ipond}{ipond}{i}{In \texttt{ra}, pointer to \texttt{pond(nfac)},
+real array giving
+$\displaystyle\frac{\vect{FJ}.\vect{n}}{\vect{IJ}.\vect{n}}$, for every
+internal face. With regard to the mesh quality, its ideal value is 0.5}
+
+\variab{isrfan}{isrfan}{i}{In \texttt{ra}, pointer to \texttt{surfan(nfac)},
+real array giving the norm of the surface vector of the internal faces}
+
+\variab{isrfbn}{isrfbn}{i}{In \texttt{ra}, pointer to \texttt{surfbn(nfabor)},
+real array giving the norm of the surface of the boundary faces}
+
+%==================================
+\subsection{Physical variables}
+%==================================
+
+The main physical variables are available in the majority of the
+subroutines and brought together according to their type in the
+multidimensional arrays listed below. In some paricular subroutines,
+some variables may be given a more explicit name, in order to ease the
+comprehension.
+
+\variab{PROPCE}{PROPCE(NCELET,NPROCE)}{RA}{Properties defined at the
+cell centers. For instance: density, viscosity ...}
+
+\variab{PROPFA}{PROPFA(NFAC,NPROFA)}{RA}{Properties defined at the
+internal faces. For instance: mass flow across internal faces}
+
+\variab{PROPFB}{PROPFB(NFABOR,NPROFB)}{RA}{Properties defined at the
+boundary faces. For instance: mass flow across boundary faces, density
+at boundary faces ...}
+
+\variab{RTP}{RTP(NCELET,NVAR)}{RA}{Array storing the values of the solved
+variables at the current time step}
+
+\variab{RTPA}{RTPA(NCELET,NVAR)}{RA}{Array storing the values of the solved
+variables at the previous time step}
+
+\bigskip
+
+\underline{Concerning RTP and RTPA}
+
+The indexes allowing to mark out the different variables (from 1 to
+NVAR) are integers available in a ``common'' file called
+\texttt{numvar.h}. Some solved variables (pressure, velocity, turbulence)
+depend on the considered phase, and the index which refers to it is then a
+array of size NPHSMX, the maximum number of phases.
+
+For example, IPR(IPHAS) refers to the variable ``pressure'' of the phase
+IPHAS (with 1$\leqslant$IPHAS$\leqslant$NPHAS): the pressure of the
+phase IPHAS in the cell IEL at the current time step is therefore
+RTP(IEL,IPR(IPHAS)).
+
+The list of integers referring to solved variables is given below. These
+variable index-numbers are not only used for the RTP and RTPA arrays, but also
+for some arrays of variable associated options (for instance, BLENCV(IK(IPHAS))
+is the percentage of second-order convective scheme for the turbulent energy of
+the phase IPHAS when a corresponding turbulent model is used).
+
+\begin{list}{$\bullet$}{}
+\item IPR(IPHAS)\index{IPR}: pressure\footnote{IPR(IPHAS) corresponds to a
+reduced pressure, from which the standard hydrostatic pressure has be
+deduced. The total pressure is stored in the PROPCE array}.
+\item IU(IPHAS)\index{IU}: velocity along the X axis.
+\item IV(IPHAS)\index{IV}: velocity along the Y axis.
+\item IW(IPHAS)\index{IW}: velocity along the Z axis.
+\item IK(IPHAS)\index{IK}: turbulent energy, in $k-\varepsilon$,
+$k-\omega$ modeling or v2f ($\varphi$-model) modeling.
+\item IR11(IPHAS)\index{IR11}: Reynolds stress R11, in
+ $R_{ij}-\varepsilon$ or SSG modeling.
+\item IR22(IPHAS)\index{IR22}: Reynolds stress R22, in
+ $R_{ij}-\varepsilon$ or SSG modeling.
+\item IR33(IPHAS)\index{IR33}: Reynolds stress R33, in
+ $R_{ij}-\varepsilon$ modeling.
+\item IR12(IPHAS)\index{IR12}: Reynolds stress R12, in
+ $R_{ij}-\varepsilon$ modeling.
+\item IR13(IPHAS)\index{IR13}: Reynolds stress R13, in
+ $R_{ij}-\varepsilon$ modeling.
+\item IR23(IPHAS)\index{IR23}: Reynolds stress R23, in
+ $R_{ij}-\varepsilon$ modeling.
+\item IEP(IPHAS)\index{IEP}: turbulent dissipation in $k-\varepsilon$,
+$R_{ij}-\varepsilon$ or v2f ($\varphi$-model) modeling.
+\item IOMG(IPHAS)\index{IOMG}: Specific dissipation rate $\omega$, in
+$k-\omega$ SST modeling.
+\item IPHI(IPHAS)\index{IPHI}: variable $\varphi=\overline{v^2}/k$ in v2f ($\varphi$-model).
+\item IFB(IPHAS)\index{IFB}: variable $\overline{f}$ in v2f ($\varphi$-model).
+\item ISCA(J)\index{ISCA}: scalar J (1$\leqslant$J$\leqslant$NSCAL).
+\end{list}
+
+\bigskip
+
+Concerning the solved scalar variables (apart from the variables
+pressure, $k$, $\varepsilon$, $R_{ij}$, $\omega$, $\varphi$,
+$\overline{f}$), the following are highly important:
+\begin{list}{-}{}
+\item The designation ``scalar'' refers to scalar variables which are
+ solution of an advection equation, apart from the variables of the
+ turbulence model ($k$, $\varepsilon$, $R_{ij}$, $\omega$,
+ $\varphi$, $\overline{f}$): for instance the temperature, scalars
+ which may be passive or not, ``user'' or not. The mean value of
+ the square of the fluctuations of a ``scalar'' is a
+ ``scalar'', too. The scalars may be divided into two groups:
+ NSCAUS ``user'' scalars and NSCAPP ``specific physics'' scalars, with
+ NSCAL=NSCAUS+NSCAPP. NSCAL must be inferior or equal to NSCAMX.
+\item The phase related to the scalar J is IPHSCA(J)\index{IPHSCA}.
+\item The J$^{\text{th}}$ user scalar is, in
+ the whole list of the NSCAL scalars, the scalar number
+ J. In the list of the NVAR solved variables, it
+ corresponds to the variable number ISCA(J),
+ its value in the cell IEL at the current time step is given by
+ RTP(IEL,ISCA(J)).
+\item The J$^{\text{th}}$ scalar related to a specific physics is, in
+ the whole list of the NSCAL scalars, the scalar number
+ ISCAPP(J). In the list of the NVAR solved variables, it
+ corresponds to the variable number ISCA(ISCAPP(J))\index{ISCAPP},
+ its value in the cell IEL at the current time step is given by
+ RTP(IEL,ISCA(ISCAPP(J))).
+
+\item The temperature (or the enthalpy) is the scalar number
+ ISCALT(IPHAS)\index{ISCALT} in the list of the NSCAL scalars. It
+ corresponds to the variable number ISCA(ISCALT(IPHAS)) and its
+ value in the cell IEL is RTP(IEL,ISCA(ISCALT(IPHAS))). If there is no
+ thermal scalar, ISCALT(IPHAS) is equal to -1.
+\item A ``user'' scalar number J may represent the average of the square of the
+ fluctuations of a scalar K ({\em i.e.} the average
+ $\overline{\varphi^\prime\varphi^\prime}$ for a fluctuating scalar
+ $\varphi$ ). This can be made either {\em via} the
+ interface or by indicating ISCAVR(J)=K\index{ISCAVR} in
+ \texttt{usini1} (if the scalar in question is not a ``user''
+ scalar, the selection is made automatically). For instance, if J
+ and K are ``user'' scalars, the variable $\varphi$ corresponding
+ to K is the variable number ISCA(K)=ISCA(ISCAVR(J)), and its value
+ in the cell IEL is \\ RTP(IEL,ISCA(K))=RTP(IEL,ISCA(ISCAVR(J))). \\
+The variable corresponding to the mean value of the square of the
+ fluctuations\footnote{it is really
+ $\overline{\varphi^\prime\varphi^\prime}$, and not
+ $\displaystyle\sqrt{\overline{\varphi^\prime\varphi^\prime}}$} is
+ the variable number ISCA(J) and its value in the cell IEL is
+ RTP(IEL,ISCA(J)).
+\end{list}
+
+\bigskip
+
+\underline{Concerning PROPCE, PROPFA and PROPFB}
+In \CS, the physical properties\footnote{other variables are stored in the
+arrays PROPCE, PROPFA and PROPFB. They are not ``physical properties'' strictly
+speaking, but it is convenient to have them in the same array as the proper
+physical properties} are stored in the arrays PROPCE, PROPFA and
+PROPFB. Some properties, like the density, are only stored for cells and boundary
+faces. Some, like the mass flux, are only stored at the internal and boundary
+faces. To avoid having different index numbers for a physical property,
+depending on the array it is used in, the following structure is used in \CS:
+
+\begin{list}{-}{}
+
+\item All the properties (used or not) have a unique and distinct index-number,
+given automatically by the code and stored in an integer or an integer array
+(its size may be the maximum number of phases, the maximum
+number of scalars or the maximum number of variables).
+
+\item The indexes referring to the different properties stored in the PROPxx
+arrays are given respectively by the following integer arrays:
+
+\variab{IPPROC}{IPPROC(NPROMX)}{IA}{Rank I in PROPCE(.,I) of the
+properties defined at the cell centers}
+
+\variab{IPPROF}{IPPROF(NPROMX)}{IA}{Rank I in PROPFA(.,I) of the
+properties defined at the internal faces}
+
+\variab{IPPROB}{IPPROB(NPROMX)}{IA}{Rank I in PROPFB(.,I) of the
+properties defined at the boundary faces}
+
+\end{list}
+
+For instance, the index number corresponding to the density of the phase
+IPHAS is IROM(IPHAS).\\
+In the list of the properties defined at the cell center, the density of
+the phase IPHAS is therefore the IPPROC(IROM(IPHAS))$^{\text{th}}$
+property: its value at the center of the cell IEL is given by \\
+PROP{\bf CE}(IEL,IPPRO{\bf C}(IROM(IPHAS)))\\
+In the same way, in the list of the properties defined at the boundary
+faces, the density of the phase IPHAS is the
+IPPROB(IROM(IPHAS)))$^{\text{th}}$ property: its value at the boundary
+face is given by \\
+PROP{\bf FB}(IEL,IPPRO{\bf B}(IROM(IPHAS)))
+
+The list of properties accessible in the PROPxx arrays is given below (this does
+not include the properties linked to the specific physics modules):
+
+\variab{IROM}{IROM(NPHSMX)}{IA}{For each phase, property number
+corresponding to the density ({\em i.e.} $\rho$ in $kg.m^{-3}$)\\
+stored at the cells and the boundary faces}
+
+\variab{IROMA}{IROMA(NPHSMX)}{IA}{For each phase, property number
+corresponding to the density ({\em i.e.} $\rho$ in $kg.m^{-3}$) at the
+previous time step, in the case of a second-order extrapolation in time\\
+stored at the cells and the boundary faces}
+
+\variab{IVISCL}{IVISCL(NPHSMX)}{IA}{For each phase, property number
+corresponding to the fluid molecular dynamic viscosity ({\em i.e.} $\mu$ in
+$kg.m^{-1}.s^{-1}$)\\
+stored at the cells}
+
+\variab{IVISLA}{IVISLA(NPHSMX)}{IA}{For each phase, property number
+corresponding to the fluid molecular dynamic viscosity ({\em i.e.} $\mu$
+in $kg.m^{-1}.s^{-1}$) at the previous time step, in the case of a
+second-order extrapolation in time\\
+stored at the cells}
+
+\variab{IVISCT}{IVISCT(NPHSMX)}{IA}{For each phase, property number
+corresponding to the fluid turbulent dynamic viscosity ({\em i.e.}
+$\mu_t$ in $kg.m^{-1}.s^{-1}$)\\
+stored at the cells}
+
+\variab{IVISTA}{IVISTA(NPHSMX)}{IA}{For each phase, property number
+corresponding to the fluid turbulent dynamic viscosity ({\em i.e.}
+$\mu_t$ in $kg.m^{-1}.s^{-1}$) at the previous time step, in the case of a
+second-order extrapolation in time\\
+stored at the cells}
+
+\variab{ICP}{ICP(NPHSMX)}{IA}{For each phase, property number
+corresponding to the specific heat, in case where it is variable
+({\em i.e.} $C_p$ in $m^2.s^{-2}.K^{-1}$). See note below\\
+stored at the cells}
+
+\variab{ICPA}{ICPA(NPHSMX)}{IA}{For each phase, property number
+corresponding to the specific heat, in case where it is variable
+({\em i.e.} $C_p$ in $m^2.s^{-2}.K^{-1}$), at the previous time step,
+in the case of a second-order extrapolation in time. See note below\\
+stored at the cells}
+
+\variab{ITSNSA}{ITSNSA(NPHSMX)}{IA}{For each phase, in the case of a
+calculation run with a second-order discretisation in time with
+extrapolation of the source terms, property number corresponding to the
+source term of Navier-Stokes at the previous time step ($kg.m^{-1}.s^{-2}$)\\
+stored at the cells}
+
+\variab{ITSTUA}{ITSTUA(NPHSMX)}{IA}{For each phase, in the case of a
+calculation run with a second-order discretisation in time with
+extrapolation of the source terms, property number corresponding to the
+source terms of the turbulence at the previous time step\\
+stored at the cells}
+
+\variab{ITSSCA}{ITSSCA(NPHSMX)}{IA}{For each phase, in the case of a
+calculation run with a second-order discretisation in time with
+extrapolation of the source terms, property number corresponding to the
+source terms of the equations solved for the scalars at the previous
+time step ($kg.m^{-1}.s^{-2}$)\\
+stored at the cells}
+
+\variab{IESTIM}{IESTIM(NESTMX,NPHSMX)}{IA}{For each phase, property
+number for the NESTMX error estimators for Navier-Stokes. The estimators
+currently available are IESTIM(IESPRE\index{IESPRE},IPHAS),
+IESTIM(IESDER\index{IESDER},IPHAS), IESTIM(IESCOR\index{IESCOR},IPHAS),
+IESTIM(IESTOT\index{IESTOT},IPHAS)\\
+stored at the cells}
+
+\variab{IFLUMA}{IFLUMA(NVARMX)}{IA}{Property number corresponding to the
+mass flow associated with each variable ({\em i.e.} for each face
+of surface $S$, $\rho \vect{u} \,.\,\vect{S}$ in $kg.s^{-1}$). It
+must be noticed that the mass flows are associated with the
+variables and not with the phases. This allows to have a distinct
+convective flow for each scalar.\\
+stored at the internal faces and boundary faces}
+
+\variab{IFLUAA}{IFLUAA(NVARMX)}{IA}{Property number corresponding to the
+mass flow associated with each variable at
+the previous time step, in the case of a second-order extrapolation in time\\
+stored at the internal faces and boundary faces}
+
+\variab{IVISLS}{IVISLS(NSCAMX)}{IA}{Property number corresponding to the
+diffusivity of scalars for which it is variable ({\em i.e.}$\displaystyle
+\frac{\lambda}{C_p}$ for the temperature, in $kg.m^{-1}.s^{-1}$). It must
+be noticed that the diffusivity is associated with the scalars rather
+than with the variables. See note below\\
+stored at the cells}
+
+\variab{IVISSA}{IVISSA(NSCAMX)}{IA}{Property number corresponding to the
+diffusivity of scalars for which it is variable ({\em i.e.}$\displaystyle
+\frac{\lambda}{C_p}$ for the temperature, in $kg.m^{-1}.s^{-1}$) at the
+previous time step, in the case of a second-order extrapolation in time\\
+stored at the cells}
+
+\variab{ISMAGO}{ISMAGO(NPHSMX)}{IA}{For each phase, property number
+corresponding to the variable $C$ of the dynamic model, {\em i.e}
+so that $\mu_t=\rho C\overline{\Delta}^2\sqrt{2S_{ij}S_{ij}}$ (with the
+notations of \cite{benhamadouche01}). $C$ corresponds to $C_s^2$ in the
+classical model of Smagorinsky\\
+stored at the cells}
+
+\variab{ICOUR}{ICOUR(NPHSMX)}{IA}{For each phase, CFL number in each cell at the
+present time step\\
+stored at the cells}
+
+\variab{IFOUR}{IFOUR(NPHSMX)}{IA}{For each phase, Fourier number in each cell at
+the present time step\\
+stored at the cells}
+
+\variab{IPRTOT}{IPRTOT(NPHSMX)}{IA}{For each phase\footnote{Although the data
+structure of \CS allows multi-phase variables, the algorithm does not allow
+more than one pressure}, total pressure in each cell\\
+stored at the cells}
+
+\variab{IVISMA}{IVISMA(1 or 3)}{IA}{When the ALE method for deformable meshes is
+activated, IVISMA corresponds to the ``mesh viscosity'', allowing to limit
+the deformation in certain areas. This mesh viscosity can be isotropic or be
+taken as a diagonal tensor (depending on the value of the parameter
+IORTVM\index{IORTVM}.\\
+stored at the cells}
+
+\variab{ICMOME}{ICMOME(NBMOMX)}{IA}{Property number corresponding to
+the time averages defined by the user. More precisely, it is not the time
+average that is stored, but a summation over time (the division by the cumulated
+duration is done just before the results are written)\\
+stored at the cells}
+
+\variab{ICDTMO}{ICDTMO(NBMOMX)}{IA}{Property number corresponding to the
+cumulated duration associated with each time average defined by the
+user, when this duration is not spatially uniform (see note below)\\
+stored at the cells}
+
+
+\minititre{Note: Variable physical properties}\label{provar}
+Some physical properties such as specific heat or diffusivity are often
+constant (choice made by the user).
+In that case, in order to limit the necessary memory, these
+properties are stored as a simple real number rather than in a domain-sized
+array of reals.
+\begin{list}{$\bullet$}{}
+\item It is the case for the specific heat $C_p$.
+\begin{list}{-}{}
+\item If $C_p$ is constant for the phase IPHAS, it can be specified in
+ the interface or by indicating ICP(IPHAS)=0 in \texttt{usini1},
+ and the property will be stored in the real number CP0(IPHAS).
+\item If $C_p$ is variable, it can be specified in the interface or by
+ indicating ICP(IPHAS)=1 in \texttt{usini1}. The code will then
+ modify this value to make ICP(IPHAS) refer to the effective
+ property number corresponding to the specific heat of the phase
+ IPHAS, in a way which is transparent for the user. For each cell
+ IEL, the value of $C_p$ is then given in \texttt{usphyv} and
+ stored in the array PROPCE(IEL,IPPROC(ICP(IPHAS))).
+\end{list}
+\item It is the same for the diffusivity $K$ of each scalar ISCAL.
+\begin{list}{-}{}
+\item If $K$ is constant, it can be specified in the interface or by
+ indicating IVISLS(ISCAL)=0 in \texttt{usini1}, and the property
+ will be stored in the real number VISLS0(ISCAL).
+\item If $K$ is variable, it can be specified in the interface or by
+ indicating IVISLS(ISCAL)=1 in \texttt{usini1}. The code will then
+ modify this value to make IVISLS(ISCAL) refer to the effective
+ property number corresponding to the diffusivity of the scalar
+ ISCAL, in a way which is transparent for the user. For each cell
+ IEL, the value of $K$ is then given in \texttt{usphyv} and stored
+ in the array PROPCE(IEL,IPPROC(IVISLS(ISCAL))).
+\end{list}
+\end{list}
+
+
+\minititre{Note: cumulated duration associated with the averages
+defined by the user}\label{prg_moyennes}
+The cumulated duration associated with the calculation of a time averages
+defined by the user is often a spatially uniform value. In this case, it
+is stored in a simple real number: for the mean value IMOM, it is the
+real number DTCMOM(-IDTMOM(IMOM))\index{DTCMOM}\index{IDTMOM} (IDTMOM(IMOM) is
+negative in this case).\\
+When this cumulated duration is not spatially uniform (for instance in the case
+of a spatially variable time step), it is stored in PROPCE. It must be
+noted that the cumulated duration associated with the calculation of
+the average IMOM is variable in space if IDTMOM(IMOM) is strictly
+positive. The number of the associated property in PROPCE is then
+ICDTMO(IDTMOM(IMOM))\index{ICDTMO}. For instance, for the average IMOM, the
+cumulated duration in the cell IEL will be
+PROPCE(IEL,ICDTMO(IDTMOM(IMOM))).\\
+The user may have a look to the example given in \texttt{usproj} to know
+how to calculate a time averages in a particular cases (printing of extreme
+values, writing of results, ...).
+
+\bigskip
+
+Two other variables, HBORD and TBORD, should be noted here, although they are
+relatively local (they appear only in the treatment of the boundary conditions)
+and are used only by developers.
+
+\variab{HBORD}{HBORD(NFABOR)}{RA}{Array of the exchange coefficient for
+temperature (or enthalpy) at the boundary faces. The table is allocated only if
+ISVHB\index{ISVHB} is set to 1 in \texttt{tridim}, which is done automatically
+but only if the coupling with \syrthes or the 1D thermal wall module are
+activated.}
+
+\variab{TBORD}{TBORD(NFABOR)}{RA}{Temperature (or enthalpy) at the boundary
+ faces\footnote{It is the physical temeprature at the boundary faces, not the
+boundary condition for temperature. See \cite{theory} for more details on
+boundary conditions}. The table is allocated only if
+ISVTB\index{ISVTB} is set to 1 in \texttt{tridim}, which is done automatically
+but only if the coupling with \syrthes or the 1D thermal wall module are
+activated.}
+
+Tables HBORD and TBORD are of size NFABOR, although they concern only the wall
+boundary faces.
+
+
+
+%%%ICI%%%%%%%%%%%%%%%
+
+%==================================
+\subsection{Variables related to the numerical methods}
+%==================================
+
+The main numerical variables and ``pointers''\footnote{As for the
+geometrical variables, some variables may be accessed to directly in
+sections of the unidimensional macro-arrays IA (for the integers) and RA
+(for the real numbers) which are present as arguments in every
+subroutine (apart from a few ones of very low level). The number of the
+first position of these sections in IA and RA is indicated by an integer
+stored in a ``common''. These integers are called ``pointers''} are
+displayed below.
+
+\minititre{Boundary conditions}
+
+\variab{COEFA}{COEFA(NFABOR,*)}{RA}{Boundary conditions: see note 2}
+
+\variab{COEFB}{COEFB(NFABOR,*)}{RA}{Boundary conditions: see note 2}
+
+\variab{ICLRTP}{ICLRTP(NVARMX,2)}{IA}{For each variable IVAR
+(1$\leqslant$IVAR$\leqslant$NVAR$\leqslant$ NVARMX), rank in COEFA and
+COEFB of the boundary conditions. See note 2}
+
+\variab{ICOEF}{ICOEF}{I}{Rank in ICLRTP of the rank in COEFA and COEFB
+of the ``standard'' boundary conditions. See note 2}
+
+\variab{ICOEFF}{ICOEFF}{I}{Rank in ICLRTP of the rank in COEFA and COEFB of the
+``flow'' type boundary conditions, reserved for developers. See note 2}
+
+
+\variab{IFMFBR}{IFMFBR(NFABOR)}{IA}{Family number of the boundary
+faces. See note 1}
+
+\variab{IPRFML}{IPRFML(NFML,NPRFML)}{IA}{Properties of the
+families of referenced entities. See note 1}
+
+
+\variab{IISYMP}{IISYMP}{I}{Integer giving the rank in IA of the first
+element of the section allowing to mark out the ``wall'' (ITYPFB=IPAROI or IPARUG)
+or ``symmetry'' (ITYPFB=ISYMET) boundary faces in order to prevent the
+mass flow (these faces are impermeable). For instance, for the phase
+IPHAS, if the face IFAC is a wall or symmetry face, IA(IISMPH+IFAC-1)=0 (with
+IISMPH=IISYMP+NFABOR*(IPHAS-1)).\\
+Otherwise IA(IISYMP+IFAC-1)=1. \\
+In some subroutines, an array called ISYMPA(NFABOR)\index{ISYMPA} allows
+to simplify the coding with ISYMPA(IFAC)=IA(IISMPH+IFAC-1)}
+
+\variab{IITRIF}{IITRIF}{I}{In IA, pointer to ITRIFB}
+
+\variab{IITYPF}{IITYPF}{I}{In IA, pointer to ITYPFB}
+
+\variab{ITRIFB}{ITRIFB(NFABOR,NPHAS)}{IA}{Indirection array allowing to
+sort the boundary faces according to their boundary condition type ITYPFB}
+
+\variab{ITYPFB}{ITYPFB(NFABOR,NPHAS)}{IA}{Boundary condition type at the
+boundary face IFAC for the phase IPHAS (see user subroutine
+\texttt{usclim})}
+
+\variab{IUETBO}{IUETBO}{I}{In RA, pointer to UETBOR, used to store the friction
+velocity at the wall, in the case of a LES calculation with van
+Driest-wall damping}
+
+\minititre{Distance to the wall}
+
+\variab{IIFAPA}{IIFAPA(NPHSMX)}{IA}{For each phase, the pointer in IA which
+ marks out the number of the wall face(type ITYPFB=IPAROI or IPARUG) which is closest
+ to the center of a given volume when necessary ($R_{ij}-\varepsilon$ with
+ wall echo, LES with van Driest-wall damping,
+or SST $k-\omega$ turbulence model) and when ICDPAR=2. The number of the wall
+face (for the phase IPHAS) which is the closest to the center of the
+cell IEL is therefore IA(IIFAPA(IPHAS)+IEL-1). This calculation method
+is not compatible with parallelism and periodicity}
+
+\variab{IDIPAR}{IDIPAR}{I}{For each phase, pointer in RA to the section
+allowing to mark out the distance between the center of a given volume and the
+closest wall, when it is necessary ($R_{ij}-\varepsilon$ with wall echo,
+LES with van Driest-wall damping, or SST $k-\omega$ turbulence model)
+and when ICDPAR=1. The distance between the center of the cell IEL and the
+closest wall is therefore RA(IDIPAR+IEL-1)}
+
+\variab{IYPPAR}{IYPPAR}{I}{For each phase, pointer in RA to the section
+allowing to mark out the adimensional distance $y^+$ between a given
+volume and the closest wall, when it is necessary (LES with van
+Driest-wall damping) and when ICDPAR=1. The adimensional distance $y^+$
+between the center of the cell IEL and the closest wall is therefore
+RA(IYPPAR+IEL-1)}
+
+\minititre{Pressure drops}
+
+\variab{IICEPD}{IICEPD(NPHSMX)}{IA}{For each phase IPHAS, pointer in IA to \\
+ICEPDC(NCEPDC(IPHAS)), array allowing to mark out the index-numbers of the \\
+NCEPDC(IPHAS) cells in which a pressure drop is imposed. \\
+The number of these cells is therefore given by ICEPDC(II)=IA(IICEPD(IPHAS)+II-1), with 1$\leqslant$II$\leqslant$NCEPDC(IPHAS). See the user subroutine
+\texttt{uskpdc}}
+
+\variab{ICEPDC}{ICEPDC(NCEPDC(IPHAS))}{IA}{Number of the NCEPDC(IPHAS)
+cells in which a pressure drop is imposed. See IICEPD and the user
+subroutine \texttt{uskpdc}}
+
+\variab{ICKUPD}{ICKUPD(NPHSMX)}{IA}{For each phase IPHAS, pointer in RA to \\
+CKUPDC(NCEPDC(IPHAS),6), array allowing to mark out the\\
+coefficients of the pressure drop tensor of the
+NCEPDC(IPHAS) cells in which a pressure drop is imposed. See the user
+subroutine \texttt{uskpdc}}
+
+\variab{CKUPDC}{CKUPDC(NCEPDC(IPHAS),6)}{RA}{Value of the
+coefficients of the pressure drop tensor of the
+NCEPDC(IPHAS) cells in which a pressure drop is imposed. See ICKPDC and
+the user subroutine \texttt{uskpdc}}
+
+\variab{NCEPDC}{NCEPDC(NPHSMX)}{IA}{For each phase, number of cells in
+which a pressure drop is imposed. See the user subroutine \texttt{uskpdc}}
+
+
+\minititre{Mass sources}
+
+\variab{IICESM}{IICESM(NPHSMX)}{IA}{For each phase IPHAS, pointer in IA
+to \\ ICETSM(NCETSM(IPHAS), array allowing to mark out the numbers of the \\
+NCETSM(IPHAS) cells in which a source of mass is imposed. The number of
+these cells is therefore given by ICETSM(II)=IA(IICESM(IPHAS)+II-1), with
+1$\leqslant$II$\leqslant$NCETSM(IPHAS). See the user subroutine
+\texttt{ustsma}}
+
+\variab{IITPSM}{IITPSM(NPHSMX)}{IA}{For each phase IPHAS, pointer in IA
+to ITYPSM (type of mass source for each variable). See ITYPSM and the
+user subroutine \texttt{ustsma}}
+
+\variab{ICETSM}{ICETSM(NCETSM(IPHAS))}{IA}{Number of the NCETSM(IPHAS)
+cells in which a mass source term is imposed. See IICESM and the user
+subroutine \texttt{ustsma}}
+
+\variab{ISMACE}{ISMACE(NPHSMX)}{IA}{For each phase IPHAS, pointer in RA
+to SMACEL (mass source term and if necessary injection value for every
+variable apart from pressure). See SMACEL and the user subroutine
+\texttt{ustsma}}
+
+\variab{ITYPSM}{ITYPSM(NCETSM(IPHAS),NVAR)}{IA}{Type of mass source term
+for each variable (0 for an injection at ambient value, 1 for an
+injection at imposed value). See the user subroutine \texttt{ustsma}}
+
+\variab{NCETSM}{NCETSM(NPHSMX)}{IA}{For each phase, number of cells with
+mass sources. See the user subroutine \texttt{ustsma}}
+
+\variab{SMACEL}{SMACEL(NCETSM(IPHAS),NVAR)}{RA}{Value of the mass source
+term for pressure. For the other variables, eventual imposed injection
+value. See the user subroutine \texttt{ustsma}}
+
+\minititre{Wall 1D thermal module}
+
+\variab{NFPT1D}{NFPT1D}{I}{Number of boundary faces which are coupled
+with a wall 1D thermal module. See the user subroutine \texttt{uspt1d}}
+
+\variab{IIFPT1}{IIFPT1}{I} {In IA, pointer to IFPT1D(NFPT1D), array allowing to
+mark out the numbers of the NFPT1D boundary faces which are coupled with
+a wall 1D thermal module. The number of these boundary faces is
+therefore given by IFPT1D(II)=IA(IIFPT1+II-1), with
+1$\leqslant$II$\leqslant$NFPT1D. See the user subroutine \texttt{uspt1d}}
+
+\variab{INPPT1}{INPPT1}{I}{In IA, pointer to NPPT1D(NFPT1D), array
+giving the number of discretisation cells in the 1D wall for the NFPT1D
+boundary faces which are coupled with a wall 1D thermal module. The
+number of cells for these boundary faces is therefore given by
+NPPT1D(II)=IA(INPPT1+II-1), with 1$\leqslant$II$\leqslant$NFPT1D. See
+the user subroutine \texttt{uspt1d}}
+
+\variab{IEPPT1}{IEPPT1}{I}{In IA, pointer to EPPT1D(NFPT1D), array
+giving the thickness of the 1D wall for the NFPT1D boundary faces which
+are coupled with a wall 1D thermal module. The wall thickness for these
+boundary faces is therefore given by EPPT1D(II)=IA(IEPPT1+II-1), with
+1$\leqslant$II$\leqslant$NFPT1D. See the user subroutine \texttt{uspt1d}}
+
+\minititre{Others}
+
+\variab{DT}{DT(NCELET)}{RA}{Value of the time step}
+
+\variab{IFMCEL}{IFMCEL(NCELET)}{IA}{Family number of the elements. See note 1}
+
+\variab{IS2KW}{IS2KW(NPHSMX)}{IA}{For each phase IPHAS, pointer in RA to
+the section storing the square of the norm of the deformation
+rate tensor. In the cell IEL, for the phase IPHAS, $S^2=2S_{ij}S_{ij}$
+is therefore given by RA(IS2KW(IPHAS)+IEL-1). This array is defined only
+when the phase IPHASE is treated with the SST $k-\omega$ turbulence model}
+
+\variab{IDVUKW}{IDVUKW(NPHSMX)}{IA}{For each phase IPHAS, pointer in RA
+to the section storing the divergence of the velocity. In the
+cell IEL, for the phase IPHAS, $div(\vect{u})$ is therefore given by
+RA(IDVUKW(IPHAS)+IEL-1). This array is defined only when the phase
+IPHASE is treated with the SST $k-\omega$ turbulence model (because in
+this case it may be calculated at the same time as $S^2$)}
+
+\variab{NGRMMX}{NGRMMX}{I}{upper limit of the number of grid levels
+in the case of a multigrid solving (see NGRMAX)}
+
+\variab{IA}{IA(LONGIA)}{IA}{Integer work array}
+
+\variab{RA}{RA(LONGRA)}{RA}{Real work array}
+
+
+\minititre{Note: boundary conditions}
+The boundary conditions in \CS boil down to determine a value for the
+current variable $\phi$ at the boundary faces, that is to say $\phi_f$,
+value expressed as a function of $\phi_{I'}$, value of $\phi$ in I',
+projection of the center of the adjacent cell on the straight line
+perpendicular to the boundary face and crossing its center:
+$\phi_f=A_{\phi,f}+B_{\phi,f}\phi_{I'}$. \\
+For a face IFAC, the pair of coefficients $A_{\phi,f},B_{\phi,f}$ is
+stored in COEFA(IFAC,ICLVAR) and
+COEFB(IFAC,ICLVAR), where the integer ICLVAR=ICLRTP(IVAR,IJCL)
+determines the rank in COEFA and COEFB of the set of boundary conditions
+of the variable IVAR. \\
+The second index of the array ICLRTP allows to have several sets of
+boundary conditions for each variable. The ``standard'' boundary
+conditions are determined by IJCL=ICOEF, where ICOEF is a parameter which
+is fixed automatically by the code, and can be accessed to in the
+``common'' file \texttt{numvar.h}. More specificic or advanced boundary
+conditions can be accessed to with IJCL=ICOEFF. \\
+In practice, for a variable IVAR whose value $\phi_{I'}$ in a
+boundary cell is known, the value at the corresponding boundary face
+IFAC is: \\
+\mbox{$\phi_f$=COEFA(IFAC,ICLVAR)+COEFB(IFAC,ICLVAR) $\phi_{I'}$}
+with ICLVAR=ICLRTP(IVAR,ICOEF)
+
+
+%==================================
+\subsection{User arrays}
+%==================================
+The code allows to define two user arrays, one integer array and one
+real array. The default size of these arrays is zero, and may be changed
+in \texttt{usini1}. The two arrays are then passed as arguments in every
+user subroutine of the code. For instance, a local variable calculated during
+the determination of the physical properties (user subroutine
+\texttt{usphyv}) may be stored in these arrays and sent to the
+post-processor at the end of the time step (user subroutine \texttt{usvpst}).
+
+\variab{NITUSE}{NITUSE}{I}{Size of the user integer array}
+
+\variab{NRTUSE}{NRTUSE}{I}{Size of the user real array}
+
+\variab{ITUSER}{ITUSER(NITUSE)}{IA}{User integer array}
+
+\variab{RTUSER}{RTUSER(NRTUSE)}{RA}{User real array}
+
+%==================================
+\subsection{Developer arrays}
+%==================================
+The code allows to define two developer arrays (similar to the user
+arrays ITUSER and RTUSER), one integer array a one real array. The
+default size of these arrays is zero, and may be changed in
+\texttt{ustbus}. The two arrays are then passed as arguments in the rest
+of the code. They are designed to be used during the transitory
+development phases, in order to ease the tests (transfer of pieces of
+informations without consequence on the arguments of the subroutines).
+
+\variab{NIDEVE}{NIDEVE}{I}{Size of the developer integer array}
+
+\variab{NRDEVE}{NRDEVE}{I}{Size of the developer real array}
+
+\variab{IDEVEL}{IDEVEL(NIDEVE)}{IA}{Complementary integer array, used
+during development and test phases}
+
+\variab{RDEVEL}{RDEVEL(NRDEVE)}{RA}{Complementary real array, used
+during development and test phases}
+
+%==================================
+\subsection{Parallelism and periodicity}
+%==================================
+
+Parallelism is based on domain partitioning: each processor is assigned
+a part of the domain, and data for cells on parallel boundaries
+is duplicated on neigboring processors in corresponding ``ghost'',
+or ``halo'' cells (both terms are used interchangeably). Values in
+these cells may be accessed just the same as values in regular cells.
+Communication is only required when cell values are modified
+using values from neighboring cells, as the values in the ``halo'' can
+not be computed correctly (since the halo does not have access to all
+its neighbors), so halo values must be updated by copying values from
+the corresponding cells on the neighboring processor.
+
+Compared to other tools using a similar system, a specificity of
+\CS is the separation of the halo in two parts: a standard part,
+containing cells shared through faces on parallel boundaries, and an
+extended part, containing cells shared through vertices, which is
+used mainly for least squares gradient reconstruction using an
+extended neighborhood. Most updates need only operate on the standard
+halo, requiring less data communication than those on the extended halos.
+
+\begin{figure}[!h]
+\centerline{
+\includegraphics*[width=14cm]{halo}}
+\caption{Parallel domain partitioning: halos}\label{Fig_haluile}
+\end{figure}
+
+Periodicity is handled using the same halo structures as parallelism,
+with an additional treatment for vector and coordinate values: updating
+coordinates requires applying the periodic transformation to the copied
+values, and in the case of rotation, updating vector and tensor values
+also requires appying the rotation transformation.
+Ghost cells may be parallel, periodic, or both. The example of a pump
+combining parallelism and periodicity is given figure \ref{Fig_parperio_pump}.
+In this example, all periodic boundaries match with boundaries on
+the same domain, so halos are either parallel or periodic.
+
+\begin{figure}[!h]
+\centerline{
+\includegraphics*[width=5.5cm]{rota_perio_parall}}
+\caption{Combined parallelism and periodicity}\label{Fig_parperio_pump}
+\end{figure}
+
+\label{prg_paralperio}
+{\bf Activation}
+
+Parallelism and periodicity are activated by means of the launch script
+in the standard cases:
+\begin{list}{$\bullet$}{}
+
+\item On clusters with PBS batch systems, the launching of a parallel run
+ requires to complete the \texttt{PBS} batch cards located in the
+ beginning of \texttt{runcase}, and particularly to set the number of
+ physical nodes (\texttt{nodes}) and the number of physical
+ processors per node (\texttt{ppn}) wanted. This can be done through
+ the Graphical Interface or by editing the \texttt{runcase} file directly.
+ The number of processors used for the calculation will then be set
+ automatically to the number of processors reserved and the
+ variable \texttt{NUMBER\_OF\_PROCESSORS} can be left empty
+ (see also \S\ref{prg_runcase}).
+
+\item On clusters with LSF batch systems (like the CCRT machines),
+ the launching of a parallel run
+ requires to complete the \texttt{LSF} batch cards located in the
+ beginning of \texttt{runcase}, and particularly to set the
+ number of processors (\texttt{\#BSUB -n}) wanted and the limit CPU
+ time (\texttt{\#BSUB -W}). As for now, this can only be done
+ by editing the \texttt{runcase} file directly.
+ The number of processors used for the calculation will then be set
+ automatically to the number of processors reserved and the
+ variable \texttt{NUMBER\_OF\_PROCESSORS} can be left empty
+ (see also \S\ref{prg_runcase}).
+
+\item On clusters with other batch systems, \texttt{runcase} file may have to
+ be modified manually. Please do not hesitate to contact the \CS support
+ (saturne-support at edf.fr) so that these modifications can be added to
+ the standard launch script to make it more general.
+
+\item Although on batch systems the \texttt{NUMBER\_OF\_PROCESSORS} variable
+ in the script (indicating the number of processors used for the
+ calculation) is filled automatically to the number of processors
+ reserved, the user can still choose to specify another value for it.
+ This might only happen in very specific conditions and is not advised,
+ as it will probably not be compatible with the batch system. Indeed,
+ batch systems forbid to launch a calculation on more processors than the
+ number of processors reserved, and some batch systems also forbid to
+ launch a calculation on less processors than the number of processors
+ reserved (automatic timeout on the idle processors that will stop the
+ whole calculation).
+
+
+\item Periodicity is activated through the Graphical Interface or by completing
+ the \texttt{COMMAND\_PERIO} of the launch script \texttt{runcase}.
+ The transformation
+ allowing to pass from a boundary to the other one must be defined
+ (the direction does not matter) and the set of periodic faces
+ should be (optional but strongly advised) marked out (for instance
+ by means of a color).
+
+\item Periodicity is compatible with parallelism.
+
+\item Periodicity can also work when the periodic boundaries are meshed
+ differently (periodicity of non-conforming faces), {\it apart} from
+ the case of a 180 degree rotation periodicity with faces coupled
+ on the rotation axis.
+
+\item A parallel calculation may be stopped in the same manner as a
+ sequential one using a \texttt{ficstp} file (see praragraph
+ \ref{prg_ficstp}).
+
+\item The standard pieces of information displayed in the listing
+ (marked out with \texttt{'v '} for the min/max values of the
+ variables), \texttt{'c '} for the data concerning the convergence
+ and \texttt{'a '} for the values before clipping) are global
+ values for the whole domain and not related to each processor.
+
+\end{list}
+
+\vspace{0.5cm}
+{\bf User subroutines}
+
+The user can notice in a subroutine
+\begin{list}{-}{}
+\item that the presence of periodicity is tested with the variable IPERIO
+ (=1 if periodicity is activated);
+\item that the presence of rotation periodicities is tested with the variable
+ IPEROT (number of rotation periodicities);
+\item that running of a calculation in parallel is tested for with the
+ variable IRANGP (IRANGP is worth -1 in the case of a non-parallel
+ calculation and N-1 in the case of a parallel calculation, N being
+ the number of the current processor)
+\end{list}
+Attention must be paid to the coding of the user subroutines. If
+conventionnal subroutines like \texttt{usini1} or \texttt{usclim}
+usually do not cause any problem, some kind of developments are more
+complicated. The most usual cases are dealt with below. \\ Examples are
+given in the subroutine \texttt{usproj}.
+\begin{list}{$\bullet$}{}
+\item {\bf Access to information related to neighboring cells in
+ parallel and periodic cases}.\\
+When periodicity or parallelism are brought into use, some cells of the
+ mesh become physically distant from their neighbors. Concerning
+ parallelism, the calculation domain is split and distributed
+ between the processors: a cell located at the ``boundary'' of a
+ given processor may have neighbors on different processors. \\
+In the same way, in case of periodicity, the neighboring cells of cells
+ adjacent to a periodic face are generally distant. \\
+When data concerning neighboring cells are required for the
+ calculation, they must first be searched on the other processors
+ or on the other edge of periodic frontiers. In order to ease the
+ manipulation of these data, they are stored temporarily in virtual
+ cells called ``halo'' cells, as can be seen in figure \ref{Fig_haluile}.
+It is in particular the case when the following operations are made on a
+ variable $A$:
+\begin{list}{-}{}
+\item calculation of the gradient of $A$ (use of \texttt{grdcel});
+\item calculation of an internal face value from the values of $A$ in
+ the neighboring cells (use of IFACEL).
+\end{list}
+The variable $A$ needs to be exchanged before these operations can be
+ made: to allow it, the subroutines \texttt{parcom} and
+ \texttt{percom} need to be called {\underline {\bf in this order}}.
+
+\item {\bf Global operations in parallel mode}.\\
+In parallel mode, the user must pay attention during the realisation of
+ global operations. The following list is not exhaustive:
+ \begin{list}{-}{}
+\item calculation of extreme values on the domain (for instance, minimum
+ and maximum of some calculation values);
+\item test of the existence of a certain value (for instance, do faces
+ of a certain color exist ?);
+\item verification of a condition on the domain (for instance, is a
+ given flow value reached somewhere ?);
+\item counting out of entities (for instance, how many cells have
+ pressure drops ?);
+\item global sum (for instance, calculation of a mass flow or the total
+ mass of a pollutant).
+ \end{list}
+The user may refer to the different examples present in the user
+ subroutine \texttt{usproj}. \\
+Care should be taken with the fact that the boundaries between
+ subdomains consist of {\bf internal} faces shared between
+ two processors (these are indeed internal faces, even if they are
+ located at a ``processor boundary''). They should not be counted twice
+ (once per processor) during global operations using internal faces
+ (for instance, counting the internal faces per processor and
+ summing all the obtained numbers drives into overevaluing the
+ number of internal faces of the initial mesh).
+
+\item {\bf Writing; operations that should be made on one
+ processor only in parallel mode}.\\
+In parallel mode, the user must pay attention during the writing of
+ pieces of information. Writing to the ``listing'' can be done
+ simply by using the NFECRA logical unit (each processor will write
+ to its own ``listing'' file): use
+ \texttt{WRITE(NFECRA,...}. \\
+If the user wants an operation to be done by only one processor (for
+ example, open or write a file), the associated instructions must
+ be included inside a test on the value of IRANGP (generally it is
+ the processor 0 which realises these actions, and we want the
+ subroutine to work in non-parallel mode, too: \texttt{IF
+ (IRANGP.LE.0) THEN ...}).
+\end{list}
+
+
+{\bf Some notes about periodicity}
+
+Some particular points should be reminded:
+\begin{list}{-}{}
+\item rotation periodicity is incompatible with
+ \begin{list}{-}{}
+ \item semi-transparent radiation,
+ \item reinforced velocity-pressure coupling (IPUCOU=1).
+ \end{list}
+\item although it has not been the case so far, potential problems might be met
+ in the case of rotation periodicity with the LRR $R_{ij}-\varepsilon$
+ model. They would come from the way of taking into account the
+ orthotropic viscosity (however, this term usually has a low influence).
+\end{list}
+
+%==================================
+\subsection{Geometry and particule arrays
+ related to lagrangian modeling}
+%==================================
+
+In this section is given a non-exhaustive list of the main variables
+which may be seen by the user in the lagrangian module. Most of them
+should not be modified by the user. They are calculated automatically
+from the data. However it may be useful to know their meaning.
+
+\noindent
+These variables are listed in the alphabetical index in the end of this
+document.
+
+\noindent
+The type of each variable is given: integer [I], real number [R],
+integer array [IA], real array [RA].
+
+\minititre{Size of the lagrangian arrays}
+
+\variab{LNDNOD}{LNDNOD}{I}{Size of the array ICOCEL concerning the cells-faces
+connectivity (the faces-nodes connectivity needs to be given to allow
+the construction of this connectivity. See note 3 of section
+\ref{prg_dimensions})}
+
+\variab{NBPMAX}{NBPMAX}{I}{Maximum number of particles
+simultaneously acceptable in the calculation domain}
+
+\variab{NVP}{NVP}{I}{Number of variables describing the particles for
+which a stochastic differential equation (SDE) is solved}
+
+\variab{NVLS}{NVLS}{I}{Number of variables describing the supplementary
+user particles for which a SDE is solved}
+
+\variab{NVEP}{NVEP}{I}{Number of real state variables describing the particles}
+
+\variab{NIVEP}{NIVEP}{I}{Number of integer state variables describing the particles}
+
+\variab{NTERSL}{NTERSL}{I}{Number of source terms representing the backward
+coupling of the dispersed phase on the continuous phase}
+
+\variab{NVLSTA}{NVLSTA}{I}{Number of volumetric statistical variables }
+
+\variab{NVLSTS}{NVLSTS}{I}{Number of supplementary user volumetric
+statistical variables}
+
+\variab{NVISBR}{NVISBR}{I}{Number of boundary statistical variables}
+
+\variab{NUSBOR}{NUSBOR}{I}{Number of supplementary user boundary statistical
+variables}
+
+\variab{NVGAUS}{NVGAUS}{I}{Number of gaussian random variables}
+
+\minititre{Note: continuous eulerian phase number}
+The current version of lagrangian module is planned to work with only one
+eulerian phase. This phase carries inclusions, and source terms of
+backward coupling are applied to it, if necessary. The number of this
+phase is stored in the variable ILPHAS\index{ILPHAS}. The standard value
+is ILPHAS = 1.
+
+\minititre{Lagrangian arrays}
+
+\variab{ICOCEL}{ICOCEL(LNDNOD)}{IA}{Cells - internal/boundary faces
+connectivity. The numbers of the boundary faces are marked out in ICOCEL
+with a negative sign}
+
+\variab{ITYCEL}{ITYCEL(NCELET+1)}{IA}{Array containing the position of
+the first face surrounding every cell in the array ICOCEL (see subroutine
+\texttt{lagdeb} for more details)}
+
+\variablist{ETTP}{ETTP(NBPMAX,NVP)}{RA}
+{Variables forming the state vector related to the particles: either at
+the current stage if the lagrangian scheme is a second-order, or at the
+current time step if the scheme is a first-order. These variables are
+marked out by ``pointers'' whose value can vary between 1 and NVP:
+\begin{list}{$\rightarrow$}{}
+\item JMP: particle mass
+\item JDP: particle diameter
+\item JXP, JYP, JZP: particle coordinates
+\item JUP, JVP, JWP: particle velocity components
+\item JUF, JVF, JWF: locally undisturbed fluid flow velocity components
+\item JTP, JTF: particle and locally undisturbed fluid flow temperature
+ (\degresC)
+\item JCP: particle specific heat
+\item JHP: coal particle temperature (\degresC)
+\item JMCH: mass of reactive coal of the coal particle
+\item JMCK: mass of coke of the coal particle
+\item JVLS(II): II\textit{th} supplementary user variable
+\end{list}
+}
+
+\variab{ETTPA}{ETTPA(NBPMAX,NVP)}{RA}{Variables forming the state vector
+related to the particles: either at the previous stage if the lagrangian
+scheme is a second-order, or at the previous time step if the lagrangian
+scheme is a first-order}
+
+\variablist{ITEPA}{ITEPA(NBPMAX,NIVEP)}{IA}{Integer state variables
+related to the particles. They are marked out by the following ``pointers'':
+\begin{list}{$\rightarrow$}{}
+\item JISOR: Number of the current cell containing the particle; this
+ number is reactualised during the trajectography step
+\item JINCH: Number of the coal particle
+\end{list}
+}
+
+\variablist{TEPA}{TEPA(NBPMAX,NVEP)}{RA}{Real state variables
+related to the particles. They are marked out by the following ``pointers'':
+\begin{list}{$\rightarrow$}{}
+\item JRTSP: particle residence time
+\item JRPOI: particle statistic weight
+\item JRDCK: coal particle shrinking core diameter
+\item JRD0P: coal particle initial diameter
+\item JRR0P: coal particle initial density
+\end{list}
+}
+
+\variab{INDEP}{INDEP(NBPMAX)}{IA}{Storage of the cell number of every
+particle at the beginning of a lagrangian iteration ; this data is not
+modified during the iteration}
+
+\variab{VITPAR}{VITPAR(NBPMAX,3)}{RA}{At the beginning of the
+trajectography, VITPAR contains the particle velocity vector components;
+the modifications of the particle velocity following every
+particle/boundary interaction are saved in this array ; after the
+trajectography and backward coupling steps, ETTP is updated with VITPAR}
+
+\variab{VITFLU}{VITFLU(NBPMAX,3)}{RA}{At the beginning of the
+trajectography, VITFLU contains the locally undisturbed fluid flow
+velocity vector components;
+the modifications of the locally undisturbed fluid flow velocity
+following every
+particle/boundary interaction are saved in this array ; after the
+trajectography and backward coupling steps, ETTP is updated with VITFLU}
+
+\variab{GRADPR}{GRADPR(NCELET,3)}{RA}{Pressure gradient of the
+continuous phase}
+
+\variab{GRADVF}{GRADVF(NCELET,9)}{RA}{Gradient of the continuous phase
+fluid velocity (useful if the complete model is activated: see MODCPL)}
+
+\variab{CPGD1}{CPGD1(NBPMAX)}{RA}{First devolatilisation term (light
+volatile matters) of the coal particles (useful in the case of backward
+coupling on the continuous phase)}
+
+\variab{CPGD2}{CPGD2(NBPMAX)}{RA}{Second devolatilisation term (heavy
+volatile matters) of the coal particles (useful in the case of backward
+coupling on the continuous phase)}
+
+\variab{CPGHT}{CPGHT(NBPMAX)}{RA}{Heterogeneous combustion term of the
+coal particles (useful in the case of backward coupling on the
+continuous phase)}
+
+\variablist{STATIS}{STATIS(NCELET,NVLSTA)}{RA}{Volumetric statistics
+related to the dispersed phase; these statistics are the kind of results
+expected with the lagrangian module. It is from these statistics that we
+obtain information concerning the particle cloud (the particle
+trajectories should only be observed on ``pedagogical'' account); they
+are marked out by the following ``pointers'':
+\begin{list}{$\rightarrow$}{}
+\item ILVX,ILVY,ILVZ: mean dispersed phase velocity
+\item ILVX2,ILVY2,ILVZ2: dispersed phase velocity standard deviation
+\item ILFV: dispersed phase volumetric concentration
+\item ILPD: sum of the statistical weights
+\item ILTP: dispersed phase temperature (\degresC)
+\item ILDP: dispersed phase mean diameter
+\item ILMP: dispersed phase mean mass
+\item ILHP: temperature of the coal particle cloud (\degresC)
+\item ILMCH: mass of reactive coal of the coal particle cloud
+\item ILMCK: mass of coke of the coal particle cloud
+\item ILMDK: shrinking core diameter of the coal particle cloud
+\item ILVU(II): II\textit{th} supplementary user volumetric statistics
+\end{list}
+}
+
+\variablist{PARBOR}{PARBOR(NFABOR,NVISBR)}{RA}{Boundary statistics
+related the dispersed phase ; after every particle/boundary
+interaction it is possible to save some data and to calculate averages ;
+the boundary statistics are marked out by the following ``pointers'':
+\begin{list}{$\rightarrow$}{}
+\item INBR: number of particle/boundary interactions
+\item IFLM: particle mass flow at the boundary faces
+\item IANG: mean interaction angle with the boundary faces (see example
+ in \texttt{uslabo})
+\item IVIT: mean interaction velocity with the boundary faces
+\item IENC: mass of coal deposit at the walls
+\item IUSB(II): II\textit{th} supplementary user boundary statistics
+\end{list}}
+
+\variablist{TSLAGR}{TSLAGR(NCELET,NTERSL)}{RA}{Source terms
+corresponding to the backward coupling of the dispersed phase on the
+continuous phase. These source terms are marked out by the following
+``pointers'':
+\begin{list}{$\rightarrow$}{}
+\item ITSVX, ITSVY, ITSVZ: explicit source terms for the continuous
+ phase velocity
+\item ITSLI: implicit source term for the continuous phase velocity and for the
+ turbulent energy if the $k-\varepsilon$ model is used
+\item ITSKE: explicit source term for the turbulent dissipation and the
+ turbulent energy if the $k-\varepsilon$ turbulence model is used for the
+ continuous phase
+\item ITSR11,... ITSR33: source terms for the Reynolds stress and the turbulent
+ dissipation if the $R_{ij}-\varepsilon$ turbulence model is used
+ for the continuous phase
+\item ITSMAS: mass source term
+\item ITSTE, ITSTI: explicit and implicit thermal source terms for the
+ thermal scalar of the continuous phase
+\item ITSMV1(ICHA), ITSMV2(ICHA): source terms respectively for the
+ light and heavy volatile matters
+\item ITSCO: source term for the carbon released during
+ heterogeneous combustion
+\item ITSF: source term for the air variance (not used at the
+ present time)
+\end{list}}
+
+\variab{CROULE}{CROULE(NCELET)}{TR}{Importance function for the
+technique of variance reduction (cloning/fusion of particles)}
+
+\variab{VAGAUS}{VAGAUS(NBPMAX,NVGAUS)}{RA}{Vectors of gaussian random
+variables}
+
+\variab{AUXL}{AUXL(NBPMAX,3)}{RA}{Auxiliary work array}
+
+
+%==================================
+\subsection{Variables saved to allow calculation restarts}
+%==================================
+
+The directory \texttt{RESTART*} contains:
+\begin{list}{-}{}
+\item \texttt{suiava}: main restart file,
+\item \texttt{suiavx}: auxiliary restart file (see ILEAUX\index{ILEAUX}, IECAUX\index{IECAUX}),
+\item \texttt{rayava}: restart file for the radiation module,
+\item \texttt{lagava}: main restart file for the lagrangian module,
+\item \texttt{lasava}: auxiliary restart file for the lagrangian module (mainly
+ for the statistics),
+\item \texttt{t1dava}: restart file for the 1D wall thermal module,
+\item \texttt{vorava}: restart file for the vortex method (see IVRTEX\index{IVRTEX}).
+\end{list}
+
+The main restart file contains the values in every cell of the mesh for
+pressure, velocity, turbulence variables and scalars. Its content is sufficient
+for a calculation restart, but the complete continuity of the solution at
+restart is not ensured\footnote{in other words, a restart calculation of n time
+steps following a calculation of m time steps will not yield strictly the same
+resluts as a direct calculation on m+n time steps, whereas it is the case when
+the auxiliary file is used}.
+
+The auxiliary restart file completes the main restart file to ensure
+solution continuity in the case of a calculation restart.
+If the code cannot find one or several pieces of data required for the
+calculation restart in the auxiliary restart file, default values are
+then used. This allows in particular to run calculation restarts even if
+the number of faces has been modified (for instance in case of
+modification of the mesh merging or of periodicity
+conditions\footnote{imposing a periodicity changes boundary faces into
+internal faces}). More precisely, the auxiliary restart file contains
+the following data:
+
+\begin{list}{-}{}
+\item type and value of the time step, turbulence model,
+\item density value at the cells and boundary faces, if it is variable,
+\item values at the cells of the other variable physical properties,
+when they are extrapolated in time (molecular dynamic viscosity, turbulent or
+subgrid scale viscosity, specific heat, scalar diffusivities); for the Joule
+effect, the specific heat is stored automatically (in case the user should need
+it at restart to calculate the temperature from the enthalpy before the new
+specific heat has been estimated),
+\item time step value at the cells, if it is variable,
+\item mass flow value at the internal and boundary faces (at the last
+time step, and also at the previous time step if required by the time scheme),
+\item boundary conditions,
+\item values at the cells of the source terms when they are extrapolated in time,
+\item number of time-averages, and values at the cells of the associated
+cumulated values,
+\item for each cell, distance to the wall when it is required (and
+index-number of the nearest boundary face, depending on ICDPAR\index{ICDPAR}),
+\item values at the cells of the external forces in balance with a part
+of the pressure (hydrostatic, in general),
+\item for the D3P gas combustion model: massic enthalpies and temperatures at entry,
+type of boundary zones and entry indicators,
+\item for the EBU gas combustion model: temperature of the fresh gas, constant
+mixing rate (for the models without mixing rate transport), types of boundary
+zones, entry indicators, temperatures and mixing rates at entry,
+\item for the LWC gas combustion model: the boundaries of the probability
+density functions for enthalpy and mixing rate, types of boundary
+zones, entry indicators, temperatures and mixing rates at entry,
+\item for the pulverised coal combustion: coal density, types of boundary
+zones, variables IENTAT, IENTCP, TIMPAT, X20 (in case of coupling
+with the lagrangian module, IENCP and X20 are not saved),
+\item for the electric module: the tuned potential difference DPOT\index{DPOT}
+and, for the electric arc module, the tuning coefficient COEJOU\index{COEJOU}
+(when the boundary conditions are tuned), the Joule source term for the enthalpy
+(with the Joule effect is activated) and the Laplace forces (with the electric
+arc module).
+\end{list}
+
+It should be noted that, if the auxiliary restart file is read, it is
+possible to run calculation restarts with relaxation of the
+density\footnote{such a relaxation only makes sense for a stationary
+calculation}(when it is variable), because this variable is stored in the
+restart file. On the other hand, it is generally not possible to do the
+same with the other physical properties (they are stored in the restart
+file only when they are extrapolated in time, or with the Joule effect for the
+specific heat).
+
+Apart from \texttt{vorava} which has a different structure and is
+always in ASCII format, all the restart files are binary
+files. Nonetheless, they may be dumped by the \texttt{cs\_io\_dump}
+tool provided with the Preprocessor.
+
+In the case of parallel calculations, it should be noted that all the processors
+will write their restart data in the same files. Hence, for instance, there will
+always be one and only one \texttt{suiava} file, whatever the number of
+processors used. The data in the file are written according to the initial full
+domain index-numbers for the cells, faces and nodes. This allows in particular
+to continue with {\it p} processors a calculation begun with {\it n} processors,
+or to make the restart files independent of any vectorial renumbering that may
+be carried out in each domain.
+
+{\bf On the other hand}, if the numbering of the initial full domain mesh is
+modified, the restart files will not be compatible. This may be the case if the
+mesh is composed of different elements that are pasted by the Preprocessor module
+and the order of the different elements has been changed in the Preprocessor command
+line between two calculations.
+
+{\em WARNING: if the mesh is composed of several files, the order
+in which they appear in the launch script or in the Graphical Interface must not
+be modified in case of a calculation restart\footnote{when uncertain, the user
+can check the saved copy of the launch script in the \texttt{RESU} directory, or
+the head of the \texttt{listpre} file, which repeats the command line passed to
+the Preprocessor module}.}
+
+{\em NOTE: when meshes are pasted by the Preprocessor module with potential hanging
+nodes, two nodes closer than a certain (small) tolerance will be
+merged. Hence, due to numerical round-up errors, two different machines may
+yield different results. This might change the number of faces in the global
+domain\footnote{the number of cells will not be modified, it is always the sum of the
+number of cells of the different meshes} and make restart files
+incompatible. Should that problem arise when making a calculation restart on a
+different architecture, the solution is to discard the \texttt{suiavx} file and
+use only the \texttt{suiava} file.}
+
+
+
+
+%==================================
+%==================================
+\section{User subroutines}
+%==================================
+%==================================
+\label{prg_ssprgutilis}
+%==================================
+\subsection{Preliminary comments}
+%==================================
+The user can run the calculations with or without an interface, with or
+ without the user subroutine. Without interface, some user subroutines
+ are needed. With interface, all the user subroutines are optional.
+
+The parameters can be read in the interface and then in the user
+subroutine. In the case that a parameter is specified in the interface
+ and in the user subroutine, it is the value in the user subroutine that
+ is taken into acount. It is for that reason that all the examples of
+ user subroutines are placed in the \texttt{REFERENCE} directory by the
+ case preparer \texttt{cs create}.
+
+
+
+%==================================
+\subsection{Using selection criteria in user subroutines}
+%==================================
+\label{fvm_selector}
+
+In order to use selection criteria (cf. \S\ref{selection_criteria}) in Fortran
+user subroutines, a collection of utility subroutines is provided. The aim is to
+define a subset of the mesh, for example:
+
+\begin{list}{-}{}
+\item boundary regions (cf. \texttt{usclim}, \texttt{uscpcl},
+\texttt{usray2}, \texttt{uslag2},...),
+\item volumic initialization (cf. \texttt{usiniv},...),
+\item head-loss region (cf. \texttt{uskpdc}),
+\item source terms region (cf. \texttt{ustsns}, \texttt{ustssc}),
+\item advanced post-processing (cf. \texttt{usdpst}), \texttt{usproj}, ...),
+\end{list}
+
+This section explains how to define surface or volume sections,
+in the form of lists \texttt{LSTELT} of \texttt{NLELT} elements
+(internal faces, boundary faces or cells).
+For each type of element, the user calls the appropriate Fortran
+subroutine: \texttt{getfbr}
+for boundary faces, \texttt{getfac} for internal faces
+and \texttt{getcel} for cells. All of these take
+the three following arguments:
+\begin{list}{-}{}
+\item the character string which contains the selection
+ criterion (see some examples below),
+\item the returned number of elements \texttt{NLELT},
+\item the returned list of elements \texttt{LSTELT}.
+\end{list}
+
+Several examples of possible selections are given here:
+\begin{list}{-}{}
+\item \verb+call getfbr('Face_1, Face_2', nlelt, lstelt)+ to select
+ boundary faces in groups Face\_1 or Face\_2,
+\item \verb+call getfac('4', nlelt, lstelt)+ to select internal
+ faces of color 4,
+\item \verb+call getfac('not(4)', nlelt, lstelt)+ to select internal
+ faces which have a different color from 4,
+\item \verb+call getfac('4 to 8', nlelt, lstelt)+ to internal faces
+with color between 4 and 8 internal faces,
+\item \verb+call getcel('1 or 2', nlelt, lstelt)+ to select cells
+ with colors 1 or 2,
+\item \verb+call getfbr('1 and y > 0', nlelt, lstelt)+ to select boundary
+ faces of color 1 which have the coordinate $Y > 0$,
+\item \verb+call getfac('normal[1, 0, 0, 0.0001]', nlelt, lstelt)+ to select
+internal faces which have a normal direction to the vector (1,0,0),
+\item \verb+call getcel('all[]', nlelt, lstelt)+ to select all cells.
+\end{list}
+
+The user may then use a loop on the selected elements.
+For instance, in the subroutine \texttt{usclim} used to impose
+boundary conditions, let us consider the boundary faces of color
+number 2 and which have the coordinate $X <= 0.01$ (so
+that \verb+call getfbr('2 and x <= 0.01', nlelt,lstelt)+);
+we can do a loop (\verb+do ilelt = 1, nlelt+) and
+obtain \verb+ifac = lstelt(ilelt)+.
+
+\minititre{Note: legacy method using explicit families and properties}
+
+The selection method for user subroutines by prior versions of \CS
+is still available, though it may be removed in future versions.
+This method was better adpated to working with colors than with groups,
+and is explained here:
+
+From \CS 's point of view, all the references to mesh entities (boundary faces
+and volume elements) correspond to a number (color number or negative
+of group number) associated with the entity. An entity may have several
+references (for instance, one entity may have one color and belong to
+several groups). In \CS, these references may be designated as
+``properties''. \\
+The mesh entities are gathered in equivalence classes on the base of
+their properties. These equivalence classes are called ``families''. All
+the entities of one family have the same properties. In order to know
+the properties (in particular the color) of an entity (a boundary face
+for example), the user must first determine the family to which it
+belongs. \\
+For instance, let's consider a mesh whose boundary faces have all been
+given one color (for example using SIMAIL). The family of the boundary
+face IFAC is IFML=IFMFBR(IFAC). The first (and only) property of this
+family is the color ICOUL, obtained for the face IFAC with
+ICOUL=IPRFML(IFML,1). In order to know the property number corresponding
+to a group, the user may refer to the listing of the Preprocessor
+(not forgetting to use the negative of the number in this case), or use
+the utility function \texttt{NUMGRP(NOMGRP, LNGNOM)} (with a name
+\texttt{NOMGRP} of the type \texttt{CHARACTER*} and its lenght
+\texttt{LNGNOM} of the type \texttt{INTEGER}).
+
+
+
+%==================================
+\subsection{Initialisation of the main key words: \textmd{\texttt{usini1}}}
+%==================================
+
+\noindent
+\textit{Subroutine only called during calculation initialisation.}
+
+This subroutine is used to indicate the value of different calculation
+basic parameters: constant and uniform physical values, parameters of
+numerical schemes, input-output management ...\\
+
+In the case of a calculation launched using the interface, it is only
+used to modify high-level parameters which can not be managed by the
+interface. In the case of a code utilisation without interface, this
+subroutine is compulsory and all the headings must be completed.
+
+For more details about the different parameters, please refer to the key
+word list (\S\ref{prg_motscles}).
+
+\texttt{usini1.F} is in fact a gouping of 6 sperate subroutines: \texttt{usipph},
+ \texttt{usinsc}, \texttt{usipsc}, \texttt{usipgl},
+\texttt{usipsu}and \texttt{usipes}. Each one controls the management of various
+ specific parameters. The key words that dont' feature in the supplied example
+can be provided by the user in \texttt{SRC/REFERENCE/base}; in this case, understanding
+ of the comments is needed to add the key words in the appropriate subroutine (the most
+ widely used is IPHAS, it will assure that the value has been well defined ).
+The modifiable parameters in each of the subroutines of \texttt{usini1.F} are:
+
+\begin{list}{$\bullet$}{}
+\item \texttt{usipph}: ITURB and ICP (don't modify these parameters anywhere else)
+\item \texttt{usinsc}: NSCAUS (don't modify these parameters anywhere else)
+\item \texttt{usipsc}: ISCAVR and IVISLS (don't modify these parameters anywhere else)
+\item \texttt{usipgl}: IDTVAR, IPUCOU, IPHYDR and the parameters related to the error
+estimators(don't modify these parameters anywhere else).
+\item \texttt{usipsu}: physical parameters of the calculation ( thermal scalar, physical
+ properties,...), numeric parameters (time steps, number of iterations,..),definition of the time averages.
+\item \texttt{usipes}: post treatment display parameters (periodicity, variable names,
+ position of probes,...)
+\end{list}
+
+For more details of the different parameters, see the list of key words (\S\ref{prg_motscles}).
+ The names of the key words can also be seen in the helps sections of the interface.
+
+\minititre{Notes}
+$\bullet\ $ Determined in the list of NSCAUS user scalars, representing
+ the mean square fluctuations of another whilst informing the ISCAVR
+array (warning, this was not the case in version 1.0). For
+the other scalars, ISCAVR does not need to be completed (by default,
+ISCAVR(II)$\leqslant$0). For instance, if the scalar JJ represents the
+average of the square of the fluctuations of the scalar KK, the user
+must indicate ISCAVR(JJ)=KK
+(1$\leqslant$KK$\leqslant$NSCAUS).
+
+\noindent
+$\bullet\ $ When using the interface, only the
+supplementary parameters (which can not be defined in the interface)
+should appear in \texttt{usini1}. To spare the user the necessity to
+delete the other parameters appearing as examples in the subroutine, the
+utility program \texttt{cs create} comments automatically all the
+example lines of \texttt{usini1} with a code \texttt{!ex}. The user
+needs then only to uncomment the lines which are useful in his
+case. This function of
+\texttt{cs create} can be inactivated with
+the option \texttt{--nogui} (useful if the user knows that he will not
+use the interface).
+
+%==================================
+\subsection{Management of boundary conditions: \textmd{\texttt{usclim}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+It is the second compulsory subroutine for every calculation launched
+without interface(except in the specific physics case where the
+corresponding boundary condition user subroutine must be used) \\
+When the interface is used, \texttt{usclim} is used to define complex
+boundary conditions (input profiles, conditions varying in time, ...)
+which could not be specified by means of the interface, and only these
+need to be defined. In the case of a calculation launched without the
+interface, all the boundary conditions must appear in \texttt{usclim}.\\
+\texttt{usclim} is essentially constituted of a loop on the boundary
+faces. Several sequences
+of \verb+CALL GETFBR+ \verb+('criterion', NLELT, LSTELT)+ (cf.
+\S\ref{fvm_selector}) allows to differentiate
+the boundary faces according to their group(s), their
+color(s) or geometrical criterion(s). If needed, disposal geometric and
+physical variables are also available to the user, these allow him to differentiate the boundary
+faces using other criterions.
+
+For more details about the treatment of boundary conditions, the user
+may refer to the theoretical and computer documentation \cite{theory} of
+the subroutine \texttt{condli} (for the wall conditions, see
+\texttt{clptur}) (to access to this document on a workstation, use
+\mbox{\texttt{cs info --guide theory}}).
+
+From the user point of view, the boundary conditions are totally
+determined by three arrays\footnote{except with Lagrangien}~: ITYPFB(NFABOR,NPHAS)\index{ITYPFB},
+ICODCL(NFABOR,NVAR)\index{ICODCL} and RCODCL(NFABOR,NVAR,3)\index{RCODCL}.
+\begin{list}{-}{}
+\item ITYPFB(IFAC,IPHAS) defines the type of the face IFAC (input, wall
+ ...) for the phase IPHAS.
+\item ICODCL(IFAC,IVAR) defines the type of boundary
+ condition for the variable IVAR at the face IFAC (Dirichlet, flux ...).
+\item RCODCL(IFAC,IVAR,.) gives the numerical values associated with the
+ type of boundary condition (value of the Dirichlet, of the flux ...).
+\end{list}
+
+In the case of standard boundary conditions (see
+\S\ref{prg_clstandard}), it is enough to complete ITYPFB(IFAC,IPHAS) and
+some boxes of the array RCODCL, the array ICODCL and most of the boxes
+of RCODCL are completed automatically. For non-standard boundary
+conditions (see \S\ref{prg_clnonstandard}), the arrays ICODCL and RCODCL
+must be totally completed.
+
+%==================================
+\subsubsection{Coding of standard boundary conditions}
+%==================================
+\label{prg_clstandard}%
+The standard values taken by the indicator ITYPFB are:
+IENTRE\index{IENTRE}, IPAROI\index{IPAROI}, IPARUG\index{IPARUG},
+ISYMET\index{ISYMET}, ISOLIB\index{ISOLIB} and IINDEF\index{IINDEF}.
+
+\begin{list}{$\bullet$}{}
+\item If ITYPFB=IENTRE: inlet face.
+
+\begin{list}{$\rightarrow$}{}
+\item Zero-flux condition for pressure and Dirichlet condition for all
+ other variables. The value of the Dirichlet must be given in
+ RCODCL(IFAC,IVAR,1) for every value of IVAR, apart from
+ IVAR=IPR(IPHAS). The other boxes of RCODCL and ICODCL are completed automatically.
+\end{list}
+
+\item If ITYPFB=IPAROI: smooth solid wall face, impermeable and with friction.
+
+\begin{list}{$\rightarrow$}{}
+\item the eventual moving velocity of the wall tangent to the face is
+ given by RCODCL(IFAC,IVAR,1) (IVAR being IU(IPHAS), IV(IPHAS) or
+ IW(IPHAS)). The initial value of RCODCL(IFAC,IVAR,1) is zero for
+ the three velocity components (and therefore needs to be specified
+ only in the case of the existence of a slipping velocity). \\
+{\em WARNING: the wall moving velocity must be in the boundary face
+ plane. By security, the code uses only the projection of this
+ velocity on the face. As a consequence, if the velocity specified
+ by the user is not in the face plane, the wall moving velocity really
+ taken into account will be different.}
+
+\item Concerning the scalars, two kinds of boundary conditions can be
+ defined:
+\begin{list}{$\rightsquigarrow$}{}
+\item Imposed value at the wall. The user must write\\
+\hspace*{1cm}ICODCL(IFAC,IVAR)=5\\
+\hspace*{1cm}RCODCL(IFAC,IVAR,1)=imposed value\\
+\item Imposed flux at the wall. The user must write\\
+\hspace*{1cm}ICODCL(IFAC,IVAR)=3\\
+\hspace*{1cm}RCODCL(IFAC,IVAR,3)=flux imposed value (for the flux
+ definition according to the variable, the user may refer to the
+ case ICODCL=3 of the paragraph \ref{prg_clnonstandard}).
+\item If the user does not complete these arrays, the default condition
+ is zero flux.
+\end{list}
+\end{list}
+
+\item If ITYPFB=IPARUG: rough solid wall face, impermeable and with friction.
+
+\begin{list}{$\rightarrow$}{}
+\item the eventual moving velocity of the wall tangent to the face is
+ given by RCODCL(IFAC,IVAR,1) (IVAR being IU(IPHAS), IV(IPHAS) or
+ IW(IPHAS)). The initial value of RCODCL(IFAC,IVAR,1) is zero for
+ the three velocity components (and therefore needs to be specified
+ only in the case of the existence of a slipping velocity). \\
+{\em WARNING: the wall moving velocity must be in the boundary face
+ plane. By security, the code uses only the projection of this
+ velocity on the face. As a consequence, if the velocity specified
+ by the user is not in the face plane, the wall moving velocity really
+ taken into account will be different.}
+\item The dynamic roughness must be specified in RCDOCL(IFAC,IU(IPHAS),3).
+ The value of RCDOCL(IFAC,IV(IPHAS),3) and RCDOCL(IFAC,IW(IPHAS),3)
+ are not used.
+\item Concerning the scalars, two kinds of boundary conditions can be
+ defined:
+\begin{list}{$\rightsquigarrow$}{}
+\item Imposed value at the wall. The user must write\\
+\hspace*{1cm}ICODCL(IFAC,IVAR)=6\\
+\hspace*{1cm}RCODCL(IFAC,IVAR,1)=imposed value\\
+\hspace*{1cm}RCODCL(IFAC,IVAR,3)=thermal roughness value\\
+\item Imposed flux at the wall. The user must write\\
+\hspace*{1cm}ICODCL(IFAC,IVAR)=3\\
+\hspace*{1cm}RCODCL(IFAC,IVAR,3)=flux imposed value (for the flux
+ definition according to the variable, the user may refer to the
+ case ICODCL=3 of the paragraph \ref{prg_clnonstandard}).
+\item If the user does not complete these arrays, the default condition
+ is zero flux.
+\end{list}
+\end{list}
+
+
+
+\item If ITYPFB=ISYMET: symmetry face (or wall without friction)
+\begin{list}{$\rightarrow$}{}
+\item Nothing to write in ICODCL and RCODCL.
+\end{list}
+
+\item If ITYPFB=ISOLIB: free outlet face (or more precisely free inlet/outlet
+ with forced pressure)
+\begin{list}{$\rightarrow$}{}
+\item The pressure is always treated with a Dirichlet condition, calculated
+ in order to have $\displaystyle \frac{d}{dn}\left(\frac{dP}{d\tau}\right)=0$.
+ The pressure is given the value $P_0$ at the first face ISOLIB met.
+ The pressure drop is always linked to just one face, even if there are
+ several outlets.
+\item If the mass flow is coming in, the ``infinite'' velocity is retained
+ and Dirichlet condition for the scalars and the turbulent quantities is used
+ (or zero-flux condition if no Dirichlet value has been specified).
+\item If the mass flow is going out, zero-flux condition for the velocity,
+ the scalars and the turbulent quantities.
+\item Nothing to write in ICODCL or RCODCL for the pressure or the velocity.
+ An optional Dirichlet condition can be specified for the scalars and turbulent
+ quantities.
+\end{list}
+
+\item Si ITYPFB=IINDEF: non-defined type face (non-standard case)
+\begin{list}{$\rightarrow$}{}
+\item The coding is done by completing every array RCODCL and ICODCL
+ (see \S\ref{prg_clnonstandard}).
+\end{list}
+\end{list}
+
+\minititre{Notes}
+$\bullet\ $ Whatever the value of the indicator ITYPFB(IFAC,IPHAS), if
+the array ICODCL(IFAC,IVAR) is modified by the user ({\em i.e.} filled
+in by a value different from zero), the code will not use the default
+conditions for the variable IVAR at the face IFAC, but will take into
+account the values of ICODCL and RCODCL given by the user (these arrays
+must then be totally completed, like in the non-standard case). \\
+For instance, for a symmetry face at which the scalar 1 is given a
+Dirichlet condition equal to 23.8 (with an infinite exchange
+coefficient):\\
+\hspace*{2cm}\texttt{ITYPFB(IFAC,IPHAS)=ISYMET}\\
+\hspace*{2cm}\texttt{ICODCL(IFAC,ISCA(1))=1}\\
+\hspace*{2cm}\texttt{RCODCL(IFAC,ISCA(1),1)=23.8D0}\\
+(\texttt{RCODCL(IFAC,ISCA(1),2)=RINFIN} is the default value, so it is
+not necessary to specify it)\\
+The boundary conditions for the other variables are still automatically
+defined.
+
+\noindent
+$\bullet\ $The user may define new types of wall faces. He only needs to
+choose a value $N$ and to specify completely the boundary conditions
+corresponding to this new wall face type (see
+\S\ref{prg_clnonstandard}). He must then specify
+ITYPFB(IFAC,IPHAS)=$N$. The value of $N$ must be between 1 and
+NTYPMX\index{NTYPMX} (maximum number of boundary face types), and of
+course different from the values IENTRE, IPAROI, IPARUG, ISYMET, ISOLIB
+and IINDEF (the value of these variables is given in the file
+\texttt{paramx.h}). This allows to isolate easily some boundary faces,
+in order to calculate balances.
+
+%==================================
+\subsubsection{Coding of non-standard boundary conditions}
+%==================================
+\label{prg_clnonstandard}%
+In the case of a face not corresponding to a standard type, the user
+must complete all of the arrays ITYPFB, ICODCL and
+RCODCL. ITYPFB(IFAC,IPHAS) is then worth IINDEF or another value defined
+by the user (see note in the end of paragraph \ref{prg_clstandard}). The
+arrays ICODCL and RCODCL must be completed as follows:
+
+\begin{list}{$\bullet$}{}
+\item If ICODCL(IFAC,IVAR)=1: Dirichlet condition at the face IFAC for
+ the variable IVAR.
+
+\begin{list}{$\rightarrow$}{}
+\item RCODCL(IFAC,IVAR,1) is the value of the variable IVAR at the face IFAC.
+
+\item RCODCL(IFAC,IVAR,2) is the value of the exchange coefficient
+ between the outside and the fluid for the variable IVAR. An
+ infinite value (\texttt{RCODCL(IFAC,IVAR,2)=RINFIN}) indicates a
+ perfect transfer between the outside and the fluid (default case).
+
+\item RCODCL(IFAC,IVAR,3) is not used.
+
+\item RCODCL(IFAC,IVAR,1) is expressed in the unit of the variable
+ IVAR, {\em i.e.}:
+\begin{list}{$\rightsquigarrow$}{}
+\item $m/s$ for the velocity
+
+\item $m^2/s^2$ for the Reynolds stress
+
+\item $m^2/s^3$ for the dissipation
+
+\item $Pa$ for the pressure
+
+\item \degresC\ for the temperature
+
+\item $J.kg^{-1}$ for the enthalpy
+
+\item \degresC$^2$ for the temperature fluctuations
+
+\item $J^2.kg^{-2}$ for the enthalpy fluctuations
+\end{list}
+
+\item RCODCL(IFAC,IVAR,2) is expressed in the following unit (defined so
+ that by multiplying the exchange coefficient and the variable, the
+ obtained flux has the same unit as the flux defined below for ICODCL=3):
+
+\begin{list}{$\rightsquigarrow$}{}
+\item $kg.m^{-2}.s^{-1}$ for the velocity
+
+\item $kg.m^{-2}.s^{-1}$ for the Reynolds stress
+
+\item $s.m^{-1}$ for the pressure
+
+\item $W.m^{-2}.\mbox{\degresC}^{-1}$ for the temperature
+
+\item $kg.m^{-2}.s^{-1}$ for the enthalpy
+\end{list}
+
+\end{list}
+
+\item If ICODCL(IFAC,IVAR)=3: flux condition at the face IFAC for the
+ variable IVAR.
+
+\begin{list}{$\rightarrow$}{}
+\item RCODCL(IFAC,IVAR,1) and RCODCL(IFAC,IVAR,2) are not used.
+
+\item RCODCL(IFAC,IVAR,3) is the flux value of IVAR at the wall. This
+ flux is negative if it is a source for the fluid. It corresponds to:
+\begin{list}{$\rightsquigarrow$}{}
+\item
+$\displaystyle -C_p(\frac{\lambda_T}{C_p}+\frac{\mu_t}{\sigma_T})\grad T\cdot\vect{n}$ in the case of a temperature (in $W/m^2$).
+
+$\displaystyle -(\lambda_h+\frac{\mu_t}{\sigma_h})\grad h\cdot\vect{n}$
+ in the case of an enthalpy (in $W/m^2$).
+
+$\displaystyle -(\lambda_\varphi+\frac{\mu_t}{\sigma_\varphi})\grad\varphi\cdot\vect{n}$ in the case of another scalar $\varphi$ (in $kg.m^{-2}.s^{-1}.[\varphi]$, where $[\varphi]$ is the unit of $\varphi$).
+
+\item $-\Delta t\ \grad P\cdot\vect{n}$ in the case of the pressure (in $kg.m^{-2}.s^{-1}$).
+
+\item $-(\mu+\mu_t)\grad U_i\cdot\vect{n}$ in the case of a velocity component (in $kg.m^{-1}.s^{-2}$).
+
+\item $-\mu\grad R_{ij}\cdot\vect{n}$ in the case of a $R_{ij}$ tensor component (in $W/m^2$).
+\end{list}
+
+\end{list}
+
+\item If ICODCL(IFAC,IVAR)=4: symmetry condition, for the symmetry
+ faces or wall faces without friction. This condition can only be
+ used for the velocity components ($\vect{U}\cdot\vect{n}=0$) and
+ the $R_{ij}$ tensor components (for the other variables, a zero-flux
+ condition type is generally used).\\
+
+\item If ICODCL(IFAC,IVAR)=5: friction condition, for the smooth-wall faces
+ with friction. This condition can not be applied to the pressure.
+\begin{list}{$\rightsquigarrow$}{}
+\item For the velocity and (if necessary) the turbulent variables, the
+ values at the wall are calculated from theoretical profiles. In
+ the case of a moving wall, the three components of the slipping
+ velocity are given by (RCODCL(IFAC,IU(IPHAS),1),
+ RCODCL(IFAC,IV(IPHAS),1), and RCODCL(IFAC,IW(IPHAS),1)).\\
+{\em WARNING: the wall moving velocity must be in the boundary face
+ plane. By security, the code uses only the projection of this
+ velocity on the face. As a consequence, if the velocity specified
+ by the user is not in the face plane, the wall moving velocity really
+ taken into account will be different.}
+
+\item For the other scalars, the condition ICODCL=5 is similar to
+ ICODCL=1, but with a wall exchange coefficient calculated from a
+ theoretical law. The values of RCODCL(IFAC,IVAR,1) and
+ RCODCL(IFAC,IVAR,2) must therefore be specified: see \cite{theory}.
+\end{list}
+
+\item If ICODCL(IFAC,IVAR)=6: friction condition, for the rough-wall faces
+ with friction. This condition can not be applied to the pressure.
+\begin{list}{$\rightsquigarrow$}{}
+\item For the velocity and (if necessary) the turbulent variables, the
+ values at the wall are calculated from theoretical profiles. In
+ the case of a moving wall, the three components of the slipping
+ velocity are given by (RCODCL(IFAC,IU(IPHAS),1),
+ RCODCL(IFAC,IV(IPHAS),1), and RCODCL(IFAC,IW(IPHAS),1)).\\
+{\em WARNING: the wall moving velocity must be in the boundary face
+ plane. By security, the code uses only the projection of this
+ velocity on the face. As a consequence, if the velocity specified
+ by the user is not in the face plane, the wall moving velocity really
+ taken into account will be different.}\\
+ The dynamic roughness height is given by RCODCL(IFAC,IU(IPHAS),3) only.
+
+\item For the other scalars, the condition ICODCL=6 is similar to
+ ICODCL=1, but with a wall exchange coefficient calculated from a
+ theoretical law. The values of RCODCL(IFAC,IVAR,1) and
+ RCODCL(IFAC,IVAR,2) must therefore be specified: see \cite{theory}.
+ The thermal roughness height is then given by RCODCL(IFAC,IVAR,3).
+\end{list}
+
+\item If ICODCL(IFAC,IVAR)=9: free outlet condition for the
+ velocity. This condition can only be applied to the velocity
+ components.\\
+If the mass flow at the face is going out, this condition is equivalent
+ to a zero-flux condition.\\
+If the mass flow at the face is coming in, the value zero is imposed to
+ the velocity at the face (but not to the mass flow).\\
+RCODCL is not used.
+
+\end{list}
+
+\minititre{Note}
+$\bullet\ $A standard ISOLIB outlet face amounts to a Dirichlet
+condition (ICODCL=1) for the pressure, a free outlet condition
+(ICODCL=9) for the velocity and a Dirichlet condition (ICODCL=1) if
+the user has specified a Dirichlet value or a zero-flux condition
+(ICODCL=3) for the other variables.\\
+
+%==================================
+\subsubsection{Checking of the boundary conditions}
+%==================================
+
+The code checks itself the main compatibilities between the boundary
+conditions. In particular, the following rules must be respected: \\
+$\bullet\ $On each face, the three components of the velocity
+must belong to the same type. The same must be true for the different
+components of the $R_{ij}$ tensor.\\
+$\bullet\ $If the boundary conditions for the velocity belong to the
+``slipping'' type (ICODCL=4), the conditions for $R_{ij}$ must belong to
+the ``symmetry'' type (ICODCL=4), and vice versa.\\
+$\bullet\ $If the boundary conditions for the velocity belong to the
+``friction'' type (ICODCL=5 or 6), the conditions for the turbulent variables
+must belong to the ``friction'' type, too.\\
+$\bullet\ $If the boundary condition for a scalar belongs to the
+``friction'' type, the boundary condition for the velocity must belong to
+the ``friction'' type, too.
+
+%==================================
+\subsubsection{Sorting of the boundary faces}
+%==================================
+
+In the code, it may be necessary to have access to all the boundary
+faces of a given type. In order to ease this kind of search, an array of
+sorted faces is automatically completed (and updated at every time step)
+for each phase IPHAS: ITRIFB(NFABOR,IPHAS)\index{ITRIFB}.\\
+IFAC=ITRIFB(n,IPHAS) is the number of the n$^{\text{th}}$ face of type
+1.\\
+IFAC=ITRIFB(n+N,IPHAS) is the number of the n$^{\text{th}}$ face de type
+2, if there are N faces of type 1.\\
+... etc.
+
+Two auxiliary arrays of size NTYPMX are also defined.\\
+IDEBTY(ITYP,IPHAS)\index{IDEBTY} is the number of the first box
+corresponding to the
+faces of type ITYP in the array ITRIFB.\\
+IFINTY(ITYP,IPHAS)\index{IFINTY} is the number of the last box
+corresponding to the
+faces of type ITYP in the array ITRIFB.
+
+Therefore, a number IFAC0 between IDEBTY(ITYP,IPHAS) and
+IFINTY(ITYP,IPHAS) corresponds to each face of type
+ITYP=ITYPFB(IFAC,IPHAS), so that IFAC=ITRIFB(IFAC0,IPHAS).
+
+If there is no face of type ITYP, the code imposes \\
+IFINTY(ITYP,IPHAS)=IDEBTY(ITYP,IPHAS)-1,\\
+which allows to bypass, for all the missing ITYP, the loops like \\
+\texttt{DO II=IDEBTY(ITYP,IPHAS),IFINTY(ITYP,IPHAS)}.
+
+The values of all these indicators are displayed in the beginning of the
+code execution listing.
+
+%=============================================================
+\subsection[Management of the boundary conditions with LES: \texttt{usvort}]
+{Management of the boundary conditions with LES: \textmd{\texttt{usvort}}}
+%===============================================================
+\label{prg_usvort}%
+This subroutine allows to generate the non-stationary inlet boundary
+conditions for the LES by the vortex method. The method is based on
+ the generation of vortices in the 2D inlet plane with help from
+the pre-defined functions. The fluctuation normal to the inlet plane
+is generated by a Langevin equation. It is in the subroutine \texttt{usvort}
+ where the parametres of this method are given.
+
+\noindent
+\textit{subroutine called for each time step}
+
+To allow the application of the vortex method, an indicator must be informed of
+the method in the user subroutine \texttt{usini1}(ivrtex=1)
+
+The subroutine \texttt{usvort} contains 3 seperate parts:
+
+\begin{list}{-}{}
+\item The 1st part defines the number of inlets concerned with the vortex
+method(NNENTT\index{NNENT}) and the number of vortex for each inlet (NVORT\index{NVORT}),
+where IENT represents the number of inlets.
+\item The 2nd part (IAPPEL=1) defines the boundary faces at which the vortex method
+ is applicable. The IREPVO\index{IREPVO} array is informed by IENT which defines
+ the number of inlets concerned with the vortex (essentially, the vortex
+ method can be applied with many independant inlets).
+\item The 3rd section defines the main parameters of the method at each inlet.
+ With the complexity of any given geometry, 4 cases are distinguished
+( the first 3 use the data file FICDAT and in the final case only 1
+initial velocity and energy are imposed.):
+
+\begin{list}{*}{}
+\item ICAS=1, For the outlet of a rectangluar pipe; 1 boundary condition is defined
+for each side of the rectangle taking into account their interaction
+with the vortex.
+\item ICAS=2, For the outlet of a circular pipe; the entry face is considered as a
+ wall (as far as interaction with the vortex is concerned)
+\item ICAS=3, For inlets of any geometry; no boundary conditions are defined at the
+ inlet face (i.e no specific treatment on the interation between the
+ vortex and the boundary)
+\item ICAS=4, similar to ICAS=3 except the data file is not used (FIDCAT); the outflow
+ parameters are estimated by the code from the global data (initial
+ velocity, level of turbulence and dissipation), information which is
+ supplied by the user.
+\end{list}
+
+When the geometry allows, cases 1 and 2 are used. Case 4 is only used
+ if it is not possible to use the other 3.
+
+In the first 3 cases, the 2 base vectors in the plane of each inlet
+must be defined (vectors DIR1 and DIR2). The 3rd vector is
+automatically calculated by the code, defined as a product of DIR1 and
+DIR2. DIR1 and DIR2 must be chosen imperatively to give (CEN, DIR1,
+DIR2) an orthogonal reference of the inlet plane and so DIR3 is
+orientated in the entry domain.If ICAS=2, the position CEN has to be
+the center of gravity of the rectangle or disc.
+
+The reference points (CEN, DIR1, DIR2, DIR3) wihch define the values
+of the variable in the FIDCAT file.\\
+In the case where ICAS=4, the vectors DIR1 and DIR2 are generated by
+the code.
+
+If ICAS=1, the boundary conditions at the rectangle's edges must be
+defined. They are defined in the array
+ICLVOR\index{ICLVOR}. ICLVOR(II,IENT) represents the standard boundary
+conditions at the edge II(1$\leqslant$II$\leqslant$4) of the inlet
+IENT. The code for the boundary conditions is as follows:
+\begin{list}{*}{}
+\item ICLVOR=1 for a wall
+\item ICLVOR=2 for symmetry
+\item ICLVOR=3 for periodicity of translation (the face corresponding to periodicity will
+automatically be taken as 3)
+\end{list}
+The 4 edges are numbered relative to the directions DIR1 and DIR2 as shown in figue \ref{Fig_vortex}:
+
+\begin{figure}[hp]
+\centerline{
+\includegraphics*[width=8cm]{vortex}}
+\caption{Numbering of the edges of a rectangular inlet(ICAS=1)
+ treated by the vortex method}\label{Fig_vortex}
+\end{figure}
+
+If ICAS=1, the user must define LLX and LLY which give the lengths of the rectangular
+ pipe in the directions DIR1 and dir2.\\
+If ICAS=2, LLD represents the diameter of the circular pipe.
+If ICAS=4, UDEBIT,KDEBIT and EDEBIT are defined for each inlet, these give respectively,
+initial speed, turbulent energy level and the dissipation level. These can be used to
+ obtain their magnitude using the correlations in the user routine \texttt{usclim} for
+ fully developed flow in a pipe.
+
+ The parameter not case dependant are defined as follows:
+\begin{list}{*}{}
+\item ITMPL represents the indicator of the advancement in time of the vortex. If ITMPLI=1,
+the vortex will be regenerated after a fixed time of TMPLIM second (defined as ITMPLI=1).
+ If ITMPLI=2, following hte data indicated in FIDCAT file, the vortex will have a variable
+life span equal to $5 \displaystyle C_\mu \displaystyle \frac{k^{\frac{3}{2}}}{\varepsilon U}$ ,
+where $C_\mu=0,09$ and $k$, $\varepsilon$ and $U$ represent respectively, turbulent energy,
+turbulent dissipation and the convective velocity in the direction normal to the inlet plane.
+
+\item XSIGMA represents the support functions used in the vortex method. They are representative
+ of the eddy sizes entered in the vortex method. ISIGMA is used to define their size: if ISIGMA=1,nction with the co-ordinates XDAT and YDAT (given in the FIDCAT file). Note that using an indicator III to accelerate the calculations
+ XSIGMA will be constant across the inlet face and is defined in \texttt{usvort}, if ISIGMA=2,
+nction with the co-ordinates XDAT and YDAT (given in the FIDCAT file). Note that using an indicator III to accelerate the calculations, XSIGMA will be variable and equal to the mixing length of the standard $k-\varepsilon$ model
+($\displaystyle {C_\mu}^{\frac{3}{4}} \displaystyle \frac{k^{\frac{3}{2}}}{\varepsilon}$), if
+ ISIGMA=3, XSIGMA will be equal to the maximum of $L_t$ et $L_K$ where $L_t$ and $L_K$ are the $\displaystyle \frac{\partial U}{\partial y}$ $\displaystyle \frac{\partial U}{\partial y}$
+ Taylor and Kolmogrov co-efficients
+($\displaystyle L_T=(5 \nu \frac{k}{\displaystyle \varepsilon})^{\frac{1}{2}}$,
+$\displaystyle L_K= 200 (\frac{\nu^3}{\varepsilon})^{\frac{1}{4}}$).
+
+\item IDELPA gives the vortex displacement method in the 2D inlet plane (the vortex method
+is a langrangian method in which the eddy centers are replaced by a set velocity). If IDELPA=1,
+the velocity displacement referred to by UD which is the vortex following a random sampling
+(a sample number r, is taken for each vortex, at each time step and for each direction and
+ the center of the vortex is replaced by the 2 principle directions, $r \mbox{UD} \Delta t$ where
+$\Delta t$ is the time step of the calcualtion). If IDEPLA=2, the vortex will be convected by itself
+( with the speed given by the time step before the vortex method)
+\end{list}
+
+A data file, FIDCAT, must be defined in the cases of ICAS=1,2,3, for each inlet. The data file
+ must contain the following data in order ($x$, $y$, $U$, $\displaystyle \frac{\partial U}
+{\partial y}$, $k$, $\varepsilon$). The number of lines of the file is given by the integer
+ NDAT. $x$ and $y$ are the co-ordinates in the inlet plane defined by the vectors DIR1 and
+DIR2. $U$, $k$ and $\varepsilon$ are respectively, the average speed normal to the inlet,
+the turbulent energy and the turbulent dissipation.
+$\displaystyle \frac{\partial U}{\partial y}
+$ is the derivative in the direction normal to the
+ inlet boundary in the cases , ICAS=1, ICAS=2.
+ Where ICAS=3 and ICAS=4 this variable is not applied (it is given the value 0)so the
+ Langevin equations, used to generate fluctuations normal to the inlet plane, is de-activated
+ (the flucutations normal to the inlet is 0 on both these cases). Note that the application of
+ many different test of the Langevin
+ equation doesn't have a notable influence on the results and that, by contrast it simply
+increases the computing time per iteration and so it decreases the random sampling which slows
+ down the pressure solver. The interpolation used in the vortex method is defined by the function
+ PHIDAT. An example is given at the end of \texttt{usvort} where the user can define the
+interpolation required. In the PHIDAT function, XX and YY are the co-ordinates by which the valu
+e of PHIDAT is calculated. XDAT and YDAT are the co-ordinates in the FIDCAT file. VARDAT is the
+value of the PHIDAT function with the co-ordinates XDAT and YDAT (given in the FIDCAT file). Note
+ that using an indicator III accelerates the calculations(the user need not modify or delete).
+ The user must also define the parameter ISUIVO wich indicates if the vortex were started at 0
+ or if the file must be re-read (FICMVO).
+
+\end{list}
+
+{\bf \underline{WARNING}}
+\begin{list}{$\bullet$}{}
+\item Be sure that the FIDCAT file and the interpolation in the user function PHIDAT are
+compatible (in particular that all the entry region is covered by FIDCAT)
+\item If the user wants to use a 1D profile in the DIR2 direction, set $x$ =0 in the FIDCAT
+ file and define the interpolation in PHIDAT.
+\end{list}
+
+
+%==================================
+\subsection{Management of the variable physical properties:
+ \textmd{\texttt{usphyv}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+If necessary, all the variation laws related to the fluid physical
+parameters (density, viscosity, thermal diffusivity ...) are written in this
+subroutine.
+
+The validity of the variation laws must be checked, particularly when
+non-linear laws are defined (for instance, a third-degree polynomial law
+may produce negative density values).
+
+{\bf \underline{WARNING}}\label{prg_propvar}
+\begin{list}{$\bullet$}{}
+\item If one wishes to impose a density or viscosity variable in
+ \texttt{usphyv}, it can be done either in the interface or in
+ \texttt{usini1}(IROVAR(IPHAS)=1, IVIVAR(IPHAS)=1).
+\item In order to impose a physical property ($\rho$, $\mu$,
+ $\lambda$, $C_p$)\footnote{except for some specific physics} a reference
+ value must be inputted to the interface or in \texttt{usini1}(in
+ particular for $\rho$, the pressure will contain 1 part as $\rho_0 gz$)
+\item By default, the $C_p$ coefficient of the phase IPHAS and the
+ diffusivity of the scalars ISCAL ($\lambda/C_p$ for the
+ temperature) are considered as constant in time and uniform in
+ space, with the values CP0(IPHAS) and VISLS0(ISCAL) specified in
+ the interface or in \texttt{usini1}.\\
+To give a variable value to $C_p$, the user must specify it in the
+ interface or give the value 1 to ICP(IPHAS) in \texttt{usini1},
+ and complete for each cell IEL the array PROPCE(IEL,IPCCP) in
+ \texttt{usphyv}. Completing the array PROPCE(IEL,IPCCP) while
+ ICP(IPHAS)=0 induces array overwriting problems and produces wrong
+ results.
+
+\item In the same way, to have variable diffusivities for the scalars
+ ISCAL, the user must specify it in the interface or give the value
+ 1 to IVISLS(ISCAL) in \texttt{usini1}, and complete for each cell
+ IEL the array PROPCE(IEL,IPCVSL) in \texttt{usphyv}. Completing
+ PROPCE(IEL,IPCVSL) while IVISLS(ISCAL)=0 induces memory overwriting
+ problems and produces wrong results.\\
+
+{\em Example}: If the scalars 1 and 3 have a constant and uniform
+ viscosity, and if the scalars 2 and 4 have a variable viscosity,
+ the following values must be imposed in \texttt{usini1}: \\
+IVISLS(1)=0, IVISLS(2)=1, IVISLS(3)=0 and IVISLS(4)=1. \\
+The indicators IVISLS(2) and IVISLS(4) are then modified automatically
+ by the code in order to reflect the rank corresponding to the
+ diffusivity of each scalar in the list of physical
+ properties\footnote{they are no longer worth 1 but stay positive
+ so that IVISLS$>$0 is synonymous with variable property}. The
+ arrays \mbox{PROPCE(IEL,IPCVSL)} in \texttt{usphyv} must then be
+ completed with IPCVSL=IPPROC(IVISLS(2)) and IPCVSL=IPPROC(IVISLS(4)). \\
+
+{\em Note}: The indicators IVISLS must not be completed in the case of
+ user scalars representing the average of the square of the
+ fluctuations of another scalar, because the diffusivity of a user
+ scalar JJ representing the average of the square of the
+ fluctuations of a user scalar KK comes directly from the
+ diffusivity of this last scalar. In particular, the diffusivity
+ of the scalar JJ is variable if the diffusivity of KK is variable.
+\end{list}
+
+%==================================
+\subsection{Non-standard initialisation of the variables:
+ \textmd{\texttt{usiniv}}}
+%==================================
+
+\noindent
+\textit{Subroutine only called during calculation initialisation.}
+
+At the calculation beginning, the variables are initialised
+automatically by the code. Velocities and scalars are set to the value
+0 (or SCAMAX or SCAMIN if 0 is outside the acceptable scalar variation
+range), and the turbulent variables are estimated from UREF and
+ALMAX. \\
+For $k$ in $k-\varepsilon$, $R_{ij}-\varepsilon$, v2f or $k-\omega$
+model:\\
+\texttt{RTP(IEL,IKIPH) = 1.5D0*(0.02D0*UREF(IPHAS))**2}
+(in $R_{ij}-\varepsilon$, $R_{ij}=\frac{2}{3}k\delta_{ij}$)\\
+For $\varepsilon$ in $k-\varepsilon$, $R_{ij}-\varepsilon$ or v2f model:\\
+\texttt{RTP(IEL,IEIPH) = RTP(IEL,IKIPH)**1.5D0*CMU/ALMAX(IPHAS)}\\
+For $\omega$ in $k-\omega$ model:\\
+\texttt{RTP(IEL,IOMGIP) = RTP(IEL,IKIPH)**0.5D0/ALMAX(IPHAS)}\\
+For $\varphi$ and $\overline{f}$ in v2f model:\\
+\texttt{RTP(IEL,IPHIPH) = 2.D0/3.D0}\\
+\texttt{RTP(IEL,IFBIPH) = 0.D0}
+
+The subroutine \texttt{usiniv} allows if necessary to initialise some
+variables at values closer to their estimated final values, in order to
+obtain a faster convergence.
+
+This subroutine allows also to make non-standard initialisation of
+physical parameters (density, viscosity, ...), to impose a local
+value of the time step, or to modify some parameters (time step,
+variable specific heat, ...) in the case of a calculation restart.
+
+\minititre{Note: value of the time step}
+\begin{list}{-}{}
+\item In the case of a calculation with constant and uniform time step
+ (IDTVAR=0), the value of the time step is DTREF, given in the
+ parametric file of the interface or \texttt{usini1}, the
+ calculation being whether a restart (ISUITE=1) or not (ISUITE=0).
+\item In the case of a calculation with non-constant time step
+ (IDTVAR=1 or 2) which is not a calculation restart (ISUITE=0), the
+ value of DTREF given in the parametric file of the interface or in
+ \texttt{usini1} is used to initialise the time step.
+\item In the case of a calculation with non-constant time step
+ (IDTVAR=1 or 2) which is a restart (ISUITE=1) of a calculation
+ whose time step type was different (for instance, restart using a
+ variable time step of a calculation run using a constant time
+ step), the value of DTREF given in the parametric file of the
+ interface or in \texttt{usini1} is used to initialise the time step.
+\item In the case of a calculation with non-constant time step
+ (IDTVAR=1 or 2) which is a restart (ISUITE=1) of a calculation
+ whose time step type was the same (for instance, restart with
+ IDTVAR=1 of a calculation run with IDTVAR=1), the time step is
+ read from the restart file and the value of DTREF given in the
+ parametric file of the interface or in \texttt{usini1} is not used.
+\end{list}
+It follows that for a calculation with non-constant time step (IDTVAR=1
+or 2) which is a restart (ISUITE=1) of a calculation in which IDTVAR had
+the same value, DTREF does not allow to modify the time step. The user
+subroutine \texttt{usiniv} allows to modify the array DT which contains
+the value of the time step read from the restart file (array whose size
+is NCELET, defined at the cell centers whatever the chosen time step type).
+
+{\em WARNING: to initialise the variables in the framework of a
+specific physics module} (NSCAPP.GT.0) {\em one of the subroutines
+\texttt{usebui}, \texttt{usd3pi}, \texttt{uslwci} or \texttt{uscpiv}
+should be used instead of \texttt{usiniv} (depending on the activated module).}
+
+%==================================
+\subsection{Non-standard management of the chronological record files:
+ \textmd{\texttt{ushist}}}
+%==================================
+\label{prg_ushist}
+
+\noindent
+\textit{Subroutine called every time step}
+
+The interface and the subroutine \texttt{usini1} allow to manage the
+``automatic'' chronological record files in an autonomous way:
+position of the probes, printing frequency and concerned variables. The
+results are written in a different file for each variable. These files
+are written in {\em xmgrace or {\em gnuplot}} format and contain the profiles corresponding to
+every probe. This type of output format may not be well adapted if, for
+instance, the number of probes is too high. The subroutine
+\texttt{ushist} allows then to personalise the output format of the
+chronological record files. The version given as example in the
+directory works as follows:
+
+\begin{list}{-}{}
+\item Positionning of the probes (only at the first passage): the index
+ II varies between 1 and the number of probes. The coordinates XX,
+ YY and ZZ of each probe are given. The subroutine \texttt{findpt}
+ gives then the number ICAPT(II)\index{ICAPT} of the cell center
+ which is the closest to the defined probe.
+
+\item Opening of the output files (only at the first pass): in the
+ version given as example, the program opens a different file for
+ all the NVAR variables. FICUSH(J) contains the name of the
+ J\raisebox{1ex}{\small th} file and IMPUSH(J) its unit number
+ (IMPUSH is initialised by default so that the user has at his
+ disposal specific unit numbers and does not run the risk to overwrite an
+ already open file).
+
+\item Writing to the files: in the version given as example, the program
+ writes the time step number, the physical time step (based on the
+ standard time step in the case of a variable time step) and the
+ value of the selected variable at the different probes.
+
+\item Closing of the files (only at the last time step).
+
+\end{list}
+
+{\em WARNING: The use of {\em\texttt{ushist}} neither erases nor replaces the
+parameters given in the interface or in {\em\texttt{usini1}}. Therefore, in
+the case of the use of {\em\texttt{ushist}}, and to avoid the creation
+of useless files, the user should set {\em NCAPT=0} in the interface or
+in {\em \texttt{usini1}} to deactivate the automatic production of
+chronological records}.\\
+In addition, {\em \texttt{ushist}} generates supplementary result
+files. The user shoud remember to add in the launch script the necessary
+command to copy them in the directory \texttt{RESU} at the end of the
+calculation. The interface allows the specification of the name of the copied
+ user results files. For the calculations without interface, the variable must
+ be inputted in USER\_OUTPUT\_FILES in the launch script.
+
+%==================================
+\subsection{User source terms in Navier-Stokes: \textmd{\texttt{ustsns}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step}
+
+This subroutine is used to add user source terms to the Navier-Stokes
+equations. For each phase IPHAS, it is called three times every time
+step, once for each velocity component (IVAR is successively worth
+IU(IPHAS), IV(IPHAS) and IW(IPHAS)). At each passage, the user must
+complete if necessary the arrays CRVIMP and CRVEXP expressing
+respectively the implicit and explicit part of the source term. If
+ no other source terms apart from IVAR=IU(IPHAS)for example, are require
+d, CRVIMP and CRVEXP must be read over and their 2 other components,
+ IVAR=IV(IHPAS) and IVAR=IW(IPHAS) must be cancelled.
+
+{\em WARNING: The decomposition of the soure terms of CVRIMP/CRVEXP is
+ different to that of the code ESTET: be careful of reflex working}
+
+Let us assume that the user source terms modify the equation of a
+variable $\varphi$ in the following way:
+\begin{displaymath}
+\rho\frac{\partial \varphi}{\partial t}+\ldots = \ldots + S_{impl}\times\varphi+S_{expl}
+\end{displaymath}
+$\varphi$ is here a velocity component, but the examples are also valid
+for a turbulent variable ($k$, $\varepsilon$, $R_{ij}$, $\omega$,
+$\varphi$ or $\overline{f}$) and for a scalar (or for the average of the
+square of the fluctuations of a scalar), because the syntax of the
+subroutines \texttt{ustske}, \texttt{ustsri}, \texttt{ustsv2},
+\texttt{ustskw} and \texttt{ustssc} is similar.
+
+In finite volume formulation, the solved system is then modified as
+follows:
+\begin{displaymath}
+\left(\frac{\rho_i\Omega_i}{\Delta t_i}-\Omega_iS_{impl,i}\right)
+\left(\varphi_i^{(n+1)}-\varphi_i^{(n)}\right)
++\ldots = \ldots + \Omega_iS_{impl,i}\varphi_i^{(n)} + \Omega_iS_{expl,i}
+\end{displaymath}
+The user needs therefore to provide the following values:\\
+$\text{CRVIMP}_i=\Omega_iS_{impl,i}$\\
+$\text{CRVEXP}_i=\Omega_iS_{expl,i}$
+
+In practice, it is essential that the term
+$\displaystyle \left(\frac{\rho_i\Omega_i}{\Delta
+t_i}-\Omega_iS_{impl,i}\right)$ is positive. To ensure this property,
+the equation really taken into account by the code is the following:
+\begin{displaymath}
+\left(\frac{\rho_i\Omega_i}{\Delta t_i}-
+\text{Min}(\Omega_iS_{impl,i};0)\right)
+\left(\varphi_i^{(n+1)}-\varphi_i^{(n)}\right)
++\ldots = \ldots + \Omega_iS_{impl,i}\varphi_i^{(n)} + \Omega_iS_{expl,i}
+\end{displaymath}
+To make the ``implicitation'' effective, the source term decomposition
+between implicit and explicit parts will be done by the user who must
+make sure $\text{CRVIMP}_i=\Omega_iS_{impl,i}$ is always negative
+(otherwise the solved equation remains right, but there is no
+``implicitation'').
+
+{\em WARNING: When the second-order in time with extrapolation of the
+source terms\footnote{indicator \texttt{ISNO2T} for the velocity,
+\texttt{ISTO2T} for the turbulence and \texttt{ISSO2T} for the scalars}
+is activated, it is no longer possible to test the sign of $S_{impl,i}$,
+because of coherence reasons (for more details, the user may refer to
+the theoretical and computer documentation \cite{theory} of the
+subroutine \texttt{preduv}). The user must therefore make sure it is
+always positive.}
+
+\minititre{Particular case of a linearised source term}
+
+In some cases, the added source term is not linear, but the user may
+want to linearise it using a first-order Taylor development, in order to
+make it partially implicit.\\
+Let us consider an equation of the type:
+\begin{displaymath}
+\rho\frac{\partial\varphi}{\partial t}=F(\varphi)
+\end{displaymath}
+
+We want to make it implicit using the following method:
+\begin{eqnarray*}
+\frac{\rho_i\Omega_i}{\Delta t}\left(\varphi_i^{(n+1)}-\varphi_i^{(n)}\right) & = &
+\Omega_i\left[F(\varphi_i^{(n)})+\left(\varphi_i^{(n+1)}-\varphi_i^{(n)}\right)
+\frac{dF}{d\varphi}(\varphi_i^{(n)})\right]\\
+& = & \Omega_i\frac{dF}{d\varphi}(\varphi_i^{(n)})\times\varphi_i^{(n+1)}
++\Omega_i\left[F(\varphi_i^{(n)})-\frac{dF}{d\varphi}(\varphi_i^{(n)})
+\times\varphi_i^{(n)}\right]
+\end{eqnarray*}
+
+The user must therefore specify:\\
+$\displaystyle\text{CRVIMP}_i=\Omega_i\frac{dF}{d\varphi}(\varphi_i^{(n)})$\\
+$\displaystyle\text{CRVEXP}_i=
+\Omega_i\left[F(\varphi_i^{(n)})-\frac{dF}{d\varphi}(\varphi_i^{(n)})\times\varphi_i^{(n)}\right]$
+
+\underline{\em Example}:\\
+If the equation is
+$\displaystyle \rho\frac{\partial\varphi}{\partial t}=-K\varphi^2$,
+the user must set:\\
+$\text{CRVIMP}_i=-2K\Omega_i\varphi_i^{(n)}$\\
+$\text{CRVEXP}_i=K\Omega_i[\varphi_i^{(n)}]^2$
+
+
+
+%==================================
+\subsection{User source terms for $k$ and $\varepsilon$:
+ \textmd{\texttt{ustske}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step, in $k-\varepsilon$ and
+in v2f.}
+
+This subroutine is used to add source terms to the transport equations
+related to the turbulent kinetics energy $k$ and to the turbulent
+dissipation $\varepsilon$ (for each phase IPHAS).
+This subroutine is called every time step, once for each phase (the
+treatment of the two variables $k$ and $\varepsilon$ is made
+simultaneously). The user is expected to provide the arrays CRKIMP and
+CRKEXP for $k$ and CREIMP and CREEXP for $\varepsilon$. These arrays are
+similar to the arrays CRVIMP and CRVEXP given for the velocity in the
+user subroutine \texttt{ustsns}. The way of making implicit the
+resulting source terms is the same as the one presented in \texttt{ustsns}.For $\varphi$ and $\bar{f}$
+in v2f, see \texttt{ustsv2}, \S\ref{prg_ustsv2}.
+
+
+
+%==================================
+\subsection{User source terms for $R_{ij}$ and $\varepsilon$: \textmd{\texttt{ustsri}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step, in $R_{ij}-\varepsilon$.}
+
+This subroutine is used to add source terms to the transport equations
+related to the Reynolds stress variables $R_{ij}$ and to the turbulent
+dissipation $\varepsilon$ (for each phase IPHAS).
+This subroutine is called 7 times every time step and for each phase
+(once for each Reynolds stress component and once for the
+dissipation). The user must provide the arrays CRVIMP and CRVEXP for the
+variable IVAR (referring successively to IR11(IPHAS), IR22(IPHAS),
+IR33(IPHAS), IR12(IPHAS), IR13(IPHAS), IR23(IPHAS) and
+IEP(IPHAS)). These arrays are similar to the arrays CRVIMP and CRVEXP
+given for the velocity in the user subroutine \texttt{ustsns}. The way
+of making implicit the resulting source terms is the same as that
+presented in \texttt{ustsns}.
+
+%==================================
+\subsection{User source terms for $\varphi$ and $\overline{f}$:
+ \textmd{\texttt{ustsv2}}}
+%==================================
+\label{prg_ustsv2}
+\noindent
+\textit{Subroutine called every time step, in v2f.}
+
+This subroutine is used to add source terms to the transport equations
+related to the variables $\varphi$ and $\overline{f}$ of the v2f
+$\varphi$-model (for each phase IPHAS). This subroutine is called twice
+every time step and for each phase (once for $\varphi$ and once for
+$\overline{f}$). The user is expected to provide the arrays CRVIMP and
+CRVEXP for IVAR referring successively to IPHI(IPHAS) and
+IFB(IPHAS). Concerning $\varphi$, these arrays are similar to the arrays
+CRVIMP and CRVEXP given for the velocity in the user subroutine
+\texttt{ustsns}. Concerning $\overline{f}$, the equation is slightly
+different:
+\begin{displaymath}
+L^2 div(\grad(\overline{f})) = \overline{f} + \ldots + S_{impl}\times\overline{f}+S_{expl}
+\end{displaymath}
+In finite volume formulation, the solved system is written:
+\begin{displaymath}
+\int_{\partial\Omega_i}\grad(\overline{f})^{(n+1)}dS=\frac{1}{L_i^2}\left(
+\Omega_i\overline{f}^{(n+1)}_i + \ldots + \Omega_iS_{impl,i}\overline{f}_i^{(n+1)} +
+\Omega_iS_{expl,i} \right)
+\end{displaymath}
+The user must then specify:\\
+$\text{CRVIMP}_i=\Omega_iS_{impl,i}$\\
+$\text{CRVEXP}_i=\Omega_iS_{expl,i}$
+
+The way of making implicit the resulting source terms is the same as the
+one presented in \texttt{ustsns}.
+
+%==================================
+\subsection{User source terms for $k$ and $\omega$: \textmd{\texttt{ustskw}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step, in $k-\omega$.}
+
+This subroutine is used to add source terms to the transport equations
+related to the turbulent kinetics energy $k$ and to the specific
+dissipation rate $\omega$ (for each phase IPHAS). This subroutine is
+called every time step, once for each phase (the treatment of the two
+variables $k$ and $\omega$ is made simultaneously).The user is expected
+to provide the arrays CRKIMP and CRKEXP for the variable $k$ the arrays
+CRWIMP and CRWEXP for the variable $\omega$. These arrays are
+similar to the arrays CRVIMP and CRVEXP given for the velocity in the
+user subroutine \texttt{ustsns}. The way of making implicit the
+resulting source terms is the same as the one presented in \texttt{ustsns}.
+
+%==================================
+\subsection{User source terms for the user scalars: \textmd{\texttt{ustssc}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+This subroutine is used to add source terms to the transport equations
+related to the user scalars (passive or not, average of the square of
+the fluctuations of a scalar ...). In the same way as
+\texttt{ustsns}, this subroutine is called every time step, once for
+each user scalar. The user needs to provide the arrays CRVIMP and CRVEXP
+related to each scalar. CVIMP and CRVEXP must be set to 0 for the scalars on which it is not wished for the user source term term to be applied (the arrays are initially at 0 at each inlet in the subroutine.)
+
+%==================================
+\subsection{Management of the pressure drops: \textmd{\texttt{uskpdc}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+This subroutine is called three times every time step and for each phase
+IPHAS.
+
+The tensor representing the pressure drops is supposed to be symmetric
+and positive.
+
+\begin{list}{$\bullet$}{}
+\item During the first call, all the cells are checked to know the
+ number of cells in which a pressure drop is present for the phase
+ IPHAS. This number is called NCEPDP\index{NCEPDP} in
+ \texttt{uskpdc} (and corresponds to
+ NCEPDC(IPHAS)\index{NCEPDC}). It is used to lay out the arrays
+ related to the pressure drops. If there is no pressure drop,
+ NCEPDP must be equal to zero (it is the default value, and the
+ rest of the subroutine is then useless).
+
+\item During the second call, all the cells are checked again to
+ complete the array ICEPDP\index{ICEPDP} whose size is
+ NCEPDP. \mbox{ICEPDC(IELPDC)} is the number of the
+ IELPDC\raisebox{1ex}{\small th} cell containing pressure drops (for
+ the current phase).
+
+\item During the third call, all the cells containing pressure drops
+ (for the current phase) are checked in order to complete the array
+ containing the components of the tensor of pressure drops
+ \mbox{CKUPDC(NCEPDP,6)}\index{CKUPDC}. This array is so that
+ the equation related to the velocity may be written:
+\begin{displaymath}
+\rho\frac{\partial}{\partial t}\vect{u}=\ldots -\rho\tens{K}\ind{pdc}\cdot\vect{u}
+\end{displaymath}
+The tensor components are given in the following order (in the general
+ reference frame): K11, K22, K33, K12, K13, K23 with K12, K13 and K23
+ being zero if the tensor is diagonal.
+
+\end{list}
+
+
+The three calls are made every time step, so that variable pressure drop
+zones or values may be treated.
+
+%==================================
+\subsection{Management of the mass sources: \textmd{\texttt{ustsma}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+This subroutine is used to add a density source term in some cells of
+the domain. The mass conservation equation is then modified as follows:
+\begin{displaymath}
+\frac{\partial \rho}{\partial t} + div(\rho\vect{u})=\Gamma
+\end{displaymath}
+
+$\Gamma$ is the mass source term expressed in $kg.m^{-3}.s^{-1}$.
+
+The presence of a mass source term modifies the evolution equation of
+the other variables, too. Let $\varphi$ be a any solved variable apart
+from the pressure (velocity component, turbulent energy, dissipation,
+scalar ...). Its evolution equation becomes:
+\begin{displaymath}
+\rho\frac{\partial \varphi}{\partial t} + \ldots = \ldots + \Gamma(\varphi_i-\varphi)
+\end{displaymath}
+
+$\varphi_i$ is the value of $\varphi$ associated with the mass entering
+or leaving the domain. After discretisation, the equation may be written:
+\begin{displaymath}
+\rho\frac{\varphi^{(n+1)}-\varphi^{(n)}}{\Delta t} + \ldots
+= \ldots + \Gamma(\varphi_i-\varphi^{(n+1)})
+\end{displaymath}
+
+For each variable $\varphi$, there are two possibilities:
+\begin{list}{$\bullet$}{}
+\item We can consider that the mass is added (or removed) with the
+ ambient value of $\varphi$. In this case
+ $\varphi_i=\varphi^{(n+1)}$ and the equation of $\varphi$ is not
+ modified.
+\item Or we can consider that the mass is added with an
+ imposed value $\varphi_i$ (this solution is physically correct
+ only when the mass is effectively added, $\Gamma>0$).
+\end{list}
+
+\bigskip
+
+This subroutine is called three times every time step (for each phase).
+
+\begin{list}{$\bullet$}{}
+\item During the first call, all the cells are checked to know the
+ number of cells containing a mass source term for the current
+ phase IPHAS. This number is called NCESMP\index{NCESMP} in
+ \texttt{ustsma} (and corresponds to
+ NCETSM(IPHAS)\index{NCETSM}). It is used to lay out the arrays
+ related to the mass sources. If there is no mass source,
+ NCESMP must be equal to zero (it is the default value, and the
+ rest of the subroutine is then useless).
+
+\item During the second call, all the cells are checked again to
+ complete the array ICETSM\index{ICETSM} whose dimension is
+ NCESMP. \mbox{ICETSM(IELTSM)} is the number of the
+ IELTSM\raisebox{1ex}{\small th} cell containing a mass source (for
+ the current phase).
+
+\item During the third call, all the cells containing mass sources are
+ checked in order to complete the arrays
+ \mbox{ITYPSM(NCESMP,NVAR)}\index{ITYPSM} and
+ \mbox{SMACEL(NCESMP,NVAR)}\index{SMACEL}:\\
+- ITYPSM(IELTSM,IVAR) is the flow type associated with the variable IVAR
+ in the IELSTM\raisebox{1ex}{\small th} cell containing a mass
+ source.\\
+\hspace*{1cm}ITYPSM=0: $\varphi_i=\varphi^{(n+1)}$ condition\\
+\hspace*{1cm}ITYPSM=1: imposed $\varphi_i$ condition\\
+\hspace*{1cm}ITYPSM is not used for IVAR=IPR(IPHAS)\\
+- SMACEL(IELTSM,IPR(IPHAS)) is the value of the mass source term $\Gamma$, in
+$kg.m^{-3}.s^{-1}$.\\
+- SMACEL(IELTSM,IVAR), for IVAR different from IPR(IPHAS), is the value
+ of $\varphi_i$ for the variable IVAR in the
+ IELSTM\raisebox{1ex}{\small th} cell containing a mass source.\\
+
+\minititre{Notes}
+$\bullet$ If ITYPSM(IELTSM,IVAR)=0, SMACEL(IELTSM,IVAR) is not used.\\
+$\bullet$ If $\Gamma$=SMACEL(IELTSM,IPR(IPHAS))$<$0, mass is removed from
+ the system, and \CS considers automatically a
+ $\varphi_i=\varphi^{(n+1)}$ condition, whatever the values given
+ to ITYPSM(IELTSM,IVAR) and SMACEL(IELTSM,IVAR) (the extraction of a
+ variable is done at ambient value).
+\end{list}
+
+
+
+The three calls are made every time step, so that variable mass source
+zones or values may be treated.\\
+
+For the variance, do not take into account the scalar $\varphi_i$ in the environment
+where $\varphi\ne\varphi_i$ generates a variance source.
+
+%========================================
+\subsection{Thermal module in a 1D wall}
+%========================================
+
+\noindent
+\textit{subroutine called at every time step}
+
+This subroutine takes into account the affected thermal inertia by a wall.
+ Some boundary faces are treated as a solid wall with a given thickness, on
+ which the code resolves an undimensional equation for the heat conduction.
+ The coupling between the 1D module and the fluid works in a similar way to
+ the coupling with the \syrthes . In construction, the user is not able to
+ account for the heat transfer between different parts of the wall. A physical
+ analysis of each problem, case by case is required to evaluate the relevance
+ of its usage by way of a report of the simple conditions (temperature, zero-flux
+ ) or a coupling with \syrthes.\\
+
+The use of this code requires that theres is only 1 phase (NPHAS=1) and that
+ the thermal scalar is defined as (ISCALT$>0$).
+
+{\em WARNING: The 1D thermal module is developped assuming the thermal scalar
+ as a temperature. If the thermal scalar is an enthalpy, the code calls the
+ subroutine \texttt{usthht} for each transfer of information between the fluid
+ and the wall in order to convert the enthalpy to temperature and vice-versa.
+ This function has not been tested and is firmly discouraged . If the thermal
+ variable is the total (compressible) energy, the thermal module will not work.}
+
+\bigskip
+
+This procedure is called twice,on initialisation and again at each time step.
+
+\begin{list}{$\bullet$}{}
+\item The 1st call (initialisation) all the boundary faces that will be treated
+ as a coupled wall are marked out. This figure is written noted as NFKPT1D. It
+ applies dimension to the arrays in the thermal module. NFKPT1D will be at 0
+ if there are no coupled faces (it is in fact the default value, the remainer
+of the subroutine is not used in this case). The parameter ISUIT1 also need to
+ be defined, this indicates if the temperature of the wall must be initialised
+ or written in the file (stored in the variable FILMT1).
+\item The 2nd call (initialisation)again concern the wall faces, it completes
+ the IFPT1D array of dimension NFPT1D. \mbox{IFPT1D(IFBT1D)}is the number
+IFBT1D\raisebox{1ex}{\small th} boundary faces coupled with the thermal module
+ of a 1D wall. The discretional parameters are then completed for a pseudo
+ wall associated to each face
+\begin{list}{-}{}
+\item NPPT1D(NFPT1D)\index{NPPT1D}: number of cells in the 1D mesh associated
+ to the pseudo wall.
+\item EPPT1D(NFPT1D)\index{EPPT1D}: thickness of the pseudo wall.
+\item RGPT1D(NFPT1D)\index{RGPT1D}: geometery of the pseudo wall mesh (refined
+ as a fluid if RGT1D is smaller than 1)
+\item TPPT1D(NFPT1D)\index{TPPT1D}: initialisation temperature of the wall
+(uniform in thickness). In the course of the calculation, the array stores the
+ temperature of the solid at the fluid/solid interface.
+\end{list}
+
+Other than for re-reading a file (FICMT1), TPPT1D is not used. NPPT1D, IFPT1D,
+RGPT1D and EPPT1D are compared to data from the follow-up file and they must
+be identical.
+
+{\em WARNING: The test in IFPT1D implicilty assumes that the array is completed
+ in ascending order (i.e IFPT1D(II)$>$IFPT1D(JJ) if II$>$JJ. This will be the
+ case if the coupled faces are defined starting from the unique loop on the
+boundary faces (as in the example). If this is not the case, contact the development
+ team to short circuit the test.}
+
+\item The 3rd call (at each time step) is for the confirmation that all the arrays
+ involving physical parameter and external boundary conditions have been completed.
+\begin{list}{-}{}
+\item ICLT1D(NFPT1D)\index{ICLT1D}:Typical boundary condition at the external
+ (pseudo) wall: Dirichlet condition (ICLT1D=1) or flux condition (ICLT1D=3)
+\item TEPT1D(NFPT1D)\index{TEPT1D}: External temperature of the pseudo wall in the
+ Dirichlet case.
+\item HEPT1D(NFPT1D)\index{HEPT1D}: External coefficient of transfer in the pseudo
+ wall under Dirichlet conditions(en $W.m^{-2}.K^.$).
+\item FEPT1D(NFPT1D)\index{NFPT1D}: External heat flux in the pseudo wall under
+ the flux conditions(en $W.m^{-2}$,negative value for energy entering the wall)
+\item XLMT1D(NFPT1D)\index{XLMT1D}: Conductivity$\lambda$ of the wall uniform
+in thickness, (in $W.m^{-1}.K^{-1}$).
+\item RCPT1D(NFPT1D)\index{RCPT1D}: Volumetric heat capacity $\rho C_p$ of the
+wall uniform in thickness in $J.m^{-3}.K^{-1}$)
+\item DTPT1D(NFPT1D)\index{DTPT1D}: Physical time step ascociated with the solved
+ 1D equation of the pseudo wall(which can be different from the time step in the
+ calculation)
+\end{list}
+
+\end{list}
+
+The 3rd call, done at each time step, allows the imposition of boundary conditions
+ and physical values in time.
+
+%==================================
+\subsection{ Initialization of the options of the variables related
+ to the ale module: \textmd{\texttt{usalin}} and \textmd{\texttt{usstr1}} }
+%==================================
+\label{prg_usalin}%
+\noindent
+\textit{Subroutine called at the start.}
+
+
+\minititre{Subroutine \texttt{usalin}}
+This subroutine completes \texttt{usini1}.
+
+\texttt{usalin} allows to set option for the ale module, and in
+particular to active the ale module
+
+\minititre{Subroutine \texttt{usstr1}}
+
+\texttt{usstr1} allows to specify for the structure module the
+following pieces of information:
+\begin{list}{-}{}
+ \item number of structure (NBSTRU).
+ \item initial value of deplacement, velocity and acceleration
+ (XSTR0, XSTREQ and VSTR0).
+\end{list}
+
+Below is a list of the different variables that might be modified :
+
+\begin{list}{$\bullet$}{}
+
+\item{NBSTRU} \\
+{the number of structures}
+
+\item{IDFSTR(I)} \\
+{index of the structure, where I is the index of the face}
+
+\item{XSTR0(I,K)} \\
+{ initial position of a structure, where I is the dimension of space
+and K the index of the structure }
+
+\item{XSTREQ(I,K)} \\
+{position of balance of a structure, where I is the dimension of space
+and K the index of the structure }
+
+\item{VSTR0(I,K)} \\
+{initial velicity of a structure, where I is the dimension of space
+and K the index of the structure }
+\end{list}
+
+%==================================
+\subsection{Management of the boundary conditions of velocity mesh related to the ale module: \textmd{\texttt{usalcl}}}
+%==================================
+
+
+\noindent
+\textit{Subroutine called every time step.}
+
+\minititre{Subroutine \texttt{usalcl}}
+The use of \texttt{usalcl} is obligatory to run a calculation using
+the ale module just as it is in \texttt{usini1} . The way of using it
+is the same as the way of using \texttt{usclim} in the framework of
+standard calculations, that is to say a loop on the boundary faces
+marked out by their colour (or more generally by a property of their
+family), where the type of boundary condition of velocity mesh for
+each variable are defined.
+
+The main numerical variables are described below.
+
+\variab{IALTYB}{IALTYB(NFABOR)}{IA}{In the ale module, the user
+defines the velocity mesh from the colour of the boundary faces, or
+more generally from their properties (colours, groups ...), from the
+boundary conditions defined in \texttt{usclim}, or even from their
+coordinates. To do so, the array IALTYB(NFABOR) gives for each face
+IFAC the velocity mesh boundary condition types marked out by the key
+words IVIMPO\index{IVIMPO}, IGLISS\index{IGLISS}, IBFIXE\index{IBFIXE}
+
+\begin{list}{$\bullet$}{}
+
+\item If IALTYB=IVIMPO : imposed velocity.
+
+\begin{list}{$\rightarrow$}{}
+\item In the case where all the nodes of a face have a imposed displacement,
+it is not necessary to fill the tables with boundary conditions
+velocity mesh for this face, they will be erased. In the other case,
+the value of the Dirichlet must be given in RCODCL(IFAC,IVAR,1) for
+every value of IVAR (IUMA, IVMA and IWMA) The other boxes of RCODCL
+and ICODCL are completed automatically.
+
+ The tangential velocity mesh is taken like a tape speed under the
+ boundary conditions of wall for the fluid, except if wall velocity
+ was specified by the user in the interface or usclim (in which case
+ it is this speed which is considered).
+\end{list}
+
+ \item if IALTYB(NFAC) = IBFIXE : fixe wall
+\begin{list}{$\rightarrow$}{}
+ \item the velocity is null.
+\end{list}
+
+ \item if IALTYB(NFAC) = IGLISS : slice wall
+\begin{list}{$\rightarrow$}{}
+\item the tangential velocity is not used.
+\end{list}
+
+\end{list}
+
+}
+
+
+%==================================
+\subsection{Management of the structure property: \textmd{\texttt{usstr2}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+The use of \texttt{usstr2}
+is obligatory to run a calculation using the ale module with a structure module.
+
+For each structure, the system that will be solved is :
+
+\begin{equation}
+M.x^{''}+C.x^{''}+K.(x-x_{0} = 0
+\end{equation}
+
+where
+
+\begin{list}{-}{}
+ \item $M$ is the mass stucture (XMSTRU).
+ \item $C$ is the dumping coefficient of the stucture (XCSTRU).
+ \item $K$ is the spring constant or force constant of the stucture (XKSTRU).
+ \item $x_{0}$ is the initial position
+\end{list}
+
+Below is a list of the different variables that might be modified :
+
+\begin{list}{$\bullet$}{}
+
+\item{XMSTRU(I,J,K)} \\
+{the mass stucture of the structure, where I,J is the array of mass
+structure and K the index of the structure. }
+
+\item{XCSTRU(I,J,K)}\\
+{dumping coefficient of the stucture, where I,J is the array of
+dumping coefficient and K the index of the structure. }
+
+\item{XKSTRU(I,J,K)}\\
+{spring constant of the stucture, where I,J is the array of spring
+constant and K the index of the structure. }
+
+\item{FORSTR(I,K)}\\
+{force vector of the stucture, where I is the force vector and K the
+index of the structure. }
+\end{list}
+
+
+%==================================
+\subsection{Modification of the turbulent viscosity: \textmd{\texttt{usvist}}}
+%==================================
+\noindent
+\textit{Subroutine called every time step.}
+
+This subroutine is used to modify the calculation of the turbulent
+viscosity of the phase IPHAS, {\em i.e.} $\mu_t$ in $kg.m^{-1}.s^{-1}$
+(this piece of information, at the mesh cell centers, is conveyed by the
+variable PROPCE(IEL,IPCVST), with IPCVST = IPPROC(IVISCT(IPHAS))). The
+subroutine is called at the beginning of every time step, after the
+calculation of the physical parameters of the flow and of the
+``conventional'' value of $\mu_t$ corresponding to the chosen turbulence
+model (indicator ITURB(IPHAS)).\\
+{\em WARNING: The calculation of the turbulent viscosity being a
+particularly sensible stage, a wrong use of {\em\texttt{usvist}} may
+seriously distort the results.}
+
+%==================================
+%==================================
+\subsection{Modification of the variable $C$ of the dynamic LES model:
+ \textmd{\texttt{ussmag}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step in the case of LES with the
+dynamic model.}
+
+This subroutine is used to modify the calculation of the variable $C$ of
+the LES sub-grid scale dynamic model.
+
+Let us first remind that the LES approach introduces the notion of
+filtering between large eddies and small motions. The solved variables
+are said to be filtered in an ``implicit'' way. Sub-grid scale models
+(``dynamic'' models) introduce in addition an explicit filtering.
+
+The notations used for the definition of the variable $C$ used in the
+dynamic models of \CS are specified below. These notations are the ones
+assumed in the document \cite{benhamadouche01}, to which the user may
+refer for more details.
+
+The value of $a$ filtered by the explicit filter (of width
+$\widetilde{\overline{\Delta}}$) is called $\widetilde{a}$ and the value
+of $a$ filtered by the implicit filter (of width $\overline{\Delta}$) is
+called $\overline{a}$.
+We define:
+\begin{equation}
+\begin{array}{ll}
+\overline{S}_{ij}=\frac{1}{2}(\frac{\partial \overline{u}_i}{\partial x_j}
+ +\frac{\partial \overline{u}_j}{\partial x_i}) &
+||\overline{S}||=\sqrt{2 \overline{S}_{ij}\overline{S}_{ij}}\\
+\alpha_{ij}=-2\widetilde{\overline{\Delta}}^2
+ ||\widetilde{\overline{S}}||
+ \widetilde{\overline{S}}_{ij}&
+\beta_{ij}=-2\overline{\Delta}^2
+ ||\overline{S}||
+ \overline{S}_{ij}\\
+L_{ij}=\widetilde{\overline{u}_i\overline{u}_j}-
+ \widetilde{\overline{u}}_i\widetilde{\overline{u}}_j&
+M_{ij}=\alpha_{ij}-\widetilde{\beta}_{ij}\\
+\end{array}
+\end{equation}
+
+
+In the framework of LES, the total viscosity (molecular + sub-grid) in
+$kg.m^{-1}.s^{-1}$ may be written in \CS:
+\begin{equation}
+\begin{array}{llll}
+\mu_{\text{total}}&=&\mu+\mu_{\text{sub-grid}} &
+ \text{\ \ if\ \ }\mu_{\text{sub-grid}}>0\\
+ &=&\mu &
+ \text{\ \ otherwise }\\
+\text{with\ }\mu_{\text{sub-grid}}&=&\rho C \overline{\Delta}^2 ||\overline{S}||
+\end{array}
+\end{equation}
+
+$\overline{\Delta}$ is the width of the implicit filter, defined at the
+cell $\Omega_i$ by \\
+$\overline{\Delta}=XLESFL(IPHAS)*(ALES(IPHAS)*|\Omega_i|)^{BLES(IPHAS)}$
+\index{XLESFL}\index{ALES}\index{BLES}.
+
+In the case of the Smagorinsky model (ITURB(IPHAS)=40), $C$ is a
+constant which is worth $C_s^2$. $C_s^2$ is the so-called Smagorinsky
+constant and is stored the variable $CSMAGO$\index{CSMAGO}.
+
+In the case of the dynamic model (ITURB(IPHAS)=41), $C$ is variable in
+time and in space. It is determined by
+$\displaystyle C=\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}$.
+
+In practice, in order to increase the stability, the code does not use the
+value of $C$ obtained in each cell, but an average with the values
+obtained in the neighboring cells (this average uses the extended
+neighborhood and corresponds to the explicit filter). By default, the
+value calculated by the code is
+\begin{displaymath}
+C=\frac{\widetilde{M_{ij}L{ij}}}{\widetilde{M_{kl}M_{kl}}}
+\end{displaymath}
+
+The subroutine \texttt{ussmag} allows to modify this value. It is for
+example possible to calculate the local average after having calculated the
+ratio
+\begin{displaymath}
+C=\widetilde{\left[\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}\right]}
+\end{displaymath}
+
+{\em WARNING: The subroutine {\em\texttt{ussmag}} can be activated only when
+the dynamic model is used.}
+
+%==================================
+\subsection{Temperature-enthalpy and enthalpy-temperature conversions: \textmd{\texttt{usthht}}}
+%==================================
+
+\noindent
+\textit{Subroutine optionally called.}
+
+This subroutine is used to encapsulate a simple enthalpy-temperature
+conversion law and its inverse.
+This subroutine is called in \texttt{usray4}, user subroutine from the
+radiation module.
+
+%==================================
+\subsection{Modification of the mesh geometry: \textmd{\texttt{usmodg}}}
+%==================================
+
+\noindent
+\textit{Subroutine called only during the calculation initialisation.}
+
+This subroutine may be used to modify ``manually'' the mesh vertices
+coordinates, \textit{i.e.} the array:
+\begin{list}{$\bullet$}{}
+\item \mbox{XYZNOD(3,NNOD)} (vertices coordinates)
+\end{list}
+
+{\em WARNING: Caution must be exercised when using this subroutine
+along with periodicity. Indeed, the periodicity parameters are not
+updated accordingly, meaning that the periodicity may be unadapted
+after one changes the mesh vertices coordinates. It is particularly
+true when one rescales the mesh.}\\
+
+%==================================
+\subsection{Management of the post-processing intermediary outputs: \textmd{\texttt{usnpst}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step(even if the user hasn't moved it to the SRC directroy).}
+
+This subroutine is used to determine when post-processing outputs will be
+generated. By default, it tests if the current time step number (NTCABS) is a
+multiple of the chosen output frequency (NTCHR). If it is the case, the
+indicator IIPOST turns to 1, which triggers the writing of an
+intermediary output. If the frequency is given a negative value, the
+test is not done.
+
+For instance, a user who wants to generate post-processing outputs (also
+called ``chronological outputs'') at
+the time step number 36 and around the physical time $t$=12 seconds may
+use the following test:\\
+\begin{tabular}{ll}
+\mbox{\texttt{~~~~~~~IIPOST = 0}}
+ & ~~~~~ No output by default. \\
+\mbox{\texttt{~~~~~~~IF (NTCABS.EQ.36) THEN}}
+ & ~~~~~ If the current time step is the 36$^{\text{th}}$,\\
+\mbox{\texttt{~~~~~~~~~~IIPOST=1}}
+ & ~~~~~ ~~~generate an output. \\
+\mbox{\texttt{~~~~~~~ENDIF}}
+ & ~~~~~ End of the test on the time step number. \\
+\mbox{\texttt{~~~~~~~IF (ABS(TTCABS-12.D0).LE.0.01D0) THEN}}
+ & ~~~~~ If the physical time is 12s +/- 0.01s,\\
+\mbox{\texttt{~~~~~~~~~~IIPOST=1}}
+ & ~~~~~ ~~~generate an output. \\
+\mbox{\texttt{~~~~~~~ENDIF}}
+ & ~~~~~ End of the test on the physical time. \\
+\end{tabular}
+
+In any case, a post-processing output is generated after the last time
+step, \texttt{usnpst} being used or not.
+
+\newpage
+%==================================
+\subsection{Definition of post-processing and mesh zones:
+ \textmd{\texttt{usdpst}}}
+%==================================
+
+\noindent
+\textit{Subroutine called at the calculation beginning..}
+
+This subroutine allows for the definition of surface or volume
+sections, in the form of lists of \texttt{nlfac} internal faces
+(\texttt{lstfac}) and \texttt{nlfab} boundary faces (\texttt{lstfab}),
+or of \texttt{nlcel} cells (\texttt{lstcel}), in order to generate
+chronological outputs in {\em EnSight}, {\em MED} or {\em CGNS} format.
+
+One or several ``writers'' can be associated with each visualization
+mesh, or ``part'' created. The arguments of the function \texttt{pstcwr}
+defining a ``writer'' are as follows:
+
+\begin{list}{$\bullet$}{}
+ \item \texttt{nomcas}: basic name of the associated case.\\ {\em
+ WARNING}: depending on the chosen format, this name may
+ be shortened (maximum number of characters: 32 for {\em MED},
+ 19 for {\em EnSight}) or modified automatically (whitespaces or
+ forbidden characters will be replaced by '\_')
+ \item \texttt{nomrep}: name of the output directory
+ \item \texttt{nomfmt}: choice of the output format:
+ \begin{list}{$\rightarrow$}{}
+ \item {\em EnSight Gold} ({\em EnSight} also accepted)
+ \item {\em MED\_fichier} ({\em MED} also accepted)
+ \item {\em CGNS}
+ \item {\em text} (readable with a text editor, mesh output,
+ no variables output, for diagnosis purposes only).
+ \end{list}
+The options are not case-sensitive, so {\em ensight} or {\em cgns} are valid, too.
+ \item \texttt{optfmt}: character string containing a list of
+ options related to the format, separated by commas; for the
+ {\em EnSight Gold} format, these options are:
+ \begin{list}{$\rightarrow$}{}
+ \item {\em binary} for a binary format version (by default)
+ \item {\em text} for a text format version
+ \item {\em discard\_polygons} to prevent from exporting faces with more
+ than four edges (which may not be recognized by some post-processing tools); such
+ faces will therefore not appear in the post-processing mesh.
+ \item {\em discard\_polyhedra} to prevent from exporting elements which
+ are neither tetrahedra, prisms, pyramids nor hexahedra (which may not be recognized by
+ some post-processing tools); such elements will therefore not appear in
+ the post-processing mesh.
+ \item {\em divide\_polygons} to divide faces with more than four edges
+ into triangles, so that any post-processing tool can recognize them
+ \item {\em divide\_polyhedra} to divide elements which are neither
+ tetrahedra, prisms, pyramids nor hexahedra into simpler elements (tetrahedra and
+ pyramids), so that any post-processing tool can recognize them
+ \item {\em split\_tensor} to export the components of a tensor
+ variable as a series of independent variables (a variable is recognised as a
+ tensor if its dimension is 6 or 9); not implemented yet.
+ \end{list}
+ \item \texttt{indmod}: indicates if the post-processing (i.e. visualization) meshes
+ (or ``parts'') are:
+ \begin{list}{$\rightarrow$}{}
+ \item 0 fixed (``classic'' case)
+ \item 1 deformable (the vertex positions may vary over time)
+ \item 2 modifiable: (the lists of cells or faces
+ defining these ``parts'' can be changed over time)
+ \end{list}
+ \item \texttt{ntchrl}: default output frequency associated with
+ this ``writer'' (the output may be forced or prevented at
+ every time step using the subroutine \texttt{usnpst})
+\end{list}
+
+In order to allow the user to add an output format to
+the main output format, or to add a mesh to the default
+output, the lists of standard and user meshes and ``writers'' are not
+separated. Negative numbers are reserved for the non-user items. For
+instance,the mesh numbers -1 and -2 correspond respectively to the global
+mesh and to boundary faces, generated by default, and the ``writer'' -1
+corresponds to the usual post-processing case defined {\em via}
+\texttt{usini1} or {\em via} the interface.
+
+The user chooses the numbers corresponding to the post-processing
+meshes and ``writers'' he wants to create. These numbers must be positive
+integers. It is possible to assocate a user mesh with the standard
+post-processing case (-1), or to ask for outputs concerning the boundary
+faces (-2) associated with a user ``writer''.
+
+For safety, the output frequency and the possibility to modify the
+post-processing meshes are associated with the ``writers'' rather than
+with with the ``parts''. This logic avoids unwanted generation of
+inconstitent post-processing outputs. For instance EnSight would not
+be able to read a case in which one field is output to a given part
+every 10 time steps while another field is output to the same part
+every 200 time steps.
+
+The possibility to modify a mesh over time is limited by the more restrictive
+``writer'' which is associated with it. For instance, if the ``writer''
+1 allows the modification of the mesh topology (argument \texttt{indmod
+= 2} in the call to \texttt{pstcwr}) and the ``writer'' 2 allows no
+modification (\texttt{indmod = 0}), a user post-processing mesh
+associated with the ``writers'' 1 and 2 will not be modifiable, but a
+mesh associated only with the ``writer'' 1 will be modifiable. The
+modification is done by means of the user subroutine \texttt{usmpst},
+which is called only for the currently modifiable meshes.
+
+It is possible to output variables which are normally automatically
+output on the main volume or boundary meshes to a user mesh which is a subset
+of one of these by assigning the corresponding category to the user
+mesh. By default, a meshe's category is identical to its number, so
+the category associated with the main volume output is -1, and that
+associated with the main boundary output is -2. A category may be assigned
+using the\texttt{pstcat} subroutine.
+
+It is also possible to define an alias of a post-processing mesh. An
+alias shares all the attributes of a ``part'' (without duplication),
+except its number. This may be used to output different variables on a
+same ``part'' with 2 different writers: the choice of output variables
+is based on the ``part'', so if $P_a$ is associated with writer $W_a$,
+all that is needed is to define an alias $P_b$ to $P_a$ and associate
+it with writer $W_b$ to allow a different output variable selection with
+each writer. An alias may be created using the \texttt{pstalm} subroutine.
+
+Modification of a part or it's alias over time is always limited by the
+most restrictive "writer" to which it's meshes have been asscoiated (parts of
+the structures being shared in memory). It is possible to define as many
+alias' as are required for a "part", but an alias cannot be defined for another alias.
+
+It is not possible to mix cells and faces in the same ``part'' (most of
+the post-processing tools being perturbed by such a case)\footnote{in thr
+future, it will probably be possible to automatically add faces bearing
+group or attribute characteristics to a cell mesh, but those faces will
+only be written for formats supporting this (such as MED 2.3),
+and will only bear attributes, not variable fields}. If the user
+defines lists of faces and cells simultaneously, only the higher dimension
+entities (the cells) will be taken into account.
+
+For a better understanding, the user may refer to the example given in
+{\texttt{usdpst}}. We can note that the whitespaces in the beginning or in
+the end of the character strings given as arguments of the functions
+called are suppressed automatically.
+
+The variables to post-process on the defined ``parts'' will be specified
+in the subroutine \texttt{usvpst}. ``
+
+{\em WARNING In the parallel case, some ``parts'' may not contain any
+local elements on a given processor. This is not a problem at all, as
+long as the ``part'' is defined for all processors (empty or not).
+It would in fact not be a good idea at all to define a ``part'' only
+if it contains local elements, global operations on the ``part'' would
+become impossible, leading to probable deadlocks or crashes.}
+
+%==================================
+\subsection{Modification of the mesh zones to post-process:
+ \textmd{\texttt{usmpst}}}
+%==================================
+
+\noindent
+\textit{Subroutine called only for each modifiable ``part'', at every
+active time step of an associated ``writer''.}
+
+For the user ``parts'' defined {\em via} the user subroutine
+\texttt{usdpst} and associated only with ``writers'' allowing the ``part''
+modification over time ({\em i.e.} created with the
+parameter \texttt{indmod} = 2), this subroutine is used to modify the
+lists of cells, internal and boundary faces defining this ``part'' (or
+post-processing mesh).
+
+At first, the corresponding lists contain the previously defined
+values. If these lists are modified for a given post-processing mesh, the
+argument \texttt{imodif} must be given the value 1.If this argument
+ maintains it's initial value of 0, the code will not consider this
+ "part" to have been modified away from that call and it will offer
+ to bring it upto date. It is in fact at the end of an optimisation
+ so there is no need to modify these "parts" within the definate and
+ modifiable assembly (if in doubt, let imodif=1).
+
+It can be noticed that the indicator \texttt{itypps} can be used to know
+whether the current post-processing mesh contains cells
+(\texttt{itypps(1)} = 1), internal faces (\texttt{itypps(2)} = 1), or
+boundary faces (\texttt{itypps(2)} = 1)globally (as the number of local cells
+ or faces of a processor could be 0, and that doesn't provide sufficient
+ information).
+ If at any time, a given part contains no element of any type, all the
+ values of itypes will be 0 and that number cannot be put in the part
+(\texttt {nummai}) to determine if it will affect the cells or
+faces\footnote{It is not expressly forbidden to associate cells with the
+``part'' at a certain timestep and faces at another, but this has not been tested}.
+
+The user may refer to the example, in which cells are selected according
+to a given criterion: \\
+- For a volumetric ``part'', cells for which the velocity exceeds a certain
+value. \\
+- For a surface ``part'', internal faces which are between a cell in
+which the velocity exceeds a certain value and a cell in which the
+velocity is lower than this value (and boundary faces neighboring a
+cell in which the velocity exceeds this value). This surface
+post-processing mesh corresponds therefore to an approximation of a
+velocity isosurface.
+
+%==================================
+\subsection{Definition of the variables to post-process:
+ \textmd{\texttt{usvpst}}}
+%==================================
+
+\noindent
+\textit{Subroutine called for each ``part'', at every active time step of an
+associated ``writer'' (see \texttt{usdpst}).}
+
+For the parts defined in \texttt{usdpst}, the subroutine \texttt{usvpst}
+is used to specify the variables to post-process.
+
+The output of a given variable is generated by means of a call to
+\texttt{psteva}, whose arguments are:
+
+\begin{list}{$\bullet$}{}
+ \item \texttt{nummai}: current ``part'' number (input
+ argument in \texttt{usvpst}).
+ \item \texttt{namevr}: name to give to the variable.
+ \item \texttt{idimt}: dimension of the variable (3 for a vector, 1 for
+ a scalar).
+ \item \texttt{ientla}: indicates if the stored arrays are
+ ``intertwined'' or not:
+ \begin{list}{$\rightarrow$}{}
+ \item 0: not intertwined, in the form ${\{x_1, x_2, ..., x_n,
+ y_1, y_2, ..., y_n, z_1, z_2, ..., z_n\}}$ \\
+ (case of all variables defined in \texttt{rtp}).
+ \item 1: intertwined, in the form ${\{x_1, y_1, z_1, x_2, y_2, z_2, ..., x_n, y_n, z_n\}}$ \\
+ (case of the geometric parameters, like
+ \texttt{xyzcen}, \texttt{surfbo}, ...).
+ \end{list}
+ For a scalar variable, this argument does not matter.
+ \item \texttt{ivarpr}: indicates if the variable is defined on the
+ ``parent'' mesh or locally:
+ \begin{list}{$\rightarrow$}{}
+ \item 0: variable generated by the user in the given work
+ arrays \texttt{tracel}, \texttt{trafac}, and
+ \texttt{trafbr} (whose size is respectively the
+ number of cells, internal faces and boundary faces
+ of the ``part'', $\times 3$). The arrays
+ \texttt{lstcel}, \texttt{lstfac}, and
+ \texttt{lstfbr} can be used to get the numbers
+ corresponding to the cells, internal faces and
+ boundary faces associated with the ``part'' and to
+ generate the appropriate post-processing variable.
+ \item 1: variable already defined in the main mesh
+ (``parent'' mesh of the ``parts''), for example the
+ variables in the rtp array. Instructions in the report which list\texttt
+{lstcel}, \texttt{lstfac}, and \texttt{lstfbr}will be treated directly by
+ the sub routine, avoiding unused copies and simplifying hte code
+ \end{list}
+ \item \texttt{ntcabs}: absolute current time step number. If a
+ negative value is given (usually -1), the variable will be
+ regarded as time-independent (and we will have to make sure this
+ call is only made once).
+ \item \texttt{ttcabs}: current physical time value. It is not taken
+ into account if \texttt{ntcabs} $< 0$.
+ \item \texttt{tracel}: array containing the values of the
+ variable at the cells. If \texttt{ivarpr} $= 1$, this
+ argument will be replaced by the position of the beginning
+ of the array on which the variable in defined, for instance
+ \texttt{rtp(1, iu(1))} for the velocity of the phase 1.
+ \item \texttt{trafac}: equivalent of \texttt{tracel} for the
+ internal faces.
+ \item \texttt{trafbr}: equivalent of \texttt{tracel} for the
+ boundary faces.
+\end{list}
+
+The user may refer to the example, which presents the different ways of
+generating an output of a variable.
+
+{\em WARNING: Apart from the time-independent variables, it is not
+recommended not to generate the same variables at every call
+(corresponding to an active time step) for a given mesh, because the
+post-processing tool may have difficulties to deal with such a case. To
+generate outputs of different variables on the same mesh with different
+frequancies, it is recommended to create an alias of this mesh and to
+associate it with a different ``writer'' in the subroutine \texttt{usdpst}.}
+
+%==================================
+\subsection{Modification of the variables at the end of a time step: \textmd{\texttt{usproj}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+This subroutine is called at the end of every time step. It is used to
+print of modify any variable at the end of every time step.
+
+Several examples are given:
+\begin{list}{-}{}
+\item Calculation of a thermal balance at the boundaries and in the
+ domain (including the mass source terms)
+
+\item Modification of the temperature in a given area starting from a
+ given time
+
+\item Extraction of a 1D profile
+
+\item Printing of a moment
+
+\item Utilisation of the tool
+ subroutines useful in the case of a parallel calculation
+ (calculation of a sum on the processors, of a maximum, ...)
+\end{list}
+
+{\em WARNING: As all the variables (solved variables, physical
+properties, geometric parameters) can be modified in this subroutine, a
+wrong use may distort totally the calculation.}
+
+The thermal balance example is particularly interesting.
+\begin{list}{-}{}
+\item It can be easily adapted to another scalar (only three simple
+ modifications to do, as indicated in the subroutine).
+\item It shows how to make a sum on all the subdomains in the framework
+ of a parallel calculation (see the calls to the subroutines
+ \texttt{PAR*}).
+\item It shows the precautions to take before doing some operations in
+ the framework of periodic or parallel calculations (in particular
+ when we want to calculate the gradient of a variable or to have
+ access to values at the cells neighboring a face).
+\item Finally it must not be forgotten that the solving with
+ temperature as a solved variable is questionable when the specific
+ heat is not constant.
+\end{list}
+
+%==================================
+\subsection{Radiative thermal transfers in semi-transparent gray media}
+%==================================
+
+%==================================
+\subsubsection{Initialisation of the radiation main key words: \textmd{\texttt{usray1}}}
+%==================================
+
+\noindent
+\textit{Subroutine called only during calculation initialisation.}
+
+This subroutine is one of the two which must be completed by the user for all
+calculations including radiative thermal transfers. This subroutine is
+composed of three headings. The first one is dedicated to the activation
+of the radiation module, only in the case of classic physics. \\
+{\em WARNING: when a calculation is run using a specific physics module,
+this first heading must not be completed. The radiation module is then
+activated or not according to the parameter file related to the considered
+specific physics.} \\
+
+\noindent
+In the second heading the basic parameters of the radiation module are indicated.\\
+Finally, the third heading deals with the selection of the
+post-processing graphic outputs. The variables to treat are splitted
+into two categories: the volumetric variables and those related to the
+boundary faces.\\
+
+\noindent
+For more details about the different parameters, the user may refer to the
+key word list (\S\ref{prg_motscles}).
+
+
+%==================================
+\subsubsection{Management of the radiation boundary conditions:
+ \textmd{\texttt{usray2}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+This is the second subroutine is necessary for every calculation
+including radiative thermal transfers. It is used to give all the
+necessary parameters concerning, in the one case, the wall temperature
+calculation, and in the other, the coupling between the termal
+scalar (temperature or enthalpy) and the radiation module at the
+calculation domain boundaries. It must be noted that the boundary conditions
+concerning the thermal scalar which may have been defined in the
+subroutine \texttt{usclim} will be modified by the radiation module
+according to the data given in \texttt{usray2} (cf. \S\ref{fvm_selector}).\\
+A zone number must be given to each boundary face \footnote{this must be less
+ than the maximum allowable by the code, \texttt{NOZRDM}. This is fixed at 2000
+ in \texttt{radiat.h} and cannot be modified.}and, specifically for
+the walls, a boundary condition type and an initialisation temperature
+(in Kelvin). The initialisation temperature is only used to make the
+solving implicit at the first time step. The zone number allows to assign
+an arbitrary integer to a set of boundary faces having the same
+radiation boundary condition type. This gathering is used by the
+calculation, and in the listing to print some physical values (mean
+temperature, net radiative flux ...). An independent graphic output in
+{\em EnSight} format is associated with each zone and allows the display on
+the boundary faces of the variables selected in the third heading of the
+subroutine \texttt{usray1}.\\
+A boundary condition type stored in the array ISOTHP is associated with
+each boundary face. There are five different types:
+
+\begin{list}{$\bullet$}{}
+
+\item \textbf{ITPIMP}: wall face with imposed temperature,
+
+\item \textbf{IPGRNO}: for a gray or black wall face, calculation of the
+ temperature by means of a flux balance,
+
+\item \textbf{IPREFL}: for a reflecting wall face, calculation of the
+ temperature by means of a flux balance,
+. This is fixed at 2000 in \texttt{radiat.h} and cannot be modified.
+
+\item \textbf{IFGRNO}: gray or black wall face to which a conduction
+ flux is imposed,
+
+\item \textbf{IFREFL}: reflecting wall face to which a conduction
+ flux is imposed, which is equivalent to impose this flux directly
+ to the fluid.
+
+\end{list}
+
+\noindent
+Depending on the selected boundary condition type at every wall face,
+the code needs to be given some supplementary pieces of information:
+
+\begin{list}{$\bullet$}{}
+
+\item \textbf{ITPIMP}: the array TINTP must be completed with the
+ imposed temperature value and the array EPSP must be completed
+ with the emissivity value (strictly positive).
+
+\item \textbf{IPGRNO}: must be given: an initialisation temperature in
+ the array TINTP, the wall emissivity (strictly positive, in EPSP),
+ thickness (in EPAP), thermal conductivity (in XLAMP) and an
+ external temperature (in TEXTP) in order to calculate a conduction
+ flux across the wall.
+
+\item \textbf{IPREFL}: must be given: an initialisation temperature (in
+ TINTP), the wall thickness (in EPAP) and thermal conductivity (in
+ XLAMP) and an external temperature (in TEXTP).
+
+\item \textbf{IFGRNO}: must be given: an initialisation temperature (in
+ TINTP), the wall emissivity (in EPSP) and the conduction flux (in
+ $W/m^2$ whatever the thermal scalar, enthalpy or temperature) in
+ the array RCODCL. The value of RCODCL is positive when the
+ conduction flux is directed from the inside of the fluid domain to the
+ outside (for instance, when the fluid heats the walls). If the
+ conduction flux is null, the wall is adiabatic.
+
+\item \textbf{IFREFL}: must be given: an initialisation temperature (in
+ TINTP) and the conduction flux (in $W/m^2$ whatever the thermal
+ scalar) in the array RCODCL. The value of RCODCL is positive when the
+ conduction flux is directed from the inside of the fluid domain to the
+ outside (for instance, when the fluid heats the walls). If the
+ conduction flux is null, the wall is adiabatic. The flux received
+ by RCODCL is directly imposed as boundary condition for the fluid.
+
+\end{list}
+
+\noindent
+{\em WARNING: it is obligatory to set a zone number to every boundary
+face, even those which are not wall faces. These zones will be used during the
+printing in the listing. It is recommended to gather together the
+boundary faces of the same type, in order to ease the reading of the
+listing.}\\
+
+%==================================
+\subsubsection{Absorption coefficient of the medium, boundary conditions
+ for the luminance and calcualtion of the net radiative flux:
+ \textmd{\texttt{usray3}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+This subroutine is composed of three parts. In the first one, the user
+must provide the absorption coefficient of the medium in the array CK,
+for each cell of the fluid mesh. By default, the absorption coefficient
+of the medium is 0, which corresponds to a transparent medium.\\
+
+{\em WARNING: when a specific physics is activated, it is forbidden to
+give a value to the absorption coefficient in this subroutine. In this
+case, it is calculated automatically, or given by the user {\em via} a
+thermo-chemical parameter file (dp\_C3P or dp\_C3PSJ for gas combustion,
+and dp\_FCP for pulverised coal combustion).}\\
+
+\noindent
+The two following parts of this subroutine concern a more advanced use
+of the radiation module. It is about imposing boundary conditions to the
+equation of radiative transfer and net radiative flux calculation, in
+coherence with the luminance at the boundary faces, when the user wants
+to give it a particular value. In most cases, the given examples do not
+need to be modified.
+
+%==================================
+\subsubsection{Encapsulation of the temperature-enthalpy conversion:
+ \textmd{\texttt{usray4}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+This subroutine is used to call the subroutine \texttt{usthht}. The user
+can implement his own conversion formulas into it. \\
+This subroutine is useless when the thermal scalar is the temperature.\\
+\noindent
+
+{\em WARNING: when a specific physics is activated, it is forbidden to use this
+subroutine. In this case, {\em \texttt{usray4}} is replaced by {\em
+\texttt{ppray4}}, which is not a user subroutine.}\\
+
+
+\noindent
+The value of the argument MODE allows to know in which direction the
+conversion will be made:
+\begin{list}{$\bullet$}{}
+
+\item \textbf{MODE = 1}: the fluid enthalpy in the cell must be
+ converted into temperature (in Kelvin),
+
+\item \textbf{MODE = -1}: the wall temperature (TEXT or TPAROI, in
+ Kelvin) must be converted into enthalpy.
+
+\end{list}
+%
+{\em WARNING: the value of MODE is passed as argument and must not be
+modified by the user.}\\
+
+
+
+%==================================
+\subsection{Utilisation of a specific physics: \textmd{\texttt{usppmo}}}
+%==================================
+\label{prg_usppmo}%
+\noindent
+\textit{Subroutine called only during calculation initialisation.}
+
+This is one of the three subroutines which must be obligatory completed
+by the user in order to use a specific physics module.
+At the moment, \CS allows to use two ``pulverised coal'' modules
+(lagrangian coupling or not), two ``gas combustion'' modules, two
+``electric'' modules and one ``compressible'' module. To activate one of
+these modules, the user needs to complete one (and only one) of the
+indicators IPPMOD(I.....)\index{IPPMOD} in the subroutine
+\texttt{usppmo}. By default, all the indicators IPPMOD(I.....) are
+initialised at -1, which means that no specific physics is activated.
+
+\begin{list}{$\bullet$}{}
+ \item Diffusion flame in the framework of ``3 points'' rapid complete
+ chemistry: indicator {\bf IPPMOD(ICOD3P\index{ICOD3P})}
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(ICOD3P) = 0 adiabatic conditions
+ \item IPPMOD(ICOD3P) = 1 permeatic conditions (enthalpy
+ transport)
+ \item IPPMOD(ICOD3P) =-1 module not activated
+ \end{list}
+ \item Eddy Break Up pre-mixed flame: indicator {\bf
+ IPPMOD(ICOEBU\index{ICOEBU})}
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(ICOEBU\index{ICOEBU}) = 0 adiabatic
+ conditions at constant richness
+ \item IPPMOD(ICOEBU) = 1 permeatic conditions at
+ constant richness
+ \item IPPMOD(ICOEBU) = 2 adiabatic conditions at
+ variable richness
+ \item IPPMOD(ICOEBU) = 3 permeatic conditions at
+ variable richness
+ \item IPPMOD(ICOEBU) =-1 module not activated
+ \end{list}
+ \item Libby-Williams pre-mixed flame: indicator {\bf IPPMOD(ICOLWC\index{ICOLWC})}
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(ICOLWC)=0 two peak model with adiabiatic conditions.
+ \item IPPMOD(ICOLWC)=1 two peak model with permeatic conditions.
+ \item IPPMOD(ICOLWC)=2 three peak model with adiabiatic conditions.
+ \item IPPMOD(ICOLWC)=3 three peak model with permeatic conditions.
+ \item IPPMOD(ICOLWC)=4 four peak model with adiabiatic conditions.
+ \item IPPMOD(ICOLWC)=5 four peak model with permeatic condintions.
+ \item IPPMOD(ICOLWC)=-1 module not activated.
+ \end{list}
+ \item Multi-coals and multi-classes pulverised coal combustion:
+ indicator {\bf IPPMOD(ICP3PL\index{ICP3PL})}
+ The number of different coals must be inferior or equal to
+ NCHARM\index{NCHARM} = 3. The number of particle size
+ classes NCLPCH\index{NCLPCH}(ICHA) for the coal ICHA, must
+ be inferior or equal to NCPCMX\index{NCPCMX} = 10.
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(ICP3PL) = 0 imbalance between the
+ temperature of the continuous and the solid phases
+ \item IPPMOD(ICP3PL) = 1 otherwise
+ \item IPPMOD(ICP3PL) =-1 module not activated
+ \end{list}
+ \item Lagrangian modeling of multi-coals and
+ multi-classes pulverised coal combustion:
+ indicator {\bf IPPMOD(ICPL3C\index{ICPL3C})}
+ The number of different coals must be inferior or equal to
+ NCHARM\index{NCHARM} = 3. The number of particle size
+ classes NCLPCH\index{NCLPCH}(ICHA) for the coal ICHA, must
+ be inferior or equal to NCPCMX\index{NCPCMX} = 10.
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(ICPL3C) = 1 coupling with the lagrangian
+ module, with transport of $H_2$
+ \item IPPMOD(ICPL3C) =-1 module not activated
+ \end{list}
+ \item Electric arc module (Joule effect and Laplace forces):
+ indicator {\bf IPPMOD(IELARC\index{IELARC})}
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(IELARC) = 1 determination of the magnetic field by
+ means of the Ampere's theorem (not available)
+ \item IPPMOD(IELARC) = 2 determination of the magnetic
+ field by means of the vector potential
+ \item IPPMOD(IELARC) =-1 module not activated
+ \end{list}
+ \item Joule effect module (Laplace forces not taken into account):
+ indicator {\bf IPPMOD(IELJOU\index{IELJOU})}
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(IELJOU) = 1 use of a real potential
+ \item IPPMOD(IELJOU) = 2 use of a complex potential
+ \item IPPMOD(IELJOU) = 3 use of real potential and specific boundary conditions for transformers.
+ \item IPPMOD(IELJOU) = 4 use of complex potential and specific boundary conditions for transformers.
+ \item IPPMOD(IELJOU) =-1 module not activated
+ \end{list}
+ \item Compressible module: indicator {\bf
+ IPPMOD(ICOMPF\index{ICOMPF})}
+ \begin{list}{$\rightarrow$}{}
+ \item IPPMOD(ICOMPF) = 0 module activated
+ \item IPPMOD(ICOMPF) =-1 module not activated
+ \end{list}
+
+\end{list}
+
+{\em WARNING: Only one specific physics module can be activated at the
+same time.}
+
+In the framework of the gas combustion modeling, the user may impose
+his own enthalpy-temperature tabulation (conversion law). He needs then
+to give the
+value zero to the indicator INDJON\index{INDJON} (the default value
+being 1). For more details, the user may refer to the following note
+(thermo-chemical files).
+
+\minititre{Note: the thermo-chemical files}
+The user must not forget to place in the directory DATA the
+thermo-chemical file \texttt{dp\_FCP}, \texttt{dp\_C3P}, \texttt{dp\_C3PSJ} or
+\texttt{dp\_ELE} (depending on the specific physics module he activated)
+and to specify the name of this file in the variable
+THERMOCHEMISTRY\_DATA\index{THERMOCHEMISTRY\_DATA} in the launch script
+(for instance: THERMOCHEMISTRY\_DATA''dp\_C3P''). Some example files
+are placed in the directory \texttt{DATA/THCH} at the creation of the
+study case. Their content is described below.
+
+\begin{list}{$\bullet$}{}
+ \item Example of file for the gas combustion:
+ \begin{list}{$\rightarrow$}{}
+ \item if the enthalpy-temperature conversion data base
+ JANAF is used: \texttt{dp\_C3P} (see
+ array\ref{tab_dpC3P}).
+
+\begin{table}[htbp]
+\begin{center}
+\small{
+\begin{tabular}{|c|c|c|c|} \hline
+ Lines &Examples of values & Variables & Observations \\ \hline
+ 1 & 5 & NGAZE\index{NGAZE} & Number of current species \\ \hline
+ 2 & 10 & NPO\index{NPO} & Number of points for the \\
+ & & & enthalpy-temperature tabulation \\ \hline
+ 3 & 300. & TMIN\index{TMIN} & Temperature inferior limit \\
+ & & & for the tabulation \\ \hline
+ 4 & 3000. & TMAX\index{TMAX} & Temperature superior limit \\
+ & & & for the tabulation \\ \hline
+ 5 & & & Empty line \\ \hline
+ 6 & CH4 O2 CO2 H2O N2 & NOMCOE\index{NOMCOE}(NGAZE) & List of the current species \\ \hline
+ 7 & 0 & IRAYPP\index{IRAYPP} & 0: no radiation \\
+ & & & 1: calculation of the absorption coefficient \\
+ & & & CKABS\index{CKABS} from the absorption \\
+ & & & coefficient KABSE of the current species \\
+ & & & 2: calculation using Modak \\
+ & & & 3: like 1 but P-1 model \\
+ & & & 4: like 2 but P-1 model \\ \hline
+ 8 &.35 .35 .35 .35 .35& KABSE\index{KABSE}(NGAZE) & Absorption coefficient \\
+ & & & of the current species \\ \hline
+ 9 & 4 & NATO\index{NATO} & Number of elemental species \\ \hline
+ 10 &.012 1 0 1 0 0& WMOLAT\index{WMOLAT}(NATO), & Molar mass of the elemental \\
+ 11 &.001 4 0 0 2 0& & species (first column) \\
+ 12 &.016 0 2 2 1 0&ATGAZE\index{ATGAZE}(NGAZE,NATO)& Composition of the current species \\
+ 13 &.014 0 0 0 0 2& & as a function of the elemental species \\
+ & & & (NGAZE following columns) \\ \hline
+ 14 & 3 & NGAZG\index{NGAZG} & Number of global species \\
+ & & & Here, NGAZG = 3 (Fuel, Oxidiser and Products) \\ \hline
+ 15 & 1. 0. 0. 0. 0. & & Composition of the global species as a \\
+ 16 & 0. 1. 0. 0. 3.76 &COMPOG\index{COMPOG}(NGAZE,NGAZG)& fonction of the current species of the line 6 \\
+ 17 & 0. 0. 1. 2. 7.52 & & In the order: Fuel (line 15), \\
+ & & & Oxidiser (line 16) and Product (line 17) \\ \hline
+ 18 & 1 & NRGAZ\index{NRGAZ} & Number of global reactions \\
+ & & & Here NRGAZ = 1 (always equal to 1 \\
+ & & & in this version) \\ \hline
+ 19 & & IGFUEL\index{IGFUEL}(NRGAZ), & Numbers of the global species concerned by \\
+ & 1 2 -1 -9.52 10.52& IGOXY\index{IGOXY}(NRGAZ), & the stoichiometric ratio \\
+ & & & (first 2 integers) \\
+ & &STOEG\index{STOEG}(NGAZG,NRGAZ)& Stoichiometry in reaction global species. \\
+ & & & Negative for the reactants (here \\
+ & & & ``Fuel'' and ``Oxidiser'') et positive for \\
+ & & & the products (here ``Products'') \\ \hline
+\end{tabular}
+}
+\caption{Example of file for the gas combustion when JANAF is used: \texttt{dp\_C3P}}\label{tab_dpC3P}
+\end{center}
+\end{table}
+
+ \item if the user provides his own enthalpy-temperature tabulation
+ (there must be three chemical species and only
+ one reaction): \texttt{dp\_C3PSJ} (see
+ array \ref{tab_dpC3PSJ}). This file replaces \texttt{dp\_C3P}.
+
+\begin{table}[htbp]
+\begin{center}
+\small{
+\begin{tabular}{|c|c|c|c|} \hline
+ Lines & Examples of values & Variables & Observations \\ \hline
+ 1 & 6 & NPO & Number of tabulation points \\ \hline
+ 2 & 50. -0.32E+07 -0.22E+06 -0.13E+08& & \\
+ 3 & 250. -0.68E+06 -0.44E+05 -0.13E+08&TH\index{TH}(NPO), & Temperature(first column), \\
+ 4 & 450. 0.21E+07 0.14E+06 -0.13E+08& EHGAZG\index{EHGAZG}(1,NPO),& mass enthalpy of fuel, oxidiser \\
+ 5 & 650. 0.50E+07 0.33E+06 -0.12E+08& EHGAZG(2,NPO), & and products (columns 2,3 and 4) \\
+ 6 & 850. 0.80E+07 0.54E+06 -0.12E+08& EHGAZG(3,NPO) & from line 2 to line NPO+1 \\
+ 7 &1050. 0.11E+08 0.76E+06 -0.11E+08& & \\ \hline
+ 8 & .00219 .1387 .159 &WMOLG(1)\index{WMOLG}, & Molar mass of fuel, \\
+ & & WMOLG(2),& oxidiser \\
+ & & WMOLG(3) & and products \\ \hline
+ 9 & .11111 & FS(1)\index{FS(1)} & Mixing rate at the stoichiometry \\
+ & & & (relating to Fuel and Oxidiser) \\ \hline
+ 10 & 0 & IRAYPP & 0: no radiation \\
+ & & & 1: calculation of the absorption coefficient\\
+ & & & CKABS\index{CKABS} from the absorption \\
+ & & & coefficient KABSG of the 3 global species \\
+ & & & (Fuel, Oxydise, Products) \\
+ & & & 2: calcul using Modak \\
+ & & & 3: like 1 but P-1 model \\
+ & & & 4: like 2 but P-1 model \\\hline
+ 11 & 0.4 0.5 0.87 &CKABSG\index{CKABSG}(1), & Absorption coefficient of fuel, \\
+ & & CKABSG(2), & oxidiser \\
+ & & CKABSG(3) & and products \\ \hline
+ 12 & 1. 2. & XCO2\index{XCO2}, XH2O\index{XH2O}& Molar coefficents of $CO_2$ \\
+ & & & and $H_2O$ in the products \\
+ & & & (radiation using Modak) \\ \hline
+\end{tabular}
+}
+\caption{Example of file for the gas combustion when the user provides
+ his own enthalpy-temperature tabulation
+ (there must be three species and only one
+ reaction): \texttt{dp\_C3PSJ} (this file replaces
+ \texttt{dp\_C3P})}\label{tab_dpC3PSJ}
+\end{center}
+\end{table}
+ \end{list}
+
+ \item Example of file for the pulverised coal combustion:
+ \texttt{dp\_FCP} (see array \ref{tab_dpFCP}).
+
+\begin{table}[htbp]
+\begin{center}
+\tiny{
+\begin{tabular}{|c|c|c|c|} \hline
+ Lines & Examples of values & Variables & Observations \\ \hline
+ 1 & THERMOCHIMIE & & Comment line \\ \hline
+ 2 & 8 & NCOEL\index{NCOEL} & Number of current species \\ \hline
+ 3 & 8 & NPO\index{NPO} & Number of points for the \\
+ & & & enthalpy-temperature tabulation \\ \hline
+ 4 & ESPECES COURANTES & & Comment line \\ \hline
+ 5 & CH4 C2H4 CO O2 CO2 H2O N2 C(S) & NOMCOEL\index{NOMCOEL}(NCOEL) & List of the \\
+ & & & current species \\ \hline
+ 6 & 300. & TMIN\index{TMIN} & Temperature inferior limit (Kelvin) \\
+ & & & for the enthalpy-temperature tabulation \\ \hline
+ 7 & 2400. & TMAX\index{TMAX} & Temperature superior limit (Kelvin) \\
+ & & & for the enthalpy-temperature tabulation \\ \hline
+ 8 & 4 & NATO\index{NATO} & Number of elemental species \\ \hline
+ 9 & .012 1 2 1 0 1 0 0 1 & & Molar mass of the elemental species \\
+ 10 & .001 4 4 0 0 0 2 0 0 &WMOLAT\index{WMOLAT}(NATO), & (first column) \\
+ 11 & .016 0 0 1 2 2 1 0 0 &ATCOEL\index{ATCOEL}(NCOEL,NATO)& and composition of the current species \\
+ 12 & .014 0 0 0 0 0 0 2 0 & & as a function of the elemental species \\ \hline
+ 13 & RAYONNEMENT & & Comment line \\ \hline
+ 14 & 1 & IRAYPP\index{IRAYPP} & 0: no radiation \\
+ & & & 1: constant, given below \\
+ & & & 2: using Modak \\
+ & & & 3: like 1 but P-1 model \\
+ & & & 4: like 2 but P-1 model \\ \hline
+ 15 & 0.1 & CKABS1\index{CKABS1} & Constant absorption coefficient \\
+ & & & for the gas mixture \\ \hline
+ 16 & CARACTERISTIQUES CHARBONS & & Comment line \\ \hline
+ 17 & 2 & NCHARB\index{NCHARB} & Number of coal types \\ \hline
+ 18 & 1 1 & NCLPCH\index{NCLPCH}(NCHARB) & Number of classes for each coal \\
+ & & & (each column corresponding to \\
+ & & & one coal type ) \\ \hline
+ 19 & 50.E-6 50.E-6 & DIAM20\index{DIAM20}(NCLACP) & Initial diameter of each class (m) \\
+ & & & NCLACP\index{NCLACP} is the total number of classes. \\
+ & & & All the diameters are written on the same line \\
+ & & & (sucessively for each coal, we give the \\
+ & & & diameter corresponding to each class) \\ \hline
+ 20 & 74.8 60.5 & CCH\index{CCH}(NCHARB)& Composition in C (mass.-\%, dry) of each coal \\ \hline
+ 21 & 5.1 4.14 & HCH\index{HCH}(NCHARB)& Composition in H (mass.-\%, dry) of each coal \\ \hline
+ 22 & 12.01 5.55 & OCH\index{OCH}(NCHARB)& Composition in O (mass.-\%, dry) of each coal \\ \hline
+ 23 & 0 31524000. 0 31524000. &IPCI\index{IPCI}(NCHARB), & Value of the PCI ($Jkg^{-1}$) for each coal, \\
+ & & PCICH\index{PCICH}(NCHARB) & the first integer indicating if this value refers \\
+ & & & to pure (0) or dry coal (1) \\ \hline
+ 24 & 1800. 1800. & CP2CH\index{CP2CH}(NCHARB)& Heat-storage capacity at constant pressure \\
+ & & & ($Jkg^{-1}K^{-1}$) for each coal \\ \hline
+ 25 & 1200. 1200. &RHO0CH\index{RHO0CH}(NCHARB) & Initial density ($kgm^{-3}$) of each \\ \hline
+ 26 & Coke & & Comment line \\ \hline
+ 27 & 0. 0. & CCK\index{CCK}(NCHARB) & Composition in C (mass.-\%, dry) of the coke \\
+ & & & for each coal \\ \hline
+ 28 & 0. 0. & HCK\index{HCK}(NCHARB) & Composition in H (mass.-\%, dry) of the coke \\
+ & & & for each coal \\ \hline
+ 29 & 0. 0. & OCK\index{OCK}(NCHARB) & Composition in O (mass.\%, dry) of the coke \\
+ & & & for each coal \\ \hline
+ 30 & 0. 0. & PCICK\index{PCICK}(NCHARB)& PCI of the dry coke ($Jkg^{-1}$) for each coal \\ \hline
+ 31 & Cendres & & Comment line \\ \hline
+ 32 & 6.3 6.3 & XASHCH\index{XASHCH}(NCHARB)& Ash mass fraction (mass.-\%, dry) in each coal \\ \hline
+ 33 & 0. 0. & H0ASHC\index{H0ASHC}(NCHARB) & Ash formation enthalpy ($Jkg^{-1}$) \\
+ & & & for each coal \\ \hline
+ 34 & 0. 0. &CPASHC\index{CPASHC}(NCHARB) & CP of the ashes ($Jkg^{-1}K^{-1}$) for each coal \\ \hline
+ 35 & D\'evolatilisation (Kobayashi) & & Comment line \\ \hline
+ 36 & 1 0.37 0 0.37 & IY1CH\index{IY1CH}(NCHARB), & For each coal, pairs (IY1CH, Y1CH). \\
+ & & Y1CH\index{Y1CH}(NCHARB) & The real Y1CH is the adimensional stoich. coefficient\\
+ & & & If the integer IY1CH is worth 1, \\
+ & & & the provided value of Y1CH is adopted and \\
+ & & & the composition of the light volatile matters \\
+ & & & is calculated automatically. \\
+ & & & If the integer IY1CH is worth 0, \\
+ & & & the provided value of Y1CH is ignored: \\
+ & & & Y1CH is calculated automatically (the light \\
+ & & & volatiles are then composed of {$CH_{4}$}, {$CO$}). \\ \hline
+ 37 & 1 0.74 1 0.74 & IY2CH\index{IY2CH}(NCHARB), & For each coal, pairs (IY2CH, Y2CH). \\
+ & & Y2CH\index{Y2CH}(NCHARB) & The real Y2CH is the adimensional stoich. coefficient\\
+ & & & If the integer IY2CH is worth 1, \\
+ & & & the provided value of Y2CH is adopted and \\
+ & & & the composition of the heavy volatile matters \\
+ & & & is calculated automatically. \\
+ & & & If the integer IY2CH is worth 0, \\
+ & & & the provided value of Y2CH is ignored: \\
+ & & & Y2CH is calculated automatically (the heavy \\
+ & & & volatiles are then composed of {$C_{2}H_{4}$}, {$CO$}).\\ \hline
+ 38 & 370000. 410000. & A1CH\index{A1CH}(NCHARB)& Devolatilisation pre-exponential factor A1 ($s^{-1}$)\\
+ & & & for each coal (light volatile matters) \\ \hline
+ 39 & 1.3E13 1.52E13 & A2CH\index{A2CH}(NCHARB)& Devolatilisation pre-exponential factor A2 ($s^{-1}$)\\
+ & & & for each coal (heavy volatile matters) \\ \hline
+ 40 & 74000. 80000. & E1CH\index{E1CH}(NCHARB)& Devolatilisation activation energy E1 ($Jmol^{-1}$) \\
+ & & & for each coal (light volatile matters) \\ \hline
+ 41 & 250000. 310000. & E2CH\index{E2CH}(NCHARB)& Energie d'activation E2 ($Jmol^{-1}$) de d\'evolatilisation\\
+ & & & for each coal (heavy volatile matters) \\ \hline
+ 42 & Combustion h\'et\'erog\`ene & & Ligne de commentaire \\ \hline
+ 43 & 17.88 17.88 &AHETCH\index{AHETCH}(NCHARB) & Char burnout pre-exponential constant \\
+ & & & ($kgm^{-2}s^{-1}atm^{-1}$) for each coal \\ \hline
+ 44 & 16.55 16.55 &EHETCH\index{EHETCH}(NCHARB) & Char burnout activation energy ($kcalmol{-1}$) \\
+ & & & for each coal \\ \hline
+ 45 & 1 1 &IOCHET\index{IOCHET}(NCHARB) & Char burnout reaction order for each coal \\
+ & & & 0.5 if IOCHET = 0 and 1 if IOCHET = 1 \\ \hline
+\end{tabular}
+}
+\caption{Example of file for the pulverised coal combustion:
+ \texttt{dp\_FCP}}\label{tab_dpFCP}
+\end{center}
+\end{table}
+
+
+ \item Example of file for the electric arc: \texttt{dp\_ELE} (see
+ array \ref{tab_dpELE}).
+
+\begin{table}[htbp]
+\begin{center}
+\small{
+\begin{tabular}{|c|l|c|c|} \hline
+ Li nes & Examples of values & Variables & Observations \\ \hline
+ 1 &\# Fichier ASCII format libre ... & & Free comment \\ \hline
+ 2 &\# Les lignes de commentaires ... & & Free comment \\ \hline
+ 3 &\# ... & & Free comment \\ \hline
+ 4 &\# Proprietes de l'Argon ... & & Free comment \\ \hline
+ 5 &\# ... & & Free comment \\ \hline
+ 6 &\# Nb d'especes NGAZG et Nb ... & & Free comment \\ \hline
+ 7 &\# NGAZG NPO ... & & Free comment \\ \hline
+ 8 & 1 238 & NGAZG\index{NGAZG} & Number of species \\
+ & & NPO\index{NPO} & Number of given temperature points for \\
+ & & & the tabulated physical properties \\
+ & & & (NPO $\leqslant$ NPOT set in ppthch.h) \\
+ & & & So there will be NGAZG blocks of NPO lines each \\ \hline
+ 9 &\# ... & & Free comment \\ \hline
+ 10 &\# Proprietes ... & & Free comment \\ \hline
+ 11 &\# ~~~~T~~~~~~~~~~~H ... & & Free comment \\ \hline
+ 12 &\# Temperature Enthalpie ... & & Free comment \\ \hline
+ 13 &\# ... & & Free comment \\ \hline
+ 14 &\# ~~~~~K~~~~~~~~~J/kg ... & & Free comment \\ \hline
+ 15 &\# ... & & Free comment \\ \hline
+ 16 & ~~~300.~~~~~~14000. ... & & Tabulation in line of the physical properties \\
+ & & & as a function of the temperature in Kelvin \\
+ & & & for each of the NGAZG species \\
+ & & H & Enthalpy in J/kg \\
+ & & ROEL & Density in kg/m3 \\
+ & & CPEL & Specific heat in J/(kg K) \\
+ & & SIGEL & Electric conductivity in Ohm/m \\
+ & & VISEL & Dynamic viscosity in kg/(m s) \\
+ & & XLABEL & Thermal conductivity in W/(m K) \\
+ & & XKABEL\index{XKABEL} & Absorption coefficient (radiation) \\ \hline
+\end{tabular}
+}
+\caption{Example of file for the electric arc module:
+ \texttt{dp\_ELE}}\label{tab_dpELE}
+\end{center}
+\end{table}
+
+\end{list}
+
+\clearpage
+%==================================
+\subsection{Management of the boundary conditions related to pulverised
+ coal and gas combustion: \textmd{\texttt{usebuc, usd3pc, uslwcc,
+ uscpcl et uscplc}} }
+%==================================
+
+\noindent
+\textit{Subroutines called every time step.}
+
+In this paragraph, ``specific physics'' refers to gas combustion or
+to pulverised coal combustion.
+
+As are \texttt{usini1} and \texttt{usppmo}, the use of \texttt{usebuc},
+\texttt {usd3pc}, \texttt{uslwcc}, \texttt{uscpcl} or \texttt{uscplc} is
+obligatory to run a calculation concerning a specific physics
+modeling. The way of using them is the same as the way of using
+\texttt{usclim} in the framework of standard calculations, that is to
+say several loops on the boundary faces lists (cf. \S\ref{fvm_selector})
+marked out by their colors, groups, or geometrical criterion, where
+the type of face, the type of boundary condition for each variable and
+eventually the value of each variable are defined.
+
+{\em WARNING: In the case of a specific physics modeling, all the
+boundary conditions for every variable must be defined here, even for
+the eventual user scalars: {\em \texttt{usclim}} is not used at all.}\\
+
+In the case of a specific physics modeling, a zone number IZONE
+\footnote{IZONE must be less than the maximum number of boundary
+zone allowable by the code, NOZPPM. This is fixed at 2000 in
+ \texttt{pppvar.h};not to be modified} (for
+instance the color ICOUL) is associated with every boundary face, in
+order to gather together all the boundary faces of the same type. In
+comparison to \texttt{usclim}, the main change from the user point of
+view concerns the faces whose boundary conditions belong to the type
+ITYPFB=IENTRE\index{IENTRE}:
+
+\begin{list}{$\bullet$}{}
+ \item for the EBU pre-mixed flame module:
+ \begin{list}{$\rightarrow$}{}
+ \item the user can choose between the ``burned gas
+ inlet'' type (marked out by the burned gas indicator
+ IENTGB\index{IENTGB}(IZONE\index{IZONE})=1) and the
+ ``fresh gas inlet'' type (marked out by
+ the fresh gas indicator
+ IENTGF\index{IENTGF}(IZONE)=1)
+ \item for each inlet type (fresh or burned
+ gas), a mass flow or a velocity must be imposed:
+
+ \begin{list}{-}{}
+ \item to impose the mass flow,
+ \begin{list}{-}{}
+ \item the user gives to
+ the indicator
+ IQIMP\index{IQIMP}(IZONE)
+ the value 1,
+ \item the
+ mass flow value is set in
+ QIMP\index{QIMP}(IZONE)
+ (positive value, in $kgs^{-1}$)
+ \item finally he imposes the
+ velocity vector direction
+ by giving the components of
+ a direction vector in
+ RCODCL\index{RCODCL}(IFAC,IU\index{IU}(IPHAS)), RCODCL(IFAC,IV\index{IV}(IPHAS)) and RCODCL(IFAC,IW\index{IW}(IPHAS))
+ \end{list}
+
+{\em WARNING:
+\begin{list}{-}{}
+\item the variable QIMP(IZONE) refers to the mass flow across the whole
+ zone IZONE and not across a boundary face (specifically for the axisymetric calculations, the inlet suface of the mesh must be broken up)
+\item the variable QIMP(izone) deals with the inflow across the area IZOZ and only across this zone;it is recomended to pay attention to the boundary conditions.
+\item the velocity direction vector is neither necessarily normed, nor
+ necessarily incoming.
+\end{list}}
+
+ \item to impose a velocity, the user
+ must give to the indicator
+ IQIMP(IZONE) the value 0 and set
+ the three velocity components (in
+ $m.s^{-1}$) in
+ RCODCL(IFAC,IU(IPHAS)),
+ RCODCL(IFAC,IV(IPHAS)) and
+ RCODCL(IFAC,IW(IPHAS))
+ \end{list}
+ \item finally he specifies for each gas inlet type
+ the mixing rate FMENT\index{FMENT}(IZONE) and
+ the temperature TKENT\index{TKENT}(IZONE) in Kelvin
+ \end{list}
+
+ \item for the ``3 points'' diffusion flame module:
+ \begin{list}{$\rightarrow$}{}
+ \item the user can choose between the ``oxydiser
+ inlet'' type marked out by
+ IENTOX\index{IENTOX}(IZONE)=1 and the ``fuel
+ inlet'' type marked out by
+ IENTFU\index{IENTFU}(IZONE)=1
+ \item concerning the input mass flow or the input
+ velocity, the method is the same as for the
+ EBU pre-mixed flame module
+ \item finally, the user sets the temperatures
+ TINOXY\index{TINOXY} for each oxydiser inlet
+ and TINFUE\index{TINFUE}, for each fuel inlet
+
+{\em Note: In the standard version, only the cases with only one
+ oxydising inlet type and one fuel inlet type
+ can be treated. In particular, there must be
+ only one input temperature for the oxidiser
+ (TINOXY) and one input temperature for the
+ fuel (TINFUEL).}
+ \end{list}
+
+ \item for the pulverised coal module:
+ \begin{list}{$\rightarrow$}{}
+ \item the inlet faces can belong to the ``primary
+ air and pulverised coal inlet'' type, marked
+ out by IENTCP\index{IENTCP}(IZONE)=1, or to
+ the ``secondary or tertiary air inlet'' type,
+ marked out by IENTAT\index{IENTAT}(IZONE)=1
+ \item in a way which is similar to the process
+ described in the framework of the EBU module,
+ the user chooses for every inlet face to
+ impose the mass flow or not (IQIMP(IZONE)=1 or
+ 0). If the mass flow is imposed, the user
+ must set the air mass flow value
+ QIMPAT\index{QIMPAT}(IZONE), its direction in
+ RCODCL(IFAC,IU(IPHAS)), RCODCL(IFAC,IV(IPHAS))
+ and \\ RCODCL(IFAC,IW(IPHAS)) and the incoming
+ air temperature TIMPAT\index{TIMPAT}(IZONE) in
+ Kelvin. If the velocity is imposed, he has to
+ set RCODCL(IFAC,IU(IPHAS)), \\
+ RCODCL(IFAC,IV(IPHAS)) and RCODCL(IFAC,IW(IPHAS)).
+
+ \item if the inlet belongs to the ``primary air and
+ pluverised coal'' type (IENTCP(IZONE) = 1) the
+ user must also define for each coal type ICHA:
+ the mass flow
+ QIMPCP\index{QIMPCP}(IZONE,ICHA), the
+ granulometric distribution
+ DISTCH\index{DISTCH}(IZONE,ICHA,ICLAPC)
+ related to each class ICLACP, and the
+ injection temperature
+ TIMPCP\index{TIMPCP}(IZONE,ICHA)
+
+ \end{list}
+\end{list}
+
+%==================================
+\subsection{Initialisation of the variables related to pulverised
+ coal and gas combustion: \textmd{\texttt{usebui, usd3pi, uslwci and uscpiv}}}
+%==================================
+
+\noindent
+\textit{Subroutines called only during the calculation initialisation.}
+
+In this paragraph, ``specific physics'' refers to gas combustion or
+to pulverised coal combustion.
+
+These subroutines allow the user to initialise some variables specific
+to the specific physics activated {\em via} \texttt{usppmo}. As usual,
+the user may have access to several geometric variables to discriminate
+between different initialisation zones if needed.
+
+{\em WARNING: in the case of a specific physics modeling, all the
+variables will be initialised here, even the eventual user scalars: {\em
+\texttt{usiniv}} is no longer used.}
+
+
+\begin{list}{$\bullet$}{}
+ \item in the case of the EBU pre-mixed flame module, the user can
+ initialise in every cell IEL: the mixing rate
+ RTP\index{RTP}(IEL,ISCA(IFM)) in variable richness, the
+ fresh gas mass fraction \\
+ RTP(IEL,ISCA(IYGFM\index{IYGFM}))
+ and the mixture enthalpy RTP(IEL,ISCA(IHM\index{IHM})) in
+ permeatic conditions
+
+ \item in the case of the rapid complete chemistry diffusion flame
+ module, the user can initialise in every cell IEL: the
+ mixing rate RTP(IEL,ISCA(IFM\index{IFM})), its variance
+ RTP(IEL,ISCA(IFP2M\index{IFP2M})) and the mixture mass
+ enthalpy RTP(IEL,ISCA(IHM)) in permeatic conditions
+
+ \item in the case of the pulverised coal combustion module, the
+ user can initialise in every cell IEL:
+ \begin{list}{$\rightarrow$}{}
+ \item the transport variables related to the solid phase
+ \begin{list}{}{}
+ \item RTP(IEL,ISCA(IXCH\index{IXCH}(ICLA))) the reactive coal mass fraction related to the class ICLA (ICLA from 1 to NCLACP which is the total number of classes, {\em i.e.} for all the coal type)
+ \item RTP(IEL,ISCA(IXCK(\index{IXCK}ICLA))) the coke mass fraction related to the class ICLA
+ \item RTP(IEL,ISCA(INP\index{INP}(ICLA))) the number of particles related to class ICLA per kg of air-coal mixture
+ \item RTP(IEL,ISCA(IH2\index{IH2}(ICLA))) the mass enthalpy related to the class ICLA in permeatic conditions
+ \end{list}
+ \item RTP(IEL,ISCA(IHM)) the mixture enthalpy
+ \item the transport variables related to the gas phase
+ \begin{list}{}{}
+ \item
+ RTP(IEL,ISCA(IF1M\index{IF1M}(ICHA))) the mean value of the tracer 1 representing the light volatile matters released by the coal ICHA
+ \item
+ RTP(IEL,ISCA(IF2M\index{IF2M}(ICHA))) the mean value of the tracer 2 representing the heavy volatile matters released by the coal ICHA
+ \item RTP(IEL,ISCA(IF3M\index{IF3M}))
+ the mean value of the tracer 3
+ representing the carbon released
+ as CO during coke burnout
+ \item RTP(IEL,ISCA(IF4P2M\index{IF4P2M})) the variance associated with the tracer 4 representing the air (the mean value of this tracer is not transported, it can be deduced directly from the three others)
+ \item RTP(IEL,ISCA(IFP3M\index{IFP3M})) the variance associated with the tracer 3
+ \end{list}
+ \end{list}
+\end{list}
+
+
+%==================================
+\subsection{Initialisation of the options of the variables related to
+ pulverised coal and gas combustion: \textmd{\texttt{usebu1, usd3p1,
+ uslwc1, uscpi1 and uscpl1}}}
+%==================================
+
+\noindent
+\textit{Subroutines called at calculation beginning.}
+
+In this paragraph, ``specific physics'' refers to gas combustion or
+pulverised coal combustion.
+
+These 3 subroutines are used to complete \texttt{usini1} for the
+considered specific physics.
+They allow to:
+\begin{list}{$\bullet$}{}
+\item generate, for the variables which are specific to the activated
+ specific physics module, chronological outputs (indicators
+ ICHRVR\index{ICHRVR}(IPP)), follow-ups in the listings
+ (indicator ILISVR\index{ILISVR}(IPP)) and to activate
+ chronological records at the probes defined in
+ \texttt{usini1} (indicators IHISVR(IPP)).\\
+The way of doing it is the same as in \texttt{usini1} and the writing
+ frequencies of these ouputs are set by \texttt{usini1}. The values
+ of the indicators IPP are
+ IPP=IPPPRO\index{IPPPRO}(IPPROC\index{IPPROC}(IVAR)), with IVAR
+ the number of the specific physics variable.
+Concerning the main variables (velocity, pressure, etc ...) the user
+ must still complete \texttt{usini1} if he wants to get
+ chronological records, printings in the listing or chronological
+ outputs.
+The variables which can be activated by the user for each specific
+ physics are listed below. The calculation variables IVAR (defined
+ at the cell IEL by RTP(IEL,IVAR)) and the properties IPROP (defined
+ at the cell IEL by PROPCE(IEL,IPPROC(IPROP))) are listed now:
+ \begin{list}{$\rightarrow$}{}
+ \item EBU pre-mixed flame modeling:
+ \begin{list}{-}{}
+ \item Calculation variables RTP(IEL,IVAR)
+ \begin{list}{IVAR = }{}
+ \item ISCA(IYGFM\index{IYGFM}) fresh gas mass fraction
+ \item ISCA(IFM\index{IFM}) mixing rate
+ \item ISCA(IHM\index{IHM}) enthalpy, if transported
+ \end{list}
+ \item Properties PROPCE(IEL,IPPROC(IPROP))
+ \begin{list}{IPROP = }{}
+ \item ITEMP\index{ITEMP} temperature
+ \item IYM(1)\index{IYM(1)} fuel mass fraction
+ \item IYM(2)\index{IYM(2)} oxidiser mass fraction
+ \item IYM(3)\index{IYM(3)} product mass fraction
+ \item ICKABS\index{ICKABS} absorption
+ coefficient, when the radiation modeling is
+ activated
+ \item IT3M\index{IT3M} and IT4M\index{IT4M}
+ ``$T^3$'' and ``$T^4$'' terms, when the radiation
+ modeling is activated
+ \end{list}
+ \end{list}
+ \item rapid complete chemistry diffusion flame modeling:
+ \begin{list}{}{}
+ \item everything is identical to the ``EBU'' case, except from
+ the fresh gas mass fraction which is replaced by the
+ variance of the mixing rate IVAR=ISCA(IFP2M\index{IFP2M})
+ \end{list}
+ \item pulverised coal modeling with 3 comustables:
+ \begin{list}{}{}
+ \item {\em variables shared by the two phases}:
+ \begin{list}{-}{}
+ \item Calculation variables RTP(IEL,IVAR)
+ \begin{list}{IVAR = }{}
+ \item ISCA(IHM\index{IHM}): gas-coal mixture enthalpy
+ \item ISCA(IMMEL\index{IMMEL}): molar mass of the
+ gas mixture
+ \end{list}
+ \end{list}
+ \item {\em variables specific to the dispersed phase}:
+ \begin{list}{-}{}
+ \item Calculation variables RTP(IEL,IVAR)
+ \begin{list}{IVAR = }{}
+ \item ISCA(IXCK\index{IXCK}(ICLA)): coke mass
+ fraction related to the class ICLA
+ \item ISCA(IXCH\index{IXCH}(ICLA)): reactive coal
+ mass fraction related to the class ICLA
+ \item ISCA(INP\index{INP}(ICLA)): number of
+ particles of the class ICLA per kg of
+ air-coal mixture
+ \item ISCA(IH2\index{IH2}(ICLA)): mass enthalpy of
+ the coal of class ICLA, if we are in
+ permeatic conditions
+ \end{list}
+ \item Properties PROPCE(IEL,IPPROC(IPROP))
+ \begin{list}{IPROP = }{}
+ \item IMMEL\index{IMMEL}: molar mass of the gas mixture
+ \item ITEMP2\index{ITEMP2}(ICLA): temperature of
+ the particles of the class ICLA
+ \item IROM2\index{IROM2}(ICLA): density of
+ the particles of the class ICLA
+ \item IDIAM2\index{IDIAM2}(ICLA): diameter of the
+ particles of the class ICLA
+ \item IGMDCH\index{IGMDCH}(ICLA): disappearance
+ rate of the reactive coal of the class ICLA
+ \item IGMDV1\index{IGMDV1}(ICLA): mass transfer
+ caused by the release of light volatiles
+ from the class ICLA
+ \item IGMDV2\index{IGMDV2}(ICLA): mass transfer
+ caused by the release of heavy volatiles
+ from the class ICLA
+ \item IGMHET\index{IGMHET}(ICLA): coke
+ disappearance rate during the coke burnout
+ of the class ICLA
+ \item IX2\index{IX2}(ICLA): solid mass fraction
+ of the class ICLA
+ \end{list}
+ \end{list}
+ \item {\em variables specific to the continuous phase}:
+ \begin{list}{-}{}
+ \item Calculation variables RTP(IEL,IVAR)
+ \begin{list}{IVAR = }{}
+ \item ISCA(IF1M\index{IF1M}(ICHA)): mean value of
+ the tracer 1 representing the light
+ volatiles released by the coal ICHA
+ \item ISCA(IF2M\index{IF2M}(ICHA)): mean value of
+ the tracer 2 representing the heavy
+ volatiles released by the coal ICHA
+ \item ISCA(IF3M)\index{IF3M}: mean value of the
+ tracer 3 representing the carbon released as
+ CO during coke burnout
+ \item ISCA(IF4PM\index{IF4PM}): variance of the
+ tracer 4 representing the air
+ \item ISCA(IF3P2M\index{IF3P2M}): variance of the
+ tracer 3
+ \end{list}
+ \item Properties PROPCE(IEL,IPPROC(IPROP))
+ \begin{list}{IPROP = }{}
+ \item ITEMP1\index{ITEMP1}: temperature of the gas
+ mixture
+ \item IYM1(1)\index{IYM1(1)}: mass fraction of
+ $CH_{X1m}$ (light volatiles) in the gas
+ mixture
+ \item IYM1(2)\index{IYM1(2)}: mass fraction of
+ $CH_{X2m}$ (heavy volatiles) in the gas
+ mixture
+ \item IYM1(3)\index{IYM1(3)}: mass fraction of
+ CO in the gas mixture
+ \item IYM1(4)\index{IYM1(4)}: mass fraction of
+ $O_2$ in the gas mixture
+ \item IYM1(5)\index{IYM1(5)}: mass fraction of
+ $CO_2$ in the gas mixture
+ \item IYM1(6)\index{IYM1(6)}: mass fraction of
+ $H_2O$ in the gas mixture
+ \item IYM1(7)\index{IYM1(7)}: mass fraction of
+ $N_2$ in the gas mixture
+ \end{list}
+ \end{list}
+ \end{list}
+ \end{list}
+
+ \item set the relaxation coefficient of the density SRROM, with \\
+$\rho^{n+1}=SRROM*\rho^{n}+(1-SRROM)\rho^{n+1}$\\
+(by default, the adopted value is SRROM\index{SRROM} = 0.8. At the
+ beginning of a calculation, a sub-relaxation of 0.95 may reduce
+ the numerical ``schocks'').
+
+ \item set the dynamic viscosity DIFTL0. By default
+ DIFTL0\index{DIFTL0}= 4.25 $kgm^{-1}s^{-1}$
+(the dynamic diffusivity being the ratio between the thermal
+ conductivity $\lambda$ and the mixture specific heat $C_p$ in the
+ equation of enthalpy).
+
+ \item set the value of the constant CEBU\index{CEBU} of the Eddy Break
+ Up model (only in \texttt{usebu1}. By default CEBU=2.5)
+
+\end{list}
+
+
+
+%==================================
+\subsection{Management of Boundary Conditions of the electric arc: \texttt{uselcl}}
+%==================================
+
+
+\noindent
+\textit {sub routine called at each time step.}
+
+As in the \texttt{usini1} and \texttt{usppmo}, the use of \texttt{usecl}
+is required to run an electric calculation. The main use is the same as
+occurs in \texttt{usclim} for the standard \CS calculations, for which
+different loops on the boundary faces is defined. Each faces list is
+built with the use of selection criteria (cf. \S\ref{fvm_selector}),
+and is referenced by their group(s), their color(s) or geometrical
+criterions. The face type, the boundary conditions for each variable,
+and finally the value of each variable or imposed flow are fixed.
+
+{\em WARNING:for the electric module, , the boundary conditions of all
+ the variables are defined here,
+even those of the eventual user scalars: {\em \texttt{usclim}} is not
+used at all.}
+
+For the electric module, each boundary face is associated with a number
+ \texttt{IZONE} \footnote{\texttt{IZONE} must be less than the maximum
+ value allowed by the code, NOZZPPM. This is fixed at 2000 in \texttt
+{ppvar.h} and cannot be modified.}(the color ICOUL for example) in order
+ to group together all the boundary faces of the same type. In the report
+ \texttt{usclim}, the main change from the users point of view concerns the
+ specification of the boundary conditions of the potential, which isn't
+ implied by default. The Dirichlet and Neuman conditions must be imposed
+ explicitly using ICODCL and RCODCL (as would be done for the classic scalar).
+
+Whats more, if one wishes to slow down the power dissipation(Joule module
+effect) or the current (electric arc module) from the imposed values(PUISMP\index{PUISMP}
+ and COUIMP\index{COUIMP} respectively), they can be changed by the potential scalar as
+ shown below~:
+
+\begin{list}{-}{}
+\item For the electric arc, the imposed potential difference can be a fixed variable:
+ for example, the cathode can be fixed at 0 and the potential at the anode
+ contains the variable DPOT. This variable is initialised in \texttt{useli1}
+ by an estimated potential difference. If IELCOR=1(see \texttt{useli1}),
+DPOT is updated automatically during the calculation to obtain the required
+current.
+\item For the Joule module effect, DPOT is again used with the same significane
+ as it held in the electric arc module. If DPOT is not wanted in the setting of the
+ boundary condtions, the variable COEJOU can be used. COEJOU is the coefficient
+ by which the potential difference is multiplied to obtain the desired power dissipation
+. By default this begins at 1 and is updated automatically. If IELCOR-1 (see \texttt
+{useli1}), multiply the imposed potentials in \texttt{uselcl} by COEJOU at each time
+ step to achieive the desired power dissipation.
+ \end{list}
+
+ {\em WARNING: In alternative current, attention should be paid to the values of potential
+ imposed at the limits: the variable named "real potential" represents an affective
+ value if the current is in single phase, and a "real part" if not.}
+\begin{list}{-}{}
+\item For the Joule studies, a complex potential is someitmes needed (IPPMOD(IELJOU)=2
+): this is the case in particular where the current is in 3 phase. In affect, to have
+ access to the phase of the potential, and not just its amplitude, the 2 variables must be deleted
+: in \CS, there are 2 arrays specified for this role, the real part and the imaginary
+ part of the potential. For use in the code, these variables are named 'real potential'
+ and 'imaginary potential'. For an alternative sinusoidal potential $Pp$, the maximum
+ value is noted as $Pp_\text{max}$, the phase is noted as $\phi$, the real potential
+ and the imaginary potential are respecively $Pp_\text{max}\,cos\phi$ and
+$Pp_\text{max}\,sin\phi$.
+\item For the Joule studies in which one does not have access to the phases, the real
+ potential (imaginary part =0) will suffice (IPPMOD(IELJOU)=1): this is obviously the case with
+ continous current, but also with single phase alternative current. In \CS
+there is only 1 varialbe for the potential, called "real potential". Pay attention to
+ the fact that in alternate current, the "real potential" represents a effective value
+ of potential , $\frac{1}{\sqrt{2}}\,Pp_\text{max}$ (in continous current there is no
+ such ambiguity).
+\end{list}
+
+
+%==================================
+\subsection{Initialisation of the variables in the electric module}
+%==================================
+
+\noindent
+\textit{subroutine called only at the initialisation of the calculation}
+
+This subroutine allows the user to initialise some of the specific physics variables
+ prompted via \texttt{usppmo}
+. The user has access, as usual, to many geometric variables so that the zones can
+ be differentiated if needed.
+
+{\em WARNING: For the specific physics, it is here that all varialbes are initialsed:
+ \texttt{usiniv} is not used}
+
+This subroutine works like \texttt{usiniv}. The values of potential and its
+constiuents are initialised if required.
+
+It should be noted that the enthalpy is important.
+
+\begin{list}{-}{}
+\item For the electric arc module, the enthalpy value is taken from the temperature
+ of reference T0(IPHAS)(given is \texttt{usini1}) from the temperature-enthalpy tables
+ supplied in the data file \texttt{dp\_ELE.} The user must not intervene here.
+\item For the Joule effect module, the value of enthalpy must be specified by the user
+. An example is given of how to obtain the enthalpy from the temperature of reference
+ T0 (IPHAS)(given in \texttt{usini1}), the the temperature-enthalpy low must be
+supplied. A code is suggested in the sub routine \texttt{usthht}(which is there for
+ the determination of physical properties).
+\end{list}
+%====================================
+\subsection { Initialisation of the variable options in the electric module}
+%==================================
+\label{prg_useli1}%
+\noindent
+\textit{subroutine called at each time step}
+
+This subroutine is completed in \texttt{usini1} for the specific physics. It allows:
+\begin{list}{$\bullet$}{}
+\item Activates the variables in the specific physics module, the chronolgical
+outputs (indicators ICHRVR(IPP)), the listings (indicator (ILISVR(IPP)) and the
+historical exits at the probes defined in \texttt{usini1}(indicators IHISVR(IPP)).
+The functions are the same as in \texttt{usini1} and the script frequency of the
+exits are fixed using \texttt{usini1.} The indicators IPP are for the value IPP=IPPPRO
+(IPPROC(IVAR), with IVAR, the number of specific physics varibles. With the main variables
+ which concern the user(velocity, pressure, etc), the user must always use \texttt{usini1
+}if the history,the listings or the chronological files are required.
+ The variables which the user can activate are marked out. The number of variables in
+the calculation is given in IVAR ( defined to the cells IEL and accessible by PROPCE
+IEL,IPPROC(IPROP)):
+
+\begin{list}{$\rightarrow$}{}
+ \item Electric Arc Module:
+ \begin{list}{-}{}
+ \item Calculation variables RTP(IEL,IVAR)
+ \begin{list}{IVAR = }{}
+ \item ISCA(IHM\index{IHM}) enthalpy
+ \item ISCA(IPOTR\index{IPOTR}) real potentiel
+ \item ISCA(IPOTVA(i))\index{IPOTVA}) solved components of the potential vector.
+ \item ISCA(IYCOEL(IESP)\index{IYCOEL}) the mass fraction of NGAZG composites if there are more than 1
+ \end{list}
+ \item Properties PROPCE(IEL,IPPROC(IPROP))
+ \begin{list}{IPROP = }{}
+ \item ITEMP\index{ITEMP} temperature
+ \item IEFJOU\index{IEFJOU} power dissipation by the Joule effect.
+ \item ILAPLA(i)\index{ILAPLA(i)} components of the laplace forces.
+ \end{list}
+ \end{list}
+ \item Joule Module effect~:
+ \begin{list}{-}{}
+ \item Calculation variables RTP(IEL,IVAR)
+ \begin{list}{IVAR = }{}
+ \item ISCA(IHM\index{IHM}) enthalpy
+ \item ISCA(IPOTR\index{IPOTR}) real potential
+ \item ISCA(IPOTI\index{IPOTI}) imaginary potential if its to be taken into account
+ \item ISCA(IYCOEL(IESP)\index{IYCOEL})the mass fraction of NGAZG composites if there are more than 1
+ \end{list}
+ \item Properties PROPCE(IEL,IPPROC(IPROP))
+ \begin{list}{IPROP = }{}
+ \item ITEMP\index{ITEMP} temperature
+ \item IEFJOU\index{IEFJOU} volumic power dissipation by Joule effect.
+ \end{list}
+ \end{list}
+ \end{list}
+
+ \item to give the coefficient of relaxation of the density SRROM:\\
+$\rho^{n+1}=SRROM*\rho^{n}+(1-SRROM)\rho^{n}$\\
+(for the electric arc, the sub-relaxation is taken into account during the 2nd time step; for the Joule effect the sub relaxation is not accounted for unless the user specifies in \texttt{uselph}
+
+ \item indicates if the data will be fixed in the power dissipation or in the current, done in IELCOR.
+ \item target current fixed as COUIMP(electric arc module) or the power dissipation PUISM (Joule module effect).
+ \item Fix the initial value of potential difference DPOT, the for the calculations with a single fixed parameter as COUIMP or PUISM.
+
+\end{list}
+
+%==================================
+\subsection{Management of variable physical properties in the electric module}
+%==================================
+
+\noindent
+\textit{Subroutine called at each time step}
+
+All the laws of the variation of physical data of the fluid are written (where neccessary)
+in this subroutine... The subroutine replaces \texttt{usphyyv} and a similar component.
+
+{\em WARNING: For the electric module, it is here that all the physical variables are defined
+ (including the relative cells and the eventuel user scalars):\texttt{usepelph} is not used.}
+
+The user should ensure that the defined variation laws are valid for the whole range of
+variables. Particular attention should be taken with the non-linear laws (for example, a
+ 3rd degree polynomial law giving negative values of density)
+
+{\em WARNING: with the electric module, all the physical propertie are assumed as variables
+ and so are stored in the PROPCE array. CP0, VISCLS0,VISCL0 are not used}
+
+For the Joule effect, the user is obliged to supply the physical properties in the sub-
+routine. Examples are given which are to be adapted by the user. If the temperature is
+to be determined to calculate the physical properties, the solved variable, enthalpy must
+ be deduced. The preffered temperature-enthalpy law can be selected in the subruotine
+ \texttt{usthht} (an example of the interpolation is given from the law table. This
+subroutine can be re-used for the initialisation of the variables(\texttt{useliv}))
+ For the elecrtic arc module, the physical properties are intepolated from the data file
+ \texttt{dp\_ELE} supplied by the user. Modification is not generally necessary.
+
+
+
+%==================================
+\subsection[Management of the {\em EnSight} output in the electric module~: \texttt{uselen}]
+{Management of the {\em EnSight} output in the electric module~: \textmd{\texttt{uselen}}}
+%==================================
+
+\noindent
+\textit{Subroutine called at each chronological output}
+
+This subroutine allow the addition on N variables in the {\em EnSight} output file and
+ works like the subroutine \texttt{usvpst} (with the electric module, it is however still
+ possible to \texttt{usvpst}.
+
+The algebraic variables related to the electric module are provided by default provided
+ that they are not explicitely contained in the POPCE array:
+\begin{list}{-}{}
+\item gradient of real potential in $V m^{-1}$ ($\grad Pot_R = -\vect{E}$)
+\item density of real current in $A m^{-2}$ ($\vect{j}=\sigma \vect{E}$)
+\end{list}
+specifically for the Joule module effect with IPPMOD(IELJOU)=2~:
+\begin{list}{-}{}
+\item gradient of imaginary potential in $V m^{-1}$
+\item density of real current in $A m^{-2}$
+\end{list}
+specifically for the electric arc module with IPPMOD(IELARC)=2~:
+\begin{list}{-}{}
+\item magnetic field in $T$ (\vect{B} = \vect{rot}\,\vect{A})
+\end{list}
+
+If it is convenient for the user, there is no need to add this subroutine into the
+ SRC directory: the post-processing will be done automatically (at the same frequency
+ (NTCHR) as the other calculation variables)
+
+
+%==================================
+\subsection{Compressible module}
+%==================================
+
+When the compressible module\footnote{For more details concerning the
+compressible version, the user may refer to the document ``Implantation
+d'un algorithme compressible dans \CS'', Rapport EDF 2003,
+HI-83/03/016/A, P. Mathon, F. Archambeau et J.-M. H\'erard.} is
+activated, it is recommended to:
+\begin{list}{-}{}
+ \item use the option ``time step variable in time and uniform in
+ space'' (IDTVAR=1) with a maximum Courant number of 0.4
+ (COUMAX=0.4): these choices must be written in \texttt{usini1}
+ \item keep the convective numerical schemes proposed by default.
+\end{list}
+
+%==================================
+\subsubsection{ Initialisation of the options of the variables related
+ to the compressible module: \textmd{\texttt{uscfx1}} and \textmd{\texttt{uscfx2}}}
+%==================================
+\label{prg_uscfx12}%
+\noindent
+\textit{Subroutine called every time step.}
+
+These subroutines complete \texttt{usini1}.
+
+\texttt{uscfx1} allows to set non standard calculation options related to the
+compressible module, and in particular to fill in the key word ICFGRP
+allowing to take into account the hydrostatic equilibrium in the
+boundary conditions.
+
+\texttt{uscfx2} allows to specify for the molecular thermal conductivity and
+the volumetric viscosity the following pieces of information:
+\begin{list}{-}{}
+ \item variable or not (IVISCV)
+ \item reference value (VISCV0)
+\end{list}
+
+%==================================
+\subsubsection{Management of the boundary conditions related to the
+ compressible module: \textmd{\texttt{uscfcl}}}
+%==================================
+
+
+\noindent
+\textit{Subroutine called every time step.}
+
+The use of \texttt{uscfcl}
+is obligatory to run a calculation using the compressible module just
+as it is in both \texttt{usini1} and \texttt{usppmo} . The
+way of using it is the same as the way of using
+\texttt{usclim} in the framework of standard calculations, that is to
+say several loops on the boundary faces lists (cf. \S\ref{fvm_selector})
+marked out by their colors, groups, or geometrical criterion, where
+the type of face, the type of boundary condition for each variable and
+eventually the value of each variable are defined.
+
+{\em WARNING: in the case of a calculation using the compressible
+module, the boundary conditions of all the variables are defined here,
+even those of the eventual user scalars: {\em \texttt{usclim}} is not
+used at all.}
+
+In the compressible module, the different available boundary conditions
+are the followings:
+
+\begin{list}{-}{}
+ \item inlet/outlet for which everything is known
+ \item supersonic outlet
+ \item subsonic inlet
+ \item subsonic wall
+ \item wall
+ \item symmetry
+\end{list}
+
+
+%==================================
+\subsubsection{Ininitialisation of the variables related to the
+ compressible module: \textmd{\texttt{uscfxi}}}
+%==================================
+
+\noindent
+\textit{Subroutine called only during calculation initialisation.}
+
+This subroutine is used to initialise some variables specific to the
+specific physics activated {\em via} \texttt{usppmo}. As usual,
+the user may have access to several geometric variables to discriminate
+between different initialisation zones if needed.
+
+{\em WARNING: in the case of a specific physics modeling, all the
+variables are initialised here: {\em \texttt{usiniv}} is not used at
+all.}
+
+This subroutine works like \texttt{usiniv} for velocity,
+turbulence and passive scalars. Concerning pressure, density,
+temperature and specific total energy, only 2 variables out of the 4 are
+independant. The user may also initialise the variable pair he wants
+(apart from temperature-energy) and the two other variables will be
+calculated automatically by giving the right value to the variable
+ICCFTH used for the call to \texttt{uscfth}.
+
+%==================================
+\subsubsection{Compressible module thermodynamics: \textmd{\texttt{uscfth}}}
+%==================================
+
+\noindent
+\textit{This subroutine is called several times every time step (boundary conditions, physical properties, solving of the energy equation, ...).}
+
+This subroutine is used to set the thermodynamics parameters. By
+default, the perfect gas laws are implemented. If the user needs to use
+other laws (perfect gas with variable Gamma, Van der Waals), he must
+modify this subroutine.
+
+%==================================
+\subsubsection{Management of the variable physical properties in the
+ compressible module: \textmd{\texttt{uscfpv}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every time step.}
+
+If necessary, all the variation laws of the fluid physical properties
+(viscosity, specific heat, ...) are described here. This subroutine
+replaces and is similar to \texttt{usphyv}.
+
+The user should make sure that the defined variation laws are valid for
+the whole variation range of the variables.
+
+%==================================
+\subsection{Lagrangian modeling of multiphasic flows with dipersed inclusions}
+%==================================
+
+
+%==================================
+\subsubsection{Initialisation of the main key words in the lagrangian
+ modeling: \textmd{\texttt{uslag1}}}
+%==================================
+
+\noindent
+\textit{Subroutine called only during calculation initialisation.}
+
+\noindent
+This is one of the two subroutines which must be completed in
+the case of a calculation modeling a lagrangian multiphasic flow. This
+subroutine gathers in different headings all the key word which are
+necessary to configure the lagrangian module. The different headings
+refer to:
+\begin{list}{$\bullet$}{}
+\item the global configuration parameters
+\item the specific physical models describing the particle behaviour
+\item the backward coupling (influence of the dispersed phase on the
+ continuous phase)
+\item the numerical parameters
+\item the volumetric statistics
+\item the boundary statistics
+\item the postprocessing in trajectory mode
+\end{list}
+%
+\noindent
+For more details about the different parameters, the user may refer to the
+key word list (\S\ref{prg_motscles_lagr}).
+
+\noindent
+The results of the lagangian module consist in some information about
+the particle cloud. These pieces of information are displayed in the
+form of statistics. It is therefore necessary to activate the
+calculation of the statistics at a given instant during the
+simulation. To do so, there are different strategies which are strongly
+related to the flow nature, stationary or not. \\
+Except from the cases where the injection conditions depend on the time,
+it is generally recommended to realise a first lagrangian calculation
+whose aim is to get a nearly constant particle number in the calculation
+domain. In a second step, a calculation restart is done to calculate the
+statistics. \\
+When the monophasic flow is stationary and the inclusion presence rate
+is low enough to neglect their influence on the continuous phase
+behaviour, it is better to realise a lagrangian calculation on a fixed
+field. It is then possible to calculate stationary volumetric statistics and
+to give a statistical weight higher than 1 to the particles, in order to
+reduce the number to treat while keeping the right concentrations. \\
+Otherwise, when the continuous phase flow is stationary, but the backward
+coupling must be taken into consideration, it is still possible to
+activate stationary statistics. \\
+When the continuous phase flow is non-stationary, it is no longer possible
+to use stationary statistics. To have correct statistics at every moment
+in the whole calculation domain, it is imperative to have an established
+particle seeding and it is recommended (when it is possible) not to
+impose statistical weights different from the unity. \\
+Finally, when the complete model is used for the turbulent dispersion
+modeling, the user must make sure that the volumetric statistics are
+directly used for the calculation of the locally undisturbed fluid flow
+field. \\
+
+\noindent
+When the thermal evolution of the particles is activated, the associated
+particulate scalars are always the inclusion temperature and the locally
+undisturbed fluid flow
+temperature expressed in degrees Celsius, whatever the thermal scalar
+associated with the continuous phase is (temperature or enthalpy). If the
+thermal scalar associated with the continuous phase is the temperature
+in Kelvin, the unit change is done automatically. If the
+thermal scalar associated with the continuous phase is the enthalpy, the
+enthalpy-temperature conversion subroutine \texttt{usthht} must be
+completed for MODE=1, and must express temperatures in degrees
+Celsius. \\
+In all cases, the thermal backward coupling of the dispersed phase on
+the continuous phase is adapted to the thermal scalar transported by the
+fluid.
+
+\noindent
+\emph{WARNING: Up to now, parallelism and periodicity are not compatible with
+the lagrangian module. This compatibility will be soon implemented. It
+is however possible, in the framework of a lagrangian calculation on a
+fixed field, to realise in a first step the calculation of the
+continuous phase using parallelism, and to conduct in a second step the
+lagrangian calculation by doing a restart on only one processor.}
+
+%==================================
+\subsubsection{Management of the boundary conditions related to the
+ particles: \textmd{\texttt{uslag2}} and \textmd{\texttt{uslain}}}
+%==================================
+
+\noindent
+In the framework of the multiphasic lagrangrian modeling, the management
+of the boundary conditions concerns the particle behaviour when there
+is an interaction between its trajectory and a boundary face. These
+boundary conditions may be imposed independently of those concerning the
+eulerian fluid phase (they are of course generally coherent). The
+boundary condition zones are actually redefined by the lagrangian
+module (cf. \S\ref{fvm_selector}), and a type of particle behaviour
+is associated with each one. \\
+The management of the lagrangian boundary conditions is done by means of
+several user subroutines: \texttt{uslag2} for the classic conditions and
+\texttt{uslain} to specify profiles if necessary. Otherwise, the
+subroutine \texttt{uslabo} allows to define the type of particle/wall
+interaction. It will be described in a specific paragraph.
+
+\minititre{Subroutine \texttt{uslag2}}
+
+\noindent
+\textit{Subroutine called every time step.}
+
+\noindent
+It is the second indispensable subroutine for every calculation using the
+lagrangian module. The main numerical variables and ``pointers'' are
+described below.
+
+\variab{IFRLAG}{IFRLAG(NFABOR)}{IA}{In the lagrangian module, the user
+defines NFRLAG\index{NFRLAG} boundary zones from the color of the
+boundary faces, or more generally from their properties (colors, groups
+...), from the boundary conditions defined in \texttt{usclim}, or even
+from their coordinates. To do so, the array IFRLAG(NFABOR) giving for
+each face IFAC the number IFRLAG(IFAC) corresponding to the zone to
+which it belongs, is completed. The zone numbers ({\em i.e.} the values
+of IFRLAG(IFAC)) are chosen freely by the user, but must be strictly
+positive integers inferior or equal to NFLAGM\index{NFLAGM} (parameter
+stored in lagpar.h, whose default value is 100). A zone type is
+associated with every zone; it will be used to impose global boundary
+conditions. \emph{WARNING: it is essential that every boundary face
+belongs to a zone.}}
+
+\variab{IUSNCL}{IUSNCL(NFLAGM)}{IA}{For all the NFRLAG boundary zones
+previously identified, the number of classes NBCLAS\footnote{a class is a set
+of particles sharing the same physical properties and the same
+characteristics concerning the injection in the calculation domain} of
+entering particles is given: IUSNCL(IZONE) = NBCLAS. By default, the
+number of particle classes is zero. The maximum number of classes is
+NCLAGM\index{NCLAGM} (parameter stored in lagpar.h, whose default value
+is 20).}
+
+\variablist{IUSCLB}{IUSCLB(NFLAGM)}{IA}{For all the NFRLAG boundary zones
+previously identified, a particle boundary condition type is
+given. There are two categories of particle boundary condition types:
+those predefined in the subroutine \texttt{uslabo} (marked out by the
+key words IENTRL\index{IENTRL}, ISORTL\index{ISORTL}, IREBOL\index{IREBOL},
+IDEPO1\index{IDEPO1}, IDEPO2\index{IDEPO2}, IDEPO3\index{IDEPO3},
+IENCRL\index{IENCRL}) and the user boundary condition types (marked out
+by the key words JBORD1 to JBORD5)\index{JBORD1}, whose corresponding
+particle behaviour must be defined in the subroutine \texttt{uslabo}.
+
+\begin{list}{$\bullet$}{}
+
+ \item if IUSCLB(IZONE) = IENTRL, IZONE is a particle injection zone. For
+ each particle class associated with this zone, some pieces of
+ information must be given (see below). If a particle trajectory
+ crosses an injection zone, then we consider that this particle
+ leaves the calculation domain.
+
+ \item if IUSCLB(IZONE) = ISORTL, the particles interacting with the zone
+ IZONE leave the calculation domain.
+
+ \item if IUSCLB(IZONE) = IREBOL, the particles undergo an elastic
+ rebound on the boundary zone IZONE.
+
+ \item if IUSCLB(IZONE) = IDEPO1, the particles settle definitevely on
+ the boundary zone IZONE. These particles can not be put in suspension
+ again, and we consider that they leave the calculation domaine.
+
+ \item if IUSCLB(IZONE) = IDEPO2, the particles settle definitevely on
+ the boundary zone IZONE, but they are kept in the calculation
+ domain. This distinction with the type IDEPO1 is useful only when
+ post-processings in movement mode (IFENSI2 = 1) are realised: the
+ particles do not disappear after touching the boundary
+ zone. However, using IDEPO2 type zones necessitates more memory
+ than using IDEPO1 type zones.
+
+ \item if IUSCLB(IZONE) = IDEPO3, the particles settle on the boudary
+ zone IZONE, but can be put in suspension again depending on the
+ local description of the continuous phase flow.
+
+ \item if IUSCLB(IZONE) = IENCRL, the particles which are coal particles
+ (if IPHYLA = 2) can become fouled up on the zone IZONE. The
+ slagging is a IDEPO1 type deposit of the coal particle if a certain
+ criterion is respected. Otherwise, the coal particle rebounds
+ (IREBOL type behaviour). This boundary condition type is available
+ if IENCRA = 1. A limit temperature TPRENC\index{TPRENC}, a
+ critical viscosity VISREF\index{VISREF} and the coal composition
+ in mineral matters must be given in the subroutine
+ \texttt{uslag1}. The slagging criterion given by default may be
+ modified in the subroutine \texttt{uslabo}.
+
+ \item if IUSCLB(IZONE) = JBORD1 to JBORD5, then the particle
+ interaction with the boundary zone IZONE is given by the user. The
+ particle behaviour associated with each type JBORD* must be defined in
+ the subroutine \texttt{uslabo}.
+
+\end{list}
+}
+
+
+\variablist{IUSLAG}{IUSLAG(NCLAGM, NFLAGM, NDLAIM)}{IA}{Some pieces of
+information must be given for each particle class associated with an
+injection zone. The first part consists in integers contained in the
+array IUSLAG. There are at the most NDLAIM\index{NDLAIM} integers. These
+pieces of information must be provided for each class ICLAS and each
+particle injection zone IZONE. They are marked out by means of ``pointers'':
+\begin{list}{$\rightarrow$}{}
+
+\item IUSLAG(ICLAS,IZONE,IJNBP): number of particles to inject in the
+ calculation domain per class and per zone.
+
+\item IUSLAG(ICLAS,IZONE,IJFRE): injection period (expressed in number
+ of time steps). If the period is null, then there is injection only
+ at the first absolute lagrangian time step (including the restart
+ calculations).
+
+\item IUSLAG(ICLAS,IZONE,IJUVW): type of velocity condition:
+
+\begin{list}{-}{}
+
+\item if IUSLAG(ICLAS,IZONE,IJUVW) = 1, the particle velocity vector is
+ imposed, and its components must be given in the array RUSLAG (see
+ below).
+
+\item if IUSLAG(ICLAS,IZONE,IJUVW) = 0, the particle velocity is imposed
+ perpendicular to the injection boundary face and with the norm
+ RUSLAG(ICLAS,IZONE,IUNO).
+
+\item if IUSLAG(ICLAS,IZONE,IJUVW) = -1, the particle injection velocity
+ is equal to the fluid velocity at the center of the cell
+ neighboring the injection boundary face.
+
+\end{list}
+
+\item IUSLAG(ICLAS,IZONE,INUCHL): when the particles are coal particles
+ (IPHYLA = 2), this part of the array contains the coal index-number,
+ between 1 and NCHARB (defined by the user in the thermo-chemical
+ file dp\_FCP, with NCHARB$\leqslant$NCHARM =
+ 3).\index{NCHARB}\index{NCHARM}
+
+\end{list}
+}
+
+\variablist{RUSLAG}{RUSLAG(NCLAGM, NFLAGM, NDLAGM)}{RA}{Some pieces of
+information must be given for each particle class associated with an
+injection zone. The second and last part consists in real numbers
+contained in the array RUSLAG. There are at the most
+NDLAGM\index{NDLAGM} such real numbers. These pieces of information must
+be provided for each class ICLAS and each particle injection zone
+IZONE. They are marked out by means of ``pointers'':
+\begin{list}{$\rightarrow$}{}
+
+\item RUSLAG(ICLAS,IZONE,IUNO): norm of the injection velocity,
+\\useful if IUSLAG(ICLAS,IZONE,IJUVW)~=~0.
+
+\item RUSLAG(ICLAS,IZONE,IUPT), RUSLAG(ICLAS,IZONE,IVPT),\\
+RUSLAG(ICLAS,IZONE,IWPT): components of the particle injection vector,
+\\useful if IUSLAG(ICLAS,IZONE,IJUVW)~=~1.
+
+\item RUSLAG(ICLAS,IZONE,IDEBT): allows to impose a particle mass
+ flow. According to the number of injected particles, the particle
+ statistical weight TEPA(NPT,JRPOI) is recalculated in order to
+ respect the required mass flow (the number of injected particles
+ does not change). When the mass flow is null, it is not taken into
+ account.
+
+\item RUSLAG(ICLAS,IZONE,IPOIT): particle statistical weight per class and
+ per zone.
+
+\item RUSLAG(ICLAS,IZONE,IDPT): particle diameter. When the particles
+ are coal particles (IPHYLA = 2), this diameter is provided by the
+ thermo-chemical file dp\_FCP {\it via} the array DIAM20(ICLG),
+ where ICLG is the ``pointer'' on the total class number ({\em
+ i.e.} for all the coal types). When the standard deviation of the
+ particle diameter is different from zero, this diameter becomes a
+ mean diameter.
+
+\item RUSLAG(ICLAS,IZONE,IVDPT): standard deviation of the injection
+ diameter. To impose this standard deviation allows to respect
+ granulometric distribution: the diameter of each particle is
+ calculated from the mean diameter, the standard deviation and a
+ gaussian random number. In this case, it is strongly recommended
+ to intervene in the subroutine \texttt{uslain} to
+ restrict the diameter variation range, in order to avoid
+ aberrant values. If this standard deviation is null, then the
+ particle diameter is constant per class and per zone.
+
+\item RUSLAG(ICLAS,IZONE,IROPT): particle density. When the particles
+ are coal particles (IPHYLA = 2), this density is set in the
+ thermo-chemical file dp\_FCP {\em via} the array RHO0CH(ICHA),
+ where ICHA is the coal number.
+
+\item RUSLAG(ICLAS,IZONE,ITPT): particle injection temperature in
+ \degresC. Useful if IPHYLA = 1 and if ITPVAR = 1.
+
+\item RUSLAG(ICLAS,IZONE,ICPT): particle injection specific heat. Useful
+ if IPHYLA = 1 and if ITPVAR = 1. When the particles are coal
+ particles (IPHYLA = 2), the specific heat is set in the
+ thermo-chemical file dp\_FCP {\em via} the array CP2CH(ICHA).
+
+\item RUSLAG(ICLAS,IZONE,IEPSI): particle emissivity. Useful if IPHYLA =
+ 1 and if ITPVAR = 1, and if the radiation module is activated for
+ the continuous phase (note: when IPHYLA = 2, the coal particle
+ emissivity is given the value 1).
+
+\item RUSLAG(ICLAS,IZONE,IHPT): particle injection temperature in
+ \degresC\ when these particles are coal
+ particles. The array RUSLAG(ICLAS,IZONE,ITPT) is then no longer
+ active. Useful if IPHYLA = 2.
+
+\item RUSLAG(ICLAS,IZONE,IMCHT): mass of reactive coal. Useful if IPHYLA = 2.
+
+\item RUSLAG(ICLAS,IZONE,IMCKT): mass of coke. This mass is null
+ if the coal did not begin to burn before its injection. Useful if
+ IPHYLA = 2.
+
+\end{list}
+}
+
+\variab{IUSVIS}{IUSVIS(NFLAGM)}{IA}{In order to display the variables at
+the boundaries defined in the subroutine \texttt{uslag1}, this array
+allows to select the boundary zones on which a display is wanted. To do
+so, a number is associated with each zone IZONE. If this number is
+strictly positive, the corresponding zone is selected ; if it is null,
+the corresponding zone is eliminated. If several zones are associated
+with the same number, they will be displayed together in the same
+selection with \textit{EnSight}. Each selection will be split in
+\textit{EnSight} parts according to the geometric types of the present
+boundary faces ((\textit{i.e.} 'tria3', 'quad4' et 'nsided').}
+
+\minititre{Subroutine \texttt{uslain}}
+
+\noindent
+\textit{Subroutine called every time step.}
+
+\noindent
+It is not obligatory to intervene in this subroutine.
+
+\noindent
+\texttt{uslain} is used to complete \texttt{uslag2} when the particles
+must be injected in the domain according to fine constraints (profile,
+position ...): the arrays ETTP, TEPA and ITEPA can be modified here for
+the new particles (these arrays were previously completed automatically
+by the code from the data provided by the user in \texttt{uslag2}).
+
+\noindent
+In the case of a more advanced utilisation, it is possible to modify
+here all the arrays ETTP, TEPA and ITEPA. The particles already present in the
+calculation domain are marked out by an index varying between 1 and
+NBPART. The particles entering the calculation domain at the current
+iteration are marked out by an index varying between NBPART+1 and NBPNEW.
+
+
+%==================================
+\subsubsection{Treatment of the particle/boundary interaction:
+\textmd{\texttt{uslabo}}}
+%==================================
+
+\noindent
+\textit{Subroutine called at every particle/boundary interaction.}
+
+\noindent
+It is not obligatory to intervene in this subroutine, but it is required
+in four different cases.
+
+\noindent
+Firstly, an intervention is required when JBORD* type boundary
+conditions are used: it is then necessary to code in this subroutine the
+corresponding particle/boundary interactions.
+
+\noindent
+Secondly, it is possible to select the particle/boundary interaction types
+(IREBOL, IDEPO1, ...) for which the user wants to save the wall
+statistics activated in the subroutine \texttt{uslag1}.
+
+\noindent
+Thirdly, if user boundary statistics are activated {\em via}
+the key word NUSBOR\index{NUSBOR} in the subroutine \texttt{uslag1}, it
+is then necessary to program them in the subroutine
+\texttt{uslabo}. When the boundary statistics are stationary, these new
+boundary statistics are added using the array PARBOR. When they are
+non-stationary (number of lagrangian iterations lower than NSTBOR, or
+ISTTIO = 0), the array PARBOR is reset at every iteration.
+
+\noindent
+Fourthly, when the user wants to modify the formulation of the wall
+slagging by the coal particles, it is then necessary to program the new laws
+in the subroutine \texttt{uslabo}.
+
+\noindent
+\minititre{Construction rules of a new particle/boundary interaction}
+\begin{enumerate}
+\item The real numbers KX, KY, KZ provide the coordinates of the intersection
+ point between the current particle trajectory and the interacting
+ boundary face.
+
+\item If the user wants to modify the particle position, it can be done
+ directly {\em via} the arrays ETTP and ETTPA:
+
+\begin{list}{-}{}
+\item new departure point of the current trajectory segment: \\
+ETTPA(NPT,JXP), ETTPA(NPT,JYP), ETTPA(NPT,JZP)
+\item new arrival point of the current trajectory segment: \\
+ETTP(NPT,JXP), ETTP(NPT,JYP), ETTP(NPT,JZP)
+\end{list}
+
+\item The particle and the fluid velocities may be modified according to
+ the desired interaction {\em via} the arrays VITPAR\index{VITPAR}
+ and VITFLU\index{VITFLU}, they \textbf{must not} be modified {\em
+ via} ETTP and ETTPA in this subroutine.
+
+\item For a given interaction, it is necessary to specify the key word
+ ISUIVI\index{ISUIVI}:
+
+\begin{list}{-}{}
+\item ISUIVI = 0 if the particle does not need to be followed in
+ the mesh after the interaction between its trajectory and the
+ boundary face (by default, it is the case for IENTRL, ISORTL,
+ IDEPO1, IDEPO2) ;
+\item ISUIVI = 1 to continue to follow the particle in the mesh
+ after its interaction (by default, it is the case for IREBOL and
+ IDEPO3). The value of ISUIVI may be a function of the particle and
+ boundary state (for instance, ISUIVI = 0 or 1 depending on the
+ physical properties for the interaction type IENCRL).
+\end{list}
+
+\item The array zone ITEPA(NPT,JISOR), containing the index-number of the
+ cell where the particle is, must be updated. Generally:
+
+\begin{list}{-}{}
+\item ITEPA(NPT,JISOR) = IFABOR(KFACE) when the particle stays in the
+ calculation domain (KFACE is the number of the interacting
+ boundary face).
+\item ITEPA(NPT,JISOR) = 0 to eliminate definitively the particle from
+ the calculation domain.
+\end{list}
+
+\end{enumerate}
+
+\minititre{Note: order of the numerical scheme after a particle/boundary
+interaction}
+
+When a particle interacts with a boundary face, the integration order of
+the associated stochastic equations is always a first-order, even if a
+second-order scheme is used elsewhere.
+
+%==================================
+\subsubsection{Option of particle cloning/fusion: \textmd{\texttt{uslaru}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every lagrangian iteration.}
+
+\noindent
+An intervention in this subroutine is required if the particle
+cloning/fusion option is activated {\em via} the key word IROULE. The
+importance function CROULE must then be completed. \\
+The aim of this technique is to reduce the number of particles to treat in
+the whole flow and to refine the description of the particle cloud only
+where the user wants to get volumetric statistics more accurate than in the
+rest of the calculation domain. \\
+The values given to the importance function are strictly positive real
+numbers allowing to classify the zones according to their
+importance. The higher the value given to the importance function, the
+more important the zone.
+
+\noindent
+For instance, when a particle moves from a zone of importance 1 to a
+zone of importance 2, it undergoes a cloning: the particle is replaced by two
+identical particles, whose statistical weight is the half of the initial
+particle. When a particle moves from a zone of importance 2 to a zone of
+importance 1, it undergoes a fusion: the particle survives to its passing
+through with a probability of 1/2. A random dawing is used to
+determine if the particle will survive or disappear.\\
+In the same way, when a particle moves from a zone of importance 3 to a
+zone of importance 7, it undergoes a cloning. The particle is cloned in
+Int(7/3)=2 or Int(7/3)+1=3 particles with a probability of respectively
+1-(7/3-Int(7/3))=2/3 and 7/3-Int(7/3)=1/3. If the particle moves from a
+zone of importance 7 to a zone of importance 3, it undergoes a fusion:
+it survives with a probability of 3/7.
+
+\noindent
+\emph{WARNING: The importance function must be a strictly positive real
+number in every cell}
+
+%==================================
+\subsubsection{Manipulation of particulate variables at the end of an
+ iteration and user volumetric statistics: \textmd{\texttt{uslast}} and
+ \textmd{\texttt{uslaen}}}
+%==================================
+
+\noindent
+\texttt{uslast}\textit{: subroutine called at the end of every
+lagrangian iteration}
+
+\noindent
+\texttt{uslaen}\textit{: subroutine called at every chronological output
+and every listing printing}
+
+\noindent
+The subroutine \texttt{uslast} is called at the end of every lagrangian
+iteration, it allows therefore the modification of variables related to
+the particles, or the extraction and preparation of data to display in
+the listing or the post-processing.
+
+\noindent
+An intervention in both subroutines \texttt{uslast} and \texttt{uslaen}
+is required if supplementary user volumetric statistics are wanted.
+
+\minititre{User volumetric statistics:}
+
+\noindent
+The volumetric statistics are calculated by means of the array STATIS. Two
+situations may happen:
+\begin{list}{-}{}
+\item the calculation of the statistics is not stationary: STATIS is
+ reset at every lagrangian iteration ;
+\item the calculation of the statistics is stationary: the array
+ STATIS is used to store cumulated values of variables, which will
+ be averaged at the end of the calculation in the subroutine
+ \texttt{uslaen}.
+\end{list}
+According to the user parameter settings, it may happen that during the
+same calculation, the statistics will be non-stationary in a first part and
+stationary in second part.
+
+\begin{list}{$\bullet$}{}
+\item\minititre{User volumetric statistics: subroutine \texttt{uslast}}
+\noindent
+
+\noindent
+In this subroutine, the variable whose volumetric statistic is wanted is
+stored in the array STATIS. In the framework of stationary statistics,
+the average itself is calculated in the subroutine \texttt{uslaen}. This
+average is obtained through the division of the cumulated value by: \\
+\hspace*{1cm}- either the duration of the stationary statistics
+ calculation stored in the variable TSTAT\index{TSTAT}, \\
+\hspace*{1cm}- or the number of particles in statistical weight. \\
+This method of averaging is applied to every piece in the listing and
+ to the post-processing outputs.
+
+\item\minititre{User volumetric statistics: subroutine \texttt{uslaen}}
+
+\noindent
+In this subroutine is calculated the average corresponding to the
+cumulated value obtained in the subroutine \texttt{uslast}. This subroutine is
+also used for the standard volumetric statistics. Several examples are
+therefore described.
+\end{list}
+
+%==================================
+\subsubsection{User stochastic differential equations:
+ \textmd{\texttt{uslaed}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every lagrangian sub-step.}
+
+\noindent
+An intervention in this subroutine is required if supplementary user
+variables are added to the particle state vector (arrays ETTP and ETTPA).
+
+\noindent
+The integration of the stochastic differential equations associated with
+supplementary particulate variables is done in this subroutine. \\
+When the integration scheme of the stochastic differential equations is
+a first-order (NORDRE = 1), this subroutine is called once every
+lagrangian iteration, if it is a second-order (NORDRE = 2), it is called
+twice. \\
+
+\noindent
+The solved stochastic differential equations must be written in the
+form:
+\begin{displaymath}
+\frac{d \Phi_p}{dt} \,=\, - \frac{\Phi_p - \Pi}{\tau_\phi}
+\end{displaymath}
+where $\Phi_p$ is the I\textit{th} supplementary user variable (NVLS in
+total) available in ETTP(NBPMAX, JVLS(I)) and in ETTPA(NBPMAX,JVLS(I)),
+$\tau_\phi$ is a quantity homogen to a characteristic time, and $\Pi$ is
+a coefficient which may be expressed as a function of the other
+particulate variables contained in ETTP and ETTPA. \\
+In order to do the integration of this equation, the following
+parameters must be provided:
+\begin{list}{-}{}
+\item $\tau_\phi$, equation characteristic time, in the array AUXL1 for
+ every particle,
+\item $\Pi$ , equation coefficient, in the array AUXL2. If the
+ integration scheme is a first-order, then $\Pi$ is expressed as a
+ function of the particulate variables at the previous iteration,
+ stored in the array ETTPA. If the chosen scheme is a second-order,
+ then $\Pi$ is expressed at the first call of the subroutine
+ (prediction step NOR = 1) as a function of the variables at the
+ previous iteration (stored in ETTPA), then at the second call
+ (correction step NOR = 2) as a function of the predicted variables
+ stored in the array ETTP.
+\end{list}
+
+\noindent
+If necessary, the thermal characteristic time $\tau_c$, whose
+calculation can be modified by the user in the subroutine
+\texttt{uslatc}, is stored for each particle in the part
+TEMPCT(NBPMAX,1) of the array TEMPCT.
+
+
+%==================================
+\subsubsection{Particle relaxation time: \textmd{\texttt{uslatp}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every lagrangian sub-step.}
+
+\noindent
+An intervention in this subroutine is not obligatory.
+
+\noindent
+In this subroutine, the particle relaxation time may be modified
+according to the chosen formulation of the drag coefficient. \\
+The particle relaxation time, modified or not by the user, is available
+in the array TAUP.
+
+%==================================
+\subsubsection{Particle thermal characteristic time: \textmd{\texttt{uslatc}}}
+%==================================
+
+\noindent
+\textit{Subroutine called every lagrangian sub-step.}
+
+\noindent
+An intervention in this subroutine is not obligatory.
+
+\noindent
+In this subroutine, the particle thermal characteristic time may be
+modified according to the chosen correlation for the calculation of the
+Nusselt number. \\
+The thermal characteristic time, modified or not by the user, is
+available in the zone TEMPCT(NBPMAX,1) of the array TEMPCT.
diff --git a/doc/user/saturne2.tex b/doc/user/saturne2.tex
new file mode 100644
index 0000000..92b9762
--- /dev/null
+++ b/doc/user/saturne2.tex
@@ -0,0 +1,3751 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2009 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%==================================
+%==================================
+\section{Key word list}
+%==================================
+%==================================
+\label{prg_motscles}
+
+The key words are classified under headings. For each key word of the Kernel of \CS,
+the following data are given:
+
+\noindent
+\makebox[2.5cm][l]{Variable name}\makebox[1.3cm][l]{Type}%
+\makebox[5cm][l]{Allowed values}%
+\makebox[4.cm][l]{[Default]}O/C\hspace{1cm}Level\\
+\hspace*{2.5cm}Description\\
+\hspace*{2.5cm}Potential dependences
+
+
+\begin{list}{$\bullet$}{}
+\item \textbf{Variable name}: Name of the variable containing the key word.
+
+\item \textbf{Type}: A (Array), I (Integer), R (Real number), C
+ (Character string).
+
+\item \textbf{Allowed values}: list or range of allowed values.
+
+\item \textbf{Default}: value defined by the code before any user
+ modification (every key word has one). In some cases, a
+ non-allowed value is given (generally -999 or -1.D12), to force the
+ user to specify a value. If he does not do it, the code may:
+\begin{list}{-}{}
+\item automatically use a recommended value (for instance, automatical
+ choice of the variables for which chronological records will be
+ generated).
+
+\item stop, if the key word is essential (for instance, value of the
+ time step).
+\end{list}
+
+\item \textbf{O/C}: Optional/Compulsory
+\begin{list}{-}{}
+\item O: optional key word, whose default value may be enough.
+
+\item C: key word which must imperatively be specified (for instance,
+ the time step).
+\end{list}
+
+\item \textbf{Level}: L1, L2 ou L3
+\begin{list}{-}{}
+\item L1 (level 1): the users will have to modify it in the framework of
+ standard applications. The L1 key words are written in bold.
+
+\item L2 (level 2): the users may have to modify it in the framework of
+ advanced applications. The L2 key word are all optional.
+
+\item L3 (level 3): the developers may have to modify it ; it keeps its
+ default value in any other case. The L3 key word are all optional.
+\end{list}
+
+\item \textbf{Description}: key word description, with its potential
+ dependences.
+
+\end{list}
+
+The L1 key words can be modifed through the Graphical Use Interface or
+in the \texttt{usini1} subroutine. L2 and L3 key words can only be modified through
+the \texttt{usini1} subroutine, even if they do not appear in the version proposed
+as example it the \texttt{FORT/USERS/base} directory.\\
+It is however recommended not to modify the key words which do not belong to the L1
+level.
+
+The alphabetical key word list is displayed in the index, in the end of
+this report.
+
+\minititre{Notes}
+$\bullet\ $The notation ``D'' refers to a double precision real. For
+ instance, 1.8D-2 means 0.018. \\
+$\bullet\ $The notation ``GRAND'' (which can be used in the code)
+corresponds to 1.D12.
+
+%==================================
+\subsection{Inputs-outputs}
+%==================================
+
+\minititre{Notes}
+\begin{list}{$\bullet$}{}
+\item Two different files can have neither the same unit number nor the
+ same name.
+\item Text files (also called ``formatted'' files, in opposition to
+ ``binary'' files) are bigger, longer to write and to read, but can
+ be used on every architecture (in particular, it is an asset for
+ calculation restart files). However, \CS can automatically recognise and
+ convert Big Endian/Little Endian files. It is therefore usually possible on
+ a given architecture to use binary restart files generated on another
+ architecture.
+ \end{list}
+
+%==================================
+\subsubsection{''Calculation'' files}
+%==================================
+
+
+\minititre{General}
+
+\motcle{impgeo}{i}{strictly positive integer}{10}{O}{L3}
+{unit of the geometric file (if the Preprocessor is not used)\\
+useful if and only if {\tt SOLCOM = 1}}
+
+\motcle{ficgeo}{c}{string of 6 characters}{\tt geomet}{O}{L3}
+{name of the geometric file (if the Preprocessor is not used)\\
+useful if and only if {\tt SOLCOM = 1}}
+
+\motcle{impstp}{i}{strictly positive integer}{12}{O}{L3}
+{unit of the calculation interactive stop file\\
+always useful (because of the interactive character)}
+
+\motcle{ficstp}{c}{string of 6 characters}{\tt ficstp}{O}{L3}
+{name of the calculation interactive stop file (see p.\pageref{prg_ficstp})\\
+always useful (because of the interactive characteristic)}
+
+\motcle{ficamo}{c}{string of 13 characters}{\tt suiamo}{O}{L3}
+{name of the main upstream restart file. As with all restart
+files, its ``format'' (current or version 1.3) is automatically
+determined by the code.\\
+useful if and only if {\tt isuite = 1}}
+
+\motcle{ficamx}{c}{string of 13 characters}{\tt suiamx}{O}{L3}
+{name of the auxiliary upstream restart file.\\
+useful if and only if {\tt isuite = 1}}
+
+\motcle{ficava}{c}{string of 13 characters}{\tt suiava}{O}{L3}
+{name of the main downstream restart file\\
+always useful}
+
+\motcle{ficavx}{c}{string of 13 characters}{\tt suiavx}{O}{L3}
+{name of the auxiliary downstream restart file\\
+always useful}
+
+
+\minititre{1D wall thermal module}
+
+\motcle{ficmt1}{c}{string of 13 characters}{\tt t1damo}{O}{L3}
+{name of the upstream restart file for the 1D wall thermal module.\\
+useful if and only if {\tt isuit1 = 1} and {\tt nfpt1d$>$0}}
+
+\motcle{ficvt1}{c}{string of 13 characters}{\tt t1dava}{O}{L3}
+{name of the upstream restart file for the 1D wall thermal module\\
+useful if and only if {\tt nfpt1d$>$0}}
+
+\minititre{Vortex method for LES}
+
+\motcle{impmvo}{i}{strictly positive integer}{\tt impmvo}{O}{L3}
+{unit of the upstream restart file for the vortex method\\
+useful if and only if {\tt isuivo = 1} and {\tt ivrtex=1}}
+
+\motcle{ficmvo}{c}{string of 13 characters}{\tt voramo}{O}{L3}
+{name of the upstream restart file for the vortex method\\
+This is always a text file (this file has a different structure from the
+other restart files)\\
+useful if and only if {\tt isuivo = 1} and {\tt ivrtex=1}}
+
+\motcle{impvvo}{i}{strictly positive integer}{\tt impvvo}{O}{L3}
+{unit of the downstream restart file for the vortex method\\
+useful if and only if {\tt ivrtex=1}}
+
+\motcle{ficvvo}{c}{string of 13 characters}{\tt vorava}{O}{L3}
+{name of the upstream restart file for the vortex method\\
+This is always a text file (this file has a different structure from the
+other restart files)\\
+useful if and only if {\tt ivrtex=1}}
+
+\motcle{impdvo}{i}{strictly positive integer}{\tt impdvo}{O}{L3}
+{unit of the {\tt ficvor} data files for the vortex method. These
+files are text files. Their number and names are specified by the user in
+the \texttt{usvort} subroutine.\\
+(Although it corresponds to an ``upstream'' data file, {\tt impdvo} is
+initialized to {\tt 20} because, in case of multiple vortex entries,
+it is opened at the same time as the {\tt ficmvo} upstream restart file,
+which already uses the {\tt impamo} unit)\\
+useful if and only if {\tt ivrtex=1}}
+
+
+\minititre{Radiation}
+
+\motcle{ficamr}{c}{string of 13 characters}{\tt rayamo}{O}{L3}
+{name of the radiation upstream restart file.\\
+useful if and only if {\tt isuird = 1}}
+
+\motcle{ficavr}{c}{string of 13 characters}{\tt rayava}{O}{L3}
+{name of the radiation downstream restart file \\
+always useful in case of radiation modeling}
+
+
+\minititre{Thermochemistry}
+
+\motcle{impfpp}{i}{strictly positive integer}{25}{O}{L3}
+{unit of the thermochemical data file\\
+useful in case of gas or pulverised coal combustion or electric arc}
+
+\motcle{ficfpp}{c}{string of 6 characters}{\tt dp\_tch}{O}{L3}
+{name of the thermochemical data file. The launch script is designed to copy the
+user specified thermochemical data file in the temporary execution directory
+under the name \texttt{dp\_tch}, for \CS to open it properly. Should the value
+of FICFPP be changed, the launch script would have to be adapted.\\
+useful in case of gas or pulverised coal combustion}
+
+\motcle{impjnf}{i}{strictly positive integer}{\tt impfpp}{O}{L3}
+{unit of the JANAF data file\\
+useful in case of gas or pulverised coal combustion}
+
+\motcle{ficjnf}{c}{string of 5 characters}{\tt JANAF}{O}{L3}
+{name of the JANAF data file. The launch script is designed to copy the
+user specified JANAF data file in the temporary execution directory
+under the name \texttt{JANAF}, for \CS to open it properly. Should the value
+of {\tt ficjnf} be changed, the launch script would have to be adapted.\\
+useful in case of gas or pulverised coal combustion}
+
+\minititre{Lagrangian}
+
+\motcle{ficaml}{c}{string of 6 characters}{\tt lagamo}{O}{L3}
+{name of the upstream restart file in case of Lagrangian modeling.\\
+useful if and only if {\tt isuila = 1}}
+
+\motcle{ficmls}{c}{string of 13 characters}{\tt lasamo}{O}{L3}
+{name of the upstream restart file for the statistics in case of
+Lagrangian modeling.\\
+useful if and only if {\tt isuist = 1}}
+
+\motcle{ficavl}{c}{string of 13 characters}{\tt lagava}{O}{L3}
+{name of the downstream restart file in case of Lagrangian modeling\\
+always useful in case of Lagrangian modeling}
+
+\motcle{ficvls}{c}{string of 6 characters}{\tt lasava}{O}{L3}
+{name of the downstream restart file for the statistics in case of
+Lagrangian modeling\\
+useful in case of Lagrangian modeling with statistics}
+
+\motcle{impla1}{i}{strictly positive integer}{50}{O}{L3}
+{unit of a file specific to Lagrangian modeling\\
+useful in case of Lagrangian modeling}
+
+\motcle{impla2}{i}{strictly positive integer}{51}{O}{L3}
+{unit of a file specific to Lagrangian modeling\\
+useful in case of Lagrangian modeling}
+
+\motcle{impla3}{i}{strictly positive integer}{52}{O}{L3}
+{unit of a file specific to Lagrangian modeling\\
+useful in case of Lagrangian modeling}
+
+\motcle{impla4}{i}{strictly positive integer}{53}{O}{L3}
+{unit of a file specific to Lagrangian modeling\\
+useful in case of Lagrangian modeling}
+
+\motcle{impla5}{ia}{strictly positive integer}{54 to 68}{O}{L3}
+{units of files specific Lagrangian modeling, 15-dimension array\\
+useful in case of Lagrangian modeling}
+
+
+%==================================
+\subsubsection{Post-processing for {\em EnSight} or other tools}
+%==================================
+
+\minititre{Notes}
+$\bullet\quad$The format depends on the user choices.\\
+$\bullet\quad$The post-processing files, directly generated by the Kernel
+through the FVM library, can be of the following formats: {\em Ensight Gold},
+{\em MED\_fichier} or {\em CGNS}. The use of the two latter formats depends on
+the installation of the corresponding external libraries.\\
+$\bullet\quad$For each quantity (problem unknow, preselected numerical
+variable or preselected physical parameter), the user specifies if a
+post-processing output is wanted. The output frequency can be set.\\
+
+
+\motcle{ichrvl}{i}{0 or 1}{1}{O}{L3}
+{indicates whether post-processing outputs are wanted (=1) or not (=0)
+on the 3D volume mesh\\
+always useful}
+
+\motcle{ichrbo}{i}{0 or 1}{0}{O}{L2}
+{indicates whether post-processing outputs are wanted (=1) or not (=0)
+on the 2D boundary mesh\\
+always useful}
+
+ \motcle{ichrsy}{i}{0 or 1}{0}{O}{L2}
+ {indicates whether post-processing outputs are wanted (=1) or not (=0)
+ on the 2D boundary mesh patches coupled with the \syrthes conjugate
+ heat trabsfer code\\
+ always useful}
+
+ \motcle{ichrmd}{i}{0, 1, 2, 10, 11 or 12}{0}{O}{L2}
+ {indicates whether the post-processing geometry varies with time:\\
+ \hspace*{1.3cm}= 0: time independent\\
+ \hspace*{1.3cm}= 1: deforming or moving mesh\\
+ \hspace*{1.3cm}= 2: changing vertex coordinates and topology\\
+ \hspace*{1.3cm}= 10: time independent base, with time dependent nodal displacement field\\
+ \hspace*{1.3cm}= 11: deforming or moving mesh, plus nodal displacement field\\
+ \hspace*{1.3cm}= 12: changing vertex coordinates and topology, plus nodal displacement field}
+
+ \motcleb{fmtchr}{c}{string of less than 32 characters}{Ensight Gold}{O}{L1}
+ {name of the output format, among the following:\\
+ \hspace*{1.3cm}$\bullet\quad$ ``Ensight Gold''\\
+ \hspace*{1.3cm}$\bullet\quad$ ``MED\_fichier'' (if available)\\
+ \hspace*{1.3cm}$\bullet\quad$ ``CGNS'' (if available)}
+
+ \motcle{optchr}{c}{string of less than 96 characters}{binary}{O}{L2}
+ {options associated to the selected output format. The string is given as a
+ series of key words, separated by a comma (and optional spaces). The key words
+ are among the following:\\
+ \hspace*{1.3cm}$\bullet\quad${\em text} for a text format (for {\em EnSight})\\
+ \hspace*{1.3cm}$\bullet\quad${\em binary} for a binary format (default choice)\\
+ \hspace*{1.3cm}$\bullet\quad${\em big\_endian} to force outputs to be in {\em big-endian}
+ mode; this can be useful when using {\em ParaView}, which uses this mode by default.\\
+ \hspace*{1.3cm}$\bullet\quad${\em discard\_polygons} to prevent from exporting faces with more
+ than four edges (which may not be recognised by some post-processing tools); such
+ faces will therefore appear as ``holes'' in the post-processing mesh.\\
+ \hspace*{1.3cm}$\bullet\quad${\em discard\_polyhedra} to prevent from exporting elements which
+ are neither tetrahedra, prisms, pyramids nor hexahedra (which may not be recognised by
+ some post-processing tools); such elements will therefore appear as ``holes'' in
+ the post-processing mesh\\
+ \hspace*{1.3cm}$\bullet\quad${\em divide\_polygons} to divide faces with more than four edges
+ into triangles, so that any post-processing tool can recognise them\\
+ \hspace*{1.3cm}$\bullet\quad${\em divide\_polyhedra} to divide elements which are neither
+ tetrahedra, prisms, pyramids nor hexahedra into simpler elements (tetrahedra and
+ pyramids), so that any post-processing tool can recognise them\\
+ \hspace*{1.3cm}$\bullet\quad${\em split\_tensors} to export the components of a tensor
+ variable as a series of independent variables (always the case for now)}
+
+
+\motcleb{ntchr}{i}{-1 or strictly positive integer}{-1}{O}{L1}
+{output period for the post-processing\\
+\hspace*{1.3cm}= -1: only at the end of the calculation\\
+\hspace*{1.3cm}$>$ 0: period (every {\tt ntchr} time step)\\
+always useful}
+
+\motcleb{ichrvr}{ia}{-999, 0 or 1}{-999}{O}{L1}
+{for each quantity defined at the cell centers (physical or numerical
+variable), indicator of whether it should be post-processed or not \\
+\hspace*{1.3cm}= -999: not initialised. By default, the post-processed
+quantities are the unknowns (pressure, velocity, $k$, $\varepsilon$,
+$R_{ij}$, $\omega$, $\varphi$, $\overline{f}$, scalars), the density,
+the turbulent viscosity and the time step if is not uniform\\
+\hspace*{1.3cm}= 0: not post-processed\\
+\hspace*{1.3cm}= 1: post-processed\\
+useful if and only if the variable is defined at the cell centers:
+calculation variable, physical property (time step, density,
+viscosity, specific heat) or turbulent viscosity if {\tt iturb(iphas)}
+$\geqslant$ 10}
+
+\motcleb{ipstdv}{i}{integer $\geqslant 1$: see below}
+{{\tt ipstyp*ipstcl*ipstft}}{O}{L1}
+{indicates the data to post-process on the boundary mesh (the boundary mesh must
+have been activated with {\tt ichrbo=1}). The value of {\tt ipstdv} is
+the product of the following integers, depending on the variables that should be
+post-processed:\\
+\hspace*{1.3cm}{\tt ipstyp}\index{ipstyp}: $y^+$ at the boundary\\
+\hspace*{1.3cm}{\tt ipstcl}\index{ipstcl}: value of the variables at the
+boundary (using the boundary conditions but without reconstruction)\\
+\hspace*{1.3cm}{\tt ipstft}\index{ipstft}: thermal flux at the boundary
+($W\,m^{-2}$), if a thermal scalar has been defined ({\tt iscalt})\\
+For instance, with {\tt ipstdv=ipstyp*ipstcl}, $y^+$ and the variables will be
+post-processed at the boundaries.\\
+With {\tt ipstdv=1}, none of these data are post-processed at the boundaries.\\
+always useful if {\tt ichrbo=1}}
+
+%==================================
+\subsubsection{Chronological records of the variables on specific points}
+%==================================
+
+\minititre{Standard use through Interface or \texttt{usini1}}
+For each quantity (problem unknown, preselected numerical variable or
+preselected physical parameter), the user indicates whether chronological records
+should be generated, the output period and the position of the
+probes. The code produces chronological records at the cell centers located
+closest to the geometric points defined by the user by means of their
+coordinates. For each quantity, the number of probes and their
+index-numbers must be specified (it is not mandatory to generate all
+the variables at all the probes).
+
+
+\motcleb{NCAPT}{I}{positive or null integer}{0}{O}{L1}
+{total number of probes (limited to NCAPTM=100)\\
+always useful }
+
+\motcleb{XYZCAP}{RA}{real numbers}{0.D0}{O}{L1}
+{3D-coordinates of the probes\\
+the coordinates are written: XYZCAP(I,J), with I = 1, 2 or 3 and J
+$\leqslant$ NCAPT\\
+useful if and only if NCAPT $>$ 0}
+
+\motcleb{IHISVR}{IA}{-999, -1 or positive or null integer}{-999}{O}{L1}
+{number IHISVR(N, 1) and index-numbers IHISVR(N, J$>$1) of the record
+probes to be used for each variable, {\em i.e.} calculation variable
+or physical property defined at the cell centers.
+With IHISVR(N, 1)=-999 or -1, IHISVR(N, J$>$1) is useless.\\
+\hspace*{.5cm} $\bullet$ IHISVR(N, 1): number of record probes to use
+for the variable N\\
+\hspace*{1.3cm}= -999: by default: chronogical records are generated on
+all the probes if N is one of the main variables (pressure, velocity,
+turbulence, scalars), the local time step or the turbulent
+viscosity. For the other quantities, no chronological record is generated.\\
+\hspace*{1.3cm}= -1: chronological records are produced on all the probes\\
+\hspace*{1.3cm}= 0: no chronological record on any probe\\
+\hspace*{1.3cm}$>0$: chronological record on IHISVR(N, 1) probes to be specified
+with IHISVR(N, J$>$1)\\
+always useful, must be inferior or equal to NCAPT\\
+\hspace*{.5cm} $\bullet$ IHISVR(N, J$>$1): index-numbers of the probes
+used for the variable N\\
+(with J$\leqslant$IHISVR(N,1)+1)\\
+\hspace*{1.3cm}= -999: by default: if IHISVR(N, 1) $\ne$
+-999, the code stops. Otherwise, refer to the description of the case
+IHISVR(N, 1)=-999\\
+useful if and only if IHISVR(N, 1) $>$ 0 \\
+The condition IHISVR(N, J) $\leqslant$NCAPT must be respected.\\
+For an easier use, it is recommended to simply specify IHISVR(N,1)=-1 for
+all the interesting variables.}
+
+\motcle{IMPHIS}{IA}{strictly positive integer}{30 and 31}{O}{L3}
+{working units for the production of chronological record files by the Kernel\\
+useful if and only if chronological files are produced ({\em i.e.} there
+is N for which IHISVR(N, 1) $\ne$ 0)}
+
+\motcle{EMPHIS}{C}{string of less than 80 characters}{\tt ./}{O}{L3}
+{directory in which the potential chronological record files generated by
+the Kernel will be written (path related to the execution directory)\\
+it is recommended to keep the default value and, if necessary, to modify the
+launch script to copy the files in the alternate destination directory\\
+useful if and only if chronological record files are generated ({\em
+i.e.} there is N for which IHISVR(N, 1) $\ne$ 0)}
+
+\motcle{EXTHIS}{C}{string of less than 80 characters}{hst}{O}{L3}
+{extension of the chronological record files\\
+useful if and only if chronological record files are generated ({\em
+i.e.} there is N for which IHISVR(N, 1) $\ne$ 0)}
+
+\motcleb{NTHIST}{I}{-1 or strictly positive integer}{1 or -1}{O}{L1}
+{output period of the chronological record files\\
+\hspace*{1.3cm}= -1: no output\\
+\hspace*{1.3cm}$>$ 0: period (every NTHIST time step)\\
+The default value is -1 if there is no chronological record file to
+generate (if there is no probe, NCAPT = 0, or if IHISVR(N, 1)=0 for
+all the variables) and 1 otherwise\\
+If chronological records are generated, it is usually wise to keep the default
+value NTHIST=1, in order to avoid missing any high frequency evolution (unless
+the total number of time steps is much too big)\\
+useful if and only if chronological record files are generated ({\em
+i.e.} there are probes (NCAPT$>$0) there is N for which IHISVR(N, 1)
+$\ne$ 0)}
+
+\motcle{NTHSAV}{I}{-1 or positive or null integer}{0}{O}{L3}
+{saving period the chronological record files (they are first stored in a
+temporary file and then saved every NTHSAV time step)\\
+\hspace*{1.3cm}= 0: by default (4 times during a calculation)\\
+\hspace*{1.3cm}= -1: saving at the end of the calculation\\
+\hspace*{1.3cm}$>$ 0: period (every NTHSAV time step)\\
+During the calculation, the user can read the chronological record files
+in the execution directory when they have been saved, {\em i.e.} at the first
+time step, at the tenth time step and when the time step number is a multiple of
+NTHSAV (multiple of (NTMABS-NTPABS)/4 if NTHSAV=0)\\
+{\em Note: using the \texttt{ficstp} file allows to update the value of
+NTMABS. Hence, if the calculation is at the time step n, the saving of the
+chronological record files can be forced by changing NTMABS to NTPABS+4(n+1)
+using \texttt{ficstp}; after the files have been saved, NTMABS can be put back
+to its original value, still using \texttt{ficstp}.}\\
+useful if and only if chronological record files are generated ({\em
+i.e.} there are probes (NCAPT$>$0) there is N for which IHISVR(N, 1)
+$\ne$ 0)}
+
+\minititre{Non-standard use through \texttt{ushist}}
+(see p.\pageref{prg_ushist})
+
+\motcle{IMPUSH}{IA}{strictly positive integer}{\tt 33 to 32+NUSHMX=49}{O}{L3}
+{units of the user chronological record files\\
+useful if and only if the subroutine \texttt{ushist} is used}
+
+\motcle{FICUSH}{CA}{strings of 13 characters}{\texttt{ush*} or
+\texttt{ush*.n\_*}}{O}{L2}
+{names of the user chronological record files.
+In the case of a non-parallel calculation, the suffix applied the file
+name is a three digit number: \texttt{ush001}, \texttt{ush002},
+\texttt{ush003}...
+In the case of a parallel-running calculation, the processor
+index-number is added to the suffix. For instance, for a calculation
+running on two processors: \texttt{ush001.n\_0001},
+\texttt{ush002.n\_0001}, \texttt{ush003.n\_0001}... and
+\texttt{ush001.n\_0002},
+\texttt{ush002.n\_0002}, \texttt{ush003.n\_0002}...
+The opening, closing, format and location of these files must be managed
+by the user.\\
+useful if and only if the subroutine \texttt{ushist} is used}
+
+
+%==================================
+\subsubsection{Time averages}
+%==================================
+
+The code allows the calculation of time averages of the type
+$<f_1*f_2...*f_n>$. The variables $f_i$ (defined at the cell centers)
+which may be taken into account are the followings:
+\begin{list}{-}{}
+\item the solved calculation variables (velocity, pressure ...),
+\item the auxiliary variables from the array PROPCE (density and
+ physical properties when they are variable in space).
+\end{list}
+
+The averages are treated like auxiliary variables defined at the cell
+centers and stored in the PROPCE array. The standard post-processing
+actions may therefore be activated, like the writing in the listing or
+the output of result files (EnSight, MED, ...). However, if the user
+wants to manipulate the averages in a more advanced way, it is
+recommended to refer first to the user subroutines \texttt{usproj} and
+\texttt{usvpst} which provide examples. Indeed, the PROPCE array
+does not contain the time averages directly, but only the cumulated value
+of the product $f_1*f_2...*f_n$ of the selected
+variables $f_i$. The division by the cumulated duration is done only
+before the writing of the results. See also page \pageref{prg_moyennes}.
+
+To calculate $p$ time averages of the type $<f_1*f_2...*f_{n(IMOM)}>$,
+the user must:
+\begin{list}{-}{}
+\item make sure that $p\leqslant$NBMOMX (do not overstep the maximum
+ number of averages),
+\item make sure that $n(IMOM)\leqslant$NDGMOX for every average IMOM
+ (do not overstep the maximum degree, {\it i.e} the maximum number
+ of variables which may compose an average),
+\item define every average IMOM (1$\leqslant$IMOM$\leqslant p$, without
+ skipping any index-number) by marking out the $n(IMOM)$ variables
+ which form it by means of the array IDFMOM(II,IMOM) (with
+ 1$\leqslant$II$\leqslant$n(IMOM)),
+\item define for each average IMOM the time step number at which the
+ calculation of the cumulated value must begin, by means of the
+ array NTDMOM(IMOM).
+\end{list}
+
+The total number of averages ($p$=NBMOMT) is automatically determined by
+the code from the values of IDTMOM. The user must not specify specify it.
+
+\motcleb{IDFMOM}{IA}{0, $\pm$ variable index-number}{0}{O}{L1}
+{Index-number of the variables composing a time average of the type
+$<f_1*f_2...*f_n>$. For every time average IMOM to calculate:\\
+\hspace*{1.3cm} - if IDFMOM(II,IMOM) is positive, it refers to the
+ index-number of a solved variable (stored in the array
+ RTP), like for instance a velocity component
+ (IU(IPHAS), IV(IPHAS), IW(IPHAS)) or the pressure
+ (IPR(IPHAS))\\
+\hspace*{1.3cm} - if IDFMOM(II,IMOM) is negative, it refers to the
+ index-number of an auxiliary variable (stored in
+ PROPCE), like for instance the density
+ (IDFMOM(II,IMOM)=-IROM(IPHAS))\\
+useful if and only if the user wants to calculate time averages}
+
+\motcleb{NTDMOM}{IA}{integer}{-1}{O}{L1}
+{For every average IMOM to calculate, absolute time step number at which
+the calculation should begin. The value -1 means ``never''. Every
+strictly negative value (in particular -1) will considered an error and
+cause the calculation to stop (because the user is supposed to want to
+calculate the averages he has defined)\\
+useful if and only if the user wants to calculate time averages}
+
+\motcleb{IMOOLD}{IA}{-2, 1$\leqslant$ integer $\leqslant$ JBMOMT}{-2}{O}{L1}
+{Correspondence table of the averages in the case of a calculation
+restart. In this case, for every average IMOM in the current
+calculation (1$\leqslant$IMOM$\leqslant$NBMOMX), IMOOLD(IMOM) gives the
+index-number of the corresponding average in the previous calculation
+(in which JBMOMT averages were calculated). \\
+\hspace*{1.3cm} - if IMOOLD(IMOM) = -2, the user lets the code automatically
+ determine the
+ correspondence. By default, the average II in the
+ current calculation will correspond to the average II in
+ the previous calculation, if it existed.
+ Otherwise, II will be a new average.\\
+\hspace*{1.3cm} - if IMOOLD(IMOM) = -1, the average is reset to zero.\\
+\hspace*{1.3cm} - if IMOOLD(IMOM) = KK, the average IMOM will correspond
+to the average KK=IMOOLD(IMOM) in the previous calculation.\\
+useful if and only if the user wants to calculate averages.
+Allows to add or suppress some averages, to reset them, to change their
+order, ...\\
+{\em Warning : if the calculation is not a restart, IMOOLD must not be
+specified (its value must remain -2)}}
+
+%==================================
+\subsubsection{Others}
+%==================================
+
+\motcle{IMPUSR}{IA}{strictly positive integer}{\tt 70 to 69+NUSRMX=79}{O}{L3}
+{unit numbers for potential user specified files\\
+useful if and only if the user needs files (therefore always useful, by security)}
+
+\motcleb{FICUSR}{CA}{string of 13 characters}{\tt usrf* or usrf*.n\_*}{O}{L1}
+{name of the potential user specified files. In the case of a non-parallel
+calculation, the suffix applied the file name is a two digit number:
+from \texttt{usrf01} to \texttt{usrf10}. In the case of a
+parallel-running calculation, the four digit processor index-number is
+added to the suffix. For instance, for a calculation running on two
+processors: from \texttt{usrf01.n\_0001} to \texttt{usrf10.n\_0001} and
+from \texttt{usrf01.n\_0002} to \texttt{usrf10.n\_0002}. The opening,
+closing, format and location of these files must be managed by the user.\\
+useful if and only if the user needs files (therefore always useful, by security)}
+
+\motcleb{ILISVR}{IA}{-999, 1 or 0}{-999}{O}{L1}
+{for every quantity (variable, physical or numerical property ...),
+indicator concerning the writing in the execution report file \\
+\hspace*{1.3cm}= -999: automatically converted into 1 if the concerned
+quantity is one of the main variables (pressure, velocity, turbulence,
+scalar), the density, the time step if IDTVAR $\ne$ 0 or the turbulent
+viscosity. Otherwise converted into 0.\\
+\hspace*{1.3cm}= 1: writing in the execution listing.\\
+\hspace*{1.3cm}= 0: no writing.\\
+always useful}
+
+\motcleb{IWARNI}{IA}{integer}{0}{O}{L1}
+{IWARNI(IVAR) characterises the level of detail of the outputs for the
+variable IVAR (from 1 to NVAR). The quantity of information increases with
+its value.\\
+Impose the value 0 or 1 for a reasonable listing size. Impose the value 2
+to get a maximum quantity of information, in case of problem during the
+execution.\\
+always useful}
+
+\motcleb{NOMVAR}{CA}{string of less than 80 characters}{``''}{O}{L1}
+{name of the variables (unknowns, physical properties ...): used in the
+execution listing, in the post-processing files, etc.\\
+{``''}: not initialised (the code chooses the manes by default)\\
+It is recommended not to define variable names of more than 8
+characters, to get a clear execution listing (some advanced writing
+levels take into account only the first 8 characters).\\
+always useful}
+
+\motcleb{NTLIST}{I}{-1 or strictly positive integer}{1}{O}{L1}
+{writing period in the execution report file\\
+\hspace*{1.3cm}= -1: no writing\\
+\hspace*{1.3cm}$>$ 0: period (every NTLIST time step)\\
+The value of NTLIST must be adapted according to the number of iterations
+carried out in the calculation. Keeping NTLIST to 1 will indeed provide
+a maximum volume of information, but if the number of time steps is too large,
+the execution report file might become too big and unusable
+(problems with disk space, memory problems while opening the file with a text
+editor, problems finding the desired information in the file, ...).\\
+always useful}
+
+\motcle{NTSUIT}{I}{-1, 0 or positive or null integer}{0}{O}{L3}
+{saving period of the restart files\\
+\hspace*{1.3cm}= -1: only at the end of the calculation\\
+\hspace*{1.3cm}= 0: by default (four times during the calculation)\\
+\hspace*{1.3cm}$>$ 0: period\\
+always useful}
+
+
+%==================================
+\subsection{Numerical options}
+%==================================
+\subsubsection{Calculation management}
+%==================================
+
+\motcle{IECAUX}{I}{0 or 1}{1}{O}{L2}
+{indicates the writing (=1) or not (=0) of the auxiliary calculation
+restart file\\
+always useful}
+
+\motcle{ILEAUX}{I}{0 or 1}{1}{O}{L2}
+{indicates the reading (=1) or not (=0) of the auxiliary
+calculation restart file\\
+useful if and only if ISUITE=1}
+
+\motcleb{INPDT0}{I}{0 or 1}{0}{O}{L1}
+{indicates the calculation mode: 1 for a zero time step control
+calculation, {\em i.e.} without solving the transport equations,
+and 0 for a standard calculation.\\
+In case of a calculation using the control mode (INPDT0=1), when the
+calculation is not a restart, the equations are not solved, but the
+physical properties and the boundary conditions are calculated. When
+the calculation is a restart, the physical properties and the boundary
+conditions are those read from the restart file (note: in the case of a
+second-order time scheme, the mass flow is modified as if a normal
+time step was realised: the mass flow generated in an potential
+post-processing is therefore not the mass flow read from the restart file).\\
+In the control mode (INPDT0=1), the variable NTMABS is not used.\\
+In the standard mode (INPDT0=0), the code solves the equations at least
+once, even if NTMABS=0.\\
+always useful}
+
+\motcleb{ISUITE}{I}{0 or 1}{0}{C}{L1}
+{indicator of a calculation restart (=1) or not (=0)\\
+always useful}
+
+\motcle{NTCABS}{I}{integer}{\tt NTPABS}{O}{L3}
+{current time step number\\
+always useful\\
+NTCABS is initialised and updated automatically by the code, its value is not to
+be modified by the user}
+
+\motcleb{NTMABS}{I}{integer $>$ NTPABS}{10}{C}{L1}
+{number of the last time step after which the calculation stops. It is
+an absolute number: for the restart calculations, NTMABS takes into
+account the number of time steps of the previous calculations. For
+instance, after a first calculation of 3 time steps, a restart file of 2
+time steps is realised by setting NTMABS=3+2=5\\
+always useful}
+
+\motcle{NTPABS}{I}{integer}{0, read}{O}{L3}
+{number of the last time step in the previous calculation. In the case of
+a restart calculation, NTPABS is read from the restart file. Otherwhise
+it is initialised to 0\\
+always useful\\
+NTPABS is initialised automatically by the code, its value is not to
+be modified by the user}
+
+\motcle{TMARUS}{R}{-1D0 or strictly positive real}{-1D0}{O}{L3}
+{margin in seconds on the remaining CPU time which is necessary to allow
+the calculation to stop automatically and write all the required results
+(for the machines having a queue manager)\\
+\hspace*{1.3cm}= -1: calculated automatically\\
+\hspace*{1.3cm}$>$ 0: margin defined by the user\\
+always useful, but the default value should not be changed
+unless absolutely necessary.}
+
+
+\motcle{TTCABS}{R}{positive or null real number}{\tt TTPABS}{O}{L3}
+{physical simulation time at the current time step. For the restart
+calculations, \mbox{TTCABS} takes into account the physical time of the
+previous calculations.\\
+If the time step is uniform (IDTVAR=0 or 1), TTCABS increases of DT (value of
+the time step) at each iteration. If the time step is non-uniform (IDTVAR=2),
+TTCABS increases of DTREF at each time step.\\
+always useful\\
+TTCABS is initialised and updated automatically by the code, its value is not to
+be modified by the user}
+
+\motcle{TTPABS}{R}{positive or null real number}{0, read}{O}{L3}
+{simulation physical time at the last time step of the previous
+calculation. In the case of a restart calculation, TTPABS is read from
+the restart file. Otherwhise it is initialised to 0.\\
+always useful\\
+TTCABS is initialised automatically by the code, its value is not to
+be modified by the user}
+
+%==================================
+\subsubsection{Scalar unknowns}
+%==================================
+
+
+\motcleb{ISCOLD}{IA}{-999, 1$\leqslant$ integer $\leqslant$ JSCAL}{-999}{O}{L1}
+{correspondence table of the scalars in the case of a calculation
+restart. For a calculation restart with NSCAL scalars, ISCOLD(ISCAL)
+gives, for every scalar ISCAL of the current calculation
+(1$\leqslant$ISCAL$\leqslant$NSCAL), the index-number of the
+corresponding scalar in the previous calculation (in which JSCAL scalars were
+taken into account).\\
+\hspace*{1.3cm} ISCOLD(ISCAL) = -999: the code automatically determines the
+correspondence. By default, the following rules are applied:\\
+\hspace*{2.cm} - the user scalar II of the current calculation is
+initialised by the the user scalar II of the previous calculation, if
+this scalar existed already (otherwise, II is a new scalar).\\
+\hspace*{2.cm} - the particular physics scalar JJ is initialised by
+the particular physics scalar JJ of the previous calculation if this
+scalar existed already (otherwise, JJ is a new scalar).\\
+\hspace*{1.3cm} ISCOLD(ISCAL) = KK: the scalar ISCAL (user or particular
+physics scalar) is initialised by the scalar KK=ISCOLD(ISCAL) of the
+previous calculation.\\
+always useful. Allows to add or remove some scalars, to change the
+solving order, to change the physics, ...}
+
+\motcleb{NSCAUS}{I}{0$\leqslant$ integer $\leqslant$ NSCMAX}{0}{O}{L1}
+{number of user scalars solutions of an advection equation\\
+always useful}
+
+\motcleb{ISCAVR}{IA}{0, 1 $\leqslant$ integer $\leqslant$ NSCAL}{0}{O}{L1}
+{if the scalar ISCAL is the average of the square of the fluctuations of a
+scalar KK, then \mbox{ISCAVR(ISCAL)=KK}.
+Otherwise ISCAVR(ISCAL)=0. For ISCAL and KK, the user can only use index-numbers
+refering to user scalars ($\leqslant$ NSCAUS). \\
+always useful}
+
+\motcle{IPHSCA}{IA}{1 $\leqslant$ integer $\leqslant$ NPHAS}{0}{O}{L3}
+{for every scalar ISCAL, IPHSCA(ISCAL) is the index-number of the
+associated phase\\
+always useful}
+
+\motcleb{ISCALT}{IA}{-1 or integer $>$ 0}{-1}{O}{L1}
+{for every phase IPHAS, ISCALT(IPHAS) is the index-number of the scalar
+representing the temperature or the enthalpy. If ISCALT(IPHAS)=-1, no
+scalar represents the temperature nor the enthalpy. When a specific
+physics module is activated (gas combustion, pulverised coal,
+electricity or compressible),
+the user must not modify ISCALT (the choice is made
+automatically)\footnote{in the case of the compressible module, ISCALT does not
+correspond to the temperature nor enthalpy but to the total energy}.\\
+useful if and only if NSCAL $\geqslant$ 1}
+
+\motcleb{ISCSTH}{IA}{-1, 0, 1, 2 or 3}{-10}{O}{L1}
+{type of scalar\\
+\hspace*{1.3cm}= -10: not specified. By default, the code chooses
+ISCSTH(ISCAL)=0 for the scalars apart from ISCALT(IPHAS)\\
+\hspace*{1.3cm}= -1: temperature in degrees Celsius (use only in case of
+radiation modeling)\\
+\hspace*{1.3cm}= 0: passive scalar\\
+\hspace*{1.3cm}= 1: temperature (in Kelvin if the radiation modeling is
+activated)\\
+\hspace*{1.3cm}= 2: enthalpy\\
+\hspace*{1.3cm}= 3: total energy (this value is automatically chosen by the code
+when using the compressible module, it must never be used otherwise and must
+never be specified by the user)\\
+useful if and only if NSCAL $\geqslant$ 1. The distinction between
+ISCSTH(ISCAL) = -1 or 1 (respectively degrees Celsius or Kelvin) is
+useful only in case of radiation modeling. For calculations without
+radiation modeling, use ISCSTH(ISCAL)=1 for the temperature. When a
+particular physics module is activated (gas combustion, pulverised coal,
+electricity or compressible), the user must not modify ISCSTH (the choice is made
+automatically: the solved variable is the enthalpy or the total energy).\\
+It is also reminded that, in the case of a coupling with
+\syrthes, the solved thermal variable should be the temperature
+(ISCSTH(ISCALT(IPHAS))=1 or -1).
+More precisely, everything is designed in the code to allow for the
+running of a calculation coupled with \syrthes with the enthalpy as thermal
+variable (the correspondence and conversion is then specified by the user in
+the subroutine \texttt{usthht}).
+However this case has never been used in practice and has therefore not been
+tested. With the compressible model, it is possible to carry out calculations
+coupled with \syrthes, although the thermal scalar represents the total
+energy and not the temperature.}
+
+\motcle{ICLVFL}{IA}{-1, 0, 1 or 2}{-1}{O}{L3}
+{for every scalar ISCAL representing the average of the square of the
+fluctuations of another scalar II=ISCAVR(ISCAL) (noted $f$),
+indicator of the clipping method\\
+\hspace*{1.3cm}= -1: no clipping because the scalar does not represent
+the average of the square of the fluctuations of another scalar\\
+\hspace*{1.3cm}= 0: clipping to 0 for lower values\\
+\hspace*{1.3cm}= 1: clipping to 0 for lower values and to
+\mbox{$(f-f_{min})(f_{max}-f)$} for higher values, where $f$ is
+the associated scalar, $f_{min}$ and $f_{max}$ its minimum and maximum
+values specified by the user ({\em i.e.} SCAMIN(II) and SCAMAX(II)) \\
+\hspace*{1.3cm}= 2: clipping to MAX(0,SCAMIN(ISCAL)) for lower
+values and to SCAMAX(ISCAL) for higher values. SCAMIN and SCAMAX
+are limits specified by the user\\
+useful for the scalars ISCAL for which ISCAVR(ISCAL)$>$0.}
+
+\motcle{ITBRRB}{I}{0 or 1}{0}{O}{L3}
+{Reconstruction (=1) or not (=0) of the temperature, enthalpy or total energy
+value in the boundary cells. Useful in the case of coupling with \syrthes
+and with radiation.}
+
+\motcle {ICPSYR}{TI}{-999,0,1}{-999}{O}{L3}
+{For each scalar ISCAL, ICPSYR(ISCAL) indicates if it is
+coupled with \syrthes (=1) or not (=0).
+There can be only one coupled scalar per calculation.\\
+\hspace*{1.3cm}=-999: by default\\
+\hspace*{2.cm} $\bullet$ ICPSYR(ISCAL)=1 for the thermal scalar
+ISCAL=(ISCALT(IPHAS)) when a coupling with \syrthes has been specified in the
+Interface or the launch script\\
+\hspace*{2.cm} $\bullet$ ICPSYR(ISCAL)=0 otherwise\\
+\hspace*{1.3cm}= 0: the scalar ISCAL is not coupled with \syrthes\\
+\hspace*{1.3cm}= 1: the scalar ISCAL is coupled with \syrthes\\
+useful in case of coupling with \syrthes}
+
+
+%==================================
+\subsubsection{Definition of the equations}
+%==================================
+
+\motcle{ISTAT}{IA}{0 or 1}{1 or 0}{O}{L2}
+{for each unknown IVAR to calculate, indicates if
+non-stationary terms are present (ISTAT(IVAR)=1) or not (0) in the matrices.\\
+By default, ISTAT is set to 0 for the pressure (variable IVAR=IPR(IPHAS))
+or $\overline{f}$ in v2f modeling (variable IVAR=IFB(IPHAS)) and set to
+1 for the other unknowns.\\
+useful for all the unknowns}
+
+\motcle{ICONV}{IA}{0 or 1}{1 or 0}{O}{L2}
+{for each unknown IVAR to calculate, indicates if the
+convection is taken into account (ICONV(IVAR)=1) or not (0).\\
+By default, ICONV is set to 0 for the pressure (variable IVAR=IPR(IPHAS))
+or $\overline{f}$ in v2f modeling (variable IVAR=IFB(IPHAS)) and set to
+1 for the other unknowns.\\
+useful for all the unknowns}
+
+\motcle{IDIFF}{IA}{0 or 1}{1}{O}{L2}
+{for each unknown IVAR to calculate, indicates if the
+diffusion is taken into account (IDIFF(IVAR)=1) or not (0)\\
+useful for all the unknowns}
+
+\motcle{IDIFFT}{IA}{0 or 1}{1}{O}{L3}
+{for each unknown IVAR to calculate, when diffusion is taken
+into account (IDIFF(IVAR)=1), IDIFFT(IVAR) indicates if the turbulent
+diffusion is taken into account (IDIFFT(IVAR)=1) or not (0)\\
+useful for all the unknowns }
+
+\motcle{IDIRCL}{IA}{0 or 1}{1 or 0}{O}{L3}
+{for each unknown IVAR to calculate, indicates whether the diagonal
+of the matrix should be slightly shifted (IDIRCL(IVAR)=1) or not (0) if there
+is no Dirichlet boundary condition and if ISTAT=0. Indeed, in such a case,
+the matrix for the general advection/diffusion equation is singular. A slight
+shift in the diagonal will make it invertable again.\\
+By default, IDIRCL is set to 1 for all the unknowns, except $\overline{f}$ in
+v2f modeling, since its equation contains another diagonal term that ensures
+the regularity of the matrix.\\
+useful for all the unknowns}
+
+\motcle{IVISSE}{IA}{0 or 1}{1}{O}{L3}
+{for each phase IPHAS, indicates whether the source terms in transposed gradient
+and velocity divergence should be taken into account in the momentum
+equation. In the compressible module, these terms also account for the volume
+viscosity (cf. VISCV0 et IVISCV):\\
+$\partial_i \left[(\kappa -2/3\,(\mu+\mu_t))\partial_k U_k \right]
+ + \partial_j \left[ (\mu+\mu_t)\partial_i U_j \right]$ \\
+\hspace*{1.3cm}= 0: not taken into account\\
+\hspace*{1.3cm}= 1: taken into account\\
+always useful}
+
+
+%==================================
+\subsubsection{Definition of the time advancement}
+%==================================
+
+\motcleb{IDTVAR}{I}{-1, 0, 1, 2}{0}{O}{L1}
+{type of time step\\
+\hspace*{1.3cm}= 0: constant in time and spatially uniform\\
+\hspace*{1.3cm}= 1: variable in time and spatially uniform\\
+\hspace*{1.3cm}= 2: variable in time and in space\\
+\hspace*{1.3cm}= -1: steady-state algorithm\\
+If the numerical scheme is a second-order in time, only the option 0 is
+allowed.\\
+always useful}
+
+\motcle{IPTLRO}{I}{0 or 1}{0}{O}{L2}
+{when density gradients and gravity are present, a local thermal time
+step can be calculated, based on the Brunt-Vaissala frequency. In numerical
+simulations, it is usually wise for the time step to be lower than this limit,
+otherwise numerical instabilities may appear\\
+IPTLRO indicates whether the time step should be limited to the local thermal
+time step (=1) or not (=0)\\
+when IPTLRO=1, the listing shows the number of cells where the time step has
+been clipped due to the thermal criterium, as well as the maximum ratio between
+the time step and the maximum thermal time step. If IDTVAR=0, since the time
+step is fixed and cannot be clipped, this ratio can be larger than
+1\footnote{it is then the user's
+choice to decide whether he should diminish DTREF or not}. When IDTVAR$>$0, this
+ratio will be smaller than 1, except if the constraint DTMIN has prevented the
+code from reaching a sufficiently low value for DT\\
+useful when density gradients and gravity are present}
+
+\motcleb{CDTVAR}{RA}{strictly positive real number}{1.D0}{O}{L1}
+{multiplicative factor applied to the time step for each scalar\\
+Hence, the time step used when solving the evolution equation for the
+variable is the time step used for the dynamic equations (velocity/pressure)
+multiplied by CDTVAR.\\
+The size of the array CDTVAR is NVAR. For instance, the multiplicative
+coefficient applied to the scalar 2 is CDTVAR(ISCA(2))). Yet, the value of CDTVAR
+for the velocity components and the pressure is not used. Also, although it is
+possible to change the value of CDTVAR for the turbulent variables, it is
+highly unrecommended\\
+useful if and only if NSCAL $\geqslant$ 1}
+
+
+\motcle{COUMAX}{R}{strictly positive real number}{1D0}{O}{L1}
+{target local or maximum Courant number in case of non-constant time step\\
+useful if IDTVAR $\ne$ 0}
+
+\motcle{FOUMAX}{R}{strictly positive real number}{10D0}{O}{L1}
+{target local or maximum Fourier number in case of non-constant time step\\
+useful if IDTVAR $\ne$ 0}
+
+\motcleb{DTREF}{R}{strictly positive real number}{\tt -GRAND*10}{C}{L1}
+{reference time step \\
+always useful.\\
+It is the time step value used in the case of a calculation run with a
+uniform and constant time step, {\em i.e.} IDTVAR=0 (restart calculation
+or not). It is the value used to initialise the time step in the case of
+an initial calculation (ISUITE=0) run with a non-constant time step
+(IDTVAR=1 or 2). It is also the value used to initialise the time step
+in the case of a restart calculation (ISUITE=1) in which the type of
+time step has been changed (for instance, IDTVAR=1 in the new
+calculation and IDTVAR=0 or 2 in the previous calculation): see
+\texttt{usiniv}}
+
+\motcle{DTMIN}{R}{positive or null real number}{\tt 0.1D0*DTREF}{O}{L2}
+{lower limit for the calculated time step when non-constant time step is activated\\
+useful if IDTVAR $\ne$ 0}
+
+\motcle{DTMAX}{R}{strictly positive real number}{\tt 1000*DTREF}{O}{L2}
+{upper limit for the calculated time step when non-constant time step is activated\\
+useful if IDTVAR $\ne$ 0}
+
+\motcle{VARRDT}{R}{strictly positive real number}{0.1D0}{O}{L3}
+{maximum allowed relative increase in the calculated time step value
+between two succesive time steps (to ensure stability, any decrease in the time step
+is immediate and without limit)\\
+useful if IDTVAR $\ne$ 0}
+
+
+\minititre{Non-constant time step}
+The calculation of the time step uses a reference time step DTREF (at
+the calculation beginning). Later, every time step, the time step value
+is calculated by taking into account the different existing limits, in
+the following order: \\
+\hspace*{1.cm}$\bullet$ COUMAX, FOUMAX: the more restrictive limit between
+both is used (in the compressible module, the acoustic limitation is added),\\
+\hspace*{1.cm}$\bullet$ VARRDT: progressive increase and immediate
+decrease in the time step,\\
+\hspace*{1.cm}$\bullet$ IPTLRO: limitation by the thermal time step,\\
+\hspace*{1.cm}$\bullet$ DTMAX and DTMIN: clipping of the time step to
+the maximum, then to the minimum limit.\\
+
+
+%==================================
+\subsubsection{Turbulence}
+%==================================
+
+\motcleb{ITURB}{IA}{0, 10, 20, 21, 30, 31, 40, 41, 50 or 60}{-999}{O}{L1}
+{for each phase IPHAS, indicator of the turbulence model ITURB(IPHAS)\\
+\hspace*{1.3cm}= -999: not initalised. This value is not allowed and
+must be modified by the user\\
+\hspace*{1.3cm}= 0: laminar\\
+\hspace*{1.3cm}= 10: mixing length (not valided)\\
+\hspace*{1.3cm}= 20: $k-\varepsilon$\\
+\hspace*{1.3cm}= 21: $k-\varepsilon$ with linear production (Laurence \& Guimet)\\
+\hspace*{1.3cm}= 30: $R_{ij}-\varepsilon$ ``standard'' LRR (Launder, Reece \& Rodi)\\
+\hspace*{1.3cm}= 31: $R_{ij}-\varepsilon$ SSG (Speziale, Sarkar \& Gatski)\\
+\hspace*{1.3cm}= 40: LES (Smagorinsky model) \\
+\hspace*{1.3cm}= 41: LES (dynamic model) \\
+\hspace*{1.3cm}= 50: v2-f, $\varphi$-model version\\
+\hspace*{1.3cm}= 60: $k-\omega$, SST version \\
+always useful}
+
+The $k-\varepsilon$ (standard and linear production) and $R_{ij}-\varepsilon$
+(LRR and SSG) turbulence
+models implemented in \CS are ``High-Reynolds'' models. It is therefore
+necessary to make sure that the thickness of the first cell neighboring
+the wall is larger than the thickness of the viscous sublayer (at the
+wall, $y^+>2.5$ is required as a minimum, and preferably between 30 and
+100)\footnote{While creating the mesh, $y^+=\frac{yu*}{\nu}$ is
+generally unknown. It can be roughly estimated as $\frac{yU}{10\nu}$, where
+$U$ is the characteristic velocity, $\nu$ is the kinematic viscosity of the fluid
+ and $y$ is the mid-height of the first cell near the wall.}. If the mesh does
+ not respect this condition, the results may be biased
+(particularly if thermal processes are involved). Using scalable wall-functions
+(cf. key word IDEUCH) may help avoiding this problem.\\
+The v2-f model is a ``Low-Reynolds'' model, it is therefore necessary to
+make sure that the thickness of the first cell neighboring the wall is
+smaller than the thickness of the viscous sublayer ($y^+<1$).\\
+The $k-\omega$ SST model provides correct results whatever the thickness of the first cell.
+Yet, it requires the knowledge of the distance to the wall in every
+cell of the calculation domain. The user may refer to the key word
+ICDPAR\index{ICDPAR} for more details about the potential limitations.\\
+The $k-\varepsilon$ model with linear production allows to correct the
+known flaw of the standard $k-\varepsilon$ model which overestimates the
+turbulence level in case of strong velocity gradients (stopping point).\\
+With LES, the wall functions are usually not greatly adapted. It is generally more advisable
+(if possible) to refine the mesh towards the wall so that the first cell is in the
+viscous sublayer, where the boundary conditions are simple natural no-slip conditions.\\
+Concerning the LES model, the user may refer to the subroutine
+\texttt{ussmag} for complements about the dynamic model. Its usage
+and the interpretation of its results require particular attention.
+In addition, the user must pay further attention when using the dynamic
+model with the least squares method based on a partial extended
+neighborhood (IMRGRA=3). Indeed, the results may be degraded if the user
+does not implement his own way of averaging the dynamic constant in
+\texttt{ussmag} (\textit{i.e.} if the user keeps the local average based
+on the extended neighborhood).\\
+
+\motcle{IDEUCH}{IA}{0, 1 or 2}{0 or 1}{O}{L2}
+{for each phase IPHAS, indicates the type of wall function is used for the velocity
+boundary conditions on a frictional wall.\\
+\hspace*{1.3cm}= 0: one-scale model\\
+\hspace*{1.3cm}= 1: two-scale model\\
+\hspace*{1.3cm}= 2: scalable wall function\\
+IDEUCH is initialised to 0 for ITURB(IPHAS)=0, 10, 40 or 41 (laminar,
+mixing length, LES).\\
+IDEUCH is initialised to 1 for ITURB(IPHAS)=20, 21, 30, 31 or 60
+($k-\varepsilon$, $R_{ij}-\varepsilon$ LRR, $R_{ij}-\varepsilon$ SSG and
+$k-\omega$ SST models).\\
+The v2f model (ITURB(IPHAS)=50) is not designed to use wall functions
+(the mesh must be ``low Reynolds'').\\
+The value IDEUCH(IPHAS)=1 is not compatible with ITURB(IPHAS)=0, 10, 40
+or 41 (laminar, mixing length and LES).\\
+Concerning the $k-\varepsilon$ and $R_{ij}-\varepsilon$ models, the
+two-scales model is usually at least as satisfactory as the one-scale
+model.\\
+The scalable wall function allows to virtually ``shift'' the wall when
+necessary in order to be always in a logarithmic layer.
+It is used to make up for
+the problems related to the use of High-Reynolds models on very refined
+meshes.\\
+useful if ITURB(IPHAS) is different from 50}
+
+\motcle{ILOGPO}{IA}{0 or 1}{1}{O}{L3}
+{for each phase IPHAS, type of wall function used for the velocity: power law
+(ILOGPO(IPHAS)=0) or logarithmic law (ILOGPO(IPHAS)=1)\\
+always useful}
+
+\motcle{YPLULI}{RA}{real number $>$ 0}{\tt 1/XKAPPA,10.88D0}{O}{L3}
+{for each phase IPHAS, limit value of $y^+$ for the viscous sublayer\\
+YPLULI depends on the chosen wall function: it is
+initialised to 10.88D0 for the scalable wall function (IDEUCH(IPHAS)=2),
+otherwise it is initialised to $1/\kappa\approx 2,38$\\
+In LES, YPLULI is taken by default to be 10.88D0\\
+always useful}
+
+\minititre{ $k-\varepsilon$, $k-\varepsilon$ with linear production,
+v2-f and $k-\omega$ SST}
+
+\motcle{IGRAKE}{IA}{0 or 1}{1}{O}{L1}
+{for each phase IPHAS, indicates if the terms related to gravity in the
+equations of $k$ and $\varepsilon$ or $\omega$ are taken into account
+(IGRAKE(IPHAS)=1) or not (0)\\
+useful if and only if ITURB(IPHAS) = 20, 21, 50 or 60, (GX,GY,GZ)
+$\ne$ (0,0,0) and the density is not uniform}
+
+\motcle{IGRHOK}{IA}{0 or 1}{0}{O}{L2}
+{for each phase IPHAS, indicates if the term $\frac{2}{3}\grad \rho k$
+is taken into account\\ (IGRHOK(IPHAS)=1) or not (0) in the velocity
+equation\\
+useful if and only if ITURB(IPHAS) = 20, 21, 50 or 60.\\
+This term may generate
+non-physical velocities at the wall. When it is not explicitely taken into
+account, it is implicitely included into the pressure.}
+
+\motcle{IKECOU}{IA}{0 or 1}{0 or 1}{O}{L3}
+{for each phase IPHAS, indicates if the coupling of the source terms of
+$k$ and $\varepsilon$ or $k$ and $\omega$ is taken into account
+(IKECOU(IPHAS)=1) or not (0)\\
+if IKECOU=0 in $k-\varepsilon$ model, the term in $\varepsilon$ in the
+equation of $k$ in made implicit\\
+IKECOU(IPHAS) is initialised to 0 if ITURB(IPHAS) = 21 or 60, and to 1 if\\
+ITURB(IPHAS)= 20\\
+IKECOU(IPHAS)=1 is forbidden when using the v2f model
+(ITURB(IPHAS)=50)\\
+useful if and only if ITURB(IPHAS) = 20, 21 or 60 ($k-\varepsilon$ and
+$k-\omega$ models)}
+
+\motcle{RELAXK}{RA}{0.D0 $\leqslant$ real $\leqslant$ 1.D0}{0.7D0}{O}{L3}
+{for each phase IPHAS, relaxation coefficient of the turbulent
+variables ($k$ and $\varepsilon$ or $\omega$) when IKECOU(IPHAS) = 0. If
+IKECOU(IPHAS)=1, RELAXK is not used, whatever its value may be.\\
+useful if and only if ITURB(IPHAS) = 20, 21, 50 or 60 and IKECOU(IPHAS)=0
+($k-\varepsilon$, v2f or $k-\omega$ models without coupling)}
+
+\motcle{ICLKEP}{IA}{0 or 1}{0}{O}{L3}
+{for each phase IPHAS, indicates the clipping method used for $k$ and
+$\varepsilon$, for the $k-\varepsilon$ and v2f models\\
+\hspace*{1.3cm}= 0: clipping in absolute value\\
+\hspace*{1.3cm}= 1: clipping from physical relations\\
+useful if and only if ITURB(IPHAS) = 20, 21 or 50 ($k-\varepsilon$ and
+v2f models). The results obtained with the method corresponding to
+ICLKEP(IPHAS)=1 showed in some cases a substantial sensitivity to the
+values of the length scale ALMAX(IPHAS).\\
+The option ICLKEP(IPHAS)=1 is therefore not recommended, and,
+if chosen, must be used cautiously.}
+
+\minititre{ $R_{ij}-\varepsilon$ (LRR and SSG)}
+
+\motcle{ICLPTR}{IA}{0 or 1}{0}{O}{L3}
+{for each phase IPHAS, indicates if $R_{ij}$ is made partially implicit
+(ICLPTR(IPHAS)=1) or not (0) in the wall boundary conditions.\\
+useful if and only if ITURB(IPHAS) = 30 or 31 ($R_{ij}-\varepsilon$ model)}
+
+\motcle{ICLSYR}{IA}{0 or 1}{0}{O}{L3}
+{for each phase IPHAS, indicates if $R_{ij}$ is made partially implicit
+(ICLSYR(IPHAS)=1) or not (0) in the symmetry boundary conditions.\\
+useful if and only if ITURB(IPHAS) = 30 or 31 ($R_{ij}-\varepsilon$ model)}
+
+\motcle{IDIFRE}{IA}{0 or 1}{1}{O}{L3}
+{for each phase IPHAS, complete (IDIFRE(IPHAS)=1) or simplified (0)
+taking into account of the diagonals of the diffusion tensors of $R_{ij}$
+and $\varepsilon$, for the LLR model.\\
+useful if and only if ITURB(IPHAS) = 30 (LLR $R_{ij}-\varepsilon$ model)}
+
+\motcle{IGRARI}{IA}{0 or 1}{1}{O}{L1}
+{for each phase IPHAS, indicates if the terms related to gravity are
+taken into account (IGRARI(IPHAS)=1) or not (0) in the equations of
+$R_{ij}-\varepsilon$. \\
+useful if and only if ITURB(IPHAS) = 30 or 31 and (GX,GY,GZ) $\ne$
+(0,0,0) ($R_{ij}-\varepsilon$ model with gravity) and the density is not uniform}
+
+\motcle{IRIJEC}{IA}{0 or 1}{0}{O}{L2}
+{for each phase IPHAS, indicates if the wall echo terms in
+$R_{ij}-\varepsilon$ LRR model are
+taken into account (IRIJEC(IPHAS)=1) or not (0).\\
+useful if and only if ITURB(IPHAS) = 30 ($R_{ij}-\varepsilon$ LRR).\\
+It is not recommended to take these terms into account:
+they have an influence only near the walls, their expression is hardly
+justifiable according to some authors and, in the configurations
+studied with \CS, they did not bring any improvement in the results.\\
+In addition, their use induces an increase in the calculation
+time.\\
+The wall echo terms imply the calculation of the distance to the wall
+for every cell in the domain. See ICDPAR for potential restrictions due
+to this.}
+
+\motcle{IRIJNU}{IA}{0 or 1}{0}{O}{L3}
+{for each phase IPHAS, addition (IRIJNU(IPHAS)=1) or not (0) of a
+turbulent viscosity in the matrix of the incermental system solved
+for the velocity in $R_{ij}-\varepsilon$ models. The goal is to improve
+the stability of the calculation. The usefulness of IRIJNU(IPHAS)=1 has
+however not been clearly demonstrated.\\
+Since the system is solved in incremental form, this extra turbulent
+viscosity does not change the final solution for steady flows. However,
+for unsteady flows, the parameter NSWRSM should be increased.\\
+useful if and only if ITURB(IPHAS) = 30 or 31 ($R_{ij}-\varepsilon$ model).}
+
+\motcle{IRIJRB}{IA}{0 or 1}{0}{O}{L3}
+{for each phase IPHAS, reconstruction (IRIJRB(IPHAS)=1) or not (0) of the
+boundary conditions at the walls for $R_{ij}$ and $\varepsilon$.\\
+useful if and only if ITURB(IPHAS) = 30 or 31 ($R_{ij}-\varepsilon$ model)}
+
+
+\minititre{$LES$}
+
+\motcle{IVRTEX}{I}{0 or 1}{0}{O}{L1}
+{activates (=1) or not (=0) the generation of synthetic turbulence at the
+different inlet boundaries with the LES model (generation of unsteady synthetic
+eddies)\\
+useful if ITURB(IPHAS)=40 or 41\\
+this key word requires the completion of the routine
+\texttt{usvort}}
+
+\motcle{ISUIVO}{I}{0 or 1}{ISUITE}{O}{L1}
+{for the vortex method, indicates whether the synthetic vortices at the inlet
+should be initialised (=0) or read form the restart file FICMVO.\\
+useful if ITURB(IPHAS)=40 or 41 and IVRTEX=1}
+
+
+\motcle{IDRIES}{IA}{0 or 1}{0,1}{O}{L2}
+{for each phase IPHAS, IDRIES(IPHAS) activates (1) or not (0) the van
+Driest wall-damping for the Smagorinsky constant (the Smagorinsky
+constant is multiplied by the damping function
+$1-e^{-y^+/CDRIES(IPHAS)}$, where $y^+$ designates the adimensional
+distance to the nearest wall). The default value is 1 for the
+Smagorinsky model and 0 for the dynamic model.\\
+the van Driest wall-damping requires the knowledge of the distance to the
+nearest wall for each cell in the domain. Refer to key word ICDPAR for potential
+limitations\\
+useful if and only if ITURB(IPHAS) = 40 or 41}
+
+\motcle{CDRIES}{RA}{real number $>$ 0}{26.D0}{O}{L3}
+{for each phase IPHAS, CDRIES(IPHAS) is the constant appearing in the van Driest
+damping function applied to the Smagorinsky constant: $1-e^{-y^+/CDRIES(IPHAS)}$\\
+useful if and only if ITURB(IPHAS) = 40 or 41}
+
+\motcle{CSMAGO}{RA}{real number $>$ 0}{0.065D0}{O}{L2}
+{for each phase IPHAS, CSMAGO(IPHAS) is the Smagorinsky constant used in
+the Smagorinsky model for LES\\
+the sub-grid scale viscosity is calculated by
+ $\displaystyle\mu_{sg}=\rho C_{smago}^2\bar{\Delta}^2\sqrt{2\bar{S}_{ij}\bar{S}_{ij}}$
+where $\bar{\Delta}$ is the width of the filter and $\bar{S}_{ij}$ the filtered
+strain rate\\
+useful if and only if ITURB(IPHAS) = 40}
+
+\motcle{SMAGMX}{RA}{real number $>$ 0}{10.D0*CSMAGO}{O}{L3}
+{for each phase IPHAS, SMAGMX(IPHAS)**2 is
+the maximum allowed value for the variable $C$ appearing in the LES dynamic
+model (the ``square'' comes from the fact that the
+variable of the dynamic model corresponds to the square of the
+constant of the Smagorinsky model). Any larger value yielded by the calculation
+procedure of the dynamic model will be clipped to SMAGMX(IPHAS)**2\\
+useful if and only if ITURB(IPHAS) = 41}
+
+\motcle{XLESFL}{RA}{real number $>$ 0}{2.D0}{O}{L3}
+{for each phase IPHAS, XLESFL(IPHAS) is a constant used to define, for
+each cell $\Omega_i$, the width of the (implicit) filter:\\
+$\overline{\Delta}=XLESFL(IPHAS)(ALES(IPHAS)*|\Omega_i|)^{BLES(IPHAS)}$\\
+useful if and only if ITURB(IPHAS) = 40 or 41}
+
+\motcle{ALES}{RA}{real number $>$ 0}{1.D0}{O}{L3}
+{for each phase IPHAS, ALES(IPHAS) is a constant used to define, for
+each cell $\Omega_i$, the width of the (implicit) filter:\\
+$\overline{\Delta}=XLESFL(IPHAS)(ALES(IPHAS)*|\Omega_i|)^{BLES(IPHAS)}$\\
+useful if and only if ITURB(IPHAS) = 40 or 41}
+
+\motcle{BLES}{RA}{real number $>$ 0}{1.D0/3.D0}{O}{L3}
+{for each phase IPHAS, BLES(IPHAS) is a constant used to define, for
+each cell $\Omega_i$, the width of the (implicit) filter:\\
+$\overline{\Delta}=XLESFL(IPHAS)(ALES(IPHAS)*|\Omega_i|)^{BLES(IPHAS)}$\\
+useful if and only if ITURB(IPHAS) = 40 or 41}
+
+\motcle{XLESFD}{RA}{real number $>$ 0}{1.5D0}{O}{L3}
+{for each phase IPHAS, XLESFD(IPHAS) is the constant used to define, for
+each cell $\Omega_i$, the width of the explicit filter used in the framework of
+the LES dynamic model:\\
+$\widetilde{\overline{\Delta}}=XLESFD(IPHAS)\overline{\Delta}$\\
+useful if and only if ITURB(IPHAS) = 41}
+
+
+
+%==================================
+\subsubsection{Time scheme}
+%==================================
+
+By default, the standard time scheme is a first-order.
+A second-order scheme is activated automatically with LES modeling.
+On the other hand, when ``specific physics'' (gas combustion, pulverised coal,
+compressible module) are activated, the second-order scheme is not allowed.
+
+In the current version, the second-order time scheme is not compatible
+with the estimators (IESCAL), the velocity-pressure coupling (IPUCOU),
+the modeling of hydrostatic pressure (ICALHY and IPHYDR) and the time- or
+space-variable time step (IDTVAR).
+
+Also, in the case of a rotation periodicity, a proper second-order is not
+ensured for the velocity, but calculations remain possible.
+
+It is recommended to keep the default values of the variables listed
+below. Hence, in standard cases, the user does not need to specify these
+options.
+
+
+\motcle{ISCHTP}{IA}{1 or 2}{1 or 2}{O}{L2}
+{for each phase IPHAS, ISCHTP(IPHAS) indicates the order of the activated
+time scheme (this indicator allows the code to automatically complete
+the other indicators related to the time scheme)\\
+\hspace*{1.3cm}= 1: first-order \\
+\hspace*{1.3cm}= 2: second-order \\
+when ISCHTP(IPHAS)=2, the physical properties are by default not
+second-order. It it possible to modify this by means of the
+following indicators.\\
+due to specific coupling between certain variables, the source terms in the
+turbulence equations (except convection and diffusion) cannot be second order,
+except with the $R_{ij}$ models (cf. key word ISTO2T)\\
+by default, ISCHTP(IPHAS) is initialised to 2 with the LES model and 1
+otherwise\\
+always useful}
+
+\motcle{ISTMPF}{IA}{0, 1 or 2}{0 or 1}{O}{L3}
+{for each phase IPHAS, ISTMPF(IPHAS) specifies the time scheme activated
+for the mass flow. The chosen value for ISTMPF(IPHAS) will automatically
+determine the value given to the variable THETFL(IPHAS)\\
+\hspace*{1.3cm}= 0: ''explicit'' first-order: the mass flow calculated
+at the previous time step (``n'') is used in the convective terms of all
+the equations (momentum, turbulence and scalars\\
+\hspace*{1.3cm}= 1: ``standard'' first-order: the mass flow calculated
+at the previous time step (``n'') is used in the convective terms of the
+momentum equation, and the updated mass flow (time ``n+1'') is used in the
+equations of turbulence and scalars\\
+\hspace*{1.3cm}= 2: second-order: the mass flow used in the momentum equations
+is extrapolated at ``n+THETFL'' (=n+1/2) from the values at the two former time
+steps (Adams Bashforth); the mass flow used in the equations for turbulence and
+scalars is interpolated at time ``n+THETFL'' (=n+1/2) from the values at the
+former time step and at the newly calculated ``n+1'' time step.\\
+by default, ISTMPF(IPHAS)=2 is used in the case of a second-order time
+scheme (if ISCHTP(IPHAS)=2) and ISTMPF(IPHAS)=1 otherwise\\
+always useful}
+
+\motcle{ISNO2T}{IA}{0, 1 or 2}{0 or 1}{O}{L3}
+{for each phase IPHAS, ISNO2T(IPHAS) specifies the time scheme activated
+for the source terms of the momentum equation, apart from convection and
+diffusion (for instance: head loss, transposed gradient, ...).\\
+\hspace*{1.3cm}= 0: ''standard'' first-order: the terms which are linear
+functions of the solved variable are implicit and the others are explicit\\
+\hspace*{1.3cm}= 1: second-order: the terms of the form $S_i\phi$ which are
+linear functions of the solved variable
+$\phi$ are expressed as second-order terms by interpolation (according
+to the formula
+$(S_i\phi)^{n+\theta}=S_i^n[(1-\theta)\phi^n+\theta\phi^{n+1}]$, $\theta$
+being given by the value of THETAV associated with the variable $\phi$)
+; the other terms $S_e$ are expressed as second-order terms by
+extrapolation (according to the formula
+$(S_e)^{n+\theta}=[(1+\theta)S_e^n-\theta S_e^{n-1}]$, $\theta$ being
+given by the value of THETSN(IPHAS)=0.5D0)\\
+\hspace*{1.3cm}= 2: the linear terms $S_i\phi$ are treated in the same
+way as when ISNO2T=1;
+the other terms $S_e$ are extrapolated according to the same formula
+as when ISNO2T=1, but with $\theta$=THETSN(IPHAS)=1.D0\\
+by default, ISNO2T(IPHAS) is initialised to 1 (second-order) when the selected
+time scheme is second-order (ISCHTP=2), otherwise to 0.\\
+always useful}
+
+\motcle{ISTO2T}{IA}{0, 1 or 2}{0}{O}{L3}
+{for each phase IPHAS, ISTO2T(IPHAS) specifies the time scheme activated
+for the source terms of the turbulence equations (related to $k$,
+$R_{ij}$, $\varepsilon$, $\omega$, $\varphi$, $\overline{f}$), apart
+from convection and diffusion.\\
+\hspace*{1.3cm}= 0: ''standard'' first-order: the terms which are linear
+functions of the solved variable are implicit and the others are explicit\\
+\hspace*{1.3cm}= 1: second-order: the terms of the form $S_i\phi$ which are
+linear functions of the solved variable
+$\phi$ are expressed as second-order terms by interpolation (according
+to the formula
+$(S_i\phi)^{n+\theta}=S_i^n[(1-\theta)\phi^n+\theta\phi^{n+1}]$, $\theta$
+being given by the value of THETAV associated with the variable $\phi$)
+; the other terms $S_e$ are expressed as second-order terms by
+extrapolation (according to the formula
+$(S_e)^{n+\theta}=[(1+\theta)S_e^n-\theta S_e^{n-1}]$, $\theta$ being
+given by the value of THETST(IPHAS)=0.5D0)\\
+\hspace*{1.3cm}= 2: the linear terms $S_i\phi$ are treated in the same
+way as when ISTO2T=1;
+the other terms $S_e$ are extrapolated according to the same formula
+as when ISTO2T=1, but with $\theta$=THETST(IPHAS)=1.D0\\
+due to certain specific couplings between the turbulence equations,
+ISTO2T(IPHAS) is allowed the value 1 or 2 only for the $R_{ij}$ models
+(ITURB(IPHAS)=30 or 31); hence, it is always initialised to 0.\\
+always useful}
+
+
+\motcle{ISSO2T}{IA}{0, 1 or 2}{0 or 1}{O}{L3}
+{for each scalar ISCAL, ISSO2T(ISCAL) specifies the time scheme activated
+for the source terms of the equation for the scalar, apart from convection and
+diffusion (for instance: variance production, user-specified terms, ...).\\
+\hspace*{1.3cm}= 0: ''standard'' first-order: the terms which are linear
+functions of the solved variable are implicit and the others are explicit\\
+\hspace*{1.3cm}= 1: second-order: the terms of the form $S_i\phi$ which are
+linear functions of the solved variable
+$\phi$ are expressed as second-order terms by interpolation (according
+to the formula
+$(S_i\phi)^{n+\theta}=S_i^n[(1-\theta)\phi^n+\theta\phi^{n+1}]$, $\theta$
+being given by the value of THETAV associated with the variable $\phi$)
+; the other terms $S_e$ are expressed as second-order terms by
+extrapolation (according to the formula
+$(S_e)^{n+\theta}=[(1+\theta)S_e^n-\theta S_e^{n-1}]$, $\theta$ being
+given by the value of THETSS(ISCAL)=0.5D0)\\
+\hspace*{1.3cm}= 2: the linear terms $S_i\phi$ are treated in the same
+way as when ISSO2T=1;
+the other terms $S_e$ are extrapolated according to the same formula
+as when ISSO2T=1, but with $\theta$=THETSS(ISCAL)=1.D0\\
+by default, ISSO2T(ISCAL) is initialised to 1 (second-order) when the selected
+time scheme is second-order (ISCHTP=2), otherwise to 0.\\
+always useful}
+
+
+\motcle{IROEXT}{IA}{0, 1 or 2}{0}{O}{L3}
+{for each phase IPHAS, IROEXT(IPHAS) specifies the time scheme activated
+for the physical property $\phi$ ``density''.\\
+\hspace*{1.3cm}= 0: ''standard'' first-order: the value calculated at
+the beginning of the current time step (from the
+variables known at the end of the previous time step) is used \\
+\hspace*{1.3cm}= 1: second-order: the physical property $\phi$ is
+extrapolated according to the formula
+$\phi^{n+\theta}=[(1+\theta)\phi^n-\theta \phi^{n-1}]$, $\theta$ being
+given by the value of THETRO(IPHAS)=0.5D0 \\
+\hspace*{1.3cm}= 2: first-order: the physical property $\phi$ is
+extrapolated at $n+1$ according to the
+same formula as when IROEXT=1 but with $\theta$=THETRO(IPHAS)=1.D0\\
+always useful}
+
+\motcle{IVIEXT}{IA}{0, 1 or 2}{0}{O}{L3}
+{for each phase IPHAS, IVIEXT(IPHAS) specifies the time scheme activated
+for the physical property $\phi$ ``total viscosity''
+(molecular+turbulent or sub-grid viscosities).\\
+\hspace*{1.3cm}= 0: ''standard'' first-order: the value calculated at
+the beginning of the current time step (from the
+variables known at the end of the previous time step) is used \\
+\hspace*{1.3cm}= 1: second-order: the physical property $\phi$ is
+extrapolated according to the formula
+$\phi^{n+\theta}=[(1+\theta)\phi^n-\theta \phi^{n-1}]$, $\theta$ being
+given by the value of THETVI(IPHAS)=0.5D0 \\
+\hspace*{1.3cm}= 2: first-order: the physical property $\phi$ is
+extrapolated at $n+1$ according to the
+same formula as when IVIEXT=1, but with $\theta$=THETVI(IPHAS)=1.D0\\
+always useful}
+
+\motcle{ICPEXT}{IA}{0, 1 or 2}{0}{O}{L3}
+{for each phase IPHAS, ICPEXT(IPHAS) specifies the time scheme activated
+for the physical property $\phi$ ``specific heat''.\\
+\hspace*{1.3cm}= 0: ''standard'' first-order: the value calculated at
+the beginning of the current time step (from the
+variables known at the end of the previous time step) is used \\
+\hspace*{1.3cm}= 1: second-order: the physical property $\phi$ is
+extrapolated according to the formula
+$\phi^{n+\theta}=[(1+\theta)\phi^n-\theta \phi^{n-1}]$, $\theta$ being
+given by the value of THETCP(IPHAS)=0.5D0 \\
+\hspace*{1.3cm}= 2: first-order: the physical property $\phi$ is
+extrapolated at $n+1$ according to the
+same formula as when ICPEXT=1, but with $\theta$=THETCP(IPHAS)=1.D0\\
+always useful}
+
+\motcle{IVSEXT}{IA}{0, 1 ou 2}{0}{O}{L3}
+{for each scalar ISCAL, IVSEXT(ISCAL) specifies the time scheme activated
+for the physical property $\phi$ ``diffusivity''.\\
+\hspace*{1.3cm}= 0: ''standard'' first-order: the value calculated at
+the beginning of the current time step (from the
+variables known at the end of the previous time step) is used \\
+\hspace*{1.3cm}= 1: second-order: the physical property $\phi$ is
+extrapolated according to the formula
+$\phi^{n+\theta}=[(1+\theta)\phi^n-\theta \phi^{n-1}]$, $\theta$ being
+given by the value of THETVS(ISCAL)=0.5D0 \\
+\hspace*{1.3cm}= 2: first-order: the physical property $\phi$ is
+extrapolated at $n+1$ according to the
+same formula as when IVSEXT=1, but with $\theta$=THETVS(ISCAL)=1.D0\\
+always useful}
+
+\motcle{THETAV}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{1.D0 or 0.5D0}{O}{L3}
+{for each variable IVAR, THETAV(IVAR) is the value of $\theta$ used to
+express at the second-order the terms of convection, diffusion and the
+source terms which are linear functions of the solved variable
+(according to the formula
+$\phi^{n+\theta}=(1-\theta)\phi^n+\theta\phi^{n+1}$). Generally,
+only the values 1.0D0 and 0.5D0 are used. The user is not allowed to modify
+this variable.\\
+\hspace*{1.3cm}= 1.D0: first-order \\
+\hspace*{1.3cm}= 0.5D0: second-order \\
+Concerning the pressure, the value of THETAV is always 1.0D0. Concerning
+the other variables, the value THETAV=0.5D0 is used when the
+second-order time scheme is activated by ISCHTP=2 (standard value for
+LES calculations), otherwise THETAV is set to 1.0D0.\\
+always useful}
+
+\motcle{THETFL}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{ 0.D0 or 0.5D0}{O}{L3}
+{for each phase IPHAS, THETFL(IPHAS) is the value of $\theta$ used to
+interpolate the convective fluxes of the variables when a second-order time
+scheme has been activated for the mass flow (see ISTMPF)\\
+generally, only the value 0.5D0 is used. The user is not allowed to
+modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: ``explicit'' first-order (corresponds to
+ISTMPF(IPHAS)=0 or 1)\\
+\hspace*{1.3cm}= 0.5D0: second-order (corresponds to ISTMPF(IPHAS)=2). The mass
+flux will be interpolated according to the formula
+$Q^{n+\theta}=\frac{1}{2-\theta}Q^{n+1}+\frac{1-\theta}{2-\theta}Q^{n+1-\theta}$).\\
+always useful}
+
+\motcle{THETSN}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{0.0D0, 0.5D0 or 1.D0}{O}{L3}
+{for each phase IPHAS, THETSN(IPHAS) is the value of $\theta$ used to
+extrapolate the non linear explicit source terms $S_e$ of the momentum equation,
+when the source term extrapolation has been activated (see ISNO2T),
+following the formula\\
+$(S_e)^{n+\theta}=(1+\theta)S_e^n-\theta S_e^{n-1}$\\
+the value
+of $\theta$=THETSN(IPHAS) is deduced from the value chosen for
+ISNO2T(IPHAS). Generally, only the value 0.5D0 is used. The user is not
+allowed to modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: first-order (unused, corresponds to ISNO2T(IPHAS)=0) \\
+\hspace*{1.3cm}= 0.5D0: second-order (used when ISNO2T(IPHAS)=1) \\
+\hspace*{1.3cm}= 1.0D0: first-order (used when ISNO2T(IPHAS)=2) \\
+always useful}
+
+\motcle{THETST}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{0.0D0, 0.5D0 or 1.D0}{O}{L3}
+{for each phase IPHAS, THETST(IPHAS) is the value of $\theta$ used to
+extrapolate the non linear explicit source terms $S_e$ of the turbulence equations,
+when the source term extrapolation has been activated (see ISTO2T),
+following the formula\\
+$(S_e)^{n+\theta}=(1+\theta)S_e^n-\theta S_e^{n-1}$\\
+the value
+of $\theta$=THETSN(IPHAS) is deduced from the value chosen for
+ISTO2T(IPHAS). Generally, only the value 0.5D0 is used. The user is not
+allowed to modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: first-order (unused, corresponds to ISTO2T(IPHAS)=0) \\
+\hspace*{1.3cm}= 0.5D0: second-order (used when ISTO2T(IPHAS)=1) \\
+\hspace*{1.3cm}= 1.0D0: first-order (used when ISTO2T(IPHAS)=2) \\
+always useful}
+
+\motcle{THETSS}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{0.0D0, 0.5D0 or 1.D0}{O}{L3}
+{for each scalar ISCAL, THETSS(ISCAL) is the value of $\theta$ used to
+extrapolate the non linear explicit source terms $S_e$ of the scalar equation,
+when the source term extrapolation has been activated (see ISSO2T),
+following the formula\\
+$(S_e)^{n+\theta}=(1+\theta)S_e^n-\theta S_e^{n-1}$\\
+the value
+of $\theta$=THETSS(ISCAL) is deduced from the value chosen for
+ISSO2T(ISCAL). Generally, only the value 0.5D0 is used. The user is not
+allowed to modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: first-order (unused, corresponds to ISSO2T(ISCAL)=0) \\
+\hspace*{1.3cm}= 0.5D0: second-order (used when ISSO2T(ISCAL)=1) \\
+\hspace*{1.3cm}= 1.0D0: first-order (used when ISSO2T(ISCAL)=2) \\
+useful if NSCAL$>$1}
+
+
+\motcle{THETRO}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{0.0D0, 0.5D0 or 1.D0}{O}{L3}
+{for each phase IPHAS, THETRO(IPHAS) is the value of $\theta$ used to
+extrapolate the physical property $\phi$ ``density'' when the extrapolation has
+been activated (see IROEXT),according to the
+formula $\phi^{n+\theta}=(1+\theta)\phi^n-\theta \phi^{n-1}$\\
+the value of $\theta$=THETRO(IPHAS) is deduced from the value chosen for
+IROEXT(IPHAS). Generally, only the value 0.5D0 is used. The user is not
+allowed to modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: first-order (unused, corresponds to
+IROEXT(IPHAS)=0)\\
+\hspace*{1.3cm}= 0.5D0: second-order (corresponds to IROEXT(IPHAS)=1) \\
+\hspace*{1.3cm}= 1.0D0: first-order (corresponds to IROEXT(IPHAS)=2) \\
+always useful}
+
+\motcle{THETVI}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{0.0D0, 0.5D0 or 1.D0}{O}{L3}
+{for each phase IPHAS, THETVI(IPHAS) is the value of $\theta$ used to
+extrapolate the physical property $\phi$ ``total viscosity'' when the extrapolation has
+been activated (see IVIEXT),according to the
+formula $\phi^{n+\theta}=(1+\theta)\phi^n-\theta \phi^{n-1}$\\
+the value of $\theta$=THETVI(IPHAS) is deduced from the value chosen for
+IVIEXT(IPHAS). Generally, only the value 0.5D0 is used. The user is not
+allowed to modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: first-order (unused, corresponds to
+IVIEXT(IPHAS)=0)\\
+\hspace*{1.3cm}= 0.5D0: second-order (corresponds to IVIEXT(IPHAS)=1) \\
+\hspace*{1.3cm}= 1.0D0: first-order (corresponds to IVIEXT(IPHAS)=2) \\
+always useful}
+
+\motcle{THETCP}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{0.0D0, 0.5D0 or 1.D0}{O}{L3}
+{for each phase IPHAS, THETCP(IPHAS) is the value of $\theta$ used to
+extrapolate the physical property $\phi$ ``specific heat'' when the extrapolation has
+been activated (see ICPEXT),according to the
+formula $\phi^{n+\theta}=(1+\theta)\phi^n-\theta \phi^{n-1}$\\
+the value of $\theta$=THETCP(IPHAS) is deduced from the value chosen for
+ICPEXT(IPHAS). Generally, only the value 0.5D0 is used. The user is not
+allowed to modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: first-order (unused, corresponds to
+ICPEXT(IPHAS)=0)\\
+\hspace*{1.3cm}= 0.5D0: second-order (corresponds to ICPEXT(IPHAS)=1) \\
+\hspace*{1.3cm}= 1.0D0: first-order (corresponds to ICPEXT(IPHAS)=2) \\
+always useful}
+
+\motcle{THETVS}{RA}{0.D0 $\leqslant$ real $\leqslant$1.D0}{0.0D0, 0.5D0 or 1.D0}{O}{L3}
+{for each scalar ISCAL, THETVS(ISCAL) is the value of $\theta$ used to
+extrapolate the physical property $\phi$ ``diffusivity'' when the extrapolation has
+been activated (see IVSEXT),according to the
+formula $\phi^{n+\theta}=(1+\theta)\phi^n-\theta \phi^{n-1}$\\
+the value of $\theta$=THETVS(ISCAL) is deduced from the value chosen for
+IVSEXT(ISCAL). Generally, only the value 0.5D0 is used. The user is not
+allowed to modify this variable.\\
+\hspace*{1.3cm}= 0.0D0: first-order (unused, corresponds to
+IVSEXT(ISCAL)=0)\\
+\hspace*{1.3cm}= 0.5D0: second-order (corresponds to IVSEXT(ISCAL)=1) \\
+\hspace*{1.3cm}= 1.0D0: first-order (corresponds to IVSEXT(ISCAL)=2) \\
+useful if NSCAL$>$1}
+
+
+%==================================
+\subsubsection{Gradient reconstruction}
+%==================================
+
+\motcle{IMRGRA}{I}{0, 1, 2, 3 or 4}{0}{O}{L2}
+{indicates the type of gradient reconstruction (one method for all the
+variables)\\
+\hspace*{1.3cm}= 0: iterative reconstruction of the non-orthogonalities\\
+\hspace*{1.3cm}= 1: least squares method based on the first neighbor cells
+(cells which share a face with the treated cell)\\
+\hspace*{1.3cm}= 2: least squares method based on the extended neighborhood
+(cells which share a node with the treated cell)\\
+\hspace*{1.3cm}= 3: least squares method based on a partial extended
+neighborhood (all first neighbors plus the extended neighborhood cells that
+are connected to a face where the non-orthogonality angle is larger than
+parameter ANOMAX)\\
+\hspace*{1.3cm}= 4: iterative reconstruction with initialisation using the least
+squares method (first neighbors)\\
+if IMRGRA fails due to probable mesh quality problems, it is usually effective
+to use IMRGRA=3. Moreover, IMRGRA=3 is usually faster than IMRGRA=0 (but with
+less feedback on its use).\\
+it should be noted that IMRGRA=1, 2 or 3 automatically triggers a gradient
+limitation procedure. See IMLIGR.\\
+useful if and only if there is N so that NSWRGR(N) $>$ 1}
+
+\motcle{NSWRGR}{IA}{positive integer}{100}{O}{L3}
+{for each unknown IVAR, NSWRGR(IVAR) $\leqslant$ 1 indicates that the
+gradients are not reconstructed\\
+\hspace*{1.3cm}if IMRGRA = 0 or 4, NSWRGR(IVAR) is the number of
+iterations for the gradient reconstruction\\
+\hspace*{1.3cm}if IMRGRA = 1, 2 or 3, NSWRGR(IVAR) $>$ 1 indicates that
+the gradients are reconstructed (but the method is not iterative, so any value
+larger than 1 for NSWRGR yields the same result)\\
+useful for all the unknowns}
+
+\motcle{EPSRGR}{RA}{real number $>$ 0}{1.D-5}{O}{L3}
+{for each unknown IVAR, relative precision for the iterative gradient
+reconstruction: EPSRGR(IVAR)\\
+useful for all the unknowns when IMRGRA = 0 or 4}
+
+\motcle{IMLIGR}{IA}{-1, 0 or 1}{-1 or 1}{O}{L3}
+{for each unknown IVAR, indicates the type of gradient limitation:
+IMLIGR(IVAR)\\
+\hspace*{1.3cm}=-1: no limitation\\
+\hspace*{1.3cm}= 0: based on the neighbors\\
+\hspace*{1.3cm}= 1: superior order\\
+for all the unknowns, IMLIGR is initialised to -1 if IMRGRA=0 or 4 and to 1 if
+\mbox{IMRGRA = 1, 2 or 3}\\
+useful for all the unknowns}
+
+\motcle{CLIMGR}{RA}{real number $>$ 0}{1.5D0}{O}{L3}
+{for each unknown IVAR, factor of gradient limitation: CLIMGR(IVAR) (high
+value means little limitation)\\
+useful for all the unknowns IVAR for which IMLIGR(IVAR) $\ne$ -1}
+
+\motcle{EXTRAG}{RA}{0.D0, 0.5D0 or 1.D0}{0.D0}{O}{L3}
+{for the variable ``pressure'' IVAR=IPR(IPHAS), extrapolation coefficient
+of the gradients at the boundaries. It affects only the Neumann conditions.
+The only possible values of EXTRAG(IPR(IPHAS)) are:\\
+\hspace*{1.3cm}= 0.D0: homogeneous Neumann calculated at first-order\\
+\hspace*{1.3cm}= 0.5D0: improved homogeneous Neumann, calculated at
+second-order in the case of an orthogonal mesh and at first-order otherwise\\
+\hspace*{1.3cm}= 1.D0: gradient extrapolation (gradient at the boundary face
+equal to the gradient in the neighbor cell), calculated at
+second-order in the case of an orthogonal mesh and at first-order otherwise\\
+EXTRAG often allows to correct the non-physical velocities that
+appear on horizontal walls when density is variable and there is gravity.
+It is strongly advised to keep EXTRAG=0 for the variables apart from
+pressure. See also IPHYDR.\\
+In practice, only the values 0.D0 and 1.D0 are allowed. The
+value 0.5D0 isn't allowed by default (but the lock can be overridden if
+necessary, contact the development team).\\
+always useful}
+
+\motcle{ANOMAX}{R}{0.D0 $\leqslant$ real $\leqslant\pi/2$}{$\pi/4$}{O}{L3}
+{limit non-orthogonality angle used to restrict the extended neighborhood for
+the gradient calculation with IMRGRA=3.\\
+ANOMAX=0 will yield the same result as IMRGRA=2 (full extended
+neighborhood). ANOMAX=$\pi/2$ will yield the same result as IMRGRA=2 (first
+neighbors only)\footnote{except for pathological cases where the
+non-orthogonality angle of a face would be larger than $\pi/2$}\\
+useful if and only if IMRGRA=3}
+
+%==================================
+\subsubsection{Solution of the linear systems}
+%==================================
+
+\motcle{IRESOL}{IA}{-1, 1000*IPOL+J}{-1}{O}{L3}
+{for each unknown IVAR, IRESOL(IVAR) indicates the method used for the solution of
+the linear system\\
+\hspace*{1.3cm}= -1: automatically managed by the code (conjugate
+gradient for the pressure IVAR=IPR(IPHAS) or any variable which is not
+convected, Jacobi for the others. Diagonal preconditioning with
+conjugate gradient).\\
+\hspace*{1.3cm}= IPOL*1000+J with J= 0: conjugate gradient\\
+\hspace*{1.3cm}\phantom{= IPOL*1000+J with} J= 1: Jacobi\\
+\hspace*{1.3cm}\phantom{= IPOL*1000+J with} J= 2: stabilised bi-conjugate
+gradient (BI-CGSTAB)\\
+\hspace*{1.3cm}IPOL is the degree of the Neumann polynomial used for the
+preconditioning\footnote{$D$ being the diagonal part of $A$ and $X$ its
+extra-diagonal part, it can be written
+$A=D(Id+D^{-1}X)$. Therefore \mbox{$A^{-1}=(Id+D^{-1}X)^{-1}D^{-1}$}. A series
+development of $Id+D^{-1}X$ can then be used which yields, symbolically,
+\mbox{$Id+\sum\limits_{I=1}^{IPOL}\left(-D^{-1}X\right)^{I}$}.}.\\
+IPOL is necessarily null with the Jacobi algorithm.\\
+Concerning the computational time, the performance depends on the
+case. If a preconditioning method different from
+the diagonal preconditioning is to be used, it seems to be better to restrict
+to a first-order preconditioning (IPOL=1). This preconditioning may save up to 10\%
+of time in some cases but in the others it may also increase the computational
+time by a few percents\\
+always useful}
+
+\motcle{NITMAX}{IA}{integer $>$ 0}{10000}{O}{L3}
+{for each unknown IVAR, maximum number of iterations for the solution of
+the linear systems: NITMAX(IVAR)\\
+when the algebraic multigrid option is activated for the variable IVAR
+(IMGR(IVAR)=1), NITMAX(IVAR) is the maximum number of iterations for the
+solution on the coarsest mesh\\
+always useful}
+
+\motcle{EPSILO}{RA}{real number $>$ 0}{1.D-8,1.D-5}{O}{L3}
+{for each unknown IVAR, relative precision for the solution of the linear
+system. The default value is EPSILO(IVAR)=1.D-8. This value is set low
+on purpose. When there are enough iterations on the reconstruction of the
+right-hand side of the equation,
+the value may be increased (by default, in case of second-order in time,
+with NSWRSM = 5 or 10, EPSILO is increased to 1.D-5).\\
+always useful}
+
+\motcle{IMGR}{IA}{0 or 1}{0}{O}{L3}
+{for each unknown IVAR, indicates the use (IMGR(IVAR)=1) or not (=0) of the
+algebraic multigrid method for the solution of the linear systems\\
+IMGR(IVAR) can be set independently for every variable\\
+always useful. Generally, its use is designed for the variable ``pressure'' in
+case of meshes with strongly stretched cells. It is recommended not to modify
+IMGR}
+
+\motcle{NCEGRM}{I}{integer $>$ 0}{30}{O}{L3}
+{for the multigrid method, maximum number of cells on the coarsest grid\\
+useful if and only if IMGR(IVAR) = 1 for at least one variable IVAR}
+
+\motcle{NCYMAX}{IA}{integer $>$ 0}{100}{O}{L3}
+{for each unknown IVAR, NCYMAX(IVAR) is the maximum number of cycles when using
+the multigrid method.\\
+useful if and only if IMGR(IVAR) = 1}
+
+\motcle{NGRMAX}{I}{1$\leqslant$ integer $\leqslant$NGRMMX }{NGRMMX}{O}{L3}
+{when using the multigrid method, maximum number of grid levels\\
+useful if and only if IMGR(IVAR) = 1 for at least one variable IVAR}
+
+\motcle{NCYMAX}{IA}{integer $>$ 0}{10}{O}{L3}
+{for each unknown IVAR, NCYMAX(IVAR) is the maximum number of multigrid cycles.\\
+useful if and only if IMGR(IVAR) = 1}
+
+\motcle{NITMGF}{IA}{integer $>$ 0}{10}{O}{L3}
+{for each unknown IVAR, NITMGF(IVAR) is the maximum number of iterations on
+all grids except for the coarsest when the multigrid method is used;
+the resolution on the coarsest grid uses NITMAX.\\
+useful if and only if IMGR(IVAR) = 1}
+
+\minititre{Warning}
+The algebraic multigrid method has only been tested for
+the ``pressure'' variable (IMGR(IPR(IPHAS))=1).
+
+%==================================
+\subsubsection{Convective scheme}
+%==================================
+
+\motcleb{BLENCV}{RA}{0 $\leqslant$ real $\leqslant$ 1}{0.D0 or 1.D0}{O}{L1}
+{for each unknown IVAR to calculate, BLENCV(IVAR) indicates the proportion of
+second-order convective scheme (0.D0 corresponds to an
+``upwind'' first-order scheme) ; in case of LES calculation, a
+second-order scheme is recommended and activated by default (BLENCV=1.D0)\\
+useful for all the unknowns IVAR for which ICONV(IVAR) = 1}
+
+\motcle{ISCHCV}{IA}{0 or 1}{1}{O}{L2}
+{for each unknown IVAR to calculate, ISCHCV(IVAR) indicates the type of second-order
+convective scheme\\
+\hspace*{1.3cm}= 0: Second Order Linear Upwind\\
+\hspace*{1.3cm}= 1: Centered\\
+useful for all the unknowns IVAR which are convected (ICONV(IVAR)=1) and
+for which a second-order scheme is used (BLENCV(IVAR) $>$ 0)}
+
+\motcle{ISSTPC}{IA}{0 or 1}{0}{O}{L2}
+{for each unknown IVAR to calculate, ISSTPC(IVAR)
+indicates whether a ``slope test'' should
+be used to switch from a second-order to an ``upwind'' convective
+scheme under certain conditions, to ensure stability.\\
+\hspace*{1.3cm}= 0: ``slope test'' activated for the considered unknown\\
+\hspace*{1.3cm}= 1: ``slope test'' deactivated for the considered unknown\\
+useful for all the unknowns IVAR which are convected (ICONV(IVAR)=1) and
+for which a second-order scheme is used (BLENCV(IVAR) $>$ 0).\\
+the use of the ``slope test'' stabilises the calculation but may bring
+the order in space to decrease quickly.}
+
+%==================================
+\subsubsection{Pressure-continuity step}
+%==================================
+
+
+\motcle{IPRCO}{I}{0 or 1}{1}{O}{L3}
+{indicates if the pressure-continuity step is taken into account (1) or
+not (0)\\
+always useful}
+
+\motcle{ARAK}{RA}{0 $<$ real $\leqslant$ 1}{1.D0}{O}{L3}
+{for each phase IPHAS, ARAK(IPHAS) is the Arakawa coefficient before the
+Rhie\& Chow filter\\
+always useful}
+
+\motcle{RELAXP}{RA}{0 $<$ real $\leqslant$ 1}{1.D0}{O}{L2}
+{for each phase IPHAS, relaxation of the pressure increment during the
+solution of the system (RELAXP(IPHAS)=1: no relaxation)\\
+can improve the convergence in case of
+meshes of insufficient quality\\
+always useful}
+
+\motcle{IREVMC}{IA}{0, 1 or 2}{0}{O}{L3}
+{for each phase IPHAS, method used to update the velocity after the pressure
+correction:\\
+\hspace*{0,5cm}- standard gradient of pressure increment
+(IREVMC(IPHAS)=0)\\
+\hspace*{0,5cm}- least squares on the pressure increment
+(IREVMC(IPHAS)=1)\\
+\hspace*{0,5cm}-``RT0'' {\em i.e.} least squares on the updated mass flux
+(IREVMC(IPHAS)=2)\\
+the method IREVMC(IPHAS)=2 is generally not recommended\\
+always useful}
+
+\motcle{IPHYDR}{I}{0 or 1}{0}{O}{L2}
+{method for taking into account the balance between the pressure gradient and
+the source terms (gravity and head losses): by extension it will be
+referenced as ``taking into account of the hydrostatic pressure''\\
+\hspace*{1.3cm}= 0: standard algorithm\\
+\hspace*{1.3cm}= 1: improved algorithm\\
+always useful\\
+When the density effects are important, the choice of
+IPHYDR=1 allows to improve the interpolation of the pressure and correct the
+non-physical velocities which may appear in highly
+stratified areas or near horizontal walls (thus
+avoiding the use of EXTRAG if the non-physical velocities are due only to
+gravity effects).\\
+The improved algorithm also allows to eradicate the velocity oscillations
+which tend to appear at the frontiers of areas with high head losses.\\
+In the case of a stratified flow, the calculation cost is higher when the
+improved algorithm is used (about 30\% depending on the case) because
+the hydrostatic pressure has to be recalculated at the outlet boundary
+conditions: see ICALHY.\\
+On meshes of insufficient quality, in order to
+improve the convergence, it may be useful to increase the number of
+iterations for the reconstruction of the pressure right-hand member,
+{\em i.e.} \mbox{NSWRSM(IPR(IPHAS))}.\\
+If head losses are present just along an outlet boundary, it is necessary to
+specify ICALHY=0 in order to deactivate the recalculation of the hydrostatic
+pressure at the boundary, which may otherwise cause instabilities.}
+
+\motcle{ICALHY}{I}{0 or 1}{0 or 1}{O}{L3}
+{activates the calculation of hydrostatic pressure boundary conditions at outlet
+boundaries\\
+\hspace*{1.3cm}= 0: no calculation of the hydrostatic pressure at the outlet boundary\\
+\hspace*{1.3cm}= 1: calculation of the hydrostatic pressure at the outlet boundary\\
+always useful\\
+This option is automatically specified depending on the
+choice of IPHYDR and the value of gravity
+(ICALHY=1 if IPHYDR=1 and gravity is different from 0; otherwise
+ICALHY=0). The activation of this option generates an additional
+calculation cost (about 30\% depending on the case).\\
+If head losses are present just along an outlet boundary, it is necessary to
+specify ICALHY=0 in order to deactivate the recalculation of the hydrostatic
+pressure at the boundary, which may otherwise cause instabilities}
+
+
+
+%==================================
+\subsubsection{Error estimators for Navier-Stokes}
+%==================================
+
+There are currently NESTMX\index{NESTMX}=4 types of local estimators
+provided at every time step, with two possible definitions for
+each\footnote{choice made by the user}. These scalars indicate the areas
+(cells) in which some error types may be important. They are
+stored in the array PROPCE containing the properties at the cells (see
+IESTIM\index{IESTIM}). For each estimator, the code writes the minimum and
+maximum values in the listing and generates post-processing outputs along with
+the other variables.
+
+The additional memory cost is about one real number per cell and per
+estimator. The additional calculation cost is variable. For instance, on a
+simple test case, the total estimator IESTOT generates an additional cost
+of 15 to 20 $\%$ on the CPU time\footnote{indeed, all the first-order in
+space differential terms have to be recalculated at the time $t^{\,n+1}$} ;
+the cost of the three others may be neglected. If the user wants to
+avoid the calculation of the estimators during the computation, it is
+possible to run a calculation without estimators first, and then activate them on
+a restart of one or two time steps.
+
+It is recommended to use the estimators only for visual and qualitative
+analysis. Also, their use is compatible neither with a second-order time scheme
+nor with a calculation with a frozen velocity field.
+
+{\bf IEST = IESPRE\index{IESPRE}: prediction} (default name: EsPre).
+After the velocity prediction step (yielding $\vect{u}^*$), the
+estimator $\eta^{\,pred}_{\,i,k}(\vect{u}^*)$, local variable calculated
+at every cell $\Omega_i$, is created from $\vect{\mathcal
+R}^{\,pred}(\vect{u}^*)$, which represents the residual of the equation
+solved during this step:
+\begin{eqnarray*}
+\vect{\mathcal R}^{\,pred}(\vect{u}^*)&= & \rho^n \frac{\vect{u}^*-\vect{u}^n}{\Delta t}
+ + \rho^n \vect{u}^n \cdot \tens{grad}(\vect{u}^*)
+ - div \left((\mu+\mu_t)^n \tens{grad}(\vect{u}^*) \right)
+ + \grad(P^n) \\
+ &- &\text{rest of the right-hand member}
+ \,(\vect{u}^n, P^n, \text{other variables}^n)
+\end{eqnarray*}
+By definition:
+$$ \eta^{\,pred}_{\,i,k}(\vect{u}^*)= {|\Omega_i|}^{\,(k-2)/2}\ ||\vect{\mathcal R}^{\,pred}(\vect{u}^*)||
+_{{I\hspace{-.25em}L}^{2}(\Omega_i)}$$
+\hspace*{0.5cm}$\bullet$ The first family, $k=1$, suppresses the
+volume $|\Omega_i|$ which intrinsicly appears with the norm
+${{I\hspace{-.25em}L}^{2}(\Omega_i)}$.\\
+\hspace*{0.5cm}$\bullet$ The second family, $k=2$, exactly represents the norm
+${{I\hspace{-.25em}L}^{2}(\Omega_i)}$. The size of the cell therefore
+appears in its calculation and induces a weighting effect.\\
+$ \eta^{\,pred}_{\,i,k}(\vect{u}^*)$ is ideally equal to zero when the
+reconstruction methods are perfect and the associated system is
+solved exactly.
+
+{\bf IEST = IESDER\index{IESDER}: drift} (default name: EsDer).
+The estimator $\eta^{\,der}_{\,i,k}(\vect{u}^{\,n+1})$ is based on the
+following quantity (intrinsic to the code):
+\begin{equation}
+\begin{array}{lll}
+ \eta^{\,der}_{\,i,k}(\vect{u}^{\,n+1})
+&=& {|\Omega_i|}^{\,(k-2)/2}
+||div (\text{corrected mass flow after the pressure step})
+ -\ \Gamma||_{{L}^{2}(\Omega_i)} \\
+&=& {|\Omega_i|}^{\,(1-k)/2}
+|div (\text{corrected mass flow after the pressure step})-\ \Gamma|
+\end{array}
+\end{equation}
+Ideally, it is equal to zero when the Poisson equation related to the pressure is
+solved exactly.
+
+{\bf IEST = IESCOR\index{IESCOR}: correction} (default name: EsCor).
+The estimator $ \eta^{\,corr}_{\,i,k}(\vect{u}^{\,n+1})$ comes directly
+from the mass flow calculated with the updated velocity field:
+\begin{eqnarray*}
+ \eta^{\,corr}_{\,i,k}(\vect{u}^{\,n+1})=
+|\Omega_i|^{\,\delta_{\,2,k}}\ |div (\rho^n \vect{u}^{n+1}) -\ \Gamma|
+\end{eqnarray*}
+The velocities $\vect{u}^{n+1}$ are taken at the cell centers,
+the divergence is calculated after projection on the faces.\\
+ $ \,\delta_{\,2,k}$ represents the Kronecker symbol.\\
+\hspace*{0.5cm}$\bullet$ The first family, $k=1$, is the absolute raw
+value of the divergence of the mass flow minus the mass source term.\\
+\hspace*{0.5cm}$\bullet$ The second family, $k=2$, represents a physical
+property and allows to evaluate the difference in $kg.s^{\,-1}$.\\
+Ideally, it is equal to zero when the Poisson equation is solved exactly and
+the projection from the mass flux at the faces to the velocity at the cell
+centers is made in a set of functions with null divergence.
+
+{\bf IEST = IESTOT\index{IESTOT}: total} (default name: EsTot).
+The estimator $ \eta^{\,tot}_{\,i,k}(\vect{u}^{\,n+1})$, local variable
+calculated at every cell $\Omega_i$, is based on the quantity
+$\vect{\mathcal R}^{\,tot}(\vect{u}^{\,n+1})$, which represents the
+residual of the equation using the updated values of
+$\vect{u}$ and $P$:
+\begin{eqnarray*}
+\vect{\mathcal R}^{\,tot}(\vect{u}^{\,n+1})&= & \rho^n \frac{\vect{u}^{\,n+1}-\vect{u}^n}{\Delta t}
+ + \rho^n \vect{u}^{\,n+1} \cdot \tens{grad}(\vect{u}^{\,n+1})
+ - div \left((\mu+\mu_t)^n \tens{grad}(\vect{u}^{\,n+1}) \right)
+ + \grad(P^{\,n+1}) \\
+ &- &\text{rest of the right-hand member}
+ \,(\vect{u}^{\,n+1}, P^{\,n+1}, \text{other variables}^n)
+\end{eqnarray*}
+By definition:
+$$ \eta^{\,tot}_{\,i,k}(\vect{u}^{\,n+1})= {|\Omega_i|}^{\,(k-2)/2}\ ||\vect{\mathcal R}^{\,tot}(\vect{u}^{\,n+1})||
+_{{I\hspace{-.25em}L}^{2}(\Omega_i)}$$
+
+The mass flux in the convective term is recalculated from $\vect{u}^{n+1}$
+expressed at the cell centers (and not taken from the updated mass flow at the
+faces).\\
+
+As for the prediction estimator:\\
+\hspace*{0.5cm}$\bullet$ The first family, $k=1$, suppresses the
+volume $|\Omega_i|$ which intrinsicly appears with the norm
+${{I\hspace{-.25em}L}^{2}(\Omega_i)}$.\\
+\hspace*{0.5cm}$\bullet$ The second family, $k=2$, exactly represents the norm
+${{I\hspace{-.25em}L}^{2}(\Omega_i)}$. The size of the cell therefore
+appears in its calculation and induces a weighting effect.\\
+
+
+The estimators are evaluated depending on the values of IESCAL.
+
+
+\motcleb{IESCAL}{IA}{0, 1 or 2}{0}{O}{L1}
+{for each phase IPHAS, IESCAL(IEST,IPHAS) indicates the calculation mode
+for the error estimator IEST (IESPRE, IESDER, IESCOR or IESTOT), for
+the Navier-Stokes equation:\\
+ IESCAL = 0: estimator not calculated, \\
+ IESCAL = 1: the estimator $ \eta^{\,* }_{\,i,1}$ is calculated,
+ without contribution of the volume, \\
+ IESCAL = 2: the estimator $ \eta^{\,* }_{\,i,2}$ is calculated,
+ with contribution of the volume ("norm $L^2$"),
+ except for IESCOR, for which
+ $|\Omega_i|\ \eta^{\,corr}_{\,i,1}\ $
+ is calculated.
+
+The name of the estimators appearing in the listing and the post-processing is
+made up of the default name (given before), followed first by the value of
+IESCAL, then by the phase number. For
+instance, EsPre201 is the estimator IESPRE calculated with IESCAL=2 for
+the phase 01.\\
+always useful}
+
+
+
+%==================================
+\subsubsection{Calculation of the distance to the wall}
+%==================================
+
+\motcle{ICDPAR}{I}{-1, 1, -2 or 2}{-1}{O}{L2}
+{specifies the method used to calculate the distance to the wall $y$ and the
+adimensional distance $y^+$ for all the
+cells of the calculation domain (when necessary):\\
+\hspace*{1.3cm}= 1: standard algorithm (based on a Poisson equation for $y$ and
+convection equation for $y^+$),
+with reading of the distance to the wall from the restart file
+if possible\\
+\hspace*{1.3cm}=-1: standard algorithm (based on a Poisson equation for $y$ and
+convection equation for $y^+$),
+with systematic recalculation of the distance to the wall in case of
+calculation restart\\
+\hspace*{1.3cm}= 2: former algorithm (based on geometrical
+considerations),
+with reading of the distance to the wall from the restart file
+if possible\\
+\hspace*{1.3cm}=-2: former algorithm (based on geometrical
+considerations) with systematic recalculation of the distance to the
+wall in case of calculation restart\\
+In case of restart calculation, if the position of the walls haven't changed,
+reading the distance to the wall from the restart file can save a fair amount of
+CPU time.\\
+Useful in $R_{ij}-\varepsilon$ model with wall echo (ITURB(IPHAS)=30 and IRIJEC=1),
+in LES with van Driest damping (ITURB(IPHAS)=40 and IDRIES(IPHAS)=1) and
+in $k-\omega$ SST (ITURB(IPHAS)=60). \\
+By default, ICDPAR is initialied to -1, in case there has been a change in the
+definition of the boundary conditions between two computations (change in the
+number or the positions of the walls). Yet, with the $k-\omega$ SST model, the
+distance to the wall is needed to calculate the turbulent viscosity, which is
+done before the calculation of the distance to the wall. Hence, when this model
+is used (and only in that case), ICDPAR is set to 1 by default, to ensure total
+continuity of the calculation at restart.\\
+{\bf As a consequence, with the \boldmath$k-\omega$\unboldmath\ SST model, if
+the number and positions of the walls are changed at a calculation restart, it
+is mandatory for the user to set ICDPAR explicitly to -1}, otherwise the
+distance to the wall used will not correspond to the actual position of the
+walls.\\
+The former algorithm is not compatible with parallelism nor periodicity. Also,
+whatever the value chosen for ICDPAR, the calculation of the distance to the
+wall is made at the most once for all a the beginning of the calculation. It is
+therefore not compatible with moving walls. Please contact the development team
+if you need to override this limitation.}
+
+
+The following options are related to ICDPAR=1 or -1. The options of
+level 2 are described first. Some options are used only in the case of
+the calculation of the adimensional distance to the wall $y^+$ (LES model with
+van Driest damping). Most of these key words are simple copies of the
+key words for the numerical options of the general equations, with a potentially
+specific value in the case of the calculation of the distance to the wall.\\
+
+\motcle{IWARNY}{I}{integer}{0}{O}{L2}
+{specifies the level of the output writing concerning the calculation of the
+distance to the wall with ICDPAR=1 or -1. The higher the value, the more
+detailled the outputs\\
+useful when ICDPAR=1 or -1}
+
+\motcle{NTCMXY}{I}{positive integer}{1000}{O}{L2}
+{number of pseudo-time iterations for the calculation of the adimensional
+distance to the wall $y^+$\\
+useful when ICDPAR=1 or -1 for the calculation of $y^+$}
+
+\motcle{NITMAY}{I}{integer $>$ 0}{10000}{O}{L3}
+{maximum number of iterations for the solution of the linear systems\\
+useful when ICDPAR=1 or -1}
+
+\motcle{NSWRSY}{I}{positive integer}{1}{O}{L3}
+{number of iterations for the reconstruction of the right-hand members:
+corresponds to NSWRSM\\
+useful when ICDPAR=1 or -1}
+
+\motcle{NSWRGY}{I}{positive integer}{100}{O}{L3}
+{number of iterations for the gradient reconstruction: corresponds to NSWRGR\\
+useful when ICDPAR=1 or -1}
+
+\motcle{IMLIGY}{I}{-1, 0 ou 1}{-1 or 1}{O}{L3}
+{type of gradient limitation: corresponds to IMLIGR\\
+useful when ICDPAR=1 or -1}
+
+\motcle{IRCFLY}{I}{0 or 1}{1}{O}{L3}
+{indicates the reconstruction of the convective and diffusive fluxes at
+the faces: corresponds to IRCFLU\\
+useful when ICDPAR=1 or -1}
+
+\motcle{ISCHCY}{I}{0 or 1}{1}{O}{L3}
+{type of second-order convective scheme: corresponds to ISCHCV\\
+useful when ICDPAR=1 or -1 for the calculation of $y^+$}
+
+\motcle{ISSTPY}{I}{0 or 1}{0}{O}{L3}
+{indicates if a ``slope test'' should be used for a second-order convective
+scheme: corresponds to ISSTPC\\
+useful when ICDPAR=1 or -1 for the calculation of $y^+$}
+
+\motcle{IMGRPY}{I}{0 or 1}{0}{O}{L3}
+{indicates whether the algebraic
+multigrid method should be used (IMGR(IVAR)=1) or not (0): corresponds to IMGR\\
+useful when ICDPAR=1 or -1}
+
+\motcle{BLENCY}{R}{0 $\leqslant$ real $\leqslant$ 1}{0.D0}{O}{L3}
+{proportion of second-order convective scheme: corresponds to BLENCV\\
+useful when ICDPAR=1 or -1 for the calculation of $y^+$}
+
+\motcle{EPSILY}{R}{real number $>$ 0}{1.D-8}{O}{L3}
+{relative precision for the solution of the linear systems: corresponds to EPSILO\\
+useful when ICDPAR=1 or -1}
+
+\motcle{EPSRGY}{R}{real number $>$ 0}{1.D-5}{O}{L3}
+{relative precision for the iterative gradient reconstruction: corresponds to EPSRGR\\
+useful when ICDPAR=1 or -1}
+
+\motcle{CLIMGY}{R}{real number $>$ 0}{1.5D0}{O}{L3}
+{limitation factor of the gradients: corresponds to CLIMGR\\
+useful when ICDPAR=1 or -1}
+
+\motcle{EXTRAY}{R}{0.D0, 0.5D0 or 1.D0}{0.D0}{O}{L3}
+{extrapolation coefficient of the gradients at the boundaries: corresponds to EXTRAG\\
+useful when ICDPAR=1 or -1}
+
+\motcle{COUMXY}{R}{strictly positive real number}{5000.D0}{O}{L3}
+{Target Courant number for the calculation of the adimensional distance
+to the wall\\
+useful when ICDPAR=1 or -1 for the calculation of $y^+$}
+
+\motcle{EPSCVY}{R}{strictly positive real number}{1.D-8}{O}{L3}
+{relative precision for the convergence of the pseudo-transient regime
+for the calculation of the adimensional distance to the wall\\
+useful when ICDPAR=1 or -1 for the calculation of $y^+$}
+
+\motcle{YPLMXY}{R}{real number}{200.D0}{O}{L3}
+{value of the adimensional distance to the wall above which the
+calculation of the distance is not necessary (for the damping)\\
+useful when ICDPAR=1 or -1 for the calculation of $y^+$}
+
+
+%==================================
+\subsubsection{Others}
+%==================================
+
+\motcleb{ICCVFG}{I}{0 or 1}{0}{O}{L1}
+{indicates whether the dynamic field should be frozen (1) or not (0)\\
+in such a case, the values of velocity,
+pressure and the variables related to the potential turbulence model
+($k$, $R_{ij}$, $\varepsilon$, $\varphi$, $\bar{f}$, $\omega$, turbulent viscosity) are kept
+constant over time and only the equations for the scalars are solved\\
+also, if ICCVFG=1, the physical properties modified in \texttt{usphyv} will keep
+being updated. Beware of non-consistencies if these properties would normally
+affect the dynamic field (modification of density for instance)\\
+useful if and only if NSCAL $>$ 0 and ISUITE=1}
+
+\motcleb{IPUCOU}{I}{0 or 1}{0}{O}{L1}
+{indicates the algorithm for velocity/pressure coupling\\
+\hspace*{1.3cm}= 0: standard algorithm\\
+\hspace*{1.3cm}= 1: reinforced coupling in case calculation with long
+time steps\\
+always useful (it is seldom advised, but it can prove very useful, for instance,
+in case of flows with weak convection effects and highly variable viscosity)}
+
+\motcleb{ISUIT1}{I}{0 or 1}{0}{O}{L1}
+{for the 1D wall thermal module, activation (1) or not(0) of the reading
+of the mesh and of the wall temperature from the FICMT1 restart file\\
+useful if NFPT1D$>$0.}
+
+\motcle{IMVISF}{I}{0 or 1}{0}{O}{L3}
+{indicates the interpolation method used to project variables from the cell
+centers to the faces\\
+\hspace*{1.3cm}= 0: linear\\
+\hspace*{1.3cm}= 1: harmonic\\
+always useful}
+
+\motcle{IRCFLU}{IA}{0 or 1}{1}{O}{L2}
+{for each unknown IVAR, IRCFLU(IVAR) indicates whether the convective
+and diffusive fluxes at the faces should be reconstructed: \\
+\hspace*{1.3cm}= 0: no reconstruction\\
+\hspace*{1.3cm}= 1: reconstruction\\
+deactivating the reconstruction of the fluxes can have a stabilising effect on
+the calculation. It is sometimes useful with the $k-\varepsilon$ model, if the
+mesh is strongly non-orthogonal in the near-wall region, where the gradients of
+$k$ and $\varepsilon$ are strong. In such a case, setting IRCFLU(IK(IPHAS))=0
+and IRCFLU(IEP(IPHAS))=0 will probably help (switching to a first order
+convective scheme, BLENCV=0.D0, for $k$ and $\varepsilon$ might also help in
+that case)\\
+always useful}
+
+\motcle{NSWRSM}{IA}{positive integer}{1, 2, 5 or 10}{O}{L3}
+{for each unknown IVAR, NSWRSM(IVAR) indicates the number of iterations for the
+reconstruction of the right-hand members of the equations\\
+with a first-order scheme in time
+(standard case), the default values are 2 for pressure and 1 for the
+other variables. With a second-order scheme in time (ISCHTP=2) or LES, the
+default values are 5 for pressure and 10 for the other variables.\\
+useful for all the unknowns}
+
+\motcle{EPSRSM}{RA}{real number $>$ 0}{1.D-8,1.D-5}{O}{L3}
+{for each unknown IVAR, relative precision on the reconstruction of the
+right hand-side. The default value is EPSRSM(IVAR)=1.D-8. This value is set low
+on purpose. When there are enough iterations on the reconstruction of the
+right-hand side of the equation,
+the value may be increased (by default, in case of second-order in time,
+with NSWRSM = 5 or 10, EPSRSM is increased to 1.D-5).\\
+always useful}
+
+
+%====================================================================================
+\subsection{Numerical, physical and modeling parameters}
+%=============================================================================
+\subsubsection{Numeric Parameters}
+%================================
+
+These parameters correspond to numeric reference values in the code.
+They can be used but shall not be modified (they are defined as PARAMETER).
+
+\motcle{ZERO}{R}{0.D0}{O.D0}{O}{L3}
+{Parameter containing the value 0}
+
+\motcle{EPZERO}{R}{1.D-12}{1.D-12}{O}{L3}
+{``Small'' real parameter, used for the comparisons of real numbers (absolute
+value of the difference lower than EPZERO)}
+
+\motcle{PI}{R}{3.141592653589793D0}{3.141592653589793D0}{O}{L3}
+{Parameter containing the value of $\pi$}
+
+\motcle{GRAND}{R}{1.D12}{1.D12}{O}{L3}
+{``Large'' real parameter, generally used by default as a non physical value for
+the initialisations of variables which have to be modified by the user}
+
+\motcle{RINFIN}{RR}{1.D30}{1.D30}{O}{L3}
+{Real parameter used to represent the ``infinite''}
+
+%==================================
+\subsubsection{Physical parameters}
+%==================================
+These parameters correspond to physical reference values in the code.
+They can be used but shall not be modified (they are defined as PARAMETER).
+
+\motcle{TKELVI}{R}{273.15D0}{273.15D0}{O}{L3}
+{Temperature in Kelvin correponding to 0 degrees Celsius.}
+
+\motcle{TKELVN}{R}{-273.15D0}{-273.15D0}{O}{L3}
+{Temperature in degrees Celsius corresponding to 0 Kelvin.}
+
+\motcle{RR}{R}{8.31434D0}{8.31434D0}{O}{L3}
+{Perfect gas constant in $J/mol/K$}
+
+\motcle{TREFTH}{R}{25.D0 + TKELVI}{25.D0 + TKELVI}{O}{L3}
+{Reference temperature for the specific physics, in $K$}
+
+\motcle{PREFTH}{R}{1.01325D5}{1.01325D5}{O}{L3}
+{Reference pressure for the specific physics, in $Pa$}
+
+\motcle{VOLMOL}{R}{22.41D-3}{22.41D-3}{O}{L3}
+{Molar volume under normal pressure and temperature conditions (1 atmosphere,
+0\degresC) in $m^{-3}$}
+
+\motcle{STEPHN}{R}{5.6703D-8}{5.6703D-8}{O}{L3}
+{Stephan constant for the radiative module $\sigma$ in $W.m^{-2}.K^{-4}$}
+
+\motcle{PERMVI}{R}{1.2566D-6}{1.2566D-6}{O}{L3}
+{Vacuum magnetic permeability $\mu_0$ (=$4\pi.10^{-7}$) in $kg.m.A^{-2}.s^{-2}$}
+
+\motcle{EPSZER}{R}{8.854D-12}{8.854D-12}{O}{L3}
+{Vacuum permittivity $\varepsilon_0$ in $F.m^{-1}$}
+
+
+
+%==================================
+\subsubsection{Physical variables}
+%==================================
+
+\motcleb{GX,GY,GZ}{R}{3 real numbers}{0.D0,0.D0,0.D0}{O}{L1}
+{gravity components\\
+always useful }
+
+\motcleb{IROVAR}{IA}{0 or 1}{\tt -1}{C}{L1}
+{for each phase IPHAS, IROVAR(IPHAS)=0 indicates that the density is
+constant. Its value is the reference density RO0(IPHAS).\\
+IROVAR(IPHAS)=1 indicates that the density is variable: its variation
+law must be given in the user subroutine \texttt{usphyv}\\
+negative value: not initialised\\
+always useful}
+
+\motcleb{IVIVAR}{IA}{0 or 1}{\tt -1}{C}{L1}
+{for each phase IPHAS, IVIVAR(IPHAS)=0 indicates that the molecular
+dynamic viscosity is constant. Its value is the reference molecular
+dynamic viscosity VISCL0(IPHAS).\\
+IVIVAR(IPHAS)=1 indicates that the molecular dynamic viscosity is
+variable: its variation law must be given in the user subroutine
+\texttt{usphyv}\\
+negative value: not initialised\\
+always useful}
+
+\motcleb{RO0}{RA}{real number $\geqslant$ 0}{\tt -GRAND*10}{C}{L1}
+{for each phase IPHAS, RO0(IPHAS) is the reference density\\
+negative value: not initialised\\
+its value is not used in gas or coal combustion modeling (it
+will be calculated following the perfect gas law, with P0 and T0). With the
+compressible module, it is also not used by the code, but it may be (and often
+is) referenced by the user in user subroutines; it is therefore better to
+specify its value.\\
+always useful otherwise, even if a law defining the density is given by
+the user subroutine \texttt{usphyv} or \texttt{uselph}\\
+indeed, except with the
+compressible module, \CS does not
+use the total pressure $P$ when solving the Navier-Stokes equation, but a
+reduced pressure \\
+$P^*=P-\rho_0\vect{g}.(\vect{x}-\vect{x}_0)+P^*_0-P_0$\\
+where
+$\vect{x_0}$ is a reference point (see XYZP0) and $P^*_0$ and $P_0$ are
+reference values (see PRED0 and P0). Hence, the term
+$-\grad{P}+\rho\vect{g}$ in the equation is treated as
+$-\grad{P^*}+(\rho-\rho_0)\vect{g}$. The closer RO0 is to the value of $\rho$,
+the more $P^*$ will tend to represent only the dynamic part of the pressure and
+the faster and more precise its solution will be. Whatever the value of RO0,
+both $P$ and $P^*$ appear in the listing and the post-processing outputs.\\
+with the compressible module, the calculation is made directly on the total
+pressure}
+
+\motcleb{VISCL0}{RA}{real number $>$ 0}{\tt -GRAND*00}{C}{L1}
+{for each phase IPHAS, VISCL0(IPHAS) is the reference molecular dynamic
+viscosity\\
+negative value: not initialised\\
+always useful, it is the used value unless the user specifies the
+viscosity in the subroutine \texttt{usphyv}}
+
+\motcleb{SRROM}{R}{$0 \leqslant \text{r\'eel} < 1$}{-GRAND ou 0}{C or O}{L1}
+{With gas combustion, pulversied coal or the electric module, SRROM
+ is the sub-relaxation coefficient for the density, following the formula:\\
+$\rho^{n+1}$\,=\,SRROM\,$\rho^n$+(1-SRROM)\,$\rho^{n+1}$\\
+hence, with a zero value, there is no sub-relaxation.
+With combustion and pulversied coal, SRROM is initialised to -GRAND
+and the user must specify a proper value through the Interface or the
+initialisation subroutines (\texttt{usd3p1},
+ \texttt{usebu1}, \texttt{uslwc1}, \texttt{uscpi1} or
+\texttt{uscpl1}).With the electric module, SRROM is initialised in to 0
+and may be modified by the user in \texttt{useli1}.\\
+With gas combustion, pulverised coal or electric arc, SSROM is
+automatically used after the second time-step. With Joule effect,
+the user decides whether or not it will be used in \texttt{uselph}
+from the coding law giving the density.}\\
+always useful with gas combustion, pulversized coal or the electric module.
+
+\motcleb{P0}{RA}{real number}{1.013D5}{O}{L1}
+{for each phase IPHAS, P0(IPHAS) is the reference pressure for the total
+pressure\\
+except with the compressible module, the total pressure $P$ is evaluated
+from the reduced pressure $P^*$ so that $P$
+is equal to P0 at the reference position $\vect{x}_0$ (given by XYZP0)\\
+with the compressible module, the total pressure is solved directly\\
+always useful}
+
+\motcle{PRED0}{RA}{real number}{0.D0}{O}{L3}
+{for each phase IPHAS, PRED0(IPHAS) is the reference value for the reduced
+pressure $P^*$ (see RO0)\\
+it is especially used to initialise the reduced pressure and as a reference
+value for the outlet boundary conditions\\
+for an optimised precision in the resolution of $P^*$, it is wiser to keep PRED0
+to 0\\
+with the compressible module, the ``pressure'' variable appearing in the
+equations directly represents the total pressure. It is therefore initialised
+to P0 and not PRED0 (see RO0)\\
+always useful, except with the compressible module}
+
+\motcleb{XYZP0}{RA}{3 real numbers}{0.D0,0.D0,0.D0}{O}{L1}
+{for each phase IPHAS, XYZP0(II,IPHAS) is the II coordinate
+(1$\leqslant$II$\leqslant$3) of the reference point $\vect{x}_0$ for the
+total pressure\\
+when there are no Dirichlet conditions for the pressure (closed domain), XYZP0
+does not need to be specified (unless the total pressure has a clear physical
+meaning in the configuration treated)\\
+when Dirichlet conditions on the pressure are specified but only through stantard
+outlet conditions (as it is in most configurations),
+XYZP0 does not need to be specified by the user, since it will be set to the
+coordinates of the reference outlet face ({\em i.e.} the code will automatically
+select a
+reference outlet boundary face and set XYZP0 so that $P$ equals P0 at this
+face). Nontheless, if XYZP0 is pecified by the user, the calculation will remain
+correct\\
+when direct Dirichlet conditions are specified by the user (specific value set
+on specific boundary faces), it is better to specify the corresponding reference
+point ({\em i.e.} specifiy where the total pressure is P0). This way, the
+boundary conditions for the reduced pressure will be close to PRED0, ensuring an
+optimal precision in the resolution. If XYZP0 is not specified, the reduced
+pressure will be shifted, but the calculations will remain correct.\\
+with the compressible module, the ``pressure'' variable appearing in the
+equations directly represents the total pressure. XYZP0 is therefore not used.\\
+always useful, except with the compressible module}
+
+\motcleb{T0}{RA}{real number}{0.D0}{O}{L1}
+{for each phase IPHAS, T0(IPHAS) is the reference temperature \\
+useful for the specific physics gas or coal combustion (initialisation
+of the density), for the electricity modules to initialise the domain
+temperature and for the comperssible module (initialisations). It must be given
+in Kelvin.}
+
+\motcleb{CP0}{RA}{real number $>$ 0}{\tt -GRAND*10}{O}{L1}
+{for each phase IPHAS, CP0(IPHAS) is the reference specific heat\\
+useful if there is 1$\leqslant$N$\leqslant$NSCAUS\footnote{none of the scalars
+from the specific physics is a temperature} so that ISCSTH(N)=1
+(there is a scalar ``temperature''), unless the user specifies the
+specific heat in the user subroutine \texttt{usphyv}\footnote{when using the
+Graphical Interface, CP0 is also used to calculate the diffusivity of the
+thermal scalars, based on their conductivity; it is therefore needed, unless the
+diffusivity is also specified in \texttt{usphyv}} (ICP(IPHAS) $>$ 0)\\
+with the compressible module or coal combustion, CP0 is also needed even when
+there is no user scalar}
+
+\motcleb{ICP}{IA}{0 or 1}{0}{O}{L1}
+{for each phase IPHAS, indicates if the specific heat $C_p$ is variable
+(ICP(IPHAS)=1) or not (0)\\
+When gas or coal combustion is activated, ICP is automatically set to 0
+(constant $C_p$). With the electric module, it is automatically set to 1.
+The user is not allowed to modify these default choices.\\
+When ICP(IPHAS)=1 is specified, the code automatically modifies this value to
+make ICP(IPHAS) designate the effective index-number of the property
+``specific heat of the phase IPHAS''. For each cell IEL, the value of
+$C_p$ is then specified by the user in the appropriate subroutine
+(\texttt{usphyv} for the standard physics) and stored in the array\\
+PROPCE(IEL,IPPROC(ICP(IPHAS)))
+({\em see p.\pageref{prg_propvar} for specific conditions of use})\\
+useful if there is 1$\leqslant$N$\leqslant$NSCAL so that ISCSTH(N)=1
+(there is a scalar ``temperature'') or with the compressible module for non
+perfect gases}
+
+\motcleb{VISLS0}{RA}{real number $>$ 0}{\tt -GRAND*10}{C}{L1}
+{VISLS0(J): reference molecular diffusivity related to the scalar J
+($kg.m^{-1}.s^{-1}$)\\
+negative value: not initialised\\
+useful if 1$\leqslant$J$\leqslant$ NSCAL, unless the user specifies the
+molecular diffusivity in the appropriate user subroutine (\texttt{usphyv} for
+the standard physics) (IVISLS(ISCAL) $>$ 0)\\
+{\em Warning : VISLS0 corresponds to the diffusivity. For the temperature, it is
+therefore defined as $\lambda/C_p$ where $\lambda$ and $C_p$ are the
+conductivity and specific heat. When using the Graphical Inteface, $\lambda$ and
+$C_p$ are specified separately, and VISLS0 is calculated automatically\\
+With the compressible module, VISLS0 (given in \texttt{uscfxi2}) is directly the
+thermal conductivity $W.m^{-1}.K^{-1}$\\
+With gas or coal combustion, the molecular diffusivity of the enthalpy
+($kg.m^{-1}.s^{-1}$) must be specified by the user in the variable DIFTL0 (\texttt{usebu1},
+\texttt{usd3p1}, \texttt{uslwc1}, \texttt{uscpi1}, \texttt{uscpl1})\\
+With the electric module, for the Joule effect, the diffusivity is specified by
+the user in \texttt{uselph} (even if it is constant). For the electric arc, it
+is calculated from the thermochemical data file}}
+
+\motcleb{IVISLS}{IA}{positive or zero integer}{0}{O}{L1}
+{indicates if the viscosity related to the scalar ISCAL is variable
+(IVISLS(ISCAL)=1) or not (0). The user must specify IVISLS only for the
+user scalars (ISCAL $\leqslant$ NSCAUS).\\
+When IVISLS(ISCAL)=1 is specified, the code automatically modifies this value to
+make IVISLS(ISCAL) designate the effective index-number of the property
+``diffusivity of the scalar ISCAL''. For each cell IEL, the value
+is then specified by the user in the appropriate subroutine
+(\texttt{usphyv} for the standard physics) and stored in the array\\
+PROPCE(IEL,IPPROC(IVISLS(IPHAS)))
+({\em see p.\pageref{prg_propvar} for specific conditions of use})\\
+useful if 1$\leqslant$N$\leqslant$NSCAL}
+
+
+\motcleb{DIFTL0}{R}{real number $>$ 0}{\tt -GRAND}{C}{L1}
+{molecular diffusivity for the enthalpy ($kg.m^{-1}.s^{-1}$) for gas or coal
+combustion (the code then automatically sets VISLS0 to DIFTL0 for the scalar
+representing the enthalpy)\\
+always useflu for gas or coal combustion}
+
+\motcleb{SCAMIN}{RA}{real number}{\tt GRAND}{O}{L1}
+{SCAMIN(ISCAL) is the lower limit value for the scalar ISCAL. At each time step,
+in every cell where the calculated value for RTP(IEL,ISCA(ISCAL)) is lower than
+\mbox{SCAMIN(ISCAL)}, RTP(IEL,ISCA(ISCAL)) will be reset to
+\mbox{SCAMIN(ISCAL)}\\
+there is no limitation if SCAMIN(ISCAL)$>$SCAMAX(ISCAL)\\
+SCAMIN shall not be specified for non-user scalars (specific physics) or for
+scalar variances\\
+useful if and only if 1$\leqslant$ISCAL$\leqslant$ NSCAUS}
+
+\motcleb{SCAMAX}{RA}{real number}{\tt -GRAND}{O}{L1}
+{SCAMAX(ISCAL) is the higher limit value for the scalar ISCAL. At each time step,
+in every cell where the calculated value for RTP(IEL,ISCA(ISCAL)) is higher than
+\mbox{SCAMAX(ISCAL)}, RTP(IEL,ISCA(ISCAL)) will be reset to
+\mbox{SCAMAX(ISCAL)}\\
+there is no limitation if SCAMIN(ISCAL)$>$SCAMAX(ISCAL)\\
+SCAMAX shall not be specified for non-user scalars (specific physics) or for
+scalar variances\\
+useful if and only if 1$\leqslant$ISCAL$\leqslant$ NSCAUS}
+
+\motcle{SIGMAS}{RA}{real number $>$ 0}{1D0}{O}{L2}
+{SIGMAS(ISCAL): turbulent Prandtl (or Schmidt) number for the scalar ISCAL\\
+useful if and only if 1$\leqslant$ISCAL$\leqslant$ NSCAUS}
+
+\motcle{RVARFL}{RA}{real number $>$ 0}{0.8D0}{O}{L2}
+{when ISCAVR(ISCAL)$>$0, RVARFL(ISCAL) is the coefficient $R_f$ in the
+dissipation term $\displaystyle -\frac{\rho}{R_f}\frac{\varepsilon}{k}$
+of the equation concerning the scalar ISCAL,
+which represents the root mean square of the
+fluctuations of the scalar ISCAVR(ISCAL)\\
+useful if and only if there is 1$\leqslant$ISCAL$\leqslant$ NSCAL such as
+ ISCAVR(ISCAL)$>$0}
+
+
+%==================================
+\subsubsection{Modeling parameters}
+%==================================
+
+\motcleb{XLOMLG}{RA}{real number $>$ 0}{\tt -GRAND*10}{O}{L1}
+{for each phase IPHAS, XLOMLG(IPHAS) is the mixing length\\
+useful if and only if there is a phase IPHAS so that ITURB(IPHAS)= 10
+(mixing length)}
+
+\motcle{ALMAX}{RA}{\texttt{-GRAND}, real number $>$ 0}{\tt -GRAND*10}{O}{L2}
+{for each phase IPHAS, ALMAX(IPHAS) is a characteristic macroscopic
+length of the domain, used for the initialisation of the turbulence and
+the potential clipping (with ICLKEP(IPHAS)=1)\\
+negative value: not initialised (the code then uses the cubic root of
+the domain volume)\\
+useful if and only if there is a phase IPHAS such as
+TURB(IPHAS)= 20, 21, 30, 31, 50 or 60 (RANS models)}
+
+\motcleb{UREF}{RA}{real number $>$ 0}{\tt -GRAND*10}{C}{L1}
+{for each phase IPHAS, UREF(IPHAS) is the characteristic flow velocity,
+used for the initialisation of the turbulence\\
+negative value: not initialised\\
+useful if and only if there is a phase IPHAS such as
+ITURB(IPHAS)= 20, 21, 30, 31, 50 ou 60 (RANS model)
+and the turbulence is not initialised somewhere
+else (restart file or subroutine \texttt{usiniv})}
+
+
+\minititre{Basic constants of the $k-\varepsilon$ and the other RANS models}
+
+\motcle{XKAPPA}{R}{real number $>$ 0}{0.42D0}{O}{L3}
+{K\'arm\'an constant\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)$\geqslant$10
+(mixing length, $k-\varepsilon$, $R_{ij}-\varepsilon$, LES, v2f or $k-\omega$)}
+
+\motcle{CSTLOG}{R}{real number $>$ 0}{5.2D0}{O}{L3}
+{constant of the logarithmic wall function\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)$\geqslant$10
+(mixing length, $k-\varepsilon$, $R_{ij}-\varepsilon$, LES, v2f or $k-\omega$)}
+
+\motcle{CMU}{R}{real number $>$ 0}{0.09D0}{O}{L3}
+{constant $C_\mu$ for all the RANS turbulence models except for the v2f model
+(see CV2FMU\index{CV2FMU} for the value of $C_\mu$ in case of v2f modeling)\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)= 20,
+21, 30, 31 or 60 ($k-\varepsilon$, $R_{ij}-\varepsilon$ or $k-\omega$)}
+
+\motcle{CE1}{R}{real number $>$ 0}{1.44D0}{O}{L3}
+{constant $C_{\varepsilon 1}$ for all the RANS turbulence models except
+for the v2f and the $k-\omega$ models\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)= 20,
+21, 30 or 31 ($k-\varepsilon$ or $R_{ij}-\varepsilon$)}
+
+\motcle{CE2}{R}{real number $>$ 0}{1.92D0}{O}{L3}
+{constant $C_{\varepsilon 2}$ for the $k-\varepsilon$ and
+$R_{ij}-\varepsilon$ LRR models\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)= 20, 21 or 30
+($k-\varepsilon$ or $R_{ij}-\varepsilon$ LRR)}
+
+%\motcle{CE3}{R}{real number $>$ 0}{1.D0}{O}{L3}
+%{constante $C_{\varepsilon 3}$\\
+%ne sert pas dans la version consid\'er\'ee}
+
+\motcle{CE4}{R}{real number $>$ 0}{1.2D0}{O}{L3}
+{constant $C_{\varepsilon 4}$ for the interfacial term (Lagrangian module) in
+case of two-way coupling\\
+useful in case of Lagrangian modeling, in $k-\varepsilon$ and $R_{ij}-\varepsilon$
+with two-way coupling}
+%c'est aussi implante en k-omega mais en ``imitant''le k-eps et sans aucune verif
+% ... et d'ailleurs ca ne marche pas !!
+
+\motcle{SIGMAK}{R}{real number $>$ 0}{1.00D0}{O}{L3}
+{Prandtl number for $k$ with $k-\varepsilon$ and v2f models\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=20, 21 or 50
+($k-\varepsilon$ or v2f)}
+
+\motcle{SIGMAE}{R}{real number $>$ 0}{1.30D0}{O}{L3}
+{Prandtl number for $\varepsilon$\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)= 20,
+21, 30, 31 or 50 ($k-\varepsilon$, $R_{ij}-\varepsilon$ or v2f)}
+
+\minititre{Constants specific to the $R_{ij}-\varepsilon$ LRR model (ITURB=30)}
+
+\motcle{CRIJ1}{R}{real number $>$ 0}{1.8D0}{O}{L3}
+{constant $C_1$ for the $R_{ij}-\varepsilon$ LRR model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=30
+($R_{ij}-\varepsilon$ LRR)}
+
+\motcle{CRIJ2}{R}{real number $>$ 0}{0.6D0}{O}{L3}
+{constant $C_2$ for the $R_{ij}-\varepsilon$ LRR model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=30
+($R_{ij}-\varepsilon$ LRR)}
+
+\motcle{CRIJ3}{R}{real number $>$ 0}{0.55D0}{O}{L3}
+{constant $C_3$ for the $R_{ij}-\varepsilon$ LRR model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=30
+($R_{ij}-\varepsilon$ LRR)}
+
+\motcle{CRIJEP}{R}{real number $>$ 0}{0.18D0}{O}{L3}
+{constant $C_\varepsilon$ for the $R_{ij}-\varepsilon$ LRR model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=30
+($R_{ij}-\varepsilon$ LRR)}
+
+\motcle{CSRIJ}{R}{real number $>$ 0}{0.22D0}{O}{L3}
+{constant $C_s$ for the $R_{ij}-\varepsilon$ LRR model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=30
+($R_{ij}-\varepsilon$ LRR)}
+
+\motcle{CRIJP1}{R}{real number $>$ 0}{0.5D0}{O}{L3}
+{constant $C_1^\prime$ for the $R_{ij}-\varepsilon$ LRR model, corresponding to
+the wall echo terms\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=30 and IRIJEC(IPHAS)=1
+($R_{ij}-\varepsilon$ LRR)}
+
+\motcle{CRIJP2}{R}{real number $>$ 0}{0.3D0}{O}{L3}
+{constant $C_2^\prime$ for the $R_{ij}-\varepsilon$ LRR model, corresponding to
+the wall echo terms\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=30 and IRIJEC(IPHAS)=1
+($R_{ij}-\varepsilon$ LRR)}
+
+\minititre{Constants specific to the $R_{ij}-\varepsilon$ SSG model}
+
+\motcle{CSSGS1}{R}{real number $>$ 0}{1.7D0}{O}{L3}
+{constant $C_{s1}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\motcle{CSSGS2}{R}{real number $>$ 0}{-1.05D0}{O}{L3}
+{constant $C_{s2}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\motcle{CSSGR1}{R}{real number $>$ 0}{0.9D0}{O}{L3}
+{constant $C_{r1}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\motcle{CSSGR2}{R}{real number $>$ 0}{0.8D0}{O}{L3}
+{constant $C_{r2}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\motcle{CSSGR3}{R}{real number $>$ 0}{0.65D0}{O}{L3}
+{constant $C_{r3}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\motcle{CSSGR4}{R}{real number $>$ 0}{0.625D0}{O}{L3}
+{constant $C_{r4}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\motcle{CSSGR5}{R}{real number $>$ 0}{0.2D0}{O}{L3}
+{constant $C_{r1}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\motcle{CSSGE2}{R}{real number $>$ 0}{1.83D0}{O}{L3}
+{constant $C_{\varepsilon 2}$ for the $R_{ij}-\varepsilon$ SSG model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=31
+($R_{ij}-\varepsilon$ SSG)}
+
+\minititre{Constants specific to the v2f $\varphi$-model}
+
+\motcle{CV2FA1}{R}{real number $>$ 0}{0.05D0}{O}{L3}
+{constant $a_1$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\motcle{CV2FE2}{R}{real number $>$ 0}{1.85D0}{O}{L3}
+{constant $C_{\varepsilon 2}$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\motcle{CV2FMU}{R}{real number $>$ 0}{0.22D0}{O}{L3}
+{constant $C_\mu$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\motcle{CV2FC1}{R}{real number $>$ 0}{1.4D0}{O}{L3}
+{constant $C_1$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\motcle{CV2FC2}{R}{real number $>$ 0}{0.3D0}{O}{L3}
+{constant $C_2$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\motcle{CV2FCT}{R}{real number $>$ 0}{6.D0}{O}{L3}
+{constant $C_T$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\motcle{CV2FCL}{R}{real number $>$ 0}{0.25D0}{O}{L3}
+{constant $C_L$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\motcle{CV2FET}{R}{real number $>$ 0}{110.D0}{O}{L3}
+{constant $C_\eta$ for the v2f $\varphi$-model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=50
+(v2f $\varphi$-model)}
+
+\minititre{Constants specific to the $k-\omega$ SST model}
+
+\motcle{CKWSK1}{R}{real number $>$ 0}{1.D0/0.85D0}{O}{L3}
+{constant $\sigma_{k1}$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+\motcle{CKWSK2}{R}{real number $>$ 0}{2.D0}{O}{L3}
+{constant $\sigma_{k2}$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+\motcle{CKWSW1}{R}{real number $>$ 0}{2.D0}{O}{L3}
+{constant $\sigma_{\omega 1}$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+\motcle{CKWSW2}{R}{real number $>$ 0}{1.D0/0.856D0}{O}{L3}
+{constant $\sigma_{\omega 2}$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+\motcle{CKWBT1}{R}{real number $>$ 0}{0.075D0}{O}{L3}
+{constant $\beta_1$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+\motcle{CKWBT2}{R}{real number $>$ 0}{0.0828D0}{O}{L3}
+{constant $\beta_2$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+\motcle{CKWGM1}{R}{real number $>$ 0}
+{$\frac{\beta_1}{C_\mu}-\frac{\kappa^2}{\sqrt{C_\mu}\sigma_{\omega 1}}$}{O}{L3}
+{constant $\gamma_1$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)\\
+{\em Warning: $\gamma_1$ is calculated before the call to
+\texttt{usini1}. Hence, if $\beta_1$, $C_\mu$, $\kappa$ or $\sigma_{\omega 1}$
+is modified in \texttt{usini1}, CKWGM1 must also be modified in accordance}}
+
+\motcle{CKWGM2}{R}{real number $>$ 0}
+{$\frac{\beta_2}{C_\mu}-\frac{\kappa^2}{\sqrt{C_\mu}\sigma_{\omega 2}}$}{O}{L3}
+{constant $\gamma_2$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)\\
+{\em Warning: $\gamma_2$ is calculated before the call to
+\texttt{usini1}. Hence, if $\beta_2$, $C_\mu$, $\kappa$ or $\sigma_{\omega 2}$
+is modified in \texttt{usini1}, CKWGM2 must also be modified in accordance}}
+
+\motcle{CKWA1}{R}{real number $>$ 0}{0.31D0}{O}{L3}
+{constant $a_1$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+\motcle{CKWC1}{R}{real number $>$ 0}{10.D0}{O}{L3}
+{constant $c_1$ for the $k-\omega$ SST model\\
+useful if and only if there is a phase IPHAS such as ITURB(IPHAS)=60
+($k-\omega$ SST)}
+
+
+%==================================
+\subsection{ALE}
+%==================================
+\motcleb{IALE}{I}{0 or 1}{C}{O}{L1}
+{activates (=1) or not (=0), activate the ALE module}
+
+\motcleb{NALINF}{I}{0 or positive integer}{C}{0}{L2}
+{The number of under-iterations of initialization of the fluid}
+
+\motcleb{NBSTR}{I}{0 or positive integer}{C}{0}{L1}
+{number of structure}
+
+\motcleb{ALPNMK}{R}{real}{C}{0.D0}{L3}
+{$alpha$ newmark's method}
+
+\motcleb{BETNMK}{R}{real}{C}{-GRAND}{L3}
+{$beta$ newmark's method}
+
+\motcleb{GAMNMK}{R}{real}{C}{-GRAND}{L3}
+{$gamma$ newmark's method}
+
+\motcleb{NALIMX}{I}{positive integer}{C}{15}{L2}
+{maximum number of iterations of implicitation of the structure displacement }
+
+\motcleb{EPALIM}{R}{positive real}{C}{1.D-5}{L2}
+{Relative precision of implicitation of the structure displacement }
+
+
+%==================================
+\subsection{Thermal radiative transfers: global settings}
+%==================================
+
+All the following key words may be modified in the user subroutines
+\texttt{usray*} (or, for some of them, by through the thermochemical data files).
+It is however not recommended to modify those which do not belong to
+level L1.
+
+\motcleb{IRAYON}{IA}{0, 1, 2}{0}{O}{L1}
+{for each phase IPHAS, IRAYON(IPHAS) activates ($>0$) or deactivates
+(=0) the radiation module\\
+if a specific physics is activated (in that case, NSCAPP$>$0),
+IRAYON(IPHAS) must be kept to 0 (see IRAYPP)\\
+The different values correspond to the following modelings:\\
+\hspace*{1.3cm} = 1 discrete ordinates
+(standard option for radiation in semi-transparent media)\\
+\hspace*{1.3cm} = 2 ``P-1'' model\\
+{\em Warning: the P-1 model allows faster computations, but it
+may only be applied to media with uniform large optical thickness, such as
+some cases of pulverised coal combustion}}
+
+\motcleb{IRAYPP}{I}{0, 1, 2, 3 or 4}{0}{O}{L1}
+{when a specific physics is activated\footnote{except with the compressible
+module, which is not compatible with radiation}
+(NPHAS=1, compulsory) IRAYPP
+indicates if thermal radiative transfers are calculated ($>0$) or not
+(=0).\\
+The value of IRAYPP is given {\em via} a data file (gas combustion:
+{\em dp\_C3P}, {\em dp\_C3PSJ}, or {\em dp\_C4P};
+pulverised coal combustion: {\em dp\_FCP}; electric module: {\em dp\_ELE})\\
+IRAYPP allows to choose between the discrete ordinates method and the
+P-1 method (see IRAYON) and to choose the method used to calculate the
+absorption coefficient. The absorption coefficient may be set by the
+user in the data file (then, \mbox{IMODAK=0}) or calculated using
+``Modak\footnote{for details about the calculation of the absorption
+coefficient, please refer to MODAK A.T., ``Radiation from products
+of combustion''}'' (then, IMODAK=1).
+The options are the followings:\\
+\hspace*{1.3cm} = 1 discrete ordinates method with the absorption coefficient
+given by the user in the data file (IMODAK=0)\\
+\hspace*{1.3cm} = 2 discrete ordinates method using Modak for the
+calculation of the absorption coefficient (IMODAK=1)\\
+\hspace*{1.3cm} = 3 ``P-1'' model with the absorption coefficient
+given by the user in the data file (IMODAK=0)\\
+\hspace*{1.3cm} = 4 ``P-1'' model using Modak for the
+calculation of the absorption coefficient (IMODAK=1)\\
+For the electric module, IRAYPP is not set directly in the data file, but
+deduced from the type of XKABEL specified in the file (given by IXKABE).
+In that case, IRAYPP can only be equal to 0 (IXKABE=0 or 2) or 1 (IXKABE=1)}
+
+\motcle{IMODAK}{I}{0 or 1}{0}{O}{L3}
+{when gas or coal combustion is activated, IMODAK indicates whether the
+absorption coefficient shall be calculated ``automatically'' (=1) or read from
+the data file (=0) (see IRAYPP)\\
+useful if the radiation module is activated; IMODAK is then automatically set
+from the value of IRAYPP, without intervention of the user}
+
+\motcleb{ISUIRD}{I}{0 or 1}{ISUITE}{C}{L1}
+{indicates whether the radiation variables should be initialised (=0) or read
+from a restart file (=1)\\
+useful if and only if the radiation module is activated (in this case, a
+restart file {\em rayamo} must be available)}
+
+\motcleb{NFREQR}{I}{strictly positive integer}{1}{O}{L1}
+{period of the radiation module\\
+the radiation module is called every NFREQR time steps (more precisely, every
+time NTCABS is a multiple of NFREQR). Also, in order to have proper
+initialisation of the variables, whatever the value of NFREQR, the radiation
+module is called at the first time step of a calculation (restart or not)\\
+useful if and only if the radiation module is activated}
+
+\motcleb{NDIREC}{I}{32 ou 128}{32}{O}{L1}
+{number of directions for the angular discretisation of the radiation
+propagation with the DOM model (IRAYON=1)\\
+no other possible value, because of the way the directions are calculated\\
+the calculation with 32 directions may break the symmetry of
+physically axisymmetric cases (but the cost in CPU time is much lower
+ than with 128 directions)\\
+useful if and only if the radiation module is activated with the DOM method}
+
+\motcle{XNP1MX}{R}{real number}{10}{O}{L3}
+{with the P-1 model (IRAYON=2), XNP1MX is the percentage of cells of
+the calculation domain for which it is acceptable that the optical
+thickness is lower than unity\footnote{more precisely, where $KL$ is lower than
+1, where $K$ is the absorption coefficient of the medium and $L$ is a
+characteristic length of the domain}, although it is not to be desired\\
+useful if and only if the radiation module is activated with the P-1 method}
+
+\motcleb{IDIVER}{I}{0, 1 or 2}{2}{C}{L1}
+{indicates the method used to calculate the radiative source term:\\
+\hspace*{1.3cm}= 0: semi-analytic calculation (compulsory with transparent
+media)\\
+\hspace*{1.3cm}= 1: conservative calculation\\
+\hspace*{1.3cm}= 2: semi-analytic calculation corrected in order to be
+globally consevative\\
+useful if and only if the radiation module is activated\\
+{\em Note: if the medium is transparent, the choice has no effect on the calculation}}
+
+\motcleb{IIMPAR}{I}{0, 1 or 2}{1}{O}{L1}
+{choice of the display level in the listing concerning the calculation of
+the wall temperatures:\\
+\hspace*{1.3cm}= 0: no display\\
+\hspace*{1.3cm}= 1: standard\\
+\hspace*{1.3cm}= 2: complete\\
+useful if and only if the radiation module is activated}
+
+\motcleb{IIMLUM}{I}{0, 1 or 2}{1}{O}{L1}
+{choice of the display level in the listing concerning the solution of
+the radiative transfer equation:\\
+\hspace*{1.3cm}= 0: no display\\
+\hspace*{1.3cm}= 1: standard\\
+\hspace*{1.3cm}= 2: complete\\
+useful if and only if the radiation module is activated}
+
+\motcleb{NBRVAP}{CA}{string of less than 80 characters}{name\_IPHAS}{O}{L1}
+{name associated for the post-processing to each of the following variables,
+defined at the cell centers ({\it see}
+\cite{Douce02} for more details concerning their definitions):\\
+\hspace*{1.3cm} NBRVAP(ITSRAY,IPHAS): radiative source term ($W/m^3$)\\
+\hspace*{1.3cm} NBRVAP(IQRAYP,IPHAS): radiative flux density vector ($W/m^2$)\\
+\hspace*{1.3cm} NBRVAP( IABSP,IPHAS): absorption part in the source term
+($W/m^3$)\\
+\hspace*{1.3cm} NBRVAP( IEMIP,IPHAS): emission part in the source term
+($W/m^3$)\\
+\hspace*{1.3cm} NBRVAP( ICAKP,IPHAS): absorption coefficient of the
+medium ($m^{-1}$)\\
+the default values are: \\
+\hspace*{1.3cm} NBRVAP(ITSRAY,IPHAS) = Srad\_IPHAS \\
+\hspace*{1.3cm} NBRVAP(IQRAYP,IPHAS) = Qrad\_IPHAS \\
+\hspace*{1.3cm} NBRVAP( IABSP,IPHAS) = Absorp\_IPHAS \\
+\hspace*{1.3cm} NBRVAP( IEMIP,IPHAS) = Emiss\_IPHAS \\
+\hspace*{1.3cm} NBRVAP( ICAKP,IPHAS) = CoefAb\_IPHAS \\
+useful if and only if the radiation module is activated}
+
+\motcleb{IRAYVP}{IA}{-1 or 1}{-1}{O}{L1}
+{activates (=1) or deactivates (=-1) the post-processing for the each of the
+followiing variables defined at the cell centers:\\
+\hspace*{1.3cm} IRAYVP(ITSRAY,IPHAS): radiative source term ($W/m^3$)\\
+\hspace*{1.3cm} IRAYVP(IQRAYP,IPHAS): radiative flux density vector ($W/m^2$)\\
+\hspace*{1.3cm} IRAYVP(IABSP,IPHAS): absorption part in the source term
+($W/m^3$)\\
+\hspace*{1.3cm} IRAYVP(IEMIP,IPHAS): emission part in the source term
+($W/m^3$)\\
+\hspace*{1.3cm} IRAYVP(ICAKP,IPHAS): absorption coefficient of the
+medium ($m^{-1}$)\\
+useful if and only if the radiation module is activated}
+
+\motcleb{NBRVAF}{CA}{string of less than 80 characters}{name\_IPHAS}{O}{L1}
+{name associated for the post-processing to each of the following variables,
+defined at the boundary faces ({\it see}
+\cite{Douce02} for more details concerning their definitions):\\
+\hspace*{1.3cm} NBRVAF(ITPARP,IPHAS): wall temperature at the boundary
+faces ($K$)\\
+\hspace*{1.3cm} NBRVAF(IQINCP,IPHAS): radiative incident flux density
+($W/m^2$)\\
+\hspace*{1.3cm} NBRVAF(IXLAMP,IPHAS): thermal conductivity of the
+boundary faces ($W/m/K$)\\
+\hspace*{1.3cm} NBRVAF(IEPAP,IPHAS): wall thickness ($m$)\\
+\hspace*{1.3cm} NBRVAF(IEPSP,IPHAS): wall emissivity \\
+\hspace*{1.3cm} NBRVAF(IFNETP,IPHAS): net radiative flux density ($W/m^2$)\\
+\hspace*{1.3cm} NBRVAF(IFCONP,IPHAS): convective flux density ($W/m^2$)\\
+\hspace*{1.3cm} NBRVAF(IHCONP,IPHAS): convective exchange coefficient
+($W/m^2/K$)\\
+The default values are: \\
+\hspace*{1.3cm} NBRVAF(ITPARP,IPHAS) = Temp\_paroi\_IPHAS \\
+\hspace*{1.3cm} NBRVAF(IQINCP,IPHAS) = Flux\_incident\_IPHAS \\
+\hspace*{1.3cm} NBRVAF(IXLAMP,IPHAS) = Conductivite\_th\_IPHAS \\
+\hspace*{1.3cm} NBRVAF(IEPAP,IPHAS) = Epaisseur\_IPHAS \\
+\hspace*{1.3cm} NBRVAF(IEPSP,IPHAS) = Emissivite\_IPHAS \\
+\hspace*{1.3cm} NBRVAF(IFNETP,IPHAS) = Flux\_net\_IPHAS \\
+\hspace*{1.3cm} NBRVAF(IFCONP,IPHAS) = Flux\_convectif\_IPHAS \\
+\hspace*{1.3cm} NBRVAF(IHCONP,IPHAS) = Coef\_ech\_convectif\_IPHAS \\
+useful if and only if the radiation module is activated}
+
+\motcleb{IRAYVF}{IA}{-1 or 1}{-1}{O}{L1}
+{activates (=1) or deactivates (=-1) the post-processing for each of the
+followiing variables defined at the boundary faces:\\
+\hspace*{1.3cm} IRAYVF(ITPARP,IPHAS): wall temperature at the boundary
+faces ($K$)\\
+\hspace*{1.3cm} IRAYVF(IQINCP,IPHAS): radiative incident flux density
+($W/m^2$)\\
+\hspace*{1.3cm} IRAYVF(IXLAMP,IPHAS): thermal conductivity of the
+boundary faces ($W/m/K$)\\
+\hspace*{1.3cm} IRAYVF( IEPAP,IPHAS): wall thickness ($m$)\\
+\hspace*{1.3cm} IRAYVF( IEPSP,IPHAS): wall emissivity \\
+\hspace*{1.3cm} IRAYVF(IFNETP,IPHAS): net radiative flux density ($W/m^2$)\\
+\hspace*{1.3cm} IRAYVF(IFCONP,IPHAS): convective flux density ($W/m^2$)\\
+\hspace*{1.3cm} IRAYVF(IHCONP,IPHAS): convective exchange coefficient
+($W/m^2/K$)\\
+useful if and only if the radiation module is activated}
+
+\motcle{TMIN}{R}{real number positif}{0.D0}{O}{L3}
+{minimum allowed value for the wall temperatures in Kelvin\\
+useful if and only if the radiation module is activated}
+
+\motcle{TMAX}{R}{real number positif}{GRAND + 273.15D0}{O}{L3}
+{maximum allowed value for the wall temperatures in Kelvin\\
+useful if and only if the radiation module is activated}
+
+%==================================
+\subsection{Electric module (Joule effect and electric arc): specificities}
+%==================================
+
+The electric module is composed of a Joule effect module
+(IPPMOD(IELJOU)\index{IELJOU}) and an electric arc module
+(IPPMOD(IELARC)\index{IELARC}).
+
+The Joule effect module is designed to take into account the Joule effect
+(for instance in glass furnaces) with real or complex potential in the
+enthalpy equation. The Laplace forces are not taken into account in the
+impluse momentum equation. Specific boundary conditions can be applied to
+account for the coupled effect of transformers (offset) in glass furnaces.
+
+The electric arc module is designed to take into account the Joule effect
+(only with real potential) in the enthalpy equation. The Laplace forces
+are taken into account in the impulse momentum equation.
+
+The key words used in the global settings are quite few. They are
+found in the subroutine \texttt{useli1} (see the description of this
+user subroutine \S\ref{prg_useli1}).
+
+\motcleb{IELCOR}{I}{0, 1}{0}{O}{L1}
+{when IELCOR=1, the boundary conditions for the potential will be tuned at each
+time step in order to reach a user-specified target dissipated power PUISIM
+(Joule effect) or a user-specified target current intensity COUIMP (electric
+arc)\\
+the boundary condition tuning is controlled by the subroutine \texttt{uselrc}\\
+alway useful}
+
+\motcleb{COUIMP}{R}{real number $\geqslant 0$}{0}{O}{L1}
+{with the electric arc module, COUIMP is the target current intensity ($A$)
+for the calculations with boundary condition tuning for the potential\\
+the target intensity will be reached if the boundary conditions are expressed
+using the variable DPOT or if the initial boundary conditions are multiplied by
+the variable COEJOU\\
+useful with the electric arc module if IELCOR=1}
+
+\motcleb{PUISIM}{R}{real number $\geqslant 0$}{0}{O}{L1}
+{with the Joule effect module, PUISIM is the target dissipated power ($W$)
+for the calculations with boundary condition tuning for the potential\\
+the target power will be reached if the boundary conditions are expressed
+using the variable DPOT or if the initial boundary conditions are multiplied by
+the variable COEJOU\\
+useful with the Joule effect module if IELCOR=1}
+
+\motcleb{DPOT}{R}{real number $\geqslant 0$}{0}{O}{L1}
+{DPOT is the potential difference ($V$) which generates the current (and the Joule effect) for the
+calculations with boundary conditions tuning for the potential. This value is
+initialised set by the user (\texttt{useli1}). It is then automatically tuned
+depending on the value of dissipated power (Joule effect module) or the
+intensity of current (electric arc module).
+In order for the correct power or intensity to be reached, the boundary
+conditions for the potential must be expressed with DPOT (\texttt{uselcl}). The
+tuning can be controlled in \texttt{uselrc}\\
+useful if IELCOR=1}
+
+\motcle{COEJOU}{R}{real number $\geqslant 0$}{1}{O}{L2}
+{only with the Joule effect, COEJOU can be used if the user does not
+wish to use DPOT. COEJOU is the coefficient to be applied to the initial
+potential difference to reach the target dissipated power. Its value is
+automatically initialised to 1 and is updated during the calculation.
+In order for the correct power to be reached, the boundary
+conditions for the potential must be expressed with COEJOU (\texttt{uselcl}). The
+tuning can be controlled in \texttt{uselrc}\\
+Useful if IELCOR=1}
+
+%=================================================
+\subsection{Compressible module: specificities}
+%==================================
+
+The key words used in the global settings are quite few. They are
+found in the subroutines \texttt{uscfx1} and \texttt{uscfx2} (see the
+description of these user subroutines, \S\ref{prg_uscfx12}).
+
+\motcleb{ICFGRP}{IA}{0 or 1}{1}{C}{L1}
+{for each phase IPHAS, ICFGRP(IPHAS) indicates if the boundary
+conditions should take into account (=1) or not (=0) the hydrostatic balance.\\
+always useful.\\
+In the cases where gravity is predominant, taking into account the hydrostatic
+pressure allows to get rid of the disturbances which may appear near the
+horizontal walls when the flow is little convective.\\
+%
+Otherwise, when ICFGRP=0, the pressure condition is calculated
+from the solution of the unidimensional Euler equations for a perfect
+gas near a wall, for the variables ``normal velocity'', ``density'' and
+``pressure'':
+\vspace{0.2cm}
+\begin{list}{}{}
+\item Case of an expansion ($M \leqslant 0$):\\
+$$
+\begin{array}{l}
+\left\{\begin{array}{lll}
+P_p=0 & \text{if} & 1 + \displaystyle\frac{\gamma-1}{2}M<0\\
+P_p = P_i \left(1 + \displaystyle\frac{\gamma-1}{2}M\right)
+^{\frac{2\gamma}{\gamma-1}} & \text{otherwise}\\
+\end{array}\right.\\
+\end{array}
+$$
+
+\item Case of a shock ($M > 0$):\\
+$$
+\begin{array}{l}
+P_p = P_i \left(1 + \displaystyle\frac{\gamma(\gamma+1)}{4}M^2
++\gamma M \displaystyle\sqrt{1+\displaystyle\frac{(\gamma+1)^2}{16}M^2}\right)
+\end{array}
+$$
+
+with $M = \displaystyle\frac{\vect{u}_i \cdot \vect{n}}{c_i}$, internal
+ Mach number calculated with the variables taken in the cell
+ adjacent to the wall.\\
+
+\end{list}
+}
+
+\motcleb{IVISCV}{IA}{0 or 1}{\tt 0}{C}{L1}
+{for each phase IPHAS, IVISCV(IPHAS)=0 indicates that the volume
+viscosity is constant and equal to the reference volume viscosity
+VISCV0(IPHAS).\\
+IVISCV(IPHAS)=1 indicates that the volume viscosity is variable: its
+variation law must be specified in the user subroutine \texttt{uscfpv}.\\
+always useful\\
+The volume viscosity $\kappa$ is defined by the formula expressing the stress:
+\begin{equation}
+ \tens{\sigma} = -P\,\tens{Id} + \mu (\grad\,\vect{u} + \ ^{t}\ggrad\,\vect{u})
+ +(\kappa-\frac{2}{3}\mu)\,\dive(\vect{u})\,\tens{Id}
+\end{equation}
+}
+
+\motcleb{VISCV0}{RA}{real number $\ge$ 0}{0.D0}{O}{L1}
+{for each phase IPHAS, VISCV0(IPHAS) is the reference volume viscosity
+(noted $\kappa$ in the equation expressing $\tens{\sigma}$ in the
+paragraph dedicated to IVISCV)\\
+always useful, it is the used value, unless the user specifies the volume
+viscosity in the user subroutine \texttt{uscfpv}}
+
+\motcle{IGRDPP}{I}{0 ou 1}{0}{O}{L3}
+{indicates whether the pressure should be updated (=1) or not (=0) after the
+solution of the acoustic equation\\
+always useful}
+
+%==================================================
+\subsection{Lagrangian multiphase flows}
+%==================================================
+\label{prg_motscles_lagr}
+
+Most of these key words may be modified in the user subroutines
+\texttt{uslag1}, \texttt{uslag2}, \texttt{uslabo}, \texttt{uslaen},
+\texttt{uslast} and \texttt{uslaed}. It is however strongly recommended
+not to modify those belonging to the level L3.
+
+First of all, it should be noted that the Lagrangian module is compliant with
+all the RANS turbulence models and with laminar flows. However, the particule
+turbulent diffusion is not specially adapted to the second order
+$R_{ij}-\varepsilon$ models. The same isotropic model is used as in the
+$k-\varepsilon$ models, with $k$ calculated from the trace of $R_{ij}$. Also,
+two-way coupling is not compatible with the $k-\omega$ SST model.
+
+
+\subsubsection{Global settings}
+
+\motcleb{IILAGR}{I}{0, 1, 2, 3}{0}{C}{L1}
+{activates ($>$0) or deactivates (=0) the Lagrangian module\\
+the different values correspond to the following modelings: \\
+\hspace*{1.3cm} = 1 Lagrangian two-phase flow in one-way coupling (no influence of
+the particles on the continuous phase)\\
+\hspace*{1.3cm} = 2 Lagrangian two-phase flow with two-way coupling (influence of
+the particles on the dynamics of the continuous phase).
+It must be noted that the two-way coupling is taken
+into account only for the first eulerian phase. Dynamics,
+temperature and mass may be coupled independently\\
+\hspace*{1.3cm} = 3 Lagrangian two-phase flow on frozen continuous phase. This option can
+only be used in case of a calculation restart (ISUITE = 1). All the eulerian
+fields are frozen (including the scalar fields). This option automatically
+implies ICCVFG = 1\\
+always useful}
+
+\motcleb{ISUILA}{I}{0, 1}{0}{C}{L1}
+{activation (=1) or not (=0) of a Lagrangian calculation restart.
+The calculation restart file read when this option is activated (FICAML)
+only contains the data related to the particles (see also ISUIST)\\
+the global calculation must also be a restart calculation (ISUITE=1)\\
+always useful}
+
+\motcleb{ISUIST}{I}{0, 1}{0}{C}{L1}
+{during a Lagrangian calculation restart, indicates whether the particle
+statistics (volume and boundary) and two-way coupling terms are to be read from
+a restart file (=1) or reinitialised (=0). The file to be read is FICMLS\\
+useful if ISUILA = 1}
+
+\motcleb{NBPMAX}{I}{positive or null integer}{1000}{C}{L1}
+{maximum number of particles allowed simultaneously in the calculation
+domain. It must be reminded that the required memory evolves accordingly}
+
+\motcle{NBPART}{I}{positive or null integer}{0}{O}{L3}
+{number of particles treated during one Lagrangian time step\\
+NBPART must always be lower than NBPMAX\\
+always useful, but initialised and updated without intervention of the user}
+
+\motcle{NVLS}{I}{integer between 0 and 10}{0}{O}{L2}
+{number of additional variables related to the particles\\
+the additional variables can be accessed in the arrays
+ETTP\index{ETTP} and ETTPA\index{ETTPA} by means of the pointer
+JVLS\index{JVLS}: ETTP(NBPT,JVLS(II)) and ETTPA(NBPT,JVLS(II)) (NBPT is
+the index-number of the treated particle, and II an integer between 1 and NVLS)}
+
+\motcleb{ISTTIO}{I}{0, 1}{0}{C}{L1}
+{indicates the steady (=1) or unsteady (=0) state of the
+continuous phase flow\\
+in particular, ISTTIO = 1 is needed in order to: \\
+\hspace*{1cm}calculate stationary statistics in the volume or at the boundaries
+(starting respectively from the Lagrangian iterations NSTIST and NSTBOR) \\
+\hspace*{1cm}calculate time-averaged two-way coupling source terms (from the
+Lagrangian iteration NSTITS) \\
+useful if IILAGR=1 or IILAGR=2 (if IILAGR=3, then ISTTIO=1 automatically)}
+
+\motcleb{INJCON}{I}{0, 1}{0}{O}{L1}
+{activates (=1) or not (=0) the continuous injection of particles\\
+this option allows to inject particles continuously during the duration of the
+Lagrangian time step DTP\index{DTP} rather than only once at the
+beginning of the Lagrangian iteration. It helps avoiding the fractioning of
+the particle cloud close to the injection areas}
+
+\motcleb{IROULE}{I}{0, 1}{0}{O}{L1}
+{activates (=1) or not (=0) of the particle cloning/fusion technique
+(option also called ``Russian roulette'')\\
+when IROULE = 1, the importance function must be specified {\em via} the
+array CROULE\index{CROULE} in the user subroutine \texttt{uslaru}}
+
+\motcle{ISUIVI}{I}{0, 1}{0 or 1}{O}{L2}
+{specifies if a particle should be followed (=1) or will disappear from the
+domain (=0) after an interaction with a boundary:\\
+\hspace*{1.3cm} = 0: the particle must not be followed in the
+calculation domain after an iteraction between its trajectory and a
+boundary face, for instance entry (IENTRL), outlet (ISORTL), definitive
+deposition on a wall (IDEPO1, IDEPO2)\\
+\hspace*{1.3cm} = 1: the particle must still be followed in the
+calculation domain after an iteraction between its trajectory and a
+boundary face, for instance rebound (IREBOL), deposition with potential
+resuspension (IDEPO3)\\
+the value of ISUIVI (ISUIVI = 0 or ISUIVI = 1) for a type of interaction
+can be defined as a function of the particle behaviour or properties. It
+is for example the default case for the fouling interaction type (IENCRL)\\
+always useful}
+
+\motcle{TTCLAG}{R}{positive real number}{0}{O}{L3}
+{physical time of the Lagrangian simulation \\
+always useful}
+
+\motcle{IPLAS}{I}{integer $>$ 0}{1}{O}{L3}
+{absolute iteration number (including the restarts) in the Lagrangian
+module ({\em i.e.} Lagrangian time step number) \\
+always useful}
+
+
+%==================================================
+\subsubsection{Specific physics models associated with the particles}
+%==================================================
+
+\motcleb{IPHYLA}{I}{0, 1, 2}{0}{C}{L1}
+{activates ($>$0) or deactivates (=0) the physical models associated to the
+particles:\\
+\hspace*{1.3cm} = 1: allows to associate with the particles evolution
+equations on their temperature (in degrees Celsius), their diameter and
+their mass\\
+\hspace*{1.3cm} = 2: the particles are pulverised coal particles.
+Evolution equations on temperature (in degree Celsius), mass of
+reactive coal, mass of char and diameter of the shrinking core are
+associated with the particles. This option is available only if the
+continuous phase represents a pulverised coal flame\\
+always useful}
+
+\motcleb{IDPVAR}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of an evolution equation on the particle
+diameter\\
+useful if IPHYLA = 1}
+
+\motcleb{ITPVAR}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of an evolution equation on the particle
+temperature (in degrees Celsius)\\
+useful if IPHYLA = 1 and if there is a thermal scalar associated with
+the continuous phase}
+
+\motcleb{IMPVAR}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of an evolution equation on the
+particle mass\\
+useful if si IPHYLA = 1}
+
+\motcleb{TPART}{R}{real number $>$ TKELVN}{700.D0}{O}{L1}
+{initialisation temperature (in degree Celsius) for the particles already
+present in the calculation domain when an evolution equation on
+the particle temperature is activated during a calculation (IPHYLA =
+1 and ITPVAR = 1)\\
+useful if ISUILA = 1 and ITPVAR = 0 in the previous calculation}
+
+\motcleb{CPPART}{R}{positive real number}{5200.D0}{O}{L1}
+{initialisation value for the specific heat ($J.kg^{-1}.K^{-1}$) of the
+particles already present in the calculation domain when an evolution equation
+on the particle temperature is activated during a calculation (IPHYLA =
+1 and ITPVAR = 1)\\
+useful if ISUILA = 1 and ITPVAR = 0 in the previous calculation}
+
+\motcleb{IENCRA}{I}{0, 1}{0}{O}{L1}
+{activates (=1) or not (=0) the option of coal particle
+fouling. It then is necessary to specify the domain boundaries
+on which fouling may take place.\\
+useful if IPHYLA = 2}
+
+\motcleb{TPRENC}{R}{real number $>$ TKELVN}{600.D0}{O}{L1}
+{limit temperature (in degree Celsius) below which the coal particles do
+not cause any fouling (if the fouling model is activated)\\
+useful if IPHYLA = 2 and IENCRA = 1}
+
+\motcleb{VISREF}{R}{positive real number}{10000.D0}{O}{L1}
+{ash critical viscosity in $kg.m^{-1}.s^{-1}$, in the fouling model
+\footnote{J.D. Watt
+et T. Fereday (\textit{J.Inst.Fuel}, Vol.42-p99)}\\
+useful if IPHYLA = 2 and IENCRA = 1}
+
+%==================================================
+\subsubsection{Options for two-way coupling}
+%==================================================
+
+\motcleb{NSTITS}{I}{strictly positive integer}{1}{O}{L1}
+{number of absolute Lagrangian iterations (including the restarts)
+after which a time-average of the two-way coupling source terms is
+calculated\\
+indeed, if the flow is steady (ISTTIO=1), the average quantities that appear in
+the two-way coupling source terms can be calculated over different time steps,
+in order to get a better precision\\
+if the number of absolute Lagrangian iterations is strictly inferior to
+NSTITS, the code considers that the flow has not yet reached its steady state
+(transition period) and the averages appearing in the source terms are
+reinitialised at each time step, as it is the case for unsteady flows (ISTTIO=0)\\
+useful if IILAGR = 2 and ISTTIO = 1}
+
+\motcleb{LTSDYN}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the two-way coupling on the dynamics of the
+continuous phase\\
+useful if IILAGR = 2 and ICCVFG = 0}
+
+\motcleb{LTSMAS}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the two-way coupling on the mass\\
+useful if IILAGR = 2, IPHYLA = 1 and IMPVAR = 1}
+
+\motcleb{LTSTHE}{I}{0, 1}{0}{O}{L1}
+{if IPHYLA = 1 and ITPVAR = 1, LTSTHE activates (=1) or not (=0) the
+two-way coupling on temperature\\
+if IPHYLA = 2, LTSTHE activates (=1) or not (=0) the two-way coupling
+on the eulerian variables related to pulverised coal combustion\\
+useful if IILAGR = 2}
+
+%==================================================
+\subsubsection{Numerical modeling}
+%==================================================
+
+\motcle{NORDRE}{I}{1, 2}{2}{O}{L2}
+{order of integration for the stochastic differential equations\\
+\hspace*{1.3cm} = 1 integration using a first-order scheme\\
+\hspace*{1.3cm} = 2 integration using a second-order scheme\\
+always useful}
+
+\motcle{ILAPOI}{I}{0, 1}{0}{O}{L3}
+{activation (=1) or not (=0) of the solution of a Poisson's equation for
+the correction of the particle instantaneous velocities (in order to obtain a
+null divergence)\\
+this option is not validated and reserved to the development team. Do not change
+the default value}
+
+\motcle{IDISTU}{I}{0, 1}{1}{O}{L3}
+{activation (=1) or not (=0) of the particle turbulent dispersion\\
+the turbulent dispersion is compatible only with the RANS turbulent models
+($k-\varepsilon$, $R_{ij}-\varepsilon$, v2f or $k-\omega$)\\
+(ITURB(IPHAS)=20, 21, 30, 31, 50 or 60 with IPHAS = 1)\\
+always useful}
+
+\motcle{IDIFFL}{I}{0, 1}{0}{O}{L3}
+{IDIFFL=1 suppresses the crossing trajectory effect, making turbulent dispersion
+for the particles identical to the turbulent diffusion of fluid particles\\
+useful if IDISTU=1}
+
+\motcleb{MODCPL}{I}{positive integer}{0}{O}{L1}
+{activates ($>$0) or not (=0) the complete turbulent dispersion model\\
+when MODCPL is strictly positive, its value is interpreted as the absolute
+Lagrangian time step number (including restarts) after which the complete model
+is applied\\
+since the complete model uses volume statistics, MODCPL must either be 0 or be
+larger than IDSTNT\\
+useful if ISTALA = 1}
+
+\motcleb{IDIRLA}{I}{1, 2, 3}{1}{O}{L1}
+{$x$, $y$ or $z$ direction of the complete model\\
+it corresponds to the main directions of the flow\\
+useful if MODCPL $>$ 0}
+
+%==================================================
+\subsubsection{Volume statistics}
+%==================================================
+
+\motcleb{ISTALA}{I}{0, 1}{0}{C}{L1}
+{activation (=1) or not (=0) of the calculation of the volume
+statistics related to the dispersed phase\\
+if ISTALA = 1, the calculation of the statistics is activated starting from the
+absolute iteration (including the restarts) IDSTNT\\
+by default, the statistics are not stationary (reset to zero at every
+Lagrangian iteration). But if ISTTIO=1, since the flow is steady, the statistics
+will be averaged overt he different time steps\\
+the statistics represent the significant results on the particle cloud\\
+always useful}
+
+\motcleb{SEUIL}{R}{positive real number}{0.D0}{O}{L1}
+{every cell of the calculation domain contains a certain quantity of
+particles, representing a certain statistical weight (sum of the
+statistical weights of all the particles present in the cell). SEUIL is
+the limit statistical weight value, below which the contribution of the
+cell in term of statistical weight is not taken into account in the volume
+statistics (for the complete turbulent dispersion model, in the
+Poisson's equation used to correct the mean velocities or in the listing and
+post-processing outputs)\\
+useful if ISTALA = 1}
+
+\motcleb{IDSTNT}{I}{strictly positive integer}{1}{C}{L1}
+{absolute Lagrangian iteration number (includings the restarts) after
+which the calculation of the volume statistics is activated\\
+useful if ISTALA = 1}
+
+\motcleb{NSTIST}{I}{integer $\geqslant$ IDSTNT}{IDSTNT}{O}{L1}
+{absolute Lagrangian iteration number (includings the restarts) after
+which the volume statistics are cumulated over time (they are then said to be
+stationary)\\
+if the absolute Lagrangian iteration number is lower than NSTIST, or if the flow
+is unsteady (ISTTIO=0), the statistics are reset to zero at every Lagrangian
+iteration (the volume statistics are then said to be non-stationary)\\
+useful if ISTALA=1 and ISTTIO=1}
+
+\motcleb{NOMLAG}{CA}{string of less than 50 characters}{VarLagXXXX}{O}{L1}
+{name of the volumetric statistics, displayed in the listing
+and the post-processing files. The default value is given above, with ``XXXX''
+representing a four digit number (for instance 0001, 0011 ...)\\
+useful if ISTALA = 1\\
+{\em Warning: this name is also used to reference information in the restart file
+\mbox{(ISUIST =1)}. If the name of a variable is changed between two
+calculations, it will not be possible to read its value from the restart file}}
+
+\motcleb{NVLSTS}{I}{0 $\leqslant$ integer $\leqslant$ NUSSTA=20}{0}{O}{L1}
+{number of additional user volume statistics\\
+the additional statistics (or their cumulated value in the stationary
+case) can be accessed in the array STATIS by means of the pointer
+ILVU\index{ILVU}: STATIS(IEL,ILVU(II)\index{STATIS}) (IEL is the cell
+index-number and II an integer between 1 and NVLSTS)\\
+useful if ISTALA = 1}
+
+\motcle{NPST}{I}{positive integer}{0}{O}{L3}
+{number of iterations during which stationary volume statistics have
+been cumulated\\
+useful if ISTALA=1, ISTTIO=1 and if NSTIST is inferior or equal to
+the current Lagrangian iteration\\
+NPST is initialised and updated automatically by the code, its value is not to
+be modified by the user}
+
+\motcle{NPSTT}{I}{positive integer}{0}{O}{L3}
+{number of iterations during which volume statistics have been
+calculated (the potential iterations during which non-stationary
+statistics have been calculated are counted in NPSTT)\\
+useful if ISTALA=1\\
+NPSTT is initialised and updated automatically by the code, its value is not to
+be modified by the user}
+
+\motcle{TSTAT}{R}{positive real number}{DTP}{O}{L3}
+{if the volume statistics are calculated in a stationary way, TSTAT
+represents the physical time during which the statistics have been cumulated\\
+if the volume statistics are calculated in a non-stationary way,
+then TSTAT=DTP\index{DTP} (it is the Lagrangian time step, because the
+statistics are reset to zero at every iteration)\\
+useful if ISTALA=1\\
+TSTAT is initialised and updated automatically by the code, its value is not to
+be modified by the user}
+
+%==================================================
+\subsubsection{Display of trajectories and particle movements}
+%==================================================
+
+\motcleb{IENSI1}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the post-processing in trajectory mode\\
+this option generates files allowing to display the trajectory of
+some pre-selected particles in the \textit{EnSight6} format\\
+always useful\\
+{\em Warning: this option very expensive with regards to CPU time and may
+generate very large files}}
+
+\motcleb{IENSI2}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the post-processing in movement
+mode\\
+This option generates files allowing to display the movement of
+some pre-selected particles in the \textit{EnSight6} format\\
+always useful\\
+{\em Warning: this option very expensive with regards to CPU time and may
+generate very large files}}
+
+\motcleb{NBVIS}{I}{positive integer}{NLISTE}{O}{L1}
+{number of particles selected for post-processing display in trajectory or
+movement mode\\
+NBVIS must be lower than NBPMAX and NLISTE (set to 500 in \texttt{lagpar.h} and
+not to be modified)\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{NVISLA}{I}{strictly positive integer}{1}{O}{L1}
+{output period for the post-processing in trajectory or
+movement mode\\
+may be useful to diminish the size of the post-processing files\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{LISTE}{IA}{positive integers}{between 1 and 500}{O}{L1}
+{contains the index-numbers of the particles selected for the display in
+trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{IVISV1}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``velocity of the locally
+undisturbed fluid flow field'' with the display in trajectory or
+movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{IVISV2}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``particle velocity''
+with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 ou IENSI2 = 1}
+
+\motcleb{IVISTP}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``residence time''
+with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{IVISDM}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``particle diameter''
+with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{IVISTE}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``particle temperature''
+with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{IVISMP}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``particle mass''
+with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1}
+
+\motcleb{IVISHP}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``temperature of the coal particles''
+with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1, if and only if IPHYLA = 2}
+
+\motcleb{IVISDK}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``shrinking core diameter of
+the coal particles'' with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1, if and only if IPHYLA = 2}
+
+\motcleb{IVISCH}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``mass of reactive coal of the
+coal particles'' with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1, if and only if IPHYLA = 2}
+
+\motcleb{IVISCK}{I}{0, 1}{0}{O}{L1}
+{associates (=1) or not (=0) the variable ``mass of char of the
+coal particles'' with the display in trajectory or movement mode\\
+useful if IENSI1 = 1 or IENSI2 = 1, if and only if IPHYLA = 2}
+
+%==================================================
+\subsubsection{Display of the particle/boundary interactions and the statistics at the boundaries}
+%==================================================
+
+\motcleb{IENSI3}{I}{0, 1}{0}{C}{L1}
+{activation (=1) or not (=0) of the recording of the particle/boundary
+interactions in PARBOR\index{PARBOR}, and of the calculation of the
+statistics at the corresponding boundaries, for post-processing
+(\textit{EnSight6} format)\\
+By default, the statistics are non-stationary (reset to zero at every
+Lagrangian iteration). They may be stationary if ISTTIO=1 ({\em i.e.}
+calculation of a cumulated value over time, and then calculation of an
+average over time or over the number of interactions with the boundary)\\
+always useful}
+
+\motcleb{NSTBOR}{I}{strictly positive integer}{1}{O}{L1}
+{number of absolute Lagrangian iterations (including the restarts)
+after which the statistics at the boundaries are considered stationary and are
+averaged (over time or over the number of interactions)\\
+If the number of absolute Lagrangian iterations is lower than NSTBOR, or if
+ISTTIO=0, the statistics are reset to zero at every Lagrangian iteration
+(non-stationary statistics)\\
+useful if IENSI3=1 and ISTTIO=1}
+
+\motcleb{SEUILF}{R}{positive real number}{0.D0}{O}{L1}
+{every boundary face of the mesh undergoes a certain number of
+interactions with particles, expressed in term of statistical weight
+(sum of the statistical weights of all the particles which have
+interacted with the boundary face). SEUILF is
+the limit statistical weight value, below which the contribution of the
+face is not taken into account in the
+statistics at the boundaries for post-processing\\
+useful if IENSI3=1}
+
+\motcleb{INBRBD}{I}{0, 1}{1}{O}{L1}
+{activation (=1) or not (=0) of the recording of the number of particle/boundary
+interactions, and of the calculation of the associated boundary statistics.\\
+INBRD = 1 is a compulsory condition to use the particulate average
+IMOYBR = 2\\
+the selection of the type of interactions that are to be recorded is specified
+in the subroutine \texttt{uslabo}\\
+useful if IENSI3=1}
+
+\motcleb{IFLMBD}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the recording of the particulate mass flow
+related to the particle/boundary interactions, and of the calculation of
+the associated boundary statistics\\
+the selection of the type of interactions that are to be recorded is specified
+in the subroutine \texttt{uslabo}\\
+INBRD = 1 is a compulsory condition to use IFLMBD=1\\
+useful if IENSI3=1 and INBRBD=1}
+
+
+\motcleb{IANGBD}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the recording of the angle between a
+particle trajectory and a boundary face involved in a particle/boundary
+interaction, and of the calculation of the associated boundary statistics\\
+the selection of the type of interactions that are to be recorded is specified
+in the subroutine \texttt{uslabo}\\
+useful if IENSI3=1}
+
+\motcleb{IVITBD}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the recording of the velocity of a particle
+involved in a particle/boundary interaction, and of the calculation of
+the associated boundary statistics\\
+the selection of the type of interactions that are to be recorded is specified
+in the subroutine \texttt{uslabo}\\
+useful if IENSI3=1}
+
+\motcleb{IENCBD}{I}{0, 1}{0}{O}{L1}
+{activation (=1) or not (=0) of the recording of the mass of coal particles
+stuck to the wall due to fouling, on the boundary faces of the IENCRL
+interaction type\\
+useful if IENSI3=1, IPHYLA=2,
+IENCRA=1, and if there is at least one boundary face of the IENCRL interaction
+type}
+
+\motcleb{NUSBOR}{I}{positive integer}{0}{O}{L1}
+{number additional user data to record for the calculation
+of additional boundary statistics in PARBOR\index{PARBOR}\\
+useful if IENSI3=1}
+
+\motcleb{NOMBRD}{CA}{string of less than 50 characters}{see
+\texttt{uslag1}}{O}{L1}
+{name of the boundary statistics, displayed in the listing
+and the post-processing files\\
+useful if IENSI3=1\\
+{\em Warning: this name is also used to reference information in the restart file
+\mbox{(ISUIST =1)}. If the name of a variable is changed between two
+calculations, it will not be possible to read its value from the restart file}}
+
+\motcleb{IMOYBR}{IA}{0, 1, 2}{0 , 1 or 2}{O}{L1}
+{the recordings in PARBOR at every particle/boundary interaction are
+cumulated values (possibly reset to zero at every iteration in the
+non-stationary case). They must therefore be divided by a quantity to
+get boundary statistics. The user can choose between two average types:\\
+\hspace*{1.3cm} = 0: no average is applied to the recorded cumulated values\\
+\hspace*{1.3cm} = 1: a time-average is calculated. The cumulated value
+is divided by the physical duration in the case of stationary
+averages (ISTTIO=1). The cumulated value is divided by the value of
+the last time step in the case of non-stationary averages (ISTTIO=0),
+and also in the case of stationary averages while the
+absolute Lagrangian iteration number is inferior to NSTBOR\\
+\hspace*{1.3cm} = 2: a particulate average is calculated. The cumulated
+value is divided by the number of particle/boundary interactions (in term of
+statistical weight) recorded in PARBOR(NFABOR,INBR). This average can only
+be calculated when INBRBD=1. The average is calculated if the number
+of interactions (in statistical weight) of the considered boundary face
+is strictly higher than SEUILF, otherwise the average at the face is set
+to zero\\
+only the cumulated value is recorded in the restart file\\
+useful if IENSI3=1}
+
+\motcle{NPSTF}{I}{positive integer}{0}{O}{L3}
+{number of iterations during which stationary boundary statistics have
+been cumulated\\
+useful if IENSI3=1, ISTTIO=1 and NSTBOR inferior or equal to the
+current Lagrangian iteration\\
+NPSTF is initialised and updated automatically by the code, its value is not to
+be modified by the user}
+
+\motcle{NPSTFT}{I}{positive integer}{0}{O}{L3}
+{number of iterations during which boundary statistics have
+been calculated
+(the potential iterations during which non-stationary
+statistics have been calculated are counted in NPSTFT)\\
+useful if IENSI3=1\\
+NPSTFT is initialised and updated automatically by the code, its value is not to
+be modified by the user}
+
+\motcle{TSTATP}{R}{positive real number}{DTP}{O}{L3}
+{if the recording of the boundary statistics is stationary, TSTATP contains
+the cumulated physical duration of the recording of the boundary statistics\\
+if the recording of the boundary statisticss is non-stationary, then
+TSTAT=DTP\index{DTP} (it is the Lagrangian time step, because the
+statistics are reset to zero at every time step)\\
+useful if IENSI3=1}
diff --git a/doc/user/summary.tex b/doc/user/summary.tex
new file mode 100644
index 0000000..9d026e4
--- /dev/null
+++ b/doc/user/summary.tex
@@ -0,0 +1,94 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% SYNTH�SE
+\vspace*{0.1cm}
+\begin{center}
+\textbf{\large \titreCS}\\
+\medskip
+\textit{ABSTRACT}
+\end{center}
+\vspace*{1cm}
+\pdfbookmark[1]{Abstract}{synthese}
+
+\CS is a system designed to solve the Navier-Stokes
+equations in the cases of 2D, 2D axisymmetric or 3D flows. Its main module is
+designed for the simulation of flows which may be steady or
+unsteady, laminar or turbulent, incompressible or potentially dilatable,
+isothermal or not. Scalars and turbulent fluctuations of scalars can be taken into
+account. The code includes specific modules, referred to as ``specific physics'',
+for the treatment of lagrangian particle tracking, semi-transparent radiative transfer,
+gas combustion, pulverised coal combustion,
+electricity effects (Joule effect and electric arcs) and compressible flows.
+The code also includes an engineering module, Matisse, for the simulation of nuclear waste
+surface storage.\\
+\CS relies on a finite volume discretisation and allows the use of
+various mesh types which may be hybrid (containing several kinds of
+elements) and may have structural non-conformities (hanging nodes).
+
+The present document is a practical user's guide for \CS version \verscs.
+It is the result of the joint effort of
+all the members in the development team.
+It presents all the necessary elements to run a calculation
+with \CS version \verscs. It then lists all the variables of the code
+which may be useful for more advanced utilisation.
+The user subroutines of all the modules within the code are then documented.
+Eventually, for each key word and user-modifiable parameter in the code,
+their definition, allowed values, default values and conditions for use are given.
+These key words and parameters are grouped under headings
+based on their function. An alphabetical index list is also given at the end of
+the document for easier consultation.
+
+\CS 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.
+\CS 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.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% EXECUTIVE SUMMARY
+%\passepage
+%\vspace*{0.1cm}
+%\begin{center}
+%\textbf{\large \titreang}\\
+%\medskip
+%\textit{EXECUTIVE SUMMARY}
+%\end{center}
+%\vspace*{1cm}
+%\pdfbookmark[1]{Excutive summary}{executive summary}
+%
+%This is the executive summary of the report.
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/doc/user/user.tex b/doc/user/user.tex
new file mode 100644
index 0000000..eefbc3f
--- /dev/null
+++ b/doc/user/user.tex
@@ -0,0 +1,117 @@
+%-----------------------------------------------------------------------
+%
+% This file is part of the Code_Saturne Kernel, element of the
+% Code_Saturne CFD tool.
+%
+% Copyright (C) 1998-2008 EDF S.A., France
+%
+% contact: saturne-support at edf.fr
+%
+% The Code_Saturne Kernel 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.
+%
+% The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+% Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor,
+% Boston, MA 02110-1301 USA
+%
+%-----------------------------------------------------------------------
+\documentclass[a4paper,10pt,twoside]{article}
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES OBLIGATOIRES
+\usepackage{csdoc}
+% MACROS SUPPLEMENTAIRES
+\usepackage{csmacros}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES ET COMMANDES POUR LE DOCUMENTS PDF ET LES HYPERLIENS
+\hypersetup{%
+ pdftitle = {CodeSaturne practical user's guide},
+ pdfauthor = {MFEE},
+ pdfpagemode = UseOutlines
+}
+\pdfinfo{/CreationDate (D:20030429000000-01 00 )}
+%
+% To have thumbnails upon opening the document under ACROREAD
+% pdfpagemode = UseThumbs
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% REALISATION D'UN INDEX
+\usepackage{makeidx}
+\makeindex
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PACKAGES ALLTT D'ENVIRONNEMENT VERBATIM AMELIORE
+\usepackage{alltt}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% INFO POUR PAGES DE GARDES
+\titreCS{\CS version~\verscs practical user's guide}
+\docassociesCS{}
+\resumeCS{This document presents all the necessary elements to run a calculation
+with \CS version \verscs. It then lists all the variables of the code
+which may be useful for more advanced utilisation.
+The user subroutines of all the modules within the code are also documented.
+Eventually, for each key word and user-modifiable parameter in the code,
+their definition, allowed values, default values and conditions for use are given.
+These key words and parameters are grouped under headings
+based on their function. An alphabetical index list is also given at the end of
+the document for easier consultation.}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DEBUT DU DOCUMENT
+\begin{document}
+
+\def\contentsname{\textbf{\normalsize TABLE OF CONTENTS}\pdfbookmark[1]{Table of
+contents}{contents}}
+\def\indexname{Index of the main variables and keywords}
+
+\pdfbookmark[1]{Flyleaf}{pdg}
+\large
+\makepdgCS
+\normalsize
+
+\input summary
+
+\passepage
+
+\begin{center}\begin{singlespace}
+\tableofcontents
+\end{singlespace}\end{center}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% CORPS DU DOCUMENT
+%
+\passepage
+\include{saturne1}
+\include{saturne2}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% REFERENCES
+\include{biblio}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% ANNEXES
+%\passepage
+\include{a1_autovalid}
+\phantomsection\addcontentsline{toc}{section}{\indexname}
+\printindex
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FIN DU DOCUMENT
+\end{document}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/examples/1-simple_junction/case1/case1.xml b/examples/1-simple_junction/case1/case1.xml
new file mode 100644
index 0000000..63e12af
--- /dev/null
+++ b/examples/1-simple_junction/case1/case1.xml
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="utf-8"?><Code_Saturne_GUI case="CASE1" study="SIMPLE_JUNCTION" version="1.0">
+ <solution_domain>
+ <volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" scalar_source_term="off" thermal_source_term="off">all[]</zone>
+ </volumic_conditions>
+ <meshes_list>
+ <mesh format="des" name="downcomer.des"/>
+ </meshes_list>
+ <join_meshes status="off"/>
+ <faces_cutting status="off"/>
+ <reorientation status="off"/>
+ <syrthes_coupling status="off"/>
+ <periodic_boundary/>
+ <standalone/>
+ </solution_domain>
+ <thermophysical_models>
+ <velocity_pressure>
+ <variable label="Pression" name="pressure">
+ <reference_pressure>101325</reference_pressure>
+ </variable>
+ <variable label="VitesseX" name="velocity_U">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseY" name="velocity_V">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseZ" name="velocity_W">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>
+ <ale_method status="off"/>
+ <turbulence model="k-epsilon">
+ <variable label="EnerTurb" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="visc. tu" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ <scale_model>1</scale_model>
+ <gravity_terms status="on"/>
+ </turbulence>
+ <thermal_scalar model="temperature_celsius">
+ <property label="Flux_thermique_entrant" name="input_thermal_flux" support="boundary"/>
+ </thermal_scalar>
+ <radiative_transfer model="off">
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ </radiative_transfer>
+ <gas_combustion model="off"/>
+ <pulverized_coal model="off"/>
+ <joule_effect model="off"/>
+ <atmospheric_flows model="off">
+ <read_meteo_data status="off"/>
+ </atmospheric_flows>
+ </thermophysical_models>
+ <numerical_parameters>
+ <multigrid status="on"/>
+ <gradient_transposed status="on"/>
+ <velocity_pressure_coupling status="off"/>
+ <pressure_relaxation>1</pressure_relaxation>
+ <wall_pressure_extrapolation>0</wall_pressure_extrapolation>
+ <gradient_reconstruction choice="0"/>
+ </numerical_parameters>
+ <physical_properties>
+ <fluid_properties>
+ <property choice="constant" label="Masse vo" name="density">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>725.735</initial_value>
+ </property>
+ <property choice="constant" label="Visc. la" name="molecular_viscosity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>8.95e-05</initial_value>
+ </property>
+ <property choice="constant" label="Ch.spec." name="specific_heat">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>5483</initial_value>
+ </property>
+ <property choice="constant" label="Cond. th" name="thermal_conductivity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>0.02495</initial_value>
+ </property>
+ </fluid_properties>
+ <gravity>
+ <gravity_x>0</gravity_x>
+ <gravity_y>0</gravity_y>
+ <gravity_z>0</gravity_z>
+ </gravity>
+ <hydrostatic_pressure status="off"/>
+ </physical_properties>
+ <additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ </additional_scalars>
+ <boundary_conditions>
+ <boundary label="Inlet" name="1" nature="inlet">1</boundary>
+ <inlet label="Inlet">
+ <velocity_pressure choice="norm" direction="coordinates">
+ <norm>1</norm>
+ <direction_x>1</direction_x>
+ <direction_y>0</direction_y>
+ <direction_z>0</direction_z>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>0.5</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="Temp.C" name="temperature_celsius" type="thermal">
+ <dirichlet>300</dirichlet>
+ </scalar>
+ </inlet>
+ <boundary label="Outlet" name="2" nature="outlet">5</boundary>
+ <outlet label="Outlet">
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ </outlet>
+ <boundary label="Symmetry" name="3" nature="symmetry">8 or 9</boundary>
+ <symmetry label="Symmetry"/>
+ <boundary label="Walls" name="4" nature="wall">2 or 3 or 4 or 6 or 7</boundary>
+ <wall label="Walls">
+ <velocity_pressure choice="off">
+ <dirichlet name="velocity_U">0</dirichlet>
+ <dirichlet name="velocity_V">0</dirichlet>
+ <dirichlet name="velocity_W">0</dirichlet>
+ </velocity_pressure>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <variable/>
+ </boundary_conditions>
+ <analysis_control>
+ <output>
+ <postprocessing_mesh_options choice="0"/>
+ <domain_boundary status="off"/>
+ <listing_printing_frequency>1</listing_printing_frequency>
+ <postprocessing_frequency>-1</postprocessing_frequency>
+ <probe_recording_frequency>1</probe_recording_frequency>
+ <fluid_domain status="on"/>
+ <postprocessing_format choice="EnSight"/>
+ <postprocessing_options choice="binary"/>
+ </output>
+ <time_parameters>
+ <property label="Nb Courant" name="courant_number"/>
+ <property label="Nb Fourier" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>0</time_passing>
+ </time_parameters>
+ <steady_management status="on">
+ <zero_iteration status="off"/>
+ <iterations>30</iterations>
+ <relaxation_coefficient>0.9</relaxation_coefficient>
+ </steady_management>
+ <time_averages/>
+ </analysis_control>
+ <calcul_management>
+ <integer_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </integer_user_array>
+ <real_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </real_user_array>
+ </calcul_management>
+ <lagrangian model="off"/>
+</Code_Saturne_GUI>
diff --git a/examples/1-simple_junction/case1/runcase b/examples/1-simple_junction/case1/runcase
new file mode 100755
index 0000000..97d4218
--- /dev/null
+++ b/examples/1-simple_junction/case1/runcase
@@ -0,0 +1,1125 @@
+#!/bin/sh
+# bin/runcase. Generated from runcase.in by configure.
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# BATCH FILE FOR THE CCRT (Platine under LSF)
+# ===========================================
+#
+#BSUB -n 2
+#BSUB -W 00:05
+#BSUB -o simple_junctioncase1o.%J
+#BSUB -e simple_junctioncase1e.%J
+#BSUB -J simple_junctioncase1
+#
+# -n : number of processors
+# -W : walltime as hh:mm
+# -o : output file name
+# -e : error file name
+# -J : job name
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE FOR THE Chatou CLUSTER (PBS)
+# =======================================
+#
+#PBS -l nodes=4:ppn=2
+#PBS -l walltime=1:00:00
+#PBS -l mem=320mb
+#
+#PBS -j eo
+#PBS -N simple_junctioncase1
+#
+# nodes : number of nodes
+# ppn : number of process per node
+# walltime : wall clock time (hh:mm:ss)
+# mem : memory
+#
+#WARNING: when coupling with SYRTHES, 1 processor will be reserved for each
+# instance of SYRTHES. The Kernel will be executed on the remaining
+# processors, so make sure to reserve a sufficiently high number
+# of processors.
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (University of Manchester Cluster)
+# =============================================
+#
+# set the name of the job
+##$ -N simple_junctioncase1
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (AIX, Loadlever)
+# ===========================
+#
+#@ shell = /bin/sh
+#
+#@ job_name = simple_junctioncase1
+#
+#@ job_type = parallel
+#@ cpus = 128
+#@ node_usage = not_shared
+#
+#@ network.MPI = csss,shared,US
+#@ bulkxfer = yes
+#
+#@ wall_clock_limit = 00:20:00
+#@ account_no = z001
+#
+#@ output = $(job_name).$(schedd_host).$(jobid).out
+#@ error = $(job_name).$(schedd_host).$(jobid).err
+#@ notification = never
+#
+#@ queue
+# suggested environment settings:
+# export MP_EAGER_LIMIT=65536
+# export MP_SHARED_MEMORY=yes
+# export MEMORY_AFFINITY=MCM
+# export MP_TASK_AFFINITY=MCM
+#
+########################################################################
+#
+# BEGINNING OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+# runcase.help gives more details about the different variables.
+#
+# -------------------------------
+#
+SOLCOM=0
+#
+# On some systems, some external libraries may require TERM to be defined.
+export TERM=xterm
+#
+STUDY=SIMPLE_JUNCTION
+CASE=CASE1
+PARAM=case1.xml
+MESH=downcomer.des
+COMMAND_REORIENT=
+COMMAND_JOIN=
+COMMAND_CWF=
+COMMAND_PERIO=
+THERMOCHEMISTRY_DATA=
+METEO_DATA=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS=
+PROCESSOR_LIST=
+#
+PARTITION_LIST=
+#
+USER_INPUT_FILES=
+USER_OUTPUT_FILES=
+#
+# Working directory (leave empty for automatic default directory)
+CS_TMP_PREFIX=
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+CS_LIB_ADD=
+VALGRIND=
+#
+ARG_CS_VERIF=
+ARG_CS_OUTPUT=
+#
+# Adaptation using HOMARD
+ADAPTATION=
+#
+summary=summary
+CASEDIR=/home/saturne/TEST_CASE/SIMPLE_JUNCTION/CASE1
+DATA=$CASEDIR/DATA
+RESU=$CASEDIR/RESU
+SRC=$CASEDIR/SRC
+SCRIPTS=$CASEDIR/SCRIPTS
+RESTART_IN=$DATA/RESTART
+PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+MESHDIR=$CASEDIR/../MESH
+#
+# The following variables are only used in case of coupling with SYRTHES.
+# DATA_SYR: directory where to find SYRTHES_ENV
+# SRC_SYR: directory where to find possible user source files
+DATA_SYR=$CASEDIR/DATA_SYR
+SRC_SYR=$CASEDIR/SRC_SYR
+SYRTHES_ENV=syrthes.env
+#
+# The possible coupling mode with SYRTHES may be chosen here.
+#
+# COUPLING_MODE=MPI : should work on most machines.
+# COUPLING_MODE=sockets : should be activated on clusters when the MPI rank
+# of a process is not determinable or if MPI can
+# not be used.
+COUPLING_MODE=MPI
+ECHO_SYR_COMM=""
+#
+# Indicate which steps should be executed; if both the Preprocessor and the
+# Kernel are executed, the "preprocessor_output" and eventual "domain_number_*"
+# files are not saved. If only the preprocessor and / or partitioner are
+# executed, the corresponding files will be saved in a RESU/PREPROCESSOR_OUTPUT
+# and RESU/PARTITION directory. If the Preprocessor is not executed,
+# "preprocessor_output" will be read from $PREPROCESSOR_OUTPUT_IN. If the
+# Partitioner is not executed, "domain_number_*" will be read from
+# $PARTITION_OUTPUT_IN if available (otherwise, unoptimized default
+# partitioning will be used).
+#
+# EXEC_PREPROCESS : should the Preprocessor be run ? (yes/no)
+# EXEC_PARTITION : should the Partitioner be run ? (yes/no)
+# EXEC_KERNEL : should the Kernel be run ? (yes/no)
+#
+EXEC_PREPROCESS=yes
+EXEC_PARTITION=yes
+EXEC_KERNEL=yes
+#
+#
+#
+########################################################################
+#
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Kernel installation parameters
+#
+prefix=/home/saturne/Code_Saturne/2.0-beta2/arch/Linux_x86_64
+#
+exec_prefix=${prefix}
+bindir=${exec_prefix}/bin
+datarootdir=${prefix}/share
+datadir=${datarootdir}
+pkgdatadir=${datadir}/ncs
+#
+# Preprocessor installation parameters
+#
+ecs_prefix=
+#
+ecs_exec_prefix=${ecs_prefix}
+ecs_bindir=${ecs_exec_prefix}/bin
+#
+# HOMARD installation parameters (to be completed if needed)
+#
+homard_prefix=
+#
+########################################################################
+# Mesh Adaptation
+#
+if [ ! -z "${ADAPTATION}" ] ; then
+ if [ "${ADAPTATION}" = "-help" ] ; then
+ ${homard_prefix}/saturne_homard ${ADAPTATION}
+ exit 0
+ else
+ HOMARD_options=" -v"
+ ${homard_prefix}/saturne_homard -Saturne_Script $0 -Donnees_Calcul $CASEDIR \
+ -Pilotage_Adaptation $ADAPTATION $HOMARD_options || exit 1
+ fi
+fi
+#
+#########################################################################
+#
+N_SYRTHES_COUPLINGS=0
+if [ -f "${SRC}/ussyrc.f90" ] ; then
+ N_SYRTHES_COUPLINGS=`grep -e ^' ' ${SRC}/ussyrc.f90 | grep -i -c defsyr`
+fi
+#
+if [ $N_SYRTHES_COUPLINGS = 0 ] ; then
+ SYRTHES_COUPLING=no
+else
+ SYRTHES_COUPLING=yes
+ export SYRTHES
+ if [ $N_SYRTHES_COUPLINGS -gt 1 ] ; then
+ echo "This script can not handle multiple couplings with SYRTHES"
+ echo "Number of SYRTHES couplings requested: $N_SYRTHES_COUPLINGS"
+ fi
+fi
+#
+if [ $SYRTHES_COUPLING = yes ] ; then
+ if [ $SOLCOM -eq 1 ] ; then
+ echo "SYRTHES coupling is not compatible with SOLCOM-type meshes"
+ exit 1
+ fi
+else
+ COUPLING_MODE=
+fi
+#
+########################################################################
+#
+# Parameters for execution
+#
+# General variables
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIX=$DATE
+EXE=cs_solver
+EXE_SYR=syrthes
+#
+# Copy runcase before changing to the working directory
+# (as after that, the relative path will not be up to date).
+#
+cp $0 $RESU/runcase.$SUFFIX
+#
+# Execution directory (reachable by all the processors)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+else
+# Default if not specified by the user
+#
+# On the CCRT, there is no TMPDIR. We work by default in SCRATCHDIR
+ if [ "$SCRATCHDIR" != "" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+ else
+ RUN=$HOME/tmp_Saturne/$STUDY.$CASE.$DATE
+ fi
+fi
+#
+# Create directory if necessary
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "RUN=$RUN already exists."
+ echo "The simulation will not be run."
+ exit 1
+ fi
+fi
+#
+# Create a temporary file for Salome (equivalent to "ficstp")
+if [ "$ARG_CS_OUTPUT" = "--log 0" ] ; then
+ echo $RUN > $SCRIPTS/runningstd.$DATE
+else
+ echo $RUN > $SCRIPTS/runningext.$DATE
+fi
+#
+cd $RUN
+#
+########################################################################
+#
+# Set up MPI environment
+#
+# Use makefile query to obtain the path to MPI binaries if those are
+# not on the default path. This is a peculiar use of make, but allows
+# us to avoid defining the MPI configuration in multiple files.
+
+CS_MPI_PATH=/home/saturne/opt/openmpi-1.3.1/arch/Linux_x86_64/bin
+
+# NUMBER_OF_PROCESSORS is determined here if not already set;
+# MPIHOSTS, MPIRUN, MPIBOOT, MPIHALT, and NUMBER_OF_NODES are
+# defined by the sourced script, and PATH may be updated.
+#
+. ${pkgdatadir}/runcase_mpi_env
+#
+# Check for the number of requested processors
+nproc_kernel="${NUMBER_OF_PROCESSORS}"
+echo
+echo
+if [ $SYRTHES_COUPLING = yes ] ; then
+ echo "Coupling of Code_Saturne and SYRTHES activated."
+ # 1 processor is reserved for SYRTHES if coupled through MPI.
+ if [ "$COUPLING_MODE" = "MPI" ] ; then
+ (( nproc_kernel = nproc_kernel - N_SYRTHES_COUPLINGS ))
+ if [ $nproc_kernel -lt 1 ] ; then
+ echo
+ echo
+ echo " Warning, if COUPLING_MODE = MPI, SYRTHES reserves 1 processor"
+ echo " (which need not be a physical processor)."
+ echo " Here, NUMBER_OF_PROCESSORS=${NUMBER_OF_PROCESSORS}, while it must"
+ echo " be strictly greater than 1."
+ echo " Increase the number of requested processors."
+ echo
+ exit 1
+ fi
+ fi
+fi
+if [ $nproc_kernel -gt 1 ] ; then
+ echo "Parallel Code_Saturne with partitioning in $nproc_kernel sub-domains"
+ if [ $SOLCOM = 1 ] ; then
+ echo
+ echo
+ echo " Parallel run impossible with SOLCOM = $SOLCOM "
+ echo " Use SOLCOM = 0 "
+ echo
+ exit 1
+ fi
+else
+ echo "Single processor Code_Saturne simulation"
+fi
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "Total number of processors: $NUMBER_OF_PROCESSORS"
+fi
+#
+# In parallel mode, the corresponding argument must be set
+if [ $nproc_kernel -gt 1 ] ; then
+ ARG_CS_MPI=" --mpi"
+else
+ ARG_CS_MPI=""
+fi
+#
+#
+########################################################################
+#
+# Communications
+#
+# To help debug coupling problems, make communication more verbose
+if [ ! -z "$ECHO_SYR_COMM" ] ; then
+ ECHOCOMMSYR="-echo-comm $ECHO_SYR_COMM"
+else
+ ECHOCOMMSYR=""
+fi
+########################################################################
+# Greeting message
+#
+echo ' '
+echo ' Code_Saturne is running '
+echo ' *********************** '
+echo ' '
+echo ' Working directory (to be periodically cleaned) : '
+echo ' ' $RUN
+#
+########################################################################
+#
+# Compilation and link
+#
+# Note: we also check the for the presence of certain user subroutines here.
+#
+echo
+echo ' Kernel version: ' $prefix
+echo ' Preprocessor version: ' $ecs_prefix
+
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ cur_dir=`pwd`
+
+ source_cas=$SRC
+
+ #
+ # Copy of the parameter file
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMAND_PARAM="--param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The parameters file ' $var
+ echo ' can not be accessed.'
+ exit 1
+ fi
+ fi
+
+ src_files=`ls ${source_cas}/*.[fF]90 ${source_cas}/*.[ch] 2>/dev/null`
+
+ if [ ! -z "${src_files}" ] ; then
+
+ echo
+ echo " ***************************************************************"
+ echo " Compilation of user subroutines and linking of Code_Saturne"
+ echo " ***************************************************************"
+
+ if [ -f compil.log ] ; then
+ rm -f compil.log
+ fi
+
+ src_dir="src_saturne"
+
+ # Copy of the user source files
+ # (no links: the directory is copied later)
+ mkdir ${src_dir}
+ for f in ${src_files} ; do
+ if [ -f $f ] ; then
+ cp ${f} ${src_dir}/
+ fi
+ done
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --source=$src_dir --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ # Compilation
+ if [ ! -z "${CS_LIB_ADD}" ] ; then
+ OPTLIBS="--opt-libs=${CS_LIB_ADD}"
+ fi
+ ${bindir}/cs compile \
+ --source=$src_dir ${OPTLIBS} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ echo "COMPILE OR LINK ERROR"
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ fi
+
+ else
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ ln -s ${bindir}/$EXE .
+
+ fi
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+
+ ${pkgdatadir}/runcase_syrthes -compile \
+ -cs-bindir=${bindir} -src-syr=${SRC_SYR} \
+ -src-copy=${RESU}/SRC_SYR.${SUFFIX} -log=${RESU}/compil_syrthes.log.${SUFFIX}
+
+ fi
+
+fi # EXEC_KERNEL = yes
+
+#
+########################################################################
+#
+# Data setup
+#
+echo
+echo " ********************************************"
+echo " Preparing calculation "
+echo " ********************************************"
+echo
+#
+ERROR=false
+PREPROCESS_ERROR=false
+PARTITION_ERROR=false
+EXECUTION_ERROR=false
+#
+if [ $SOLCOM = 1 ]
+then
+ EXEC_PREPROCESS=no
+ EXEC_PARTITION=no
+ ln -s $MESHDIR/$MESH geomet || exit 1
+fi
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ]
+then
+ for var in $MESH ; do
+ ln -s $MESHDIR/$var $var || exit 1
+ # Special case for meshes in EnSight format: link to .geo file necessary
+ # (retrieve name through .case file)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $MESHDIR/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+else
+ if [ -f ${PREPROCESSOR_OUTPUT_IN} ] ; then
+ ln -s ${PREPROCESSOR_OUTPUT_IN} preprocessor_output || exit 1
+ else
+ echo "Error: no preprocessor output file is available;"
+ echo " (${PREPROCESSOR_OUTPUT_IN} does not exist."
+ echo " or is not a standard file."
+ exit 1
+ fi
+fi
+#
+if [ $nproc_kernel -eq 1 -a "${EXEC_KERNEL}" = "yes" ] ; then
+ EXEC_PARTITION=no
+elif [ "${EXEC_PARTITION}" = "no" -a "${PARTITION_OUTPUT_IN}" != "" ]
+then
+ if [ -f ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} ] ; then
+ ln -s ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} .
+ else
+ echo "Warning: no partitioning file is available;"
+ echo " (no ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel})."
+ echo
+ echo " Unoptimized partitioning will be used."
+ echo " Parallel performance may be degraded."
+ fi
+fi
+#
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ for var in ${RESTART_IN}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "$THERMOCHEMISTRY_DATA" != "" ] ; then
+ var=$DATA/$THERMOCHEMISTRY_DATA
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # Copy so as to have correct name upon backup
+ if [ "$THERMOCHEMISTRY_DATA" != "dp_tch" ] ; then
+ cp dp_tch $THERMOCHEMISTRY_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The thermochemistry file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ if [ "$METEO_DATA" != "" ] ; then
+ var=$DATA/$METEO_DATA
+ if [ -f $var ] ; then
+ cp $var meteo
+ # Copy so as to have correct name upon backup
+ if [ "$METEO_DATA" != "meteo" ] ; then
+ cp meteo $METEO_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The meteo profile file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ for f in uscpcl.f90 usd3pc.f90 usebuc.f90 uslwcc.f90 usfucl.f90
+ do
+ if [ -f "${SRC}/${f}" -a ! -f JANAF ] ; then
+ cp ${datadir}/data/thch/JANAF JANAF
+ fi
+ done
+ #
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ #
+ ${pkgdatadir}/runcase_syrthes -copy-data -syrthes-env=${DATA_SYR}/$SYRTHES_ENV
+ #
+ fi
+ #
+ if [ ! -z "$USER_INPUT_FILES" ] ; then
+ for f in $USER_INPUT_FILES ; do
+ cp $DATA/$f .
+ done
+ fi
+ #
+fi # EXEC_KERNEL = yes
+
+########################################################################
+# Maximum time for PBS (done here so as to leave time for PBS to
+# realize that things have started).
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Summary: start
+#
+CURDATE=`unset LANG ; date`
+#
+echo '========================================================'>>$summary
+echo ' Start time : ' $CURDATE >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Kernel : ' $prefix >>$summary
+echo ' Preprocessor : ' $ecs_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' HOMARD : ' $homard_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' CS_MPI_PATH : ' $CS_MPI_PATH >>$summary
+echo ' PATH : ' $PATH >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' User : ' $USER >>$summary
+echo '========================================================'>>$summary
+echo ' Machine : ' >>$summary
+ uname -a >>$summary
+if [ -z "$NUMBER_OF_PROCESSORS" ] ; then
+ echo ' N Procs : ' 1 >>$summary
+else
+ echo ' N Procs : ' $NUMBER_OF_PROCESSORS >>$summary
+fi
+if [ -z "$PROCESSOR_LIST" ] ; then
+ echo ' Processors : ' default >>$summary
+else
+ echo ' Processors : ' $PROCESSOR_LIST >>$summary
+fi
+echo '========================================================'>>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Case : ' $CASE >>$summary
+echo ' DATA : ' $DATA >>$summary
+echo ' SRC : ' $SRC >>$summary
+echo ' RESU : ' $RESU >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Exec. dir. : ' $RUN >>$summary
+echo ' ----------------------------------------------------' >>$summary
+if [ "$EXEC_PREPROCESSOR" = "yes" ] ; then
+ echo ' Preprocessor : ' ${ecs_bindir}/cs_preprocess >>$summary
+fi
+if [ "$EXEC_PARTITION" = "yes" ] ; then
+ echo ' Partitioner : ' ${ecs_bindir}/cs_partition >>$summary
+fi
+if [ "$EXEC_KERNEL" = "yes" ] ; then
+ echo ' Executable : ' $EXE >>$summary
+fi
+echo ' ----------------------------------------------------' >>$summary
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Starting calculation"
+echo " ********************************************"
+echo
+#
+# Preprocessor start
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ] ; then
+ #
+ ${ecs_bindir}/cs_preprocess --mesh $MESH "--case" $CASE \
+ $COMMAND_REORIENT $COMMAND_JOIN $COMMAND_PERIO \
+ > listpre 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error running the preprocessor."
+ echo "Check preprocessor log (listpre) for details."
+ echo
+ PREPROCESS_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PREPROCESSOR_OUTPUT_OUT=$RESU/preprocessor_output.$SUFFIX
+ cp preprocessor_output ${PREPROCESSOR_OUTPUT_OUT}
+ fi
+ #
+fi
+#
+# Partitioner start
+#
+if [ ! -f ${ecs_bindir}/cs_partition ] ; then
+ echo "Warning: ${ecs_bindir}/cs_partition not found."
+ echo
+ echo "The partitioner may not have been installed"
+ echo " (this is the case if neither METIS nor."
+ echo " SCOTCH are avaialable)."
+ echo
+ echo "Unoptimized partitioning will be used, so"
+ echo "parallel performance may be degraded."
+ echo
+ EXEC_PARTITION=no
+fi
+#
+if [ "${EXEC_PARTITION}" = "yes" ] ; then
+ #
+ if [ "${EXEC_KERNEL}" = "yes" ] ; then
+ ${ecs_bindir}/cs_partition $nproc_kernel > listpart 2>&1
+ else
+ if [ -z "$PARTITION_LIST" ] ; then
+ echo "Error running the partitioner."
+ echo "PARTITION_LIST is not set."
+ echo "This variable should contain the number of processors"
+ echo "for which we partition (or a list of such numbers)."
+ PARTITION_ERROR=true
+ ERROR=true
+ else
+ ${ecs_bindir}/cs_partition $PARTITION_LIST > listpart 2>&1
+ fi
+ fi
+ if [ $? != 0 -a $PARTITION_ERROR = false ] ; then
+ echo "Error running the partitioner."
+ echo "Check partitioner log (listpart) for details."
+ echo
+ PARTITION_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PARTITION_OUTPUT_OUT=$RESU/PARTITION_OUTPUT.$SUFFIX
+ mkdir $PARTITION_OUTPUT_OUT
+ cp -r domain_number_* ${PARTITION_OUTPUT_OUT}/
+ fi
+#
+fi
+#
+# Run calculation proper.
+#
+if [ "$ERROR" != "true" -a "$EXEC_KERNEL" = "yes" ] ; then
+#
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ # MPI Communication
+ #
+ # Make sure to transmit possible additional arguments assigned by mpirun to
+ # the executable with some MPI-1 implementations (vanilla MPICH 1.2 sets the
+ # parameters needed by MPI_Init through argc/argv): we use $@ to forward
+ # arguments passed to localexec to the true executable files.
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`${pkgdatadir}/runcase_mpi_rank \$@\`" >> $localexec
+ echo cd $RUN >> $localexec
+ echo "if [ \$MPI_RANK -eq 0 ] ; then" >> $localexec
+ echo " $RUN/$EXE_SYR \$@ -app-num 0 -comm-mpi 1 $ECHOCOMMSYR > listsyr 2>&1" >> $localexec
+ echo "else" >> $localexec
+ echo " $VALGRIND $RUN/$EXE \$@ --mpi 1 $COMMAND_CWF "\
+ "$ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM " >> $localexec
+ echo "fi" >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ #
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ elif [ $SYRTHES_COUPLING = yes ] ; then
+ # Socket communications
+ #
+ # We provide the executables with a "random" port number.
+ PORT=35623
+ SOCKETNCS="--syr-socket $PORT"
+ SOCKETSYR="-comm-socket $PORT"
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI $COMMAND_CWF "\
+ " $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM $SOCKETNCS " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true &
+ #
+ ./$EXE_SYR $ECHOCOMMSYR $SOCKETSYR > listsyr 2>&1
+ #
+ $MPIHALT
+ #
+ elif [ $SOLCOM = 0 ] ; then
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI "\
+ " $COMMAND_CWF $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ else # cas SOLCOM = 1
+ #
+ $VALGRIND $RUN/$EXE --solcom \
+ $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM \
+ || EXECUTION_ERROR=true
+ #
+ fi
+#
+fi
+#
+# Remove the Salome temporary files
+rm -f $SCRIPTS/running*.$DATE
+#
+########################################################################
+#
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ echo "Error running the coupled calculation."
+ echo "Either the Kernel or SYRTHES may have failed."
+ echo
+ echo "Check Kernel log (listing) and SYRTHES log (listsyr) for details,"
+ echo "as well as eventual error* files."
+ echo
+ else
+ echo "Error running the calculation."
+ echo
+ echo "Check Kernel log (listing) and error* files for details"
+ echo
+ fi
+ ERROR=true
+fi
+#
+# Treatment of the ouput files:
+# Starts with the restart files
+# (in case of full disk, increases chances of being able to continue).
+#
+if [ $EXEC_KERNEL = yes ] ; then
+
+ RESTART_OUT=$RESU/RESTART.$SUFFIX
+ iok=1
+ mkdir ${RESTART_OUT} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f ${RESTART_OUT}
+ fi
+ done
+ else
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+
+ resuser=0
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIX
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f ${RES_USER}
+ fi
+ done
+ else
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+ fi
+
+ for f in $PARAM $THERMOCHEMISTRY_DATA $METEO_DATA ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+
+ for f in probes_*.dat ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+ for f in ush* ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+
+fi # output files
+
+for f in list* error* *.med *.cgns ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+done
+
+# Treatment of EnSight and MED files
+# The $dir (=*.ensight and/or *.med) directories are copied
+# to $DIR.$SUFFIX
+
+# We place directories $dir (=*.ensight and/or *.med)
+# in $DIR.$SUFFIX
+
+cas=`echo $CASE |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Creating $RESU/$DIR.$SUFFIX failed
+ else
+ for f in $dir/* ; do
+ if [ -f $f ] ; then
+ cp -R ${f} $RESU/$DIR.$SUFFIX/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ rayt_list=`ls bord* 2>/dev/null`
+ if [ ! -z "${rayt_list}" ] ; then
+ for f in $rayt_list ; do
+ if [ ! -d $RESU/CHR.$SUFFIX ] ; then
+ mkdir $RESU/CHR.$SUFFIX
+ fi
+ cp $f $RESU/CHR.$SUFFIX/.
+ done
+ fi
+
+ lagr_list=`ls debug* deplacement* trajectoire* frontiere* 2>/dev/null`
+ if [ ! -z "${lagr_list}" ] ; then
+ mkdir $RESU/LAGR.$SUFFIX
+ for f in $lagr_list ; do
+ cp $f $RESU/LAGR.$SUFFIX
+ done
+ fi
+
+ # Matisse output files
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # The date is added to the first line of resuMatisse
+ AFDATE="Date of the case : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIX
+ fi
+
+ for dir in src_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/SRC.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Failure creating $RESU/SRC.$SUFFIX
+ else
+ for f in $dir/*.[fF]90 $dir/*.[ch] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} $RESU/SRC.$SUFFIX/.
+ fbase=`basename ${f}`
+ chmod a-w $RESU/SRC.$SUFFIX/${fbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ ${pkgdatadir}/runcase_syrthes -copy-results \
+ -result-dir=${RESU}/RESU_SYR.${SUFFIX}
+ fi
+
+fi # input data and outputs
+#
+########################################################################
+#
+# Summary: end
+#
+if [ "$PREPROCESS_ERROR" = "true" ] ; then
+ EXEC_PREPROCESS="failed"
+fi
+echo " Preprocessing : " $EXEC_PREPROCESS >>$summary
+if [ "$PARTITION_ERROR" = "true" ] ; then
+ EXEC_PARTITION="failed"
+fi
+echo " Partitioning : " $EXEC_PARTITION >>$summary
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ EXEC_KERNEL="failed"
+fi
+echo " Calculation : " $EXEC_KERNEL >>$summary
+#
+CURDATE=`unset LANG ; date`
+#
+echo ' ----------------------------------------------------' >>$summary
+echo ' Finish time : ' $CURDATE >>$summary
+echo '========================================================'>>$summary
+#
+cp $summary $RESU/$summary.$SUFFIX
+#
+########################################################################
+#
+#
+# Finish
+#
+echo
+echo " ********************************************"
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ echo " Error in calculation stage."
+elif [ "$PARTITION_ERROR" = "true" ] ; then
+ echo " Error in partitioning stage."
+elif [ "$PREPROCESS_ERROR" = "true" ] ; then
+ echo " Error in preprocessing stage."
+else
+ echo " Normal simulation finish"
+fi
+echo " ********************************************"
+
+if [ "$ERROR" = "true" ] ; then
+ exit 1
+else
+ exit 0
+fi
+#
+########################################################################
diff --git a/examples/1-simple_junction/mesh/downcomer.des b/examples/1-simple_junction/mesh/downcomer.des
new file mode 100644
index 0000000..e254292
Binary files /dev/null and b/examples/1-simple_junction/mesh/downcomer.des differ
diff --git a/examples/2-full_domain/case2/case2.xml b/examples/2-full_domain/case2/case2.xml
new file mode 100644
index 0000000..ab97d24
--- /dev/null
+++ b/examples/2-full_domain/case2/case2.xml
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="utf-8"?><Code_Saturne_GUI case="CASE2" study="FULL_DOMAIN" version="1.0">
+ <solution_domain>
+ <volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" scalar_source_term="off" thermal_source_term="off">all[]</zone>
+ </volumic_conditions>
+ <meshes_list>
+ <mesh format="des" name="downcomer.des"/>
+ <mesh format="des" name="fdc.des"/>
+ <mesh format="des" name="pic.des"/>
+ </meshes_list>
+ <join_meshes status="on">
+ <faces_join name="1" status="on">
+ <faces_color>5 24 32</faces_color>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ </faces_join>
+ </join_meshes>
+ <faces_cutting status="off"/>
+ <reorientation status="off"/>
+ <syrthes_coupling status="off"/>
+ <periodic_boundary/>
+ <standalone/>
+ </solution_domain>
+ <thermophysical_models>
+ <velocity_pressure>
+ <variable label="Pression" name="pressure">
+ <reference_pressure>101325</reference_pressure>
+ <listing_printing status="off"/>
+ </variable>
+ <variable label="VitesseX" name="velocity_U">
+ <probes choice="5">
+ <probe_recording name="1"/>
+ <probe_recording name="2"/>
+ <probe_recording name="6"/>
+ <probe_recording name="7"/>
+ <probe_recording name="8"/>
+ </probes>
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseY" name="velocity_V">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseZ" name="velocity_W">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>
+ <ale_method status="off"/>
+ <turbulence model="k-epsilon">
+ <variable label="EnerTurb" name="turb_k">
+ <listing_printing status="off"/>
+ </variable>
+ <variable label="Dissip" name="turb_eps">
+ <listing_printing status="off"/>
+ </variable>
+ <property label="visc. tu" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ </turbulence>
+ <thermal_scalar model="temperature_celsius">
+ <property label="Flux_thermique_entrant" name="input_thermal_flux" support="boundary"/>
+ </thermal_scalar>
+ <radiative_transfer model="off">
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ </radiative_transfer>
+ <gas_combustion model="off"/>
+ <pulverized_coal model="off"/>
+ <joule_effect model="off"/>
+ <atmospheric_flows model="off">
+ <read_meteo_data status="off"/>
+ </atmospheric_flows>
+ </thermophysical_models>
+ <numerical_parameters>
+ <multigrid status="on"/>
+ <gradient_transposed status="on"/>
+ <velocity_pressure_coupling status="off"/>
+ <pressure_relaxation>1</pressure_relaxation>
+ <wall_pressure_extrapolation>0</wall_pressure_extrapolation>
+ <gradient_reconstruction choice="0"/>
+ </numerical_parameters>
+ <physical_properties>
+ <fluid_properties>
+ <property choice="constant" label="Masse vo" name="density">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>725.735</initial_value>
+ </property>
+ <property choice="constant" label="Visc. la" name="molecular_viscosity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>8.95e-05</initial_value>
+ </property>
+ <property choice="constant" label="Ch.spec." name="specific_heat">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>5483</initial_value>
+ </property>
+ <property choice="constant" label="Cond. th" name="thermal_conductivity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>0.02495</initial_value>
+ </property>
+ </fluid_properties>
+ <gravity>
+ <gravity_x>0</gravity_x>
+ <gravity_y>0</gravity_y>
+ <gravity_z>0</gravity_z>
+ </gravity>
+ <hydrostatic_pressure status="off"/>
+ </physical_properties>
+ <additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>400</max_value>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ <scalar label="scalar_2" name="scalar2" type="user">
+ <initial_value zone="1">10.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>400</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_2">
+ <initial_value>8.95e-05</initial_value>
+ </property>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ </additional_scalars>
+ <boundary_conditions>
+ <boundary label="inlet" name="1" nature="inlet">1</boundary>
+ <boundary label="outlet" name="2" nature="outlet">34</boundary>
+ <boundary label="symmetry" name="3" nature="symmetry">8 or 9 or 28 or 29 or 38 or 39</boundary>
+ <boundary label="Wall_1" name="4" nature="wall">24 and 0.1<=X and 0.5>=X</boundary>
+ <boundary label="Wall_2" name="5" nature="wall">2 or 3</boundary>
+ <boundary label="Wall_3" name="6" nature="wall">4 or 7 or 21 or 22 or 23</boundary>
+ <boundary label="Wall_4" name="7" nature="wall">6 and Y>1</boundary>
+ <boundary label="Wall_5" name="8" nature="wall">6 and Y<=1</boundary>
+ <boundary label="Wall_6" name="9" nature="wall">31 or 33</boundary>
+ <inlet label="inlet">
+ <velocity_pressure choice="norm" direction="coordinates">
+ <norm>1</norm>
+ <direction_x>1</direction_x>
+ <direction_y>0</direction_y>
+ <direction_z>0</direction_z>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>0.5</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="Temp.C" name="temperature_celsius" type="thermal">
+ <dirichlet>300</dirichlet>
+ </scalar>
+ <scalar choice="dirichlet" label="scalar_2" name="scalar2" type="user">
+ <dirichlet>200</dirichlet>
+ </scalar>
+ </inlet>
+ <outlet label="outlet">
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </outlet>
+ <symmetry label="symmetry"/>
+ <wall label="Wall_1">
+ <velocity_pressure choice="off">
+ <dirichlet name="velocity_U">0</dirichlet>
+ <dirichlet name="velocity_V">0</dirichlet>
+ <dirichlet name="velocity_W">0</dirichlet>
+ </velocity_pressure>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_3">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_2">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>5</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_4">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>25</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_5">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>320</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_6">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>40</neumann>
+ </scalar>
+ </wall>
+ <variable/>
+ </boundary_conditions>
+ <analysis_control>
+ <output>
+ <postprocessing_mesh_options choice="0"/>
+ <postprocessing_format choice="EnSight"/>
+ <postprocessing_options choice="binary"/>
+ <domain_boundary status="on"/>
+ <listing_printing_frequency>1</listing_printing_frequency>
+ <postprocessing_frequency>2</postprocessing_frequency>
+ <probe_recording_frequency>1</probe_recording_frequency>
+ <fluid_domain status="on"/>
+ <probe name="1" status="on">
+ <probe_x>-0.25</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="2" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="3" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>2.75</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="4" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>0.5</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="5" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>-0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="6" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>-0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="7" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="8" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>0.75</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="9" status="on">
+ <probe_x>-0.5</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ </output>
+ <time_parameters>
+ <property label="Nb Courant" name="courant_number">
+ <postprocessing_recording status="off"/>
+ </property>
+ <property label="Nb Fourier" name="fourier_number">
+ <postprocessing_recording status="off"/>
+ </property>
+ <time_step_ref>0.05</time_step_ref>
+ <iterations>300</iterations>
+ <time_passing>0</time_passing>
+ <zero_time_step status="off"/>
+ </time_parameters>
+ <steady_management status="off"/>
+ <time_averages/>
+ <profiles/>
+ </analysis_control>
+ <calcul_management>
+ <integer_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </integer_user_array>
+ <real_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </real_user_array>
+ <start_restart>
+ <restart status="off"/>
+ <frozen_field status="off"/>
+ <restart_rescue>0</restart_rescue>
+ <restart_with_auxiliary status="on"/>
+ </start_restart>
+ </calcul_management>
+ <lagrangian model="off"/>
+</Code_Saturne_GUI>
diff --git a/examples/2-full_domain/case2/lance b/examples/2-full_domain/case2/lance
new file mode 100644
index 0000000..ff4652f
--- /dev/null
+++ b/examples/2-full_domain/case2/lance
@@ -0,0 +1,1612 @@
+#!/bin/sh
+#============================================================================
+#
+# Code_Saturne version 1.3
+# ------------------------
+#
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# Exemple de fichier de lancement Code_Saturne
+#
+########################################################################
+########################################################################
+#
+# CARTES BATCH POUR LE CCRT (Tantale/Platine sous LSF)
+# ====================================================
+#
+#BSUB -n 2
+#BSUB -W 00:05
+#BSUB -o full_domaincaseo.%J
+#BSUB -e full_domaincasee.%J
+#BSUB -J full_domaincase
+#
+# -n : nombre de processeurs
+# -c : temps limite pour le job (cumul par processeur de tous les process du job)
+# au format hh:mm (heures:minutes)
+# -o : nom du listing de sortie
+# -e : nom du listing d'erreur
+# -J : nom du job
+#
+#ATTENTION : Les calculs lances sur Tantale sont executes sur Tantale, mais pour
+# Nickel/Chrome, la machine d'execution (Nickel Ou Chrome) est definie
+# par la classe du calcul et pas par la machine qui a execute la commande
+# "bsub". Attention aux disques WORKDIR non partages entre Nickel et
+# Chrome.
+#ATTENTION : En cas de couplage avec Syrthes, 1 processeur
+# sera reserve pour chacune des instances de Syrthes.
+# Le Noyau ne sera execute que sur les processeurs restants.
+# Pensez reserver un nombre suffisant de processeurs.
+#
+# ------------------------------------------------------------------
+#
+# CARTES BATCH POUR LE CLUSTER CHATOU sous PBS
+# ============================================
+#
+#PBS -l nodes=4:ppn=2,walltime=1:00:00,mem=320mb
+#PBS -j eo -N full_domaincase
+#
+# nodes= nombre de "noeuds" a reserver sur le cluster
+# ppn = nombre de processeurs par noeud (1 ou 2)
+# cput = cpu time (heures, minutes, secondes)
+# walltime = wall clock time (heures, minutes, secondes)
+# mem = memoire
+#
+#ATTENTION : En cas de couplage avec Syrthes, 1 processeur
+# sera reserve pour chacune des instances de Syrthes.
+# Le Noyau ne sera execute que sur les processeurs restants.
+# Pensez reserver un nombre suffisant de processeurs.
+#
+# ------------------------------------------------------------------
+#
+# CARTES BATCH POUR LE CLUSTER de University of Manchester
+# ========================================================
+#
+# set the name of the job
+##$ -N full_domaincase
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+########################################################################
+#
+# Definition du cas
+# : rubrique utilisateur
+#
+# Se reporter au fichier joint "lance.help" pour toute information
+# sur les rubriques a remplir et les valeurs possibles.
+#
+#
+# -------------------------------
+#
+#
+#
+# NE PAS LAISSER DE BLANCS (c'est un script)
+#
+#
+# -------------------------------
+#
+SOLCOM=0
+LONGIA=1000000
+LONGRA=5000000
+#
+# Sur certaines machines, dont Tantale, des librairies externes
+# peuvent necessiter la definition de la variable TERM
+export TERM=xterm
+#
+ETUDE=FULL_DOMAIN
+CAS=CASE2
+PARAM=case2.xml
+MAILLAGE="downcomer.des fdc.des pic.des"
+COMMANDE_RC="-j -color 5 24 32 -fraction 0.1 -plane 0.8"
+COMMANDE_DF=
+COMMANDE_PERIO=
+COMMANDE_SYRTHES=
+DONNEES_THERMOCHIMIE=
+#
+# Choix du nombre total de processeurs utilises (si vide, detection automatique
+# via le systeme de queue si possible, mise a 1 sinon).
+# En cas de couplage Syrthes avec MODE_COUPLAGE=MPI, le 1er processeur est
+# utilise pour Syrthes, donc le nombre effectif de processeurs dedies au noyau
+# est reduit de 1.
+# La liste des processeurs n'est utilisable qu'hors systeme de queue
+# (un tel systeme fournissant lui-meme une liste equivalente)
+NOMBRE_DE_PROCESSEURS=
+LISTE_PROCESSEURS=
+#
+FICHIERS_DONNEES_UTILISATEUR=
+FICHIERS_RESULTATS_UTILISATEUR=
+#
+# Repertoire temporaire local (vide pour valeur automatique par defaut)
+CS_TMP_PREFIX=/local00/users
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+OPTIMISATION=
+LISTE_LIB_SAT=
+OPTION_LIB_EXT=
+VALGRIND=
+#
+ARG_CS_VERIF=
+ARG_CS_OUTPUT=
+ECHOCOMM=""
+#
+#Pilotage du couplage avec HOMARD
+PILOTAGE_ADAPTATION=
+#
+resume=resume
+REPBASE=/home/saturne/TEST_CASES/FULL_DOMAIN/CASE2
+DATA=$REPBASE/DATA
+RESU=$REPBASE/RESU
+FORT=$REPBASE/FORT
+SCRIPTS=$REPBASE/SCRIPTS
+SUITE_AMONT=$DATA/SUITE
+PRE_TRAITEMENT_AMONT=$DATA/PRE_TRAITEMENT
+REPMAIL=$REPBASE/../MAILLAGE
+#
+# Les variables suivantes ne sont utiles que dans les cas couples avec SYRTHES
+# DATA_SYR : repertoire ou trouver SYRTHES_ENV
+# FORT_SYR : repertoire ou trouver les fichiers utilisateur eventuels
+DATA_SYR=$REPBASE/DATA_SYR
+SYRTHES_ENV=syrthes.env
+FORT_SYR=$REPBASE/FORT_SYR
+#
+# Le mode de couplage eventuel avec Syrthes peut etre choisi ici.
+# (attention aux majuscules/minuscules).
+# Si l'on n'a pas de couplage, cette variable sera mise a zero par la suite.
+#
+# MODE_COUPLAGE=MPI : recommande sur tout cluster (CCRT ou Chatou notamment).
+# MODE_COUPLAGE=sockets : solution de secours sur cluster si l'on ne sait
+# determiner le rang MPI d'un process a priori
+# (i.e. si rang_mpi.sh ne peut etre adapte)
+# ou si l'on ne dispose pas de MPI.
+# MODE_COUPLAGE=pipes : sur station de travail ou autre machine a memoire
+# partagee uniquement (les pipes n'etant visibles
+# que localement, et ne "traversant" pas le reseau).
+MODE_COUPLAGE=MPI
+#
+# On peut utiliser 3 modes d'execution.
+# (attention aux minuscules/majuscules)
+#
+# MODE_EXEC=complet : choix par defaut (Preprocesseur puis calcul).
+# MODE_EXEC=pre_traitement : lancement du Preprocesseur seul, pour generer
+# les fichiers preprocessor_output/*.
+# MODE_EXEC=calcul : lancement du calcul seul, en utilisant des
+# fichiers preprocessor_output/* deja generes et
+# accessibles dans le repertoire $PRE_TRAITEMENT_AMONT.
+#
+MODE_EXEC=complet
+#
+#
+#
+#
+########################################################################
+#
+# FIN DE ZONE UTILISATEUR POUR CALCULS STANDARDS
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Adresse de la bibliotheque du noyau
+CS_HOME=/home/saturne/Noyau/ncs-1.3.2
+export CS_HOME
+#
+# Parametres d'installation
+#
+. $CS_HOME/bin/cs_profile
+#
+#Verification de la compatibilite de la bibliotheque
+if [ ! -f ${CS_HOME}/bin/macros_${NOM_ARCH}.mk ]
+then
+ echo Architecture ${NOM_ARCH} non supportee par la version de Code_Saturne
+ echo ${CS_HOME}
+ exit 1
+fi
+#
+########################################################################
+# Adaptation de maillage
+#
+if [ ! -z "${PILOTAGE_ADAPTATION}" ] ; then
+ if [ "${PILOTAGE_ADAPTATION}" = "-aide" -o "${PILOTAGE_ADAPTATION}" = "-help" ] ; then
+ ${CSHOMARD_HOME}/saturne_homard ${PILOTAGE_ADAPTATION}
+ exit 0
+ else
+ Options_HOMARD=" -v"
+ ${CSHOMARD_HOME}/saturne_homard -Saturne_Script $0 -Donnees_Calcul $REPBASE \
+ -Pilotage_Adaptation $PILOTAGE_ADAPTATION $Options_HOMARD || exit 1
+ fi
+fi
+#
+#########################################################################
+#
+#
+N_COUPLAGE_SYRTHES=0
+N_COUPLAGE_SYRTHES=`echo $COMMANDE_SYRTHES | grep -c syrthes`
+if [ $N_COUPLAGE_SYRTHES = 0 ] ; then
+ COUPLAGE_SYRTHES=non
+else
+ COUPLAGE_SYRTHES=oui
+ export SYRTHES
+ if [ $N_COUPLAGE_SYRTHES -gt 1 ] ; then
+ echo "Ce script ne prend pas en charge plusieurs couplage Syrthes"
+ echo "Nombre de couplages Syrthes demande : $N_COUPLAGE_SYRTHES"
+ fi
+fi
+#
+if [ $COUPLAGE_SYRTHES = oui ] ; then
+ if [ $SOLCOM -eq 1 ] ; then
+ echo "Le couplage avec Syrthes n est pas compatible avec les"
+ echo "maillages de type SOLCOM"
+ exit 1
+ fi
+else
+ MODE_COUPLAGE=
+fi
+#
+########################################################################
+#
+# Definition des parametres d'execution
+#
+# Variables generales
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIXE=$DATE
+EXE=cs13.exe
+EXE_SYR=syrthes
+#
+# on recopie le script de lancement avant de se positionner dans le
+# repertoire de travail (car ensuite, un chemin relatif ne sera
+# plus a jour)
+
+cp $0 $RESU/lance.$SUFFIXE
+#
+# Repertoire d'execution (accessible depuis tous les procs)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$ETUDE.$CAS.$DATE
+#
+else
+# Valeur par defaut si l'utilisateur n'a rien specifie
+#
+# A priori sur Nickel/Chrome, c'est mieux avec TMPDIR, sauf si on veut
+# debuguer (car $TMPDIR est detruit a la fin du job)
+ if [ "$NOM_ARCH" = "OSF1" ] ; then
+ RUN=$TMPDIR
+# RUN=/scratch/scratchdir/$USER/TMPDIR/$ETUDE.$CAS.$DATE
+#
+# Sur Tantale, il n'y a pas de TMPDIR. On se met par defaut dans SCRATCHDIR
+ elif [ "$NOM_ARCH" = "Linux_CCRT" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$ETUDE.$CAS.$DATE
+#
+# Sur Argent, il n'y a pas de TMPDIR. On se met par defaut dans SCRATCHDIR
+ elif [ "$NOM_ARCH" = "Linux_IA64" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$ETUDE.$CAS.$DATE
+#
+# Sur l'ancien cluster MFEE, il y a un TMPDIR, mais il correspond
+# a un repertoire local, non partage par les noeuds. On ne peut
+# donc pas l'utiliser
+ elif [ "$NOM_ARCH" = "Linux_SCALI" ] ; then
+ RUN=$HOME/tmp_Saturne/$ETUDE.$CAS.$DATE
+#
+# Sur station classique ou cluster generique, on
+# n'utilisera TMPDIR que s'il est defini
+# (via un systeme batch en general)
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR
+ else
+ RUN=$HOME/tmp_Saturne/$ETUDE.$CAS.$DATE
+ fi
+fi
+#
+# Creation automatique du repertoire si necessaire
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "Le repertoire RUN=$RUN existe deja."
+ echo "Le calcul ne peut pas etre execute."
+ exit 1
+ fi
+fi
+#
+cd $RUN
+#
+########################################################################
+#
+# Parallelisme
+#
+# Liste des processeurs
+#
+if [ -f "$TMPDIR/machines" ] ; then # avec systeme de queue Manchester
+ MPIHOSTS="$TMPDIR/machines"
+elif [ ! -z "$PBS_NODEFILE" ] ; then # avec system de queue PBS
+ MPIHOSTS="$PBS_NODEFILE"
+elif [ ! -z "$LSB_HOSTS" ] ; then # avec systeme de queue LSF
+ \rm -f $RUN/hostsfile
+ echo $LSB_HOSTS | awk '{ for (ii = 1; ii < NF+1; ++ii) print $ii }' >> $RUN/hostsfile
+ MPIHOSTS="$RUN/hostsfile"
+elif [ ! -z "$LISTE_PROCESSEURS" ] ; then
+ \rm -f $RUN/hostsfile
+ localproc=`hostname`
+ echo $LISTE_PROCESSEURS | grep -q $localproc || LISTE_PROCESSEURS="$localproc & $LISTE_PROCESSEURS"
+ echo $LISTE_PROCESSEURS | awk -F\& '{ for (ii = 1; ii < NF+1; ++ii) print $ii }' >> $RUN/hostsfile
+ MPIHOSTS="$RUN/hostsfile"
+fi
+# Verification du nombre de processeurs
+if [ -z "${NOMBRE_DE_PROCESSEURS}" ] ; then
+ if [ ! -z "${NSLOTS}" ] ; then
+ # pour systeme de queue cluster Manchester
+ NOMBRE_DE_PROCESSEURS=$NSLOTS
+ elif [ ! -z "${SLURM_NPROCS}" ] ; then
+ # pour systeme de queue LSF avec Slurm
+ NOMBRE_DE_PROCESSEURS=$SLURM_NPROCS
+ elif [ ! -z "${LSB_HOSTS}" ] ; then
+ # pour systeme de queue LSF sans Slurm
+ NOMBRE_DE_PROCESSEURS=`echo $LSB_HOSTS | wc -w`
+ elif [ ! -z "${MPIHOSTS}" ] ; then
+ # pour systeme de queue cluster MFEE ou des que MPIHOSTS est defini
+ NOMBRE_DE_PROCESSEURS=`cat $MPIHOSTS | wc -l`
+ else
+ NOMBRE_DE_PROCESSEURS=1
+ fi
+fi
+#
+# Verification du nombre de noeuds si possible
+NOMBRE_DE_NOEUDS=1
+if [ -z "${NOMBRE_DE_PROCESSEURS}" ] ; then
+ if [ ! -z "${MPIHOSTS}" ] ; then
+ NOMBRE_DE_NOEUDS=`sort $MPIHOSTS | sed -e 's/:/ /' | cut -f 1 -d" " | uniq | wc -l`
+ fi
+fi
+#
+# Verification du nombre de processeurs demandes
+nproc_noy=${NOMBRE_DE_PROCESSEURS}
+echo
+echo
+if [ $COUPLAGE_SYRTHES = oui ] ; then
+ echo "Couplage de Code_Saturne avec Syrthes active"
+ if [ ! -z "$MPIHOSTS" ] ; then
+ # si on utilise Syrthes en batch par MPI, on lui reserve un processeur par instance
+ if [ "$MODE_COUPLAGE" = "MPI" ] ; then
+ (( nproc_noy = nproc_noy - N_COUPLAGE_SYRTHES ))
+ if [ $nproc_noy -lt 1 ] ; then
+ echo
+ echo
+ echo " Attention, avec MODE_COUPLAGE = MPI, Syrthes reserve un processeur."
+ echo " Le nombre de processeurs demande ($NOMBRE_DE_PROCESSEURS)"
+ echo " est donc insuffisant."
+ echo " Augmenter le nombre de processeurs reserves dans les cartes batch."
+ echo
+ exit 1
+ fi
+ fi
+ # si on utilise Syrthes en batch pipe, on verifie que tout tient sur un seul noeud
+ if [ "$MODE_COUPLAGE" = "pipes" -a "$NOMBRE_DE_NOEUDS" != 1 ] ; then
+ echo
+ echo
+ echo " Attention, avec MODE_COUPLAGE = pipes, les transmissions "
+ echo " Syrthes-noyau se font par tubes (pipes). "
+ echo " Ici, plusieurs machines ont ete selectionnees pour "
+ echo " realiser le calcul en parallele : "
+ cat "$MPIHOSTS"
+ echo " Les tubes (pipes) sont limites a un noeud et le calcul "
+ echo " risque de ne pas pouvoir aboutir."
+ echo " Utiliser une autre valeur de MODE_COUPLAGE "
+ echo
+ exit 1
+ fi
+ else
+ # si on n'est pas en batch et qu'on couple par MPI, on doit specifier un nombre
+ # de processeurs superieur a 1 pour activer MPI
+ if [ "$MODE_COUPLAGE" = "MPI" ] ; then
+ (( nproc_noy = nproc_noy - N_COUPLAGE_SYRTHES ))
+ if [ $nproc_noy -lt 1 ] ; then
+ echo
+ echo
+ echo " Attention, avec MODE_COUPLAGE = MPI, Syrthes reserve un processeur"
+ echo " (eventuellement virtuel)."
+ echo " Le nombre de processeurs demande ($NOMBRE_DE_PROCESSEURS)"
+ echo " doit donc etre strictement superieur a 1."
+ echo " Augmenter NOMBRE_DE_PROCESSEURS."
+ echo
+ exit 1
+ fi
+ fi
+ # si on n'est pas en batch et qu'on couple par pipes, on diminue aussi
+ # NOMBRE_DE_PROCESSEURS pour ne pas avoir besoin de MPI si
+ # Code_Saturne et Syrthes tournent chacun sur 1 processeur
+ if [ "$MODE_COUPLAGE" = "pipes" ] ; then
+ (( nproc_noy = nproc_noy - N_COUPLAGE_SYRTHES ))
+ (( NOMBRE_DE_PROCESSEURS = NOMBRE_DE_PROCESSEURS - 1 ))
+ if [ $nproc_noy -lt 1 ] ; then
+ echo
+ echo
+ echo " Attention, avec MODE_COUPLAGE = pipes, Syrthes reserve un processeur"
+ echo " (eventuellement virtuel)."
+ echo " Le nombre de processeurs demande ($NOMBRE_DE_PROCESSEURS)"
+ echo " doit donc etre strictement superieur a 1."
+ echo " Augmenter NOMBRE_DE_PROCESSEURS."
+ echo
+ exit 1
+ fi
+ fi
+ fi
+fi
+if [ $nproc_noy -gt 1 ] ; then
+ echo "Calcul Code_Saturne parallele avec decomposition en $nproc_noy sous-domaines"
+ if [ $SOLCOM = 1 ] ; then
+ echo
+ echo
+ echo " Calcul en parallele impossible avec SOLCOM = $SOLCOM "
+ echo " Utiliser SOLCOM = 0 "
+ echo
+ exit 1
+ fi
+else
+ echo "Calcul Code_Saturne monoprocesseur"
+fi
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "$NOMBRE_DE_PROCESSEURS processeur(s) reserve(s) en tout"
+fi
+#
+# Si le noyau fonctionne en parallele, on doit lui preciser le nombre
+# de domaines, ainsi qu'au Preprocesseur
+if [ $nproc_noy -gt 1 ] ; then
+ ARG_ECS_PAR=" -p $nproc_noy"
+ ARG_CS_PAR=" -p $nproc_noy"
+else
+ ARG_ECS_PAR=""
+ ARG_CS_PAR=""
+fi
+#
+# Parametres lies au systeme
+#
+if [ $NOMBRE_DE_PROCESSEURS -gt 1 ] ; then
+#
+# Valeurs par defaut definies au depart
+ MPIBOOT=""
+ MPIHALT=""
+ MPIRUN="mpirun -np ${NOMBRE_DE_PROCESSEURS}"
+ if [ -d "$CS_MPI_PATH" ] ; then
+ export PATH=${CS_MPI_PATH}:$PATH
+ fi
+#
+ if [ "$NOM_ARCH" = "OSF1" ] ; then
+ MPIRUN="prun -n ${NOMBRE_DE_PROCESSEURS} -stv"
+#
+ elif [ "$NOM_ARCH" = "Linux_CCRT" ] ; then
+ MPIRUN="mpirun -srun"
+#
+ elif [ "$NOM_ARCH" = "Linux_IA64" ] ; then
+ MPIRUN="srun -n ${NOMBRE_DE_PROCESSEURS}"
+#
+ elif [ "$NOM_ARCH" = "Linux_Ch" ] ; then
+ MPIRUN="mpirun -np ${NOMBRE_DE_PROCESSEURS} -machinefile $PBS_NODEFILE"
+#
+ else
+ if [ -d "$CS_MPI_PATH" ] ; then
+ if [ -f "${CS_MPI_PATH}/mpdboot" ] ; then # Si MPI de type MPICH2
+ MPIBOOT="${CS_MPI_PATH}/mpdboot"
+ MPIHALT="${CS_MPI_PATH}/mpdallexit"
+ MPIRUN="${CS_MPI_PATH}/mpiexec -n ${NOMBRE_DE_PROCESSEURS}"
+ if [ ! -z "$MPIHOSTS" ] ; then
+ MPIBOOT="$MPIBOOT -n ${NOMBRE_DE_NOEUDS} -v -f $MPIHOSTS"
+ fi
+ elif [ -f "${CS_MPI_PATH}/ompi_info" ] ; then # Si MPI de type Open MPI
+ MPIRUN="${CS_MPI_PATH}/mpiexec -n ${NOMBRE_DE_PROCESSEURS}"
+ if [ ! -z "$MPIHOSTS" ] ; then
+ MPIRUN="$MPIRUN -machinefile $MPIHOSTS"
+ fi
+ elif [ -f "${CS_MPI_PATH}/lamboot" ] ; then # Si MPI de type LAM MPI
+ MPIBOOT="${CS_MPI_PATH}/lamboot"
+ MPIHALT="${CS_MPI_PATH}/lamhalt"
+ MPIRUN="${CS_MPI_PATH}/mpirun -np ${NOMBRE_DE_PROCESSEURS}"
+ if [ ! -z "$MPIHOSTS" ] ; then
+ MPIBOOT="$MPIBOOT -v $MPIHOSTS"
+ MPIHALT="$MPIHALT -v $MPIHOSTS"
+ fi
+ elif [ -f "${CS_MPI_PATH}/mpichversion" ] ; then # Si MPI de type MPICH
+ MPIRUN="${CS_MPI_PATH}/mpirun -np ${NOMBRE_DE_PROCESSEURS}"
+ if [ ! -z "$TMPDIR/machines" ] ; then # avec systeme de queue Manchester
+ MPIRUN="$MPIRUN -machinefile $TMPDIR/machines"
+ elif [ ! -z "$MPIHOSTS" ] ; then
+ MPIRUN="$MPIRUN -machinefile $MPIHOSTS"
+ fi
+ fi
+ fi
+ fi
+#
+# si on ne demande pas plusieurs processeurs
+#
+else
+#
+ MPIRUN=""
+ MPIBOOT=""
+ MPIHALT=""
+fi
+#
+########################################################################
+#
+# Communications
+#
+# Definition des sockets
+if [ $COUPLAGE_SYRTHES = oui -a "$MODE_COUPLAGE" = "sockets" ] ; then
+ SOCKETSYR="-comm-socket"
+else
+ SOCKETSYR=""
+fi
+# En prevision des echo comm si probleme
+if [ ! -z "$ECHOCOMM" ] ; then
+ ECHOCOMMNB="$ECHOCOMM"
+ ECHOCOMMECS="-echo-comm $ECHOCOMMNB"
+ ECHOCOMMSYR="-echo-comm $ECHOCOMMNB"
+ ECHOCOMMNOY="--echo-comm $ECHOCOMMNB"
+else
+ ECHOCOMMNB=""
+ ECHOCOMMECS=""
+ ECHOCOMMSYR=""
+ ECHOCOMMNOY=""
+fi
+########################################################################
+# Message d'accueil
+#
+echo ' '
+echo ' Execution de Code_Saturne '
+echo ' ************************* '
+echo ' '
+echo ' Repertoire de travail (penser a le purger periodiquement) : '
+echo ' ' $RUN
+#
+########################################################################
+
+# Fonction de reperage d'un sous programme utilisateur
+# pour le moment, on fait simple
+# (on pourrait verifier que uslag2 contient bien uslag2 ou encore
+# qu'il n'est pas bidon ...)
+presence () {
+
+ presence_sspgm=$1
+
+ if [ ! -f "${presence_sspgm}" ] ; then
+ presence_PRESENT="non"
+ else
+ presence_PRESENT="oui"
+ fi
+ echo ${presence_PRESENT}
+}
+#
+########################################################################
+#
+# Compilation et edition des liens
+#
+# Remarque : on en profite pour reperer la presence de certains
+# sous-programmes utilisateurs.
+#
+if [ "$CS_HOME" = "" ]; then
+ echo
+ echo "WARNING: la variable CS_HOME n est pas positionnee"
+ echo
+ exit 1
+else
+ echo
+ echo ' Version noyau : ' $CS_HOME
+ echo ' Version preprocesseur : ' $ECS_HOME
+fi
+
+source_cas=$FORT
+
+if [ -f compil.log ] ; then
+ rm -f compil.log
+fi
+
+if [ $MODE_EXEC != pre_traitement ] ; then
+
+ echo
+ echo " *****************************************************************************"
+ echo " Compilation des sous-programmes utilisateur et edition de liens Code_Saturne"
+ echo " *****************************************************************************"
+
+ cur_dir=`pwd`
+
+ #
+ # Recopie du fichier parametrique
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMANDE_PARAM="-param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Le fichier de donnees parametrique ' $var
+ echo ' n est pas accessible '
+ exit 1
+ fi
+ fi
+
+ # Determination de la version des compilateurs
+ ${CS_HOME}/bin/compiler_version -cshome ${CS_HOME} -nomarch ${NOM_ARCH} -output ${cur_dir}/compil.log
+
+ # Recopie des sources utilisateur
+ # (pas de liens : on recopie le repertoire ensuite)
+ mkdir fort_saturne
+ cd fort_saturne
+ for fich in ${source_cas}/*.[F,c,h] ; do
+ if [ -f $fich ] ; then
+ cp ${fich} .
+ fi
+ done
+#
+# Detection de la presence de modules
+
+# Standard
+ USCLIM_PRESENT=`presence "usclim.F"`
+
+# Lagrangien
+ USLAG2_PRESENT=`presence "uslag2.F"`
+
+# Rayonnement
+ USRAY2_PRESENT=`presence "usray2.F"`
+ if [ ! -z "$PARAM" ] ; then
+ NRAYT=`grep "radiative_transfer\ model" ${cur_dir}/$PARAM | grep -v "off" |wc -l`
+ if [ $NRAYT -eq 1 ] ; then
+ USRAY2_PRESENT="oui"
+ fi
+ fi
+
+# Charbon pulverise
+ USCPCL_PRESENT=`presence "uscpcl.F"`
+ if [ ! -z "$PARAM" ] ; then
+ NCHARB=`grep "pulverized_coal\ model" ${cur_dir}/$PARAM | grep -v "off" |wc -l`
+ if [ $NCHARB -eq 1 ] ; then
+ USCPCL_PRESENT="oui"
+ fi
+ fi
+
+# Combustion gaz chimie 3 points
+ USD3PC_PRESENT=`presence "usd3pc.F"`
+
+# Combustion gaz EBU
+ USEBUC_PRESENT=`presence "usebuc.F"`
+
+# Combustion gaz LWC
+ USLWCC_PRESENT=`presence "uslwcc.F"`
+
+# Electrique
+ USELCL_PRESENT=`presence "uselcl.F"`
+
+# Compressible
+ USCFCL_PRESENT=`presence "uscfcl.F"`
+
+# Fuel
+ USFUCL_PRESENT=`presence "usfucl.F"`
+
+# Tests de compatibilite
+ if [ "${USCPCL_PRESENT}" = "oui" ] ; then
+ if [ "${USCLIM_PRESENT}" = "oui" ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Lorsque le modele de combustion du charbon pulverise'
+ echo ' est active, usclim ne doit pas etre utilise'
+ echo ' Les conditions aux limites sont fournies dans'
+ echo ' l interface graphique ou dans uscpcl.'
+ echo ' '
+ exit 1
+ fi
+ fi
+ if [ "${USD3PC_PRESENT}" = "oui" ] ; then
+ if [ "${USCLIM_PRESENT}" = "oui" ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Lorsque usd3pc est complete, usclim ne doit pas l etre'
+ echo ' (modele combustion chimie trois points) '
+ echo ' Les conditions aux limites sont fournies dans usd3pc.'
+ echo ' '
+ exit 1
+ fi
+ fi
+ if [ "${USEBUC_PRESENT}" = "oui" ] ; then
+ if [ "${USCLIM_PRESENT}" = "oui" ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Lorsque usebuc est complete, usclim ne doit pas l etre'
+ echo ' (modele combustion EBU) '
+ echo ' Les conditions aux limites sont fournies dans usebuc.'
+ echo ' '
+ exit 1
+ fi
+ fi
+ if [ "${USLWCC_PRESENT}" = "oui" ] ; then
+ if [ "${USCLIM_PRESENT}" = "oui" ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Lorsque uslwcc est complete, usclim ne doit pas l etre'
+ echo ' (modele combustion LWC) '
+ echo ' Les conditions aux limites sont fournies dans uslwcc.'
+ echo ' '
+ exit 1
+ fi
+ fi
+ if [ "${USELCL_PRESENT}" = "oui" ] ; then
+ if [ "${USCLIM_PRESENT}" = "oui" ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Lorsque uselcl est complete, usclim ne doit pas l etre'
+ echo ' (modele electrique) '
+ echo ' Les conditions aux limites sont fournies dans uselcl.'
+ echo ' '
+ exit 1
+ fi
+ fi
+
+ if [ "${USCFCL_PRESENT}" = "oui" ] ; then
+ if [ "${USCLIM_PRESENT}" = "oui" ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Lorsque uscfcl est complete, usclim ne doit pas l etre'
+ echo ' (modele compressible) '
+ echo ' Les conditions aux limites sont fournies dans uscfcl.'
+ echo ' '
+ exit 1
+ fi
+ fi
+
+ if [ "${USFUCL_PRESENT}" = "oui" ] ; then
+ if [ "${USCLIM_PRESENT}" = "oui" ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Lorsque usfucl est complete, usclim ne doit pas l etre'
+ echo ' (modele fuel) '
+ echo ' Les conditions aux limites sont fournies dans usfucl.'
+ echo ' '
+ exit 1
+ fi
+ fi
+
+# Traduction
+ if [ "${USLAG2_PRESENT}" = "oui" ] ; then
+ LAGRANGIEN=oui
+ echo ' '
+ echo ' Utilisation du module lagrangien '
+ echo ' '
+ else
+ LAGRANGIEN=non
+ fi
+ if [ "${USRAY2_PRESENT}" = "oui" ] ; then
+ RAYONNEMENT=oui
+ echo ' '
+ echo ' Utilisation du module rayonnement '
+ echo ' '
+ else
+ RAYONNEMENT=non
+ fi
+ COMBUSTION=non
+ if [ "${USCPCL_PRESENT}" = "oui" ] ; then
+ COMBUSTION=oui
+ COMBUSTION_CPP=oui
+ echo ' '
+ echo ' Utilisation du module combustion charbon pulverise '
+ echo ' '
+ else
+ COMBUSTION_CPP=non
+ fi
+ if [ "${USD3PC_PRESENT}" = "oui" ] ; then
+ COMBUSTION=oui
+ COMBUSTION_C3P=oui
+ echo ' '
+ echo ' Utilisation du module combustion chimie trois points '
+ echo ' '
+ else
+ COMBUSTION_C3P=non
+ fi
+ if [ "${USEBUC_PRESENT}" = "oui" ] ; then
+ COMBUSTION=oui
+ COMBUSTION_EBU=oui
+ echo ' '
+ echo ' Utilisation du module combustion EBU '
+ echo ' '
+ else
+ COMBUSTION_EBU=non
+ fi
+ if [ "${USLWCC_PRESENT}" = "oui" ] ; then
+ COMBUSTION=oui
+ COMBUSTION_LWC=oui
+ echo ' '
+ echo ' Utilisation du module combustion LWC '
+ echo ' '
+ else
+ COMBUSTION_LWC=non
+ fi
+ if [ "${USELCL_PRESENT}" = "oui" ] ; then
+ ELECTRIQUE=oui
+ echo ' '
+ echo ' Utilisation du module electrique '
+ echo ' '
+ else
+ ELECTRIQUE=non
+ fi
+
+ if [ "${USCFCL_PRESENT}" = "oui" ] ; then
+ COMPRESSIBLE=oui
+ echo ' '
+ echo ' Utilisation du module compressible '
+ echo ' '
+ else
+ COMPRESSIBLE=non
+ fi
+
+ if [ "${USFUCL_PRESENT}" = "oui" ] ; then
+ FUEL=oui
+ echo ' '
+ echo ' Utilisation du module fuel '
+ echo ' '
+ else
+ FUEL=non
+ fi
+
+
+# Pas de lagrangien en parallele
+ if [ "${LAGRANGIEN}" = "oui" ] ; then
+ if [ ${nproc_noy} -gt 1 ] ; then
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Le mode parallele est incompatible avec le module Lagrangien'
+ echo ' dans la version courante. '
+ echo ' '
+ exit 1
+ fi
+ fi
+#
+ # Extraction du main sur HP (link avec f90) sauf s'il existe deja
+ # (devrait etre migre vers le Makefile si possible)
+ if [ "${NOM_ARCH}" = "HP-UX" ] ; then
+ cheminlib=${CS_HOME}/lib/${NOM_ARCH}
+ main=cs_main
+ mainc=cs_main.c
+ maino=cs_main.o
+ if [ ! -f "$mainc" ] ; then
+ libsaturneBASE=libsaturneBASE
+ if [ ! -z "${LISTE_LIB_SAT}" ] ; then
+ for module in ${LISTE_LIB_SAT} ; do
+ if [ `echo ${module} | grep ${libsaturneBASE}` ] ; then
+ ar -xv $cheminlib/${libsaturneBASE}${OPTIMISATION} $maino
+ fi
+ done
+ else
+ ar -xv $cheminlib/${libsaturneBASE}${OPTIMISATION}.a $maino
+ fi
+ fi
+ fi
+
+# Compilation
+ ln -s ${CS_HOME}/bin/Makefile .
+
+ make saturne OPT="${OPTIMISATION}" LIB="${LISTE_LIB_SAT}" OPTLIBS="${OPTION_LIB_EXT}" 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIXE
+ echo ERREUR DE COMPILATION OU D\'EDITION DE LIENS
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIXE
+ fi
+
+# Nettoyage
+ make clean
+ mv $EXE ${cur_dir}/
+ cd ${cur_dir}
+
+ if [ $COUPLAGE_SYRTHES = oui ] ; then
+
+ echo
+ echo " *****************************************************************************"
+ echo " Compilation des sous-programmes utilisateur et edition de liens SYRTHES "
+ echo " *****************************************************************************"
+
+ cur_dir=`pwd`
+ mkdir fort_syrthes
+ cd fort_syrthes
+ for fich in $FORT_SYR/*.[F,c,h] ; do
+ cp ${fich} .
+ done
+ ln -s $SYRCS_HOME/bin/Makefile .
+ make syrthes NOM_ARCH=${NOM_ARCH} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIXE
+ echo ERREUR DE COMPILATION OU D\'EDITION DE LIENS
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIXE
+ fi
+ make clean
+ mv syrthes $cur_dir/
+ cd $cur_dir
+
+ fi
+
+fi # MODE_EXEC != pre_traitement
+
+#
+########################################################################
+#
+# Mise en place des donnees
+#
+echo
+echo " ********************************************"
+echo " Preparation du calcul "
+echo " ********************************************"
+echo
+if [ $SOLCOM = 1 ]
+then
+ ln -s $REPMAIL/$MAILLAGE geomet || exit 1
+elif [ $MODE_EXEC != calcul ]
+then
+ for var in $MAILLAGE ; do
+ ln -s $REPMAIL/$var $var || exit 1
+# cas particulier des maillages au format EnSight : lien sur le fichier .geo
+# necessaire (recuperation du nom de fichier dans le fichier .case)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $REPMAIL/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+elif [ $MODE_EXEC = calcul ]
+then
+ ln -s ${PRE_TRAITEMENT_AMONT} preprocessor_output || exit 1
+fi
+#
+if [ $MODE_EXEC != pre_traitement ] ; then
+
+ for var in ${SUITE_AMONT}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "${COMBUSTION}" = "oui" -o "${ELECTRIQUE}" = "oui" -o "${FUEL}" = "oui" ] ; then
+ var=$DATA/$DONNEES_THERMOCHIMIE
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # recopie pour avoir le bon nom a la sauvegarde
+ if [ "$DONNEES_THERMOCHIMIE" != "dp_tch" ] ; then
+ cp dp_tch $DONNEES_THERMOCHIMIE
+ fi
+ else
+ echo ' '
+ echo ' -- ERREUR -- '
+ echo ' Le fichier de donnees thermochimie ' $var
+ echo ' n est pas accessible '
+ exit 1
+ fi
+ if [ "${COMBUSTION}" = "oui" -o "${FUEL}" = "oui" ] ; then
+ cp $CS_HOME/data/thch/JANAF JANAF
+ fi
+ fi
+ #
+ if [ $COUPLAGE_SYRTHES = oui ] ; then
+ #
+ cp $DATA_SYR/$SYRTHES_ENV .
+ #
+ # On extrait les informations de syrthes.env et on le modifie en csq
+ # (tous les fichiers seront locaux)
+ # On sauve le fichier auparavant pour pouvoir le recopier avec
+ # les resultats ensuite
+ #
+ cp $SYRTHES_ENV $SYRTHES_ENV.save
+ #
+ AMONT_SYR=`grep "AMONT :" $SYRTHES_ENV | awk -F: '{print $NF}' | sed -e "s/ //g"`
+ AVAL_SYR=` grep "AVAL :" $SYRTHES_ENV | awk -F: '{print $NF}' | sed -e "s/ //g"`
+ SUITE_SYR=`grep "SUITE :" $SYRTHES_ENV | awk -F: '{print $NF}' | sed -e "s/ //g"`
+ SYRTHES_DATA=`grep "DONNEES DU CALCUL :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_GEOM=`grep "GEOMETRIE SOLIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_SUIT=`grep "SUITE SOLIDE RESU :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_DATA_RAY=`grep "DONNEES POUR LE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_MAIL_RAY=`grep "MAILLAGE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_CORR=`grep "STOCKAGE DES CORRESPONDANTS :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_FFOR_RAY=`grep "FACTEURS DE FORME RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_CORR_RAY=`grep "STOCKAGE DES CORRESPONDANTS RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_RES1=`grep "RESU SYRTHES 1 :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_RES2=`grep "RESU SYRTHES 2 :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_CHR2=`grep "CHRONO SYRTHES 2 :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_HIST=`grep "HISTORIQUE SOLIDE RESULTAT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_MAIL_PEAU_FLUIDE=`grep "MAILLAGE PEAU FLUIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_RESU_PEAU_FLUIDE=`grep "RESULTATS PEAU FLUIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_CHR_PEAU_FLUIDE=`grep "CHRONO PEAU FLUIDE :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_MAIL_RAY=`grep "MAILLAGE DE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_RESU_RAY=`grep "RESULTATS DE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_CHR_RAY=`grep "CHRONO DE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ SYRTHES_AVAL_HIST_RAY=`grep "HISTORIQUE RAYONNEMENT :" $SYRTHES_ENV | awk -F: '{print $NF}'`
+ sed -e "s/:.*\//: /" $SYRTHES_ENV > $SYRTHES_ENV.mod ; mv -f $SYRTHES_ENV.mod $SYRTHES_ENV
+ sed -e "s/AMONT :.*/AMONT : .\//" $SYRTHES_ENV > $SYRTHES_ENV.mod ; mv -f $SYRTHES_ENV.mod $SYRTHES_ENV
+ sed -e "s/AVAL :.*/AVAL : .\//" $SYRTHES_ENV > $SYRTHES_ENV.mod ; mv -f $SYRTHES_ENV.mod $SYRTHES_ENV
+ sed -e "s/SUITE :.*/SUITE : .\//" $SYRTHES_ENV > $SYRTHES_ENV.mod ; mv -f $SYRTHES_ENV.mod $SYRTHES_ENV
+ #
+ # si vide, on prend les noms par defaut pour les resultats :
+ if [ -z "$SYRTHES_CORR" ] ; then
+ SYRTHES_CORR="corresp"
+ fi
+ if [ -z "$SYRTHES_CORR_RAY" ] ; then
+ SYRTHES_CORR_RAY="corresp_ray"
+ fi
+ if [ -z "$SYRTHES_FFOR_RAY" ] ; then
+ SYRTHES_FFOR_RAY="fdf_ray"
+ fi
+ if [ -z "$SYRTHES_AVAL_RES1" ] ; then
+ SYRTHES_AVAL_RES1="geoms"
+ fi
+ if [ -z "$SYRTHES_AVAL_RES2" ] ; then
+ SYRTHES_AVAL_RES2="resus"
+ fi
+ if [ -z "$SYRTHES_AVAL_CHR2" ] ; then
+ SYRTHES_AVAL_CHR2="chronos"
+ fi
+ if [ -z "$SYRTHES_AVAL_HIST" ] ; then
+ SYRTHES_AVAL_HIST="histos"
+ fi
+ if [ -z "$SYRTHES_AVAL_MAIL_PEAU_FLUIDE" ] ; then
+ SYRTHES_AVAL_MAIL_PEAU_FLUIDE="geomf_ef"
+ fi
+ if [ -z "$SYRTHES_AVAL_RESU_PEAU_FLUIDE" ] ; then
+ SYRTHES_AVAL_RESU_PEAU_FLUIDE="resuf_ef"
+ fi
+ if [ -z "$SYRTHES_AVAL_CHR_PEAU_FLUIDE" ] ; then
+ SYRTHES_AVAL_CHR_PEAU_FLUIDE="chronof_ef"
+ fi
+ if [ -z "$SYRTHES_AVAL_MAIL_RAY" ] ; then
+ SYRTHES_AVAL_MAIL_RAY="resu_ray.geom"
+ fi
+ if [ -z "$SYRTHES_AVAL_RESU_RAY" ] ; then
+ SYRTHES_AVAL_RESU_RAY="resu_ray"
+ fi
+ if [ -z "$SYRTHES_AVAL_CHR_RAY" ] ; then
+ SYRTHES_AVAL_CHR_RAY="chrono_ray"
+ fi
+ if [ -z "$SYRTHES_AVAL_HIST_RAY" ] ; then
+ SYRTHES_AVAL_HIST_RAY="histor"
+ fi
+ #
+ #
+ # On transfere les fichiers syrthes
+ #
+ for var in $SYRTHES_DATA $SYRTHES_GEOM $SYRTHES_SUIT $SYRTHES_DATA_RAY $SYRTHES_MAIL_RAY ; do
+ cp $AMONT_SYR/$var $RUN/`echo $var | sed -e "s/.*\///"`
+ done
+ for var in $SYRTHES_CORR $SYRTHES_FFOR_RAY $SYRTHES_CORR_RAY ; do
+ cp $SUITE_SYR/$var $RUN/`echo $var | sed -e "s/.*\///"`
+ done
+ #
+ fi
+ #
+ if [ ! -z "$FICHIERS_DONNEES_UTILISATEUR" ] ; then
+ for fich in $FICHIERS_DONNEES_UTILISATEUR ; do
+ cp $DATA/$fich .
+ done
+ fi
+ #
+fi # MODE_EXEC != pre_traitement
+
+########################################################################
+# Temps limite pour PBS (on le fait ici pour laisser le temps a PBS
+# de se rendre compte que ca a demarre)
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Resume : debut
+#
+echo '========================================================'>>$resume
+echo ' DATE DE DEBUT : ' $DATE >>$resume
+echo ' ----------------------------------------------------' >>$resume
+echo ' CS_HOME : ' $CS_HOME >>$resume
+echo ' ECS_HOME : ' $ECS_HOME >>$resume
+echo ' ------------------------------------------------ ' >>$resume
+cat $CS_HOME/bin/cs_profile >>$resume
+echo ' ----------------------------------------------------' >>$resume
+echo ' UTILISATEUR : ' $USER >>$resume
+echo ' ARCHITECTURE : ' $NOM_ARCH >>$resume
+echo '========================================================'>>$resume
+echo ' MACHINE : ' >>$resume
+ uname -a >>$resume
+if [ -z "$NOMBRE_DE_PROCESSEURS" ] ; then
+ echo ' N PROCS : ' 1 >>$resume
+else
+ echo ' N PROCS : ' $NOMBRE_DE_PROCESSEURS >>$resume
+fi
+if [ -z "$LISTE_PROCESSEURS" ] ; then
+ echo ' PROCESSEURS : ' par defaut >>$resume
+else
+ echo ' PROCESSEURS : ' $NOMBRE_DE_PROCESSEURS >>$resume
+fi
+echo '========================================================'>>$resume
+echo ' ----------------------------------------------------' >>$resume
+echo ' CAS : ' $CAS >>$resume
+echo ' CONFIG. : ' $CONF >>$resume
+echo ' DATA : ' $DATA >>$resume
+echo ' FORT : ' $FORT >>$resume
+echo ' RESU : ' $RESU >>$resume
+echo ' ----------------------------------------------------' >>$resume
+echo ' REP. RUN : ' $RUN >>$resume
+echo ' ----------------------------------------------------' >>$resume
+echo ' EXECUTABLE : ' $EXE >>$resume
+echo ' BIB : ' $BIB >>$resume
+echo ' COMPILATEUR f : ' $COMPF >>$resume
+echo ' COMPILATEUR c : ' $COMPC >>$resume
+echo ' OPTIONS f : ' $OPTCOMPF1 >>$resume
+echo ' ----------------------------------------------------' >>$resume
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Execution "
+echo " ********************************************"
+echo
+#
+ERROR=$RUN/error
+erreur()
+{
+echo ERREUR $1 >> $ERROR
+}
+#
+# Preparation supplementaire pour le couplage Syrthes
+#
+if [ $COUPLAGE_SYRTHES = oui ] ; then
+ #
+ if [ "$MODE_COUPLAGE" = "pipes" ] ; then
+ #
+ # Creation des pipes si besoin
+ #
+ if [ $nproc_noy -gt 1 ] ; then
+ num=1
+ while [ $num -le $nproc_noy ] ; do
+ numf=`echo $num | awk '{printf "%4.4i\n", $1}'`
+ for fich in solveur_n${numf}_vers_syrthes.0001 syrthes_vers_solveur_n$numf.0001 ; do
+ if [ -f $fich ] ; then
+ rm -f $fich
+ fi
+ mkfifo $fich
+ done
+ (( num = num + 1 ))
+ done
+ else
+ for fich in solveur_vers_syrthes.0001 syrthes_vers_solveur.0001 ; do
+ if [ -f $fich ] ; then
+ rm -f $fich
+ fi
+ mkfifo $fich
+ done
+ fi
+ #
+ # Si sockets, on doit adapter la COMMANDE_SYRTHES
+ # (on ajoute -socket apres -syrthes)
+ #
+ elif [ "$MODE_COUPLAGE" = "sockets" ] ; then
+ cmdsyr=""
+ if [ ! -z "$COMMANDE_SYRTHES" ] ; then
+ for var in $COMMANDE_SYRTHES ; do
+ if [ "$var" = "-syrthes" ] ; then
+ cmdsyr="$cmdsyr $var -socket"
+ else
+ cmdsyr="$cmdsyr $var"
+ fi
+ done
+ COMMANDE_SYRTHES="$cmdsyr"
+ fi
+ fi
+ #
+fi
+#
+# Lancement du Preprocesseur
+#
+if [ $SOLCOM = 0 -a $MODE_EXEC != calcul ] ; then
+ #
+ ${ECS_HOME}/bin/ecs $ARG_ECS_PAR -mesh $MAILLAGE -case $CAS \
+ $ECHOCOMMECS \
+ $COMMANDE_RC $COMMANDE_PERIO > listenv 2>&1 \
+ || erreur " A L'EXECUTION DU PREPROCESSEUR"
+ #
+ if [ $MODE_EXEC = pre_traitement ] ; then
+ #
+ PRE_TRAITEMENT_AVAL=$RESU/PRE_TRAITEMENT.$SUFFIXE
+ if [ -d ${PRE_TRAITEMENT_AVAL} ] ; then
+ echo "Le repertoire ${PRE_TRAITEMENT_AVAL} existe deja."
+ echo "Copie des fichiers preprocessor_output/n* impossible"
+ else
+ cp -r preprocessor_output ${PRE_TRAITEMENT_AVAL}
+ fi
+ fi
+#
+fi
+#
+# Lancement du calcul proprement dit
+#
+if [ ! -f $ERROR -a $MODE_EXEC != pre_traitement ] ; then
+#
+ if [ $COUPLAGE_SYRTHES = oui -a "$MODE_COUPLAGE" = "MPI" ] ; then
+ # Communication par MPI
+ #
+ # Attention a bien transmettre les eventuels arguments supplementaires
+ # fournis par mpirun a l'executable (pour le cas de MPICH 1.2 standard, qui
+ # fournit les parametres de MPI_Init via argc/argv) : on utilise donc $@
+ # pour transmettre les arguments fournis a localexec aux exectables appeles
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`$CS_HOME/bin/rang_mpi.sh \$@\`" >> $localexec
+ echo cd $RUN >> $localexec
+ echo "if [ \$MPI_RANK -eq 0 ] ; then" >> $localexec
+ echo " $RUN/$EXE_SYR \$@ -comm-mpi 1 -nbr_sat $nproc_noy $ECHOCOMMSYR > listsyr 2>&1" >> $localexec
+ echo "else" >> $localexec
+ echo " $VALGRIND $RUN/$EXE \$@ $ARG_CS_PAR $COMMANDE_SYRTHES -proc 0 $COMMANDE_DF "\
+ "$ARG_CS_VERIF $ARG_CS_OUTPUT $ECHOCOMMNOY -iasize $LONGIA -rasize $LONGRA "\
+ "$COMMANDE_PARAM " >> $localexec
+ echo "fi" >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ #
+ $MPIBOOT
+ $MPIRUN $localexec || erreur " A L'EXECUTION DU NOYAU "
+ $MPIHALT
+ #
+ elif [ $COUPLAGE_SYRTHES = oui ] ; then
+ # Communication par pipes ou sockets
+ #
+ # Lancement de saturne
+ # Attention a bien transmettre les eventuels arguments supplementaires
+ # fournis par mpirun a l'executable (pour le cas de MPICH 1.2 standard, qui
+ # fournit les parametres de MPI_Init via argc/argv) : on utilise donc $@
+ # pour transmettre les arguments fournis a localexec
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_PAR $COMMANDE_SYRTHES $COMMANDE_DF "\
+ " $ARG_CS_VERIF $ARG_CS_OUTPUT $ECHOCOMMNOY -iasize $LONGIA "\
+ " -rasize $LONGRA $COMMANDE_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || erreur " A L'EXECUTION DU NOYAU " &
+ #
+ if [ "$MODE_COUPLAGE" = "sockets" ] ; then
+ # Il faut recuperer la machine et le port dans le listing ;
+ # on utilise un sleep pour laisser le temps au noyau de demarrer et
+ # ecrire ces informations; on evite le while qui pourrait attendre eternellement
+ sleep 5
+ MACHPORT=""
+ MACHPORT=`grep 'Communication possible sur' listing|sed -e "s/Communication possible sur //g"|sed -e "s/, port /:/g"`
+ SOCKETSYR="$SOCKETSYR $MACHPORT"
+ fi
+ #
+ # Lancement de syrthes
+ if [ $COUPLAGE_SYRTHES = oui ] ; then
+ ./$EXE_SYR -nbr_sat $nproc_noy $ECHOCOMMSYR $SOCKETSYR > listsyr 2>&1
+ fi
+ #
+ $MPIHALT
+ #
+ elif [ $SOLCOM = 0 ] ; then
+ #
+ if [ ! -f $ERROR ] ; then
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_PAR "\
+ " $COMMANDE_DF $ARG_CS_VERIF $ARG_CS_OUTPUT $ECHOCOMMNOY "\
+ "-iasize $LONGIA -rasize $LONGRA $COMMANDE_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || erreur " A L'EXECUTION DU NOYAU "
+ $MPIHALT
+ fi
+ #
+ else # cas SOLCOM = 1
+ #
+ $VALGRIND $RUN/$EXE -solcom \
+ -iasize $LONGIA -rasize $LONGRA $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMANDE_PARAM \
+ || erreur " A L'EXECUTION DU NOYAU "
+ #
+ fi
+#
+fi
+#
+########################################################################
+#
+# Recuperation des resultats :
+# on commence par tous les fichiers suite
+# (en cas de pb disque, on a plus de chances de pouvoir
+# poursuivre le calcul).
+#
+if [ $MODE_EXEC != pre_traitement ] ; then
+
+ SUITE_AVAL=$RESU/SUITE.$SUFFIXE
+ iok=1
+ mkdir ${SUITE_AVAL} || iok=0
+ if [ $iok = 1 ] ; then
+ for fich in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $fich ] ; then
+ cp $fich ${SUITE_AVAL}
+ fi
+ done
+ else
+ for fich in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $fich ] ; then
+ cp $fich $RESU/$fich.$SUFFIXE
+ fi
+ done
+ fi
+
+ resuser=0
+ for fich in ${FICHIERS_RESULTATS_UTILISATEUR} ; do
+ if [ -f $fich ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIXE
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for fich in ${FICHIERS_RESULTATS_UTILISATEUR} ; do
+ if [ -f $fich ] ; then
+ cp $fich ${RES_USER}
+ fi
+ done
+ else
+ for fich in ${FICHIERS_RESULTATS_UTILISATEUR} ; do
+ if [ -f $fich ] ; then
+ cp $fich $RESU/$fich.$SUFFIXE
+ fi
+ done
+ fi
+ fi
+
+ for fich in $PARAM $DONNEES_THERMOCHIMIE rubmail dessin ; do
+ if [ -f $fich ] ; then
+ cp $fich $RESU/$fich.$SUFFIXE
+ fi
+ done
+
+ for fich in *.hst ; do
+ if [ -f $fich ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIXE ] ; then
+ mkdir $RESU/HIST.$SUFFIXE
+ fi
+ cp $fich $RESU/HIST.$SUFFIXE
+ fi
+ done
+ for fich in ush* ; do
+ if [ -f $fich ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIXE ] ; then
+ mkdir $RESU/HIST.$SUFFIXE
+ fi
+ cp $fich $RESU/HIST.$SUFFIXE
+ fi
+ done
+
+fi # resultats de calcul
+
+for fich in list* erreur* *.med *.cgns ; do
+ if [ -f $fich ] ; then
+ cp $fich $RESU/$fich.$SUFFIXE
+ fi
+done
+
+# Recup des cas EnSight et MED
+# les fichiers bord* sont des sorties rayonnement eventuelles
+# faites dans le noyau en reponse a un besoin urgent
+# elles seront revues.
+
+# On range les repertoires $dir (=*.ensight et/ou *.med)
+# dans $DIR.$SUFFIXE
+
+cas=`echo $CAS |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIXE
+ if [ $? -ne 0 ] ; then
+ echo Echec a la creation de $RESU/$DIR.$SUFFIXE
+ else
+ for fich in $dir/* ; do
+ if [ -f $fich ] ; then
+ cp -R ${fich} $RESU/$DIR.$SUFFIXE/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $MODE_EXEC != pre_traitement ] ; then
+
+ if [ "${RAYONNEMENT}" = "oui" ] ; then
+ for fich in bord* ; do
+ if [ -f $fich ] ; then
+ if [ ! -d $RESU/CHR.$SUFFIXE ] ; then
+ mkdir $RESU/CHR.$SUFFIXE
+ fi
+ cp $fich $RESU/CHR.$SUFFIXE/.
+ fi
+ done
+ fi
+
+
+ if [ "${LAGRANGIEN}" = "oui" ] ; then
+ mkdir $RESU/LAGR.$SUFFIXE
+ for fich in debug* deplacement* trajectoire* frontiere* ; do
+ if [ -f $fich ] ; then
+ cp $fich $RESU/LAGR.$SUFFIXE
+ fi
+ done
+ fi
+
+ # Fichier de resultats Matisse
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # Ajout de la date sur la premiere ligne du fichier resuMatisse
+ AFDATE="Date du cas : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIXE
+ fi
+
+ for dir in fort_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/FORT.$SUFFIXE
+ if [ $? -ne 0 ] ; then
+ echo Echec a la creation de $RESU/FORT.$SUFFIXE
+ else
+ for fich in $dir/*.[f,F,c,h] ; do
+ if [ -f ${fich} ] ; then
+ cp -R ${fich} $RESU/FORT.$SUFFIXE/.
+ fichbase=`basename ${fich}`
+ chmod a-w $RESU/FORT.$SUFFIXE/${fichbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+ if [ $COUPLAGE_SYRTHES = oui ] ; then
+ mkdir $RESU/RESU_SYR.$SUFFIXE
+ if [ $? -ne 0 ] ; then
+ echo Echec a la creation de $RESU/RESU_SYR.$SUFFIXE
+ else
+ for var in $SYRTHES_ENV.save $SYRTHES_DATA $SYRTHES_DATA_RAY \
+ $SYRTHES_CORR $SYRTHES_CORR_RAY $SYRTHES_FFOR_RAY \
+ $SYRTHES_AVAL_RES1 $SYRTHES_AVAL_RES2 $SYRTHES_AVAL_CHR2 \
+ $SYRTHES_AVAL_HIST \
+ $SYRTHES_AVAL_MAIL_PEAU_FLUIDE $SYRTHES_AVAL_RESU_PEAU_FLUIDE \
+ $SYRTHES_AVAL_CHR_PEAU_FLUIDE \
+ $SYRTHES_AVAL_MAIL_RAY $SYRTHES_AVAL_RESU_RAY \
+ $SYRTHES_AVAL_CHR_RAY \
+ $SYRTHES_AVAL_HIST_RAY ; do
+ fich=$RUN/`echo $var | sed -e "s/.*\///"`
+ if [ -f $fich ] ; then
+ cp $fich $RESU/RESU_SYR.$SUFFIXE/.
+ fi
+ done
+ fi
+ #
+ for dir in fort_syrthes ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/FORT_SYR.$SUFFIXE
+ if [ $? -ne 0 ] ; then
+ echo Echec a la creation de $RESU/FORT_SYR.$SUFFIXE
+ else
+ for fich in $dir/*.[f,F,c,h] ; do
+ if [ -f ${fich} ] ; then
+ cp -R ${fich} $RESU/FORT_SYR.$SUFFIXE/.
+ fichbase=`basename ${fich}`
+ chmod a-w $RESU/FORT_SYR.$SUFFIXE/${fichbase}
+ fi
+ done
+ fi
+ fi
+ done
+ fi
+
+fi # donnees d'entree et resultats de calcul
+#
+########################################################################
+#
+# Resume : fin
+#
+DATEFIN=`date '+%m%d%H%M'`
+echo ' DATE DE FIN : ' $DATEFIN >>$resume
+echo '========================================================'>>$resume
+#
+cp $resume $RESU/$resume.$SUFFIXE
+#
+########################################################################
+#
+#
+# Fin
+#
+if [ -f $ERROR ] ; then
+#
+ echo
+ echo " ********************************************"
+ cat $ERROR
+ echo " ********************************************"
+ exit 1
+#
+else
+#
+ echo
+ echo " ********************************************"
+ echo " Fin normale du calcul "
+ echo " ********************************************"
+ exit 0
+#
+fi
+#
+########################################################################
+#
+########################################################################
diff --git a/examples/2-full_domain/case2/runcase b/examples/2-full_domain/case2/runcase
new file mode 100755
index 0000000..6b17f75
--- /dev/null
+++ b/examples/2-full_domain/case2/runcase
@@ -0,0 +1,1125 @@
+#!/bin/sh
+# bin/runcase. Generated from runcase.in by configure.
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# BATCH FILE FOR THE CCRT (Platine under LSF)
+# ===========================================
+#
+#BSUB -n 2
+#BSUB -W 00:30
+#BSUB -o full_domaincaseo.%J
+#BSUB -e full_domaincasee.%J
+#BSUB -J full_domaincase
+#
+# -n : number of processors
+# -W : walltime as hh:mm
+# -o : output file name
+# -e : error file name
+# -J : job name
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE FOR THE Chatou CLUSTER (PBS)
+# =======================================
+#
+#PBS -l nodes=4:ppn=2
+#PBS -l walltime=1:00:00
+#PBS -l mem=320mb
+#
+#PBS -j eo
+#PBS -N full_domaincase2
+#
+# nodes : number of nodes
+# ppn : number of process per node
+# walltime : wall clock time (hh:mm:ss)
+# mem : memory
+#
+#WARNING: when coupling with SYRTHES, 1 processor will be reserved for each
+# instance of SYRTHES. The Kernel will be executed on the remaining
+# processors, so make sure to reserve a sufficiently high number
+# of processors.
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (University of Manchester Cluster)
+# =============================================
+#
+# set the name of the job
+##$ -N full_domaincase2
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (AIX, Loadlever)
+# ===========================
+#
+#@ shell = /bin/sh
+#
+#@ job_name = full_domaincase2
+#
+#@ job_type = parallel
+#@ cpus = 128
+#@ node_usage = not_shared
+#
+#@ network.MPI = csss,shared,US
+#@ bulkxfer = yes
+#
+#@ wall_clock_limit = 00:20:00
+#@ account_no = z001
+#
+#@ output = $(job_name).$(schedd_host).$(jobid).out
+#@ error = $(job_name).$(schedd_host).$(jobid).err
+#@ notification = never
+#
+#@ queue
+# suggested environment settings:
+# export MP_EAGER_LIMIT=65536
+# export MP_SHARED_MEMORY=yes
+# export MEMORY_AFFINITY=MCM
+# export MP_TASK_AFFINITY=MCM
+#
+########################################################################
+#
+# BEGINNING OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+# runcase.help gives more details about the different variables.
+#
+# -------------------------------
+#
+SOLCOM=0
+#
+# On some systems, some external libraries may require TERM to be defined.
+export TERM=xterm
+#
+STUDY=FULL_DOMAIN
+CASE=CASE2
+PARAM=case2.xml
+MESH="downcomer.des fdc.des pic.des"
+COMMAND_REORIENT=
+COMMAND_JOIN="--join --color 5 24 32 --fraction 0.1 --plane 0.8"
+COMMAND_CWF=
+COMMAND_PERIO=
+THERMOCHEMISTRY_DATA=
+METEO_DATA=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS=
+PROCESSOR_LIST=
+#
+PARTITION_LIST=
+#
+USER_INPUT_FILES=""
+USER_OUTPUT_FILES=""
+#
+# Working directory (leave empty for automatic default directory)
+CS_TMP_PREFIX=
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+CS_LIB_ADD=
+VALGRIND=
+#
+ARG_CS_VERIF=""
+ARG_CS_OUTPUT=""
+#
+# Adaptation using HOMARD
+ADAPTATION=
+#
+summary=summary
+CASEDIR=/home/saturne/TEST_CASE/FULL_DOMAIN/CASE2
+DATA=$CASEDIR/DATA
+RESU=$CASEDIR/RESU
+SRC=$CASEDIR/SRC
+SCRIPTS=$CASEDIR/SCRIPTS
+RESTART_IN=$DATA/RESTART
+PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+MESHDIR=$CASEDIR/../MESH
+#
+# The following variables are only used in case of coupling with SYRTHES.
+# DATA_SYR: directory where to find SYRTHES_ENV
+# SRC_SYR: directory where to find possible user source files
+DATA_SYR=$CASEDIR/DATA_SYR
+SRC_SYR=$CASEDIR/SRC_SYR
+SYRTHES_ENV=syrthes.env
+#
+# The possible coupling mode with SYRTHES may be chosen here.
+#
+# COUPLING_MODE=MPI : should work on most machines.
+# COUPLING_MODE=sockets : should be activated on clusters when the MPI rank
+# of a process is not determinable or if MPI can
+# not be used.
+COUPLING_MODE=MPI
+ECHO_SYR_COMM=""
+#
+# Indicate which steps should be executed; if both the Preprocessor and the
+# Kernel are executed, the "preprocessor_output" and eventual "domain_number_*"
+# files are not saved. If only the preprocessor and / or partitioner are
+# executed, the corresponding files will be saved in a RESU/PREPROCESSOR_OUTPUT
+# and RESU/PARTITION directory. If the Preprocessor is not executed,
+# "preprocessor_output" will be read from $PREPROCESSOR_OUTPUT_IN. If the
+# Partitioner is not executed, "domain_number_*" will be read from
+# $PARTITION_OUTPUT_IN if available (otherwise, unoptimized default
+# partitioning will be used).
+#
+# EXEC_PREPROCESS : should the Preprocessor be run ? (yes/no)
+# EXEC_PARTITION : should the Partitioner be run ? (yes/no)
+# EXEC_KERNEL : should the Kernel be run ? (yes/no)
+#
+EXEC_PREPROCESS=yes
+EXEC_PARTITION=yes
+EXEC_KERNEL=yes
+#
+#
+#
+########################################################################
+#
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Kernel installation parameters
+#
+prefix=/home/saturne/Code_Saturne/2.0-beta2/arch/Linux_x86_64
+#
+exec_prefix=${prefix}
+bindir=${exec_prefix}/bin
+datarootdir=${prefix}/share
+datadir=${datarootdir}
+pkgdatadir=${datadir}/ncs
+#
+# Preprocessor installation parameters
+#
+ecs_prefix=
+#
+ecs_exec_prefix=${ecs_prefix}
+ecs_bindir=${ecs_exec_prefix}/bin
+#
+# HOMARD installation parameters (to be completed if needed)
+#
+homard_prefix=
+#
+########################################################################
+# Mesh Adaptation
+#
+if [ ! -z "${ADAPTATION}" ] ; then
+ if [ "${ADAPTATION}" = "-help" ] ; then
+ ${homard_prefix}/saturne_homard ${ADAPTATION}
+ exit 0
+ else
+ HOMARD_options=" -v"
+ ${homard_prefix}/saturne_homard -Saturne_Script $0 -Donnees_Calcul $CASEDIR \
+ -Pilotage_Adaptation $ADAPTATION $HOMARD_options || exit 1
+ fi
+fi
+#
+#########################################################################
+#
+N_SYRTHES_COUPLINGS=0
+if [ -f "${SRC}/ussyrc.f90" ] ; then
+ N_SYRTHES_COUPLINGS=`grep -e ^' ' ${SRC}/ussyrc.f90 | grep -i -c defsyr`
+fi
+#
+if [ $N_SYRTHES_COUPLINGS = 0 ] ; then
+ SYRTHES_COUPLING=no
+else
+ SYRTHES_COUPLING=yes
+ export SYRTHES
+ if [ $N_SYRTHES_COUPLINGS -gt 1 ] ; then
+ echo "This script can not handle multiple couplings with SYRTHES"
+ echo "Number of SYRTHES couplings requested: $N_SYRTHES_COUPLINGS"
+ fi
+fi
+#
+if [ $SYRTHES_COUPLING = yes ] ; then
+ if [ $SOLCOM -eq 1 ] ; then
+ echo "SYRTHES coupling is not compatible with SOLCOM-type meshes"
+ exit 1
+ fi
+else
+ COUPLING_MODE=
+fi
+#
+########################################################################
+#
+# Parameters for execution
+#
+# General variables
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIX=$DATE
+EXE=cs_solver
+EXE_SYR=syrthes
+#
+# Copy runcase before changing to the working directory
+# (as after that, the relative path will not be up to date).
+#
+cp $0 $RESU/runcase.$SUFFIX
+#
+# Execution directory (reachable by all the processors)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+else
+# Default if not specified by the user
+#
+# On the CCRT, there is no TMPDIR. We work by default in SCRATCHDIR
+ if [ "$SCRATCHDIR" != "" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+ else
+ RUN=$HOME/tmp_Saturne/$STUDY.$CASE.$DATE
+ fi
+fi
+#
+# Create directory if necessary
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "RUN=$RUN already exists."
+ echo "The simulation will not be run."
+ exit 1
+ fi
+fi
+#
+# Create a temporary file for Salome (equivalent to "ficstp")
+if [ "$ARG_CS_OUTPUT" = "--log 0" ] ; then
+ echo $RUN > $SCRIPTS/runningstd.$DATE
+else
+ echo $RUN > $SCRIPTS/runningext.$DATE
+fi
+#
+cd $RUN
+#
+########################################################################
+#
+# Set up MPI environment
+#
+# Use makefile query to obtain the path to MPI binaries if those are
+# not on the default path. This is a peculiar use of make, but allows
+# us to avoid defining the MPI configuration in multiple files.
+
+CS_MPI_PATH=/home/saturne/opt/openmpi-1.3.1/arch/Linux_x86_64/bin
+
+# NUMBER_OF_PROCESSORS is determined here if not already set;
+# MPIHOSTS, MPIRUN, MPIBOOT, MPIHALT, and NUMBER_OF_NODES are
+# defined by the sourced script, and PATH may be updated.
+#
+. ${pkgdatadir}/runcase_mpi_env
+#
+# Check for the number of requested processors
+nproc_kernel="${NUMBER_OF_PROCESSORS}"
+echo
+echo
+if [ $SYRTHES_COUPLING = yes ] ; then
+ echo "Coupling of Code_Saturne and SYRTHES activated."
+ # 1 processor is reserved for SYRTHES if coupled through MPI.
+ if [ "$COUPLING_MODE" = "MPI" ] ; then
+ (( nproc_kernel = nproc_kernel - N_SYRTHES_COUPLINGS ))
+ if [ $nproc_kernel -lt 1 ] ; then
+ echo
+ echo
+ echo " Warning, if COUPLING_MODE = MPI, SYRTHES reserves 1 processor"
+ echo " (which need not be a physical processor)."
+ echo " Here, NUMBER_OF_PROCESSORS=${NUMBER_OF_PROCESSORS}, while it must"
+ echo " be strictly greater than 1."
+ echo " Increase the number of requested processors."
+ echo
+ exit 1
+ fi
+ fi
+fi
+if [ $nproc_kernel -gt 1 ] ; then
+ echo "Parallel Code_Saturne with partitioning in $nproc_kernel sub-domains"
+ if [ $SOLCOM = 1 ] ; then
+ echo
+ echo
+ echo " Parallel run impossible with SOLCOM = $SOLCOM "
+ echo " Use SOLCOM = 0 "
+ echo
+ exit 1
+ fi
+else
+ echo "Single processor Code_Saturne simulation"
+fi
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "Total number of processors: $NUMBER_OF_PROCESSORS"
+fi
+#
+# In parallel mode, the corresponding argument must be set
+if [ $nproc_kernel -gt 1 ] ; then
+ ARG_CS_MPI=" --mpi"
+else
+ ARG_CS_MPI=""
+fi
+#
+#
+########################################################################
+#
+# Communications
+#
+# To help debug coupling problems, make communication more verbose
+if [ ! -z "$ECHO_SYR_COMM" ] ; then
+ ECHOCOMMSYR="-echo-comm $ECHO_SYR_COMM"
+else
+ ECHOCOMMSYR=""
+fi
+########################################################################
+# Greeting message
+#
+echo ' '
+echo ' Code_Saturne is running '
+echo ' *********************** '
+echo ' '
+echo ' Working directory (to be periodically cleaned) : '
+echo ' ' $RUN
+#
+########################################################################
+#
+# Compilation and link
+#
+# Note: we also check the for the presence of certain user subroutines here.
+#
+echo
+echo ' Kernel version: ' $prefix
+echo ' Preprocessor version: ' $ecs_prefix
+
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ cur_dir=`pwd`
+
+ source_cas=$SRC
+
+ #
+ # Copy of the parameter file
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMAND_PARAM="--param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The parameters file ' $var
+ echo ' can not be accessed.'
+ exit 1
+ fi
+ fi
+
+ src_files=`ls ${source_cas}/*.[fF]90 ${source_cas}/*.[ch] 2>/dev/null`
+
+ if [ ! -z "${src_files}" ] ; then
+
+ echo
+ echo " ***************************************************************"
+ echo " Compilation of user subroutines and linking of Code_Saturne"
+ echo " ***************************************************************"
+
+ if [ -f compil.log ] ; then
+ rm -f compil.log
+ fi
+
+ src_dir="src_saturne"
+
+ # Copy of the user source files
+ # (no links: the directory is copied later)
+ mkdir ${src_dir}
+ for f in ${src_files} ; do
+ if [ -f $f ] ; then
+ cp ${f} ${src_dir}/
+ fi
+ done
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --source=$src_dir --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ # Compilation
+ if [ ! -z "${CS_LIB_ADD}" ] ; then
+ OPTLIBS="--opt-libs=${CS_LIB_ADD}"
+ fi
+ ${bindir}/cs compile \
+ --source=$src_dir ${OPTLIBS} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ echo "COMPILE OR LINK ERROR"
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ fi
+
+ else
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ ln -s ${bindir}/$EXE .
+
+ fi
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+
+ ${pkgdatadir}/runcase_syrthes -compile \
+ -cs-bindir=${bindir} -src-syr=${SRC_SYR} \
+ -src-copy=${RESU}/SRC_SYR.${SUFFIX} -log=${RESU}/compil_syrthes.log.${SUFFIX}
+
+ fi
+
+fi # EXEC_KERNEL = yes
+
+#
+########################################################################
+#
+# Data setup
+#
+echo
+echo " ********************************************"
+echo " Preparing calculation "
+echo " ********************************************"
+echo
+#
+ERROR=false
+PREPROCESS_ERROR=false
+PARTITION_ERROR=false
+EXECUTION_ERROR=false
+#
+if [ $SOLCOM = 1 ]
+then
+ EXEC_PREPROCESS=no
+ EXEC_PARTITION=no
+ ln -s $MESHDIR/$MESH geomet || exit 1
+fi
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ]
+then
+ for var in $MESH ; do
+ ln -s $MESHDIR/$var $var || exit 1
+ # Special case for meshes in EnSight format: link to .geo file necessary
+ # (retrieve name through .case file)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $MESHDIR/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+else
+ if [ -f ${PREPROCESSOR_OUTPUT_IN} ] ; then
+ ln -s ${PREPROCESSOR_OUTPUT_IN} preprocessor_output || exit 1
+ else
+ echo "Error: no preprocessor output file is available;"
+ echo " (${PREPROCESSOR_OUTPUT_IN} does not exist."
+ echo " or is not a standard file."
+ exit 1
+ fi
+fi
+#
+if [ $nproc_kernel -eq 1 -a "${EXEC_KERNEL}" = "yes" ] ; then
+ EXEC_PARTITION=no
+elif [ "${EXEC_PARTITION}" = "no" -a "${PARTITION_OUTPUT_IN}" != "" ]
+then
+ if [ -f ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} ] ; then
+ ln -s ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} .
+ else
+ echo "Warning: no partitioning file is available;"
+ echo " (no ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel})."
+ echo
+ echo " Unoptimized partitioning will be used."
+ echo " Parallel performance may be degraded."
+ fi
+fi
+#
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ for var in ${RESTART_IN}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "$THERMOCHEMISTRY_DATA" != "" ] ; then
+ var=$DATA/$THERMOCHEMISTRY_DATA
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # Copy so as to have correct name upon backup
+ if [ "$THERMOCHEMISTRY_DATA" != "dp_tch" ] ; then
+ cp dp_tch $THERMOCHEMISTRY_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The thermochemistry file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ if [ "$METEO_DATA" != "" ] ; then
+ var=$DATA/$METEO_DATA
+ if [ -f $var ] ; then
+ cp $var meteo
+ # Copy so as to have correct name upon backup
+ if [ "$METEO_DATA" != "meteo" ] ; then
+ cp meteo $METEO_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The meteo profile file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ for f in uscpcl.f90 usd3pc.f90 usebuc.f90 uslwcc.f90 usfucl.f90
+ do
+ if [ -f "${SRC}/${f}" -a ! -f JANAF ] ; then
+ cp ${datadir}/data/thch/JANAF JANAF
+ fi
+ done
+ #
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ #
+ ${pkgdatadir}/runcase_syrthes -copy-data -syrthes-env=${DATA_SYR}/$SYRTHES_ENV
+ #
+ fi
+ #
+ if [ ! -z "$USER_INPUT_FILES" ] ; then
+ for f in $USER_INPUT_FILES ; do
+ cp $DATA/$f .
+ done
+ fi
+ #
+fi # EXEC_KERNEL = yes
+
+########################################################################
+# Maximum time for PBS (done here so as to leave time for PBS to
+# realize that things have started).
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Summary: start
+#
+CURDATE=`unset LANG ; date`
+#
+echo '========================================================'>>$summary
+echo ' Start time : ' $CURDATE >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Kernel : ' $prefix >>$summary
+echo ' Preprocessor : ' $ecs_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' HOMARD : ' $homard_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' CS_MPI_PATH : ' $CS_MPI_PATH >>$summary
+echo ' PATH : ' $PATH >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' User : ' $USER >>$summary
+echo '========================================================'>>$summary
+echo ' Machine : ' >>$summary
+ uname -a >>$summary
+if [ -z "$NUMBER_OF_PROCESSORS" ] ; then
+ echo ' N Procs : ' 1 >>$summary
+else
+ echo ' N Procs : ' $NUMBER_OF_PROCESSORS >>$summary
+fi
+if [ -z "$PROCESSOR_LIST" ] ; then
+ echo ' Processors : ' default >>$summary
+else
+ echo ' Processors : ' $PROCESSOR_LIST >>$summary
+fi
+echo '========================================================'>>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Case : ' $CASE >>$summary
+echo ' DATA : ' $DATA >>$summary
+echo ' SRC : ' $SRC >>$summary
+echo ' RESU : ' $RESU >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Exec. dir. : ' $RUN >>$summary
+echo ' ----------------------------------------------------' >>$summary
+if [ "$EXEC_PREPROCESSOR" = "yes" ] ; then
+ echo ' Preprocessor : ' ${ecs_bindir}/cs_preprocess >>$summary
+fi
+if [ "$EXEC_PARTITION" = "yes" ] ; then
+ echo ' Partitioner : ' ${ecs_bindir}/cs_partition >>$summary
+fi
+if [ "$EXEC_KERNEL" = "yes" ] ; then
+ echo ' Executable : ' $EXE >>$summary
+fi
+echo ' ----------------------------------------------------' >>$summary
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Starting calculation"
+echo " ********************************************"
+echo
+#
+# Preprocessor start
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ] ; then
+ #
+ ${ecs_bindir}/cs_preprocess --mesh $MESH "--case" $CASE \
+ $COMMAND_REORIENT $COMMAND_JOIN $COMMAND_PERIO \
+ > listpre 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error running the preprocessor."
+ echo "Check preprocessor log (listpre) for details."
+ echo
+ PREPROCESS_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PREPROCESSOR_OUTPUT_OUT=$RESU/preprocessor_output.$SUFFIX
+ cp preprocessor_output ${PREPROCESSOR_OUTPUT_OUT}
+ fi
+ #
+fi
+#
+# Partitioner start
+#
+if [ ! -f ${ecs_bindir}/cs_partition ] ; then
+ echo "Warning: ${ecs_bindir}/cs_partition not found."
+ echo
+ echo "The partitioner may not have been installed"
+ echo " (this is the case if neither METIS nor."
+ echo " SCOTCH are avaialable)."
+ echo
+ echo "Unoptimized partitioning will be used, so"
+ echo "parallel performance may be degraded."
+ echo
+ EXEC_PARTITION=no
+fi
+#
+if [ "${EXEC_PARTITION}" = "yes" ] ; then
+ #
+ if [ "${EXEC_KERNEL}" = "yes" ] ; then
+ ${ecs_bindir}/cs_partition $nproc_kernel > listpart 2>&1
+ else
+ if [ -z "$PARTITION_LIST" ] ; then
+ echo "Error running the partitioner."
+ echo "PARTITION_LIST is not set."
+ echo "This variable should contain the number of processors"
+ echo "for which we partition (or a list of such numbers)."
+ PARTITION_ERROR=true
+ ERROR=true
+ else
+ ${ecs_bindir}/cs_partition $PARTITION_LIST > listpart 2>&1
+ fi
+ fi
+ if [ $? != 0 -a $PARTITION_ERROR = false ] ; then
+ echo "Error running the partitioner."
+ echo "Check partitioner log (listpart) for details."
+ echo
+ PARTITION_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PARTITION_OUTPUT_OUT=$RESU/PARTITION_OUTPUT.$SUFFIX
+ mkdir $PARTITION_OUTPUT_OUT
+ cp -r domain_number_* ${PARTITION_OUTPUT_OUT}/
+ fi
+#
+fi
+#
+# Run calculation proper.
+#
+if [ "$ERROR" != "true" -a "$EXEC_KERNEL" = "yes" ] ; then
+#
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ # MPI Communication
+ #
+ # Make sure to transmit possible additional arguments assigned by mpirun to
+ # the executable with some MPI-1 implementations (vanilla MPICH 1.2 sets the
+ # parameters needed by MPI_Init through argc/argv): we use $@ to forward
+ # arguments passed to localexec to the true executable files.
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`${pkgdatadir}/runcase_mpi_rank \$@\`" >> $localexec
+ echo cd $RUN >> $localexec
+ echo "if [ \$MPI_RANK -eq 0 ] ; then" >> $localexec
+ echo " $RUN/$EXE_SYR \$@ -app-num 0 -comm-mpi 1 $ECHOCOMMSYR > listsyr 2>&1" >> $localexec
+ echo "else" >> $localexec
+ echo " $VALGRIND $RUN/$EXE \$@ --mpi 1 $COMMAND_CWF "\
+ "$ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM " >> $localexec
+ echo "fi" >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ #
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ elif [ $SYRTHES_COUPLING = yes ] ; then
+ # Socket communications
+ #
+ # We provide the executables with a "random" port number.
+ PORT=35623
+ SOCKETNCS="--syr-socket $PORT"
+ SOCKETSYR="-comm-socket $PORT"
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI $COMMAND_CWF "\
+ " $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM $SOCKETNCS " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true &
+ #
+ ./$EXE_SYR $ECHOCOMMSYR $SOCKETSYR > listsyr 2>&1
+ #
+ $MPIHALT
+ #
+ elif [ $SOLCOM = 0 ] ; then
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI "\
+ " $COMMAND_CWF $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ else # cas SOLCOM = 1
+ #
+ $VALGRIND $RUN/$EXE --solcom \
+ $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM \
+ || EXECUTION_ERROR=true
+ #
+ fi
+#
+fi
+#
+# Remove the Salome temporary files
+rm -f $SCRIPTS/running*.$DATE
+#
+########################################################################
+#
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ echo "Error running the coupled calculation."
+ echo "Either the Kernel or SYRTHES may have failed."
+ echo
+ echo "Check Kernel log (listing) and SYRTHES log (listsyr) for details,"
+ echo "as well as eventual error* files."
+ echo
+ else
+ echo "Error running the calculation."
+ echo
+ echo "Check Kernel log (listing) and error* files for details"
+ echo
+ fi
+ ERROR=true
+fi
+#
+# Treatment of the ouput files:
+# Starts with the restart files
+# (in case of full disk, increases chances of being able to continue).
+#
+if [ $EXEC_KERNEL = yes ] ; then
+
+ RESTART_OUT=$RESU/RESTART.$SUFFIX
+ iok=1
+ mkdir ${RESTART_OUT} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f ${RESTART_OUT}
+ fi
+ done
+ else
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+
+ resuser=0
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIX
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f ${RES_USER}
+ fi
+ done
+ else
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+ fi
+
+ for f in $PARAM $THERMOCHEMISTRY_DATA $METEO_DATA ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+
+ for f in probes_*.dat ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+ for f in ush* ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+
+fi # output files
+
+for f in list* error* *.med *.cgns ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+done
+
+# Treatment of EnSight and MED files
+# The $dir (=*.ensight and/or *.med) directories are copied
+# to $DIR.$SUFFIX
+
+# We place directories $dir (=*.ensight and/or *.med)
+# in $DIR.$SUFFIX
+
+cas=`echo $CASE |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Creating $RESU/$DIR.$SUFFIX failed
+ else
+ for f in $dir/* ; do
+ if [ -f $f ] ; then
+ cp -R ${f} $RESU/$DIR.$SUFFIX/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ rayt_list=`ls bord* 2>/dev/null`
+ if [ ! -z "${rayt_list}" ] ; then
+ for f in $rayt_list ; do
+ if [ ! -d $RESU/CHR.$SUFFIX ] ; then
+ mkdir $RESU/CHR.$SUFFIX
+ fi
+ cp $f $RESU/CHR.$SUFFIX/.
+ done
+ fi
+
+ lagr_list=`ls debug* deplacement* trajectoire* frontiere* 2>/dev/null`
+ if [ ! -z "${lagr_list}" ] ; then
+ mkdir $RESU/LAGR.$SUFFIX
+ for f in $lagr_list ; do
+ cp $f $RESU/LAGR.$SUFFIX
+ done
+ fi
+
+ # Matisse output files
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # The date is added to the first line of resuMatisse
+ AFDATE="Date of the case : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIX
+ fi
+
+ for dir in src_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/SRC.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Failure creating $RESU/SRC.$SUFFIX
+ else
+ for f in $dir/*.[fF]90 $dir/*.[ch] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} $RESU/SRC.$SUFFIX/.
+ fbase=`basename ${f}`
+ chmod a-w $RESU/SRC.$SUFFIX/${fbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ ${pkgdatadir}/runcase_syrthes -copy-results \
+ -result-dir=${RESU}/RESU_SYR.${SUFFIX}
+ fi
+
+fi # input data and outputs
+#
+########################################################################
+#
+# Summary: end
+#
+if [ "$PREPROCESS_ERROR" = "true" ] ; then
+ EXEC_PREPROCESS="failed"
+fi
+echo " Preprocessing : " $EXEC_PREPROCESS >>$summary
+if [ "$PARTITION_ERROR" = "true" ] ; then
+ EXEC_PARTITION="failed"
+fi
+echo " Partitioning : " $EXEC_PARTITION >>$summary
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ EXEC_KERNEL="failed"
+fi
+echo " Calculation : " $EXEC_KERNEL >>$summary
+#
+CURDATE=`unset LANG ; date`
+#
+echo ' ----------------------------------------------------' >>$summary
+echo ' Finish time : ' $CURDATE >>$summary
+echo '========================================================'>>$summary
+#
+cp $summary $RESU/$summary.$SUFFIX
+#
+########################################################################
+#
+#
+# Finish
+#
+echo
+echo " ********************************************"
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ echo " Error in calculation stage."
+elif [ "$PARTITION_ERROR" = "true" ] ; then
+ echo " Error in partitioning stage."
+elif [ "$PREPROCESS_ERROR" = "true" ] ; then
+ echo " Error in preprocessing stage."
+else
+ echo " Normal simulation finish"
+fi
+echo " ********************************************"
+
+if [ "$ERROR" = "true" ] ; then
+ exit 1
+else
+ exit 0
+fi
+#
+########################################################################
diff --git a/examples/2-full_domain/case3/case3.xml b/examples/2-full_domain/case3/case3.xml
new file mode 100644
index 0000000..21dee12
--- /dev/null
+++ b/examples/2-full_domain/case3/case3.xml
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="utf-8"?><Code_Saturne_GUI case="CASE3" study="FULL_DOMAIN" version="1.0">
+ <solution_domain>
+ <volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" scalar_source_term="off" thermal_source_term="off">all[]</zone>
+ </volumic_conditions>
+ <meshes_list>
+ <mesh format="des" name="downcomer.des"/>
+ <mesh format="des" name="fdc.des"/>
+ <mesh format="des" name="pic.des"/>
+ </meshes_list>
+ <join_meshes status="on">
+ <faces_join name="1" status="on">
+ <faces_color>5 24 32</faces_color>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ </faces_join>
+ </join_meshes>
+ <faces_cutting status="off"/>
+ <reorientation status="off"/>
+ <syrthes_coupling status="off"/>
+ <periodic_boundary/>
+ <standalone/>
+ </solution_domain>
+ <thermophysical_models>
+ <velocity_pressure>
+ <variable label="Pression" name="pressure">
+ <reference_pressure>101325</reference_pressure>
+ <listing_printing status="off"/>
+ </variable>
+ <variable label="VitesseX" name="velocity_U">
+ <blending_factor>1</blending_factor>
+ <probes choice="5">
+ <probe_recording name="1"/>
+ <probe_recording name="2"/>
+ <probe_recording name="6"/>
+ <probe_recording name="7"/>
+ <probe_recording name="8"/>
+ </probes>
+ </variable>
+ <variable label="VitesseY" name="velocity_V">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseZ" name="velocity_W">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>
+ <ale_method status="off"/>
+ <turbulence model="k-epsilon">
+ <variable label="EnerTurb" name="turb_k">
+ <listing_printing status="off"/>
+ </variable>
+ <variable label="Dissip" name="turb_eps">
+ <listing_printing status="off"/>
+ </variable>
+ <property label="visc. tu" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ </turbulence>
+ <thermal_scalar model="temperature_celsius">
+ <property label="Flux_thermique_entrant" name="input_thermal_flux" support="boundary"/>
+ </thermal_scalar>
+ <radiative_transfer model="off">
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ </radiative_transfer>
+ <gas_combustion model="off"/>
+ <pulverized_coal model="off"/>
+ <joule_effect model="off"/>
+ <atmospheric_flows model="off">
+ <read_meteo_data status="off"/>
+ </atmospheric_flows>
+ </thermophysical_models>
+ <numerical_parameters>
+ <multigrid status="on"/>
+ <gradient_transposed status="on"/>
+ <velocity_pressure_coupling status="off"/>
+ <pressure_relaxation>1</pressure_relaxation>
+ <wall_pressure_extrapolation>0</wall_pressure_extrapolation>
+ <gradient_reconstruction choice="0"/>
+ </numerical_parameters>
+ <physical_properties>
+ <fluid_properties>
+ <property choice="variable" label="Masse vo" name="density">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>725.735</initial_value>
+ </property>
+ <property choice="constant" label="Visc. la" name="molecular_viscosity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>8.95e-05</initial_value>
+ </property>
+ <property choice="constant" label="Ch.spec." name="specific_heat">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>5483</initial_value>
+ </property>
+ <property choice="constant" label="Cond. th" name="thermal_conductivity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>0.02495</initial_value>
+ </property>
+ </fluid_properties>
+ <gravity>
+ <gravity_x>0</gravity_x>
+ <gravity_y>-9.81</gravity_y>
+ <gravity_z>0</gravity_z>
+ </gravity>
+ <hydrostatic_pressure status="off"/>
+ </physical_properties>
+ <additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>400</max_value>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ <scalar label="scalar_2" name="scalar2" type="user">
+ <initial_value zone="1">10.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>400</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_2">
+ <initial_value>8.95e-05</initial_value>
+ </property>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ </additional_scalars>
+ <boundary_conditions>
+ <boundary label="inlet" name="1" nature="inlet">1</boundary>
+ <boundary label="outlet" name="2" nature="outlet">34</boundary>
+ <boundary label="symmetry" name="3" nature="symmetry">8 or 9 or 28 or 29 or 38 or 39</boundary>
+ <boundary label="Wall_1" name="4" nature="wall">24 and 0.1<=X and 0.5>=X</boundary>
+ <boundary label="Wall_2" name="5" nature="wall">2 or 3</boundary>
+ <boundary label="Wall_3" name="6" nature="wall">4 or 7 or 21 or 22 or 23</boundary>
+ <boundary label="Wall_4" name="7" nature="wall">6 and Y>1</boundary>
+ <boundary label="Wall_5" name="8" nature="wall">6 and Y<=1</boundary>
+ <boundary label="Wall_6" name="9" nature="wall">31 or 33</boundary>
+ <inlet label="inlet">
+ <velocity_pressure choice="norm" direction="coordinates">
+ <norm>1</norm>
+ <direction_x>1</direction_x>
+ <direction_y>0</direction_y>
+ <direction_z>0</direction_z>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>0.5</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="Temp.C" name="temperature_celsius" type="thermal">
+ <dirichlet>300</dirichlet>
+ </scalar>
+ <scalar choice="dirichlet" label="scalar_2" name="scalar2" type="user">
+ <dirichlet>200</dirichlet>
+ </scalar>
+ </inlet>
+ <outlet label="outlet">
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </outlet>
+ <symmetry label="symmetry"/>
+ <wall label="Wall_1">
+ <velocity_pressure choice="off">
+ <dirichlet name="velocity_U">0</dirichlet>
+ <dirichlet name="velocity_V">0</dirichlet>
+ <dirichlet name="velocity_W">0</dirichlet>
+ </velocity_pressure>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_3">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_2">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>5</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_4">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>25</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_5">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>320</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_6">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>40</neumann>
+ </scalar>
+ </wall>
+ <variable/>
+ </boundary_conditions>
+ <analysis_control>
+ <output>
+ <postprocessing_mesh_options choice="0"/>
+ <postprocessing_format choice="EnSight"/>
+ <postprocessing_options choice="binary"/>
+ <domain_boundary status="on"/>
+ <listing_printing_frequency>1</listing_printing_frequency>
+ <postprocessing_frequency>2</postprocessing_frequency>
+ <probe_recording_frequency>1</probe_recording_frequency>
+ <fluid_domain status="on"/>
+ <probe name="1" status="on">
+ <probe_x>-0.25</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="2" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="3" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>2.75</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="4" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>0.5</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="5" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>-0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="6" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>-0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="7" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="8" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>0.75</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="9" status="on">
+ <probe_x>-0.5</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ </output>
+ <time_parameters>
+ <property label="Nb Courant" name="courant_number">
+ <postprocessing_recording status="off"/>
+ </property>
+ <property label="Nb Fourier" name="fourier_number">
+ <postprocessing_recording status="off"/>
+ </property>
+ <time_step_ref>0.05</time_step_ref>
+ <iterations>700</iterations>
+ <time_passing>0</time_passing>
+ <zero_time_step status="off"/>
+ </time_parameters>
+ <steady_management status="off"/>
+ <time_averages/>
+ <profiles/>
+ </analysis_control>
+ <calcul_management>
+ <integer_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </integer_user_array>
+ <real_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </real_user_array>
+ <start_restart>
+ <restart status="off"/>
+ <frozen_field status="off"/>
+ <restart_rescue>0</restart_rescue>
+ <restart_with_auxiliary status="on"/>
+ </start_restart>
+ </calcul_management>
+ <lagrangian model="off"/>
+</Code_Saturne_GUI>
diff --git a/examples/2-full_domain/case3/runcase b/examples/2-full_domain/case3/runcase
new file mode 100755
index 0000000..a6234a0
--- /dev/null
+++ b/examples/2-full_domain/case3/runcase
@@ -0,0 +1,1125 @@
+#!/bin/sh
+# bin/runcase. Generated from runcase.in by configure.
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# BATCH FILE FOR THE CCRT (Platine under LSF)
+# ===========================================
+#
+#BSUB -n 2
+#BSUB -W 00:30
+#BSUB -o full_domaincaseo.%J
+#BSUB -e full_domaincasee.%J
+#BSUB -J full_domaincase
+#
+# -n : number of processors
+# -W : walltime as hh:mm
+# -o : output file name
+# -e : error file name
+# -J : job name
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE FOR THE Chatou CLUSTER (PBS)
+# =======================================
+#
+#PBS -l nodes=4:ppn=2
+#PBS -l walltime=1:00:00
+#PBS -l mem=320mb
+#
+#PBS -j eo
+#PBS -N full_domaincase3
+#
+# nodes : number of nodes
+# ppn : number of process per node
+# walltime : wall clock time (hh:mm:ss)
+# mem : memory
+#
+#WARNING: when coupling with SYRTHES, 1 processor will be reserved for each
+# instance of SYRTHES. The Kernel will be executed on the remaining
+# processors, so make sure to reserve a sufficiently high number
+# of processors.
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (University of Manchester Cluster)
+# =============================================
+#
+# set the name of the job
+##$ -N full_domaincase3
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (AIX, Loadlever)
+# ===========================
+#
+#@ shell = /bin/sh
+#
+#@ job_name = full_domaincase3
+#
+#@ job_type = parallel
+#@ cpus = 128
+#@ node_usage = not_shared
+#
+#@ network.MPI = csss,shared,US
+#@ bulkxfer = yes
+#
+#@ wall_clock_limit = 00:20:00
+#@ account_no = z001
+#
+#@ output = $(job_name).$(schedd_host).$(jobid).out
+#@ error = $(job_name).$(schedd_host).$(jobid).err
+#@ notification = never
+#
+#@ queue
+# suggested environment settings:
+# export MP_EAGER_LIMIT=65536
+# export MP_SHARED_MEMORY=yes
+# export MEMORY_AFFINITY=MCM
+# export MP_TASK_AFFINITY=MCM
+#
+########################################################################
+#
+# BEGINNING OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+# runcase.help gives more details about the different variables.
+#
+# -------------------------------
+#
+SOLCOM=0
+#
+# On some systems, some external libraries may require TERM to be defined.
+export TERM=xterm
+#
+STUDY=FULL_DOMAIN
+CASE=CASE3
+PARAM=case3.xml
+MESH="downcomer.des fdc.des pic.des"
+COMMAND_REORIENT=
+COMMAND_JOIN="--join --color 5 24 32 --fraction 0.1 --plane 0.8"
+COMMAND_CWF=
+COMMAND_PERIO=
+THERMOCHEMISTRY_DATA=
+METEO_DATA=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS=
+PROCESSOR_LIST=
+#
+PARTITION_LIST=
+#
+USER_INPUT_FILES=""
+USER_OUTPUT_FILES=""
+#
+# Working directory (leave empty for automatic default directory)
+CS_TMP_PREFIX=
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+CS_LIB_ADD=
+VALGRIND=
+#
+ARG_CS_VERIF=""
+ARG_CS_OUTPUT=""
+#
+# Adaptation using HOMARD
+ADAPTATION=
+#
+summary=summary
+CASEDIR=/home/saturne/TEST_CASE/FULL_DOMAIN/CASE3
+DATA=$CASEDIR/DATA
+RESU=$CASEDIR/RESU
+SRC=$CASEDIR/SRC
+SCRIPTS=$CASEDIR/SCRIPTS
+RESTART_IN=$DATA/RESTART
+PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+MESHDIR=$CASEDIR/../MESH
+#
+# The following variables are only used in case of coupling with SYRTHES.
+# DATA_SYR: directory where to find SYRTHES_ENV
+# SRC_SYR: directory where to find possible user source files
+DATA_SYR=$CASEDIR/DATA_SYR
+SRC_SYR=$CASEDIR/SRC_SYR
+SYRTHES_ENV=syrthes.env
+#
+# The possible coupling mode with SYRTHES may be chosen here.
+#
+# COUPLING_MODE=MPI : should work on most machines.
+# COUPLING_MODE=sockets : should be activated on clusters when the MPI rank
+# of a process is not determinable or if MPI can
+# not be used.
+COUPLING_MODE=MPI
+ECHO_SYR_COMM=""
+#
+# Indicate which steps should be executed; if both the Preprocessor and the
+# Kernel are executed, the "preprocessor_output" and eventual "domain_number_*"
+# files are not saved. If only the preprocessor and / or partitioner are
+# executed, the corresponding files will be saved in a RESU/PREPROCESSOR_OUTPUT
+# and RESU/PARTITION directory. If the Preprocessor is not executed,
+# "preprocessor_output" will be read from $PREPROCESSOR_OUTPUT_IN. If the
+# Partitioner is not executed, "domain_number_*" will be read from
+# $PARTITION_OUTPUT_IN if available (otherwise, unoptimized default
+# partitioning will be used).
+#
+# EXEC_PREPROCESS : should the Preprocessor be run ? (yes/no)
+# EXEC_PARTITION : should the Partitioner be run ? (yes/no)
+# EXEC_KERNEL : should the Kernel be run ? (yes/no)
+#
+EXEC_PREPROCESS=yes
+EXEC_PARTITION=yes
+EXEC_KERNEL=yes
+#
+#
+#
+########################################################################
+#
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Kernel installation parameters
+#
+prefix=/home/saturne/Code_Saturne/2.0-beta2/arch/Linux_x86_64
+#
+exec_prefix=${prefix}
+bindir=${exec_prefix}/bin
+datarootdir=${prefix}/share
+datadir=${datarootdir}
+pkgdatadir=${datadir}/ncs
+#
+# Preprocessor installation parameters
+#
+ecs_prefix=
+#
+ecs_exec_prefix=${ecs_prefix}
+ecs_bindir=${ecs_exec_prefix}/bin
+#
+# HOMARD installation parameters (to be completed if needed)
+#
+homard_prefix=
+#
+########################################################################
+# Mesh Adaptation
+#
+if [ ! -z "${ADAPTATION}" ] ; then
+ if [ "${ADAPTATION}" = "-help" ] ; then
+ ${homard_prefix}/saturne_homard ${ADAPTATION}
+ exit 0
+ else
+ HOMARD_options=" -v"
+ ${homard_prefix}/saturne_homard -Saturne_Script $0 -Donnees_Calcul $CASEDIR \
+ -Pilotage_Adaptation $ADAPTATION $HOMARD_options || exit 1
+ fi
+fi
+#
+#########################################################################
+#
+N_SYRTHES_COUPLINGS=0
+if [ -f "${SRC}/ussyrc.f90" ] ; then
+ N_SYRTHES_COUPLINGS=`grep -e ^' ' ${SRC}/ussyrc.f90 | grep -i -c defsyr`
+fi
+#
+if [ $N_SYRTHES_COUPLINGS = 0 ] ; then
+ SYRTHES_COUPLING=no
+else
+ SYRTHES_COUPLING=yes
+ export SYRTHES
+ if [ $N_SYRTHES_COUPLINGS -gt 1 ] ; then
+ echo "This script can not handle multiple couplings with SYRTHES"
+ echo "Number of SYRTHES couplings requested: $N_SYRTHES_COUPLINGS"
+ fi
+fi
+#
+if [ $SYRTHES_COUPLING = yes ] ; then
+ if [ $SOLCOM -eq 1 ] ; then
+ echo "SYRTHES coupling is not compatible with SOLCOM-type meshes"
+ exit 1
+ fi
+else
+ COUPLING_MODE=
+fi
+#
+########################################################################
+#
+# Parameters for execution
+#
+# General variables
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIX=$DATE
+EXE=cs_solver
+EXE_SYR=syrthes
+#
+# Copy runcase before changing to the working directory
+# (as after that, the relative path will not be up to date).
+#
+cp $0 $RESU/runcase.$SUFFIX
+#
+# Execution directory (reachable by all the processors)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+else
+# Default if not specified by the user
+#
+# On the CCRT, there is no TMPDIR. We work by default in SCRATCHDIR
+ if [ "$SCRATCHDIR" != "" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+ else
+ RUN=$HOME/tmp_Saturne/$STUDY.$CASE.$DATE
+ fi
+fi
+#
+# Create directory if necessary
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "RUN=$RUN already exists."
+ echo "The simulation will not be run."
+ exit 1
+ fi
+fi
+#
+# Create a temporary file for Salome (equivalent to "ficstp")
+if [ "$ARG_CS_OUTPUT" = "--log 0" ] ; then
+ echo $RUN > $SCRIPTS/runningstd.$DATE
+else
+ echo $RUN > $SCRIPTS/runningext.$DATE
+fi
+#
+cd $RUN
+#
+########################################################################
+#
+# Set up MPI environment
+#
+# Use makefile query to obtain the path to MPI binaries if those are
+# not on the default path. This is a peculiar use of make, but allows
+# us to avoid defining the MPI configuration in multiple files.
+
+CS_MPI_PATH=/home/saturne/opt/openmpi-1.3.1/arch/Linux_x86_64/bin
+
+# NUMBER_OF_PROCESSORS is determined here if not already set;
+# MPIHOSTS, MPIRUN, MPIBOOT, MPIHALT, and NUMBER_OF_NODES are
+# defined by the sourced script, and PATH may be updated.
+#
+. ${pkgdatadir}/runcase_mpi_env
+#
+# Check for the number of requested processors
+nproc_kernel="${NUMBER_OF_PROCESSORS}"
+echo
+echo
+if [ $SYRTHES_COUPLING = yes ] ; then
+ echo "Coupling of Code_Saturne and SYRTHES activated."
+ # 1 processor is reserved for SYRTHES if coupled through MPI.
+ if [ "$COUPLING_MODE" = "MPI" ] ; then
+ (( nproc_kernel = nproc_kernel - N_SYRTHES_COUPLINGS ))
+ if [ $nproc_kernel -lt 1 ] ; then
+ echo
+ echo
+ echo " Warning, if COUPLING_MODE = MPI, SYRTHES reserves 1 processor"
+ echo " (which need not be a physical processor)."
+ echo " Here, NUMBER_OF_PROCESSORS=${NUMBER_OF_PROCESSORS}, while it must"
+ echo " be strictly greater than 1."
+ echo " Increase the number of requested processors."
+ echo
+ exit 1
+ fi
+ fi
+fi
+if [ $nproc_kernel -gt 1 ] ; then
+ echo "Parallel Code_Saturne with partitioning in $nproc_kernel sub-domains"
+ if [ $SOLCOM = 1 ] ; then
+ echo
+ echo
+ echo " Parallel run impossible with SOLCOM = $SOLCOM "
+ echo " Use SOLCOM = 0 "
+ echo
+ exit 1
+ fi
+else
+ echo "Single processor Code_Saturne simulation"
+fi
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "Total number of processors: $NUMBER_OF_PROCESSORS"
+fi
+#
+# In parallel mode, the corresponding argument must be set
+if [ $nproc_kernel -gt 1 ] ; then
+ ARG_CS_MPI=" --mpi"
+else
+ ARG_CS_MPI=""
+fi
+#
+#
+########################################################################
+#
+# Communications
+#
+# To help debug coupling problems, make communication more verbose
+if [ ! -z "$ECHO_SYR_COMM" ] ; then
+ ECHOCOMMSYR="-echo-comm $ECHO_SYR_COMM"
+else
+ ECHOCOMMSYR=""
+fi
+########################################################################
+# Greeting message
+#
+echo ' '
+echo ' Code_Saturne is running '
+echo ' *********************** '
+echo ' '
+echo ' Working directory (to be periodically cleaned) : '
+echo ' ' $RUN
+#
+########################################################################
+#
+# Compilation and link
+#
+# Note: we also check the for the presence of certain user subroutines here.
+#
+echo
+echo ' Kernel version: ' $prefix
+echo ' Preprocessor version: ' $ecs_prefix
+
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ cur_dir=`pwd`
+
+ source_cas=$SRC
+
+ #
+ # Copy of the parameter file
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMAND_PARAM="--param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The parameters file ' $var
+ echo ' can not be accessed.'
+ exit 1
+ fi
+ fi
+
+ src_files=`ls ${source_cas}/*.[fF]90 ${source_cas}/*.[ch] 2>/dev/null`
+
+ if [ ! -z "${src_files}" ] ; then
+
+ echo
+ echo " ***************************************************************"
+ echo " Compilation of user subroutines and linking of Code_Saturne"
+ echo " ***************************************************************"
+
+ if [ -f compil.log ] ; then
+ rm -f compil.log
+ fi
+
+ src_dir="src_saturne"
+
+ # Copy of the user source files
+ # (no links: the directory is copied later)
+ mkdir ${src_dir}
+ for f in ${src_files} ; do
+ if [ -f $f ] ; then
+ cp ${f} ${src_dir}/
+ fi
+ done
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --source=$src_dir --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ # Compilation
+ if [ ! -z "${CS_LIB_ADD}" ] ; then
+ OPTLIBS="--opt-libs=${CS_LIB_ADD}"
+ fi
+ ${bindir}/cs compile \
+ --source=$src_dir ${OPTLIBS} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ echo "COMPILE OR LINK ERROR"
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ fi
+
+ else
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ ln -s ${bindir}/$EXE .
+
+ fi
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+
+ ${pkgdatadir}/runcase_syrthes -compile \
+ -cs-bindir=${bindir} -src-syr=${SRC_SYR} \
+ -src-copy=${RESU}/SRC_SYR.${SUFFIX} -log=${RESU}/compil_syrthes.log.${SUFFIX}
+
+ fi
+
+fi # EXEC_KERNEL = yes
+
+#
+########################################################################
+#
+# Data setup
+#
+echo
+echo " ********************************************"
+echo " Preparing calculation "
+echo " ********************************************"
+echo
+#
+ERROR=false
+PREPROCESS_ERROR=false
+PARTITION_ERROR=false
+EXECUTION_ERROR=false
+#
+if [ $SOLCOM = 1 ]
+then
+ EXEC_PREPROCESS=no
+ EXEC_PARTITION=no
+ ln -s $MESHDIR/$MESH geomet || exit 1
+fi
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ]
+then
+ for var in $MESH ; do
+ ln -s $MESHDIR/$var $var || exit 1
+ # Special case for meshes in EnSight format: link to .geo file necessary
+ # (retrieve name through .case file)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $MESHDIR/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+else
+ if [ -f ${PREPROCESSOR_OUTPUT_IN} ] ; then
+ ln -s ${PREPROCESSOR_OUTPUT_IN} preprocessor_output || exit 1
+ else
+ echo "Error: no preprocessor output file is available;"
+ echo " (${PREPROCESSOR_OUTPUT_IN} does not exist."
+ echo " or is not a standard file."
+ exit 1
+ fi
+fi
+#
+if [ $nproc_kernel -eq 1 -a "${EXEC_KERNEL}" = "yes" ] ; then
+ EXEC_PARTITION=no
+elif [ "${EXEC_PARTITION}" = "no" -a "${PARTITION_OUTPUT_IN}" != "" ]
+then
+ if [ -f ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} ] ; then
+ ln -s ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} .
+ else
+ echo "Warning: no partitioning file is available;"
+ echo " (no ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel})."
+ echo
+ echo " Unoptimized partitioning will be used."
+ echo " Parallel performance may be degraded."
+ fi
+fi
+#
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ for var in ${RESTART_IN}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "$THERMOCHEMISTRY_DATA" != "" ] ; then
+ var=$DATA/$THERMOCHEMISTRY_DATA
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # Copy so as to have correct name upon backup
+ if [ "$THERMOCHEMISTRY_DATA" != "dp_tch" ] ; then
+ cp dp_tch $THERMOCHEMISTRY_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The thermochemistry file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ if [ "$METEO_DATA" != "" ] ; then
+ var=$DATA/$METEO_DATA
+ if [ -f $var ] ; then
+ cp $var meteo
+ # Copy so as to have correct name upon backup
+ if [ "$METEO_DATA" != "meteo" ] ; then
+ cp meteo $METEO_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The meteo profile file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ for f in uscpcl.f90 usd3pc.f90 usebuc.f90 uslwcc.f90 usfucl.f90
+ do
+ if [ -f "${SRC}/${f}" -a ! -f JANAF ] ; then
+ cp ${datadir}/data/thch/JANAF JANAF
+ fi
+ done
+ #
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ #
+ ${pkgdatadir}/runcase_syrthes -copy-data -syrthes-env=${DATA_SYR}/$SYRTHES_ENV
+ #
+ fi
+ #
+ if [ ! -z "$USER_INPUT_FILES" ] ; then
+ for f in $USER_INPUT_FILES ; do
+ cp $DATA/$f .
+ done
+ fi
+ #
+fi # EXEC_KERNEL = yes
+
+########################################################################
+# Maximum time for PBS (done here so as to leave time for PBS to
+# realize that things have started).
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Summary: start
+#
+CURDATE=`unset LANG ; date`
+#
+echo '========================================================'>>$summary
+echo ' Start time : ' $CURDATE >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Kernel : ' $prefix >>$summary
+echo ' Preprocessor : ' $ecs_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' HOMARD : ' $homard_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' CS_MPI_PATH : ' $CS_MPI_PATH >>$summary
+echo ' PATH : ' $PATH >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' User : ' $USER >>$summary
+echo '========================================================'>>$summary
+echo ' Machine : ' >>$summary
+ uname -a >>$summary
+if [ -z "$NUMBER_OF_PROCESSORS" ] ; then
+ echo ' N Procs : ' 1 >>$summary
+else
+ echo ' N Procs : ' $NUMBER_OF_PROCESSORS >>$summary
+fi
+if [ -z "$PROCESSOR_LIST" ] ; then
+ echo ' Processors : ' default >>$summary
+else
+ echo ' Processors : ' $PROCESSOR_LIST >>$summary
+fi
+echo '========================================================'>>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Case : ' $CASE >>$summary
+echo ' DATA : ' $DATA >>$summary
+echo ' SRC : ' $SRC >>$summary
+echo ' RESU : ' $RESU >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Exec. dir. : ' $RUN >>$summary
+echo ' ----------------------------------------------------' >>$summary
+if [ "$EXEC_PREPROCESSOR" = "yes" ] ; then
+ echo ' Preprocessor : ' ${ecs_bindir}/cs_preprocess >>$summary
+fi
+if [ "$EXEC_PARTITION" = "yes" ] ; then
+ echo ' Partitioner : ' ${ecs_bindir}/cs_partition >>$summary
+fi
+if [ "$EXEC_KERNEL" = "yes" ] ; then
+ echo ' Executable : ' $EXE >>$summary
+fi
+echo ' ----------------------------------------------------' >>$summary
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Starting calculation"
+echo " ********************************************"
+echo
+#
+# Preprocessor start
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ] ; then
+ #
+ ${ecs_bindir}/cs_preprocess --mesh $MESH "--case" $CASE \
+ $COMMAND_REORIENT $COMMAND_JOIN $COMMAND_PERIO \
+ > listpre 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error running the preprocessor."
+ echo "Check preprocessor log (listpre) for details."
+ echo
+ PREPROCESS_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PREPROCESSOR_OUTPUT_OUT=$RESU/preprocessor_output.$SUFFIX
+ cp preprocessor_output ${PREPROCESSOR_OUTPUT_OUT}
+ fi
+ #
+fi
+#
+# Partitioner start
+#
+if [ ! -f ${ecs_bindir}/cs_partition ] ; then
+ echo "Warning: ${ecs_bindir}/cs_partition not found."
+ echo
+ echo "The partitioner may not have been installed"
+ echo " (this is the case if neither METIS nor."
+ echo " SCOTCH are avaialable)."
+ echo
+ echo "Unoptimized partitioning will be used, so"
+ echo "parallel performance may be degraded."
+ echo
+ EXEC_PARTITION=no
+fi
+#
+if [ "${EXEC_PARTITION}" = "yes" ] ; then
+ #
+ if [ "${EXEC_KERNEL}" = "yes" ] ; then
+ ${ecs_bindir}/cs_partition $nproc_kernel > listpart 2>&1
+ else
+ if [ -z "$PARTITION_LIST" ] ; then
+ echo "Error running the partitioner."
+ echo "PARTITION_LIST is not set."
+ echo "This variable should contain the number of processors"
+ echo "for which we partition (or a list of such numbers)."
+ PARTITION_ERROR=true
+ ERROR=true
+ else
+ ${ecs_bindir}/cs_partition $PARTITION_LIST > listpart 2>&1
+ fi
+ fi
+ if [ $? != 0 -a $PARTITION_ERROR = false ] ; then
+ echo "Error running the partitioner."
+ echo "Check partitioner log (listpart) for details."
+ echo
+ PARTITION_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PARTITION_OUTPUT_OUT=$RESU/PARTITION_OUTPUT.$SUFFIX
+ mkdir $PARTITION_OUTPUT_OUT
+ cp -r domain_number_* ${PARTITION_OUTPUT_OUT}/
+ fi
+#
+fi
+#
+# Run calculation proper.
+#
+if [ "$ERROR" != "true" -a "$EXEC_KERNEL" = "yes" ] ; then
+#
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ # MPI Communication
+ #
+ # Make sure to transmit possible additional arguments assigned by mpirun to
+ # the executable with some MPI-1 implementations (vanilla MPICH 1.2 sets the
+ # parameters needed by MPI_Init through argc/argv): we use $@ to forward
+ # arguments passed to localexec to the true executable files.
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`${pkgdatadir}/runcase_mpi_rank \$@\`" >> $localexec
+ echo cd $RUN >> $localexec
+ echo "if [ \$MPI_RANK -eq 0 ] ; then" >> $localexec
+ echo " $RUN/$EXE_SYR \$@ -app-num 0 -comm-mpi 1 $ECHOCOMMSYR > listsyr 2>&1" >> $localexec
+ echo "else" >> $localexec
+ echo " $VALGRIND $RUN/$EXE \$@ --mpi 1 $COMMAND_CWF "\
+ "$ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM " >> $localexec
+ echo "fi" >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ #
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ elif [ $SYRTHES_COUPLING = yes ] ; then
+ # Socket communications
+ #
+ # We provide the executables with a "random" port number.
+ PORT=35623
+ SOCKETNCS="--syr-socket $PORT"
+ SOCKETSYR="-comm-socket $PORT"
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI $COMMAND_CWF "\
+ " $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM $SOCKETNCS " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true &
+ #
+ ./$EXE_SYR $ECHOCOMMSYR $SOCKETSYR > listsyr 2>&1
+ #
+ $MPIHALT
+ #
+ elif [ $SOLCOM = 0 ] ; then
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI "\
+ " $COMMAND_CWF $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ else # cas SOLCOM = 1
+ #
+ $VALGRIND $RUN/$EXE --solcom \
+ $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM \
+ || EXECUTION_ERROR=true
+ #
+ fi
+#
+fi
+#
+# Remove the Salome temporary files
+rm -f $SCRIPTS/running*.$DATE
+#
+########################################################################
+#
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ echo "Error running the coupled calculation."
+ echo "Either the Kernel or SYRTHES may have failed."
+ echo
+ echo "Check Kernel log (listing) and SYRTHES log (listsyr) for details,"
+ echo "as well as eventual error* files."
+ echo
+ else
+ echo "Error running the calculation."
+ echo
+ echo "Check Kernel log (listing) and error* files for details"
+ echo
+ fi
+ ERROR=true
+fi
+#
+# Treatment of the ouput files:
+# Starts with the restart files
+# (in case of full disk, increases chances of being able to continue).
+#
+if [ $EXEC_KERNEL = yes ] ; then
+
+ RESTART_OUT=$RESU/RESTART.$SUFFIX
+ iok=1
+ mkdir ${RESTART_OUT} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f ${RESTART_OUT}
+ fi
+ done
+ else
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+
+ resuser=0
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIX
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f ${RES_USER}
+ fi
+ done
+ else
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+ fi
+
+ for f in $PARAM $THERMOCHEMISTRY_DATA $METEO_DATA ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+
+ for f in probes_*.dat ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+ for f in ush* ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+
+fi # output files
+
+for f in list* error* *.med *.cgns ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+done
+
+# Treatment of EnSight and MED files
+# The $dir (=*.ensight and/or *.med) directories are copied
+# to $DIR.$SUFFIX
+
+# We place directories $dir (=*.ensight and/or *.med)
+# in $DIR.$SUFFIX
+
+cas=`echo $CASE |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Creating $RESU/$DIR.$SUFFIX failed
+ else
+ for f in $dir/* ; do
+ if [ -f $f ] ; then
+ cp -R ${f} $RESU/$DIR.$SUFFIX/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ rayt_list=`ls bord* 2>/dev/null`
+ if [ ! -z "${rayt_list}" ] ; then
+ for f in $rayt_list ; do
+ if [ ! -d $RESU/CHR.$SUFFIX ] ; then
+ mkdir $RESU/CHR.$SUFFIX
+ fi
+ cp $f $RESU/CHR.$SUFFIX/.
+ done
+ fi
+
+ lagr_list=`ls debug* deplacement* trajectoire* frontiere* 2>/dev/null`
+ if [ ! -z "${lagr_list}" ] ; then
+ mkdir $RESU/LAGR.$SUFFIX
+ for f in $lagr_list ; do
+ cp $f $RESU/LAGR.$SUFFIX
+ done
+ fi
+
+ # Matisse output files
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # The date is added to the first line of resuMatisse
+ AFDATE="Date of the case : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIX
+ fi
+
+ for dir in src_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/SRC.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Failure creating $RESU/SRC.$SUFFIX
+ else
+ for f in $dir/*.[fF]90 $dir/*.[ch] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} $RESU/SRC.$SUFFIX/.
+ fbase=`basename ${f}`
+ chmod a-w $RESU/SRC.$SUFFIX/${fbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ ${pkgdatadir}/runcase_syrthes -copy-results \
+ -result-dir=${RESU}/RESU_SYR.${SUFFIX}
+ fi
+
+fi # input data and outputs
+#
+########################################################################
+#
+# Summary: end
+#
+if [ "$PREPROCESS_ERROR" = "true" ] ; then
+ EXEC_PREPROCESS="failed"
+fi
+echo " Preprocessing : " $EXEC_PREPROCESS >>$summary
+if [ "$PARTITION_ERROR" = "true" ] ; then
+ EXEC_PARTITION="failed"
+fi
+echo " Partitioning : " $EXEC_PARTITION >>$summary
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ EXEC_KERNEL="failed"
+fi
+echo " Calculation : " $EXEC_KERNEL >>$summary
+#
+CURDATE=`unset LANG ; date`
+#
+echo ' ----------------------------------------------------' >>$summary
+echo ' Finish time : ' $CURDATE >>$summary
+echo '========================================================'>>$summary
+#
+cp $summary $RESU/$summary.$SUFFIX
+#
+########################################################################
+#
+#
+# Finish
+#
+echo
+echo " ********************************************"
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ echo " Error in calculation stage."
+elif [ "$PARTITION_ERROR" = "true" ] ; then
+ echo " Error in partitioning stage."
+elif [ "$PREPROCESS_ERROR" = "true" ] ; then
+ echo " Error in preprocessing stage."
+else
+ echo " Normal simulation finish"
+fi
+echo " ********************************************"
+
+if [ "$ERROR" = "true" ] ; then
+ exit 1
+else
+ exit 0
+fi
+#
+########################################################################
diff --git a/examples/2-full_domain/case3/usclim.f90 b/examples/2-full_domain/case3/usclim.f90
new file mode 100644
index 0000000..aefadd2
--- /dev/null
+++ b/examples/2-full_domain/case3/usclim.f90
@@ -0,0 +1,578 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta2
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usclim &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine.
+
+! Fill boundary conditions arrays (icodcl, rcodcl)
+! for unknown variables.
+
+
+! Introduction
+! ============
+
+! Here we define boundary conditions on a per-face basis.
+
+! Boundary faces may be identified using the 'getfbr' subroutine.
+
+! getfbr(string, nelts, eltlst) :
+! - string is a user-supplied character string containing
+! selection criteria;
+! - nelts is set by the subroutine. It is an integer value
+! corresponding to the number of boundary faces verifying the
+! selection criteria;
+! - lstelt is set by the subroutine. It is an integer array of
+! size nelts containing the list of boundary faces verifying
+! the selection criteria.
+
+! string may contain:
+! - references to colors (ex.: 1, 8, 26, ...
+! - references to groups (ex.: inlet, group1, ...)
+! - geometric criteria (ex. x < 0.1, y >= 0.25, ...)
+! These criteria may be combined using logical operators
+! ('and', 'or') and parentheses.
+! Example: '1 and (group2 or group3) and y < 1' will select boundary
+! faces of color 1, belonging to groups 'group2' or 'group3' and
+! with face center coordinate y less than 1.
+
+
+
+! Boundary condition types
+! ========================
+
+! Boundary conditions may be assigned in two ways.
+
+
+! For "standard" boundary conditions:
+! -----------------------------------
+
+! (inlet, free outlet, wall, symmetry), we define a code
+! in the 'itypfb' array (of dimensions number of boundary faces,
+! number of phases). This code will then be used by a non-user
+! subroutine to assign the following conditions (scalars in
+! particular will receive the conditions of the phase to which
+! they are assigned). Thus:
+
+! Code | Boundary type
+! --------------------------
+! ientre | Inlet
+! isolib | Free outlet
+! isymet | Symmetry
+! iparoi | Wall (smooth)
+! iparug | Rough wall
+
+! Integers ientre, isolib, isymet, iparoi, iparug
+! are defined elsewhere (param.h). Their value is greater than
+! or equal to 1 and less than or equal to ntypmx
+! (value fixed in paramx.h)
+
+
+! In addition, some values must be defined:
+
+
+! - Inlet (more precisely, inlet/outlet with prescribed flow, as
+! the flow may be prescribed as an outflow):
+
+! -> Dirichlet conditions on variables
+! other than pressure are mandatory if the flow is incoming,
+! optional if the flow is outgoing (the code assigns 0 flux
+! if no Dirichlet is specified); thus,
+! at face 'ifac', for the variable 'ivar': rcodcl(ifac, ivar, 1)
+
+
+! - Smooth wall: (= impermeable solid, with smooth friction)
+
+! -> Velocity value for sliding wall if applicable
+! at face ifac, rcodcl(ifac, iu, 1)
+! rcodcl(ifac, iv, 1)
+! rcodcl(ifac, iw, 1)
+! -> Specific code and prescribed temperature value
+! at wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 5
+! rcodcl(ifac, ivar, 1) = prescribed temperature
+! -> Specific code and prescribed flux value
+! at wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 3
+! rcodcl(ifac, ivar, 3) = prescribed flux
+! =
+! Note that the default condition for scalars
+! (other than k and epsilon) is homogeneous Neumann.
+
+
+! - Rough wall: (= impermeable solid, with rough friction)
+
+! -> Velocity value for sliding wall if applicable
+! at face ifac, rcodcl(ifac, iu, 1)
+! rcodcl(ifac, iv, 1)
+! rcodcl(ifac, iw, 1)
+! -> Value of the dynamic roughness height to specify in
+! rcodcl(ifac, iu, 3) (value for iv et iw not used)
+! -> Specific code and prescribed temperature value
+! at rough wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 6
+! rcodcl(ifac, ivar, 1) = prescribed temperature
+! rcodcl(ifac, ivar, 3) = dynamic roughness height
+! -> Specific code and prescribed flux value
+! at rough wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 3
+! rcodcl(ifac, ivar, 3) = prescribed flux
+! =
+! Note that the default condition for scalars
+! (other than k and epsilon) is homogeneous Neumann.
+
+! - Symmetry (= impermeable frictionless wall):
+
+! -> Nothing to specify
+
+
+! - Free outlet (more precisely free inlet/outlet with prescribed pressure)
+
+! -> Nothing to prescribe for pressure and velocity
+! For scalars and turbulent values, a Dirichlet value may optionally
+! be specified. The behavior is as follows:
+! * pressure is always handled as a Dirichlet condition
+! * if the mass flow is inflowing:
+! we retain the velocity at infinity
+! Dirichlet condition for scalars and turbulent values
+! (or zero flux if the user has not specified a
+! Dirichlet value)
+! if the mass flow is outflowing:
+! we prescribe zero flux on the velocity, the scalars,
+! and turbulent values
+
+! Note that the pressure will be reset to P0
+! on the first free outlet face found
+
+
+! For "non-standard" conditions:
+! ------------------------------
+
+! Other than (inlet, free outlet, wall, symmetry), we define
+! - on one hand, for each face:
+! -> an admissible 'itypfb' value
+! (i.e. greater than or equal to 1 and less than or equal to
+! ntypmx; see its value in paramx.h).
+! The values predefined in paramx.h:
+! 'ientre', 'isolib', 'isymet', 'iparoi', 'iparug' are in
+! this range, and it is preferable not to assign one of these
+! integers to 'itypfb' randomly or in an inconsiderate manner.
+! To avoid this, we may use 'iindef' if we wish to avoid
+! checking values in paramx.h. 'iindef' is an admissible
+! value to which no predefined boundary condition is attached.
+! Note that the 'itypfb' array is reinitialized at each time
+! step to the non-admissible value of 0. If we forget to
+! modify 'typfb' for a given face, the code will stop.
+
+! - and on the other hand, for each face and each variable:
+! -> a code icodcl(ifac, ivar)
+! -> three real values rcodcl(ifac, ivar, 1)
+! rcodcl(ifac, ivar, 2)
+! rcodcl(ifac, ivar, 3)
+! The value of 'icodcl' is taken from the following:
+! 1: Dirichlet (usable for any variable)
+! 3: Neumann (usable for any variable)
+! 4: Symmetry (usable only for the velocity and
+! components of the Rij tensor)
+! 5: Smooth wall (usable for any variable except for pressure)
+! 6: Rough wall (usable for any variable except for pressure)
+! 9: Free outlet (usable only for velocity)
+! The values of the 3 'rcodcl' components are
+! rcodcl(ifac, ivar, 1):
+! Dirichlet for the variable if icodcl(ifac, ivar) = 1
+! wall value (sliding velocity, temp) if icodcl(ifac, ivar) = 5
+! The dimension of rcodcl(ifac, ivar, 1) is that of the
+! resolved variable: ex U (velocity in m/s),
+! T (temperature in degrees)
+! H (enthalpy in J/kg)
+! F (passive scalar in -)
+! rcodcl(ifac, ivar, 2):
+! "exterior" exchange coefficient (between the prescribed value
+! and the value at the domain boundary)
+! rinfin = infinite by default
+! For velocities U, in kg/(m2 s):
+! rcodcl(ifac, ivar, 2) = (viscl+visct) / d
+! For the pressure P, in s/m:
+! rcodcl(ifac, ivar, 2) = dt / d
+! For temperatures T, in Watt/(m2 degres):
+! rcodcl(ifac, ivar, 2) = Cp*(viscls+visct/sigmas) / d
+! For enthalpies H, in kg /(m2 s):
+! rcodcl(ifac, ivar, 2) = (viscls+visct/sigmas) / d
+! For other scalars F in:
+! rcodcl(ifac, ivar, 2) = (viscls+visct/sigmas) / d
+! (d has the dimension of a distance in m)
+!
+! rcodcl(ifac, ivar, 3) if icodcl(ifac, ivar) <> 6:
+! Flux density (< 0 if gain, n outwards-facing normal)
+! if icodcl(ifac, ivar)= 3
+! For velocities U, in kg/(m s2) = J:
+! rcodcl(ifac, ivar, 3) = -(viscl+visct) * (grad U).n
+! For pressure P, en kg/(m2 s):
+! rcodcl(ifac, ivar, 3) = -dt * (grad P).n
+! For temperatures T, in Watt/m2:
+! rcodcl(ifac, ivar, 3) = -Cp*(viscls+visct/sigmas) * (grad T).n
+! For enthalpies H, in Watt/m2:
+! rcodcl(ifac, ivar, 3) = -(viscls+visct/sigmas) * (grad H).n
+! For other scalars F in :
+! rcodcl(ifac, ivar, 3) = -(viscls+visct/sigmas) * (grad F).n
+
+! rcodcl(ifac, ivar, 3) if icodcl(ifac, ivar) = 6:
+! Roughness for the rough wall law
+! For velocities U, dynamic roughness
+! rcodcl(ifac, ivar, 3) = rugd
+! For other scalars, thermal roughness
+! rcodcl(ifac, ivar, 3) = rugt
+
+
+! Note that if the user assigns a value to itypfb equal to
+! ientre, isolib, isymet, iparoi, or iparug
+! and does not modify icodcl (zero value by default),
+! itypfb will define the boundary condition type.
+
+! To the contrary, if the user prescribes
+! icodcl(ifac, ivar) (nonzero),
+! the values assigned to rcodcl will be used for the considered
+! face and variable (if rcodcl values are not set, the default
+! values will be used for the face and variable, so:
+! rcodcl(ifac, ivar, 1) = 0.d0
+! rcodcl(ifac, ivar, 2) = rinfin
+! rcodcl(ifac, ivar, 3) = 0.d0)
+! Especially, we may have for example:
+! -> set itypfb(ifac, iphas) = iparoi
+! which prescribes default wall conditions for all variables at
+! face ifac,
+! -> and define IN ADDITION for variable ivar on this face
+! specific conditions by specifying
+! icodcl(ifac, ivar) and the 3 rcodcl values.
+
+
+! The user may also assign to itypfb a value not equal to
+! ientre, isolib, isymet, iparoi, iparug, iindef
+! but greater than or equal to 1 and less than or equal to
+! ntypmx (see values in param.h) to distinguish
+! groups or colors in other subroutines which are specific
+! to the case and in which itypfb is accessible.
+! In this case though it will be necessary to
+! prescribe boundary conditions by assigning values to
+! icodcl and to the 3 rcodcl fields (as the value of itypfb
+! will not be predefined in the code).
+
+
+! Consistency rules
+! =================
+
+! A few consistency rules between 'icodcl' codes for
+! variables with non-standard boundary conditions:
+
+! Codes for velocity components must be identical
+! Codes for Rij components must be identical
+! If code (velocity or Rij) = 4
+! we must have code (velocity and Rij) = 4
+! If code (velocity or turbulence) = 5
+! we must have code (velocity and turbulence) = 5
+! If code (velocity or turbulence) = 6
+! we must have code (velocity and turbulence) = 6
+! If scalar code (except pressure or fluctuations) = 5
+! we must have velocity code = 5
+! If scalar code (except pressure or fluctuations) = 6
+! we must have velocity code = 6
+
+
+! Remarks
+! =======
+
+! Caution: to prescribe a flux (nonzero) to Rij,
+! the viscosity to take into account is viscl
+! even if visct exists (visct=rho cmu k2/epsilon)
+
+! We have the ordering array for boundary faces from the
+! previous time step (except for the fist time step,
+! where 'itrifb' has not been set yet).
+! The array of boundary face types 'itypfb' has been
+! reset before entering the subroutine.
+
+
+! Note how to access some variables:
+
+! Cell values
+! Let iel = ifabor(ifac)
+
+! * Density phase iphas, cell iel:
+! propce(iel, ipproc(irom(iphas)))
+! * Dynamic molecular viscosity phase iphas, cell iel:
+! propce(iel, ipproc(iviscl(iphas)))
+! * Turbulent viscosity dynamique phase iphas, cell iel:
+! propce(iel, ipproc(ivisct(iphas)))
+! * Specific heat phase iphas, cell iel:
+! propce(iel, ipproc(icp(iphasl))
+! * Diffusivity: lambda scalaire iscal, cell iel:
+! propce(iel, ipproc(ivisls(iscal)))
+
+! Boundary face values
+
+! * Density phase iphas, boundary face ifac :
+! propfb(ifac, ipprob(irom(iphas)))
+! * Mass flow relative to variable ivar, boundary face ifac:
+! (i.e. the mass flow used for convecting ivar)
+! propfb(ifac, pprob(ifluma(ivar )))
+! * For other values at boundary face ifac:
+! take as an approximation the value in the adjacent cell iel
+! i.e. as above with iel = ifabor(ifac).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! i ! <-- ! number of first free position in ia !
+! idbra0 ! i ! <-- ! number of first free position in ra !
+! ndim ! i ! <-- ! spatial dimension !
+! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
+! ncel ! i ! <-- ! number of cells !
+! nfac ! i ! <-- ! number of interior faces !
+! nfabor ! i ! <-- ! number of boundary faces !
+! nfml ! i ! <-- ! number of families (group classes) !
+! nprfml ! i ! <-- ! number of properties per family (group class) !
+! nnod ! i ! <-- ! number of vertices !
+! lndfac ! i ! <-- ! size of nodfac indexed array !
+! lndfbr ! i ! <-- ! size of nodfbr indexed array !
+! ncelbr ! i ! <-- ! number of cells with faces on boundary !
+! nvar ! i ! <-- ! total number of variables !
+! nscal ! i ! <-- ! total number of scalars !
+! nphas ! i ! <-- ! number of phases !
+! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
+! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
+! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
+! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
+! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
+! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
+! iprfml ! ia ! <-- ! property numbers per family !
+! (nfml, nprfml) ! ! ! !
+! maxelt ! e ! <-- ! max number of cells and faces (int/boundary) !
+! lstelt(maxelt) ! ia ! --- ! work array !
+! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
+! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
+! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
+! nodfac(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
+! icodcl ! ia ! --> ! boundary condition code !
+! (nfabor, nvar) ! ! ! = 1 -> Dirichlet !
+! ! ! ! = 2 -> flux density !
+! ! ! ! = 4 -> sliding wall and u.n=0 (velocity) !
+! ! ! ! = 5 -> friction and u.n=0 (velocity) !
+! ! ! ! = 6 -> roughness and u.n=0 (velocity) !
+! ! ! ! = 9 -> free inlet/outlet (velocity) !
+! ! ! ! inflowing possibly blocked !
+! itrifb(nfabor ! ia ! <-- ! indirection for boundary faces ordering) !
+! (nfabor, nphas) ! ! ! !
+! itypfb ! ia ! --> ! boundary face types !
+! (nfabor, nphas) ! ! ! !
+! idevel(nideve) ! ia ! <-- ! integer work array for temporary developpement !
+! ituser(nituse ! ia ! <-- ! user-reserved integer work array !
+! ia(*) ! ia ! --- ! main integer work array !
+! xyzcen ! ra ! <-- ! cell centers !
+! (ndim, ncelet) ! ! ! !
+! surfac ! ra ! <-- ! interior faces surface vectors !
+! (ndim, nfac) ! ! ! !
+! surfbo ! ra ! <-- ! boundary faces surface vectors !
+! (ndim, nfavor) ! ! ! !
+! cdgfac ! ra ! <-- ! interior faces centers of gravity !
+! (ndim, nfac) ! ! ! !
+! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
+! (ndim, nfabor) ! ! ! !
+! xyznod ! ra ! <-- ! vertex coordinates (optional) !
+! (ndim, nnod) ! ! ! !
+! volume(ncelet) ! ra ! <-- ! cell volumes !
+! dt(ncelet) ! ra ! <-- ! time step (per cell) !
+! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
+! (ncelet, *) ! ! ! (at current and preceding time steps) !
+! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
+! propfa(nfac, *) ! ra ! <-- ! physical properties at interior face centers !
+! propfb(nfabor, *)! ra ! <-- ! physical properties at boundary face centers !
+! coefa, coefb ! ra ! <-- ! boundary conditions !
+! (nfabor, *) ! ! ! !
+! rcodcl ! ra ! --> ! boundary condition values !
+! ! ! ! rcodcl(1) = Dirichlet value !
+! ! ! ! rcodcl(2) = exterior exchange coefficient !
+! ! ! ! (infinite if no exchange) !
+! ! ! ! rcodcl(3) = flux density value !
+! ! ! ! (negative for gain) in w/m2 or !
+! ! ! ! roughness height (m) if icodcl=6 !
+! ! ! ! for velocities ( vistl+visct)*gradu !
+! ! ! ! for pressure dt*gradp !
+! ! ! ! for scalars cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! ra ! --- ! work arrays !
+! (ncelet) ! ! ! (computation of pressure gradient) !
+! coefu ! ra ! --- ! tab de trav !
+! (nfabor, 3) ! ! ! (computation of pressure gradient) !
+! rdevel(nrdeve) ! ra ! <-> ! tab reel complementaire developemt !
+! rdevel(nideve) ! ra ! <-- ! real work array for temporary developpement !
+! rtuser(nituse ! ra ! <-- ! user-reserved real work array !
+! ra(*) ! ra ! --- ! main real work array !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! Local variables
+
+integer idebia, idebra
+integer ifac, ielt, ii, ivar, iphas
+integer ilelt, nlelt
+double precision uref2, d2s3
+double precision rhomoy, dh, ustar2
+double precision xintur
+double precision xkent, xeent
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. Initialization
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. Assign boundary conditions to boundary faces here
+
+! We may use selection criteria to filter boundary case subsets
+! Loop on faces from a subset
+! Set the boundary condition for each face
+!===============================================================================
+
+! --- Most types and values have been set using the GUI.
+
+! --- Set inlet values
+
+! Inlet type has already been assigned to boundary faces of color 1
+! through the GUI with a default velocity, but a time-varying value
+! is prescribed here and overrides the one given through the GUI.
+
+call getfbr('1', nlelt, lstelt)
+!==========
+
+if (ttcabs .lt. 3.8d0) then
+ do ielt = 1, nlelt
+ ifac = lstelt(ielt)
+ rcodcl(ifac,isca(1),1) = 20.d0+100.d0*ttcabs
+ enddo
+else
+ do ielt = 1, nlelt
+ ifac = lstelt(ielt)
+ rcodcl(ifac,isca(1),1) = 400.d0
+ enddo
+endif
+
+!----
+! Formats
+!----
+
+!----
+! End
+!----
+
+return
+end subroutine
diff --git a/examples/2-full_domain/case3/usphyv.f90 b/examples/2-full_domain/case3/usphyv.f90
new file mode 100644
index 0000000..c0ee651
--- /dev/null
+++ b/examples/2-full_domain/case3/usphyv.f90
@@ -0,0 +1,313 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta2
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : REMPLISSAGE DES VARIABLES PHYSIQUES
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivart, iclvar, iel, iphas
+integer ipcrom, ipbrom, ipcvis, ipccp
+integer ipcvsl, ith, iscal, ii
+integer iutile
+double precision vara, varb, varc, varam, varbm, varcm, vardm
+double precision varal, varbl, varcl, vardl
+double precision varac, varbc
+double precision xrtp
+
+!===============================================================================
+
+!===============================================================================
+! 0. Initializations
+!===============================================================================
+
+! --- Memory initialization
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+
+! Variable density, as a function of temperature
+! ================
+
+! We use the same density law for all phases.
+! Values of this property are assigned to cell centers.
+! (and optionally to boundary faces).
+
+!===============================================================================
+
+do iphas = 1, nphas ! Loop on phases
+
+ ! The position of the density of phase iphas in propce
+ ! (physical properties at element centers) given by ipcrom.
+
+ ipcrom = ipproc(irom(iphas))
+
+ ! Coefficients chosen and prescribed by the user.
+
+ vara = -4.0668d-3
+ varb = -5.0754d-2
+ varc = 1000.9d0
+
+ ! Density at cell centers
+ ! -----------------------
+ ! Law: rho = t * ( a * t + b ) + c
+ ! Code: propce(iel, ipcrom) = xrtp * (vara*xrtp+varb) + varc
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,isca(1))
+ propce(iel,ipcrom) = xrtp * (vara*xrtp+varb) + varc
+ enddo
+
+enddo ! End of loop on phases
+
+!===============================================================================
+
+!----
+! Formats
+!----
+
+!----
+! Fin
+!----
+
+return
+end
diff --git a/examples/2-full_domain/case4/case4.xml b/examples/2-full_domain/case4/case4.xml
new file mode 100644
index 0000000..21dee12
--- /dev/null
+++ b/examples/2-full_domain/case4/case4.xml
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="utf-8"?><Code_Saturne_GUI case="CASE3" study="FULL_DOMAIN" version="1.0">
+ <solution_domain>
+ <volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" scalar_source_term="off" thermal_source_term="off">all[]</zone>
+ </volumic_conditions>
+ <meshes_list>
+ <mesh format="des" name="downcomer.des"/>
+ <mesh format="des" name="fdc.des"/>
+ <mesh format="des" name="pic.des"/>
+ </meshes_list>
+ <join_meshes status="on">
+ <faces_join name="1" status="on">
+ <faces_color>5 24 32</faces_color>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ </faces_join>
+ </join_meshes>
+ <faces_cutting status="off"/>
+ <reorientation status="off"/>
+ <syrthes_coupling status="off"/>
+ <periodic_boundary/>
+ <standalone/>
+ </solution_domain>
+ <thermophysical_models>
+ <velocity_pressure>
+ <variable label="Pression" name="pressure">
+ <reference_pressure>101325</reference_pressure>
+ <listing_printing status="off"/>
+ </variable>
+ <variable label="VitesseX" name="velocity_U">
+ <blending_factor>1</blending_factor>
+ <probes choice="5">
+ <probe_recording name="1"/>
+ <probe_recording name="2"/>
+ <probe_recording name="6"/>
+ <probe_recording name="7"/>
+ <probe_recording name="8"/>
+ </probes>
+ </variable>
+ <variable label="VitesseY" name="velocity_V">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseZ" name="velocity_W">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>
+ <ale_method status="off"/>
+ <turbulence model="k-epsilon">
+ <variable label="EnerTurb" name="turb_k">
+ <listing_printing status="off"/>
+ </variable>
+ <variable label="Dissip" name="turb_eps">
+ <listing_printing status="off"/>
+ </variable>
+ <property label="visc. tu" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ </turbulence>
+ <thermal_scalar model="temperature_celsius">
+ <property label="Flux_thermique_entrant" name="input_thermal_flux" support="boundary"/>
+ </thermal_scalar>
+ <radiative_transfer model="off">
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ </radiative_transfer>
+ <gas_combustion model="off"/>
+ <pulverized_coal model="off"/>
+ <joule_effect model="off"/>
+ <atmospheric_flows model="off">
+ <read_meteo_data status="off"/>
+ </atmospheric_flows>
+ </thermophysical_models>
+ <numerical_parameters>
+ <multigrid status="on"/>
+ <gradient_transposed status="on"/>
+ <velocity_pressure_coupling status="off"/>
+ <pressure_relaxation>1</pressure_relaxation>
+ <wall_pressure_extrapolation>0</wall_pressure_extrapolation>
+ <gradient_reconstruction choice="0"/>
+ </numerical_parameters>
+ <physical_properties>
+ <fluid_properties>
+ <property choice="variable" label="Masse vo" name="density">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>725.735</initial_value>
+ </property>
+ <property choice="constant" label="Visc. la" name="molecular_viscosity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>8.95e-05</initial_value>
+ </property>
+ <property choice="constant" label="Ch.spec." name="specific_heat">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>5483</initial_value>
+ </property>
+ <property choice="constant" label="Cond. th" name="thermal_conductivity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>0.02495</initial_value>
+ </property>
+ </fluid_properties>
+ <gravity>
+ <gravity_x>0</gravity_x>
+ <gravity_y>-9.81</gravity_y>
+ <gravity_z>0</gravity_z>
+ </gravity>
+ <hydrostatic_pressure status="off"/>
+ </physical_properties>
+ <additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>400</max_value>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ <scalar label="scalar_2" name="scalar2" type="user">
+ <initial_value zone="1">10.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>400</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_2">
+ <initial_value>8.95e-05</initial_value>
+ </property>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ </additional_scalars>
+ <boundary_conditions>
+ <boundary label="inlet" name="1" nature="inlet">1</boundary>
+ <boundary label="outlet" name="2" nature="outlet">34</boundary>
+ <boundary label="symmetry" name="3" nature="symmetry">8 or 9 or 28 or 29 or 38 or 39</boundary>
+ <boundary label="Wall_1" name="4" nature="wall">24 and 0.1<=X and 0.5>=X</boundary>
+ <boundary label="Wall_2" name="5" nature="wall">2 or 3</boundary>
+ <boundary label="Wall_3" name="6" nature="wall">4 or 7 or 21 or 22 or 23</boundary>
+ <boundary label="Wall_4" name="7" nature="wall">6 and Y>1</boundary>
+ <boundary label="Wall_5" name="8" nature="wall">6 and Y<=1</boundary>
+ <boundary label="Wall_6" name="9" nature="wall">31 or 33</boundary>
+ <inlet label="inlet">
+ <velocity_pressure choice="norm" direction="coordinates">
+ <norm>1</norm>
+ <direction_x>1</direction_x>
+ <direction_y>0</direction_y>
+ <direction_z>0</direction_z>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>0.5</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="Temp.C" name="temperature_celsius" type="thermal">
+ <dirichlet>300</dirichlet>
+ </scalar>
+ <scalar choice="dirichlet" label="scalar_2" name="scalar2" type="user">
+ <dirichlet>200</dirichlet>
+ </scalar>
+ </inlet>
+ <outlet label="outlet">
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </outlet>
+ <symmetry label="symmetry"/>
+ <wall label="Wall_1">
+ <velocity_pressure choice="off">
+ <dirichlet name="velocity_U">0</dirichlet>
+ <dirichlet name="velocity_V">0</dirichlet>
+ <dirichlet name="velocity_W">0</dirichlet>
+ </velocity_pressure>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_3">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_2">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>5</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_4">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>25</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_5">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>320</neumann>
+ </scalar>
+ </wall>
+ <wall label="Wall_6">
+ <velocity_pressure choice="off"/>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ <scalar choice="neumann" label="scalar_2" name="scalar2" type="user">
+ <neumann>40</neumann>
+ </scalar>
+ </wall>
+ <variable/>
+ </boundary_conditions>
+ <analysis_control>
+ <output>
+ <postprocessing_mesh_options choice="0"/>
+ <postprocessing_format choice="EnSight"/>
+ <postprocessing_options choice="binary"/>
+ <domain_boundary status="on"/>
+ <listing_printing_frequency>1</listing_printing_frequency>
+ <postprocessing_frequency>2</postprocessing_frequency>
+ <probe_recording_frequency>1</probe_recording_frequency>
+ <fluid_domain status="on"/>
+ <probe name="1" status="on">
+ <probe_x>-0.25</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="2" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="3" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>2.75</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="4" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>0.5</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="5" status="on">
+ <probe_x>0.05</probe_x>
+ <probe_y>-0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="6" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>-0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="7" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>0.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="8" status="on">
+ <probe_x>0.75</probe_x>
+ <probe_y>0.75</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ <probe name="9" status="on">
+ <probe_x>-0.5</probe_x>
+ <probe_y>2.25</probe_y>
+ <probe_z>0</probe_z>
+ </probe>
+ </output>
+ <time_parameters>
+ <property label="Nb Courant" name="courant_number">
+ <postprocessing_recording status="off"/>
+ </property>
+ <property label="Nb Fourier" name="fourier_number">
+ <postprocessing_recording status="off"/>
+ </property>
+ <time_step_ref>0.05</time_step_ref>
+ <iterations>700</iterations>
+ <time_passing>0</time_passing>
+ <zero_time_step status="off"/>
+ </time_parameters>
+ <steady_management status="off"/>
+ <time_averages/>
+ <profiles/>
+ </analysis_control>
+ <calcul_management>
+ <integer_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </integer_user_array>
+ <real_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </real_user_array>
+ <start_restart>
+ <restart status="off"/>
+ <frozen_field status="off"/>
+ <restart_rescue>0</restart_rescue>
+ <restart_with_auxiliary status="on"/>
+ </start_restart>
+ </calcul_management>
+ <lagrangian model="off"/>
+</Code_Saturne_GUI>
diff --git a/examples/2-full_domain/case4/runcase b/examples/2-full_domain/case4/runcase
new file mode 100755
index 0000000..394ff8e
--- /dev/null
+++ b/examples/2-full_domain/case4/runcase
@@ -0,0 +1,1125 @@
+#!/bin/sh
+# bin/runcase. Generated from runcase.in by configure.
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# BATCH FILE FOR THE CCRT (Platine under LSF)
+# ===========================================
+#
+#BSUB -n 2
+#BSUB -W 00:30
+#BSUB -o full_domaincaseo.%J
+#BSUB -e full_domaincasee.%J
+#BSUB -J full_domaincase
+#
+# -n : number of processors
+# -W : walltime as hh:mm
+# -o : output file name
+# -e : error file name
+# -J : job name
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE FOR THE Chatou CLUSTER (PBS)
+# =======================================
+#
+#PBS -l nodes=4:ppn=2
+#PBS -l walltime=1:00:00
+#PBS -l mem=320mb
+#
+#PBS -j eo
+#PBS -N full_domaincase4
+#
+# nodes : number of nodes
+# ppn : number of process per node
+# walltime : wall clock time (hh:mm:ss)
+# mem : memory
+#
+#WARNING: when coupling with SYRTHES, 1 processor will be reserved for each
+# instance of SYRTHES. The Kernel will be executed on the remaining
+# processors, so make sure to reserve a sufficiently high number
+# of processors.
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (University of Manchester Cluster)
+# =============================================
+#
+# set the name of the job
+##$ -N full_domaincase4
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (AIX, Loadlever)
+# ===========================
+#
+#@ shell = /bin/sh
+#
+#@ job_name = full_domaincase4
+#
+#@ job_type = parallel
+#@ cpus = 128
+#@ node_usage = not_shared
+#
+#@ network.MPI = csss,shared,US
+#@ bulkxfer = yes
+#
+#@ wall_clock_limit = 00:20:00
+#@ account_no = z001
+#
+#@ output = $(job_name).$(schedd_host).$(jobid).out
+#@ error = $(job_name).$(schedd_host).$(jobid).err
+#@ notification = never
+#
+#@ queue
+# suggested environment settings:
+# export MP_EAGER_LIMIT=65536
+# export MP_SHARED_MEMORY=yes
+# export MEMORY_AFFINITY=MCM
+# export MP_TASK_AFFINITY=MCM
+#
+########################################################################
+#
+# BEGINNING OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+# runcase.help gives more details about the different variables.
+#
+# -------------------------------
+#
+SOLCOM=0
+#
+# On some systems, some external libraries may require TERM to be defined.
+export TERM=xterm
+#
+STUDY=FULL_DOMAIN
+CASE=CASE4
+PARAM=case4.xml
+MESH="downcomer.des fdc.des pic.des"
+COMMAND_REORIENT=
+COMMAND_JOIN="--join --color 5 24 32 --fraction 0.1 --plane 0.8"
+COMMAND_CWF=
+COMMAND_PERIO=
+THERMOCHEMISTRY_DATA=
+METEO_DATA=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS=
+PROCESSOR_LIST=
+#
+PARTITION_LIST=
+#
+USER_INPUT_FILES=""
+USER_OUTPUT_FILES=""
+#
+# Working directory (leave empty for automatic default directory)
+CS_TMP_PREFIX=
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+CS_LIB_ADD=
+VALGRIND=
+#
+ARG_CS_VERIF=""
+ARG_CS_OUTPUT=""
+#
+# Adaptation using HOMARD
+ADAPTATION=
+#
+summary=summary
+CASEDIR=/home/saturne/TEST_CASE/FULL_DOMAIN/CASE4
+DATA=$CASEDIR/DATA
+RESU=$CASEDIR/RESU
+SRC=$CASEDIR/SRC
+SCRIPTS=$CASEDIR/SCRIPTS
+RESTART_IN=$DATA/RESTART
+PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+MESHDIR=$CASEDIR/../MESH
+#
+# The following variables are only used in case of coupling with SYRTHES.
+# DATA_SYR: directory where to find SYRTHES_ENV
+# SRC_SYR: directory where to find possible user source files
+DATA_SYR=$CASEDIR/DATA_SYR
+SRC_SYR=$CASEDIR/SRC_SYR
+SYRTHES_ENV=syrthes.env
+#
+# The possible coupling mode with SYRTHES may be chosen here.
+#
+# COUPLING_MODE=MPI : should work on most machines.
+# COUPLING_MODE=sockets : should be activated on clusters when the MPI rank
+# of a process is not determinable or if MPI can
+# not be used.
+COUPLING_MODE=MPI
+ECHO_SYR_COMM=""
+#
+# Indicate which steps should be executed; if both the Preprocessor and the
+# Kernel are executed, the "preprocessor_output" and eventual "domain_number_*"
+# files are not saved. If only the preprocessor and / or partitioner are
+# executed, the corresponding files will be saved in a RESU/PREPROCESSOR_OUTPUT
+# and RESU/PARTITION directory. If the Preprocessor is not executed,
+# "preprocessor_output" will be read from $PREPROCESSOR_OUTPUT_IN. If the
+# Partitioner is not executed, "domain_number_*" will be read from
+# $PARTITION_OUTPUT_IN if available (otherwise, unoptimized default
+# partitioning will be used).
+#
+# EXEC_PREPROCESS : should the Preprocessor be run ? (yes/no)
+# EXEC_PARTITION : should the Partitioner be run ? (yes/no)
+# EXEC_KERNEL : should the Kernel be run ? (yes/no)
+#
+EXEC_PREPROCESS=yes
+EXEC_PARTITION=yes
+EXEC_KERNEL=yes
+#
+#
+#
+########################################################################
+#
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Kernel installation parameters
+#
+prefix=/home/saturne/Code_Saturne/2.0-beta2/arch/Linux_x86_64
+#
+exec_prefix=${prefix}
+bindir=${exec_prefix}/bin
+datarootdir=${prefix}/share
+datadir=${datarootdir}
+pkgdatadir=${datadir}/ncs
+#
+# Preprocessor installation parameters
+#
+ecs_prefix=
+#
+ecs_exec_prefix=${ecs_prefix}
+ecs_bindir=${ecs_exec_prefix}/bin
+#
+# HOMARD installation parameters (to be completed if needed)
+#
+homard_prefix=
+#
+########################################################################
+# Mesh Adaptation
+#
+if [ ! -z "${ADAPTATION}" ] ; then
+ if [ "${ADAPTATION}" = "-help" ] ; then
+ ${homard_prefix}/saturne_homard ${ADAPTATION}
+ exit 0
+ else
+ HOMARD_options=" -v"
+ ${homard_prefix}/saturne_homard -Saturne_Script $0 -Donnees_Calcul $CASEDIR \
+ -Pilotage_Adaptation $ADAPTATION $HOMARD_options || exit 1
+ fi
+fi
+#
+#########################################################################
+#
+N_SYRTHES_COUPLINGS=0
+if [ -f "${SRC}/ussyrc.f90" ] ; then
+ N_SYRTHES_COUPLINGS=`grep -e ^' ' ${SRC}/ussyrc.f90 | grep -i -c defsyr`
+fi
+#
+if [ $N_SYRTHES_COUPLINGS = 0 ] ; then
+ SYRTHES_COUPLING=no
+else
+ SYRTHES_COUPLING=yes
+ export SYRTHES
+ if [ $N_SYRTHES_COUPLINGS -gt 1 ] ; then
+ echo "This script can not handle multiple couplings with SYRTHES"
+ echo "Number of SYRTHES couplings requested: $N_SYRTHES_COUPLINGS"
+ fi
+fi
+#
+if [ $SYRTHES_COUPLING = yes ] ; then
+ if [ $SOLCOM -eq 1 ] ; then
+ echo "SYRTHES coupling is not compatible with SOLCOM-type meshes"
+ exit 1
+ fi
+else
+ COUPLING_MODE=
+fi
+#
+########################################################################
+#
+# Parameters for execution
+#
+# General variables
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIX=$DATE
+EXE=cs_solver
+EXE_SYR=syrthes
+#
+# Copy runcase before changing to the working directory
+# (as after that, the relative path will not be up to date).
+#
+cp $0 $RESU/runcase.$SUFFIX
+#
+# Execution directory (reachable by all the processors)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+else
+# Default if not specified by the user
+#
+# On the CCRT, there is no TMPDIR. We work by default in SCRATCHDIR
+ if [ "$SCRATCHDIR" != "" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+ else
+ RUN=$HOME/tmp_Saturne/$STUDY.$CASE.$DATE
+ fi
+fi
+#
+# Create directory if necessary
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "RUN=$RUN already exists."
+ echo "The simulation will not be run."
+ exit 1
+ fi
+fi
+#
+# Create a temporary file for Salome (equivalent to "ficstp")
+if [ "$ARG_CS_OUTPUT" = "--log 0" ] ; then
+ echo $RUN > $SCRIPTS/runningstd.$DATE
+else
+ echo $RUN > $SCRIPTS/runningext.$DATE
+fi
+#
+cd $RUN
+#
+########################################################################
+#
+# Set up MPI environment
+#
+# Use makefile query to obtain the path to MPI binaries if those are
+# not on the default path. This is a peculiar use of make, but allows
+# us to avoid defining the MPI configuration in multiple files.
+
+CS_MPI_PATH=/home/saturne/opt/openmpi-1.3.1/arch/Linux_x86_64/bin
+
+# NUMBER_OF_PROCESSORS is determined here if not already set;
+# MPIHOSTS, MPIRUN, MPIBOOT, MPIHALT, and NUMBER_OF_NODES are
+# defined by the sourced script, and PATH may be updated.
+#
+. ${pkgdatadir}/runcase_mpi_env
+#
+# Check for the number of requested processors
+nproc_kernel="${NUMBER_OF_PROCESSORS}"
+echo
+echo
+if [ $SYRTHES_COUPLING = yes ] ; then
+ echo "Coupling of Code_Saturne and SYRTHES activated."
+ # 1 processor is reserved for SYRTHES if coupled through MPI.
+ if [ "$COUPLING_MODE" = "MPI" ] ; then
+ (( nproc_kernel = nproc_kernel - N_SYRTHES_COUPLINGS ))
+ if [ $nproc_kernel -lt 1 ] ; then
+ echo
+ echo
+ echo " Warning, if COUPLING_MODE = MPI, SYRTHES reserves 1 processor"
+ echo " (which need not be a physical processor)."
+ echo " Here, NUMBER_OF_PROCESSORS=${NUMBER_OF_PROCESSORS}, while it must"
+ echo " be strictly greater than 1."
+ echo " Increase the number of requested processors."
+ echo
+ exit 1
+ fi
+ fi
+fi
+if [ $nproc_kernel -gt 1 ] ; then
+ echo "Parallel Code_Saturne with partitioning in $nproc_kernel sub-domains"
+ if [ $SOLCOM = 1 ] ; then
+ echo
+ echo
+ echo " Parallel run impossible with SOLCOM = $SOLCOM "
+ echo " Use SOLCOM = 0 "
+ echo
+ exit 1
+ fi
+else
+ echo "Single processor Code_Saturne simulation"
+fi
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "Total number of processors: $NUMBER_OF_PROCESSORS"
+fi
+#
+# In parallel mode, the corresponding argument must be set
+if [ $nproc_kernel -gt 1 ] ; then
+ ARG_CS_MPI=" --mpi"
+else
+ ARG_CS_MPI=""
+fi
+#
+#
+########################################################################
+#
+# Communications
+#
+# To help debug coupling problems, make communication more verbose
+if [ ! -z "$ECHO_SYR_COMM" ] ; then
+ ECHOCOMMSYR="-echo-comm $ECHO_SYR_COMM"
+else
+ ECHOCOMMSYR=""
+fi
+########################################################################
+# Greeting message
+#
+echo ' '
+echo ' Code_Saturne is running '
+echo ' *********************** '
+echo ' '
+echo ' Working directory (to be periodically cleaned) : '
+echo ' ' $RUN
+#
+########################################################################
+#
+# Compilation and link
+#
+# Note: we also check the for the presence of certain user subroutines here.
+#
+echo
+echo ' Kernel version: ' $prefix
+echo ' Preprocessor version: ' $ecs_prefix
+
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ cur_dir=`pwd`
+
+ source_cas=$SRC
+
+ #
+ # Copy of the parameter file
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMAND_PARAM="--param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The parameters file ' $var
+ echo ' can not be accessed.'
+ exit 1
+ fi
+ fi
+
+ src_files=`ls ${source_cas}/*.[fF]90 ${source_cas}/*.[ch] 2>/dev/null`
+
+ if [ ! -z "${src_files}" ] ; then
+
+ echo
+ echo " ***************************************************************"
+ echo " Compilation of user subroutines and linking of Code_Saturne"
+ echo " ***************************************************************"
+
+ if [ -f compil.log ] ; then
+ rm -f compil.log
+ fi
+
+ src_dir="src_saturne"
+
+ # Copy of the user source files
+ # (no links: the directory is copied later)
+ mkdir ${src_dir}
+ for f in ${src_files} ; do
+ if [ -f $f ] ; then
+ cp ${f} ${src_dir}/
+ fi
+ done
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --source=$src_dir --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ # Compilation
+ if [ ! -z "${CS_LIB_ADD}" ] ; then
+ OPTLIBS="--opt-libs=${CS_LIB_ADD}"
+ fi
+ ${bindir}/cs compile \
+ --source=$src_dir ${OPTLIBS} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ echo "COMPILE OR LINK ERROR"
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ fi
+
+ else
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ ln -s ${bindir}/$EXE .
+
+ fi
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+
+ ${pkgdatadir}/runcase_syrthes -compile \
+ -cs-bindir=${bindir} -src-syr=${SRC_SYR} \
+ -src-copy=${RESU}/SRC_SYR.${SUFFIX} -log=${RESU}/compil_syrthes.log.${SUFFIX}
+
+ fi
+
+fi # EXEC_KERNEL = yes
+
+#
+########################################################################
+#
+# Data setup
+#
+echo
+echo " ********************************************"
+echo " Preparing calculation "
+echo " ********************************************"
+echo
+#
+ERROR=false
+PREPROCESS_ERROR=false
+PARTITION_ERROR=false
+EXECUTION_ERROR=false
+#
+if [ $SOLCOM = 1 ]
+then
+ EXEC_PREPROCESS=no
+ EXEC_PARTITION=no
+ ln -s $MESHDIR/$MESH geomet || exit 1
+fi
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ]
+then
+ for var in $MESH ; do
+ ln -s $MESHDIR/$var $var || exit 1
+ # Special case for meshes in EnSight format: link to .geo file necessary
+ # (retrieve name through .case file)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $MESHDIR/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+else
+ if [ -f ${PREPROCESSOR_OUTPUT_IN} ] ; then
+ ln -s ${PREPROCESSOR_OUTPUT_IN} preprocessor_output || exit 1
+ else
+ echo "Error: no preprocessor output file is available;"
+ echo " (${PREPROCESSOR_OUTPUT_IN} does not exist."
+ echo " or is not a standard file."
+ exit 1
+ fi
+fi
+#
+if [ $nproc_kernel -eq 1 -a "${EXEC_KERNEL}" = "yes" ] ; then
+ EXEC_PARTITION=no
+elif [ "${EXEC_PARTITION}" = "no" -a "${PARTITION_OUTPUT_IN}" != "" ]
+then
+ if [ -f ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} ] ; then
+ ln -s ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} .
+ else
+ echo "Warning: no partitioning file is available;"
+ echo " (no ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel})."
+ echo
+ echo " Unoptimized partitioning will be used."
+ echo " Parallel performance may be degraded."
+ fi
+fi
+#
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ for var in ${RESTART_IN}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "$THERMOCHEMISTRY_DATA" != "" ] ; then
+ var=$DATA/$THERMOCHEMISTRY_DATA
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # Copy so as to have correct name upon backup
+ if [ "$THERMOCHEMISTRY_DATA" != "dp_tch" ] ; then
+ cp dp_tch $THERMOCHEMISTRY_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The thermochemistry file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ if [ "$METEO_DATA" != "" ] ; then
+ var=$DATA/$METEO_DATA
+ if [ -f $var ] ; then
+ cp $var meteo
+ # Copy so as to have correct name upon backup
+ if [ "$METEO_DATA" != "meteo" ] ; then
+ cp meteo $METEO_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The meteo profile file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ for f in uscpcl.f90 usd3pc.f90 usebuc.f90 uslwcc.f90 usfucl.f90
+ do
+ if [ -f "${SRC}/${f}" -a ! -f JANAF ] ; then
+ cp ${datadir}/data/thch/JANAF JANAF
+ fi
+ done
+ #
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ #
+ ${pkgdatadir}/runcase_syrthes -copy-data -syrthes-env=${DATA_SYR}/$SYRTHES_ENV
+ #
+ fi
+ #
+ if [ ! -z "$USER_INPUT_FILES" ] ; then
+ for f in $USER_INPUT_FILES ; do
+ cp $DATA/$f .
+ done
+ fi
+ #
+fi # EXEC_KERNEL = yes
+
+########################################################################
+# Maximum time for PBS (done here so as to leave time for PBS to
+# realize that things have started).
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Summary: start
+#
+CURDATE=`unset LANG ; date`
+#
+echo '========================================================'>>$summary
+echo ' Start time : ' $CURDATE >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Kernel : ' $prefix >>$summary
+echo ' Preprocessor : ' $ecs_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' HOMARD : ' $homard_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' CS_MPI_PATH : ' $CS_MPI_PATH >>$summary
+echo ' PATH : ' $PATH >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' User : ' $USER >>$summary
+echo '========================================================'>>$summary
+echo ' Machine : ' >>$summary
+ uname -a >>$summary
+if [ -z "$NUMBER_OF_PROCESSORS" ] ; then
+ echo ' N Procs : ' 1 >>$summary
+else
+ echo ' N Procs : ' $NUMBER_OF_PROCESSORS >>$summary
+fi
+if [ -z "$PROCESSOR_LIST" ] ; then
+ echo ' Processors : ' default >>$summary
+else
+ echo ' Processors : ' $PROCESSOR_LIST >>$summary
+fi
+echo '========================================================'>>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Case : ' $CASE >>$summary
+echo ' DATA : ' $DATA >>$summary
+echo ' SRC : ' $SRC >>$summary
+echo ' RESU : ' $RESU >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Exec. dir. : ' $RUN >>$summary
+echo ' ----------------------------------------------------' >>$summary
+if [ "$EXEC_PREPROCESSOR" = "yes" ] ; then
+ echo ' Preprocessor : ' ${ecs_bindir}/cs_preprocess >>$summary
+fi
+if [ "$EXEC_PARTITION" = "yes" ] ; then
+ echo ' Partitioner : ' ${ecs_bindir}/cs_partition >>$summary
+fi
+if [ "$EXEC_KERNEL" = "yes" ] ; then
+ echo ' Executable : ' $EXE >>$summary
+fi
+echo ' ----------------------------------------------------' >>$summary
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Starting calculation"
+echo " ********************************************"
+echo
+#
+# Preprocessor start
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ] ; then
+ #
+ ${ecs_bindir}/cs_preprocess --mesh $MESH "--case" $CASE \
+ $COMMAND_REORIENT $COMMAND_JOIN $COMMAND_PERIO \
+ > listpre 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error running the preprocessor."
+ echo "Check preprocessor log (listpre) for details."
+ echo
+ PREPROCESS_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PREPROCESSOR_OUTPUT_OUT=$RESU/preprocessor_output.$SUFFIX
+ cp preprocessor_output ${PREPROCESSOR_OUTPUT_OUT}
+ fi
+ #
+fi
+#
+# Partitioner start
+#
+if [ ! -f ${ecs_bindir}/cs_partition ] ; then
+ echo "Warning: ${ecs_bindir}/cs_partition not found."
+ echo
+ echo "The partitioner may not have been installed"
+ echo " (this is the case if neither METIS nor."
+ echo " SCOTCH are avaialable)."
+ echo
+ echo "Unoptimized partitioning will be used, so"
+ echo "parallel performance may be degraded."
+ echo
+ EXEC_PARTITION=no
+fi
+#
+if [ "${EXEC_PARTITION}" = "yes" ] ; then
+ #
+ if [ "${EXEC_KERNEL}" = "yes" ] ; then
+ ${ecs_bindir}/cs_partition $nproc_kernel > listpart 2>&1
+ else
+ if [ -z "$PARTITION_LIST" ] ; then
+ echo "Error running the partitioner."
+ echo "PARTITION_LIST is not set."
+ echo "This variable should contain the number of processors"
+ echo "for which we partition (or a list of such numbers)."
+ PARTITION_ERROR=true
+ ERROR=true
+ else
+ ${ecs_bindir}/cs_partition $PARTITION_LIST > listpart 2>&1
+ fi
+ fi
+ if [ $? != 0 -a $PARTITION_ERROR = false ] ; then
+ echo "Error running the partitioner."
+ echo "Check partitioner log (listpart) for details."
+ echo
+ PARTITION_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PARTITION_OUTPUT_OUT=$RESU/PARTITION_OUTPUT.$SUFFIX
+ mkdir $PARTITION_OUTPUT_OUT
+ cp -r domain_number_* ${PARTITION_OUTPUT_OUT}/
+ fi
+#
+fi
+#
+# Run calculation proper.
+#
+if [ "$ERROR" != "true" -a "$EXEC_KERNEL" = "yes" ] ; then
+#
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ # MPI Communication
+ #
+ # Make sure to transmit possible additional arguments assigned by mpirun to
+ # the executable with some MPI-1 implementations (vanilla MPICH 1.2 sets the
+ # parameters needed by MPI_Init through argc/argv): we use $@ to forward
+ # arguments passed to localexec to the true executable files.
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`${pkgdatadir}/runcase_mpi_rank \$@\`" >> $localexec
+ echo cd $RUN >> $localexec
+ echo "if [ \$MPI_RANK -eq 0 ] ; then" >> $localexec
+ echo " $RUN/$EXE_SYR \$@ -app-num 0 -comm-mpi 1 $ECHOCOMMSYR > listsyr 2>&1" >> $localexec
+ echo "else" >> $localexec
+ echo " $VALGRIND $RUN/$EXE \$@ --mpi 1 $COMMAND_CWF "\
+ "$ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM " >> $localexec
+ echo "fi" >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ #
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ elif [ $SYRTHES_COUPLING = yes ] ; then
+ # Socket communications
+ #
+ # We provide the executables with a "random" port number.
+ PORT=35623
+ SOCKETNCS="--syr-socket $PORT"
+ SOCKETSYR="-comm-socket $PORT"
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI $COMMAND_CWF "\
+ " $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM $SOCKETNCS " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true &
+ #
+ ./$EXE_SYR $ECHOCOMMSYR $SOCKETSYR > listsyr 2>&1
+ #
+ $MPIHALT
+ #
+ elif [ $SOLCOM = 0 ] ; then
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI "\
+ " $COMMAND_CWF $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ else # cas SOLCOM = 1
+ #
+ $VALGRIND $RUN/$EXE --solcom \
+ $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM \
+ || EXECUTION_ERROR=true
+ #
+ fi
+#
+fi
+#
+# Remove the Salome temporary files
+rm -f $SCRIPTS/running*.$DATE
+#
+########################################################################
+#
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ echo "Error running the coupled calculation."
+ echo "Either the Kernel or SYRTHES may have failed."
+ echo
+ echo "Check Kernel log (listing) and SYRTHES log (listsyr) for details,"
+ echo "as well as eventual error* files."
+ echo
+ else
+ echo "Error running the calculation."
+ echo
+ echo "Check Kernel log (listing) and error* files for details"
+ echo
+ fi
+ ERROR=true
+fi
+#
+# Treatment of the ouput files:
+# Starts with the restart files
+# (in case of full disk, increases chances of being able to continue).
+#
+if [ $EXEC_KERNEL = yes ] ; then
+
+ RESTART_OUT=$RESU/RESTART.$SUFFIX
+ iok=1
+ mkdir ${RESTART_OUT} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f ${RESTART_OUT}
+ fi
+ done
+ else
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+
+ resuser=0
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIX
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f ${RES_USER}
+ fi
+ done
+ else
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+ fi
+
+ for f in $PARAM $THERMOCHEMISTRY_DATA $METEO_DATA ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+
+ for f in probes_*.dat ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+ for f in ush* ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+
+fi # output files
+
+for f in list* error* *.med *.cgns ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+done
+
+# Treatment of EnSight and MED files
+# The $dir (=*.ensight and/or *.med) directories are copied
+# to $DIR.$SUFFIX
+
+# We place directories $dir (=*.ensight and/or *.med)
+# in $DIR.$SUFFIX
+
+cas=`echo $CASE |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Creating $RESU/$DIR.$SUFFIX failed
+ else
+ for f in $dir/* ; do
+ if [ -f $f ] ; then
+ cp -R ${f} $RESU/$DIR.$SUFFIX/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ rayt_list=`ls bord* 2>/dev/null`
+ if [ ! -z "${rayt_list}" ] ; then
+ for f in $rayt_list ; do
+ if [ ! -d $RESU/CHR.$SUFFIX ] ; then
+ mkdir $RESU/CHR.$SUFFIX
+ fi
+ cp $f $RESU/CHR.$SUFFIX/.
+ done
+ fi
+
+ lagr_list=`ls debug* deplacement* trajectoire* frontiere* 2>/dev/null`
+ if [ ! -z "${lagr_list}" ] ; then
+ mkdir $RESU/LAGR.$SUFFIX
+ for f in $lagr_list ; do
+ cp $f $RESU/LAGR.$SUFFIX
+ done
+ fi
+
+ # Matisse output files
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # The date is added to the first line of resuMatisse
+ AFDATE="Date of the case : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIX
+ fi
+
+ for dir in src_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/SRC.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Failure creating $RESU/SRC.$SUFFIX
+ else
+ for f in $dir/*.[fF]90 $dir/*.[ch] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} $RESU/SRC.$SUFFIX/.
+ fbase=`basename ${f}`
+ chmod a-w $RESU/SRC.$SUFFIX/${fbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ ${pkgdatadir}/runcase_syrthes -copy-results \
+ -result-dir=${RESU}/RESU_SYR.${SUFFIX}
+ fi
+
+fi # input data and outputs
+#
+########################################################################
+#
+# Summary: end
+#
+if [ "$PREPROCESS_ERROR" = "true" ] ; then
+ EXEC_PREPROCESS="failed"
+fi
+echo " Preprocessing : " $EXEC_PREPROCESS >>$summary
+if [ "$PARTITION_ERROR" = "true" ] ; then
+ EXEC_PARTITION="failed"
+fi
+echo " Partitioning : " $EXEC_PARTITION >>$summary
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ EXEC_KERNEL="failed"
+fi
+echo " Calculation : " $EXEC_KERNEL >>$summary
+#
+CURDATE=`unset LANG ; date`
+#
+echo ' ----------------------------------------------------' >>$summary
+echo ' Finish time : ' $CURDATE >>$summary
+echo '========================================================'>>$summary
+#
+cp $summary $RESU/$summary.$SUFFIX
+#
+########################################################################
+#
+#
+# Finish
+#
+echo
+echo " ********************************************"
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ echo " Error in calculation stage."
+elif [ "$PARTITION_ERROR" = "true" ] ; then
+ echo " Error in partitioning stage."
+elif [ "$PREPROCESS_ERROR" = "true" ] ; then
+ echo " Error in preprocessing stage."
+else
+ echo " Normal simulation finish"
+fi
+echo " ********************************************"
+
+if [ "$ERROR" = "true" ] ; then
+ exit 1
+else
+ exit 0
+fi
+#
+########################################################################
diff --git a/examples/2-full_domain/case4/usclim.f90 b/examples/2-full_domain/case4/usclim.f90
new file mode 100644
index 0000000..aefadd2
--- /dev/null
+++ b/examples/2-full_domain/case4/usclim.f90
@@ -0,0 +1,578 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta2
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usclim &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine.
+
+! Fill boundary conditions arrays (icodcl, rcodcl)
+! for unknown variables.
+
+
+! Introduction
+! ============
+
+! Here we define boundary conditions on a per-face basis.
+
+! Boundary faces may be identified using the 'getfbr' subroutine.
+
+! getfbr(string, nelts, eltlst) :
+! - string is a user-supplied character string containing
+! selection criteria;
+! - nelts is set by the subroutine. It is an integer value
+! corresponding to the number of boundary faces verifying the
+! selection criteria;
+! - lstelt is set by the subroutine. It is an integer array of
+! size nelts containing the list of boundary faces verifying
+! the selection criteria.
+
+! string may contain:
+! - references to colors (ex.: 1, 8, 26, ...
+! - references to groups (ex.: inlet, group1, ...)
+! - geometric criteria (ex. x < 0.1, y >= 0.25, ...)
+! These criteria may be combined using logical operators
+! ('and', 'or') and parentheses.
+! Example: '1 and (group2 or group3) and y < 1' will select boundary
+! faces of color 1, belonging to groups 'group2' or 'group3' and
+! with face center coordinate y less than 1.
+
+
+
+! Boundary condition types
+! ========================
+
+! Boundary conditions may be assigned in two ways.
+
+
+! For "standard" boundary conditions:
+! -----------------------------------
+
+! (inlet, free outlet, wall, symmetry), we define a code
+! in the 'itypfb' array (of dimensions number of boundary faces,
+! number of phases). This code will then be used by a non-user
+! subroutine to assign the following conditions (scalars in
+! particular will receive the conditions of the phase to which
+! they are assigned). Thus:
+
+! Code | Boundary type
+! --------------------------
+! ientre | Inlet
+! isolib | Free outlet
+! isymet | Symmetry
+! iparoi | Wall (smooth)
+! iparug | Rough wall
+
+! Integers ientre, isolib, isymet, iparoi, iparug
+! are defined elsewhere (param.h). Their value is greater than
+! or equal to 1 and less than or equal to ntypmx
+! (value fixed in paramx.h)
+
+
+! In addition, some values must be defined:
+
+
+! - Inlet (more precisely, inlet/outlet with prescribed flow, as
+! the flow may be prescribed as an outflow):
+
+! -> Dirichlet conditions on variables
+! other than pressure are mandatory if the flow is incoming,
+! optional if the flow is outgoing (the code assigns 0 flux
+! if no Dirichlet is specified); thus,
+! at face 'ifac', for the variable 'ivar': rcodcl(ifac, ivar, 1)
+
+
+! - Smooth wall: (= impermeable solid, with smooth friction)
+
+! -> Velocity value for sliding wall if applicable
+! at face ifac, rcodcl(ifac, iu, 1)
+! rcodcl(ifac, iv, 1)
+! rcodcl(ifac, iw, 1)
+! -> Specific code and prescribed temperature value
+! at wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 5
+! rcodcl(ifac, ivar, 1) = prescribed temperature
+! -> Specific code and prescribed flux value
+! at wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 3
+! rcodcl(ifac, ivar, 3) = prescribed flux
+! =
+! Note that the default condition for scalars
+! (other than k and epsilon) is homogeneous Neumann.
+
+
+! - Rough wall: (= impermeable solid, with rough friction)
+
+! -> Velocity value for sliding wall if applicable
+! at face ifac, rcodcl(ifac, iu, 1)
+! rcodcl(ifac, iv, 1)
+! rcodcl(ifac, iw, 1)
+! -> Value of the dynamic roughness height to specify in
+! rcodcl(ifac, iu, 3) (value for iv et iw not used)
+! -> Specific code and prescribed temperature value
+! at rough wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 6
+! rcodcl(ifac, ivar, 1) = prescribed temperature
+! rcodcl(ifac, ivar, 3) = dynamic roughness height
+! -> Specific code and prescribed flux value
+! at rough wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 3
+! rcodcl(ifac, ivar, 3) = prescribed flux
+! =
+! Note that the default condition for scalars
+! (other than k and epsilon) is homogeneous Neumann.
+
+! - Symmetry (= impermeable frictionless wall):
+
+! -> Nothing to specify
+
+
+! - Free outlet (more precisely free inlet/outlet with prescribed pressure)
+
+! -> Nothing to prescribe for pressure and velocity
+! For scalars and turbulent values, a Dirichlet value may optionally
+! be specified. The behavior is as follows:
+! * pressure is always handled as a Dirichlet condition
+! * if the mass flow is inflowing:
+! we retain the velocity at infinity
+! Dirichlet condition for scalars and turbulent values
+! (or zero flux if the user has not specified a
+! Dirichlet value)
+! if the mass flow is outflowing:
+! we prescribe zero flux on the velocity, the scalars,
+! and turbulent values
+
+! Note that the pressure will be reset to P0
+! on the first free outlet face found
+
+
+! For "non-standard" conditions:
+! ------------------------------
+
+! Other than (inlet, free outlet, wall, symmetry), we define
+! - on one hand, for each face:
+! -> an admissible 'itypfb' value
+! (i.e. greater than or equal to 1 and less than or equal to
+! ntypmx; see its value in paramx.h).
+! The values predefined in paramx.h:
+! 'ientre', 'isolib', 'isymet', 'iparoi', 'iparug' are in
+! this range, and it is preferable not to assign one of these
+! integers to 'itypfb' randomly or in an inconsiderate manner.
+! To avoid this, we may use 'iindef' if we wish to avoid
+! checking values in paramx.h. 'iindef' is an admissible
+! value to which no predefined boundary condition is attached.
+! Note that the 'itypfb' array is reinitialized at each time
+! step to the non-admissible value of 0. If we forget to
+! modify 'typfb' for a given face, the code will stop.
+
+! - and on the other hand, for each face and each variable:
+! -> a code icodcl(ifac, ivar)
+! -> three real values rcodcl(ifac, ivar, 1)
+! rcodcl(ifac, ivar, 2)
+! rcodcl(ifac, ivar, 3)
+! The value of 'icodcl' is taken from the following:
+! 1: Dirichlet (usable for any variable)
+! 3: Neumann (usable for any variable)
+! 4: Symmetry (usable only for the velocity and
+! components of the Rij tensor)
+! 5: Smooth wall (usable for any variable except for pressure)
+! 6: Rough wall (usable for any variable except for pressure)
+! 9: Free outlet (usable only for velocity)
+! The values of the 3 'rcodcl' components are
+! rcodcl(ifac, ivar, 1):
+! Dirichlet for the variable if icodcl(ifac, ivar) = 1
+! wall value (sliding velocity, temp) if icodcl(ifac, ivar) = 5
+! The dimension of rcodcl(ifac, ivar, 1) is that of the
+! resolved variable: ex U (velocity in m/s),
+! T (temperature in degrees)
+! H (enthalpy in J/kg)
+! F (passive scalar in -)
+! rcodcl(ifac, ivar, 2):
+! "exterior" exchange coefficient (between the prescribed value
+! and the value at the domain boundary)
+! rinfin = infinite by default
+! For velocities U, in kg/(m2 s):
+! rcodcl(ifac, ivar, 2) = (viscl+visct) / d
+! For the pressure P, in s/m:
+! rcodcl(ifac, ivar, 2) = dt / d
+! For temperatures T, in Watt/(m2 degres):
+! rcodcl(ifac, ivar, 2) = Cp*(viscls+visct/sigmas) / d
+! For enthalpies H, in kg /(m2 s):
+! rcodcl(ifac, ivar, 2) = (viscls+visct/sigmas) / d
+! For other scalars F in:
+! rcodcl(ifac, ivar, 2) = (viscls+visct/sigmas) / d
+! (d has the dimension of a distance in m)
+!
+! rcodcl(ifac, ivar, 3) if icodcl(ifac, ivar) <> 6:
+! Flux density (< 0 if gain, n outwards-facing normal)
+! if icodcl(ifac, ivar)= 3
+! For velocities U, in kg/(m s2) = J:
+! rcodcl(ifac, ivar, 3) = -(viscl+visct) * (grad U).n
+! For pressure P, en kg/(m2 s):
+! rcodcl(ifac, ivar, 3) = -dt * (grad P).n
+! For temperatures T, in Watt/m2:
+! rcodcl(ifac, ivar, 3) = -Cp*(viscls+visct/sigmas) * (grad T).n
+! For enthalpies H, in Watt/m2:
+! rcodcl(ifac, ivar, 3) = -(viscls+visct/sigmas) * (grad H).n
+! For other scalars F in :
+! rcodcl(ifac, ivar, 3) = -(viscls+visct/sigmas) * (grad F).n
+
+! rcodcl(ifac, ivar, 3) if icodcl(ifac, ivar) = 6:
+! Roughness for the rough wall law
+! For velocities U, dynamic roughness
+! rcodcl(ifac, ivar, 3) = rugd
+! For other scalars, thermal roughness
+! rcodcl(ifac, ivar, 3) = rugt
+
+
+! Note that if the user assigns a value to itypfb equal to
+! ientre, isolib, isymet, iparoi, or iparug
+! and does not modify icodcl (zero value by default),
+! itypfb will define the boundary condition type.
+
+! To the contrary, if the user prescribes
+! icodcl(ifac, ivar) (nonzero),
+! the values assigned to rcodcl will be used for the considered
+! face and variable (if rcodcl values are not set, the default
+! values will be used for the face and variable, so:
+! rcodcl(ifac, ivar, 1) = 0.d0
+! rcodcl(ifac, ivar, 2) = rinfin
+! rcodcl(ifac, ivar, 3) = 0.d0)
+! Especially, we may have for example:
+! -> set itypfb(ifac, iphas) = iparoi
+! which prescribes default wall conditions for all variables at
+! face ifac,
+! -> and define IN ADDITION for variable ivar on this face
+! specific conditions by specifying
+! icodcl(ifac, ivar) and the 3 rcodcl values.
+
+
+! The user may also assign to itypfb a value not equal to
+! ientre, isolib, isymet, iparoi, iparug, iindef
+! but greater than or equal to 1 and less than or equal to
+! ntypmx (see values in param.h) to distinguish
+! groups or colors in other subroutines which are specific
+! to the case and in which itypfb is accessible.
+! In this case though it will be necessary to
+! prescribe boundary conditions by assigning values to
+! icodcl and to the 3 rcodcl fields (as the value of itypfb
+! will not be predefined in the code).
+
+
+! Consistency rules
+! =================
+
+! A few consistency rules between 'icodcl' codes for
+! variables with non-standard boundary conditions:
+
+! Codes for velocity components must be identical
+! Codes for Rij components must be identical
+! If code (velocity or Rij) = 4
+! we must have code (velocity and Rij) = 4
+! If code (velocity or turbulence) = 5
+! we must have code (velocity and turbulence) = 5
+! If code (velocity or turbulence) = 6
+! we must have code (velocity and turbulence) = 6
+! If scalar code (except pressure or fluctuations) = 5
+! we must have velocity code = 5
+! If scalar code (except pressure or fluctuations) = 6
+! we must have velocity code = 6
+
+
+! Remarks
+! =======
+
+! Caution: to prescribe a flux (nonzero) to Rij,
+! the viscosity to take into account is viscl
+! even if visct exists (visct=rho cmu k2/epsilon)
+
+! We have the ordering array for boundary faces from the
+! previous time step (except for the fist time step,
+! where 'itrifb' has not been set yet).
+! The array of boundary face types 'itypfb' has been
+! reset before entering the subroutine.
+
+
+! Note how to access some variables:
+
+! Cell values
+! Let iel = ifabor(ifac)
+
+! * Density phase iphas, cell iel:
+! propce(iel, ipproc(irom(iphas)))
+! * Dynamic molecular viscosity phase iphas, cell iel:
+! propce(iel, ipproc(iviscl(iphas)))
+! * Turbulent viscosity dynamique phase iphas, cell iel:
+! propce(iel, ipproc(ivisct(iphas)))
+! * Specific heat phase iphas, cell iel:
+! propce(iel, ipproc(icp(iphasl))
+! * Diffusivity: lambda scalaire iscal, cell iel:
+! propce(iel, ipproc(ivisls(iscal)))
+
+! Boundary face values
+
+! * Density phase iphas, boundary face ifac :
+! propfb(ifac, ipprob(irom(iphas)))
+! * Mass flow relative to variable ivar, boundary face ifac:
+! (i.e. the mass flow used for convecting ivar)
+! propfb(ifac, pprob(ifluma(ivar )))
+! * For other values at boundary face ifac:
+! take as an approximation the value in the adjacent cell iel
+! i.e. as above with iel = ifabor(ifac).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! i ! <-- ! number of first free position in ia !
+! idbra0 ! i ! <-- ! number of first free position in ra !
+! ndim ! i ! <-- ! spatial dimension !
+! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
+! ncel ! i ! <-- ! number of cells !
+! nfac ! i ! <-- ! number of interior faces !
+! nfabor ! i ! <-- ! number of boundary faces !
+! nfml ! i ! <-- ! number of families (group classes) !
+! nprfml ! i ! <-- ! number of properties per family (group class) !
+! nnod ! i ! <-- ! number of vertices !
+! lndfac ! i ! <-- ! size of nodfac indexed array !
+! lndfbr ! i ! <-- ! size of nodfbr indexed array !
+! ncelbr ! i ! <-- ! number of cells with faces on boundary !
+! nvar ! i ! <-- ! total number of variables !
+! nscal ! i ! <-- ! total number of scalars !
+! nphas ! i ! <-- ! number of phases !
+! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
+! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
+! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
+! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
+! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
+! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
+! iprfml ! ia ! <-- ! property numbers per family !
+! (nfml, nprfml) ! ! ! !
+! maxelt ! e ! <-- ! max number of cells and faces (int/boundary) !
+! lstelt(maxelt) ! ia ! --- ! work array !
+! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
+! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
+! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
+! nodfac(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
+! icodcl ! ia ! --> ! boundary condition code !
+! (nfabor, nvar) ! ! ! = 1 -> Dirichlet !
+! ! ! ! = 2 -> flux density !
+! ! ! ! = 4 -> sliding wall and u.n=0 (velocity) !
+! ! ! ! = 5 -> friction and u.n=0 (velocity) !
+! ! ! ! = 6 -> roughness and u.n=0 (velocity) !
+! ! ! ! = 9 -> free inlet/outlet (velocity) !
+! ! ! ! inflowing possibly blocked !
+! itrifb(nfabor ! ia ! <-- ! indirection for boundary faces ordering) !
+! (nfabor, nphas) ! ! ! !
+! itypfb ! ia ! --> ! boundary face types !
+! (nfabor, nphas) ! ! ! !
+! idevel(nideve) ! ia ! <-- ! integer work array for temporary developpement !
+! ituser(nituse ! ia ! <-- ! user-reserved integer work array !
+! ia(*) ! ia ! --- ! main integer work array !
+! xyzcen ! ra ! <-- ! cell centers !
+! (ndim, ncelet) ! ! ! !
+! surfac ! ra ! <-- ! interior faces surface vectors !
+! (ndim, nfac) ! ! ! !
+! surfbo ! ra ! <-- ! boundary faces surface vectors !
+! (ndim, nfavor) ! ! ! !
+! cdgfac ! ra ! <-- ! interior faces centers of gravity !
+! (ndim, nfac) ! ! ! !
+! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
+! (ndim, nfabor) ! ! ! !
+! xyznod ! ra ! <-- ! vertex coordinates (optional) !
+! (ndim, nnod) ! ! ! !
+! volume(ncelet) ! ra ! <-- ! cell volumes !
+! dt(ncelet) ! ra ! <-- ! time step (per cell) !
+! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
+! (ncelet, *) ! ! ! (at current and preceding time steps) !
+! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
+! propfa(nfac, *) ! ra ! <-- ! physical properties at interior face centers !
+! propfb(nfabor, *)! ra ! <-- ! physical properties at boundary face centers !
+! coefa, coefb ! ra ! <-- ! boundary conditions !
+! (nfabor, *) ! ! ! !
+! rcodcl ! ra ! --> ! boundary condition values !
+! ! ! ! rcodcl(1) = Dirichlet value !
+! ! ! ! rcodcl(2) = exterior exchange coefficient !
+! ! ! ! (infinite if no exchange) !
+! ! ! ! rcodcl(3) = flux density value !
+! ! ! ! (negative for gain) in w/m2 or !
+! ! ! ! roughness height (m) if icodcl=6 !
+! ! ! ! for velocities ( vistl+visct)*gradu !
+! ! ! ! for pressure dt*gradp !
+! ! ! ! for scalars cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! ra ! --- ! work arrays !
+! (ncelet) ! ! ! (computation of pressure gradient) !
+! coefu ! ra ! --- ! tab de trav !
+! (nfabor, 3) ! ! ! (computation of pressure gradient) !
+! rdevel(nrdeve) ! ra ! <-> ! tab reel complementaire developemt !
+! rdevel(nideve) ! ra ! <-- ! real work array for temporary developpement !
+! rtuser(nituse ! ra ! <-- ! user-reserved real work array !
+! ra(*) ! ra ! --- ! main real work array !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! Local variables
+
+integer idebia, idebra
+integer ifac, ielt, ii, ivar, iphas
+integer ilelt, nlelt
+double precision uref2, d2s3
+double precision rhomoy, dh, ustar2
+double precision xintur
+double precision xkent, xeent
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. Initialization
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. Assign boundary conditions to boundary faces here
+
+! We may use selection criteria to filter boundary case subsets
+! Loop on faces from a subset
+! Set the boundary condition for each face
+!===============================================================================
+
+! --- Most types and values have been set using the GUI.
+
+! --- Set inlet values
+
+! Inlet type has already been assigned to boundary faces of color 1
+! through the GUI with a default velocity, but a time-varying value
+! is prescribed here and overrides the one given through the GUI.
+
+call getfbr('1', nlelt, lstelt)
+!==========
+
+if (ttcabs .lt. 3.8d0) then
+ do ielt = 1, nlelt
+ ifac = lstelt(ielt)
+ rcodcl(ifac,isca(1),1) = 20.d0+100.d0*ttcabs
+ enddo
+else
+ do ielt = 1, nlelt
+ ifac = lstelt(ielt)
+ rcodcl(ifac,isca(1),1) = 400.d0
+ enddo
+endif
+
+!----
+! Formats
+!----
+
+!----
+! End
+!----
+
+return
+end subroutine
diff --git a/examples/2-full_domain/case4/uskpdc.f90 b/examples/2-full_domain/case4/uskpdc.f90
new file mode 100644
index 0000000..fc4a4c4
--- /dev/null
+++ b/examples/2-full_domain/case4/uskpdc.f90
@@ -0,0 +1,409 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta2
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uskpdc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdp , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! PERTES DE CHARGE (PDC)
+! POUR LA PHASE IPHAS
+
+! IAPPEL = 1 :
+! CALCUL DU NOMBRE DE CELLULES OU L'ON IMPOSE UNE PDC
+! IAPPEL = 2 :
+! REPERAGE DES CELLULES OU L'ON IMPOSE UNE PDC
+! IAPPEL = 3 :
+! CALCUL DES VALEURS DES COEFS DE PDC
+
+
+! CKUPDC EST LE COEFF DE PDC CALCULE.
+
+! IL INTERVIENT DANS LA QDM COMME SUIT :
+! RHO DU/DT = - GRAD P + TSPDC (+ AUTRES TERMES)
+! AVEC TSPDC = - RHO CKUPDC U ( en kg/(m2 s))
+
+
+! POUR UNE PDC REPARTIE,
+
+! SOIT KSIL = DHL/(0.5 RHO U**2) DONNE DANS LA LITTERATURE
+! (DHL EST LA PERTE DE CHARGE PAR UNITE DE LONGUEUR)
+
+! LE TERME SOURCE TSPDC VAUT DHL = - KSIL *(0.5 RHO U**2)
+
+! ON A CKUPDC = 0.5 KSIL ABS(U)
+
+
+! POUR UNE PDC SINGULIERE,
+
+! SOIT KSIS = DHS/(0.5 RHO U**2) DONNE DANS LA LITTERATURE
+! (DHS EST LA PERTE DE CHARGE SINGULIERE)
+
+! LE TERME SOURCE TSPDC VAUT DHS/L = - KSIS/L *(0.5 RHO U**2)
+
+! ON A CKUPDC = 0.5 KSIS/L ABS(U)
+
+! OU L DESIGNE LA LONGUEUR SUR LAQUELLE
+! ON A CHOISI DE REPRESENTER LA ZONE DE PDC SINGULIERE
+
+
+! IDENTIFICATION DES CELLULES/FACES DE BORD/FACES INTERNES
+! ========================================================
+
+! Les commandes GETCEL, GETFBR et GETFAC permettent d'identifier
+! respectivement les cellules, faces ou faces de bord en fonction
+! de differents criteres.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! La syntaxe des commandes GETFBR et GETFAC est identique.
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncepdp ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp
+integer nideve , nrdeve , nituse , nrtuse
+integer iappel
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ielpdc, iphas, ikpdc
+integer ilelt, nlelt
+
+double precision alpha, cosalp, sinalp, vit1, vit2, ck1, ck2
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if(iappel.eq.1.or.iappel.eq.2) then
+
+!===============================================================================
+
+! 1. POUR CHAQUE PHASE : UN OU DEUX APPELS
+
+! PREMIER APPEL :
+
+! IAPPEL = 1 : NCEPDP : CALCUL DU NOMBRE DE CELLULES
+! AVEC PERTES DE CHARGE
+
+
+! DEUXIEME APPEL (POUR LES PHASES AVEC NCEPDP > 0) :
+
+! IAPPEL = 2 : ICEPDC : REPERAGE DU NUMERO DES CELLULES
+! AVEC PERTES DE CHARGE
+
+! REMARQUES :
+
+! Ne pas utiliser CKUPDC dans cette section
+! (il est rempli au troisieme appel, IAPPEL = 3)
+
+! Ne pas utiliser ICEPDC dans cette section
+! au premier appel (IAPPEL = 1)
+
+! On passe ici a chaque pas de temps
+! (ATTENTION au cout calcul de vos developpements)
+
+!===============================================================================
+
+
+! 1.1 A completer par l'utilisateur : selection des cellules
+! -----------------------------------------------------------
+
+! --- Exemple 1 : Aucune pdc (defaut)
+
+ ielpdc = 0
+
+
+! --- Exemple 2 : Pdc definies par coordonnees pour la phase 1
+! Pas de pertes de charge pour la phase 2
+! Le traitement etant different pour les phases
+! un test est necessaire.
+
+ if(iphas.eq.1) then
+ ielpdc = 0
+
+ call getcel('X <= 0.4 and X >= 0.2 and Y >= -0.75 and Y <= -0.25', &
+ nlelt,lstelt)
+
+ do ilelt = 1, nlelt
+ iel = lstelt(ilelt)
+ ielpdc = ielpdc + 1
+ if (iappel.eq.2) icepdc(ielpdc) = iel
+ enddo
+
+ else
+ ielpdc = 0
+ endif
+
+
+! 1.2 Sous section generique a ne pas modifier
+! ---------------------------------------------
+
+! --- Pour IAPPEL = 1,
+! Renseigner NCEPDP, nombre de cellules avec pdc
+! Le bloc ci dessous est valable pourles 2 exemples ci dessus
+
+ if (iappel.eq.1) then
+ ncepdp = ielpdc
+ endif
+
+!-------------------------------------------------------------------------------
+
+elseif(iappel.eq.3) then
+
+!===============================================================================
+
+! 2. POUR CHAQUE PHASE AVEC NCEPDP > 0 , TROISIEME APPEL
+
+! TROISIEME APPEL (POUR LES PHASES AVEC NCEPDP > 0) :
+
+! IAPPEL = 3 : CKUPDC : CALCUL DES COEFFICIENTS DE PERTE DE CHARGE
+! DANS LE REPERE DE CALCUL
+! STOCKES DANS L'ORDRE
+! K11, K22, K33, K12, K13, K23
+
+
+! REMARQUE :
+
+! Veillez a ce que les coefs diagonaux soient positifs.
+
+! Vous risquez un PLANTAGE si ce n'est pas le cas.
+
+! AUCUN controle ulterieur ne sera effectue.
+
+! ===========================================================
+
+
+! 2.1 A completer par l'utilisateur : valeur des coefs
+! -----------------------------------------------------
+
+! --- Attention
+! Il est important que les CKUPDC soient completes (par des valeurs
+! nulles eventuellement) dans la mesure ou ils seront utilises pour
+! calculer un terme source dans les cellules identifiees precedemment.
+
+! On les initialise tous par des valeurs nulles.
+! Et on demande a l'utilisateur de conserver cette initialisation.
+! =========
+
+ do ikpdc = 1, 6
+ do ielpdc = 1, ncepdp
+ ckupdc(ielpdc,ikpdc) = 0.d0
+ enddo
+ enddo
+
+ if(iphas.eq.1) then
+
+! Exemple de pertes de charges isotropes (tenseur diagonal)
+
+
+ do ielpdc = 1, ncepdp
+ iel=icepdc(ielpdc)
+ ckupdc(ielpdc,1) = 1.d4
+ ckupdc(ielpdc,2) = 1.d4
+ ckupdc(ielpdc,3) = 1.d4
+ enddo
+
+ endif
+
+!-------------------------------------------------------------------------------
+
+endif
+
+return
+
+end
diff --git a/examples/2-full_domain/case4/usphyv.f90 b/examples/2-full_domain/case4/usphyv.f90
new file mode 100644
index 0000000..c0ee651
--- /dev/null
+++ b/examples/2-full_domain/case4/usphyv.f90
@@ -0,0 +1,313 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta2
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : REMPLISSAGE DES VARIABLES PHYSIQUES
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivart, iclvar, iel, iphas
+integer ipcrom, ipbrom, ipcvis, ipccp
+integer ipcvsl, ith, iscal, ii
+integer iutile
+double precision vara, varb, varc, varam, varbm, varcm, vardm
+double precision varal, varbl, varcl, vardl
+double precision varac, varbc
+double precision xrtp
+
+!===============================================================================
+
+!===============================================================================
+! 0. Initializations
+!===============================================================================
+
+! --- Memory initialization
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+
+! Variable density, as a function of temperature
+! ================
+
+! We use the same density law for all phases.
+! Values of this property are assigned to cell centers.
+! (and optionally to boundary faces).
+
+!===============================================================================
+
+do iphas = 1, nphas ! Loop on phases
+
+ ! The position of the density of phase iphas in propce
+ ! (physical properties at element centers) given by ipcrom.
+
+ ipcrom = ipproc(irom(iphas))
+
+ ! Coefficients chosen and prescribed by the user.
+
+ vara = -4.0668d-3
+ varb = -5.0754d-2
+ varc = 1000.9d0
+
+ ! Density at cell centers
+ ! -----------------------
+ ! Law: rho = t * ( a * t + b ) + c
+ ! Code: propce(iel, ipcrom) = xrtp * (vara*xrtp+varb) + varc
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,isca(1))
+ propce(iel,ipcrom) = xrtp * (vara*xrtp+varb) + varc
+ enddo
+
+enddo ! End of loop on phases
+
+!===============================================================================
+
+!----
+! Formats
+!----
+
+!----
+! Fin
+!----
+
+return
+end
diff --git a/examples/2-full_domain/case4/usproj.f90 b/examples/2-full_domain/case4/usproj.f90
new file mode 100644
index 0000000..e6e1686
--- /dev/null
+++ b/examples/2-full_domain/case4/usproj.f90
@@ -0,0 +1,342 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta2
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usproj &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvep , nivep , ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , statis , stativ , tslagr , parbor , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! MODIFICATION UTILISATEUR EN FIN DE PAS DE TEMPS
+! TOUT EST POSSIBLE,
+
+
+! ON DONNE ICI PLUSIEURS EXEMPLES :
+
+! - CALCUL DE BILAN THERMIQUE
+! (au besoin, voir "ADAPTATION A UN SCALAIRE QUELCONQUE")
+
+! - CALCUL DES EFFORTS GLOBAUX SUR UN SOUS-ENSEMBLE DE FACES
+
+! - MODIFICATION ARBITRAIRE D'UNE VARIABLE DE CALCUL
+
+! - EXTRACTION D'UN PROFIL 1D
+
+! - IMPRESSION D'UN MOMENT
+
+! - EXEMPLES D'UTILISATION DES ROUTINES DE PARALLELISME
+
+! CES EXEMPLES SONT DONNES EN SUPPOSANT UN CAS AVEC PERIODICITE
+! (IPERIO .GT.0) ET PARALLELISME (IRANGP.GE.0).
+
+
+! LE CALCUL DE BILAN THERMIQUE FOURNIT EN OUTRE UNE TRAME POUR
+! PLUSIEURS CHOSES
+! - CALCUL DE GRADIENT (AVEC LES PRECAUTIONS UTILES EN PARALLELE ET
+! PERIODIQUE)
+! - CALCUL DE GRANDEUR DEPENDANT DES VALEURS AUX CELLULES VOISINES
+! D'UNE FACE (AVEC LES PRECAUTIONS A PRENDRE EN PARALLELE ET
+! PERIODIQUE : VOIR L'ECHANGE DE DT ET DE CP)
+! - CALCUL D'UNE SOMME SUR LES PROCESSEURS LORS D'UN CALCUL
+! PARALLELE (PARSOM)
+
+
+! IDENTIFICATION DES CELLULES/FACES DE BORD/FACES INTERNES
+! ========================================================
+
+! Les commandes GETCEL, GETFBR et GETFAC permettent d'identifier
+! respectivement les cellules, faces ou faces de bord en fonction
+! de differents criteres.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! La syntaxe des commandes GETFBR et GETFAC est identique.
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particules autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! moyennes statistiques !
+!(ncelet,nvlsta ! ! ! !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,ntersl ! ! ! lagrangien sur la phase porteuse !
+! parbor ! tr ! <-- ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta), stativ(ncelet,nvlsta-1)
+double precision tslagr(ncelet,ntersl)
+double precision parbor(nfabor,nvisbr)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel
+
+double precision sum, sumvol
+
+!===============================================================================
+
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! ---> Extra memory handling
+
+idebia = idbia0
+idebra = idbra0
+
+
+! Opening of file moy.dat at the first time step of the calculation
+! ntcabs = current time step
+! ntpabs = last time step of former calculation (if restart) or 0
+! Only the first processor opens the file
+! irangp = rank of current processor (=-1 if single-processor calculation)
+if (ntcabs.eq.ntpabs+1 .and. irangp.le.0) then
+ open(99,file="moy.dat")
+endif
+
+sum = 0.d0
+sumvol = 0.d0
+do iel = 1, ncel
+ sum = sum + rtp(iel,isca(1))*volume(iel)
+ sumvol = sumvol + volume(iel)
+enddo
+
+! If the computation is done on more than one processor,
+! the "local" sum calculated above must be cumulated on all the processors.
+! parsom = replaces the argument by its sum over all the processors
+! (Code_Saturne routine encapsulating MPI commands).
+if (irangp.ge.0) then
+ call parsom(sum)
+ call parsom(sumvol)
+endif
+sum = sum/sumvol
+
+! Only the first processor writes
+if (irangp.le.0) write(99,99) ntcabs,sum
+
+ 99 format(i6,g15.8)
+
+! Close file moy.dat at last time step (ntmabs).
+if (ntcabs.eq.ntmabs .and. irangp.le.0) then
+ close(99)
+endif
+
+return
+end
diff --git a/examples/2-full_domain/mesh/downcomer.des b/examples/2-full_domain/mesh/downcomer.des
new file mode 100644
index 0000000..e254292
Binary files /dev/null and b/examples/2-full_domain/mesh/downcomer.des differ
diff --git a/examples/2-full_domain/mesh/fdc.des b/examples/2-full_domain/mesh/fdc.des
new file mode 100644
index 0000000..482d3eb
Binary files /dev/null and b/examples/2-full_domain/mesh/fdc.des differ
diff --git a/examples/2-full_domain/mesh/pic.des b/examples/2-full_domain/mesh/pic.des
new file mode 100644
index 0000000..7fed3c9
Binary files /dev/null and b/examples/2-full_domain/mesh/pic.des differ
diff --git a/examples/3-stratified_junction/case5/case5.xml b/examples/3-stratified_junction/case5/case5.xml
new file mode 100644
index 0000000..b1ba5da
--- /dev/null
+++ b/examples/3-stratified_junction/case5/case5.xml
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="utf-8"?><Code_Saturne_GUI case="CASE5" study="STRATIFIED_JUNCTION" version="1.0">
+ <solution_domain>
+ <volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" scalar_source_term="off" thermal_source_term="off">all[]</zone>
+ </volumic_conditions>
+ <meshes_list>
+ <mesh format="des" name="sn_total.des"/>
+ </meshes_list>
+ <join_meshes status="off"/>
+ <faces_cutting status="off"/>
+ <reorientation status="off"/>
+ <syrthes_coupling status="off"/>
+ <periodic_boundary/>
+ <standalone/>
+ </solution_domain>
+ <thermophysical_models>
+ <velocity_pressure>
+ <variable label="Pression" name="pressure">
+ <reference_pressure>101325</reference_pressure>
+ </variable>
+ <variable label="VitesseX" name="velocity_U">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseY" name="velocity_V">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <variable label="VitesseZ" name="velocity_W">
+ <blending_factor>1</blending_factor>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>
+ <ale_method status="off"/>
+ <turbulence model="k-epsilon">
+ <variable label="EnerTurb" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="visc. tu" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>0.03183</reference_velocity>
+ </initialization>
+ <scale_model>1</scale_model>
+ <gravity_terms status="on"/>
+ </turbulence>
+ <thermal_scalar model="temperature_celsius">
+ <property label="Flux_thermique_entrant" name="input_thermal_flux" support="boundary"/>
+ </thermal_scalar>
+ <radiative_transfer model="off"/>
+ <gas_combustion model="off"/>
+ <pulverized_coal model="off"/>
+ <joule_effect model="off"/>
+ <atmospheric_flows model="off">
+ <read_meteo_data status="off"/>
+ </atmospheric_flows>
+ </thermophysical_models>
+ <numerical_parameters>
+ <multigrid status="on"/>
+ <gradient_transposed status="on"/>
+ <velocity_pressure_coupling status="off"/>
+ <pressure_relaxation>1</pressure_relaxation>
+ <wall_pressure_extrapolation>0</wall_pressure_extrapolation>
+ <gradient_reconstruction choice="0"/>
+ </numerical_parameters>
+ <physical_properties>
+ <fluid_properties>
+ <property choice="variable" label="Masse vo" name="density">
+ <initial_value>998.671</initial_value>
+ </property>
+ <property choice="variable" label="Visc. la" name="molecular_viscosity">
+ <initial_value>4.45e-05</initial_value>
+ </property>
+ <property choice="constant" label="Ch.spec." name="specific_heat">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>4182.88</initial_value>
+ </property>
+ <property choice="constant" label="Cond. th" name="thermal_conductivity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>0.601498</initial_value>
+ </property>
+ </fluid_properties>
+ <gravity>
+ <gravity_x>0</gravity_x>
+ <gravity_y>0</gravity_y>
+ <gravity_z>-9.81</gravity_z>
+ </gravity>
+ <hydrostatic_pressure status="on"/>
+ </physical_properties>
+ <additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">38.5</initial_value>
+ <min_value>18.26</min_value>
+ <max_value>38.5</max_value>
+ <blending_factor>1</blending_factor>
+ </scalar>
+ </additional_scalars>
+ <boundary_conditions>
+ <boundary label="cold_inlet" name="1" nature="inlet">2</boundary>
+ <inlet label="cold_inlet">
+ <velocity_pressure choice="norm" direction="normal">
+ <norm>0.03183</norm>
+ <direction_x>0</direction_x>
+ <direction_y>0</direction_y>
+ <direction_z>0</direction_z>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>0.4</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="Temp.C" name="temperature_celsius" type="thermal">
+ <dirichlet>18.6</dirichlet>
+ </scalar>
+ </inlet>
+ <boundary label="hot_inlet" name="2" nature="inlet">6</boundary>
+ <inlet label="hot_inlet">
+ <velocity_pressure choice="norm" direction="normal">
+ <norm>0.03183</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>0.4</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="Temp.C" name="temperature_celsius" type="thermal">
+ <dirichlet>38.5</dirichlet>
+ </scalar>
+ </inlet>
+ <boundary label="wall" name="3" nature="wall">5</boundary>
+ <wall label="wall">
+ <velocity_pressure choice="off">
+ <dirichlet name="velocity_U">0</dirichlet>
+ <dirichlet name="velocity_V">0</dirichlet>
+ <dirichlet name="velocity_W">0</dirichlet>
+ </velocity_pressure>
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ </wall>
+ <boundary label="outlet" name="5" nature="outlet">7</boundary>
+ <outlet label="outlet">
+ <scalar choice="neumann" label="Temp.C" name="temperature_celsius" type="thermal">
+ <neumann>0</neumann>
+ </scalar>
+ </outlet>
+ <variable/>
+ </boundary_conditions>
+ <analysis_control>
+ <output>
+ <postprocessing_mesh_options choice="0"/>
+ <postprocessing_format choice="EnSight"/>
+ <postprocessing_options choice="binary"/>
+ <listing_printing_frequency>1</listing_printing_frequency>
+ <postprocessing_frequency>10</postprocessing_frequency>
+ <probe_recording_frequency>1</probe_recording_frequency>
+ <fluid_domain status="on"/>
+ <domain_boundary status="off"/>
+ <probe name="1" status="on">
+ <probe_x>0.010025</probe_x>
+ <probe_y>0.01534</probe_y>
+ <probe_z>-0.011765</probe_z>
+ </probe>
+ <probe name="2" status="on">
+ <probe_x>1.625</probe_x>
+ <probe_y>0.01534</probe_y>
+ <probe_z>-0.031652</probe_z>
+ </probe>
+ <probe name="3" status="on">
+ <probe_x>3.225</probe_x>
+ <probe_y>0.01534</probe_y>
+ <probe_z>-0.031652</probe_z>
+ </probe>
+ <probe name="4" status="on">
+ <probe_x>3.8726</probe_x>
+ <probe_y>0.047481</probe_y>
+ <probe_z>7.25</probe_z>
+ </probe>
+ </output>
+ <time_parameters>
+ <property label="Nb Courant" name="courant_number"/>
+ <property label="Nb Fourier" name="fourier_number"/>
+ <time_step_ref>1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>1</time_passing>
+ <thermal_time_step status="on"/>
+ <zero_time_step status="off"/>
+ <property label="pdtlocal" name="local_time_step"/>
+ <max_courant_num>20</max_courant_num>
+ <max_fourier_num>60</max_fourier_num>
+ <time_step_min>0.01</time_step_min>
+ <time_step_max>70</time_step_max>
+ <time_step_var>0.1</time_step_var>
+ </time_parameters>
+ <steady_management status="off"/>
+ <time_averages/>
+ <profiles/>
+ </analysis_control>
+ <calcul_management>
+ <start_restart>
+ <restart status="off"/>
+ <frozen_field status="off"/>
+ </start_restart>
+ <integer_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </integer_user_array>
+ <real_user_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </real_user_array>
+ <integer_work_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </integer_work_array>
+ <real_work_array>
+ <ncelet>0</ncelet>
+ <nfac>0</nfac>
+ <nfabor>0</nfabor>
+ <dimless>0</dimless>
+ </real_work_array>
+ </calcul_management>
+ <lagrangian model="off"/>
+</Code_Saturne_GUI>
diff --git a/examples/3-stratified_junction/case5/runcase b/examples/3-stratified_junction/case5/runcase
new file mode 100755
index 0000000..3f4de8a
--- /dev/null
+++ b/examples/3-stratified_junction/case5/runcase
@@ -0,0 +1,1125 @@
+#!/bin/sh
+# bin/runcase. Generated from runcase.in by configure.
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+########################################################################
+#
+# BATCH FILE FOR THE CCRT (Platine under LSF)
+# ===========================================
+#
+#BSUB -n 2
+#BSUB -W 00:30
+#BSUB -o stratified_junctioncaseo.%J
+#BSUB -e stratified_junctioncasee.%J
+#BSUB -J stratified_junctioncase
+#
+# -n : number of processors
+# -W : walltime as hh:mm
+# -o : output file name
+# -e : error file name
+# -J : job name
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE FOR THE Chatou CLUSTER (PBS)
+# =======================================
+#
+#PBS -l nodes=4:ppn=2
+#PBS -l walltime=1:00:00
+#PBS -l mem=320mb
+#
+#PBS -j eo
+#PBS -N stratified_junctioncase5
+#
+# nodes : number of nodes
+# ppn : number of process per node
+# walltime : wall clock time (hh:mm:ss)
+# mem : memory
+#
+#WARNING: when coupling with SYRTHES, 1 processor will be reserved for each
+# instance of SYRTHES. The Kernel will be executed on the remaining
+# processors, so make sure to reserve a sufficiently high number
+# of processors.
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (University of Manchester Cluster)
+# =============================================
+#
+# set the name of the job
+##$ -N stratified_junctioncase5
+#
+# request between 2 and 4 slots
+##$ -pe mpich 2-4
+#
+# Execute the job from the current working directory
+# Job output will appear in this directory
+##$ -cwd
+# can use -o dirname to redirect stdout
+# can use -e dirname to redirect stderr
+
+# Export these environment variables
+##$ -v MPI_HOME
+
+#set -x
+#
+# ------------------------------------------------------------------
+#
+# BATCH FILE (AIX, Loadlever)
+# ===========================
+#
+#@ shell = /bin/sh
+#
+#@ job_name = stratified_junctioncase5
+#
+#@ job_type = parallel
+#@ cpus = 128
+#@ node_usage = not_shared
+#
+#@ network.MPI = csss,shared,US
+#@ bulkxfer = yes
+#
+#@ wall_clock_limit = 00:20:00
+#@ account_no = z001
+#
+#@ output = $(job_name).$(schedd_host).$(jobid).out
+#@ error = $(job_name).$(schedd_host).$(jobid).err
+#@ notification = never
+#
+#@ queue
+# suggested environment settings:
+# export MP_EAGER_LIMIT=65536
+# export MP_SHARED_MEMORY=yes
+# export MEMORY_AFFINITY=MCM
+# export MP_TASK_AFFINITY=MCM
+#
+########################################################################
+#
+# BEGINNING OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+# runcase.help gives more details about the different variables.
+#
+# -------------------------------
+#
+SOLCOM=0
+#
+# On some systems, some external libraries may require TERM to be defined.
+export TERM=xterm
+#
+STUDY=STRATIFIED_JUNCTION
+CASE=CASE5
+PARAM=case5.xml
+MESH=sn_total.des
+COMMAND_REORIENT=
+COMMAND_JOIN=
+COMMAND_CWF=
+COMMAND_PERIO=
+THERMOCHEMISTRY_DATA=
+METEO_DATA=
+#
+# Choose the total number of processors used (if empty, automatic detection
+# through the batch system if possible, set to 1 otherwise).
+# When coupling with SYRTHES with COUPLING_MODE=MPI, the 1st processor is
+# used by SYRTHES, so the effective number of processors assigned to the
+# Kernel is reduced by 1.
+# The processors list is only usable when not running on a batch system
+# (as such a system usually already defines a similar list)
+NUMBER_OF_PROCESSORS=
+PROCESSOR_LIST=
+#
+PARTITION_LIST=
+#
+USER_INPUT_FILES=""
+USER_OUTPUT_FILES=""
+#
+# Working directory (leave empty for automatic default directory)
+CS_TMP_PREFIX=
+#CS_TMP_PREFIX=/local00/users/`whoami`
+#
+CS_LIB_ADD=
+VALGRIND=
+#
+ARG_CS_VERIF=""
+ARG_CS_OUTPUT=""
+#
+# Adaptation using HOMARD
+ADAPTATION=
+#
+summary=summary
+CASEDIR=/home/saturne/TEST_CASE/STRATIFIED_JUNCTION/CASE5
+DATA=$CASEDIR/DATA
+RESU=$CASEDIR/RESU
+SRC=$CASEDIR/SRC
+SCRIPTS=$CASEDIR/SCRIPTS
+RESTART_IN=$DATA/RESTART
+PREPROCESSOR_OUTPUT_IN=$DATA/preprocessor_output
+PARTITION_OUTPUT_IN=$DATA/PARTITION_OUTPUT
+MESHDIR=$CASEDIR/../MESH
+#
+# The following variables are only used in case of coupling with SYRTHES.
+# DATA_SYR: directory where to find SYRTHES_ENV
+# SRC_SYR: directory where to find possible user source files
+DATA_SYR=$CASEDIR/DATA_SYR
+SRC_SYR=$CASEDIR/SRC_SYR
+SYRTHES_ENV=syrthes.env
+#
+# The possible coupling mode with SYRTHES may be chosen here.
+#
+# COUPLING_MODE=MPI : should work on most machines.
+# COUPLING_MODE=sockets : should be activated on clusters when the MPI rank
+# of a process is not determinable or if MPI can
+# not be used.
+COUPLING_MODE=MPI
+ECHO_SYR_COMM=""
+#
+# Indicate which steps should be executed; if both the Preprocessor and the
+# Kernel are executed, the "preprocessor_output" and eventual "domain_number_*"
+# files are not saved. If only the preprocessor and / or partitioner are
+# executed, the corresponding files will be saved in a RESU/PREPROCESSOR_OUTPUT
+# and RESU/PARTITION directory. If the Preprocessor is not executed,
+# "preprocessor_output" will be read from $PREPROCESSOR_OUTPUT_IN. If the
+# Partitioner is not executed, "domain_number_*" will be read from
+# $PARTITION_OUTPUT_IN if available (otherwise, unoptimized default
+# partitioning will be used).
+#
+# EXEC_PREPROCESS : should the Preprocessor be run ? (yes/no)
+# EXEC_PARTITION : should the Partitioner be run ? (yes/no)
+# EXEC_KERNEL : should the Kernel be run ? (yes/no)
+#
+EXEC_PREPROCESS=yes
+EXEC_PARTITION=yes
+EXEC_KERNEL=yes
+#
+#
+#
+########################################################################
+#
+# END OF USER MODIFIABLE ZONE FOR STANDARD CALCULATIONS
+#
+########################################################################
+#
+# Kernel installation parameters
+#
+prefix=/home/saturne/Code_Saturne/2.0-beta2/arch/Linux_x86_64
+#
+exec_prefix=${prefix}
+bindir=${exec_prefix}/bin
+datarootdir=${prefix}/share
+datadir=${datarootdir}
+pkgdatadir=${datadir}/ncs
+#
+# Preprocessor installation parameters
+#
+ecs_prefix=
+#
+ecs_exec_prefix=${ecs_prefix}
+ecs_bindir=${ecs_exec_prefix}/bin
+#
+# HOMARD installation parameters (to be completed if needed)
+#
+homard_prefix=
+#
+########################################################################
+# Mesh Adaptation
+#
+if [ ! -z "${ADAPTATION}" ] ; then
+ if [ "${ADAPTATION}" = "-help" ] ; then
+ ${homard_prefix}/saturne_homard ${ADAPTATION}
+ exit 0
+ else
+ HOMARD_options=" -v"
+ ${homard_prefix}/saturne_homard -Saturne_Script $0 -Donnees_Calcul $CASEDIR \
+ -Pilotage_Adaptation $ADAPTATION $HOMARD_options || exit 1
+ fi
+fi
+#
+#########################################################################
+#
+N_SYRTHES_COUPLINGS=0
+if [ -f "${SRC}/ussyrc.f90" ] ; then
+ N_SYRTHES_COUPLINGS=`grep -e ^' ' ${SRC}/ussyrc.f90 | grep -i -c defsyr`
+fi
+#
+if [ $N_SYRTHES_COUPLINGS = 0 ] ; then
+ SYRTHES_COUPLING=no
+else
+ SYRTHES_COUPLING=yes
+ export SYRTHES
+ if [ $N_SYRTHES_COUPLINGS -gt 1 ] ; then
+ echo "This script can not handle multiple couplings with SYRTHES"
+ echo "Number of SYRTHES couplings requested: $N_SYRTHES_COUPLINGS"
+ fi
+fi
+#
+if [ $SYRTHES_COUPLING = yes ] ; then
+ if [ $SOLCOM -eq 1 ] ; then
+ echo "SYRTHES coupling is not compatible with SOLCOM-type meshes"
+ exit 1
+ fi
+else
+ COUPLING_MODE=
+fi
+#
+########################################################################
+#
+# Parameters for execution
+#
+# General variables
+THISSCRIPT=$0
+USER=`whoami`
+DATE=`date '+%m%d%H%M'`
+SUFFIX=$DATE
+EXE=cs_solver
+EXE_SYR=syrthes
+#
+# Copy runcase before changing to the working directory
+# (as after that, the relative path will not be up to date).
+#
+cp $0 $RESU/runcase.$SUFFIX
+#
+# Execution directory (reachable by all the processors)
+#
+if [ ! -z "$CS_TMP_PREFIX" ] ; then
+ RUN=${CS_TMP_PREFIX}/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+else
+# Default if not specified by the user
+#
+# On the CCRT, there is no TMPDIR. We work by default in SCRATCHDIR
+ if [ "$SCRATCHDIR" != "" ] ; then
+ RUN=$SCRATCHDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+#
+ elif [ "$TMPDIR" != "" -a "$TMPDIR" != "/tmp" ] ; then
+ RUN=$TMPDIR/tmp_Saturne/$STUDY.$CASE.$DATE
+ else
+ RUN=$HOME/tmp_Saturne/$STUDY.$CASE.$DATE
+ fi
+fi
+#
+# Create directory if necessary
+if [ "$RUN" != "$TMPDIR" ] ; then
+ if [ ! -d $RUN ] ; then
+ mkdir -p $RUN || exit 1
+ else
+ echo "RUN=$RUN already exists."
+ echo "The simulation will not be run."
+ exit 1
+ fi
+fi
+#
+# Create a temporary file for Salome (equivalent to "ficstp")
+if [ "$ARG_CS_OUTPUT" = "--log 0" ] ; then
+ echo $RUN > $SCRIPTS/runningstd.$DATE
+else
+ echo $RUN > $SCRIPTS/runningext.$DATE
+fi
+#
+cd $RUN
+#
+########################################################################
+#
+# Set up MPI environment
+#
+# Use makefile query to obtain the path to MPI binaries if those are
+# not on the default path. This is a peculiar use of make, but allows
+# us to avoid defining the MPI configuration in multiple files.
+
+CS_MPI_PATH=/home/saturne/opt/openmpi-1.3.1/arch/Linux_x86_64/bin
+
+# NUMBER_OF_PROCESSORS is determined here if not already set;
+# MPIHOSTS, MPIRUN, MPIBOOT, MPIHALT, and NUMBER_OF_NODES are
+# defined by the sourced script, and PATH may be updated.
+#
+. ${pkgdatadir}/runcase_mpi_env
+#
+# Check for the number of requested processors
+nproc_kernel="${NUMBER_OF_PROCESSORS}"
+echo
+echo
+if [ $SYRTHES_COUPLING = yes ] ; then
+ echo "Coupling of Code_Saturne and SYRTHES activated."
+ # 1 processor is reserved for SYRTHES if coupled through MPI.
+ if [ "$COUPLING_MODE" = "MPI" ] ; then
+ (( nproc_kernel = nproc_kernel - N_SYRTHES_COUPLINGS ))
+ if [ $nproc_kernel -lt 1 ] ; then
+ echo
+ echo
+ echo " Warning, if COUPLING_MODE = MPI, SYRTHES reserves 1 processor"
+ echo " (which need not be a physical processor)."
+ echo " Here, NUMBER_OF_PROCESSORS=${NUMBER_OF_PROCESSORS}, while it must"
+ echo " be strictly greater than 1."
+ echo " Increase the number of requested processors."
+ echo
+ exit 1
+ fi
+ fi
+fi
+if [ $nproc_kernel -gt 1 ] ; then
+ echo "Parallel Code_Saturne with partitioning in $nproc_kernel sub-domains"
+ if [ $SOLCOM = 1 ] ; then
+ echo
+ echo
+ echo " Parallel run impossible with SOLCOM = $SOLCOM "
+ echo " Use SOLCOM = 0 "
+ echo
+ exit 1
+ fi
+else
+ echo "Single processor Code_Saturne simulation"
+fi
+if [ ! -z "$MPIHOSTS" ] ; then
+ echo "Total number of processors: $NUMBER_OF_PROCESSORS"
+fi
+#
+# In parallel mode, the corresponding argument must be set
+if [ $nproc_kernel -gt 1 ] ; then
+ ARG_CS_MPI=" --mpi"
+else
+ ARG_CS_MPI=""
+fi
+#
+#
+########################################################################
+#
+# Communications
+#
+# To help debug coupling problems, make communication more verbose
+if [ ! -z "$ECHO_SYR_COMM" ] ; then
+ ECHOCOMMSYR="-echo-comm $ECHO_SYR_COMM"
+else
+ ECHOCOMMSYR=""
+fi
+########################################################################
+# Greeting message
+#
+echo ' '
+echo ' Code_Saturne is running '
+echo ' *********************** '
+echo ' '
+echo ' Working directory (to be periodically cleaned) : '
+echo ' ' $RUN
+#
+########################################################################
+#
+# Compilation and link
+#
+# Note: we also check the for the presence of certain user subroutines here.
+#
+echo
+echo ' Kernel version: ' $prefix
+echo ' Preprocessor version: ' $ecs_prefix
+
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ cur_dir=`pwd`
+
+ source_cas=$SRC
+
+ #
+ # Copy of the parameter file
+ if [ ! -z "$PARAM" ] ; then
+ var=$DATA/$PARAM
+ if [ -f $var ] ; then
+ COMMAND_PARAM="--param $PARAM"
+ cp $var .
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The parameters file ' $var
+ echo ' can not be accessed.'
+ exit 1
+ fi
+ fi
+
+ src_files=`ls ${source_cas}/*.[fF]90 ${source_cas}/*.[ch] 2>/dev/null`
+
+ if [ ! -z "${src_files}" ] ; then
+
+ echo
+ echo " ***************************************************************"
+ echo " Compilation of user subroutines and linking of Code_Saturne"
+ echo " ***************************************************************"
+
+ if [ -f compil.log ] ; then
+ rm -f compil.log
+ fi
+
+ src_dir="src_saturne"
+
+ # Copy of the user source files
+ # (no links: the directory is copied later)
+ mkdir ${src_dir}
+ for f in ${src_files} ; do
+ if [ -f $f ] ; then
+ cp ${f} ${src_dir}/
+ fi
+ done
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --source=$src_dir --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ # Compilation
+ if [ ! -z "${CS_LIB_ADD}" ] ; then
+ OPTLIBS="--opt-libs=${CS_LIB_ADD}"
+ fi
+ ${bindir}/cs compile \
+ --source=$src_dir ${OPTLIBS} 2>>$cur_dir/compil.log 1>&2
+ if [ $? -ne 0 ]
+ then
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ echo "COMPILE OR LINK ERROR"
+ rm -f *.o
+ exit 1
+ else
+ cp $cur_dir/compil.log $RESU/compil.log.$SUFFIX
+ fi
+
+ else
+
+ # Detect presence and test for compatibility of modules.
+ if [ ! -z "$PARAM" ] ; then
+ ${bindir}/cs check_consistency --param=$PARAM --nproc=$nproc_kernel
+ else
+ ${bindir}/cs check_consistency --nproc=$nproc_kernel
+ fi
+ if [ $? = 1 ] ; then
+ exit 1
+ fi
+
+ ln -s ${bindir}/$EXE .
+
+ fi
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+
+ ${pkgdatadir}/runcase_syrthes -compile \
+ -cs-bindir=${bindir} -src-syr=${SRC_SYR} \
+ -src-copy=${RESU}/SRC_SYR.${SUFFIX} -log=${RESU}/compil_syrthes.log.${SUFFIX}
+
+ fi
+
+fi # EXEC_KERNEL = yes
+
+#
+########################################################################
+#
+# Data setup
+#
+echo
+echo " ********************************************"
+echo " Preparing calculation "
+echo " ********************************************"
+echo
+#
+ERROR=false
+PREPROCESS_ERROR=false
+PARTITION_ERROR=false
+EXECUTION_ERROR=false
+#
+if [ $SOLCOM = 1 ]
+then
+ EXEC_PREPROCESS=no
+ EXEC_PARTITION=no
+ ln -s $MESHDIR/$MESH geomet || exit 1
+fi
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ]
+then
+ for var in $MESH ; do
+ ln -s $MESHDIR/$var $var || exit 1
+ # Special case for meshes in EnSight format: link to .geo file necessary
+ # (retrieve name through .case file)
+ var2=`basename $var .case`
+ if [ $var2 != $var ] ; then
+ ficgeo_ensight=`awk '/^model:/ {print $2}' $var`
+ ln -s $MESHDIR/$ficgeo_ensight $ficgeo_ensight || FIN
+ fi
+ done
+else
+ if [ -f ${PREPROCESSOR_OUTPUT_IN} ] ; then
+ ln -s ${PREPROCESSOR_OUTPUT_IN} preprocessor_output || exit 1
+ else
+ echo "Error: no preprocessor output file is available;"
+ echo " (${PREPROCESSOR_OUTPUT_IN} does not exist."
+ echo " or is not a standard file."
+ exit 1
+ fi
+fi
+#
+if [ $nproc_kernel -eq 1 -a "${EXEC_KERNEL}" = "yes" ] ; then
+ EXEC_PARTITION=no
+elif [ "${EXEC_PARTITION}" = "no" -a "${PARTITION_OUTPUT_IN}" != "" ]
+then
+ if [ -f ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} ] ; then
+ ln -s ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel} .
+ else
+ echo "Warning: no partitioning file is available;"
+ echo " (no ${PARTITION_OUTPUT_IN}/domain_number_${nproc_kernel})."
+ echo
+ echo " Unoptimized partitioning will be used."
+ echo " Parallel performance may be degraded."
+ fi
+fi
+#
+if [ "${EXEC_KERNEL}" = "yes" ] ; then
+
+ for var in ${RESTART_IN}/* ; do
+ if [ -f $var ] ; then
+ varb=`basename $var`
+ if [ $varb = suiava ] ; then
+ vara=suiamo
+ elif [ $varb = suiavx ] ; then
+ vara=suiamx
+ elif [ $varb = vorava ] ; then
+ vara=voramo
+ elif [ $varb = t1dava ] ; then
+ vara=t1damo
+ elif [ $varb = rayava ] ; then
+ vara=rayamo
+ elif [ $varb = lagava ] ; then
+ vara=lagamo
+ elif [ $varb = lasava ] ; then
+ vara=lasamo
+ else
+ vara=$varb
+ fi
+ ln -s $var $vara
+ fi
+ done
+ #
+ if [ "$THERMOCHEMISTRY_DATA" != "" ] ; then
+ var=$DATA/$THERMOCHEMISTRY_DATA
+ if [ -f $var ] ; then
+ cp $var dp_tch
+ # Copy so as to have correct name upon backup
+ if [ "$THERMOCHEMISTRY_DATA" != "dp_tch" ] ; then
+ cp dp_tch $THERMOCHEMISTRY_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The thermochemistry file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ if [ "$METEO_DATA" != "" ] ; then
+ var=$DATA/$METEO_DATA
+ if [ -f $var ] ; then
+ cp $var meteo
+ # Copy so as to have correct name upon backup
+ if [ "$METEO_DATA" != "meteo" ] ; then
+ cp meteo $METEO_DATA
+ fi
+ else
+ echo ' '
+ echo ' -- ERROR -- '
+ echo ' The meteo profile file ' $var
+ echo ' can not be accessed. '
+ exit 1
+ fi
+ fi
+ #
+ for f in uscpcl.f90 usd3pc.f90 usebuc.f90 uslwcc.f90 usfucl.f90
+ do
+ if [ -f "${SRC}/${f}" -a ! -f JANAF ] ; then
+ cp ${datadir}/data/thch/JANAF JANAF
+ fi
+ done
+ #
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ #
+ ${pkgdatadir}/runcase_syrthes -copy-data -syrthes-env=${DATA_SYR}/$SYRTHES_ENV
+ #
+ fi
+ #
+ if [ ! -z "$USER_INPUT_FILES" ] ; then
+ for f in $USER_INPUT_FILES ; do
+ cp $DATA/$f .
+ done
+ fi
+ #
+fi # EXEC_KERNEL = yes
+
+########################################################################
+# Maximum time for PBS (done here so as to leave time for PBS to
+# realize that things have started).
+#
+if [ "$PBS_JOBID" != "" ] ; then
+ CS_MAXTIME=`qstat -r $PBS_JOBID | grep $PBS_JOBID | sed -e's/ \{1,\}/ /g' | cut -d ' ' -f 9`
+ export CS_MAXTIME
+fi
+#
+########################################################################
+#
+# Summary: start
+#
+CURDATE=`unset LANG ; date`
+#
+echo '========================================================'>>$summary
+echo ' Start time : ' $CURDATE >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Kernel : ' $prefix >>$summary
+echo ' Preprocessor : ' $ecs_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' HOMARD : ' $homard_prefix >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' CS_MPI_PATH : ' $CS_MPI_PATH >>$summary
+echo ' PATH : ' $PATH >>$summary
+echo ' ------------------------------------------------ ' >>$summary
+echo ' User : ' $USER >>$summary
+echo '========================================================'>>$summary
+echo ' Machine : ' >>$summary
+ uname -a >>$summary
+if [ -z "$NUMBER_OF_PROCESSORS" ] ; then
+ echo ' N Procs : ' 1 >>$summary
+else
+ echo ' N Procs : ' $NUMBER_OF_PROCESSORS >>$summary
+fi
+if [ -z "$PROCESSOR_LIST" ] ; then
+ echo ' Processors : ' default >>$summary
+else
+ echo ' Processors : ' $PROCESSOR_LIST >>$summary
+fi
+echo '========================================================'>>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Case : ' $CASE >>$summary
+echo ' DATA : ' $DATA >>$summary
+echo ' SRC : ' $SRC >>$summary
+echo ' RESU : ' $RESU >>$summary
+echo ' ----------------------------------------------------' >>$summary
+echo ' Exec. dir. : ' $RUN >>$summary
+echo ' ----------------------------------------------------' >>$summary
+if [ "$EXEC_PREPROCESSOR" = "yes" ] ; then
+ echo ' Preprocessor : ' ${ecs_bindir}/cs_preprocess >>$summary
+fi
+if [ "$EXEC_PARTITION" = "yes" ] ; then
+ echo ' Partitioner : ' ${ecs_bindir}/cs_partition >>$summary
+fi
+if [ "$EXEC_KERNEL" = "yes" ] ; then
+ echo ' Executable : ' $EXE >>$summary
+fi
+echo ' ----------------------------------------------------' >>$summary
+#
+# Execution
+echo
+echo " ********************************************"
+echo " Starting calculation"
+echo " ********************************************"
+echo
+#
+# Preprocessor start
+#
+if [ "${EXEC_PREPROCESS}" = "yes" ] ; then
+ #
+ ${ecs_bindir}/cs_preprocess --mesh $MESH "--case" $CASE \
+ $COMMAND_REORIENT $COMMAND_JOIN $COMMAND_PERIO \
+ > listpre 2>&1
+ if [ $? != 0 ] ; then
+ echo "Error running the preprocessor."
+ echo "Check preprocessor log (listpre) for details."
+ echo
+ PREPROCESS_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PREPROCESSOR_OUTPUT_OUT=$RESU/preprocessor_output.$SUFFIX
+ cp preprocessor_output ${PREPROCESSOR_OUTPUT_OUT}
+ fi
+ #
+fi
+#
+# Partitioner start
+#
+if [ ! -f ${ecs_bindir}/cs_partition ] ; then
+ echo "Warning: ${ecs_bindir}/cs_partition not found."
+ echo
+ echo "The partitioner may not have been installed"
+ echo " (this is the case if neither METIS nor."
+ echo " SCOTCH are avaialable)."
+ echo
+ echo "Unoptimized partitioning will be used, so"
+ echo "parallel performance may be degraded."
+ echo
+ EXEC_PARTITION=no
+fi
+#
+if [ "${EXEC_PARTITION}" = "yes" ] ; then
+ #
+ if [ "${EXEC_KERNEL}" = "yes" ] ; then
+ ${ecs_bindir}/cs_partition $nproc_kernel > listpart 2>&1
+ else
+ if [ -z "$PARTITION_LIST" ] ; then
+ echo "Error running the partitioner."
+ echo "PARTITION_LIST is not set."
+ echo "This variable should contain the number of processors"
+ echo "for which we partition (or a list of such numbers)."
+ PARTITION_ERROR=true
+ ERROR=true
+ else
+ ${ecs_bindir}/cs_partition $PARTITION_LIST > listpart 2>&1
+ fi
+ fi
+ if [ $? != 0 -a $PARTITION_ERROR = false ] ; then
+ echo "Error running the partitioner."
+ echo "Check partitioner log (listpart) for details."
+ echo
+ PARTITION_ERROR=true
+ ERROR=true
+ fi
+ #
+ if [ "${EXEC_KERNEL}" = "no" ] ; then
+ #
+ PARTITION_OUTPUT_OUT=$RESU/PARTITION_OUTPUT.$SUFFIX
+ mkdir $PARTITION_OUTPUT_OUT
+ cp -r domain_number_* ${PARTITION_OUTPUT_OUT}/
+ fi
+#
+fi
+#
+# Run calculation proper.
+#
+if [ "$ERROR" != "true" -a "$EXEC_KERNEL" = "yes" ] ; then
+#
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ # MPI Communication
+ #
+ # Make sure to transmit possible additional arguments assigned by mpirun to
+ # the executable with some MPI-1 implementations (vanilla MPICH 1.2 sets the
+ # parameters needed by MPI_Init through argc/argv): we use $@ to forward
+ # arguments passed to localexec to the true executable files.
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo "MPI_RANK=\`${pkgdatadir}/runcase_mpi_rank \$@\`" >> $localexec
+ echo cd $RUN >> $localexec
+ echo "if [ \$MPI_RANK -eq 0 ] ; then" >> $localexec
+ echo " $RUN/$EXE_SYR \$@ -app-num 0 -comm-mpi 1 $ECHOCOMMSYR > listsyr 2>&1" >> $localexec
+ echo "else" >> $localexec
+ echo " $VALGRIND $RUN/$EXE \$@ --mpi 1 $COMMAND_CWF "\
+ "$ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM " >> $localexec
+ echo "fi" >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ #
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ elif [ $SYRTHES_COUPLING = yes ] ; then
+ # Socket communications
+ #
+ # We provide the executables with a "random" port number.
+ PORT=35623
+ SOCKETNCS="--syr-socket $PORT"
+ SOCKETSYR="-comm-socket $PORT"
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI $COMMAND_CWF "\
+ " $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM $SOCKETNCS " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true &
+ #
+ ./$EXE_SYR $ECHOCOMMSYR $SOCKETSYR > listsyr 2>&1
+ #
+ $MPIHALT
+ #
+ elif [ $SOLCOM = 0 ] ; then
+ #
+ localexec=$RUN/localexec
+ echo '#!/bin/sh' > $localexec
+ echo cd $RUN >> $localexec
+ echo "$VALGRIND $RUN/$EXE \$@ $ARG_CS_MPI "\
+ " $COMMAND_CWF $ARG_CS_VERIF $ARG_CS_OUTPUT "\
+ " $COMMAND_PARAM " >> $localexec
+ echo "retour=\$?" >> $localexec
+ echo "exit \$retour" >> $localexec
+ chmod 700 $localexec
+ $MPIBOOT
+ $MPIRUN $localexec || EXECUTION_ERROR=true
+ $MPIHALT
+ #
+ else # cas SOLCOM = 1
+ #
+ $VALGRIND $RUN/$EXE --solcom \
+ $ARG_CS_VERIF $ARG_CS_OUTPUT $COMMAND_PARAM \
+ || EXECUTION_ERROR=true
+ #
+ fi
+#
+fi
+#
+# Remove the Salome temporary files
+rm -f $SCRIPTS/running*.$DATE
+#
+########################################################################
+#
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ if [ "$SYRTHES_COUPLING" = "yes" -a "$COUPLING_MODE" = "MPI" ] ; then
+ echo "Error running the coupled calculation."
+ echo "Either the Kernel or SYRTHES may have failed."
+ echo
+ echo "Check Kernel log (listing) and SYRTHES log (listsyr) for details,"
+ echo "as well as eventual error* files."
+ echo
+ else
+ echo "Error running the calculation."
+ echo
+ echo "Check Kernel log (listing) and error* files for details"
+ echo
+ fi
+ ERROR=true
+fi
+#
+# Treatment of the ouput files:
+# Starts with the restart files
+# (in case of full disk, increases chances of being able to continue).
+#
+if [ $EXEC_KERNEL = yes ] ; then
+
+ RESTART_OUT=$RESU/RESTART.$SUFFIX
+ iok=1
+ mkdir ${RESTART_OUT} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f ${RESTART_OUT}
+ fi
+ done
+ else
+ for f in suiava suiavx t1dava vorava rayava lagava* lasava* ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+
+ resuser=0
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ resuser=1
+ fi
+ done
+ if [ ${resuser} = 1 ] ; then
+ RES_USER=$RESU/RES_USER.$SUFFIX
+ iok=1
+ mkdir ${RES_USER} || iok=0
+ if [ $iok = 1 ] ; then
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f ${RES_USER}
+ fi
+ done
+ else
+ for f in ${USER_OUTPUT_FILES} ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+ fi
+ fi
+
+ for f in $PARAM $THERMOCHEMISTRY_DATA $METEO_DATA ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+ done
+
+ for f in probes_*.dat ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+ for f in ush* ; do
+ if [ -f $f ] ; then
+ if [ ! -d $RESU/HIST.$SUFFIX ] ; then
+ mkdir $RESU/HIST.$SUFFIX
+ fi
+ cp $f $RESU/HIST.$SUFFIX
+ fi
+ done
+
+fi # output files
+
+for f in list* error* *.med *.cgns ; do
+ if [ -f $f ] ; then
+ cp $f $RESU/$f.$SUFFIX
+ fi
+done
+
+# Treatment of EnSight and MED files
+# The $dir (=*.ensight and/or *.med) directories are copied
+# to $DIR.$SUFFIX
+
+# We place directories $dir (=*.ensight and/or *.med)
+# in $DIR.$SUFFIX
+
+cas=`echo $CASE |tr "[:upper:]" "[:lower:]"`
+
+for dir in *.ensight *.med ; do
+ if [ -d $dir ] ; then
+ DIR=`echo $dir |tr "[:lower:]" "[:upper:]"`
+ mkdir $RESU/$DIR.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Creating $RESU/$DIR.$SUFFIX failed
+ else
+ for f in $dir/* ; do
+ if [ -f $f ] ; then
+ cp -R ${f} $RESU/$DIR.$SUFFIX/.
+ fi
+ done
+ fi
+ fi
+done
+
+if [ $EXEC_KERNEL = yes ] ; then
+
+ rayt_list=`ls bord* 2>/dev/null`
+ if [ ! -z "${rayt_list}" ] ; then
+ for f in $rayt_list ; do
+ if [ ! -d $RESU/CHR.$SUFFIX ] ; then
+ mkdir $RESU/CHR.$SUFFIX
+ fi
+ cp $f $RESU/CHR.$SUFFIX/.
+ done
+ fi
+
+ lagr_list=`ls debug* deplacement* trajectoire* frontiere* 2>/dev/null`
+ if [ ! -z "${lagr_list}" ] ; then
+ mkdir $RESU/LAGR.$SUFFIX
+ for f in $lagr_list ; do
+ cp $f $RESU/LAGR.$SUFFIX
+ done
+ fi
+
+ # Matisse output files
+ if [ -f ${RUN}/resuMatisse ] ; then
+ matisse=`grep -i matisse $DATA/$PARAM`
+ if [ ! -z "$matisse" ] ; then
+ # The date is added to the first line of resuMatisse
+ AFDATE="Date of the case : "$DATE
+ sed "1i\ ${AFDATE}" ${RUN}/resuMatisse >> ${RUN}/resuMatisse.mod
+ mv ${RUN}/resuMatisse.mod ${RUN}/resuMatisse
+ fi
+ cp ${RUN}/resuMatisse ${RESU}/resuMatisse.$SUFFIX
+ fi
+
+ for dir in src_saturne ; do
+ if [ -d $dir ] ; then
+ mkdir $RESU/SRC.$SUFFIX
+ if [ $? -ne 0 ] ; then
+ echo Failure creating $RESU/SRC.$SUFFIX
+ else
+ for f in $dir/*.[fF]90 $dir/*.[ch] ; do
+ if [ -f ${f} ] ; then
+ cp -R ${f} $RESU/SRC.$SUFFIX/.
+ fbase=`basename ${f}`
+ chmod a-w $RESU/SRC.$SUFFIX/${fbase}
+ fi
+ done
+ fi
+ fi
+ done
+
+ if [ $SYRTHES_COUPLING = yes ] ; then
+ ${pkgdatadir}/runcase_syrthes -copy-results \
+ -result-dir=${RESU}/RESU_SYR.${SUFFIX}
+ fi
+
+fi # input data and outputs
+#
+########################################################################
+#
+# Summary: end
+#
+if [ "$PREPROCESS_ERROR" = "true" ] ; then
+ EXEC_PREPROCESS="failed"
+fi
+echo " Preprocessing : " $EXEC_PREPROCESS >>$summary
+if [ "$PARTITION_ERROR" = "true" ] ; then
+ EXEC_PARTITION="failed"
+fi
+echo " Partitioning : " $EXEC_PARTITION >>$summary
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ EXEC_KERNEL="failed"
+fi
+echo " Calculation : " $EXEC_KERNEL >>$summary
+#
+CURDATE=`unset LANG ; date`
+#
+echo ' ----------------------------------------------------' >>$summary
+echo ' Finish time : ' $CURDATE >>$summary
+echo '========================================================'>>$summary
+#
+cp $summary $RESU/$summary.$SUFFIX
+#
+########################################################################
+#
+#
+# Finish
+#
+echo
+echo " ********************************************"
+if [ "$EXECUTION_ERROR" = "true" ] ; then
+ echo " Error in calculation stage."
+elif [ "$PARTITION_ERROR" = "true" ] ; then
+ echo " Error in partitioning stage."
+elif [ "$PREPROCESS_ERROR" = "true" ] ; then
+ echo " Error in preprocessing stage."
+else
+ echo " Normal simulation finish"
+fi
+echo " ********************************************"
+
+if [ "$ERROR" = "true" ] ; then
+ exit 1
+else
+ exit 0
+fi
+#
+########################################################################
diff --git a/examples/3-stratified_junction/case5/usdpst.f90 b/examples/3-stratified_junction/case5/usdpst.f90
new file mode 100644
index 0000000..5962aed
--- /dev/null
+++ b/examples/3-stratified_junction/case5/usdpst.f90
@@ -0,0 +1,403 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta1
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usdpst &
+!=================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LOCALISER DES CELLULES, DES FACES
+! INTERNES ET/OU DES FACES DE BORD DEFINISSANT UN MAILLAGE DE
+! POST-TRAITEMENT.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! lstcel ! te ! --- ! tableau de travail (liste des !
+! (ncelet) ! ! ! cellules d'un maillage de sortie) !
+! lstfac ! te ! --- ! tableau de travail (liste des faces !
+! (nfac) ! ! ! internes d'un maillage de sortie) !
+! lstfbr ! te ! --- ! tableau de travail (liste des faces !
+! (nfabor) ! ! ! de bord d'un maillage de sortie) !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelet), lstfac(nfac), lstfbr(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer indmod, icas, nbcas, ipart, nbpart, ipref
+integer ntchrl
+
+integer nlcel, nlfac , nlfbr
+integer iel, ifac , ii
+integer idebia, idebra
+integer icoul , icoul1, icoul2, iel1 , iel2
+character*32 nomcas, nomfmt, nommai
+character*96 nomrep, optfmt
+
+double precision xfac , yfac , zfac
+
+
+!===============================================================================
+
+
+
+nbcas = 0
+nbpart = 0
+
+! Entiers "pointeurs" sur la premiere case libre de IA et RA
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! CREATION DES GESTIONNAIRES D'ECRITURE POUR LE POST TRAITEMENT
+! (UN PAR CAS ET PAR FORMAT, A RENSEIGNER PAR L'UTILISATEUR)
+!===============================================================================
+
+! NOMBRE DE GESTIONNAIRES (case au sens EnSight, etude au sens MED,
+! ou racine d'une arborescence CGNS)
+
+nbcas = 1
+
+do icas = 1, nbcas
+
+! INITIALISATIONS DIVERSES
+
+ do ii = 1, len(nomcas)
+ NOMCAS (II:II) = ' '
+ enddo
+ do ii = 1, len(nomrep)
+ NOMREP (II:II) = ' '
+ enddo
+ do ii = 1, len(nomfmt)
+ NOMFMT (II:II) = ' '
+ enddo
+ do ii = 1, len(optfmt)
+ OPTFMT (II:II) = ' '
+ enddo
+
+! DEFINITION UTILISATEUR :
+
+! NOMCAS et NOMREP indiquent respectivement le prefixe du nom
+! des fichiers et le repertoire correspondant.
+! Si NOMREP est de la forme xxxx.ensight ou xxxx.med, le lanceur le
+! rapatriera automatiquement sous le nom XXXX.ENSIGHT.$DATE ou
+! XXXX.MED.$DATE dans le repertoire RESU. Si NOMREP est d'une autre
+! forme, il faudra gerer son rapatriement a la main.
+
+! NOMFMT permet de choisir le format de sortie
+! ("EnSight Gold", "MED_fichier", ou "CGNS").
+
+! OPTFMT permet de fournir des options specifiques au format de
+! sortie (separees par des virgules) ;
+! Pour EnSight : "text" ou "binary" (defaut),
+! Pour EnSight, MED, ou CGNS :
+! "discard_polygons" pour supprimer les polygones,
+! "discard_polyhedra" pour supprimer les polyedres.
+! Pour EnSight ou MED :
+! "divide_polygons" pour d�couper les polygones,
+! "divide_polyhedra" pour d�couper les polyedres.
+
+! INDMOD indique si les maillages ecrits seront :
+! 0 : fixes,
+! 1 : deformables a topologie constante,
+! 2 : modifiables (pourront etre completement redefinis en
+! cours de calcul via le sous-programme USMPST).
+! 10 : comme INDMOD = 0, avec champ de d�placement
+! 11 : comme INDMOD = 1, avec champ de d�placement
+! 12 : comme INDMOD = 2, avec champ de d�placement
+
+! NTCHRL donne la frequence de sortie par defaut associee,
+! (la sortie a un pas de temps donne pouvant etre forcee ou
+! empechee via le sous-programme utilisateur USNPST).
+
+ if (icas .eq. 1) then
+
+ NOMCAS = 'chr'
+ NOMREP = 'TINF21.ensight'
+ NOMFMT = 'EnSight Gold'
+ OPTFMT = 'binary, discard_polygons'
+ indmod = 2
+ ntchrl = 5
+
+ endif
+
+! DEFINITION EFFECTIVE
+
+ call pstcwr (icas , nomcas, nomrep, nomfmt, optfmt, &
+ !==========
+ indmod, ntchrl)
+
+enddo
+
+!===============================================================================
+! NOMBRE DE MAILLAGES EXTRAITS POUR POST TRAITEMENT
+! A RENSEIGNER PAR L'UTILISATEUR
+!===============================================================================
+
+! NBPART est le nombre de "parts" qui seront generees
+! (au sens EnSight ; les �quivalents MED et CGNS sont le maillage
+! et la base respectivement)
+
+! Une "part" peut etre tout volume ou surface que l'on definira par
+! l'identification des cellules ou faces du maillage
+
+
+nbpart = 2
+
+!===============================================================================
+! DEBUT DE LA BOUCLE SUR LES PARTS DEFINIES PAR L'UTILISATEUR
+!===============================================================================
+
+do ipart = 1, nbpart
+
+
+!===============================================================================
+! INITIALISATIONS DIVERSES
+! PAS D'INTERVENTION UTILISATEUR REQUISE
+!===============================================================================
+
+ nlcel = 0
+ nlfac = 0
+ nlfbr = 0
+ do iel = 1, ncelet
+ lstcel(iel) = 0
+ enddo
+ do ifac = 1, nfac
+ lstfac(ifac) = 0
+ enddo
+ do ifac = 1, nfabor
+ lstfbr(ifac) = 0
+ enddo
+
+ do ii = 1, len(nommai)
+ NOMMAI(II:II) = ' '
+ enddo
+
+!===============================================================================
+! REPERAGE DES CELLULES OU FACES INCLUSES DANS LE MAILLAGE
+! A RENSEIGNER PAR L'UTILISATEUR
+!===============================================================================
+
+! Ce sous programme est appele avant la definition des
+! conditions aux limites
+
+
+! POUR LA 1ere COUPE (PART 1) : coupe exemple
+
+! Exemple : on selectionne
+! les faces internes sur le plan median
+
+ if (ipart .eq. 1) then
+
+ NOMMAI = 'Coupe'
+
+! Pour les faces internes
+
+ do ifac = 1, nfac
+
+! Determination si la face appartient a la coupe
+
+ if (abs(cdgfac(2,ifac)).lt.1.d-4) then
+ nlfac = nlfac+1
+ lstfac(nlfac)= ifac
+ endif
+
+ enddo
+
+
+
+
+! POUR LA 2eme COUPE (PART 2) : cellules a T<21 degres
+
+! Exemple : on initialise a NCELET, le choix
+! des cellules sera fait dans usmpst.F
+
+ else if (ipart .eq. 2) then
+
+ NOMMAI = 'celTinf21'
+
+! Si NLCEL = NCELET, pas la peine de definir LSTCEL
+
+ nlcel = ncelet
+
+ endif
+
+!===============================================================================
+! CREATION DES STRUCTURES CONSERVANT LES DONNEES DES PARTS
+! PAS D'INTERVENTION UTILISATEUR REQUISE
+!===============================================================================
+
+ call pstcma (ipart, nommai, nlcel, nlfac, nlfbr, lstcel, lstfac, lstfbr)
+ !==========
+
+!===============================================================================
+! IDENTIFICATION DU MAILLAGE EXTRAIT ET GESTION DE SORTIE
+! A RENSEIGNER PAR L'UTILISATEUR
+!===============================================================================
+
+ if (ipart .eq. 1) then
+
+! Le maillage 1 est associe a la sortie standard (ICAS=-1)
+ icas = -1
+ call pstass(ipart, icas)
+ !==========
+
+ else if (ipart .eq. 2) then
+
+! Le maillage 2 est associe au cas cree ici (ICAS=1)
+ icas = 1
+ call pstass(ipart, icas)
+ !==========
+
+ endif
+
+!===============================================================================
+! FIN DE LA BOUCLE SUR LES PARTS DEFINIES PAR L'UTILISATEUR
+!===============================================================================
+
+enddo
+
+return
+
+!===============================================================================
+! FORMATS
+!===============================================================================
+
+end
+
diff --git a/examples/3-stratified_junction/case5/usmpst.f90 b/examples/3-stratified_junction/case5/usmpst.f90
new file mode 100644
index 0000000..596efea
--- /dev/null
+++ b/examples/3-stratified_junction/case5/usmpst.f90
@@ -0,0 +1,270 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta1
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usmpst &
+!================
+
+ ( idbia0 , idbra0 , ipart , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ ncelps , nfacps , nfbrps , &
+ nideve , nrdeve , nituse , nrtuse , imodif , &
+ itypps , ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , &
+ tracel , trafac , trafbr , rdevel , rtuser , ra )
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LA MODIFICATION DES LISTES DE CELLULES
+! OU FACES INTERNES ET DE BORD DEFINISSANT UN MAILLAGE DE POST
+! TRAITEMENT EXISTANT ; CETTE ROUTINE EST APPELEE AUX PAS DE
+! TEMPS AUQUEL CE MAILLAGE EST ACTIF, ET UNIQUEMENT POUR LES
+! MAILLAGES POST UTILISATEUR PRINCIPAUX (NON ALIAS), SI TOUS LES
+! "WRITERS" ASSOCIES A CE MAILLAGE OU SES ALIAS PERMETTENT
+! CETTE MODIFICATION
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ipart ! e ! <-- ! numero du maillage post !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
+! ncelps ! e ! <-- ! nombre de cellules du maillage post !
+! nfacps ! e ! <-- ! nombre de faces interieur post !
+! nfbrps ! e ! <-- ! nombre de faces de bord post !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! imodif ! e ! <-- ! 0 si maillage non modifie par cette !
+! ! ! ! fonction, 1 si modifie !
+! itypps(3) ! te ! <-- ! indicateur de presence (0 ou 1) de !
+! ! ! ! cellules (1), faces (2), ou faces de !
+! ! ! ! de bord (3) dans le maillage post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
+! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
+! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! statis ! tr ! <-- ! statistiques (lagrangien) !
+!ncelet,nvlsta) ! ! ! !
+! tracel(*) ! tr ! <-- ! tab reel valeurs cellules post !
+! trafac(*) ! tr ! <-- ! tab reel valeurs faces int. post !
+! trafbr(*) ! tr ! <-- ! tab reel valeurs faces bord post !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "optcal.h"
+include "numvar.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ipart
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nvlsta
+integer ncelps , nfacps , nfbrps
+integer nideve , nrdeve , nituse , nrtuse, imodif
+
+integer itypps(3)
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision statis(ncelet,nvlsta)
+double precision tracel(ncelps*3)
+double precision trafac(nfacps*3), trafbr(nfbrps*3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer ii
+
+
+!===============================================================================
+
+! Remarque : le tableau ITYPPS permet de savoir si le maillage post
+! contient a l'origine des cellules, des faces internes,
+! ou des faces de bord (sur l'ensemble des processeurs).
+
+! Ceci permet d'avoir un traitement "generique" qui
+! peut fonctionner pour tous les numeros de maillage,
+! mais si le maillage post est vide a un instant de
+! post traitement donne, on ne saura plus s'il contenait
+! des cellules ou faces. Dans ce cas, il est preferable
+! d'utiliser explicitement le numero du maillage post
+! pour bien determiner s'il doit contenir des cellules
+! ou des faces.
+
+
+!===============================================================================
+! 1. TRAITEMENT DES MAILLAGES POST A REDEFINIR
+! A RENSEIGNER PAR L'UTILISATEUR aux endroits indiques
+!===============================================================================
+
+! Exemple : maillage 2 : cellules ou T<21 degres
+!
+
+
+if (ipart.eq.2) then
+
+ imodif = 1
+
+ ncelps = 0
+ nfacps = 0
+ nfbrps = 0
+
+! SI LE MAILLAGE POST CONTIENT DES CELLULES
+! -----------------------------------------
+
+ if (itypps(1) .eq. 1) then
+
+ do ii = 1, ncel
+
+
+ if (rtp(ii,isca(1)) .le. 21.d0) then
+ ncelps = ncelps + 1
+ lstcel(ncelps) = ii
+ endif
+
+ enddo
+
+
+ endif
+
+endif
+! Fin du test sur le numero de maillage post.
+
+
+return
+
+end
diff --git a/examples/3-stratified_junction/case5/usphyv.f90 b/examples/3-stratified_junction/case5/usphyv.f90
new file mode 100644
index 0000000..aff78f0
--- /dev/null
+++ b/examples/3-stratified_junction/case5/usphyv.f90
@@ -0,0 +1,403 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta1
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : REMPLISSAGE DES VARIABLES PHYSIQUES
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivart, iclvar, iel, iphas
+integer ipcrom, ipbrom, ipcvis, ipccp
+integer ipcvsl, ith, iscal, ii
+integer iutile
+double precision vara, varb, varc, varam, varbm, varcm, vardm
+double precision varal, varbl, varcl, vardl
+double precision varac, varbc
+double precision xrtp
+
+!===============================================================================
+
+
+
+!===============================================================================
+! 0. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+
+
+
+
+!===============================================================================
+
+
+! LES EXEMPLES FANTAISISTES SUIVANTS SONT A ADAPTER PAR L'UTILISATEUR
+! ====================================================================
+
+! Chaque exemple est encadre par un test sur IUTILE, par securite.
+! Mettre IUTILE a 1 pour activer l'exemple.
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! EXEMPLE 1 : MASSE VOLUMIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! EXEMPLE 2 : VISCOSITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! EXEMPLE 3 : CHALEUR SPECIFIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! EXEMPLE 4 : Lambda/CP VARIABLE EN FONCTION DE LA TEMPERATURE
+! POUR LA TEMPERATURE OU L'ENTHALPIE
+! EXEMPLE 5 : DIFFUSIVITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! POUR LES SCALAIRES
+!===============================================================================
+
+
+
+
+
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 1 : MASSE VOLUMIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! ===========
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la masse volumique
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules (et, de facon optionnelle, aux faces de bord).
+! ===================================================================
+
+
+! --- Boucle sur les phases : debut
+ do iphas = 1, nphas
+
+! --- Rang de la masse volumique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCROM
+! dans PROPFB, prop. physiques au centre des faces de bord : IPBROM
+
+ ipcrom = ipproc(irom(iphas))
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ vara = -4.0668d-3
+ varb = -5.0754d-2
+ varc = 1000.9d0
+
+
+
+! Masse volumique au centre des cellules
+! ---------------------------------------
+! loi RHO = T * ( A * T + B ) + C
+! soit PROPCE(IEL,IPCROM) = XRTP * (VARA*XRTP+VARB) + VARC
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,isca(1))
+ propce(iel,ipcrom) = xrtp * (vara*xrtp+varb) + varc
+ enddo
+
+
+ enddo
+! --- Boucle sur les phases : fin
+
+
+!===============================================================================
+! EXEMPLE 2 : VISCOSITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! ===========
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la viscosite
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! Le test sur IUTILE permet de desactiver les instructions (qui
+! ne sont fournies qu'a titre d'exemple a adapter)
+
+! --- Boucle sur les phases : debut
+ do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Rang de la viscosite dynamique moleculaire de la phase IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCVIS
+
+ ipcvis = ipproc(iviscl(iphas))
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varam = -3.4016d-9
+ varbm = 6.2332d-7
+ varcm = -4.5577d-5
+ vardm = 1.6935d-3
+
+
+
+! Viscosite moleculaire dynamique en kg/(m s) au centre des cellules
+! ------------------------------------------------------------------
+! loi MU =
+! T *( T *( AM * T + BM )+ CM )+ DM
+! soit PROPCE(IEL,IPCVIS) =
+! & XRTP*(XRTP*(VARAM*XRTP+VARBM)+VARCM)+VARDM
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,isca(1))
+ propce(iel,ipcvis) = &
+ xrtp*(xrtp*(varam*xrtp+varbm)+varcm)+vardm
+ enddo
+
+
+ enddo
+! --- Boucle sur les phases : fin
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/examples/3-stratified_junction/case5/usvpst.f90 b/examples/3-stratified_junction/case5/usvpst.f90
new file mode 100644
index 0000000..4ca66b6
--- /dev/null
+++ b/examples/3-stratified_junction/case5/usvpst.f90
@@ -0,0 +1,431 @@
+!-------------------------------------------------------------------------------
+
+! Code_Saturne version 2.0.0-beta1
+! --------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usvpst &
+!================
+
+ ( idbia0 , idbra0 , ipart , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ ncelps , nfacps , nfbrps , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itypps , ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , &
+ tracel , trafac , trafbr , rdevel , rtuser , ra )
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LA SORTIE DE VARIABLES SUR UN MAILLAGE
+! DE POST TRAITEMENT DEJA DEFINI
+
+! PAR DEFAUT, DEUX MAILLAGES SONT DEFINIS AUTOMATIQUEMENT :
+! - LE MAILLAGE VOLUMIQUE (IPART=-1) SELON LA VALEUR DE ICHRVL
+! - LE MAILLAGE DE BORD (IPART=-2) SELON LA VALEUR DE ICHRBO
+! DES MAILLAGES SUPPLEMENTAIRES (CELLULES OU FACES INTERNES ET
+! DE BORD) PEUVENT ETRE DEFINIS ET PARAMETRES A TRAVERS
+! usdpst .F ET usmpst.F.
+
+!ETTE CETTE ROUTINE EST APPELEE UNE FOIS PAR MAILLAGE POST
+! ET PAR PAS DE TEMPS AUQUEL CE MAILLAGE EST ACTIF
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ipart ! e ! <-- ! numero du maillage post !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
+! ncelps ! e ! <-- ! nombre de cellules du maillage post !
+! nfacps ! e ! <-- ! nombre de faces interieur post !
+! nfbrps ! e ! <-- ! nombre de faces de bord post !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itypps(3) ! te ! <-- ! indicateur de presence (0 ou 1) de !
+! ! ! ! cellules (1), faces (2), ou faces de !
+! ! ! ! de bord (3) dans le maillage post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
+! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
+! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! statis ! tr ! <-- ! statistiques (lagrangien) !
+!ncelet,nvlsta) ! ! ! !
+! tracel(*) ! tr ! <-- ! tab reel valeurs cellules post !
+! trafac(*) ! tr ! <-- ! tab reel valeurs faces int. post !
+! trafbr(*) ! tr ! <-- ! tab reel valeurs faces bord post !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "optcal.h"
+include "numvar.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ipart
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nvlsta
+integer ncelps , nfacps , nfbrps
+integer nideve , nrdeve , nituse , nrtuse
+
+integer itypps(3)
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision statis(ncelet,nvlsta)
+double precision tracel(ncelps*3)
+double precision trafac(nfacps*3), trafbr(nfbrps*3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character*32 namevr
+
+integer ntindp
+integer iel , ifac , iloc , iphas, ivar , iclt
+integer idimt , ii , jj
+integer idimte, itenso, ientla, ivarpr
+integer imom1, imom2, ipcmo1, ipcmo2, idtcm
+double precision pond
+double precision rbid(1)
+
+integer ipass
+data ipass /0/
+save ipass
+
+
+!===============================================================================
+
+
+
+!===============================================================================
+! 1. TRAITEMENT DES VARIABLES A SORTIR
+! A RENSEIGNER PAR L'UTILISATEUR aux endroits indiques
+!===============================================================================
+
+
+! Un maillage de posttraitement est une "part"
+! (au sens EnSight ; les �quivalents MED et CGNS sont le maillage
+! et la base respectivement)
+! L'utilisateur aura defini ses maillages de posttraitement dans
+! usdpst (NBPART maillages de posttraitement)
+
+
+! La routine est appelee une fois pour chaque maillage IPART.
+! Pour chaque maillage et pour chacune des variables que l'on
+! souhaite posttraiter, on doit definir certains parametres et les
+! passer a la routine PSTEVA qui se charge de l'ecriture effective.
+! Ces parametres sont :
+! NAMEVR : nom de la variable
+! IDIMT : dimension de la variable
+! IENTLA : dans le cas ou IDIMT est >1, IENTLA permet de specifier
+! si le tableau contenant la variable est range de maniere
+! entrelacee X1,Y1,Z1,X2,Y2,Z2,X3,Y3,Z3,... (IENTLA=1)
+! ou non entrelancee X1,X2,X3,...,Y1,Y2,Y3,...,Z1,Z2,Z3,...
+! (IENTLA=0)
+! IVARPR : specifie si le tableau contenant la variable traitee est
+! defini sur le maillage "parent"/
+! En effet, meme si le maillage IPART considere contient
+! le meme nombre d'elements que le maillage complet "parent"
+! (NCELPS=NCEL), l'ordre de numerotation des elements n'est pas
+! forcement le meme. Le tableau TRACEL passe en argument de
+! PSTEVA est construit selon la numerotation du maillage IPART.
+! Pour posttraiter une variable contenue dans un tableau RTUSER
+! par exemple, il faut donc d'abord le reordonner dans le
+! tableau TRACEL :
+! DO ILOC = 1, NCELPS
+! IEL = LSTCEL(ILOC)
+! TRACEL(ILOC) = RTUSER(IEL)
+! ENDDO
+! Une alternative est cependant offerte, pour eviter des copies
+! inutiles. Si NCELPS=NCEL, on peut directement passer RTUSER
+! en argument de PSTEVA, en specifiant IVARPR=1, pour avertir
+! le code que la numerotation est celle du maillage "parent".
+! L'exemple ci-dessus concerne les cellules, mais la
+! problematique est la meme avec les faces internes ou faces de
+! bord.
+
+
+! Remarque : attention aux longueurs des noms de variables.
+
+! On autorise ici jusqu'� 32 caracteres , mais selon le
+! format utilise, les noms peuvent etre tronques :
+
+! - a 19 caracteres pour une sortie EnSight
+! - a 32 caracteres pour ue sortie MED 2.2
+
+! La longueur du nom n'est pas limitee en interne, et en
+! cas de deux variables aux noms tronques ne differant
+! qu'apres le 19ieme caractere, les lignes correspondantes
+! apparaitront normalement dans le fichier texte ".case"
+! EnSight, avec un meme champ de description ; il suffit
+! alors de renommer un de ces champs dans ce fichier
+! texte pour corriger le probleme.
+
+! Les caracteres blancs en debut ou fin de chaine sont
+! supprimes automatiquement. Selon le format utilise,
+! les caracteres interdits (sous EnSight, les caracteres
+! ( ) ] [ + - @ ! # * ^ $ / ainsi que les blancs et les
+! tabulations seront remplaces par le caractere ___________.
+! Ceci ne necessite aucune intervention utilisateur
+! (i.e. inutile d'utiliser ici les anciennes fonctions
+! Fortran VERLON et UNDSCR).
+
+
+! Exemples :
+! pour le maillage post 1, on sort
+! la temperature interpolee a la face
+! (et 0 sur les eventuelles faces interieures)
+
+! pour le maillage post 2, on sort
+! la temperature
+
+
+if (ipart.eq.1 ) then
+
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Temperature interpolee'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+! Valeurs entrelac�es
+ ientla = 0
+
+
+! Calcul des valeurs de la variable sur les faces internes
+! Pour simplifier l'exemple, on se contente ici d'une simple
+! interpolation lineaire.
+! Dans les calculs paralleles, si l'on utilise les voisins,
+! il faut faire un echange au prealable, comme d'habitude.
+! Dans les calculs avec periodicite, il faut egalement le faire
+! Pour les calculs ou periodicite et parallelisme coexistent,
+! l'appel a ces routines doit etre fait dans l'ordre
+! PARCOM puis PERCOM
+
+! a renseigner par l'utilisateur
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,isca(1)))
+ endif
+
+ if(iperio.eq.1) then
+ ivar = isca(1)
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+ do iloc = 1, nfacps
+
+ ifac = lstfac(iloc)
+ ii = ifacel(1, ifac)
+ jj = ifacel(2, ifac)
+ pond = ra(ipond-1+ifac)
+
+ trafac(iloc) &
+ = pond * rtp(ii, isca(1)) &
+ + (1.d0 - pond) * rtp(jj, isca(1))
+
+ enddo
+
+
+! Ecriture effective des valeurs calculees
+
+ ivarpr = 0
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, trafac, trafbr)
+
+
+
+
+else if (ipart.eq.2) then
+
+
+! 1.4.1 TRAITEMENT DE LA VITESSE
+! ------------------------------
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Temperature'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = rtp(iel,isca(1))
+ enddo
+
+ ivarpr = 0
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, trafac, trafbr)
+
+endif
+! Fin du test sur le numero de maillage post.
+
+
+return
+
+end
diff --git a/examples/3-stratified_junction/mesh/sn_total.des b/examples/3-stratified_junction/mesh/sn_total.des
new file mode 100644
index 0000000..a5d5c7f
Binary files /dev/null and b/examples/3-stratified_junction/mesh/sn_total.des differ
diff --git a/extras/cs_component.py b/extras/cs_component.py
new file mode 100644
index 0000000..d3f568e
--- /dev/null
+++ b/extras/cs_component.py
@@ -0,0 +1,74 @@
+import os
+from module_generator import Generator,Module,Service,CPPComponent
+
+context={'update':1,
+ "prerequisites":"/home/salome/SALOME5/V5_1_0/envSalome-V5_1_0.sh",
+ "kernel":"/home/salome/SALOME5/V5_1_0/KERNEL_V5_1_0",
+ }
+
+cwd=os.getcwd()
+
+defs="""
+void cs_calcium_set_component(int comp_id, void *comp);
+void cs_run(void);
+"""
+
+body="""
+cs_calcium_set_component(0, component);
+cs_run();
+"""
+c1 = CPPComponent("CFD_Single",
+ services = [Service("run",
+ inport=[("exec_dir", "string"),
+ ("library", "string"),
+ ("args", "string")],
+ outport=[("retval", "long")],
+ defs=defs, body=body,
+ ),
+ ],
+ includes="-I/usr/include",
+ kind="exe",
+ exe_path=os.path.join(cwd, "cs14.exe"),
+ )
+
+c2 = CPPComponent("CFD_Aster",
+ services = [Service("run",
+ inport=[("exec_dir", "string"),
+ ("library", "string"),
+ ("args", "string")],
+ outport=[("retval", "long")],
+ instream =[("depsat","CALCIUM_double","I"),
+ ("epsilo","CALCIUM_double","I"),
+ ("dtcalc","CALCIUM_double","I"),
+ ("ttinit","CALCIUM_double","I"),
+ ("pdtref","CALCIUM_double","I"),
+ ("nbpdtm","CALCIUM_integer","I"),
+ ("nbssit","CALCIUM_integer","I"),
+ ("isyncp","CALCIUM_integer","I"),
+ ("ntchro","CALCIUM_integer","I"),
+ ("icvext","CALCIUM_integer","I")],
+ outstream=[("dtsat", "CALCIUM_double","I"),
+ ("forsat","CALCIUM_double","I"),
+ ("almaxi","CALCIUM_double","I"),
+ ("coonod","CALCIUM_double","I"),
+ ("coofac","CALCIUM_double","I"),
+ ("icv", "CALCIUM_integer","I"),
+ ("dongeo","CALCIUM_integer","I"),
+ ("colnod","CALCIUM_integer","I"),
+ ("colfac","CALCIUM_integer","I")],
+ defs=defs, body=body,
+ ),
+ ],
+ includes="-I/usr/include",
+ kind="exe",
+ exe_path=os.path.join(cwd, "cs14.exe"),
+ )
+
+g=Generator(Module("CFDRUN", components=[c1, c2], prefix="./install"), context)
+g.generate()
+g.bootstrap()
+g.configure()
+g.make()
+g.install()
+g.make_appli("appli", restrict=["KERNEL", "GUI", "YACS"])
+
diff --git a/extras/validation/Autovalidation/Case.py b/extras/validation/Autovalidation/Case.py
new file mode 100644
index 0000000..f138ca9
--- /dev/null
+++ b/extras/validation/Autovalidation/Case.py
@@ -0,0 +1,550 @@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, os, shutil
+import re, time
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+import Autovalidation.Parser as Parser
+import Autovalidation.Common as Common
+import Autovalidation.Listing as Listing
+import Autovalidation.Chrono as Chrono
+
+class Case :
+ """
+ Describe a Saturne case
+ """
+
+ def __init__(self, parser, studyLabel, caseLabel, variables, reportListing, reportChrono):
+ """
+ constructor
+ """
+ self.studyLabel = studyLabel
+ self.caseLabel = caseLabel
+ self.variables = variables
+ self.parser = parser
+ self.studyPath = Common.localDirectory+"/"+studyLabel.upper()
+ self.casePath = self.studyPath+"/"+caseLabel.upper()
+ self.reportListing = reportListing
+ self.reportChrono = reportChrono
+ #
+ # if case doesn't exist, create "case" with cree_sat
+ #
+ if not os.path.isdir(self.studyPath+"/"+caseLabel.upper()):
+ os.chdir(self.studyPath)
+ proc = os.popen("cs_create -nogui -case "+caseLabel)
+ proc.close()
+ os.chdir(Common.localDirectory)
+ #
+ # Si le cas est deja cree l'indiquer dans le fichier report
+ # Si il y a deja des resultats dans RESU, ils sont supprimes
+ # Ajouter en parametre le fichier report
+ #
+ # ln or cp :
+ # - users
+ # - data.xml
+ refSrcPath = Common.referencePath+"/"+studyLabel.upper()+"/"+caseLabel.upper()+"/SRC"
+ try:
+ sourcesList = os.listdir(refSrcPath)
+ for source in sourcesList :
+ if source != "REFERENCE" :
+ shutil.copyfile(refSrcPath+"/"+source,self.studyPath+"/"+caseLabel.upper()+"/SRC/"+source)
+ except:
+ pass
+
+ refDataPath = Common.referencePath+"/"+studyLabel.upper()+"/"+caseLabel.upper()+"/DATA"
+ try:
+ datasList = os.listdir(refDataPath)
+ for data in datasList :
+ if data != "THCH" and data != "SaturneGUI" :
+ shutil.copyfile(refDataPath+"/"+data,self.studyPath+"/"+caseLabel.upper()+"/DATA/"+data)
+ except:
+ pass
+ #
+ # mise a jour du runcase
+ refScriptsPath = Common.referencePath+"/"+studyLabel.upper()+"/"+caseLabel.upper()+"/SCRIPTS"
+ try:
+ runcaseFile = file(refScriptsPath+'/runcase', mode='r')
+ except IOError:
+ print "Error : opening "+refScriptsPath+'/runcase'
+ print sys.exit(1)
+
+ keywordsRuncase = ["SOLCOM","PARAM","MESH",
+ "COMMAND_JOIN","COMMAND_CWF","COMMAND_PERIO",
+ "COMMAND_SYRTHES","THERMOCHEMISTRY_DATA",
+ "NUMBER_OF_PROCESSORS","PROCESSOR_LIST",
+ "USER_INPUT_FILES",
+ "USER_OUTPUT_FILES",
+ "OPTIMIZATION","CS_LIB_ADD","VALGRIND",
+ "ARG_CS_VERIF","ARG_CS_OUTPUT","ECHOCOMM",
+ "ADAPTATION"]
+
+ keywordsBsub = ["#BSUB -n","#BSUB -c"]
+
+ keywordsValues = {}
+
+ keywordsValBsub = {}
+
+ while 1:
+ line = runcaseFile.readline()
+ if (line == ""):
+ break
+
+ for keywordRuncase in keywordsRuncase :
+ kw = re.compile("^"+keywordRuncase+"=")
+
+ lineVar = kw.match(line)
+ if lineVar :
+ tmp = line.split("=")
+
+ try:
+ keywordsValues[keywordRuncase] = str(tmp[1])
+ except:
+ keywordsValues[keywordRuncase] = None
+
+ for keywordBsub in keywordsBsub :
+ kw = re.compile("^"+keywordBsub+" ")
+
+ lineVar = kw.match(line)
+ if lineVar :
+ tmp = line.split(" ")
+
+ try:
+ keywordsValBsub[keywordBsub] = str(tmp[2])
+ except:
+ keywordsValBsub[keywordBsub] = None
+
+ runcaseFile.close()
+
+ testScriptsPath = self.studyPath+"/"+caseLabel.upper()+"/SCRIPTS"
+ try:
+ runcaseTestFile = file(testScriptsPath+'/runcase', mode='r')
+ except IOError:
+ print "Error : opening "+testScriptsPath+'/runcase'
+ print sys.exit(1)
+
+ runcaseTmpFile = file(testScriptsPath+'/runcase.tmp', mode='w')
+
+ while 1:
+ line = runcaseTestFile.readline()
+ if (line == ""):
+ break
+
+ indic = False
+ for keywordRuncase in keywordsRuncase :
+ kw = re.compile("^"+keywordRuncase+"=")
+
+ lineVar = kw.match(line)
+ if lineVar :
+ runcaseTmpFile.write(keywordRuncase+"="+keywordsValues[keywordRuncase]+'\n')
+ indic = True
+
+ for keywordBsub in keywordsBsub :
+ kw = re.compile("^"+keywordBsub+" ")
+
+ lineVar = kw.match(line)
+ if lineVar :
+ runcaseTmpFile.write(keywordBsub+" "+keywordsValBsub[keywordBsub]+'\n')
+ indic = True
+
+ if Common.tmpDirectory != 'Default directory' :
+ kw = re.compile("^CS_TMP_PREFIX=")
+
+ lineVar = kw.match(line)
+ if lineVar :
+ runcaseTmpFile.write("CS_TMP_PREFIX="+Common.tmpDirectory+'\n')
+ indic = True
+
+ if not indic:
+ runcaseTmpFile.write(line)
+
+ runcaseTmpFile.close()
+ os.rename(testScriptsPath+'/runcase.tmp',testScriptsPath+'/runcase')
+
+
+ def run(self):
+ """
+ run case
+ """
+ #
+ # verifier que le cas ne devant pas etre recalcule a
+ # bien des resultats sinon envoie d'un message a l'utilisateur
+ # et relance du calcul
+
+ run = True
+
+ if not self.parser.getIfComputeCase(self.studyLabel,self.caseLabel):
+ run = False
+
+ if not self.isResult(self.caseLabel) :
+ print " -- No results for "+self.studyLabel+"/"+self.caseLabel
+ run = True
+
+ if run :
+ resuList = os.listdir(self.casePath+"/RESU")
+ for resu in resuList :
+ try :
+ shutil.rmtree(self.casePath+"/RESU/"+resu)
+ except :
+ os.remove(self.casePath+"/RESU/"+resu)
+
+ print " "+self.studyLabel+"/"+self.caseLabel+ " is running"
+ # Ajouter la commande de lancement avec os.system
+ testRunPath = self.studyPath+"/"+self.caseLabel.upper()+"/SCRIPTS"
+ os.chdir(testRunPath)
+ os.chmod(testRunPath+"/runcase",0777)
+ arch = os.uname()
+ if (arch[0]=='OSF1' or (arch[1].find("tantal") >=0)):
+ proc = os.popen("bsub < runcase")
+ proc.close()
+ elif (arch[0]=='Linux_Ch'):
+ proc = os.popen("qsub < runcase")
+ proc.close()
+ else:
+ proc = os.popen("nohup ./runcase > list&")
+ proc.close()
+ end = False
+ while 1:
+ resuList = os.listdir(self.casePath+"/RESU")
+ for resuFile in resuList:
+ if resuFile.find("error") >= 0:
+ return "Execution error"
+ elif resuFile.find("resume") >= 0:
+ end = True
+ elif resuFile.find("compil.log") >= 0:
+ compilFile = file(self.casePath+'/RESU/'+resuFile, mode='r')
+ while 1:
+ line = compilFile.readline()
+ if (line == ""):
+ break
+ error = "ERREUR DE COMPILATION OU D'EDITION DE LIENS"
+ err = re.compile(error)
+ lineVar = err.match(line)
+ if lineVar :
+ return "Compilation error"
+ if end:
+ break
+ time.sleep(10.)
+
+ os.chdir(Common.localDirectory)
+
+ return "OK"
+
+ def listingCompare(self):
+ """
+ compare listing with reference listing
+ """
+ refCasePath = Common.referencePath+"/"+self.studyLabel.upper()+"/"+self.caseLabel.upper()
+
+ refListing = Listing.Listing(refCasePath)
+ testListing = Listing.Listing(self.casePath)
+
+ varMinRef, varMaxRef, clipMinRef, clipMaxRef = refListing.getMinMaxVariables(self.variables)
+ varMinTest, varMaxTest, clipMinTest, clipMaxTest = testListing.getMinMaxVariables(self.variables)
+
+ #
+ # Creation d'un fichier cas_listing.report
+ #
+ fa = open(self.reportListing,'a')
+ fa.write('\n')
+ fa.write('Case: '+self.caseLabel.upper())
+ fa.write('\n')
+ fa.write('-------------------------------------------------------------------------------------------------\n')
+ fa.write(' Variable Ref Value Test Value Norm ClipRef ClipTest <tol\n')
+ fa.write('-------------------------------------------------------------------------------------------------\n')
+ fa.close()
+ print " Listing files analysing"
+
+ #
+ # Gestion des erreurs
+ #
+ if len(varMinRef)==0:
+ # Verification que la variable a bien ete trouvee
+ print '%12.12s' %self.variables, ' X -> Variable not find in listing'
+ return
+
+ if len(varMinRef)!=len(varMinTest):
+ # Verification que l'on effectue une comparaison avec des "fichiers comparables"
+ print '%12.12s' %self.variables, ' -> Different listing files ! case 1:',len(varMinRef), ' values - case 2:',len(varMinTest), ' values'
+ fa = open(self.reportListing,'a')
+ fa.write('%12.12s' %self.variables)
+ fa.write(" X -> different listing files!")
+ fa.write(" case 1: ")
+ fa.write(str(len(varMinRef)))
+ fa.write(" values")
+ fa.write(" - case 2: ")
+ fa.write(str(len(varMinTest)))
+ fa.write(" values\n")
+ fa.close()
+ indic=1
+ return
+ #
+ # Calcul des normes
+ #
+ epsilon = 1E-12
+ for i in self.variables :
+ try:
+ norme1 = abs(varMinRef[i]-varMinTest[i])/abs(varMaxRef[i]-varMinRef[i] + epsilon)
+ norme2 = abs(varMaxRef[i]-varMaxTest[i])/abs(varMaxRef[i]-varMinRef[i] + epsilon)
+ except:
+ norme1 = None
+ norme2 = None
+
+ for i in self.variables :
+ tolerance = self.variables[i]
+ try:
+ if norme1 > tolerance :
+ test1 ='NOK'
+ else :
+ test1 ='OK'
+ except:
+ test1 = None
+
+ try:
+ if norme2 > tolerance :
+ test2 ='NOK'
+ else :
+ test2 ='OK'
+ except:
+ test2 = None
+
+ fa = open(self.reportListing,'a')
+ fa.write('%12s' % i)
+ fa.write(' min ')
+ try:
+ fa.write('%12.5e' % varMinRef[i])
+ except:
+ fa.write('%12s' % varMinRef[i])
+ fa.write(' ')
+ try:
+ fa.write('%12.5e' % varMinTest[i])
+ except:
+ fa.write('%12s' % varMinTest[i])
+ fa.write(' ')
+ try:
+ fa.write('%12.5e' % norme1)
+ except:
+ fa.write('%12s' % norme1)
+ fa.write(' ')
+ try:
+ fa.write('%5i' % clipMinRef[i])
+ except:
+ fa.write('%5s' % clipMinRef[i])
+ fa.write(' ')
+ try:
+ fa.write('%5i' % clipMinTest[i])
+ except:
+ fa.write('%5s' % clipMinTest[i])
+ fa.write(' ')
+ fa.write(test1)
+ fa.write('\n')
+ fa.write(' ')
+ fa.write(' max ')
+ try:
+ fa.write('%12.5e' % varMaxRef[i])
+ except:
+ fa.write('%12s' % varMaxRef[i])
+ fa.write(' ')
+ try:
+ fa.write('%12.5e' % varMaxTest[i])
+ except:
+ fa.write('%12s' % varMaxTest[i])
+ fa.write(' ')
+ try:
+ fa.write('%12.5e' % norme2)
+ except:
+ fa.write('%12s' % norme2)
+ fa.write(' ')
+ try:
+ fa.write('%5i' % clipMaxRef[i])
+ except:
+ fa.write('%5s' % clipMaxRef[i])
+ fa.write(' ')
+ try:
+ fa.write('%5i' % clipMaxTest[i])
+ except:
+ fa.write('%5s' % clipMaxTest[i])
+ fa.write(' ')
+ fa.write(test2)
+ fa.write('\n')
+ fa.close()
+
+ return test1,test2
+
+
+ def chrCompare(self):
+ """
+ compare chrono file with reference file
+ """
+ refCasePath = Common.referencePath+"/"+self.studyLabel.upper()+"/"+self.caseLabel.upper()
+ refResuPath = refCasePath+"/RESU"
+ testResuPath = self.casePath+"/RESU"
+
+ refFilesNames = os.listdir(refResuPath)
+ testFilesNames = os.listdir(testResuPath)
+
+ for fileName in refFilesNames :
+ if fileName.find('CHR.ENSIGHT') >= 0 :
+ refChrName = fileName
+
+ for fileName in testFilesNames :
+ if fileName.find('CHR.ENSIGHT') >= 0 :
+ testChrName = fileName
+
+ refChrono = Chrono.Chrono(refCasePath,self.variables)
+ testChrono = Chrono.Chrono(self.casePath,self.variables)
+
+ timeRef = refChrono.getTime()
+ timeTest = testChrono.getTime()
+
+ #
+ # Creation d'un fichier cas_chrono.report
+ #
+ fa = open(self.reportChrono,'a')
+ fa.write('Case: '+self.caseLabel.upper())
+ fa.write('\n')
+ fa.close()
+ print " Chrono files analysing \n"
+
+ #
+ # Gestion des erreurs
+ #
+
+ # Verification que les instants sont identiques a epsilon pres
+ epsilon=1.0 # en secondes
+
+ if abs(timeRef-timeTest)>epsilon :
+ print " -> ERROR: chrono files incompatibles: different times !"
+ fa = open(self.reportChrono,'a')
+ fa.write(' X -> ERROR: chrono files incompatibles: different times)')
+ fa.write('\n')
+ fa.close()
+ return
+
+ fa = open(self.reportChrono,'a')
+ fa.write('--------------------------------------------------------------------\n')
+ fa.write('Time = ')
+ fa.write(str(timeRef))
+ fa.write(' s\n')
+ fa.write('--------------------------------------------------------------------\n')
+ fa.write(' Variable Delta_max Delta_moy. Norm Norm<tol. \n')
+ fa.write('--------------------------------------------------------------------\n')
+ fa.close()
+
+ for variable in self.variables:
+ tablRef = refChrono.getValues(variable)
+ tablTest = testChrono.getValues(variable)
+
+ delta = []
+
+ # Calcul de delta(variable)
+ for i in range (len(tablRef)):
+ try:
+ delta.append(abs(tablRef[i] - tablTest[i]))
+ except:
+ print "Warning : incompatibility between the files"
+ return "No possible comparison"
+
+ vminRef = min(tablRef)
+ vmaxRef = max(tablRef)
+
+ # Calcul de l'ecart max
+ deltaMax = max(delta)
+
+ somVar = 0.0
+
+ for i in range (len(delta)):
+ somVar += delta[i]
+
+ # Calcul de l'ecart moyen
+ deltaMoy = somVar/len(delta)
+
+ # Calcul de la norme
+ epsilon= 1e-12
+ norme = deltaMax/(vmaxRef-vminRef+epsilon)
+
+ tolerance = self.variables[variable]
+ if norme > tolerance:
+ test='NOK'
+ if self.parser.getIfComputeCase(self.studyLabel,self.caseLabel):
+ typ = testChrono.getTyp(variable)
+ testChrono.addVariable(delta, typ, "delta_"+variable, variable)
+ else:
+ test='OK'
+
+ #
+ # Ecriture du fichier cas_chrono.report
+ #
+ fa = open(self.reportChrono,'a')
+ fa.write('%12s' % variable)
+ fa.write(' ')
+ try:
+ fa.write('%12.5e' % deltaMax)
+ except:
+ fa.write('%12s' % deltaMax)
+ fa.write(' ')
+ try:
+ fa.write('%12.5e' % deltaMoy)
+ except:
+ fa.write('%12s' % deltaMoy)
+ fa.write(' ')
+ try:
+ fa.write('%12.5e' % norme)
+ except:
+ fa.write('%12s' % norme)
+ fa.write(' ')
+ fa.write(test)
+ fa.write('\n')
+ fa.close()
+
+ return test
+
+
+ def getCaseLabel(self):
+ return self.caseLabel
+
+
+ def isResult(self, caseLabel):
+ """
+ find a result file in RESU
+ """
+ testResuPath = self.studyPath+"/"+caseLabel.upper()+"/RESU"
+
+ try:
+ resusList = os.listdir(testResuPath)
+ if resusList != None and resusList != [] :
+ return True
+ else :
+ return False
+ except:
+ return False
diff --git a/extras/validation/Autovalidation/Chrono.py b/extras/validation/Autovalidation/Chrono.py
new file mode 100644
index 0000000..e1d478d
--- /dev/null
+++ b/extras/validation/Autovalidation/Chrono.py
@@ -0,0 +1,294 @@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys
+import re
+import string
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+class Chrono :
+ """
+ Describe a chrono
+ """
+
+ def __init__(self, casePath, variables):
+ """
+ constructor
+ """
+ self.variables = variables
+ self.casePath = casePath
+ #
+ # Verifier qu'il n'y a qu'un chr dans RESU
+ self.chrPath = casePath+"/RESU"
+
+ filesNames = os.listdir(self.chrPath)
+
+ counter = 0
+ for fileName in filesNames :
+ if fileName.find('CHR.ENSIGHT') >= 0 :
+ self.chrName = fileName
+ counter += 1
+ if counter > 1 :
+ print ("Error : Several chrono files in :" + self.chrPath)
+ print (" Delete old files and run again")
+ print sys.exit(1)
+ if counter < 1 :
+ print ("Error : No chrono file in :" + self.chrPath)
+ print sys.exit(1)
+
+ try:
+ chrFile = file(self.chrPath+'/'+self.chrName+'/CHR.case', mode='r')
+ except IOError:
+ print "Error : opening "+self.chrPath+'/'+self.chrName+'/CHR.case'
+ print sys.exit(1)
+
+ variablesChrNames={}
+ for variable in self.variables :
+ #
+ # in CHR.case, variable name len is < 19
+ if len(variable) > 19 :
+ variableChrName = variable[:19]
+ else :
+ variableChrName = variable
+ #
+ # in CHR.case, replace special characters
+ characters=["(",")","[","]","+","-","@"," ","!",
+ "#","*","^","$","/"]
+
+ for character in characters :
+ variableChrName.replace(character,"_")
+
+ variablesChrNames[variable] = variableChrName
+
+ line = ""
+ while line.find("VARIABLE") < 0 :
+ line = chrFile.readline()
+ if (line == ""):
+ print "Error : reading "+self.chrPath+'/'+self.chrName+'/CHR.case'
+ sys.exit(1)
+
+ self.variablesChrFiles={}
+ self.typ = {}
+
+ while line.find("TIME") < 0:
+ line = chrFile.readline()
+ if (line == ""):
+ print "Error : reading "+self.chrPath+'/'+self.chrName+'/CHR.case'
+ sys.exit(1)
+
+ for variable in self.variables :
+ numCar = line.find(variablesChrNames[variable])
+ if numCar > -1 :
+ self.typ[variable] = line.split(":")[0]
+ nameTab = line[numCar:].split()
+ self.variablesChrFiles[variable]=nameTab[1][:nameTab[1].find("*")]
+
+ while line.find("number of steps:") < 0:
+ line = chrFile.readline()
+ if (line == ""):
+ print "Error : reading "+self.chrPath+'/'+self.chrName+'/CHR.case'
+ sys.exit(1)
+ stepNb = int(line.split(":")[1])
+ filenumber = '%4.4i' % stepNb
+
+ for variable in self.variables :
+ self.variablesChrFiles[variable]+=str(filenumber)
+
+ while line.find("time values:") < 0:
+ line = chrFile.readline()
+ if (line == ""):
+ print "Error : reading "+self.chrPath+'/'+self.chrName+'/CHR.case'
+ sys.exit(1)
+
+# self.time = float(line.split(":")[1])
+
+ while 1 :
+ line = chrFile.readline()
+ if (line == ""):
+ break
+ try:
+ self.time = float(line.split()[0])
+ except:
+ pass
+
+
+ def getTime(self):
+ return self.time
+
+
+ def getTyp(self,variable):
+ return self.typ[variable]
+
+
+ def getValues(self, variable):
+ chrFicName = self.variablesChrFiles[variable]
+ path = self.chrPath+'/'+self.chrName+'/'+self.variablesChrFiles[variable]
+ try:
+ chrVar = file(path, mode='r')
+ except IOError:
+ print "Error : opening "+path
+ print sys.exit(1)
+
+ tabl = []
+ counter = 0
+
+ while 1:
+ text = chrVar.readline()
+ counter += 1
+ if (text == ""):
+ break
+
+ if counter > 4:
+ tmp = text.split()
+ try:
+ tabl.append(float(tmp[0]))
+ except:
+ pass
+
+ chrVar.close()
+ return tabl
+
+
+ def getStructure(self,variable):
+ chrFicName = self.variablesChrFiles[variable]
+ path = self.chrPath+'/'+self.chrName+'/'+self.variablesChrFiles[variable]
+ print path
+ try:
+ chrVar = file(path, mode='r')
+ except IOError:
+ print "Error : opening "+path
+ print sys.exit(1)
+
+ structure = []
+
+ line = chrVar.readline()
+ while line.find("part") < 0:
+ line = chrVar.readline()
+ if (line == ""):
+ break
+
+ while 1:
+ line = chrVar.readline()
+ if (line == ""):
+ break
+
+ valpart=[]
+ counter = 0
+ typ = ""
+ while line.find("part") < 0:
+ line = chrVar.readline()
+ if (line == ""):
+ break
+
+ tmp=line.split()
+ try:
+ float(tmp[0])
+ counter += 1
+ except:
+ if counter > 0 and typ != "":
+ valpart.append([typ,counter])
+ typ = tmp[0]
+ counter = 0
+
+ if typ != "part" and typ !="" :
+ valpart.append([typ,counter])
+ structure.append(valpart)
+
+ if (line == ""):
+ break
+
+ return structure
+
+
+ def addVariable(self, values, typ, name, varModel):
+ #
+ # on ajoute les variables supplementaires dans CHR.case
+ #
+ print self.chrPath+'/'+self.chrName+'/CHR.case'
+
+ try:
+ chrFile = file(self.chrPath+'/'+self.chrName+'/CHR.case', mode='r')
+ except IOError:
+ print "Error : opening "+self.chrPath+'/'+self.chrName+'/CHR.case'
+ print sys.exit(1)
+
+ chrFileTmp = file(self.chrPath+'/'+self.chrName+'/CHR.case.tmp', mode='w')
+
+ line = ""
+ while line.find("VARIABLE") < 0 :
+ line = chrFile.readline()
+ if (line == ""):
+ print "Error : reading "+self.chrPath+'/'+self.chrName+'/CHR.case'
+ sys.exit(1)
+ chrFileTmp.write(line)
+
+ if len(name) > 19 :
+ line = typ+":"+" 1 "+name[:19]+" "+"chr."+name[:19]+"\n"
+ else:
+ line = typ+":"+" 1 "+name+" "+" "+"chr."+name+"\n"
+
+ chrFileTmp.write(line)
+
+ while 1 :
+ line = chrFile.readline()
+ if (line == ""):
+ break
+ chrFileTmp.write(line)
+
+ chrFile.close()
+ chrFileTmp.close()
+ os.rename(self.chrPath+'/'+self.chrName+'/CHR.case.tmp',self.chrPath+'/'+self.chrName+'/CHR.case')
+
+ #
+ # creation du chr.delta
+ #
+ structure = self.getStructure(varModel)
+
+ if len(name) > 19 :
+ chrVar = file(self.chrPath+'/'+self.chrName+'/chr.'+name[:19], mode='w')
+ else:
+ chrVar = file(self.chrPath+'/'+self.chrName+'/chr.'+name, mode='w')
+
+ chrVar.write('Variable : '+name+'\n')
+
+ numPart = 1
+ debut = 0
+ for part in structure:
+ chrVar.write("part\n")
+ chrVar.write("%10i\n" % numPart)
+ for elt in part:
+ chrVar.write(elt[0]+"\n")
+ for i in range(debut, debut+elt[1]) :
+ chrVar.write("%12.5e\n" % values[i])
+ debut = elt[1]
+ numPart +=1
diff --git a/extras/validation/Autovalidation/CommandLine.py b/extras/validation/Autovalidation/CommandLine.py
new file mode 100644
index 0000000..2a45c97
--- /dev/null
+++ b/extras/validation/Autovalidation/CommandLine.py
@@ -0,0 +1,98 @@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, getopt
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+import Autovalidation.Common as Common
+
+
+def usage():
+ """
+ Usage of autovalid
+ """
+ txt="""
+Usage:\n\nautovalid -f [xml file name] [-d [local directory]]
+
+Valid options are one or more of the following:
+
+-f [xml file name]
+--file [xml file name]
+
+ Upload a studies list.
+
+-d [directory]
+--tmpdirectory [directory]
+
+ Define the local directory.
+
+-h
+--help
+
+ Prints this help message.
+----------------------------------------------------------------------
+"""
+ return txt
+
+def process_cmd_line (arg):
+
+ options = "f:hd:"
+ long_opts = ['file=', 'help', 'tmpdirectory=']
+
+ try:
+ opts, args = getopt.getopt(arg, options, long_opts)
+ except getopt.error, msg:
+ print "\nWarning:\n", msg
+ print usage()
+ print "Warning:\n", msg, "\n"
+ sys.exit(1)
+
+ if (opts and args) or len(args)>1 :
+ print usage()
+ sys.exit(1)
+
+ if not opts and args :
+ print usage()
+ sys.exit(1)
+
+ for o, a in opts:
+ if o in ('-f', '--file'):
+ Common.XMLFileName = a
+ if o in ('-d', '--tmpdirectory'):
+ Common.tmpDirectory = a
+ if o in ('-h', '--help'):
+ print usage()
+ sys.exit(1)
+
+ if Common.XMLFileName == "":
+ print usage()
+ sys.exit(1)
diff --git a/extras/validation/Autovalidation/Common.py b/extras/validation/Autovalidation/Common.py
new file mode 100644
index 0000000..6517435
--- /dev/null
+++ b/extras/validation/Autovalidation/Common.py
@@ -0,0 +1,34 @@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#-------------------------------------------------------------------------------
+# Global variable
+#-------------------------------------------------------------------------------
+XMLFileName=""
+referenceVersion=""
+referencePath=""
+tmpDirectory = "Default directory"
+localDirectory = ""
diff --git a/extras/validation/Autovalidation/Listing.py b/extras/validation/Autovalidation/Listing.py
new file mode 100644
index 0000000..48db9bb
--- /dev/null
+++ b/extras/validation/Autovalidation/Listing.py
@@ -0,0 +1,129 @@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys
+import re
+import string
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+class Listing :
+ """
+ Describe a listing
+ """
+
+ def __init__(self, casePath):
+ """
+ constructor
+ """
+ #
+ # Verifier qu'il n'y a qu'un listing dans RESU
+ listingPath = casePath+"/RESU"
+
+ filesNames = os.listdir(listingPath)
+ for fileName in filesNames :
+ if fileName.find('listing_n') >= 0 :
+ os.remove(listingPath+"/"+fileName)
+
+ counter = 0
+ filesNames = os.listdir(listingPath)
+ for fileName in filesNames :
+ if fileName.find('listing') >= 0 :
+ listingName = fileName
+ counter += 1
+ if counter > 1 :
+ print ("Error : Several listing files in :" + listingPath)
+ print (" Delete old files and run again")
+ print sys.exit(1)
+ if counter < 1 :
+ print ("Error : No listing file in :" + listingPath)
+ print sys.exit(1)
+
+ try:
+ self.listingFile = file(listingPath+'/'+listingName, mode='r')
+ except IOError:
+ print "Error : opening "+listingPath+'/'+listingName
+ print sys.exit(1)
+
+
+ def getMinMaxVariables(self, variables):
+
+ clipMin = {}
+ clipMax = {}
+ varMin = {}
+ varMax = {}
+ variablesListingNames = {}
+
+ for variable in variables :
+ #
+ # in listing, variable name len is < 12
+ if len(variable) > 12 :
+ variableListingName = variable[:12]
+ else :
+ variableListingName = variable
+
+ variablesListingNames[variable] = variableListingName
+ clipMin[variable] = None
+ clipMax[variable] = None
+ varMin[variable] = None
+ varMax[variable] = None
+
+ while 1:
+ line = self.listingFile.readline()
+ if (line == ""):
+ break
+
+ for variable in variables :
+
+ keyword = "v " + variablesListingNames[variable]
+ kw = re.compile(keyword)
+
+ lineVar = kw.match(line)
+ if lineVar :
+ tmp = line.split()
+
+ if len(tmp) == 6 :
+ varMin[variable] = float(tmp[2])
+ varMax[variable] = float(tmp[3])
+
+ if tmp[4] != '--' :
+ clipMin[variable] = int(tmp[4])
+
+ if tmp[5] != '--' :
+ clipMax[variable] = int(tmp[5])
+
+ else :
+ print " Warning : Variable found but bad listing structure"
+
+ return varMin, varMax, clipMin, clipMax
+
+
diff --git a/extras/validation/Autovalidation/Parser.py b/extras/validation/Autovalidation/Parser.py
new file mode 100644
index 0000000..df7786f
--- /dev/null
+++ b/extras/validation/Autovalidation/Parser.py
@@ -0,0 +1,181 @@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+import sys
+from xml.dom import minidom
+#from neptune import case
+
+class Parser:
+ """ Parser -- class to parse XML file."""
+
+ def __init__ (self, XMLFileName):
+ "Constructor --"
+ try:
+ self.doc = minidom.parse (XMLFileName)
+ except:
+ print "No file or syntax error"
+ sys.exit(1)
+
+ self.root = self.doc.firstChild
+
+ name = self.root.nodeName
+
+ if name != "autovalid":
+ print XMLFileName + " :Wrong XML file"
+ print sys.exit(1)
+
+
+ def getReferenceVersion(self):
+ return self.getDataFromNode(self.root,"referenceversion")
+
+
+ def getReferencePath(self):
+ return self.getDataFromNode(self.root,"referencepath")
+
+
+ def getStudiesLabels(self):
+ studiesLabels=[]
+
+ studyNodes = self.root.getElementsByTagName("study")
+
+ for node in studyNodes :
+ label = str(node.attributes["label"].value)
+ status = str(node.attributes["status"].value)
+ if status == 'on':
+ studiesLabels.append(label)
+
+ return studiesLabels
+
+
+ def getVariablesDefinition(self, studyLabel):
+ variables = {}
+
+ studyNode = self.getStudyNode(studyLabel)
+
+ variableNodes = studyNode.getElementsByTagName("variable")
+
+ for node in variableNodes :
+ label = str(node.attributes["label"].value)
+ status = str(node.attributes["status"].value)
+ if status == 'on' :
+ variables[label] = float(self.getDataFromNode(node,"tolerance"))
+
+ return variables
+
+
+ def getCasesLabels(self, studyLabel):
+ casesLabels=[]
+
+ studyNode = self.getStudyNode(studyLabel)
+
+ caseNodes = studyNode.getElementsByTagName("case")
+
+ for node in caseNodes :
+ label = str(node.attributes["label"].value)
+ status = str(node.attributes["status"].value)
+ compute = str(node.attributes["compute"].value)
+ if status == 'on':
+ casesLabels.append(label)
+
+ return casesLabels
+
+
+ def getIfComputeCase(self, studyLabel, caseLabel):
+ ifComputeCase = False
+
+ studyNode = self.getStudyNode(studyLabel)
+ caseNode = self.getCaseNode(studyNode,caseLabel)
+
+ compute = str(caseNode.attributes["compute"].value)
+ if compute == 'on':
+ ifComputeCase = True
+
+ return ifComputeCase
+
+
+ def getScriptPostName(self, studyLabel, caseLabel):
+ studyNode = self.getStudyNode(studyLabel)
+ caseNode = self.getCaseNode(studyNode,caseLabel)
+
+ postNodes = caseNode.getElementsByTagName("post")
+ returnLabel = None
+
+ if postNodes != None :
+ label = str(postNodes[0].attributes["label"].value)
+ status = str(postNodes[0].attributes["status"].value)
+ if status == 'on':
+ returnLabel = label
+
+ return returnLabel
+
+
+ def getProcNumber(self, studyLabel, caseLabel):
+ studyNode = self.getStudyNode(studyLabel)
+ caseNode = self.getCaseNode(studyNode,caseLabel)
+
+ try:
+ procNumber = int(self.getDataFromNode(caseNode,"nproc"))
+ except:
+ procNumber = 1
+
+ return procNumber
+
+
+
+ def getDataFromNode(self, node, childName):
+ data = None
+ list = node.getElementsByTagName(childName)
+
+ if (list.length == 1):
+ current = list.item(0)
+ data = current.firstChild.data
+
+ return data
+
+
+ def getStudyNode(self, studyLabel):
+ studyNodes = self.root.getElementsByTagName("study")
+
+ for node in studyNodes :
+ label = str(node.attributes["label"].value)
+ if label == studyLabel :
+ studyNode = node
+
+ return studyNode
+
+
+ def getCaseNode(self, studyNode, caseLabel):
+ caseNodes = studyNode.getElementsByTagName("case")
+
+ for node in caseNodes :
+ label = str(node.attributes["label"].value)
+ if label == caseLabel :
+ caseNode = node
+
+ return caseNode
+
+
+
diff --git a/extras/validation/Autovalidation/Study.py b/extras/validation/Autovalidation/Study.py
new file mode 100644
index 0000000..68803fd
--- /dev/null
+++ b/extras/validation/Autovalidation/Study.py
@@ -0,0 +1,103 @@
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, os, shutil
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+import Autovalidation.Common as Common
+import Autovalidation.Case as Case
+import Autovalidation.Parser as Parser
+
+class Study:
+
+ def __init__(self, parser, studyLabel):
+
+ self.cases = []
+ #
+ # if study doesn't exist, create it with "cree_sat"
+ #
+ localDir = Common.localDirectory
+ studyPath = localDir+"/"+studyLabel.upper()
+
+ reportListing = studyLabel + "_listing.report"
+ fa = open(reportListing,'w')
+ fa.write('-------------------------\n')
+ fa.write('Listing files comparison \n')
+ fa.write('-------------------------\n')
+ fa.close()
+
+ reportChrono = studyLabel + "_chrono.report"
+ fa = open(reportChrono,'w')
+ fa.write('-------------------------\n')
+ fa.write('Chrono files comparison \n')
+ fa.write('-------------------------\n')
+ fa.close()
+
+ if not os.path.isdir(studyLabel.upper()) :
+ proc = os.popen("cs_create -nogui -study "+studyLabel)
+ proc.close()
+ shutil.rmtree(studyPath+"/CASE1")
+ #
+ # lien ou copie des maillages et des scripts du cas de reference
+ #
+ refMeshPath = Common.referencePath+"/"+studyLabel.upper()+"/MESH"
+ try:
+ meshesList = os.listdir(refMeshPath)
+ for mesh in meshesList :
+ os.symlink(refMeshPath+"/"+mesh,studyPath+"/MESH/"+mesh)
+ except:
+ pass
+
+ refPostPath = Common.referencePath+"/"+studyLabel.upper()+"/POST"
+ try:
+ scriptsList = os.listdir(refPostPath)
+ for script in scriptsList :
+ shutil.copyfile(refPostPath+"/"+script,studyPath+"/POST/"+script)
+ except:
+ pass
+ #
+ # On recupere les variables a comparer
+ variables = parser.getVariablesDefinition(studyLabel)
+ #
+ # create cases list
+ casesLabels = parser.getCasesLabels(studyLabel)
+ if casesLabels != [] and casesLabels != None:
+ for caseLabel in casesLabels:
+ case = Case.Case(parser, studyLabel, caseLabel, variables, reportListing, reportChrono )
+ self.cases.append(case)
+ else :
+ print "Error : no case in "+studyLabel+" study"
+ sys.exit(1)
+
+ def getCases(self):
+ return self.cases
diff --git a/extras/validation/Autovalidation/__init__.py b/extras/validation/Autovalidation/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/extras/validation/autovalid b/extras/validation/autovalid
new file mode 100755
index 0000000..8fbb8b2
--- /dev/null
+++ b/extras/validation/autovalid
@@ -0,0 +1,129 @@
+#!/usr/bin/env python
+#============================================================================
+#
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2008 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#============================================================================
+#
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, os
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+import Autovalidation.CommandLine as CommandLine
+import Autovalidation.Parser as Parser
+import Autovalidation.Study as Study
+import Autovalidation.Case as Case
+import Autovalidation.Common as Common
+
+
+def runAutovalid():
+
+ #
+ # Command line
+ if len(sys.argv) <= 1 :
+ print CommandLine.usage()
+ sys.exit(1)
+
+ CommandLine.process_cmd_line(sys.argv[1:])
+
+ #
+ # Parser
+ parser = Parser.Parser(Common.XMLFileName)
+
+ #
+ # Global variables
+ Common.referenceVersion = parser.getReferenceVersion()
+ Common.referencePath = parser.getReferencePath()
+ Common.localDirectory = os.getcwd()
+
+ #
+ # Print
+ print "\n Code_Saturne autovalidation"
+ print " ---------------------------"
+ print " - Version : " + Common.referenceVersion
+ print " - Reference path : " + Common.referencePath
+ print " - Tmp directory : " + Common.tmpDirectory
+ print " - Local directory : " + Common.localDirectory
+ print "\n"
+ #
+ # studies labels
+ studiesLabels = parser.getStudiesLabels()
+
+ #
+ # Results file opening
+ reportFile = open("report.txt", mode='w')
+ reportFile.write('\n')
+ reportFile.write('---------------\n')
+ reportFile.write('Report file \n')
+ reportFile.write('---------------\n')
+
+ #
+ # Studies treatment
+ if studiesLabels != None :
+ for studyLabel in studiesLabels:
+ #
+ # study create
+ print ' Study: ' + studyLabel
+ reportFile.write(' Study: ' + studyLabel +'\n')
+ study = Study.Study(parser, studyLabel)
+ #
+ # case treatment
+ cases = study.getCases()
+ for case in cases:
+ label = case.getCaseLabel()
+ print ' Case: ' + label
+
+ runState = case.run()
+ #
+ # compare listing
+ if runState != "Compilation error" and runState != "Execution error":
+ listState1, listState2 = case.listingCompare()
+ #
+ # compare chr
+ chrState = case.chrCompare()
+
+ if runState != "OK":
+ valid = runState
+ else:
+ valid = "OK"
+ if listState1 != "OK" or listState2 != "OK" or chrState != "OK":
+ valid = "NOK"
+ if len(label) > 15:
+ reportFile.write(' Case: %15s %17s\n' % (label[:15], valid))
+ else :
+ reportFile.write(' Case: %15s %17s\n' % (label, valid))
+
+ reportFile.write('\n')
+
+ reportFile.close()
+
+if __name__ == '__main__':
+ runAutovalid()
+
diff --git a/extras/validation/autovalid.xml b/extras/validation/autovalid.xml
new file mode 100644
index 0000000..674451a
--- /dev/null
+++ b/extras/validation/autovalid.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<autovalid name="Validation Code_Saturne 1.4">
+
+<!--==========================================================================
+*
+* This file is part of the Code_Saturne Kernel, element of the
+* Code_Saturne CFD tool.
+*
+* Copyright (C) 1998-2008 EDF S.A., France
+*
+* contact: saturne-support at edf.fr
+*
+* The Code_Saturne Kernel 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.
+*
+* The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin St, Fifth Floor,
+* Boston, MA 02110-1301 USA
+*
+*===========================================================================-->
+
+ <referencepath>/home/saturne/Validation</referencepath>
+ <referenceversion>ncs-1.4.0</referenceversion>
+
+ <study label='LAPLACIEN' status='on'>
+ <variable label='scalaire' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+
+ <case label='CAS1' status='on' compute='on'>
+ <post label='depou_elargb' status='off'> </post>
+ </case>
+
+ <case label='2PROCS' status='on' compute='on'>
+ <post label='depou_elargb' status='off'> </post>
+ <nproc>2</nproc>
+ </case>
+ </study>
+
+
+ <study label='GRADIENT' status='on'>
+ <variable label='gradient' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+
+ <case label='CAS1' status='on' compute='on'>
+ </case>
+
+ <case label='CAS2' status='on' compute='on'>
+ </case>
+
+ <case label='CAS3' status='on' compute='on'>
+ </case>
+
+ <case label='CAS4' status='on' compute='on'>
+ </case>
+
+ <case label='CAS5' status='on' compute='on'>
+ </case>
+
+ <case label='CAS1-2PROCS' status='on' compute='on'>
+ <nproc>2</nproc>
+ </case>
+ </study>
+
+ <study label='CAVITE_ENTR' status='on'>
+ <variable label='VitesseX' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+ <variable label='Pression' status='on'>
+ <tolerance>0.1</tolerance>
+ </variable>
+
+ <case label='CAS1' status='on' compute='on'>
+ <post label='depou_elargb' status='off'> </post>
+ <nproc>2</nproc>
+ </case>
+ </study>
+
+
+</autovalid>
diff --git a/gui/AUTHORS b/gui/AUTHORS
new file mode 100644
index 0000000..79b64ec
--- /dev/null
+++ b/gui/AUTHORS
@@ -0,0 +1,29 @@
+This file is the credits list for the Code_Saturne Graphical User Interface,
+element of the Code_Saturne CFD tool. The affiliation given for each
+contributor refers to the time when that contributor was active in the project,
+and does not necessarily correspond to his or her present affiliation.
+
+
+Code_Saturne is copyright (C) 1998-2009 EDF S.A., France
+
+
+Major contributions to the Code_Saturne GUI have been provided by
+Douce Alexandre (EDF, Chatou, France)
+Picard Nicole (EDF, Chatou, France)
+Rousset Jean-Luc (EDF, Chatou, France)
+Quemerais Eric (INCKA, Boulogne-Billancourt, France)
+Sophie Bosse (EDF, Chatou, France)
+Michael Tartar (INCKA, Boulogne-Billancourt, France)
+Olivier Gaça (INCKA, Boulogne-Billancourt, France)
+
+
+
+Other contributors to the Code_Saturne GUI include
+Vit Carole (INCKA, Boulogne-Billancourt, France)
+
+
+To the best of our knowledge, this list reflects the exact level of
+contribution of each among the many people who have approached
+Code_Saturne. It is made as objective and accurate as possible.
+However, if you feel you have been misplaced in the list, or completely
+forgotten, please contact saturne-support at edf.fr so we can update it.
diff --git a/gui/Base/BrowserForm.ui b/gui/Base/BrowserForm.ui
new file mode 100644
index 0000000..03d14ce
--- /dev/null
+++ b/gui/Base/BrowserForm.ui
@@ -0,0 +1,27 @@
+<ui version="4.0" >
+ <class>BrowserForm</class>
+ <widget class="QWidget" name="BrowserForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>260</width>
+ <height>79</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTreeView" name="treeView" >
+ <property name="statusTip" >
+ <string>Click right for context menu</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Base/BrowserView.py b/gui/Base/BrowserView.py
new file mode 100644
index 0000000..6e67955
--- /dev/null
+++ b/gui/Base/BrowserView.py
@@ -0,0 +1,800 @@
+# -*- coding: utf-8 -*-
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the following classes:
+- BrowserView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import sys, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from BrowserForm import Ui_BrowserForm
+from Toolbox import GuiParam, displaySelectedPage
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BrowserView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class TreeItem:
+ def __init__(self, data, typename, parent=None):
+ self.parentItem = parent
+ self.itemData = data
+ self.itemType = typename
+ self.itemIcon = None
+ self.childItems = []
+
+ def appendChild(self, item):
+ self.childItems.append(item)
+
+ def child(self, row):
+ return self.childItems[row]
+
+ def childCount(self):
+ return len(self.childItems)
+
+ def columnCount(self):
+ return len(self.itemData)
+
+ def data(self, column):
+ return self.itemData[column]
+
+ def parent(self):
+ return self.parentItem
+
+ def row(self):
+ if self.parentItem:
+ return self.parentItem.childItems.index(self)
+
+ return 0
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class TreeModel(QAbstractItemModel):
+ """A model representing the widget tree structure.
+ """
+ def __init__(self, data, parent=None):
+ """Constructs a new item model with the given I{parent}.
+
+ @type data: C{QString}
+ @param data: content of the new item
+ @type parent: C{QObject} or C{None}
+ @param parent: parent of the new item
+ """
+ QAbstractItemModel.__init__(self, parent)
+
+ rootData = []
+ rootData.append(QVariant("Pages"))
+ self.rootItem = TreeItem(rootData, "folder")
+ self.populateModel(data.split("\n"), self.rootItem)
+
+
+ def columnCount(self, parent):
+ """Returns the number of columns for the children of the given I{parent}.
+
+ @type parent: C{QModelIndex}
+ @param parent: parent of the item
+ @return: C{int}
+ """
+ if parent.isValid():
+ return parent.internalPointer().columnCount()
+ else:
+ return self.rootItem.columnCount()
+
+
+ def data(self, index, role):
+ """Returns the data stored under the given I{role} for the item referred to by the I{index}.
+
+ @type index: C{QModelIndex}
+ @param index: used to locate data in a data model
+ @type role: C{Qt.ItemDataRole}
+ @param role: used by the view to indicate to the model which type of data it needs
+ @return: C{QVariant}
+ """
+ if not index.isValid():
+ return QVariant()
+
+ item = index.internalPointer()
+ column = index.column()
+
+ if role == Qt.DisplayRole:
+ # return text for columns
+ if column == 0:
+ return QVariant(item.itemData[column])
+
+ elif role == Qt.DecorationRole:
+ # return icon for first column
+ if column == 0:
+ style = QWidget().style()
+ if item.itemType == "folder-new":
+ icon = style.standardIcon(QStyle.SP_FileDialogNewFolder)
+ elif item.itemType == "folder-close":
+ icon = style.standardIcon(QStyle.SP_DirClosedIcon)
+ elif item.itemType == "folder-open":
+ icon = style.standardIcon(QStyle.SP_DirOpenIcon)
+ elif item.itemType == "file-open":
+ icon = style.standardIcon(QStyle.SP_FileIcon)
+ elif item.itemType == "file-new":
+ icon = style.standardIcon(QStyle.SP_FileLinkIcon)
+ return QVariant(icon)
+
+ # return nothing
+ return QVariant()
+
+
+ def flags(self, index):
+ """What we can do with the item.
+
+ @type index: C{QModelIndex}
+ @param index: used to locate data in a data model
+ """
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ flags = Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+# if index.internalPointer() is not self.rootItem and index.column() == 0:
+# # allow items other than root to be edited
+# flags |= Qt.ItemIsEditable
+ return flags
+
+
+ def headerData(self, section, orientation, role):
+ """Return the header of the tree.*
+
+ @return: C{QVariant}
+ """
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return self.rootItem.data(section)
+
+ return QVariant()
+
+
+ def index(self, row, column, parent):
+ """Returns the index of the item in the model specified by the given I{row}, I{column} and I{parent} index.
+
+ @type row: C{int}
+ @param row: row of the item
+ @type column: C{int}
+ @param column: column of the item
+ @type parent: C{QModelIndex}
+ @param parent: parent of the item
+ @return: C{QModelIndex}
+ """
+ if not parent.isValid():
+ parentItem = self.rootItem
+ else:
+ parentItem = parent.internalPointer()
+
+ #FIXME: why childItem can be None?
+ try:
+ childItem = parentItem.child(row)
+ except:
+ childItem = None
+
+ if childItem:
+ return self.createIndex(row, column, childItem)
+ else:
+ return QModelIndex()
+
+
+ def parent(self, index):
+ """Returns the parent of the model item with the given index.
+
+ @type index: C{QModelIndex}
+ @param index: index of the child
+ @return: C{QModelIndex}
+ """
+ if not index.isValid():
+ return QModelIndex()
+
+ childItem = index.internalPointer()
+ parentItem = childItem.parent()
+
+ if parentItem == self.rootItem:
+ return QModelIndex()
+
+ return self.createIndex(parentItem.row(), 0, parentItem)
+
+
+ def rowCount(self, parent):
+ """Returns the number of rows under the given I{parent}.
+
+ @type parent: C{QModelIndex}
+ @param parent: parent of the item
+ @return: C{int}
+ """
+
+ if not parent.isValid():
+ parentItem = self.rootItem
+ else:
+ parentItem = parent.internalPointer()
+
+ return parentItem.childCount()
+
+
+ def match(self, start, role, value, hits, flags):
+ """
+ @type start: C{QModelIndex}
+ @type role: C{Qt.ItemDataRole}
+ @type value: C{QVarient}
+ @type hits: C{int}
+ @type flags: C{Qt.MatchFlag}
+ """
+ result = []
+ p = self.parent(start)
+ st = start.row()
+ to = self.rowCount(p)
+
+ for r in range(st, to):
+
+ index = self.index(r, start.column(), p)
+ if not index.isValid():
+ pass
+ v = self.data(index, role)
+
+ if flags == Qt.MatchExactly:
+ if value == v:
+ result.append(index)
+ else:
+ raise ValueError, "This flags is not implemented"
+
+ if self.hasChildren(index):
+ result += self.match(self.index(0, index.column(), index), role, value, hits, flags)
+
+ return result
+
+
+ def itemLocalization(self, data, role=Qt.DisplayRole):
+ """
+ """
+ info = []
+ search_item = QVariant(QString(data))
+ start = self.index(0, 0, QModelIndex())
+ indexList = self.match(start, role, search_item, -1, Qt.MatchExactly)
+
+ for index in indexList:
+ item = index.internalPointer()
+ column = index.column()
+ row = index.row()
+ parent = self.parent(index)
+
+ info.append( (row, column, parent) )
+
+ return info
+
+
+ def populateModel(self, lines, parent):
+ """
+ @type lines: C{QString}
+ @param lines:
+ @type parent: C{QModelIndex}
+ @param parent: parent of the item
+ """
+ parents = []
+ indentations = []
+
+ parents.append(parent)
+ indentations.append(0)
+
+ for number in range(len(lines)):
+ position = 0
+ while position < len(lines[number]):
+ if lines[number][position] != " ":
+ break
+ position += 1
+
+ lineData = lines[number][position:].trimmed()
+
+ if not lineData.isEmpty():
+ # Read the column data from the rest of the line.
+ columnStrings = lineData.split("\t", QString.SkipEmptyParts)
+ columnData = []
+ for column in range(0, len(columnStrings)):
+ columnData.append(columnStrings[column])
+
+ if position == 0:
+ typename = "folder-new"
+ else:
+ typename = "file-new"
+
+ if position > indentations[-1]:
+ # The last child of the current parent is now the new parent
+ # unless the current parent has no children.
+ if parents[-1].childCount() > 0:
+ parents.append(parents[-1].child(parents[-1].childCount() - 1))
+ indentations.append(position)
+
+ else:
+ while position < indentations[-1] and len(parents) > 0:
+ parents.pop()
+ indentations.pop()
+
+ # Append a new item to the current parent's list of children.
+ parents[-1].appendChild(TreeItem(columnData, typename, parents[-1]))
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class BrowserView(QWidget, Ui_BrowserForm):
+ """
+ Class for the browser widget
+ """
+ def __init__(self):
+ """
+ Constructor
+ """
+ QWidget.__init__(self)
+
+ Ui_BrowserForm.__init__(self)
+ self.setupUi(self)
+
+ tree = self._browser()
+ self.model = TreeModel(QString(tree))
+
+ self.treeView.setModel(self.model)
+ self.treeView.header().hide()
+ self.treeView.setAnimated(True)
+ #self.treeView.setMinimumSize(QSize(200, 300))
+ self.treeView.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
+ self.treeView.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
+ self.treeView.setAlternatingRowColors(True)
+ self.treeView.setWindowTitle("Simple Tree Model")
+
+ # Popup menu
+ self.treeView.setContextMenuPolicy(Qt.CustomContextMenu)
+ self.connect(self.treeView, SIGNAL("customContextMenuRequested(QPoint)"), self.displayPopup)
+
+ # Receive change in selection
+ self.connect(self.treeView, SIGNAL('pressed(const QModelIndex &)'), self.onItemPressed)
+ self.connect(self.treeView, SIGNAL('expanded(const QModelIndex &)'), self.onFolderOpen)
+ self.connect(self.treeView, SIGNAL('collapsed(const QModelIndex &)'), self.onFolderClose)
+
+
+ def _browser(self):
+ tree ="""
+ Identity and paths
+Calculation environment
+ Meshes selection
+ Mesh quality criteria
+Storage system description
+ Storage system type
+ Storage system geometry
+ Inlet description
+ Outlet description
+ Network description
+Thermohydraulic parameters
+ Hydraulic load
+ Thermal load
+Thermophysical models
+ Calculation features
+ Mobile mesh
+ Turbulence models
+ Thermal model
+ Gas combustion
+ Current species
+ Pulverized coal combustion
+ Electrical models
+ Radiative transfers
+ Atmospheric flows
+Physical properties
+ Reference values
+ Fluid properties
+ Gravity, hydrostatic pressure
+Volume conditions
+ Volume regions definition
+ Initialization
+ Head losses
+Additional scalars
+ Definition and initialization
+ Physicals properties
+Particles and droplets tracking
+ Global settings
+ Statistics
+ Output
+Boundary conditions
+ Definition of boundary regions
+ Boundary conditions
+ Particles boundary conditions
+ Fluid structure interaction
+Numerical parameters
+ Time step
+ Steady flow management
+ Equation parameters
+ Global parameters
+Calculation control
+ Time averages
+ Output control
+ Volume solution control
+ Surface solution control
+ Profiles
+Calculation management
+ User arrays
+ Memory management
+ Start/Restart
+ Prepare batch calculation
+"""
+ return tree
+
+
+ def setRowClose(self, string):
+ log.debug("setRowClose(): %s" % string)
+ itemInfoList = self.model.itemLocalization(string)
+ for itemInfo in itemInfoList:
+ row = itemInfo[0]
+ column = itemInfo[1]
+ parent = itemInfo[2]
+ self.treeView.setRowHidden(row, parent, True)
+
+
+ def setRowOpen(self, string):
+ log.debug("setRowOpen(): %s" % string)
+ itemInfoList = self.model.itemLocalization(string)
+ for itemInfo in itemInfoList:
+ row = itemInfo[0]
+ column = itemInfo[1]
+ parent = itemInfo[2]
+ self.treeView.setRowHidden(row, parent, False)
+
+
+ def isRowClose(self, string):
+ log.debug("isRowClose(): %s" % string)
+ itemInfoList = self.model.itemLocalization(string)
+ for itemInfo in itemInfoList:
+ row = itemInfo[0]
+ column = itemInfo[1]
+ parent = itemInfo[2]
+ index = self.model.index(row, column, parent)
+ # FIXME: this return should not be in a loop
+ return self.treeView.isRowHidden(row, index)
+
+
+ @pyqtSignature('const QModelIndex &')
+ def onItemPressed(self, index):
+ item = index.internalPointer()
+ if item.itemType == "file-new":
+ item.itemType = "file-open"
+
+
+ @pyqtSignature('const QModelIndex &')
+ def onFolderOpen(self, index):
+ """
+ public slot
+
+ change the item type when the folder is opened
+
+ @type index: C{QModelIndex}
+ @param index: index in the model of the selected folder
+ """
+ item = index.internalPointer()
+ if item.itemType == "folder-new" or item.itemType == "folder-close":
+ item.itemType = "folder-open"
+
+
+ @pyqtSignature('const QModelIndex &')
+ def onFolderClose(self, index):
+ """
+ public slot
+
+ change the item type when the folder is closed
+
+ @type index: C{QModelIndex}
+ @param index: index in the model of the selected folder
+ """
+ item = index.internalPointer()
+ if item.itemType == "folder-new" or item.itemType == "folder-open":
+ item.itemType = "folder-close"
+
+
+ @pyqtSignature("")
+ def displayPopup(self):
+ """
+ public slot
+
+ create the popup menu of the Browser
+ """
+ self.fileMenu = QMenu(self.treeView)
+
+ self.actionExpand = QAction(self.tr("Expand"), self.treeView)
+ #self.actionExpand.setShortcut(self.tr("F5"))
+ self.connect(self.actionExpand, SIGNAL("triggered()"), self.openTreeFolder)
+
+ self.actionCollapse = QAction(self.tr("Collapse"), self.treeView)
+ #self.actionCollapse.setShortcut(self.tr("F6"))
+ self.connect(self.actionCollapse, SIGNAL("triggered()"), self.closeTreeFolder)
+
+ # ... TODO
+ #self.actionWelcome = QAction(self.tr("Welcome page"), self.treeView)
+
+ self.fileMenu.addAction(self.actionExpand)
+ self.fileMenu.addAction(self.actionCollapse)
+
+ cursor = QCursor()
+ self.fileMenu.popup(cursor.pos())
+ self.fileMenu.show()
+
+
+ def display(self, root, case, stbar, study, tree):
+ """
+ """
+ index = self.treeView.currentIndex()
+ item = index.internalPointer()
+ name = item.itemData[0]
+ return displaySelectedPage(name, root, case, stbar, study, tree)
+
+
+ def isFolder(self):
+ """
+ Return True if current item is a folder (parent)
+ """
+ index = self.treeView.currentIndex()
+ item = index.internalPointer()
+ return item.childCount() != 0
+
+
+ def openSingleFolder(self, string):
+ """
+ Open a single folder of the Tree.
+ """
+ itemInfoList = self.model.itemLocalization(string)
+ for itemInfo in itemInfoList:
+ row = itemInfo[0]
+ column = itemInfo[1]
+ parent = itemInfo[2]
+ index = self.model.index(row, column, parent)
+ self.treeView.expand(index)
+
+
+ @pyqtSignature("")
+ def openTreeFolder(self):
+ """
+ public slot
+
+ open all folders of the Tree.
+ """
+ self.treeView.expandAll()
+
+ parent = QModelIndex()
+ column = 0
+ for row in range(self.model.rowCount(parent)):
+ index = self.model.index(row, column, parent)
+ self.onFolderOpen(index)
+
+ if hasattr(self, 'case'):
+ self.configureTree(self.case)
+
+
+ def closeSingleFolder(self, string):
+ """
+ Close a single folder of the Tree.
+ """
+ itemInfoList = self.model.itemLocalization(string)
+ for itemInfo in itemInfoList:
+ row = itemInfo[0]
+ column = itemInfo[1]
+ parent = itemInfo[2]
+ index = self.model.index(row, column, parent)
+ self.treeView.collapse(index)
+
+
+ @pyqtSignature("")
+ def closeTreeFolder(self):
+ """
+ public slot
+
+ close all folders of the Tree.
+ """
+ self.treeView.collapseAll()
+
+ parent = QModelIndex()
+ column = 0
+ for row in range(self.model.rowCount(parent)):
+ index = self.model.index(row, column, parent)
+ self.onFolderClose(index)
+
+
+ def configureTree(self, case):
+ """
+ Public method.
+ Configures the browser with users data.
+ """
+
+ # FIXME: Initialization to delete
+
+ self.setRowClose(self.tr('Particles and droplets tracking'))
+ self.setRowClose(self.tr('Gas combustion'))
+ self.setRowClose(self.tr('Current species'))
+ self.setRowClose(self.tr('Pulverized coal combustion'))
+ self.setRowClose(self.tr('Electrical models'))
+ self.setRowClose(self.tr('Radiative transfers'))
+ self.setRowClose(self.tr('Atmospheric flows'))
+ self.setRowClose(self.tr('Radiative boundary conditions'))
+ self.setRowClose(self.tr('Particles boundary conditions'))
+ self.setRowClose(self.tr('Steady flow management'))
+ self.setRowClose(self.tr('Surface solution control'))
+ self.setRowClose(self.tr('Time averages'))
+ self.setRowClose(self.tr('Time step'))
+ self.setRowClose(self.tr('Storage system description'))
+ self.setRowClose(self.tr('Thermohydraulic parameters'))
+ self.setRowClose(self.tr('Mobil mesh boundary'))
+ self.setRowClose(self.tr('Fluid structure interaction'))
+
+ # Matisse
+
+ if GuiParam.matisse:
+ self.setRowOpen(self.tr('Storage system description'))
+ self.setRowOpen(self.tr('Thermohydraulic parameters'))
+ self.setRowClose(self.tr('Thermophysical models'))
+ self.setRowClose(self.tr('Physical properties'))
+ self.setRowClose(self.tr('Solution Domain'))
+ self.setRowClose(self.tr('Additional scalars'))
+ self.setRowClose(self.tr('Boundary conditions'))
+ self.setRowClose(self.tr('Numerical parameters'))
+ self.setRowClose(self.tr('Start/Restart'))
+ return
+
+ # Steady flow management
+
+ nodeanal = case.xmlGetNode('analysis_control')
+ nodeSteady = nodeanal.xmlGetNode('steady_management')
+
+ if nodeSteady['status'] == 'on':
+ self.setRowClose(self.tr('Time averages'))
+ self.setRowClose(self.tr('Time step'))
+ self.setRowOpen(self.tr('Steady flow management'))
+ else:
+ nodeSteady['status'] = 'off'
+ self.setRowClose(self.tr('Steady flow management'))
+ self.setRowOpen(self.tr('Time averages'))
+ self.setRowOpen(self.tr('Time step'))
+
+ # Multi-phase flow
+
+ nodeLagr = case.xmlGetNode('lagrangian', 'model')
+
+ if nodeLagr and nodeLagr['model'] == "on":
+ self.setRowOpen(self.tr('Particles and droplets tracking'))
+ self.setRowOpen(self.tr('Particles boundary conditions'))
+ else:
+ self.setRowClose(self.tr('Particles and droplets tracking'))
+ self.setRowClose(self.tr('Particles boundary conditions'))
+
+ # OutputSurfacicView
+
+ node_control = case.xmlGetNode('analysis_control')
+ node_out = node_control.xmlInitNode('output')
+ node_bound = node_out.xmlGetNode('domain_boundary', 'status')
+
+ # FIXME: node_bound = ''
+ if node_bound and node_bound['status'] == 'on':
+ self.setRowOpen(self.tr('Surface solution control'))
+
+ # Reactive flow
+
+ node0 = case.xmlGetNode('thermophysical_models')
+ node1 = node0.xmlGetNode('gas_combustion', 'model')
+ node2 = node0.xmlGetNode('pulverized_coal', 'model')
+ node3 = node0.xmlGetNode('joule_effect', 'model')
+ node4 = node0.xmlGetNode('thermal_scalar', 'model')
+ node5 = node0.xmlGetNode('radiative_transfer', 'model')
+ node6 = node0.xmlGetNode('atmospheric_flows', 'model')
+
+ if node1['model'] in ('ebu', '3p'):
+ self.setRowClose(self.tr('Thermal model'))
+ self.setRowOpen(self.tr('Gas combustion'))
+ self.setRowOpen(self.tr('Radiative transfers'))
+ if node5.xmlGetAttribute('model') != 'off':
+ self.setRowOpen(self.tr('Radiative boundary conditions'))
+
+ elif node2['model'] in ('coal_homo', 'coal_homo2'):
+ self.setRowClose(self.tr('Thermal model'))
+ self.setRowOpen(self.tr('Current species'))
+ self.setRowOpen(self.tr('Pulverized coal combustion'))
+ self.setRowOpen(self.tr('Radiative transfers'))
+ if node5.xmlGetAttribute('model') != 'off':
+ self.setRowOpen(self.tr('Radiative boundary conditions'))
+
+ elif node3['model'] in ('joule', 'arc'):
+ self.setRowClose(self.tr('Thermal model'))
+ self.setRowOpen(self.tr('Electrical models'))
+ self.setRowOpen(self.tr('Radiative transfers'))
+ if node5.xmlGetAttribute('model') != 'off':
+ self.setRowOpen(self.tr('Radiative boundary conditions'))
+
+ elif node6 and node6['model'] != 'off':
+ self.setRowClose(self.tr('Thermal model'))
+ self.setRowOpen(self.tr('Atmospheric flows'))
+ self.setRowOpen(self.tr('Radiative transfers'))
+ if node5.xmlGetAttribute('model') != 'off':
+ self.setRowOpen(self.tr('Radiative boundary conditions'))
+
+ else:
+ self.setRowOpen(self.tr('Thermal model'))
+ if node4.xmlGetAttribute('model') != 'off':
+ self.setRowOpen(self.tr('Radiative transfers'))
+ if node5.xmlGetAttribute('model') != 'off':
+ self.setRowOpen(self.tr('Radiative boundary conditions'))
+
+ node7 = node0.xmlGetNode('ale_method', 'status')
+ if node7 and node7['status'] == 'on':
+ self.setRowOpen(self.tr('Mobil mesh boundary'))
+ self.setRowOpen(self.tr('Fluid structure interaction'))
+
+ self.__hideRow()
+
+
+ def __hideRow(self):
+ """Only for developpement purpose"""
+ self.setRowClose(self.tr('Head losses'))
+ self.setRowClose(self.tr('Current species'))
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ BrowserView = BrowserView()
+ BrowserView.show()
+ sys.exit(app.exec_())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Base/CommandLine.py b/gui/Base/CommandLine.py
new file mode 100644
index 0000000..a3e0d32
--- /dev/null
+++ b/gui/Base/CommandLine.py
@@ -0,0 +1,209 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module describes what to do when the line command is parsed.
+
+This module defines the following functions:
+- usage
+- process_cmd_line
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, types, string, getopt
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Usage/help message
+#-------------------------------------------------------------------------------
+
+def usage():
+ """
+ Usage of the GUI.
+ """
+ txt="""
+Usage:\n\ncs_gui [options]... [xml file name]
+
+Valid options are one or more of the following:
+
+-f [xml file name]
+--file [xml file name]
+
+ Upload a previous case at the interface start.
+
+-n
+--new
+
+ Open a new case. None effect if '-f' option is used.
+
+-v
+--version
+
+ Prints the GUI version.
+
+-h
+--help
+
+ Prints this help message.
+
+-z
+--no-splash
+
+ Without splash screen.
+
+-m
+--matisse
+
+ Load matisse version.
+
+-b [batchfile]
+--batch (batchfile]
+
+ Set batchrunning window with batch file
+ (-f or --file option is mandatory).
+
+-t
+--no-tree
+
+ No tree window loaded.
+
+
+Examples:
+
+ cs_gui -f name_of_file.xml
+
+ cs_gui --file name_of_file.xml
+
+ cs_gui -n
+
+----------------------------------------------------------------------
+"""
+ return txt
+
+
+#-------------------------------------------------------------------------------
+# Processes the passed command line arguments
+#-------------------------------------------------------------------------------
+
+
+def process_cmd_line (arg):
+ """
+ Processes the passed command line arguments.
+
+ Input Argument:
+ arg -- This can be either a list of arguments as in
+ sys.argv[1:] or a string that is similar to the one
+ passed on the command line. If it is a string the
+ string is split to create a list of arguments.
+ Returned Values:
+ case -- Name of the file. If the variable case is set
+ to "new case" GUI is open with a new case.
+ """
+
+ # The "-n" option has none effect when "-f" is used
+ #
+ if ( ('-n' in arg) or ('--new' in arg) ) and \
+ ( ('-f' in arg) or ('--file' in arg) ):
+ try:
+ del arg[arg.index('-n')]
+ except:
+ del arg[arg.index('--new')]
+
+ # When xml file name is the only one argument
+ #
+ if type(arg) is types.StringType:
+ arg = "-f " + arg
+ arg = string.split(arg)
+
+ options = "f:b:mntrz"
+ long_opts = ['file=', 'batch=', 'matisse', 'new', 'no-tree', 'read-only', 'no-splash']
+
+ try:
+ opts, args = getopt.getopt(arg, options, long_opts)
+ except getopt.error, msg:
+ print "\nWarning:\n", msg
+ print usage()
+ print "Warning:\n", msg, "\n"
+ sys.exit(1)
+
+ if (opts and args) or len(args) > 1:
+ print usage()
+ sys.exit(1)
+
+ case = ""
+ matisse = False
+ batch_window = False
+ batch_file = 'lance'
+ tree_window = True
+ read_only = False
+ splash = True
+
+ if not opts and args :
+ case = args[0]
+
+ for o, a in opts:
+
+ if o in ('-f', '--file'):
+ case = a
+
+ if o in ('-n', '--new'):
+ case = "new case"
+
+ if o in ('-m', '--matisse'):
+ matisse = True
+
+ if o in ('-b', '--batch'):
+ batch_window = True
+ batch_file = os.path.basename(a)
+ if not case:
+ print usage()
+ sys.exit(1)
+
+ if o in ('-z', '--no-splash'):
+ splash = False
+
+ if o in ('-t', '--no-tree'):
+ tree_window = False
+
+ if o in ('-r', '--read-only'):
+ read_only = True
+
+
+ return case, splash, matisse, batch_window, batch_file, tree_window, read_only
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Base/Common.py b/gui/Base/Common.py
new file mode 100644
index 0000000..5176bbd
--- /dev/null
+++ b/gui/Base/Common.py
@@ -0,0 +1,68 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines global constant.
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Version number
+#-------------------------------------------------------------------------------
+
+base_path = os.path.dirname(os.path.abspath(__file__))
+version = os.path.join(os.path.dirname(base_path), "VERSION")
+
+f = open(version,'r')
+VERSION = f.read()
+f.close()
+
+#-------------------------------------------------------------------------------
+# Global Parameters
+#-------------------------------------------------------------------------------
+
+# xml_doc_version modifie le 10/12/07
+XML_DOC_VERSION = "1.0"
+
+LABEL_LENGTH_MAX = 32
+
+icon_base_path = os.path.join(base_path, 'icons')
+
+#-------------------------------------------------------------------------------
+# End of Common
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Base/IdForm.ui b/gui/Base/IdForm.ui
new file mode 100644
index 0000000..7b46e95
--- /dev/null
+++ b/gui/Base/IdForm.ui
@@ -0,0 +1,71 @@
+<ui version="4.0" >
+ <class>IdForm</class>
+ <widget class="QWidget" name="IdForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>627</width>
+ <height>100</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>IdForm</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Study:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Case:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEdit_2" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>XML file:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEdit_3" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>lineEdit</tabstop>
+ <tabstop>lineEdit_2</tabstop>
+ <tabstop>lineEdit_3</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Base/IdView.py b/gui/Base/IdView.py
new file mode 100644
index 0000000..f219927
--- /dev/null
+++ b/gui/Base/IdView.py
@@ -0,0 +1,114 @@
+# -*- coding: utf-8 -*-
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the main application classes for the Qt GUI.
+This GUI provides a simple way to display independante pages, in order to put
+informations in the XML document, which reflets the treated case.
+
+This module defines the following classes:
+- IdView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys
+from PyQt4 import QtGui, QtCore
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from IdForm import Ui_IdForm
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class IdView(QtGui.QWidget, Ui_IdForm):
+ """
+ Class for the identity dock widget
+ """
+ def __init__(self):
+ """
+ Constructor
+ """
+ QtGui.QWidget.__init__(self)
+ Ui_IdForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setStudyName(self, s):
+ """
+ Set the study name in the identity dock widget
+ """
+ self.lineEdit.setText(QtCore.QString.fromUtf8(str(s)))
+
+
+ def setCaseName(self, s):
+ """
+ Set the case name in the identity dock widget
+ """
+ self.lineEdit_2.setText(QtCore.QString.fromUtf8(str(s)))
+
+
+ def setXMLFileName(self, s):
+ """
+ Set the XML file name in the identity dock widget
+ """
+ self.lineEdit_3.setText(QtCore.QString.fromUtf8(str(s)))
+
+
+ def set(self, study=None, case=None, filename=None):
+ """
+ Set names in the identity dock widget
+ """
+ if study is not None:
+ self.lineEdit.setText(QtCore.QString.fromUtf8(str(study)))
+
+ if case is not None:
+ self.lineEdit_2.setText(QtCore.QString.fromUtf8(str(case)))
+
+ if filename is not None:
+ self.lineEdit_3.setText(QtCore.QString.fromUtf8(str(filename)))
+
+
+
+if __name__ == "__main__":
+
+ app = QtGui.QApplication(sys.argv)
+
+ IdView = IdView()
+ IdView.setStudyName("toto")
+ IdView.setCaseName("tata")
+ IdView.setXMLFileName("titi.xml")
+ IdView.show()
+
+ sys.exit(app.exec_())
\ No newline at end of file
diff --git a/gui/Base/MainForm.ui b/gui/Base/MainForm.ui
new file mode 100644
index 0000000..663ead9
--- /dev/null
+++ b/gui/Base/MainForm.ui
@@ -0,0 +1,427 @@
+<ui version="4.0" >
+ <author>A. DOUCE</author>
+ <class>MainForm</class>
+ <widget class="QMainWindow" name="MainForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>403</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Interface Code_Saturne</string>
+ </property>
+ <property name="dockOptions" >
+ <set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Sunken</enum>
+ </property>
+ <layout class="QGridLayout" />
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>403</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_File" >
+ <property name="title" >
+ <string>&File</string>
+ </property>
+ <widget class="QMenu" name="menuRecent" >
+ <property name="title" >
+ <string>Recent file</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/format-justify-fill.png</normaloff>:/icons/22x22/format-justify-fill.png</iconset>
+ </property>
+ </widget>
+ <addaction name="fileNewAction" />
+ <addaction name="fileOpenAction" />
+ <addaction name="menuRecent" />
+ <addaction name="separator" />
+ <addaction name="fileSaveAction" />
+ <addaction name="fileSaveAsAction" />
+ <addaction name="separator" />
+ <addaction name="fileCloseAction" />
+ <addaction name="fileQuitAction" />
+ </widget>
+ <widget class="QMenu" name="menuO_ptions" >
+ <property name="title" >
+ <string>&Tools</string>
+ </property>
+ <addaction name="openXtermAction" />
+ <addaction name="separator" />
+ <addaction name="displayCaseAction" />
+ </widget>
+ <widget class="QMenu" name="menu_Help" >
+ <property name="title" >
+ <string>&Help</string>
+ </property>
+ <widget class="QMenu" name="menu_User_manuals" >
+ <property name="title" >
+ <string>&User manuals</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/x-office-address-book.png</normaloff>:/icons/22x22/x-office-address-book.png</iconset>
+ </property>
+ <addaction name="displayCSManualAction" />
+ <addaction name="displayCSTutorialAction" />
+ <addaction name="displayCSKernelAction" />
+ <addaction name="displayCSRefcardAction" />
+ </widget>
+ <addaction name="displayAboutAction" />
+ <addaction name="displayLicenceAction" />
+ <addaction name="separator" />
+ <addaction name="menu_User_manuals" />
+ </widget>
+ <widget class="QMenu" name="menu_Window" >
+ <property name="title" >
+ <string>&Window</string>
+ </property>
+ <addaction name="IdentityAction" />
+ <addaction name="BrowserAction" />
+ <addaction name="separator" />
+ <addaction name="backgroundColorAction" />
+ <addaction name="actionFont" />
+ </widget>
+ <addaction name="menu_File" />
+ <addaction name="menuO_ptions" />
+ <addaction name="menu_Window" />
+ <addaction name="menu_Help" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ <widget class="QToolBar" name="toolBar" >
+ <property name="windowTitle" >
+ <string>toolBar</string>
+ </property>
+ <attribute name="toolBarArea" >
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
+ </attribute>
+ <addaction name="fileNewAction" />
+ <addaction name="fileOpenAction" />
+ <addaction name="fileSaveAction" />
+ <addaction name="fileCloseAction" />
+ <addaction name="fileQuitAction" />
+ </widget>
+ <widget class="QToolBar" name="toolBar_2" >
+ <property name="windowTitle" >
+ <string>toolBar_2</string>
+ </property>
+ <attribute name="toolBarArea" >
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
+ </attribute>
+ <addaction name="displayCaseAction" />
+ </widget>
+ <widget class="QDockWidget" name="dockWidgetIdentity" >
+ <attribute name="dockWidgetArea" >
+ <number>4</number>
+ </attribute>
+ <widget class="QWidget" name="dockWidgetIdentityContents" />
+ </widget>
+ <widget class="QDockWidget" name="dockWidgetBrowser" >
+ <attribute name="dockWidgetArea" >
+ <number>1</number>
+ </attribute>
+ <widget class="QWidget" name="dockWidgetBrowserContents" />
+ </widget>
+ <action name="fileOpenAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/document-open.png</normaloff>:/icons/22x22/document-open.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Open</string>
+ </property>
+ <property name="toolTip" >
+ <string>Open an existing case</string>
+ </property>
+ <property name="statusTip" >
+ <string>Open an existing case.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+O</string>
+ </property>
+ </action>
+ <action name="fileNewAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/document-new.png</normaloff>:/icons/22x22/document-new.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&New file</string>
+ </property>
+ <property name="statusTip" >
+ <string>Open a new case.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ <action name="fileSaveAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/document-save.png</normaloff>:/icons/22x22/document-save.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Save</string>
+ </property>
+ <property name="statusTip" >
+ <string>Save the current case.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action name="fileSaveAsAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/document-save-as.png</normaloff>:/icons/22x22/document-save-as.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Sa&ve as ...</string>
+ </property>
+ <property name="statusTip" >
+ <string>Save as.</string>
+ </property>
+ </action>
+ <action name="fileCloseAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/process-stop.png</normaloff>:/icons/22x22/process-stop.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Close</string>
+ </property>
+ <property name="statusTip" >
+ <string>Close</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+W</string>
+ </property>
+ </action>
+ <action name="openXtermAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/utilities-terminal.png</normaloff>:/icons/22x22/utilities-terminal.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Open shell</string>
+ </property>
+ <property name="statusTip" >
+ <string>Open shell</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+T</string>
+ </property>
+ </action>
+ <action name="displayCaseAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/document-properties.png</normaloff>:/icons/22x22/document-properties.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Current case displaying</string>
+ </property>
+ <property name="statusTip" >
+ <string>Current case displaying.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+P</string>
+ </property>
+ </action>
+ <action name="reload_modulesAction" >
+ <property name="icon" >
+ <iconset>
+ <normaloff>:/icons/22x22/view-refresh.png</normaloff>:/icons/22x22/view-refresh.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Reload all loaded modules</string>
+ </property>
+ <property name="statusTip" >
+ <string>Reload all loaded modules.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+A</string>
+ </property>
+ </action>
+ <action name="reload_pageAction" >
+ <property name="icon" >
+ <iconset>
+ <normaloff>:/icons/22x22/view-refresh.png</normaloff>:/icons/22x22/view-refresh.png</iconset>
+ </property>
+ <property name="text" >
+ <string>R&eload the loaded page</string>
+ </property>
+ <property name="statusTip" >
+ <string>Reload the loaded page.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+R</string>
+ </property>
+ </action>
+ <action name="displayAboutAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/help-browser.png</normaloff>:/icons/22x22/help-browser.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&About</string>
+ </property>
+ <property name="statusTip" >
+ <string>About.</string>
+ </property>
+ </action>
+ <action name="displayLicenceAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/application-certificate.png</normaloff>:/icons/22x22/application-certificate.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Licence</string>
+ </property>
+ <property name="statusTip" >
+ <string>Licence.</string>
+ </property>
+ </action>
+ <action name="displayCSManualAction" >
+ <property name="text" >
+ <string>&Code_Saturne</string>
+ </property>
+ <property name="statusTip" >
+ <string>Code_Saturne user manual.</string>
+ </property>
+ <property name="shortcut" >
+ <string>F1</string>
+ </property>
+ </action>
+ <action name="displayCSTutorialAction" >
+ <property name="text" >
+ <string>&Code_Saturne tutorial</string>
+ </property>
+ <property name="statusTip" >
+ <string>Code_Saturne tutorial.</string>
+ </property>
+ <property name="shortcut" >
+ <string>F2</string>
+ </property>
+ </action>
+ <action name="displayCSKernelAction" >
+ <property name="text" >
+ <string>&Code_Saturne Kernel</string>
+ </property>
+ <property name="statusTip" >
+ <string>Code_Saturne theory and programmer's guide.</string>
+ </property>
+ <property name="shortcut" >
+ <string>F3</string>
+ </property>
+ </action>
+ <action name="displayCSRefcardAction" >
+ <property name="text" >
+ <string>&Code_Saturne reference card</string>
+ </property>
+ <property name="statusTip" >
+ <string>Code_Saturne quick reference card.</string>
+ </property>
+ <property name="shortcut" >
+ <string>F4</string>
+ </property>
+ </action>
+ <action name="IdentityAction" >
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ <property name="text" >
+ <string>&Identity</string>
+ </property>
+ <property name="statusTip" >
+ <string>Show/Hide the identity window.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+I</string>
+ </property>
+ </action>
+ <action name="BrowserAction" >
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ <property name="text" >
+ <string>&Browser</string>
+ </property>
+ <property name="statusTip" >
+ <string>Show/Hide the browser window.</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+B</string>
+ </property>
+ </action>
+ <action name="fileQuitAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/system-log-out.png</normaloff>:/icons/22x22/system-log-out.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Quit</string>
+ </property>
+ <property name="statusTip" >
+ <string>Quit</string>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+Q</string>
+ </property>
+ </action>
+ <action name="backgroundColorAction" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/preferences-desktop-wallpaper.png</normaloff>:/icons/22x22/preferences-desktop-wallpaper.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Background color</string>
+ </property>
+ </action>
+ <action name="actionFont" >
+ <property name="icon" >
+ <iconset resource="resource_base.qrc" >
+ <normaloff>:/icons/22x22/preferences-desktop-font.png</normaloff>:/icons/22x22/preferences-desktop-font.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Font</string>
+ </property>
+ </action>
+ </widget>
+ <resources>
+ <include location="resource_base.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Base/MainView.py b/gui/Base/MainView.py
new file mode 100644
index 0000000..0a43ce2
--- /dev/null
+++ b/gui/Base/MainView.py
@@ -0,0 +1,1036 @@
+# -*- coding: utf-8 -*-
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+This module defines the main application classes for the Qt GUI.
+This GUI provides a simple way to display independante pages, in order to put
+informations in the XML document, which reflets the treated case.
+
+This module defines the following classes:
+- MainView
+
+ @copyright: 1998-2009 EDF S.A., France
+ @author: U{EDF R&D<mailto:saturne-support at edf.fr>}
+ @license: GNU GPL v2, see COPYING for details.
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import os, sys, string, shutil, signal, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules
+#-------------------------------------------------------------------------------
+
+from MainForm import Ui_MainForm
+from IdView import IdView
+from BrowserView import BrowserView
+import XMLengine
+from XMLinitialize import *
+from XMLmodel import *
+from Toolbox import GuiParam, displaySelectedPage
+from Common import VERSION, XML_DOC_VERSION
+
+try:
+ import Pages
+except:
+ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+from Pages.WelcomeView import WelcomeView
+from Pages.IdentityAndPathesModel import IdentityAndPathesModel
+from Pages.BatchRunningModel import BatchRunningModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MainView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main Window
+#-------------------------------------------------------------------------------
+
+class MainView(QMainWindow, Ui_MainForm):
+
+ NextId = 1
+ Instances = set()
+
+ def __init__(self,
+ cmd_case = "",
+ cmd_matisse = False,
+ cmd_batch_window = False,
+ cmd_batch_file = 'runcase',
+ cmd_tree_window = True,
+ cmd_read_only = False,
+ cmd_salome = False):
+ """
+ Initializes a Main Window for a new document:
+ 1. finish the Main Window layout
+ 2. connection betwenn signal and slot
+ 3. Ctrl+C signal handler
+ 4. create some instance variables
+ 5. restore system settings
+
+ @type cmd_case:
+ @param cmd_case:
+ """
+ QMainWindow.__init__(self)
+ Ui_MainForm.__init__(self)
+
+ self.setupUi(self)
+
+ self.setAttribute(Qt.WA_DeleteOnClose)
+ MainView.Instances.add(self)
+
+ self.Id = IdView()
+ self.dockWidgetIdentity.setWidget(self.Id)
+
+ self.Browser = BrowserView()
+ self.dockWidgetBrowser.setWidget(self.Browser)
+
+ self.scrollArea = QScrollArea(self.frame)
+ self.gridlayout1.addWidget(self.scrollArea,0,0,1,1)
+ self.gridlayout1.setMargin(0)
+ self.gridlayout1.setSpacing(0)
+ self.gridlayout.addWidget(self.frame,0,0,1,1)
+
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setFrameShape(QFrame.StyledPanel)
+ self.scrollArea.setFrameShadow(QFrame.Raised)
+ self.scrollArea.setFrameStyle(QFrame.NoFrame)
+
+ # connections
+
+ self.connect(self.fileOpenAction, SIGNAL("activated()"), self.fileOpen)
+ self.connect(self.fileNewAction, SIGNAL("activated()"), self.fileNew)
+ self.connect(self.menuRecent, SIGNAL("aboutToShow()"), self.updateRecentFileMenu)
+ self.connect(self.fileSaveAction, SIGNAL("activated()"), self.fileSave)
+ self.connect(self.fileSaveAsAction, SIGNAL("activated()"), self.fileSaveAs)
+ self.connect(self.fileCloseAction, SIGNAL("activated()"), self.close)
+ self.connect(self.fileQuitAction, SIGNAL("activated()"), self.fileQuit)
+
+ self.connect(self.openXtermAction, SIGNAL("activated()"), self.openXterm)
+ self.connect(self.displayCaseAction, SIGNAL("activated()"), self.displayCase)
+ self.connect(self.reload_modulesAction, SIGNAL("activated()"), self.reload_modules)
+ self.connect(self.reload_pageAction, SIGNAL("activated()"), self.reload_page)
+
+ self.connect(self.IdentityAction, SIGNAL("toggled(bool)"), self.dockWidgetIdentityDisplay)
+ self.connect(self.BrowserAction, SIGNAL("toggled(bool)"), self.dockWidgetBrowserDisplay)
+
+ self.connect(self.displayAboutAction, SIGNAL("activated()"), self.displayAbout)
+ self.connect(self.backgroundColorAction, SIGNAL("activated()"), self.setColor)
+ self.connect(self.actionFont, SIGNAL("activated()"), self.setFontSize)
+
+ self.connect(self.displayLicenceAction, SIGNAL("activated()"), self.displayLicence)
+ #self.connect(self.displayConfigAction, SIGNAL("activated()"), self.displayConfig)
+ self.connect(self.displayCSManualAction, SIGNAL("activated()"), self.displayCSManual)
+ self.connect(self.displayCSTutorialAction, SIGNAL("activated()"), self.displayCSTutorial)
+ self.connect(self.displayCSKernelAction, SIGNAL("activated()"), self.displayCSKernel)
+ self.connect(self.displayCSRefcardAction, SIGNAL("activated()"), self.displayCSRefcard)
+
+ # connection for page layout
+
+ self.connect(self.Browser.treeView, SIGNAL("pressed(const QModelIndex &)"), self.displayNewPage)
+ self.connect(self, SIGNAL("destroyed(QObject*)"), MainView.updateInstances)
+
+ # Ctrl+C signal handler (allow to shutdown the GUI with Ctrl+C)
+
+ signal.signal(signal.SIGINT, signal.SIG_DFL)
+
+ # create some instance variables
+
+ self.cmd_case = cmd_case
+ self.salome = cmd_salome
+ self.batch = cmd_batch_window
+ self.batch_file = cmd_batch_file
+ self.tree_w = cmd_tree_window
+ self.read_o = cmd_read_only
+ self.notree = 0
+
+ self.resize(800, 700)
+ #self.setMaximumSize(QSize(2000, 900))
+
+ # restore system settings
+
+ settings = QSettings()
+ self.recentFiles = settings.value("RecentFiles").toStringList()
+ self.restoreGeometry(
+ settings.value("MainWindow/Geometry").toByteArray())
+ self.restoreState(
+ settings.value("MainWindow/State").toByteArray())
+
+ color = settings.value("MainWindow/Color",
+ QVariant(self.palette().color(QPalette.Window).name()))
+ color = QColor(color.toString())
+ if color.isValid():
+ self.setPalette(QPalette(color))
+ app = QCoreApplication.instance()
+ app.setPalette(QPalette(color))
+
+ f = settings.value("MainWindow/Font",
+ QVariant(self.font().toString()))
+ if (f.isValid()):
+ font = QFont()
+ if (font.fromString(f.toString())):
+ self.setFont(font)
+ app = QCoreApplication.instance()
+ app.setFont(font)
+
+ title = self.tr("Code_Saturne GUI")
+ self.setWindowTitle(title)
+ self.updateRecentFileMenu()
+ QTimer.singleShot(0, self.loadInitialFile)
+
+ self.statusbar.setSizeGripEnabled(False)
+ self.statusbar.showMessage(self.tr("Ready"), 5000)
+# self.setMaximumSize(QSize(700, 600))
+# self.setMinimumSize(QSize(700, 600))
+
+ @staticmethod
+ def updateInstances(qobj):
+ """
+ Overwrites the Instances set with a set that contains only those
+ window instances that are still alive.
+ """
+ MainView.Instances = set([window for window \
+ in MainView.Instances if isAlive(window)])
+
+
+ def loadInitialFile(self):
+ """
+ Private method.
+
+ Checks the opening mode (from command line).
+ """
+ log.debug("loadInitialFile -> %s" % self.cmd_case)
+
+ # 1) new case
+
+ if self.cmd_case == "new case":
+ MainView.NextId += 1
+ self.fileNew()
+ self.dockWidgetBrowserDisplay(True)
+
+ # 2) existing case
+
+ elif self.cmd_case:
+ try:
+ self.loadFile(self.cmd_case)
+ self.dockWidgetBrowserDisplay(True)
+ except:
+ raise
+
+ # 3) neutral point (default page layout)
+
+ else:
+ self.displayWelcomePage()
+ self.dockWidgetBrowserDisplay(False)
+
+
+ @pyqtSignature("bool")
+ def dockWidgetIdentityDisplay(self, bool=True):
+ """
+ Private slot.
+
+ Show or hide the the identity dock window.
+
+ @type bool: C{True} or C{False}
+ @param bool: if C{True}, shows the identity dock window
+ """
+ if bool:
+ self.dockWidgetIdentity.show()
+ else:
+ self.dockWidgetIdentity.hide()
+
+
+ @pyqtSignature("bool")
+ def dockWidgetBrowserDisplay(self, bool=True):
+ """
+ Private slot.
+
+ Show or hide the browser dock window.
+
+ @type bool: C{True} or C{False}
+ @param bool: if C{True}, shows the browser dock window
+ """
+ if bool:
+ self.dockWidgetBrowser.show()
+ else:
+ self.dockWidgetBrowser.hide()
+
+
+ @pyqtSignature("")
+ def updateRecentFileMenu(self):
+ """
+ private method
+
+ update the File menu with the recent files list
+ """
+ self.menuRecent.clear()
+
+ if hasattr(self, 'case'):
+ current = QString(self.case['xmlfile'])
+ else:
+ current = QString()
+
+ recentFiles = []
+ for f in self.recentFiles:
+ if f != current and QFile.exists(f):
+ recentFiles.append(f)
+
+ if recentFiles:
+ for i, f in enumerate(recentFiles):
+ action = QAction(QIcon(":/icons/22x22/document-open.png"), "&%d %s" % (
+ i + 1, QFileInfo(f).fileName()), self)
+ action.setData(QVariant(f))
+ self.connect(action,
+ SIGNAL("triggered()"),
+ self.loadRecentFile)
+ self.menuRecent.addAction(action)
+
+
+ def addRecentFile(self, fname):
+ """
+ private method
+
+ creates and update the list of the recent files
+
+ @type fname: C{str}
+ @param fname: filename to add in the recent files list
+ """
+ if fname is None:
+ return
+ if not self.recentFiles.contains(fname):
+ self.recentFiles.prepend(QString(fname))
+ while self.recentFiles.count() > 9:
+ self.recentFiles.takeLast()
+
+
+ def initializeBatchRunningWindow(self):
+ """
+ initializes variables concerning the display of batchrunning
+ """
+ self.IdPthMdl = IdentityAndPathesModel(self.case)
+ fic = self.IdPthMdl.getXmlFileName()
+
+ if not fic:
+ file_name = os.getcwd()
+ if os.path.basename(f) == 'DATA': file_name = os.path.dirname(file_name)
+ self.IdPthMdl.setCasePath(file_name)
+ else:
+ file_dir = os.path.split(fic)[0]
+ if file_dir:
+ self.IdPthMdl.setCasePath(os.path.split(file_dir)[0])
+ if not os.path.basename(file_dir) == 'DATA':
+ self.IdPthMdl.setCasePath(file_dir)
+ else:
+ file_dir = os.path.split(os.getcwd())[0]
+ self.IdPthMdl.setCasePath(file_dir)
+
+ for p, rep in [('data_path', 'DATA'),
+ ('resu_path', 'RESU'),
+ ('user_src_path', 'SRC'),
+ ('scripts_path', 'SCRIPTS')]:
+ self.IdPthMdl.setPathI(p,file_dir + '/' + rep)
+ self.IdPthMdl.setRelevantSubdir("yes", "")
+
+ self.IdPthMdl.setPathI('mesh_path',
+ os.path.abspath(os.path.split(file_dir)[0] + '/' + 'MESH'))
+ self.case['computer'] = 'station'
+ self.case['batchScript'] = {'pbs': '', 'station': self.batch_file}
+ self.case['backupBatchScript'] = {'pbs': 'no', 'station': 'yes'}
+ del IdentityAndPathesModel
+
+ self.updateStudyId()
+
+
+ def closeEvent(self, event):
+ """
+ public slot
+
+ try to quit all the current MainWindow
+ """
+ if self.okToContinue():
+ settings = QSettings()
+ if self.recentFiles:
+ recentFiles = QVariant(self.recentFiles)
+ else:
+ recentFiles = QVariant()
+ #recentFiles = QVariant(self.recentFiles) \
+ # if self.recentFiles else QVariant()
+ settings.setValue("RecentFiles", recentFiles)
+ settings.setValue("MainWindow/Geometry",
+ QVariant(self.saveGeometry()))
+ settings.setValue("MainWindow/State",
+ QVariant(self.saveState()))
+ settings.setValue("MainWindow/Color",
+ QVariant(self.palette().color(QPalette.Window).name()))
+ settings.setValue("MainWindow/Font",
+ QVariant(self.font().toString()))
+
+ event.accept()
+ log.debug("closeEvent -> accept")
+
+ else:
+ event.ignore()
+ log.debug("closeEvent -> ignore")
+
+
+ def okToContinue(self):
+ """
+ private method
+
+ ask for unsaved changes before quit
+
+ @return: C{True} or C{False}
+ """
+ title = self.tr("Quit")
+ msg = self.tr("Save unsaved changes?")
+
+ if hasattr(self, 'case'):
+ log.debug("okToContinue -> %s" % self.case.isModified())
+
+ if hasattr(self, 'case') and self.case.isModified():
+ reply = QMessageBox.question(self,
+ title,
+ msg,
+ QMessageBox.Yes|
+ QMessageBox.No|
+ QMessageBox.Cancel)
+ if reply == QMessageBox.Cancel:
+ return False
+ elif reply == QMessageBox.Yes:
+ self.fileSave()
+
+ return True
+
+
+ @pyqtSignature("")
+ def fileQuit(self):
+ """
+ Public slot.
+
+ try to quit all window
+ """
+ QApplication.closeAllWindows()
+
+
+ @pyqtSignature("")
+ def fileNew(self):
+ """
+ Public slot.
+
+ create new Code_Saturne case
+ """
+ if not hasattr(self, 'case'):
+ self.case = XMLengine.Case()
+ self.case.root()['version'] = XML_DOC_VERSION
+ XMLinit(self.case)
+ title = self.tr("New parameters set") + " - " + self.tr("Code_Saturne GUI")
+ self.setWindowTitle(title)
+
+ self.Browser.configureTree(self.case)
+ self.dockWidgetBrowserDisplay(True)
+
+ self.case['salome'] = self.salome
+
+ p = displaySelectedPage('Identity and paths',
+ self,
+ self.case,
+ stbar=self.statusbar,
+ study=self.Id,
+ tree=self.Browser)
+ self.scrollArea.setWidget(p)
+
+ self.case['saved'] = "yes"
+
+ else:
+ MainView(cmd_case="new case").show()
+
+
+ def fileAlreadyLoaded(self, f):
+ """
+ private method
+
+ check if the file to load is not already loaded
+
+ @type fname: C{str}
+ @param fname: file name to load
+ @return: C{True} or C{False}
+ """
+ for win in MainView.Instances:
+ if isAlive(win) and hasattr(win, 'case') \
+ and win.case['xmlfile'] == f:
+ win.activateWindow()
+ win.raise_()
+ return True
+ return False
+
+
+ def loadRecentFile(self, file_name=None):
+ """
+ private slot
+
+ reload an existing recent file
+
+ @type fname: C{str}
+ @param fname: file name to load
+ """
+ # reload from File menu
+ if file_name is None:
+ action = self.sender()
+ if isinstance(action, QAction):
+ file_name = unicode(action.data().toString())
+ if not self.okToContinue():
+ return
+ else:
+ return
+
+ # check if the file to load is not already loaded
+ if hasattr(self, 'case'):
+ if not self.fileAlreadyLoaded(file_name):
+ MainView(cmd_case = file_name).show()
+ else:
+ self.loadFile(file_name)
+
+
+ def loadFile(self, file_name=None):
+ """
+ Private method
+
+ Load an existing file.
+
+ @type fname: C{str}
+ @param fname: file name to load
+ """
+ #file_name = unicode(file_name)
+ file_name = os.path.abspath(str(file_name))
+ fn = os.path.basename(file_name)
+ log.debug("loadFile -> %s" % file_name)
+
+ # Instantiate a new case
+
+ try:
+ self.case = XMLengine.Case(file_name)
+ except:
+ err = QErrorMessage(self)
+ msg = self.tr("XML file reading error. "\
+ "This file is not in accordance with XML "\
+ "specifications. Please correct it and verify "\
+ "it with XMLcheck tool.")
+ err.showMessage(msg)
+ if hasattr(self, 'case'):
+ delattr(self, 'case')
+ return
+
+ self.addRecentFile(fn)
+
+ # Cleaning the '\n' and '\t' from file_name (except in formula)
+ self.case.xmlCleanAllBlank(self.case.xmlRootNode())
+
+ try:
+ XMLinit(self.case)
+ except:
+ err = QErrorMessage(self)
+ msg = self.tr("XML file reading error. "\
+ "Perhaps the version of the file is to old.")
+ err.showMessage(msg)
+ if hasattr(self, 'case'):
+ delattr(self, 'case')
+ return
+
+ self.Browser.configureTree(self.case)
+ self.dockWidgetBrowserDisplay(True)
+
+ self.case['salome'] = self.salome
+
+ # Update the case and the StudyIdBar
+ self.case['xmlfile'] = file_name
+ title = fn + " - " + self.tr("Code_Saturne GUI")
+ self.setWindowTitle(title)
+
+ msg = self.tr("Loaded: %s" % fn)
+ self.statusbar.showMessage(msg, 2000)
+
+ p = displaySelectedPage('Identity and paths',
+ self,
+ self.case,
+ stbar=self.statusbar,
+ study=self.Id,
+ tree=self.Browser)
+ self.scrollArea.setWidget(p)
+
+ self.case['saved'] = "yes"
+
+ # Update the Tree Navigator layout
+
+ if self.batch == True:
+ self.initializeBatchRunningWindow()
+ self.currentEntry = 'Prepare batch calculation'
+
+
+ @pyqtSignature("")
+ def fileOpen(self):
+ """
+ public slot
+
+ open an existing file
+ """
+ msg = self.tr("Opening an existing case.")
+ self.statusbar.showMessage(msg, 2000)
+
+ title = self.tr("Open existing file.")
+
+ if hasattr(self, 'case') and os.path.isdir(self.case['data_path']):
+ path = self.case['data_path']
+ else:
+ path = os.getcwd()
+ if os.path.isdir(path + "/../DATA"): path = path + "/../DATA"
+
+ filetypes = self.tr("Code_Saturne GUI files (*.xml);;""All Files (*)")
+
+ file_name = QFileDialog.getOpenFileName(self, title, path, filetypes)
+
+ if file_name.isEmpty() or file_name.isNull():
+ msg = self.tr("Loading aborted")
+ self.statusbar.showMessage(msg, 2000)
+ file_name = None
+ return
+ else:
+ #file_name = unicode(file_name)
+ file_name = str(file_name)
+ log.debug("fileOpen -> %s" % file_name)
+
+ if hasattr(self, 'case'):
+ if not self.fileAlreadyLoaded(file_name):
+ MainView(cmd_case = file_name).show()
+ else:
+ self.loadFile(file_name)
+
+ self.statusbar.clearMessage()
+
+
+ @pyqtSignature("")
+ def openXterm(self):
+ """
+ public slot
+
+ open an xterm window
+ """
+ if hasattr(self, 'case'):
+ os.system('cd ' + self.case['case_path'] + ' && xterm -sb &')
+ else:
+ os.system('xterm -sb&')
+
+
+ @pyqtSignature("")
+ def displayCase(self):
+ """
+ public slot
+
+ print the case (xml file) on the current terminal
+ """
+ if hasattr(self, 'case'):
+ print self.case
+
+
+ def updateStudyId(self):
+ """
+ private method
+
+ update the Study Identity dock widget
+ """
+ study = self.case.root().xmlGetAttribute('study')
+ case = self.case.root().xmlGetAttribute('case')
+ file_name = XMLengine._encode(self.case['xmlfile'])
+ self.Id.setStudyName(study)
+ self.Id.setCaseName(case)
+ self.Id.setXMLFileName(file_name)
+
+
+ @pyqtSignature("")
+ def fileSave(self):
+ """
+ public slot
+
+ save the current case
+ """
+ log.debug("fileSave()")
+
+ if not hasattr(self, 'case'):
+ return
+
+ file_name = self.case['xmlfile']
+ log.debug("fileSave(): %s" % file_name)
+ if not file_name:
+ self.fileSaveAs()
+ return
+
+ log.debug("fileSave(): %s" % os.path.dirname(file_name))
+ log.debug("fileSave(): %s" % os.access(os.path.dirname(file_name), os.W_OK))
+ if not os.access(os.path.dirname(file_name), os.W_OK):
+ title = self.tr("Save error")
+ msg = self.tr("Failed to write %s " % file_name)
+ QMessageBox.critical(self, title, msg)
+ msg = self.tr("Saving aborted")
+ self.statusbar.showMessage(msg, 2000)
+ return
+
+ self.updateStudyId()
+ self.case.xmlSaveDocument()
+
+ log.debug("fileSave(): ok")
+
+ msg = self.tr("%s saved" % file_name)
+ self.statusbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("")
+ def fileSaveAs(self):
+ """
+ public slot
+
+ save the current case with a new name
+ """
+ log.debug("fileSaveAs()")
+
+ if hasattr(self,'case'):
+ fname = QFileDialog.getSaveFileName(self,
+ self.tr("Save File As"),
+ self.case['data_path'],
+ self.tr("Code_Saturne GUI file (*.xml);;All files (*)"))
+
+ if not fname.isEmpty():
+ f = str(fname)
+ self.case['xmlfile'] = f
+ self.addRecentFile(f)
+ self.fileSave()
+ self.updateStudyId()
+ self.case.xmlSaveDocument()
+ title = os.path.basename(self.case['xmlfile']) + " - " + self.tr("Code_Saturne GUI")
+ self.setWindowTitle(title)
+
+ for k,v in self.case['batchScript'].items():
+ if v:
+ self.case['computer'] = k
+ mdl = BatchRunningModel(self.case)
+ mdl.updateBatchScriptFile('PARAM')
+ else:
+ msg = self.tr("Saving aborted")
+ self.statusbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("")
+ def reload_modules(self):
+ """
+ public slot
+
+ reload all the currently loaded modules, and then update the GUI
+ """
+ log.debug("reload_modules()")
+ title = self.tr("Warning")
+ msg = self.tr("This reloads all the currently loaded modules. "\
+ "This is a feature useful only for developers. You might "\
+ "see funny behaviour for already instantiated objects.\n\n"\
+ "Are you sure you want to do this?")
+
+ ans = QMessageBox.question(self, title, msg,
+ QMessageBox.Yes|
+ QMessageBox.No)
+
+ if ans == QMessageBox.Yes:
+ self.scrollArea.widget().close()
+ reload_all_modules()
+ p = displaySelectedPage(self.case['currentPage'],
+ self,
+ self.case,
+ stbar=self.statusbar,
+ study=self.Id,
+ tree=self.Browser)
+ self.scrollArea.setWidget(p)
+
+
+ @pyqtSignature("")
+ def reload_page(self):
+ """
+ public slot
+
+ reload the current loaded page
+ """
+ log.debug("reload_page()")
+ title = self.tr("Warning")
+ msg = self.tr("This reloads all the current loaded page. "\
+ "This is a feature useful only for developers. You might "\
+ "see funny behaviour for already instantiated objects.\n\n"\
+ "Are you sure you want to do this?")
+
+ ans = QMessageBox.question(self, title, msg,
+ QMessageBox.Yes|
+ QMessageBox.No)
+
+ if ans == QMessageBox.Yes:
+ self.scrollArea.widget().close()
+ reload_current_page()
+ p = displaySelectedPage(self.case['currentPage'],
+ self,
+ self.case,
+ stbar=self.statusbar,
+ study=self.Id,
+ tree=self.Browser)
+ self.scrollArea.setWidget(p)
+
+
+ @pyqtSignature("")
+ def displayAbout(self):
+ """
+ public slot
+
+ the About dialog window shows:
+ - title
+ - version
+ - contact
+ """
+ msg = "Code_Saturne\n" +\
+ "version " + VERSION + "\n" +\
+ "For information about this application " +\
+ "please contact:\n\n" +\
+ "saturne-support at edf.fr\n\n" +\
+ "Please visit our site:\n" +\
+ "http://www.code-saturne.org"
+ QMessageBox.about(self, 'Code_Saturne Interface', msg)
+
+
+ @pyqtSignature("")
+ def displayLicence(self):
+ """
+ public slot
+
+ GNU GPL license dialog window
+ """
+ QMessageBox.about(self, 'Code_Saturne Interface', "see COPYING file") # TODO
+
+
+ @pyqtSignature("")
+ def displayConfig(self):
+ """
+ public slot
+
+ configuration information window
+ """
+ QMessageBox.about(self, 'Code_Saturne Interface', "see config.py") # TODO
+
+
+ def displayManual(self, manual, reader = None):
+ """
+ private method
+
+ open a manual
+ """
+ try:
+ import cs_info
+ except:
+ QMessageBox.warning(self, 'Code_Saturne Interface',
+ "The module 'cs_info' is not available.")
+ return
+ argv_info = ['--guide']
+ argv_info.append(manual)
+ cs_info.main(argv_info)
+
+
+ @pyqtSignature("")
+ def displayCSManual(self):
+ """
+ public slot
+
+ open the user manual
+ """
+ self.displayManual('user')
+
+
+ @pyqtSignature("")
+ def displayCSTutorial(self):
+ """
+ public slot
+
+ open the tutorial for Code_Saturne
+ """
+ self.displayManual('tutorial')
+
+
+ @pyqtSignature("")
+ def displayCSKernel(self):
+ """
+ public slot
+
+ open the theory and programmer's guide
+ """
+ self.displayManual('theory')
+
+
+ @pyqtSignature("")
+ def displayCSRefcard(self):
+ """
+ public slot
+
+ open the quick reference card for Code_Saturne
+ """
+ self.displayManual('refcard')
+
+
+ @pyqtSignature("const QModelIndex &")
+ def displayNewPage(self, index):
+ """
+ private slot
+
+ display a new page when the Browser send the order
+
+ @type index: C{QModelIndex}
+ @param index: index of the item in the C{QTreeView} clicked in the browser
+ """
+ # stop if the entry is a folder or a file
+
+ if self.Browser.isFolder(): return
+
+ # warning and stop if is no case
+ if not hasattr(self, 'case'):
+ log.debug("displayNewPage(): no attr. 'case', return ")
+
+ msg = self.tr("You have to create a new case or load\n"\
+ "an existing case before selecting an item")
+ w = QMessageBox(self)
+ w.information(self,
+ self.tr("Warning"),
+ msg,
+ self.tr('OK'))
+ return
+
+ self.page = self.Browser.display(self,
+ self.case,
+ self.statusbar,
+ self.Id,
+ self.Browser)
+
+ if self.page is not None:
+ #self.page.resize(600,500)
+ self.scrollArea.setWidget(self.page)
+
+ else:
+ log.debug("displayNewPage() self.page == None")
+ raise
+
+
+ def displayWelcomePage(self):
+ """
+ private method
+
+ display the Welcome (and the default) page
+ """
+ self.page = WelcomeView()
+ #self.page.resize(600,500)
+ self.scrollArea.setWidget(self.page)
+ #self.gridlayout2.addWidget(self.page, 0, 0)
+
+
+ @pyqtSignature("")
+ def setColor(self):
+ """
+ public slot
+
+ choose GUI color
+ """
+ c = self.palette().color(QPalette.Window)
+ color = QColorDialog.getColor(c, self)
+ if color.isValid():
+ self.setPalette(QPalette(color))
+ app = QCoreApplication.instance()
+ app.setPalette(QPalette(color))
+
+
+ @pyqtSignature("")
+ def setFontSize(self):
+ """
+ public slot
+
+ choose GUI font
+ """
+ font, ok = QFontDialog.getFont(self)
+ log.debug("setFont -> %s" % ok)
+ if ok:
+ self.setFont(font)
+ app = QCoreApplication.instance()
+ app.setFont(font)
+
+
+ def tr(self, text):
+ """
+ private method
+
+ translation
+
+ @param text: text to translate
+ @return: translated text
+ """
+ return text
+
+
+def isAlive(qobj):
+ """
+ return True if the object qobj exist
+
+ @param qobj: the name of the attribute
+ @return: C{True} or C{False}
+ """
+ import sip
+ try:
+ sip.unwrapinstance(qobj)
+ except RuntimeError:
+ return False
+ return True
+
+
+#-------------------------------------------------------------------------------
+# Local main program
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ Main = MainView()
+ Main.show()
+ sys.exit(app.exec_())
diff --git a/gui/Base/Makefile.am b/gui/Base/Makefile.am
new file mode 100644
index 0000000..24c233c
--- /dev/null
+++ b/gui/Base/Makefile.am
@@ -0,0 +1,48 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+all-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --build $(srcdir)
+
+clean-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --clean $(srcdir)
+
+# Install Python library
+
+basedir = $(pkgpythondir)/Base
+base_PYTHON = \
+__init__.py \
+resource_base_rc.py \
+BrowserForm.py \
+BrowserView.py \
+CommandLine.py \
+Common.py \
+IdForm.py \
+IdView.py \
+MainForm.py \
+MainView.py \
+QtPage.py \
+Toolbox.py \
+XMLengine.py \
+XMLinitialize.py \
+XMLmodel.py \
+XMLvariables.py
diff --git a/gui/Base/Makefile.in b/gui/Base/Makefile.in
new file mode 100644
index 0000000..7b9924f
--- /dev/null
+++ b/gui/Base/Makefile.in
@@ -0,0 +1,510 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = gui/Base
+DIST_COMMON = $(base_PYTHON) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(basedir)"
+basePYTHON_INSTALL = $(INSTALL_DATA)
+py_compile = $(top_srcdir)/config/py-compile
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Install Python library
+basedir = $(pkgpythondir)/Base
+base_PYTHON = \
+__init__.py \
+resource_base_rc.py \
+BrowserForm.py \
+BrowserView.py \
+CommandLine.py \
+Common.py \
+IdForm.py \
+IdView.py \
+MainForm.py \
+MainView.py \
+QtPage.py \
+Toolbox.py \
+XMLengine.py \
+XMLinitialize.py \
+XMLmodel.py \
+XMLvariables.py
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/Base/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu gui/Base/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-basePYTHON: $(base_PYTHON)
+ @$(NORMAL_INSTALL)
+ test -z "$(basedir)" || $(MKDIR_P) "$(DESTDIR)$(basedir)"
+ @list='$(base_PYTHON)'; dlist=''; for p in $$list; do\
+ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
+ if test -f $$b$$p; then \
+ f=$(am__strip_dir) \
+ dlist="$$dlist $$f"; \
+ echo " $(basePYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(basedir)/$$f'"; \
+ $(basePYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(basedir)/$$f"; \
+ else :; fi; \
+ done; \
+ if test -n "$$dlist"; then \
+ if test -z "$(DESTDIR)"; then \
+ PYTHON=$(PYTHON) $(py_compile) --basedir "$(basedir)" $$dlist; \
+ else \
+ PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(basedir)" $$dlist; \
+ fi; \
+ else :; fi
+
+uninstall-basePYTHON:
+ @$(NORMAL_UNINSTALL)
+ @list='$(base_PYTHON)'; dlist=''; for p in $$list; do\
+ f=$(am__strip_dir) \
+ rm -f "$(DESTDIR)$(basedir)/$$f"; \
+ rm -f "$(DESTDIR)$(basedir)/$${f}c"; \
+ rm -f "$(DESTDIR)$(basedir)/$${f}o"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile all-local
+installdirs:
+ for dir in "$(DESTDIR)$(basedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-basePYTHON
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-basePYTHON
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+ clean-libtool clean-local distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-basePYTHON install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-basePYTHON
+
+
+all-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --build $(srcdir)
+
+clean-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --clean $(srcdir)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gui/Base/QtPage.py b/gui/Base/QtPage.py
new file mode 100644
index 0000000..91f81fa
--- /dev/null
+++ b/gui/Base/QtPage.py
@@ -0,0 +1,585 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines basic classes used for the Pages construction.
+
+This module defines the following classes:
+- ComboModel
+- IntValidator
+- DoubleValidator
+- RegExpValidator
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4 import QtGui, QtCore
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Toolbox import GuiParam
+from Common import LABEL_LENGTH_MAX
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("QtPage")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# QComboBox model
+#-------------------------------------------------------------------------------
+
+class ComboModel:
+ """
+ Class to build a model (QStandardItemModel) used with a QComboBox.
+
+ Main attributes of class are:
+
+ combo: QComboBox passed as arguments. It uses the model
+ model: QStandardItemModel which contains items
+
+ dicoV2M: correspondance between strings in Qt view and strings in parameters
+ dicoM2V: correspondance between strings in parameters and strings in Qt view
+
+ items: tuple which contains all model strings (usefull to get its index in the model)
+ """
+ def __init__(self, combo, rows=0, columns=0):
+ """
+ Initialization
+ """
+ self.combo = combo
+
+ self.rows = rows
+ self.columns = columns
+ self.last = 0
+
+ self.model = QtGui.QStandardItemModel()
+ self.model.clear()
+ self.model.setRowCount(rows)
+ self.model.setColumnCount(columns)
+
+ self.dicoV2M = {}
+ self.dicoM2V = {}
+
+ self.items = []
+ self.combo.setModel(self.model)
+
+
+ def addItem(self, str_view, str_model=""):
+ """
+ Insert an item in the model.
+
+ str_view: string to be displayed in the view.
+ For example, 'Eulerian/Lagangian Multi-phase Treatment'
+
+ str_model: correponding string used in the model.
+ For example, 'lagrangian'
+ """
+ item = QtGui.QStandardItem(QtCore.QString(str(str_view)))
+ index = self.last
+ self.model.setItem(index, item)
+
+ self.last = index + 1
+
+ if not str_model: str_model = str_view
+
+ self.items.append(str_model)
+
+ self.dicoM2V[str_model] = str_view
+ self.dicoV2M[str_view] = str_model
+
+
+ def modifyItem(self, old_str_view, new_str_view, new_str_model=""):
+ """
+ Modify string names.
+ """
+ if old_str_view in self.items:
+ index = self.items.index(old_str_view)
+ self.items[index] = new_str_view
+
+ old_str_model = dicoV2M[old_str_view]
+ if new_str_model == "":
+ new_str_model = old_str_model
+
+ del self.dicoM2V[str_model]
+ del self.dicoV2M[str_view]
+
+ self.dicoM2V[new_str_model] = new_str_view
+ self.dicoV2M[new_str_view] = new_str_model
+
+
+ def delItem(self, index=None, str_model="", str_view=""):
+ """
+ Remove the item specified with its index or a string.
+ """
+ if index is not None:
+ self.__deleteItem(index)
+
+ elif str_model:
+ index = self.items.index(str_model)
+ self.__deleteItem(index)
+
+ elif str_view:
+ str_model = self.dicoV2M[str_view]
+ index = self.items.index(str_model)
+ self.__deleteItem(index)
+
+
+ def __deleteItem(self, index):
+ """
+ Delete the item specified with its index
+ """
+ str_view = self.items[index]
+ str_model = self.dicoV2M[str_view]
+ del self.items[index]
+ del self.dicoV2M[str_view]
+ del self.dicoM2V[str_model]
+
+
+ def __disableItem(self, index):
+ """
+ Disable the item specified with its index
+ """
+ self.model.item(index).setEnabled(False)
+
+
+ def __enableItem(self, index):
+ """
+ Enable the item specified with its index
+ """
+ self.model.item(index).setEnabled(True)
+
+
+ def disableItem(self, index=None, str_model="", str_view=""):
+ """
+ Disable the item specified with its index or a string.
+ """
+ if index is not None:
+ self.__disableItem(index)
+
+ elif str_model:
+ index = self.items.index(str_model)
+ self.__disableItem(index)
+
+ elif str_view:
+ str_model = self.dicoV2M[str_view]
+ index = self.items.index(str_model)
+ self.__disableItem(index)
+
+
+ def enableItem(self, index=None, str_model="", str_view=""):
+ """
+ Enable the item specified with its index or a string.
+ """
+ if index is not None:
+ self.__enableItem(index)
+
+ elif str_model:
+ index = self.items.index(str_model)
+ self.__enableItem(index)
+
+ elif str_view:
+ str_model = self.dicoV2M[str_view]
+ index = self.items.index(str_model)
+ self.__enableItem(index)
+
+
+ def setItem(self, index=None, str_model="", str_view=""):
+ """
+ Set item as current.
+ """
+ if index is not None:
+ self.combo.setCurrentIndex(index)
+
+ elif str_model:
+ index = self.items.index(str_model)
+ self.combo.setCurrentIndex(index)
+
+ elif str_view:
+ str_model = self.dicoV2M[str_view]
+ index = self.items.index(str_model)
+ self.combo.setCurrentIndex(index)
+
+
+ def getIndex(self, str_model="", str_view=""):
+ """
+ Get the index for a string.
+ """
+ if str_model:
+ index = self.items.index(str_model)
+
+ elif str_view:
+ str_model = self.dicoV2M[str_view]
+ index = self.items.index(str_model)
+
+ return index
+
+
+ def getItems(self):
+ """
+ Get the tuple of items.
+ """
+ return self.items
+
+#-------------------------------------------------------------------------------
+# Validators for editors
+#-------------------------------------------------------------------------------
+
+vmax = sys.maxint
+vmax = 2147483647
+vmin = -vmax
+
+class IntValidator(QtGui.QIntValidator):
+ """
+ Validator for integer data.
+ """
+ def __init__(self, parent, min=vmin, max=vmax):
+ """
+ Initialization for validator
+ """
+ QtGui.QIntValidator.__init__(self, parent)
+ self.parent = parent
+ self.state = QtGui.QValidator.Invalid
+ self.__min = min
+ self.__max = max
+
+ if type(min) != int or type(max) != int:
+ raise ValueError, "The given parameters are not integers (warning: long are not allowed)."
+ self.setBottom(min)
+ self.setTop(max)
+
+ self.exclusiveMin = False
+ self.exclusiveMax = False
+
+ self.default = 0
+ self.fix = False
+
+ msg = ""
+ if min > vmin and max == vmax:
+ msg = self.tr("The integer value must be greater than or equal to %i" % min)
+ elif min == vmin and max < vmax:
+ msg = self.tr("The integer value must be lower than or equal to %i" % max)
+ elif min > vmin and max < vmax:
+ msg = self.tr("The integer value must be between than or equal to %i and %i" % (min, max))
+
+ self.parent.setStatusTip(QtCore.QString(msg))
+
+
+ def setExclusiveMin(self, b=True):
+ if type(b) != bool:
+ raise ValueError, "The given parameter is not a boolean."
+ self.exclusiveMin = b
+
+ msg = ""
+ if self.__min > vmin and self.__max == vmax:
+ msg = self.tr("The integer value must be greater than %i" % self.__min)
+ elif self.__min == vmin and self.__max < vmax:
+ msg = self.tr("The integer value must be lower than or equal to %i" % self.__max)
+ elif self.__min > vmin and self.__max < vmax:
+ msg = self.tr("The integer value must be greater %i and lower than or equal to %i" % (self.__min, self.__max))
+
+ self.parent.setStatusTip(QtCore.QString(msg))
+
+
+ def setExclusiveMax(self, b=True):
+ if type(b) != bool:
+ raise ValueError, "The given parameter is not a boolean."
+ self.exclusiveMax = b
+
+ msg = ""
+ if self.__min > vmin and self.__max == vmax:
+ msg = self.tr("The integer value must be greater than or equal to %i" % self.__min)
+ elif self.__min == vmin and self.__max < vmax:
+ msg = self.tr("The integer value must be lower than %i" % self.__max)
+ elif self.__min > vmin and self.__max < vmax:
+ msg = self.tr("The integer value must be greater than or equal to %i and lower than %i" % (self.__min, self.__max))
+
+ self.parent.setStatusTip(QtCore.QString(msg))
+
+
+ def setFixup(self, v):
+ if type(v) != int:
+ raise ValueError, "The given parameter is not an integer."
+ self.default = v
+ self.fix = True
+
+
+ def fixup(self, string):
+ if self.fix:
+ if string.length() == 0:
+ string.truncate(0)
+ string += str(self.default)
+
+
+ def validate(self, string, pos):
+ """
+ Validation method.
+
+ QValidator.Invalid 0 The string is clearly invalid.
+ QValidator.Intermediate 1 The string is a plausible intermediate value during editing.
+ QValidator.Acceptable 2 The string is acceptable as a final result; i.e. it is valid.
+ """
+ state = QtGui.QIntValidator.validate(self, string, pos)[0]
+
+ x, valid = string.toInt()
+
+ if state == QtGui.QValidator.Acceptable:
+ if self.exclusiveMin and x == self.bottom():
+ state = QtGui.QValidator.Intermediate
+ if self.exclusiveMax and x == self.top():
+ state = QtGui.QValidator.Intermediate
+
+ palette = self.parent.palette()
+
+ if not valid or state == QtGui.QValidator.Intermediate:
+ palette.setColor(QtGui.QPalette.Text, QtGui.QColor("red"))
+ self.parent.setPalette(palette)
+ else:
+ palette.setColor(QtGui.QPalette.Text, QtGui.QColor("black"))
+ self.parent.setPalette(palette)
+
+ self.state = state
+
+ return (state, pos)
+
+
+ def tr(self, text):
+ """
+ """
+ return text
+
+
+class DoubleValidator(QtGui.QDoubleValidator):
+ """
+ Validator for real data.
+ """
+ def __init__(self, parent, min=-1.e99, max=1.e99):
+ """
+ Initialization for validator
+ """
+ QtGui.QDoubleValidator.__init__(self, parent)
+ self.parent = parent
+ self.state = QtGui.QValidator.Invalid
+ self.__min = min
+ self.__max = max
+
+ self.setNotation(self.ScientificNotation)
+
+ if type(min) != float or type(max) != float:
+ raise ValueError, "The given parameters are not floats."
+ self.setBottom(min)
+ self.setTop(max)
+
+ self.exclusiveMin = False
+ self.exclusiveMax = False
+
+ self.default = 0.0
+ self.fix = False
+
+ msg = ""
+ if min > -1.e99 and max == 1.e99:
+ msg = self.tr("The float value must be greater than %.1f" % min)
+ elif min == -1.e99 and max < 1.e99:
+ msg = self.tr("The float value must be lower than %.1f" % max)
+ elif min > -1.e99 and max < 1.e99:
+ msg = self.tr("The float value must be between than %.1f and %.1f" % (min, max))
+
+ self.parent.setStatusTip(QtCore.QString(msg))
+
+
+ def setExclusiveMin(self, b=True):
+ if type(b) != bool:
+ raise ValueError, "The given parameter is not a boolean."
+ self.exclusiveMin = b
+
+ msg = ""
+ if self.__min > -1.e99 and self.__max == 1.e99:
+ msg = self.tr("The float value must be greater than %.1f" % self.__min)
+ elif self.__min == -1.e99 and self.__max < 1.e99:
+ msg = self.tr("The float value must be lower than or equal to %.1f" % self.__max)
+ elif self.__min > -1.e99 and self.__max < 1.e99:
+ msg = self.tr("The float value must be greater than %.1f and lower than or equal to %.1f" % (self.__min, self.__max))
+
+ self.parent.setStatusTip(QtCore.QString(msg))
+
+
+ def setExclusiveMax(self, b=True):
+ if type(b) != bool:
+ raise ValueError, "The given parameter is not a boolean."
+ self.exclusiveMax = b
+
+ msg = ""
+ if self.__min > -1.e99 and self.__max == 1.e99:
+ msg = self.tr("The float value must be greater than or equal to %.1f" % self.__min)
+ elif self.__min == -1.e99 and self.__max < 1.e99:
+ msg = self.tr("The float value must be lower than %.1f" % self.__max)
+ elif self.__min > -1.e99 and self.__max < 1.e99:
+ msg = self.tr("The float value must be greater than or equal to %.1f and lower than %.1f" % (self.__min, self.__max))
+
+ self.parent.setStatusTip(QtCore.QString(msg))
+
+
+ def setFixup(self, v):
+ if type(v) != float:
+ raise ValueError, "The given parameter is not a float."
+ self.default = v
+ self.fix = True
+
+
+ def fixup(self, string):
+ if self.fix:
+ if string.length() == 0:
+ string.truncate(0)
+ string += str(self.default)
+
+
+ def validate(self, string, pos):
+ """
+ Validation method.
+
+ QValidator.Invalid 0 The string is clearly invalid.
+ QValidator.Intermediate 1 The string is a plausible intermediate value during editing.
+ QValidator.Acceptable 2 The string is acceptable as a final result; i.e. it is valid.
+ """
+ state = QtGui.QDoubleValidator.validate(self, string, pos)[0]
+
+ x, valid = string.toDouble()
+
+ if state == QtGui.QValidator.Acceptable:
+ if self.exclusiveMin and x == self.bottom():
+ state = QtGui.QValidator.Intermediate
+ if self.exclusiveMax and x == self.top():
+ state = QtGui.QValidator.Intermediate
+
+ palette = self.parent.palette()
+
+ if not valid or state == QtGui.QValidator.Intermediate:
+ palette.setColor(QtGui.QPalette.Text, QtGui.QColor("red"))
+ self.parent.setPalette(palette)
+ else:
+ palette.setColor(QtGui.QPalette.Text, QtGui.QColor("black"))
+ self.parent.setPalette(palette)
+
+ self.state = state
+
+ return (state, pos)
+
+
+ def tr(self, text):
+ """
+ """
+ return text
+
+
+class RegExpValidator(QtGui.QRegExpValidator):
+ """
+ Validator for regular expression.
+ """
+ def __init__(self, parent, rx):
+ """
+ Initialization for validator
+ """
+ QtGui.QRegExpValidator.__init__(self, parent)
+ self.parent = parent
+ self.state = QtGui.QRegExpValidator.Invalid
+
+ self.__validator = QtGui.QRegExpValidator(rx, parent)
+
+ if "{1," + str(LABEL_LENGTH_MAX) + "}" in rx.pattern():
+ msg = self.tr("The maximum length of the label is %i characters" % LABEL_LENGTH_MAX)
+ self.parent.setStatusTip(QtCore.QString(msg))
+
+
+ def validate(self, string, pos):
+ """
+ Validation method.
+
+ QValidator.Invalid 0 The string is clearly invalid.
+ QValidator.Intermediate 1 The string is a plausible intermediate value during editing.
+ QValidator.Acceptable 2 The string is acceptable as a final result; i.e. it is valid.
+ """
+ state = self.__validator.validate(string, pos)[0]
+
+ palette = self.parent.palette()
+
+ if state == QtGui.QValidator.Intermediate:
+ palette.setColor(QtGui.QPalette.Text, QtGui.QColor("red"))
+ self.parent.setPalette(palette)
+ else:
+ palette.setColor(QtGui.QPalette.Text, QtGui.QColor("black"))
+ self.parent.setPalette(palette)
+
+ self.state = state
+
+ return (state, pos)
+
+
+ def tr(self, text):
+ """
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Paint in green a given widget
+#-------------------------------------------------------------------------------
+
+def setGreenColor(w, green=True):
+ """
+ Paint in green color the QWidget I{w} if I{green} is equal to C{True}.
+ If not, the QWidget I{w} is paint with the color of its parents.
+
+ @type w: C{QWidget}
+ @param w: widget to paint
+ @type green: C{True} or C{False}
+ @param green: I{w} is paint in green if C{True}
+ """
+ if green:
+ color = QtGui.QColor(QtCore.Qt.green)
+ else:
+ color = w.parentWidget().palette().color(QtGui.QPalette.Window)
+
+ w.setPalette(QtGui.QPalette(color))
+
+#-------------------------------------------------------------------------------
+# End of QtPage
+#-------------------------------------------------------------------------------
diff --git a/gui/Base/Toolbox.py b/gui/Base/Toolbox.py
new file mode 100644
index 0000000..3057808
--- /dev/null
+++ b/gui/Base/Toolbox.py
@@ -0,0 +1,374 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the following classes and functions:
+- GuiParam
+- displaySelectedPage
+- dicoLabel
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, logging
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Common import *
+
+#-------------------------------------------------------------------------------
+# Global GUI parameters
+#-------------------------------------------------------------------------------
+
+class GuiParam(object):
+ """
+ Language default chooser, and bell ON/OFF switch.
+ """
+ # 'fr' or 'en' (default)
+ #
+ try:
+ lang = os.environ['LANG'][0:2]
+ except Exception:
+ lang = 'fr'
+
+ # 'on' (default) or 'off'
+ #
+ beep = 'on'
+
+ # pdf reader
+ #
+ pdfReader = 'on'
+
+ # Matisse: False (default) or True
+ #
+ matisse = False
+
+ # debug
+ #
+ DEBUG = logging.NOTSET
+ #DEBUG = logging.DEBUG
+
+#-------------------------------------------------------------------------------
+# displaySelectedPage direct to the good page with its name
+#-------------------------------------------------------------------------------
+
+def displaySelectedPage(page_name, root, case, stbar=None, study=None, tree=None):
+ """
+ This function enables to display a new page when the TreeNavigator
+ send the order.
+ """
+ # 'win' is the frame-support of the Pages
+ # 'thisPage' is the instance of classes which create thePages
+ # 'page_name' is the name of the page
+ #
+ if page_name == tr("Identity and paths"):
+ import Pages.IdentityAndPathesView as Page
+ thisPage = Page.IdentityAndPathesView(root, case, study)
+
+ elif page_name == tr("Meshes selection"):
+ import Pages.SolutionDomainView as Page
+ thisPage = Page.SolutionDomainView(root, case, stbar)
+
+ elif page_name == tr("Wall thermal coupling"):
+ import Pages.SyrthesView as Page
+ thisPage = Page.SyrthesView(root, case)
+
+ elif page_name == tr("Mesh quality criteria"):
+ import Pages.SolutionVerifView as Page
+ thisPage = Page.SolutionVerifView(root, case)
+
+ elif page_name == tr("Volume regions definition"):
+ import Pages.LocalizationView as Page
+ thisPage = Page.VolumeLocalizationView(root, case)
+## import Pages.AddScalarFieldBoundView as Page
+## thisPage = Page.AddScalarFieldBoundView(root, case)
+
+ elif page_name == tr("Storage system type"):
+ import Pages.MatisseTypeView as Page
+ thisPage = Page.MatisseTypeView(root, case)
+
+ elif page_name == tr("Storage system geometry"):
+ import Pages.MatisseGeomView as Page
+ thisPage = Page.MatisseGeomView(root, case)
+
+ elif page_name == tr("Inlet description"):
+ import Pages.MatisseRangeDescriptionView as Page
+ thisPage = Page.MatisseRangeDescriptionView(root, case, 'inlet_range')
+
+ elif page_name == tr("Outlet description"):
+ import Pages.MatisseRangeDescriptionView as Page
+ thisPage = Page.MatisseRangeDescriptionView(root, case, 'outlet_range')
+
+ elif page_name == tr("Network description"):
+ import Pages.MatisseNetworkView as Page
+ thisPage = Page.MatisseNetworkView(root, case)
+
+ elif page_name == tr("Hydraulic load"):
+ import Pages.MatisseHydrauView as Page
+ thisPage = Page.MatisseHydrauView(root, case)
+
+ elif page_name == tr("Thermal load"):
+ import Pages.MatisseThermicView as Page
+ thisPage = Page.MatisseThermicView(root, case)
+
+ elif page_name == tr("Calculation features"):
+ import Pages.AnalysisFeaturesView as Page
+ thisPage = Page.AnalysisFeaturesView(root, case, tree)
+
+ elif page_name == tr("Mobile mesh"):
+ import Pages.MobileMeshView as Page
+ thisPage = Page.MobileMeshView(root, case, tree)
+
+ elif page_name == tr("Turbulence models"):
+ import Pages.TurbulenceView as Page
+ thisPage = Page.TurbulenceView(root, case)
+
+ elif page_name == tr("Thermal model"):
+ import Pages.ThermalScalarView as Page
+ thisPage = Page.ThermalScalarView(root, case, tree)
+
+## elif page_name == tr("Gas combustion"):
+## thisPage = root.fr2.p2.fr.window.myPage
+
+ elif page_name == tr("Current species"):
+ import Pages.CurrentSpeciesView as Page
+ thisPage = Page.CurrentSpeciesView(root, case)
+
+ elif page_name == tr("Pulverized coal combustion"):
+ import Pages.CoalCombustionView as Page
+ thisPage = Page.CoalCombustionView(root, case, stbar)
+
+## elif page_name == tr("Electrical models"):
+## thisPage = root.fr2.p2.fr.window.myPage
+
+ elif page_name == tr("Radiative transfers"):
+ import Pages.ThermalRadiationView as Page
+ thisPage = Page.ThermalRadiationView(root, case, tree)
+
+ elif page_name == tr("Initialization"):
+ import Pages.InitializationView as Page
+ thisPage = Page.InitializationView(root, case, stbar)
+
+ elif page_name == tr("Head losses"):
+ import Pages.HeadLossesView as Page
+ thisPage = Page.HeadLossesView(root, case, stbar)
+
+ elif page_name == tr("Reference values"):
+ import Pages.ReferenceValuesView as Page
+ thisPage = Page.ReferenceValuesView(root, case)
+
+ elif page_name == tr("Fluid properties"):
+ import Pages.FluidCharacteristicsView as Page
+ thisPage = Page.FluidCharacteristicsView(root, case)
+
+ elif page_name == tr("Gravity, hydrostatic pressure"):
+ import Pages.BodyForcesView as Page
+ thisPage = Page.BodyForcesView(root, case)
+
+ elif page_name == tr("Definition and initialization"):
+ import Pages.DefineUserScalarsView as Page
+ thisPage = Page.DefineUserScalarsView(root, case, stbar)
+
+ elif page_name == tr("Physicals properties"):
+ import Pages.UserScalarPropertiesView as Page
+ thisPage = Page.UserScalarPropertiesView(root, case, stbar)
+
+ elif page_name == tr("Global settings"):
+ import Pages.LagrangianView as Page
+ thisPage = Page.LagrangianView(root, case)
+
+ elif page_name == tr("Statistics"):
+ import Pages.LagrangianStatisticsView as Page
+ thisPage = Page.LagrangianStatisticsView(root, case)
+
+ elif page_name == tr("Output"):
+ import Pages.LagrangianOutputView as Page
+ thisPage = Page.LagrangianOutputView(root, case)
+
+ elif page_name == tr("Definition of boundary regions"):
+ import Pages.LocalizationView as Page
+ thisPage = Page.BoundaryLocalizationView(root, case)
+
+ elif page_name == tr("Boundary conditions"):
+ import Pages.BoundaryConditionsView as Page
+ thisPage = Page.BoundaryConditionsView(root, case)
+
+# elif page_name == tr("Scalars boundary conditions"):
+# import Pages.ScalarsBoundariesView as Page
+# thisPage = Page.ScalarsBoundariesView(root, case)
+
+# elif page_name == tr("Radiative boundary conditions"):
+# import Pages.RadiativeBoundariesView as Page
+# thisPage = Page.RadiativeBoundariesView(root, case)
+
+ elif page_name == tr("Particles boundary conditions"):
+ import Pages.LagrangianBoundariesView as Page
+ thisPage = Page.LagrangianBoundariesView(root, case)
+
+ elif page_name == tr("Time averages"):
+ import Pages.TimeAveragesView as Page
+ thisPage = Page.TimeAveragesView(root, case, stbar)
+
+ elif page_name == tr("Time step"):
+ import Pages.TimeStepView as Page
+ thisPage = Page.TimeStepView(root, case)
+## if GuiParam.matisse :
+## thisPage = Page.TimeStepMatisseView(root, case, stbar)
+## else :
+## thisPage = Page.TimeStepView(root, case, stbar)
+
+ elif page_name == tr("Steady flow management"):
+ import Pages.SteadyManagementView as Page
+ thisPage = Page.SteadyManagementView(root, case)
+
+ elif page_name == tr("Output control"):
+ import Pages.OutputControlView as Page
+ thisPage = Page.OutputControlView(root, case, tree)
+
+ elif page_name == tr("Volume solution control"):
+ import Pages.OutputVolumicVariablesView as Page
+ thisPage = Page.OutputVolumicVariablesView(root, case)
+
+ elif page_name == tr("Surface solution control"):
+ import Pages.OutputSurfacicVariablesView as Page
+ thisPage = Page.OutputSurfacicVariablesView(root, case)
+
+ elif page_name == tr("Profiles"):
+ import Pages.ProfilesView as Page
+ thisPage = Page.ProfilesView(root, case, stbar)
+
+ elif page_name == tr("Equation parameters"):
+ import Pages.NumericalParamEquationView as Page
+ thisPage = Page.NumericalParamEquationView(root, case)
+
+ elif page_name == tr("Global parameters"):
+ import Pages.NumericalParamGlobalView as Page
+ thisPage = Page.NumericalParamGlobalView(root, case)
+
+ elif page_name == tr("User arrays"):
+ import Pages.UserArraysView as Page
+ thisPage = Page.UserArraysView(root, case)
+
+ elif page_name == tr("Memory management"):
+ import Pages.MemoryAllocationView as Page
+ thisPage = Page.MemoryAllocationView(root, case)
+
+ elif page_name == tr("Start/Restart"):
+ import Pages.StartRestartView as Page
+ thisPage = Page.StartRestartView(root, case)
+
+ elif page_name == tr("Prepare batch calculation"):
+ import Pages.BatchRunningView as Page
+ thisPage = Page.BatchRunningView(root, case)
+
+# elif page_name == tr("Mobil mesh boundary"):
+# import Pages.MobilMeshBoundaryView as Page
+# thisPage = Page.MobilMeshBoundaryView(root, case)
+
+ elif page_name == tr("Fluid structure interaction"):
+ import Pages.FluidStructureInteractionView as Page
+ thisPage = Page.FluidStructureInteractionView(root, case)
+
+ elif page_name == tr("Atmospheric flows"):
+ import Pages.AtmosphericFlowsView as Page
+ thisPage = Page.AtmosphericFlowsView(root, case)
+
+
+ else:
+ msg = tr("Warning: the corresponding Page %s doesn't exist!") % page_name
+ print msg
+ # So we display the Welcome Page!
+ import Pages.WelcomeView as Page
+ thisPage = Page.WelcomeView()
+
+ return thisPage
+
+
+def tr(text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Dictionary : dependance between names and labels
+#-------------------------------------------------------------------------------
+
+def dicoLabel(name):
+ """
+ Correspondence between the names and the labels according to
+ whether one is in French or in English.
+ """
+ for (n, labF, labE) in [('velocity_U', "VitesseX", "VelocitU"),
+ ('velocity_V', "VitesseY", "VelocitV"),
+ ('velocity_W', "VitesseZ", "VelocitW"),
+ ('pressure', "Pression", "Pressure"),
+ ('turb_k', "EnerTurb", "TurbEner"),
+ ('turb_eps', "Dissip", "Dissip"),
+ ('turb_viscosity', "visc. tu", "turb. vi"),
+ ('component_R11', "R11", "R11"),
+ ('component_R22', "R22", "R22"),
+ ('component_R33', "R33", "R33"),
+ ('component_R12', "R12", "R12"),
+ ('component_R13', "R13", "R13"),
+ ('component_R23', "R23", "R23"),
+ ('turb_phi', "phi", "phi"),
+ ('turb_fb', "fb", "fb"),
+ ('turb_omega', "omega", "omega"),
+ ('smagorinsky_constant', "Csdyn2", "Csdyn2"),
+ ('temperature_celsius', "Temp.C", "Temp.C"),
+ ('temperature_kelvin', "Temp.K", "Temp.K"),
+ ('enthalpy', "Enthal.", "Enthalpy"),
+ ('density', "Masse vo", "Density"),
+ ('molecular_viscosity', "Visc. la", "Lam. vis"),
+ ('specific_heat', "Ch.spec.", "Sp. heat"),
+ ('thermal_conductivity', "Cond. th", "Th. cond"),
+ ('local_time_step', "pdtlocal", "loc.time"),
+ ('courant_number', "Nb Courant", "Courant nb"),
+ ('fourier_number', "Nb Fourier", "Fourier nb"),
+ ('weight_matrix_X', "VPsolve1", "VPsolve1"),
+ ('weight_matrix_Y', "VPsolve2", "VPsolve2"),
+ ('weight_matrix_Z', "VPsolve3", "VPsolve3")]:
+
+ if n == name:
+ if GuiParam.lang == 'fr':
+ label = labF
+ else:
+ label = labE
+
+ return label
+
+#-------------------------------------------------------------------------------
+# End of Toolbox
+#-------------------------------------------------------------------------------
diff --git a/gui/Base/XMLengine.py b/gui/Base/XMLengine.py
new file mode 100644
index 0000000..93b0497
--- /dev/null
+++ b/gui/Base/XMLengine.py
@@ -0,0 +1,1877 @@
+# -*- coding: utf-8 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines a Lightweight XML constructor and reader.
+It provides a management of the XML document, which reflets the treated case.
+
+This module defines the following classes:
+- Dico
+- XMLElement
+- _Document (obsolete since Python 2.3)
+- XMLDocument
+- Case
+- XMLDocumentTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# String for the root node of the xml document from the case
+#-------------------------------------------------------------------------------
+
+rootNode = '<Code_Saturne_GUI study="" case="" version="1.0"/>'
+#rootNode = '<NeptuneCFD study="" case=""/>'
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, string, unittest, logging
+from types import StringType, UnicodeType, FloatType, IntType
+from xml.dom.minidom import Document, parse, parseString, Node
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Toolbox import GuiParam
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("XMLengine")
+#log.setLevel(logging.NOTSET)
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Simple class wich emulate a basic dictionary, but allows to make
+# everytimes verification on values and keys
+#-------------------------------------------------------------------------------
+
+class Dico:
+ """
+ This define a simple class in order to store informations about the case.
+ These informations are usefull only for the current session, and are
+ forgotten for the next one.
+ """
+ def __init__(self):
+ """
+ Create a dictionary and the associated key.
+ """
+ self.data = {}
+
+ self.data['new'] = ""
+ self.data['saved'] = "yes"
+ self.data['xmlfile'] = ""
+ self.data['mesh_path'] = ""
+ self.data['user_src_path'] = ""
+ self.data['data_path'] = ""
+ self.data['resu_path'] = ""
+ self.data['scripts_path'] = ""
+ self.data['relevant_subdir'] = "no"
+ self.data['case_path'] = ""
+ self.data['batchScript'] = {}
+ self.data['backupBatchScript'] = {}
+ self.data['computer'] = ""
+ self.data['no_boundary_conditions'] = False
+ self.data['salome'] = False
+
+
+ def _errorExit(self, msg):
+ """
+ """
+ print 'CASE DICO ERROR'
+ raise ValueError, msg
+
+
+ def __setitem__(self, key, name):
+ """
+ Store values in the data dictionary when the key existe
+ in the dictionary.
+ """
+ if hasattr(self, 'data'):
+ if key in self.data:
+ self.data[key] = name
+ else:
+ msg = "There is an error in the use of the dictionary "+ \
+ "with the key named: " + key + ". \n" + \
+ "The application will finish.\n" \
+ "Please contact the devlopment team."
+
+ print self._errorExit(msg)
+
+
+ def __getitem__(self, key):
+ """
+ Extraction of informations from the data dictionary.
+ """
+ if hasattr(self, 'data'):
+ if key in self.data:
+ return self.data[key]
+ else:
+ return None
+
+
+ def printDico(self):
+ """
+ Simple tool wich print on the current terminal the contents of the dico.
+ """
+ if hasattr(self, 'data'):
+ for i in self.data.keys():
+ print "%s -> %s" % (i, self.data[i])
+
+
+#-------------------------------------------------------------------------------
+# Lightweight XML constructor and reader
+#-------------------------------------------------------------------------------
+
+
+enc = "utf-8"
+
+
+def _encode(v):
+ """
+ return a byte string. This function handles the Unicode encoding.
+ minidom handles only byte strings, see: http://evanjones.ca/python-utf8.html
+ """
+ if isinstance(v, UnicodeType):
+ v = v.encode(enc)
+ return v
+
+
+class XMLElement:
+ """
+ """
+ def __init__(self, doc, el, case):
+ """
+ Constructor.
+ """
+ self.doc = doc
+ self.el = el
+ self.ca = case
+
+
+ def _errorExit(self, msg):
+ """
+ """
+ print 'XML ERROR'
+ raise ValueError, msg
+
+
+ def toString(self):
+ """
+ Print the XMLElement node to a simple string (without \n and \t).
+ Unicode characters are encoded.
+ """
+ return self.el.toxml(enc)
+
+
+ def toUnicodeString(self):
+ """
+ Print the XMLElement node to an unicode string (without \n and \t).
+ Unicode string are decoded if it's possible by the standard output,
+ if not unicode characters are replaced by '?' character.
+ Warning: do not use this method for comparison purpose!
+ """
+ unicode_obj = self.el.toxml()
+ try:
+ return unicode_obj.encode("utf-8", 'replace')
+ except:
+ return unicode_obj.encode(sys.stdout.encoding, 'replace')
+
+
+ def __str__(self):
+ """
+ Print the XMLElement node with \n and \t.
+ Unicode string are decoded if it's possible by the standard output,
+ if not unicode characters are replaced by '?' character.
+ Warning: do not use this method for comparison purpose!
+ """
+ unicode_obj = self.el.toprettyxml()
+ try:
+ return unicode_obj.encode("utf-8", 'replace')
+ except:
+ return unicode_obj.encode(sys.stdout.encoding, 'replace')
+
+
+ def __xmlLog(self):
+ """Convenient method for log"""
+ if self.el.hasChildNodes() and len(self.el.childNodes) > 1:
+ return "\n" + self.__str__()
+ else:
+ return self.toUnicodeString()
+
+
+ def _inst(self, el):
+ """
+ Transform a Element node to an instance of the XMLElement class.
+ """
+ return XMLElement(self.doc, el, self.ca)
+
+
+ def xmlCreateAttribute(self, **kwargs):
+ """
+ Set attributes to a XMLElement node, only if these attributes
+ does not allready exist.
+ """
+ if self.ca: self.ca.modified()
+
+ for attr, value in kwargs.items():
+ if not self.el.hasAttribute(attr):
+ self.el.setAttribute(attr, _encode(str(value)))
+
+ log.debug("xmlCreateAttribute-> %s" % self.__xmlLog())
+
+
+ def xmlGetAttributeDictionary(self):
+ """
+ Return the dictionary of the XMLElement node attributes.
+ """
+ d = {}
+ if self.el.nodeType == Node.ELEMENT_NODE:
+ if self.el.hasAttributes():
+ attrs = self.el._get_attributes()
+ a_names = attrs.keys()
+ a_names.sort()
+ for a_name in a_names:
+ d[a_name] = attrs[a_name].value
+ return d
+
+
+ def xmlGetAttribute(self, attr):
+ """
+ Return the value of the XMLElement node attribute.
+ Crash if the searched attribute does not exist.
+ """
+ if not self.el.hasAttribute(attr):
+ node = self.__str__()
+ attr = attr.encode(sys.stdout.encoding,'replace')
+ msg = "There is an error in with the elementNode: \n\n" \
+ + node + "\n\nand the searching attribute: \n\n" \
+ + attr + "\n\nThe application will finish."
+ self._errorExit(msg)
+ else:
+ a = self.el.getAttributeNode(attr)
+
+ return _encode(a.value)
+
+
+ def xmlSetAttribute(self, **kwargs):
+ """
+ Set several attribute (key=value) to a node
+ """
+ if self.ca: self.ca.modified()
+
+ for attr, value in kwargs.items():
+ self.el.setAttribute(attr, _encode(str(value)))
+
+ log.debug("xmlSetAttribute-> %s" % self.__xmlLog())
+
+
+ def xmlDelAttribute(self, attr):
+ """
+ Delete the XMLElement node attribute
+ """
+ if self.ca: self.ca.modified()
+
+ if self.el.hasAttribute(attr):
+ self.el.removeAttribute(attr)
+
+ log.debug("xmlDelAttribute-> %s %s" % (attr, self.__xmlLog()))
+
+
+ def __getitem__(self, attr):
+ """
+ Return the XMLElement attribute's value
+ with a dictionary syntaxe: node['attr']
+ Return None if the searched attribute does not exist.
+ """
+ a = self.el.getAttributeNode(attr)
+ if a:
+ return _encode(a.value)
+ return None
+
+
+ def __setitem__(self, attr, value):
+ """
+ Set a XMLElement attribute an its value
+ with a dictionary syntaxe: node['attr'] = value
+ """
+ if self.ca: self.ca.modified()
+ self.el.setAttribute(attr, _encode(str(value)))
+
+ log.debug("__setitem__-> %s" % self.__xmlLog())
+
+
+ def __delitem__(self, name):
+ """
+ Delete a XMLElement attribute with a dictionary syntaxe: del node['attr']
+ """
+ if self.ca: self.ca.modified()
+ self.xmlDelAttribute(name)
+
+ #log.debug("__delitem__-> %s" % self.__xmlLog())
+
+
+ def xmlSortByTagName(self):
+ """
+ Return a dictionary which keys are the name of the node.
+ """
+ d = {}
+ for node in self.el.childNodes:
+ if node.nodeType == Node.ELEMENT_NODE:
+ dd = self._inst(node).xmlGetAttributeDictionary()
+ key = node.tagName
+ for k in dd.keys(): key = key + (k+dd[k])
+ d[key] = self._inst(node)
+ elif node.nodeType == Node.TEXT_NODE:
+ try:
+ k = float(node.data)
+ except:
+ k = node.data
+ d[k] = self._inst(node)
+ return d
+
+
+ def __cmp__(self, other):
+ """
+ Return 0 if two XMLElement are the same, return 1 otherwise.
+ """
+ if not other:
+ return 1
+ if not isinstance(other, XMLElement):
+ return 1
+ if self.el.nodeType == Node.ELEMENT_NODE:
+ if self.el.tagName != other.el.tagName:
+ return 1
+ elif self.el.nodeType == Node.TEXT_NODE:
+ try:
+ a = float(self.el.data)
+ b = float(other.el.data)
+ except:
+ a = self.el.data
+ b = other.el.data
+ if a != b:
+ return 1
+ if self.xmlGetAttributeDictionary() != other.xmlGetAttributeDictionary():
+ return 1
+ d1 = self.xmlSortByTagName()
+ d2 = other.xmlSortByTagName()
+ l1 = d1.keys()
+ l2 = d2.keys()
+ l1.sort()
+ l2.sort()
+ if l1 != l2:
+ return 1
+ if self.el.childNodes and other.el.childNodes:
+ for key in d1.keys():
+ if d1[key] != d2[key]:
+ return 1
+ return 0
+
+
+ def _nodeList(self, tag, *attrList, **kwargs):
+ """
+ Return a list of Element (and not XMLElement)!
+ """
+ nodeList = []
+
+ # Get the nodes list
+ #
+ nodeL = self.el.getElementsByTagName(tag)
+
+ # If there is a precision for the selection
+ #
+#TRYME
+## for attr in attrList:
+## for node in nodeL:
+## if node.hasAttribute(attr) and node not in nodeList:
+## nodeList.append(node)
+
+## if attrList and kwargs:
+## nodeL = nodeList
+## nodeList = []
+
+## for k, v in kwargs.items():
+## for node in nodeL:
+## if node.getAttribute(k) == v and node not in nodeList:
+## nodeList.append(node)
+
+ for node in nodeL:
+ iok = 0
+ for attr in attrList:
+ if node.hasAttribute(str(attr)):
+ iok = 1
+ else:
+ iok = 0
+ break
+ if iok: nodeList.append(node)
+
+ if attrList and kwargs:
+ nodeL = nodeList
+ nodeList = []
+
+ for node in nodeL:
+ iok = 0
+ for k, v in kwargs.items():
+ if node.getAttribute(str(k)) == str(v):
+ iok = 1
+ else:
+ iok = 0
+ break
+ if iok: nodeList.append(node)
+#TRYME
+
+ if not attrList and not kwargs:
+ nodeList = nodeL
+
+ return nodeList
+
+
+ def _childNodeList(self, tag, *attrList, **kwargs):
+ """
+ Return a list of first child Element node from the explored XMLElement node.
+ """
+ nodeList = self._nodeList(tag, *attrList, **kwargs)
+
+ childNodeList = []
+ if self.el.hasChildNodes():
+ for node in self.el.childNodes:
+ if node.nodeType == Node.ELEMENT_NODE:
+ if node.nodeName == tag and node in nodeList:
+ childNodeList.append(node)
+
+ return childNodeList
+
+
+ def xmlAddChild(self, tag, *attrList, **kwargs):
+ """
+ Add a new XMLElement node as a child of the current
+ XMLElement node (i.e. self), with attributes and value.
+ """
+ if self.ca: self.ca.modified()
+
+ el = self.doc.createElement(tag)
+ for k in attrList:
+ el.setAttribute(k, "")
+ for k, v in kwargs.items():
+ el.setAttribute(k, _encode(str(v)))
+
+ log.debug("xmlAddChild-> %s %s" % (tag, self.__xmlLog()))
+
+ return self._inst(self.el.appendChild(el))
+
+
+ def xmlSetTextNode(self, newTextNode):
+ """
+ Replace old text value of a TEXT_NODE by the new one.
+ If the elementNode 'node' has no TEXT_NODE as childNodes,
+ it will be created.
+ """
+ if self.ca: self.ca.modified()
+
+ if newTextNode == "" or newTextNode == None : return
+
+ if type(newTextNode) != StringType: newTextNode = str(newTextNode)
+
+ if self.el.hasChildNodes():
+ for n in self.el.childNodes:
+ if n.nodeType == Node.TEXT_NODE:
+ n.data = _encode(newTextNode)
+ else:
+ self._inst(
+ self.el.appendChild(
+ self.doc.createTextNode(_encode(newTextNode))))
+
+ log.debug("xmlSetTextNode-> %s" % self.__xmlLog())
+
+
+ def xmlSetData(self, tag, textNode, *attrList, **kwargs):
+ """
+ Set the textNode in an elementNode, which is a single node.
+ If the searched 'tag' doesn't exist, it is create
+ and textNode is added as a child TEXT_NODE nodeType.
+ Return a XMLElement list of the created Node.
+ """
+ # First we convert textNode in string, if necessary.
+ # About the precision display read :
+ # "B. Floating Point Arithmetic: Issues and Limitations
+ # http://www.python.org/doc/current/tut/node14.html"
+ #
+ if type(textNode) == FloatType: textNode = str("%g" % (textNode))
+
+ nodeList = self._childNodeList(tag, *attrList, **kwargs)
+ elementList = []
+
+ # Add a new ELEMENT_NODE and a new TEXT_NODE
+ # or replace an existing TEXT_NODE
+ #
+ if not nodeList:
+ child = self.xmlAddChild(tag, *attrList, **kwargs)
+ child.xmlSetTextNode(textNode)
+ elementList.append(child)
+ else:
+ for node in nodeList:
+ child = self._inst(node)
+ child.xmlSetTextNode(textNode)
+ elementList.append(child)
+
+ return elementList
+
+
+ def xmlGetTextNode(self, sep=" "):
+ """
+ """
+ rc = []
+ if self.el.hasChildNodes():
+ for node in self.el.childNodes:
+ if node.nodeType == node.TEXT_NODE:
+ rc.append(node.data)
+ return _encode(string.join(rc, sep))
+ else:
+ return None
+
+
+ def xmlGetStringList(self, tag, *attrList, **kwargs):
+ """
+ Return a list of TEXT_NODE associed to the tagName elements
+ from the explored elementNode.
+ """
+ stringList = []
+
+ nodeList = self._nodeList(tag, *attrList, **kwargs)
+ if nodeList:
+ for node in nodeList:
+ data = self._inst(node).xmlGetTextNode()
+ if data:
+ stringList.append(data)
+
+ return stringList
+
+
+ def xmlGetChildStringList(self, tag, *attrList, **kwargs):
+ """
+ Return a list of TEXT_NODE associed to the tagName elements
+ from the explored elementNode.
+ """
+ stringList = []
+
+ nodeList = self._childNodeList(tag, *attrList, **kwargs)
+
+ if nodeList:
+ for node in nodeList:
+ data = self._inst(node).xmlGetTextNode()
+ if data:
+ stringList.append(data)
+
+ return stringList
+
+
+ def xmlGetIntList(self, tag, *attrList, **kwargs):
+ """
+ Return a list of integer insteed of a list of one string.
+ """
+ intList = []
+ stringList = self.xmlGetStringList(tag, *attrList, **kwargs)
+
+ for s in stringList:
+ try:
+ intList.append(int(s))
+ except:
+ pass
+
+ return intList
+
+
+ def xmlGetString(self, tag, *attrList, **kwargs):
+ """
+ Just verify that te returned list contains only one string variable.
+ Return a string and not a list of one string.
+ """
+ stringList = self.xmlGetStringList(tag, *attrList, **kwargs)
+
+ if stringList:
+ if len(stringList) == 1:
+ string = stringList[0]
+ else:
+ msg = "There is an error in with the use of the xmlGetString method. "\
+ "There is more than one occurence of the tagName: " + tag
+ self._errorExit(msg)
+ else:
+ string = ""
+
+ return string
+
+
+ def xmlGetChildString(self, tag, *attrList, **kwargs):
+ """
+ Just verify that te returned list contains only one string variable.
+ Return a string and not a list of one string.
+ """
+ stringList = self.xmlGetChildStringList(tag, *attrList, **kwargs)
+
+ if stringList:
+ if len(stringList) == 1:
+ string = stringList[0]
+ else:
+ msg = "There is an error in with the use of the xmlGetChildString method. "\
+ "There is more than one occurence of the tagName: " + tag
+ self._errorExit(msg)
+ else:
+ string = ""
+
+ return string
+
+
+ def xmlGetInt(self, tag, *attrList, **kwargs):
+ """
+ Just verify that te returned list contains only one string variable.
+ Return an integer and not a list of one string.
+ """
+ stringList = self.xmlGetStringList(tag, *attrList, **kwargs)
+
+ if stringList:
+ if len(stringList) == 1:
+ try:
+ integer = int(stringList[0])
+ except:
+ integer = None
+ else:
+ msg = "There is an error in with the use of the xmlGetInt method. "\
+ "There is more than one occurence of the tagName: " + tag
+ self._errorExit(msg)
+ else:
+ integer = None
+
+ return integer
+
+
+ def xmlGetDouble(self, tag, *attrList, **kwargs):
+ """
+ Just verify that the returned list contains only one string variable.
+ Return a float and not a list of one string.
+ """
+ stringList = self.xmlGetStringList(tag, *attrList, **kwargs)
+
+ if stringList:
+ if len(stringList) == 1:
+ try:
+ double = float(stringList[0])
+ except:
+ double = None
+ else:
+ msg = "There is an error in with the use of the xmlGetDouble method. "\
+ "There is more than one occurence of the tagName: " + tag
+ self._errorExit(msg)
+ else:
+ double = None
+
+ return double
+
+
+ def xmlGetChildDouble(self, tag, *attrList, **kwargs):
+ """
+ Just verify that te returned list contains only one string variable.
+ Return a float and not a list of one string.
+ """
+ stringList = self.xmlGetChildStringList(tag, *attrList, **kwargs)
+
+ if stringList:
+ if len(stringList) == 1:
+ try:
+ double = float(stringList[0])
+ except:
+ double = None
+ else:
+ msg = "There is an error in with the use of the xmlGetChildDouble method. "\
+ "There is more than one occurence of the tagName: " + tag
+ self._errorExit(msg)
+ else:
+ double = None
+
+ return double
+
+
+ def xmlAddComment(self, data):
+ """
+ Create a comment XMLElement node.
+ """
+ if self.ca: self.ca.modified()
+ elt = self._inst( self.el.appendChild(self.doc.createComment(data)) )
+ log.debug("xmlAddComment-> %s" % self.__xmlLog())
+ return elt
+
+
+ def xmlGetNodeList(self, tag, *attrList, **kwargs):
+ """
+ Return a list of XMLElement nodes from the explored
+ XMLElement node (i.e. self).
+ """
+ return map(self._inst, self._nodeList(tag, *attrList, **kwargs))
+
+
+ def xmlGetNode(self, tag, *attrList, **kwargs):
+ """
+ Return a single XMLElement node from the explored elementNode.
+ The returned element is an instance of the XMLElement class.
+ """
+ nodeList = self._nodeList(tag, *attrList, **kwargs)
+
+ if len(nodeList) > 1:
+ msg = "There is an error in with the use of the xmlGetNode method. "\
+ "There is more than one occurence of the tag: " + tag
+ for n in nodeList: msg += "\n" + self._inst(n).__str__()
+ self._errorExit(msg)
+ elif len(nodeList) == 1:
+ return self._inst(nodeList[0])
+ else:
+ return None
+
+
+ def xmlGetChildNodeList(self, tag, *attrList, **kwargs):
+ """
+ Return a list of XMLElement nodes from the explored elementNode.
+ Each element of the returned list is an instance of the XMLElement
+ class.
+ """
+ return map(self._inst, self._childNodeList(tag, *attrList, **kwargs))
+
+
+ def xmlGetChildNode(self, tag, *attrList, **kwargs):
+ """
+ Return a single XMLElement node from the explored elementNode.
+ The returned element is an instance of the XMLElement class.
+ """
+ nodeList = self._childNodeList(tag, *attrList, **kwargs)
+
+ if len(nodeList) > 1:
+ msg = "There is an error in with the use of the xmlGetChildNode method. "\
+ "There is more than one occurence of the tag: " + tag
+ for n in nodeList: msg += "\n" + self._inst(n).__str__()
+ self._errorExit(msg)
+ elif len(nodeList) == 1:
+ return self._inst(nodeList[0])
+ else:
+ return None
+
+
+ def xmlInitNodeList(self, tag, *attrList, **kwargs):
+ """
+ Each element of the returned list is an instance
+ of the XMLElement class.
+ """
+ nodeList = self._nodeList(tag, *attrList, **kwargs)
+
+ if not nodeList:
+ child = self.xmlAddChild(tag, *attrList, **kwargs)
+ for k in attrList: child.el.setAttribute(k, "")
+ for k, v in kwargs.items(): child.el.setAttribute(k, _encode(str(v)))
+ nodeList.append(child)
+ else:
+ list = []
+ for node in nodeList: list.append(self._inst(node))
+ nodeList = list
+
+ return nodeList
+
+
+ def xmlInitChildNodeList(self, tag, *attrList, **kwargs):
+ """
+ Each element of the returned list is an instance
+ of the XMLElement class.
+ """
+ nodeList = self._childNodeList(tag, *attrList, **kwargs)
+
+ if not nodeList:
+ child = self.xmlAddChild(tag, *attrList, **kwargs)
+ for k in attrList: child.el.setAttribute(k, "")
+ for k, v in kwargs.items(): child.el.setAttribute(k, _encode(str(v)))
+ nodeList.append(child)
+ else:
+ list = []
+ for node in nodeList: list.append(self._inst(node))
+ nodeList = list
+
+ return nodeList
+
+
+ def xmlInitNode(self, tag, *attrList, **kwargs):
+ """
+ Return a single XMLElement node from the explored elementNode.
+ If the tag does not exist, it will be created.
+ The returned element is an instance of the XMLElement class.
+ """
+ nodeList = self._nodeList(tag, *attrList, **kwargs)
+
+ if not nodeList:
+ child = self.xmlAddChild(tag, *attrList, **kwargs)
+ for k in attrList: child.el.setAttribute(k, "")
+ for k, v in kwargs.items(): child.el.setAttribute(k, _encode(str(v)))
+ else:
+ if len(nodeList) > 1:
+ msg = "There is an error in with the use of the xmlInitNode method. "\
+ "There is more than one occurence of the tag: " + tag
+ for n in nodeList: msg += "\n" + self._inst(n).__str__()
+ self._errorExit(msg)
+ else:
+ child = self._inst(nodeList[0])
+
+ return child
+
+
+ def xmlInitChildNode(self, tag, *attrList, **kwargs):
+ """
+ Return a single XMLElement child node from the explored elementNode.
+ If the tag does not exist, it will be created.
+ The returned element is an instance of the XMLElement class.
+ """
+ nodeList = self._childNodeList(tag, *attrList, **kwargs)
+
+ if not nodeList:
+ child = self.xmlAddChild(tag, *attrList, **kwargs)
+ for k in attrList: child.el.setAttribute(k, "")
+ for k, v in kwargs.items(): child.el.setAttribute(k, _encode(str(v)))
+ else:
+ if len(nodeList) > 1:
+ msg = "There is an error in with the use of the xmlInitChildNode method. "\
+ "There is more than one occurence of the tag: " + tag
+ for n in nodeList: msg += "\n" + self._inst(n).__str__()
+ self._errorExit(msg)
+ else:
+ child = self._inst(nodeList[0])
+
+ return child
+
+
+ def xmlChildsCopy(self, oldNode, deep=1000):
+ """
+ Copy all childsNode of oldNode to the node newNode.
+ 'deep' is the childs and little-childs level of the copy.
+ """
+ if self.ca: self.ca.modified()
+
+ if oldNode.el.hasChildNodes():
+ for n in oldNode.el.childNodes:
+ self._inst(self.el.appendChild(n.cloneNode(deep)))
+
+ log.debug("xmlChildsCopy-> %s" % self.__xmlLog())
+
+
+ def xmlRemoveNode(self):
+ """
+ Destroy a single node.
+ """
+ if self.ca: self.ca.modified()
+ oldChild = self.el.parentNode.removeChild(self.el)
+ oldChild.unlink()
+
+
+ def xmlRemoveChild(self, tag, *attrList, **kwargs):
+ """
+ Destroy the nodeList found with 'tag' and
+ 'attrList'/'kwargs' if they exist.
+ """
+ for node in self._nodeList(tag, *attrList, **kwargs):
+ self._inst(node).xmlRemoveNode()
+
+ log.debug("xmlRemoveChild-> %s %s" % (tag, self.__xmlLog()))
+
+
+ def xmlNormalizeWhitespace(self, text):
+ """
+ return a string without redundant whitespace.
+ """
+ # This function is important even if it is single line.
+ # XML treats whitespace very flexibly; you can
+ # include extra spaces or newlines wherever you like. This means that
+ # you must normalize the whitespace before comparing attribute values or
+ # element content; otherwise the comparison might produce a wrong
+ # result due to the content of two elements having different amounts of
+ # whitespace.
+ return string.join(string.split(text), ' ')
+
+
+##class _Document(Document):
+## """
+## """
+## def writexml(self, writer, indent="", addindent="", newl=""):
+## """
+## """
+## writer.write('<?xml version="1.0" encoding="%s" ?>\n' % enc)
+## for node in self.childNodes:
+## node.writexml(writer, indent, addindent, newl)
+
+
+class XMLDocument(XMLElement):
+ """
+ """
+ def __init__(self, case=None, tag=None, *attrList, **kwargs):
+ """
+ """
+## self.doc = _Document()
+ self.doc = Document()
+ self.case = case
+
+ XMLElement.__init__(self, self.doc, self.doc, self.case)
+
+ if tag:
+ self.el = self.xmlAddChild(tag, *attrList, **kwargs).el
+
+
+ def root(self):
+ """
+ This function return the only one root element of the document
+ (higher level of ELEMENT_NODE after the <?xml version="1.0" ?> markup).
+ """
+ return self._inst(self.doc.documentElement)
+
+
+ def toString(self):
+ """
+ Return the XMLDocument to a byte string (without \n and \t).
+ Unicode characters are encoded.
+ """
+ return self.el.toxml(enc)
+
+
+ def toUnicodeString(self):
+ """
+ Return the XMLDocument node to a byte string (without \n and \t).
+ Unicode string are decoded if it's possible by the standard output,
+ if not unicode characters are replaced by '?' character.
+ Warning: do not use this method for comparison purpose!
+ """
+ unicode_obj = self.el.toxml()
+ try:
+ return unicode_obj.encode("iso-8859-1",'replace')
+ except:
+ return unicode_obj.encode(sys.stdout.encoding,'replace')
+
+
+ def toPrettyString(self):
+ """
+ Return the XMLDocument to a byte string with \n and \t.
+ Unicode characters are encoded.
+ """
+ return self.doc.toprettyxml(encoding = enc)
+
+
+ def toPrettyUnicodeString(self):
+ """
+ Return the XMLDocument node to a byte string with \n and \t.
+ Unicode string are decoded if it's possible by the standard output,
+ if not unicode characters are replaced by '?' character.
+ Warning: the returned XMLDocument do not show the encoding in the
+ header, because it is already encoded!
+ Warning: do not use this method for comparison purpose!
+ """
+ unicode_obj = self.el.toprettyxml()
+ try:
+ return unicode_obj.encode("iso-8859-1",'replace')
+ except:
+ return unicode_obj.encode(sys.stdout.encoding,'replace')
+
+
+ def __str__(self):
+ """
+ Print the XMLDocument node with \n and \t.
+ Unicode string are decoded if it's possible by the standard output,
+ if not unicode characters are replaced by '?' character.
+ Warning: the returned XMLDocument do not show the encoding in the
+ header, because it is already encoded!
+ Warning: do not use this method for comparison purpose!
+ """
+ return self.toPrettyUnicodeString()
+
+
+ def parse(self, d):
+ """
+ return a xml doc from a file
+ """
+ self.doc = self.el = parse(d)
+ return self
+
+
+ def parseString(self, d):
+ """
+ return a xml doc from a string
+ """
+ self.doc = self.el = parseString(_encode(d))
+ return self
+
+
+ def xmlCleanAllBlank(self, node):
+ """
+ Clean a previous XMLElement file. The purpose of this method
+ is to delete all TEXT_NODE which are "\n" or "\t".
+ It is a recursive method.
+ """
+ if isinstance(node, XMLElement):
+ node = node.el
+
+ if 'formula' not in node.tagName:
+ for n in node.childNodes:
+ if n.nodeType == Node.TEXT_NODE:
+ n.data = self.xmlNormalizeWhitespace(n.data)
+ else:
+ for n in node.childNodes:
+ if n.nodeType == Node.TEXT_NODE:
+ while n.data[0] in (" ", "\n", "\t"):
+ n.data = n.data[1:]
+ while n.data[-1] in (" ", "\n", "\t"):
+ n.data = n.data[:-1]
+
+ node.normalize()
+
+ for n in node.childNodes:
+ if n.nodeType == Node.TEXT_NODE:
+ if n.data == "":
+ old_child = node.removeChild(n)
+ old_child.unlink()
+
+ for n in node.childNodes:
+ if n.nodeType == Node.ELEMENT_NODE:
+ if n.hasChildNodes(): self.xmlCleanAllBlank(n)
+
+
+ def xmlCleanHightLevelBlank(self, node):
+ """
+ This method deletes TEXT_NODE which are "\n" or "\t" in the
+ hight level of the ELEMENT_NODE nodes. It is a recursive method.
+ """
+ if isinstance(node, XMLElement):
+ node = node.el
+
+ elementNode = 0
+ for n in node.childNodes:
+ if n.nodeType == Node.ELEMENT_NODE:
+ elementNode = 1
+ if n.hasChildNodes():
+ self.xmlCleanHightLevelBlank(n)
+
+ if 'formula' not in node.tagName:
+ for n in node.childNodes:
+ if n.nodeType == Node.TEXT_NODE and not elementNode:
+ self.xmlCleanAllBlank(n.parentNode)
+ else:
+ for n in node.childNodes:
+ if n.nodeType == Node.TEXT_NODE:
+ while n.data[0] in (" ", "\n", "\t"):
+ n.data = n.data[1:]
+ while n.data[-1] in (" ", "\n", "\t"):
+ n.data = n.data[:-1]
+
+#-------------------------------------------------------------------------------
+# XML utility functions
+#-------------------------------------------------------------------------------
+
+class Case(Dico, XMLDocument):
+ def __init__(self, file_name=""):
+ """
+ Instantiate a new dico and a new xml doc
+ """
+ Dico.__init__(self)
+ XMLDocument.__init__(self, case=self)
+
+ if file_name:
+ self.parse(file_name)
+ self['new'] = "no"
+ self['saved'] = "yes"
+ else:
+ self.parseString(rootNode)
+ self['new'] = "yes"
+ self['saved'] = "yes"
+
+
+ def xmlRootNode(self):
+ """
+ This function return the only one root element of the document
+ (higher level of ELEMENT_NODE).
+ """
+ return self.doc.documentElement
+
+
+ def modified(self):
+ """
+ Return if the xml doc is modified.
+ """
+ self['saved'] = "no"
+
+
+ def isModified(self):
+ """
+ Return True if the xml doc is modified.
+ """
+ return self['saved'] == "no"
+
+
+ def __del__(self):
+ """
+ What to do when the instance of Case is deleted.
+ """
+ if hasattr(self, 'data'):
+ delattr(self, 'data')
+
+ if hasattr(self, 'doc'):
+ self.doc.unlink()
+ delattr(self, 'doc')
+
+
+ def __str__(self):
+ """
+ Print on the current terminal the contents of the case.
+ """
+ self.printDico()
+ return self.toPrettyUnicodeString()
+
+
+ def xmlSaveDocument(self):
+ """
+ This method write the associated xml file.
+ See saveCase and saveCaseAs methods in the Main module.
+ """
+ try:
+ d = XMLDocument().parseString(self.toPrettyString())
+ d.xmlCleanHightLevelBlank(d.root())
+ file = open(self['xmlfile'], 'w')
+ file.write(d.toString())
+ file.close()
+ self['new'] = "no"
+ self['saved'] = "yes"
+ d.doc.unlink()
+ except IOError:
+ msg = "Error: unable to save the XML document file." ,
+ "(XMLengine module, Case class, xmlSaveDocument method)"
+ print msg
+
+## def xmlSaveDocument(self):
+## """
+## This method write the associated xml file.
+## See saveCase and saveCaseAs methods in the Main module.
+## """
+## try:
+## file = open(self['xmlfile'], 'w')
+## file.write(self.toPrettyString())
+## file.close()
+## self['new'] = "no"
+## self['saved'] = "yes"
+## except IOError:
+## msg = "Error: unable to save the XML document file." ,
+## "(XMLengine module, Case class, xmlSaveDocument method)"
+## print msg
+
+#-------------------------------------------------------------------------------
+# XMLengine test case
+#-------------------------------------------------------------------------------
+
+
+class XMLengineTestCase(unittest.TestCase):
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ self.doc = XMLDocument()
+
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ self.doc.doc.unlink()
+
+
+ def xmlNewFile(self):
+ """Private method to return a xml document."""
+ return \
+ u'<root><first/><market><cucumber/><fruits color="red"/></market></root>'
+
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+
+ def checkXMLDocumentInstantiation(self):
+ """Check whether the Case class could be instantiated."""
+ xmldoc = None
+ tag = None
+ xmldoc = XMLDocument(tag=tag)
+
+ assert xmldoc, 'Could not instantiate XMLDocument'
+
+
+ def checkXmlAddChild(self):
+ """Check whether a node child could be added."""
+ node = self.doc.xmlAddChild("table", name="test")
+ node.xmlAddChild("field", "label", name="info", type="text")
+ truc = node.toString()
+ doc = '<table name="test">'\
+ '<field label="" name="info" type="text"/>'\
+ '</table>'
+
+ assert doc == truc, 'Could not use the xmlAddChild method'
+
+
+ def checkNodeList(self):
+ """Check whether a node could be found if it does exist."""
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ node = '<fruits color="red"/>'
+
+ nodeList = xmldoc._nodeList('fruits')
+ truc = nodeList[0].toxml()
+ assert node == truc, 'Could not use the _nodeList method'
+
+ nodeList = xmldoc._nodeList('fruits', 'color')
+ truc = nodeList[0].toxml()
+ assert node == truc, 'Could not use the _nodeList method'
+
+ nodeList = xmldoc._nodeList('fruits', color="red")
+ truc = nodeList[0].toxml()
+ assert node == truc, 'Could not use the _nodeList method'
+
+
+ def checkChildNodeList(self):
+ """Check whether a child node could be found if it does exist."""
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ n = self.doc._inst(xmldoc.doc.firstChild.childNodes[1])
+ node = '<fruits color="red"/>'
+
+ nodeList = n._childNodeList('fruits')
+ truc = nodeList[0].toxml()
+ assert node == truc, 'Could not use the _childNodeList method'
+
+ nodeList = n._childNodeList('fruits', 'color')
+ truc = nodeList[0].toxml()
+ assert node == truc, 'Could not use the _childNodeList method'
+
+ nodeList = n._childNodeList('fruits', color="red")
+ truc = nodeList[0].toxml()
+ assert node == truc, 'Could not use the _childNodeList method'
+
+ nodeList = xmldoc._childNodeList('fruits', color="red")
+ self.failUnless(nodeList==[], 'Could not use the _childNodeList method')
+
+
+ def checkXmlInitNodeList(self):
+ """Check whether a node child list could be get."""
+ nList1 = self.doc.xmlInitNodeList("table", name="test")
+ nList2 = nList1[0].xmlInitNodeList("field", "label", name="info", type="text")
+ truc = nList1[0].toString()
+ doc = '<table name="test">'\
+ '<field label="" name="info" type="text"/>'\
+ '</table>'
+
+ assert doc == truc, 'Could not use the xmlInitNodeList method'
+
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ node = '<fruits color="red"/>'
+
+ nodeList = xmldoc.xmlInitNodeList('fruits')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlInitNodeList method'
+
+ nodeList = xmldoc.xmlInitNodeList('fruits', 'color')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlInitNodeList method'
+
+ nodeList = xmldoc.xmlInitNodeList('fruits', color="red")
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlinitNodeList method'
+
+
+ def checkXmlInitNode(self):
+ """Check whether a node child could be get."""
+ n1 = self.doc.xmlInitNode("table", name="test")
+ n2 = n1.xmlInitNode("field", "label", name="info", type="text")
+ truc = n1.toString()
+ doc = '<table name="test">'\
+ '<field label="" name="info" type="text"/>'\
+ '</table>'
+
+ assert doc == truc, 'Could not use the xmlInitNodeList method'
+
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ node = '<fruits color="red"/>'
+
+ truc = xmldoc.xmlInitNode('fruits').toString()
+ assert node == truc, 'Could not use the xmlInitNode method'
+
+ truc = xmldoc.xmlInitNode('fruits', 'color').toString()
+ assert node == truc, 'Could not use the xmlInitNode method'
+
+ truc = xmldoc.xmlInitNode('fruits', color="red").toString()
+ assert node == truc, 'Could not use the xmlInitNode method'
+
+
+ def checkXmlInitChildNodeList(self):
+ """Check whether a child node list could be found if it does exist."""
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ thermo = self.doc._inst(xmldoc.doc.firstChild.childNodes[1])
+ truc = '<market><cucumber/><fruits color="red"/></market>'
+ assert thermo.toString() == truc, 'Could not use the firstChild.childNodes method'
+
+ node = '<fruits color="red"/>'
+
+ nodeList = thermo.xmlInitChildNodeList('fruits')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlInitChildNodeList method'
+
+ nodeList = thermo.xmlInitChildNodeList('fruits', 'color')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlInitChildNodeList method'
+
+ nodeList = thermo.xmlInitChildNodeList('fruits', color="red")
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlInitChildNodeList method'
+
+
+ def checkXmlInitChildNode(self):
+ """Check whether a node child could be get."""
+ n1 = self.doc.xmlInitChildNode("table", name="test")
+ n2 = n1.xmlInitChildNode("field", "label", name="info", type="text")
+ truc = n1.toString()
+ doc = '<table name="test">'\
+ '<field label="" name="info" type="text"/>'\
+ '</table>'
+
+ assert doc == truc, 'Could not use the xmlInitNodeList method'
+
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ thermo = self.doc._inst(xmldoc.doc.firstChild.childNodes[1])
+ node = '<fruits color="red"/>'
+
+ truc = thermo.xmlInitChildNode('fruits').toString()
+ assert node == truc, 'Could not use the xmlInitChildNode method'
+
+ truc = thermo.xmlInitChildNode('fruits', 'color').toString()
+ assert node == truc, 'Could not use the xmlInitChildNode method'
+
+ truc = thermo.xmlInitChildNode('fruits', color="red").toString()
+ assert node == truc, 'Could not use the xmlInitChildNode method'
+
+
+ def checkXmlGetNodeList(self):
+ """Check whether a node list could be found if it does exist."""
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ node = '<fruits color="red"/>'
+
+ nodeList = xmldoc.xmlGetNodeList('fruits')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlGetNodeList method'
+
+ nodeList = xmldoc.xmlGetNodeList('fruits', 'color')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlGetNodeList method'
+
+ nodeList = xmldoc.xmlGetNodeList('fruits', color="red")
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlGetNodeList method'
+
+ nodeList = xmldoc.xmlGetNodeList('fruits', color="red")
+ self.failIf(nodeList==[], 'Could not use the xmlGetNodeList method')
+
+
+ def checkXmlGetChildNodeList(self):
+ """Check whether a child node list could be found if it does exist."""
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ thermo = self.doc._inst(xmldoc.doc.firstChild.childNodes[1])
+ node = '<fruits color="red"/>'
+
+ nodeList = thermo.xmlGetChildNodeList('fruits')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlGetChildNodeList method'
+
+ nodeList = thermo.xmlGetChildNodeList('fruits', 'color')
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlGetChildNodeList method'
+
+ nodeList = thermo.xmlGetChildNodeList('fruits', color="red")
+ truc = nodeList[0].toString()
+ assert node == truc, 'Could not use the xmlGetChildNodeList method'
+
+ nodeList = xmldoc.xmlGetChildNodeList('fruits', color="red")
+ self.failUnless(nodeList==[], 'Could not use the xmlGetChildNodeList method')
+
+
+ def checkXmlGetNode(self):
+ """Check whether a child node could be found if it does exist."""
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ node = '<fruits color="red"/>'
+
+ truc = xmldoc.xmlGetNode('fruits').toString()
+ assert node == truc, 'Could not use the xmlGetNode method'
+
+ truc = xmldoc.xmlGetNode('fruits', 'color').toString()
+ assert node == truc, 'Could not use the xmlGetNode method'
+
+ truc = xmldoc.xmlGetNode('fruits', color="red").toString()
+ assert node == truc, 'Could not use the xmlGetNode method'
+
+ empty = xmldoc.xmlGetNode('fruits', color="red")
+ assert empty, 'Could not use the xmlGetNode method'
+
+
+ def checkXmlGetChildNode(self):
+ """Check whether a child node could be found if it does exist."""
+ xmldoc = self.doc.parseString(self.xmlNewFile())
+ n = self.doc._inst(xmldoc.doc.firstChild.childNodes[1])
+ node = '<fruits color="red"/>'
+
+ truc = n.xmlGetChildNode('fruits').toString()
+ assert node == truc, 'Could not use the xmlGetChildNode method'
+
+ truc = n.xmlGetChildNode('fruits', 'color').toString()
+ assert node == truc, 'Could not use the xmlGetChildNode method'
+
+ truc = n.xmlGetChildNode('fruits', color="red").toString()
+ assert node == truc, 'Could not use the xmlGetChildNode method'
+
+ empty = xmldoc.xmlGetChildNode('fruits', color="red")
+ self.failUnless(empty==None, 'Could not use the xmlGetChildNode method')
+
+
+ def checkXMLDocumentUnicodeParseString(self):
+ """Check whether a XMLDocument with unicode string could be created."""
+ d = XMLDocument()
+ d.parseString(u'<français a="àùè">tâché</français>')
+
+ t = u'<?xml version="1.0" encoding="utf-8"?>\n' \
+ u'<français a="àùè">tâché</français>'
+ t = t.encode(enc)
+ assert d.toString() == t, 'Could not use the parseString method with utf-8 encoding'
+
+ t = u'<?xml version="1.0" encoding="utf-8"?>\n' \
+ u'<français a="àùè">\n\ttâché\n</français>\n'
+ t = t.encode(enc)
+ assert d.toPrettyString() == t, 'Could not use the parseString method with utf-8 encoding'
+
+ t = self.xmlNodeFromString(u'<français a="àùè">tâché</français>')
+ assert d.root() == t, 'Could not use the parseString method with utf-8 encoding'
+
+
+ def checkXmlNodeFromString(self):
+ """"Check whether two XML nodes could be compared."""
+ print '\n'
+ n1 = self.xmlNodeFromString(u'<fruits taste="ok" color="red"><a>toto</a><c a="2é"/></fruits>')
+ n2 = XMLDocument().parseString(u'<fruits color="red" taste="ok"><c a="2é"/><a>toto</a></fruits>').root()
+ assert n1 == n2, 'This two node are not identical'
+
+ n3 = self.xmlNodeFromString(u'<fruits><b/><a>123.0</a></fruits>')
+ n4 = XMLDocument().parseString(u'<fruits><a>123</a><b/></fruits>').root()
+ assert n3 == n4, 'This two node are not identical'
+
+ d1 = '<fruits><apple from="W" name="P"/><apple from="P"/></fruits>'
+ d2 = '<fruits><apple from="P"/><apple from="W" name="P"/></fruits>'
+ n5 = self.xmlNodeFromString(d1)
+ n6 = XMLDocument().parseString(d2).root()
+ assert n5 == n6, 'This two node are not identical'
+
+ d1 = '<velocity_pressure>'\
+ '<variable label="U" name="velocity_U"/>'\
+ '<variable label="V" name="velocity_V"/>'\
+ '<variable label="W" name="velocity_W"/>'\
+ '<variable label="P" name="pressure"/>'\
+ '</velocity_pressure>'
+ d2 = '<velocity_pressure>'\
+ '<variable label="P" name="pressure"/>'\
+ '<variable label="U" name="velocity_U"/>'\
+ '<variable label="V" name="velocity_V"/>'\
+ '<variable label="W" name="velocity_W"/>'\
+ '</velocity_pressure>'
+ n5 = self.xmlNodeFromString(d1)
+ n6 = XMLDocument().parseString(d2).root()
+ assert n5 == n6, 'This two node are not identical'
+
+ d1 = '<turbulence model="Rij-epsilon">'\
+ '<property label="turb. vi" name="turb_viscosity"/>'\
+ '<variable label="R11" name="component_R11"/>'\
+ '</turbulence>'
+ d2 = '<turbulence model="Rij-epsilon">'\
+ '<variable label="R11" name="component_R11"/>'\
+ '<property label="turb. vi" name="turb_viscosity"/>'\
+ '</turbulence>'
+ n5 = self.xmlNodeFromString(d1)
+ n6 = XMLDocument().parseString(d2).root()
+ assert n5 == n6, 'This two node are not identical'
+
+ def checkCaseInstantiation(self):
+ """Check whether the Case class could be instantiated."""
+ case = None
+ case = Case()
+ assert case, 'Could not instantiate Case'
+
+
+ def checkCaseParseString(self):
+ """Check whether a Case could be created."""
+ case = Case()
+ assert case.root() == self.xmlNodeFromString(rootNode), \
+ 'Could not use the parseString method'
+
+
+ def checkXmlSaveDocument(self):
+ """Check whether a Case could be save on the file system"""
+ case = Case()
+ case.parseString(u'<fruits color="red" taste="ok"><c a="2é">to</c></fruits>')
+ case['xmlfile'] = os.path.dirname(os.getcwd()) + "/ToTo"
+ if os.path.isfile(case['xmlfile']):
+ os.remove(case['xmlfile'])
+ case.xmlSaveDocument()
+
+ if not os.path.isfile(case['xmlfile']):
+ assert False, \
+ 'Could not save the file ' + case['xmlfile']
+
+ d= case.parse(case['xmlfile'])
+ os.remove(case['xmlfile'])
+ d.xmlCleanAllBlank(d.root())
+ assert case.root() == d.root(), \
+ 'Could not use the xmlSaveDocument method'
+
+
+## def checkFailUnless(self):
+## """Test"""
+## self.failUnless(1==1, "One should be one.")
+##
+##
+## def checkFailIf(self):
+## """Test"""
+## self.failIf(1==2,"I don't one to be one, I want it to be two.")
+
+
+def suite():
+ """unittest function"""
+ testSuite = unittest.makeSuite(XMLengineTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ """unittest function"""
+ print "XMLengineTestCase to be completed..."
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# Check XML file
+#-------------------------------------------------------------------------------
+
+
+# A "Well Formed" XML document is a document that conforms to the XML
+# syntax rules that we described in the previous chapter.
+#
+# A "Valid" XML document is a "Well Formed" XML document which conforms to the
+# rules of a Document Type Definition (DTD).
+#
+# This small script will check whether one or more XML documents are well-formed.
+#
+# This uses the SAX API with a "dummy" ContentHandler that does nothing.
+# It parses the whole document and throws an exception if there is an error.
+# The exception will be caught and printed like this:
+#
+# $ python wellformed.py test.xml
+# test.xml is NOT well-formed! test.xml:1002:2: mismatched tag
+#
+# This means that character 2 on line 1002 has a mismatched tag.
+#
+# The script will not check adherence to a DTD or schema.
+#(Code from: aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52256)
+
+from xml.sax.handler import ContentHandler
+from xml.sax import make_parser
+
+class XMLchek:
+ def __call__(self, filename):
+ try:
+ self.parsefile(filename)
+ print "%s is well-formed" % filename
+ except Exception, e:
+ print "%s is NOT well-formed! %s" % (filename, e)
+ sys.exit(0)
+
+ def parsefile(self, file):
+ parser = make_parser()
+ parser.setContentHandler(ContentHandler())
+ parser.parse(file)
+
+
+
+#-------------------------------------------------------------------------------
+# Archives :
+#-------------------------------------------------------------------------------
+#
+##This module defines a Lightweight XML constructor and reader.
+##Here is a very easy solution, that doesn't offer all capabilities of XML
+##but sufficient stuff for creating valid XML outputs and read them later.
+##The central class is XMLElement, even the XMLDocument derives from that.
+##This module also handles the encoding in quite an easy way, that's usefull
+##if you don't like to use unicode data.
+##(Code stolen from: aspn.activestate.com/ASPN/Cookbook/Python/Recipe/157358)
+##
+##from xml.dom.minidom import Document, parse, parseString
+##from types import StringType, UnicodeType
+##import string
+##
+##enc = "iso-8859-1"
+##
+##def _encode(v):
+## if isinstance(v, UnicodeType):
+## v = v.encode(enc)
+## return v
+##
+##class XMLElement:
+##
+## def __init__(self, doc, el):
+## self.doc = doc
+## self.el = el
+##
+## def __getitem__(self, name):
+## a = self.el.getAttributeNode(name)
+## if a:
+## return _encode(a.value)
+## return None
+##
+## def __setitem__(self, name, value):
+## self.el.setAttribute(name, _encode(value))
+##
+## def __delitem__(self, name):
+## self.el.removeAttribute(name)
+##
+## def __str__(self):
+## return _encode(self.doc.toprettyxml())
+##
+## def toString(self):
+## return _encode(self.doc.toxml())
+##
+## def _inst(self, el):
+## return XMLElement(self.doc, el)
+##
+## def get(self, name, default=None):
+## a = self.el.getAttributeNode(name)
+## if a:
+## return _encode(a.value)
+## return _encode(default)
+##
+## def add(self, tag, **kwargs):
+## el = self.doc.createElement(tag)
+## for k, v in kwargs.items():
+## el.setAttribute(k, _encode(str(v)))
+## return self._inst(self.el.appendChild(el))
+##
+## def addText(self, data):
+## return self._inst(
+## self.el.appendChild(
+## self.doc.createTextNode(_encode(data))))
+##
+## def addComment(self, data):
+## return self._inst(
+## self.el.appendChild(
+## self.doc.createComment(data)))
+##
+## def getText(self, sep=" "):
+## rc = []
+## for node in self.el.childNodes:
+## if node.nodeType == node.TEXT_NODE:
+## rc.append(node.data)
+## return _encode(string.join(rc, sep))
+##
+## def getAll(self, tag):
+## return map(self._inst, self.el.getElementsByTagName(tag))
+##
+##class _Document(Document):
+##
+## def writexml(self, writer, indent="", addindent="", newl=""):
+## writer.write('<?xml version="1.0" encoding="%s" ?>\n' % enc)
+## for node in self.childNodes:
+## node.writexml(writer, indent, addindent, newl)
+##
+##class XMLDocument(XMLElement):
+##
+## def __init__(self, tag=None, **kwargs):
+## self.doc = _Document()
+## XMLElement.__init__(self, self.doc, self.doc)
+## if tag:
+## self.el = self.add(tag, **kwargs).el
+##
+## def parse(self, d):
+## self.doc = self.el = parse(d)
+## return self
+##
+## def parseString(self, d):
+## self.doc = self.el = parseString(_encode(d))
+## return self
+##
+##if __name__=="__main__":
+##
+## # Example of dumping a database structure
+## doc = XMLDocument("database", name="testdb")
+## table = doc.add("table", name="test")
+## table.add("field", name="counter", type="int")
+## table.add("field", name="name", type="varchar")
+## table.add("field", name="info", type="text")
+## print doc
+##
+## # Simulate reading a XML file
+## ndoc = XMLDocument()
+## ndoc.parseString(str(doc))
+## root = ndoc.getAll("database")
+## if root:
+## db = root[0]
+## print "Database:", db["name"]
+## for table in db.getAll("table"):
+## print " Table:", table["name"]
+## for field in db.getAll("field"):
+## print " Field:", field["name"], "- Type:", field["type"]
+##
+## # It's object oriented
+## print XMLDocument("notice").add("text",format="plain").addText("Some text")
+#
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ runTest()
+ sys.exit(0)
+
+
+ print "------------------------------------------------------"
+ print " Lightweight XML constructor and reader testing"
+ print "------------------------------------------------------\n"
+
+ # Example of dumping a database structure
+ #
+ xmldoc = XMLDocument("", "", "database", name="testdb")
+ print "XMLDocument:\n", xmldoc
+
+ table = xmldoc.xmlAddChild("table", name="test")
+ table.xmlAddChild("field", name="counter", type="int")
+ table.xmlAddChild("field", name="name", type="varchar")
+ table.xmlAddChild("field", name="info", type="text")
+ print "table:\n", table
+
+ print "name:", table.xmlGetAttribute("name")
+ table.xmlDelAttribute("name")
+ table.xmlCreateAttribute(truc="super", toto="méga")
+ table.xmlCreateAttribute(name="atchoum")
+ for field in table.xmlGetNodeList("field", "name", "type", type="text"):
+ print "field:", field.toString()
+ print "truc:", table.xmlGetAttribute("truc")
+ #table.xmlGetAttribute("tru") # Uncomment this line for testing
+ l = table.xmlGetNodeList("camion", "jacky", moquette="moche")
+ if not l:
+ l = table.xmlAddChild("camion", jacky="", moquette="moche")
+ print "child:", l.toString()
+ l = table.xmlInitNodeList("camion", "jacky", moquette="bêlle")[0]
+ print "child:", l.toString()
+
+ l.xmlSetData("camion", "rétro")
+ l.xmlSetData("camion", "chèvre")
+ for i in table.xmlGetNodeList("camion"):
+ print "List camion :", i.toString(), "\n"
+ for i in table.xmlGetChildNodeList("camion"):
+ print "Child camion:", i.toString(), "\n"
+
+ table.xmlAddComment("Ceci est un commentaire")
+ table.xmlInitNodeList('scalar', 'roue', 'box', auto='yes', type='model')
+ table.xmlInitNodeList('scalar', 'roue', 'box', 'auto', type='model')
+
+ chaise = xmldoc.xmlAddChild("chaise", name="test")
+ chaise.xmlChildsCopy(table)
+ l = chaise.xmlGetNodeList("camion", "jacky", "moquette")
+ for camion in l:
+ camion.xmlDelAttribute("moquette")
+ camion.xmlSetAttribute(jacky="riton")
+ chaise.xmlGetNodeList("camion")[1].xmlRemoveChild("moumoutte")
+ chaise.xmlRemoveNode()
+
+ chaise = xmldoc.xmlAddChild("chaise", name="test")
+ p = chaise.xmlSetData("pieds", 4)
+ print p[0].toString()
+ print chaise.xmlGetStringList("pieds")
+ print chaise.xmlGetIntList("pieds")
+ print chaise.xmlGetString("pieds")
+ print chaise.xmlGetInt("pieds")
+ print chaise.xmlGetDouble("pieds")
+ print p[0].xmlGetTextNode()
+
+ print xmldoc
+
+ # Direct acces to node's methods
+ #print dir(xmldoc.doc.documentElement)
+ #print _encode(xmldoc.doc.documentElement.toxml())
+ #print _encode(xmldoc.doc.documentElement.childNodes[0].childNodes[2].attributes.get("name").value)
+ #print _encode(xmldoc.doc.firstChild.firstChild.childNodes[1].attributes.items())
+ #print dir(xmldoc.doc.firstChild.firstChild.childNodes[1].attributes)
+
+ # Simulate reading a XML file
+ ndoc = XMLDocument("", "")
+ print "XML DOC:", ndoc.toString()
+ ndoc.parseString(str(xmldoc))
+ print "XML DOC:", ndoc.toString()
+ root = ndoc.xmlGetNodeList("database")
+ if root:
+ db = root[0]
+ print "Database:", db.xmlGetAttribute("name")
+ for table in db.xmlGetNodeList("table"):
+ print " Table:", table.xmlGetAttribute("name")
+ for field in table.xmlGetNodeList("field"):
+ print " Field:", field.xmlGetAttribute("name"), \
+ "- Type:", field.xmlGetAttribute("type")
+
+
+ ndoc.parseString('<?xml version="1.0" encoding="utf-8" ?><foo><baré/></foo>')
+ print "1 XML DOC:\n", ndoc
+
+ ndoc.parse("../misc/foo.txt")
+ print "2 XML DOC:\n", ndoc
+
+
+ print "------------------------------------------------------"
+ print " Case class testing"
+ print "------------------------------------------------------\n"
+
+ case = Case()
+ case['new'] = 'toto'
+ print "case:", case['new']
+ models = case.xmlGetNodeList('thermophysical_models')[0]
+ models = case.xmlInitNodeList('thermophysical_models')[0]
+ #print "models :", dir(models)
+ variables = models.xmlGetNodeList('variable')
+ for var in variables:
+ name = var['name']
+ print var.toString(), name
+ var['label'] = name
+ #var.xmlSetAttribute(label='truc')
+
+ #print case
+ #case.xmlRemoveChild('variable')
+ #print case
+
+
+#-------------------------------------------------------------------------------
+# End of XMLengine
+#-------------------------------------------------------------------------------
diff --git a/gui/Base/XMLinitialize.py b/gui/Base/XMLinitialize.py
new file mode 100644
index 0000000..91b0d9b
--- /dev/null
+++ b/gui/Base/XMLinitialize.py
@@ -0,0 +1,324 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the XML data model in which the user defines the physical
+options of the treated case.
+
+This module contains the following classe:
+- XMLinit
+- XMLinitTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import sys, unittest
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from Common import XML_DOC_VERSION
+from XMLvariables import Variables
+import Toolbox
+from Pages.LocalizationModel import Zone, LocalizationModel
+from Pages.MobileMeshModel import MobileMeshModel
+from Pages.TurbulenceModel import TurbulenceModel
+from Pages.InitializationModel import InitializationModel
+from Pages.TimeStepModel import TimeStepModel
+from Pages.SteadyManagementModel import SteadyManagementModel
+from Pages.FluidCharacteristicsModel import FluidCharacteristicsModel
+from Pages.CoalCombustionModel import CoalCombustionModel
+from Pages.ThermalScalarModel import ThermalScalarModel
+from Pages.ElectricalModelsModel import ElectricalModel
+from Pages.GasCombustionModel import GasCombustionModel
+from Pages.ThermalRadiationModel import ThermalRadiationModel
+
+
+#-------------------------------------------------------------------------------
+# class XMLinit
+#-------------------------------------------------------------------------------
+
+
+class XMLinit(Variables):
+ """
+ This class initialize the XML contents of the case.
+ """
+ def __init__(self, case):
+ """
+ """
+ self.case = case
+ self.root = self.case.root()
+
+ if self.root['version'] != XML_DOC_VERSION:
+ msg = "The version of the loaded case is to old: %s.\n"\
+ "The minimum version required is: %s." % \
+ (self.root['version'], XML_DOC_VERSION)
+ raise ValueError, msg
+
+ # Verify that all Heading exist only once in the XMLDocument.
+ # Create the missing heading.
+
+ self.initHeading()
+
+ # Initialization (order is important, see turbulenceModelsList method)
+
+ self.node_models = self.case.xmlInitNode('thermophysical_models')
+ node = self.node_models.xmlInitNode('velocity_pressure')
+ for tag in ('pressure',
+ 'velocity_U',
+ 'velocity_V',
+ 'velocity_W'):
+ self.setNewVariable(node, tag)
+ self.setNewProperty(node, 'total_pressure')
+ n = self.setNewProperty(node, 'yplus')
+ n['support'] = 'boundary'
+ n['label'] = 'Yplus'
+ n = self.setNewProperty(node, 'effort')
+ n['support'] = 'boundary'
+ n['label'] = 'Efforts'
+ n = self.setNewProperty(node, 'all_variables')
+ n['support'] = 'boundary'
+
+ MobileMeshModel(self.case).getMethod()
+ TurbulenceModel(self.case).getTurbulenceModel()
+
+ # First Volume Zone definition for all cells -> initialization
+
+ if Toolbox.GuiParam.matisse == False:
+ zones = LocalizationModel("VolumicZone", self.case).getZones()
+ iok = 0
+ for zone in zones:
+ if zone.getLabel() == 'all_cells':
+ iok = 1
+ if iok == 0:
+ zone = Zone("VolumicZone", label = 'all_cells', localization = 'all[]')
+ LocalizationModel("VolumicZone", self.case).addZone(zone)
+ zone = LocalizationModel("VolumicZone", self.case).getCodeNumberOfZoneLabel('all_cells')
+ InitializationModel(self.case).getInitialTurbulenceChoice(zone)
+
+ # Time step
+
+ TimeStepModel(self.case).getTimeStep()
+ TimeStepModel(self.case).getIterationsNumber()
+ TimeStepModel(self.case).getTimePassing()
+
+ # Thermodynamics definitinon
+
+ m = FluidCharacteristicsModel(self.case)
+ for tag in ('density',
+ 'molecular_viscosity',
+ 'specific_heat',
+ 'thermal_conductivity'):
+ m.getInitialValue(tag)
+
+ # Calculation features
+
+ SteadyManagementModel(self.case).getSteadyFlowManagement()
+ ThermalScalarModel(self.case).getThermalScalarModel()
+ CoalCombustionModel(self.case).getCoalCombustionModel()
+ GasCombustionModel(self.case).getGasCombustionModel()
+ ElectricalModel(self.case).getElectricalModel()
+ ThermalRadiationModel(self.case).getRadiativeModel()
+
+
+ def _errorExit(self, msg):
+ """
+ """
+ print 'XML ERROR'
+ raise ValueError, msg
+
+
+ def initHeading(self):
+ """
+ Create if necessary headings from the root element of the case.
+ """
+ tagList = ('solution_domain',
+ 'thermophysical_models',
+ 'numerical_parameters',
+ 'physical_properties',
+ 'additional_scalars',
+ 'boundary_conditions',
+ 'analysis_control',
+ 'calcul_management')
+
+ for tag in tagList:
+ nodeList = self.root.xmlInitChildNodeList(tag)
+
+ if len(nodeList) > 1:
+ msg = "There is an error in with the use of the initHeading method. "\
+ "There is more than one occurence of the tag: \n\n" + tag + \
+ "\n\nThe application will finish. Sorry."
+ self._errorExit(msg)
+
+ for tag in tagList:
+ nodeList = self.case.xmlInitNodeList(tag)
+
+ if len(nodeList) > 1:
+ msg = "There is an error in with the use of the initHeading method. "\
+ "There is more than one occurence of the tag: \n\n" + tag + \
+ "\n\nThe application will finish. Sorry."
+ self._errorExit(msg)
+
+
+#-------------------------------------------------------------------------------
+# XMLinit test case
+#-------------------------------------------------------------------------------
+
+
+class XMLinitTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """
+ This method is executed before all "check" methods.
+ """
+ import XMLengine
+ Toolbox.GuiParam.lang = 'en'
+ self.doc = XMLengine.XMLDocument("")
+ self.case = XMLengine.Case(None)
+
+
+ def tearDown(self):
+ """
+ This method is executed after all "check" methods.
+ """
+ del self.case
+ del self.doc
+
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+
+ def checkXMLinitInstantiation(self):
+ """
+ Check whether the Case class could be instantiated
+ """
+ xmldoc = None
+ xmldoc = XMLinit(self.case)
+ assert xmldoc != None, 'Could not instantiate XMLinit'
+
+
+ def checkInitHeading(self):
+ """
+ Check whether the headings markups could be initialized
+ """
+ doc = \
+ '<Code_Saturne_GUI case="" study="" version="1.0">'\
+ '<solution_domain/>'\
+ '<thermophysical_models>'\
+ '<velocity_pressure>'\
+ '<variable label="Pressure" name="pressure"/>'\
+ '<variable label="VelocitU" name="velocity_U"/>'\
+ '<variable label="VelocitV" name="velocity_V"/>'\
+ '<variable label="VelocitW" name="velocity_W"/>'\
+ '<property label="total_pressure" name="total_pressure"/>'\
+ '</velocity_pressure>'\
+ '<turbulence model="k-epsilon">'\
+ '<variable label="TurbEner" name="turb_k"/>'\
+ '<variable label="Dissip" name="turb_eps"/>'\
+ '<property label="turb. vi" name="turb_viscosity"/>'\
+ '<initialization choice="reference_velocity">'\
+ '<reference_velocity>1.0</reference_velocity>'\
+ '</initialization>'\
+ '</turbulence>'\
+ '<initialization>'\
+ '<zone name="1">0</zone>'\
+ '</initialization>'\
+ '<thermal_scalar model="off"/>'\
+ '<gas_combustion model="off"/>'\
+ '<pulverized_coal model="off"/>'\
+ '<joule_effect model="off"/>'\
+ '<radiative_transfer model="off"/>'\
+ '</thermophysical_models>'\
+ '<numerical_parameters/>'\
+ '<physical_properties>'\
+ '<fluid_properties>'\
+ '<property choice="constant" label="Density" name="density">'\
+ '<listing_printing status="off"/>'\
+ '<postprocessing_recording status="off"/>'\
+ '<initial_value>1.17862</initial_value>'\
+ '</property>'\
+ '<property choice="constant" label="Lam. vis" name="molecular_viscosity">'\
+ '<listing_printing status="off"/>'\
+ '<postprocessing_recording status="off"/>'\
+ '<initial_value>1.83e-05</initial_value>'\
+ '</property>'\
+ '<property choice="constant" label="Sp. heat" name="specific_heat">'\
+ '<listing_printing status="off"/>'\
+ '<postprocessing_recording status="off"/>'\
+ '<initial_value>1017.24</initial_value>'\
+ '</property>'\
+ '<property choice="constant" label="Th. cond" name="thermal_conductivity">'\
+ '<listing_printing status="off"/>'\
+ '<postprocessing_recording status="off"/>'\
+ '<initial_value>0.02495</initial_value>'\
+ '</property>'\
+ '</fluid_properties>'\
+ '</physical_properties>'\
+ '<additional_scalars/>'\
+ '<boundary_conditions/>'\
+ '<analysis_control>'\
+ '<time_parameters>'\
+ '<time_step_ref>0.1</time_step_ref>'\
+ '<property label="Nb Courant" name="courant_number">'\
+ '<property label="Nb Fourier" name="fourier_number">'\
+ '</time_parameters>'\
+ '</analysis_control>'\
+ '<calcul_management/>'\
+ '</Code_Saturne_GUI>'
+
+ XMLinit(self.case)
+## print self.case.root()
+
+ assert self.case.root() == self.xmlNodeFromString(doc), \
+ 'Could not use the constructor of the XMLinit class'
+
+
+def suite():
+ testSuite = unittest.makeSuite(XMLinitTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "XMLinitTestCase to be completed..."
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End of XMLinit
+#-------------------------------------------------------------------------------
diff --git a/gui/Base/XMLmodel.py b/gui/Base/XMLmodel.py
new file mode 100644
index 0000000..a6e1263
--- /dev/null
+++ b/gui/Base/XMLmodel.py
@@ -0,0 +1,242 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the XML data model in which the user defines the physical
+options of the treated case. This module defines also a very usefull
+function for the NavigatorTree display updating, taking into account
+the current options selected by the user.
+
+This module contains the following classes and function:
+- XMLmodel
+- XMLmodelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import sys, unittest
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from XMLvariables import Variables
+import Toolbox
+
+
+#-------------------------------------------------------------------------------
+# class XMLmodel
+#-------------------------------------------------------------------------------
+
+
+class XMLmodel(Variables):
+ """
+ This class initialize the XML contents of the case.
+ """
+ def __init__(self, case):
+ """
+ """
+ self.case = case
+ self.root = self.case.root()
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+
+#FIXME: voir getTurbulenceModel de Turbulence.py (le noeud etant a declarer des le deaprt /...
+ def getTurbModel(self):
+ """
+ This method return the turbilence model, but does not manage
+ default values. Therefore...
+ """
+ nodeTurb = self.node_models.xmlGetNode('turbulence', 'model')
+ return nodeTurb, nodeTurb['model']
+
+
+ def getTurbVariable(self):
+ """
+ """
+ nodeTurb, model = self.getTurbModel()
+ nodeList = []
+
+ if model in ('k-epsilon', 'k-epsilon-PL'):
+ nodeList.append(nodeTurb.xmlGetNode('variable', name='turb_k'))
+ nodeList.append(nodeTurb.xmlGetNode('variable', name='turb_eps'))
+
+ elif model in ('Rij-epsilon', 'Rij-SSG'):
+ for var in ('component_R11', 'component_R22', 'component_R33',
+ 'component_R12', 'component_R13', 'component_R23',
+ 'turb_eps'):
+ nodeList.append(nodeTurb.xmlGetNode('variable', name=var))
+
+ elif model in ('v2f-phi'):
+ for var in ('turb_k', 'turb_eps', 'turb_phi', 'turb_fb'):
+ nodeList.append(nodeTurb.xmlGetNode('variable', name=var))
+
+ elif model in ('k-omega-SST'):
+ nodeList.append(nodeTurb.xmlGetNode('variable', name='turb_k'))
+ nodeList.append(nodeTurb.xmlGetNode('variable', name='turb_omega'))
+
+ return nodeList
+
+
+ def getTurbProperty(self):
+ """
+ """
+ nodeTurb, model = self.getTurbModel()
+ nodeList = []
+
+ if model in ('mixing_length',
+ 'k-epsilon',
+ 'k-epsilon-PL',
+ 'k-omega-SST',
+ 'v2f-phi',
+ 'Rij-epsilon',
+ 'Rij-SSG'):
+ nodeList.append(nodeTurb.xmlGetNode('property', name='turb_viscosity'))
+
+ elif model in ('LES_Smagorinsky', 'LES_dynamique'):
+ nodeList.append(nodeTurb.xmlGetNode('property', name='smagorinsky_constant'))
+
+ return nodeList
+
+#FIXME: A METTRE en commentaire mais aussi getTurbVariable et getTurbProperty
+ def getTurbNodeList(self):
+ """
+ """
+ nodeList = []
+ for node in self.getTurbVariable(): nodeList.append(node)
+ for node in self.getTurbProperty(): nodeList.append(node)
+
+ return nodeList
+
+
+
+#-------------------------------------------------------------------------------
+# XMLmodel test case
+#-------------------------------------------------------------------------------
+
+class ModelTest(unittest.TestCase):
+ """
+ Class beginning class test case of all pages
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Toolbox.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ n = self.doc.parseString(string)
+ self.doc.xmlCleanAllBlank(n)
+ return self.doc.root()
+
+
+#-------------------------------------------------------------------------------
+# XMLmodel test case
+#-------------------------------------------------------------------------------
+
+
+class XMLmodelTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """
+ This method is executed before all "check" methods.
+ """
+ from Base.XMLengine import Case
+ from Base.XMLinitialize import XMLinit
+ Toolbox.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+
+ def tearDown(self):
+ """
+ This method is executed after all "check" methods.
+ """
+ del self.case
+
+ def checkXMLmodelInstantiation(self):
+ """
+ Check whether the Case class could be instantiated
+ """
+ xmldoc = None
+ xmldoc = XMLmodel(self.case)
+ assert xmldoc != None, 'Could not instantiate XMLmodel'
+
+## def checkGetThermalModel(self):
+## """
+## Check whether the thermal model could be get.
+## """
+## doc = XMLmodel(self.case)
+## node_coal = self.case.xmlGetNode('pulverized_coal', 'model')
+## node_coal['model'] = "toto"
+## nodeThermal, model = doc.getThermalModel()
+##
+## assert nodeThermal == node_coal, \
+## 'Could not use the getThermalModel method'
+## assert model == "toto", \
+## 'Could not use the getThermalModel method'
+
+## def checkGetThermoPhysicalModel(self):
+## """
+## Check whether the specific thermophysical model could be get.
+## """
+## doc = XMLmodel(self.case)
+## node_coal = self.case.xmlGetNode('pulverized_coal', 'model')
+## node_coal['model'] = "toto"
+## model = doc.getThermoPhysicalModel()
+##
+## assert model == node_coal.el.tagName, \
+## 'Could not use the getTermoPhysicalModel method'
+
+def suite():
+ testSuite = unittest.makeSuite(XMLmodelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "XMLmodelTestCase to be completed..."
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End of XMLmodel
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Base/XMLvariables.py b/gui/Base/XMLvariables.py
new file mode 100644
index 0000000..3d965a3
--- /dev/null
+++ b/gui/Base/XMLvariables.py
@@ -0,0 +1,704 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Variables class which creates the <variable>,
+<scalar> and <property> markups.
+
+This module contains the following classes and function:
+- Variables
+- VariablesTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import unittest
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from Common import *
+import Toolbox
+
+
+#-------------------------------------------------------------------------------
+# Class Model
+#-------------------------------------------------------------------------------
+
+
+class Model:
+ """
+ This class verifies int and float values mathematically
+ """
+ def isStr(self, string):
+ """This method verifies that the string type is str"""
+ if type(string) != str:
+ msg = "There is an error : " + str(string) + " is not a string\n"
+ raise ValueError, msg
+ return True
+
+
+ def isList(self, liste):
+ """This method verifies that list is not empty"""
+ if type(liste) != list:
+ msg = "There is an error: " + string.join(liste) + " is not a list\n"
+ raise ValueError, msg
+ return True
+
+
+ def isInt(self, ival):
+ """This method verifies that ival is a int value"""
+ if type(ival) != int:
+ msg = "There is an error: this value " + str(ival) + " is not an integer\n"
+ raise ValueError, msg
+ return True
+
+
+ def isPositiveInt(self, ival):
+ """This method verifies that ival is a int value > or = 0"""
+ if self.isInt(ival):
+ if ival < 0:
+ msg = "There is an error: this value " + str(ival) + " must not be negative\n"
+ raise ValueError, msg
+ return True
+
+
+# def isStrictPositiveInt(self, ival):
+# """This method verifies that ival is a int value > 0"""
+# if self.isInt(ival):
+# if ival <= 0:
+# msg = "There is an error: this value " + str(ival) + "\n"\
+# "must not be neither negative neither 0\n"
+# raise ValueError, msg
+# return True
+
+
+ def isIntEqual(self, ival1, ival2):
+ """This method verifies that val1 = val2"""
+ if self.isInt(ival1) and self.isInt(ival2):
+ if ival1 != ival2:
+ msg = "There is an error: this value " + str(ival1) + "\n"\
+ "must be equal to " + str(ival2) + "\n"
+ raise ValueError, msg
+ return True
+
+## def isStrictBetweenInt(self, ival, imin, imax):
+## """This method verifies that ival is in imin and imax"""
+## if self.isInt(ival):
+## if ival <= imin or ival >= imax:
+## msg = "There is an error: this value " + str(ival) + "\n"\
+## "must be strictly between " + str(imin) + "and" + str(imax) + "\n"
+## raise ValueError, msg
+## return True
+##
+##
+## def isBetweenInt(self, ival, imin, imax):
+## """This method verifies that ival is in imin and imax"""
+## if self.isInt(ival):
+## if ival < imin or ival > imax:
+## msg = "There is an error: this value " + str(ival) + "\n"\
+## "must be between " + str(imin) + "and" + str(imax) + "\n"
+## raise ValueError, msg
+## return True
+
+
+ def isIntInList(self, ival, list):
+ """This method verifies that ival is in list"""
+ if self.isInt(ival) and self.isList(list):
+ if ival not in list:
+ msg = "There is an error: this value " + str(ival) + "\n"\
+ "is not in list " + list + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isFloat(self, val):
+ """This method verifies that val is a float value > 0"""
+ if type(val) != float and type(val) != int:
+ msg = "There is an error: this value " + str(val) + " is not a float value\n"
+ raise ValueError, msg
+ return True
+
+
+ def isPositiveFloat(self, val):
+ """This method verifies that val is a float value > or = 0"""
+ if self.isFloat(val):
+ if val < 0:
+ msg = "There is an error: this value " + str(val) + " must not be negative\n"
+ raise ValueError, msg
+ return True
+
+
+ def isStrictPositiveFloat(self, val):
+ """This method verifies that val is a float value > 0"""
+ if self.isFloat(val):
+ if val <= 0:
+ msg = "There is an error: this value " + str(val) + "\n"\
+ "must not be neither negative neither 0\n"
+ raise ValueError, msg
+ return True
+
+
+ def isFloatEqual(self, val1, val2):
+ """This method verifies that val1 = val2"""
+ if self.isFloat(val1) and self.isFloat(val2):
+ if val1 > (val2 + 1e-6) or val1 < (val2 - 1e-6):
+ msg = "There is an error: this value " + str(val1) + "\n"\
+ "must be equal to " + str(val2) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isGreater(self, val, min):
+ """This method verifies that val > min"""
+ if self.isFloat(val):
+ if val <= min:
+ msg = "There is an error: this value " + str(val) + "\n"\
+ "must be greater than " + str(min) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isGreaterOrEqual(self, val, min):
+ """This method verifies that val >= min"""
+ if self.isFloat(val):
+ if val < min:
+ msg = "There is an error: this value " + str(val) + "\n"\
+ "must be greater or equal than " + str(min) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isLower(self, val, max):
+ """This method verifies that val < max"""
+ if self.isFloat(val):
+ if val >= max:
+ msg = "There is an error: this value " + str(val) + "\n"\
+ "must be lower than " + str(max) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isLowerOrEqual(self, val, max):
+ """This method verifies that val <= max"""
+ if self.isFloat(val):
+ if val > max:
+ msg = "There is an error: this value " + str(val) + "\n"\
+ "must be lower or equal than " + str(max) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isFloatInList(self, val, list):
+ """This method verifies that val is in list"""
+ if self.isFloat(val):
+ if val not in list:
+ msg = "There is an error: this float value " + str(val) + "\n"\
+ "is not in list " + str(list) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isInList(self, val, list):
+ """This method verifies that val is in list"""
+ if val not in list:
+ msg = "There is an error: this value " + str(val) + "\n"\
+ "is not in list " + str(list) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isNotInList(self, val, list):
+ """This method verifies that val is not in list"""
+ if val in list:
+ msg = "There is an error: this value " + str(val) + "\n"\
+ "should be not in list " + str(list) + "\n"
+ raise ValueError, msg
+ return True
+
+
+ def isOnOff(self, status):
+ """This method verifies that status is on or off"""
+ if status not in ['on', 'off']:
+ msg = "There is an error: this status " + str(status) + "\n"\
+ "is not in list " + str(list) + "\n"
+ raise ValueError, msg
+ return True
+
+
+#-------------------------------------------------------------------------------
+# class Variables : creates <variable>, <scalar> and <property> markups.
+#-------------------------------------------------------------------------------
+
+
+class Variables:
+ """
+ This class creates <variable>, <scalar> and <property> markups.
+ Each new markup has a 'name' and a 'label' attribute.
+ Each new markup has <listing_printing status='on'>,
+ <postprocessing_recording status='on'> and several
+ <probe_recording name="XX"> (if any <probe> exists) as child markups.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+
+## def defaultInitialValues(self):
+## """
+## Return in a dictionnary which contains default values.
+## """
+## default = {}
+## #Initial values for thermal scalar: 20 deg C air at atmospheric pressure.
+## default['temperature_celsius'] = 20.0
+## default['temperature_kelvin'] = 293.15
+## default['enthalpy'] = 297413.
+##
+## #Initial values for properties: 20 degC air at atmospheric pressure.
+## default['density'] = 1.17862
+## default['molecular_viscosity'] = 1.83e-05
+## default['diffusion_coefficient'] = 1.83e-05
+## default['specific_heat'] = 1017.24
+## default['thermal_conductivity'] = 0.02495
+##
+## return default
+
+
+## def setOutputControl(self, variable):
+## """
+## Update the output markups <probe_recording name="XX">,
+## <postprocessing_recording status='on'> and
+## <listing_printing status='on'> for the new 'variable' markup.
+## """
+## analysis_ctrl = self.case.xmlGetNode('analysis_control')
+## node_output = analysis_ctrl.xmlInitNode('output')
+## for node in node_output.xmlGetNodeList('probe', 'name'):
+## num = node['name']
+## variable.xmlInitChildNode('probe_recording', name=num)
+
+## variable.xmlInitChildNode('listing_printing', status='on')
+## variable.xmlInitChildNode('postprocessing_recording', status='on')
+
+
+ def updateLabel(self, vv):
+ """
+ """
+ if not vv['label']:
+ vv['label'] = Toolbox.dicoLabel(vv['name'])
+
+
+ def setNewTurbulenceVariable(self, node, tag):
+ """
+ Input a new <variable name="my_variable" label="ma_variable">
+ in the xmldoc.
+ """
+ if not node.xmlGetNode('variable', name=tag):
+ n = node.xmlInitNode('variable', name=tag)
+## n.xmlSetData('blending_factor', 0)
+## n.xmlInitNode('order_scheme', choice='upwind')
+
+ self.updateLabel(n)
+
+
+ def setNewVariable(self, node, tag):
+ """
+ Input a new <variable name="my_variable" label="ma_variable">
+ in the xmldoc.
+ """
+ if not node.xmlGetNode('variable', name=tag):
+ v1 = node.xmlInitNode('variable', name=tag)
+ self.updateLabel(v1)
+
+
+## def setNewThermalScalar(self, node, tag, zone):
+## """
+## Input a child node
+## <scalar name="my_variable" label="ma_variable" type="thermal">
+## to the argument node. Initial values are for air at
+## atmospheric pressure.
+## """
+## if not node.xmlGetNode('scalar', type='thermal', name=tag):
+## s1 = node.xmlInitNode('scalar', type='thermal', name=tag)
+## s1.xmlInitChildNode('initial_value', zone=zone)
+## if tag == "temperature_celsius":
+## s1.xmlSetData('initial_value', self.defaultInitialValues()[tag])
+## elif tag == "temperature_kelvin":
+## s1.xmlSetData('initial_value', self.defaultInitialValues()[tag])
+## elif tag == "enthalpy":
+## s1.xmlSetData('initial_value', self.defaultInitialValues()[tag])
+## else:
+## print "Error in setNewThermalScalar:"
+## print "the given tag is %s" % (tag)
+## exit(0)
+##
+## s1.xmlSetData('min_value', SMGRAND)
+## s1.xmlSetData('max_value', SPGRAND)
+##
+#### self.setOutputControl(s1)
+## self.updateLabel(s1)
+
+
+ def setNewModelScalar(self, node, tag):
+ """
+ Input a new <scalar label="ma_variable" type="model">
+ in the xmldoc.
+ """
+ if not node.xmlGetNodeList('scalar', type="model", name=tag, label=tag):
+ s1 = node.xmlInitNode('scalar', type="model", name=tag, label=tag)
+## self.setOutputControl(s1)
+ self.updateLabel(s1)
+ else:
+ s1 = node.xmlGetNode('scalar', type="model", name=tag, label=tag )
+
+ return s1
+
+##
+## def deleteAllModelScalars(self, node):
+## """
+## Input a new <scalar label="ma_variable" type="model">
+## in the xmldoc.
+## """
+## nodeList = node.xmlGetNodeList('scalar')
+## if nodeList != None:
+## for node in nodeList :
+## node.xmlRemoveNode()
+##
+
+## def setWeightMatrixComponents(self, event=None):
+## """
+## Input a new <scalar label="ma_variable" type="user">
+## in the xmldoc.
+## """
+## node_np = self.case.xmlInitNode('numerical_parameters')
+## node_ipucou = node_np.xmlInitNode('velocity_pressure_coupling')
+##
+## node_Tx = node_ipucou.xmlInitNode('variable', name='weight_matrix_X')
+## node_Ty = node_ipucou.xmlInitNode('variable', name='weight_matrix_Y')
+## node_Tz = node_ipucou.xmlInitNode('variable', name='weight_matrix_Z')
+##
+## for (node, val) in [(node_Tx, 'weight_matrix_X'),
+## (node_Ty, 'weight_matrix_Y'),
+## (node_Tz, 'weight_matrix_Z')]:
+## self.setOutputControl(node)
+## if not node['label']: node['label'] = Toolbox.dicoLabel(val)
+
+## def deleteAllModelProperties(self, modelNode):
+## """
+## Input a new <scalar label="ma_variable" type="model">
+## in the xmldoc.
+## """
+## nodeList = modelNode.xmlGetNodeList('property')
+## if nodeList != None:
+## for node in nodeList :
+## node.xmlRemoveNode()
+
+
+ def setNewProperty(self, node, tag):
+ """
+ Input a new <property name="my_property" label="ma_propriete">
+ in the xmldoc.
+ """
+ if not node.xmlGetNode('property', name=tag):
+ p1 = node.xmlInitNode('property', name=tag)
+## self.setOutputControl(p1)
+ try :
+ self.updateLabel(p1)
+ except:
+ pass
+ if not p1['label']: p1['label'] = tag
+
+ else:
+ p1 = node.xmlGetNode('property', name=tag)
+
+ return p1
+
+ def setNewFluidProperty(self, node, tag, label=None):
+ """
+ Input a new <property name="my_property" label="ma_propriete", choice="constant">
+ in the xmldoc.
+ """
+ if not node.xmlGetNode('property', name=tag):
+ p1 = node.xmlInitNode('property', name=tag, choice='constant')
+## if tag == "density":
+## value = self.defaultInitialValues()[tag]
+## elif tag == "molecular_viscosity" or tag == "diffusion_coefficient":
+## value = self.defaultInitialValues()[tag]
+## elif tag == "specific_heat":
+## value = self.defaultInitialValues()[tag]
+## elif tag == "thermal_conductivity":
+## value = self.defaultInitialValues()[tag]
+## else:
+## print "Error in setNewFluidProperty:"
+## print "the given tag is %s" % (tag)
+## exit(0)
+
+## p1.xmlSetData('initial_value', value)
+## self.setOutputControl(p1)
+ p1.xmlInitChildNode('listing_printing')['status'] = "off"
+ p1.xmlInitChildNode('postprocessing_recording')['status'] = "off"
+
+ if label:
+ p1['label'] = label
+ else:
+ self.updateLabel(p1)
+
+ else:
+ p1 = node.xmlGetNode('property', name=tag)
+
+ return p1
+
+
+#-------------------------------------------------------------------------------
+# MODEL test case
+#-------------------------------------------------------------------------------
+
+
+class ModelTestCase(unittest.TestCase):
+ def checkIsInt(self):
+ """ Check whether the Model class could be verify value is integer """
+ ival = 3
+ xval = 5.2
+ assert Model().isInt(ival),'Should be an integer value'
+
+
+ def checkIsPositiveInt(self):
+ """Check whether the Model class could be verify value is a int value > or = 0"""
+ ival = 3
+ assert Model().isPositiveInt(ival) == True,\
+ 'Should be a positive integer value'
+
+
+# def checkIsStrictPositiveInt(self):
+# """Check whether the Model class could be verify value is a int value > or = 0"""
+# ival = 3
+# assert Model().isStrictPositiveInt(ival) == True,\
+# 'Should be a strict positive integer value'
+
+
+## def checkIsIntbetween(self):
+## """Check whether the Model class could be verify value is between min-max"""
+## ival = 3
+## imin = 1
+## imax = 10
+## assert Model().isBetweenInt(ival, imin, imax) == True,\
+## 'Could not verify value is between min and max integer values'
+## assert Model().isStrictBetweenInt(ival, imin, imax) == True,\
+## 'Could not verify value is strictly between min and max integer values'
+
+ def checkIsIntInList(self):
+ """Check whether the Model class could be verify value is in list"""
+ ival = 3
+ list = ['toto', 3.4, 3, "machin"]
+ assert Model().isIntInList(ival, list) == True,\
+ 'Could not verify value is in list '
+
+
+ def checkIsFloat(self):
+ """ Check whether the Model class could be verify value is float """
+ ival = 3
+ xval = 5.2
+ assert Model().isFloat(xval) == True,'Should be a float value'
+
+
+ def checkIsPositiveFloat(self):
+ """Check whether the Model class could be verify value is a float value > or = 0"""
+ val = 3.5
+ assert Model().isPositiveFloat(val) == True,\
+ 'Should be a positive float value'
+
+
+ def checkIsStrictPositiveFloat(self):
+ """Check whether the Model class could be verify value is a float value > or = 0"""
+ val = 3.5
+ assert Model().isStrictPositiveFloat(val) == True,\
+ 'Should be a strict positive float value'
+
+
+ def checkIsFloatInList(self):
+ """Check whether the Model class could be verify value is in list"""
+ val = 3.4
+ list = ['toto', 3.4, 3, "machin"]
+ assert Model().isFloatInList(val, list) ==True ,\
+ 'Could not verify value is in list '
+
+
+ def checkIsList(self):
+ """Check whether the Model class could be verify value is not empty"""
+ list = ['toto', 3.4, 3, "machin"]
+ assert Model().isList(list) == True, 'Should be a list'
+
+
+ def checkIsInList(self):
+ """Check whether the Model class could be verify value is in list"""
+ list = ['toto', 3.4, 3, "machin"]
+ assert Model().isInList('toto', list) == True, 'Should be in a list'
+
+
+def suite1():
+ testSuite = unittest.makeSuite(ModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "ModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite1())
+## runner.run(suite2())
+
+#-------------------------------------------------------------------------------
+# Variables test case
+#-------------------------------------------------------------------------------
+
+
+##class VariablesTestCase(unittest.TestCase):
+## """
+## """
+## def setUp(self):
+## """This method is executed before all "check" methods."""
+## import XMLengine
+## self.doc = XMLengine.XMLDocument("")
+## self.case = self.doc.parseString('<?xml version="1.0" ?>'\
+## '<Code_Saturne_GUI/>')
+## self.case.root().xmlAddChild('analysis_control')
+##
+## def tearDown(self):
+## """This method is executed after all "check" methods."""
+## del self.case
+##
+## def xmlNodeFromString(self, string):
+## """Private method to return a xml node from string"""
+## return self.doc.parseString(string).root()
+##
+## def checkVariablesInstantiation(self):
+## """ Check whether the Variable class could be instantiated """
+## doc = None
+## doc = Variables(self.case)
+## assert doc != None, 'Could not instantiate Variables'
+##
+## def checkSetOutputControl(self):
+## """ Check whether the <probe_recording name="XX">,
+## <postprocessing_recording status='on'> and
+## <listing_printing status='on'> markups could be set. """
+## node = self.case.root().xmlAddChild('variable')
+## Variables(self.case).setOutputControl(node)
+## doc = '<variable/>'
+## assert node == self.xmlNodeFromString(doc),\
+## 'Could not set the output control markups'
+##
+## def checkSetNewVariable(self):
+## """ Check whether a new
+## <variable name="my_variable" label="ma_variable">
+## in the xmldoc could bet set. """
+## root = self.case.root()
+## Variables(self.case).setNewVariable(root, 'pressure')
+## node = root.xmlGetChildNode('variable')
+## node['label'] = "toto"
+## doc = '<variable label="toto" name="pressure"/>'
+## assert node == self.xmlNodeFromString(doc),\
+## 'Could not set the variable markup'
+##
+## def checkSetNewThermalScalar(self):
+## """ Check whether a new
+## <scalar name="my_variable" label="ma_variable" type="">
+## in the xmldoc could bet set. """
+## root = self.case.root()
+## Variables(self.case).setNewThermalScalar(root, 'temperature_celsius', "0")
+## node = root.xmlGetChildNode('scalar')
+## node['label'] = "toto"
+## doc = '<scalar label="toto" name="temperature_celsius" type="thermal">'\
+## '<initial_value zone="0">20</initial_value>'\
+## '<min_value>-1e+12</min_value>'\
+## '<max_value>1e+12</max_value>'\
+## '</scalar>'
+## assert node == self.xmlNodeFromString(doc),\
+## 'Could not set the thermal scalar markups'
+##
+## def checkSetNewUserScalar(self):
+## """
+## Check whether a new <scalar label="ma_variable" type="user">
+## in the xmldoc could bet set.
+## """
+## root = self.case.root()
+## Variables(self.case).setNewUserScalar(root, 'scalar1')
+## node = root.xmlGetChildNode('scalar')
+## doc = '<scalar label="scalar1" type="user"/>'
+## assert node == self.xmlNodeFromString(doc),\
+## 'Could not set the user scalar markups'
+##
+## def checkSetNewProperty(self):
+## """
+## Check whether a new
+## <property name="my_property" label="ma_propriete">
+## in the xmldoc could bet set.
+## """
+## root = self.case.root()
+## Variables(self.case).setNewProperty(root, 'prop')
+## node = root.xmlGetChildNode('property')
+## truc = node.toString()
+## doc = '<property label="prop" name="prop"/>'
+## assert node == self.xmlNodeFromString(doc),\
+## 'Could not set the property markups'
+##
+## def checkSetNewFluidProperty(self):
+## """
+## Check whether a new
+## <property name="my_property" label="ma_propriete" choice="constant">
+## in the xmldoc could bet set.
+## """
+## root = self.case.root()
+## Variables(self.case).setNewFluidProperty(root, 'density')
+## node = root.xmlGetChildNode('property')
+## node['label'] = "toto"
+## doc = '<property choice="constant" label="toto" name="density">'\
+## '<listing_printing status="off"/>'\
+## '<postprocessing_recording status="off"/>'\
+## '</property>'
+## assert node == self.xmlNodeFromString(doc),\
+## 'Could not set the fluid property markups'
+##
+##def suite():
+## testSuite = unittest.makeSuite(VariablesTestCase, "check")
+## return testSuite
+##
+##def runTest():
+## print "VariablesTestCase"
+## runner = unittest.TextTestRunner()
+## runner.run(suite())
+##
+
+#-------------------------------------------------------------------------------
+# End of XMLvariables
+#-------------------------------------------------------------------------------
diff --git a/gui/Base/__init__.py b/gui/Base/__init__.py
new file mode 100644
index 0000000..0ba72c0
--- /dev/null
+++ b/gui/Base/__init__.py
@@ -0,0 +1,48 @@
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+This file makes this directory Base a Python package.
+ ====
+"""
+
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Base/icons/22x22/application-certificate.png b/gui/Base/icons/22x22/application-certificate.png
new file mode 100644
index 0000000..9657b43
Binary files /dev/null and b/gui/Base/icons/22x22/application-certificate.png differ
diff --git a/gui/Base/icons/22x22/document-new.png b/gui/Base/icons/22x22/document-new.png
new file mode 100644
index 0000000..e3808a1
Binary files /dev/null and b/gui/Base/icons/22x22/document-new.png differ
diff --git a/gui/Base/icons/22x22/document-open.png b/gui/Base/icons/22x22/document-open.png
new file mode 100644
index 0000000..7c4ee79
Binary files /dev/null and b/gui/Base/icons/22x22/document-open.png differ
diff --git a/gui/Base/icons/22x22/document-properties.png b/gui/Base/icons/22x22/document-properties.png
new file mode 100644
index 0000000..a5ad728
Binary files /dev/null and b/gui/Base/icons/22x22/document-properties.png differ
diff --git a/gui/Base/icons/22x22/document-save-as.png b/gui/Base/icons/22x22/document-save-as.png
new file mode 100644
index 0000000..340a87e
Binary files /dev/null and b/gui/Base/icons/22x22/document-save-as.png differ
diff --git a/gui/Base/icons/22x22/document-save.png b/gui/Base/icons/22x22/document-save.png
new file mode 100644
index 0000000..a94e0ea
Binary files /dev/null and b/gui/Base/icons/22x22/document-save.png differ
diff --git a/gui/Base/icons/22x22/format-justify-fill.png b/gui/Base/icons/22x22/format-justify-fill.png
new file mode 100644
index 0000000..0ce4013
Binary files /dev/null and b/gui/Base/icons/22x22/format-justify-fill.png differ
diff --git a/gui/Base/icons/22x22/help-browser.png b/gui/Base/icons/22x22/help-browser.png
new file mode 100644
index 0000000..c67c7a6
Binary files /dev/null and b/gui/Base/icons/22x22/help-browser.png differ
diff --git a/gui/Base/icons/22x22/preferences-desktop-font.png b/gui/Base/icons/22x22/preferences-desktop-font.png
new file mode 100644
index 0000000..d452db7
Binary files /dev/null and b/gui/Base/icons/22x22/preferences-desktop-font.png differ
diff --git a/gui/Base/icons/22x22/preferences-desktop-wallpaper.png b/gui/Base/icons/22x22/preferences-desktop-wallpaper.png
new file mode 100644
index 0000000..3389e55
Binary files /dev/null and b/gui/Base/icons/22x22/preferences-desktop-wallpaper.png differ
diff --git a/gui/Base/icons/22x22/process-stop.png b/gui/Base/icons/22x22/process-stop.png
new file mode 100644
index 0000000..b68290b
Binary files /dev/null and b/gui/Base/icons/22x22/process-stop.png differ
diff --git a/gui/Base/icons/22x22/system-log-out.png b/gui/Base/icons/22x22/system-log-out.png
new file mode 100644
index 0000000..28ac66f
Binary files /dev/null and b/gui/Base/icons/22x22/system-log-out.png differ
diff --git a/gui/Base/icons/22x22/utilities-terminal.png b/gui/Base/icons/22x22/utilities-terminal.png
new file mode 100644
index 0000000..ceb0fb9
Binary files /dev/null and b/gui/Base/icons/22x22/utilities-terminal.png differ
diff --git a/gui/Base/icons/22x22/view-refresh.png b/gui/Base/icons/22x22/view-refresh.png
new file mode 100644
index 0000000..cab4d02
Binary files /dev/null and b/gui/Base/icons/22x22/view-refresh.png differ
diff --git a/gui/Base/icons/22x22/x-office-address-book.png b/gui/Base/icons/22x22/x-office-address-book.png
new file mode 100644
index 0000000..2e519ce
Binary files /dev/null and b/gui/Base/icons/22x22/x-office-address-book.png differ
diff --git a/gui/Base/icons/LICENSE.Tango b/gui/Base/icons/LICENSE.Tango
new file mode 100644
index 0000000..5200927
--- /dev/null
+++ b/gui/Base/icons/LICENSE.Tango
@@ -0,0 +1,97 @@
+Tango Icon Theme
+----------------
+
+This is an icon theme that follows the Tango visual guidelines [1]. Currently
+it depends on Imagemagick for creation of 24x24 bitmaps by adding a 1px padding
+around the 22x22px version. For GNOME and KDE you will also need
+icon-naming-utils that allow the theme to work in these environments before
+they follow the new naming scheme [2].
+
+
+[1] http://tango-project.org/Tango_Icon_Theme_Guidelines
+[2] http://tango-project.org/Standard_Icon_Naming_Specification
+
+Authors
+-------
+
+Ulisse Perusin <uli.peru at gmail.com>
+Steven Garrity <sgarrity at silverorange.com>
+Lapo Calamandrei <calamandrei at gmail.com>
+Ryan Collier <rcollier at novell.com>
+Rodney Dawes <dobey at novell.com>
+Andreas Nilsson <nisses.mail at home.se>
+Tuomas Kuosmanen <tigert at tigert.com>
+Garrett LeSage <garrett at novell.com>
+Jakub Steiner <jimmac at novell.com>
+
+
+Copying
+-------
+
+Creative Commons Attribution-ShareAlike 2.5 License Agreement
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+ 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+ 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of d [...]
+ 3. "Licensor" means the individual or entity that offers the Work under the terms of this License.
+ 4. "Original Author" means the individual or entity who created the Work.
+ 5. "Work" means the copyrightable work of authorship offered under the terms of this License.
+ 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+ 7. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
+
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+ 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+ 2. to create and reproduce Derivative Works;
+ 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+ 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+ 5.
+
+ For the avoidance of doubt, where the work is a musical composition:
+ 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+ 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+ 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+ 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights g [...]
+ 2. You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sent [...]
+ 3. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for a [...]
+
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSIO [...]
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+ 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+ 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this Lic [...]
+
+8. Miscellaneous
+
+ 1. Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+ 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+ 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+ 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+ 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all right [...]
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
diff --git a/gui/Base/icons/SplashScreen/logocs.png b/gui/Base/icons/SplashScreen/logocs.png
new file mode 100644
index 0000000..d47a4f9
Binary files /dev/null and b/gui/Base/icons/SplashScreen/logocs.png differ
diff --git a/gui/Base/resource_base.qrc b/gui/Base/resource_base.qrc
new file mode 100644
index 0000000..6c9ccbd
--- /dev/null
+++ b/gui/Base/resource_base.qrc
@@ -0,0 +1,18 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>icons/22x22/document-new.png</file>
+ <file>icons/22x22/document-open.png</file>
+ <file>icons/22x22/document-properties.png</file>
+ <file>icons/22x22/document-save-as.png</file>
+ <file>icons/22x22/document-save.png</file>
+ <file>icons/22x22/format-justify-fill.png</file>
+ <file>icons/22x22/preferences-desktop-font.png</file>
+ <file>icons/22x22/preferences-desktop-wallpaper.png</file>
+ <file>icons/22x22/process-stop.png</file>
+ <file>icons/22x22/system-log-out.png</file>
+ <file>icons/22x22/utilities-terminal.png</file>
+ <file>icons/22x22/application-certificate.png</file>
+ <file>icons/22x22/x-office-address-book.png</file>
+ <file>icons/22x22/help-browser.png</file>
+ </qresource>
+</RCC>
diff --git a/gui/Makefile.am b/gui/Makefile.am
new file mode 100644
index 0000000..fae1c36
--- /dev/null
+++ b/gui/Makefile.am
@@ -0,0 +1,35 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+SUBDIRS = Base Pages
+
+# Install Python library
+
+dist_pkgpython_PYTHON = \
+__init__.py \
+cs_gui.py
+
+# Install data
+
+nobase_pkgpython_DATA = \
+$(srcdir)/Base/icons/SplashScreen/logocs.png \
+VERSION
diff --git a/gui/Makefile.in b/gui/Makefile.in
new file mode 100644
index 0000000..228887a
--- /dev/null
+++ b/gui/Makefile.in
@@ -0,0 +1,679 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = gui
+DIST_COMMON = $(dist_pkgpython_PYTHON) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in AUTHORS
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgpythondir)" \
+ "$(DESTDIR)$(pkgpythondir)"
+dist_pkgpythonPYTHON_INSTALL = $(INSTALL_DATA)
+py_compile = $(top_srcdir)/config/py-compile
+nobase_pkgpythonDATA_INSTALL = $(install_sh_DATA)
+DATA = $(nobase_pkgpython_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = Base Pages
+
+# Install Python library
+dist_pkgpython_PYTHON = \
+__init__.py \
+cs_gui.py
+
+
+# Install data
+nobase_pkgpython_DATA = \
+$(srcdir)/Base/icons/SplashScreen/logocs.png \
+VERSION
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu gui/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-dist_pkgpythonPYTHON: $(dist_pkgpython_PYTHON)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgpythondir)" || $(MKDIR_P) "$(DESTDIR)$(pkgpythondir)"
+ @list='$(dist_pkgpython_PYTHON)'; dlist=''; for p in $$list; do\
+ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
+ if test -f $$b$$p; then \
+ f=$(am__strip_dir) \
+ dlist="$$dlist $$f"; \
+ echo " $(dist_pkgpythonPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(pkgpythondir)/$$f'"; \
+ $(dist_pkgpythonPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(pkgpythondir)/$$f"; \
+ else :; fi; \
+ done; \
+ if test -n "$$dlist"; then \
+ if test -z "$(DESTDIR)"; then \
+ PYTHON=$(PYTHON) $(py_compile) --basedir "$(pkgpythondir)" $$dlist; \
+ else \
+ PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pkgpythondir)" $$dlist; \
+ fi; \
+ else :; fi
+
+uninstall-dist_pkgpythonPYTHON:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_pkgpython_PYTHON)'; dlist=''; for p in $$list; do\
+ f=$(am__strip_dir) \
+ rm -f "$(DESTDIR)$(pkgpythondir)/$$f"; \
+ rm -f "$(DESTDIR)$(pkgpythondir)/$${f}c"; \
+ rm -f "$(DESTDIR)$(pkgpythondir)/$${f}o"; \
+ done
+install-nobase_pkgpythonDATA: $(nobase_pkgpython_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgpythondir)" || $(MKDIR_P) "$(DESTDIR)$(pkgpythondir)"
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_pkgpython_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ $(am__vpath_adj) \
+ echo " $(nobase_pkgpythonDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgpythondir)/$$f'"; \
+ $(nobase_pkgpythonDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgpythondir)/$$f"; \
+ done
+
+uninstall-nobase_pkgpythonDATA:
+ @$(NORMAL_UNINSTALL)
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_pkgpython_DATA)'; for p in $$list; do \
+ $(am__vpath_adj) \
+ echo " rm -f '$(DESTDIR)$(pkgpythondir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgpythondir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(pkgpythondir)" "$(DESTDIR)$(pkgpythondir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-dist_pkgpythonPYTHON \
+ install-nobase_pkgpythonDATA
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-dist_pkgpythonPYTHON \
+ uninstall-nobase_pkgpythonDATA
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dist_pkgpythonPYTHON install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-nobase_pkgpythonDATA install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-dist_pkgpythonPYTHON \
+ uninstall-nobase_pkgpythonDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gui/Pages/AnalysisFeaturesForm.ui b/gui/Pages/AnalysisFeaturesForm.ui
new file mode 100644
index 0000000..8ec8ee2
--- /dev/null
+++ b/gui/Pages/AnalysisFeaturesForm.ui
@@ -0,0 +1,357 @@
+<ui version="4.0" >
+ <class>AnalysisFeaturesForm</class>
+ <widget class="QWidget" name="AnalysisFeaturesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>474</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxSteadyFlow" >
+ <property name="title" >
+ <string>Steady/Unsteady flow algorithm</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxSteadyFlow" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDTVAR</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the flow treatment</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxMultiphase" >
+ <property name="title" >
+ <string>Eulerian-Lagrangian multi-phase treatment</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxLagrangian" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IILAGR</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the flow treatment</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QGroupBox" name="Atmosphericflows" >
+ <property name="title" >
+ <string>Atmospheric flows</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxAtmospheric" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QGroupBox" name="groupBoxGasCombustion" >
+ <property name="title" >
+ <string>Gas combustion</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxGasCombustionModel" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPPMOD</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the combustion modelling</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QGroupBox" name="groupBoxCoalCombustion" >
+ <property name="title" >
+ <string>Pulverized coal combustion</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxPulverizedCoal" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPPMOD</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the combustion modelling</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QGroupBox" name="groupBoxElectricalModels" >
+ <property name="title" >
+ <string>Electrical models</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxJouleEffect" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPPMOD</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the electrical model</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/AnalysisFeaturesView.py b/gui/Pages/AnalysisFeaturesView.py
new file mode 100644
index 0000000..31cb6d7
--- /dev/null
+++ b/gui/Pages/AnalysisFeaturesView.py
@@ -0,0 +1,481 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Page in which the user defines the physical options
+of the treated case.
+
+This module contains the following class :
+- AnalysisFeaturesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from AnalysisFeaturesForm import Ui_AnalysisFeaturesForm
+
+import Base.QtPage as QtPage
+
+from TurbulenceModel import TurbulenceModel
+from ThermalScalarModel import ThermalScalarModel
+from LagrangianModel import LagrangianModel
+from GasCombustionModel import GasCombustionModel
+from CoalCombustionModel import CoalCombustionModel
+from ElectricalModelsModel import ElectricalModel
+from DefineUserScalarsModel import DefineUserScalarsModel
+from ThermalRadiationModel import ThermalRadiationModel
+from SteadyManagementModel import SteadyManagementModel
+from AtmosphericFlowsModel import AtmosphericFlowsModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("AnalysisFeaturesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Analysis Features View class
+#-------------------------------------------------------------------------------
+
+class AnalysisFeaturesView(QWidget, Ui_AnalysisFeaturesForm):
+ """
+ Class to open Calculation Features Page.
+ """
+ def __init__(self, parent, case, tree):
+ """
+ Constructor.
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_AnalysisFeaturesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.browser = tree
+
+ self.lagr = LagrangianModel(self.case)
+ self.turb = TurbulenceModel(self.case)
+ self.therm = ThermalScalarModel(self.case)
+ self.gas = GasCombustionModel(self.case)
+ self.pcoal = CoalCombustionModel(self.case)
+ self.elect = ElectricalModel(self.case)
+ self.scal = DefineUserScalarsModel(self.case)
+ self.std = SteadyManagementModel(self.case)
+ self.atmo = AtmosphericFlowsModel(self.case)
+
+ # Set models and number of elements for combo boxes
+
+ self.modelSteadyFlow = QtPage.ComboModel(self.comboBoxSteadyFlow,2,1)
+ self.modelLagrangian = QtPage.ComboModel(self.comboBoxLagrangian,2,1)
+ self.modelAtmospheric = QtPage.ComboModel(self.comboBoxAtmospheric,4,1)
+ self.modelGasCombustionModel = QtPage.ComboModel(self.comboBoxGasCombustionModel,3,1)
+ self.modelPulverizedCoal = QtPage.ComboModel(self.comboBoxPulverizedCoal,3,1)
+ self.modelJouleEffect = QtPage.ComboModel(self.comboBoxJouleEffect,3,1)
+
+ self.modelSteadyFlow.addItem(self.tr("steady flow"), "on")
+ self.modelSteadyFlow.addItem(self.tr("unsteady flow"), "off")
+
+ self.modelLagrangian.addItem(self.tr("single Phase Flow"), "single_phase")
+ self.modelLagrangian.addItem(self.tr("particles and droplets tracking"), "lagrangian")
+
+ self.modelAtmospheric.addItem(self.tr("off" ), "off")
+ self.modelAtmospheric.addItem(self.tr("constant density"), "constant")
+ self.modelAtmospheric.addItem(self.tr("dry atmosphere" ), "dry")
+ self.modelAtmospheric.addItem(self.tr("humid atmosphere"), "humid")
+
+ self.modelGasCombustionModel.addItem(self.tr("off"), "off")
+ self.modelGasCombustionModel.addItem(self.tr("premixed flame (Eddy Break-Up)"), "ebu")
+ self.modelGasCombustionModel.addItem(self.tr("equilibrium chemistry diffusion flame (Presumed PDF)"), "d3p")
+
+ self.modelPulverizedCoal.addItem(self.tr("off"), "off")
+ self.modelPulverizedCoal.addItem(self.tr("homogeneous approach"), "coal_homo")
+ self.modelPulverizedCoal.addItem(self.tr("homogeneous approach (wet)"), "coal_homo2")
+ # WARNING: the 'coal_lagr' model is deprecated
+ #self.modelPulverizedCoal.addItem(self.tr("Gaseous phase coupling with Lagrangian coal transport"), "coal_lagr")
+
+ self.modelJouleEffect.addItem(self.tr("off"), "off")
+ self.modelJouleEffect.addItem(self.tr("Joule Effect"), "joule")
+ self.modelJouleEffect.addItem(self.tr("Joule Effect and Lorentz Forces"), "arc")
+
+ # Connect signals to slots
+
+ self.connect(self.comboBoxSteadyFlow, SIGNAL("activated(const QString&)"), self.slotSteadyFlow)
+ self.connect(self.comboBoxLagrangian, SIGNAL("activated(const QString&)"), self.slotLagrangian)
+ self.connect(self.comboBoxAtmospheric, SIGNAL("activated(const QString&)"), self.slotAtmospheric)
+ self.connect(self.comboBoxGasCombustionModel, SIGNAL("activated(const QString&)"), self.slotGasCombustionModel)
+ self.connect(self.comboBoxPulverizedCoal, SIGNAL("activated(const QString&)"), self.slotPulverizedCoal)
+ self.connect(self.comboBoxJouleEffect, SIGNAL("activated(const QString&)"), self.slotJouleEffect)
+
+ # Initialize Widgets
+
+ val = self.std.getSteadyFlowManagement()
+ if val == 'on':
+ self.modelSteadyFlow.setItem(str_model='on')
+ self.modelLagrangian.disableItem(str_model='lagrangian')
+ else:
+ self.modelSteadyFlow.setItem(str_model='off')
+ self.modelLagrangian.enableItem(str_model='lagrangian')
+
+ val = self.lagr.getLagrangianStatus()
+ if val == 'off':
+ self.modelLagrangian.setItem(str_model='single_phase')
+ self.modelSteadyFlow.enableItem(str_model='on')
+ else:
+ self.modelLagrangian.setItem(str_model='lagrangian')
+ self.modelSteadyFlow.disableItem(str_model='on')
+
+ #self.modelLagrangian.disableItem(str_model='lagrangian')
+
+ val = self.atmo.getAtmosphericFlowsModel()
+ self.modelAtmospheric.setItem(str_model=val)
+
+ self.modelGasCombustionModel.setItem(str_model='off') # to delete
+ self.modelGasCombustionModel.disableItem(str_model='ebu') # to delete
+ self.modelGasCombustionModel.disableItem(str_model='d3p') # to delete
+ model = self.gas.getGasCombustionModel()
+ self.modelGasCombustionModel.setItem(str_model=model)
+
+ self.modelJouleEffect.setItem(str_model='off') # to delete
+ self.modelJouleEffect.disableItem(str_model='joule') # to delete
+ self.modelJouleEffect.disableItem(str_model='arc') # to delete
+ elec = self.elect.getElectricalModel()
+ self.modelJouleEffect.setItem(str_model=elec)
+
+ #self.modelPulverizedCoal.disableItem(str_model='coal_homo') # to delete
+ #self.modelPulverizedCoal.disableItem(str_model='coal_homo2') # to delete
+ coal = self.pcoal.getCoalCombustionModel()
+ self.modelPulverizedCoal.setItem(str_model=coal)
+
+ # Multi-phase flow and coal combustion
+ # WARNING: the 'coal_lagr' model is deprecated
+
+ #if self.lagr.getLagrangianStatus() == 'off':
+ # self.modelLagrangian.setItem(str_model='single_phase')
+ # self.modelPulverizedCoal.disableItem(str_model='coal_lagr')
+ #else:
+ # self.modelLagrangian.setItem(str_model='lagrangian')
+ # self.modelPulverizedCoal.enableItem(str_model='coal_lagr')
+
+ #if self.pcoal.getCoalCombustionModel() == 'coal_lagr':
+ # self.modelLagrangian.setItem(str_model='lagrangian')
+ # self.modelLagrangian.disableItem(str_model='single_phase')
+
+ # Compatibility between turbulence model and multi-phases flow model
+
+ if self.turb.getTurbulenceModel() not in \
+ ('off', 'k-epsilon', 'k-epsilon-PL',
+ 'Rij-epsilon', 'Rij-SSG', 'v2f-phi', 'k-omega-SST'):
+ self.modelLagrangian.setItem(str_model='single_phase')
+ self.comboBoxLagrangian.setEnabled(False)
+
+ # Compatibility between turbulence model and reactive flow models
+
+ if self.turb.getTurbulenceModel() not in ('k-epsilon',
+ 'k-epsilon-PL',
+ 'Rij-epsilon',
+ 'Rij-SSG',
+ 'v2f-phi',
+ 'k-omega-SST'):
+
+ self.modelGasCombustionModel.setItem(str_model='off')
+ self.modelPulverizedCoal.setItem(str_model='off')
+ self.modelJouleEffect.setItem(str_model='off')
+
+ self.modelGasCombustionModel.disableItem(str_model='ebu')
+ self.modelGasCombustionModel.disableItem(str_model='d3p')
+
+ self.modelJouleEffect.disableItem(str_model='joule')
+ self.modelJouleEffect.disableItem(str_model='arc')
+
+ self.modelPulverizedCoal.disableItem(str_model='coal_homo')
+ self.modelPulverizedCoal.disableItem(str_model='coal_homo2')
+ # WARNING: the 'coal_lagr' model is deprecated
+ #self.modelPulverizedCoal.disableItem(str_model='coal_lagr')
+
+ self.comboBoxGasCombustionModel.setEnabled(False)
+ self.comboBoxPulverizedCoal.setEnabled(False)
+ self.comboBoxJouleEffect.setEnabled(False)
+
+ # Update the QComboBox
+
+ flame = self.gas.getGasCombustionModel()
+ coal = self.pcoal.getCoalCombustionModel()
+ joule = self.elect.getElectricalModel()
+ atmospheric = self.atmo.getAtmosphericFlowsModel()
+
+ self.modelGasCombustionModel.setItem(str_model=flame)
+ self.modelPulverizedCoal.setItem(str_model=coal)
+ self.modelJouleEffect.setItem(str_model=joule)
+ self.modelAtmospheric.setItem(str_model=atmospheric)
+
+ # If one model is turned on, the others are turned off
+
+ if (flame, coal, joule, atmospheric) != ('off', 'off', 'off', 'off'):
+
+ if flame == 'off':
+ self.comboBoxGasCombustionModel.setEnabled(False)
+
+ if coal == 'off':
+ self.comboBoxPulverizedCoal.setEnabled(False)
+
+ if joule == 'off':
+ self.comboBoxJouleEffect.setEnabled(False)
+
+ if atmospheric == 'off':
+ self.comboBoxAtmospheric.setEnabled(False)
+
+ # Update the Tree files and folders
+
+ self.browser.configureTree(self.case)
+
+
+ def __activateComboBox(self):
+ """
+ Private Method.
+ Change to NORMAL the state of the reactive flow OptionMenu buttons.
+ """
+ self.comboBoxSteadyFlow.setEnabled(True)
+ #self.comboBoxLagrangian.setEnabled(True)
+ self.comboBoxGasCombustionModel.setEnabled(True)
+ self.comboBoxPulverizedCoal.setEnabled(True)
+ self.comboBoxJouleEffect.setEnabled(True)
+ self.comboBoxAtmospheric.setEnabled(True)
+
+
+ def __disableComboBox(self):
+ """
+ Private Method.
+ Change to DISABLED the state of the reactive flow OptionMenu buttons.
+ """
+ self.comboBoxSteadyFlow.setEnabled(False)
+ #self.comboBoxLagrangian.setEnabled(False)
+ self.comboBoxGasCombustionModel.setEnabled(False)
+ self.comboBoxPulverizedCoal.setEnabled(False)
+ self.comboBoxJouleEffect.setEnabled(False)
+ self.comboBoxAtmospheric.setEnabled(False)
+
+
+ def __stringModelFromCombo(self, name):
+ """
+ Private Method.
+ Method to get the current item from a QComboBox and returns
+ the correct string for the model
+ """
+ if not name in ['SteadyFlow',
+ 'Lagrangian',
+ 'Atmospheric',
+ 'GasCombustionModel',
+ 'PulverizedCoal',
+ 'JouleEffect']:
+ log.debug("__stringModelFromCombo() Incorrect name for QComboBox name")
+ string = ""
+ else:
+ combo = eval('self.comboBox' + name)
+ dico = eval('self.model' + name + '.dicoV2M')
+ string = dico[str(combo.currentText())]
+
+ return string
+
+
+ @pyqtSignature("const QString&")
+ def slotSteadyFlow(self, text):
+ """
+ Private slot.
+ Configure tree and update xmlfile beyond the steady or unsteady flow type.
+ """
+ log.debug("slotSteadyFlow")
+ steady = self.__stringModelFromCombo('SteadyFlow')
+
+ if steady == 'on':
+ self.modelLagrangian.disableItem(str_model='lagrangian')
+ else:
+ self.modelLagrangian.enableItem(str_model='lagrangian')
+
+ self.std.setSteadyFlowManagement(steady)
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("const QString&")
+ def slotLagrangian(self, text):
+ """
+ Private slot.
+ Put value beyond the multi-phase flow treatment is choosen or not.
+ """
+ if self.__stringModelFromCombo('Lagrangian') == 'single_phase':
+ val = 'off'
+ else:
+ val = 'on'
+
+ if val == 'off':
+ self.modelSteadyFlow.enableItem(str_model='on')
+ # WARNING: the 'coal_lagr' model is deprecated
+ #self.modelPulverizedCoal.disableItem(str_model='coal_lagr')
+ else:
+ self.modelSteadyFlow.disableItem(str_model='on')
+ # WARNING: the 'coal_lagr' model is deprecated
+ #self.modelPulverizedCoal.enableItem(str_model='coal_lagr')
+
+ self.lagr.setLagrangianStatus(val)
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("const QString&")
+ def slotAtmospheric(self, text):
+ """
+ Called when the comboBoxAtmospheric changed
+ """
+ self.__activateComboBox()
+
+ model = self.__stringModelFromCombo('Atmospheric')
+
+ if model != 'off':
+ # we inform that thermal scalar will be removed if it exists
+ th_label = self.scal.getThermalScalarLabel()
+ if th_label != '':
+ title = self.tr("Warning")
+ msg = self.tr("This selection implies the destruction of the thermal scalar")
+ QMessageBox.warning(self, title, msg)
+
+ self.therm.setThermalModel('off')
+ self.__disableComboBox()
+ self.comboBoxAtmospheric.setEnabled(True)
+
+ self.atmo.setAtmosphericFlowsModel(model)
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("const QString&")
+ def slotGasCombustionModel(self, text):
+ """
+ Private slot.
+ Binding method for gas combustion models.
+ """
+ self.__activateComboBox()
+
+ model = self.__stringModelFromCombo('GasCombustionModel')
+
+ if model != 'off':
+ # we inform that thermal scalar will be removed if it exists
+ th_label = self.scal.getThermalScalarLabel()
+ if th_label != '':
+ title = self.tr("Warning")
+ msg = self.tr("This selection implies the destruction of the thermal scalar")
+ QMessageBox.warning(self, title, msg)
+
+ self.therm.setThermalModel('off')
+ self.__disableComboBox()
+ self.comboBoxGasCombustionModel.setEnabled(True)
+
+ self.gas.setGasCombustionModel(model)
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("const QString&")
+ def slotPulverizedCoal(self, text):
+ """
+ Private slot.
+ Binding method for pulverized coal combustion models
+ """
+ self.__activateComboBox()
+
+ model = self.__stringModelFromCombo('PulverizedCoal')
+
+ # WARNING: the 'coal_lagr' model is deprecated
+# if model == 'coal_lagr':
+# self.modelLagrangian.disableItem(str_model='single_phase')
+# else:
+# self.modelLagrangian.enableItem(str_model='single_phase')
+
+ if model != 'off':
+ # we inform that thermal scalar will be removed if it exists
+ th_label = self.scal.getThermalScalarLabel()
+ if th_label != '':
+ title = self.tr("Warning")
+ msg = self.tr("This selection implies the destruction of the thermal scalar")
+ QMessageBox.warning(self, title, msg)
+
+ self.therm.setThermalModel('off')
+ self.__disableComboBox()
+ self.comboBoxPulverizedCoal.setEnabled(True)
+
+ self.pcoal.setCoalCombustionModel(model)
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("const QString&")
+ def slotJouleEffect(self, text):
+ """
+ Private slot.
+ Binding method for electrical models
+ """
+ self.__activateComboBox()
+
+ model = self.__stringModelFromCombo('JouleEffect')
+
+ if model != 'off':
+ # we inform that thermal scalar will be removed if it exists
+ th_label = self.scal.getThermalScalarLabel()
+ if th_label != '':
+ title = self.tr("Warning")
+ msg = self.tr("This selection implies the destruction of the thermal scalar")
+ QMessageBox.warning(self, title, msg)
+
+ self.therm.setThermalModel('off')
+ self.__disableComboBox()
+ self.comboBoxJouleEffect.setEnabled(True)
+
+ self.elect.setElectricalModel(model)
+ self.browser.configureTree(self.case)
+
+
+ def tr(self, text):
+ """
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/AtmosphericFlowsForm.ui b/gui/Pages/AtmosphericFlowsForm.ui
new file mode 100644
index 0000000..4c254c1
--- /dev/null
+++ b/gui/Pages/AtmosphericFlowsForm.ui
@@ -0,0 +1,137 @@
+<ui version="4.0" >
+ <class>AtmosphericFlowsForm</class>
+ <widget class="QWidget" name="AtmosphericFlowsForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>310</width>
+ <height>127</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Atmospheric flows</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" colspan="2" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QCheckBox" name="checkBoxMeteoData" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Read the file of meteorological data</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonMeteoData" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/weather-few-clouds.png</normaloff>:/new/prefix1/icons/22x22/weather-few-clouds.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelMeteoData" >
+ <property name="text" >
+ <string>name of the data file: </string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelMeteoFile" >
+ <property name="font" >
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>false</bool>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>19</width>
+ <height>27</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>19</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/AtmosphericFlowsModel.py b/gui/Pages/AtmosphericFlowsModel.py
new file mode 100644
index 0000000..209753a
--- /dev/null
+++ b/gui/Pages/AtmosphericFlowsModel.py
@@ -0,0 +1,342 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the atmospheric flows modelling management.
+
+This module contains the following classes and function:
+- AtmosphericFlowsModel
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+from FluidCharacteristicsModel import FluidCharacteristicsModel
+
+#-------------------------------------------------------------------------------
+# Atmospheric flows model class
+#-------------------------------------------------------------------------------
+
+class AtmosphericFlowsModel(Model):
+ """
+ Model for atmospheric flows
+ """
+ off = 'off'
+ constant = 'constant'
+ dry = 'dry'
+ humid = 'humid'
+ read_meteo_data = 'read_meteo_data'
+ model = 'model'
+ status = 'status'
+
+
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.__case = case
+ self.__fluidProp = FluidCharacteristicsModel(self.__case)
+
+ models = case.xmlGetNode('thermophysical_models')
+ self.__node_atmos = models.xmlInitChildNode('atmospheric_flows')
+ self.__atmosphericModel = (AtmosphericFlowsModel.off,
+ AtmosphericFlowsModel.constant,
+ AtmosphericFlowsModel.dry,
+ AtmosphericFlowsModel.humid)
+ self.__default = {}
+ self.__default[self.model] = AtmosphericFlowsModel.off
+ self.__default[self.read_meteo_data] = AtmosphericFlowsModel.off
+ self.__default['meteo_data'] = "meteo"
+
+
+ def setAtmosphericFlowsModel(self, model):
+ """
+ Update the atmospheric flows model markup from the XML document.
+ """
+ self.isInList(model, self.__atmosphericModel)
+ self.__node_atmos[self.model] = model
+ self.__updateScalarAndProperty()
+
+
+ def getAtmosphericFlowsModel(self):
+ """
+ Return the current atmospherics flows model.
+ """
+ model = self.__node_atmos[self.model]
+ if model not in self.__atmosphericModel:
+ model = self.__default[self.model]
+ self.setAtmosphericFlowsModel(model)
+ return model
+
+
+ def getMeteoDataStatus(self):
+ """
+ Return if reading meteo data status is 'on' or 'off'.
+ """
+ node = self.__node_atmos.xmlInitChildNode(self.read_meteo_data)
+ if not node[self.status]:
+ status = self.__default[self.read_meteo_data]
+ self.setMeteoDataStatus(status)
+ return node[self.status]
+
+
+ def setMeteoDataStatus(self, status):
+ """
+ Set meteo data status to 'on' / 'off'.
+ """
+ self.isOnOff(status)
+ self.__node_atmos.xmlInitChildNode(self.read_meteo_data)[self.status] = status
+
+ if status == 'off':
+ for tag in ['read_meteo_data', 'meteo_automatic']:
+ for node in self.__case.xmlGetNodeList(tag):
+ node['status'] = "off"
+
+
+ def getMeteoDataFileName(self):
+ """
+ Return the name of the meteo data file.
+ """
+ f = self.__node_atmos.xmlGetString('meteo_data')
+ if f == None:
+ f = self.__default['meteo_data']
+ self.setMeteoDataFile(f)
+ return f
+
+
+ def setMeteoDataFileName(self, tag):
+ """
+ Set the name of the meteo data file.
+ """
+ self.__node_atmos.xmlSetData('meteo_data', tag)
+
+
+ def __updateScalarAndProperty(self):
+ """
+ Update scalars and properties depending on model
+ """
+ node = self.__node_atmos
+
+ # Update only if getMeteoDataStatus is not off
+ if self.getMeteoDataStatus() != AtmosphericFlowsModel.off:
+
+ model = self.getAtmosphericFlowsModel()
+
+ if model == AtmosphericFlowsModel.dry:
+ self.__removeScalar(node, 'liquid_potential_temperature')
+ self.__removeScalar(node, 'total_water')
+ self.__removeScalar(node, 'number_of_droplets')
+ self.__removeProperty(node, 'liquid_water')
+ self.__setScalar(node, 'PotTemp', 'potential_temperature', 'model')
+ self.__setProperty(node, 'RealTemp', 'real_temperature')
+ if self.__fluidProp.getPropertyMode('density') == 'constant':
+ self.__fluidProp.setPropertyMode('density', 'variable')
+
+ elif model == AtmosphericFlowsModel.humid:
+ self.__removeScalar(node, 'potential_temperature')
+ self.__setScalar(node, 'LqPotTmp', 'liquid_potential_temperature', 'model')
+ self.__setScalar(node, 'TotWater', 'total_water', 'model')
+ self.__setScalar(node, 'TotDrop', 'number_of_droplets', 'model')
+ self.__setProperty(node, 'RealTemp', 'real_temperature')
+ self.__setProperty(node, 'LiqWater', 'liquid_water')
+ if self.__fluidProp.getPropertyMode('density') == 'constant':
+ self.__fluidProp.setPropertyMode('density', 'variable')
+
+ elif model == AtmosphericFlowsModel.constant:
+ self.__removeScalar(node, 'potential_temperature')
+ self.__removeScalar(node, 'liquid_potential_temperature')
+ self.__removeScalar(node, 'total_water')
+ self.__removeScalar(node, 'number_of_droplets')
+ self.__removeProperty(node, 'liquid_water')
+ FluidCharacteristicsModel(self.__case).setPropertyMode('density', 'constant')
+
+ else:
+ self.__removeScalar(node, 'potential_temperature')
+ self.__removeScalar(node, 'liquid_potential_temperature')
+ self.__removeScalar(node, 'total_water')
+ self.__removeScalar(node, 'number_of_droplets')
+ self.__removeProperty(node, 'liquid_water')
+
+
+ def atmosphericFlowsNode(self):
+ """
+ Get the atmospheric flows node
+ """
+ return self.__node_atmos
+
+
+ def __setScalar(self, parentNode, labelStr, nameStr, typeStr ):
+ """
+ Create xml scalar
+ """
+ scalar = parentNode.xmlInitChildNode('scalar', label = labelStr)
+ scalar['name'] = nameStr
+ scalar['type'] = typeStr
+
+
+ def __setProperty(self, parentNode, labelStr, nameStr):
+ """
+ Create xml property
+ """
+ prop = parentNode.xmlInitChildNode('property', label = labelStr)
+ prop['name'] = nameStr
+
+
+ def __removeScalar(self, parentNode, nameStr):
+ """
+ Delete scalar
+ """
+ parentNode.xmlRemoveChild('scalar', name = nameStr)
+
+
+ def __removeProperty(self, parentNode, nameStr):
+ """
+ Delete property
+ """
+ parentNode.xmlRemoveChild('property', name = nameStr)
+
+#-------------------------------------------------------------------------------
+# AtmosphericFlowsModel test case
+#-------------------------------------------------------------------------------
+
+class AtmosphericFlowsTestCase(ModelTest):
+ """
+ Test case for AtmosphericFlows
+ """
+ def checkAtmosphericFlowsInstantiation(self):
+ """
+ Check whether the AtmosphericFlowsModel class could be instantiated
+ """
+ model = None
+ model = AtmosphericFlowsModel(self.case)
+ assert model != None, 'Could not instantiate '
+
+
+ def checkGetandSetAtmosphericFlowsModel(self):
+ """Check whether the AtmosphericFlowsModel class could be set and get the model"""
+ mdl = AtmosphericFlowsModel(self.case)
+ mdl.setAtmosphericFlowsModel(AtmosphericFlowsModel.dry)
+
+ doc = """<atmospheric_flows model="dry">
+ <read_meteo_data status="off"/>
+ </atmospheric_flows>"""
+ assert mdl.atmosphericFlowsNode() == self.xmlNodeFromString(doc), \
+ 'Could not set atmospheric flows model'
+ assert mdl.getAtmosphericFlowsModel() == AtmosphericFlowsModel.dry, \
+ 'Could not get atmospheric flows model'
+
+
+ def checkGetandSetMeteoDataStatus(self):
+ """Check whether the AtmosphericFlowsModel class could be set and get the meteo data status"""
+ mdl = AtmosphericFlowsModel(self.case)
+ mdl.setAtmosphericFlowsModel(AtmosphericFlowsModel.constant)
+ mdl.setMeteoDataStatus('on')
+
+ doc = """<atmospheric_flows model="constant">
+ <read_meteo_data status="on"/>
+ </atmospheric_flows>"""
+
+ assert mdl.atmosphericFlowsNode() == self.xmlNodeFromString(doc), \
+ 'Could not set meteo data status'
+ assert mdl.getMeteoDataStatus() == 'on', \
+ 'Could not get meteo data status'
+
+
+ def checkDryModel(self):
+ """
+ Check whether the AtmosphericFlowsModel class could set the correct
+ properties and scalar for dry model
+ """
+ mdl = AtmosphericFlowsModel(self.case)
+ mdl.setAtmosphericFlowsModel(AtmosphericFlowsModel.dry)
+ mdl.setMeteoDataStatus('on')
+
+ doc = """<atmospheric_flows model="dry">
+ <read_meteo_data status="on">
+ <scalar label="Potential temp" name="potential_temperature" type="model"/>
+ <property label="Real temp" name="real_temperature"/>
+ </read_meteo_data>
+ </atmospheric_flows>
+ """
+
+ assert mdl.atmosphericFlowsNode() == self.xmlNodeFromString(doc), \
+ 'Could not set scalars and properties for dry model'
+
+
+ def checkHumidModel(self):
+ """
+ Check whether the AtmosphericFlowsModel class could set the correct
+ properties and scalar for humid model
+ """
+ mdl = AtmosphericFlowsModel(self.case)
+ mdl.setAtmosphericFlowsModel(AtmosphericFlowsModel.humid)
+ mdl.setMeteoDataStatus('on')
+
+ doc = """<atmospheric_flows model="humid">
+ <read_meteo_data status="on">
+ <scalar label="Liq potential temp" name="liquid_potential_temperature" type="model"/>
+ <scalar label="total water" name="total_water" type="model"/>
+ <scalar label="number of droplets" name="number_of_droplets" type="model"/>
+ <property label="Real temp" name="real_temperature"/>
+ <property label="Liquid water" name="liquid_water"/>
+ </read_meteo_data>
+ </atmospheric_flows>"""
+
+ assert mdl.atmosphericFlowsNode() == self.xmlNodeFromString(doc), \
+ 'Could not set scalars and properties for humid model'
+
+
+def suite():
+ """
+ Test Suite for AtmosphericFlows
+ """
+ testSuite = unittest.makeSuite(AtmosphericFlowsTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ """
+ run test
+ """
+ print "AtmosphericFlowsTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/AtmosphericFlowsView.py b/gui/Pages/AtmosphericFlowsView.py
new file mode 100644
index 0000000..343993b
--- /dev/null
+++ b/gui/Pages/AtmosphericFlowsView.py
@@ -0,0 +1,148 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- AtmosphericFlowsView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import os, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import pyqtSignature, SIGNAL, QString
+from PyQt4.QtGui import QWidget, QFileDialog, QMessageBox
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.AtmosphericFlowsForm import Ui_AtmosphericFlowsForm
+from Pages.AtmosphericFlowsModel import AtmosphericFlowsModel
+from Base.QtPage import setGreenColor
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("AtmosphericFlowsView")
+log.setLevel(logging.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class AtmosphericFlowsView(QWidget, Ui_AtmosphericFlowsForm):
+ """
+ Main class
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ # Setup base classes
+ QWidget.__init__(self, parent)
+ Ui_AtmosphericFlowsForm.__init__(self)
+ self.setupUi(self)
+
+ # create model
+ model = AtmosphericFlowsModel(case)
+ self.__model = model
+ self.__case = case
+
+ # Define connection
+ self.connect(self.checkBoxMeteoData,
+ SIGNAL("clicked(bool)"),
+ self.__slotCheckBoxMeteoData)
+ self.connect(self.pushButtonMeteoData,
+ SIGNAL("pressed()"),
+ self.__slotSearchMeteoData)
+
+ # Initialize the widgets
+ isMeteoDataChecked = model.getMeteoDataStatus() == 'on'
+ self.checkBoxMeteoData.setChecked(isMeteoDataChecked)
+ self.labelMeteoFile.setText(QString(self.__model.getMeteoDataFileName()))
+ self.labelMeteoData.setEnabled(isMeteoDataChecked)
+ self.labelMeteoFile.setEnabled(isMeteoDataChecked)
+
+
+ @pyqtSignature("bool")
+ def __slotCheckBoxMeteoData(self, checked):
+ """
+ Called when checkBox state changed
+ """
+ status = 'off'
+ if checked:
+ status = 'on'
+
+ setGreenColor(self.pushButtonMeteoData, checked)
+ self.labelMeteoData.setEnabled(checked)
+ self.labelMeteoFile.setEnabled(checked)
+ self.__model.setMeteoDataStatus(status)
+
+
+ @pyqtSignature("")
+ def __slotSearchMeteoData(self):
+ """
+ Select a meteorological file of data
+ """
+ data = self.__case['data_path']
+ title = self.tr("Meteorological file of data.")
+ filetypes = self.tr("Meteo data (*meteo*);;All Files (*)")
+ file = QFileDialog.getOpenFileName(self, title, data, filetypes)
+ file = str(file)
+ if not file:
+ return
+ file = os.path.basename(file)
+ if file not in os.listdir(data):
+ title = self.tr("WARNING")
+ msg = self.tr("This selected file is not in the DATA directory")
+ QMessageBox.information(self, title, msg)
+ else:
+ self.labelMeteoFile.setText(QString(file))
+ self.__model.setMeteoDataFileName(file)
+ setGreenColor(self.pushButtonMeteoData, False)
+
+
+ def tr(self, text):
+ """
+ Translation.
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BatchRunningAdvancedOptionsDialogForm.ui b/gui/Pages/BatchRunningAdvancedOptionsDialogForm.ui
new file mode 100644
index 0000000..b7b0143
--- /dev/null
+++ b/gui/Pages/BatchRunningAdvancedOptionsDialogForm.ui
@@ -0,0 +1,482 @@
+<ui version="4.0" >
+ <class>BatchRunningAdvancedOptionsDialogForm</class>
+ <widget class="QDialog" name="BatchRunningAdvancedOptionsDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>743</width>
+ <height>473</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <spacer name="horizontalSpacer_8" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>7</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Prefix of temporary execution
+directory (CS_TMP_PREFIX)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>34</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEdit" />
+ </item>
+ <item row="0" column="3" colspan="2" >
+ <widget class="QToolButton" name="toolButton" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Pre-processing (EXEC_PREPROCESS)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" colspan="3" >
+ <widget class="QComboBox" name="comboBox" />
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Partitioning (EXEC_PARTITION)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>37</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" colspan="3" >
+ <widget class="QComboBox" name="comboBox_2" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>490</width>
+ <height>40</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Calculation (EXEC_KERNEL)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="2" colspan="3" >
+ <widget class="QComboBox" name="comboBox_3" />
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>List of partitionings for use by later
+ calculation (PARTITION_LIST)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>34</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="2" colspan="3" >
+ <widget class="QLineEdit" name="lineEdit_2" />
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label_7" >
+ <property name="text" >
+ <string>valgrind (VALGRIND)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" >
+ <spacer name="horizontalSpacer_7" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>25</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="2" colspan="2" >
+ <widget class="QLineEdit" name="lineEdit_3" />
+ </item>
+ <item row="5" column="4" >
+ <widget class="QToolButton" name="toolButton_2" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <widget class="QLabel" name="label_8" >
+ <property name="text" >
+ <string>List of external libraries
+ for link (CS_LIB_ADD)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1" >
+ <spacer name="horizontalSpacer_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>34</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="6" column="2" colspan="3" >
+ <widget class="QLineEdit" name="lineEdit_4" />
+ </item>
+ <item row="7" column="0" >
+ <widget class="QLabel" name="label_9" >
+ <property name="text" >
+ <string>Elementary test of the mesh
+ (ARG_CS_VERIF)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" >
+ <spacer name="horizontalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>34</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="7" column="2" colspan="3" >
+ <widget class="QComboBox" name="comboBox_5" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Output redirection management (ARG_CS_OUTPUT)</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_10" >
+ <property name="text" >
+ <string>Redirection for single processor job or for
+ processor rank 0 of multi-processors job (--log)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QComboBox" name="comboBox_6" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_11" >
+ <property name="text" >
+ <string>Redirection for processors from rank 1 to N-&
+ of multi-processors job (--logp)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QComboBox" name="comboBox_7" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="layoutDirection" >
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <spacer name="horizontalSpacer_9" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>3</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>BatchRunningAdvancedOptionsDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>BatchRunningAdvancedOptionsDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/BatchRunningForm.ui b/gui/Pages/BatchRunningForm.ui
new file mode 100644
index 0000000..f2a9f2e
--- /dev/null
+++ b/gui/Pages/BatchRunningForm.ui
@@ -0,0 +1,396 @@
+<ui version="4.0" >
+ <class>BatchRunningForm</class>
+ <widget class="QWidget" name="BatchRunningForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>422</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxArchi" >
+ <property name="minimumSize" >
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Computer selection</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxArchi" >
+ <property name="minimumSize" >
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="lineArchi1" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>27</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelLauncher" >
+ <property name="toolTip" >
+ <string>The batch script file name is searched in </string>
+ </property>
+ <property name="text" >
+ <string>Select the batch script file</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonSearch" >
+ <property name="toolTip" >
+ <string>Search the batch script</string>
+ </property>
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/document-open.png</normaloff>:/new/prefix1/icons/22x22/document-open.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelFilename" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>27</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxBatch" >
+ <property name="statusTip" >
+ <string/>
+ </property>
+ <property name="title" >
+ <string>Prepare batch calculation</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelProcs" >
+ <property name="text" >
+ <string>Number of processors</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelJob" >
+ <property name="text" >
+ <string>Job management</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelFiles" >
+ <property name="text" >
+ <string>User files</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelAdvanced" >
+ <property name="text" >
+ <string>Advanced options</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QSpinBox" name="spinBoxProcs" >
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="maximum" >
+ <number>32</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonJob" >
+ <property name="toolTip" >
+ <string>PBS card informations</string>
+ </property>
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/network-server.png</normaloff>:/new/prefix1/icons/22x22/network-server.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>21</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonFiles" >
+ <property name="toolTip" >
+ <string>Data files selection and
+results files name</string>
+ </property>
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/bookmark-new.png</normaloff>:/new/prefix1/icons/22x22/bookmark-new.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonAdvanced" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/preferences-system.png</normaloff>:/new/prefix1/icons/22x22/preferences-system.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="lineBatch2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonRun" >
+ <property name="text" >
+ <string>Code_Saturne
+batch
+running</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>432</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BatchRunningModel.py b/gui/Pages/BatchRunningModel.py
new file mode 100644
index 0000000..8b4a6dc
--- /dev/null
+++ b/gui/Pages/BatchRunningModel.py
@@ -0,0 +1,705 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module modify the "runcase" script file
+- RuncaseModel
+- BatchRunningModel
+"""
+#-------------------------------------------------------------------------------
+# Standard modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+import os, sys, string, types, re
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import Base.Toolbox as Tool
+from SolutionDomainModel import SolutionDomainModel
+from CoalCombustionModel import CoalCombustionModel
+from AtmosphericFlowsModel import AtmosphericFlowsModel
+from ProfilesModel import ProfilesModel
+from Base.XMLvariables import Variables, Model
+
+#-------------------------------------------------------------------------------
+# Class BatchRunningModel
+#-------------------------------------------------------------------------------
+
+class RuncaseModel:
+ """
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ if not self.case['batchScript']:
+ self.case['batchScript'] = {'station': "",
+ 'pbs': "",
+ 'lsf': "",
+ 'sge': ""}
+
+ if not self.case['backupBatchScript']:
+ self.case['backupBatchScript'] = {'station': "no",
+ 'pbs': "no",
+ 'lsf': "no",
+ 'sge': "no"}
+
+
+class BatchRunningModel(Model):
+ """
+ This class modify saturne running file (runcase)
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ RuncaseModel(self.case)
+
+ # we get up batch script file
+ key = self.case['computer']
+
+ self.script1 = self.case['scripts_path'] + "/" + self.case['batchScript'][key]
+
+ # Save a backup file before any modification.
+ # There is only one backup for the entire session.
+
+ script2 = self.script1 + "~"
+
+ if self.case['backupBatchScript'][key] == "no" \
+ or not os.path.isfile(script2):
+ os.popen('cp ' + self.script1 + " " +script2)
+ self.case['backupBatchScript'][key] = "yes"
+
+ # Read the batch script file line by line.
+ # All lines are stored in a list called "self.lines".
+
+ f = open(self.script1, 'rw')
+ self.lines = f.readlines()
+ f.close()
+
+ # DicoValues's initialisation
+
+ self.dicoValues = {}
+ self.dicoValues['SOLCOM'] = '0'
+ self.dicoValues['PARAM'] = ""
+ self.dicoValues['VERSION'] = ""
+ self.dicoValues['NUMBER_OF_PROCESSORS'] = '1'
+ self.dicoValues['PROCESSOR_LIST'] = ""
+ self.dicoValues['PARTITION_LIST'] = ""
+ self.dicoValues['USER_INPUT_FILES'] = ""
+ self.dicoValues['USER_OUTPUT_FILES'] = ""
+ self.dicoValues['CS_TMP_PREFIX'] = ""
+ self.dicoValues['MESH'] = ""
+ self.dicoValues['COMMAND_REORIENT'] = ""
+ self.dicoValues['COMMAND_JOIN'] = ""
+ self.dicoValues['COMMAND_CWF'] = ""
+ self.dicoValues['COMMAND_PERIO'] = ""
+ self.dicoValues['COMMAND_SYRTHES'] = ""
+ self.dicoValues['PBS_JOB_NAME'] = ""
+ self.dicoValues['PBS_nodes'] = '1'
+ self.dicoValues['PBS_ppn'] = '2'
+ self.dicoValues['PBS_walltime'] = '1:00:00'
+ self.dicoValues['PBS_mem'] = '320'
+ self.dicoValues['EXEC_PREPROCESS'] = "yes"
+ self.dicoValues['EXEC_PARTITION'] = "yes"
+ self.dicoValues['EXEC_KERNEL'] = "yes"
+ self.dicoValues['CS_LIB_ADD'] = ""
+ self.dicoValues['VALGRIND'] = ""
+ self.dicoValues['ARG_CS_OUTPUT'] = ""
+ self.dicoValues['ARG_CS_VERIF'] = ""
+ self.dicoValues['THERMOCHEMISTRY_DATA'] = ""
+ self.dicoValues['METEO_DATA'] = ""
+
+ if self.case['salome']:
+ self.mdl.dicoValues['ARG_CS_OUTPUT'] = "--log 0"
+
+
+ def _getRegex(self, word):
+ """
+ Get regular expression to extract line without comment
+ """
+## fonctionne mais incomplet: regex = re.compile(r"""(^\s*""" + word + r""".*$)""")
+## fonctionne en tenant compte des lignes commencant par # :
+## regex = re.compile(r"""(^(?#)^\s*""" + word + r""".*$)""")
+ #tient compte a la fois des commentaires et des "$word":
+ regex = re.compile(r"""(^(?#)^\s*(?<!$)""" + word + r""".*$)""")
+
+ return regex
+
+
+ def _getLineToModify(self, regex, txt):
+ """
+ Search word in txt if and only if it's not a comment
+ """
+ pattern = None
+ if regex != None :
+ pattern = regex.search(txt)
+ return pattern
+
+
+ def _substituteLine(self, pattern, newword, txt):
+ """
+ Substitute pattern by newword
+ """
+ new_pattern = pattern.re.sub(newword, txt, re.VERBOSE)
+ return new_pattern
+
+
+ def _getValueInPattern(self, pattern, word, dico):
+ """
+ Return value of pattern
+ """
+ self.dicoValues[word] = dico
+ resu = pattern.group().split('=')
+ L = resu[1]
+ for i in range(2,len(resu)): L = L + "="+ resu[i]
+ resu = L
+
+ if resu:
+ if resu.split(' ')[0] == '': resu = resu.split(' ')[1]
+ if resu == '""': resu =''
+ else:
+ resu =''
+
+ self.dicoValues[word] = resu
+ return self.dicoValues[word]
+
+
+ def _removeQuotes(self, line, index=0, word=""):
+ """
+ 1) Delete quotes and return caracters,
+ 2) Return the associated value of the word
+ """
+ if not line: return ""
+
+ ch = line[index+len(word):]
+ if not ch: return ""
+ ch = string.join(string.split(ch))
+
+ try:
+ if ch[-1:] == '\n': ch = ch[:-1]
+ except IndexError:
+ pass
+
+ try:
+ if ch[-1:] == '"': ch = ch[:-1]
+ except IndexError:
+ pass
+
+ try:
+ if ch[0] == '"': ch = ch[1:]
+ except IndexError:
+ pass
+
+ ch = string.join(string.split(ch))
+
+ return ch
+
+
+ def _addQuotes(self, ch):
+ """
+ Add quotes in front of and behind string c.
+ """
+ ch = string.join(string.split(ch))
+ if string.rfind(ch, " ") != -1:
+ ch = '"' + ch + '"'
+ return ch
+
+
+ def readBatchScriptFile(self):
+ """
+ Fill self.dicoValues reading the backup file.
+ """
+ lines = self.lines
+
+ list = ['PBS_JOB_NAME','PBS_nodes','PBS_ppn','PBS_walltime','PBS_mem']
+
+ for k in self.dicoValues.keys():
+ if k not in list and k not in ('THERMOCHEMISTRY_DATA', 'METEO_DATA'):
+ nbkey = 0
+ for i in range(len(lines)):
+ reg = self._getRegex(k)
+ if reg != None:
+ pat = self._getLineToModify(reg, lines[i])
+ if pat != None:
+ nbkey = nbkey + 1
+ if nbkey == 1:
+ ch = self._getValueInPattern(pat, k, self.dicoValues)
+ ch = self._removeQuotes(str(ch))
+ self.dicoValues[k] = ch
+ else:
+ # If there are more than one occurence of the keyword in the
+ # batch script file, only the first one is modified
+ #
+ pass
+
+ if self.case['computer'] == "pbs":
+ for (word, ind, lab) in [('#PBS -j eo -N ', 0, 'PBS_JOB_NAME')]:
+ for i in range(len(lines)):
+ index = string.rfind(lines[i], word)
+ if index == ind:
+ self.dicoValues[lab] = self._removeQuotes(lines[i], ind, word)
+
+ for (word, next, lab) in [('#PBS -l nodes', ':ppn' , 'PBS_nodes'),
+ (':ppn' ,',walltime', 'PBS_ppn'),
+ (',walltime' ,',mem' , 'PBS_walltime'),
+ (',mem' , 'mb' , 'PBS_mem')]:
+ word = word + "="
+ for i in range(len(lines)):
+ ind1 = string.rfind(lines[i], word)
+ ind2 = string.rfind(lines[i], next)
+ if ind1 != -1 and ind2 != -1:
+ ch = lines[i][ind1+len(word):ind2]
+ self.dicoValues[lab] = ch
+
+ self.initializeBatchScriptFile()
+
+
+ def initializeBatchScriptFile(self):
+ """
+ Initialize the backup file from reading dictionary self.dicoValues the first time.
+ """
+ # Basic verification
+ #
+ #node_ecs = self.case.xmlGetNode('solution_domain')
+ #if not Tool.GuiParam.matisse:
+ #if not node_ecs:
+ #raise ValueError, "No preprocessor heading!"
+
+ sdm = SolutionDomainModel(self.case)
+ prm = ProfilesModel(self.case)
+
+ # MESH
+ meshes = string.join(sdm.getMeshList())
+ if meshes:
+ self.dicoValues['MESH'] = meshes
+
+ self.dicoValues['COMMAND_REORIENT'] = sdm.getReorientCommand()
+ self.dicoValues['COMMAND_JOIN'] = sdm.getJoinCommand()
+ self.dicoValues['COMMAND_CWF'] = sdm.getCutCommand()
+ self.dicoValues['COMMAND_PERIO'] = sdm.getPerioCommand()
+ self.dicoValues['COMMAND_SYRTHES'] = sdm.getSyrthesCommand()
+ self.dicoValues['PARAM'] = os.path.basename(self.case['xmlfile'])
+
+ # User 1D profiles are loaded as user result files
+
+ list = prm.getProfilesLabelsList()
+ if list:
+ if self.dicoValues['USER_OUTPUT_FILES']:
+ vlist = string.split(self.dicoValues['USER_OUTPUT_FILES'])
+ else:
+ vlist = []
+ for file in list:
+ if file not in vlist:
+ vlist.append(file)
+ self.dicoValues['USER_OUTPUT_FILES'] = string.join(vlist, " ")
+
+ # Specific data file for specific physics
+
+ model = CoalCombustionModel(self.case).getCoalCombustionModel()
+ if model == 'coal_homo' or model == 'coal_homo2':
+ self.dicoValues['THERMOCHEMISTRY_DATA'] = 'dp_FCP'
+
+ atmo = AtmosphericFlowsModel(self.case)
+ if atmo.getAtmosphericFlowsModel() != 'off':
+ self.dicoValues['METEO_DATA'] = atmo.getMeteoDataFileName()
+
+
+ def updateBatchScriptFile(self, keyword=None):
+ """
+ Update the backup file from reading dictionary self.dicoValues.
+ If keyword == None, all keywords are updated
+ If keyword == key, only key is updated.
+ """
+ # update the name of the param, useful when the xml file is new
+ # and was never saved before
+ self.dicoValues['PARAM'] = os.path.basename(self.case['xmlfile'])
+
+ l = self.dicoValues.keys()
+ l.append(None) # Add 'None' when no keyword is specified in argument.
+ self.isInList(keyword, l)
+ lines = self.lines
+
+ if self.case['computer'] == "pbs":
+ self.dicoValues['NUMBER_OF_PROCESSORS'] = ""
+
+ for k in self.dicoValues.keys():
+ nbkey = 0
+ if keyword: k = keyword
+ for i in range(len(lines)):
+ if self._getRegex(k) != None:
+ pat = self._getLineToModify(self._getRegex(k),lines[i])
+ if pat != None:
+ nbkey = nbkey + 1
+ if nbkey == 1:
+ ch = self._addQuotes(str(self.dicoValues[k]))
+ new = k + "=" + ch
+ lines[i] = self._substituteLine(pat, new, lines[i])
+ if keyword: break
+
+ # keywords only for the PBS Cluster
+ if self.case['computer'] == "pbs":
+ for (word, ind, var) in [('#PBS -j eo -N ', 0, self.dicoValues['PBS_JOB_NAME'])]:
+ for i in range(len(lines)):
+ index = string.rfind(lines[i], word)
+ if index == ind:
+ if type(var) != types.StringType :
+ var = str(var)
+ if var == "0" : var=""
+ lines[i] = word + var + '\n'
+
+ for (word, ind, next) in [('#PBS -l nodes', 0, ':ppn')]:
+ for i in range(len(lines)):
+ ind1 = string.rfind(lines[i], word)
+ ind2 = string.rfind(lines[i], next)
+ if ind1 == ind and ind2 != -1:
+ ch = ""
+ for (w, dic) in [('#PBS -l nodes=', self.dicoValues['PBS_nodes']),
+ (':ppn=', self.dicoValues['PBS_ppn']),
+ (',walltime=', self.dicoValues['PBS_walltime']),
+ (',mem=', self.dicoValues['PBS_mem'])]:
+ ch = ch + w + str(dic)
+ lines[i] = ch + "mb\n"
+
+ f = open(self.script1, 'w')
+ f.writelines(lines)
+ f.close()
+ os.system('chmod +x ' + self.script1)
+
+
+#-------------------------------------------------------------------------------
+# BatchRunningModel test class
+#-------------------------------------------------------------------------------
+
+
+class BatchRunningModelTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """
+ This method is executed before all 'check' methods.
+ """
+ from Base.XMLengine import Case
+ from Base.XMLinitialize import XMLinit
+ from Base.Toolbox import GuiParam
+ GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+
+ domain = SolutionDomainModel(self.case)
+ domain.addMesh('mail1.des', 'des')
+ domain.addMesh('mail2.des', 'des')
+ domain.addMesh('mail3.des', 'des')
+ domain.setCutStatus('on')
+ domain.setCutAngle(0.0321)
+ domain.setOrientation('on')
+
+ self.case['xmlfile'] = 'NEW.xml'
+ self.case['computer'] = 'station'
+ self.case['scripts_path'] = os.getcwd()
+ self.case['batchScript'] = {'pbs': 'lance_PBS', 'lsf': 'lance_LSF', 'station': 'lance_test'}
+ self.case['backupBatchScript'] = {'pbs': 'yes', 'lsf': 'yes', 'station': 'yes'}
+ lance_test = '# test \n'\
+ '#SOLCOM=6\n'\
+ 'SOLCOM=999\n'\
+ 'PARAM=NEW.xml\n'\
+ 'VERSION=tutu\n'\
+ 'NUMBER_OF_PROCESSORS=2\n'\
+ 'PROCESSOR_LIST=\n'\
+ 'PARTITION_LIST=\n'\
+ 'USER_INPUT_FILES=data\n'\
+ 'USER_OUTPUT_FILES=titi\n'\
+ 'CS_TMP_PREFIX=/home/toto\n'\
+ 'MESH=\n'\
+ 'COMMAND_REORIENT=\n'\
+ 'COMMAND_JOIN=" --j --color 98 99 --fraction 0.1 --plane 0.8"\n'\
+ 'COMMAND_CWF="--cwf 0.001"\n'\
+ 'COMMAND_PERIO=\n'\
+ 'COMMAND_SYRTHES=\n'\
+ 'EXEC_PREPROCESS=yes\n'\
+ 'EXEC_PARTITION=yes\n'\
+ 'EXEC_KERNEL=yes\n'\
+ 'CS_LIB_ADD=''\n'\
+ 'VALGRIND=''\n'\
+ 'ARG_CS_OUTPUT=''\n'\
+ 'ARG_CS_VERIF=''\n'
+
+ lance_PBS = '# test \n'\
+ '#\n'\
+ '# CARTES BATCH POUR CLUSTERS sous PBS\n'\
+ '#\n'\
+ '#PBS -l nodes=16:ppn=1,walltime=34:77:22,mem=832mb\n'\
+ '#PBS -j eo -N super_toto\n'
+
+ lance_LSF = '# test \n'\
+ '#\n'\
+ '# CARTES BATCH POUR LE CCRT (Nickel/Chrome/Tantale sous LSF)\n'\
+ '#\n'\
+ '#BSUB -n 2\n'\
+ '#BSUB -c 00:05\n'\
+ '#BSUB -o super_tataco.%J\n'\
+ '#BSUB -e super_tatace.%J\n'\
+ '#BSUB -J super_truc\n'
+
+ self.f = open('lance_test','w')
+ self.f.write(lance_test)
+ self.f.close()
+ self.f = open('lance_PBS','w')
+ self.f.write(lance_PBS)
+ self.f.close()
+ self.f = open('lance_LSF','w')
+ self.f.write(lance_LSF)
+ self.f.close()
+
+
+ def tearDown(self):
+ """
+ This method is executed after all 'check' methods.
+ """
+ for plateform in ('station', 'pbs','lsf'):
+ f = self.case['batchScript'][plateform]
+ if os.path.isfile(f): os.remove(f)
+ if os.path.isfile(f+"~"): os.remove(f+"~")
+
+
+ def checkGetRegexAndGetLineToModify(self):
+ """ Check whether the BatchRunningModel class could be get line"""
+ mdl = BatchRunningModel(self.case)
+ txt1 = '# fic = 1 '
+ txt2 = ' fic=2'
+ txt3 = 'fic=33'
+ txt4 = ' fic =55'
+ txt5 = ' fic = 55'
+ txt6 = ' fic = " fic jklm " '
+ regex1 = mdl._getRegex('fic')
+ regex2 = mdl._getRegex('fic')
+ regex3 = mdl._getRegex('fic')
+ regex4 = mdl._getRegex('fic')
+ regex5 = mdl._getRegex('fic')
+ regex6 = mdl._getRegex('fic')
+
+ pat1 = mdl._getLineToModify(regex1,txt1)
+ pat2 = mdl._getLineToModify(regex2,txt2)
+ pat3 = mdl._getLineToModify(regex3,txt3)
+ pat4 = mdl._getLineToModify(regex4,txt4)
+ pat5 = mdl._getLineToModify(regex5,txt5)
+ pat6 = mdl._getLineToModify(regex6,txt6)
+
+ assert pat1 == None, 'Could not get pat1 to modify text'
+ assert pat2.group() == ' fic=2', 'Could not get pat2 to modify text'
+ assert pat3.group() == 'fic=33', 'Could not get pat3 to modify text'
+ assert pat4.group() == ' fic =55', 'Could not get pat4 to modify text'
+ assert pat5.group() == ' fic = 55', 'Could not get pat5 to modify text'
+ assert pat6.group() == ' fic = " fic jklm " ', 'Could not get pat6 to modify text'
+
+
+ def checkGetValueInPattern(self):
+ """ Check whether the class could be get value from regular expression"""
+ mdl = BatchRunningModel(self.case)
+ dico = {}
+ txt = 'fic=33'
+ txt1 = '# fic = 1 '
+ txt2 = ' fic=2'
+ txt5 = ' fic = 55'
+ regex = mdl._getRegex('fic')
+ pat = mdl._getLineToModify(regex,txt)
+ value = mdl._getValueInPattern(pat, 'fic', dico)
+ regex1 = mdl._getRegex('fic')
+ pat1 = mdl._getLineToModify(regex1,txt1)
+ regex2 = mdl._getRegex('fic')
+ pat2 = mdl._getLineToModify(regex2,txt2)
+ value2 = mdl._getValueInPattern(pat2, 'fic', dico)
+ regex5 = mdl._getRegex('fic')
+ pat5 = mdl._getLineToModify(regex5,txt5)
+ value5 = mdl._getValueInPattern(pat5, 'fic', dico)
+
+ assert value == '33','could not get value from regular expression'
+ assert pat1 == None,'could not get value1 from regular expression'
+ assert value2 == '2','could not get value2 from regular expression'
+ assert value5 == '55','could not get value5 from regular expression'
+
+
+ def checkSubstituteLine(self):
+ """ Check whether the BatchRunningModel class could be substitute line"""
+ mdl = BatchRunningModel(self.case)
+ txt1 = ' fic='
+ txt2 = ' fic= rien'
+ pat1 = mdl._getLineToModify(mdl._getRegex('fic'),txt1)
+ new1 = mdl._substituteLine(pat1,'vacances',txt1)
+ pat2 = mdl._getLineToModify(mdl._getRegex('fic'),txt2)
+ new_pat2 = 'fic=' + 'vacances'
+ new2 = mdl._substituteLine(pat2,new_pat2,txt2)
+
+ assert new1 == 'vacances','could not substitute line from regular expression'
+ assert new2 == 'fic=vacances','could not substitute line from regular expression'
+
+
+ def checkReadBatchScriptFile(self):
+ """ Check whether the BatchRunningModel class could be read file"""
+ self.case['computer'] = 'station'
+ mdl = BatchRunningModel(self.case)
+ mdl.readBatchScriptFile()
+
+ # The following keywords from the batch script file
+ # are cancelled by the informations from the case !
+ # MESH
+ # COMMAND_JOIN
+ # COMMAND_CWF
+ # COMMAND_SYRTHES
+ # COMMAND_PERIO
+ # COMMAND_REORIENT
+ #
+ dico = {\
+ 'PROCESSOR_LIST': '',
+ 'PARTITION_LIST': '',
+ 'PBS_nodes': '1',
+ 'MESH': 'mail1.des mail2.des mail3.des',
+ 'PBS_JOB_NAME': '',
+ 'COMMAND_CWF': ' --cwf 0.0321',
+ 'SOLCOM': '999',
+ 'USER_OUTPUT_FILES': 'titi',
+ 'PARAM': 'NEW.xml',
+ 'NUMBER_OF_PROCESSORS': '2',
+ 'USER_INPUT_FILES': 'data',
+ 'COMMAND_JOIN': '',
+ 'COMMAND_REORIENT': ' --reorient ',
+ 'VERSION': 'tutu',
+ 'CS_TMP_PREFIX': '/home/toto',
+ 'COMMAND_SYRTHES': '',
+ 'PBS_ppn': '2',
+ 'PBS_walltime': '1:00:00',
+ 'PBS_mem': '320',
+ 'COMMAND_PERIO': '',
+ 'EXEC_PREPROCESS':'yes',
+ 'EXEC_PARTITION':'yes',
+ 'EXEC_KERNEL':'yes',
+ 'CS_LIB_ADD':'',
+ 'VALGRIND':'',
+ 'ARG_CS_OUTPUT':'',
+ 'ARG_CS_VERIF':'',
+ 'THERMOCHEMISTRY_DATA':'',
+ 'METEO_DATA':''}
+ for k in mdl.dicoValues.keys():
+ if mdl.dicoValues[k] != dico[k]:
+ print "\nwarning for key: ", k
+ print " read value in the script:", mdl.dicoValues[k]
+ print " reference value:", dico[k]
+ assert mdl.dicoValues[k] == dico[k], 'could not read the batch script file'
+ assert mdl.dicoValues == dico, 'could not read batch script file'
+
+
+ def checkReadBatchScriptPBS(self):
+ """ Check whether the BatchRunningModel class could be read file"""
+ self.case['computer'] = 'pbs'
+ mdl = BatchRunningModel(self.case)
+ mdl.readBatchScriptFile()
+
+ # The following keywords from the batch script file
+ # are cancelled by the informations from the case !
+ # MESH
+ # COMMAND_JOIN
+ # COMMAND_CWF
+ # COMMAND_SYRTHES
+ # COMMAND_PERIO
+ #
+ #
+ dico_PBS = {\
+ 'PBS_nodes': '16',
+ 'MESH': 'mail1.des mail2.des mail3.des',
+ 'PBS_JOB_NAME': 'super_toto',
+ 'COMMAND_CWF': ' --cwf 0.0321',
+ 'SOLCOM': '0',
+ 'PARAM': 'NEW.xml',
+ 'NUMBER_OF_PROCESSORS': '1',
+ 'USER_INPUT_FILES': '',
+ 'COMMAND_JOIN': '',
+ 'COMMAND_REORIENT': ' --reorient ',
+ 'CS_TMP_PREFIX': '',
+ 'COMMAND_SYRTHES': '',
+ 'PBS_ppn': '1',
+ 'PBS_walltime': '34:77:22',
+ 'PBS_mem': '832',
+ 'COMMAND_PERIO': ''}
+
+ for k in dico_PBS.keys():
+ if mdl.dicoValues[k] != dico_PBS[k] :
+ print "\nwarning for key: ", k
+ print " read value in the script:", mdl.dicoValues[k]
+ print " reference value:", dico_PBS[k]
+ assert mdl.dicoValues[k] == dico_PBS[k], 'could not read the batch script file'
+
+
+ def checkUpdateBatchScriptFile(self):
+ """ Check whether the BatchRunningModel class could update file"""
+ mdl = BatchRunningModel(self.case)
+ mdl.readBatchScriptFile()
+ mdl.dicoValues['NUMBER_OF_PROCESSORS']='48'
+ dico_updated = mdl.dicoValues
+ mdl.updateBatchScriptFile()
+ mdl.readBatchScriptFile()
+ dico_read = mdl.dicoValues
+
+ assert dico_updated == dico_read, 'error on updating batch script file'
+
+
+ def checkUpdateBatchScriptPBS(self):
+ """ Check whether the BatchRunningModel class could update file"""
+ mdl = BatchRunningModel(self.case)
+ mdl.readBatchScriptFile()
+ mdl.dicoValues['PBS_mem']='512'
+ mdl.dicoValues['PBS_walltime']='12:42:52'
+ dicoPBS_updated = mdl.dicoValues
+ mdl.updateBatchScriptFile()
+ mdl.readBatchScriptFile()
+ dicoPBS_read = mdl.dicoValues
+
+ assert dicoPBS_updated == dicoPBS_read, 'error on updating PBS batch script file'
+
+
+def suite():
+ testSuite = unittest.makeSuite(BatchRunningModelTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "BatchRunningModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End of BacthRunningModel
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BatchRunningPBSJobManagementDialogForm.ui b/gui/Pages/BatchRunningPBSJobManagementDialogForm.ui
new file mode 100644
index 0000000..43cd8b3
--- /dev/null
+++ b/gui/Pages/BatchRunningPBSJobManagementDialogForm.ui
@@ -0,0 +1,255 @@
+<ui version="4.0" >
+ <class>BatchRunningPBSJobManagementDialogForm</class>
+ <widget class="QDialog" name="BatchRunningPBSJobManagementDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>290</width>
+ <height>214</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Job management</string>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelJobName" >
+ <property name="text" >
+ <string>Job name</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelNodes" >
+ <property name="text" >
+ <string>Number of nodes</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelCPUTime" >
+ <property name="text" >
+ <string>CPU time</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_8" >
+ <property name="text" >
+ <string>Memory (Mb)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLineEdit" name="lineEditJobName" />
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLineEdit" name="lineEditNodes" >
+ <property name="maximumSize" >
+ <size>
+ <width>40</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelCPUNodes" >
+ <property name="text" >
+ <string>CPUs per node</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditCPUNodes" >
+ <property name="maximumSize" >
+ <size>
+ <width>40</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLineEdit" name="lineEditHours" >
+ <property name="maximumSize" >
+ <size>
+ <width>40</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelHours" >
+ <property name="text" >
+ <string>h</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditMinutes" >
+ <property name="maximumSize" >
+ <size>
+ <width>40</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelMinutes" >
+ <property name="text" >
+ <string>mn</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditSeconds" >
+ <property name="maximumSize" >
+ <size>
+ <width>40</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelSeconds" >
+ <property name="text" >
+ <string>s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditMemory" />
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>272</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>BatchRunningPBSJobManagementDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>BatchRunningPBSJobManagementDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/BatchRunningUserFilesDialogForm.ui b/gui/Pages/BatchRunningUserFilesDialogForm.ui
new file mode 100644
index 0000000..c7283e3
--- /dev/null
+++ b/gui/Pages/BatchRunningUserFilesDialogForm.ui
@@ -0,0 +1,271 @@
+<ui version="4.0" >
+ <class>BatchRunningUserFilesDialogForm</class>
+ <widget class="QDialog" name="BatchRunningUserFilesDialogForm" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>250</width>
+ <height>397</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>User files</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Data files selection</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" colspan="4" >
+ <widget class="QListView" name="viewData" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QToolButton" name="buttonNewData" >
+ <property name="minimumSize" >
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Search previous user data file</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/document-open.png</normaloff>:/new/prefix1/icons/22x22/document-open.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QToolButton" name="buttonAddData" >
+ <property name="minimumSize" >
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>New user data file</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/document-new.png</normaloff>:/new/prefix1/icons/22x22/document-new.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QToolButton" name="buttonDeleteData" >
+ <property name="minimumSize" >
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Revome from selection</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/user-trash-full.png</normaloff>:/new/prefix1/icons/22x22/user-trash-full.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxResults" >
+ <property name="title" >
+ <string>Results files</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" colspan="3" >
+ <widget class="QListView" name="viewResu" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QToolButton" name="buttonAddResu" >
+ <property name="minimumSize" >
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>New user result file</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/document-new.png</normaloff>:/new/prefix1/icons/22x22/document-new.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QToolButton" name="buttonDeleteResu" >
+ <property name="minimumSize" >
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Revome from selection</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/user-trash-full.png</normaloff>:/new/prefix1/icons/22x22/user-trash-full.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>BatchRunningUserFilesDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>BatchRunningUserFilesDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/BatchRunningView.py b/gui/Pages/BatchRunningView.py
new file mode 100644
index 0000000..941f111
--- /dev/null
+++ b/gui/Pages/BatchRunningView.py
@@ -0,0 +1,1149 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- BatchRunningUserFilesDialogView
+- BatchRunningPBSJobManagementDialogView
+- BatchRunningAdvancedOptionsDialogView
+- BatchRunningView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys
+import string, types
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from BatchRunningForm import Ui_BatchRunningForm
+from BatchRunningUserFilesDialogForm import Ui_BatchRunningUserFilesDialogForm
+from BatchRunningPBSJobManagementDialogForm import Ui_BatchRunningPBSJobManagementDialogForm
+from BatchRunningAdvancedOptionsDialogForm import Ui_BatchRunningAdvancedOptionsDialogForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, IntValidator, RegExpValidator, setGreenColor
+from BatchRunningModel import RuncaseModel, BatchRunningModel
+from Pages.LocalizationModel import LocalizationModel, Zone
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BatchRunningView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Popup window class: Data and results user files
+#-------------------------------------------------------------------------------
+
+
+class BatchRunningUserFilesDialogView(QDialog, Ui_BatchRunningUserFilesDialogForm):
+ """
+ Class for data and results user files
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_BatchRunningUserFilesDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("User files"))
+
+ self.default = default
+ self.result = {}
+ for key in self.default.keys():
+ self.result[key] = []
+
+ # Models
+ rows = 0
+ columns = 1
+ self.modelData = QListModel(rows, columns)
+ self.modelResu = QListModel(rows, columns)
+
+ # associated with views.
+ self.viewData.setModel(self.modelData)
+ self.viewResu.setModel(self.modelResu)
+
+ self.viewData.setItemDelegate(DataDelegate(self, self.default['data_path']))
+ self.viewResu.setItemDelegate(ResuDelegate(self))
+
+ # Connections
+ self.connect(self.buttonNewData, SIGNAL("clicked()"), self.slotAddData)
+ self.connect(self.buttonAddData, SIGNAL("clicked()"), self.slotNewData)
+ self.connect(self.buttonAddResu, SIGNAL("clicked()"), self.slotNewResu)
+ self.connect(self.buttonDeleteData, SIGNAL("clicked()"), self.slotDeleteData)
+ self.connect(self.buttonDeleteResu, SIGNAL("clicked()"), self.slotDeleteResu)
+
+ # Previous values
+ for item in self.default['data']:
+ self.setFileData(item)
+ for item in self.default['results']:
+ self.setFileResu(item)
+
+
+ def setFileData(self, item):
+ # Verify that the input is not already in the QListView
+ indexList = self.modelData.search(QString(item))
+
+ if indexList:
+ title = self.tr("Warning")
+ msg = self.tr("%s is already in the list." % str(item))
+ QMessageBox.warning(self, title, msg)
+ else:
+ std_item = QStandardItem(QString(item))
+ self.modelData.appendRow(std_item)
+
+
+ def setFileResu(self, item):
+ # Verify that the input is not already in the QListView
+ indexList = self.modelResu.search(QString(item))
+
+ if indexList:
+ title = self.tr("Warning")
+ msg = self.tr("%s is already in the list." % str(item))
+ QMessageBox.warning(self, title, msg)
+ else:
+ std_item = QStandardItem(QString(item))
+ self.modelResu.appendRow(std_item)
+
+
+ @pyqtSignature("")
+ def slotAddData(self):
+ """
+ Add data users files input in entries in the good list.
+ """
+ title = self.tr("Search user data files.")
+ filetypes = self.tr("User data files (*);;""All Files (*)")
+ list = QFileDialog.getOpenFileNames(self,
+ title,
+ self.default['data_path'],
+ filetypes)
+ for item in list:
+ self.setFileData(os.path.basename(str(item)))
+
+
+ @pyqtSignature("")
+ def slotNewData(self):
+ std_item = QStandardItem(QString(""))
+ self.modelData.appendRow(std_item)
+ index = self.modelData.indexFromItem(std_item)
+ self.viewData.edit(index)
+
+
+ @pyqtSignature("")
+ def slotNewResu(self):
+ std_item = QStandardItem(QString(""))
+ self.modelResu.appendRow(std_item)
+ index = self.modelResu.indexFromItem(std_item)
+ self.viewResu.edit(index)
+
+
+ @pyqtSignature("")
+ def slotDeleteData(self):
+ """
+ Delete the selection from the listbox (one by one).
+ """
+ index = self.viewData.currentIndex()
+ if index.isValid():
+ self.modelData.removeRow(index.row())
+
+
+ @pyqtSignature("")
+ def slotDeleteResu(self):
+ """
+ Delete the selection from the listbox (one by one).
+ """
+ index = self.viewResu.currentIndex()
+ if index.isValid():
+ self.modelResu.removeRow(index.row())
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ column = 0
+
+ for row in range(self.modelData.rowCount()):
+ index = self.modelData.index(row, column, QModelIndex())
+ qstring = index.data(Qt.DisplayRole).toString()
+ self.result['data'].append(str(qstring))
+
+ for row in range(self.modelResu.rowCount()):
+ index = self.modelResu.index(row, column, QModelIndex())
+ qstring = index.data(Qt.DisplayRole).toString()
+ self.result['results'].append(str(qstring))
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ self.result = self.default.copy()
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+class QListModel(QStandardItemModel):
+ def __init__(self, row, column, parent=None):
+ super(QListModel, self).__init__(row, column, parent)
+
+ def search(self, item):
+ result = []
+ column = 0
+ for row in range(self.rowCount()):
+ index = self.index(row, column, QModelIndex())
+ qstring = index.data(Qt.DisplayRole).toString()
+ if item == qstring:
+ result.append(index)
+
+ return result
+
+
+class DataDelegate(QItemDelegate):
+ def __init__(self, parent=None, path=None):
+ super(DataDelegate, self).__init__(parent)
+ self.path = path
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ vd = RegExpValidator(editor, QRegExp("[_A-Za-z0-9\-\*\!\?\.]*"))
+ editor.setValidator(vd)
+ editor.setFrame(False)
+ self.connect(editor, SIGNAL("returnPressed()"), self.commitAndCloseEditor)
+ editor.setCursorPosition(0)
+ return editor
+
+
+ def commitAndCloseEditor(self):
+ editor = self.sender()
+ if isinstance(editor, QLineEdit):
+ self.emit(SIGNAL("commitData(QWidget*)"), editor)
+ self.emit(SIGNAL("closeEditor(QWidget*)"), editor)
+
+
+ def setEditorData(self, editor, index):
+ text = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(text)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+
+ item = editor.text()
+
+ if model.search(item):
+ model.removeRow(index.row())
+ title = self.tr("Warning")
+ msg = self.tr("%s is already in the list." % str(item))
+ QMessageBox.warning(self.parent, title, msg)
+ return
+
+ path = self.path + "/" + str(item)
+ if not os.path.isfile(path) and not os.path.islink(path):
+ model.removeRow(index.row())
+ title = self.tr("Information")
+ msg = self.tr("%s is not in the data directory:\n\n%s"
+ "\n\nCheck location of this file.\n"
+ "(Note: wildcards are authorized)" % (str(item), self.path))
+ QMessageBox.information(self.parent, title, msg)
+
+ model.setData(index, QVariant(item), Qt.DisplayRole)
+
+
+class ResuDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(ResuDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ vd = RegExpValidator(editor, QRegExp("[_A-Za-z0-9\-\*\!\?\.]*"))
+ editor.setValidator(vd)
+ editor.setFrame(False)
+ self.connect(editor, SIGNAL("returnPressed()"), self.commitAndCloseEditor)
+ editor.setCursorPosition(0)
+ return editor
+
+
+ def commitAndCloseEditor(self):
+ editor = self.sender()
+ if isinstance(editor, QLineEdit):
+ self.emit(SIGNAL("commitData(QWidget*)"), editor)
+ self.emit(SIGNAL("closeEditor(QWidget*)"), editor)
+
+
+ def setEditorData(self, editor, index):
+ text = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(text)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+
+ item = editor.text()
+
+ if model.search(item):
+ model.removeRow(index.row())
+ title = self.tr("Warning")
+ msg = self.tr("%s is already in the list." % str(item))
+ QMessageBox.warning(self.parent, title, msg)
+ else:
+ model.setData(index, QVariant(item), Qt.DisplayRole)
+
+
+#-------------------------------------------------------------------------------
+# Popup window class: Cluster job management
+#-------------------------------------------------------------------------------
+
+
+class BatchRunningPBSJobManagementDialogView(QDialog, Ui_BatchRunningPBSJobManagementDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_BatchRunningPBSJobManagementDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("PBS job management"))
+
+ self.default = default
+ self.result = self.default.copy()
+
+ # Validators
+ validatorJobName = RegExpValidator(rx, self.lineEditJobName, QRegExp("[_A-Za-z0-9]*"))
+ validatorNodes = IntValidator(self.lineEditNodes, min=1)
+ validatorCPUNodes = IntValidator(self.lineEditCPUNodes, min=1, max=2)
+ validatorHours = IntValidator(self.lineEditHours, min=0, max=999)
+ validatorMinutes = IntValidator(self.lineEditMinutes, min=0, max=59)
+ validatorSeconds = IntValidator(self.lineEditSeconds, min=0, max=59)
+ validatorMemory = IntValidator(self.lineEditMemory, min=1, max=9999999)
+
+ self.lineEditJobName.setValidator(validatorJobName)
+ self.lineEditNodes.setValidator(validatorNodes)
+ self.lineEditCPUNodes.setValidator(validatorCPUNodes)
+
+ self.lineEditHours.setValidator(validatorHours)
+ self.lineEditMinutes.setValidator(validatorMinutes)
+ self.lineEditSeconds.setValidator(validatorSeconds)
+ self.lineEditMemory.setValidator(validatorMemory)
+
+ # Previous values
+ self.job_name = self.default['PBS_JOB_NAME']
+ self.cluster_node = self.default['PBS_nodes']
+ self.cluster_ppn = self.default['PBS_ppn']
+ self.job_mem = self.default['PBS_mem']
+ L = string.split(self.default['PBS_walltime'], ":")
+ self.h_cput = L[0]
+ self.m_cput = L[1]
+ self.s_cput = L[2]
+
+ self.lineEditJobName.setText(QString(self.job_name))
+ self.lineEditNodes.setText(QString(str(self.cluster_node)))
+
+ self.lineEditCPUNodes.setText(QString(str(self.cluster_ppn)))
+ self.lineEditHours.setText(QString(str(self.h_cput)))
+ self.lineEditMinutes.setText(QString(str(self.m_cput)))
+ self.lineEditSeconds.setText(QString(str(self.s_cput)))
+ self.lineEditMemory.setText(QString(str(self.job_mem)))
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ self.result['PBS_JOB_NAME'] = str(self.lineEditJobName.text())
+ if self.lineEditNodes.validator().state == QValidator.Acceptable:
+ self.result['PBS_nodes'] = str(self.lineEditNodes.text())
+ if self.lineEditCPUNodes.validator().state == QValidator.Acceptable:
+ self.result['PBS_ppn'] = str(self.lineEditCPUNodes.text())
+ if self.lineEditCPUNodes.validator().state == QValidator.Acceptable and \
+ self.lineEditMinutes.validator().state == QValidator.Acceptable and \
+ self.lineEditSeconds.validator().state == QValidator.Acceptable:
+ h_cput = str(self.lineEditHours.text())
+ m_cput = str(self.lineEditMinutes.text())
+ s_cput = str(self.lineEditSeconds.text())
+ self.result['PBS_walltime'] = h_cput + ":" + m_cput + ":" + s_cput
+ if self.lineEditMemory.validator().state == QValidator.Acceptable:
+ self.result['PBS_mem'] = str(self.lineEditMemory.text())
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Popup advanced options
+#-------------------------------------------------------------------------------
+
+
+class BatchRunningAdvancedOptionsDialogView(QDialog, Ui_BatchRunningAdvancedOptionsDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_BatchRunningAdvancedOptionsDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("Advanced options"))
+ self.default = default
+ self.result = self.default.copy()
+
+ # Combo models
+ self.modelExecPrepro = ComboModel(self.comboBox, 2, 1)
+ self.modelExecPartit = ComboModel(self.comboBox_2, 2, 1)
+ self.modelExecKernel = ComboModel(self.comboBox_3, 2, 1)
+ self.modelArg_cs_verif = ComboModel(self.comboBox_5, 2, 1)
+ self.modelCSOUT1 = ComboModel(self.comboBox_6, 2, 1)
+ self.modelCSOUT2 = ComboModel(self.comboBox_7, 3, 1)
+
+ # Combo items
+ self.modelExecPrepro.addItem(self.tr("Run the preprocessor"), 'yes')
+ self.modelExecPrepro.addItem(self.tr("Use existing DATA/preprocessor_output"), 'no')
+
+ self.modelExecPartit.addItem(self.tr("Run the partioner"), 'yes')
+ self.modelExecPartit.addItem(self.tr("Use existing domain_number_<p> file in DATA/PARTITION_OUTPUT/\n"\
+ "if present, unoptimized partition otherwise"), 'no')
+
+ self.modelExecKernel.addItem(self.tr("Setup data and run the calculation"), 'yes')
+ self.modelExecKernel.addItem(self.tr("Do not setup data and run the calculation"), 'no')
+
+ self.modelArg_cs_verif.addItem(self.tr("Off"), 'standard')
+ self.modelArg_cs_verif.addItem(self.tr("Mesh quality criteria"), 'mesh_quality')
+
+ self.modelCSOUT1.addItem(self.tr("to standard output"), 'standard')
+ self.modelCSOUT1.addItem(self.tr("to listing"), 'listing')
+
+ self.modelCSOUT2.addItem(self.tr("no output"), 'shunte')
+ self.modelCSOUT2.addItem(self.tr("to standard output"), 'standard')
+ self.modelCSOUT2.addItem(self.tr("to listing_n<N>"), 'listing')
+
+ # connections
+ self.connect(self.toolButton, SIGNAL("clicked()"), self.slotSearchDirectory)
+ self.connect(self.comboBox, SIGNAL("activated(const QString&)"), self.slotExePrepro)
+ self.connect(self.comboBox_2, SIGNAL("activated(const QString&)"), self.slotExePartit)
+ self.connect(self.comboBox_3, SIGNAL("activated(const QString&)"), self.slotExeKernel)
+ self.connect(self.toolButton_2, SIGNAL("clicked()"), self.slotSearchFile)
+ self.connect(self.lineEdit_2, SIGNAL("textChanged(const QString &)"), self.slotPartitionList)
+ self.connect(self.lineEdit_3, SIGNAL("textChanged(const QString &)"), self.slotValgrind)
+ self.connect(self.lineEdit_4, SIGNAL("textChanged(const QString &)"), self.slotCs_lib_add)
+ self.connect(self.comboBox_5, SIGNAL("activated(const QString&)"), self.slotArgCsVerif)
+ self.connect(self.comboBox_6, SIGNAL("activated(const QString&)"), self.slotArgCsOutput)
+ self.connect(self.comboBox_7, SIGNAL("activated(const QString&)"), self.slotArgCsOutput)
+
+ # Previous values
+ self.exe_name = self.default['CS_TMP_PREFIX']
+ self.lineEdit.setText(QString(self.exe_name))
+
+ self.exe_prepro = self.default['EXEC_PREPROCESS']
+ self.modelExecPrepro.setItem(str_model=self.exe_prepro)
+
+ self.exe_partit = self.default['EXEC_PARTITION']
+ self.modelExecPartit.setItem(str_model=self.exe_partit)
+
+ self.exe_kernel = self.default['EXEC_KERNEL']
+ self.modelExecKernel.setItem(str_model=self.exe_kernel)
+
+ self.partition_list = self.default['PARTITION_LIST']
+ self.lineEdit_2.setText(QString(self.partition_list))
+
+ self.valgrind = self.default['VALGRIND']
+ self.lineEdit_3.setText(QString(self.valgrind))
+
+ self.cs_lib_add = self.default['CS_LIB_ADD']
+ self.lineEdit_4.setText(QString(self.cs_lib_add))
+
+ self.setArgCsVerif()
+ self.setArgCsOutput()
+
+ self.dir_name = self.default['CS_TMP_PREFIX']
+ self.lineEdit.setEnabled(False)
+
+
+ @pyqtSignature("const QString &")
+ def slotPartitionList(self, text):
+ """
+ Input for Partitioner.
+ """
+ self.partition_list = str(text)
+
+
+ @pyqtSignature("const QString &")
+ def slotValgrind(self, text):
+ """
+ Input for Valgrind.
+ """
+ self.valgrind = str(text)
+
+
+ @pyqtSignature("const QString &")
+ def slotCs_lib_add(self, text):
+ """
+ Input for external libraries.
+ """
+ self.cs_lib_add = str(text)
+
+
+ @pyqtSignature("const QString &")
+ def slotExePrepro(self, text):
+ """
+ Preprocessor execution mode option.
+ """
+ self.exe_prepro = self.modelExecPrepro.dicoV2M[str(text)]
+
+
+ @pyqtSignature("const QString &")
+ def slotExePartit(self, text):
+ """
+ Partitioner execution mode option.
+ """
+ self.exe_partit = self.modelExecPartit.dicoV2M[str(text)]
+
+
+ @pyqtSignature("const QString &")
+ def slotExeKernel(self, text):
+ """
+ Kernel execution mode option.
+ """
+ self.exe_kernel = self.modelExecKernel.dicoV2M[str(text)]
+
+
+ def setArgCsVerif(self):
+ """
+ Put ARG_CS_VERIF option from "lance" file.
+ """
+ if self.default['ARG_CS_VERIF'] == '':
+ self.arg_cs_verif = 'standard'
+ self.val_verif = ""
+ if self.default['ARG_CS_VERIF'] == '--quality' or self.default['ARG_CS_VERIF'] == '-q':
+ self.arg_cs_verif = 'mesh_quality'
+ self.val_verif = '--quality'
+ self.modelArg_cs_verif.setItem(str_model=self.arg_cs_verif)
+
+
+ @pyqtSignature("const QString &")
+ def slotArgCsVerif(self, text):
+ """
+ Input ARG_CS_VERIF option.
+ """
+ self.val_verif = ''
+ self.arg_cs_verif = self.modelArg_cs_verif.dicoV2M[str(text)]
+ arg_verif = self.arg_cs_verif
+
+ if arg_verif == 'standard' : self.val_verif = ''
+ if arg_verif == 'mesh_quality' : self.val_verif = '--quality'
+
+
+ def setArgCsOutput(self):
+ """
+ Put ARG_CS_OUTPUT options from 'lancer' file.
+ """
+ self.val_output = self.default['ARG_CS_OUTPUT']
+ if self.default['ARG_CS_OUTPUT'] == '':
+ self.modelCSOUT1.setItem(str_model='listing')
+ self.modelCSOUT2.setItem(str_model='shunte')
+ else:
+ list = self.default['ARG_CS_OUTPUT'].split()
+ l1 = 0
+ l2 = 0
+ for n in range(len(list)):
+ if list[n] == '--log':
+ l1 = 1
+ if list[n+1] == '0': self.modelCSOUT1.setItem(str_model='standard')
+ if list[n+1] == '1': self.modelCSOUT1.setItem(str_model='listing')
+ if list[n] == '--logp':
+ l2 = 1
+ if list[n+1] == '0': self.modelCSOUT2.setItem(str_model='standard')
+ if list[n+1] == '1': self.modelCSOUT2.setItem(str_model='listing')
+ if list[n+1] == '-1': self.modelCSOUT2.setItem(str_model='shunte')
+ if l1 == 0: self.modelCSOUT1.setItem(str_model='listing')
+ if l2 == 0: self.modelCSOUT2.setItem(str_model='shunte')
+
+
+ @pyqtSignature("const QString &")
+ def slotArgCsOutput(self, text):
+ """
+ Input ARG_CS_OUTPUT options.
+ """
+ self.val_output =''
+ out1 = ''
+ out2 = ''
+ arg_out1 = self.modelCSOUT1.dicoV2M[str(self.comboBox_6.currentText())]
+ arg_out2 = self.modelCSOUT2.dicoV2M[str(self.comboBox_7.currentText())]
+ if arg_out1 == 'listing': out1 = ''
+ if arg_out1 == 'standard': out1 = '--log 0'
+ if arg_out2 == 'shunte': out2 = ''
+ if arg_out2 == 'standard': out2 = '--logp 0'
+ if arg_out2 == 'listing': out2 = '--logp 1'
+ self.val_output = out1 + ' ' + out2
+
+
+ @pyqtSignature("")
+ def slotSearchDirectory(self):
+ """
+ Choice temporary directory for batch
+ """
+ self.dir_name = ''
+
+ title = self.tr("Select directory")
+ default = os.getcwd()
+ options = QFileDialog.ShowDirsOnly # | QFileDialog.DontResolveSymlinks
+ dir_name = QFileDialog.getExistingDirectory(self, title, default, options)
+
+ self.dir_name = str(dir_name)
+ if self.dir_name:
+ self.exe_name = self.dir_name
+ else:
+ self.exe_name = ""
+ self.lineEdit.setText(QString(self.exe_name))
+
+ return self.dir_name
+
+
+ @pyqtSignature("")
+ def slotSearchFile(self):
+ """
+ Choice temporary directory for batch
+ """
+ file_name = ""
+
+ title = self.tr("Select file for use VALGRIND option")
+ path = os.getcwd()
+ filetypes = self.tr("All Files (*)")
+ file_name = QFileDialog.getOpenFileName(self, title, path, filetypes)
+ file_name = str(file_name)
+
+ # TO CHECK ...
+ if file_name:
+ self.valgrind = str(self.lineEdit_3.text())
+ if not self.valgrind:
+ new = file_name + " --tool=memcheck"
+ else:
+ new = ""
+ for i in string.split(self.valgrind):
+ if i == string.split(self.valgrind)[0]:
+ i = file_name
+ new = new + i + ' '
+ self.valgrind = new
+ self.lineEdit_3.setText(QString(self.valgrind))
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ self.result['CS_TMP_PREFIX'] = self.dir_name
+ self.result['EXEC_PREPROCESS'] = self.exe_prepro
+ self.result['EXEC_PARTITION'] = self.exe_partit
+ self.result['EXEC_KERNEL'] = self.exe_kernel
+ self.result['PARTITION_LIST'] = self.partition_list
+ self.result['VALGRIND'] = self.valgrind
+ self.result['CS_LIB_ADD'] = self.cs_lib_add
+ self.result['ARG_CS_VERIF'] = self.val_verif
+ self.result['ARG_CS_OUTPUT'] = self.val_output
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+
+class BatchRunningView(QWidget, Ui_BatchRunningForm):
+ """
+ This class is devoted to the Computer selection.
+ When a new computer is selected, The old data frame is deleted and
+ a new apropriate frame is open.
+ If the batch script file name is known, informations are display
+ in the apropiate widget.
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BatchRunningForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ RuncaseModel(self.case)
+
+ # Combo model
+
+ self.modelArchi = ComboModel(self.comboBoxArchi, 3, 1)
+ self.modelArchi.addItem(self.tr("Workstation"), 'station')
+ self.modelArchi.addItem(self.tr("Cluster with PBS queue system"), 'pbs')
+ self.modelArchi.addItem(self.tr("Cluster with LSF queue system"), 'lsf')
+ self.modelArchi.addItem(self.tr("Cluster with SGE queue system"), 'sge')
+ self.modelArchi.disableItem(str_model='lsf')
+ self.modelArchi.disableItem(str_model='sge')
+
+ # Connections
+
+ self.connect(self.comboBoxArchi, SIGNAL("activated(const QString &)"), self.slotBatchCalculation)
+ self.connect(self.toolButtonSearch, SIGNAL("clicked()"), self.slotSearchBatchScriptFile)
+ self.connect(self.spinBoxProcs, SIGNAL("valueChanged(int)"), self.slotParallelComputing)
+ self.connect(self.toolButtonFiles, SIGNAL("clicked()"), self.slotUserFiles)
+ self.connect(self.toolButtonAdvanced, SIGNAL("clicked()"), self.slotAdvancedOptions)
+ self.connect(self.pushButtonRun, SIGNAL("clicked()"), self.slotBatchRunning)
+
+ # initialize Widgets
+
+ if self.case['computer'] == "":
+ key = 'station'
+ self.case['computer'] = key
+ self.modelArchi.setItem(str_model=key)
+ self.slotBatchCalculation(self.tr('Workstation'))
+ if self.case['scripts_path']:
+ if "runcase" in os.listdir(self.case['scripts_path']):
+ if key in self.case['batchScript']:
+ self.case['batchScript'][key] = "runcase"
+ self.displayBatchScriptInfo()
+ setGreenColor(self.toolButtonSearch, False)
+ else:
+ self.modelArchi.setItem(str_model=self.case['computer'])
+ self.slotBatchCalculation(self.modelArchi.dicoM2V[self.case['computer']])
+
+
+ @pyqtSignature("int")
+ def slotParallelComputing(self, v):
+ """
+ Increment, decrement and colorize the input argument entry
+ """
+ self.mdl.dicoValues['NUMBER_OF_PROCESSORS'] = v
+ self.mdl.updateBatchScriptFile('NUMBER_OF_PROCESSORS')
+
+
+ @pyqtSignature("")
+ def pbsJobManagement(self):
+ """
+ Get PBS card informations.
+ """
+ default = {}
+ list = ['PBS_JOB_NAME', 'PBS_nodes', 'PBS_ppn', 'PBS_walltime', 'PBS_mem']
+ for opt in list:
+ default[opt] = self.mdl.dicoValues[opt]
+ log.debug("pbsJobManagement -> %s" % str(default))
+
+ dialog = BatchRunningPBSJobManagementDialogView(self, default)
+
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("pbsJobManagement -> %s" % str(result))
+ for option in list:
+ self.mdl.dicoValues[option] = result[option]
+
+ self.mdl.updateBatchScriptFile()
+
+ @pyqtSignature("")
+ def lsfJobManagement(self):
+ """
+ Get LSF card informations
+ """
+ pass
+## default = {}
+## default['job_name'] = self.mdl.dicoValues['PBS_JOB_NAME']
+## default['NQS_cput'] =
+## default['NQS_cpuT'] =
+## default['NQS_mem'] =
+## windowTitle = self.tr("CaThy")
+## dialog = LSFJobManagementDialog(self.myPage, title=t.CATHY, default=default)
+##
+## self.job_name = dialog.result['job_name']
+## self.NQS_cpult = dialog.result['NQS_cput']
+## self.NQS_cpulT = dialog.result['NQS_cpuT'] + dialog.result['NQS_cput']
+## self.job_memory = dialog.result['NQS_mem']
+##
+## self.mdl.updateBatchScriptFile()
+
+
+ @pyqtSignature("")
+ def slotUserFiles(self):
+ """
+ Input 'USER_INPUT_FILES' and 'USER_OUTPUT_FILES'
+ """
+ default = {}
+ default['data_path'] = self.case['data_path']
+ default['data'] = string.split(self.mdl.dicoValues['USER_INPUT_FILES'])
+ default['results'] = string.split(self.mdl.dicoValues['USER_OUTPUT_FILES'])
+ log.debug("slotUserFiles -> %s" % str(default))
+
+ dialog = BatchRunningUserFilesDialogView(self, default)
+
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotUserFiles -> %s" % str(result))
+ self.mdl.dicoValues['USER_INPUT_FILES'] = string.join(result['data'])
+ self.mdl.dicoValues['USER_OUTPUT_FILES'] = string.join(result['results'])
+ self.mdl.updateBatchScriptFile('USER_INPUT_FILES')
+ self.mdl.updateBatchScriptFile('USER_OUTPUT_FILES')
+
+
+ @pyqtSignature("")
+ def slotAdvancedOptions(self):
+ """
+ Ask one popup for advanced specifications
+ """
+ default = {}
+ list = ['CS_TMP_PREFIX', 'EXEC_PREPROCESS', 'EXEC_PARTITION', 'EXEC_KERNEL',
+ 'PARTITION_LIST', 'VALGRIND', 'CS_LIB_ADD',
+ 'ARG_CS_VERIF', 'ARG_CS_OUTPUT', ]
+ for option in list:
+ default[option] = self.mdl.dicoValues[option]
+ log.debug("slotAdvancedOptions result = %s "%str(default))
+
+ dialog = BatchRunningAdvancedOptionsDialogView(self, default)
+
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotAdvancedOptions result = %s "%str(result))
+ for option in list:
+ self.mdl.dicoValues[option] = result[option]
+ self.mdl.updateBatchScriptFile(option)
+
+
+ @pyqtSignature("")
+ def slotBatchRunning(self):
+ """
+ Launch Code_Saturne batch running.
+ """
+ # Test 1: is the file saved?
+
+ if self.case['new'] == "yes" or self.case.isModified():
+
+ title = self.tr("Warning")
+ msg = self.tr("The current case must be saved before "\
+ "Code_Saturne batch running.")
+ QMessageBox.information(self, title, msg)
+ return
+# if self.case.saved() == "no":
+# self.case.xmlSaveDocument()
+# self.mdl.dicoValues['PARAM'] = os.path.basename(self.case['xmlfile'])
+# self.mdl.updateBatchScriptFile('PARAM')
+
+ # Test 2: have we a mesh?
+
+ if not GuiParam.matisse :
+ node_ecs = self.case.xmlGetNode('solution_domain')
+ if not node_ecs.xmlGetNode('meshes_list'):
+ if not node_ecs.xmlGetNode('meshes_list').xmlGetNodeList('mesh'):
+ title = self.tr("Warning")
+ msg = self.tr("You have to select a mesh.\n\n")
+ QMessageBox.information(self, title, msg)
+ return
+
+ # Test 3: have we a trouble with the mesh generation?
+
+ if GuiParam.matisse :
+ import Pages.Matisse as Matisse
+ if not Matisse.MatisseMeshRunning(self.case).ok :
+ title = self.tr("Warning")
+ msg = self.tr("Mesh generation error.\nSee the file 'listsim'")
+ QMessageBox.information(self, title, msg)
+ return
+
+ # Test 4: verify if boundary definition exists
+
+## if not GuiParam.matisse:
+## from DefineBoundaryRegionsModel import DefBCModel
+## groupList = DefBCModel(self.case).getListLabel()
+## if not groupList:
+## if self.case['no_boundary_conditions'] == False:
+## title = self.tr("Warning")
+## msg = self.tr("No boundary definition declared.\n\n")
+## QMessageBox.warning(self, title, msg)
+## self.case['no_boundary_conditions'] = True
+
+ if not GuiParam.matisse:
+ bd = LocalizationModel('BoundaryZone', self.case)
+ if not bd.getZones():
+ if self.case['no_boundary_conditions'] == False:
+ title = self.tr("Warning")
+ msg = self.tr("No boundary definition declared.\n\n")
+ QMessageBox.warning(self, title, msg)
+ self.case['no_boundary_conditions'] = True
+
+ # Command line building
+
+ key = self.case['computer']
+
+ script = self.case['scripts_path'] + "/" + self.case['batchScript'][key]
+ batch1 = self.case['scripts_path'] + "/" + "batch"
+ batch2 = batch1 + '~'
+
+ if key == 'station':
+ try:
+ os.rename(batch1, batch2)
+ except:
+ pass
+ cmd = 'nice nohup ' + script + ' | tee ' + batch1 + ' &'
+# FIXME: Work in progress
+## dialog = CalculationDialog(self.master, title=t.BATCH, stbar=self.stbar,
+## script, batch1)
+## cmd = 'nice nohup ' + script + 'dialog' + ' &'
+ elif key == 'pbs':
+ #cmd = 'qsub ' + script + ' ' + self.case['batchScript'][key] + ' &'
+ cmd = 'qsub ' + script
+ elif key == 'lsf':
+ cmd = 'bsub ' + script + ' ' + self.case['batchScript'][key] + ' &'
+ elif key == 'sge':
+ pass
+
+ if self.case['salome']:
+ from SalomeHandler import runSolver
+ cmd = ['nice', 'nohup', script]
+ runSolver(self.case, cmd, self.mdl, batch1)
+ else:
+ os.system(cmd)
+
+
+ def displayBatchScriptInfo(self):
+ """
+ Layout of the second part of this page.
+ """
+ self.groupBoxBatch.show()
+
+ self.labelJob.hide()
+ self.toolButtonJob.hide()
+
+ if hasattr(self, 'mdl'):
+ del self.mdl
+ self.mdl = BatchRunningModel(self.case)
+ self.mdl.readBatchScriptFile()
+
+ self.labelFilename.show()
+ self.computer = self.modelArchi.dicoV2M[str(self.comboBoxArchi.currentText())]
+ name = self.case['batchScript'][self.computer]
+ self.labelFilename.setText(QString(name))
+
+ if self.case['computer'] == 'station':
+ if GuiParam.matisse :
+ self.labelFiles.show()
+ self.toolButtonFiles.show()
+ self.labelProcs.hide()
+ self.spinBoxProcs.hide()
+ else:
+ self.labelFiles.show()
+ self.toolButtonFiles.show()
+ self.labelProcs.show()
+ self.spinBoxProcs.show()
+ else:
+ self.labelProcs.hide()
+ self.spinBoxProcs.hide()
+ self.labelJob.show()
+ self.toolButtonJob.show()
+ if self.case['computer'] == "pbs":
+ self.connect(self.toolButtonJob, SIGNAL("clicked()"), self.pbsJobManagement)
+ if self.case['computer'] == "lsf":
+ self.connect(self.toolButtonJob, SIGNAL("clicked()"), self.lsfJobManagement)
+ if self.case['computer'] == "sge":
+ pass
+
+# self.lineBatch1.show()
+# self.labelAdvanced.show()
+# self.toolButtonAdvanced.show()
+
+ dico = self.mdl.dicoValues
+
+ if dico['NUMBER_OF_PROCESSORS'] == "":
+ dico['NUMBER_OF_PROCESSORS'] = "1"
+ if self.case['computer'] == 'station':
+ self.spinBoxProcs.setValue(int(dico['NUMBER_OF_PROCESSORS']))
+
+ self.mdl.updateBatchScriptFile()
+
+
+ @pyqtSignature("const QString &")
+ def slotBatchCalculation(self, text):
+ """
+ 1) Look if the batch script file name is allready known
+ for the current computer
+ 2) Display the apropriate frame for the selected computer
+ """
+ log.debug("slotBatchCalculation -> %s" % str(text))
+ self.groupBoxBatch.hide()
+
+ key = self.modelArchi.dicoV2M[str(text)]
+ self.case['computer'] = key
+ log.debug("slotBatchCalculation -> %s" % key)
+
+ self.labelLauncher.setEnabled(True)
+
+ if key in self.case['batchScript'] and self.case['batchScript'][key]:
+ self.displayBatchScriptInfo()
+ setGreenColor(self.toolButtonSearch, False)
+ else:
+ self.labelFilename.hide()
+ setGreenColor(self.toolButtonSearch, True)
+
+
+ @pyqtSignature("")
+ def slotSearchBatchScriptFile(self):
+ """
+ Open a FileDialog in order to search the batch script file
+ in the system file.
+ """
+ file_name = ""
+ if self.case['scripts_path'] and os.path.isdir(self.case['scripts_path']):
+ path = self.case['scripts_path']
+ else:
+ path = os.getcwd()
+ title = self.tr("Search the batch script")
+ filetypes = self.tr("All Files (*)")
+ file_name = QFileDialog.getOpenFileName(self, title, path, filetypes)
+ file_name = str(file_name)
+
+ if file_name:
+ launcher = os.path.basename(file_name)
+ setGreenColor(self.toolButtonSearch, False)
+
+ if self.case['scripts_path'] == os.path.dirname(file_name):
+
+ self.computer = self.modelArchi.dicoV2M[str(self.comboBoxArchi.currentText())]
+ key = self.computer
+ if key in self.case['batchScript']:
+ self.case['batchScript'][key] = launcher
+ else:
+ print "Warning: slotSearchBatchScriptFile\n Error with key:", key
+ self.displayBatchScriptInfo()
+ else:
+ title = self.tr("Warning")
+ msg = self.tr("The new batch script file is not in scripts "\
+ "directory given in the 'Identity and paths' "\
+ "section.\n\n" + \
+ "Verify the existence and location of these files, "\
+ "and the 'Identity and Pathes' section")
+ QMessageBox.warning(self, title, msg)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BodyForcesForm.ui b/gui/Pages/BodyForcesForm.ui
new file mode 100644
index 0000000..79d6f25
--- /dev/null
+++ b/gui/Pages/BodyForcesForm.ui
@@ -0,0 +1,273 @@
+<ui version="4.0" >
+ <class>BodyForcesForm</class>
+ <widget class="QWidget" name="BodyForcesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>252</height>
+ </rect>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="title" >
+ <string>Gravity</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelX" >
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Gravity along X</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: GX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitX" >
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>m/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelY" >
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Gravity along Y</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: GY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitY" >
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>m/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelZ" >
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Gravity along Z</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditZ" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: GZ</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="labelUnitZ" >
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>m/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Hydrostatic pressure</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelHPressure" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPHYDR</string>
+ </property>
+ <property name="text" >
+ <string>Pressure interpolation in stratified flow:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QRadioButton" name="radioButtonNo" >
+ <property name="text" >
+ <string>standard</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QRadioButton" name="radioButtonYes" >
+ <property name="text" >
+ <string>improved</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>21</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BodyForcesModel.py b/gui/Pages/BodyForcesModel.py
new file mode 100644
index 0000000..36e9e67
--- /dev/null
+++ b/gui/Pages/BodyForcesModel.py
@@ -0,0 +1,194 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- BodyForcesModel
+- BodyForcesView
+- PageText
+- BodyForcesTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+from math import sqrt
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+
+#-------------------------------------------------------------------------------
+# Body Force model class
+#-------------------------------------------------------------------------------
+
+class BodyForcesModel(Model):
+
+ def __init__(self, case):
+
+ """
+ Constuctor.
+ """
+ self.case = case
+
+ self.node_pp = self.case.xmlGetNode('physical_properties')
+ self.node_gravity = self.node_pp.xmlInitNode('gravity')
+
+ self.nodes = ['gravity_x', 'gravity_y', 'gravity_z']
+
+
+ def defaultBodyForcesValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['gravity'] = 0.0
+ default['status'] = "off"
+
+ return default
+
+
+ def getGravity(self, var):
+ """
+ Return value of gravity for var
+ """
+ self.isInList(var, self.nodes)
+ gravity = self.node_gravity.xmlGetDouble(var)
+ if gravity == None:
+ gravity = self.defaultBodyForcesValues()['gravity']
+ self.setGravity(var, gravity)
+
+ return gravity
+
+
+ def setGravity(self, txml, value):
+ """
+ Put value of gravity for txml balise
+ """
+ self.isInList(txml, self.nodes)
+ self.isFloat(value)
+ self.node_gravity.xmlSetData(txml, value)
+
+ if self.getGravity('gravity_x') == 0.0 and \
+ self.getGravity('gravity_y') == 0.0 and \
+ self.getGravity('gravity_z') == 0.0:
+ from TimeStepModel import TimeStepModel
+ TimeStepModel(self.case).RemoveThermalTimeStepNode()
+ del TimeStepModel
+
+ def getHydrostaticPressure(self):
+ """
+ Return status of hydrostatic pressure :
+ 'off' if standard, 'on' if improved
+ """
+ node = self.node_pp.xmlInitNode('hydrostatic_pressure', 'status')
+ status = node['status']
+ if not status:
+ status = self.defaultBodyForcesValues()['status']
+ self.setHydrostaticPressure(status)
+ return status
+
+
+ def setHydrostaticPressure(self, var):
+ """
+ Put status of hydrostatic pressure
+ """
+ self.isOnOff(var)
+ node = self.node_pp.xmlInitNode('hydrostatic_pressure', 'status')
+ node['status'] = var
+
+
+#-------------------------------------------------------------------------------
+# BodyForce test case
+#-------------------------------------------------------------------------------
+
+
+class BodyForcesTestCase(ModelTest):
+ """
+ """
+ def checkBodyForcesInstantiation(self):
+ """
+ Check whether the BodyForcesModel class could be instantiated
+ """
+ model = None
+ model = BodyForcesModel(self.case)
+ assert model != None, 'Could not instantiate BodyForcesModel'
+
+ def checkGetandSetGravity(self):
+ """
+ Check whether the gravity terms could be set and get
+ """
+ mdl = BodyForcesModel(self.case)
+ mdl.setGravity('gravity_x', 1.1)
+ mdl.setGravity('gravity_y', 2.2)
+ mdl.setGravity('gravity_z', 3.3)
+ doc = '''<gravity>
+ <gravity_x>1.1</gravity_x>
+ <gravity_y>2.2</gravity_y>
+ <gravity_z>3.3</gravity_z>
+ </gravity>'''
+ assert mdl.node_gravity == self.xmlNodeFromString(doc), \
+ 'Could not set gravity'
+ assert mdl.getGravity('gravity_y') == 2.2, 'Could not get gravity'
+
+ def checkGetandSetHydrostaticPressure(self):
+ """
+ Check whether the hydrostatic pressure could be set and get
+ """
+ mdl = BodyForcesModel(self.case)
+ mdl.setHydrostaticPressure('on')
+ n = mdl.node_pp.xmlGetNode('hydrostatic_pressure')
+ doc = '''<hydrostatic_pressure status="on"/>'''
+ assert n == self.xmlNodeFromString(doc), \
+ 'Could not set hydrostatic pressure'
+ assert mdl.getHydrostaticPressure() == 'on',\
+ 'Could not get hydrostatic pressure'
+
+
+def suite():
+ testSuite = unittest.makeSuite(BodyForcesTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "BodyForcesTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/BodyForcesView.py b/gui/Pages/BodyForcesView.py
new file mode 100644
index 0000000..590082c
--- /dev/null
+++ b/gui/Pages/BodyForcesView.py
@@ -0,0 +1,181 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- BodyForcesView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from BodyForcesForm import Ui_BodyForcesForm
+import Base.QtPage as QtPage
+from BodyForcesModel import BodyForcesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BodyForcesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BodyForcesView(QWidget, Ui_BodyForcesForm):
+ """
+ Class to open the Body Forces (gravity) Page.
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BodyForcesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = BodyForcesModel(self.case)
+
+ # Connections
+
+ self.connect(self.lineEditX, SIGNAL("textChanged(const QString &)"), self.slotGravityX)
+ self.connect(self.lineEditY, SIGNAL("textChanged(const QString &)"), self.slotGravityY)
+ self.connect(self.lineEditZ, SIGNAL("textChanged(const QString &)"), self.slotGravityZ)
+ self.connect(self.radioButtonYes, SIGNAL("clicked()"), self.slotHydrostaticPressure)
+ self.connect(self.radioButtonNo, SIGNAL("clicked()"), self.slotHydrostaticPressure)
+
+ # Validators
+ validatorX = QtPage.DoubleValidator(self.lineEditX)
+ validatorY = QtPage.DoubleValidator(self.lineEditY)
+ validatorZ = QtPage.DoubleValidator(self.lineEditZ)
+
+ self.lineEditX.setValidator(validatorX)
+ self.lineEditY.setValidator(validatorY)
+ self.lineEditZ.setValidator(validatorZ)
+
+ # Initialization
+
+ if self.mdl.getHydrostaticPressure() == "on":
+ self.radioButtonYes.setChecked(True)
+ self.radioButtonNo.setChecked(False)
+ else:
+ self.radioButtonYes.setChecked(False)
+ self.radioButtonNo.setChecked(True)
+
+ gravity_x = self.mdl.getGravity(self.mdl.nodes[0])
+ gravity_y = self.mdl.getGravity(self.mdl.nodes[1])
+ gravity_z = self.mdl.getGravity(self.mdl.nodes[2])
+
+ self.lineEditX.setText(QString(str(gravity_x)))
+ self.lineEditY.setText(QString(str(gravity_y)))
+ self.lineEditZ.setText(QString(str(gravity_z)))
+
+
+ @pyqtSignature("const QString&")
+ def slotGravityX(self, text):
+ """
+ Input GX
+ """
+ gravity_x, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setGravity('gravity_x', gravity_x)
+
+
+ @pyqtSignature("const QString&")
+ def slotGravityY(self, text):
+ """
+ Input GY
+ """
+ gravity_y, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setGravity('gravity_y', gravity_y)
+
+
+ @pyqtSignature("const QString&")
+ def slotGravityZ(self, text):
+ """
+ Input GZ
+ """
+ gravity_z, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setGravity('gravity_z', gravity_z)
+
+
+ @pyqtSignature("")
+ def slotHydrostaticPressure(self):
+ """
+ Input IHYDPR.
+ """
+ if self.radioButtonYes.isChecked():
+ hpr = 'on'
+ else:
+ hpr = 'off'
+ self.mdl.setHydrostaticPressure(hpr)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/Boundary.py b/gui/Pages/Boundary.py
new file mode 100644
index 0000000..22d2eb5
--- /dev/null
+++ b/gui/Pages/Boundary.py
@@ -0,0 +1,3707 @@
+# -*- coding: utf-8 -*-
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+from Base.XMLengine import *
+from Pages.DefineUserScalarsModel import DefineUserScalarsModel
+from Pages.ThermalScalarModel import ThermalScalarModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("Boundary")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class Boundary(object) :
+ """
+ Abstract class
+ """
+ def __new__(cls, nature , label, case) :
+ """
+ Factory
+ """
+ if nature == 'inlet':
+ return InletBoundary.__new__(InletBoundary, label, case)
+ elif nature == 'coal_inlet':
+ from CoalCombustionModel import CoalCombustionModel
+ Model().isNotInList(CoalCombustionModel(case).getCoalCombustionModel(), ("off",))
+ return CoalInletBoundary.__new__(CoalInletBoundary, label, case)
+ elif nature == 'outlet':
+ return OutletBoundary.__new__(OutletBoundary, label, case)
+ elif nature == 'symmetry':
+ return SymmetryBoundary.__new__(SymmetryBoundary, label, case)
+ elif nature == 'wall':
+ return WallBoundary.__new__(WallBoundary, label, case)
+ elif nature == 'radiative_wall':
+ from ThermalRadiationModel import ThermalRadiationModel
+ Model().isNotInList(ThermalRadiationModel(case).getRadiativeModel(), ("off",))
+ return RadiativeWallBoundary.__new__(RadiativeWallBoundary, label, case)
+ elif nature == 'mobile_boundary':
+ return MobilWallBoundary.__new__(MobilWallBoundary, label, case)
+ elif nature == 'coupling_mobile_boundary':
+ return CouplingMobilWallBoundary.__new__(CouplingMobilWallBoundary, label, case)
+ elif nature == 'meteo_inlet' or nature == 'meteo_outlet':
+ return MeteoBoundary.__new__(MeteoBoundary, label, case)
+ else :
+ raise ValueError, "Unknown boundary nature: " + nature
+
+
+ def __init__(self, nature, label, case) :
+ """
+ """
+ self._label = label
+ self._nature = nature
+ self._case = case
+ self._XMLBoundaryConditionsNode = self._case.xmlGetNode('boundary_conditions')
+ self._thermalLabelsList = ('temperature_celsius', 'temperature_kelvin', 'enthalpy')
+
+ self.sca_model = DefineUserScalarsModel(self._case)
+
+ # Create nodes
+ if nature not in ["coal_inlet",
+ "radiative_wall",
+ "mobile_boundary",
+ "coupling_mobile_boundary",
+ "meteo_inlet",
+ "meteo_outlet"]:
+ self.boundNode = self._XMLBoundaryConditionsNode.xmlInitNode(nature, label = label)
+
+ else:
+ if nature == "coal_inlet":
+ self.boundNode = self._XMLBoundaryConditionsNode.xmlInitNode('inlet', label = label)
+
+ elif nature in ["radiative_wall",
+ "mobile_boundary",
+ "coupling_mobile_boundary"]:
+ self.boundNode = self._XMLBoundaryConditionsNode.xmlInitNode('wall', label = label)
+
+ elif nature == "meteo_inlet":
+ self.boundNode = self._XMLBoundaryConditionsNode.xmlInitNode('inlet', label = label)
+
+ elif nature == "meteo_outlet":
+ self.boundNode = self._XMLBoundaryConditionsNode.xmlInitNode('outlet', label = label)
+
+ self._initBoundary()
+
+
+ def _initBoundary(self):
+ """
+ Initialize the boundary, add nodes in the boundary node (vitual method)
+ """
+ pass
+
+
+ def updateScalarTypeAndName(self, scalarNode, label):
+ """
+ Check and update type and name of scalar labelled label for boundary conditions for wall
+ """
+ #update name and type of scalar
+
+ if self.sca_model.getScalarType(label) == 'thermal':
+ Model().isInList(self.sca_model.getScalarName(label), self._thermalLabelsList)
+ elif self.sca_model.getScalarType(label) == 'user':
+ Model().isInList(self.sca_model.getScalarName(label)[:6], ('scalar'))
+ scalarNode['name'] = self.sca_model.getScalarName(label)
+ scalarNode['type'] = self.sca_model.getScalarType(label)
+
+
+ def getLabel(self):
+ """
+ Return the label
+ """
+ return self._label
+
+
+ def getNature(self):
+ """
+ Return the nature
+ """
+ return self._nature
+
+
+ def delete(self):
+ """
+ Delete Boundary
+ """
+ self.boundNode.xmlRemoveNode()
+
+
+class InletBoundary(Boundary):
+ """
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize the boundary, add nodes in the boundary node
+ """
+ self.__velocityChoices = ['norm', 'flow1', 'flow2',
+ 'norm_formula', 'flow1_formula', 'flow2_formula']
+ self.__directionChoices = ['normal', 'coordinates', 'formula']
+ self.__directionTags = ['direction_x', 'direction_y', 'direction_z', 'direction_formula']
+ self.__turbulenceChoices = ['hydraulic_diameter', 'turbulent_intensity']
+
+ self.th_model = ThermalScalarModel(self._case)
+
+ # Initialize nodes if necessary
+
+ self.getVelocityChoice()
+ self.getDirectionChoice()
+ self.getTurbulenceChoice()
+
+ for label in self.sca_model.getScalarLabelsList():
+ self.getScalar(label)
+
+ from CoalCombustionModel import CoalCombustionModel
+ if CoalCombustionModel(self._case).getCoalCombustionModel() =="off":
+ self.boundNode.xmlRemoveChild('coal')
+ self.boundNode.xmlRemoveChild('temperature')
+
+
+ def __defaultValues(self):
+ """
+ Default values
+ """
+ dico = {}
+ dico['velocityChoice'] = 'norm'
+ dico['directionChoice'] = 'normal'
+ dico['turbulenceChoice'] = 'hydraulic_diameter'
+ dico['hydraulic_diameter'] = 1
+ dico['turbulent_intensity'] = 2
+ dico['velocity'] = 0.0
+ dico['flow1'] = 1
+ dico['flow2'] = 1
+ dico['norm'] = 1
+ dico['flow1_formula'] = "q_m = 1;"
+ dico['flow2_formula'] = "q_v = 1;"
+ dico['norm_formula'] = "u_norm = 1;"
+ dico['direction_x'] = 0.0
+ dico['direction_y'] = 0.0
+ dico['direction_z'] = 0.0
+ dico['direction_formula'] = "dir_x = 1;\ndir_y = 0;\ndir_z = 0;\n"
+ dico['scalar'] = 0.0
+ dico['scalarChoice'] = 'dirichlet'
+
+ return dico
+
+
+ def __initChoiceForVelocityAndDirection(self):
+ """
+ Get the choice of velocity and direction.
+ """
+ node = self.boundNode.xmlInitNode('velocity_pressure', 'choice', 'direction')
+ choice = node['choice']
+ if not choice:
+ choice = self.__defaultValues()['velocityChoice']
+ self.setVelocityChoice(choice)
+ dir = node['direction']
+ if not dir:
+ dir = self.__defaultValues()['directionChoice']
+ self.setDirectionChoice(dir)
+ return choice, dir
+
+
+ def getVelocityChoice(self):
+ """
+ Get the choice of velocity.
+ """
+ choice, dir = self.__initChoiceForVelocityAndDirection()
+ return choice
+
+
+ def getDirectionChoice(self):
+ """
+ Get the choice of direction.
+ """
+ choice, dir = self.__initChoiceForVelocityAndDirection()
+ return dir
+
+
+ def getVelocity(self):
+ """
+ Get value of velocity beyond choice.
+ """
+ choice = self.getVelocityChoice()
+ Model().isInList(choice, self.__velocityChoices)
+
+ XMLVelocityNode = self.boundNode.xmlGetNode('velocity_pressure')
+
+ if choice in ('norm', 'flow1', 'flow2'):
+ value = XMLVelocityNode.xmlGetChildDouble(choice)
+ elif choice in ('norm_formula', 'flow1_formula', 'flow2_formula'):
+ value = XMLVelocityNode.xmlGetChildString(choice)
+ if value == None:
+ value = self.__defaultValues()[choice]
+ self.setVelocity(value)
+
+ return value
+
+
+ def setVelocity(self, value):
+ """
+ Set value of velocity.
+ """
+ choice = self.getVelocityChoice()
+ Model().isInList(choice, self.__velocityChoices)
+
+ if choice in ('norm', 'flow1', 'flow2'):
+ Model().isFloat(value)
+
+ XMLVelocityNode = self.boundNode.xmlInitNode('velocity_pressure')
+ XMLVelocityNode.xmlSetData(choice, value)
+
+
+ def getDirection(self, component):
+ """
+ Get the component velocity
+ """
+ Model().isInList(component, self.__directionTags)
+
+ XMLVelocityNode = self.boundNode.xmlGetNode('velocity_pressure')
+
+ if XMLVelocityNode['direction'] == 'coordinates':
+ Model().isInList(component, ('direction_x', 'direction_y', 'direction_z'))
+ value = XMLVelocityNode.xmlGetChildDouble(component)
+ elif XMLVelocityNode['direction'] == 'formula':
+ Model().isInList(component, ('direction_formula',))
+ value = XMLVelocityNode.xmlGetChildString(component)
+
+ if value == None :
+ value = self.__defaultValues()[component]
+ self.setDirection(component, value)
+ return value
+
+
+ def setDirection(self, component, value):
+ """
+ Set the component velocity for fieldLabel
+ """
+ Model().isInList(component, self.__directionTags)
+ if component != 'direction_formula':
+ Model().isFloat(value)
+
+ XMLVelocityNode = self.boundNode.xmlInitNode('velocity_pressure')
+ XMLVelocityNode.xmlSetData(component, value)
+
+
+ def setVelocityChoice(self, value):
+ """
+ Set the velocity definition according to choice
+ """
+ Model().isInList(value, self.__velocityChoices)
+
+ # Check if value is a new velocity choice value
+ XMLVelocityNode = self.boundNode.xmlInitNode('velocity_pressure')
+ if XMLVelocityNode['choice'] != None :
+ if XMLVelocityNode['choice'] == value:
+ return
+
+ # Update velocity choice
+ XMLVelocityNode['choice'] = value
+ self.getVelocity()
+
+ for tag in self.__velocityChoices:
+ if tag != value:
+ XMLVelocityNode.xmlRemoveChild(tag)
+
+
+ def setDirectionChoice(self, value):
+ """
+ Set the direction of the flow definition according to choice.
+ """
+ Model().isInList(value, self.__directionChoices)
+
+ # Check if value is a new direction choice
+ XMLVelocityNode = self.boundNode.xmlInitNode('velocity_pressure')
+ if XMLVelocityNode['direction'] != None :
+ if XMLVelocityNode['direction'] == value:
+ return
+
+ # Update direction choice
+ XMLVelocityNode['direction'] = value
+
+ if value == 'coordinates':
+ self.getDirection('direction_x')
+ self.getDirection('direction_y')
+ self.getDirection('direction_z')
+ XMLVelocityNode.xmlRemoveChild('direction_formula')
+
+ elif value == 'formula':
+ self.getDirection('direction_formula')
+ for tag in ('direction_x', 'direction_y', 'direction_z'):
+ XMLVelocityNode.xmlRemoveChild(tag)
+
+
+ def getTurbulenceChoice(self):
+ """
+ Get the turbulence choice
+ """
+ XMLTurbulenceNode = self.boundNode.xmlInitNode('turbulence')
+
+ choice = XMLTurbulenceNode['choice']
+ if choice not in self.__turbulenceChoices :
+ choice = self.__defaultValues()['turbulenceChoice']
+ self.setTurbulenceChoice(choice)
+
+ return choice
+
+
+ def setTurbulenceChoice(self, value):
+ """
+ Set the choice turbulence
+ """
+ Model().isInList(value, self.__turbulenceChoices)
+
+ XMLTurbulenceNode = self.boundNode.xmlInitNode('turbulence')
+
+ if XMLTurbulenceNode['choice'] != None:
+ if XMLTurbulenceNode['choice'] == value:
+ return
+
+ XMLTurbulenceNode['choice'] = value
+
+ # Update values
+ if value == 'hydraulic_diameter' :
+ self.getHydraulicDiameter()
+ XMLTurbulenceNode.xmlRemoveChild('turbulent_intensity')
+
+ elif value == 'turbulent_intensity' :
+ self.getHydraulicDiameter()
+ self.getTurbulentIntensity()
+
+
+ def getHydraulicDiameter(self):
+ """
+ Get hydraulic diameter
+ """
+ XMLTurbulenceNode = self.boundNode.xmlInitNode('turbulence')
+ Model().isInList(XMLTurbulenceNode['choice'], self.__turbulenceChoices)
+ value = XMLTurbulenceNode.xmlGetDouble('hydraulic_diameter')
+ if value == None :
+ value = self.__defaultValues()['hydraulic_diameter']
+ self.setHydraulicDiameter(value)
+ return value
+
+
+ def setHydraulicDiameter(self, value):
+ """
+ Set hydraulic diameter
+ """
+ Model().isStrictPositiveFloat(value)
+
+ XMLTurbulenceNode = self.boundNode.xmlInitNode('turbulence')
+ Model().isInList(XMLTurbulenceNode['choice'], self.__turbulenceChoices)
+ XMLTurbulenceNode.xmlSetData('hydraulic_diameter', value)
+
+
+ def getTurbulentIntensity(self):
+ """
+ Get turbulent intensity
+ """
+ XMLTurbulenceNode = self.boundNode.xmlInitNode('turbulence')
+ Model().isInList(XMLTurbulenceNode['choice'], ('turbulent_intensity',))
+ value = XMLTurbulenceNode.xmlGetDouble('turbulent_intensity')
+ if value == None :
+ value = self.__defaultValues()['turbulent_intensity']
+ self.setTurbulentIntensity(value)
+
+ return value
+
+
+ def setTurbulentIntensity(self, value):
+ """
+ Set turbulent intensity
+ """
+ Model().isStrictPositiveFloat(value)
+
+ XMLTurbulenceNode = self.boundNode.xmlInitNode('turbulence')
+ Model().isInList(XMLTurbulenceNode['choice'], ('turbulent_intensity',))
+ XMLTurbulenceNode.xmlSetData('turbulent_intensity', value)
+
+
+ def getScalar(self, scalarLabel) :
+ """
+ Get scalar value
+ """
+ Model().isInList(scalarLabel, self.sca_model.getScalarLabelsList())
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', choice="dirichlet", label=scalarLabel)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, scalarLabel)
+
+ value = scalarNode.xmlGetChildDouble('dirichlet')
+ if value == None :
+ value = self.__defaultValues()['scalar']
+ self.setScalar(scalarLabel, value)
+ return value
+
+
+ def setScalar(self, scalarLabel, value):
+ """
+ Set scalar value
+ """
+ Model().isInList(scalarLabel, self.sca_model.getScalarLabelsList())
+ Model().isFloat(value)
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', choice="dirichlet", label=scalarLabel)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, scalarLabel)
+
+ scalarNode.xmlSetData('dirichlet', value)
+
+
+ def getScalarImposedValue(self, label):
+ return self.getScalar(label)
+
+
+ def setScalarImposedValue(self, label, value):
+ self.setScalar(label, value)
+
+
+#-------------------------------------------------------------------------------
+# Atmospheric flow inlet/outlet boundary.
+#-------------------------------------------------------------------------------
+
+class MeteoBoundary(Boundary) :
+ """
+ Atmospheric flow inlet/outlet boundary.
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def __defaultValues(self):
+ """
+ Default values
+ """
+ dico = {}
+ dico['meteo_data'] = 'off'
+ dico['meteo_automatic'] = 'off'
+
+ return dico
+
+
+ def getMeteoDataStatus(self):
+ """
+ Return if one reads the meteorological data.
+ """
+ node = self.boundNode.xmlInitNode('velocity_pressure').xmlInitNode('meteo_data')
+ if node['status'] == None:
+ self.setMeteoDataStatus (self.__defaultValues()['meteo_data'])
+ return node['status']
+
+
+ def setMeteoDataStatus(self, status):
+ """
+ """
+ Model().isOnOff(status)
+ self.boundNode.xmlInitNode('velocity_pressure').xmlInitNode('meteo_data')['status'] = status
+
+
+ def getAutomaticNatureStatus(self):
+ """
+ The boundary could be set to an inlet or an outlet automaticaly.
+ """
+ node = self.boundNode.xmlInitNode('velocity_pressure').xmlInitNode('meteo_automatic')
+ if node['status'] == None:
+ self.setMeteoDataStatus (self.__defaultValues()['meteo_automatic'])
+ return node['status']
+
+
+ def setAutomaticNatureStatus(self, status):
+ """
+ The boundary could be set to an inlet or an outlet automaticaly.
+ """
+ Model().isOnOff(status)
+ self.boundNode.xmlInitNode('velocity_pressure').xmlInitNode('meteo_automatic')['status'] = status
+
+#-------------------------------------------------------------------------------
+# Coal flow inlet boundary
+#-------------------------------------------------------------------------------
+
+class CoalInletBoundary(InletBoundary) :
+ """
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize the boundary, add nodes in the boundary node
+ """
+ InletBoundary._initBoundary(self)
+ self.typeList = ['oxydantFlow', 'coalFlow']
+
+ self.__updateCoalInfo()
+
+ # Initialize nodes if necessary
+ type = self.getInletType()
+ self.setInletType(type)
+
+
+ def __updateCoalInfo(self):
+ from CoalThermoChemistry import CoalThermoChemistryModel
+ coalThermoChModel = CoalThermoChemistryModel("dp_FCP", self._case)
+ self.coalNumber = coalThermoChModel.getCoals().getCoalNumber()
+ log.debug("__updateCoalInfo coalNumber: %i " % self.coalNumber)
+ self.coalClassesNumber = []
+ for c in range(0, self.coalNumber):
+ self.coalClassesNumber.append(coalThermoChModel.getCoals().getCoal(c+1).getClassesNumber())
+ log.debug("__updateCoalInfo number of classes: %i " % self.coalClassesNumber[c])
+
+
+ def __deleteCoalNodes(self):
+ """
+ Delete all nodes udes for coal. Private method
+ """
+ node = self.boundNode.xmlGetNode('velocity_pressure')
+ for n in node.xmlGetChildNodeList('coal'):
+ n.xmlRemoveNode()
+
+
+ def __getClassCoalRatio(self, coal, classe):
+ """
+ Return ratio for classe for coal. Private method
+ """
+ Model().isInt(coal)
+ Model().isInt(classe)
+
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ num = '%2.2i' % (coal+1)
+ nc = n.xmlInitNode('coal', name="coal"+num)
+ num = '%2.2i' % (classe+1)
+ nratio = nc.xmlGetChildNode('ratio', name="class"+num)
+ if nratio:
+ ratio = nc.xmlGetChildDouble('ratio', name="class"+num)
+ else:
+ #self.__updateCoalInfo()
+ if self.coalClassesNumber[coal] > 1:
+ if classe == 0:
+ ratio = 100.
+ self.__setClassCoalRatio(ratio, coal, classe)
+ else:
+ ratio = self.__defaultValues()['ratio']
+ self.__setClassCoalRatio(ratio, coal, classe)
+ else:
+ ratio = 100.
+ self.__setClassCoalRatio(ratio, coal, classe)
+
+ return ratio
+
+
+ def __setClassCoalRatio(self, value, coal, classe):
+ """
+ Put value of ratio when several classes for coal. Private method
+ """
+ Model().isFloat(value)
+ Model().isLowerOrEqual(value, 100.)
+ Model().isInt(coal)
+
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ num = '%2.2i' % (coal+1)
+ nc = n.xmlInitNode('coal', name="coal"+ num)
+
+ num = '%2.2i' % (classe+1)
+ nc.xmlSetData('ratio', value, name="class"+ num)
+
+
+ def __defaultValues(self):
+ """
+ Default values
+ """
+ dico = {}
+ dico['flow'] = 1.0
+ dico['ratio'] = 0.0
+ dico['oxydant'] = 1
+ from ReferenceValuesModel import ReferenceValuesModel
+ dico['temperature'] = ReferenceValuesModel(self._case).getTemperature()
+
+ return dico
+
+
+ def getInletType(self):
+ """
+ Return type (oxydant or oxydant+coal) for velocities's boundary conditions for inlet coal flow.
+ """
+ if self.boundNode.xmlGetNode('velocity_pressure').xmlGetChildNodeList('coal'):
+ type = "coalFlow"
+ else:
+ type = "oxydantFlow"
+ return type
+
+
+ def setInletType(self, type):
+ """
+ Set type (oxydant or oxydant+coal) for velocities's boundary conditions for inlet coal flow.
+ """
+ Model().isInList(type, self.typeList)
+
+ self.getOxydantTemperature()
+
+ if type == "oxydantFlow":
+ self.__deleteCoalNodes()
+ elif type == "coalFlow":
+ #self.__updateCoalInfo()
+ for coal_idx in range(0, self.coalNumber):
+ self.getCoalFlow(coal_idx)
+ self.getCoalTemperature(coal_idx)
+ self.getCoalRatios(coal_idx)
+
+
+ def getCoalFlow(self, coal_idx):
+ """
+ Return value of flow for coal
+ """
+ Model().isInt(coal_idx)
+
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ num = '%2.2i' % (coal_idx+1)
+ n2 = n.xmlInitNode('coal', name = "coal"+num)
+ flow = n2.xmlGetDouble('flow1')
+ if flow == None:
+ flow = self.__defaultValues()['flow']
+ self.setCoalFlow(flow, coal_idx)
+
+ return flow
+
+
+ def setCoalFlow(self, value, coal):
+ """
+ Put value of flow for coal
+ """
+ Model().isFloat(value)
+ Model().isInt(coal)
+
+ num = '%2.2i' % (coal+1)
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ n.xmlInitNode('coal', name = "coal"+num).xmlSetData('flow1', value)
+
+
+ def getOxydantTemperature(self):
+ """
+ Return value of the temperature for oxydant for coal choice
+ """
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ temperature = n.xmlGetChildDouble('temperature')
+ if temperature == None:
+ temperature = self.__defaultValues()['temperature']
+ self.setOxydantTemperature(temperature)
+
+ return temperature
+
+
+ def setOxydantNumber(self, value):
+ """
+ Set value of the oxydant number.
+ """
+ Model().isInt(value)
+ self.boundNode.xmlInitNode('velocity_pressure').xmlSetData('oxydant',value)
+
+
+ def getOxydantNumber(self):
+ """
+ Return value of oxydant number.
+ """
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ oxydant = n.xmlGetInt('oxydant')
+ if oxydant == None:
+ oxydant = self.__defaultValues()['oxydant']
+ self.setOxydantNumber(oxydant)
+
+ return oxydant
+
+
+ def setOxydantTemperature(self, value):
+ """
+ Set value of the temperature for oxydant for coal choice
+ """
+ Model().isFloat(value)
+ self.boundNode.xmlInitNode('velocity_pressure').xmlSetData('temperature',value)
+
+
+ def getCoalTemperature(self, coal):
+ """
+ Return value of temperature for coal for coal choice
+ """
+ Model().isInt(coal)
+
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ num = '%2.2i' % (coal+1)
+ nt = n.xmlInitNode('coal', name="coal"+ num)
+ temperature = nt.xmlGetChildDouble('temperature')
+ if temperature == None:
+ temperature = self.__defaultValues()['temperature']
+ self.setCoalTemperature(temperature, coal)
+
+ return temperature
+
+
+ def setCoalTemperature(self, value, coal_idx):
+ """
+ Put value of temperature for coal for coal choice
+ """
+ Model().isFloat(value)
+ Model().isInt(coal_idx)
+
+ num = '%2.2i' % (coal_idx+1)
+ n = self.boundNode.xmlInitNode('velocity_pressure')
+ n.xmlInitNode('coal', name="coal"+ num).xmlSetData('temperature',value)
+
+
+ def getCoalRatios(self, coal_idx):
+ """
+ Put list of values of classe's ratio for one coal
+ """
+ Model().isInt(coal_idx)
+ #self.__updateCoalInfo()
+ Model().isLowerOrEqual(coal_idx, self.coalNumber-1)
+
+ list = []
+ for i in range(0, self.coalClassesNumber[coal_idx]):
+ list.append(self.__getClassCoalRatio(coal_idx, i))
+
+ # check if sum of ratios of coal mass is equal to 100%
+ som = 0.
+ for i in range(0, self.coalClassesNumber[coal_idx]):
+ som += list[i]
+ Model().isFloatEqual(som, 100.)
+
+ return list
+
+
+ def setCoalRatios(self, coal, list):
+ """
+ Put list of values of classe's ratio for one coal
+ """
+ #self.__updateCoalInfo()
+ Model().isInt(coal)
+ Model().isIntEqual(len(list), self.coalClassesNumber[coal])
+ som = 0.
+ for i in range(0, self.coalClassesNumber[coal]):
+ som += list[i]
+ Model().isFloatEqual(som, 100.)
+
+ n = self.boundNode.xmlInitNode('velocity_pressure')
+ num = '%2.2i' % (coal+1)
+ nc = n.xmlInitNode('coal', name="coal"+ num)
+
+ for i in range(0, len(list)):
+ num = '%2.2i' % (i+1)
+ nc.xmlSetData('ratio', list[i], name="class"+ num)
+
+
+ def deleteCoalFlow(self, coal, nbCoals):
+ """
+ Delete coal with name = coal.
+ Usefull only for CoalCombustionView.
+ """
+ Model().isInt(coal)
+ Model().isInt(nbCoals)
+
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ if n:
+ num = '%2.2i' % (coal+1)
+ n2 = n.xmlGetNode('coal', name="coal"+ num)
+ # delete coal
+ if n2:
+ n2.xmlRemoveNode()
+ # rename other coals
+ for icoal in range(coal+1, nbCoals):
+ self.__renameCoalFlow(icoal)
+
+
+ def __renameCoalFlow(self, coal):
+ """
+ coaln become coaln-1.
+ Usefull only for CoalCombustionView.
+ """
+ Model().isInt(coal)
+
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ if n:
+ num = '%2.2i' % (coal+1)
+ newNum = '%2.2i' % coal
+ n2 = n.xmlGetNode('coal', name="coal"+ num)
+ if n2:
+ n2['name'] = "coal"+newNum
+
+
+ def updateCoalRatios(self, coal):
+ """
+ Delete ratio with name = classe. Usefull only for CoalCombustionView.
+ """
+ Model().isInt(coal)
+
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ if n:
+ num = '%2.2i' % (coal+1)
+ n2 = n.xmlGetNode('coal', name="coal"+num)
+ if n2:
+ n2.xmlRemoveChild('ratio')
+
+ self.getCoalRatios(coal)
+
+
+ def deleteCoals(self):
+ """
+ Delete all information of coal combustion in boundary conditions.
+ """
+ n = self.boundNode.xmlGetNode('velocity_pressure')
+ n.xmlRemoveChild('oxydant')
+ n.xmlRemoveChild('coal')
+ n.xmlRemoveChild('temperature')
+
+#-------------------------------------------------------------------------------
+# Outlet boundary
+#-------------------------------------------------------------------------------
+
+class OutletBoundary(Boundary) :
+ """
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize the boundary, add nodes in the boundary node
+ """
+ self._scalarChoicesList = ['dirichlet', 'neumann']
+
+ self.getReferencePressure()
+
+ for label in self.sca_model.getScalarLabelsList():
+ self.getScalar(label)
+
+
+ def __deleteScalarNodes(self, label, tag):
+ """
+ Delete nodes of scalars
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(tag, self._scalarChoicesList)
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ for tt in self._scalarChoicesList:
+ if tt != tag:
+ scalarNode.xmlRemoveChild(tt)
+
+
+ def __defaultValues(self):
+ """
+ Default values
+ """
+ dico = {}
+ from ReferenceValuesModel import ReferenceValuesModel
+ dico['reference_pressure'] = ReferenceValuesModel(self._case).getPressure()
+ dico['scalarChoice'] = 'neumann'
+ dico['scalar'] = 0.
+
+ return dico
+
+
+ def getScalarChoice(self, label):
+ """
+ Get scalar choice
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update type and name of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ choice = scalarNode['choice']
+ if not choice:
+ choice = self.__defaultValues()['scalarChoice']
+ self.setScalarChoice(label, choice)
+
+ return choice
+
+
+ def setScalarChoice(self, label, choice) :
+ """
+ Set scalar choice
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(choice, self._scalarChoicesList)
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ if scalarNode['choice'] == choice:
+ return
+
+ scalarNode['choice'] = choice
+ if choice == 'dirichlet':
+ self.getScalar(label)
+ self.__deleteScalarNodes(label, 'dirichlet')
+ elif choice == 'neumann':
+ self.setScalar(label, 0.)
+ self.__deleteScalarNodes(label, 'neumann')
+
+
+ def getScalar(self, label) :
+ """
+ Get variableName variable
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ choice = self.getScalarChoice(label)
+
+ value = scalarNode.xmlGetChildDouble(choice)
+ if value == None :
+ value = self.__defaultValues()['scalar']
+ self.setScalar(label, value)
+ return value
+
+
+ def setScalar(self, label, value) :
+ """
+ Set variableName variable
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isFloat(value)
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ choice = self.getScalarChoice(label)
+ if choice == 'neumann':
+ Model().isInList(value, (0.,))
+ Model().isInList(choice, self._scalarChoicesList)
+
+ scalarNode.xmlSetData(choice, value)
+
+
+ def getScalarImposedValue(self, label):
+ Model().isInList(self.getScalarChoice(label), ('dirichlet',))
+ return self.getScalar(label)
+
+
+ def setScalarImposedValue(self, label, value):
+ Model().isInList(self.getScalarChoice(label), ('dirichlet',))
+ self.setScalar(label, value)
+
+
+ def getScalarImposedFlux(self, label):
+ Model().isInList(self.getScalarChoice(label), ('neumann',))
+ return self.getScalar(label)
+
+
+ def setScalarImposedFlux(self, label, value):
+ Model().isInList(self.getScalarChoice(label), ('neumann',))
+ self.setScalar(label, value)
+
+
+ def getPressureChoice(self) :
+ """
+ Return if the value of pressure exist or not of boundary conditions for outlet.
+ """
+ choice = "off"
+ if self.boundNode.xmlGetChildNode('dirichlet', name='reference_pressure'):
+ choice = "on"
+
+ return choice
+
+
+ def setPressureChoice(self, choice) :
+ """
+ Set balise of pressure beyond the choice for boundary conditions for outlet
+ """
+ Model().isOnOff(choice)
+ if choice == 'off':
+ self.setReferencePressure(self, 0.0)
+ else:
+ if node.xmlGetDouble('dirichlet', name='pressure') == None:
+ self.setReferencePressure(self.__defaultValues()['pressure'])
+
+
+ def getReferencePressure(self) :
+ """
+ Get reference pressure
+ """
+ pressure = self.boundNode.xmlGetDouble('dirichlet', name='pressure')
+ if pressure == None:
+ return 0
+
+ return pressure
+
+
+ def setReferencePressure(self, value) :
+ """
+ Set reference pressure
+ """
+ Model().isPositiveFloat(value)
+
+ node = self.boundNode.xmlInitNode('dirichlet', name='pressure')
+ if value == 0:
+ node.xmlRemoveNode()
+ else:
+ self.boundNode.xmlSetData('dirichlet', value, name='pressure')
+
+
+#-------------------------------------------------------------------------------
+# Symmetry boundary
+#-------------------------------------------------------------------------------
+
+class SymmetryBoundary(Boundary) :
+ """
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize the boundary, add nodes in the boundary node
+ """
+ pass
+
+#-------------------------------------------------------------------------------
+# Wall boundary
+#-------------------------------------------------------------------------------
+
+class WallBoundary(Boundary) :
+ """
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize the boundary, add nodes in the boundary node
+ """
+ self._fluxChoices=['temperature', 'flux']
+ self._scalarChoices = ['dirichlet', 'neumann', 'exchange_coefficient']
+
+ # Initialize nodes if necessary
+ self.getVelocityChoice()
+ self.getRoughnessChoice()
+
+ # Scalars
+ for label in self.sca_model.getScalarLabelsList():
+ self.getScalarChoice(label)
+
+
+ def __deleteVelocities(self, node):
+ """
+ Delete nodes of velocity
+ """
+ node.xmlRemoveChild('dirichlet', name='velocity_U')
+ node.xmlRemoveChild('dirichlet', name='velocity_V')
+ node.xmlRemoveChild('dirichlet', name='velocity_W')
+
+
+ def __deleteScalarNodes(self, label, tag):
+ """
+ Delete nodes of scalars
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(tag, self._scalarChoices)
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ if tag == 'exchange_coefficient':
+ scalarNode.xmlRemoveChild('dirichlet')
+ else:
+ for tt in ('dirichlet', 'neumann'):
+ if tt != tag:
+ scalarNode.xmlRemoveChild(tt)
+ scalarNode.xmlRemoveChild('exchange_coefficient')
+
+
+ def __defaultValues(self):
+ """
+ Default values
+ """
+ dico = {}
+ dico['velocityChoice'] = "off"
+ dico['velocityValue'] = 0.
+ dico['scalarChoice'] = "neumann"
+ dico['scalarValue'] = 0.
+ dico['roughness'] = 0.01
+ dico['flux'] = 0
+ return dico
+
+
+ def getVelocityChoice(self):
+ """
+ Get the velocity choice
+ """
+ node = self.boundNode.xmlInitNode('velocity_pressure', 'choice')
+ choice = node['choice']
+ if not choice:
+ choice = self.__defaultValues()['velocityChoice']
+ self.setVelocityChoice(choice)
+ return node['choice']
+
+
+ def setVelocityChoice(self, choice):
+ """
+ Set the velocity choice
+ """
+ Model().isOnOff(choice)
+ #
+ # Check if value is a new velocity choice value
+ XMLVelocityNode = self.boundNode.xmlInitNode('velocity_pressure')
+
+ if XMLVelocityNode['choice'] == choice:
+ return
+
+ # Update velocity choice
+ XMLVelocityNode['choice'] = choice
+ #
+ # Velocities updating
+ if choice == 'on':
+ # Create norm node if necessary
+ self.getVelocities()
+ else:
+ # Delete 'flow1', 'flow2' and 'direction' nodes
+ self.__deleteVelocities(XMLVelocityNode)
+
+
+ def getVelocities(self):
+ """
+ Set the velocity definition according to choice
+ """
+ node = self.boundNode.xmlInitNode('velocity_pressure')
+ Model().isInList(node['choice'],('on',))
+
+ n = node.xmlGetChildNode('dirichlet', name='velocity_U')
+ if n:
+ u = node.xmlGetChildDouble('dirichlet', name='velocity_U')
+ else:
+ u = self.__defaultValues()['velocityValue']
+ n = node.xmlGetChildNode('dirichlet', name='velocity_V')
+ if n:
+ v = node.xmlGetChildDouble('dirichlet', name='velocity_V')
+ else:
+ v = self.__defaultValues()['velocityValue']
+ n = node.xmlGetChildNode('dirichlet', name='velocity_W')
+ if n:
+ w = node.xmlGetChildDouble('dirichlet', name='velocity_W')
+ else:
+ w = self.__defaultValues()['velocityValue']
+ self.setVelocities(u, v, w)
+
+ return u, v, w
+
+
+ def setVelocities(self, u, v, w):
+ """
+ Set the velocity definition according to choice
+ """
+ Model().isFloat(u)
+ Model().isFloat(v)
+ Model().isFloat(w)
+
+ node = self.boundNode.xmlInitNode('velocity_pressure')
+ Model().isInList(node['choice'],('on',))
+
+ node.xmlSetData('dirichlet', u, name='velocity_U')
+ node.xmlSetData('dirichlet', v, name='velocity_V')
+ node.xmlSetData('dirichlet', w, name='velocity_W')
+
+
+ def setVelocityComponent(self, val, component):
+ """
+ Set the value of component of the velocity - Method for the view
+ """
+ Model().isFloat(val)
+ Model().isInList(component, ('velocity_U', 'velocity_V', 'velocity_W'))
+ node = self.boundNode.xmlInitNode('velocity_pressure')
+ Model().isInList(node['choice'], ('on', 'off'))
+
+ node.xmlSetData('dirichlet', val, name=component)
+
+
+ def getRoughnessChoice(self):
+ """
+ Return if the value of roughness height exist or not of boundary conditions for wall.
+ """
+ choice = "off"
+ node = self.boundNode.xmlInitNode('velocity_pressure')
+ if node.xmlGetChildNode('roughness'):
+ choice = "on"
+
+ return choice
+
+
+ def setRoughnessChoice(self, choice):
+ """
+ Update balise of roughness beyond the choice for boundary conditions for wall.
+ """
+ Model().isOnOff(choice)
+ node = self.boundNode.xmlInitNode('velocity_pressure')
+ if choice == 'off':
+ self.setRoughness(0.0)
+ else:
+ if node.xmlGetDouble('roughness') == None:
+ self.setRoughness(self.__defaultValues()['roughness'])
+
+
+ def getRoughness(self):
+ """
+ Get the value of roughness height if it's exist of boundary conditions for wall.
+ """
+ node = self.boundNode.xmlInitNode('velocity_pressure')
+
+ val = node.xmlGetDouble('roughness')
+ if val == None:
+ return 0
+
+ return val
+
+
+ def setRoughness(self, value):
+ """
+ Put value of roughness height in xmlfile
+ """
+ Model().isGreaterOrEqual(value, 0.)
+
+ node = self.boundNode.xmlInitNode('velocity_pressure', 'choice')
+ if value == 0.:
+ node.xmlRemoveChild('roughness')
+ else:
+ node.xmlSetData('roughness', value)
+
+
+ def getScalarChoice(self, label):
+ """
+ Get scalar choice
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update type and name of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ choice = scalarNode['choice']
+ if not choice:
+ choice = self.__defaultValues()['scalarChoice']
+ self.setScalarChoice(label, choice)
+
+ return choice
+
+
+ def setScalarChoice(self, label, choice) :
+ """
+ Set scalar choice
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(choice, self._scalarChoices)
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ if scalarNode['choice'] == choice:
+ return
+
+ scalarNode['choice'] = choice
+ if choice == 'dirichlet':
+ self.getScalarImposedValue(label)
+ self.__deleteScalarNodes(label, 'dirichlet')
+ elif choice == 'neumann':
+ self.getScalarImposedFlux(label)
+ self.__deleteScalarNodes(label, 'neumann')
+ elif choice == 'exchange_coefficient':
+ self.getScalarImposedFlux(label)
+ self.getScalarExchangeCoefficient(label)
+ self.__deleteScalarNodes(label, 'exchange_coefficient')
+
+
+ def getScalar(self, label) :
+ """
+ Get variableName variable
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(self.getScalarChoice(label), ('dirichlet', 'neumann', 'exchange_coefficient'))
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ choice = self.getScalarChoice(label)
+ if choice == 'exchange_coefficient':
+ choice = 'neumann'
+
+ value = scalarNode.xmlGetChildDouble(choice)
+ if value == None :
+ value = self.__defaultValues()['scalar']
+ self.setScalar(label, value)
+ return value
+
+
+ def setScalar(self, label, value) :
+ """
+ Set variableName variable
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isFloat(value)
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ choice = self.getScalarChoice(label)
+ if choice == 'exchange_coefficient':
+ choice = 'neumann'
+
+ scalarNode.xmlSetData(choice, value)
+
+
+ def getScalarImposedValue(self, label):
+ """
+ Get scalar dirichlet value
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(self.getScalarChoice(label), ('dirichlet',))
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ value = scalarNode.xmlGetChildDouble('dirichlet')
+ if not value:
+ value = self.__defaultValues()['scalarValue']
+ self.setScalarImposedValue(label, value)
+
+ return value
+
+
+ def setScalarImposedValue(self, label, value):
+ """
+ Set scalar dirichlet value
+ """
+ Model().isFloat(value)
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(self.getScalarChoice(label), ('dirichlet',))
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ scalarNode.xmlSetData('dirichlet', value)
+
+
+ def getScalarImposedFlux(self, label):
+ """
+ Get scalar neumann value
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(self.getScalarChoice(label), ('neumann', 'exchange_coefficient'))
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ value = scalarNode.xmlGetChildDouble('neumann')
+ if not value:
+ value = self.__defaultValues()['scalarValue']
+ self.setScalarImposedFlux(label, value)
+
+ return value
+
+
+ def setScalarImposedFlux(self, label, value):
+ """
+ Set scalar neumann value
+ """
+ Model().isFloat(value)
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(self.getScalarChoice(label), ('neumann', 'exchange_coefficient'))
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ scalarNode.xmlSetData('neumann', value)
+
+
+ def getScalarExchangeCoefficient(self, label):
+ """
+ Get scalar values for exchange coefficient
+ """
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(self.getScalarChoice(label), ('exchange_coefficient',))
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ value = scalarNode.xmlGetChildDouble('exchange_coefficient')
+ if not value:
+ value = self.__defaultValues()['scalarValue']
+ self.setScalarExchangeCoefficient(label, value)
+
+ return value
+
+
+ def setScalarExchangeCoefficient(self, label, value):
+ """
+ Set scalar values for exchange coefficient
+ """
+ Model().isFloat(value)
+ Model().isInList(label, self.sca_model.getScalarLabelsList())
+ Model().isInList(self.getScalarChoice(label), ('exchange_coefficient',))
+
+ scalarNode = self.boundNode.xmlInitNode('scalar', label=label)
+
+ #update name and type of scalar
+ self.updateScalarTypeAndName(scalarNode, label)
+
+ scalarNode.xmlSetData('exchange_coefficient', value)
+
+
+#-------------------------------------------------------------------------------
+# Radiative wall boundary
+#-------------------------------------------------------------------------------
+
+class RadiativeWallBoundary(Boundary) :
+ """
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize the boundary, add nodes in the radiative boundary node
+ """
+ self._radiativeChoices = ['itpimp', 'ipgrno', 'ifgrno']
+
+ self.head_list = ['emissivity',
+ 'thermal_conductivity',
+ 'thickness', 'flux',
+ 'external_temperature_profile',
+ 'internal_temperature_profile',
+ 'output_zone']
+
+
+ def _getListValRay(self, choice):
+ """
+ Return list of radiative variables according to choice's
+ """
+ Model().isInList(choice, self._radiativeChoices)
+ list = []
+ if choice == 'itpimp':
+ list = ('emissivity', 'internal_temperature_profile', 'output_zone')
+ elif choice == 'ipgrno':
+ list = ('emissivity', 'thermal_conductivity', 'thickness',
+ 'external_temperature_profile',
+ 'internal_temperature_profile', 'output_zone')
+ elif choice == 'ifgrno':
+ list = ('emissivity', 'flux', 'internal_temperature_profile', 'output_zone')
+
+ return list
+
+
+ def __defaultValues(self):
+ """
+ Default values
+ """
+ dico = {}
+ dico['emissivity'] = 0.8
+ dico['thermal_conductivity'] = 3.0
+ dico['thickness'] = 0.10
+ dico['flux'] = 0.
+ dico['external_temperature_profile'] = 300.
+ dico['internal_temperature_profile'] = 300.
+ dico['choice_condition'] = 'itpimp'
+ dico['output_zone'] = 1
+ return dico
+
+
+ def getRadiativeChoice(self):
+ """
+ Return variables according to choice of type of condition for the radiative wall
+ """
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ choice = nod_ray_cond['choice']
+ if not choice:
+ choice = self.__defaultValues()['choice_condition']
+ self.setRadiativeChoice(choice)
+ return choice
+
+
+ def setRadiativeChoice(self, choice):
+ """
+ Put variables according to choice of type of condition for the radiative wall
+ """
+ Model().isInList(choice, self._radiativeChoices)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond['choice'] = choice
+ list = self._getListValRay(choice)
+ for i in list:
+ if not nod_ray_cond.xmlGetChildNode(i):
+ nod_ray_cond.xmlSetData(i, self.__defaultValues()[i])
+
+
+ def getEmissivity(self):
+ """
+ Return value of emissivity for the radiative wall
+ """
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ val = nod_ray_cond.xmlGetChildDouble('emissivity')
+ if not val:
+ val = self.__defaultValues()['emissivity']
+ self.setEmissivity(val)
+
+ return val
+
+
+ def setEmissivity(self, val):
+ """
+ Put value of emissivity for the radiative wall
+ """
+ Model().isGreaterOrEqual(val, 0.)
+ Model().isLowerOrEqual(val, 1.)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond.xmlSetData('emissivity', val)
+
+
+ def getThermalConductivity(self):
+ """
+ Return value of thermal conductivity for the radiative wall
+ """
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ val = nod_ray_cond.xmlGetChildDouble('thermal_conductivity')
+ if not val:
+ val = self.__defaultValues()['thermal_conductivity']
+ self.setThermalConductivity(val)
+
+ return val
+
+
+ def setThermalConductivity(self, val):
+ """
+ Put value of thermal conductivity for the radiative wall
+ """
+ Model().isGreaterOrEqual(val, 0.)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond.xmlSetData('thermal_conductivity', val)
+
+
+ def getThickness(self):
+ """
+ Return value of thickness for the radiative wall
+ """
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ val = nod_ray_cond.xmlGetChildDouble('thickness')
+ if not val:
+ val = self.__defaultValues()['thickness']
+ self.setThickness(val)
+
+ return val
+
+
+ def setThickness(self, val):
+ """
+ Put value of thickness for the radiative wall
+ """
+ Model().isGreaterOrEqual(val, 0.)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond.xmlSetData('thickness', val)
+
+
+ def getExternalTemperatureProfile(self):
+ """
+ Return value of external temperature profile for the radiative wall
+ """
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ val = nod_ray_cond.xmlGetChildDouble('external_temperature_profile')
+ if not val:
+ val = self.__defaultValues()['external_temperature_profile']
+ self.setExternalTemperatureProfile(val)
+
+ return val
+
+
+ def setExternalTemperatureProfile(self, val):
+ """
+ Put value of external temperature profile for the radiative wall
+ """
+ Model().isGreaterOrEqual(val, 0.)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond.xmlSetData('external_temperature_profile',val)
+
+
+ def getInternalTemperatureProfile(self):
+ """
+ Return value of internal temperature profile for the radiative wall
+ """
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ val = nod_ray_cond.xmlGetChildDouble('internal_temperature_profile')
+ if not val:
+ val = self.__defaultValues()['internal_temperature_profile']
+ self.setInternalTemperatureProfile(val)
+
+ return val
+
+
+ def setInternalTemperatureProfile(self, val):
+ """
+ Put value of internal temperature profile for the radiative wall
+ """
+ Model().isGreaterOrEqual(val, 0.)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond.xmlSetData('internal_temperature_profile',val)
+
+
+ def getFlux(self):
+ """
+ Return value of flux for the radiative wall
+ """
+## nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+## val = nod_ray_cond.xmlGetChildDouble('flux')
+## if not val:
+## val = self.__defaultValues()['flux']
+## self.setFlux(val)
+ val = self.getValRay('flux')
+
+ return val
+
+
+ def setFlux(self, val):
+ """
+ Put value of flux for the radiative wall
+ """
+ Model().isGreaterOrEqual(val, 0.)
+
+## nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+## nod_ray_cond.xmlSetData('flux', val)
+ self.setValRay(val, 'flux')
+
+
+ def getOutputRadiativeZone(self):
+ """
+ Return value of output radiative zone for the radiative wall
+ """
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ ival = nod_ray_cond.xmlGetInt('output_zone')
+ if not ival:
+ ival = self.__defaultValues()['output_zone']
+ self.setOutputRadiativeZone(ival)
+
+ return ival
+
+
+ def setOutputRadiativeZone(self, ival):
+ """
+ Put value of output radiative zone for the radiative wall
+ """
+ Model().isInt(ival)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond.xmlSetData('output_zone', ival)
+
+
+ def getValRay(self, rayvar):
+ """
+ Return value of radiative variable named 'var' for the radiative wall
+ """
+ Model().isInList(rayvar, self.head_list)
+
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ if rayvar == "output_zone":
+ val = nod_ray_cond.xmlGetInt(rayvar)
+ else:
+ val = nod_ray_cond.xmlGetDouble(rayvar)
+ if not val:
+ val = self.__defaultValues()[rayvar]
+ self.setValRay(val, rayvar)
+
+ return val
+
+
+ def setValRay(self, val, rayvar):
+ """
+ Put value of radiative variable named 'rayvar' for the radiative wall
+ """
+ Model().isInList(rayvar, self.head_list)
+ if rayvar == "output_zone":
+ Model().isInt(val)
+ else:
+ Model().isFloat(val)
+ nod_ray_cond = self.boundNode.xmlInitChildNode('radiative_data')
+ nod_ray_cond.xmlSetData(rayvar, val)
+
+#-------------------------------------------------------------------------------
+# Mobil wall boundary
+#-------------------------------------------------------------------------------
+
+class MobilWallBoundary(Boundary) :
+ """
+ Boundary class for mobil wall.
+ """
+ def __new__(cls, label, case):
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize the possible choices.
+ """
+ self.__ALEChoices = ["fixed_boundary",
+ "sliding_boundary",
+ "internal_coupling",
+ "external_coupling",
+ "fixed_velocity",
+ "fixed_displacement"]
+
+ self._defaultValues = {}
+ self._defaultValues['ale_choice'] = self.__ALEChoices[0]
+
+ formula_velocity = 'ale_formula_' + "fixed_velocity"
+ formula_displacement = 'ale_formula_' + "fixed_displacement"
+ self._defaultValues[ formula_velocity ] = 'U_mesh=0;\nV_mesh=0;\nW_mesh=0;'
+ self._defaultValues[ formula_displacement ] = 'X_mesh=0;\nY_mesh=0;\nZ_mesh=0;'
+
+
+ def getALEChoice(self):
+ """
+ Get the choice ALE
+ """
+ node = self.boundNode.xmlInitNode('ale', 'choice')
+ choice = node['choice']
+
+ # Create a defaut choice if it does not exist.
+ if not node['choice']:
+ choice = self._defaultValues['ale_choice']
+ self.setALEChoice(choice)
+
+ return choice
+
+
+ def setALEChoice(self, value):
+ """
+ Set the ALE according to choice
+ """
+ Model().isInList(value, self.__ALEChoices)
+ node = self.boundNode.xmlInitNode('ale')
+
+ # if something has changed
+ if node['choice'] != value:
+ node['choice'] = value
+ if value in ["fixed_velocity", "fixed_displacement"]:
+ self.setFormula(self._getDefaultFormula())
+ else:
+ node.xmlRemoveChild('formula')
+
+
+ def getFormula(self):
+ """
+ Get the formula from the xml
+ """
+ node = self.boundNode.xmlInitChildNode('ale')
+ value = node.xmlGetChildString('formula')
+
+ if not value:
+ value = self._getDefaultFormula()
+ self.setFormula(value)
+
+ return value
+
+
+ def setFormula(self, value):
+ """
+ Set the formula into the xml
+ """
+ node = self.boundNode.xmlInitChildNode('ale')
+ node.xmlSetData('formula', value)
+
+
+ def _getDefaultFormula(self):
+ """
+ Return the default value for the formula
+ """
+ if self.getALEChoice() in ["fixed_velocity", "fixed_displacement"]:
+ aleChoice = self.getALEChoice()
+ return self._defaultValues[ 'ale_formula_' + aleChoice ]
+ else:
+ return ''
+
+#-------------------------------------------------------------------------------
+# CouplingMobilWallBoundary
+#-------------------------------------------------------------------------------
+
+class CouplingMobilWallBoundary(Boundary) :
+ """
+ Boundary class for coupling mobil wall.
+ """
+ def __new__(cls, label, case) :
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initBoundary(self):
+ """
+ Initialize default values
+ """
+ # Default values
+ self._defaultValues = {}
+ self._defaultValues['initial_displacement_X' ] = 0
+ self._defaultValues['initial_displacement_Y' ] = 0
+ self._defaultValues['initial_displacement_Z' ] = 0
+ self._defaultValues['initial_velocity_X' ] = 0
+ self._defaultValues['initial_velocity_Y' ] = 0
+ self._defaultValues['initial_velocity_Z' ] = 0
+ self._defaultValues['equilibrium_displacement_X'] = 0
+ self._defaultValues['equilibrium_displacement_Y'] = 0
+ self._defaultValues['equilibrium_displacement_Z'] = 0
+
+ defaultMatrix = 'm11=0;\nm22=0;\nm33=0;\nm12=0;\nm13=0;\nm23=0;'
+ defaultFluidMatrix = "Fx=0;\nFy=0;\nFz=0;"
+
+ self._defaultValues['mass_matrix_formula' ] = defaultMatrix
+ self._defaultValues['damping_matrix_formula' ] = defaultMatrix
+ self._defaultValues['stiffness_matrix_formula' ] = defaultMatrix
+ self._defaultValues['fluid_force_matrix_formula'] = defaultFluidMatrix
+ self._defaultValues['DDLX_choice' ] = 'off'
+ self._defaultValues['DDLY_choice' ] = 'off'
+ self._defaultValues['DDLZ_choice' ] = 'off'
+
+
+ # Accessors
+ #----------
+
+ def _setData(self, nodeName, subNodeName, value):
+ """
+ Set value into xml file.
+ """
+ aleNode = self.boundNode.xmlGetNode('ale')
+ node = aleNode.xmlInitChildNode(nodeName)
+ node.xmlSetData(subNodeName, value)
+
+
+ def _getDoubleData(self, nodeName, subNodeName, setter ):
+ """
+ Get value from xml file.
+ """
+ aleNode = self.boundNode.xmlGetNode('ale')
+ node = aleNode.xmlInitChildNode(nodeName)
+ value = node.xmlGetChildDouble(subNodeName)
+ if not value:
+ value = self._defaultValues[nodeName + '_' + subNodeName]
+ setter(value)
+ return value
+
+
+ def _getStringData(self, nodeName, subNodeName, setter ):
+ """
+ Get value from xml file.
+ """
+ aleNode = self.boundNode.xmlGetNode('ale')
+ node = aleNode.xmlInitChildNode(nodeName)
+ value = node.xmlGetChildString(subNodeName)
+ if not value:
+ value = self._defaultValues[nodeName + '_' + subNodeName]
+ setter(value)
+ return value
+
+
+ # InitialDisplacement
+ #--------------------
+
+ def setInitialDisplacementX(self, value ):
+ """
+ Set value of initial displacement X into xml file.
+ """
+ self._setData('initial_displacement', 'X', value)
+
+
+ def getInitialDisplacementX(self ):
+ """
+ Get value of initial displacement X from xml file.
+ """
+ return self._getDoubleData('initial_displacement', 'X', self.setInitialDisplacementX)
+
+
+ def setInitialDisplacementY(self, value ):
+ """
+ Set value of initial displacement Y into xml file.
+ """
+ self._setData('initial_displacement', 'Y', value)
+
+
+ def getInitialDisplacementY(self ):
+ """
+ Get value of initial displacement Y from xml file.
+ """
+ return self._getDoubleData('initial_displacement', 'Y', self.setInitialDisplacementY)
+
+
+ def setInitialDisplacementZ(self, value ):
+ """
+ Set value of initial displacement Z into xml file.
+ """
+ self._setData('initial_displacement', 'Z', value)
+
+
+ def getInitialDisplacementZ(self ):
+ """
+ Get value of initial displacement Z from xml file.
+ """
+ return self._getDoubleData('initial_displacement', 'Z', self.setInitialDisplacementZ)
+
+
+ # EquilibriumDisplacement
+ #------------------------
+
+ def setEquilibriumDisplacementX(self, value):
+ """
+ Set value of equilibrium displacement X into xml file.
+ """
+ self._setData('equilibrium_displacement', 'X', value)
+
+
+ def getEquilibriumDisplacementX(self):
+ """
+ Get value of equilibrium displacement X from xml file.
+ """
+ return self._getDoubleData('equilibrium_displacement', 'X', self.setEquilibriumDisplacementX)
+
+
+ def setEquilibriumDisplacementY(self, value):
+ """
+ Set value of equilibrium displacement Y into xml file.
+ """
+ self._setData('equilibrium_displacement', 'Y', value)
+
+
+ def getEquilibriumDisplacementY(self):
+ """
+ Get value of equilibrium displacement Y from xml file.
+ """
+ return self._getDoubleData('equilibrium_displacement', 'Y', self.setEquilibriumDisplacementY)
+
+
+ def setEquilibriumDisplacementZ(self, value):
+ """
+ Set value of equilibrium displacement Z into xml file.
+ """
+ self._setData('equilibrium_displacement', 'Z', value)
+
+
+ def getEquilibriumDisplacementZ(self):
+ """
+ Get value of equilibrium displacement X from xml file.
+ """
+ return self._getDoubleData('equilibrium_displacement', 'Z', self.setEquilibriumDisplacementZ)
+
+
+ # InitialDisplacement
+ #--------------------
+
+ def setInitialVelocityX(self, value):
+ """
+ Set value of initial velocity X into xml file.
+ """
+ self._setData('initial_velocity', 'X', value)
+
+
+ def getInitialVelocityX(self):
+ """
+ Get value of initial velocity X from xml file.
+ """
+ return self._getDoubleData('initial_velocity', 'X', self.setInitialVelocityX)
+
+
+ def setInitialVelocityY(self, value):
+ """
+ Set value of initial velocity Y into xml file.
+ """
+ self._setData('initial_velocity', 'Y', value)
+
+
+ def getInitialVelocityY(self):
+ """
+ Get value of initial velocity Y from xml file.
+ """
+ return self._getDoubleData('initial_velocity', 'Y', self.setInitialVelocityY)
+
+
+ def setInitialVelocityZ(self, value):
+ """
+ Set value of initial velocity Z into xml file.
+ """
+ self._setData('initial_velocity', 'Z', value)
+
+
+ def getInitialVelocityZ(self):
+ """
+ Get value of initial velocity Z from xml file.
+ """
+ return self._getDoubleData('initial_velocity', 'Z', self.setInitialVelocityZ)
+
+
+ # Matrix
+ #-------
+
+ def setMassMatrix(self, value):
+ """
+ Set values of massMatrix into xml file.
+ """
+ self._setData('mass_matrix', 'formula', value)
+
+
+ def getMassMatrix(self):
+ """
+ Get values of massMatrix from xml file.
+ """
+ return self._getStringData('mass_matrix', 'formula', self.setMassMatrix)
+
+
+ def setStiffnessMatrix(self, value):
+ """
+ Set values of stiffnessMatrix into xml file.
+ """
+ self._setData('stiffness_matrix', 'formula', value)
+
+
+ def getStiffnessMatrix(self):
+ """
+ Get values of stiffnessMatrix from xml file.
+ """
+ return self._getStringData('stiffness_matrix', 'formula', self.setStiffnessMatrix)
+
+
+ def setDampingMatrix(self, value):
+ """
+ Set values of dampingMatrix into xml file.
+ """
+ self._setData('damping_matrix', 'formula', value)
+
+
+ def getDampingMatrix(self):
+ """
+ Get values of dampingMatrix from xml file.
+ """
+ return self._getStringData('damping_matrix', 'formula', self.setDampingMatrix)
+
+
+ def setFluidForceMatrix(self, value):
+ """
+ Set values of fluid force matrix into xml file.
+ """
+ self._setData('fluid_force_matrix', 'formula', value)
+
+
+ def getFluidForceMatrix(self):
+ """
+ Get values of fluid force matrix from xml file.
+ """
+ return self._getStringData('fluid_force_matrix', 'formula', self.setFluidForceMatrix)
+
+ # DDL
+ #----
+
+ def _setChoice(self, nodeName, value):
+ """
+ Set the choice
+ """
+ Model().isInList(value, ['on', 'off'])
+ aleNode = self.boundNode.xmlGetNode('ale')
+ node = aleNode.xmlInitNode(nodeName)
+ node['choice'] = value
+
+
+ def _getChoice(self, nodeName, setter):
+ """
+ Get the choice
+ """
+ aleNode = self.boundNode.xmlGetNode('ale')
+ node = aleNode.xmlInitNode(nodeName, 'choice')
+ choice = node['choice']
+
+ # Create a defaut choice if it does not exist.
+ if not node['choice']:
+ choice = self._defaultValues[nodeName + '_choice']
+ setter(choice)
+
+ return choice
+
+
+ def setDDLX(self, value):
+ """
+ Set the DDLX to xml
+ """
+ self._setChoice('DDLX', value )
+
+
+ def getDDLX(self):
+ """
+ Get DDLX from xml
+ """
+ return self._getChoice('DDLX', self.setDDLX)
+
+
+ def setDDLY(self, value):
+ """
+ Set the DDLY to xml
+ """
+ self._setChoice('DDLY', value )
+
+
+ def getDDLY(self):
+ """
+ Get DDLY from xml
+ """
+ return self._getChoice('DDLY', self.setDDLY)
+
+
+ def setDDLZ(self, value):
+ """
+ Set the DDLZ to xml
+ """
+ self._setChoice('DDLZ', value )
+
+
+ def getDDLZ(self):
+ """
+ Get DDLZ from xml
+ """
+ return self._getChoice('DDLZ', self.setDDLZ)
+
+
+#-------------------------------------------------------------------------------
+# InletBoundaryModel test case for inlet boundaries conditions
+#-------------------------------------------------------------------------------
+
+
+class InletBoundaryTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkInletBoundaryInstantiation(self):
+ """
+ Check whether the InletBoundary class could be instantiated
+ """
+ model = None
+ model = Boundary("inlet", "entree1", self.case)
+ assert model != None, 'Could not instantiate InletBoundary'
+
+
+ def checkSetAndGetVelocityChoice(self):
+ """Check whether the velocity choice could be set and get for inlet boundary."""
+ model = Boundary("inlet", "entree1", self.case)
+ model.setVelocityChoice('flow1+direction')
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <inlet label="entree1">
+ <velocity_pressure choice="flow1+direction">
+ <flow1>1</flow1>
+ <direction_x>0</direction_x>
+ <direction_y>0</direction_y>
+ <direction_z>0</direction_z>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set velocity choice for inlet boundary'
+
+ assert model.getVelocityChoice() == "flow1+direction",\
+ 'Could not get velocity choice for inlet boundary'
+
+
+ def checkSetAndGetFlowAndDirection(self):
+ """Check whether the mass or volumic flow could be set and get for inlet boundary."""
+ model = Boundary("inlet", "entree1", self.case)
+ model.setVelocityChoice('flow1+direction')
+ node = model._XMLBoundaryConditionsNode
+
+ model.setFlow('flow1', 3.5)
+## model.setFlow('flow2', 3.5)
+ model.setDirection('direction_z', 2.0)
+
+ doc = '''<boundary_conditions>
+ <inlet label="entree1">
+ <velocity_pressure choice="flow1+direction">
+ <flow1>3.5</flow1>
+ <direction_x>0</direction_x>
+ <direction_y>0</direction_y>
+ <direction_z>2.0</direction_z>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set mass flow or volumic flow and directions for inlet boundary'
+
+ assert model.getVelocityChoice() == "flow1+direction",\
+ 'Could not get mass flow or volumic flow and directions for inlet boundary'
+
+
+ def checkSetAndGetNorm(self):
+ """Check whether the velocity norm could be set and get for inlet boundary."""
+ model = Boundary("inlet", "entree1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('flow1+direction')
+ model.setVelocityChoice('norm')
+ #il faut explicietement supprimer direction si on ne dirige pas la vitesse
+ model.deleteDirectionNodes()
+
+ model.setNorm(999.99)
+ doc = '''<boundary_conditions>
+ <inlet label="entree1">
+ <velocity_pressure choice="norm">
+ <norm>999.99</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set velocity norm for inlet boundary'
+
+ assert model.getVelocityChoice() == "norm",\
+ 'Could not get velocity norm for inlet boundary'
+
+
+ def checkSetAndGetTurbulenceChoice(self):
+ """Check whether the turbulence choice could be set and get for inlet boundary."""
+ model = Boundary("inlet", "entree1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('norm')
+ model.setTurbulenceChoice('turbulent_intensity')
+
+ doc = '''<boundary_conditions>
+ <inlet label="entree1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="turbulent_intensity">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ <turbulent_intensity>2</turbulent_intensity>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set turbulence choice for inlet boundary'
+
+ assert model.getTurbulenceChoice() == "turbulent_intensity",\
+ 'Could not get turbulence choice for inlet boundary'
+
+
+ def checkSetAndGetHydraulicDiameterAndTurbulentIntensity(self):
+ """
+ Check whether the hydraulic_diameter and turbulent_intensity could be
+ set and get for inlet boundary.
+ """
+ model = Boundary("inlet", "entree1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('norm')
+ model.setTurbulenceChoice('turbulent_intensity')
+
+ model.setHydraulicDiameter(120.)
+ model.setTurbulentIntensity(0.005)
+
+ doc = '''<boundary_conditions>
+ <inlet label="entree1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="turbulent_intensity">
+ <hydraulic_diameter>120.</hydraulic_diameter>
+ <turbulent_intensity>0.005</turbulent_intensity>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set hydraulic_diameter and turbulent_intensity for inlet boundary'
+
+ assert model.getHydraulicDiameter() == 120,\
+ 'Could not get hydraulic_diameter for turbulence for inlet boundary'
+ assert model.getTurbulentIntensity() == 0.005,\
+ 'Could not get turbulent_intensity for inlet boundary'
+
+
+ def checkSetAndGetThermalScalar(self):
+ """Check whether the thermal scalar could be set and get for inlet boundary."""
+ model = Boundary("inlet", "entree1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('norm')
+ model.setTurbulenceChoice('hydraulic_diameter')
+ model.th_model.setThermalModel('temperature_celsius')
+ model.setScalar("Temp.C", 15.)
+
+ doc = '''<boundary_conditions>
+ <inlet label="entree1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="Temp.C" name="temperature_celsius" type="thermal">
+ <dirichlet>15</dirichlet>
+ </scalar>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set thermal scalar value for inlet boundary'
+
+ assert model.getScalar("Temp.C") == 15,\
+ 'Could not get thermal scalar value for inlet boundary'
+
+
+ def checkSetAndGetScalar(self):
+ """Check whether the user scalar could be set and get for inlet boundary."""
+ model = Boundary("inlet", "entree1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('norm')
+ model.setTurbulenceChoice('hydraulic_diameter')
+ model.sca_model.addUserScalar('1', 'sca1')
+ model.sca_model.addUserScalar('1', 'sca2')
+ model.setScalar('sca1', 11.)
+ model.setScalar('sca2', 22.)
+
+ doc = '''<boundary_conditions>
+ <inlet label="entree1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ <scalar choice="dirichlet" label="sca1" name="scalar1" type="user">
+ <dirichlet>11</dirichlet>
+ </scalar>
+ <scalar choice="dirichlet" label="sca2" name="scalar2" type="user">
+ <dirichlet>22</dirichlet>
+ </scalar>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set user scalar value for inlet boundary'
+
+ assert model.getScalar('sca2') == 22,\
+ 'Could not get user scalar value for inlet boundary'
+
+
+def suite():
+ testSuite = unittest.makeSuite(InletBoundaryTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "InletBoundaryTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# CoalInletBoundaryModel test case for coal inlet boundaries conditions
+#-------------------------------------------------------------------------------
+
+
+class CoalInletBoundaryTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkCoalInletBoundaryInstantiation(self):
+ """
+ Check whether the CoalInletBoundary class could be instantiated
+ """
+ from CoalCombustionModel import CoalCombustionModel
+ CoalCombustionModel(self.case).setCoalCombustionModel('coal_homo')
+ model = None
+ model = Boundary("coal_inlet", "entree1", self.case)
+ assert model != None, 'Could not instantiate CoalInletBoundary'
+
+
+ def checkSetAndgetInletType(self):
+ """Check whether the type of inlet coal could be set and get for coal inlet boundary."""
+ from CoalCombustionModel import CoalCombustionModel
+ CoalCombustionModel(self.case).setCoalCombustionModel('coal_homo')
+
+ model = Boundary("inlet", "charb1", self.case)
+ coal_model = Boundary("coal_inlet", "charb1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('norm')
+ coal_model.setInletType('coalFlow')
+
+ doc = '''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ <temperature>1273.15</temperature>
+ <coal name="coal01">
+ <flow1>1</flow1>
+ <temperature>1273.15</temperature>
+ <ratio name="class01">100</ratio>
+ </coal>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set coalFlow type for coal inlet boundary'
+
+ assert coal_model.getInletType() == "coalFlow",\
+ 'Could not get coalFlow type for coal inlet boundary'
+
+ coal_model.setInletType('oxydantFlow')
+ doc1 = '''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ <temperature>1273.15</temperature>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+ assert node == self.xmlNodeFromString(doc1),\
+ 'Could not set oxydantFlow type for coal inlet boundary'
+
+ assert coal_model.getInletType() == "oxydantFlow",\
+ 'Could not get oxydantFlow type for coal inlet boundary'
+
+
+ def checkSetAndGetOxydantAndCoalTemperature(self):
+ """Check whether the temperature of oxydant and coal could be set and get for coal inlet boundary."""
+ from CoalCombustionModel import CoalCombustionModel
+ CoalCombustionModel(self.case).setCoalCombustionModel('coal_homo')
+
+ model = Boundary("inlet", "charb1", self.case)
+ coal_model = Boundary("coal_inlet", "charb1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('norm')
+ coal_model.setInletType('coalFlow')
+ coal_model.setOxydantTemperature(500.)
+ coal_model.setCoalTemperature(999.99, 0)
+
+ doc = '''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ <temperature>500.</temperature>
+ <coal name="coal01">
+ <flow1>1</flow1>
+ <temperature>999.99</temperature>
+ <ratio name="class01">100</ratio>
+ </coal>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set oxydant temperature for coal inlet boundary'
+
+ assert coal_model.getOxydantTemperature() == 500.,\
+ 'Could not get oxydant temperature for coal inlet boundary'
+
+ assert coal_model.getCoalTemperature(0) == 999.99,\
+ 'Could not get coal temperature for coal inlet boundary'
+
+
+ def checkSetAndGetCoalFlow(self):
+ """Check whether the flow of inlet coal could be set and get for coal inlet boundary."""
+ from CoalCombustionModel import CoalCombustionModel
+ CoalCombustionModel(self.case).setCoalCombustionModel('coal_homo')
+
+ model = Boundary("inlet", "charb1", self.case)
+ coal_model = Boundary("coal_inlet", "charb1", self.case)
+ node = model._XMLBoundaryConditionsNode
+ model.setVelocityChoice('flow1')
+ coal_model.setInletType('coalFlow')
+ coal_model.setCoalFlow(123.5, 0)
+
+ doc = '''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="flow1">
+ <temperature>1273.15</temperature>
+ <flow1>1</flow1>
+ <coal name="coal01">
+ <flow1>123.5</flow1>
+ <temperature>1273.15</temperature>
+ <ratio name="class01">100</ratio>
+ </coal>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set flow for coal inlet boundary'
+
+ assert coal_model.getCoalFlow(0) == 123.5,\
+ 'Could not get flow for coal inlet boundary'
+
+
+ def checkSetAndGetCoalRatios(self):
+ """Check whether the ratio of classes could be set and get for coal inlet boundary."""
+ os.remove("dp_FCP")
+ from CoalCombustionModel import CoalCombustionModel
+ m = CoalCombustionModel(self.case)
+ m.setCoalCombustionModel('coal_homo')
+
+ # creation du fichier dp_FCP avec 2 charbons et 3 classes
+ self.case['data_path'] = "."
+ from CoalThermoChemistry import CoalThermoChemistryModel, Coal
+ coalThermoChModel = CoalThermoChemistryModel("dp_FCP", self.case)
+ m.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.save()
+
+ coalThermoChModel.getCoals().addCoal(Coal())
+ m.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.save()
+ coalNumber = 2
+ coal = coalThermoChModel.getCoals().getCoal(coalNumber)
+ coal.addInitDiameterClasses(0.5)
+ coalThermoChModel.getCoals().updateCoal(coalNumber, coal)
+ m.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.save()
+ # fin de la creation du fichier dp_FCP
+
+ model = Boundary("inlet", "charb1", self.case)
+ coal_model = Boundary("coal_inlet", "charb1", self.case)
+
+ model.setVelocityChoice('flow1')
+ model.setVelocity(12.5)
+ coal_model.setInletType('coalFlow')
+ coal_model.setCoalFlow(123.5, 0)
+ coal_model.setOxydantTemperature(500.)
+ coal_model.setCoalTemperature(999.99, 0)
+## coal_model.setCoalRatios(0, (45,))
+ coal_model.setCoalRatios(1, (45, 55))
+
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="flow1">
+ <temperature>500</temperature>
+ <flow1>12.5</flow1>
+ <coal name="coal01">
+ <flow1>123.5</flow1>
+ <temperature>999.99</temperature>
+ <ratio name="class01">100</ratio>
+ </coal>
+ <coal name="coal02">
+ <flow1>1</flow1>
+ <temperature>1273.15</temperature>
+ <ratio name="class01">45</ratio>
+ <ratio name="class02">55</ratio>
+ </coal>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set ratios for classes for coal inlet boundary'
+
+ assert coal_model.getCoalRatios(1) == [45.0, 55.0],\
+ 'Could not get ratios for classes for coal inlet boundary'
+
+
+ def checkDeleteCoalAndClassesRatios(self):
+ """Check whether coal or classes could be deleted for coal inlet boundary."""
+ os.remove("dp_FCP")
+ from CoalCombustionModel import CoalCombustionModel
+ m = CoalCombustionModel(self.case)
+ m.setCoalCombustionModel('coal_homo')
+
+ # creation du fichier dp_FCP avec 3 charbons et 6 classes
+ self.case['data_path'] = "."
+ from CoalThermoChemistry import CoalThermoChemistryModel, Coal
+ coalThermoChModel = CoalThermoChemistryModel("dp_FCP", self.case)
+ m.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.save()
+
+ coalThermoChModel.getCoals().addCoal(Coal())
+ coalThermoChModel.getCoals().addCoal(Coal())
+ m.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.save()
+ coalNumber = 2
+ coal = coalThermoChModel.getCoals().getCoal(coalNumber)
+ coal.addInitDiameterClasses(0.5)
+ coalThermoChModel.getCoals().updateCoal(coalNumber, coal)
+ m.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalNumber = 3
+ coal = coalThermoChModel.getCoals().getCoal(coalNumber)
+ coal.addInitDiameterClasses(9.9)
+ coal.addInitDiameterClasses(21.)
+ coalThermoChModel.getCoals().updateCoal(coalNumber, coal)
+ m.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.save()
+ # fin de la creation du fichier dp_FCP
+ model = Boundary("inlet", "charb1", self.case)
+ coal_model = Boundary("coal_inlet", "charb1", self.case)
+
+ model.setVelocityChoice('flow1')
+ model.setVelocity(12.5)
+ coal_model.setInletType('coalFlow')
+ coal_model.setCoalFlow(123.5, 0)
+ coal_model.setOxydantTemperature(500.)
+ coal_model.setCoalTemperature(999.99, 0)
+ coal_model.setCoalRatios(1, (45, 55))
+ coal_model.setCoalRatios(2, (10, 20, 70))
+
+ node = model._XMLBoundaryConditionsNode
+ doc = '''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="flow1">
+ <temperature>500</temperature>
+ <flow1>12.5</flow1>
+ <coal name="coal01">
+ <flow1>123.5</flow1>
+ <temperature>999.99</temperature>
+ <ratio name="class01">100</ratio>
+ </coal>
+ <coal name="coal02">
+ <flow1>1</flow1>
+ <temperature>1273.15</temperature>
+ <ratio name="class01">45</ratio>
+ <ratio name="class02">55</ratio>
+ </coal>
+ <coal name="coal03">
+ <flow1>1</flow1>
+ <temperature>1273.15</temperature>
+ <ratio name="class01">10</ratio>
+ <ratio name="class02">20</ratio>
+ <ratio name="class03">70</ratio>
+ </coal>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set ratios for classes for coal inlet boundary'
+
+ coal_model.deleteCoalFlow(1,3)
+ doc1 ='''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="flow1">
+ <temperature>500</temperature>
+ <flow1>12.5</flow1>
+ <coal name="coal01">
+ <flow1>123.5</flow1>
+ <temperature>999.99</temperature>
+ <ratio name="class01">100</ratio>
+ </coal>
+ <coal name="coal02">
+ <flow1>1</flow1>
+ <temperature>1273.15</temperature>
+ <ratio name="class01">10</ratio>
+ <ratio name="class02">20</ratio>
+ <ratio name="class03">70</ratio>
+ </coal>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc1),\
+ 'Could not delete one coal for coal inlet boundary'
+ coal_model.updateCoalRatios(1)
+ coal_model.updateClassRatio(1)
+ doc2 ='''<boundary_conditions>
+ <inlet label="charb1">
+ <velocity_pressure choice="flow1">
+ <temperature>500</temperature>
+ <flow1>12.5</flow1>
+ <coal name="coal01">
+ <flow1>123.5</flow1>
+ <temperature>999.99</temperature>
+ <ratio name="class01">100</ratio>
+ </coal>
+ <coal name="coal02">
+ <flow1>1</flow1>
+ <temperature>1273.15</temperature>
+ <ratio name="class01">100</ratio>
+ <ratio name="class02">0</ratio>
+ </coal>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc2),\
+ 'Could not delete one class of one coal for coal inlet boundary'
+
+
+def suite2():
+ testSuite = unittest.makeSuite(CoalInletBoundaryTestCase, "check")
+ return testSuite
+
+
+def runTest2():
+ print "CoalInletBoundaryTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite2())
+
+#-------------------------------------------------------------------------------
+# WallBoundaryModel test case for wall boundaries conditions
+#-------------------------------------------------------------------------------
+
+
+class WallBoundaryTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkWallBoundaryInstantiation(self):
+ """
+ Check whether the WallBoundary class could be instantiated WallBoundary
+ """
+ model = None
+ model = Boundary("wall", "paroi", self.case)
+ assert model != None, 'Could not instantiate '
+
+
+ def checkSetAndGetVelocityChoice(self):
+ """Check whether the velocity choice could be set and get for wall boundary."""
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('on')
+ model = Boundary("wall", "fenetre", self.case)
+ model.setVelocityChoice('off')
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="on">
+ <dirichlet name="velocity_U">0.0</dirichlet>
+ <dirichlet name="velocity_V">0.0</dirichlet>
+ <dirichlet name="velocity_W">0.0</dirichlet>
+ </velocity_pressure>
+ </wall>
+ <wall label="fenetre">
+ <velocity_pressure choice="off"/>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set choice of velocity for wall boundary'
+
+ assert model.getVelocityChoice() == 'off',\
+ 'Could not get set choice of velocity for wall boundary'
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+
+ doc2 = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="fenetre">
+ <velocity_pressure choice="off"/>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc2),\
+ 'Could not set choice of velocity for wall boundary'
+
+
+ def checkSetAndGetVelocityValue(self):
+ """Check whether the velocity value could be set and get for wall boundary."""
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('on')
+ model.setVelocities(1., 2., 3.)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="on">
+ <dirichlet name="velocity_U">1</dirichlet>
+ <dirichlet name="velocity_V">2</dirichlet>
+ <dirichlet name="velocity_W">3</dirichlet>
+ </velocity_pressure>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set values of velocity for wall boundary'
+
+ assert model.getVelocities() == (1, 2 ,3),\
+ 'Could not get set values of velocity for wall boundary'
+
+
+ def checkSetAndGetRoughnessChoiceAndValue(self):
+ """Check whether the roughness could be set and get for wall boundary."""
+ model = Boundary("wall", "mur", self.case)
+ model.setRoughnessChoice('on')
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off">
+ <roughness>0.01</roughness>
+ </velocity_pressure>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not update roughness choice for wall boundary'
+
+ model.setRoughness(15.33)
+ doc1 = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off">
+ <roughness>15.33</roughness>
+ </velocity_pressure>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc1),\
+ 'Could not set roughness value for wall boundary'
+
+ assert model.getRoughness() == 15.33,\
+ 'Could not get roughness value for wall boundary'
+
+
+ def checkSetAndGetScalarChoice(self):
+ """Check whether the scalar choice could be set and get for wall boundary."""
+ model = Boundary("wall", "mur", self.case)
+ model.sca_model.addUserScalar('1', 'sca1')
+ model.sca_model.addUserScalar('1', 'sca2')
+ model.setScalarChoice('sca2', 'dirichlet')
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ <scalar choice="dirichlet" label="sca2" name="scalar2" type="user">
+ <dirichlet>0.0</dirichlet>
+ </scalar>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set scalar choice for wall boundary'
+
+ assert model.getScalarChoice('sca2') == 'dirichlet',\
+ 'Could not get scalar choice for wall boundary'
+
+ assert model.getScalarChoice('sca1') == 'neumann',\
+ 'Could not get scalar choice for wall boundary'
+
+ model.setScalarChoice('sca1', 'exchange_coefficient')
+ doc1 = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ <scalar choice="exchange_coefficient" label="sca1" name="scalar1" type="user">
+ <neumann>0.0</neumann>
+ <exchange_coefficient>0.0</exchange_coefficient>
+ </scalar>
+ <scalar choice="dirichlet" label="sca2" name="scalar2" type="user">
+ <dirichlet>0.0</dirichlet>
+ </scalar>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc1),\
+ 'Could not set scalar choice for wall boundary'
+
+ assert model.getScalarChoice('sca1') == 'exchange_coefficient',\
+ 'Could not get scalar choice for wall boundary'
+
+
+ def checkSetAndGetScalarImposedValueFluxAndExchangeCoefficient(self):
+ """Check whether the scalar values could be set and get for wall boundary."""
+ model = Boundary("wall", "mur", self.case)
+ model.sca_model.addUserScalar('1', 'sca1')
+ model.sca_model.addUserScalar('1', 'sca2')
+ model.setScalarChoice('sca1', 'exchange_coefficient')
+ model.setScalarChoice('sca2', 'dirichlet')
+ model.setScalarImposedFlux('sca1', 130.)
+ model.setScalarExchangeCoefficient('sca1', 0.130)
+ model.setScalarImposedValue('sca2', 55.)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ <scalar choice="exchange_coefficient" label="sca1" name="scalar1" type="user">
+ <neumann>130.0</neumann>
+ <exchange_coefficient>0.130</exchange_coefficient>
+ </scalar>
+ <scalar choice="dirichlet" label="sca2" name="scalar2" type="user">
+ <dirichlet>55.</dirichlet>
+ </scalar>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set scalar imposed value, flux and exchange_coefficient for wall boundary'
+
+ assert model.getScalarImposedValue('sca2') == 55.,\
+ 'Could not get scalar imposed value for wall boundary'
+
+ assert model.getScalarImposedFlux('sca1') == 130.,\
+ 'Could not get scalar imposed value for wall boundary'
+
+ assert model.getScalarExchangeCoefficient('sca1') == 0.130,\
+ 'Could not get scalar imposed value for wall boundary'
+
+
+def suite3():
+ testSuite = unittest.makeSuite(WallBoundaryTestCase, "check")
+ return testSuite
+
+
+def runTest3():
+ print "WallBoundaryTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite3())
+
+
+#-------------------------------------------------------------------------------
+# RadiativeWallBoundaryModel test case for radiative boundaries conditions
+#-------------------------------------------------------------------------------
+
+
+class RadiativeWallBoundaryTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkRadiativeWallBoundaryInstantiation(self):
+ """
+ Check whether the RadiativeWallBoundary class could be instantiated RadiativeWallBoundary
+ """
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = None
+ model = Boundary("radiative_wall", "paroi", self.case)
+ assert model != None, 'Could not instantiate '
+
+
+ def checkSetAndgetRadiativeChoice(self):
+ """Check whether the type of condition could be set and get for radiative wall boundary."""
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+ model = Boundary("radiative_wall", "radiateur", self.case)
+ model.setRadiativeChoice('ipgrno')
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="radiateur">
+ <radiative_data choice="ipgrno">
+ <emissivity>0.8</emissivity>
+ <thermal_conductivity>3</thermal_conductivity>
+ <thickness>0.1</thickness>
+ <external_temperature_profile>300</external_temperature_profile>
+ <internal_temperature_profile>300</internal_temperature_profile>
+ <output_zone>1</output_zone>
+ </radiative_data>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set type of condition for radiative wall boundary'
+
+ assert model.getRadiativeChoice() == "ipgrno",\
+ 'Could not get type of condition for radiative wall boundary'
+
+
+ def checkSetAndGetEmissivity(self):
+ """Check whether the emissivity could be set and get for radiative wall boundary."""
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+ model = Boundary("radiative_wall", "radiateur", self.case)
+ model.setRadiativeChoice('ipgrno')
+ model.setEmissivity(0.22)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="radiateur">
+ <radiative_data choice="ipgrno">
+ <emissivity>0.22</emissivity>
+ <thermal_conductivity>3</thermal_conductivity>
+ <thickness>0.1</thickness>
+ <external_temperature_profile>300</external_temperature_profile>
+ <internal_temperature_profile>300</internal_temperature_profile>
+ <output_zone>1</output_zone>
+ </radiative_data>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set emissivity for radiative wall boundary'
+
+ assert model.getEmissivity() == 0.22,\
+ 'Could not get emissivity for radiative wall boundary'
+
+
+ def checkSetAndGetThermalConductivity(self):
+ """Check whether the thermal conductivity could be set and get for radiative wall boundary."""
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+ model = Boundary("radiative_wall", "radiateur", self.case)
+ model.setRadiativeChoice('ipgrno')
+ model.setThermalConductivity(5.6)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="radiateur">
+ <radiative_data choice="ipgrno">
+ <emissivity>0.8</emissivity>
+ <thermal_conductivity>5.6</thermal_conductivity>
+ <thickness>0.1</thickness>
+ <external_temperature_profile>300</external_temperature_profile>
+ <internal_temperature_profile>300</internal_temperature_profile>
+ <output_zone>1</output_zone>
+ </radiative_data>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set thermal conductivity for radiative wall boundary'
+
+ assert model.getThermalConductivity() == 5.6,\
+ 'Could not get thermal conductivity for radiative wall boundary'
+
+
+ def checkSetAndGetThickness(self):
+ """Check whether the thickness could be set and get for radiative wall boundary."""
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+ model = Boundary("radiative_wall", "radiateur", self.case)
+ model.setRadiativeChoice('ipgrno')
+ model.setThickness(2.)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="radiateur">
+ <radiative_data choice="ipgrno">
+ <emissivity>0.8</emissivity>
+ <thermal_conductivity>3</thermal_conductivity>
+ <thickness>2.</thickness>
+ <external_temperature_profile>300</external_temperature_profile>
+ <internal_temperature_profile>300</internal_temperature_profile>
+ <output_zone>1</output_zone>
+ </radiative_data>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set thickness for radiative wall boundary'
+
+ assert model.getThickness() == 2.0,\
+ 'Could not get thickness for radiative wall boundary'
+
+
+ def checkSetAndGetExternalAndInternalTemperatureProfile(self):
+ """
+ Check whether the external and internal temperature profile
+ could be set and get for radiative wall boundary.
+ """
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+ model = Boundary("radiative_wall", "radiateur", self.case)
+ model.setRadiativeChoice('ipgrno')
+ model.setExternalTemperatureProfile(55.55)
+ model.setInternalTemperatureProfile(987.)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="radiateur">
+ <radiative_data choice="ipgrno">
+ <emissivity>0.8</emissivity>
+ <thermal_conductivity>3</thermal_conductivity>
+ <thickness>0.1</thickness>
+ <external_temperature_profile>55.55</external_temperature_profile>
+ <internal_temperature_profile>987.</internal_temperature_profile>
+ <output_zone>1</output_zone>
+ </radiative_data>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set external or internal temperature profile for radiative wall boundary'
+
+ assert model.getExternalTemperatureProfile() == 55.55,\
+ 'Could not get external temperature profile for radiative wall boundary'
+
+ assert model.getInternalTemperatureProfile() == 987.,\
+ 'Could not get internal temperature profile for radiative wall boundary'
+
+
+
+ def checkSetAndGetOutputRadiativeZone(self):
+ """
+ Check whether the output radiative zone could be set and get for
+ radiative wall boundary.
+ """
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+ model = Boundary("radiative_wall", "radiateur", self.case)
+ model.setRadiativeChoice('ipgrno')
+ model.setOutputRadiativeZone(21)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="radiateur">
+ <radiative_data choice="ipgrno">
+ <emissivity>0.8</emissivity>
+ <thermal_conductivity>3</thermal_conductivity>
+ <thickness>0.1</thickness>
+ <external_temperature_profile>300.</external_temperature_profile>
+ <internal_temperature_profile>300.</internal_temperature_profile>
+ <output_zone>21</output_zone>
+ </radiative_data>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set output radiative zone for radiative wall boundary'
+
+ assert model.getOutputRadiativeZone() == 21,\
+ 'Could not get output radiative zone for radiative wall boundary'
+
+
+ def checkSetAndGetFlux(self):
+ """Check whether the flux could be set and get for radiative wall boundary."""
+ from ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+
+ model = Boundary("wall", "mur", self.case)
+ model.setVelocityChoice('off')
+ model = Boundary("radiative_wall", "radiateur", self.case)
+ model.setRadiativeChoice('ifgrno')
+ model.setFlux(5.65)
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="mur">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <wall label="radiateur">
+ <radiative_data choice="ifgrno">
+ <emissivity>0.8</emissivity>
+ <flux>5.65</flux>
+ <internal_temperature_profile>300.</internal_temperature_profile>
+ <output_zone>1</output_zone>
+ </radiative_data>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set flux for radiative wall boundary'
+
+ assert model.getFlux() == 5.65,\
+ 'Could not get flux for radiative wall boundary'
+
+def suite4():
+ testSuite = unittest.makeSuite(RadiativeWallBoundaryTestCase, "check")
+ return testSuite
+
+
+def runTest4():
+ print "RadiativeWallBoundaryTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite4())
+
+#-------------------------------------------------------------------------------
+# OutletBoundaryModel test case for outlet boundaries conditions
+#-------------------------------------------------------------------------------
+
+class OutletBoundaryTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkOutletBoundaryInstantiation(self):
+ """
+ Check whether the OutletBoundary class could be instantiated OutletBoundary
+ """
+ model = None
+ model = Boundary("outlet", "sortie", self.case)
+ assert model != None, 'Could not instantiate '
+
+
+ def checkSetAndGetPressure(self):
+ """Check whether the reference pressure could be set and get for outlet boundary."""
+ model = Boundary("outlet", "sortie", self.case)
+ model.setReferencePressure(111333.)
+
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <outlet label="sortie">
+ <dirichlet name="pressure">111333</dirichlet>
+ </outlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set reference pressure for outlet boundary'
+
+ assert model.getReferencePressure() == 111333,\
+ 'Could not get reference pressure for outlet boundary'
+
+
+ def checkSetAndGetScalarChoiceAndValue(self):
+ """Check whether the scalar choice and value could be set and get for outlet boundary."""
+ model = Boundary("outlet", "sortie", self.case)
+ model.sca_model.addUserScalar('1', 'sca1')
+ model.sca_model.addUserScalar('1', 'sca2')
+ model.setScalarChoice('sca1', 'dirichlet')
+ model.setScalar('sca1', 10.10)
+ model.setScalarChoice('sca2', 'neumann')
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <outlet label="sortie">
+ <scalar choice="dirichlet" label="sca1" name="scalar1" type="user">
+ <dirichlet>10.1</dirichlet>
+ </scalar>
+ <scalar choice="neumann" label="sca2" name="scalar2" type="user">
+ <neumann>0</neumann>
+ </scalar>
+ </outlet>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set choice and value at scalars for outlet boundary'
+
+ assert model.getScalarChoice('sca1') == 'dirichlet',\
+ 'Could not get choice of scalar for outlet boundary'
+
+ assert model.getScalar('sca2') == 0,\
+ 'Could not get choice of scalar for outlet boundary'
+
+
+def suite5():
+ testSuite = unittest.makeSuite(OutletBoundaryTestCase, "check")
+ return testSuite
+
+
+def runTest5():
+ print "OutletBoundaryTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite5())
+
+#-------------------------------------------------------------------------------
+# MobilWallBoundary test case for mobils boundaries conditions
+#-------------------------------------------------------------------------------
+
+class MobilWallBoundaryTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkMobilWallBoundaryInstantiation(self):
+ """
+ Check whether the MobilWallBoundary class could be instantiated
+ """
+ model = None
+ model = Boundary("mobile_boundary", "wall_1", self.case)
+ assert model != None, 'Could not instantiate '
+
+
+ def checkSetAndGetALEChoice(self):
+ """Check whether the ale choice could be set and get for mobil wall boundary."""
+ model = Boundary("mobile_boundary", "Wall_1", self.case)
+ model.setALEChoice("fixed_wall")
+
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="Wall_1">
+ <ale choice="fixed_wall"/>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set reference ale choice for mobil wall boundary'
+
+ assert model.getALEChoice() == "fixed_wall",\
+ 'Could not get ale choice for mobil wall boundary'
+
+
+ def checkSetAndGetFormula(self):
+ """Check whether the formula could be set and get for mobil wall boundary."""
+ model = Boundary("mobile_boundary", "Wall_1", self.case)
+ model.setFormula("mesh_vi1 = 1000;")
+
+ node = model._XMLBoundaryConditionsNode
+
+ doc = '''<boundary_conditions>
+ <wall label="Wall_1">
+ <ale>
+ <formula>
+ mesh_vi1 = 1000;
+ </formula>
+ </ale>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set reference formula for mobil wall boundary'
+ assert model.getFormula() == "mesh_vi1 = 1000;",\
+ 'Could not get formula for mobil wall boundary'
+
+
+def suite6():
+ testSuite = unittest.makeSuite(MobilWallBoundaryTestCase, "check")
+ return testSuite
+
+
+def runTest6():
+ print "MobilWallBoundaryTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite6())
+
+#-------------------------------------------------------------------------------
+# CouplingMobilWallBoundary test case for coupling mobil wall boundary
+#-------------------------------------------------------------------------------
+
+class CouplingMobilWallBoundaryTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkCouplingMobilWallBoundaryInstantiation(self):
+ """
+ Check whether the MobilWallBoundary class could be instantiated
+ """
+ model = None
+ model = Boundary("coupling_mobile_boundary", "Wall_1", self.case)
+ assert model != None, 'Could not instantiate '
+
+
+ def checkSetAndGetInitialDisplacement(self):
+ """Check whether coupling mobil wall boundary could be set and get initial displacement."""
+ model = Boundary("coupling_mobile_boundary", "Wall_1", self.case)
+ model.boundNode.xmlInitNode('ale')
+ model.setInitialDisplacementX(1)
+ model.setInitialDisplacementY(2)
+ model.setInitialDisplacementZ(3)
+ node = model._XMLBoundaryConditionsNode
+ doc = '''<boundary_conditions>
+ <wall label="Wall_1">
+ <ale>
+ <initial_displacement>
+ <X>1</X>
+ <Y>2</Y>
+ <Z>3</Z>
+ </initial_displacement>
+ </ale>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set initial displacement for coupling mobil wall boundary'
+ assert model.getInitialDisplacementX() == 1,\
+ 'Could not get initial displacement X for coupling mobil wall boundary'
+ assert model.getInitialDisplacementY() == 2,\
+ 'Could not get initial displacement Y for coupling mobil wall boundary'
+ assert model.getInitialDisplacementZ() == 3,\
+ 'Could not get initial displacement Z for coupling mobil wall boundary'
+
+
+ def checkSetAndGetEquilibriumDisplacement(self):
+ """Check whether coupling mobil wall boundary could be set and get equilibrium displacement."""
+ model = Boundary("coupling_mobile_boundary", "Wall_1", self.case)
+ model.boundNode.xmlInitNode('ale')
+ model.setEquilibriumDisplacementX(1)
+ model.setEquilibriumDisplacementY(2)
+ model.setEquilibriumDisplacementZ(3)
+
+ node = model._XMLBoundaryConditionsNode
+ doc = '''<boundary_conditions>
+ <wall label="Wall_1">
+ <ale>
+ <equilibrium_displacement>
+ <X>1</X>
+ <Y>2</Y>
+ <Z>3</Z>
+ </equilibrium_displacement>
+ </ale>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set equilibrium displacement for coupling mobil wall boundary'
+ assert model.getEquilibriumDisplacementX() == 1,\
+ 'Could not get equilibrium displacement X for coupling mobil wall boundary'
+ assert model.getEquilibriumDisplacementY() == 2,\
+ 'Could not get equilibrium displacement Y for coupling mobil wall boundary'
+ assert model.getEquilibriumDisplacementZ() == 3,\
+ 'Could not get equilibrium displacement Z for coupling mobil wall boundary'
+
+
+ def checkSetAndGetInitialVelocity(self):
+ """Check whether coupling mobil wall boundary could be set and get initial velocity."""
+ model = Boundary("coupling_mobile_boundary", "Wall_1", self.case)
+ model.boundNode.xmlInitNode('ale')
+ model.setInitialVelocityX(1)
+ model.setInitialVelocityY(2)
+ model.setInitialVelocityZ(3)
+
+ node = model._XMLBoundaryConditionsNode
+ doc = '''<boundary_conditions>
+ <wall label="Wall_1">
+ <ale>
+ <initial_velocity>
+ <X>1</X>
+ <Y>2</Y>
+ <Z>3</Z>
+ </initial_velocity>
+ </ale>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set initial velocity for coupling mobil wall boundary'
+ assert model.getInitialVelocityX() == 1,\
+ 'Could not get initial velocity X for coupling mobil wall boundary'
+ assert model.getInitialVelocityY() == 2,\
+ 'Could not get initial velocity Y for coupling mobil wall boundary'
+ assert model.getInitialVelocityZ() == 3,\
+ 'Could not get initial velocity Z for coupling mobil wall boundary'
+
+
+ def checkSetAndGetMatrix(self):
+ """Check whether coupling mobil wall boundary could be set and get matrix."""
+ model = Boundary("coupling_mobile_boundary", "Wall_1", self.case)
+ model.boundNode.xmlInitNode('ale')
+ model.setMassMatrix('MassMatrix')
+ model.setStiffnessMatrix('StiffnessMatrix')
+ model.setDampingMatrix('DampingMatrix')
+ model.setFluidForceMatrix('FluidForceMatrix')
+
+ node = model._XMLBoundaryConditionsNode
+ doc = '''<boundary_conditions>
+ <wall label="Wall_1">
+ <ale>
+ <mass_matrix>
+ <formula>MassMatrix</formula>
+ </mass_matrix>
+ <stiffness_matrix>
+ <formula>StiffnessMatrix</formula>
+ </stiffness_matrix>
+ <damping_matrix>
+ <formula>DampingMatrix</formula>
+ </damping_matrix>
+ <fluid_force_matrix>
+ <formula>FluidForceMatrix</formula>
+ </fluid_force_matrix>
+ </ale>
+ </wall>
+ </boundary_conditions>'''
+
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set matrix for coupling mobil wall boundary'
+ assert model.getMassMatrix() == 'MassMatrix',\
+ 'Could not get mass matrix for coupling mobil wall boundary'
+ assert model.getStiffnessMatrix() == 'StiffnessMatrix',\
+ 'Could not get stiffness matrix for coupling mobil wall boundary'
+ assert model.getDampingMatrix() == 'DampingMatrix',\
+ 'Could not get damping matrix for coupling mobil wall boundary'
+ assert model.getFluidForceMatrix() == 'FluidForceMatrix',\
+ 'Could not get fluid force matrix for coupling mobil wall boundary'
+
+
+ def checkSetAndGetDDL(self):
+ """Check whether coupling mobil wall boundary could be set and get DDL."""
+ model = Boundary("coupling_mobile_boundary", "Wall_1", self.case)
+ model.boundNode.xmlInitNode('ale')
+ model.setDDLX('on')
+ model.setDDLY('on')
+ model.setDDLZ('on')
+
+ node = model._XMLBoundaryConditionsNode
+ doc = '''<boundary_conditions>
+ <wall label="Wall_1">
+ <ale>
+ <DDLX choice="on"/>
+ <DDLY choice="on"/>
+ <DDLZ choice="on"/>
+ </ale>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set DDL for coupling mobil wall boundary'
+ assert model.getDDLX() == 'on',\
+ 'Could not get DDL X for coupling mobil wall boundary'
+ assert model.getDDLY() == 'on',\
+ 'Could not get DDL Y for coupling mobil wall boundary'
+ assert model.getDDLZ() == 'on',\
+ 'Could not get DDL Z for coupling mobil wall boundary'
+
+
+def suite7():
+ testSuite = unittest.makeSuite(CouplingMobilWallBoundaryTestCase, "check")
+ return testSuite
+
+
+def runTest7():
+ print "CouplingMobilWallBoundaryTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite7())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsCoalInletForm.ui b/gui/Pages/BoundaryConditionsCoalInletForm.ui
new file mode 100644
index 0000000..87ef538
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsCoalInletForm.ui
@@ -0,0 +1,554 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsCoalInletForm</class>
+ <widget class="QWidget" name="BoundaryConditionsCoalInletForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>424</width>
+ <height>620</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxFlowTemp" >
+ <property name="title" >
+ <string>Flows and temperatures</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <layout class="QGridLayout" name="horizontalLayout_1" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxTypeInlet" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxOxydants" >
+ <property name="title" >
+ <string>Mass flow rate and temperature for oxydant</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer name="horizontalSpacer_7" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QComboBox" name="comboBoxVelocity" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditVelocity" />
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitVelocity" >
+ <property name="text" >
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonVelocityFormula" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5" >
+ <item>
+ <widget class="QLabel" name="labelOxydant" >
+ <property name="text" >
+ <string>Oxydant number</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinBoxOxydantNumber" >
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="maximum" >
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelTempOxydant" >
+ <property name="text" >
+ <string>Temperature</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditTemperature" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitTemp" >
+ <property name="text" >
+ <string>K</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxDirection" >
+ <property name="title" >
+ <string>Direction</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QComboBox" name="comboBoxDirection" />
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDirectionFormula" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameDirectionCoordinates" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <property name="lineWidth" >
+ <number>0</number>
+ </property>
+ <layout class="QHBoxLayout" name="_6" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_9" >
+ <item>
+ <widget class="QLabel" name="labelXVelocity" >
+ <property name="text" >
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDirectionX" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelYVelocity" >
+ <property name="text" >
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDirectionY" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelZVelocity" >
+ <property name="text" >
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDirectionZ" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxCoal" >
+ <property name="title" >
+ <string>Mass flow rate and temperature of coals</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_11" >
+ <item>
+ <spacer name="horizontalSpacer_9" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>32</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QTableView" name="tableViewCoal" >
+ <property name="minimumSize" >
+ <size>
+ <width>310</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="dragDropOverwriteMode" >
+ <bool>false</bool>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="verticalScrollMode" >
+ <enum>QAbstractItemView::ScrollPerPixel</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_10" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>32</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxCoalMass" >
+ <property name="title" >
+ <string>Ratio of mass distribution for each class of coal</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_10" >
+ <item>
+ <spacer name="horizontalSpacer_11" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>32</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QTableView" name="tableViewCoalMass" >
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="dragDropOverwriteMode" >
+ <bool>false</bool>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="horizontalScrollMode" >
+ <enum>QAbstractItemView::ScrollPerPixel</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_12" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>32</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsCoalInletView.py b/gui/Pages/BoundaryConditionsCoalInletView.py
new file mode 100644
index 0000000..96c4ca5
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsCoalInletView.py
@@ -0,0 +1,739 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- BoundaryConditionsCoalInletView
+- ValueDelegate
+- StandardItemModelCoal
+- StandardItemModelCoalMass
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+try:
+ import mei
+ _have_mei = True
+except:
+ _have_mei = False
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsCoalInletForm import Ui_BoundaryConditionsCoalInletForm
+import Pages.CoalCombustionModel as CoalCombustion
+import Pages.CoalThermoChemistry as CoalThermoChemistry
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel, setGreenColor
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.Boundary import Boundary
+if _have_mei:
+ from QMeiEditorView import QMeiEditorView
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsCoalInletView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate with a Double validator (positive value)
+#-------------------------------------------------------------------------------
+
+class ValueDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(ValueDelegate, self).__init__(parent)
+ self.parent = parent
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = DoubleValidator(editor, min=0.)
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+ def setModelData(self, editor, model, index):
+ value, ok = editor.text().toDouble()
+ if editor.validator().state == QValidator.Acceptable:
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class to display Coals in a QTableView
+#-------------------------------------------------------------------------------
+
+class StandardItemModelCoal(QStandardItemModel):
+ def __init__(self, case):
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Coal number"),
+ self.tr("Flow (kg/s)"),
+ self.tr("Temperature \n(K)")]
+ self.setColumnCount(len(self.headers))
+ self.dataCoal = []
+ self.__case = case
+
+
+ def setBoundaryFromLabel(self, label):
+ self.modelBoundary = Boundary('coal_inlet', label, self.__case)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataCoal[index.row()][index.column()])
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() in [1,2]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+ col = index.column()
+ if not hasattr(self, "modelBoundary"):
+ log.debug("ERROR in setData (StandardItemModelCoal) : no Boundary model defined")
+ return
+ v, ok = value.toDouble()
+ self.dataCoal[row][col] = v
+ if col == 1:
+ self.modelBoundary.setCoalFlow(v, row)
+ elif col == 2:
+ self.modelBoundary.setCoalTemperature(v, row)
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def insertItem(self, nameCoal, valCoal, valCoalTemp):
+ line = [nameCoal, valCoal, valCoalTemp]
+ self.dataCoal.append(line)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def deleteAll(self):
+ self.dataCoal = []
+ self.setRowCount(0)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class to display Coal masses in a QTableView
+#-------------------------------------------------------------------------------
+
+class StandardItemModelCoalMass(QStandardItemModel):
+
+ def __init__(self, case, coalNumber, coalClassesNumber):
+ QStandardItemModel.__init__(self)
+ self.__case = case
+ self.coalNumber = coalNumber
+ self.coalClassesNumber = coalClassesNumber
+
+
+ def setRatio(self, ratio):
+ cols = len(ratio)
+ if type(ratio[0]) == type([]):
+ rows = max([len(c) for c in ratio])
+ else:
+ rows = 1
+ self.setColumnCount(cols)
+ self.setRowCount(rows)
+ self.ratio = ratio
+
+
+ def setBoundaryFromLabel(self, label):
+ log.debug("setBoundaryFromLabel")
+ self.modelBoundary = Boundary('coal_inlet', label, self.__case)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ classe = index.row()
+ coal = index.column()
+ if classe < self.coalClassesNumber[coal]:
+ try:
+ return QVariant(self.ratio[coal][classe])
+ except:
+ log.debug("ERROR no data for self.ratio[%i][%i] "%(coal, classe))
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.row() >= self.coalClassesNumber[index.column()]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant("Coal" + " " + str(section+1))
+ if orientation == Qt.Vertical and role == Qt.DisplayRole:
+ return QVariant("Class" + " " + str(section+1))
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ if not hasattr(self, "modelBoundary"):
+ log.debug("ERROR in setData (StandardItemModelCoalMass): no Boundary model defined")
+ return
+ classe = index.row()
+ coal = index.column()
+ v, ok = value.toDouble()
+ self.ratio[coal][classe] = v
+ log.debug("setData v = %f "%v)
+
+ liste = self.modelBoundary.getCoalRatios(coal)
+ lastValue = 0
+ for iclasse in range(0, self.coalClassesNumber[coal]-1):
+ lastValue += self.ratio[coal][iclasse]
+
+ if lastValue < 100.+ 1e-6 :
+ liste[classe] = self.ratio[coal][classe]
+ lastValue = 100 - lastValue
+ self.ratio[coal][self.coalClassesNumber[coal]-1] = lastValue
+ liste[self.coalClassesNumber[coal]-1] = lastValue
+ self.modelBoundary.setCoalRatios(coal, liste)
+ else :
+ self.ratio[coal][classe] = liste[classe]
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def deleteAll(self):
+ self.ratio = []
+ self.setRowCount(0)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsCoalInletView(QWidget, Ui_BoundaryConditionsCoalInletForm):
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsCoalInletForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+
+ # Connections
+ self.connect(self.comboBoxTypeInlet,
+ SIGNAL("activated(const QString&)"),
+ self.__slotInletType)
+ self.connect(self.comboBoxVelocity,
+ SIGNAL("activated(const QString&)"),
+ self.__slotChoiceVelocity)
+ self.connect(self.lineEditVelocity,
+ SIGNAL("textChanged(const QString &)"),
+ self.__slotVelocityValue)
+ self.connect(self.lineEditTemperature,
+ SIGNAL("textChanged(const QString &)"),
+ self.__slotTemperature)
+ self.connect(self.spinBoxOxydantNumber,
+ SIGNAL("valueChanged(int)"),
+ self.__slotOxydantNumber)
+
+ self.connect(self.comboBoxDirection,
+ SIGNAL("activated(const QString&)"),
+ self.__slotChoiceDirection)
+ self.connect(self.lineEditDirectionX,
+ SIGNAL("textChanged(const QString &)"),
+ self.__slotDirX)
+ self.connect(self.lineEditDirectionY,
+ SIGNAL("textChanged(const QString &)"),
+ self.__slotDirY)
+ self.connect(self.lineEditDirectionZ,
+ SIGNAL("textChanged(const QString &)"),
+ self.__slotDirZ)
+
+ # Combo models
+ self.modelTypeInlet = ComboModel(self.comboBoxTypeInlet, 2, 1)
+ self.modelTypeInlet.addItem(self.tr("Only oxydant"), 'oxydantFlow')
+ self.modelTypeInlet.addItem(self.tr("Oxydant and coal"), 'coalFlow')
+
+ self.modelVelocity = ComboModel(self.comboBoxVelocity, 4, 1)
+ self.modelVelocity.addItem(self.tr("Norm"), 'norm')
+ self.modelVelocity.addItem(self.tr("Mass flow rate"), 'flow1')
+ self.modelVelocity.addItem(self.tr("Norm (user law)"), 'norm_formula')
+ self.modelVelocity.addItem(self.tr("Mass flow rate (user law)"), 'flow1_formula')
+
+ self.modelDirection = ComboModel(self.comboBoxDirection, 3, 1)
+ self.modelDirection.addItem(self.tr("Normal to the inlet"), 'normal')
+ self.modelDirection.addItem(self.tr("Specified coordinates"), 'coordinates')
+ self.modelDirection.addItem(self.tr("User profile"), 'formula')
+
+ # Validators
+ validatorVelocity = DoubleValidator(self.lineEditVelocity)
+ validatorX = DoubleValidator(self.lineEditDirectionX)
+ validatorY = DoubleValidator(self.lineEditDirectionY)
+ validatorZ = DoubleValidator(self.lineEditDirectionZ)
+ validatorTemp = DoubleValidator(self.lineEditTemperature, min=0.)
+
+ # Apply validators
+ self.lineEditVelocity.setValidator(validatorVelocity)
+ self.lineEditDirectionX.setValidator(validatorX)
+ self.lineEditDirectionY.setValidator(validatorY)
+ self.lineEditDirectionZ.setValidator(validatorZ)
+ self.lineEditTemperature.setValidator(validatorTemp)
+
+ if _have_mei:
+ self.connect(self.pushButtonVelocityFormula,
+ SIGNAL("clicked()"),
+ self.__slotVelocityFormula)
+ self.connect(self.pushButtonDirectionFormula,
+ SIGNAL("clicked()"),
+ self.__slotDirectionFormula)
+ else:
+ self.pushButtonVelocityFormula.setEnabled(False)
+ self.pushButtonDirectionFormula.setEnabled(False)
+ self.modelVelocity.disableItem(str_model="norm_formula")
+ self.modelVelocity.disableItem(str_model="flow1_formula")
+ self.modelDirection.disableItem(str_model="formula")
+
+ # Usefull information about coals, classes, and ratios
+
+ mdl = CoalCombustion.CoalCombustionModel(self.__case)
+ if mdl.getCoalCombustionModel() != "off":
+ coalModel = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.__case)
+ self.__coalNumber = coalModel.getCoals().getNumber()
+ self.__coalClassesNumber = []
+ for coal in range(0, self.__coalNumber):
+ self.__coalClassesNumber.append(coalModel.getCoals().getCoal(coal+1).getClassesNumber())
+ self.__maxOxydantNumber = coalModel.getOxydants().getNumber()
+ else:
+ self.__coalNumber = 0
+ self.__coalClassesNumber = [0]
+ self.__maxOxydantNumber = 1
+
+ self.__ratio = self.__coalNumber*[0]
+ for i in range(0, self.__coalNumber):
+ self.__ratio[i] = self.__coalClassesNumber[i]*[0]
+
+ # Coal table
+
+ self.__modelCoal = StandardItemModelCoal(self.__case)
+ self.tableViewCoal.setModel(self.__modelCoal)
+ delegateValue = ValueDelegate(self.tableViewCoal)
+ self.tableViewCoal.setItemDelegateForColumn(1, delegateValue)
+ self.tableViewCoal.setItemDelegateForColumn(2, delegateValue)
+
+ # Coal mass ratio table
+
+ self.__modelCoalMass = StandardItemModelCoalMass(self.__case,
+ self.__coalNumber,
+ self.__coalClassesNumber)
+ self.tableViewCoalMass.setModel(self.__modelCoalMass)
+
+ delegateValueMass = ValueDelegate(self.tableViewCoalMass)
+ for c in range(self.__modelCoalMass.columnCount()):
+ self.tableViewCoalMass.setItemDelegateForColumn(c, delegateValueMass)
+
+
+ def showWidget(self, b):
+ """
+ Show the widget
+ """
+ label = b.getLabel()
+ self.__boundary = Boundary('coal_inlet', label, self.__case)
+
+ # Initialize velocity
+ choice = self.__boundary.getVelocityChoice()
+ self.modelVelocity.setItem(str_model=choice)
+ self.__updateLabel()
+
+ if not _have_mei:
+ if self.__boundary.getVelocityChoice()[-7:] == "formula":
+ c = self.__boundary.defaultValues()['velocityChoice']
+ self.__boundary.setVelocityChoice(c)
+ if self.__boundary.getDirectionChoice() == "formula":
+ c = self.__boundary.defaultValues()['directionChoice']
+ self.__boundary.setDirectionChoice(c)
+
+ if choice[-7:] == "formula":
+ self.pushButtonVelocityFormula.setEnabled(True)
+ self.lineEditVelocity.setEnabled(False)
+ else:
+ self.pushButtonVelocityFormula.setEnabled(False)
+ self.lineEditVelocity.setEnabled(True)
+ v = self.__boundary.getVelocity()
+ self.lineEditVelocity.setText(QString(str(v)))
+
+ # Initialize oxydant and temperature
+ self.spinBoxOxydantNumber.setMaximum(self.__maxOxydantNumber)
+ o = self.__boundary.getOxydantNumber()
+ self.spinBoxOxydantNumber.setValue(o)
+ t = self.__boundary.getOxydantTemperature()
+ self.lineEditTemperature.setText(QString(str(t)))
+
+ # Initialize direction
+ choice = self.__boundary.getDirectionChoice()
+ self.modelDirection.setItem(str_model=choice)
+ text = self.modelDirection.dicoM2V[choice]
+ if choice == "formula":
+ self.pushButtonDirectionFormula.setEnabled(True)
+ self.frameDirectionCoordinates.hide()
+ elif choice == "coordinates":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ self.frameDirectionCoordinates.show()
+ v = self.__boundary.getDirection('direction_x')
+ self.lineEditDirectionX.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_y')
+ self.lineEditDirectionY.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_z')
+ self.lineEditDirectionZ.setText(QString(str(v)))
+ elif choice == "normal":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ self.frameDirectionCoordinates.hide()
+
+ log.debug("showWidget:inlet type: %s " % self.__boundary.getInletType())
+ if self.__boundary.getInletType() == "coalFlow":
+ self.modelTypeInlet.setItem(str_model="coalFlow")
+ self.groupBoxCoal.show()
+ self.groupBoxCoalMass.show()
+ self.__updateTables()
+ self.__boundary.setInletType("coalFlow")
+ else:
+ self.__boundary.setInletType("oxydantFlow")
+ self.modelTypeInlet.setItem(str_model="oxydantFlow")
+ self.groupBoxCoal.hide()
+ self.groupBoxCoalMass.hide()
+
+ self.show()
+
+
+ def hideWidget(self):
+ """
+ Hide all
+ """
+ self.hide()
+
+
+ def __updateTables(self):
+ """
+ Insert rows in the two QTableView.
+ """
+ # clean the QTableView
+ self.__modelCoal.deleteAll()
+ self.__modelCoalMass.deleteAll()
+
+ label = self.__boundary.getLabel()
+ self.__modelCoalMass.setBoundaryFromLabel(label)
+ self.__modelCoal.setBoundaryFromLabel(label)
+
+ # fill the flow and temperature of the coal
+ for coal in range(0, self.__coalNumber):
+ self.__modelCoal.insertItem(self.tr("Coal ") + " " + str(coal+1),
+ self.__boundary.getCoalFlow(coal),
+ self.__boundary.getCoalTemperature(coal))
+
+ # fill the ratio of mass for each class for each coal
+ for coal in range(0, self.__coalNumber) :
+ lastValue = 0.
+ for coalClass in range(0, self.__coalClassesNumber[coal]-1):
+ list = self.__boundary.getCoalRatios(coal)
+ lastValue += list[coalClass]
+ self.__ratio[coal][coalClass] = list[coalClass]
+
+ # last class is computed in order to assure that sum is egal to 100%
+ coalClass = self.__coalClassesNumber[coal]-1
+ lastValue = 100 - lastValue
+ self.__ratio[coal][coalClass] = lastValue
+
+ self.__modelCoalMass.setRatio(self.__ratio)
+
+
+ @pyqtSignature("const QString&")
+ def __slotChoiceVelocity(self, text):
+ """
+ Private slot.
+
+ Input the velocity boundary type choice (norm, ).
+
+ @type text: C{QString}
+ @param text: velocity boundary type choice.
+ """
+ c = self.modelVelocity.dicoV2M[str(text)]
+ log.debug("slotChoiceVelocity: %s " % c)
+ self.__boundary.setVelocityChoice(c)
+
+ if c[-7:] == "formula":
+ self.pushButtonVelocityFormula.setEnabled(True)
+ setGreenColor(self.pushButtonVelocityFormula, True)
+ self.lineEditVelocity.setEnabled(False)
+ self.lineEditVelocity.setText(QString(""))
+ else:
+ self.pushButtonVelocityFormula.setEnabled(False)
+ setGreenColor(self.pushButtonVelocityFormula, False)
+ self.lineEditVelocity.setEnabled(True)
+ v = self.__boundary.getVelocity()
+ self.lineEditVelocity.setText(QString(str(v)))
+
+ self.__updateLabel()
+
+
+ def __updateLabel(self):
+ """
+ Update the unit for the velocity specification.
+ """
+ c = self.__boundary.getVelocityChoice()
+ if c in ('norm', 'norm_formula'):
+ self.labelUnitVelocity.setText(QString(str('m/s')))
+ elif c in ('flow1', 'flow1_formula'):
+ self.labelUnitVelocity.setText(QString(str('kg/s')))
+ elif c in ('flow2', 'flow2_formula'):
+ self.labelUnitVelocity.setText(QString(str('m<sup>3</sup>/s')))
+
+
+ @pyqtSignature("const QString&")
+ def __slotVelocityValue(self, text):
+ """
+ Private slot.
+
+ New value associated to the velocity boundary type.
+
+ @type text: C{QString}
+ @param text: value
+ """
+ v, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setVelocity(v)
+
+
+ @pyqtSignature("")
+ def __slotVelocityFormula(self):
+ """
+ """
+ exp = self.__boundary.getVelocity()
+ c = self.__boundary.getVelocityChoice()
+ req = [('u_norm', 'Norm of the velocity')]
+ if c == 'norm_formula':
+ exa = "u_norm = 1.0;"
+ elif c == 'flow1_formula':
+ exa = "q_m = 1.0;"
+ elif c == 'flow2_formula':
+ exa = "q_v = 1.0;"
+
+ sym = [('x', "X face's gravity center"),
+ ('y', "Y face's gravity center"),
+ ('z', "Z face's gravity center"),
+ ('dt', 'time step'),
+ ('t', 'current time'),
+ ('iter', 'number of iteration')]
+
+ dialog = QMeiEditorView(self, expression = exp,
+ required = req,
+ symbols = sym,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaVelocity -> %s" % str(result))
+ self.__boundary.setVelocity(result)
+ setGreenColor(self.pushButtonVelocityFormula, False)
+
+
+ @pyqtSignature("const QString&")
+ def __slotChoiceDirection(self, text):
+ """
+ Input the direction type choice.
+ """
+ c = self.modelDirection.dicoV2M[str(text)]
+ log.debug("slotChoiceVelocity: %s " % c)
+ self.__boundary.setDirectionChoice(c)
+
+ if c == "formula":
+ self.pushButtonDirectionFormula.setEnabled(True)
+ setGreenColor(self.pushButtonDirectionFormula, True)
+ self.frameDirectionCoordinates.hide()
+ elif c == "coordinates":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ setGreenColor(self.pushButtonDirectionFormula, False)
+ self.frameDirectionCoordinates.show()
+ v = self.__boundary.getDirection('direction_x')
+ self.lineEditDirectionX.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_y')
+ self.lineEditDirectionY.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_z')
+ self.lineEditDirectionZ.setText(QString(str(v)))
+ elif c == "normal":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ setGreenColor(self.pushButtonDirectionFormula, False)
+ self.frameDirectionCoordinates.hide()
+
+
+ @pyqtSignature("const QString&")
+ def __slotDirX(self, text):
+ """
+ INPUT value into direction of inlet flow
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setDirection('direction_x', value)
+
+
+ @pyqtSignature("const QString&")
+ def __slotDirY(self, text):
+ """
+ INPUT value into direction of inlet flow
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setDirection('direction_y', value)
+
+
+ @pyqtSignature("const QString&")
+ def __slotDirZ(self, text):
+ """
+ INPUT value into direction of inlet flow
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setDirection('direction_z', value)
+
+
+ @pyqtSignature("")
+ def __slotDirectionFormula(self):
+ """
+ """
+ exp = self.__boundary.getDirection('direction_formula')
+
+ req = [('dir_x', 'Direction of the flow along X'),
+ ('dir_y', 'Direction of the flow along Y'),
+ ('dir_z', 'Direction of the flow along Z')]
+
+ exa = "dir_x = 3.0;\ndir_y = 1.0;\ndir_z = 0.0;\n"
+
+ sym = [('x', "X face's gravity center"),
+ ('y', "Y face's gravity center"),
+ ('z', "Z face's gravity center"),
+ ('dt', 'time step'),
+ ('t', 'current time'),
+ ('iter', 'number of iteration')]
+
+ dialog = QMeiEditorView(self,expression = exp,
+ required = req,
+ symbols = sym,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaDirection -> %s" % str(result))
+ self.__boundary.setDirection('direction_formula', result)
+ setGreenColor(self.pushButtonDirectionFormula, False)
+
+
+
+ @pyqtSignature("const QString&")
+ def __slotInletType(self, text):
+ """
+ INPUT inlet type : 'oxydant' or 'oxydant + coal'
+ """
+ value = self.modelTypeInlet.dicoV2M[str(text)]
+ log.debug("__slotInletType value = %s " % value)
+
+ self.__boundary.setInletType(value)
+
+ if value == 'oxydantFlow':
+ self.groupBoxCoal.hide()
+ self.groupBoxCoalMass.hide()
+ else:
+ self.groupBoxCoal.show()
+ self.groupBoxCoalMass.show()
+ self.__updateTables()
+
+
+ @pyqtSignature("const QString&")
+ def __slotTemperature(self, text):
+ t, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setOxydantTemperature(t)
+
+
+ @pyqtSignature("int")
+ def __slotOxydantNumber(self, i):
+ self.__boundary.setOxydantNumber(i)
+
+
+ def getCoalNumber(self):
+ """
+ Return the coal number
+ """
+ return self.__coalNumber
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsForm.ui b/gui/Pages/BoundaryConditionsForm.ui
new file mode 100644
index 0000000..e8e57fc
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsForm.ui
@@ -0,0 +1,183 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsForm</class>
+ <widget class="QWidget" name="BoundaryConditionsForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>399</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxMain" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="MinimumExpanding" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title" >
+ <string>Boundary conditions</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QTreeView" name="treeViewBoundaries" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BoundaryConditionsRoughWallView" native="1" name="roughWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BoundaryConditionsSlidingWallView" native="1" name="slidingWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BoundaryConditionsMeteoView" native="1" name="meteoWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BoundaryConditionsVelocityInletView" native="1" name="velocityWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BoundaryConditionsCoalInletView" native="1" name="coalWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BoundaryConditionsTurbulenceInletView" native="1" name="turbulenceWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BoundaryConditionsScalarsView" native="1" name="scalarsWidget" />
+ </item>
+ <item>
+ <widget class="BoundaryConditionsMobileMeshView" native="1" name="mobileMeshWidget" />
+ </item>
+ <item>
+ <widget class="BoundaryConditionsWallRadiativeTransferView" native="1" name="radiativeWidget" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>BoundaryConditionsRoughWallView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsRoughWallView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsSlidingWallView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsSlidingWallView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsVelocityInletView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsVelocityInletView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsCoalInletView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsCoalInletView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsTurbulenceInletView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsTurbulenceInletView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsMeteoView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsMeteoView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsScalarsView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsScalarsView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsMobileMeshView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsMobileMeshView.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>BoundaryConditionsWallRadiativeTransferView</class>
+ <extends>QWidget</extends>
+ <header location="global" >BoundaryConditionsWallRadiativeTransferView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsMeteoForm.ui b/gui/Pages/BoundaryConditionsMeteoForm.ui
new file mode 100644
index 0000000..f81218b
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsMeteoForm.ui
@@ -0,0 +1,73 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsMeteoForm</class>
+ <widget class="QWidget" name="BoundaryConditionsMeteoForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>324</width>
+ <height>103</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxMeteo" >
+ <property name="title" >
+ <string>Atmospheric flows</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>5</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QCheckBox" name="checkBoxReadData" >
+ <property name="text" >
+ <string>meteorological profile from data</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QCheckBox" name="checkBoxAutoNature" >
+ <property name="text" >
+ <string>automatic inlet/outlet nature from data</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>6</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsMeteoView.py b/gui/Pages/BoundaryConditionsMeteoView.py
new file mode 100644
index 0000000..a99c453
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsMeteoView.py
@@ -0,0 +1,180 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- BoundaryConditionsMeteoView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsMeteoForm import Ui_BoundaryConditionsMeteoForm
+from Pages.AtmosphericFlowsModel import AtmosphericFlowsModel
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.Boundary import Boundary
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsMeteoView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsMeteoView(QWidget, Ui_BoundaryConditionsMeteoForm):
+ """
+ Boundary condifition for the velocity part
+ """
+ def __init__(self, parent):
+ """
+ Constructor.
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsMeteoForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case, velocityWidget, turbulenceWidget):
+ """
+ Setup the widget.
+ """
+ self.__case = case
+ self.velocityWidget = velocityWidget
+ self.turbulenceWidget = turbulenceWidget
+ self.__boundary = None
+ self.__model = AtmosphericFlowsModel(self.__case)
+
+ self.connect(self.checkBoxReadData,
+ SIGNAL("clicked(bool)"),
+ self.__slotReadData)
+ self.connect(self.checkBoxAutoNature,
+ SIGNAL("clicked(bool)"),
+ self.__slotAutoNature)
+
+
+ def showWidget(self, b):
+ """
+ Show the widget.
+ """
+ self.__b = b
+ if self.__model.getAtmosphericFlowsModel() != "off" \
+ and self.__model.getMeteoDataStatus() == "on":
+ self.show()
+
+ label = b.getLabel()
+ nature = "meteo_" + b.getNature()
+ self.__boundary = Boundary(nature, label, self.__case)
+
+ if self.__boundary.getMeteoDataStatus() == 'on':
+ self.checkBoxReadData.setChecked(True)
+ self.checkBoxAutoNature.setEnabled(True)
+ self.velocityWidget.hideWidget()
+ self.turbulenceWidget.hideWidget()
+ else:
+ self.checkBoxReadData.setChecked(False)
+ self.checkBoxAutoNature.setEnabled(False)
+ self.velocityWidget.showWidget(b)
+ self.turbulenceWidget.showWidget(b)
+
+ if self.__boundary.getAutomaticNatureStatus() == 'on':
+ self.checkBoxAutoNature.setChecked(True)
+ else:
+ self.checkBoxAutoNature.setChecked(False)
+
+ else:
+ self.hideWidget()
+
+
+ def hideWidget(self):
+ """
+ Hide all.
+ """
+ self.hide()
+
+
+ def __slotReadData(self, bool):
+ """
+ Input if the meteo data must be read.
+ """
+ if bool == True:
+ self.__boundary.setMeteoDataStatus('on')
+ self.checkBoxAutoNature.setEnabled(True)
+ self.velocityWidget.hideWidget()
+ self.turbulenceWidget.hideWidget()
+ else:
+ self.__boundary.setMeteoDataStatus('off')
+ self.checkBoxAutoNature.setChecked(False)
+ self.__boundary.setAutomaticNatureStatus('off')
+ self.checkBoxAutoNature.setEnabled(False)
+ self.velocityWidget.showWidget(self.__b)
+ self.turbulenceWidget.showWidget(self.__b)
+
+
+ def __slotAutoNature(self, bool):
+ """
+ Input if the nature of the boundary must be detected automaticaly.
+ """
+ if bool == True:
+ self.__boundary.setAutomaticNatureStatus('on')
+ else:
+ self.__boundary.setAutomaticNatureStatus('off')
+
+
+ def tr(self, text):
+ """
+ Translation.
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsMobileMeshForm.ui b/gui/Pages/BoundaryConditionsMobileMeshForm.ui
new file mode 100644
index 0000000..cddcc84
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsMobileMeshForm.ui
@@ -0,0 +1,98 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsMobileMeshForm</class>
+ <widget class="QWidget" name="BoundaryConditionsMobileMeshForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>204</width>
+ <height>91</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupMobilBoundary" >
+ <property name="title" >
+ <string>Mobile mesh</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>53</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QComboBox" name="comboMobilBoundary" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IROVAR</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonMobilBoundary" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>53</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsMobileMeshView.py b/gui/Pages/BoundaryConditionsMobileMeshView.py
new file mode 100644
index 0000000..bf241fd
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsMobileMeshView.py
@@ -0,0 +1,201 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- BoundaryConditionsMobileMeshView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+try:
+ import mei
+ _have_mei = True
+except ImportError:
+ _have_mei = False
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsMobileMeshForm import Ui_BoundaryConditionsMobileMeshForm
+from Pages.MobileMeshModel import MobileMeshModel
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, setGreenColor
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.Boundary import Boundary
+
+if _have_mei:
+ from QMeiEditorView import QMeiEditorView
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsMobileMeshView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsMobileMeshView(QWidget, Ui_BoundaryConditionsMobileMeshForm):
+ """
+ Boundary condifition for mobil mesh (ALE and/or Fluid-interaction)
+ """
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsMobileMeshForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+ self.__model = MobileMeshModel(self.__case)
+
+ self.__comboModel = ComboModel(self.comboMobilBoundary, 6, 1)
+ self.__comboModel.addItem(self.tr("Fixed boundary"), "fixed_boundary")
+ self.__comboModel.addItem(self.tr("Sliding boundary"), "sliding_boundary")
+ self.__comboModel.addItem(self.tr("Internal coupling"), "internal_coupling")
+ self.__comboModel.addItem(self.tr("External coupling"), "external_coupling")
+ self.__comboModel.addItem(self.tr("Fixed velocity"), "fixed_velocity")
+ self.__comboModel.addItem(self.tr("Fixed displacement"), "fixed_displacement")
+
+ self.connect(self.comboMobilBoundary,
+ SIGNAL("activated(const QString&)"),
+ self.__slotCombo)
+ self.connect(self.pushButtonMobilBoundary,
+ SIGNAL("clicked(bool)"),
+ self.__slotFormula)
+
+
+ @pyqtSignature("const QString&")
+ def __slotFormula(self, text):
+ """
+ Run formula editor.
+ """
+ exp = self.__boundary.getFormula()
+ aleChoice = self.__boundary.getALEChoice();
+
+ if aleChoice == "fixed_velocity":
+ if not exp:
+ exp = 'mesh_u ='
+ req = [('mesh_u', 'Fixed velocity of the mesh'),
+ ('mesh_v', 'Fixed velocity of the mesh'),
+ ('mesh_w', 'Fixed velocity of the mesh')]
+ exa = 'mesh_u = 1000;\nmesh_v = 1000;\nmesh_w = 1000;'
+ elif aleChoice == "fixed_displacement":
+ if not exp:
+ exp = 'mesh_x ='
+ req = [('mesh_x', 'Fixed displacement of the mesh'),
+ ('mesh_y', 'Fixed displacement of the mesh'),
+ ('mesh_z', 'Fixed displacement of the mesh')]
+ exa = 'mesh_x = 1000;\nmesh_y = 1000;\nmesh_z = 1000;'
+
+ symbs = [('dt', 'time step'),
+ ('t', 'current time'),
+ ('iter', 'number of iteration')]
+
+ dialog = QMeiEditorView(self,
+ expression = exp,
+ required = req,
+ symbols = symbs,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaMobileMeshBoundary -> %s" % str(result))
+ self.__boundary.setFormula(result)
+ setGreenColor(self.pushButtonMobilBoundary, False)
+
+
+ @pyqtSignature("const QString&")
+ def __slotCombo(self, text):
+ """
+ Called when the combobox changed.
+ """
+ modelData = self.__comboModel.dicoV2M[str(text)]
+ # Enable/disable formula button.
+ isFormulaEnabled = _have_mei and modelData in ["fixed_velocity", "fixed_displacement"]
+ self.pushButtonMobilBoundary.setEnabled(isFormulaEnabled)
+ setGreenColor(self.pushButtonMobilBoundary, isFormulaEnabled)
+ self.__boundary.setALEChoice(modelData)
+
+
+ def showWidget(self, b):
+ """
+ Show the widget
+ """
+ if self.__model.getMethod() != "off":
+ self.__boundary = Boundary("mobile_boundary", b.getLabel(), self.__case)
+ modelData = self.__boundary.getALEChoice()
+ self.__comboModel.setItem(str_model=modelData)
+ isFormulaEnabled = _have_mei and modelData in ["fixed_velocity", "fixed_displacement"]
+ self.pushButtonMobilBoundary.setEnabled(isFormulaEnabled)
+ self.show()
+ else:
+ self.hideWidget()
+
+
+ def hideWidget(self):
+ """
+ Hide all
+ """
+ self.hide()
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsParticlesModel.py b/gui/Pages/BoundaryConditionsParticlesModel.py
new file mode 100644
index 0000000..69698aa
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsParticlesModel.py
@@ -0,0 +1,755 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+This module defines the lagrangian two phase flow modelling management.
+
+This module contains the following classes and function:
+- LagrangianBoundariesModel
+- LagrangianBoundariesTestCase
+"""
+
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import sys, unittest, logging
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Pages.LagrangianModel import LagrangianModel
+
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianBoundariesModel")
+log.setLevel(Tool.GuiParam.DEBUG)
+
+
+#-------------------------------------------------------------------------------
+# lagrangian model class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianBoundariesModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Lagrangian module.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_boundaries = self.case.root().xmlInitNode('boundary_conditions')
+ self.default = self.defaultParticlesBoundaryValues()
+
+
+ def defaultParticlesBoundaryValues(self):
+ """
+ Return a dictionnary which contains default values.
+ """
+ default = {}
+ default['particles'] = "inlet"
+ default['nbclas'] = 0
+ default['number'] = 0
+ default['frequency'] = 0
+ default['statistical_groups'] = 0.
+ default['statistical_weight_choice'] = "prescribed"
+ default['statistical_weight'] = 0
+ default['mass_flow_rate'] = 0.
+ default['density'] = 0.
+ default['velocity_choice'] = "fluid"
+ default['velocity_norm'] = 0.
+ default['velocity_value'] = 0.
+ default['temperature_choice'] = "prescribed"
+ default['temperature'] = 0.
+ default['specific_heat'] = 0.
+ default['emissivity'] = 0.
+ default['diameter_choice'] = "prescribed"
+ default['diameter'] = 0.
+ default['diameter_standard_deviation'] = 0.
+ default['coal_number'] = 0
+ default['coal_temperature'] = 0.
+ default['raw_coal_mass_fraction'] = 0.
+ default['char_mass_fraction'] = 0.
+ return default
+
+
+ def setBoundaryChoice(self, nature, labelbc, value):
+ """
+ Update value for the boundary condition. Here we defined the xml nodes
+ 'self.node_boundary' and 'self.node_particles' used in many functions.
+ """
+ if nature == "inlet":
+ self.isInList(value, ["inlet"])
+ elif nature == "outlet":
+ self.isInList(value, ["outlet"])
+ elif nature == "symmetry":
+ self.isInList(value, ["bounce"])
+ elif nature == "wall":
+ l = [ "inlet", "bounce", "deposit1", "deposit2", "deposit3", "depositfa"]
+ #if iscoal: l.append("encra")
+ self.isInList(value, l)
+ self.node_boundary = self.node_boundaries.xmlInitChildNode(nature, label=labelbc)
+ self.node_particles = self.node_boundary.xmlInitChildNode('particles', 'choice')
+ self.node_particles['choice'] = value
+ self.setCurrentBoundaryNode(nature, labelbc)
+
+
+ def getBoundaryChoice(self, nature, labelbc):
+ """
+ Return value for the boundary condition.
+ """
+ default = { "wall" : "deposit1", "inlet" : "inlet",
+ "outlet" : "outlet", "symmetry" : "bounce"}
+ self.setCurrentBoundaryNode(nature, labelbc)
+ if self.node_particles:
+ val = self.node_particles['choice']
+ if val == None or val == "":
+ val = default[nature]
+ self.setBoundaryChoice(nature, labelbc, val)
+ return val
+
+
+ def setCurrentBoundaryNode(self, nature, labelbc):
+ """
+ Update the current boundary node.
+ """
+ self.node_boundary = self.node_boundaries.xmlInitChildNode(nature, label=labelbc)
+ self.node_particles = self.node_boundary.xmlInitChildNode('particles', 'choice')
+
+
+ def newClassNode(self):
+ """
+ Add a new 'class' node with child nodes.
+ """
+ node_class = self.node_particles.xmlAddChild('class')
+ node_class.xmlSetData('number', self.default['number'])
+ node_class.xmlSetData('frequency', self.default['frequency'])
+ node_class.xmlSetData('statistical_groups', self.default['statistical_groups'])
+ node_class.xmlSetData('mass_flow_rate', self.default['mass_flow_rate'])
+ node_class.xmlSetData('density', self.default['density'])
+
+ node_class.xmlInitChildNode('statitical_weight', choice=self.default['statistical_weight_choice'])
+ node_class.xmlSetData('statitical_weight', self.default['statistical_weight'])
+
+ node_class.xmlInitChildNode('velocity', choice=self.default['velocity_choice'])
+ #node_class.xmlSetData('', self.default[''])
+
+ node_class.xmlInitChildNode('diameter', choice=self.default['diameter_choice'])
+ node_class.xmlSetData('diameter', self.default['diameter'])
+ node_class.xmlSetData('diameter_standard_deviation', self.default['diameter_standard_deviation'])
+
+ node_class.xmlInitChildNode('temperature', choice=self.default['temperature_choice'])
+ node_class.xmlSetData('temperature', self.default['temperature'])
+
+## node_class.xmlSetData('specific_heat', self.default['specific_heat'])
+## node_class.xmlSetData('emissivity', self.default['emissivity'])
+## node_class.xmlSetData('coal_number', self.default['coal_number'])
+## node_class.xmlSetData('raw_coal_mass_fraction', self.default['raw_coal_mass_fraction'])
+## node_class.xmlSetData('char_mass_fraction', self.default['char_mass_fraction'])
+
+
+ def setNumberOfClassesValue(self, labelbc, value):
+ """
+ Update the number of classes. Create or delete nodes if necessary.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ node_list = self.node_particles.xmlGetChildNodeList('class')
+ nnodes = len(node_list)
+ if value > nnodes:
+ for i in range(value-nnodes):
+ self.newClassNode()
+ else:
+ for i in range(nnodes-value):
+ node_list[-1].xmlRemoveNode()
+ # redefine self.node_class
+ self.setCurrentClassNode(labelbc, value)
+
+
+ def getNumberOfClassesValue(self, labelbc):
+ """
+ Return the number of classes.
+ """
+ node_list = self.node_particles.xmlGetChildNodeList('class')
+ value = len(node_list)
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['nbclas']
+ self.setNumberOfClassesValue(labelbc, value)
+ return value
+
+
+ def setCurrentClassNode(self, labelbc, iclass):
+ """
+ Update the current class node.
+ """
+ choice = self.node_particles['choice']
+ self.isInList(choice, ["inlet"])
+ self.isInt(iclass)
+ self.node_class = None
+## from PyQt4.QtCore import pyqtRemoveInputHook
+## pyqtRemoveInputHook()
+## import pdb
+## pdb.set_trace()
+ nodes_list = self.node_particles.xmlGetChildNodeList('class')
+ if nodes_list:
+ nnodes = len(nodes_list)
+ self.isLowerOrEqual(iclass, nnodes)
+ self.node_class = nodes_list[iclass-1]
+
+
+## def getCurrentClassNode(self):
+## """
+## Return the current class node.
+## """
+## if hasattr(self, "node_class"):
+## return self.node_class
+## return None
+
+
+ def setNumberOfParticulesInClassValue(self, label, iclass, value):
+ """
+ Update the number of particles in a class.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+## node = self.node_class.xmlInitChildNode('number')
+## node.xmlSetTextNode(value)
+ self.node_class.xmlSetData('number', value)
+
+
+ def getNumberOfParticulesInClassValue(self, label, iclass):
+ """
+ Return the number of particles in a class.
+ """
+ value = self.node_class.xmlGetInt('number')
+ print "getNumberOfParticulesInClassValue value = ", value
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['number']
+ self.setNumberOfParticulesInZoneValue(label, iclass,value)
+ return value
+
+
+ def setInjectionFrequencyValue(self, label, iclass, value):
+ """
+ Update the injection frequency.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('frequency', value)
+
+
+ def getInjectionFrequencyValue(self, label, iclass):
+ """
+ Return the injection frequency.
+ """
+ value = self.node_class.xmlGetInt('frequency')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['frequency']
+ self.setInjectionFrequencyValue(label, iclass, value)
+ return value
+
+
+ def setParticleGroupNumberValue(self, label, iclass, value):
+ """
+ Update the group number of the particle.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('statistical_groups', value)
+
+
+ def getParticleGroupNumberValue(self, label, iclass):
+ """
+ Return the group number of the particle.
+ """
+ value = self.node_class.xmlGetInt('statistical_groups')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['statistical_groups']
+ self.setParticleGroupNumberValue(label, iclass, value)
+ return value
+
+
+ def setMassFlowRateValue(self, label, iclass, value):
+ """
+ Update the mass flow rate value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('mass_flow_rate', value)
+
+
+ def getMassFlowRateValue(self, label, iclass):
+ """
+ Return the mass flow rate value.
+ """
+ value = self.node_class.xmlGetDouble('mass_flow_rate')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['mass_flow_rate']
+ self.setMassFlowRateValue(label, iclass, value)
+ return value
+
+
+ def setStatisticalWeightChoice(self, label, iclass, value):
+ """
+ Update the condition on statistical weight.
+ """
+ self.isInList(value, ["rate", "prescribed", "subroutine"])
+ node = self.node_class.xmlInitChildNode('statistical_weight', 'choice')
+ node['choice'] = value
+
+
+ def getStatisticalWeightChoice(self, label, iclass):
+ """
+ Return the condition on statistical weight.
+ """
+ node = self.node_class.xmlInitChildNode('statistical_weight', 'choice')
+ if node:
+ val = node['choice']
+ if val == None or val == "":
+ val = self.defaultParticlesBoundaryValues()['statistical_weight_choice']
+ self.setStatisticalWeightChoice(label, iclass, val)
+ return val
+
+
+ def setStatisticalWeightValue(self, label, iclass, value):
+ """
+ Update the statistical weight value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('statistical_weight', value)
+
+
+ def getStatisticalWeightValue(self, label, iclass):
+ """
+ Return the statistical weight value.
+ """
+ value = self.node_class.xmlGetDouble('statistical_weight')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['statistical_weight']
+ self.setStatisticalWeightValue(label, iclass, value)
+ return value
+
+
+ def setDensityValue(self, label, iclass, value):
+ """
+ Update the density value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('density', value)
+
+
+ def getDensityValue(self, label, iclass):
+ """
+ Return the density value.
+ """
+ value = self.node_class.xmlGetDouble('density')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['density']
+ self.setDensityValue(label, iclass, value)
+ return value
+
+
+ def setVelocityChoice(self, label, iclass, choice):
+ """
+ Update the condition on velocity.
+ """
+ self.isInList(choice, ["fluid", "components", "norm", "subroutine"])
+ node_velocity = self.node_class.xmlInitChildNode('velocity', 'choice')
+ node_velocity['choice'] = choice
+ if choice in ["fluid", "norm", "subroutine"]:
+ node_velocity.xmlRemoveChild('velocity_x')
+ node_velocity.xmlRemoveChild('velocity_y')
+ node_velocity.xmlRemoveChild('velocity_z')
+ elif choice in ["fluid", "components", "subroutine"]:
+ node_velocity.xmlRemoveChild('norm')
+
+
+ def getVelocityChoice(self, label, iclass):
+ """
+ Return the condition on velocity.
+ """
+ node = self.node_class.xmlInitChildNode('velocity', 'choice')
+ if node:
+ val = node['choice']
+ if val == None:
+ val = self.defaultParticlesBoundaryValues()['velocity_choice']
+ self.setVelocityChoice(val)
+ return val
+
+
+ def setVelocityNormValue(self, label, iclass, value):
+ """
+ Update the velocity norm.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0.)
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="norm")
+ choice = node_velocity['choice']
+ self.isInList(choice, ["norm"])
+ node_velocity.xmlSetData('norm', value)
+
+
+ def getVelocityNormValue(self, label, iclass):
+ """
+ Return the velocity norm.
+ """
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="norm")
+ value = node_velocity.xmlGetDouble('norm')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['velocity_norm']
+ self.setVelocityNormValue(label, iclass, value)
+ return value
+
+
+ def setVelocityDirectionValue(self, label, iclass, idir, value):
+ """
+ Update the velocity value in the given direction.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0.)
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="components")
+ choice = node_velocity['choice']
+ self.isInList(choice, ["components"])
+ node_velocity.xmlSetData('velocity_' + idir, value)
+
+
+ def getVelocityDirectionValue(self, label, iclass, idir):
+ """
+ Return the velocity value in the given direction.
+ """
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="components")
+ value = self.node_class.xmlGetDouble('velocity_' + idir)
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['velocity_value']
+ self.setVelocityDirectionValue(label, iclass, idir, value)
+ return value
+
+
+ def setTemperatureChoice(self, label, iclass, value):
+ """
+ Update the condition on temperature.
+ """
+ self.isInList(value, ["prescribed", "subroutine"])
+ node = self.node_class.xmlInitChildNode('temperature', 'choice')
+ node['choice'] = value
+
+
+ def getTemperatureChoice(self, label, iclass):
+ """
+ Return the condition on temperature.
+ """
+ node = self.node_class.xmlInitChildNode('temperature', 'choice')
+ if node:
+ val = node['choice']
+ if val == None:
+ val = self.defaultParticlesBoundaryValues()['temperature_choice']
+ self.setTemperatureChoice(label, iclass, val)
+ return val
+
+
+ def setTemperatureValue(self, label, iclass, value):
+ """
+ Update the temperature value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('temperature', value)
+
+
+ def getTemperatureValue(self, label, iclass):
+ """
+ Return the temperature value.
+ """
+ value = self.node_class.xmlGetDouble('temperature')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['temperature']
+ self.setTemperatureValue(label, iclass, value)
+ return value
+
+
+ def setSpecificHeatValue(self, label, iclass, value):
+ """
+ Update the specific heat value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('specific_heat', value)
+
+
+ def getSpecificHeatValue(self, label, iclass):
+ """
+ Return the specific heat value.
+ """
+ value = self.node_class.xmlGetDouble('specific_heat')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['specific_heat']
+ self.setSpecificHeatValue(label, iclass, value)
+ return value
+
+
+ def setEmissivityValue(self, label, iclass, value):
+ """
+ Update the emissivity value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('emissivity', value)
+
+
+ def getEmissivityValue(self, label, iclass):
+ """
+ Return the emissivity value.
+ """
+ value = self.node_class.xmlGetDouble('emissivity')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['emissivity']
+ self.setEmissivityValue(label, iclass, value)
+ return value
+
+
+ def setDiameterChoice(self, label, iclass, value):
+ """
+ Update the condition on the particle diameter.
+ """
+ self.isInList(value, ["prescribed", "subroutine"])
+ node = self.node_class.xmlInitChildNode('diameter', 'choice')
+ node['choice'] = value
+
+
+ def getDiameterChoice(self, label, iclass):
+ """
+ Return the condition on the particle diameter.
+ """
+ node = self.node_class.xmlInitChildNode('diameter', 'choice')
+ if node:
+ val = node['choice']
+ if val == None:
+ val = self.defaultParticlesBoundaryValues()['diameter_choice']
+ self.setDiameterChoice(label, iclass, val)
+ return val
+
+
+ def setDiameterValue(self, label, iclass, value):
+ """
+ Update the particle diameter value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('diameter', value)
+
+
+ def getDiameterValue(self, label, iclass):
+ """
+ Return the particle diameter value.
+ """
+ value = self.node_class.xmlGetDouble('diameter')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['diameter']
+ self.setDiameterValue(label, iclass, value)
+ return value
+
+
+ def setDiameterVarianceValue(self, label, iclass, value):
+ """
+ Update the particle diameter variance value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('diameter_standard_deviation', value)
+
+
+ def getDiameterVarianceValue(self, label, iclass):
+ """
+ Return the particle diameter variance value.
+ """
+ value = self.node_class.xmlGetDouble('diameter_standard_deviation')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['diameter_standard_deviation']
+ self.setDiameterVarianceValue(label, iclass, value)
+ return value
+
+
+ def setCoalNumberValue(self, label, iclass, value):
+ """
+ Update the coal number of the particle.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('coal_number', value)
+
+
+ def getCoalNumberValue(self, label, iclass):
+ """
+ Return the coal number of the particle.
+ """
+ value = self.node_class.xmlGetInt('coal_number')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['coal_number']
+ self.setCoalNumberValue(label, iclass, value)
+ return value
+
+
+ def setCoalTemperatureValue(self, label, iclass, value):
+ """
+ Update the coal temperature.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('coal_temperature', value)
+
+
+ def getCoalTemperatureValue(self, label, iclass):
+ """
+ Return the coal temperature.
+ """
+ value = self.node_class.xmlGetDouble('coal_temperature')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['coal_temperature']
+ self.setCoalTemperatureValue(label, iclass, value)
+ return value
+
+
+ def setCoalMassValue(self, label, iclass, value):
+ """
+ Update the coal mass value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('raw_coal_mass_fraction', value)
+
+
+ def getCoalMassValue(self, label, iclass):
+ """
+ Return the coal mass value.
+ """
+ value = self.node_class.xmlGetDouble('raw_coal_mass_fraction')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['raw_coal_mass_fraction']
+ self.setCoalMassValue(label, iclass, value)
+ return value
+
+
+ def setCokeMassValue(self, label, iclass, value):
+ """
+ Update the coke mass value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('char_mass_fraction', value)
+
+
+ def getCokeMassValue(self, label, iclass):
+ """
+ Return the coke mass value.
+ """
+ value = self.node_class.xmlGetDouble('char_mass_fraction')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['char_mass_fraction']
+ self.setCokeMassValue(label, iclass, svalue)
+ return value
+
+
+#-------------------------------------------------------------------------------
+# LagrangianBoundaries test case
+#-------------------------------------------------------------------------------
+
+
+class LagrangianBoundariesTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """
+ This method is executed before all "check" methods.
+ """
+ from Base.XMLengine import Case
+ from Base.XMLinitialize import XMLinit
+ self.case = Case()
+ XMLinit(self.case)
+
+
+ def tearDown(self):
+ """
+ This method is executed after all "check" methods.
+ """
+ del self.case
+
+
+ def checkLagrangianBoundariesInstantiation(self):
+ """
+ Check whether the LagrangianBoundariesModel class could be instantiated
+ """
+ model = None
+ model = LagrangianBoundariesModel(self.case)
+
+ assert model != None, 'Could not instantiate LagrangianBoundariesModel'
+
+
+ def checkLagrangianBoundariesDefaultValues(self):
+ """
+ Check the default values
+ """
+ model = LagrangianBoundariesModel(self.case)
+ doc = """"""
+
+ assert model.node_output == self.xmlNodeFromString(doc),\
+ 'Could not get default values for model'
+
+
+def suite():
+ testSuite = unittest.makeSuite(LagrangianBoundariesTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "LagrangianBoundariesTestCase A COMPLETER *********."
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsParticlesView.py b/gui/Pages/BoundaryConditionsParticlesView.py
new file mode 100644
index 0000000..c47b2d6
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsParticlesView.py
@@ -0,0 +1,828 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- ValueDelegate
+- StandardItemModelBoundaries
+- LagrangianBoundariesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+
+import logging
+
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from LagrangianBoundariesForm import Ui_LagrangianBoundariesForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import IntValidator, DoubleValidator, ComboModel
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.LagrangianBoundariesModel import LagrangianBoundariesModel
+from Pages.LagrangianModel import LagrangianModel
+from Pages.LagrangianStatisticsModel import LagrangianStatisticsModel
+
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianBoundariesView")
+log.setLevel(GuiParam.DEBUG)
+
+
+#-------------------------------------------------------------------------------
+# Line edit delegate with an integere validator
+#-------------------------------------------------------------------------------
+
+
+class ValueDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(ValueDelegate, self).__init__(parent)
+ self.parent = parent
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = IntValidator(editor, min=0, max=20) # nb max classes
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+ def setModelData(self, editor, model, index):
+ value, ok = editor.text().toDouble()
+ if editor.validator().state == QValidator.Acceptable:
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+
+#-------------------------------------------------------------------------------
+# QComboBox delegate for the particle-boundary interaction
+#-------------------------------------------------------------------------------
+
+
+class ParticleBoundaryInteractionDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent):
+ super(ParticleBoundaryInteractionDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ self.combo_mdl = ComboModel(editor,1,1)
+ nature = index.model()._data[index.row()][1]
+ self.dico = index.model().dicoM2V[nature]
+ for k, v in self.dico.items():
+ self.combo_mdl.addItem(v, k)
+ editor.installEventFilter(self)
+ #editor.setSizeAdjustPolicy(QComboBox.AdjustToContents)
+ editor.setMinimumWidth(100)
+ return editor
+
+
+ def setEditorData(self, comboBox, index):
+ row = index.row()
+ col = index.column()
+ str_model = index.model()._data[row][col]
+ self.combo_mdl.setItem(str_model=str_model)
+
+
+ def setModelData(self, comboBox, model, index):
+ txt = str(comboBox.currentText())
+ value = self.combo_mdl.dicoV2M[txt]
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+
+ def tr(self, text):
+ return text
+
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class to display boundaries in a QTreeView
+#-------------------------------------------------------------------------------
+
+
+class StandardItemModelBoundaries(QStandardItemModel):
+ def __init__(self, case, model):
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Label"), self.tr("Nature"),
+ self.tr("Particle-boundary\ninteraction"),
+ self.tr("Number of classes")]
+ self.setColumnCount(len(self.headers))
+ self.case = case
+ self.model = model
+ self._data = []
+
+ # Corresponding dict for the nature of the boundary. used in combo delegate.
+ self.dicoM2V = {
+ "wall" : { "inlet" : self.tr("Particles injection zone"),
+ "bounce" : self.tr("Particles rebound zone"),
+ "deposit1" : self.tr("Particles deposit"),
+ "deposit2" : self.tr("Particles deposit + memory"),
+ "deposit3" : self.tr("Particles deposit + suspension"),
+ "depositfa" : self.tr("Particles deposit + attachment force") },
+ "inlet" : { "inlet" : self.tr("Particles injection zone") },
+ "outlet" : { "outlet" : self.tr("Particles outlet zone") },
+ "symmetry" : { "bounce" : self.tr("Particles rebound zone") }
+ }
+
+ self.dicoV2M = {}
+ for key in self.dicoM2V.keys():
+ dico = self.dicoM2V[key]
+ self.dicoV2M[key] = {}
+ for k, v in dico.items():
+ self.dicoV2M[key][v] = k
+
+ # Initialization
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ label = zone.getLabel()
+ nature = zone.getNature()
+ interaction = self.model.getBoundaryChoice(nature, label)
+ nclasses = self.model.getNumberOfClassesValue(label)
+ line = [label, nature, interaction, nclasses]
+ self._data.append(line)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.DisplayRole:
+ row = index.row()
+ col = index.column()
+ if col == 2:
+ nature = self._data[row][1]
+ dico = self.dicoM2V[nature]
+ return QVariant(dico[self._data[row][col]])
+ else:
+ return QVariant(self._data[row][col])
+
+ if role == Qt.ToolTipRole:
+ if index.column() == 2:
+ return QVariant(self.tr("Code_Saturne keyword: IUSCLB"))
+ elif index.column() == 3:
+ return QVariant(self.tr("Code_Saturne keyword: NBCLAS"))
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() in [0,1]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ elif index.column() == 2:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ elif index.column() == 3:
+ if self._data[index.row()][2] == "inlet":
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+ col = index.column()
+
+ if col == 2:
+ interaction = str(value.toString())
+ self._data[row][col] = interaction
+ label = self._data[row][0]
+ nature = self._data[row][1]
+ self.model.setBoundaryChoice(nature, label, interaction)
+ if nature != "inlet":
+ self._data[row][3] = 0
+
+ elif col == 3:
+ nclasses, ok = value.toInt()
+ self._data[row][col] = nclasses
+ label = self._data[row][0]
+ nn = self.model.getNumberOfClassesValue(label)
+ label = self._data[row][0]
+ self.model.setNumberOfClassesValue(label, nclasses)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def getItem(self, row):
+ return self._data[row]
+
+
+ def tr(self, text):
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianBoundariesView(QWidget, Ui_LagrangianBoundariesForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_LagrangianBoundariesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = LagrangianBoundariesModel(self.case)
+
+ self.modelBoundaries = StandardItemModelBoundaries(self.case, self.model)
+ self.tableViewBoundaries.setModel(self.modelBoundaries)
+ self.tableViewBoundaries.setAlternatingRowColors(True)
+## self.tableViewBoundaries.setSelectionBehavior(QAbstractItemView.SelectItems)
+## self.tableViewBoundaries.setSelectionMode(QAbstractItemView.ExtendedSelection)
+## self.tableViewBoundaries.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewBoundaries.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ delegateInteraction = ParticleBoundaryInteractionDelegate(self.tableViewBoundaries)
+ delegateClassNumber = ValueDelegate(self.tableViewBoundaries)
+ self.tableViewBoundaries.setItemDelegateForColumn(2,delegateInteraction)
+ self.tableViewBoundaries.setItemDelegateForColumn(3,delegateClassNumber)
+
+ self.modelIPOIT = ComboModel(self.comboBoxIPOIT,3,1)
+ self.modelIPOIT.addItem(self.tr("Volumic flow rate"), "rate")
+ self.modelIPOIT.addItem(self.tr("Statistical weight set by values"), "prescribed")
+ self.modelIPOIT.addItem(self.tr("User defined statistical weight"), "subroutine")
+
+ self.modelIJUVW = ComboModel(self.comboBoxIJUVW,4,1)
+ self.modelIJUVW.addItem(self.tr("Fluid velocity"), "fluid")
+ self.modelIJUVW.addItem(self.tr("Normal direction velocity"), "norm")
+ self.modelIJUVW.addItem(self.tr("Velocity given by values"), "components")
+ self.modelIJUVW.addItem(self.tr("User defined velocity"), "subroutine")
+
+ self.modelIJRTP = ComboModel(self.comboBoxIJRTP,2,1)
+ self.modelIJRTP.addItem(self.tr("Temperature set by values"), "prescribed")
+ self.modelIJRTP.addItem(self.tr("User defined temperature"), "subroutine")
+
+ self.modelIJRDP = ComboModel(self.comboBoxIJRDP,2,1)
+ self.modelIJRDP.addItem(self.tr("Diameter set by values"), "prescribed")
+ self.modelIJRDP.addItem(self.tr("User defined diameter"), "subroutine")
+
+ self.connect(self.tableViewBoundaries, SIGNAL("clicked(const QModelIndex &)"), self.slotSelectBoundary)
+ self.connect(self.modelBoundaries, SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), self.slotEditBoundary)
+ self.connect(self.spinBoxICLAS, SIGNAL("valueChanged(int)"), self.slotICLAS)
+
+ self.connect(self.lineEditIJNBP, SIGNAL("textChanged(const QString &)"), self.slotIJNBP)
+ self.connect(self.lineEditIJFRE, SIGNAL("textChanged(const QString &)"), self.slotIJFRE)
+ self.connect(self.lineEditICLST, SIGNAL("textChanged(const QString &)"), self.slotICLST)
+ self.connect(self.lineEditIDEBT, SIGNAL("textChanged(const QString &)"), self.slotIDEBT)
+ self.connect(self.comboBoxIPOIT, SIGNAL("activated(const QString&)"), self.slotIPOITChoice)
+ self.connect(self.lineEditIPOIT, SIGNAL("textChanged(const QString &)"), self.slotIPOIT)
+ self.connect(self.lineEditIROPT, SIGNAL("textChanged(const QString &)"), self.slotIROPT)
+
+ self.connect(self.comboBoxIJUVW, SIGNAL("activated(const QString&)"), self.slotIJUVW)
+ self.connect(self.lineEditIUNO, SIGNAL("textChanged(const QString &)"), self.slotIUNO)
+ self.connect(self.lineEditIUPT, SIGNAL("textChanged(const QString &)"), self.slotIUPT)
+ self.connect(self.lineEditIVPT, SIGNAL("textChanged(const QString &)"), self.slotIVPT)
+ self.connect(self.lineEditIWPT, SIGNAL("textChanged(const QString &)"), self.slotIWPT)
+
+ self.connect(self.comboBoxIJRTP, SIGNAL("activated(const QString&)"), self.slotIJRTP)
+ self.connect(self.lineEditITPT, SIGNAL("textChanged(const QString &)"), self.slotITPT)
+ self.connect(self.lineEditICPT, SIGNAL("textChanged(const QString &)"), self.slotICPT)
+ self.connect(self.lineEditIEPSI, SIGNAL("textChanged(const QString &)"), self.slotIEPSI)
+
+ self.connect(self.comboBoxIJRDP, SIGNAL("activated(const QString&)"), self.slotIJRDP)
+ self.connect(self.lineEditIDPT, SIGNAL("textChanged(const QString &)"), self.slotIDPT)
+ self.connect(self.lineEditIVDPT, SIGNAL("textChanged(const QString &)"), self.slotIVDPT)
+
+ self.connect(self.lineEditINUCHL, SIGNAL("textChanged(const QString &)"), self.slotINUCHL)
+ self.connect(self.lineEditIHPT, SIGNAL("textChanged(const QString &)"), self.slotIHPT)
+ self.connect(self.lineEditIMCHT, SIGNAL("textChanged(const QString &)"), self.slotIMCHT)
+ self.connect(self.lineEditIMCKT, SIGNAL("textChanged(const QString &)"), self.slotIMCKT)
+
+ # Validators
+ validatorIJNBP = IntValidator(self.lineEditIJNBP, min=0)
+ validatorIJFRE = IntValidator(self.lineEditIJFRE, min=0)
+ validatorICLST = IntValidator(self.lineEditICLST, min=0)
+ validatorIDEBT = DoubleValidator(self.lineEditIDEBT, min=0.)
+ validatorIPOIT = IntValidator(self.lineEditIPOIT, min=0)
+ validatorIROPT = DoubleValidator(self.lineEditIROPT, min=0.)
+
+ validatorIUNO = DoubleValidator(self.lineEditIUNO) #, min=0.)
+ validatorIUPT = DoubleValidator(self.lineEditIUPT)
+ validatorIVPT = DoubleValidator(self.lineEditIVPT)
+ validatorIWPT = DoubleValidator(self.lineEditIWPT)
+
+ validatorITPT = DoubleValidator(self.lineEditITPT)#, min=0.)
+ validatorICPT = DoubleValidator(self.lineEditICPT)
+ validatorIEPSI = DoubleValidator(self.lineEditIEPSI)
+
+ validatorIDPT = DoubleValidator(self.lineEditIDPT, min=0.)
+ validatorIVDPT = DoubleValidator(self.lineEditIVDPT)
+
+ validatorINUCHL = IntValidator(self.lineEditINUCHL, min=0)
+ validatorIHPT = DoubleValidator(self.lineEditIHPT)
+ validatorIMCHT = DoubleValidator(self.lineEditIMCHT, min=0.)
+ validatorIMCKT = DoubleValidator(self.lineEditIMCKT, min=0.)
+
+ self.lineEditIJNBP.setValidator(validatorIJNBP)
+ self.lineEditIJFRE.setValidator(validatorIJFRE)
+ self.lineEditICLST.setValidator(validatorICLST)
+ self.lineEditIDEBT.setValidator(validatorIDEBT)
+ self.lineEditIPOIT.setValidator(validatorIPOIT)
+ self.lineEditIROPT.setValidator(validatorIROPT)
+
+ self.lineEditIUNO.setValidator(validatorIUNO)
+ self.lineEditIUPT.setValidator(validatorIUPT)
+ self.lineEditIVPT.setValidator(validatorIVPT)
+ self.lineEditIWPT.setValidator(validatorIWPT)
+
+ self.lineEditITPT.setValidator(validatorITPT)
+ self.lineEditICPT.setValidator(validatorICPT)
+ self.lineEditIEPSI.setValidator(validatorIEPSI)
+
+ self.lineEditIDPT.setValidator(validatorIDPT)
+ self.lineEditIVDPT.setValidator(validatorIVDPT)
+
+ self.lineEditINUCHL.setValidator(validatorINUCHL)
+ self.lineEditIHPT.setValidator(validatorIHPT)
+ self.lineEditIMCHT.setValidator(validatorIMCHT)
+ self.lineEditIMCKT.setValidator(validatorIMCKT)
+
+ self._hideAllWidgets()
+
+
+ def _hideAllWidgets(self):
+ self.groupBoxClassNumber.hide()
+ self.groupBoxMain.hide()
+ self.groupBoxRate.hide()
+ self.groupBoxVelocity.hide()
+ self.groupBoxTemperature.hide()
+ self.groupBoxDiameter.hide()
+ self.groupBoxCoal.hide()
+
+
+ @pyqtSignature("const QModelIndex&, const QModelIndex&")
+ def slotEditBoundary(self, index, index2):
+ """
+ """
+ self.slotSelectBoundary(index)
+
+
+ @pyqtSignature("const QModelIndex&")
+ def slotSelectBoundary(self, index):
+ """
+ """
+ self._hideAllWidgets()
+ label, nature, interaction, nclasses = self.modelBoundaries.getItem(index.row())
+ self.label = label
+ if interaction != "inlet":
+ return
+ self.model.setCurrentBoundaryNode(nature, label)
+ if nclasses > 0:
+ self.groupBoxClassNumber.show()
+ self.spinBoxICLAS.setMinimum(1)
+ self.spinBoxICLAS.setMaximum(nclasses)
+ self.spinBoxICLAS.setValue(1)
+ self.slotICLAS(1)
+ else:
+ return
+
+
+ @pyqtSignature("int")
+ def slotICLAS(self, iclass):
+ """
+ Input ICLAS.
+ """
+ self.iclass = iclass
+ index = self.tableViewBoundaries.currentIndex()
+ label, nature, interaction, nclasses = self.modelBoundaries.getItem(index.row())
+ if interaction == "inlet":
+ self.model.setCurrentClassNode(self.label, iclass)
+
+ self.LM = LagrangianModel(self.case)
+ part_model = self.LM.getParticlesModel()
+
+ # Main variables
+ self.groupBoxMain.show()
+ npart = self.model.getNumberOfParticulesInClassValue(self.label, self.iclass)
+ self.lineEditIJNBP.setText(QString(str(npart)))
+ freq = self.model.getInjectionFrequencyValue(self.label, self.iclass)
+ self.lineEditIJFRE.setText(QString(str(freq)))
+
+ self.LSM = LagrangianStatisticsModel(self.case)
+ if self.LSM.getGroupOfParticlesValue() > 0:
+ igroup = self.model.getParticleGroupNumberValue(self.label, self.iclass)
+ self.lineEditICLST.setText(QString(str(igroup)))
+ else:
+ self.labelICLST.setDisabled(True)
+ self.lineEditICLST.setDisabled(True)
+
+ # Rate / stat. weight
+ self.groupBoxRate.show()
+ choice = self.model.getStatisticalWeightChoice(self.label, self.iclass)
+ self.modelIPOIT.setItem(str_model=choice)
+ text = self.modelIPOIT.dicoM2V[choice]
+ self.slotIPOITChoice(QString(text))
+
+
+ # Velocity
+ self.groupBoxVelocity.show()
+ choice = self.model.getVelocityChoice(self.label, self.iclass)
+ self.modelIJUVW.setItem(str_model=choice)
+ text = self.modelIJUVW.dicoM2V[choice]
+ self.slotIJUVW(QString(text))
+
+ # Temperature
+ status = self.LM.getHeating()
+ if part_model == "thermal" and status == "on":
+ self.groupBoxTemperature.show()
+ choice = self.model.getTemperatureChoice(self.label, self.iclass)
+ self.modelIJRTP.setItem(str_model=choice)
+ text = self.modelIJRTP.dicoM2V[choice]
+ self.slotIJRTP(QString(text))
+
+ cp = self.model.getSpecificHeatValue(self.label, self.iclass)
+ self.lineEditICPT.setText(QString(str(cp)))
+ eps = self.model.getEmissivityValue(self.label, self.iclass)
+ self.lineEditIEPSI.setText(QString(str(eps)))
+
+ # Coals
+ if part_model == "coal" and self.LM.getCoalFouling() == "on" :
+ self.groupBoxCoal.show()
+ #icoal = self.model.getCoalNumberValue(self.label, self.iclass)
+ icoal = 1
+ self.lineEditINUCHL.setText(QString(str(icoal)))
+ #temp = self.model.getCoalTemperatureValue(self.label, self.iclass)
+ temp = 800.
+ self.lineEditIHPT.setText(QString(str(temp)))
+ #mass = self.model.getCoalMassValue(self.label, self.iclass)
+ pis6 = 3.14159265/6.
+ diam = 1. # TODO diam20
+ rho = 1. # TODO rho0ch
+ mass = pis6 * diam**3 * rho
+ self.lineEditIMCHT.setText(QString(str(mass)))
+ #mass2 = self.model.getCokeMassValue(self.label, self.iclass)
+ mass2 = 0.
+ self.lineEditIMCKT.setText(QString(str(mass2)))
+
+ # Diameter
+## status = self.LM.getBreakUp()
+## if part_model == "thermal" and status == "on":
+ if part_model == "thermal":
+ self.groupBoxDiameter.show()
+ choice = self.model.getDiameterChoice(self.label, self.iclass)
+ self.modelIJRDP.setItem(str_model=choice)
+ text = self.modelIJRDP.dicoM2V[choice]
+ self.slotIJRDP(QString(text))
+ elif part_model == "coal":
+ self.groupBoxDiameter.show()
+ self.modelIJRDP.setItem(str_model="prescribed")
+
+ rho = self.model.getDensityValue(self.label, self.iclass)
+ self.lineEditIROPT.setText(QString(str(rho)))
+
+
+ @pyqtSignature("const QString&")
+ def slotIJNBP(self, text):
+ """
+ Input IJNBP.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setNumberOfParticulesInClassValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJFRE(self, text):
+ """
+ Input IJFRE.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setInjectionFrequencyValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotICLST(self, text):
+ """
+ Input ICLST.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setParticleGroupNumberValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIDEBT(self, text):
+ """
+ Input IDEBT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setMassFlowRateValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIPOITChoice(self, text):
+ """
+ Input IPOIT.
+ """
+ choice = self.modelIPOIT.dicoV2M[str(text)]
+ self.model.setStatisticalWeightChoice(self.label, self.iclass, choice)
+ self.frameVolumicRate.hide()
+ self.frameStatisticalWeight.hide()
+ if choice == "rate":
+ self.frameVolumicRate.show()
+ rate = self.model.getMassFlowRateValue(self.label, self.iclass)
+ self.lineEditIDEBT.setText(QString(str(rate)))
+ self.model.setStatisticalWeightValue(self.label, self.iclass, 1) # ???
+ elif choice == "prescribed":
+ self.frameStatisticalWeight.show()
+ weight = self.model.getStatisticalWeightValue(self.label, self.iclass)
+ self.lineEditIPOIT.setText(QString(str(weight)))
+ elif choice == "subroutine":
+ pass
+
+
+ @pyqtSignature("const QString&")
+ def slotIPOIT(self, text):
+ """
+ Input IPOIT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setStatisticalWeightValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIROPT(self, text):
+ """
+ Input IROPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setDensityValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJUVW(self, text):
+ """
+ Input IJUVW.
+ """
+ choice = self.modelIJUVW.dicoV2M[str(text)]
+ self.model.setVelocityChoice(self.label, self.iclass, choice)
+ self.frameVelocityNorm.hide()
+ self.frameVelocityValues.hide()
+ if choice == "norm":
+ self.frameVelocityNorm.show()
+ norm = self.model.getVelocityNormValue(self.label, self.iclass)
+ self.lineEditIUNO.setText(QString(str(norm)))
+ elif choice == "components":
+ self.frameVelocityValues.show()
+ vu = self.model.getVelocityDirectionValue(self.label, self.iclass, "u")
+ vv = self.model.getVelocityDirectionValue(self.label, self.iclass, "v")
+ vw = self.model.getVelocityDirectionValue(self.label, self.iclass, "w")
+ self.lineEditIUPT.setText(QString(str(vu)))
+ self.lineEditIVPT.setText(QString(str(vv)))
+ self.lineEditIWPT.setText(QString(str(vw)))
+
+
+ @pyqtSignature("const QString&")
+ def slotIUNO(self, text):
+ """
+ Input IUNO.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityNormValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIUPT(self, text):
+ """
+ Input IUPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityDirectionValue(self.label, self.iclass, "u", value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIVPT(self, text):
+ """
+ Input IVPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityDirectionValue(self.label, self.iclass, "v", value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIWPT(self, text):
+ """
+ Input IWPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityDirectionValue(self.label, self.iclass, "w", value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJRTP(self, text):
+ """
+ Input IJRTP.
+ """
+ choice = self.modelIJRTP.dicoV2M[str(text)]
+ self.model.setTemperatureChoice(self.label, self.iclass, choice)
+ if choice == "prescribed":
+ self.frameTemperature.show()
+ temp = self.model.getTemperatureValue(self.label, self.iclass)
+ self.lineEditITPT.setText(QString(str(temp)))
+ elif choice == "subroutine":
+ self.frameTemperature.hide()
+
+
+ @pyqtSignature("const QString&")
+ def slotITPT(self, text):
+ """
+ Input ITPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setTemperatureValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotICPT(self, text):
+ """
+ Input ICPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setSpecificHeatValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIEPSI(self, text):
+ """
+ Input IEPSI.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setEmissivityValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJRDP(self, text):
+ """
+ Input IJRDP.
+ """
+ choice = self.modelIJRDP.dicoV2M[str(text)]
+ self.model.setDiameterChoice(self.label, self.iclass, choice)
+ if choice == "prescribed":
+ self.frameDiameter.show()
+ diam = self.model.getDiameterValue(self.label, self.iclass)
+ vdiam = self.model.getDiameterVarianceValue(self.label, self.iclass)
+ self.lineEditIDPT.setText(QString(str(diam)))
+ self.lineEditIVDPT.setText(QString(str(vdiam)))
+ elif choice == "subroutine":
+ self.frameDiameter.hide()
+
+
+ @pyqtSignature("const QString&")
+ def slotIDPT(self, text):
+ """
+ Input IDPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setDiameterValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIVDPT(self, text):
+ """
+ Input IVDPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setDiameterVarianceValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotINUCHL(self, text):
+ """
+ Input IHPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setCoalNumberValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIHPT(self, text):
+ """
+ Input IHPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setCoalTemperatureValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIMCHT(self, text):
+ """
+ Input IMCHT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setCoalMassValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIMCKT(self, text):
+ """
+ Input IMCKT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setCokeMassValue(self.label, self.iclass, value)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/BoundaryConditionsRoughWallForm.ui b/gui/Pages/BoundaryConditionsRoughWallForm.ui
new file mode 100644
index 0000000..99cdcc7
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsRoughWallForm.ui
@@ -0,0 +1,149 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsRoughWallForm</class>
+ <widget class="QWidget" name="BoundaryConditionsRoughWallForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>240</width>
+ <height>133</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxRough" >
+ <property name="title" >
+ <string>Smooth or rough wall</string>
+ </property>
+ <layout class="QGridLayout" name="_6" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" name="_7" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" name="_8" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QRadioButton" name="radioButtonSmooth" >
+ <property name="text" >
+ <string>smooth wall</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QRadioButton" name="radioButtonRough" >
+ <property name="text" >
+ <string>rough wall</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QFrame" name="frameRoughness" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="_9" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" name="_10" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelRoughCoef" >
+ <property name="text" >
+ <string>Roughness height</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditRoughCoef" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QLabel" name="labelRoughUnit" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>51</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsRoughWallView.py b/gui/Pages/BoundaryConditionsRoughWallView.py
new file mode 100644
index 0000000..7c5218d
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsRoughWallView.py
@@ -0,0 +1,164 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- BoundaryConditionsRoughWallView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsRoughWallForm import Ui_BoundaryConditionsRoughWallForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsRoughWallView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsRoughWallView(QWidget, Ui_BoundaryConditionsRoughWallForm):
+ """
+ Boundary condition for smooth or rough wall.
+ """
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsRoughWallForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+
+ self.connect(self.radioButtonSmooth, SIGNAL("clicked()"), self.__slotRoughness)
+ self.connect(self.radioButtonRough, SIGNAL("clicked()"), self.__slotRoughness)
+
+ self.connect(self.lineEditRoughCoef, SIGNAL("textChanged(const QString &)"), self.__slotRoughnessHeight)
+
+ validatorRoughCoef = DoubleValidator(self.lineEditRoughCoef)
+ self.lineEditRoughCoef.setValidator(validatorRoughCoef)
+
+
+ def showWidget(self, boundary):
+ """
+ Show the widget
+ """
+ self.show()
+ self.__boundary = boundary
+
+ if self.__boundary.getRoughnessChoice() == "on":
+ self.radioButtonSmooth.setChecked(False)
+ self.radioButtonRough.setChecked(True)
+ else:
+ self.radioButtonSmooth.setChecked(True)
+ self.radioButtonRough.setChecked(False)
+
+ self.__slotRoughness()
+
+
+ def hideWidget(self):
+ """
+ Hide the widget
+ """
+ self.hide()
+
+
+ @pyqtSignature("")
+ def __slotRoughness(self):
+ """
+ Private slot.
+
+ Selects if the wall is rought or smooth.
+ """
+ if self.radioButtonSmooth.isChecked():
+ self.frameRoughness.hide()
+ self.__boundary.setRoughnessChoice('off')
+
+ elif self.radioButtonRough.isChecked():
+ self.frameRoughness.show()
+ self.__boundary.setRoughnessChoice('on')
+ r = self.__boundary.getRoughness()
+ self.lineEditRoughCoef.setText(QString(str(r)))
+
+
+ @pyqtSignature("const QString&")
+ def __slotRoughnessHeight(self, text):
+ """
+ Private slot.
+
+ Input the roughness height for the selected wall.
+
+ @type text: C{QString}
+ @param text: roughness height.
+ """
+ r, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setRoughness(r)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsScalarsForm.ui b/gui/Pages/BoundaryConditionsScalarsForm.ui
new file mode 100644
index 0000000..8375cfd
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsScalarsForm.ui
@@ -0,0 +1,39 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsScalarsForm</class>
+ <widget class="QWidget" name="BoundaryConditionsScalarsForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>134</width>
+ <height>151</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxScalars" >
+ <property name="title" >
+ <string>Scalars</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewScalars" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsScalarsView.py b/gui/Pages/BoundaryConditionsScalarsView.py
new file mode 100644
index 0000000..1586f30
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsScalarsView.py
@@ -0,0 +1,414 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- NatureScalarDelegate
+- DoubleValueDelegate
+- StandardItemModelScalars
+- ScalarsBoundariesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from BoundaryConditionsScalarsForm import Ui_BoundaryConditionsScalarsForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.DefineUserScalarsModel import DefineUserScalarsModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsScalarsView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Combo box delegate for nature of the scalar
+#-------------------------------------------------------------------------------
+# TODO: Use a model to enable/disable items in the combo
+
+class NatureScalarDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent=None):
+ super(NatureScalarDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ for item in index.model().dico.values():
+ editor.addItem(QString(item))
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, comboBox, index):
+ dico = {"dirichlet": 0, "neumann": 1, "exchange_coefficient": 2}
+ row = index.row()
+ col = index.column()
+ string = index.model().getItem(row)[col]
+ idx = dico[string]
+ comboBox.setCurrentIndex(idx)
+
+
+ def setModelData(self, comboBox, model, index):
+ value = str(comboBox.currentText())
+
+ if value == self.tr("Prescribed value"):
+ d = "dirichlet"
+ elif value == self.tr("Prescribed flux"):
+ d = "neumann"
+ elif value == self.tr("Exchange coefficient"):
+ d = "exchange_coefficient"
+
+ model.setData(index, QVariant(d), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Delegate for a double value QTableView
+#-------------------------------------------------------------------------------
+
+class DoubleValueDelegate(QItemDelegate):
+ def __init__(self, parent = None):
+ super(DoubleValueDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = DoubleValidator(editor)
+ editor.setValidator(validator)
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ value, ok = editor.text().toDouble()
+ if editor.validator().state == QValidator.Acceptable:
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class to display scalars values in a QTableView
+#-------------------------------------------------------------------------------
+
+class StandardItemModelScalars(QStandardItemModel):
+
+ def __init__(self, case, boundary):
+ QStandardItemModel.__init__(self)
+
+ self.headers = [self.tr("Scalar Name"),
+ self.tr("Type"),
+ self.tr("Value"),
+ self.tr("Exchange\nCoefficient")]
+ self.setColumnCount(len(self.headers))
+
+ self.case = case
+ self.nature = boundary.getNature()
+ self.boundary = boundary
+ self.sca_model = DefineUserScalarsModel(self.case)
+
+ self.dico = {}
+ self.dico["dirichlet"] = self.tr("Prescribed value")
+ self.dico["neumann"] = self.tr("Prescribed flux")
+ if self.nature == "wall":
+ self.dico["exchange_coefficient"] = self.tr("Exchange coefficient")
+
+ self._data = []
+ self._disabled = []
+
+ self._populateModel()
+
+
+ def _populateModel(self):
+ for s_label in self.sca_model.getScalarLabelsList():
+ log.debug("_initData for scalar label %s " % s_label)
+ row = self.rowCount()
+ self._newItem(s_label, row)
+ self.setRowCount(row+1)
+
+
+ def _newItem(self, s_label, row):
+ line = ["", "", "", ""]
+ line[0] = s_label
+
+ if self.nature == 'inlet':
+ line[1] = 'dirichlet'
+ line[2] = self.boundary.getScalar(s_label)
+ if (row,1) not in self._disabled: self._disabled.append((row,1))
+ if (row,3) not in self._disabled: self._disabled.append((row,3))
+
+ elif self.nature == 'wall':
+ choice = self.boundary.getScalarChoice(s_label)
+ line[1] = choice
+ if choice == 'dirichlet':
+ line[2] = self.boundary.getScalarImposedValue(s_label)
+ if (row,3) not in self._disabled: self._disabled.append((row,3))
+ elif choice == 'neumann':
+ line[2] = self.boundary.getScalarImposedFlux(s_label)
+ if (row,3) not in self._disabled: self._disabled.append((row,3))
+ elif choice == 'exchange_coefficient':
+ line[2] = self.boundary.getScalarImposedFlux(s_label)
+ line[3] = self.boundary.getScalarExchangeCoefficient(s_label)
+ if (row,3) in self._disabled: self._disabled.remove((row,3))
+
+ elif self.nature == 'outlet':
+ choice = self.boundary.getScalarChoice(s_label)
+ line[1] = choice
+ if (row,3) not in self._disabled: self._disabled.append((row,3))
+ if choice == 'dirichlet':
+ line[2] = self.boundary.getScalar(s_label)
+ elif choice == 'neumann':
+ line[2] = self.boundary.getScalar(s_label)
+
+ self._data.append(line)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ row = index.row()
+ col = index.column()
+
+ if role == Qt.DisplayRole:
+ if col == 1:
+ if self._data[row][col] in self.dico:
+ return QVariant(self.dico[self._data[row][col]])
+ else:
+ return QVariant()
+ else:
+ return QVariant(self._data[row][col])
+
+ if role == Qt.ToolTipRole:
+ if col == 0 :
+ return QVariant(self.tr("Code_Saturne keyword: NOMVAR"))
+
+ if role == Qt.StatusTipRole:
+ if col == 0:
+ return QVariant(self.tr("Scalar name"))
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ elif (index.row(), index.column()) in self._disabled:
+ return Qt.ItemIsEnabled
+
+ else:
+ if index.column() == 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+ col = index.column()
+ s_label = self._data[row][0]
+
+ # type in dirichlet, neumann or exchange_coefficient
+ if col == 1:
+ type = str(value.toString())
+ self._data[row][col] = type
+ self.boundary.setScalarChoice(s_label, type)
+
+ if type == 'dirichlet':
+ if self.nature == 'wall':
+ self._data[row][2] = self.boundary.getScalarImposedValue(s_label)
+ elif self.nature == 'outlet':
+ self._data[row][2] = self.boundary.getScalar(s_label)
+ if (row,3) not in self._disabled: self._disabled.append((row,3))
+ self._data[row][3] = ""
+
+ elif type == 'neumann':
+ if self.nature == 'wall':
+ self._data[row][2] = self.boundary.getScalarImposedFlux(s_label)
+ elif self.nature == 'outlet':
+ self._data[row][2] = self.boundary.getScalar(s_label)
+ if (row,3) not in self._disabled: self._disabled.append((row,3))
+ self._data[row][3] = ""
+
+ elif type == 'exchange_coefficient':
+ if (row,3) in self._disabled: self._disabled.remove((row,3))
+ self._data[row][2] = self.boundary.getScalarImposedFlux(s_label)
+ self._data[row][3] = self.boundary.getScalarExchangeCoefficient(s_label)
+
+ # value(s) associated to the choice
+ if col == 2:
+ choice = self._data[row][1]
+ val, ok = value.toDouble()
+ self._data[row][col] = val
+
+ if self.nature == 'inlet':
+ self.boundary.setScalar(s_label, val)
+ elif self.nature == 'wall':
+ if choice == 'dirichlet':
+ self.boundary.setScalarImposedValue(s_label, val)
+ elif choice == 'neumann' or choice == 'exchange_coefficient':
+ self.boundary.setScalarImposedFlux(s_label, val)
+ elif self.nature == 'outlet':
+ self.boundary.setScalar(s_label, val)
+
+ # exchange_coefficient
+ if col == 3:
+ choice = self._data[row][1]
+ coeff, ok = value.toDouble()
+ self._data[row][col] = coeff
+
+ if self.nature == 'wall':
+ if choice == 'exchange_coefficient':
+ self.boundary.setScalarExchangeCoefficient(s_label, coeff)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def insertItem(self, label, codeNumber, var_nature, local):
+ """
+ Insert an element in the table view.
+ """
+ line = [label, codeNumber, var_nature, local]
+ self._data.append(line)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def getItem(self, row):
+ return self._data[row]
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsScalarsView(QWidget, Ui_BoundaryConditionsScalarsForm):
+ """
+ """
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsScalarsForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+
+
+ def __setBoundary(self, boundary):
+ """
+ Set the current boundary
+ """
+ self.__boundary = boundary
+
+ if hasattr(self, "modelScalars"):
+ del self.modelScalars
+
+ # Model and QTableView for Scalars
+ self.modelScalars = StandardItemModelScalars(self.__case, self.__boundary)
+ self.tableViewScalars.setModel(self.modelScalars)
+ self.tableViewScalars.resizeColumnsToContents()
+ self.tableViewScalars.resizeRowsToContents()
+ self.tableViewScalars.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ # Delegates
+ delegateNatureScalar = NatureScalarDelegate(self.tableViewScalars)
+ delegateDouble = DoubleValueDelegate(self.tableViewScalars)
+ self.tableViewScalars.setItemDelegateForColumn(1, delegateNatureScalar)
+ self.tableViewScalars.setItemDelegateForColumn(2, delegateDouble)
+ self.tableViewScalars.setItemDelegateForColumn(3, delegateDouble)
+
+
+ def showWidget(self, boundary):
+ """
+ Show the widget
+ """
+ if DefineUserScalarsModel(self.__case).getScalarLabelsList():
+ self.__setBoundary(boundary)
+ self.show()
+ else:
+ self.hideWidget()
+
+
+ def hideWidget(self):
+ """
+ Hide all
+ """
+ self.hide()
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsSlidingWallForm.ui b/gui/Pages/BoundaryConditionsSlidingWallForm.ui
new file mode 100644
index 0000000..eca9f6c
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsSlidingWallForm.ui
@@ -0,0 +1,189 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsSlidingWallForm</class>
+ <widget class="QWidget" name="BoundaryConditionsSlidingWallForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>312</width>
+ <height>76</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxSliding" >
+ <property name="title" >
+ <string>Sliding wall</string>
+ </property>
+ <property name="flat" >
+ <bool>false</bool>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ <layout class="QHBoxLayout" >
+ <property name="spacing" >
+ <number>0</number>
+ </property>
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameSlideVelocity" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <property name="lineWidth" >
+ <number>0</number>
+ </property>
+ <layout class="QHBoxLayout" name="_2" >
+ <item>
+ <widget class="QLabel" name="labelSlideU" >
+ <property name="text" >
+ <string>U</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditSlideU" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelSlideUnitU" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelSlideV" >
+ <property name="text" >
+ <string>V</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditSlideV" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelSlideUnitV" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelSlideW" >
+ <property name="text" >
+ <string>W</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditSlideW" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelSlideUnitW" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsSlidingWallView.py b/gui/Pages/BoundaryConditionsSlidingWallView.py
new file mode 100644
index 0000000..27519ce
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsSlidingWallView.py
@@ -0,0 +1,211 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- BoundaryConditionsSlidingWallView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsSlidingWallForm import Ui_BoundaryConditionsSlidingWallForm
+from Pages.MobileMeshModel import MobileMeshModel
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.Boundary import Boundary
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsSlidingWallView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsSlidingWallView(QWidget, Ui_BoundaryConditionsSlidingWallForm):
+ """
+ Boundary conditions for sliding wall
+ """
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsSlidingWallForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+
+ self.connect(self.groupBoxSliding, SIGNAL("clicked(bool)"), self.__slotSlidingWall)
+
+ self.connect(self.lineEditSlideU, SIGNAL("textChanged(const QString &)"), self.__slotVelocityU)
+ self.connect(self.lineEditSlideV, SIGNAL("textChanged(const QString &)"), self.__slotVelocityV)
+ self.connect(self.lineEditSlideW, SIGNAL("textChanged(const QString &)"), self.__slotVelocityW)
+
+ validatorSlideU = DoubleValidator(self.lineEditSlideU)
+ validatorSlideV = DoubleValidator(self.lineEditSlideV)
+ validatorSlideW = DoubleValidator(self.lineEditSlideW)
+
+ self.lineEditSlideU.setValidator(validatorSlideU)
+ self.lineEditSlideV.setValidator(validatorSlideV)
+ self.lineEditSlideW.setValidator(validatorSlideW)
+
+
+ def showWidget(self, boundary):
+ """
+ Show the widget
+ """
+ if MobileMeshModel(self.__case).getMethod() == "off":
+ self.__boundary = boundary
+ if self.__boundary.getVelocityChoice() == "on":
+ self.groupBoxSliding.setChecked(True)
+ checked = True
+ else:
+ self.groupBoxSliding.setChecked(False)
+ checked = False
+ self.__slotSlidingWall(checked)
+ self.show()
+ else:
+ self.hideWidget()
+
+
+ def hideWidget(self):
+ """
+ Hide all the widget
+ """
+ self.hide()
+
+
+ @pyqtSignature("bool")
+ def __slotSlidingWall(self, checked):
+ """
+ Private slot.
+
+ Activates sliding wall boundary condition.
+
+ @type checked: C{True} or C{False}
+ @param checked: if C{True}, shows the QGroupBox sliding wall parameters.
+ """
+ self.groupBoxSliding.setFlat(not checked)
+
+ if checked:
+ self.__boundary.setVelocityChoice("on")
+ self.frameSlideVelocity.show()
+ u, v, w = self.__boundary.getVelocities()
+ else:
+ self.__boundary.setVelocityChoice("off")
+ self.frameSlideVelocity.hide()
+ u, v, w = 0.0, 0.0, 0.0
+ self.lineEditSlideU.setText(QString(str(u)))
+ self.lineEditSlideV.setText(QString(str(v)))
+ self.lineEditSlideW.setText(QString(str(w)))
+
+
+ @pyqtSignature("const QString&")
+ def __slotVelocityU(self, text):
+ """
+ Private slot.
+
+ If sliding wall activated, input U velocity component.
+
+ @type text: C{QString}
+ @param text: sliding wall U velocity component.
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setVelocityComponent(value, 'velocity_U')
+
+
+ @pyqtSignature("const QString&")
+ def __slotVelocityV(self, text):
+ """
+ Private slot.
+
+ If sliding wall activated, input V velocity component.
+
+ @type text: C{QString}
+ @param text: sliding wall V velocity component.
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setVelocityComponent(value, 'velocity_V')
+
+
+ @pyqtSignature("const QString&")
+ def __slotVelocityW(self, text):
+ """
+ Private slot.
+
+ If sliding wall activated, input W velocity component.
+
+ @type text: C{QString}
+ @param text: sliding wall W velocity component.
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setVelocityComponent(value, 'velocity_W')
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsTurbulenceInletForm.ui b/gui/Pages/BoundaryConditionsTurbulenceInletForm.ui
new file mode 100644
index 0000000..0ca02ac
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsTurbulenceInletForm.ui
@@ -0,0 +1,211 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsTurbulenceInletForm</class>
+ <widget class="QWidget" name="BoundaryConditionsTurbulenceInletForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>359</width>
+ <height>213</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxTurbulence" >
+ <property name="title" >
+ <string>Turbulence</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" name="_2" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <layout class="QGridLayout" name="_3" >
+ <item row="0" column="0" >
+ <widget class="QComboBox" name="comboBoxTurbulence" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QFrame" name="frameTurbDiameter" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="_4" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" name="_5" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelDiameter" >
+ <property name="text" >
+ <string>Hydraulic diameter</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditDiameter" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Inlet hydraulic diameter =
+4S/P with S=surface and P=perimeter of wet wall</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitDiameter" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QFrame" name="frameTurbIntensity" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>70</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="_6" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" name="_7" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIntensity" >
+ <property name="text" >
+ <string>Intensity</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditIntensity" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>turbulent intensity expressed in percent </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitIntensity" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelDiameterIntens" >
+ <property name="text" >
+ <string>Hydraulic diameter</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditDiameterIntens" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Inlet hydraulic diameter =
+4S/P with S=surface and P=perimeter of wet wall</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitDiameterintens" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsTurbulenceInletView.py b/gui/Pages/BoundaryConditionsTurbulenceInletView.py
new file mode 100644
index 0000000..c5b362f
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsTurbulenceInletView.py
@@ -0,0 +1,194 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- BoundaryConditionsTurbulenceInletView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsTurbulenceInletForm import Ui_BoundaryConditionsTurbulenceInletForm
+from TurbulenceModel import TurbulenceModel
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsTurbulenceInletView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsTurbulenceInletView(QWidget, Ui_BoundaryConditionsTurbulenceInletForm):
+ """
+ Boundary condition for turbulence
+ """
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsTurbulenceInletForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+
+ self.connect(self.comboBoxTurbulence, SIGNAL("activated(const QString&)"), self.__slotChoiceTurbulence)
+
+ self.__modelTurbulence = ComboModel(self.comboBoxTurbulence, 2, 1)
+ self.__modelTurbulence.addItem(self.tr("Calculation by hydraulic diameter"), 'hydraulic_diameter')
+ self.__modelTurbulence.addItem(self.tr("Calculation by turbulent intensity"), 'turbulent_intensity')
+
+ self.connect(self.lineEditDiameter, SIGNAL("textChanged(const QString &)"), self.__slotDiam)
+ self.connect(self.lineEditIntensity, SIGNAL("textChanged(const QString &)"), self.__slotIntensity)
+ self.connect(self.lineEditDiameterIntens, SIGNAL("textChanged(const QString &)"), self.__slotDiam)
+
+ validatorDiam = DoubleValidator(self.lineEditDiameter, min=0.)
+ validatorDiam.setExclusiveMin(True)
+ validatorIntensity = DoubleValidator(self.lineEditIntensity, min=0.)
+
+ self.lineEditDiameter.setValidator(validatorDiam)
+ self.lineEditDiameterIntens.setValidator(validatorDiam)
+ self.lineEditIntensity.setValidator(validatorIntensity)
+
+
+ def showWidget(self, boundary):
+ """
+ Show the widget
+ """
+ self.__boundary = boundary
+
+ if TurbulenceModel(self.__case).getTurbulenceVariable():
+ turb_choice = boundary.getTurbulenceChoice()
+ self.__modelTurbulence.setItem(str_model=turb_choice)
+ if turb_choice == "hydraulic_diameter":
+ self.frameTurbDiameter.show()
+ self.frameTurbIntensity.hide()
+ d = boundary.getHydraulicDiameter()
+ self.lineEditDiameter.setText(QString(str(d)))
+ elif turb_choice == "turbulent_intensity":
+ self.frameTurbIntensity.show()
+ self.frameTurbDiameter.hide()
+ i = boundary.getTurbulentIntensity()
+ d = boundary.getHydraulicDiameter()
+ self.lineEditIntensity.setText(QString(str(i)))
+ self.lineEditDiameterIntens.setText(QString(str(d)))
+ self.show()
+ else:
+ self.hideWidget()
+
+
+ def hideWidget(self):
+ """
+ Hide the widget
+ """
+ self.hide()
+
+
+ @pyqtSignature("const QString&")
+ def __slotChoiceTurbulence(self, text):
+ """
+ INPUT choice of method of calculation of the turbulence
+ """
+ turb_choice = self.__modelTurbulence.dicoV2M[str(text)]
+ self.__boundary.setTurbulenceChoice(turb_choice)
+
+ self.frameTurbDiameter.hide()
+ self.frameTurbIntensity.hide()
+
+ if turb_choice == 'hydraulic_diameter':
+ self.frameTurbDiameter.show()
+ d = self.__boundary.getHydraulicDiameter()
+ self.lineEditDiameter.setText(QString(str(d)))
+ elif turb_choice == 'turbulent_intensity':
+ self.frameTurbIntensity.show()
+ i = self.__boundary.getTurbulentIntensity()
+ self.lineEditIntensity.setText(QString(str(i)))
+ d = self.__boundary.getHydraulicDiameter()
+ self.lineEditDiameterIntens.setText(QString(str(d)))
+
+
+ @pyqtSignature("const QString&")
+ def __slotDiam(self, text):
+ """
+ INPUT hydraulic diameter
+ """
+ diam, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setHydraulicDiameter(diam)
+
+
+ @pyqtSignature("const QString&")
+ def __slotIntensity(self, text):
+ """
+ INPUT turbulent intensity
+ """
+ intens, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setTurbulentIntensity(intens)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsVelocityInletForm.ui b/gui/Pages/BoundaryConditionsVelocityInletForm.ui
new file mode 100644
index 0000000..05d985b
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsVelocityInletForm.ui
@@ -0,0 +1,316 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsVelocityInletForm</class>
+ <widget class="QWidget" name="BoundaryConditionsVelocityInletForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>287</width>
+ <height>221</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxVelocity" >
+ <property name="title" >
+ <string>Velocity</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QComboBox" name="comboBoxVelocity" />
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditVelocity" />
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitVelocity" >
+ <property name="text" >
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonVelocityFormula" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Direction</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QComboBox" name="comboBoxDirection" />
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDirectionFormula" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameDirectionCoordinates" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <property name="lineWidth" >
+ <number>0</number>
+ </property>
+ <layout class="QHBoxLayout" name="_4" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="_5" >
+ <item>
+ <widget class="QLabel" name="labelXVelocity" >
+ <property name="text" >
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDirectionX" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelYVelocity" >
+ <property name="text" >
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDirectionY" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelZVelocity" >
+ <property name="text" >
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDirectionZ" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsVelocityInletView.py b/gui/Pages/BoundaryConditionsVelocityInletView.py
new file mode 100644
index 0000000..1fe03bb
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsVelocityInletView.py
@@ -0,0 +1,391 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- BoundaryConditionsVelocityInletView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+try:
+ import mei
+ _have_mei = True
+except:
+ _have_mei = False
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsVelocityInletForm import Ui_BoundaryConditionsVelocityInletForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel, setGreenColor
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.Boundary import Boundary
+if _have_mei:
+ from QMeiEditorView import QMeiEditorView
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsVelocityInletView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsVelocityInletView(QWidget, Ui_BoundaryConditionsVelocityInletForm):
+ """
+ Boundary condition for velocity in inlet, without particular physics.
+ """
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsVelocityInletForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+
+ # Connections
+ self.connect(self.comboBoxVelocity, SIGNAL("activated(const QString&)"), self.__slotChoiceVelocity)
+ self.connect(self.lineEditVelocity, SIGNAL("textChanged(const QString &)"), self.__slotVelocityValue)
+
+ self.connect(self.comboBoxDirection, SIGNAL("activated(const QString&)"), self.__slotChoiceDirection)
+ self.connect(self.lineEditDirectionX, SIGNAL("textChanged(const QString &)"), self.__slotDirX)
+ self.connect(self.lineEditDirectionY, SIGNAL("textChanged(const QString &)"), self.__slotDirY)
+ self.connect(self.lineEditDirectionZ, SIGNAL("textChanged(const QString &)"), self.__slotDirZ)
+
+ # Combo models
+ self.modelVelocity = ComboModel(self.comboBoxVelocity, 6, 1)
+ self.modelVelocity.addItem(self.tr("norm"), 'norm')
+ self.modelVelocity.addItem(self.tr("mass flow rate"), 'flow1')
+ self.modelVelocity.addItem(self.tr("volumic flow rate"), 'flow2')
+ self.modelVelocity.addItem(self.tr("norm (user law)"), 'norm_formula')
+ self.modelVelocity.addItem(self.tr("mass flow rate (user law)"), 'flow1_formula')
+ self.modelVelocity.addItem(self.tr("volumic flow rate (user law)"), 'flow2_formula')
+
+ self.modelDirection = ComboModel(self.comboBoxDirection, 3, 1)
+ self.modelDirection.addItem(self.tr("normal direction to the inlet"), 'normal')
+ self.modelDirection.addItem(self.tr("specified coordiates"), 'coordinates')
+ self.modelDirection.addItem(self.tr("user profile"), 'formula')
+
+ # Validators
+ validatorVelocity = DoubleValidator(self.lineEditVelocity)
+ validatorX = DoubleValidator(self.lineEditDirectionX)
+ validatorY = DoubleValidator(self.lineEditDirectionY)
+ validatorZ = DoubleValidator(self.lineEditDirectionZ)
+
+ # Apply validators
+ self.lineEditVelocity.setValidator(validatorVelocity)
+ self.lineEditDirectionX.setValidator(validatorX)
+ self.lineEditDirectionY.setValidator(validatorY)
+ self.lineEditDirectionZ.setValidator(validatorZ)
+
+ if _have_mei:
+ self.connect(self.pushButtonVelocityFormula, SIGNAL("clicked()"), self.__slotVelocityFormula)
+ self.connect(self.pushButtonDirectionFormula, SIGNAL("clicked()"), self.__slotDirectionFormula)
+ else:
+ self.pushButtonVelocityFormula.setEnabled(False)
+ self.pushButtonDirectionFormula.setEnabled(False)
+ self.modelVelocity.disableItem(str_model="norm_formula")
+ self.modelVelocity.disableItem(str_model="flow1_formula")
+ self.modelVelocity.disableItem(str_model="flow2_formula")
+ self.modelDirection.disableItem(str_model="formula")
+
+
+ def showWidget(self, boundary):
+ """
+ Show the widget
+ """
+ self.__boundary = boundary
+
+ # Initialize velocity
+ choice = self.__boundary.getVelocityChoice()
+ self.modelVelocity.setItem(str_model=choice)
+ self.__updateLabel()
+
+ if not _have_mei:
+ if self.__boundary.getVelocityChoice()[-7:] == "formula":
+ c = self.__boundary.defaultValues()['velocityChoice']
+ self.__boundary.setVelocityChoice(c)
+ if self.__boundary.getDirectionChoice() == "formula":
+ c = self.__boundary.defaultValues()['directionChoice']
+ self.__boundary.setDirectionChoice(c)
+
+ if choice[-7:] == "formula":
+ self.pushButtonVelocityFormula.setEnabled(True)
+ self.lineEditVelocity.setEnabled(False)
+ else:
+ self.pushButtonVelocityFormula.setEnabled(False)
+ self.lineEditVelocity.setEnabled(True)
+ v = self.__boundary.getVelocity()
+ self.lineEditVelocity.setText(QString(str(v)))
+
+ # Initialize direction
+ choice = self.__boundary.getDirectionChoice()
+ self.modelDirection.setItem(str_model=choice)
+ text = self.modelDirection.dicoM2V[choice]
+ if choice == "formula":
+ self.pushButtonDirectionFormula.setEnabled(True)
+ self.frameDirectionCoordinates.hide()
+ elif choice == "coordinates":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ self.frameDirectionCoordinates.show()
+ v = self.__boundary.getDirection('direction_x')
+ self.lineEditDirectionX.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_y')
+ self.lineEditDirectionY.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_z')
+ self.lineEditDirectionZ.setText(QString(str(v)))
+ elif choice == "normal":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ self.frameDirectionCoordinates.hide()
+
+ self.show()
+
+
+ def hideWidget(self):
+ """
+ Hide all
+ """
+ self.hide()
+
+
+ @pyqtSignature("const QString&")
+ def __slotChoiceVelocity(self, text):
+ """
+ Private slot.
+
+ Input the velocity boundary type choice (norm, ).
+
+ @type text: C{QString}
+ @param text: velocity boundary type choice.
+ """
+ c = self.modelVelocity.dicoV2M[str(text)]
+ log.debug("slotChoiceVelocity: %s " % c)
+ self.__boundary.setVelocityChoice(c)
+
+ if c[-7:] == "formula":
+ self.pushButtonVelocityFormula.setEnabled(True)
+ setGreenColor(self.pushButtonVelocityFormula, True)
+ self.lineEditVelocity.setEnabled(False)
+ self.lineEditVelocity.setText(QString(""))
+ else:
+ self.pushButtonVelocityFormula.setEnabled(False)
+ setGreenColor(self.pushButtonVelocityFormula, False)
+ self.lineEditVelocity.setEnabled(True)
+ v = self.__boundary.getVelocity()
+ self.lineEditVelocity.setText(QString(str(v)))
+
+ self.__updateLabel()
+
+
+ def __updateLabel(self):
+ """
+ Update the unit for the velocity specification.
+ """
+ c = self.__boundary.getVelocityChoice()
+ if c in ('norm', 'norm_formula'):
+ self.labelUnitVelocity.setText(QString(str('m/s')))
+ elif c in ('flow1', 'flow1_formula'):
+ self.labelUnitVelocity.setText(QString(str('kg/s')))
+ elif c in ('flow2', 'flow2_formula'):
+ self.labelUnitVelocity.setText(QString(str('m<sup>3</sup>/s')))
+
+
+ @pyqtSignature("const QString&")
+ def __slotVelocityValue(self, text):
+ """
+ Private slot.
+
+ New value associated to the velocity boundary type.
+
+ @type text: C{QString}
+ @param text: value
+ """
+ v, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setVelocity(v)
+
+
+ @pyqtSignature("")
+ def __slotVelocityFormula(self):
+ """
+ """
+ exp = self.__boundary.getVelocity()
+ c = self.__boundary.getVelocityChoice()
+ req = [('u_norm', 'Norm of the velocity')]
+ if c == 'norm_formula':
+ exa = "u_norm = 1.0;"
+ elif c == 'flow1_formula':
+ exa = "q_m = 1.0;"
+ elif c == 'flow2_formula':
+ exa = "q_v = 1.0;"
+
+ sym = [('x', "X face's gravity center"),
+ ('y', "Y face's gravity center"),
+ ('z', "Z face's gravity center"),
+ ('dt', 'time step'),
+ ('t', 'current time'),
+ ('iter', 'number of iteration')]
+
+ dialog = QMeiEditorView(self, expression = exp,
+ required = req,
+ symbols = sym,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaVelocity -> %s" % str(result))
+ self.__boundary.setVelocity(result)
+ setGreenColor(self.pushButtonVelocityFormula, False)
+
+
+ @pyqtSignature("const QString&")
+ def __slotChoiceDirection(self, text):
+ """
+ Input the direction type choice.
+ """
+ c = self.modelDirection.dicoV2M[str(text)]
+ log.debug("slotChoiceVelocity: %s " % c)
+ self.__boundary.setDirectionChoice(c)
+
+ if c == "formula":
+ self.pushButtonDirectionFormula.setEnabled(True)
+ setGreenColor(self.pushButtonDirectionFormula, True)
+ self.frameDirectionCoordinates.hide()
+ elif c == "coordinates":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ setGreenColor(self.pushButtonDirectionFormula, False)
+ self.frameDirectionCoordinates.show()
+ v = self.__boundary.getDirection('direction_x')
+ self.lineEditDirectionX.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_y')
+ self.lineEditDirectionY.setText(QString(str(v)))
+ v = self.__boundary.getDirection('direction_z')
+ self.lineEditDirectionZ.setText(QString(str(v)))
+ elif c == "normal":
+ self.pushButtonDirectionFormula.setEnabled(False)
+ setGreenColor(self.pushButtonDirectionFormula, False)
+ self.frameDirectionCoordinates.hide()
+
+
+ @pyqtSignature("const QString&")
+ def __slotDirX(self, text):
+ """
+ INPUT value into direction of inlet flow
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setDirection('direction_x', value)
+
+
+ @pyqtSignature("const QString&")
+ def __slotDirY(self, text):
+ """
+ INPUT value into direction of inlet flow
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setDirection('direction_y', value)
+
+
+ @pyqtSignature("const QString&")
+ def __slotDirZ(self, text):
+ """
+ INPUT value into direction of inlet flow
+ """
+ value, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setDirection('direction_z', value)
+
+
+ @pyqtSignature("")
+ def __slotDirectionFormula(self):
+ """
+ """
+ exp = self.__boundary.getDirection('direction_formula')
+
+ req = [('dir_x', 'Direction of the flow along X'),
+ ('dir_y', 'Direction of the flow along Y'),
+ ('dir_z', 'Direction of the flow along Z')]
+
+ exa = "dir_x = 3.0;\ndir_y = 1.0;\ndir_z = 0.0;\n"
+
+ sym = [('x', "X face's gravity center"),
+ ('y', "Y face's gravity center"),
+ ('z', "Z face's gravity center"),
+ ('dt', 'time step'),
+ ('t', 'current time'),
+ ('iter', 'number of iteration')]
+
+ dialog = QMeiEditorView(self,expression = exp,
+ required = req,
+ symbols = sym,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaDirection -> %s" % str(result))
+ self.__boundary.setDirection('direction_formula', result)
+ setGreenColor(self.pushButtonDirectionFormula, False)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsView.py b/gui/Pages/BoundaryConditionsView.py
new file mode 100644
index 0000000..05e6be3
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsView.py
@@ -0,0 +1,267 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- StandardItemModelBoundaries
+- BoundaryConditionsView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from BoundaryConditionsForm import Ui_BoundaryConditionsForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.Boundary import Boundary
+from Pages.MobileMeshModel import MobileMeshModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class to display boundaries in a QTreeView
+#-------------------------------------------------------------------------------
+
+class StandardItemModelBoundaries(QStandardItemModel):
+ def __init__(self):
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Label"),
+ self.tr("Zone"),
+ self.tr("Nature"),
+ self.tr("Selection criteria")]
+ self.setColumnCount(len(self.headers))
+ self.dataBoundary = []
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataBoundary[index.row()][index.column()])
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def insertItem(self, label, codeNumber, var_nature, local):
+ line = [label, codeNumber, var_nature, local]
+ self.dataBoundary.append(line)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def getItem(self, row):
+ return self.dataBoundary[row]
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsView(QWidget, Ui_BoundaryConditionsForm):
+ """
+ Main boundary conditions view class
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsForm.__init__(self)
+ self.setupUi(self)
+ self.__case = case
+
+ # Model and QTreeView for Boundaries
+
+ self.__modelBoundaries = StandardItemModelBoundaries()
+ self.treeViewBoundaries.setModel(self.__modelBoundaries)
+
+ # Fill the model with the boundary zone
+
+ if MobileMeshModel(self.__case).getMethod() == "off":
+ list = ('wall', 'inlet', 'outlet')
+ else:
+ list = ('wall', 'inlet', 'outlet', 'symmetry')
+
+ d = LocalizationModel('BoundaryZone', self.__case)
+ for zone in d.getZones():
+ label = zone.getLabel()
+ nature = zone.getNature()
+ codeNumber = zone.getCodeNumber()
+ local = zone.getLocalization()
+ if nature in list:
+ self.__modelBoundaries.insertItem(label, codeNumber, nature, local)
+
+ self.connect(self.treeViewBoundaries,
+ SIGNAL("clicked(const QModelIndex &)"),
+ self.__slotSelectBoundary)
+
+ # Set the case for custom widgets
+ self.roughWidget.setup(self.__case)
+ self.slidingWidget.setup(self.__case)
+ self.velocityWidget.setup(self.__case)
+ self.turbulenceWidget.setup(self.__case)
+ self.coalWidget.setup(self.__case)
+ self.meteoWidget.setup(self.__case, self.velocityWidget, self.turbulenceWidget)
+ self.scalarsWidget.setup(self.__case)
+ self.mobileMeshWidget.setup(self.__case)
+ self.radiativeWidget.setup(self.__case)
+
+ self.__hideAllWidgets()
+
+
+ @pyqtSignature("const QModelIndex&")
+ def __slotSelectBoundary(self, index):
+ """
+ Select a boundary in the QTreeView.
+ """
+ label, codeNumber, nature, local = self.__modelBoundaries.getItem(index.row())
+ log.debug("slotSelectBoundary label %s (%s)" % (label, nature))
+
+ self.__hideAllWidgets()
+ boundary = Boundary(nature, label, self.__case)
+
+ if nature == 'wall':
+ self.__selectWallBoundary(boundary)
+ elif nature == 'inlet':
+ self.__selectInletBoundary(boundary)
+ elif nature == 'outlet':
+ self.__selectOutletBoundary(boundary)
+ elif nature == 'symmetry':
+ self.__selectSymmetryBoundary(boundary)
+
+
+ def __selectInletBoundary(self, boundary):
+ """
+ Shows widgets for inlet.
+ """
+ if self.coalWidget.getCoalNumber() == 0:
+ self.velocityWidget.showWidget(boundary)
+ self.coalWidget.hideWidget()
+ else:
+ self.velocityWidget.hideWidget()
+ self.coalWidget.showWidget(boundary)
+
+ self.turbulenceWidget.showWidget(boundary)
+ self.meteoWidget.showWidget(boundary)
+ self.scalarsWidget.showWidget(boundary)
+ self.mobileMeshWidget.showWidget(boundary)
+
+
+ def __selectWallBoundary(self, boundary):
+ """
+ Shows widgets for wall.
+ """
+ self.slidingWidget.showWidget(boundary)
+ self.roughWidget.showWidget(boundary)
+ self.scalarsWidget.showWidget(boundary)
+ self.mobileMeshWidget.showWidget(boundary)
+ self.radiativeWidget.showWidget(boundary)
+
+
+ def __selectOutletBoundary(self, boundary):
+ """
+ Shows widgets for wall.
+ """
+ self.scalarsWidget.showWidget(boundary)
+ self.mobileMeshWidget.showWidget(boundary)
+ self.meteoWidget.showWidget(boundary)
+ #self.pressureWidget.showWidget(boundary)
+
+
+ def __selectSymmetryBoundary(self, boundary):
+ """
+ Shows widgets for wall.
+ """
+ self.mobileMeshWidget.showWidget(boundary)
+
+
+ def __hideAllWidgets(self):
+ """
+ Hides all promoted QWidgets, for all nature.
+ """
+ self.slidingWidget.hideWidget()
+ self.roughWidget.hideWidget()
+ self.velocityWidget.hideWidget()
+ self.turbulenceWidget.hideWidget()
+ self.coalWidget.hideWidget()
+ self.meteoWidget.hideWidget()
+ self.scalarsWidget.hideWidget()
+ self.mobileMeshWidget.hideWidget()
+ self.radiativeWidget.hideWidget()
+ #self.pressureWidget.hideWidget()
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/BoundaryConditionsWallRadiativeTransferForm.ui b/gui/Pages/BoundaryConditionsWallRadiativeTransferForm.ui
new file mode 100644
index 0000000..b4f1f0e
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsWallRadiativeTransferForm.ui
@@ -0,0 +1,186 @@
+<ui version="4.0" >
+ <class>BoundaryConditionsWallRadiativeTransferForm</class>
+ <widget class="QWidget" name="BoundaryConditionsWallRadiativeTransferForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>372</width>
+ <height>248</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxRadiative" >
+ <property name="title" >
+ <string>Thermal radiative transfer</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer name="horizontalSpacer_7" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <spacer name="horizontalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxRadiative" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: ISOTHP</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QTableView" name="tableViewScalars" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="verticalScrollMode" >
+ <enum>QAbstractItemView::ScrollPerPixel</enum>
+ </property>
+ <property name="horizontalScrollMode" >
+ <enum>QAbstractItemView::ScrollPerPixel</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Post-processing zone: no.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditZone" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_8" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/BoundaryConditionsWallRadiativeTransferView.py b/gui/Pages/BoundaryConditionsWallRadiativeTransferView.py
new file mode 100644
index 0000000..fea123a
--- /dev/null
+++ b/gui/Pages/BoundaryConditionsWallRadiativeTransferView.py
@@ -0,0 +1,299 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- StandardItemModelBoundaries
+- StandardItemModelScalars
+- RadiativeBoundariesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Pages.BoundaryConditionsWallRadiativeTransferForm import Ui_BoundaryConditionsWallRadiativeTransferForm
+from Pages.ThermalRadiationModel import ThermalRadiationModel
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import IntValidator, DoubleValidator, ComboModel, setGreenColor
+#from Pages.RadiativeBoundariesModel import RadiativeBoundariesModel
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.Boundary import Boundary
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("BoundaryConditionsWallRadiativeTransferView")
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class to display scalars properties
+#-------------------------------------------------------------------------------
+
+class StandardItemModelScalars(QStandardItemModel):
+ def __init__(self, bdModel):
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Wall radiative\ncaracteristics"),
+ self.tr("Value"),
+ self.tr("Unit")]
+ self.setColumnCount(len(self.headers))
+ self.bdModel = bdModel
+ self.liste = self.getListVariablesForCondition()
+ self.setRowCount(len(self.liste))
+ log.debug("StandardItemModelScalars.__init__ liste = %s " % str(self.liste))
+
+ self.dataScalars = {}
+ self.dataScalars["EPSP"] = bdModel.getEmissivity()
+ self.dataScalars["XLAMP"] = bdModel.getThermalConductivity()
+ self.dataScalars["EPAP"] = bdModel.getThickness()
+ self.dataScalars["TEXTP"] = bdModel.getExternalTemperatureProfile()
+ self.dataScalars["TINTP"] = bdModel.getInternalTemperatureProfile()
+ self.dataScalars["FLUX"] = bdModel.getFlux()
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ if index.column() == 0:
+ return QVariant(self.liste[index.row()][1])
+ elif index.column() == 1:
+ key = self.liste[index.row()][3]
+ return QVariant(self.dataScalars[key])
+ elif index.column() == 2:
+ return QVariant(self.liste[index.row()][2])
+ if role == Qt.ToolTipRole:
+ kword = self.liste[index.row()][3]
+ return QVariant(self.tr("Code_Saturne keyword: " + kword))
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() == 1:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ if index.column() == 1:
+ row = index.row()
+ key = self.liste[row][3]
+ tag = self.liste[row][4]
+ val, ok = value.toDouble()
+ self.bdModel.setValRay(val, tag)
+ self.dataScalars[key] = val
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def deleteAll(self):
+ self.dataScalars = []
+ self.setRowCount(0)
+
+
+ def insertItem(self):
+ self.dataScalars.append()
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def getItem(self, row):
+ return self.dataScalars[row]
+
+
+ def getListVariablesForCondition(self):
+ """
+ Get list of variables for condition choosed
+ """
+ cond = self.bdModel.getRadiativeChoice()
+
+ if cond == 'itpimp':
+ liste = [(0, self.tr("Emissivite"), '', 'EPSP', 'emissivity'),
+ (1, self.tr("Initial temperature"), 'K', 'TINTP', 'internal_temperature_profile')]
+ if cond == 'ipgrno':
+ liste = [(0, self.tr("Emissivity"), '', 'EPSP', 'emissivity'),
+ (1, self.tr("Conductivity"), 'W/m/K', 'XLAMP', 'thermal_conductivity'),
+ (2, self.tr("Thickness"), 'm', 'EPAP' , 'thickness'),
+ (3, self.tr("Profile of external temperature"), 'K', 'TEXTP', 'external_temperature_profile'),
+ (4, self.tr("Profile of internal temperature"), 'K', 'TINTP', 'internal_temperature_profile')]
+## if cond == 'iprefl':
+## list = [(0, self.xlamp,t.XLAMP, 'W/m/K', 'XLAMP'),
+## (1, self.epap, t.EPAP, 'm', 'EPAP'),
+## (2, self.textp,t.TEXTP, 'K', 'TEXTP'),
+## (3, self.tintp,t.TINTP, 'K', 'TINTP')]
+## self.f43 = Tix.Frame(self.f4, relief=FLAT)
+## self.f43.pack(side=TOP, fill=X, pady=10)
+## frad = self.f43
+ if cond == 'ifgrno':
+ liste = [(0, self.tr("Emissivity"),'', 'EPSP', 'emissivity'),
+ (1, self.tr("Flux of conduction"), 'W/m2', 'FLUX', 'flux'),
+ (2, self.tr("Inital temperature"), 'K', 'TINTP', 'internal_temperature_profile')]
+## if cond == 'ifrefl':
+## list = [(0, self.flux, t.FLUX, 'W/m2', 'FLUX'),
+## (1, self.tintp, t.TINTP, 'K', 'TINTP')]
+## self.f45 = Tix.Frame(self.f4, relief=FLAT)
+## self.f45.pack(side=TOP, fill=X, pady=10)
+## frad = self.f45
+ return liste
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class BoundaryConditionsWallRadiativeTransferView(QWidget,
+ Ui_BoundaryConditionsWallRadiativeTransferForm):
+ """
+ """
+ def __init__(self, parent):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_BoundaryConditionsWallRadiativeTransferForm.__init__(self)
+ self.setupUi(self)
+
+
+ def setup(self, case):
+ """
+ Setup the widget
+ """
+ self.__case = case
+ self.__boundary = None
+
+ # Create the Page layout.
+
+ # Combo
+ self.modelRadiative = ComboModel(self.comboBoxRadiative,3,1)
+ self.modelRadiative.addItem(self.tr("Gray or black wall\n"\
+ " and profile of fixed internal temperature"), 'itpimp')
+ self.modelRadiative.addItem(self.tr("Gray or black wall\n"\
+ " and profile of fixed external temperature"), 'ipgrno')
+## self.modelRadiative.addItem(self.tr("Paroi reflechissante\n"\
+## " + profil de temperature externe impose"), 'iprefl')
+ self.modelRadiative.addItem(self.tr("Gray or black wall\n"\
+ " and flux of fixed conduction"), 'ifgrno')
+## self.modelRadiative.addItem(self.tr("Paroi reflechissante\n"\
+## " + flux de conduction impose en paroi"), 'ifrefl')
+
+ # Validator
+ validatorZone = IntValidator(self.lineEditZone, min=0)
+ validatorZone.setExclusiveMin(True)
+ self.lineEditZone.setValidator(validatorZone)
+
+ # Connections
+ self.connect(self.comboBoxRadiative,
+ SIGNAL("activated(const QString&)"),
+ self.slotRadiativeChoice)
+ self.connect(self.lineEditZone,
+ SIGNAL("textChanged(const QString &)"),
+ self.slotZone)
+
+
+ def showWidget(self, b):
+ """
+ Show the widget
+ """
+ if ThermalRadiationModel(self.__case).getRadiativeModel() != "off":
+ label = b.getLabel()
+ self.__boundary = Boundary('radiative_wall', label, self.__case)
+ choice = self.__boundary.getRadiativeChoice()
+ self.modelRadiative.setItem(str_model=choice)
+
+ if hasattr(self, "modelScalars"):
+ del self.modelScalars
+ self.modelScalars = StandardItemModelScalars(self.__boundary)
+ self.tableViewScalars.setModel(self.modelScalars)
+
+ self.nb_zone = self.__boundary.getOutputRadiativeZone()
+ self.lineEditZone.setText(QString(str(self.nb_zone)))
+
+ self.show()
+ else:
+ self.hideWidget()
+
+
+ def hideWidget(self):
+ """
+ Hide all the widget
+ """
+ self.hide()
+
+
+ @pyqtSignature("const QString&")
+ def slotZone(self, text):
+ nb_zone, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__boundary.setOutputRadiativeZone(nb_zone)
+ return nb_zone
+
+
+ @pyqtSignature("const QString&")
+ def slotRadiativeChoice(self, text):
+ cond = self.modelRadiative.dicoV2M[str(text)]
+ log.debug("slotRadiativeChoice cond = %s "%cond)
+ self.__boundary.setRadiativeChoice(cond)
+ self.modelScalars.deleteAll()
+ self.modelScalars = StandardItemModelScalars(self.__boundary)
+ self.tableViewScalars.setModel(self.modelScalars)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/CoalCombustionForm.ui b/gui/Pages/CoalCombustionForm.ui
new file mode 100644
index 0000000..0252b6f
--- /dev/null
+++ b/gui/Pages/CoalCombustionForm.ui
@@ -0,0 +1,1287 @@
+<ui version="4.0" >
+ <class>CoalCombustionForm</class>
+ <widget class="QWidget" name="CoalCombustionForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>593</width>
+ <height>598</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_14" >
+ <item row="0" column="0" >
+ <widget class="QTabWidget" name="tabWidget_2" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab_7" >
+ <attribute name="title" >
+ <string>Coal</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_12" >
+ <item row="0" column="0" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>6</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxCoalsList" >
+ <property name="title" >
+ <string>Coal combustion</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item rowspan="3" row="0" column="0" >
+ <widget class="QTreeView" name="treeViewCoals" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>80</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>80</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>false</bool>
+ </property>
+ <property name="uniformRowHeights" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="pushButtonAddCoal" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QPushButton" name="pushButtonDeleteCoal" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Classes</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxClasses" >
+ <property name="title" >
+ <string>Classes</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item rowspan="3" row="0" column="0" >
+ <widget class="QTreeView" name="treeViewClasses" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>120</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>false</bool>
+ </property>
+ <property name="uniformRowHeights" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="pushButtonAddClass" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QPushButton" name="pushButtonDeleteClass" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Coal</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_9" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxComposition" >
+ <property name="title" >
+ <string>Coal composition</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelC" >
+ <property name="text" >
+ <string>Composition over C on dry </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditC" />
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitC" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelH" >
+ <property name="text" >
+ <string>Composition over H on dry </string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditH" />
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitH" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelO" >
+ <property name="text" >
+ <string>Composition over O on dry </string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditO" />
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="labelUnitO" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxProperties" >
+ <property name="title" >
+ <string>Coal properties</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_8" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_7" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelPCI" >
+ <property name="text" >
+ <string>PCI</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditPCI" />
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitPCI" >
+ <property name="text" >
+ <string>J/kg</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QComboBox" name="comboBoxPCIList" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelCp" >
+ <property name="text" >
+ <string>Cp</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditCp" />
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitCp" >
+ <property name="text" >
+ <string>J/kg/K</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelDensity" >
+ <property name="text" >
+ <string>Density</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditDensity" />
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="labelUnitDensity" >
+ <property name="text" >
+ <string>kg/m<sup>3</sup></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>120</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_3" >
+ <attribute name="title" >
+ <string>Coke</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxCokeComposition" >
+ <property name="title" >
+ <string>Coke composition</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelC_2" >
+ <property name="text" >
+ <string>Composition over C on dry </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditCokeC" />
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitCokeC" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelCokeH" >
+ <property name="text" >
+ <string>Composition over H on dry </string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditCokeH" />
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitCokeH" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelCokeO" >
+ <property name="text" >
+ <string>Composition over O on dry </string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditCokeO" />
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="labelUnitCokeO" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxCokeProperties" >
+ <property name="title" >
+ <string>Coke properties</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelCokePCI" >
+ <property name="text" >
+ <string>PCI</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditCokePCI" />
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitCokePCI" >
+ <property name="text" >
+ <string>J/kg</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_4" >
+ <attribute name="title" >
+ <string>Ashes</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_6" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxAshesProperties" >
+ <property name="title" >
+ <string>Ashes properties</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_4" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelAshessRatio" >
+ <property name="text" >
+ <string>Ratio</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditAshesRatio" />
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitAshesRatio" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelAshesEnthalpy" >
+ <property name="text" >
+ <string>Enthalpy</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditAshesEnthalpy" />
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitAshesEnthalpy" >
+ <property name="text" >
+ <string>J/kg</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelAshesCp" >
+ <property name="text" >
+ <string>Cp</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditAshesCp" />
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="labelUnitAshesCp" >
+ <property name="text" >
+ <string>J/kg/K</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelHumidity" >
+ <property name="text" >
+ <string>Humidity</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditHumidity" />
+ </item>
+ <item row="3" column="2" >
+ <widget class="QLabel" name="labelUnitHumidity" >
+ <property name="text" >
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_5" >
+ <attribute name="title" >
+ <string>Devolatilisation</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxKobayashi" >
+ <property name="title" >
+ <string>Kobayashi model</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelCoefY1" >
+ <property name="text" >
+ <string>Coefficient stoechiomtrique Y<sub>1</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditCoefY1" />
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelY1" >
+ <property name="text" >
+ <string>automatic</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QCheckBox" name="checkBoxY1" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelCoefY2" >
+ <property name="text" >
+ <string>Coefficient stoechiomtrique Y<sub>2</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditCoefY2" />
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelY2" >
+ <property name="text" >
+ <string>automatic</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QCheckBox" name="checkBoxY2" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelCoefA1" >
+ <property name="text" >
+ <string>Facteur pre-exponentielle A<sub>1</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditCoefA1" />
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="labelUnitA1" >
+ <property name="text" >
+ <string>s<sup>-1</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelCoefA2" >
+ <property name="text" >
+ <string>Facteur pre-exponentielle A<sub>2</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditCoefA2" />
+ </item>
+ <item row="3" column="2" >
+ <widget class="QLabel" name="labelUnitA2" >
+ <property name="text" >
+ <string>s<sup>-1</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="labelCoefE1" >
+ <property name="text" >
+ <string>Energie d'activation E<sub>1</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLineEdit" name="lineEditCoefE1" />
+ </item>
+ <item row="4" column="2" >
+ <widget class="QLabel" name="labelUnitE1" >
+ <property name="text" >
+ <string>J/mol</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="labelCoefE2" >
+ <property name="text" >
+ <string>Energie d'activation E<sub>2</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLineEdit" name="lineEditCoefE2" />
+ </item>
+ <item row="5" column="2" >
+ <widget class="QLabel" name="labelUnitE2" >
+ <property name="text" >
+ <string>J/mol</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_6" >
+ <attribute name="title" >
+ <string>Heterogeneous combustion</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxParametersO2" >
+ <property name="title" >
+ <string>Parameters for O2</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>80</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelConstO2" >
+ <property name="text" >
+ <string>Pre-exponential constant</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditConstO2" />
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitConstO2" >
+ <property name="text" >
+ <string>kg/m<sup>2</sup>/s/atm</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelEnergyO2" >
+ <property name="text" >
+ <string>Activation energy</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditEnergyO2" />
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitO2" >
+ <property name="text" >
+ <string>kcal/mol</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelReactionOrderO2" >
+ <property name="text" >
+ <string>Reaction order</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QComboBox" name="comboBoxReactO2" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>80</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxParametersCO2" >
+ <property name="title" >
+ <string>Parameters for CO2</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelConstCO2" >
+ <property name="text" >
+ <string>Pre-exponential constant</string>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="3" row="0" column="1" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QLineEdit" name="lineEditConstCO2" />
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditEnergyCO2" />
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxReactCO2" />
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitConstCO2" >
+ <property name="text" >
+ <string>kg/m<sup>2</sup>/s/atm</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelEnergyCO2" >
+ <property name="text" >
+ <string>Activation energy</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitCO2" >
+ <property name="text" >
+ <string>kcal/mol</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelReactionOrderCO2" >
+ <property name="text" >
+ <string>Reaction order</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>391</width>
+ <height>154</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>435</width>
+ <height>5</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_8" >
+ <attribute name="title" >
+ <string>Oxydant</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_13" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Oxydants caracterization (by number of mol)</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_11" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_10" >
+ <item row="0" column="1" >
+ <spacer name="verticalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="pushButtonAddOxydant" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QPushButton" name="pushButtonDeleteOxydant" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="3" row="0" column="0" >
+ <widget class="QTableView" name="tableViewOxydants" >
+ <property name="minimumSize" >
+ <size>
+ <width>430</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="horizontalScrollMode" >
+ <enum>QAbstractItemView::ScrollPerPixel</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer name="verticalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>435</width>
+ <height>252</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer name="verticalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/CoalCombustionModel.py b/gui/Pages/CoalCombustionModel.py
new file mode 100644
index 0000000..68cb9b9
--- /dev/null
+++ b/gui/Pages/CoalCombustionModel.py
@@ -0,0 +1,1197 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the coal combustion thermal flow modelling management.
+
+This module contains the following classes and function:
+- CoalCombustionModel
+- CoalCombustionTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+import Pages.CoalThermoChemistry as CoalThermoChemistry
+import Pages.IdentityAndPathesModel as IdentityAndPathesModel
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+from Pages.FluidCharacteristicsModel import FluidCharacteristicsModel
+from Pages.NumericalParamEquationModel import NumericalParamEquatModel
+from ThermalRadiationModel import ThermalRadiationModel
+from LocalizationModel import LocalizationModel
+from Boundary import Boundary
+
+#-------------------------------------------------------------------------------
+# Coal combustion model class
+#-------------------------------------------------------------------------------
+
+class CoalCombustionModel(Variables, Model):
+ """
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ nModels = self.case.xmlGetNode('thermophysical_models')
+ self.node_lagr = self.case.xmlGetNode('lagrangian', 'model')
+ self.node_turb = nModels.xmlGetNode('turbulence', 'model')
+ self.node_gas = nModels.xmlInitNode('gas_combustion', 'model')
+ self.node_coal = nModels.xmlInitNode('pulverized_coal', 'model')
+ self.node_joule = nModels.xmlInitNode('joule_effect', 'model')
+ self.node_therm = nModels.xmlInitNode('thermal_scalar', 'model')
+
+ self.coalCombustionModel = ('off', 'coal_homo', 'coal_homo2')
+
+
+ def defaultValues(self):
+ """
+ Private method
+ Return in a dictionnary which contains default values.
+ """
+ default = {}
+ default['model'] = "off"
+ default['diameter'] = 0.0001
+ default['ihtco2'] = 0
+ default['ieqco2'] = 0
+
+ return default
+
+
+ def __coalCombustionModelsList(self):
+ """
+ Private method
+ Create a tuple with the coal combustion models allowed
+ by the calculation features.
+ """
+ coalCombustionList = self.coalCombustionModel
+
+ if self.node_lagr and self.node_lagr['model'] != 'off':
+ coalCombustionList = ('off', 'coal_homo', 'coal_homo2')
+
+ n, m = FluidCharacteristicsModel(self.case).getThermalModel()
+ if m != "off" and m not in coalCombustionList:
+ coalCombustionList = ('off',)
+
+ if self.node_turb['model'] not in ('k-epsilon',
+ 'k-epsilon-PL',
+ 'Rij-epsilon',
+ 'Rij-SSG',
+ 'v2f-phi',
+ 'k-omega-SST'):
+ coalCombustionList = ('off',)
+
+ return coalCombustionList
+
+
+ def __createModelScalarsList(self , thermoChemistryModel):
+ """
+ Private method
+ Create model scalar list
+ """
+ coalsNumber = thermoChemistryModel.getCoals().getCoalNumber()
+ classesNumber = sum(thermoChemistryModel.getCoals().getClassesNumberList())
+
+ list = []
+ # add new scalars
+ list.append("Enthalpy")
+
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "XWT_CP", "ENT_CP"]
+
+ for baseName in baseNames:
+ for classe in range(0,classesNumber):
+ name = '%s%2.2i' % (baseName, classe+1)
+ list.append(name)
+
+ baseNames = [ "Fr_MV1", "Fr_MV2"]
+ for baseName in baseNames:
+ for coal in range(0,coalsNumber):
+ name = '%s%2.2i' % (baseName, coal+1)
+ list.append(name)
+
+ self.setNewModelScalar(self.node_coal, "Fr_HET_O2")
+ list.append("Fr_HET_O2")
+
+ if self.defaultValues()['ihtco2'] == 1:
+ list.append("Fr_HET_CO2")
+
+ list.append("Var_AIR")
+
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ list.append("FR_H20")
+
+ if thermoChemistryModel.getOxydants().getNumber() >= 2:
+ list.append("FR_OXYD2")
+
+ if thermoChemistryModel.getOxydants().getNumber() == 3:
+ list.append("FR_OXYD3")
+
+ if self.defaultValues()['ieqco2'] == 1:
+ list.append("FR_CO2")
+
+ return list
+
+
+ def __createModelScalars(self , thermoChemistryModel):
+ """
+ Private method
+ Create model scalar
+ """
+ previous_list = []
+ nodes = self.node_coal.xmlGetChildNodeList('scalar')
+ for node in nodes:
+ previous_list.append(node['name'])
+
+ new_list = self.__createModelScalarsList(thermoChemistryModel)
+ for name in previous_list:
+ if name not in new_list:
+ self.node_coal.xmlRemoveChild('scalar', name = name)
+
+ for name in new_list:
+ if name not in previous_list:
+ self.setNewModelScalar(self.node_coal, name)
+
+ NPE = NumericalParamEquatModel(self.case)
+ for node in self.node_coal.xmlGetChildNodeList('scalar'):
+ NPE.setBlendingFactor(node['label'], 0.)
+ NPE.setScheme(node['label'], 'upwind')
+ NPE.setFluxReconstruction(node['label'], 'off')
+
+
+ def __createModelPropertiesList(self, thermoChemistryModel):
+ """
+ Private method
+ Create model properties
+ """
+ classesNumber = sum(thermoChemistryModel.getCoals().getClassesNumberList())
+
+ list = []
+ list.append("Temp_GAZ")
+ list.append("ROM_GAZ")
+ list.append("YM_CHx1m")
+ list.append("YM_CHx2m")
+ list.append("YM_CO")
+ list.append("YM_O2")
+ list.append("YM_CO2")
+ list.append("YM_H2O")
+ list.append("YM_N2")
+ list.append("XM")
+
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET_O2"]
+
+ if self.defaultValues()['ihtco2'] == 1:
+ baseNames.append("Ga_HET_CO2")
+
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames.append("Ga_SEC")
+
+ for baseName in baseNames:
+ for classe in range(0,classesNumber):
+ name = '%s%2.2i' % (baseName, classe+1)
+ list.append(name)
+
+ list.append("IntLuminance_4PI")
+
+ return list
+
+
+ def __createModelProperties(self, thermoChemistryModel):
+ """
+ Private method
+ Create model properties
+ """
+ previous_list = []
+ nodes = self.node_coal.xmlGetChildNodeList('property')
+ for node in nodes:
+ previous_list.append(node['name'])
+
+ new_list = self.__createModelPropertiesList(thermoChemistryModel)
+ for name in previous_list:
+ if name not in new_list:
+ self.node_coal.xmlRemoveChild('property', name = name)
+
+ for name in new_list:
+ if name not in previous_list:
+ self.setNewProperty(self.node_coal, name)
+
+
+ def createModel (self) :
+ """
+ Private method
+ Create scalars and properties when coal combustion is selected
+ """
+ model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+ self.__createModelScalars(model)
+ self.__createModelProperties(model)
+
+
+ def __deleteWetScalarsAndProperty(self):
+ """
+ Private method
+ Delete scalars XWT_CP and Fr_H20 and property Ga_SEC
+ if model is'nt 'coal_homo2'
+ """
+ if self.getCoalCombustionModel() != 'coal_homo2':
+ nod = self.node_coal.xmlGetNode('scalar', type="model", name="FR_H20")
+ if nod:
+ nod.xmlRemoveNode()
+ for node in self.node_coal.xmlGetNodeList('scalar', type="model"):
+ if node['name'][:6] == "XWT_CP":
+ node.xmlRemoveNode()
+ for node in self.node_coal.xmlGetNodeList('property'):
+ if node['name'][:6] == "Ga_SEC":
+ node.xmlRemoveNode()
+
+
+ def __deleteCoalModelProperties(self, classMin, classMax, classesNumber):
+ """
+ Private method
+ Delete properties for one coal
+ """
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET", "Ga_SEC"]
+ #
+ # Remove coal classes
+ nodeList = self.node_coal.xmlGetNodeList('property')
+ if nodeList != None:
+ for node in nodeList :
+ nameNode =node['name']
+ for baseName in baseNames:
+ for classe in range(classMin, classMax):
+ name = '%s%2.2i' % (baseName, classe+1)
+ if ( nameNode == name):
+ node.xmlRemoveNode()
+ #
+ # Rename other classes
+ nodeList = self.node_coal.xmlGetNodeList('property')
+ delta = classMax - classMin
+ if nodeList != None:
+ for node in nodeList:
+ try:
+ oldName = node['name']
+ if oldName[:-2] in baseNames :
+ oldNum = int(oldName[-2:])
+ if oldNum in range(classMax+1, classesNumber+1):
+ name = '%s%2.2i' % (oldName[:-2], oldNum-delta)
+ node['name'] = name
+ if node['label'] == oldName:
+ node['label'] = name
+
+ except:
+ pass
+
+
+ def __deleteCoalModelScalars(self, classMin, classMax, classesNumber, coalNumber, coalsNumber):
+ """
+ Private method
+ Delete scalars for one coal
+ """
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP", "XWT_CP"]
+ #
+ # Remove coal classes
+ nodeList = self.node_coal.xmlGetNodeList('scalar', 'name')
+ if nodeList != None:
+ for node in nodeList :
+ nameNode = node['name']
+ for baseName in baseNames:
+ for classe in range(classMin, classMax):
+ name = '%s%2.2i' % (baseName, classe+1)
+ if (nameNode == name):
+ node.xmlRemoveNode()
+ #
+ # Rename other classes
+ nodeList = self.node_coal.xmlGetNodeList('scalar')
+ delta = classMax - classMin
+ if nodeList != None:
+ for node in nodeList:
+ try:
+ oldName = node['name']
+ if oldName[:-2] in baseNames :
+ oldNum = int(oldName[-2:])
+ if oldNum in range(classMax+1, classesNumber+1):
+ name = '%s%2.2i' % (oldName[:-2], oldNum-delta)
+ node['name'] = name
+ if node['label'] == oldName:
+ node['label'] = name
+ except:
+ pass
+ #
+ # Remove coal scalars
+ baseNames = [ "Fr_MV1", "Fr_MV2"]
+ nodeList = self.node_coal.xmlGetNodeList('scalar')
+ if nodeList != None:
+ for node in nodeList :
+ nameNode = node['name']
+ for baseName in baseNames:
+ name = '%s%2.2i' % (baseName, coalNumber+1)
+ if (nameNode == name):
+ node.xmlRemoveNode()
+ #
+ # Rename other coals
+ nodeList = self.node_coal.xmlGetNodeList('scalar')
+ if nodeList != None:
+ for node in nodeList:
+ oldName = node['name']
+ if oldName[:-2] in baseNames :
+ oldNum = int(oldName[-2:])
+ if oldNum in range(coalNumber+1, coalsNumber+1):
+ name = '%s%2.2i' % (oldName[:-2], oldNum-1)
+ node['name'] = name
+ if node['label'] == oldName:
+ node['label'] = name
+
+
+ def __updateCoalCombustionDensity(self, model):
+ """
+ Private method
+ Update the coal combustion model markup from the XML document.
+ """
+ self.isInList(model, self.__coalCombustionModelsList())
+
+ mdl = FluidCharacteristicsModel(self.case)
+
+ if model == 'off':
+ w = mdl.node_density.xmlGetDouble('initial_value')
+
+ if w == None:
+ v = mdl.defaultFluidCharacteristicsValues()['density']
+ mdl.node_density.xmlSetData('initial_value',v)
+ mdl.setPropertyMode('density', 'constant')
+ mdl.node_density.xmlInitNode('listing_printing', status='off')
+ mdl.node_density.xmlInitNode('postprocessing_recording', status='off')
+
+ v = mdl.defaultFluidCharacteristicsValues()['thermal_conductivity']
+ mdl.node_cond.xmlSetData('initial_value',v)
+ mdl.setPropertyMode('thermal_conductivity', 'constant')
+ mdl.node_cond.xmlInitNode('listing_printing', status='off')
+ mdl.node_cond.xmlInitNode('postprocessing_recording', status='off')
+
+ else:
+ mdl.setPropertyMode('density', 'variable')
+ mdl.node_density.xmlRemoveChild('initial_value')
+ mdl.node_density.xmlRemoveChild('listing_printing')
+ mdl.node_density.xmlRemoveChild('postprocessing_recording')
+ mdl.node_cond.xmlRemoveNode()
+
+
+ def __createCoalModelScalars(self , coalsNumber, coalClassesNumber, classesNumber):
+ """
+ Private method
+ Create new scalars for one coal
+ """
+ # add new scalars
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP", "XWT_CP"]
+ else:
+ self.__deleteWetScalarsAndProperty()
+
+ for baseName in baseNames:
+ for classe in range(classesNumber - coalClassesNumber, classesNumber):
+ name = '%s%2.2i' % (baseName, classe+1)
+ self.setNewModelScalar(self.node_coal, name)
+
+ baseNames = [ "Fr_MV1", "Fr_MV2"]
+ for baseName in baseNames:
+ name = '%s%2.2i' % (baseName, coalsNumber)
+ self.setNewModelScalar(self.node_coal, name)
+
+ NPE = NumericalParamEquatModel(self.case)
+ for node in self.node_coal.xmlGetChildNodeList('scalar'):
+ NPE.setBlendingFactor(node['label'], 0.)
+ NPE.setScheme(node['label'], 'upwind')
+ NPE.setFluxReconstruction(node['label'], 'off')
+
+
+ def __createCoalModelProperties(self, coalsNumber, coalClassesNumber, classesNumber):
+ """
+ Private method
+ Create new properties for one coal
+ """
+ # create new properties
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET", "Ga_SEC"]
+ for baseName in baseNames:
+ for classe in range(classesNumber - coalClassesNumber, classesNumber):
+ name = '%s%2.2i' % (baseName, classe+1)
+ self.setNewProperty(self.node_coal, name)
+
+
+ def __createClassModelProperties(self, classNum, classesNumber):
+ """
+ Private method
+ Create class of model properties
+ """
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET", "Ga_SEC"]
+ #
+ # Rename other classes
+ nodeList = self.node_coal.xmlGetNodeList('property')
+ if nodeList != None:
+ for node in nodeList:
+ oldName = node['name']
+ if oldName[:-2] in baseNames :
+ oldNum = int(oldName[-2:])
+ if oldNum in range(classNum, classesNumber + 1):
+ name = '%s%2.2i' % (oldName[:-2], oldNum + 1)
+ node['name'] = name
+ if node['label'] == oldName:
+ node['label'] = name
+ #
+ # create new properties
+ for i in range(len(baseNames)):
+ name = '%s%2.2i' % (baseNames[i], classNum)
+ self.setNewProperty(self.node_coal, name)
+
+
+ def __createClassModelScalars(self, classNum, classesNumber):
+ """
+ Private method
+ Create a new coal and associated scalars
+ """
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP", "XWT_CP"]
+ else:
+ self.__deleteWetScalarsAndProperty()
+ #
+ # Rename other classes
+ nodeList = self.node_coal.xmlGetNodeList('scalar')
+ if nodeList != None:
+ for node in nodeList:
+ oldName = node['name']
+ if oldName[:-2] in baseNames :
+ oldNum = int(oldName[-2:])
+ if oldNum in range(classNum, classesNumber + 1):
+ name = '%s%2.2i' % (oldName[:-2], oldNum+1)
+ node['name'] = name
+ if node['label'] == oldName:
+ node['label'] = name
+ #
+ # create new scalars
+ for i in range(len(baseNames)):
+ name = '%s%2.2i' % (baseNames[i], classNum)
+ self.setNewModelScalar(self.node_coal, name)
+
+
+ def setCoalCombustionModel(self, model):
+ """
+ Update the coal combustion model markup from the XML document.
+ """
+ self.isInList(model, self.__coalCombustionModelsList())
+
+ if model == 'off':
+ for tag in ('scalar',
+ 'property',
+ 'reference_mass_molar',
+ 'reference_temperature'):
+ for node in self.node_coal.xmlGetNodeList(tag):
+ node.xmlRemoveNode()
+
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ if zone.getNature() == "inlet":
+ Boundary("coal_inlet", zone.getLabel(), self.case).deleteCoals()
+
+ ThermalRadiationModel(self.case).setRadiativeModel('off')
+ self.node_coal['model'] = 'off'
+
+ else:
+ self.node_gas['model'] = 'off'
+ self.node_coal['model'] = model
+ self.node_joule['model'] = 'off'
+ self.node_therm['model'] = 'off'
+ self.createModel()
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ if zone.getNature() == "inlet":
+ b = Boundary("coal_inlet", zone.getLabel(), self.case)
+ b.getOxydantTemperature()
+ b.getOxydantNumber()
+
+ self.__updateCoalCombustionDensity(model)
+
+
+ def getCoalCombustionModel(self):
+ """
+ Return the current coal combustion model.
+ """
+ model = self.node_coal['model']
+
+ if model not in self.__coalCombustionModelsList():
+ model = self.defaultValues()['model']
+ self.setCoalCombustionModel(model)
+ else:
+ self.__updateCoalCombustionDensity(model)
+
+ return model
+
+
+ def createCoalModelScalarsAndProperties(self, thermoChemistryModel ):
+ """
+ Create new scalars and new properties for one coal
+ """
+ coalsNumber = thermoChemistryModel.getCoals().getCoalNumber()
+ coalClassesNumber = thermoChemistryModel.getCoals().getClassesNumberList()[coalsNumber - 1]
+ classesNumber = sum(thermoChemistryModel.getCoals().getClassesNumberList())
+
+ # add new scalars and properties
+ self.__createCoalModelScalars(coalsNumber, coalClassesNumber, classesNumber)
+ self.__createCoalModelProperties(coalsNumber, coalClassesNumber, classesNumber)
+
+
+ def createClassModelScalarsAndProperties(self, thermoChemistryModel, coalNumber):
+ """
+ Create class of model scalars and properties for one given coal
+ """
+ self.isInt(coalNumber)
+
+ classNum = 0
+ for coal in range(0, coalNumber):
+ classNum += thermoChemistryModel.getCoals().getClassesNumberList()[coal]
+
+ classesNumber = sum(thermoChemistryModel.getCoals().getClassesNumberList())
+ #
+ # create new scalars
+ self.__createClassModelScalars(classNum, classesNumber)
+ self.__createClassModelProperties(classNum, classesNumber)
+
+
+ def deleteCoalModelScalarsAndProperties(self, thermoChemistryModel, coalNumber):
+ """
+ Delete scalars and properties for one coal
+ """
+ self.isInt(coalNumber)
+
+ classMin = 0
+ for coal in range(0, coalNumber):
+ classMin += thermoChemistryModel.getCoals().getClassesNumberList()[coal]
+ classMax = classMin + thermoChemistryModel.getCoals().getClassesNumberList()[coalNumber]
+ classesNumber = sum(thermoChemistryModel.getCoals().getClassesNumberList())
+ coalsNumber = thermoChemistryModel.getCoals().getCoalNumber()
+
+ self.__deleteCoalModelScalars(classMin, classMax, classesNumber, coalNumber, coalsNumber)
+ self.__deleteCoalModelProperties(classMin, classMax, classesNumber)
+
+
+ def deleteClassModelScalars(self, thermoChemistryModel, coalNumber, classeNumber):
+ """
+ delete class of model scalars
+ """
+ self.isInt(coalNumber)
+ self.isInt(classeNumber)
+
+ classNum = 0
+ if (coalNumber >= 1) :
+ for coal in range(0, coalNumber - 1):
+ classNum += thermoChemistryModel.getCoals().getClassesNumberList()[coal]
+ classNum += classeNumber
+
+
+ classesNumber = sum(thermoChemistryModel.getCoals().getClassesNumberList())
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["NP_CP", "XCH_CP", "XCK_CP", "ENT_CP", "XWT_CP"]
+
+ #
+ # Remove coal classes
+ nodeList = self.node_coal.xmlGetNodeList('scalar')
+ if nodeList != None:
+ for node in nodeList :
+ nodeName = node['name']
+ for baseName in baseNames:
+ name = '%s%2.2i' % (baseName, classNum+1)
+ if (nodeName == name):
+ node.xmlRemoveNode()
+ #
+ # Rename other classes
+ nodeList = self.node_coal.xmlGetNodeList('scalar')
+ if nodeList != None:
+ for node in nodeList:
+ oldName = node['name']
+ if oldName[:-2] in baseNames :
+ oldNum = int(oldName[-2:])
+ if oldNum in range(classNum + 1, classesNumber + 1):
+ name = '%s%2.2i' % (oldName[:-2], oldNum-1)
+ node['name'] = name
+ if node['label'] == oldName:
+ node['label'] = name
+
+
+ def deleteClassModelProperties(self, thermoChemistryModel, coalNumber, classeNumber):
+ """
+ delete class of model properties
+ """
+ self.isInt(coalNumber)
+ self.isInt(classeNumber)
+
+ classNum = 0
+ for coal in range(0, coalNumber):
+ classNum += thermoChemistryModel.getCoals().getClassesNumberList()[coal]
+ classNum += classeNumber
+
+ classesNumber = sum(thermoChemistryModel.getCoals().getClassesNumberList())
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET"]
+ if self.getCoalCombustionModel() == 'coal_homo2':
+ baseNames = ["Temp_CP", "Frm_CP", "Rho_CP", "Dia_CK", "Ga_DCH",
+ "Ga_DV1", "Ga_DV2", "Ga_HET", "Ga_SEC"]
+ #
+ # Remove coal classes
+ nodeList = self.node_coal.xmlGetNodeList('property')
+ if nodeList != None:
+ for node in nodeList :
+ nodeName = node['name']
+ for baseName in baseNames:
+ name = '%s%2.2i' % (baseName, classNum+1)
+ if (nodeName == name):
+ node.xmlRemoveNode()
+ #
+ # Rename other classes
+ nodeList = self.node_coal.xmlGetNodeList('property')
+ if nodeList != None:
+ for node in nodeList:
+ oldName = node['name']
+ if oldName[:-2] in baseNames :
+ oldNum = int(oldName[-2:])
+ if oldNum in range(classNum + 1, classesNumber + 1):
+ name = '%s%2.2i' % (oldName[:-2], oldNum-1)
+ node['name'] = name
+ if node['label'] == oldName:
+ node['label'] = name
+
+#-------------------------------------------------------------------------------
+# Coal combustion test case
+#-------------------------------------------------------------------------------
+
+class CoalCombustionModelTestCase(ModelTest):
+ """
+ """
+
+ def checkCoalCombustionModelInstantiation(self):
+ """Check whether the CoalCombustionModel class could be instantiated"""
+ model = None
+ model = CoalCombustionModel(self.case)
+ assert model != None, 'Could not instantiate coalCombustionModel'
+
+ def checkSetAndGetCoalCombustionModel(self):
+ """Check whether the CoalCombustionModel class could be set and get combustion model"""
+ model = CoalCombustionModel(self.case)
+ model.setCoalCombustionModel('coal_homo')
+
+ doc = '''<pulverized_coal model="coal_homo">
+ <scalar label="Enthalpy" name="Enthalpy" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="NP_CP01" name="NP_CP01" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCH_CP01" name="XCH_CP01" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCK_CP01" name="XCK_CP01" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="ENT_CP01" name="ENT_CP01" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV101" name="Fr_MV101" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV201" name="Fr_MV201" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_HET" name="Fr_HET" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Var_AIR" name="Var_AIR" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_GAZ" name="Temp_GAZ"/>
+ <property label="ROM_GAZ" name="ROM_GAZ"/>
+ <property label="YM_CHx1m" name="YM_CHx1m"/>
+ <property label="YM_CHx2m" name="YM_CHx2m"/>
+ <property label="YM_CO" name="YM_CO"/>
+ <property label="YM_O2" name="YM_O2"/>
+ <property label="YM_CO2" name="YM_CO2"/>
+ <property label="YM_H2O" name="YM_H2O"/>
+ <property label="YM_N2" name="YM_N2"/>
+ <property label="XM" name="XM"/>
+ <property label="Temp_CP01" name="Temp_CP01"/>
+ <property label="Frm_CP01" name="Frm_CP01"/>
+ <property label="Rho_CP01" name="Rho_CP01"/>
+ <property label="Dia_CK01" name="Dia_CK01"/>
+ <property label="Ga_DCH01" name="Ga_DCH01"/>
+ <property label="Ga_DV101" name="Ga_DV101"/>
+ <property label="Ga_DV201" name="Ga_DV201"/>
+ <property label="Ga_HET01" name="Ga_HET01"/>
+ <property label="ntLuminance_4PI" name="ntLuminance_4PI"/>
+ </pulverized_coal>'''
+
+ assert model.node_coal == self.xmlNodeFromString(doc),\
+ 'Could not set a model of combustion'
+ assert model.getCoalCombustionModel() == 'coal_homo',\
+ 'Could not get a model of combustion'
+
+
+ def checkCreateCoalModelScalarsAndProperties(self):
+ """
+ Check whether the CoalCombustionModel class could be
+ created new scalars and properties for one new coal
+ """
+ model = CoalCombustionModel(self.case)
+ model.setCoalCombustionModel('coal_homo')
+
+ from CoalThermoChemistry import CoalThermoChemistryModel, Coal
+ coalThermoChModel = CoalThermoChemistryModel("dp_FCP",self.case)
+ coalThermoChModel.getCoals().addCoal(Coal())
+ del CoalThermoChemistryModel
+
+ model.createCoalModelScalarsAndProperties(coalThermoChModel)
+
+ doc = '''<pulverized_coal model="coal_homo">
+ <scalar label="Enthalpy" name="Enthalpy" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="NP_CP01" name="NP_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCH_CP01" name="XCH_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCK_CP01" name="XCK_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="ENT_CP01" name="ENT_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV101" name="Fr_MV101" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV201" name="Fr_MV201" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_HET" name="Fr_HET" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Var_AIR" name="Var_AIR" type="model"><flux_reconstruction status="off"/></scalar>
+ <property label="Temp_GAZ" name="Temp_GAZ"/>
+ <property label="ROM_GAZ" name="ROM_GAZ"/>
+ <property label="YM_CHx1m" name="YM_CHx1m"/>
+ <property label="YM_CHx2m" name="YM_CHx2m"/>
+ <property label="YM_CO" name="YM_CO"/>
+ <property label="YM_O2" name="YM_O2"/>
+ <property label="YM_CO2" name="YM_CO2"/>
+ <property label="YM_H2O" name="YM_H2O"/>
+ <property label="YM_N2" name="YM_N2"/>
+ <property label="XM" name="XM"/>
+ <property label="Temp_CP01" name="Temp_CP01"/>
+ <property label="Frm_CP01" name="Frm_CP01"/>
+ <property label="Rho_CP01" name="Rho_CP01"/>
+ <property label="Dia_CK01" name="Dia_CK01"/>
+ <property label="Ga_DCH01" name="Ga_DCH01"/>
+ <property label="Ga_DV101" name="Ga_DV101"/>
+ <property label="Ga_DV201" name="Ga_DV201"/>
+ <property label="Ga_HET01" name="Ga_HET01"/>
+ <property label="ntLuminance_4PI" name="ntLuminance_4PI"/>
+ <scalar label="NP_CP02" name="NP_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCH_CP02" name="XCH_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCK_CP02" name="XCK_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="ENT_CP02" name="ENT_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV102" name="Fr_MV102" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV202" name="Fr_MV202" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_CP02" name="Temp_CP02"/>
+ <property label="Frm_CP02" name="Frm_CP02"/>
+ <property label="Rho_CP02" name="Rho_CP02"/>
+ <property label="Dia_CK02" name="Dia_CK02"/>
+ <property label="Ga_DCH02" name="Ga_DCH02"/>
+ <property label="Ga_DV102" name="Ga_DV102"/>
+ <property label="Ga_DV202" name="Ga_DV202"/>
+ <property label="Ga_HET02" name="Ga_HET02"/>
+ </pulverized_coal>'''
+
+ assert model.node_coal == self.xmlNodeFromString(doc),\
+ 'Could not create newscalars and properties for new coal'
+
+
+ def checkCreateClassModelScalarsAndProperties(self):
+ """
+ Check whether the CoalCombustionModel class could be
+ created a new class of scalars and properties for one coal
+ """
+ model = CoalCombustionModel(self.case)
+ model.setCoalCombustionModel('coal_homo')
+
+ from CoalThermoChemistry import CoalThermoChemistryModel, Coal
+ coalThermoChModel = CoalThermoChemistryModel("dp_FCP",self.case)
+ coalThermoChModel.getCoals().addCoal(Coal())
+ model.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.getCoals().addCoal(Coal())
+ model.createCoalModelScalarsAndProperties(coalThermoChModel)
+ del CoalThermoChemistryModel
+
+ model.createClassModelScalarsAndProperties(coalThermoChModel, 2)
+
+ doc = '''<pulverized_coal model="coal_homo">
+ <scalar label="Enthalpy" name="Enthalpy" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="NP_CP01" name="NP_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCH_CP01" name="XCH_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCK_CP01" name="XCK_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="ENT_CP01" name="ENT_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV101" name="Fr_MV101" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV201" name="Fr_MV201" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_HET" name="Fr_HET" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Var_AIR" name="Var_AIR" type="model"><flux_reconstruction status="off"/></scalar>
+ <property label="Temp_GAZ" name="Temp_GAZ"/>
+ <property label="ROM_GAZ" name="ROM_GAZ"/>
+ <property label="YM_CHx1m" name="YM_CHx1m"/>
+ <property label="YM_CHx2m" name="YM_CHx2m"/>
+ <property label="YM_CO" name="YM_CO"/>
+ <property label="YM_O2" name="YM_O2"/>
+ <property label="YM_CO2" name="YM_CO2"/>
+ <property label="YM_H2O" name="YM_H2O"/>
+ <property label="YM_N2" name="YM_N2"/>
+ <property label="XM" name="XM"/>
+ <property label="Temp_CP01" name="Temp_CP01"/>
+ <property label="Frm_CP01" name="Frm_CP01"/>
+ <property label="Rho_CP01" name="Rho_CP01"/>
+ <property label="Dia_CK01" name="Dia_CK01"/>
+ <property label="Ga_DCH01" name="Ga_DCH01"/>
+ <property label="Ga_DV101" name="Ga_DV101"/>
+ <property label="Ga_DV201" name="Ga_DV201"/>
+ <property label="Ga_HET01" name="Ga_HET01"/>
+ <property label="ntLuminance_4PI" name="ntLuminance_4PI"/>
+ <scalar label="NP_CP03" name="NP_CP03" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCH_CP03" name="XCH_CP03" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCK_CP03" name="XCK_CP03" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="ENT_CP03" name="ENT_CP03" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV102" name="Fr_MV102" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV202" name="Fr_MV202" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_CP02" name="Temp_CP02"/>
+ <property label="Frm_CP02" name="Frm_CP02"/>
+ <property label="Rho_CP02" name="Rho_CP02"/>
+ <property label="Dia_CK02" name="Dia_CK02"/>
+ <property label="Ga_DCH02" name="Ga_DCH02"/>
+ <property label="Ga_DV102" name="Ga_DV102"/>
+ <property label="Ga_DV202" name="Ga_DV202"/>
+ <property label="Ga_HET02" name="Ga_HET02"/>
+ <scalar label="NP_CP04" name="NP_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCH_CP04" name="XCH_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCK_CP04" name="XCK_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="ENT_CP04" name="ENT_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV103" name="Fr_MV103" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV203" name="Fr_MV203" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_CP03" name="Temp_CP03"/>
+ <property label="Frm_CP03" name="Frm_CP03"/>
+ <property label="Rho_CP03" name="Rho_CP03"/>
+ <property label="Dia_CK03" name="Dia_CK03"/>
+ <property label="Ga_DCH03" name="Ga_DCH03"/>
+ <property label="Ga_DV103" name="Ga_DV103"/>
+ <property label="Ga_DV203" name="Ga_DV203"/>
+ <property label="Ga_HET03" name="Ga_HET03"/>
+ <scalar label="NP_CP02" name="NP_CP02" type="model"/>
+ <scalar label="XCH_CP02" name="XCH_CP02" type="model"/>
+ <scalar label="XCK_CP02" name="XCK_CP02" type="model"/>
+ <scalar label="ENT_CP02" name="ENT_CP02" type="model"/>
+ <property label="Temp_CP04" name="Temp_CP04"/>
+ <property label="Frm_CP04" name="Frm_CP04"/>
+ <property label="Rho_CP04" name="Rho_CP04"/>
+ <property label="Dia_CK04" name="Dia_CK04"/>
+ <property label="Ga_DCH04" name="Ga_DCH04"/>
+ <property label="Ga_DV104" name="Ga_DV104"/>
+ <property label="Ga_DV204" name="Ga_DV204"/>
+ <property label="Ga_HET04" name="Ga_HET04"/>
+ </pulverized_coal>'''
+
+ assert model.node_coal == self.xmlNodeFromString(doc),\
+ 'Could not create a new class of scalars and properties for one coal'
+
+
+ def checkDeleteCoalModelScalarsAndProperties(self):
+ """
+ Check whether the CoalCombustionModel class could be
+ deleted class of scalars and properties for one given coal
+ """
+ model = CoalCombustionModel(self.case)
+ model.setCoalCombustionModel('coal_homo')
+
+ from CoalThermoChemistry import CoalThermoChemistryModel, Coal
+ coalThermoChModel = CoalThermoChemistryModel("dp_FCP",self.case)
+ coalThermoChModel.getCoals().addCoal(Coal())
+ model.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.getCoals().addCoal(Coal())
+ model.createCoalModelScalarsAndProperties(coalThermoChModel)
+ del CoalThermoChemistryModel
+
+ model.createClassModelScalarsAndProperties(coalThermoChModel, 2)
+ model.deleteCoalModelScalarsAndProperties(coalThermoChModel, 1)
+
+ doc = '''<pulverized_coal model="coal_homo">
+ <scalar label="Enthalpy" name="Enthalpy" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="NP_CP01" name="NP_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCH_CP01" name="XCH_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCK_CP01" name="XCK_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="ENT_CP01" name="ENT_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV101" name="Fr_MV101" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV201" name="Fr_MV201" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_HET" name="Fr_HET" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Var_AIR" name="Var_AIR" type="model"><flux_reconstruction status="off"/></scalar>
+ <property label="Temp_GAZ" name="Temp_GAZ"/>
+ <property label="ROM_GAZ" name="ROM_GAZ"/>
+ <property label="YM_CHx1m" name="YM_CHx1m"/>
+ <property label="YM_CHx2m" name="YM_CHx2m"/>
+ <property label="YM_CO" name="YM_CO"/>
+ <property label="YM_O2" name="YM_O2"/>
+ <property label="YM_CO2" name="YM_CO2"/>
+ <property label="YM_H2O" name="YM_H2O"/>
+ <property label="YM_N2" name="YM_N2"/>
+ <property label="XM" name="XM"/>
+ <property label="Temp_CP01" name="Temp_CP01"/>
+ <property label="Frm_CP01" name="Frm_CP01"/>
+ <property label="Rho_CP01" name="Rho_CP01"/>
+ <property label="Dia_CK01" name="Dia_CK01"/>
+ <property label="Ga_DCH01" name="Ga_DCH01"/>
+ <property label="Ga_DV101" name="Ga_DV101"/>
+ <property label="Ga_DV201" name="Ga_DV201"/>
+ <property label="Ga_HET01" name="Ga_HET01"/>
+ <property label="ntLuminance_4PI" name="ntLuminance_4PI"/>
+ <scalar label="NP_CP02" name="NP_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCH_CP02" name="XCH_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCK_CP02" name="XCK_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="ENT_CP02" name="ENT_CP02" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_CP02" name="Temp_CP02"/>
+ <property label="Frm_CP02" name="Frm_CP02"/>
+ <property label="Rho_CP02" name="Rho_CP02"/>
+ <property label="Dia_CK02" name="Dia_CK02"/>
+ <property label="Ga_DCH02" name="Ga_DCH02"/>
+ <property label="Ga_DV102" name="Ga_DV102"/>
+ <property label="Ga_DV202" name="Ga_DV202"/>
+ <property label="Ga_HET02" name="Ga_HET02"/>
+ <scalar label="NP_CP04" name="NP_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCH_CP04" name="XCH_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCK_CP04" name="XCK_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="ENT_CP04" name="ENT_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV102" name="Fr_MV102" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV202" name="Fr_MV202" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_CP04" name="Temp_CP04"/>
+ <property label="Frm_CP04" name="Frm_CP04"/>
+ <property label="Rho_CP04" name="Rho_CP04"/>
+ <property label="Dia_CK04" name="Dia_CK04"/>
+ <property label="Ga_DCH04" name="Ga_DCH04"/>
+ <property label="Ga_DV104" name="Ga_DV104"/>
+ <property label="Ga_DV204" name="Ga_DV204"/>
+ <property label="Ga_HET04" name="Ga_HET04"/>
+ </pulverized_coal>'''
+
+ assert model.node_coal == self.xmlNodeFromString(doc),\
+ "Could not delete one coal's scalars and properties"
+
+
+ def checkDeleteClassModelScalarsAndProperties(self):
+ """
+ Check whether the CoalCombustionModel class could be
+ deleted class of scalars and properties for one given coal
+ """
+ model = CoalCombustionModel(self.case)
+ model.setCoalCombustionModel('coal_homo')
+
+ from CoalThermoChemistry import CoalThermoChemistryModel, Coal
+ coalThermoChModel = CoalThermoChemistryModel("dp_FCP",self.case)
+ coalThermoChModel.getCoals().addCoal(Coal())
+ model.createCoalModelScalarsAndProperties(coalThermoChModel)
+ coalThermoChModel.getCoals().addCoal(Coal())
+ model.createCoalModelScalarsAndProperties(coalThermoChModel)
+ del CoalThermoChemistryModel
+
+ model.createClassModelScalarsAndProperties(coalThermoChModel, 2)
+ model.deleteClassModelScalars(coalThermoChModel, 2, 1)
+
+ doc = '''<pulverized_coal model="coal_homo">
+ <scalar label="Enthalpy" name="Enthalpy" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="NP_CP01" name="NP_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCH_CP01" name="XCH_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCK_CP01" name="XCK_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="ENT_CP01" name="ENT_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV101" name="Fr_MV101" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV201" name="Fr_MV201" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_HET" name="Fr_HET" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Var_AIR" name="Var_AIR" type="model"><flux_reconstruction status="off"/></scalar>
+ <property label="Temp_GAZ" name="Temp_GAZ"/>
+ <property label="ROM_GAZ" name="ROM_GAZ"/>
+ <property label="YM_CHx1m" name="YM_CHx1m"/>
+ <property label="YM_CHx2m" name="YM_CHx2m"/>
+ <property label="YM_CO" name="YM_CO"/>
+ <property label="YM_O2" name="YM_O2"/>
+ <property label="YM_CO2" name="YM_CO2"/>
+ <property label="YM_H2O" name="YM_H2O"/>
+ <property label="YM_N2" name="YM_N2"/>
+ <property label="XM" name="XM"/>
+ <property label="Temp_CP01" name="Temp_CP01"/>
+ <property label="Frm_CP01" name="Frm_CP01"/>
+ <property label="Rho_CP01" name="Rho_CP01"/>
+ <property label="Dia_CK01" name="Dia_CK01"/>
+ <property label="Ga_DCH01" name="Ga_DCH01"/>
+ <property label="Ga_DV101" name="Ga_DV101"/>
+ <property label="Ga_DV201" name="Ga_DV201"/>
+ <property label="Ga_HET01" name="Ga_HET01"/>
+ <property label="ntLuminance_4PI" name="ntLuminance_4PI"/>
+ <scalar label="Fr_MV102" name="Fr_MV102" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV202" name="Fr_MV202" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_CP03" name="Temp_CP03"/>
+ <property label="Frm_CP03" name="Frm_CP03"/>
+ <property label="Rho_CP03" name="Rho_CP03"/>
+ <property label="Dia_CK03" name="Dia_CK03"/>
+ <property label="Ga_DCH03" name="Ga_DCH03"/>
+ <property label="Ga_DV103" name="Ga_DV103"/>
+ <property label="Ga_DV203" name="Ga_DV203"/>
+ <property label="Ga_HET03" name="Ga_HET03"/>
+ <scalar label="NP_CP04" name="NP_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCH_CP04" name="XCH_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="XCK_CP04" name="XCK_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="ENT_CP04" name="ENT_CP04" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV103" name="Fr_MV103" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <scalar label="Fr_MV203" name="Fr_MV203" type="model">
+ <flux_reconstruction status="off"/>
+ </scalar>
+ <property label="Temp_CP04" name="Temp_CP04"/>
+ <property label="Frm_CP04" name="Frm_CP04"/>
+ <property label="Rho_CP04" name="Rho_CP04"/>
+ <property label="Dia_CK04" name="Dia_CK04"/>
+ <property label="Ga_DCH04" name="Ga_DCH04"/>
+ <property label="Ga_DV104" name="Ga_DV104"/>
+ <property label="Ga_DV204" name="Ga_DV204"/>
+ <property label="Ga_HET04" name="Ga_HET04"/>
+ <scalar label="NP_CP02" name="NP_CP02" type="model"/>
+ <scalar label="XCH_CP02" name="XCH_CP02" type="model"/>
+ <scalar label="XCK_CP02" name="XCK_CP02" type="model"/>
+ <scalar label="ENT_CP02" name="ENT_CP02" type="model"/>
+ <property label="Temp_CP02" name="Temp_CP02"/>
+ <property label="Frm_CP02" name="Frm_CP02"/>
+ <property label="Rho_CP02" name="Rho_CP02"/>
+ <property label="Dia_CK02" name="Dia_CK02"/>
+ <property label="Ga_DCH02" name="Ga_DCH02"/>
+ <property label="Ga_DV102" name="Ga_DV102"/>
+ <property label="Ga_DV202" name="Ga_DV202"/>
+ <property label="Ga_HET02" name="Ga_HET02"/>
+ </pulverized_coal>'''
+
+ assert model.node_coal == self.xmlNodeFromString(doc),\
+ "Could not delete one class of scalars and properties for one given coal"
+
+
+def suite():
+ testSuite = unittest.makeSuite(CoalCombustionModelTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "CoalCombustionModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/CoalCombustionView.py b/gui/Pages/CoalCombustionView.py
new file mode 100644
index 0000000..d54d2cf
--- /dev/null
+++ b/gui/Pages/CoalCombustionView.py
@@ -0,0 +1,1269 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- StandardItemModelCoals
+- StandardItemModelClasses
+- CoalCombustionView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from CoalCombustionForm import Ui_CoalCombustionForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, DoubleValidator
+
+import Pages.CoalThermoChemistry as CoalThermoChemistry
+from Pages.Boundary import Boundary
+from Pages.LocalizationModel import LocalizationModel
+from CoalCombustionModel import CoalCombustionModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("CoalCombustionView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Delegate for diameter
+#-------------------------------------------------------------------------------
+
+class DiameterDelegate(QItemDelegate):
+ def __init__(self, parent):
+ super(DiameterDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ v = DoubleValidator(editor, min=0.)
+ v.setExclusiveMin()
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if editor.validator().state == QValidator.Acceptable:
+ value, ok = editor.text().toDouble()
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Delegate for oxydant composition
+#-------------------------------------------------------------------------------
+
+class OxydantDelegate(QItemDelegate):
+ def __init__(self, parent):
+ super(OxydantDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ v = DoubleValidator(editor, min=0.)
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if editor.validator().state == QValidator.Acceptable:
+ value, ok = editor.text().toDouble()
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel for Coals
+#-------------------------------------------------------------------------------
+
+class StandardItemModelCoals(QStandardItemModel):
+ def __init__(self):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Number of coal types")]
+ self.setColumnCount(len(self.headers))
+ self.dataCoals = []
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataCoals[index.row()])
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self, label):
+ """
+ Add a row in the table.
+ """
+ self.dataCoals.append("Coal " + str(label))
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def getItem(self, row):
+ """
+ Returns the name of the mesh file.
+ """
+ return self.dataCoals[row]
+
+
+ def deleteRow(self, row):
+ """
+ Delete the row in the model
+ """
+ del self.dataCoals[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+
+ def deleteAll(self):
+ """
+ Delete all the rows in the model
+ """
+ self.dataCoals = []
+ self.setRowCount(0)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel for Coal Classes
+#-------------------------------------------------------------------------------
+
+class StandardItemModelClasses(QStandardItemModel):
+ def __init__(self, coalThermoChModel):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Number of classes"),
+ self.tr("Initial diameter")]
+ self.setColumnCount(len(self.headers))
+ self.dataClasses = []
+ self.coalNumber = None
+ self.coalThermoChModel = coalThermoChModel
+
+
+ def setCoalNumber(self, coalNumber):
+ self.coalNumber = coalNumber
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataClasses[index.row()][index.column()])
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() == 1:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ row = index.row()
+ col = index.column()
+ if col == 1:
+ newDiameter, ok = value.toDouble()
+ self.dataClasses[row][col] = newDiameter
+
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.updateInitDiameterClasses(row+1, newDiameter)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self, num, diameter):
+ """
+ Add a row in the table.
+ """
+ label = "Class " + str(num)
+ item = [label, diameter]
+ self.dataClasses.append(item)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def getItem(self, row):
+ return self.dataClasses[row]
+
+
+ def deleteRow(self, row):
+ """
+ Delete the row in the model
+ """
+ del self.dataClasses[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+
+ def deleteAll(self):
+ """
+ Delete all the rows in the model
+ """
+ self.dataClasses = []
+ self.setRowCount(0)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel for Oxydant
+#-------------------------------------------------------------------------------
+
+class StandardItemModelOxydant(QStandardItemModel):
+ def __init__(self, coalThermoChModel):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Oxydant\nnumber"),
+ self.tr(" O2 "),
+ self.tr(" N2 "),
+ self.tr(" H2O "),
+ self.tr(" CO2 ")]
+ self.setColumnCount(len(self.headers))
+ self.dataClasses = []
+ self.coalThermoChModel = coalThermoChModel
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataClasses[index.row()][index.column()])
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() != 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ row = index.row()
+ col = index.column()
+ v, ok = value.toDouble()
+ self.dataClasses[row][col] = v
+
+ oxy = self.coalThermoChModel.getOxydants().getOxydant(row+1)
+ if col == 1:
+ oxy.setO2(v)
+ elif col == 2:
+ oxy.setN2(v)
+ elif col == 3:
+ oxy.setH2O(v)
+ elif col == 4:
+ oxy.setCO2(v)
+ self.coalThermoChModel.getOxydants().updateOxydant(row+1, oxy)
+ self.coalThermoChModel.save()
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self, num, oxy):
+ """
+ Add a row in the table.
+ """
+ label = str(num)
+ item = [label, oxy.getO2(), oxy.getN2(), oxy.getH2O(),oxy.getCO2()]
+ self.dataClasses.append(item)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def getItem(self, row):
+ return self.dataClasses[row]
+
+
+ def deleteRow(self, row):
+ """
+ Delete the row in the model
+ """
+ del self.dataClasses[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+ self.coalThermoChModel.getOxydants().deleteOxydant(row+1)
+ self.coalThermoChModel.save()
+
+ def deleteAll(self):
+ """
+ Delete all the rows in the model
+ """
+ self.dataClasses = []
+ self.setRowCount(0)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class CoalCombustionView(QWidget, Ui_CoalCombustionForm):
+ """
+ """
+ def __init__(self, parent, case, stbar):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_CoalCombustionForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.stbar = stbar
+
+ self.model = CoalCombustionModel(self.case)
+ self.coalThermoChModel = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+
+ self.coalNumber = 0
+ ###
+ ### Attention voir comment creer un charbon quand il n'y a pas de fichier dp_FCP !
+ ####
+
+# self.selectedEntryNb1p1h = None
+
+ # widgets layout.
+
+ # Models
+ # ------
+ self.modelCoals = StandardItemModelCoals()
+ self.treeViewCoals.setModel(self.modelCoals)
+
+ self.modelClasses = StandardItemModelClasses(self.coalThermoChModel)
+ self.treeViewClasses.setModel(self.modelClasses)
+ self.treeViewClasses.resizeColumnToContents(0)
+ self.treeViewClasses.resizeColumnToContents(1)
+
+ self.modelOxydants = StandardItemModelOxydant(self.coalThermoChModel)
+ self.tableViewOxydants.setModel(self.modelOxydants)
+ self.tableViewOxydants.resizeColumnsToContents()
+ self.tableViewOxydants.resizeRowsToContents()
+
+ # set Coal number in modelClasses
+ coalNumber = self.treeViewCoals.currentIndex().row()
+ log.debug("coalNumber row = %i " % coalNumber)
+ self.modelClasses.setCoalNumber(coalNumber)
+
+ delegateDiameter = DiameterDelegate(self.treeViewClasses)
+ self.treeViewClasses.setItemDelegateForColumn(1, delegateDiameter)
+ delegateOxydant = OxydantDelegate(self.tableViewOxydants)
+ self.tableViewOxydants.setItemDelegate(delegateOxydant)
+
+ # Combo box
+ # ---------
+ self.modelPCI = ComboModel(self.comboBoxPCIList,2,1)
+ self.modelPCI.addItem(self.tr("on dry"), "sec")
+ self.modelPCI.addItem(self.tr("on pure"), "pur")
+
+ self.modelReactTypeO2 = ComboModel(self.comboBoxReactO2,2,1)
+ self.modelReactTypeO2.addItem(self.tr("0.5"), "0.5")
+ self.modelReactTypeO2.addItem(self.tr("1"), "1")
+
+ self.modelReactTypeCO2 = ComboModel(self.comboBoxReactCO2,2,1)
+ self.modelReactTypeCO2.addItem(self.tr("0.5"), "0.5")
+ self.modelReactTypeCO2.addItem(self.tr("1"), "1")
+
+ # Connections
+ # -----------
+ self.connect(self.treeViewCoals, SIGNAL("clicked(const QModelIndex &)"), self.slotSelectCoal)
+ self.connect(self.pushButtonAddCoal, SIGNAL("clicked()"), self.slotCreateCoal)
+ self.connect(self.pushButtonDeleteCoal, SIGNAL("clicked()"), self.slotDeleteCoal)
+ self.connect(self.pushButtonAddClass, SIGNAL("clicked()"), self.slotCreateClass)
+ self.connect(self.pushButtonDeleteClass, SIGNAL("clicked()"), self.slotDeleteClass)
+ self.connect(self.pushButtonAddOxydant, SIGNAL("clicked()"), self.slotCreateOxydant)
+ self.connect(self.pushButtonDeleteOxydant, SIGNAL("clicked()"), self.slotDeleteOxydant)
+
+ self.connect(self.lineEditC, SIGNAL("textChanged(const QString &)"), self.slotCComposition)
+ self.connect(self.lineEditH, SIGNAL("textChanged(const QString &)"), self.slotHComposition)
+ self.connect(self.lineEditO, SIGNAL("textChanged(const QString &)"), self.slotOComposition)
+ self.connect(self.lineEditPCI, SIGNAL("textChanged(const QString &)"), self.slotPCI)
+ self.connect(self.lineEditCp, SIGNAL("textChanged(const QString &)"), self.slotThermalCapacity)
+ self.connect(self.lineEditDensity, SIGNAL("textChanged(const QString &)"), self.slotDensity)
+ self.connect(self.comboBoxPCIList, SIGNAL("activated(const QString&)"), self.slotPCIType)
+
+ self.connect(self.lineEditCokeC, SIGNAL("textChanged(const QString &)"), self.slotCCompositionCoke)
+ self.connect(self.lineEditCokeH, SIGNAL("textChanged(const QString &)"), self.slotHCompositionCoke)
+ self.connect(self.lineEditCokeO, SIGNAL("textChanged(const QString &)"), self.slotOCompositionCoke)
+ self.connect(self.lineEditCokePCI, SIGNAL("textChanged(const QString &)"), self.slotPCICoke)
+
+ self.connect(self.lineEditAshesRatio, SIGNAL("textChanged(const QString &)"), self.slotAshesRatio)
+ self.connect(self.lineEditAshesEnthalpy, SIGNAL("textChanged(const QString &)"), self.slotAshesFormingEnthalpy)
+ self.connect(self.lineEditAshesCp, SIGNAL("textChanged(const QString &)"), self.slotAshesThermalCapacity)
+ self.connect(self.lineEditHumidity, SIGNAL("textChanged(const QString &)"), self.slotHumidity)
+
+ self.connect(self.lineEditCoefY1, SIGNAL("textChanged(const QString &)"), self.slotY1CH)
+ self.connect(self.lineEditCoefY2, SIGNAL("textChanged(const QString &)"), self.slotY2CH)
+ self.connect(self.lineEditCoefA1, SIGNAL("textChanged(const QString &)"), self.slotA1CH)
+ self.connect(self.lineEditCoefA2, SIGNAL("textChanged(const QString &)"), self.slotA2CH)
+ self.connect(self.lineEditCoefE1, SIGNAL("textChanged(const QString &)"), self.slotE1CH)
+ self.connect(self.lineEditCoefE2, SIGNAL("textChanged(const QString &)"), self.slotE2CH)
+ self.connect(self.checkBoxY1, SIGNAL("clicked()"), self.slotIY1)
+ self.connect(self.checkBoxY2, SIGNAL("clicked()"), self.slotIY2)
+
+ self.connect(self.lineEditConstO2, SIGNAL("textChanged(const QString &)"), self.slotPreExpoCstO2)
+ self.connect(self.lineEditEnergyO2, SIGNAL("textChanged(const QString &)"), self.slotActivEnergyO2)
+ self.connect(self.comboBoxReactO2, SIGNAL("activated(const QString&)"), self.slotReactTypeO2)
+ self.connect(self.lineEditConstCO2, SIGNAL("textChanged(const QString &)"), self.slotPreExpoCstCO2)
+ self.connect(self.lineEditEnergyCO2, SIGNAL("textChanged(const QString &)"), self.slotActivEnergyCO2)
+ self.connect(self.comboBoxReactCO2, SIGNAL("activated(const QString&)"), self.slotReactTypeCO2)
+
+ # Validators
+ # ----------
+ validatorC = DoubleValidator(self.lineEditC, min=0., max=100.)
+ validatorH = DoubleValidator(self.lineEditH, min=0., max=100.)
+ validatorO = DoubleValidator(self.lineEditO, min=0., max=100.)
+ validatorPCI = DoubleValidator(self.lineEditPCI, min=0.)
+ validatorCp = DoubleValidator(self.lineEditCp, min=0.)
+ validatorDensity = DoubleValidator(self.lineEditDensity, min=0.)
+ validatorHumidity = DoubleValidator(self.lineEditHumidity, min=0., max=100.)
+
+ validatorCCoke = DoubleValidator(self.lineEditCokeC, min=0., max=100.)
+ validatorHCoke = DoubleValidator(self.lineEditCokeH, min=0., max=100.)
+ validatorOCoke = DoubleValidator(self.lineEditCokeO, min=0., max=100.)
+ validatorPCICoke = DoubleValidator(self.lineEditCokePCI, min=0.)
+
+ validatorAshesRatio = DoubleValidator(self.lineEditAshesRatio, min=0., max=100.)
+ validatorAshesEnthalpy = DoubleValidator(self.lineEditAshesEnthalpy, min=0.)
+ validatorAshesCp = DoubleValidator(self.lineEditAshesCp, min=0.)
+
+ validatorY1 = DoubleValidator(self.lineEditCoefY1, min=0.)
+ validatorY2 = DoubleValidator(self.lineEditCoefY2, min=0.)
+ validatorA1 = DoubleValidator(self.lineEditCoefA1, min=0.)
+ validatorA2 = DoubleValidator(self.lineEditCoefA2, min=0.)
+ validatorE1 = DoubleValidator(self.lineEditCoefE1, min=0.)
+ validatorE2 = DoubleValidator(self.lineEditCoefE2, min=0.)
+
+ validatorConstO2 = DoubleValidator(self.lineEditConstO2, min=0.)
+ validatorEnergyO2 = DoubleValidator(self.lineEditEnergyO2, min=0.)
+ validatorConstCO2 = DoubleValidator(self.lineEditConstCO2, min=0.)
+ validatorEnergyCO2 = DoubleValidator(self.lineEditEnergyCO2, min=0.)
+
+ self.lineEditC.setValidator(validatorC)
+ self.lineEditH.setValidator(validatorH)
+ self.lineEditO.setValidator(validatorO)
+ self.lineEditPCI.setValidator(validatorPCI)
+ self.lineEditCp.setValidator(validatorCp)
+ self.lineEditDensity.setValidator(validatorDensity)
+
+ self.lineEditCokeC.setValidator(validatorCCoke)
+ self.lineEditCokeH.setValidator(validatorHCoke)
+ self.lineEditCokeO.setValidator(validatorOCoke)
+ self.lineEditCokePCI.setValidator(validatorPCICoke)
+
+ self.lineEditAshesRatio.setValidator(validatorAshesRatio)
+ self.lineEditAshesEnthalpy.setValidator(validatorAshesEnthalpy)
+ self.lineEditAshesCp.setValidator(validatorAshesCp)
+ self.lineEditHumidity.setValidator(validatorHumidity)
+
+ self.lineEditCoefY1.setValidator(validatorY1)
+ self.lineEditCoefY2.setValidator(validatorY2)
+ self.lineEditCoefA1.setValidator(validatorA1)
+ self.lineEditCoefA2.setValidator(validatorA2)
+ self.lineEditCoefE1.setValidator(validatorE1)
+ self.lineEditCoefE2.setValidator(validatorE2)
+
+ self.lineEditConstO2.setValidator(validatorConstO2)
+ self.lineEditEnergyO2.setValidator(validatorEnergyO2)
+ self.lineEditConstCO2.setValidator(validatorConstCO2)
+ self.lineEditEnergyCO2.setValidator(validatorEnergyCO2)
+
+ # Initialize widgets
+
+ coals = self.coalThermoChModel.getCoals()
+ CoalsNumber = coals.getNumber()
+ for coalNumber in range(0, CoalsNumber):
+ self.modelCoals.addItem(coalNumber + 1)
+
+ if coals.getNumber() >= 3:
+ self.pushButtonAddCoal.setDisabled(True)
+ if coals.getNumber() <= 1:
+ self.pushButtonDeleteCoal.setDisabled(True)
+
+ self.slotSelectCoal()
+
+ if self.model.getCoalCombustionModel() == 'coal_homo':
+ self.lineEditHumidity.setText(QString(str(0.)))
+ self.labelHumidity.setDisabled(True)
+ self.lineEditHumidity.setDisabled(True)
+ self.labelUnitHumidity.setDisabled(True)
+
+ num = self.coalThermoChModel.getOxydants().getNumber()
+ for index in range(0, num):
+ oxy = self.coalThermoChModel.getOxydants().getOxydant(index+1)
+ self.modelOxydants.addItem(index+1, oxy)
+
+ # Update buttons
+ self.pushButtonAddOxydant.setEnabled(True)
+ self.pushButtonDeleteOxydant.setEnabled(True)
+ if num <= 1:
+ self.pushButtonDeleteOxydant.setDisabled(True)
+ if num >= 3:
+ self.pushButtonAddOxydant.setDisabled(True)
+
+
+ @pyqtSignature("const QModelIndex &")
+ def slotSelectCoal(self, text=None):
+ """
+ Display values for the current coal selected in the view.
+ """
+ #self.treeViewCoals.setCurrentIndex(index)
+ row = self.treeViewCoals.currentIndex().row()
+ log.debug("selectCoal row = %i "%row)
+ if row == -1:
+ row = 0
+
+ coals = self.coalThermoChModel.getCoals()
+ number = row + 1
+ self.coalNumber = int(number)
+ coal = coals.getCoal(self.coalNumber)
+
+ # set Coal number in modelClasses
+ self.modelClasses.setCoalNumber(self.coalNumber)
+
+ # Classes
+ ClassesNumber = coal.getClassesNumber()
+ initDiameters = coal.getInitDiameterClasses()
+
+ self.modelClasses.deleteAll()
+ for number in range(0, ClassesNumber):
+ self.modelClasses.addItem(number + 1, initDiameters[number])
+# self.coalThermoChModel.save()
+
+ log.debug("selectCoal getClassesNumber = %i " % coal.getClassesNumber())
+ self.pushButtonDeleteClass.setDisabled(False)
+ if coal.getClassesNumber() >= 10:
+ self.pushButtonAddClass.setDisabled(True)
+ if coal.getClassesNumber() <= 1:
+ self.pushButtonDeleteClass.setDisabled(True)
+
+ # General (composition)
+ self.lineEditC.setText(QString(str(coal.getCDryComposition())))
+ self.lineEditH.setText(QString(str(coal.getHDryComposition())))
+ self.lineEditO.setText(QString(str(coal.getODryComposition())))
+ self.lineEditPCI.setText(QString(str(coal.getPCIValue())))
+ self.lineEditCp.setText(QString(str(coal.getThermalCapacity())))
+ self.lineEditDensity.setText(QString(str(coal.getDensity())))
+ self.lineEditHumidity.setText(QString(str(coal.getHumidity())))
+ dry = coal.getDry()
+ if dry == 0:
+ key = "pur"
+ elif dry == 1:
+ key = "sec"
+ self.modelPCI.setItem(str_model=key)
+
+ # Coke
+ self.lineEditCokeC.setText(QString(str(coal.getCDryCompositionCoke())))
+ self.lineEditCokeH.setText(QString(str(coal.getHDryCompositionCoke())))
+ self.lineEditCokeO.setText(QString(str(coal.getODryCompositionCoke())))
+ self.lineEditCokePCI.setText(QString(str(coal.getPCICokeValue())))
+
+ # Ashes
+ self.lineEditAshesRatio.setText(QString(str(coal.getAshesRatio())))
+ self.lineEditAshesEnthalpy.setText(QString(str(coal.getAshesFormingEnthalpy())))
+ self.lineEditAshesCp.setText(QString(str(coal.getAshesThermalCapacity())))
+
+ # Devolatilisation
+ stat = self.coalThermoChModel.getCoals().getCoal(self.coalNumber).getIY1CH()
+ if stat == 0 :
+ bstat = "on"
+ self.checkBoxY1.setChecked(True)
+ else:
+ bstat = "off"
+ self.checkBoxY1.setChecked(False)
+ self.ActiveWidgetIY1(bstat)
+
+ self.lineEditCoefY1.setText(QString(str(coal.getY1CH())))
+
+ stat = self.coalThermoChModel.getCoals().getCoal(self.coalNumber).getIY2CH()
+ if stat == 0 :
+ bstat = "on"
+ self.checkBoxY2.setChecked(True)
+ else:
+ bstat = "off"
+ self.checkBoxY2.setChecked(False)
+ self.ActiveWidgetIY2(bstat)
+
+ self.lineEditCoefY2.setText(QString(str(coal.getY2CH())))
+
+ self.lineEditCoefA1.setText(QString(str(coal.getA1CH())))
+ self.lineEditCoefA2.setText(QString(str(coal.getA2CH())))
+ self.lineEditCoefE1.setText(QString(str(coal.getE1CH())))
+ self.lineEditCoefE2.setText(QString(str(coal.getE2CH())))
+
+ # Combustion heterogene
+ self.lineEditConstO2.setText(QString(str(coal.getAHETCH_O2())))
+ self.lineEditEnergyO2.setText(QString(str(coal.getEHETCH_O2())))
+ self.lineEditConstCO2.setText(QString(str(coal.getAHETCH_CO2())))
+ self.lineEditEnergyCO2.setText(QString(str(coal.getEHETCH_CO2())))
+
+ if coal.getIOCHET_O2() == 0:
+ key = "0.5"
+ else:
+ key = "1"
+ self.modelReactTypeO2.setItem(str_model=key)
+
+ if coal.getIOCHET_CO2() == 0:
+ key = "0.5"
+ else:
+ key = "1"
+ self.modelReactTypeCO2.setItem(str_model=key)
+
+
+ @pyqtSignature("")
+ def slotCreateCoal(self):
+ """ create a new coal"""
+ diameter = self.model.defaultValues()['diameter']
+
+ # update model
+ coal = CoalThermoChemistry.Coal()
+ self.coalThermoChModel.getCoals().addCoal(coal)
+ CoalsNumber = self.coalThermoChModel.getCoals().getNumber()
+ coal = self.coalThermoChModel.getCoals().getCoal(CoalsNumber)
+ coal.updateInitDiameterClasses(1, diameter)
+
+ # Init
+ self.modelCoals.deleteAll()
+# CoalsNumber = self.coalThermoChModel.getCoals().getNumber()
+ for number in range(0, CoalsNumber):
+ self.modelCoals.addItem(number + 1)
+ log.debug("slotCreateCoal number + 1 = %i " % (number + 1))
+ self.coalThermoChModel.save()
+
+ # update Properties and scalars
+ self.model.createCoalModelScalarsAndProperties(self.coalThermoChModel)
+
+ # update Buttons
+ if self.coalThermoChModel.getCoals().getNumber() >= 3:
+ self.pushButtonAddCoal.setDisabled(True)
+ self.pushButtonDeleteCoal.setEnabled(True)
+
+ # Coal created is selected
+ self.slotSelectCoal()
+
+
+ @pyqtSignature("")
+ def slotDeleteCoal(self):
+ """ cancel a coal"""
+ row = self.treeViewCoals.currentIndex().row()
+ log.debug("slotDeleteCoal row = %i "%row)
+
+ if row == -1:
+ return
+
+ number = row + 1
+
+ # update Scalars and properties
+ self.model.deleteCoalModelScalarsAndProperties(self.coalThermoChModel, number - 1)
+
+ # update boundary conditions (1/2)
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ label = zone.getLabel()
+ nature = zone.getNature()
+ if nature == "inlet":
+ bc = Boundary("coal_inlet", label, self.case)
+ bc.deleteCoalFlow(number-1, self.coalThermoChModel.getCoals().getNumber())
+
+ self.coalThermoChModel.getCoals().deleteCoal(number)
+
+ # Init
+ self.modelCoals.deleteAll()
+ CoalsNumber = self.coalThermoChModel.getCoals().getNumber()
+ for number in range(0, CoalsNumber):
+ self.modelCoals.addItem(number + 1)
+ log.debug("slotDeleteCoal number + 1 = %i " % (number + 1))
+ self.coalThermoChModel.save()
+
+ # Update buttons
+ self.pushButtonAddCoal.setEnabled(True)
+ if self.coalThermoChModel.getCoals().getNumber() <= 1:
+ self.pushButtonDeleteCoal.setDisabled(True)
+ else:
+ self.pushButtonDeleteCoal.setEnabled(True)
+
+ # First coal is selected
+ self.slotSelectCoal()
+
+
+ @pyqtSignature("")
+ def slotCreateClass(self):
+ """Create a new class"""
+ diameter = self.model.defaultValues()['diameter']
+
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.addInitDiameterClasses(diameter)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+
+ # Init
+ ClassesNumber = coal.getClassesNumber()
+ initDiameters = coal.getInitDiameterClasses()
+ self.modelClasses.addItem(ClassesNumber, initDiameters[ClassesNumber -1])
+ log.debug("slotCreateClass number + 1 = %i " % (ClassesNumber))
+ self.coalThermoChModel.save()
+ self.model.createClassModelScalarsAndProperties(self.coalThermoChModel, self.coalNumber)
+
+ # FIXME: bug ici
+ # Update boundary conditions
+ log.debug("slotCreateClass: number of classes: %i " % coal.getClassesNumber())
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ if zone.getNature() == "inlet":
+ b = Boundary("coal_inlet", zone.getLabel(), self.case)
+ #b.getCoalRatios(self.coalNumber-1)
+ b.updateCoalRatios(self.coalNumber-1)
+
+ # Update buttons
+ self.pushButtonDeleteClass.setEnabled(True)
+ if self.coalThermoChModel.getCoals().getCoal(self.coalNumber).getClassesNumber() >= 10:
+ self.pushButtonAddClass.setDisabled(True)
+
+
+ @pyqtSignature("")
+ def slotDeleteClass(self):
+ """ cancel a class diameter"""
+ row = self.treeViewClasses.currentIndex().row()
+ log.debug("slotDeleteClass number = %i " % row)
+ if row == -1:
+ return
+
+ number = row + 1
+
+ self.model.deleteClassModelProperties(self.coalThermoChModel, self.coalNumber, number - 1)
+ self.model.deleteClassModelScalars(self.coalThermoChModel, self.coalNumber, number - 1)
+
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.cancelInitDiameterClasses(number)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+ # Init
+ self.modelClasses.deleteAll()
+ ClassesNumber = coal.getClassesNumber()
+ initDiameters = coal.getInitDiameterClasses()
+ for number in range(0, ClassesNumber):
+ self.modelClasses.addItem(number+1, initDiameters[number])
+ log.debug("slotDeleteClass number + 1 = %i " % (number+1))
+
+ # Update boundary conditions
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ if zone.getNature() == "inlet":
+ bc = Boundary("coal_inlet", zone.getLabel(), self.case)
+ bc.updateCoalRatios(self.coalNumber-1)
+
+ # Update buttons
+ self.pushButtonAddClass.setEnabled(True)
+ if self.coalThermoChModel.getCoals().getCoal(self.coalNumber).getClassesNumber() <= 1:
+ self.pushButtonDeleteClass.setDisabled(True)
+
+
+ @pyqtSignature("")
+ def slotCreateOxydant(self):
+ """Create a new oxydant"""
+ new_ox = CoalThermoChemistry.Oxydant()
+ self.coalThermoChModel.getOxydants().addOxydant(new_ox)
+ num = self.coalThermoChModel.getOxydants().getNumber()
+
+ self.modelOxydants.addItem(num, new_ox)
+ log.debug("slotCreateOxydant number = %i " % num)
+ self.coalThermoChModel.save()
+ #self.model.createOxydantModelScalarsAndProperties(self.coalThermoChModel, num)
+
+ # Update buttons
+ self.pushButtonDeleteOxydant.setEnabled(True)
+ if self.coalThermoChModel.getOxydants().getNumber() >= 3:
+ self.pushButtonAddOxydant.setDisabled(True)
+
+
+ @pyqtSignature("")
+ def slotDeleteOxydant(self):
+ """ delete an oxydant"""
+ row = self.tableViewOxydants.currentIndex().row()
+ log.debug("slotDeleteOxydants number = %i " % row)
+ if row == -1:
+ return
+
+ number = row + 1
+ self.coalThermoChModel.getOxydants().deleteOxydant(number)
+ self.coalThermoChModel.save()
+
+ # Update boundary conditions
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ label = zone.getLabel()
+ nature = zone.getNature()
+ if nature == "inlet":
+ bc = Boundary("coal_inlet", label, self.case)
+ oxy_max = bc.getOxydantNumber()
+ if oxy_max >= number:
+ bc.setOxydantNumber(oxy_max-1)
+
+ self.modelOxydants.deleteAll()
+ for number in range(0, self.coalThermoChModel.getOxydants().getNumber()):
+ oxy = self.coalThermoChModel.getOxydants().getOxydant(number+1)
+ self.modelOxydants.addItem(number+1, oxy)
+
+ # Update buttons
+ self.pushButtonAddOxydant.setEnabled(True)
+ if self.coalThermoChModel.getOxydants().getNumber() <= 1:
+ self.pushButtonDeleteOxydant.setDisabled(True)
+
+
+ @pyqtSignature("const QString&")
+ def slotCComposition(self, text):
+ composition, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setCDryComposition(composition)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotHComposition(self, text):
+ composition, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setHDryComposition(composition)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotOComposition(self, text):
+ composition, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setODryComposition(composition)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotPCI(self, text):
+ PCI, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setPCIValue(PCI)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotThermalCapacity(self, text):
+ Cp, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setThermalCapacity(Cp)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotDensity(self, text):
+ density, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setDensity(density)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotHumidity(self, text):
+ humidity, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setHumidity(humidity)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotPCIType(self, text):
+ """
+ Return the selected type of boundary condition. Whatever the
+ language (i18n), type is always in ('wall','inlet','outlet','symmetry').
+ """
+ key = self.modelPCI.dicoV2M[str(text)]
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ if key == "sec" :
+ coal.setDry(1)
+ elif key == "pur":
+ coal.setDry(0)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ return key
+
+
+ @pyqtSignature("const QString&")
+ def slotCCompositionCoke(self, text):
+ composition, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setCDryCompositionCoke(composition)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotHCompositionCoke(self, text):
+ composition, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setHDryCompositionCoke(composition)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotOCompositionCoke(self, text):
+ composition, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setODryCompositionCoke(composition)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotPCICoke(self, text):
+ PCICoke, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setPCICokeValue(PCICoke)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotAshesRatio(self, text):
+ ashesRatio, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setAshesRatio(ashesRatio)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ else:
+ msg = self.tr("This value must be between 0 and 100.")
+ self.stbar.showMessage(msg, 2000)
+
+
+ @pyqtSignature("const QString&")
+ def slotAshesFormingEnthalpy(self, text):
+ ashesFormingEnthalpy, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setAshesFormingEnthalpy(ashesFormingEnthalpy)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotAshesThermalCapacity(self, text):
+ ashesThermalCapacity, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setAshesThermalCapacity(ashesThermalCapacity)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotY1CH(self, text):
+ Y1CH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setY1CH(Y1CH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotY2CH(self, text):
+ Y2CH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setY2CH(Y2CH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotA1CH(self, text):
+ A1CH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setA1CH(A1CH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotA2CH(self, text):
+ A2CH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setA2CH(A2CH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotE1CH(self, text):
+ E1CH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setE1CH(E1CH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotE2CH(self, text):
+ E2CH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setE2CH(E2CH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("")
+ def slotIY1(self):
+ if self.checkBoxY1.isChecked():
+ stat = "on"
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setIY1CH(0)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ else :
+ stat = "off"
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setIY1CH(1)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ self.ActiveWidgetIY1(stat)
+
+
+ @pyqtSignature("")
+ def slotIY2(self):
+ if self.checkBoxY2.isChecked():
+ stat = "on"
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setIY2CH(0)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ else :
+ stat = "off"
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setIY2CH(1)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ self.ActiveWidgetIY2(stat)
+
+
+ def ActiveWidgetIY1(self, stat) :
+ if stat == 'on':
+ self.labelCoefY1.setDisabled(True)
+ self.lineEditCoefY1.setDisabled(True)
+ else :
+ self.labelCoefY1.setEnabled(True)
+ self.lineEditCoefY1.setEnabled(True)
+
+
+ def ActiveWidgetIY2(self, stat) :
+ if stat == 'on':
+ self.labelCoefY2.setDisabled(True)
+ self.lineEditCoefY2.setDisabled(True)
+ else :
+ self.labelCoefY2.setEnabled(True)
+ self.lineEditCoefY2.setEnabled(True)
+
+
+ @pyqtSignature("const QString&")
+ def slotPreExpoCstO2(self, text):
+ AHETCH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setAHETCH_O2(AHETCH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotActivEnergyO2(self, text):
+ EHETCH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setEHETCH_O2(EHETCH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotReactTypeO2(self, text):
+ key = self.modelReactTypeO2.dicoV2M[str(text)]
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ if key == "0.5" :
+ coal.setIOCHET_O2(0)
+ else:
+ coal.setIOCHET_O2(1)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ return key
+
+
+ @pyqtSignature("const QString&")
+ def slotPreExpoCstCO2(self, text):
+ AHETCH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setAHETCH_CO2(AHETCH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotActivEnergyCO2(self, text):
+ EHETCH, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ coal.setEHETCH_CO2(EHETCH)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+
+
+ @pyqtSignature("const QString&")
+ def slotReactTypeCO2(self, text):
+ key = self.modelReactTypeCO2.dicoV2M[str(text)]
+ coal = self.coalThermoChModel.getCoals().getCoal(self.coalNumber)
+ if key == "0.5" :
+ coal.setIOCHET_CO2(0)
+ else:
+ coal.setIOCHET_CO2(1)
+ self.coalThermoChModel.getCoals().updateCoal(self.coalNumber, coal)
+ self.coalThermoChModel.save()
+ return key
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/CoalThermoChemistry.py b/gui/Pages/CoalThermoChemistry.py
new file mode 100644
index 0000000..a09df43
--- /dev/null
+++ b/gui/Pages/CoalThermoChemistry.py
@@ -0,0 +1,1702 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+import os, re, sys
+import string
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.XMLvariables import Model
+import Pages.CommonCombustion as CommonCombustion
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class Coal(Model):
+ def __init__(self):
+ self.classesNumber = 1
+ self.initDiameterClasses = [0.]
+ self.CDryComposition = 0
+ self.HDryComposition = 0
+ self.ODryComposition = 0
+ self.Dry = 0
+ self.PCIValue = 0
+ self.thermalCapacity = 0
+ self.density = 0
+ self.CDryCompositionCoke = 0
+ self.HDryCompositionCoke = 0
+ self.ODryCompositionCoke = 0
+ self.PCICokeValue = 0
+ self.ashesRatio = 0
+ self.ashesFormingEnthalpy = 0
+ self.ashesThermalCapacity = 0
+ self.humidity = 0
+ self.IY1CH = 0
+ self.Y1CH = 0
+ self.IY2CH = 0
+ self.Y2CH = 0
+ self.A1CH = 0
+ self.A2CH = 0
+ self.E1CH = 0
+ self.E2CH = 0
+ self.AHETCH_O2 = 0
+ self.EHETCH_O2 = 0
+ self.IOCHET_O2 = 0
+ self.AHETCH_CO2 = 0
+ self.EHETCH_CO2 = 0
+ self.IOCHET_CO2 = 0
+
+
+ def setClassesNumber(self, value):
+ self.classesNumber = value
+
+
+ def setInitDiameterClasses(self, value):
+ self.initDiameterClasses = value
+
+
+ def addInitDiameterClasses(self, value):
+ self.initDiameterClasses.append(value)
+ self.classesNumber += 1
+ self.isLowerOrEqual(self.classesNumber, 10)
+
+
+ def updateInitDiameterClasses(self, number, value):
+ self.initDiameterClasses[number-1] = value
+
+
+ def cancelInitDiameterClasses(self, number):
+ self.classesNumber -= 1
+ self.initDiameterClasses.pop(number-1)
+
+
+ def setCDryComposition(self, value):
+ self.CDryComposition = value
+
+
+ def setODryComposition(self, value):
+ self.ODryComposition = value
+
+
+ def setHDryComposition(self, value):
+ self.HDryComposition = value
+
+
+ def setDry(self, value):
+ self.Dry = value
+
+
+ def setPCIValue(self, value):
+ self.PCIValue = value
+
+
+ def setThermalCapacity(self, value):
+ self.thermalCapacity = value
+
+
+ def setDensity(self, value):
+ self.density = value
+
+
+ def setCDryCompositionCoke(self, value):
+ self.CDryCompositionCoke = value
+
+
+ def setHDryCompositionCoke(self, value):
+ self.HDryCompositionCoke = value
+
+
+ def setODryCompositionCoke(self, value):
+ self.ODryCompositionCoke = value
+
+
+ def setPCICokeValue(self, value):
+ self.PCICokeValue = value
+
+
+ def setAshesRatio(self, value):
+ self.ashesRatio = value
+
+
+ def setAshesFormingEnthalpy(self, value):
+ self.ashesFormingEnthalpy = value
+
+
+ def setAshesThermalCapacity(self, value):
+ self.ashesThermalCapacity = value
+
+
+ def setHumidity(self, value):
+ self.humidity = value
+
+
+ def setIY1CH(self, value):
+ self.IY1CH = value
+
+
+ def setY1CH(self, value):
+ self.Y1CH = value
+
+
+ def setIY2CH(self, value):
+ self.IY2CH = value
+
+
+ def setY2CH(self, value):
+ self.Y2CH = value
+
+
+ def setA1CH(self, value):
+ self.A1CH = value
+
+
+ def setA2CH(self, value):
+ self.A2CH = value
+
+
+ def setE1CH(self, value):
+ self.E1CH = value
+
+
+ def setE2CH(self, value):
+ self.E2CH = value
+
+
+ def setAHETCH_O2(self, value):
+ self.AHETCH_O2 = value
+
+
+ def setEHETCH_O2(self, value):
+ self.EHETCH_O2 = value
+
+
+ def setIOCHET_O2(self, value):
+ self.IOCHET_O2 = value
+
+
+ def setAHETCH_CO2(self, value):
+ self.AHETCH_CO2 = value
+
+
+ def setEHETCH_CO2(self, value):
+ self.EHETCH_CO2 = value
+
+
+ def setIOCHET_CO2(self, value):
+ self.IOCHET_CO2 = value
+
+
+ def getClassesNumber(self):
+ return self.classesNumber
+
+
+ def getInitDiameterClasses(self):
+ return self.initDiameterClasses
+
+
+ def getCDryComposition(self):
+ return self.CDryComposition
+
+
+ def getODryComposition(self):
+ return self.ODryComposition
+
+
+ def getHDryComposition(self):
+ return self.HDryComposition
+
+
+ def getDry(self):
+ return self.Dry
+
+
+ def getPCIValue(self):
+ return self.PCIValue
+
+
+ def getThermalCapacity(self):
+ return self.thermalCapacity
+
+
+ def getDensity(self):
+ return self.density
+
+
+ def getHumidity(self):
+ return self.humidity
+
+
+ def getCDryCompositionCoke(self):
+ return self.CDryCompositionCoke
+
+
+ def getHDryCompositionCoke(self):
+ return self.HDryCompositionCoke
+
+
+ def getODryCompositionCoke(self):
+ return self.ODryCompositionCoke
+
+
+ def getPCICokeValue(self):
+ return self.PCICokeValue
+
+
+ def getAshesRatio(self):
+ return self.ashesRatio
+
+
+ def getAshesFormingEnthalpy(self):
+ return self.ashesFormingEnthalpy
+
+
+ def getAshesThermalCapacity(self):
+ return self.ashesThermalCapacity
+
+
+ def getIY1CH(self):
+ return self.IY1CH
+
+
+ def getY1CH(self):
+ return self.Y1CH
+
+
+ def getIY2CH(self):
+ return self.IY2CH
+
+
+ def getY2CH(self):
+ return self.Y2CH
+
+
+ def getA1CH(self):
+ return self.A1CH
+
+
+ def getA2CH(self):
+ return self.A2CH
+
+
+ def getE1CH(self):
+ return self.E1CH
+
+
+ def getE2CH(self):
+ return self.E2CH
+
+
+ def getAHETCH_O2(self):
+ return self.AHETCH_O2
+
+
+ def getEHETCH_O2(self):
+ return self.EHETCH_O2
+
+
+ def getIOCHET_O2(self):
+ return self.IOCHET_O2
+
+
+ def getAHETCH_CO2(self):
+ return self.AHETCH_CO2
+
+
+ def getEHETCH_CO2(self):
+ return self.EHETCH_CO2
+
+
+ def getIOCHET_CO2(self):
+ return self.IOCHET_CO2
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class Coals(Model):
+
+ def __init__(self):
+ """ constructor """
+ #
+ # "CARACTERISTIQUES CHARBON" part
+ self.Comment = {}
+ self.coalNumber = 0
+ self.Comment["coalNumber"] = "Nb de charbons"
+ self.classesNumberList = []
+ self.Comment["classesNumberList"] = "Nb de classes"
+ self.initDiameterClassesList = []
+ self.Comment["initDiameterClassesList"] = "Diametre initial de la classe (m)"
+ self.CDryCompositionList = []
+ self.Comment["CDryCompositionList"] = "Composition C (%) sur sec"
+ self.HDryCompositionList = []
+ self.Comment["HDryCompositionList"] = "Composition H (%) sur sec"
+ self.ODryCompositionList = []
+ self.Comment["ODryCompositionList"] = "Composition O (%) sur sec"
+ self.DryList = []
+ self.Comment["DryList"] = "PCI (J/kg) sur pur (0) sur sec 1"
+ self.PCIValueList = []
+ self.thermalCapacityList = []
+ self.Comment["thermalCapacityList"] = "CP moyen du charbon (J/kg/K)"
+ self.densityList = []
+ self.Comment["densityList"] = "Masse volumique (kg/m3)"
+ self.humidityList = []
+ self.Comment["humidityList"] = "Humidite du charbon(%)"
+ self.CDryCompositionCokeList = []
+ self.Comment["CDryCompositionCokeList"] = "Composition C (%) sur sec"
+ self.HDryCompositionCokeList = []
+ self.Comment["HDryCompositionCokeList"] = "Composition H (%) sur sec"
+ self.ODryCompositionCokeList = []
+ self.Comment["ODryCompositionCokeList"] = "Composition O (%) sur sec"
+ self.PCICokeValueList = []
+ self.Comment["PCICokeValueList"] = "PCI sur sec (J/kg)"
+ self.ashesRatioList = []
+ self.Comment["ashesRatioList"] = "Taux de cendres en masse (%)"
+ self.ashesFormingEnthalpyList = []
+ self.Comment["ashesFormingEnthalpyList"]= "Enthalpie de formation des cendres (J/kg)"
+ self.ashesThermalCapacityList = []
+ self.Comment["ashesThermalCapacityList"]= "CP des cendres (J/kg/K)"
+ #
+ # "DEVOLATILISATION" part
+ self.IY1CHList = []
+ self.Comment["Y1CHList"] = "Coef. stoe. (adim) Y1 si = 0 calcul automatique"
+ self.Y1CHList = []
+ self.Comment["Y2CHList"] = "Coef. stoe. (adim) Y2 si = 0 calcul automatique"
+ self.IY2CHList = []
+ self.Y2CHList = []
+ self.A1CHList = []
+ self.Comment["A1CHList"] = "Facteur pre-exponentielle A1 (s-1)"
+ self.A2CHList = []
+ self.Comment["A2CHList"] = "Facteur pre-exponentielle A2 (s-1)"
+ self.E1CHList = []
+ self.Comment["E1CHList"] = "Energie d'activation E1 (J/mol)"
+ self.E2CHList = []
+ self.Comment["E2CHList"] = "Energie d'activation E2 (J/mol)"
+ #
+ # "COMBUSTION HETEROGENE" part
+ self.AHETCH_O2List = []
+ self.Comment["AHETCH_O2List"] = "Constante pre-exponentielle (kg/m2/s/atm)"
+ self.EHETCH_O2List = []
+ self.Comment["EHETCH_O2List"] = "Energie d'activation (kcal/mol)"
+ self.IOCHET_O2List = []
+ self.Comment["IOCHET_O2List"] = "Ordre de la reaction 0.5 si = 0 1 si = 1"
+ self.AHETCH_CO2List = []
+ self.Comment["AHETCH_CO2List"] = "Constante pre-exponentielle (kg/m2/s/atm)"
+ self.EHETCH_CO2List = []
+ self.Comment["EHETCH_CO2List"] = "Energie d'activation (kcal/mol)"
+ self.IOCHET_CO2List = []
+ self.Comment["IOCHET_CO2List"] = "Ordre de la reaction 0.5 si = 0 1 si = 1"
+
+
+ def getNumber(self):
+ return self.coalNumber
+
+
+ #
+ # "CARACTERISTIQUES CHARBON" part
+
+ def deleteCoal(self, number):
+ self.coalNumber -= 1
+ nb = number - 1
+ self.classesNumberList.pop(nb)
+ self.initDiameterClassesList.pop(nb)
+ self.CDryCompositionList.pop(nb)
+ self.HDryCompositionList.pop(nb)
+ self.ODryCompositionList.pop(nb)
+ self.DryList.pop(nb)
+ self.PCIValueList.pop(nb)
+ self.thermalCapacityList.pop(nb)
+ self.densityList.pop(nb)
+ self.humidityList.pop(nb)
+ self.CDryCompositionCokeList.pop(nb)
+ self.HDryCompositionCokeList.pop(nb)
+ self.ODryCompositionCokeList.pop(nb)
+ self.PCICokeValueList.pop(nb)
+ self.ashesRatioList.pop(nb)
+ self.ashesFormingEnthalpyList.pop(nb)
+ self.ashesThermalCapacityList.pop(nb)
+ self.IY1CHList.pop(nb)
+ self.Y1CHList.pop(nb)
+ self.IY2CHList.pop(nb)
+ self.Y2CHList.pop(nb)
+ self.A1CHList.pop(nb)
+ self.A2CHList.pop(nb)
+ self.E1CHList.pop(nb)
+ self.E2CHList.pop(nb)
+ self.AHETCH_O2List.pop(nb)
+ self.EHETCH_O2List.pop(nb)
+ self.IOCHET_O2List.pop(nb)
+ self.AHETCH_CO2List.pop(nb)
+ self.EHETCH_CO2List.pop(nb)
+ self.IOCHET_CO2List.pop(nb)
+
+
+ def addCoal(self, coal):
+ self.coalNumber += 1
+ self.isLowerOrEqual(self.coalNumber, 3)
+ self.classesNumberList.append(coal.getClassesNumber())
+ self.initDiameterClassesList.append(coal.getInitDiameterClasses())
+ self.CDryCompositionList.append(coal.getCDryComposition())
+ self.HDryCompositionList.append(coal.getHDryComposition())
+ self.ODryCompositionList.append(coal.getODryComposition())
+ self.DryList.append(coal.getDry())
+ self.PCIValueList.append(coal.getPCIValue())
+ self.thermalCapacityList.append(coal.getThermalCapacity())
+ self.densityList.append(coal.getDensity())
+ self.humidityList.append(coal.getHumidity())
+ self.CDryCompositionCokeList.append(coal.getCDryCompositionCoke())
+ self.HDryCompositionCokeList.append(coal.getHDryCompositionCoke())
+ self.ODryCompositionCokeList.append(coal.getODryCompositionCoke())
+ self.PCICokeValueList.append(coal.getPCICokeValue())
+ self.ashesRatioList.append(coal.getAshesRatio())
+ self.ashesFormingEnthalpyList.append(coal.getAshesFormingEnthalpy())
+ self.ashesThermalCapacityList.append(coal.getAshesThermalCapacity())
+ self.IY1CHList.append(coal.getIY1CH())
+ self.Y1CHList.append(coal.getY1CH())
+ self.IY2CHList.append(coal.getIY2CH())
+ self.Y2CHList.append(coal.getY2CH())
+ self.A1CHList.append(coal.getA1CH())
+ self.A2CHList.append(coal.getA2CH())
+ self.E1CHList.append(coal.getE1CH())
+ self.E2CHList.append(coal.getE2CH())
+ self.AHETCH_O2List.append(coal.getAHETCH_O2())
+ self.EHETCH_O2List.append(coal.getEHETCH_O2())
+ self.IOCHET_O2List.append(coal.getIOCHET_O2())
+ self.AHETCH_CO2List.append(coal.getAHETCH_CO2())
+ self.EHETCH_CO2List.append(coal.getEHETCH_CO2())
+ self.IOCHET_CO2List.append(coal.getIOCHET_CO2())
+
+
+ def updateCoal(self,number, coal) :
+ nb = number - 1
+ self.classesNumberList[nb] = coal.getClassesNumber()
+ self.initDiameterClassesList[nb] = coal.getInitDiameterClasses()
+ self.CDryCompositionList[nb] = coal.getCDryComposition()
+ self.HDryCompositionList[nb] = coal.getHDryComposition()
+ self.ODryCompositionList[nb] = coal.getODryComposition()
+ self.DryList[nb] = coal.getDry()
+ self.PCIValueList[nb] = coal.getPCIValue()
+ self.thermalCapacityList[nb] = coal.getThermalCapacity()
+ self.densityList[nb] = coal.getDensity()
+ self.humidityList[nb] = coal.getHumidity()
+ self.CDryCompositionCokeList[nb] = coal.getCDryCompositionCoke()
+ self.HDryCompositionCokeList[nb] = coal.getHDryCompositionCoke()
+ self.ODryCompositionCokeList[nb] = coal.getODryCompositionCoke()
+ self.PCICokeValueList[nb] = coal.getPCICokeValue()
+ self.ashesRatioList[nb] = coal.getAshesRatio()
+ self.ashesFormingEnthalpyList[nb] = coal.getAshesFormingEnthalpy()
+ self.ashesThermalCapacityList[nb] = coal.getAshesThermalCapacity()
+ self.IY1CHList[nb] = coal.getIY1CH()
+ self.Y1CHList[nb] = coal.getY1CH()
+ self.IY2CHList[nb] = coal.getIY2CH()
+ self.Y2CHList[nb] = coal.getY2CH()
+ self.A1CHList[nb] = coal.getA1CH()
+ self.A2CHList[nb] = coal.getA2CH()
+ self.E1CHList[nb] = coal.getE1CH()
+ self.E2CHList[nb] = coal.getE2CH()
+ self.AHETCH_O2List[nb] = coal.getAHETCH_O2()
+ self.EHETCH_O2List[nb] = coal.getEHETCH_O2()
+ self.IOCHET_O2List[nb] = coal.getIOCHET_O2()
+ self.AHETCH_CO2List[nb] = coal.getAHETCH_CO2()
+ self.EHETCH_CO2List[nb] = coal.getEHETCH_CO2()
+ self.IOCHET_CO2List[nb] = coal.getIOCHET_CO2()
+
+
+ def getCoal(self, number):
+ coal = Coal()
+ nb = number - 1
+ coal.setClassesNumber(self.classesNumberList[nb])
+ coal.setInitDiameterClasses(self.initDiameterClassesList[nb])
+ coal.setCDryComposition(self.CDryCompositionList[nb])
+ coal.setHDryComposition(self.HDryCompositionList[nb])
+ coal.setODryComposition(self.ODryCompositionList[nb])
+ coal.setDry(self.DryList[nb])
+ coal.setPCIValue(self.PCIValueList[nb])
+ coal.setThermalCapacity(self.thermalCapacityList[nb])
+ coal.setDensity(self.densityList[nb])
+ coal.setHumidity(self.humidityList[nb])
+ coal.setCDryCompositionCoke(self.CDryCompositionCokeList[nb])
+ coal.setHDryCompositionCoke(self.HDryCompositionCokeList[nb])
+ coal.setODryCompositionCoke(self.ODryCompositionCokeList[nb])
+ coal.setPCICokeValue(self.PCICokeValueList[nb])
+ coal.setAshesRatio(self.ashesRatioList[nb])
+ coal.setAshesFormingEnthalpy(self.ashesFormingEnthalpyList[nb])
+ coal.setAshesThermalCapacity(self.ashesThermalCapacityList[nb])
+ coal.setIY1CH(self.IY1CHList[nb])
+ coal.setY1CH(self.Y1CHList[nb])
+ coal.setIY2CH(self.IY2CHList[nb])
+ coal.setY2CH(self.Y2CHList[nb])
+ coal.setA1CH(self.A1CHList[nb])
+ coal.setA2CH(self.A2CHList[nb])
+ coal.setE1CH(self.E1CHList[nb])
+ coal.setE2CH(self.E2CHList[nb])
+ coal.setAHETCH_O2(self.AHETCH_O2List[nb])
+ coal.setEHETCH_O2(self.EHETCH_O2List[nb])
+ coal.setIOCHET_O2(self.IOCHET_O2List[nb])
+ coal.setAHETCH_CO2(self.AHETCH_CO2List[nb])
+ coal.setEHETCH_CO2(self.EHETCH_CO2List[nb])
+ coal.setIOCHET_O2(self.IOCHET_CO2List[nb])
+ return coal
+
+
+ def getCoalNumber(self):
+ return self.coalNumber
+
+
+ def getClassesNumberList(self):
+ return self.classesNumberList
+
+
+ def getInitDiameterClassesList(self):
+ return self.initDiameterClassesList
+
+
+ def getCDryCompositionList(self):
+ return self.CDryCompositionList
+
+
+ def getHDryCompositionList(self):
+ return self.HDryCompositionList
+
+
+ def getODryCompositionList(self):
+ return self.ODryCompositionList
+
+
+ def getDryList(self):
+ return self.DryList
+
+
+ def getPCIValueList(self):
+ return self.PCIValueList
+
+
+ def getThermalCapacityList(self):
+ return self.thermalCapacityList
+
+
+ def getDensityList(self):
+ return self.densityList
+
+
+ def getHumidityList(self):
+ return self.humidityList
+
+
+ def getCDryCompositionCokeList(self):
+ return self.CDryCompositionCokeList
+
+
+ def getHDryCompositionCokeList(self):
+ return self.HDryCompositionCokeList
+
+
+ def getODryCompositionCokeList(self):
+ return self.ODryCompositionCokeList
+
+
+ def getPCICokeValueList(self):
+ return self.PCICokeValueList
+
+
+ def getAshesRatioList(self):
+ return self.ashesRatioList
+
+
+ def getAshesFormingEnthalpyList(self):
+ return self.ashesFormingEnthalpyList
+
+
+ def getAshesThermalCapacityList(self):
+ return self.ashesThermalCapacityList
+
+
+ def setCoalNumber(self, value):
+ self.coalNumber = value
+
+
+ def setClassesNumberList(self, value):
+ self.classesNumberList = value
+
+
+ def setInitDiameterClassesList(self, value):
+ self.initDiameterClassesList = value
+
+
+ def setCDryCompositionList(self, value):
+ self.CDryCompositionList = value
+
+
+ def setHDryCompositionList(self, value):
+ self.HDryCompositionList = value
+
+
+ def setODryCompositionList(self, value):
+ self.ODryCompositionList = value
+
+
+ def setDryList(self, value):
+ self.DryList = value
+
+
+ def setPCIValueList(self, value):
+ self.PCIValueList = value
+
+
+ def setThermalCapacityList(self, value):
+ self.thermalCapacityList = value
+
+
+ def setDensityList(self, value):
+ self.densityList = value
+
+
+ def setHumidityList(self, value):
+ self.humidityList = value
+
+
+ def setCDryCompositionCokeList(self, value):
+ self.CDryCompositionCokeList = value
+
+
+ def setHDryCompositionCokeList(self, value):
+ self.HDryCompositionCokeList = value
+
+
+ def setODryCompositionCokeList(self, value):
+ self.ODryCompositionCokeList = value
+
+
+ def setPCICokeValueList(self, value):
+ self.PCICokeValueList = value
+
+
+ def setAshesRatioList(self, value):
+ self.ashesRatioList = value
+
+
+ def setAshesFormingEnthalpyList(self, value):
+ self.ashesFormingEnthalpyList = value
+
+
+ def setAshesThermalCapacityList(self, value):
+ self.ashesThermalCapacityList = value
+
+ #
+ # "DEVOLATISATION" part
+ def getIY1CHList(self):
+ return self.IY1CHList
+
+
+ def getY1CHList(self):
+ return self.Y1CHList
+
+
+ def getIY2CHList(self):
+ return self.IY2CHList
+
+
+ def getY2CHList(self):
+ return self.Y2CHList
+
+
+ def getA1CHList(self):
+ return self.A1CHList
+
+
+ def getA2CHList(self):
+ return self.A2CHList
+
+
+ def getE1CHList(self):
+ return self.E1CHList
+
+
+ def getE2CHList(self):
+ return self.E2CHList
+
+
+ def setIY1CHList(self, value):
+ self.IY1CHList = value
+
+
+ def setY1CHList(self, value):
+ self.Y1CHList = value
+
+
+ def setIY2CHList(self, value):
+ self.IY2CHList = value
+
+
+ def setY2CHList(self, value):
+ self.Y2CHList = value
+
+
+ def setA1CHList(self, value):
+ self.A1CHList = value
+
+
+ def setA2CHList(self, value):
+ self.A2CHList = value
+
+
+ def setE1CHList(self, value):
+ self.E1CHList = value
+
+
+ def setE2CHList(self, value):
+ self.E2CHList = value
+ #
+ # "COMBUSTION HETEROGENE" part
+ def getAHETCH_O2List(self):
+ return self.AHETCH_O2List
+
+
+ def getEHETCH_O2List(self):
+ return self.EHETCH_O2List
+
+
+ def getIOCHET_O2List(self):
+ return self.IOCHET_O2List
+
+
+ def getAHETCH_CO2List(self):
+ return self.AHETCH_CO2List
+
+
+ def getEHETCH_CO2List(self):
+ return self.EHETCH_CO2List
+
+
+ def getIOCHET_CO2List(self):
+ return self.IOCHET_CO2List
+
+
+ def setAHETCH_O2List(self, value):
+ self.AHETCH_O2List = value
+
+
+ def setEHETCH_O2List(self, value):
+ self.EHETCH_O2List = value
+
+
+ def setIOCHET_O2List(self, value):
+ self.IOCHET_O2List = value
+
+
+ def setAHETCH_CO2List(self, value):
+ self.AHETCH_CO2List = value
+
+
+ def setEHETCH_CO2List(self, value):
+ self.EHETCH_CO2List = value
+
+
+ def setIOCHET_CO2List(self, value):
+ self.IOCHET_CO2List = value
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class RadiativTransfer:
+ def __init__(self):
+ """ constructor """
+ #
+ # "RAYONNEMENT" part
+ self.Comment = {}
+ #self.radiativTransfer = 0
+ #self.Comment["radiativTransfer"] = "Rayonnement : (0 : pas de rayonnement ; 1 : constant donne ci-dessous ; 2 : par Modak)"
+ self.absorptionCoeff = 0
+ self.Comment["absorptionCoeff"] = "Coeff absorption pour le melange gazeux constant"
+
+ #
+ # "RAYONNEMENT" part
+ #def getRadiativTransfer(self) :
+ # return self.radiativTransfer
+
+
+ def getAbsorptionCoeff(self):
+ return self.absorptionCoeff
+
+
+ #def setRadiativTransfer(self, value) :
+ # self.radiativTransfer = value
+
+
+ def setAbsorptionCoeff(self, value):
+ self.absorptionCoeff = value
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class Oxydant:
+ """
+ Oxydant compisition in O2,N2,H2O,CO2
+ """
+ def __init__(self):
+ self.oxydantNumber = 1
+ self.O2 = 0.25
+ self.N2 = 0.75
+ self.H2O = 0
+ self.CO2 = 0
+
+
+ def setOxydantNumber(self, value):
+ self.oxydantNumber = value
+
+
+ def setO2(self, value):
+ self.O2 = value
+
+
+ def setN2(self, value):
+ self.N2 = value
+
+
+ def setH2O(self, value):
+ self.H2O = value
+
+
+ def setCO2(self, value):
+ self.CO2 = value
+
+
+ def getOxydantNumber(self):
+ return self.oxydantNumber
+
+
+ def getO2(self):
+ return self.O2
+
+
+ def getN2(self):
+ return self.N2
+
+
+ def getH2O(self):
+ return self.H2O
+
+
+ def getCO2(self):
+ return self.CO2
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class Oxydants(Model):
+ def __init__(self):
+ """ constructor """
+ self.Comment = {}
+ self.oxydantNumber = 0
+ self.Comment["oxydantNumber"] = ""
+ self.oxydantNumberList = []
+ self.Comment["oxydantNumberList"] = ""
+ self.O2List = []
+ self.Comment["O2List"] = ""
+ self.N2List = []
+ self.Comment["N2List"] = ""
+ self.H2OList = []
+ self.Comment["H2OList"] = ""
+ self.CO2List = []
+ self.Comment["CO2List"] = ""
+
+
+ def deleteOxydant(self, number):
+ self.oxydantNumber -= 1
+ nb = number - 1
+ self.oxydantNumberList.pop(nb)
+ self.O2List.pop(nb)
+ self.N2List.pop(nb)
+ self.H2OList.pop(nb)
+ self.CO2List.pop(nb)
+
+
+ def addOxydant(self, oxy):
+ self.oxydantNumber += 1
+ self.isLowerOrEqual(self.oxydantNumber, 3)
+ self.oxydantNumberList.append(oxy.getOxydantNumber())
+ self.O2List.append(oxy.getO2())
+ self.N2List.append(oxy.getN2())
+ self.H2OList.append(oxy.getH2O())
+ self.CO2List.append(oxy.getCO2())
+
+
+ def updateOxydant(self, number, oxy) :
+ nb = number - 1
+ self.oxydantNumberList[nb] = oxy.getOxydantNumber()
+ self.O2List[nb] = oxy.getO2()
+ self.N2List[nb] = oxy.getN2()
+ self.H2OList[nb] = oxy.getH2O()
+ self.CO2List[nb] = oxy.getCO2()
+
+
+ def getOxydant(self, number):
+ oxy = Oxydant()
+ nb = number - 1
+ oxy.setOxydantNumber(self.oxydantNumberList[nb])
+ oxy.setO2(self.O2List[nb])
+ oxy.setN2(self.N2List[nb])
+ oxy.setH2O(self.H2OList[nb])
+ oxy.setCO2(self.CO2List[nb])
+ return oxy
+
+
+ def getNumber(self):
+ return self.oxydantNumber
+
+
+ def setNumber(self, value):
+ self.oxydantNumber = value
+ self.oxydantNumberList = []
+ for i in range(0, value):
+ self.oxydantNumberList.append(i)
+
+
+ def getOxydantNumberList(self):
+ return self.oxydantNumberList
+
+
+ def setOxydantNumberList(self, value):
+ self.oxydantNumberList = value
+ self.oxydantNumber = len(value)
+
+
+ def getO2List(self):
+ return self.O2List
+
+
+ def getN2List(self):
+ return self.N2List
+
+
+ def getH2OList(self):
+ return self.H2OList
+
+
+ def getCO2List(self):
+ return self.CO2List
+
+
+ def setO2List(self, value):
+ self.O2List = value
+
+
+ def setN2List(self, value):
+ self.N2List = value
+
+
+ def setH2OList(self, value):
+ self.H2OList = value
+
+
+ def setCO2List(self, value):
+ self.CO2List = value
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class CoalThermoChemistryModel:
+ def __init__(self, fileName, case):
+ """ constructor """
+ self.case = case
+
+ # A remplacer par le bon repertoire
+ self.fileName = fileName
+ self.varComment = {}
+
+ self.species = CommonCombustion.Species()
+ self.radiativTransfer = RadiativTransfer()
+ self.coals = Coals()
+ self.oxydants = Oxydants()
+
+ # Load file
+ if not self.load():
+
+ # create default coal
+ coal = Coal()
+ self.coals.addCoal(coal)
+
+ # create default species
+ self.species.getDefault()
+
+ # create default oxydant
+ oxy = Oxydant()
+ self.oxydants.addOxydant(oxy)
+
+
+ def getCoals(self):
+ return self.coals
+
+
+ def getSpecies(self):
+ return self.species
+
+
+ def getOxydants(self):
+ return self.oxydants
+
+
+ def load(self):
+ """ read thermochimestry file"""
+ #FIXME bug to obtain case_path
+ filePath = self.case['data_path']+"/"+self.fileName
+ try :
+ ThermoChFile = open(filePath, "r")
+ except :
+ return 0
+
+ # "THERMOCHIMIE" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^THERMOCHIMIE")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath
+ msg = msg + "\nNo string 'THERMOCHIMIE' in the first line\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ value = self.__readIntValue(line, "currentSpeciesNb", filePath)
+ self.species.setCurrentSpeciesNb(value)
+
+ line = ThermoChFile.readline()
+ value = self.__readIntValue(line, "enthalpyTempTabNb", filePath)
+ self.species.setEnthalpyTempTabNb(value)
+
+ # "ESPECE COURANTE" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^ESPECES COURANTES")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath
+ msg = msg + "\nNo string 'ESPECES COURANTES' in the first line\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ try:
+ self.species.setCurrentSpeciesList(line.split())
+ except:
+ msg = "Reading file error: " + filePath + " bad list of current species"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ value = self.__readFloatValue(line, "MinTempTab", filePath)
+ self.species.setMinTempTab(value)
+
+ line = ThermoChFile.readline()
+ value = self.__readFloatValue(line, "MaxTempTab", filePath)
+ self.species.setMaxTempTab(value)
+
+ line = ThermoChFile.readline()
+ value = self.__readIntValue(line, "ElementarySpeciesNb", filePath)
+ self.species.setElementarySpeciesNb(value)
+
+ ElementarySpeciesMolarMassesList = []
+ CurrentSpeciesCompositionList = []
+ for elemSpec in range(self.species.getElementarySpeciesNb()):
+ try:
+ line = ThermoChFile.readline()
+ valuesList = line.split()
+ ElementarySpeciesMolarMassesList.append(float(valuesList[0]))
+ composition = []
+ for currentSpec in range(self.species.getCurrentSpeciesNb()):
+ composition.append(int(valuesList[1 + currentSpec]))
+ CurrentSpeciesCompositionList.append(composition)
+
+ except:
+ msg = "Reading file error: " + filePath
+ msg = msg + "\nElementarySpeciesMolarMassesList or CurrentSpeciesCompositionList reading\n"
+ raise ValueError, msg
+ self.species.setElementarySpeciesList(["C","H","O","N"])
+ self.species.setElementarySpeciesMolarMassesList(ElementarySpeciesMolarMassesList)
+ self.species.setCurrentSpeciesCompositionList(CurrentSpeciesCompositionList)
+
+ # "RAYONNEMENT" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^RAYONNEMENT")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath + "\nNo string 'RAYONNEMENT'\n"
+ raise ValueError, msg
+
+ #line = ThermoChFile.readline()
+ #value = self.__readIntValue(line, "RadiativTransfer", filePath)
+ #self.radiativTransfer.setRadiativTransfer(value)
+
+ line = ThermoChFile.readline()
+ value = self.__readFloatValue(line, "AbsorptionCoeff", filePath)
+ self.radiativTransfer.setAbsorptionCoeff(value)
+
+ # "CARACTERISTIQUES CHARBONS" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^CARACTERISTIQUES CHARBONS")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath + "\nNo string 'CARACTERISTIQUES CHARBONS'\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ value = self.__readIntValue(line, "CoalNumber", filePath)
+ self.coals.setCoalNumber(value)
+
+ line = ThermoChFile.readline()
+ values = self.__readIntCoalValues(line, "ClassesNumberList", filePath)
+ self.coals.setClassesNumberList(values)
+
+ line = ThermoChFile.readline()
+ try:
+ strList = line.split()
+ InitDiameterClassesList = []
+ pt = 0
+ for coal in range(self.coals.coalNumber):
+ InitDiameter = []
+ for Class in range(self.coals.classesNumberList[coal]):
+ InitDiameter.append(float(strList[pt+Class]))
+ pt += self.coals.classesNumberList[coal]
+ InitDiameterClassesList.append(InitDiameter)
+
+ self.coals.setInitDiameterClassesList(InitDiameterClassesList)
+
+ except:
+ msg = "Reading file error: " + filePath + "\nbad value for InitDiameterClassesList\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "CDryCompositionList", filePath)
+ self.coals.setCDryCompositionList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "HDryCompositionList", filePath)
+ self.coals.setHDryCompositionList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "ODryCompositionList", filePath)
+ self.coals.setODryCompositionList(values)
+
+ line = ThermoChFile.readline()
+ intValues, floatValues = self.__readIntFloatCoalValues(line, "PCIValue", filePath)
+ self.coals.setDryList(intValues)
+ self.coals.setPCIValueList(floatValues)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "thermalCapacity", filePath)
+ self.coals.setThermalCapacityList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "density", filePath)
+ self.coals.setDensityList(values)
+
+ # "Coke" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^Coke")
+ if not RegExpr.match(line):
+ msg = "_reading file error: " + filePath + "\nNo string 'Coke'\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "CDryCompositionCokeList", filePath)
+ self.coals.setCDryCompositionCokeList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "HDryCompositionCokeList", filePath)
+ self.coals.setHDryCompositionCokeList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "ODryCompositionCokeList", filePath)
+ self.coals.setODryCompositionCokeList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "PCICokeValue", filePath)
+ self.coals.setPCICokeValueList(values)
+
+ # "Cendres" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^Cendres")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath + "\nNo string 'Cendres'\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "ashesRatioList", filePath)
+ self.coals.setAshesRatioList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "AshesFormingEnthalpy", filePath)
+ self.coals.setAshesFormingEnthalpyList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "AshesThermalCapacity", filePath)
+ self.coals.setAshesThermalCapacityList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "humidity", filePath)
+ self.coals.setHumidityList(values)
+
+ # "Devolatilisation (Kobayashi)" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^Parametres de devolatilisation")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath + \
+ "\nNo string 'Parametres de devolatilisation (modele de Kobayashi)'\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ intValues, floatValues = self.__readIntFloatCoalValues(line, "IY1CH", filePath)
+ self.coals.setIY1CHList(intValues)
+ self.coals.setY1CHList(floatValues)
+
+ line = ThermoChFile.readline()
+ intValues, floatValues = self.__readIntFloatCoalValues(line, "IY2CH", filePath)
+ self.coals.setIY2CHList(intValues)
+ self.coals.setY2CHList(floatValues)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "A1CH", filePath)
+ self.coals.setA1CHList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "A2CH", filePath)
+ self.coals.setA2CHList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "E1CH", filePath)
+ self.coals.setE1CHList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "E2CH", filePath)
+ self.coals.setE2CHList(values)
+
+ # "Devolatisation (Kobayashi)" part
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("Parametres de combustion heterogene")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath + \
+ "\nNo string '^Parametres de combustion heterogene O2 (modele a sphere retrecissante)'\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "AHETCH_O2", filePath)
+ self.coals.setAHETCH_O2List(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "EHETCH_O2", filePath)
+ self.coals.setEHETCH_O2List(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readIntCoalValues(line, "IOCHET_O2", filePath)
+ self.coals.setIOCHET_O2List(values)
+
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^Parametres de combustion heterogene")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath + \
+ "\nNo string 'Parametres de combustion heterogene CO2 (modele a sphere retrecissante)'\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "AHETCH_CO2", filePath)
+ self.coals.setAHETCH_CO2List(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatCoalValues(line, "EHETCH_CO2", filePath)
+ self.coals.setEHETCH_CO2List(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readIntCoalValues(line, "IOCHET_CO2", filePath)
+ self.coals.setIOCHET_CO2List(values)
+
+ line = ThermoChFile.readline()
+ RegExpr = re.compile("^CARACTERISTIQUES OXYDANTS")
+ if not RegExpr.match(line):
+ msg = "Reading file error: " + filePath + \
+ "\nNo string 'CARACTERISTIQUES OXYDANTS (O2,N2,H2O,CO2)'\n"
+ raise ValueError, msg
+
+ line = ThermoChFile.readline()
+ value = self.__readIntValue(line, "oxydantNumber", filePath)
+ self.oxydants.setNumber(value)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatOxydantsValues(line, "O2 for oxydants", filePath)
+ self.oxydants.setO2List(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatOxydantsValues(line, "N2 for oxydants", filePath)
+ self.oxydants.setN2List(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatOxydantsValues(line, "H2O for oxydants", filePath)
+ self.oxydants.setH2OList(values)
+
+ line = ThermoChFile.readline()
+ values = self.__readFloatOxydantsValues(line, "CO2 for oxydants", filePath)
+ self.oxydants.setCO2List(values)
+
+ ThermoChFile.close()
+
+ return 1
+
+
+ def save(self):
+ """ write and save thermochimestry file"""
+ #
+ # Openning
+ filePath = self.case['data_path']+"/"+self.fileName
+ try :
+ ThermoChFile = open(filePath, "w")
+ except :
+ msg = "Openning file error: " + filePath
+ raise ValueError, msg
+ #
+ # writing
+ ThermoChFile.write("THERMOCHIMIE\n")
+ chain = str(self.species.getCurrentSpeciesNb())
+ comment = self.createComment(len(chain),self.species.Comment["currentSpeciesNb"])
+ ThermoChFile.write(chain + comment + "\n")
+
+ chain = str(self.species.getEnthalpyTempTabNb())
+ comment = self.createComment(len(chain),self.species.Comment["enthalpyTempTabNb"])
+ ThermoChFile.write(chain + comment + "\n")
+ #
+ ThermoChFile.write("ESPECES COURANTES\n")
+ ThermoChFile.write(self.__preWriteList(self.species.getCurrentSpeciesList())+"\n")
+
+ chain = str(self.species.getMinTempTab())
+ comment = self.createComment(len(chain),self.species.Comment["minTempTab"])
+ ThermoChFile.write(chain + comment + "\n")
+
+ chain = str(self.species.getMaxTempTab())
+ comment = self.createComment(len(chain),self.species.Comment["maxTempTab"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.species.getElementarySpeciesNb())
+ comment = self.createComment(len(chain),self.species.Comment["elementarySpeciesNb"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ list2write=[]
+ ind = 0
+ for i in self.species.getElementarySpeciesMolarMassesList():
+ listTMP = []
+ listTMP.append(i)
+ for j in self.species.getCurrentSpeciesCompositionList()[ind]:
+ listTMP.append(j)
+ ind += 1
+ list2write.append(listTMP)
+ ThermoChFile.write(self.__preWriteList(list2write))
+ #
+ ThermoChFile.write("RAYONNEMENT\n")
+
+ #chain = str(self.radiativTransfer.getRadiativTransfer())
+ #comment = self.createComment(len(chain),self.radiativTransfer.Comment["radiativTransfer"])
+ #ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.radiativTransfer.getAbsorptionCoeff())
+ comment = self.createComment(len(chain),self.radiativTransfer.Comment["absorptionCoeff"])
+ ThermoChFile.write(chain + comment +"\n")
+ #
+ ThermoChFile.write("CARACTERISTIQUES CHARBONS\n")
+
+ chain = str(self.coals.getCoalNumber())
+ comment = self.createComment(len(chain),self.coals.Comment["coalNumber"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getClassesNumberList()))
+ comment = self.createComment(len(chain),self.coals.Comment["classesNumberList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ listTMP = []
+ for i in self.coals.getInitDiameterClassesList():
+ for j in i:
+ listTMP.append(j)
+ chain = str(self.__preWriteList(listTMP))
+ comment = self.createComment(len(chain),self.coals.Comment["initDiameterClassesList"])
+ ThermoChFile.write(chain + comment + "\n")
+
+ chain = str(self.__preWriteList(self.coals.getCDryCompositionList()))
+ comment = self.createComment(len(chain),self.coals.Comment["CDryCompositionList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getHDryCompositionList()))
+ comment = self.createComment(len(chain),self.coals.Comment["HDryCompositionList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getODryCompositionList()))
+ comment = self.createComment(len(chain),self.coals.Comment["ODryCompositionList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ list2write=[]
+
+ for coal in range(self.coals.coalNumber):
+ list2write.append(self.coals.getDryList()[coal])
+ list2write.append(self.coals.getPCIValueList()[coal])
+
+ chain = str(self.__preWriteList(list2write))
+ comment = self.createComment(len(chain),self.coals.Comment["DryList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getThermalCapacityList()))
+ comment = self.createComment(len(chain),self.coals.Comment["thermalCapacityList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getDensityList()))
+ comment = self.createComment(len(chain),self.coals.Comment["densityList"])
+ ThermoChFile.write(chain + comment +"\n")
+ #
+ ThermoChFile.write("Coke\n")
+
+ chain = str(self.__preWriteList(self.coals.getCDryCompositionCokeList()))
+ comment = self.createComment(len(chain),self.coals.Comment["CDryCompositionCokeList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getHDryCompositionCokeList()))
+ comment = self.createComment(len(chain),self.coals.Comment["HDryCompositionCokeList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getODryCompositionCokeList()))
+ comment = self.createComment(len(chain),self.coals.Comment["ODryCompositionCokeList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getPCICokeValueList()))
+ comment = self.createComment(len(chain),self.coals.Comment["PCICokeValueList"])
+ ThermoChFile.write(chain + comment +"\n")
+ #
+ ThermoChFile.write("Cendres\n")
+
+ chain = str(self.__preWriteList(self.coals.getAshesRatioList()))
+ comment = self.createComment(len(chain),self.coals.Comment["ashesRatioList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getAshesFormingEnthalpyList()))
+ comment = self.createComment(len(chain),self.coals.Comment["ashesFormingEnthalpyList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getAshesThermalCapacityList()))
+ comment = self.createComment(len(chain),self.coals.Comment["ashesThermalCapacityList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = str(self.__preWriteList(self.coals.getHumidityList()))
+ comment = self.createComment(len(chain),self.coals.Comment["humidityList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ #
+ ThermoChFile.write("Parametres de devolatilisation (modele de Kobayashi)\n")
+
+ list2write=[]
+ ind = 0
+ for i in self.coals.getIY1CHList():
+ j = self.coals.getY1CHList()[ind]
+ list2write.append(i)
+ list2write.append(j)
+ ind += 1
+ chain = self.__preWriteList(list2write)
+ comment = self.createComment(len(chain),self.coals.Comment["Y1CHList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ list2write=[]
+
+ ind = 0
+ for i in self.coals.getIY2CHList():
+ j = self.coals.getY2CHList()[ind]
+ list2write.append(i)
+ list2write.append(j)
+ ind += 1
+
+ chain = self.__preWriteList(list2write)
+ comment = self.createComment(len(chain),self.coals.Comment["Y2CHList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getA1CHList())
+ comment = self.createComment(len(chain),self.coals.Comment["A1CHList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getA2CHList())
+ comment = self.createComment(len(chain),self.coals.Comment["A2CHList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getE1CHList())
+ comment = self.createComment(len(chain),self.coals.Comment["E1CHList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getE2CHList())
+ comment = self.createComment(len(chain),self.coals.Comment["E2CHList"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ ThermoChFile.write("Parametres de combustion heterogene O2 (modele a sphere retrecissante)\n")
+
+ chain = self.__preWriteList(self.coals.getAHETCH_O2List())
+ comment = self.createComment(len(chain),self.coals.Comment["AHETCH_O2List"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getEHETCH_O2List())
+ comment = self.createComment(len(chain),self.coals.Comment["EHETCH_O2List"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getIOCHET_O2List())
+ comment = self.createComment(len(chain),self.coals.Comment["IOCHET_O2List"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ ThermoChFile.write("Parametres de combustion heterogene CO2 (modele a sphere retrecissante)\n")
+
+ chain = self.__preWriteList(self.coals.getAHETCH_CO2List())
+ comment = self.createComment(len(chain),self.coals.Comment["AHETCH_CO2List"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getEHETCH_CO2List())
+ comment = self.createComment(len(chain),self.coals.Comment["EHETCH_CO2List"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ chain = self.__preWriteList(self.coals.getIOCHET_CO2List())
+ comment = self.createComment(len(chain),self.coals.Comment["IOCHET_CO2List"])
+ ThermoChFile.write(chain + comment +"\n")
+
+ ThermoChFile.write("CARACTERISTIQUES OXYDANTS (O2,N2,H2O,CO2)\n")
+
+ chain = str(self.oxydants.getNumber())
+ ThermoChFile.write(chain + "\n")
+
+ chain = self.__preWriteList(self.oxydants.getO2List())
+ ThermoChFile.write(chain + "\n")
+
+ chain = self.__preWriteList(self.oxydants.getN2List())
+ ThermoChFile.write(chain + "\n")
+
+ chain = self.__preWriteList(self.oxydants.getH2OList())
+ ThermoChFile.write(chain + "\n")
+
+ chain = self.__preWriteList(self.oxydants.getCO2List())
+ ThermoChFile.write(chain + "\n")
+
+ ThermoChFile.close()
+
+
+ def createComment(self, length, comment):
+
+ nb = length
+ blancString = ""
+ while nb < 60 :
+ blancString += " "
+ nb += 1
+ return blancString+comment
+
+
+ def __readIntValue(self, line, valueName, filePath):
+
+ try:
+ value = int(line.split()[0])
+ except:
+ msg = "Reading file error: " + filePath + "\n"\
+ "bad value for " + valueName
+ raise ValueError, msg
+ return value
+
+
+ def __readFloatValue(self, line, valueName, filePath):
+
+ try:
+ value = float(line.split()[0])
+ except:
+ msg = "Reading file error: " + filePath + "\n" \
+ "bad value for " + valueName
+ raise ValueError, msg
+ return value
+
+
+ def __readFloatCoalValues(self, line, valueName, filePath):
+ """ read coal values"""
+ try:
+ strList = line.split()
+ value = []
+ for coal in range(self.coals.coalNumber):
+ value.append(float(strList[coal]))
+ except:
+ msg = "Reading file error: " + filePath + "\n"\
+ "bad value for "+ valueName
+ raise ValueError, msg
+ return value
+
+
+ def __readIntCoalValues(self, line, valueName, filePath):
+ """ read coal values"""
+ try:
+ strList = line.split()
+ value = []
+ for coal in range(self.coals.coalNumber):
+ value.append(int(strList[coal]))
+ except:
+ msg = "Reading file error: " + filePath + " bad value for "+ valueName
+ raise ValueError, msg
+ return value
+
+
+ def __readIntFloatCoalValues(self, line, valueName, filePath):
+ """ read coal values"""
+ try:
+ strList = line.split()
+ intValue = []
+ floatValue = []
+ for coal in range(0,2*self.coals.coalNumber,2):
+ intValue.append(int(strList[coal]))
+ floatValue.append(float(strList[coal+1]))
+ except:
+ msg = "Reading file error: " + filePath + " bad value for "+ valueName
+ raise ValueError, msg
+ return intValue, floatValue
+
+
+ def __preWriteList(self, List):
+ """build a line with elements list"""
+ string = ""
+ for i in List:
+ if type(i) == type([]) :
+ stringTMP = self.__preWriteList(i)
+ string += stringTMP + "\n"
+ else:
+ if string != "":
+ string += " " + str(i) + " "
+ else:
+ string += str(i)
+ return string
+
+
+ def __readFloatOxydantsValues(self, line, valueName, filePath):
+ """ read oxydants values"""
+ try:
+ strList = line.split()
+ values = []
+ for oxy in range(self.oxydants.getNumber()):
+ values.append(float(strList[oxy]))
+ except:
+ msg = "Reading file error: " + filePath + "\nbad value for " + valueName
+ raise ValueError, msg
+ return values
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/CommonCombustion.py b/gui/Pages/CommonCombustion.py
new file mode 100644
index 0000000..1cdb4d8
--- /dev/null
+++ b/gui/Pages/CommonCombustion.py
@@ -0,0 +1,158 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+import os, re, sys
+import string
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+class Species:
+
+ def __init__(self):
+ """ constructor """
+
+ self.currentSpeciesNb = 0
+ self.enthalpyTempTabNb = 0
+ self.currentSpeciesList = []
+ self.minTempTab = 0
+ self.maxTempTab = 0
+ self.elementarySpeciesNb = 0
+ self.elementarySpeciesMolarMassesList = []
+ self.elementarySpeciesList = []
+ self.currentSpeciesCompositionList = []
+
+ self.Comment = {}
+ self.Comment["currentSpeciesNb"] = "Nb especes courantes"
+ self.Comment["enthalpyTempTabNb"] = "Nb de points de tabulation ENTH-TEMP"
+ self.Comment["minTempTab"] = "Tmin"
+ self.Comment["maxTempTab"] = "Tmax"
+ self.Comment["elementarySpeciesNb"]= "Nb especes elementaires / Composition C,H,O,N"
+
+
+ def getDefault(self) :
+ self.currentSpeciesNb = 8
+ self.enthalpyTempTabNb = 8
+ self.currentSpeciesList = ['CH4','C2H4','CO','O2','CO2','H2O','N2','C(S)']
+ self.minTempTab = 300.
+ self.maxTempTab = 2400.
+ self.elementarySpeciesNb = 4
+ self.elementarySpeciesMolarMassesList = [0.012, 0.001, 0.016, 0.014]
+ self.elementarySpeciesList = ['C','H','O','N']
+ self.currentSpeciesCompositionList = [[1,2,1,0,1,0,0,1],[4,4,0,0,0,2,0,0],[0,0,1,2,2,1,0,0],[0,0,0,0,0,0,2,0]]
+ return
+
+
+ def getCurrentSpeciesNb(self) :
+ return self.currentSpeciesNb
+
+
+ def getEnthalpyTempTabNb(self) :
+ return self.enthalpyTempTabNb
+
+
+ def setCurrentSpeciesNb(self, value) :
+ self.currentSpeciesNb = value
+
+
+ def setEnthalpyTempTabNb(self, value) :
+ self.enthalpyTempTabNb = value
+
+
+ def getCurrentSpeciesList(self):
+ return self.currentSpeciesList
+
+
+ def getElementarySpeciesList(self):
+ return self.elementarySpeciesList
+
+
+ def getMinTempTab(self):
+ return self.minTempTab
+
+
+ def getMaxTempTab(self):
+ return self.maxTempTab
+
+
+ def getElementarySpeciesNb(self):
+ return self.elementarySpeciesNb
+
+
+ def getElementarySpeciesMolarMassesList(self):
+ return self.elementarySpeciesMolarMassesList
+
+
+ def getCurrentSpeciesCompositionList(self):
+ return self.currentSpeciesCompositionList
+
+
+ def setCurrentSpeciesList(self, value):
+ self.currentSpeciesList = value
+
+
+ def setElementarySpeciesList(self, value):
+ self.elementarySpeciesList = value
+
+
+ def setMinTempTab(self, value):
+ self.minTempTab = value
+
+
+ def setMaxTempTab(self, value):
+ self.maxTempTab = value
+
+
+ def setElementarySpeciesNb(self, value):
+ self.elementarySpeciesNb = value
+
+
+ def setElementarySpeciesMolarMassesList(self, value):
+ self.elementarySpeciesMolarMassesList = value
+
+
+ def setCurrentSpeciesCompositionList(self, value):
+ self.currentSpeciesCompositionList = value
+
+
+ def addElementarySpecie(self, name, molarMass):
+ print "Not yet implemented"
+
+
+ def cancelElementarySpecie(self, number):
+ print "Not yet implemented"
+
+
+ def addCurrentSpecie(self, name, composition):
+ print "Not yet implemented"
+
+
+ def cancelElementarySpecie(self, number):
+ print "Not yet implemented"
\ No newline at end of file
diff --git a/gui/Pages/CurrentSpeciesForm.ui b/gui/Pages/CurrentSpeciesForm.ui
new file mode 100644
index 0000000..72e5aa9
--- /dev/null
+++ b/gui/Pages/CurrentSpeciesForm.ui
@@ -0,0 +1,207 @@
+<ui version="4.0" >
+ <class>CurrentSpeciesForm</class>
+ <widget class="QWidget" name="CurrentSpeciesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>540</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxEnthalpyTemp" >
+ <property name="title" >
+ <string>Enthalpy-Temperature tabulation</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QTableView" name="tableViewEnthalpyTemp" >
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::NoSelection</enum>
+ </property>
+ <property name="cornerButtonEnabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxComposition" >
+ <property name="title" >
+ <string>Composition</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QTableView" name="tableViewComposition" >
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::NoSelection</enum>
+ </property>
+ <property name="cornerButtonEnabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxMolarMass" >
+ <property name="title" >
+ <string>Elementary species molar mass</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QTableView" name="tableViewMolarMass" >
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>130</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::NoSelection</enum>
+ </property>
+ <property name="cornerButtonEnabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/CurrentSpeciesModel.py b/gui/Pages/CurrentSpeciesModel.py
new file mode 100644
index 0000000..a141c14
--- /dev/null
+++ b/gui/Pages/CurrentSpeciesModel.py
@@ -0,0 +1,107 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, re, sys
+import string
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+import Pages.CoalCombustionModel as CoalCombustion
+import Pages.CommonCombustion as CommonCombustion
+
+#-------------------------------------------------------------------------------
+# Class Model Main
+#-------------------------------------------------------------------------------
+
+class CurrentSpeciesModel:
+
+ def __init__(self, case):
+ """ constructor """
+ self.case = case
+ model = CoalCombustion.CoalCombustionModel(self.case)
+ if model.getCoalCombustionModel() != "off":
+ import Pages.CoalThermoChemistry as CoalThermoChemistry
+ model = CoalThermoChemistry.CoalThermoChemistryModel('dp_FCP', self.case)
+ self.species = model.getSpecies()
+
+ def getSpecies(self):
+ return self.species
+
+#-------------------------------------------------------------------------------
+# Class CurrentSpeciesModelTestCase
+#-------------------------------------------------------------------------------
+
+class CurrentSpeciesModelTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+
+ def checkCurrentSpeciesModelInstantiation(self):
+ """Check whether the NOMModel class could be instantiated"""
+ model = None
+ model = CurrentSpeciesModel(self.case)
+ assert model != None, 'Could not instantiate CurrentSpeciesModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(CurrentSpeciesModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "CurrentSpeciesModelTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/gui/Pages/CurrentSpeciesView.py b/gui/Pages/CurrentSpeciesView.py
new file mode 100644
index 0000000..932fdff
--- /dev/null
+++ b/gui/Pages/CurrentSpeciesView.py
@@ -0,0 +1,279 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- CurrentSpeciesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from CurrentSpeciesForm import Ui_CurrentSpeciesForm
+from Pages.CurrentSpeciesModel import CurrentSpeciesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("CurrentSpeciesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class for enthalpy-Temperature tabutation
+#-------------------------------------------------------------------------------
+
+class StandardItemModelEnthalpyTemp(QStandardItemModel):
+
+ def __init__(self, mdl):
+ """
+ Constructor.
+ """
+ QStandardItemModel.__init__(self)
+ self.setColumnCount(2)
+ self.setRowCount(3)
+ self.modelSpecies = mdl
+ self.species = self.modelSpecies.getSpecies()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ # Display
+ if role == Qt.DisplayRole:
+ if index.column() == 0:
+ if index.row() == 0:
+ return QVariant("points number of tabulation")
+ elif index.row() == 1:
+ return QVariant("Min temperature")
+ elif index.row() == 2:
+ return QVariant("Max temperature")
+ else:
+ return QVariant()
+ elif index.column() == 1:
+ if index.row() == 0:
+ text = str(self.species.getEnthalpyTempTabNb())
+ return QVariant(text)
+ elif index.row() == 1:
+ text = str(self.species.getMinTempTab()) + " K"
+ return QVariant(text)
+ elif index.row() == 2:
+ text = str(self.species.getMaxTempTab()) + " K"
+ return QVariant(text)
+ else:
+ return QVariant()
+ return QVariant()
+
+
+ def headerData(self, section, orientation, role):
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class for composition
+#-------------------------------------------------------------------------------
+
+class StandardItemModelComposition(QStandardItemModel):
+
+ def __init__(self, mdl):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.modelSpecies = mdl
+ self.species = self.modelSpecies.getSpecies()
+ nbspecies = self.species.getCurrentSpeciesNb()
+ self.setColumnCount(nbspecies)
+ nbelem = self.species.getElementarySpeciesList()
+ self.setRowCount(len(nbelem))
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ row = index.row()
+ col = index.column()
+ elemSpeciesName = self.species.getElementarySpeciesList()
+ composition = self.species.getCurrentSpeciesCompositionList()[row]
+ text=str(composition[col])
+ return QVariant(text)
+ return QVariant()
+
+
+ def headerData(self, section, orientation, role):
+ currentSpeciesName = self.species.getCurrentSpeciesList()
+ currentElementarySpecies = self.species.getElementarySpeciesList()
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ text = str(currentSpeciesName[section])
+ return QVariant(text)
+ if orientation == Qt.Vertical and role == Qt.DisplayRole:
+ text = str(currentElementarySpecies[section])
+ return QVariant(text)
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class for elementary species molar mass
+#-------------------------------------------------------------------------------
+
+class StandardItemModelMolarMass(QStandardItemModel):
+ def __init__(self, mdl):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.modelSpecies = mdl
+ self.species = self.modelSpecies.getSpecies()
+ self.setColumnCount(2)
+ nbspecies = self.species.getElementarySpeciesNb()
+ self.setRowCount(nbspecies)
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ row = index.row()
+ elemSpeciesName = self.species.getElementarySpeciesList()
+ molarMass = self.species.getElementarySpeciesMolarMassesList()
+ if index.column() == 0:
+ text=str(elemSpeciesName[row])
+ return QVariant(text)
+ elif index.column() == 1:
+ text = str(molarMass[row]) + " kg/mol"
+ return QVariant(text)
+ return QVariant()
+
+
+ def headerData(self, section, orientation, role):
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class CurrentSpeciesView(QWidget, Ui_CurrentSpeciesForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_CurrentSpeciesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+
+ # widgets layout
+
+ self.modelSpecies = CurrentSpeciesModel(self.case)
+
+ self.modelEnthalpyTemp = StandardItemModelEnthalpyTemp(self.modelSpecies)
+ self.modelComposition = StandardItemModelComposition(self.modelSpecies)
+ self.modelMolarMass = StandardItemModelMolarMass(self.modelSpecies)
+
+ self.tableViewEnthalpyTemp.setModel(self.modelEnthalpyTemp)
+ self.tableViewComposition.setModel(self.modelComposition)
+ self.tableViewMolarMass.setModel(self.modelMolarMass)
+
+ self.tableViewEnthalpyTemp.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ self.tableViewComposition.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+ self.tableViewMolarMass.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
+
+ #col = self.tableViewEnthalpyTemp.model().rowCount() -1
+ self.tableViewEnthalpyTemp.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
+ #col = self.tableViewMolarMass.model().rowCount() -1
+ self.tableViewMolarMass.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
+
+ self.tableViewEnthalpyTemp.horizontalHeader().hide()
+ self.tableViewMolarMass.horizontalHeader().hide()
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/DefineUserScalarsForm.ui b/gui/Pages/DefineUserScalarsForm.ui
new file mode 100644
index 0000000..5e08806
--- /dev/null
+++ b/gui/Pages/DefineUserScalarsForm.ui
@@ -0,0 +1,166 @@
+<ui version="4.0" >
+ <class>DefineUserScalarsForm</class>
+ <widget class="QWidget" name="DefineUserScalarsForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>223</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Select volume region for initial value</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Region selection</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxZone" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>User scalar definition</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QTableView" name="table" >
+ <property name="editTriggers" >
+ <set>QAbstractItemView::DoubleClicked</set>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QPushButton" name="pushButtonNew" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDelete" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/DefineUserScalarsModel.py b/gui/Pages/DefineUserScalarsModel.py
new file mode 100644
index 0000000..93282ea
--- /dev/null
+++ b/gui/Pages/DefineUserScalarsModel.py
@@ -0,0 +1,992 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the 'Additional user's scalars' page.
+
+This module defines the following classes:
+- DefineUserScalarsModel
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import string
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables
+from Base.XMLvariables import Model
+from Base.XMLmodel import XMLmodel, ModelTest
+##from DefineBoundaryRegionsModel import DefBCModel
+
+#-------------------------------------------------------------------------------
+# Define User Scalars model class
+#-------------------------------------------------------------------------------
+
+class DefineUserScalarsModel(Variables, Model):
+ """
+ Useful methods for operation of the page.
+ __method : private methods for the Model class.
+ _method : private methods for the View Class
+ """
+ def __init__(self, case):
+ """
+ Constructor
+ """
+ self.case = case
+
+# self.node_th_sca = self.case.xmlGetNode('thermal_scalar')
+ self.scalar_node = self.case.xmlGetNode('additional_scalars')
+ self.node_bc = self.case.xmlGetNode('boundary_conditions')
+
+
+ def defaultScalarValues(self):
+ """Return the default values - Method also used by ThermalScalarModel"""
+ default = {}
+ default['scalar_label'] = "scalar"
+ default['coefficient_label'] = "Dscal"
+ default['initial_value'] = 0.0
+ default['min_value'] = -1e+12
+ default['max_value'] = 1e+12
+ default['diffusion_coefficient'] = 1.83e-05
+ default['diffusion_choice'] = 'constant'
+ default['temperature_celsius'] = 20.0
+ default['temperature_kelvin'] = 293.15
+ default['enthalpy'] = 297413.
+ default['zone'] = 1
+
+ return default
+
+
+ def __removeScalarChildNode(self, label, tag):
+ """
+ Private method.
+ Delete 'variance' or 'property' markup from scalar named I{label}
+ """
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ if node['label'] == label:
+ node.xmlRemoveChild(tag)
+
+
+ def __deleteScalarBoundaryConditions(self, label):
+ """
+ Private method.
+ Delete boundary conditions for scalar I{label}
+ """
+ for nature in ('inlet', 'outlet', 'wall'):
+ for node in self.node_bc.xmlGetChildNodeList(nature):
+ for n in node.xmlGetChildNodeList('scalar'):
+ if n['label'] == label:
+ n.xmlRemoveNode()
+
+
+ def __defaultScalarNameAndDiffusivityLabel(self, scalar_label=None):
+ """
+ Private method.
+ Return a default name and label for a new scalar.
+ Create a default name for the associated diffusion coefficient to.
+ """
+ __coef = {}
+ for l in self.getScalarLabelsList():
+ __coef[l] = self.getScalarDiffusivityLabel(l)
+ length = len(__coef)
+ Lscal = self.defaultScalarValues()['scalar_label']
+ Dscal = self.defaultScalarValues()['coefficient_label']
+
+ # new scalar: default value for both scalar and diffusivity
+
+ if not scalar_label:
+ if length != 0:
+ i = 1
+ while (Dscal + str(i)) in __coef.values():
+ i = i + 1
+ num = str(i)
+ else:
+ num = str(1)
+ scalar_label = Lscal + num
+ __coef[scalar_label] = Dscal + num
+
+ # existing scalar
+
+ else:
+ if scalar_label not in __coef.keys()or \
+ (scalar_label in __coef.keys() and __coef[scalar_label] == ''):
+
+ __coef[scalar_label] = Dscal + str(length + 1)
+
+ return scalar_label, __coef[scalar_label]
+
+
+ def __updateScalarNameAndDiffusivityName(self):
+ """
+ Private method.
+ Update suffixe number for scalar name and diffusivity' name.
+ """
+ list = []
+ n = 0
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ n = n + 1
+ if node['type'] == 'user':
+ node['name'] = 'scalar' + str(n)
+ nprop = node.xmlGetChildNode('property')
+ if nprop:
+ nprop['name'] = 'diffusion_coefficient_' + str(n)
+
+
+ def __setScalarDiffusivity(self, scalar_label, coeff_label):
+ """
+ Private method.
+
+ Input default initial value of property "diffusivity"
+ for a new scalar I{scalar_label}
+ """
+ self.isNotInList(scalar_label, self.getScalarsVarianceList())
+ self.isInList(scalar_label, self.getUserScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', type='user', label=scalar_label)
+ n.xmlInitChildNode('property', label=coeff_label)
+
+ if not self.getScalarDiffusivityChoice(scalar_label):
+ self.setScalarDiffusivityChoice(scalar_label, 'constant')
+
+ if not self.getScalarDiffusivityInitialValue(scalar_label):
+ ini = self.defaultScalarValues()['diffusion_coefficient']
+ self.setScalarDiffusivityInitialValue(scalar_label, ini)
+
+
+ def __deleteScalar(self, label):
+ """
+ Private method.
+
+ Delete scalar I{label}.
+ """
+ node = self.scalar_node.xmlGetNode('scalar', label=label)
+ node.xmlRemoveNode()
+ self.__deleteScalarBoundaryConditions(label)
+ self.__updateScalarNameAndDiffusivityName()
+
+
+ def getScalarLabelsList(self):
+ """Public method.
+ Return the User scalar label list (thermal scalar included)"""
+ list = []
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ list.append(node['label'])
+ return list
+
+
+ def getUserScalarLabelsList(self):
+ """Public method.
+ Return the user scalar label list (without thermal scalar).
+ Method also used by UserScalarPropertiesView
+ """
+ list = []
+ for node in self.scalar_node.xmlGetNodeList('scalar', type='user'):
+ list.append(node['label'])
+ return list
+
+
+ def setScalarBoundaries(self):
+ """Public method.
+ Input boundaries conditions for a scalar node. Method also used by ThermalScalarModel
+ """
+ from Boundary import Boundary
+
+ for node in self.node_bc.xmlGetChildNodeList('inlet'):
+ model = Boundary('inlet', node['label'], self.case)
+ for label in self.getScalarLabelsList():
+ model.setScalar(label, 0.0)
+
+ for node in self.node_bc.xmlGetChildNodeList('outlet'):
+ model = Boundary('outlet', node['label'], self.case)
+ for label in self.getScalarLabelsList():
+ model.setScalar(label, 0.0)
+
+
+ def addUserScalar(self, zone, label=None):
+ """Public method.
+ Input a new user scalar I{label}"""
+ self.isInt(int(zone))
+
+ l, c = self.__defaultScalarNameAndDiffusivityLabel(label)
+
+ if l not in self.getScalarLabelsList():
+ self.scalar_node.xmlInitNode('scalar', 'name', type="user", label=l)
+
+ ini = self.defaultScalarValues()['initial_value']
+ min = self.defaultScalarValues()['min_value']
+ max = self.defaultScalarValues()['max_value']
+
+ self.setScalarInitialValue(zone, l, ini)
+ self.setScalarMinValue(l, min)
+ self.setScalarMaxValue(l, max)
+ self.__setScalarDiffusivity(l, c)
+ self.setScalarBoundaries()
+
+ self.__updateScalarNameAndDiffusivityName()
+
+ return l
+
+
+ def renameScalarLabel(self, old_label, new_label):
+ """Public method.
+ Modify old_label of scalar with new_label and put new label if variancy exists"""
+ # fusion de cette methode avec OutputVolumicVariablesModel.setVariablesLabel
+ self.isInList(old_label, self.getScalarLabelsList())
+
+ label = new_label[:LABEL_LENGTH_MAX]
+ if label not in self.getScalarLabelsList():
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ if node['label'] == old_label:
+ node['label'] = label
+
+ if node.xmlGetString('variance') == old_label:
+ node.xmlSetData('variance', label)
+
+ for nature in ('inlet', 'outlet', 'wall'):
+ for node in self.node_bc.xmlGetChildNodeList(nature):
+ for n in node.xmlGetChildNodeList('scalar'):
+ if n['label'] == old_label:
+ n['label'] = new_label
+
+ for node in self.case.xmlGetNodeList('formula'):
+ f = node.xmlGetTextNode().replace(old_label, new_label)
+ node.xmlSetTextNode(f)
+
+
+ # FIXME: cette methode est a deplacer dans ThermalScalarmodel
+ def getThermalScalarLabel(self):
+ """
+ Get label for thermal scalar
+ """
+ label = ""
+ node = self.scalar_node.xmlGetNode('scalar', type='thermal')
+ if node:
+ label = node['label']
+
+ return label
+
+
+ def getScalarInitialValue(self, zone, scalar_label):
+ """
+ Get initial value from an additional_scalar with label scalar_label
+ and zone zone. Method also used by InitializationView
+ """
+ self.isInt(int(zone))
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ val = n.xmlGetChildDouble('initial_value', zone=zone)
+ if val == None:
+ if n['type'] == 'thermal':
+ val = self.defaultScalarValues()[n['name']]
+ else:
+ val = self.defaultScalarValues()['initial_value']
+ self.setScalarInitialValue(zone, scalar_label, val)
+
+ return val
+
+
+ def setScalarInitialValue(self, zone, scalar_label, initial_value):
+ """
+ Put initial value for an additional_scalar with label scalar_label
+ and zone zone.
+ Method also used by InitializationView, ThermalScalarModel and MatisseModel
+ """
+ self.isInt(int(zone))
+ self.isFloat(initial_value)
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ nz = n.xmlInitChildNode('initial_value', zone=zone)
+ nz.xmlSetTextNode(initial_value)
+
+
+ def getScalarMinValue(self, scalar_label):
+ """Get minimal value from an additional_scalar with label scalar_label"""
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ min_val = n.xmlGetChildDouble('min_value')
+ if min_val == None:
+ min_val = self.defaultScalarValues()['min_value']
+ if self.getScalarVariance(scalar_label) == "":
+ self.setScalarMinValue(scalar_label, min_val)
+
+ return min_val
+
+
+ def setScalarMinValue(self, scalar_label, min_value):
+ """
+ Put minimal value for an additional_scalar with label scalar_label.
+ Method also used by ThermalScalarModel
+ """
+ self.isFloat(min_value)
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ n.xmlSetData('min_value', min_value)
+
+
+ def getScalarMaxValue(self, scalar_label):
+ """Get maximal value from an additional_scalar with label scalar_label"""
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ max_val = n.xmlGetDouble('max_value')
+ if max_val == None:
+ max_val = self.defaultScalarValues()['max_value']
+ if self.getScalarVariance(scalar_label) == "":
+ self.setScalarMaxValue(scalar_label, max_val)
+
+ return max_val
+
+
+ def setScalarMaxValue(self, scalar_label, max_value):
+ """
+ Put maximal value for an additional_scalar with label scalar_label.
+ Method also used by ThermalScalarModel
+ """
+ # we verify max_value is a float value
+ self.isFloat(max_value)
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ n.xmlSetData('max_value', max_value)
+
+
+ def getScalarVariance(self, l):
+ """
+ Get variance of an additional_scalar with label I{l}.
+ Method also used by UserScalarPropertiesView
+ """
+ self.isInList(l, self.getScalarLabelsList())
+
+ return self.scalar_node.xmlGetNode('scalar', label=l).xmlGetString('variance')
+
+
+ def setScalarVariance(self, scalar_label, variance_label):
+ """Put variance of an additional_scalar with label scalar_label"""
+ self.isInList(scalar_label, self.getUserScalarLabelsList())
+ self.isInList(variance_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', type='user', label=scalar_label)
+ n.xmlSetData('variance', variance_label)
+
+ self.__removeScalarChildNode(scalar_label, 'property')
+ self.setScalarMinValue(scalar_label, 0.0)
+ self.setScalarMaxValue(scalar_label, self.defaultScalarValues()['max_value'])
+
+
+ def getScalarsWithVarianceList(self):
+ """
+ Return list of scalars which have a variance
+ """
+ list = []
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ sca = node.xmlGetString('variance')
+ if sca and sca not in list:
+ list.append(sca)
+ return list
+
+
+ def getScalarsVarianceList(self):
+ """
+ Return list of scalars which are also a variance
+ """
+ list = []
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ if node.xmlGetString('variance') and node['label'] not in list:
+ list.append(node['label'])
+ return list
+
+
+ def getVarianceLabelFromScalarLabel(self, label):
+ """
+ Get the label of scalar with variancy's label: label
+ """
+ self.isInList(label, self.getScalarLabelsList())
+
+ lab = ""
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ if node.xmlGetString('variance') == label:
+ lab = node['label']
+ return lab
+
+
+ def setScalarDiffusivityLabel(self, scalar_label, diff_label):
+ """
+ Set label of diffusivity's property for an additional_scalar
+ """
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ n.xmlGetChildNode('property')['label'] = diff_label
+
+
+ def getScalarDiffusivityLabel(self, scalar_label):
+ """
+ Get label of diffusivity's property for an additional_scalar
+ with label scalar_label
+ """
+ self.isInList(scalar_label, self.getScalarLabelsList())
+
+ lab_diff = ""
+ n = self.scalar_node.xmlGetNode('scalar', label=scalar_label)
+ n_diff = n.xmlGetChildNode('property')
+ if n_diff:
+ lab_diff = n_diff['label']
+
+ return lab_diff
+
+
+ def setScalarDiffusivityInitialValue(self, scalar_label, initial_value):
+ """
+ Set initial value of diffusivity's property for an additional_scalar
+ with label scalar_label. Method also called by UserScalarPropertiesView.
+ """
+ self.isNotInList(scalar_label, self.getScalarsVarianceList())
+ self.isInList(scalar_label, self.getUserScalarLabelsList())
+ self.isFloat(initial_value)
+
+ n = self.scalar_node.xmlGetNode('scalar', type='user', label=scalar_label)
+ n_diff = n.xmlInitChildNode('property')
+ n_diff.xmlSetData('initial_value', initial_value)
+
+
+ def getScalarDiffusivityInitialValue(self, scalar_label):
+ """
+ Get initial value of diffusivity's property for an additional_scalar
+ with label scalar_label. Method also called by UserScalarPropertiesView.
+ """
+ self.isNotInList(scalar_label, self.getScalarsVarianceList())
+ self.isInList(scalar_label, self.getUserScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', type='user', label=scalar_label)
+ n_diff = n.xmlInitChildNode('property')
+ diffu = n_diff.xmlGetDouble('initial_value')
+ if diffu == None:
+ diffu = self.defaultScalarValues()['diffusion_coefficient']
+ self.setScalarDiffusivityInitialValue(scalar_label, diffu)
+
+ return diffu
+
+
+ def setScalarDiffusivityChoice(self, scalar_label, choice):
+ """
+ Set choice of diffusivity's property for an additional_scalar
+ with label scalar_label
+ """
+ self.isNotInList(scalar_label, self.getScalarsVarianceList())
+ self.isInList(scalar_label, self.getUserScalarLabelsList())
+ self.isInList(choice, ('constant', 'variable'))
+
+ n = self.scalar_node.xmlGetNode('scalar', type='user', label=scalar_label)
+ n_diff = n.xmlInitChildNode('property')
+ n_diff['choice'] = choice
+
+
+ def getScalarDiffusivityChoice(self, scalar_label):
+ """
+ Get choice of diffusivity's property for an additional_scalar
+ with label scalar_label
+ """
+ self.isNotInList(scalar_label, self.getScalarsVarianceList())
+ self.isInList(scalar_label, self.getUserScalarLabelsList())
+
+ n = self.scalar_node.xmlGetNode('scalar', type='user', label=scalar_label)
+ choice = n.xmlInitChildNode('property')['choice']
+ if not choice:
+ choice = self.defaultScalarValues()['diffusion_choice']
+ self.setScalarDiffusivityChoice(scalar_label, choice)
+
+ return choice
+
+
+ def setScalarValues(self, label, zone, init, mini, maxi, vari):
+ """
+ Put values to scalar with labelled I{label} for creating or replacing values.
+ Method also used by MatisseModel
+ """
+ self.isInt(int(zone))
+ self.isFloat(init)
+ self.isFloat(mini)
+ self.isFloat(maxi)
+ l = self.getScalarLabelsList()
+ l.append('no')
+ self.isInList(vari, l)
+
+ type = 'user'
+
+ if label not in self.getUserScalarLabelsList():
+ if label not in self.getScalarLabelsList():
+ self.addUserScalar(zone, label)
+ else:
+ type = 'thermal'
+ self.setScalarMinValue(label, mini)
+ self.setScalarMaxValue(label, maxi)
+
+ self.setScalarInitialValue(zone, label, init)
+ if type == 'user':
+ if vari != "no":
+ self.setScalarVariance(label, vari)
+ else:
+ self.__removeScalarChildNode(label, 'variance')
+ self.setScalarMinValue(label, mini)
+ self.setScalarMaxValue(label, maxi)
+ l, c = self.__defaultScalarNameAndDiffusivityLabel(label)
+ self.__setScalarDiffusivity(l, c)
+
+ self.__updateScalarNameAndDiffusivityName()
+
+
+ def deleteScalar(self, slabel):
+ """
+ Public method.
+ Delete scalar I{label}. Also called by ThermalScalarModel
+ Warning: deleting a scalar may delete other scalar which are variances
+ of previous deleting scalars.
+ """
+ self.isInList(slabel, self.getScalarLabelsList())
+
+ # First add the main scalar to delete
+ list = []
+ list.append(slabel)
+
+ # Then add variance scalar related to the main scalar
+ for node in self.scalar_node.xmlGetNodeList('scalar'):
+ if node.xmlGetString('variance') == slabel:
+ list.append(node['label'])
+
+ # Delete all scalars
+ for scalar in list:
+ self.__deleteScalar(scalar)
+
+ return list
+
+
+ def getScalarType(self, scalar_label):
+ """
+ Return type of scalar for choice of color (for view)
+ """
+ self.isInList(scalar_label, self.getScalarLabelsList())
+ node = self.scalar_node.xmlGetNode('scalar', 'type', label=scalar_label)
+ Model().isInList(node['type'], ('user', 'thermal'))
+ return node['type']
+
+
+ def getScalarName(self, scalar_label):
+ """
+ Return type of scalar for choice of color (for view)
+ """
+ self.isInList(scalar_label, self.getScalarLabelsList())
+ node = self.scalar_node.xmlGetNode('scalar', 'name', label=scalar_label)
+ return node['name']
+
+
+#-------------------------------------------------------------------------------
+# DefineUsersScalars test case
+#-------------------------------------------------------------------------------
+
+
+class UserScalarTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkDefineUserScalarsModelInstantiation(self):
+ """Check whether the DefineUserScalarsModel class could be instantiated."""
+ model = None
+ model = DefineUserScalarsModel(self.case)
+
+ assert model != None, 'Could not instantiate DefineUserScalarsModel'
+
+
+ def checkAddNewUserScalar(self):
+ """Check whether the DefineUserScalarsModel class could add a scalar."""
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'toto')
+
+ doc = '''<additional_scalars>
+ <scalar label="toto" name="scalar1" type="user">
+ <initial_value zone="1">0.0 </initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not add a user scalar'
+
+ def checkRenameScalarLabel(self):
+ """Check whether the DefineUserScalarsModel class could set a label."""
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'toto')
+ model.addUserScalar(zone,'titi')
+ model.renameScalarLabel('titi', 'MACHIN')
+
+ doc = '''<additional_scalars>
+ <scalar label="toto" name="scalar1" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ <scalar label="MACHIN" name="scalar2" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal2" name="diffusion_coefficient_2">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not rename a label to one scalar'
+
+ def checkGetThermalScalarLabel(self):
+ """Check whether the DefineUserScalarsModel class could be get label of thermal scalar."""
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'usersca1')
+ from ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+
+ doc = '''<additional_scalars>
+ <scalar label="usersca1" name="scalar1" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ </scalar>
+ </additional_scalars>'''
+
+ model.renameScalarLabel("Temp.C", "Matemperature")
+
+ assert model.getThermalScalarLabel() == "Matemperature",\
+ 'Could not get label of thermal scalar'
+
+ def checkSetAndGetScalarInitialValue(self):
+ """Check whether the DefineUserScalarsModel class could be set and get initial value."""
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'toto')
+ model.setScalarInitialValue(zone, 'toto', 0.05)
+
+ doc = '''<additional_scalars>
+ <scalar label="toto" name="scalar1" type="user">
+ <initial_value zone="1">0.05</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not set initial value to user scalar'
+ assert model.getScalarInitialValue(zone, 'toto') == 0.05,\
+ 'Could not get initial value to user scalar'
+
+ def checkSetAndGetScalarMinMaxValue(self):
+ """Check whether the DefineUserScalarsModel class could be set and get min and max value."""
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'toto')
+ model.addUserScalar(zone, 'titi')
+ model.setScalarInitialValue(zone, 'toto', 0.05)
+ model.setScalarMinValue('toto',0.01)
+ model.setScalarMaxValue('titi',100.)
+
+ doc = '''<additional_scalars>
+ <scalar label="toto" name="scalar1" type="user">
+ <initial_value zone="1">0.05</initial_value>
+ <min_value>0.01</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ <scalar label="titi" name="scalar2" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>100.</max_value>
+ <property choice="constant" label="Dscal2" name="diffusion_coefficient_2">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not set minimal or maximal value to user scalar'
+ assert model.getScalarMinValue('toto') == 0.01,\
+ 'Could not get minimal value from user scalar'
+ assert model.getScalarMaxValue('titi') == 100.,\
+ 'Could not get maximal value from user scalar'
+
+ def checkSetAndGetScalarVariance(self):
+ """Check whether the DefineUserScalarsModel class could be set and get variance of scalar."""
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'toto')
+ model.addUserScalar(zone, 'titi')
+ model.setScalarVariance('toto', 'titi')
+
+ doc = '''<additional_scalars>
+ <scalar label="toto" name="scalar1" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>1e+12</max_value>
+ <variance>titi</variance>
+ </scalar>
+ <scalar label="titi" name="scalar2" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal2" name="diffusion_coefficient_2">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not set variance to user scalar'
+ assert model.getScalarVariance('toto') == 'titi',\
+ 'Could not get variance of user scalar'
+
+ def checkGetVarianceLabelFromScalarLabel(self):
+ """
+ Check whether the DefineUserScalarsModel class could be get label of
+ the scalar which has variancy.
+ """
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'toto')
+ model.addUserScalar(zone, 'titi')
+ model.setScalarVariance('toto', 'titi')
+
+ assert model.getVarianceLabelFromScalarLabel('titi') == 'toto',\
+ 'Could not get label of scalar whiwh has a variancy'
+
+ def checkGetScalarDiffusivityLabel(self):
+ """
+ Check whether the DefineUserScalarsModel class could be get label of
+ diffusivity of user scalar.
+ """
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'premier')
+ model.addUserScalar(zone, 'second')
+
+ doc = '''<additional_scalars>
+ <scalar label="premier" name="scalar1" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>0</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ <scalar label="second" name="scalar2" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal2" name="diffusion_coefficient_2">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.getScalarDiffusivityLabel('second') == "Dscal2",\
+ 'Could not get label of diffusivity of one scalar'
+
+ def checkSetandGetScalarDiffusivityInitialValue(self):
+ """
+ Check whether the DefineUserScalarsModel class could be set
+ and get initial value of diffusivity.
+ """
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'premier')
+ model.addUserScalar(zone, 'second')
+ model.setScalarDiffusivityInitialValue('premier', 0.555)
+
+ doc = '''<additional_scalars>
+ <scalar label="premier" name="scalar1" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>0.555</initial_value>
+ </property>
+ </scalar>
+ <scalar label="second" name="scalar2" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal2" name="diffusion_coefficient_2">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not set initial value of property of one user scalar'
+ assert model.getScalarDiffusivityInitialValue('premier') == 0.555,\
+ 'Could not get initial value of property of one user scalar '
+
+ def checkSetandGetScalarDiffusivityChoice(self):
+ """Check whether the DefineUserScalarsModel class could be set and get diffusivity's choice."""
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'premier')
+ model.addUserScalar(zone, 'second')
+ model.setScalarDiffusivityChoice('premier', 'variable')
+ doc = '''<additional_scalars>
+ <scalar label="premier" name="scalar1" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="variable" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ <scalar label="second" name="scalar2" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal2" name="diffusion_coefficient_2">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not set choice of property of one user scalar'
+ assert model.getScalarDiffusivityChoice('premier') == "variable",\
+ 'Could not get choice of property of one user scalar'
+
+ def checkDeleteScalarandGetScalarType(self):
+ """
+ Check whether the DefineUserScalarsModel class could be
+ delete a user scalar and get type of the scalar.
+ """
+ model = DefineUserScalarsModel(self.case)
+ zone = '1'
+ model.addUserScalar(zone, 'premier')
+
+ from ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+
+ model.addUserScalar(zone, 'second')
+ model.addUserScalar(zone, 'troisieme')
+ model.addUserScalar(zone, 'quatrieme')
+
+ assert model.getScalarType('premier') == 'user',\
+ 'Could not get type of one scalar'
+
+ model.deleteScalar('second')
+
+ doc = '''<additional_scalars>
+ <scalar label="premier" name="scalar1" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal1" name="diffusion_coefficient_1">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ </scalar>
+ <scalar label="troisieme" name="scalar3" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal4" name="diffusion_coefficient_3">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ <scalar label="quatrieme" name="scalar4" type="user">
+ <initial_value zone="1">0.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <property choice="constant" label="Dscal5" name="diffusion_coefficient_4">
+ <initial_value>1.83e-05</initial_value>
+ </property>
+ </scalar>
+ </additional_scalars>'''
+
+ assert model.scalar_node == self.xmlNodeFromString(doc),\
+ 'Could not delete one scalar'
+
+
+
+def suite():
+ """unittest function"""
+ testSuite = unittest.makeSuite(UserScalarTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ """unittest function"""
+ print "UserScalarTestTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End DefineUsersScalars
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/DefineUserScalarsView.py b/gui/Pages/DefineUserScalarsView.py
new file mode 100644
index 0000000..96707be
--- /dev/null
+++ b/gui/Pages/DefineUserScalarsView.py
@@ -0,0 +1,619 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the 'Additional user's scalars' page.
+
+This module contains the following classes:
+- LabelDelegate
+- InitialValueDelegate
+- VarianceDelegate
+- MinimumDelegate
+- MaximumDelegate
+- StandardItemModelScalars
+- DefineUserScalarsView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from DefineUserScalarsForm import Ui_DefineUserScalarsForm
+
+from LocalizationModel import LocalizationModel
+from DefineUserScalarsModel import DefineUserScalarsModel
+
+from Base.Common import LABEL_LENGTH_MAX
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, DoubleValidator, RegExpValidator
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("DefineUserScalarsView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for the label
+#-------------------------------------------------------------------------------
+
+class LabelDelegate(QItemDelegate):
+ """
+ Use of a QLineEdit in the table.
+ """
+ def __init__(self, parent=None):
+ QItemDelegate.__init__(self, parent)
+ self.parent = parent
+ self.old_plabel = ""
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ self.old_label = ""
+ #editor.installEventFilter(self)
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ self.regExp = QRegExp(rx)
+ v = RegExpValidator(editor, self.regExp)
+ editor.setValidator(v)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ self.old_plabel = str(value)
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+
+ if editor.validator().state == QValidator.Acceptable:
+ new_plabel = str(editor.text())
+
+ if new_plabel in model.mdl.getScalarLabelsList():
+ default = {}
+ default['label'] = self.old_plabel
+ default['list'] = model.mdl.getScalarLabelsList()
+ default['regexp'] = self.regExp
+ log.debug("setModelData -> default = %s" % default)
+
+ from VerifyExistenceLabelDialogView import VerifyExistenceLabelDialogView
+ dialog = VerifyExistenceLabelDialogView(self.parent, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ new_plabel = result['label']
+ log.debug("setModelData -> result = %s" % result)
+ else:
+ new_plabel = self.old_plabel
+
+ model.setData(index, QVariant(QString(new_plabel)), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for the initial value
+#-------------------------------------------------------------------------------
+
+class InitialValueDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(InitialValueDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ v = DoubleValidator(editor)
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+ if editor.validator().state == QValidator.Acceptable:
+ value, ok = editor.text().toDouble()
+ for idx in self.parent.selectionModel().selectedIndexes():
+ if idx.column() == index.column():
+ [label, old_init, vari, mini, maxi] = model.getData(idx)
+ if model.checkInitMinMax(label, value, mini, maxi):
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Combo box delegate for the variance
+#-------------------------------------------------------------------------------
+
+class VarianceDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent):
+ super(VarianceDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ self.modelCombo = ComboModel(editor, 1, 1)
+ self.modelCombo.addItem(self.tr("No variance"), "no")
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ sca = index.model().getData(index)[0]
+ if index.model().mdl.getVarianceLabelFromScalarLabel(sca):
+ return
+
+ l1 = index.model().mdl.getScalarLabelsList()
+ for s in index.model().mdl.getScalarsVarianceList():
+ if s in l1: l1.remove(s)
+
+ if sca in l1: l1.remove(sca)
+
+ for s in l1:
+ self.modelCombo.addItem(s, s)
+
+
+ def setModelData(self, comboBox, model, index):
+ txt = str(comboBox.currentText())
+ value = self.modelCombo.dicoV2M[txt]
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for minimum value
+#-------------------------------------------------------------------------------
+
+class MinimumDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(MinimumDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ v = DoubleValidator(editor)
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+ if editor.validator().state == QValidator.Acceptable:
+ value, ok = editor.text().toDouble()
+ for idx in self.parent.selectionModel().selectedIndexes():
+ if idx.column() == index.column():
+ [label, init, vari, old_mini, maxi] = model.getData(idx)
+ if model.checkInitMinMax(label, init, value, maxi):
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for maximum value
+#-------------------------------------------------------------------------------
+
+class MaximumDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(MaximumDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ v = DoubleValidator(editor)
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+ if editor.validator().state == QValidator.Acceptable:
+ value, ok = editor.text().toDouble()
+ for idx in self.parent.selectionModel().selectedIndexes():
+ if idx.column() == index.column():
+ [label, init, vari, mini, old_maxi] = model.getData(idx)
+ if model.checkInitMinMax(label, init, mini, value):
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelScalars(QStandardItemModel):
+ """
+ """
+ def __init__(self, parent, mdl, zone):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.headers = [self.tr("Name"),
+ self.tr("Initial\nvalue"),
+ self.tr("Variance\nof scalar"),
+ self.tr("Minimal\nvalue"),
+ self.tr("Maximal\nvalue")]
+
+ self.setColumnCount(len(self.headers))
+
+ self.toolTipRole = [self.tr("Code_Saturne keyword: NSCAUS"),
+ self.tr("Code_Saturne user subroutine: usinv.F"),
+ self.tr("Code_Saturne keyword: ISCAVR"),
+ self.tr("Code_Saturne keyword: SCAMIN"),
+ self.tr("Code_Saturne keyword: SCAMAX")]
+
+ self._data = []
+ self._disable = []
+ self.parent = parent
+ self.mdl = mdl
+ self._zone = zone
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ row = index.row()
+ col = index.column()
+
+ if role == Qt.ToolTipRole:
+ return QVariant(self.toolTipRole[col])
+ if role == Qt.DisplayRole:
+ return QVariant(self._data[row][col])
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if (index.row(), index.column()) in self._disable:
+ return Qt.ItemIsSelectable
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ # Update the row in the table
+ row = index.row()
+ col = index.column()
+
+ # Label
+ if col == 0:
+ old_plabel = self._data[row][col]
+ new_plabel = str(value.toString())
+ self._data[row][col] = new_plabel
+ self.mdl.renameScalarLabel(old_plabel, new_plabel)
+
+ # Numerical values: init values, min and max
+ elif col == 1:
+ self._data[row][col], ok = value.toDouble()
+
+ elif col in [3, 4]:
+ if (row,3) not in self._disable:
+ self._data[row][col], ok = value.toDouble()
+
+ # Variance
+ elif col == 2:
+ variance = str(value.toString())
+ self._data[row][col] = variance
+
+ if (row,3) in self._disable: self._disable.remove((row,3))
+ if (row,4) in self._disable: self._disable.remove((row,4))
+ if variance != "no":
+ self._data[row][3] = 0.
+ self._data[row][4] = self.mdl.defaultScalarValues()['max_value']
+ # Disable values in columns 3 and 4
+ if (row,3) not in self._disable: self._disable.append((row,3))
+ if (row,4) not in self._disable: self._disable.append((row,4))
+ else:
+ label = self._data[row][0]
+ if self.mdl.getScalarType(label) == 'thermal':
+ if (row,2) not in self._disable: self._disable.append((row,2))
+ else:
+ if (row,2) in self._disable: self._disable.remove((row,2))
+
+ # Update the XML doc with the new data
+ if col != 0:
+ [label, init, vari, mini, maxi] = self._data[row]
+ self.mdl.setScalarValues(label, self._zone, init, mini, maxi, vari)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def getData(self, index):
+ row = index.row()
+ return self._data[row]
+
+
+ def newItem(self, existing_label=None):
+ """
+ Add an item in the table view
+ """
+ row = self.rowCount()
+
+ label = self.mdl.addUserScalar(self._zone, existing_label)
+ min = self.mdl.getScalarMinValue(label)
+ max = self.mdl.getScalarMaxValue(label)
+ ini = self.mdl.getScalarInitialValue(self._zone, label)
+ var = self.mdl.getScalarVariance(label)
+ if var in ("", "no variance", "no_variance"):
+ var = "no"
+ scalar = [label, ini, var, min, max]
+
+ self.setRowCount(row+1)
+ self._data.append(scalar)
+
+ if self.mdl.getScalarType(label) == 'thermal':
+ if (row,2) not in self._disable: self._disable.append((row,2))
+ else:
+ if (row,2) in self._disable: self._disable.remove((row,2))
+
+
+ def getItem(self, row):
+ """
+ Return the values for an item.
+ """
+ [label, init, vari, mini, maxi] = self._data[row]
+ return label, init, vari, mini, maxi
+
+
+ def deleteItem(self, row):
+ """
+ Delete the row in the model.
+ """
+ log.debug("deleteItem row = %i " % row)
+
+ for tuple in [(row,2), (row,3), (row,4)]:
+ if tuple in self._disable: self._disable.remove(tuple)
+
+ del self._data[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+ for r in range(self.rowCount()):
+ if self.mdl.getScalarType(self._data[r][0]) == 'thermal':
+ if (r,2) not in self._disable: self._disable.append((r,2))
+ else:
+ if (r,2) in self._disable: self._disable.remove((r,2))
+
+
+ def checkInitMinMax(self, label, init, mini, maxi):
+ """
+ Verify the coherence between init, mini and maxi
+ """
+ log.debug("checkInitMinMax")
+ OK = 1
+
+ if mini > maxi:
+ title = self.tr("Information")
+ msg = self.tr("The minimal value is greater than the maximal "\
+ "value. Therefore there will be no clipping for the "\
+ "scalar named:\n\n%1").arg(label)
+ QMessageBox.information(self.parent, title, msg)
+ return OK
+
+ # if min or max is modified, initial value must be checked for all zones
+ for z in LocalizationModel('VolumicZone', self.mdl.case).getZones():
+ if z.getNature()['initialization'] == "on":
+ name = str(z.getCodeNumber())
+ ini = self.mdl.getScalarInitialValue(name, label)
+ if name == self._zone:
+ ini = init
+
+ if ini < mini or ini > maxi:
+ title = self.tr("Warning")
+ msg = self.tr("The initial value must be set between the "\
+ "minimal and the maximal value of the scalar "\
+ "named: %1 for the volume region: %2").arg(label, z.getLabel())
+ QMessageBox.warning(self.parent, title, msg)
+ OK = 0
+
+ return OK
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class DefineUserScalarsView(QWidget, Ui_DefineUserScalarsForm):
+ """
+ """
+ def __init__(self, parent, case, stbar):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_DefineUserScalarsForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = DefineUserScalarsModel(self.case)
+
+ # widget layout
+
+ # 0/ Combo box model for zone
+ self.modelZone = ComboModel(self.comboBoxZone, 1, 1)
+
+ # Warning: the Volume region 'all_cells' is mandatory, it is exists always
+ zones = LocalizationModel('VolumicZone', self.case).getZones()
+ for z in zones:
+ if z.getNature()['initialization'] == "on":
+ label = z.getLabel()
+ name = str(z.getCodeNumber())
+ self.modelZone.addItem(self.tr(label), name)
+ if label == "all_cells":
+ zone_label = label
+ zone_name = name
+
+ self.modelZone.setItem(str_model = zone_name)
+
+ # 2/ tableView
+ self.modelScalars = StandardItemModelScalars(self, self.mdl, zone_name)
+ self.table.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+# self.table.setEditTriggers(QAbstractItemView.DoubleClicked)
+
+ # Delegates
+ delegateLabel = LabelDelegate(self.table)
+ delegateInitialValue = InitialValueDelegate(self.table)
+ delegateVariance = VarianceDelegate(self.table)
+ delegateMinimum = MinimumDelegate(self.table)
+ delegateMaximum = MaximumDelegate(self.table)
+
+ self.table.setItemDelegateForColumn(0, delegateLabel)
+ self.table.setItemDelegateForColumn(1, delegateInitialValue)
+ self.table.setItemDelegateForColumn(2, delegateVariance)
+ self.table.setItemDelegateForColumn(3, delegateMinimum)
+ self.table.setItemDelegateForColumn(4, delegateMaximum)
+
+ # Connections
+ self.connect(self.comboBoxZone, SIGNAL("activated(const QString&)"), self.slotZone)
+ self.connect(self.pushButtonNew, SIGNAL("clicked()"), self.slotAddScalar)
+ self.connect(self.pushButtonDelete, SIGNAL("clicked()"), self.slotDeleteScalar)
+ self.connect(self.modelScalars, SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), self.dataChanged)
+
+ # widget initialization
+ self.slotZone(zone_label)
+
+
+ @pyqtSignature("const QString &")
+ def slotZone(self, text):
+ """
+ Get label of volume zone for initialization
+ """
+ log.debug("slotZone-> text = %s" % text)
+ zone_name = self.modelZone.dicoV2M[str(text)]
+ log.debug("slotZone-> name = %s" % zone_name)
+
+ self.table.reset()
+ self.modelScalars = StandardItemModelScalars(self, self.mdl, zone_name)
+ self.table.setModel(self.modelScalars)
+
+ for label in self.mdl.getScalarLabelsList():
+ self.modelScalars.newItem(label)
+
+
+ @pyqtSignature("")
+ def slotAddScalar(self):
+ """
+ Add a new item in the table when the 'Create' button is pushed.
+ """
+ self.table.clearSelection()
+ self.modelScalars.newItem()
+
+
+ @pyqtSignature("")
+ def slotDeleteScalar(self):
+ """
+ Just delete the current selected entries from the table and
+ of course from the XML file.
+ """
+ list = []
+ for index in self.table.selectionModel().selectedRows():
+ row = index.row()
+ list.append(row)
+
+ list.sort()
+ list.reverse()
+
+ for row in list:
+ label, init, vari, mini, maxi = self.modelScalars.getItem(row)
+ if self.mdl.getScalarType(label) == 'user':
+ self.mdl.deleteScalar(label)
+# self.modelScalars.deleteItem(row)
+
+ self.table.clearSelection()
+ txt = str(self.comboBoxZone.currentText())
+ self.slotZone(txt)
+
+
+ @pyqtSignature("const QModelIndex &, const QModelIndex &")
+ def dataChanged(self, topLeft, bottomRight):
+ for row in range(topLeft.row(), bottomRight.row()+1):
+ self.tableView.resizeRowToContents(row)
+ for col in range(topLeft.column(), bottomRight.column()+1):
+ self.tableView.resizeColumnToContents(col)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/ElectricalModelsModel.py b/gui/Pages/ElectricalModelsModel.py
new file mode 100644
index 0000000..3388e6a
--- /dev/null
+++ b/gui/Pages/ElectricalModelsModel.py
@@ -0,0 +1,192 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the electrical thermal flow modelling management.
+
+This module contains the following classes and function:
+- ElectricalModel
+- ElectricalTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from ThermalRadiationModel import ThermalRadiationModel
+from Pages.FluidCharacteristicsModel import FluidCharacteristicsModel
+
+#-------------------------------------------------------------------------------
+# Coal combustion model class
+#-------------------------------------------------------------------------------
+
+class ElectricalModel(Variables, Model):
+ """
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ nModels = self.case.xmlGetNode('thermophysical_models')
+ self.node_turb = nModels.xmlGetNode('turbulence', 'model')
+ self.node_gas = nModels.xmlInitNode('gas_combustion', 'model')
+ self.node_coal = nModels.xmlInitNode('pulverized_coal', 'model')
+ self.node_joule = nModels.xmlInitNode('joule_effect', 'model')
+ self.node_therm = nModels.xmlGetNode('thermal_scalar', 'model')
+
+ self.electricalModel = ('off', 'joule', 'arc')
+
+
+ def defaultElectricalValues(self):
+ """
+ Return in a dictionnary which contains default values.
+ """
+ default = {}
+ default['model'] = "off"
+
+ return default
+
+
+ def getAllElectricalModels(self):
+ """
+ Return all defined electrical models in a tuple.
+ """
+ return self.electricalModel
+
+
+ def electricalModelsList(self):
+ """
+ Create a tuple with the electrical models allowed
+ by the calculation features.
+ """
+ electricalList = self.electricalModel
+
+ n, m = FluidCharacteristicsModel(self.case).getThermalModel()
+ if m != "off" and m not in electricalList:
+ electricalList = ('off',)
+
+ if self.node_turb['model'] not in ('off','k-epsilon',
+ 'k-epsilon-PL',
+ 'Rij-epsilon',
+ 'Rij-SSG',
+ 'v2f-phi',
+ 'k-omega-SST'):
+ electricalList = ('off',)
+
+ return electricalList
+
+
+ def setElectricalModel(self, model):
+ """
+ Update the electrical model markup from the XML document.
+ """
+ self.isInList(model, self.electricalModelsList())
+
+ if model == 'off':
+ self.node_joule['model'] = 'off'
+ ThermalRadiationModel(self.case).setRadiativeModel('off')
+ else:
+ self.node_gas['model'] = 'off'
+ self.node_coal['model'] = 'off'
+ self.node_joule['model'] = model
+ self.node_therm['model'] = 'off'
+
+
+ def getElectricalModel(self):
+ """
+ Return the current electrical model.
+ """
+ model = self.node_joule['model']
+ if model not in self.electricalModelsList():
+ model = self.defaultElectricalValues()['model']
+ self.setElectricalModel(model)
+
+ return model
+
+
+#-------------------------------------------------------------------------------
+# Electrical model test case
+#-------------------------------------------------------------------------------
+
+
+class ElectricalTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+ def checkElectricalInstantiation(self):
+ """
+ Check whether the ElectricalModel class could be instantiated
+ """
+ model = None
+ model = ElectricalModel(self.case)
+ assert model != None, 'Could not instantiate ElectricalModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(ElectricalTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "ElectricalTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/FacesSelectionForm.ui b/gui/Pages/FacesSelectionForm.ui
new file mode 100644
index 0000000..fa5160d
--- /dev/null
+++ b/gui/Pages/FacesSelectionForm.ui
@@ -0,0 +1,108 @@
+<ui version="4.0" >
+ <class>FacesSelectionForm</class>
+ <widget class="QWidget" name="FacesSelectionForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>212</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QTableView" name="tableView" />
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonNew" >
+ <property name="text" >
+ <string>New</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDelete" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="5" margin="10" />
+ <layoutfunction spacing="spacing" margin="margin" />
+ <resources/>
+ <connections/>
+ <designerdata>
+ <property name="gridDeltaX" >
+ <number>10</number>
+ </property>
+ <property name="gridDeltaY" >
+ <number>10</number>
+ </property>
+ <property name="gridSnapX" >
+ <bool>true</bool>
+ </property>
+ <property name="gridSnapY" >
+ <bool>true</bool>
+ </property>
+ <property name="gridVisible" >
+ <bool>true</bool>
+ </property>
+ </designerdata>
+</ui>
diff --git a/gui/Pages/FacesSelectionView.py b/gui/Pages/FacesSelectionView.py
new file mode 100644
index 0000000..6d5e51a
--- /dev/null
+++ b/gui/Pages/FacesSelectionView.py
@@ -0,0 +1,475 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- LineEditDelegateReferences
+- LineEditDelegateGroups
+- StandardItemModelFaces
+- FacesSelectionView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.QtPage import RegExpValidator, DoubleValidator
+from Base.Toolbox import GuiParam
+from FacesSelectionForm import Ui_FacesSelectionForm
+from Pages.SolutionDomainModel import SolutionDomainModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("FacesSelectionView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for references
+#-------------------------------------------------------------------------------
+
+class LineEditDelegateReferences(QItemDelegate):
+ """
+ Use of a QLineEdit in the table.
+ """
+ def __init__(self, parent=None):
+ QItemDelegate.__init__(self, parent)
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = RegExpValidator(editor, QRegExp("^all[ ]*$|^[0-9\ ]*$"))
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, lineEdit, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ lineEdit.setText(value)
+
+
+ def setModelData(self, lineEdit, model, index):
+ value = lineEdit.text()
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for groups
+#-------------------------------------------------------------------------------
+
+class LineEditDelegateGroups(QItemDelegate):
+ """
+ Use of a QLineEdit in the table.
+ """
+ def __init__(self, parent=None):
+ QItemDelegate.__init__(self, parent)
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = RegExpValidator(editor, QRegExp("[ '_A-Za-z0-9]*"))
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, lineEdit, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ lineEdit.setText(value)
+
+
+ def setModelData(self, lineEdit, model, index):
+ value = lineEdit.text()
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for Fraction and Plan
+#-------------------------------------------------------------------------------
+
+class FractionPlanDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(FractionPlanDelegate, self).__init__(parent)
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = DoubleValidator(editor, min=0.)
+ validator.setExclusiveMin(True)
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ value, ok = editor.text().toDouble()
+ if editor.validator().state == QValidator.Acceptable:
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelFaces(QStandardItemModel):
+
+ def __init__(self, parent, mdl=None, tag=None, perio_name=None):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.parent = parent
+ self.mdl = mdl
+ self.tag = tag
+ self.perio_name = perio_name
+
+ self.headers = [self.tr("References"),
+ self.tr("Groups"),
+ self.tr("Reverse"),
+ self.tr("Fraction"),
+ self.tr("Plane"),
+ self.tr("Semi-conf")]
+
+ self.tooltip = [self.tr("Code_Saturne Preprocessor sub-option: --color"),
+ self.tr("Code_Saturne Preprocessor sub-option: --group"),
+ self.tr("Code_Saturne Preprocessor sub-option: --invsel"),
+ self.tr("Code_Saturne Preprocessor sub-option: --fraction"),
+ self.tr("Code_Saturne Preprocessor sub-option: --plane"),
+ self.tr("Code_Saturne Preprocessor sub-option: --semi-conf")]
+
+ if self.tag == "faces_periodic":
+ self.headers.pop()
+ self.tooltip.pop()
+
+ elif self.tag == "faces_select":
+ self.headers = [self.tr("References"), self.tr("Groups"), self.tr("Reverse")]
+ self.tooltip = [self.tr("Code_Saturne Preprocessor sub-option: --color"),
+ self.tr("Code_Saturne Preprocessor sub-option: --group"),
+ self.tr("Code_Saturne Preprocessor sub-option: --invsel")]
+
+ self.setColumnCount(len(self.headers))
+
+ self.dataFaces = []
+ if tag and mdl:
+ self.populateModel()
+
+
+ def populateModel(self):
+
+ # Default values
+ self.default = {}
+ for key in ('color', 'group', 'reverse', 'fraction', 'plan', 'semiconf'):
+ self.default[key] = self.mdl.defaultValues()[key]
+
+ if self.tag == "faces_join":
+ for j in range(self.mdl.getJoinSelectionsNumber()):
+ d = self.mdl.getJoinFaces(j+1)
+ self.dataFaces.append(d)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+ else:
+ if self.tag == "faces_periodic":
+ d = self.mdl.getPeriodicFaces(self.perio_name)
+
+ elif self.tag == "faces_syrthes":
+ d = self.mdl.getSyrthesFaces()
+
+ elif self.tag == "faces_select":
+ d = self.mdl.getSelectFaces()
+
+ if d:
+ self.dataFaces.append(d)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ row = index.row()
+ col = index.column()
+
+ if role == Qt.ToolTipRole:
+ return QVariant(self.tooltip[col])
+
+ if role == Qt.DisplayRole:
+ if col == 0:
+ return QVariant(self.dataFaces[row]['color'])
+ elif col == 1:
+ return QVariant(self.dataFaces[row]['group'])
+ elif col == 3:
+ return QVariant(self.dataFaces[row]['fraction'])
+ elif col == 4:
+ return QVariant(self.dataFaces[row]['plan'])
+
+ if role == Qt.CheckStateRole:
+ if col == 2:
+ if self.dataFaces[row]['reverse'] == "on":
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+ elif col == 5:
+ if self.dataFaces[row]['semiconf'] == "on":
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if index.column() in [2, 5]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+ col = index.column()
+
+ if col == 0:
+ self.dataFaces[row]['color'] = str(value.toString())
+ elif col == 1:
+ self.dataFaces[row]['group'] = str(value.toString())
+ elif col == 3:
+ self.dataFaces[row]['fraction'] = str(value.toString())
+ elif col == 4:
+ self.dataFaces[row]['plan'] = str(value.toString())
+ elif col == 2:
+ v, ok = value.toInt()
+ if v == Qt.Checked:
+ self.dataFaces[row]['reverse'] = "on"
+ else:
+ self.dataFaces[row]['reverse'] = "off"
+ elif col == 5:
+ v, ok = value.toInt()
+ if v == Qt.Checked:
+ self.dataFaces[row]['semiconf'] = "on"
+ else:
+ self.dataFaces[row]['semiconf'] = "off"
+
+ if self.tag == "faces_join":
+ self.mdl.replaceJoinFaces(row+1, self.dataFaces[row])
+
+ elif self.tag == "faces_periodic":
+ self.mdl.replacePeriodicFaces(self.perio_name, self.dataFaces[row])
+
+ elif self.tag == "faces_syrthes":
+ self.mdl.replaceSyrthesFaces(self.dataFaces[row])
+
+ elif self.tag == "faces_select":
+ self.mdl.replaceSelectFaces(self.dataFaces[row])
+
+ log.debug("setData -> dataFaces = %s" % self.dataFaces)
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self):
+ """
+ Add an item in the QListView.
+ """
+ title = self.tr("Warning")
+
+ if self.tag == "faces_syrthes":
+ if self.mdl.getSyrthesFaces():
+ msg = self.tr("For Syrthes coupling, only a single faces selection is allowed.")
+ QMessageBox.information(self.parent, title, msg)
+ return
+
+ elif self.tag == "faces_select":
+ if self.mdl.getSelectFaces() or self.rowCount() == 1:
+ msg = self.tr("For interior faces selection, only a single criterion is allowed.")
+ QMessageBox.information(self.parent, title, msg)
+ return
+
+ elif self.tag == "faces_periodic":
+ if self.mdl.getPeriodicFaces(self.perio_name):
+ msg = self.tr("For a given periodicity, only a single faces selection is allowed.")
+ QMessageBox.information(self.parent, title, msg)
+ return
+
+ if self.tag == "faces_join":
+ self.mdl.addJoinFaces(self.default)
+
+ elif self.tag == "faces_periodic":
+ self.mdl.addPeriodicFaces(self.perio_name, self.default)
+
+ elif self.tag == "faces_syrthes":
+ self.mdl.addSyrthesFaces(self.default)
+
+ elif self.tag == "faces_select":
+ self.mdl.addSelectFaces(self.default)
+
+ self.dataFaces.append(self.default.copy())
+ log.debug("addItem -> dataFaces = %s" % self.dataFaces)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def delItem(self, row):
+ """
+ Delete an item from the QTableView.
+ """
+ log.debug("StandardItemModelFaces.delete row = %i %i" % (row, self.mdl.getJoinSelectionsNumber()))
+
+ if self.tag == "faces_join":
+ self.mdl.deleteJoinFaces(str(row+1))
+
+ elif self.tag == "faces_periodic":
+ self.mdl.deletePeriodicFaces(self.perio_name)
+
+ elif self.tag == "faces_syrthes":
+ self.mdl.deleteSyrthesFaces()
+
+ elif self.tag == "faces_select":
+ self.mdl.deleteSelectFaces()
+
+ del self.dataFaces[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class FacesSelectionView(QWidget, Ui_FacesSelectionForm):
+ """
+ """
+ def __init__(self, *args):
+ """
+ Constructor.
+ """
+ QWidget.__init__(self, *args)
+ Ui_FacesSelectionForm.__init__(self)
+ self.setupUi(self)
+
+ self.modelFaces = None
+ #self.modelFaces = StandardItemModelFaces(self)
+ #self.tableView.setModel(self.modelFaces)
+
+ delegateReferences = LineEditDelegateReferences(self.tableView)
+ self.tableView.setItemDelegateForColumn(0, delegateReferences)
+
+ delegateGroups = LineEditDelegateGroups(self.tableView)
+ self.tableView.setItemDelegateForColumn(1, delegateGroups)
+
+ delegateFraction = FractionPlanDelegate(self.tableView)
+ self.tableView.setItemDelegateForColumn(3, delegateFraction)
+
+ delegatePlan = FractionPlanDelegate(self.tableView)
+ self.tableView.setItemDelegateForColumn(4, delegatePlan)
+
+## self.tableView.resizeColumnsToContents()
+## self.tableView.resizeRowsToContents()
+ self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
+ self.tableView.setSelectionMode(QAbstractItemView.SingleSelection)
+
+ # Connections
+
+ self.connect(self.pushButtonNew, SIGNAL("clicked()"), self.slotAddItem)
+ self.connect(self.pushButtonDelete, SIGNAL("clicked()"), self.slotDelItem)
+
+
+# def populateModel(self, model, tag):
+# self.modelFaces.populateModel(model, tag)
+#
+#
+# def setPeriodicityName(self, perio_name):
+# self.modelFaces.perio_name = perio_name
+
+
+ @pyqtSignature("")
+ def slotAddItem(self):
+ """
+ Create a new faces selection.
+ """
+ self.modelFaces.addItem()
+
+
+ @pyqtSignature("")
+ def slotDelItem(self):
+ """
+ Delete a single selectded row.
+ """
+ for index in self.tableView.selectionModel().selectedIndexes():
+ self.modelFaces.delItem(index.row())
+ break
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ import sys
+ app = QApplication(sys.argv)
+ FacesSelectionView = FacesSelectionView(app)
+ FacesSelectionView.show()
+ sys.exit(app.exec_())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/FluidCharacteristicsForm.ui b/gui/Pages/FluidCharacteristicsForm.ui
new file mode 100644
index 0000000..ab6c55e
--- /dev/null
+++ b/gui/Pages/FluidCharacteristicsForm.ui
@@ -0,0 +1,628 @@
+<ui version="4.0" >
+ <class>FluidCharacteristicsForm</class>
+ <widget class="QWidget" name="FluidCharacteristicsForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>502</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxRho" >
+ <property name="title" >
+ <string>Density</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>53</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QComboBox" name="comboBoxRho" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IROVAR</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonRho" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <widget class="QLabel" name="labelRho" >
+ <property name="text" >
+ <string>reference</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelVarRho" >
+ <property name="font" >
+ <font>
+ <family>Symbol</family>
+ </font>
+ </property>
+ <property name="text" >
+ <string>r</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditRho" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: RO0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitRho" >
+ <property name="text" >
+ <string>kg/m<sup>3</sup></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>53</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxMu" >
+ <property name="title" >
+ <string>Viscosity</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_8" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_7" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6" >
+ <item>
+ <widget class="QComboBox" name="comboBoxMu" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVIVAR</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonMu" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5" >
+ <item>
+ <widget class="QLabel" name="labelMu" >
+ <property name="text" >
+ <string>reference</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelVarMu" >
+ <property name="font" >
+ <font>
+ <family>Symbol</family>
+ </font>
+ </property>
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditMu" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: VISCL0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitMu" >
+ <property name="text" >
+ <string>Pa.s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxCp" >
+ <property name="title" >
+ <string>Specific heat</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_12" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>50</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_11" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_10" >
+ <item>
+ <widget class="QComboBox" name="comboBoxCp" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICP</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonCp" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_9" >
+ <item>
+ <widget class="QLabel" name="labelCp" >
+ <property name="text" >
+ <string>reference</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelVarCp" >
+ <property name="text" >
+ <string>Cp</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditCp" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: CP0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitCp" >
+ <property name="text" >
+ <string>J/kg/K</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>50</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxAl" >
+ <property name="title" >
+ <string>Thermal conductivity</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_16" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>53</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_15" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_14" >
+ <item>
+ <widget class="QComboBox" name="comboBoxAl" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISLS</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonAl" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_13" >
+ <item>
+ <widget class="QLabel" name="labelAl" >
+ <property name="text" >
+ <string>reference</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelVarAl" >
+ <property name="font" >
+ <font>
+ <family>Symbol</family>
+ </font>
+ </property>
+ <property name="text" >
+ <string>l</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditAl" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: VISLS0*CP0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitAl" >
+ <property name="text" >
+ <string>W/m/K</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>52</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>comboBoxRho</tabstop>
+ <tabstop>lineEditRho</tabstop>
+ <tabstop>comboBoxMu</tabstop>
+ <tabstop>lineEditMu</tabstop>
+ <tabstop>comboBoxCp</tabstop>
+ <tabstop>lineEditCp</tabstop>
+ <tabstop>comboBoxAl</tabstop>
+ <tabstop>lineEditAl</tabstop>
+ </tabstops>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/FluidCharacteristicsModel.py b/gui/Pages/FluidCharacteristicsModel.py
new file mode 100644
index 0000000..70edb55
--- /dev/null
+++ b/gui/Pages/FluidCharacteristicsModel.py
@@ -0,0 +1,453 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Page for the physical properties of the fluid.
+These properties can be reference value or initial value
+
+This module contens the following classes and function:
+- FluidCaracteristicsModel
+- FluidCaracteristicsModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import XMLmodel, ModelTest
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class FluidCharacteristicsModel(Variables, Model):
+ """
+ Class to manipulate Molecular Properties in xml file.
+ """
+ def __init__(self, case):
+ """FluidCharacteristicsModel Constuctor."""
+ self.case = case
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_prop = self.case.xmlGetNode('physical_properties')
+ self.node_fluid = self.node_prop.xmlInitNode('fluid_properties')
+
+ self.node_density = self.setNewFluidProperty(self.node_fluid, 'density')
+ self.node_viscosity = self.setNewFluidProperty(self.node_fluid, 'molecular_viscosity')
+ self.node_heat = self.setNewFluidProperty(self.node_fluid, 'specific_heat')
+ self.node_cond = self.setNewFluidProperty(self.node_fluid, 'thermal_conductivity')
+
+ self.nodeList = (self.node_density, self.node_viscosity,
+ self.node_heat, self.node_cond )
+
+
+ def __nodeFromTag(self, name):
+ """
+ Private method : return node with attibute name 'name'
+ """
+ for node in self.nodeList:
+ if node['name'] == name:
+ return node
+
+
+ def defaultFluidCharacteristicsValues(self):
+ """
+ Return in a dictionnary which contains default values.
+ (also called by CoalCombustionModel)
+ """
+ default = {}
+
+ #Initial values for properties: 20 Celsius degrees air at atmospheric pressure
+
+ default['density'] = 1.17862
+ default['molecular_viscosity'] = 1.83e-05
+ default['specific_heat'] = 1017.24
+ default['thermal_conductivity'] = 0.02495
+
+ return default
+
+
+ def getThermalModel(self):
+ """
+ Return node and model of choosen thermophysical model
+ """
+ modelList = []
+ node1 = self.node_models.xmlGetNode('gas_combustion', 'model')
+ node2 = self.node_models.xmlGetNode('pulverized_coal', 'model')
+ node3 = self.node_models.xmlGetNode('joule_effect', 'model')
+ node4 = self.node_models.xmlGetNode('thermal_scalar', 'model')
+ node5 = self.node_models.xmlGetNode('atmospheric_flows', 'model')
+
+ for node in (node1, node2, node3, node4, node5):
+ if node:
+ if node['model'] == "":
+ node['model'] = "off"
+ if node['model'] != 'off':
+ modelList.append(node['model'])
+ nodeThermal = node
+
+ if len(modelList) > 1:
+ raise ValueError, "Erreur de model thermique dans le fichier XML"
+ elif modelList == []:
+ modelList.append('off')
+ nodeThermal = None
+
+ return nodeThermal, modelList[0]
+
+
+ def getThermoPhysicalModel(self):
+ """
+ Return values of attribute "model" of all thermophysical model nodes.
+ (also called by NumericalParamGlobalView and TimeStepView)
+ """
+ d = {}
+ d['joule_effect'] = 'off'
+ d['gas_combustion'] = 'off'
+ d['pulverized_coal'] = 'off'
+ d['thermal_scalar'] = 'off'
+ d['atmospheric_flows'] = 'off'
+
+ node, model = self.getThermalModel()
+ if node:
+ d[node.el.tagName] = model
+
+ return d['atmospheric_flows'], \
+ d['joule_effect'], \
+ d['thermal_scalar'], \
+ d['gas_combustion'], \
+ d['pulverized_coal']
+
+
+ def getInitialValue(self, tag):
+ """
+ Return initial value of the markup tag : 'density', or
+ 'molecular_viscosity', or 'specific_heat'or 'thermal_conductivity'
+ """
+ self.isInList(tag, ('density', 'molecular_viscosity',
+ 'specific_heat', 'thermal_conductivity'))
+ node = self.node_fluid.xmlGetNode('property', name=tag)
+ pp = node.xmlGetDouble('initial_value')
+ if pp == None:
+ pp = self.defaultFluidCharacteristicsValues()[tag]
+ self.setInitialValue(tag, pp)
+ return pp
+
+
+ def setInitialValue(self, tag, val):
+ """
+ Put initial value for the markup tag : 'density', or
+ 'molecular_viscosity', or 'specific_heat'or 'thermal_conductivity'
+ """
+ self.isInList(tag, ('density', 'molecular_viscosity',
+ 'specific_heat', 'thermal_conductivity'))
+ self.isGreater(val, 0.)
+ node = self.node_fluid.xmlGetNode('property', name=tag)
+ node.xmlSetData('initial_value', val)
+
+
+ def getInitialValueDensity(self):
+ """Return initial value of density"""
+ return self.getInitialValue('density')
+
+
+ def setInitialValueDensity(self, val):
+ """Put initial value for density"""
+ self.setInitialValue('density', val)
+
+
+ def getInitialValueViscosity(self):
+ """Return initial value of viscosity"""
+ return self.getInitialValue('molecular_viscosity')
+
+
+ def setInitialValueViscosity(self, val):
+ """Put initial value for viscosity"""
+ self.setInitialValue('molecular_viscosity', val)
+
+
+ def getInitialValueHeat(self):
+ """Return initial value of specific heat"""
+ return self.getInitialValue('specific_heat')
+
+
+ def setInitialValueHeat(self, val):
+ """Put initial value for specific heat"""
+ self.setInitialValue('specific_heat', val)
+
+
+ def getInitialValueCond(self):
+ """Return initial value of conductivity"""
+ return self.getInitialValue('thermal_conductivity')
+
+
+ def setInitialValueCond(self, val):
+ """Put initial value for conductivity"""
+ self.setInitialValue('thermal_conductivity', val)
+
+
+ def getFormula(self, tag):
+ """
+ Return a formula for I{tag} 'density', 'molecular_viscosity',
+ 'specific_heat' or 'thermal_conductivity'
+ """
+ self.isInList(tag, ('density', 'molecular_viscosity',
+ 'specific_heat', 'thermal_conductivity'))
+ node = self.node_fluid.xmlGetNode('property', name=tag)
+ return node.xmlGetString('formula')
+
+
+ def setFormula(self, tag, str):
+ """
+ Gives a formula for 'density', 'molecular_viscosity',
+ 'specific_heat'or 'thermal_conductivity'
+ """
+ self.isInList(tag, ('density', 'molecular_viscosity',
+ 'specific_heat', 'thermal_conductivity'))
+ node = self.node_fluid.xmlGetNode('property', name=tag)
+ node.xmlSetData('formula', str)
+
+
+ def getPropertyMode(self, tag):
+ """Return choice of node I{tag}. Choice is constant or variable"""
+ self.isInList(tag, ('density', 'molecular_viscosity',
+ 'specific_heat', 'thermal_conductivity'))
+ node = self.__nodeFromTag(tag)
+ c = node['choice']
+ self.isInList(c, ('constant', 'user_law', 'variable'))
+ return c
+
+
+ def setPropertyMode(self, tag, choice):
+ """Put choice in xml file's node I{tag}"""
+ self.isInList(tag, ('density', 'molecular_viscosity',
+ 'specific_heat', 'thermal_conductivity'))
+ self.isInList(choice, ('constant', 'user_law', 'variable'))
+
+ node = self.__nodeFromTag(tag)
+ node['choice'] = choice
+
+ if choice == 'constant':
+ node.xmlInitNode('listing_printing')['status'] = 'off'
+ node.xmlInitNode('postprocessing_recording')['status'] = 'off'
+
+ if tag == 'density':
+ from TimeStepModel import TimeStepModel
+ TimeStepModel(self.case).RemoveThermalTimeStepNode()
+ del TimeStepModel
+ else:
+ if node.xmlGetNode('listing_printing'):
+ node.xmlRemoveChild('listing_printing')
+ if node.xmlGetNode('postprocessing_recording'):
+ node.xmlRemoveChild('postprocessing_recording')
+
+
+## def RemoveThermoConductNode(self):
+## """Remove balise property for thermal_conductivity"""
+## self.node_fluid.xmlRemoveChild('property', name='thermal_conductivity')
+
+
+
+#-------------------------------------------------------------------------------
+# FluidCharacteristicsModel test case
+#-------------------------------------------------------------------------------
+
+
+class FluidCharacteristicsModelTestCase(ModelTest):
+ """
+ """
+ def checkFluidCharacteristicsInstantiation(self):
+ """Check whether the FluidCaracteristicsModel class could be instantiated"""
+ model = None
+ model = FluidCharacteristicsModel(self.case)
+ assert model != None, 'Could not instantiate FluidCaracteristicsModel'
+
+ def checkGetThermoPhysicalModel(self):
+ """Check whether thermal physical models could be get"""
+ mdl = FluidCharacteristicsModel(self.case)
+ from Pages.ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+ assert mdl.getThermoPhysicalModel() == ('off', 'off', 'temperature_celsius', 'off', 'off'),\
+ 'Could not get thermophysical models in FluidCaracteristicsModel'
+
+ def checkSetandGetInitialValue(self):
+ """Check whether the initial value for the properties could be set and get"""
+ mdl = FluidCharacteristicsModel(self.case)
+ mdl.setInitialValue('density', 123.0)
+ mdl.setInitialValue('molecular_viscosity', 1.5e-5)
+ mdl.setInitialValue('specific_heat', 1212)
+ mdl.setInitialValue('thermal_conductivity', 0.04)
+ doc = '''<fluid_properties>
+ <property choice="constant" label="Density" name="density">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>123</initial_value>
+ </property>
+ <property choice="constant" label="Lam. vis" name="molecular_viscosity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>1.5e-05</initial_value>
+ </property>
+ <property choice="constant" label="Sp. heat" name="specific_heat">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>1212</initial_value>
+ </property>
+ <property choice="constant" label="Th. cond" name="thermal_conductivity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>0.04</initial_value>
+ </property>
+ </fluid_properties>'''
+ assert mdl.node_fluid == self.xmlNodeFromString(doc),\
+ 'Could not set initial value for properties in FluidCharacteristicsModel model'
+ assert mdl.getInitialValue('specific_heat') == 1212.,\
+ 'Could not get initial value for properties in FluidCharacteristicsModel model'
+
+ def checkSetandGetInitialValueDensity(self):
+ """Check whether the initial value for density could be set and get"""
+ mdl = FluidCharacteristicsModel(self.case)
+ mdl.setInitialValueDensity(89.98)
+ doc = '''<property choice="constant" label="Density" name="density">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>89.98</initial_value>
+ </property>'''
+ assert mdl.node_density == self.xmlNodeFromString(doc),\
+ 'Could not set initial value of density'
+ assert mdl.getInitialValueDensity() == 89.98,\
+ 'Could not get initial value of density'
+
+ def checkSetandGetInitialValueViscosity(self):
+ """Check whether the initial value for molecular_viscosity could be set and get"""
+ mdl = FluidCharacteristicsModel(self.case)
+ mdl.setInitialValueViscosity(1.2e-4)
+ doc = '''<property choice="constant" label="Lam. vis" name="molecular_viscosity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>1.2e-4</initial_value>
+ </property>'''
+ assert mdl.node_viscosity == self.xmlNodeFromString(doc),\
+ 'Could not set initial value of molecular_viscosity'
+ assert mdl.getInitialValueViscosity() == 1.2e-4,\
+ 'Could not get initial value of molecular_viscosity'
+
+ def checkSetandGetInitialValueHeat(self):
+ """Check whether the initial value for specific_heat could be set and get"""
+ mdl = FluidCharacteristicsModel(self.case)
+ mdl.setInitialValueHeat(456.9)
+ doc = '''<property choice="constant" label="Sp. heat" name="specific_heat">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>456.9</initial_value>
+ </property>'''
+ assert mdl.node_heat == self.xmlNodeFromString(doc),\
+ 'Could not set initial value of specific_heat'
+ assert mdl.getInitialValueHeat() == 456.9,\
+ 'Could not get initial value of specific_heat'
+
+ def checkSetandGetInitialValueCond(self):
+ """Check whether the initial value for thermal_conductivity could be set and get"""
+ mdl = FluidCharacteristicsModel(self.case)
+ mdl.setInitialValueCond(456.9)
+ doc = '''<property choice="constant" label="Th. cond" name="thermal_conductivity">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ <initial_value>456.9</initial_value>
+ </property>'''
+ assert mdl.node_cond == self.xmlNodeFromString(doc),\
+ 'Could not set initial value of thermal_conductivity'
+ assert mdl.getInitialValueCond() == 456.9,\
+ 'Could not get initial value of thermal_conductivity'
+
+ def checkSetandGetPropertyMode(self):
+ """Check whether choice constant or variable could be set and get"""
+ mdl = FluidCharacteristicsModel(self.case)
+ mdl.setPropertyMode('density', 'variable')
+ doc = '''<property choice="variable" label="Density" name="density">
+ <initial_value>1.17862</initial_value>
+ </property>'''
+ assert mdl.node_density == self.xmlNodeFromString(doc),\
+ 'Could not set choice constant or variable for property'
+ assert mdl.getPropertyMode('density') == 'variable',\
+ 'Could not get choice constant or variable for property'
+
+ mdl.setPropertyMode('density', 'constant')
+ doc2 = '''<property choice="constant" label="Density" name="density">
+ <initial_value>1.17862</initial_value>
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ </property>'''
+ assert mdl.node_density == self.xmlNodeFromString(doc2),\
+ 'Could not set listing and recording status for property and remove this nodes'
+
+## def checkRemoveThermoConductNode(self):
+## """Check whether node thermal conductivity could be removed"""
+## mdl = FluidCharacteristicsModel(self.case)
+## mdl.setPropertyMode('density', 'variable')
+## mdl.setPropertyMode('molecular_viscosity', 'variable')
+## mdl.setPropertyMode('specific_heat', 'variable')
+## mdl.RemoveThermoConductNode()
+## doc = '''<fluid_properties>
+## <property choice="variable" label="Density" name="density">
+## <initial_value>1.17862</initial_value>
+## </property>
+## <property choice="variable" label="Lam. vis" name="molecular_viscosity">
+## <initial_value>1.83e-05</initial_value>
+## </property>
+## <property choice="variable" label="Sp. heat" name="specific_heat">
+## <initial_value>1017.24</initial_value>
+## </property>
+## </fluid_properties>'''
+## assert mdl.node_fluid == self.xmlNodeFromString(doc),\
+## 'Could not remove thermal_conductivity node'
+
+
+def suite():
+ testSuite = unittest.makeSuite(FluidCharacteristicsModelTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print __file__
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/FluidCharacteristicsView.py b/gui/Pages/FluidCharacteristicsView.py
new file mode 100644
index 0000000..ea3acb6
--- /dev/null
+++ b/gui/Pages/FluidCharacteristicsView.py
@@ -0,0 +1,420 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Page for the physical properties of the fluid.
+These properties can be reference value or initial value
+
+This module contains the following classes and function:
+- FluidCharacteristicsView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+try:
+ import mei
+ _have_mei = True
+except:
+ _have_mei = False
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import DoubleValidator, ComboModel, setGreenColor
+from FluidCharacteristicsForm import Ui_FluidCharacteristicsForm
+from FluidCharacteristicsModel import FluidCharacteristicsModel
+from DefineUserScalarsModel import DefineUserScalarsModel
+if _have_mei:
+ from QMeiEditorView import QMeiEditorView
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("FluidCharacteristicsView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class FluidCharacteristicsView(QWidget, Ui_FluidCharacteristicsForm):
+ """
+ Class to open Molecular Properties Page.
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_FluidCharacteristicsForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = FluidCharacteristicsModel(self.case)
+
+ list = [('density', 'Rho'),
+ ('molecular_viscosity', 'Mu'),
+ ('specific_heat', 'Cp'),
+ ('thermal_conductivity', 'Al')]
+
+ self.list_scalars = []
+ m_sca = DefineUserScalarsModel(self.case)
+ s = m_sca.getThermalScalarLabel()
+ if s:
+ self.list_scalars.append((s, self.tr("Thermal scalar")))
+ for s in m_sca.getUserScalarLabelsList():
+ self.list_scalars.append((s, self.tr("Additional scalar")))
+
+ # Combo models
+
+ self.modelRho = ComboModel(self.comboBoxRho, 3, 1)
+ self.modelMu = ComboModel(self.comboBoxMu, 3, 1)
+ self.modelCp = ComboModel(self.comboBoxCp, 3, 1)
+ self.modelAl = ComboModel(self.comboBoxAl, 3, 1)
+
+ self.modelRho.addItem(self.tr('constant'), 'constant')
+ self.modelRho.addItem(self.tr('user law'), 'user_law')
+ self.modelRho.addItem(self.tr('user subroutine (usphyv)'), 'variable')
+ self.modelMu.addItem(self.tr('constant'), 'constant')
+ self.modelMu.addItem(self.tr('user law'), 'user_law')
+ self.modelMu.addItem(self.tr('user subroutine (usphyv)'), 'variable')
+ self.modelCp.addItem(self.tr('constant'), 'constant')
+ self.modelCp.addItem(self.tr('user law'), 'user_law')
+ self.modelCp.addItem(self.tr('user subroutine (usphyv)'), 'variable')
+ self.modelAl.addItem(self.tr('constant'), 'constant')
+ self.modelAl.addItem(self.tr('user law'), 'user_law')
+ self.modelAl.addItem(self.tr('user subroutine (usphyv)'), 'variable')
+
+ # Connections
+
+ self.connect(self.comboBoxRho, SIGNAL("activated(const QString&)"), self.slotStateRho)
+ self.connect(self.comboBoxMu, SIGNAL("activated(const QString&)"), self.slotStateMu)
+ self.connect(self.comboBoxCp, SIGNAL("activated(const QString&)"), self.slotStateCp)
+ self.connect(self.comboBoxAl, SIGNAL("activated(const QString&)"), self.slotStateAl)
+ self.connect(self.lineEditRho, SIGNAL("textChanged(const QString &)"), self.slotRho)
+ self.connect(self.lineEditMu, SIGNAL("textChanged(const QString &)"), self.slotMu)
+ self.connect(self.lineEditCp, SIGNAL("textChanged(const QString &)"), self.slotCp)
+ self.connect(self.lineEditAl, SIGNAL("textChanged(const QString &)"), self.slotAl)
+ if _have_mei:
+ self.connect(self.pushButtonRho, SIGNAL("clicked()"), self.slotFormulaRho)
+ self.connect(self.pushButtonMu, SIGNAL("clicked()"), self.slotFormulaMu)
+ self.connect(self.pushButtonCp, SIGNAL("clicked()"), self.slotFormulaCp)
+ self.connect(self.pushButtonAl, SIGNAL("clicked()"), self.slotFormulaAl)
+ else:
+ for tag, symbol in list:
+ getattr(self, "pushButton" + symbol).setEnabled(False)
+ getattr(self, "model" + symbol).disableItem(str_model="user_law")
+ if self.mdl.getPropertyMode(tag) == 'user_law':
+ self.__changeChoice("constant", symbol, tag)
+
+ # Validators
+
+ validatorRho = DoubleValidator(self.lineEditRho, min = 0.0)
+ validatorMu = DoubleValidator(self.lineEditMu, min = 0.0)
+ validatorCp = DoubleValidator(self.lineEditCp, min = 0.0)
+ validatorAl = DoubleValidator(self.lineEditAl, min = 0.0)
+
+ validatorRho.setExclusiveMin(True)
+ validatorMu.setExclusiveMin(True)
+ validatorCp.setExclusiveMin(True)
+ validatorAl.setExclusiveMin(True)
+
+ self.lineEditRho.setValidator(validatorRho)
+ self.lineEditMu.setValidator(validatorMu)
+ self.lineEditCp.setValidator(validatorCp)
+ self.lineEditAl.setValidator(validatorAl)
+
+ # Standard Widget initialization
+
+ for tag, symbol in list:
+ __model = getattr(self, "model" + symbol)
+ __line = getattr(self, "lineEdit" + symbol)
+ __button = getattr(self, "pushButton" + symbol)
+ __label = getattr(self, "label" + symbol)
+ c = self.mdl.getPropertyMode(tag)
+ __model.setItem(str_model=c)
+ if c == 'user_law':
+ __button.setEnabled(True)
+ __label.setText(QString(self.tr("Reference value")))
+ else:
+ __button.setEnabled(False)
+ __label.setText(QString(self.tr("Reference value")))
+ self.mdl.getInitialValue(tag)
+ __line.setText(QString(str(self.mdl.getInitialValue(tag))))
+
+ # Particular Widget initialization taking into account of "Calculation Features"
+
+ mdl_atmo, mdl_joule, mdl_thermal, mdl_gas, mdl_coal = self.mdl.getThermoPhysicalModel()
+
+ # no 'thermal_conductivity' if not Joule and not Thermal scalar and not
+ if mdl_joule == 'off' and mdl_thermal == 'off' and mdl_atmo == 'off':
+ self.groupBoxAl.hide()
+
+ for tag, symbol in list:
+ __model = getattr(self, "model" + symbol)
+ __line = getattr(self, "lineEdit" + symbol)
+ __button = getattr(self, "pushButton" + symbol)
+ __label = getattr(self, "label" + symbol)
+ __combo = getattr(self, "comboBox" + symbol)
+
+ # Gas or coal combustion
+ if mdl_gas != 'off' or mdl_coal != 'off':
+ if tag == 'density':
+ __model.setItem(str_model='user_law')
+ __combo.setEnabled(False)
+ __button.setEnabled(False)
+ self.mdl.setPropertyMode(tag, 'user_law')
+ __label.setText(QString(self.tr("Calculation by\n perfect gas law")))
+ __line.setText(QString(str("")))
+ __line.setEnabled(False)
+ else:
+ __model.setItem(str_model='constant')
+ self.mdl.setPropertyMode(tag, 'constant')
+
+ # Joule
+ if mdl_joule != 'off':
+ __model.setItem(str_model='user_law')
+ __model.disableItem(str_model='constant')
+ self.mdl.setPropertyMode(name, 'user_law')
+
+ # Atmospheric Flows
+ if mdl_atmo != 'off':
+ if tag == 'density':
+ __model.disableItem(str_model='constant')
+
+
+ @pyqtSignature("const QString &")
+ def slotStateRho(self, text):
+ """
+ Method to call 'getState' with correct arguements for 'rho'
+ """
+ self.__changeChoice(str(text), 'Rho', 'density')
+
+
+ @pyqtSignature("const QString &")
+ def slotStateMu(self, text):
+ """
+ Method to call 'getState' with correct arguements for 'Mu'
+ """
+ self.__changeChoice(str(text), 'Mu', 'molecular_viscosity')
+
+
+ @pyqtSignature("const QString &")
+ def slotStateCp(self, text):
+ """
+ Method to call 'getState' with correct arguements for 'Cp'
+ """
+ self.__changeChoice(str(text), 'Cp', 'specific_heat')
+
+
+ @pyqtSignature("const QString &")
+ def slotStateAl(self, text):
+ """
+ Method to call 'getState' with correct arguements for 'Al'
+ """
+ self.__changeChoice(str(text), 'Al', 'thermal_conductivity')
+
+
+ def __changeChoice(self, text, sym, tag):
+ """
+ Input variable state
+ """
+ __model = getattr(self, "model" + sym)
+ __line = getattr(self, "lineEdit" + sym)
+ __combo = getattr(self, "comboBox" + sym)
+ __label = getattr(self, "label" + sym)
+ __button = getattr(self, "pushButton" + sym)
+
+ choice = __model.dicoV2M[text]
+ log.debug("__changeChoice -> %s, %s" % (text, choice))
+
+ if choice != 'user_law':
+ __button.setEnabled(False)
+ setGreenColor(__button, False)
+ else:
+ __button.setEnabled(True)
+ setGreenColor(__button, True)
+
+ self.mdl.setPropertyMode(tag, choice)
+
+
+ @pyqtSignature("const QString &")
+ def slotRho(self, text):
+ """
+ Update the density
+ """
+ rho, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setInitialValueDensity(rho)
+
+
+ @pyqtSignature("const QString &")
+ def slotMu(self, text):
+ """
+ Update the molecular viscosity
+ """
+ mu, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setInitialValueViscosity(mu)
+
+
+ @pyqtSignature("const QString &")
+ def slotCp(self, text):
+ """
+ Update the specific heat
+ """
+ cp, ok = self.lineEditCp.text().toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setInitialValueHeat(cp)
+
+
+ @pyqtSignature("const QString &")
+ def slotAl(self, text):
+ """
+ Update the thermal conductivity
+ """
+ al, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setInitialValueCond(al)
+
+
+ @pyqtSignature("")
+ def slotFormulaRho(self):
+ """
+ User formula for density
+ """
+ exp = self.mdl.getFormula('density')
+ if not exp:
+ exp = "rho ="
+ req = [('rho', 'Density')]
+ exa = "rho = 3*2"
+ setGreenColor(self.sender(), False)
+
+ dialog = QMeiEditorView(self,expression = exp,
+ required = req,
+ symbols = self.list_scalars,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaRho -> %s" % str(result))
+ self.mdl.setFormula('density', result)
+ setGreenColor(self.sender(), False)
+
+
+ @pyqtSignature("")
+ def slotFormulaMu(self):
+ """
+ User formula for molecular viscosity
+ """
+ exp = self.mdl.getFormula('molecular_viscosity')
+ if not exp:
+ exp = "mu ="
+ req = [('mu', 'Molecular Viscosity')]
+ exa = "mu = 3*2"
+
+ dialog = QMeiEditorView(self,expression = exp,
+ required = req,
+ symbols = self.list_scalars,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaMu -> %s" % str(result))
+ self.mdl.setFormula('molecular_viscosity', result)
+ setGreenColor(self.sender(), False)
+
+
+ @pyqtSignature("")
+ def slotFormulaCp(self):
+ """
+ User formula for specific heat
+ """
+ exp = self.mdl.getFormula('specific_heat')
+ if not exp:
+ exp = "cp ="
+ req = [('cp', 'Specific heat')]
+ exa = "cp = 3*2"
+
+ dialog = QMeiEditorView(self,expression = exp,
+ required = req,
+ symbols = self.list_scalars,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaRho -> %s" % str(result))
+ self.mdl.setFormula('specific_heat', result)
+ setGreenColor(self.sender(), False)
+
+
+ @pyqtSignature("")
+ def slotFormulaAl(self):
+ """
+ User formula for thermal conductivity
+ """
+ exp = self.mdl.getFormula('thermal_conductivity')
+ if not exp:
+ exp = "lambda ="
+ req = [('lambda', 'Thermal conductivity')]
+ exa = "lambda = 3*2"
+
+ dialog = QMeiEditorView(self,expression = exp,
+ required = req,
+ symbols = self.list_scalars,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaRho -> %s" % str(result))
+ self.mdl.setFormula('thermal_conductivity', result)
+ setGreenColor(self.sender(), False)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/FluidStructureInteractionAdvancedOptionsDialogForm.ui b/gui/Pages/FluidStructureInteractionAdvancedOptionsDialogForm.ui
new file mode 100644
index 0000000..a1615e3
--- /dev/null
+++ b/gui/Pages/FluidStructureInteractionAdvancedOptionsDialogForm.ui
@@ -0,0 +1,329 @@
+<ui version="4.0" >
+ <class>FluidStructureInteractionAdvancedOptionsDialogForm</class>
+ <widget class="QDialog" name="FluidStructureInteractionAdvancedOptionsDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>319</width>
+ <height>287</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <spacer name="horizontalSpacer_8" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>30</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Displacements prediction:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Alpha<sub>d</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditDisplacementAlpha" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: AEXXST</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Beta<sub>d</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLineEdit" name="lineEditDisplacementBeta" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: BEXXST</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Stress prediction:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Alpha<sub>Force</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditStressAlpha" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: CFOPRE</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer name="horizontalSpacer_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxSynchronization" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IHISTR</string>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>Monitoring point synchronisation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_7" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>18</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <spacer name="horizontalSpacer_9" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>29</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <spacer name="verticalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>FluidStructureInteractionAdvancedOptionsDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>FluidStructureInteractionAdvancedOptionsDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/FluidStructureInteractionForm.ui b/gui/Pages/FluidStructureInteractionForm.ui
new file mode 100644
index 0000000..db5106a
--- /dev/null
+++ b/gui/Pages/FluidStructureInteractionForm.ui
@@ -0,0 +1,1146 @@
+<ui version="4.0" >
+ <class>FluidStructureInteractionForm</class>
+ <widget class="QWidget" name="FluidStructureInteractionForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>696</width>
+ <height>916</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5" >
+ <item rowspan="2" row="0" column="0" colspan="2" >
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Internal coupling with a simplified structure model</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxALE" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ <property name="acceptDrops" >
+ <bool>false</bool>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>false</bool>
+ </property>
+ <property name="title" >
+ <string>Internal coupling</string>
+ </property>
+ <property name="flat" >
+ <bool>false</bool>
+ </property>
+ <property name="checkable" >
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_11" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>7</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelNALIMX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NALIMX</string>
+ </property>
+ <property name="text" >
+ <string>Maximum number of sub-iterations for implicit
+coupling with internal structures</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditNALIMX" >
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NALIMX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelEPALIM" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: EPALIM</string>
+ </property>
+ <property name="text" >
+ <string>Relative precision for implicit coupling
+with internal structures</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLineEdit" name="lineEditEPALIM" >
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: EPALIM</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Advanced options</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QPushButton" name="pushButtonAdvanced" >
+ <property name="maximumSize" >
+ <size>
+ <width>36</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/preferences-system.png</normaloff>:/new/prefix1/icons/22x22/preferences-system.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Structures definition</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QTableView" name="tableInternalCoupling" />
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Initial position</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5" >
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditInitialDisplacementX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XSTR0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditInitialDisplacementY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XSTR0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_6" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditInitialDisplacementZ" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XSTR0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_7" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3" >
+ <property name="title" >
+ <string>Position of equilibrium</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6" >
+ <item>
+ <spacer name="horizontalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <widget class="QLabel" name="label_8" >
+ <property name="text" >
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditEquilibriumDisplacementX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XSTREQ</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_9" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_10" >
+ <property name="text" >
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditEquilibriumDisplacementY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XSTREQ</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_11" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_12" >
+ <property name="text" >
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditEquilibriumDisplacementZ" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XSTREQ</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_13" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_4" >
+ <property name="title" >
+ <string>Initial velocity</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_7" >
+ <item>
+ <spacer name="horizontalSpacer_7" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QLabel" name="label_14" >
+ <property name="text" >
+ <string>V<sub>X</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditInitialVelocityX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: VSTR0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_15" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_16" >
+ <property name="text" >
+ <string>V<sub>Y</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditInitialVelocityY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: VSTR0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_17" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_18" >
+ <property name="text" >
+ <string>V<sub>Z</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditInitialVelocityZ" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: VSTR0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_19" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_8" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_5" >
+ <property name="title" >
+ <string>Caracteristics of the structure</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_10" >
+ <item>
+ <spacer name="horizontalSpacer_9" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_20" >
+ <property name="minimumSize" >
+ <size>
+ <width>110</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XMSTRU</string>
+ </property>
+ <property name="text" >
+ <string>Mass matrix</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonMassMatrix" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XMSTRU</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_10" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_9" >
+ <item>
+ <spacer name="horizontalSpacer_11" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_21" >
+ <property name="minimumSize" >
+ <size>
+ <width>110</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XKSTRU</string>
+ </property>
+ <property name="text" >
+ <string>Stiffness matrix</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonStiffnessMatrix" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XKSTRU</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_12" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_8" >
+ <item>
+ <spacer name="horizontalSpacer_13" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_22" >
+ <property name="minimumSize" >
+ <size>
+ <width>110</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XCSTRU</string>
+ </property>
+ <property name="text" >
+ <string>Damping matrix</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDampingMatrix" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XCSTRU</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_14" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_8" >
+ <property name="title" >
+ <string>Force applied to the structure</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ <property name="checkable" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_12" >
+ <item>
+ <spacer name="horizontalSpacer_23" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonFluidForce" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: FORSTR</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_24" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>6</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>External coupling with Code_Aster</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_8" >
+ <item row="0" column="0" >
+ <spacer name="horizontalSpacer_21" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>126</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item rowspan="2" row="0" column="1" >
+ <widget class="QGroupBox" name="groupBox_9" >
+ <property name="title" >
+ <string>External coupling</string>
+ </property>
+ <property name="checkable" >
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5" >
+ <item>
+ <widget class="QCheckBox" name="checkBoxPostSynchronization" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISYNCP</string>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>Fluid-structure post-treatement synchronisation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_10" >
+ <property name="title" >
+ <string>Structures definition</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_7" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout_4" >
+ <item>
+ <widget class="QTableView" name="tableExternalCoupling" />
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_11" >
+ <property name="title" >
+ <string>Blocage des DDL de force:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_6" >
+ <item row="0" column="0" >
+ <spacer name="horizontalSpacer_15" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBoxDDLX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ASDDLF</string>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>DDLX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer name="horizontalSpacer_16" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item rowspan="2" row="1" column="0" >
+ <spacer name="horizontalSpacer_18" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QCheckBox" name="checkBoxDDLY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ASDDLF</string>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>DDLY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <spacer name="horizontalSpacer_17" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item rowspan="2" row="2" column="1" >
+ <widget class="QCheckBox" name="checkBoxDDLZ" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ASDDLF</string>
+ </property>
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>DDLZ</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <spacer name="horizontalSpacer_19" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="2" >
+ <spacer name="horizontalSpacer_20" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <spacer name="horizontalSpacer_22" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>126</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>403</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/FluidStructureInteractionModel.py b/gui/Pages/FluidStructureInteractionModel.py
new file mode 100644
index 0000000..a687194
--- /dev/null
+++ b/gui/Pages/FluidStructureInteractionModel.py
@@ -0,0 +1,443 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- FluidStructureInteractionModel
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+
+
+#-------------------------------------------------------------------------------
+# Constante class
+#-------------------------------------------------------------------------------
+class Constantes:
+ """
+ Define class that manage constantes
+
+ This class is especially useful when we need constante string identifier.
+ Indeed, if the constante value must be changed, the changes is done at
+ one place
+
+ ### example
+ const = Constantes()
+
+ # define constante 'a'
+ const.a = 10
+
+ # raise Exception, "Cannot reassign constant a"
+ const.a = 20
+ """
+ def __getattr__(self, attr):
+ """
+ Get an attributs
+ """
+ try:
+ return self.__dict__[attr]
+ except(KeyError):
+ raise AttributeError, 'A instance has no attribute %s' % attr
+
+
+ def __setattr__(self, attr, value):
+ """
+ Set an attributs
+ """
+ if attr in self.__dict__.keys():
+ raise Exception, "Cannot reassign constant %s" % attr
+ else:
+ self.__dict__[attr] = value
+
+
+#-------------------------------------------------------------------------------
+# Constante class
+#-------------------------------------------------------------------------------
+const = Constantes()
+
+const.max_iterations_implicitation = 'max_iterations_implicitation'
+const.implicitation_precision = 'implicitation_precision'
+const.displacement_prediction_alpha = 'displacement_prediction_alpha'
+const.displacement_prediction_beta = 'displacement_prediction_beta'
+const.stress_prediction_alpha = 'stress_prediction_alpha'
+const.external_coupling_post_synchronization = 'external_coupling_post_synchronization'
+const.monitor_point_synchronisation = 'monitor_point_synchronisation'
+
+
+#-------------------------------------------------------------------------------
+# Mobil Mesh model class
+#-------------------------------------------------------------------------------
+
+class FluidStructureInteractionModel(Model):
+ """
+ Manage the input/output markups in the xml doc about mobil mesh
+ """
+
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.__case = case
+
+ self.__node_models = case.xmlGetNode('thermophysical_models')
+ self.__node_ale = self.__node_models.xmlInitChildNode('ale_method', 'status')
+
+ self.__defaults = {}
+ self.__defaults[const.max_iterations_implicitation] = 1
+ self.__defaults[const.implicitation_precision] = 1e-05
+ self.__defaults[const.displacement_prediction_alpha] = 0.5
+ self.__defaults[const.displacement_prediction_beta] = 0
+ self.__defaults[const.stress_prediction_alpha] = 2
+ self.__defaults[const.external_coupling_post_synchronization] = 'off'
+ self.__defaults[const.monitor_point_synchronisation] = 'off'
+
+
+ #------------------------------------------------------------------
+ # MaxIterations
+ #------------------------------------------------------------------
+ def setMaxIterations(self, value):
+ """
+ Set value of maximum of iteration if implicitation into xml file.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 1)
+ self.__node_ale.xmlSetData(const.max_iterations_implicitation, value)
+
+
+ def getMaxIterations(self):
+ """
+ Get value of maximum of iteration if implicitation from xml file.
+ """
+ return self.__getIntData(const.max_iterations_implicitation,
+ self.setMaxIterations )
+
+
+ #------------------------------------------------------------------
+ # Precision
+ #------------------------------------------------------------------
+ def setPrecision(self, value):
+ """
+ Set value of precision of implicitation into xml file.
+ """
+ self.isGreater(value, 0.0)
+ self.__node_ale.xmlSetData(const.implicitation_precision, value)
+
+
+ def getPrecision(self):
+ """
+ Get value of precision of implicitation from xml file.
+ """
+ return self.__getDoubleData(const.implicitation_precision,
+ self.setPrecision )
+
+ #------------------------------------------------------------------
+ # ExternalCouplingPostSynchronization
+ #------------------------------------------------------------------
+ def setExternalCouplingPostSynchronization(self, value):
+ """
+ Set value of stress prediction alpha into xml file.
+ """
+ self.__setOnOffXML(const.external_coupling_post_synchronization, value)
+
+
+ def getExternalCouplingPostSynchronization(self):
+ """
+ Get value of external coupling post syncrhonization from xml file.
+ """
+ return self.__getOnOffXML(const.external_coupling_post_synchronization,
+ self.setExternalCouplingPostSynchronization)
+
+
+ #------------------------------------------------------------------
+ # DisplacementPredictionAlpha
+ #------------------------------------------------------------------
+ def setDisplacementPredictionAlpha(self, value):
+ """
+ Set value of isplacement prediction alpha into xml file.
+ """
+ self.__node_ale.xmlSetData(const.displacement_prediction_alpha, value)
+
+
+ def getDisplacementPredictionAlpha(self):
+ """
+ Get value of displacement prediction alpha from xml file.
+ """
+ return self.__getDoubleData(const.displacement_prediction_alpha,
+ self.setDisplacementPredictionAlpha )
+
+
+ #------------------------------------------------------------------
+ # DisplacementPredictionBeta
+ #------------------------------------------------------------------
+ def setDisplacementPredictionBeta(self, value):
+ """
+ Set value of isplacement prediction beta into xml file.
+ """
+ self.__node_ale.xmlSetData(const.displacement_prediction_beta, value)
+
+
+ def getDisplacementPredictionBeta(self):
+ """
+ Get value of displacement prediction beta from xml file.
+ """
+ return self.__getDoubleData(const.displacement_prediction_beta,
+ self.setDisplacementPredictionBeta )
+
+
+ #------------------------------------------------------------------
+ # StressPredictionAlpha
+ #------------------------------------------------------------------
+ def setStressPredictionAlpha(self, value):
+ """
+ Set value of stress prediction alpha into xml file.
+ """
+ self.__node_ale.xmlSetData(const.stress_prediction_alpha, value)
+
+
+ def getStressPredictionAlpha(self):
+ """
+ Get value of stress prediction alpha from xml file.
+ """
+ return self.__getDoubleData(const.stress_prediction_alpha,
+ self.setStressPredictionAlpha )
+
+
+ #------------------------------------------------------------------
+ # Monitor point synchronisation
+ #------------------------------------------------------------------
+ def setMonitorPointSynchronisation(self, value):
+ """
+ Set value of monitor point synchronisation into xml file.
+ """
+ self.__setOnOffXML(const.monitor_point_synchronisation, value)
+
+
+ def getMonitorPointSynchronisation(self):
+ """
+ Get value of monitor point synchronisation from xml file.
+ """
+ return self.__getOnOffXML(const.monitor_point_synchronisation,
+ self.setMonitorPointSynchronisation)
+
+
+ #------------------------------------------------------------------
+ # Helper function
+ #------------------------------------------------------------------
+ def __getStringData(self, name, setFunction):
+ """
+ Get string value from xml file.
+ """
+ value = self.__node_ale.xmlGetString(name)
+ return self.__getDefaultDataIfNone(value, name, setFunction)
+
+
+ def __getDoubleData(self, name, setFunction):
+ """
+ Get double value from xml file.
+ """
+ value = self.__node_ale.xmlGetDouble(name)
+ return self.__getDefaultDataIfNone(value, name, setFunction)
+
+
+ def __getIntData(self, name, setFunction):
+ """
+ Get int value from xml file.
+ """
+ value = self.__node_ale.xmlGetInt(name)
+ return self.__getDefaultDataIfNone(value, name, setFunction)
+
+
+ def __getDefaultDataIfNone(self, value, name, setFunction):
+ """
+ Get default value if value is none.
+ """
+ if not value:
+ value = self.__defaults[name]
+ setFunction(value)
+ return value
+
+
+ def __setOnOffXML(self, name, value):
+ """
+ Set value of 'on'/'off' xml attribute
+ """
+ Model().isInList(value, [ 'on', 'off'])
+ xmlNode = self.__node_ale.xmlInitNode(name)
+ xmlNode['status'] = value
+
+
+ def __getOnOffXML(self, name, setFunction):
+ """
+ Get value of 'on'/'off' xml attribut
+ """
+ node = self.__node_ale.xmlInitNode(name, 'status')
+ value = node['status']
+
+ return self.__getDefaultDataIfNone(value, name, setFunction)
+
+
+
+ def getNodeALE(self):
+ """
+ Return the node ALE
+ """
+ return self.__node_ale
+
+
+#-------------------------------------------------------------------------------
+# FluidStructureInteraction test case
+#-------------------------------------------------------------------------------
+
+class FluidStructureInteractionTestCase(ModelTest):
+ """
+ Test case for FluidStructureInteraction
+ """
+
+ def checkFluidStructureInteractionInstantiation(self):
+ """
+ Check whether the FluidStructureInteraction class could be instantiated
+ """
+ model = None
+ model = FluidStructureInteractionModel(self.case)
+ assert model != None, 'Could not instantiate '
+
+
+ def checkGetandSetPrecision(self):
+ """Check whether the FluidStructureInteraction class could be set and get precision"""
+ mdl = FluidStructureInteractionModel(self.case)
+ mdl.setPrecision(0.001)
+
+ doc = """<ale_method status="off">
+ <implicitation_precision>
+ 0.001
+ </implicitation_precision>
+ </ale_method>"""
+
+ assert mdl.getNodeALE() == self.xmlNodeFromString(doc), \
+ 'Could not set fluid structure interaction precision'
+ assert mdl.getPrecision() == 0.001, \
+ 'Could not get fluid structure interaction precision'
+
+
+ def checkGetandSetMaxIterations(self):
+ """Check whether the FluidStructureInteraction class could be set and get max iterations"""
+ mdl = FluidStructureInteractionModel(self.case)
+ mdl.setMaxIterations(99)
+
+ doc = """<ale_method status="off">
+ <max_iterations_implicitation>
+ 99
+ </max_iterations_implicitation>
+ </ale_method>"""
+
+ assert mdl.getNodeALE() == self.xmlNodeFromString(doc), \
+ 'Could not set fluid structure interaction max iterations'
+ assert mdl.getMaxIterations() == 99, \
+ 'Could not get fluid structure interaction max iteration'
+
+
+ def checkGetandSetPostSynchronization(self):
+ """Check whether the FluidStructureInteraction class could be set and get post synchronization"""
+ mdl = FluidStructureInteractionModel(self.case)
+ mdl.setExternalCouplingPostSynchronization('on')
+
+ doc = """<ale_method status="off">
+ <external_coupling_post_synchronization status="on"/>
+ </ale_method>"""
+
+ assert mdl.getNodeALE() == self.xmlNodeFromString(doc), \
+ 'Could not set fluid structure interaction post synchronization'
+ assert mdl.getExternalCouplingPostSynchronization() == 'on', \
+ 'Could not get fluid structure interaction post synchronization'
+
+ def checkGetAndSetAdvancedViewFeatures(self):
+ """Check whether the FluidStructureInteraction class could be set and get advanced view features"""
+ mdl = FluidStructureInteractionModel(self.case)
+
+ mdl.setStressPredictionAlpha(42.0)
+ mdl.setDisplacementPredictionBeta(42.42)
+ mdl.setDisplacementPredictionAlpha(42.4242)
+ mdl.setMonitorPointSynchronisation('on')
+
+ doc = """<ale_method status="off">
+ <stress_prediction_alpha>
+ 42
+ </stress_prediction_alpha>
+ <displacement_prediction_beta>
+ 42.42
+ </displacement_prediction_beta>
+ <displacement_prediction_alpha>
+ 42.4242
+ </displacement_prediction_alpha>
+ <monitor_point_synchronisation status="on"/>
+ </ale_method>"""
+
+ assert mdl.getNodeALE() == self.xmlNodeFromString(doc), \
+ 'Could not set fluid structure interaction advanced view features'
+ assert mdl.getStressPredictionAlpha() == 42.0, \
+ 'Could not get fluid structure interaction stress prediction alpha'
+ assert mdl.getDisplacementPredictionBeta() == 42.42, \
+ 'Could not get fluid structure interaction displacement prediction beta'
+ assert mdl.getDisplacementPredictionAlpha() == 42.4242, \
+ 'Could not get fluid structure interaction displacement prediction alpha'
+ assert mdl.getMonitorPointSynchronisation() == 'on', \
+ 'Could not get fluid structure interaction monitor point synchronisation'
+
+
+
+def suite():
+ """
+ Test Suite for FluidStructureInteractionTestCase
+ """
+ testSuite = unittest.makeSuite(FluidStructureInteractionTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ """
+ run test
+ """
+ print "FluidStructureInteractionTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/FluidStructureInteractionView.py b/gui/Pages/FluidStructureInteractionView.py
new file mode 100644
index 0000000..4ce05a7
--- /dev/null
+++ b/gui/Pages/FluidStructureInteractionView.py
@@ -0,0 +1,859 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- FluidStructureInteractionAdvancedOptionsView
+- StandardItemModel
+- Coupling
+- LineEditCoupling
+- FormulaCoupling
+- CheckBoxCoupling
+- CouplingManager
+- FluidStructureInteractionView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import Qt, QVariant, QString, SIGNAL, pyqtSignature
+from PyQt4.QtGui import QDialog, QHeaderView, QStandardItemModel, QWidget
+from PyQt4.QtGui import QAbstractItemView, QItemSelectionModel, QValidator
+
+try:
+ import mei
+ _have_mei = True
+except ImportError:
+ _have_mei = False
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+from Pages.FluidStructureInteractionForm import Ui_FluidStructureInteractionForm
+from Base import QtPage
+from Pages.FluidStructureInteractionModel import FluidStructureInteractionModel
+from Pages.LocalizationModel import LocalizationModel
+from Pages.Boundary import Boundary
+from Pages.FluidStructureInteractionAdvancedOptionsDialogForm import \
+Ui_FluidStructureInteractionAdvancedOptionsDialogForm
+
+if _have_mei:
+ from Pages.QMeiEditorView import QMeiEditorView
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("FluidStructureInteractionView")
+#log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Constantes
+#-------------------------------------------------------------------------------
+
+displacement_prediction_alpha = 'displacement_prediction_alpha'
+displacement_prediction_beta = 'displacement_prediction_beta'
+stress_prediction_alpha = 'stress_prediction_alpha'
+external_coupling_post_synchronization = 'external_coupling_post_synchronization'
+monitor_point_synchronisation = 'monitor_point_synchronisation'
+
+#-------------------------------------------------------------------------------
+# Advanced dialog
+#-------------------------------------------------------------------------------
+
+class FluidStructureInteractionAdvancedOptionsView(QDialog,
+ Ui_FluidStructureInteractionAdvancedOptionsDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ # Init base classes
+ QDialog.__init__(self, parent)
+ Ui_FluidStructureInteractionAdvancedOptionsDialogForm.__init__(self)
+ self.setupUi(self)
+
+ title = self.tr("Displacements prediction:")
+ self.setWindowTitle(title)
+
+ self.__default = default
+ self.__result = default.copy()
+ self.__setValidator()
+ self.__setInitialValues()
+
+
+ def __setValidator(self):
+ """
+ Set the validator
+ """
+ validator = QtPage.DoubleValidator(self.lineEditDisplacementAlpha,
+ min=0.0)
+ self.lineEditDisplacementAlpha.setValidator(validator)
+
+ validator = QtPage.DoubleValidator(self.lineEditDisplacementBeta,
+ min=0.0)
+ self.lineEditDisplacementBeta.setValidator(validator)
+
+ validator = QtPage.DoubleValidator(self.lineEditStressAlpha, min=0.0)
+ self.lineEditStressAlpha.setValidator(validator)
+
+
+ def __setInitialValues(self):
+ """
+ Set the initial values for the 4 widgets
+ """
+ # Read from default
+ displacementAlpha = str(self.__default[displacement_prediction_alpha])
+ displacementBeta = str(self.__default[displacement_prediction_beta ])
+ stressAlpha = str(self.__default[stress_prediction_alpha ])
+
+ isSynchronizationOn = self.__default[monitor_point_synchronisation] == 'on'
+
+ # Update Widget
+ self.lineEditDisplacementAlpha.setText(displacementAlpha)
+ self.lineEditDisplacementBeta.setText(displacementBeta)
+ self.lineEditStressAlpha.setText(stressAlpha)
+ self.checkBoxSynchronization.setChecked(isSynchronizationOn)
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.__result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ # Read value from widget
+ displacementAlpha = float(self.lineEditDisplacementAlpha.text())
+ displacementBeta = float(self.lineEditDisplacementBeta.text())
+ stressAlpha = float(self.lineEditStressAlpha.text())
+
+ if self.checkBoxSynchronization.isChecked():
+ synchronization = 'on'
+ else:
+ synchronization = 'off'
+
+ # Set result attributes
+ self.__result[displacement_prediction_alpha] = displacementAlpha
+ self.__result[displacement_prediction_beta ] = displacementBeta
+ self.__result[stress_prediction_alpha ] = stressAlpha
+ self.__result[monitor_point_synchronisation] = synchronization
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class
+#-------------------------------------------------------------------------------
+class StandardItemModel(QStandardItemModel):
+ """
+ StandardItemModel for table view
+ """
+
+ def __init__(self):
+ """
+ StandarItemModel for fluid structure interaction tableView
+ """
+ QStandardItemModel.__init__(self)
+
+ # Define header
+ self.headers = [self.tr("Structure number"),
+ self.tr("Label"),
+ self.tr("Location")]
+ self.setColumnCount(len(self.headers))
+
+ # Set attributes
+ self.__data = []
+
+
+ def data(self, index, role):
+ """
+ Called when table need to read the data
+ """
+ # return value only for Qt.DisplayRole
+ if index.isValid() and role == Qt.DisplayRole:
+ row = index.row()
+ col = index.column()
+ return QVariant(self.__data[row][col])
+
+ return QVariant()
+
+
+ def flags(self, index):
+ """
+ Define which column is editable/selectable/enable.
+ """
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ """
+ Return the header column data.
+ """
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ """
+ Set a the data when table changed
+ """
+ raise Exception('Cannot edit column')
+
+
+ def addItem(self, zone):
+ """
+ Add an element in the table view.
+ """
+ index = len(self.__data)
+ line = [index + 1, zone.getLabel(), zone.getLocalization()]
+
+ # Add the line and increment line number
+ self.__data.append(line)
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+
+ def getLabel(self, index):
+ """
+ return the label
+ """
+ row = index.row()
+ [index, label, localization] = self.__data[row]
+ return label
+
+
+#-------------------------------------------------------------------------------
+# Coupling base class
+#-------------------------------------------------------------------------------
+
+class Coupling:
+ """
+ Coupling is the base class to manage all widgets which value depend on the
+ boundary.
+
+ It provides getBoundaryDefinedValue/setBoundaryDefinedValue methods which
+ get/set the value of a boundary attribute. Getter and setter are specified
+ int the constructor
+
+ It also automatically enable/disable the widget when boundary is present
+ or not
+
+ Derived class can override onBoundarySet method to specify the initial
+ value of the widget base on the boundary
+ """
+
+ def __init__(self, widget, getterStr, setterStr ):
+ """
+ Constructor. getterStr and setterStr are string
+ """
+ self.__widget = widget
+ self.__getterStr = getterStr
+ self.__setterStr = setterStr
+ self.__boundary = None
+
+ # As no boundary is selected disable the widget
+ widget.setEnabled(False)
+
+
+ def getWidget(self):
+ """
+ Return the widget
+ """
+ return self.__widget
+
+
+ def setBoundary(self, boundary):
+ """
+ Set the current boundary
+ """
+ self.__boundary = boundary
+
+ #Enable widget
+ self.__widget.setEnabled(True)
+
+ # call onBoundarySet for derived class
+ self.onBoundarySet()
+
+
+ def onBoundarySet(self):
+ """
+ Called when boundary is set. Nothing by default
+ """
+ pass
+
+
+ def getBoundaryDefinedValue(self):
+ """
+ Return the value of the boundary using the getter function
+ """
+ return getattr(self.__boundary, self.__getterStr)()
+
+
+ def setBoundaryDefinedValue(self, value):
+ """
+ Set the value of the boundary using the setter function
+ """
+ getattr(self.__boundary, self.__setterStr)(value)
+
+
+
+#-------------------------------------------------------------------------------
+# LineEdit Coupling class
+#-------------------------------------------------------------------------------
+
+class LineEditCoupling(Coupling):
+ """
+ LineEdit that depend on a boundary
+ """
+
+ def __init__(self, lineEdit, getter, setter):
+ """
+ Constructor
+ """
+ Coupling.__init__(self, lineEdit, getter, setter)
+
+ # Add validator.
+ validator = QtPage.DoubleValidator(lineEdit, min=0.0)
+ lineEdit.setValidator(validator)
+ lineEdit.connect(lineEdit, SIGNAL("textChanged(const QString &)"),
+ self.__slotTextChanged)
+
+
+ def onBoundarySet(self):
+ """
+ Called when boundary is set. Update lineEdit text
+ """
+ value = self.getBoundaryDefinedValue()
+ self.getWidget().setText(str(value))
+
+
+ @pyqtSignature("const QString&")
+ def __slotTextChanged(self, text):
+ """
+ Update the model
+ """
+ self.setBoundaryDefinedValue(text)
+
+
+#-------------------------------------------------------------------------------
+# Formula Coupling class
+#-------------------------------------------------------------------------------
+
+class FormulaCoupling(Coupling):
+ """
+ Formula button that depend on a boundary
+ """
+
+ def __init__(self, button, getter, setter, default, required, symbols, examples):
+ """
+ Constructor
+ """
+ Coupling.__init__(self, button, getter, setter)
+
+ self.__default = default
+ self.__required = required
+ self.__examples = examples
+ self.__symbols = symbols
+ button.connect(button, SIGNAL("clicked(bool)"), self.__slotFormula)
+
+
+ def onBoundarySet(self):
+ """
+ Called when boundary is set.
+ """
+ # call getter to create default value if needed
+ self.getBoundaryDefinedValue()
+
+ # Disable button if _have_mei is false
+ if not _have_mei:
+ self.getWidget().setEnabled(False)
+
+
+ @pyqtSignature("const QString&")
+ def __slotFormula(self, text):
+ """
+ Run formula editor.
+ """
+ # Read current expression
+ exp = self.getBoundaryDefinedValue()
+
+ if not exp:
+ exp = self.__default
+
+ # run the editor
+ dialog = QMeiEditorView(self.getWidget(),
+ expression = exp,
+ required = self.__required,
+ symbols = self.__symbols,
+ examples = self.__examples)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("FormulaCoupling -> %s" % str(result))
+ self.setBoundaryDefinedValue(result)
+
+
+
+#-------------------------------------------------------------------------------
+# CheckBoxCouplings Coupling class
+#-------------------------------------------------------------------------------
+class CheckBoxCoupling(Coupling):
+ """
+ CheckBox that depend on a boundary
+ """
+
+ def __init__(self, checkBox, getter, setter):
+ """
+ Constructor
+ """
+ Coupling.__init__(self, checkBox, getter, setter)
+ checkBox.connect(checkBox, SIGNAL("stateChanged(int)"),
+ self.__slotStateChanged)
+
+
+ def onBoundarySet(self):
+ """
+ Called when boundary is set.
+ """
+ value = self.getBoundaryDefinedValue()
+
+ if value == "on":
+ state = Qt.Checked
+ else:
+ state = Qt.Unchecked
+ self.getWidget().setCheckState(state)
+
+
+ @pyqtSignature("int")
+ def __slotStateChanged(self, state):
+ """
+ Called when checkbox state changed
+ """
+ value = "off"
+ if state == Qt.Checked:
+ value = "on"
+ self.setBoundaryDefinedValue(value)
+
+
+#-------------------------------------------------------------------------------
+# CouplingManager class
+#-------------------------------------------------------------------------------
+class CouplingManager:
+ """
+ Manage and initialize coupling derived objects
+ """
+
+ def __init__(self, mainView, case, internalTableModel, externalTableModel):
+ """
+ Constructor
+ """
+ self.__case = case
+ self.__internalTableModel = internalTableModel
+ self.__externalTableModel = externalTableModel
+ self.__internalCouplings = []
+ self.__externalCouplings = []
+
+ # Init widgets
+ self.__initLineEditCouplings(mainView)
+ self.__initFormulaCouplings (mainView)
+ self.__initCheckBoxCouplings(mainView)
+
+
+ def __initLineEditCouplings(self, mainView):
+ """
+ Initialize the creation of LineEditCoupling
+ """
+ coupings = []
+ coupings.append( LineEditCoupling( mainView.lineEditInitialDisplacementX
+ , "getInitialDisplacementX", "setInitialDisplacementX"))
+ coupings.append( LineEditCoupling( mainView.lineEditInitialDisplacementY
+ , "getInitialDisplacementY", "setInitialDisplacementY"))
+ coupings.append( LineEditCoupling( mainView.lineEditInitialDisplacementZ
+ , "getInitialDisplacementZ", "setInitialDisplacementZ"))
+
+ coupings.append(
+ LineEditCoupling( mainView.lineEditEquilibriumDisplacementX,
+ "getEquilibriumDisplacementX",
+ "setEquilibriumDisplacementX"))
+
+ coupings.append(
+ LineEditCoupling( mainView.lineEditEquilibriumDisplacementY,
+ "getEquilibriumDisplacementY",
+ "setEquilibriumDisplacementY"))
+ coupings.append(
+ LineEditCoupling( mainView.lineEditEquilibriumDisplacementZ,
+ "getEquilibriumDisplacementZ",
+ "setEquilibriumDisplacementZ"))
+
+ coupings.append( LineEditCoupling( mainView.lineEditInitialVelocityX
+ , "getInitialVelocityX", "setInitialVelocityX"))
+ coupings.append( LineEditCoupling( mainView.lineEditInitialVelocityY
+ , "getInitialVelocityY", "setInitialVelocityY"))
+ coupings.append( LineEditCoupling( mainView.lineEditInitialVelocityZ
+ , "getInitialVelocityZ", "setInitialVelocityZ"))
+ self.__internalCouplings.extend(coupings)
+
+
+ def __initCheckBoxCouplings(self, mainView):
+ """
+ Initialize the creation of the checkbox coupling
+ """
+ couplings = []
+ couplings.append(CheckBoxCoupling( mainView.checkBoxDDLX, "getDDLX",
+ "setDDLX"))
+ couplings.append(CheckBoxCoupling( mainView.checkBoxDDLY, "getDDLY",
+ "setDDLY"))
+ couplings.append(CheckBoxCoupling( mainView.checkBoxDDLZ, "getDDLZ",
+ "setDDLZ"))
+ self.__externalCouplings.extend(couplings)
+
+
+ def __initFormulaCouplings(self, mainView):
+ """
+ Initialize the creation of the formula button
+ """
+ default = "m11 = ;"
+ examples = "m11 = 100;\nm22 = 100;\nm33 = 100;"
+ examples += "\nm12 = 0;\nm13 = 0;\nm23 = 0;\nm21 = 0;\nm31 = 0;\nm32 = 0;"
+ massRequired = [('m11', 'mass matrix of the structure (1,1)'),
+ ('m22', 'mass matrix of the structure (2,2)'),
+ ('m33', 'mass matrix of the structure (3,3)'),
+ ('m12', 'mass matrix of the structure (1,2)'),
+ ('m13', 'mass matrix of the structure (1,3)'),
+ ('m23', 'mass matrix of the structure (2,3)'),
+ ('m21', 'mass matrix of the structure (2,1)'),
+ ('m31', 'mass matrix of the structure (3,1)'),
+ ('m32', 'mass matrix of the structure (3,2)')]
+ symbols = [('dt', 'time step'),
+ ('t', 'current time'),
+ ('nbIter', 'number of iteration')]
+
+ stiffnessRequired = []
+ dampingRequired = []
+ for var, str in massRequired:
+ stiffnessRequired.append( (var, str.replace('mass', 'stiffness') ) )
+ dampingRequired.append( (var, str.replace('mass', 'damping') ) )
+
+ couplings = []
+ couplings.append( FormulaCoupling( mainView.pushButtonMassMatrix,
+ "getMassMatrix", "setMassMatrix",
+ default, massRequired, symbols,
+ examples))
+ couplings.append( FormulaCoupling( mainView.pushButtonStiffnessMatrix,
+ "getStiffnessMatrix",
+ "setStiffnessMatrix", default,
+ stiffnessRequired, symbols, examples))
+
+ couplings.append( FormulaCoupling( mainView.pushButtonDampingMatrix,
+ "getDampingMatrix",
+ "setDampingMatrix", default,
+ dampingRequired, symbols, examples))
+
+ defaultFluidForce = "fx = "
+ requiredFluidForce = [('fx', 'Force applied to the structure along X'),
+ ('fy', 'Force applied to the structure along Y'),
+ ('fz', 'Force applied to the structure along Z')]
+ symbolsFluidForce = symbols[:];
+ symbolsFluidForce.append( ('fluid_fx', 'Force of flow along X'))
+ symbolsFluidForce.append( ('fluid_fy', 'Force of flow along Y'))
+ symbolsFluidForce.append( ('fluid_fz', 'Force of flow along Z'))
+
+ examplesFluidForce = "fx = fluid_fx;\nfy = fluid_fy;\nfz = fluid_fz;"
+ couplings.append( FormulaCoupling( mainView.pushButtonFluidForce,
+ "getFluidForceMatrix",
+ "setFluidForceMatrix",
+ defaultFluidForce,
+ requiredFluidForce,
+ symbolsFluidForce,
+ examplesFluidForce))
+ self.__internalCouplings.extend(couplings)
+
+
+
+ @pyqtSignature("QModelIndex const&, QModelIndex const&")
+ def slotInternalSelectionChanged(self, selected, deselected):
+ """
+ Called when internal tableView selection changed
+ """
+ self.__selectionChanged(self.__internalTableModel,
+ self.__internalCouplings, selected)
+
+
+ @pyqtSignature("QModelIndex const&, QModelIndex const&")
+ def slotExternalSelectionChanged(self, selected, deselected):
+ """
+ Called when external tableView selection changed
+ """
+ self.__selectionChanged(self.__externalTableModel,
+ self.__externalCouplings, selected)
+
+
+ def __selectionChanged(self, tableModel, couplings, selected):
+ """
+ Called when a tableView selection changed
+ """
+ # Get Boundary
+ label = tableModel.getLabel(selected)
+
+ boundary = Boundary("coupling_mobile_boundary", label, self.__case)
+
+ # Set boundary for coupling
+ for coupling in couplings:
+ coupling.setBoundary(boundary)
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+class FluidStructureInteractionView(QWidget, Ui_FluidStructureInteractionForm):
+ """
+ Main class.
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ # Init base classes
+ QWidget.__init__(self, parent)
+
+ Ui_FluidStructureInteractionForm.__init__(self)
+ self.setupUi(self)
+
+ self.__case = case
+ self.__model = FluidStructureInteractionModel(case)
+
+ self.__defineConnection()
+ self.__addValidators()
+ self.__setInitialValues()
+
+ # Use localization model for column 0, 1, 3
+ modelLocalization = LocalizationModel("BoundaryZone", case)
+
+ # Store modelLocalization as attribut to avoid garbage collector to clean it
+ self.__modelLocalization = modelLocalization
+
+ # Initialize the internal and external TableViewItemModel
+ self.__internalTableModel = self.__createTableViewItemModel(modelLocalization,
+ 'internal_coupling')
+ self.__externalTableModel = self.__createTableViewItemModel(modelLocalization,
+ 'external_coupling')
+
+ # Coupling Manager
+ couplingManager = CouplingManager(self, case, self.__internalTableModel
+ , self.__externalTableModel)
+ # Avoid garbage collector to delete couplingManager
+ self.__couplingManager = couplingManager
+
+ # Initialize internal / external table view
+ self.__initTableView(self.tableInternalCoupling,
+ self.__internalTableModel,
+ couplingManager.slotInternalSelectionChanged)
+
+ self.__initTableView(self.tableExternalCoupling,
+ self.__externalTableModel,
+ couplingManager.slotExternalSelectionChanged)
+
+
+ def __defineConnection(self):
+ """
+ Define coonection for widget that do not depend on the boundary
+ """
+ self.connect(self.lineEditNALIMX,
+ SIGNAL("textChanged(const QString &)"), self.__slotNalimx)
+
+ self.connect(self.lineEditEPALIM,
+ SIGNAL("textChanged(const QString &)"), self.__slotEpalim)
+ self.connect(self.pushButtonAdvanced,
+ SIGNAL("clicked(bool)"), self.__slotAdvanced)
+ self.connect(self.checkBoxPostSynchronization,
+ SIGNAL("stateChanged (int)"),
+ self.__slotPostSynchronization)
+
+
+ def __addValidators(self):
+ """
+ Add the validator for NALIMX and EPALIM
+ """
+ validatorNALIMX = QtPage.IntValidator(self.lineEditNALIMX, min=1)
+ self.lineEditNALIMX.setValidator(validatorNALIMX)
+
+ validatorEPALIM = QtPage.DoubleValidator(self.lineEditEPALIM, min=0.0)
+ validatorEPALIM.setExclusiveMin(True)
+ self.lineEditEPALIM.setValidator(validatorEPALIM)
+
+
+ def __setInitialValues(self):
+ """
+ Set Widget initial values that do not depend on the boundary
+ """
+ nalimx = self.__model.getMaxIterations()
+ self.lineEditNALIMX.setText(QString(str(nalimx)))
+ epalim = self.__model.getPrecision()
+ self.lineEditEPALIM.setText(QString(str(epalim)))
+ postSynchronization = self.__model.getExternalCouplingPostSynchronization()
+ self.checkBoxPostSynchronization.setChecked(postSynchronization == 'on')
+
+
+ def __createTableViewItemModel(self, modelLocalization, filterALE):
+ """
+ Create the table view item model
+ """
+ tableViewItemModel = StandardItemModel()
+
+ # Populate QTableView model
+ for zone in modelLocalization.getZones():
+ boundary = Boundary("mobile_boundary", zone.getLabel(), self.__case)
+ if boundary.getALEChoice() == filterALE:
+ tableViewItemModel.addItem(zone)
+ return tableViewItemModel
+
+
+ def __initTableView(self, tableView, tableViewItemModel, slotSelectionChanged):
+ """
+ Initialize the main table view
+ """
+ # Set the model
+ tableView.setModel(tableViewItemModel)
+
+ # set the column size
+ tableView.verticalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ tableView.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ tableView.horizontalHeader().setResizeMode(2, QHeaderView.Stretch)
+
+ # Connect slot when selection changed
+ tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
+ selectionModel = QItemSelectionModel(tableViewItemModel, tableView)
+ tableView.setSelectionModel(selectionModel)
+
+ self.connect(selectionModel,
+ SIGNAL( "currentChanged(const QModelIndex &, const QModelIndex &)"),
+ slotSelectionChanged)
+
+
+ @pyqtSignature("const QString&")
+ def __slotNalimx(self, text):
+ """
+ Input viscosity type of mesh : isotrop or orthotrop.
+ """
+ nalimx, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__model.setMaxIterations(nalimx)
+
+
+ @pyqtSignature("const QString&")
+ def __slotEpalim(self, text):
+ """
+ Input viscosity type of mesh : isotrop or orthotrop.
+ """
+ epalim, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.__model.setPrecision(epalim)
+
+
+ @pyqtSignature("int")
+ def __slotPostSynchronization(self, value):
+ """
+ Called when check box state changed
+ """
+ postSynchronization = 'on'
+ if not value:
+ postSynchronization = 'off'
+ self.__model.setExternalCouplingPostSynchronization(postSynchronization)
+
+
+
+ @pyqtSignature("const QString&")
+ def __slotAdvanced(self, text):
+ """
+ Private slot.
+ Ask one popup for advanced specifications
+ """
+ # Set the default value
+ default = {}
+ default[displacement_prediction_alpha] = self.__model.getDisplacementPredictionAlpha()
+ default[displacement_prediction_beta ] = self.__model.getDisplacementPredictionBeta()
+ default[stress_prediction_alpha ] = self.__model.getStressPredictionAlpha()
+ default[monitor_point_synchronisation] = \
+ self.__model.getMonitorPointSynchronisation()
+ log.debug("slotAdvancedOptions -> %s" % str(default))
+
+ # run the dialog
+ dialog = FluidStructureInteractionAdvancedOptionsView(self, default)
+ if dialog.exec_():
+ # Set the model with the dialog results
+ result = dialog.get_result()
+ log.debug("slotAdvanced -> %s" % str(result))
+ self.__model.setDisplacementPredictionAlpha(result[displacement_prediction_alpha])
+ self.__model.setDisplacementPredictionBeta(result[displacement_prediction_beta])
+ self.__model.setStressPredictionAlpha(result[stress_prediction_alpha])
+ self.__model.setMonitorPointSynchronisation(result[monitor_point_synchronisation])
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/GasCombustionModel.py b/gui/Pages/GasCombustionModel.py
new file mode 100644
index 0000000..74700b1
--- /dev/null
+++ b/gui/Pages/GasCombustionModel.py
@@ -0,0 +1,192 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the gas combustion thermal flow modelling management.
+
+This module contains the following classes and function:
+- GasCombustionModel
+- GasCombustionTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from ThermalRadiationModel import ThermalRadiationModel
+from Pages.FluidCharacteristicsModel import FluidCharacteristicsModel
+
+#-------------------------------------------------------------------------------
+# Gas combustion model class
+#-------------------------------------------------------------------------------
+
+class GasCombustionModel(Variables, Model):
+ """
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ nModels = self.case.xmlGetNode('thermophysical_models')
+ self.node_turb = nModels.xmlGetNode('turbulence', 'model')
+ self.node_gas = nModels.xmlGetNode('gas_combustion', 'model')
+ self.node_coal = nModels.xmlGetNode('pulverized_coal', 'model')
+ self.node_joule = nModels.xmlGetNode('joule_effect', 'model')
+ self.node_therm = nModels.xmlGetNode('thermal_scalar', 'model')
+
+ self.gasCombustionModel = ('off', 'ebu', 'd3p')
+
+
+ def defaultGasCombustionValues(self):
+ """
+ Return in a dictionnary which contains default values.
+ """
+ default = {}
+ default['model'] = "off"
+
+ return default
+
+
+ def getAllGasCombustionModels(self):
+ """
+ Return all defined gas combustion models in a tuple.
+ """
+ return self.gasCombustionModel
+
+
+ def gasCombustionModelsList(self):
+ """
+ Create a tuple with the gas combustion models allowed
+ by the calculation features.
+ """
+ gasCombustionList = self.gasCombustionModel
+
+ n, m = FluidCharacteristicsModel(self.case).getThermalModel()
+ if m != "off" and m not in gasCombustionList:
+ gasCombustionList = ('off',)
+
+ if self.node_turb['model'] not in ('k-epsilon',
+ 'k-epsilon-PL',
+ 'Rij-epsilon',
+ 'Rij-SSG',
+ 'v2f-phi',
+ 'k-omega-SST'):
+ gasCombustionList = ('off',)
+
+ return gasCombustionList
+
+
+ def setGasCombustionModel(self, model):
+ """
+ Update the gas combustion model markup from the XML document.
+ """
+ self.isInList(model, self.gasCombustionModelsList())
+
+ if model == 'off':
+ self.node_gas['model'] = model
+ ThermalRadiationModel(self.case).setRadiativeModel('off')
+ else:
+ self.node_gas['model'] = model
+ self.node_coal['model'] = 'off'
+ self.node_joule['model'] = 'off'
+ self.node_therm['model'] = 'off'
+
+
+ def getGasCombustionModel(self):
+ """
+ Return the current gas combustion model.
+ """
+ model = self.node_gas['model']
+ if model not in self.gasCombustionModelsList():
+ model = self.defaultGasCombustionValues()['model']
+ self.setGasCombustionModel(model)
+
+ return model
+
+
+#-------------------------------------------------------------------------------
+# Gas combustion test case
+#-------------------------------------------------------------------------------
+
+
+class GasCombustionTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+ def checkGasCombustionInstantiation(self):
+ """
+ Check whether the gasCombustionModel class could be instantiated
+ """
+ model = None
+ model = GasCombustionModel(self.case)
+ assert model != None, 'Could not instantiate GasCombustionModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(GasCombustionTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "GasCombustionTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/HeadLossesForm.ui b/gui/Pages/HeadLossesForm.ui
new file mode 100644
index 0000000..d1c7fdd
--- /dev/null
+++ b/gui/Pages/HeadLossesForm.ui
@@ -0,0 +1,501 @@
+<ui version="4.0" >
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>392</height>
+ </rect>
+ </property>
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="windowTitle" >
+ <string>Head Losses</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxZones" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Select volume zone for head losses </string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewZones" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxDef" >
+ <property name="title" >
+ <string>Definition of tensor coefficients</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Head losses coefficients</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignHCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>K<sub>XX</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>15</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>K<sub>YY</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_2" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>15</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>K<sub>ZZ</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_3" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Reference frame transformation matrix</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignHCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Reference frame: (x, y, z ) Local frame: (X, Y, Z)</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>X =</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEdit_4" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="label_6" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <weight>50</weight>
+ <italic>true</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>x +</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QLineEdit" name="lineEdit_5" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLabel" name="label_7" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>y +</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5" >
+ <widget class="QLineEdit" name="lineEdit_6" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="6" >
+ <widget class="QLabel" name="label_8" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>z </string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_11" >
+ <property name="text" >
+ <string>Y =</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEdit_8" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="label_9" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>x +</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QLineEdit" name="lineEdit_9" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" >
+ <widget class="QLabel" name="label_10" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>y +</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="5" >
+ <widget class="QLineEdit" name="lineEdit_7" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="6" >
+ <widget class="QLabel" name="label_12" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>z</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_15" >
+ <property name="text" >
+ <string>Z =</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEdit_11" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="label_13" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>x +</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3" >
+ <widget class="QLineEdit" name="lineEdit_12" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4" >
+ <widget class="QLabel" name="label_14" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>y +</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5" >
+ <widget class="QLineEdit" name="lineEdit_10" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="6" >
+ <widget class="QLabel" name="label_16" >
+ <property name="font" >
+ <font>
+ <family>LMRoman10</family>
+ <pointsize>10</pointsize>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="text" >
+ <string>z</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/HeadLossesModel.py b/gui/Pages/HeadLossesModel.py
new file mode 100644
index 0000000..9927b6e
--- /dev/null
+++ b/gui/Pages/HeadLossesModel.py
@@ -0,0 +1,420 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the HeadLosses model data management.
+
+This module contains the following classes and function:
+- HeadLossesModel
+- HeadLossesTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import StandardItemModelMeshes(
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+from Pages.LocalizationModel import LocalizationModel, VolumicLocalizationModel, Zone
+
+#-------------------------------------------------------------------------------
+# HeadLosses model class
+#-------------------------------------------------------------------------------
+
+class HeadLossesModel(Variables, Model):
+ """
+ Manage the input/output markups in the xml doc about HeadLosses
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_domain = self.case.xmlGetNode('solution_domain')
+ self.node_volzone = self.node_domain.xmlGetNode('volumic_conditions')
+ self.node_hloss = self.node_models.xmlInitNode('heads_losses')
+
+ self.tenseurModel = ('3', '6')
+ self.coeffNames = ('kxx', 'kyy', 'kzz')
+ self.matrix = ('a11', 'a12', 'a13',
+ 'a21', 'a22', 'a23',
+ 'a31', 'a32', 'a33')
+
+ self.getNameAndLocalizationZone()
+
+
+ def __defaultValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['tenseur'] = '6'
+ default['kxx'] = 0.0
+ default['kyy'] = 0.0
+ default['kzz'] = 0.0
+ default['a11'] = 0.0
+ default['a12'] = 0.0
+ default['a13'] = 0.0
+ default['a21'] = 0.0
+ default['a22'] = 0.0
+ default['a23'] = 0.0
+ default['a31'] = 0.0
+ default['a32'] = 0.0
+ default['a33'] = 0.0
+
+ return default
+
+
+ def getNameAndLocalizationZone(self):
+ """
+ Return name and localization zone from volume regions definitions.
+ """
+ zoneDico = {}
+ zonesList = LocalizationModel('VolumicZone', self.case).getZones()
+ for zone in zonesList:
+ if zone.getNature()['head_losses'] == 'on':
+ label = zone.getLabel()
+ name = zone.getCodeNumber()
+ localization = zone.getLocalization()
+ zoneDico[label] = (name, localization)
+ self.setNameAndLabelZone(name, label)
+
+ return zoneDico
+
+
+ def setNameAndLabelZone(self, name, label):
+ """
+ Set name and label zone for head losses markups.
+ """
+ self.node_hloss.xmlInitChildNode('head_loss', name=name, label=label)
+ self.getKCoefficients(name)
+ self.getMatrix(name)
+
+
+ def getCoefficient(self, name, k):
+ """
+ Return value of coefficient k for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+ self.isInList(k, self.coeffNames)
+
+ node = self.node_hloss.xmlGetNode('head_loss', name=name)
+ value = node.xmlGetDouble(k)
+ if value == None:
+ value = self.__defaultValues()[k]
+ self.setCoefficient(name, k, value)
+
+ return value
+
+
+ def getKCoefficients(self, name):
+ """
+ Get value of kxx, kyy and kzz from xml file, for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+
+ kxx = self.getCoefficient(name, 'kxx')
+ kyy = self.getCoefficient(name, 'kyy')
+ kzz = self.getCoefficient(name, 'kzz')
+
+ return kxx, kyy, kzz
+
+
+ def setCoefficient(self, name, k, value):
+ """
+ Set value of coefficient k for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+ self.isInList(k, self.coeffNames)
+ self.isFloat(value)
+
+ node = self.node_hloss.xmlGetNode('head_loss', name=name)
+ node.xmlSetData(k, value)
+
+
+ def setKCoefficients(self, name, kxx, kyy, kzz):
+ """
+ Set value of kxx, kyy and kzz into xml file, for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+ self.isFloat(kxx)
+ self.isFloat(kyy)
+ self.isFloat(kzz)
+
+ self.setCoefficient(name, 'kxx', kxx)
+ self.setCoefficient(name, 'kyy', kyy)
+ self.setCoefficient(name, 'kzz', kzz)
+
+
+ def getMatrixComposant(self, name, a):
+ """
+ Get values of one composant of the matrix of the change reference frame,
+ for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+ self.isInList(a, self.matrix)
+
+ node = self.node_hloss.xmlGetNode('head_loss', name=name)
+ value = node.xmlGetDouble(a)
+ if value == None:
+ value = self.__defaultValues()[a]
+ self.setMatrixComposant(name, a, value)
+
+ return value
+
+
+ def getMatrix(self, name):
+ """
+ Get values of matrix of the change reference frame from xml file,
+ for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+
+ a11 = self.getMatrixComposant(name, 'a11')
+ a12 = self.getMatrixComposant(name, 'a12')
+ a13 = self.getMatrixComposant(name, 'a13')
+ a21 = self.getMatrixComposant(name, 'a21')
+ a22 = self.getMatrixComposant(name, 'a22')
+ a23 = self.getMatrixComposant(name, 'a23')
+ a31 = self.getMatrixComposant(name, 'a31')
+ a32 = self.getMatrixComposant(name, 'a32')
+ a33 = self.getMatrixComposant(name, 'a33')
+
+ return a11, a12, a13, a21, a22, a23, a31, a32, a33
+
+
+ def setMatrixComposant(self, name, a, value):
+ """
+ Set value of composant of matrix of the change reference frame,
+ for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+ self.isInList(a, self.matrix)
+ self.isFloat(value)
+
+ node = self.node_hloss.xmlGetNode('head_loss', name=name)
+ node.xmlSetData(a, value)
+
+
+ def setMatrix(self, name, a11, a12, a13, a21, a22, a23, a31, a32, a33):
+ """
+ Set values of the matrix of the change reference frame,
+ for the head loss with zone's name.
+ """
+ self.isInt(int(name))
+ for a in (a11, a12, a13, a21, a22, a23, a31, a32, a33):
+ self.isFloat(a)
+
+ self.setMatrixComposant(name, 'a11', a11)
+ self.setMatrixComposant(name, 'a12', a12)
+ self.setMatrixComposant(name, 'a13', a13)
+ self.setMatrixComposant(name, 'a21', a21)
+ self.setMatrixComposant(name, 'a22', a22)
+ self.setMatrixComposant(name, 'a23', a23)
+ self.setMatrixComposant(name, 'a31', a31)
+ self.setMatrixComposant(name, 'a32', a32)
+ self.setMatrixComposant(name, 'a33', a33)
+
+
+#-------------------------------------------------------------------------------
+# HeadLossesModel test case
+#-------------------------------------------------------------------------------
+
+
+class HeadLossesModelTestCase(ModelTest):
+ """
+ """
+ def checkHeadLossesInstantiation(self):
+ """Check whether the HeadLossesModel class could be instantiated"""
+ model = None
+ model = HeadLossesModel(self.case)
+ assert model != None, 'Could not instantiate HeadLossesModel'
+
+
+ def checkSetandGetNameLabelandCoefficients(self):
+ """Check whether the head_losses markups could be set and get"""
+ # we create a new zone for head losses
+ loc = LocalizationModel("VolumicZone", self.case)
+ zone = Zone("VolumicZone", label='toto', localization="1 or door", nature="head_losses")
+ loc.addZone(zone)
+
+ #we can test
+ mdl = HeadLossesModel(self.case)
+ mdl.getNameAndLocalizationZone()
+ doc = '''<heads_losses>
+ <head_loss label="toto" name="2">
+ <kxx>0</kxx>
+ <kyy>0</kyy>
+ <kzz>0</kzz>
+ <a11>0</a11>
+ <a12>0</a12>
+ <a13>0</a13>
+ <a21>0</a21>
+ <a22>0</a22>
+ <a23>0</a23>
+ <a31>0</a31>
+ <a32>0</a32>
+ <a33>0</a33>
+ </head_loss>
+ </heads_losses>'''
+ assert mdl.node_hloss == self.xmlNodeFromString(doc),\
+ 'Could not set name and label for head losses'
+ assert mdl.getNameAndLocalizationZone() == {'toto': (2, '1 or door')},\
+ 'Could not get name, label and localization for head losses'
+
+ def checkSetandGetKCoefficients(self):
+ """Check whether the head_losses could be set and get kxx, kyy, kzz"""
+ # we create a new zone for head losses
+ loc = LocalizationModel("VolumicZone", self.case)
+ zone = Zone("VolumicZone", label='toto', localization="1 or door", nature="head_losses")
+ loc.addZone(zone)
+
+ mdl = HeadLossesModel(self.case)
+ mdl.setKCoefficients('2', 10., 100., 1000.)
+ doc = '''<heads_losses>
+ <head_loss label="toto" name="2">
+ <kxx>10</kxx>
+ <kyy>100</kyy>
+ <kzz>1000</kzz>
+ <a11>0</a11>
+ <a12>0</a12>
+ <a13>0</a13>
+ <a21>0</a21>
+ <a22>0</a22>
+ <a23>0</a23>
+ <a31>0</a31>
+ <a32>0</a32>
+ <a33>0</a33>
+ </head_loss>
+ </heads_losses>'''
+
+ assert mdl.node_hloss == self.xmlNodeFromString(doc),\
+ 'Could not set kxx, kyy, kzz coefficients for head losses'
+ assert mdl.getKCoefficients('2') == (10., 100., 1000.),\
+ 'Could not get kxx, kyy, kzz coefficients for head losses'
+
+ mdl.setCoefficient('2', 'kyy', 555.)
+ doc2 = '''<heads_losses>
+ <head_loss label="toto" name="2">
+ <kxx>10</kxx>
+ <kyy>555</kyy>
+ <kzz>1000</kzz>
+ <a11>0</a11>
+ <a12>0</a12>
+ <a13>0</a13>
+ <a21>0</a21>
+ <a22>0</a22>
+ <a23>0</a23>
+ <a31>0</a31>
+ <a32>0</a32>
+ <a33>0</a33>
+ </head_loss>
+ </heads_losses>'''
+
+ assert mdl.node_hloss == self.xmlNodeFromString(doc2),\
+ 'Could not set one coefficient for head losses'
+ assert mdl.getCoefficient('2', 'kyy') == 555.,\
+ 'Could not get one coefficient for head losses'
+
+ def checkSetandGetMatrix(self):
+ """Check whether the head_losses could be set and get composantes of matrix"""
+ # we create a new zone for head losses
+ loc = LocalizationModel("VolumicZone", self.case)
+ zone = Zone("VolumicZone", label='toto', localization="1 or door", nature="head_losses")
+ loc.addZone(zone)
+
+ mdl = HeadLossesModel(self.case)
+ mdl.setMatrix('2', 1., 1.2, 1.5, 2., 2.2, 2.5, 3., 3.2, 3.5)
+ doc = '''<heads_losses>
+ <head_loss label="toto" name="2">
+ <kxx>0</kxx>
+ <kyy>0</kyy>
+ <kzz>0</kzz>
+ <a11>1</a11>
+ <a12>1.2</a12>
+ <a13>1.5</a13>
+ <a21>2</a21>
+ <a22>2.2</a22>
+ <a23>2.5</a23>
+ <a31>3</a31>
+ <a32>3.2</a32>
+ <a33>3.5</a33>
+ </head_loss>
+ </heads_losses>'''
+
+ assert mdl.node_hloss == self.xmlNodeFromString(doc),\
+ 'Could not set matrix for head losses'
+ assert mdl.getMatrix('2') == (1., 1.2, 1.5, 2., 2.2, 2.5, 3., 3.2, 3.5),\
+ 'Could not get matrix for head losses'
+
+ mdl.setMatrixComposant('2', 'a23', 2300.55)
+ doc2='''<heads_losses>
+ <head_loss label="toto" name="2">
+ <kxx>0</kxx>
+ <kyy>0</kyy>
+ <kzz>0</kzz>
+ <a11>1</a11>
+ <a12>1.2</a12>
+ <a13>1.5</a13>
+ <a21>2</a21>
+ <a22>2.2</a22>
+ <a23>2300.55</a23>
+ <a31>3</a31>
+ <a32>3.2</a32>
+ <a33>3.5</a33>
+ </head_loss>
+ </heads_losses>'''
+ assert mdl.node_hloss == self.xmlNodeFromString(doc2),\
+ 'Could not set one composant of the matrix for head losses'
+ assert mdl.getMatrixComposant('2', 'a23') == 2300.55,\
+ 'Could not get one composant of the matrix for head losses'
+
+
+def suite():
+ testSuite = unittest.makeSuite(HeadLossesModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "HeadLossesModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/HeadLossesView.py b/gui/Pages/HeadLossesView.py
new file mode 100644
index 0000000..5be9316
--- /dev/null
+++ b/gui/Pages/HeadLossesView.py
@@ -0,0 +1,223 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the HeadLosses model data management.
+
+This module contains the following classes:
+- HeadLosses
+- HeadLossesView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from HeadLossesForm import Ui_HeadLossesForm
+from HeadLossesAdvancedOptionsDialogForm import Ui_HeadLossesAdvancedOptionsDialogForm
+import Base.QtPage as QtPage
+from Pages.HeadLossesModel import HeadLossesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("HeadLossesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main view class
+#-------------------------------------------------------------------------------
+
+class HeadLossesView(QWidget, Ui_HeadLossesForm):
+ """
+ Class to open HeadLosses Page.
+ """
+ def __init__(self, parent=None, case=None):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_HeadLossesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = HeadLossesModel(self.case)
+
+ # Combo model
+
+ self.modelTurbModel = QtPage.ComboModel(self.comboBoxTurbModel,10,1)
+
+ self.modelTurbModel.addItem(self.tr("No model (i.e. laminar flow)"), "off")
+ self.modelTurbModel.addItem(self.tr("Mixing length"), "mixing_length")
+ self.modelTurbModel.addItem(self.tr("k-epsilon"), "k-epsilon")
+ self.modelTurbModel.addItem(self.tr("k-epsilon Linear Production"), "k-epsilon-PL")
+ self.modelTurbModel.addItem(self.tr("Rij-epsilon LLR"), "Rij-epsilon")
+ self.modelTurbModel.addItem(self.tr("Rij-epsilon SSG"), "Rij-SSG")
+ self.modelTurbModel.addItem(self.tr("v2f (phi model)"), "v2f-phi")
+ self.modelTurbModel.addItem(self.tr("k-omega SST"), "k-omega-SST")
+ self.modelTurbModel.addItem(self.tr("LES (Smagorinsky)"), "LES_Smagorinsky")
+ self.modelTurbModel.addItem(self.tr("LES (classical dynamic model)"), "LES_dynamique")
+
+ # Connections
+
+ self.connect(self.comboBoxTurbModel, SIGNAL("activated(const QString&)"), self.slotHeadLossesModel)
+ self.connect(self.pushButtonAdvanced, SIGNAL("clicked()"), self.slotAdvancedOptions)
+ self.connect(self.lineEditLength, SIGNAL("textChanged(const QString &)"), self.slotLengthScale)
+
+ # Frames display
+
+ self.frameAdvanced.hide()
+ self.frameLength.hide()
+
+ # Validator
+
+ validator = QtPage.DoubleValidator(self.lineEditLength, min=0.0)
+ validator.setExclusiveMin(True)
+ #validator.setFixup(self.model.defaultHeadLossesValues()['length_scale'])
+ self.lineEditLength.setValidator(validator)
+
+
+ # Update the HeadLosses models list with the calculation features
+
+ for turb in self.model.turbModel:
+ if turb not in self.model.HeadLossesModelsList():
+ self.modelTurbModel.disableItem(str_model=turb)
+
+ # Select the HeadLosses model
+
+ model = self.model.getHeadLossesModel()
+ self.modelTurbModel.setItem(str_model=model)
+ self.slotHeadLossesModel(self.comboBoxTurbModel.currentText())
+
+ # Length scale
+
+ l_scale = self.model.getLengthScale()
+ self.lineEditLength.setText(QString(str(l_scale)))
+
+
+ @pyqtSignature("const QString&")
+ def slotLengthScale(self, text):
+ """
+ Private slot.
+ Input XLOMLG.
+ """
+ l_scale, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.model.setLengthScale(l_scale)
+
+
+ @pyqtSignature("const QString&")
+ def slotHeadLossesModel(self, text):
+ """
+ Private slot.
+ Input ITURB.
+ """
+ model = self.modelTurbModel.dicoV2M[str(text)]
+ self.model.setHeadLossesModel(model)
+
+ self.frameAdvanced.hide()
+ self.frameLength.hide()
+
+ if model == 'mixing_length':
+ self.frameLength.show()
+ self.frameAdvanced.hide()
+ self.model.getLengthScale()
+ elif model not in ('off', 'LES_Smagorinsky', 'LES_dynamique'):
+ self.frameLength.hide()
+ self.frameAdvanced.show()
+
+ if model in ('off', 'LES_Smagorinsky', 'LES_dynamique'):
+ self.line.hide()
+ else:
+ self.line.show()
+
+## if model in ('LES_Smagorinsky', 'LES_dynamique'):
+## title = self.tr("HeadLosses model")
+## msg = self.tr("Please report to the informations \n" \
+## "contain in the user subroutine: 'ussmag'")
+## QMessageBox.warning(self, title, msg)
+
+
+ @pyqtSignature("")
+ def slotAdvancedOptions(self):
+ """
+ Private slot.
+ Ask one popup for advanced specifications
+ """
+ default = {}
+ default['model'] = self.model.getHeadLossesModel()
+ default['scale_model'] = self.model.getScaleModel()
+ default['gravity_terms'] = self.model.getGravity()
+ log.debug("slotAdvancedOptions -> %s" % str(default))
+
+ dialog = HeadLossesAdvancedOptionsDialogView(self, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotAdvancedOptions -> %s" % str(result))
+ self.model.setHeadLossesModel(result['model'])
+ self.model.setScaleModel(result['scale_model'])
+ self.model.setGravity(result['gravity_terms'])
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/IdentityAndPathesForm.ui b/gui/Pages/IdentityAndPathesForm.ui
new file mode 100644
index 0000000..e684587
--- /dev/null
+++ b/gui/Pages/IdentityAndPathesForm.ui
@@ -0,0 +1,252 @@
+<ui version="4.0" >
+ <class>IdentityAndPathesForm</class>
+ <widget class="QWidget" name="IdentityAndPathesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>264</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Directory of the case</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditCasePath" >
+ <property name="minimumSize" >
+ <size>
+ <width>310</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="statusTip" >
+ <string>Please give the absolute path of the case directory or use the dialog box.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButton" >
+ <property name="statusTip" >
+ <string>Select the case directory</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >:/new/prefix1/icons/22x22/folder-open.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+S</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Associated sub-directories of the case</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_1" >
+ <property name="text" >
+ <string>Data</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditData" >
+ <property name="minimumSize" >
+ <size>
+ <width>215</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Results</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditResults" >
+ <property name="minimumSize" >
+ <size>
+ <width>215</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>User subroutines</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditUserSrc" >
+ <property name="minimumSize" >
+ <size>
+ <width>215</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Running scripts</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditScripts" >
+ <property name="minimumSize" >
+ <size>
+ <width>215</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Directory of meshes</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLineEdit" name="lineEditMeshPath" >
+ <property name="minimumSize" >
+ <size>
+ <width>215</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/IdentityAndPathesModel.py b/gui/Pages/IdentityAndPathesModel.py
new file mode 100644
index 0000000..1da5f3b
--- /dev/null
+++ b/gui/Pages/IdentityAndPathesModel.py
@@ -0,0 +1,200 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Page in which the user defines the path of the treated
+case. The Page verify that the case configuration directories is appropriate.
+
+This module contents the following classes:
+- IdentityAndPathesModel
+- IdentityAndPathesModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, string, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+
+import Pages.MatisseModel as Matisse
+import Pages.MatisseTypeModel as MatisseType
+import Pages.MatisseGeomModel as MatisseGeom
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class IdentityAndPathesModel(Model):
+ """
+ Class to manipulate xml file.
+ """
+ def __init__(self, case):
+ """
+ Constuctor.
+ """
+ self.case = case
+
+
+ def getXmlFileName(self):
+ """
+ Get xml file'name
+ """
+ return self.case['xmlfile']
+
+
+ def getCasePath(self):
+ """
+ Get xml file'name
+ """
+ return self.case['case_path']
+
+
+ def setId(self, ncase, nstudy):
+ """
+ Put case and study's names
+ """
+ self.case.root().xmlSetAttribute(case=ncase, study=nstudy)
+
+
+ def setCasePath(self, dircase):
+ """
+ Put path of case into xml file
+ """
+ self.case['case_path'] = dircase
+
+
+ def setRelevantSubdir(self, val, directory):
+ """
+ Put relevant_subdir value into xml file
+ """
+ self.isInList(val, ('yes', 'no'))
+
+ dirList = ["DATA", "RESU", "SRC", "SCRIPTS",
+ 'data_path','resu_path',
+ 'user_src_path','scripts_path','mesh_path']
+ self.isInList(directory, dirList)
+
+ self.case['relevant_subdir'] = val
+
+ if self.case['relevant_subdir'] == 'yes' and \
+ Tool.GuiParam.matisse and directory == 'mesh_path':
+ Matisse.MatisseInit(self.case)
+
+
+ def setPath(self, pathi, tag):
+ """
+ Put relevant_subdir value into xml file
+ """
+ self.isInList(pathi, ('data_path','resu_path',
+ 'user_src_path',
+ 'scripts_path','mesh_path'))
+ self.case[pathi] = tag
+
+#-------------------------------------------------------------------------------
+# IdentityAndPathesModel test Case
+#-------------------------------------------------------------------------------
+
+class IdentityAndPathesModelTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkIdentityAndPathesModelInstantiation(self):
+ """Check whether the IdentityAndPathesModel class could be instantiated"""
+ model = None
+ model = IdentityAndPathesModel(self.case)
+ assert model != None, 'Could not instantiate IdentityAndPathesModel'
+
+
+ def checkGetXmlFileName(self):
+ model = IdentityAndPathesModel(self.case)
+ model.setId('castoto', 'etude')
+ self.case['xmlfile'] = 'trucmuche.xml'
+ assert model.getXmlFileName() == 'trucmuche.xml',\
+ 'Could not get name of xml in IdentityAndPathesModel'
+
+
+ def checkSetCaseandStudy(self):
+ model = IdentityAndPathesModel(self.case)
+ model.setId('castoto', 'etude')
+
+ assert self.case.root()['case'] == 'castoto',\
+ 'Could not get case name in IdentityAndPathesModel'
+ assert self.case.root()['study'] == 'etude',\
+ 'Could not get study name in IdentityAndPathesModel'
+
+
+ def checkSetRelevantSubdir(self):
+ model = IdentityAndPathesModel(self.case)
+ model.setId('castoto', 'etude')
+ model.setRelevantSubdir('yes', 'mesh_path')
+ assert self.case['relevant_subdir'] == 'yes',\
+ 'Could not set relevant subdir in IdentityAndPathesModel'
+
+
+ def checkSetandGetCase(self):
+ model = IdentityAndPathesModel(self.case)
+ model.setId('castoto', 'etude')
+ directory = os.getcwd()
+ model.setCasePath(directory)
+ assert model.getCasePath() == directory,\
+ 'Could not set or get case path in IdentityAndPathesModel'
+
+
+ def checkSetPathI(self):
+ model = IdentityAndPathesModel(self.case)
+ model.setId('castoto', 'etude')
+ dir = os.getcwd()
+ dir_resu = dir + '/RESU'
+ model.setPath('resu_path', dir_resu)
+ assert self.case['resu_path'] == dir_resu,\
+ 'Could not set pathI in IdentityAndPathesModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(IdentityAndPathesModelTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "IdentityAndPathesModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/IdentityAndPathesView.py b/gui/Pages/IdentityAndPathesView.py
new file mode 100644
index 0000000..00e030f
--- /dev/null
+++ b/gui/Pages/IdentityAndPathesView.py
@@ -0,0 +1,241 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Page in which the user defines the path of the treated
+case. The Page verify that the case configuration directories is appropriate.
+
+This module contains the following classes:
+- IdentityAndPathesView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, string
+import logging
+from PyQt4 import QtGui, QtCore
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from IdentityAndPathesForm import Ui_IdentityAndPathesForm
+import Base.QtPage as QtPage
+from Pages.IdentityAndPathesModel import IdentityAndPathesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("IdentityAndPathesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Relevant directories label
+#-------------------------------------------------------------------------------
+
+sub_dir = ["DATA", "RESU", "SRC", "SCRIPTS"]
+meshes_dir = "MESH"
+unknown_dir = "????????"
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class IdentityAndPathesView(QtGui.QWidget, Ui_IdentityAndPathesForm):
+ """
+ Class to open Identity and Pathes Page.
+ """
+ def __init__(self, parent, case, study):
+ """
+ Constructor
+ """
+ QtGui.QWidget.__init__(self, parent)
+
+ Ui_IdentityAndPathesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.study = study
+
+ self.path = ['data_path',
+ 'resu_path',
+ 'user_src_path',
+ 'scripts_path',
+ 'mesh_path']
+
+ self.mdl = IdentityAndPathesModel(self.case)
+
+ # Create the Page layout.
+ self.connect(self.toolButton, QtCore.SIGNAL("pressed()"), self.searchDir)
+ self.lineEditCasePath.setReadOnly(True)
+
+ # Initialize the contens of the widgets.
+ if not self.case['case_path']:
+
+ # Set case path to its default value
+ #
+ fic = self.mdl.getXmlFileName()
+ if not fic:
+ f = os.getcwd()
+ if os.path.basename(f) == 'DATA': f = os.path.dirname(f)
+ self.mdl.setCasePath(f)
+ else :
+ file_dir = os.path.split(fic)[0]
+ if file_dir:
+ self.mdl.setCasePath(os.path.split(file_dir)[0])
+ if not os.path.basename(file_dir) == 'DATA':
+
+ title = self.tr("WARNING")
+ msg = self.tr("Warning: the xml file must be in directory "\
+ "DATA of the case.")
+ QtGui.QMessageBox.warning(self, title, msg)
+ self.mdl.setCasePath(file_dir)
+ else:
+ self.mdl.setCasePath(os.path.split(os.getcwd())[0])
+
+ self.case_path = self.mdl.getCasePath()
+ self.lineEditCasePath.setText(self.case_path)
+ self.getAbsolutePath()
+
+
+ def updateId(self, case_path):
+ """
+ Update Study and Case names in the StudyId bar.
+ """
+ case_name = os.path.basename(case_path)
+ self.spath = os.path.split(case_path)[0]
+ study_name = os.path.basename(self.spath)
+
+ self.mdl.setId(case_name, study_name)
+ fic = self.mdl.getXmlFileName()
+ self.study.set(study=study_name, case=case_name, filename=fic)
+
+
+ def searchDir(self):
+ """
+ Open a File Dialog in order to search the case directory.
+ """
+ path_case = self.mdl.getCasePath()
+
+ title = self.tr("Select directory")
+ default = path_case
+ options = QtGui.QFileDialog.ShowDirsOnly # | QtGui.QFileDialog.DontResolveSymlinks
+ dir_name = QtGui.QFileDialog.getExistingDirectory(self, title, default, options)
+ dir_name = str(dir_name)
+
+ if dir_name:
+ self.case_path = dir_name
+ self.lineEditCasePath.setText(self.case_path)
+ self.getAbsolutePath()
+ self.updateId(dir_name)
+
+
+ def getAbsolutePath(self):
+ """
+ Get absolute path for the case sub-directories and the meshes.
+ """
+ self.case_path = str(self.lineEditCasePath.text())
+ self.lineEditCasePath.setText(self.case_path)
+ case_dir = os.path.abspath(self.case_path)
+ self.case_path = case_dir
+
+ line_name = ['Data', 'Results', 'UserSrc', 'Scripts']
+
+ if os.path.isdir(case_dir) :
+ self.mdl.setCasePath(case_dir)
+ self.updateId(case_dir)
+
+ msg = [self.tr("Warning: the DATA sub-directory DATA is required."),
+ self.tr("Warning: the RESU sub-directory RESU is required."),
+ self.tr("Warning: the SRC sub-directory SRC is required."),
+ self.tr("Warning: the SCRIPTS sub-directory SCRIPTS is required.")]
+
+ msgError = self.tr("Associated sub-directory not found")
+
+ for i in range(0,4) :
+ if sub_dir[i] in os.listdir(case_dir):
+ self.mdl.setPath(self.path[i], os.path.abspath(case_dir + '/' + sub_dir[i]))
+ line = getattr(self, "lineEdit"+line_name[i]) # line is self.lineEditXXX
+ line.setText(QtCore.QString(sub_dir[i]))
+ line.setStatusTip("")
+ self.mdl.setRelevantSubdir("yes", sub_dir[i])
+ else:
+ self.mdl.setPath(self.path[i], "")
+ line = getattr(self, "lineEdit"+line_name[i]) # line is self.lineEditXXX
+ line.setText(msgError)
+ line.setStatusTip(msg[i])
+ self.mdl.setRelevantSubdir("no", sub_dir[i])
+
+ if os.path.isdir(self.spath) and meshes_dir in os.listdir(self.spath):
+ self.mdl.setPath(self.path[4], os.path.abspath(self.spath + '/' + meshes_dir))
+ self.lineEditMeshPath.setText(QtCore.QString(meshes_dir))
+ self.setStatusTip("")
+ self.mdl.setRelevantSubdir("yes", self.path[4])
+ else:
+ self.mdl.setPath(self.path[4], "")
+ self.lineEditMeshPath.setText(msgError)
+ msg = self.tr("Warning: the MESH directory "\
+ "is required, at the level of the case directory.")
+ self.lineEditMeshPath.setStatusTip(msg)
+ self.mdl.setRelevantSubdir("no", self.path[4])
+
+ else:
+ for i in range(0,4) :
+ line = getattr(self, "lineEdit"+line_name[i]) # line is self.lineEditXXX
+ line.setText(unknown_dir)
+ self.lineEditMeshPath.setText(unknown_dir)
+
+ msg = self.tr("Warning: the given directory does not exist.")
+ self.lineEditMeshPath.setStatusTip(msg)
+ self.mdl.setRelevantSubdir("no", '')
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/InitializationForm.ui b/gui/Pages/InitializationForm.ui
new file mode 100644
index 0000000..753dd07
--- /dev/null
+++ b/gui/Pages/InitializationForm.ui
@@ -0,0 +1,837 @@
+<ui version="4.0" >
+ <class>InitializationForm</class>
+ <widget class="QWidget" name="InitializationForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>943</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxZone" >
+ <property name="title" >
+ <string>Select volume zone for initialization</string>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelZone" >
+ <property name="text" >
+ <string>Volume zone</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxZone" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxVelocity" >
+ <property name="title" >
+ <string>Velocity initialization</string>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label_U" >
+ <property name="text" >
+ <string>U</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_V" >
+ <property name="text" >
+ <string>V</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_W" >
+ <property name="text" >
+ <string>W</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLineEdit" name="lineEditU" />
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelUnitU" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLineEdit" name="lineEditV" />
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelUnitV" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLineEdit" name="lineEditW" />
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="labelUnitW" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QGroupBox" name="groupBoxThermal" >
+ <property name="title" >
+ <string>Thermal scalar initialization</string>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelThermal" >
+ <property name="text" >
+ <string>Temp</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditThermal" />
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitThermal" >
+ <property name="text" >
+ <string>C</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QGroupBox" name="groupBoxTurbulence" >
+ <property name="title" >
+ <string>Turbulence initialization</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxTurbulence" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameKeps" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelKeps_k" >
+ <property name="text" >
+ <string>k</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelKeps_eps" >
+ <property name="text" >
+ <string>eps</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLineEdit" name="lineEditKeps_k" />
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelUnitKeps_k" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLineEdit" name="lineEditKeps_eps" />
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelUnitKeps_eps" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>3</sup></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameRij" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelR11" >
+ <property name="text" >
+ <string>R<sub>11</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelR22" >
+ <property name="text" >
+ <string>R<sub>22</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelR33" >
+ <property name="text" >
+ <string>R<sub>33</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelR12" >
+ <property name="text" >
+ <string>R<sub>12</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelR13" >
+ <property name="text" >
+ <string>R<sub>13</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelR23" >
+ <property name="text" >
+ <string>R<sub>23</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelRijEps" >
+ <property name="text" >
+ <string>eps</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLineEdit" name="lineEditR11" />
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelUnitR11" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLineEdit" name="lineEditR22" />
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelUnitR22" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLineEdit" name="lineEditR33" />
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="labelUnitR33" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLineEdit" name="lineEditR12" />
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="labelUnitR12" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLineEdit" name="lineEditR13" />
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLabel" name="labelUnitR13" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLineEdit" name="lineEditR23" />
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLabel" name="labelUnitR23" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <widget class="QLineEdit" name="lineEditRijEps" />
+ </item>
+ <item row="6" column="1" >
+ <widget class="QLabel" name="labelUnitRijEps" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>3</sup></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="framev2f" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelv2f_k" >
+ <property name="text" >
+ <string>k</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelv2f_eps" >
+ <property name="text" >
+ <string>eps</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelv2f_phi" >
+ <property name="text" >
+ <string>phi</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelv2f_fb" >
+ <property name="text" >
+ <string>fb</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLineEdit" name="lineEditv2f_k" />
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelUbitv2f_k" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLineEdit" name="lineEditv2f_eps" />
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelUbitv2f_eps" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>3</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLineEdit" name="lineEditv2f_phi" />
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLineEdit" name="lineEditv2f_fb" />
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="labelUbitv2f_fb" >
+ <property name="text" >
+ <string>s<sup>-1</sup></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameKomega" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelKomega_k" >
+ <property name="text" >
+ <string>k</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelKomega_omega" >
+ <property name="text" >
+ <string>omega</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLineEdit" name="lineEditKomega_k" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelUnitKomega_k" >
+ <property name="text" >
+ <string>m<sup>2</sup>/s<sup>2</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLineEdit" name="lineEditKomega_omega" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelUnitKomega_omega" >
+ <property name="text" >
+ <string>s<sup>-1</sup></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameReference" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelRefVelocity" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: UREF</string>
+ </property>
+ <property name="text" >
+ <string>Reference velocity</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditRefVelocity" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: UREF</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitRefVelocity" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelRefLength" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ALMAX</string>
+ </property>
+ <property name="text" >
+ <string>Reference length</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditRefLength" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ALMAX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelUnitRefLength" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/InitializationModel.py b/gui/Pages/InitializationModel.py
new file mode 100644
index 0000000..55888b2
--- /dev/null
+++ b/gui/Pages/InitializationModel.py
@@ -0,0 +1,576 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module initialize model dynamics variables and model scalars
+
+This module contents the following classes:
+- InitializationModel
+- InitializationTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, string, unittest
+from math import pow
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLmodel import XMLmodel, ModelTest
+from Base.XMLvariables import Model
+from TurbulenceModel import TurbulenceModel
+from ThermalScalarModel import ThermalScalarModel
+from GasCombustionModel import GasCombustionModel
+from CoalCombustionModel import CoalCombustionModel
+from ElectricalModelsModel import ElectricalModel
+from DefineUserScalarsModel import DefineUserScalarsModel
+from LocalizationModel import LocalizationModel
+
+#-------------------------------------------------------------------------------
+# Multi-selection string
+#-------------------------------------------------------------------------------
+
+MULTISEL = "*****"
+
+#-------------------------------------------------------------------------------
+# Variables and Scalar model initialization modelling class
+#-------------------------------------------------------------------------------
+
+class InitializationModel(Model):
+ """
+ Class for Variables and Scalar model initialization.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ models = self.case.xmlGetNode('thermophysical_models')
+ self.node_veloce = models.xmlGetNode('velocity_pressure')
+ self.node_turb = models.xmlGetNode('turbulence', 'model')
+ self.node_therm = models.xmlGetNode('thermal_scalar', 'model')
+
+ self.VelocityList = ('velocity_U', 'velocity_V', 'velocity_W')
+ self.Turb_var_List = ('turb_k', 'turb_eps',
+ 'component_R11', 'component_R22', 'component_R33',
+ 'component_R12', 'component_R13', 'component_R23',
+ 'turb_phi', 'turb_fb', 'turb_omega')
+
+ self.turb = TurbulenceModel(self.case)
+ self.turbulenceModes = ('values',
+ 'reference_velocity',
+ 'reference_velocity_length')
+
+
+ def __defaultValues(self):
+ """
+ Private method.
+ Return in a dictionnary which contains default values.
+ """
+ default = {}
+ default['init_mode'] = "reference_velocity"
+ default['velocity'] = 0.0
+ default['turb_velocity'] = 1.0
+ default['length'] = 1
+
+ # Initialization of k, eps, phi, fb, omega, R11, R22, R33,
+ # with standard formulae
+
+ Uref = float(1.)
+ Almax = float(1.)
+ Cmu = 0.09
+
+ default['turb_k'] = 1.5 * pow((0.02*Uref), 2)
+ default['turb_eps'] = pow(default['turb_k'], 1.5) / Cmu / Almax
+ default['turb_phi'] = float(2./3.)
+ default['turb_fb'] = 0
+ default['turb_omega'] = default['turb_eps'] / default['turb_k'] / Cmu
+ default['component_R11'] = pow((0.02*Uref), 2)
+ default['component_R22'] = pow((0.02*Uref), 2)
+ default['component_R33'] = pow((0.02*Uref), 2)
+ default['component_R12'] = 0.0
+ default['component_R23'] = 0.0
+ default['component_R13'] = 0.0
+ default['temperature'] = 0.0
+ default['pressure'] = 0.0
+
+ return default
+
+
+ def __verifyZone(self, zone):
+ """Private method.
+ Verify if zone exists and raise ValueError if not.
+ """
+ self.isInt(int(zone))
+ self.isInList(zone, LocalizationModel('VolumicZone', self.case).getCodeNumbersList())
+
+
+ def __initTurbulenceInitialValues(self, zone):
+ """
+ Private method.
+ Initialize values for turbulence variables.
+ """
+ self.__verifyZone(zone)
+ turb_model = self.turb.getTurbulenceModel()
+
+ if turb_model in ('k-epsilon', 'k-epsilon-PL'):
+ for txt in ('turb_k', 'turb_eps'):
+ self.getTurbulenceInitialValue(zone, txt)
+
+ elif turb_model in ('Rij-epsilon', 'Rij-epsilon-SSG'):
+ for txt in ('component_R11',
+ 'component_R22',
+ 'component_R33',
+ 'component_R12',
+ 'component_R13',
+ 'component_R23',
+ 'turb_eps'):
+ self.getTurbulenceInitialValue(zone, txt)
+
+ elif turb_model == 'v2f-phi':
+ for txt in ('turb_k',
+ 'turb_eps',
+ 'turb_phi',
+ 'turb_fb'):
+ self.getTurbulenceInitialValue(zone, txt)
+
+ elif turb_model == 'k-omega-SST':
+ for txt in ('turb_k', 'turb_omega'):
+ self.getTurbulenceInitialValue(zone, txt)
+
+
+ def __setDefaultTurbulenceInitialValues(self, zone, choice):
+ """
+ Private method.
+ Set the values of initialization by default according
+ to the choice of the initialization of turbulence
+ """
+ self.__verifyZone(zone)
+ self.isInList(choice, self.turbulenceModes)
+
+ if choice == 'reference_velocity':
+ self.getReferenceVelocity()
+ elif choice == 'reference_velocity_length':
+ self.getReferenceVelocityAndLength()
+ elif choice == 'values':
+ self.__initTurbulenceInitialValues(zone)
+
+
+ def setInitialVelocity(self, zone, var_name, var_init):
+ """
+ Public method.
+ Set values for initialization of velocity.
+ """
+ self.__verifyZone(zone)
+ self.isFloat(var_init)
+ self.isInList(var_name, self.VelocityList)
+
+ node = self.node_veloce.xmlGetNode('variable', name=var_name)
+ if not node:
+ msg = "There is an error: this node " + str(node) + "should be existed"
+ raise ValueError, msg
+
+ n = node.xmlInitChildNode('initial_value', zone=zone)
+ if var_init == 0:
+ n.xmlRemoveNode()
+ else:
+ n.xmlSetTextNode(var_init)
+
+
+ def getInitialVelocity(self, zone):
+ """
+ Public method.
+ Return values for initialization of velocity in a list.
+ """
+ self.__verifyZone(zone)
+ velocity_list = []
+
+ for var_name in self.VelocityList:
+ node = self.node_veloce.xmlGetNode('variable', name=var_name)
+ if not node:
+ msg = "There is an error: this node " + str(node) + "should be existed"
+ raise ValueError, msg
+ v = node.xmlGetDouble('initial_value', zone=zone)
+ if v == None:
+ v = self.__defaultValues()['velocity']
+ velocity_list.append(v)
+
+ return velocity_list
+
+
+ def setInitialTurbulenceChoice(self, zone, init_mode):
+ """
+ Public method.
+ Set the initialization mode in the attribute choice.
+ """
+ self.__verifyZone(zone)
+ self.isInList(init_mode, self.turbulenceModes)
+
+ node_init = self.node_turb.xmlInitNode('initialization')
+ node_init['choice'] = init_mode
+ self.__setDefaultTurbulenceInitialValues(zone, init_mode)
+
+
+ def getInitialTurbulenceChoice(self, zone):
+ """
+ Public method.
+ Return the turbulence initialization choice.
+ """
+ self.__verifyZone(zone)
+ node_init = self.node_turb.xmlInitNode('initialization')
+ choice = node_init['choice']
+
+ if choice not in self.turbulenceModes:
+ choice = self.__defaultValues()['init_mode']
+ node_init['choice'] = choice
+ self.__setDefaultTurbulenceInitialValues(zone, choice)
+
+ return choice
+
+
+ def setReferenceVelocity(self, velocity):
+ """
+ Public method.
+ Set the reference velocity for initialization of turbulence (UREF).
+ """
+ self.isFloat(velocity)
+
+ node_init = self.node_turb.xmlGetNode('initialization')
+ if not node_init:
+ msg = "There is an error: this node " + str(node_init) + "should be existed"
+ raise ValueError, msg
+
+ self.isInList(node_init['choice'], ('reference_velocity','reference_velocity_length'))
+
+ node_init.xmlSetData('reference_velocity', velocity)
+
+
+ def getReferenceVelocity(self):
+ """
+ Public method.
+ Return the reference velocity for initialization of turbulence(UREF).
+ """
+ node_init = self.node_turb.xmlGetNode('initialization',
+ choice='reference_velocity')
+ if not node_init:
+ msg = "There is an error: this node " + str(node_init) + "should be existed"
+ raise ValueError, msg
+
+ v = node_init.xmlGetDouble('reference_velocity')
+ if v == None:
+ v = self.__defaultValues()['turb_velocity']
+ self.setReferenceVelocity(v)
+
+ return v
+
+
+ def setReferenceLength(self, length):
+ """
+ Public method.
+ Set the reference length (ALMAX).
+ """
+ self.isStrictPositiveFloat(length)
+
+ node_init = self.node_turb.xmlGetNode('initialization',
+ choice='reference_velocity_length')
+ if not node_init:
+ msg = "There is an error: this node " + str(node_init) + "should be existed"
+ raise ValueError, msg
+
+ node_init.xmlSetData('reference_length', length)
+
+
+ def getReferenceVelocityAndLength(self):
+ """
+ Public method.
+ Return the reference velocity and length.
+ """
+ node_init = self.node_turb.xmlGetNode('initialization',
+ choice='reference_velocity_length')
+ if not node_init:
+ msg = "There is an error: this node " + str(node_init) + "should be existed"
+ raise ValueError, msg
+
+ v = node_init.xmlGetDouble('reference_velocity')
+ if v == None:
+ v = self.__defaultValues()['turb_velocity']
+ self.setReferenceVelocity(v)
+
+ l = node_init.xmlGetDouble('reference_length')
+ if l == None:
+ l = self.__defaultValues()['length']
+ self.setReferenceLength(l)
+
+ return v, l
+
+
+ def setTurbulenceInitialValue(self, zone, var_name, var_init):
+ """
+ Public method.
+ Set values for initialization of turbulence variables.
+ """
+ self.__verifyZone(zone)
+ self.isInList(var_name, self.Turb_var_List)
+ self.isFloat(var_init)
+
+ node = self.node_turb.xmlGetNode('variable', name=var_name)
+ if not node:
+ msg = "There is an error: this node " + str(node) + "should be existed"
+ raise ValueError, msg
+
+ node.xmlInitNode('initial_value', zone=zone)
+ node.xmlSetData('initial_value', var_init, zone=zone)
+
+
+ def getTurbulenceInitialValue(self, zone, var_name):
+ """
+ Public method.
+ Return values for initialization of turbulence variable.
+ """
+ self.__verifyZone(zone)
+ self.isInList(var_name, self.Turb_var_List)
+
+ node = self.node_turb.xmlGetNode('variable', name=var_name)
+ if not node:
+ msg = "There is an error: this node " + str(node) + "should be existed"
+ raise ValueError, msg
+
+ init = node.xmlGetDouble('initial_value', zone=zone)
+ if init == None:
+ init = self.__defaultValues()[var_name]
+ self.setTurbulenceInitialValue(zone, var_name, init)
+
+ return init
+
+
+ def getTurbulenceVariableLabel(self, var_name):
+ """
+ Public method.
+ Return the label of the turbulence variables. Only for the view.
+ """
+ self.isInList(var_name, self.Turb_var_List)
+
+ label = Tool.dicoLabel(var_name)
+ node = self.node_turb.xmlGetNode('variable', name=var_name)
+ if node:
+ label = node['label']
+
+ return label
+
+
+ def getVelocityLabel(self):
+ """
+ Public method.
+ Return the list of users labels for velocity. Only for the view
+ """
+ label_list = []
+
+ for var_name in self.VelocityList:
+ node = self.node_veloce.xmlGetNode('variable', name=var_name)
+ if not node:
+ msg = "There is an error: this node " + str(node) + "should be existed"
+ raise ValueError, msg
+ label_list.append(node['label'])
+
+ return label_list
+
+
+#-------------------------------------------------------------------------------
+# InitializationModel test case
+#-------------------------------------------------------------------------------
+
+
+class InitializationTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkInitializationInstantiation(self):
+ """Check whether the InitializationModel class could be instantiated."""
+ model = None
+ model = InitializationModel(self.case)
+ assert model != None, 'Could not instantiate InitializationModel'
+
+
+ def checkSetAndGetInitialVelocity(self):
+ """Check whether the velocity initial value could be set and get"""
+ mdl = InitializationModel(self.case)
+ zone = '1'
+ mdl.setInitialVelocity(zone, 'velocity_U', 123)
+ mdl.setInitialVelocity(zone, 'velocity_V', 1.e+2)
+ mdl.setInitialVelocity(zone, 'velocity_W', 0)
+
+ doc = '''<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U">
+ <initial_value zone="1">123</initial_value>
+ </variable>
+ <variable label="VelocitV" name="velocity_V">
+ <initial_value zone="1">100.0</initial_value>
+ </variable>
+ <variable label="VelocitW" name="velocity_W"/>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>'''
+
+ assert mdl.node_veloce == self.xmlNodeFromString(doc), \
+ 'Could not set the initial values of velocity'
+
+ assert mdl.getInitialVelocity(zone) == [123.0, 100.0, 0.0], \
+ 'Could not get the initial velocity values'
+
+
+ def checkSetAndGetInitialTurbulenceChoice(self):
+ """Check whether the velocity initial value choice could be set."""
+ mdl = InitializationModel(self.case)
+ zone = '1'
+ mdl.turb.setTurbulenceModel('k-epsilon')
+ mdl.setInitialTurbulenceChoice('1', 'reference_velocity')
+
+ doc = '''<turbulence model="k-epsilon">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ </turbulence>'''
+
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set choice for initialization of the turbulence'
+
+ assert mdl.getInitialTurbulenceChoice('1') == 'reference_velocity',\
+ 'Could not get choice of initialization of the turbulence'
+
+
+ def checkSetAndGetReferenceVelocity(self):
+ """Check whether the reference velocity value could be set and get"""
+ mdl = InitializationModel(self.case)
+ zone = '1'
+ mdl.turb.setTurbulenceModel('k-epsilon')
+ mdl.setReferenceVelocity(5)
+ doc = '''<turbulence model="k-epsilon">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>5</reference_velocity>
+ </initialization>
+ </turbulence>'''
+
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set values of reference velocity for initialization of the turbulence'
+
+ assert mdl.getReferenceVelocity() == 5,\
+ 'Could not get values of reference velocity for initialization of the turbulence'
+
+
+ def checkSetAndGetReferenceLength(self):
+ """Check whether the reference lenght value could be set and get"""
+ mdl = InitializationModel(self.case)
+ zone = '1'
+ mdl.turb.setTurbulenceModel('k-epsilon')
+ mdl.setInitialTurbulenceChoice('1', 'reference_velocity_length')
+ mdl.setReferenceVelocity(5)
+ mdl.setReferenceLength(155.8)
+
+ doc = '''<turbulence model="k-epsilon">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity_length">
+ <reference_velocity>5</reference_velocity>
+ <reference_length>155.8</reference_length>
+ </initialization>
+ </turbulence>'''
+
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set values of reference length for initialization of the turbulence'
+
+ assert mdl.getReferenceVelocityAndLength() == (5, 155.8),\
+ 'Could not get values of reference length for initialization of the turbulence'
+
+
+ def checkSetAndGetTurbulenceInitialValue(self):
+ """Check whether the initial values of turbulence could be set.and get"""
+ mdl = InitializationModel(self.case)
+ zone = '1'
+ mdl.turb.setTurbulenceModel('Rij-epsilon')
+ mdl.setTurbulenceInitialValue(zone, 'component_R11', 0.0011)
+ mdl.setTurbulenceInitialValue(zone, 'component_R22', 0.0022)
+ mdl.setTurbulenceInitialValue(zone, 'component_R33', 0.0033)
+ doc = '''<turbulence model="Rij-epsilon">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ <variable label="R11" name="component_R11">
+ <initial_value zone="1">0.0011</initial_value>
+ </variable>
+ <variable label="R22" name="component_R22">
+ <initial_value zone="1">0.0022</initial_value>
+ </variable>
+ <variable label="R33" name="component_R33">
+ <initial_value zone="1">0.0033</initial_value>
+ </variable>
+ <variable label="R12" name="component_R12"/>
+ <variable label="R13" name="component_R13"/>
+ <variable label="R23" name="component_R23"/>
+ </turbulence>'''
+
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set initial values of the turbulence'
+
+ assert mdl.getTurbulenceInitialValue(zone, 'component_R22') == 0.0022,\
+ 'Could not get initial values of the turbulence'
+
+
+def suite():
+ testSuite = unittest.makeSuite(InitializationTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "InitializationTestCase - OK !!!!"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/InitializationView.py b/gui/Pages/InitializationView.py
new file mode 100644
index 0000000..b9082fd
--- /dev/null
+++ b/gui/Pages/InitializationView.py
@@ -0,0 +1,721 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following class:
+- InitializationView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from InitializationForm import Ui_InitializationForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import IntValidator, DoubleValidator, ComboModel
+from TurbulenceModel import TurbulenceModel
+from ThermalScalarModel import ThermalScalarModel
+from GasCombustionModel import GasCombustionModel
+from DefineUserScalarsModel import DefineUserScalarsModel
+from Pages.LocalizationModel import VolumicLocalizationModel, LocalizationModel
+from InitializationModel import InitializationModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("InitializationView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class InitializationView(QWidget, Ui_InitializationForm):
+ """
+ """
+ def __init__(self, parent, case, stbar):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_InitializationForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.parent = parent
+
+ self.init = InitializationModel(self.case)
+ self.turb = TurbulenceModel(self.case)
+ self.therm = ThermalScalarModel(self.case)
+ self.th_sca = DefineUserScalarsModel(self.case)
+ self.volzone = LocalizationModel('VolumicZone', self.case)
+
+
+ # 0/ Read label names from XML file
+
+ # Velocity
+ [U, V, W] = self.init.getVelocityLabel()
+ self.label_U.setText(QString(str(U)))
+ self.label_V.setText(QString(str(V)))
+ self.label_W.setText(QString(str(W)))
+
+ # Thermal scalar
+ namesca, unit = self.getThermalLabelAndUnit()
+ self.labelThermal.setText(QString(str(namesca)))
+ self.labelUnitThermal.setText(QString(str(unit)))
+ self.th_sca_label = namesca
+
+ # k-eps
+ label_k = self.init.getTurbulenceVariableLabel('turb_k')
+ label_eps = self.init.getTurbulenceVariableLabel('turb_eps')
+ self.labelKeps_k.setText(QString(str(label_k)))
+ self.labelKeps_eps.setText(QString(str(label_eps)))
+
+ # Rij
+ for (coeff, attr) in [('R11', 'component_R11'),
+ ('R22', 'component_R22'),
+ ('R33', 'component_R33'),
+ ('R12', 'component_R12'),
+ ('R13', 'component_R13'),
+ ('R23', 'component_R23')]:
+ tt = self.init.getTurbulenceVariableLabel(attr)
+ line = getattr(self, "label" + coeff)
+ line.setText(QString(str(tt)))
+
+ tt = self.init.getTurbulenceVariableLabel('turb_eps')
+ self.labelRijEps.setText(QString(str(tt)))
+
+ # v2f
+ labelv2f_k = self.init.getTurbulenceVariableLabel('turb_k')
+ labelv2f_eps = self.init.getTurbulenceVariableLabel('turb_eps')
+ labelv2f_phi = self.init.getTurbulenceVariableLabel('turb_phi')
+ labelv2f_fb = self.init.getTurbulenceVariableLabel('turb_fb')
+ self.labelv2f_k.setText(QString(str(labelv2f_k)))
+ self.labelv2f_eps.setText(QString(str(labelv2f_eps)))
+ self.labelv2f_phi.setText(QString(str(labelv2f_phi)))
+ self.labelv2f_fb.setText(QString(str(labelv2f_fb)))
+
+ # K-omega
+ labelKomega_k = self.init.getTurbulenceVariableLabel('turb_k')
+ labelKomega_omega = self.init.getTurbulenceVariableLabel('turb_omega')
+ self.labelKomega_k.setText(QString(str(labelKomega_k)))
+ self.labelKomega_omega.setText(QString(str(labelKomega_omega)))
+
+ # 1/ Combo box models
+
+ self.modelZone = ComboModel(self.comboBoxZone, 1, 1)
+
+ self.zone = ""
+ zones = self.volzone.getZones()
+ for zone in zones:
+ if zone.getNature()['initialization'] == "on":
+ label = zone.getLabel()
+ name = str(zone.getCodeNumber())
+ self.modelZone.addItem(self.tr(label), name)
+ if label == "all_cells":
+ self.zone = name
+ if not self.zone:
+ self.zone = name
+ else:
+ raise ValueError, "there is no initialization zone defined."
+
+ self.modelZone.setItem(str_model = self.zone)
+
+ self.modelTurbulence = ComboModel(self.comboBoxTurbulence, 3, 1)
+ self.modelTurbulence.addItem(self.tr("Initialization by values for the selected zone"), 'values')
+ self.modelTurbulence.addItem(self.tr("Initialization by reference velocity for all zones"), 'reference_velocity')
+ self.modelTurbulence.addItem(self.tr("Initialization by reference velocity and reference length for all zones"), 'reference_velocity_length')
+
+ # 2/ Connections
+
+ self.connect(self.comboBoxZone, SIGNAL("activated(const QString&)"), self.slotZone)
+ self.connect(self.lineEditU, SIGNAL("textChanged(const QString&)"), self.slotU)
+ self.connect(self.lineEditV, SIGNAL("textChanged(const QString&)"), self.slotV)
+ self.connect(self.lineEditW, SIGNAL("textChanged(const QString&)"), self.slotW)
+ self.connect(self.lineEditThermal, SIGNAL("textChanged(const QString&)"), self.slotThermalValue)
+ self.connect(self.comboBoxTurbulence, SIGNAL("activated(const QString&)"), self.slotChoice)
+ self.connect(self.lineEditKeps_k, SIGNAL("textChanged(const QString&)"), self.slotKeps_k)
+ self.connect(self.lineEditKeps_eps, SIGNAL("textChanged(const QString&)"), self.slotKeps_eps)
+ self.connect(self.lineEditR11, SIGNAL("textChanged(const QString&)"), self.slotR11)
+ self.connect(self.lineEditR22, SIGNAL("textChanged(const QString&)"), self.slotR22)
+ self.connect(self.lineEditR33, SIGNAL("textChanged(const QString&)"), self.slotR33)
+ self.connect(self.lineEditR12, SIGNAL("textChanged(const QString&)"), self.slotR12)
+ self.connect(self.lineEditR13, SIGNAL("textChanged(const QString&)"), self.slotR13)
+ self.connect(self.lineEditR23, SIGNAL("textChanged(const QString&)"), self.slotR23)
+ self.connect(self.lineEditRijEps, SIGNAL("textChanged(const QString&)"), self.slotRijEps)
+ self.connect(self.lineEditv2f_k, SIGNAL("textChanged(const QString&)"), self.slotv2f_k)
+ self.connect(self.lineEditv2f_eps, SIGNAL("textChanged(const QString&)"), self.slotv2f_eps)
+ self.connect(self.lineEditv2f_phi, SIGNAL("textChanged(const QString&)"), self.slotv2f_phi)
+ self.connect(self.lineEditv2f_fb, SIGNAL("textChanged(const QString&)"), self.slotv2f_fb)
+ self.connect(self.lineEditKomega_k, SIGNAL("textChanged(const QString&)"), self.slotKomega_k)
+ self.connect(self.lineEditKomega_omega, SIGNAL("textChanged(const QString&)"), self.slotKomega_omega)
+ self.connect(self.lineEditRefVelocity, SIGNAL("textChanged(const QString&)"), self.slotReferenceVelocity)
+ self.connect(self.lineEditRefLength, SIGNAL("textChanged(const QString&)"), self.slotReferenceVelocityAndLength)
+
+ # 3/ Validator definitions
+
+ validatorU = DoubleValidator(self.lineEditU)
+ validatorV = DoubleValidator(self.lineEditV)
+ validatorW = DoubleValidator(self.lineEditW)
+ validatorThermal = DoubleValidator(self.lineEditThermal)
+ validatorKeps_k = DoubleValidator(self.lineEditKeps_k, min=0.)
+ validatorKeps_eps = DoubleValidator(self.lineEditKeps_eps, min=0.)
+ validatorR11 = DoubleValidator(self.lineEditR11, min=0.)
+ validatorR22 = DoubleValidator(self.lineEditR22, min=0.)
+ validatorR33 = DoubleValidator(self.lineEditR33, min=0.)
+ validatorR12 = DoubleValidator(self.lineEditR12, min=0.)
+ validatorR13 = DoubleValidator(self.lineEditR13, min=0.)
+ validatorR23 = DoubleValidator(self.lineEditR23, min=0.)
+ validatorRijEps = DoubleValidator(self.lineEditRijEps, min=0.)
+ validatorv2f_k = DoubleValidator(self.lineEditv2f_k, min=0.)
+ validatorv2f_eps = DoubleValidator(self.lineEditv2f_eps, min=0.)
+ validatorv2f_phi = DoubleValidator(self.lineEditv2f_phi, min=0.)
+ validatorv2f_fb = DoubleValidator(self.lineEditv2f_fb, min=0.)
+ validatorKomega_k = DoubleValidator(self.lineEditKomega_k, min=0.)
+ validatorKomega_omega = DoubleValidator(self.lineEditKomega_omega, min=0.)
+ validatorRefVelocity = DoubleValidator(self.lineEditRefVelocity, min=0.)
+ validatorRefLength = DoubleValidator(self.lineEditRefLength, min=0.)
+ validatorRefLength.setExclusiveMin()
+
+ self.lineEditU.setValidator(validatorU)
+ self.lineEditV.setValidator(validatorV)
+ self.lineEditW.setValidator(validatorW)
+ self.lineEditThermal.setValidator(validatorThermal)
+ self.lineEditKeps_k.setValidator(validatorKeps_k)
+ self.lineEditKeps_eps.setValidator(validatorKeps_eps)
+ self.lineEditR11.setValidator(validatorR11)
+ self.lineEditR22.setValidator(validatorR22)
+ self.lineEditR33.setValidator(validatorR33)
+ self.lineEditR12.setValidator(validatorR12)
+ self.lineEditR13.setValidator(validatorR13)
+ self.lineEditR23.setValidator(validatorR23)
+ self.lineEditRijEps.setValidator(validatorRijEps)
+ self.lineEditv2f_k.setValidator(validatorv2f_k)
+ self.lineEditv2f_eps.setValidator(validatorv2f_eps)
+ self.lineEditv2f_phi.setValidator(validatorv2f_phi)
+ self.lineEditv2f_fb.setValidator(validatorv2f_fb)
+ self.lineEditKomega_k.setValidator(validatorKomega_k)
+ self.lineEditKomega_omega.setValidator(validatorKomega_omega)
+ self.lineEditRefVelocity.setValidator(validatorRefVelocity)
+ self.lineEditRefLength.setValidator(validatorRefLength)
+
+ # Initialize widget
+
+ self.initializeVariables(self.zone)
+
+
+ @pyqtSignature("const QString&")
+ def slotZone(self, text):
+ """
+ INPUT label for choice of zone
+ """
+ self.zone = self.modelZone.dicoV2M[str(text)]
+ self.initializeVariables(self.zone)
+
+
+ @pyqtSignature("const QString&")
+ def slotU(self, var):
+ """
+ """
+ value, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setInitialVelocity(self.zone, 'velocity_U', value)
+
+
+ @pyqtSignature("const QString&")
+ def slotV(self, var):
+ """
+ """
+ value, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setInitialVelocity(self.zone, 'velocity_V', value)
+
+
+ @pyqtSignature("const QString&")
+ def slotW(self, var):
+ """
+ """
+ value, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setInitialVelocity(self.zone, 'velocity_W', value)
+
+
+ @pyqtSignature("const QString&")
+ def slotChoice(self, text):
+ """
+ INPUT choice of method of initialization
+ """
+ # Hide everything
+ self.frameKeps.hide()
+ self.frameRij.hide()
+ self.framev2f.hide()
+ self.frameKomega.hide()
+ self.frameReference.hide()
+
+ choice = self.modelTurbulence.dicoV2M[str(text)]
+ log.debug("slotChoice choice = %s "%str(choice))
+ self.init.setInitialTurbulenceChoice(self.zone, choice)
+ turb_model = self.turb.getTurbulenceModel()
+
+ if choice == 'values':
+ if turb_model in ('k-epsilon', 'k-epsilon-PL'):
+
+ self.frameKeps.show()
+
+ k = self.init.getTurbulenceInitialValue(self.zone, 'turb_k')
+ eps = self.init.getTurbulenceInitialValue(self.zone, 'turb_eps')
+ self.lineEditKeps_k.setText(QString(str(k)))
+ self.lineEditKeps_eps.setText(QString(str(eps)))
+
+ elif turb_model in ('Rij-epsilon', 'Rij-SSG'):
+
+ self.frameRij.show()
+
+ R11 = self.init.getTurbulenceInitialValue(self.zone, 'component_R11')
+ R22 = self.init.getTurbulenceInitialValue(self.zone, 'component_R22')
+ R33 = self.init.getTurbulenceInitialValue(self.zone, 'component_R33')
+ R12 = self.init.getTurbulenceInitialValue(self.zone, 'component_R12')
+ R13 = self.init.getTurbulenceInitialValue(self.zone, 'component_R13')
+ R23 = self.init.getTurbulenceInitialValue(self.zone, 'component_R23')
+ eps = self.init.getTurbulenceInitialValue(self.zone, 'turb_eps')
+
+ self.lineEditR11.setText(QString(R11))
+ self.lineEditR22.setText(QString(R22))
+ self.lineEditR33.setText(QString(R33))
+ self.lineEditR12.setText(QString(R12))
+ self.lineEditR13.setText(QString(R13))
+ self.lineEditR23.setText(QString(R23))
+ self.lineEditRijEps.setText(QString(eps))
+
+ elif turb_model == 'v2f-phi':
+
+ self.framev2f.show()
+
+ k = self.init.getTurbulenceInitialValue(self.zone, 'turb_k')
+ eps = self.init.getTurbulenceInitialValue(self.zone, 'turb_eps')
+ phi = self.init.getTurbulenceInitialValue(self.zone, 'turb_phi')
+ fb = self.init.getTurbulenceInitialValue(self.zone, 'turb_fb')
+
+ self.lineEditv2f_k.setText(QString(k))
+ self.lineEditv2f_eps.setText(QString(eps))
+ self.lineEditv2f_phi.setText(QString(phi))
+ self.lineEditv2f_fb.setText(QString(fb))
+
+ elif turb_model == 'k-omega-SST':
+
+ self.frameKomega.show()
+
+ k = self.init.getTurbulenceInitialValue(self.zone, 'turb_k')
+ omega = self.init.getTurbulenceInitialValue(self.zone, 'turb_omega')
+
+ self.lineEditKomega_k.setText(QString(k))
+ self.lineEditKomega_omega.setText(QString(omega))
+
+ elif choice == 'reference_velocity':
+
+ self.frameReference.show()
+ self.labelRefLength.hide()
+ self.lineEditRefLength.hide()
+ self.labelUnitRefLength.hide()
+
+ v = self.init.getReferenceVelocity()
+ self.lineEditRefVelocity.setText(QString(str(v)))
+
+ elif choice == 'reference_velocity_length':
+
+ self.frameReference.show()
+ self.labelRefLength.show()
+ self.lineEditRefLength.show()
+ self.labelUnitRefLength.show()
+
+ v, l = self.init.getReferenceVelocityAndLength()
+ self.lineEditRefVelocity.setText(QString(str(v)))
+ self.lineEditRefLength.setText(QString(str(l)))
+
+
+ @pyqtSignature("const QString&")
+ def slotKeps_k(self, var):
+ """
+ INPUT values for K-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_k', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotKeps_eps(self, var):
+ """
+ INPUT values for K-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_eps', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotR11(self, var):
+ """
+ INPUT values for Rij-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'component_R11', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotR12(self, var):
+ """
+ INPUT values for Rij-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'component_R12', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotR13(self, var):
+ """
+ INPUT values for Rij-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'component_R13', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotR22(self, var):
+ """
+ INPUT values for Rij-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'component_R22', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotR23(self, var):
+ """
+ INPUT values for Rij-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'component_R23', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotR33(self, var):
+ """
+ INPUT values for Rij-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'component_R33', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotRijEps(self, var):
+ """
+ INPUT values for Rij-epsilon's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_eps', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotv2f_k(self, var):
+ """
+ INPUT values for v2f's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_k', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotv2f_eps(self, var):
+ """
+ INPUT values for v2f's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_eps', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotv2f_phi(self, var):
+ """
+ INPUT values for v2f's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_phi', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotv2f_fb(self, var):
+ """
+ INPUT values for v2f's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_fb', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotKomega_k(self, var):
+ """
+ INPUT values for k-omega's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_k', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotKomega_omega(self, var):
+ """
+ INPUT values for k-omega's initialization by values
+ """
+ val, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setTurbulenceInitialValue(self.zone, 'turb_omega', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotReferenceVelocity(self, var):
+ """
+ INPUT values for initialization by reference velocity or
+ length and velocity of reference.
+ """
+ UREF, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setReferenceVelocity(UREF)
+
+
+ @pyqtSignature("const QString&")
+ def slotReferenceVelocityAndLength(self, var):
+ """
+ INPUT values for initialization by reference length.
+ """
+ long, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.init.setReferenceLength(long)
+
+# FIXME: slotReferenceVelocityAndLength (long != -1e+12)
+# if long < 0.0:
+# if long != -1e+12:
+# msg = self.tr("THE ONLY AUTHORIZED NEGATIVE VALUE IS: -1e+12")
+# self.stbar.showMessage(msg, 2000)
+# self.lineEditRefLength.setText(QString(""))
+# else:
+# self.init.setReferenceLength(long)
+# else:
+# self.init.setReferenceLength(long)
+
+
+ def getThermalLabelAndUnit(self):
+ """
+ Define the type of model is used.
+ """
+ model = self.therm.getThermalScalarModel()
+
+ if model != 'off':
+ th_sca_label = self.therm.getThermalScalarLabel()
+ if model == "temperature_celsius":
+ unit = "<sup>o</sup>C"
+ elif model == "temperature_kelvin":
+ unit = "Kelvin"
+ elif model == "enthalpy":
+ unit = "J/kg"
+ else:
+ th_sca_label = ''
+ unit = None
+
+ # Value to use in slotThermalValue
+ self.th_sca_label = th_sca_label
+
+ return th_sca_label, unit
+
+
+ @pyqtSignature("const QString&")
+ def slotThermalValue(self, var):
+ """
+ Input the initial value of thermal scalar
+ """
+ v, ok = var.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ min = self.th_sca.getScalarMinValue(self.th_sca_label)
+ max = self.th_sca.getScalarMaxValue(self.th_sca_label)
+ from DefineUserScalarsView import StandardItemModelScalars
+ if StandardItemModelScalars(self.parent, self.th_sca,
+ self.zone).checkInitMinMax(self.th_sca_label, v, min, max):
+ self.th_sca.setScalarInitialValue(self.zone, self.th_sca_label, v)
+
+
+ def initializeVariables(self, zone):
+ """
+ Initialize variables when a new volumic zone is choosen
+ """
+ # Velocity initialization
+
+ [U, V, W] = self.init.getInitialVelocity(zone)
+ self.lineEditU.setText(QString(str(U)))
+ self.lineEditV.setText(QString(str(V)))
+ self.lineEditW.setText(QString(str(W)))
+
+ # Initialisation of Turbulence
+
+ turb_model = self.turb.getTurbulenceModel()
+
+ if turb_model not in ('k-epsilon',
+ 'k-epsilon-PL',
+ 'Rij-epsilon',
+ 'Rij-SSG',
+ 'v2f-phi',
+ 'k-omega-SST'):
+ self.groupBoxTurbulence.hide()
+ else:
+ self.groupBoxTurbulence.show()
+
+ # Select the initialization's choice
+
+ choice = self.init.getInitialTurbulenceChoice(zone)
+ self.modelTurbulence.setItem(str_model = choice)
+ txt = self.comboBoxTurbulence.currentText()
+ self.slotChoice(txt)
+
+ if choice == 'reference_velocity':
+ v = self.init.getReferenceVelocity()
+ self.lineEditRefVelocity.setText(QString(str(v)))
+
+ elif choice == 'reference_velocity_length':
+ v,l = self.init.getReferenceVelocityAndLength()
+ self.lineEditRefVelocity.setText(QString(str(v)))
+ self.lineEditRefLength.setText(QString(str(l)))
+
+ elif choice == 'values':
+
+ if turb_model in ('k-epsilon', 'k-epsilon-PL'):
+
+ k = self.init.getTurbulenceInitialValue(self.zone, 'turb_k')
+ eps = self.init.getTurbulenceInitialValue(self.zone, 'turb_eps')
+ self.lineEditKeps_k.setText(QString(str(k)))
+ self.lineEditKeps_eps.setText(QString(str(eps)))
+
+ elif turb_model in ('Rij-epsilon', 'Rij-epsilon-SSG'):
+
+ R11 = self.init.getTurbulenceInitialValue(self.zone, 'component_R11')
+ R22 = self.init.getTurbulenceInitialValue(self.zone, 'component_R22')
+ R33 = self.init.getTurbulenceInitialValue(self.zone, 'component_R33')
+ R12 = self.init.getTurbulenceInitialValue(self.zone, 'component_R12')
+ R13 = self.init.getTurbulenceInitialValue(self.zone, 'component_R13')
+ R23 = self.init.getTurbulenceInitialValue(self.zone, 'component_R23')
+ eps = self.init.getTurbulenceInitialValue(self.zone, 'turb_eps')
+
+ self.lineEditR11.setText(QString(str(R11)))
+ self.lineEditR22.setText(QString(str(R22)))
+ self.lineEditR33.setText(QString(str(R33)))
+ self.lineEditR12.setText(QString(str(R12)))
+ self.lineEditR13.setText(QString(str(R13)))
+ self.lineEditR23.setText(QString(str(R23)))
+ self.lineEditRijEps.setText(QString(str(eps)))
+
+ elif turb_model == 'v2f-phi':
+
+ k = self.init.getTurbulenceInitialValue(self.zone, 'turb_k')
+ eps = self.init.getTurbulenceInitialValue(self.zone, 'turb_eps')
+ phi = self.init.getTurbulenceInitialValue(self.zone, 'turb_phi')
+ fb = self.init.getTurbulenceInitialValue(self.zone, 'turb_fb')
+
+ self.lineEditv2f_k.setText(QString(str(k)))
+ self.lineEditv2f_eps.setText(QString(str(eps)))
+ self.lineEditv2f_phi.setText(QString(str(phi)))
+ self.lineEditv2f_fb.setText(QString(str(fb)))
+
+ elif turb_model == 'k-omega-SST':
+
+ k = self.init.getTurbulenceInitialValue(self.zone, 'turb_k')
+ omega = self.init.getTurbulenceInitialValue(self.zone, 'turb_omega')
+
+ self.lineEditKomega_k.setText(QString(str(k)))
+ self.lineEditKomega_omega.setText(QString(str(omega)))
+
+
+ # Initialisation of Model Variables if thermal model is selectionned
+
+ name, unit = self.getThermalLabelAndUnit()
+
+ if name == "":
+ self.groupBoxThermal.hide()
+ else:
+ self.groupBoxThermal.show()
+
+ ini = self.th_sca.getScalarInitialValue(zone, name)
+ self.lineEditThermal.setText(QString(str(ini)))
+ self.labelUnitThermal.setText(QString(str(unit)))
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/LagrangianAdvancedOptionsDialogForm.ui b/gui/Pages/LagrangianAdvancedOptionsDialogForm.ui
new file mode 100644
index 0000000..54b37d1
--- /dev/null
+++ b/gui/Pages/LagrangianAdvancedOptionsDialogForm.ui
@@ -0,0 +1,307 @@
+<ui version="4.0" >
+ <class>LagrangianAdvancedOptionsDialogForm</class>
+ <widget class="QDialog" name="LagrangianAdvancedOptionsDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>418</width>
+ <height>292</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" colspan="4" >
+ <widget class="QGroupBox" name="groupBoxOrder" >
+ <property name="title" >
+ <string>Integration for the stochastic differential equations</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>26</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxNORDRE" >
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NORDRE</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>27</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelIDISTU" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDISTU</string>
+ </property>
+ <property name="text" >
+ <string>Particle turbulent dispersion</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>73</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QCheckBox" name="checkBoxIDISTU" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDISTU</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>72</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelIDIFFL" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDIFFL</string>
+ </property>
+ <property name="text" >
+ <string>Suppresses the crossing trajectory effect</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>73</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QCheckBox" name="checkBoxIDIFFL" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDIFFL</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>72</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0" colspan="4" >
+ <widget class="QGroupBox" name="groupBoxModel" >
+ <property name="title" >
+ <string>Complete model for turbulent dispersion</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelMODCPL" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: MODCPL</string>
+ </property>
+ <property name="text" >
+ <string>Starting lagrangian iteration</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditMODCPL" >
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: MODCPL</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelIDIRLA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDIRLA</string>
+ </property>
+ <property name="text" >
+ <string>Main direction of the flow</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="comboBoxIDIRLA" >
+ <property name="minimumSize" >
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDIRLA</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="0" colspan="4" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>6</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>36</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>LagrangianAdvancedOptionsDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>LagrangianAdvancedOptionsDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/LagrangianBoundariesForm.ui b/gui/Pages/LagrangianBoundariesForm.ui
new file mode 100644
index 0000000..057dcbc
--- /dev/null
+++ b/gui/Pages/LagrangianBoundariesForm.ui
@@ -0,0 +1,1152 @@
+<ui version="4.0" >
+ <class>LagrangianBoundariesForm</class>
+ <widget class="QWidget" name="LagrangianBoundariesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>1153</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxBoundaries" >
+ <property name="title" >
+ <string>Lagrangian boundary condition</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewBoundaries" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxClassNumber" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelICLAS" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICLAS</string>
+ </property>
+ <property name="text" >
+ <string>Class number</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QSpinBox" name="spinBoxICLAS" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICLAS</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QGroupBox" name="groupBoxMain" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelIJNBP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IJNBP</string>
+ </property>
+ <property name="text" >
+ <string>Number of particles in class</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QLineEdit" name="lineEditIJNBP" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IJNBP</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelIJFRE" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IJFRE</string>
+ </property>
+ <property name="text" >
+ <string>Frequency of injection</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QLineEdit" name="lineEditIJFRE" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IJFRE</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>31</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="labelICLST" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICLST</string>
+ </property>
+ <property name="text" >
+ <string>Cluster number for particle</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="3" >
+ <widget class="QLineEdit" name="lineEditICLST" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICLST</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="labelIROPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IROPT</string>
+ </property>
+ <property name="text" >
+ <string>Density</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3" >
+ <widget class="QLineEdit" name="lineEditIROPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IROPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="4" >
+ <widget class="QLabel" name="labelUnitIROPT" >
+ <property name="text" >
+ <string>kg/m3</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QGroupBox" name="groupBoxRate" >
+ <property name="title" >
+ <string/>
+ </property>
+ <property name="checkable" >
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>51</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxIPOIT" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPOIT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>41</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QFrame" name="frameVolumicRate" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIDEBT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDEBT</string>
+ </property>
+ <property name="text" >
+ <string>Volumic rate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditIDEBT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDEBT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLabel" name="labelUnitIDEBT" >
+ <property name="text" >
+ <string>kg/s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QFrame" name="frameStatisticalWeight" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIPOIT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPOIT</string>
+ </property>
+ <property name="text" >
+ <string>Statistical weight</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditIPOIT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPOIT</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QGroupBox" name="groupBoxVelocity" >
+ <property name="title" >
+ <string>Velocity</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxIJUVW" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IJUVW</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QFrame" name="frameVelocityNorm" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIUNO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IUNO</string>
+ </property>
+ <property name="text" >
+ <string>Norm</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditIUNO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IUNO</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitIUNO" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QFrame" name="frameVelocityValues" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIUPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IUPT</string>
+ </property>
+ <property name="text" >
+ <string>U</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditIUPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IUPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitIUPT" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>22</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLabel" name="labelIVPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVPT</string>
+ </property>
+ <property name="text" >
+ <string>V</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5" >
+ <widget class="QLineEdit" name="lineEditIVPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="6" >
+ <widget class="QLabel" name="labelUnitIVPT" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="7" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>22</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="8" >
+ <widget class="QLabel" name="labelIWPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IWPT</string>
+ </property>
+ <property name="text" >
+ <string>W</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="9" >
+ <widget class="QLineEdit" name="lineEditIWPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IWPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="10" >
+ <widget class="QLabel" name="labelUnitIWPT" >
+ <property name="text" >
+ <string>m/s</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QGroupBox" name="groupBoxDiameter" >
+ <property name="title" >
+ <string>Diameter</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxIJRDP" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word:IJRDP</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QFrame" name="frameDiameter" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIDPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDPT</string>
+ </property>
+ <property name="text" >
+ <string>Mean value</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditIDPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word:IDPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitIDPT" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLabel" name="labelIVDPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVDPT</string>
+ </property>
+ <property name="text" >
+ <string>Standard deviation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5" >
+ <widget class="QLineEdit" name="lineEditIVDPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVDPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="6" >
+ <widget class="QLabel" name="labelUnitIVDPT" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <widget class="QGroupBox" name="groupBoxTemperature" >
+ <property name="title" >
+ <string>Temperature</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QComboBox" name="comboBoxIJRTP" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word:IJRTP</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QFrame" name="frameTemperature" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>42</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelITPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ITPT</string>
+ </property>
+ <property name="text" >
+ <string>Temperature</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditITPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ITPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitITPT" >
+ <property name="text" >
+ <string>C</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelICPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICPT</string>
+ </property>
+ <property name="text" >
+ <string>Specific heat</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditICPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelUnitICPT" >
+ <property name="text" >
+ <string>J/kg/K</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelIEPSI" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IEPSI</string>
+ </property>
+ <property name="text" >
+ <string>Emissivity</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditIEPSI" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IEPSI</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="7" column="0" >
+ <widget class="QGroupBox" name="groupBoxCoal" >
+ <property name="title" >
+ <string>Coal</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelINUCHL" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: INUCHL</string>
+ </property>
+ <property name="text" >
+ <string>Coal number</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QLineEdit" name="lineEditINUCHL" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: INUCHL</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelIHPT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IHPT</string>
+ </property>
+ <property name="text" >
+ <string>Temperature</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QLineEdit" name="lineEditIHPT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IHPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" >
+ <widget class="QLabel" name="labelUnitIHPT" >
+ <property name="text" >
+ <string>C</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="labelIMCHT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMCHT</string>
+ </property>
+ <property name="text" >
+ <string>Mass of coal</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <spacer>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMCHT</string>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>121</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="3" >
+ <widget class="QLineEdit" name="lineEditIMCHT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMCHT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4" >
+ <widget class="QLabel" name="labelUnitIMCHT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMCHT</string>
+ </property>
+ <property name="text" >
+ <string>kg</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="labelIMCKT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMCKT</string>
+ </property>
+ <property name="text" >
+ <string>Mass of coke</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3" >
+ <widget class="QLineEdit" name="lineEditIMCKT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMCKT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="4" >
+ <widget class="QLabel" name="labelUnitIIMCKT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMCHT</string>
+ </property>
+ <property name="text" >
+ <string>kg</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/LagrangianBoundariesModel.py b/gui/Pages/LagrangianBoundariesModel.py
new file mode 100644
index 0000000..ac0b6bf
--- /dev/null
+++ b/gui/Pages/LagrangianBoundariesModel.py
@@ -0,0 +1,740 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+This module defines the lagrangian two phase flow modelling management.
+
+This module contains the following classes and function:
+- LagrangianBoundariesModel
+- LagrangianBoundariesTestCase
+"""
+
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import sys, unittest, logging
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Pages.LagrangianModel import LagrangianModel
+
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianBoundariesModel")
+log.setLevel(Tool.GuiParam.DEBUG)
+
+
+#-------------------------------------------------------------------------------
+# lagrangian model class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianBoundariesModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Lagrangian module.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_boundaries = self.case.root().xmlInitNode('boundary_conditions')
+ self.default = self.defaultParticlesBoundaryValues()
+
+
+ def defaultParticlesBoundaryValues(self):
+ """
+ Return a dictionnary which contains default values.
+ """
+ default = {}
+ default['particles'] = "inlet"
+ default['nbclas'] = 0
+ default['number'] = 0
+ default['frequency'] = 0
+ default['statistical_groups'] = 0.
+ default['statistical_weight_choice'] = "prescribed"
+ default['statistical_weight'] = 0
+ default['mass_flow_rate'] = 0.
+ default['density'] = 0.
+ default['velocity_choice'] = "fluid"
+ default['velocity_norm'] = 0.
+ default['velocity_value'] = 0.
+ default['temperature_choice'] = "prescribed"
+ default['temperature'] = 0.
+ default['specific_heat'] = 0.
+ default['emissivity'] = 0.
+ default['diameter_choice'] = "prescribed"
+ default['diameter'] = 0.
+ default['diameter_standard_deviation'] = 0.
+ default['coal_number'] = 0
+ default['coal_temperature'] = 0.
+ default['raw_coal_mass_fraction'] = 0.
+ default['char_mass_fraction'] = 0.
+ return default
+
+
+ def setBoundaryChoice(self, nature, labelbc, value):
+ """
+ Update value for the boundary condition. Here we defined the xml nodes
+ 'self.node_boundary' and 'self.node_particles' used in many functions.
+ """
+ if nature == "inlet":
+ self.isInList(value, ["inlet"])
+ elif nature == "outlet":
+ self.isInList(value, ["outlet"])
+ elif nature == "symmetry":
+ self.isInList(value, ["bounce"])
+ elif nature == "wall":
+ l = [ "inlet", "bounce", "deposit1", "deposit2", "deposit3", "depositfa"]
+ #if iscoal: l.append("encra")
+ self.isInList(value, l)
+ self.node_boundary = self.node_boundaries.xmlInitChildNode(nature, label=labelbc)
+ self.node_particles = self.node_boundary.xmlInitChildNode('particles', 'choice')
+ self.node_particles['choice'] = value
+ self.setCurrentBoundaryNode(nature, labelbc)
+
+
+ def getBoundaryChoice(self, nature, labelbc):
+ """
+ Return value for the boundary condition.
+ """
+ default = { "wall" : "deposit1", "inlet" : "inlet",
+ "outlet" : "outlet", "symmetry" : "bounce"}
+ self.setCurrentBoundaryNode(nature, labelbc)
+ if self.node_particles:
+ val = self.node_particles['choice']
+ if val == None or val == "":
+ val = default[nature]
+ self.setBoundaryChoice(nature, labelbc, val)
+ return val
+
+
+ def setCurrentBoundaryNode(self, nature, labelbc):
+ """
+ Update the current boundary node.
+ """
+ self.node_boundary = self.node_boundaries.xmlInitChildNode(nature, label=labelbc)
+ self.node_particles = self.node_boundary.xmlInitChildNode('particles', 'choice')
+
+
+ def newClassNode(self):
+ """
+ Add a new 'class' node with child nodes.
+ """
+ node_class = self.node_particles.xmlAddChild('class')
+ node_class.xmlSetData('number', self.default['number'])
+ node_class.xmlSetData('frequency', self.default['frequency'])
+ node_class.xmlSetData('statistical_groups', self.default['statistical_groups'])
+ node_class.xmlSetData('mass_flow_rate', self.default['mass_flow_rate'])
+ node_class.xmlSetData('density', self.default['density'])
+
+ node_class.xmlInitChildNode('statitical_weight', choice=self.default['statistical_weight_choice'])
+ node_class.xmlSetData('statitical_weight', self.default['statistical_weight'])
+
+ node_class.xmlInitChildNode('velocity', choice=self.default['velocity_choice'])
+ #node_class.xmlSetData('', self.default[''])
+
+ node_class.xmlInitChildNode('diameter', choice=self.default['diameter_choice'])
+ node_class.xmlSetData('diameter', self.default['diameter'])
+ node_class.xmlSetData('diameter_standard_deviation', self.default['diameter_standard_deviation'])
+
+ node_class.xmlInitChildNode('temperature', choice=self.default['temperature_choice'])
+ node_class.xmlSetData('temperature', self.default['temperature'])
+
+## node_class.xmlSetData('specific_heat', self.default['specific_heat'])
+## node_class.xmlSetData('emissivity', self.default['emissivity'])
+## node_class.xmlSetData('coal_number', self.default['coal_number'])
+## node_class.xmlSetData('raw_coal_mass_fraction', self.default['raw_coal_mass_fraction'])
+## node_class.xmlSetData('char_mass_fraction', self.default['char_mass_fraction'])
+
+
+ def setNumberOfClassesValue(self, labelbc, value):
+ """
+ Update the number of classes. Create or delete nodes if necessary.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ node_list = self.node_particles.xmlGetChildNodeList('class')
+ nnodes = len(node_list)
+ if value > nnodes:
+ for i in range(value-nnodes):
+ self.newClassNode()
+ else:
+ for i in range(nnodes-value):
+ node_list[-1].xmlRemoveNode()
+ # redefine self.node_class
+ self.setCurrentClassNode(labelbc, value)
+
+
+ def getNumberOfClassesValue(self, labelbc):
+ """
+ Return the number of classes.
+ """
+ node_list = self.node_particles.xmlGetChildNodeList('class')
+ value = len(node_list)
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['nbclas']
+ self.setNumberOfClassesValue(labelbc, value)
+ return value
+
+
+ def setCurrentClassNode(self, labelbc, iclass):
+ """
+ Update the current class node.
+ """
+ choice = self.node_particles['choice']
+ self.isInList(choice, ["inlet"])
+ self.isInt(iclass)
+ self.node_class = None
+ nodes_list = self.node_particles.xmlGetChildNodeList('class')
+ if nodes_list:
+ nnodes = len(nodes_list)
+ self.isLowerOrEqual(iclass, nnodes)
+ self.node_class = nodes_list[iclass-1]
+
+
+ def setNumberOfParticulesInClassValue(self, label, iclass, value):
+ """
+ Update the number of particles in a class.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('number', value)
+
+
+ def getNumberOfParticulesInClassValue(self, label, iclass):
+ """
+ Return the number of particles in a class.
+ """
+ value = self.node_class.xmlGetInt('number')
+ print "getNumberOfParticulesInClassValue value = ", value
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['number']
+ self.setNumberOfParticulesInZoneValue(label, iclass,value)
+ return value
+
+
+ def setInjectionFrequencyValue(self, label, iclass, value):
+ """
+ Update the injection frequency.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('frequency', value)
+
+
+ def getInjectionFrequencyValue(self, label, iclass):
+ """
+ Return the injection frequency.
+ """
+ value = self.node_class.xmlGetInt('frequency')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['frequency']
+ self.setInjectionFrequencyValue(label, iclass, value)
+ return value
+
+
+ def setParticleGroupNumberValue(self, label, iclass, value):
+ """
+ Update the group number of the particle.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('statistical_groups', value)
+
+
+ def getParticleGroupNumberValue(self, label, iclass):
+ """
+ Return the group number of the particle.
+ """
+ value = self.node_class.xmlGetInt('statistical_groups')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['statistical_groups']
+ self.setParticleGroupNumberValue(label, iclass, value)
+ return value
+
+
+ def setMassFlowRateValue(self, label, iclass, value):
+ """
+ Update the mass flow rate value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('mass_flow_rate', value)
+
+
+ def getMassFlowRateValue(self, label, iclass):
+ """
+ Return the mass flow rate value.
+ """
+ value = self.node_class.xmlGetDouble('mass_flow_rate')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['mass_flow_rate']
+ self.setMassFlowRateValue(label, iclass, value)
+ return value
+
+
+ def setStatisticalWeightChoice(self, label, iclass, value):
+ """
+ Update the condition on statistical weight.
+ """
+ self.isInList(value, ["rate", "prescribed", "subroutine"])
+ node = self.node_class.xmlInitChildNode('statistical_weight', 'choice')
+ node['choice'] = value
+
+
+ def getStatisticalWeightChoice(self, label, iclass):
+ """
+ Return the condition on statistical weight.
+ """
+ node = self.node_class.xmlInitChildNode('statistical_weight', 'choice')
+ if node:
+ val = node['choice']
+ if val == None or val == "":
+ val = self.defaultParticlesBoundaryValues()['statistical_weight_choice']
+ self.setStatisticalWeightChoice(label, iclass, val)
+ return val
+
+
+ def setStatisticalWeightValue(self, label, iclass, value):
+ """
+ Update the statistical weight value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('statistical_weight', value)
+
+
+ def getStatisticalWeightValue(self, label, iclass):
+ """
+ Return the statistical weight value.
+ """
+ value = self.node_class.xmlGetDouble('statistical_weight')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['statistical_weight']
+ self.setStatisticalWeightValue(label, iclass, value)
+ return value
+
+
+ def setDensityValue(self, label, iclass, value):
+ """
+ Update the density value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('density', value)
+
+
+ def getDensityValue(self, label, iclass):
+ """
+ Return the density value.
+ """
+ value = self.node_class.xmlGetDouble('density')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['density']
+ self.setDensityValue(label, iclass, value)
+ return value
+
+
+ def setVelocityChoice(self, label, iclass, choice):
+ """
+ Update the condition on velocity.
+ """
+ self.isInList(choice, ["fluid", "components", "norm", "subroutine"])
+ node_velocity = self.node_class.xmlInitChildNode('velocity', 'choice')
+ node_velocity['choice'] = choice
+ if choice in ["fluid", "norm", "subroutine"]:
+ node_velocity.xmlRemoveChild('velocity_x')
+ node_velocity.xmlRemoveChild('velocity_y')
+ node_velocity.xmlRemoveChild('velocity_z')
+ elif choice in ["fluid", "components", "subroutine"]:
+ node_velocity.xmlRemoveChild('norm')
+
+
+ def getVelocityChoice(self, label, iclass):
+ """
+ Return the condition on velocity.
+ """
+ node = self.node_class.xmlInitChildNode('velocity', 'choice')
+ if node:
+ val = node['choice']
+ if val == None:
+ val = self.defaultParticlesBoundaryValues()['velocity_choice']
+ self.setVelocityChoice(val)
+ return val
+
+
+ def setVelocityNormValue(self, label, iclass, value):
+ """
+ Update the velocity norm.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0.)
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="norm")
+ choice = node_velocity['choice']
+ self.isInList(choice, ["norm"])
+ node_velocity.xmlSetData('norm', value)
+
+
+ def getVelocityNormValue(self, label, iclass):
+ """
+ Return the velocity norm.
+ """
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="norm")
+ value = node_velocity.xmlGetDouble('norm')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['velocity_norm']
+ self.setVelocityNormValue(label, iclass, value)
+ return value
+
+
+ def setVelocityDirectionValue(self, label, iclass, idir, value):
+ """
+ Update the velocity value in the given direction.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0.)
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="components")
+ choice = node_velocity['choice']
+ self.isInList(choice, ["components"])
+ node_velocity.xmlSetData('velocity_' + idir, value)
+
+
+ def getVelocityDirectionValue(self, label, iclass, idir):
+ """
+ Return the velocity value in the given direction.
+ """
+ node_velocity = self.node_class.xmlInitChildNode('velocity', choice="components")
+ value = self.node_class.xmlGetDouble('velocity_' + idir)
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['velocity_value']
+ self.setVelocityDirectionValue(label, iclass, idir, value)
+ return value
+
+
+ def setTemperatureChoice(self, label, iclass, value):
+ """
+ Update the condition on temperature.
+ """
+ self.isInList(value, ["prescribed", "subroutine"])
+ node = self.node_class.xmlInitChildNode('temperature', 'choice')
+ node['choice'] = value
+
+
+ def getTemperatureChoice(self, label, iclass):
+ """
+ Return the condition on temperature.
+ """
+ node = self.node_class.xmlInitChildNode('temperature', 'choice')
+ if node:
+ val = node['choice']
+ if val == None:
+ val = self.defaultParticlesBoundaryValues()['temperature_choice']
+ self.setTemperatureChoice(label, iclass, val)
+ return val
+
+
+ def setTemperatureValue(self, label, iclass, value):
+ """
+ Update the temperature value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('temperature', value)
+
+
+ def getTemperatureValue(self, label, iclass):
+ """
+ Return the temperature value.
+ """
+ value = self.node_class.xmlGetDouble('temperature')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['temperature']
+ self.setTemperatureValue(label, iclass, value)
+ return value
+
+
+ def setSpecificHeatValue(self, label, iclass, value):
+ """
+ Update the specific heat value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('specific_heat', value)
+
+
+ def getSpecificHeatValue(self, label, iclass):
+ """
+ Return the specific heat value.
+ """
+ value = self.node_class.xmlGetDouble('specific_heat')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['specific_heat']
+ self.setSpecificHeatValue(label, iclass, value)
+ return value
+
+
+ def setEmissivityValue(self, label, iclass, value):
+ """
+ Update the emissivity value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('emissivity', value)
+
+
+ def getEmissivityValue(self, label, iclass):
+ """
+ Return the emissivity value.
+ """
+ value = self.node_class.xmlGetDouble('emissivity')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['emissivity']
+ self.setEmissivityValue(label, iclass, value)
+ return value
+
+
+ def setDiameterChoice(self, label, iclass, value):
+ """
+ Update the condition on the particle diameter.
+ """
+ self.isInList(value, ["prescribed", "subroutine"])
+ node = self.node_class.xmlInitChildNode('diameter', 'choice')
+ node['choice'] = value
+
+
+ def getDiameterChoice(self, label, iclass):
+ """
+ Return the condition on the particle diameter.
+ """
+ node = self.node_class.xmlInitChildNode('diameter', 'choice')
+ if node:
+ val = node['choice']
+ if val == None:
+ val = self.defaultParticlesBoundaryValues()['diameter_choice']
+ self.setDiameterChoice(label, iclass, val)
+ return val
+
+
+ def setDiameterValue(self, label, iclass, value):
+ """
+ Update the particle diameter value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('diameter', value)
+
+
+ def getDiameterValue(self, label, iclass):
+ """
+ Return the particle diameter value.
+ """
+ value = self.node_class.xmlGetDouble('diameter')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['diameter']
+ self.setDiameterValue(label, iclass, value)
+ return value
+
+
+ def setDiameterVarianceValue(self, label, iclass, value):
+ """
+ Update the particle diameter variance value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('diameter_standard_deviation', value)
+
+
+ def getDiameterVarianceValue(self, label, iclass):
+ """
+ Return the particle diameter variance value.
+ """
+ value = self.node_class.xmlGetDouble('diameter_standard_deviation')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['diameter_standard_deviation']
+ self.setDiameterVarianceValue(label, iclass, value)
+ return value
+
+
+ def setCoalNumberValue(self, label, iclass, value):
+ """
+ Update the coal number of the particle.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('coal_number', value)
+
+
+ def getCoalNumberValue(self, label, iclass):
+ """
+ Return the coal number of the particle.
+ """
+ value = self.node_class.xmlGetInt('coal_number')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['coal_number']
+ self.setCoalNumberValue(label, iclass, value)
+ return value
+
+
+ def setCoalTemperatureValue(self, label, iclass, value):
+ """
+ Update the coal temperature.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('coal_temperature', value)
+
+
+ def getCoalTemperatureValue(self, label, iclass):
+ """
+ Return the coal temperature.
+ """
+ value = self.node_class.xmlGetDouble('coal_temperature')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['coal_temperature']
+ self.setCoalTemperatureValue(label, iclass, value)
+ return value
+
+
+ def setCoalMassValue(self, label, iclass, value):
+ """
+ Update the coal mass value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('raw_coal_mass_fraction', value)
+
+
+ def getCoalMassValue(self, label, iclass):
+ """
+ Return the coal mass value.
+ """
+ value = self.node_class.xmlGetDouble('raw_coal_mass_fraction')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['raw_coal_mass_fraction']
+ self.setCoalMassValue(label, iclass, value)
+ return value
+
+
+ def setCokeMassValue(self, label, iclass, value):
+ """
+ Update the coke mass value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_class.xmlSetData('char_mass_fraction', value)
+
+
+ def getCokeMassValue(self, label, iclass):
+ """
+ Return the coke mass value.
+ """
+ value = self.node_class.xmlGetDouble('char_mass_fraction')
+ if value == None:
+ value = self.defaultParticlesBoundaryValues()['char_mass_fraction']
+ self.setCokeMassValue(label, iclass, svalue)
+ return value
+
+
+#-------------------------------------------------------------------------------
+# LagrangianBoundaries test case
+#-------------------------------------------------------------------------------
+
+
+class LagrangianBoundariesTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """
+ This method is executed before all "check" methods.
+ """
+ from Base.XMLengine import Case
+ from Base.XMLinitialize import XMLinit
+ self.case = Case()
+ XMLinit(self.case)
+
+
+ def tearDown(self):
+ """
+ This method is executed after all "check" methods.
+ """
+ del self.case
+
+
+ def checkLagrangianBoundariesInstantiation(self):
+ """
+ Check whether the LagrangianBoundariesModel class could be instantiated
+ """
+ model = None
+ model = LagrangianBoundariesModel(self.case)
+
+ assert model != None, 'Could not instantiate LagrangianBoundariesModel'
+
+
+ def checkLagrangianBoundariesDefaultValues(self):
+ """
+ Check the default values
+ """
+ model = LagrangianBoundariesModel(self.case)
+ doc = """"""
+
+ assert model.node_output == self.xmlNodeFromString(doc),\
+ 'Could not get default values for model'
+
+
+def suite():
+ testSuite = unittest.makeSuite(LagrangianBoundariesTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "LagrangianBoundariesTestCase A COMPLETER *********."
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/LagrangianBoundariesView.py b/gui/Pages/LagrangianBoundariesView.py
new file mode 100644
index 0000000..b7fe706
--- /dev/null
+++ b/gui/Pages/LagrangianBoundariesView.py
@@ -0,0 +1,827 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- ValueDelegate
+- StandardItemModelBoundaries
+- LagrangianBoundariesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+
+import logging
+
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from LagrangianBoundariesForm import Ui_LagrangianBoundariesForm
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import IntValidator, DoubleValidator, ComboModel
+from Pages.LocalizationModel import LocalizationModel, Zone
+from Pages.LagrangianBoundariesModel import LagrangianBoundariesModel
+from Pages.LagrangianModel import LagrangianModel
+from Pages.LagrangianStatisticsModel import LagrangianStatisticsModel
+
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianBoundariesView")
+log.setLevel(GuiParam.DEBUG)
+
+
+#-------------------------------------------------------------------------------
+# Line edit delegate with an integere validator
+#-------------------------------------------------------------------------------
+
+
+class ValueDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(ValueDelegate, self).__init__(parent)
+ self.parent = parent
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = IntValidator(editor, min=0, max=20) # nb max classes
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+ def setModelData(self, editor, model, index):
+ value, ok = editor.text().toDouble()
+ if editor.validator().state == QValidator.Acceptable:
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+
+#-------------------------------------------------------------------------------
+# QComboBox delegate for the particle-boundary interaction
+#-------------------------------------------------------------------------------
+
+
+class ParticleBoundaryInteractionDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent):
+ super(ParticleBoundaryInteractionDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ self.combo_mdl = ComboModel(editor,1,1)
+ nature = index.model()._data[index.row()][1]
+ self.dico = index.model().dicoM2V[nature]
+ for k, v in self.dico.items():
+ self.combo_mdl.addItem(v, k)
+ editor.installEventFilter(self)
+ #editor.setSizeAdjustPolicy(QComboBox.AdjustToContents)
+ editor.setMinimumWidth(100)
+ return editor
+
+
+ def setEditorData(self, comboBox, index):
+ row = index.row()
+ col = index.column()
+ str_model = index.model()._data[row][col]
+ self.combo_mdl.setItem(str_model=str_model)
+
+
+ def setModelData(self, comboBox, model, index):
+ txt = str(comboBox.currentText())
+ value = self.combo_mdl.dicoV2M[txt]
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+
+ def tr(self, text):
+ return text
+
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class to display boundaries in a QTreeView
+#-------------------------------------------------------------------------------
+
+
+class StandardItemModelBoundaries(QStandardItemModel):
+ def __init__(self, case, model):
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Label"), self.tr("Nature"),
+ self.tr("Particle-boundary\ninteraction"),
+ self.tr("Number of classes")]
+ self.setColumnCount(len(self.headers))
+ self.case = case
+ self.model = model
+ self._data = []
+
+ # Corresponding dict for the nature of the boundary. used in combo delegate.
+ self.dicoM2V = {
+ "wall" : { "inlet" : self.tr("Particles injection zone"),
+ "bounce" : self.tr("Particles rebound zone"),
+ "deposit1" : self.tr("Particles deposit"),
+ "deposit2" : self.tr("Particles deposit + memory"),
+ "deposit3" : self.tr("Particles deposit + suspension"),
+ "depositfa" : self.tr("Particles deposit + attachment force") },
+ "inlet" : { "inlet" : self.tr("Particles injection zone") },
+ "outlet" : { "outlet" : self.tr("Particles outlet zone") },
+ "symmetry" : { "bounce" : self.tr("Particles rebound zone") }
+ }
+
+ self.dicoV2M = {}
+ for key in self.dicoM2V.keys():
+ dico = self.dicoM2V[key]
+ self.dicoV2M[key] = {}
+ for k, v in dico.items():
+ self.dicoV2M[key][v] = k
+
+ # Initialization
+ for zone in LocalizationModel('BoundaryZone', self.case).getZones():
+ label = zone.getLabel()
+ nature = zone.getNature()
+ interaction = self.model.getBoundaryChoice(nature, label)
+ nclasses = self.model.getNumberOfClassesValue(label)
+ line = [label, nature, interaction, nclasses]
+ self._data.append(line)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.DisplayRole:
+ row = index.row()
+ col = index.column()
+ if col == 2:
+ nature = self._data[row][1]
+ dico = self.dicoM2V[nature]
+ return QVariant(dico[self._data[row][col]])
+ else:
+ return QVariant(self._data[row][col])
+
+ if role == Qt.ToolTipRole:
+ if index.column() == 2:
+ return QVariant(self.tr("Code_Saturne keyword: IUSCLB"))
+ elif index.column() == 3:
+ return QVariant(self.tr("Code_Saturne keyword: NBCLAS"))
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() in [0,1]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ elif index.column() == 2:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ elif index.column() == 3:
+ if self._data[index.row()][2] == "inlet":
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+ col = index.column()
+
+ if col == 2:
+ interaction = str(value.toString())
+ self._data[row][col] = interaction
+ label = self._data[row][0]
+ nature = self._data[row][1]
+ self.model.setBoundaryChoice(nature, label, interaction)
+ if nature != "inlet":
+ self._data[row][3] = 0
+
+ elif col == 3:
+ nclasses, ok = value.toInt()
+ self._data[row][col] = nclasses
+ label = self._data[row][0]
+ nn = self.model.getNumberOfClassesValue(label)
+ label = self._data[row][0]
+ self.model.setNumberOfClassesValue(label, nclasses)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def getItem(self, row):
+ return self._data[row]
+
+
+ def tr(self, text):
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianBoundariesView(QWidget, Ui_LagrangianBoundariesForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_LagrangianBoundariesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = LagrangianBoundariesModel(self.case)
+
+ self.modelBoundaries = StandardItemModelBoundaries(self.case, self.model)
+ self.tableViewBoundaries.setModel(self.modelBoundaries)
+ self.tableViewBoundaries.setAlternatingRowColors(True)
+## self.tableViewBoundaries.setSelectionBehavior(QAbstractItemView.SelectItems)
+## self.tableViewBoundaries.setSelectionMode(QAbstractItemView.ExtendedSelection)
+## self.tableViewBoundaries.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewBoundaries.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ delegateInteraction = ParticleBoundaryInteractionDelegate(self.tableViewBoundaries)
+ delegateClassNumber = ValueDelegate(self.tableViewBoundaries)
+ self.tableViewBoundaries.setItemDelegateForColumn(2,delegateInteraction)
+ self.tableViewBoundaries.setItemDelegateForColumn(3,delegateClassNumber)
+
+ self.modelIPOIT = ComboModel(self.comboBoxIPOIT,3,1)
+ self.modelIPOIT.addItem(self.tr("Volumic flow rate"), "rate")
+ self.modelIPOIT.addItem(self.tr("Statistical weight set by values"), "prescribed")
+ self.modelIPOIT.addItem(self.tr("User defined statistical weight"), "subroutine")
+
+ self.modelIJUVW = ComboModel(self.comboBoxIJUVW,4,1)
+ self.modelIJUVW.addItem(self.tr("Fluid velocity"), "fluid")
+ self.modelIJUVW.addItem(self.tr("Normal direction velocity"), "norm")
+ self.modelIJUVW.addItem(self.tr("Velocity given by values"), "components")
+ self.modelIJUVW.addItem(self.tr("User defined velocity"), "subroutine")
+
+ self.modelIJRTP = ComboModel(self.comboBoxIJRTP,2,1)
+ self.modelIJRTP.addItem(self.tr("Temperature set by values"), "prescribed")
+ self.modelIJRTP.addItem(self.tr("User defined temperature"), "subroutine")
+
+ self.modelIJRDP = ComboModel(self.comboBoxIJRDP,2,1)
+ self.modelIJRDP.addItem(self.tr("Diameter set by values"), "prescribed")
+ self.modelIJRDP.addItem(self.tr("User defined diameter"), "subroutine")
+
+ self.connect(self.tableViewBoundaries, SIGNAL("clicked(const QModelIndex &)"), self.slotSelectBoundary)
+ self.connect(self.modelBoundaries, SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), self.slotEditBoundary)
+ self.connect(self.spinBoxICLAS, SIGNAL("valueChanged(int)"), self.slotICLAS)
+
+ self.connect(self.lineEditIJNBP, SIGNAL("textChanged(const QString &)"), self.slotIJNBP)
+ self.connect(self.lineEditIJFRE, SIGNAL("textChanged(const QString &)"), self.slotIJFRE)
+ self.connect(self.lineEditICLST, SIGNAL("textChanged(const QString &)"), self.slotICLST)
+ self.connect(self.lineEditIDEBT, SIGNAL("textChanged(const QString &)"), self.slotIDEBT)
+ self.connect(self.comboBoxIPOIT, SIGNAL("activated(const QString&)"), self.slotIPOITChoice)
+ self.connect(self.lineEditIPOIT, SIGNAL("textChanged(const QString &)"), self.slotIPOIT)
+ self.connect(self.lineEditIROPT, SIGNAL("textChanged(const QString &)"), self.slotIROPT)
+
+ self.connect(self.comboBoxIJUVW, SIGNAL("activated(const QString&)"), self.slotIJUVW)
+ self.connect(self.lineEditIUNO, SIGNAL("textChanged(const QString &)"), self.slotIUNO)
+ self.connect(self.lineEditIUPT, SIGNAL("textChanged(const QString &)"), self.slotIUPT)
+ self.connect(self.lineEditIVPT, SIGNAL("textChanged(const QString &)"), self.slotIVPT)
+ self.connect(self.lineEditIWPT, SIGNAL("textChanged(const QString &)"), self.slotIWPT)
+
+ self.connect(self.comboBoxIJRTP, SIGNAL("activated(const QString&)"), self.slotIJRTP)
+ self.connect(self.lineEditITPT, SIGNAL("textChanged(const QString &)"), self.slotITPT)
+ self.connect(self.lineEditICPT, SIGNAL("textChanged(const QString &)"), self.slotICPT)
+ self.connect(self.lineEditIEPSI, SIGNAL("textChanged(const QString &)"), self.slotIEPSI)
+
+ self.connect(self.comboBoxIJRDP, SIGNAL("activated(const QString&)"), self.slotIJRDP)
+ self.connect(self.lineEditIDPT, SIGNAL("textChanged(const QString &)"), self.slotIDPT)
+ self.connect(self.lineEditIVDPT, SIGNAL("textChanged(const QString &)"), self.slotIVDPT)
+
+ self.connect(self.lineEditINUCHL, SIGNAL("textChanged(const QString &)"), self.slotINUCHL)
+ self.connect(self.lineEditIHPT, SIGNAL("textChanged(const QString &)"), self.slotIHPT)
+ self.connect(self.lineEditIMCHT, SIGNAL("textChanged(const QString &)"), self.slotIMCHT)
+ self.connect(self.lineEditIMCKT, SIGNAL("textChanged(const QString &)"), self.slotIMCKT)
+
+ # Validators
+ validatorIJNBP = IntValidator(self.lineEditIJNBP, min=0)
+ validatorIJFRE = IntValidator(self.lineEditIJFRE, min=0)
+ validatorICLST = IntValidator(self.lineEditICLST, min=0)
+ validatorIDEBT = DoubleValidator(self.lineEditIDEBT, min=0.)
+ validatorIPOIT = DoubleValidator(self.lineEditIPOIT, min=0.)
+ validatorIPOIT.setExclusiveMin(True)
+ validatorIROPT = DoubleValidator(self.lineEditIROPT, min=0.)
+ validatorIROPT.setExclusiveMin(True)
+
+ validatorIUNO = DoubleValidator(self.lineEditIUNO)
+ validatorIUPT = DoubleValidator(self.lineEditIUPT)
+ validatorIVPT = DoubleValidator(self.lineEditIVPT)
+ validatorIWPT = DoubleValidator(self.lineEditIWPT)
+
+ validatorITPT = DoubleValidator(self.lineEditITPT)
+ validatorICPT = DoubleValidator(self.lineEditICPT)
+ validatorIEPSI = DoubleValidator(self.lineEditIEPSI)
+
+ validatorIDPT = DoubleValidator(self.lineEditIDPT, min=0.)
+ validatorIVDPT = DoubleValidator(self.lineEditIVDPT)
+
+ validatorINUCHL = IntValidator(self.lineEditINUCHL, min=0)
+ validatorIHPT = DoubleValidator(self.lineEditIHPT)
+ validatorIMCHT = DoubleValidator(self.lineEditIMCHT, min=0.)
+ validatorIMCKT = DoubleValidator(self.lineEditIMCKT, min=0.)
+
+ self.lineEditIJNBP.setValidator(validatorIJNBP)
+ self.lineEditIJFRE.setValidator(validatorIJFRE)
+ self.lineEditICLST.setValidator(validatorICLST)
+ self.lineEditIDEBT.setValidator(validatorIDEBT)
+ self.lineEditIPOIT.setValidator(validatorIPOIT)
+ self.lineEditIROPT.setValidator(validatorIROPT)
+
+ self.lineEditIUNO.setValidator(validatorIUNO)
+ self.lineEditIUPT.setValidator(validatorIUPT)
+ self.lineEditIVPT.setValidator(validatorIVPT)
+ self.lineEditIWPT.setValidator(validatorIWPT)
+
+ self.lineEditITPT.setValidator(validatorITPT)
+ self.lineEditICPT.setValidator(validatorICPT)
+ self.lineEditIEPSI.setValidator(validatorIEPSI)
+
+ self.lineEditIDPT.setValidator(validatorIDPT)
+ self.lineEditIVDPT.setValidator(validatorIVDPT)
+
+ self.lineEditINUCHL.setValidator(validatorINUCHL)
+ self.lineEditIHPT.setValidator(validatorIHPT)
+ self.lineEditIMCHT.setValidator(validatorIMCHT)
+ self.lineEditIMCKT.setValidator(validatorIMCKT)
+
+ self._hideAllWidgets()
+
+
+ def _hideAllWidgets(self):
+ self.groupBoxClassNumber.hide()
+ self.groupBoxMain.hide()
+ self.groupBoxRate.hide()
+ self.groupBoxVelocity.hide()
+ self.groupBoxTemperature.hide()
+ self.groupBoxDiameter.hide()
+ self.groupBoxCoal.hide()
+
+
+ @pyqtSignature("const QModelIndex&, const QModelIndex&")
+ def slotEditBoundary(self, index, index2):
+ """
+ """
+ self.slotSelectBoundary(index)
+
+
+ @pyqtSignature("const QModelIndex&")
+ def slotSelectBoundary(self, index):
+ """
+ """
+ self._hideAllWidgets()
+ label, nature, interaction, nclasses = self.modelBoundaries.getItem(index.row())
+ self.label = label
+ if interaction != "inlet":
+ return
+ self.model.setCurrentBoundaryNode(nature, label)
+ if nclasses > 0:
+ self.groupBoxClassNumber.show()
+ self.spinBoxICLAS.setMinimum(1)
+ self.spinBoxICLAS.setMaximum(nclasses)
+ self.spinBoxICLAS.setValue(1)
+ self.slotICLAS(1)
+ else:
+ return
+
+
+ @pyqtSignature("int")
+ def slotICLAS(self, iclass):
+ """
+ Input ICLAS.
+ """
+ self.iclass = iclass
+ index = self.tableViewBoundaries.currentIndex()
+ label, nature, interaction, nclasses = self.modelBoundaries.getItem(index.row())
+ if interaction == "inlet":
+ self.model.setCurrentClassNode(self.label, iclass)
+
+ self.LM = LagrangianModel(self.case)
+ part_model = self.LM.getParticlesModel()
+
+ # Main variables
+ self.groupBoxMain.show()
+ npart = self.model.getNumberOfParticulesInClassValue(self.label, self.iclass)
+ self.lineEditIJNBP.setText(QString(str(npart)))
+ freq = self.model.getInjectionFrequencyValue(self.label, self.iclass)
+ self.lineEditIJFRE.setText(QString(str(freq)))
+
+ self.LSM = LagrangianStatisticsModel(self.case)
+ if self.LSM.getGroupOfParticlesValue() > 0:
+ igroup = self.model.getParticleGroupNumberValue(self.label, self.iclass)
+ self.lineEditICLST.setText(QString(str(igroup)))
+ else:
+ self.labelICLST.setDisabled(True)
+ self.lineEditICLST.setDisabled(True)
+
+ # Rate / stat. weight
+ self.groupBoxRate.show()
+ choice = self.model.getStatisticalWeightChoice(self.label, self.iclass)
+ self.modelIPOIT.setItem(str_model=choice)
+ text = self.modelIPOIT.dicoM2V[choice]
+ self.slotIPOITChoice(QString(text))
+
+ # Velocity
+ self.groupBoxVelocity.show()
+ choice = self.model.getVelocityChoice(self.label, self.iclass)
+ self.modelIJUVW.setItem(str_model=choice)
+ text = self.modelIJUVW.dicoM2V[choice]
+ self.slotIJUVW(QString(text))
+
+ # Temperature
+ status = self.LM.getHeating()
+ if part_model == "thermal" and status == "on":
+ self.groupBoxTemperature.show()
+ choice = self.model.getTemperatureChoice(self.label, self.iclass)
+ self.modelIJRTP.setItem(str_model=choice)
+ text = self.modelIJRTP.dicoM2V[choice]
+ self.slotIJRTP(QString(text))
+
+ cp = self.model.getSpecificHeatValue(self.label, self.iclass)
+ self.lineEditICPT.setText(QString(str(cp)))
+ eps = self.model.getEmissivityValue(self.label, self.iclass)
+ self.lineEditIEPSI.setText(QString(str(eps)))
+
+ # Coals
+ if part_model == "coal" and self.LM.getCoalFouling() == "on" :
+ self.groupBoxCoal.show()
+ #icoal = self.model.getCoalNumberValue(self.label, self.iclass)
+ icoal = 1
+ self.lineEditINUCHL.setText(QString(str(icoal)))
+ #temp = self.model.getCoalTemperatureValue(self.label, self.iclass)
+ temp = 800.
+ self.lineEditIHPT.setText(QString(str(temp)))
+ #mass = self.model.getCoalMassValue(self.label, self.iclass)
+ pis6 = 3.14159265/6.
+ diam = 1. # TODO diam20
+ rho = 1. # TODO rho0ch
+ mass = pis6 * diam**3 * rho
+ self.lineEditIMCHT.setText(QString(str(mass)))
+ #mass2 = self.model.getCokeMassValue(self.label, self.iclass)
+ mass2 = 0.
+ self.lineEditIMCKT.setText(QString(str(mass2)))
+
+ # Diameter
+ if part_model == "coal":
+ self.groupBoxDiameter.show()
+ self.modelIJRDP.setItem(str_model="prescribed")
+ else:
+ self.groupBoxDiameter.show()
+ choice = self.model.getDiameterChoice(self.label, self.iclass)
+ self.modelIJRDP.setItem(str_model=choice)
+ text = self.modelIJRDP.dicoM2V[choice]
+ self.slotIJRDP(QString(text))
+
+ rho = self.model.getDensityValue(self.label, self.iclass)
+ self.lineEditIROPT.setText(QString(str(rho)))
+
+
+ @pyqtSignature("const QString&")
+ def slotIJNBP(self, text):
+ """
+ Input IJNBP.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setNumberOfParticulesInClassValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJFRE(self, text):
+ """
+ Input IJFRE.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setInjectionFrequencyValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotICLST(self, text):
+ """
+ Input ICLST.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setParticleGroupNumberValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIDEBT(self, text):
+ """
+ Input IDEBT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setMassFlowRateValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIPOITChoice(self, text):
+ """
+ Input IPOIT.
+ """
+ choice = self.modelIPOIT.dicoV2M[str(text)]
+ self.model.setStatisticalWeightChoice(self.label, self.iclass, choice)
+ self.frameVolumicRate.hide()
+ self.frameStatisticalWeight.hide()
+ if choice == "rate":
+ self.frameVolumicRate.show()
+ rate = self.model.getMassFlowRateValue(self.label, self.iclass)
+ self.lineEditIDEBT.setText(QString(str(rate)))
+ self.model.setStatisticalWeightValue(self.label, self.iclass, 1) # ???
+ elif choice == "prescribed":
+ self.frameStatisticalWeight.show()
+ weight = self.model.getStatisticalWeightValue(self.label, self.iclass)
+ self.lineEditIPOIT.setText(QString(str(weight)))
+ elif choice == "subroutine":
+ pass
+
+
+ @pyqtSignature("const QString&")
+ def slotIPOIT(self, text):
+ """
+ Input IPOIT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setStatisticalWeightValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIROPT(self, text):
+ """
+ Input IROPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setDensityValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJUVW(self, text):
+ """
+ Input IJUVW.
+ """
+ choice = self.modelIJUVW.dicoV2M[str(text)]
+ self.model.setVelocityChoice(self.label, self.iclass, choice)
+ self.frameVelocityNorm.hide()
+ self.frameVelocityValues.hide()
+ if choice == "norm":
+ self.frameVelocityNorm.show()
+ norm = self.model.getVelocityNormValue(self.label, self.iclass)
+ self.lineEditIUNO.setText(QString(str(norm)))
+ elif choice == "components":
+ self.frameVelocityValues.show()
+ vu = self.model.getVelocityDirectionValue(self.label, self.iclass, "u")
+ vv = self.model.getVelocityDirectionValue(self.label, self.iclass, "v")
+ vw = self.model.getVelocityDirectionValue(self.label, self.iclass, "w")
+ self.lineEditIUPT.setText(QString(str(vu)))
+ self.lineEditIVPT.setText(QString(str(vv)))
+ self.lineEditIWPT.setText(QString(str(vw)))
+
+
+ @pyqtSignature("const QString&")
+ def slotIUNO(self, text):
+ """
+ Input IUNO.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityNormValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIUPT(self, text):
+ """
+ Input IUPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityDirectionValue(self.label, self.iclass, "u", value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIVPT(self, text):
+ """
+ Input IVPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityDirectionValue(self.label, self.iclass, "v", value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIWPT(self, text):
+ """
+ Input IWPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setVelocityDirectionValue(self.label, self.iclass, "w", value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJRTP(self, text):
+ """
+ Input IJRTP.
+ """
+ choice = self.modelIJRTP.dicoV2M[str(text)]
+ self.model.setTemperatureChoice(self.label, self.iclass, choice)
+ if choice == "prescribed":
+ self.frameTemperature.show()
+ temp = self.model.getTemperatureValue(self.label, self.iclass)
+ self.lineEditITPT.setText(QString(str(temp)))
+ elif choice == "subroutine":
+ self.frameTemperature.hide()
+
+
+ @pyqtSignature("const QString&")
+ def slotITPT(self, text):
+ """
+ Input ITPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setTemperatureValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotICPT(self, text):
+ """
+ Input ICPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setSpecificHeatValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIEPSI(self, text):
+ """
+ Input IEPSI.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setEmissivityValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIJRDP(self, text):
+ """
+ Input IJRDP.
+ """
+ choice = self.modelIJRDP.dicoV2M[str(text)]
+ self.model.setDiameterChoice(self.label, self.iclass, choice)
+ if choice == "prescribed":
+ self.frameDiameter.show()
+ diam = self.model.getDiameterValue(self.label, self.iclass)
+ vdiam = self.model.getDiameterVarianceValue(self.label, self.iclass)
+ self.lineEditIDPT.setText(QString(str(diam)))
+ self.lineEditIVDPT.setText(QString(str(vdiam)))
+ elif choice == "subroutine":
+ self.frameDiameter.hide()
+
+
+ @pyqtSignature("const QString&")
+ def slotIDPT(self, text):
+ """
+ Input IDPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setDiameterValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIVDPT(self, text):
+ """
+ Input IVDPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setDiameterVarianceValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotINUCHL(self, text):
+ """
+ Input IHPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setCoalNumberValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIHPT(self, text):
+ """
+ Input IHPT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setCoalTemperatureValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIMCHT(self, text):
+ """
+ Input IMCHT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setCoalMassValue(self.label, self.iclass, value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIMCKT(self, text):
+ """
+ Input IMCKT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setCokeMassValue(self.label, self.iclass, value)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/LagrangianForm.ui b/gui/Pages/LagrangianForm.ui
new file mode 100644
index 0000000..f6a0f77
--- /dev/null
+++ b/gui/Pages/LagrangianForm.ui
@@ -0,0 +1,694 @@
+<ui version="4.0" >
+ <class>LagrangianForm</class>
+ <widget class="QWidget" name="LagrangianForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>564</width>
+ <height>805</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxIILAGR" >
+ <property name="title" >
+ <string>Eulerian/Lagangian Multi-phase Treatment</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_8" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>77</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxIILAGR" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IILAGR</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the type of lagrangian module</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>77</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxMain" >
+ <property name="title" >
+ <string>Main parameters</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>27</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelISUILA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISUILA</string>
+ </property>
+ <property name="text" >
+ <string>Calculation restart for particles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBoxISUILA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISUILA</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelISTTIO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISTTIO</string>
+ </property>
+ <property name="text" >
+ <string>The continuous phase flow is a steady flow</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QCheckBox" name="checkBoxISTTIO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISTTIO</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelNBPMAX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NBPMAX</string>
+ </property>
+ <property name="text" >
+ <string>Maximum number of particles at each time step</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditNBPMAX" >
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>120</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NBPMAX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelINJCON" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: INJCON</string>
+ </property>
+ <property name="text" >
+ <string>Injection of particles during the time step</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QCheckBox" name="checkBoxINJCON" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: INJCON</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>26</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxPhysicsModels" >
+ <property name="title" >
+ <string>Physics models associated with particles</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QComboBox" name="comboBoxIPHYLA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPHYLA</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameModel1" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>36</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelITPVAR" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ITPVAR</string>
+ </property>
+ <property name="text" >
+ <string>Heating of particles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>48</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QCheckBox" name="checkBoxITPVAR" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ITPVAR</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelIDPVAR" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDPVAR</string>
+ </property>
+ <property name="text" >
+ <string>Break-up of droplets</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>48</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QCheckBox" name="checkBoxIDPVAR" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDPVAR</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelIMPVAR" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMPVAR</string>
+ </property>
+ <property name="text" >
+ <string>Evaporation of droplets</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QCheckBox" name="checkBoxIMPVAR" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMPVAR</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>35</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameModel2" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>96</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QLabel" name="labelIENCRA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IENCRA</string>
+ </property>
+ <property name="text" >
+ <string>Coal particle fouling (Watt & Fereday's model)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxIENCRA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IENCRA</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>96</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0" colspan="3" >
+ <widget class="QTableView" name="tableViewCoals" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>100</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox2way" >
+ <property name="title" >
+ <string>Two-way coupling</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_5" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>31</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_4" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelLTSDYN" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: LTSDYN</string>
+ </property>
+ <property name="text" >
+ <string>Two-way coupling for velocity and turbulence</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBoxLTSDYN" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: LTSDYN</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelLTSTHE" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: LTSTHE</string>
+ </property>
+ <property name="text" >
+ <string>Two-way coupling for temperature</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QCheckBox" name="checkBoxLTSTHE" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: LTSTHE</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelLTSMAS" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: LTSMAS</string>
+ </property>
+ <property name="text" >
+ <string>Two-way coupling for mass (evaporation)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QCheckBox" name="checkBoxLTSMAS" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: LTSMAS</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelNSTITS" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NSTITS</string>
+ </property>
+ <property name="text" >
+ <string>Starting lagrangian iteration of coupling</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditNSTITS" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NSTITS</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>31</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Numerical scheme</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_7" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>162</width>
+ <height>28</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6" >
+ <item>
+ <widget class="QLabel" name="labelAdvanced" >
+ <property name="text" >
+ <string>Advanced options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>29</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonAdvanced" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/preferences-system.png</normaloff>:/new/prefix1/icons/22x22/preferences-system.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>162</width>
+ <height>28</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>546</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/LagrangianModel.py b/gui/Pages/LagrangianModel.py
new file mode 100644
index 0000000..7107691
--- /dev/null
+++ b/gui/Pages/LagrangianModel.py
@@ -0,0 +1,1241 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the lagrangian two phase flow modelling management.
+
+This module contains the following classes and function:
+- LagrangianModel
+- LagrangianTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, unittest, logging
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+import Pages.CoalThermoChemistry as CoalThermoChemistry
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianModel")
+log.setLevel(Tool.GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# lagrangian model class
+#-------------------------------------------------------------------------------
+
+class LagrangianModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Lagrangian module.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_lagr = self.case.root().xmlInitNode('lagrangian', 'model')
+ self.getLagrangianStatus()
+ self.__lagrangianStatus = ('off', 'on')
+ self.__lagrangianCouplingMode = ('one_way', 'two_way', 'frozen')
+ self.__particlesModels = ("thermal", "coal", "off")
+
+
+ def defaultParticlesValues(self):
+ """
+ Return a dictionnary which contains default values.
+ """
+ default = {}
+ default['model'] = "off"
+ default['coupling_mode'] = "one_way"
+ default['restart'] = "off"
+ default['carrier_field_stationary'] = "off"
+ default['particles_max_number'] = 10000
+ default['continuous_injection'] = "off"
+ default['particles_models'] = "off"
+ default['thermal'] = "off"
+ #default['particle_temperature'] = 700.
+ #default['particle_specific_heat'] = 5200.
+ default['evaporation'] = "off"
+ default['break_up'] = "off"
+ default['coal_fouling'] = "off"
+ default['threshold_temperature'] = 600.
+ default['critical_viscosity'] = 10000.
+ default['fouling_coefficient_1'] = 0.316608
+ default['fouling_coefficient_2'] = -1.6786
+ default['iteration_start'] = 1
+ default['thermal'] = "off"
+ default['dynamic'] = "off"
+ default['mass'] = "off"
+ default['scheme_order'] = 2
+ default['turbulent_dispersion'] = "on"
+ default['fluid_particles_turbulent_diffusion'] = "off"
+ default['complete_model_iteration'] = 0
+ default['complete_model_direction'] = 1
+ return default
+
+
+ def lagrangianStatus(self):
+ """
+ Return a tuple with the lagrangian status allowed.
+ """
+ from TurbulenceModel import TurbulenceModel
+ model = TurbulenceModel(self.case).getTurbulenceModel()
+ del TurbulenceModel
+ if model not in ('off',
+ 'k-epsilon',
+ 'k-epsilon-PL',
+ 'Rij-epsilon',
+ 'Rij-SSG',
+ 'v2f-phi',
+ 'k-omega-SST'):
+ return ('off',)
+ else:
+ return self.__lagrangianStatus
+
+
+ def particlesModels(self):
+ """
+ Return the list of models associated to the particles.
+ """
+ return self.__particlesModels
+
+
+ def lagrangianCouplingMode(self):
+ """
+ Return all defined lagrangian models in a tuple.
+ """
+ return self.__lagrangianCouplingMode
+
+
+ def setLagrangianStatus(self, status):
+ """
+ Update the lagrangian module status markup.
+ """
+ self.isOnOff(status)
+ self.node_lagr['model'] = status
+
+ # WARNING: the 'coal_lagr' model is deprecated.
+# if status == 'off':
+# import CoalCombustionModel
+# coal = CoalCombustionModel.CoalCombustionModel(self.case).getCoalCombustionModel()
+# # WARNING: the 'coal_lagr' model is deprecated.
+# if coal == 'coal_lagr':
+# CoalCombustionModel.CoalCombustionModel(self.case).setCoalCombustion('off')
+# del CoalCombustionModel
+
+
+ def getLagrangianStatus(self):
+ """
+ Return the status for lagrangian module markup from the XML document.
+ """
+ status = self.node_lagr['model']
+ if status == "":
+ status = self.defaultParticlesValues()['model']
+ self.setLagrangianStatus(status)
+ return status
+
+
+ def setCouplingMode(self, model):
+ """
+ Update the lagrangian model markup from the XML document.
+ """
+ self.isInList(model, self.__lagrangianCouplingMode)
+ node_coupling = self.node_lagr.xmlInitChildNode('coupling_mode', 'model')
+ node_coupling['model'] = model
+
+ if model == 'two_way':
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+
+
+ def getCouplingMode(self):
+ """
+ Return the current lagrangian model.
+ """
+ node_coupling = self.node_lagr.xmlInitChildNode('coupling_mode', 'model')
+ model = node_coupling['model']
+ if model not in self.__lagrangianCouplingMode:
+ model = self.defaultParticlesValues()['coupling_mode']
+ self.setCouplingMode(model)
+ return model
+
+
+ def setRestart(self, status):
+ """
+ Update the restart status markup from the XML document.
+ """
+ self.isOnOff(status)
+ node_restart = self.node_lagr.xmlInitChildNode('restart', 'status')
+ node_restart['status'] = status
+
+
+ def getRestart(self):
+ """
+ Return status of restart file.
+ """
+ node_restart = self.node_lagr.xmlInitChildNode('restart', 'status')
+ status = node_restart['status']
+ if not status:
+ status = self.defaultParticlesValues()['restart']
+ self.setRestart(status)
+ return status
+
+
+ def setCarrierFlowStationary(self, status):
+ """
+ Update the status for steady flow markup from the XML document.
+ """
+ self.isOnOff(status)
+ node_steady = self.node_lagr.xmlInitChildNode('carrier_field_stationary', 'status')
+ if not (self.getCouplingMode() == "frozen" and status == "off"):
+ node_steady['status'] = status
+
+
+ def getCarrierFlowStationary(self):
+ """
+ Return status of steady (on) or unsteady (off) state
+ of the continuous phase flow.
+ """
+ node_steady = self.node_lagr.xmlInitChildNode('carrier_field_stationary', 'status')
+ status = node_steady['status']
+ if not status:
+ status = self.defaultParticlesValues()['carrier_field_stationary']
+ self.setCarrierFlowStationary(status)
+ return status
+
+
+ def setMaxNumber(self, value):
+ """
+ Update value for maximum number of particles allowed
+ simultaneously in the calculation domain.
+ """
+ self.isInt(value)
+ self.isGreater(value, 0)
+ self.node_lagr.xmlSetData('particles_max_number', value)
+
+
+ def getMaxNumber(self):
+ """
+ Return the value for maximum number of particles allowed
+ simultaneously in the calculation domain.
+ """
+ nbpmax = self.node_lagr.xmlGetInt('particles_max_number')
+ if nbpmax == None:
+ nbpmax = self.defaultParticlesValues()['particles_max_number']
+ self.setMaxNumber(nbpmax)
+ return nbpmax
+
+
+ def setContinuousInjection(self, status):
+ """
+ Update the status for continuous injection of particles.
+ """
+ self.isOnOff(status)
+ node_injection = self.node_lagr.xmlInitChildNode('continuous_injection', 'status')
+ node_injection['status'] = status
+
+
+ def getContinuousInjection(self):
+ """
+ Return status for continuous injection of particles.
+ """
+ node_injection = self.node_lagr.xmlInitChildNode('continuous_injection', 'status')
+ status = node_injection['status']
+ if not status:
+ status = self.defaultParticlesValues()['continuous_injection']
+ self.setContinuousInjection(status)
+ return status
+
+
+ def setParticlesModel(self, model):
+ """
+ Update the particles model markup from the XML document.
+ """
+ self.isInList(model, self.__particlesModels)
+ node_model = self.node_lagr.xmlInitChildNode('particles_models', 'model')
+ node_model['model'] = model
+
+ if model == "off":
+ node_model.xmlRemoveChild('thermal')
+ node_model.xmlRemoveChild('evaporation')
+ node_model.xmlRemoveChild('break_up')
+ node_model.xmlRemoveChild('coal_fouling')
+ elif model == "thermal":
+ node_model.xmlRemoveChild('coal_fouling')
+ elif model == "coal":
+ node_model.xmlRemoveChild('thermal')
+ node_model.xmlRemoveChild('evaporation')
+ node_model.xmlRemoveChild('break_up')
+ self.getCoalFouling()
+
+
+ def __nodeParticlesModel(self):
+ """
+ Return xml node for particles model. Create node if it does not exists.
+ """
+ node_model = self.node_lagr.xmlInitChildNode('particles_models', 'model')
+ model = node_model['model']
+ if model not in self.__particlesModels:
+ model = self.defaultParticlesValues()['particles_models']
+ self.setParticlesModel(model)
+ return node_model
+
+
+ def getParticlesModel(self):
+ """
+ Return the current particles model.
+ """
+ return self.__nodeParticlesModel()['model']
+
+
+ def setBreakUp(self, status):
+ """
+ Update the status for activation of evolution equation on the particle diameter.
+ """
+ self.isOnOff(status)
+ node_model = self.__nodeParticlesModel()
+ node_diameter = node_model.xmlInitChildNode('break_up', 'status')
+ node_diameter['status'] = status
+
+
+ def getBreakUp(self):
+ """
+ Return status for the activation of an evolution equation on the particle diameter.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_diameter = node_model.xmlInitChildNode('break_up', 'status')
+ status = node_diameter['status']
+ if not status:
+ status = self.defaultParticlesValues()['break_up']
+ self.setBreakUp(status)
+ return status
+
+
+ def setHeating(self, status):
+ """
+ Update the status for the activation of an evolution equation on the particle temperature.
+ """
+ self.isOnOff(status)
+ node_model = self.__nodeParticlesModel()
+ node_thermal = node_model.xmlInitChildNode('thermal', 'status')
+ node_thermal['status'] = status
+ #if status == "on":
+ #node_temp = node_thermal.xmlInitChildNode('particle_temperature')
+ #temp = self.getParticlesTemperatureValue()
+ #node_temp.xmlSetTextNode(str(temp))
+ #node_cp = node_thermal.xmlInitChildNode('particle_specific_heat')
+ #cp = self.getParticlesSpecificHeatValue()
+ #node_cp.xmlSetTextNode(str(cp))
+
+
+ def getHeating(self):
+ """
+ Return status for the activation of an evolution equation on the particle temperature.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_temp = node_model.xmlInitChildNode('thermal', 'status')
+ status = node_temp['status']
+ if not status:
+ status = self.defaultParticlesValues()['thermal']
+ self.setHeating(status)
+ return status
+
+
+ #def setParticlesTemperatureValue(self, value):
+ #"""
+ #"""
+ #self.isFloat(value)
+ #node_model = self.__nodeParticlesModel()
+ #node_thermal = node_model.xmlInitChildNode('thermal', 'status')
+ ##check if node_thermal status == "on" ?
+ #node_temp = node_thermal.xmlInitChildNode('particle_temperature')
+ #node_temp.xmlSetTextNode(str(value))
+
+
+ #def getParticlesTemperatureValue(self):
+ #"""
+ #"""
+ #node_model = self.__nodeParticlesModel()
+ #node_thermal = node_model.xmlInitChildNode('thermal', 'status')
+ #value = node_thermal.xmlGetDouble('particle_temperature')
+ #if not value:
+ #value = self.defaultParticlesValues()['particle_temperature']
+ #self.setParticlesTemperatureValue(value)
+ #return value
+
+
+ #def setParticlesSpecificHeatValue(self, value):
+ #"""
+ #"""
+ #self.isFloat(value)
+ #node_model = self.__nodeParticlesModel()
+ #node_thermal = node_model.xmlInitChildNode('thermal', 'status')
+ ##check if node_thermal status == "on" ?
+ #node_cp = node_thermal.xmlInitChildNode('particle_specific_heat')
+ #node_cp.xmlSetTextNode(str(value))
+
+
+ #def getParticlesSpecificHeatValue(self):
+ #"""
+ #"""
+ #node_model = self.__nodeParticlesModel()
+ #node_thermal = node_model.xmlInitChildNode('thermal', 'status')
+ #value = node_thermal.xmlGetDouble('particle_specific_heat')
+ #if not value:
+ #value = self.defaultParticlesValues()['particle_specific_heat']
+ #self.setParticlesSpecificHeatValue(value)
+ #return value
+
+
+ def setEvaporation(self, status):
+ """
+ Update the status for the activation of an evolution equation on the particle temperature.
+ """
+ self.isOnOff(status)
+ node_model = self.__nodeParticlesModel()
+ node_mass = node_model.xmlInitChildNode('evaporation', 'status')
+ node_mass['status'] = status
+
+
+ def getEvaporation(self):
+ """
+ Return status for the activation of an evolution equation on the particle temperature.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_mass = node_model.xmlInitChildNode('evaporation', 'status')
+ status = node_mass['status']
+ if not status:
+ status = self.defaultParticlesValues()['evaporation']
+ self.setEvaporation(status)
+ return status
+
+
+ def setCoalFouling(self, status):
+ """
+ Update the status for coal particle fouling.
+ """
+ self.isOnOff(status)
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ node_coal['status'] = status
+ if status == "on":
+ self.coalThermoChModel = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+ coals = self.coalThermoChModel.getCoals()
+ for icoal in range(coals.getNumber()):
+ self.getThresholdTemperatureOfFouling(icoal+1)
+ self.getCriticalViscosityOfFouling(icoal+1)
+ self.getCoef1OfFouling(icoal+1)
+ self.getCoef2OfFouling(icoal+1)
+ elif status == "off":
+ node_coal.xmlRemoveChild('threshold_temperature')
+ node_coal.xmlRemoveChild('critical_viscosity')
+ node_coal.xmlRemoveChild('fouling_coefficient_1')
+ node_coal.xmlRemoveChild('fouling_coefficient_2')
+
+
+ def getCoalFouling(self):
+ """
+ Return status for coal particle fouling.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ status = node_coal['status']
+ if not status:
+ status = self.defaultParticlesValues()['coal_fouling']
+ self.setCoalFouling(status)
+ return status
+
+
+ def setThresholdTemperatureOfFouling(self, icoal, value):
+ """
+ Update the value for the threshold temperature for the coal specified.
+ """
+ self.isFloat(value)
+ self.isGreater(value, 0.)
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ node_temp = node_coal.xmlInitChildNode('threshold_temperature', coal=icoal)
+ node_temp.xmlSetTextNode(str(value))
+
+
+ def getThresholdTemperatureOfFouling(self, icoal):
+ """
+ Return the value for the threshold temperature for the specified coal.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ value = node_coal.xmlGetDouble('threshold_temperature', coal=icoal)
+ if value == None:
+ value = self.defaultParticlesValues()['threshold_temperature']
+ self.setThresholdTemperatureOfFouling(icoal, value)
+ return value
+
+
+ def setCriticalViscosityOfFouling(self, icoal, value):
+ """
+ Update the value for the critical viscosity for the coal specified.
+ """
+ self.isFloat(value)
+ self.isGreater(value, 0.)
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ node_visc = node_coal.xmlInitChildNode('critical_viscosity', coal=icoal)
+ node_visc.xmlSetTextNode(str(value))
+
+
+ def getCriticalViscosityOfFouling(self, icoal):
+ """
+ Return the value for the critical viscosity for the coal specified.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ value = node_coal.xmlGetDouble('critical_viscosity', coal=icoal)
+ if value == None:
+ value = self.defaultParticlesValues()['critical_viscosity']
+ self.setCriticalViscosityOfFouling(icoal, value)
+ return value
+
+
+ def setCoef1OfFouling(self, icoal, value):
+ """
+ Update the value for the coefficient for the coal specified.
+ """
+ self.isFloat(value)
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ node_visc = node_coal.xmlInitChildNode('fouling_coefficient_1', coal=icoal)
+ node_visc.xmlSetTextNode(str(value))
+
+
+ def getCoef1OfFouling(self, icoal):
+ """
+ Return the value for the coefficient for the coal specified.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ value = node_coal.xmlGetDouble('fouling_coefficient_1', coal=icoal)
+ if not value:
+ value = self.defaultParticlesValues()['fouling_coefficient_1']
+ self.setCoef1OfFouling(icoal, value)
+ return value
+
+
+ def setCoef2OfFouling(self, icoal, value):
+ """
+ Update the value for the coefficient for the coal specified.
+ """
+ self.isFloat(value)
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ node_visc = node_coal.xmlInitChildNode('fouling_coefficient_2', coal=icoal)
+ node_visc.xmlSetTextNode(str(value))
+
+
+ def getCoef2OfFouling(self, icoal):
+ """
+ Return the value for the coefficient for the coal specified.
+ """
+ node_model = self.__nodeParticlesModel()
+ node_coal = node_model.xmlInitChildNode('coal_fouling', 'status')
+ value = node_coal.xmlGetDouble('fouling_coefficient_2', coal=icoal)
+ if not value:
+ value = self.defaultParticlesValues()['fouling_coefficient_2']
+ self.setCoef2OfFouling(icoal, value)
+ return value
+
+
+ def set2WayCouplingStartIteration(self, value):
+ """
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ node_2way.xmlSetData('iteration_start', value)
+
+
+ def get2WayCouplingStartIteration(self):
+ """
+ """
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ niter = node_2way.xmlGetInt('iteration_start')
+ if niter == None:
+ niter = self.defaultParticlesValues()['iteration_start']
+ self.set2WayCouplingStartIteration(niter)
+ return niter
+
+
+ def set2WayCouplingDynamic(self, status):
+ """
+ Update the status for 2 way coupling on continuous phase dynamic markup from the XML document.
+ """
+ self.isOnOff(status)
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ node_dyn = node_2way.xmlInitChildNode('dynamic')
+ node_dyn['status'] = status
+
+
+ def get2WayCouplingDynamic(self):
+ """
+ Return status of 2 way coupling on continuous phase dynamic.
+ """
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ node_dyn = node_2way.xmlInitChildNode('dynamic')
+ status = node_dyn['status']
+ if not status:
+ status = self.defaultParticlesValues()['dynamic']
+ self.set2WayCouplingDynamic(status)
+ return status
+
+
+ def set2WayCouplingMass(self, status):
+ """
+ Update the status markup for 2 way coupling on mass from the XML document.
+ """
+ self.isOnOff(status)
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ node_mass = node_2way.xmlInitChildNode('mass')
+ node_mass['status'] = status
+
+
+ def get2WayCouplingMass(self):
+ """
+ Return status of 2 way coupling on mass.
+ """
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ node_mass = node_2way.xmlInitChildNode('mass')
+ status = node_mass['status']
+ if not status:
+ status = self.defaultParticlesValues()['mass']
+ self.set2WayCouplingMass(status)
+ return status
+
+
+ def set2WayCouplingTemperature(self, status):
+ """
+ Update the status markup for 2 way coupling on temperature from the XML document.
+ """
+ self.isOnOff(status)
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ node_temp = node_2way.xmlInitChildNode('thermal')
+ node_temp['status'] = status
+
+
+ def get2WayCouplingTemperature(self):
+ """
+ Return status of 2 way coupling on temperature.
+ """
+ node_2way = self.node_lagr.xmlInitChildNode('two_way_coupling')
+ node_temp = node_2way.xmlInitChildNode('thermal')
+ status = node_temp['status']
+ if not status:
+ status = self.defaultParticlesValues()['thermal']
+ self.set2WayCouplingTemperature(status)
+ return status
+
+
+ def setSchemeOrder(self, value):
+ """
+ Update value for scheme order.
+ """
+ self.isInt(value)
+ self.isInList(value, (1,2))
+ node_order = self.node_lagr.xmlInitChildNode('scheme_order', 'choice')
+ node_order['choice'] = value
+
+
+ def getSchemeOrder(self):
+ """
+ Return value for scheme order.
+ """
+ node_order = self.node_lagr.xmlInitChildNode('scheme_order', 'choice')
+ if node_order:
+ val = node_order['choice']
+ if val == "":
+ val = self.defaultParticlesValues()['scheme_order']
+ self.setSchemeOrder(val)
+ return val
+
+
+ def setTurbulentDispersion(self, status):
+ """
+ Update the status markup for turbulent dispersion status from the XML document.
+ """
+ self.isOnOff(status)
+ node_turb = self.node_lagr.xmlInitChildNode('turbulent_dispersion', 'status')
+ node_turb['status'] = status
+
+
+ def getTurbulentDispersion(self):
+ """
+ Return status of turbulent dispersion status.
+ """
+ node_turb = self.node_lagr.xmlInitChildNode('turbulent_dispersion', 'status')
+ status = node_turb['status']
+ if not status:
+ status = self.defaultParticlesValues()['turbulent_dispersion']
+ self.setTurbulentDispersion(status)
+ return status
+
+
+ def setTurbulentDiffusion(self, status):
+ """
+ Update the status markup for turbulent diffusion status from the XML document.
+ """
+ self.isOnOff(status)
+ node_turb = self.node_lagr.xmlInitChildNode('fluid_particles_turbulent_diffusion', 'status')
+ node_turb['status'] = status
+
+
+ def getTurbulentDiffusion(self):
+ """
+ Return status of turbulent diffusion status.
+ """
+ node_turb = self.node_lagr.xmlInitChildNode('fluid_particles_turbulent_diffusion', 'status')
+ status = node_turb['status']
+ if not status:
+ status = self.defaultParticlesValues()['fluid_particles_turbulent_diffusion']
+ self.setTurbulentDiffusion(status)
+ return status
+
+
+ def setCompleteModelStartIteration(self, iteration):
+ """
+ Set value for complete model start iteration.
+ """
+ self.isInt(iteration)
+ self.isGreaterOrEqual(iteration, 0)
+ self.node_lagr.xmlSetData('complete_model', iteration)
+
+
+ def getCompleteModelStartIteration(self):
+ """
+ Return value for complete model iteration.
+ """
+ iteration = self.node_lagr.xmlGetInt('complete_model')
+ if iteration == None:
+ iteration = self.defaultParticlesValues()['complete_model_iteration']
+ self.setCompleteModelStartIteration(iteration)
+ return iteration
+
+
+ def setCompleteModelDirection(self, value):
+ """
+ Set value for complete model direction.
+ """
+ self.isInt(value)
+ self.isInList(value, (1,2,3))
+ node_direction = self.node_lagr.xmlInitChildNode('complete_model_direction', 'choice')
+ node_direction['choice'] = value
+
+
+ def getCompleteModelDirection(self):
+ """
+ Return value for complete model direction.
+ """
+ node_direction = self.node_lagr.xmlInitChildNode('complete_model_direction', 'choice')
+ if node_direction:
+ val = node_direction['choice']
+ if val == "":
+ val = self.defaultParticlesValues()['complete_model_direction']
+ self.setCompleteModelDirection(val)
+ return val
+
+#-------------------------------------------------------------------------------
+# Lagrangian test case
+#-------------------------------------------------------------------------------
+
+class LagrangianTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkLagrangianInstantiation(self):
+ """Check whether the LagrangianModel class could be instantiated"""
+ model = None
+ model = LagrangianModel(self.case)
+
+ assert model != None, 'Could not instantiate LagrangianModel'
+
+ doc = """<lagrangian model="off"/>"""
+
+ assert model.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not instantiate LagrangianModel'
+
+
+ def checkLagrangianStatus(self):
+ """Check whether the Lagrangian status could be set and get."""
+ mdl = LagrangianModel(self.case)
+ mdl.setLagrangianStatus("on")
+
+ assert mdl.node_lagr == self.xmlNodeFromString("""<lagrangian model="on"/>"""), \
+ 'Could not get lagrangian status.'
+
+ assert mdl.getLagrangianStatus() == "on", \
+ 'Could not get lagrangian status.'
+
+
+ def checklagrangianStatus(self):
+ """Check whether the lagrangianStatus could be get."""
+ from TurbulenceModel import TurbulenceModel
+ mdl = LagrangianModel(self.case)
+ TurbulenceModel(self.case).setTurbulenceModel('LES_Smagorinsky')
+
+ assert mdl.lagrangianStatus() == ('off',), \
+ 'Could not use the lagrangianStatus method'
+
+
+ def checkLagrangianModel(self):
+ """Check whether the LagrangianModel could be set and get."""
+ mdl = LagrangianModel(self.case)
+
+ assert mdl.lagrangianStatus() == ('off', 'on'), \
+ 'Could not use the lagrangianStatus method'
+
+ mdl.setCouplingMode("frozen")
+ doc = """<lagrangian model="off">
+ <coupling_mode model="frozen"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not get lagrangian model.'
+
+ for mode in mdl.lagrangianCouplingMode():
+ mdl.setCouplingMode(mode)
+ name = mdl.getCouplingMode()
+ assert mode == mdl.getCouplingMode(), \
+ 'Could not use the get/setCouplingMode method for %s'% mode
+
+
+ def checkRestart(self):
+ """Check whether the restart method could be set and get."""
+ mdl = LagrangianModel(self.case)
+ status = mdl.getRestart()
+
+ assert status == mdl.defaultParticlesValues()['restart'], \
+ 'Could not get default values for restart status'
+
+ mdl.setRestart('on')
+ doc = """<lagrangian model="off">
+ <restart status="on"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set values for restart status'
+
+
+ def checkCarrierFlowStationary(self):
+ """Check whether the stationary behavior of the carrier flow
+ could be set and get."""
+ mdl = LagrangianModel(self.case)
+
+ status = mdl.getCarrierFlowStationary()
+
+ assert status == mdl.defaultParticlesValues()['carrier_field_stationary'], \
+ 'Could not get default values for stationary \
+ behavior of the carrier flow status'
+
+ mdl.setCarrierFlowStationary('on')
+ doc = """<lagrangian model="off">
+ <carrier_field_stationary status="on"/>
+ <coupling_mode model="one_way"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set default values for stationary \
+ behavior of the carrier flow status'
+
+
+ def checkMaxNumber(self):
+ """Check whether the max number of particles method could be set and get."""
+ mdl = LagrangianModel(self.case)
+ n = mdl.getMaxNumber()
+
+ assert n == mdl.defaultParticlesValues()['particles_max_number'], \
+ 'Could not set default values for max number of particles'
+
+ mdl.setMaxNumber(123456)
+ doc = """<lagrangian model="off">
+ <particles_max_number>123456</particles_max_number>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not get default values for max number of particles'
+
+
+ def checkContinuousInjection(self):
+ """Check whether the continuous injection could be set and get."""
+ mdl = LagrangianModel(self.case)
+ status = mdl.getContinuousInjection()
+
+ assert status == mdl.defaultParticlesValues()['continuous_injection'], \
+ 'Could not get default values for continuous injection status'
+
+ mdl.setContinuousInjection('on')
+ doc = """<lagrangian model="off">
+ <continuous_injection status="on"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set values for continuous injection status'
+
+
+ def checkParticlesModel(self):
+ """Check whether the particles models could be set and get."""
+ mdl = LagrangianModel(self.case)
+ mdl.setParticlesModel('thermal')
+ doc = """<lagrangian model="off">
+ <particles_models model="thermal"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for particles model (thermal)'
+
+ mdl.setParticlesModel('coal')
+ doc = """<lagrangian model="off">
+ <particles_models model="coal">
+ <coal_fouling status="off"/>
+ </particles_models>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for particles model (coal)'
+
+ for name in mdl.particlesModels():
+ mdl.setParticlesModel(name)
+ name2 = mdl.getParticlesModel()
+ assert name == name2 ,\
+ 'Could not use the get/setParticlesModel method for model name %s '%name
+
+
+ def checkBreakUp(self):
+ """Check whether the break-up model could be set and get."""
+ mdl = LagrangianModel(self.case)
+ mdl.setParticlesModel('thermal')
+ status = mdl.getBreakUp()
+
+ assert status == mdl.defaultParticlesValues()['break_up'], \
+ 'Could not get default values for break-up model'
+
+ mdl.setBreakUp('on')
+ doc = """<lagrangian model="off">
+ <particles_models model="thermal">
+ <break_up status="on"/>
+ </particles_models>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set value for break-up model'
+
+
+ def checkHeating(self):
+ """Check whether the heating model could be set and get."""
+ mdl = LagrangianModel(self.case)
+ mdl.setParticlesModel('thermal')
+ status = mdl.getHeating()
+
+ assert status == mdl.defaultParticlesValues()['thermal'], \
+ 'Could not get default values for heating model'
+
+ mdl.setHeating('on')
+ doc = """<lagrangian model="off">
+ <particles_models model="thermal">
+ <thermal status="on"/>
+ </particles_models>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set value for heating model'
+
+
+ def checkEvaporation(self):
+ """Check whether the heating model could be set and get."""
+ mdl = LagrangianModel(self.case)
+ mdl.setParticlesModel('thermal')
+ status = mdl.getEvaporation()
+
+ assert status == mdl.defaultParticlesValues()['evaporation'], \
+ 'Could not get default values for heating model'
+
+ mdl.setEvaporation('on')
+ doc = """<lagrangian model="off">
+ <particles_models model="thermal">
+ <evaporation status="on"/>
+ </particles_models>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set value for heating model'
+
+
+ def checkCoalFouling(self):
+ """Check whether the heating model could be set and get."""
+ mdl = LagrangianModel(self.case)
+ mdl.setParticlesModel('coal')
+ status = mdl.getCoalFouling()
+
+ assert status == mdl.defaultParticlesValues()['coal_fouling'], \
+ 'Could not get default values for coal fouling model'
+
+ mdl.setCoalFouling('on')
+ doc = """<lagrangian model="off">
+ <particles_models model="coal">
+ <coal_fouling status="on">
+ <threshold_temperature coal="1">
+ 600.0
+ </threshold_temperature>
+ <critical_viscosity coal="1">
+ 10000.0
+ </critical_viscosity>
+ <fouling_coefficient_1 coal="1">
+ 0.316608
+ </fouling_coefficient_1>
+ <fouling_coefficient_2 coal="1">
+ -1.6786
+ </fouling_coefficient_2>
+ </coal_fouling>
+ </particles_models>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set value for coal fouling model'
+
+ mdl.setThresholdTemperatureOfFouling(1, 800)
+ mdl.setCriticalViscosityOfFouling(1, 12300)
+ mdl.setCoef1OfFouling(1, -0.001)
+ mdl.setCoef2OfFouling(1, 0.002)
+ doc = """<lagrangian model="off">
+ <particles_models model="coal">
+ <coal_fouling status="on">
+ <threshold_temperature coal="1">
+ 800
+ </threshold_temperature>
+ <critical_viscosity coal="1">
+ 12300
+ </critical_viscosity>
+ <fouling_coefficient_1 coal="1">
+ -0.001
+ </fouling_coefficient_1>
+ <fouling_coefficient_2 coal="1">
+ 0.002
+ </fouling_coefficient_2>
+ </coal_fouling>
+ </particles_models>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set values for coal fouling model'
+
+
+ def check2WayCouplingStartIteration(self):
+ """Check whether the 2 way coupling start iteration could be set and get."""
+ mdl = LagrangianModel(self.case)
+ n = mdl.get2WayCouplingStartIteration()
+
+ assert n == mdl.defaultParticlesValues()['iteration_start'], \
+ 'Could not set default values for 2 way coupling start iteration'
+
+ mdl.set2WayCouplingStartIteration(123456)
+ doc = """<lagrangian model="off">
+ <two_way_coupling>
+ <iteration_start>
+ 123456
+ </iteration_start>
+ </two_way_coupling>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not get default values for 2 way coupling start iteration'
+
+
+ def check2WayCouplingDynamic(self):
+ """Check whether the 2 way coupling dynamic could be set and get."""
+ mdl = LagrangianModel(self.case)
+ n = mdl.get2WayCouplingDynamic()
+
+ assert n == mdl.defaultParticlesValues()['dynamic'], \
+ 'Could not set default values for 2 way coupling dynamic'
+
+ mdl.set2WayCouplingDynamic("on")
+ doc = """<lagrangian model="off">
+ <two_way_coupling>
+ <dynamic status="on"/>
+ </two_way_coupling>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not get default values for 2 way coupling dynamic'
+
+
+ def check2WayCouplingMass(self):
+ """Check whether the 2 way coupling mass could be set and get."""
+ mdl = LagrangianModel(self.case)
+ n = mdl.get2WayCouplingMass()
+
+ assert n == mdl.defaultParticlesValues()['mass'], \
+ 'Could not set default values for 2 way coupling mass'
+
+ mdl.set2WayCouplingMass("on")
+ doc = """<lagrangian model="off">
+ <two_way_coupling>
+ <mass status="on"/>
+ </two_way_coupling>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not get default values for 2 way coupling mass'
+
+
+ def check2WayCouplingThermal(self):
+ """Check whether the 2 way coupling mass could be set and get."""
+ mdl = LagrangianModel(self.case)
+ n = mdl.get2WayCouplingTemperature()
+
+ assert n == mdl.defaultParticlesValues()['thermal'], \
+ 'Could not set default values for 2 way coupling thermal'
+
+ mdl.set2WayCouplingTemperature("on")
+ doc = """<lagrangian model="off">
+ <two_way_coupling>
+ <thermal status="on"/>
+ </two_way_coupling>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not get default values for 2 way coupling thermal'
+
+
+ def checkSchemeOrder(self):
+ """Check whether the scheme order could be set and get."""
+ mdl = LagrangianModel(self.case)
+ n = mdl.getSchemeOrder()
+
+ assert n == mdl.defaultParticlesValues()['scheme_order'], \
+ 'Could not set default values for scheme order.'
+
+ mdl.setSchemeOrder(1)
+ doc = """<lagrangian model="off">
+ <scheme_order choice="1"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not get default values for scheme order.'
+
+
+ def checkTurbulentDispersion(self):
+ """Check whether the turbulent dispersion could be set and get."""
+ mdl = LagrangianModel(self.case)
+ status = mdl.getTurbulentDispersion()
+
+ assert status == mdl.defaultParticlesValues()['turbulent_dispersion'], \
+ 'Could not get default values for turbulent dispersion status.'
+
+ mdl.setTurbulentDispersion('on')
+ doc = """<lagrangian model="off">
+ <turbulent_dispersion status="on"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set default values for turbulent dispersion status.'
+
+
+ def checkTurbulentDiffusion(self):
+ """Check whether the turbulent diffusion could be set and get."""
+ mdl = LagrangianModel(self.case)
+ status = mdl.getTurbulentDiffusion()
+
+ assert status == mdl.defaultParticlesValues()['fluid_particles_turbulent_diffusion'], \
+ 'Could not get default values for turbulent diffusion status.'
+
+ mdl.setTurbulentDiffusion('on')
+ doc = """<lagrangian model="off">
+ <fluid_particles_turbulent_diffusion status="on"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set default values for turbulent diffusion status.'
+
+
+ def checkCompleteModelStartIteration(self):
+ """Check whether the complete model start iteration could be set and get."""
+ mdl = LagrangianModel(self.case)
+ status = mdl.getCompleteModelStartIteration()
+
+ assert status == mdl.defaultParticlesValues()['complete_model_iteration'], \
+ 'Could not get default values for complete model start iteration.'
+
+ mdl.setCompleteModelStartIteration(1234)
+ doc = """<lagrangian model="off">
+ <complete_model>1234</complete_model>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set default values for complete model start iteration.'
+
+
+ def checkCompleteModelDirection(self):
+ """Check whether the complete model direction could be set and get."""
+ mdl = LagrangianModel(self.case)
+ status = mdl.getCompleteModelDirection()
+
+ assert status == mdl.defaultParticlesValues()['complete_model_direction'], \
+ 'Could not get default values for complete model direction.'
+
+ mdl.setCompleteModelDirection(2)
+ doc = """<lagrangian model="off">
+ <complete_model_direction choice="2"/>
+ </lagrangian>"""
+
+ assert mdl.node_lagr == self.xmlNodeFromString(doc), \
+ 'Could not set default values for complete model direction.'
+
+
+def suite():
+ testSuite = unittest.makeSuite(LagrangianTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print os.path.basename(__file__)
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/LagrangianOutputForm.ui b/gui/Pages/LagrangianOutputForm.ui
new file mode 100644
index 0000000..8c56fa9
--- /dev/null
+++ b/gui/Pages/LagrangianOutputForm.ui
@@ -0,0 +1,584 @@
+<ui version="4.0" >
+ <class>LagrangianOutputForm</class>
+ <widget class="QWidget" name="LagrangianOutputForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>382</width>
+ <height>604</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QGroupBox" name="groupBoxListing" >
+ <property name="title" >
+ <string>Output listing</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxNTLAL" >
+ <property name="minimumSize" >
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTLAL</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditNTLAL" >
+ <property name="minimumSize" >
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTLAL</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxMode" >
+ <property name="title" >
+ <string>Post-processing for particles</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIENSI1" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IENSI1</string>
+ </property>
+ <property name="text" >
+ <string>Trajectory mode</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBoxIENSI1" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IENSI1</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelIENSI2" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IENSI2</string>
+ </property>
+ <property name="text" >
+ <string>Displacement mode</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QCheckBox" name="checkBoxIENSI2" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IENSI2</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelNVISLA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NVISLA</string>
+ </property>
+ <property name="text" >
+ <string>Output frequency</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditNVISLA" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NVISLA</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QLabel" name="labelNBVIS" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NBVIS</string>
+ </property>
+ <property name="text" >
+ <string>Number of particles for post-processing</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditNBVIS" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NBVIS</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelFormat_2" >
+ <property name="text" >
+ <string>Format</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxFormat" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelOptions" >
+ <property name="text" >
+ <string>Options </string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="comboBoxOptions" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxVariables" >
+ <property name="title" >
+ <string>Variables selection</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelIVISV2" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISV2</string>
+ </property>
+ <property name="text" >
+ <string>Particle velocity</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISV2" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISV2</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelIVISV1" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISV1</string>
+ </property>
+ <property name="text" >
+ <string>Fluid velocity seen by particles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISV1" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISV1</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="labelIVISTP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISTP</string>
+ </property>
+ <property name="text" >
+ <string>Residence time</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISTP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISTP</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="labelIVISDM" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISDM</string>
+ </property>
+ <property name="text" >
+ <string>Particle diameter</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISDM" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISDM</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLabel" name="labelIVISTE" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISTE</string>
+ </property>
+ <property name="text" >
+ <string>Particle temperature</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISTE" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISTE</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="4" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLabel" name="labelIVISMP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISMP</string>
+ </property>
+ <property name="text" >
+ <string>Particle mass</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISMP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISMP</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1" >
+ <widget class="QLabel" name="labelIVISHP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISHP</string>
+ </property>
+ <property name="text" >
+ <string>Temperature of the coal particles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISHP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISHP</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" >
+ <widget class="QLabel" name="labelIVISDK" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISDK</string>
+ </property>
+ <property name="text" >
+ <string>Shrinking core diameter of the coal particles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISDK" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISDK</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1" >
+ <widget class="QLabel" name="labelIVISCH" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISCH</string>
+ </property>
+ <property name="text" >
+ <string>Mass of reactive coal of the coal particles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISCH" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISCH</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="1" >
+ <widget class="QLabel" name="labelIVISCK" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISCK</string>
+ </property>
+ <property name="text" >
+ <string>Mass of char of the coal particles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="2" >
+ <widget class="QCheckBox" name="checkBoxIVISCK" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISCK</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>3</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/LagrangianOutputModel.py b/gui/Pages/LagrangianOutputModel.py
new file mode 100644
index 0000000..6c2de42
--- /dev/null
+++ b/gui/Pages/LagrangianOutputModel.py
@@ -0,0 +1,876 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+This module defines the lagrangian two phase flow modelling management.
+
+This module contains the following classes and function:
+- LagrangianOutputModel
+- LagrangianOutputTestCase
+"""
+
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import sys, unittest, logging
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianOutputModel")
+log.setLevel(Tool.GuiParam.DEBUG)
+
+
+#-------------------------------------------------------------------------------
+# lagrangian model class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianOutputModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Lagrangian module.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_lagr = self.case.root().xmlInitNode('lagrangian', 'model')
+ self._setDefaultVariables()
+
+
+ def _defaultLagrangianOutputValues(self):
+ """
+ Return a dictionnary which contains default values.
+ """
+ default = {}
+ default['listing_printing_frequency'] = 1
+ default['postprocessing_frequency'] = 1
+ default['postprocessing_format'] = "EnSight"
+ default['postprocessing_options'] = "ascii"
+ default['particles'] = "off"
+ default['trajectory'] = "off"
+ default['number_of_particles'] = 500
+ default['resident_time'] = "off"
+ default['diameter'] = "off"
+ default['temperature'] = "off"
+ default['velocity_particles'] = "off"
+ default['velocity_fluid_seen'] = "off"
+ default['mass'] = "off"
+ default['coal_temperature'] = "off"
+ default['shrinking_core_diameter'] = "off"
+ default['raw_coal_mass_fraction'] = "off"
+ default['char_mass_fraction'] = "off"
+ return default
+
+
+ def _setDefaultVariables(self):
+ """
+ Set variables and properties if lagrangian model is on.
+ """
+ self.node_output = self.node_lagr.xmlInitChildNode('output')
+
+## default = self._defaultLagrangianOutputValues()['listing_printing_frequency']
+## node = self.node_output.xmlInitChildNode('listing_printing_frequency')
+## node.xmlSetTextNode(str(default))
+
+## default = self._defaultLagrangianOutputValues()['postprocessing_frequency']
+## node = self.node_output.xmlInitChildNode('postprocessing_frequency')
+## node.xmlSetTextNode(str(default))
+
+## default = self._defaultLagrangianOutputValues()['postprocessing_format']
+## self.node_output.xmlInitChildNode('postprocessing_format', choice=default)
+
+## default = self._defaultLagrangianOutputValues()['postprocessing_options']
+## self.node_output.xmlInitChildNode('postprocessing_options', choice=default)
+
+## default = self._defaultLagrangianOutputValues()['particles']
+## self.node_output.xmlInitChildNode('particles', status=default)
+
+## default = self._defaultLagrangianOutputValues()['trajectory']
+## self.node_output.xmlInitChildNode('trajectory', status=default)
+
+## default = self._defaultLagrangianOutputValues()['number_of_particles']
+## node = self.node_output.xmlInitChildNode('number_of_particles')
+## node.xmlSetTextNode(str(default))
+
+## default = self._defaultLagrangianOutputValues()['resident_time']
+## self.node_output.xmlInitChildNode('resident_time', status=default)
+
+## default = self._defaultLagrangianOutputValues()['diameter']
+## self.node_output.xmlInitChildNode('diameter', status=default)
+
+## default = self._defaultLagrangianOutputValues()['velocity_particles']
+## self.node_output.xmlInitChildNode('velocity_particles', status=default)
+
+## default = self._defaultLagrangianOutputValues()['velocity_fluid_seen']
+## self.node_output.xmlInitChildNode('velocity_fluid_seen', status=default)
+
+## default = self._defaultLagrangianOutputValues()['mass']
+## self.node_output.xmlInitChildNode('mass', status=default)
+
+## default = self._defaultLagrangianOutputValues()['shrinking_core_diameter']
+## self.node_output.xmlInitChildNode('shrinking_core_diameter', status=default)
+
+## default = self._defaultLagrangianOutputValues()['raw_coal_mass_fraction']
+## self.node_output.xmlInitChildNode('raw_coal_mass_fraction', status=default)
+
+## default = self._defaultLagrangianOutputValues()['char_mass_fraction']
+## self.node_output.xmlInitChildNode('char_mass_fraction', status=default)
+
+
+ def setTrajectoryStatus(self, status):
+ """
+ Update the trajectory mode status markup from the XML document.
+ """
+ self.isOnOff(status)
+ node_traj = self.node_lagr.xmlInitNode('trajectory', 'status')
+ #node_traj = self.node_output.xmlInitChildNode('trajectory', 'status')
+ node_traj['status'] = status
+
+
+ def getTrajectoryStatus(self):
+ """
+ Return status for trajectory mode.
+ """
+ node_traj = self.node_output.xmlInitChildNode('trajectory', 'status')
+ status = node_traj['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['trajectory']
+ self.setTrajectoryStatus(status)
+ return status
+
+
+ def setParticlesStatus(self, status):
+ """
+ Update the particles mode status markup from the XML document.
+ """
+ self.isOnOff(status)
+ node_part = self.node_output.xmlInitChildNode('particles', 'status')
+ node_part['status'] = status
+
+
+ def getParticlesStatus(self):
+ """
+ Return status for particles mode.
+ """
+ node_part = self.node_output.xmlInitChildNode('particles', 'status')
+ status = node_part['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['particles']
+ self.setParticlesStatus(status)
+ return status
+
+
+ def setDisplayParticlesValue(self, value):
+ """
+ Update value of particles for post-processing display.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_output.xmlSetData('number_of_particles', value)
+
+
+ def getDisplayParticlesValue(self):
+ """
+ Return the value of particles for post-processing display.
+ """
+ npart = self.node_output.xmlGetInt('number_of_particles')
+ if npart == None:
+ npart = self._defaultLagrangianOutputValues()['number_of_particles']
+ self.setDisplayParticlesValue(npart)
+ return npart
+
+
+ def setListingFrequency(self, value):
+ """
+ Update the value for listing frequency.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_output.xmlSetData('listing_printing_frequency', value)
+
+
+ def getListingFrequency(self):
+ """
+ Return the value for listing frequency.
+ """
+ freq = self.node_output.xmlGetInt('listing_printing_frequency')
+ if freq == None:
+ freq = self._defaultLagrangianOutputValues()['listing_printing_frequency']
+ self.setListingFrequency(freq)
+ return freq
+
+
+ def setPostProcessingFrequency(self, value):
+ """
+ Update the value for post-processing frequency.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_output.xmlSetData('postprocessing_frequency', value)
+
+
+ def getPostProcessingFrequency(self):
+ """
+ Return the value for post-processing frequency.
+ """
+ freq = self.node_output.xmlGetInt('postprocessing_frequency')
+ if freq == None:
+ freq = self._defaultLagrangianOutputValues()['postprocessing_frequency']
+ self.setPostProcessingFrequency(freq)
+ return freq
+
+
+ def getPostProcessingFormat(self):
+ """
+ Return the value for post-processing format.
+ """
+ node_format = self.node_output.xmlInitChildNode('postprocessing_format', 'choice')
+ format = node_format['choice']
+ if not format:
+ format = self._defaultLagrangianOutputValues()['postprocessing_format']
+ #self.setPostProcessingFormat(format)
+ return format
+
+
+ def getPostProcessingOption(self):
+ """
+ Return the value for post-processing options.
+ """
+ node_format = self.node_output.xmlInitChildNode('postprocessing_options', 'choice')
+ format = node_format['choice']
+ if not format:
+ format = self._defaultLagrangianOutputValues()['postprocessing_options']
+ #self.setPostProcessingOption(format)
+ return format
+
+
+ def setFluidVelocityStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'velocity of the locally undisturbed fluid' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_velocity = self.node_output.xmlInitChildNode('velocity_fluid_seen', 'status')
+ node_velocity['status'] = status
+
+
+ def getFluidVelocityStatus(self):
+ """
+ Return status for association of the variable 'velocity of the locally
+ undisturbed fluid' with the display.
+ """
+ node_velocity = self.node_output.xmlInitChildNode('velocity_fluid_seen', 'status')
+ status = node_velocity['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['velocity_fluid_seen']
+ self.setFluidVelocityStatus(status)
+ return status
+
+
+ def setParticlesVelocityStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'particle velocity' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_velocity = self.node_output.xmlInitChildNode('velocity_particles', 'status')
+ node_velocity['status'] = status
+
+
+ def getParticlesVelocityStatus(self):
+ """
+ Return status for association of the variable 'particle velocity'
+ with the display.
+ """
+ node_velocity = self.node_output.xmlInitChildNode('velocity_particles', 'status')
+ status = node_velocity['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['velocity_particles']
+ self.setParticlesVelocityStatus(status)
+ return status
+
+
+ def setResidentTimeStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'resident time' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_rtime = self.node_output.xmlInitChildNode('resident_time', 'status')
+ node_rtime['status'] = status
+
+
+ def getResidentTimeStatus(self):
+ """
+ Return status for association of the variable 'resident time'
+ with the display.
+ """
+ node_rtime = self.node_output.xmlInitChildNode('resident_time', 'status')
+ status = node_rtime['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['resident_time']
+ self.setResidentTimeStatus(status)
+ return status
+
+
+ def setParticleDiameterStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'particle diameter' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_diam = self.node_output.xmlInitChildNode('diameter', 'status')
+ node_diam['status'] = status
+
+
+ def getParticleDiameterStatus(self):
+ """
+ Return status for association of the variable 'particle diameter'
+ with the display.
+ """
+ node_diam = self.node_output.xmlInitChildNode('diameter', 'status')
+ status = node_diam['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['diameter']
+ self.setParticleDiameterStatus(status)
+ return status
+
+
+ def setParticleTemperatureStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'particle temperature' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_temp = self.node_output.xmlInitChildNode('temperature', 'status')
+ node_temp['status'] = status
+
+
+ def getParticleTemperatureStatus(self):
+ """
+ Return status for association of the variable 'particle temperature'
+ with the display.
+ """
+ node_temp = self.node_output.xmlInitChildNode('temperature', 'status')
+ status = node_temp['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['temperature']
+ self.setParticleTemperatureStatus(status)
+ return status
+
+
+ def setParticleMassStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'particle mass' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_mass = self.node_output.xmlInitChildNode('mass', 'status')
+ node_mass['status'] = status
+
+
+ def getParticleMassStatus(self):
+ """
+ Return status for association of the variable 'particle mass'
+ with the display.
+ """
+ node_mass = self.node_output.xmlInitChildNode('mass', 'status')
+ status = node_mass['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['mass']
+ self.setParticleMassStatus(status)
+ return status
+
+
+ def setCoalParticleTemperatureStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'temperature of the coal particles' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_temp = self.node_output.xmlInitChildNode('coal_temperature', 'status')
+ node_temp['status'] = status
+
+
+ def getCoalParticleTemperatureStatus(self):
+ """
+ Return status for association of the variable 'temperature of the coal particles'
+ with the display.
+ """
+ node_temp = self.node_output.xmlInitChildNode('coal_temperature', 'status')
+ status = node_temp['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['coal_temperature']
+ self.setParticleTemperatureStatus(status)
+ return status
+ if not status:
+ status = self._defaultLagrangianOutputValues()['mass']
+ self.setParticleMassStatus(status)
+ return status
+
+
+ def setCoalParticleDiameterStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'shrinking core diameter of the coal particles' with the display
+ (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_diam = self.node_output.xmlInitChildNode('shrinking_core_diameter', 'status')
+ node_diam['status'] = status
+
+
+ def getCoalParticleDiameterStatus(self):
+ """
+ Return status for association of the variable
+ 'shrinking core diameter of the coal particles' with the display.
+ """
+ node_diam = self.node_output.xmlInitChildNode('shrinking_core_diameter', 'status')
+ status = node_diam['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['shrinking_core_diameter']
+ self.setCoalParticleDiameterStatus(status)
+ return status
+
+
+ def setCoalParticleMassStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'mass of reactive coal of the coal particles' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_mass = self.node_output.xmlInitChildNode('raw_coal_mass_fraction', 'status')
+ node_mass['status'] = status
+
+
+ def getCoalParticleMassStatus(self):
+ """
+ Return status for association of the variable 'mass of reactive coal of the coal particles'
+ with the display.
+ """
+ node_mass = self.node_output.xmlInitChildNode('raw_coal_mass_fraction', 'status')
+ status = node_mass['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['raw_coal_mass_fraction']
+ self.setCoalParticleDiameterStatus(status)
+ return status
+
+
+ def setCokeParticleMassStatus(self, status):
+ """
+ Update the status markup from the XML document to associate the variable
+ 'mass of char of the coal particles' with the display (trajectory or particles) mode.
+ """
+ self.isOnOff(status)
+ node_mass = self.node_output.xmlInitChildNode('char_mass_fraction', 'status')
+ node_mass['status'] = status
+
+
+ def getCokeParticleMassStatus(self):
+ """
+ Return status for association of the variable 'mass of char of the coal particles'
+ with the display.
+ """
+ node_mass = self.node_output.xmlInitChildNode('char_mass_fraction', 'status')
+ status = node_mass['status']
+ if not status:
+ status = self._defaultLagrangianOutputValues()['char_mass_fraction']
+ self.setCoalParticleDiameterStatus(status)
+ return status
+
+
+#-------------------------------------------------------------------------------
+# LagrangianOutput test case
+#-------------------------------------------------------------------------------
+
+
+class LagrangianOutputTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """
+ This method is executed before all "check" methods.
+ """
+ from Base.XMLengine import Case
+ from Base.XMLinitialize import XMLinit
+ self.case = Case()
+ XMLinit(self.case)
+
+
+ def tearDown(self):
+ """
+ This method is executed after all "check" methods.
+ """
+ del self.case
+
+
+ def checkLagrangianOutputInstantiation(self):
+ """
+ Check whether the LagrangianOutputModel class could be instantiated
+ """
+ model = None
+ model = LagrangianOutputModel(self.case)
+
+ assert model != None, 'Could not instantiate LagrangianOutputModel'
+
+
+ def checkLagrangianOutputDefaultValues(self):
+ """
+ Check the default values
+ """
+ model = LagrangianOutputModel(self.case)
+ doc = """
+ <output>
+ <listing_printing_frequency>
+ 1
+ </listing_printing_frequency>
+ <postprocessing_frequency>
+ 1
+ </postprocessing_frequency>
+ <postprocessing_format choice="EnSight"/>
+ <postprocessing_options choice="ascii"/>
+ <particles status="off"/>
+ <trajectory status="off"/>
+ <number_of_particles>
+ 500
+ </number_of_particles>
+ <resident_time status="off"/>
+ <diameter status="off"/>
+ <velocity_particles status="off"/>
+ <velocity_fluid_seen status="off"/>
+ <mass status="off"/>
+ <shrinking_core_diameter status="off"/>
+ <raw_coal_mass_fraction status="off"/>
+ <char_mass_fraction status="off"/>
+ </output>"""
+
+ assert model.node_output == self.xmlNodeFromString(doc),\
+ 'Could not get default values for LagrangianOutputModel model '
+
+
+ def checkSetandGetListingFrequency(self):
+ """
+ Check whether the listing frequency method could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ value = mdl.getListingFrequency()
+ assert value == 1 ,\
+ 'Could not get default value for '
+ mdl.setListingFrequency(1234)
+ doc = """
+ <listing_printing_frequency>
+ 1234
+ </listing_printing_frequency>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('listing_printing_frequency') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for'
+
+
+ def checkSetandGetPostProcessingFrequency(self):
+ """
+ Check whether the postprocessing frequency method could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ value = mdl.getPostProcessingFrequency()
+ assert value == 1 ,\
+ 'Could not get default value for postprocessing_frequency'
+ mdl.setPostProcessingFrequency(1234)
+ doc = """
+ <postprocessing_frequency>
+ 1234
+ </postprocessing_frequency>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('postprocessing_frequency') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for'
+
+
+ def checkSetandGetTrajectoryStatus(self):
+ """
+ Check whether the trajectory method could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getTrajectoryStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for trajectory status'
+ mdl.setTrajectoryStatus('on')
+ doc = """
+ <trajectory status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('trajectory') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for trajectory status'
+
+
+ def checkSetandGetParticlesStatus(self):
+ """
+ Check whether the particles mode method could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getParticlesStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for particles status'
+ mdl.setParticlesStatus('on')
+ doc = """
+ <particles status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('particles') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for particles mode status'
+
+
+ def checkSetandGetDisplayParticlesValue(self):
+ """
+ Check whether the particles to be display method could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ value = mdl.getDisplayParticlesValue()
+ assert value == 500 ,\
+ 'Could not get default value for '
+ mdl.setDisplayParticlesValue(123456789)
+ doc = """
+ <number_of_particles>
+ 123456789
+ </number_of_particles>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('number_of_particles') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for'
+
+
+ def checkSetandGetFluidVelocityStatus(self):
+ """
+ Check whether the method for 'velocity of the locally undisturbed fluid' association
+ with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getFluidVelocityStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for velocity_fluid_seen status'
+ mdl.setFluidVelocityStatus('on')
+ doc = """
+ <velocity_fluid_seen status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('velocity_fluid_seen') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for velocity_fluid_seen status '
+
+
+ def checkSetandGetParticlesVelocityStatus(self):
+ """
+ Check whether the method for 'particle velocity' association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getParticlesVelocityStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for velocity_particles status'
+ mdl.setParticlesVelocityStatus('on')
+ doc = """
+ <velocity_particles status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('velocity_particles') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for velocity_particles status'
+
+
+ def checkSetandGetResidentTimeStatus(self):
+ """
+ Check whether the method for 'resident time' association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getResidentTimeStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for resident time status'
+ mdl.setResidentTimeStatus('on')
+ doc = """
+ <resident_time status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('resident_time') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for resident time status'
+
+
+ def checkSetandGetParticleDiameterStatus(self):
+ """
+ Check whether the method for 'particle diameter' association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getParticleDiameterStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for diameter status'
+ mdl.setParticleDiameterStatus('on')
+ doc = """
+ <diameter status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('diameter') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for diameter status'
+
+
+ def checkSetandGetParticleTemperatureStatus(self):
+ """
+ Check whether the method for 'particle temperature' association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getParticleTemperatureStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for temperature status'
+ mdl.setParticleTemperatureStatus('on')
+ doc = """
+ <temperature status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('temperature') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for temperature status'
+
+
+ def checkSetandGetParticleMassStatus(self):
+ """
+ Check whether the method for 'particle mass' association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getParticleMassStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for mass status'
+ mdl.setParticleMassStatus('on')
+ doc = """
+ <mass status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('mass') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for mass status'
+
+
+ def checkSetandGetCoalParticleTemperatureStatus(self):
+ """
+ Check whether the method for 'temperature of the coal particles'
+ association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getCoalParticleTemperatureStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for status'
+ mdl.setCoalParticleTemperatureStatus('on')
+ doc = """
+ """
+
+ assert mdl.node_output.xmlInitChildNode('') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for status'
+
+
+ def checkSetandGetCoalParticleDiameterStatus(self):
+ """
+ Check whether the method for 'shrinking core diameter of the coal particles'
+ association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getCoalParticleDiameterStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for shrinking_core_diameter status'
+ mdl.setCoalParticleDiameterStatus('on')
+ doc = """
+ <shrinking_core_diameter status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('shrinking_core_diameter') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for shrinking_core_diameter status'
+
+
+ def checkSetandGetCoalParticleMassStatus(self):
+ """
+ Check whether the method for 'mass of reactive coal of the coal particles'
+ association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getCoalParticleMassStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for raw_coal_mass_fraction status'
+ mdl.setCoalParticleMassStatus('on')
+ doc = """
+ <raw_coal_mass_fraction status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('raw_coal_mass_fraction') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for raw_coal_mass_fraction status'
+
+
+ def checkSetandGetCokeParticleMassStatus(self):
+ """
+ Check whether the method for 'mass of char of the coal particles'
+ association with display could be set and get
+ """
+ mdl = LagrangianOutputModel(self.case)
+ status = mdl.getCokeParticleMassStatus()
+ assert status == 'off' ,\
+ 'Could not get default values for status'
+ mdl.setCokeParticleMassStatus('on')
+ doc = """
+ <char_mass_fraction status="on"/>
+ """
+
+ assert mdl.node_output.xmlInitChildNode('char_mass_fraction') == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for status'
+
+
+
+def suite():
+ testSuite = unittest.makeSuite(LagrangianOutputTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "LagrangianOutputTestCase A COMPLETER *********."
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/LagrangianOutputView.py b/gui/Pages/LagrangianOutputView.py
new file mode 100644
index 0000000..d9bab23
--- /dev/null
+++ b/gui/Pages/LagrangianOutputView.py
@@ -0,0 +1,474 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- LagrangianOutputView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+
+import logging
+
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from LagrangianOutputForm import Ui_LagrangianOutputForm
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, IntValidator, DoubleValidator
+from Pages.LagrangianOutputModel import LagrangianOutputModel
+import Pages.CoalThermoChemistry as CoalThermoChemistry
+
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianOutputView")
+log.setLevel(GuiParam.DEBUG)
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianOutputView(QWidget, Ui_LagrangianOutputForm):
+ """
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_LagrangianOutputForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = LagrangianOutputModel(self.case)
+
+ # Combo model
+ self.modelNTLAL = ComboModel(self.comboBoxNTLAL,3,1)
+ self.modelNTLAL.addItem(self.tr("No output"), 'None')
+ self.modelNTLAL.addItem(self.tr("Output listing at each time step"), 'At each step')
+ self.modelNTLAL.addItem(self.tr("Output every 'n' time steps"), 'Frequency_l')
+
+ # Connections
+ self.connect(self.checkBoxIENSI1, SIGNAL("clicked()"), self.slotIENSI1)
+ self.connect(self.checkBoxIENSI2, SIGNAL("clicked()"), self.slotIENSI2)
+ self.connect(self.lineEditNBVIS, SIGNAL("textChanged(const QString &)"), self.slotNBVIS)
+ self.connect(self.lineEditNVISLA, SIGNAL("textChanged(const QString &)"), self.slotNVISLA)
+ self.connect(self.comboBoxNTLAL, SIGNAL("activated(const QString&)"), self.slotChoiceNTLAL)
+ self.connect(self.lineEditNTLAL, SIGNAL("textChanged(const QString &)"), self.slotNTLAL)
+ self.connect(self.checkBoxIVISV1, SIGNAL("clicked()"), self.slotIVISV1)
+ self.connect(self.checkBoxIVISV2, SIGNAL("clicked()"), self.slotIVISV2)
+ self.connect(self.checkBoxIVISTP, SIGNAL("clicked()"), self.slotIVISTP)
+ self.connect(self.checkBoxIVISDM, SIGNAL("clicked()"), self.slotIVISDM)
+ self.connect(self.checkBoxIVISTE, SIGNAL("clicked()"), self.slotIVISTE)
+ self.connect(self.checkBoxIVISMP, SIGNAL("clicked()"), self.slotIVISMP)
+ self.connect(self.checkBoxIVISHP, SIGNAL("clicked()"), self.slotIVISHP)
+ self.connect(self.checkBoxIVISDK, SIGNAL("clicked()"), self.slotIVISDK)
+ self.connect(self.checkBoxIVISCH, SIGNAL("clicked()"), self.slotIVISCH)
+ self.connect(self.checkBoxIVISCK, SIGNAL("clicked()"), self.slotIVISCK)
+
+ validatorNBVIS = IntValidator(self.lineEditNBVIS, min=0)
+ self.lineEditNBVIS.setValidator(validatorNBVIS)
+
+ validatorNVISLA = IntValidator(self.lineEditNVISLA, min=0)
+ #setExclusive
+ self.lineEditNVISLA.setValidator(validatorNVISLA)
+
+ validatorNTLAL = IntValidator(self.lineEditNTLAL)
+ self.lineEditNTLAL.setValidator(validatorNTLAL)
+
+ # initialize Widgets
+
+ # post processing info to display
+ status = self.model.getTrajectoryStatus()
+ if status == "on":
+ self.checkBoxIENSI1.setChecked(True)
+ else:
+ self.checkBoxIENSI1.setChecked(False)
+
+ status = self.model.getParticlesStatus()
+ if status == "on":
+ self.checkBoxIENSI2.setChecked(True)
+ else:
+ self.checkBoxIENSI2.setChecked(False)
+
+ self.modelFormat = ComboModel(self.comboBoxFormat,1,1)
+ format = self.model.getPostProcessingFormat()
+ self.modelFormat.addItem(format)
+ self.modelFormat.setItem(str_model=format)
+ self.comboBoxFormat.setDisabled(True)
+
+ self.modelOption = ComboModel(self.comboBoxOptions,1,1)
+ option = self.model.getPostProcessingOption()
+ self.modelOption.addItem(option)
+ self.modelOption.setItem(str_model=option)
+ self.comboBoxOptions.setDisabled(True)
+
+ npart = self.model.getDisplayParticlesValue()
+ self.lineEditNBVIS.setText(QString(str(npart)))
+
+ period = self.model.getPostProcessingFrequency()
+ self.lineEditNVISLA.setText(QString(str(period)))
+
+ period = self.model.getListingFrequency()
+ if period == -1:
+ m = "None"
+ elif period == 1:
+ m = "At each step"
+ else:
+ m = "Frequency_l"
+ self.lineEditNTLAL.setText(QString(str(period)))
+ t = self.modelNTLAL.dicoM2V[m]
+ self.slotChoiceNTLAL(t)
+
+ status = self.model.getFluidVelocityStatus()
+ if status == "on":
+ self.checkBoxIVISV1.setChecked(True)
+ else:
+ self.checkBoxIVISV1.setChecked(False)
+
+ status = self.model.getParticlesVelocityStatus()
+ if status == "on":
+ self.checkBoxIVISV2.setChecked(True)
+ else:
+ self.checkBoxIVISV2.setChecked(False)
+
+ status = self.model.getResidentTimeStatus()
+ if status == "on":
+ self.checkBoxIVISTP.setChecked(True)
+ else:
+ self.checkBoxIVISTP.setChecked(False)
+
+ status = self.model.getParticleDiameterStatus()
+ if status == "on":
+ self.checkBoxIVISDM.setChecked(True)
+ else:
+ self.checkBoxIVISDM.setChecked(False)
+
+ status = self.model.getParticleTemperatureStatus()
+ if status == "on":
+ self.checkBoxIVISTE.setChecked(True)
+ else:
+ self.checkBoxIVISTE.setChecked(False)
+
+ status = self.model.getParticleMassStatus()
+ if status == "on":
+ self.checkBoxIVISMP.setChecked(True)
+ else:
+ self.checkBoxIVISMP.setChecked(False)
+
+ # FIXME
+ # check if coal model is activated
+## coalThermoChModel = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+## coals = coalThermoChModel.getCoals()
+## CoalsNumber = coals.getNumber()
+## if CoalsNumber == 0:
+## self.lineEditIVISHP.setDisabled(True)
+## self.checkBoxIVISHP.setDisabled(True)
+## self.lineEditIVISDK.setDisabled(True)
+## self.checkBoxIVISDK.setDisabled(True)
+## self.lineEditIVISCH.setDisabled(True)
+## self.checkBoxIVISCH.setDisabled(True)
+## self.lineEditIVISCK.setDisabled(True)
+## self.checkBoxIVISCK.setDisabled(True)
+ status = self.model.getCoalParticleTemperatureStatus()
+ if status == "on":
+ self.checkBoxIVISHP.setChecked(True)
+ else:
+ self.checkBoxIVISHP.setChecked(False)
+
+ status = self.model.getCoalParticleDiameterStatus()
+ if status == "on":
+ self.checkBoxIVISDK.setChecked(True)
+ else:
+ self.checkBoxIVISDK.setChecked(False)
+
+ status = self.model.getCoalParticleMassStatus()
+ if status == "on":
+ self.checkBoxIVISCH.setChecked(True)
+ else:
+ self.checkBoxIVISCH.setChecked(False)
+
+ status = self.model.getCokeParticleMassStatus()
+ if status == "on":
+ self.checkBoxIVISCK.setChecked(True)
+ else:
+ self.checkBoxIVISCK.setChecked(False)
+
+
+ @pyqtSignature("")
+ def slotIENSI1(self):
+ """
+ Input IENSI1.
+ """
+ if self.checkBoxIENSI1.isChecked():
+ self.model.setTrajectoryStatus("on")
+ else:
+ self.model.setTrajectoryStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIENSI2(self):
+ """
+ Input IENSI2.
+ """
+ if self.checkBoxIENSI2.isChecked():
+ self.model.setParticlesStatus("on")
+ else:
+ self.model.setParticlesStatus("off")
+
+
+ @pyqtSignature("const QString&")
+ def slotNBVIS(self, text):
+ """
+ Input NBVIS.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ log.debug("slotNBVIS value = %i "%value)
+ self.model.setDisplayParticlesValue(value)
+
+
+ @pyqtSignature("const QString&")
+ def slotNBVIS(self, text):
+ """
+ Input NBVIS.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setDisplayParticlesValue(value)
+
+
+ @pyqtSignature("const QString&")
+ def slotChoiceNVISLA(self, text):
+ """
+ Input NVISLA.
+ """
+ log.debug("slotChoiceNVISLA text = %s " %str(text))
+
+
+ @pyqtSignature("const QString&")
+ def slotNVISLA(self, text):
+ """
+ Input NVISLA.
+ """
+ log.debug("slotNVISLA text = %s " %str(text))
+
+
+ @pyqtSignature("const QString&")
+ def slotChoiceNTLAL(self, text):
+ """
+ Input NTLAL.
+ """
+ listing = self.modelNTLAL.dicoV2M[str(text)]
+ log.debug("slotChoiceNTLAL-> listing = %s" % listing)
+
+ if listing == "None":
+ ntlist = -1
+ self.model.setListingFrequency(ntlist)
+ self.lineEditNTLAL.setText(QString(str(ntlist)))
+ self.lineEditNTLAL.setDisabled(True)
+
+ elif listing == "At each step":
+ ntlist = 1
+ self.model.setListingFrequency(ntlist)
+ self.lineEditNTLAL.setText(QString(str(ntlist)))
+ self.lineEditNTLAL.setDisabled(True)
+
+ elif listing == "Frequency_l":
+ self.lineEditNTLAL.setEnabled(True)
+ ntlist, ok = self.lineEditNTLAL.text().toInt()
+ if ntlist < 1:
+ ntlist = 1
+ self.model.setListingFrequency(ntlist)
+ self.lineEditNTLAL.setText(QString(str(ntlist)))
+
+
+ @pyqtSignature("const QString&")
+ def slotNTLAL(self, text):
+ """
+ Input NTLAL.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ period, ok = text.toInt()
+ self.model.setListingFrequency(period)
+
+
+ @pyqtSignature("")
+ def slotIVISV1(self):
+ """
+ Input IVISV1.
+ """
+ if self.checkBoxIVISV1.isChecked():
+ self.model.setFluidVelocityStatus("on")
+ else:
+ self.model.setFluidVelocityStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISV2(self):
+ """
+ Input IVISV2.
+ """
+ if self.checkBoxIVISV2.isChecked():
+ self.model.setParticlesVelocityStatus("on")
+ else:
+ self.model.setParticlesVelocityStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISTP(self):
+ """
+ Input IVISTP.
+ """
+ if self.checkBoxIVISTP.isChecked():
+ self.model.setResidentTimeStatus("on")
+ else:
+ self.model.setResidentTimeStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISDM(self):
+ """
+ Input IVISDM.
+ """
+ if self.checkBoxIVISDM.isChecked():
+ self.model.setParticleDiameterStatus("on")
+ else:
+ self.model.setParticleDiameterStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISTE(self):
+ """
+ Input IVISTE.
+ """
+ if self.checkBoxIVISTE.isChecked():
+ self.model.setParticleTemperatureStatus("on")
+ else:
+ self.model.setParticleTemperatureStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISMP(self):
+ """
+ Input IVISMP.
+ """
+ if self.checkBoxIVISMP.isChecked():
+ self.model.setParticleMassStatus("on")
+ else:
+ self.model.setParticleMassStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISHP(self):
+ """
+ Input IVISHP.
+ """
+ if self.checkBoxIVISHP.isChecked():
+ self.model.setCoalParticleTemperatureStatus("on")
+ else:
+ self.model.setCoalParticleTemperatureStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISDK(self):
+ """
+ Input IVISDK.
+ """
+ if self.checkBoxIVISDK.isChecked():
+ self.model.setCoalParticleDiameterStatus("on")
+ else:
+ self.model.setCoalParticleDiameterStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISCH(self):
+ """
+ Input IVISCH.
+ """
+ if self.checkBoxIVISCH.isChecked():
+ self.model.setCoalParticleMassStatus("on")
+ else:
+ self.model.setCoalParticleMassStatus("off")
+
+
+ @pyqtSignature("")
+ def slotIVISCK(self):
+ """
+ Input IVISCK.
+ """
+ if self.checkBoxIVISCK.isChecked():
+ self.model.setCokeParticleMassStatus("on")
+ else:
+ self.model.setCokeParticleMassStatus("off")
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/LagrangianStatisticsForm.ui b/gui/Pages/LagrangianStatisticsForm.ui
new file mode 100644
index 0000000..5f893b5
--- /dev/null
+++ b/gui/Pages/LagrangianStatisticsForm.ui
@@ -0,0 +1,360 @@
+<ui version="4.0" >
+ <class>LagrangianStatisticsForm</class>
+ <widget class="QWidget" name="LagrangianStatisticsForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>363</width>
+ <height>414</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>42</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelISUIST" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISUIST</string>
+ </property>
+ <property name="text" >
+ <string>Particles statistics read from restart file</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBoxISUIST" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISUIST</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelNBCLST" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NBCLST</string>
+ </property>
+ <property name="text" >
+ <string>Number of particles cluster </string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditNBCLST" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NBCLST</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>41</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="widget" >
+ <attribute name="title" >
+ <string>Volumes</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_6" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxISTALA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISTALA</string>
+ </property>
+ <property name="title" >
+ <string>Volume statistics</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxMainVolume" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_4" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelIDSTNT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDSTNT</string>
+ </property>
+ <property name="text" >
+ <string>Iteration starting</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditIDSTNT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDSTNT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelSEUIL" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: SEUIL</string>
+ </property>
+ <property name="text" >
+ <string> Threshold for statistical weight</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditSEUIL" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: SEUIL</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxVolumeNames" >
+ <property name="title" >
+ <string>Variable names</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewVolumicNames" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Boundaries</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxIENSI3" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IENSI3</string>
+ </property>
+ <property name="title" >
+ <string>Boundaries statistics</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxMainBoundaries" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelNSTBOR" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NSTBOR</string>
+ </property>
+ <property name="text" >
+ <string>Iteration starting</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditNSTBOR" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NSTBOR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelSEUILF" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: SEUILF</string>
+ </property>
+ <property name="text" >
+ <string> Threshold for statistical weight</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditSEUILF" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: SEUILF</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxBoundariesNames" >
+ <property name="title" >
+ <string>Variable names</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewBoundariesNames" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/LagrangianStatisticsModel.py b/gui/Pages/LagrangianStatisticsModel.py
new file mode 100644
index 0000000..aea9805
--- /dev/null
+++ b/gui/Pages/LagrangianStatisticsModel.py
@@ -0,0 +1,469 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the lagrangian two phase flow modelling management.
+
+This module contains the following classes and function:
+- LagrangianStatisticsModel
+- LagrangianStatisticsTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest, logging
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Pages.LagrangianModel import LagrangianModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianStatisticsModel")
+log.setLevel(Tool.GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# lagrangian model class
+#-------------------------------------------------------------------------------
+
+class LagrangianStatisticsModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Lagrangian module.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_lagr = self.case.root().xmlInitNode('lagrangian', 'model')
+ self.node_stat = self.node_lagr.xmlInitChildNode('statistics')
+
+
+ def _defaultLagrangianStatisticsValues(self):
+ """
+ Return a dictionnary which contains default values.
+ """
+ default = {}
+ default['restart'] = "off"
+ default['statistics_groups_of_particles'] = 0
+ default['volume_statistics'] = "off"
+ default['iteration_start_volume'] = 1
+ default['threshold_volume'] = 0.
+
+ for v in self._defaultVariablesNamesVolume():
+ default[v] = v
+
+ default['boundary_statistics'] = "off"
+ default['iteration_start_boundary'] = 1
+ default['threshold_boundary'] = 0.
+
+ for v in self.getVariablesNamesBoundary():
+ default[v] = v
+
+ default['monitoring_point'] = "off"
+ default['listing_printing'] = "off"
+ default['postprocessing_recording'] = "off"
+
+ return default
+
+
+ def _defaultVariablesNamesVolume(self):
+ names = self.getVariablesNamesVolume()
+ volume_names = []
+ for name in names:
+ if name == "statistical_weight":
+ volume_names.append(name)
+ else:
+ volume_names.append("mean_" + name)
+ volume_names.append("variance_" + name)
+ return volume_names
+
+
+ # not private, used in View
+ def getVariablesNamesVolume(self):
+
+ names = ["statistical_weight",
+ "velocity_U", "velocity_V", "velocity_W",
+ "mass_fraction", "resident_time", "temperature",
+ "diameter", "shrinking_core_diameter",
+ "raw_coal_mass_fraction", "char_mass_fraction" ]
+ return names
+
+
+ # not private, used in View
+ def getVariablesNamesBoundary(self):
+ names = ["impacts", "mass_flux",
+ "angle", "velocity", "coal_fouling"]
+ return names
+
+
+ def setRestartStatisticsStatus(self, status):
+ """
+ Update the restart status markup from the XML document.
+ """
+ self.isOnOff(status)
+ node_restart = self.node_stat.xmlInitChildNode('restart', 'status')
+ node_restart['status'] = status
+
+
+ def getRestartStatisticsStatus(self):
+ """
+ Return status of restart file.
+ """
+ node_restart = self.node_stat.xmlInitChildNode('restart', 'status')
+ status = node_restart['status']
+ if not status:
+ status = self._defaultLagrangianStatisticsValues()['restart']
+ self.setRestartStatisticsStatus(status)
+ return status
+
+
+ def setGroupOfParticlesValue(self, value):
+ """
+ Update the value of group of particles.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_stat.xmlSetData('statistics_groups_of_particles', value)
+
+
+ def getGroupOfParticlesValue(self):
+ """
+ Return the value of group of particles.
+ """
+ npart = self.node_stat.xmlGetInt('statistics_groups_of_particles')
+ if npart == None:
+ npart = self._defaultLagrangianStatisticsValues()['statistics_groups_of_particles']
+ self.setGroupOfParticlesValue(npart)
+ return npart
+
+
+ # Volume functions
+ # ----------------
+ def setVolumeStatisticsStatus(self, status):
+ """
+ """
+ self.isOnOff(status)
+ self.node_volume['status'] = status
+
+
+ def getVolumeStatisticsStatus(self):
+ """
+ """
+ self.node_volume = self.node_stat.xmlInitChildNode('volume', 'status')
+ status = self.node_volume['status']
+ if not status:
+ status = self._defaultLagrangianStatisticsValues()['volume_statistics']
+ self.setVolumeStatisticsStatus(status)
+ return status
+
+
+ def setIterationStartVolume(self, value):
+ """
+ Update the iteration value for start of volume statistics calculation.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_volume.xmlSetData('iteration_start_volume', value)
+
+
+ def getIterationStartVolume(self):
+ """
+ Return the iteration value for start of volume statistics calculation.
+ """
+ value = self.node_volume.xmlGetInt('iteration_start_volume')
+ if value == None:
+ value = self._defaultLagrangianStatisticsValues()['iteration_start_volume']
+ self.setIterationStartVolume(value)
+ return value
+
+
+ def setThresholdValueVolume(self, value):
+ """
+ Update the limit statistical weight value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_volume.xmlSetData('threshold_volume', value)
+
+
+ def getThresholdValueVolume(self):
+ """
+ Return the limit statistical weight value.
+ """
+ value = self.node_volume.xmlGetDouble('threshold_volume')
+ if not value:
+ value = self._defaultLagrangianStatisticsValues()['threshold_volume']
+ self.setThresholdValueVolume(value)
+ return value
+
+
+ def getPropertyLabelFromNameVolume(self, name):
+ node = self.node_volume.xmlInitChildNode('property', name=name)
+ label = node['label']
+ if not label:
+ label = self._defaultLagrangianStatisticsValues()[name]
+ self.setPropertyLabelFromNameVolume(label, label)
+ return label
+
+
+ def setPropertyLabelFromNameVolume(self, name, label):
+ node = self.node_volume.xmlInitChildNode('property', name=name)
+ node['label'] = label
+
+
+ def getMonitoringStatusFromName(self, name):
+ node = self.node_volume.xmlInitChildNode('property', name=name)
+ node2 = node.xmlGetChildNode('monitoring_point', 'status')
+ if not node2:
+ return "on"
+ else:
+ return "off" # node2['status']
+
+
+ def setMonitoringStatusFromName(self, name, status):
+ self.isOnOff(status)
+ node = self.node_volume.xmlInitChildNode('property', name=name)
+ node2 = node.xmlInitChildNode('monitoring_point', 'status')
+ if status == "on":
+ node.xmlRemoveChild('monitoring_point')
+ elif status == "off":
+ node2['status'] = status
+
+
+ # Boundary functions
+ # ------------------
+ def setBoundaryStatisticsStatus(self, status):
+ """
+ """
+ self.isOnOff(status)
+ self.node_boundary['status'] = status
+
+
+ def getBoundaryStatisticsStatus(self):
+ """
+ """
+ self.node_boundary = self.node_stat.xmlInitChildNode('boundary', 'status')
+ status = self.node_boundary['status']
+ if not status:
+ status = self._defaultLagrangianStatisticsValues()['boundary_statistics']
+ self.setBoundaryStatisticsStatus(status)
+ return status
+
+
+ def setIterationStartBoundary(self, value):
+ """
+ Update iteration value for start of boundary statistics calculation.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_boundary.xmlSetData('iteration_start_boundary', value)
+
+
+ def getIterationStartBoundary(self):
+ """
+ Return the iteration value for start of boundary statistics calculation.
+ """
+ value = self.node_boundary.xmlGetInt('iteration_start_boundary')
+ if value == None:
+ value = self._defaultLagrangianStatisticsValues()['iteration_start_boundary']
+ self.setIterationStartBoundary(value)
+ return value
+
+
+ def setThresholdValueBoundary(self, value):
+ """
+ Update the limit statistical weight value.
+ """
+ self.isFloat(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_boundary.xmlSetData('threshold_boundary', value)
+
+
+ def getThresholdValueBoundary(self):
+ """
+ Return the limit statistical weight value.
+ """
+ value = self.node_boundary.xmlGetDouble('threshold_boundary')
+ if not value:
+ value = self._defaultLagrangianStatisticsValues()['threshold_boundary']
+ self.setThresholdValueBoundary(value)
+ return value
+
+
+ def getPropertyLabelFromNameBoundary(self, name):
+ node = self.node_boundary.xmlInitChildNode('property', name=name) #, support="boundary")
+ label = node['label']
+ if not label:
+ label = self._defaultLagrangianStatisticsValues()[name]
+ self.setPropertyLabelFromNameBoundary(label, label)
+ return label
+
+
+ def setPropertyLabelFromNameBoundary(self, name, label):
+ node = self.node_boundary.xmlInitChildNode('property', name=name) #, support="boundary")
+ node['label'] = label
+
+
+ def getListingPrintingStatusFromName(self, name):
+ node = self.node_boundary.xmlInitChildNode('property', name=name) #, support="boundary")
+ node2 = node.xmlGetChildNode('listing_printing', 'status')
+ if not node2:
+ return "on"
+ else:
+ return "off" # node2['status']
+
+
+ def setListingPrintingStatusFromName(self, name, status):
+ self.isOnOff(status)
+ node = self.node_boundary.xmlInitChildNode('property', name=name) #, support="boundary")
+ node2 = node.xmlInitChildNode('listing_printing', 'status')
+ if status == "on":
+ node.xmlRemoveChild('listing_printing')
+ elif status == "off":
+ node2['status'] = status
+
+
+ def getPostprocessingStatusFromName(self, name):
+ node = self.node_boundary.xmlInitChildNode('property', name=name) #, support="boundary")
+ node2 = node.xmlGetChildNode('postprocessing_recording', 'status')
+ if not node2:
+ return "on"
+ else:
+ return "off" # node2['status']
+
+
+ def setPostprocessingStatusFromName(self, name, status):
+ self.isOnOff(status)
+ node = self.node_boundary.xmlInitChildNode('property', name=name) #, support="boundary")
+ node2 = node.xmlInitChildNode('postprocessing_recording', 'status')
+ if status == "on":
+ node.xmlRemoveChild('postprocessing_recording')
+ elif status == "off":
+ node2['status'] = status
+
+#-------------------------------------------------------------------------------
+# LagrangianStatistics test case
+#-------------------------------------------------------------------------------
+
+class LagrangianStatisticsTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """
+ This method is executed before all "check" methods.
+ """
+ from Base.XMLengine import Case
+ from Base.XMLinitialize import XMLinit
+ self.case = Case()
+ XMLinit(self.case)
+
+
+ def tearDown(self):
+ """
+ This method is executed after all "check" methods.
+ """
+ del self.case
+
+
+ def checkLagrangianStatisticsInstantiation(self):
+ """
+ Check whether the LagrangianStatisticsModel class could be instantiated
+ """
+ model = None
+ model = LagrangianStatisticsModel(self.case)
+
+ assert model != None, 'Could not instantiate LagrangianStatisticsModel'
+
+
+ def checkLagrangianStatisticsDefaultValues(self):
+ """
+ Check the default values
+ """
+ model = LagrangianStatisticsModel(self.case)
+ doc = """"""
+
+ assert model.node_output == self.xmlNodeFromString(doc),\
+ 'Could not get default values for model'
+
+
+# def checkGetandSetLagrangianStatisticsModel(self):
+# """
+# Check whether the LagrangianStatisticsModel could be set/get
+# """
+# mdl = LagrangianStatisticsModel(self.case)
+# lagrangianStatus = mdl.lagrangianStatus()
+# assert lagrangianStatus == ('off','one_way','two_way','frozen')
+# for name in lagrangianStatus:
+# mdl.setLagrangianStatisticsModel(name)
+# name2 = mdl.getLagrangianStatisticsModel()
+# assert name == name2 ,\
+# 'Could not use the get/setLagrangianStatisticsModel method for model name %s '%name
+
+
+ def checkSetandGetRestart(self):
+ """
+ Check whether the restart method could be set and get
+ """
+ mdl = LagrangianStatisticsModel(self.case)
+ # default
+ status = mdl.getRestart()
+ assert status == 'off' ,\
+ 'Could not get default values for restart status'
+ mdl.setRestart('on')
+ doc = """
+ """
+
+ assert mdl.node_output == self.xmlNodeFromString(doc) ,\
+ 'Could not set values for restart status'
+
+
+def suite():
+ testSuite = unittest.makeSuite(LagrangianStatisticsTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "LagrangianStatisticsTestCase A COMPLETER *********."
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/LagrangianStatisticsView.py b/gui/Pages/LagrangianStatisticsView.py
new file mode 100644
index 0000000..4628b15
--- /dev/null
+++ b/gui/Pages/LagrangianStatisticsView.py
@@ -0,0 +1,553 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- StandardItemModelVolumicNames
+- StandardItemModelBoundariesNames
+- LagrangianStatisticsView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+
+import logging
+
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from LagrangianStatisticsForm import Ui_LagrangianStatisticsForm
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, IntValidator, DoubleValidator
+from Pages.LagrangianStatisticsModel import LagrangianStatisticsModel
+from Pages.LagrangianModel import LagrangianModel
+
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianStatisticsView")
+log.setLevel(GuiParam.DEBUG)
+
+
+#-------------------------------------------------------------------------------
+# StandarItemModel for volumic variables names
+#-------------------------------------------------------------------------------
+
+
+class StandardItemModelVolumicNames(QStandardItemModel):
+ def __init__(self, model):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.headers = [self.tr("Name"),
+ self.tr("Mean value name"),
+ self.tr("Variance name"),
+ self.tr("Recording")]
+ self.setColumnCount(len(self.headers))
+ self.model = model
+ self.initData()
+
+
+ def initData(self):
+
+ self.dataVolumicNames = []
+ vnames = self.model.getVariablesNamesVolume()
+
+ for vname in vnames:
+ if vname == "statistical_weight":
+ label = self.model.getPropertyLabelFromNameVolume(vname)
+ labelv = ""
+ monitoring = self.model.getMonitoringStatusFromName(vname)
+ line = [vname, label, labelv, monitoring]
+ else:
+ label = self.model.getPropertyLabelFromNameVolume("mean_" + vname)
+ labelv = self.model.getPropertyLabelFromNameVolume("variance_" + vname)
+ monitoring = self.model.getMonitoringStatusFromName(label)
+ line = [vname, label, labelv, monitoring]
+
+ row = self.rowCount()
+ self.setRowCount(row+1)
+ self.dataVolumicNames.append(line)
+
+
+ def data(self, index, role):
+
+ self.kwords = [ "", "NOMLAG", "NOMLAV", "IHSLAG"]
+ if not index.isValid():
+ return QVariant()
+
+ # ToolTips
+ if role == Qt.ToolTipRole:
+ if index.column() == 0:
+ return QVariant()
+ else:
+ return QVariant(self.tr("Code_Saturne key word: " + self.kwords[index.column()]))
+
+ # Display
+ if role == Qt.DisplayRole:
+ if index.column() in [0,1,2]:
+ return QVariant(self.dataVolumicNames[index.row()][index.column()])
+
+ # CheckState
+ elif role == Qt.CheckStateRole:
+ if index.column() == 3:
+ if self.dataVolumicNames[index.row()][index.column()] == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() == 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ elif index.column() in [1,2] :
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ #
+ if index.column() == 1:
+ label = str(value.toString())
+ self.dataVolumicNames[index.row()][index.column()] = label
+
+ vname = self.dataVolumicNames[index.row()][0]
+ if index.row() != 0: vname = "mean_" + vname
+ self.model.setPropertyLabelFromNameVolume(vname, label)
+
+ elif index.column() == 2:
+ labelv = str(value.toString())
+ self.dataVolumicNames[index.row()][index.column()] = labelv
+ name = self.dataVolumicNames[index.row()][0]
+ vname = "variance_" + name
+ self.model.setPropertyLabelFromNameVolume(vname, labelv)
+
+ elif index.column() == 3:
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ status = "off"
+ self.dataVolumicNames[index.row()][index.column()] = "off"
+ else:
+ status = "on"
+ self.dataVolumicNames[index.row()][index.column()] = "on"
+
+ vname = self.dataVolumicNames[index.row()][0]
+ if index.row() != 0: vname = "mean_" + vname
+ self.model.setMonitoringStatusFromName(vname, status)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+#-------------------------------------------------------------------------------
+# StandarItemModel for boundaries variables names
+#-------------------------------------------------------------------------------
+
+
+class StandardItemModelBoundariesNames(QStandardItemModel):
+ def __init__(self, model):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.headers = [self.tr("Name"),
+ self.tr("Value name"),
+ self.tr("Listing"),
+ self.tr("Post-processing")]
+ self.setColumnCount(len(self.headers))
+ self.model = model
+ self.initData()
+
+
+ def initData(self):
+
+ self.dataBoundariesNames = []
+ vnames = self.model.getVariablesNamesBoundary()
+ for vname in vnames:
+ label = self.model.getPropertyLabelFromNameBoundary(vname)
+ listing = self.model.getListingPrintingStatusFromName(vname)
+ postproc = self.model.getPostprocessingStatusFromName(vname)
+ line = [vname, label, listing, postproc]
+
+ row = self.rowCount()
+ self.setRowCount(row+1)
+ self.dataBoundariesNames.append(line)
+
+
+ def data(self, index, role):
+
+ self.kwords = [ "INBRBD", "IFLMBD", "IANGBD", "IVITBD", "IENCBD"]
+ if not index.isValid():
+ return QVariant()
+
+ # ToolTips
+ if role == Qt.ToolTipRole:
+ if index.column() == 1:
+ return QVariant(self.tr("Code_Saturne key word: NOMBRD"))
+ elif index.column() in [2,3]:
+ return QVariant(self.tr("Code_Saturne key word: " + self.kwords[index.row()]))
+
+ # Display
+ if role == Qt.DisplayRole:
+ if index.column() in [0, 1]:
+ return QVariant(self.dataBoundariesNames[index.row()][index.column()])
+
+ # CheckState
+ elif role == Qt.CheckStateRole:
+ if index.column() in [2, 3]:
+ if self.dataBoundariesNames[index.row()][index.column()] == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() == 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ elif index.column() == 1 :
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+
+ if index.column() == 1:
+ label = str(value.toString())
+ self.dataBoundariesNames[index.row()][index.column()] = label
+
+ vname = self.dataBoundariesNames[index.row()][0]
+ self.model.setPropertyLabelFromNameBoundary(vname, label)
+
+ elif index.column() == 2:
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ status = "off"
+ self.dataBoundariesNames[index.row()][index.column()] = "off"
+ else:
+ status = "on"
+ self.dataBoundariesNames[index.row()][index.column()] = "on"
+
+ vname = self.dataBoundariesNames[index.row()][0]
+ self.model.setListingPrintingStatusFromName(vname, status)
+
+ elif index.column() == 3:
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ status = "off"
+ self.dataBoundariesNames[index.row()][index.column()] = "off"
+ else:
+ status = "on"
+ self.dataBoundariesNames[index.row()][index.column()] = "on"
+
+ vname = self.dataBoundariesNames[index.row()][0]
+ self.model.setPostprocessingStatusFromName(vname, status)
+
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianStatisticsView(QWidget, Ui_LagrangianStatisticsForm):
+ """
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_LagrangianStatisticsForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = LagrangianStatisticsModel(self.case)
+
+ self.connect(self.checkBoxISUIST, SIGNAL("clicked()"), self.slotISUIST)
+ self.connect(self.lineEditNBCLST, SIGNAL("textChanged(const QString &)"), self.slotNBCLST)
+
+ self.connect(self.groupBoxISTALA, SIGNAL("clicked()"), self.slotISTALA)
+ self.connect(self.lineEditIDSTNT, SIGNAL("textChanged(const QString &)"), self.slotIDSTNT)
+ self.connect(self.lineEditSEUIL, SIGNAL("textChanged(const QString &)"), self.slotSEUIL)
+
+ self.connect(self.groupBoxIENSI3, SIGNAL("clicked()"), self.slotIENSI3)
+ self.connect(self.lineEditNSTBOR, SIGNAL("textChanged(const QString &)"), self.slotNSTBOR)
+ self.connect(self.lineEditSEUILF, SIGNAL("textChanged(const QString &)"), self.slotSEUILF)
+
+ validatorNBCLST = IntValidator(self.lineEditNBCLST, min=0) # max=100
+ #validatorNBCLST.setExclusiveMin(True)
+
+ validatorIDSTNT = IntValidator(self.lineEditIDSTNT, min=0)
+ validatorIDSTNT.setExclusiveMin(True)
+ validatorSEUIL = DoubleValidator(self.lineEditSEUIL, min=0.)
+ validatorNSTBOR = IntValidator(self.lineEditNSTBOR, min=0)
+ validatorNSTBOR.setExclusiveMin(True)
+ validatorSEUILF = DoubleValidator(self.lineEditSEUILF, min=0.)
+
+ self.lineEditNBCLST.setValidator(validatorNBCLST)
+ self.lineEditIDSTNT.setValidator(validatorIDSTNT)
+ self.lineEditSEUIL.setValidator(validatorSEUIL)
+ self.lineEditNSTBOR.setValidator(validatorNSTBOR)
+ self.lineEditSEUILF.setValidator(validatorSEUILF)
+
+ # initialize Widgets
+ # FIXME
+ # test if restart lagrangian is on
+## mdl.lagr = LagrangianModel()
+## is_restart = mdl_lagr.getRestart()
+## if is_restart == "off":
+## self.lineEditISUIST.setEnabled(False)
+## self.checkBoxISUIST.setEnabled(False)
+ status = self.model.getRestartStatisticsStatus()
+ if status == "on":
+ self.checkBoxISUIST.setChecked(True)
+ else:
+ self.checkBoxISUIST.setChecked(False)
+
+ nclust = self.model.getGroupOfParticlesValue()
+ self.lineEditNBCLST.setText(QString(str(nclust)))
+
+ # volume
+ status = self.model.getVolumeStatisticsStatus()
+ if status == "on":
+ self.groupBoxISTALA.setChecked(True)
+ else:
+ self.groupBoxISTALA.setChecked(False)
+ self.slotISTALA()
+
+ # boundary
+ status = self.model.getBoundaryStatisticsStatus()
+ if status == "on":
+ self.groupBoxIENSI3.setChecked(True)
+ else:
+ self.groupBoxIENSI3.setChecked(False)
+ self.slotIENSI3()
+
+
+ def _initVolumicNames(self):
+ """
+ Initialize names for volumic statistics.
+ """
+ self.modelVolumicNames = StandardItemModelVolumicNames(self.model)
+
+ self.tableViewVolumicNames.setModel(self.modelVolumicNames)
+ self.tableViewVolumicNames.setAlternatingRowColors(True)
+ self.tableViewVolumicNames.setSelectionBehavior(QAbstractItemView.SelectItems)
+ self.tableViewVolumicNames.setSelectionMode(QAbstractItemView.ExtendedSelection)
+ self.tableViewVolumicNames.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewVolumicNames.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+
+ def _initBoundariesNames(self):
+ """
+ Initialize names for volumic statistics.
+ """
+ self.modelBoundariesNames = StandardItemModelBoundariesNames(self.model)
+
+ self.tableViewBoundariesNames.setModel(self.modelBoundariesNames)
+ self.tableViewBoundariesNames.setAlternatingRowColors(True)
+ self.tableViewBoundariesNames.setSelectionBehavior(QAbstractItemView.SelectItems)
+ self.tableViewBoundariesNames.setSelectionMode(QAbstractItemView.ExtendedSelection)
+ self.tableViewBoundariesNames.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewBoundariesNames.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+
+ @pyqtSignature("")
+ def slotISUIST(self):
+ """
+ Input ISUIST.
+ """
+ if self.checkBoxISUIST.isChecked():
+ status = "on"
+ else:
+ status = "off"
+ self.model.setRestartStatisticsStatus(status)
+
+
+ @pyqtSignature("const QString")
+ def slotNBCLST(self, text):
+ """
+ Input NBCLST.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setGroupOfParticlesValue(value)
+
+
+ @pyqtSignature("")
+ def slotISTALA(self):
+ """
+ Input ISTALA.
+ """
+ if self.groupBoxISTALA.isChecked():
+
+ self.model.setVolumeStatisticsStatus("on")
+ self._initVolumicNames()
+
+ it = self.model.getIterationStartVolume()
+ self.lineEditIDSTNT.setText(QString(str(it)))
+
+ seuil = self.model.getThresholdValueVolume()
+ self.lineEditSEUIL.setText(QString(str(seuil)))
+
+ else:
+
+ self.model.setVolumeStatisticsStatus("off")
+ if hasattr(self, "modelVolumicNames"):
+ del self.modelVolumicNames
+
+
+ @pyqtSignature("const QString&")
+ def slotIDSTNT(self, text):
+ """
+ Input IDSTNT.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setIterationStartVolume(value)
+
+
+ @pyqtSignature("const QString&")
+ def slotSEUIL(self, text):
+ """
+ Input SEUIL.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setThresholdValueVolume(value)
+
+
+ @pyqtSignature("")
+ def slotIENSI3(self):
+ """
+ Input IENSI3.
+ """
+ if self.groupBoxIENSI3.isChecked():
+
+ self.model.setBoundaryStatisticsStatus("on")
+ self._initBoundariesNames()
+
+ it = self.model.getIterationStartBoundary()
+ self.lineEditNSTBOR.setText(QString(str(it)))
+
+ seuil = self.model.getThresholdValueBoundary()
+ self.lineEditSEUILF.setText(QString(str(seuil)))
+
+ else:
+
+ self.model.setBoundaryStatisticsStatus("off")
+ if hasattr(self, "modelBoundariesNames"):
+ del self.modelBoundariesNames
+
+
+ @pyqtSignature("const QString&")
+ def slotNSTBOR(self, text):
+ """
+ Input NSTBOR.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setIterationStartBoundary(value)
+
+
+ @pyqtSignature("const QString&")
+ def slotSEUILF(self, text):
+ """
+ Input SEUILF.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setThresholdValueBoundary(value)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/LagrangianView.py b/gui/Pages/LagrangianView.py
new file mode 100644
index 0000000..dc85014
--- /dev/null
+++ b/gui/Pages/LagrangianView.py
@@ -0,0 +1,781 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- LagrangianAdvancedOptionsDialogForm
+- StandardItemModelCoals
+- LagrangianView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from LagrangianForm import Ui_LagrangianForm
+from LagrangianAdvancedOptionsDialogForm import Ui_LagrangianAdvancedOptionsDialogForm
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, IntValidator, DoubleValidator
+from Pages.LagrangianModel import LagrangianModel
+from Pages.StartRestartModel import StartRestartModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("LagrangianView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Popup advanced options
+#-------------------------------------------------------------------------------
+
+class LagrangianAdvancedOptionsDialogView(QDialog, Ui_LagrangianAdvancedOptionsDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_LagrangianAdvancedOptionsDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("Advanced options"))
+ self.default = default
+ self.result = self.default.copy()
+
+ # Combo model
+ self.modelNORDRE = ComboModel(self.comboBoxNORDRE, 2, 1)
+ self.modelNORDRE.addItem(self.tr("first-order scheme"), "1")
+ self.modelNORDRE.addItem(self.tr("second-order scheme"), "2")
+
+ self.modelIDIRLA = ComboModel(self.comboBoxIDIRLA, 3, 1)
+ self.modelIDIRLA.addItem(self.tr("X"), "1")
+ self.modelIDIRLA.addItem(self.tr("Y"), "2")
+ self.modelIDIRLA.addItem(self.tr("Z"), "3")
+
+ # Connections
+ self.connect(self.comboBoxNORDRE, SIGNAL("activated(const QString&)"), self.slotNORDRE)
+ self.connect(self.checkBoxIDISTU, SIGNAL("clicked()"), self.slotIDISTU)
+ self.connect(self.checkBoxIDIFFL, SIGNAL("clicked()"), self.slotIDIFFL)
+ self.connect(self.groupBoxModel, SIGNAL("clicked(bool)"), self.slotModel)
+ self.connect(self.lineEditMODCPL, SIGNAL("textChanged(const QString &)"), self.slotMODCPL)
+ self.connect(self.comboBoxIDIRLA, SIGNAL("activated(const QString&)"), self.slotIDIRLA)
+
+ validatorMODCPL = IntValidator(self.lineEditMODCPL, min=1)
+ self.lineEditMODCPL.setValidator(validatorMODCPL)
+
+ # initialize Widgets
+ order = str(self.result['scheme_order'])
+ self.modelNORDRE.setItem(str_model=order)
+
+ if self.result['turbulent_dispertion'] == "on":
+ self.checkBoxIDISTU.setChecked(True)
+ else:
+ self.checkBoxIDISTU.setChecked(False)
+
+ if self.result['fluid_particles_turbulent_diffusion'] == "on":
+ self.checkBoxIDIFFL.setChecked(True)
+ else:
+ self.checkBoxIDIFFL.setChecked(False)
+
+ value = self.result['complete_model_iteration']
+ if value > 0:
+ self.lineEditMODCPL.setText(str(value))
+
+ direction = self.result['complete_model_direction']
+ self.modelIDIRLA.setItem(str_model=str(direction))
+ else:
+ self.groupBoxModel.setChecked(False)
+
+
+ @pyqtSignature("const QString&")
+ def slotNORDRE(self, text):
+ """
+ Input NORDRE.
+ """
+ value = self.modelNORDRE.dicoV2M[str(text)]
+ self.result['scheme_order'] = value
+
+
+ @pyqtSignature("")
+ def slotIDISTU(self):
+ """
+ Input IDISTU.
+ """
+ if self.checkBoxIDISTU.isChecked():
+ status = "on"
+ else:
+ status = "off"
+ self.result['turbulent_dispertion'] = status
+
+
+ @pyqtSignature("")
+ def slotIDIFFL(self):
+ """
+ Input IDIFFL.
+ """
+ if self.checkBoxIDIFFL.isChecked():
+ status = "on"
+ else:
+ status = "off"
+ self.result['fluid_particles_turbulent_diffusion'] = status
+
+
+ @pyqtSignature("bool")
+ def slotModel(self, checked):
+ if checked:
+ value = self.default['complete_model_iteration']
+ if value == 0:
+ value = 1
+ self.result['complete_model_iteration'] = value
+ self.lineEditMODCPL.setText(str(value))
+ else:
+ self.result['complete_model_iteration'] = 0
+
+
+ @pyqtSignature("const QString&")
+ def slotMODCPL(self, text):
+ """
+ Input MODCPL.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.result['complete_model_iteration'], ok = text.toInt()
+
+
+ @pyqtSignature("const QString&")
+ def slotIDIRLA(self, text):
+ """
+ Input IDIRLA.
+ """
+ value = self.modelIDIRLA.dicoV2M[str(text)]
+ self.result['complete_model_direction'] = value
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ self.result = self.default.copy()
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for values in self.tableViewCoals
+#-------------------------------------------------------------------------------
+
+class ValueDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(ValueDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ if index.row() == 0 or index.row() == 1:
+ v = DoubleValidator(editor, min=0.)
+ v.setExclusiveMin(True)
+ else:
+ v = DoubleValidator(editor)
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+ if editor.validator().state == QValidator.Acceptable:
+ value, ok = editor.text().toDouble()
+ for idx in self.parent.selectionModel().selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel for Coals
+#-------------------------------------------------------------------------------
+
+class StandardItemModelCoals(QStandardItemModel):
+ def __init__(self, case, model):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Limit temperature\nof fouling (deg C)"),
+ self.tr("Ash critical\nviscosity (Pa.s)"),
+ self.tr("Coefficient 1"),
+ self.tr("Coefficient 2")]
+
+ self.kwords = ["TPRENC", "VISREF", "ENC1" ,"ENC2"]
+
+ self.setColumnCount(len(self.headers))
+ self.dataCoals = []
+
+ self.case = case
+ self.model = model
+
+ import Pages.CoalThermoChemistry as CoalThermoChemistry
+ self.coalThermoChModel = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+ coals = self.coalThermoChModel.getCoals()
+ CoalsNumber = coals.getNumber()
+
+ for icoal in range(CoalsNumber):
+ line = []
+ line.append(self.model.getThresholdTemperatureOfFouling(icoal+1))
+ line.append(self.model.getCriticalViscosityOfFouling(icoal+1))
+ line.append(self.model.getCoef1OfFouling(icoal+1))
+ line.append(self.model.getCoef2OfFouling(icoal+1))
+ self.dataCoals.append(line)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ # ToolTips
+ if role == Qt.ToolTipRole:
+ return QVariant(self.tr("Code_Saturne key word: " + self.kwords[index.column()]))
+
+ # Display
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataCoals[index.row()][index.column()])
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+ col = index.column()
+
+ val, ok = value.toDouble()
+ self.dataCoals[row][col] = val
+
+ if col == 0:
+ self.model.setThresholdTemperatureOfFouling(row+1, val)
+ elif col == 1:
+ self.model.setCriticalViscosityOfFouling(row+1, val)
+ elif col == 2:
+ self.model.setCoef1OfFouling(row+1, val)
+ elif col == 3:
+ self.model.setCoef2OfFouling(row+1, val)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+
+class LagrangianView(QWidget, Ui_LagrangianForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_LagrangianForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = LagrangianModel(self.case)
+
+ # Combo model
+ self.modelIILAGR = ComboModel(self.comboBoxIILAGR,3,1)
+ self.modelIILAGR.addItem(self.tr("One way coupling"), "one_way")
+ self.modelIILAGR.addItem(self.tr("Two way coupling"), "two_way")
+ self.modelIILAGR.addItem(self.tr("Frozen carrier flow"), "frozen")
+
+ self.modelIPHYLA = ComboModel(self.comboBoxIPHYLA,3,1)
+ self.modelIPHYLA.addItem(self.tr("No model"), 'off')
+ self.modelIPHYLA.addItem(self.tr("Heating, break-up and evaporation"), 'thermal')
+ self.modelIPHYLA.addItem(self.tr("Pulverised coal model"), 'coal')
+
+ # Connections
+ self.connect(self.comboBoxIILAGR, SIGNAL("activated(const QString&)"), self.slotIILAGR)
+ self.connect(self.checkBoxISUILA, SIGNAL("clicked()"), self.slotISUILA)
+ self.connect(self.checkBoxISTTIO, SIGNAL("clicked()"), self.slotISTTIO)
+ self.connect(self.lineEditNBPMAX, SIGNAL("textChanged(const QString &)"), self.slotNBPMAX)
+ self.connect(self.checkBoxINJCON, SIGNAL("clicked()"), self.slotINJCON)
+ self.connect(self.comboBoxIPHYLA, SIGNAL("activated(const QString&)"), self.slotIPHYLA)
+ self.connect(self.checkBoxIDPVAR, SIGNAL("clicked()"), self.slotIDPVAR)
+ self.connect(self.checkBoxITPVAR, SIGNAL("clicked()"), self.slotITPVAR)
+ #self.connect(self.lineEditTPPART, SIGNAL("textChanged(const QString &)"), self.slotTPPART)
+ #self.connect(self.lineEditCPPART, SIGNAL("textChanged(const QString &)"), self.slotCPPART)
+ self.connect(self.checkBoxIMPVAR, SIGNAL("clicked()"), self.slotIMPVAR)
+ self.connect(self.checkBoxIENCRA, SIGNAL("clicked()"), self.slotIENCRA)
+ #
+ self.connect(self.lineEditNSTITS, SIGNAL("textChanged(const QString &)"), self.slotNSTITS)
+ self.connect(self.checkBoxLTSDYN, SIGNAL("clicked()"), self.slotLTSDYN)
+ self.connect(self.checkBoxLTSMAS, SIGNAL("clicked()"), self.slotLTSMAS)
+ self.connect(self.checkBoxLTSTHE, SIGNAL("clicked()"), self.slotLTSTHE)
+ self.connect(self.toolButtonAdvanced, SIGNAL("clicked()"), self.slotAdvancedOptions)
+
+ # Validators
+ validatorNBPMAX = IntValidator(self.lineEditNBPMAX, min=0)
+ #validatorTPPART = DoubleValidator(self.lineEditTPPART)
+ #validatorCPPART = DoubleValidator(self.lineEditCPPART, min=0.)
+ validatorNSTITS = IntValidator(self.lineEditNSTITS)
+
+ self.lineEditNBPMAX.setValidator(validatorNBPMAX)
+ #self.lineEditTPPART.setValidator(validatorTPPART)
+ #self.lineEditCPPART.setValidator(validatorCPPART)
+ self.lineEditNSTITS.setValidator(validatorNSTITS)
+
+ # initialize Widgets
+
+# # Update the lagrangian list with the calculation features
+#
+# for mdl in self.model.lagrangianCouplingMode():
+# if mdl not in self.model.lagrangianStatus():
+# self.modelIILAGR.disableItem(str_model=mdl)
+
+ model = self.model.getCouplingMode()
+ self.modelIILAGR.setItem(str_model=model)
+ self.slotIILAGR(self.modelIILAGR.dicoM2V[model])
+
+ # FIXME
+ # Control if restart is activated
+## is_restart = StartRestartModel.getRestart()
+## if is_restart == "on":
+## self.checkBoxISUILA.setEnabled(True)
+## self.lineEditISUILA.setEnabled(True)
+## else:
+## self.checkBoxISUILA.setEnabled(False)
+## self.lineEditISUILA.setEnabled(False)
+ status = self.model.getRestart()
+ if status == "on":
+ self.checkBoxISUILA.setChecked(True)
+ else:
+ self.checkBoxISUILA.setChecked(False)
+
+ status = self.model.getCarrierFlowStationary()
+ if status == "on":
+ self.checkBoxISTTIO.setChecked(True)
+ else:
+ self.checkBoxISTTIO.setChecked(False)
+
+ status = self.model.getContinuousInjection()
+ if status == "on":
+ self.checkBoxINJCON.setChecked(True)
+ else:
+ self.checkBoxINJCON.setChecked(False)
+
+ if ( model == "frozen" ):
+ self.labelISTTIO.setDisabled(True)
+ self.checkBoxISTTIO.setChecked(True)
+ self.checkBoxISTTIO.setDisabled(True)
+
+ nmax = self.model.getMaxNumber()
+ self.lineEditNBPMAX.setText(QString(str(nmax)))
+
+ status = self.model.getContinuousInjection()
+ if status == "on":
+ self.checkBoxINJCON.setChecked(True)
+ else:
+ self.checkBoxINJCON.setChecked(False)
+
+ part_model = self.model.getParticlesModel()
+ self.modelIPHYLA.setItem(str_model=part_model)
+ self.slotIPHYLA(self.modelIPHYLA.dicoM2V[part_model])
+
+
+ @pyqtSignature("const QString&")
+ def slotIILAGR(self, text):
+ """
+ Input IILAGR.
+ """
+ model = self.modelIILAGR.dicoV2M[str(text)]
+ self.model.setCouplingMode(model)
+
+ self.groupBox2way.hide()
+
+ self.labelISTTIO.setDisabled(False)
+ self.checkBoxISTTIO.setDisabled(False)
+
+ if model == "one_way":
+ pass
+
+ elif model == "two_way":
+ self.groupBox2way.show()
+
+ start_it = self.model.get2WayCouplingStartIteration()
+ self.lineEditNSTITS.setText(QString(str(start_it)))
+
+ status = self.model.get2WayCouplingDynamic()
+ if status == "on":
+ self.checkBoxLTSDYN.setChecked(True)
+ else:
+ self.checkBoxLTSDYN.setChecked(False)
+
+ status = self.model.get2WayCouplingMass()
+ if status == "on":
+ self.checkBoxLTSMAS.setChecked(True)
+ else:
+ self.checkBoxLTSMAS.setChecked(False)
+
+ status = self.model.get2WayCouplingTemperature()
+ if status == "on":
+ self.checkBoxLTSTHE.setChecked(True)
+ else:
+ self.checkBoxLTSTHE.setChecked(False)
+
+ elif model == "frozen":
+ self.labelISTTIO.setDisabled(True)
+ self.checkBoxISTTIO.setDisabled(True)
+
+
+ @pyqtSignature("")
+ def slotISUILA(self):
+ """
+ Input ISUILA.
+ """
+ if self.checkBoxISUILA.isChecked():
+ self.model.setRestart("on")
+ else:
+ self.model.setRestart("off")
+
+
+ @pyqtSignature("")
+ def slotISTTIO(self):
+ """
+ Input ISTTIO.
+ """
+ if self.checkBoxISTTIO.isChecked():
+ self.model.setCarrierFlowStationary("on")
+ else:
+ self.model.setCarrierFlowStationary("off")
+
+
+ @pyqtSignature("")
+ def slotINJCON(self):
+ """
+ Input INJCON.
+ """
+ if self.checkBoxINJCON.isChecked():
+ self.model.setContinuousInjection("on")
+ else:
+ self.model.setContinuousInjection("off")
+
+
+ @pyqtSignature("const QString&")
+ def slotNBPMAX(self, text):
+ """
+ Input NBPMAX.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.setMaxNumber(value)
+
+
+ @pyqtSignature("const QString&")
+ def slotIPHYLA(self, text):
+ """
+ Input IPHYLA.
+ """
+ value = self.modelIPHYLA.dicoV2M[str(text)]
+ self.model.setParticlesModel(value)
+
+ self.frameModel1.hide()
+ self.frameModel2.hide()
+
+ # No model
+ if value == "off":
+ pass
+
+ # Equations on temperature, diameter and mass
+ elif value == "thermal":
+
+ self.frameModel1.show()
+
+ status = self.model.getBreakUp()
+ if status == "on":
+ self.checkBoxIDPVAR.setChecked(True)
+ else:
+ self.checkBoxIDPVAR.setChecked(False)
+
+ status = self.model.getHeating()
+ if status == "on":
+ self.checkBoxITPVAR.setChecked(True)
+ #
+ #self.frameTemperature.show()
+ #
+ #temp = self.model.getParticlesTemperatureValue()
+ #cp = self.model.getParticlesSpecificHeatValue()
+ #self.lineEditTPPART.setText(str(temp))
+ #self.lineEditCPPART.setText(str(cp))
+
+ else:
+ self.checkBoxITPVAR.setChecked(False)
+ #self.frameTemperature.hide()
+
+ status = self.model.getEvaporation()
+ if status == "on":
+ self.checkBoxIMPVAR.setChecked(True)
+ else:
+ self.checkBoxIMPVAR.setChecked(False)
+
+ # Pulverised coal model
+ elif value == "coal":
+
+ self.frameModel2.show()
+ self.tableViewCoals.show()
+ status = self.model.getCoalFouling()
+ if status == "on":
+ self.checkBoxIENCRA.setChecked(True)
+ else:
+ self.checkBoxIENCRA.setChecked(False)
+ self.slotIENCRA()
+
+
+ @pyqtSignature("")
+ def slotIDPVAR(self):
+ """
+ Input IDPVAR.
+ """
+ if self.checkBoxIDPVAR.isChecked():
+ self.model.setBreakUp("on")
+ else:
+ self.model.setBreakUp("off")
+
+
+ @pyqtSignature("")
+ def slotITPVAR(self):
+ """
+ Input ITPVAR.
+ """
+ if self.checkBoxITPVAR.isChecked():
+ self.model.setHeating("on")
+ #self.frameTemperature.show()
+ #temp = self.model.getParticlesTemperatureValue()
+ #self.lineEditTPPART.setText(str(temp))
+ #cp = self.model.getParticlesSpecificHeatValue()
+ #self.lineEditCPPART.setText(str(cp))
+ else:
+ self.model.setHeating("off")
+ #self.frameTemperature.hide()
+
+
+ @pyqtSignature("const QString&")
+ def slotTPPART(self, text):
+ """
+ Input TPPART.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setParticlesTemperatureValue(value)
+
+
+ @pyqtSignature("const QString&")
+ def slotCPPART(self, text):
+ """
+ Input CPPART.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toDouble()
+ self.model.setParticlesSpecificHeatValue(value)
+
+
+ @pyqtSignature("")
+ def slotIMPVAR(self):
+ """
+ Input IMPVAR.
+ """
+ if self.checkBoxIMPVAR.isChecked():
+ self.model.setEvaporation("on")
+ else:
+ self.model.setEvaporation("off")
+
+
+ @pyqtSignature("")
+ def slotIENCRA(self):
+ """
+ Input IENCRA.
+ """
+ if self.checkBoxIENCRA.isChecked():
+ self.model.setCoalFouling("on")
+
+ self.modelCoals = StandardItemModelCoals(self.case, self.model)
+ self.tableViewCoals.setModel(self.modelCoals)
+ delegateValue = ValueDelegate(self.tableViewCoals)
+ self.tableViewCoals.setItemDelegateForColumn(0, delegateValue)
+ self.tableViewCoals.setItemDelegateForColumn(1, delegateValue)
+ self.tableViewCoals.setItemDelegateForColumn(2, delegateValue)
+ self.tableViewCoals.setItemDelegateForColumn(3, delegateValue)
+ self.tableViewCoals.show()
+ self.tableViewCoals.verticalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ self.tableViewCoals.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ self.tableViewCoals.horizontalHeader().setResizeMode(0, QHeaderView.Stretch)
+ else:
+ self.model.setCoalFouling("off")
+ if hasattr(self, "modelCoals"):
+ del self.modelCoals
+ self.tableViewCoals.hide()
+
+
+ @pyqtSignature("const QString&")
+ def slotNSTITS(self, text):
+ """
+ Input NSTITS.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ value, ok = text.toInt()
+ self.model.set2WayCouplingStartIteration(value)
+
+
+ @pyqtSignature("")
+ def slotLTSDYN(self):
+ """
+ Input LTSDYN.
+ """
+ if self.checkBoxLTSDYN.isChecked():
+ self.model.set2WayCouplingDynamic("on")
+ else:
+ self.model.set2WayCouplingDynamic("off")
+
+
+ @pyqtSignature("")
+ def slotLTSMAS(self):
+ """
+ Input LTSMAS.
+ """
+ if self.checkBoxLTSMAS.isChecked():
+ self.model.set2WayCouplingMass("on")
+ else:
+ self.model.set2WayCouplingMass("off")
+
+
+ @pyqtSignature("")
+ def slotLTSTHE(self):
+ """
+ Input LTSTHE.
+ """
+ if self.checkBoxLTSTHE.isChecked():
+ self.model.set2WayCouplingTemperature("on")
+ else:
+ self.model.set2WayCouplingTemperature("off")
+
+
+ @pyqtSignature("")
+ def slotAdvancedOptions(self):
+ """
+ Ask one popup for advanced specifications
+ """
+ default = {}
+ default['scheme_order'] = self.model.getSchemeOrder()
+ default['turbulent_dispertion'] = self.model.getTurbulentDispersion()
+ default['fluid_particles_turbulent_diffusion'] = self.model.getTurbulentDiffusion()
+ default['complete_model_iteration'] = self.model.getCompleteModelStartIteration()
+ default['complete_model_direction'] = self.model.getCompleteModelDirection()
+
+ dialog = LagrangianAdvancedOptionsDialogView(self, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ self.model.setSchemeOrder(int(result['scheme_order']))
+ self.model.setTurbulentDispersion(result['turbulent_dispertion'])
+ self.model.setTurbulentDiffusion(result['fluid_particles_turbulent_diffusion'])
+ self.model.setCompleteModelStartIteration(result['complete_model_iteration'])
+ self.model.setCompleteModelDirection(int(result['complete_model_direction']))
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/LocalizationForm.ui b/gui/Pages/LocalizationForm.ui
new file mode 100644
index 0000000..7443602
--- /dev/null
+++ b/gui/Pages/LocalizationForm.ui
@@ -0,0 +1,189 @@
+<ui version="4.0" >
+ <class>LocalizationForm</class>
+ <widget class="QWidget" name="LocalizationForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>225</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxLocalization" >
+ <property name="title" >
+ <string>GroupBox</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QTableView" name="tableView" >
+ <property name="statusTip" >
+ <string>Click right for context menu</string>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonNew" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDelete" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonSalome" >
+ <property name="text" >
+ <string>Add from Salome</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxCreation" >
+ <property name="title" >
+ <string>Add from Prepocessor listing</string>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelCreation" >
+ <property name="text" >
+ <string>Import groups and references from Preprocessor listing</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonCreation" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >:/new/prefix1/icons/22x22/document-open.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+S</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/LocalizationModel.py b/gui/Pages/LocalizationModel.py
new file mode 100644
index 0000000..e9f3d8b
--- /dev/null
+++ b/gui/Pages/LocalizationModel.py
@@ -0,0 +1,1154 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- Zone
+- BoundaryZone
+- VolumicZone
+- LocalizationModel
+- VolumicLocalizationModel
+- BoundaryLocalizationModel
+- LocalizationVolumicTestCase
+- LocalizationSurfacicTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest, types
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+from Base.XMLengine import *
+from Pages.Boundary import Boundary
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class Zone(object):
+ """
+ Zone API
+ """
+ def __new__(cls, typeZone , label = None, codeNumber = None, localization = None, nature = None):
+ """
+ Factory
+ """
+ if typeZone == 'BoundaryZone':
+ return BoundaryZone.__new__(BoundaryZone, label, codeNumber, localization, nature)
+ elif typeZone == 'VolumicZone':
+ return VolumicZone.__new__(VolumicZone, label, codeNumber, localization)
+ else:
+ raise ValueError, "Unknown type zone"
+
+
+ def __init__(self, typeZone , label = None, codeNumber = None, localization = None, nature = None):
+ """
+ """
+ self._initNatureList()
+
+ if label:
+ self._label = label
+ else:
+ self._label = self.defaultValues()['label']
+ if codeNumber:
+ self._codeNumber = codeNumber
+ else:
+ self._codeNumber = self.defaultValues()['codeNumber']
+ if localization:
+ self._localization = localization
+ else:
+ self._localization = self.defaultValues()['localization']
+ if nature:
+ if typeZone == 'VolumicZone' and type(nature) == types.StringType:
+ self._nature = self.defaultValues()['nature'].copy()
+ self._nature[nature] = "on"
+ else:
+ self._nature = nature
+ else:
+ self._nature = self.defaultValues()['nature']
+
+
+ def _initNatureList(self):
+ self._natureList = []
+ self._natureDict = {}
+
+
+ def setLabel(self, text):
+ if Model().isStr(text):
+ self._label = text
+
+
+ def getLabel(self):
+ return self._label
+
+
+ def setLocalization(self, text):
+ if Model().isStr(text):
+ self._localization = text
+
+
+ def getLocalization(self):
+ return self._localization
+
+
+ def setCodeNumber(self, number):
+ if Model().isPositiveInt(number):
+ self._codeNumber = number
+
+
+ def getCodeNumber(self):
+ return self._codeNumber
+
+
+ def setNature(self, text):
+ if Model().isInList(text, self._natureList):
+ self._nature = text
+
+
+ def getNature(self):
+ return self._nature
+
+
+ def getNatureList(self):
+ return self._natureList
+
+
+ def getModel2ViewDictionary(self):
+ return self._natureDict
+
+
+ def defaultValues(self):
+ dico = {}
+ dico['codeNumber'] = -1
+ dico['localization'] = "all[]"
+ return dico
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class BoundaryZone(Zone):
+ """
+ """
+ def __new__(cls, label = None, codeNumber = None, localization = None, nature = None):
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initNatureList(self):
+ self._natureList = ['wall', 'inlet', 'outlet', 'symmetry']
+
+ self._natureDict = {}
+ self._natureDict['wall'] = self.tr("Wall")
+ self._natureDict['inlet'] = self.tr("Inlet")
+ self._natureDict['outlet'] = self.tr("Outlet")
+ self._natureDict['symmetry'] = self.tr("Symmetry")
+
+
+ def defaultValues(self):
+ """
+ """
+ dico = Zone.defaultValues(self)
+ dico['label'] = 'Wall_'
+ dico['nature'] = self._natureList[0]
+ return dico
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class VolumicZone(Zone):
+ """
+ """
+ def __new__(cls, label = None, codeNumber = None, localization = None, nature = None):
+ return object.__new__(cls)
+
+
+ def _initNatureList(self):
+ self._natureList= ['initialization',
+ 'head_losses',
+ 'momentum_source_term',
+ 'mass_source_term',
+ 'thermal_source_term',
+ 'scalar_source_term']
+
+ self._natureDict = {}
+ self._natureDict['initialization'] = self.tr("Initialization")
+ self._natureDict['head_losses'] = self.tr("Head losses")
+ self._natureDict['momentum_source_term'] = self.tr("Momentum source term")
+ self._natureDict['mass_source_term'] = self.tr("Mass source term")
+ self._natureDict['thermal_source_term'] = self.tr("Thermal source term")
+ self._natureDict['scalar_source_term'] = self.tr("Scalar source term")
+
+
+ def defaultValues(self):
+ dico = Zone.defaultValues(self)
+ dico['label'] = 'Zone_'
+ dico['nature'] = {}
+ dico['nature']['initialization'] = "on"
+ dico['nature']['head_losses'] = "off"
+ dico['nature']['momentum_source_term'] = "off"
+ dico['nature']['mass_source_term'] = "off"
+ dico['nature']['thermal_source_term'] = "off"
+ dico['nature']['scalar_source_term'] = "off"
+ return dico
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class LocalizationModel(object):
+ """
+ Abstract class
+ """
+ def __new__(cls, typeZone, case):
+ """
+ """
+ if typeZone == 'BoundaryZone':
+ return BoundaryZone.__new__(BoundaryLocalizationModel, case)
+ elif typeZone == 'VolumicZone':
+ return VolumicZone.__new__(VolumicLocalizationModel, case)
+ else:
+ raise ValueError, "Unknown type zone"
+
+
+ def __init__(self, typeZone, case):
+ """
+ """
+ self._case = case
+ self._initModel()
+ self._typeZone = typeZone
+
+
+ def getLocalizationsZonesList(self):
+ """
+ Return list of localizations used by zones
+ """
+ zones = self.getZones()
+ locals = []
+ for zone in zones:
+ locals.append(zone.getLocalization())
+
+ return locals
+
+
+ def getLabelsZonesList(self):
+ """
+ Return list of labels used by zones
+ """
+ zones = self.getZones()
+ labels = []
+ for zone in zones:
+ labels.append(zone.getLabel())
+
+ return labels
+
+
+ def getCodeNumbersList(self):
+ """
+ Return list of code numbers used
+ """
+ zones = self.getZones()
+ codes = []
+ for zone in zones:
+ codes.append(zone.getCodeNumber())
+
+ return codes
+
+
+ def getZones(self):
+ """
+ Return zones list after XML file reading (virtual method)
+ """
+ return []
+
+
+ def getMaxCodeNumber(self):
+ """
+ Return maximum of code number's values to put on name
+ """
+ zones = self.getZones()
+ codeNumber = 0
+ for zone in zones:
+ codeNumber = max(codeNumber, zone.getCodeNumber())
+
+ return codeNumber
+
+
+ def getMaxNumberNature(self, nature):
+ """
+ Return maximum of nature number's values to put on name
+ """
+ Model().isInList(nature, self._natureList)
+
+
+ def renameLabel(self, label, newLabel):
+ """
+ """
+ if label == newLabel: return
+
+ labels = self.getLabelsZonesList()
+
+ Model().isInList(label, labels)
+ Model().isNotInList(newLabel, labels)
+
+
+ def renameName(self, codeNumber, newCodeNumber):
+ """
+ """
+ if codeNumber == newCodeNumber: return
+
+ labels = self.getLabelsZonesList()
+
+ Model().isInt(newCodeNumber)
+
+
+ def replaceLocalization(self, local, newLocal):
+ """
+ """
+ if local == newLocal: return
+
+ Model().isNotInList(newLocal, self.getLocalizationsZonesList())
+
+
+ def setLocalization(self, label, localization):
+ """
+ Define a new localization for the current zone (zone.getLabel == label).
+ """
+ labels = self.getLabelsZonesList()
+ Model().isInList(label, labels)
+
+
+ def setNature(self, label, nature):
+ """
+ Define a new nature number for the current zone (zone.getLabel == label)
+ """
+ # Set nature: nothing here, see other setNature reimplementation methods
+ pass
+
+
+ def addZone(self, newZone = None):
+ """
+ Add a new zone. Management of default values.
+ """
+ if newZone == None:
+ newZone = Zone(self._typeZone)
+
+ zones = self.getZones()
+
+ # Set localization
+
+ if newZone.getLocalization() == newZone.defaultValues()['localization']:
+ oldLocalization = ""
+ newLocalization = ""
+ for zone in zones:
+ oldLocalization = zone.getLocalization()
+ if oldLocalization != "all[]":
+ if newLocalization == "":
+ newLocalization = oldLocalization
+ else:
+ newLocalization += " or " + oldLocalization
+
+ if newLocalization == "":
+ newLocalization = newZone.defaultValues()['localization']
+ if newLocalization != "all[]":
+ newLocalization = "not (" + newLocalization + ")"
+
+ newZone.setLocalization(newLocalization)
+ else:
+ # No control on localization is avaliable
+ pass
+
+ # Set code number
+
+ if newZone.getCodeNumber() == newZone.defaultValues()['codeNumber']:
+ newZone.setCodeNumber(self.getMaxCodeNumber() + 1)
+ else:
+ codes = []
+ for zone in zones:
+ codes.append(zone.getCodeNumber())
+ Model().isNotInList(newZone.getCodeNumber(), codes)
+
+ # Set label: search a free label (Type of newLabel is: "default_n")
+
+ newLabel = newZone.getLabel()
+ if newLabel == newZone.defaultValues()['label']:
+ code = 1
+ inLabels = 1
+ while (inLabels):
+ inLabels = 0
+ for zone in zones:
+ if newLabel+str(code) == zone.getLabel():
+ inLabels = 1
+ break
+ code += 1
+ newLabel = newLabel + str(code-1)
+
+ newZone.setLabel(newLabel)
+ else:
+ labels = []
+ for zone in zones:
+ labels.append(zone.getLabel())
+ Model().isNotInList(newLabel, labels)
+
+ # Set nature: nothing here, see other addZone reimplementation methods
+
+ return newZone
+
+
+ def replaceZone(self, old_zone, new_zone):
+ """
+ Replace a zone by another in the XML file
+ """
+ #
+ newLabel = new_zone.getLabel()
+ if newLabel == new_zone.defaultValues()['label']:
+ newLabel = old_zone.getLabel()
+ self.renameLabel(old_zone.getLabel(), newLabel)
+
+ newCodeNumber = new_zone.getCodeNumber()
+ if newCodeNumber == new_zone.defaultValues()['codeNumber']:
+ newCodeNumber = old_zone.getCodeNumber()
+ self.renameName(old_zone.getCodeNumber(), newCodeNumber)
+
+ newLocal = new_zone.getLocalization()
+ if newLocal == new_zone.defaultValues()['localization']:
+ newLocal = old_zone.getLocalization()
+ self.replaceLocalization(old_zone.getLocalization(), newLocal)
+
+ return newLabel, newCodeNumber, newLocal
+
+
+ def deleteZone(self, label):
+ """
+ Delete the current zone (zone.getLabel == label)
+ """
+ pass
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class VolumicLocalizationModel(LocalizationModel):
+ """
+ """
+ def __new__(cls, case):
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initModel(self):
+ """
+ Initialize mode
+ """
+ XMLSolutionDomainNode = self._case.xmlInitNode('solution_domain')
+ self.__XMLVolumicConditionsNode = XMLSolutionDomainNode.xmlInitNode('volumic_conditions')
+ self.__natureOptions = Zone('VolumicZone').getNatureList()
+ self._tagList = ['initial_value']
+
+
+ def getZones(self):
+ """
+ Get zones in the XML file
+ """
+ XMLZonesNodes = self.__XMLVolumicConditionsNode.xmlGetChildNodeList('zone', 'label', 'name')
+
+ # XML file reading
+ zones = []
+ for node in XMLZonesNodes:
+ label = str(node['label'])
+ codeNumber = int(node['name'])
+ localization = str(node.xmlGetTextNode())
+ nature = self.getNature(label)
+ zone = Zone('VolumicZone',
+ label = label,
+ codeNumber = codeNumber,
+ localization = localization,
+ nature = nature)
+ zones.append(zone)
+ return zones
+
+
+ def getCodeNumberOfZoneLabel(self, label):
+ """
+ Get zones in the XML file
+ """
+ XMLZonesNodes = self.__XMLVolumicConditionsNode.xmlGetChildNodeList('zone', 'label', 'name')
+
+ # XML file reading
+ for node in XMLZonesNodes:
+ if node['label'] == label:
+ codeNumber = node['name']
+
+ return codeNumber
+
+
+ def setLocalization(self, label, localization):
+ """
+ Define a new localization for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ node = self.__XMLVolumicConditionsNode.xmlGetChildNode('zone', 'name', label = label)
+ node.xmlSetTextNode(localization)
+
+
+ def getCodeNumbersList(self, codeNumber=None):
+ """
+ Define a new code number for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ XMLZonesNodesList = self._case.xmlGetNodeList('zone', 'label', 'name')
+ codeList = []
+ for node in XMLZonesNodesList:
+ codeList.append(node['name'])
+ return codeList
+
+
+ def getNature(self, label):
+ """
+ Define a new Nature for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ node = self.__XMLVolumicConditionsNode.xmlGetChildNode('zone', 'name', label = label)
+ nature = {}
+ for option in self.__natureOptions:
+ if node[option] == 'on':
+ nature[option] = 'on'
+ else:
+ nature[option] = 'off'
+ return nature
+
+
+ def setNature(self, label, nature):
+ """
+ Define a new Nature for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ node = self.__XMLVolumicConditionsNode.xmlGetChildNode('zone', 'name', label = label)
+ oldNature = self.getNature(label)
+ if oldNature != nature:
+ for option in self.__natureOptions:
+ if option not in nature.keys():
+ nature[option] = 'off'
+ for k,v in nature.items():
+ node[k] = v
+
+
+ def addZone(self, zone = None):
+ """
+ Add a new zone in the XML file
+ """
+ newZone = LocalizationModel.addZone(self, zone)
+
+ # XML file updating
+ node = self.__XMLVolumicConditionsNode.xmlInitNode('zone',
+ label = newZone.getLabel(),
+ name = newZone.getCodeNumber())
+
+ for k, v in newZone.getNature().items():
+ node[k] = v
+
+ node.xmlSetTextNode(newZone.getLocalization())
+
+ return newZone
+
+
+ def replaceZone(self, old_zone, new_zone):
+ """
+ Replace a zone by another in the XML file
+ """
+ newLabel, newCodeNumber, newLocal = LocalizationModel.replaceZone(self, old_zone, new_zone)
+
+ node = self.__XMLVolumicConditionsNode.xmlGetNode('zone',
+ label = old_zone.getLabel())
+
+ # if codeNumber is modified, we must modify zone in initialization of variables
+ if old_zone.getCodeNumber() != newCodeNumber:
+ node['name'] = newCodeNumber
+ list = self.__natureOptions
+ list.append('initial_value')
+ for tag in self.__natureOptions:
+ for n in self._case.xmlGetNodeList(tag, zone=old_zone.getCodeNumber()):
+ n['zone'] = newCodeNumber
+
+ node['label'] = newLabel
+ node.xmlSetTextNode(newLocal)
+ for k, v in new_zone.getNature().items():
+ node[k] = v
+
+
+ def deleteZone(self, label):
+ """
+ Delete one zone in the XML file
+ """
+ LocalizationModel.deleteZone(self, label)
+ #
+ # Delete node
+ node = self._case.xmlGetNode('zone', label=label)
+ if node:
+ name = node['name']
+ node.xmlRemoveNode()
+
+ # Delete the other nodes for zone initializations
+ for tag in self._tagList:
+ nodeList = self._case.xmlGetNodeList(tag, zone=name)
+ for node in nodeList:
+ node.xmlRemoveNode()
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class BoundaryLocalizationModel(LocalizationModel):
+ """
+ """
+ def __new__(cls, case):
+ """
+ Constructor
+ """
+ return object.__new__(cls)
+
+
+ def _initModel(self):
+ """
+ Initialize mode
+ """
+ #LocalizationModel._initModel(self)
+ self.__XMLBoundaryConditionsNode = self._case.xmlInitNode('boundary_conditions')
+ self.__natureList = Zone('BoundaryZone').getNatureList()
+
+
+ def getZones(self):
+ """
+ Get zones in the XML file
+ """
+ XMLZonesNodes = self.__XMLBoundaryConditionsNode.xmlGetChildNodeList('boundary', 'label', 'name', 'nature')
+ #
+ # XML file reading
+ zones = []
+ for node in XMLZonesNodes:
+ label = str(node['label'])
+ nature = str(node['nature'])
+ codeNumber = int(node['name'])
+ localization = str(node.xmlGetTextNode())
+ zone = Zone('BoundaryZone', label = label, codeNumber = codeNumber, localization = localization, nature = nature)
+ zones.append(zone)
+ return zones
+
+
+ def getMaxNumberNature(self, nature):
+ """
+ Return maximum of nature number's values to put on name
+ """
+
+ XMLZonesNodes = self.__XMLBoundaryConditionsNode.xmlGetChildNodeList('boundary', 'label', 'name', 'nature')
+ max = 0
+ #
+ # XML file reading
+ zones = []
+ for node in XMLZonesNodes:
+ if node['nature'] == nature:
+ max = max + 1
+ return max
+
+
+
+ def setLabel(self, label, newLabel):
+ """
+ Define a new label for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ LocalizationModel.renameLabel(self, label, newLabel)
+ #
+ # XML file updating
+ node = self.__XMLBoundaryConditionsNode.xmlGetChildNode('boundary', 'name', 'nature', label = label )
+ node['label'] = newLabel
+ nature = node['nature']
+ #
+ # Update references
+ XMLZonesNodes = self.__XMLBoundaryConditionsNode.xmlGetChildNodeList(nature, label = label)
+ for node in XMLZonesNodes:
+ node['label'] = newLabel
+
+
+ def setLocalization(self, label, localization):
+ """
+ Define a new localization for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ LocalizationModel.setLocalization(self, label, localization)
+ #
+ # XML file updating
+ node = self.__XMLBoundaryConditionsNode.xmlGetChildNode('boundary', 'name', 'nature', label = label)
+ node.xmlSetTextNode(localization)
+
+
+ def setCodeNumber(self, label, codeNumber):
+ """
+ Define a new code number for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ LocalizationModel.setCodeNumber(self, label, codeNumber)
+ #
+ # XML file updating
+ node = self.__XMLBoundaryConditionsNode.xmlGetChildNode('boundary', 'name', 'nature', label = label)
+ node['name'] = str(codeNumber)
+
+
+ def setNature(self, label, nature):
+ """
+ Define a new Nature for the current zone (zone.getLabel == label)
+ Update XML file
+ """
+ LocalizationModel.setNature(self, label, nature)
+
+ # XML file updating
+ node = self.__XMLBoundaryConditionsNode.xmlGetChildNode('boundary', 'name', 'nature', label = label)
+ oldNature = node['nature']
+ node['nature'] = str(nature)
+
+ # Delete oldNature boundary
+ Boundary(oldNature, label, self._case).delete()
+
+ # Create nature boundary
+ Boundary(nature, label, self._case)
+
+
+ def addZone(self, zone = None):
+ """
+ Add a new zone in the XML file
+ """
+ newZone = LocalizationModel.addZone(self, zone)
+
+ # XML file updating
+ node = self.__XMLBoundaryConditionsNode.xmlInitNode('boundary',
+ label = newZone.getLabel(),
+ name = str(newZone.getCodeNumber()),
+ nature = newZone.getNature())
+ node.xmlSetTextNode(newZone.getLocalization())
+
+ # Create nature boundary
+ Boundary(newZone.getNature(), newZone.getLabel(), self._case)
+
+ return newZone
+
+
+ def replaceZone(self, old_zone, new_zone):
+ """
+ Replace a zone by another in the XML file
+ """
+ Boundary(old_zone.getNature(), old_zone.getLabel(), self._case).delete()
+ newLabel, newCodeNumber, newLocal = LocalizationModel.replaceZone(self, old_zone, new_zone)
+
+ newNature = new_zone.getNature()
+ Model().isInList(newNature, self.__natureList)
+
+ node = self.__XMLBoundaryConditionsNode.xmlGetNode('boundary',
+ label = old_zone.getLabel())
+
+ node['label'] = newLabel
+ node['name'] = newCodeNumber
+ node['nature'] = newNature
+ node.xmlSetTextNode(newLocal)
+
+ Boundary(new_zone.getNature(), new_zone.getLabel(), self._case)
+
+
+ def deleteZone(self, label):
+ """
+ Delete a zone in the XML file
+ """
+ LocalizationModel.deleteZone(self, label)
+
+ # Get Nature
+ node = self.__XMLBoundaryConditionsNode.xmlGetNode('boundary', 'name', 'nature', label = label)
+ nature = node['nature']
+ node.xmlRemoveNode()
+
+ # Delete nature boundary
+ Boundary(nature, label, self._case).delete()
+
+#-------------------------------------------------------------------------------
+# LocalizationModel test case for volumic zones
+#-------------------------------------------------------------------------------
+
+class LocalizationVolumicTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkLocalizationInstantiation(self):
+ """Check whether the LocalizationModel class could be instantiated."""
+ model = None
+ model = LocalizationModel("VolumicZone", self.case)
+ assert model != None, 'Could not instantiate LocalizationVolumicModel'
+
+
+ def checkInitialZone(self):
+ """Check whether the zone could be initialized"""
+ model = LocalizationModel("VolumicZone", self.case)
+ node = self.case.xmlGetNode('volumic_conditions')
+
+ doc = '''<volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" thermal_source_term="off">
+ all[]
+ </zone>
+ </volumic_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not initialize default volumic zone'
+
+
+ def checkAddAndDeleteZone(self):
+ """Check whether the zone could be added and deleted"""
+ model = LocalizationModel("VolumicZone", self.case)
+ node = self.case.xmlGetNode('volumic_conditions')
+ model.addZone()
+ zone = Zone("VolumicZone", label='toto', localization="1 or door")
+ model.addZone(zone)
+ zone = Zone("VolumicZone", label='fenetre', localization="12 and window or door")
+ model.addZone(zone)
+ model.addZone()
+
+ doc = '''<volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" thermal_source_term="off">
+ all[]
+ </zone>
+ <zone head_losses="off" initialization="on" label="Zone_1" mass_source_term="off" momentum_source_term="off" name="2" thermal_source_term="off">
+ not(all[])
+ </zone>
+ <zone head_losses="off" initialization="on" label="toto" mass_source_term="off" momentum_source_term="off" name="3" thermal_source_term="off">
+ 1 or door
+ </zone>
+ <zone head_losses="off" initialization="on" label="fenetre" mass_source_term="off" momentum_source_term="off" name="4" thermal_source_term="off">
+ 12 and window or door
+ </zone>
+ <zone head_losses="off" initialization="on" label="Zone_2" mass_source_term="off" momentum_source_term="off" name="5" thermal_source_term="off">
+ not(all[];not(all[]);1 or door;12 and window or door)
+ </zone>
+ </volumic_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not add one volumic zone'
+
+ model.deleteZone(label="toto")
+ model.deleteZone(label="Zone_2")
+
+ doc = '''<volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" thermal_source_term="off">
+ all[]
+ </zone>
+ <zone head_losses="off" initialization="on" label="Zone_1" mass_source_term="off" momentum_source_term="off" name="2" thermal_source_term="off">
+ not(all[])
+ </zone>
+ <zone head_losses="off" initialization="on" label="fenetre" mass_source_term="off" momentum_source_term="off" name="4" thermal_source_term="off">
+ 12 and window or door
+ </zone>
+ </volumic_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not delete one volumic zone'
+
+
+ def checkReplaceZone(self):
+ """Check whether the zone could be replaced"""
+ model = LocalizationModel("VolumicZone", self.case)
+ node = self.case.xmlGetNode('volumic_conditions')
+ model.addZone()
+ zone = Zone("VolumicZone", label='toto', localization="1 or door")
+ model.addZone(zone)
+ zone1 = Zone("VolumicZone", label='fenetre', localization="12 and window or door")
+ model.addZone(zone1)
+ new_zone = Zone("VolumicZone", label='window', localization="12 or window or door")
+## new_zone = Zone("VolumicZone", localization="12 or window or door")
+## new_zone = Zone("VolumicZone", label='window')
+
+ model.replaceZone(zone1, new_zone)
+
+ doc = '''<volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" thermal_source_term="off">
+ all[]
+ </zone>
+ <zone head_losses="off" initialization="on" label="Zone_1" mass_source_term="off" momentum_source_term="off" name="2" thermal_source_term="off">
+ not(all[])
+ </zone>
+ <zone head_losses="off" initialization="on" label="toto" mass_source_term="off" momentum_source_term="off" name="3" thermal_source_term="off">
+ 1 or door
+ </zone>
+ <zone head_losses="off" initialization="on" label="window" mass_source_term="off" momentum_source_term="off" name="4" thermal_source_term="off">
+ 12 or window or door
+ </zone>
+ </volumic_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not replace volumic zone'
+
+
+ def checkSetLabelAndLocalization(self):
+ """Check whether the zone could be set label ,and localization"""
+ model = LocalizationModel("VolumicZone", self.case)
+ node = self.case.xmlGetNode('volumic_conditions')
+ model.addZone()
+ zone = Zone("VolumicZone", label='toto', localization="1 or door")
+ model.addZone(zone)
+ zone = Zone("VolumicZone", label='fenetre', localization="12 and window or door")
+ model.addZone(zone)
+
+ model.setLocalization("Zone_1", "1 and 2 and 3 or group1")
+ doc = '''<volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" thermal_source_term="off">
+ all[]
+ </zone>
+ <zone head_losses="off" initialization="on" label="Zone_1" mass_source_term="off" momentum_source_term="off" name="2" thermal_source_term="off">
+ 1 and 2 and 3 or group1
+ </zone>
+ <zone head_losses="off" initialization="on" label="toto" mass_source_term="off" momentum_source_term="off" name="3" thermal_source_term="off">
+ 1 or door
+ </zone>
+ <zone head_losses="off" initialization="on" label="fenetre" mass_source_term="off" momentum_source_term="off" name="4" thermal_source_term="off">
+ 12 and window or door
+ </zone>
+ </volumic_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set localization on volumic zone'
+
+
+ def checkSetAndGetNature(self):
+ """Check whether the zone could be set and get nature"""
+ model = LocalizationModel("VolumicZone", self.case)
+ node = self.case.xmlGetNode('volumic_conditions')
+ model.addZone()
+ zone = Zone("VolumicZone", label='porte', localization="1 or door")
+ model.addZone(zone)
+ zone = Zone("VolumicZone", label='fenetre', localization="12 and window or door")
+ model.addZone(zone)
+
+ model.setNature('porte', "head_losses,thermal_source_term")
+
+ doc = '''<volumic_conditions>
+ <zone head_losses="off" initialization="on" label="all_cells" mass_source_term="off" momentum_source_term="off" name="1" thermal_source_term="off">
+ all[]
+ </zone>
+ <zone head_losses="off" initialization="on" label="Zone_1" mass_source_term="off" momentum_source_term="off" name="2" thermal_source_term="off">
+ not(all[])
+ </zone>
+ <zone head_losses="on" initialization="off" label="porte" mass_source_term="off" momentum_source_term="off" name="3" thermal_source_term="on">
+ 1 or door
+ </zone>
+ <zone head_losses="off" initialization="on" label="fenetre" mass_source_term="off" momentum_source_term="off" name="4" thermal_source_term="off">
+ 12 and window or door
+ </zone>
+ </volumic_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set nature on volumic zone'
+
+ assert model.getNature('fenetre') == "initialization",\
+ 'Could not get nature on volumic zone'
+
+ assert model.getNature('porte') == "thermal_source_term,head_losses",\
+ 'Could not get nature on volumic zone'
+
+
+def suite1():
+ testSuite = unittest.makeSuite(LocalizationVolumicTestCase, "check")
+ return testSuite
+
+
+def runTest1():
+ print __file__
+ runner = unittest.TextTestRunner()
+ runner.run(suite1())
+
+#-------------------------------------------------------------------------------
+# LocalizationModel test case for boundaries conditions
+#-------------------------------------------------------------------------------
+
+class LocalizationSurfacicTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkLocalizationSurfacicInstantiation(self):
+ """
+ Check whether the LocalizationModel class could be instantiated
+ for boundary conditions.
+ """
+ model = None
+ model = LocalizationModel("BoundaryZone", self.case)
+ assert model != None, 'Could not instantiate LocalizationSurfacicModel'
+
+
+ def checkAddAndDeleteZone(self):
+ """Check whether the zone could be added and deleted for boundary conditions."""
+ model = LocalizationModel("BoundaryZone", self.case)
+ node = self.case.xmlGetNode('boundary_conditions')
+ zone1 = Zone("BoundaryZone", label='entre1', localization="porte", nature='inlet')
+ zone2 = Zone("BoundaryZone", label='entre2', localization="fenetre", nature='inlet')
+ zone3 = Zone("BoundaryZone", label='plafond', localization="not porte", nature='wall')
+ model.addZone(zone1)
+ model.addZone(zone2)
+ model.addZone(zone3)
+
+ doc = '''<boundary_conditions>
+ <boundary label="entre1" name="1" nature="inlet">
+ porte
+ </boundary>
+ <inlet label="entre1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ <boundary label="entre2" name="2" nature="inlet">
+ fenetre
+ </boundary>
+ <inlet label="entre2">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ <boundary label="plafond" name="3" nature="wall">
+ not porte
+ </boundary>
+ <wall label="plafond">
+ <velocity_pressure choice="off"/>
+ </wall>
+ </boundary_conditions>'''
+
+ model.deleteZone("entre2")
+
+ doc = '''<boundary_conditions>
+ <boundary label="entre1" name="1" nature="inlet">
+ porte
+ </boundary>
+ <inlet label="entre1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ <boundary label="plafond" name="3" nature="wall">
+ not porte
+ </boundary>
+ <wall label="plafond">
+ <velocity_pressure choice="off"/>
+ </wall>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not delete zone in localizationModel for boundaries conditions'
+
+
+ def checkReplaceZone(self):
+ """Check whether the zone could be replaced for boundary conditions."""
+ model = LocalizationModel("BoundaryZone", self.case)
+ node = self.case.xmlGetNode('boundary_conditions')
+ zone1 = Zone("BoundaryZone", label='entre1', localization="porte", nature='inlet')
+ zone2 = Zone("BoundaryZone", label='entre2', localization="fenetre", nature='inlet')
+ zone3 = Zone("BoundaryZone", label='plafond', localization="not porte", nature='wall')
+ model.addZone(zone1)
+ model.addZone(zone2)
+ model.addZone(zone3)
+ zone4 = Zone("BoundaryZone", label='hublot', localization="2 et 3", nature='symmetry')
+ model.replaceZone(zone2, zone4)
+
+ doc = '''<boundary_conditions>
+ <boundary label="entre1" name="1" nature="inlet">
+ porte
+ </boundary>
+ <inlet label="entre1">
+ <velocity_pressure choice="norm">
+ <norm>1</norm>
+ </velocity_pressure>
+ <turbulence choice="hydraulic_diameter">
+ <hydraulic_diameter>1</hydraulic_diameter>
+ </turbulence>
+ </inlet>
+ <boundary label="hublot" name="2" nature="symmetry">
+ 2 et 3
+ </boundary>
+ <boundary label="plafond" name="3" nature="wall">
+ not porte
+ </boundary>
+ <wall label="plafond">
+ <velocity_pressure choice="off"/>
+ </wall>
+ <symmetry label="hublot"/>
+ </boundary_conditions>'''
+
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not replace zone in localizationModel for boundaries conditions'
+
+
+def suite2():
+ testSuite = unittest.makeSuite(LocalizationSurfacicTestCase, "check")
+ return testSuite
+
+
+def runTest2():
+ print __file__
+ runner = unittest.TextTestRunner()
+ runner.run(suite2())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
+
diff --git a/gui/Pages/LocalizationView.py b/gui/Pages/LocalizationView.py
new file mode 100644
index 0000000..17dc4ef
--- /dev/null
+++ b/gui/Pages/LocalizationView.py
@@ -0,0 +1,881 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- LabelDelegate
+- CodeNumberDelegate
+- BoundaryNatureDelegate
+- StandardItemVolumeNature
+- FlagBox
+- VolumeNatureDelegate
+- LocalizationSelectorDelegate
+- StandardItemModelLocalization
+- LocalizationView
+- VolumeLocalizationView
+- BoundaryLocalizationView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from LocalizationForm import Ui_LocalizationForm
+from Base.Common import LABEL_LENGTH_MAX
+from Base.QtPage import IntValidator, RegExpValidator
+from Pages.PreProcessingInformationsView import Informations, preprocessorFile
+from Pages.LocalizationModel import LocalizationModel, Zone
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("LocalizationView")
+log.setLevel(logging.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for the label
+#-------------------------------------------------------------------------------
+
+class LabelDelegate(QItemDelegate):
+ """
+ Use of a QLineEdit in the table.
+ """
+ def __init__(self, parent, mdl):
+ super(LabelDelegate, self).__init__(parent)
+ self.parent = parent
+ self.mdl = mdl
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ self.regExp = QRegExp(rx)
+ v = RegExpValidator(editor, self.regExp)
+ editor.setValidator(v)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ v = index.model().data(index, Qt.DisplayRole).toString()
+ self.p_value = str(v)
+ editor.setText(v)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+
+ if editor.validator().state == QValidator.Acceptable:
+ p_value = str(editor.text())
+
+ if p_value in self.mdl.getLabelsZonesList():
+ default = {}
+ default['label'] = self.p_value
+ default['list'] = self.mdl.getLabelsZonesList()
+ default['regexp'] = self.regExp
+ log.debug("setModelData-> default = %s" % default)
+
+ from VerifyExistenceLabelDialogView import VerifyExistenceLabelDialogView
+ dialog = VerifyExistenceLabelDialogView(self.parent, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ p_value = result['label']
+ log.debug("setModelData-> result = %s" % result)
+ else:
+ p_value = self.p_value
+
+ model.setData(index, QVariant(QString(p_value)), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# QLineEdit delegate for the zone
+#-------------------------------------------------------------------------------
+
+class CodeNumberDelegate(QItemDelegate):
+ def __init__(self, parent, mdl):
+ super(CodeNumberDelegate, self).__init__(parent)
+ self.parent = parent
+ self.mdl = mdl
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = IntValidator(editor, min=0, max=999)
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ self.value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(self.value)
+
+
+ def setModelData(self, editor, model, index):
+ value, ok = editor.text().toInt()
+
+ # Check for unicity
+ if value != self.value and str(value) in self.mdl.getCodeNumbersList():
+ title = self.tr("Warning")
+ msg = self.tr("Zone number can be used only once.\n"\
+ "Please give another value.")
+ QMessageBox.warning(self.parent, title, msg)
+ return
+
+ if editor.validator().state == QValidator.Acceptable:
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# QComboBox delegate for the boundary nature
+#-------------------------------------------------------------------------------
+
+class BoundaryNatureDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent, dicoM2V):
+ super(BoundaryNatureDelegate, self).__init__(parent)
+ self.parent = parent
+ self.dicoM2V = dicoM2V
+
+ self.dicoV2M = {}
+ for k, v in self.dicoM2V.items():
+ self.dicoV2M[v] = k
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ for k in self.dicoV2M.keys():
+ editor.addItem(k)
+ editor.installEventFilter(self)
+ #editor.setSizeAdjustPolicy(QComboBox.AdjustToContents)
+ editor.setMinimumWidth(100)
+ return editor
+
+
+ def setEditorData(self, comboBox, index):
+ row = index.row()
+ col = index.column()
+ str_model = index.model().getData(row, col)
+ idx = self.dicoM2V.keys().index(str_model)
+ #str_view = self.dicoM2V[str_model]
+ #comboBox.setItem(str_view)
+ comboBox.setCurrentIndex(idx)
+
+
+ def setModelData(self, comboBox, model, index):
+ txt = str(comboBox.currentText())
+ value = self.dicoV2M[txt]
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+
+ def tr(self, text):
+ return text
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class for QComboBox in nature delegate (Volumic)
+#-------------------------------------------------------------------------------
+
+class StandardItemVolumeNature(QStandardItemModel):
+ """
+ QStandardItemModel associated with the QComboBox
+ in the delegate (validator) for the nature in the case of volumic zone.
+
+ Attr. natureList is a dictionnary between model string and view string.
+ Attr. dicoNature holds value 'on' or 'off' if the item is checked or not.
+ """
+
+ def __init__(self, dicoM2V, data):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ # Dictionary item to label for display
+ self.dicoM2V = dicoM2V
+ # Dictionary item to status (on/off)
+ self.dicoNature = data
+
+ #self.keys = self.natureList.keys() # ordered tuple
+ self.keys = Zone('VolumicZone').getNatureList()
+
+ self.setRowCount(len(self.dicoM2V.keys()))
+ self.setColumnCount(1)
+
+ row = 0
+ for key in self.keys:
+ self.setItem(row, QStandardItem(QString(str(self.dicoM2V[key]))))
+ row += 1
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.EditRole:
+ key = self.keys[index.row()]
+ return QVariant(self.dicoM2V[key])
+
+ elif role == Qt.DisplayRole:
+ key = self.keys[index.row()]
+ return QVariant(self.dicoM2V[key])
+
+ elif role == Qt.CheckStateRole:
+ key = self.keys[index.row()]
+ value = self.dicoNature[key]
+ if value == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ cpt = 0
+ disable_row = 0
+ for row in range(self.rowCount()):
+ if self.dicoNature[self.keys[row]] == "on":
+ disable_row = row
+ cpt += 1
+
+ #FIXME : delete the following line
+ return Qt.ItemIsSelectable
+ if cpt == 1 and index.row() == disable_row:
+ return Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+
+
+ def setData(self, index, value, role=None):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.EditRole:
+ pass
+
+ elif role == Qt.DisplayRole:
+ key = self.keys[index.row()]
+ self.dicoNature[key] = str(value)
+
+ elif role == Qt.CheckStateRole:
+ state, ok = value.toInt()
+ key = self.keys[index.row()]
+ if state == Qt.Unchecked:
+ self.dicoNature[key] = "off"
+ else:
+ self.dicoNature[key] = "on"
+
+ id1 = self.index(0, 0)
+ id2 = self.index(self.rowCount(), 0)
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), id1, id2)
+ return True
+
+
+ def getChecked(self):
+ s = []
+ for k, v in self.dicoNature.items():
+ if v == "on":
+ s.append(k)
+ return string.join(s, ";")
+
+#-------------------------------------------------------------------------------
+# FlagBox: new QComboBox to construct Delegate for the volume nature
+#-------------------------------------------------------------------------------
+
+class FlagBox(QComboBox):
+ def __init__(self, parent):
+ QComboBox.__init__(self, parent)
+
+ opt = QStyleOptionComboBox()
+ opt.initFrom(self)
+ opt.editable = self.isEditable()
+ if (self.style().styleHint(QStyle.SH_ComboBox_Popup, opt)):
+ self.setItemDelegate(QItemDelegate(self))
+
+ self.connect(self, SIGNAL("activated(int)"), self.slotActivated)
+
+
+ @pyqtSignature("int")
+ def slotActivated(self, index):
+ value = self.itemData(index, Qt.CheckStateRole)
+ state, ok = value.toInt()
+ if state == Qt.Unchecked:
+ s = Qt.Checked
+ else:
+ s = Qt.Unchecked
+ self.setItemData(index, QVariant(s), Qt.CheckStateRole)
+
+
+ def hidePopup(self):
+ pass
+
+#-------------------------------------------------------------------------------
+# Delegate for the volume nature
+#-------------------------------------------------------------------------------
+
+class VolumeNatureDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent):
+ super(VolumeNatureDelegate, self).__init__(parent)
+
+
+ def createEditor(self, parent, option, index):
+ editor = FlagBox(parent)
+ editor.setEditable(False)
+ #editor.setSizeAdjustPolicy(QComboBox.AdjustToContents)
+ editor.setMinimumWidth(160)
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ data = index.model().getData(index.row(), index.column())
+ dicoM2V = index.model().dicoM2V
+
+ self.flagbox_model = StandardItemVolumeNature(dicoM2V, data)
+ editor.setModel(self.flagbox_model)
+
+
+ def setModelData(self, editor, model, index):
+ value = self.flagbox_model.getChecked()
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# QLineEdit delegate for localization
+#-------------------------------------------------------------------------------
+
+class LocalizationSelectorDelegate(QItemDelegate):
+ def __init__(self, parent, mdl):
+ super(LocalizationSelectorDelegate, self).__init__(parent)
+ self.parent = parent
+ self.mdl = mdl
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ self.value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(self.value)
+
+
+ def setModelData(self, editor, model, index):
+ value = editor.text()
+
+# if str(value) == "" :
+# title = self.tr("Warning")
+# msg = self.tr("Please give a localization")
+# QMessageBox.information(self.parent, title, msg)
+# return
+
+ if value != self.value and str(value) in self.mdl.getLocalizationsZonesList():
+ title = self.tr("Warning")
+ msg = self.tr("This localization is already used.\n"\
+ "Please give another one.")
+ QMessageBox.information(self.parent, title, msg)
+ return
+
+ if str(value) != "" :
+ model.setData(index, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelLocalization(QStandardItemModel):
+ def __init__(self, mdl, zoneType, dicoM2V):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.headers = [self.tr("Label"),
+ self.tr("Zone"),
+ self.tr("Nature"),
+ self.tr("Selection criteria")]
+ self.setColumnCount(len(self.headers))
+
+ self.mdl = mdl
+ self.zoneType = zoneType
+ self.dicoM2V = dicoM2V
+
+ self._data = []
+ self._disable = []
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.DisplayRole:
+ row = index.row()
+ col = index.column()
+
+ if col in [0, 1, 3]:
+ return QVariant(self._data[row][col])
+
+ elif col == 2:
+ if self.zoneType == "VolumicZone":
+ data = self._data[row][col]
+ item = string.join([self.dicoM2V[key] for key in self.dicoM2V.keys() if data[key] == "on"], "\n")
+# item = ""
+# for key in dico.keys():
+# print key
+# if dico[key] == "on":
+# item += key + "\n"
+ return QVariant(item)
+
+ elif self.zoneType == "BoundaryZone":
+ key = self._data[row][col]
+ return QVariant(self.dicoM2V[key])
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if (index.row(), index.column()) in self._disable:
+ return Qt.ItemIsSelectable
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+ col = index.column()
+
+ [old_label, old_code, old_nature, old_local] = self._data[row]
+
+ old_zone = Zone(self.zoneType,
+ label = old_label,
+ codeNumber = old_code,
+ localization = old_local,
+ nature = old_nature)
+
+ new_label = old_label
+ new_code = old_code
+ new_nature = old_nature
+ new_local = old_local
+
+ if col == 0:
+ new_label = str(value.toString())
+ self._data[row][col] = new_label
+
+ elif col == 1:
+ new_code, ok = value.toInt()
+ self._data[row][col] = new_code
+
+ elif col == 2:
+
+ if self.zoneType == "VolumicZone":
+
+ # We modify the dictionary here
+ nature_list = string.split(str(value.toString()), ";")
+
+ for key in self._data[row][col].keys():
+ if key in nature_list:
+ self._data[row][col][key] = "on"
+ else:
+ self._data[row][col][key] = "off"
+
+ new_nature = self._data[row][col].copy()
+
+ elif self.zoneType == "BoundaryZone":
+
+ new_nature = str(value.toString())
+ self._data[row][col] = new_nature
+
+ elif col == 3:
+ new_local = str(value.toString())
+ self._data[row][col] = new_local
+
+ new_zone = Zone(self.zoneType,
+ label = new_label,
+ codeNumber = new_code,
+ localization = new_local,
+ nature = new_nature)
+
+ self.mdl.replaceZone(old_zone, new_zone)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self, zone=None):
+ """
+ Add an element in the table view.
+ """
+ if not zone:
+ zone = self.mdl.addZone(Zone(self.zoneType))
+
+ line = [zone.getLabel(),
+ zone.getCodeNumber(),
+ zone.getNature(),
+ zone.getLocalization()]
+ self._data.append(line)
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+ # Warning: the Volume region 'all_cells' is mandatory, and can not be modified.
+ if self.zoneType == "VolumicZone" and zone.getLabel() == "all_cells":
+ for c in range(self.columnCount()):
+ self._disable.append((row, c))
+
+
+ def getItem(self, row):
+ return self._data[row]
+
+
+ def deleteItem(self, irow):
+ del self._data[irow]
+ nb_rows = self.rowCount()
+ self.setRowCount(nb_rows-1)
+
+
+ def getData(self, row, column):
+ return self._data[row][column]
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class LocalizationView(QWidget, Ui_LocalizationForm):
+ """
+ Main class
+ """
+ def __init__(self, zoneType, parent, case, dicoM2V):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_LocalizationForm.__init__(self)
+ self.setupUi(self)
+
+ self.zoneType = zoneType
+ self.mdl = LocalizationModel(zoneType, case)
+
+ # Model for table View
+ self.modelLocalization = StandardItemModelLocalization(self.mdl, zoneType, dicoM2V)
+ self.tableView.setModel(self.modelLocalization)
+
+ # Delegates
+ delegateLabel = LabelDelegate(self.tableView, self.mdl)
+ delegateCode = CodeNumberDelegate(self.tableView, self.mdl)
+ delegateLocal = LocalizationSelectorDelegate(self.tableView, self.mdl)
+
+ self.tableView.setItemDelegateForColumn(0, delegateLabel)
+ self.tableView.setItemDelegateForColumn(1, delegateCode)
+ self.tableView.setItemDelegateForColumn(3, delegateLocal)
+
+ # Populate QTableView model
+ for zone in self.mdl.getZones():
+ self.modelLocalization.addItem(zone)
+
+ self.tableView.verticalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ self.tableView.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ #col = self.tableView.model().rowCount() -1
+ self.tableView.horizontalHeader().setResizeMode(3, QHeaderView.Stretch)
+
+ # Connections
+ self.connect(self.pushButtonNew, SIGNAL("clicked()"), self.slotAddZone)
+ self.connect(self.pushButtonDelete, SIGNAL("clicked()"), self.slotDeleteZone)
+ self.connect(self.toolButtonCreation, SIGNAL("clicked()"), self.slotAddFromPrePro)
+ self.connect(self.modelLocalization, SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), self.dataChanged)
+
+ self.pushButtonSalome.hide()
+ if case['salome']:
+ self.pushButtonSalome.show()
+ self.connect(self.pushButtonSalome, SIGNAL("clicked()"), self.slotAddFromSalome)
+
+ # Context menu
+ self.tableView.setContextMenuPolicy(Qt.CustomContextMenu)
+ self.connect(self.tableView, SIGNAL("customContextMenuRequested(QPoint)"), self.slotContextMenu)
+
+
+ @pyqtSignature("")
+ def slotAddZone(self):
+ """
+ Insert a new item in the table view.
+ """
+ self.modelLocalization.addItem()
+
+
+ @pyqtSignature("")
+ def slotDeleteZone(self):
+ """
+ Private Slot.
+ Warning: the Volume region 'all_cells' is mandatory, therefore it can not be deleted.
+ """
+ list = []
+ for index in self.tableView.selectionModel().selectedRows():
+ row = index.row()
+ list.append(row)
+
+ list.sort()
+ list.reverse()
+
+ for row in list:
+ [label, codeNumber, nature, localization] = self.modelLocalization.getItem(row)
+ if not (label == "all_cells" and self.zoneType == 'VolumicZone'):
+ self.mdl.deleteZone(label)
+ self.modelLocalization.deleteItem(row)
+
+
+ @pyqtSignature("")
+ def slotAddFromPrePro(self):
+ """
+ Research a Preprocessor listing to pick colors or groups of cells or faces.
+ """
+ if self.zoneType == 'VolumicZone':
+ entity = 'cells'
+ elif self.zoneType == 'BoundaryZone':
+ entity = 'faces'
+
+ file_name = preprocessorFile(self, self.case['resu_path'])
+
+ if file_name:
+ for loc in Informations(file_name, entity).getLocalizations():
+ if loc not in self.mdl.getLocalizationsZonesList():
+ zone = Zone(self.zoneType, localization = loc)
+ self.mdl.addZone(zone)
+ self.modelLocalization.addItem(zone)
+
+
+ @pyqtSignature("")
+ def slotContextMenu(self):
+ """
+ Public slot
+
+ Create the popup menu of the Browser
+ """
+ fileMenu = QMenu(self.tableView)
+
+ actionMerge = QAction(self.tr("Merge selected zones"), self.tableView)
+ self.connect(actionMerge, SIGNAL("triggered()"), self.slotMerge)
+ fileMenu.addAction(actionMerge)
+
+ if self.zoneType == 'BoundaryZone':
+ fileMenu.addSeparator()
+
+ self.actionInlet = QAction(self.tr("Select all inlets"), self.tableView)
+ self.connect(self.actionInlet, SIGNAL("triggered()"), self.slotSelectBoudaries)
+ fileMenu.addAction(self.actionInlet)
+
+ self.actionOutlet = QAction(self.tr("Select all outlets"), self.tableView)
+ self.connect(self.actionOutlet, SIGNAL("triggered()"), self.slotSelectBoudaries)
+ fileMenu.addAction(self.actionOutlet)
+
+ self.actionWall = QAction(self.tr("Select all walls"), self.tableView)
+ self.connect(self.actionWall, SIGNAL("triggered()"), self.slotSelectBoudaries)
+ fileMenu.addAction(self.actionWall)
+
+ self.actionSymmetry = QAction(self.tr("Select all symmeties"), self.tableView)
+ self.connect(self.actionSymmetry, SIGNAL("triggered()"), self.slotSelectBoudaries)
+ fileMenu.addAction(self.actionSymmetry)
+
+ fileMenu.popup(QCursor().pos())
+ fileMenu.show()
+
+
+ @pyqtSignature("")
+ def slotMerge(self):
+ """
+ public slot
+ """
+ list = []
+ for index in self.tableView.selectionModel().selectedRows():
+ list.append(index.row())
+
+ row = list.pop(0)
+ [label, code, nature, new_localization] = self.modelLocalization.getItem(row)
+
+ new_zone = Zone(self.zoneType,
+ label = label,
+ codeNumber = code,
+ localization = new_localization,
+ nature = nature)
+
+ for row in list:
+ [label, code, nature, localization] = self.modelLocalization.getItem(row)
+ if "all[]" not in string.split(new_localization, " "):
+ new_localization += " or " + localization
+ if localization == "all[]":
+ new_localization = "all[]"
+
+ new_zone.setLocalization(new_localization)
+ self.slotDeleteZone()
+ self.mdl.addZone(new_zone)
+ self.modelLocalization.addItem(new_zone)
+
+
+ @pyqtSignature("")
+ def slotAddFromSalome(self):
+ """
+ When GUI is embeded in the Salome desktop. Add selection criteria from
+ graphical selection in the VTK viwver, or in the ObjectBrowser.
+ """
+ if self.case['salome']:
+ from SalomeHandler import BoundaryGroup, VolumeGroup
+
+ log.debug("slotAddFromSalome: zoneType -> %s" % self.zoneType)
+ if self.zoneType == 'VolumicZone':
+ loc = VolumeGroup()
+ elif self.zoneType == 'BoundaryZone':
+ loc = BoundaryGroup()
+
+ log.debug("slotAddFromSalome: selection criteria -> %s" % loc)
+ if loc not in self.mdl.getLocalizationsZonesList():
+ zone = Zone(self.zoneType, localization = loc)
+ self.mdl.addZone(zone)
+ self.modelLocalization.addItem(zone)
+
+
+ @pyqtSignature("const QModelIndex &, const QModelIndex &")
+ def dataChanged(self, topLeft, bottomRight):
+ for row in range(topLeft.row(), bottomRight.row()+1):
+ self.tableView.resizeRowToContents(row)
+ for col in range(topLeft.column(), bottomRight.column()+1):
+ self.tableView.resizeColumnToContents(col)
+
+
+ def tr(self, text):
+ """
+ Translation.
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Define Volumic regions class
+#-------------------------------------------------------------------------------
+
+class VolumeLocalizationView(LocalizationView):
+ """
+ Define volume regions class.
+ """
+ def __init__(self, parent=None, case=None):
+ """
+ Constructor.
+ """
+ self.case = case
+ dicoM2V = Zone("VolumicZone").getModel2ViewDictionary()
+
+ LocalizationView.__init__(self, "VolumicZone", parent, self.case, dicoM2V)
+
+ title = self.tr("Definition of volume regions")
+ self.groupBoxLocalization.setTitle(title)
+
+ # Delegates
+ delegateNature = VolumeNatureDelegate(self.tableView)
+ self.tableView.setItemDelegateForColumn(2, delegateNature)
+
+#-------------------------------------------------------------------------------
+# Define Boundary regions class
+#-------------------------------------------------------------------------------
+
+class BoundaryLocalizationView(LocalizationView):
+ """
+ Define boundary regions class.
+ """
+ def __init__(self, parent=None, case=None):
+ """
+ Constructor.
+ """
+ self.case = case
+ dicoM2V = Zone("BoundaryZone").getModel2ViewDictionary()
+
+ LocalizationView.__init__(self, "BoundaryZone", parent, self.case, dicoM2V)
+
+ title = self.tr("Definition of boundary regions")
+ self.groupBoxLocalization.setTitle(title)
+
+ # Delegates
+ delegateNature = BoundaryNatureDelegate(self.tableView, dicoM2V)
+ self.tableView.setItemDelegateForColumn(2, delegateNature)
+
+
+ @pyqtSignature("")
+ def slotSelectBoudaries(self):
+ """
+ Public slot.
+
+ Warning: works only if the selection mode of the view is set to MultiSelection.
+ """
+ previous_selecion_mode = self.tableView.selectionMode()
+ self.tableView.setSelectionMode(QAbstractItemView.MultiSelection)
+ self.tableView.clearSelection()
+
+ if self.sender() == self.actionInlet:
+ select = "inlet"
+ elif self.sender() == self.actionOutlet:
+ select = "outlet"
+ elif self.sender() == self.actionWall:
+ select = "wall"
+ elif self.sender() == self.actionSymmetry:
+ select = "symmetry"
+
+ for row in range(self.modelLocalization.rowCount()):
+ [label, code, nature, localization] = self.modelLocalization.getItem(row)
+ if nature == select:
+ self.tableView.selectRow(row)
+
+ self.tableView.setSelectionMode(previous_selecion_mode)
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/Makefile.am b/gui/Pages/Makefile.am
new file mode 100644
index 0000000..ed34dad
--- /dev/null
+++ b/gui/Pages/Makefile.am
@@ -0,0 +1,212 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+all-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --build $(srcdir)
+
+clean-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --clean $(srcdir)
+
+# Install Python library
+
+pagesdir = $(pkgpythondir)/Pages
+pages_PYTHON = \
+__init__.py \
+resources_pages_rc.py \
+AnalysisFeaturesForm.py \
+AnalysisFeaturesView.py \
+AtmosphericFlowsForm.py \
+AtmosphericFlowsModel.py \
+AtmosphericFlowsView.py \
+BatchRunningAdvancedOptionsDialogForm.py \
+BatchRunningForm.py \
+BatchRunningModel.py \
+BatchRunningPBSJobManagementDialogForm.py \
+BatchRunningUserFilesDialogForm.py \
+BatchRunningView.py \
+BodyForcesForm.py \
+BodyForcesModel.py \
+BodyForcesView.py \
+BoundaryConditionsCoalInletForm.py \
+BoundaryConditionsCoalInletView.py \
+BoundaryConditionsForm.py \
+BoundaryConditionsMeteoForm.py \
+BoundaryConditionsMeteoView.py \
+BoundaryConditionsMobileMeshForm.py \
+BoundaryConditionsMobileMeshView.py \
+BoundaryConditionsParticlesModel.py \
+BoundaryConditionsParticlesView.py \
+BoundaryConditionsRoughWallForm.py \
+BoundaryConditionsRoughWallView.py \
+BoundaryConditionsScalarsForm.py \
+BoundaryConditionsScalarsView.py \
+BoundaryConditionsSlidingWallForm.py \
+BoundaryConditionsSlidingWallView.py \
+BoundaryConditionsTurbulenceInletForm.py \
+BoundaryConditionsTurbulenceInletView.py \
+BoundaryConditionsVelocityInletForm.py \
+BoundaryConditionsVelocityInletView.py \
+BoundaryConditionsWallRadiativeTransferForm.py \
+BoundaryConditionsWallRadiativeTransferView.py \
+BoundaryConditionsView.py \
+Boundary.py \
+CoalCombustionForm.py \
+CoalCombustionModel.py \
+CoalCombustionView.py \
+CoalThermoChemistry.py \
+CommonCombustion.py \
+CurrentSpeciesForm.py \
+CurrentSpeciesModel.py \
+CurrentSpeciesView.py \
+DefineUserScalarsForm.py \
+DefineUserScalarsModel.py \
+DefineUserScalarsView.py \
+ElectricalModelsModel.py \
+FacesSelectionForm.py \
+FacesSelectionView.py \
+FluidCharacteristicsForm.py \
+FluidCharacteristicsModel.py \
+FluidCharacteristicsView.py \
+FluidStructureInteractionAdvancedOptionsDialogForm.py \
+FluidStructureInteractionForm.py \
+FluidStructureInteractionModel.py \
+FluidStructureInteractionView.py \
+GasCombustionModel.py \
+HeadLossesForm.py \
+HeadLossesModel.py \
+HeadLossesView.py \
+IdentityAndPathesForm.py \
+IdentityAndPathesModel.py \
+IdentityAndPathesView.py \
+InitializationForm.py \
+InitializationModel.py \
+InitializationView.py \
+LagrangianAdvancedOptionsDialogForm.py \
+LagrangianBoundariesForm.py \
+LagrangianBoundariesModel.py \
+LagrangianBoundariesView.py \
+LagrangianForm.py \
+LagrangianModel.py \
+LagrangianOutputForm.py \
+LagrangianOutputModel.py \
+LagrangianOutputView.py \
+LagrangianStatisticsForm.py \
+LagrangianStatisticsModel.py \
+LagrangianStatisticsView.py \
+LagrangianView.py \
+LocalizationForm.py \
+LocalizationModel.py \
+LocalizationView.py \
+MatisseCustomForm.py \
+MatisseCustomView.py \
+MatisseGeomForm.py \
+MatisseGeomModel.py \
+MatisseGeomView.py \
+MatisseHydrauForm.py \
+MatisseHydrauModel.py \
+MatisseHydrauView.py \
+MatisseModel.py \
+MatisseNetworkForm.py \
+MatisseNetworkModel.py \
+MatisseNetworkView.py \
+MatisseRangeDescriptionForm.py \
+MatisseRangeDescriptionModel.py \
+MatisseRangeDescriptionView.py \
+MatisseThermicForm.py \
+MatisseThermicModel.py \
+MatisseThermicView.py \
+MatisseTypeForm.py \
+MatisseTypeModel.py \
+MatisseTypeView.py \
+MemoryAllocationForm.py \
+MemoryAllocationModel.py \
+MemoryAllocationView.py \
+MeshQualityCriteriaLogDialogForm.py \
+MobileMeshForm.py \
+MobileMeshModel.py \
+MobileMeshView.py \
+NumericalParamEquationForm.py \
+NumericalParamEquationModel.py \
+NumericalParamEquationView.py \
+NumericalParamGlobalForm.py \
+NumericalParamGlobalModel.py \
+NumericalParamGlobalView.py \
+OutputControlForm.py \
+OutputControlModel.py \
+OutputControlView.py \
+OutputSurfacicVariablesForm.py \
+OutputSurfacicVariablesModel.py \
+OutputSurfacicVariablesView.py \
+OutputVolumicVariablesForm.py \
+OutputVolumicVariablesModel.py \
+OutputVolumicVariablesView.py \
+PreProcessingInformationsView.py \
+ProfilesForm.py \
+ProfilesModel.py \
+ProfilesView.py \
+QMeiEditorForm.py \
+QMeiEditorView.py \
+ReferenceValuesForm.py \
+ReferenceValuesModel.py \
+ReferenceValuesView.py \
+SalomeHandler.py \
+SolutionDomainForm.py \
+SolutionDomainMeshFormatDialogForm.py \
+SolutionDomainModel.py \
+SolutionDomainView.py \
+SolutionVerifForm.py \
+SolutionVerifView.py \
+StartRestartAdvancedDialogForm.py \
+StartRestartForm.py \
+StartRestartModel.py \
+StartRestartView.py \
+SteadyManagementForm.py \
+SteadyManagementModel.py \
+SteadyManagementView.py \
+SyrthesForm.py \
+SyrthesView.py \
+ThermalRadiationAdvancedDialogForm.py \
+ThermalRadiationForm.py \
+ThermalRadiationModel.py \
+ThermalRadiationView.py \
+ThermalScalarForm.py \
+ThermalScalarModel.py \
+ThermalScalarView.py \
+TimeAveragesForm.py \
+TimeAveragesModel.py \
+TimeAveragesView.py \
+TimeStepForm.py \
+TimeStepModel.py \
+TimeStepView.py \
+TurbulenceAdvancedOptionsDialogForm.py \
+TurbulenceForm.py \
+TurbulenceModel.py \
+TurbulenceView.py \
+UserArraysForm.py \
+UserArraysModel.py \
+UserArraysView.py \
+UserScalarPropertiesForm.py \
+UserScalarPropertiesView.py \
+VerifyExistenceLabelDialogForm.py \
+VerifyExistenceLabelDialogView.py \
+WelcomeForm.py \
+WelcomeView.py
diff --git a/gui/Pages/Makefile.in b/gui/Pages/Makefile.in
new file mode 100644
index 0000000..f91d224
--- /dev/null
+++ b/gui/Pages/Makefile.in
@@ -0,0 +1,673 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = gui/Pages
+DIST_COMMON = $(pages_PYTHON) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pagesdir)"
+pagesPYTHON_INSTALL = $(INSTALL_DATA)
+py_compile = $(top_srcdir)/config/py-compile
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Install Python library
+pagesdir = $(pkgpythondir)/Pages
+pages_PYTHON = \
+__init__.py \
+resources_pages_rc.py \
+AnalysisFeaturesForm.py \
+AnalysisFeaturesView.py \
+AtmosphericFlowsForm.py \
+AtmosphericFlowsModel.py \
+AtmosphericFlowsView.py \
+BatchRunningAdvancedOptionsDialogForm.py \
+BatchRunningForm.py \
+BatchRunningModel.py \
+BatchRunningPBSJobManagementDialogForm.py \
+BatchRunningUserFilesDialogForm.py \
+BatchRunningView.py \
+BodyForcesForm.py \
+BodyForcesModel.py \
+BodyForcesView.py \
+BoundaryConditionsCoalInletForm.py \
+BoundaryConditionsCoalInletView.py \
+BoundaryConditionsForm.py \
+BoundaryConditionsMeteoForm.py \
+BoundaryConditionsMeteoView.py \
+BoundaryConditionsMobileMeshForm.py \
+BoundaryConditionsMobileMeshView.py \
+BoundaryConditionsParticlesModel.py \
+BoundaryConditionsParticlesView.py \
+BoundaryConditionsRoughWallForm.py \
+BoundaryConditionsRoughWallView.py \
+BoundaryConditionsScalarsForm.py \
+BoundaryConditionsScalarsView.py \
+BoundaryConditionsSlidingWallForm.py \
+BoundaryConditionsSlidingWallView.py \
+BoundaryConditionsTurbulenceInletForm.py \
+BoundaryConditionsTurbulenceInletView.py \
+BoundaryConditionsVelocityInletForm.py \
+BoundaryConditionsVelocityInletView.py \
+BoundaryConditionsWallRadiativeTransferForm.py \
+BoundaryConditionsWallRadiativeTransferView.py \
+BoundaryConditionsView.py \
+Boundary.py \
+CoalCombustionForm.py \
+CoalCombustionModel.py \
+CoalCombustionView.py \
+CoalThermoChemistry.py \
+CommonCombustion.py \
+CurrentSpeciesForm.py \
+CurrentSpeciesModel.py \
+CurrentSpeciesView.py \
+DefineUserScalarsForm.py \
+DefineUserScalarsModel.py \
+DefineUserScalarsView.py \
+ElectricalModelsModel.py \
+FacesSelectionForm.py \
+FacesSelectionView.py \
+FluidCharacteristicsForm.py \
+FluidCharacteristicsModel.py \
+FluidCharacteristicsView.py \
+FluidStructureInteractionAdvancedOptionsDialogForm.py \
+FluidStructureInteractionForm.py \
+FluidStructureInteractionModel.py \
+FluidStructureInteractionView.py \
+GasCombustionModel.py \
+HeadLossesForm.py \
+HeadLossesModel.py \
+HeadLossesView.py \
+IdentityAndPathesForm.py \
+IdentityAndPathesModel.py \
+IdentityAndPathesView.py \
+InitializationForm.py \
+InitializationModel.py \
+InitializationView.py \
+LagrangianAdvancedOptionsDialogForm.py \
+LagrangianBoundariesForm.py \
+LagrangianBoundariesModel.py \
+LagrangianBoundariesView.py \
+LagrangianForm.py \
+LagrangianModel.py \
+LagrangianOutputForm.py \
+LagrangianOutputModel.py \
+LagrangianOutputView.py \
+LagrangianStatisticsForm.py \
+LagrangianStatisticsModel.py \
+LagrangianStatisticsView.py \
+LagrangianView.py \
+LocalizationForm.py \
+LocalizationModel.py \
+LocalizationView.py \
+MatisseCustomForm.py \
+MatisseCustomView.py \
+MatisseGeomForm.py \
+MatisseGeomModel.py \
+MatisseGeomView.py \
+MatisseHydrauForm.py \
+MatisseHydrauModel.py \
+MatisseHydrauView.py \
+MatisseModel.py \
+MatisseNetworkForm.py \
+MatisseNetworkModel.py \
+MatisseNetworkView.py \
+MatisseRangeDescriptionForm.py \
+MatisseRangeDescriptionModel.py \
+MatisseRangeDescriptionView.py \
+MatisseThermicForm.py \
+MatisseThermicModel.py \
+MatisseThermicView.py \
+MatisseTypeForm.py \
+MatisseTypeModel.py \
+MatisseTypeView.py \
+MemoryAllocationForm.py \
+MemoryAllocationModel.py \
+MemoryAllocationView.py \
+MeshQualityCriteriaLogDialogForm.py \
+MobileMeshForm.py \
+MobileMeshModel.py \
+MobileMeshView.py \
+NumericalParamEquationForm.py \
+NumericalParamEquationModel.py \
+NumericalParamEquationView.py \
+NumericalParamGlobalForm.py \
+NumericalParamGlobalModel.py \
+NumericalParamGlobalView.py \
+OutputControlForm.py \
+OutputControlModel.py \
+OutputControlView.py \
+OutputSurfacicVariablesForm.py \
+OutputSurfacicVariablesModel.py \
+OutputSurfacicVariablesView.py \
+OutputVolumicVariablesForm.py \
+OutputVolumicVariablesModel.py \
+OutputVolumicVariablesView.py \
+PreProcessingInformationsView.py \
+ProfilesForm.py \
+ProfilesModel.py \
+ProfilesView.py \
+QMeiEditorForm.py \
+QMeiEditorView.py \
+ReferenceValuesForm.py \
+ReferenceValuesModel.py \
+ReferenceValuesView.py \
+SalomeHandler.py \
+SolutionDomainForm.py \
+SolutionDomainMeshFormatDialogForm.py \
+SolutionDomainModel.py \
+SolutionDomainView.py \
+SolutionVerifForm.py \
+SolutionVerifView.py \
+StartRestartAdvancedDialogForm.py \
+StartRestartForm.py \
+StartRestartModel.py \
+StartRestartView.py \
+SteadyManagementForm.py \
+SteadyManagementModel.py \
+SteadyManagementView.py \
+SyrthesForm.py \
+SyrthesView.py \
+ThermalRadiationAdvancedDialogForm.py \
+ThermalRadiationForm.py \
+ThermalRadiationModel.py \
+ThermalRadiationView.py \
+ThermalScalarForm.py \
+ThermalScalarModel.py \
+ThermalScalarView.py \
+TimeAveragesForm.py \
+TimeAveragesModel.py \
+TimeAveragesView.py \
+TimeStepForm.py \
+TimeStepModel.py \
+TimeStepView.py \
+TurbulenceAdvancedOptionsDialogForm.py \
+TurbulenceForm.py \
+TurbulenceModel.py \
+TurbulenceView.py \
+UserArraysForm.py \
+UserArraysModel.py \
+UserArraysView.py \
+UserScalarPropertiesForm.py \
+UserScalarPropertiesView.py \
+VerifyExistenceLabelDialogForm.py \
+VerifyExistenceLabelDialogView.py \
+WelcomeForm.py \
+WelcomeView.py
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/Pages/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu gui/Pages/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pagesPYTHON: $(pages_PYTHON)
+ @$(NORMAL_INSTALL)
+ test -z "$(pagesdir)" || $(MKDIR_P) "$(DESTDIR)$(pagesdir)"
+ @list='$(pages_PYTHON)'; dlist=''; for p in $$list; do\
+ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
+ if test -f $$b$$p; then \
+ f=$(am__strip_dir) \
+ dlist="$$dlist $$f"; \
+ echo " $(pagesPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(pagesdir)/$$f'"; \
+ $(pagesPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(pagesdir)/$$f"; \
+ else :; fi; \
+ done; \
+ if test -n "$$dlist"; then \
+ if test -z "$(DESTDIR)"; then \
+ PYTHON=$(PYTHON) $(py_compile) --basedir "$(pagesdir)" $$dlist; \
+ else \
+ PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pagesdir)" $$dlist; \
+ fi; \
+ else :; fi
+
+uninstall-pagesPYTHON:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pages_PYTHON)'; dlist=''; for p in $$list; do\
+ f=$(am__strip_dir) \
+ rm -f "$(DESTDIR)$(pagesdir)/$$f"; \
+ rm -f "$(DESTDIR)$(pagesdir)/$${f}c"; \
+ rm -f "$(DESTDIR)$(pagesdir)/$${f}o"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile all-local
+installdirs:
+ for dir in "$(DESTDIR)$(pagesdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pagesPYTHON
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pagesPYTHON
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+ clean-libtool clean-local distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pagesPYTHON install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-pagesPYTHON
+
+
+all-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --build $(srcdir)
+
+clean-local:
+ @$(PYTHON) $(top_srcdir)/gui/sbin/mkpyqt.py --clean $(srcdir)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gui/Pages/MatisseCustomForm.ui b/gui/Pages/MatisseCustomForm.ui
new file mode 100644
index 0000000..d57aee3
--- /dev/null
+++ b/gui/Pages/MatisseCustomForm.ui
@@ -0,0 +1,174 @@
+<ui version="4.0" >
+ <class>MatisseCustomForm</class>
+ <widget class="QWidget" name="MatisseCustomForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>519</width>
+ <height>541</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>GroupBox</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableView" />
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>477</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelLabel" >
+ <property name="text" >
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditLabel" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelMin" >
+ <property name="text" >
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditMin" />
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelMax" >
+ <property name="text" >
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditMax" />
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelValue" >
+ <property name="text" >
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditValue" />
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="3" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QPushButton" name="pushButtonNew" >
+ <property name="text" >
+ <string>Create</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QPushButton" name="pushButtonModify" >
+ <property name="text" >
+ <string>Modify</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QPushButton" name="pushButtonDelete" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="4" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>121</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MatisseCustomView.py b/gui/Pages/MatisseCustomView.py
new file mode 100644
index 0000000..70276f8
--- /dev/null
+++ b/gui/Pages/MatisseCustomView.py
@@ -0,0 +1,979 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- MatisseCustomView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from MatisseCustomForm import Ui_MatisseCustomForm
+import Base.QtPage as QtPage
+
+import Pages.MatisseTypeModel as MatisseType
+import Pages.MatisseGeomModel as MatisseGeom
+
+from Pages.MatisseRangeDescriptionModel import MatisseRangeDescriptionModel
+from Pages.MatisseNetworkModel import MatisseNetworkModel
+from Pages.MatisseThermicModel import MatisseThermicModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MatisseCustomView")
+log.setLevel(logging.DEBUG)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class
+#-------------------------------------------------------------------------------
+
+_EPSILON = 1e-6
+
+class StandardItemModelMatisseCustom(QStandardItemModel):
+ """
+ QStandardItemModel associated with the QtableView for common Matisse operations.
+
+ Behavior depends on the value of attribute tagName (self.tagName).
+ """
+
+ def __init__(self, parent, case, tagName, dico):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.parent = parent
+ self.case = case
+ self.tagName = tagName
+ self.dico = dico
+ self.dataMatisse = []
+ self.setColumnCount(len(self.dico['headers']))
+ self.__initXMLModel()
+ self.__initData()
+
+
+ def __initXMLModel(self):
+ """
+ """
+ if self.tagName in ["inlet_range_line", "inlet_range_height",
+ "outlet_range_line", "outlet_range_height",
+ "network_line", "network_row"]:
+
+ self.default_row = ["default", 0., 0., 0., 0.]
+ self.columns_editable = [0, 1, 2]
+ self.column_step_min = 3
+ self.column_step_max = 4
+
+ # XML Model
+ if self.tagName in ["network_line", "network_row"]:
+
+ self.model = MatisseNetworkModel(self.case)
+
+ model_geom = MatisseGeom.MatisseGeomModel(self.case)
+ self.lineStep = model_geom.getMatisseGeomDoubleVar('ptrres')
+ self.rowStep = model_geom.getMatisseGeomDoubleVar('plgres')
+ self.heightStep = model_geom.getMatisseGeomDoubleVar('epchel')
+ self.lineMax = model_geom.getMatisseGeomDoubleVar('nptran')
+ self.rowMax = model_geom.getMatisseGeomDoubleVar('nplgrs')
+ self.heightMax = model_geom.getMatisseGeomDoubleVar('nchest')
+
+ model_mat_type = MatisseType.MatisseTypeModel(self.case)
+ self.alveoStat = model_mat_type.node_alveo['status']
+
+ elif self.tagName in ["inlet_range_line", "inlet_range_height"]:
+
+ self.model = MatisseRangeDescriptionModel(self.case, 'inlet_range')
+
+ model_geom = MatisseGeom.MatisseGeomModel(self.case)
+ self.lineStep = model_geom.getMatisseGeomDoubleVar('ptrres')
+ self.heightStep = model_geom.getMatisseGeomDoubleVar('epchel')
+ self.lineMax = model_geom.getMatisseGeomDoubleVar('nptran')
+ self.heightMax = model_geom.getMatisseGeomDoubleVar('nchest')
+
+ elif self.tagName in ["outlet_range_line", "outlet_range_height"]:
+
+ self.model = MatisseRangeDescriptionModel(self.case, 'outlet_range')
+
+ model_geom = MatisseGeom.MatisseGeomModel(self.case)
+ self.lineStep = model_geom.getMatisseGeomDoubleVar('ptrres')
+ self.heightStep = model_geom.getMatisseGeomDoubleVar('epchel')
+ self.lineMax = model_geom.getMatisseGeomDoubleVar('nptran')
+ self.heightMax = model_geom.getMatisseGeomDoubleVar('nchest')
+
+ else:
+ #elif self.tagName in ["thermal_line", "thermal_row", "thermal_height"]:
+
+ # Thermic load
+ self.areatype = self.dico['areatype']
+
+ self.default_row = ["default", 0., 0., 0., 0., 0.]
+ self.columns_editable = [0, 1, 2, 3]
+ self.column_step_min = 4
+ self.column_step_max = 5
+
+ # XML Model
+ self.model = MatisseThermicModel(self.case)
+
+ self.model_mat_type = MatisseType.MatisseTypeModel(self.case)
+ model_geom = MatisseGeom.MatisseGeomModel(self.case)
+ self.lineStep = model_geom.getMatisseGeomDoubleVar('ptrres')
+ self.rowStep = model_geom.getMatisseGeomDoubleVar('plgres')
+ self.heightStep = model_geom.getMatisseGeomDoubleVar('epchel')
+
+ self.lineMax = model_geom.getMatisseGeomDoubleVar('nptran')
+ self.rowMax = model_geom.getMatisseGeomDoubleVar('nplgrs')
+ self.heightMax = model_geom.getMatisseGeomDoubleVar('nchest')
+
+ #
+ self.areatype = self.dico['areatype']
+ if self.areatype == 'line' :
+ self.step = self.lineStep
+ elif self.areatype == 'height' :
+ self.step = self.heightStep
+ elif self.areatype == 'row' :
+ self.step = self.rowStep
+
+
+ def __initData(self):
+ """
+ Load previous values
+ """
+ if self.tagName in ["inlet_range_line", "inlet_range_height",
+ "outlet_range_line", "outlet_range_height",
+ "network_line", "network_row"]:
+
+ llabel, lbmin, lbmax = self.model.GetAreas(self.areatype)
+
+ n = len(llabel)
+ if ((n != len(lbmin)) or (n != len(lbmax))):
+ print "XML format error : bad definition of <area> "
+ sys.exit(1)
+
+ for area in range(0,len(llabel)):
+ row = self.default_row
+ row[0] = llabel[area]
+ row[1] = float(lbmin[area])
+ row[2] = float(lbmax[area])
+ row[self.column_step_min] = self.step * row[1]
+ row[self.column_step_max] = self.step * row[2]
+ self.dataMatisse.append(row)
+ nrows = self.rowCount()
+ self.setRowCount(nrows+1)
+
+ elif self.tagName in ["thermal_line", "thermal_row", "thermal_height"]:
+
+ llabel, lbmin, lbmax, lval = self.model.GetAreas(self.areatype)
+
+ n = len(llabel)
+ if ((n != len(lbmin)) or (n != len(lbmax)) or (n != len(lval))):
+ print "XML format error : bad definition of <area> "
+ sys.exit(1)
+
+ # Default values
+ if len(llabel) == 0 :
+ dlabel, dmin, dmax, dval = self.model.DefaultArea(self.areatype)
+ self.model.NewArea(self.areatype, dlabel, dmin, dmax, dval)
+ llabel.append(dlabel)
+ lbmin.append(dmin)
+ lbmax.append(dmax)
+ lval.append(dval)
+
+ for area in range(0,len(llabel)):
+ row = self.default_row
+ row[0] = llabel[area]
+ row[1] = float(lbmin[area])
+ row[2] = float(lbmax[area])
+ row[3] = float(lval[area])
+ row[self.column_step_min] = self.step * row[1]
+ row[self.column_step_max] = self.step * row[2]
+ self.dataMatisse.append(row)
+ nrows = self.rowCount()
+ self.setRowCount(nrows+1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ row = index.row()
+ col = index.column()
+ return QVariant(self.dataMatisse[row][col])
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.dico['headers'][section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addRow(self, label, sbmin, sbmax, svalue):
+ """
+ Add a row in the model.
+ """
+ log.debug("addRow")
+ bool_create = False
+ if self.tagName in ["inlet_range_line", "inlet_range_height",
+ "outlet_range_line", "outlet_range_height",
+ "network_line", "network_row"]:
+
+ bool_create = self.__addRowRangeDescriptionNetwork(label, sbmin, sbmax, self.areatype, self.step)
+
+ if self.tagName in ["thermal_line", "thermal_row", "thermal_height"]:
+
+ bool_create = self.__addRowThermal(label, sbmin, sbmax, svalue, self.areatype, self.step)
+
+
+ if bool_create:
+ row = self.default_row
+ row[0] = label
+ row[1] = sbmin
+ row[2] = sbmax
+ row[self.column_step_min] = self.step * row[1]
+ row[self.column_step_max] = self.step * row[2]
+ self.dataMatisse.append(row)
+ nrows = self.rowCount()
+ self.setRowCount(nrows+1)
+
+
+ def editRow(self, row, new_label, new_bmin, new_bmax, new_value):
+ """
+ Edit a row in the model
+ """
+ if self.tagName in ["inlet_range_line", "inlet_range_height",
+ "outlet_range_line", "outlet_range_height",
+ "network_line", "network_row"]:
+
+ [label, sbmin, sbmax, sbmin2, sbmax2] = self.dataMatisse[row]
+ bool_modify = self.__editRangeDescription(new_label, new_bmin, new_bmax,
+ label, sbmin, sbmax,
+ self.areatype, self.step)
+
+ if self.tagName in ["thermal_line", "thermal_row", "thermal_height"]:
+ [label, sbmin, sbmax, svalue, sbmin2, sbmax2] = self.dataMatisse[row]
+ bool_modify = self.__editRangeThermal(new_label, new_bmin, new_bmax, new_value,
+ label, sbmin, sbmax, svalue,
+ self.areatype, self.step)
+
+
+ if bool_modify:
+ pass # TODO
+
+ def deleteRow(self, row):
+ """
+ Delete a row in the model.
+ """
+ log.debug("deleteRow")
+
+ if self.tagName in ["inlet_range_line", "inlet_range_height",
+ "outlet_range_line", "outlet_range_height",
+ "network_line", "network_row"]:
+
+ [label, sbmin, sbmax, sbmin2, sbmax2] = self.dataMatisse[row]
+ bool_cancel = self.__deleteRowRangeDescription(label, sbmin, sbmax, self.areatype)
+
+ if self.tagName in ["thermal_line", "thermal_row", "thermal_height"]:
+ [label, sbmin, sbmax, svalue, sbmin2, sbmax2] = self.dataMatisse[row]
+ bool_cancel = self.__deleteRowThermal(label, sbmin, sbmax, svalue, self.areatype)
+
+
+
+ if bool_cancel:
+ del self.dataMatisse[row]
+ nrows = self.rowCount()
+ self.setRowCount(nrows-1)
+
+
+ # RangeDescription & Network
+ # --------------------------
+
+ def __addRowRangeDescriptionNetwork(self, label, sbmin, sbmax, areatype, step):
+ """
+ Add a row : test for RangeDescription & Network
+ """
+ log.debug("__addRowRangeDescriptionNetwork")
+
+ if not label:
+ label = "Default"
+
+ try :
+ bmin = float(sbmin)
+ bmax = float(sbmax)
+ except:
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+ return
+
+ llabel, lbmin, lbmax = self.model.GetAreas(areatype)
+ create = True
+ #
+ # Bounds check 1/2
+ if (bmin > bmax) or (bmin < 0):
+ create = False
+ if (areatype == 'line'):
+ if (bmax > self.lineMax) :
+ create = False
+ elif (areatype == 'height'):
+ if (bmax > self.heightMax) :
+ create = False
+ elif (areatype == 'row'):
+ if (bmax > self.rowMax) :
+ create = False
+
+ for area in range(0,len(llabel)) :
+ if ((label == llabel[area]) and
+ (abs(bmin - float(lbmin[area])) < _EPSILON) and
+ (abs(bmax - float(lbmax[area])) < _EPSILON)):
+
+ create = False
+
+ #
+ # Bounds check 2/2
+ if (((bmin > float(lbmin[area])) and (bmin < float(lbmax[area]))) or
+ ((bmax > float(lbmin[area])) and (bmax < float(lbmax[area])))) :
+ create = False
+
+ if create :
+ #name = self.insertHlist(h, label, sbmin, sbmax, step)
+ self.model.NewArea(areatype, label, bmin, bmax)
+ else :
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+
+ return create
+
+
+ def __editRowRangeDescriptionNetwork(self, new_label, new_bmin, new_bmax, label, sbmin, sbmax, areatype):
+ """
+ Edit row : test for RangeDescription & Network
+ """
+
+ if not new_label:
+ new_label = "Default"
+
+ if areatype == 'line' :
+ step = self.lineStep
+ elif areatype == 'height' :
+ step = self.heightStep
+ elif areatype == 'row' :
+ step = self.rowStep
+
+ #if len(self.currentEntry) == 1 : # TODO ONE SELECTION
+ if 1 :
+
+## entry = self.currentEntry
+## if h == self.h :
+## label, sbmin, sbmax = self.select.areaInfo(entry)
+## elif h == self.h3 :
+## label, sbmin, sbmax = self.select3.areaInfo(entry)
+
+ bmin = float(sbmin)
+ bmax = float(sbmax)
+
+ llabel, lbmin, lbmax = self.model.GetAreas(areatype)
+
+ #
+ # Bounds check
+ modify = True
+
+ #
+ # Type check
+ try :
+ fnew_bmin=float(new_bmin)
+ fnew_bmax=float(new_bmax)
+ except :
+
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+ return
+
+ if (fnew_bmin > fnew_bmax) or (fnew_bmin < 0):
+ modify = False
+ if (areatype == 'line'):
+ if fnew_bmax > self.lineMax :
+ modify = False
+ elif (areatype == 'height'):
+ if (fnew_bmax > self.heightMax) :
+ modify = False
+
+ if not modify :
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+
+ else:
+ for area in range(0,len(llabel)) :
+ if ((label == llabel[area]) and
+ (abs(bmin - float(lbmin[area])) <= _EPSILON) and
+ (abs(bmax - float(lbmax[area])) <= _EPSILON)):
+
+
+ if ((label != new_label) or
+ (abs(bmax - fnew_bmax) >= _EPSILON) or
+ (abs(bmin - fnew_bmin) >= _EPSILON)) :
+
+ for area1 in range(0,len(llabel)) :
+ if area1 != area :
+ if (((fnew_bmin > float(lbmin[area1])) and (fnew_bmin < float(lbmax[area1]))) or
+ ((fnew_bmax > float(lbmin[area1])) and (fnew_bmax < float(lbmax[area1])))) :
+ modify = False
+
+ if modify :
+ self.model.SetArea(areatype, area, new_label, new_bmin, new_bmax)
+ #self.replaceHlist(h, entry, new_label, new_bmin, new_bmax, step)
+ else:
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+
+ else: # # TODO MULTI-SELECTION
+ for entry in self.currentEntry:
+
+## if h == self.h :
+## label, sbmin, sbmax = self.select.areaInfo(entry)
+## elif h == self.h3 :
+## label, sbmin, sbmax = self.select3.areaInfo(entry)
+
+ bmin = float(sbmin)
+ bmax = float(sbmax)
+
+ llabel, lbmin, lbmax = self.model.GetAreas(areatype)
+
+ for area in range(0,len(llabel)) :
+ if ((label == llabel[area]) or
+ (abs(bmin - float(lbmin[area])) <= _EPSILON) and
+ (abs(bmax - float(lbmax[area])) <= _EPSILON)):
+
+ if (label != new_label) :
+
+ if (new_label != _MULTISEL) :
+ self.model.SetArea(areatype, area, new_label, None , None)
+ #self.replaceHlist( h, entry, new_label, bmin, bmax,step)
+
+ else :
+ pass
+
+
+ def __deleteRowRangeDescriptionNetwork(self, label, sbmin, sbmax, areatype):
+ """
+ Delete row : test for RangeDescription & Network
+ """
+ log.debug("__deleteRowRangeDescriptionNetwork")
+
+ bmin = float(sbmin)
+ bmax = float(sbmax)
+
+ llabel, lbmin, lbmax = self.model.GetAreas(areatype)
+
+ cancel = False
+ for area in range(0,len(llabel)) :
+ if ((label == llabel[area]) and
+ (abs(bmin - float(lbmin[area])) < _EPSILON) and
+ (abs(bmax - float(lbmax[area])) < _EPSILON)):
+
+ self.model.EraseArea(areatype, area)
+ cancel = True
+
+ return cancel
+
+## # Delete boundary region from the Hlist
+## #
+## if not cancel :
+## print "Entry is in Hlist but not in XML"
+## sys.exit(1)
+## else :
+## #
+## # Pb : si on ne supprime pas le dernier elt : lors de la creation d'une nouvelle hlist
+## # il recupere un nom deja donne !!!
+## ## if h == self.h :
+## ## self.entriesNumberH1 = self.entriesNumberH1 -1
+## ## elif h == self.h3 :
+## ## self.entriesNumberH3 = self.entriesNumberH3 -1
+## h.hlist.delete_entry(entry)
+
+
+
+ # Thermal
+ # -------
+
+ def __addRowRangeThermal(self, label, sbmin, sbmax, svalue, areatype, step):
+ """
+ Add a row : test for Thermal load
+ """
+ log.debug("__addRowThermal")
+
+ # Reading and add to Hlist
+ #
+ if not label:
+ label = "Default"
+
+ try :
+ bmin = float(sbmin)
+ bmax = float(sbmax)
+ value = float(svalue)
+ except:
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+ return
+
+ llabel, lbmin, lbmax, lval = self.model.GetAreas(areatype)
+
+ create = True
+ #
+ # Bounds check
+ if (bmin > bmax) or (bmin < 0):
+ create = False
+ if (areatype == 'line'):
+ if (bmax > self.lineMax) :
+ create = False
+ elif (areatype == 'row'):
+ if (bmax > self.rowMax) :
+ create = False
+ elif (areatype == 'height'):
+ if (bmax > self.heightMax) :
+ create = False
+
+ for area in range(0,len(llabel)) :
+ #
+ # No duplicate
+ if ((label == llabel[area]) and
+ (abs(bmin - float(lbmin[area])) < _EPSILON) and
+ (abs(bmax - float(lbmax[area])) < _EPSILON) and
+ (abs(value - float(lval[area])) < _EPSILON)) :
+ create = False
+
+ if (((bmin > float(lbmin[area])) and (bmin < float(lbmax[area]))) or
+ ((bmax > float(lbmin[area])) and (bmax < float(lbmax[area])))) :
+ create = False
+
+
+ if create :
+ #name = self.insertHlist(h, label, sbmin, sbmax, svalue ,step)
+ self.model.NewArea(areatype, label, bmin, bmax, value)
+ else :
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+
+ return create
+
+
+ def __editRowThermal(self, new_label, new_bmin, new_bmax, label, sbmin, sbmax, areatype):
+ """
+ Edit row : test for Thermal load
+ """
+ log.debug("__editRowThermal")
+
+
+ if not new_label:
+ new_label = "Default"
+
+ if areatype == 'line' :
+ step = self.lineStep
+ elif areatype == 'row' :
+ step = self.rowStep
+ elif areatype == 'height' :
+ step = self.heightStep
+
+ if 1:
+ #if len(self.currentEntry) == 1 :
+
+ bmin = float(sbmin)
+ bmax = float(sbmax)
+ value = float(svalue)
+
+ llabel, lbmin, lbmax, lval = self.model.GetAreas(areatype)
+
+ #
+ # Bounds check
+ modify = True
+
+ #
+ # Type check
+ try :
+ fnew_bmin=float(new_bmin)
+ fnew_bmax=float(new_bmax)
+ fnew_value=float(new_value)
+ except :
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+ return
+
+ if (fnew_bmin > fnew_bmax) or (fnew_bmin < 0):
+ modify = False
+ if (areatype == 'line'):
+ if fnew_bmax > self.lineMax :
+ modify = False
+ elif (areatype == 'height'):
+ if (fnew_bmax > self.heightMax) :
+ modify = False
+ elif (areatype == 'row'):
+ if (fnew_bmax > self.rowMax) :
+ modify = False
+
+ if not modify :
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+ else:
+ for area in range(0,len(llabel)) :
+ if ((label == llabel[area]) and
+ (abs(bmin - float(lbmin[area])) <= _EPSILON) and
+ (abs(bmax - float(lbmax[area])) <= _EPSILON) and
+ (abs(value - float(lval[area])) <= _EPSILON)) :
+
+ if ((label != new_label) or
+ (abs(bmax - fnew_bmax) >= _EPSILON) or
+ (abs(bmin - fnew_bmin) >= _EPSILON) or
+ (abs(value - fnew_value) >= _EPSILON)) :
+
+ for area1 in range(0,len(llabel)) :
+ if area1 != area :
+ if (((fnew_bmin > float(lbmin[area1])) and (fnew_bmin < float(lbmax[area1]))) or
+ ((fnew_bmax > float(lbmin[area1])) and (fnew_bmax < float(lbmax[area1])))) :
+ modify = False
+
+ if modify :
+ self.model.SetArea(areatype, area, new_label, new_bmin, new_bmax, new_value)
+ #self.replaceHlist(h, entry, new_label, new_bmin, new_bmax, new_value, step)
+ else:
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+
+
+ else :
+ for entry in self.currentEntry:
+
+ bmin = float(sbmin)
+ bmax = float(sbmax)
+ value = float(svalue)
+
+ llabel, lbmin, lbmax, lval = self.model.GetAreas(areatype)
+
+ #
+ # Type check
+ try :
+ fnew_value=float(new_value)
+ except :
+ if new_value != _MULTISEL :
+ title = self.tr("Warning")
+ msg = self.tr("'%1' bad definition: see the bounds definition").arg(label)
+ QMessageBox.warning(self.parent, title, msg)
+
+ return
+
+ for area in range(0,len(llabel)) :
+ if ((label == llabel[area]) or
+ (abs(bmin - float(lbmin[area])) <= _EPSILON) and
+ (abs(bmax - float(lbmax[area])) <= _EPSILON) and
+ (abs(value - float(lval[area])) <= _EPSILON)) :
+
+ if ((label != new_label) or new_value == _MULTISEL or
+ (abs(value - fnew_value) >= _EPSILON)) :
+
+ if (new_label == _MULTISEL) and (new_value != _MULTISEL):
+ self.model.SetArea(areatype, area, None, None , None , new_value)
+ #self.replaceHlist( h, entry, label, bmin, bmax, new_value, step)
+
+ elif (new_value == _MULTISEL) and (new_label != _MULTISEL) :
+ self.model.SetArea(areatype, area, new_label , None , None , None)
+ #self.replaceHlist( h, entry, new_label, bmin, bmax, value, step)
+
+ elif (new_value != _MULTISEL) and (new_label != _MULTISEL) :
+ self.model.SetArea(areatype, area, new_label, None , None , new_value)
+ #self.replaceHlist( h, entry, new_label, bmin, bmax, new_value, step)
+
+ else :
+ pass
+
+
+ def __deleteRowThermal(self, label, sbmin, sbmax, svalue, areatype):
+ """
+ Delete row : test for Thermal
+ """
+ log.debug("__deleteRowThermal")
+
+ llabel, lbmin, lbmax, lval = self.model.GetAreas(areatype)
+ cancel = False
+ for area in range(0,len(llabel)) :
+ if ((label == llabel[area]) and
+ (abs(bmin - float(lbmin[area])) < _EPSILON) and
+ (abs(bmax - float(lbmax[area])) < _EPSILON) and
+ (abs(value - float(lval[area])) < _EPSILON)) :
+ self.model.EraseArea(areatype, area)
+ cancel = True
+
+ return cancel
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MatisseCustomView(QWidget, Ui_MatisseCustomForm):
+ """
+ """
+
+ def __init__(self, *args):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, *args)
+ Ui_MatisseCustomForm.__init__(self)
+ self.setupUi(self)
+
+
+ def initWidget(self, case, tagName):
+ """
+ Method to initialize the widget.
+ Must be explicitly called.
+ """
+ self.case = case
+ self.tagName = tagName
+ self._createWidgets()
+
+
+ def getLabel(self):
+ """
+ Return the name of the boundary condition. It 's not allowed to have
+ blank or not ASCII caracters in this name.
+ """
+ label = str(self.lineEditLabel.text())
+ return string.join(string.split(label), '_')
+
+
+ def getBmin(self):
+ """
+ """
+ bmin, ok = self.lineEditMin.text().toFloat()
+ return bmin
+
+
+ def getBmax(self):
+ """
+ """
+ bmax, ok = self.lineEditMax.text().toFloat()
+ return bmax
+
+
+ def getValue(self):
+ """
+ """
+ value, ok = self.lineEditValue.text().toFloat()
+ return value
+
+
+ def createItem(self):
+ label = self.getLabel()
+ sbmin = self.getBmin()
+ sbmax = self.getBmax()
+ svalue = self.getValue()
+ self.modelMatisseCustom.addRow(label, sbmin, sbmax, svalue)
+
+
+ def modifyItem(self):
+ new_label = self.getLabel()
+ new_bmin = self.getBmin()
+ new_bmax = self.getBmax()
+ new_value = self.getValue()
+ nrows = 0
+ tab_rows = []
+ selectionModel = self.tableView.selectionModel()
+ for index in selectionModel.selectedRows():
+ tab_rows.append(index.row())
+ nrows = nrows + 1
+ log.debug("modifyItem nrows = %i tab_rows = %s "%(nrows, str(tab_rows)))
+ for row in tab_rows:
+ self.modelMatisseCustom.editRow(row, new_label, new_bmin, new_bmax, new_value)
+
+
+ def cancelItem(self):
+ nrows = 0
+ tab_rows = []
+ selectionModel = self.tableView.selectionModel()
+ for index in selectionModel.selectedRows():
+ tab_rows.append(index.row())
+ nrows = nrows + 1
+ log.debug("cancelItem nrows = %i tab_rows = %s "%(nrows, str(tab_rows)))
+ for row in tab_rows:
+ self.modelMatisseCustom.deleteRow(row)
+
+
+ def _createWidgets(self):
+ """
+ Create the Page layout.
+ """
+ if self.tagName == "":
+ log.debug("_createWidgets self.tagName is not set!")
+ sys.exit(1)
+
+ self.__initDico()
+ dico = self.dico_custom[self.tagName]
+
+ # Update title and labels in the view
+ self.groupBox.setTitle(dico['title'])
+ self.labelLabel.setText(QString(dico['label']))
+ self.labelMin.setText(QString(dico['min']))
+ self.labelMax.setText(QString(dico['max']))
+ self.labelValue.hide()
+ self.lineEditValue.hide()
+
+ if 'value' in dico.keys():
+ self.labelValue.setText(QString(dico['value']))
+ self.labelValue.show()
+ self.lineEditValue.show()
+
+ # Set model for tableView
+ self.modelMatisseCustom = StandardItemModelMatisseCustom(self, self.case, self.tagName, dico)
+ self.tableView.setModel(self.modelMatisseCustom)
+ self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
+ self.tableView.setSelectionMode(QAbstractItemView.ExtendedSelection)
+
+ # Connections
+ self.connect(self.pushButtonNew, SIGNAL("clicked()"), self.createItem)
+ self.connect(self.pushButtonModify, SIGNAL("clicked()"), self.modifyItem)
+ self.connect(self.pushButtonDelete, SIGNAL("clicked()"), self.cancelItem)
+
+ # validators
+ regExp = QRegExp("[_A-Za-z0-9]*") # QRegExp("^all[ ]*$|^[0-9\ ]*$")
+ validatorLabel = QRegExpValidator(regExp, self.lineEditLabel)
+ self.lineEditLabel.setValidator(validatorLabel)
+
+ validatorFloat = QtPage.DoubleValidator(self.lineEditMin)
+ self.lineEditMin.setValidator(validatorFloat)
+ self.lineEditMax.setValidator(validatorFloat)
+ self.lineEditValue.setValidator(validatorFloat)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+ def __initDico(self):
+ """
+ Set a dictionnary which contains field names.
+ """
+
+ line = { 'areatype' : "line",
+ 'title' : self.tr("headloss in line") ,
+ 'label' : self.tr("Label"),
+ 'min' : self.tr("Distance min \n (in lines)"),
+ 'max' : self.tr("Distance max \n (in lines)"),
+ 'headers' : [self.tr("Label"),
+ self.tr("Distance min \n (in lines)"),
+ self.tr("Distance max \n (in lines)"),
+ self.tr("Distance min \n (m)"),
+ self.tr("Distance max \n (m)")]
+ }
+
+ height = { 'areatype' : "height",
+ 'title' : self.tr("headloss in height") ,
+ 'label' : self.tr("Label"),
+ 'min' : self.tr("Height min \n (in cells)"),
+ 'max' : self.tr("Height max \n (in cells)"),
+ 'headers' : [self.tr("Label"),
+ self.tr("Height min \n (in cells)"),
+ self.tr("Height max \n (in cells)"),
+ self.tr("Height min \n (m)"),
+ self.tr("Height max \n (m)")]
+ }
+
+ row = { 'areatype' : "row",
+ 'title' : self.tr("Headloss in row") ,
+ 'label' : self.tr("Label"),
+ 'min' : self.tr("Distance min \n (in rows)"),
+ 'max' : self.tr("Distance max \n (in rows)"),
+ 'headers' : [self.tr("Label"),
+ self.tr("Distance min \n (in rows)"),
+ self.tr("Distance max \n (in rows)"),
+ self.tr("Distance min \n (m)"),
+ self.tr("Distance max \n (m)")]
+ }
+
+ dico_custom = {}
+ dico_custom['inlet_range_line'] = line
+ dico_custom['inlet_range_height'] = height
+ dico_custom['outlet_range_line'] = line
+ dico_custom['outlet_range_height'] = height
+ dico_custom['network_line'] = line
+ dico_custom['network_row'] = row
+ dico_custom['thermal_line'] = line
+ dico_custom['thermal_height'] = height
+ dico_custom['thermal_row'] = row
+
+ self.dico_custom = dico_custom
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseGeomForm.ui b/gui/Pages/MatisseGeomForm.ui
new file mode 100644
index 0000000..f849114
--- /dev/null
+++ b/gui/Pages/MatisseGeomForm.ui
@@ -0,0 +1,41 @@
+<ui version="4.0" >
+ <class>MatisseGeomForm</class>
+ <widget class="QWidget" name="MatisseGeomForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>563</width>
+ <height>574</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="geometry" >
+ <rect>
+ <x>30</x>
+ <y>20</y>
+ <width>491</width>
+ <height>411</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>Storage concept geometry</string>
+ </property>
+ <widget class="QTableView" name="tableView" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>471</width>
+ <height>371</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MatisseGeomModel.py b/gui/Pages/MatisseGeomModel.py
new file mode 100644
index 0000000..689a75e
--- /dev/null
+++ b/gui/Pages/MatisseGeomModel.py
@@ -0,0 +1,394 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the storage system type.
+
+This module contains the following classes and function:
+- MatisseGeomModel
+- MatisseGeomTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import shutil, sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+import Pages.MatisseTypeModel as MatisseType
+
+#-------------------------------------------------------------------------------
+# Matisse Geom model class
+#-------------------------------------------------------------------------------
+
+class MatisseGeomModel:
+ """
+ Manage the input/output markups in the xml doc about Turbulence
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_matisse = self.case.root().xmlInitChildNode('matisse')
+ self.node_mesh = self.node_matisse.xmlInitChildNode('mesh')
+ self.node_compute = self.node_matisse.xmlInitChildNode('compute')
+ self.node_geom_mesh = self.node_mesh.xmlInitChildNode('geometry')
+ self.node_geom_compute = self.node_compute.xmlInitChildNode('geometry')
+
+ self.mesh_geom_vars = ['nechrg','nergrs','neclrg','neciel','nergch',
+ 'jeuchr','jeurcl','jeuclr','jeurch',
+ 'hbdtoi']
+
+ self.compute_geom_vars = ['epchem','nptran','nplgrs','nelgrs',
+ 'nchest','netran','epregi','hconve',
+ 'rconve','hchali','hcheva','hfttoi',
+ 'ptrres','frdtra','plgres','epchel',
+ 'dmcont']
+ typeModel = MatisseType.MatisseTypeModel(self.case)
+ self.matisseType = typeModel.getMatisseType()
+
+
+ def defaultMatisseGeomValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ #
+ # node geom_mesh
+ default['nechrg'] = 1
+ default['nergrs'] = 5
+ default['neclrg'] = 5
+ default['nergch'] = 1
+ default['neciel'] = 20
+ default['jeuchr'] = 0.2
+ default['jeurcl'] = 2.
+ default['jeuclr'] = 2.
+ default['jeurch'] = 0.2
+ default['hbdtoi'] = 15.
+
+ #
+ # node geom_compute
+ default['epchem'] = 2.
+ default['nptran'] = 1
+ default['nplgrs'] = 24
+ default['nelgrs'] = 1
+ default['nchest'] = 24
+ default['netran'] = 1
+ default['epregi'] = 1.
+ default['hconve'] = 15.
+ default['rconve'] = 4.93
+ default['hchali'] = 24.
+ default['hcheva'] = 24.
+ default['hfttoi'] = 20.
+ default['ptrres'] = 0.8
+ default['frdtra'] = 1.
+ default['plgres'] = 0.7
+ default['epchel'] = 0.333
+ default['dmcont'] = 0.347
+
+ return default
+
+
+ def setMatisseGeomVar(self, tag, val):
+ """
+ """
+ if tag in self.mesh_geom_vars :
+ self.node_geom_mesh.xmlSetData(tag, val)
+ elif tag in self.compute_geom_vars :
+ self.node_geom_compute.xmlSetData(tag, val)
+ else :
+ print tag + ": unknown parameter"
+ sys.exit(1)
+ self.updateMeshAndProbes()
+
+
+ def getMatisseGeomIntVar(self,tag):
+ """
+ """
+ if tag in self.mesh_geom_vars :
+ val = self.node_geom_mesh.xmlGetInt(tag)
+ elif tag in self.compute_geom_vars :
+ val = self.node_geom_compute.xmlGetInt(tag)
+ else :
+ print tag + ": unknown parameter"
+ sys.exit(1)
+
+ if val == "" or val == None:
+ if tag in self.mesh_geom_vars :
+ self.node_geom_mesh.xmlInitChildNode(tag)
+ elif tag in self.compute_geom_vars :
+ self.node_geom_compute.xmlInitChildNode(tag)
+
+ val = self.defaultMatisseGeomValues()[tag]
+ self.setMatisseGeomVar(tag, val)
+
+ return val
+
+
+ def getMatisseGeomDoubleVar(self,tag):
+ """
+ """
+ if tag in self.mesh_geom_vars :
+ val = self.node_geom_mesh.xmlGetDouble(tag)
+ elif tag in self.compute_geom_vars :
+ val = self.node_geom_compute.xmlGetDouble(tag)
+ else :
+ print tag + ": unknown parameter"
+ sys.exit(1)
+
+ if val == "" or val == None:
+ if tag in self.mesh_geom_vars :
+ self.node_geom_mesh.xmlInitChildNode(tag)
+ elif tag in self.compute_geom_vars :
+ self.node_geom_compute.xmlInitChildNode(tag)
+
+ val = self.defaultMatisseGeomValues()[tag]
+ self.setMatisseGeomVar(tag, val)
+
+ return val
+
+
+ def updateMeshAndProbes(self):
+ """
+ """
+ self.replaceText={}
+ self.replaceText['PTTUB'] = str(self.getMatisseGeomDoubleVar('ptrres'))
+ self.replaceText['NLIGN'] = str(self.getMatisseGeomIntVar('nptran'))
+ self.replaceText['PLTUB'] = str(self.getMatisseGeomDoubleVar('plgres'))
+ self.replaceText['NRANG'] = str(self.getMatisseGeomIntVar('nplgrs'))
+ self.replaceText['PVTUB'] = str(self.getMatisseGeomDoubleVar('epchel'))
+ self.replaceText['NZTUB'] = str(self.getMatisseGeomIntVar('nchest'))
+ self.replaceText['ABAMON'] = str(self.getMatisseGeomDoubleVar('epregi'))
+ self.replaceText['EPSCHEM'] = str(self.getMatisseGeomDoubleVar('epchem'))
+ self.replaceText['HCHALIM'] = str(self.getMatisseGeomDoubleVar('hchali'))
+ self.replaceText['HCHEVAC'] = str(self.getMatisseGeomDoubleVar('hcheva'))
+ self.replaceText['NCELT'] = str(self.getMatisseGeomIntVar('netran'))
+ self.replaceText['NCELL'] = str(self.getMatisseGeomIntVar('nelgrs'))
+ self.replaceText['GAPGECH'] = str(self.getMatisseGeomDoubleVar('jeurch'))
+ self.replaceText['NELGECH'] = str(self.getMatisseGeomIntVar('nergch'))
+ self.replaceText['GAPREG'] = str(self.getMatisseGeomDoubleVar('jeuclr'))
+ self.replaceText['NELREG'] = str(self.getMatisseGeomIntVar('neclrg'))
+ self.replaceText['GAPGRE'] = str(self.getMatisseGeomDoubleVar('jeurcl'))
+ self.replaceText['NELGRE'] = str(self.getMatisseGeomIntVar('nergrs'))
+ self.replaceText['GAPCHEG'] = str(self.getMatisseGeomDoubleVar('jeuchr'))
+ self.replaceText['NELCHEG'] = str(self.getMatisseGeomIntVar('nechrg'))
+ self.replaceText['HCONVER'] = str(self.getMatisseGeomDoubleVar('hconve'))
+ self.replaceText['RCONVER'] = str(self.getMatisseGeomDoubleVar('rconve'))
+ self.replaceText['NCELCIEL']= str(self.getMatisseGeomIntVar('neciel'))
+ self.replaceText['HTOITBAS']= str(self.getMatisseGeomDoubleVar('hbdtoi'))
+ self.replaceText['HTOITHAU']= str(self.getMatisseGeomDoubleVar('hfttoi'))
+
+ self.meshUpdate()
+ self.probesUpdate()
+
+
+ def meshUpdate(self):
+ """
+ Update mesh file
+ """
+ #
+ # copy of default mesh
+ print "Not available in the current version."
+ sys.exit(1)
+
+ # TODO: To be adapated, once GUI and Kernel are mergerd
+ defaultMeshDir = cs_home[:-1] + '/data/mati'
+
+ if (self.matisseType == 'vault') or (self.matisseType == 'djw'):
+ meshFile = 'vault.dat'
+ geomFile = 'vault.geom'
+ desFile = 'vault.des'
+ elif self.matisseType == 'emm':
+ meshFile = 'emm.dat'
+ geomFile = 'emm.geom'
+ desFile = 'emm.des'
+ else:
+ print self.matisseType + ": matisseType unknown"
+ sys.exit(1)
+
+ geomFileInitName = defaultMeshDir + '/' + geomFile
+ geomFileName = self.case['mesh_path'] + '/' + geomFile
+
+ meshFileName = self.case['mesh_path'] + '/' + meshFile
+ shutil.copyfile(defaultMeshDir + '/' + meshFile, meshFileName)
+
+ geomFileInit = open(geomFileInitName, 'r')
+ geomFile = open(geomFileName, 'w')
+
+ #
+ # update mesh
+ while 1:
+ line = geomFileInit.readline()
+ if line != '':
+ for param in self.replaceText:
+ newLine = line.replace(param,self.replaceText[param])
+ line = newLine
+ geomFile.write(newLine)
+ else:
+ break
+
+ #
+ # update node <solution_domain> in XML file
+ node_preprocessor = self.case.root().xmlGetNode('solution_domain')
+ node_meshes_list= node_preprocessor.xmlInitChildNode('meshes_list')
+ mesh_nodes = node_meshes_list.xmlGetNodeList('mesh', 'name')
+
+ if mesh_nodes != []:
+ for i in range(len(mesh_nodes)):
+ if i == 0:
+ mesh_nodes[i]['format'] = 'des'
+ mesh_nodes[i]['name'] = desFile
+ else:
+ mesh_nodes[i].xmlRemoveNode()
+ else :
+ node_meshes_list.xmlInitChildNode('mesh', format='des',name=desFile)
+
+
+ def probesUpdate(self):
+ """
+ Update probes
+ """
+ #
+ # update probes
+ cy = float(self.replaceText['PLTUB'])
+ nr = int(self.replaceText['NRANG'])
+ cz = float(self.replaceText['PVTUB'])
+ nz = int(self.replaceText['NZTUB'])
+
+ probes=[]
+
+ probes.append(["1",[0.02, 0.25*cy*nr/11., 1*0.95*cz*nz/7.]])
+ probes.append(["2",[0.02, 0.25*cy*nr/11., 2*0.95*cz*nz/7.]])
+ probes.append(["3",[0.02, 0.25*cy*nr/11., 3*0.95*cz*nz/7.]])
+ probes.append(["4",[0.02, 0.25*cy*nr/11., 4*0.95*cz*nz/7.]])
+ probes.append(["5",[0.02, 0.25*cy*nr/11., 5*0.95*cz*nz/7.]])
+ probes.append(["6",[0.02, 0.25*cy*nr/11., 6*0.95*cz*nz/7.]])
+ probes.append(["7",[0.02, 0.25*cy*nr/11., 7*0.95*cz*nz/7.]])
+
+ probes.append(["8",[0.02, 4.*cy*nr/11., 1*0.95*cz*nz/7.]])
+ probes.append(["9",[0.02, 4.*cy*nr/11., 2*0.95*cz*nz/7.]])
+ probes.append(["10",[0.02, 4.*cy*nr/11., 3*0.95*cz*nz/7.]])
+ probes.append(["11",[0.02, 4.*cy*nr/11., 4*0.95*cz*nz/7.]])
+ probes.append(["12",[0.02, 4.*cy*nr/11., 5*0.95*cz*nz/7.]])
+ probes.append(["13",[0.02, 4.*cy*nr/11., 6*0.95*cz*nz/7.]])
+ probes.append(["14",[0.02, 4.*cy*nr/11., 7*0.95*cz*nz/7.]])
+
+ probes.append(["15",[0.02, 7.*cy*nr/11., 1*0.95*cz*nz/7.]])
+ probes.append(["16",[0.02, 7.*cy*nr/11., 2*0.95*cz*nz/7.]])
+ probes.append(["17",[0.02, 7.*cy*nr/11., 3*0.95*cz*nz/7.]])
+ probes.append(["18",[0.02, 7.*cy*nr/11., 4*0.95*cz*nz/7.]])
+ probes.append(["19",[0.02, 7.*cy*nr/11., 5*0.95*cz*nz/7.]])
+ probes.append(["20",[0.02, 7.*cy*nr/11., 6*0.95*cz*nz/7.]])
+ probes.append(["21",[0.02, 7.*cy*nr/11., 7*0.95*cz*nz/7.]])
+
+ probes.append(["22",[0.02, 10.*cy*nr/11., 1*0.95*cz*nz/7.]])
+ probes.append(["23",[0.02, 10.*cy*nr/11., 2*0.95*cz*nz/7.]])
+ probes.append(["24",[0.02, 10.*cy*nr/11., 3*0.95*cz*nz/7.]])
+ probes.append(["25",[0.02, 10.*cy*nr/11., 4*0.95*cz*nz/7.]])
+ probes.append(["26",[0.02, 10.*cy*nr/11., 5*0.95*cz*nz/7.]])
+ probes.append(["27",[0.02, 10.*cy*nr/11., 6*0.95*cz*nz/7.]])
+ probes.append(["28",[0.02, 10.*cy*nr/11., 7*0.95*cz*nz/7.]])
+
+ #
+ # update XML
+ node_control = self.case.root().xmlGetChildNode('analysis_control')
+ node_output = node_control.xmlGetChildNode('output')
+ node_probes = node_output.xmlGetNodeList('probe','name')
+
+ import Pages.OutputControlModel as OutputControl
+ output = OutputControl.OutputControlModel(self.case)
+ for probe in probes :
+ try:
+ output.replaceMonitoringPointCoordinates(x = probe[1][0],
+ y = probe[1][1],
+ z = probe[1][2],
+ name = probe[0])
+ except:
+ output.addMonitoringPoint(x = probe[1][0],
+ y = probe[1][1],
+ z = probe[1][2])
+
+
+#-------------------------------------------------------------------------------
+# MatisseGeom Model test case
+#-------------------------------------------------------------------------------
+
+
+class MatisseGeomTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+
+ def checkMatisseGeomInstantiation(self):
+ """
+ Check whether the TurbulenceModel class could be instantiated
+ """
+ model = None
+ model = MatisseGeomModel(self.case)
+ assert model != None, 'Could not instantiate MatisseGeomModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(MatisseGeomTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "MatisseGeomTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/MatisseGeomView.py b/gui/Pages/MatisseGeomView.py
new file mode 100644
index 0000000..c6b43a1
--- /dev/null
+++ b/gui/Pages/MatisseGeomView.py
@@ -0,0 +1,389 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- MatisseGeomView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MatisseGeomForm import Ui_MatisseGeomForm
+import Pages.MatisseTypeModel as MatisseType
+from Pages.MatisseGeomModel import MatisseGeomModel
+import Base.QtPage as QtPage
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MatisseGeomView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Line edit delegates
+#-------------------------------------------------------------------------------
+
+class LineEditDelegateInt(QItemDelegate):
+ """
+ Use of a QLineEdit in the table.
+ """
+ def __init__(self, parent=None):
+ QItemDelegate.__init__(self, parent)
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = QtPage.IntegerValidator(editor, "validatorInt")
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+ def setEditorData(self, lineEdit, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ lineEdit.setText(value)
+
+ def setModelData(self, lineEdit, model, index):
+ value = lineEdit.text()
+ model.setData(index, QVariant(value))
+
+
+class LineEditDelegateFloat(QItemDelegate):
+ """
+ Use of a QLineEdit in the table.
+ """
+ def __init__(self, parent=None):
+ QItemDelegate.__init__(self, parent)
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ validator = QtPage.DoubleValidator(editor, "validatorFloat")
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+ def setEditorData(self, lineEdit, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ lineEdit.setText(value)
+
+ def setModelData(self, lineEdit, model, index):
+ value = lineEdit.text()
+ model.setData(index, QVariant(value))
+
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelGeom(QStandardItemModel):
+
+ def __init__(self, case):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.case = case
+ self.model = MatisseGeomModel(self.case)
+ self.model_mat_type = MatisseType.MatisseTypeModel(self.case)
+
+ self.setColumnCount(4)
+ self._initData()
+
+
+ def _initData(self):
+
+ # Int
+ self.nechrg = 0
+ self.nergrs = 0
+ self.neclrg = 0
+ self.nergch = 0
+ self.neciel = 0
+ self.nptran = 0
+ self.nplgrs = 0
+ self.nelgrs = 0
+ self.nchest = 0
+ self.netran = 0
+
+ # Double
+ self.jeuchr = 0.
+ self.jeurcl = 0.
+ self.jeuclr = 0.
+ self.jeurch = 0.
+ self.hbdtoi = 0.
+ self.epchem = 0.
+ self.epregi = 0.
+ self.hconve = 0.
+ self.rconve = 0.
+ self.hchali = 0.
+ self.hcheva = 0.
+ self.hfttoi = 0.
+ self.ptrres = 0.
+ self.frdtra = 0.
+ self.plgres = 0.
+ self.epchel = 0.
+ self.dmcont = 0.
+
+ self.texts = {}
+ self.texts['jeuchr'] = (6 , self.tr("Upstream space between chimney/register"), "m")
+ self.texts['nechrg'] = (7 , self.tr("Number of cells between chimney/upstream register"))
+ self.texts['jeurcl'] = (8 , self.tr("Space between upstream register/canisters"), "m")
+ self.texts['nergrs'] = (9 , self.tr("Number of cells between upstream register/canisters"))
+ self.texts['jeuclr'] = (10, self.tr("Space between canisters/downstream register"), "m")
+ self.texts['neclrg'] = (11, self.tr("Number of cells between canisters/downstream register"))
+ self.texts['jeurch'] = (12, self.tr("Downstrean space between register/chimney"), "m")
+ self.texts['nergch'] = (13, self.tr("Number of cells between downstream register/chimney"))
+ self.texts['hbdtoi'] = (18, self.tr("Height of roof edge"), "m")
+ self.texts['neciel'] = (20, self.tr("Number of cells layers above canisters"))
+ self.texts['epregi'] = (4 , self.tr("Upstream and downstream registers/doors thickness"), "m")
+ self.texts['epchem'] = (5 , self.tr("chimneys' thickness"), "m")
+ self.texts['hconve'] = (14, self.tr("Convergent height"), "m")
+ self.texts['rconve'] = (15, self.tr("Convergent ratio"), "m")
+ self.texts['hchali'] = (16, self.tr("Inlet chimney height"), "m")
+ self.texts['hcheva'] = (17, self.tr("Outlet chimney height"), "m")
+ self.texts['hfttoi'] = (19, self.tr("Roof ridge height"), "m")
+ self.texts['ptrres'] = (21, self.tr("Transverse step of canisters network"), "m")
+ self.texts['nptran'] = (22, self.tr("Number of tranverse steps"))
+ self.texts['netran'] = (23, self.tr("Number of cells by tranverse step"))
+ self.texts['frdtra'] = (24, self.tr("Transverse reduction factor model/real"), "m")
+ self.texts['plgres'] = (25, self.tr("Longitudinal step of canisters network"), "m")
+ self.texts['nplgrs'] = (26, self.tr("Number of longitudinal steps"))
+ self.texts['nelgrs'] = (27, self.tr("Number of cells by longitudinal step"))
+ self.texts['epchel'] = (28, self.tr("Cells height (storage area)"), "m")
+ self.texts['nchest'] = (29, self.tr("Number of cells layers in the storage area"))
+ self.texts['dmcont'] = (30, self.tr("Canister diameter"), "m")
+
+
+ self.variables = [
+ ['epregi', self.epregi, 'double'],
+ ['epchem', self.epchem, 'double'],
+ ['jeuchr', self.jeuchr, 'double'],
+ ['nechrg', self.nechrg, 'int'],
+ ['jeurcl', self.jeurcl, 'double'],
+ ['nergrs', self.nergrs, 'int'],
+ ['jeuclr', self.jeuclr, 'double'],
+ ['neclrg', self.neclrg, 'int'],
+ ['jeurch', self.jeurch, 'double'],
+ ['nergch', self.nergch, 'int'],
+ ['hconve', self.hconve, 'double'],
+ ['rconve', self.rconve, 'double'],
+ ['hchali', self.hchali, 'double'],
+ ['hcheva', self.hcheva, 'double'],
+ ['hbdtoi', self.hbdtoi, 'double'],
+ ['hfttoi', self.hfttoi, 'double'],
+ ['neciel', self.neciel, 'int'],
+ ['ptrres', self.ptrres, 'double'],
+ ['nptran', self.nptran, 'int'],
+ ['netran', self.netran, 'int'],
+ ['frdtra', self.frdtra, 'double'],
+ ['plgres', self.plgres, 'double'],
+ ['nplgrs', self.nplgrs, 'int'],
+ ['nelgrs', self.nelgrs, 'int'],
+ ['epchel', self.epchel, 'double'],
+ ['nchest', self.nchest, 'int'],
+ ['dmcont', self.dmcont, 'double']
+ ]
+
+
+ self.rows_disabled = []
+
+ i = 0
+ for variable in self.variables:
+ if variable[2] == 'double':
+ val = self.model.getMatisseGeomDoubleVar(variable[0])
+ elif variable[2] == 'int':
+ val = self.model.getMatisseGeomIntVar(variable[0])
+ else :
+ print variable[2]+": unknown type"
+ sys.exit(1)
+ var = self.variables[i][1]
+ var = val
+ self.variables[i][1] = var
+
+ t = self.model_mat_type.getMatisseType()
+ if variable[0] in ('hfttoi', 'hbdtoi', 'neciel') :
+ if (t == 'vault') or (t == 'djw'):
+ if not i in self.rows_disabled:
+ self.rows_disabled.append(i)
+ elif variable[0] in ('jeuclr', 'neclrg', 'jeurch', 'nergch' ) :
+ if t == 'emm' :
+ if not i in self.rows_disabled:
+ self.rows_disabled.append(i)
+ else :
+ pass
+ i += 1
+
+ self.setRowCount(len(self.variables))
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.DisplayRole:
+ row = index.row()
+ var = self.variables[row][0]
+
+ if index.column() == 0:
+ num = self.texts[var][0]
+ return QVariant(num)
+
+ if index.column() == 1:
+ txt = self.texts[var][1]
+ return QVariant(txt)
+
+ if index.column() == 2:
+ val = self.variables[row][1]
+ return QVariant(val)
+
+ if index.column() == 3:
+ if len(self.texts[var])>2:
+ unit = self.texts[var][2]
+ else:
+ unit = ""
+ return QVariant(unit)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if index.row() in self.rows_disabled:
+ return Qt.ItemIsSelectable
+ if index.column() in [0,1,3]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ #def setData(self, index, value, role):
+ def setData(self, index, value):
+ row = index.row()
+
+ if index.column() == 2:
+ var = self.variables[row][0]
+ typ = self.variables[row][2]
+ if typ == "int":
+ val, ok = value.toInt()
+ elif typ == "double":
+ val, ok = value.toDouble()
+ else:
+ val = 0.
+ # get attribute and set value ???
+ attr = getattr(self, var)
+ attr = val
+ self.variables[row][1] = val
+ self.model.setMatisseGeomVar(var, val)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MatisseGeomView(QWidget, Ui_MatisseGeomForm):
+ """
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MatisseGeomForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+
+ # Create the Page layout.
+
+ self.modelGeom = StandardItemModelGeom(self.case)
+ self.tableView.setModel(self.modelGeom)
+ self.tableView.setAlternatingRowColors(True)
+ self.tableView.resizeColumnsToContents()
+
+## Note: If a delegate has been assigned to both a row and a column,
+## the row delegate (i.e., this delegate) will take presedence and
+## manage the intersecting cell index.
+
+ # First defines a float delegate (i.e. validator) for the entire column ...
+ delegateFloat = LineEditDelegateFloat(self.tableView)
+ self.tableView.setItemDelegateForColumn(2,delegateFloat)
+
+ # ... then define an int delegate for certain rows!
+ delegateInt = LineEditDelegateInt(self.tableView)
+ self.tableView.setItemDelegateForRow(3,delegateInt)
+ self.tableView.setItemDelegateForRow(5,delegateInt)
+ self.tableView.setItemDelegateForRow(7,delegateInt)
+ self.tableView.setItemDelegateForRow(9,delegateInt)
+ self.tableView.setItemDelegateForRow(16,delegateInt)
+ self.tableView.setItemDelegateForRow(18,delegateInt)
+ self.tableView.setItemDelegateForRow(19,delegateInt)
+ self.tableView.setItemDelegateForRow(22,delegateInt)
+ self.tableView.setItemDelegateForRow(23,delegateInt)
+ self.tableView.setItemDelegateForRow(25,delegateInt)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseHydrauForm.ui b/gui/Pages/MatisseHydrauForm.ui
new file mode 100644
index 0000000..b198be9
--- /dev/null
+++ b/gui/Pages/MatisseHydrauForm.ui
@@ -0,0 +1,41 @@
+<ui version="4.0" >
+ <class>MatisseHydrauForm</class>
+ <widget class="QWidget" name="MatisseHydrauForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>557</width>
+ <height>567</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>473</width>
+ <height>425</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>hydraulic load</string>
+ </property>
+ <widget class="QTableView" name="tableView" >
+ <property name="geometry" >
+ <rect>
+ <x>11</x>
+ <y>27</y>
+ <width>451</width>
+ <height>371</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MatisseHydrauModel.py b/gui/Pages/MatisseHydrauModel.py
new file mode 100644
index 0000000..45efc87
--- /dev/null
+++ b/gui/Pages/MatisseHydrauModel.py
@@ -0,0 +1,216 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the storage system type.
+
+This module contains the following classes and function:
+- MatisseHydrauModel
+- MatisseHydrauModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+import Pages.MatisseTypeModel as MatisseType
+
+#-------------------------------------------------------------------------------
+# Matisse Hydraulique model class
+#-------------------------------------------------------------------------------
+
+class MatisseHydrauModel:
+ """
+ Manage the input/output markups in the xml doc about matisse hydraulic load
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_matisse = self.case.root().xmlInitChildNode('matisse')
+ self.node_compute = self.node_matisse.xmlInitChildNode('compute')
+ self.node_phymodel = self.node_compute.xmlInitChildNode('physical_model')
+
+ self.node_cofor = self.node_phymodel.xmlInitChildNode('icofor','status')
+ self.node_conlg = self.node_phymodel.xmlInitChildNode('iconlg','status')
+
+ self.status = ('on', 'off')
+
+
+ def defaultMatisseHydrauValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ #
+ # bool
+ default['icofor'] = 'off'
+ default['iconlg'] = 'off'
+
+ #
+ # double
+ default['debmas'] = 0.
+ default['pdccha'] = 1.7
+ default['pdcfch'] = 0.
+ default['dhchea'] = 1.7
+ default['sdchea'] = 3.2
+ default['pdcche'] = 2.
+ default['pdccch'] = 0.
+ default['dhches'] = 1.2
+ default['sdches'] = 3.82
+ default['pdcalg'] = 0.25
+ default['pdcatv'] = 0.25
+ default['argamt'] = 0.
+ default['pdcslg'] = 0.25
+ default['pdcstv'] = 0.25
+ default['argavl'] = 0.
+ default['amppdc'] = 1.
+ default['dhalve'] = 0.13
+ default['dpvent'] = 0.
+
+ return default
+
+
+ def setMatisseHydrauVar(self, tag, val):
+ """
+ """
+ self.node_phymodel.xmlSetData(tag, val)
+
+
+ def getMatisseHydrauDoubleVar(self, tag):
+ """
+ """
+ val = self.node_phymodel.xmlGetDouble(tag)
+
+ if val == "" or val == None:
+ self.node_phymodel.xmlInitChildNode(tag)
+ val = self.defaultMatisseHydrauValues()[tag]
+ self.setMatisseHydrauVar(tag, val)
+
+ return val
+
+
+ def setConstrainedConvStatus(self, stat):
+ """
+ Input constrained convection status
+ """
+ if stat not in self.status :
+ sys.exit(1)
+
+ self.node_cofor['status'] = stat
+
+
+ def getConstrainedConvStatus(self):
+ """
+ Return constrained convection status
+ """
+ stat = self.node_cofor['status']
+
+ if stat not in self.status :
+ stat = self.defaultMatisseHydrauValues()['icofor']
+ self.setConstrainedConvStatus(stat)
+ return stat
+
+
+ def setInlineContainerNetworkStatus(self, stat):
+ """
+ Input containers network in line status
+ """
+ if stat not in self.status :
+ sys.exit(1)
+
+ self.node_conlg['status'] = stat
+
+
+ def getInlineContainerNetworkStatus(self):
+ """
+ Return containers network in line status
+ """
+ stat = self.node_conlg['status']
+
+ if stat not in self.status :
+ stat = self.defaultMatisseHydrauValues()['iconlg']
+ self.setInlineContainerNetworkStatus(stat)
+ return stat
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
+class MatisseHydrauModelTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+ def checkMatisseHydrauModelInstantiation(self):
+ """Check whether the NOMModel class could be instantiated"""
+ model = None
+ model = MatisseHydrauModel(self.case)
+ assert model != None, 'Could not instantiate MatisseHydrauModel'
+
+
+
+def suite():
+ testSuite = unittest.makeSuite(MatisseHydrauModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "MatisseHydrauModelTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseHydrauView.py b/gui/Pages/MatisseHydrauView.py
new file mode 100644
index 0000000..4080db0
--- /dev/null
+++ b/gui/Pages/MatisseHydrauView.py
@@ -0,0 +1,327 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- MatisseHydrauView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MatisseHydrauForm import Ui_MatisseHydrauForm
+import Base.QtPage as QtPage
+import Pages.MatisseTypeModel as MatisseType
+from MatisseHydrauModel import MatisseHydrauModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MatisseHydrauView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelHydrau(QStandardItemModel):
+
+ def __init__(self, case):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.case = case
+ self.model = MatisseHydrauModel(self.case)
+ self.model_mat_type = MatisseType.MatisseTypeModel(self.case)
+
+ self.setColumnCount(4)
+ self._initData()
+
+
+ def _initData(self):
+
+ # String Var
+ self.icofor = ""
+ self.iconlg = ""
+
+ #
+ # Double Var
+ self.debmas = 0.
+ self.pdccha = 0.
+ self.pdcfch = 0.
+ self.dhchea = 0.
+ self.sdchea = 0.
+ self.pdcche = 0.
+ self.pdccch = 0.
+ self.dhches = 0.
+ self.sdches = 0.
+ self.pdcalg = 0.
+ self.pdcatv = 0.
+ self.argamt = 0.
+ self.pdcslg = 0.
+ self.pdcstv = 0.
+ self.argavl = 0.
+ self.amppdc = 0.
+ self.dhalve = 0.
+ self.dpvent = 0.
+
+ # association between variables and tag
+
+ self.variables = [
+ ['icofor', self.icofor],
+ ['iconlg', self.iconlg],
+ ['debmas', self.debmas],
+ ['pdccha', self.pdccha],
+ ['pdcfch', self.pdcfch],
+ ['dhchea', self.dhchea],
+ ['sdchea', self.sdchea],
+ ['pdcche', self.pdcche],
+ ['pdccch', self.pdccch],
+ ['dhches', self.dhches],
+ ['sdches', self.sdches],
+ ['pdcalg', self.pdcalg],
+ ['pdcatv', self.pdcatv],
+ ['argamt', self.argamt],
+ ['pdcslg', self.pdcslg],
+ ['pdcstv', self.pdcstv],
+ ['argavl', self.argavl],
+ ['amppdc', self.amppdc],
+ ['dhalve', self.dhalve],
+ ['dpvent', self.dpvent]]
+
+ self.texts = {}
+ self.texts['icofor'] = (1, self.tr("Forced hydraulic air circulation regime"))
+ self.texts['iconlg'] = (2, self.tr("Canister network in row (staggered arrangement otherwise)"))
+ self.texts['debmas'] = (3, self.tr("Forced circulation air flow"), "Kg/s")
+ self.texts['pdccha'] = (4, self.tr("Inlet chimney diffuser headloss"))
+ self.texts['pdcfch'] = (5, self.tr("Inlet chimney filter headloss"))
+ self.texts['dhchea'] = (6, self.tr("Inlet chimney hydraulic diameter"), "m")
+ self.texts['sdchea'] = (7, self.tr("Inlet chimney flow area"), "m<sup>2</sup>")
+ self.texts['pdcche'] = (8, self.tr("Outlet chimney diffuser headloss"))
+ self.texts['pdccch'] = (9, self.tr("Outlet chimney valve headloss"))
+ self.texts['dhches'] = (10, self.tr("Outlet chimney hydraulic diameter"), "m")
+ self.texts['sdches'] = (11, self.tr("Outlet chimney flow area"), "m<sup>2</sup>")
+ self.texts['pdcalg'] = (12, self.tr("Upstream inlet door longitudinal headloss"))
+ self.texts['pdcatv'] = (13, self.tr("Upstream inlet door transversal headloss"))
+ self.texts['argamt'] = (14, self.tr("Upstream register incline angle (degree)"), "<sup>o</sup>")
+ self.texts['pdcslg'] = (16, self.tr("Downstream outlet door longitudinal headloss"))
+ self.texts['pdcstv'] = (17, self.tr("Downstream outlet door transversal headloss"))
+ self.texts['argavl'] = (18, self.tr("Downstream register incline angle (degree)"), "<sup>o</sup>")
+ self.texts['amppdc'] = (20, self.tr("Network headloss amplifying factor"))
+ self.texts['dhalve'] = (23, self.tr("Double jacketed wells hydraulic diameter"), "m")
+ self.texts['dpvent'] = (24, self.tr("Inlet/outlet atmospheric pressure difference"), "Pa")
+
+ self.rows_disabled = []
+
+ stat = self.model.getConstrainedConvStatus()
+ self.icofor = stat
+ if not 2 in self.rows_disabled and stat == "off":
+ self.rows_disabled.append(2)
+
+ stat = self.model.getInlineContainerNetworkStatus()
+ self.iconlg = stat
+
+ i = 0
+ for variable in self.variables :
+ if variable[0] not in ['icofor', 'iconlg']:
+ val = self.model.getMatisseHydrauDoubleVar(variable[0])
+ self.variables[i][1] = val
+
+ if variable[0] == 'dhalve' :
+ stat = self.model_mat_type.node_alveo['status']
+ if not i in self.rows_disabled and stat == "off":
+ self.rows_disabled.append(i)
+ i += 1
+
+ self.setRowCount(len(self.variables))
+
+
+ def data(self, index, role):
+
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.DisplayRole:
+ row = index.row()
+
+ if index.column() == 0:
+ var = self.variables[row][0]
+ num = self.texts[var][0]
+ return QVariant(num)
+
+ if index.column() == 1:
+ var = self.variables[row][0]
+ txt = self.texts[var][1]
+ return QVariant(txt)
+
+ if index.column() == 2:
+ var = self.variables[row][0]
+ val = self.variables[row][1]
+ return QVariant(val)
+
+ if index.column() == 3:
+ var = self.variables[row][0]
+ if len(self.texts[var])>2:
+ unit = self.texts[var][2]
+ else:
+ unit = ""
+ return QVariant(unit)
+
+ if role == Qt.CheckStateRole:
+
+ if index.row() == 0 and index.column() == 2:
+ if self.icofor == "on":
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ if index.row() == 1 and index.column() == 2:
+ if self.iconlg == "on":
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if index.row() in self.rows_disabled:
+ return Qt.ItemIsSelectable
+ if index.row() in [0,1] and index.column()== 2:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+ if index.column() in [0,1,3]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def setData(self, index, value, role):
+
+ if index.column() == 2:
+
+ if index.row() == 0: # icofor
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ self.icofor = "off"
+ if not 2 in self.rows_disabled:
+ self.rows_disabled.append(2)
+ else:
+ self.icofor = "on"
+ if 2 in self.rows_disabled:
+ self.rows_disabled.remove(2)
+ self.model.setConstrainedConvStatus(self.icofor)
+
+ elif index.row() == 1: # iconlg
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ self.iconlg = "off"
+ else:
+ self.iconlg = "on"
+ self.model.setInlineContainerNetworkStatus(self.iconlg)
+
+ else:
+ tag = self.variables[index.row()][0]
+ num = self.texts[tag][0]
+ var = self.variables[index.row()][1]
+ v, ok = value.toDouble()
+ var = v
+ self.model.setMatisseHydrauVar(num, v) # ???
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MatisseHydrauView(QWidget, Ui_MatisseHydrauForm):
+ """
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MatisseHydrauForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+
+
+ # Create the Page layout.
+
+ self.modelHydrau = StandardItemModelHydrau(self.case)
+ self.tableView.setModel(self.modelHydrau)
+ self.tableView.setAlternatingRowColors(True)
+ self.tableView.resizeColumnsToContents()
+ self.tableView.setShowGrid(False)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseModel.py b/gui/Pages/MatisseModel.py
new file mode 100644
index 0000000..2aec877
--- /dev/null
+++ b/gui/Pages/MatisseModel.py
@@ -0,0 +1,374 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+"""
+
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+
+import sys, os, shutil, unittest
+import filecmp, os.path
+
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+from Base.Common import *
+from Base.Toolbox import *
+import Pages.BodyForcesModel as BodyForcesModel
+
+
+#-------------------------------------------------------------------------------
+# Global
+#-------------------------------------------------------------------------------
+
+
+class MatisseInit :
+ """
+ This class is called only by XMLmodel for initializing:
+ - Turbulence
+ - Gravity
+ - Initilization zones
+ - Thermal Scalar
+ - Additional scalars
+ - Properties density , thermal_conductivity, molecular_viscosity
+ - MatisseThermicModel
+ - MatisseThermUpdate
+ - MatisseGeomModel
+ """
+ def __init__(self, case):
+
+ self.case = case
+
+ #
+ # save old geom files
+ geomvault = self.case['mesh_path'] +'/vault.geom'
+ geomemm = self.case['mesh_path'] +'/emm.geom'
+ try:
+ shutil.copyfile(geomvault,geomvault+'~')
+ except:
+ try:
+ shutil.copyfile(geomemm,geomemm+'~')
+ except:
+ pass
+
+ #
+ # turbulence
+ import Pages.TurbulenceModel as Turbulence
+ Turbulence.TurbulenceModel(self.case).setTurbulenceModel("off")
+ del Turbulence
+
+ #
+ # gravity
+ model_bodyForce = BodyForcesModel.BodyForcesModel(self.case)
+ model_bodyForce.setGravity('gravity_z', -9.81)
+ model_bodyForce.setHydrostaticPressure('on')
+
+ #
+ # Zones initialization
+ from Pages.LocalizationModel import LocalizationModel, Zone
+ model_zone = LocalizationModel('VolumicZone', self.case)
+ zones =[["zone1","1","0"],["zone2","2","2"],["zone3","3","3"],["zone4","4","4"],
+ ["zone5","5","6"],["zone6","6","7"],["zone7","7","8"],["zone8","8","9"],
+ ["zone9","9","10"]]
+ for i in range(len(zones)):
+ if zones[i][0] not in model_zone.getLabelsZonesList():
+ zone = Zone('VolumicZone',
+ label = zones[i][0],
+ codeNumber = zones[i][1],
+ localization = zones[i][2],
+ nature = 'initialization')
+ model_zone.addZone(zone)
+
+ #
+ # Thermal Scalar
+ import Pages.ThermalScalarModel as ThermalScalar
+ thermal = ThermalScalar.ThermalScalarModel(self.case)
+ thermal.setThermalModel('temperature_celsius')
+ thermal.node_therm.xmlRemoveChild('initial_value')
+
+ #
+ # Additional scalars
+ import Pages.DefineUserScalarsModel as DefineUserScalars
+ temp = DefineUserScalars.DefineUserScalarsModel(self.case)
+
+ t = PageText()
+ for i in range(len(zones)):
+ temp.setScalarValues('T_PeauCol', zones[i][1], 0.0, -1e+12, 1e+12, t.NO_VARIANCE)
+ temp.setScalarDiffusivityChoice('T_PeauCol', 'variable')
+
+ for i in range(len(zones)):
+ temp.setScalarValues('T_PeauMur', zones[i][1], 0.0, -1e+12, 1e+12, t.NO_VARIANCE)
+ temp.setScalarDiffusivityChoice('T_PeauMur', 'variable')
+
+ temp.node_user_sca.xmlRemoveChild('initial_value')
+ temp.node_user_sca.xmlRemoveChild('variance')
+
+ del DefineUserScalars
+
+ #
+ # properties density , thermal_conductivity, molecular_viscosity
+ import Pages.FluidCharacteristicsModel as FluidCharacteristics
+ fluid = FluidCharacteristics.FluidCharacteristicsModel(self.case)
+ fluid.setPropertyMode('density','variable')
+ fluid.setPropertyMode('molecular_viscosity','variable')
+ fluid.setPropertyMode('thermal_conductivity','variable')
+ fluid.setPropertyMode('specific_heat','constant')
+ del FluidCharacteristics
+
+ import Pages.MatisseThermicModel as MatisseThermic
+ model = MatisseThermic.MatisseThermicModel(self.case)
+ tinit = model.getMatisseThermicDoubleVar('tinit')
+ tcrit = model.getMatisseThermicDoubleVar('tcrit')
+ MatisseThermUpdate(self.case, tinit, tcrit).compute()
+ del MatisseThermic
+
+ from Pages.MatisseTypeModel import MatisseTypeModel
+ m = MatisseTypeModel(self.case)
+ m.getMatisseType()
+
+ from Pages.MatisseGeomModel import MatisseGeomModel
+ m = MatisseGeomModel(self.case)
+ m.updateMeshAndProbes()
+
+
+class MatisseThermUpdate :
+ def __init__(self , case, tinit, tcrit):
+
+ self.case = case
+ self.tinit = tinit
+ self.tcrit = tcrit
+
+ def compute(self):
+ """
+ Update XML
+ """
+ #
+ # Additional Scalars (init)
+ import Pages.DefineUserScalarsModel as DefineUserScalars
+ mdl = DefineUserScalars.DefineUserScalarsModel(self.case)
+
+ for node in mdl.node_user_sca.xmlGetNodeList('scalar'):
+ label = node['label']
+ if node['type'] == "thermal":
+ if self.tinit : mdl.setScalarInitialValue("1",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("2",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("3",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("4",label,self.tinit)
+ if self.tcrit : mdl.setScalarInitialValue("5",label,self.tcrit)
+ if self.tinit : mdl.setScalarInitialValue("6",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("7",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("8",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("9",label,self.tinit)
+ else:
+ if self.tinit : mdl.setScalarInitialValue("1",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("2",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("3",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("4",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("5",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("6",label,self.tinit)
+ if self.tcrit : mdl.setScalarInitialValue("7",label,self.tcrit)
+ if self.tinit : mdl.setScalarInitialValue("8",label,self.tinit)
+ if self.tinit : mdl.setScalarInitialValue("9",label,self.tinit)
+ del DefineUserScalars
+
+
+class MatisseMeshRunning :
+ """
+ """
+ def __init__(self, case):
+ """
+ """
+ self.case = case
+ self.ok = True
+ #
+ # update node <solution_domain> in XML file
+ node_preprocessor = self.case.root().xmlGetNode('solution_domain')
+ node_meshes_list= node_preprocessor.xmlInitChildNode('meshes_list')
+ mesh_nodes = node_meshes_list.xmlGetNodeList('mesh', 'name')
+
+ if len(mesh_nodes) == 1:
+ try:
+ desFile = mesh_nodes[0]['name']
+ geomFile = desFile.split(".")[0]+'.geom'
+ datFile = desFile.split(".")[0]+'.dat'
+ except:
+ print "MatisseMeshRunning: see the node mesh"
+ sys.exit(1)
+
+ #
+ # Files
+ newGeom = self.case['mesh_path'] + '/' + geomFile
+ oldGeom = self.case['mesh_path'] + '/' + geomFile + '~'
+
+ oldDes = self.case['mesh_path'] + '/' + desFile
+ datFile = self.case['mesh_path'] + '/' + datFile
+
+ #
+ # Checks
+ simail = False
+ if not os.path.isfile(newGeom) or \
+ not os.path.isfile(datFile) or \
+ not os.path.isfile(oldDes) :
+
+ import Pages.MatisseGeomModel as MatisseGeom
+ MatisseGeom.MatisseGeomModel(self.case).updateMeshAndProbes()
+ del MatisseGeom
+ simail = True
+
+ else :
+ if not os.path.isfile(oldGeom) :
+ simail = True
+ else:
+ if not filecmp.cmp(oldGeom, newGeom):
+ simail = True
+
+ #
+ # Simail
+ if simail:
+ if os.path.isfile(oldDes) :
+ os.remove(oldDes)
+ newDes = oldDes
+ shutil.copyfile(newGeom, oldGeom)
+ os.chdir(self.case['mesh_path'])
+ cmd = "xsimail -b " + datFile + " | tee " + self.case['case_path'] + "/RESU/listsim"
+ os.system(cmd)
+ os.chdir(self.case['case_path'])
+ if not os.path.isfile(newDes) :
+ self.ok = False
+
+ else :
+ print "MatisseMeshRunning: see meshes_list"
+ sys.exit(1)
+
+#-------------------------------------------------------------------------------
+# Page text class
+#-------------------------------------------------------------------------------
+
+class PageText:
+ """
+ Storage of all texts and messages for this page.
+ """
+ def __init__(self):
+ if GuiParam.lang == 'fr':
+ self.NO_VARIANCE = "no"
+ else:
+ self.NO_VARIANCE = "no"
+
+
+#-------------------------------------------------------------------------------
+# Matisse Init test class
+#-------------------------------------------------------------------------------
+
+class MatisseInitTestCase(unittest.TestCase):
+ """
+ """
+## def setUp(self):
+## """This method is executed before all "check" methods."""
+## from Base.XMLengine import Case, XMLDocument
+## from Base.XMLinitialize import XMLinit
+## GuiParam.lang = 'en'
+## self.case = Case(None)
+## XMLinit(self.case)
+## self.doc = XMLDocument()
+##
+## def tearDown(self):
+## """This method is executed after all "check" methods."""
+## del self.case
+## del self.doc
+##
+## def xmlNodeFromString(self, string):
+## """Private method to return a xml node from string"""
+## return self.doc.parseString(string).root()
+##
+## def checkMatisseInstantiation(self):
+## """Check whether the NOMModel class could be instantiated"""
+## model = None
+## model = MatisseInit(self.case)
+## assert model != None, 'Could not instantiate MatisseInit'
+
+
+#-------------------------------------------------------------------------------
+# Matisse ThermUpdate test class
+#-------------------------------------------------------------------------------
+
+class MatisseThermUpdateTestCase(unittest.TestCase):
+ """
+ """
+## def setUp(self):
+## """This method is executed before all "check" methods."""
+## from Base.XMLengine import Case, XMLDocument
+## from Base.XMLinitialize import XMLinit
+## GuiParam.lang = 'en'
+## self.case = Case(None)
+## XMLinit(self.case)
+## self.doc = XMLDocument()
+##
+## def tearDown(self):
+## """This method is executed after all "check" methods."""
+## del self.case
+## del self.doc
+##
+## def xmlNodeFromString(self, string):
+## """Private method to return a xml node from string"""
+## return self.doc.parseString(string).root()
+##
+## def checkMatisseThermUpdateInstantiation(self):
+## """Check whether the NOMModel class could be instantiated"""
+## model = None
+## model = MatisseThermUpdate(self.case, '0','0')
+## assert model != None, 'Could not instantiate MatisseThermUpdate'
+
+
+def suite1():
+ testSuite = unittest.makeSuite(MatisseInitTestCase, "check")
+ return testSuite
+
+def suite2():
+ testSuite = unittest.makeSuite(MatisseThermUpdateTestCase, "check")
+ return testSuite
+
+def runTest():
+ runner = unittest.TextTestRunner()
+
+ print "MatisseInitTestCase: - A FAIRE************"
+ runner.run(suite1())
+
+ print "MatisseThermUpdateTestCase: - A FAIRE************"
+ runner.run(suite2())
+
+
+
\ No newline at end of file
diff --git a/gui/Pages/MatisseNetworkForm.ui b/gui/Pages/MatisseNetworkForm.ui
new file mode 100644
index 0000000..6868df9
--- /dev/null
+++ b/gui/Pages/MatisseNetworkForm.ui
@@ -0,0 +1,213 @@
+<ui version="4.0" >
+ <class>MatisseNetworkForm</class>
+ <widget class="QWidget" name="MatisseNetworkForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>626</width>
+ <height>660</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>30</y>
+ <width>601</width>
+ <height>571</height>
+ </rect>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Parameters</string>
+ </attribute>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>40</y>
+ <width>562</width>
+ <height>120</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>Thermal load</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_1" >
+ <property name="text" >
+ <string>Height of canisters network (in cells)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEdit_hreso1" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="labelTo_1" >
+ <property name="text" >
+ <string>----></string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QLineEdit" name="lineEdit2_1" />
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLabel" name="labelUnit_1" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Height max of double jacketed wells (in cells)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEdit_hreso2" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelTo_2" >
+ <property name="text" >
+ <string>----></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QLineEdit" name="lineEdit2_2" />
+ </item>
+ <item row="1" column="4" >
+ <widget class="QLabel" name="labelUnit_2" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Height min of double jacketed wells (in cells)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="labelTo_3" >
+ <property name="text" >
+ <string>----></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3" >
+ <widget class="QLineEdit" name="lineEdit2_3" />
+ </item>
+ <item row="2" column="4" >
+ <widget class="QLabel" name="labelUnit_3" >
+ <property name="text" >
+ <string>m</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEdit_hplen" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Canisters network</string>
+ </attribute>
+ <widget class="QTabWidget" name="tabWidget_2" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>551</width>
+ <height>501</height>
+ </rect>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab_3" >
+ <attribute name="title" >
+ <string>Line</string>
+ </attribute>
+ <widget class="MatisseCustomView" native="1" name="widgetLine" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>521</width>
+ <height>451</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_4" >
+ <attribute name="title" >
+ <string>Row</string>
+ </attribute>
+ <widget class="MatisseCustomView" native="1" name="widgetRow" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>511</width>
+ <height>441</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MatisseCustomView</class>
+ <extends>QWidget</extends>
+ <header>MatisseCustomView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MatisseNetworkModel.py b/gui/Pages/MatisseNetworkModel.py
new file mode 100644
index 0000000..4d999d0
--- /dev/null
+++ b/gui/Pages/MatisseNetworkModel.py
@@ -0,0 +1,272 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the storage system type.
+
+This module contains the following classes and function:
+- MatisseNetworkModel
+- MatisseNetworwTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+import Pages.MatisseTypeModel as MatisseType
+import Pages.MatisseGeomModel as MatisseGeom
+
+#-------------------------------------------------------------------------------
+# Matisse thermic class
+#-------------------------------------------------------------------------------
+
+class MatisseNetworkModel:
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_matisse = self.case.root().xmlInitChildNode('matisse')
+ self.node_compute = self.node_matisse.xmlInitChildNode('compute')
+ self.node_phymodel = self.node_compute.xmlInitChildNode('physical_model')
+
+ #
+ # Vars Filters
+ self.node_map = self.node_compute.xmlInitChildNode('map')
+ self.node_hl = self.node_map.xmlInitChildNode('headloss')
+ self.node_network = self.node_hl.xmlInitChildNode('network')
+ self.node_line = self.node_network.xmlInitChildNode('line')
+ self.node_row = self.node_network.xmlInitChildNode('row')
+
+ self.list_line_area = self.node_line.xmlGetNodeList('area','label')
+ self.list_row_area = self.node_row.xmlGetNodeList('area','label')
+
+
+ def defaultMatisseNetworkValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+
+ #
+ # double
+ modelgeom = MatisseGeom.MatisseGeomModel(self.case)
+ hreso = modelgeom.getMatisseGeomDoubleVar('nchest')
+ step = modelgeom.getMatisseGeomDoubleVar('epchel')
+
+ default['nbcellreso'] = hreso
+ default['nbcellplen'] = 0.
+ default['hreso'] = hreso*step
+ default['hplen'] = 0.
+
+ return default
+
+
+ def SetArea(self, areatype, num, label, bmin, bmax):
+ """
+ Add to the XML doc the new values.
+ """
+ if areatype == 'line':
+ if label: self.list_line_area[num]['label'] = label
+ if bmin: self.list_line_area[num].xmlSetData('min',bmin)
+ if bmax: self.list_line_area[num].xmlSetData('max',bmax)
+ elif areatype == 'row':
+ if label: self.list_row_area[num]['label'] = label
+ if bmin: self.list_row_area[num].xmlSetData('min',bmin)
+ if bmax: self.list_row_area[num].xmlSetData('max',bmax)
+ else :
+ print areatype, ": Unknown area type"
+ sys.exit(1)
+
+
+ def NewArea(self, areatype, label, bmin, bmax):
+ """
+ Add to the XML doc the new values.
+ """
+
+ if areatype == 'line':
+ node = self.node_line.xmlAddChild('area', label=label)
+ elif areatype == 'row':
+ node = self.node_row.xmlAddChild('area', label=label)
+ else :
+ print areatype + ": Unknown area type"
+ sys.exit(1)
+
+ node.xmlAddChild('min').xmlSetTextNode(bmin)
+ node.xmlAddChild('max').xmlSetTextNode(bmax)
+
+ if areatype == 'line':
+ self.list_line_area.append(node)
+ elif areatype == 'row':
+ self.list_row_area.append(node)
+ else :
+ print areatype + ": Unknown area type"
+ sys.exit(1)
+
+
+ def GetArea(self, areatype, num):
+ """
+ Get area Values.
+ """
+ if areatype == 'line':
+ label = self.list_line_area[num]['label']
+ bmin = self.list_line_area[num].xmlGetString('min')
+ bmax = self.list_line_area[num].xmlGetString('max')
+ elif areatype == 'row':
+ label = self.list_row_area[num]['label']
+ bmin = self.list_row_area[num].xmlGetString('min')
+ bmax = self.list_row_area[num].xmlGetString('max')
+ elif areatype == 'height':
+ label = self.list_height_area[num]['label']
+ bmin = self.list_height_area[num].xmlGetString('min')
+ bmax = self.list_height_area[num].xmlGetString('max')
+ else :
+ print "GetArea" + areatype + " : Unknown area type"
+ sys.exit(1)
+
+ return label, bmin, bmax
+
+
+ def GetAreas(self, areatype):
+ """
+ Get areas Values.
+ """
+ llabel=[]
+ lbmin=[]
+ lbmax=[]
+
+ if areatype == 'line':
+ nodes_nb = len(self.list_line_area)
+ elif areatype == 'row':
+ nodes_nb = len(self.list_row_area)
+ else :
+ print "GetAreas '" + areatype + "': Unknown area type"
+ sys.exit(1)
+
+ for i in range(0,nodes_nb):
+ label, bmin, bmax = self.GetArea(areatype, i)
+ llabel.append(label)
+ lbmin.append(bmin)
+ lbmax.append(bmax)
+
+ return llabel, lbmin, lbmax
+
+
+ def EraseArea(self, areatype, num):
+ """
+ Remove Area.
+ """
+ if areatype == 'line':
+ node = self.list_line_area.pop(num)
+ elif areatype == 'row':
+ node = self.list_row_area.pop(num)
+ else :
+ print "EraseErea" + areatype, " : Unknown area type"
+ sys.exit(1)
+
+ node.xmlRemoveChild('min')
+ node.xmlRemoveChild('max')
+ node.xmlRemoveNode()
+
+
+ def setMatisseNetworkVar(self, tag, val):
+ """
+ """
+ if tag.find('reso') >= 0:
+ tag = tag[:-1]
+ self.node_phymodel.xmlSetData(tag, val)
+
+
+ def getMatisseNetworkDoubleVar(self, tag):
+ """
+ """
+ if tag.find('reso') >= 0:
+ tagtmp = tag[:-1]
+ else:
+ tagtmp = tag
+ val = self.node_phymodel.xmlGetDouble(tagtmp)
+
+ if val == "" or val == None:
+ self.node_phymodel.xmlInitChildNode(tagtmp)
+ val = self.defaultMatisseNetworkValues()[tagtmp]
+ self.setMatisseNetworkVar(tag, val)
+
+ return val
+
+#-------------------------------------------------------------------------------
+# MatisseNetwork Model Test Class
+#-------------------------------------------------------------------------------
+
+class MatisseNetworkModelTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+ def checkMatisseNetworkModelInstantiation(self):
+ """Check whether the NOMModel class could be instantiated"""
+ model = None
+ model = MatisseNetworkModel(self.case)
+ assert model != None, 'Could not instantiate MatisseNetworkModel'
+
+def suite():
+ testSuite = unittest.makeSuite(MatisseNetworkModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "MatisseNetworkModelTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseNetworkView.py b/gui/Pages/MatisseNetworkView.py
new file mode 100644
index 0000000..9f00238
--- /dev/null
+++ b/gui/Pages/MatisseNetworkView.py
@@ -0,0 +1,218 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- MatisseNetworkView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MatisseNetworkForm import Ui_MatisseNetworkForm
+import Base.QtPage as QtPage
+import Pages.MatisseTypeModel as MatisseType
+import Pages.MatisseGeomModel as MatisseGeom
+from Pages.MatisseNetworkModel import MatisseNetworkModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MatisseNetworkView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MatisseNetworkView(QWidget, Ui_MatisseNetworkForm):
+ """
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MatisseNetworkForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+
+ self.model = MatisseNetworkModel(self.case)
+
+ model_geom = MatisseGeom.MatisseGeomModel(self.case)
+## self.lineStep = model_geom.getMatisseGeomDoubleVar('ptrres')
+## self.rowStep = model_geom.getMatisseGeomDoubleVar('plgres')
+ self.heightStep = model_geom.getMatisseGeomDoubleVar('epchel')
+## self.lineMax = model_geom.getMatisseGeomDoubleVar('nptran')
+## self.rowMax = model_geom.getMatisseGeomDoubleVar('nplgrs')
+## self.heightMax = model_geom.getMatisseGeomDoubleVar('nchest')
+
+ model_mat_type = MatisseType.MatisseTypeModel(self.case)
+ self.alveoStat = model_mat_type.node_alveo['status']
+
+
+ # Create the Page layout.
+ self.widgetLine.initWidget(self.case, "network_line")
+ self.widgetRow.initWidget(self.case, "network_row")
+ # Connections
+ self.connect(self.lineEdit_hreso1,
+ SIGNAL("textChanged(const QString &)"),
+ self.getMatisseNetworkVar_hreso1)
+
+ self.connect(self.lineEdit_hreso2,
+ SIGNAL("textChanged(const QString &)"),
+ self.getMatisseNetworkVar_hreso2)
+
+ self.connect(self.lineEdit_hplen,
+ SIGNAL("textChanged(const QString &)"),
+ self.getMatisseNetworkVar_hplen)
+
+ # Validators
+ validator_hreso1 = QtPage.DoubleValidator(
+ self.lineEdit_hreso1, "validator_hreso1")
+
+ validator_hreso2 = QtPage.DoubleValidator(
+ self.lineEdit_hreso2, "validator_hreso2")
+
+ validator_hplen = QtPage.DoubleValidator(
+ self.lineEdit_hplen, "validator_hplen")
+
+ self.lineEdit_hreso1.setValidator(validator_hreso1)
+ self.lineEdit_hreso2.setValidator(validator_hreso2)
+ self.lineEdit_hplen.setValidator(validator_hplen)
+
+ # initialize
+
+ invStat = 'on'
+ if self.alveoStat == 'on' :
+ invStat = 'off'
+
+ self.nbcellreso1 = self.model.getMatisseNetworkDoubleVar('nbcellreso1')
+ self.nbcellreso2 = self.model.getMatisseNetworkDoubleVar('nbcellreso2')
+ self.nbcellplen = self.model.getMatisseNetworkDoubleVar('nbcellplen')
+
+ self.lineEdit_hreso1.setText(QString(str(self.nbcellreso1)))
+ self.lineEdit_hreso2.setText(QString(str(self.nbcellreso2)))
+ self.lineEdit_hplen.setText(QString(str(self.nbcellplen)))
+
+ self.hreso1 = self.heightStep * self.nbcellreso1
+ self.hreso2 = self.heightStep * self.nbcellreso2
+ self.hplen = self.heightStep * self.nbcellplen
+
+ self.model.setMatisseNetworkVar('hreso1', self.hreso1)
+ self.model.setMatisseNetworkVar('hreso2', self.hreso2)
+ self.model.setMatisseNetworkVar('hplen', self.hplen)
+
+ self.lineEdit2_1.setText(QString(str(self.hreso1)))
+ self.lineEdit2_2.setText(QString(str(self.hreso2)))
+ self.lineEdit2_3.setText(QString(str(self.hplen)))
+
+
+ if invStat == "off":
+ self.lineEdit_hreso1.setDisabled(True)
+
+ if self.alveoStat == "off":
+ self.lineEdit_hreso2.setDisabled(True)
+ self.lineEdit_hplen.setDisabled(True)
+
+
+ self.lineEdit2_1.setDisabled(True)
+ self.lineEdit2_2.setDisabled(True)
+ self.lineEdit2_3.setDisabled(True)
+
+
+ def getMatisseNetworkVar_hreso1(self):
+ """
+ Input thermiclic load variable.
+ """
+ self.nbcellreso1, ok = self.lineEdit_hreso1.text().toFloat()
+ self.model.setMatisseNetworkVar('nbcellreso1', self.nbcellreso1)
+ val = float(self.nbcellreso1) * self.heightStep
+ self.model.setMatisseNetworkVar('hreso1', val)
+
+
+ def getMatisseNetworkVar_hreso2(self):
+ """
+ Input thermiclic load variable.
+ """
+ self.nbcellreso2, ok = self.lineEdit_hreso2.text().toFloat()
+ self.model.setMatisseNetworkVar('nbcellreso2', self.nbcellreso2)
+ val = float(self.nbcellreso2) * self.heightStep
+ self.model.setMatisseNetworkVar('hreso2', val)
+
+
+ def getMatisseNetworkVar_hplen(self):
+ """
+ Input thermiclic load variable.
+ """
+ self.nbcellplen, ok = self.lineEdit_hplen.text().toFloat()
+ self.model.setMatisseNetworkVar('nbcellplen', self.nbcellplen)
+ val = float(self.nbcellplen) * self.heightStep
+ self.model.setMatisseNetworkVar('hplen', val)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseRangeDescriptionForm.ui b/gui/Pages/MatisseRangeDescriptionForm.ui
new file mode 100644
index 0000000..9e7634e
--- /dev/null
+++ b/gui/Pages/MatisseRangeDescriptionForm.ui
@@ -0,0 +1,69 @@
+<ui version="4.0" >
+ <class>MatisseRangeDescriptionForm</class>
+ <widget class="QWidget" name="MatisseRangeDescriptionForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>588</width>
+ <height>742</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>30</y>
+ <width>541</width>
+ <height>551</height>
+ </rect>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Line</string>
+ </attribute>
+ <widget class="MatisseCustomView" native="1" name="widgetLine" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>511</width>
+ <height>501</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Height</string>
+ </attribute>
+ <widget class="MatisseCustomView" native="1" name="widgetHeight" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>521</width>
+ <height>501</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MatisseCustomView</class>
+ <extends>QWidget</extends>
+ <header>MatisseCustomView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MatisseRangeDescriptionModel.py b/gui/Pages/MatisseRangeDescriptionModel.py
new file mode 100644
index 0000000..a4d25a6
--- /dev/null
+++ b/gui/Pages/MatisseRangeDescriptionModel.py
@@ -0,0 +1,229 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the storage system type.
+
+This module contains the following classes and function:
+- MatisseRangeDescriptionModel
+- MatisseRangeDescriptionTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+import Pages.MatisseTypeModel as MatisseType
+import Pages.MatisseGeomModel as MatisseGeom
+
+
+#-------------------------------------------------------------------------------
+# Matisse RangeDescription Model class
+#-------------------------------------------------------------------------------
+
+
+class MatisseRangeDescriptionModel :
+ """
+ Manage the input/output markups in the xml doc about matisse thermiclic load
+ """
+ def __init__(self, case, rangeType):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_matisse = self.case.root().xmlInitChildNode('matisse')
+ self.node_compute = self.node_matisse.xmlInitChildNode('compute')
+
+ #
+ # Vars Filters
+ self.node_map = self.node_compute.xmlInitChildNode('map')
+ self.node_hl = self.node_map.xmlInitChildNode('headloss')
+ self.node_range = self.node_hl.xmlInitChildNode(rangeType)
+ self.node_line = self.node_range.xmlInitChildNode('line')
+ self.node_height = self.node_range.xmlInitChildNode('height')
+
+ self.list_line_area = self.node_line.xmlGetNodeList('area','label')
+ self.list_height_area = self.node_height.xmlGetNodeList('area','label')
+
+
+ def SetArea(self, areatype, num, label, bmin, bmax):
+ """
+ Add to the XML doc the new values.
+ """
+ if areatype == 'line' :
+ if label: self.list_line_area[num]['label'] = label
+ if bmin: self.list_line_area[num].xmlSetData('min',bmin)
+ if bmax: self.list_line_area[num].xmlSetData('max',bmax)
+ elif areatype == 'height' :
+ if label: self.list_height_area[num]['label'] = label
+ if bmin: self.list_height_area[num].xmlSetData('min',bmin)
+ if bmax: self.list_height_area[num].xmlSetData('max',bmax)
+ else :
+ print areatype, " : Unknown area type"
+ sys.exit(1)
+
+
+ def NewArea(self, areatype, label, bmin, bmax):
+ """
+ Add to the XML doc the new values.
+ """
+
+ if areatype == 'line' :
+ node = self.node_line.xmlAddChild('area', label=label)
+ elif areatype == 'height' :
+ node = self.node_height.xmlAddChild('area', label=label)
+ else :
+ print areatype + " : Unknown area type"
+ sys.exit(1)
+
+ node.xmlAddChild('min').xmlSetTextNode(bmin)
+ node.xmlAddChild('max').xmlSetTextNode(bmax)
+
+ if areatype == 'line' :
+ self.list_line_area.append(node)
+ elif areatype == 'height' :
+ self.list_height_area.append(node)
+ else :
+ print areatype + " : Unknown area type"
+ sys.exit(1)
+
+
+ def GetArea(self, areatype, num):
+ """
+ Get area Values.
+ """
+ if areatype == 'line' :
+ label = self.list_line_area[num]['label']
+ bmin = self.list_line_area[num].xmlGetString('min')
+ bmax = self.list_line_area[num].xmlGetString('max')
+ elif areatype == 'height' :
+ label = self.list_height_area[num]['label']
+ bmin = self.list_height_area[num].xmlGetString('min')
+ bmax = self.list_height_area[num].xmlGetString('max')
+ else :
+ print "GetArea" + areatype + " : Unknown area type"
+ sys.exit(1)
+
+ return label, bmin, bmax
+
+
+ def GetAreas(self, areatype):
+ """
+ Get areas Values.
+ """
+ llabel=[]
+ lbmin=[]
+ lbmax=[]
+
+ if areatype == 'line' :
+ nodes_nb = len(self.list_line_area)
+ elif areatype == 'height' :
+ nodes_nb = len(self.list_height_area)
+ else :
+ print "GetAreas '" + areatype + "' : Unknown area type"
+ sys.exit(1)
+
+ for i in range(0,nodes_nb) :
+ label, bmin, bmax = self.GetArea(areatype, i)
+ llabel.append(label)
+ lbmin.append(bmin)
+ lbmax.append(bmax)
+
+ return llabel, lbmin, lbmax
+
+
+ def EraseArea(self, areatype, num):
+ """
+ Remove Area.
+ """
+ if areatype == 'line' :
+ node = self.list_line_area.pop(num)
+ elif areatype == 'height' :
+ node = self.list_height_area.pop(num)
+ else :
+ print "EraseErea" + areatype, " : Unknown area type"
+ sys.exit(1)
+
+ node.xmlRemoveChild('min')
+ node.xmlRemoveChild('max')
+ node.xmlRemoveNode()
+
+
+#-------------------------------------------------------------------------------
+# MatisseRangeDescription Model Test class
+#-------------------------------------------------------------------------------
+class MatisseRangeDescriptionModelTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+ def checkMatisseRangeDescriptionModelInstantiation(self):
+ """Check whether the MatisseRangeDescriptionModel class could be instantiated"""
+ model = None
+ model = MatisseRangeDescriptionModel(self.case, 'inlet_range')
+ assert model != None, 'Could not instantiate MatisseRangeDescriptionModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(MatisseRangeDescriptionModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "MatisseRangeDescriptionModelTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseRangeDescriptionView.py b/gui/Pages/MatisseRangeDescriptionView.py
new file mode 100644
index 0000000..369591b
--- /dev/null
+++ b/gui/Pages/MatisseRangeDescriptionView.py
@@ -0,0 +1,110 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- MatisseRangeDescriptionView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MatisseRangeDescriptionForm import Ui_MatisseRangeDescriptionForm
+import Base.QtPage as QtPage
+
+import Pages.MatisseGeomModel as MatisseGeom
+from Pages.MatisseRangeDescriptionModel import MatisseRangeDescriptionModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MatisseRangeDescriptionView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MatisseRangeDescriptionView(QWidget, Ui_MatisseRangeDescriptionForm):
+ """
+ """
+ def __init__(self, parent, case, rangeType):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MatisseRangeDescriptionForm.__init__(self)
+ self.setupUi(self)
+
+ self.rangeType = rangeType
+ self.case = case
+
+ # Create the Page layout.
+ if self.rangeType == "inlet_range":
+ self.widgetLine.initWidget(self.case, "inlet_range_line")
+ self.widgetHeight.initWidget(self.case, "inlet_range_height")
+ if self.rangeType == "outlet_range":
+ self.widgetLine.initWidget(self.case, "outlet_range_line")
+ self.widgetHeight.initWidget(self.case, "outlet_range_height")
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseThermicForm.ui b/gui/Pages/MatisseThermicForm.ui
new file mode 100644
index 0000000..16f6081
--- /dev/null
+++ b/gui/Pages/MatisseThermicForm.ui
@@ -0,0 +1,130 @@
+<ui version="4.0" >
+ <class>MatisseThermicForm</class>
+ <widget class="QWidget" name="MatisseThermicForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>675</width>
+ <height>685</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>30</x>
+ <y>40</y>
+ <width>531</width>
+ <height>531</height>
+ </rect>
+ </property>
+ <property name="currentIndex" >
+ <number>1</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Parameters</string>
+ </attribute>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>503</width>
+ <height>425</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>Thermal load</string>
+ </property>
+ <widget class="QTableView" name="tableView" >
+ <property name="geometry" >
+ <rect>
+ <x>11</x>
+ <y>27</y>
+ <width>481</width>
+ <height>371</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Canisters network</string>
+ </attribute>
+ <widget class="QTabWidget" name="tabWidget_2" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>501</width>
+ <height>461</height>
+ </rect>
+ </property>
+ <property name="currentIndex" >
+ <number>2</number>
+ </property>
+ <widget class="QWidget" name="tab_line" >
+ <attribute name="title" >
+ <string>Line</string>
+ </attribute>
+ <widget class="MatisseCustomView" native="1" name="widgetLine" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>481</width>
+ <height>421</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_row" >
+ <attribute name="title" >
+ <string>Row</string>
+ </attribute>
+ <widget class="MatisseCustomView" native="1" name="widgetRow" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>481</width>
+ <height>421</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_height" >
+ <attribute name="title" >
+ <string>Height</string>
+ </attribute>
+ <widget class="MatisseCustomView" native="1" name="widgetHeight" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>481</width>
+ <height>421</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MatisseCustomView</class>
+ <extends>QWidget</extends>
+ <header>MatisseCustomView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MatisseThermicModel.py b/gui/Pages/MatisseThermicModel.py
new file mode 100644
index 0000000..8b5deb0
--- /dev/null
+++ b/gui/Pages/MatisseThermicModel.py
@@ -0,0 +1,405 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the storage system type.
+
+This module contains the following classes and function:
+- MatisseThermicModel
+- MatisseThermicModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+import Pages.MatisseTypeModel as MatisseType
+import Pages.MatisseGeomModel as MatisseGeom
+
+#-------------------------------------------------------------------------------
+# Matisse thermic class
+#-------------------------------------------------------------------------------
+
+class MatisseThermicModel:
+ """
+ Manage the input/output markups in the xml doc about matisse thermiclic load
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_matisse = self.case.root().xmlInitChildNode('matisse')
+ self.node_compute = self.node_matisse.xmlInitChildNode('compute')
+ self.node_phymodel = self.node_compute.xmlInitChildNode('physical_model')
+
+ self.node_mdcnt = self.node_phymodel.xmlInitChildNode('imdcnt','status')
+
+ self.status = ('on',
+ 'off')
+
+ #
+ # Vars Filters
+ self.node_map = self.node_compute.xmlInitChildNode('map')
+ self.node_th_cp = self.node_map.xmlInitChildNode('thermal_capacity')
+ self.node_line = self.node_th_cp.xmlInitChildNode('line')
+ self.node_row = self.node_th_cp.xmlInitChildNode('row')
+ self.node_height = self.node_th_cp.xmlInitChildNode('height')
+
+ self.list_line_area = self.node_line.xmlGetNodeList('area','label')
+ self.list_line_min = self.node_line.xmlGetNodeList('min')
+ self.list_line_max = self.node_line.xmlGetNodeList('max')
+ self.list_line_value = self.node_line.xmlGetNodeList('value')
+
+ self.list_row_area = self.node_row.xmlGetNodeList('area','label')
+ self.list_row_min = self.node_row.xmlGetNodeList('min')
+ self.list_row_max = self.node_row.xmlGetNodeList('max')
+ self.list_row_value = self.node_row.xmlGetNodeList('value')
+
+ self.list_height_area = self.node_height.xmlGetNodeList('area','label')
+ self.list_height_min = self.node_height.xmlGetNodeList('min')
+ self.list_height_max = self.node_height.xmlGetNodeList('max')
+ self.list_height_value = self.node_height.xmlGetNodeList('value')
+
+
+ def defaultMatisseThermicValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+
+ #
+ # bool
+ default['imdcnt']='off'
+
+ #
+ # double
+ default['puicon'] = 1000.
+ default['tinit'] = 20.
+ default['tcrit'] = 80.
+ default['emicon'] = 0.4
+ default['emimur'] = 0.8
+ default['hepcnt'] = 6.
+ default['dhpcnt'] = 0.
+
+ #
+ # Vars Filters
+ default['maplabel'] = 'default'
+ default['maplmin'] = 0.
+ default['maprmin'] = 0.
+ default['maphmin'] = 0.
+ default['maplmax'] = 0.
+ default['maprmax'] = 0.
+ default['maphmax'] = 0.
+ default['maplval'] = 1.
+ default['maprval'] = 1.
+ default['maphval'] = 1.
+
+ return default
+
+
+ def SetArea(self, areatype, num, label, bmin, bmax, val):
+ """
+ Add to the XML doc the new values.
+ """
+ if areatype == 'line' :
+ if label: self.list_line_area[num]['label'] = label
+ if bmin: self.list_line_area[num].xmlSetData('min',bmin)
+ if bmax: self.list_line_area[num].xmlSetData('max',bmax)
+ if val: self.list_line_area[num].xmlSetData('value',val)
+ elif areatype == 'row' :
+ if label: self.list_row_area[num]['label'] = label
+ if bmin: self.list_row_area[num].xmlSetData('min',bmin)
+ if bmax: self.list_row_area[num].xmlSetData('max',bmax)
+ if val: self.list_row_area[num].xmlSetData('value',val)
+ elif areatype == 'height' :
+ if label: self.list_height_area[num]['label'] = label
+ if bmin: self.list_height_area[num].xmlSetData('min',bmin)
+ if bmax: self.list_height_area[num].xmlSetData('max',bmax)
+ if val: self.list_height_area[num].xmlSetData('value',val)
+ else :
+ print areatype, " : Unknown area type"
+ sys.exit(1)
+
+
+ def NewArea(self, areatype, label, bmin, bmax, val):
+ """
+ Add to the XML doc the new values.
+ """
+ dlabel, dmin, dmax, dval = self.DefaultArea(areatype)
+
+ if areatype == 'line' :
+ if label :
+ node = self.node_line.xmlAddChild('area', label=label)
+ else :
+ node = self.node_line.xmlAddChild('area', label=dlabel)
+ elif areatype == 'row' :
+ if label :
+ node = self.node_row.xmlAddChild('area', label=label)
+ else :
+ node = self.node_row.xmlAddChild('area', label=dlabel)
+ elif areatype == 'height' :
+ if label :
+ node = self.node_height.xmlAddChild('area', label=label)
+ else :
+ node = self.node_height.xmlAddChild('area', label=dlabel)
+ else :
+ print areatype + " : Unknown area type"
+ sys.exit(1)
+
+ nmin = node.xmlAddChild('min')
+ nmax = node.xmlAddChild('max')
+ nval = node.xmlAddChild('value')
+
+ if bmin != None and bmin != "":
+ nmin.xmlSetTextNode(bmin)
+ else:
+ nmin.xmlSetTextNode(dmin)
+ if bmax != None and bmax != "":
+ nmax.xmlSetTextNode(bmax)
+ else:
+ nmax.xmlSetTextNode(dmax)
+ if val != None and val != "":
+ nval.xmlSetTextNode(val)
+ else:
+ nval.xmlSetTextNode(dval)
+
+ if areatype == 'line' :
+ self.list_line_area.append(node)
+ elif areatype == 'row' :
+ self.list_row_area.append(node)
+ elif areatype == 'height' :
+ self.list_height_area.append(node)
+ else :
+ print areatype + " : Unknown area type"
+ sys.exit(1)
+
+
+ def DefaultArea(self,areatype):
+ """
+ Return default values of a area
+ """
+ modelgeom = MatisseGeom.MatisseGeomModel(self.case)
+ dlabel = "default"
+ dmin = 0
+ dval = 1.0
+
+ if areatype == 'line' :
+ dmax = modelgeom.getMatisseGeomDoubleVar('nptran')
+ elif areatype == 'row' :
+ dmax = modelgeom.getMatisseGeomDoubleVar('nplgrs')
+ elif areatype == 'height' :
+ dmax = modelgeom.getMatisseGeomDoubleVar('nchest')
+ else :
+ print "DefaultArea" + areatype + " : Unknown area type"
+ sys.exit(1)
+
+ return dlabel, dmin, dmax, dval
+
+
+ def GetArea(self, areatype, num):
+ """
+ Get area Values.
+ """
+ if areatype == 'line' :
+ label = self.list_line_area[num]['label']
+ bmin = self.list_line_area[num].xmlGetString('min')
+ bmax = self.list_line_area[num].xmlGetString('max')
+ val = self.list_line_area[num].xmlGetString('value')
+ elif areatype == 'row' :
+ label = self.list_row_area[num]['label']
+ bmin = self.list_row_area[num].xmlGetString('min')
+ bmax = self.list_row_area[num].xmlGetString('max')
+ val = self.list_row_area[num].xmlGetString('value')
+ elif areatype == 'height' :
+ label = self.list_height_area[num]['label']
+ bmin = self.list_height_area[num].xmlGetString('min')
+ bmax = self.list_height_area[num].xmlGetString('max')
+ val = self.list_height_area[num].xmlGetString('value')
+ else :
+ print "GetArea" + areatype + " : Unknown area type"
+ sys.exit(1)
+
+ return label, bmin, bmax, val
+
+
+ def GetAreas(self, areatype):
+ """
+ Get areas Values.
+ """
+ llabel=[]
+ lbmin=[]
+ lbmax=[]
+ lval=[]
+
+ if areatype == 'line' :
+ nodes_nb = len(self.list_line_area)
+ elif areatype == 'row' :
+ nodes_nb = len(self.list_row_area)
+ elif areatype == 'height' :
+ nodes_nb = len(self.list_height_area)
+ else :
+ print "GetAreas '" + areatype + "' : Unknown area type"
+ sys.exit(1)
+
+ for i in range(0,nodes_nb) :
+ label, bmin, bmax, val = self.GetArea(areatype, i)
+ llabel.append(label)
+ lbmin.append(bmin)
+ lbmax.append(bmax)
+ lval.append(val)
+
+ return llabel, lbmin, lbmax, lval
+
+
+ def EraseArea(self, areatype, num):
+ """
+ Remove Area.
+ """
+ if areatype == 'line' :
+ node = self.list_line_area.pop(num)
+ elif areatype == 'row' :
+ node = self.list_row_area.pop(num)
+ elif areatype == 'height' :
+ node = self.list_height_area.pop(num)
+ else :
+ print "EraseErea" + areatype, " : Unknown area type"
+ sys.exit(1)
+
+ node.xmlRemoveChild('min')
+ node.xmlRemoveChild('max')
+ node.xmlRemoveChild('value')
+ node.xmlRemoveNode()
+
+
+ def setMatisseThermicVar(self, tag, val):
+ """
+ """
+ self.node_phymodel.xmlSetData(tag, val)
+
+ tinit = None
+ tcrit = None
+
+ if tag == 'tinit':
+ tinit = val
+ elif tag == 'tcrit':
+ tcrit = val
+
+ import Pages.MatisseModel as Matisse
+ Matisse.MatisseThermUpdate(self.case,tinit,tcrit).compute()
+ del Matisse
+
+
+ def getMatisseThermicDoubleVar(self,tag):
+ """
+ """
+ val = self.node_phymodel.xmlGetDouble(tag)
+
+ if val == "" or val == None:
+ self.node_phymodel.xmlInitChildNode(tag)
+ val = self.defaultMatisseThermicValues()[tag]
+ self.setMatisseThermicVar(tag, val)
+
+ return val
+
+
+ def setNatConvPanacheStatus(self, stat):
+ """
+ Input natural convection panache status
+ """
+ if stat not in self.status :
+ sys.exit(1)
+
+ self.node_mdcnt['status'] = stat
+
+
+ def getNatConvPanacheStatus(self):
+ """
+ Return natural convection panache status
+ """
+ stat = self.node_mdcnt['status']
+
+ if stat not in self.status :
+ stat = self.defaultMatisseThermicValues()['imdcnt']
+ self.setNatConvPanacheStatus(stat)
+ return stat
+
+
+#-------------------------------------------------------------------------------
+# MatisseThermic Model Test class
+#-------------------------------------------------------------------------------
+class MatisseThermicModelTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+ def checkMatisseThermicModelInstantiation(self):
+ """Check whether the MatisseThermicModel class could be instantiated"""
+ model = None
+ model = MatisseThermicModel(self.case)
+ assert model != None, 'Could not instantiate MatisseThermicModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(MatisseThermicModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "MatisseThermicModelTestCase - A FAIRE**************"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseThermicView.py b/gui/Pages/MatisseThermicView.py
new file mode 100644
index 0000000..d524d68
--- /dev/null
+++ b/gui/Pages/MatisseThermicView.py
@@ -0,0 +1,279 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- MatisseThermicView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MatisseThermicForm import Ui_MatisseThermicForm
+import Base.QtPage as QtPage
+from Pages.MatisseThermicModel import MatisseThermicModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MatisseThermicView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelThermic(QStandardItemModel):
+
+ def __init__(self, case):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.case = case
+ self.setColumnCount(4)
+ self.model = MatisseThermicModel(self.case)
+ self._initData()
+
+
+ def _initData(self):
+
+ # String Var
+ self.imdcnt = ""
+
+ # Double Var
+ self.puicon = 0.
+ self.tinit = 0.
+ self.tcrit = 0.
+ self.emicon = 0.
+ self.emimur = 0.
+ self.hepcnt = 0.
+ self.dhpcnt = 0.
+
+ self.variables = [
+ ['imdcnt', self.imdcnt],
+ ['puicon', self.puicon],
+ ['tinit' , self.tinit],
+ ['tcrit' , self.tcrit],
+ ['emicon', self.emicon],
+ ['emimur', self.emimur],
+ ['hepcnt', self.hepcnt],
+ ['dhpcnt', self.dhpcnt]]
+
+ self.texts = {}
+ self.texts['imdcnt'] = (1, self.tr("Natural convection plume modelling"))
+ self.texts['puicon'] = (2, self.tr("Canister heating power"), "W")
+ self.texts['tinit'] = (3, self.tr("Inlet air temperature"), "<sup>o</sup>C")
+ self.texts['tcrit'] = (4, self.tr("Critical outlet air temperature"), "<sup>o</sup>C")
+ self.texts['emicon'] = (5, self.tr("Canister emissivity"))
+ self.texts['emimur'] = (6, self.tr("Wall emissivity"))
+ self.texts['hepcnt'] = (8, self.tr("Natural convection plume erosion height"), "m")
+ self.texts['dhpcnt'] = (9, self.tr("Natural convection plume heat flowrate"), "W")
+
+ self.rows_disabled = []
+
+ stat = self.model.getNatConvPanacheStatus()
+ self.imdcnt = stat
+
+ if stat == "off":
+ if not 5 in self.rows_disabled : self.rows_disabled.append(5)
+ if not 6 in self.rows_disabled : self.rows_disabled.append(6)
+
+ idx = 0
+ for variable in self.variables:
+ if variable[0] != 'imdcnt':
+ val = self.model.getMatisseThermicDoubleVar(variable[0])
+ self.variables[idx][1] = val
+ idx += 1
+
+ self.setRowCount(len(self.variables))
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.DisplayRole:
+ row = index.row()
+ var = self.variables[row][0]
+
+ if index.column() == 0:
+ num = self.texts[var][0]
+ return QVariant(num)
+
+ if index.column() == 1:
+ txt = self.texts[var][1]
+ return QVariant(txt)
+
+ if index.column() == 2:
+ val = self.variables[row][1]
+ return QVariant(val)
+
+ if index.column() == 3:
+ if len(self.texts[var])>2:
+ unit = self.texts[var][2]
+ else:
+ unit = ""
+ return QVariant(unit)
+
+ if role == Qt.CheckStateRole:
+ if index.row() == 0 and index.column() == 2:
+ if self.imdcnt == "on":
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if index.row() in self.rows_disabled:
+ return Qt.ItemIsSelectable
+ if index.row() == 0 and index.column() == 2:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+ if index.column() in [0,1,3]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def setData(self, index, value, role):
+ row = index.row()
+
+ if index.column() == 2:
+
+ if index.row() == 1: # imdcnt
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ self.imdcnt = "off"
+ if not 5 in self.rows_disabled : self.rows_disabled.append(5)
+ if not 6 in self.rows_disabled : self.rows_disabled.append(6)
+ else:
+ self.imdcnt = "on"
+ if 5 in self.rows_disabled : self.rows_disabled.remove(5)
+ if 6 in self.rows_disabled : self.rows_disabled.remove(6)
+ self.model.setNatConvPanacheStatus(self.imdcnt)
+
+ else:
+ tag = self.variables[row][0]
+ num = self.texts[tag][0]
+ var = self.variables[row][1]
+ v, ok = value.toDouble()
+ var = v
+ self.model.setMatisseThermicVar(tag,var)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MatisseThermicView(QWidget, Ui_MatisseThermicForm):
+ """
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MatisseThermicForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+
+ # Create the Page layout.
+
+ self.modelThermic = StandardItemModelThermic(self.case)
+ self.tableView.setModel(self.modelThermic)
+ self.tableView.resizeColumnsToContents()
+
+ self.widgetLine.initWidget(self.case, "thermal_line")
+ self.widgetRow.initWidget(self.case, "thermal_row")
+ self.widgetHeight.initWidget(self.case, "thermal_height")
+
+
+## def _initModel(self):
+## """
+## Instantiate the matisse type modelling class.
+## """
+## self.model = MatisseThermicModel(self.case)
+## self.model_mat_type = MatisseType.MatisseTypeModel(self.case)
+## model_geom = MatisseGeom.MatisseGeomModel(self.case)
+## self.lineStep = model_geom.getMatisseGeomDoubleVar('ptrres')
+## self.rowStep = model_geom.getMatisseGeomDoubleVar('plgres')
+## self.heightStep = model_geom.getMatisseGeomDoubleVar('epchel')
+
+## self.lineMax = model_geom.getMatisseGeomDoubleVar('nptran')
+## self.rowMax = model_geom.getMatisseGeomDoubleVar('nplgrs')
+## self.heightMax = model_geom.getMatisseGeomDoubleVar('nchest')
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseTypeForm.ui b/gui/Pages/MatisseTypeForm.ui
new file mode 100644
index 0000000..9b81381
--- /dev/null
+++ b/gui/Pages/MatisseTypeForm.ui
@@ -0,0 +1,47 @@
+<ui version="4.0" >
+ <class>MatisseTypeForm</class>
+ <widget class="QWidget" name="MatisseTypeForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>505</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="geometry" >
+ <rect>
+ <x>30</x>
+ <y>20</y>
+ <width>431</width>
+ <height>142</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>Storage concept</string>
+ </property>
+ <widget class="QComboBox" name="comboBoxType" >
+ <property name="geometry" >
+ <rect>
+ <x>60</x>
+ <y>60</y>
+ <width>311</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MatisseTypeModel.py b/gui/Pages/MatisseTypeModel.py
new file mode 100644
index 0000000..db4a594
--- /dev/null
+++ b/gui/Pages/MatisseTypeModel.py
@@ -0,0 +1,163 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the storage system type.
+
+This module contains the following classes and function:
+- MatisseTypeModel
+- MatisseTypeModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+
+#-------------------------------------------------------------------------------
+# Turbulence model class
+#-------------------------------------------------------------------------------
+
+class MatisseTypeModel:
+ def __init__(self, case):
+ self.case = case
+ self.node_matisse= self.case.root().xmlInitChildNode('matisse')
+ self.node_compute= self.node_matisse.xmlInitChildNode('compute')
+ self.node_geom = self.node_compute.xmlInitChildNode('geometry')
+ self.node_phys = self.node_compute.xmlInitChildNode('physical_model')
+
+ self.node_type = self.node_geom.xmlInitChildNode('typent', 'label')
+ self.node_alveo = self.node_phys.xmlInitChildNode('ialveo', 'status')
+
+ self.matisseTypes = ('vault', 'emm','djw')
+
+
+ def defaultMatisseTypeValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['typent'] = 'vault'
+ return default
+
+
+ def setMatisseType(self, matisse_type):
+ """
+ Input storage matisse type
+ """
+ if matisse_type not in self.matisseTypes :
+ print "MatisseTypeModel: error with the storage concept list"
+ sys.exit(1)
+
+ if matisse_type == 'djw' :
+ self.node_type['label'] = 'vault'
+ self.node_alveo['status'] = 'on'
+ else :
+ self.node_alveo['status'] = 'off'
+ self.node_type['label'] = matisse_type
+
+
+ def getMatisseType(self):
+ """
+ Return the storage matisse type
+ """
+ if self.node_alveo['status'] == 'on' :
+ if self.node_type['label'] != 'vault':
+ print "MatisseTypeModel: error with the storage concept input"
+ sys.exit(1)
+ matisse_type = 'djw'
+ else :
+ matisse_type = self.node_type['label']
+
+ if matisse_type not in self.matisseTypes :
+ matisse_type = self.defaultMatisseTypeValues()['typent']
+ self.setMatisseType(matisse_type)
+ return matisse_type
+
+
+
+#-------------------------------------------------------------------------------
+# MatisseTypeTestCase test case
+#-------------------------------------------------------------------------------
+
+
+class MatisseTypeTestCase(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """This method is executed before all "check" methods."""
+ from Base.XMLengine import Case, XMLDocument
+ from Base.XMLinitialize import XMLinit
+ Tool.GuiParam.lang = 'en'
+ self.case = Case(None)
+ XMLinit(self.case)
+ self.doc = XMLDocument()
+
+ def tearDown(self):
+ """This method is executed after all "check" methods."""
+ del self.case
+ del self.doc
+
+ def xmlNodeFromString(self, string):
+ """Private method to return a xml node from string"""
+ return self.doc.parseString(string).root()
+
+
+
+ def checkMatisseTypeInstantiation(self):
+ """
+ Check whether the TurbulenceModel class could be instantiated
+ """
+ model = None
+ model = MatisseTypeModel(self.case)
+ assert model != None, 'Could not instantiate MatisseTypeModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(MatisseTypeTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "MatisseTypeTestCase - A FAIRE*****"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MatisseTypeView.py b/gui/Pages/MatisseTypeView.py
new file mode 100644
index 0000000..d68291f
--- /dev/null
+++ b/gui/Pages/MatisseTypeView.py
@@ -0,0 +1,128 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- MatisseTypeView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MatisseTypeForm import Ui_MatisseTypeForm
+from MatisseTypeModel import MatisseTypeModel
+import Base.QtPage as QtPage
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MatisseTypeView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MatisseTypeView(QWidget, Ui_MatisseTypeForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MatisseTypeForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+
+ self.model = MatisseTypeModel(self.case)
+
+ # Create the Page layout.
+ # Combo model
+ self.modelType = QtPage.ComboModel(self.comboBoxType,3,1)
+ self.modelType.addItem(self.tr("Vault"), 'vault')
+ self.modelType.addItem(self.tr("Cask storage"), 'emm')
+ self.modelType.addItem(self.tr("Double jacketed wells"), 'djw')
+
+ self.connect(self.comboBoxType,
+ SIGNAL("activated(const QString&)"),
+ self.getMatisseType)
+
+ # initialize
+
+ t = self.model.getMatisseType()
+ self.modelType.setItem(str_model=t)
+
+
+ def getMatisseType(self):
+ """
+ Input Storage matisse type.
+ """
+ t = self.modelType.dicoV2M[str(self.comboBoxType.currentText())]
+ self.model.setMatisseType(t)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MemoryAllocationForm.ui b/gui/Pages/MemoryAllocationForm.ui
new file mode 100644
index 0000000..39fef80
--- /dev/null
+++ b/gui/Pages/MemoryAllocationForm.ui
@@ -0,0 +1,336 @@
+<ui version="4.0" >
+ <class>MemoryAllocationForm</class>
+ <widget class="QWidget" name="MemoryAllocationForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>348</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Integer array</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Main integer work array = </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditIDIMLS" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_6" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditICEL" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="label_2" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NCELET</string>
+ </property>
+ <property name="text" >
+ <string>x Number of cells with halo</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_9" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditIFAC" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="label_3" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFAC</string>
+ </property>
+ <property name="text" >
+ <string>x Number of interior faces</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_10" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditIFABOR" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" >
+ <widget class="QLabel" name="label_4" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFABOR</string>
+ </property>
+ <property name="text" >
+ <string>x Number of boundary faces</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Real array</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Main real work array= </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditRDIMLS" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_11" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditRCEL" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelRCEL" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NCELET</string>
+ </property>
+ <property name="text" >
+ <string>x Number of cells with halo</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_12" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditRFAC" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="label_7" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFAC</string>
+ </property>
+ <property name="text" >
+ <string>x Number of interior faces</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_13" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditRFABOR" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" >
+ <widget class="QLabel" name="label_8" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFABOR</string>
+ </property>
+ <property name="text" >
+ <string>x Number of boundary faces</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MemoryAllocationModel.py b/gui/Pages/MemoryAllocationModel.py
new file mode 100644
index 0000000..2a7ee64
--- /dev/null
+++ b/gui/Pages/MemoryAllocationModel.py
@@ -0,0 +1,357 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- MemoryAllocationModel
+- MemoryAllocationTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+
+#-------------------------------------------------------------------------------
+# Memory allocation model class
+#-------------------------------------------------------------------------------
+
+class MemoryAllocationModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Integer and real memory allocation
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ self.node_calcul = self.case.xmlGetNode('calcul_management')
+ self.node_int = self.node_calcul.xmlInitNode('integer_work_array')
+ self.node_real = self.node_calcul.xmlInitNode('real_work_array')
+
+
+ def defaultValues(self):
+ """
+ Return reference values by default
+ """
+ default = {}
+ default['icel'] = 0
+ default['ifac'] = 0
+ default['ifab'] = 0
+ default['idls'] = 0
+ default['rcel'] = 0
+ default['rfac'] = 0
+ default['rfab'] = 0
+ default['rdls'] = 0
+ return default
+
+
+ def setIntegerNcelet(self, value):
+ """
+ Set number of cells with halo into integer work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('ncelet', value)
+
+
+ def setIntegerNfac(self, value):
+ """
+ Set number of internal faces into integer work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('nfac', value)
+
+
+ def setIntegerNfabor(self, value):
+ """
+ Set number of boundary faces into integer work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('nfabor', value)
+
+
+ def setIntegerDimless(self, value):
+ """
+ Set integer value for integer work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('dimless', value)
+
+
+ def setRealNcelet(self, value):
+ """
+ Set number of cells with halo into real work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('ncelet', value)
+
+
+ def setRealNfac(self, value):
+ """
+ Set number of internal faces into real work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('nfac', value)
+
+
+ def setRealNfabor(self, value):
+ """
+ Set number of boundary faces into real work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('nfabor', value)
+
+
+ def setRealDimless(self, value):
+ """
+ Set integer value into real work's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('dimless', value)
+
+
+ def getIntegerNcelet(self):
+ """
+ Return number of cells with halo from integer work's array.
+ """
+ value = self.node_int.xmlGetInt('ncelet')
+ if value == None:
+ value = self.defaultValues()['icel']
+ self.setIntegerNcelet(value)
+ return value
+
+
+ def getIntegerNfac(self):
+ """
+ Return number of cells with halo from integer work's array.
+ """
+ value = self.node_int.xmlGetInt('nfac')
+ if value == None:
+ value = self.defaultValues()['ifac']
+ return value
+
+
+ def getIntegerNfabor(self):
+ """
+ Return number of cells with halo from integer work's array.
+ """
+ value = self.node_int.xmlGetInt('nfabor')
+ if value == None:
+ value = self.defaultValues()['ifab']
+ return value
+
+
+ def getIntegerDimless(self):
+ """
+ Return number of cells with halo from integer work's array.
+ """
+ value = self.node_int.xmlGetInt('dimless')
+ if value == None:
+ value = self.defaultValues()['idls']
+ return value
+
+
+ def getRealNcelet(self):
+ """
+ Return number of cells with halo from real work's array.
+ """
+ value = self.node_real.xmlGetInt('ncelet')
+ if value == None:
+ value = self.defaultValues()['rcel']
+ return value
+
+
+ def getRealNfac(self):
+ """
+ Return number of cells with halo from real work's array.
+ """
+ value = self.node_real.xmlGetInt('nfac')
+ if value == None:
+ value = self.defaultValues()['rfac']
+ return value
+
+
+ def getRealNfabor(self):
+ """
+ Return number of cells with halo from real work's array.
+ """
+ value = self.node_real.xmlGetInt('nfabor')
+ if value == None:
+ value = self.defaultValues()['rfab']
+ return value
+
+
+ def getRealDimless(self):
+ """
+ Return number of cells with halo from real work's array.
+ """
+ value = self.node_real.xmlGetInt('dimless')
+ if value == None:
+ value = self.defaultValues()['rdls']
+ return value
+
+
+#-------------------------------------------------------------------------------
+# MemoryAllocationModel test case
+#-------------------------------------------------------------------------------
+
+class MemoryAllocationTestCase(ModelTest):
+ """
+ """
+ def checkMemoryAllocationInstantiation(self):
+ """Check whether the MemoryAllocationModel class could be instantiated"""
+ model = None
+ model = MemoryAllocationModel(self.case)
+ assert model != None, 'Could not instantiate MemoryAllocationModel'
+
+ def checkGetandSetIntegerNcelet(self):
+ """Check whether the integer ncelet memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setIntegerNcelet(111)
+ doc = '''<integer_work_array>
+ <ncelet>111</ncelet>
+ </integer_work_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer ncelet memory allocation model'
+ assert mdl.getIntegerNcelet() == 111,\
+ 'Could not get integer ncelet memory allocation model'
+
+ def checkGetandSetIntegerNfac(self):
+ """Check whether the integer nfac memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setIntegerNfac(211)
+ doc = '''<integer_work_array>
+ <nfac>211</nfac>
+ </integer_work_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer nfac memory allocation model'
+ assert mdl.getIntegerNfac() == 211,\
+ 'Could not get integer nfac memory allocation model'
+
+ def checkGetandSetIntegerNfabor(self):
+ """Check whether the integer nfabor memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setIntegerNfabor(33)
+ doc = '''<integer_work_array>
+ <nfabor>33</nfabor>
+ </integer_work_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer nfabor memory allocation model'
+ assert mdl.getIntegerNfabor() == 33,\
+ 'Could not get integer nfabor memory allocation model'
+
+ def checkGetandSetIntegerDimless(self):
+ """Check whether the integer dimless memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setIntegerDimless(10)
+ doc = '''<integer_work_array>
+ <dimless>10</dimless>
+ </integer_work_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer dimless memory allocation model'
+ assert mdl.getIntegerDimless() == 10,\
+ 'Could not get integer dimless memory allocation model'
+
+ def checkGetandSetRealNcelet(self):
+ """Check whether the real ncelet memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setRealNcelet(999)
+ doc = '''<real_work_array>
+ <ncelet>999</ncelet>
+ </real_work_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real ncelet memory allocation model'
+ assert mdl.getRealNcelet() == 999,\
+ 'Could not get real ncelet memory allocation model'
+
+ def checkGetandSetRealNfac(self):
+ """Check whether the real nfac memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setRealNfac(988)
+ doc = '''<real_work_array>
+ <nfac>988</nfac>
+ </real_work_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real nfac memory allocation model'
+ assert mdl.getRealNfac() == 988,\
+ 'Could not get real nfac memory allocation model'
+
+ def checkGetandSetRealNfabor(self):
+ """Check whether the real nfabor memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setRealNfabor(977)
+ doc = '''<real_work_array>
+ <nfabor>977</nfabor>
+ </real_work_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real nfabor memory allocation model'
+ assert mdl.getRealNfabor() == 977,\
+ 'Could not get real nfabor memory allocation model'
+
+ def checkGetandSetRealDimless(self):
+ """Check whether the real dimless memory allocation model could be set"""
+ mdl = MemoryAllocationModel(self.case)
+ mdl.setRealDimless(966)
+ doc = '''<real_work_array>
+ <dimless>966</dimless>
+ </real_work_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real dimless memory allocation model'
+ assert mdl.getRealDimless() == 966,\
+ 'Could not get real dimless memory allocation model'
+
+
+
+
+
+def suite():
+ testSuite = unittest.makeSuite(MemoryAllocationTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "MemoryAllocationTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MemoryAllocationView.py b/gui/Pages/MemoryAllocationView.py
new file mode 100644
index 0000000..0abcd9c
--- /dev/null
+++ b/gui/Pages/MemoryAllocationView.py
@@ -0,0 +1,236 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- MemoryAllocationView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MemoryAllocationForm import Ui_MemoryAllocationForm
+import Base.QtPage as QtPage
+from Pages.MemoryAllocationModel import MemoryAllocationModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MemoryAllocationView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main View class
+#-------------------------------------------------------------------------------
+
+class MemoryAllocationView(QWidget, Ui_MemoryAllocationForm):
+ """
+ Class to open Memory allocation Page.
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MemoryAllocationForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = MemoryAllocationModel(self.case)
+
+ # Connections
+
+ self.connect(self.lineEditICEL, SIGNAL("textChanged(const QString &)"), self.slotICEL)
+ self.connect(self.lineEditRCEL, SIGNAL("textChanged(const QString &)"), self.slotRCEL)
+ self.connect(self.lineEditIFAC, SIGNAL("textChanged(const QString &)"), self.slotIFAC)
+ self.connect(self.lineEditRFAC, SIGNAL("textChanged(const QString &)"), self.slotRFAC)
+ self.connect(self.lineEditIFABOR, SIGNAL("textChanged(const QString &)"), self.slotIFABOR)
+ self.connect(self.lineEditRFABOR, SIGNAL("textChanged(const QString &)"), self.slotRFABOR)
+ self.connect(self.lineEditIDIMLS, SIGNAL("textChanged(const QString &)"), self.slotIDIMLS)
+ self.connect(self.lineEditRDIMLS, SIGNAL("textChanged(const QString &)"), self.slotRDIMLS)
+
+ # Validators
+
+ validatorICEL = QtPage.IntValidator(self.lineEditICEL, min=0)
+ validatorRCEL = QtPage.IntValidator(self.lineEditRCEL, min=0)
+ validatorIFAC = QtPage.IntValidator(self.lineEditIFAC, min=0)
+ validatorRFAC = QtPage.IntValidator(self.lineEditRFAC, min=0)
+ validatorIFABOR = QtPage.IntValidator(self.lineEditIFABOR, min=0)
+ validatorRFABOR = QtPage.IntValidator(self.lineEditRFABOR, min=0)
+ validatorIDIMLS = QtPage.IntValidator(self.lineEditIDIMLS, min=0)
+ validatorRDIMLS = QtPage.IntValidator(self.lineEditRDIMLS, min=0)
+
+ self.lineEditICEL.setValidator(validatorICEL)
+ self.lineEditRCEL.setValidator(validatorRCEL)
+ self.lineEditIFAC.setValidator(validatorIFAC)
+ self.lineEditRFAC.setValidator(validatorRFAC)
+ self.lineEditIFABOR.setValidator(validatorIFABOR)
+ self.lineEditRFABOR.setValidator(validatorRFABOR)
+ self.lineEditIDIMLS.setValidator(validatorIDIMLS)
+ self.lineEditRDIMLS.setValidator(validatorRDIMLS)
+
+ # Initialization
+
+ icel = self.mdl.getIntegerNcelet()
+ ifac = self.mdl.getIntegerNfac()
+ ifabor = self.mdl.getIntegerNfabor()
+ idimls = self.mdl.getIntegerDimless()
+
+ rcel = self.mdl.getRealNcelet()
+ rfac = self.mdl.getRealNfac()
+ rfabor = self.mdl.getRealNfabor()
+ rdimls = self.mdl.getRealDimless()
+
+ self.lineEditICEL.setText(QString(str(icel)))
+ self.lineEditIFAC.setText(QString(str(ifac)))
+ self.lineEditIFABOR.setText(QString(str(ifabor)))
+ self.lineEditIDIMLS.setText(QString(str(idimls)))
+
+ self.lineEditRCEL.setText(QString(str(rcel)))
+ self.lineEditRFAC.setText(QString(str(rfac)))
+ self.lineEditRFABOR.setText(QString(str(rfabor)))
+ self.lineEditRDIMLS.setText(QString(str(rdimls)))
+
+
+ @pyqtSignature("const QString&")
+ def slotICEL(self, text):
+ """
+ Input number of cells with halo for integer array.
+ """
+ icel, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerNcelet(icel)
+
+
+ @pyqtSignature("const QString&")
+ def slotRCEL(self, text):
+ """
+ Input number of cells with halo for real array.
+ """
+ rcel, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealNcelet(rcel)
+
+
+ @pyqtSignature("const QString&")
+ def slotIFAC(self, text):
+ """
+ Input number of internal faces for integer array.
+ """
+ ifac, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerNfac(ifac)
+
+
+ @pyqtSignature("const QString&")
+ def slotRFAC(self, text):
+ """
+ Input number of internal faces for real array.
+ """
+ rfac, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealNfac(rfac)
+
+
+ @pyqtSignature("const QString&")
+ def slotIFABOR(self, text):
+ """
+ Input number of boundary faces for integer array.
+ """
+ ifabor, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerNfabor(ifabor)
+
+
+ @pyqtSignature("const QString&")
+ def slotRFABOR(self, text):
+ """
+ Input number of boundary faces for real array.
+ """
+ rfabor, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealNfabor(rfabor)
+
+
+ @pyqtSignature("const QString&")
+ def slotIDIMLS(self, text):
+ """
+ Input integer value for integer array.
+ """
+ idimls, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerDimless(idimls)
+
+
+ @pyqtSignature("const QString&")
+ def slotRDIMLS(self, text):
+ """
+ Input integer value for real array.
+ """
+ rdimls, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealDimless(rdimls)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MeshQualityCriteriaLogDialogForm.ui b/gui/Pages/MeshQualityCriteriaLogDialogForm.ui
new file mode 100644
index 0000000..f2d598e
--- /dev/null
+++ b/gui/Pages/MeshQualityCriteriaLogDialogForm.ui
@@ -0,0 +1,90 @@
+<ui version="4.0" >
+ <class>MeshQualityCriteriaLogDialogForm</class>
+ <widget class="QDialog" name="MeshQualityCriteriaLogDialogForm" >
+ <property name="windowModality" >
+ <enum>Qt::NonModal</enum>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>700</width>
+ <height>800</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="logText" >
+ <property name="font" >
+ <font>
+ <family>Courier New</family>
+ <pointsize>10</pointsize>
+ </font>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton" >
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>pushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MeshQualityCriteriaLogDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>350</x>
+ <y>775</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>349</x>
+ <y>399</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/MobileMeshForm.ui b/gui/Pages/MobileMeshForm.ui
new file mode 100644
index 0000000..ae369bf
--- /dev/null
+++ b/gui/Pages/MobileMeshForm.ui
@@ -0,0 +1,256 @@
+<ui version="4.0" >
+ <class>MobileMeshForm</class>
+ <widget class="QWidget" name="MobileMeshForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>229</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxALE" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ <property name="acceptDrops" >
+ <bool>false</bool>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>false</bool>
+ </property>
+ <property name="title" >
+ <string>Mobile mesh (ALE method)</string>
+ </property>
+ <property name="flat" >
+ <bool>false</bool>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>10</width>
+ <height>140</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelNALINF" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NALINF</string>
+ </property>
+ <property name="text" >
+ <string>Number of iterations for fluid initialization</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2" colspan="2" >
+ <widget class="QLineEdit" name="lineEditNALINF" >
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NALINF</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelVISCOSITY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IORTVM</string>
+ </property>
+ <property name="text" >
+ <string>Type of the viscosity of mesh</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" colspan="2" >
+ <widget class="QComboBox" name="comboBoxVISCOSITY" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IORTVM</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelUSVISMA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: EPALIM</string>
+ </property>
+ <property name="text" >
+ <string>Spatial distribution of
+the viscosity of the mesh</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>34</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" colspan="2" >
+ <widget class="QComboBox" name="comboBoxMEI" />
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Formula for the viscosity of mesh</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>18</width>
+ <height>29</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="2" >
+ <widget class="QPushButton" name="pushButtonFormula" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3" >
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>10</width>
+ <height>140</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/MobileMeshModel.py b/gui/Pages/MobileMeshModel.py
new file mode 100644
index 0000000..8789425
--- /dev/null
+++ b/gui/Pages/MobileMeshModel.py
@@ -0,0 +1,438 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- MobileMeshModel
+- MobileMeshTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+from Pages.OutputControlModel import OutputControlModel
+
+#-------------------------------------------------------------------------------
+# Mobil Mesh model class
+#-------------------------------------------------------------------------------
+
+class MobileMeshModel(Model):
+ """
+ Manage the input/output markups in the xml doc about mobil mesh
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_ale = self.node_models.xmlInitChildNode('ale_method', 'status')
+
+ self.out = OutputControlModel(self.case)
+
+
+ def __defaultInitialValues(self):
+ """
+ Return in a dictionnary which contains default values.
+ """
+ default = {}
+ default['nalinf' ] = 0
+ default['iortvm' ] = 'isotrop'
+ default['mei' ] = 'user_subroutine'
+ default['formula_isotrop'] = 'mesh_vi1=0;'
+ default['formula_orthotrop'] = 'mesh_vi1=0;\nmesh_vi2=0;\nmesh_vi3=0;'
+ default['ale_method'] = 'off'
+
+ return default
+
+
+ def __setVariablesandProperties(self):
+ """
+ Set variables and properties if ALE method is activated.
+ """
+ self.node_ale.xmlInitChildNode('variable', name='mesh_velocity_U', label='mesh_u')
+ self.node_ale.xmlInitChildNode('variable', name='mesh_velocity_V', label='mesh_v')
+ self.node_ale.xmlInitChildNode('variable', name='mesh_velocity_W', label='mesh_w')
+ self.node_ale.xmlInitChildNode('property', name='mesh_viscosity_1', label='mesh_vi1')
+
+ # find node for property / choice and set to default value if require
+ node = self.node_ale.xmlGetChildNode('property', name='mesh_viscosity_1')
+ if not node['choice']:
+ node['choice'] = self.__defaultInitialValues()['mei']
+
+ self.__updateNodeViscosity()
+
+
+ def __updateNodeViscosity(self):
+ """
+ Update properties beyond mesh visosity is isotrope or not.
+ """
+ if self.getViscosity() == 'orthotrop':
+ self.node_ale.xmlInitChildNode('property', name='mesh_viscosity_2', label='mesh_vi2')
+ self.node_ale.xmlInitChildNode('property', name='mesh_viscosity_3', label='mesh_vi3')
+
+ # find choice for mesh_viscosity_1, create default value if require
+ node = self.node_ale.xmlGetChildNode('property', name='mesh_viscosity_1')
+ if not node['choice']:
+ node['choice'] = self.__defaultInitialValues()['mei']
+ mei = node['choice']
+
+ # Syncrhonize other properties
+ for n in ('mesh_viscosity_2', 'mesh_viscosity_3'):
+ node = self.node_ale.xmlGetChildNode('property', name=n)
+ node['choice'] = mei
+
+ else:
+ node1 = self.node_ale.xmlGetChildNode('property', name='mesh_viscosity_2')
+ node2 = self.node_ale.xmlGetChildNode('property', name='mesh_viscosity_3')
+
+ if node1:
+ node1.xmlRemoveNode()
+ if node2:
+ node2.xmlRemoveNode()
+
+
+ def __removeVariablesandProperties(self):
+ """
+ Remove variables and properties if ALE method is disabled.
+ """
+ self.node_ale.xmlRemoveChild('variable')
+ self.node_ale.xmlRemoveChild('property')
+
+## def setMethod(self, answer):
+## """
+## Set method of activation of ALE into xml file.
+## """
+## self.isOnOff(answer)
+## typ = ''
+## typ = self.out.getTypePostMeshes()
+## self.node_ale['status'] = answer
+## if answer == 'on':
+## if typ not in ('10', '11', '12'):
+## typ = '10'
+## self.__setVariablesandProperties()
+## else:
+## if typ not in ('0', '1', '2'):
+## typ = '0'
+## self.out.setTypePostMeshes(typ)
+##
+##
+## def getMethod(self):
+## """
+## Get method of activation of ALE from xml file.
+## """
+## if self.node_ale['status'] == '':
+## status = 'off'
+## self.setMethod(status)
+## else:
+## status = self.node_ale['status']
+## return status
+
+ def getMethod(self):
+ """
+ Get status on balise "ALE" from xml file
+ """
+ status = self.node_ale['status']
+ if not status:
+ status = self.__defaultInitialValues()['ale_method']
+ self.setMethod(status)
+ return status
+
+
+ def setMethod(self, status):
+ """
+ Put status on balise "ALE" in xml file
+ """
+ self.isOnOff(status)
+ typ = ''
+ typ = self.out.getTypePostMeshes()
+ self.node_ale['status'] = status
+ if status == 'on':
+ if typ not in ('10', '11', '12'):
+ typ = '10'
+ self.__setVariablesandProperties()
+ else:
+ if typ not in ('0', '1', '2'):
+ typ = '0'
+ self.__removeVariablesandProperties()
+ self.out.setTypePostMeshes(typ)
+
+
+ def setSubIterations(self, value):
+ """
+ Set value of fluid initialization sub iterations into xml file.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0)
+ self.node_ale.xmlSetData('fluid_initialization_sub_iterations', value)
+
+
+ def getSubIterations(self):
+ """
+ Get value of fluid initialization sub iterations from xml file.
+ """
+ nalinf = self.node_ale.xmlGetInt('fluid_initialization_sub_iterations')
+ if not nalinf:
+ nalinf = self.__defaultInitialValues()['nalinf']
+ self.setSubIterations(nalinf)
+ return nalinf
+
+
+ def setViscosity(self, value):
+ """
+ Set value of mesh viscosity into xml file.
+ """
+ self.isInList(value, ['isotrop', 'orthotrop'])
+ node = self.node_ale.xmlInitChildNode('mesh_viscosity')
+ node['type'] = value
+ self.__updateNodeViscosity()
+
+ # update formula
+ if self.getMEI() == 'user_function':
+ self.setFormula(self.getDefaultFormula())
+
+
+ def getViscosity(self):
+ """
+ Get value of mesh viscosity from xml file.
+ """
+ iortvm = self.__defaultInitialValues()['iortvm']
+ node = self.node_ale.xmlGetChildNode('mesh_viscosity')
+ if node :
+ iortvm = node['type']
+ else:
+ self.setViscosity(iortvm)
+
+ return iortvm
+
+
+ def setMEI(self, value):
+ """
+ Set value of spatial distribution of the viscosity of the mesh.
+ """
+ self.isInList(value, ['user_subroutine', 'user_function'] )
+
+ # do something only if mei has changed
+ if self.getMEIWithoutDefaultValue() != value:
+ for node in self.node_ale.xmlGetNodeList('property'):
+ node['choice'] = value
+ if value == 'user_subroutine':
+ self.node_ale.xmlRemoveChild('formula')
+ else:
+ self.setFormula(self.getDefaultFormula())
+
+
+ def getMEI(self):
+ """
+ Get value of spatial distribution of the viscosity of the mesh.
+ """
+ # Get the first node
+ mei = self.getMEIWithoutDefaultValue()
+
+ if not mei:
+ mei = self.__defaultInitialValues()['mei']
+ self.setMEI(mei)
+ return mei
+
+
+ def getMEIWithoutDefaultValue(self):
+ """
+ Get value of spatial distribution of the viscosity of the mesh.
+ Return null if no value is set
+ """
+ # Get the first node
+ node = self.node_ale.xmlGetNode('property', label='mesh_vi1')
+ mei = None
+
+ if node:
+ mei = node['choice']
+ return mei
+
+
+ def setFormula(self, value):
+ """
+ Set the formula for the viscosity of mesh
+ """
+ self.node_ale.xmlSetData('formula', value)
+
+
+ def getFormula(self):
+ """
+ Get the formula for the viscosity of mesh
+ """
+ formula = self.node_ale.xmlGetString('formula')
+ if not formula:
+ formula = self.getDefaultFormula()
+ self.setFormula(formula)
+ return formula
+
+
+ def getDefaultFormula(self):
+ """
+ Get the default formula base on viscosity type
+ """
+ viscosity = self.getViscosity()
+ return self.__defaultInitialValues()['formula_'+ viscosity ]
+
+
+#-------------------------------------------------------------------------------
+# MobileMesh Model test case
+#-------------------------------------------------------------------------------
+
+
+class MobileMeshTestCase(ModelTest):
+ """
+ """
+ def checkMobileMeshInstantiation(self):
+ """Check whether the TurbulenceModel class could be instantiated"""
+ model = None
+ model = MobileMeshModel(self.case)
+ assert model != None, 'Could not instantiate MobileMeshModel'
+
+ def checkGetandSetMethod(self):
+ """Check whether the MobileMeshModel class could be set and get method"""
+ mdl = MobileMeshModel(self.case)
+ mdl.setMethod('on')
+ doc = """<ale_method status="on">
+ <variable label="mesh_u" name="mesh_velocity_U"/>
+ <variable label="mesh_v" name="mesh_velocity_V"/>
+ <variable label="mesh_w" name="mesh_velocity_W"/>
+ <property choice="user_subroutine" label="mesh_vi1" name="mesh_viscosity_1"/>
+ <mesh_viscosity type="isotrop"/>
+ </ale_method>"""
+ assert mdl.node_ale == self.xmlNodeFromString(doc),\
+ 'Could not set mobil mesh model method'
+ assert mdl.getMethod() == 'on',\
+ 'Could not get mobil mesh model method'
+
+ def checkGetandSetSubIterations(self):
+ """Check whether the MobileMeshModel class could be set and get sub iterations"""
+ mdl = MobileMeshModel(self.case)
+ mdl.setMethod('on')
+ mdl.setSubIterations(12)
+##
+ doc = """<ale_method status="on">
+ <variable label="mesh_u" name="mesh_velocity_U"/>
+ <variable label="mesh_v" name="mesh_velocity_V"/>
+ <variable label="mesh_w" name="mesh_velocity_W"/>
+ <property choice="user_subroutine" label="mesh_vi1" name="mesh_viscosity_1"/>
+ <mesh_viscosity type="isotrop"/>
+ <fluid_initialization_sub_iterations>12</fluid_initialization_sub_iterations>
+ </ale_method>"""
+
+ assert mdl.node_ale == self.xmlNodeFromString(doc),\
+ 'Could not set mobil mesh model sub iterations'
+ assert mdl.getSubIterations() == 12,\
+ 'Could not get mobil mesh model sub iteration'
+
+
+ def checkGetandSetViscosity(self):
+ """Check whether the MobileMeshModel class could be set and get viscosity"""
+ mdl = MobileMeshModel(self.case)
+ mdl.setMethod('on')
+ mdl.setViscosity('orthotrop')
+
+ doc = """<ale_method status="on">
+ <variable label="mesh_u" name="mesh_velocity_U"/>
+ <variable label="mesh_v" name="mesh_velocity_V"/>
+ <variable label="mesh_w" name="mesh_velocity_W"/>
+ <property choice="user_subroutine" label="mesh_vi1" name="mesh_viscosity_1"/>
+ <mesh_viscosity type="orthotrop"/>
+ <property choice="user_subroutine" label="mesh_vi2" name="mesh_viscosity_2"/>
+ <property choice="user_subroutine" label="mesh_vi3" name="mesh_viscosity_3"/>
+ </ale_method>"""
+ assert mdl.node_ale == self.xmlNodeFromString(doc),\
+ 'Could not set mobil mesh model visocity type'
+ assert mdl.getViscosity() == 'orthotrop',\
+ 'Could not get mobil mesh model viscosity type'
+
+ def checkGetAndSetMEI(self):
+ """Check whether the MobileMeshModel class could be set and get mei"""
+ mdl = MobileMeshModel(self.case)
+ mdl.setMethod('on')
+ mdl.setMEI('user_subroutine')
+
+ doc = """<ale_method status="on">
+ <variable label="mesh_u" name="mesh_velocity_U"/>
+ <variable label="mesh_v" name="mesh_velocity_V"/>
+ <variable label="mesh_w" name="mesh_velocity_W"/>
+ <property choice="user_subroutine" label="mesh_vi1" name="mesh_viscosity_1"/>
+ <mesh_viscosity type="isotrop"/>
+ </ale_method> """
+ assert mdl.node_ale == self.xmlNodeFromString(doc),\
+ 'Could not set mei'
+ assert mdl.getMEI() == 'user_subroutine',\
+ 'Could not get mei'
+
+ def checkGetAndSetFormula(self):
+ """Check whether the MobileMeshModel class could be set and get formula"""
+ mdl = MobileMeshModel(self.case)
+ mdl.setMethod('on')
+ mdl.setFormula('mesh_vi1 = 1000;')
+
+ doc = """<ale_method status="on">
+ <variable label="mesh_u" name="mesh_velocity_U"/>
+ <variable label="mesh_v" name="mesh_velocity_V"/>
+ <variable label="mesh_w" name="mesh_velocity_W"/>
+ <property choice="user_subroutine" label="mesh_vi1" name="mesh_viscosity_1"/>
+ <mesh_viscosity type="isotrop"/>
+ <formula>mesh_vi1 = 1000;</formula>
+ </ale_method> """
+ assert mdl.node_ale == self.xmlNodeFromString(doc),\
+ 'Could not set formula'
+ assert mdl.getFormula() == 'mesh_vi1 = 1000;',\
+ 'Could not get formula'
+
+
+def suite():
+ testSuite = unittest.makeSuite(MobileMeshTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "MobileMeshTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/MobileMeshView.py b/gui/Pages/MobileMeshView.py
new file mode 100644
index 0000000..1fe8a1f
--- /dev/null
+++ b/gui/Pages/MobileMeshView.py
@@ -0,0 +1,244 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- MobileMeshView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+try:
+ import mei
+ _have_mei = True
+except:
+ _have_mei = False
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from MobileMeshForm import Ui_MobileMeshForm
+from Base.QtPage import setGreenColor, IntValidator, ComboModel
+from MobileMeshModel import MobileMeshModel
+
+if _have_mei:
+ from QMeiEditorView import QMeiEditorView
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("MobileMeshView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class MobileMeshView(QWidget, Ui_MobileMeshForm):
+ """
+ Class to open Page.
+ """
+ def __init__(self, parent, case, browser):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_MobileMeshForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = MobileMeshModel(self.case)
+ self.browser = browser
+
+ # Combo model VISCOSITY
+ self.modelVISCOSITY = ComboModel(self.comboBoxVISCOSITY,2,1)
+
+ self.modelVISCOSITY.addItem(self.tr("isotropic"), 'isotrop')
+ self.modelVISCOSITY.addItem(self.tr("orthotropic"), 'orthotrop')
+
+ # Combo model MEI
+ self.modelMEI = ComboModel(self.comboBoxMEI, 2, 1)
+
+ self.modelMEI.addItem(self.tr("user subroutine (usvima)"), 'user_subroutine')
+ self.modelMEI.addItem(self.tr("user formula"), 'user_function')
+
+ # Connections
+ self.connect(self.groupBoxALE, SIGNAL("clicked(bool)"), self.slotMethod)
+ self.connect(self.lineEditNALINF, SIGNAL("textChanged(const QString &)"), self.slotNalinf)
+ self.connect(self.comboBoxVISCOSITY, SIGNAL("activated(const QString&)"), self.slotViscosityType)
+ self.connect(self.comboBoxMEI, SIGNAL("activated(const QString&)"), self.slotMEI)
+ self.connect(self.pushButtonFormula, SIGNAL("clicked(bool)"), self.slotFormula)
+
+ # Validators
+ validatorNALINF = IntValidator(self.lineEditNALINF, min=0)
+ self.lineEditNALINF.setValidator(validatorNALINF)
+
+ if self.mdl.getMethod() == 'on':
+ self.groupBoxALE.setChecked(True)
+ checked = True
+ else:
+ self.groupBoxALE.setChecked(False)
+ checked = False
+
+ self.slotMethod(checked)
+
+ # Enable / disable formula state
+ self.slotMEI(self.comboBoxMEI.currentText())
+ setGreenColor(self.pushButtonFormula, False)
+
+
+ @pyqtSignature("bool")
+ def slotMethod(self, checked):
+ """
+ Private slot.
+
+ Activates ALE method.
+
+ @type checked: C{True} or C{False}
+ @param checked: if C{True}, shows the QGroupBox ALE parameters
+ """
+ self.groupBoxALE.setFlat(not checked)
+ if checked:
+ self.frame.show()
+ self.mdl.setMethod ("on")
+ nalinf = self.mdl.getSubIterations()
+ self.lineEditNALINF.setText(QString(str(nalinf)))
+ value = self.mdl.getViscosity()
+ self.modelVISCOSITY.setItem(str_model=value)
+ value = self.mdl.getMEI()
+ self.modelMEI.setItem(str_model=value)
+ else:
+ self.frame.hide()
+ self.mdl.setMethod("off")
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("const QString&")
+ def slotNalinf(self, text):
+ """
+ Input viscosity type of mesh : isotrop or orthotrop.
+ """
+ nalinf, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setSubIterations(nalinf)
+
+
+ @pyqtSignature("const QString&")
+ def slotViscosityType(self, text):
+ """
+ Input viscosity type of mesh : isotrop or orthotrop.
+ """
+ self.viscosity_type = self.modelVISCOSITY.dicoV2M[str(text)]
+ visco = self.viscosity_type
+ self.mdl.setViscosity(visco)
+ return visco
+
+
+ @pyqtSignature("const QString&")
+ def slotMEI(self, text):
+ """
+ MEI
+ """
+ MEI = self.modelMEI.dicoV2M[str(text)]
+ self.MEI = MEI
+ self.mdl.setMEI(MEI)
+ # enable disable formula button
+
+ isFormulaButtonEnabled = _have_mei and MEI == 'user_function'
+ self.pushButtonFormula.setEnabled(isFormulaButtonEnabled)
+ setGreenColor(self.pushButtonFormula, isFormulaButtonEnabled)
+
+ return MEI
+
+
+ @pyqtSignature("const QString&")
+ def slotFormula(self, text):
+ """
+ Run formula editor.
+ """
+ exp = self.mdl.getFormula()
+
+ if self.mdl.getViscosity() == 'isotrop':
+ if not exp:
+ exp = "mesh_vi1 ="
+ req = [('mesh_vi1', 'mesh viscosity')]
+ exa = "mesh_vi1 = 1000;"
+ else:
+ if not exp:
+ exp = "mesh_vi11 ="
+ req = [('mesh_vi1', 'mesh viscosity X'),
+ ('mesh_vi2', 'mesh viscosity Y'),
+ ('mesh_vi3', 'mesh viscosity Z')]
+ exa = "mesh_vi1 = 1000;\nmesh_vi2 = 1;\nmesh_vi3 = mesh_vi2;"
+
+ symb = [('x', "X cell's gravity center"),
+ ('y', "Y cell's gravity center"),
+ ('z', "Z cell's gravity center"),
+ ('dt', 'time step'),
+ ('t', 'current time'),
+ ('iter', 'number of iteration')]
+
+ dialog = QMeiEditorView(self,expression = exp,
+ required = req,
+ symbols = symb,
+ examples = exa)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotFormulaMobileMeshView -> %s" % str(result))
+ self.mdl.setFormula(result)
+ setGreenColor(self.pushButtonFormula, False)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/NumericalParamEquationForm.ui b/gui/Pages/NumericalParamEquationForm.ui
new file mode 100644
index 0000000..b750e18
--- /dev/null
+++ b/gui/Pages/NumericalParamEquationForm.ui
@@ -0,0 +1,86 @@
+<ui version="4.0" >
+ <class>NumericalParamEquationForm</class>
+ <widget class="QWidget" name="NumericalParamEquationForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>472</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QTabWidget" name="tabWidgetScheme" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Solver</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewSolver" >
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Scheme</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewScheme" >
+ <property name="minimumSize" >
+ <size>
+ <width>420</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/NumericalParamEquationModel.py b/gui/Pages/NumericalParamEquationModel.py
new file mode 100644
index 0000000..2c7c6c6
--- /dev/null
+++ b/gui/Pages/NumericalParamEquationModel.py
@@ -0,0 +1,694 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the differents possible outputs : listings, for ensights
+chronologic and historic files .... captors .... used variables ...
+
+This module defines the following classes:
+- NumericalParamEquatModel
+- NumericalParamEquatModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import string
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import XMLmodel, ModelTest
+from Pages.DefineUserScalarsModel import DefineUserScalarsModel
+from Pages.NumericalParamGlobalModel import NumericalParamGlobalModel
+from Pages.TurbulenceModel import TurbulenceModel
+
+#-------------------------------------------------------------------------------
+# NumericalParamEquat model class
+#-------------------------------------------------------------------------------
+
+class NumericalParamEquatModel(Model):
+ """
+ """
+ def __init__(self, case):
+ """
+ initialization of nodes lists
+ """
+ self.case = case
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_vitpre = self.node_models.xmlGetNode('velocity_pressure')
+ self.node_varVP = self.node_vitpre.xmlGetNodeList('variable')
+ self.node_np = self.case.xmlInitNode('numerical_parameters')
+ self.node_anal = self.case.xmlGetNode('analysis_control')
+ self.model = XMLmodel(self.case)
+
+ #variables list
+ self.var = []
+ for node in self.node_varVP:
+ self.var.append(node['label'])
+ for node in self._getThermalScalarNode():
+ self.var.append(node['label'])
+ for node in self._getAdditionalScalarNodes():
+ self.var.append(node['label'])
+
+ self.UVW = []
+ for node in self.node_varVP:
+ if node['name'] in ('velocity_U', 'velocity_V', 'velocity_W'):
+ self.UVW.append(node['label'])
+
+
+ def _defaultValues(self, label=""):
+ """ Private method: return default values """
+ self.default = {}
+ self.default['time_step_factor'] = 1.0
+ self.default['max_iter_number'] = 10000
+ self.default['solveur_precision'] = 1e-8
+ self.default['solveur_precision_pressure'] = 1e-8
+ if NumericalParamGlobalModel(self.case).getTimeSchemeOrder() == 2:
+ self.default['solveur_precision'] = 1e-5
+ self.default['slope_test'] = 'on'
+ self.default['flux_reconstruction'] = 'on'
+
+ if label not in self.var:
+ self.default['order_scheme'] = 'upwind'
+ self.default['blending_factor'] = 0.
+ else:
+ self.default['order_scheme'] = 'centered'
+ self.default['blending_factor'] = 1.
+
+ if TurbulenceModel(self.case).getTurbulenceModel() in \
+ ('LES_Smagorinsky', 'LES_dynamique', 'LES_WALE'):
+ if label in self.UVW:
+ self.default['slope_test'] = 'off'
+
+ return self.default
+
+
+ def _getThermalScalarNode(self):
+ """ Private method: return node of thermal scalar """
+ node_scalar = self.case.xmlGetNode('additional_scalars')
+ thermal_scalar_list = node_scalar.xmlGetNodeList('scalar', type='thermal')
+ return thermal_scalar_list
+
+
+ def _getPuCoalScalarsNodes(self):
+ """ Private method: return list of pulverized coal scalar's nodes """
+ nodList = []
+ node = self.node_models.xmlGetNode('pulverized_coal', 'model')
+ model = node['model']
+ if model != 'off':
+ nodList = node.xmlGetNodeList('scalar')
+ return nodList
+
+
+ def _getMeteoScalarsNodes(self):
+ """ Private method: return list of pulverized coal scalar's nodes """
+ nodList = []
+ node = self.node_models.xmlGetNode('atmospheric_flows', 'model')
+ if not node: return []
+ model = node['model']
+ if model != 'off':
+ nodList = node.xmlGetNodeList('scalar')
+ return nodList
+
+
+ def _getAdditionalScalarNodes(self):
+ """ Private method: return list of additional scalar's nodes """
+ n = self.case.xmlGetNode('additional_scalars')
+ return n.xmlGetNodeList('scalar', type='user')
+
+
+ def _getAleVariablesNodes(self):
+ """ Private method: return list of nodes for ALE"""
+ nodList = []
+ n = self.node_models.xmlGetNode('ale_method')
+ if n['status'] == 'on':
+ nodList = n.xmlGetNodeList('variable')
+ return nodList
+
+
+ def _getSchemeNodesList(self):
+ """ Return list of nodes for class view Scheme"""
+ self.var_shem = []
+
+ for part in (self.node_varVP,
+ self.model.getTurbVariable(),
+ self._getThermalScalarNode(),
+ self._getPuCoalScalarsNodes(),
+ self._getMeteoScalarsNodes(),
+ self._getAdditionalScalarNodes()):
+ self.var_shem.append(part)
+ return self.var_shem
+
+
+ def _getSolveurNodesList(self):
+ """ Return list of nodes for class view Solveur"""
+ self.var_solv = []
+ for part in (self.node_varVP,
+ self.model.getTurbVariable(),
+ self._getThermalScalarNode(),
+ self._getPuCoalScalarsNodes(),
+ self._getMeteoScalarsNodes(),
+ self._getAdditionalScalarNodes(),
+ self._getAleVariablesNodes()):
+ self.var_solv.append(part)
+ return self.var_solv
+
+
+ def _getSchemeLabelNode(self, label):
+ """ Private method: return node called with label'label' for scheme nodes"""
+ for node in self._getSchemeNodesList():
+ for n in node:
+ if n['label'] == label:
+ if n['name'] == 'pressure':
+ raise ValueError, "This method does not run with pressure"
+ else:
+ return n
+ raise ValueError, "This label does not exist: " + label
+
+
+ def _getSolveurLabelNode(self, label):
+ """ Private method: return node called with label'label' for solveur scheme"""
+ for node in self._getSolveurNodesList():
+ for n in node:
+ if n['label'] == label:
+ return n
+ raise ValueError, "This label does not exist: " + label
+
+
+ def _isPressure(self, node):
+ """ Return : 1 if name of node is 'pressure', 0 if not """
+ if node and node['name'] == 'pressure':
+ return 1
+ else:
+ return 0
+
+
+ def setSchemeDefaultValues(self):
+ """Usefull for TurbulenceModel in case of LES"""
+ for label in self.var:
+ try:
+ self.setBlendingFactor(label, self._defaultValues(label)['blending_factor'])
+ self.setScheme(label, self._defaultValues(label)['order_scheme'])
+ self.setSlopeTest(label, self._defaultValues(label)['slope_test'])
+ self.setFluxReconstruction(label, self._defaultValues(label)['flux_reconstruction'])
+ except:
+ pass
+
+
+ def getSchemeList(self):
+ """ Return the variables label list for scheme parameters """
+ list = []
+ for node in self._getSchemeNodesList():
+ for n in node:
+ if not self._isPressure(n):
+ list.append(n['label'])
+ return list
+
+
+ def getSolveurList(self):
+ """ Return the variables label list for solveur parameters """
+ list = []
+ for node in self._getSolveurNodesList():
+ for n in node:
+ list.append(n['label'])
+ return list
+
+
+ def isScalar(self, label):
+ """
+ Return : 1 if type of node is 'user' or 'thermal' or 'model',
+ 0 if not. Only used by the view by solveur class
+ """
+ node = self._getSolveurLabelNode(label)
+ if node:
+ if node['type'] in ['user', 'thermal', 'model']:
+ return 1
+ else:
+ return 0
+
+
+# Following methods for dependances of scheme:
+
+ def getScheme(self, label):
+ """ Return value of order scheme for variable labelled label """
+ node = self._getSchemeLabelNode(label)
+## if self._isPressure(node):
+### FIXME: return nothing ?
+## return
+## else:
+ value = self._defaultValues(label)['order_scheme']
+ n = node.xmlGetNode('order_scheme')
+ if n:
+ value = n['choice']
+ return value
+
+
+ def getBlendingFactor(self, label):
+ """ Return value of blending factor for variable labelled label """
+ node = self._getSchemeLabelNode(label)
+## if self._isPressure(node):
+## return
+## else:
+ value = node.xmlGetDouble('blending_factor')
+ if value == None:
+ value = self._defaultValues(label)['blending_factor']
+ return value
+
+
+ def getSlopeTest(self, label):
+ """ Return value of slope test for variable labelled label """
+ node = self._getSchemeLabelNode(label)
+## if self._isPressure(node):
+## return
+## else:
+ value = self._defaultValues(label)['slope_test']
+ n = node.xmlGetNode('slope_test')
+ if n:
+ value = n['status']
+ return value
+
+
+ def getFluxReconstruction(self, label):
+ """ Return value of flux reconstruction for variable labelled label """
+ node = self._getSchemeLabelNode(label)
+## if self._isPressure(node):
+## return
+## else:
+ value = self._defaultValues()['flux_reconstruction']
+ if node.xmlGetNode('flux_reconstruction'):
+ value = node.xmlGetNode('flux_reconstruction')['status']
+ return value
+
+
+ def setBlendingFactor(self, label, value):
+ """
+ Put value of blending factor for variable labelled label
+ only if it 's different of default value
+ """
+ self.isGreaterOrEqual(value, 0.)
+ self.isLowerOrEqual(value, 1.)
+ node = self._getSchemeLabelNode(label)
+ scheme = self.getScheme(label)
+## if scheme == 'upwind':
+## node.xmlSetData('blending_factor', 0.)
+## else:
+## if value != self._defaultValues(label)['blending_factor']:
+## node.xmlSetData('blending_factor', value)
+ if scheme == self._defaultValues(label)['order_scheme']:
+ if scheme == 'upwind':
+ node.xmlRemoveChild('blending_factor')
+ else:
+ node.xmlSetData('blending_factor', value)
+ else:
+ if value != self._defaultValues(label)['blending_factor']:
+ node.xmlSetData('blending_factor', value)
+
+
+ def setScheme(self, label, value):
+ """
+ Put value of order scheme for variable or scalar labelled label
+ only if it 's different of default value
+ """
+ self.isInList(value, ('upwind', 'centered', 'solu'))
+ node = self._getSchemeLabelNode(label)
+ if value == self._defaultValues(label)['order_scheme']:
+ node.xmlRemoveChild('order_scheme')
+ if self.getBlendingFactor(label) == self._defaultValues(label)['blending_factor']\
+ or value == 'centered' and self.getBlendingFactor(label) == 0. \
+ or value == 'upwind' and self.getBlendingFactor(label) != 0.:
+ node.xmlRemoveChild('blending_factor')
+ else:
+ n = node.xmlInitNode('order_scheme')
+ n['choice'] = value
+
+
+ def setSlopeTest(self, label, status):
+ """ Put status of slope test for variable labelled label """
+ self.isOnOff(status)
+ node = self._getSchemeLabelNode(label)
+ if status == self._defaultValues(label)['slope_test']:
+ node.xmlRemoveChild('slope_test')
+ else:
+ n = node.xmlInitNode('slope_test')
+ n['status'] = status
+
+
+ def setFluxReconstruction(self, label, value):
+ """ Put status of flux reconstruction for variable labelled label """
+ self.isOnOff(value)
+ node = self._getSchemeLabelNode(label)
+ if value == self._defaultValues()['flux_reconstruction']:
+ node.xmlRemoveChild('flux_reconstruction')
+ else:
+ n = node.xmlInitNode('flux_reconstruction')
+ n['status']=value
+
+
+# Following methods for dependances of solveur:
+
+ def setMaxIterNumber(self, label, value):
+ """ Put number of maximum iterations for variable labelled label """
+ self.isInt(value)
+ node = self._getSolveurLabelNode(label)
+ if value != self._defaultValues()['max_iter_number']:
+ node.xmlSetData('max_iter_number', value)
+ else:
+ node.xmlRemoveChild('max_iter_number')
+
+
+ def setSolveurPrecision(self, label, value):
+ """ Put value of solveur precision for variable labelled label """
+ # for pressure default value always equal to 1e-8
+ self.isPositiveFloat(value)
+ node = self._getSolveurLabelNode(label)
+ if self._isPressure(node):
+ default = self._defaultValues()['solveur_precision_pressure']
+ else:
+ default = self._defaultValues()['solveur_precision']
+
+ if value != default:
+ node.xmlSetData('solveur_precision', value)
+ else:
+ node.xmlRemoveChild('solveur_precision')
+
+
+ def getMaxIterNumber(self, label):
+ """ Return number of maximum iterations for variable labelled label """
+ node = self._getSolveurLabelNode(label)
+ value = node.xmlGetInt('max_iter_number')
+ if value == None:
+ value = self._defaultValues()['max_iter_number']
+ return value
+
+
+ def getSolveurPrecision(self, label):
+ """ Return value of solveur precision for variable labelled label """
+ node = self._getSolveurLabelNode(label)
+
+ if self._isPressure(node):
+ default = self._defaultValues()['solveur_precision_pressure']
+ else:
+ default = self._defaultValues()['solveur_precision']
+
+ value = node.xmlGetDouble('solveur_precision')
+ if value == None:
+ value = default
+ return value
+
+
+ def getScalarTimeStepFactor(self, label):
+ """ Return value of time_step_factor for variable labelled label """
+ if self.isScalar(label):
+ node = self._getSolveurLabelNode(label)
+ value = node.xmlGetDouble('time_step_factor')
+ if value == None:
+ value = self._defaultValues()['time_step_factor']
+ return value
+ else:
+ raise ValueError, "This method runs only with scalar label"
+
+
+ def setScalarTimeStepFactor(self, label, value):
+ """ Put value of time_step_factor for variable labelled label """
+ self.isStrictPositiveFloat(value)
+ if self.isScalar(label):
+ node = self._getSolveurLabelNode(label)
+ if value != self._defaultValues()['time_step_factor']:
+ node.xmlSetData('time_step_factor', value)
+ else:
+ node.xmlRemoveChild('time_step_factor')
+ else:
+ raise ValueError, "This method runs only with scalar label"
+
+
+#-------------------------------------------------------------------------------
+# NumericalParamEquat test case
+#-------------------------------------------------------------------------------
+
+
+class NumericalParamEquatTestCase(ModelTest):
+ """
+ """
+ def checkNumericalParamEquatInstantiation(self):
+ """
+ Check whether the NumericalParamEquatModel class could be instantiated
+ """
+ model = None
+ model = NumericalParamEquatModel(self.case)
+ assert model != None, 'Could not instantiate NumericalParamEquatModel'
+
+ def checkSetAndGetScheme(self):
+ """
+ Check whether the NumericalParamEquatModel class could set and get scheme
+ """
+ model = NumericalParamEquatModel(self.case)
+ model.setScheme('VelocitW', 'upwind')
+ doc = """<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W">
+ <order_scheme choice="upwind"/>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert model.node_vitpre == self.xmlNodeFromString(doc),\
+ 'Could not set scheme in NumericalParamEquationModel'
+ assert model.getScheme('VelocitW') == 'upwind',\
+ 'Could not get scheme in NumericalParamEquationModel'
+
+ def checkSetAndGetBlendingFactor(self):
+ """
+ Check whether the NumericalParamEquatModel class could set and get blending factor
+ """
+ model = NumericalParamEquatModel(self.case)
+ model.setScheme('VelocitW', 'centered')
+ model.setBlendingFactor('VelocitW', 0.5)
+ doc = """<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W">
+ <blending_factor>0.5</blending_factor>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert model.node_vitpre == self.xmlNodeFromString(doc),\
+ 'Could not set blending factor in NumericalParamEquationModel'
+ assert model.getBlendingFactor('VelocitW') == 0.5,\
+ 'Could not get blending factor in NumericalParamEquationModel'
+
+ def checkSetAndGetSlopeTest(self):
+ """
+ Check whether the NumericalParamEquatModel class could set and get slope test
+ """
+ model = NumericalParamEquatModel(self.case)
+ model.setSlopeTest('VelocitW', 'off')
+ doc = """<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W">
+ <slope_test status="off"/>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert model.node_vitpre == self.xmlNodeFromString(doc),\
+ 'Could not set status of slope test in NumericalParamEquationModel'
+ assert model.getSlopeTest('VelocitW') == 'off',\
+ 'Could not get status of slope test in NumericalParamEquationModel'
+
+
+ def checkSetAndGetFluxReconstruction(self):
+ """
+ Check whether the NumericalParamEquatModel class could set and get flux reconstruction
+ """
+ model = NumericalParamEquatModel(self.case)
+ model.setFluxReconstruction('VelocitW', 'on')
+ doc = """<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W">
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert model.node_vitpre == self.xmlNodeFromString(doc),\
+ 'Could not set status of flux reconstruction in NumericalParamEquationModel'
+ assert model.getFluxReconstruction('VelocitW') == 'on',\
+ 'Could not get status of flux reconstruction in NumericalParamEquationModel'
+
+ model.setFluxReconstruction('VelocitW', 'off')
+ doc2 = """<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W">
+ <flux_reconstruction status="off"/>
+ </variable>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert model.node_vitpre == self.xmlNodeFromString(doc2),\
+ 'Could not set status of flux reconstruction in NumericalParamEquationModel'
+ assert model.getFluxReconstruction('VelocitW') == 'off',\
+ 'Could not get status of flux reconstruction in NumericalParamEquationModel'
+
+ def checkSetAndGetMaxIterNumber(self):
+ """
+ Check whether the NumericalParamEquatModel class could set and get max of number of iterations
+ """
+ model = NumericalParamEquatModel(self.case)
+ model.setMaxIterNumber('Pressure', 22222)
+ doc = """<velocity_pressure>
+ <variable label="Pressure" name="pressure">
+ <max_iter_number>22222</max_iter_number>
+ </variable>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W"/>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert model.node_vitpre == self.xmlNodeFromString(doc),\
+ 'Could not set max of number of iterations in NumericalParamEquationModel'
+ assert model.getMaxIterNumber('Pressure') == 22222,\
+ 'Could not get max of number of iterations in NumericalParamEquationModel'
+
+ def checkSetAndGetSolveurPrecision(self):
+ """
+ Check whether the NumericalParamEquatModel class could set and get solveur precision
+ """
+ model = NumericalParamEquatModel(self.case)
+
+ assert model.getSolveurPrecision('Pressure') == 1e-8,\
+ 'Could not get solveur precision for pressure in NumericalParamEquationModel'
+ from Pages.NumericalParamGlobalModel import NumericalParamGlobalModel
+ NumericalParamGlobalModel(self.case).setTimeSchemeOrder(2)
+ del NumericalParamGlobalModel
+ assert model.getSolveurPrecision('VelocitU') == 1e-5
+
+ model.setSolveurPrecision('VelocitU', 2e-6)
+ doc = """<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U">
+ <solveur_precision>2e-06</solveur_precision>
+ </variable>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W"/>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert model.node_vitpre == self.xmlNodeFromString(doc),\
+ 'Could not set solveur precision in NumericalParamEquationModel'
+ assert model.getSolveurPrecision('VelocitU') == 2e-6,\
+ 'Could not get solveur precision in NumericalParamEquationModel'
+
+ def checkSetAndGetScalarTimeStepFactor(self):
+ """
+ Check whether the NumericalParamEquatModel class could set and get time step factor
+ """
+ model = NumericalParamEquatModel(self.case)
+ from Pages.ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+
+## self.failUnlessRaises(ValueError, model.setScalarTimeStepFactor('VelocitU', 25.), \
+## 'Could not set time step factor in NumericalParamEquationModel')
+
+ model.setScalarTimeStepFactor('Temp.C', 52.)
+ node_sca = self.case.xmlGetNode('additional_scalars')
+ vit = """<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W"/>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ sca = """<additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>-1e+12 </min_value>
+ <max_value>1e+12</max_value>
+ <time_step_factor>52</time_step_factor>
+ </scalar>
+ </additional_scalars>"""
+ assert model.node_vitpre == self.xmlNodeFromString(vit),\
+ 'Could not set time step factor in NumericalParamEquationModel'
+
+ assert node_sca == self.xmlNodeFromString(sca),\
+ 'Could not set time step factor for scalar in NumericalParamEquationModel'
+
+## self.failUnlessRaises(ValueError, model.getScalarTimeStepFactor('VelocitV'), \
+## 'Could not get time step factor in NumericalParamEquationModel')
+
+ assert model.getScalarTimeStepFactor('Temp.C') == 52.,\
+ 'Could not get time step factor for scalar in NumericalParamEquationModel'
+
+def suite():
+ testSuite = unittest.makeSuite(NumericalParamEquatTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "NumericalParamEquatTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/NumericalParamEquationView.py b/gui/Pages/NumericalParamEquationView.py
new file mode 100644
index 0000000..d1bdd14
--- /dev/null
+++ b/gui/Pages/NumericalParamEquationView.py
@@ -0,0 +1,550 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- StandardItemModelScheme
+- StandardItemModelSolver
+- NumericalParamEquationView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from NumericalParamEquationForm import Ui_NumericalParamEquationForm
+from Pages.NumericalParamEquationModel import NumericalParamEquatModel
+from Pages.TurbulenceModel import TurbulenceModel
+from Pages.SteadyManagementModel import SteadyManagementModel
+import Base.QtPage as QtPage
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("NumericalParamEquationView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Combo box delegate for ISCHCV
+#-------------------------------------------------------------------------------
+
+class SchemeOrderDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent=None, xml_model=None):
+ super(SchemeOrderDelegate, self).__init__(parent)
+ self.parent = parent
+ self.mdl = xml_model
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ editor.addItem(QString("Upwind"))
+ editor.addItem(QString("Centered"))
+ editor.addItem(QString("SOLU"))
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, comboBox, index):
+ dico = {"upwind": 0, "centered": 1, "solu": 2}
+ row = index.row()
+ string = index.model().dataScheme[row]['ischcv']
+ idx = dico[string]
+ comboBox.setCurrentIndex(idx)
+
+
+ def setModelData(self, comboBox, model, index):
+ value = comboBox.currentText()
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value))
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for BLENCV
+#-------------------------------------------------------------------------------
+
+class BlendingFactorDelegate(QItemDelegate):
+ def __init__(self, parent=None, xml_model=None):
+ super(BlendingFactorDelegate, self).__init__(parent)
+ self.parent = parent
+ self.turb = xml_model
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ if self.turb.getTurbulenceModel() in ('LES_Smagorinsky', 'LES_dynamique', 'LES_WALE'):
+ validator = QtPage.DoubleValidator(editor, min=0.95, max=1.)
+ else:
+ validator = QtPage.DoubleValidator(editor, min=0., max=1.)
+ validator.setExclusiveMin(True)
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ value, ok = editor.text().toDouble()
+ if editor.validator().state == QValidator.Acceptable:
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value))
+
+#-------------------------------------------------------------------------------
+# Delegate for Solver QTableView
+#-------------------------------------------------------------------------------
+
+class SolveurDelegate(QItemDelegate):
+ def __init__(self, parent = None):
+ super(SolveurDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ if index.column() == 2:
+ validator = QtPage.DoubleValidator(editor, min=0., max=0.01)
+ validator.setExclusiveMin(True)
+ else:
+ validator = QtPage.IntValidator(editor, min=1)
+ editor.setValidator(validator)
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if index.column() == 2:
+ value, ok = editor.text().toDouble()
+ else:
+ value, ok = editor.text().toInt()
+ if editor.validator().state == QValidator.Acceptable:
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value))
+
+#-------------------------------------------------------------------------------
+# Scheme class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelScheme(QStandardItemModel):
+
+ def __init__(self, NPE):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.NPE = NPE
+ self.dataScheme = []
+ # list of items to be disabled in the QTableView
+ self.disabledItem = []
+ self.populateModel()
+ self.headers = [self.tr("Name"),
+ self.tr("Scheme"),
+ self.tr("Blending\nFactor"),
+ self.tr("Slope\nTest"),
+ self.tr("Flux\nReconstruction")]
+ self.setColumnCount(len(self.headers))
+
+ # Initialize the flags
+ for row in range(self.rowCount()):
+ for column in range(self.columnCount()):
+ if column < 3:
+ role = Qt.DisplayRole
+ else:
+ role = Qt.CheckStateRole
+ index = self.index(row, column)
+ value = self.data(index, role)
+ self.setData(index, value)
+
+
+ def populateModel(self):
+ #FIXME
+ #self.dicoV2M= {"Upwind" : 'upwind', self.tr("Centered"): 'centered', "SOLU": 'solu'}
+ #self.dicoM2V= {"upwind" : 'Upwind', "centered": self.tr('Centered'), "solu": 'SOLU'}
+ self.dicoV2M= {"Upwind" : 'upwind', "Centered": 'centered', "SOLU": 'solu'}
+ self.dicoM2V= {"upwind" : 'Upwind', "centered": 'Centered', "solu": 'SOLU'}
+
+ for label in self.NPE.getSchemeList():
+ dico = {}
+ dico['label'] = label
+ dico['blencv'] = self.NPE.getBlendingFactor(label)
+ dico['ischcv'] = self.NPE.getScheme(label)
+ dico['isstpc'] = self.NPE.getSlopeTest(label)
+ dico['ircflu'] = self.NPE.getFluxReconstruction(label)
+ self.dataScheme.append(dico)
+ log.debug("populateModel-> dataScheme = %s" % dico)
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ row = index.row()
+ dico = self.dataScheme[row]
+
+ if role == Qt.ToolTipRole:
+ if index.column() == 1:
+ return QVariant(self.tr("Code_Saturne keyword: ISCHCV"))
+ elif index.column() == 2:
+ return QVariant(self.tr("Code_Saturne keyword: BLENCV"))
+ elif index.column() == 3:
+ return QVariant(self.tr("Code_Saturne keyword: ISSTPC"))
+ elif index.column() == 4:
+ return QVariant(self.tr("Code_Saturne keyword: IRCFLU"))
+
+ elif role == Qt.DisplayRole:
+ if index.column() == 0:
+ return QVariant(dico['label'])
+ elif index.column() == 1:
+ return QVariant(self.dicoM2V[dico['ischcv']])
+ elif index.column() == 2:
+ return QVariant(dico['blencv'])
+ else:
+ return QVariant()
+
+ elif role == Qt.CheckStateRole:
+ if index.column() == 3:
+ if dico['isstpc'] == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+ elif index.column() == 4:
+ if dico['ircflu'] == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ # disable item
+ if (index.row(), index.column()) in self.disabledItem:
+ return Qt.ItemIsSelectable
+
+ if index.column() == 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ elif index.column() == 1 or index.column() == 2:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ elif index.column() == 3 or index.column() == 4:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role=None):
+ row = index.row()
+ label = self.dataScheme[row]['label']
+
+ # set ISCHCV
+ if index.column() == 1:
+ self.dataScheme[row]['ischcv'] = self.dicoV2M[str(value.toString())]
+
+ if self.dataScheme[row]['ischcv'] == "upwind":
+ if (row, 2) not in self.disabledItem:
+ self.disabledItem.append((row, 2))
+ if (row, 3) not in self.disabledItem:
+ self.disabledItem.append((row, 3))
+ self.dataScheme[row]['blencv'] = 0.0
+ self.dataScheme[row]['isstpc'] = "off"
+ else:
+ if (row, 2) in self.disabledItem:
+ self.disabledItem.remove((row, 2))
+ self.dataScheme[row]['blencv'] = 1.0
+ if (row, 3) in self.disabledItem:
+ self.disabledItem.remove((row, 3))
+ self.dataScheme[row]['isstpc'] = "on"
+
+ self.NPE.setScheme(label, self.dataScheme[row]['ischcv'])
+ self.NPE.setBlendingFactor(label, self.dataScheme[row]['blencv'])
+
+ # set BLENCV
+ elif index.column() == 2:
+ if self.dataScheme[row]['ischcv'] != "upwind":
+ self.dataScheme[row]['blencv'], ok = value.toDouble()
+ self.NPE.setBlendingFactor(label, self.dataScheme[row]['blencv'])
+
+ # set ISSTPC
+ elif index.column() == 3:
+ if self.dataScheme[row]['ischcv'] != "upwind":
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ self.dataScheme[row]['isstpc'] = "off"
+ else:
+ self.dataScheme[row]['isstpc'] = "on"
+ self.NPE.setSlopeTest(label, self.dataScheme[row]['isstpc'])
+
+ # set IRCFLU
+ elif index.column() == 4:
+ v, ok = value.toInt()
+ if v == Qt.Unchecked:
+ self.dataScheme[row]['ircflu'] = "off"
+ else:
+ self.dataScheme[row]['ircflu'] = "on"
+ self.NPE.setFluxReconstruction(label, self.dataScheme[row]['ircflu'])
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+#-------------------------------------------------------------------------------
+# Solver class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelSolver(QStandardItemModel):
+ """
+ Model associated with a QTableView.
+ """
+ def __init__(self, NPE, SM):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.NPE = NPE
+ self.SM = SM
+ self.setColumnCount(4)
+ self.dataSolver = []
+ # list of items to be disabled in the view
+ self.disabledItem = []
+ self.populateModel()
+
+
+ def populateModel(self):
+ for label in self.NPE.getSolveurList():
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+ dico = {}
+ dico['label'] = label
+ dico['nitmax'] = self.NPE.getMaxIterNumber(label)
+ dico['epsilo'] = self.NPE.getSolveurPrecision(label)
+ if self.NPE.isScalar(label):
+ dico['cdtvar'] = self.NPE.getScalarTimeStepFactor(label)
+ else:
+ dico['cdtvar'] = ""
+ self.disabledItem.append((row,3))
+
+ self.dataSolver.append(dico)
+ log.debug("populateModel-> dataSolver = %s" % dico)
+
+
+ def data(self, index, role):
+
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.ToolTipRole:
+ if index.column() == 1:
+ return QVariant(self.tr("Code_Saturne keyword: NITMAX"))
+ elif index.column() == 2:
+ return QVariant(self.tr("Code_Saturne keyword: EPSILO"))
+ elif index.column() == 3:
+ return QVariant(self.tr("Code_Saturne keyword: CDTVAR"))
+
+ elif role == Qt.DisplayRole:
+ row = index.row()
+ dico = self.dataSolver[row]
+
+ if index.column() == 0:
+ return QVariant(dico['label'])
+ elif index.column() == 1:
+ return QVariant(dico['nitmax'])
+ elif index.column() == 2:
+ return QVariant(dico['epsilo'])
+ elif index.column() == 3:
+ return QVariant(dico['cdtvar'])
+ else:
+ return QVariant()
+
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ # disable item
+ if (index.row(), index.column()) in self.disabledItem:
+ return Qt.ItemIsEnabled
+
+ if index.column() == 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ if section == 0:
+ return QVariant(self.tr("Name"))
+ elif section == 1:
+ return QVariant(self.tr("Maximum\nIteration Number"))
+ elif section == 2:
+ return QVariant(self.tr("Solver\nPrecision"))
+ elif section == 3:
+ return QVariant(self.tr("Time Step\nFactor"))
+ else:
+ return QVariant()
+ return QVariant()
+
+
+ def setData(self, index, value, role=None):
+ row = index.row()
+ label = self.dataSolver[row]['label']
+
+ if index.column() == 1:
+ self.dataSolver[row]['nitmax'], ok = value.toInt()
+ self.NPE.setMaxIterNumber(label, self.dataSolver[row]['nitmax'])
+
+ elif index.column() == 2:
+ self.dataSolver[row]['epsilo'], ok = value.toDouble()
+ self.NPE.setSolveurPrecision(label, self.dataSolver[row]['epsilo'])
+
+ elif index.column() == 3:
+ self.dataSolver[row]['cdtvar'], ok = value.toDouble()
+ self.NPE.setScalarTimeStepFactor(label, self.dataSolver[row]['cdtvar'])
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class NumericalParamEquationView(QWidget, Ui_NumericalParamEquationForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+ Ui_NumericalParamEquationForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.NPE = NumericalParamEquatModel(self.case)
+ self.SM = SteadyManagementModel(self.case)
+ self.turb = TurbulenceModel(self.case)
+
+ # Scheme
+ self.modelScheme = StandardItemModelScheme(self.NPE)
+ self.tableViewScheme.setModel(self.modelScheme)
+ self.tableViewScheme.setAlternatingRowColors(True)
+ self.tableViewScheme.resizeColumnToContents(0)
+ self.tableViewScheme.resizeRowsToContents()
+ self.tableViewScheme.setSelectionBehavior(QAbstractItemView.SelectItems)
+ self.tableViewScheme.setSelectionMode(QAbstractItemView.ExtendedSelection)
+ self.tableViewScheme.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewScheme.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ delegateISCHCV = SchemeOrderDelegate(self.tableViewScheme)
+ self.tableViewScheme.setItemDelegateForColumn(1, delegateISCHCV)
+
+ delegateBLENCV = BlendingFactorDelegate(self.tableViewScheme, self.turb)
+ self.tableViewScheme.setItemDelegateForColumn(2, delegateBLENCV)
+
+ # Solveur
+ self.modelSolver = StandardItemModelSolver(self.NPE, self.SM)
+ self.tableViewSolver.setModel(self.modelSolver)
+ self.tableViewSolver.setAlternatingRowColors(True)
+ self.tableViewSolver.resizeColumnToContents(0)
+ self.tableViewSolver.resizeRowsToContents()
+ self.tableViewSolver.setSelectionBehavior(QAbstractItemView.SelectItems)
+ self.tableViewSolver.setSelectionMode(QAbstractItemView.ExtendedSelection)
+ self.tableViewSolver.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewSolver.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ if self.SM.getSteadyFlowManagement() == 'on':
+ self.tableViewSolver.setColumnHidden(3, True)
+
+ delegate = SolveurDelegate(self.tableViewSolver)
+ self.tableViewSolver.setItemDelegate(delegate)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/NumericalParamGlobalForm.ui b/gui/Pages/NumericalParamGlobalForm.ui
new file mode 100644
index 0000000..bf81df4
--- /dev/null
+++ b/gui/Pages/NumericalParamGlobalForm.ui
@@ -0,0 +1,701 @@
+<ui version="4.0" >
+ <class>NumericalParamGlobalForm</class>
+ <widget class="QWidget" name="NumericalParamGlobalForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>456</width>
+ <height>437</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Global parameters</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_6" >
+ <property name="minimumSize" >
+ <size>
+ <width>390</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelIMRGRA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMRGRA</string>
+ </property>
+ <property name="text" >
+ <string>Gradient calculation method:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QComboBox" name="comboBoxIMRGRA" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMRGRA</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="Line" name="line_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMGR</string>
+ </property>
+ <property name="text" >
+ <string>Multigrid algorithm for pressure</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>158</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxIMGR" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMGR</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" >
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_5" >
+ <property name="minimumSize" >
+ <size>
+ <width>390</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelIPUCOU" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPUCOU</string>
+ </property>
+ <property name="text" >
+ <string>Pseudo-coupled velocity-pressure solver</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxIPUCOU" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPUCOU</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="5" column="0" >
+ <widget class="Line" name="line_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_4" >
+ <property name="minimumSize" >
+ <size>
+ <width>390</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelIVISSE" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISSE</string>
+ </property>
+ <property name="text" >
+ <string>Handling of transposed gradient and divergence
+source terms in momentum equation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxIVISSE" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IVISSE</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="7" column="0" >
+ <widget class="Line" name="line_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_3" >
+ <property name="minimumSize" >
+ <size>
+ <width>390</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelEXTRAG" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: EXTRAG</string>
+ </property>
+ <property name="text" >
+ <string>Extrapolation of pressure gradient
+on domain boundary</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxEXTRAG" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: EXTRAG</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="9" column="0" >
+ <widget class="Line" name="line_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="10" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_2" >
+ <property name="minimumSize" >
+ <size>
+ <width>390</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelRELAXP" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: RELAXP</string>
+ </property>
+ <property name="text" >
+ <string>Relaxation of pressure increase</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditRELAXP" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: RELAXP</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="11" column="0" >
+ <widget class="Line" name="line_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="12" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame" >
+ <property name="minimumSize" >
+ <size>
+ <width>390</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelSRROM" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: SRROM</string>
+ </property>
+ <property name="text" >
+ <string>Relaxation of density</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditSRROM" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: SRROM</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/NumericalParamGlobalModel.py b/gui/Pages/NumericalParamGlobalModel.py
new file mode 100644
index 0000000..60b8d3e
--- /dev/null
+++ b/gui/Pages/NumericalParamGlobalModel.py
@@ -0,0 +1,434 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the differents possible outputs : listings, for ensights
+chronologic and historic files .... probes .... used variables ...
+
+This module defines the following classes:
+- NumericalParamGlobalModel
+- NumericalParamGlobalModelTestCase
+
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+from Pages.OutputVolumicVariablesModel import OutputVolumicVariablesModel
+
+#-------------------------------------------------------------------------------
+# NumericalParamGlobal model class
+#-------------------------------------------------------------------------------
+
+class NumericalParamGlobalModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Turbulence
+ """
+ def __init__(self, case):
+ """
+ Xml node declaration and supplementary default value settings.
+ """
+ self.case = case
+ self.node_np = self.case.xmlInitNode('numerical_parameters')
+
+
+ def _defaultValues(self):
+ """
+ default values
+ """
+ self.default = {}
+ self.default['multigrid'] = 'on'
+ self.default['gradient_transposed'] = 'on'
+ self.default['pressure_relaxation'] = 1.
+ self.default['density_relaxation'] = 0.95
+ self.default['velocity_pressure_coupling'] ='off'
+ self.default['wall_pressure_extrapolation'] = 'neumann'
+ self.default['gradient_reconstruction'] = 0
+ self.default['time_scheme_order'] = 1
+ return self.default
+
+
+ def getMultigrid(self):
+ """
+ Return status of multigrid algorithm for pressure
+ """
+ node = self.node_np.xmlInitNode('multigrid', 'status')
+ status = node['status']
+ if not status:
+ status = self._defaultValues()['multigrid']
+ self.setMultigrid(status)
+ return status
+
+
+ def getTransposedGradient(self):
+ """
+ Return status of transposed gradient
+ """
+ node = self.node_np.xmlInitNode('gradient_transposed', 'status')
+ status = node['status']
+ if not status:
+ status = self._defaultValues()['gradient_transposed']
+ self.setTransposedGradient(status)
+ return status
+
+
+ def getVelocityPressureCoupling(self):
+ """
+ Return status of IPUCOU value is activated or not
+ """
+ node = self.node_np.xmlInitNode('velocity_pressure_coupling', 'status')
+ status = node['status']
+ if not status:
+ status = self._defaultValues()['velocity_pressure_coupling']
+ self.setVelocityPressureCoupling(status)
+ return status
+
+
+ def getWallPressureExtrapolation(self):
+ """
+ Return EXTRAG value
+ """
+ value = self.node_np.xmlGetString('wall_pressure_extrapolation')
+ if not value:
+ value = self._defaultValues()['wall_pressure_extrapolation']
+ self.setWallPressureExtrapolation(value)
+ else:
+ if value == '0':
+ value = 'neumann'
+ else:
+ value = 'extrapolation'
+
+ return value
+
+
+ def getPressureRelaxation(self):
+ """
+ Return RELAXP value
+ """
+ value = self.node_np.xmlGetDouble('pressure_relaxation')
+ if value == None:
+ value = self._defaultValues()['pressure_relaxation']
+ self.setPressureRelaxation(value)
+ return value
+
+
+ def getDensityRelaxation(self):
+ """
+ Return SRROM value
+ """
+ value = self.node_np.xmlGetDouble('density_relaxation')
+ if value == None:
+ value = self._defaultValues()['density_relaxation']
+ self.setDensityRelaxation(value)
+ return value
+
+
+ def getGradientReconstruction(self):
+ """
+ Return IMRGRA value : 0, 1, 2, 3, 4 or 5
+ """
+ node = self.node_np.xmlInitNode('gradient_reconstruction', 'choice')
+ choice = node['choice']
+ if not choice:
+ choice = self._defaultValues()['gradient_reconstruction']
+ self.setGradientReconstruction(choice)
+ return choice
+
+
+ def setMultigrid(self, status):
+ """
+ Put status of multigrid algorithm for pressure
+ """
+ self.isOnOff(status)
+ node = self.node_np.xmlInitNode('multigrid', 'status')
+ node['status'] = status
+
+
+ def setTransposedGradient(self, status):
+ """
+ Put status of gradient transposed
+ """
+ self.isOnOff(status)
+ node = self.node_np.xmlInitNode('gradient_transposed', 'status')
+ node['status'] = status
+
+
+ def setVelocityPressureCoupling(self, status):
+ """
+ Put status of velocity_pressure_coupling
+ """
+ self.isOnOff(status)
+ node_ipucou = self.node_np.xmlInitNode('velocity_pressure_coupling', 'status')
+ node_ipucou['status'] = status
+ if status == 'on':
+ node_Tx = node_ipucou.xmlInitNode('property', name='weight_matrix_X')
+ node_Ty = node_ipucou.xmlInitNode('property', name='weight_matrix_Y')
+ node_Tz = node_ipucou.xmlInitNode('property', name='weight_matrix_Z')
+
+ for (node, val) in [(node_Tx, 'weight_matrix_X'),
+ (node_Ty, 'weight_matrix_Y'),
+ (node_Tz, 'weight_matrix_Z')]:
+ if not node['label']: node['label'] = Tool.dicoLabel(val)
+ node.xmlInitChildNode('listing_printing', status="off")
+ node.xmlInitChildNode('postprocessing_recording', status="off")
+ else:
+ for node in node_ipucou.xmlGetNodeList('property'):
+ node.xmlRemoveNode()
+
+
+ def setPressureRelaxation(self, value):
+ """
+ Put value of pressure_relaxation
+ """
+ self.isPositiveFloat(value)
+ self.node_np.xmlSetData('pressure_relaxation', value)
+
+
+ def setDensityRelaxation(self, value):
+ """
+ Put value of density_relaxation
+ """
+ self.isGreater(value, 0.0)
+ self.isLowerOrEqual(value, 1.0)
+ self.node_np.xmlSetData('density_relaxation', value)
+
+
+ def setWallPressureExtrapolation(self, value):
+ """
+ Put value of wall pressure extrapolation
+ """
+ self.isInList(value, ('neumann', 'extrapolation'))
+ if value == 'neumann':
+ value = '0'
+ else:
+ value = '1'
+ self.node_np.xmlSetData('wall_pressure_extrapolation', value)
+
+
+ def setGradientReconstruction(self, value):
+ """
+ Put value of gradient_reconstruction
+ """
+ self.isInt(value)
+ self.isInList(value, (0, 1, 2, 3, 4, 5))
+ node = self.node_np.xmlInitNode('gradient_reconstruction', 'choice')
+ node['choice'] = value
+
+
+ def getTimeSchemeOrder(self):
+ """
+ Return time scheme order for NumericalParamEquationModel
+ """
+ # getTimeSchemeOrder: used only by NumericalParamEquationModel
+ node = self.node_np.xmlGetNode('time_scheme_order')
+ if node:
+ order = self.node_np.xmlGetInt('time_scheme_order')
+ else:
+ order = self._defaultValues()['time_scheme_order']
+ return order
+
+
+ def setTimeSchemeOrder(self, order):
+ """
+ Set or remove markup of time scheme order for turbulence (LES)
+ """
+ # setTimeSchemeOrder : used only by Turbulence Model
+ self.isInt(order)
+ if order == 2:
+ self.node_np.xmlSetData('time_scheme_order', 2)
+ else:
+ self.node_np.xmlRemoveChild('time_scheme_order')
+
+#-------------------------------------------------------------------------------
+# NumericalParamEquat test case
+#-------------------------------------------------------------------------------
+
+class NumericalParamGlobalTestCase(ModelTest):
+ """
+ """
+ def checkNumericalParamGlobalInstantiation(self):
+ """
+ Check whether the NumericalParamEquatModel class could be instantiated
+ """
+ model = None
+ model = NumericalParamGlobalModel(self.case)
+ assert model != None, 'Could not instantiate NumericalParamGlobalModel'
+
+
+ def checkSetandGetGradTransp(self):
+ """
+ Check whether the NumericalParamEquatModel class
+ could be set and get gradient transposed
+ """
+ model = NumericalParamGlobalModel(self.case)
+ model.setTransposedGradient('on')
+ doc = """<numerical_parameters>
+ <gradient_transposed status="on"/>
+ </numerical_parameters>"""
+
+ assert model.node_np == self.xmlNodeFromString(doc),\
+ 'Could not set gradient transposed in NumericalParamGlobalModel'
+ assert model.getTransposedGradient() == 'on',\
+ 'Could not get gradient transposed in NumericalParamGlobalModel'
+
+ def checkSetandGetVelPesCoupl(self):
+ """
+ Check whether the NumericalParamEquatModel class
+ could be set and get velocity pressure coupling
+ """
+ model = NumericalParamGlobalModel(self.case)
+ model.setVelocityPressureCoupling('on')
+ doc = '''<numerical_parameters>
+ <velocity_pressure_coupling status="on">
+ <property label="VPsolve1" name="weight_matrix_X">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ </property>
+ <property label="VPsolve2" name="weight_matrix_Y">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ </property>
+ <property label="VPsolve3" name="weight_matrix_Z">
+ <listing_printing status="off"/>
+ <postprocessing_recording status="off"/>
+ </property>
+ </velocity_pressure_coupling>
+ </numerical_parameters>'''
+ assert model.node_np == self.xmlNodeFromString(doc),\
+ 'Could not set velocity_pressure_coupling in NumericalParamGlobalModel'
+ assert model.getVelocityPressureCoupling() == 'on',\
+ 'Could not get velocity_pressure_coupling in NumericalParamGlobalModel'
+
+ def checkSetandGetWallPressureExtrapolation(self):
+ """
+ Check whether the NumericalParamEquatModel class could be set
+ and get wall pressure extrapolation
+ """
+ model = None
+ model = NumericalParamGlobalModel(self.case)
+ model.setWallPressureExtrapolation('extrapolation')
+
+ doc = '''<numerical_parameters>
+ <wall_pressure_extrapolation>1</wall_pressure_extrapolation>
+ </numerical_parameters>'''
+ assert model.node_np == self.xmlNodeFromString(doc),\
+ 'Could not set wall pressure extrapolation in NumericalParamGlobalModel'
+ assert model.getWallPressureExtrapolation() == 'extrapolation',\
+ 'Could not get wall pressure extrapolation in NumericalParamGlobalModel'
+
+ def checkSetandGetPressureRelaxation(self):
+ """
+ Check whether the NumericalParamEquatModel class could be set
+ and get pressure relaxation
+ """
+ model = None
+ model = NumericalParamGlobalModel(self.case)
+ model.setPressureRelaxation(0.88)
+ doc = '''<numerical_parameters>
+ <pressure_relaxation>0.88</pressure_relaxation>
+ </numerical_parameters>'''
+ assert model.node_np == self.xmlNodeFromString(doc),\
+ 'Could not set pressure relaxation in NumericalParamGlobalModel'
+ assert model.getPressureRelaxation() == 0.88,\
+ 'Could not get pressure relaxation in NumericalParamGlobalModel'
+
+ def checkSetandGetDensityRelaxation(self):
+ """
+ Check whether the NumericalParamEquatModel class could be set
+ and get density relaxation
+ """
+ model = None
+ model = NumericalParamGlobalModel(self.case)
+ model.setDensityRelaxation(0.91)
+ doc = '''<numerical_parameters>
+ <density_relaxation>0.91</density_relaxation>
+ </numerical_parameters>'''
+ assert model.node_np == self.xmlNodeFromString(doc),\
+ 'Could not set density relaxation in NumericalParamGlobalModel'
+ assert model.getDensityRelaxation() == 0.91,\
+ 'Could not get density relaxation in NumericalParamGlobalModel'
+
+ def checkSetandGetGradientReconstructionruction(self):
+ """
+ Check whether the NumericalParamEquatModel class could be set
+ and get gradient_reconstruction
+ """
+ model = None
+ model = NumericalParamGlobalModel(self.case)
+ model.setGradientReconstruction(3)
+ doc = '''<numerical_parameters>
+ <gradient_reconstruction choice="3"/>
+ </numerical_parameters>'''
+ assert model.node_np == self.xmlNodeFromString(doc),\
+ 'Could not set gradient_reconstruction in NumericalParamGlobalModel'
+ assert model.getGradientReconstruction() == "3",\
+ 'Could not get gradient_reconstruction in NumericalParamGlobalModel'
+
+ def checkSetandGetsetTimeSchemeOrder(self):
+ """
+ Check whether the NumericalParamEquatModel class could be set
+ and get time scheme order
+ """
+ model = None
+ model = NumericalParamGlobalModel(self.case)
+ model.setTimeSchemeOrder(2)
+ doc = '''<numerical_parameters>
+ <time_scheme_order>2</time_scheme_order>
+ </numerical_parameters>'''
+ assert model.node_np == self.xmlNodeFromString(doc),\
+ 'Could not set time scheme order in NumericalParamGlobalModel'
+ assert model.getTimeSchemeOrder() == 2,\
+ 'Could not get time scheme order in NumericalParamGlobalModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(NumericalParamGlobalTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "NumericalParamGlobalModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/NumericalParamGlobalView.py b/gui/Pages/NumericalParamGlobalView.py
new file mode 100644
index 0000000..6075bb9
--- /dev/null
+++ b/gui/Pages/NumericalParamGlobalView.py
@@ -0,0 +1,243 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following class:
+- NumericalParamGlobalView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from NumericalParamGlobalForm import Ui_NumericalParamGlobalForm
+import Base.QtPage as QtPage
+from Pages.NumericalParamGlobalModel import NumericalParamGlobalModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("NumericalParamGlobalView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+
+class NumericalParamGlobalView(QWidget, Ui_NumericalParamGlobalForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_NumericalParamGlobalForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = NumericalParamGlobalModel(self.case)
+
+ self.labelSRROM.hide()
+ self.lineEditSRROM.hide()
+ self.line_5.hide()
+
+ # Combo models
+ self.modelEXTRAG = QtPage.ComboModel(self.comboBoxEXTRAG,2,1)
+ self.modelIMRGRA = QtPage.ComboModel(self.comboBoxIMRGRA,5,1)
+
+ self.modelEXTRAG.addItem(self.tr("Neumann 1st order"), 'neumann')
+ self.modelEXTRAG.addItem(self.tr("Extrapolation"), 'extrapolation')
+
+ self.modelIMRGRA.addItem(self.tr("Iterative handling of non-orthogonalities"),'0')
+ self.modelIMRGRA.addItem(self.tr("Least squares method over neighboring cells"),'1')
+ self.modelIMRGRA.addItem(self.tr("Least squares method over extended cell neighborhood"),'2')
+ self.modelIMRGRA.addItem(self.tr("Least squares method over partial extended cell neighborhood"),'3')
+ self.modelIMRGRA.addItem(self.tr("Iterative method with least squares initialization"),'4')
+
+ self.comboBoxEXTRAG.setSizeAdjustPolicy(QComboBox.AdjustToContents)
+
+ # Connections
+ self.connect(self.checkBoxIVISSE, SIGNAL("clicked()"), self.slotIVISSE)
+ self.connect(self.checkBoxIMGR, SIGNAL("clicked()"), self.slotIMGR)
+ self.connect(self.checkBoxIPUCOU, SIGNAL("clicked()"), self.slotIPUCOU)
+ self.connect(self.comboBoxEXTRAG, SIGNAL("activated(const QString&)"), self.slotEXTRAG)
+ self.connect(self.lineEditRELAXP, SIGNAL("textChanged(const QString &)"), self.slotRELAXP)
+ self.connect(self.comboBoxIMRGRA, SIGNAL("activated(const QString&)"), self.slotIMRGRA)
+ self.connect(self.lineEditSRROM, SIGNAL("textChanged(const QString &)"), self.slotSRROM)
+
+ # Validators
+ validatorRELAXP = QtPage.DoubleValidator(self.lineEditRELAXP, min=0., max=1.)
+ validatorRELAXP.setExclusiveMin(True)
+ validatorSRROM = QtPage.DoubleValidator(self.lineEditSRROM, min=0., max=1.)
+ validatorSRROM.setExclusiveMin(True)
+ self.lineEditRELAXP.setValidator(validatorRELAXP)
+ self.lineEditSRROM.setValidator(validatorSRROM)
+
+ if self.model.getMultigrid() == 'on':
+ self.checkBoxIMGR.setChecked(True)
+ else:
+ self.checkBoxIMGR.setChecked(False)
+
+ if self.model.getTransposedGradient() == 'on':
+ self.checkBoxIVISSE.setChecked(True)
+ else:
+ self.checkBoxIVISSE.setChecked(False)
+
+ if self.model.getVelocityPressureCoupling() == 'on':
+ self.checkBoxIPUCOU.setChecked(True)
+ else:
+ self.checkBoxIPUCOU.setChecked(False)
+
+ self.lineEditRELAXP.setText(str(self.model.getPressureRelaxation()))
+ self.modelEXTRAG.setItem(str_model=self.model.getWallPressureExtrapolation())
+ self.modelIMRGRA.setItem(str_model=self.model.getGradientReconstruction())
+
+ import Pages.FluidCharacteristicsModel as FluidCharacteristics
+ fluid = FluidCharacteristics.FluidCharacteristicsModel(self.case)
+ modl_atmo, modl_joul, modl_thermo, modl_gas, modl_coal = fluid.getThermoPhysicalModel()
+ if modl_joul != 'off' or modl_gas != 'off' or modl_coal != 'off':
+ self.labelSRROM.show()
+ self.lineEditSRROM.show()
+ self.lineEditSRROM.setText(str(self.model.getDensityRelaxation()))
+ self.line_5.show()
+
+
+ @pyqtSignature("")
+ def slotIMGR(self):
+ """
+ Set value for parameter IMGR
+ """
+ if self.checkBoxIMGR.isChecked():
+ self.model.setMultigrid("on")
+ else:
+ self.model.setMultigrid("off")
+
+
+ @pyqtSignature("")
+ def slotIVISSE(self):
+ """
+ Set value for parameter IVISSE
+ """
+ if self.checkBoxIVISSE.isChecked():
+ self.model.setTransposedGradient("on")
+ else:
+ self.model.setTransposedGradient("off")
+
+
+ @pyqtSignature("")
+ def slotIPUCOU(self):
+ """
+ Set value for parameter IPUCOU
+ """
+ if self.checkBoxIPUCOU.isChecked():
+ self.model.setVelocityPressureCoupling("on")
+ else:
+ self.model.setVelocityPressureCoupling("off")
+
+
+ @pyqtSignature("const QString &")
+ def slotEXTRAG(self, text):
+ """
+ Set value for parameter EXTRAG
+ """
+ extrag = self.modelEXTRAG.dicoV2M[str(text)]
+ self.model.setWallPressureExtrapolation(extrag)
+ log.debug("slotEXTRAG-> %s" % extrag)
+
+
+ @pyqtSignature("const QString &")
+ def slotRELAXP(self, text):
+ """
+ Set value for parameter RELAXP
+ """
+ relaxp, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.model.setPressureRelaxation(relaxp)
+ log.debug("slotRELAXP-> %s" % relaxp)
+
+
+ @pyqtSignature("const QString &")
+ def slotSRROM(self, text):
+ """
+ Set value for parameter SRROM
+ """
+ srrom, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.model.setDensityRelaxation(srrom)
+ log.debug("slotSRROM-> %s" % srrom)
+
+
+ @pyqtSignature("const QString &")
+ def slotIMRGRA(self, text):
+ """
+ Set value for parameter IMRGRA
+ """
+ imrgra = self.modelIMRGRA.getIndex(str_view=str(text))
+ self.model.setGradientReconstruction(imrgra)
+ log.debug("slotIMRGRA-> %s" % imrgra)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/OutputControlForm.ui b/gui/Pages/OutputControlForm.ui
new file mode 100644
index 0000000..0e902cb
--- /dev/null
+++ b/gui/Pages/OutputControlForm.ui
@@ -0,0 +1,690 @@
+<ui version="4.0" >
+ <class>OutputControlForm</class>
+ <widget class="QWidget" name="OutputControlForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>522</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="font" >
+ <font>
+ <weight>50</weight>
+ <italic>false</italic>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tabOUTPUT" >
+ <attribute name="title" >
+ <string>Output Control</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxListings" >
+ <property name="title" >
+ <string>Outputs listings</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxOutput" >
+ <property name="minimumSize" >
+ <size>
+ <width>275</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>275</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTLIST</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditNTLIST" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTLIST</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxPostProc" >
+ <property name="title" >
+ <string>Post-processing</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxPostProcessing" >
+ <property name="minimumSize" >
+ <size>
+ <width>275</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>275</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTCHR</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditNTCHR" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTCHR</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelICHRVL" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRVL</string>
+ </property>
+ <property name="text" >
+ <string>Fluid domain post processing</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QCheckBox" name="checkBoxICHRVL" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRVL</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelICHRBO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRBO</string>
+ </property>
+ <property name="text" >
+ <string>Domain boundary post processing</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QCheckBox" name="checkBoxICHRBO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRBO</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelICHRSY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRSY</string>
+ </property>
+ <property name="text" >
+ <string>Syrthes boundary post processing</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QCheckBox" name="checkBoxICHRSY" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRSY</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" >
+ <widget class="Line" name="line_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelMeshes" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRMD</string>
+ </property>
+ <property name="text" >
+ <string>Type of post-processing for mesh</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxMeshes" >
+ <property name="minimumSize" >
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICHRMD</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelFormats" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: FMTCHR</string>
+ </property>
+ <property name="text" >
+ <string>Post-processing format</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="comboBoxFMTCHR" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: FMTCHR</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QGroupBox" name="groupBoxOptions" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="title" >
+ <string>Options</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelformat" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="text" >
+ <string>format</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxFormat" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelPolygon" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="text" >
+ <string>polygons</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="comboBoxPolygon" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelPolyhedra" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="text" >
+ <string>polyhedra</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QComboBox" name="comboBoxPolyhedra" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelBigEndian" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="text" >
+ <string>big-endian</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QCheckBox" name="checkBoxBigEndian" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabMONITORING" >
+ <attribute name="title" >
+ <string>Monitoring Points Coordinates</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxMonitoring" >
+ <property name="title" >
+ <string>Monitoring points recording</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>37</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxHisto" >
+ <property name="minimumSize" >
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditHisto" >
+ <property name="maximumSize" >
+ <size>
+ <width>40</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTHIST</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>18</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>1000</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Monitoring points coordinates</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewPoints" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>300</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>89</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonAdd" >
+ <property name="minimumSize" >
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonDelete" >
+ <property name="minimumSize" >
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="statusTip" >
+ <string>Delet several lines if you want</string>
+ </property>
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>88</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/OutputControlModel.py b/gui/Pages/OutputControlModel.py
new file mode 100644
index 0000000..48ddb33
--- /dev/null
+++ b/gui/Pages/OutputControlModel.py
@@ -0,0 +1,632 @@
+# -*- coding: iso-8859-1 -*-
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module manages the differents possible outputs :
+- listing printing
+- post-processing and relationship with the FVM library
+- monitoring points
+
+This module defines the following classes:
+- OutputControlModel
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import string, sys, unittest
+from types import FloatType
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class OutputControlModel(Model):
+ """
+ Class for Variables and Scalar model initialization.
+ """
+ def __init__(self, case):
+ """
+ Constructor
+ """
+ self.case = case
+ node_control = self.case.xmlGetNode('analysis_control')
+ self.node_out = node_control.xmlInitNode('output')
+ self.dicoName = {}
+
+
+ def defaultInitialValues(self):
+ """
+ Return in a dictionnary which contains default values.
+ """
+ default = {}
+ default['listing_printing_frequency'] = 1
+ default['postprocessing_frequency'] = -1
+ default['probe_recording_frequency'] = 1
+ default['postprocessing_options'] = "binary"
+ default['postprocessing_format'] = "EnSight"
+ default['fluid_domain'] = "on"
+ default['domain_boundary'] = "off"
+ default['syrthes_boundary'] = "on"
+ default['postprocessing_mesh'] = '0'
+ default['coordinate'] = 0.0
+
+ return default
+
+
+ def _getCoordPoint(self, name, coord):
+ """
+ Private method: return coordinate 'coord' for probe named 'name'
+ """
+ for probe in self.node_out.xmlGetNodeList('probe'):
+ if probe['name'] == name:
+ val = probe.xmlGetDouble(coord)
+ if val == None:
+ val = self.defaultInitialValues()['coordinate']
+ self._setCoordPoint(name, coord, val)
+ return val
+
+
+ def _setCoordPoint(self, name, coord, val):
+ """
+ Private method: put value of coordinate 'coord' for probe named 'name'
+ """
+ node = self.node_out.xmlGetNode('probe', name=name)
+ node.xmlSetData(coord, val)
+
+
+ def __deleteMonitoringPoint(self, n):
+ """ Private method : remove monitoring point """
+ node = self.node_out.xmlGetNode('probe', name=n)
+ if node:
+ node.xmlRemoveNode()
+ self.case.xmlRemoveChild('probe_recording', name=n)
+ del self.dicoName[n]
+
+
+ def __deleteProbesNodes(self):
+ """ Private method : remove balise when choice = '0' is existed """
+ from OutputVolumicVariablesModel import OutputVolumicVariablesModel
+ listNodeVolum = OutputVolumicVariablesModel(self.case).listNodeVolum
+ del OutputVolumicVariablesModel
+ for nodeList in listNodeVolum:
+ for node in nodeList:
+ n = node.xmlGetChildNode('probes')
+ if n:
+ nlist = n.xmlGetChildNodeList('probe_recording')
+ if not nlist:
+ n.xmlRemoveNode()
+
+
+ def getListingFrequency(self):
+ """
+ Return the frequency for printing listing
+ """
+ f = self.node_out.xmlGetInt('listing_printing_frequency')
+ if f == None:
+ f = self.defaultInitialValues()['listing_printing_frequency']
+ self.setListingFrequency(f)
+ return f
+
+
+ def setListingFrequency(self, freq):
+ """
+ Set the frequency for printing listing
+ """
+ self.isInt(freq)
+ self.node_out.xmlSetData('listing_printing_frequency', freq)
+
+
+ def getPostprocessingFrequency(self):
+ """
+ Return the frequency for post processing output
+ """
+ f = self.node_out.xmlGetInt('postprocessing_frequency')
+ if f == None:
+ f = self.defaultInitialValues()['postprocessing_frequency']
+ self.setPostprocessingFrequency(f)
+ return f
+
+
+ def setPostprocessingFrequency(self, freq):
+ """
+ Set the frequency for post processing output
+ """
+ self.isInt(freq)
+ self.node_out.xmlSetData('postprocessing_frequency', freq)
+
+
+ def getFluidDomainPostProStatus(self):
+ """
+ Return status for traitment of fluid domain
+ """
+ nod = self.node_out.xmlInitNode('fluid_domain', 'status')
+ status = nod['status']
+ if not status:
+ status = self.defaultInitialValues()['fluid_domain']
+ self.setFluidDomainPostProStatus(status)
+ return status
+
+
+ def setFluidDomainPostProStatus(self, status):
+ """
+ Set status for traitment of fluid domain
+ """
+ self.isOnOff(status)
+ node = self.node_out.xmlInitNode('fluid_domain', 'status')
+ node['status'] = status
+
+
+ def getDomainBoundaryPostProStatus(self):
+ """
+ Return status for traitment of domain boundary
+ """
+ nod = self.node_out.xmlInitNode('domain_boundary', 'status')
+ status = nod['status']
+ if not status:
+ status = self.defaultInitialValues()['domain_boundary']
+ self.setDomainBoundaryPostProStatus(status)
+ return status
+
+
+ def setDomainBoundaryPostProStatus(self, status):
+ """
+ Set status for traitment of domain boundary
+ """
+ self.isOnOff(status)
+ node = self.node_out.xmlInitNode('domain_boundary', 'status')
+ node['status'] = status
+
+
+ def getSyrthesBoundaryPostProStatus(self):
+ """
+ Return status for traitment of syrthes boundary
+ """
+ nod = self.node_out.xmlInitNode('syrthes_boundary', 'status')
+ status = nod['status']
+ if not status:
+ status = self.defaultInitialValues()['syrthes_boundary']
+ self.setSyrthesBoundaryPostProStatus(status)
+ return status
+
+
+ def setSyrthesBoundaryPostProStatus(self, status):
+ """
+ Set status for traitment of syrthes boundary
+ """
+ self.isOnOff(status)
+ node = self.node_out.xmlInitNode('syrthes_boundary', 'status')
+ node['status'] = status
+
+
+ def getTypePostMeshes(self):
+ """
+ Return choice of type of post processing for mesh
+ """
+ node = self.node_out.xmlInitNode('postprocessing_mesh_options', 'choice')
+ choice = node['choice']
+ if not choice:
+ choice = self.defaultInitialValues()['postprocessing_mesh']
+ self.setTypePostMeshes(choice)
+ return choice
+
+
+ def setTypePostMeshes(self, choice):
+ """
+ Set choice of type of post processing for mesh
+ """
+ self.isInList(choice, ['0', '1', '2', '10', '11', '12'])
+ node = self.node_out.xmlInitNode('postprocessing_mesh_options', 'choice')
+ node['choice'] = choice
+
+
+ def getPostProFormat(self):
+ """
+ Return choice of format for post processing output file
+ """
+ node = self.node_out.xmlInitNode('postprocessing_format', 'choice')
+ choice = node['choice']
+ if not choice:
+ choice = self.defaultInitialValues()['postprocessing_format']
+ self.setPostProFormat(choice)
+ return choice
+
+
+ def setPostProFormat(self, choice):
+ """
+ Set choice of format for post processing output file
+ """
+ self.isInList(choice, ('EnSight', 'MED_fichier', 'CGNS'))
+ node = self.node_out.xmlInitNode('postprocessing_format', 'choice')
+ node['choice'] = choice
+
+
+ def getPostProOptionsFormat(self):
+ """
+ Return options for post processing output file
+ """
+ node = self.node_out.xmlInitNode('postprocessing_options', 'choice')
+ line = node['choice']
+ if not line:
+ line = self.defaultInitialValues()['postprocessing_options']
+ self.setPostProOptionsFormat(line)
+ return line
+
+
+ def setPostProOptionsFormat(self, line):
+ """
+ Set options for post processing output file
+ """
+ list = string.split(line)
+ self.isList(list)
+ n = self.node_out.xmlInitNode('postprocessing_options', 'choice')
+ n['choice'] = line
+
+
+ def getMonitoringPointFrequency(self):
+ """
+ Return the frequency for recording probes
+ """
+ f = self.node_out.xmlGetInt('probe_recording_frequency')
+ if f == None:
+ f = self.defaultInitialValues()['probe_recording_frequency']
+ self.setMonitoringPointFrequency(f)
+ return f
+
+
+ def setMonitoringPointFrequency(self, freq):
+ """
+ Set the frequency for recording probes
+ """
+ self.isInt(freq)
+ self.node_out.xmlSetData('probe_recording_frequency', freq)
+
+
+ def addMonitoringPoint(self, x=0.0, y=0.0, z=0.0):
+ """
+ Input a new monitoring point definition.
+ """
+ status="on"
+ num = 1
+ while (str(num)) in self.dicoName.keys(): num = num+1
+ num = str(num)
+ probe_num = 'item' + num
+ self.dicoName[num] = probe_num
+
+ node = self.node_out.xmlInitNode('probe', name=num, status=status)
+ for coord, val in [('probe_x', x), ('probe_y', y), ('probe_z', z)]:
+ self._setCoordPoint(num, coord, val)
+
+
+ def replaceMonitoringPointCoordinates(self, name=None, x=0.0, y=0.0, z=0.0):
+ """
+ Change the localization of a probe
+ """
+ if not name:
+ raise ValueError, "replaceMonitoringPointCoordinates : pas de nom au point de monitoring"
+
+ for coord, val in [('probe_x', x), ('probe_y', y), ('probe_z', z)]:
+ self._setCoordPoint(name, coord, val)
+
+
+ def deleteMonitoringPointsList(self, nameList):
+ """
+ Destroy the definition of a monitoring points list
+ """
+ if not nameList: return
+ for n in nameList:
+ self.__deleteMonitoringPoint(n)
+
+ self.__deleteProbesNodes()
+
+ # compactage du numero des points de monitorings
+ listprob, dicocoord = [], {}
+ for node in self.node_out.xmlGetNodeList('probe'):
+ listprob.append(node['name'])
+ dicocoord[node['name']] = (node.xmlGetDouble('probe_x'),
+ node.xmlGetDouble('probe_y'),
+ node.xmlGetDouble('probe_z'))
+ listprob.sort()
+ for n in range(len(listprob)):
+ # si l'indice de rangement ne correspond pas a un point de monitoring ...
+ if str(n+1) not in listprob:
+ # alors on fait un decalage sur tous les points de monitoring suivants
+ for num in range(n, len(listprob)):
+ for node in self.node_out.xmlGetNodeList('probe'):
+ if node['name'] == listprob[n]:
+ node['name'] = str(n+1)
+ prob = listprob[n]
+ node.xmlSetData('probe_x',dicocoord[prob][0])
+ node.xmlSetData('probe_y',dicocoord[prob][1])
+ node.xmlSetData('probe_z',dicocoord[prob][2])
+
+ for node in self.case.xmlGetNodeList('probe_recording'):
+ if node['name'] == listprob[n]:
+ node['name'] = str(n+1)
+ listprob[n] = n+1
+
+ #on réinitialise le dico pour le remplir avec les valeurs compactees
+ self.dicoName = {}
+ for n in range(len(listprob)):
+ self.dicoName[str(n+1)] = 'item'+str(listprob[n])
+
+
+ def getProbeNameList(self):
+ """
+ Return list of names of used probes
+ """
+ nameList = []
+ for probe in self.node_out.xmlGetNodeList('probe'):
+ nameList.append(probe['name'])
+ probe_num = 'item' + probe['name']
+ self.dicoName[probe['name']] = probe_num
+ return nameList
+
+
+ def getMonitoringPointInfo(self, name):
+ """
+ Return coordinates X, Y, Z for probe named 'name'
+ """
+ self.isInList(name, self.dicoName.keys())
+ X = self._getCoordPoint(name, 'probe_x')
+ Y = self._getCoordPoint(name, 'probe_y')
+ Z = self._getCoordPoint(name, 'probe_z')
+ return X, Y, Z
+
+
+#-------------------------------------------------------------------------------
+# OutputControlModel test Class
+#-------------------------------------------------------------------------------
+
+class OutputControlModelTestCase(ModelTest):
+ """
+ """
+ def checkOutputControlModeInstantiation(self):
+ """Check whether the OutputControlModel class could be instantiated"""
+ model = None
+ model = OutputControlModel(self.case)
+ assert model != None, 'Could not instantiate OutputControlModel'
+
+ def checkSetandGetListingFrequency(self):
+ """Check whether the frequency of output listing could be set and get"""
+ model = OutputControlModel(self.case)
+ model.setListingFrequency(12)
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <listing_printing_frequency>12</listing_printing_frequency>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set frequency for listing output control model'
+ assert model.getListingFrequency() == 12, \
+ 'Could not get frequency for listing output control model'
+
+ def checkSetandGetPostprocessingFrequency(self):
+ """Check whether the frequency of post processing could be set and get"""
+ model = OutputControlModel(self.case)
+ model.setPostprocessingFrequency(13)
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <postprocessing_frequency>13</postprocessing_frequency>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set frequency for post processing output control model'
+ assert model.getPostprocessingFrequency() == 13, \
+ 'Could not get frequency for post processing output control model'
+
+ def checkSetandGetFluidDomainPostProStatus(self):
+ """Check whether the status of post processing for fluid domain could be set and get"""
+ model = OutputControlModel(self.case)
+ model.setFluidDomainPostProStatus('off')
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <fluid_domain status="off"/>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set status of post processing for fluid domain for output control model'
+ assert model.getFluidDomainPostProStatus() == 'off', \
+ 'Could not get status of post processing for fluid domain for output control model'
+
+ def checkSetandGetDomainBoundaryPostProStatus(self):
+ """
+ Check whether the status of post processing for domain
+ boundary could be set and get
+ """
+ model = OutputControlModel(self.case)
+ model.setDomainBoundaryPostProStatus('on')
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <domain_boundary status="on"/>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set status of post processing for domain boundary for output control model'
+ assert model.getDomainBoundaryPostProStatus() == 'on', \
+ 'Could not get status of post processing for domain boundary for output control model'
+
+ def checkSetandGetSyrthesBoundaryPostProStatus(self):
+ """
+ Check whether the status of post processing for boundary
+ syrthes post processing could be set and get
+ """
+ model = OutputControlModel(self.case)
+ model.setSyrthesBoundaryPostProStatus('on')
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <syrthes_boundary status="on"/>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set status of post processing for syrthes boundary for output control model'
+ assert model.getSyrthesBoundaryPostProStatus() == 'on', \
+ 'Could not get status of post processing for syrthes boundary for output control model'
+
+ def checkSetandGetTypePostMeshes(self):
+ """Check whether the type of mesh's post processing could be set and get"""
+ model = OutputControlModel(self.case)
+ model.setTypePostMeshes('2')
+ doc = '''<output>
+ <postprocessing_mesh_options choice="2"/>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set type of post processing for mesh in output control model'
+ assert model.getTypePostMeshes() == '2', \
+ 'Could not get type of post processing for mesh in output control model'
+
+ def checkSetandGetPostProFormat(self):
+ """Check whether the format for post processing could be set and get"""
+ model = OutputControlModel(self.case)
+ model.setPostProFormat('MED_fichier')
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <postprocessing_format choice="MED_fichier"/>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set format of post processing in output control model'
+ assert model.getPostProFormat() == 'MED_fichier', \
+ 'Could not get format of post processing in output control model'
+
+ def checkSetandGetPostProOptionsFormat(self):
+ """
+ Check whether the options of format for post processing could be set and get
+ """
+ model = OutputControlModel(self.case)
+ model.setPostProOptionsFormat('big_endian,divide_polyhedra')
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <postprocessing_options choice="big_endian,divide_polyhedra"/>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc), \
+ 'Could not set the options of format for post processing in output control model'
+ assert model.getPostProOptionsFormat() == 'big_endian,divide_polyhedra', \
+ 'Could not get the options of format for post processing in output control model'
+
+ def checkSetandGetMonitoringPointFrequency(self):
+ """
+ Check whether the frequency of monitoring point could be set and get
+ """
+ model = OutputControlModel(self.case)
+ model.setMonitoringPointFrequency(15)
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <probe_recording_frequency>15</probe_recording_frequency>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc),\
+ 'Could not set the frequency of monitoring point in output control model'
+ assert model.getMonitoringPointFrequency() == 15,\
+ 'Could not get the frequency of monitoring point in output control model'
+
+ def checkAddMonitoringPoint(self):
+ """
+ Check whether monitoring point could be added
+ """
+ model = OutputControlModel(self.case)
+ model.addMonitoringPoint(11.1, 22.2, 33.3)
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <probe name="1" status="on">
+ <probe_x>11.1</probe_x>
+ <probe_y>22.2</probe_y>
+ <probe_z>33.3</probe_z>
+ </probe>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc),\
+ 'Could not add monitoring point in output control model'
+ assert model.getMonitoringPointInfo("1") == (11.1, 22.2, 33.3),\
+ 'Could not get monitoring point in output control model'
+
+ def checkReplaceMonitoringPoint(self):
+ """
+ Check whether monitoring point could be replaced
+ """
+ model = OutputControlModel(self.case)
+ model.addMonitoringPoint(11.1, 22.2, 33.3)
+ model.addMonitoringPoint(5, 5.1, 5.21)
+ model.replaceMonitoringPointCoordinates("2",5., 6, 7.)
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <probe name="1" status="on">
+ <probe_x>11.1</probe_x>
+ <probe_y>22.2</probe_y>
+ <probe_z>33.3</probe_z>
+ </probe>
+ <probe name="2" status="on">
+ <probe_x>5</probe_x>
+ <probe_y>6</probe_y>
+ <probe_z>7</probe_z>
+ </probe>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc),\
+ 'Could not replace monitoring point in output control model'
+
+
+ def checkDeleteMonitoringPoint(self):
+ """
+ Check whether monitoring point could be deleted
+ """
+ model = OutputControlModel(self.case)
+ model.addMonitoringPoint(11.1, 22.2, 33.3)
+ model.addMonitoringPoint(5, 5.1, 5.21)
+ model.addMonitoringPoint(9.,8.,7.)
+ model.deleteMonitoringPointsList("2")
+ doc = '''<output>
+ <postprocessing_mesh_options choice="0"/>
+ <probe name="1" status="on">
+ <probe_x>11.1</probe_x>
+ <probe_y>22.2</probe_y>
+ <probe_z>33.3</probe_z>
+ </probe>
+ <probe name="2" status="on">
+ <probe_x>9</probe_x>
+ <probe_y>8</probe_y>
+ <probe_z>7</probe_z>
+ </probe>
+ </output>'''
+ assert model.node_out== self.xmlNodeFromString(doc),\
+ 'Could not delete monitoring point in output control model'
+
+
+def suite():
+ testSuite = unittest.makeSuite(OutputControlModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "OutputControlModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/OutputControlView.py b/gui/Pages/OutputControlView.py
new file mode 100644
index 0000000..6112000
--- /dev/null
+++ b/gui/Pages/OutputControlView.py
@@ -0,0 +1,748 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module manages the layout of outputs control:
+- listing printing
+- post-processing and relationship with the FVM library
+- monitoring points
+
+This module defines the following classes:
+- StandardItemModelMonitoring
+- MonitoringPointDelegate
+- OutputControliew
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import string
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from OutputControlForm import Ui_OutputControlForm
+import Base.QtPage as QtPage
+from OutputControlModel import OutputControlModel
+from SolutionDomainModel import SolutionDomainModel
+from MobileMeshModel import MobileMeshModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("OutputControlView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# QStandardItemModel for monitoring points QTableView
+#-------------------------------------------------------------------------------
+
+class StandardItemModelMonitoring(QStandardItemModel):
+ def __init__(self):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.setColumnCount(4)
+ self.dataMonitoring = []
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.DisplayRole:
+
+ row = index.row()
+ dico = self.dataMonitoring[row]
+
+ if index.column() == 0:
+ return QVariant(dico['n'])
+ elif index.column() == 1:
+ return QVariant(dico['X'])
+ elif index.column() == 2:
+ return QVariant(dico['Y'])
+ elif index.column() == 3:
+ return QVariant(dico['Z'])
+ else:
+ return QVariant()
+
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if index.column() == 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ if section == 0:
+ return QVariant(self.tr("n"))
+ elif section == 1:
+ return QVariant(self.tr("X"))
+ elif section == 2:
+ return QVariant(self.tr("Y"))
+ elif section == 3:
+ return QVariant(self.tr("Z"))
+ return QVariant()
+
+
+ def setData(self, index, value, role=None):
+ row = index.row()
+ if index.column() == 0:
+ n, ok = value.toInt()
+ self.dataMonitoring[row]['n'] = n
+ elif index.column() == 1:
+ X, ok = value.toDouble()
+ self.dataMonitoring[row]['X'] = X
+ elif index.column() == 2:
+ Y, ok = value.toDouble()
+ self.dataMonitoring[row]['Y'] = Y
+ elif index.column() == 3:
+ Z, ok = value.toDouble()
+ self.dataMonitoring[row]['Z'] = Z
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def insertData(self, num, X, Y, Z):
+ """
+ Add a new 'item' into the table.
+ """
+ dico = {}
+ dico['n'] = num
+ dico['X'] = X
+ dico['Y'] = Y
+ dico['Z'] = Z
+ self.dataMonitoring.append(dico)
+
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+
+ def deleteAllData(self):
+ """
+ Destroy the contents of the list.
+ """
+ self.dataMonitoring = []
+ self.setRowCount(0)
+
+#-------------------------------------------------------------------------------
+# QItemDelegate for monitoring points QTableView
+#-------------------------------------------------------------------------------
+
+class MonitoringPointDelegate(QItemDelegate):
+ def __init__(self, parent=None, xml_model=None):
+ """ Construtor.
+
+ @param: parent ancestor object
+ @xml_model: monitoring points model
+ """
+ super(MonitoringPointDelegate, self).__init__(parent)
+ self.table = parent
+ self.mdl = xml_model
+
+
+ def createEditor(self, parent, option, index):
+ if index.column() == 0:
+ editor = QFrame(parent)
+ else:
+ editor = QLineEdit(parent)
+ editor.setValidator(QtPage.DoubleValidator(editor))
+ editor.setFrame(False)
+ self.connect(editor, SIGNAL("returnPressed()"), self.commitAndCloseEditor)
+ editor.setCursorPosition(0)
+ return editor
+
+
+ def commitAndCloseEditor(self):
+ editor = self.sender()
+ if isinstance(editor, QLineEdit):
+ self.emit(SIGNAL("commitData(QWidget*)"), editor)
+ self.emit(SIGNAL("closeEditor(QWidget*)"), editor)
+
+
+ def setEditorData(self, editor, index):
+ text = index.model().data(index, Qt.DisplayRole).toString()
+ if isinstance(editor, QLineEdit):
+ editor.setText(text)
+
+
+ def setModelData(self, editor, model, index):
+ if isinstance(editor, QLineEdit):
+ if not editor.isModified():
+ return
+
+ item = editor.text()
+ selectionModel = self.table.selectionModel()
+ for index in selectionModel.selectedRows(index.column()):
+ model.setData(index, QVariant(item), Qt.DisplayRole)
+ dico = model.dataMonitoring[index.row()]
+ self.mdl.replaceMonitoringPointCoordinates(dico['n'],
+ dico['X'],
+ dico['Y'],
+ dico['Z'])
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class OutputControlView(QWidget, Ui_OutputControlForm):
+ """
+ """
+ def __init__(self, parent, case, tree):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_OutputControlForm.__init__(self)
+ self.setupUi(self)
+
+ self.browser = tree
+ self.case = case
+ self.mdl = OutputControlModel(self.case)
+
+ # Combo models
+
+ self.modelOutput = QtPage.ComboModel(self.comboBoxOutput,3,1)
+ self.modelPostProcessing = QtPage.ComboModel(self.comboBoxPostProcessing,2,1)
+ self.modelMeshes = QtPage.ComboModel(self.comboBoxMeshes,3,1)
+ self.modelFMTCHR = QtPage.ComboModel(self.comboBoxFMTCHR,3,1)
+ self.modelFormat = QtPage.ComboModel(self.comboBoxFormat,2,1)
+ self.modelPolygon = QtPage.ComboModel(self.comboBoxPolygon,3,1)
+ self.modelPolyhedra = QtPage.ComboModel(self.comboBoxPolyhedra,3,1)
+ self.modelHisto = QtPage.ComboModel(self.comboBoxHisto,3,1)
+
+ self.modelOutput.addItem(self.tr("No output"), 'None')
+ self.modelOutput.addItem(self.tr("Output listing at each time step"), 'At each step')
+ self.modelOutput.addItem(self.tr("Output every 'n' time steps"), 'Frequency_l')
+
+ self.modelPostProcessing.addItem(self.tr("Only at the end of calculation"), 'At the end')
+ self.modelPostProcessing.addItem(self.tr("At each time step"), 'At each step')
+ self.modelPostProcessing.addItem(self.tr("Post-processing every 'n' time steps"), 'Frequency_c')
+
+ self.modelMeshes.addItem(self.tr("fixed"), '0')
+ self.modelMeshes.addItem(self.tr("deformable"), '1')
+ self.modelMeshes.addItem(self.tr("modifiable"), '2')
+ self.modelMeshes.addItem(self.tr("fixed (with displacement)"), '10')
+ self.modelMeshes.addItem(self.tr("deformable (with displacement)"), '11')
+ self.modelMeshes.addItem(self.tr("modifiable (with displacement)"), '12')
+
+ ale = MobileMeshModel(self.case).getMethod()
+ if ale == 'off':
+ self.modelMeshes.disableItem(str_model='10')
+ self.modelMeshes.disableItem(str_model='11')
+ self.modelMeshes.disableItem(str_model='12')
+
+ self.modelFMTCHR.addItem(self.tr("EnSight Gold"), 'EnSight')
+ self.modelFMTCHR.addItem(self.tr("MED"), 'MED_fichier')
+ self.modelFMTCHR.addItem(self.tr("CGNS"), 'CGNS')
+
+ self.modelFormat.addItem(self.tr("binary"), 'binary')
+ self.modelFormat.addItem(self.tr("text"), 'text')
+
+ self.modelPolygon.addItem(self.tr("display"), 'display')
+ self.modelPolygon.addItem(self.tr("discard"), 'discard_polygons')
+ self.modelPolygon.addItem(self.tr("subdivide"), 'divide_polygons')
+
+ self.modelPolyhedra.addItem(self.tr("display"), 'display')
+ self.modelPolyhedra.addItem(self.tr("discard"), 'discard_polyhedra')
+ self.modelPolyhedra.addItem(self.tr("subdivide"), 'divide_polyhedra')
+
+ self.modelHisto.addItem(self.tr("No monitoring points file"), 'None')
+ self.modelHisto.addItem(self.tr("Monitoring points files at each time step"), 'At each step')
+ self.modelHisto.addItem(self.tr("Monitoring points file every 'n' time steps"), 'Frequency_h')
+
+ # Model for QTableView
+
+ self.modelMonitoring = StandardItemModelMonitoring()
+ self.tableViewPoints.setModel(self.modelMonitoring)
+ self.tableViewPoints.resizeColumnToContents(0)
+ self.tableViewPoints.resizeRowsToContents()
+ self.tableViewPoints.setAlternatingRowColors(True)
+ self.tableViewPoints.setSelectionBehavior(QAbstractItemView.SelectRows)
+ self.tableViewPoints.setSelectionMode(QAbstractItemView.ExtendedSelection)
+ self.tableViewPoints.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewPoints.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+ delegate = MonitoringPointDelegate(self.tableViewPoints, self.mdl)
+ self.tableViewPoints.setItemDelegate(delegate)
+
+ # Connections
+
+ self.connect(self.comboBoxOutput, SIGNAL("activated(const QString&)"), self.slotOutputListing)
+ self.connect(self.lineEditNTLIST, SIGNAL("textChanged(const QString &)"), self.slotListingFrequency)
+ self.connect(self.comboBoxPostProcessing, SIGNAL("activated(const QString&)"), self.slotOutputPostpro)
+ self.connect(self.lineEditNTCHR, SIGNAL("textChanged(const QString &)"), self.slotPostproFrequency)
+ self.connect(self.checkBoxICHRVL, SIGNAL("clicked()"), self.slotVolumeOuput)
+ self.connect(self.checkBoxICHRBO, SIGNAL("clicked()"), self.slotBoundaryOuput)
+ self.connect(self.checkBoxICHRSY, SIGNAL("clicked()"), self.slotSyrthesOutput)
+ self.connect(self.comboBoxMeshes, SIGNAL("activated(const QString&)"), self.slotTypePostMeshes)
+ self.connect(self.comboBoxFMTCHR, SIGNAL("activated(const QString&)"), self.slotOutputFormat)
+ self.connect(self.comboBoxFormat, SIGNAL("activated(const QString&)"), self.slotOutputOptions)
+ self.connect(self.comboBoxPolygon, SIGNAL("activated(const QString&)"), self.slotOutputOptions)
+ self.connect(self.comboBoxPolyhedra, SIGNAL("activated(const QString&)"), self.slotOutputOptions)
+ self.connect(self.checkBoxBigEndian, SIGNAL("clicked()"), self.slotOutputOptions)
+
+
+ self.connect(self.toolButtonAdd, SIGNAL("clicked()"), self.slotAddMonitoringPoint)
+ self.connect(self.toolButtonDelete, SIGNAL("clicked()"), self.slotDeleteMonitoringPoints)
+ self.connect(self.comboBoxHisto, SIGNAL("activated(const QString&)"), self.slotMonitoringPoint)
+ self.connect(self.lineEditHisto, SIGNAL("textChanged(const QString &)"), self.slotMonitoringPointFrequency)
+
+ # Validators
+
+ validatorNTLIST = QtPage.IntValidator(self.lineEditNTLIST, min=1)
+ validatorNTCHR = QtPage.IntValidator(self.lineEditNTCHR, min=1)
+ validatorNTHIST = QtPage.IntValidator(self.lineEditHisto, min=1)
+ self.lineEditNTLIST.setValidator(validatorNTLIST)
+ self.lineEditNTCHR.setValidator(validatorNTCHR)
+ self.lineEditHisto.setValidator(validatorNTHIST)
+
+ # Initialisation of the listing frequency
+
+ ntlist = self.mdl.getListingFrequency()
+ if ntlist == -1:
+ m = "None"
+ elif ntlist == 1:
+ m = "At each step"
+ else:
+ m = "Frequency_l"
+ self.modelOutput.setItem(str_model=m)
+ t = self.modelOutput.dicoM2V[m]
+ self.lineEditNTLIST.setText(QString(str(ntlist)))
+ self.slotOutputListing(t)
+
+ # Initialisation of the post-pro output frequency
+
+ ntchr = self.mdl.getPostprocessingFrequency()
+ if ntchr == -1:
+ m = "At the end"
+ elif ntchr == 1:
+ m = "At each step"
+ else:
+ m = "Frequency_c"
+ self.modelPostProcessing.setItem(str_model=m)
+ t = self.modelPostProcessing.dicoM2V[m]
+ self.lineEditNTCHR.setText(QString(str(ntchr)))
+ self.slotOutputPostpro(t)
+
+ # Initialisation of the monitoring points files
+
+ nthist = self.mdl.getMonitoringPointFrequency()
+ if nthist == -1:
+ m = "None"
+ elif nthist == 1:
+ m = "At each step"
+ else:
+ m = "Frequency_h"
+ self.modelHisto.setItem(str_model=m)
+ t = self.modelHisto.dicoM2V[m]
+ self.lineEditHisto.setText(QString(str(nthist)))
+ self.slotMonitoringPoint(t)
+
+ # ICHRVL, ICHRBO, ICHRSY
+
+ if self.mdl.getFluidDomainPostProStatus() == "on":
+ self.checkBoxICHRVL.setChecked(True)
+ else:
+ self.checkBoxICHRVL.setChecked(False)
+
+ if self.mdl.getDomainBoundaryPostProStatus() == "on":
+ self.checkBoxICHRBO.setChecked(True)
+ else:
+ self.checkBoxICHRBO.setChecked(False)
+
+ syrthes = SolutionDomainModel(self.case).getSyrthesCouplingStatus()
+ if syrthes != 'on':
+ self.labelICHRSY.hide()
+ self.checkBoxICHRSY.hide()
+
+ self.checkBoxICHRSY.setChecked(False)
+ if syrthes == "on":
+ self.checkBoxICHRSY.setChecked(True)
+ if self.mdl.getDomainBoundaryPostProStatus() == "off":
+ self.checkBoxICHRSY.setChecked(False)
+
+ # values of type of mesh's post processing
+
+ if self.mdl.getTypePostMeshes() == '0':
+ if ale == 'on':
+ self.modelMeshes.setItem(str_model='10')
+ else:
+ self.modelMeshes.setItem(str_model='0')
+ else:
+ self.modelMeshes.setItem(str_model=self.mdl.getTypePostMeshes())
+
+
+ # values of post processing's format
+
+ fmt = self.mdl.getPostProFormat()
+ self.modelFMTCHR.setItem(str_model=fmt)
+ line = self.mdl.getPostProOptionsFormat()
+ self.__updateOptionsFormat(line)
+
+ # Monitoring points initialisation
+
+ for name in self.mdl.getProbeNameList():
+ X, Y, Z = self.mdl.getMonitoringPointInfo(name)
+ self.__insertMonitoringPoint(name, X, Y, Z)
+
+
+ @pyqtSignature("const QString &")
+ def slotOutputListing(self, text):
+ """
+ INPUT choice of the output listing
+ """
+ listing = self.modelOutput.dicoV2M[str(text)]
+ log.debug("slotOutputListing-> listing = %s" % listing)
+
+ if listing == "None":
+ ntlist = -1
+ self.mdl.setListingFrequency(ntlist)
+ self.lineEditNTLIST.setText(QString(str(ntlist)))
+ self.lineEditNTLIST.setDisabled(True)
+
+ elif listing == "At each step":
+ ntlist = 1
+ self.lineEditNTLIST.setText(QString(str(ntlist)))
+ self.lineEditNTLIST.setDisabled(True)
+
+ elif listing == "Frequency_l":
+ self.lineEditNTLIST.setEnabled(True)
+ ntlist, ok = self.lineEditNTLIST.text().toInt()
+ if ntlist < 1:
+ ntlist = 1
+ self.lineEditNTLIST.setText(QString(str(ntlist)))
+
+
+ @pyqtSignature("const QString &")
+ def slotListingFrequency(self, text):
+ """
+ Input the frequency of the listing output
+ """
+ n, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ log.debug("slotListingFrequency-> NTLIST = %s" % n)
+ self.mdl.setListingFrequency(n)
+
+
+ @pyqtSignature("const QString &")
+ def slotOutputPostpro(self, text):
+ """
+ INPUT choice of the output for the Postprocessor (Ensight,...)
+ """
+ chrono = self.modelPostProcessing.dicoV2M[str(text)]
+ log.debug("slotOutputPostpro-> chrono = %s" % chrono)
+
+ if chrono == "At the end":
+ ntchr = -1
+ self.mdl.setPostprocessingFrequency(ntchr)
+ self.lineEditNTCHR.setText(QString(str(ntchr)))
+ self.lineEditNTCHR.setEnabled(False)
+
+ elif chrono == "At each step":
+ ntchr = 1
+ self.lineEditNTCHR.setText(QString(str(ntchr)))
+ self.lineEditNTCHR.setEnabled(False)
+
+ elif chrono == "Frequency_c":
+ self.lineEditNTCHR.setEnabled(True)
+ ntchr, ok = self.lineEditNTCHR.text().toInt()
+ if ntchr < 1:
+ ntchr = 1
+ self.lineEditNTCHR.setText(QString(str(ntchr)))
+
+
+ @pyqtSignature("const QString &")
+ def slotPostproFrequency(self, text):
+ """
+ Input the frequency of the post-processing output
+ """
+ n, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ log.debug("slotPostproFrequency-> NTCHR = %s" % n)
+ self.mdl.setPostprocessingFrequency(n)
+
+
+ @pyqtSignature("const QString &")
+ def slotMonitoringPoint(self, text):
+ """
+ Input choice of the output of monitoring points files
+ """
+ histo = self.modelHisto.dicoV2M[str(text)]
+ log.debug("slotMonitoringPoint-> histo = %s" % histo)
+
+ if histo == "None":
+ nthist = -1
+ self.mdl.setMonitoringPointFrequency(nthist)
+ self.lineEditHisto.setText(QString(str(nthist)))
+ self.lineEditHisto.setEnabled(False)
+
+ if histo == "At each step":
+ nthist = 1
+ self.lineEditHisto.setText(QString(str(nthist)))
+ self.lineEditHisto.setEnabled(False)
+
+ if histo == "Frequency_h":
+ self.lineEditHisto.setEnabled(True)
+ nthist, ok = self.lineEditHisto.text().toInt()
+ if nthist < 1:
+ nthist = 1
+ self.lineEditHisto.setText(QString(str(nthist)))
+
+
+ @pyqtSignature("const QString &")
+ def slotMonitoringPointFrequency(self, text):
+ """
+ Input the frequency of the monitoring point output
+ """
+ n, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ log.debug("slotMonitoringPointFrequency-> NTHIST = %s" % n)
+ self.mdl.setMonitoringPointFrequency(n)
+
+
+ @pyqtSignature("")
+ def slotVolumeOuput(self):
+ """
+ Input value of ICHRVL
+ """
+ if self.checkBoxICHRVL.isChecked():
+ self.mdl.setFluidDomainPostProStatus('on')
+ else:
+ self.mdl.setFluidDomainPostProStatus('off')
+
+
+ @pyqtSignature("")
+ def slotBoundaryOuput(self):
+ """
+ Input value of ICHRBO
+ """
+ if self.checkBoxICHRBO.isChecked():
+ self.mdl.setDomainBoundaryPostProStatus('on')
+ else:
+ self.mdl.setDomainBoundaryPostProStatus('off')
+
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("")
+ def slotSyrthesOutput(self):
+ """
+ Input value of ICHRSY
+ """
+ if self.checkBoxICHRSY.isChecked():
+ self.mdl.setSyrthesBoundaryPostProStatus('on')
+ else:
+ self.mdl.setSyrthesBoundaryPostProStatus('off')
+
+
+ @pyqtSignature("const QString &")
+ def slotTypePostMeshes(self, text):
+ """
+ Input type of post-processing for mesh
+ """
+ self.mdl.setTypePostMeshes(self.modelMeshes.dicoV2M[str(text)])
+
+
+ @pyqtSignature("const QString &")
+ def slotOutputFormat(self, text):
+ """
+ Input format of post-processing
+ """
+ format = self.modelFMTCHR.dicoV2M[str(text)]
+ if self.mdl.getPostProFormat() != format:
+ self.mdl.setPostProFormat(format)
+ line = self.mdl.defaultInitialValues()['postprocessing_options']
+ self.mdl.setPostProOptionsFormat(line)
+ self.__updateOptionsFormat(line)
+
+
+ @pyqtSignature("")
+ def slotOutputOptions(self):
+ """
+ Create characters ligne for command of format's options
+ """
+ line = []
+ opt_format = self.modelFormat.dicoV2M[str(self.comboBoxFormat.currentText())]
+ line.append(opt_format)
+
+ if self.checkBoxBigEndian.isChecked():
+ line.append('big_endian')
+
+ opt_polygon = self.modelPolygon.dicoV2M[str(self.comboBoxPolygon.currentText())]
+ opt_polyhed = self.modelPolyhedra.dicoV2M[str(self.comboBoxPolyhedra.currentText())]
+ if opt_polygon != 'display': line.append(opt_polygon)
+ if opt_polyhed != 'display': line.append(opt_polyhed)
+
+ l = string.join(line, ',')
+ log.debug("slotOutputOptions-> OPTCHR = %s" % l)
+ self.mdl.setPostProOptionsFormat(l)
+
+
+ def __updateOptionsFormat(self, line):
+ """
+ Update ligne for command of format's options at each modification of
+ post processing format
+ """
+ list = string.split(line, ',')
+ format = self.modelFMTCHR.dicoV2M[str(self.comboBoxFMTCHR.currentText())]
+ log.debug("__updateOptionsFormat-> FMTCHR = %s" % format)
+ log.debug("__updateOptionsFormat-> OPTCHR = %s" % line)
+
+ # update widgets from the options list
+
+ for opt in list:
+
+ if opt == 'binary' or opt == 'text' :
+ self.modelFormat.setItem(str_model=opt)
+
+ if opt == 'discard_polygons' or opt == 'divide_polygons':
+ self.modelPolygon.setItem(str_model=opt)
+
+ if opt == 'discard_polyhedra' or opt == 'divide_polyhedra':
+ self.modelPolyhedra.setItem(str_model=opt)
+
+ if format == 'EnSight':
+ if opt == 'big_endian':
+ self.checkBoxBigEndian.setChecked(True)
+## if opt == 'split_tensors':
+## self.opt_splittens.set('on')
+
+ if 'discard_polygons' not in list and 'divide_polygons' not in list:
+ self.modelPolygon.setItem(str_model="display")
+ if 'discard_polyhedra' not in list and 'divide_polyhedra' not in list:
+ self.modelPolyhedra.setItem(str_model="display")
+ if 'big_endian' not in list:
+ self.checkBoxBigEndian.setChecked(False)
+## if 'split_tensors' not in list:
+## self.opt_splittens.set('off')
+
+ # enable and disable options related to the format
+
+ if format != "EnSight":
+
+ if format == "CGNS":
+ self.modelPolyhedra.setItem(str_model='divide_polyhedra')
+ self.modelPolyhedra.disableItem(str_model='display')
+
+ self.modelFormat.setItem(str_model="binary")
+ self.modelFormat.disableItem(str_model='text')
+ self.labelBigEndian.setEnabled(False)
+ self.checkBoxBigEndian.setEnabled(False)
+ else:
+ self.modelFormat.enableItem(str_model='text')
+ self.comboBoxFormat.setEnabled(True)
+ self.labelBigEndian.setEnabled(True)
+ self.checkBoxBigEndian.setEnabled(True)
+ self.modelPolyhedra.enableItem(str_model='display')
+ self.comboBoxPolyhedra.setEnabled(True)
+
+
+ def __insertMonitoringPoint(self, num, X, Y, Z):
+ """
+ Add a new 'item' into the Hlist.
+ """
+ probe_num = self.mdl.dicoName[str(num)]
+ self.modelMonitoring.insertData(num, X, Y, Z)
+
+
+ @pyqtSignature("")
+ def slotAddMonitoringPoint(self):
+ """
+ Add one monitoring point with these coordinates in the list in the Hlist
+ The number of the monitoring point is added at the precedent one
+ """
+ self.mdl.addMonitoringPoint(x=0, y=0, z=0)
+ nameList = self.mdl.getProbeNameList()
+ self.__insertMonitoringPoint(len(nameList), QString('0'), QString('0'), QString('0'))
+
+
+ @pyqtSignature("")
+ def slotDeleteMonitoringPoints(self):
+ """
+ Just delete the current selected entries from the Hlist and
+ of course from the XML file.
+ """
+ rowList = []
+ selectionModel = self.tableViewPoints.selectionModel()
+ for index in selectionModel.selectedRows():
+ row = index.row()
+ rowList.append(str(index.row() + 1))
+
+ self.mdl.deleteMonitoringPointsList(rowList)
+
+ self.modelMonitoring.deleteAllData()
+ nameList = self.mdl.getProbeNameList()
+ for name in nameList:
+ X, Y, Z = self.mdl.getMonitoringPointInfo(name)
+ self.__insertMonitoringPoint(name, X, Y, Z)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/OutputSurfacicVariablesForm.ui b/gui/Pages/OutputSurfacicVariablesForm.ui
new file mode 100644
index 0000000..4b7e749
--- /dev/null
+++ b/gui/Pages/OutputSurfacicVariablesForm.ui
@@ -0,0 +1,75 @@
+<ui version="4.0" >
+ <class>OutputSurfacicVariablesForm</class>
+ <widget class="QWidget" name="OutputSurfacicVariablesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>245</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Solution control</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QTableView" name="tableViewOutput" />
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/OutputSurfacicVariablesModel.py b/gui/Pages/OutputSurfacicVariablesModel.py
new file mode 100644
index 0000000..eb2ccd6
--- /dev/null
+++ b/gui/Pages/OutputSurfacicVariablesModel.py
@@ -0,0 +1,256 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- OutputVariableModel
+- OutputVariableModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import string, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLmodel import ModelTest
+from Base.XMLvariables import Model
+from Pages.ThermalScalarModel import ThermalScalarModel
+from Pages.ThermalRadiationModel import ThermalRadiationModel
+
+#-------------------------------------------------------------------------------
+# Output model class
+#-------------------------------------------------------------------------------
+
+class OutputSurfacicVariablesModel(Model):
+
+ def __init__(self, case):
+ """
+ Constuctor
+ """
+ self.case = case
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.listNodeSurface = (self._getListOfVelocityPressureSurfacicProperties(),
+ self._getThermalScalarSurfacicProperties(),
+ self._getThermalRadiativeSurfacicProperties())
+
+ self.dicoLabelName = {}
+ self.list_name = []
+ self._updateDicoLabelName()
+
+
+ def _defaultValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['status'] = "on"
+
+ return default
+
+
+ def _getListOfVelocityPressureSurfacicProperties(self):
+ """
+ Private method: return node of yplus, all_variables and effort
+ """
+ nodeList = []
+ self.node_veloce = self.node_models.xmlInitNode('velocity_pressure')
+ for node in self.node_veloce.xmlGetNodeList('property'):
+ if node['support']:
+ nodeList.append(node)
+ return nodeList
+
+
+ def _getThermalScalarSurfacicProperties(self):
+ """
+ Private method: return list of volumic properties for thermal radiation
+ """
+ nodeList = []
+ self.node_therm = self.node_models.xmlGetNode('thermal_scalar')
+ if ThermalScalarModel(self.case).getThermalScalarModel() != "off":
+ for node in self.node_therm.xmlGetChildNodeList('property'):
+ if node['support']:
+ nodeList.append(node)
+ return nodeList
+
+
+ def _getThermalRadiativeSurfacicProperties(self):
+ """
+ Private method: return list of volumic properties for thermal radiation
+ """
+ nodeList = []
+ self.node_ray = self.node_models.xmlGetNode('radiative_transfer')
+ if ThermalRadiationModel(self.case).getRadiativeModel() != "off":
+ for node in self.node_ray.xmlGetChildNodeList('property'):
+ if node['support']:
+ nodeList.append(node)
+ return nodeList
+
+
+ def _updateDicoLabelName(self):
+ """
+ Private method: update dictionaries of labels for all properties .....
+ """
+ for nodeList in self.listNodeSurface:
+ for node in nodeList:
+ name = node['name']
+ if not name:
+ name = node['label']
+ if not node['label']:
+ msg = "xml node named "+ name +" has no label"
+ raise ValueError, msg
+ self.dicoLabelName[name] = node['label']
+ self.list_name.append(name)
+
+
+ def getLabelsList(self):
+ """
+ Return list of labels for all properties .....Only for the View
+ """
+ list = []
+ for nodeList in self.listNodeSurface:
+ for node in nodeList:
+ list.append(node['label'])
+ return list
+
+
+ def setPropertyLabel(self, old_label, new_label):
+ """
+ Replace old_label by new_label for node with name and old_label. Only for the View
+ """
+ self.isInList(old_label, self.getLabelsList())
+ if old_label != new_label:
+ self.isNotInList(new_label, self.getLabelsList())
+ for nodeList in self.listNodeSurface:
+ for node in nodeList:
+ if node['label'] == old_label:
+ node['label'] = new_label
+ self._updateDicoLabelName()
+
+
+ def getPostProcessing(self, label):
+ """ Return status of post processing for node withn label 'label'"""
+ self.isInList(label, self.getLabelsList())
+ status = self._defaultValues()['status']
+ for nodeList in self.listNodeSurface:
+ for node in nodeList:
+ if node['label'] == label:
+ node_post = node.xmlGetChildNode('postprocessing_recording', 'status')
+ if node_post:
+ status = node_post['status']
+ return status
+
+
+ def setPostProcessing(self, label, status):
+ """ Put status of post processing for node with label 'label'"""
+ self.isOnOff(status)
+ self.isInList(label, self.getLabelsList())
+ for nodeList in self.listNodeSurface:
+ for node in nodeList:
+ if node['label'] == label:
+ if status == 'off':
+ node.xmlInitChildNode('postprocessing_recording')['status'] = status
+ else:
+ if node.xmlGetChildNode('postprocessing_recording'):
+ node.xmlRemoveChild('postprocessing_recording')
+
+#-------------------------------------------------------------------------------
+# OutputVariableModel test case
+#-------------------------------------------------------------------------------
+
+class OutputSurfacicVariablesTestCase(ModelTest):
+ """
+ """
+ def checkOutputSurfacicVariablesInstantiation(self):
+ """
+ Check whether the OutputSurfacicVariables Model class could be instantiated
+ """
+ model = None
+ model = OutputSurfacicVariablesModel(self.case)
+ assert model != None, 'Could not instantiate OutputSurfacicVariablesModel'
+
+ def checkSetPropertyLabel(self):
+ """
+ Check whether the OutputSurfacicVariablesModel class could be set a label
+ of property
+ """
+ model = OutputSurfacicVariablesModel(self.case)
+ model.setPropertyLabel('Yplus', 'toto')
+ node = model.node_models.xmlInitNode('velocity_pressure')
+ doc = '''<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W"/>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="toto" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>'''
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set label of property in output surfacic variables model'
+
+ def checkSetandGetPostProcessing(self):
+ """
+ Check whether the OutputSurfacicVariablesModel class could be set and
+ get status for post processing of named property
+ """
+ from Pages.ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+ del ThermalRadiationModel
+ model = OutputSurfacicVariablesModel(self.case)
+
+ model.setPostProcessing('Flux_convectif','off')
+ doc = '''<property label="Flux_convectif" name="flux_convectif" support="boundary">
+ <postprocessing_recording status="off"/>
+ </property>'''
+
+ assert model.getPostProcessing('Flux_convectif') == 'off',\
+ 'Could not get status for post processing of named property'
+
+
+def suite():
+ testSuite = unittest.makeSuite(OutputSurfacicVariablesTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "OutputSurfacicVariablesTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/OutputSurfacicVariablesView.py b/gui/Pages/OutputSurfacicVariablesView.py
new file mode 100644
index 0000000..77df704
--- /dev/null
+++ b/gui/Pages/OutputSurfacicVariablesView.py
@@ -0,0 +1,229 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- OutputSurfacicVariablesView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from OutputSurfacicVariablesForm import Ui_OutputSurfacicVariablesForm
+import Base.QtPage as QtPage
+from Pages.OutputSurfacicVariablesModel import OutputSurfacicVariablesModel
+from Pages.OutputVolumicVariablesView import LabelDelegate
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("OutputSurfacicVariablesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# StandarItemModelOutput class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelOutput(QStandardItemModel):
+
+ def __init__(self, case):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.case = case
+ self.mdl = OutputSurfacicVariablesModel(self.case)
+
+ self.setColumnCount(2)
+ self.dataLabel = []
+ self.dataPost = []
+ self.disableItem = []
+ self.populateModel()
+
+
+ def populateModel(self):
+ # Data initialization
+
+ for name in OutputSurfacicVariablesModel(self.case).list_name:
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+ label = self.mdl.dicoLabelName[name]
+ post = self.mdl.getPostProcessing(label)
+
+# if name in ('yplus', 'effort', 'all_variables'):
+# post = "on"
+# if (row,1) not in self.disableItem:
+# self.disableItem.append((row,1))
+
+ self.dataLabel.append(label)
+ self.dataPost.append(post)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ # ToolTips BUG
+ if role == Qt.ToolTipRole:
+ if index.column() == 0 and index.column() > 3:
+ return QVariant(self.tr("Code_Saturne keyword: NBRVAF"))
+ elif index.column() == 1 and index.column() > 3:
+ return QVariant(self.tr("Code_Saturne keyword: IRAYVF"))
+ elif index.column() == 1 and index.column() <= 3:
+ return QVariant(self.tr("Code_Saturne keyword: IPSTYP/IPSTCL/IPSTFT/IPSTFO"))
+
+ # StatusTips
+ if role == Qt.StatusTipRole:
+ if index.column() == 1:
+ return QVariant("Post-processing")
+
+ # Display
+ if role == Qt.DisplayRole:
+ row = index.row()
+ if index.column() == 0:
+ return QVariant(self.dataLabel[row])
+ else:
+ return QVariant()
+
+ # CheckState
+ if role == Qt.CheckStateRole:
+ row = index.row()
+ if index.column() == 1:
+ value = self.dataPost[row]
+ if value == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ if (index.row(), index.column()) in self.disableItem:
+ return Qt.ItemIsSelectable
+ elif index.column() == 0 :
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ elif index.column() == 1 :
+ return Qt.ItemIsEnabled | Qt.ItemIsUserCheckable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ if section == 0:
+ return QVariant(self.tr("Name"))
+ elif section == 1:
+ return QVariant(self.tr("Post-\nprocessing"))
+ return QVariant()
+
+
+ def setData(self, index, value, role=None):
+ row = index.row()
+ if index.column() == 0:
+ label = str(value.toString())
+ if label == "": label = self.dataLabel[row]
+ self.mdl.setPropertyLabel(self.dataLabel[row], label)
+ self.dataLabel[row] = label
+
+ elif index.column() == 1:
+ v, ok = value.toInt()
+ if v == Qt.Checked:
+ self.dataPost[row] = "on"
+ else:
+ self.dataPost[row] = "off"
+
+ self.mdl.setPostProcessing(self.dataLabel[row], self.dataPost[row])
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class OutputSurfacicVariablesView(QWidget, Ui_OutputSurfacicVariablesForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_OutputSurfacicVariablesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = OutputSurfacicVariablesModel(self.case)
+
+ self.modelOutput = StandardItemModelOutput(self.case)
+ self.tableViewOutput.setModel(self.modelOutput)
+ self.tableViewOutput.setAlternatingRowColors(True)
+ self.tableViewOutput.resizeColumnToContents(0)
+ self.tableViewOutput.resizeRowsToContents()
+ self.tableViewOutput.setSelectionBehavior(QAbstractItemView.SelectItems)
+ self.tableViewOutput.setSelectionMode(QAbstractItemView.ExtendedSelection)
+ self.tableViewOutput.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewOutput.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ labelDelegate = LabelDelegate(self.tableViewOutput, self.mdl)
+ self.tableViewOutput.setItemDelegateForColumn(0, labelDelegate)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/OutputVolumicVariablesForm.ui b/gui/Pages/OutputVolumicVariablesForm.ui
new file mode 100644
index 0000000..d18ae88
--- /dev/null
+++ b/gui/Pages/OutputVolumicVariablesForm.ui
@@ -0,0 +1,32 @@
+<ui version="4.0" >
+ <class>OutputVolumicVariablesForm</class>
+ <widget class="QWidget" name="OutputVolumicVariablesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>471</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Solution control</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewOutput" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/OutputVolumicVariablesModel.py b/gui/Pages/OutputVolumicVariablesModel.py
new file mode 100644
index 0000000..85f4325
--- /dev/null
+++ b/gui/Pages/OutputVolumicVariablesModel.py
@@ -0,0 +1,609 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+"""
+
+#-------------------------------------------------------------------------------
+# Library odules import
+#-------------------------------------------------------------------------------
+
+import string, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLmodel import XMLmodel, ModelTest
+from Base.XMLvariables import Model
+from Pages.DefineUserScalarsModel import DefineUserScalarsModel
+from Pages.ThermalRadiationModel import ThermalRadiationModel
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class OutputVolumicVariablesModel(Model):
+
+ def __init__(self, case):
+ """
+ Constuctor.
+ """
+ self.case = case
+ self.node_models = self.case.xmlInitNode('thermophysical_models')
+ self.analysis_ctrl = self.case.xmlInitNode('analysis_control')
+ self.fluid_prop = self.case.xmlInitNode('physical_properties')
+ self.node_model_vp = self.node_models.xmlInitNode('velocity_pressure')
+ self.node_ale = self.node_models.xmlGetChildNode('ale_method')
+ self.node_output = self.analysis_ctrl.xmlInitNode('output')
+ self.node_probe = self.node_output.xmlGetNodeList('probe','name')
+ self.node_means = self.analysis_ctrl.xmlInitNode('time_averages')
+
+ model = XMLmodel(self.case)
+
+ self.listNodeVolum = (self._getListOfVelocityPressureVariables(),
+ model.getTurbNodeList(),
+ self.getThermalScalar(),
+ self.getAdditionalScalar(),
+ self.getAdditionalScalarProperty(),
+ self.getFluidProperty(),
+ self.getTimeProperty(),
+ self.getMeteoScalProper(),
+ self.getPuCoalScalProper(),
+ self._getWeightMatrixProperty(),
+ self.getListOfTimeMeans(),
+ self._getListOfAleMethod(),
+ self._getThermalRadiativeProperties())
+
+ self.dicoLabelName = {}
+ self.list_name = []
+ self._updateDicoLabelName()
+
+
+# Following private methods: (to see for gathering eventually)
+
+ def _defaultValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['status'] = "on"
+
+ return default
+
+
+ def _updateDicoLabelName(self):
+ """
+ Update dictionaries of labels for all variables, properties .....
+ """
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ name = node['name']
+ if not name: name = node['label']
+ if not node['label']:
+ msg = "xml node named "+ name +" has no label"
+ raise ValueError, msg
+ self.dicoLabelName[name] = node['label']
+ self.list_name.append(name)
+
+
+ def _getListOfVelocityPressureVariables(self):
+ """
+ Private method: return node of properties of weight matrix
+ """
+ nodeList = []
+ for tag in ('variable', 'property'):
+ for node in self.node_model_vp.xmlGetNodeList(tag):
+ if not node['support']:
+ nodeList.append(node)
+ return nodeList
+
+
+ def _getWeightMatrixProperty(self):
+ """
+ Private method: return node of properties of weight matrix
+ """
+ nodeList = []
+ node0 = self.case.xmlGetNode('numerical_parameters')
+ node1 = node0.xmlGetNode('velocity_pressure_coupling', 'status')
+ if node1:
+ if node1['status'] == 'on':
+ nodeList = node0.xmlGetNodeList('property')
+ return nodeList
+
+
+ def _getListOfAleMethod(self):
+ """
+ Private method: return list of variables and properties for ale method if it's activated
+ """
+ nodeList = []
+ if self.node_ale['status'] == 'on':
+ for tag in ('variable', 'property'):
+ for node in self.node_ale.xmlGetChildNodeList(tag):
+ nodeList.append(node)
+
+ return nodeList
+
+
+ def _getThermalRadiativeProperties(self):
+ """
+ Private method: return list of volumic properties for thermal radiation
+ """
+ nodeList = []
+ if ThermalRadiationModel(self.case).getRadiativeModel() != "off":
+ self.node_ray = self.node_models.xmlGetNode('radiative_transfer')
+ for node in self.node_ray.xmlGetChildNodeList('property'):
+ if not node['support']:
+ nodeList.append(node)
+ return nodeList
+
+
+# Following methods also called by ProfilesModel and TimeAveragesModel
+
+
+ def getThermalScalar(self):
+ """
+ Return node of thermal scalar (idem ds NumericalParamEquationModel)
+ """
+ node = self.case.xmlGetNode('additional_scalars')
+ return node.xmlGetNodeList('scalar', type='thermal')
+
+
+
+ def getPuCoalScalProper(self):
+ """
+ Return list fo nodes of pulverized coal.
+ Also called by ProfilesModel and TimeAveragesModel
+ """
+ nodList = []
+ node = self.node_models.xmlGetNode('pulverized_coal', 'model')
+ model = node['model']
+ varList = []
+ if model != 'off':
+ for var in ('scalar', 'property'):
+ nodList = node.xmlGetNodeList(var)
+ for nodvar in nodList:
+ varList.append(nodvar)
+ return varList
+
+
+ def getMeteoScalProper(self):
+ """
+ Return list fo nodes of atmospheric flows.
+ Also called by ProfilesModel and TimeAveragesModel
+ """
+ nodList = []
+ node = self.node_models.xmlGetNode('atmospheric_flows', 'model')
+ if not node: return []
+ model = node['model']
+ varList = []
+ if model != 'off':
+ for var in ('scalar', 'property'):
+ nodList = node.xmlGetNodeList(var)
+ for nodvar in nodList:
+ varList.append(nodvar)
+ return varList
+
+
+
+ def getAdditionalScalar(self):
+ """
+ Return list of nodes of user scalars
+ Also called by ProfilesModel and TimeAveragesModel
+ (idem ds NumericalParamEquationModel named getAdditionalScalarNodes)
+ """
+ node = self.case.xmlGetNode('additional_scalars')
+ return node.xmlGetNodeList('scalar', type='user')
+
+
+ def getAdditionalScalarProperty(self):
+ """
+ Return list of nodes of properties of user scalars
+ Also called by ProfilesModel and TimeAveragesModel
+ """
+ nodeList = []
+ for node in self.getAdditionalScalar():
+ L = node.xmlGetNode('property', choice='variable')
+ if L:
+ nodeList.append(L)
+ return nodeList
+
+
+ def getFluidProperty(self):
+ """
+ Return list of nodes of fluid properties
+ Also called by ProfilesModel and TimeAveragesModel
+ """
+ nodeList = []
+ model = self.getThermalScalar()
+
+ node = self.fluid_prop.xmlGetNode('fluid_properties')
+ if node:
+ for prop in ('density',
+ 'molecular_viscosity',
+ 'specific_heat',
+ 'thermal_conductivity'):
+ L = node.xmlGetNode('property', name=prop, choice='variable')
+ if L:
+ nodeList.append(L)
+
+ return nodeList
+
+
+ def getTimeProperty(self):
+ """
+ Return list fo nodes of properties of time_parameters.
+ Also called by ProfilesModel and TimeAveragesModel
+ """
+ nodeList = []
+
+ node1 = self.analysis_ctrl.xmlGetNode('time_parameters')
+
+ if node1:
+ if node1.xmlGetInt('time_passing'):
+ node2 = node1.xmlGetNode('property', name='local_time_step')
+ if node2:
+ nodeList.append(node2)
+
+ for prop in ('courant_number', 'fourier_number'):
+ L = node1.xmlGetNode('property', name=prop)
+ if L: nodeList.append(L)
+
+ return nodeList
+
+
+ def getListOfTimeMeans(self):
+ """
+ Return list of time averages variables
+ Also called by ProfilesModel
+ """
+ nodeList = []
+ for node in self.node_means.xmlGetNodeList('time_average'):
+ nodeList.append(node)
+
+ return nodeList
+
+
+#Following methods only called by the View
+ def getLabelsList(self):
+ """
+ Return list of labels for all variables, properties .....Only for the View
+ """
+ list = []
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ list.append(node['label'])
+ return list
+
+
+ def getVariableProbeList(self):
+ """ Return list of node for probes """
+ probeList = []
+ for node in self.node_probe:
+ probeList.append(node['name'])
+ return probeList
+
+
+ def getProbesList(self, label):
+ """
+ Return list of probes if it exists for node['name'] = name. Only for the View
+ """
+ self.isInList(label, self.getLabelsList())
+ list = self.getVariableProbeList()
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ if node['label'] == label:
+ node_probes = node.xmlGetChildNode('probes')
+ if node_probes:
+ nb_probes = node_probes['choice']
+ if nb_probes == '0':
+ list = []
+ elif nb_probes > '0':
+ list = []
+ for n in node_probes.xmlGetChildNodeList('probe_recording'):
+ list.append(n['name'])
+ return list
+
+
+ def getPrintingStatus(self, label):
+ """
+ Return status of markup printing from node with label. Only for the View
+ """
+ self.isInList(label, self.getLabelsList())
+ status = self._defaultValues()['status']
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ if node['label'] == label:
+ node_printing = node.xmlGetChildNode('listing_printing', 'status')
+ if node_printing:
+ status = node_printing['status']
+ return status
+
+
+ def getPostStatus(self, label):
+ """
+ Return status of markup post processing from node with label. Only for the View
+ """
+ self.isInList(label, self.getLabelsList())
+ status = self._defaultValues()['status']
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ if node['label'] == label:
+ node_post = node.xmlGetChildNode('postprocessing_recording', 'status')
+ if node_post:
+ status = node_post['status']
+ return status
+
+
+ def setVariableLabel(self, old_label, new_label):
+ """
+ Replace old_label by new_label for node with name and old_label. Only for the View
+ """
+ # fusion de cette methode avec DefineUserScalarsModel.renameScalarLabel
+ self.isInList(old_label, self.getLabelsList())
+ self.isNotInList(new_label, [""])
+
+ if old_label != new_label:
+ self.isNotInList(new_label, self.getLabelsList())
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ if node['label'] == old_label:
+ node['label'] = new_label
+
+ self._updateDicoLabelName()
+ self._updateBoundariesNodes(old_label, new_label)
+
+ for node in self.case.xmlGetNodeList('formula'):
+ f = node.xmlGetTextNode().replace(old_label, new_label)
+ node.xmlSetTextNode(f)
+
+
+ def _updateBoundariesNodes(self, old_label, new_label):
+ """
+ Update good label for boundaries nodes with name and label. Only for the View
+ """
+ self.node_bc = self.case.xmlInitNode('boundary_conditions')
+ self.node_var = self.node_bc.xmlInitNodeList('variable')
+ self.node_sca = self.node_bc.xmlInitNodeList('scalar')
+
+ for node in [self.node_var, self.node_sca]:
+ for nodebc in node:
+ if nodebc['label'] == old_label:
+ nodebc['label'] = new_label
+
+
+ def setPrintingStatus(self, label, status):
+ """
+ Put status for balise printing from node with name and label
+ """
+ self.isOnOff(status)
+ self.isInList(label, self.getLabelsList())
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ if node['label'] == label:
+ if status == 'off':
+ node.xmlInitChildNode('listing_printing')['status'] = status
+ else:
+ if node.xmlGetChildNode('listing_printing'):
+ node.xmlRemoveChild('listing_printing')
+
+
+ def setPostStatus(self, label, status):
+ """
+ Put status for balise postprocessing from node with name and label
+ """
+ self.isOnOff(status)
+ self.isInList(label, self.getLabelsList())
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ if node['label'] == label:
+ if status == 'off':
+ node.xmlInitChildNode('postprocessing_recording')['status'] = status
+ else:
+ if node.xmlGetChildNode('postprocessing_recording'):
+ node.xmlRemoveChild('postprocessing_recording')
+
+
+ def updateProbes(self, label, list):
+ """
+ Update probe_recording markups if it exists
+ """
+ self.isInList(label, self.getLabelsList())
+ nb = len(string.split(list))
+ if nb == len(self.getVariableProbeList()):
+ return
+ else:
+ for nodeList in self.listNodeVolum:
+ for node in nodeList:
+ if node['label'] == label:
+ try:
+ node.xmlRemoveChild('probes')
+ except:
+ pass
+ n = node.xmlInitNode('probes', choice=str(nb))
+ if nb > 0:
+ for i in string.split(list):
+ n.xmlInitChildNodeList('probe_recording',name=i)
+
+#-------------------------------------------------------------------------------
+# OutputVolumicVariablesModel Test Class
+#-------------------------------------------------------------------------------
+
+class OutputVolumicVariablesModelTestCase(ModelTest):
+ """
+ Unittest
+ """
+ def checkOutputVolumicVariablesModelInstantiation(self):
+ """Check whether the OutputVolumicVariablesModel class could be instantiated"""
+ mdl = None
+ mdl = OutputVolumicVariablesModel(self.case)
+ assert mdl != None, 'Could not instantiate OutputVolumicVariablesModel'
+
+## def checkGetPuCoalScalProper(self):
+## """
+## Check whether the OutputVolumicVariablesModel class could be get
+## properties of pulverized coal
+## """
+## mdl = OutputVolumicVariablesModel(self.case)
+## from CoalCombustionModel import CoalCombustionModel
+## CoalCombustionModel(self.case).setCoalCombustionModel('coal_homo')
+## del CoalCombustionModel
+## mdl.getPuCoalScalProper()
+## node = mdl.node_models.xmlGetNode('pulverized_coal', 'model')
+## print node
+## print mdl.getPuCoalScalProper()
+
+ def checkSetVariableLabel(self):
+ """
+ Check whether the OutputVolumicVariablesModel class could be set a label
+ of property
+ """
+ model = OutputVolumicVariablesModel(self.case)
+ model.setVariableLabel('VelocitV', 'vitV')
+ node = model.node_models.xmlInitNode('velocity_pressure')
+ doc = '''<velocity_pressure>
+ <variable label="Pressure" name="pressure"/>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="vitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W"/>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>'''
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set label of property in output volumic variables model'
+
+ def checkSetAndGetPrintingStatus(self):
+ """
+ Check whether the OutputVolumicVariablesModel class could be
+ set and get status for printing listing
+ """
+ from ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+
+ mdl = OutputVolumicVariablesModel(self.case)
+ mdl.setPrintingStatus('Temp.C', 'off')
+ node_out = mdl.case.xmlGetNode('additional_scalars')
+ doc = '''<additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <listing_printing status="off"/>
+ </scalar>
+ </additional_scalars>'''
+
+ assert node_out == self.xmlNodeFromString(doc),\
+ 'Could not set status of listing printing in output volumic variables model'
+ assert mdl.getPrintingStatus('Temp.C') == 'off',\
+ 'Could not get status of listing printing in output volumic variables model'
+
+ def checkSetAndGetPostStatus(self):
+ """
+ Check whether the OutputVolumicVariablesModel class could be
+ set and get status for printing
+ """
+ from ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+
+ mdl = OutputVolumicVariablesModel(self.case)
+ mdl.setPostStatus('Temp.C', 'off')
+ node_out = mdl.case.xmlGetNode('additional_scalars')
+ doc = '''<additional_scalars>
+ <scalar label="Temp.C" name="temperature_celsius" type="thermal">
+ <initial_value zone="1">20.0</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ <postprocessing_recording status="off"/>
+ </scalar>
+ </additional_scalars>'''
+
+ assert node_out == self.xmlNodeFromString(doc),\
+ 'Could not set status of post processing in output volumic variables model'
+ assert mdl.getPostStatus('Temp.C') == 'off',\
+ 'Could not get status of post processing in output volumic variables model'
+
+ def checkSetAndGetPostStatusForRadiativeProperties(self):
+ """
+ Check whether the OutputVolumicVariablesModel class could be
+ set and get status for post processing of radaitive property
+ """
+ from Pages.ThermalRadiationModel import ThermalRadiationModel
+ ThermalRadiationModel(self.case).setRadiativeModel('dom')
+ del ThermalRadiationModel
+
+ mdl = OutputVolumicVariablesModel(self.case)
+ mdl.setPostStatus('Srad', 'off')
+ node_out = mdl.case.xmlGetNode('radiative_transfer')
+
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad">
+ <postprocessing_recording status="off"/>
+ </property><property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <directions_number>32</directions_number>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ </radiative_transfer>'''
+
+ assert node_out == self.xmlNodeFromString(doc),\
+ 'Could not set status of post processing for radiative property \
+ in output volumic variables model'
+ assert mdl.getPostStatus('Srad') == 'off',\
+ 'Could not get status of post processing for radiative property \
+ in output volumic variables model'
+
+
+def suite():
+ testSuite = unittest.makeSuite(OutputVolumicVariablesModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "OutputVolumicVariablesModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/OutputVolumicVariablesView.py b/gui/Pages/OutputVolumicVariablesView.py
new file mode 100644
index 0000000..d3954bd
--- /dev/null
+++ b/gui/Pages/OutputVolumicVariablesView.py
@@ -0,0 +1,465 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- OutputVolumicVariablesView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import LABEL_LENGTH_MAX
+from Base.Toolbox import GuiParam
+from Base.QtPage import RegExpValidator
+from OutputVolumicVariablesForm import Ui_OutputVolumicVariablesForm
+from Pages.OutputControlModel import OutputControlModel
+from Pages.OutputVolumicVariablesModel import OutputVolumicVariablesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("OutputVolumicVariablesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class ProbesValidator(QRegExpValidator):
+ """
+ Validator for real data.
+ """
+ def __init__(self, parent, xml_model):
+ """
+ Initialization for validator
+ """
+ regExp = QRegExp("^all[ ]*$|^[0-9\ ]*$")
+ super(ProbesValidator, self).__init__(regExp, parent)
+ self.parent = parent
+ self.mdl = xml_model
+ self.state = QValidator.Invalid
+
+
+ def validate(self, string, pos):
+ """
+ Validation method.
+
+ QValidator.Invalid 0 The string is clearly invalid.
+ QValidator.Intermediate 1 The string is a plausible intermediate value during editing.
+ QValidator.Acceptable 2 The string is acceptable as a final result; i.e. it is valid.
+ """
+ state = QRegExpValidator.validate(self, string, pos)[0]
+
+ valid = True
+ for probe in str(string).split():
+ if probe not in self.mdl.getVariableProbeList():
+ valid = False
+
+ if state == QValidator.Acceptable:
+ if not valid:
+ state = QValidator.Intermediate
+
+ palette = self.parent.palette()
+
+ if state == QValidator.Intermediate:
+ palette.setColor(QPalette.Text, QColor("red"))
+ self.parent.setPalette(palette)
+ else:
+ palette.setColor(QPalette.Text, QColor("black"))
+ self.parent.setPalette(palette)
+
+ self.state = state
+
+ return (state, pos)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class ProbesDelegate(QItemDelegate):
+ """
+ """
+ def __init__(self, parent=None, xml_model=None):
+ super(ProbesDelegate, self).__init__(parent)
+ self.parent = parent
+ self.mdl = xml_model
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ #regExp = QRegExp("^all[ ]*$|^[0-9\ ]*$")
+ #validator = QRegExpValidator(regExp, editor)
+ validator = ProbesValidator(editor, self.mdl)
+ editor.setValidator(validator)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, lineEdit, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ lineEdit.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ value = editor.text()
+ if editor.validator().state == QValidator.Acceptable:
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value))
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class LabelDelegate(QItemDelegate):
+ """
+ """
+ def __init__(self, parent=None, xml_model=None):
+ super(LabelDelegate, self).__init__(parent)
+ self.parent = parent
+ self.mdl = xml_model
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ self.regExp = QRegExp(rx)
+ v = RegExpValidator(editor, self.regExp)
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ v = index.model().data(index, Qt.DisplayRole).toString()
+ self.p_value = str(v)
+ editor.setText(v)
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+
+ if editor.validator().state == QValidator.Acceptable:
+ p_value = str(editor.text())
+
+ if p_value in self.mdl.getLabelsList():
+ default = {}
+ default['label'] = self.p_value
+ default['list'] = self.mdl.getLabelsList()
+ default['regexp'] = self.regExp
+ log.debug("setModelData-> default = %s" % default)
+
+ from VerifyExistenceLabelDialogView import VerifyExistenceLabelDialogView
+ dialog = VerifyExistenceLabelDialogView(self.parent, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ p_value = result['label']
+ log.debug("setModelData-> result = %s" % result)
+ else:
+ p_value = self.p_value
+
+ model.setData(index, QVariant(QString(p_value)), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModelOutput class
+#-------------------------------------------------------------------------------
+
+class VolumicOutputStandardItemModel(QStandardItemModel):
+
+ def __init__(self, parent, case, mdl):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.parent = parent
+ self.case = case
+ self.mdl = mdl
+
+ #self.list_turb_probe = self.mdl.getVariableProbeList()
+
+ self.setColumnCount(4)
+ self.dataLabel = []
+ self.dataPrinting = []
+ self.dataPost = []
+ self.dataProbe = []
+ self.disabledItem = []
+ self.populateModel()
+
+
+ def populateModel(self):
+ """Data initialization"""
+ for name in self.mdl.list_name:
+ # row number
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+ # XML Model data
+ label = self.mdl.dicoLabelName[name]
+ printing = self.mdl.getPrintingStatus(label)
+
+ if OutputControlModel(self.case).getFluidDomainPostProStatus() == 'off':
+ post = "off"
+ self.mdl.setPostStatus(label, post)
+ self.disabledItem.append((row, 2))
+ else:
+ post = self.mdl.getPostStatus(label)
+
+
+ if not self.mdl.getVariableProbeList():
+ self.disabledItem.append((row, 3))
+
+ listProbe = self.mdl.getProbesList(label)
+ if listProbe:
+ probes = string.join(listProbe," ")
+ else:
+ probes = ""
+
+ # StandardItemModel data
+ self.dataLabel.append(label)
+ self.dataPrinting.append(printing)
+ self.dataPost.append(post)
+ self.dataProbe.append(probes)
+
+ # Initialize the flags
+ for row in range(self.rowCount()):
+ for column in range(self.columnCount()):
+ if column == 0 or column == 3:
+ role = Qt.DisplayRole
+ else:
+ role = Qt.CheckStateRole
+ index = self.index(row, column)
+ value = self.data(index, role)
+ self.setData(index, value)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ # ToolTips
+ if role == Qt.ToolTipRole:
+ if index.column() == 0:
+ return QVariant(self.tr("Code_Saturne keyword: NOMVAR"))
+ elif index.column() == 1:
+ return QVariant(self.tr("Code_Saturne key word: ILISVR"))
+ elif index.column() == 2:
+ return QVariant(self.tr("Code_Saturne key word: ICHRVR"))
+ elif index.column() == 3:
+ return QVariant(self.tr("Code_Saturne key word: IHISVR"))
+
+ # StatusTips
+ if role == Qt.StatusTipRole:
+ if index.column() == 0:
+ return QVariant(self.tr("Variable/Scalar name =< 32 characters"))
+ elif index.column() == 1:
+ return QVariant(self.tr("Print in listing"))
+ elif index.column() == 2:
+ return QVariant(self.tr("Post-processing"))
+ elif index.column() == 3:
+ return QVariant(self.tr("Enter Probes number"))
+
+ # Display
+ if role == Qt.DisplayRole:
+ row = index.row()
+ if index.column() == 0:
+ return QVariant(self.dataLabel[row])
+ elif index.column() == 3:
+ return QVariant(self.dataProbe[row])
+ else:
+ return QVariant()
+
+ # CheckState
+ if role == Qt.CheckStateRole:
+ row = index.row()
+ if index.column() == 1:
+ value = self.dataPrinting[row]
+ if value == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ elif index.column() == 2:
+ value = self.dataPost[row]
+ if value == 'on':
+ return QVariant(Qt.Checked)
+ else:
+ return QVariant(Qt.Unchecked)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ # disable item
+ if (index.row(), index.column()) in self.disabledItem:
+ return Qt.ItemIsEnabled
+
+ if index.column() == 1 or index.column() == 2:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ if section == 0:
+ return QVariant(self.tr("Name"))
+ elif section == 1:
+ return QVariant(self.tr("Print in\nlisting"))
+ elif section == 2:
+ return QVariant(self.tr("Post-\nprocessing"))
+ elif section == 3:
+ return QVariant(self.tr("Probes"))
+ return QVariant()
+
+
+ def setData(self, index, value, role=None):
+ row = index.row()
+ if index.column() == 0:
+ label = str(value.toString())
+ if label == "": label = self.dataLabel[row]
+ self.mdl.setVariableLabel(self.dataLabel[row], label)
+ self.dataLabel[row] = label
+
+ elif index.column() == 1:
+ v, ok = value.toInt()
+ if v == Qt.Checked:
+ self.dataPrinting[row] = "on"
+ else:
+ self.dataPrinting[row] = "off"
+ self.mdl.setPrintingStatus(self.dataLabel[row], self.dataPrinting[row])
+
+ elif index.column() == 2:
+ v, ok = value.toInt()
+ if v == Qt.Checked:
+ self.dataPost[row] = "on"
+ else:
+ self.dataPost[row] = "off"
+
+ if OutputControlModel(self.case).getFluidDomainPostProStatus() == 'off':
+ self.dataPost[row] = "off"
+
+ self.mdl.setPostStatus(self.dataLabel[row], self.dataPost[row])
+
+ elif index.column() == 3:
+ probes = str(value.toString())
+ self.dataProbe[row] = probes
+ #print probes
+ self.mdl.updateProbes(self.dataLabel[row], probes)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+# TODO: VolumicOutputStandardItemModel (selectAllProbe cancelAllProbe methods)
+## def selectAll(self, event= None):
+## self.probe.set(string.join(self.list_turb_probe))
+## self.getProbe()
+
+
+## def cancelAll(self, event= None):
+## self.probe.set("")
+## self.getProbe()
+
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class OutputVolumicVariablesView(QWidget, Ui_OutputVolumicVariablesForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_OutputVolumicVariablesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.info_turb_name = []
+ self.mdl = OutputVolumicVariablesModel(self.case)
+
+ self.modelOutput = VolumicOutputStandardItemModel(parent, self.case, self.mdl)
+ self.tableViewOutput.setModel(self.modelOutput)
+ self.tableViewOutput.setAlternatingRowColors(True)
+ self.tableViewOutput.resizeColumnToContents(0)
+ self.tableViewOutput.resizeRowsToContents()
+ self.tableViewOutput.setSelectionBehavior(QAbstractItemView.SelectItems)
+ self.tableViewOutput.setSelectionMode(QAbstractItemView.ExtendedSelection)
+ self.tableViewOutput.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.tableViewOutput.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ labelDelegate = LabelDelegate(self.tableViewOutput, self.mdl)
+ self.tableViewOutput.setItemDelegateForColumn(0, labelDelegate)
+
+ probesDelegate = ProbesDelegate(self.tableViewOutput, self.mdl)
+ self.tableViewOutput.setItemDelegateForColumn(3, probesDelegate)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/PreProcessingInformationsView.py b/gui/Pages/PreProcessingInformationsView.py
new file mode 100644
index 0000000..be71ff0
--- /dev/null
+++ b/gui/Pages/PreProcessingInformationsView.py
@@ -0,0 +1,230 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- preprocessorFile
+- Informations
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import sys, re, os, string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+import Base.QtPage as QtPage
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("PreprocessingInformationsView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Function for select the Preprocessor listing
+#-------------------------------------------------------------------------------
+
+def preprocessorFile(parent, initdir):
+ """
+ Verify if the choses of file is correct
+ """
+ file_name = ""
+ title = tr("Select a Code_Saturne Preprocessor listing")
+ filetypes = "Preprocessor listing (listpre.*);;All Files (*)"
+ filt = "All files (*)"
+ file_name = QFileDialog.getOpenFileName(parent, title, initdir, filetypes, filt)
+ file_name = str(file_name)
+
+ if file_name:
+ f = open(file_name, 'r')
+ lines = f.readlines()
+ f.close()
+
+ j=0
+ for i in range(len(lines)):
+ index = string.rfind(lines[i], "ECS version")
+ if index != -1:
+ j = i
+ break
+
+ if j == 0:
+ title = tr("Informations")
+ msg = tr("Warning : the selected file is not a correct file.\n\n"\
+ "Verify your selection")
+ QMessageBox.information(parent, title, msg)
+ preprocessorFile(initdir) # ???
+
+ return file_name
+
+
+
+def tr(text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Informations class
+#-------------------------------------------------------------------------------
+
+class Informations:
+ def __init__(self, file, chain):
+
+ self.chain = chain
+ if self.chain not in ('faces', 'cells'):
+ raise ValueError, "Informations class is called with a wrong parameter 'chain'"
+
+ lines = self.readFile(file)
+ if not lines:
+ raise ValueError, "Code_Saturne Preprocessor listing language unknown."
+
+ refList, groupList = self.getListes(lines)
+
+ self.refList = refList
+ self.groupList = groupList
+
+ self.updateListes()
+
+
+ def readFile(self, file):
+ if not file:
+ return []
+ else:
+ f = open(file, 'r')
+ lines = f.readlines()
+ f.close()
+
+ lang = ""
+ for i in range(len(lines)):
+ #index = re.search("processeur", lines[i])
+ index = string.rfind(lines[i], "processeur")
+ if index > 0:
+ lang = 'fr'
+ break
+
+ if lang == 'fr':
+ self.str1 = "finition des familles de faces et cellules"
+ if self.chain == 'faces':
+ self.str2 = "Nombre de faces de bord"
+ elif self.chain == 'cells':
+ self.str2 = "Nombre de cellules"
+ self.str3 = 'Famille'
+ self.str4 = 'Couleur'
+ self.str5 = 'Groupe'
+ self.str6 = 'Définition des couleurs et groupes en fonction des familles'
+ else:
+ self.str1 = "Definition of face and cell families"
+ if self.chain == 'faces':
+ self.str2 = "Number of boundary faces"
+ elif self.chain == 'cells':
+ self.str2 = "Number of cells"
+ self.str3 = 'Family'
+ self.str4 = 'Color'
+ self.str5 = 'Group'
+ self.str6 = 'Definition of colors and groups beyond families'
+
+ return lines
+
+
+ def getListes(self, lines):
+ refList = []
+ groupList = []
+ for i in range(len(lines)):
+ index = re.search(self.str1, lines[i])
+ if index != None:
+ j = i
+ break
+
+ for n in range(j,len(lines),1):
+ if re.search(self.str6, lines[n]): break
+ index = re.search(self.str3, lines[n])
+ if index != None:
+ familyList =[]
+ fam = re.split(self.str3, lines[n])
+ for f in fam[1:]: numfam = re.split('\n', f)[0]
+ for m in range(n+1,len(lines),1):
+ if re.search(self.str2, lines[m]) != None:
+ p = m
+ for p in range(p-1,p-m,-1):
+ if re.search(self.str4, lines[p]) != None:
+ coul = re.split(self.str4 + ' ', lines[p])
+ for cl in coul[1:]:
+ ref = re.split('\n', cl)[0]
+ if ref:
+ if ref not in refList: refList.append(ref)
+ if re.search(self.str5, lines[p]) != None:
+ gr = re.split(self.str5 + ' ', lines[p])
+ for g in gr[1:]:
+ group = re.split('\n', g)[0]
+ group = re.split('"',group)[1]
+ if group:
+ if group not in groupList: groupList.append(group)
+ if re.search(self.str3, lines[p]) != None:
+ n = m-1
+ break
+
+ return refList, groupList
+
+
+ # TODO: delete this method
+ def updateListes(self):
+ return self.refList, self.groupList
+
+
+ def getLocalizations(self):
+ list = self.refList + self.groupList
+ return map(str, list)
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/ProfilesForm.ui b/gui/Pages/ProfilesForm.ui
new file mode 100644
index 0000000..9f8faad
--- /dev/null
+++ b/gui/Pages/ProfilesForm.ui
@@ -0,0 +1,351 @@
+<ui version="4.0" >
+ <class>ProfilesForm</class>
+ <widget class="QWidget" name="ProfilesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>394</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Definition of 1D profiles</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QTreeView" name="treeViewProfile" >
+ <property name="indentation" >
+ <number>0</number>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QPushButton" name="pushButtonAdd" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonEdit" >
+ <property name="text" >
+ <string>Edit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDelete" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Label of profile</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lineEditProfileName" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelFirstPoint" >
+ <property name="text" >
+ <string>First point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelX1" >
+ <property name="text" >
+ <string>X<sub>1</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLineEdit" name="lineEditX1" />
+ </item>
+ <item row="1" column="3" >
+ <widget class="QLabel" name="labelY1" >
+ <property name="text" >
+ <string>Y<sub>1</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" >
+ <widget class="QLineEdit" name="lineEditY1" />
+ </item>
+ <item row="1" column="5" >
+ <widget class="QLabel" name="labelZ1" >
+ <property name="text" >
+ <string>Z<sub>1</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="6" >
+ <widget class="QLineEdit" name="lineEditZ1" />
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelLastPoint" >
+ <property name="text" >
+ <string>Last point</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="labelX2" >
+ <property name="text" >
+ <string>X<sub>2</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLineEdit" name="lineEditX2" />
+ </item>
+ <item row="2" column="3" >
+ <widget class="QLabel" name="labelY2" >
+ <property name="text" >
+ <string>Y<sub>2</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4" >
+ <widget class="QLineEdit" name="lineEditY2" />
+ </item>
+ <item row="2" column="5" >
+ <widget class="QLabel" name="labelZ2" >
+ <property name="text" >
+ <string>Z<sub>2</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="6" >
+ <widget class="QLineEdit" name="lineEditZ2" />
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelFreq" >
+ <property name="text" >
+ <string>Frequency</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" colspan="3" >
+ <widget class="QComboBox" name="comboBoxFreq" />
+ </item>
+ <item row="3" column="5" colspan="2" >
+ <widget class="QLineEdit" name="lineEditFreq" >
+ <property name="maximumSize" >
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>61</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QWidget" native="1" name="widgetDrag" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="font" >
+ <font>
+ <pointsize>20</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="pixmap" >
+ <pixmap resource="resources_pages.qrc" >:/new/prefix1/icons/32x32/go-next.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QWidget" native="1" name="widgetDrop" >
+ <property name="minimumSize" >
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>61</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>432</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/ProfilesModel.py b/gui/Pages/ProfilesModel.py
new file mode 100644
index 0000000..e1e94e5
--- /dev/null
+++ b/gui/Pages/ProfilesModel.py
@@ -0,0 +1,430 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the 1D profile management page.
+
+This module defines the following classes:
+- ProfilesModel
+- ProfilesTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, string, types, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLmodel import XMLmodel, ModelTest
+from Base.XMLvariables import Model
+from Pages.OutputVolumicVariablesModel import OutputVolumicVariablesModel
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class ProfilesModel(Model):
+ """
+ 1D profile management.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_anal = self.case.xmlInitNode('analysis_control')
+ self.node_prof = self.node_anal.xmlInitNode('profiles')
+ self.node_model = self.case.xmlInitNode('thermophysical_models')
+ self.node_model_vp = self.node_model.xmlInitNode('velocity_pressure')
+ self.node_var_vp = self.node_model_vp.xmlGetNodeList('variable')
+ self.node_pro_vp = self.node_model_vp.xmlGetNodeList('property')
+
+ self.suffixe = self.__defaultValues()['suffixe']
+ self.__var_prop_list = self.getVariablesAndVolumeProperties()
+
+
+ def __defaultValues(self):
+ """
+ Private method.
+ Returns a dictionnary with default values.
+ """
+ value = {}
+ value['nfreq'] = -1
+ value['X1'] = 0.
+ value['Y1'] = 0.
+ value['Z1'] = 0.
+ value['X2'] = 1.
+ value['Y2'] = 1.
+ value['Z2'] = 1.
+ value['suffixe'] = ""
+
+ return value
+
+
+ def __updateBatchScriptFile(self, param, profile):
+ """
+ Update the backup file if it's ready to run.
+ """
+ key = self.case['computer']
+ if key:
+ if not self.case['batchScript'][key]:
+ return
+
+ from BatchRunningModel import BatchRunningModel
+ batch = BatchRunningModel(self.case)
+ batch.initializeBatchScriptFile()
+
+ if batch.dicoValues['USER_OUTPUT_FILES']:
+ vlist = string.split(batch.dicoValues['USER_OUTPUT_FILES'])
+ else:
+ vlist = []
+
+ if param == "delete":
+ if profile in vlist:
+ vlist.remove(profile)
+ elif param == "add":
+ if profile not in vlist:
+ vlist.append(profile)
+
+ batch.dicoValues['USER_OUTPUT_FILES'] = string.join(vlist, " ")
+ batch.updateBatchScriptFile('USER_OUTPUT_FILES')
+ del BatchRunningModel
+
+
+ def getVariablesAndVolumeProperties(self):
+ """
+ Creates a dictionnary to connect name and label from
+ variables and properties.
+ """
+ # FIXME: merge this method with the same one in TimeAveragesView
+ self.dicoLabel2Name = {}
+ model = XMLmodel(self.case)
+ output = OutputVolumicVariablesModel(self.case)
+ for nodeList in [self.node_var_vp,
+ self.node_pro_vp,
+ model.getTurbNodeList(),
+ output.getFluidProperty(),
+ output.getAdditionalScalarProperty(),
+ output.getTimeProperty(),
+ output.getListOfTimeMeans(),
+ output.getPuCoalScalProper(),
+ output.getMeteoScalProper(),
+ output.getThermalScalar(),
+ output.getAdditionalScalar()]:
+
+ for node in nodeList:
+ name = node['name']
+ label = node['label']
+ if not label:
+ raise ValueError, "Node has no label"
+
+ if not (node['support'] and node['support'] == "boundary"):
+ if name != 'local_time_step':
+ self.dicoLabel2Name[label] = name
+
+ return self.dicoLabel2Name.keys()
+
+
+ def __setCoordinates(self, label, x1, y1, z1, x2, y2, z2):
+ """
+ Private method.
+ Get coordinates for profile named I{label}
+ """
+ self.isInList(label, self.getProfilesLabelsList())
+ for coord in (x1, y1, z1, x2, y2, z2):
+ self.isFloat(coord)
+
+ label_xml = label + self.suffixe
+ node = self.node_prof.xmlGetNode('profile', label=label_xml)
+ node.xmlSetData('x1', x1)
+ node.xmlSetData('y1', y1)
+ node.xmlSetData('z1', z1)
+ node.xmlSetData('x2', x2)
+ node.xmlSetData('y2', y2)
+ node.xmlSetData('z2', z2)
+
+
+ def __getCoordinates(self, label):
+ """
+ Private method.
+ Gets coordinates for profile named I{label}.
+ """
+ self.isInList(label, self.getProfilesLabelsList())
+ label_xml = label + self.suffixe
+ node = self.node_prof.xmlGetNode('profile', label=label_xml)
+
+ x1 = node.xmlGetDouble('x1')
+ if x1 == None:
+ x1 = self.__defaultValues()['X1']
+ node.xmlSetData('x1', x1)
+
+ y1 = node.xmlGetDouble('y1')
+ if y1 == None:
+ y1 = self.__defaultValues()['Y1']
+ node.xmlSetData('y1', y1)
+
+ z1 = node.xmlGetDouble('z1')
+ if z1 == None:
+ z1 = self.__defaultValues()['Z1']
+ node.xmlSetData('z1', z1)
+
+ x2 = node.xmlGetDouble('x2')
+ if x2 == None:
+ x2 = self.__defaultValues()['X2']
+ node.xmlSetData('x2', x2)
+
+ y2 = node.xmlGetDouble('y2')
+ if y2 == None:
+ y2 = self.__defaultValues()['Y2']
+ node.xmlSetData('y2', y2)
+
+ z2 = node.xmlGetDouble('z2')
+ if z2 == None:
+ z2 = self.__defaultValues()['Z2']
+ node.xmlSetData('z2', z2)
+
+ return x1, y1, z1, x2, y2, z2
+
+
+ def getProfilesLabelsList(self):
+ """
+ Public method.
+ Returns the profiles labels list.
+ """
+ list = []
+ for node in self.node_prof.xmlGetNodeList('profile'):
+ #label = node['label'][:-4]
+ label = node['label']
+ list.append(label)
+ return list
+
+
+ def setProfile(self, label, list, freq, x1, y1, z1, x2, y2, z2):
+ """
+ Public method.
+ Sets data to create one profile named I{label}.
+ """
+ self.isNotInList(label, self.getProfilesLabelsList())
+ self.isInt(freq)
+ for coord in (x1, y1, z1, x2, y2, z2):
+ self.isFloat(coord)
+
+ label_xml = label + self.suffixe
+ node = self.node_prof.xmlInitNode('profile', label=label_xml)
+ for var in list:
+ self.isInList(var, self.__var_prop_list)
+ node.xmlAddChild('var_prop', name=self.dicoLabel2Name[var])
+ node.xmlSetData('output_frequency', freq)
+ self.__setCoordinates(label, x1, y1, z1, x2, y2, z2)
+ self.__updateBatchScriptFile('add', label_xml)
+
+
+ def replaceProfile(self, old_label, label, list, freq, x1, y1, z1, x2, y2, z2):
+ """
+ Public method.
+ Replaces data from I{old_label} profile
+ with label, frequency, and coordinates values.
+ """
+ self.isInList(old_label,self.getProfilesLabelsList())
+ if label != old_label:
+ self.isNotInList(label, self.getProfilesLabelsList())
+ self.isInt(freq)
+ for coord in (x1, y1, z1, x2, y2, z2):
+ self.isFloat(coord)
+
+ old_label_xml = old_label + self.suffixe
+ label_xml = label + self.suffixe
+ node = self.node_prof.xmlGetNode('profile', label=old_label_xml)
+ if node:
+ node.xmlRemoveChild('var_prop')
+ node.xmlRemoveChild('output_frequency')
+ for tag in ('x1', 'y1', 'z1', 'x2', 'y2', 'z2'):
+ node.xmlRemoveChild(tag)
+ for var in list:
+ self.isInList(var, self.__var_prop_list)
+ node.xmlAddChild('var_prop', name=self.dicoLabel2Name[var])
+ node['label'] = label_xml
+ node.xmlSetData('output_frequency', freq)
+ self.__setCoordinates(label, x1, y1, z1, x2, y2, z2)
+
+ if old_label != label:
+ self.__updateBatchScriptFile('delete', old_label_xml)
+ self.__updateBatchScriptFile('add', label_xml)
+
+
+ def deleteProfile(self, label):
+ """
+ Public method.
+ Deletes profile named I{label}.
+ """
+ self.isInList(label, self.getProfilesLabelsList())
+ label_xml = label + self.suffixe
+ node = self.node_prof.xmlGetNode('profile', label=label_xml)
+ if node:
+ node.xmlRemoveNode()
+ self.__updateBatchScriptFile('delete', label_xml)
+
+
+ def getProfileData(self, label):
+ """
+ Public method. Only for the GUI.
+ Get profile named label and return list of variables or properties,
+ frequency and coordinates.
+ """
+ self.isInList(label, self.getProfilesLabelsList())
+ list = []
+ label_xml = label + self.suffixe
+ node = self.node_prof.xmlGetNode('profile', label=label_xml)
+ freq = node.xmlGetInt('output_frequency')
+ x1, y1, z1, x2, y2, z2 = self.__getCoordinates(label)
+ for var in node.xmlGetChildNodeList('var_prop'):
+ for name in self.__var_prop_list:
+ if self.dicoLabel2Name[name] == var['name']:
+ list.append(name)
+ label_xml = node['label']
+ #label = label_xml[:-4]
+ label = label_xml
+
+ return label, list, freq, x1, y1, z1, x2, y2, z2
+
+
+#-------------------------------------------------------------------------------
+# TimeAveragesModel test case
+#-------------------------------------------------------------------------------
+
+
+class ProfilesTestCase(ModelTest):
+ """
+ Unittest.
+ """
+ def checkProfilesModelInstantiation(self):
+ """Check whether the ProfilesModel class could be instantiated"""
+ model = None
+ model = ProfilesModel(self.case)
+ assert model != None, 'Could not instantiate ProfilesModel'
+
+
+ def checkSetProfile(self):
+ """Check whether the ProfilesModel class could set one profile"""
+ mdl = ProfilesModel(self.case)
+ mdl.setProfile('prof1', ['VelocitU', 'VelocitV', 'VelocitW'], 20, 0.1, 0.2, 0.3, 2.1, 2.2, 2.3)
+ doc = '''<profiles>
+ <profile label="prof1">
+ <var_prop name="velocity_U"/>
+ <var_prop name="velocity_V"/>
+ <var_prop name="velocity_W"/>
+ <output_frequency>20</output_frequency>
+ <x1>0.1</x1>
+ <y1>0.2</y1>
+ <z1>0.3</z1>
+ <x2>2.1</x2>
+ <y2>2.2</y2>
+ <z2>2.3</z2>
+ </profile>
+ </profiles>'''
+
+ assert mdl.node_prof == self.xmlNodeFromString(doc),\
+ 'Could not set profiles in ProfilesModel'
+
+
+ def checkReplaceProfile(self):
+ """Check whether the ProfilesModel class could replace profiles"""
+ mdl = ProfilesModel(self.case)
+ mdl.setProfile('prof1', ['VelocitU', 'VelocitV', 'VelocitW'], 20, 0.1, 0.2, 0.3, 2.1, 2.2, 2.3)
+ mdl.replaceProfile('prof1', 'premier', ['VelocitU'], 30, 0.1, 0.2, 0.3, 2.0, 2.0, 2.0)
+ doc = '''<profiles>
+ <profile label="premier">
+ <var_prop name="velocity_U"/>
+ <output_frequency>30</output_frequency>
+ <x1>0.1</x1>
+ <y1>0.2</y1>
+ <z1>0.3</z1>
+ <x2>2.0</x2>
+ <y2>2.0</y2>
+ <z2>2.0</z2>
+ </profile>
+ </profiles>'''
+
+ assert mdl.node_prof == self.xmlNodeFromString(doc),\
+ 'Could not replace profiles in ProfilesModel'
+
+
+ def checkDeleteProfile(self):
+ """Check whether the ProfilesModel class could delete profiles"""
+ mdl = ProfilesModel(self.case)
+
+ mdl.setProfile('prof1', ['VelocitU', 'VelocitV', 'VelocitW'], 20, 0.1, 0.2, 0.3, 2.1, 2.2, 2.3)
+ mdl.setProfile('prof2', ['VelocitU'], 20, 0.9, 0.8, 0.7, 9.1, 9.2, 9.3)
+ mdl.deleteProfile('prof1')
+ doc = '''<profiles>
+ <profile label="prof2">
+ <var_prop name="velocity_U"/>
+ <output_frequency>20</output_frequency>
+ <x1>0.9</x1>
+ <y1>0.8</y1>
+ <z1>0.7</z1>
+ <x2>9.1</x2>
+ <y2>9.2</y2>
+ <z2>9.3</z2>
+ </profile>
+ </profiles>'''
+ assert mdl.node_prof == self.xmlNodeFromString(doc),\
+ 'Could not delete profiles in ProfilesModel'
+
+
+ def checkGetVarProfile(self):
+ """Check whether the ProfilesModel class could get one profile"""
+ mdl = ProfilesModel(self.case)
+ mdl.setProfile('prof1', ['VelocitU', 'VelocitV', 'VelocitW'], 20, 0.1, 0.2, 0.3, 2.1, 2.2, 2.3)
+ mdl.setProfile('prof2', ['VelocitU'], 20, 0.9, 0.8, 0.7, 9.1, 9.2, 9.3)
+ prof = ('prof2', ['VelocitU'], 20, 0.9, 0.8, 0.7, 9.1, 9.2, 9.3)
+
+ assert mdl.getProfileData('prof2') == prof,\
+ 'Could not get values for profile named label in ProfilesModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(ProfilesTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print __file__
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/ProfilesView.py b/gui/Pages/ProfilesView.py
new file mode 100644
index 0000000..a9bcd09
--- /dev/null
+++ b/gui/Pages/ProfilesView.py
@@ -0,0 +1,625 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the 'Meshes and Enveloppe' page.
+
+This module contains the following classes:
+- ProfilesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import LABEL_LENGTH_MAX
+from Base.Toolbox import GuiParam
+from ProfilesForm import Ui_ProfilesForm
+from Base.QtPage import IntValidator, DoubleValidator, RegExpValidator, ComboModel
+from Pages.ProfilesModel import ProfilesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("ProfilesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelProfile(QStandardItemModel):
+
+ def __init__(self):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.setColumnCount(2)
+ self.dataProfile = []
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataProfile[index.row()][index.column()])
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ if section == 0:
+ return QVariant(self.tr("Profile name"))
+ elif section == 1:
+ return QVariant(self.tr("Variables"))
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self, label, prof):
+ """
+ Add a row in the table.
+ """
+ self.dataProfile.append([label, prof])
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def replaceItem(self, row, label, prof):
+ """
+ Replace a row in the table.
+ """
+ self.dataProfile[row] = [label, prof]
+
+
+ def deleteRow(self, row):
+ """
+ Delete the row in the model
+ """
+ del self.dataProfile[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+
+ def getItem(self, row):
+ """
+ Returns the name of the mesh file.
+ """
+ return self.dataProfile[row]
+
+
+ def getLabel(self, row):
+ """
+ Returns the name of the mesh file.
+ """
+ return self.dataProfile[row][0]
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class DragListView(QListView):
+ def __init__(self, parent=None):
+ QListView.__init__(self, parent)
+ self.setObjectName("DragList")
+ self.setAlternatingRowColors(True)
+ self.setDragEnabled(True)
+ self.setAcceptDrops(True)
+ self.setDragDropOverwriteMode(False)
+ self.setDragDropMode(QAbstractItemView.DragDrop)
+
+
+# def dragEnterEvent(self,event):
+# if event.mimeData().hasFormat("application/x-ics"):
+# if event.source() in self.children():
+# event.setDropAction(Qt.MoveAction)
+# event.accept()
+# else:
+# event.acceptProposedAction()
+#
+# elif event.mimeData().hasText():
+# event.acceptProposedAction()
+# else:
+# event.ignore()
+
+# def dragMoveEvent(self,event):
+# event.ignore()
+#
+# def dragLeaveEvent(self,event):
+# event.accept()
+# print "1 drag leave"
+#
+# def dropEvent(self,event):
+# event.acceptProposedAction()
+# print "1 drag drop"
+
+
+# def mouseMoveEvent(self, event):
+# self.QtBaseClass.mousePressEvent(self, event)
+# if self.enable_drag:
+# if event.buttons() & Qt.LeftButton != Qt.LeftButton:
+# return
+# if (event.pos() - self._drag_start_position).manhattanLength() < \
+# QApplication.startDragDistance():
+# return
+# self.start_drag(self._drag_start_position)
+#
+#
+# def dragEnterEvent(self, event):
+# if event.mimeData().hasFormat("text/uri-list"):
+# event.acceptProposedAction()
+#
+# def dragMoveEvent(self, event):
+# event.acceptProposedAction()
+#
+#
+# def dropEvent(self, event):
+# files = self._get_r_ok_files(event)
+# if files:
+# try:
+# event.setDropAction(Qt.CopyAction)
+# if self.files_dropped(files, event):
+# event.accept()
+# except Exception, e:
+# Error("There was an error processing the dropped files.", e)
+# raise e
+
+
+class DropListView(QListView):
+ def __init__(self, parent=None):
+ QListView.__init__(self, parent)
+ self.setObjectName("DragList")
+ self.setAlternatingRowColors(True)
+ self.setDragEnabled(True)
+ self.setAcceptDrops(True)
+ self.setDragDropOverwriteMode(False)
+ self.setDragDropMode(QAbstractItemView.DragDrop)
+
+
+# def dragEnterEvent(self,event):
+# if event.mimeData().hasFormat("application/x-ics"):
+# print "1"
+# if event.source() in self.children():
+# event.setDropAction(Qt.MoveAction)
+# event.accept()
+# else:
+# event.acceptProposedAction()
+#
+# elif event.mimeData().hasText():
+# print "2"
+# event.acceptProposedAction()
+# else:
+# print "3"
+# event.ignore()
+
+# def dragMoveEvent(self,event):
+# event.ignore()
+#
+# def dragLeaveEvent(self,event):
+# event.accept()
+# print "2 drag leave"
+
+# def dropEvent(self,event):
+# if event.mimeData().hasText():
+# text = event.mimeData().text()
+# self.model().append(text)
+# event.acceptProposedAction()
+# else:
+# event.ignore()
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class ProfilesView(QWidget, Ui_ProfilesForm):
+ """
+ """
+ def __init__(self, parent, case, stbar):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_ProfilesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = ProfilesModel(self.case)
+
+ # Initialize variables concerning the display of the Hlist
+
+ self.entriesNumber = 0
+
+ # Models
+ self.modelProfile = StandardItemModelProfile()
+ self.treeViewProfile.setModel(self.modelProfile)
+ self.treeViewProfile.resizeColumnToContents(0)
+
+ # QListView layout
+ self.gridlayout1 = QGridLayout(self.widgetDrag)
+ self.gridlayout1.setMargin(0)
+ self.DragList = DragListView(self.widgetDrag)
+ self.gridlayout1.addWidget(self.DragList,0,0,1,1)
+
+ self.gridlayout2 = QGridLayout(self.widgetDrop)
+ self.gridlayout2.setMargin(0)
+ self.DropList = DropListView(self.widgetDrop)
+ self.gridlayout2.addWidget(self.DropList,0,0,1,1)
+
+ self.modelDrag = QStringListModel()
+ self.modelDrop = QStringListModel()
+ self.DragList.setModel(self.modelDrag)
+ self.DropList.setModel(self.modelDrop)
+
+ # Combo items
+ self.modelFreq = ComboModel(self.comboBoxFreq, 2, 1)
+ self.modelFreq.addItem(self.tr("at the end of the calculation"), "end")
+ self.modelFreq.addItem(self.tr("at each 'n' time steps"), "frequency")
+
+ # Connections
+ self.connect(self.treeViewProfile, SIGNAL("pressed(const QModelIndex &)"), self.slotSelectProfile)
+ self.connect(self.pushButtonAdd, SIGNAL("clicked()"), self.slotAddProfile)
+ self.connect(self.pushButtonEdit, SIGNAL("clicked()"), self.slotEditProfile)
+ self.connect(self.pushButtonDelete, SIGNAL("clicked()"), self.slotDeleteProfile)
+ self.connect(self.comboBoxFreq, SIGNAL("activated(const QString&)"), self.slotFrequencyType)
+
+ # Validators
+ validatorFreq = IntValidator(self.lineEditFreq, min=0)
+ validatorFreq.setExclusiveMin(True)
+ self.lineEditFreq.setValidator(validatorFreq)
+
+ validatorFloat = DoubleValidator(self.lineEditX1)
+ self.lineEditX1.setValidator(validatorFloat)
+ self.lineEditY1.setValidator(validatorFloat)
+ self.lineEditZ1.setValidator(validatorFloat)
+ self.lineEditX2.setValidator(validatorFloat)
+ self.lineEditY2.setValidator(validatorFloat)
+ self.lineEditZ2.setValidator(validatorFloat)
+
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ validatorLabel = RegExpValidator(self.lineEditProfileName, QRegExp(rx))
+ self.lineEditProfileName.setValidator(validatorLabel)
+
+ #update list of variables, properties, scalars ...
+ liste_label = QStringList()
+ for label in self.mdl.getVariablesAndVolumeProperties():
+ liste_label.append(label)
+ self.modelDrag.setStringList(liste_label)
+
+ #update list of profiles for view from xml file
+ for lab in self.mdl.getProfilesLabelsList():
+ self.entriesNumber = self.entriesNumber + 1
+ label, list, freq, x1, y1, z1, x2, y2, z2 = self.mdl.getProfileData(lab)
+ self.__insertProfile(label, list)
+
+ self.__eraseEntries()
+
+
+ def __verifLabel(self):
+ """
+ Verif label.
+ """
+ label = str(self.lineEditProfileName.text())
+ if label in self.mdl.getProfilesLabelsList():
+ default = {}
+ default['label'] = label
+ default['list'] = self.mdl.getProfilesLabelsList()
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ default['regexp'] = QRegExp(rx)
+ from VerifyExistenceLabelDialogView import VerifyExistenceLabelDialogView
+ dialog = VerifyExistenceLabelDialogView(self, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ label = result['label']
+ if result['label'] == default['label']:
+ label = ""
+ return label
+
+
+ @pyqtSignature("const QString&")
+ def slotFrequencyType(self, text):
+ """
+ Input choice for frequency for profile.
+ """
+ choice = self.modelFreq.dicoV2M[str(text)]
+ self.freq = choice
+
+ if choice == "end":
+ nfreq = -1
+ self.lineEditFreq.setText(QString(str(nfreq)))
+ self.lineEditFreq.setDisabled(True)
+
+ if choice == "frequency":
+ self.lineEditFreq.setEnabled(True)
+ nfreq = self.__getFrequency()
+ self.lineEditFreq.setText(QString(str(nfreq)))
+
+ return choice, nfreq
+
+
+ def __getFrequency(self):
+ """
+ Input the frequency of the listing output
+ """
+ nfreq = 1
+
+ if self.freq == "frequency":
+ nfreq = int(self.lineEditFreq.text())
+ if nfreq > 0: self.nfreq = nfreq
+
+ return nfreq
+
+
+ #def setFrequency(self, nfreq):
+ #"""
+ #Put frequency' choice and values on view
+ #"""
+ #if nfreq == -1 or nfreq == None:
+ #self.modelFreq.setItem(str_model='end')
+ #self.lineEditFreq.setDisabled(True)
+ #else:
+ #self.modelFreq.setItem(str_model='frequency')
+ #self.lineEditFreq.setEnabled(True)
+ #self.lineEditFreq.setText(QString(str(nfreq)))
+
+
+ def __infoProfile(self, row):
+ """
+ Return info from the argument entry.
+ """
+ label = self.modelProfile.getLabel(row)
+ lab, liste, freq, x1, y1, z1, x2, y2, z2 = self.mdl.getProfileData(label)
+ return label, liste, freq, x1, y1, z1, x2, y2, z2
+
+
+ def __insertProfile(self, label, list):
+ """
+ Insert values in table view.
+ """
+ self.modelProfile.addItem(label, string.join(list,' ; '))
+
+
+
+ def __replaceProfile(self, num, label, list):
+ """
+ Insert values in table view.
+ """
+ self.modelProfile.replaceItem(num-1, label, string.join(list,' ; '))
+
+
+ @pyqtSignature("")
+ def slotAddProfile(self):
+ """
+ Set in view label and variables to see on profile
+ """
+ var_prof = [str(s) for s in self.modelDrop.stringList()]
+ log.debug("slotAddProfile -> %s" % (var_prof,))
+ if not var_prof:
+ title = self.tr("Warning")
+ msg = self.tr("You must select at least one variable or property from list")
+ QMessageBox.information(self, title, msg)
+
+ else:
+ label = self.__verifLabel()
+
+ self.entriesNumber = self.entriesNumber + 1
+ if label == '':
+ label = 'profile' + repr(self.entriesNumber)
+
+ if label in self.mdl.getProfilesLabelsList():
+ title = self.tr("Warning")
+ msg = self.tr("This label already exists")
+ QMessageBox.information(self, title, msg)
+ return
+
+ log.debug("slotAddProfile -> %s" % (label,))
+ self.__insertProfile(label, var_prof)
+
+ choice, freq = self.slotFrequencyType(self.comboBoxFreq.currentText())
+ X1, ok = self.lineEditX1.text().toDouble()
+ Y1, ok = self.lineEditY1.text().toDouble()
+ Z1, ok = self.lineEditZ1.text().toDouble()
+ X2, ok = self.lineEditX2.text().toDouble()
+ Y2, ok = self.lineEditY2.text().toDouble()
+ Z2, ok = self.lineEditZ2.text().toDouble()
+
+ self.mdl.setProfile(label, var_prof, freq, X1, Y1, Z1, X2, Y2, Z2)
+ self.__eraseEntries()
+
+
+ @pyqtSignature("")
+ def slotDeleteProfile(self):
+ """
+ Delete the profile from the list (one by one).
+ """
+ row = self.treeViewProfile.currentIndex().row()
+ log.debug("slotDeleteProfile -> %s" % (row,))
+ if row == -1:
+ title = self.tr("Warning")
+ msg = self.tr("You must select an existing profile")
+ QMessageBox.information(self, title, msg)
+ else:
+ label, vlist, freq, x1, y1, z1, x2, y2, z2 = self.__infoProfile(row)
+ self.modelProfile.deleteRow(row)
+ self.mdl.deleteProfile(label)
+ self.__eraseEntries()
+
+
+ @pyqtSignature("")
+ def slotEditProfile(self):
+ """
+ Edit profile to modify its characteristics.
+ """
+ row = self.treeViewProfile.currentIndex().row()
+ log.debug("slotEditProfile -> %s" % (row,))
+ if row == -1:
+ title = self.tr("Warning")
+ msg = self.tr("You must select an existing profile")
+ QMessageBox.information(self, title, msg)
+ else:
+ old_label, vlist, freq, x1, y1, z1, x2, y2, z2 = self.__infoProfile(row)
+
+ var_prof = [str(s) for s in self.modelDrop.stringList()]
+ log.debug("slotEditProfile -> %s" % (var_prof,))
+ if not var_prof:
+ title = self.tr("Warning")
+ msg = self.tr("You must select at least one variable or property from list")
+ QMessageBox.information(self, title, msg)
+
+ else:
+ new_label = str(self.lineEditProfileName.text())
+
+ if new_label == '':
+ new_label = 'profile' + repr(self.entriesNumber)
+
+ if new_label != old_label and new_label in self.mdl.getProfilesLabelsList():
+ title = self.tr("Warning")
+ msg = self.tr("This label already exists: the old label is kept")
+ QMessageBox.information(self, title, msg)
+ new_label = old_label
+
+ log.debug("slotEditedProfile -> %s" % (new_label,))
+ self.__replaceProfile(self.entriesNumber, new_label, var_prof)
+ idx = self.treeViewProfile.currentIndex()
+ self.treeViewProfile.dataChanged(idx, idx)
+
+ choice, freq = self.slotFrequencyType(self.comboBoxFreq.currentText())
+ X1, ok = self.lineEditX1.text().toDouble()
+ Y1, ok = self.lineEditY1.text().toDouble()
+ Z1, ok = self.lineEditZ1.text().toDouble()
+ X2, ok = self.lineEditX2.text().toDouble()
+ Y2, ok = self.lineEditY2.text().toDouble()
+ Z2, ok = self.lineEditZ2.text().toDouble()
+
+ self.mdl.replaceProfile(old_label, new_label, var_prof, freq, X1, Y1, Z1, X2, Y2, Z2)
+ self.__eraseEntries()
+
+
+ @pyqtSignature("const QModelIndex &")
+ def slotSelectProfile(self, index):
+ """
+ Return the selected item from the list.
+ """
+ row = index.row()
+ log.debug("slotSelectProfile -> %s" % (row,))
+
+ label, liste, freq, x1, y1, z1, x2, y2, z2 = self.__infoProfile(row)
+
+ self.lineEditProfileName.setText(QString(str(label)))
+
+ if freq >= 1:
+ self.modelFreq.setItem(str_model='frequency')
+ self.lineEditFreq.setEnabled(True)
+ self.lineEditFreq.setText(QString(str(freq)))
+ else:
+ self.modelFreq.setItem(str_model='end')
+ self.lineEditFreq.setText(QString(str("-1")))
+ self.lineEditFreq.setDisabled(True)
+
+ self.lineEditX1.setText(QString(str(x1)))
+ self.lineEditY1.setText(QString(str(y1)))
+ self.lineEditZ1.setText(QString(str(z1)))
+ self.lineEditX2.setText(QString(str(x2)))
+ self.lineEditY2.setText(QString(str(y2)))
+ self.lineEditZ2.setText(QString(str(z2)))
+
+ self.modelDrop.setStringList(QStringList())
+ liste = [QString(s) for s in liste]
+ self.modelDrop.setStringList(liste)
+
+
+ def __eraseEntries(self):
+ """
+ Delete all caracters in the entries.
+ """
+ self.lineEditProfileName.setText(QString(str("")))
+ self.lineEditX1.setText(QString(str("")))
+ self.lineEditY1.setText(QString(str("")))
+ self.lineEditZ1.setText(QString(str("")))
+ self.lineEditX2.setText(QString(str("")))
+ self.lineEditY2.setText(QString(str("")))
+ self.lineEditZ2.setText(QString(str("")))
+
+ self.modelFreq.setItem(str_model='end')
+ self.lineEditFreq.setText(QString(str("-1")))
+ self.lineEditFreq.setDisabled(True)
+ self.modelDrop.setStringList(QStringList())
+ self.treeViewProfile.clearSelection()
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/QMeiEditorForm.ui b/gui/Pages/QMeiEditorForm.ui
new file mode 100644
index 0000000..282a4e3
--- /dev/null
+++ b/gui/Pages/QMeiEditorForm.ui
@@ -0,0 +1,147 @@
+<ui version="4.0" >
+ <class>QMeiDialog</class>
+ <widget class="QDialog" name="QMeiDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>500</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Mathematical expression editor</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab_1" >
+ <attribute name="title" >
+ <string>User expression</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditExpression" >
+ <property name="font" >
+ <font>
+ <family>Courier New</family>
+ </font>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>true</bool>
+ </property>
+ <property name="verticalScrollBarPolicy" >
+ <enum>Qt::ScrollBarAsNeeded</enum>
+ </property>
+ <property name="horizontalScrollBarPolicy" >
+ <enum>Qt::ScrollBarAsNeeded</enum>
+ </property>
+ <property name="acceptRichText" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Predefined symbols</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditSymbols" >
+ <property name="font" >
+ <font>
+ <family>Courier New</family>
+ </font>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_3" >
+ <attribute name="title" >
+ <string>Examples</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditExamples" >
+ <property name="font" >
+ <font>
+ <family>Courier New</family>
+ </font>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ <property name="acceptRichText" >
+ <bool>false</bool>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ <zorder>buttonBox</zorder>
+ <zorder>tabWidget</zorder>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>QMeiDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>249</x>
+ <y>476</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>249</x>
+ <y>249</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>QMeiDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>249</x>
+ <y>476</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>249</x>
+ <y>249</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/QMeiEditorView.py b/gui/Pages/QMeiEditorView.py
new file mode 100644
index 0000000..81923af
--- /dev/null
+++ b/gui/Pages/QMeiEditorView.py
@@ -0,0 +1,337 @@
+# -*- coding: utf-8 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2007 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Dialog window of the mathematical expression interpretor.
+
+This module contains the following classes and function:
+- QMeiEditorView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, string
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from QMeiEditorForm import Ui_QMeiDialog
+import mei
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("QMeiEditorView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class QMeiHighlighter(QSyntaxHighlighter):
+
+ def __init__(self, document, required, symbols):
+ QSyntaxHighlighter.__init__(self, document)
+
+ list = []
+ for p,q in required:
+ list.append(p)
+ rx = string.join(list, r"|")
+ self.req_re = QRegExp(rx)
+ self.req_fmt = QTextCharFormat()
+ self.req_fmt.setFontWeight(QFont.Bold)
+
+ list = []
+ for p,q in symbols:
+ list.append(p)
+ rx = string.join(list, r"|")
+ self.sym_re = QRegExp(rx)
+ self.sym_fmt = QTextCharFormat()
+ self.sym_fmt.setFontWeight(QFont.Bold)
+
+ self.const_re = QRegExp(r"e|pi")
+ self.const_fmt = QTextCharFormat()
+ self.const_fmt.setForeground(Qt.darkCyan)
+
+ self.func_re = QRegExp(r"exp|log|sqrt|sin|cos|tan|asin|acos|atan|atan2|sinh|cosh|tanh|abs|min|max")
+ self.func_fmt = QTextCharFormat()
+ self.func_fmt.setFontWeight(QFont.Bold)
+ self.func_fmt.setForeground(Qt.blue)
+
+ self.kword_re = QRegExp(r"while|if|else|print")
+ self.kword_fmt = QTextCharFormat()
+ self.kword_fmt.setForeground(Qt.darkRed)
+
+ #self.special_re = QRegExp(r"[^\\][(),]")
+ #self.special_fmt = QTextCharFormat()
+ #self.special_fmt.setForeground(Qt.blue)
+
+ self.rules = [
+ (self.req_re, self.req_fmt, 0, 0),
+ (self.sym_re, self.sym_fmt, 0, 0),
+ (self.const_re, self.const_fmt, 0, 0),
+ (self.func_re, self.func_fmt, 0, 0),
+ (self.kword_re, self.kword_fmt, 0, 0),
+ #(self.special_re, self.special_fmt, 1, -1),
+ ]
+
+
+ def highlightBlock(self, text):
+ for expr, fmt, a, b in self.rules:
+ index = text.indexOf(expr)
+ while index >= 0:
+ length = expr.matchedLength()
+ self.setFormat(index + a, length + b, fmt)
+ index = text.indexOf(expr, index + length + b)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class QMeiEditorView(QDialog, Ui_QMeiDialog):
+ """
+ """
+ def __init__(self, parent, expression = "", symbols = [], required = [], examples = ""):
+ """
+ Constructor.
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_QMeiDialog.__init__(self)
+ self.setupUi(self)
+
+ self.required = required
+ self.symbols = symbols
+
+ #h1 = QMeiHighlighter(self.textEditExpression, required, symbols)
+ #h2 = QMeiHighlighter(self.textEditExamples, required, symbols)
+
+ # Required symbols of the mathematical expression
+
+ if not expression:
+ expression = ""
+ for p,q in required:
+ expression += p + " = \n"
+ else:
+ while expression[0] in (" ", "\n", "\t"):
+ expression = expression[1:]
+ while expression[-1] in (" ", "\n", "\t"):
+ expression = expression[:-1]
+
+ # Predefined symbols for the mathematical expression
+
+ predif = self.tr("<big><u>Required symbol:</u></big><br>")
+
+ for p,q in required:
+ for s in ("<b>", p, "</b>: ", q, "<br>"):
+ predif += s
+
+ if symbols:
+ predif += self.tr("<br><big><u>Predefined symbols:</u></big><br>")
+
+ for p,q in symbols:
+ for s in ("<b>", p, "</b>: ", q, "<br>"):
+ predif += s
+
+ predif += self.tr("<br>"\
+ "<big><u>Usefull functions:</u></big><br>"\
+ "<b>cos</b>: cosine<br>"\
+ "<b>sin</b>: sinus<br>"\
+ "<b>tan</b>: tangent<br>"\
+ "<b>exp</b>: exponential<br>"\
+ "<b>sqrt</b>: square root<br>"\
+ "<b>log</b>: napierian logarithm<br>"\
+ "<b>acos</b>: arccosine<br>"\
+ "<b>asin</b>: arcsine<br>"\
+ "<b>atan</b>: arctangent<br>"\
+ "<b>atan2</b>: arctangent<br>"\
+ "<b>cosh</b>: hyperbolic cosine<br>"\
+ "<b>sinh</b>: hyperbolic sine<br>"\
+ "<b>tanh</b>: hyperbolic tangent<br>"\
+ "<b>abs</b>: absolute value<br>"\
+ "<b>mod</b>: modulo<br>"\
+ "<b>int</b>: floor<br>"\
+ "<b>min</b>: minimum<br>"\
+ "<b>max</b>: maximum<br>"\
+ "<br>"\
+ "<big><u>Usefull constants:</u></big><br>"\
+ "<b>pi</b> = 3.14159265358979323846<br>"\
+ "<b>e</b> = 2.718281828459045235<br>"\
+ "<br>"\
+ "<big><u>Operators and statements:</u></big><br>"\
+ "<b><code> + - * / ^ </code></b><br>"\
+ "<b><code>! < > <= >= == != && || </code></b><br>"\
+ "<b><code>while if else</code></b><br>"\
+ "")
+
+ # lay out the text
+
+ self.textEditExpression.setText(expression)
+ self.textEditSymbols.setText(predif)
+ self.textEditExamples.setText(examples)
+
+ self.expressionDoc = self.textEditExpression.document()
+
+
+ @pyqtSignature("")
+ def slotClearBackground(self):
+ """
+ Private slot.
+ """
+ QObject.disconnect(self.textEditExpression, SIGNAL("textChanged()"), self.slotClearBackground)
+ doc = self.textEditExpression.document()
+
+ for i in range(0, doc.blockCount()):
+ block_text = doc.findBlockByNumber(i)
+ log.debug("block: %s" % block_text.text())
+ cursor = QTextCursor(block_text)
+ block_format = QTextBlockFormat()
+ block_format.clearBackground()
+ cursor.setBlockFormat(block_format)
+
+
+ def accept(self):
+ """
+ What to do when user clicks on 'OK'.
+ """
+ log.debug("accept()")
+
+ doc = self.textEditExpression.document()
+
+ intr = mei.mei_tree_new(str(self.textEditExpression.toPlainText()))
+ log.debug("intr.string: %s" % intr.string)
+
+ for p,q in self.symbols:
+ mei.mei_tree_insert(intr, p, 0.0)
+
+ # Unknown symbols
+
+ if mei.mei_tree_builder(intr):
+ log.debug("intr.errors: %s" % intr.errors)
+ for i in range(0, intr.errors):
+ log.debug(" line: %s \n column: %s\n" % (intr.lines[i], intr.columns[i]))
+ msg = ""
+ for i in range(0, intr.errors):
+ l = intr.lines[i]
+ c = intr.columns[i]
+ block_text = doc.findBlockByNumber(l - 1)
+ cursor = QTextCursor(block_text)
+ block_format = QTextBlockFormat()
+ block_format.setBackground(QBrush(QColor(Qt.red)))
+ cursor.setBlockFormat(block_format)
+
+ #self.textEditExpression.setCursorPosition(l, c)
+ #self.textEditExpression.setFocus()
+ msg += intr.labels[i] + \
+ " line: " + str(l) + " \n" + \
+ " column: " + str(c) + " \n\n"
+
+ QMessageBox.critical(self, self.tr('Expression Editor'), QString(msg))
+ intr = mei.mei_tree_destroy(intr)
+ QObject.connect(self.textEditExpression, SIGNAL("textChanged()"), self.slotClearBackground)
+ return
+
+ # If required symbols are missing
+
+ list = []
+ for p,q in self.required:
+ list.append(p)
+
+ if mei.mei_tree_find_symbols(intr, len(list), list):
+ msg = "Warning, these required symbols are not found:\n\n"
+ for i in range(0, doc.blockCount()):
+ block_text = doc.findBlockByNumber(i)
+ cursor = QTextCursor(block_text)
+ block_format = QTextBlockFormat()
+ block_format.setBackground(QBrush(QColor(Qt.magenta)))
+ cursor.setBlockFormat(block_format)
+ #self.textEditExpression.setFocus()
+ for i in range(0, intr.errors): msg += intr.labels[i] + " \n"
+ QMessageBox.critical(self, self.tr('Expression Editor'), QString(msg))
+ intr = mei.mei_tree_destroy(intr)
+ QObject.connect(self.textEditExpression, SIGNAL("textChanged()"), self.slotClearBackground)
+ return
+
+ intr = mei.mei_tree_destroy(intr)
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when 'Cancel' button is clicked
+ """
+ log.debug("reject()")
+ QDialog.reject(self)
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.textEditExpression.toPlainText()
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Test function
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ import sys, signal
+ app = QApplication(sys.argv)
+ app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
+ parent = QWidget()
+ dlg = QMeiEditorView(parent)
+ dlg.show()
+ signal.signal(signal.SIGINT, signal.SIG_DFL)
+ sys.exit(app.exec_())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/ReferenceValuesForm.ui b/gui/Pages/ReferenceValuesForm.ui
new file mode 100644
index 0000000..caa8862
--- /dev/null
+++ b/gui/Pages/ReferenceValuesForm.ui
@@ -0,0 +1,299 @@
+<ui version="4.0" >
+ <class>ReferenceValuesForm</class>
+ <widget class="QWidget" name="ReferenceValuesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>272</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: P0</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxPressure" >
+ <property name="title" >
+ <string>Reference pressure</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelP0" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: P0</string>
+ </property>
+ <property name="text" >
+ <string>Reference value for total pressure</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditP0" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: P0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitP0" >
+ <property name="text" >
+ <string>Pa</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxTemperature" >
+ <property name="title" >
+ <string>Reference temperature</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelT0" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: T0</string>
+ </property>
+ <property name="text" >
+ <string>Reference temperature</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditT0" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: T0</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitT0" >
+ <property name="text" >
+ <string>K</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelInfoT0" >
+ <property name="text" >
+ <string>(used for initialization of enthalpy and density)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QGroupBox" name="groupBoxMassMolar" >
+ <property name="title" >
+ <string>Mass molar molecular reference</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelMassMolar" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: WMOLME</string>
+ </property>
+ <property name="text" >
+ <string>Mass molar reference</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditMassMolar" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: WMOLME</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelUnitMassMolar" >
+ <property name="text" >
+ <string>kg/mol</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelInfoMassMolar" >
+ <property name="text" >
+ <string>(used for initialization of user scalars)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/ReferenceValuesModel.py b/gui/Pages/ReferenceValuesModel.py
new file mode 100644
index 0000000..3bec944
--- /dev/null
+++ b/gui/Pages/ReferenceValuesModel.py
@@ -0,0 +1,287 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- ReferenceValuesModel
+- ReferenceValuesTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+from Pages.CoalCombustionModel import CoalCombustionModel
+from Pages.GasCombustionModel import GasCombustionModel
+from Pages.ElectricalModelsModel import ElectricalModel
+
+#-------------------------------------------------------------------------------
+# Reference values model class
+#-------------------------------------------------------------------------------
+
+class ReferenceValuesModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Pressure
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_veloce = self.node_models.xmlGetNode('velocity_pressure')
+ self.node_coal = self.node_models.xmlGetNode('pulverized_coal', 'model')
+ self.node_gas = self.node_models.xmlGetNode('gas_combustion', 'model')
+ self.node_joule = self.node_models.xmlGetNode('joule_effect', 'model')
+
+ self.ppList = ['off', 'ebu', 'd3p',
+ 'coal_homo', 'coal_homo2', 'coal_lagr',
+ 'joule', 'arc']
+
+
+ def defaultValues(self):
+ """
+ Return reference values by default
+ """
+ default = {}
+ default['reference_pressure'] = 1.01325e+5
+ default['reference_temperature'] = 1273.15
+ # mass molar for dry air
+ default['reference_mass_molar'] = 28.966e-3
+
+ return default
+
+
+ def setPressure(self, value):
+ """
+ Set value of reference pressure into xml file.
+ """
+ self.isGreaterOrEqual(value, 0.0)
+ node = self.node_veloce.xmlGetNode('variable', name ='pressure')
+ node.xmlSetData('reference_pressure', value)
+
+
+ def getPressure(self):
+ """
+ Return the value of reference pressure.
+ """
+ node = self.node_veloce.xmlGetNode('variable', name ='pressure')
+ value = node.xmlGetDouble('reference_pressure')
+ if value == None:
+ value = self.defaultValues()['reference_pressure']
+ self.setPressure(value)
+
+ return value
+
+
+ def setTemperature(self, value):
+ """
+ Set reference temperature.
+ """
+ self.isGreater(value, 0.0)
+ model, node = self.getParticularPhysical()
+ node.xmlSetData('reference_temperature', value)
+
+
+ def getTemperature(self):
+ """
+ Get reference temperature.
+ """
+ model, node = self.getParticularPhysical()
+ value = node.xmlGetDouble('reference_temperature')
+ if not value :
+ value = self.defaultValues()['reference_temperature']
+ self.setTemperature(value)
+ return value
+
+
+ def setMassemol(self, value):
+ """
+ Set reference mass molar.
+ """
+ self.isGreater(value, 0.0)
+ model, node = self.getParticularPhysical()
+ node.xmlSetData('reference_mass_molar', value)
+
+
+ def getMassemol(self):
+ """
+ Get reference mass molar.
+ """
+ model, node = self.getParticularPhysical()
+ value = node.xmlGetDouble('reference_mass_molar')
+ if not value :
+ value = self.defaultValues()['reference_mass_molar']
+ self.setMassemol(value)
+ return value
+
+
+ def getParticularPhysical(self):
+ """
+ Get model for set temperature for relative model
+ """
+ model = 'off'
+ node = None
+ coalModel = CoalCombustionModel(self.case).getCoalCombustionModel()
+ gasModel = GasCombustionModel(self.case).getGasCombustionModel()
+ jouleModel = ElectricalModel(self.case).getElectricalModel()
+ if coalModel != 'off':
+ model = coalModel
+ node = self.node_coal
+ if gasModel != 'off':
+ model = gasModel
+ node = self.node_gas
+ if jouleModel != 'off':
+ model = jouleModel
+ node = self.node_joule
+ self.isInList(model, self.ppList)
+ return model, node
+
+
+#-------------------------------------------------------------------------------
+# ReferenceValuesModel test case
+#-------------------------------------------------------------------------------
+GasCombustionModel
+
+class ReferenceValuesTestCase(ModelTest):
+ """
+ """
+ def checkReferenceValuesInstantiation(self):
+ """Check whether the ReferenceValuesModel class could be instantiated"""
+ model = None
+ model = ReferenceValuesModel(self.case)
+ assert model != None, 'Could not instantiate ReferenceValuesModel'
+
+ def checkGetandSetPressure(self):
+ """Check whether the ReferenceValuesModel class could be set and get Pressure"""
+ mdl = ReferenceValuesModel(self.case)
+ mdl.setPressure(13e+5)
+
+ doc = """<velocity_pressure>
+ <variable label="Pressure" name="pressure">
+ <reference_pressure>1.3e+06</reference_pressure>
+ </variable>
+ <variable label="VelocitU" name="velocity_U"/>
+ <variable label="VelocitV" name="velocity_V"/>
+ <variable label="VelocitW" name="velocity_W"/>
+ <property label="total_pressure" name="total_pressure"/>
+ <property label="Yplus" name="yplus" support="boundary"/>
+ <property label="Efforts" name="effort" support="boundary"/>
+ <property label="all_variables" name="all_variables" support="boundary"/>
+ </velocity_pressure>"""
+ assert mdl.node_veloce == self.xmlNodeFromString(doc),\
+ 'Could not set pressure ReferenceValuesModel'
+ assert mdl.getPressure() == 13e+5,\
+ 'Could not get pressure ReferenceValuesModel'
+
+ def checkGetandSetTemperature(self):
+ """Check whether the ReferenceValuesModel class could be set and get Temperature"""
+ mdl = ReferenceValuesModel(self.case)
+ from Pages.CoalCombustionModel import CoalCombustionModel
+ CoalCombustionModel(self.case).setCoalCombustionModel('coal_homo')
+ del CoalCombustionModel
+ mdl.setTemperature(55.5)
+
+ doc = """<pulverized_coal model="coal_homo">
+ <scalar label="Enthalpy" name="Enthalpy" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="NP_CP01" name="NP_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCH_CP01" name="XCH_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="XCK_CP01" name="XCK_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="ENT_CP01" name="ENT_CP01" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV101" name="Fr_MV101" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_MV201" name="Fr_MV201" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Fr_HET" name="Fr_HET" type="model"><flux_reconstruction status="off"/></scalar>
+ <scalar label="Var_AIR" name="Var_AIR" type="model"><flux_reconstruction status="off"/></scalar>
+ <property label="Temp_GAZ" name="Temp_GAZ"/>
+ <property label="ROM_GAZ" name="ROM_GAZ"/>
+ <property label="YM_CHx1m" name="YM_CHx1m"/>
+ <property label="YM_CHx2m" name="YM_CHx2m"/>
+ <property label="YM_CO" name="YM_CO"/>
+ <property label="YM_O2" name="YM_O2"/>
+ <property label="YM_CO2" name="YM_CO2"/>
+ <property label="YM_H2O" name="YM_H2O"/>
+ <property label="YM_N2" name="YM_N2"/>
+ <property label="XM" name="XM"/>
+ <property label="Temp_CP01" name="Temp_CP01"/>
+ <property label="Frm_CP01" name="Frm_CP01"/>
+ <property label="Rho_CP01" name="Rho_CP01"/>
+ <property label="Dia_CK01" name="Dia_CK01"/>
+ <property label="Ga_DCH01" name="Ga_DCH01"/>
+ <property label="Ga_DV101" name="Ga_DV101"/>
+ <property label="Ga_DV201" name="Ga_DV201"/>
+ <property label="Ga_HET01" name="Ga_HET01"/>
+ <property label="ntLuminance_4PI" name="ntLuminance_4PI"/>
+ <reference_temperature>55.5</reference_temperature>
+ </pulverized_coal>"""
+ assert mdl.node_coal == self.xmlNodeFromString(doc),\
+ 'Could not set temperature ReferenceValuesModel'
+ assert mdl.getTemperature() == 55.5,\
+ 'Could not get temperature ReferenceValuesModel'
+
+ def checkGetandSsetMassemol(self):
+ """Check whether the ReferenceValuesModel class could be set and get Molar mass"""
+ mdl = ReferenceValuesModel(self.case)
+ from Pages.GasCombustionModel import GasCombustionModel
+ GasCombustionModel(self.case).setGasCombustionModel('ebu')
+ del GasCombustionModel
+ mdl.setMassemol(50.8e-3)
+ doc = """<gas_combustion model="ebu">
+ <reference_mass_molar>0.0508</reference_mass_molar>
+ </gas_combustion>"""
+ assert mdl.node_gas == self.xmlNodeFromString(doc),\
+ 'Could not set molar mass ReferenceValuesModel'
+ assert mdl.getMassemol() == 50.8e-3,\
+ 'Could not get molar mass ReferenceValuesModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(ReferenceValuesTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "ReferenceValuesTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/ReferenceValuesView.py b/gui/Pages/ReferenceValuesView.py
new file mode 100644
index 0000000..a4d5889
--- /dev/null
+++ b/gui/Pages/ReferenceValuesView.py
@@ -0,0 +1,176 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; ReferenceValuesif not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- ReferenceValuesView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from ReferenceValuesForm import Ui_ReferenceValuesForm
+import Base.QtPage as QtPage
+from Pages.ReferenceValuesModel import ReferenceValuesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("ReferenceValuesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class ReferenceValuesView(QWidget, Ui_ReferenceValuesForm):
+ """
+ Class to open Reference Pressure Page.
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_ReferenceValuesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = ReferenceValuesModel(self.case)
+
+ # Connections
+
+ self.connect(self.lineEditP0, SIGNAL("textChanged(const QString &)"), self.slotPressure)
+ self.connect(self.lineEditT0, SIGNAL("textChanged(const QString &)"), self.slotTemperature)
+ self.connect(self.lineEditMassMolar, SIGNAL("textChanged(const QString &)"), self.slotMassemol)
+
+ # Validators
+
+ validatorP0 = QtPage.DoubleValidator(self.lineEditP0, min=0.0)
+ self.lineEditP0.setValidator(validatorP0)
+
+ validatorT0 = QtPage.DoubleValidator(self.lineEditT0, min=0.0)
+ validatorT0.setExclusiveMin(True)
+ self.lineEditT0.setValidator(validatorT0)
+
+ validatorMM = QtPage.DoubleValidator(self.lineEditMassMolar, min=0.0)
+ validatorMM.setExclusiveMin(True)
+ self.lineEditMassMolar.setValidator(validatorMM)
+
+ # Display
+
+ model, node = self.mdl.getParticularPhysical()
+ if model != "off":
+ self.groupBoxTemperature.show()
+ self.groupBoxMassMolar.show()
+ else:
+ self.groupBoxTemperature.hide()
+ self.groupBoxMassMolar.hide()
+
+ # Initialization
+
+ p = self.mdl.getPressure()
+ self.lineEditP0.setText(QString(str(p)))
+
+ model, node = self.mdl.getParticularPhysical()
+ if model != "off":
+ t = self.mdl.getTemperature()
+ self.lineEditT0.setText(QString(str(t)))
+
+ m = self.mdl.getMassemol()
+ self.lineEditMassMolar.setText(QString(str(m)))
+
+
+ @pyqtSignature("const QString&")
+ def slotPressure(self, text):
+ """
+ Input PRESS.
+ """
+ p, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setPressure(p)
+
+
+ @pyqtSignature("const QString&")
+ def slotTemperature(self, text):
+ """
+ Input TEMPERATURE.
+ """
+ t, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setTemperature(t)
+
+
+ @pyqtSignature("const QString&")
+ def slotMassemol(self, text):
+ """
+ Input Mass molar.
+ """
+ m, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setMassemol(m)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/SalomeHandler.py b/gui/Pages/SalomeHandler.py
new file mode 100644
index 0000000..3615f65
--- /dev/null
+++ b/gui/Pages/SalomeHandler.py
@@ -0,0 +1,276 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines hooks with the SALOME plate-forme concerning
+the graphical selection of the Groups.
+
+This module contains the following classes and function:
+- BoundaryGroup
+- VolumeGroup
+- runSolver
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules
+#-------------------------------------------------------------------------------
+
+import os
+import os.path
+import logging
+
+#-------------------------------------------------------------------------------
+# Application modules
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+import CFDSTUDYGUI
+import CFDSTUDYGUI_ProcessMgr
+from CFDSTUDYGUI_DataModel import _getStudy, _getEngine
+from CFDSTUDYGUI_Commons import sg, sgPyQt
+from salome import lcc
+import smesh
+import GEOM
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("SalomeHandler")
+log.setLevel(logging.DEBUG)
+
+#-------------------------------------------------------------------------------
+
+aStudy = _getStudy()
+aSMESH_SO = aStudy.FindComponent("SMESH")
+aGEOM_SO = aStudy.FindComponent("GEOM")
+
+#loading IORs
+builder = aStudy.NewBuilder()
+if aSMESH_SO != None:
+ aSMESHEngine = lcc.FindOrLoadComponent("FactoryServer", "SMESH")
+ builder.LoadWith(aSMESH_SO, aSMESHEngine)
+if aGEOM_SO != None:
+ aGEOMEngine = lcc.FindOrLoadComponent("FactoryServer", "GEOM")
+ builder.LoadWith(aGEOM_SO, aGEOMEngine)
+
+#-------------------------------------------------------------------------------
+
+#def isSmeshAndGeomActivated():
+# if aSMESH_SO == None and aGEOM_SO == None:
+# return False
+# else:
+# return True
+
+
+#def isSmeshActivated():
+# if aSMESH_SO == None:
+# tkMessageBox.showwarning ("WARNING", "MESH module is not activated.")
+# return False
+# else:
+# return True
+
+
+def BoundaryGroup():
+ """
+ Import groups of faces.
+ """
+ if aSMESH_SO == None and aGEOM_SO == None:
+ raise ValueError, "Component SMESH and GEOM not found"
+
+ local = ""
+ if sg.SelectedCount() > 0:
+ for i in range (sg.SelectedCount()):
+ entry = sg.getSelected(i)
+ if entry != '':
+ sobj = aStudy.FindObjectID(entry)
+ if sobj != None:
+ anObjectDS = sobj.GetObject()
+ if anObjectDS != None:
+
+ # check for smesh group
+ aSmeshObject = anObjectDS._narrow(smesh.SMESH_GroupBase)
+ #if aSmeshObject == None:
+ # aSmeshObject = anObjectDS._narrow(smesh.SMESH_Group)
+ #if aSmeshObject == None:
+ # aSmeshObject = anObjectDS._narrow(smesh.SMESH_GroupOnGeom)
+
+ if aSmeshObject != None and aSmeshObject.GetType() == smesh.FACE:
+ if not local:
+ local = aSmeshObject.GetName()
+ else:
+ local += ' or ' + aSmeshObject.GetName()
+
+ # check for geom group of faces
+ aGeomObject = anObjectDS._narrow(GEOM.GEOM_Object)
+ if aGeomObject != None and aGeomObject.GetType() == 37:
+ # check the group
+ # get all possible faces
+ import geompy
+ all_ids = geompy.SubShapeAllIDs(aGeomObject.GetMainShape(), geompy.ShapeType["FACE"])
+ cur_ids = geompy.GetObjectIDs(aGeomObject)
+ isValid = len(cur_ids) > 0 # not include empty list
+ if isValid:
+ for face_id in cur_ids:
+ if not face_id in all_ids:
+ #invalid id
+ isValid = False
+ break
+
+ if isValid:
+ if not local:
+ local = aGeomObject.GetName()
+ else:
+ local += ' or ' + aGeomObject.GetName()
+
+ log.debug("BoundaryGroup -> %s" % str(local))
+ return local
+
+
+def VolumeGroup():
+ """
+ Import groups of solid.
+ """
+ if aSMESH_SO == None and aGEOM_SO == None:
+ raise ValueError, "Component SMESH and GEOM not found"
+
+ local = ""
+ if sg.SelectedCount() > 0:
+ for i in range (sg.SelectedCount()):
+ entry = sg.getSelected(i)
+ if entry != '':
+ sobj = aStudy.FindObjectID(entry)
+ if sobj != None:
+ anObjectDS = sobj.GetObject()
+ #check for smesh group
+ if anObjectDS != None:
+ #aSmeshObject = anObjectDS._narrow(smesh.SMESH_Group)
+ aSmeshObject = anObjectDS._narrow(smesh.SMESH_GroupBase)
+ if aSmeshObject != None and aSmeshObject.GetType() == smesh.VOLUME:
+ if not local:
+ local = aSmeshObject.GetName()
+ else:
+ local += ' or ' + aSmeshObject.GetName()
+
+ # check for geom group of volumes
+ aGeomObject = anObjectDS._narrow(GEOM.GEOM_Object)
+ if aGeomObject != None and aGeomObject.GetType() == 37:
+ # check the group
+ # get all possible volumes
+ import geompy
+ all_ids = geompy.SubShapeAllIDs(aGeomObject.GetMainShape(), geompy.ShapeType["SOLID"])
+ cur_ids = geompy.GetObjectIDs(aGeomObject)
+ isValid = len(cur_ids) > 0 # not include empty list
+ if isValid:
+ for face_id in cur_ids:
+ if not face_id in all_ids:
+ # invalid id
+ isValid = False
+ break
+
+ if isValid:
+ if not local:
+ local = aGeomObject.GetName()
+ else:
+ local += ' or ' + aGeomObject.GetName()
+
+ log.debug("VolumeGroup -> %s" % str(local))
+ return local
+
+
+#def VolumeGroupOld():
+# """
+# Import groups of cells.
+# """
+# if aSMESH_SO == None:
+# return False
+#
+# #loading IORs
+# builder = aStudy.NewBuilder()
+# if aSMESH_SO != None:
+# aSMESHEngine = lcc.FindOrLoadComponent("FactoryServer", "SMESH")
+# builder.LoadWith(aSMESH_SO, aSMESHEngine)
+#
+# local = ""
+# if sg.SelectedCount() > 0:
+# for i in range (sg.SelectedCount()):
+# entry = sg.getSelected(i)
+# if entry != '':
+# sobj = aStudy.FindObjectID(entry)
+# if sobj != None:
+# anObjectDS = sobj.GetObject()
+# #check for smesh group
+# if anObjectDS != None:
+# #aSmeshObject = anObjectDS._narrow(smesh.SMESH_Group)
+# aSmeshObject = anObjectDS._narrow(smesh.SMESH_GroupBase)
+# if aSmeshObject != None and aSmeshObject.GetType() == smesh.VOLUME:
+# if not local:
+# local = aSmeshObject.GetName()
+# else:
+# local = local + ' or ' + aSmeshObject.GetName()
+#
+# return local
+
+
+def runSolver(case, cmd, mdl, log_file):
+ #_CommandMgr = CFDSTUDYGUI_CommandMgr.CFDSTUDYGUI_CommandMgr()
+ #_CommandMgr.runCommand( cmd, os.path.abspath(os.path.curdir), "", log_file)
+
+ tmp_path = ''
+ if mdl.dicoValues['CS_TMP_PREFIX']:
+ tmp_path = mdl.dicoValues['CS_TMP_PREFIX']
+ elif os.environ["NOM_ARCH"] == "OSF1":
+ tmp_path = os.environ["TMPDIR"]
+ elif os.environ["NOM_ARCH"] == "Linux_CCRT":
+ tmp_path = os.environ["SCRATCHDIR"]
+ elif os.environ["NOM_ARCH"] == "Linux_IA64":
+ tmp_path = os.environ["SCRATCHDIR"]
+ elif os.environ["NOM_ARCH"] == "Linux_SCALI":
+ tmp_path = os.environ["HOME"]
+ elif "TMPDIR" in os.environ and os.environ["TMPDIR"] != '' and os.environ["TMPDIR"] != '/tmp':
+ tmp_path = os.environ["TMPDIR"]
+ else:
+ tmp_path = os.environ["HOME"]
+
+ study_dir, case_name = os.path.split(case['case_path'])
+ study_name = os.path.split(study_dir)[-1]
+ tmp_path = os.path.join(tmp_path, "tmp_Saturne")
+ tmp_path = os.path.join(tmp_path, study_name) + "." + case_name
+
+ CFDSTUDYGUI.processMgr().addProcess(cmd, \
+ case['case_path'], \
+ case['xmlfile'], \
+ tmp_path, \
+ mdl.dicoValues['ARG_CS_OUTPUT'])
+
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/SolutionDomainForm.ui b/gui/Pages/SolutionDomainForm.ui
new file mode 100644
index 0000000..97b93c4
--- /dev/null
+++ b/gui/Pages/SolutionDomainForm.ui
@@ -0,0 +1,1136 @@
+<ui version="4.0" >
+ <class>SolutionDomainForm</class>
+ <widget class="QWidget" name="SolutionDomainForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>867</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Meshes</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxMeshes" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -mesh</string>
+ </property>
+ <property name="title" >
+ <string>List of meshes</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTableView" name="tableViewMeshes" >
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="horizontalScrollBarPolicy" >
+ <enum>Qt::ScrollBarAsNeeded</enum>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonAddMesh" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDeleteMesh" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxJoin" >
+ <property name="title" >
+ <string>Join meshes</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QFrame" name="frameJoin" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_5" >
+ <property name="statusTip" >
+ <string>Boundary faces selections for meshes join. These selections are optional. A selection can be activated or not. </string>
+ </property>
+ <property name="text" >
+ <string>Select boundary faces from single meshes to join (optional)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="FacesSelectionView" native="1" name="widgetFacesJoin" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>200</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QGroupBox" name="groupBoxWarp" >
+ <property name="title" >
+ <string>Subdivide warped faces</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QFrame" name="frameWarp" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="statusTip" >
+ <string>Faces are cut with a Delaunay method if their warp angle is greatter than an minimal angle in degrees (default angle value: 0.01).</string>
+ </property>
+ <property name="text" >
+ <string>Max warp angle</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditWarp" >
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QGroupBox" name="groupBoxOrient" >
+ <property name="enabled" >
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Correct cell and face orientations</string>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>428</width>
+ <height>218</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Periodic Boundaries</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item rowspan="2" row="0" column="0" >
+ <widget class="QTreeView" name="treeViewPeriod" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="indentation" >
+ <number>0</number>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QPushButton" name="pushButtonAddPeriod" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="pushButtonDeletePeriod" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxMode" >
+ <property name="title" >
+ <string>Type of definition for the selected periodicity</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxPeriodicity" >
+ <property name="toolTip" >
+ <string>Preprocessor option:-trans or -rota</string>
+ </property>
+ <property name="statusTip" >
+ <string>Periodicity's transformation mode selection </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QGroupBox" name="groupBoxTranslation" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="title" >
+ <string>Translation vector </string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelTX" >
+ <property name="text" >
+ <string>T<sub>X</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditTX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: -trans</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelTY" >
+ <property name="text" >
+ <string>T<sub>Y</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditTY" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelTZ" >
+ <property name="text" >
+ <string>T<sub>Z</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditTZ" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QGroupBox" name="groupBoxRotation1" >
+ <property name="title" >
+ <string>Rotation definitions</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelAngle" >
+ <property name="text" >
+ <string>angle (deg)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditAngle" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Rotation vector</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignHCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelDX" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>D<sub>X</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDX" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelDY" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>D<sub>Y</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDY" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelDZ" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>D<sub>Z</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditDZ" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3" >
+ <property name="title" >
+ <string>Invariant point coordinates</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignHCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelX1" >
+ <property name="text" >
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditX1" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelY1" >
+ <property name="text" >
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditY1" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelZ1" >
+ <property name="text" >
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditZ1" />
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QGroupBox" name="groupBoxRotation2" >
+ <property name="title" >
+ <string>Rotation definition</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox_4" >
+ <property name="title" >
+ <string>Rotation matrix coefficients</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignHCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelM11" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>11</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditM11" />
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QLabel" name="labelM12" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>12</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QLineEdit" name="lineEditM12" />
+ </item>
+ <item row="0" column="5" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="6" >
+ <widget class="QLabel" name="labelM13" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>13</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="7" >
+ <widget class="QLineEdit" name="lineEditM13" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelM21" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>21</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditM21" />
+ </item>
+ <item row="1" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="3" >
+ <widget class="QLabel" name="labelM22" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>22</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" >
+ <widget class="QLineEdit" name="lineEditM22" />
+ </item>
+ <item row="1" column="5" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="6" >
+ <widget class="QLabel" name="labelM23" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>23</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="7" >
+ <widget class="QLineEdit" name="lineEditM23" />
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelM31" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>31</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditM31" />
+ </item>
+ <item row="2" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="3" >
+ <widget class="QLabel" name="labelM32" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>32</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4" >
+ <widget class="QLineEdit" name="lineEditM32" />
+ </item>
+ <item row="2" column="5" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="6" >
+ <widget class="QLabel" name="labelM33" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -trans</string>
+ </property>
+ <property name="text" >
+ <string>m<sub>33</sub></string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="7" >
+ <widget class="QLineEdit" name="lineEditM33" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_5" >
+ <property name="title" >
+ <string>Invariant point coordinates</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignHCenter</set>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelX2" >
+ <property name="text" >
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditX2" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelY2" >
+ <property name="text" >
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditY2" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelZ2" >
+ <property name="text" >
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditZ2" />
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QGroupBox" name="groupBoxFaces" >
+ <property name="title" >
+ <string>List of boundary faces for the selected periodicity (optional)</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="FacesSelectionView" native="1" name="widgetFacesPeriodic" >
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>200</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>FacesSelectionView</class>
+ <extends>QWidget</extends>
+ <header location="global" >FacesSelectionView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/SolutionDomainMeshFormatDialogForm.ui b/gui/Pages/SolutionDomainMeshFormatDialogForm.ui
new file mode 100644
index 0000000..6ed7cb1
--- /dev/null
+++ b/gui/Pages/SolutionDomainMeshFormatDialogForm.ui
@@ -0,0 +1,138 @@
+<ui version="4.0" >
+ <class>SolutionDomainMeshFormatDialogForm</class>
+ <widget class="QDialog" name="SolutionDomainMeshFormatDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>280</width>
+ <height>118</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>58</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Select the mesh file format</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QComboBox" name="comboBox" >
+ <property name="minimumSize" >
+ <size>
+ <width>220</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>220</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>58</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>260</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>SolutionDomainMeshFormatDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>SolutionDomainMeshFormatDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/SolutionDomainModel.py b/gui/Pages/SolutionDomainModel.py
new file mode 100644
index 0000000..774ed41
--- /dev/null
+++ b/gui/Pages/SolutionDomainModel.py
@@ -0,0 +1,2572 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the XML calls for ecs execution
+This module contains the following classes and function:
+- MeshModel
+- SolutionDomainModel
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+import os, sys, string, types
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+
+#-------------------------------------------------------------------------------
+# Class Mesh Model
+#-------------------------------------------------------------------------------
+
+class MeshModel:
+ """
+ This class manages meshes's extension file and formats
+ """
+ def __init__(self):
+ """
+ Constructor.
+
+ Initialize the dictionary file extension => format.
+ """
+ self.ext = {}
+ self.ext['case'] = "ensight"
+ self.ext['cgns'] = "cgns"
+ self.ext['des'] = "des"
+ self.ext['med'] = "med"
+ self.ext['msh'] = "gmsh"
+ self.ext['neu'] = "gambit"
+ self.ext['ccm'] = "ccm"
+ self.ext['ngeom'] = "ngeom"
+ self.ext['unv'] = "unv"
+ self.ext['mesh'] = "meta"
+
+
+ def getMeshExtension(self, mesh):
+ """
+ Public method.
+
+ @return: Extension of the mesh file if it exists.
+ @rtype: C{String}
+ """
+ # first check if the mesh is compressed with gzip
+ if mesh.endswith(".gz"):
+ mesh = mesh[:-3]
+
+ extension = ""
+ last_caracters = (string.split(mesh, ".")[-1:])[0]
+ if last_caracters in self.ext.keys():
+ extension = last_caracters
+ return extension
+
+
+ def getMeshFormat(self, mesh):
+ """
+ Public method.
+
+ @return: Format of the mesh, if the extension is given.
+ @rtype: C{String}
+ """
+ format = ""
+ extension = self.getMeshExtension(mesh)
+ if extension:
+ format = self.ext[extension]
+ return format
+
+
+ def getExtensionFileList(self):
+ """
+ Public method.
+
+ @return: List of all authorized extensions for mesh files.
+ @rtype: C{List}
+ """
+ return self.ext.keys()
+
+
+ def getBuildFormatList(self):
+ """
+ Public method.
+
+ @return: List of number, format and description for view of popup.
+ @rtype: C{List} of C{3-tuple}
+ """
+ list = [(0, 'ensight', 'EnSight (6 or Gold) ".case"' ),
+ (1, 'cgns', 'CGNS ".cgns"' ),
+ (2, 'des', 'Simail (NOPO) ".des"' ),
+ (3, 'med', 'MED ".med"' ),
+ (4, 'gmsh', 'Gmsh ".msh"' ),
+ (5, 'gambit', 'GAMBIT Neutral ".neu"' ),
+ (6, 'ccm', 'STAR-CCM+ ".ccm"' ),
+ (7, 'ngeom', 'pro-STAR/STAR4 ".ngeom"' ),
+ (8, 'ideas', 'I-deas universal ".unv"' ),
+ (9, 'meta', 'Meta-mesh file ".mesh"' )]
+
+ return list
+
+
+ def getMeshFormatDescription(self, format):
+ """
+ Public method.
+
+ @type format: C{String}
+ @param format: name of the I{format} (ensight, cgns,...)
+ @return: Description of I{format}.
+ @rtype: C{String}
+ """
+ label = ''
+ for line in self.getBuildFormatList():
+ if format == line[1]:
+ label = line[2]
+ return label
+
+
+ def getFileFormatList(self):
+ """
+ Public method.
+
+ @return: List of format and associated text for research file.
+ @rtype: C{List} of C{2-tuple}
+ """
+ list = [("All files", "*" ),
+ ("EnSight (6 or Gold) files", "*.case" ),
+ ("CGNS files", "*.cgns" ),
+ ("Simail (NOPO) files", "*.des" ),
+ ("MED files", "*.med" ),
+ ("GMSH files", "*.msh" ),
+ ("GAMBIT Neutral files", "*.neu" ),
+ ("STAR-CCM+", "*.ccm" ),
+ ("pro-STAR/STAR4 files", "*.ngeom"),
+ ("I-DEAS universal files", "*.unv" ),
+ ("Meta-mesh files", "*.mesh" ) ]
+
+ return list
+
+
+#-------------------------------------------------------------------------------
+# Class SolutionDomainModel
+#-------------------------------------------------------------------------------
+
+class SolutionDomainModel(MeshModel, Model):
+ """
+ This class allow to call function for fill saturne running file (lance)
+ """
+
+ def __init__(self, case):
+ """
+ Simple constructor.
+ """
+ self.case = case
+
+ self.node_ecs = self.case.xmlGetNode('solution_domain')
+ self.node_meshes = self.node_ecs.xmlInitNode('meshes_list')
+ self.node_join = self.node_ecs.xmlInitNode('join_meshes', "status")
+ self.node_cut = self.node_ecs.xmlInitNode('faces_cutting', "status")
+ self.node_orient = self.node_ecs.xmlInitNode('reorientation', "status")
+ self.node_syrthes = self.node_ecs.xmlInitNode('syrthes_coupling', "status")
+ self.node_perio = self.node_ecs.xmlInitNode('periodic_boundary')
+ self.node_standalone = self.node_ecs.xmlInitNode('standalone')
+## self.node_select = self.node_standalone.xmlInitNode('faces_select', "status")
+
+
+#************************* Private methods *****************************
+
+ def defaultValues(self):
+ """
+ Return a dictionary with default values
+ """
+ defvalue = {}
+ defvalue['join_status'] = "off"
+ defvalue['cutting_status'] = "off"
+ defvalue['reorientation'] = "off"
+ defvalue['select_status'] = "off"
+ defvalue['color'] = ""
+ defvalue['group'] = ""
+ defvalue['reverse'] = "off"
+ defvalue['fraction'] = 0.1
+ defvalue['plan'] = 0.8
+ defvalue['semiconf'] = "off"
+ defvalue['angle'] = 0.01
+ defvalue['syrth_status'] = "off"
+ defvalue['syrth_mesh_2d'] = "off"
+ defvalue['sim_status'] = "on"
+ defvalue['verif_mail'] = "on"
+ defvalue['postprocessing_format'] = "EnSight"
+ defvalue['postprocessing_options'] = "binary"
+ defvalue['dir_cas'] = "cas_defaut"
+ defvalue['poly_status'] = "off"
+ defvalue['perio_mode'] = "translation"
+ defvalue['transfo_val'] = 0.0
+
+ return defvalue
+
+
+ def _updateBatchScriptFile(self, keyword):
+ """
+ Update, for keyword, the backup file if it's ready to run.
+ """
+ self.isInList(keyword,('MESH',
+ 'COMMAND_REORIENT',
+ 'COMMAND_JOIN',
+ 'COMMAND_CWF',
+ 'COMMAND_PERIO',
+ 'COMMAND_SYRTHES',
+ 'CWF_OFF',
+ 'JOIN_OFF',
+ 'PERIO_OFF',
+ 'SYRTHES_OFF'))
+ key = self.case['computer']
+ if key:
+ if not self.case['batchScript'][key]: return
+
+ from BatchRunningModel import BatchRunningModel
+ batch = BatchRunningModel(self.case)
+ if keyword in ('CWF_OFF', 'JOIN_OFF', 'PERIO_OFF', 'SYRTHES_OFF'):
+ cmd = string.split(keyword,'_')[:1][0]
+ keyword = 'COMMAND_' + str(cmd)
+ batch.dicoValues[keyword] = ''
+ batch.initializeBatchScriptFile()
+ batch.updateBatchScriptFile(keyword)
+ del BatchRunningModel
+
+
+#To follow : private methods to get or put faces
+#================================================
+
+ def _getTagNode(self, tagName):
+ """
+ Private method: Return node corresponding at item "tag"
+ """
+ self.isInList(tagName, ('faces_join', 'faces_syrthes',
+ 'faces_select', 'faces_periodic'))
+ if tagName == 'faces_join':
+ node = self.node_join
+ elif tagName == 'faces_syrthes':
+ node = self.node_syrthes
+ elif tagName == 'faces_select':
+ node = self.node_standalone
+ elif tagName == 'faces_periodic':
+ node = self.node_perio
+ return node
+
+
+ def _updateJoinSelectionsNumbers(self):
+ """
+ Update names of join selection
+ """
+ listNode = self.node_join.xmlGetNodeList('faces_join')
+ i = 0
+ for node in listNode:
+ i = i + 1
+ if int(node['name']) > i:
+ node['name'] = str(i)
+
+
+ def getJoinSelectionsNumber(self):
+ """
+ Public method.
+
+ @return: number of join faces selections
+ @rtype: C{int}
+ """
+ return len(self.node_join.xmlGetNodeList('faces_join'))
+
+
+ def _addFacesSelect(self, node, select):
+ """
+ Private method: Add faces to node (join, periodic or syrthes) with dictionary select.
+ """
+ for sel, txt in [ (select['color'], 'faces_color'),
+ (select['group'], 'faces_group'),
+ (select['fraction'], 'faces_fraction'),
+ (select['plan'], 'faces_plan')]:
+ if sel:
+ node.xmlSetData(txt, sel)
+ else:
+ node.xmlRemoveChild(txt)
+
+ if select['reverse'] == 'on':
+ node_revers = node.xmlInitNode('faces_reverse', status='on')
+ else:
+ node.xmlRemoveChild('faces_reverse')
+
+ if select['semiconf'] == 'on':
+ node_semiconf = node.xmlInitNode('faces_semi_conf', status='on')
+ else:
+ node.xmlRemoveChild('faces_semi_conf')
+
+
+ def _getFaces(self, node):
+ """
+ Private method: Return values found for color, group .. for node "node"
+ """
+ default = {}
+ default['color'] =""
+ default['group'] = ""
+ default['fraction'] = ""
+ default['plan'] = ""
+ default['reverse'] = ""
+ default['semiconf'] = ""
+
+ if node:
+ default['color'] = node.xmlGetString('faces_color')
+ default['group'] = node.xmlGetString('faces_group')
+ default['fraction'] = node.xmlGetString('faces_fraction')
+ default['plan'] = node.xmlGetString('faces_plan')
+
+ n_revers = node.xmlGetNode('faces_reverse', 'status')
+
+ if n_revers:
+ default['reverse'] = n_revers['status']
+ else:
+ default['reverse'] = "off"
+
+ n_semi_conf = node.xmlGetNode('faces_semi_conf', 'status')
+
+ if n_semi_conf:
+ default['semiconf'] = n_semi_conf['status']
+ else:
+ default['semiconf'] = "off"
+ if default['color'] == '' and default['group'] == '' and default['fraction'] == ""\
+ and default['plan'] == "" and default['reverse'] == "off" \
+ and default['semiconf'] == "off":
+ default = {}
+
+ return default
+
+
+ def _removeChildren(self, node):
+ """
+ Private method: Remove all child nodes of node for one selection
+ """
+ for tag in ('faces_color',
+ 'faces_group',
+ 'faces_fraction',
+ 'faces_plan',
+ 'faces_reverse',
+ 'faces_semi_conf'):
+ node.xmlRemoveChild(tag)
+
+
+ def _getLineCommand(self, node):
+ """
+ Private method: Get color group faces and revers satus and fraction
+ and plan datas for ommand line to preprocessor execution
+ """
+ line = ""
+ coul = node.xmlGetString('faces_color')
+ grp = node.xmlGetString('faces_group')
+ n_revers = node.xmlGetNode('faces_reverse', 'status')
+ n_semi_conf = node.xmlGetNode('faces_semi_conf',' status')
+
+ if coul:
+ line += " --color " + coul
+ if grp:
+ line += " --group " + grp
+ if n_revers and n_revers['status'] == "on":
+ line += " --invsel"
+ if n_semi_conf and n_semi_conf['status'] == "on":
+ line += " --semi-conf"
+
+ return line
+
+
+#To follow : private methods for periodicity:
+#===========================================
+
+
+ def _setPeriodicNewMode(self, perio_name, new_mode):
+ """
+ Private method: Set node and mode of periodicity for transformation named 'perio_name'
+ """
+ #self.isInList(perio_name, ("0", "1", "2", "3"))
+ #self.isLowerOrEqual(int(perio_name), int(self.getPeriodicityNumber()))
+ self.isInList(perio_name, self.getPeriodicityListName())
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ node['mode'] = new_mode
+
+
+ def _setTranslationDefault(self, perio_name):
+ """
+ Private method: Put default values of translation for periodic translation
+ """
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ if node:
+ nList = node.xmlInitChildNodeList('translation')
+ for n in nList:
+ n.xmlSetData('translation_x', self.defaultValues()['transfo_val'])
+ n.xmlSetData('translation_y', self.defaultValues()['transfo_val'])
+ n.xmlSetData('translation_z', self.defaultValues()['transfo_val'])
+
+
+ def _setRotation1Default(self, perio_name):
+ """
+ Private method: Put default values of translation for periodic translation
+ """
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ nList = node.xmlInitChildNodeList('rotation1')
+ for n in nList:
+ n.xmlSetData('rotation_angle', self.defaultValues()['transfo_val'])
+ n.xmlSetData('rotation_x', self.defaultValues()['transfo_val'])
+ n.xmlSetData('rotation_y', self.defaultValues()['transfo_val'])
+ n.xmlSetData('rotation_z', self.defaultValues()['transfo_val'])
+ n.xmlSetData('rotation_center_x', self.defaultValues()['transfo_val'])
+ n.xmlSetData('rotation_center_y', self.defaultValues()['transfo_val'])
+ n.xmlSetData('rotation_center_z', self.defaultValues()['transfo_val'])
+
+
+ def _setRotation2Default(self, perio_name):
+ """
+ Private method: Put default values of translation for periodic translation
+ """
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ nList = node.xmlInitChildNodeList('rotation2')
+ for n in nList:
+ for txt in ('rotation_matrix_11', 'rotation_matrix_12', 'rotation_matrix_13',
+ 'rotation_matrix_21', 'rotation_matrix_22', 'rotation_matrix_23',
+ 'rotation_matrix_31', 'rotation_matrix_32', 'rotation_matrix_33',
+ 'rotation_center_y', 'rotation_center_z', ):
+ n.xmlSetData(txt, self.defaultValues()['transfo_val'])
+
+
+#************************* Methods callable by users*****************************
+
+# Methods to manage meshes :
+#=========================
+
+ def addMesh(self, mesh, format=None):
+ """
+ Public method. Add mesh name in xml file.
+ """
+ self.isNotInList(mesh, self.getMeshList())
+ if not format:
+ format = MeshModel().getMeshFormat(mesh)
+ else:
+ self.isInList(format, MeshModel().ext.values())
+
+ self.node_meshes.xmlInitNode('mesh', name=mesh, format=format)
+ self._updateBatchScriptFile('MESH')
+
+
+ def delMesh(self, mesh):
+ """
+ Public method. Delete node for mesh named "mesh" in xml file
+ """
+ self.isInList(mesh, self.getMeshList())
+ nodeList = self.node_meshes.xmlGetNodeList('mesh', 'name')
+ for node in nodeList:
+ if node['name'] == mesh:
+ node.xmlRemoveNode()
+ self._updateBatchScriptFile('MESH')
+
+
+ def getMeshList(self):
+ """
+ Public method. Return the meshes name list already put in the case.
+ """
+ meshList = []
+ nodeList = self.node_meshes.xmlGetNodeList('mesh', 'name')
+ for node in nodeList:
+ meshList.append(node['name'])
+ return meshList
+
+
+ def getMeshFormat(self, mesh):
+ """
+ Public method. Return the mesh name format recorded in the case.
+ """
+ self.isInList(mesh, self.getMeshList())
+ return self.node_meshes.xmlGetNode('mesh', name=mesh)['format']
+
+
+ def getMeshExtendedFormat(self, mesh):
+ """
+ Public method. Return the mesh extended format.
+ """
+ fmt = MeshModel().getMeshFormat(mesh)
+ for line in MeshModel().getBuildFormatList():
+ if fmt == line[1]:
+ label = line[2]
+ return label
+
+
+ def setMeshNumber(self, mesh, num):
+ """
+ Public method. Put the mesh number.
+ """
+ self.isInList(mesh, self.getMeshList())
+ self.isInt(num)
+ self.isGreater(num, 0)
+
+ self.node_meshes.xmlGetNode('mesh', name=mesh)['num'] = num
+ self._updateBatchScriptFile('MESH')
+
+
+ def getMeshNumber(self, mesh):
+ """
+ Public method. Return the mesh number recorded in the case.
+ """
+ self.isInList(mesh, self.getMeshList())
+ num = self.node_meshes.xmlGetNode('mesh', name=mesh)['num']
+ if num:
+ num = int(num)
+ return num
+
+
+ def setMeshGroupCells(self, mesh, grp_cel):
+ """
+ Public method. Put the grp-cel option.
+ """
+ self.isInList(mesh, self.getMeshList())
+ self.isInList(grp_cel, ('off', 'section', 'zone'))
+
+ if grp_cel == "off":
+ del self.node_meshes.xmlGetNode('mesh', name=mesh)['grp_cel']
+ else:
+ self.node_meshes.xmlGetNode('mesh', name=mesh)['grp_cel'] = grp_cel
+ self._updateBatchScriptFile('MESH')
+
+
+ def getMeshGroupCells(self, mesh):
+ """
+ Public method. Return the mesh 'grp-cel' sub-option recorded in the case.
+ """
+ return self.__getMeshGroup(mesh, 'grp_cel')
+
+
+ def setMeshGroupFaces(self, mesh, grp_fac):
+ """
+ Public method. Put the 'grp-fac' sub-option.
+ """
+ self.isInList(mesh, self.getMeshList())
+ self.isInList(grp_fac, ('off', 'section', 'zone'))
+
+ if grp_fac == "off":
+ del self.node_meshes.xmlGetNode('mesh', name=mesh)['grp_fac']
+ else:
+ self.node_meshes.xmlGetNode('mesh', name=mesh)['grp_fac'] = grp_fac
+ self._updateBatchScriptFile('MESH')
+
+
+ def getMeshGroupFaces(self, mesh):
+ """
+ Public method. Return the mesh 'grp_fac' option recorded in the case.
+ """
+ return self.__getMeshGroup(mesh, 'grp_fac')
+
+
+ def __getMeshGroup(self, mesh, group):
+ """
+ Private method. Return the mesh 'grp_fac' or 'grp_cel' sub-option recorded in the case.
+ """
+ self.isInList(mesh, self.getMeshList())
+ grp = self.node_meshes.xmlGetNode('mesh', name=mesh)[group]
+ if grp == None:
+ grp = 'off'
+ return grp
+
+# Methods to manage status of all main balises :
+#=============================================
+
+ def getJoinMeshesStatus(self):
+ """
+ Get status on balise "join_meshes" from xml file
+ """
+ status = self.node_join['status']
+ if not status:
+ status = self.defaultValues()['join_status']
+ self.setJoinMeshesStatus(status)
+ return status
+
+
+ def setJoinMeshesStatus(self, status):
+ """
+ Put status on balise "join_meshes" in xml file
+ """
+ self.isOnOff(status)
+ if self.node_join:
+ self.node_join['status'] = status
+ else:
+ self.node_join = self.node_ecs.xmlInitNode('join_meshes', status=status)
+ if status == 'off':
+ self._updateBatchScriptFile('JOIN_OFF')
+ else:
+ self._updateBatchScriptFile('COMMAND_JOIN')
+
+
+ def getCutStatus(self):
+ """
+ Get status on balise "faces_cutting" from xml file
+ """
+ status = self.node_cut['status']
+ if not status:
+ status = self.defaultValues()['cutting_status']
+ self.setCutStatus(status)
+ return status
+
+
+ def setCutStatus(self, status):
+ """
+ Put status on balise "faces_cutting" in xml file
+ """
+ self.isOnOff(status)
+ self.node_cut['status'] = status
+ if status == 'off':
+ self._updateBatchScriptFile('CWF_OFF')
+ else:
+ self._updateBatchScriptFile('COMMAND_CWF')
+
+
+ def setCutAngle(self, var):
+ """
+ input '--cwf' parameter.
+ """
+ self.isGreaterOrEqual(var, 0.0)
+ if var != self.defaultValues()['angle']:
+ self.node_cut.xmlSetData('warp_angle_max', var)
+ else:
+ self.node_cut.xmlRemoveChild('warp_angle_max')
+ self._updateBatchScriptFile('COMMAND_CWF')
+
+
+ def getCutAngle(self):
+ """
+ get '--cwf' parameters.
+ """
+ angle = self.node_cut.xmlGetDouble('warp_angle_max')
+ if angle == None:
+ angle = self.defaultValues()['angle']
+ return angle
+
+
+ def getOrientation(self):
+ """
+ Get status on balise "reorientation" from xml file
+ """
+ status = self.node_orient['status']
+ if not status:
+ status = self.defaultValues()['reorientation']
+ self.setOrientation(status)
+ return status
+
+
+ def setOrientation(self, status):
+ """
+ Put status on balise "reorientation" in xml file
+ """
+ self.isOnOff(status)
+ self.node_orient['status'] = status
+ self._updateBatchScriptFile('COMMAND_REORIENT')
+
+
+ def getSyrthesCouplingStatus(self):
+ """
+ Get status on balise "syrthes_coupling" in xml file
+ """
+ status = self.node_syrthes['status']
+ if not status:
+ status = self.defaultValues()['syrth_status']
+ self.setSyrthesCouplingStatus(status)
+ return status
+
+
+ def setSyrthesCouplingStatus(self, status):
+ """
+ Put status on balise "syrthes_coupling" in xml file
+ """
+ self.isOnOff(status)
+ self.node_syrthes['status'] = status
+ if status == 'off':
+ self._updateBatchScriptFile('SYRTHES_OFF')
+ else:
+ self._updateBatchScriptFile('COMMAND_SYRTHES')
+
+
+ def getSyrthes2dMeshStatus(self):
+ """
+ Return status of balise "'syrthes_mesh_2d'" from xml file
+ """
+ node = self.node_syrthes.xmlInitNode('syrthes_mesh_2d', 'status')
+ status = node['status']
+ if not status :
+ status = self.defaultValues()['syrth_mesh_2d']
+ self.setSyrthes2dMeshStatus(status)
+ return status
+
+
+ def setSyrthes2dMeshStatus(self, status):
+ """
+ Put status of balise 'syrthes_mesh_2d' into xml file
+ """
+ self.isOnOff(status)
+ node = self.node_syrthes.xmlInitNode('syrthes_mesh_2d', 'status')
+ if status != self.defaultValues()['syrth_mesh_2d']:
+ node['status'] = status
+ else:
+ if node:
+ node.xmlRemoveNode()
+ self._updateBatchScriptFile('COMMAND_SYRTHES')
+
+
+ def getSimCommStatus(self):
+ """
+ Get status of balise ''similation_communication' into xml file
+ """
+ node = self.node_standalone.xmlInitNode('simulation_communication', 'status')
+ status = node['status']
+ if not status:
+ status = self.defaultValues()['sim_status']
+ self.setSimCommStatus(status)
+ return status
+
+
+ def setSimCommStatus(self, status):
+ """
+ Put status of balise ''similation_communication' into xml file
+ """
+ self.isOnOff(status)
+ node = self.node_standalone.xmlInitNode('simulation_communication', 'status')
+ node['status'] = status
+
+
+ def getPostProFormat(self):
+ """
+ Return choice of format for post processing output file
+ """
+ node = self.node_standalone.xmlInitNode('postprocessing_format', 'choice')
+ choice = node['choice']
+ if not choice:
+ choice = self.defaultValues()['postprocessing_format']
+ self.setPostProFormat(choice)
+ return choice
+
+
+ def setPostProFormat(self, choice):
+ """
+ Set choice of format for post processing output file
+ """
+ self.isInList(choice, ('EnSight', 'MED_fichier', 'CGNS'))
+ node = self.node_standalone.xmlInitNode('postprocessing_format', 'choice')
+ node['choice'] = choice
+
+
+ def getPostProOptionsFormat(self):
+ """
+ Return options for post processing output file
+ """
+ node = self.node_standalone.xmlInitNode('postprocessing_options', 'choice')
+ line = node['choice']
+ if not line:
+ line = self.defaultValues()['postprocessing_options']
+ self.setPostProOptionsFormat(line)
+ return line
+
+
+ def setPostProOptionsFormat(self, line):
+ """
+ Set options for post processing output file
+ """
+ list = string.split(line)
+ self.isList(list)
+ n = self.node_standalone.xmlInitNode('postprocessing_options', 'choice')
+ n['choice'] = line
+
+
+# Methods to manage periodicity :
+#==============================
+
+ def getPeriodicityListName(self):
+ """
+ Public method.
+
+ @return: list of name of defined periodic transformation
+ @rype: C{list}
+ """
+ l = []
+ for node in self.node_perio.xmlGetNodeList('transformation'):
+ l.append(node['name'])
+ return l
+
+
+ def getPeriodicityNumber(self):
+ """
+ Public method.
+
+ @return: number of "periodic_boundary" markup in xml file
+ @rtype: C{int}
+ """
+ return len(self.node_perio.xmlGetNodeList('transformation'))
+
+
+ def getPeriodicityMode(self, perio_name):
+ """
+ Public method.
+
+ @type perio_name: C{str}
+ @param perio_name: name of the periodic boundary
+ @return: mode of transformation of periodic boundary I{perio_name}
+ @rtype: C{str}
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+
+ node = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ mode = node['mode']
+ if not mode:
+ mode = self.defaultValues()['perio_mode']
+ self.addPeriodicity(perio_name)
+ return mode
+
+
+ def addPeriodicity(self, perio_name):
+ """
+ Public method.
+
+ Add a new transformation in periodic boundary.
+
+ @type perio_name: C{str}
+ @param perio_name: name of the periodic boundary
+ """
+ self.isNotInList(perio_name, self.getPeriodicityListName())
+
+ m = self.defaultValues()['perio_mode']
+ self.node_perio.xmlInitNode('transformation', mode="", name=perio_name)
+ self.updatePeriodicityMode(perio_name, m)
+
+
+ def updatePeriodicityMode(self, perio_name, mode):
+ """
+ Public method.
+
+ Update transformation mode from a periodic boundary
+
+ @type perio_name: C{str}
+ @param perio_name: name of the periodic boundary
+ @type mode: C{str}
+ @param mode: mode of the periodic boundary (i.e.: 'translation', 'rotation1', 'rotation2', 'tr+rota1', 'tr+rota2')
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ self.isInList(mode, ('translation', 'rotation1', 'rotation2', 'tr+rota1', 'tr+rota2'))
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ if node['mode'] != mode:
+ node['mode'] = mode
+
+ if mode in ('translation', 'rotation1', 'rotation2'):
+ if not node.xmlGetChildNode(mode):
+ if mode =="translation":
+ self._setTranslationDefault(perio_name)
+ elif mode =="rotation1":
+ self._setRotation1Default(perio_name)
+ elif mode =="rotation2":
+ self._setRotation2Default(perio_name)
+ else:
+ if mode =="tr+rota1":
+ if not node.xmlGetChildNode('translation'):
+ self._setTranslationDefault(perio_name)
+ if not node.xmlGetChildNode('rotation1'):
+ self._setRotation1Default(perio_name)
+ elif mode =="tr+rota2":
+ if not node.xmlGetChildNodeList('translation'):
+ self._setTranslationDefault(perio_name)
+ if not node.xmlGetChildNodeList('rotation2'):
+ self._setRotation2Default(perio_name)
+
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def deletePeriodicity(self, perio_name):
+ """
+ Public method.
+
+ Delete a transformation in periodic boundary.
+
+ @type perio_name: C{str}
+ @param perio_name: name of the periodic boundary
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ self.node_perio.xmlGetNode('transformation', name=perio_name).xmlRemoveNode()
+
+ if len(self.node_perio.xmlGetNodeList('transformation')) == 0:
+ self._updateBatchScriptFile('PERIO_OFF')
+ else:
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def changePeriodicityName(self, perio_name, new_name):
+ """
+ Public method.
+
+ Change the label name of a periodic boundary
+
+ @type perio_name: C{str}
+ @param perio_name: old name of the periodic boundary
+ @type new_name: C{str}
+ @param new_name: new name of the periodic boundary
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ node['name'] = new_name
+
+
+ def getTranslationDirection(self, perio_name):
+ """
+ Public method.
+
+ Get values of translation for periodic translation
+
+ @type perio_name: C{str}
+ @param perio_name: name of the periodic boundary
+ @return: values of translation for periodic translation
+ @rtype: 3 C{float}
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ n = node.xmlGetChildNode('translation')
+ dx = n.xmlGetString('translation_x')
+ dy = n.xmlGetString('translation_y')
+ dz = n.xmlGetString('translation_z')
+
+ return dx, dy, dz
+
+
+ def setTranslationDirection(self, perio_name, dir, valcoor):
+ """
+ Put values of translation for periodic translation
+ """
+ self.isFloat(valcoor)
+ self.isInList(perio_name, self.getPeriodicityListName())
+ self.isInList(dir, ("translation_x", "translation_y", "translation_z"))
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ for n in node.xmlGetChildNodeList('translation'):
+ n.xmlSetData(dir, valcoor)
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def getRotationDirection(self, perio_name):
+ """
+ Get values for director vector rotation for periodic translation
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ n = node.xmlGetChildNode('rotation1')
+ rx = n.xmlGetString('rotation_x')
+ ry = n.xmlGetString('rotation_y')
+ rz = n.xmlGetString('rotation_z')
+
+ return rx, ry, rz
+
+
+ def setRotationVector(self, perio_name, dir, valcoor):
+ """
+ Put values for director vector rotation for periodic translation
+ """
+ self.isFloat(valcoor)
+ self.isInList(perio_name, self.getPeriodicityListName())
+ self.isInList(dir, ("rotation_x", "rotation_y", "rotation_z"))
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ n = node.xmlGetChildNode('rotation1')
+ n.xmlSetData(dir,valcoor)
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def getRotationAngle(self, perio_name):
+ """
+ Get angle for rotation for periodic rotation
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ n = node.xmlGetChildNode('rotation1')
+ angle = n.xmlGetString('rotation_angle')
+
+ return angle
+
+
+ def setRotationAngle(self, perio_name, angle):
+ """
+ Put angle for rotation for periodic rotation
+ """
+ self.isGreaterOrEqual(angle, 0.0)
+ self.isInList(perio_name, self.getPeriodicityListName())
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ n = node.xmlGetChildNode('rotation1')
+ n.xmlSetData('rotation_angle', angle)
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def getRotationCenter(self, perio_name):
+ """
+ Get coordinates of center of rotation for periodic transformation
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ mode = self.getPeriodicityMode(perio_name)
+ self.isInList(mode, ('rotation1', 'rotation2', 'tr+rota1', 'tr+rota2'))
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+
+ if mode == "rotation1" or mode == "tr+rota1":
+ n = node.xmlGetChildNode('rotation1')
+ elif mode == "rotation2" or mode == "tr+rota2":
+ n = node.xmlGetChildNode('rotation2')
+ px = n.xmlGetString('rotation_center_x')
+ py = n.xmlGetString('rotation_center_y')
+ pz = n.xmlGetString('rotation_center_z')
+
+ return px, py, pz
+
+
+ def setRotationCenter(self, perio_name, pos, val):
+ """
+ Put coordinates of center of rotation for periodic transformation
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ self.isFloat(val)
+ self.isInList(pos, ("rotation_center_x", "rotation_center_y", "rotation_center_z"))
+ mode = self.getPeriodicityMode(perio_name)
+ self.isInList(mode, ('rotation1', 'rotation2', 'tr+rota1', 'tr+rota2'))
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+
+ if mode == "rotation1" or mode == "tr+rota1":
+ n = node.xmlGetChildNode('rotation1')
+ elif mode == "rotation2" or mode == "tr+rota2":
+ n = node.xmlGetChildNode('rotation2')
+ n.xmlSetData(pos, val)
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def getRotationMatrix(self, perio_name):
+ """
+ Get values of matrix of rotation for periodic transformation
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ mode = self.getPeriodicityMode(perio_name)
+ self.isInList(mode, ('rotation2', 'tr+rota2'))
+
+ node = self.node_perio.xmlGetNode('transformation', name=perio_name)
+ n = node.xmlGetChildNode('rotation2')
+ m11 = n.xmlGetString('rotation_matrix_11')
+ m12 = n.xmlGetString('rotation_matrix_12')
+ m13 = n.xmlGetString('rotation_matrix_13')
+ m21 = n.xmlGetString('rotation_matrix_21')
+ m22 = n.xmlGetString('rotation_matrix_22')
+ m23 = n.xmlGetString('rotation_matrix_23')
+ m31 = n.xmlGetString('rotation_matrix_31')
+ m32 = n.xmlGetString('rotation_matrix_32')
+ m33 = n.xmlGetString('rotation_matrix_33')
+
+ return m11, m12, m13, m21, m22, m23, m31, m32, m33
+
+
+ def setRotationMatrix(self, perio_name, pos, val):
+ """
+ Put values of matrix of rotation for periodic transformation
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ self.isFloat(val)
+ self.isInList(pos, ('rotation_matrix_11','rotation_matrix_12','rotation_matrix_13',
+ 'rotation_matrix_21','rotation_matrix_22','rotation_matrix_23',
+ 'rotation_matrix_31','rotation_matrix_32','rotation_matrix_33'))
+ mode = self.getPeriodicityMode(perio_name)
+ self.isInList(mode, ('rotation2', 'tr+rota2'))
+
+ node = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ n = node.xmlGetChildNode('rotation2')
+ n.xmlSetData(pos, val)
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+# Methods to manage faces :
+#========================
+
+ def addJoinFaces(self, select):
+ """
+ Add faces selection for join meshes.
+ Select is a dictionary with 'color', 'group', 'fraction', 'plan'
+ """
+ nb = self.getJoinSelectionsNumber()
+ name = str(nb +1)
+ node = self.node_join.xmlAddChild('faces_join', status="on", name=name)
+ self._addFacesSelect(node, select)
+ self._updateBatchScriptFile('COMMAND_JOIN')
+
+
+ def getJoinFaces(self, number):
+ """
+ Return faces selection named 'number' for join meshes .
+ """
+ self.isLowerOrEqual(int(number), int(self.getJoinSelectionsNumber()))
+
+ node = self.node_join.xmlGetNode('faces_join', status="on", name=number)
+ return self._getFaces(node)
+
+
+ def replaceJoinFaces(self, number, select):
+ """
+ Replace values of faces selection named 'number' for join meshes, by select
+ """
+ self.isLowerOrEqual(int(number), int(self.getJoinSelectionsNumber()))
+
+ node = self.node_join.xmlGetNode('faces_join', status="on", name=number)
+ self._removeChildren(node)
+ self._addFacesSelect(node, select)
+ self._updateBatchScriptFile('COMMAND_JOIN')
+
+
+ def deleteJoinFaces(self, number):
+ """
+ Delete faces selection named 'number' for join meshes
+ """
+ self.isLowerOrEqual(int(number), int(self.getJoinSelectionsNumber()))
+
+ node = self.node_join.xmlGetNode('faces_join', status="on", name=number)
+ node.xmlRemoveNode()
+ if int(number) <= int(self.getJoinSelectionsNumber()):
+ self._updateJoinSelectionsNumbers()
+ self._updateBatchScriptFile('COMMAND_JOIN')
+
+
+ def setJoinStatus(self, number, status):
+ """
+ Set status of faces selection named 'number' for join meshes
+ """
+ self.isOnOff(status)
+ self.isLowerOrEqual(int(number), int(self.getJoinSelectionsNumber()))
+
+ node = self.node_join.xmlGetNode('faces_join', 'status', name=number)
+ node['status'] = status
+
+
+ def getJoinStatus(self, number):
+ """
+ Get status of faces selection named 'number' for join meshes
+ """
+ self.isLowerOrEqual(int(number), int(self.getJoinSelectionsNumber()))
+
+ return self.node_join.xmlGetNode('faces_join', 'status', name=number)['status']
+
+
+ def addPeriodicFaces(self, perio_name, select):
+ """
+ Add faces selection for periodic transformation.
+ Select is a dictionary with 'color', 'group', 'fraction', 'plan' ...
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ node_tr = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ if node_tr:
+ node = node_tr.xmlAddChild('faces_periodic', status="on")
+ self._addFacesSelect(node, select)
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def getPeriodicFaces(self, perio_name):
+ """
+ Public method.
+
+ @return: faces selection for periodic transformation named perio_name
+ @rtype: C{dictionary}
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ result = {}
+ node_tr = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ if node_tr:
+ node = node_tr.xmlGetChildNode('faces_periodic', 'status')
+ if node and node['status'] == 'on':
+ result = self._getFaces(node)
+
+ return result
+
+
+ def replacePeriodicFaces(self, perio_name, select):
+ """
+ Replace values of faces selection for periodic transformation, by select
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ node_tr = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ if node_tr:
+ node = node_tr.xmlGetChildNode('faces_periodic', status="on")
+ self._removeChildren(node)
+ self._addFacesSelect(node, select)
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def deletePeriodicFaces(self, perio_name):
+ """
+ Delete faces selection for periodic transformation named 'perio_name'
+ """
+ self.isInList(perio_name, self.getPeriodicityListName())
+ node_tr = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ if node_tr:
+ node = node_tr.xmlGetChildNode('faces_periodic', status="on")
+ node.xmlRemoveNode()
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def setPeriodicStatus(self, perio_name, status):
+ """
+ Set status of faces for periodic transformation named 'perio_name'
+ """
+ self.isOnOff(status)
+ node_tr = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ if node_tr:
+ node = node_tr.xmlGetChildNode('faces_periodic', 'status')
+ if node:
+ node['status'] = status
+ if status == 'on':
+ self._updateBatchScriptFile('COMMAND_PERIO')
+
+
+ def getPeriodicStatus(self, perio_name):
+ """
+ Get status of faces for periodic transformation named 'perio_name'
+ """
+ node_tr = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ if node_tr:
+ node = node_tr.xmlGetChildNode('faces_periodic', 'status')
+ if node:
+ status = node['status']
+ return status
+ else:
+ raise ValueError, "wrong periodicity"
+
+
+ def addSyrthesFaces(self, select):
+ """
+ Add faces selection for syrthes coupling.
+ Select is a dictionary with 'color', 'group', 'fraction', 'plan' ...
+ """
+ node = self.node_syrthes.xmlAddChild('faces_syrthes', status="on")
+ select['fraction'] =""
+ select['plan'] = ""
+ self._addFacesSelect(node, select)
+ self._updateBatchScriptFile('COMMAND_SYRTHES')
+
+
+ def getSyrthesFaces(self):
+ """
+ Return faces selection for syrthes coupling (only one authorized selection)
+ """
+ result = {}
+ node = self.node_syrthes.xmlGetChildNode('faces_syrthes', status="on")
+ if node:
+ result = self._getFaces(node)
+
+ return result
+
+
+ def replaceSyrthesFaces(self, select):
+ """
+ Replace values of faces selection for syrthes coupling (only one authorized selection)
+ by select
+ """
+ node = self.node_syrthes.xmlGetChildNode('faces_syrthes', status="on")
+ self._removeChildren(node)
+ self._addFacesSelect(node, select)
+ self._updateBatchScriptFile('COMMAND_SYRTHES')
+
+
+ def deleteSyrthesFaces(self):
+ """
+ Delete faces selection for syrthes coupling (only one authorized selection)
+ """
+ node = self.node_syrthes.xmlGetChildNode('faces_syrthes', status="on")
+ node.xmlRemoveNode()
+ self._updateBatchScriptFile('COMMAND_SYRTHES')
+
+
+ def setSyrthesStatus(self, status):
+ """
+ Set status of faces selection for syrthes coupling (only one authorized selection)
+ """
+ self.isOnOff(status)
+ node = self.node_syrthes.xmlGetChildNode('faces_syrthes', 'status')
+ if node:
+ node['status'] = status
+
+
+ def getSyrthesStatus(self):
+ """
+ Get status of faces selection for syrthes coupling (only one authorized selection)
+ """
+ node = self.node_syrthes.xmlGetChildNode('faces_syrthes', 'status')
+ if node:
+ status = node['status']
+ return status
+
+
+ def addSelectFaces(self, select):
+ """
+ Add faces selection for standalone selection.
+ Select is a dictionary with 'color', 'group', 'fraction', 'plan' ...
+ """
+ node = self.node_standalone.xmlGetChildNode('faces_select', 'status')
+ if node:
+ node['status'] = "on"
+ else:
+ node = self.node_standalone.xmlAddChild('faces_select', status="on")
+ select['fraction'] =""
+ select['plan'] = ""
+ select['semiconf'] = ""
+ self._addFacesSelect(node, select)
+
+
+ def getSelectFaces(self):
+ """
+ Return faces selection for standalone selection (only one authorized selection)
+ """
+ result = {}
+ node = self.node_standalone.xmlGetChildNode('faces_select', status="on")
+ if node:
+ result = self._getFaces(node)
+
+ return result
+
+
+ def replaceSelectFaces(self, select):
+ """
+ Replace values of faces selection for standalone selection (only one authorized selection)
+ by select
+ """
+ node = self.node_standalone.xmlGetChildNode('faces_select', status="on")
+ self._removeChildren(node)
+ select['fraction'] =""
+ select['plan'] = ""
+ select['semiconf'] = ""
+ self._addFacesSelect(node, select)
+
+
+ def deleteSelectFaces(self):
+ """
+ Delete faces selection for standalone selection (only one authorized selection)
+ """
+ node = self.node_standalone.xmlGetChildNode('faces_select', 'status')
+ node.xmlRemoveNode()
+
+
+ def setSelectStatus(self, status):
+ """
+ Set status of faces selection for standalone selection (only one authorized selection)
+ """
+ self.isOnOff(status)
+ node = self.node_standalone.xmlInitNode('faces_select', 'status')
+ if status == "off":
+ self.deleteSelectFaces()
+ else:
+ node['status'] = status
+
+
+ def getSelectStatus(self):
+ """
+ Get status of faces selection for standalone selection (only one authorized selection)
+ """
+ node = self.node_standalone.xmlInitChildNode('faces_select', 'status')
+ status = node['status']
+ if not status:
+ status = self.defaultValues()['select_status']
+ self.deleteSelectFaces()
+
+ return status
+
+
+# In following methods we build command for "lance" file
+#=======================================================
+
+ def getMeshCommand(self):
+ """
+ Get mesh command line for preprocessor execution
+ """
+ lines = ''
+ nodeList = self.node_meshes.xmlGetNodeList('mesh', 'name')
+ mesh_mdl = MeshModel()
+ for meshNode in nodeList:
+ name = meshNode['name']
+ format = meshNode['format']
+ #f = string.split(string.split(name,".")[1]," ")[0]
+ #if f not in .getExtensionFileList():
+ # name=string.split(name," ")[0]
+ mesh = self.case['mesh_path'] + '/' + name
+ lines += " -m " + mesh
+
+ if meshNode['num']:
+ lines += " --num " + meshNode['num']
+ if meshNode['grp_fac']:
+ lines += " --grp-fac " + meshNode['grp_fac']
+ if meshNode['grp_cel']:
+ lines += " --grp-cel " + meshNode['grp_cel']
+
+ lines += " "
+ return lines
+
+
+ def getReorientCommand(self):
+ """
+ Get reorient command line for preprocessor execution
+ """
+ line = ''
+ if self.node_orient and self.node_orient['status'] == 'on':
+ line += ' --reorient '
+
+ return line
+
+
+ def getJoinCommand(self):
+ """
+ Get rc command line for preprocessor execution
+ """
+ lines = ''
+ if self.node_join and self.node_join['status'] == 'on':
+ node_face_join_list = self.node_join.xmlGetNodeList('faces_join')
+ if node_face_join_list:
+ for node_face_join in node_face_join_list:
+ if node_face_join['status'] == 'on':
+ linecoul = ' -j '
+ line = self._getLineCommand(node_face_join)
+ lines = lines + linecoul + line
+
+ fraction = node_face_join.xmlGetString('faces_fraction')
+ lines = lines + " --fraction " + fraction +" "
+ plan = node_face_join.xmlGetString('faces_plan')
+ lines = lines + " --plane " + plan +" "
+ lines = lines + ' '
+ else:
+ lines = ' -j '
+
+ return lines
+
+
+ def getCutCommand(self):
+ """
+ Get cwf command line for preprocessor execution
+ """
+ line = ''
+ if self.node_cut and self.node_cut['status'] == 'on':
+ line += ' --cwf ' + str(self.getCutAngle())
+
+ return line
+
+
+ def getPerioCommand(self):
+ """
+ Get perio command line for preprocessor execution
+ """
+ line = ''
+ for perio_name in self.getPeriodicityListName():
+ node = self.node_perio.xmlGetNode('transformation', 'mode', name=perio_name)
+ mode = self.getPeriodicityMode(perio_name)
+ node_face_perio = node.xmlGetNode('faces_periodic', 'status')
+ if node_face_perio:
+ node_face_perio_list = node.xmlGetNodeList('faces_periodic', 'status')
+ if node_face_perio_list:
+ for node in node_face_perio_list:
+ if node['status'] == 'on':
+ lineperio = ' --perio '
+ l = self._getLineCommand(node)
+ line = line + lineperio + l
+ fraction = node.xmlGetString('faces_fraction')
+ if fraction:
+ line = line + " --fraction " + fraction +" "
+ plan = node.xmlGetString('faces_plan')
+ if plan:
+ line = line + " --plane " + plan +" "
+ else:
+ line = line + ' --perio '
+ mode = self.getPeriodicityMode(perio_name)
+ if mode == 'translation' or mode == 'tr+rota1' or mode == 'tr+rota2':
+ dx, dy, dz = self.getTranslationDirection(perio_name)
+ line = line + " --trans " + dx +" " + dy +" " + dz +" "
+ if mode == 'rotation1' or mode == 'tr+rota1':
+ angle = self.getRotationAngle(perio_name)
+ rx, ry, rz = self.getRotationDirection(perio_name)
+ px, py, pz = self.getRotationCenter(perio_name)
+ line = line + " --rota " + " --angle " + angle + " --dir " + rx +" " + ry +" " + rz +" " + " --invpt " + px +" " + py +" " + pz +" "
+ if mode == 'rotation2' or mode == 'tr+rota2':
+ m11, m12, m13, m21, m22, m23, m31, m32, m33 = self.getRotationMatrix(perio_name)
+ px, py, pz = self.getRotationCenter(perio_name)
+ line = line + " --rota " + " --matrix " + m11 +" " + m12 +" " + m13 +" " + m21 +" " + m22 +" " + m23 +" " + m31 +" " + m32 +" " + m33 +" " + " --invpt " + px +" " + py +" " + pz +" "
+
+ return line
+
+
+ def getSyrthesCommand(self):
+ """
+ Get syrthes command line for preprocessor execution
+ """
+ lines = ''
+ if self.node_syrthes and self.node_syrthes['status'] == 'on':
+ linesyr = ' --syrthes '
+ node_list = self.node_syrthes.xmlGetNodeList('faces_syrthes')
+ for node in node_list:
+ if node['status'] == 'on':
+ line = self._getLineCommand(node)
+ linesyr = linesyr + line
+ node_syrth_2d = self.node_syrthes.xmlGetNode('syrthes_mesh_2d', 'status')
+ if node_syrth_2d and node_syrth_2d['status'] == 'on':
+ linesyr += " --2d "
+ lines += linesyr
+
+ return lines
+
+
+ def getSimCommCommand(self):
+ """
+ Get " --sim-comm " command line for preprocessor execution
+ """
+ lines = ''
+ node = self.node_standalone.xmlGetNode('simulation_communication')
+ if node and node['status'] == 'on':
+ lines = " -sc "
+ return lines
+
+
+ def getSelectCommand(self):
+ """
+ Get "--int-face" command line for preprocessor execution
+ """
+ lines = ''
+ node_list = self.node_standalone.xmlGetNodeList('faces_select')
+ for nod in node_list:
+ if nod['status'] == 'on':
+ line = ' --int-face ' + self._getLineCommand(nod)
+ lines += line
+ return lines
+
+
+ def getPostCommand(self):
+ """
+ Get "--ensight" "--med" and/or "--cgns" command line for preprocessor execution
+ """
+ line = ''
+ iok = 0
+ if self.getPostProFormat() == "EnSight":
+ line = ' --ensight '
+ if self.getPostProFormat() == "MED_fichier":
+ line = ' --med '
+ if self.getPostProFormat() == "CGNS":
+ line = ' --cgns '
+
+ options = self.getPostProOptionsFormat()
+ options = string.split(options, ',')
+
+ for opt in options:
+ if opt in ('binary', 'discard_polygons', 'discard_polyhedra'):
+ line = line
+ if opt in ('divide_polygons', 'divide_polyhedra'):
+ opt = line + ' --divide-poly '
+ if opt == "big_endian":
+ line = line + ' --big_endian '
+
+ return line
+
+
+# These following methods are kept only for tkInter View
+#=======================================================
+
+ def getListNodes(self, tagName):
+ """
+ Return node corresponding at the selection (only for view)
+ """
+ node = self._getTagNode(tagName)
+ listNode = node.xmlGetNodeList(tagName)
+
+ return listNode
+
+
+ def getStatusNode(self, node):
+ """
+ Return status for node "node"
+ """
+ if node : status = node['status']
+ return status
+
+
+ def getFacesSelect(self, tagName, n):
+ """
+ Return default filled with values found for color, group ..
+ """
+ nodeList = self.getListNodes(tagName)
+ node = nodeList[n]
+ return self._getFaces(node)
+
+
+#-------------------------------------------------------------------------------
+# SolutionDomain Model test case
+#-------------------------------------------------------------------------------
+
+class SolutionDomainTestCase(ModelTest):
+ """
+ """
+ def checkSolutionDomainInstantiation(self):
+ """ Check whether the SolutionDomainModel class could be instantiated """
+ model = None
+ model = SolutionDomainModel(self.case)
+ assert model != None, 'Could not instantiate SolutionDomainModel'
+
+ def checkAddDelMeshandGetMeshList(self):
+ """ Check whether the meshes could be added and deleted and list of meshes could be get """
+ mdl = SolutionDomainModel(self.case)
+ mdl.addMesh('fdc','des')
+ mdl.addMesh('pic','des')
+ mdl.addMesh('down','des')
+ mdl.addMesh('up','des')
+ doc = '<meshes_list>'\
+ '<mesh format="des" name="fdc"/>'\
+ '<mesh format="des" name="pic"/>'\
+ '<mesh format="des" name="down"/>'\
+ '<mesh format="des" name="up"/>'\
+ '</meshes_list>'
+ assert mdl.node_meshes == self.xmlNodeFromString(doc), \
+ 'Could not add meshes in SolutionDomainModel'
+ mdl.delMesh('down')
+ assert mdl.getMeshList() == ['fdc','pic','up'],\
+ 'Could not get mesh list'
+
+
+ def checkSetandGetJoinMeshesStatus(self):
+ """ Check whether the status of join meshes could be set and get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.setJoinMeshesStatus('on')
+ doc = '''<join_meshes status="on"/>'''
+ assert mdl.node_join == self.xmlNodeFromString(doc), \
+ 'Could not set status in join meshes balise'
+ assert mdl.getJoinMeshesStatus() == 'on', \
+ 'Could not get status from join meshes balise'
+
+ def checkSetandGetCutStatusAndAngleValue(self):
+ """ Check whether the status of node cut and value of angle could be set and get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.setCutStatus('on')
+ doc1 = '''<faces_cutting status="on"/>'''
+
+ assert mdl.node_cut == self.xmlNodeFromString(doc1), \
+ 'Could not set status of faces_cutting'
+ assert mdl.getCutStatus() == 'on',\
+ 'Could not get status of faces_cutting'
+
+ mdl.setCutAngle(90.)
+ doc2 = '''<faces_cutting status="on">
+ <warp_angle_max>90</warp_angle_max>
+ </faces_cutting>'''
+
+ assert mdl.node_cut == self.xmlNodeFromString(doc2), \
+ 'Could not set angle for faces_cutting'
+ assert mdl.getCutAngle() == 90, \
+ 'Could not get angle for faces_cutting'
+
+ def checkSetandGetSyrthesCouplingStatusAndMesh2d(self):
+ """ Check whether the status of node syrthes_coupling and mesh 2D could be set and get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.setSyrthesCouplingStatus('on')
+ doc1 = '''<syrthes_coupling status="on"/>'''
+ assert mdl.node_syrthes == self.xmlNodeFromString(doc1), \
+ 'Could not set status for syrthes_coupling balise'
+ assert mdl.getSyrthesCouplingStatus() == 'on',\
+ 'Could not get status for syrthes_coupling balise'
+
+ mdl.setSyrthes2dMeshStatus('on')
+ doc2 = '''<syrthes_coupling status="on">
+ <syrthes_mesh_2d status="on"/>
+ </syrthes_coupling>'''
+ assert mdl.node_syrthes == self.xmlNodeFromString(doc2), \
+ 'Could not set status on syrthes_2dMesh balise'
+ assert mdl.getSyrthes2dMeshStatus() == 'on',\
+ 'Could not get status of syrthes_mesh_2d balise'
+
+ mdl.setSyrthes2dMeshStatus('off')
+ doc3 = '''<syrthes_coupling status="on"/>'''
+ assert mdl.node_syrthes == self.xmlNodeFromString(doc3), \
+ 'Could not set status OFF on syrthes_2dMesh balise'
+
+ def checkSetandGetSimCommStatus(self):
+ """ Check whether the status of node simulation_communication could be set and get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.setSimCommStatus('on')
+ doc = '''<standalone>
+ <simulation_communication status="on"/>
+ </standalone>'''
+
+ assert mdl.node_standalone == self.xmlNodeFromString(doc), \
+ 'Could not set status of node simulation_communication'
+ assert mdl.getSimCommStatus() == 'on', \
+ 'Could not get status of node simulation_communication'
+
+ def checkGetPeriodicityNumber(self):
+ """ Check whether the number of periodicities could be get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.addPeriodicity('2')
+ doc ='''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>0</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ </transformation>
+ <transformation mode="translation" name="2">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>0</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ </transformation>
+ </periodic_boundary>'''
+
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not set number of periodicities'
+ assert mdl.getPeriodicityNumber() == 2,\
+ 'Could not get number for periodicities'
+
+ def checkSetandgetPeriodicityMode(self):
+ """ Check whether the mode of transformation could be set and get """
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.addPeriodicity('2')
+ mdl.updatePeriodicityMode('2', "tr+rota1")
+ doc ='''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>0</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ </transformation>
+ <transformation mode="tr+rota1" name="2">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>0</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ <rotation1>
+ <rotation_angle>0</rotation_angle>
+ <rotation_x>0</rotation_x>
+ <rotation_y>0</rotation_y>
+ <rotation_z>0</rotation_z>
+ <rotation_center_x>0</rotation_center_x>
+ <rotation_center_y>0</rotation_center_y>
+ <rotation_center_z>0</rotation_center_z>
+ </rotation1>
+ </transformation>
+ </periodic_boundary>'''
+
+
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not set mode of transformation for periodicities'
+ assert mdl.getPeriodicityMode('2') == "tr+rota1",\
+ 'Could not get mode of transformation for periodicities'
+
+ def checkSetandgetTranslationDirection(self):
+ """ Check whether the dir values translation mode of periodicity could be set and get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.setTranslationDirection('1','translation_y',3.0)
+ doc ='''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>3</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ </transformation>
+ </periodic_boundary>'''
+
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not set one direction values for translation'
+ assert mdl.getTranslationDirection('1') == ('0', '3', '0'),\
+ 'Could not get one direction values for translation'
+
+ def checkSetandgetRotationDirectionandAngleandCenter(self):
+ """ Check whether the values for rotation's mode of periodicity could be set and get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.setTranslationDirection('1','translation_y', 3.0)
+ mdl.addPeriodicity('2')
+ mdl.updatePeriodicityMode('2', "tr+rota1")
+ mdl.setRotationAngle('2', 180.)
+ mdl.setRotationVector('2', 'rotation_x', 0.5)
+ mdl.setRotationVector('2', 'rotation_z', 2.5)
+ mdl.setRotationCenter('2', 'rotation_center_y', 9.8)
+ doc ='''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>3</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ </transformation>
+ <transformation mode="tr+rota1" name="2">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>0</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ <rotation1>
+ <rotation_angle>180</rotation_angle>
+ <rotation_x>0.5</rotation_x>
+ <rotation_y>0.0</rotation_y>
+ <rotation_z>2.5</rotation_z>
+ <rotation_center_x>0</rotation_center_x>
+ <rotation_center_y>9.8</rotation_center_y>
+ <rotation_center_z>0</rotation_center_z>
+ </rotation1>
+ </transformation>
+ </periodic_boundary>'''
+
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not set values for rotation transformation mode'
+ assert mdl.getRotationAngle('2') == '180',\
+ 'Could not get value of angle for rotation transformation mode'
+ assert mdl.getRotationDirection('2') == ('0.5', '0', '2.5'),\
+ 'Could not get values of direction for rotation transformation mode'
+ assert mdl.getRotationCenter('2') == ('0', '9.8', '0'),\
+ 'Could not get value of center of rotation for rotation transformation mode'
+
+ def checkSetandgetRotationMatrix(self):
+ """ Check whether the matrix of rotation for rotation2 mode could be set """
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.updatePeriodicityMode('1','rotation2')
+ mdl.setRotationMatrix('1', 'rotation_matrix_31', 31.31)
+ doc = '''<periodic_boundary>
+ <transformation mode="rotation2" name="1">
+ <translation>
+ <translation_x>0.0</translation_x>
+ <translation_y>0.0</translation_y>
+ <translation_z>0.0</translation_z>
+ </translation>
+ <rotation2>
+ <rotation_matrix_11>0.0</rotation_matrix_11>
+ <rotation_matrix_12>0.0</rotation_matrix_12>
+ <rotation_matrix_13>0.0</rotation_matrix_13>
+ <rotation_matrix_21>0.0</rotation_matrix_21>
+ <rotation_matrix_22>0.0</rotation_matrix_22>
+ <rotation_matrix_23>0.0</rotation_matrix_23>
+ <rotation_matrix_31>31.31</rotation_matrix_31>
+ <rotation_matrix_32>0.0</rotation_matrix_32>
+ <rotation_matrix_33>0.0</rotation_matrix_33>
+ <rotation_center_y>0.0</rotation_center_y>
+ <rotation_center_z>0.0</rotation_center_z>
+ </rotation2>
+ </transformation>
+ </periodic_boundary>'''
+
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not set values for matrix of rotation for rotation2 transformation mode'
+ assert mdl.getRotationMatrix('1') == ('0', '0', '0', '0', '0', '0', '31.31','0', '0'),\
+ 'Could not get values for matrix of rotation for rotation2 transformation mode'
+
+ def checkAddandGetJoinFaces(self):
+ """ Check whether faces of join meshes could be added and get """
+ select = {}
+ select['color'] = '1 2 3'
+ select['group'] = 'toto'
+ select['fraction'] = '0.1'
+ select['plan'] = '0.8'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'on'
+ mdl = SolutionDomainModel(self.case)
+ mdl.setJoinMeshesStatus('on')
+ mdl.addJoinFaces(select)
+ doc = '''<join_meshes status="on">
+ <faces_join name="1" status="on">
+ <faces_color>1 2 3</faces_color>
+ <faces_group>toto</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ <faces_semi_conf status="on"/>
+ </faces_join>
+ </join_meshes>'''
+
+ assert mdl.node_join == self.xmlNodeFromString(doc),\
+ 'Could not set values of faces join for join meshes'
+ assert mdl.getJoinFaces('1') == {'semiconf': 'on', 'reverse': 'off',
+ 'color': '1 2 3', 'plan': '0.8',
+ 'fraction': '0.1', 'group': 'toto'},\
+ 'Could not get values of faces join for join meshes'
+
+ def checkReplaceandDeleteandSetandGetStatusForJoinFaces(self):
+ """
+ Check whether faces of join meshes could be replaced and deleted
+ and status could be set and get
+ """
+ select = {}
+ select['color'] = '1 2 3'
+ select['group'] = 'toto'
+ select['fraction'] = '0.1'
+ select['plan'] = '0.8'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'on'
+ deux = {}
+ deux['color'] = '9 8 7'
+ deux['group'] = 'coucou'
+ deux['fraction'] = '0.2'
+ deux['plan'] = '0.82'
+ deux['reverse'] = 'off'
+ deux['semiconf'] = 'off'
+ mdl = SolutionDomainModel(self.case)
+ mdl.setJoinMeshesStatus('on')
+ mdl.addJoinFaces(select)
+ mdl.addJoinFaces(deux)
+ doc = '''<join_meshes status="on">
+ <faces_join name="1" status="on">
+ <faces_color>1 2 3</faces_color>
+ <faces_group>toto</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ <faces_semi_conf status="on"/>
+ </faces_join>
+ <faces_join name="2" status="on">
+ <faces_color>9 8 7</faces_color>
+ <faces_group>coucou</faces_group>
+ <faces_fraction>0.2</faces_fraction>
+ <faces_plan>0.82</faces_plan>
+ </faces_join>
+ </join_meshes>'''
+
+ assert mdl.node_join == self.xmlNodeFromString(doc),\
+ 'Could not set values of faces join for join meshes'
+ assert mdl.getJoinFaces('1') == {'group': 'toto', 'reverse': 'off', 'color': '1 2 3',
+ 'plan': '0.8', 'fraction': '0.1',
+ 'semiconf': 'on'},\
+ 'Could not get values of faces join for join meshes'
+
+ select['group'] = 'je vais partir'
+ mdl.replaceJoinFaces('1', select)
+ doc = '''<join_meshes status="on">
+ <faces_join name="1" status="on">
+ <faces_color>1 2 3</faces_color>
+ <faces_group>je vais partir</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ <faces_semi_conf status="on"/>
+ </faces_join>
+ <faces_join name="2" status="on">
+ <faces_color>9 8 7</faces_color>
+ <faces_group>coucou</faces_group>
+ <faces_fraction>0.2</faces_fraction>
+ <faces_plan>0.82</faces_plan>
+ </faces_join>
+ </join_meshes>'''
+
+ assert mdl.node_join == self.xmlNodeFromString(doc),\
+ 'Could not replace values of faces join for join meshes'
+
+ mdl.deleteJoinFaces('1')
+ doc = '''<join_meshes status="on">
+ <faces_join name="1" status="on">
+ <faces_color>9 8 7</faces_color>
+ <faces_group>coucou</faces_group>
+ <faces_fraction>0.2</faces_fraction>
+ <faces_plan>0.82</faces_plan>
+ </faces_join>
+ </join_meshes>'''
+
+ assert mdl.node_join == self.xmlNodeFromString(doc),\
+ 'Could not delete faces join for join meshes'
+
+ mdl.addJoinFaces(select)
+ mdl.setJoinStatus('1', 'off')
+ doc = '''<join_meshes status="on">
+ <faces_join name="1" status="off">
+ <faces_color>9 8 7</faces_color>
+ <faces_group>coucou</faces_group>
+ <faces_fraction>0.2</faces_fraction>
+ <faces_plan>0.82</faces_plan>
+ </faces_join>
+ <faces_join name="2" status="on">
+ <faces_color>1 2 3</faces_color>
+ <faces_group>je vais partir</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ <faces_semi_conf status="on"/>
+ </faces_join>
+ </join_meshes>'''
+
+ assert mdl.node_join == self.xmlNodeFromString(doc),\
+ 'Could not set status for active or not faces join for join meshes'
+ assert mdl.getJoinStatus('1') == 'off',\
+ 'Could not get status for active or not faces join for join meshes'
+
+ def checkAddandGetPeriodicFaces(self):
+ """ Check whether faces of periodicity could be added and get """
+ select = {}
+ select['color'] = '5 6'
+ select['group'] = 'toto'
+ select['fraction'] = '0.1'
+ select['plan'] = '0.8'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'off'
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.addPeriodicity('2')
+ mdl.updatePeriodicityMode('2', 'rotation1')
+ mdl.addPeriodicFaces('1', select)
+ mdl.addPeriodicFaces('2', select)
+ doc = '''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>0</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ <faces_periodic status="on">
+ <faces_color>5 6</faces_color>
+ <faces_group>toto</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ </faces_periodic>
+ </transformation>
+ <transformation mode="rotation1" name="2">
+ <translation>
+ <translation_x>0</translation_x>
+ <translation_y>0</translation_y>
+ <translation_z>0</translation_z>
+ </translation>
+ <rotation1>
+ <rotation_angle>0</rotation_angle>
+ <rotation_x>0</rotation_x>
+ <rotation_y>0</rotation_y>
+ <rotation_z>0</rotation_z>
+ <rotation_center_x>0</rotation_center_x>
+ <rotation_center_y>0</rotation_center_y>
+ <rotation_center_z>0</rotation_center_z>
+ </rotation1>
+ <faces_periodic status="on">
+ <faces_color>5 6</faces_color>
+ <faces_group>toto</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ </faces_periodic>
+ </transformation>
+ </periodic_boundary>'''
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not add values of faces for periodicities'
+ assert mdl.getPeriodicFaces('1') == {'group': 'toto', 'reverse': 'off', 'color': '5 6',
+ 'plan': '0.8', 'fraction': '0.1', 'semiconf': 'off'},\
+ 'Could not get values of faces for periodicities'
+
+ def checkReplaceandDeleteandSetandGetStatusForPeriodicFaces(self):
+ """
+ Check whether faces of of periodicity could be replaced and deleted
+ and status could be set and get
+ """
+ select = {}
+ select['color'] = '5 6'
+ select['group'] = 'toto'
+ select['fraction'] = '0.1'
+ select['plan'] = '0.8'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'off'
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.addPeriodicity('2')
+ mdl.updatePeriodicityMode('2', 'rotation1')
+ mdl.addPeriodicFaces('1', select)
+ mdl.addPeriodicFaces('2', select)
+ mdl.deletePeriodicFaces('2')
+ doc = '''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0.0</translation_x>
+ <translation_y>0.0</translation_y>
+ <translation_z>0.0</translation_z>
+ </translation>
+ <faces_periodic status="on">
+ <faces_color>5 6</faces_color>
+ <faces_group>toto</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.8</faces_plan>
+ </faces_periodic>
+ </transformation>
+ <transformation mode="rotation1" name="2">
+ <translation>
+ <translation_x>0.0</translation_x>
+ <translation_y>0.0</translation_y>
+ <translation_z>0.0</translation_z>
+ </translation>
+ <rotation1>
+ <rotation_angle>0.0</rotation_angle>
+ <rotation_x>0.0</rotation_x>
+ <rotation_y>0.0</rotation_y>
+ <rotation_z>0.0</rotation_z>
+ <rotation_center_x>0.0</rotation_center_x>
+ <rotation_center_y>0.0</rotation_center_y>
+ <rotation_center_z>0.0</rotation_center_z>
+ </rotation1>
+ </transformation>
+ </periodic_boundary>'''
+
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not delete one selection of faces for periodicities'
+
+ select['color'] = '147 963'
+ select['group'] = 'PERIODIC'
+ select['fraction'] = '0.1'
+ select['plan'] = '0.77'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'off'
+ mdl.replacePeriodicFaces('1', select)
+ doc = '''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0.0</translation_x>
+ <translation_y>0.0</translation_y>
+ <translation_z>0.0</translation_z>
+ </translation>
+ <faces_periodic status="on">
+ <faces_color>147 963</faces_color>
+ <faces_group>PERIODIC</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.77</faces_plan>
+ </faces_periodic>
+ </transformation>
+ <transformation mode="rotation1" name="2">
+ <translation>
+ <translation_x>0.0</translation_x>
+ <translation_y>0.0</translation_y>
+ <translation_z>0.0</translation_z>
+ </translation>
+ <rotation1>
+ <rotation_angle>0.0</rotation_angle>
+ <rotation_x>0.0</rotation_x>
+ <rotation_y>0.0</rotation_y>
+ <rotation_z>0.0</rotation_z>
+ <rotation_center_x>0.0</rotation_center_x>
+ <rotation_center_y>0.0</rotation_center_y>
+ <rotation_center_z>0.0</rotation_center_z>
+ </rotation1>
+ </transformation>
+ </periodic_boundary>'''
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not replace values of faces for periodicities'
+
+ mdl.setPeriodicStatus('1', 'off')
+ doc = '''<periodic_boundary>
+ <transformation mode="translation" name="1">
+ <translation>
+ <translation_x>0.0</translation_x>
+ <translation_y>0.0</translation_y>
+ <translation_z>0.0</translation_z>
+ </translation>
+ <faces_periodic status="off">
+ <faces_color>147 963</faces_color>
+ <faces_group>PERIODIC</faces_group>
+ <faces_fraction>0.1</faces_fraction>
+ <faces_plan>0.77</faces_plan>
+ </faces_periodic>
+ </transformation>
+ <transformation mode="rotation1" name="2">
+ <translation>
+ <translation_x>0.0</translation_x>
+ <translation_y>0.0</translation_y>
+ <translation_z>0.0</translation_z>
+ </translation>
+ <rotation1>
+ <rotation_angle>0.0</rotation_angle>
+ <rotation_x>0.0</rotation_x>
+ <rotation_y>0.0</rotation_y>
+ <rotation_z>0.0</rotation_z>
+ <rotation_center_x>0.0</rotation_center_x>
+ <rotation_center_y>0.0</rotation_center_y>
+ <rotation_center_z>0.0</rotation_center_z>
+ </rotation1>
+ </transformation>
+ </periodic_boundary>'''
+ assert mdl.node_perio == self.xmlNodeFromString(doc),\
+ 'Could not set status for activate or not selection of faces for periodicities'
+ assert mdl.getPeriodicStatus('1') == 'off',\
+ 'Could not get status for activate or not selection of faces for periodicities'
+
+ def checkAddandGetSyrthesFaces(self):
+ """ Check whether faces of syrthes coupling could be added and get """
+ select = {}
+ select['color'] = '85 2'
+ select['group'] = 'SYRT'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'off'
+ mdl = SolutionDomainModel(self.case)
+ mdl.setSyrthesCouplingStatus('on')
+ mdl.addSyrthesFaces(select)
+ doc = '''<syrthes_coupling status="on">
+ <faces_syrthes status="on">
+ <faces_color>85 2</faces_color>
+ <faces_group>SYRT</faces_group>
+ </faces_syrthes>
+ </syrthes_coupling>'''
+
+ assert mdl.node_syrthes == self.xmlNodeFromString(doc),\
+ 'Could not add values of faces for syrthes coupling'
+ assert mdl.getSyrthesFaces() == {'group': 'SYRT', 'reverse': 'off', 'color': '85 2',
+ 'plan': '', 'fraction': '', 'semiconf': 'off'},\
+ 'Could not get values of faces for syrthes coupling'
+
+ def checkReplaceandDeleteandSetandGetStatusForSyrthesFaces(self):
+ """
+ Check whether faces of syrthes coupling could be replaced and deleted
+ and status could be set and get
+ """
+ select = {}
+ select['color'] = '85 2'
+ select['group'] = 'SYRT'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'off'
+ mdl = SolutionDomainModel(self.case)
+ mdl.setSyrthesCouplingStatus('on')
+ mdl.addSyrthesFaces(select)
+ select['color'] = '6 3'
+ select['group'] = 'COUPLING'
+ mdl.replaceSyrthesFaces(select)
+ doc = '''<syrthes_coupling status="on">
+ <faces_syrthes status="on">
+ <faces_color>6 3</faces_color>
+ <faces_group>COUPLING</faces_group>
+ </faces_syrthes>
+ </syrthes_coupling>'''
+
+ assert mdl.node_syrthes == self.xmlNodeFromString(doc),\
+ 'Could not replace values of faces for syrthes coupling'
+
+ mdl.deleteSyrthesFaces()
+ doc = '''<syrthes_coupling status="on"/>'''
+
+ assert mdl.node_syrthes == self.xmlNodeFromString(doc),\
+ 'Could not delete values of faces for syrthes coupling'
+
+ select['group'] = 'NOUVEAU'
+ mdl.addSyrthesFaces(select)
+ mdl.setSyrthesStatus('off')
+ doc = '''<syrthes_coupling status="on">
+ <faces_syrthes status="off">
+ <faces_color>6 3</faces_color>
+ <faces_group>NOUVEAU</faces_group>
+ </faces_syrthes>
+ </syrthes_coupling>'''
+
+ assert mdl.node_syrthes == self.xmlNodeFromString(doc),\
+ 'Could not set status for activate selection of faces for syrthes coupling'
+ assert mdl.getSyrthesStatus() == 'off',\
+ 'Could not get status for activate selection of faces for syrthes coupling'
+
+ def checkAddandGetSelectFaces(self):
+ """ Check whether faces of standalone could be added and get """
+ select = {}
+ select['color'] = '8 2'
+ select['group'] = 'STAND'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'off'
+ mdl = SolutionDomainModel(self.case)
+ mdl.addSelectFaces(select)
+ doc = '''<standalone>
+ <faces_select status="on">
+ <faces_color>8 2</faces_color>
+ <faces_group>STAND</faces_group>
+ </faces_select>
+ </standalone>'''
+
+ assert mdl.node_standalone == self.xmlNodeFromString(doc),\
+ 'Could not add values of faces for standalone selection'
+ assert mdl.getSelectFaces() == {'group': 'STAND', 'reverse': 'off', 'color': '8 2',
+ 'plan': '', 'fraction': '', 'semiconf': 'off'},\
+ 'Could not get values of faces for standalone selection'
+
+ def checkReplaceandDeleteandSetandGetStatusForSelectFaces(self):
+ """
+ Check whether faces of standalone could be replaced and deleted
+ and status could be set and get
+ """
+ select = {}
+ select['color'] = '8 2'
+ select['group'] = 'STAND'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'off'
+ mdl = SolutionDomainModel(self.case)
+ mdl.addSelectFaces(select)
+ new = {}
+ new['color'] = '7 8 9'
+ new['group'] = 'NEW'
+ new['reverse'] = 'off'
+ new['semiconf'] = 'off'
+ mdl.replaceSelectFaces(new)
+ doc = '''<standalone>
+ <faces_select status="on">
+ <faces_color>7 8 9</faces_color>
+ <faces_group>NEW</faces_group>
+ </faces_select>
+ </standalone>'''
+
+ assert mdl.node_standalone == self.xmlNodeFromString(doc),\
+ 'Could not replace values of faces for standalone selection'
+
+ mdl.deleteSelectFaces()
+ doc = '''<standalone/>'''
+
+ assert mdl.node_standalone == self.xmlNodeFromString(doc),\
+ 'Could not delete values of faces for standalone selection'
+
+ select['group'] = 'NOUVEAU'
+ mdl.addSelectFaces(select)
+ mdl.setSelectStatus('off')
+ doc = '''<standalone/>'''
+
+ assert mdl.node_standalone == self.xmlNodeFromString(doc),\
+ 'Could not set status for activate selection of faces for standalone selection'
+ assert mdl.getSelectStatus() == 'off',\
+ 'Could not get status for activate selection of faces for standalone selection'
+
+ def checkMeshCommand(self):
+ """ Check whether command for meshes could be set """
+ mdl = SolutionDomainModel(self.case)
+ mdl.case['mesh_path'] = 'MESH'
+ mdl.addMesh('fdc.des','des')
+ mdl.addMesh('pic.des','des')
+ mdl.addMesh('truc.ngeom','ngeom')
+ line = ''' -m MESH/fdc.des -m MESH/pic.des -m MESH/truc.ngeom '''
+
+ assert mdl.getMeshCommand() == line,\
+ 'Mesh command is not verified in SolutionDomain Model'
+
+
+ def checkReorientSetAndGetStatusAndCommand(self):
+ """ Check whether reorient status could be set and get and command line could be get """
+ mdl = SolutionDomainModel(self.case)
+ mdl.setOrientation('on')
+ doc = '''<reorientation status="on"/>'''
+
+ assert mdl.node_orient == self.xmlNodeFromString(doc),\
+ 'Could not set reorient status in SolutionDomain Model'
+ assert mdl.getOrientation() == "on",\
+ 'Could not get reorient status in SolutionDomain Model'
+
+ cmd_orient = ' --reorient '
+ assert mdl.getReorientCommand() == cmd_orient,\
+ 'Reorient command is not verified in SolutionDomain Model'
+
+
+ def checkJoinAndCutCommand(self):
+ """ Check whether join and cut command lines could be get """
+ mdl = SolutionDomainModel(self.case)
+ select = {}
+ select['color'] = '1 2 3'
+ select['group'] = 'toto'
+ select['fraction'] = '0.1'
+ select['plan'] = '0.8'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'on'
+ mdl.setJoinMeshesStatus('on')
+ mdl.addJoinFaces(select)
+ cmd_join = ' -j --color 1 2 3 --group toto --fraction 0.1 --plane 0.8 '
+
+ assert mdl.getJoinCommand() == cmd_join,\
+ 'Join command is not verified in SolutionDomain Model'
+
+ mdl.setCutStatus('on')
+ mdl.setCutAngle(0.05)
+ cmd_cut = mdl.getCutCommand()
+ cut = ' --cwf 0.05'
+ assert mdl.getCutCommand() == cmd_cut,\
+ 'Cut command is not verified in SolutionDomain Model'
+
+ def checkPerioCommand(self):
+ """ Check whether perio command line could be get """
+ mdl = SolutionDomainModel(self.case)
+ mdl.addPeriodicity('1')
+ mdl.updatePeriodicityMode('1','rotation1')
+ mdl.setRotationVector('1', 'rotation_x', 9.)
+ mdl.setRotationVector('1', 'rotation_y', 8.)
+ mdl.setRotationVector('1', 'rotation_z', 7.)
+ mdl.setRotationAngle('1', 45.)
+ mdl.setRotationCenter('1', 'rotation_center_y', 66.)
+ mdl.addPeriodicity('2')
+ mdl.updatePeriodicityMode('2','tr+rota2')
+ mdl.setTranslationDirection('2','translation_y', 3)
+ mdl.setRotationMatrix('2', 'rotation_matrix_31', 31.31)
+ cmd_perio = " --perio --rota --angle 45 --dir 9 8 7 --invpt 0 66 0 --perio --trans 0 3 0 --rota --matrix 0 0 0 0 0 0 31.31 0 0 --invpt 0 0 "
+
+ assert mdl.getPerioCommand() == cmd_perio,\
+ 'Perio command is not verified in SolutionDomain Model'
+
+ def checkSyrthesCommand(self):
+ """ Check whether syrthes command line could be get """
+ mdl = SolutionDomainModel(self.case)
+ mdl.setSyrthesCouplingStatus('on')
+ mdl.setSyrthes2dMeshStatus('on')
+ select = {}
+ select['color'] = '1 2 3'
+ select['group'] = 'toto'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'on'
+ mdl = SolutionDomainModel(self.case)
+ mdl.addSyrthesFaces(select)
+ cmd_syr = ''' --syrthes --color 1 2 3 --group toto --2d '''
+
+ assert mdl.getSyrthesCommand() == cmd_syr,\
+ 'Syrthes command is not verified in SolutionDomain Model'
+
+ def checkSimCommAndVerifMaillCommand(self):
+ """ Check whether simulation_communication command line could be get """
+ mdl = SolutionDomainModel(self.case)
+ mdl.setSimCommStatus('on')
+ cmd_sim = mdl.getSimCommCommand()
+ sim =' -sc '
+ assert mdl.getSimCommCommand() == sim,\
+ 'Simulation_communication command is not verified in SolutionDomain Model'
+
+ #A reprendre :
+#### def checkSelectCommand(self):
+#### """Check whether standalone selection command line could be get"""
+#### select = {}
+#### select['color'] = '1 2 3'
+#### select['group'] = 'toto'
+#### select['reverse'] = 'off'
+#### select['semiconf'] = 'on'
+#### mdl = SolutionDomainModel(self.case)
+#### mdl.addSelectFaces(select)
+#### print mdl.getSelectCommand()
+###### --int-face --color 1 2 3 --group toto
+#### select =' --color 1 2 3 --group toto --semi-conf '
+###### select =' --int-face --color 1 2 3 --group toto --semi-conf '
+#### assert mdl.getSelectCommand().split() == select.split(),\
+#### 'Standalone selection faces command is not verified in SolutionDomain Model'
+####
+ def checkPostCommand(self):
+ """Check whether output postprocessing format command line could be get"""
+ mdl = SolutionDomainModel(self.case)
+ mdl.setPostProFormat('CGNS')
+
+ cmd_post = ' --cgns '
+ assert mdl.getPostCommand() == cmd_post,\
+ 'Post command is not verified for postprocessing format in SolutionDomain Model'
+
+
+ def checkGetStatusNodeAndGetFacesSelect(self):
+ """Check whether status of node and selection pf fzces could be get - only for view"""
+ mdl = SolutionDomainModel(self.case)
+ select = {}
+ select['color'] = '1 2 3'
+ select['group'] = 'toto'
+ select['fraction'] = '0.12'
+ select['plan'] = '0.88'
+ select['reverse'] = 'off'
+ select['semiconf'] = 'on'
+ mdl.setJoinMeshesStatus('on')
+ mdl.addJoinFaces(select)
+ node = mdl.node_join.xmlGetChildNode('faces_join')
+
+ assert mdl.getStatusNode(node) == 'on',\
+ 'Could not get status of node in SolutionDomainModel'
+
+ deux = {}
+ deux['color'] = '4 5 6'
+ deux['group'] = 'coucou'
+ deux['fraction'] = '0.1'
+ deux['plan'] = '0.8'
+ deux['reverse'] = 'off'
+ deux['semiconf'] = 'on'
+ mdl.addJoinFaces(deux)
+ list = {'group': 'coucou', 'reverse': 'off', 'color': '4 5 6', 'plan': '0.8', 'fraction': '0.1', 'semiconf': 'on'}
+
+ assert mdl.getFacesSelect('faces_join', 1) == list,\
+ 'Could not get faces for view in SolutionDomainModel'
+
+
+
+#-------------------------------------------------------------------------------
+# SolutionDomain Model test case
+#-------------------------------------------------------------------------------
+
+
+class MeshModelTestCase(unittest.TestCase):
+ def setUp(self):
+ """
+ This method is executed before all "check" methods.
+ """
+ self.files = [ ("toto.case", "case") ,
+ ("toto.cgns.gz", "cgns") ,
+ ("toto.des", "des") ,
+ ("toto.ccm.gz", "ccm") ,
+ ("toto.med", "med") ,
+ ("toto.msh.gz", "msh") ,
+ ("toto.neu", "neu") ,
+ ("toto.ngeom.gz", "ngeom"),
+ ("toto.unv.gz", "unv") ,
+ ("toto", "") ,
+ ("toto.gz", "") ]
+
+ def tearDown(self):
+ """
+ This method is executed after all "check" methods.
+ """
+ pass
+
+ def checkGetMeshExtension(self):
+ """Check whether mesh extension could be get"""
+ mdl = MeshModel()
+
+ for f in self.files:
+ ext = mdl.getMeshExtension(f[0])
+ assert ext == f[1], 'could not get the mesh extension'
+
+ def checkGetMeshFormat(self):
+ """Check whether mesh extension could be get"""
+ mdl = MeshModel()
+
+ for f in self.files:
+ fmt = mdl.getMeshFormat(f[0])
+ if fmt:
+ assert fmt == mdl.ext[f[1]], 'could not get the mesh format'
+
+
+def suite1():
+ testSuite = unittest.makeSuite(SolutionDomainTestCase, "check")
+ return testSuite
+
+def suite2():
+ testSuite = unittest.makeSuite(MeshModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print __file__
+ runner = unittest.TextTestRunner()
+ runner.run(suite1())
+ runner.run(suite2())
+
+
+
+
+
diff --git a/gui/Pages/SolutionDomainView.py b/gui/Pages/SolutionDomainView.py
new file mode 100644
index 0000000..4c8a519
--- /dev/null
+++ b/gui/Pages/SolutionDomainView.py
@@ -0,0 +1,1319 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- SpinBoxDelegate
+- StandardItemModelMeshes
+- StandardItemModelPeriod
+- SolutionDomainMeshFormatDialogView
+- SolutionDomainView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import os, sys, string, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from SolutionDomainForm import Ui_SolutionDomainForm
+from SolutionDomainMeshFormatDialogForm import Ui_SolutionDomainMeshFormatDialogForm
+from Pages.SolutionDomainModel import SolutionDomainModel
+from Pages.SolutionDomainModel import MeshModel
+from FacesSelectionView import StandardItemModelFaces
+from Base.QtPage import ComboModel, DoubleValidator
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("SolutionDomainView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Spin box delegate for 'Number' in Meshes table
+#-------------------------------------------------------------------------------
+
+class MeshNumberDelegate(QItemDelegate):
+ def __init__(self, parent = None):
+ super(MeshNumberDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QSpinBox(parent)
+ editor.setMinimum(1)
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, spinBox, index):
+ value, ok = index.model().data(index, Qt.DisplayRole).toInt()
+ spinBox.setValue(value)
+
+
+ def setModelData(self, spinBox, model, index):
+ spinBox.interpretText()
+ value = spinBox.value()
+ model.setData(index, QVariant(value))
+# selectionModel = self.parent.selectionModel()
+# for idx in selectionModel.selectedIndexes():
+# if idx.column() == index.column():
+# model.setData(idx, QVariant(value))
+
+
+#-------------------------------------------------------------------------------
+# QComboBox delegate for 'Group cells' and 'Group Faces' in Meshes table
+#-------------------------------------------------------------------------------
+
+
+class GroupDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent = None):
+ super(GroupDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ editor.addItem(QString("off"))
+ editor.addItem(QString("section"))
+ editor.addItem(QString("zone"))
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, comboBox, index):
+ row = index.row()
+ col = index.column()
+ string = index.model().dataMeshes[row][col]
+ comboBox.setEditText(string)
+
+
+ def setModelData(self, comboBox, model, index):
+ value = comboBox.currentText()
+ model.setData(index, QVariant(value))
+
+
+#-------------------------------------------------------------------------------
+# StandarItemModelMeshes class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelMeshes(QStandardItemModel):
+
+ def __init__(self, mdl):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.mdl = mdl
+ self.dataMeshes = []
+ # list of items to be disabled in the QTableView
+ self.disabledItem = []
+
+ self.populateModel()
+
+ self.headers = [self.tr("Meshes"),
+ self.tr("Format"),
+ self.tr("Number"),
+ self.tr("Add groups of faces"),
+ self.tr("Add groups of cells")]
+
+ self.tooltip = [self.tr("Code_Saturne Preprocessor option: --mesh"),
+ self.tr("Code_Saturne Preprocessor sub-option: --format"),
+ self.tr("Code_Saturne Preprocessor sub-option: --num"),
+ self.tr("Code_Saturne Preprocessor sub-option: --grp-fac"),
+ self.tr("Code_Saturne Preprocessor sub-option: --grp-cel")]
+
+ self.setColumnCount(len(self.headers))
+
+ # Initialize the flags
+ for row in range(self.rowCount()):
+ for column in range(self.columnCount()):
+ role = Qt.DisplayRole
+ index = self.index(row, column)
+ value = self.data(index, role)
+ self.setData(index, value)
+
+
+ def populateModel(self):
+
+ for mesh in self.mdl.getMeshList():
+ format = self.mdl.getMeshFormat(mesh)
+ list = []
+ list.append(mesh)
+ list.append(MeshModel().getMeshFormatDescription(format))
+ if format == 'med':
+ num = self.mdl.getMeshNumber(mesh)
+ if not num:
+ num = 1
+ list.append(num)
+ else:
+ list.append("")
+ if format == 'cgns':
+ list.append(self.mdl.getMeshGroupFaces(mesh))
+ list.append(self.mdl.getMeshGroupCells(mesh))
+ else:
+ list.append("")
+ list.append("")
+ self.dataMeshes.append(list)
+ log.debug("populateModel-> dataMeshes = %s" % list)
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ if role == Qt.ToolTipRole:
+ return QVariant(self.tooltip[index.column()])
+
+ elif role == Qt.DisplayRole:
+ d = self.dataMeshes[index.row()][index.column()]
+ if d:
+ return QVariant(d)
+ else:
+ return QVariant()
+
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ self.__disableData(index.row())
+
+ # disable item
+ if (index.row(), index.column()) in self.disabledItem:
+ return Qt.ItemIsEnabled
+
+ if index.column() in [0, 1]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ elif index.column() in [2, 3, 4]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role=None):
+ row = index.row()
+ col = index.column()
+
+ mesh = self.dataMeshes[row][0]
+
+ if col == 2:
+ v, ok = value.toInt()
+ if ok:
+ self.dataMeshes[row][2] = v
+ self.mdl.setMeshNumber(mesh, v)
+
+ elif col == 3:
+ v = str(value.toString())
+ self.dataMeshes[row][col] = v
+ if v:
+ self.mdl.setMeshGroupFaces(mesh, v)
+
+ elif col == 4:
+ v = str(value.toString())
+ self.dataMeshes[row][col] = v
+ if v:
+ self.mdl.setMeshGroupCells(mesh, v)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addRow(self, name, format):
+ """
+ Add a row in the table.
+ """
+ txt_format = MeshModel().getMeshFormatDescription(format)
+
+ if format == 'med':
+ item = [name, txt_format, 1, "", ""]
+ elif format == 'cgns':
+ item = [name, txt_format, "", "off", "off"]
+ else:
+ item = [name, txt_format, "", "", ""]
+
+ self.dataMeshes.append(item)
+
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+
+ def deleteRow(self, row):
+ """
+ Delete the row in the model
+ """
+ del self.dataMeshes[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+
+ def __disableData(self, row):
+ if self.mdl.getMeshFormat(self.dataMeshes[row][0]) != "med":
+ if (row, 2) not in self.disabledItem:
+ self.disabledItem.append((row, 2))
+ else:
+ if (row, 2) in self.disabledItem:
+ self.disabledItem.remove((row, 2))
+
+ if self.mdl.getMeshFormat(self.dataMeshes[row][0]) != "cgns":
+ if (row, 3) not in self.disabledItem:
+ self.disabledItem.append((row, 3))
+ if (row, 4) not in self.disabledItem:
+ self.disabledItem.append((row, 4))
+ else:
+ if (row, 3) in self.disabledItem:
+ self.disabledItem.remove((row, 3))
+ if (row, 4) in self.disabledItem:
+ self.disabledItem.remove((row, 4))
+
+
+ def getName(self, row):
+ """
+ Returns the name of the mesh file.
+ """
+ return self.dataMeshes[row][0]
+
+#-------------------------------------------------------------------------------
+# StandarItemModelPeriod class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelPeriod(QStandardItemModel):
+
+ def __init__(self, mdl):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.mdl = mdl
+ self.headers = [ self.tr("Number"), self.tr("Name")]
+ self.tooltip = [self.tr("Code_Saturne Preprocessor option: --perio"),
+ self.tr("Code_Saturne Preprocessor option: --perio")]
+
+ self.setColumnCount(len(self.headers))
+ self.dataPeriod = []
+
+ self.populateModel()
+
+
+ def populateModel(self):
+ l = self.mdl.getPeriodicityListName()
+ for i in range(self.mdl.getPeriodicityNumber()):
+ list = []
+ list.append(i+1)
+ list.append(l[i])
+ self.dataPeriod.append(list)
+ log.debug("populateModel-> dataPeriod = %s" % list)
+ row = self.rowCount()
+ self.setRowCount(row + 1)
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataPeriod[index.row()][index.column()])
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ elif index.column() == 0:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+ elif index.column() == 1:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ if index.column() == 1:
+ row = index.row()
+ new_name = str(value.toString())
+ if new_name:
+ self.mdl.changePeriodicityName(self.dataPeriod[row][1], new_name)
+ self.dataPeriod[row][1] = new_name
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addRow(self):
+ """
+ Add a row in the model.
+ """
+ row = self.rowCount()
+ self.mdl.addPeriodicity("perio" + str(row+1))
+ item = [row+1, "perio" + str(row+1)]
+ self.dataPeriod.append(item)
+ self.setRowCount(row+1)
+
+# def deleteRow(self, row=0):
+# """
+# Delete the row in the model.
+# """
+# # This deletes only the last row
+# last = self.rowCount()
+# del self.dataPeriod[last-1]
+# self.setRowCount(self.rowCount()-1)
+
+ def deleteRow(self, row):
+ """
+ Delete the row in the model.
+ """
+ self.mdl.deletePeriodicity(self.dataPeriod[row][1])
+ del self.dataPeriod[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+#-------------------------------------------------------------------------------
+# Popup window: Mesh Format dialog window
+#-------------------------------------------------------------------------------
+
+class SolutionDomainMeshFormatDialogView(QDialog, Ui_SolutionDomainMeshFormatDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+ Ui_SolutionDomainMeshFormatDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("Mesh format selection"))
+ self.default = default
+ self.result = self.default
+
+ # Combo models and items
+
+ self.dico_txt_format = {}
+ liste = MeshModel().getBuildFormatList()
+ for (num, v, txt) in liste:
+ self.dico_txt_format[txt] = v
+ self.comboBox.addItem(QString(txt))
+
+ # Activate the default format: "NOPO Simail (.des)"
+
+ self.comboBox.setCurrentIndex(2)
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ txt_format = str(self.comboBox.currentText())
+ self.result = self.dico_txt_format[txt_format]
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class SolutionDomainView(QWidget, Ui_SolutionDomainForm):
+ """
+ """
+ def __init__(self, parent, case, stbar):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+ Ui_SolutionDomainForm.__init__(self)
+ self.setupUi(self)
+
+ self.stbar = stbar
+ self.case = case
+ self.mdl = SolutionDomainModel(self.case)
+
+ # 1) MESHES SELECTION LAYOUT
+
+ # 1.1) Model for meshes table
+ self.modelMeshes = StandardItemModelMeshes(self.mdl)
+ self.tableViewMeshes.setModel(self.modelMeshes)
+ self.tableViewMeshes.resizeColumnsToContents()
+ self.tableViewMeshes.resizeRowsToContents()
+
+ delegateNumber = MeshNumberDelegate(self.tableViewMeshes)
+ self.tableViewMeshes.setItemDelegateForColumn(2, delegateNumber)
+
+ delegateGroupFaces = GroupDelegate(self.tableViewMeshes)
+ self.tableViewMeshes.setItemDelegateForColumn(3, delegateGroupFaces)
+
+ delegateGroupCells = GroupDelegate(self.tableViewMeshes)
+ self.tableViewMeshes.setItemDelegateForColumn(4, delegateGroupCells)
+
+ # 1.2) Connections
+
+ self.connect(self.pushButtonAddMesh, SIGNAL("clicked()"), self.slotSearchMesh)
+ self.connect(self.pushButtonDeleteMesh, SIGNAL("clicked()"), self.slotDeleteMesh)
+ self.connect(self.groupBoxJoin, SIGNAL("clicked(bool)"), self.slotJoinMeshes)
+ self.connect(self.groupBoxWarp, SIGNAL("clicked(bool)"), self.slotFacesCutting)
+ self.connect(self.lineEditWarp, SIGNAL("textChanged(const QString &)"), self.slotWarpParam)
+ self.connect(self.groupBoxOrient, SIGNAL("clicked(bool)"), self.slotOrientation)
+
+ # 1.3) Set up validators
+ validatorWarp = DoubleValidator(self.lineEditWarp, min=0.0)
+ self.lineEditWarp.setValidator(validatorWarp)
+
+ # 1.4) Faces to join selection (Custom Widgets)
+
+ model = StandardItemModelFaces(self, self.mdl, 'faces_join')
+ #self.widgetFacesJoin.tableView.reset()
+ self.widgetFacesJoin.modelFaces = model
+ self.widgetFacesJoin.tableView.setModel(model)
+
+ # 2) PERIODICITIES
+
+ self.perio_name = ""
+ self.perio_mode = ""
+
+ # Model for periodicities
+ self.modelPeriod = StandardItemModelPeriod(self.mdl)
+ self.treeViewPeriod.setModel(self.modelPeriod)
+ self.treeViewPeriod.setSelectionBehavior(QAbstractItemView.SelectRows)
+
+ # Combo model for type of periodicity
+ self.modelComboPeriod = ComboModel(self.comboBoxPeriodicity, 5, 1)
+ self.modelComboPeriod.addItem(self.tr("Periodicity of translation"), "translation")
+ self.modelComboPeriod.addItem(self.tr("Periodicity of rotation (defined by angle and direction)"), "rotation1")
+ self.modelComboPeriod.addItem(self.tr("Periodicity of rotation (defined by matrix)"), "rotation2")
+ self.modelComboPeriod.addItem(self.tr("Translation + rotation (defined by angle and direction)"), "tr+rota1")
+ self.modelComboPeriod.addItem(self.tr("Translation + rotation (defined by matrix)"), "tr+rota2")
+
+ # Display
+ self.groupBoxMode.hide()
+ self.groupBoxFaces.hide()
+ self.groupBoxTranslation.hide()
+ self.groupBoxRotation1.hide()
+ self.groupBoxRotation2.hide()
+
+ # Set up validators
+
+ # 2)
+ self.lineEditTX.setValidator(DoubleValidator(self.lineEditTX))
+ self.lineEditTY.setValidator(DoubleValidator(self.lineEditTY))
+ self.lineEditTZ.setValidator(DoubleValidator(self.lineEditTZ))
+ self.lineEditAngle.setValidator(DoubleValidator(self.lineEditAngle))
+ self.lineEditDX.setValidator(DoubleValidator(self.lineEditDX))
+ self.lineEditDY.setValidator(DoubleValidator(self.lineEditDY))
+ self.lineEditDZ.setValidator(DoubleValidator(self.lineEditDZ))
+ self.lineEditX1.setValidator(DoubleValidator(self.lineEditX1))
+ self.lineEditY1.setValidator(DoubleValidator(self.lineEditY1))
+ self.lineEditZ1.setValidator(DoubleValidator(self.lineEditZ1))
+ self.lineEditM11.setValidator(DoubleValidator(self.lineEditM11))
+ self.lineEditM12.setValidator(DoubleValidator(self.lineEditM12))
+ self.lineEditM13.setValidator(DoubleValidator(self.lineEditM13))
+ self.lineEditM21.setValidator(DoubleValidator(self.lineEditM21))
+ self.lineEditM22.setValidator(DoubleValidator(self.lineEditM22))
+ self.lineEditM23.setValidator(DoubleValidator(self.lineEditM23))
+ self.lineEditM31.setValidator(DoubleValidator(self.lineEditM31))
+ self.lineEditM32.setValidator(DoubleValidator(self.lineEditM32))
+ self.lineEditM33.setValidator(DoubleValidator(self.lineEditM33))
+ self.lineEditX2.setValidator(DoubleValidator(self.lineEditX2))
+ self.lineEditY2.setValidator(DoubleValidator(self.lineEditY2))
+ self.lineEditZ2.setValidator(DoubleValidator(self.lineEditZ2))
+
+ # Connections
+
+ self.connect(self.treeViewPeriod, SIGNAL("clicked(const QModelIndex &)"), self.slotUpdatePeriodicity)
+ self.connect(self.pushButtonAddPeriod, SIGNAL("clicked()"), self.slotAddPeriodicity)
+ self.connect(self.pushButtonDeletePeriod, SIGNAL("clicked()"), self.slotDeletePeriodicity)
+
+ self.connect(self.comboBoxPeriodicity, SIGNAL("activated(const QString&)"), self.slotPeriodicityMode)
+
+ self.connect(self.lineEditTX, SIGNAL("textChanged(const QString &)"), self.slotTranslationX)
+ self.connect(self.lineEditTY, SIGNAL("textChanged(const QString &)"), self.slotTranslationY)
+ self.connect(self.lineEditTZ, SIGNAL("textChanged(const QString &)"), self.slotTranslationZ)
+
+ self.connect(self.lineEditAngle, SIGNAL("textChanged(const QString &)"), self.slotAngleRotation)
+
+ self.connect(self.lineEditDX, SIGNAL("textChanged(const QString &)"), self.slotRotationX)
+ self.connect(self.lineEditDY, SIGNAL("textChanged(const QString &)"), self.slotRotationY)
+ self.connect(self.lineEditDZ, SIGNAL("textChanged(const QString &)"), self.slotRotationZ)
+
+ self.connect(self.lineEditX1, SIGNAL("textChanged(const QString &)"), self.slotCenterRotationX1)
+ self.connect(self.lineEditY1, SIGNAL("textChanged(const QString &)"), self.slotCenterRotationY1)
+ self.connect(self.lineEditZ1, SIGNAL("textChanged(const QString &)"), self.slotCenterRotationZ1)
+
+ self.connect(self.lineEditM11, SIGNAL("textChanged(const QString &)"), self.slotMatrix11)
+ self.connect(self.lineEditM12, SIGNAL("textChanged(const QString &)"), self.slotMatrix12)
+ self.connect(self.lineEditM13, SIGNAL("textChanged(const QString &)"), self.slotMatrix13)
+ self.connect(self.lineEditM21, SIGNAL("textChanged(const QString &)"), self.slotMatrix21)
+ self.connect(self.lineEditM22, SIGNAL("textChanged(const QString &)"), self.slotMatrix22)
+ self.connect(self.lineEditM23, SIGNAL("textChanged(const QString &)"), self.slotMatrix22)
+ self.connect(self.lineEditM31, SIGNAL("textChanged(const QString &)"), self.slotMatrix31)
+ self.connect(self.lineEditM32, SIGNAL("textChanged(const QString &)"), self.slotMatrix32)
+ self.connect(self.lineEditM33, SIGNAL("textChanged(const QString &)"), self.slotMatrix33)
+
+ self.connect(self.lineEditX2, SIGNAL("textChanged(const QString &)"), self.slotCenterRotationX2)
+ self.connect(self.lineEditY2, SIGNAL("textChanged(const QString &)"), self.slotCenterRotationY2)
+ self.connect(self.lineEditZ2, SIGNAL("textChanged(const QString &)"), self.slotCenterRotationZ2)
+
+ # 3) INITIALIZE MESHES LIST
+
+ # 3.1) Meshes list
+
+ msg = ""
+ nameList = self.mdl.getMeshList()
+ log.debug("__init__ -> nameList = %s " % nameList)
+
+ if nameList:
+ for mesh in nameList:
+ if mesh not in os.listdir(self.case['mesh_path']):
+ msg = msg + mesh + '\n'
+
+ if msg:
+ msg = msg + '\n'
+ title = self.tr("WARNING")
+ msg2 = self.tr("The following meshes are not in the meshes " \
+ "directory given in the 'Identity and paths' " \
+ "section:\n\n" +
+ msg +
+ "Verify existence and location of the mesh " \
+ "files, and the 'Identity and Paths' section." )
+ QMessageBox.warning(self, title, msg2)
+
+# for mesh in nameList:
+# format = self.mdl.getMeshFormat(mesh)
+# txt_format = self.dico_format[format]
+# self.modelMeshes.addRow(mesh, txt_format)
+
+ elif os.listdir(self.case['mesh_path']):
+ for mesh in os.listdir(self.case['mesh_path']):
+ if MeshModel().getMeshExtension(mesh):
+ format = self._meshFormatFromFileName(mesh)
+ self.modelMeshes.addRow(mesh, format)
+ self.mdl.addMesh(mesh, format)
+
+ self._tableViewLayout()
+
+
+ # 3.2) Join parameters
+
+ if self.mdl.getJoinMeshesStatus() == 'on':
+ self.groupBoxJoin.setChecked(True)
+ self.slotJoinMeshes(True)
+ else:
+ self.groupBoxJoin.setChecked(False)
+ self.slotJoinMeshes(False)
+
+ # 3.3) Warp faces cutting
+
+ if self.mdl.getCutStatus() == 'on':
+ self.groupBoxWarp.setChecked(True)
+ self.slotFacesCutting(True)
+ else:
+ self.groupBoxWarp.setChecked(False)
+ self.slotFacesCutting(False)
+
+ v = self.mdl.getCutAngle()
+ self.warp = v
+ self.lineEditWarp.setText(str(self.warp))
+
+ # 3.4) Reorientation
+
+ if self.mdl.getOrientation() == 'on':
+ self.groupBoxOrient.setChecked(True)
+ else:
+ self.groupBoxOrient.setChecked(False)
+
+
+ def setLink(self, fullfile):
+ """
+ Tab1: set link between asked file and case's directory 'MESH'
+ and keep dependance between file ena directory if destruction
+ """
+ name = os.path.basename(fullfile)
+ new_full = self.case['mesh_path'] + "/" + name
+ os.symlink(fullfile, new_full)
+
+
+ def _meshFormatFromFileName(self, mesh):
+ """
+ Tab1: return the format and the listbox name fo the given elementNode.
+ Put the format in attribute of the elementNode if necessary.
+ """
+ # Search the format of the mesh
+ format = MeshModel().getMeshFormat(mesh)
+
+ # If the format is not found ask to the user
+ if not format:
+ default = ""
+ dialog = SolutionDomainMeshFormatDialogView(self, default)
+ if dialog.exec_():
+ format = dialog.get_result()
+
+ return format
+
+
+ def _tableViewLayout(self):
+ """
+ Configure QTableView column number
+ """
+ format_list = []
+ for mesh in self.mdl.getMeshList():
+ format_list.append(self.mdl.getMeshFormat(mesh))
+
+ self.tableViewMeshes.resizeColumnsToContents()
+ self.tableViewMeshes.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
+
+ if "med" in format_list:
+ self.tableViewMeshes.setColumnHidden(2, False)
+ self.tableViewMeshes.horizontalHeader().setResizeMode(2, QHeaderView.Stretch)
+ else:
+ self.tableViewMeshes.setColumnHidden(2, True)
+
+ if "cgns" in format_list:
+ self.tableViewMeshes.setColumnHidden(3, False)
+ self.tableViewMeshes.setColumnHidden(4, False)
+ self.tableViewMeshes.horizontalHeader().setResizeMode(3, QHeaderView.ResizeToContents)
+ self.tableViewMeshes.horizontalHeader().setResizeMode(4, QHeaderView.ResizeToContents)
+ else:
+ self.tableViewMeshes.setColumnHidden(3, True)
+ self.tableViewMeshes.setColumnHidden(4, True)
+
+ if "med" not in format_list and "cgns" not in format_list:
+ self.tableViewMeshes.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
+ self.tableViewMeshes.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
+
+
+ def _addMeshInList(self, m):
+ """
+ Tab1: add input new meshes in the listbox and case.
+ """
+ input_meshes = string.split(m)
+ if not input_meshes: return
+
+ # 1) Verify if the all new meshes are the mesh_path directory.
+
+ for mesh in input_meshes:
+
+ if mesh not in os.listdir(self.case['mesh_path']):
+ title = self.tr("Warning")
+ msg = self.tr("The new mesh entry is not in meshes directory " \
+ "given in the 'Identity and paths' section." \
+ "One link is created in this directory.\n\n" \
+ "Verify existence and location of the meshes " \
+ "files, and the 'Identity and Pathes' section." )
+ QMessageBox.information(self, title, msg)
+
+ # 2) Verify that the new mesh is not allready in the case
+
+ for mesh in input_meshes:
+
+ if mesh in self.mdl.getMeshList():
+ title = self.tr("Warning")
+ msg = self.tr("Warning, the following input is already " \
+ "uploaded in the list:\n\n" + mesh)
+ QMessageBox.information(self, title, msg)
+
+ else:
+
+ # 3) Update View and model
+
+ format = self._meshFormatFromFileName(mesh)
+ if format:
+ self.modelMeshes.addRow(mesh, format)
+ self.mdl.addMesh(mesh, format)
+
+ self._tableViewLayout()
+
+
+ @pyqtSignature("")
+ def slotSearchMesh(self):
+ msg = self.tr("Select a mesh file (the file must be " \
+ "in the directory %s)."%self.case['mesh_path'])
+ self.stbar.showMessage(msg, 2000)
+
+ title = self.tr("New mesh")
+ if self.case['mesh_path'] and os.path.isdir(self.case['mesh_path']):
+ path = self.case['mesh_path']
+ else:
+ path = os.getcwd()
+
+ filetypes = ""
+ for Format in MeshModel().getFileFormatList():
+ filetypes += "%s (%s);;"%(Format[0], Format[1])
+
+ filt = "All files (*)"
+ file_name = QFileDialog.getOpenFileName(self, title, path, filetypes, filt)
+ file_name = str(file_name)
+
+ if file_name:
+ if os.path.dirname(file_name) != self.case['mesh_path']:
+ self.setLink(file_name)
+ msg = self.tr("Select a mesh file (the file must be " \
+ "in the directory %s)."%self.case['mesh_path'])
+ self.stbar.showMessage(msg, 2000)
+ m = os.path.basename(file_name)
+ self._addMeshInList(m)
+
+
+ @pyqtSignature("")
+ def slotDeleteMesh(self):
+ """
+ Delete the selected mesh from the list
+ """
+ # 1) Is there a mesh to delete ?
+
+ selectionModel = self.tableViewMeshes.selectionModel()
+ for index in selectionModel.selectedRows():
+ row = index.row()
+ mesh = self.modelMeshes.getName(row)
+
+ # 2) Delete mesh from view and from model
+
+ self.modelMeshes.deleteRow(row)
+ self.mdl.delMesh(mesh)
+
+ self._tableViewLayout()
+
+
+ @pyqtSignature("bool")
+ def slotJoinMeshes(self, checked):
+ """
+ Private slot.
+
+ Do we join any meshes ?
+
+ @type checked: C{True} or C{False}
+ @param checked: if C{True}, shows the QGroupBox join parameters
+ """
+ self.groupBoxJoin.setFlat(not checked)
+ if checked:
+ self.mdl.setJoinMeshesStatus("on")
+ self.frameJoin.show()
+ else:
+ self.mdl.setJoinMeshesStatus("off")
+ self.frameJoin.hide()
+
+
+ @pyqtSignature("bool")
+ def slotFacesCutting(self, checked):
+ """
+ Private slot.
+
+ Do we cut any warp faces ?
+
+ @type checked: C{True} or C{False}
+ @param checked: if C{True}, shows the QGroupBox warp parameters
+ """
+ self.groupBoxWarp.setFlat(not checked)
+ if checked:
+ self.mdl.setCutStatus("on")
+ self.frameWarp.show()
+ else:
+ self.mdl.setCutStatus("off")
+ self.frameWarp.hide()
+
+
+ @pyqtSignature("bool")
+ def slotOrientation(self, checked):
+ """
+ Private slot.
+
+ Do we cut any warp faces ?
+
+ @type checked: C{True} or C{False}
+ @param checked: if C{True}, shows the QGroupBox warp parameters
+ """
+ #self.groupBoxOrient.setFlat(not checked)
+ if checked:
+ self.mdl.setOrientation ("on")
+ else:
+ self.mdl.setOrientation("off")
+
+
+ @pyqtSignature("const QString&")
+ def slotWarpParam(self, text):
+ """
+ Private slot.
+
+ Input '--cwf' parameters.
+
+ @type text: C{QString}
+ @param text: max angle of warped faces
+ """
+ var, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setCutAngle(var)
+
+
+ @pyqtSignature("")
+ def slotAddPeriodicity(self):
+ """
+ Add a periodicity in the list.
+ """
+ self.modelPeriod.addRow()
+
+
+ @pyqtSignature("")
+ def slotDeletePeriodicity(self):
+ """
+ Delete a periodicity from the list.
+ """
+ self.groupBoxMode.hide()
+ self.groupBoxFaces.hide()
+ self.groupBoxTranslation.hide()
+ self.groupBoxRotation1.hide()
+ self.groupBoxRotation2.hide()
+
+ for index in self.treeViewPeriod.selectionModel().selectedIndexes():
+ self.modelPeriod.deleteRow(index.row())
+ break
+
+
+ def __setValuesTranslation(self, perio_name):
+ """
+ Put values found in xml file as soon as mode is "translation"
+ """
+ dx, dy, dz = self.mdl.getTranslationDirection(perio_name)
+
+ self.lineEditTX.setText(QString(dx))
+ self.lineEditTY.setText(QString(dy))
+ self.lineEditTZ.setText(QString(dz))
+
+
+ def __setValuesRotation1(self, perio_name):
+ """
+ Put values found in xml file as soon as mode is "rotation1"
+ """
+ angle = self.mdl.getRotationAngle(perio_name)
+ rx, ry, rz = self.mdl.getRotationDirection(perio_name)
+ px, py, pz = self.mdl.getRotationCenter(perio_name)
+
+ self.lineEditAngle.setText(QString((angle)))
+ self.lineEditDX.setText(QString(rx))
+ self.lineEditDY.setText(QString(ry))
+ self.lineEditDZ.setText(QString(rz))
+ self.lineEditX1.setText(QString(px))
+ self.lineEditY1.setText(QString(py))
+ self.lineEditZ1.setText(QString(pz))
+
+
+ def __setValuesRotation2(self, perio_name):
+ """
+ Put values found in xml file as soon as mode is "rotation"2
+ """
+ m11,m12,m13,m21,m22,m23,m31,m32,m33 = self.mdl.getRotationMatrix(perio_name)
+ px, py, pz = self.mdl.getRotationCenter(perio_name)
+
+ self.lineEditM11.setText(QString(m11))
+ self.lineEditM12.setText(QString(m12))
+ self.lineEditM13.setText(QString(m13))
+ self.lineEditM21.setText(QString(m21))
+ self.lineEditM22.setText(QString(m22))
+ self.lineEditM23.setText(QString(m23))
+ self.lineEditM31.setText(QString(m31))
+ self.lineEditM32.setText(QString(m32))
+ self.lineEditM33.setText(QString(m33))
+ self.lineEditX2.setText(QString(px))
+ self.lineEditY2.setText(QString(py))
+ self.lineEditZ2.setText(QString(pz))
+
+
+ def __setValuesPeriodicTransformation(self, perio, mode):
+ """
+ Put values found in xml file as soon as mode of
+ transformation is choosen
+ """
+ log.debug("__setValuesPeriodicTransformation perio mode = %s %s "% (perio, mode))
+ if mode == "translation" :
+ self.__setValuesTranslation(perio)
+ if mode == "rotation1":
+ self.__setValuesRotation1(perio)
+ if mode == "rotation2":
+ self.__setValuesRotation2(perio)
+ if mode == "tr+rota1":
+ self.__setValuesTranslation(perio)
+ self.__setValuesRotation1(perio)
+ if mode == "tr+rota2":
+ self.__setValuesTranslation(perio)
+ self.__setValuesRotation2(perio)
+
+
+ @pyqtSignature("const QModelIndex&")
+ def slotUpdatePeriodicity(self, index):
+ """
+ This slot update the display for the periodicity selected
+ in the tree view.
+ """
+ log.debug("slotUpdatePeriodicity index.row() = %i " % index.row())
+
+ self.groupBoxMode.show()
+ self.groupBoxFaces.show()
+
+ perio_name = self.mdl.getPeriodicityListName()[index.row()]
+ perio_mode = self.mdl.getPeriodicityMode(perio_name)
+ self.perio_name = perio_name
+ self.perio_mode = perio_mode
+
+ self.modelComboPeriod.setItem(str_model=perio_mode)
+ txt = str(self.comboBoxPeriodicity.currentText())
+ self.slotPeriodicityMode(txt)
+
+ # Update FaceSelection
+# self.widgetFacesPeriodic.setPeriodicityName(perio_name)
+# self.widgetFacesPeriodic.populateModel(self.mdl, 'faces_periodic')
+ model = StandardItemModelFaces(self, self.mdl, 'faces_periodic', perio_name)
+ self.widgetFacesPeriodic.modelFaces = model
+ self.widgetFacesPeriodic.tableView.setModel(model)
+
+ @pyqtSignature("const QString&")
+ def slotPeriodicityMode(self, text):
+ """
+ Do we have a periodicity ?
+ """
+ self.perio_mode = self.modelComboPeriod.dicoV2M[str(text)]
+ #perio_number = self.treeViewPeriod.currentIndex().row()
+ #self.perio_number = str(perio_number+1)
+
+ log.debug("slotPeriodicityMode = %s " % self.perio_mode)
+
+ self.mdl.updatePeriodicityMode(self.perio_name, self.perio_mode)
+
+ # exit if no periodicity
+# if self.perio_number == "0":
+# log.debug("slotPeriodicityMode -> no periodicity ")
+# return
+
+ self.groupBoxTranslation.hide()
+ self.groupBoxRotation1.hide()
+ self.groupBoxRotation2.hide()
+
+ if self.perio_mode == "":
+ self.modelComboPeriod(str_model='translation')
+ self.__setValuesTranslation(self.perio_name)
+
+ if self.perio_mode == "translation":
+ self.groupBoxTranslation.show()
+ self.groupBoxRotation1.hide()
+ self.groupBoxRotation2.hide()
+ self.__setValuesTranslation(self.perio_name)
+
+ elif self.perio_mode == "rotation1":
+ self.groupBoxTranslation.hide()
+ self.groupBoxRotation1.show()
+ self.groupBoxRotation2.hide()
+ self.__setValuesRotation1(self.perio_name)
+
+ elif self.perio_mode == "rotation2":
+ self.groupBoxTranslation.hide()
+ self.groupBoxRotation1.hide()
+ self.groupBoxRotation2.show()
+ self.__setValuesRotation2(self.perio_name)
+
+ elif self.perio_mode == "tr+rota1":
+ self.groupBoxTranslation.show()
+ self.groupBoxRotation1.show()
+ self.groupBoxRotation2.hide()
+ self.__setValuesTranslation(self.perio_name)
+ self.__setValuesRotation1(self.perio_name)
+
+ elif self.perio_mode == "tr+rota2":
+ self.groupBoxTranslation.show()
+ self.groupBoxRotation1.hide()
+ self.groupBoxRotation2.show()
+ self.__setValuesTranslation(self.perio_name)
+ self.__setValuesRotation2(self.perio_name)
+
+# self.mdl.addPeriodicity(self.perio_name, self.perio_mode)
+ self.__setValuesPeriodicTransformation(self.perio_name, self.perio_mode)
+
+
+ @pyqtSignature("const QString&")
+ def slotTranslationX(self, text):
+ """
+ Periodicity translation for X
+ """
+ if self.perio_mode != "rotation1" or self.perio_mode != "rotation2":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setTranslationDirection(self.perio_name, 'translation_x', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotTranslationY(self, text):
+ """
+ Periodicity translation for Y
+ """
+ if self.perio_mode != "rotation1" or self.perio_mode != "rotation2":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setTranslationDirection(self.perio_name, 'translation_y', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotTranslationZ(self, text):
+ """
+ Periodicity translation for Z
+ """
+ if self.perio_mode != "rotation1" or self.perio_mode != "rotation2":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setTranslationDirection(self.perio_name, 'translation_z', val)
+
+
+ @pyqtSignature("const QString&")
+ def slotAngleRotation(self, text):
+ """
+ Periodicity rotation angle
+ """
+ if self.perio_mode == "rotation1" or self.perio_mode == "tr+rota1":
+ angle, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationAngle(self.perio_name, angle)
+
+
+ @pyqtSignature("const QString&")
+ def slotRotationX(self, text):
+ """
+ Periodicity rotation for X
+ """
+ if self.perio_mode == "rotation1" or self.perio_mode =="tr+rota1":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationVector(self.perio_name, "rotation_x", val)
+
+
+ @pyqtSignature("const QString&")
+ def slotRotationY(self, text):
+ """
+ Periodicity rotation for Y
+ """
+ if self.perio_mode == "rotation1" or self.perio_mode =="tr+rota1":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationVector(self.perio_name, "rotation_y", val)
+
+
+ @pyqtSignature("const QString&")
+ def slotRotationZ(self, text):
+ """
+ Periodicity rotation for Z
+ """
+ if self.perio_mode == "rotation1" or self.perio_mode =="tr+rota1":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationVector(self.perio_name, "rotation_z", val)
+
+
+ @pyqtSignature("const QString&")
+ def slotCenterRotationX1(self, text):
+ """
+ Periodicity : center of rotation
+ """
+ if self.perio_mode != "translation":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationCenter(self.perio_name, "rotation_center_x", val)
+
+
+ @pyqtSignature("const QString&")
+ def slotCenterRotationY1(self, text):
+ """
+ Periodicity : center of rotation
+ """
+ if self.perio_mode != "translation":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationCenter(self.perio_name, "rotation_center_y", val)
+
+
+ @pyqtSignature("const QString&")
+ def slotCenterRotationZ1(self, text):
+ """
+ Periodicity : center of rotation
+ """
+ if self.perio_mode != "translation":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationCenter(self.perio_name, "rotation_center_z", val)
+
+
+ # Methods for matrix components
+ @pyqtSignature("const QString&")
+ def slotMatrix11(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_11", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix12(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_12", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix13(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_13", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix21(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_21", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix22(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_22", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix23(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_23", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix31(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_31", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix32(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_32", text)
+
+
+ @pyqtSignature("const QString&")
+ def slotMatrix33(self, text):
+ self.__cmdMatrixRotation("rotation_matrix_33", text)
+
+
+ def __cmdMatrixRotation(self, pos, text):
+ """
+ Periodicity translation
+ """
+ if self.perio_mode == "rotation2" or self.perio_mode == "tr+rota2":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationMatrix(self.perio_name, pos, val)
+
+
+ @pyqtSignature("const QString&")
+ def slotCenterRotationX2(self, text):
+ """
+ Periodicity : center of rotation
+ """
+ if self.perio_mode != "translation":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationCenter(self.perio_name, "rotation_center_x", val)
+
+
+ @pyqtSignature("const QString&")
+ def slotCenterRotationY2(self, text):
+ """
+ Periodicity : center of rotation
+ """
+ if self.perio_mode != "translation":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationCenter(self.perio_name, "rotation_center_y", val)
+
+
+ @pyqtSignature("const QString&")
+ def slotCenterRotationZ2(self, text):
+ """
+ Periodicity : center of rotation
+ """
+ if self.perio_mode != "translation":
+ val, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRotationCenter(self.perio_name, "rotation_center_z", val)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/SolutionVerifForm.ui b/gui/Pages/SolutionVerifForm.ui
new file mode 100644
index 0000000..2b429a7
--- /dev/null
+++ b/gui/Pages/SolutionVerifForm.ui
@@ -0,0 +1,383 @@
+<ui version="4.0" >
+ <class>SolutionVerifForm</class>
+ <widget class="QWidget" name="SolutionVerifForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>369</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Mesh quality criteria</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Post-processing format</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxFMTCHR" >
+ <property name="minimumSize" >
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxOptions" >
+ <property name="title" >
+ <string>Options</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelformat" >
+ <property name="text" >
+ <string>format</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="comboBoxFormat" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelPolygon" >
+ <property name="text" >
+ <string>polygons</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="comboBoxPolygon" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelPolyhedra" >
+ <property name="text" >
+ <string>polyhedra</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QComboBox" name="comboBoxPolyhedra" >
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelBigEndian" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="text" >
+ <string>big-endian</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QCheckBox" name="checkBoxBigEndian" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: OPTCHR</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBoxFaces" >
+ <property name="title" >
+ <string>Interior faces selection for post-processing</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item rowspan="2" row="0" column="0" colspan="2" >
+ <widget class="QFrame" name="frameFaces" >
+ <property name="minimumSize" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer name="horizontalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Criterion for interior faces selection (optional)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="FacesSelectionView" native="1" name="widgetFacesSelect" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonBatch" >
+ <property name="text" >
+ <string>Check mesh</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>41</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>FacesSelectionView</class>
+ <extends>QWidget</extends>
+ <header location="global" >FacesSelectionView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/SolutionVerifView.py b/gui/Pages/SolutionVerifView.py
new file mode 100644
index 0000000..b76e69d
--- /dev/null
+++ b/gui/Pages/SolutionVerifView.py
@@ -0,0 +1,544 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following class:
+- SolutionVerifView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import os, logging, subprocess
+import string, shutil, cStringIO
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel
+from Base.XMLengine import Case
+from Base.XMLinitialize import XMLinit
+from SolutionVerifForm import Ui_SolutionVerifForm
+from MeshQualityCriteriaLogDialogForm import Ui_MeshQualityCriteriaLogDialogForm
+from Pages.SolutionDomainModel import SolutionDomainModel
+from OutputControlModel import OutputControlModel
+from FacesSelectionView import StandardItemModelFaces
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("SolutionVerifView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+
+class MeshQualityCriteriaLogDialogView(QDialog, Ui_MeshQualityCriteriaLogDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, case, case2):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_MeshQualityCriteriaLogDialogForm.__init__(self)
+ self.setupUi(self)
+ self.setWindowTitle(self.tr("Run mesh quality criteria"))
+ self.pushButton.setEnabled(False)
+
+ self.case = case
+ self.case2 = case2
+ self.mdl = SolutionDomainModel(self.case)
+ self.out2 = OutputControlModel(self.case2)
+
+ self.proc = QProcess()
+ self.connect(self.proc, SIGNAL('readyReadStandardOutput()'), self.__readFromStdout)
+ self.connect(self.proc, SIGNAL('readyReadStandardError()'), self.__readFromStderr)
+ self.procErrorFlag = False
+
+ self.cwd = os.getcwd()
+ os.chdir(self.case['resu_path'])
+ self.fmt = string.join(string.split(self.__getPostCommand()))
+
+ self.__ecsProcess()
+
+
+ def __ecsProcess(self):
+ # Run Preprocessor
+
+ lines = []
+ lines.append(self.mdl.getMeshCommand())
+ lines.append(self.mdl.getJoinCommand())
+ lines.append(self.mdl.getPerioCommand())
+ lines.append(self.mdl.getSelectCommand())
+ lines.append(self.__getPostCommand())
+ lines.append(" --case check_mesh ")
+ log.debug("ecs_cmd = %s" % lines)
+
+ f1 = 'ecs_cmd'
+ f = open(f1, 'w')
+ f.writelines(lines)
+ f.close()
+
+ ecs = "cs_preprocess "
+ args = ' --in ' + f1
+ self.proc.start(ecs + args)
+
+ self.connect(self.proc, SIGNAL('finished(int, QProcess::ExitStatus)'), self.__ecsPostTreatment)
+
+
+ def __ecsPostTreatment(self):
+ if self.proc.exitStatus() == QProcess.NormalExit and not self.procErrorFlag:
+ if self.fmt == "--ensight":
+ os.chdir(self.case['resu_path'] + '/check_mesh.ensight')
+ os.rename('CHR.case', 'PREPROCESSOR.case')
+ os.rename('chr.geo', 'preprocessor.geo')
+
+ out = cStringIO.StringIO()
+ f = open('PREPROCESSOR.case')
+ for line in f:
+ print >> out, line.replace('chr', 'preprocessor'),
+ f.close()
+ out2 = open('PREPROCESSOR.case', 'w')
+ out2.write(out.getvalue())
+ out2.close()
+
+ os.chdir(self.case['resu_path'])
+
+ elif self.fmt == "--med":
+ os.rename('check_mesh.med', 'PREPROCESSOR.med')
+
+ elif self.fmt == "--cgns":
+ os.rename('check_mesh.cgns', 'PREPROCESSOR.cgns')
+
+ if os.path.isfile(self.case['resu_path'] + '/preprocessor_output'):
+ self.__csProcess()
+ else:
+ self.__finished()
+
+ else:
+ self.__finished()
+
+
+
+ def __csProcess(self):
+ # Run Kernel
+ self.disconnect(self.proc, SIGNAL('finished(int, QProcess::ExitStatus)'), self.__ecsPostTreatment)
+
+ self.case2.xmlSaveDocument()
+ cs = "cs_solver --quality --log 0 "
+ args = ' --param ' + self.case2['xmlfile']
+ self.proc.start(cs + args)
+
+ self.connect(self.proc, SIGNAL('finished(int, QProcess::ExitStatus)'), self.__csPostTreatment)
+
+
+ def __csPostTreatment(self):
+ if self.proc.exitStatus() == QProcess.NormalExit and not self.procErrorFlag:
+ if self.fmt == "--ensight":
+ for src in os.listdir(self.case['resu_path'] + '/chr.ensight'):
+ shutil.copy(self.case['resu_path'] + '/chr.ensight/' + src,
+ self.case['resu_path'] + '/check_mesh.ensight')
+ os.chdir(self.case['resu_path'] + '/check_mesh.ensight')
+ os.rename('CHR.case', 'QUALITY.case')
+
+ for src in os.listdir(self.case['resu_path'] + '/check_mesh.ensight'):
+ if src[:4] == "chr.":
+ dst = src.replace("chr.", "quality.")
+ os.rename(src, dst)
+
+ out = cStringIO.StringIO()
+ f = open('QUALITY.case')
+ for line in f:
+ print >> out, line.replace('chr', 'quality'),
+ f.close()
+ out2 = open('QUALITY.case', 'w')
+ out2.write(out.getvalue())
+ out2.close()
+
+ shutil.rmtree(self.case['resu_path'] + '/chr.ensight')
+ os.chdir(self.case['resu_path'])
+
+ elif self.fmt == "--med":
+ os.rename('chr.med', 'QUALITY.med')
+
+ elif self.fmt == "--cgns":
+ os.rename('chr.cgns', 'QUALITY.cgns')
+
+ # Cleanup
+ os.remove('preprocessor_output')
+ os.remove('cs_cmd')
+ os.remove('ecs_cmd')
+
+ self.__saveLog()
+ self.__finished()
+
+
+ def __getPostCommand(self):
+ """
+ Return the preprocessor argument for postprocessing.
+ """
+ format = self.out2.getPostProFormat()
+ if format == "EnSight":
+ l = " --ensight "
+ elif format == "MED_fichier":
+ l = " --med "
+ elif format == "CGNS":
+ l = " --cgns "
+ return l
+
+
+ def __readFromStdout(self):
+ """
+ Private slot to handle the readyReadStandardOutput signal of the process.
+ """
+ if self.proc is None:
+ return
+ self.proc.setReadChannel(QProcess.StandardOutput)
+
+ while self.proc and self.proc.canReadLine():
+ ba = self.proc.readLine()
+ if ba.isNull(): return
+ str = QString()
+ s = QString(str.fromUtf8(ba.data()))[:-1]
+ self.logText.append(s)
+
+
+ def __readFromStderr(self):
+ """
+ Private slot to handle the readyReadStandardError signal of the process.
+ """
+ if self.proc is None:
+ return
+ self.proc.setReadChannel(QProcess.StandardError)
+
+ while self.proc and self.proc.canReadLine():
+ ba = self.proc.readLine()
+ if ba.isNull(): return
+ str = QString()
+ s = QString(str.fromUtf8(ba.data()))[:-1]
+ self.logText.append(s.prepend('<font color="red">').append('</font>'))
+ self.procErrorFlag = True
+
+
+ def __saveLog(self):
+ fileName = QFileDialog.getSaveFileName(self,
+ self.tr("Save File As"),
+ self.case['resu_path'],
+ self.tr("Mesh quality criteria listing (listpre.*);;All files (*)"))
+ if fileName.isEmpty(): return
+ try:
+ logFile = open(str(fileName), 'w')
+ except:
+ QMessageBox.warning(self, 'Error', 'Could not open file for writing')
+ return
+ logFile.write(str(self.logText.toPlainText().toAscii()))
+ logFile.close()
+
+
+ def __finished(self):
+ os.chdir(self.cwd)
+ self.pushButton.setEnabled(True)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class SolutionVerifView(QWidget, Ui_SolutionVerifForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_SolutionVerifForm.__init__(self)
+ self.setupUi(self)
+
+ self.parent = parent
+ self.case = case
+ self.mdl = SolutionDomainModel(self.case)
+ self.out = OutputControlModel(self.case)
+
+ self.case2 = Case(None)
+ XMLinit(self.case2)
+ self.case2['xmlfile'] = 'cs_cmd'
+ self.out2 = OutputControlModel(self.case2)
+
+ # combo models
+ self.modelFMTCHR = ComboModel(self.comboBoxFMTCHR, 3, 1)
+ self.modelFormat = ComboModel(self.comboBoxFormat, 2, 1)
+ self.modelPolygon = ComboModel(self.comboBoxPolygon, 3, 1)
+ self.modelPolyhedra = ComboModel(self.comboBoxPolyhedra, 3, 1)
+
+ self.modelFMTCHR.addItem(self.tr("EnSight Gold"), 'EnSight')
+ self.modelFMTCHR.addItem(self.tr("MED"), 'MED_fichier')
+ self.modelFMTCHR.addItem(self.tr("CGNS"), 'CGNS')
+
+ self.modelFormat.addItem(self.tr("binary"), 'binary')
+ self.modelFormat.addItem(self.tr("text"), 'text')
+
+ self.modelPolygon.addItem(self.tr("display"), 'display')
+ self.modelPolygon.addItem(self.tr("discard"), 'discard_polygons')
+ self.modelPolygon.addItem(self.tr("subdivide"), 'divide_polygons')
+
+ self.modelPolyhedra.addItem(self.tr("display"), 'display')
+ self.modelPolyhedra.addItem(self.tr("discard"), 'discard_polyhedra')
+ self.modelPolyhedra.addItem(self.tr("subdivide"), 'divide_polyhedra')
+
+ # connections
+
+ self.connect(self.groupBoxFaces, SIGNAL("clicked(bool)"), self.slotInterneFacesPostPro)
+ self.connect(self.comboBoxFMTCHR, SIGNAL("activated(const QString&)"), self.slotOutputFormat)
+ self.connect(self.comboBoxFormat, SIGNAL("activated(const QString&)"), self.slotOutputOptions)
+ self.connect(self.comboBoxPolygon, SIGNAL("activated(const QString&)"), self.slotOutputOptions)
+ self.connect(self.comboBoxPolyhedra, SIGNAL("activated(const QString&)"), self.slotOutputOptions)
+ self.connect(self.checkBoxBigEndian, SIGNAL("clicked()"), self.slotOutputOptions)
+ self.connect(self.toolButtonBatch, SIGNAL("clicked()"), self.slotMeshChecking)
+
+ # Faces for selection (Custom Widgets)
+
+ model = StandardItemModelFaces(self, self.mdl, 'faces_select')
+ self.widgetFacesSelect.modelFaces = model
+ self.widgetFacesSelect.tableView.setModel(model)
+
+ # INITIALISATIONS
+ # 1 - Visualization faces parameters
+
+ if self.mdl.getSelectStatus() == 'on':
+ self.groupBoxFaces.setChecked(True)
+ self.slotInterneFacesPostPro(True)
+ else:
+ self.groupBoxFaces.setChecked(False)
+ self.slotInterneFacesPostPro(False)
+
+ # 2 - Values of post processing's format
+
+ fmt = self.out.getPostProFormat()
+ self.modelFMTCHR.setItem(str_model=fmt)
+ line = self.out.getPostProOptionsFormat()
+ self.__updateOptionsFormat(line)
+
+ if not self.mdl.getMeshList():
+ self.toolButtonBatch.setEnabled(False)
+
+
+ @pyqtSignature("bool")
+ def slotInterneFacesPostPro(self, checked):
+ """
+ Private slot.
+
+ Do we join any meshes ?
+
+ @type checked: C{True} or C{False}
+ @param checked: if C{True}, shows the QGroupBox join parameters
+ """
+ self.groupBoxFaces.setFlat(not checked)
+ if checked:
+ self.mdl.setSelectStatus("on")
+ self.frameFaces.show()
+ else:
+ self.mdl.setSelectStatus("off")
+ self.frameFaces.hide()
+
+
+ @pyqtSignature("const QString &")
+ def slotOutputFormat(self, text):
+ """
+ Input format of post-processing
+ """
+ format = self.modelFMTCHR.dicoV2M[str(text)]
+
+ if self.out.getPostProFormat() != format:
+ self.out.setPostProFormat(format)
+ l = self.out.defaultInitialValues()['postprocessing_options']
+ self.out.setPostProOptionsFormat(l)
+
+ if self.out2.getPostProFormat() != format:
+ self.out2.setPostProFormat(format)
+ l = self.out2.defaultInitialValues()['postprocessing_options']
+ self.out2.setPostProOptionsFormat(l)
+ self.__updateOptionsFormat(l)
+
+
+ @pyqtSignature("")
+ def slotOutputOptions(self):
+ """
+ Create characters ligne for command of format's options
+ """
+ line = []
+ opt_format = self.modelFormat.dicoV2M[str(self.comboBoxFormat.currentText())]
+ line.append(opt_format)
+
+ if self.checkBoxBigEndian.isChecked():
+ line.append('big_endian')
+
+ opt_polygon = self.modelPolygon.dicoV2M[str(self.comboBoxPolygon.currentText())]
+ opt_polyhed = self.modelPolyhedra.dicoV2M[str(self.comboBoxPolyhedra.currentText())]
+ if opt_polygon != 'display': line.append(opt_polygon)
+ if opt_polyhed != 'display': line.append(opt_polyhed)
+
+ l = string.join(line, ',')
+ log.debug("slotOutputOptions-> OPTCHR = %s" % l)
+ self.out.setPostProOptionsFormat(l)
+ self.out2.setPostProOptionsFormat(l)
+
+
+ def __updateOptionsFormat(self, line):
+ """
+ Update ligne for command of format's options at each modification of
+ post processing format
+ """
+ list = string.split(line, ',')
+ format = self.modelFMTCHR.dicoV2M[str(self.comboBoxFMTCHR.currentText())]
+ log.debug("__updateOptionsFormat-> FMTCHR = %s" % format)
+ log.debug("__updateOptionsFormat-> OPTCHR = %s" % line)
+
+ # update widgets from the options list
+
+ for opt in list:
+
+ if opt == 'binary' or opt == 'text' :
+ self.modelFormat.setItem(str_model=opt)
+
+ if opt == 'discard_polygons' or opt == 'divide_polygons':
+ self.modelPolygon.setItem(str_model=opt)
+
+ if opt == 'discard_polyhedra' or opt == 'divide_polyhedra':
+ self.modelPolyhedra.setItem(str_model=opt)
+
+ if format == 'EnSight':
+ if opt == 'big_endian':
+ self.checkBoxBigEndian.setChecked(True)
+## if opt == 'split_tensors':
+## self.opt_splittens.set('on')
+
+ if 'discard_polygons' not in list and 'divide_polygons' not in list:
+ self.modelPolygon.setItem(str_model="display")
+ if 'discard_polyhedra' not in list and 'divide_polyhedra' not in list:
+ self.modelPolyhedra.setItem(str_model="display")
+ if 'big_endian' not in list:
+ self.checkBoxBigEndian.setChecked(False)
+## if 'split_tensors' not in list:
+## self.opt_splittens.set('off')
+
+ # enable and disable options related to the format
+
+ if format != "EnSight":
+
+ if format == "CGNS":
+ self.modelPolyhedra.setItem(str_model='divide_polyhedra')
+ self.modelPolyhedra.disableItem(str_model='display')
+
+ self.modelFormat.setItem(str_model="binary")
+ self.modelFormat.disableItem(str_model='text')
+ self.labelBigEndian.setEnabled(False)
+ self.checkBoxBigEndian.setEnabled(False)
+ else:
+ self.modelFormat.enableItem(str_model='text')
+ self.comboBoxFormat.setEnabled(True)
+ self.labelBigEndian.setEnabled(True)
+ self.checkBoxBigEndian.setEnabled(True)
+ self.modelPolyhedra.enableItem(str_model='display')
+ self.comboBoxPolyhedra.setEnabled(True)
+
+
+ def __getPostCommand(self):
+ """
+ Return the preprocessor argument for postprocessing.
+ """
+ format = self.out2.getPostProFormat()
+ if format == "EnSight":
+ l = " --ensight "
+ elif format == "MED_fichier":
+ l = " --med "
+ elif format == "CGNS":
+ l = " --cgns "
+ return l
+
+
+ def __setButtonEnabled(self):
+ """
+ Block the QButton during the display of the dialog.
+ """
+ try:
+ self.toolButtonBatch.setEnabled(not self.toolButtonBatch.isEnabled())
+ except:
+ pass
+
+
+ def slotMeshChecking(self):
+ """
+ """
+ self.__setButtonEnabled()
+ dialog = MeshQualityCriteriaLogDialogView(self.parent, self.case, self.case2)
+ dialog.show()
+ self.connect(dialog, SIGNAL("accepted()"), self.__setButtonEnabled)
+ self.connect(dialog, SIGNAL("rejected()"), self.__setButtonEnabled)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/StartRestartAdvancedDialogForm.ui b/gui/Pages/StartRestartAdvancedDialogForm.ui
new file mode 100644
index 0000000..e1990ed
--- /dev/null
+++ b/gui/Pages/StartRestartAdvancedDialogForm.ui
@@ -0,0 +1,191 @@
+<ui version="4.0" >
+ <class>StartRestartAdvancedDialogForm</class>
+ <widget class="QDialog" name="StartRestartAdvancedDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>336</width>
+ <height>202</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxRestart" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelILEAUX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ILEAUX</string>
+ </property>
+ <property name="text" >
+ <string>Read the auxiliary restart file
+at the begin of the calculation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxReadAuxFile" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ILEAUX</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBoxFreq" >
+ <property name="title" >
+ <string>Frequency of restart checkpoints</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QComboBox" name="comboBoxFreq" >
+ <property name="minimumSize" >
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NSUIT</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditNSUIT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NSUIT</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>StartRestartAdvancedDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>StartRestartAdvancedDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/StartRestartForm.ui b/gui/Pages/StartRestartForm.ui
new file mode 100644
index 0000000..9d287e3
--- /dev/null
+++ b/gui/Pages/StartRestartForm.ui
@@ -0,0 +1,421 @@
+<ui version="4.0" >
+ <class>StartRestartForm</class>
+ <widget class="QWidget" name="StartRestartForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>236</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Start/Restart</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QFrame" name="frameRestart" >
+ <property name="minimumSize" >
+ <size>
+ <width>380</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" colspan="2" >
+ <widget class="QLabel" name="label" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISUITE</string>
+ </property>
+ <property name="text" >
+ <string>Calculation restart:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QRadioButton" name="radioButtonYes" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISUITE</string>
+ </property>
+ <property name="text" >
+ <string>on</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QRadioButton" name="radioButtonNo" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ISUITE</string>
+ </property>
+ <property name="text" >
+ <string>off</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QToolButton" name="toolButton" >
+ <property name="toolTip" >
+ <string>Selection of the restart directory and
+creation of the symbolic link in the DATA directory</string>
+ </property>
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/document-open.png</normaloff>:/new/prefix1/icons/22x22/document-open.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelDir1" >
+ <property name="text" >
+ <string>RESTART:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" colspan="3" >
+ <widget class="QLabel" name="labelDir2" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>80</width>
+ <height>25</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QFrame" name="frameFrozen" >
+ <property name="minimumSize" >
+ <size>
+ <width>380</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ICCVFG</string>
+ </property>
+ <property name="text" >
+ <string>Calculation on frozen velocity and pressure fields</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="Line" name="lineICCVFG" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QFrame" name="frameAdvanced" >
+ <property name="minimumSize" >
+ <size>
+ <width>380</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Advanced options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonAdvanced" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/preferences-system.png</normaloff>:/new/prefix1/icons/22x22/preferences-system.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="shortcut" >
+ <string>Ctrl+S</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections>
+ <connection>
+ <sender>radioButtonYes</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>frameFrozen</receiver>
+ <slot>show()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>318</x>
+ <y>121</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>78</x>
+ <y>270</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>radioButtonNo</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>frameFrozen</receiver>
+ <slot>hide()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>365</x>
+ <y>121</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>478</x>
+ <y>307</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>radioButtonNo</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>toolButton</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>365</x>
+ <y>121</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>397</x>
+ <y>122</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>radioButtonYes</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>toolButton</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>318</x>
+ <y>121</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>397</x>
+ <y>122</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>radioButtonYes</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>lineICCVFG</receiver>
+ <slot>show()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>244</x>
+ <y>46</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>224</x>
+ <y>129</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>radioButtonNo</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>lineICCVFG</receiver>
+ <slot>hide()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>286</x>
+ <y>46</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>224</x>
+ <y>129</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/StartRestartModel.py b/gui/Pages/StartRestartModel.py
new file mode 100644
index 0000000..31df64c
--- /dev/null
+++ b/gui/Pages/StartRestartModel.py
@@ -0,0 +1,394 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the 'Start/Restart' page.
+
+This module defines the following classes:
+- StartRestartModel
+- StartRestartTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, string, types
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Model
+from Base.XMLmodel import ModelTest
+
+#-------------------------------------------------------------------------------
+# Start-Restart model class
+#-------------------------------------------------------------------------------
+
+class StartRestartModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Start and Restart
+ """
+ def __init__(self, case):
+ """
+ Constuctor.
+ """
+ self.case = case
+ node_magt = self.case.xmlInitNode('calcul_management')
+ self.node_start = node_magt.xmlInitNode('start_restart')
+
+
+ def _defaultStartRestartValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['restart'] = "off"
+ default['frozen_field'] = "off"
+ default['restart_with_auxiliary'] = "on"
+## default['main_restart'] = "binary"
+## default['auxiliary_restart'] = "binary"
+ default['restart_rescue'] = 0
+ default['period_rescue'] = "4 output"
+ return default
+
+
+ def _updateStartRestart(self):
+ """
+ If we don't continue calculation, TimeAveragesModel must to know
+ """
+ from TimeAveragesModel import TimeAveragesModel
+ ta_mdl = TimeAveragesModel(self.case)
+ for id in ta_mdl.getAverageList():
+ if ta_mdl.getAverageRestart(id) != '':
+ node_anal = self.case.xmlInitNode('analysis_control')
+ node_mean = node_anal.xmlInitNode('time_averages')
+ n = node_mean.xmlGetNode('time_average', id=id)
+ n.xmlRemoveChild('restart_from_time_average')
+ del TimeAveragesModel
+
+
+ def getRestart(self):
+ """
+ Return if this calcul is restarted with a restart file
+ """
+ node = self.node_start.xmlInitNode('restart', 'status')
+ restart = node['status']
+ if not restart:
+ restart = self._defaultStartRestartValues()['restart']
+ self.setRestart(restart)
+ return restart
+
+
+ def setRestart(self, v):
+ """
+ Set status if we continue calculation or not
+ """
+ self.isOnOff(v)
+ node = self.node_start.xmlInitNode('restart', 'status')
+ node['status'] = v
+ if v == 'off':
+ self._updateStartRestart()
+ self.node_start.xmlRemoveChild('current_restart')
+
+
+ def getFrozenField(self):
+ """
+ Return if the velocity and the pressure are solved
+ """
+ node = self.node_start.xmlInitNode('frozen_field', 'status')
+ status = node['status']
+ if not status:
+ v = self._defaultStartRestartValues()['frozen_field']
+ self.setFrozenField(v)
+ return status
+
+
+ def setFrozenField(self, v):
+ """
+ """
+ self.isOnOff(v)
+ node = self.node_start.xmlInitNode('frozen_field', 'status')
+ node['status'] = v
+
+
+ def getRestartWithAuxiliaryStatus(self):
+ """
+ Return status of reading auxiliary restart file for advanced options.
+ """
+ node = self.node_start.xmlInitNode('restart_with_auxiliary', 'status')
+ status = node['status']
+ if not status:
+ status = self._defaultStartRestartValues()['restart_with_auxiliary']
+ self.setRestartWithAuxiliaryStatus(status)
+ return status
+
+
+## def getMainRestartFormat(self):
+## """
+## Return format of main restart file from advanced options.
+## """
+## node = self.node_start.xmlInitNode('main_restart', 'format')
+## format= node['format']
+## if not format:
+## format = self._defaultStartRestartValues()['main_restart']
+## self.setMainRestartFormat(format)
+## return format
+
+##
+## def getAuxiliaryRestartFormat(self):
+## """
+## Return format of auxiliary restart file from advanced options.
+## """
+## node = self.node_start.xmlInitNode('auxiliary_restart', 'format')
+## format= node['format']
+## if not format:
+## format = self._defaultStartRestartValues()['auxiliary_restart']
+## self.setAuxiliaryRestartFormat(format)
+## return format
+
+
+ def getRestartRescue(self):
+ """
+ Return frequency for restart checkpoints from advanced options.
+ """
+ val = self.node_start.xmlGetInt('restart_rescue')
+ if val == None or val == 0:
+ period = self._defaultStartRestartValues()['period_rescue']
+ val = self._defaultStartRestartValues()['restart_rescue']
+ self.setRestartRescue(val)
+ else:
+ if val == -1:
+ period = "At the end"
+ else:
+ period = "Frequency"
+ return val, period
+
+
+ def setRestartWithAuxiliaryStatus(self, status):
+ """
+ Input status of reading auxiliary restart file for advanced options.
+ """
+ self.isOnOff(status)
+ node = self.node_start.xmlInitNode('restart_with_auxiliary', 'status')
+ node['status'] = status
+
+
+## def setMainRestartFormat(self, fmt):
+## """
+## Input format of main restart file for advanced options.
+## """
+## print "format ===", fmt
+## self.isInList(fmt, ('ascii', 'binary'))
+## node = self.node_start.xmlInitNode('main_restart', 'format')
+## node['format'] = fmt
+##
+##
+## def setAuxiliaryRestartFormat(self, fmt):
+## """
+## Input format of auxiliary restart file for advanced options.
+## """
+## self.isInList(fmt, ('ascii', 'binary'))
+## node = self.node_start.xmlInitNode('auxiliary_restart', 'format')
+## node['format'] = fmt
+
+
+ def setRestartRescue(self, freq):
+ """
+ Inputfrequency for restart checkpoints from advanced options.
+ """
+ self.isInt(freq)
+ self.node_start.xmlSetData('restart_rescue', freq)
+
+
+ def getRestartDirectory(self):
+ """ Convenient method only for the View """
+ return self.node_start.xmlGetString('current_restart')
+
+
+ def setRestartDirectory(self, dir):
+ """ Convenient method only for the View """
+# if not os.path.isdir(self.case['resu_path'] + "/" + dir):
+# raise ValueError, "Invalid restart directory %s" % dir
+ self.node_start.xmlSetData('current_restart', dir)
+
+
+#-------------------------------------------------------------------------------
+# StartRestartModel test case
+#-------------------------------------------------------------------------------
+
+
+class StartRestartTestCase(ModelTest):
+ """
+ """
+ def checkStartRestartInstantiation(self):
+ """
+ Check whether the StartRestartModel class could be instantiated
+ """
+ model = None
+ model = StartRestartModel(self.case)
+ assert model != None, 'Could not instantiate StartRestartModel'
+
+ def checkSetandGetRestart(self):
+ """
+ Check whether the restart method could be set and get
+ """
+ model = StartRestartModel(self.case)
+ model.setRestart("on")
+ doc= '''<start_restart>
+ <restart status="on"/>
+ </start_restart>'''
+
+ assert model.node_start == self.xmlNodeFromString(doc),\
+ 'Could not set restart in StartRestart model'
+ assert model.getRestart() == 'on',\
+ 'Could not get restart in StartRestart model'
+
+ def checkSetandGetFrozenStatus(self):
+ """
+ Check whether the Frozen status method could be set and get
+ """
+ model = StartRestartModel(self.case)
+ model.setRestart("on")
+ model.setFrozenField('on')
+ doc = '''<start_restart>
+ <restart status="on"/>
+ <frozen_field status="on"/>
+ </start_restart>'''
+ assert model.node_start == self.xmlNodeFromString(doc),\
+ 'Could not set frozen status in StartRestart model'
+ assert model.getFrozenField() == "on",\
+ 'Could not get frozen status in StartRestart model'
+
+ def checkSetAuxiliaryRestartStatus(self):
+ """
+ Check whether the Auxiliary Restart Status method
+ could be set and get
+ """
+ model = StartRestartModel(self.case)
+ model.setRestart("on")
+ model.setRestartWithAuxiliaryStatus('on')
+ doc= '''<start_restart>
+ <restart status="on"/>
+ <restart_with_auxiliary status="on"/>
+ </start_restart>'''
+ assert model.node_start == self.xmlNodeFromString(doc),\
+ 'Could not set auxiliary restart status in StartRestart model'
+ assert model.getRestartWithAuxiliaryStatus() == "on",\
+ 'Could not get auxiliary restart status in StartRestart model'
+
+## def checkSetandGetMainandAxiliaryRestartFormat(self):
+## """
+## Check whether the Main and Auxiliary Restart format method
+## could be set and get
+## """
+## model = StartRestartModel(self.case)
+## model.setRestart("on")
+## model.setRestartWithAuxiliaryStatus('on')
+## model.setMainRestartFormat('binary')
+## model.setAuxiliaryRestartFormat('ascii')
+## doc= '''<start_restart>
+## <restart status="on"/>
+## <restart_with_auxiliary status="on"/>
+## <main_restart format="binary"/>
+## <auxiliary_restart format="ascii"/>
+## </start_restart>'''
+## assert model.node_start == self.xmlNodeFromString(doc),\
+## 'Could not set main and auxiliary restart formats in StartRestart model'
+## assert model.getMainRestartFormat() == "binary",\
+## 'Could not get main restart format in StartRestart model'
+## assert model.getAuxiliaryRestartFormat() == "ascii",\
+## 'Could not get auxiliary restart format in StartRestart model'
+
+ def checkSetandGetRestartRescue(self):
+ """
+ Check whether the Restart rescue could be set and get
+ """
+ model = StartRestartModel(self.case)
+ model.setRestart("on")
+ model.setRestartRescue(15)
+ doc = '''<start_restart>
+ <restart status="on"/>
+ <restart_rescue>15</restart_rescue>
+ </start_restart>'''
+ assert model.node_start == self.xmlNodeFromString(doc),\
+ 'Could not set restart rescue value in StartRestart model'
+ freq, period = model.getRestartRescue()
+ assert freq == 15,\
+ 'Could not get restart rescue value in StartRestart model'
+ assert period == "Frequency",\
+ 'Could not get restart rescue period in StartRestart model'
+
+ model.setRestartRescue(-1)
+ freq, period = model.getRestartRescue()
+ assert freq == -1,\
+ 'Could not get restart rescue value in StartRestart model'
+ assert period == "At the end",\
+ 'Could not get restart rescue period in StartRestart model'
+
+ def checksetRestartDirectory(self):
+ """
+ Check whether the setRestartDirectory method could be set
+ """
+ model = StartRestartModel(self.case)
+ model.setRestart("on")
+ model.setRestartDirectory('RESTART.11221504')
+ doc = '''<start_restart>
+ <restart status="on"/>
+ <current_restart>RESTART.11221504</current_restart>
+ </start_restart>'''
+ assert model.node_start == self.xmlNodeFromString(doc),\
+ 'Could not update restart directory in StartRestart model'
+
+ model.setRestart("off")
+ doc = '''<start_restart>
+ <restart status="off"/>
+ </start_restart>'''
+ assert model.node_start == self.xmlNodeFromString(doc),\
+ 'Could not remove the restart directory in StartRestart model'
+
+
+def suite():
+ testSuite = unittest.makeSuite(StartRestartTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "StartRestartTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/StartRestartView.py b/gui/Pages/StartRestartView.py
new file mode 100644
index 0000000..7d6fe70
--- /dev/null
+++ b/gui/Pages/StartRestartView.py
@@ -0,0 +1,393 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the 'Start/Restart' page.
+
+This module contains the following classes:
+- StartRestartAdvancedDialogView
+- StartRestartView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, string, types
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from Base.QtPage import ComboModel, IntValidator, setGreenColor
+from StartRestartForm import Ui_StartRestartForm
+from StartRestartAdvancedDialogForm import Ui_StartRestartAdvancedDialogForm
+from Pages.StartRestartModel import StartRestartModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("StartRestartView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Popup window class
+#-------------------------------------------------------------------------------
+
+class StartRestartAdvancedDialogView(QDialog, Ui_StartRestartAdvancedDialogForm):
+ """
+ Building of popup window for advanced options.
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_StartRestartAdvancedDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("Advanced options"))
+ self.default = default
+ self.result = self.default.copy()
+
+ # Combo models and items
+ self.modelFreq = ComboModel(self.comboBoxFreq, 3, 1)
+
+ self.modelFreq.addItem(self.tr("Only at the end of the calculation"), 'At the end')
+ self.modelFreq.addItem(self.tr("4 restart checkpoints"), '4 output')
+ self.modelFreq.addItem(self.tr("Checkpoints frequency :"), 'Frequency')
+
+ # Connections
+
+ self.connect(self.comboBoxFreq, SIGNAL("activated(const QString&)"), self.slotFreq)
+ self.connect(self.lineEditNSUIT, SIGNAL("textChanged(const QString&)"), self.slotNsuit)
+
+ # Validator
+
+ validatorNSUIT = IntValidator(self.lineEditNSUIT, min=0)
+ self.lineEditNSUIT.setValidator(validatorNSUIT)
+
+ # Read of auxiliary file if calculation restart is asked
+
+ if self.default['restart'] == "on":
+ self.groupBoxRestart.show()
+
+ if self.default['restart_with_auxiliary'] == 'on':
+ self.checkBoxReadAuxFile.setChecked(True)
+ else:
+ self.checkBoxReadAuxFile.setChecked(False)
+ else:
+ self.groupBoxRestart.hide()
+
+ # Frequency of rescue of restart file
+
+ if self.default['restart_rescue'] == -1:
+ self.nsuit = -1
+ self.lineEditNSUIT.setDisabled(True)
+ self.freq = 'At the end'
+ elif self.default['restart_rescue'] == 0:
+ self.nsuit = 0
+ self.lineEditNSUIT.setDisabled(True)
+ self.freq = '4 output'
+ else:
+ self.nsuit = self.default['restart_rescue']
+ self.lineEditNSUIT.setEnabled(True)
+ self.freq = 'Frequency'
+ self.modelFreq.setItem(str_model=self.freq)
+ self.lineEditNSUIT.setText(str(self.nsuit))
+
+
+ @pyqtSignature("const QString &")
+ def slotFreq(self, text):
+ """
+ Creation of popup window's widgets
+ """
+ self.freq = self.modelFreq.dicoV2M[str(text)]
+ log.debug("getFreq-> %s" % self.freq)
+
+ if self.freq == "At the end":
+ self.nsuit = -1
+ self.lineEditNSUIT.setText(str(self.nsuit))
+ self.lineEditNSUIT.setDisabled(True)
+
+ elif self.freq == "4 output":
+ self.nsuit = 0
+ self.lineEditNSUIT.setText(str(self.nsuit))
+ self.lineEditNSUIT.setDisabled(True)
+
+ elif self.freq == "Frequency":
+ if self.nsuit <= 0: self.nsuit = 1
+ self.lineEditNSUIT.setText(str(self.nsuit))
+ self.lineEditNSUIT.setEnabled(True)
+
+
+ @pyqtSignature("const QString &")
+ def slotNsuit(self, text):
+ n, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.nsuit = n
+ log.debug("getNsuit-> nsuit = %s" % n)
+
+
+ def accept(self):
+ """
+ What to do when user clicks on 'OK'.
+ """
+ if self.default['restart'] == 'on':
+ if self.checkBoxReadAuxFile.isChecked():
+ self.result['restart_with_auxiliary'] = 'on'
+ else:
+ self.result['restart_with_auxiliary'] = 'off'
+
+ self.result['restart_rescue'] = self.nsuit
+ self.result['period_rescue'] = self.freq
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when 'Cancel' button is clicked
+ """
+ QDialog.reject(self)
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.result
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class StartRestartView(QWidget, Ui_StartRestartForm):
+ """
+ This page is devoted to the start/restart control.
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_StartRestartForm.__init__(self)
+ self.setupUi(self)
+ self.case = case
+
+ self.connect(self.radioButtonYes, SIGNAL("clicked()"), self.slotStartRestart)
+ self.connect(self.radioButtonNo, SIGNAL("clicked()"), self.slotStartRestart)
+ self.connect(self.toolButton, SIGNAL("pressed()"), self.slotSearchRestartDirectory)
+ self.connect(self.checkBox, SIGNAL("clicked()"), self.slotFrozenField)
+ self.connect(self.toolButtonAdvanced, SIGNAL("pressed()"), self.slotAdvancedOptions)
+
+ self.model = StartRestartModel(self.case)
+
+ # Widget initialization
+
+ if 'RESTART' in os.listdir(self.case['data_path']):
+ if not os.path.isdir(os.readlink(self.case['data_path'] + '/RESTART')):
+ title = self.tr("WARNING")
+ msg = self.tr("Invalid link in %s!" % self.case['data_path'])
+ QMessageBox.warning(self, title, msg)
+
+ if self.model.getRestart() == "on":
+ self.radioButtonYes.setChecked(True)
+ self.radioButtonNo.setChecked(False)
+ else:
+ self.radioButtonYes.setChecked(False)
+ self.radioButtonNo.setChecked(True)
+ self.slotStartRestart()
+
+ if self.model.getFrozenField() == 'on':
+ self.checkBox.setChecked(True)
+ else:
+ self.checkBox.setChecked(False)
+
+
+ @pyqtSignature("")
+ def slotSearchRestartDirectory(self):
+ """
+ Search restart file (directory) in list of directories
+ """
+ title = self.tr("Selection of the restart directory RESTART")
+ default = self.case['resu_path']
+ dir_path = QFileDialog.getExistingDirectory(self, title, default, QFileDialog.ShowDirsOnly)
+
+ if dir_path:
+ dir_path = os.path.abspath(str(dir_path))
+ dir_name = os.path.basename(dir_path)
+ log.debug("slotSearchRestartDirectory-> %s" % dir_name)
+ link = self.case['data_path'] + '/RESTART'
+
+ # a link already exists
+ if os.path.islink(link):
+ exist_name = os.path.abspath(os.readlink(link))
+ if dir_path != exist_name:
+ title = self.tr("WARNING")
+ msg = self.tr("This symbolic link already exists in DATA:\n\n" \
+ + exist_name + "\n\nReplace with the new directory?")
+ ans = QMessageBox.question(self, title, msg, QMessageBox.Yes, QMessageBox.No)
+ if ans == QMessageBox.Yes:
+ os.unlink(link)
+ os.symlink(dir_path, link)
+ self.model.setRestartDirectory(dir_name)
+ else:
+ self.model.setRestartDirectory(os.path.basename(exist_name))
+ else:
+ self.model.setRestartDirectory(os.path.basename(exist_name))
+
+ # a RESTART directory exists
+ elif os.path.isdir(link):
+ title = self.tr("WARNING")
+ msg = self.tr("The directory RESTART is already in DATA.\n\n" \
+ "Replace with the new directory?")
+ ans = QMessageBox.question(self, title, msg, QMessageBox.Yes, QMessageBox.No)
+ if ans == QMessageBox.Yes:
+ os.rmdir(link)
+ os.symlink(dir_path, link)
+ self.model.setRestartDirectory(dir_name)
+ else:
+ self.model.setRestartDirectory('RESTART')
+
+ # create a new link
+ else:
+ os.symlink(os.path.abspath(dir_path), link)
+ self.model.setRestartDirectory(dir_name)
+
+ setGreenColor(self.toolButton, False)
+ self.slotStartRestart()
+
+
+ @pyqtSignature("")
+ def slotStartRestart(self):
+ """
+ Input IRESTART Code_Saturne keyword.
+ """
+ if self.radioButtonYes.isChecked():
+ self.model.setRestart("on")
+ self.toolButton.setEnabled(True)
+ self.radioButtonYes.setChecked(True)
+ self.radioButtonNo.setChecked(False)
+
+ name = self.model.getRestartDirectory()
+ if name:
+ self.labelDir1.show()
+ self.labelDir2.show()
+ self.labelDir2.setText(name)
+ else:
+ setGreenColor(self.toolButton)
+
+ else:
+ self.model.setRestart("off")
+ self.toolButton.setDisabled(True)
+ self.model.setFrozenField("off")
+ self.radioButtonYes.setChecked(False)
+ self.radioButtonNo.setChecked(True)
+
+ self.labelDir1.hide()
+ self.labelDir2.hide()
+ setGreenColor(self.toolButton, False)
+
+
+ @pyqtSignature("")
+ def slotFrozenField(self):
+ """
+ Input if calculation on frozen velocity and pressure fields or not
+ """
+ if self.checkBox.isChecked():
+ self.model.setFrozenField('on')
+ else:
+ self.model.setFrozenField('off')
+
+
+ @pyqtSignature("")
+ def slotAdvancedOptions(self):
+ """
+ Ask one popup for advanced specifications
+ """
+ freq, period = self.model.getRestartRescue()
+
+ default = {}
+ default['restart'] = self.model.getRestart()
+ default['restart_with_auxiliary'] = self.model.getRestartWithAuxiliaryStatus()
+ default['restart_rescue'] = freq
+ default['period_rescue'] = period
+## default['main_restart'] = self.model.getMainRestartFormat()
+## default['auxiliary_restart'] = self.model.getAuxiliaryRestartFormat()
+ log.debug("slotAdvancedOptions -> %s" % str(default))
+
+ dialog = StartRestartAdvancedDialogView(self, default)
+
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotAdvancedOptions -> %s" % str(result))
+ self.model.setRestart(result['restart'])
+ self.model.setRestartWithAuxiliaryStatus(result['restart_with_auxiliary'])
+ self.model.setRestartRescue(result['restart_rescue'])
+## self.model.setMainRestartFormat(result['main_restart'])
+## self.model.setAuxiliaryRestartFormat(result['auxiliary_restart'])
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/SteadyManagementForm.ui b/gui/Pages/SteadyManagementForm.ui
new file mode 100644
index 0000000..8ff1a8b
--- /dev/null
+++ b/gui/Pages/SteadyManagementForm.ui
@@ -0,0 +1,172 @@
+<ui version="4.0" >
+ <class>SteadyManagementForm</class>
+ <widget class="QWidget" name="SteadyManagementForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>155</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Steady flow algorithm management</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelRELXST" >
+ <property name="minimumSize" >
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: RELXST</string>
+ </property>
+ <property name="text" >
+ <string>Relaxation coefficient</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditRELXST" >
+ <property name="minimumSize" >
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: RELXST</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelNTMABS" >
+ <property name="minimumSize" >
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTMABS</string>
+ </property>
+ <property name="text" >
+ <string>Number of iterations (restart included) </string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditNTMABS" >
+ <property name="minimumSize" >
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTMABS</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelINPDT0" >
+ <property name="minimumSize" >
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: INPDT0</string>
+ </property>
+ <property name="text" >
+ <string>Zero iterations option</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QCheckBox" name="checkBoxINPDT0" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/SteadyManagementModel.py b/gui/Pages/SteadyManagementModel.py
new file mode 100644
index 0000000..1c0df73
--- /dev/null
+++ b/gui/Pages/SteadyManagementModel.py
@@ -0,0 +1,259 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- SteadyManagementModel
+- SteadyManagementTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import XMLmodel, ModelTest
+from Pages.CoalCombustionModel import CoalCombustionModel
+from Pages.GasCombustionModel import GasCombustionModel
+from Pages.ElectricalModelsModel import ElectricalModel
+
+#-------------------------------------------------------------------------------
+# SteadyManagement model class
+#-------------------------------------------------------------------------------
+
+class SteadyManagementModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Pressure
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+ self.node_anal = self.case.xmlGetNode('analysis_control')
+## self.node_steady = node_anal.xmlInitNode('steady_management', 'status')
+
+ def defaultValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['status'] = "off"
+ default['iterations'] = 10
+ default['relaxation_coefficient'] = 0.9
+ default['zero_iteration'] = "off"
+
+ return default
+
+
+ def setSteadyFlowManagement(self, steady):
+ """
+ Set steady flow management balise into xml file.
+ """
+ self.isOnOff(steady)
+ node = self.node_anal.xmlInitNode('steady_management', 'status')
+ node['status'] = steady
+
+ if steady == 'on':
+ self.getZeroIteration()
+ self.getNbIter()
+ self.getRelaxCoefficient()
+
+
+ def getSteadyFlowManagement(self):
+ """
+ Get status of steady flow management balise fromxml file.
+ """
+ node = self.node_anal.xmlInitNode('steady_management', 'status')
+ status = node['status']
+ if not status:
+ status = self.defaultValues()['status']
+ self.setSteadyFlowManagement(status)
+ return status
+
+
+ def setRelaxCoefficient(self, value):
+ """
+ Set value of coefficient of relaxation into xml file.
+ """
+ self.isGreater(value, 0.)
+ self.isLowerOrEqual(value, 1.)
+ node = self.node_anal.xmlInitNode('steady_management', 'status')
+ node.xmlSetData('relaxation_coefficient', value)
+
+
+ def setNbIter(self, value):
+ """
+ Set value of iterations number into xml file.
+ """
+ self.isInt(value)
+ self.isGreaterOrEqual(value, 0.)
+ node = self.node_anal.xmlInitNode('steady_management', 'status')
+ node.xmlSetData('iterations', value)
+
+
+ def setZeroIteration(self, status):
+ """
+ Set status of option of zero iteration into xml file.
+ """
+ self.isOnOff(status)
+ node_steady = self.node_anal.xmlInitNode('steady_management', 'status')
+ node = node_steady.xmlInitChildNode('zero_iteration', 'status')
+ node['status'] = status
+
+
+ def getRelaxCoefficient(self):
+ """
+ Get value of coefficient of relaxation from xml file.
+ """
+ node = self.node_anal.xmlInitNode('steady_management', 'status')
+ coef = node.xmlGetDouble('relaxation_coefficient')
+ if not coef:
+ coef = self.defaultValues()['relaxation_coefficient']
+ self.setRelaxCoefficient(coef)
+
+ return coef
+
+
+ def getNbIter(self):
+ """
+ Get value of coefficient of relaxation from xml file.
+ """
+ node = self.node_anal.xmlInitNode('steady_management', 'status')
+ value = node.xmlGetInt('iterations')
+ if not value:
+ value = self.defaultValues()['iterations']
+ self.setNbIter(value)
+
+ return value
+
+
+ def getZeroIteration(self):
+ """
+ Get status of option of zero iteration from xml file.
+ """
+ node_steady = self.node_anal.xmlInitNode('steady_management', 'status')
+ node = node_steady.xmlGetChildNode('zero_iteration')
+ if not node or not node['status']:
+ self.setZeroIteration(self.defaultValues()['zero_iteration'])
+ node = node_steady.xmlGetChildNode('zero_iteration')
+
+ return node['status']
+
+
+#-------------------------------------------------------------------------------
+# SteadyManagement Model test case
+#-------------------------------------------------------------------------------
+
+
+class SteadyManagementTestCase(ModelTest):
+ """
+ """
+ def checkSteadyManagementInstantiation(self):
+ """Check whether the SteadyManagementModel class could be instantiated"""
+ model = None
+ model = SteadyManagementModel(self.case)
+ assert model != None, 'Could not instantiate SteadyManagementModel'
+
+ def checkSetandGetRelaxCoefficient(self):
+ """Check whether the SteadyManagementModel class could be set or get relax coefficient """
+ mdl = SteadyManagementModel(self.case)
+ mdl.setSteadyFlowManagement('on')
+ node = mdl.node_anal.xmlInitNode('steady_management', 'status')
+ mdl.setRelaxCoefficient(0.45)
+ doc = """<steady_management status="on">
+ <zero_iteration status="off"/>
+ <iterations>10</iterations>
+ <relaxation_coefficient>0.45</relaxation_coefficient>
+ </steady_management>"""
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set a relax coefficient'
+ coef = mdl.getRelaxCoefficient()
+ assert coef == 0.45, 'Could not get a relax coefficient in SteadyManagementModel '
+
+ def checkSetandGeNbIter(self):
+ """
+ Check whether the SteadyManagementModel class could be
+ set or get number of iterations
+ """
+ mdl = SteadyManagementModel(self.case)
+ mdl.setSteadyFlowManagement('on')
+ node = mdl.node_anal.xmlInitNode('steady_management', 'status')
+ mdl.setNbIter(33)
+ doc = """<steady_management status="on">
+ <zero_iteration status="off"/>
+ <iterations>33</iterations>
+ <relaxation_coefficient>0.9</relaxation_coefficient>
+ </steady_management>"""
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set a number of iterations'
+ assert mdl.getNbIter() == 33,\
+ 'Could not get a number of iterations in SteadyManagementModel'
+
+ def checkSetandGetZeroIteration(self):
+ """
+ Check whether the SteadyManagementModel class could be
+ set or get zero iteration status
+ """
+ mdl = SteadyManagementModel(self.case)
+ mdl.setSteadyFlowManagement('on')
+ node = mdl.node_anal.xmlInitNode('steady_management', 'status')
+ mdl.setZeroIteration('on')
+ doc = """<steady_management status="on">
+ <zero_iteration status="on"/>
+ <iterations>10</iterations>
+ <relaxation_coefficient>0.9</relaxation_coefficient>
+ </steady_management>"""
+ assert node == self.xmlNodeFromString(doc),\
+ 'Could not set a status for zero iteration'
+ stat = mdl.getZeroIteration()
+ assert stat == 'on', 'Could not get a status for zero iteration in SteadyManagementModel'
+
+def suite():
+ testSuite = unittest.makeSuite(SteadyManagementTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "SteadyManagementTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/SteadyManagementView.py b/gui/Pages/SteadyManagementView.py
new file mode 100644
index 0000000..673fc49
--- /dev/null
+++ b/gui/Pages/SteadyManagementView.py
@@ -0,0 +1,164 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- SteadyManagementView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from SteadyManagementForm import Ui_SteadyManagementForm
+import Base.QtPage as QtPage
+from Base.XMLvariables import Variables
+from Pages.SteadyManagementModel import SteadyManagementModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("SteadyManagementView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class SteadyManagementView(QWidget, Ui_SteadyManagementForm):
+ """
+ Class to open steady management Page.
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_SteadyManagementForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = SteadyManagementModel(self.case)
+
+ # Connections
+
+ self.connect(self.lineEditRELXST, SIGNAL("textChanged(const QString &)"), self.slotRelaxCoef)
+ self.connect(self.lineEditNTMABS, SIGNAL("textChanged(const QString &)"), self.slotNbIter)
+ self.connect(self.checkBoxINPDT0, SIGNAL("clicked()"), self.slotZeroIteration)
+
+ # Validators
+
+ validatorRELXST = QtPage.DoubleValidator(self.lineEditRELXST, min=0.0, max=1.0)
+ validatorRELXST.setExclusiveMin(True)
+ self.lineEditRELXST.setValidator(validatorRELXST)
+
+ validatorNTMABS = QtPage.IntValidator(self.lineEditNTMABS, min=0)
+ self.lineEditNTMABS.setValidator(validatorNTMABS)
+
+ # Initialization
+
+ relax_coef = self.mdl.getRelaxCoefficient()
+ self.lineEditRELXST.setText(QString(str(relax_coef)))
+
+ nb_iter = self.mdl.getNbIter()
+ self.lineEditNTMABS.setText(QString(str(nb_iter)))
+
+ if self.mdl.getZeroIteration() == 'on':
+ self.checkBoxINPDT0.setChecked(True)
+ else:
+ self.checkBoxINPDT0.setChecked(False)
+
+
+ @pyqtSignature("const QString&")
+ def slotRelaxCoef(self, text):
+ """
+ Input relaxation coefficient.
+ """
+ relax_coef, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRelaxCoefficient(relax_coef)
+
+
+ @pyqtSignature("const QString&")
+ def slotNbIter(self, text):
+ """
+ Input itarations number.
+ """
+ nb_iter, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setNbIter(nb_iter)
+
+
+ @pyqtSignature("")
+ def slotZeroIteration(self):
+ """
+ Input zero iteration number.
+ """
+ if self.checkBoxINPDT0.isChecked():
+ zero_iter = 'on'
+ else:
+ zero_iter = 'off'
+ self.mdl.setZeroIteration(zero_iter)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/SyrthesForm.ui b/gui/Pages/SyrthesForm.ui
new file mode 100644
index 0000000..edc7c1f
--- /dev/null
+++ b/gui/Pages/SyrthesForm.ui
@@ -0,0 +1,241 @@
+<ui version="4.0" >
+ <class>SyrthesForm</class>
+ <widget class="QWidget" name="SyrthesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>471</width>
+ <height>603</height>
+ </rect>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>250</height>
+ </size>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <widget class="QFrame" name="frame" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>30</y>
+ <width>398</width>
+ <height>446</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelSyrthes" >
+ <property name="toolTip" >
+ <string>Preprocessor option: -syrthes</string>
+ </property>
+ <property name="text" >
+ <string>Syrthes coupling:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="3" >
+ <widget class="QRadioButton" name="radioButtonCouplingOn" >
+ <property name="text" >
+ <string>on</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <widget class="QRadioButton" name="radioButtonCouplingOff" >
+ <property name="text" >
+ <string>off</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="statusTip" >
+ <string>Boundary faces selections for Syrthes coupling. These selections are optional. A selection can be activated or not. </string>
+ </property>
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelFaces" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string>Select boundary faces for Syrthes coupling:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="FacesSelectionView" native="1" name="widgetFaces" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>250</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Project mesh for 2D syrthes run:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QRadioButton" name="radioButton2DOn" >
+ <property name="text" >
+ <string>on</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QRadioButton" name="radioButton2DOff" >
+ <property name="text" >
+ <string>off</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>FacesSelectionView</class>
+ <extends>QWidget</extends>
+ <header>FacesSelectionView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>radioButtonCouplingOff</sender>
+ <signal>clicked()</signal>
+ <receiver>groupBox</receiver>
+ <slot>hide()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>311</x>
+ <y>56</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>354</x>
+ <y>82</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>radioButtonCouplingOn</sender>
+ <signal>clicked()</signal>
+ <receiver>groupBox</receiver>
+ <slot>show()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>264</x>
+ <y>56</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>235</x>
+ <y>78</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/SyrthesView.py b/gui/Pages/SyrthesView.py
new file mode 100644
index 0000000..6f66704
--- /dev/null
+++ b/gui/Pages/SyrthesView.py
@@ -0,0 +1,195 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following class:
+- SyrthesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from SyrthesForm import Ui_SyrthesForm
+from Pages.SolutionDomainModel import SolutionDomainModel
+import Base.QtPage as QtPage
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("SyrthesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class SyrthesView(QWidget, Ui_SyrthesForm):
+ """
+ """
+
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_SyrthesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+
+ # Create the Page layout.
+
+ # Configure Faces Selection Widget
+ self.widgetFaces.setTagName("faces_syrthes")
+ self.widgetFaces.setCase(self.case)
+
+ # Connections
+ self.connect(self.radioButtonCouplingOn, SIGNAL("clicked()"), self.slotSyrthesCoupling)
+ self.connect(self.radioButtonCouplingOff, SIGNAL("clicked()"), self.slotSyrthesCoupling)
+
+ self.connect(self.radioButton2DOn, SIGNAL("clicked()"), self.slotSyrthes2dMesh)
+ self.connect(self.radioButton2DOff, SIGNAL("clicked()"), self.slotSyrthes2dMesh)
+
+ # Signals for the Faces Selection Widget
+ self.connect(self.widgetFaces.pushButtonDelete, SIGNAL("clicked()"), self.delListboxSyrthes)
+
+ # initialize
+
+ if SolutionDomainModel(self.case).getSyrthesCouplingStatus() == 'on':
+ self.radioButtonCouplingOn.setChecked(True)
+ self.radioButtonCouplingOff.setChecked(False)
+ self.groupBox.show()
+ if SolutionDomainModel(self.case).getSyrthes2dMeshStatus() == 'on':
+ self.radioButton2DOn.setChecked(True)
+ self.radioButton2DOff.setChecked(False)
+ else:
+ self.radioButton2DOn.setChecked(False)
+ self.radioButton2DOff.setChecked(True)
+ else:
+ self.radioButtonCouplingOn.setChecked(False)
+ self.radioButtonCouplingOff.setChecked(True)
+ self.groupBox.hide()
+ SolutionDomainModel(self.case).setSyrthesCouplingStatus('off')
+
+ #for node in self.node_syrthes.xmlGetNodeList('faces_syrthes'):
+ result = {}
+ result = SolutionDomainModel(self.case).getSyrthesFaces()
+ if result:
+ self.widgetFaces.insertItemFromDico(result)
+
+
+ @pyqtSignature("")
+ def slotSyrthesCoupling(self):
+ """
+ Do we have a syrthes coupling ?
+ """
+ if self.radioButtonCouplingOn.isChecked():
+ self.syr_on_off = "on"
+ else:
+ self.syr_on_off = "off"
+ answer = self.syr_on_off
+ SolutionDomainModel(self.case).setSyrthesCouplingStatus(answer)
+
+ # Hide/Show of the group box is handled by signals in the Form
+ if SolutionDomainModel(self.case).getSyrthes2dMeshStatus() == 'on':
+ self.radioButton2DOn.setChecked(True)
+ self.radioButton2DOff.setChecked(False)
+ else:
+ self.radioButton2DOn.setChecked(False)
+ self.radioButton2DOff.setChecked(True)
+
+
+ @pyqtSignature("")
+ def slotSyrthes2dMesh(self):
+ """
+ Is the mesh for Syrthes a 2D mesh ?
+ This command is invoked with 2 arguments. The first is the name of the
+ button subwidget that has toggled. The second is a boolean value
+ indicating whether the button subwidget is selected.
+ """
+ if self.radioButton2DOn.isChecked():
+ self.syr2d_on_off = "on"
+ else:
+ self.syr2d_on_off = "off"
+ SolutionDomainModel(self.case).setSyrthes2dMeshStatus(self.syr2d_on_off)
+ if self.syr2d_on_off == 'off':
+## SolutionDomainModel(self.case).setSyrthes2dMeshStatus('on')
+## else:
+## SolutionDomainModel(self.case).delSyrthes2dMeshNode()
+ self.radioButton2DOn.setChecked(False)
+ self.radioButton2DOff.setChecked(True)
+
+
+ @pyqtSignature("")
+ def delListboxSyrthes(self):
+ """
+ Delete the selection from the listView.
+ """
+ self.widgetFaces.slotDelItem()
+ self.syr2d_on_off = "off"
+ self.slotSyrthes2dMesh()
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/ThermalRadiationAdvancedDialogForm.ui b/gui/Pages/ThermalRadiationAdvancedDialogForm.ui
new file mode 100644
index 0000000..87e3622
--- /dev/null
+++ b/gui/Pages/ThermalRadiationAdvancedDialogForm.ui
@@ -0,0 +1,271 @@
+<ui version="4.0" >
+ <class>ThermalRadiationAdvancedDialogForm</class>
+ <widget class="QDialog" name="ThermalRadiationAdvancedDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>322</width>
+ <height>184</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelFreq" >
+ <property name="text" >
+ <string>Iteration resolution frequency</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="4" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="5" colspan="2" >
+ <widget class="QLineEdit" name="lineEditFreq" >
+ <property name="minimumSize" >
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key words: NREFQR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2" >
+ <widget class="QLabel" name="labelTSRay" >
+ <property name="text" >
+ <string>Radiative source term calculus</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" colspan="4" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="6" >
+ <widget class="QComboBox" name="comboBoxTSRay" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key words: IDIVER</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>0</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>2</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="3" >
+ <widget class="QLabel" name="labelPrintT" >
+ <property name="text" >
+ <string>Verbosity level for wall temperature</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3" colspan="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="6" >
+ <widget class="QComboBox" name="comboBoxPrintT" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key words: IIMPAR</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>0</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>2</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="4" >
+ <widget class="QLabel" name="labelPrintL" >
+ <property name="text" >
+ <string>Verbosity level for brigthness resolution</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="4" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="6" >
+ <widget class="QComboBox" name="comboBoxPrintL" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key words: IIMLUM</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>0</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>2</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>280</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>ThermalRadiationAdvancedDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ThermalRadiationAdvancedDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/ThermalRadiationForm.ui b/gui/Pages/ThermalRadiationForm.ui
new file mode 100644
index 0000000..6dd377d
--- /dev/null
+++ b/gui/Pages/ThermalRadiationForm.ui
@@ -0,0 +1,465 @@
+<ui version="4.0" >
+ <class>ThermalRadiationForm</class>
+ <widget class="QWidget" name="ThermalRadiationForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>456</width>
+ <height>337</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Thermal radiative transfers</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxRadModel" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key words: IRAYON, IRAYPP</string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the thermic radiation model</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameOptions" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QFrame" name="frameDirection" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="spacing" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="labelDirection" >
+ <property name="text" >
+ <string>Number of directions for angular discretisation </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxDirection" >
+ <property name="toolTip" >
+ <string>Code_Saturne key words: NDIREC</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <spacer name="horizontalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Absorption coefficient</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" colspan="2" >
+ <widget class="QComboBox" name="comboBoxAbsorption" />
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QLineEdit" name="lineEditCoeff" />
+ </item>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>m<sup>-1</sup></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonCoeffFormula" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</normaloff>:/new/prefix1/icons/22x22/edit-find-replace.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="1" >
+ <spacer name="horizontalSpacer_6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>17</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>13</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelRestart" >
+ <property name="text" >
+ <string>Restart of radiative calculation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButtonOn" >
+ <property name="toolTip" >
+ <string>Code_Saturne key words: ISUIRD</string>
+ </property>
+ <property name="text" >
+ <string>on</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButtonOff" >
+ <property name="toolTip" >
+ <string>Code_Saturne key words: ISUIRD</string>
+ </property>
+ <property name="text" >
+ <string>off</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelAdvanced" >
+ <property name="text" >
+ <string>Advanced options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="toolButtonAdvanced" >
+ <property name="minimumSize" >
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >
+ <normaloff>:/new/prefix1/icons/22x22/preferences-system.png</normaloff>:/new/prefix1/icons/22x22/preferences-system.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>comboBoxRadModel</tabstop>
+ <tabstop>radioButtonOn</tabstop>
+ <tabstop>radioButtonOff</tabstop>
+ <tabstop>comboBoxDirection</tabstop>
+ <tabstop>toolButtonAdvanced</tabstop>
+ </tabstops>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/ThermalRadiationModel.py b/gui/Pages/ThermalRadiationModel.py
new file mode 100644
index 0000000..84c445f
--- /dev/null
+++ b/gui/Pages/ThermalRadiationModel.py
@@ -0,0 +1,851 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Thermal Radiation model
+
+This module contains the following classes and function:
+- ThermalRadiationModel
+- ThermalRadiationTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+from Base.XMLmodel import ModelTest
+from Base.XMLvariables import Variables, Model
+from Pages.OutputControlModel import OutputControlModel
+
+#-------------------------------------------------------------------------------
+# ThermalRadiation model class
+#-------------------------------------------------------------------------------
+
+class ThermalRadiationModel(Model):
+
+ def __init__(self, case):
+ """
+ Constuctor
+ """
+ self.case = case
+
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_ray = self.node_models.xmlInitNode('radiative_transfer')
+ self.node_Coal = self.node_models.xmlGetNode('pulverized_coal')
+
+ self.radiativeModels = ('off', 'dom', 'p-1')
+ self.optionsList = [0, 1, 2]
+
+ self.c_prop = {}
+ self.b_prop = {}
+
+ #self.c_prop['intensity'] = self.tr("Intensity")
+ #self.c_prop['implicite_source_term'] = self.tr("Implicite_source_term")
+ self.c_prop['qrad_x'] = self.tr("Qrad_x")
+ self.c_prop['qrad_y'] = self.tr("Qrad_y")
+ self.c_prop['qrad_z'] = self.tr("Qrad_z")
+ self.c_prop['radiative_source_term'] = self.tr("Radiative_source_term")
+ self.c_prop['absorption'] = self.tr("Absorption")
+ self.c_prop['emission'] = self.tr("Emission")
+ self.c_prop['absorption_coefficient'] = self.tr("Absorption_coefficient")
+
+ self.b_prop['wall_temp'] = self.tr("Wall_temperature")
+ self.b_prop['flux_incident'] = self.tr("Flux_incident")
+ self.b_prop['thickness'] = self.tr("Thickness")
+ self.b_prop['thermal_conductivity'] = self.tr("Thermal_conductivity")
+ self.b_prop['emissivity'] = self.tr("Emissivity")
+ self.b_prop['flux_net'] = self.tr("Flux_net")
+ self.b_prop['flux_convectif'] = self.tr("Flux_convectif")
+ self.b_prop['coeff_ech_conv'] = self.tr("Coeff_ech_convectif")
+
+ self.classesNumber = 0
+ self.isCoalCombustion()
+
+
+ def __volumeProperties(self):
+ """
+ Return the name and the defaul label for cells properties.
+ """
+ for k, v in self.c_prop.items():
+ if k in ('absorption', 'emission', 'radiative_source_term', 'absorption_coefficient'):
+ for classe in range(1, self.classesNumber+1):
+ k = '%s_%2.2i' % (k, classe)
+ v = '%s_%2.2i' % (v, classe)
+ self.c_prop[k] = v
+ return self.c_prop
+
+
+ def __boundaryProperties(self):
+ """
+ Return the name and the defaul label for boundaries properties.
+ """
+ return self.b_prop
+
+
+ def _defaultValues(self):
+ """
+ Private method : return in a dictionnary which contains default values
+ """
+ default = {}
+ default['radiative_model'] = "off"
+ default['directions_number'] = 32
+ default['restart_status'] = 'off'
+ default['type_coef'] = 'constant'
+ default['value_coef'] = 0.0
+ default['frequency'] = 1
+ default['idiver'] = 2
+ default['tempP'] = 1
+ default['intensity'] = 0
+ return default
+
+
+ def __dicoRayLabel():
+ """
+ """
+ dico = {}
+ rayName = ['srad', 'qrad', 'absorp', 'emiss', 'coefAb',
+ 'wall_temp', 'flux_incident', 'thermal_conductivity', 'thickness',
+ 'emissivity', 'flux_net', 'flux_convectif', 'coeff_ech_conv']
+
+ raylabF = ['Srad', 'Qrad', 'Absorp', 'Emiss', 'CoefAb',
+ 'Temp_paroi', 'Flux_incident', 'Conductivite_th', 'Epaisseur',
+ 'Emissivite', 'Flux_net', 'Flux_convectif', 'Coeff_ech_conv']
+
+ raylabE = ['Srad', 'Qrad', 'Absorp', 'Emiss', 'CoefAb',
+ 'Wall_temp', 'Flux_incident', 'Th_conductivity', 'Thickness',
+ 'Emissivity','Flux_net', 'Flux_convectif', 'Coeff_ech_conv']
+
+ dico['name'] = rayName
+ dico['labF'] = raylabF
+ dico['labE'] = raylabE
+ if GuiParam.lang == 'fr':
+ label = dico['labF']
+ else:
+ label = dico['labE']
+
+ return dico['name'], label
+
+
+# def _getCoalModel(self):
+# """
+# Private method : return value model of radiative transfer for coal
+# """
+# import Pages.CoalThermoChemistry as CoalThermoChemistry
+# model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+# model.load()
+# ind = model.radiativTransfer.getRadiativTransfer()
+# if (ind == 1) or (ind == 2):
+# val = "dom"
+# elif (ind == 3) or (ind == 4):
+# val = "p-1"
+# else:
+# val = self._defaultValues()['radiative_model']
+# return val
+
+
+# def _setCoalModel(self, model2):
+# """
+# Private method : put value of model of radiative transfer for coal
+# """
+# self.isInList(model2, self.radiativeModels)
+# import Pages.CoalThermoChemistry as CoalThermoChemistry
+# model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+# model.load()
+# ind = 0
+# node_coeff = self.node_ray.xmlGetNode('absorption_coefficient', 'type')
+# if model2 != "off":
+# if model2 == "p-1":
+# ind = 2
+# coalCoeff = 'constant'
+# if node_coeff:
+# coalCoeff = node_coeff['type']
+# if coalCoeff == 'constant':
+# ind += 1
+# elif coalCoeff == 'modak':
+# ind += 2
+# model.radiativTransfer.setRadiativTransfer(ind)
+# model.save()
+
+
+# def _getTypeCoalCoeff(self):
+# """
+# Private method : return type of coefficient absorption for coal
+# """
+# import Pages.CoalThermoChemistry as CoalThermoChemistry
+# model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+# model.load()
+# ind = model.radiativTransfer.getRadiativTransfer()
+# type = "constant"
+# if (ind == 1) or (ind == 3):
+# type = "constant"
+# elif (ind == 2) or (ind == 4):
+# type = "modak"
+# return type
+
+
+# def _setTypeCoalCoeff(self, val):
+# """
+# Private method : put indice relatively to type of
+# coefficient absorption for coal
+# """
+# self.isInList(val, ('constant', 'variable', 'modak'))
+# import Pages.CoalThermoChemistry as CoalThermoChemistry
+# model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+# model.load()
+# if val == "constant":
+# ind = 1
+# else :
+# ind = 2
+#
+# radModel = self.node_ray['model']
+# if radModel == 'p-1':
+# ind += 2
+# elif radModel == 'off':
+# ind = 0
+# model.radiativTransfer.setRadiativTransfer(ind)
+# model.save()
+
+
+ def _setBoundCond(self):
+ """
+ Private method : put by default boundary conditions for radiative
+ variables as soon as a radiative model is set
+ """
+ from Pages.LocalizationModel import LocalizationModel, Zone
+ from Pages.Boundary import Boundary
+ d = LocalizationModel('BoundaryZone', self.case)
+ for zone in d.getZones():
+ nature = zone.getNature()
+ if nature == 'wall':
+ label = zone.getLabel()
+ bdModel = Boundary("radiative_wall", label, self.case)
+ bdModel.getRadiativeChoice()
+
+
+ def _updateModelParameters(self, model):
+ """
+ Private method : put by default all parameters for radiative
+ variables as soon a radiative model is set
+ """
+ self.getRestart()
+ if model == 'dom':
+ self.getNbDir()
+ elif model == 'p-1':
+ self.node_ray.xmlRemoveChild('directions_number')
+ self.getAbsorCoeff()
+
+
+ def isCoalCombustion(self):
+ """
+ Return 0 if pulverized_coal's attribute model is 'off',
+ return 1 if it's different
+ """
+ value = 0
+ if self.node_Coal and self.node_Coal.xmlGetAttribute('model') != 'off':
+ value = 1
+ import Pages.CoalThermoChemistry as CoalThermoChemistry
+ model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+ coalsNumber = model.getCoals().getCoalNumber()
+ self.classesNumber = sum(model.getCoals().getClassesNumberList())
+
+ return value
+
+
+# def _setVariable_ray(self):
+# """
+# Private method: put all variables for thermal radiative transfer
+# """
+# dico = self.__dicoRayLabel()
+# if self.getRadiativeModel() != "off":
+# for nb in range(len(dico[0])):
+# if not self.node_ray.xmlGetNode('property', name =dico[0][nb]):
+# if dico[0][nb] in ("srad", "qrad", "absorp", "emiss", "coefAb"):
+# self.node_ray.xmlInitNode('property',
+# label=dico[1][nb],
+# name =dico[0][nb])
+# else:
+# self.node_ray.xmlInitNode('property',
+# label=dico[1][nb],
+# name =dico[0][nb],
+# support='boundary')
+
+
+ def _setVariable_ray(self):
+ if self.getRadiativeModel() != "off":
+ for k, v in self.__volumeProperties().items():
+ if not self.node_ray.xmlGetNode('property', name=k):
+ self.node_ray.xmlInitNode('property', label=v, name=k)
+
+ for k, v in self.__boundaryProperties().items():
+ if not self.node_ray.xmlGetNode('property', name=k):
+ self.node_ray.xmlInitNode('property', label=v, name=k, support='boundary')
+
+
+ def getRadiativeModel(self):
+ """
+ Return value of attribute model
+ """
+ #if self.isCoalCombustion():
+ # return self._getCoalModel()
+ #else:
+ model = self.node_ray['model']
+ if model not in self.radiativeModels:
+ model = self._defaultValues()['radiative_model']
+ self.setRadiativeModel(model)
+ return model
+
+
+ def setRadiativeModel(self, model):
+ """
+ Put value of attribute model to radiative transfer markup
+ """
+ self.isInList(model, self.radiativeModels)
+ self.node_ray['model'] = model
+ #if self.isCoalCombustion():
+ # self._setCoalModel(model)
+ if model in ('dom', 'p-1'):
+ self._setVariable_ray()
+ self._setBoundCond()
+ self._updateModelParameters(model)
+ OutputControlModel(self.case).setDomainBoundaryPostProStatus('on')
+
+
+
+ def getNbDir(self):
+ """ Return value of number of directions """
+ nb = self.node_ray.xmlGetInt('directions_number')
+ if nb == None:
+ nb = self._defaultValues()['directions_number']
+ self.setNbDir(nb)
+ return nb
+
+
+ def setNbDir(self, val):
+ """ Put value of number of directions """
+ self.isIntInList(val, [32, 128])
+ self.isInList(self.getRadiativeModel(), ('off', 'dom'))
+ self.node_ray.xmlSetData('directions_number', val)
+
+
+ def getRestart(self):
+ """
+ Return status of restart markup
+ """
+ node = self.node_ray.xmlInitNode('restart', 'status')
+ status = node['status']
+ if not status:
+ status = self._defaultValues()['restart_status']
+ self.setRestart(status)
+ return status
+
+
+ def setRestart(self, status):
+ """
+ Put status of restart markup
+ """
+ self.isOnOff(status)
+ node = self.node_ray.xmlInitNode('restart', 'status')
+ node['status'] = status
+
+
+ def getTypeCoeff(self):
+ """
+ Return value of attribute type of 'absorption_coefficient' markup
+ """
+ node = self.node_ray.xmlInitNode('absorption_coefficient', 'type')
+ type = node['type']
+# if self.isCoalCombustion():
+# type = self._getTypeCoalCoeff()
+# self._setTypeCoalCoeff(type)
+# else:
+ if not type:
+ type = self._defaultValues()['type_coef']
+ self.setTypeCoeff(type)
+ return type
+
+
+ def setTypeCoeff(self, type):
+ """
+ Put value of attribute type of 'absorption_coefficient' markup
+ """
+ self.isInList(type, ('constant', 'variable', 'formula', 'modak'))
+# if self.isCoalCombustion():
+# self._setTypeCoalCoeff(type)
+ node = self.node_ray.xmlInitNode('absorption_coefficient', 'type')
+ node['type'] = type
+
+
+ def getAbsorCoeff(self):
+ """
+ Return value of absorption coefficient
+ """
+ if self.isCoalCombustion():
+ import Pages.CoalThermoChemistry as CoalThermoChemistry
+ model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+ model.load()
+ val = model.radiativTransfer.getAbsorptionCoeff()
+ else :
+ self.getTypeCoeff()
+ node = self.node_ray.xmlGetNode('absorption_coefficient', 'type')
+ val = self.node_ray.xmlGetDouble('absorption_coefficient')
+ if val == None:
+ val = self._defaultValues()['value_coef']
+ self.setAbsorCoeff(val)
+ return val
+
+
+ def setAbsorCoeff(self, val):
+ """
+ Put value of absorption coefficient
+ """
+ self.isPositiveFloat(val)
+ if self.isCoalCombustion():
+ import Pages.CoalThermoChemistry as CoalThermoChemistry
+ model = CoalThermoChemistry.CoalThermoChemistryModel("dp_FCP", self.case)
+ model.load()
+ model.radiativTransfer.setAbsorptionCoeff(val)
+ model.save()
+
+ t = self.getTypeCoeff()
+ self.node_ray.xmlSetData('absorption_coefficient', val, type=t)
+
+
+
+ def getFrequency(self):
+ """ Return value of frequency for advanced options """
+ freq = self.node_ray.xmlGetInt('frequency')
+ if freq == None:
+ freq = self._defaultValues()['frequency']
+ self.setFrequency(freq)
+ return freq
+
+
+ def setFrequency(self, val):
+ """ Put value of frequency for advanced options """
+ self.isInt(val)
+ self.node_ray.xmlSetData('frequency', val)
+
+
+ def getIntensityResolution(self):
+ """ Return value of IIMLUM for advanced options """
+ intens = self.node_ray.xmlGetInt('intensity_resolution_listing_printing')
+ if intens == None:
+ intens = self._defaultValues()['intensity']
+ self.setIntensityResolution(intens)
+ return intens
+
+
+ def setIntensityResolution(self, intens):
+ """ Put value of IIMLUM for advanced options """
+ self.isIntInList(intens, self.optionsList)
+ self.node_ray.xmlSetData('intensity_resolution_listing_printing', intens)
+
+
+ def getTemperatureListing(self):
+ """ Return value of IIMPAR for advanced options """
+ tp = self.node_ray.xmlGetInt('temperature_listing_printing')
+ if tp == None:
+ tp = self._defaultValues()['tempP']
+ self.setTemperatureListing(tp)
+ return tp
+
+
+ def setTemperatureListing(self, val):
+ """ Put value of IIMPAR for advanced options """
+ self.isIntInList(val, self.optionsList)
+ self.node_ray.xmlSetData('temperature_listing_printing', val)
+
+
+ def getTrs(self):
+ """ Return value of IDIVER for advanced options """
+ idiver = self.node_ray.xmlGetInt('thermal_radiative_source_term')
+ if idiver == None:
+ idiver = self._defaultValues()['idiver']
+ self.setTrs(idiver)
+ return idiver
+
+
+ def setTrs(self, idiver):
+ """ Put value of IDIVER for advanced options """
+ self.isIntInList(idiver, self.optionsList)
+ self.node_ray.xmlSetData('thermal_radiative_source_term', idiver)
+
+
+ def getThermalRadiativeModel(self):
+ """
+ Return 0 if thermal radiative transfer is activated, or 1 if not.
+ Only used by the view of Thermal Scalar for the tree management.
+ """
+ if self.node_ray['model'] != 'off':
+ return 0
+ else:
+ return 1
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# ThermalRadiation test case
+#-------------------------------------------------------------------------------
+
+
+class ThermalRadiationTestCase(ModelTest):
+ """
+ """
+ def checkThermalRadiationInstantiation(self):
+ """
+ Check whether the ThermalRadiationModel class could be instantiated
+ """
+ mdl = None
+ mdl = ThermalRadiationModel(self.case)
+
+ assert mdl != None, 'Could not instantiate ThermalRadiationModel'
+
+
+ def checkIsCoalCombustion(self):
+ """
+ Check whether the ThermalRadiationModel class could be in coal combustion
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.node_Coal['model'] = 'off'
+ assert mdl.isCoalCombustion() != 1, 'Could not verify pulverized_coal is "on"'
+
+ def checkSetandGetRadiativeModel(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and get model
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ <directions_number>32</directions_number>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc), \
+ 'Could not set model in ThermalRadiationModel'
+ assert mdl.getRadiativeModel() == 'dom', \
+ 'Could not get model in ThermalRadiationModel'
+
+ def checkSetandgetNbDir(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and get
+ number of directions
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setNbDir(128)
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ <directions_number>128</directions_number>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc), \
+ 'Could not set number of directions in ThermalRadiationModel'
+ assert mdl.getNbDir() == 128, \
+ 'Could not get number of directions in ThermalRadiationModel'
+
+ def checkSetandGetRestart(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and get restart
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setRestart('on')
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="on"/>
+ <absorption_coefficient type="constant">0</absorption_coefficient>
+ <directions_number>32</directions_number>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc), \
+ 'Could not set restart in ThermalRadiationModel'
+ assert mdl.getRestart() == 'on', \
+ 'Could not get restart in ThermalRadiationModel'
+
+ def checkSetandGetTypeCoeff(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and
+ get type of absorption coefficient
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setTypeCoeff('variable')
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="variable">0</absorption_coefficient>
+ <directions_number>32</directions_number>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc), \
+ 'Could not set type of absorption coefficient in ThermalRadiationModel'
+ assert mdl.getTypeCoeff() == 'variable', \
+ 'Could not get type of absorption coefficient in ThermalRadiationModel'
+
+ def checkSetandGetAbsorCoeff(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and
+ get value of absorption coefficient
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setAbsorCoeff(0.77)
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0.77</absorption_coefficient>
+ <directions_number>32</directions_number>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc),\
+ 'Could not set value of absorption coefficient in ThermalRadiationModel'
+ assert mdl.getAbsorCoeff() == 0.77,\
+ 'Could not get value of absorption coefficient in ThermalRadiationModel'
+
+ def checkSetandGetFrequency(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and get
+ frequency for advanced options
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setFrequency(12)
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0.0</absorption_coefficient>
+ <directions_number>32</directions_number>
+ <frequency>12</frequency>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc),\
+ 'Could not set frequency for advanced options in ThermalRadiationModel'
+ assert mdl.getFrequency() == 12,\
+ 'Could not get frequency for advanced options in ThermalRadiationModel'
+
+ def checkSetandGetIntensityResolution(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and get
+ IIMLUM for advanced options
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setIntensityResolution(1)
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0.0</absorption_coefficient>
+ <directions_number>32</directions_number>
+ <intensity_resolution_listing_printing>1</intensity_resolution_listing_printing>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc),\
+ 'Could not set IIMLUM for advanced options in ThermalRadiationModel'
+ assert mdl.getFrequency() == 1,\
+ 'Could not get IIMLUM for advanced options in ThermalRadiationModel'
+
+ def checkSetandGetTemperatureListing(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and get
+ IIMPAR for advanced options
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setTemperatureListing(2)
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0.0</absorption_coefficient>
+ <directions_number>32</directions_number>
+ <temperature_listing_printing>2</temperature_listing_printing>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc),\
+ 'Could not set IIMPAR for advanced options in ThermalRadiationModel'
+ assert mdl.getTemperatureListing() == 2,\
+ 'Could not get IIMPAR for advanced options in ThermalRadiationModel'
+
+ def checkSetandGetTrs(self):
+ """
+ Check whether the ThermalRadiationModel class could be set and get
+ IDIVER for advanced options
+ """
+ mdl = ThermalRadiationModel(self.case)
+ mdl.setRadiativeModel('dom')
+ mdl.setTrs(2)
+ doc = '''<radiative_transfer model="dom">
+ <property label="Srad" name="srad"/>
+ <property label="Qrad" name="qrad"/>
+ <property label="Absorp" name="absorp"/>
+ <property label="Emiss" name="emiss"/>
+ <property label="CoefAb" name="coefAb"/>
+ <property label="Wall_temp" name="wall_temp" support="boundary"/>
+ <property label="Flux_incident" name="flux_incident" support="boundary"/>
+ <property label="Th_conductivity" name="thermal_conductivity" support="boundary"/>
+ <property label="Thickness" name="thickness" support="boundary"/>
+ <property label="Emissivity" name="emissivity" support="boundary"/>
+ <property label="Flux_net" name="flux_net" support="boundary"/>
+ <property label="Flux_convectif" name="flux_convectif" support="boundary"/>
+ <property label="Coeff_ech_conv" name="coeff_ech_conv" support="boundary"/>
+ <restart status="off"/>
+ <absorption_coefficient type="constant">0.0</absorption_coefficient>
+ <directions_number>32</directions_number>
+ <thermal_radiative_source_term>2</thermal_radiative_source_term>
+ </radiative_transfer>'''
+ assert mdl.node_ray == self.xmlNodeFromString(doc),\
+ 'Could not set IDIVER for advanced options in ThermalRadiationModel'
+ assert mdl.getTrs() == 2,\
+ 'Could not get IDIVER for advanced options in ThermalRadiationModel'
+
+ def checkGetThermalRadiativeModel(self):
+ """
+ Check whether a thermal radiative model could be get
+ """
+ mdl = ThermalRadiationModel(self.case)
+ assert mdl.getThermalRadiativeModel() == 1,\
+ 'Could not get thermal radiative model'
+
+
+
+def suite():
+ testSuite = unittest.makeSuite(ThermalRadiationTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "ThermalRadiationTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/ThermalRadiationView.py b/gui/Pages/ThermalRadiationView.py
new file mode 100644
index 0000000..fc96eb7
--- /dev/null
+++ b/gui/Pages/ThermalRadiationView.py
@@ -0,0 +1,373 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Thermal Radiation model
+
+This module contains the following classes and function:
+- ThermalRadiationView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from ThermalRadiationForm import Ui_ThermalRadiationForm
+from ThermalRadiationAdvancedDialogForm import Ui_ThermalRadiationAdvancedDialogForm
+import Base.QtPage as QtPage
+from Pages.ThermalRadiationModel import ThermalRadiationModel
+from Pages.OutputControlModel import OutputControlModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("ThermalRadiationView")
+log.setLevel(GuiParam.DEBUG)
+
+#--------------------------------------------------------------------------------
+# Popup Class
+#--------------------------------------------------------------------------------
+
+class ThermalRadiationAdvancedDialogView(QDialog, Ui_ThermalRadiationAdvancedDialogForm):
+ """
+ Building of popup window for advanced options.
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_ThermalRadiationAdvancedDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("Advanced options"))
+ self.default = default
+ self.result = self.default.copy()
+
+ # Combo models
+
+ self.modelTSRay = QtPage.ComboModel(self.comboBoxTSRay, 3, 1)
+ self.modelPrintT = QtPage.ComboModel(self.comboBoxPrintT, 3, 1)
+ self.modelPrintL = QtPage.ComboModel(self.comboBoxPrintL, 3, 1)
+
+ self.modelTSRay.addItem('0', '0')
+ self.modelTSRay.addItem('1', '1')
+ self.modelTSRay.addItem('2', '2')
+
+ self.modelPrintT.addItem('0', '0')
+ self.modelPrintT.addItem('1', '1')
+ self.modelPrintT.addItem('2', '2')
+
+ self.modelPrintL.addItem('0', '0')
+ self.modelPrintL.addItem('1', '1')
+ self.modelPrintL.addItem('2', '2')
+
+ self.frequ = self.default['frequency']
+ self.tsr = self.default['idiver']
+ self.printTemp = self.default['tempP']
+ self.printLum = self.default['intensity']
+ model = self.default['model']
+
+ # Initialization
+
+ self.lineEditFreq.setText(QString(str(self.frequ)))
+ self.modelTSRay.setItem(str_model=str(self.tsr))
+ self.modelPrintT.setItem(str_model=str(self.printTemp))
+ self.modelPrintL.setItem(str_model=str(self.printLum))
+
+ if model == 'dom':
+ self.labelPrintL.show()
+ self.comboBoxPrintL.show()
+ else:
+ self.labelPrintL.hide()
+ self.comboBoxPrintL.hide()
+
+ # Validator
+
+ validatorFreq = QtPage.IntValidator(self.lineEditFreq, min=1)
+ self.lineEditFreq.setValidator(validatorFreq)
+
+
+ def accept(self):
+ """
+ What to do when user clicks on 'OK'.
+ """
+ if self.lineEditFreq.validator().state == QValidator.Acceptable:
+ self.result['frequency'], ok = self.lineEditFreq.text().toInt()
+ self.result['idiver'], ok = self.comboBoxTSRay.currentText().toInt()
+ self.result['tempP'], ok = self.comboBoxPrintT.currentText().toInt()
+ self.result['intensity'], ok = self.comboBoxPrintL.currentText().toInt()
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when 'Cancel' button is clicked.
+ """
+ QDialog.reject(self)
+
+
+ def get_result(self):
+ """
+ Method to get the result.
+ """
+ return self.result
+
+
+ def tr(self, text):
+ """
+ Translation.
+ """
+ return text
+
+
+#--------------------------------------------------------------------------------
+# Main class
+#--------------------------------------------------------------------------------
+
+class ThermalRadiationView(QWidget, Ui_ThermalRadiationForm):
+ """
+ Class to open Thermal Scalar Transport Page.
+ """
+ def __init__(self, parent, case, tree):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_ThermalRadiationForm.__init__(self)
+ self.setupUi(self)
+
+ self.browser = tree
+ self.case = case
+ self.mdl = ThermalRadiationModel(self.case)
+
+ # Combo models
+
+ self.modelRadModel = QtPage.ComboModel(self.comboBoxRadModel, 3, 1)
+ self.modelDirection = QtPage.ComboModel(self.comboBoxDirection, 2, 1)
+ self.modelAbsorption = QtPage.ComboModel(self.comboBoxAbsorption, 3, 1)
+
+ self.modelRadModel.addItem("No radiative transfers", 'off')
+ self.modelRadModel.addItem("Discrete ordinates method", 'dom')
+ self.modelRadModel.addItem("P-1 Model", 'p-1')
+
+ self.modelDirection.addItem("32")
+ self.modelDirection.addItem("128")
+
+ # Connections
+
+ self.connect(self.comboBoxRadModel,
+ SIGNAL("activated(const QString&)"),
+ self.slotRadiativeTransfer)
+ self.connect(self.radioButtonOn,
+ SIGNAL("clicked()"),
+ self.slotStartRestart)
+ self.connect(self.radioButtonOff,
+ SIGNAL("clicked()"),
+ self.slotStartRestart)
+ self.connect(self.comboBoxDirection,
+ SIGNAL("activated(const QString&)"),
+ self.slotDirection)
+ self.connect(self.comboBoxAbsorption,
+ SIGNAL("activated(const QString&)"),
+ self.slotTypeCoefficient)
+ self.connect(self.lineEditCoeff,
+ SIGNAL("textChanged(const QString &)"),
+ self.slotAbsorptionCoefficient)
+ self.connect(self.toolButtonAdvanced,
+ SIGNAL("clicked()"),
+ self.slotAdvancedOptions)
+
+ # Validator
+
+ validatorCoeff = QtPage.DoubleValidator(self.lineEditCoeff, min=0.0)
+ self.lineEditCoeff.setValidator(validatorCoeff)
+
+ self.modelAbsorption.addItem('constant', 'constant')
+ self.modelAbsorption.addItem('user subroutine (usray3)', 'variable')
+ self.modelAbsorption.addItem('user law', 'formula')
+ self.modelAbsorption.addItem('H2O and CO2 mixing (Modak)', 'modak')
+
+ if self.mdl.isCoalCombustion():
+ self.modelAbsorption.disableItem(str_model='variable')
+ self.modelAbsorption.enableItem(str_model='modak')
+ else:
+ self.modelAbsorption.disableItem(str_model='modak')
+ self.modelAbsorption.enableItem(str_model='variable')
+
+ self.modelAbsorption.disableItem(str_model='formula')
+
+ # Initialization
+
+ self.modelRadModel.setItem(str_model=self.mdl.getRadiativeModel())
+ self.slotRadiativeTransfer()
+
+ if self.mdl.getRestart() == 'on':
+ self.radioButtonOn.setChecked(True)
+ self.radioButtonOff.setChecked(False)
+ else:
+ self.radioButtonOn.setChecked(False)
+ self.radioButtonOff.setChecked(True)
+
+ value = self.mdl.getTypeCoeff()
+ self.modelAbsorption.setItem(str_model=value)
+ self.slotTypeCoefficient(self.modelAbsorption.dicoM2V[value])
+
+ self.pushButtonCoeffFormula.setEnabled(False)
+
+ self.lineEditCoeff.setText(QString(str(self.mdl.getAbsorCoeff())))
+
+
+ @pyqtSignature("const QString &")
+ def slotRadiativeTransfer(self):
+ """
+ """
+ model = self.modelRadModel.dicoV2M[str(self.comboBoxRadModel.currentText())]
+ self.mdl.setRadiativeModel(model)
+ if model == 'off':
+ self.frameOptions.hide()
+ self.line.hide()
+ OutputControlModel(self.case).setDomainBoundaryPostProStatus('off')
+ else:
+ self.frameOptions.show()
+ self.line.show()
+ OutputControlModel(self.case).setDomainBoundaryPostProStatus('on')
+
+ if model == 'p-1':
+ self.frameDirection.hide()
+ elif model == 'dom':
+ self.frameDirection.show()
+ self.modelDirection.setItem(str_model=str(self.mdl.getNbDir()))
+
+ self.browser.configureTree(self.case)
+
+
+ @pyqtSignature("")
+ def slotStartRestart(self):
+ """
+ """
+ if self.radioButtonOn.isChecked():
+ self.mdl.setRestart("on")
+ else:
+ self.mdl.setRestart("off")
+
+
+ @pyqtSignature("const QString &")
+ def slotDirection(self, text):
+ """
+ """
+ n, ok = text.toInt()
+ self.mdl.setNbDir(n)
+
+
+ @pyqtSignature("const QString &")
+ def slotTypeCoefficient(self, text):
+ """
+ """
+ typeCoeff = self.modelAbsorption.dicoV2M[str(text)]
+ self.mdl.setTypeCoeff(typeCoeff)
+
+ if typeCoeff == 'constant':
+ self.lineEditCoeff.setEnabled(True)
+ elif typeCoeff == 'modak':
+ self.lineEditCoeff.setDisabled(True)
+ else:
+ self.lineEditCoeff.setDisabled(True)
+
+
+ @pyqtSignature("const QString &")
+ def slotAbsorptionCoefficient(self, text):
+ """
+ """
+ c, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setAbsorCoeff(c)
+
+
+ @pyqtSignature("")
+ def slotAdvancedOptions(self):
+ """
+ Ask one popup for advanced specifications
+ """
+ default = {}
+ default['frequency'] = self.mdl.getFrequency()
+ default['idiver'] = self.mdl.getTrs()
+ default['tempP'] = self.mdl.getTemperatureListing()
+ default['intensity'] = self.mdl.getIntensityResolution()
+ default['model'] = self.mdl.getRadiativeModel()
+ log.debug("slotAdvancedOptions -> %s" % str(default))
+
+ dialog = ThermalRadiationAdvancedDialogView(self, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotAdvancedOptions -> %s" % str(result))
+ self.mdl.setFrequency(result['frequency'])
+ self.mdl.setTrs(result['idiver'])
+ self.mdl.setTemperatureListing(result['tempP'])
+ self.mdl.setIntensityResolution(result['intensity'])
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+
+if __name__ == "__main__":
+ pass
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/ThermalScalarForm.ui b/gui/Pages/ThermalScalarForm.ui
new file mode 100644
index 0000000..fcb0894
--- /dev/null
+++ b/gui/Pages/ThermalScalarForm.ui
@@ -0,0 +1,103 @@
+<ui version="4.0" >
+ <class>ThermalScalarForm</class>
+ <widget class="QWidget" name="ThermalScalarForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>84</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Thermal scalar</string>
+ </property>
+ <property name="flat" >
+ <bool>false</bool>
+ </property>
+ <property name="checkable" >
+ <bool>false</bool>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="leftMargin" >
+ <number>9</number>
+ </property>
+ <property name="horizontalSpacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxThermal" >
+ <property name="minimumSize" >
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key words: ISCALT, ISCSTH </string>
+ </property>
+ <property name="statusTip" >
+ <string>Select the thermal scalar</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>21</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/ThermalScalarModel.py b/gui/Pages/ThermalScalarModel.py
new file mode 100644
index 0000000..2b74bb3
--- /dev/null
+++ b/gui/Pages/ThermalScalarModel.py
@@ -0,0 +1,247 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+
+"""
+This module defines the thermal scalar management.
+
+This module contains the following classes and function:
+- ThermalScalarModel
+- ThermalScalarTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import unittest
+import sys
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLmodel import ModelTest
+from Base.XMLvariables import Variables, Model
+from DefineUserScalarsModel import DefineUserScalarsModel
+from ThermalRadiationModel import ThermalRadiationModel
+
+#-------------------------------------------------------------------------------
+# Thermal scalar model class
+#-------------------------------------------------------------------------------
+
+class ThermalScalarModel(DefineUserScalarsModel, Variables, Model):
+ """
+ The thermal scalar could be temperature
+ (Celsius degrees or Kelvin) either enthalpy.
+ """
+ def __init__(self, case):
+ """
+ Constuctor.
+ """
+ DefineUserScalarsModel.__init__(self, case)
+
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_therm = self.node_models.xmlInitChildNode('thermal_scalar', 'model')
+ self.node_prop = self.case.xmlGetNode('physical_properties').xmlGetNode('fluid_properties')
+
+ self.node_coal = self.node_models.xmlGetChildNode('pulverized_coal', 'model')
+ self.node_joule = self.node_models.xmlGetChildNode('joule_effect', 'model')
+ self.node_gas = self.node_models.xmlGetChildNode('gas_combustion', 'model')
+ self.node_ray = self.node_models.xmlGetChildNode('radiative_transfer', 'model')
+
+ self.old_scaTh = "off"
+
+ self.thermalModel = ('off',
+ 'temperature_celsius',
+ 'temperature_kelvin',
+ 'enthalpy')
+
+
+ def _defaultThermalScalarValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+ default['thermal_scalar'] = "off"
+
+ return default
+
+
+ def _setNewThermalScalar(self, thermal_scalar):
+ """
+ Put a new thermal scalar name on to the XML document and its dependances
+ """
+ self.isInList(thermal_scalar, self.thermalModel)
+ node = self.scalar_node.xmlInitNode('scalar', name=thermal_scalar, type='thermal')
+
+ if not node['label']:
+ lab_def = Tool.dicoLabel(node['name'])
+ node['label'] = lab_def
+ else:
+ lab_def = node['label']
+
+ self.setScalarInitialValue(self.defaultScalarValues()['zone'],
+ lab_def,
+ self.defaultScalarValues()[thermal_scalar])
+ self.setScalarMinValue(lab_def, self.defaultScalarValues()['min_value'])
+ self.setScalarMaxValue(lab_def, self.defaultScalarValues()['max_value'])
+ self.setNewFluidProperty(self.node_prop, 'thermal_conductivity')
+
+ self.setScalarBoundaries()
+
+
+ def _removeThermalTimeStep(self):
+ """
+ Private method : remove node 'thermal_time_step' in time_parameters
+ we call function from TimeStepModel
+ """
+ from TimeStepModel import TimeStepModel
+ TimeStepModel(self.case).RemoveThermalTimeStepNode()
+ del TimeStepModel
+
+
+ def thermalScalarModelsList(self):
+ """
+ Create a tuple with the thermal scalar allowed by the calculation
+ features (multi-phases model, and reactive flow models).
+ """
+ thermalScalarList = self.thermalModel
+
+ for node in (self.node_gas, self.node_coal, self.node_joule):
+ if node['model'] != 'off':
+ thermalScalarList = ('off',)
+
+ return thermalScalarList
+
+
+ def setThermalModel(self, thermal_scalar):
+ """
+ Update the thermal model and create the thermal scalar markup from the XML document.
+ """
+ self.isInList(thermal_scalar, self.thermalModel)
+
+ self.node_therm['model'] = thermal_scalar
+ if thermal_scalar != 'off':
+ node = self.scalar_node.xmlGetNode('scalar', type='thermal')
+ if node:
+ if node['name'] != thermal_scalar:
+ self.deleteScalar(node['label'])
+ self._setNewThermalScalar(thermal_scalar)
+ n = self.node_therm.xmlInitChildNode('property',
+ name="input_thermal_flux",
+ support="boundary")
+ if not n['label']:
+## n['label'] = "input_thermal_flux"
+ n['label'] = "Flux_thermique_entrant"
+
+ else:
+ node = self.scalar_node.xmlGetNode('scalar', type='thermal')
+ if node:
+ self.deleteScalar(node['label'])
+ self._removeThermalTimeStep()
+ ThermalRadiationModel(self.case).setRadiativeModel('off')
+ self.node_therm.xmlRemoveChild('property',
+ name="input_thermal_flux",
+ support="boundary")
+
+
+
+ def getThermalScalarModel(self):
+ """
+ Get name of thermal scalar (not label)
+ """
+ model = self.node_therm['model']
+ if not model:
+ model = self._defaultThermalScalarValues()['thermal_scalar']
+ self.setThermalModel(model)
+ return model
+
+
+#-------------------------------------------------------------------------------
+# ThermalScalar Model test case
+#-------------------------------------------------------------------------------
+
+
+class ThermalScalarTestCase(ModelTest):
+ """
+ """
+ def checkThermalInstantiation(self):
+ """
+ Check whether the ThermalScalarModel class could be instantiated
+ """
+ model = None
+ model = ThermalScalarModel(self.case)
+ assert model != None, 'Could not instantiate ThermalScalarModel'
+
+ def checkThermalScalarModelsList(self):
+ """
+ Check whether the ThermalScalarModelsList could be get
+ """
+ mdl = ThermalScalarModel(self.case)
+ mdl.node_gas['model'] = 'on'
+ assert mdl.getThermalScalarModel() == ('off'),\
+ 'Could not use the thermalScalarModelsList method'
+
+ def checkUpdateandGetThermalScalarModel(self):
+ """
+ Check whether a new thermal scalar could be set and get
+ """
+ mdl = ThermalScalarModel(self.case)
+ mdl.setThermalModel('temperature_kelvin')
+ doc = '''<additional_scalars>
+ <scalar label="Temp.K" name="temperature_kelvin" type="thermal">
+ <initial_value zone="1">293.15</initial_value>
+ <min_value>-1e+12</min_value>
+ <max_value>1e+12</max_value>
+ </scalar>
+ </additional_scalars>'''
+
+ assert mdl.scalar_node == self.xmlNodeFromString(doc), \
+ 'Could not update thermal scalar in ThermalScalarModel'
+ assert mdl.getThermalScalarModel() == 'temperature_kelvin', \
+ 'Could not get the thermal scalar'
+
+
+def suite():
+ testSuite = unittest.makeSuite(ThermalScalarTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print "ThermalScalarTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/ThermalScalarView.py b/gui/Pages/ThermalScalarView.py
new file mode 100644
index 0000000..c487927
--- /dev/null
+++ b/gui/Pages/ThermalScalarView.py
@@ -0,0 +1,136 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the thermal scalar management.
+
+This module contains the following classes and function:
+- ThermalScalarView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from ThermalScalarForm import Ui_ThermalScalarForm
+import Base.QtPage as QtPage
+from ThermalScalarModel import ThermalScalarModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("ThermalScalarView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class ThermalScalarView(QWidget, Ui_ThermalScalarForm):
+ """
+ Class to open Thermal Scalar Transport Page.
+ """
+ def __init__(self, parent, case, tree):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_ThermalScalarForm.__init__(self)
+ self.setupUi(self)
+
+ self.browser = tree
+ self.case = case
+ self.thermal = ThermalScalarModel(self.case)
+
+ # combo Model
+
+ self.modelThermal = QtPage.ComboModel(self.comboBoxThermal, 4, 1)
+ self.modelThermal.addItem(self.tr("No thermal scalar"), 'off')
+ self.modelThermal.addItem(self.tr("Temperature (Celsius)"), 'temperature_celsius')
+ self.modelThermal.addItem(self.tr("Temperature (Kelvin)"), 'temperature_kelvin')
+ self.modelThermal.addItem(self.tr("Enthalpy (J/kg)"), 'enthalpy')
+
+ self.connect(self.comboBoxThermal, SIGNAL("activated(const QString&)"), self.slotThermalScalar)
+
+ # Update the thermal scalar list with the calculation features
+
+ for sca in self.thermal.thermalModel:
+ if sca not in self.thermal.thermalScalarModelsList():
+ self.modelThermal.disableItem(str_model=sca)
+
+ # Select the thermal scalar model
+
+ model = self.thermal.getThermalScalarModel()
+ self.modelThermal.setItem(str_model=model)
+
+
+ @pyqtSignature("const QString &")
+ def slotThermalScalar(self, text):
+ """
+ Update the thermal scalar markup.
+ """
+ th = self.modelThermal.dicoV2M[str(text)]
+ self.thermal.setThermalModel(th)
+
+ self.browser.configureTree(self.case)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/TimeAveragesForm.ui b/gui/Pages/TimeAveragesForm.ui
new file mode 100644
index 0000000..ce06f24
--- /dev/null
+++ b/gui/Pages/TimeAveragesForm.ui
@@ -0,0 +1,295 @@
+<ui version="4.0" >
+ <class>TimeAveragesForm</class>
+ <widget class="QWidget" name="TimeAveragesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>448</height>
+ </rect>
+ </property>
+ <property name="acceptDrops" >
+ <bool>true</bool>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Time averages</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QTreeView" name="treeViewAverage" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="indentation" >
+ <number>0</number>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QPushButton" name="pushButtonAdd" >
+ <property name="text" >
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonEdit" >
+ <property name="text" >
+ <string>Edit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonDelete" >
+ <property name="text" >
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelAverage" >
+ <property name="text" >
+ <string>Label of time average </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditAverage" >
+ <property name="toolTip" >
+ <string>To give a name for the choosen time average</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelStart" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTDMOM(IMOM)</string>
+ </property>
+ <property name="text" >
+ <string>Start iteration number
+for time average calculation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditStart" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTDMOM(IMOM)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelRestart" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMOOLD(IMOM)</string>
+ </property>
+ <property name="text" >
+ <string>If restart, number in preceding calculation
+of the time average to use to initalize
+the selected time average.
+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditRestart" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IMOOLD(IMOM)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QListView" name="listViewDrag" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="font" >
+ <font>
+ <pointsize>20</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="pixmap" >
+ <pixmap resource="resources_pages.qrc" >:/new/prefix1/icons/32x32/go-next.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListView" name="listViewDrop" >
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/TimeAveragesModel.py b/gui/Pages/TimeAveragesModel.py
new file mode 100644
index 0000000..1f1b718
--- /dev/null
+++ b/gui/Pages/TimeAveragesModel.py
@@ -0,0 +1,391 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the Time averages page.
+
+This module defines the following classes:
+- TimeAveragesModel
+- TimeAveragesTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, string, types, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLmodel import XMLmodel, ModelTest
+from Base.XMLvariables import Model
+from Pages.OutputVolumicVariablesModel import OutputVolumicVariablesModel
+from Pages.StartRestartModel import StartRestartModel
+
+#-------------------------------------------------------------------------------
+# Model class
+#-------------------------------------------------------------------------------
+
+class TimeAveragesModel(Model):
+ """
+ Class to open TimeAverages Page.
+ """
+ def __init__(self, case):
+ """
+ Simple constructor.
+ """
+ self.case = case
+ self.node_anal = self.case.xmlInitNode('analysis_control')
+ self.node_mean = self.node_anal.xmlInitNode('time_averages')
+ self.node_model = self.case.xmlInitNode('thermophysical_models')
+ self.node_model_vp = self.node_model.xmlInitNode('velocity_pressure')
+ self.node_var_vp = self.node_model_vp.xmlGetNodeList('variable')
+ self.node_pro_vp = self.node_model_vp.xmlGetNodeList('property')
+
+ self.__updateDicoLabel2Name()
+
+
+ def __defaultValues(self):
+ """
+ Private method.
+ Return a dictionnary with default values
+ """
+ value = {}
+ if StartRestartModel(self.case).getRestart() == 'off':
+ value['restart'] = 0
+ else:
+ value['restart'] = -1
+
+ return value
+
+
+ def __updateDicoLabel2Name(self):
+ """
+ Private method.
+ Gets a dictionnary to connect name and label from
+ variables and properties.
+ """
+ # FIXME: merge this method with the same one in ProfilesView
+ self.dicoLabel2Name = {}
+ model = XMLmodel(self.case)
+ output = OutputVolumicVariablesModel(self.case)
+ for nodeList in [self.node_var_vp,
+ self.node_pro_vp,
+ model.getTurbNodeList(),
+ output.getFluidProperty(),
+ output.getAdditionalScalarProperty(),
+ output.getTimeProperty(),
+ output.getListOfTimeMeans(),
+ output.getPuCoalScalProper(),
+ output.getMeteoScalProper(),
+ output.getThermalScalar(),
+ output.getAdditionalScalar()]:
+
+ for node in nodeList:
+ name = node['name']
+ label = node['label']
+ if not label:
+ raise ValueError, "Node has no label"
+
+ if not (node['support'] and node['support'] == "boundary"):
+ if name != 'local_time_step':
+ self.dicoLabel2Name[label] = name
+
+ return self.dicoLabel2Name.keys()
+
+
+ def ___updateAverageNumbers(self, imom):
+ """
+ Private method.
+ Update order of average.
+ """
+ for index in self.getAverageList():
+ lab, start, restart, list = self.getAverageInformations(index)
+ if index >= imom:
+ nb = str(index - 1)
+ if lab == 'Moy' + str(index):
+ lab = 'Moy' + nb
+ node = self.node_mean.xmlGetNode('time_average', id=index)
+ node['id'] = nb
+ node['label'] = lab
+
+
+ def __updateAverage(self, nb, label, start, restart, list):
+ """
+ Private method.
+ Update data for average I{llabel}.
+ """
+ node = self.node_mean.xmlInitNode('time_average', id=nb)
+ node['label'] = label
+ for var in list:
+ self.isInList(var, self.dicoLabel2Name.keys())
+ node.xmlAddChild('var_prop', name=self.dicoLabel2Name[var])
+ node.xmlSetData('time_step_start', start)
+ if StartRestartModel(self.case).getRestart() != 'off' and restart != -1:
+ node.xmlSetData('restart_from_time_average', restart)
+ else:
+ if node.xmlGetInt('restart_from_time_average'):
+ node.xmlRemoveChild('restart_from_time_average')
+
+
+ def setAverage(self, nb, label, start, restart, list):
+ """
+ Public method.
+ Sets list of variables or properties used for calculation of average
+ for average number nb, and time's start and restart values.
+ """
+ self.isNotInList(nb, self.getAverageList())
+ for i in (nb, start):
+ self.isInt(i)
+ if StartRestartModel(self.case).getRestart() != 'off':
+ self.isInt(restart)
+ self.isNotInList(label, self.getAverageLabelsList())
+
+ self.__updateAverage(nb, label, start, restart, list)
+
+
+ def replaceAverage(self, nb, label, start, restart, list):
+ """
+ Public method.
+ Replaces list of variables or properties used for calculation of mean
+ for average number nb, or label, or time's start or restart values.
+ """
+ self.isInList(nb, self.getAverageList())
+ for i in (nb, start):
+ self.isInt(i)
+ if StartRestartModel(self.case).getRestart() != 'off':
+ self.isInt(restart)
+
+ node = self.node_mean.xmlGetNode('time_average', id=nb)
+ if node:
+ node.xmlRemoveChild('var_prop')
+ node.xmlRemoveChild('time_step_start')
+ node.xmlRemoveChild('restart_from_time_average')
+ self.__updateAverage(nb, label, start, restart, list)
+
+
+ def deleteAverage(self, nb):
+ """
+ Public method.
+ Sets list of variables or properties used for calculation of mean
+ for average number nb, and time's start and restart values.
+ """
+ self.isInt(nb)
+ node = self.node_mean.xmlGetNode('time_average', id=nb)
+ if node:
+ node.xmlRemoveNode()
+## node.xmlRemoveChild('var_prop')
+## node.xmlRemoveChild('time_step_start')
+## if node.xmlGetInt('restart_from_time_average'):
+## node.xmlRemoveChild('restart_from_time_average')
+ self.___updateAverageNumbers(nb)
+
+
+ def getAverageList(self):
+ """
+ Public method.
+ Gets list of averages and return list of imom number.
+ """
+ list = []
+ for node in self.node_mean.xmlGetNodeList('time_average'):
+ list.append(int(node['id']))
+
+ return list
+
+
+ def getAverageInformations(self, imom):
+ """
+ Public method.
+ Gets average with imom and return time_step_start, restart_from_time_average,
+ and list of variables or properties ....
+ """
+ self.isInt(imom)
+ list = []
+ restart = self.__defaultValues()['restart']
+ node = self.node_mean.xmlGetNode('time_average', id=imom)
+ start = node.xmlGetInt('time_step_start')
+ if StartRestartModel(self.case).getRestart() != 'off':
+ restart = node.xmlGetInt('restart_from_time_average')
+
+ for var in node.xmlGetChildNodeList('var_prop'):
+ for label in self.dicoLabel2Name.keys():
+ if self.dicoLabel2Name[label] == var['name']:
+ list.append(label)
+ return node['label'], start, restart, list
+
+
+ def getAverageLabelsList(self):
+ """
+ Public method.
+ Gets list of averages's labels.
+ """
+ list = []
+ for node in self.node_mean.xmlGetNodeList('time_average'):
+ label = node['label']
+ list.append(label)
+ return list
+
+
+ def getAverageRestart(self, nb):
+ """
+ Public method. Only for GUI (StartRestartModel class).
+ Get restart to know if balise exists.
+ """
+ self.isInt(nb)
+ restart = ''
+ node = self.node_mean.xmlGetNode('time_average', id=nb)
+ if node:
+ restart = node.xmlGetInt('restart_from_time_average')
+ return restart
+
+#-------------------------------------------------------------------------------
+# TimeAveragesModel test case
+#-------------------------------------------------------------------------------
+
+class TimeAveragesTestCase(ModelTest):
+ """
+ unittest
+ """
+ def checkTimeAveragesInstantiation(self):
+ """Check whether the TimeAveragesModel class could be instantiated"""
+ model = None
+ model = TimeAveragesModel(self.case)
+ assert model != None, 'Could not instantiate TimeAveragesModel'
+
+
+ def checkSetAverage(self):
+ """Check whether the TimeAveragesModel class could be set a average"""
+ mdl = TimeAveragesModel(self.case)
+ mdl.setAverage(1, 'moyenne', 10, 1, ['VelocitU', 'VelocitV'])
+ mdl.setAverage(2, 'deux', 20, 1, ['Pressure'])
+
+ doc = '''<time_averages>
+ <time_average id="1" label="moyenne">
+ <var_prop name="velocity_U"/>
+ <var_prop name="velocity_V"/>
+ <time_step_start>10</time_step_start>
+ </time_average>
+ <time_average id="2" label="deux">
+ <var_prop name="pressure"/>
+ <time_step_start>20</time_step_start>
+ </time_average>
+ </time_averages>'''
+
+ assert mdl.node_mean == self.xmlNodeFromString(doc),\
+ 'Could not set some averages in TimeAveragesModel'
+
+
+ def checkReplaceAverage(self):
+ """Check whether the TimeAveragesModel class could be replaced one average"""
+ mdl = TimeAveragesModel(self.case)
+ mdl.setAverage(1, 'moyenne', 10, 1, ['VelocitU', 'VelocitV'])
+ mdl.setAverage(2, 'deux', 20, 1, ['Pressure'])
+ mdl.setAverage(3, 'trois', 33, 1, ['Pressure', 'VelocitU'])
+ mdl.replaceAverage(2, 'SECOND', 12, 1, ['VelocitW', 'VelocitV'])
+ mdl.replaceAverage(3, 'trois', 33, 1, ['Pressure', 'VelocitW'])
+ doc = '''<time_averages>
+ <time_average id="1" label="moyenne">
+ <var_prop name="velocity_U"/>
+ <var_prop name="velocity_V"/>
+ <time_step_start>10</time_step_start>
+ </time_average>
+ <time_average id="2" label="SECOND">
+ <var_prop name="velocity_W"/>
+ <var_prop name="velocity_V"/>
+ <time_step_start>12</time_step_start>
+ </time_average>
+ <time_average id="3" label="trois">
+ <var_prop name="pressure"/>
+ <var_prop name="velocity_W"/>
+ <time_step_start>33</time_step_start>
+ </time_average>
+ </time_averages>'''
+ assert mdl.node_mean == self.xmlNodeFromString(doc),\
+ 'Could not replace one average in TimeAveragesModel'
+
+
+ def checkDeleteAverage(self):
+ """Check whether the TimeAveragesModel class could be deleted one average"""
+ mdl = TimeAveragesModel(self.case)
+ mdl.setAverage(1, 'moyenne', 10, 1, ['VelocitU', 'VelocitV'])
+ mdl.setAverage(2, 'deux', 20, 1, ['VelocitU'])
+ mdl.setAverage(3, 'trois', 33, 1, ['VelocitW', 'VelocitU'])
+ mdl.deleteAverage(2)
+ doc = '''<time_averages>
+ <time_average id="1" label="moyenne">
+ <var_prop name="velocity_U"/>
+ <var_prop name="velocity_V"/>
+ <time_step_start>10</time_step_start>
+ </time_average>
+ <time_average id="2" label="trois">
+ <var_prop name="velocity_W"/>
+ <var_prop name="velocity_U"/>
+ <time_step_start>33</time_step_start>
+ </time_average>
+ </time_averages>'''
+
+ assert mdl.node_mean == self.xmlNodeFromString(doc),\
+ 'Could not delete one average in TimeAveragesModel'
+
+
+ def checkDeleteAverage(self):
+ """Check whether the TimeAveragesModel class could be get restart average"""
+ mdl = TimeAveragesModel(self.case)
+ mdl.setAverage(1, 'moyenne', 10, 1, ['VelocitU', 'VelocitV'])
+ mdl.setAverage(2, 'deux', 20, 1, ['VelocitU'])
+ mdl.setAverage(3, 'trois', 33, 1, ['VelocitW', 'VelocitU'])
+
+ assert mdl.getAverageRestart(1) == None,\
+ 'Could not get restart average in TimeAveragesModel'
+
+ from Pages.StartRestartModel import StartRestartModel
+ StartRestartModel(self.case).setRestart('on')
+ mdl.replaceAverage(2, 'deux', 20, 3, ['VelocitU'])
+
+ assert mdl.getAverageRestart(2) == 3,\
+ 'Could not get restart average in TimeAveragesModel'
+
+
+def suite():
+ testSuite = unittest.makeSuite(TimeAveragesTestCase, "check")
+ return testSuite
+
+
+def runTest():
+ print __file__
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/TimeAveragesView.py b/gui/Pages/TimeAveragesView.py
new file mode 100644
index 0000000..bc4cdb0
--- /dev/null
+++ b/gui/Pages/TimeAveragesView.py
@@ -0,0 +1,490 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- StandardItemModelAverage
+- TimeAveragesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import string
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import LABEL_LENGTH_MAX
+from Base.Toolbox import GuiParam
+from TimeAveragesForm import Ui_TimeAveragesForm
+from Base.QtPage import IntValidator, RegExpValidator
+from Pages.StartRestartModel import StartRestartModel
+from Pages.TimeAveragesModel import TimeAveragesModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("TimeAveragesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class for time averages
+#-------------------------------------------------------------------------------
+
+class StandardItemModelAverage(QStandardItemModel):
+
+ def __init__(self, parent):
+ """
+ """
+ QStandardItemModel.__init__(self)
+ self.parent = parent
+ self.headers = [self.tr("Number"), self.tr("Average name"), self.tr("Start"),
+ self.tr("Restart"), self.tr("Variables")]
+ self.setColumnCount(len(self.headers))
+ self.dataAverage = []
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+ if role == Qt.DisplayRole:
+ return QVariant(self.dataAverage[index.row()][index.column()])
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ else:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ elif role == Qt.TextAlignmentRole:
+ return QVariant(Qt.AlignCenter)
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self, imom, label, ntdmom, imoold, list):
+ """
+ Add a row in the table.
+ """
+ item = [imom, label, ntdmom, imoold, list]
+ self.dataAverage.append(item)
+ row = self.rowCount()
+ if row +1 > 50:
+ title = self.tr("Information")
+ msg = self.tr("The maximal number of time averages cannot exceed 50. ")
+ QMessageBox.information(self.parent, title, msg)
+ else:
+ self.setRowCount(row+1)
+
+
+ def replaceItem(self, row, imom, label, ntdmom, imoold, list):
+ """
+ Replace a row in the table.
+ """
+ self.dataAverage[row] = [imom, label, ntdmom, imoold, list]
+
+
+ def deleteRow(self, row):
+ """
+ Delete the row in the model.
+ """
+ del self.dataAverage[row]
+ row = self.rowCount()
+ self.setRowCount(row-1)
+
+
+ def getItem(self, row):
+ """
+ Returns the name of the mesh file.
+ """
+ return self.dataAverage[row]
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class TimeAveragesView(QWidget, Ui_TimeAveragesForm):
+ """
+ """
+ def __init__(self, parent, case, stbar):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_TimeAveragesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = TimeAveragesModel(self.case)
+ self.entriesNumber = 0
+ self.start = 1
+ self.restart = -2
+
+ # Create the Page layout.
+
+ # Models
+ self.modelAverage = StandardItemModelAverage(self)
+ self.treeViewAverage.setModel(self.modelAverage)
+ self.treeViewAverage.resizeColumnToContents(0)
+ self.treeViewAverage.resizeColumnToContents(1)
+ self.treeViewAverage.resizeColumnToContents(2)
+ self.treeViewAverage.resizeColumnToContents(3)
+
+ self.modelDrag = QStringListModel()
+ self.modelDrop = QStringListModel()
+ self.listViewDrag.setModel(self.modelDrag)
+ self.listViewDrop.setModel(self.modelDrop)
+
+ # Drag ...
+ self.listViewDrag.setDragDropMode(QAbstractItemView.DragOnly)
+ self.listViewDrop.setDragDropOverwriteMode(False)
+ self.listViewDrag.setAlternatingRowColors(True)
+ self.listViewDrag.setDragEnabled(True)
+ #self.listViewDrag.setAcceptDrops(True)
+ # ... and Drop
+ self.listViewDrop.setDragDropMode(QAbstractItemView.DragDrop)
+ self.listViewDrop.setAlternatingRowColors(True)
+ self.listViewDrop.setAcceptDrops(True)
+ self.listViewDrop.setDragEnabled(True)
+ self.listViewDrop.setDragDropOverwriteMode(False)
+
+ # Connections
+ self.connect(self.pushButtonAdd, SIGNAL("clicked()"), self.slotAddAverage)
+ self.connect(self.pushButtonEdit, SIGNAL("clicked()"), self.slotEditAverage)
+ self.connect(self.pushButtonDelete, SIGNAL("clicked()"), self.slotDeleteAverage)
+ self.connect(self.treeViewAverage, SIGNAL("pressed(const QModelIndex &)"), self.slotSelectAverage)
+ self.connect(self.lineEditStart, SIGNAL("textChanged(const QString &)"), self.slotStart)
+ self.connect(self.lineEditRestart, SIGNAL("textChanged(const QString &)"), self.slotRestart)
+
+ # Validators
+ validatorStart = IntValidator(self.lineEditStart, min=1)
+ self.lineEditStart.setValidator(validatorStart)
+
+ validatorRestart = IntValidator(self.lineEditRestart, min=-2, max=50)
+ self.lineEditRestart.setValidator(validatorRestart)
+
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ validatorLabel = RegExpValidator(self.lineEditAverage, QRegExp(rx))
+ self.lineEditAverage.setValidator(validatorLabel)
+
+ # Initialize
+
+ # Update list of variables, properties, scalars ...
+
+ liste_label = QStringList()
+ for label in self.mdl.dicoLabel2Name.keys():
+ liste_label.append(label)
+
+ self.modelDrag.setStringList(liste_label)
+
+ # Is it a following calculation ?
+
+ if StartRestartModel(self.case).getRestart() == 'off':
+ self.labelRestart.setDisabled(True)
+ self.lineEditRestart.setDisabled(True)
+ self.treeViewAverage.hideColumn(3)
+
+ # Update list of averages for view from xml file
+
+ for nb in self.mdl.getAverageList():
+ self.entriesNumber = self.entriesNumber + 1
+ label, start, restart, list = self.mdl.getAverageInformations(nb)
+ if restart == 0:
+ restart = ''
+ self.insertAverage(str(nb), label, start, restart, list)
+
+
+ def getLabel(self):
+ """
+ Return label of average.
+ """
+ label = str(self.lineEditAverage.text())
+ if label in self.mdl.getAverageLabelsList():
+ default = {}
+ default['label'] = label
+ default['list'] = self.mdl.getAverageLabelsList()
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ default['regexp'] = QRegExp(rx)
+ from VerifyExistenceLabelDialogView import VerifyExistenceLabelDialogView
+ dialog = VerifyExistenceLabelDialogView(self, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ label = result['label']
+ if result['label'] == default['label']:
+ label = ""
+ return label
+
+
+ @pyqtSignature("const QString&")
+ def slotStart(self, text):
+ """
+ Return an integer for ntdmom, value of start of calculation.
+ """
+ start, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.start = start
+
+
+ @pyqtSignature("const QString&")
+ def slotRestart(self, text):
+ """
+ Return an integer for imoold, value of restart of calculation.
+ """
+ restart, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ if restart != 0:
+ self.restart = restart
+ return
+
+ self.restart = self.treeViewAverage.currentIndex().row()
+ self.sender().setText(QString(self.restart))
+
+
+ def averageInfo(self):
+ """
+ Return info from the argument entry.
+ """
+ row = self.treeViewAverage.currentIndex().row()
+ return self.modelAverage.getItem(row)
+
+
+ def insertAverage(self, imom, label, ntdmom, imoold, list):
+ """
+ Insert values in Hlist.
+ """
+ idfmom = string.join(list,'*')
+ idfmom_view = "<" + idfmom +">"
+
+ if imoold == None:
+ imoold = -1
+ self.modelAverage.addItem(imom, label, ntdmom, imoold, idfmom_view)
+
+
+ def replaceAverage(self, row, imom, label, ntdmom, imoold, list):
+ """
+ Insert values in Hlist.
+ """
+ idfmom = string.join(list,'*')
+ idfmom_view = "<" + idfmom + ">"
+
+ if imoold == None:
+ imoold = -1
+ self.modelAverage.replaceItem(row, imom, label, ntdmom, imoold, idfmom_view)
+
+
+ @pyqtSignature("")
+ def slotAddAverage(self):
+ """
+ Set in view IMOM, NTDMOM, IMOOLD, IDFMOM
+ """
+ var_prop = [str(s) for s in self.modelDrop.stringList()]
+ log.debug("slotAddAverage -> %s" % (var_prop,))
+ idfmom = string.join(var_prop,'*')
+
+ if idfmom == '':
+ title = self.tr("Warning")
+ msg = self.tr("You must select at least one variable or property from list")
+ QMessageBox.information(self, title, msg)
+
+ else:
+ label = self.getLabel()
+
+ self.entriesNumber = self.entriesNumber+1
+ if label == '':
+ label = 'Average' + repr(self.entriesNumber)
+
+ if label in self.mdl.getAverageLabelsList():
+ title = self.tr("Warning")
+ msg = self.tr("This label already exists")
+ QMessageBox.information(self, title, msg)
+ return
+
+ log.debug("slotAddAverage -> %s" % (label,))
+
+ ntdmom = self.start
+ if StartRestartModel(self.case).getRestart() != 'off':
+ imoold = self.restart
+ else:
+ imoold = 0
+
+ self.insertAverage(self.entriesNumber, label, ntdmom, imoold, var_prop)
+ average = string.split(idfmom, '*')
+ self.mdl.setAverage(self.entriesNumber, label, ntdmom, imoold, average)
+ self.__eraseEntries()
+
+
+ @pyqtSignature("")
+ def slotDeleteAverage(self):
+ """
+ Delete the selected average from the list (one by one).
+ """
+ row = self.treeViewAverage.currentIndex().row()
+ log.debug("slotDeleteAverage -> %s" % (row,))
+ if row == -1:
+ title = self.tr("Warning")
+ msg = self.tr("You must select an existing time average")
+ QMessageBox.information(self, title, msg)
+ else:
+ [imom, label, ntdmom, imoold, idfmom] = self.averageInfo()
+ self.modelAverage.deleteRow(row)
+ self.mdl.deleteAverage(int(imom))
+ self.__eraseEntries()
+
+
+ @pyqtSignature("")
+ def slotEditAverage(self):
+ """
+ Edit average to modify the selected average from the list.
+ """
+ row = self.treeViewAverage.currentIndex().row()
+ log.debug("slotEditAverage -> %s" % (row,))
+ if row == -1:
+ title = self.tr("Warning")
+ msg = self.tr("You must select an existing tiem average")
+ QMessageBox.information(self, title, msg)
+ else:
+ [imom, old_label, old_start, old_restart, old_average] = self.averageInfo()
+
+ var_prof = [str(s) for s in self.modelDrop.stringList()]
+ log.debug("slotEditAverage -> %s" % (var_prof,))
+ if not var_prof:
+ title = self.tr("Warning")
+ msg = self.tr("You must select at least one variable or property from list")
+ QMessageBox.information(self, title, msg)
+
+ else:
+ new_label = str(self.lineEditAverage.text())
+
+ if new_label == '':
+ new_label = old_label
+
+ if new_label != old_label and new_label in self.mdl.getAverageLabelsList():
+ title = self.tr("Warning")
+ msg = self.tr("This label already exists: the old label is kept")
+ QMessageBox.information(self, title, msg)
+ new_label = old_label
+
+ log.debug("slotEditAverage -> %s" % (new_label,))
+
+ new_start = self.start
+ if StartRestartModel(self.case).getRestart() != 'off':
+ new_restart = self.restart
+ else:
+ new_restart = 0
+
+ self.replaceAverage(row, imom, new_label, new_start, new_restart, var_prof)
+ self.mdl.replaceAverage(int(imom), new_label, new_start, new_restart, var_prof)
+ idx = self.treeViewAverage.currentIndex()
+ self.treeViewAverage.dataChanged(idx, idx)
+
+ self.__eraseEntries()
+
+
+ @pyqtSignature("const QModelIndex &")
+ def slotSelectAverage(self, index):
+ """
+ Return the selected item from the Hlist.
+ """
+ row = index.row()
+ log.debug("slotSelectAverage -> %s" % (row,))
+
+ [imom, label, ntdmom, imoold, idfmom] = self.averageInfo()
+
+ self.lineEditAverage.setText(QString(label))
+ self.lineEditStart.setText(QString(str(ntdmom)))
+
+ if StartRestartModel(self.case).getRestart() != 'off':
+ if imoold == '':
+ imoold = -1
+ self.lineEditRestart.setText(QString(str(imoold)))
+ liste = [QString(s) for s in idfmom.replace('>','').replace('<','').split('*')]
+ self.modelDrop.setStringList(liste)
+
+
+ def __eraseEntries(self):
+ """
+ Delete all caracters in the entries.
+ """
+ self.lineEditAverage.setText(str(""))
+ self.lineEditStart.setText(str(""))
+ if StartRestartModel(self.case).getRestart() == 'on':
+ self.lineEditRestart.setText(str(""))
+ self.modelDrop.setStringList(QStringList())
+ self.treeViewAverage.clearSelection()
+
+
+ def insertListVarP(self, name):
+ """
+ Insert name of variable or property into the list (one by one).
+ """
+ log.debug("insertListVarP")
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/TimeStepForm.ui b/gui/Pages/TimeStepForm.ui
new file mode 100644
index 0000000..5de875f
--- /dev/null
+++ b/gui/Pages/TimeStepForm.ui
@@ -0,0 +1,561 @@
+<ui version="4.0" >
+ <class>TimeStepForm</class>
+ <widget class="QWidget" name="TimeStepForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>437</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Unsteady flow algorithm management</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Time step option</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxOptions" >
+ <property name="minimumSize" >
+ <size>
+ <width>241</width>
+ <height>21</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: DTREF</string>
+ </property>
+ <property name="text" >
+ <string>Reference time step</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditDTREF" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: DTREF</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>s</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTMABS</string>
+ </property>
+ <property name="statusTip" >
+ <string>Absolute time step number of the simulation, restarts included.</string>
+ </property>
+ <property name="text" >
+ <string>Number of iterations (restart included)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditNTMABS" >
+ <property name="maximumSize" >
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: NTMABS</string>
+ </property>
+ <property name="statusTip" >
+ <string>Absolute time step number of the simulation, restarts included.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QGroupBox" name="groupBoxLabels" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>316</width>
+ <height>160</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string/>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="labelCOUMAX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: COUMAX</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ <property name="text" >
+ <string>Maximal CFL number</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditCOUMAX" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: COUMAX</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="labelFOUMAX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: FOUMAX</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ <property name="text" >
+ <string>Maximal Fourier number</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditFOUMAX" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: FOUMAX</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="labelDTMIN" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: DTMIN/DTREF</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ <property name="text" >
+ <string>Minimal time step factor</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditDTMIN" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: DTMIN/DTREF</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="labelDTMAX" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: DTMAX/DTREF</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ <property name="text" >
+ <string>Maximal time step factor</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditDTMAX" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: DTMAX/DTREF</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="labelVARRDT" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: VARRDT</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ <property name="text" >
+ <string>Time step maximal variation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLineEdit" name="lineEditVARRDT" >
+ <property name="maximumSize" >
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: VARRDT</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accessible entry if the time step is variable.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="Line" name="lineIPTLRO" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="labelIPTLRO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPTLRO</string>
+ </property>
+ <property name="statusTip" >
+ <string>Accesible if gravity is not nul, if density is not constant and if the time step is variable</string>
+ </property>
+ <property name="text" >
+ <string>Time step limitation with
+the local thermal time step</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxIPTLRO" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: INPDT0</string>
+ </property>
+ <property name="statusTip" >
+ <string>Code_Saturne key word: INPDT0</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="6" column="0" >
+ <widget class="Line" name="line_4" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label_8" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: INPDT0</string>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string>Option zero time step</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxINPDT0" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IPTLRO</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/TimeStepModel.py b/gui/Pages/TimeStepModel.py
new file mode 100644
index 0000000..6d4fae4
--- /dev/null
+++ b/gui/Pages/TimeStepModel.py
@@ -0,0 +1,671 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This page is devoted to the time step management.
+
+This module contains the following classes and function:
+- TimeStepModel
+- TimeStepMatisseModel
+- TimeStepModelTestCase
+- TimeStepMatisseModelTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+
+#-------------------------------------------------------------------------------
+# Time Step Model class
+#-------------------------------------------------------------------------------
+
+class TimeStepModel(Model):
+ """
+ Class to open the Time Step Page.
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case =case
+
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_turb = self.node_models.xmlGetNode('turbulence')
+ self.node_control = self.case.xmlGetNode('analysis_control')
+ self.node_time = self.node_control.xmlInitNode('time_parameters')
+
+ Variables(self.case).setNewProperty(self.node_time, 'courant_number')
+ Variables(self.case).setNewProperty(self.node_time, 'fourier_number')
+
+
+ def defaultValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = {}
+
+ default['iterations'] = 10
+ default['time_passing'] = 0
+ default['time_step_ref'] = 0.1
+ default['max_courant_num'] = 1.0
+ default['max_fourier_num'] = 10.0
+ default['time_step_min'] = 0.1*default['time_step_ref']
+ default['time_step_max'] = 1000.0*default['time_step_ref']
+ default['time_step_var'] = 0.1
+ default['thermal_time_step'] = 'off'
+ default['zero_time_step'] = 'off'
+
+ return default
+
+
+ def thermalCase(self):
+ """
+ Is the current case adapted for IPTLRO ?
+ """
+ thermal_case = 0
+ from FluidCharacteristicsModel import FluidCharacteristicsModel
+ n_atmo, n_joul, n_thermo, n_gas, n_coal = FluidCharacteristicsModel(self.case).getThermoPhysicalModel()
+
+ if n_atmo != 'off' or n_joul != 'off' or n_thermo != 'off' or n_gas != 'off' or n_coal != 'off':
+ thermal_case = 1
+
+ # gravity
+ from BodyForcesModel import BodyForcesModel
+ mdl = BodyForcesModel(self.case)
+ gx = mdl.getGravity('gravity_x')
+ gy = mdl.getGravity('gravity_y')
+ gz = mdl.getGravity('gravity_z')
+ if gx == 0.0 and gy == 0.0 and gz == 0.0:
+ thermal_case = 0
+
+ # rho variable
+ if FluidCharacteristicsModel(self.case).getPropertyMode('density') == 'constant':
+ thermal_case = 0
+
+ del FluidCharacteristicsModel
+ del BodyForcesModel
+ return thermal_case
+
+
+ def getTimePassing(self):
+ """
+ Get value of time_passing (IDTVAR) for node "time_parameters"
+ """
+ tag = 'time_passing'
+ v = self.node_time.xmlGetInt(tag)
+ if v == None:
+ v = self.defaultValues()[tag]
+ self.setTimePassing(v)
+
+ from TurbulenceModel import TurbulenceModel
+ model = TurbulenceModel(self.case).getTurbulenceModel()
+ del TurbulenceModel
+ if model in ('LES_Smagorinsky', 'LES_dynamique', 'LES_WALE'):
+ v = 0
+ self.setTimePassing(v)
+
+ return v
+
+
+ def setTimePassing(self, val):
+ """
+ Get value of time_passing (IDTVAR) for node "time_parameters"
+ Used also by TurbulenceModel
+ """
+ self.isIntInList(val, [0, 1, 2])
+ self.node_time.xmlSetData('time_passing', val)
+ if val in (1, 2):
+ Variables(self.case).setNewProperty(self.node_time,
+ 'local_time_step')
+ else:
+ self.node_time.xmlRemoveChild('property', name='local_time_step')
+ for tag in ('max_courant_num', 'max_fourier_num',
+ 'time_step_min', 'time_step_max', 'time_step_var'):
+ self.node_time.xmlRemoveChild(tag)
+
+
+ def getTimeStep(self):
+ """
+ Get value of time_step_reference for node "time_parameters"
+ """
+ tag = 'time_step_ref'
+ v = self.node_time.xmlGetDouble(tag)
+ if v == None:
+ v = self.defaultValues()[tag]
+ self.setTimeStep(v)
+
+ return v
+
+
+ def setTimeStep(self, val):
+ """
+ Get value of time_step_reference for node "time_parameters"
+ """
+ self.isPositiveFloat(val)
+ self.node_time.xmlSetData('time_step_ref', val)
+
+
+ def getIterationsNumber(self):
+ """
+ Get number of iterations for node "time_parameters"
+ """
+ tag = 'iterations'
+ v = self.node_time.xmlGetInt(tag)
+ if v == None:
+ v = self.defaultValues()[tag]
+ self.setIterationsNumber(v)
+ return v
+
+
+ def setIterationsNumber(self, val):
+ """
+ Put number of iterations for node "time_parameters"
+ """
+ self.isPositiveInt(val)
+ self.node_time.xmlSetData('iterations', val)
+
+
+ def getMaxCourant(self):
+ """
+ Return the max courant number allowed
+ """
+ tag = 'max_courant_num'
+ return self.getOptions(tag)
+
+
+ def setMaxCourant(self, val):
+ """
+ Input the max courant number allowed
+ """
+ self.isStrictPositiveFloat(val)
+ self.setOptions('max_courant_num', val)
+
+
+ def getMaxFourier(self):
+ """
+ Return the max fourier number allowed
+ """
+ tag = 'max_fourier_num'
+ return self.getOptions(tag)
+
+
+ def setMaxFourier(self, val):
+ """
+ Input the max fourier number allowed
+ """
+ self.isStrictPositiveFloat(val)
+ self.setOptions('max_fourier_num', val)
+
+
+ def getTimeStepMin(self):
+ """
+ Return the minimal time step
+ """
+ tag = 'time_step_min'
+ return self.getOptions(tag)
+
+
+ def setTimeStepMin(self, val):
+ """
+ Input the minimal time step
+ """
+ self.isPositiveFloat(val)
+ self.setOptions('time_step_min', val)
+
+
+ def getTimeStepMax(self):
+ """
+ Return the maximal time step
+ """
+ tag = 'time_step_max'
+ return self.getOptions(tag)
+
+
+ def setTimeStepMax(self, val):
+ """
+ Input the maximal time step
+ """
+ self.isStrictPositiveFloat(val)
+ self.setOptions('time_step_max', val)
+
+
+ def getTimeStepVariation(self):
+ """
+ Return the maximal variation of time step between two iteration
+ """
+ tag = 'time_step_var'
+ return self.getOptions(tag)
+
+
+ def setTimeStepVariation(self, val):
+ """
+ Input the maximal variation of time step between two iteration
+ """
+ self.isStrictPositiveFloat(val)
+ self.setOptions('time_step_var', val)
+
+
+ def getOptions(self, tag):
+ """
+ Get options for node "time_parameters"
+ """
+ if self.getTimePassing() == 0:
+ msg = "No option : " + tag + " in this case"
+ raise ValueError, msg
+
+ v = self.node_time.xmlGetChildDouble(tag)
+ if v == None:
+ v = self.defaultValues()[tag]
+ self.setOptions(tag, v)
+ return v
+
+
+ def setOptions(self, tag, val):
+ """
+ Put options for node "time_parameters"
+ """
+ if self.getTimePassing() == 0:
+ msg = "No option : " + tag + " in this case"
+ raise ValueError, msg
+
+ if tag == 'time_step_min':
+ self.isPositiveFloat(val)
+ else:
+ self.isStrictPositiveFloat(val)
+ self.node_time.xmlSetData(tag, val)
+
+
+ def getThermalTimeStep(self):
+ """
+ Get status of thermal_time_step for node "time_parameters"
+ """
+ if not self.thermalCase():
+ raise ValueError, "TimeStepModel: no thermal model in this case"
+
+ node = self.node_time.xmlInitChildNode('thermal_time_step', 'status')
+ s = node['status']
+ if not s:
+ s = self.defaultValues()['thermal_time_step']
+ self.setThermalTimeStep(s)
+ return s
+
+
+ def setThermalTimeStep(self, status):
+ """
+ Put status of thermal_time_step for node "time_parameters"
+ """
+
+ if not self.thermalCase():
+ raise ValueError, "TimeStepModel: no thermal model in this case"
+
+ self.isOnOff(status)
+ node = self.node_time.xmlInitChildNode('thermal_time_step', 'status')
+ node['status'] = status
+
+
+ def getZeroTimeStep(self):
+ """
+ Get status of zero_time_step for node "time_parameters"
+ """
+ node = self.node_time.xmlInitNode('zero_time_step', 'status')
+ s = node['status']
+ if not s:
+ s = self.defaultValues()['zero_time_step']
+ self.setZeroTimeStep(s)
+ return s
+
+
+ def setZeroTimeStep(self, status):
+ """
+ Get status of zero_time_step for node "time_parameters"
+ """
+ self.isOnOff(status)
+ node = self.node_time.xmlInitChildNode('zero_time_step', 'status')
+ node['status'] = status
+
+
+ def RemoveThermalTimeStepNode(self):
+ """
+ Remove Thermal time step node for node "time_parameters"
+ Also called by ThermalScalarModel
+ """
+ node = self.node_time.xmlGetNode('thermal_time_step')
+ if node:
+ self.node_time.xmlRemoveChild('thermal_time_step')
+
+#-------------------------------------------------------------------------------
+# Time Step Model class for Matisse
+#-------------------------------------------------------------------------------
+
+class TimeStepMatisseModel(TimeStepModel):
+
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ TimeStepModel.__init__(self, case)
+ self.node_matisse = self.case.root().xmlInitChildNode('matisse')
+ self.node_compute = self.node_matisse.xmlInitChildNode('compute')
+ self.node_phymodel = self.node_compute.xmlInitChildNode('physical_model')
+
+
+ def _defaultValues(self):
+ """
+ Return in a dictionnary which contains default values
+ """
+ default = TimeStepModel.defaultValues(self)
+ default['dtdtmx'] = 1.0
+ return default
+
+
+ def setDtdtmx(self, val):
+ """
+ set value of Dtdtmx for node "dtdtmx"
+ """
+ self.isStrictPositiveFloat(val)
+ self.node_phymodel.xmlSetData('dtdtmx', val)
+
+
+ def getDtdtmx(self):
+ """
+ Get value of Dtdtmx for node "dtdtmx"
+ """
+ val = self.node_phymodel.xmlGetDouble('dtdtmx')
+ if val == None:
+ self.node_phymodel.xmlInitChildNode('dtdtmx')
+ val = self._defaultValues()['dtdtmx']
+ self.setDtdtmx(val)
+
+ return val
+
+
+#-------------------------------------------------------------------------------
+# TimeStepModel Test Class
+#-------------------------------------------------------------------------------
+
+class TimeStepModelTestCase(ModelTest):
+ """
+ """
+ def checkTimeStepModelInstantiation(self):
+ """Check whether the TimeStepModel class could be instantiated"""
+ mdl = None
+ mdl = TimeStepModel(self.case)
+ assert mdl != None, 'Could not instantiate TimeStepModel'
+
+ def checkSetandGetTimePassing(self):
+ """Check whether the TimeStepModel class could be set and get time passing"""
+ mdl = TimeStepModel(self.case)
+ mdl.setTimePassing(1)
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>1</time_passing>
+ <property label="loc.time" name="local_time_step"/>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not set time passing in TimeStepModel'
+ assert mdl.getTimePassing() == 1,\
+ 'Could not get time passing in TimeStepModel'
+
+ mdl.setTimePassing(0)
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>0</time_passing>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not remove local time step node in TimeStepModel'
+
+ mdl.setTimePassing(2)
+ mdl.setTimeStepMin(0.05)
+ mdl.setTimeStepMax(500)
+ mdl.setTimeStepVariation(0.25)
+ mdl.setTimePassing(0)
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>0</time_passing>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not remove tagged time node in TimeStepModel'
+
+ def checkSetandGetIterationsNumber(self):
+ """Check whether the TimeStepModel class could be set and get number of iterations"""
+ mdl = TimeStepModel(self.case)
+ mdl.setIterationsNumber(50)
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>50</iterations>
+ <time_passing>0</time_passing>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not set number of iterations in TimeStepModel'
+ assert mdl.getIterationsNumber() == 50,\
+ 'Could not get number of iterations in TimeStepModel'
+
+ def checkSetandGetMaxCourant(self):
+ """Check whether the TimeStepModel class could be
+ set and get max courant number : option(s) only for idtvar = 1 or 2"""
+ mdl = TimeStepModel(self.case)
+ mdl.setTimePassing(1)
+ mdl.setMaxCourant(10)
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>1</time_passing>
+ <property label="loc.time" name="local_time_step"/>
+ <max_courant_num>10</max_courant_num>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not set max courant number in TimeStepModel'
+ assert mdl.getMaxCourant() == 10,\
+ 'Could not get max courant number in TimeStepModel'
+
+ def checkSetandGetMaxFourier(self):
+ """Check whether the TimeStepModel class could be set and get
+ max fourier number (if idtvar = 0 : no options max fourier)"""
+ mdl = TimeStepModel(self.case)
+ mdl.setTimePassing(1)
+ mdl.setMaxFourier(100.)
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>1</time_passing>
+ <property label="loc.time" name="local_time_step"/>
+ <max_fourier_num>100.</max_fourier_num>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not set max fourier number in TimeStepModel'
+ assert mdl.getMaxFourier() == 100.,\
+ 'Could not get max fourier number in TimeStepModel'
+
+ def checkSetandGetTimeStepMinMaxandVariation(self):
+ """Check whether the TimeStepModel class could be set and get
+ options :min max and variation for time step"""
+ mdl = TimeStepModel(self.case)
+ mdl.setTimePassing(2)
+ mdl.setTimeStepMin(0.05)
+ mdl.setTimeStepMax(500)
+ mdl.setTimeStepVariation(0.25)
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>2</time_passing>
+ <property label="loc.time" name="local_time_step"/>
+ <time_step_min>0.05</time_step_min>
+ <time_step_max>500</time_step_max>
+ <time_step_var>0.25</time_step_var>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not set min max and variation of time step in TimeStepModel'
+ assert mdl.getTimeStepMin() == 0.05,\
+ 'Could not get min of time step in TimeStepModel'
+ assert mdl.getTimeStepMax() == 500,\
+ 'Could not get max of time step in TimeStepModel'
+ assert mdl.getTimeStepVariation() == 0.25,\
+ 'Could not get variation of time step in TimeStepModel'
+
+ def checkSetandGetThermalTimeStep(self):
+ """Check whether the TimeStepModel class could be set and get thermal time step"""
+ mdl = TimeStepModel(self.case)
+ from ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+ from FluidCharacteristicsModel import FluidCharacteristicsModel
+ FluidCharacteristicsModel(self.case).setPropertyMode('density','variable')
+ del FluidCharacteristicsModel
+ from BodyForcesModel import BodyForcesModel
+ BodyForcesModel(self.case).setGravity('gravity_x', 9.81)
+ del BodyForcesModel
+ mdl.setThermalTimeStep('on')
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>0</time_passing>
+ <thermal_time_step status="on"/>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not set thermal time step in TimeStepModel'
+ assert mdl.getThermalTimeStep() == 'on',\
+ 'Could not get thermal time step in TimeStepModel'
+
+ def checkSetandGetZeroTimeStep(self):
+ """Check whether the TimeStepModel class could be set and get zero time step"""
+ mdl = TimeStepModel(self.case)
+ mdl.setZeroTimeStep('on')
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>0</time_passing>
+ <zero_time_step status="on"/>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not set zero time step in TimeStepModel'
+ assert mdl.getZeroTimeStep() == 'on',\
+ 'Could not get zero time step in TimeStepModel'
+
+ def checkRemoveThermalTimeStepNode(self):
+ """Check whether the TimeStepModel class could be removed thermal time step node"""
+ mdl = TimeStepModel(self.case)
+ from ThermalScalarModel import ThermalScalarModel
+ ThermalScalarModel(self.case).setThermalModel('temperature_celsius')
+ del ThermalScalarModel
+ from FluidCharacteristicsModel import FluidCharacteristicsModel
+ FluidCharacteristicsModel(self.case).setPropertyMode('density','variable')
+ del FluidCharacteristicsModel
+ from BodyForcesModel import BodyForcesModel
+ BodyForcesModel(self.case).setGravity('gravity_x', 9.81)
+ del BodyForcesModel
+ mdl.setThermalTimeStep('on')
+ mdl.RemoveThermalTimeStepNode()
+ doc = '''<time_parameters>
+ <property label="Courant nb" name="courant_number"/>
+ <property label="Fourier nb" name="fourier_number"/>
+ <time_step_ref>0.1</time_step_ref>
+ <iterations>10</iterations>
+ <time_passing>0</time_passing>
+ </time_parameters>'''
+ assert mdl.node_time == self.xmlNodeFromString(doc),\
+ 'Could not remove thermal time step node in TimeStepModel'
+
+def suite():
+ testSuite = unittest.makeSuite(TimeStepModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "TimeStepModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# TimeStepMatisse Model Test Class
+#-------------------------------------------------------------------------------
+
+class TimeStepMatisseModelTestCase(ModelTest):
+ """
+ """
+ def checkTimeStepMatisseModelInstantiation(self):
+ """Check whether the TimeStepMatisseModel class could be instantiated"""
+ model = None
+ model = TimeStepMatisseModel(self.case)
+ assert model != None, 'Could not instantiate TimeStepMatisseModel'
+
+ def checkSetandGetDtdtmx(self):
+ """Check whether the TimeStepMatisseModel class could be set and get Dtdtmx"""
+ model = TimeStepMatisseModel(self.case)
+ model.setDtdtmx(10.5)
+ doc = '''<physical_model>
+ <dtdtmx>10.5</dtdtmx>
+ </physical_model>'''
+ assert model.node_phymodel == self.xmlNodeFromString(doc),\
+ 'Could not set Dtdtmx in TimeStepMatisseModel'
+ assert model.getDtdtmx() == 10.5,\
+ 'Could not get Dtdtmx in TimeStepMatisseModel'
+
+def suite2():
+ testSuite = unittest.makeSuite(TimeStepMatisseModelTestCase, "check")
+ return testSuite
+
+def runTest2():
+ print "TimeStepMatisseModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite2())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/TimeStepView.py b/gui/Pages/TimeStepView.py
new file mode 100644
index 0000000..5c0e9d3
--- /dev/null
+++ b/gui/Pages/TimeStepView.py
@@ -0,0 +1,305 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes and function:
+- TimeStepView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from TimeStepForm import Ui_TimeStepForm
+import Base.QtPage as QtPage
+from Pages.TimeStepModel import TimeStepModel, TimeStepMatisseModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("TimeStepView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class TimeStepView(QWidget, Ui_TimeStepForm):
+ """
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_TimeStepForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = TimeStepModel(self.case)
+
+ # Combo model
+
+ self.modelTimeOptions = QtPage.ComboModel(self.comboBoxOptions,3,1)
+
+ self.modelTimeOptions.addItem(self.tr("Uniform and constant"), '0')
+ self.modelTimeOptions.addItem(self.tr("Variable in time and uniform in space"), '1')
+ self.modelTimeOptions.addItem(self.tr("Variable in time and in space"), '2')
+
+ # Connections
+ self.connect(self.comboBoxOptions, SIGNAL("activated(const QString&)"), self.slotTimePassing)
+ self.connect(self.lineEditDTREF, SIGNAL("textChanged(const QString &)"), self.slotTimeStep)
+ self.connect(self.lineEditNTMABS, SIGNAL("textChanged(const QString &)"), self.slotIter)
+ self.connect(self.lineEditCOUMAX, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionCOUMAX)
+ self.connect(self.lineEditFOUMAX, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionFOUMAX)
+ self.connect(self.lineEditDTMIN, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionDTMIN)
+ self.connect(self.lineEditDTMAX, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionDTMAX)
+ self.connect(self.lineEditVARRDT, SIGNAL("textChanged(const QString &)"), self.slotTimeOptionVARRDT)
+ self.connect(self.checkBoxIPTLRO, SIGNAL("clicked()"), self.slotThermalTimeStep)
+ self.connect(self.checkBoxINPDT0, SIGNAL("clicked()"), self.slotZeroTimeStep)
+
+ # Validators
+
+ validatorDTREF = QtPage.DoubleValidator(self.lineEditDTREF, min=0.0)
+ validatorDTREF.setExclusiveMin(True)
+ validatorNTMABS = QtPage.IntValidator(self.lineEditNTMABS, min=1)
+ validatorCOUMAX = QtPage.DoubleValidator(self.lineEditCOUMAX, min=0.0)
+ validatorCOUMAX.setExclusiveMin(True)
+ validatorFOUMAX = QtPage.DoubleValidator(self.lineEditFOUMAX, min=0.0)
+ validatorFOUMAX.setExclusiveMin(True)
+ validatorDTMIN = QtPage.DoubleValidator(self.lineEditDTMIN, min=0.0, max=1.0)
+ validatorDTMIN.setExclusiveMin(True)
+ validatorDTMAX = QtPage.DoubleValidator(self.lineEditDTMAX, min=1.0)
+ validatorVARRDT = QtPage.DoubleValidator(self.lineEditVARRDT, min=0.0, max=1.0)
+ validatorVARRDT.setExclusiveMin(True)
+
+ self.lineEditDTREF.setValidator(validatorDTREF)
+ self.lineEditNTMABS.setValidator(validatorNTMABS)
+ self.lineEditCOUMAX.setValidator(validatorCOUMAX)
+ self.lineEditFOUMAX.setValidator(validatorFOUMAX)
+ self.lineEditDTMIN.setValidator(validatorDTMIN)
+ self.lineEditDTMAX.setValidator(validatorDTMAX)
+ self.lineEditVARRDT.setValidator(validatorVARRDT)
+
+ # Initialization
+
+ idtvar = self.mdl.getTimePassing()
+ self.modelTimeOptions.setItem(str_model=str(idtvar))
+
+ from TurbulenceModel import TurbulenceModel
+ model = TurbulenceModel(self.case).getTurbulenceModel()
+ del TurbulenceModel
+
+ if model in ('LES_Smagorinsky', 'LES_dynamique', 'LES_WALE'):
+ idtvar = 0
+ self.modelTimeOptions.setItem(str_model=str(idtvar))
+ self.modelTimeOptions.disableItem(str_model='0')
+ self.modelTimeOptions.disableItem(str_model='1')
+ self.modelTimeOptions.disableItem(str_model='2')
+
+ text = self.comboBoxOptions.currentText()
+ self.slotTimePassing(text)
+
+ dtref = self.mdl.getTimeStep()
+ self.lineEditDTREF.setText(QString(str(dtref)))
+
+ ntmabs = self.mdl.getIterationsNumber()
+ self.lineEditNTMABS.setText(QString(str(ntmabs)))
+
+ if self.mdl.thermalCase():
+ if self.mdl.getThermalTimeStep() == 'on':
+ self.checkBoxIPTLRO.setChecked(True)
+ else:
+ self.checkBoxIPTLRO.setChecked(False)
+ else:
+ self.lineIPTLRO.hide()
+ self.labelIPTLRO.hide()
+ self.checkBoxIPTLRO.hide()
+ self.mdl.RemoveThermalTimeStepNode()
+
+ if self.mdl.getZeroTimeStep() == 'on':
+ self.checkBoxINPDT0.setChecked(True)
+ else:
+ self.checkBoxINPDT0.setChecked(False)
+
+
+ @pyqtSignature("")
+ def slotTimePassing(self, text):
+ """
+ Input IDTVAR.
+ """
+ idtvar = int(self.modelTimeOptions.dicoV2M[str(text)])
+
+ self.mdl.setTimePassing(idtvar)
+
+ if idtvar in (1, 2):
+ courant_max = self.mdl.getOptions('max_courant_num')
+ fourier_max = self.mdl.getOptions('max_fourier_num')
+ time_step_min = self.mdl.getOptions('time_step_min') / self.mdl.getTimeStep()
+ time_step_max = self.mdl.getOptions('time_step_max') / self.mdl.getTimeStep()
+ time_step_var = self.mdl.getOptions('time_step_var')
+
+ self.lineEditCOUMAX.setText(QString(str(courant_max)))
+ self.lineEditFOUMAX.setText(QString(str(fourier_max)))
+ self.lineEditDTMIN.setText(QString(str(time_step_min)))
+ self.lineEditDTMAX.setText(QString(str(time_step_max)))
+ self.lineEditVARRDT.setText(QString(str(time_step_var)))
+
+ self.groupBoxLabels.show()
+ else:
+ self.groupBoxLabels.hide()
+
+
+ @pyqtSignature("const QString &")
+ def slotTimeStep(self, text):
+ """
+ Input DTREF.
+ """
+ time_step, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setTimeStep(time_step)
+
+
+ @pyqtSignature("const QString &")
+ def slotIter(self, text):
+ """
+ Input NTMABS.
+ """
+ iteration, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIterationsNumber(iteration)
+
+
+ @pyqtSignature("const QString &")
+ def slotTimeOptionCOUMAX(self, text):
+ """
+ Input COUMAX.
+ """
+ courant_max, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setOptions('max_courant_num', courant_max)
+
+
+ @pyqtSignature("const QString &")
+ def slotTimeOptionFOUMAX(self, text):
+ """
+ Input FOUMAX.
+ """
+ fourier_max, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setOptions('max_fourier_num', fourier_max)
+
+
+ @pyqtSignature("const QString &")
+ def slotTimeOptionDTMIN(self, text):
+ """
+ Input DTMIN.
+ """
+ time_step_min, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ time_step_min = time_step_min * self.mdl.getTimeStep()
+ self.mdl.setOptions('time_step_min', time_step_min)
+
+
+ @pyqtSignature("const QString &")
+ def slotTimeOptionDTMAX(self, text):
+ """
+ Input DTMAX.
+ """
+ time_step_max, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ time_step_max = time_step_max * self.mdl.getTimeStep()
+ self.mdl.setOptions('time_step_max', time_step_max)
+
+
+ @pyqtSignature("const QString &")
+ def slotTimeOptionVARRDT(self, text):
+ """
+ Input VARRDT.
+ """
+ time_step_var, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setOptions('time_step_var', time_step_var)
+
+
+ @pyqtSignature("")
+ def slotThermalTimeStep(self):
+ """
+ Input IPTLRO.
+ """
+ if self.checkBoxIPTLRO.isChecked():
+ self.mdl.setThermalTimeStep("on")
+ else:
+ self.mdl.setThermalTimeStep("off")
+
+
+ @pyqtSignature("")
+ def slotZeroTimeStep(self):
+ """
+ Input INPDT0.
+ """
+ if self.checkBoxINPDT0.isChecked():
+ self.mdl.setZeroTimeStep("on")
+ else:
+ self.mdl.setZeroTimeStep("off")
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/TurbulenceAdvancedOptionsDialogForm.ui b/gui/Pages/TurbulenceAdvancedOptionsDialogForm.ui
new file mode 100644
index 0000000..4d3fef4
--- /dev/null
+++ b/gui/Pages/TurbulenceAdvancedOptionsDialogForm.ui
@@ -0,0 +1,236 @@
+<ui version="4.0" >
+ <class>TurbulenceAdvancedOptionsDialogForm</class>
+ <widget class="QDialog" name="TurbulenceAdvancedOptionsDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>128</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelScales" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDEUCH</string>
+ </property>
+ <property name="text" >
+ <string>Wall function type</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxScales" >
+ <property name="minimumSize" >
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IDEUCH</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>One scale model</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Two scale model</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Scalable wall function</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelGravity" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IGRAKE / IGRARI</string>
+ </property>
+ <property name="text" >
+ <string>Gravity terms in the turbulence equations</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBoxGravity" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: IGRAKE / IGRARI</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>TurbulenceAdvancedOptionsDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>TurbulenceAdvancedOptionsDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/TurbulenceForm.ui b/gui/Pages/TurbulenceForm.ui
new file mode 100644
index 0000000..648bfac
--- /dev/null
+++ b/gui/Pages/TurbulenceForm.ui
@@ -0,0 +1,249 @@
+<ui version="4.0" >
+ <class>TurbulenceForm</class>
+ <widget class="QWidget" name="TurbulenceForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>242</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBoxModel" >
+ <property name="title" >
+ <string>Turbulence model</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBoxTurbModel" >
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: ITURB</string>
+ </property>
+ <property name="statusTip" >
+ <string>For mixing length contact the development team.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameAdvanced" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelAdvanced" >
+ <property name="text" >
+ <string>Advanced options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButtonAdvanced" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="resources_pages.qrc" >:/new/prefix1/icons/22x22/preferences-system.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frameLength" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelLength" >
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XLOMLG</string>
+ </property>
+ <property name="statusTip" >
+ <string>The mixing length is a > 0 real.</string>
+ </property>
+ <property name="text" >
+ <string>Length scale</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditLength" >
+ <property name="maximumSize" >
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>Code_Saturne key word: XLOMLG</string>
+ </property>
+ <property name="statusTip" >
+ <string>The mixing length is a > 0 real.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/TurbulenceModel.py b/gui/Pages/TurbulenceModel.py
new file mode 100644
index 0000000..e559a39
--- /dev/null
+++ b/gui/Pages/TurbulenceModel.py
@@ -0,0 +1,615 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the turbulence model data management.
+
+This module contains the following classes and function:
+- TurbulenceModel
+- TurbulenceTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+from NumericalParamGlobalModel import NumericalParamGlobalModel
+
+#-------------------------------------------------------------------------------
+# Turbulence model class
+#-------------------------------------------------------------------------------
+
+class TurbulenceModel(Variables, Model):
+ """
+ Manage the input/output markups in the xml doc about Turbulence
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ self.node_models = self.case.xmlGetNode('thermophysical_models')
+ self.node_lagr = self.case.xmlGetNode('lagrangian')
+ self.node_coal = self.node_models.xmlGetChildNode('pulverized_coal', 'model')
+ self.node_joule = self.node_models.xmlGetChildNode('joule_effect', 'model')
+ self.node_gas = self.node_models.xmlGetChildNode('gas_combustion', 'model')
+ self.node_turb = self.node_models.xmlInitChildNode('turbulence', 'model')
+ self.node_bc = self.case.xmlGetNode('boundary_conditions')
+
+ self.__turbModel = ('off',
+ 'mixing_length',
+ 'k-epsilon',
+ 'k-epsilon-PL',
+ 'Rij-epsilon',
+ 'Rij-SSG',
+ 'v2f-phi',
+ 'k-omega-SST',
+ 'LES_Smagorinsky',
+ 'LES_dynamique',
+ 'LES_WALE')
+
+ self.__turbLESmodel = ('LES_Smagorinsky',
+ 'LES_dynamique',
+ 'LES_WALE')
+
+ self.__allVariables = ['component_R11',
+ 'component_R22',
+ 'component_R33',
+ 'component_R12',
+ 'component_R13',
+ 'component_R23',
+ 'turb_k',
+ 'turb_eps',
+ 'turb_phi',
+ 'turb_fb',
+ 'turb_omega']
+
+
+ def turbulenceModels(self):
+ """
+ Return all turbulence models known.
+
+ @rtype: C{Tuple}
+ @return: list of turbulence models
+ """
+ return self.__turbModel
+
+
+ def LESmodels(self):
+ """
+ Return only LES turbulence models.
+
+ @rtype: C{Tuple}
+ @return: list of LES models
+ """
+ return self.__turbLESmodel
+
+
+ def RANSmodels(self):
+ """
+ Return only RANS turbulence models.
+
+ @rtype: C{Tuple}
+ @return: list of RANS models
+ """
+ l = []
+ for m in self.__turbModel:
+ if m not in self.__turbLESmodel and \
+ m not in ("off", "mixing_length"):
+ l.append(m)
+ return l
+
+
+ def defaultTurbulenceValues(self):
+ """
+ Return in a dictionnary which contains default values.
+
+ @rtype: C{Dictionary}
+ @return: default values
+ """
+ default = {}
+ default['turbulence_model'] = "k-epsilon"
+ default['length_scale'] = 1.0
+ default['scale_model'] = 1
+ default['gravity_terms'] = "on"
+
+ return default
+
+
+ def turbulenceModelsList(self):
+ """
+ Create a tuple with the turbulence models allowed by the calculation
+ features (multi-phases model, and reactive flow models).
+
+ @rtype: C{Tuple}
+ @return: list of avalaible models
+ """
+ turbList = self.__turbModel
+
+ if self.node_lagr and self.node_lagr['model'] == 'on':
+ turbList = self.RANSmodels()
+ turbList.insert(0, "off")
+
+ for node in (self.node_gas, self.node_coal, self.node_joule):
+ if node and node['model'] != 'off':
+ turbList = self.RANSmodels()
+
+ return turbList
+
+
+ def __removeVariablesAndProperties(self, varList, propName):
+ """
+ Delete variables and property that are useless accordingly to the model.
+ """
+ for v in self.__allVariables:
+ if v not in varList:
+ self.node_turb.xmlRemoveChild('variable', name=v)
+ self.node_turb.xmlRemoveChild('property', name=propName)
+
+
+ def setTurbulenceModel(self, model_turb):
+ """
+ Input ITURB
+ """
+ self.isInList(model_turb, self.turbulenceModelsList())
+
+ NumericalParamGlobalModel(self.case).setTimeSchemeOrder(1)
+
+ if model_turb == 'mixing_length':
+ self.setNewProperty(self.node_turb, 'turb_viscosity')
+ self.__removeVariablesAndProperties([], 'smagorinsky_constant')
+
+ elif model_turb in ('k-epsilon', 'k-epsilon-PL'):
+ list = ('turb_k', 'turb_eps')
+ for v in list:
+ self.setNewTurbulenceVariable(self.node_turb, v)
+ self.setNewProperty(self.node_turb, 'turb_viscosity')
+ self.__updateInletsForTurbulence()
+ self.__removeVariablesAndProperties(list, 'smagorinsky_constant')
+
+ elif model_turb in ('Rij-epsilon', 'Rij-SSG'):
+ list = ('component_R11', 'component_R22', 'component_R33',
+ 'component_R12', 'component_R13', 'component_R23',
+ 'turb_eps')
+ for v in list:
+ self.setNewTurbulenceVariable(self.node_turb, v)
+ self.setNewProperty(self.node_turb, 'turb_viscosity')
+ self.__updateInletsForTurbulence()
+ self.__removeVariablesAndProperties(list, 'smagorinsky_constant')
+
+ elif model_turb in self.LESmodels():
+ self.setNewProperty(self.node_turb, 'smagorinsky_constant')
+ self.__removeVariablesAndProperties([], 'turb_viscosity')
+
+ from TimeStepModel import TimeStepModel
+ TimeStepModel(self.case).setTimePassing(0)
+ del TimeStepModel
+
+ NumericalParamGlobalModel(self.case).setTimeSchemeOrder(2)
+
+ from Pages.NumericalParamEquationModel import NumericalParamEquatModel
+ NumericalParamEquatModel(self.case).setSchemeDefaultValues()
+ del NumericalParamEquatModel
+
+ elif model_turb == 'v2f-phi':
+ list = ('turb_k', 'turb_eps', 'turb_phi', 'turb_fb')
+ for v in list:
+ self.setNewTurbulenceVariable(self.node_turb, v)
+ self.setNewProperty(self.node_turb, 'turb_viscosity')
+ self.__updateInletsForTurbulence()
+ self.__removeVariablesAndProperties(list, 'smagorinsky_constant')
+
+ elif model_turb == 'k-omega-SST':
+ list = ('turb_k', 'turb_omega')
+ for v in list:
+ self.setNewTurbulenceVariable(self.node_turb, v)
+ self.setNewProperty(self.node_turb, 'turb_viscosity')
+ self.__updateInletsForTurbulence()
+ self.__removeVariablesAndProperties(list, 'smagorinsky_constant')
+
+ else:
+ model_turb = 'off'
+ self.node_turb.xmlRemoveChild('variable')
+ self.node_turb.xmlRemoveChild('property')
+
+ self.node_turb['model'] = model_turb
+
+
+ def __updateInletsForTurbulence(self):
+ """
+ Put boundaries conditions if it's necessary
+ """
+ from Boundary import Boundary
+ for nodbc in self.node_bc.xmlGetChildNodeList('inlet'):
+ model = Boundary('inlet', nodbc['label'], self.case)
+ model.getTurbulenceChoice()
+
+
+ def getTurbulenceModel(self):
+ """
+ Return the current turbulence model.
+ """
+ model = self.node_turb['model']
+ if model not in self.turbulenceModelsList():
+ model = self.defaultTurbulenceValues()['turbulence_model']
+ self.setTurbulenceModel(model)
+ return model
+
+
+ def setLengthScale(self, l_scale):
+ """
+ Input XLOMLG.
+ """
+ self.isGreater(l_scale, 0.0)
+ if self.getTurbulenceModel() == 'mixing_length':
+ self.node_turb.xmlSetData('mixing_length_scale', l_scale)
+
+
+ def getLengthScale(self):
+ """
+ Return XLOMLG.
+ """
+ l_scale = self.node_turb.xmlGetDouble('mixing_length_scale')
+ if l_scale == None:
+ l_scale = self.defaultTurbulenceValues()['length_scale']
+ self.setLengthScale(l_scale)
+ return l_scale
+
+
+ def getScaleModel(self):
+ """
+ Return scale model from advanced options.
+ """
+ scale = self.node_turb.xmlGetInt('scale_model')
+ if scale != 0 and scale != 1 and scale != 2:
+ scale = self.defaultTurbulenceValues()['scale_model']
+ self.setScaleModel(scale)
+ return scale
+
+
+ def setScaleModel(self, scale):
+ """
+ Input scale model for advanced options.
+ """
+ self.isIntInList(scale, [0, 1, 2])
+ self.node_turb.xmlSetData('scale_model', scale)
+
+
+ def getGravity(self):
+ """
+ Return scale model from advanced options .
+ """
+ node_gravity = self.node_turb.xmlInitNode('gravity_terms', 'status')
+ gravity = node_gravity['status']
+ if not gravity:
+ gravity = self.defaultTurbulenceValues()['gravity_terms']
+ self.setGravity(gravity)
+
+ return gravity
+
+
+ def setGravity(self, gravity):
+ """
+ Input gravity for advanced options.
+ """
+ self.isOnOff(gravity)
+ node_gravity = self.node_turb.xmlInitNode('gravity_terms', 'status')
+ node_gravity ['status'] = gravity
+
+
+ def getTurbulenceVariable(self):
+ """
+ Return the turbulence <variable> markup list.
+ """
+ model = self.getTurbulenceModel()
+ nodeList = []
+
+ if model in ('k-epsilon','k-epsilon-PL'):
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_k'))
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_eps'))
+ elif model in ('Rij-epsilon', 'Rij-SSG'):
+ for var in ('component_R11', 'component_R22', 'component_R33',
+ 'component_R12', 'component_R13', 'component_R23', 'turb_eps'):
+ nodeList.append(self.node_turb.xmlGetNode('variable', name=var))
+ elif model == 'v2f-phi':
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_k'))
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_eps'))
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_phi'))
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_fb'))
+ elif model == 'k-omega-SST':
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_k'))
+ nodeList.append(self.node_turb.xmlGetNode('variable', name='turb_omega'))
+ return nodeList
+
+#-------------------------------------------------------------------------------
+# TurbulenceModel test case
+#-------------------------------------------------------------------------------
+
+class TurbulenceModelTestCase(ModelTest):
+ """
+ """
+ def checkTurbulenceInstantiation(self):
+ """Check whether the TurbulenceModel class could be instantiated"""
+ model = None
+ model = TurbulenceModel(self.case)
+ assert model != None, 'Could not instantiate TurbulenceModel'
+
+ def checkTurbulenceModelsList(self):
+ """Check whether the TurbulenceModelList could be get"""
+ from LagrangianModel import LagrangianModel
+ LagrangianModel(self.case).setLagrangianStatus('on')
+ del LagrangianModel
+ mdl = TurbulenceModel(self.case)
+
+ l = mdl.RANSmodels()
+ l.insert(0, "off")
+ assert mdl.turbulenceModelsList() == l, \
+ 'Could not return turbulence models for particles tracking'
+
+ mdl.node_gas['model'] = 'on'
+ assert mdl.turbulenceModelsList() == mdl.RANSmodels(), \
+ 'Could not return turbulence models for particular physics'
+
+ def checkSetMixingLength(self):
+ """Check whether the mixing length turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.node_turb.xmlRemoveChild('variable')
+ mdl.setTurbulenceModel('mixing_length')
+ mdl.setLengthScale(1)
+ doc ='''<turbulence model="mixing_length">
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ <mixing_length_scale>1</mixing_length_scale>
+ </turbulence>'''
+
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the mixing length turbulence model'
+
+ def checkSetkepsilon(self):
+ """Check whether the k-epsilon turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('k-epsilon')
+ doc ='''<turbulence model="k-epsilon">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ </turbulence>'''
+
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the k-epsilon turbulence model'
+
+ def checkSetkepsilonPL(self):
+ """Check whether the k-epsilon turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('k-epsilon-PL')
+ doc ='''<turbulence model="k-epsilon-PL">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the linear production k-epsilon turbulence model'
+
+ def checkSetRijepsilon(self):
+ """Check whether the Rij-epsilon turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.node_turb.xmlRemoveChild('variable')
+ mdl.setTurbulenceModel('Rij-epsilon')
+ doc ='''<turbulence model="Rij-epsilon">
+ <property label="turb. vi" name="turb_viscosity"/>
+ <variable label="R11" name="component_R11"/>
+ <variable label="R22" name="component_R22"/>
+ <variable label="R33" name="component_R33"/>
+ <variable label="R12" name="component_R12"/>
+ <variable label="R13" name="component_R13"/>
+ <variable label="R23" name="component_R23"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the Rij-epsilon turbulence model'
+
+ def checkSetRijepsilonSSG(self):
+ """Check whether the Rij-epsilon SSG turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.node_turb.xmlRemoveChild('variable')
+ mdl.setTurbulenceModel('Rij-SSG')
+ truc = mdl.node_turb
+ doc ='''<turbulence model="Rij-SSG">
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ <variable label="R11" name="component_R11"/>
+ <variable label="R22" name="component_R22"/>
+ <variable label="R33" name="component_R33"/>
+ <variable label="R12" name="component_R12"/>
+ <variable label="R13" name="component_R13"/>
+ <variable label="R23" name="component_R23"/>
+ <variable label="Dissip" name="turb_eps"/>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the Rij-epsilon SSG turbulence model'
+
+ def checkSetLESSmagorinsky(self):
+ """Check whether the classical LES turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.node_turb.xmlRemoveChild('variable')
+ mdl.node_turb.xmlRemoveChild('property')
+ mdl.node_turb.xmlRemoveChild('initialization')
+ mdl.setTurbulenceModel('LES_Smagorinsky')
+ truc = mdl.node_turb
+ doc ='''<turbulence model="LES_Smagorinsky">
+ <property label="Csdyn2" name="smagorinsky_constant"/>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the LES turbulence model'
+
+ def checkSetLESdynamique(self):
+ """Check whether the dynamique LES turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.node_turb.xmlRemoveChild('variable')
+ mdl.node_turb.xmlRemoveChild('property')
+ mdl.node_turb.xmlRemoveChild('initialization')
+ mdl.setTurbulenceModel('LES_dynamique')
+ truc = mdl.node_turb
+ doc = '''<turbulence model="LES_dynamique">
+ <property label="Csdyn2" name="smagorinsky_constant"/>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the dynamique LES turbulence model'
+
+ def checkSetV2F(self):
+ """Check whether the v2f phi turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('v2f-phi')
+ doc = '''<turbulence model="v2f-phi">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <variable label="phi" name="turb_phi"/>
+ <variable label="fb" name="turb_fb"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1.0</reference_velocity>
+ </initialization>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the v2f phi turbulence model'
+
+ def checkkOmegaSST(self):
+ """Check whether the k-Omega SST turbulence model could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('k-omega-SST')
+ doc = '''<turbulence model="k-omega-SST">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <variable label="omega" name="turb_omega"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1.0</reference_velocity>
+ </initialization>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the k_Omega SST turbulence model'
+
+ def checkGetTurbulenceModel(self):
+ """Check whether the turbulence model could be get"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('Rij-epsilon')
+
+ assert mdl.getTurbulenceModel() == 'Rij-epsilon', \
+ 'Could not get the turbulence model'
+
+ def checkSetLengthScale(self):
+ """Check whether the mixing length scale could be set"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('mixing_length')
+ mdl.node_turb.xmlRemoveChild('variable')
+ mdl.node_turb.xmlRemoveChild('property')
+ mdl.node_turb.xmlRemoveChild('initialization')
+ mdl.setLengthScale(123.0)
+ doc = '''<turbulence model="mixing_length">
+ <mixing_length_scale>123</mixing_length_scale>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the mixing length scale'
+
+ def checkSetandGetScaleModel(self):
+ """Check whether the scale model could be get"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('k-epsilon')
+ mdl.setScaleModel(2)
+
+ doc = '''<turbulence model="k-epsilon">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ <scale_model>2</scale_model>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set the scale model '
+ assert mdl.getScaleModel() == 2,\
+ 'Could not get the scale model '
+
+ def checkSetandGetgravity(self):
+ """Check whether the gravity could be get"""
+ mdl = TurbulenceModel(self.case)
+ mdl.setTurbulenceModel('k-epsilon')
+ mdl.setGravity('off')
+ doc = '''<turbulence model="k-epsilon">
+ <variable label="TurbEner" name="turb_k"/>
+ <variable label="Dissip" name="turb_eps"/>
+ <property label="turb. vi" name="turb_viscosity"/>
+ <initialization choice="reference_velocity">
+ <reference_velocity>1</reference_velocity>
+ </initialization>
+ <gravity_terms status="off"/>
+ </turbulence>'''
+ assert mdl.node_turb == self.xmlNodeFromString(doc),\
+ 'Could not set gravity status '
+ assert mdl.getGravity() == "off",\
+ 'Could not get gravity status '
+
+
+def suite():
+ testSuite = unittest.makeSuite(TurbulenceModelTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "TurbulenceModelTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/TurbulenceView.py b/gui/Pages/TurbulenceView.py
new file mode 100644
index 0000000..2d7ff59
--- /dev/null
+++ b/gui/Pages/TurbulenceView.py
@@ -0,0 +1,294 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the turbulence model data management.
+
+This module contains the following classes:
+- TurbulenceAdvancedOptionsDialogView
+- TurbulenceView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from TurbulenceForm import Ui_TurbulenceForm
+from TurbulenceAdvancedOptionsDialogForm import Ui_TurbulenceAdvancedOptionsDialogForm
+import Base.QtPage as QtPage
+from Pages.TurbulenceModel import TurbulenceModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("TurbulenceView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Advanced dialog
+#-------------------------------------------------------------------------------
+
+class TurbulenceAdvancedOptionsDialogView(QDialog, Ui_TurbulenceAdvancedOptionsDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_TurbulenceAdvancedOptionsDialogForm.__init__(self)
+ self.setupUi(self)
+
+ if default['model'] in ('k-epsilon', 'k-epsilon-PL'):
+ title = self.tr("Options for k-epsilon model")
+ elif default['model'] in ('Rij-epsilon', 'Rij-SSG'):
+ title = self.tr("Options for Rij-epsilon model")
+ elif default['model'] == 'k-omega-SST':
+ title = self.tr("Options for k-omega_SST model")
+ elif default['model'] == 'v2f-phi':
+ title = self.tr("Options for v2f-phi model")
+ self.setWindowTitle(title)
+ self.default = default
+ self.result = self.default.copy()
+
+ # Combo
+
+ self.modelScales = QtPage.ComboModel(self.comboBoxScales, 3, 1)
+
+ self.modelScales.addItem(self.tr("One scale model"), '0')
+ self.modelScales.addItem(self.tr("Two scale model"), '1')
+ self.modelScales.addItem(self.tr("Scalable wall function"), '2')
+
+ # Initialization
+
+ self.modelScales.setItem(str_model=str(self.result['scale_model']))
+ if self.result['gravity_terms'] == 'on':
+ self.checkBoxGravity.setChecked(True)
+ else:
+ self.checkBoxGravity.setChecked(False)
+
+
+ def get_result(self):
+ """
+ Method to get the result
+ """
+ return self.result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ if self.checkBoxGravity.isChecked():
+ self.result['gravity_terms'] = "on"
+ else:
+ self.result['gravity_terms'] = "off"
+ self.result['scale_model'] = \
+ int(self.modelScales.dicoV2M[str(self.comboBoxScales.currentText())])
+
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Main view class
+#-------------------------------------------------------------------------------
+
+class TurbulenceView(QWidget, Ui_TurbulenceForm):
+ """
+ Class to open Turbulence Page.
+ """
+ def __init__(self, parent=None, case=None):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_TurbulenceForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.model = TurbulenceModel(self.case)
+
+ # Combo model
+
+ self.modelTurbModel = QtPage.ComboModel(self.comboBoxTurbModel,10,1)
+
+ self.modelTurbModel.addItem(self.tr("No model (i.e. laminar flow)"), "off")
+ self.modelTurbModel.addItem(self.tr("Mixing length"), "mixing_length")
+ self.modelTurbModel.addItem(self.tr("k-epsilon"), "k-epsilon")
+ self.modelTurbModel.addItem(self.tr("k-epsilon Linear Production"), "k-epsilon-PL")
+ self.modelTurbModel.addItem(self.tr("Rij-epsilon LLR"), "Rij-epsilon")
+ self.modelTurbModel.addItem(self.tr("Rij-epsilon SSG"), "Rij-SSG")
+ self.modelTurbModel.addItem(self.tr("v2f (phi model)"), "v2f-phi")
+ self.modelTurbModel.addItem(self.tr("k-omega SST"), "k-omega-SST")
+ self.modelTurbModel.addItem(self.tr("LES (Smagorinsky)"), "LES_Smagorinsky")
+ self.modelTurbModel.addItem(self.tr("LES (classical dynamic model)"), "LES_dynamique")
+ self.modelTurbModel.addItem(self.tr("LES (WALE)"), "LES_WALE")
+
+ # Connections
+
+ self.connect(self.comboBoxTurbModel, SIGNAL("activated(const QString&)"), self.slotTurbulenceModel)
+ self.connect(self.pushButtonAdvanced, SIGNAL("clicked()"), self.slotAdvancedOptions)
+ self.connect(self.lineEditLength, SIGNAL("textChanged(const QString &)"), self.slotLengthScale)
+
+ # Frames display
+
+ self.frameAdvanced.hide()
+ self.frameLength.hide()
+
+ # Validator
+
+ validator = QtPage.DoubleValidator(self.lineEditLength, min=0.0)
+ validator.setExclusiveMin(True)
+ #validator.setFixup(self.model.defaultTurbulenceValues()['length_scale'])
+ self.lineEditLength.setValidator(validator)
+
+
+ # Update the turbulence models list with the calculation features
+
+ for turb in self.model.turbulenceModels():
+ if turb not in self.model.turbulenceModelsList():
+ self.modelTurbModel.disableItem(str_model=turb)
+
+ # Select the turbulence model
+
+ model = self.model.getTurbulenceModel()
+ self.modelTurbModel.setItem(str_model=model)
+ self.slotTurbulenceModel(self.comboBoxTurbModel.currentText())
+
+ # Length scale
+
+ l_scale = self.model.getLengthScale()
+ self.lineEditLength.setText(QString(str(l_scale)))
+
+
+ @pyqtSignature("const QString&")
+ def slotLengthScale(self, text):
+ """
+ Private slot.
+ Input XLOMLG.
+ """
+ l_scale, ok = text.toDouble()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.model.setLengthScale(l_scale)
+
+
+ @pyqtSignature("const QString&")
+ def slotTurbulenceModel(self, text):
+ """
+ Private slot.
+ Input ITURB.
+ """
+ model = self.modelTurbModel.dicoV2M[str(text)]
+ self.model.setTurbulenceModel(model)
+
+ self.frameAdvanced.hide()
+ self.frameLength.hide()
+
+ if model == 'mixing_length':
+ self.frameLength.show()
+ self.frameAdvanced.hide()
+ self.model.getLengthScale()
+ elif model not in ('off', 'LES_Smagorinsky', 'LES_dynamique', 'LES_WALE'):
+ self.frameLength.hide()
+ self.frameAdvanced.show()
+
+ if model in ('off', 'LES_Smagorinsky', 'LES_dynamique', 'LES_WALE'):
+ self.line.hide()
+ else:
+ self.line.show()
+
+## if model in ('LES_Smagorinsky', 'LES_dynamique'):
+## title = self.tr("Turbulence model")
+## msg = self.tr("Please report to the informations \n" \
+## "contain in the user subroutine: 'ussmag'")
+## QMessageBox.warning(self, title, msg)
+
+
+ @pyqtSignature("")
+ def slotAdvancedOptions(self):
+ """
+ Private slot.
+ Ask one popup for advanced specifications
+ """
+ default = {}
+ default['model'] = self.model.getTurbulenceModel()
+ default['scale_model'] = self.model.getScaleModel()
+ default['gravity_terms'] = self.model.getGravity()
+ log.debug("slotAdvancedOptions -> %s" % str(default))
+
+ dialog = TurbulenceAdvancedOptionsDialogView(self, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ log.debug("slotAdvancedOptions -> %s" % str(result))
+ self.model.setTurbulenceModel(result['model'])
+ self.model.setScaleModel(result['scale_model'])
+ self.model.setGravity(result['gravity_terms'])
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/UserArraysForm.ui b/gui/Pages/UserArraysForm.ui
new file mode 100644
index 0000000..c6f5f6a
--- /dev/null
+++ b/gui/Pages/UserArraysForm.ui
@@ -0,0 +1,336 @@
+<ui version="4.0" >
+ <class>UserArraysForm</class>
+ <widget class="QWidget" name="UserArraysForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>348</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Integer array</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Array size NITUSE = </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditIDIMLS" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_6" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditICEL" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="label_2" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NCELET</string>
+ </property>
+ <property name="text" >
+ <string>x Number of cells with halo</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_9" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditIFAC" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="label_3" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFAC</string>
+ </property>
+ <property name="text" >
+ <string>x Number of interior faces</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_10" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditIFABOR" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" >
+ <widget class="QLabel" name="label_4" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFABOR</string>
+ </property>
+ <property name="text" >
+ <string>x Number of boundary faces</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Real array</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Array size NRTUSE = </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="lineEditRDIMLS" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_11" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="lineEditRCEL" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_12" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="lineEditRFAC" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QLabel" name="label_7" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFAC</string>
+ </property>
+ <property name="text" >
+ <string>x Number of interior faces</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_13" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="lineEditRFABOR" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="statusTip" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" >
+ <widget class="QLabel" name="label_8" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NFABOR</string>
+ </property>
+ <property name="text" >
+ <string>x Number of boundary faces</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLabel" name="labelRCEL" >
+ <property name="toolTip" >
+ <string>Code_Saturne keyword: NCELET</string>
+ </property>
+ <property name="text" >
+ <string>x Number of cells with halo</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/UserArraysModel.py b/gui/Pages/UserArraysModel.py
new file mode 100644
index 0000000..6a51933
--- /dev/null
+++ b/gui/Pages/UserArraysModel.py
@@ -0,0 +1,352 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- UserArraysModel
+- UserArraysTestCase
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, unittest
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Common import *
+import Base.Toolbox as Tool
+from Base.XMLvariables import Variables, Model
+from Base.XMLmodel import ModelTest
+
+#-------------------------------------------------------------------------------
+# User arrays model class
+#-------------------------------------------------------------------------------
+
+class UserArraysModel(Model):
+ """
+ Manage the input/output markups in the xml doc about Integer and real user arrays
+ """
+ def __init__(self, case):
+ """
+ Constructor.
+ """
+ self.case = case
+
+ self.node_calcul = self.case.xmlGetNode('calcul_management')
+ self.node_int = self.node_calcul.xmlInitNode('integer_user_array')
+ self.node_real = self.node_calcul.xmlInitNode('real_user_array')
+
+
+ def defaultValues(self):
+ """
+ Return reference values by default
+ """
+ default = {}
+ default['icel'] = 0
+ default['ifac'] = 0
+ default['ifab'] = 0
+ default['idls'] = 0
+ default['rcel'] = 0
+ default['rfac'] = 0
+ default['rfab'] = 0
+ default['rdls'] = 0
+ return default
+
+
+ def setIntegerNcelet(self, value):
+ """
+ Set number of cells with halo into integer user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('ncelet', value)
+
+
+ def setIntegerNfac(self, value):
+ """
+ Set number of internal faces into integer user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('nfac', value)
+
+
+ def setIntegerNfabor(self, value):
+ """
+ Set number of boundary faces into integer user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('nfabor', value)
+
+
+ def setIntegerDimless(self, value):
+ """
+ Set integer value for integer user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_int.xmlSetData('dimless', value)
+
+
+ def setRealNcelet(self, value):
+ """
+ Set number of cells with halo into real user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('ncelet', value)
+
+
+ def setRealNfac(self, value):
+ """
+ Set number of internal faces into real user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('nfac', value)
+
+
+ def setRealNfabor(self, value):
+ """
+ Set number of boundary faces into real user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('nfabor', value)
+
+
+ def setRealDimless(self, value):
+ """
+ Set integer value into real user's array.
+ """
+ self.isPositiveInt(value)
+ self.node_real.xmlSetData('dimless', value)
+
+
+ def getIntegerNcelet(self):
+ """
+ Return number of cells with halo from integer user's array.
+ """
+ value = self.node_int.xmlGetInt('ncelet')
+ if value == None:
+ value = self.defaultValues()['icel']
+ self.setIntegerNcelet(value)
+ return value
+
+
+ def getIntegerNfac(self):
+ """
+ Return number of cells with halo from integer user's array.
+ """
+ value = self.node_int.xmlGetInt('nfac')
+ if value == None:
+ value = self.defaultValues()['ifac']
+ return value
+
+
+ def getIntegerNfabor(self):
+ """
+ Return number of cells with halo from integer user's array.
+ """
+ value = self.node_int.xmlGetInt('nfabor')
+ if value == None:
+ value = self.defaultValues()['ifab']
+ return value
+
+
+ def getIntegerDimless(self):
+ """
+ Return number of cells with halo from integer user's array.
+ """
+ value = self.node_int.xmlGetInt('dimless')
+ if value == None:
+ value = self.defaultValues()['idls']
+ return value
+
+
+ def getRealNcelet(self):
+ """
+ Return number of cells with halo from real user's array.
+ """
+ value = self.node_real.xmlGetInt('ncelet')
+ if value == None:
+ value = self.defaultValues()['rcel']
+ return value
+
+
+ def getRealNfac(self):
+ """
+ Return number of cells with halo from real user's array.
+ """
+ value = self.node_real.xmlGetInt('nfac')
+ if value == None:
+ value = self.defaultValues()['rfac']
+ return value
+
+
+ def getRealNfabor(self):
+ """
+ Return number of cells with halo from real user's array.
+ """
+ value = self.node_real.xmlGetInt('nfabor')
+ if value == None:
+ value = self.defaultValues()['rfab']
+ return value
+
+
+ def getRealDimless(self):
+ """
+ Return number of cells with halo from real user's array.
+ """
+ value = self.node_real.xmlGetInt('dimless')
+ if value == None:
+ value = self.defaultValues()['rdls']
+ return value
+
+#-------------------------------------------------------------------------------
+# UserArraysModel test case
+#-------------------------------------------------------------------------------
+
+class UserArraysTestCase(ModelTest):
+ """
+ """
+ def checkUserArraysInstantiation(self):
+ """Check whether the UserArraysModel class could be instantiated"""
+ model = None
+ model = UserArraysModel(self.case)
+ assert model != None, 'Could not instantiate UserArraysModel'
+
+ def checkGetandSetIntegerNcelet(self):
+ """Check whether the integer ncelet user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setIntegerNcelet(111)
+ doc = '''<integer_user_array>
+ <ncelet>111</ncelet>
+ </integer_user_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer ncelet user arrays model'
+ assert mdl.getIntegerNcelet() == 111,\
+ 'Could not get integer ncelet user arrays model'
+
+ def checkGetandSetIntegerNfac(self):
+ """Check whether the integer nfac user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setIntegerNfac(211)
+ doc = '''<integer_user_array>
+ <nfac>211</nfac>
+ </integer_user_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer nfac user arrays model'
+ assert mdl.getIntegerNfac() == 211,\
+ 'Could not get integer nfac user arrays model'
+
+ def checkGetandSetIntegerNfabor(self):
+ """Check whether the integer nfabor user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setIntegerNfabor(33)
+ doc = '''<integer_user_array>
+ <nfabor>33</nfabor>
+ </integer_user_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer nfabor user arrays model'
+ assert mdl.getIntegerNfabor() == 33,\
+ 'Could not get integer nfabor user arrays model'
+
+ def checkGetandSetIntegerDimless(self):
+ """Check whether the integer dimless user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setIntegerDimless(10)
+ doc = '''<integer_user_array>
+ <dimless>10</dimless>
+ </integer_user_array>'''
+ assert mdl.node_int == self.xmlNodeFromString(doc),\
+ 'Could not set integer dimless user arrays model'
+ assert mdl.getIntegerDimless() == 10,\
+ 'Could not get integer dimless user arrays model'
+
+ def checkGetandSetRealNcelet(self):
+ """Check whether the real ncelet user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setRealNcelet(999)
+ doc = '''<real_user_array>
+ <ncelet>999</ncelet>
+ </real_user_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real ncelet user arrays model'
+ assert mdl.getRealNcelet() == 999,\
+ 'Could not get real ncelet user arrays model'
+
+ def checkGetandSetRealNfac(self):
+ """Check whether the real nfac user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setRealNfac(988)
+ doc = '''<real_user_array>
+ <nfac>988</nfac>
+ </real_user_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real nfac user arrays model'
+ assert mdl.getRealNfac() == 988,\
+ 'Could not get real nfac user arrays model'
+
+ def checkGetandSetRealNfabor(self):
+ """Check whether the real nfabor user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setRealNfabor(977)
+ doc = '''<real_user_array>
+ <nfabor>977</nfabor>
+ </real_user_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real nfabor user arrays model'
+ assert mdl.getRealNfabor() == 977,\
+ 'Could not get real nfabor user arrays model'
+
+ def checkGetandSetRealDimless(self):
+ """Check whether the real dimless user arrays model could be set"""
+ mdl = UserArraysModel(self.case)
+ mdl.setRealDimless(966)
+ doc = '''<real_user_array>
+ <dimless>966</dimless>
+ </real_user_array>'''
+ assert mdl.node_real == self.xmlNodeFromString(doc),\
+ 'Could not set real dimless user arrays model'
+ assert mdl.getRealDimless() == 966,\
+ 'Could not get real dimless user arrays model'
+
+def suite():
+ testSuite = unittest.makeSuite(UserArraysTestCase, "check")
+ return testSuite
+
+def runTest():
+ print "UserArraysTestCase"
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/UserArraysView.py b/gui/Pages/UserArraysView.py
new file mode 100644
index 0000000..340208a
--- /dev/null
+++ b/gui/Pages/UserArraysView.py
@@ -0,0 +1,236 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the values of reference.
+
+This module contains the following classes and function:
+- UserArraysView
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from Base.Toolbox import GuiParam
+from UserArraysForm import Ui_UserArraysForm
+import Base.QtPage as QtPage
+from Pages.UserArraysModel import UserArraysModel
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("UserArraysView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Main View class
+#-------------------------------------------------------------------------------
+
+class UserArraysView(QWidget, Ui_UserArraysForm):
+ """
+ Class to open User arrays Page.
+ """
+ def __init__(self, parent, case):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_UserArraysForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.mdl = UserArraysModel(self.case)
+
+ # Connections
+
+ self.connect(self.lineEditICEL, SIGNAL("textChanged(const QString &)"), self.slotICEL)
+ self.connect(self.lineEditRCEL, SIGNAL("textChanged(const QString &)"), self.slotRCEL)
+ self.connect(self.lineEditIFAC, SIGNAL("textChanged(const QString &)"), self.slotIFAC)
+ self.connect(self.lineEditRFAC, SIGNAL("textChanged(const QString &)"), self.slotRFAC)
+ self.connect(self.lineEditIFABOR, SIGNAL("textChanged(const QString &)"), self.slotIFABOR)
+ self.connect(self.lineEditRFABOR, SIGNAL("textChanged(const QString &)"), self.slotRFABOR)
+ self.connect(self.lineEditIDIMLS, SIGNAL("textChanged(const QString &)"), self.slotIDIMLS)
+ self.connect(self.lineEditRDIMLS, SIGNAL("textChanged(const QString &)"), self.slotRDIMLS)
+
+ # Validators
+
+ validatorICEL = QtPage.IntValidator(self.lineEditICEL, min=0)
+ validatorRCEL = QtPage.IntValidator(self.lineEditRCEL, min=0)
+ validatorIFAC = QtPage.IntValidator(self.lineEditIFAC, min=0)
+ validatorRFAC = QtPage.IntValidator(self.lineEditRFAC, min=0)
+ validatorIFABOR = QtPage.IntValidator(self.lineEditIFABOR, min=0)
+ validatorRFABOR = QtPage.IntValidator(self.lineEditRFABOR, min=0)
+ validatorIDIMLS = QtPage.IntValidator(self.lineEditIDIMLS, min=0)
+ validatorRDIMLS = QtPage.IntValidator(self.lineEditRDIMLS, min=0)
+
+ self.lineEditICEL.setValidator(validatorICEL)
+ self.lineEditRCEL.setValidator(validatorRCEL)
+ self.lineEditIFAC.setValidator(validatorIFAC)
+ self.lineEditRFAC.setValidator(validatorRFAC)
+ self.lineEditIFABOR.setValidator(validatorIFABOR)
+ self.lineEditRFABOR.setValidator(validatorRFABOR)
+ self.lineEditIDIMLS.setValidator(validatorIDIMLS)
+ self.lineEditRDIMLS.setValidator(validatorRDIMLS)
+
+ # Initialization
+
+ icel = self.mdl.getIntegerNcelet()
+ ifac = self.mdl.getIntegerNfac()
+ ifabor = self.mdl.getIntegerNfabor()
+ idimls = self.mdl.getIntegerDimless()
+
+ rcel = self.mdl.getRealNcelet()
+ rfac = self.mdl.getRealNfac()
+ rfabor = self.mdl.getRealNfabor()
+ rdimls = self.mdl.getRealDimless()
+
+ self.lineEditICEL.setText(QString(str(icel)))
+ self.lineEditIFAC.setText(QString(str(ifac)))
+ self.lineEditIFABOR.setText(QString(str(ifabor)))
+ self.lineEditIDIMLS.setText(QString(str(idimls)))
+
+ self.lineEditRCEL.setText(QString(str(rcel)))
+ self.lineEditRFAC.setText(QString(str(rfac)))
+ self.lineEditRFABOR.setText(QString(str(rfabor)))
+ self.lineEditRDIMLS.setText(QString(str(rdimls)))
+
+
+ @pyqtSignature("const QString&")
+ def slotICEL(self, text):
+ """
+ Input number of cells with halo for integer array.
+ """
+ icel, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerNcelet(icel)
+
+
+ @pyqtSignature("const QString&")
+ def slotRCEL(self, text):
+ """
+ Input number of cells with halo for real array.
+ """
+ rcel, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealNcelet(rcel)
+
+
+ @pyqtSignature("const QString&")
+ def slotIFAC(self, text):
+ """
+ Input number of internal faces for integer array.
+ """
+ ifac, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerNfac(ifac)
+
+
+ @pyqtSignature("const QString&")
+ def slotRFAC(self, text):
+ """
+ Input number of internal faces for real array.
+ """
+ rfac, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealNfac(rfac)
+
+
+ @pyqtSignature("const QString&")
+ def slotIFABOR(self, text):
+ """
+ Input number of boundary faces for integer array.
+ """
+ ifabor, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerNfabor(ifabor)
+
+
+ @pyqtSignature("const QString&")
+ def slotRFABOR(self, text):
+ """
+ Input number of boundary faces for real array.
+ """
+ rfabor, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealNfabor(rfabor)
+
+
+ @pyqtSignature("const QString&")
+ def slotIDIMLS(self, text):
+ """
+ Input integer value for integer array.
+ """
+ idimls, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setIntegerDimless(idimls)
+
+
+ @pyqtSignature("const QString&")
+ def slotRDIMLS(self, text):
+ """
+ Input integer value for real array.
+ """
+ rdimls, ok = text.toInt()
+ if self.sender().validator().state == QValidator.Acceptable:
+ self.mdl.setRealDimless(rdimls)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# Testing part
+#-------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+ pass
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/UserScalarPropertiesForm.ui b/gui/Pages/UserScalarPropertiesForm.ui
new file mode 100644
index 0000000..e8c60d4
--- /dev/null
+++ b/gui/Pages/UserScalarPropertiesForm.ui
@@ -0,0 +1,99 @@
+<ui version="4.0" >
+ <class>UserScalarPropertiesForm</class>
+ <widget class="QWidget" name="UserScalarPropertiesForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>149</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>User Scalar Diffusion Coefficient</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QTableView" name="table" >
+ <property name="editTriggers" >
+ <set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::NoEditTriggers|QAbstractItemView::SelectedClicked</set>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelFortran" >
+ <property name="font" >
+ <font>
+ <pointsize>10</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>You must complete usphyv.f90</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/gui/Pages/UserScalarPropertiesView.py b/gui/Pages/UserScalarPropertiesView.py
new file mode 100644
index 0000000..4ed2c1b
--- /dev/null
+++ b/gui/Pages/UserScalarPropertiesView.py
@@ -0,0 +1,382 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module contains the following classes:
+- LabelDelegate
+- TypeDelegate
+- ValueDelegate
+- StandardItemModelScalars
+- UserScalarPropertiesView
+"""
+
+#-------------------------------------------------------------------------------
+# Standard modules
+#-------------------------------------------------------------------------------
+
+import logging
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from UserScalarPropertiesForm import Ui_UserScalarPropertiesForm
+from DefineUserScalarsModel import DefineUserScalarsModel
+from Base.Toolbox import GuiParam
+from Base.Common import LABEL_LENGTH_MAX
+from Base.QtPage import ComboModel, DoubleValidator, RegExpValidator
+
+#-------------------------------------------------------------------------------
+# log config
+#-------------------------------------------------------------------------------
+
+logging.basicConfig()
+log = logging.getLogger("UserScalarPropertiesView")
+log.setLevel(GuiParam.DEBUG)
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for the label
+#-------------------------------------------------------------------------------
+
+class LabelDelegate(QItemDelegate):
+ """
+ Use of a QLineEdit in the table.
+ """
+ def __init__(self, parent=None):
+ QItemDelegate.__init__(self, parent)
+ self.parent = parent
+ self.old_plabel = ""
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ self.old_label = ""
+ #editor.installEventFilter(self)
+ rx = "[\-_A-Za-z0-9]{1," + str(LABEL_LENGTH_MAX) + "}"
+ self.regExp = QRegExp(rx)
+ v = RegExpValidator(editor, self.regExp)
+ editor.setValidator(v)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ self.old_plabel = str(value)
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+
+ if editor.validator().state == QValidator.Acceptable:
+ new_plabel = str(editor.text())
+
+ if new_plabel in model.mdl.getScalarLabelsList():
+ default = {}
+ default['label'] = self.old_plabel
+ default['list'] = model.mdl.getScalarLabelsList()
+ default['regexp'] = self.regExp
+ log.debug("setModelData -> default = %s" % default)
+
+ from VerifyExistenceLabelDialogView import VerifyExistenceLabelDialogView
+ dialog = VerifyExistenceLabelDialogView(self.parent, default)
+ if dialog.exec_():
+ result = dialog.get_result()
+ new_plabel = result['label']
+ log.debug("setModelData -> result = %s" % result)
+ else:
+ new_plabel = self.old_plabel
+
+ model.setData(index, QVariant(QString(new_plabel)), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# Combo box delegate for the type of coefficient
+#-------------------------------------------------------------------------------
+
+class TypeDelegate(QItemDelegate):
+ """
+ Use of a combo box in the table.
+ """
+ def __init__(self, parent, stbar):
+ super(TypeDelegate, self).__init__(parent)
+ self.parent = parent
+ self.stbar = stbar
+
+
+ def createEditor(self, parent, option, index):
+ editor = QComboBox(parent)
+ self.modelCombo = ComboModel(editor, 2, 1)
+ self.modelCombo.addItem(self.tr("constant"), 'constant')
+ self.modelCombo.addItem(self.tr("variable"), 'variable')
+ editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, comboBox, index):
+ row = index.row()
+ col = index.column()
+ string = index.model().getData(index)[col]
+ self.modelCombo.setItem(str_model=string)
+
+
+ def setModelData(self, comboBox, model, index):
+ txt = str(comboBox.currentText())
+ value = self.modelCombo.dicoV2M[txt]
+ log.debug("TypeDelegate value = %s"%value)
+ if value == "variable":
+ msg = self.tr("You must complete the user subroutine usphyv")
+ self.stbar.showMessage(msg, 2000)
+
+ selectionModel = self.parent.selectionModel()
+ for idx in selectionModel.selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+
+ def tr(self, text):
+ return text
+
+#-------------------------------------------------------------------------------
+# Line edit delegate for the value
+#-------------------------------------------------------------------------------
+
+class ValueDelegate(QItemDelegate):
+ def __init__(self, parent=None):
+ super(ValueDelegate, self).__init__(parent)
+ self.parent = parent
+
+
+ def createEditor(self, parent, option, index):
+ editor = QLineEdit(parent)
+ v = DoubleValidator(editor, min=0.)
+ editor.setValidator(v)
+ #editor.installEventFilter(self)
+ return editor
+
+
+ def setEditorData(self, editor, index):
+ value = index.model().data(index, Qt.DisplayRole).toString()
+ editor.setText(value)
+
+
+ def setModelData(self, editor, model, index):
+ if not editor.isModified():
+ return
+ if editor.validator().state == QValidator.Acceptable:
+ value, ok = editor.text().toDouble()
+ for idx in self.parent.selectionModel().selectedIndexes():
+ if idx.column() == index.column():
+ model.setData(idx, QVariant(value), Qt.DisplayRole)
+
+#-------------------------------------------------------------------------------
+# StandarItemModel class
+#-------------------------------------------------------------------------------
+
+class StandardItemModelScalars(QStandardItemModel):
+ """
+ """
+ def __init__(self, parent, mdl):
+ """
+ """
+ QStandardItemModel.__init__(self)
+
+ self.headers = [self.tr("Name"),
+ self.tr("Associated\nScalar"),
+ self.tr("Type of\ncoefficient"), # constant/variable
+ self.tr("Type of\nvalue"), # initial/reference value
+ self.tr("Value\n(m2/s)")]
+ self.setColumnCount(len(self.headers))
+
+ self._data = []
+ self.mdl = mdl
+ self.parent = parent
+
+
+ def data(self, index, role):
+ if not index.isValid():
+ return QVariant()
+
+ # Display Fortran message in tips !
+ if role == Qt.DisplayRole:
+ row = index.row()
+ col = index.column()
+ val = self._data[row][col]
+ return QVariant(val)
+ return QVariant()
+
+
+ def flags(self, index):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+ if index.column() in [0, 2, 4]:
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
+ return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
+
+ def headerData(self, section, orientation, role):
+ if orientation == Qt.Horizontal and role == Qt.DisplayRole:
+ return QVariant(self.headers[section])
+ return QVariant()
+
+
+ def setData(self, index, value, role):
+ if not index.isValid():
+ return Qt.ItemIsEnabled
+
+ row = index.row()
+ col = index.column()
+ scalar_label = self._data[row][1]
+
+ # Label
+ if col == 0:
+ new_plabel = str(value.toString())
+ self._data[row][col] = new_plabel
+ self.mdl.setScalarDiffusivityLabel(scalar_label, new_plabel)
+
+ # Coeff. type
+ elif col == 2:
+ typ = str(value.toString())
+ self._data[row][col] = typ
+ if typ == 'constant':
+ self._data[row][3] = self.tr("Reference value")
+ elif typ == 'variable':
+ self._data[row][3] = self.tr("Initial value")
+
+ self.mdl.setScalarDiffusivityChoice(scalar_label, typ)
+ self._subroutineMessage()
+
+ # Value
+ elif col == 4:
+ coeff, ok = value.toDouble()
+ self._data[row][col] = coeff
+ self.mdl.setScalarDiffusivityInitialValue(scalar_label, coeff)
+
+ self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), index, index)
+ return True
+
+
+ def addItem(self, scalar):
+ """
+ Add an item in the table view
+ """
+ coeff_label = self.mdl.getScalarDiffusivityLabel(scalar)
+ coeff_value = self.mdl.getScalarDiffusivityInitialValue(scalar)
+ typC = self.mdl.getScalarDiffusivityChoice(scalar)
+ if typC == "constant":
+ typV = self.tr("Reference value")
+ else:
+ typV = self.tr("Initial value")
+
+ line = [coeff_label, scalar, typC, typV, coeff_value]
+ self._data.append(line)
+
+ row = self.rowCount()
+ self.setRowCount(row+1)
+
+ self._subroutineMessage()
+
+
+ def _subroutineMessage(self):
+ self.parent.labelFortran.hide()
+ for r in range(self.rowCount()):
+ if self._data[r][2] == 'variable':
+ self.parent.labelFortran.show()
+
+
+ def getData(self, index):
+ row = index.row()
+ return self._data[row]
+
+#-------------------------------------------------------------------------------
+# Main class
+#-------------------------------------------------------------------------------
+
+class UserScalarPropertiesView(QWidget, Ui_UserScalarPropertiesForm):
+ """
+ """
+ def __init__(self, parent, case, stbar):
+ """
+ Constructor
+ """
+ QWidget.__init__(self, parent)
+
+ Ui_UserScalarPropertiesForm.__init__(self)
+ self.setupUi(self)
+
+ self.case = case
+ self.stbar = stbar
+
+ self.mdl = DefineUserScalarsModel(self.case)
+
+ # Widget Layout
+
+ self.modelScalars = StandardItemModelScalars(self, self.mdl)
+
+ self.table.setModel(self.modelScalars)
+ self.table.horizontalHeader().setResizeMode(QHeaderView.Stretch)
+
+ delegateLabel = LabelDelegate(self.table)
+ delegateType = TypeDelegate(self.table, self.stbar)
+ delegateValue = ValueDelegate(self.table)
+
+ self.table.setItemDelegateForColumn(0, delegateLabel)
+ self.table.setItemDelegateForColumn(2, delegateType)
+ self.table.setItemDelegateForColumn(4, delegateValue)
+
+ self.connect(self.modelScalars, SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), self.dataChanged)
+
+ # Initialize widgets
+
+ for scalar in self.mdl.getUserScalarLabelsList():
+ if not self.mdl.getScalarVariance(scalar):
+ self.modelScalars.addItem(scalar)
+
+
+ @pyqtSignature("const QModelIndex &, const QModelIndex &")
+ def dataChanged(self, topLeft, bottomRight):
+ for row in range(topLeft.row(), bottomRight.row()+1):
+ self.table.resizeRowToContents(row)
+ for col in range(topLeft.column(), bottomRight.column()+1):
+ self.table.resizeColumnToContents(col)
+
+
+ def tr(self, text):
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/VerifyExistenceLabelDialogForm.ui b/gui/Pages/VerifyExistenceLabelDialogForm.ui
new file mode 100644
index 0000000..04d7a41
--- /dev/null
+++ b/gui/Pages/VerifyExistenceLabelDialogForm.ui
@@ -0,0 +1,91 @@
+<ui version="4.0" >
+ <class>VerifyExistenceLabelDialogForm</class>
+ <widget class="QDialog" name="VerifyExistenceLabelDialogForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>314</width>
+ <height>114</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>This label already exists: choose an another one</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLineEdit" name="lineEdit" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ <property name="centerButtons" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>VerifyExistenceLabelDialogForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>VerifyExistenceLabelDialogForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/Pages/VerifyExistenceLabelDialogView.py b/gui/Pages/VerifyExistenceLabelDialogView.py
new file mode 100644
index 0000000..3a0479a
--- /dev/null
+++ b/gui/Pages/VerifyExistenceLabelDialogView.py
@@ -0,0 +1,118 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from VerifyExistenceLabelDialogForm import Ui_VerifyExistenceLabelDialogForm
+from Base.QtPage import RegExpValidator
+
+#-------------------------------------------------------------------------------
+# Advanced dialog
+#-------------------------------------------------------------------------------
+
+class VerifyExistenceLabelDialogView(QDialog, Ui_VerifyExistenceLabelDialogForm):
+ """
+ Advanced dialog
+ """
+ def __init__(self, parent, default):
+ """
+ Constructor
+ """
+ QDialog.__init__(self, parent)
+
+ Ui_VerifyExistenceLabelDialogForm.__init__(self)
+ self.setupUi(self)
+
+ self.setWindowTitle(self.tr("New label"))
+ self.default = default
+ self.default['list'].remove(self.default['label'])
+ self.result = self.default.copy()
+
+ v = RegExpValidator(self.lineEdit, self.default['regexp'])
+ self.lineEdit.setValidator(v)
+
+ self.connect(self.lineEdit, SIGNAL("textChanged(const QString &)"), self.slotLabel)
+
+
+ @pyqtSignature("const QString &")
+ def slotLabel(self, text):
+ """
+ Get label.
+ """
+ if self.sender().validator().state == QValidator.Acceptable:
+ label = str(text)
+
+ if label in self.default['list']:
+ self.buttonBox.setDisabled(True)
+ else:
+ self.buttonBox.setDisabled(False)
+ self.result['label'] = label
+ else:
+ self.buttonBox.setDisabled(True)
+
+
+ def get_result(self):
+ """
+ Return the result dictionary.
+ """
+ return self.result
+
+
+ def accept(self):
+ """
+ Method called when user clicks 'OK'
+ """
+ QDialog.accept(self)
+
+
+ def reject(self):
+ """
+ Method called when user clicks 'Cancel'
+ """
+ QDialog.reject(self)
+
+
+ def tr(self, text):
+ """
+ Translation
+ """
+ return text
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/WelcomeForm.ui b/gui/Pages/WelcomeForm.ui
new file mode 100644
index 0000000..398a2f7
--- /dev/null
+++ b/gui/Pages/WelcomeForm.ui
@@ -0,0 +1,128 @@
+<ui version="4.0" >
+ <class>WelcomeForm</class>
+ <widget class="QWidget" name="WelcomeForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>450</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Welcome to Code_Saturne GUI</string>
+ </property>
+ <property name="statusTip" >
+ <string>Welcome to Code_Saturne GUI.</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_title" >
+ <property name="text" >
+ <string>Welcome to SaturneGUI </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_image" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="pixmap" >
+ <pixmap resource="resources_pages.qrc" >:/new/prefix1/icons/welcome.gif</pixmap>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources_pages.qrc" />
+ </resources>
+ <connections/>
+</ui>
diff --git a/gui/Pages/WelcomeView.py b/gui/Pages/WelcomeView.py
new file mode 100644
index 0000000..afa5ec3
--- /dev/null
+++ b/gui/Pages/WelcomeView.py
@@ -0,0 +1,64 @@
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This module defines the welcome page.
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+from PyQt4 import QtGui
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+from WelcomeForm import Ui_WelcomeForm
+
+#-------------------------------------------------------------------------------
+# This class defines the welcome page
+#-------------------------------------------------------------------------------
+
+class WelcomeView(QtGui.QWidget, Ui_WelcomeForm):
+ """
+ Class for the welcome page
+ """
+ def __init__(self):
+ """
+ Constructor
+ """
+ QtGui.QWidget.__init__(self)
+ Ui_WelcomeForm.__init__(self)
+ self.setupUi(self)
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/Pages/__init__.py b/gui/Pages/__init__.py
new file mode 100644
index 0000000..7b18410
--- /dev/null
+++ b/gui/Pages/__init__.py
@@ -0,0 +1,45 @@
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This file makes this directory Pages a Python package.
+ =====
+This package contains each Pages writing as an independant module.
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/Pages/icons/22x22/bookmark-new.png b/gui/Pages/icons/22x22/bookmark-new.png
new file mode 100644
index 0000000..3ec0300
Binary files /dev/null and b/gui/Pages/icons/22x22/bookmark-new.png differ
diff --git a/gui/Pages/icons/22x22/document-new.png b/gui/Pages/icons/22x22/document-new.png
new file mode 100644
index 0000000..e3808a1
Binary files /dev/null and b/gui/Pages/icons/22x22/document-new.png differ
diff --git a/gui/Pages/icons/22x22/document-open.png b/gui/Pages/icons/22x22/document-open.png
new file mode 100644
index 0000000..7c4ee79
Binary files /dev/null and b/gui/Pages/icons/22x22/document-open.png differ
diff --git a/gui/Pages/icons/22x22/edit-find-replace.png b/gui/Pages/icons/22x22/edit-find-replace.png
new file mode 100644
index 0000000..de3a75f
Binary files /dev/null and b/gui/Pages/icons/22x22/edit-find-replace.png differ
diff --git a/gui/Pages/icons/22x22/folder-open.png b/gui/Pages/icons/22x22/folder-open.png
new file mode 100644
index 0000000..eaf4be8
Binary files /dev/null and b/gui/Pages/icons/22x22/folder-open.png differ
diff --git a/gui/Pages/icons/22x22/network-server.png b/gui/Pages/icons/22x22/network-server.png
new file mode 100644
index 0000000..a0d7118
Binary files /dev/null and b/gui/Pages/icons/22x22/network-server.png differ
diff --git a/gui/Pages/icons/22x22/preferences-system.png b/gui/Pages/icons/22x22/preferences-system.png
new file mode 100644
index 0000000..cc91d65
Binary files /dev/null and b/gui/Pages/icons/22x22/preferences-system.png differ
diff --git a/gui/Pages/icons/22x22/user-trash-full.png b/gui/Pages/icons/22x22/user-trash-full.png
new file mode 100644
index 0000000..ffd7cc2
Binary files /dev/null and b/gui/Pages/icons/22x22/user-trash-full.png differ
diff --git a/gui/Pages/icons/22x22/weather-few-clouds.png b/gui/Pages/icons/22x22/weather-few-clouds.png
new file mode 100644
index 0000000..28b1147
Binary files /dev/null and b/gui/Pages/icons/22x22/weather-few-clouds.png differ
diff --git a/gui/Pages/icons/32x32/go-next.png b/gui/Pages/icons/32x32/go-next.png
new file mode 100644
index 0000000..a68e2db
Binary files /dev/null and b/gui/Pages/icons/32x32/go-next.png differ
diff --git a/gui/Pages/icons/welcome.gif b/gui/Pages/icons/welcome.gif
new file mode 100644
index 0000000..da15066
Binary files /dev/null and b/gui/Pages/icons/welcome.gif differ
diff --git a/gui/Pages/resources_pages.qrc b/gui/Pages/resources_pages.qrc
new file mode 100644
index 0000000..3ece703
--- /dev/null
+++ b/gui/Pages/resources_pages.qrc
@@ -0,0 +1,15 @@
+<RCC>
+ <qresource prefix="/new/prefix1" >
+ <file>icons/22x22/weather-few-clouds.png</file>
+ <file>icons/22x22/document-new.png</file>
+ <file>icons/22x22/user-trash-full.png</file>
+ <file>icons/22x22/edit-find-replace.png</file>
+ <file>icons/22x22/bookmark-new.png</file>
+ <file>icons/22x22/document-open.png</file>
+ <file>icons/22x22/folder-open.png</file>
+ <file>icons/22x22/network-server.png</file>
+ <file>icons/22x22/preferences-system.png</file>
+ <file>icons/32x32/go-next.png</file>
+ <file>icons/welcome.gif</file>
+ </qresource>
+</RCC>
diff --git a/gui/VERSION b/gui/VERSION
new file mode 100644
index 0000000..dfdc755
--- /dev/null
+++ b/gui/VERSION
@@ -0,0 +1 @@
+2.0.0-beta1
diff --git a/gui/__init__.py b/gui/__init__.py
new file mode 100644
index 0000000..6ee6170
--- /dev/null
+++ b/gui/__init__.py
@@ -0,0 +1,39 @@
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys, os
+
+path = os.path.dirname(os.path.abspath(__file__))
+sys.path.insert(0, path)
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/cs_gui.py b/gui/cs_gui.py
new file mode 100644
index 0000000..a7a6675
--- /dev/null
+++ b/gui/cs_gui.py
@@ -0,0 +1,143 @@
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+Parse command line arguments and launch the GUI.
+"""
+
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import os, sys, string
+
+if not hasattr(sys, 'version_info') or sys.version_info <= (2, 4, 0, 'final'):
+ raise SystemExit, "Graphical users interface of Code_Saturne "\
+ "requires python 2.4 or later."
+
+#-------------------------------------------------------------------------------
+# Third-party modules
+#-------------------------------------------------------------------------------
+
+try:
+ from PyQt4.QtCore import *
+ from PyQt4.QtGui import *
+except ImportError:
+ print "\n Error: Unable to import PyQt4.QtCore or PyQt4.QtGui modules."
+ print " Please check your PyQt4 installation.\n"
+ sys.exit(0)
+
+
+if map(int, string.split(QT_VERSION_STR, ".")) < [4, 3, 0]:
+ raise SystemExit, "Graphical users interface of Code_Saturne "\
+ "requires Qt 4.3 or later (found %s)." % QT_VERSION_STR
+
+
+if map(int, string.split(PYQT_VERSION_STR, ".")) < [4, 3, 0]:
+ raise SystemExit, "Graphical users interface of Code_Saturne "\
+ "requires PyQt 4.3 or later (found %s)." % PYQT_VERSION_STR
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+try:
+ import ncs
+except:
+ pass
+
+from Base.Common import VERSION, icon_base_path
+from Base.CommandLine import usage, process_cmd_line
+from Base.MainView import MainView
+
+#-------------------------------------------------------------------------------
+# Help messages
+#-------------------------------------------------------------------------------
+
+if ('-h' in sys.argv[1:]) or ('--help' in sys.argv[1:]):
+ print usage()
+ sys.exit(0)
+
+
+if ('-v' in sys.argv[1:]) or ('--version' in sys.argv[1:]):
+ print "Graphical users interface of Code_Saturne %s" % VERSION
+ sys.exit(0)
+
+#-------------------------------------------------------------------------------
+# Start point of the Graphical User Interface
+#-------------------------------------------------------------------------------
+
+def main(argv):
+ """
+ Start Qt and a session of the application.
+ """
+ case, spl, matisse, batch_window, batch_file, tree_window, read_only \
+ = process_cmd_line(argv)
+
+ app = QApplication(argv)
+ app.setOrganizationName("EDF R&D")
+ app.setOrganizationDomain("www.code_saturne.org")
+ app.setApplicationName("Code_Saturne GUI")
+ #app.setWindowIcon(QIcon(":/icon.png"))
+ app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
+
+ if spl:
+ app.setOverrideCursor(QCursor(Qt.WaitCursor))
+ pixmap = QPixmap('%s/SplashScreen/logocs.png' % icon_base_path)
+ splash = QSplashScreen(pixmap, Qt.WindowStaysOnTopHint)
+ splash.setMask(pixmap.mask()) # this is usefull if the splashscreen is not a regular ractangle...
+ splash.show()
+ splash.showMessage('GUI %sStarting...' % VERSION,
+ Qt.AlignHCenter | Qt.AlignVCenter, Qt.black)
+ app.processEvents()
+ QTimer.singleShot(1500, splash.hide)
+
+ main = MainView(cmd_case = case,
+ cmd_matisse = matisse,
+ cmd_batch_window = batch_window,
+ cmd_batch_file = batch_file,
+ cmd_tree_window = tree_window,
+ cmd_read_only = read_only)
+
+ try:
+ main.show()
+ if spl:
+ app.processEvents()
+ app.restoreOverrideCursor()
+ except:
+ print "\n Unable to display a Qt window."
+ print " Please check your display environment.\n"
+ sys.exit(0)
+
+ sys.exit(app.exec_())
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/gui/epydocConfig b/gui/epydocConfig
new file mode 100644
index 0000000..185840c
--- /dev/null
+++ b/gui/epydocConfig
@@ -0,0 +1,42 @@
+[epydoc] # Epydoc section marker (required by ConfigParser)
+
+# Information about the project.
+name: Code_Saturne GUI
+url: http://www.code-saturne.org
+
+# The list of modules to document. Modules can be named using
+# dotted names, module filenames, or package directory names.
+# This option may be repeated.
+modules: cs_gui
+modules: Base
+modules: Pages
+
+# The type of output that should be generated. Should be one
+# of: html, text, latex, dvi, ps, pdf.
+output: html
+
+# The path to the output directory. May be relative or absolute.
+target: doc/
+
+# An integer indicating how verbose epydoc should be. The default
+# value is 0; negative values will supress warnings and errors;
+# positive values will give more verbose output.
+verbosity: 0
+
+# Whether or not to inclue private variables. (Even if included,
+# private variables will be hidden by default.)
+private: no
+
+# Whether or not to list each module's imports.
+imports: no
+
+# Whether or not to include syntax highlighted source code in
+# the output (HTML only).
+sourcecode: yes
+
+
+# Include all automatically generated graphs. These graphs are
+# generated using Graphviz dot.
+graph: all
+dotpath: dot
+
diff --git a/gui/sbin/mkpyqt.py b/gui/sbin/mkpyqt.py
new file mode 100755
index 0000000..e03df07
--- /dev/null
+++ b/gui/sbin/mkpyqt.py
@@ -0,0 +1,270 @@
+#!/usr/bin/env python
+# Copyright (c) 2007-9 Qtrac Ltd. All rights reserved.
+# This program or module 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
+# version 3 of the License, or (at your option) any later version. It is
+# provided for educational purposes and 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.
+
+import os
+import platform
+import stat
+import sys
+import PyQt4.QtCore
+
+__version__ = "1.0.3"
+
+if sys.platform.startswith("win"):
+ PATH = os.path.join(os.path.dirname(sys.executable),
+ "Lib/site-packages/PyQt4")
+else:
+ app = PyQt4.QtCore.QCoreApplication([])
+ PATH = unicode(app.applicationDirPath())
+ del app
+if sys.platform.startswith("darwin"):
+ i = PATH.find("Resources")
+ if i > -1:
+ PATH = PATH[:i] + "bin"
+PYUIC4 = os.path.join(PATH, "pyuic4") # e.g. PYUIC4 = "/usr/bin/pyuic4"
+if sys.platform.startswith("darwin"):
+ PYUIC4 = os.path.dirname(sys.executable)
+ i = PYUIC4.find("Resources")
+ if i > -1:
+ PYUIC4 = PYUIC4[:i] + "Lib/python2.5/site-packages/PyQt4/uic/pyuic.py"
+PYRCC4 = os.path.join(PATH, "pyrcc4")
+PYLUPDATE4 = os.path.join(PATH, "pylupdate4")
+LRELEASE = "lrelease"
+if platform.system() == "Windows":
+ PYUIC4 = PYUIC4.replace("/", "\\") + ".bat"
+ PYRCC4 = PYRCC4.replace("/", "\\") + ".exe"
+ PYLUPDATE4 = PYLUPDATE4.replace("/", "\\") + ".exe"
+
+msg = []
+if not os.access(PYUIC4, os.F_OK):
+ msg.append("failed to find pyuic4; tried %s" % PYUIC4)
+if not os.access(PYRCC4, os.F_OK):
+ msg.append("failed to find pyrcc4; tried %s" % PYRCC4)
+if not os.access(PYLUPDATE4, os.F_OK):
+ msg.append("failed to find pylupdate4; tried %s" % PYLUPDATE4)
+if msg:
+ print "\n".join(msg)
+ print "try manually editing this program to put the correct " + \
+ "paths in place"
+ sys.exit()
+
+Debug = False
+Verbose = False
+
+def usage():
+ print """usage: mkpyqt.py [options] [path]
+
+Options (which can be given in any of the forms shown):
+-b --build build [default]
+-c --clean clean
+-f --force force
+-t --translate translate
+-r --recurse recurse
+-v --verbose verbose
+-D --debug debug
+path defaults to .
+
+If executed with no arguments (or with a build argument) it does a
+build, i.e., it looks for all *.ui and *.qrc files and makes sure that
+the corresponding ui_*.py and qrc_*.py files exist and are up-to-date.
+
+If executed with clean, deletes all ui_*.py and qrc_*.py files that have
+corresponding *.ui and *.qrc files, and all *.pyc and *.pyo files.
+
+If executed with force, it does a clean followed by a build.
+
+If building and the translate option is given, after building, it runs
+pylupdate4 on all .py and .pyw files it encounters, and then runs lrelease
+on all .ts files it encounters. It does not use a .pro file so the .ts
+files must be created in the first place, e.g., using pylupdate4 on one
+of the source files and using its -ts option.
+
+WARNING: Do not give any hand-coded files names that match ui_*.py or
+qrc_*.py since these will be deleted by mkpyqt.py clean!
+
+NOTE: If any tool fails to run, e.g., pyuic4, then edit this program and
+hard-code the path; the variables with the tool paths are near the top
+of the file.
+
+mkpyqt.py v %s. Copyright (c) 2007-9 Qtrac Ltd. All rights reserved.
+""" % __version__
+ sys.exit()
+
+
+def report_failure(command, args, process):
+ msg = ""
+ ba = process.readAllStandardError()
+ if not ba.isEmpty():
+ msg = ": " + str(QString(ba))
+ print "failed", command, " ".join(args), msg
+
+
+def build(path):
+ for name in os.listdir(path):
+ source = os.path.join(path, name)
+ target = None
+ if source.endswith(".ui"):
+ target = os.path.join(path,
+ name.replace(".ui", ".py"))
+# "ui_" + name.replace(".ui", ".py"))
+ command = PYUIC4
+ elif source.endswith(".qrc"):
+ target = os.path.join(path,
+ name.replace(".qrc", "_rc.py"))
+# "qrc_" + name.replace(".qrc", ".py"))
+ command = PYRCC4
+ process = PyQt4.QtCore.QProcess()
+ if target is not None:
+ if not os.access(target, os.F_OK) or (
+ os.stat(source)[stat.ST_MTIME] > \
+ os.stat(target)[stat.ST_MTIME]):
+ args = ["-o", target, source]
+ if sys.platform.startswith("darwin") and command == PYUIC4:
+ command = sys.executable
+ args = [PYUIC4] + args
+ if Debug:
+ print "# %s %s" % (command, " ".join(args))
+ else:
+ process.start(command, args)
+ if not process.waitForFinished(2 * 60 * 1000):
+ report_failure(command, args, process)
+ else:
+ print source, "->", target
+ elif Verbose:
+ print source, "is up-to-date"
+
+
+def clean(path):
+ deletelist = []
+ for name in os.listdir(path):
+ target = os.path.join(path, name)
+ source = None
+ if target.endswith(".py") or target.endswith(".pyc") or \
+ target.endswith(".pyo"):
+ #if name.startswith("ui_") and not name[-1] in "oc":
+ if name.endswith("Form.py") and not name[-1] in "oc":
+ #source = os.path.join(path, name[3:-3] + ".ui")
+ source = os.path.join(path, name[:-3] + ".ui")
+ #elif name.startswith("qrc_"):
+ elif name.endswith("_rc.py"):
+ if target[-1] in "oc":
+ #source = os.path.join(path, name[4:-4] + ".qrc")
+ source = os.path.join(path, name[:-7] + ".qrc")
+ else:
+ #source = os.path.join(path, name[4:-3] + ".qrc")
+ source = os.path.join(path, name[:-6] + ".qrc")
+ elif target[-1] in "oc":
+ source = target[:-1]
+ if source is not None:
+ if os.access(source, os.F_OK):
+ if Debug:
+ print "# delete ", target
+ else:
+ deletelist.append(target)
+ else:
+ print "will not remove '%s' since `%s' not found" % (
+ target, source)
+ if not Debug:
+ for target in deletelist:
+ if Verbose:
+ print "deleted", target
+ os.remove(target)
+
+
+def translate(path):
+ files = []
+ tsfiles = []
+ for name in os.listdir(path):
+ if name.endswith((".py", ".pyw")):
+ files.append(os.path.join(path, name))
+ elif name.endswith(".ts"):
+ tsfiles.append(os.path.join(path, name))
+ if not tsfiles:
+ return
+ #verbose = "-verbose" if Verbose else ""
+ if Verbose:
+ verbose = "-verbose"
+ else:
+ verbose = ""
+ #silent = "-silent" if not Verbose else ""
+ if not Verbose:
+ silent = "-silent"
+ else:
+ silent = ""
+ process = PyQt4.QtCore.QProcess()
+ for ts in tsfiles:
+ qm = ts[:-3] + ".qm"
+ command1 = PYLUPDATE4
+ args1 = [verbose] + files + ["-ts", ts]
+ command2 = LRELEASE
+ args2 = [silent, ts, "-qm", qm]
+ if Debug:
+ print "updated", ts
+ print "generated", qm
+ else:
+ process.start(command1, args1)
+ if not process.waitForFinished(2 * 60 * 1000):
+ report_failure(command1, args1, process)
+ process.start(command2, args2)
+ if not process.waitForFinished(2 * 60 * 1000):
+ report_failure(command2, args2, process)
+
+
+def apply(recurse, function, path):
+ if not recurse:
+ function(path)
+ else:
+ for root, dirs, files in os.walk(path):
+ for dir in dirs:
+ function(os.path.join(root, dir))
+
+
+def main():
+ global Debug, Verbose
+ function = build
+ recurse = False
+ trans = False
+ force = False
+ path = "."
+ args = sys.argv[1:]
+ while args:
+ arg = args.pop(0)
+ if arg in ("-D", "--debug", "debug"):
+ Debug = True
+ elif arg in ("-b", "--build", "build"):
+ pass # This is the default
+ elif arg in ("-c", "--clean", "clean"):
+ function = clean
+ elif arg in ("-f", "--force", "force"):
+ force = True
+ elif arg in ("-t", "--translate", "translate"):
+ trans = True
+ elif arg in ("-r", "--recurse", "recurse"):
+ recurse = True
+ elif arg in ("-v", "--verbose", "verbose"):
+ Verbose = True
+ elif arg in ("-h", "--help", "help"):
+ usage()
+ else:
+ path = arg
+ if not force:
+ apply(recurse, function, path)
+ else:
+ apply(recurse, clean, path)
+ apply(recurse, build, path)
+ if trans and (function == build or force):
+ apply(recurse, translate, path)
+
+main()
+
+# 1.0.1 Fixed bug reported by Brian Downing where paths that contained
+# spaces were not handled correctly.
+# 1.0.2 Changed default path on Windows to match PyQt 4.4
+# 1.0.3 Tried to make the paths work on Mac OS X
diff --git a/gui/sbin/unittests.py b/gui/sbin/unittests.py
new file mode 100755
index 0000000..725f4d7
--- /dev/null
+++ b/gui/sbin/unittests.py
@@ -0,0 +1,279 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+#
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+#
+#-------------------------------------------------------------------------------
+# Library modules import
+#-------------------------------------------------------------------------------
+
+import sys
+
+#-------------------------------------------------------------------------------
+# Application modules import
+#-------------------------------------------------------------------------------
+
+
+#-------------------------------------------------------------------------------
+# Tests suite
+#-------------------------------------------------------------------------------
+
+
+def starttest1():
+ from Base.XMLengine import runTest
+ runTest()
+
+def starttest2():
+ from Base.XMLvariables import runTest
+ runTest()
+
+def starttest3():
+ from Base.XMLmodel import runTest
+ runTest()
+
+def starttest4():
+ from Pages.IdentityAndPathesModel import runTest
+ runTest()
+
+def starttest5():
+ from Pages.SolutionDomainModel import runTest
+ runTest()
+
+def starttest8():
+ from Pages.MobileMeshModel import runTest
+ runTest()
+
+def starttest9():
+ from Pages.TurbulenceModel import runTest
+ runTest()
+
+def starttest10():
+ from Pages.CoalCombustionModel import runTest
+ runTest()
+
+def starttest11():
+ from Pages.CurrentSpeciesModel import runTest
+ runTest()
+
+def starttest12():
+ from Pages.ThermalScalarModel import runTest
+ runTest()
+
+def starttest13():
+ from Pages.ThermalRadiationModel import runTest
+ runTest()
+
+def starttest14():
+ from Pages.InitializationModel import runTest
+ runTest()
+
+def starttest15():
+ from Pages.ReferenceValuesModel import runTest
+ runTest()
+
+def starttest16():
+ from Pages.FluidCharacteristicsModel import runTest
+ runTest()
+
+def starttest17():
+ from Pages.BodyForcesModel import runTest
+ runTest()
+
+def starttest18():
+ from Pages.DefineUserScalarsModel import runTest
+ runTest()
+
+def starttest19():
+ from Pages.Boundary import runTest, runTest2, runTest3, runTest4, runTest5
+ from Pages.Boundary import runTest6, runTest7
+ runTest()
+ runTest2()
+ runTest3()
+ runTest4()
+ runTest5()
+ runTest6()
+ runTest7()
+
+def starttest23():
+ from Pages.TimeAveragesModel import runTest
+ runTest()
+
+def starttest24():
+ from Pages.SteadyManagementModel import runTest
+ runTest()
+
+def starttest25():
+ from Pages.TimeStepModel import runTest
+ from Pages.TimeStepModel import runTest2
+ runTest()
+ runTest2()
+
+def starttest26():
+ from Pages.OutputControlModel import runTest
+ runTest()
+
+def starttest27():
+ from Pages.OutputVolumicVariablesModel import runTest
+ runTest()
+
+def starttest28():
+ from Pages.OutputSurfacicVariablesModel import runTest
+ runTest()
+
+def starttest29():
+ from Pages.ProfilesModel import runTest
+ runTest()
+
+def starttest30():
+ from Pages.NumericalParamEquationModel import runTest
+ runTest()
+
+def starttest31():
+ from Pages.NumericalParamGlobalModel import runTest
+ runTest()
+
+def starttest32():
+ from Pages.UserArraysModel import runTest
+ runTest()
+
+def starttest33():
+ from Pages.StartRestartModel import runTest
+ runTest()
+
+def starttest34():
+ from Pages.BatchRunningModel import runTest
+ runTest()
+
+def starttest35():
+ from Pages.LagrangianModel import runTest
+ runTest()
+
+def starttest36():
+ from Pages.ElectricalModelsModel import runTest
+ runTest()
+
+def starttest37():
+ from Pages.GasCombustionModel import runTest
+ runTest()
+
+def starttest38():
+ from Pages.MatisseModel import runTest
+ runTest()
+
+def starttest39():
+ from Pages.MatisseGeomModel import runTest
+ runTest()
+
+def starttest40():
+ from Pages.MatisseHydrauModel import runTest
+ runTest()
+
+def starttest41():
+ from Pages.MatisseNetworkModel import runTest
+ runTest()
+
+def starttest42():
+ from Pages.MatisseRangeDescriptionModel import runTest
+ runTest()
+
+def starttest43():
+ from Pages.MatisseThermicModel import runTest
+ runTest()
+
+def starttest44():
+ from Pages.MatisseTypeModel import runTest
+ runTest()
+
+def starttest45():
+ from Pages.LocalizationModel import runTest
+ runTest()
+
+def starttest46():
+ from Pages.HeadLossesModel import runTest
+ runTest()
+
+def starttest47():
+ from Pages.FluidStructureInteractionModel import runTest
+ runTest()
+
+def starttest48():
+ from Pages.AtmosphericFlowsModel import runTest
+ runTest()
+
+if __name__ == '__main__':
+
+ print 'DEBUT DES TESTS'
+ #sys.exit(0)
+ starttest1()
+ starttest2()
+ starttest3()
+ starttest4()
+ starttest5()
+ starttest8()
+ starttest9()
+ starttest10()
+ starttest11()
+ starttest12()
+ starttest13()
+ starttest14()
+ starttest15()
+ starttest16()
+ starttest17()
+ starttest18()
+ starttest19()
+ starttest23()
+ starttest24()
+ starttest25()
+ starttest26()
+ starttest27()
+ starttest28()
+ starttest29()
+ starttest30()
+ starttest31()
+ starttest32()
+ starttest33()
+ starttest34()
+ starttest35()
+ #starttest36()
+ #starttest37()
+ #starttest38()
+ #starttest39()
+ #starttest40()
+ #starttest41()
+ #starttest42()
+ #starttest43()
+ #starttest44()
+ starttest45()
+## starttest46()
+ starttest47()
+ starttest48()
+
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gui/setup.py b/gui/setup.py
new file mode 100644
index 0000000..ae2dcb6
--- /dev/null
+++ b/gui/setup.py
@@ -0,0 +1,115 @@
+#-------------------------------------------------------------------------------
+#
+# This file is part of the Code_Saturne User Interface, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 1998-2009 EDF S.A., France
+#
+# contact: saturne-support at edf.fr
+#
+# The Code_Saturne User Interface 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.
+#
+# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+#-------------------------------------------------------------------------------
+
+"""
+This is the cs_gui setup.py script.
+
+1) for installation:
+python setup.py build
+python setup.py install
+python setup.py install --prefix MY_INSTALL_PATH
+python setup.py install --prefix=MY_INSTALL_PATH
+
+2) for distribution:
+python setup.py bdist --format=wininst
+python setup.py bdist --format=rpm
+python setup.py sdist
+python setup.py sdist --formats=gztar,zip
+python setup.py bdist_rpm
+python setup.py bdist_wininst
+
+3) for more options:
+python setup.py --help
+python setup.py bdist --help-formats
+"""
+
+#-------------------------------------------------------------------------------
+# Check versions
+#-------------------------------------------------------------------------------
+
+import sys, string, os
+
+if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'):
+ raise SystemExit, "Graphical users interface of Code_Saturne "\
+ "requires python 2.4 or later."
+try:
+ from PyQt4.QtCore import *
+ from PyQt4.QtGui import *
+except ImportError:
+ print "\n Error: Unable to import PyQt4.QtCore or PyQt4.QtGui modules."
+ print " Please check your PyQt4 installation.\n"
+ sys.exit(0)
+
+
+if map(int, string.split(QT_VERSION_STR, ".")) < [4, 3, 0]:
+ raise SystemExit, "Graphical users interface of Code_Saturne "\
+ "requires Qt 4.3 or later (found %s)." % QT_VERSION_STR
+
+
+if map(int, string.split(PYQT_VERSION_STR, ".")) < [4, 3, 0]:
+ raise SystemExit, "Graphical users interface of Code_Saturne "\
+ "requires PyQt 4.3 or later (found %s)." % PYQT_VERSION_STR
+
+#-------------------------------------------------------------------------------
+# Distribution or installation
+#-------------------------------------------------------------------------------
+
+from Base.Common import VERSION
+from distutils.core import setup
+from distutils.sysconfig import get_python_lib
+
+install_dir = os.path.join(get_python_lib(), 'ncs')
+
+for arg in sys.argv[1:]:
+ if arg.startswith("--prefix="):
+ install_dir = os.path.join(get_python_lib(prefix=arg[9:]), 'ncs')
+ break
+
+for i in range(len(sys.argv)):
+ if sys.argv[i].startswith("--prefix") and not sys.argv[i].startswith("--prefix="):
+ install_dir = os.path.join(get_python_lib(prefix=sys.argv[i+1]), 'ncs')
+ break
+
+setup(name='cs_gui',
+ version=VERSION,
+ url='www.code-saturne.org',
+ description='Graphical user interface of Code_Saturne CFD code',
+ license='GNU GPL',
+ maintainer='Code_Saturne team',
+ maintainer_email='saturne-support at edf.fr',
+ scripts=['cs_gui'],
+ package_dir={ 'ncs' : '.', 'ncs.Base' : 'Base', 'ncs.Pages' : 'Pages'},
+ packages=['ncs', 'ncs.Base', 'ncs.Pages'],
+ data_files=[(install_dir,
+ ["AUTHORS", "COPYING", "VERSION"]),
+ (os.path.join(install_dir, "Base", "icons", "SplashScreen"),
+ [os.path.join("Base", "icons", "SplashScreen", "logocs.png")])]
+ )
+
+#-------------------------------------------------------------------------------
+# End
+#-------------------------------------------------------------------------------
diff --git a/include/atmo/atincl.h b/include/atmo/atincl.h
new file mode 100644
index 0000000..bb9335f
--- /dev/null
+++ b/include/atmo/atincl.h
@@ -0,0 +1,155 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! atincl.h
+
+!===============================================================================
+
+! INCLUDE FOR THE ATMOSPHERIC MODULE SPECIFIC PHYSICS
+
+!-------------------------------------------------------------------------------
+
+! 1. Pointers specific to the atmospheric physics
+
+! 1.1 Pointers specific to the input meteo profile (in ra)
+!-------------------------------------------------------------------------------
+! /IPROM/
+! Pointers specific to values read in the input meteo file:
+! ITMMET ---> time (in sec) of the meteo profile
+! IZDMET ---> altitudes of the dynamic profiles
+! IZTMET ---> altitudes of the temperature profile
+! IUMET, IVMET, IWMET --> meteo u, v, w profiles
+! IEKMET ---> meteo turbulent kinetic energy profile
+! IEPMET ---> meteo turbulent dissipation profile
+! ITTMET ---> meteo temperature (Celsius) profile
+! IQVMET ---> meteo specific humidity profile
+! IPMER ---> Sea level pressure
+! IXMET, IYMET --> cooordinates of the meteo profile
+
+! Pointers specific to values calculated from the meteo file
+! (cf atlecm.f90):
+! IRMET --> density profile
+! ITPMET --> potential temperature profile
+! IPHMET --> hydro. pressure from Laplace integration
+
+integer itmmet, &
+ izdmet, &
+ iztmet, &
+ iumet, &
+ ivmet, &
+ iwmet, &
+ iekmet, &
+ iepmet, &
+ ittmet, &
+ iqvmet, &
+ ipmer, &
+ ixmet, &
+ iymet, &
+ irmet, &
+ itpmet, &
+ iphmet
+
+common /iprom/ itmmet, &
+ izdmet, &
+ iztmet, &
+ iumet, &
+ ivmet, &
+ iwmet, &
+ iekmet, &
+ iepmet, &
+ ittmet, &
+ iqvmet, &
+ ipmer, &
+ ixmet, &
+ iymet, &
+ irmet, &
+ itpmet, &
+ iphmet
+
+! 1.2 Pointers for the positions of the variables (in rtp, rtpa)
+!-------------------------------------------------------------------------------
+
+! /IATVAR/
+! Variables specific to the atmospheric physics:
+! IPPMOD(IATMOS) = 1 (Dry atmosphere):
+! ITEMPP---> potential temperature
+! IPPMOD(IATMOS) = 2 (Humid atmosphere):
+! ITEMPL---> liquid potential temperature
+! ITOTWT---> total water content
+! INTDRP---> total number of droplets
+
+integer itempp, itempl, itotwt, intdrp
+
+common /iatvar/ itempp, itempl, itotwt, intdrp
+
+! 1.3 Pointers for the positions of the properties for the specific phys.
+! (ipproc in propce, propfa, propfb)
+!-------------------------------------------------------------------------------
+
+! /IATPRO/
+! Properties specific to the atmospheric physics:
+! IPPMOD(IATMOS) = 1 or 2 (Dry or Humid atmosphere):
+! ITEMPC---> temperature (in celsius)
+! IPPMOD(IATMOS) = 2 (Humid atmosphere):
+! ILIQWT---> liquid water content
+
+integer itempc,iliqwt
+
+common /iatpro/ itempc,iliqwt
+
+
+!-------------------------------------------------------------------------------
+
+! 2. Data specific to the atmospheric physics
+
+! 2.1 Constant specific
+!-------------------------------------------------------------------------------
+! /ATMCST/ RAIR --> perfect gaz constant for air (mixture)
+! defined in atini1
+
+ double precision rair
+ common /atmcst/ rair
+
+! 2.2 Data specific to the input meteo profile
+!-------------------------------------------------------------------------------
+! /PROMET/
+! IMETEO --> flag for reading the meteo input file
+! = 0 -> no reading
+! = 1 -> reading
+! NBMETD --> numbers of altitudes for the dynamics
+! NBMETT --> numbers of altitudes for the temperature
+! and specific humidity
+! NBMETM --> numbers of time steps for the meteo profiles
+! IPROFM --> read zone boundary conditions from profile
+
+ integer imeteo, nbmetd, nbmett, nbmetm, &
+ iprofm(nozppm)
+
+ common / iimet / imeteo, nbmetd, nbmett,nbmetm, iprofm
diff --git a/include/base/alaste.h b/include/base/alaste.h
new file mode 100644
index 0000000..b7efc1a
--- /dev/null
+++ b/include/base/alaste.h
@@ -0,0 +1,54 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! alaste.h
+!===============================================================================
+
+! METHODE ALE - MOUVEMENT DE STRUCTURES EN COUPLAGE AVEC CODE_ASTER
+
+! NTCAST : NUMERO D'ITERATION DE COUPLAGE AVEC CODE_ASTER
+! NBASTE : NOMBRE DE STRUCTURES MOBILES
+! NBFAST : NOMBRE DE FACES COUPLEES
+! NBNAST : NOMBRE DE NOEUDS COUPLES
+! ISYNCP : INDICATEUR D'IMPRESSION DES RESULTATS DES DEUX CODES
+! AUX MEMES INSTANTS (SORTIE ENSIGHT POUR ASTER)
+! ASDDLF : BLOCAGE DES DDL DE FORCE
+! ASDDLC : BLOCAGE DES DDL CINEMATIQUES
+
+integer ntcast
+integer nbaste, nbfast, nbnast
+integer iforas
+integer isyncp
+integer asddlf(3,nastmx), asddlc(3,nastmx)
+
+common / iaster / ntcast, nbaste, nbfast, nbnast, &
+ iforas, &
+ isyncp, &
+ asddlf, asddlc
+
+! FIN
+
diff --git a/include/base/albase.h b/include/base/albase.h
new file mode 100644
index 0000000..b363a10
--- /dev/null
+++ b/include/base/albase.h
@@ -0,0 +1,59 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! albase.h
+!===============================================================================
+
+! METHODE ALE
+! IALE : UTILISATION DE LA METHODE ALE
+! = 0 SANS METHODE ALE
+! = 1 AVEC METHODE ALE
+! IIMPAL : POINTEUR SUR IMPALE, INDICATEUR DE DEPLACEMENT IMPOSE
+! IXYZN0 : POINTEUR SUR XYZNO0, POSITION INITIALE DU MAILLAGE
+! IDEPAL : POINTEUR SUR DEPALE, DEPLACEMENT DU MAILLAGE
+! IIALTY : POINTEUR SUR IALTYB, TYPE DE BORD
+! NALINF : NOMBRE D'ITERATIONS D'INITIALISATION DU FLUIDE
+! NALIMX : NOMBRE MAXIMAL D'ITERATIONS D'IMPLICITATION DU DEPLACEMENT
+! DES STRUCTURES
+! IORTVM : TYPE DE VISCOSITE DE MAILLAGE
+! = 0 ISOTROPE
+! = 1 ORTHOTROPE
+! EPALIM : PRECISION RELATIVE D'IMPLICITATION DU DEPLACEMENT DES
+! STRUCTURES
+! ITALIN : ITERATION D'INITIALISATION DE l'ALE
+! = 0 NON
+! = 1 OUI
+
+integer iale , iimpal, ixyzn0, idepal, iialty, nalinf
+integer nalimx, iortvm, italin
+common / icmale / iale , iimpal, ixyzn0, idepal, iialty, nalinf, &
+ nalimx, iortvm, italin
+
+double precision epalim
+common / rcmale / epalim
+! FIN
+
diff --git a/include/base/alstru.h b/include/base/alstru.h
new file mode 100644
index 0000000..4249b9c
--- /dev/null
+++ b/include/base/alstru.h
@@ -0,0 +1,87 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! alstru.h
+!===============================================================================
+
+! METHODE ALE - MOUVEMENT DE STRUCTURES EN COUPLAGE INTERNE
+
+! NBSTRU : NOMBRE DE STRUCTURES MOBILES
+
+! XMSTRU : MATRICE DE MASSE DES STRUCTURES (kg)
+! XCSTRU : MATRICE DE FRICTION DES STRUCTURES (kg/s)
+! XKSTRU : MATRICE DE RAIDEUR DES STRUCTURES (kg/s2 = N/m)
+! XSTREQ : VECTEUR ECART DE LA POSITION DES STRUCTURE DANS LE MAILLAGE
+! INITIAL PAR RAPPORT A LEUR POSITION D'EQUILIBRE (m)
+! XSTR : VECTEUR DEPLACEMENT DES STRUCTURES PAR RAPPORT A LEUR POSITION
+! DANS LE MAILLAGE INITIAL (m)
+! XPSTR : VECTEUR VITESSE DES STRUCTURES (m/s)
+! XPPSTR : VECTEUR ACCELERATION DES STRUCTURES (m/s2)
+! FORSTR : VECTEUR FORCE EXERCE SUR LES STRUCTURES (N)
+! XSTA : VALEUR DE XSTR AU PAS DE TEMPS PRECEDENT
+! XPSTA : VALEUR DE XPSTR AU PAS DE TEMPS PRECEDENT
+! XPPSTA : VALEUR DE XPPSTR AU PAS DE TEMPS PRECEDENT
+! FORSTA : VALEUR DE FORSTR AU PAS DE TEMPS PRECEDENT
+! XSTP : VALEUR PREDITE DE XSTR
+! FORSTP : VALEUR PREDITE DE FORSTR
+! DTSTR : PAS DE TEMPS ASSOCIE AU MOUVEMENT DES STRUCTURES
+! AEXXST : COEFFICIENT DE PREDICTION DU DEPLACEMENT (SUR XPSTR)
+! BEXXST : COEFFICIENT DE PREDICTION DU DEPLACEMENT (SUR XPSTR-XPSTA)
+! CFOPRE : COEFFICIENT DE PREDICTION DES EFFORTS
+
+
+integer nbstru
+
+common / istruc / nbstru
+
+double precision xmstru(3,3,nstrmx)
+double precision xcstru(3,3,nstrmx)
+double precision xkstru(3,3,nstrmx)
+double precision xstr(3,nstrmx) ,xsta(3,nstrmx)
+double precision xstp(3,nstrmx) ,xstreq(3,nstrmx)
+double precision xpstr(3,nstrmx) ,xpsta(3,nstrmx)
+double precision xppstr(3,nstrmx),xppsta(3,nstrmx)
+double precision forstr(3,nstrmx),forsta(3,nstrmx)
+double precision forstp(3,nstrmx)
+double precision dtstr(nstrmx)
+double precision aexxst, bexxst, cfopre
+
+common / rstruc / xmstru, xcstru, xkstru, xstr , xsta , xstp, &
+ xstreq, xpstr , xpsta , xppstr, xppsta, &
+ forstr, forsta, forstp, dtstr, &
+ aexxst, bexxst, cfopre
+
+! METHODE DE NEWMARK HHT
+
+! ALPNMK : COEFFICIENT ALPHA DE LA METHODE DE NEWMARK HHT
+! BETNMK : COEFFICIENT BETA DE LA METHODE DE NEWMARK HHT
+! GAMNMK : COEFFICIENT GAMMA DE LA METHODE DE NEWMARK HHT
+double precision alpnmk, gamnmk, betnmk
+common / rnemrk / alpnmk, gamnmk, betnmk
+
+! FIN
+
diff --git a/include/base/cplsat.h b/include/base/cplsat.h
new file mode 100644
index 0000000..2c59a9e
--- /dev/null
+++ b/include/base/cplsat.h
@@ -0,0 +1,53 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! cplsat.h
+!===============================================================================
+
+! COUPLAGE CODE / CODE - GESTION DES PARAMETRES PRINCIPAUX
+
+! NBRCPL : NOMBRE DE COUPLAGE CODE_SATURNE / CODE_SATURNE
+
+integer nbrcpl
+
+common / icplcs / nbrcpl
+
+! NBCPMX : NOMBRE DE COUPLAGE MAX ADMISSIBLE
+
+integer nbcpmx
+parameter(nbcpmx=10)
+
+! ITURCP(NBCPMX,NPHSMX) : MODELE DE TURBULENCE DE L'INSTANCE DISTANTE
+! IMAJCP(NBCPMX) : INDICE DE MISE A JOUR DE LA LOCALISATION DU COUPLAGE
+! NVARCP(NBCPMX) : NOMBRE DE VARIABLE A ENVOYER/RECEVOIR
+! NVARTO(NBCPMX) : TAILLE DES TABLEAUX D'ECHANGE
+
+
+integer iturcp(nbcpmx,nphsmx), imajcp(nbcpmx)
+integer nvarcp(nbcpmx), nvarto(nbcpmx)
+common / icplcs / iturcp, imajcp, nvarcp, nvarto
+
diff --git a/include/base/cs_ale.h b/include/base/cs_ale.h
new file mode 100644
index 0000000..a30c6d3
--- /dev/null
+++ b/include/base/cs_ale.h
@@ -0,0 +1,129 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_ALE_H__
+#define __CS_ALE_H__
+
+/*============================================================================
+ * Functions associated to ALE formulation
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute cell and face centre of gravity, cell volume.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE ALGRMA
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (algrma, ALGRMA)(void);
+
+/*----------------------------------------------------------------------------
+ * Projection on mesh vertices of the displacement (computed on cell center)
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE ALDEPL
+ * *****************
+ *
+ * INTEGER IFACEL(2,NFAC) : --> : Interior faces -> cells connectivity
+ * INTEGER IFABOR(NFABOR) : --> : Border faces -> cells connectivity
+ * INTEGER IPNFAC(NFAC+1) : --> : Interior faces -> vertices index
+ * INTEGER NODFAC(LNDFAC) : --> : Interior faces -> vertices list
+ * INTEGER IPNFBR(NFABOR+1): --> : Border faces -> vertices index
+ * INTEGER NODFBR(LNDFBR) : --> : Border faces -> vertices list
+ * DOUBLE PRECISION UMA(NCELET) : --> : Mesh velocity along X
+ * DOUBLE PRECISION VMA(NCELET) : --> : Mesh velocity along Y
+ * DOUBLE PRECISION WMA(NCELET) : --> : Mesh velocity along Z
+ * DOUBLE PRECISION COEFAU(NCELET) : --> : Boundary condition A for UMA
+ * DOUBLE PRECISION COEFAV(NCELET) : --> : Boundary condition A pour VMA
+ * DOUBLE PRECISION COEFAW(NCELET) : --> : Boundary condition A pour WMA
+ * DOUBLE PRECISION COEFBU(NCELET) : --> : Boundary condition B pour UMA
+ * DOUBLE PRECISION COEFBV(NCELET) : --> : Boundary condition B pour VMA
+ * DOUBLE PRECISION COEFBW(NCELET) : --> : Boundary condition B pour WMA
+ * DOUBLE PRECISION DT(NCELET) : --> : Time step
+ * DOUBLE PRECISION DEPROJ(NNOD,3)): <-- : Displacement projected on vertices
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (aldepl, ALDEPL)(const cs_int_t i_face_cells[],
+ const cs_int_t b_face_cells[],
+ const cs_int_t i_face_vtx_idx[],
+ const cs_int_t i_face_vtx_lst[],
+ const cs_int_t b_face_vtx_idx[],
+ const cs_int_t b_face_vtx_lst[],
+ cs_real_t *uma,
+ cs_real_t *vma,
+ cs_real_t *wma,
+ cs_real_t *coefau,
+ cs_real_t *coefav,
+ cs_real_t *coefaw,
+ cs_real_t *coefbu,
+ cs_real_t *coefbv,
+ cs_real_t *coefbw,
+ cs_real_t *dt,
+ cs_real_t *disp_proj);
+
+/*----------------------------------------------------------------------------
+ * Destroy the associated fvm_interface_set_t structure if necessary
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE LBRALE
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (lbrale, LBRALE)(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_ALE_H__ */
+
diff --git a/include/base/cs_ast_coupling.h b/include/base/cs_ast_coupling.h
new file mode 100644
index 0000000..700082d
--- /dev/null
+++ b/include/base/cs_ast_coupling.h
@@ -0,0 +1,205 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_AST_COUPLING_H__
+#define __CS_AST_COUPLING_H__
+
+/*============================================================================
+ * Code_Aster coupling
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Structure definition
+ *============================================================================*/
+
+typedef struct _cs_ast_coupling_t cs_ast_coupling_t;
+
+/*============================================================================
+ * Global variables definition
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Send nodes coordinates and structure numbering of coupled mesh.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ASTGEO
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astgeo, ASTGEO)
+(
+ cs_int_t *nbfast,
+ cs_int_t *nbnast,
+ cs_int_t *lstfac,
+ cs_int_t *idfast,
+ cs_int_t *idnast,
+ cs_real_t *almax
+);
+
+/*----------------------------------------------------------------------------
+ * Send stresses acting on the fluid/structure interface.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ASTFOR
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astfor, ASTFOR)
+(
+ cs_int_t *ntcast,
+ cs_int_t *nbfast,
+ cs_real_t *forast
+);
+
+/*----------------------------------------------------------------------------
+ * Receive displacement values of the fluid/structure interface
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ASTCIN
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astcin, ASTCIN)
+(
+ cs_int_t *ntcast,
+ cs_int_t *nbfast,
+ cs_int_t *lstfac,
+ cs_real_t *depale
+);
+
+/*----------------------------------------------------------------------------
+ * Receive coupling parameters
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ASTPAR
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astpar, ASTPAR)
+(
+ cs_int_t *nbpdt,
+ cs_int_t *nbsspdt,
+ cs_real_t *delta,
+ cs_int_t *ihi,
+ cs_int_t *chro,
+ cs_real_t *tt,
+ cs_real_t *dt
+);
+
+/*----------------------------------------------------------------------------
+ * Exchange time step
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ASTPDT
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astpdt, ASTPDT)
+(
+ cs_real_t *dttab,
+ cs_int_t *ncelet,
+ cs_int_t *nbpdt
+);
+
+/*----------------------------------------------------------------------------
+ * Receive convergence value of Code_Saturne/Code_Aster coupling
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ASTCV1
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astcv1, ASTCV1)
+(
+ cs_int_t *ntcast,
+ cs_int_t *icv
+);
+
+/*-----------------------------------------------------------------------------
+ * Send global convergence value of IFS calculations
+ * (Internal and external structures)
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ASTCV2
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astcv2, ASTCV2)
+(
+ cs_int_t *ntcast,
+ cs_int_t *icv
+);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SYR_COUPLING_H__ */
diff --git a/include/base/cs_base.h b/include/base/cs_base.h
new file mode 100644
index 0000000..a32a706
--- /dev/null
+++ b/include/base/cs_base.h
@@ -0,0 +1,485 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_BASE_H__
+#define __CS_BASE_H__
+
+/*============================================================================
+ * Definitions, global variables, and base functions
+ *============================================================================*/
+
+
+/* Definition of the C langage version used (C89 or C99) */
+
+#if defined(__STDC_VERSION__)
+# define _CS_STDC_VERSION __STDC_VERSION__
+#else
+# define _CS_STDC_VERSION 1989
+#endif
+
+/*
+ * Redefinition of "inline" et "restrict" qualifiers incompatible with
+ * some C89 compilers (standard in C99)
+ */
+
+#if (_CS_STDC_VERSION < 199901L)
+
+# if defined(__GNUC__)
+# define inline __inline__
+# define restrict __restrict__
+# else
+# define inline
+# define restrict
+# endif
+
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stddef.h>
+
+#if (_CS_STDC_VERSION >= 199901L)
+#include <stdint.h>
+#endif
+
+#if defined(HAVE_MPI)
+
+#include <mpi.h>
+
+#if defined(HAVE_MPE)
+#include <mpe.h>
+#endif
+
+#endif
+
+#if defined(HAVE_OPENMP)
+#include <omp.h>
+#endif
+
+/*=============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/* Application type name */
+
+#define CS_APP_NAME "Code_Saturne"
+#define CS_APP_VERSION PACKAGE_VERSION /* PACKAGE_VERSION from autoconf */
+
+/* System type name */
+
+#if defined(__sgi__) || defined(__sgi) || defined(sgi)
+#define _CS_ARCH_IRIX_64
+
+#elif defined(__hpux__) || defined(__hpux) || defined(hpux)
+#define _CS_ARCH_HP_UX
+
+#elif defined(__blrts__) || defined(__bgp__)
+#define _CS_ARCH_Blue_Gene
+
+#elif defined(__linux__) || defined(__linux) || defined(linux)
+#define _CS_ARCH_Linux
+
+#elif defined(__sun__) || defined(__sun) || defined(sun)
+#define _CS_ARCH_SunOS
+
+#elif defined(__uxpv__) || defined(__uxpv) || defined(uxpv)
+#define _CS_ARCH_UNIX_System_V
+
+#endif
+
+/*
+ * Macro for handling of different symbol names (underscored or not,
+ * lowercase or uppercase) between C and Fortran, for link resolution.
+ */
+
+#if !defined (__hpux)
+#define CS_PROCF(x, y) x##_
+#else
+#define CS_PROCF(x, y) x
+#endif
+
+/*
+ * Macro used to handle automatic "Fortran string length" arguments
+ * (not used by Code_Saturne calls, but set by many compilers).
+ * Some compilers, like the Fujitsu VPP 5000 compiler, may not
+ * support the variable length lists in mixed C/Fortran calls.
+ */
+
+#if defined (__uxpv__) /* Fujitsu VPP 5000 case */
+#define CS_ARGF_SUPP_CHAINE
+#else
+#define CS_ARGF_SUPP_CHAINE , ...
+#endif
+
+/* On certain architectures such as IBM Blue Gene, some operations may
+ * be better optimized on memory-aligned data (if 0 here, no alignment
+ * is leveraged). This alignment is not exploited yet in Code_Saturne. */
+
+#if defined(__blrts__) || defined(__bgp__)
+#define CS_MEM_ALIGN 16
+#else
+#define CS_MEM_ALIGN 0
+#endif
+
+/* "Classical" macros */
+
+#define CS_ABS(a) ((a) < 0 ? -(a) : (a)) /* Absolute value of a */
+#define CS_MIN(a,b) ((a) < (b) ? (a) : (b)) /* Minimum of a et b */
+#define CS_MAX(a,b) ((a) > (b) ? (a) : (b)) /* Maximum of a et b */
+
+/*
+ * Macros for internationalization via gettext() or a similar
+ * function (to mark translatable character strings)
+ */
+
+#if defined(ENABLE_NLS)
+
+#include <libintl.h>
+#define _(String) gettext(String)
+#define gettext_noop(String) String
+#define N_(String) gettext_noop(String)
+
+#else
+
+#define _(String) String
+#define N_(String) String
+#define textdomain(Domain)
+#define bindtextdomain(Package, Directory)
+
+#endif
+
+/* Macros for compilation with a C++ compiler */
+
+#undef BEGIN_C_DECLS
+#undef END_C_DECLS
+
+#if defined(__cplusplus)
+#define BEGIN_C_DECLS extern "C" {
+#define END_C_DECLS }
+#else
+#define BEGIN_C_DECLS
+#define END_C_DECLS
+#endif
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+typedef int cs_int_t; /* Integer */
+typedef double cs_real_t; /* Floating-point real */
+typedef char cs_byte_t; /* Byte (untyped memory unit) */
+
+typedef cs_real_t cs_point_t[3];
+
+typedef enum { /* Boolean */
+ CS_FALSE ,
+ CS_TRUE
+} cs_bool_t;
+
+#if !defined(false)
+#define false CS_FALSE
+#endif
+
+#if !defined(true)
+#define true CS_TRUE
+#endif
+
+/* Mappings to MPI datatypes */
+
+#if defined(HAVE_MPI)
+
+#define CS_MPI_INT MPI_INT /* If cs_int_t is an int */
+#define CS_MPI_REAL MPI_DOUBLE /* If cs_real_t is a double */
+
+#endif /* defined(HAVE_MPI) */
+
+/* Datatype enumeration to transmit a data's type to a function */
+
+typedef enum {
+ CS_TYPE_char,
+ CS_TYPE_cs_int_t,
+ CS_TYPE_cs_real_t,
+ CS_TYPE_cs_bool_t,
+ CS_TYPE_cs_point_t,
+ CS_TYPE_void
+} cs_type_t;
+
+/*=============================================================================
+ * Global variable definitions
+ *============================================================================*/
+
+extern int cs_glob_n_threads; /* Number of threads */
+
+extern int cs_glob_rank_id; /* Rank of process in group */
+extern int cs_glob_n_ranks; /* Number of processes in group */
+
+#if defined(HAVE_MPI)
+extern MPI_Comm cs_glob_mpi_comm; /* Intra-communicator */
+#endif
+
+/* Global variables used for MPE instrumentation */
+
+#if defined(HAVE_MPI) && defined(HAVE_MPE)
+extern int cs_glob_mpe_broadcast_a;
+extern int cs_glob_mpe_broadcast_b;
+extern int cs_glob_mpe_synchro_a;
+extern int cs_glob_mpe_synchro_b;
+extern int cs_glob_mpe_send_a;
+extern int cs_glob_mpe_send_b;
+extern int cs_glob_mpe_rcv_a;
+extern int cs_glob_mpe_rcv_b;
+extern int cs_glob_mpe_reduce_a;
+extern int cs_glob_mpe_reduce_b;
+extern int cs_glob_mpe_compute_a;
+extern int cs_glob_mpe_compute_b;
+#endif
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Call exit routine from Fortran code
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE CSEXIT (STATUS)
+ * *****************
+ *
+ * INTEGER STATUS : --> : 0 for success, 1+ for error
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csexit, CSEXIT)
+(
+ const cs_int_t *status
+);
+
+/*----------------------------------------------------------------------------
+ * CPU time used since execution start
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DMTMPS (TCPU)
+ * *****************
+ *
+ * DOUBLE PRECISION TCPU : --> : CPU time (user + system)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (dmtmps, DMTMPS)
+(
+ cs_real_t *tcpu
+);
+
+/*----------------------------------------------------------------------------
+ * Check that main integer working array memory reservation fits within
+ * the allocated size of IA.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE IASIZE (CALLER, MEMINT)
+ * *****************
+ *
+ * CHARACTER*6 CALLER : --> : Name of calling subroutine
+ * INTEGER MEMINT : --> : Last required element in IA
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (iasize, IASIZE)
+(
+ const char caller[6],
+ cs_int_t *memint
+);
+
+/*----------------------------------------------------------------------------
+ * Check that main floating-point working array memory reservation fits
+ * within the allocated size of RA.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE RASIZE (CALLER, MEMINT)
+ * *****************
+ *
+ * CHARACTER*6 CALLER : --> : Name of calling subroutine
+ * INTEGER MEMRDP : --> : Last required element in RA
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (rasize, RASIZE)
+(
+ const char caller[6],
+ cs_int_t *memrdp
+);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Complete MPI setup.
+ *
+ * MPI should have been initialized by cs_opts_mpi_init().
+ *
+ * Global variables `cs_glob_n_ranks' (number of Code_Saturne processes)
+ * and `cs_glob_rank_id' (rank of local process) are set by this function.
+ *
+ * parameters:
+ * app_num <-- -1 if MPI is not needed, or application number in
+ * MPI_COMM_WORLD of this instance of Code_Saturne.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mpi_init(int app_num);
+
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Exit, with handling for both normal and error cases.
+ *
+ * Finalize MPI if necessary.
+ *
+ * parameters:
+ * status <-- value to be returned to the parent:
+ * EXIT_SUCCESS / 0 for the normal case,
+ * EXIT_FAILURE or other nonzero code for error cases.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_exit(int status);
+
+/*----------------------------------------------------------------------------
+ * Initialize error and signal handlers.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_error_init(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize management of memory allocated through BFT.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mem_init(void);
+
+/*----------------------------------------------------------------------------
+ * Allocate Fortran work arrays and prepare for their use.
+ *
+ * parameters:
+ * iasize <-- integer working array size (maximum number of values)
+ * rasize <-- floating-point working array size (maximum number of values)
+ * ia --> pointer to integer working array
+ * ra --> pointer to floating-point working array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mem_init_work(size_t iasize,
+ size_t rasize,
+ cs_int_t **ia,
+ cs_real_t **ra);
+
+/*----------------------------------------------------------------------------
+ * Finalize management of memory allocated through BFT.
+ *
+ * A summary of the consumed memory is given.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mem_fin(void);
+
+/*----------------------------------------------------------------------------
+ * Print summary of running time, including CPU and elapsed times.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_bilan_temps(void);
+
+/*----------------------------------------------------------------------------
+ * Print available system information.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_system_info(void);
+
+/*----------------------------------------------------------------------------
+ * Replace default bft_printf() mechanism with internal mechanism.
+ *
+ * This is necessary for good consistency of messages output from C or
+ * from Fortran, and to handle parallel and serial logging options.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_bft_printf_set(void);
+
+/*----------------------------------------------------------------------------
+ * Print a warning message header.
+ *
+ * parameters:
+ * file_name <-- name of source file
+ * line_nume <-- line number in source file
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_warn(const char *file_name,
+ int line_num);
+
+/*----------------------------------------------------------------------------
+ * Convert a character string from the Fortran API to the C API.
+ *
+ * Eventual leading and trailing blanks are removed.
+ *
+ * parameters:
+ * f_str <-- Fortran string
+ * f_len <-- Fortran string length
+ *
+ * returns:
+ * pointer to C string
+ *----------------------------------------------------------------------------*/
+
+char *
+cs_base_string_f_to_c_create(const char *f_str,
+ int f_len);
+
+/*----------------------------------------------------------------------------
+ * Free a string converted from the Fortran API to the C API.
+ *
+ * parameters:
+ * str <-> pointer to C string
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_string_f_to_c_free(char **c_str);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_BASE_H__ */
diff --git a/include/base/cs_benchmark.h b/include/base/cs_benchmark.h
new file mode 100644
index 0000000..975583b
--- /dev/null
+++ b/include/base/cs_benchmark.h
@@ -0,0 +1,72 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_BENCHMARK_H__
+#define __CS_BENCHMARK_H__
+
+/*============================================================================
+ * Low-level operator benchmarking
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Run simple benchmarks.
+ *
+ * parameters:
+ * mpi_trace_mode --> indicates if timing mode (0) or MPI trace-friendly
+ * mode (1) is to be used
+ *----------------------------------------------------------------------------*/
+
+void
+cs_benchmark(int mpi_trace_mode);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_BENCHMARK_H__ */
diff --git a/include/base/cs_blas.h b/include/base/cs_blas.h
new file mode 100644
index 0000000..d3e28d2
--- /dev/null
+++ b/include/base/cs_blas.h
@@ -0,0 +1,282 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_BLAS_H__
+#define __CS_BLAS_H__
+
+/*============================================================================
+ * Portability and fallback layer for BLAS functions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * External library headers
+ *----------------------------------------------------------------------------*/
+
+#if defined(HAVE_ESSL_H)
+#include <essl.h>
+
+#elif defined(HAVE_MKL)
+#include <mkl_cblas.h>
+
+#elif defined(HAVE_CBLAS)
+#include <cblas.h>
+
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+#if defined(HAVE_CBLAS) || defined(HAVE_FBLAS) \
+ || defined(HAVE_ESSL) || defined (HAVE_MKL)
+#define HAVE_BLAS 1
+#endif
+
+/*----------------------------------------------------------------------------
+ * Definition of some C BLAS functions depending on external libraries
+ *----------------------------------------------------------------------------*/
+
+/*
+ - Sum of the absolute values of a vector
+
+ double dasum(int n,
+ const double *x,
+ int incx);
+
+ - Constant times a vector plus a vector: y <-- ax + y
+
+ void daxpy(int n,
+ double a,
+ const double *x,
+ int incx,
+ double *y,
+ int incy);
+
+ - Copy a vector x to a vector y: y <-- x
+
+ void dcopy(int n,
+ const double *x,
+ int incx,
+ double *y,
+ int incy);
+
+ - Return the dot product of 2 vectors: x.y
+
+ double ddot(int n,
+ const double *x,
+ int incx,
+ const double *y,
+ int incy);
+
+ - Return the euclidean norm of a vector
+
+ double dnrm2(int n,
+ const double *x,
+ int incx);
+
+ - Scales a vector by a constant: x <-- ax
+
+ void dscal(int n,
+ double a,
+ double *x,
+ int incx);
+
+ - Interchange vectors
+
+ void dswap(int n,
+ double *x,
+ int incx,
+ double *y,
+ int incy);
+
+ - Finds the index of element having max absolute value
+
+ int idamax(int n,
+ const double *x,
+ int incx);
+*/
+
+/* For the IBM ESSL library, function prototypes are defined in essl.h,
+ with legacy blas names <name> mapped to esv<name> */
+
+#if defined(HAVE_ESSL_H)
+
+#define cblas_dasum dasum
+#define cblas_daxpy daxpy
+#define cblas_dcopy dcopy
+#define cblas_ddot ddot
+#define cblas_dnrm2 dnrm2
+#define cblas_dscal dscal
+#define cblas_dswap dswap
+
+/* For the Intel MKL library, function prototypes are defined in mkl_cblas.h,
+ with standard legacy C BLAS names */
+
+#elif defined(HAVE_MKL)
+
+/* Otherwise, if the legacy C BLAS names are not defined, we define double
+ precision legacy BLAS 1 prototypes */
+
+#define HAVE_CBLAS 1
+
+#elif !defined(HAVE_CBLAS)
+
+/* Sum of the absolute values of a vector */
+
+double cblas_dasum(cs_int_t n,
+ const double *x,
+ cs_int_t incx);
+
+/* Constant times a vector plus a vector: y <-- ax + y */
+
+void cblas_daxpy(cs_int_t n,
+ double a,
+ const double *x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy);
+
+/* Copy a vector x to a vector y: y <-- x */
+
+void cblas_dcopy(cs_int_t n,
+ const double *x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy);
+
+/* Return the dot product of 2 vectors: x.y */
+
+double cblas_ddot(cs_int_t n,
+ const double *x,
+ cs_int_t incx,
+ const double *y,
+ cs_int_t incy);
+
+/* Return the euclidean norm of a vector */
+
+double cblas_dnrm2(cs_int_t n,
+ const double *x,
+ cs_int_t incx);
+
+/* Scales a vector by a constant: x <-- ax */
+
+void cblas_dscal(cs_int_t n,
+ double a,
+ double *x,
+ cs_int_t incx);
+
+/* Interchange vectors */
+
+void cblas_dswap(cs_int_t n,
+ double *restrict x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy);
+
+/* Finds the index of element having max absolute value */
+
+cs_int_t cblas_idamax(cs_int_t n,
+ const double *x,
+ cs_int_t incx);
+
+#endif /* !defined(HAVE_CBLAS) */
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+double CS_PROCF(dasum, DASUM)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx);
+
+/* Constant times a vector plus a vector: y <-- ax + y */
+
+void CS_PROCF(daxpy, DAXPY)(const cs_int_t *n,
+ const double *a,
+ const double *x,
+ const cs_int_t *incx,
+ double *restrict y,
+ const cs_int_t *incy);
+
+/* Copy a vector x to a vector y: y <-- x */
+
+void CS_PROCF(dcopy, DCOPY)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx,
+ double *restrict y,
+ const cs_int_t *incy);
+
+/* Return the dot product of 2 vectors: x.y */
+
+double CS_PROCF(ddot, DDOT)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx,
+ const double *y,
+ const cs_int_t *incy);
+
+/* Return the euclidean norm of a vector */
+
+double CS_PROCF(dnrm2, DNRM2)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx);
+
+/* Scales a vector by a constant: x <-- ax */
+
+void CS_PROCF(dscal, DSCAL)(const cs_int_t *n,
+ const double *a,
+ double *x,
+ const cs_int_t *incx);
+
+/* Interchange vectors */
+
+void CS_PROCF(dswap, DSWAP)(const cs_int_t *n,
+ double *restrict x,
+ const cs_int_t *incx,
+ double *restrict y,
+ const cs_int_t *incy);
+
+/* Finds the index of element having max absolute value */
+
+cs_int_t CS_PROCF(idamax, IDAMAX)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_BLAS_H__ */
diff --git a/include/base/cs_boundary_conditions.h b/include/base/cs_boundary_conditions.h
new file mode 100644
index 0000000..3d4fdd8
--- /dev/null
+++ b/include/base/cs_boundary_conditions.h
@@ -0,0 +1,126 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_BOUNDARY_CONDITIONS_H__
+#define __CS_BOUNDARY_CONDITIONS_H__
+
+/*============================================================================
+ * Post-processing management
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_writer.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Local type definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public Fortran function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Handling of boundary condition definition errors and associated output.
+ *
+ * For each boundary face, itypfb defines the boundary condition type.
+ * As a convention here, zero values correspond to undefined types,
+ * positive values to defined types (with no error), and negative values
+ * to defined types with inconsistent or incompatible values, the
+ * aboslute value indicationg the original boundary condition type.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE BCDERR (NPHAS , ITYPFB)
+ * *****************
+ *
+ * INTEGER NPHAS : --> : Number of active phases
+ * INTEGER ITYPFB : <-> : Array of BC type ids (per phase)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (bcderr, BCDERR)
+(
+ const cs_int_t *nphas,
+ cs_int_t *itypfb
+);
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Handling of boundary condition definition errors and associated output.
+ *
+ * For each boundary face, bc_type defines the boundary condition type.
+ * As a convention here, zero values correspond to undefined types,
+ * positive values to defined types (with no error), and negative values
+ * to defined types with inconsistent or incompatible values, the
+ * absolute value indicating the original boundary condition type.
+ *
+ * parameters:
+ * n_phases <-- number of active phases
+ * bc_type <-- array of BC type ids (per phase)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_boundary_conditions_error(int n_phases,
+ const cs_int_t bc_type[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_BOUNDARY_CONDITIONS_H__ */
diff --git a/include/base/cs_calcium.h b/include/base/cs_calcium.h
new file mode 100644
index 0000000..b7f014b
--- /dev/null
+++ b/include/base/cs_calcium.h
@@ -0,0 +1,275 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_CALCIUM_H__
+#define __CS_CALCIUM_H__
+
+/*============================================================================
+ * Basic CALCIUM-mappable functions for code coupling using SALOME's YACS
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* Instance continuation directive */
+
+#define CS_CALCIUM_CONTINUE 20
+#define CS_CALCIUM_STOP 22
+
+/* Maximum string Lengths (based on CALCIUM's limits) */
+
+#define CS_CALCIUM_INSTANCE_LEN 72
+#define CS_CALCIUM_VARIABLE_LEN 144
+
+/*=============================================================================
+ * Type Definitions
+ *============================================================================*/
+
+/* CALCIUM Variable type dependency */
+
+typedef enum {
+
+ CALCIUM_time, /* Physical time */
+ CALCIUM_iteration /* Iteration number */
+
+} cs_calcium_timedep_t;
+
+/* CALCIUM Variable type dependency */
+
+typedef enum {
+
+ CALCIUM_continue, /* Use last values after disconnect */
+ CALCIUM_stop /* Stop after disconnect */
+
+} cs_calcium_continuation_t;
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Connection
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * s --> name of calling instance
+ * (CS_CALCIUM_INSTANCE_LEN chars max)
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_connect(int comp_id,
+ char *s);
+
+/*----------------------------------------------------------------------------
+ * Disconnection
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * cont --> continuation directive (continue with last values or stop)
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_disconnect(int comp_id,
+ cs_calcium_continuation_t cont);
+
+/*----------------------------------------------------------------------------
+ * Read values, blocking until they are available.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * min_time <-> lower bound of read interval
+ * max_time <-- upper bound of read interval
+ * iteration <-> iteration number of read
+ * var_name <-- name of the variable to read
+ * n_val_max <-- maximum number of values to read
+ * n_val_read <-- maximum number of values to read
+ * val --> values read
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_read_int(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ const char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ int val[]);
+
+int
+cs_calcium_read_float(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ const char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ float val[]);
+
+int
+cs_calcium_read_double(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ const char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ double val[]);
+
+/*----------------------------------------------------------------------------
+ * Write values.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * cur_time <-- current time
+ * iteration <-- iteration number
+ * var_name <-- name of the variable to read
+ * n_val <-- number of values to read
+ * val <-- values written
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_write_int(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double cur_time,
+ int iteration,
+ const char *var_name,
+ int n_val,
+ const int val[]);
+
+int
+cs_calcium_write_float(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double cur_time,
+ int iteration,
+ const char *var_name,
+ int n_val,
+ const float val[]);
+
+int
+cs_calcium_write_double(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double cur_time,
+ int iteration,
+ const char *var_name,
+ int n_val,
+ const double val[]);
+
+/*----------------------------------------------------------------------------
+ * Assign a component and its id
+ *
+ * parameters:
+ * comp_id <-- id of component (0 to n-1, Code_Saturne local)
+ * comp <-- pointer to component
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_set_component(int comp_id,
+ void *comp);
+
+/*----------------------------------------------------------------------------
+ * Set proxy IPC communication mode
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_set_comm_proxy(void);
+
+/*----------------------------------------------------------------------------
+ * Set the CALCIUM-mappable function's verbosity
+ *
+ * parameters:
+ * n_echo <-- verbosity (none if -1, headers if 0,
+ * headers + n first and last elements if > 0.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_set_verbosity(int n_echo);
+
+/*----------------------------------------------------------------------------
+ * Load YACS and corresponding Calcium functions.
+ *
+ * parameters:
+ * lib_path <-- path to shared library containing the yacsinit() function.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_load_yacs(const char *lib_path);
+
+/*----------------------------------------------------------------------------
+ * Unload YACS and corresponding Calcium functions
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_unload_yacs(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize YACS component and enter event loop.
+ *
+ * This must be called after cs_calcium_load_yacs().
+ *
+ * Note that the YACS event loop does not return, sot the YACS component
+ * description should ensure that the code's main run() method (or similar)
+ * is called in the component body.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_start_yacs(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_CALCIUM_H__ */
+
diff --git a/include/base/cs_coupling.h b/include/base/cs_coupling.h
new file mode 100644
index 0000000..7c89910
--- /dev/null
+++ b/include/base/cs_coupling.h
@@ -0,0 +1,108 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_COUPLING_H__
+#define __CS_COUPLING_H__
+
+/*============================================================================
+ * Common functionnality for various coupling types.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_coupling.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Global variable definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Discover other applications in the same MPI root communicator.
+ *
+ * parameters:
+ * app_num <-- application number for this instance of Code_Saturne (>= 0)
+ * app_name <-- optional name of this instance of Code_Saturne, or NULL.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_coupling_discover_mpi_apps(int app_num,
+ const char *app_name);
+
+/*----------------------------------------------------------------------------
+ * Finalize MPI coupling helper structures.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_coupling_finalize(void);
+
+/*----------------------------------------------------------------------------
+ * Return info on other applications in the same MPI root communicator.
+ *
+ * returns:
+ * info on other applications structure.
+ *----------------------------------------------------------------------------*/
+
+const fvm_coupling_mpi_world_t *
+cs_coupling_get_mpi_apps(void);
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_COUPLING_H__ */
diff --git a/include/base/cs_ext_neighborhood.h b/include/base/cs_ext_neighborhood.h
new file mode 100644
index 0000000..f28c815
--- /dev/null
+++ b/include/base/cs_ext_neighborhood.h
@@ -0,0 +1,119 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_EXT_NEIGHBOR_H__
+#define __CS_EXT_NEIGHBOR_H__
+
+/*============================================================================
+ * Fortran interfaces of functions needing a synchronization of the extended
+ * neighborhood.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definition
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define a new "cell -> cells" connectivity for the extended neighborhood
+ * in case of computation of gradient whith the least square algorithm
+ * (imrgra = 3).
+ * The "cell -> cells" connectivity is clipped by a non-orthogonality
+ * criterion.
+ *
+ * Warning : Only cells sharing a vertex or vertices
+ * (not a face => mesh->face_cells) belong to the
+ * "cell -> cells" connectivity.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE REDVSE
+ * *****************
+ * & ( ANOMAX )
+ *
+ * parameters:
+ * anomax --> non-orthogonality angle (rad) above which cells
+ * are selected for the extended neighborhood
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (redvse, REDVSE) (const cs_real_t *anomax);
+
+/*----------------------------------------------------------------------------
+ * Compute filters for dynamic models. This function deals with the standard
+ * or extended neighborhood.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE CFILTR (VAR, F_VAR, WBUF1, WBUF2)
+ * *****************
+ *
+ * DOUBLE PRECISION(*) var[] --> array of variables to filter
+ * DOUBLE PRECISION(*) f_var[] --> filtered variable array
+ * DOUBLE PRECISION(*) wbuf1[] --> working buffer
+ * DOUBLE PRECISION(*) wbuf2[] --> working buffer
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (cfiltr, CFILTR)(cs_real_t var[],
+ cs_real_t f_var[],
+ cs_real_t wbuf1[],
+ cs_real_t wbuf2[]);
+
+/*----------------------------------------------------------------------------
+ * Create the "cell -> cells" connectivity
+ *
+ * parameters:
+ * mesh <-> pointer to a mesh structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_ext_neighborhood_define(cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_EXT_NEIGHBOR_H__ */
diff --git a/include/base/cs_gradient.h b/include/base/cs_gradient.h
new file mode 100644
index 0000000..a6212fb
--- /dev/null
+++ b/include/base/cs_gradient.h
@@ -0,0 +1,177 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GRADIENT_H__
+#define __CS_GRADIENT_H__
+
+/*============================================================================
+ * Gradient reconstruction.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definition
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Encapsulation of the call to GRADMC (Fortran routine for the computation of
+ * gradients by the least squares method). Add data for taking into account
+ * the extended neighborhood.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE CGRDMC
+ * *****************
+ *
+ * ( NCELET , NCEL , NFAC , NFABOR , NCELBR ,
+ * INC , ICCOCG , NSWRGP , IDIMTE , ITENSO , IPHYDP , IMRGRA ,
+ * IWARNP , NFECRA , EPSRGP , EXTRAP ,
+ * IFACEL , IFABOR , IA(IICELB) , IA(IISYMP) ,
+ * VOLUME , SURFAC , SURFBO , RA(ISRFBN) , RA(IPOND) ,
+ * RA(IDIST) , RA(IDISTB) ,
+ * RA(IDIJPF) , RA(IDIIPB) ,
+ * FEXTX , FEXTY , FEXTZ ,
+ * XYZCEN , CDGFAC , CDGFBO , COEFAP , COEFBP , PVAR ,
+ * RA(ICOCGB) , RA(ICOCG) ,
+ * DPDX , DPDY , DPDZ ,
+ * DPDXA , DPDYA , DPDZA )
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cgrdmc, CGRDMC)
+(
+ const cs_int_t *const ncelet, /* --> number of extended cells */
+ const cs_int_t *const ncel, /* --> number of cells */
+ const cs_int_t *const nfac, /* --> number of internal faces */
+ const cs_int_t *const nfabor, /* --> number of boundary faces */
+ const cs_int_t *const ncelbr, /* --> number of cells on boundary */
+ const cs_int_t *const inc, /* --> 0 or 1: increment or not */
+ const cs_int_t *const iccocg, /* --> 1 or 0: recompute COCG or not */
+ const cs_int_t *const nswrgp, /* --> >1: with reconstruction */
+ const cs_int_t *const idimte, /* --> 0, 1, 2: scalar, vector, tensor */
+ const cs_int_t *const itenso, /* --> for rotational periodicity */
+ const cs_int_t *const iphydp, /* --> use hydrosatatic pressure */
+ const cs_int_t *const imrgra, /* --> gradient computation mode */
+ const cs_int_t *const iwarnp, /* --> verbosity level */
+ const cs_int_t *const nfecra, /* --> standard output unit */
+ const cs_real_t *const epsrgp, /* --> precision for iterative gradient
+ calculation */
+ const cs_real_t *const extrap, /* --> extrapolate gradient at boundary */
+ const cs_int_t ifacel[], /* --> interior face->cell connectivity */
+ const cs_int_t ifabor[], /* --> boundary face->cell connectivity */
+ const cs_int_t icelbr[], /* --> list of cells on boundary */
+ const cs_int_t isympa[], /* --> indicator for symmetry faces */
+ const cs_real_t volume[], /* --> cell volumes */
+ const cs_real_t surfac[], /* --> surfaces of internal faces */
+ const cs_real_t surfbo[], /* --> surfaces of boundary faces */
+ const cs_real_t surfbn[], /* --> norm of surfbo */
+ const cs_real_t pond[], /* --> interior faces geometric weight */
+ const cs_real_t dist[], /* --> interior faces I' to J' distance */
+ const cs_real_t distbr[], /* --> boundary faces I' to J' distance */
+ const cs_real_t dijpf[], /* --> interior faces I'J' vector */
+ const cs_real_t diipb[], /* --> boundary faces II' vector */
+ cs_real_t fextx[], /* --> components of the exterior force */
+ cs_real_t fexty[], /* generating the hydrostatic */
+ cs_real_t fextz[], /* pressure */
+ const cs_real_t xyzcen[], /* --> cell centers */
+ const cs_real_t cdgfac[], /* --> interior face centers of gravity */
+ const cs_real_t cdgfbo[], /* --> boundary face centers of gravity */
+ const cs_real_t coefap[], /* --> boundary condition term */
+ const cs_real_t coefbp[], /* --> boundary condition term */
+ cs_real_t pvar[], /* --> gradient's base variable */
+ cs_real_t cocgb[], /* <-> contribution to COCG of cells
+ on boundary's internal faces */
+ cs_real_t cocg[], /* <-> contribution to COCG of cells
+ on boundary's boundary faces */
+ cs_real_t dpdx[], /* <-- gradient x component */
+ cs_real_t dpdy[], /* <-- gradient y component */
+ cs_real_t dpdz[], /* <-- gradient z component */
+ cs_real_t bx[], /* --- local work array */
+ cs_real_t by[], /* --- local work array */
+ cs_real_t bz[] /* --- local work array */
+);
+
+/*----------------------------------------------------------------------------
+ * Clip the gradient if necessary. This function deals with the standard or
+ * extended neighborhood.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE CLMGRD
+ * *****************
+ *
+ * & ( IMRGRA , IMLIGP , IWARNP , CLIMGP ,
+ * & VAR , DPDX , DPDY , DPDZ )
+ *
+ * parameters:
+ * imrgra --> type of computation for the gradient
+ * imligp --> type of clipping for the computation of the gradient
+ * idimte --> dimension of the variable
+ * 0: scalar, 1: vector, 2: tensor
+ * itenso --> only for periodicity when there is a rotation
+ * iwarnp --> output level
+ * itenso --> for rotational periodicity
+ * climgp --> clipping coefficient for the computation of the gradient
+ * var --> variable
+ * dpdx --> X component of the pressure gradient
+ * dpdy --> Y component of the pressure gradient
+ * dpdz --> Z component of the pressure gradient
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (clmgrd, CLMGRD)(const cs_int_t *imrgra,
+ const cs_int_t *imligp,
+ const cs_int_t *iwarnp,
+ const cs_int_t *itenso,
+ const cs_real_t *climgp,
+ cs_real_t var[],
+ cs_real_t dpdx[],
+ cs_real_t dpdy[],
+ cs_real_t dpdz[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GRADIENT__ */
diff --git a/include/base/cs_grid.h b/include/base/cs_grid.h
new file mode 100644
index 0000000..341b82c
--- /dev/null
+++ b/include/base/cs_grid.h
@@ -0,0 +1,312 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GRID_H__
+#define __CS_GRID_H__
+
+/*============================================================================
+ * Grid connectivity and data used for multgrid coarsening
+ * and associated matrix construction.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+#include "cs_halo.h"
+#include "cs_matrix.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/* Structure associated with opaque grid object */
+
+typedef struct _cs_grid_t cs_grid_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create base grid by mapping from shared mesh values.
+ *
+ * Note that as arrays given as arguments are shared by the created grid
+ * (which can only access them, not modify them), the grid should be
+ * destroyed before those arrays.
+ *
+ * parameters:
+ * n_cells <-- Local number of cells
+ * n_cells_ext <-- Local number of cells + ghost cells
+ * n_faces <-- Local number of faces
+ * symmetric <-- True if xam is symmetric, false otherwise
+ * face_cell <-- Face -> cells connectivity (1 to n)
+ * halo <-- Halo structure associated with this level, or NULL.
+ * numbering <-- vectorization or thread-related numbering info, or NULL
+ * cell_cen <-- Cell center (size: 3.n_cells_ext)
+ * cell_vol <-- Cell volume (size: n_cells_ext)
+ * face_normal <-- Internal face normals (size: 3.n_faces)
+ * da <-- Matrix diagonal (size: n_cell_ext)
+ * xa <-- Matrix extra-diagonal terms
+ * (size: n_faces if symmetric, 2.n_faces otherwise)
+ *
+ * returns:
+ * base grid structure
+ *----------------------------------------------------------------------------*/
+
+cs_grid_t *
+cs_grid_create_from_shared(fvm_lnum_t n_cells,
+ fvm_lnum_t n_cells_ext,
+ fvm_lnum_t n_faces,
+ cs_bool_t symmetric,
+ const fvm_lnum_t *face_cell,
+ const cs_halo_t *halo,
+ const cs_numbering_t *numbering,
+ const cs_real_t *cell_cen,
+ const cs_real_t *cell_vol,
+ const cs_real_t *face_normal,
+ const cs_real_t *da,
+ const cs_real_t *xa);
+
+/*----------------------------------------------------------------------------
+ * Destroy a grid structure.
+ *
+ * parameters:
+ * grid <-> Pointer to grid structure pointer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_destroy(cs_grid_t **grid);
+
+/*----------------------------------------------------------------------------
+ * Get grid information.
+ *
+ * parameters:
+ * g <-- Grid structure
+ * level --> Level in multigrid hierarchy (or NULL)
+ * symmetric --> Symmetric matrix coefficients indicator (or NULL)
+ * n_cells_ext --> Number of local cells (or NULL)
+ * n_cells_ext --> Number of cells including ghosts (or NULL)
+ * n_cells_ext --> Number of faces (or NULL)
+ * n_g_cells --> Number of global cells (or NULL)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_get_info(const cs_grid_t *g,
+ int *level,
+ cs_bool_t *symmetric,
+ fvm_lnum_t *n_cells,
+ fvm_lnum_t *n_cells_ext,
+ fvm_lnum_t *n_faces,
+ fvm_gnum_t *n_g_cells);
+
+/*----------------------------------------------------------------------------
+ * Get number of cells corresponding to a grid.
+ *
+ * parameters:
+ * g <-- Grid structure
+ *
+ * returns:
+ * number of cells of grid structure
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_grid_get_n_cells(const cs_grid_t *g);
+
+/*----------------------------------------------------------------------------
+ * Get number of extended (local + ghost) cells corresponding to a grid.
+ *
+ * parameters:
+ * g <-- Grid structure
+ *
+ * returns:
+ * number of extended cells of grid structure
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_grid_get_n_cells_ext(const cs_grid_t *g);
+
+/*----------------------------------------------------------------------------
+ * Get global number of cells corresponding to a grid.
+ *
+ * parameters:
+ * g <-- Grid structure
+ *
+ * returns:
+ * global number of cells of grid structure
+ *----------------------------------------------------------------------------*/
+
+fvm_gnum_t
+cs_grid_get_n_g_cells(const cs_grid_t *g);
+
+/*----------------------------------------------------------------------------
+ * Get grid's associated matrix information.
+ *
+ * parameters:
+ * g <-- Grid structure
+ * da --> Diagonal matrix coefficients
+ * xa --> Non-diagonal matrix coefficients
+ * m --> Associated matrix structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_get_matrix(const cs_grid_t *g,
+ const cs_real_t **da,
+ const cs_real_t **xa,
+ cs_matrix_t **m);
+
+/*----------------------------------------------------------------------------
+ * Create coarse grid from fine grid.
+ *
+ * parameters:
+ * f <-- Fine grid structure
+ * verbosity <-- Verbosity level
+ * agglomeration_limit <-- Maximum allowed fine cells per coarse cell
+ * max_agglomeration <-> Maximum fine cells per coarse cell
+ *
+ * returns:
+ * coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+cs_grid_t *
+cs_grid_coarsen(const cs_grid_t *f,
+ int verbosity,
+ int agglomeration_limit,
+ int *max_agglomeration);
+
+/*----------------------------------------------------------------------------
+ * Compute coarse cell variable values from fine cell values
+ *
+ * parameters:
+ * f <-- Fine grid structure
+ * c <-- Fine grid structure
+ * f_var <-- Variable defined on fine grid cells
+ * c_var --> Variable defined on coarse grid cells
+ *
+ * returns:
+ * coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_restrict_cell_var(const cs_grid_t *f,
+ const cs_grid_t *c,
+ const cs_real_t *f_var,
+ cs_real_t *c_var);
+
+/*----------------------------------------------------------------------------
+ * Compute fine cell variable values from coarse cell values
+ *
+ * parameters:
+ * c <-- Fine grid structure
+ * f <-- Fine grid structure
+ * c_var --> Variable defined on coarse grid cells
+ * f_var <-- Variable defined on fine grid cells
+ *
+ * returns:
+ * coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_prolong_cell_var(const cs_grid_t *c,
+ const cs_grid_t *f,
+ const cs_real_t *c_var,
+ cs_real_t *f_var);
+
+/*----------------------------------------------------------------------------
+ * Project coarse grid cell numbers to base grid.
+ *
+ * If a global coarse grid cell number is larger than max_num, its
+ * value modulo max_num is used.
+ *
+ * parameters:
+ * g <-- Grid structure
+ * n_base_cells <-- Number of cells in base grid
+ * max_num <-- Values of c_cell_num = global_num % max_num
+ * c_cell_num --> Global coarse cell number (modulo max_num)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_project_cell_num(const cs_grid_t *g,
+ fvm_lnum_t n_base_cells,
+ int max_num,
+ int c_cell_num[]);
+
+/*----------------------------------------------------------------------------
+ * Project variable from coarse grid to base grid
+ *
+ * parameters:
+ * g <-- Grid structure
+ * n_base_cells <-- Number of cells in base grid
+ * c_var <-- Cell variable on coarse grid
+ * f_var --> Cell variable projected to fine grid
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_project_var(const cs_grid_t *g,
+ fvm_lnum_t n_base_cells,
+ const cs_real_t c_var[],
+ cs_real_t f_var[]);
+
+/*----------------------------------------------------------------------------
+ * Compute diagonal dominance metric and project it to base grid
+ *
+ * parameters:
+ * g <-- Grid structure
+ * n_base_cells <-- Number of cells in base grid
+ * diag_dom --> Diagonal dominance metric (on fine grid)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_project_diag_dom(const cs_grid_t *g,
+ fvm_lnum_t n_base_cells,
+ cs_real_t diag_dom[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GRID_H__ */
diff --git a/include/base/cs_gui.h b/include/base/cs_gui.h
new file mode 100644
index 0000000..fdc7287
--- /dev/null
+++ b/include/base/cs_gui.h
@@ -0,0 +1,571 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_H__
+#define __CS_GUI_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: main parameters
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialise the global 'vars' structure.
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiinit
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiinit, UIINIT) (void);
+
+/*----------------------------------------------------------------------------
+ * Turbulence model.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSTURB
+ * *****************
+ *
+ * INTEGER ITURB <-- turbulence model
+ * INTEGER IDEUCH <-- wall law treatment
+ * INTEGER IGRAKE <-- k-eps gravity effects
+ * INTEGER IGRAKI <-- Rij-eps gravity effects
+ * DOUBLE PRECISION XLOMLG <-- mixing_length_scale
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csturb, CSTURB) (int *const iturb,
+ int *const ideuch,
+ int *const igrake,
+ int *const igrari,
+ double *const xlomlg);
+
+/*----------------------------------------------------------------------------
+ * Specific heat variable or constant indicator.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSCPVA
+ * *****************
+ *
+ * INTEGER ICP <-- Specific heat variable or constant indicator
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cscpva, CSCPVA) (int *const icp);
+
+/*----------------------------------------------------------------------------
+ * User scalars number.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSNSCA
+ * *****************
+ *
+ * INTEGER NSCAUS <-- user scalars number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csnsca, CSNSCA) (int *const nscaus);
+
+/*----------------------------------------------------------------------------
+ * User scalars which are variance.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSISCA (ISCAVR)
+ * *****************
+ *
+ * INTEGER ISCAVR <-- user scalars variance array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csisca, CSISCA) (int *const iscavr);
+
+/*----------------------------------------------------------------------------
+ * Constant or variable indicator for the user scalar laminar viscosity.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIVIS (IDTVAR)
+ * *****************
+ *
+ * INTEGER ISCAVR <--> number of the related variance if any
+ * INTEGER IVISLS <-- indicator for the user scalar viscosity
+ * INTEGER ISCALT <--> number of the user thermal scalar if any
+ * INTEGER ISCSTH <--> type of the user thermal scalar
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csivis, CSIVIS) (int *const iscavr,
+ int *const ivisls,
+ int *const iscalt,
+ int *const iscsth);
+
+/*----------------------------------------------------------------------------
+ * Time passing parameter.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIDTV (IDTVAR)
+ * *****************
+ *
+ * INTEGER IDTVAR <-- fixed or variable time step
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csidtv, CSIDTV) (int *const idtvar);
+
+/*----------------------------------------------------------------------------
+ * Hydrostatic pressure parameter.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIPHY (IPHYDR)
+ * *****************
+ *
+ * INTEGER IPHYDR <-- hydrostatic pressure
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csiphy, CSIPHY) (int *const iphydr);
+
+/*----------------------------------------------------------------------------
+ *
+ * SUBROUTINE CSVNUM()
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csvnum, CSVNUM) (const int *const nvar,
+ const int *const iu,
+ const int *const iv,
+ const int *const iw,
+ const int *const ipr,
+ const int *const iturb,
+ const int *const ik,
+ const int *const iep,
+ const int *const ir11,
+ const int *const ir22,
+ const int *const ir33,
+ const int *const ir12,
+ const int *const ir13,
+ const int *const ir23,
+ const int *const iomg,
+ const int *const iphi,
+ const int *const ifb,
+ const int *const iale,
+ const int *const iuma,
+ const int *const ivma,
+ const int *const iwma,
+ const int *const isca,
+ const int *const iscapp);
+
+/*----------------------------------------------------------------------------
+ * Restart parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSISUI
+ * *****************
+ *
+ * INTEGER ISUITE <-- restart
+ * INTEGER ILEAUX <-- restart with auxiliary
+ * INTEGER ICCFVG <-- restart with frozen field
+ *----------------------------------------------------------------------------*/
+
+
+void CS_PROCF (csisui, CSISUI) (int *const isuite,
+ int *const ileaux,
+ int *const iccvfg);
+
+/*----------------------------------------------------------------------------
+ * Time passing parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSTIME
+ * *****************
+ *
+ * INTEGER INPDT0 <-- zero tim step
+ * INTEGER IPTLTO <-- thermal time step control
+ * INTEGER NTMABS <-- iterations numbers
+ * INTEGER IDTVAR <-- time step's options
+ * DOUBLE PRECISION DTREF <-- time step
+ * DOUBLE PRECISION DTMIN <-- minimal time step
+ * DOUBLE PRECISION DTMAX <-- maximal time step
+ * DOUBLE PRECISION COUMAX <-- maximal courant number
+ * DOUBLE PRECISION FOUMAX <-- maximal fournier number
+ * DOUBLE PRECISION VARRDT <-- max time step variation between 2 iterations
+ * DOUBLE PRECISION RELXST <-- relaxation coefficient if idtvar = -1
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cstime, CSTIME) (int *const inpdt0,
+ int *const iptlro,
+ int *const ntmabs,
+ int *const idtvar,
+ double *const dtref,
+ double *const dtmin,
+ double *const dtmax,
+ double *const coumax,
+ double *const foumax,
+ double *const varrdt,
+ double *const relxst);
+
+/*----------------------------------------------------------------------------
+ * Check if a users thermal scalar is defined.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSSCA1
+ * *****************
+ *
+ * INTEGER ISCALT <-- number of the user thermal scalar if any
+ * INTEGER ISCSTH <-- type of the user thermal scalar
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cssca1, CSSCA1) (int *const iscalt,
+ int *const iscsth);
+
+/*----------------------------------------------------------------------------
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UINUM1
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uinum1, UINUM1) (const int *const isca,
+ const int *const iscapp,
+ double *const blencv,
+ int *const ischcv,
+ int *const isstpc,
+ int *const ircflu,
+ double *const cdtvar,
+ int *const nitmax,
+ double *const epsilo);
+
+/*----------------------------------------------------------------------------
+ * Global numerical parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSNUM2
+ * *****************
+ *
+ * INTEGER IVISSE <-- gradient transpose
+ * INTEGER RELAXP <-- pressure relaxation
+ * INTEGER IPUCOU <-- velocity pressure coupling
+ * INTEGER EXTRAG <-- wall pressure extrapolation
+ * INTEGER IMRGRA <-- gradient reconstruction
+ * INTEGER IMGR <-- multigrid algorithm for pressure
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csnum2, CSNUM2) ( int *const ivisse,
+ double *const relaxp,
+ int *const ipucou,
+ double *const extrag,
+ int *const imrgra,
+ int *const imgrpr);
+
+void CS_PROCF (csphys, CSPHYS) (const int *const nmodpp,
+ int *const irovar,
+ int *const ivivar,
+ int *const icorio,
+ double *const gx,
+ double *const gy,
+ double *const gz,
+ double *const omegax,
+ double *const omegay,
+ double *const omegaz,
+ double *const ro0,
+ double *const viscl0,
+ double *const cp0,
+ double *const t0,
+ double *const p0);
+
+/*----------------------------------------------------------------------------
+ * User scalar min and max values for clipping.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSSCA2
+ * *****************
+ *
+ * INTEGER ISCAVR --> number of the related variance if any
+ * DOUBLE PRECISION SCAMIN <-- user scalar min array
+ * DOUBLE PRECISION SCAMAX <-- user scalar max array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cssca2, CSSCA2) ( const int *const iscavr,
+ double *const scamin,
+ double *const scamax);
+
+void CS_PROCF (cssca3, CSSCA3) (const int *const iscalt,
+ const int *const iscavr,
+ double *const visls0,
+ double *const t0,
+ double *const p0);
+
+/*----------------------------------------------------------------------------
+ * Array of properties used in the calculation
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiprop, UIPROP) (const int *const irom,
+ const int *const iviscl,
+ const int *const ivisct,
+ const int *const ivisls,
+ const int *const icour,
+ const int *const ifour,
+ const int *const ismago,
+ const int *const iale,
+ const int *const icp,
+ const int *const iscalt,
+ const int *const iscavr,
+ const int *const iprtot,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const icmome,
+ const int *const ipptx,
+ const int *const ippty,
+ const int *const ipptz,
+ const int *const ippdt,
+ const int *const ivisma,
+ const int *const iappel);
+
+/*----------------------------------------------------------------------------
+ * Temporal averaging treatment
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uimoyt, UIMOYT) (const int *const ndgmox,
+ int *const ntdmom,
+ int *const imoold,
+ int *const idfmom);
+
+/*----------------------------------------------------------------------------
+ * Turbulence initialization parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSTINI
+ * *****************
+ *
+ * INTEGER UREF <-- reference velocity
+ * INTEGER ALMAX <-- reference length
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cstini, CSTINI) (double *const uref,
+ double *const almax);
+
+void CS_PROCF (csenso, CSENSO) (const int *const nvppmx,
+ int *const ncapt,
+ int *const nthist,
+ int *const ntlist,
+ int *const ichrvl,
+ int *const ichrbo,
+ int *const ichrsy,
+ int *const ichrmd,
+ char *const fmtchr,
+ int *const size_fmt,
+ char *const optchr,
+ int *const size_opt,
+ int *const ntchr,
+ int *const iecaux,
+ int *const ipstdv,
+ int *const ipstyp,
+ int *const ipstcl,
+ int *const ipstft,
+ int *const ipstfo,
+ int *const ichrvr,
+ int *const ilisvr,
+ int *const ihisvr,
+ const int *const isca,
+ const int *const iscapp,
+ const int *const ipprtp,
+ double *const xyzcap);
+
+void CS_PROCF(fcnmva, FCNMVA)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+);
+
+void CS_PROCF(cfnmva, CFNMVA)
+(
+ char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+);
+
+void CS_PROCF(nvamem, NVAMEM) (void);
+
+/*----------------------------------------------------------------------------
+ * Users arrays
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIUSAR (ICOFTU)
+ * *****************
+ *
+ * INTEGER ICOFTU --> Dimension coef for user arrays
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiusar, UIUSAR) (int *const icoftu);
+
+/*----------------------------------------------------------------------------
+ * Variables and user scalars initialization
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIINIV (NCELET, ISCA, RTP)
+ * *****************
+ *
+ * INTEGER NCELET --> number of cells with halo
+ * INTEGER ISCA --> indirection array for scalar number
+ * DOUBLE PRECISION RTP <-- variables and scalars array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(uiiniv, UIINIV) (const int *const ncelet,
+ const int *const isca,
+ double *const rtp);
+
+/*----------------------------------------------------------------------------
+ * User law for material Properties
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIPHYV (NCELET, ISCA, RTP)
+ * *****************
+ *
+ * INTEGER NCEL --> number of cells whithout halo
+ * INTEGER NCELET --> number of cells whith halo
+ * INTEGER NSCAUS --> number of user scalar including thermal scalar
+ * INTEGER IROM --> pointer for density rho
+ * INTEGER IVISCL --> pointer for mulecular viscosity mu
+ * INTEGER ICP --> pointer for predifined heat Cp
+ * INTEGER IVISLS --> pointer for Lambda/Cp
+ * INTEGER IROVAR --> =1 if rho variable, =0 if rho constant
+ * INTEGER IVIVAR --> =1 if mu variable, =0 if mu constant
+ * INTEGER ISCA --> indirection array for scalar number
+ * INTEGER ISCALT --> pointer for the thermal scalar in ISCA
+ * INTEGER ISCAVR --> scalars that are variance
+ * INTEGER IPPROC --> indirection array for cell properties
+ * DOUBLE PRECISION RO0 --> value of density if IROVAR=0
+ * DOUBLE PRECISION CP0 --> value of predifined heat if ICP=0
+ * DOUBLE PRECISION RTP --> variables and scalars array
+ * DOUBLE PRECISION PROPCE <-- cell properties array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(uiphyv, UIPHYV)(const cs_int_t *const ncel,
+ const cs_int_t *const ncelet,
+ const cs_int_t *const nscaus,
+ const cs_int_t irom[],
+ const cs_int_t iviscl[],
+ const cs_int_t icp[],
+ const cs_int_t ivisls[],
+ const cs_int_t irovar[],
+ const cs_int_t ivivar[],
+ const cs_int_t isca[],
+ const cs_int_t iscalt[],
+ const cs_int_t iscavr[],
+ const cs_int_t ipproc[],
+ const cs_real_t ro0[],
+ const cs_real_t cp0[],
+ const cs_real_t rtp[],
+ cs_real_t propce[]);
+
+/*----------------------------------------------------------------------------
+ * 1D profile postprocessing
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIPROF
+ * *****************
+ *
+ * INTEGER NCELET --> number of cells with halo
+ * INTEGER NCEL --> number of cells without halo
+ * INTEGER NTMABS --> max iterations numbers
+ * INTEGER NTCABS --> current iteration number
+ * DOUBLE PRECISION TTCABS --> current physical time
+ * DOUBLE PRECISION XYZCEN --> cell's gravity center
+ * DOUBLE PRECISION RTP --> variables and scalars array
+ * DOUBLE PRECISION PROPCE --> property array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiprof, UIPROF)(const int *const ncelet,
+ const int *const ncel,
+ const int *const ntmabs,
+ const int *const ntcabs,
+ const double *const ttcabs,
+ const double *const xyzcen,
+ const double *const rtp,
+ const double *const propce);
+
+/*----------------------------------------------------------------------------
+ * Free memory: clean global private variables and libxml2 variables.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE MEMUI1
+ * *****************
+ *
+ * INTEGER NCHARB --> number of coal
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (memui1, MEMUI1) (const int *const ncharb);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Free memory: clean global private variables and libxml2 variables
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_clean_memory(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_H__ */
diff --git a/include/base/cs_gui_boundary_conditions.h b/include/base/cs_gui_boundary_conditions.h
new file mode 100644
index 0000000..ab5312c
--- /dev/null
+++ b/include/base/cs_gui_boundary_conditions.h
@@ -0,0 +1,312 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_BOUNDARY_CONDITION_H__
+#define __CS_GUI_BOUNDARY_CONDITION_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: boundary conditions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * MEI library headers
+ *----------------------------------------------------------------------------*/
+
+#ifdef HAVE_MEI
+#include "mei_evaluate.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Structures associated to boundary conditions definition
+ *----------------------------------------------------------------------------*/
+
+typedef struct {
+ double val1; /* fortran array RCODCL(.,.,1) mapping */
+ double val2; /* fortran array RCODCL(.,.,2) mapping */
+ double val3; /* fortran array RCODCL(.,.,3) mapping */
+} cs_val_t;
+
+typedef struct {
+ int read_data; /* 1 if profile is calculated from data */
+ int automatic; /* 1 if nature of the boundary is automatic */
+} cs_meteo_t;
+
+typedef struct {
+ char **label; /* label for each boundary zone */
+ char **nature; /* nature for each boundary zone */
+ int *iqimp; /* 1 if a flow rate is applied */
+ int *ientat; /* 1 if inlet for oxydant (coal combustion) */
+ int *ientcp; /* 1 if inlet for oxydant+coal (coal combustion) */
+ int *icalke; /* automatic boundaries for turbulent variables */
+ double *qimp; /* oxydant flow rate (coal combustion) */
+ double *inmoxy; /* oxydant number (coal combustion) */
+ double *timpat; /* inlet temperature of oxydant (coal combustion) */
+ double **qimpcp; /* inlet coal flow rate (coal combustion) */
+ double **timpcp; /* inlet coal temperature (coal combustion) */
+ double *dh; /* inlet hydraulic diameter */
+ double *xintur; /* inlet turbulent intensity */
+ int **type_code; /* type of boundary for each variables */
+ cs_val_t **values; /* fortran array RCODCL mapping */
+ double ***distch; /* ratio for each coal */
+ double *rough; /* roughness size */
+ double *norm; /* norm of velocity vector */
+ double *dirx; /* directions x inlet velocity */
+ double *diry; /* directions y inlet velocity */
+ double *dirz; /* directions z inlet velocity */
+#if defined(HAVE_MEI)
+ mei_tree_t **velocity; /* formula for norm or mass flow rate of velocity */
+ mei_tree_t **direction; /* formula for direction of velocity */
+#endif
+ cs_meteo_t *meteo; /* inlet or outlet info for atmospheric flow */
+} cs_boundary_t;
+
+
+/*----------------------------------------------------------------------------
+ * Enum for boundary conditions
+ *----------------------------------------------------------------------------*/
+
+typedef enum {
+ DIRICHLET,
+ FLOW1,
+ HYDRAULIC_DIAMETER,
+ TURBULENT_INTENSITY,
+ NEUMANN,
+ COEF_ECHANGE,
+ COALFLOW,
+ WALL_FUNCTION
+} cs_boundary_value_t;
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Pointer on the main boundaries structure */
+
+extern cs_boundary_t *boundaries;
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Boundary conditions treatment
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UICLIM
+ * *****************
+ *
+ * INTEGER NTCABS --> current iteration number
+ * INTEGER NFABOR --> number of boundary faces
+ * INTEGER NOZPPM --> max number of boundary conditions zone
+ * INTEGER NCHARM --> maximal number of coals
+ * INTEGER NCHARB --> number of simulated coals
+ * INTEGER NCLPCH --> number of simulated class per coals
+ * INTEGER IINDEF --> type of boundary: not defined
+ * INTEGER IENTRE --> type of boundary: inlet
+ * INTEGER IPAROI --> type of boundary: smooth wall
+ * INTEGER IPARUG --> type of boundary: rough wall
+ * INTEGER ISYMET --> type of boundary: symetry
+ * INTEGER ISOLIB --> type of boundary: outlet
+ * INTEGER IQIMP --> 1 if flow rate is applied
+ * INTEGER ICALKE --> 1 for automatic turbulent boundary conditions
+ * INTEGER IENTAT --> 1 for air temperature boundary conditions (coal)
+ * INTEGER IENTCP --> 1 for coal temperature boundary conditions (coal)
+ * INTEGER inmoxy --> oxydant number (coal)
+ * integer iprofm --> atmospheric flows: on/off for profile from data
+ * INTEGER ITYPFB --> type of boundary for each face
+ * INTEGER IZFPPP --> zone number for each boundary face
+ * INTEGER ICODCL --> boundary conditions array type
+ * DOUBLE PRECISION DTREF --> time step
+ * DOUBLE PRECISION TTCABS --> current time
+ * DOUBLE PRECISION SURFBO --> boundary faces surface
+ * DOUBLE PRECISION CGDFBO --> boundary faces center of gravity
+ * DOUBLE PRECISION QIMP --> inlet flow rate
+ * DOUBLE PRECISION QIMPAT --> inlet air flow rate (coal)
+ * DOUBLE PRECISION QIMPCP --> inlet coal flow rate (coal)
+ * DOUBLE PRECISION DH --> hydraulic diameter
+ * DOUBLE PRECISION XINTUR --> turbulent intensity
+ * DOUBLE PRECISION TIMPAT --> air temperature boundary conditions (coal)
+ * DOUBLE PRECISION TIMPCP --> inlet coal temperature (coal)
+ * DOUBLE PRECISION DISTCH --> ratio for each coal
+ * DOUBLE PRECISION RCODCL --> boundary conditions array value
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiclim, UICLIM)(const int *const ntcabs,
+ const int *const nfabor,
+ const int *const nozppm,
+ const int *const ncharm,
+ const int *const ncharb,
+ const int *const nclpch,
+ const int *const iindef,
+ const int *const ientre,
+ const int *const iparoi,
+ const int *const iparug,
+ const int *const isymet,
+ const int *const isolib,
+ int *const iqimp,
+ int *const icalke,
+ int *const ientat,
+ int *const ientcp,
+ int *const inmoxy,
+ int *const iprofm,
+ int *const itypfb,
+ int *const izfppp,
+ int *const icodcl,
+ double *const dtref,
+ double *const ttcabs,
+ double *const surfbo,
+ double *const cdgfbo,
+ double *const qimp,
+ double *const qimpat,
+ double *const qimpcp,
+ double *const dh,
+ double *const xintur,
+ double *const timpat,
+ double *const timpcp,
+ double *const distch,
+ double *const rcodcl);
+
+/*----------------------------------------------------------------------------
+ * Boundary conditions input verification
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UICLVE
+ * *****************
+ *
+ * INTEGER NFABOR --> number of boundary faces
+ * INTEGER NOZPPM --> max number of boundary conditions zone
+ * INTEGER IINDEF --> type of boundary: not defined
+ * INTEGER IENTRE --> type of boundary: inlet
+ * INTEGER IPAROI --> type of boundary: wall
+ * INTEGER IPARUG --> type of boundary: wall with rugosity
+ * INTEGER ISYMET --> type of boundary: symmetry
+ * INTEGER ISOLIB --> type of boundary: outlet
+ * INTEGER ITYPFB --> type of boundary for each face
+ * INTEGER IZFPPP --> zone number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiclve, UICLVE) (const int *const nfabor,
+ const int *const nozppm,
+ const int *const iindef,
+ const int *const ientre,
+ const int *const iparoi,
+ const int *const iparug,
+ const int *const isymet,
+ const int *const isolib,
+ int *const itypfb,
+ int *const izfppp);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return number of boundary regions definition
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_boundary_zones_number(void);
+
+/*-----------------------------------------------------------------------------
+ * Return the nature of boundary condition for the given zone
+ *----------------------------------------------------------------------------*/
+
+char *
+cs_gui_boundary_zone_nature(const int ith_zone);
+
+/*-----------------------------------------------------------------------------
+ * Return the label of boundary condition for the given zone
+ *----------------------------------------------------------------------------*/
+
+char *
+cs_gui_boundary_zone_label(const int ith_zone);
+
+/*-----------------------------------------------------------------------------
+ * Return the zone number of boundary condition for the given zone
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_boundary_zone_number(const int ith_zone);
+
+/*-----------------------------------------------------------------------------
+ * Return the description of a boundary zone
+ *
+ * parameters:
+ * label --> label of boundary zone
+ *----------------------------------------------------------------------------*/
+
+char *
+cs_gui_boundary_zone_localization(const char *const label);
+
+/*-----------------------------------------------------------------------------
+ * Helper to get the face list for the izone
+ *
+ * parameters:
+ * izone --> zone index
+ * label --> boundary label
+ * nfabor --> number of boundary faces
+ * nozppm --> max number of boundary zone for preefined physics
+ * faces <-- number of face
+ *----------------------------------------------------------------------------*/
+
+int*
+cs_gui_get_faces_list(const int izone,
+ const char *label,
+ const int nfabor,
+ const int nozppm,
+ int *faces );
+
+/*----------------------------------------------------------------------------
+ * Free memory
+ *
+ * INTEGER NCHARB --> number of coal
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_boundary_conditions_free_memory(const int *const ncharb);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_BOUNDARY_CONDITION_H__ */
diff --git a/include/base/cs_gui_matisse.h b/include/base/cs_gui_matisse.h
new file mode 100644
index 0000000..e147fdb
--- /dev/null
+++ b/include/base/cs_gui_matisse.h
@@ -0,0 +1,133 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_MATISSE_H__
+#define __CS_GUI_MATISSE_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: Matisse module
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+void CS_PROCF (csgein, CSGEIN) (int *const nptran,
+ int *const nplgrs,
+ int *const nelgrs,
+ int *const nchest,
+ int *const netran,
+ int *const itypen);
+
+void CS_PROCF (csgedb, CSGEDB) (double *const epregi,
+ double *const epchem,
+ double *const hconve,
+ double *const rconve,
+ double *const hchali,
+ double *const hcheva,
+ double *const hfttoi,
+ double *const ptrres,
+ double *const frdtra,
+ double *const plgres,
+ double *const epchel,
+ double *const dmcont);
+
+void CS_PROCF (csphdb, CSPHDB) (double *const dtdtmx,
+ double *const puicon,
+ double *const tinit,
+ double *const tcrit,
+ double *const emicon,
+ double *const emimur,
+ double *const hepcnt,
+ double *const dhpcnt,
+ double *const debmas,
+ double *const pdccha,
+ double *const pdcfch,
+ double *const dhchea,
+ double *const sdchea,
+ double *const pdcche,
+ double *const pdccch,
+ double *const dhches,
+ double *const sdches,
+ double *const pdcalg,
+ double *const pdcatv,
+ double *const argamt,
+ double *const pdcslg,
+ double *const pdcstv,
+ double *const argavl,
+ double *const amppdc,
+ double *const dhalve,
+ double *const hreso,
+ double *const hplen,
+ double *const dpvent);
+
+void CS_PROCF (csphat, CSPHAT) (int *const imdcnt,
+ int *const icofor,
+ int *const iconlg,
+ int *const ialveo);
+
+void CS_PROCF (csmtpr, CSMTPR) (int *imatis);
+
+void CS_PROCF (csnbmp, CSNBMP) (int *const direction,
+ int *const carte,
+ int *const nb);
+
+void CS_PROCF (csdfmp, CSDFMP) (int *const zone,
+ int *const direction,
+ int *const carte,
+ double *const min,
+ double *const max,
+ double *const value);
+
+void CS_PROCF (csmhdb, CSMHDB) (double *const jeuchr,
+ double *const jeurcl,
+ double *const jeuclr,
+ double *const jeurch,
+ int *const nechrg,
+ int *const nergrs,
+ int *const neclrg,
+ int *const nergch,
+ double *const hbdtoi,
+ int *const neciel);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_MATISSE_H__ */
+
+
diff --git a/include/base/cs_gui_mobile_mesh.h b/include/base/cs_gui_mobile_mesh.h
new file mode 100644
index 0000000..5568135
--- /dev/null
+++ b/include/base/cs_gui_mobile_mesh.h
@@ -0,0 +1,245 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_MOBILE_MESH_H__
+#define __CS_GUI_MOBILE_MESH_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: mobile mesh
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * ALE method.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIALIN()
+ * *****************
+ *
+ * INTEGER IALE <-- iale method activation
+ * INTEGER NALINF <-- number of subiterations of initialization of
+ * fluid
+ * INTEGER NALIMX <-- max number of iterations of implicitation of
+ * the displacement of the structures
+ * DOUBLE EPALIM <-- realtive precision of implicitation of
+ * the displacement of the structures
+ * INTEGER IORTVM <-- type of viscosity of mesh
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uialin, UIALIN) (int *const iale,
+ int *const nalinf,
+ int *const nalimx,
+ double *const epalim,
+ int *const iortvm);
+
+/*----------------------------------------------------------------------------
+ * uivima
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE uivima
+ * *****************
+ *
+ * ncel --> number of cells whithout halo
+ * viscmx <-- VISCMX
+ * viscmy <-- VISCMY
+ * viscmz <-- VISCMZ
+ * xyzcen --> cell's gravity center
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uivima, UIVIMA) ( const cs_int_t *const ncel,
+ double *const viscmx,
+ double *const viscmy,
+ double *const viscmz,
+ const double *const xyzcen,
+ double *const dtref,
+ double *const ttcabs,
+ const int *const ntcabs);
+
+/*-----------------------------------------------------------------------------
+ * uialcl
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIALCL
+ * *****************
+ *
+ *
+ * parameters:
+ * nfabor --> Number of boundary faces
+ * nozppm --> Max number of boundary conditions zone
+ * ialtyb --> ialtyb
+ * ipnfbr --> First node position for each boundary in nodfbr
+ * nnod --> number of node
+ * nodfbr --> uialcl_fixed_displacement
+ * impale --> uialcl_fixed_displacement
+ * depale --> See uialcl_fixed_displacement
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ * iuma --> See uialcl_fixed_velocity
+ * ivma --> See uialcl_fixed_velocity
+ * iwma --> See uialcl_fixed_velocity
+ * rcodcl --> See uialcl_fixed_velocity
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uialcl, UIALCL) ( const int *const nfabor,
+ const int *const nozppm,
+ const int *const ibfixe,
+ const int *const igliss,
+ const int *const ivimpo,
+ int *const ialtyb,
+ const int *const ipnfbr,
+ const int *const nnod,
+ const int *const nodfbr,
+ int *const impale,
+ double *const depale,
+ double *const dtref,
+ double *const ttcabs,
+ const int *const ntcabs,
+ const int *const iuma,
+ const int *const ivma,
+ const int *const iwma,
+ double *const rcodcl );
+
+/*-----------------------------------------------------------------------------
+ * Retreive data for internal coupling. Called once at initialization
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UISTR1
+ * *****************
+ *
+ * parameters:
+ * nfabor --> Number of boundary faces
+ * idfstr --> Structure definition
+ * aexxst <-- Displacement prediction alpha
+ * bexxst <-- Displacement prediction beta
+ * cfopre <-- Stress prediction alpha
+ * ihistr <-- Monitor point synchronisation
+ * xstr0 <-- Values of the initial displacement
+ * xstreq <-- Values of the equilibrium displacement
+ * vstr0 <-- Values of the initial velocity
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uistr1, UISTR1) ( const int *const nfabor,
+ int *const idfstr,
+ double *aexxst,
+ double *bexxst,
+ double *cfopre,
+ int *ihistr,
+ double *xstr0,
+ double *xstreq,
+ double *vstr0 );
+
+/*-----------------------------------------------------------------------------
+ * Retreive data for internal coupling. Called at each step
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UISTR2
+ * *****************
+ *
+ * parameters:
+ * xmstru <-- Mass matrix
+ * xcstr <-- Damping matrix
+ * xkstru <-- Stiffness matrix
+ * forstr <-- Fluid force matrix
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uistr2, UISTR2) ( double *const xmstru,
+ double *const xcstru,
+ double *const xkstru,
+ double *const forstr,
+ double *const dtref,
+ double *const ttcabs,
+ int *const ntcabs);
+
+/*-----------------------------------------------------------------------------
+ * Retreive data for external coupling
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIASTE
+ * *****************
+ *
+ * parameters:
+ * nfabor <-- Number of boundary faces
+ * idfstr <-- Structure definition
+ * asddlf <-- Block of the DDL forces
+ * isyncp <---
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiaste, UIASTE) (const int *const nfabor,
+ int *const idfstr,
+ double *const asddlf,
+ int *const isyncp );
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the viscosity's type of ALE method
+ *
+ * parameters:
+ * type <-- type of viscosity's type
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_get_ale_viscosity_type(int * type);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_MOBILE_MESH_H__ */
diff --git a/include/base/cs_gui_particles.h b/include/base/cs_gui_particles.h
new file mode 100644
index 0000000..f62c723
--- /dev/null
+++ b/include/base/cs_gui_particles.h
@@ -0,0 +1,231 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_PARTICLES_H__
+#define __CS_GUI_PARTICLES_H__
+
+/*============================================================================
+ * Reader of the parameters file: lagrangian particles
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from C to Fortran
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(cfname, CFNAME)
+(
+ int *const flag, /* --> flag for array = 1, 2, or 3 */
+ char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+ );
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fclag1, FCLAG1)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fclag2, FCLAG2)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fclag3, FCLAG3)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*-----------------------------------------------------------------------------
+ * Lagrangian: global settings, particles model, 2 way coupling, numerical ordering.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UILAG1
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uilag1, UILAG1) (int *const iilagr,
+ int *const isuila,
+ int *const isuist,
+ int *const nbpmax,
+ int *const isttio,
+ int *const injcon,
+ int *const iphyla,
+ int *const idpvar,
+ int *const itpvar,
+ int *const impvar,
+ int *const iencra,
+ double tprenc[],
+ double visref[],
+ double enc1[],
+ double enc2[],
+ int *const nstits,
+ int *const lstdyn,
+ int *const ltsmas,
+ int *const ltsthe,
+ int *const nordre,
+ int *const idistu,
+ int *const idiffl,
+ int *const modcpl,
+ int *const idirla,
+ int *const iensi1,
+ int *const iensi2,
+ int *const ntlal,
+ int *const nbvis,
+ int *const nvisla,
+ int *const ivisv1,
+ int *const ivisv2,
+ int *const ivistp,
+ int *const ivisdm,
+ int *const iviste,
+ int *const ivismp,
+ int *const ivishp,
+ int *const ivisdk,
+ int *const ivisch,
+ int *const ivisck,
+ int *const istala,
+ int *const nbclst,
+ double *const seuil,
+ int *const idstnt,
+ int ihslag[],
+ int *const iensi3,
+ double *const seuilf,
+ int *const nstbor,
+ int *const inbrbd,
+ int *const iflmbd,
+ int *const iangbd,
+ int *const ivitbd,
+ int *const iencbd,
+ int imoybr[]);
+
+/*-----------------------------------------------------------------------------
+ * Fortran Interface:
+ *
+ * subroutine uilag2
+ * *****************
+ *
+ * integer nfabor --> number of boundary faces
+ * integer nozppm --> max number of boundary conditions zone
+ * integer nclagm --> max number of classes
+ * integer nflagm --> max number of boundaries
+ * integer iphyla --> physica model associated to the particles
+ * integer iusncl <-- array for particles class(es) number
+ * integer iusclb <-- array for particles boundary conditions
+ * integer iuslag <-- array for integer variables
+ * double precision ruslag <-- array for real variables
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uilag2, UILAG2) (const int *const nfabor,
+ const int *const nozppm,
+ const int *const nclagm,
+ const int *const nflagm,
+ const int *const nbclst,
+ const int *const ientrl,
+ const int *const isortl,
+ const int *const idepo1,
+ const int *const idepo2,
+ const int *const idepo3,
+ const int *const idepfa,
+ const int *const iencrl,
+ const int *const irebol,
+ const int *const iphyla,
+ const int *const ijnbp,
+ const int *const ijfre,
+ const int *const iclst,
+ const int *const ijuvw,
+ const int *const iuno,
+ const int *const iupt,
+ const int *const ivpt,
+ const int *const iwpt,
+ const int *const ijprpd,
+ const int *const ipoit,
+ const int *const idebt,
+ const int *const ijprdp,
+ const int *const idpt,
+ const int *const ivdpt,
+ const int *const iropt,
+ const int *const ijprtp,
+ const int *const itpt,
+ const int *const icpt,
+ const int *const iepsi,
+ const int *const ihpt,
+ const int *const inuchl,
+ const int *const imcht,
+ const int *const imckt,
+ int ichcor[],
+ int cp2ch[],
+ int diam20[],
+ int rho0ch[],
+ int xashch[],
+ int ifrlag[],
+ int iusncl[],
+ int iusclb[],
+ int iuslag[],
+ double ruslag[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_PARTICLES_H__ */
diff --git a/include/base/cs_gui_radiative_transfer.h b/include/base/cs_gui_radiative_transfer.h
new file mode 100644
index 0000000..2ba705d
--- /dev/null
+++ b/include/base/cs_gui_radiative_transfer.h
@@ -0,0 +1,165 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_RADIATIVE_TRANSFER_H__
+#define __CS_GUI_RADIATIVE_TRANSFER_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: radiative transfer
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiray1, UIRAY1) (int *const iirayo,
+ int *const isuird,
+ int *const ndirec,
+ int *const nfreqr,
+ int *const idiver,
+ int *const iimpar,
+ int *const iimlum);
+
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fcnmra, FCNMRA)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(cfnmra, CFNMRA)
+(
+ char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+
+void CS_PROCF (uiray2, UIRAY2) (const int *const itypfb,
+ const int *const iparoi,
+ const int *const iparug,
+ const int *const ivart,
+ int *const izfrdp,
+ int *const isothp,
+ const int *const itpimp,
+ const int *const ipgrno,
+ const int *const iprefl,
+ const int *const ifgrno,
+ const int *const ifrefl,
+ const int *const nzoppm,
+ const int *const nfabor,
+ const int *const nvar,
+ double *const epsp,
+ double *const epap,
+ double *const tintp,
+ double *const textp,
+ double *const xlamp,
+ double *const rcodcl);
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+
+void CS_PROCF (uiray3, UIRAY3) ( double *const ck,
+ const int *const ncel,
+ int *const imodak);
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiray4, UIRAY4) (int *const nbrayf,
+ int *const nphas,
+ int *const iirayo,
+ int *const irayvf);
+
+/*-----------------------------------------------------------------------------
+ * Indirection between the solver numbering and the XML one
+ * for physical properties of radiative transfer
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uirapr, UIRAPR) (const int *const nprayc,
+ const int *const nprayb,
+ const int *const nphasc,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const ilumin,
+ const int *const iqx,
+ const int *const iqy,
+ const int *const iqz,
+ const int *const itsre,
+ const int *const itsri,
+ const int *const iabs,
+ const int *const iemi,
+ const int *const icak);
+
+/*-----------------------------------------------------------------------------
+ * Free memory: clean global private variables.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE MEMUI2
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (memui2, MEMUI2) (void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_RADIATIVE_TRANSFER_H__ */
diff --git a/include/base/cs_gui_specific_physics.h b/include/base/cs_gui_specific_physics.h
new file mode 100644
index 0000000..4d84cbd
--- /dev/null
+++ b/include/base/cs_gui_specific_physics.h
@@ -0,0 +1,265 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_PREDEFINED_PHYSICS_H__
+#define __CS_GUI_PREDEFINED_PHYSICS_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: specific physics
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public Fortran function prototypes
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Predefined physics indicator.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIPPMO
+ * *****************
+ *
+ * INTEGER IPPMOD <-- specific physics indicator array
+ * INTEGER ICOD3P --> diffusion flame in fast complete chemistry
+ * INTEGER ICODEQ --> diffusion flame in fast chemistry to equilibrium
+ * INTEGER ICOEBU --> Eddy Break Up premixing flame
+ * INTEGER ICOBML --> Bray - Moss - Libby premixing flame
+ * INTEGER ICOLWC --> Libby Williams premixing flame
+ * INTEGER ICP3PL --> Coal combustion. Combustible moyen local
+ * INTEGER ICPL3C --> Coal combustion coupled with lagrangien approach
+ * INTEGER ICFUEL --> Fuel combustion
+ * INTEGER IELJOU --> Joule effect
+ * INTEGER IELARC --> electrical arc
+ * INTEGER IELION --> ionique mobility
+ * INTEGER ICOMPF --> compressible without shock
+ * INTEGER IATMOS --> atmospheric flows
+ * INTEGER IAEROS --> cooling tower
+ * INTEGER INDJON --> INDJON=1: a JANAF enthalpy-temperature
+ * tabulation is used. INDJON=1: users tabulation
+ * INTEGER IEQCO2 --> CO2 massic fraction transport
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uippmo, UIPPMO) (int *const ippmod,
+ int *const icod3p,
+ int *const icodeq,
+ int *const icoebu,
+ int *const icobml,
+ int *const icolwc,
+ int *const icp3pl,
+ int *const icpl3c,
+ int *const icfuel,
+ int *const ieljou,
+ int *const ielarc,
+ int *const ielion,
+ int *const icompf,
+ int *const iatmos,
+ int *const iaeros,
+ int *const indjon,
+ int *const ieqco2);
+
+/*----------------------------------------------------------------------------
+ * Density under relaxation
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UICPI1 (SRROM)
+ * *****************
+ * DOUBLE PRECISION SRROM <-- density relaxation
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uicpi1, UICPI1) (double *const srrom);
+
+/*----------------------------------------------------------------------------
+ * Pointers definition for scalars and coal combustion
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uicpsc, UICPSC) (const int *const ncharb,
+ const int *const nclass,
+ const int *const noxyd,
+ const int *const ippmod,
+ const int *const icp3pl,
+ const int *const ieqco2,
+ const int *const ihtco2,
+ const int *const ihm,
+ const int *const inp,
+ const int *const ixch,
+ const int *const ixck,
+ const int *const ixwt,
+ const int *const ih2,
+ const int *const if1m,
+ const int *const if2m,
+ const int *const if3m,
+ const int *const if3mc2,
+ const int *const if4p2m,
+ const int *const if5m,
+ const int *const if6m,
+ const int *const if7m,
+ const int *const iyco2);
+
+/*----------------------------------------------------------------------------
+ * Defintion des pointeurs des proprietes pour le charbon
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uicppr, UICPPR) (const int *const nclass,
+ const int *const nsalpp,
+ const int *const nsalto,
+ const int *const ippmod,
+ const int *const icp3pl,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const ihtco2,
+ const int *const itemp1,
+ const int *const irom1,
+ const int *const ym1,
+ const int *const imel,
+ const int *const itemp2,
+ const int *const ix2,
+ const int *const irom2,
+ const int *const idiam2,
+ const int *const igmdch,
+ const int *const igmdv1,
+ const int *const igmdv2,
+ const int *const igmhet,
+ const int *const ighco2,
+ const int *const igmsec);
+
+/*----------------------------------------------------------------------------
+ * Atmospheric flows: read of meteorological file of data
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiati1
+ * *****************
+ * integer imeteo <-- on/off index
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiati1, UIATI1) (int *const imeteo);
+
+/*----------------------------------------------------------------------------
+ * Atmospheric flows: indirection between the solver numbering and the XML one
+ * for physical properties
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiatpr
+ * *****************
+ * integer nsalpp -->
+ * integer nsalto -->
+ * integer ippmod --> specific physics indicator array
+ * integer iatmos --> index for atmospheric flow
+ * integer ipppro -->
+ * integer ipproc -->
+ * integer itempc --> index for real temperature
+ * integer iliqwt --> index for liquid water
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiatpr, UIATPR) (const int *const nsalpp,
+ const int *const nsalto,
+ const int *const ippmod,
+ const int *const iatmos,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const itempc,
+ const int *const iliqwt);
+
+/*----------------------------------------------------------------------------
+ * Atmospheric flows: indirection between the solver numbering and the XML one
+ * for models scalars.
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiatsc
+ * *****************
+ * integer ippmod --> specific physics indicator array
+ * integer iatmos --> index for atmospheric flow
+ * integer itempp --> index for potential temperature
+ * integer itempl --> index for liquid potential temperature
+ * integer itotwt --> index for total water content
+ * integer intdrp --> index for total number of droplets
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiatsc, UIATSC) (const int *const ippmod,
+ const int *const iatmos,
+ const int *const itempp,
+ const int *const itempl,
+ const int *const itotwt,
+ const int *const intdrp);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the name of a thermophysical model.
+ *
+ * parameter:
+ * model_thermo --> thermophysical model
+ *----------------------------------------------------------------------------*/
+
+char *
+cs_gui_get_thermophysical_model(const char *const model_thermo);
+
+/*-----------------------------------------------------------------------------
+ * Modify double numerical parameters.
+ *
+ * parameters:
+ * param --> label of the numerical parameter
+ * keyword <--> value of the numerical parameter
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_numerical_double_parameters(const char *const param,
+ double *const keyword);
+
+/*-----------------------------------------------------------------------------
+ * Return if a predifined physics model is activated.
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_activ_thermophysical_model(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_PREDEFINED_PHYSICS_H__ */
diff --git a/include/base/cs_gui_util.h b/include/base/cs_gui_util.h
new file mode 100644
index 0000000..8cf3c9e
--- /dev/null
+++ b/include/base/cs_gui_util.h
@@ -0,0 +1,373 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_UTIL_H__
+#define __CS_GUI_UTIL_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: xpath request and utilities
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the information if the requested xml file is missing
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIHMP (IIHMPR)
+ * *****************
+ *
+ * INTEGER IIHMPR <-- 1 if the file exists, 0 otherwise
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (csihmp, CSIHMP) (int *const iihmpr);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Load the xml file in memory. Return an error code for the main programme.
+ *
+ * parameter:
+ * filename --> xml file containing the parameters
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_file_loading(const char *const filename);
+
+/*----------------------------------------------------------------------------
+ * Check the xml file version.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_get_version(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize the path for the xpath request with the root node.
+ * Return the root path.
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_xpath_init_path(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize the path for the xpath request with a short way.
+ * Return the short path.
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_xpath_short_path(void);
+
+/*----------------------------------------------------------------------------
+ * Add all element (*) to the path.
+ *
+ * parameter:
+ * path <--> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_all_elements(char **path);
+
+/*----------------------------------------------------------------------------
+ * Add an element (i.e. markup's label) to the path.
+ *
+ * parameter:
+ * path <--> path for the xpath request
+ * element --> label of the new element in the path
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_element( char ** path,
+ const char *const element);
+
+/*----------------------------------------------------------------------------
+ * Add a list of elements (i.e. markup's label) to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * nbr --> size of the labels list
+ * ... --> list of labels of new elements in the path
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_elements( char **path,
+ const int nbr, ...);
+
+/*----------------------------------------------------------------------------
+ * Add an element's attribute to the path.
+ *
+ * parameter:
+ * path <--> path for the xpath request
+ * attribute_name --> label of the new attribute in the path
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_attribute( char ** path,
+ const char *const attribute_name);
+
+/*----------------------------------------------------------------------------
+ * Add the i'st element to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * element --> label of the new element in the path
+ * num --> number of the element's markup
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_element_num( char ** path,
+ const char *const element,
+ const int num);
+
+/*----------------------------------------------------------------------------
+ * Add a test on a value associated to an attribute to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * attribute_type --> label of the attribute for the test in the path
+ * attribute_value --> value of the attribute for the test in the path
+ *----------------------------------------------------------------------------*/
+
+
+void
+cs_xpath_add_test_attribute( char ** path,
+ const char *const attribute_type,
+ const char *const attribute_value);
+
+/*----------------------------------------------------------------------------
+ * Add the 'text()' xpath function to the path.
+ *
+ * parameter:
+ * path <--> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_function_text(char **path);
+
+/*----------------------------------------------------------------------------
+ * Return a list of attributes nodes name from the xpath request in an array.
+ * Example: from <a attr="c"/><b attr="d"/> return {c,d}
+ *
+ * parameter:
+ * path --> path for the xpath request
+ * size <-- array size
+ *----------------------------------------------------------------------------*/
+
+char**
+cs_gui_get_attribute_values(char *const path,
+ int *const size);
+
+/*----------------------------------------------------------------------------
+ * Return the value of an element's attribute.
+ * Example: from <a b="c"/> return c
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_gui_get_attribute_value(char *const path);
+
+/*----------------------------------------------------------------------------
+ * Return a list of children nodes name from the xpath request in an array.
+ * Example: from <a>3<\a><b>4<\b> return {a,b}
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * size <-- array size
+ *----------------------------------------------------------------------------*/
+
+char**
+cs_gui_get_nodes_name(char *const path,
+ int *const size);
+
+/*----------------------------------------------------------------------------
+ * Return a single node's name from the xpath request.
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_gui_get_node_name(char *const path);
+
+/*----------------------------------------------------------------------------
+ * Return a list of children text nodes from the xpath request in an array.
+ * Example: from <a>3<\a><a>4<\a> return {3,4}
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * size <-- array size
+ *----------------------------------------------------------------------------*/
+
+char**
+cs_gui_get_text_values(char *const path,
+ int *const size);
+
+/*----------------------------------------------------------------------------
+ * Return a single children text node from the xpath request.
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_gui_get_text_value(char *const path);
+
+/*----------------------------------------------------------------------------
+ * Modify the value parameter and return 1 if the xpath request succeeded,
+ * otherwise just return 0.
+ * Example: from <a>3<\a><a>4<\a> return {3,4}
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * value <-- double result of the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_double(char *const path,
+ double *const value);
+
+/*----------------------------------------------------------------------------
+ * Modify the value parameter and return 1 if the xpath request succeeded,
+ * otherwise just return 0.
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * value <-- integer result of the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_int(char *const path,
+ int *const value);
+
+/*----------------------------------------------------------------------------
+ * Return the number of elements (i.e. the number of xml markups)
+ * from a xpath request.
+ * Example: from <a>3<\a><a>4<\a> return 2
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_nb_element(char *const path);
+
+/*----------------------------------------------------------------------------
+ * Return the integer max value from a list, which is a xpath request result.
+ * Example: from <a>3<\a><a>4<\a> return 4
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_max_value(char *const path);
+
+/*-----------------------------------------------------------------------------
+ * Evaluate the "status" attribute value.
+ * Return 1 if the xpath request has succeeded, 0 otherwise.
+ *
+ * parameter:
+ * path --> path for the xpath request
+ * result <-- status="on" return 1, status="off" return 0
+ *----------------------------------------------------------------------------*/
+
+
+int
+cs_gui_get_status(char *const path,
+ int *const result);
+
+/*-----------------------------------------------------------------------------
+ * Returns the number of markup described with a path
+ *
+ * parameters:
+ * markup --> path for the markup
+ * flag --> 1: initialize the path with the root node;
+ * 0: initialize the path with a short way
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_tag_number(const char *const markup, const int flag);
+
+/*-----------------------------------------------------------------------------
+ * Return the number of sign needed to write an integer number
+ *
+ * parameter:
+ * num --> integer number
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_characters_number(const int num);
+
+/*-----------------------------------------------------------------------------
+ * Comparison between two string: return 1 if the two string are equal, 0
+ * otherwise.
+ *
+ * parameters:
+ * s1 --> first string
+ * s2 --> second string
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_strcmp(const char *const s1,
+ const char *const s2);
+
+/*-----------------------------------------------------------------------------
+ * Copy a C string into a Fortran string.
+ *
+ * parameters:
+ * chainef <--> Fortran string
+ * chainc --> C string
+ * lstrF --> maximum length of the Fortran string
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_strcpy_c2f( char *const chainef,
+ const char *const chainec,
+ const int lstrF);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_UTIL_H__ */
diff --git a/include/base/cs_gui_variables.h b/include/base/cs_gui_variables.h
new file mode 100644
index 0000000..e6f1693
--- /dev/null
+++ b/include/base/cs_gui_variables.h
@@ -0,0 +1,103 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_GUI_VARIABLES_H__
+#define __CS_GUI_VARIABLES_H__
+
+/*============================================================================
+ * Management of the GUI parameters file: variables
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Variables and scalars management structure
+ *----------------------------------------------------------------------------*/
+
+typedef struct {
+ char *model; /* predifined physics model */
+ char *model_value; /* predifined physics model value */
+ char **head; /* name of the head */
+ char **type; /* type of markup: 'variable' or 'scalar' */
+ char **name; /* variables name and scalars label */
+ char **label; /* scalars label */
+ int *rtp; /* variables position in fortran array RTP */
+ int nvar; /* total number of variables and scalars */
+ int nscaus; /* number of user scalars */
+ int nscapp; /* number of specific physics scalars */
+ int nprop; /* number of properties */
+ int nsalpp; /* number of predifined physics properties */
+ int nprayc; /* number of cell's radiative properties */
+ int nprayb; /* number of boundary face's radiative properties */
+ int ntimaver; /* number of time averages */
+ char **properties_name; /* label of properties */
+ int *properties_ipp; /* properties position for post-processing */
+ int *propce; /* properties position in fortran array PROPCE */
+ char **b_prop_name; /* label of boundary faces properties */
+ int *b_prop_ipp; /* boundary faces prop position for post */
+ int *propfb; /* bound faces prop position in fortran array PROPFB */
+} cs_var_t;
+
+
+typedef struct {
+ int _cs_gui_max_vars;
+ int _cs_gui_last_var;
+ char **_cs_gui_var_name;
+} cs_label_t;
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+extern cs_var_t *cs_glob_var; /* Pointer to main variables structure */
+extern cs_label_t *cs_glob_label; /* Pointer to main label structure */
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_GUI_VARIABLES_H__ */
diff --git a/include/base/cs_halo.h b/include/base/cs_halo.h
new file mode 100644
index 0000000..8b80932
--- /dev/null
+++ b/include/base/cs_halo.h
@@ -0,0 +1,356 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_HALO_H__
+#define __CS_HALO_H__
+
+/*============================================================================
+ * Structure and function headers handling with ghost cells
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_periodicity.h>
+#include <fvm_interface.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Type definitions
+ *============================================================================*/
+
+/* Halo type */
+
+typedef enum {
+
+ CS_HALO_STANDARD,
+ CS_HALO_EXTENDED,
+ CS_HALO_N_TYPES
+
+} cs_halo_type_t;
+
+/* Options for cs_halo_sync_component(). */
+
+typedef enum {
+
+ CS_HALO_ROTATION_COPY, /* Copy halo */
+ CS_HALO_ROTATION_ZERO, /* Set rotation halo values to zero */
+ CS_HALO_ROTATION_IGNORE /* Do not modify rotation halo values */
+
+} cs_halo_rotation_t ;
+
+
+/*============================================================================
+ * Type definition
+ *============================================================================*/
+
+/* Structure for halo management */
+/* ----------------------------- */
+
+typedef struct {
+
+ int n_c_domains; /* Number of communicating domains. */
+ int n_transforms; /* Number of periodic transformations */
+
+ int *c_domain_rank; /* List of communicating ranks */
+
+ const fvm_periodicity_t * periodicity; /* Pointer to periodicity
+ structure describing transforms */
+
+ int n_rotations; /* Number of periodic transformations
+ involving rotations */
+
+ cs_int_t n_local_elts; /* Number of local elements */
+
+ /* send_halo features : send to distant ranks */
+
+ cs_int_t n_send_elts[2]; /* Numer of ghost elements in send_list
+ n_elts[0] = standard elements
+ n_elts[1] = extended + standard elements */
+
+ cs_int_t *send_list; /* List of local elements in distant halos
+ (0 to n-1 numbering) */
+
+ cs_int_t *send_index; /* Index on send_list
+ Size = 2*n_c_domains + 1. For each rank, we
+ have an index for standard halo and one
+ for extended halo. */
+
+ cs_int_t *send_perio_lst ; /* For each transformation and for each type of
+ halo on each communicating rank, we store
+ 2 values:
+ - start index,
+ - number of elements. */
+
+ /* halo features : receive from distant ranks */
+
+ cs_int_t n_elts[2]; /* Numer of ghost elements in halo
+ n_elts[0] = standard elements
+ n_elts[1] = extended + standard elements */
+
+ cs_int_t *index; /* Index on halo sections;
+ Size = 2*n_c_domains. For each rank, we
+ have an index for the standard halo and one
+ for the extended halo. */
+
+ cs_int_t *perio_lst; /* For each transformation and for each type of halo
+ on each communicating rank, we store 2 values:
+ - start index,
+ - number of elements. */
+
+ /* Organisation of perio_lst:
+
+ -------------------------------------------------
+ T1: | | | | | | | | | | | | |
+ -------------------------------------------------
+ idx n idx n idx n idx n idx n idx n
+ ______ ______ ______ ______ ______ ______
+ std ext std ext std ext
+ ___________ ___________ ___________
+ rank 0 rank 1 rank 2
+
+ -------------------------------------------------
+ T2: | | | | | | | | | | | | |
+ -------------------------------------------------
+ idx n idx n idx n idx n idx n idx n
+ ______ ______ ______ ______ ______ ______
+ std ext std ext std ext
+ ___________ ___________ ___________
+ rank 0 rank 1 rank 2
+
+ -------------------------------------------------
+ T3: | | | | | | | | | | | | |
+ -------------------------------------------------
+ idx n idx n idx n idx n idx n idx n
+ ______ ______ ______ ______ ______ ______
+ std ext std ext std ext
+ ___________ ___________ ___________
+ rank 0 rank 1 rank 2
+
+ etc...
+
+ */
+
+} cs_halo_t;
+
+/*=============================================================================
+ * Global static variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public function header for Fortran API
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a halo structure.
+ *
+ * parameters:
+ * ifs --> pointer to a fvm_interface_set structure
+ *
+ * returns:
+ * pointer to created cs_halo_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_halo_t *
+cs_halo_create(fvm_interface_set_t *ifs);
+
+/*----------------------------------------------------------------------------
+ * Create a halo structure, using a reference halo
+ *
+ * parameters:
+ * ref --> pointer to reference halo
+ *
+ * returns:
+ * pointer to created cs_halo_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_halo_t *
+cs_halo_create_from_ref(const cs_halo_t *ref);
+
+/*----------------------------------------------------------------------------
+ * Destroy a halo structure.
+ *
+ * parameters:
+ * this_halo --> pointer to cs_halo structure to destroy
+ *
+ * returns:
+ * pointer to deleted halo structure (NULL)
+ *---------------------------------------------------------------------------*/
+
+cs_halo_t *
+cs_halo_destroy(cs_halo_t *this_halo);
+
+/*----------------------------------------------------------------------------
+ * Update global buffer sizes so as to be usable with a given halo.
+ *
+ * Calls to halo synchronizations with variable strides up to 3 are
+ * expected. For strides greater than 3, the halo will be resized if
+ * necessary directly by the synchronization function.
+ *
+ * This function should be called at the end of any halo creation,
+ * so that buffer sizes are increased if necessary.
+ *
+ * parameters:
+ * halo --> pointer to cs_halo_t structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_halo_update_buffers(const cs_halo_t *halo);
+
+/*----------------------------------------------------------------------------
+ * Apply cell renumbering to a halo
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * new_cell_id --> array indicating old -> new cell id (0 to n-1)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_halo_renumber_cells(cs_halo_t *halo,
+ const cs_int_t new_cell_id[]);
+
+/*----------------------------------------------------------------------------
+ * Update array of integer halo values in case of parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * num <-> pointer to local number value array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_num(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_int_t num[]);
+
+/*----------------------------------------------------------------------------
+ * Update array of variable (floating-point) halo values in case of
+ * parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * var <-> pointer to variable value array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_var(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var[]);
+
+/*----------------------------------------------------------------------------
+ * Update array of strided variable (floating-point) halo values in case
+ * of parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * var <-> pointer to variable value array
+ * stride --> number of (interlaced) values by entity
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_var_strided(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var[],
+ int stride);
+
+/*----------------------------------------------------------------------------
+ * Update array of vector variable component (floating-point) halo values
+ * in case of parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * If rotation_op is equal to CS_HALO_ROTATION_IGNORE, halo values
+ * corresponding to periodicity with rotation are left unchanged from their
+ * previous values.
+ *
+ * If rotation_op is equal to CS_HALO_ROTATION_ZERO, halo values
+ * corresponding to periodicity with rotation are set to 0.
+ *
+ * If rotation_op is equal to CS_HALO_ROTATION_COPY, halo values
+ * corresponding to periodicity with rotation are exchanged normally, so
+ * the behavior is the same as that of cs_halo_sync_var().
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * var <-> pointer to variable value array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_component(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_halo_rotation_t rotation_op,
+ cs_real_t var[]);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_halo_t structure.
+ *
+ * parameters:
+ * halo --> pointer to cs_halo_t struture
+ * print_level --> 0 only dimensions and indexes are printed, else (1)
+ * everything is printed
+ *---------------------------------------------------------------------------*/
+
+void
+cs_halo_dump(const cs_halo_t *halo,
+ cs_int_t print_level);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_HALO_H__ */
diff --git a/include/base/cs_io.h b/include/base/cs_io.h
new file mode 100644
index 0000000..55abc01
--- /dev/null
+++ b/include/base/cs_io.h
@@ -0,0 +1,545 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_IO_H__
+#define __CS_IO_H__
+
+/*============================================================================
+ * Low level file I/O utility functions for Preprocessor and restart files
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+#include <fvm_file.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define CS_IO_NAME_LEN 32 /* Section header name length */
+
+#define CS_IO_ECHO_NONE -2 /* No verbosity at all */
+#define CS_IO_ECHO_OPEN_CLOSE -1 /* Echo open or close operations */
+#define CS_IO_ECHO_HEADERS 0 /* Echo headers */
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/* Input or output mode */
+
+ typedef enum {
+
+ CS_IO_MODE_READ,
+ CS_IO_MODE_WRITE
+
+} cs_io_mode_t;
+
+/* Structure associated with opaque pre-processing structure object */
+
+typedef struct _cs_io_t cs_io_t;
+
+/* Structure used to save section header data, so as to simplify
+ passing this data to various functions */
+
+typedef struct {
+
+ const char *sec_name; /* Pointer to section name */
+ fvm_file_off_t n_vals; /* Number of associated values */
+ size_t location_id; /* Id of associated location, or 0 */
+ size_t index_id; /* Id of associated index, or 0 */
+ size_t n_location_vals; /* Number of values per location */
+ fvm_datatype_t elt_type; /* Type if n_elts > 0 */
+ fvm_datatype_t type_read; /* Type in file */
+
+} cs_io_sec_header_t;
+
+/*=============================================================================
+ * Global variables
+ *============================================================================*/
+
+/* Default hints for files using this API (for MPI-IO) */
+
+extern int cs_glob_io_hints;
+
+/* Global structure associated with pre-processor output (kernel input) file */
+
+extern cs_io_t *cs_glob_pp_io;
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Set the default kernel IO hints to the specified value.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE IOHINT (IHINT)
+ * *****************
+ *
+ * INTEGER IHINT : <-> : IO hints (bit mask)
+ * 0: default
+ * 1: disable MPI IO
+ * 4: MPI IO uses explicit offsets
+ * 8: MPI IO uses individual pointers
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (iohint, IOHINT) (const cs_int_t *iopt);
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a kernel IO file structure.
+ *
+ * The magic string may be NULL only in read mode;
+ *
+ * If the position of section bodies is already known (after initial
+ * analysis for example), the file may be opened for reading section bodies
+ * only by using "seek_read_section_bodies_only" as a magic string. This may
+ * be used to map another type of file to kernel io files, if header data is
+ * different but body data is similar (binary, using the same datatypes).
+ *
+ * parameters:
+ * name <-- file name
+ * magic_string <-- magic string associated with file type, or NULL
+ * mode <-- read or write
+ * hints <-- optional flags for file access method (see fvm_file.h)
+ * echo <-- echo on main output (< 0 if none, header if 0,
+ * n first and last elements if n > 0)
+ * comm <-- associated MPI communicator
+ *
+ * returns:
+ * pointer to kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+
+cs_io_t *
+cs_io_initialize(const char *file_name,
+ const char *magic_string,
+ cs_io_mode_t mode,
+ int hints,
+ long echo,
+ MPI_Comm comm);
+
+#else
+
+cs_io_t *
+cs_io_initialize(const char *file_name,
+ const char *magic_string,
+ cs_io_mode_t mode,
+ int hints,
+ long echo);
+
+#endif /* FVM_HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Initialize a kernel IO file structure in read mode, building an index.
+ *
+ * The magic string may be NULL, if we choose to ignore it.
+ *
+ * parameters:
+ * name <-- file name
+ * magic_string <-- magic string associated with file type
+ * hints <-- optional flags for file access method (see fvm_file.h)
+ * echo <-- echo on main output (< 0 if none, header if 0,
+ * n first and last elements if n > 0)
+ * comm <-- associated MPI communicator
+ *
+ * returns:
+ * pointer to kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+
+cs_io_t *
+cs_io_initialize_with_index(const char *file_name,
+ const char *magic_string,
+ int hints,
+ long echo,
+ MPI_Comm comm);
+
+#else
+
+cs_io_t *
+cs_io_initialize_with_index(const char *file_name,
+ const char *magic_string,
+ int hints,
+ long echo);
+
+#endif /* FVM_HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Free a preprocessor output file structure, closing the associated file.
+ *
+ * parameters:
+ * pp_io <-> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_finalize(cs_io_t **pp_io);
+
+/*----------------------------------------------------------------------------
+ * Return a pointer to a preprocessor IO structure's name.
+ *
+ * parameters:
+ * pp_io <-- kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+const char *
+cs_io_get_name(const cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Return the number of indexed entries in a kernel IO structure.
+ *
+ * parameters:
+ * inp <-- input kernel IO structure
+ *
+ * returns:
+ * size of index if present, 0 otherwise,
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_io_get_index_size(const cs_io_t *inp);
+
+/*----------------------------------------------------------------------------
+ * Return the name of an indexed section in a kernel IO structure.
+ *
+ * parameters:
+ * inp <-- input kernel IO structure
+ * id <-- id of section in index (0 to n-1 numbering)
+ *
+ * returns:
+ * pointer to section name if id in index range, NULL otherwise
+ *----------------------------------------------------------------------------*/
+
+const char *
+cs_io_get_indexed_sec_name(const cs_io_t *inp,
+ size_t id);
+
+/*----------------------------------------------------------------------------
+ * Return header data for an indexed section in a kernel IO structure.
+ *
+ * parameters:
+ * inp <-- input kernel IO structure
+ * id <-- id of section in index (0 to n-1 numbering)
+ *
+ * returns:
+ * section header data (if id not in index range, fields set to zero)
+ *----------------------------------------------------------------------------*/
+
+cs_io_sec_header_t
+cs_io_get_indexed_sec_header(const cs_io_t *inp,
+ size_t id);
+
+/*----------------------------------------------------------------------------
+ * Return a kernel IO structure's echo (verbosity) level.
+ *
+ * parameters:
+ * pp_io <-- kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_io_get_echo(const cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Read a message header.
+ *
+ * parameters:
+ * pp_io <-- kernel IO structure
+ * header --> header structure
+ *
+ * returns:
+ * 0 if a header was read, 1 in case of error or end-of-file
+ *----------------------------------------------------------------------------*/
+
+int
+cs_io_read_header(cs_io_t *inp,
+ cs_io_sec_header_t *header);
+
+/*----------------------------------------------------------------------------
+ * Set a kernel IO's state so as to be ready to read an indexed section.
+ *
+ * The header values and position in the file are set so as to be equivalent
+ * to those they would have if the corresponding header had just been read.
+ *
+ * parameters:
+ * inp <-> input kernel IO structure
+ * header --> associated header
+ * id <-- id of section in index (0 to n-1 numbering)
+ *
+ * returns:
+ * 0 in case of success, 1 in case of error
+ *----------------------------------------------------------------------------*/
+
+int
+cs_io_set_indexed_position(cs_io_t *inp,
+ cs_io_sec_header_t *header,
+ size_t id);
+
+/*----------------------------------------------------------------------------
+ * Set a message's final data type to fvm_lnum_t.
+ *
+ * It the datatype is not compatible, throw an error.
+ *
+ * parameters:
+ * header <-- header structure
+ * pp_io --> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_set_fvm_lnum(cs_io_sec_header_t *header,
+ const cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Set a message's final data type to fvm_gnum_t.
+ *
+ * It the datatype is not compatible, throw an error.
+ *
+ * parameters:
+ * header <-> header structure
+ * pp_io <-- kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_set_fvm_gnum(cs_io_sec_header_t *header,
+ const cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Check that a message's final data type corresponds to cs_real_t.
+ *
+ * parameters:
+ * header <-- header structure
+ * pp_io <-- kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_assert_cs_real(const cs_io_sec_header_t *header,
+ const cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Read a message body and replicate it to all processors.
+ *
+ * If the array intended to receive the data already exists, we pass an
+ * "elt" pointer to this array; this same pointer is then returned.
+ * Otherwise, if this pointer is passed as NULL, memory is allocated
+ * by this function, and the corresponding pointer is returned. It is
+ * the caller's responsibility to free this array.
+ *
+ * parameters:
+ * header <-- header structure
+ * elts <-> pointer to data array, or NULL
+ * pp_io --> kernel IO structure
+ *
+ * returns:
+ * elts if non NULL, or pointer to allocated array otherwise
+ *----------------------------------------------------------------------------*/
+
+void *
+cs_io_read_global(const cs_io_sec_header_t *header,
+ void *elts,
+ cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Read a message body, assigning a different block to each processor.
+ *
+ * If location_id > 0 and header->n_location_vals > 1, then
+ * global_num_start and global_num_end will be based on location element
+ * numbers, so the total number of values read equals
+ * (global_num_end - global_num_start) * header->n_location_vals.
+ *
+ * If the array intended to receive the data already exists, we pass an
+ * "elt" pointer to this array; this same pointer is then returned.
+ * Otherwise, if this pointer is passed as NULL, memory is allocated
+ * by this function, and the corresponding pointer is returned. It is
+ * the caller's responsibility to free this array.
+ *
+ * parameters:
+ * header <-- header structure
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * (1 to n numbering)
+ * elts <-> pointer to data array, or NULL
+ * pp_io --> kernel IO structure
+ *
+ * returns:
+ * elts if non NULL, or pointer to allocated array otherwise
+ *----------------------------------------------------------------------------*/
+
+void *
+cs_io_read_block(const cs_io_sec_header_t *header,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ void *elts,
+ cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Read a message body, assigning a different block to each processor,
+ * when the body corresponds to an index.
+ *
+ * In serial mode, this function behaves just like cs_io_read_block(),
+ * except that it allows only unsigned integer values (fvm_gnum_t).
+ *
+ * In parallel mode, global_num_end should be set to the past-the-end value
+ * of the base data block, the same as for regular data (and not increased
+ * by 1 for the last rank, as this will be handled internally).
+ * On each rank, the buffer size should be:
+ * global_num_end - global_num_start + 1, as the past-the end index
+ * for the local block is added automatically.
+ *
+ * If the array intended to receive the data already exists, we pass an
+ * "elt" pointer to this array; this same pointer is then returned.
+ * Otherwise, if this pointer is passed as NULL, memory is allocated
+ * by this function, and the corresponding pointer is returned. It is
+ * the caller's responsibility to free this array.
+ *
+ * parameters:
+ * header <-- header structure
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * (1 to n numbering)
+ * elts <-> pointer to data array, or NULL
+ * pp_io --> kernel IO structure
+ *
+ * returns:
+ * elts if non NULL, or pointer to allocated array otherwise
+ *----------------------------------------------------------------------------*/
+
+void *
+cs_io_read_index_block(cs_io_sec_header_t *header,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ fvm_gnum_t *elts,
+ cs_io_t *pp_io);
+
+/*----------------------------------------------------------------------------
+ * Write a global section.
+ *
+ * Under MPI, data is only written by the associated communicator's root
+ * rank. The section data on other ranks is ignored, though the file offset
+ * is updated (i.e. the call to this function is collective).
+ *
+ * parameters:
+ * section_name <-- section name
+ * n_vals <-- total number of values
+ * location_id <-- id of associated location, or 0
+ * index_id <-- id of associated index, or 0
+ * n_location_vals <-- number of values per location
+ * elt_type <-- element type
+ * elts <-- pointer to element data
+ * outp <-> output kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_write_global(const char *sec_name,
+ fvm_gnum_t n_vals,
+ size_t location_id,
+ size_t index_id,
+ size_t n_location_vals,
+ fvm_datatype_t elt_type,
+ const void *elts,
+ cs_io_t *outp);
+
+/*----------------------------------------------------------------------------
+ * Write a section to file, each associated process providing a contiguous
+ * of the section's body.
+ *
+ * Each process should provide a (possibly empty) block of the body,
+ * and we should have:
+ * global_num_start at rank 0 = 1
+ * global_num_start at rank i+1 = global_num_end at rank i.
+ * Otherwise, behavior (especially positioning for future reads) is undefined.
+ *
+ * If location_id > 0 and n_location_vals > 1, then global_num_start
+ * and global_num_end will be based on location element numbers, so the
+ * total number of values read equals
+ * (global_num_end - global_num_start) * header->n_location_vals.
+ *
+ * This function is intended to be used mainly data that is already of
+ * copy of original data (such as data that has been redistributed across
+ * processors just for the sake of output), or that is to be deleted after
+ * writing, so it may modify the values in its input buffer (notably to
+ * convert from little-endian to big-endian of vice-versa if necessary).
+ *
+ * parameters:
+ * section_name <-- section name
+ * n_g_elts <-- number of global elements (locations)
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * location_id <-- id of associated location, or 0
+ * index_id <-- id of associated index, or 0
+ * n_location_vals <-- number of values per location
+ * elt_type <-- element type
+ * (1 to n numbering)
+ * elts <-- pointer to element data
+ * outp <-> output kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_write_block_buffer(const char *sec_name,
+ fvm_gnum_t n_g_elts,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ size_t location_id,
+ size_t index_id,
+ size_t n_location_vals,
+ fvm_datatype_t elt_type,
+ void *elts,
+ cs_io_t *outp);
+
+/*----------------------------------------------------------------------------
+ * Dump a kernel IO file handle's metadata.
+ *
+ * parameters:
+ * cs_io <-- kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_dump(const cs_io_t *cs_io);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_IO_H__ */
diff --git a/include/base/cs_join.h b/include/base/cs_join.h
new file mode 100644
index 0000000..39aea5a
--- /dev/null
+++ b/include/base/cs_join.h
@@ -0,0 +1,144 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_JOIN_H__
+#define __CS_JOIN_H__
+
+/*============================================================================
+ * Structure and function headers handling with ghost cells
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Type definition
+ *===========================================================================*/
+
+/*=============================================================================
+ * Global variables
+ *===========================================================================*/
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define new boundary faces joining.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE DEFJO1
+ * *****************
+ *
+ * CHARACTER* joining_criteria : <-- : boundary face selection criteria,
+ * REAL fraction : <-- : parameter for merging vertices
+ * REAL plane : <-- : parameter for splitting faces
+ * REAL rtf : <-- : reduction of tolerance factor
+ * REAL mtf : <-- : merge tolerance coefficient
+ * REAL etf : <-- : equivalence tolerance coefficient
+ * INTEGER verbosity : <-- : verbosity level
+ * INTEGER joining_c_len : <-- : length of joining_criteria
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(defjo1, DEFJO1)
+(
+ const char *joining_criteria,
+ cs_real_t *fraction,
+ cs_real_t *plane,
+ cs_real_t *rtf,
+ cs_real_t *mtf,
+ cs_real_t *etf,
+ cs_int_t *verbosity,
+ cs_int_t *joining_c_len
+ CS_ARGF_SUPP_CHAINE
+ );
+
+/*=============================================================================
+ * Public function prototypes
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create and initialize a cs_join_t structure.
+ *
+ * parameters:
+ * sel_criteria <-- boundary face selection criteria
+ * fraction <-- value of the fraction parameter
+ * plane <-- value of the plane parameter
+ * rtf <-- value of the "reduction tolerance factor" parameter
+ * mtf <-- value of the "merge tolerance factor" parameter
+ * etf <-- value of the "edge equiv. tolerance factor" parameter
+ * max_sub_faces <-- value of the max_sub_faces
+ * tml <-- value of the "tree max level" parameter
+ * tmb <-- value of the "tree max boxes" parameter
+ * tmr <-- value of the "tree max ratio" parameter
+ * verbosity <-- level of verbosity required
+ *
+ * returns:
+ * a pointer to a cs_join_t structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_add(char *sel_criteria,
+ float fraction,
+ float plane,
+ float rtf,
+ float mtf,
+ float etf,
+ int max_sub_faces,
+ int tml,
+ int tmb,
+ float tmr,
+ int verbosity);
+
+/*----------------------------------------------------------------------------
+ * Apply all the defined joining operations.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_all(void);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_H__ */
diff --git a/include/base/cs_join_intersect.h b/include/base/cs_join_intersect.h
new file mode 100644
index 0000000..511a24f
--- /dev/null
+++ b/include/base/cs_join_intersect.h
@@ -0,0 +1,345 @@
+
+/*
+ This file is part of the "Finite Volume Mesh" library, intended to provide
+ finite volume mesh and associated fields I/O and manipulation services.
+
+ Copyright (C) 2008-2009 EDF
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef __CS_JOIN_INTERSECT_H__
+#define __CS_JOIN_INTERSECT_H__
+
+/*============================================================================
+ * Set of subroutines for finding intersections between bounding boxes
+ * - on faces
+ * - on edges
+ *===========================================================================*/
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local library headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_join_mesh.h"
+#include "cs_join_set.h"
+#include "cs_join_util.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/* Definition of a structure defining an intersection */
+/* -------------------------------------------------- */
+
+typedef struct {
+
+ cs_int_t edge_id; /* id of the edge implied in this intersection */
+ cs_int_t vtx_id; /* id of the vertex resulting of the intersection */
+ float curv_abs; /* curvilinear abscissa of the intersection */
+
+} cs_join_inter_t;
+
+/* Definition of a structure defining a set of intersections */
+/* --------------------------------------------------------- */
+
+typedef struct {
+
+ cs_int_t n_max_inter; /* max. number of intersections allocated */
+ cs_int_t n_inter; /* number of intersections */
+
+ cs_join_inter_t *inter_lst; /* size = 2 * n_intersections
+ one inter_t structure for each edge
+ implied in an intersection */
+
+} cs_join_inter_set_t;
+
+/* Definition of a structure defining a set of intersections on edges */
+/* ------------------------------------------------------------------ */
+
+typedef struct {
+
+ cs_int_t n_edges; /* Number of edges implied in an intersection */
+
+ fvm_gnum_t *edge_gnum; /* Global number of the related edges */
+ cs_int_t *index; /* Indexed list of vertex num describing
+ intersections on a given edge without
+ vertices at the extremity and ordered
+ by curvilinear abscissa */
+
+ cs_int_t *vtx_lst; /* List of new vertex num */
+ fvm_gnum_t *vtx_glst; /* List of new vertex global num */
+ float *abs_lst; /* List of curvilinear abscissa */
+
+ cs_int_t max_sub_size;
+
+} cs_join_inter_edges_t;
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a new cs_join_inter_set_t structure.
+ *
+ * parameters:
+ * init_size <-- number of init. cs_join_inter_t structure to allocate
+ *
+ * returns:
+ * a pointer to a new inter_set_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_set_t *
+cs_join_inter_set_create(cs_int_t init_size);
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_inter_set_t structure.
+ *
+ * parameter:
+ * inter_set <-- a pointer to the inter_set_t structure to destroy
+ *
+ * returns:
+ * a NULL pointer.
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_set_t *
+cs_join_inter_set_destroy(cs_join_inter_set_t *inter_set);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_inter_set_t structure.
+ *
+ * parameters:
+ * i_set <-- cs_join_inter_set_t structure to dump
+ * edges <-- associated cs_join_edge_t structure
+ * mesh <-- associated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_inter_set_dump(const cs_join_inter_set_t *i_set,
+ const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Allocate and initialize a new cs_join_inter_edges_t structure.
+ *
+ * parameters:
+ * n_edges <-- number of edges
+ *
+ * returns:
+ * a pointer to the created cs_join_inter_edges_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_create(cs_int_t n_edges);
+
+/*----------------------------------------------------------------------------
+ * Build a cs_join_inter_edges_t structure (useful to find equivalence on
+ * edges and to apply vertex merge to a cs_join_mesh_t structure).
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure
+ * inter_set <-- structure storing data on edge intersections
+ *
+ * returns:
+ * a pointer to the created cs_join_inter_edges_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_define(const cs_join_edges_t *edges,
+ const cs_join_inter_set_t *inter_set);
+
+/*----------------------------------------------------------------------------
+ * Destroy an cs_join_inter_edges_t structure.
+ *
+ * parameters:
+ * inter_edges <-- cs_join_inter_edges_t structure to dump
+ *
+ * returns:
+ * a NULL pointer
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_destroy(cs_join_inter_edges_t *inter_edges);
+
+/*----------------------------------------------------------------------------
+ * Find non-trivial equivalences between vertices sharing the same edges.
+ *
+ * For instance an equivalence between a vertex from the extremity of an edge
+ * and a vertex created by an edge-edge intersection.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter
+ * mesh <-- pointer to the local cs_join_mesh_t structure
+ * which has initial vertex data
+ * edges <-- list of edges
+ * inter_edges <-- structure including data on edge intersections
+ * vtx_equiv <-> structure dealing with vertex equivalences
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_add_equiv_from_edges(const cs_join_param_t param,
+ const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_join_inter_edges_t *inter_edges,
+ cs_join_eset_t *vtx_equiv);
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Synchronize the definition of intersections on each edge by block.
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure
+ * mesh <-- cs_join_mesh_t structure
+ * part <-- structure storing data on edge intersections by partition
+ *
+ * returns:
+ * newly allocated cs_join_inter_edges_t, synchronized and defined on
+ * a block
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_part_to_block(const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_join_inter_edges_t *part);
+
+/*----------------------------------------------------------------------------
+ * Synchronize the definition of intersections on each edge from a
+ * cs_join_inter_edges_t structure defined on a block.
+ *
+ * parameters:
+ * n_g_egdes <-- global number of edges
+ * block <-- synchronized cs_join_inter_edges_t struct. by block
+ * part <-> cs_join_inter_edges_t to synchronized on partition
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_inter_edges_block_to_part(fvm_gnum_t n_g_edges,
+ const cs_join_inter_edges_t *block,
+ cs_join_inter_edges_t *part);
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Redefine a cs_join_inter_edges_t structure to be consistent with the local
+ * numbering of a given couple of cs_join_mesh_t structure and
+ * cs_join_edges_t structure.
+ * Add future new vertices for the face definition in cs_join_mesh_t
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure
+ * mesh <-> cs_join_mesh_t structure
+ * inter_edges <-> current cs_join_inter_edges_t struct. to work with
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_intersect_update_struct(const cs_join_edges_t *edges,
+ cs_join_mesh_t *mesh,
+ cs_join_inter_edges_t **inter_edges);
+
+/*----------------------------------------------------------------------------
+ * Get all real edges intersections among possible edges intersections.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters for the joining
+ * edge_edge_vis <-- a pointer to a cs_join_gset_t structure
+ * edges <-- pointer to a structure defining edges
+ * mesh <-- pointer to the cs_join_mesh_t structure
+ * which has the face connectivity
+ * inter_set <-> pointer to a structure including data on edge
+ * intersections
+ * vtx_eset <-> pointer to a structure dealing with vertex
+ * equivalences
+ *
+ * returns:
+ * the type of joining encountered (conforming or not)
+ *---------------------------------------------------------------------------*/
+
+cs_join_type_t
+cs_join_intersect_edges(cs_join_param_t param,
+ const cs_join_gset_t *edge_edge_vis,
+ const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh,
+ cs_join_eset_t **vtx_eset,
+ cs_join_inter_set_t **inter_set);
+
+/*----------------------------------------------------------------------------
+ * Build a tree structure on which we associate leaves and face bounding boxes.
+ * Create a cs_join_gset_t structure (indexed list on global numbering)
+ * storing potential intersections between face bounding boxes.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter
+ * mesh <-- cs_join_mesh_t structure where faces are defined
+ *
+ * returns:
+ * a new allocated pointer to a cs_join_gset_t structure storing the
+ * face - face visibility.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_intersect_faces(const cs_join_param_t param,
+ const cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Transform face visibility into edge visibility.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ * edges <-- pointer to a cs_join_edges_t structure
+ * face_visib <-- pointer to a cs_join_gset_t structure
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure holding edge visibility
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_intersect_face_to_edge(const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_join_gset_t *face_visib);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_inter_edges_t structure.
+ *
+ * parameters:
+ * inter_edges <-- cs_join_inter_edges_t structure to dump
+ * edges <-- list of edges
+ * mesh <-- associated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_inter_edges_dump(const cs_join_inter_edges_t *inter_edges,
+ const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_INTERSECT_H__ */
diff --git a/include/base/cs_join_merge.h b/include/base/cs_join_merge.h
new file mode 100644
index 0000000..6e2c48b
--- /dev/null
+++ b/include/base/cs_join_merge.h
@@ -0,0 +1,152 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+#ifndef __CS_JOIN_MERGE_H__
+#define __CS_JOIN_MERGE_H__
+
+/*============================================================================
+ * Set of subroutines for:
+ * - fusing equivalent vertices,
+ * - managing tolerance reduction,
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_join_intersect.h"
+#include "cs_join_mesh.h"
+#include "cs_join_set.h"
+#include "cs_join_util.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Creation of new vertices.
+ *
+ * Update list of equivalent vertices, and assign a vertex (existing or
+ * newly created) to each intersection.
+ *
+ * parameters:
+ * verbosity <-- verbosity level
+ * edges <-- list of edges
+ * work <-> joining mesh maintaining initial vertex data
+ * inter_set <-> cs_join_inter_set_t structure including
+ * data on edge-edge intersections
+ * n_g_vertices <-- global number of vertices (initial parent mesh)
+ * p_n_g_new_vertices <-> pointer to the global number of new vertices
+ * p_vtx_eset <-> pointer to a structure dealing with vertex
+ * equivalences
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_create_new_vertices(int verbosity,
+ const cs_join_edges_t *edges,
+ cs_join_mesh_t *work,
+ cs_join_inter_set_t *inter_set,
+ fvm_gnum_t n_g_vertices,
+ fvm_gnum_t *p_n_g_new_vertices,
+ cs_join_eset_t **p_vtx_eset);
+
+/*----------------------------------------------------------------------------
+ * Merge of equivalent vertices (and tolerance reduction if necessary)
+ *
+ * Define a new cs_join_vertex_t structure (stored in "work" structure).
+ * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters for the joining
+ * n_g_vertices_tot <-- global number of vertices (initial parent mesh)
+ * work <-> pointer to a cs_join_mesh_t structure
+ * vtx_eset <-- structure storing equivalences between vertices
+ * (two vertices are equivalent if they are within
+ * each other's tolerance)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_merge_vertices(cs_join_param_t param,
+ fvm_gnum_t n_g_vertices_tot,
+ cs_join_mesh_t *work,
+ const cs_join_eset_t *vtx_eset);
+
+/*----------------------------------------------------------------------------
+ * Merge of equivalent vertices (and reduction of tolerance if necessary)
+ *
+ * Define a new cs_join_vertex_t structure (stored in "work" structure)
+ * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters for the joining
+ * n_iwm_vertices <-- initial number of vertices (work mesh struct.)
+ * n_g_ifm_vertices <-- initial global number of vertices (full mesh)
+ * iwm_vtx_gnum <-- initial global vertex num. (work mesh struct)
+ * rank_face_gnum_index <-- index on face global numbering to determine
+ * the related rank
+ * p_mesh <-> pointer to cs_join_mesh_t structure
+ * p_edges <-> pointer to cs_join_edges_t structure
+ * p_inter_edges <-> pointer to a cs_join_inter_edges_t struct.
+ * p_local_mesh <-> pointer to a cs_join_mesh_t structure
+ * p_o2n_vtx_gnum --> array on blocks on the new global vertex
+ * numbering for the init. vertices (before inter.)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_merge_update_struct(cs_join_param_t param,
+ cs_int_t n_iwm_vertices,
+ fvm_gnum_t n_g_ifm_vertices,
+ const fvm_gnum_t iwm_vtx_gnum[],
+ const fvm_gnum_t rank_face_gnum_index[],
+ cs_join_mesh_t **p_mesh,
+ cs_join_edges_t **p_edges,
+ cs_join_inter_edges_t **p_inter_edges,
+ cs_join_mesh_t **p_local_mesh,
+ fvm_gnum_t *p_o2n_vtx_gnum[]);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_MERGE_H__ */
diff --git a/include/base/cs_join_mesh.h b/include/base/cs_join_mesh.h
new file mode 100644
index 0000000..3d04881
--- /dev/null
+++ b/include/base/cs_join_mesh.h
@@ -0,0 +1,509 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+#ifndef __CS_JOIN_MESH_H__
+#define __CS_JOIN_MESH_H__
+
+/*============================================================================
+ * Subroutines useful to manipulate a cs_join_mesh_t structure
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local library headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+typedef enum {
+
+ CS_JOIN_FACE_UNDEFINED,
+ CS_JOIN_FACE_BORDER,
+ CS_JOIN_FACE_INTERIOR
+
+} cs_join_face_type_t;
+
+typedef struct {
+
+ double tolerance; /* Tolerance = radius of the sphere in which
+ intersection and merge is possible. */
+ cs_real_t coord[3]; /* Coordinates of the vertex */
+ fvm_gnum_t gnum; /* Global vertex number */
+
+} cs_join_vertex_t;
+
+typedef struct {
+
+ /* Edge numbering is defined by the ordering of the couples of vertices
+ in their global numbering */
+
+ cs_int_t n_edges; /* Local number of edges */
+ fvm_gnum_t n_g_edges; /* Global number of edges */
+ cs_int_t *def; /* Definition of each edge by a couple of vertex
+ numbers */
+ fvm_gnum_t *gnum; /* Global numbering of edges */
+
+ /*
+ Edge definition through the relation between vertices :
+
+ vtx_idx: index on vertices : -> define first vertex :
+ V1
+ adj_vtx_lst: list of coupled vertices with the first vertex V1:
+ V1a, V1b, ...
+ edge_lst: list of edge numbers relative to the defined couple:
+ (V1, V1a), (V1, V1b), ...
+ */
+
+ cs_int_t n_vertices; /* Number of vertices in index */
+ cs_int_t *vtx_idx; /* Index on first vertices */
+ cs_int_t *adj_vtx_lst; /* List of adjacent vertices */
+ cs_int_t *edge_lst; /* List of corresponding edge ids */
+
+} cs_join_edges_t;
+
+/* Structure defining a mesh on selected faces for the joining operation */
+
+typedef struct {
+
+ char *name; /* For post-processing and dump purpose */
+
+ /* Face connectivity */
+
+ cs_int_t n_faces;
+ fvm_gnum_t n_g_faces;
+ fvm_gnum_t *face_gnum;
+ cs_int_t *face_vtx_idx;
+ cs_int_t *face_vtx_lst;
+
+ /* Vertex data */
+
+ cs_int_t n_vertices;
+ fvm_gnum_t n_g_vertices;
+ cs_join_vertex_t *vertices;
+
+} cs_join_mesh_t;
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Create a MPI_Datatype for the cs_join_vertex_t structure.
+ *
+ * returns:
+ * an MPI_Datatype associated to the cs_join_vertex_t structure.
+ *---------------------------------------------------------------------------*/
+
+MPI_Datatype
+cs_join_mesh_create_vtx_datatype(void);
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Allocate and initialize a new cs_join_mesh_t structure.
+ *
+ * parameters:
+ * name <-- name of the mesh
+ *
+ * returns:
+ * a pointer to a cs_join_mesh_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create(const char *name);
+
+/*----------------------------------------------------------------------------
+ * Get a cs_join_mesh_t structure with the given list of global faces inside.
+ *
+ * Exchange between ranks to get the connectivity associated to each
+ * face of the global numbering list.
+ *
+ * parameters:
+ * mesh_name <-- name of the created mesh
+ * n_elts <-- number of elements in the global list
+ * glob_sel <-- list of global elements (ordered)
+ * gnum_rank_index <-- index on ranks for the global elements
+ * local_mesh <-- pointer to the local part of the distributed
+ * cs_join_mesh_t structure on selected elements
+ *
+ * returns:
+ * a pointer to a new allocated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create_from_glob_sel(const char *mesh_name,
+ cs_int_t n_elts,
+ const fvm_gnum_t glob_sel[],
+ const fvm_gnum_t gnum_rank_index[],
+ const cs_join_mesh_t *local_mesh);
+
+/*----------------------------------------------------------------------------
+ * Allocate and define a cs_join_mesh_t structure relative to an extraction
+ * of selected faces.
+ *
+ * The selection must be ordered.
+ *
+ * parameters:
+ * mesh_name <-- name of the name to create
+ * subset_size <-- number of selected faces in the subset
+ * selection <-- list of selected faces. Numbering in parent mesh
+ * parent_mesh <-- parent cs_join_mesh_t structure
+ *
+ * returns:
+ * a pointer to a cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create_from_subset(const char *mesh_name,
+ cs_int_t subset_size,
+ const cs_int_t selection[],
+ const cs_join_mesh_t *parent_mesh);
+
+/*----------------------------------------------------------------------------
+ * Allocate and define a cs_join_mesh_t structure relative to an extraction
+ * of selected faces.
+ *
+ * parameters:
+ * mesh_name <-- name of the mesh to create
+ * n_faces <-- number of selected faces
+ * n_g_faces <-- global number of selected faces
+ * selected_faces <-- list of selected faces (based on parent mesh)
+ * face_gnum <-- global face numbers
+ * face_vtx_idx <-- "face -> vertex" connectivity index
+ * face_vtx_lst <-- "face -> vertex" connectivity
+ * n_select_vertices <-- number of vertices used in joining operation
+ * n_g_select_vertices <-- global number of vertices used in joining
+ * select_vertices <-- list of selected vertices (based on parent mesh)
+ * vtx_data <-- array on data associated to selected vertices
+ *
+ * returns:
+ * a pointer to a cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create_from_extract(const char *mesh_name,
+ cs_int_t n_faces,
+ fvm_gnum_t n_g_faces,
+ const cs_int_t selected_faces[],
+ const fvm_gnum_t face_gnum[],
+ const cs_int_t face_vtx_idx[],
+ const cs_int_t face_vtx_lst[],
+ cs_int_t n_select_vertices,
+ fvm_gnum_t n_g_select_vertices,
+ const cs_int_t selected_vertices[],
+ const cs_join_vertex_t *vtx_data);
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-> pointer to pointer to cs_join_mesh_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_destroy(cs_join_mesh_t **mesh);
+
+/*----------------------------------------------------------------------------
+ * Re-initialize an existing cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_reset(cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Copy a cs_join_mesh_t structure into another.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_join_mesh_t structure to fill
+ * ref_mesh <-- pointer to the reference
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_copy(cs_join_mesh_t **mesh,
+ const cs_join_mesh_t *ref_mesh);
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Get the connectivity of a list of global elements distributed over the
+ * ranks.
+ *
+ * parameters:
+ * n_ranks <-- number of ranks in the MPI communicator
+ * send_rank_index <-- index on ranks for the face distribution
+ * send_faces <-- list of face ids to send
+ * send_mesh <-- pointer to the sending cs_join_mesh_t structure
+ * recv_mesh <-> pointer to the receiving cs_join_mesh_t structure
+ * comm <-- mpi communicator on which take places comm.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_exchange(int n_ranks,
+ const cs_int_t send_rank_index[],
+ const cs_int_t send_faces[],
+ const cs_join_mesh_t *send_mesh,
+ cs_join_mesh_t *recv_mesh,
+ MPI_Comm comm);
+
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_edges_t structure.
+ *
+ * parameters:
+ * edges <-> pointer to pointer to cs_join_edges_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_destroy_edges(cs_join_edges_t **edges);
+
+/*----------------------------------------------------------------------------
+ * Order a cs_join_mesh_t structure according to the global face numbering
+ *
+ * Delete redundancies.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_join_mesh_t structure to order
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_face_order(cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Delete vertices which appear several times (same global number) and
+ * vertices which are not used in face definition.
+ *
+ * parameters:
+ * mesh <-> pointer to cs_join_mesh_t structure to clean
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_vertex_clean(cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Clean the given cs_join_mesh_t structure, removing degenerate edges.
+ *
+ * parameters:
+ * mesh <-> pointer to the cs_join_mesh_t structure to clean
+ * verbosity <-- level of display
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_clean(cs_join_mesh_t *mesh,
+ int verbosity);
+
+/*----------------------------------------------------------------------------
+ * Define a list of edges associated to a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ *
+ * returns:
+ * a pointer to the new defined cs_join_edges_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_edges_t *
+cs_join_mesh_define_edges(const cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Get the edge number relative to a couple of vertex numbers.
+ *
+ * edge_num > 0 if couple is in the same order as the edge->def
+ * edge_num < 0 otherwise
+ *
+ * parameters:
+ * v1_num <-- vertex number for the first vertex
+ * v2_num <-- vertex number for the second vertex
+ * edges <-- pointer to a cs_join_edges_t structure
+ *
+ * returns:
+ * an edge number relative to the couple of vertices
+ *---------------------------------------------------------------------------*/
+
+cs_int_t
+cs_join_mesh_get_edge(cs_int_t v1_num,
+ cs_int_t v2_num,
+ const cs_join_edges_t *edges);
+
+/*----------------------------------------------------------------------------
+ * Re-organize the cs_join_mesh_t structure after a renumbering of
+ * the vertices following the merge operation + a new description of each
+ * face.
+ *
+ * parameters:
+ * mesh <-> pointer to the cs_join_mesh_t structure to update
+ * edges <-- pointer to a cs_join_edges_t structure
+ * edge_index <-- index on edges for the new vertices
+ * edge_new_vtx_lst <-- list of new vertices for each edge
+ * n_new_vertices <-- new local number of vertices after merge
+ * old2new <-- array storing the relation between old/new vertex id
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_update(cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_int_t edge_index[],
+ const cs_int_t edge_new_vtx_lst[],
+ cs_int_t n_new_vertices,
+ const cs_int_t old2new[]);
+
+/*----------------------------------------------------------------------------
+ * Compute for each face of the cs_join_mesh_t structure the face normal.
+ * || face_normal || = 1 (divided by the area of the face)
+ *
+ * The caller is responsible for freeing the returned array.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ *
+ * Pi+1
+ * *---------* B : barycenter of the polygon
+ * / . . \
+ * / . . \ Pi : vertices of the polygon
+ * / . . \
+ * / . . Ti \ Ti : triangle
+ * *.........B.........* Pi
+ * Pn-1 \ . . /
+ * \ . . /
+ * \ . . /
+ * \ . T0 . /
+ * *---------*
+ * P0
+ *
+ *
+ * returns:
+ * an array with the face normal for each face of the mesh
+ *---------------------------------------------------------------------------*/
+
+cs_real_t *
+cs_join_mesh_get_face_normal(const cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Allocate and define an "edge -> face" connectivity
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ * edges <-- pointer to a cs_join_edges_t structure
+ * edge_face_idx --> pointer to the edge -> face connect. index
+ * edge_face_lst --> pointer to the edge -> face connect. list
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_get_edge_face_adj(const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ cs_int_t *edge_face_idx[],
+ cs_int_t *edge_face_lst[]);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_vertex_t structure.
+ *
+ * parameters:
+ * vertex <-- cs_join_vertex_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_vertex(const cs_join_vertex_t vertex);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_vertex_t structure into a file.
+ *
+ * parameters:
+ * file <-- pointer to a FILE structure
+ * vertex <-- cs_join_vertex_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_vertex_file(FILE *file,
+ const cs_join_vertex_t vertex);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump(const cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_mesh_t structure into a file.
+ *
+ * parameters:
+ * file <-- pointer to a FILE structure
+ * mesh <-- pointer to cs_join_mesh_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_file(FILE *file,
+ const cs_join_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Dump a list of cs_join_edge_t structures.
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure to dump
+ * mesh <-- associated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_edges(const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_MESH_H__ */
diff --git a/include/base/cs_join_post.h b/include/base/cs_join_post.h
new file mode 100644
index 0000000..9f523d5
--- /dev/null
+++ b/include/base/cs_join_post.h
@@ -0,0 +1,174 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+#ifndef __CS_JOIN_POST_H__
+#define __CS_JOIN_POST_H__
+
+/*============================================================================
+ * Subroutines to manage post-treatment for joining operation
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include "fvm_nodal.h"
+#include "fvm_writer.h"
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_join_mesh.h"
+#include "cs_join_util.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create and define a writer to make post-treatment for the joining operation
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_init(void);
+
+/*----------------------------------------------------------------------------
+ * Post-treatment of a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh_name <-- name of the mesh for the post-processing
+ * mesh <-- pointer to a cs_join_mesh_t structure to post
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_mesh(const char *mesh_name,
+ const cs_join_mesh_t *join_mesh);
+
+/*----------------------------------------------------------------------------
+ * Post-process a subset of faces of a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh_name <-- name of the sub-set mesh
+ * mesh <-- pointer to the parent cs_join_mesh_t structure
+ * n_selected_faces <-- number of selected faces (size of the sub-set)
+ * selected_faces <-- list of local number in parent mesh
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_faces_subset(const char *mesh_name,
+ const cs_join_mesh_t *parent_mesh,
+ cs_int_t n_select_faces,
+ const cs_int_t selected_faces[]);
+
+/*----------------------------------------------------------------------------
+ * Post-process mesh after the update following the fusion operation.
+ *
+ * parameters:
+ * join_param <-- set of parameters for the joining operation
+ * join_select <-- list of all implied entities in the joining operation
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_after_merge(cs_join_param_t join_param,
+ const cs_join_select_t *join_select);
+
+
+/*----------------------------------------------------------------------------
+ * Post-process mesh after the update following the split operation.
+ *
+ * parameters:
+ * n_old_i_faces <-- initial number of interior faces
+ * n_new_i_faces <-- number of interior faces added to the mesh definition
+ * n_old_b_faces <-- initial number of border faces
+ * n_new_b_faces <-- number of border faces added to the mesh definition
+ * n_g_new_b_faces <-- global number of new border faces
+ * n_select_faces <-- number of selected faces
+ * mesh <-- pointer to a cs_mesh_t structure
+ * join_param <-- set of parameters for the joining operation
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_after_split(cs_int_t n_old_i_faces,
+ cs_int_t n_new_i_faces,
+ cs_int_t n_old_b_faces,
+ cs_int_t n_new_b_faces,
+ fvm_gnum_t n_g_new_b_faces,
+ cs_int_t n_select_faces,
+ const cs_mesh_t *mesh,
+ cs_join_param_t join_param);
+
+/*----------------------------------------------------------------------------
+ * Post-process mesh after the update following the split operation.
+ *
+ * parameters:
+ * n_i_clean_faces <-- number of interior faces cleaned
+ * i_clean_faces <-> list of interior face numbers (ordered on exit)
+ * n_b_clean_faces <-- number of border faces cleaned
+ * b_clean_faces <-> list of border face numbers (ordered on exit)
+ * param <-- set of parameters for the joining operation
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_cleaned_faces(cs_int_t n_i_clean_faces,
+ cs_int_t i_clean_faces[],
+ cs_int_t n_b_clean_faces,
+ cs_int_t b_clean_faces[],
+ cs_join_param_t param);
+
+/*----------------------------------------------------------------------------
+ * Post and dump a cs_join_mesh_t according to the verbosity level.
+ *
+ * parameters:
+ * basename <-- generic name for the mesh to post
+ * mesh <-- fvm_join_mesh_t structure to post
+ * param <-- fvm_join_param_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_dump_mesh(const char *basename,
+ const cs_join_mesh_t *mesh,
+ cs_join_param_t param);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_POST_H__ */
diff --git a/include/base/cs_join_set.h b/include/base/cs_join_set.h
new file mode 100644
index 0000000..e6d9f89
--- /dev/null
+++ b/include/base/cs_join_set.h
@@ -0,0 +1,427 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Subroutines useful to manage list structures
+ *===========================================================================*/
+
+#ifndef __CS_JOIN_SET_H__
+#define __CS_JOIN_SET_H__
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+typedef struct { /* Definition of a global indexed list of global elements */
+
+ cs_int_t n_elts;
+ fvm_gnum_t n_g_elts;
+
+ fvm_gnum_t *g_elts; /* Global numbering of elements */
+
+ cs_int_t *index; /* Index on elements from */
+ fvm_gnum_t *g_list; /* Global numbering of entities linked with g_elts */
+
+} cs_join_gset_t;
+
+typedef struct { /* Resizable array structure */
+
+ cs_int_t n_max_elts;
+ cs_int_t n_elts;
+ cs_int_t *array;
+
+} cs_join_rset_t;
+
+/* ------------------------------------------------------------------ *
+ * Definition of a structure defining a set of equivalence between
+ * vertices for instance
+ * ------------------------------------------------------------------ */
+
+typedef struct {
+
+ cs_int_t n_max_equiv; /* max. number of equiv. allocated */
+ cs_int_t n_equiv; /* number of equivalences */
+ cs_int_t *equiv_couple; /* ids of the two equivalent entities.
+ size = 2 * n_equiv */
+} cs_join_eset_t;
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Allocate a resizable array.
+ *
+ * parameters:
+ * max_size <-- initial number of elements to allocate
+ *
+ * returns:
+ * pointer to a new alloacted resizable array
+ *---------------------------------------------------------------------------*/
+
+cs_join_rset_t *
+cs_join_rset_create(cs_int_t max_size);
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_rset_t structure.
+ *
+ * parameter:
+ * set <-- pointer to pointer to the cs_join_rset_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_rset_destroy(cs_join_rset_t **set);
+
+/*----------------------------------------------------------------------------
+ * Check if we need to resize the current cs_join_rset_t structure and do
+ * it if necessary.
+ *
+ * parameters:
+ * set <-- pointer to pointer to the cs_join_rset_t structure to test
+ * test_size <-- target size
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_rset_resize(cs_join_rset_t **set,
+ cs_int_t test_size);
+
+/*----------------------------------------------------------------------------
+ * Create a new cs_join_eset_t structure.
+ *
+ * parameters:
+ * init_size <-- number of initial equivalences to allocate
+ *
+ * returns:
+ * a pointer to a new cs_join_eset_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_eset_t *
+cs_join_eset_create(cs_int_t init_size);
+
+/*----------------------------------------------------------------------------
+ * Check if the requested size if allocated in the structure.
+ *
+ * Reallocate cs_join_eset_t structure if necessary.
+ *
+ * parameters:
+ * request_size <-- necessary size
+ * equiv_set <-> pointer to pointer to the cs_join_eset_t struct.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_eset_check_size(cs_int_t request_size,
+ cs_join_eset_t **equiv_set);
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_eset_t structure.
+ *
+ * parameter:
+ * equiv_set <-- pointer to pointer to the structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_eset_destroy(cs_join_eset_t **equiv_set);
+
+/*----------------------------------------------------------------------------
+ * Clean a cs_join_eset_t structure.
+ *
+ * If necessary, create a new cs_join_eset_t structure with no redundancy.
+ *
+ * parameters:
+ * eset <-- pointer to pointer to the cs_join_eset_t structure to clean
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_eset_clean(cs_join_eset_t **eset);
+
+/*----------------------------------------------------------------------------
+ * Create a cs_join_gset_t structure (indexed list on global numbering)
+ *
+ * parameters:
+ * n_elts <-- number of elements composing the list
+ *
+ * returns:
+ * a new allocated pointer to a cs_join_gset_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_create(cs_int_t n_elts);
+
+/*----------------------------------------------------------------------------
+ * Build a cs_join_gset_t structure to store all the potential groups
+ * between elements.
+ *
+ * Values in g_elts are the tag values and values in g_list
+ * are position in tag array.
+ *
+ * parameters:
+ * n_elts <-- number of elements in tag array
+ * tag <-- tag array used to define a new cs_join_gset_t
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_create_from_tag(cs_int_t n_elts,
+ const fvm_gnum_t tag[]);
+
+/*----------------------------------------------------------------------------
+ * Create a new cs_join_gset_t which holds equivalences between elements of
+ * g_list in cs_join_gset_t.
+ *
+ * For a subset of equivalences, we store their initial value in the return
+ * cs_join_gset_t structure. A subset is defined if at least two elements
+ * are equivalent.
+ *
+ * The behavior of this function is near from cs_join_gset_create_from_tag
+ * but we don't store the position in init_array but its value in init_array.
+ *
+ * parameters:
+ * set <-- pointer to a cs_join_gset_t structure
+ * init_array <-- initial values of set->g_list
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_create_by_equiv(const cs_join_gset_t *set,
+ const fvm_gnum_t init_array[]);
+
+/*----------------------------------------------------------------------------
+ * Copy a cs_join_gset_t structure.
+ *
+ * parameters:
+ * src <-- pointer to the cs_join_gset_t structure to copy
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_copy(const cs_join_gset_t *src);
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-- pointer to pointer to the cs_join_gset_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_destroy(cs_join_gset_t **set);
+
+/*----------------------------------------------------------------------------
+ * Sort a cs_join_gset_t structure according to the global numbering of
+ * the g_elts in cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-> pointer to the structure to order
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_sort_elts(cs_join_gset_t *set);
+
+/*----------------------------------------------------------------------------
+ * Sort each sub-list of the g_list array in a cs_join_gset_t structure.
+ *
+ * parameters:
+ * p_set <-> pointer to the structure to sort
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_sort_sublist(cs_join_gset_t *set);
+
+/*----------------------------------------------------------------------------
+ * Invert a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-- pointer to the cs_join_gset_t structure to work with
+ *
+ * returns:
+ * the new allocated and inverted set structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_invert(const cs_join_gset_t *set);
+
+/*----------------------------------------------------------------------------
+ * Delete redudancies in a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-> pointer to the structure to clean
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_clean(cs_join_gset_t *set);
+
+/*----------------------------------------------------------------------------
+ * Delete redudancies in g_list array of a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-> pointer to the structure to clean
+ * linked_array <-> array for which redundancies are scanned
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_clean_from_array(cs_join_gset_t *set,
+ fvm_gnum_t linked_array[]);
+
+/*----------------------------------------------------------------------------
+ * Concatenate the two g_elts and g_list arrays.
+ *
+ * Order the new concatenated array and delete redundant elements.
+ * We get a single ordered array.
+ *
+ * parameters:
+ * set <-- pointer to the structure to work with
+ * n_elts --> number of elements in the new set
+ * new_array --> pointer to the new created array
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_single_order(const cs_join_gset_t *set,
+ cs_int_t *n_elts,
+ fvm_gnum_t *new_array[]);
+
+/*----------------------------------------------------------------------------
+ * Compress a g_list such as for each element "e" in g_elts:
+ * - there is no redundancy for the linked elements of set->g_list
+ * - there is no element in set->g_list < e
+ *
+ * parameters:
+ * set <-> pointer to the structure to work with
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_compress(cs_join_gset_t *set);
+
+/*----------------------------------------------------------------------------
+ * Delete redundancies in set->g_elts.
+ *
+ * Merge sub-arrays associated to a common set->g_elts[i].
+ *
+ * parameters:
+ * set <-- pointer to the structure to work with
+ * order_tag <-- 0: set->g_elts is not ordered, 1: ordered
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_merge_elts(cs_join_gset_t *set,
+ int order_tag);
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Synchronize a cs_join_gset_t structure and distribute the resulting set
+ * over the rank by block
+ *
+ * parameters:
+ * n_g_elts <-- global number of elements
+ * loc_set <-> pointer to the local structure to work with
+ * comm <-- mpi_comm on which synchro. and distribution take place
+ *
+ * returns:
+ * a synchronized and distributed cs_join_gset_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_sync_by_block(fvm_gnum_t n_g_elts,
+ cs_join_gset_t *loc_set,
+ MPI_Comm comm);
+
+/*----------------------------------------------------------------------------
+ * Update a local cs_join_gset_t structure from a distributed and
+ * synchronized cs_join_gset_t structure.
+ *
+ * parameters:
+ * n_g_elts <-- global number of elements
+ * sync_set <-- pointer to the structure which holds a synchronized block
+ * loc_set <-> pointer to a local structure holding elements to update
+ * comm <-- comm on which synchronization and distribution take place
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_update_from_block(fvm_gnum_t n_g_elts,
+ const cs_join_gset_t *sync_set,
+ cs_join_gset_t *loc_set,
+ MPI_Comm comm);
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Dump an array (int or double).
+ *
+ * This function is called according to the verbosity.
+ *
+ * parameters:
+ * type <-- type of the array to display
+ * header <-- header to display in front of the array
+ * n_elts <-- number of elements to display
+ * array <-- array to display
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_dump_array(const char *type,
+ const char *header,
+ int n_elts,
+ const void *array);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_gset_t structure.
+ *
+ * parameters:
+ * file <-- pointer to an output file or NULL
+ * set <-- pointer to the cs_join_gset_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_dump(FILE *file,
+ const cs_join_gset_t *set);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_SET_H__ */
diff --git a/include/base/cs_join_split.h b/include/base/cs_join_split.h
new file mode 100644
index 0000000..09bd409
--- /dev/null
+++ b/include/base/cs_join_split.h
@@ -0,0 +1,97 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+#ifndef __CS_JOIN_SPLIT_H__
+#define __CS_JOIN_SPLIT_H__
+
+/*============================================================================
+ * Set of subroutines for cutting faces during face joining.
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_join_mesh.h"
+#include "cs_join_set.h"
+#include "cs_join_util.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build new faces after the vertex fusion operation. Split initial faces into
+ * subfaces and keep the historic between initial/final faces.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters
+ * face_normal <-- array of normal vector on each face
+ * edges <-- list of edges
+ * work <-> pointer to a cs_join_mesh_t structure
+ * old2new_history <-> relation between new faces and old one:
+ * old global face -> new local face
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_split_faces(cs_join_param_t param,
+ const cs_real_t face_normal[],
+ const cs_join_edges_t *edges,
+ cs_join_mesh_t **work,
+ cs_join_gset_t **old2new_history);
+
+/*----------------------------------------------------------------------------
+ * Update after face splitting of the local join mesh structure.
+ * Send back to the original rank the new face description.
+ *
+ * parameters:
+ * work_mesh <-- distributed mesh on faces to join
+ * gnum_rank_index <-- index on ranks for the old global face numbering
+ * o2n_hist <-> old global face -> new local face numbering
+ * local_mesh <-> mesh on local selected faces to be joined
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_split_update_struct(const cs_join_mesh_t *work_mesh,
+ const fvm_gnum_t gnum_rank_index[],
+ cs_join_gset_t **o2n_hist,
+ cs_join_mesh_t **local_mesh);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_SPLIT_H__ */
diff --git a/include/base/cs_join_update.h b/include/base/cs_join_update.h
new file mode 100644
index 0000000..98d10f3
--- /dev/null
+++ b/include/base/cs_join_update.h
@@ -0,0 +1,125 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+#ifndef __CS_JOIN_UPDATE_H__
+#define __CS_JOIN_UPDATE_H__
+
+/*============================================================================
+ * Structure and function headers handling with mesh update during
+ * the joining operation
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_join_mesh.h"
+#include "cs_join_set.h"
+#include "cs_join_util.h"
+#include "cs_mesh.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Type definition
+ *===========================================================================*/
+
+/*=============================================================================
+ * Global variables
+ *===========================================================================*/
+
+/*============================================================================
+ * Public function header for Fortran API
+ *===========================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update mesh structure (vertices + faces) after the fusion step.
+ *
+ * parameters:
+ * join_param <-- set of parameters for the joining operation
+ * join_select <-- list of all implied entities in the joining op.
+ * o2n_vtx_gnum <-> in : array on blocks on the new global vertex
+ * out: local array on the new global vertex
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_update_mesh_after_merge(cs_join_param_t join_param,
+ const cs_join_select_t *join_select,
+ fvm_gnum_t o2n_vtx_gnum[],
+ cs_join_mesh_t *join_mesh,
+ cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Update mesh structure (vertices + faces) after the face split step.
+ *
+ * parameters:
+ * join_param <-- set of parameters for the joining operation
+ * join_select <-- list of all implied entities in the joining op.
+ * o2n_face_hist <-- relation between faces before/after the joining
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_update_mesh_after_split(cs_join_param_t join_param,
+ const cs_join_select_t *join_select,
+ const cs_join_gset_t *o2n_face_hist,
+ const cs_join_mesh_t *join_mesh,
+ cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Clean a cs_mesh_t struct.
+ *
+ * Delete redundant and empty edge definitions.
+ *
+ * parameters:
+ * para <-- set of parameters for the joining operation
+ * mesh <-> pointer to a cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_update_mesh_clean(cs_join_param_t param,
+ cs_mesh_t *mesh);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_UPDATE_H__ */
diff --git a/include/base/cs_join_util.h b/include/base/cs_join_util.h
new file mode 100644
index 0000000..9b90494
--- /dev/null
+++ b/include/base/cs_join_util.h
@@ -0,0 +1,369 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+#ifndef __CS_JOIN_UTIL_H__
+#define __CS_JOIN_UTIL_H__
+
+/*============================================================================
+ * Manipulation of low-level structures for joining operations
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local library headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_selector.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *============================================================================*/
+
+typedef enum {
+
+ CS_JOIN_TYPE_CONFORM,
+ CS_JOIN_TYPE_NO_CONFORM,
+
+} cs_join_type_t;
+
+/*----------------------------------------------------------------------------
+ * Set of user parameters to control the join operation
+ *----------------------------------------------------------------------------*/
+
+typedef struct {
+
+ int num; /* number associated to the current join operation */
+
+ /* Octree - Quadtree search algorithm */
+ /* ---------------------------------- */
+
+ int tree_max_level; /* Deepest level reachable during tree building */
+ int tree_n_max_boxes; /* Max. number of boxes which can be related to a
+ a leaf of the tree if level != tree_max_level */
+
+ int tree_max_box_ratio; /* Stop tree building if:
+ n_linked_boxes > tree_max_box_ratio*n_init_boxes
+ */
+
+ /* Geometric parameters */
+ /* -------------------- */
+
+ /* parameter used to compute the tolerance associated to each vertex.
+ Also used for finding equivalent vertices during edge intersections */
+
+ double fraction;
+
+ /* maximum angle between normals of two faces considered to
+ be in the same plane (for face split) */
+
+ double plane;
+
+ /* Coef. used to reduce the tolerance: new tol. = tol * coef
+ Values between [0.0, 1.0[ */
+
+ double reduce_tol_factor;
+
+ /* Coef. used to modify the tolerance associated to each vertex before the
+ merge operation.
+ If coef = 0.0 => no vertex merge
+ If coef < 1.0 => reduce vertex merge
+ If coef = 1.0 => no change
+ If coef > 1.0 => increase vertex merge */
+
+ double merge_tol_coef;
+
+ /* Coef. used to modify locally the tolerance associated to each vertex
+ BEFORE adding equivalences between vertices after edge intersections.
+ If coef = 0.0 => add no equivalence
+ If coef < 1.0 => reduce the number of equivalences between vertices
+ sharing the same edge
+ If coef = 1.0 => no change
+ If coef > 1.0 => increase the number of equivalences between vertices
+ sharing the same edge. NOT ADVISED. */
+
+ double edge_equiv_tol_coef;
+
+ /* Parameter to switch on/off the influence of adjacent faces in the
+ computation of tolerance */
+
+ cs_bool_t include_adj_faces;
+
+ /* Parameter used to define if we get vertex equivalence trough the
+ comparison of vertex tolerance or through the difference of curvilinear
+ abscissa of vertices on edges.
+ If include_adj_faces = false => this parameter should not have any
+ effect. (Not a user-defined parameter) */
+
+ cs_bool_t edge_equiv_by_tolerance;
+
+ int max_sub_faces; /* Maximum number of sub-faces when splitting a face */
+
+ int verbosity; /* Level of display:
+ O : no information printed
+ 1 : general information printed
+ 2 : more information printed
+ 5 and beyond : highest level (DEBUG LEVEL) */
+
+
+} cs_join_param_t;
+
+/*----------------------------------------------------------------------------
+ * Structure used to store the result of the extraction of entities
+ * implied in the joining operation
+ *----------------------------------------------------------------------------*/
+
+typedef struct { /* Structure used to synchronize single elements */
+
+ int n_elts;
+ int n_ranks;
+ int *ranks;
+ int *index;
+ int *array;
+
+} cs_join_sync_t;
+
+typedef struct {
+
+ cs_int_t n_faces; /* Number of border faces selected
+ for the joining operation */
+ fvm_gnum_t n_g_faces; /* Global number of border faces selected
+ for the joining operation */
+ cs_int_t *faces; /* List of selected border faces */
+
+ fvm_gnum_t *compact_face_gnum; /* Global face numbering defined
+ on the selected faces */
+ fvm_gnum_t *compact_rank_index; /* Distribution of the selected faces
+ over the ranks */
+
+ cs_int_t *cell_filter; /* Size: n_cells
+ value = -1 if not implied
+ value >= 0 else */
+
+ cs_real_t *cell_cen; /* Cell center for cells implied */
+ fvm_gnum_t *cell_gnum; /* Global cell numbering of the cells
+ holding the selected face */
+
+ cs_int_t n_vertices; /* Number of vertices selected
+ for the joining operation */
+ fvm_gnum_t n_g_vertices; /* Global number of selected vertices */
+ cs_int_t *vertices; /* List of selected vertices */
+
+ /* Adjacent faces of the current face selection: border and interior */
+
+ cs_int_t n_b_adj_faces;
+ cs_int_t n_i_adj_faces;
+
+ cs_int_t *b_adj_faces;
+ cs_int_t *i_adj_faces;
+
+ /*
+ Single elements (Only possible in parallel. It appears
+ when the domain splitting has a poor quality and elements
+ on the joining interface are prisms or tetraedrals)
+ s = single / c = coupled
+ */
+
+ cs_bool_t do_single_sync;
+
+ cs_join_sync_t *s_vertices;
+ cs_join_sync_t *c_vertices;
+ cs_join_sync_t *s_edges;
+ cs_join_sync_t *c_edges;
+
+} cs_join_select_t;
+
+/*----------------------------------------------------------------------------
+ * Structure used to store information about a block distribution
+ *----------------------------------------------------------------------------*/
+
+typedef struct {
+
+ fvm_gnum_t n_g_elts; /* Global number of elements to distribute */
+ fvm_gnum_t first_gnum; /* Global number of the element in the local block */
+
+ int n_ranks; /* Number of processes in the communicator used
+ to define the current distribution */
+ int local_rank; /* Id of the current process in the communicator
+ used to define the current distribution */
+
+ size_t size; /* Size of block for the given set of parameters */
+ size_t local_size; /* Number of global elements to treat on the local
+ rank according to the distribution */
+
+} cs_join_block_info_t;
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define a set of parameters to control a contiguous distribution by block.
+ *
+ * parameters:
+ * n_g_elts <-- global number of elements to treat
+ * n_ranks <-- number of ranks in the MPI communicator related to the
+ * cs_join_block_info_t structure to create
+ * local_rank <-- rank in the MPI communicator related to the
+ * cs_join_block_info_t structure to create
+ *
+ * returns:
+ * a new defined cs_join_block_info_t structure
+ *----------------------------------------------------------------------------*/
+
+cs_join_block_info_t
+cs_join_get_block_info(fvm_gnum_t n_g_elts,
+ int n_ranks,
+ int local_rank);
+
+/*----------------------------------------------------------------------------
+ * Initialize a cs_join_param_t structure.
+ *
+ * parameters:
+ * join_id <-- id of the current joining operation
+ * fraction <-- value of the fraction parameter
+ * plane <-- value of the plane parameter
+ * rtf <-- value of the "reduction tolerance factor" parameter
+ * ftf <-- value of the "merge tolerance factor" parameter
+ * etf <-- value of the "edge equiv. tolerance factor" parameter
+ * max_sub_faces <-- maximum number of sub-faces allowed during splitting
+ * tml <-- value of the "tree max level" parameter
+ * tmb <-- value of the "tree max boxes" parameter
+ * tmr <-- value of the "tree max ratio" parameter
+ * verbosity <-- level of verbosity required
+ *
+ * returns:
+ * a pointer to a cs_join_param_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_param_t
+cs_join_param_define(int join_id,
+ double fraction,
+ double plane,
+ double rtf,
+ double ftf,
+ double etf,
+ int max_sub_faces,
+ int tml,
+ int tmb,
+ double tmr,
+ int verbosity);
+
+/*----------------------------------------------------------------------------
+ * Create and initialize a cs_join_select_t structure.
+ *
+ * parameters:
+ * selection_criteria <-- pointer to a cs_mesh_select_t structure
+ * verbosity <-- level of verbosity required
+ *
+ * returns:
+ * pointer to a newly created cs_join_select_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_select_t *
+cs_join_select_create(const char *selection_criteria,
+ int verbosity);
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_select_t structure.
+ *
+ * parameters:
+ * join_select <-- pointer to pointer to structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_select_destroy(cs_join_select_t **join_select);
+
+/*----------------------------------------------------------------------------
+ * Build vertex -> vertex index for a selection of faces.
+ *
+ * "v2v_idx" is already allocated to the number of vertices in the mesh.
+ * At this stage, it is just a counter.
+ *
+ * parameters:
+ * n_faces <-- number of selected faces
+ * faces <-- list of selected faces
+ * f2v_idx <-- face -> vertex connectivity index
+ * f2v_lst <-- face -> vertex connectivity list
+ * v2v_idx <-> index to build (already allocated and may be used again)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_build_edges_idx(cs_int_t n_faces,
+ const cs_int_t faces[],
+ const cs_int_t f2v_idx[],
+ const cs_int_t f2v_lst[],
+ cs_int_t v2v_idx[]);
+
+/*----------------------------------------------------------------------------
+ * Build vertex -> vertex list for a selection of faces.
+ * "count" and "v2v_lst" are already allocated to the number of vertices in
+ * the mesh.
+ *
+ * parameters:
+ * n_faces <-- number of selected faces
+ * faces <-- list of selected faces
+ * f2v_idx <-- face -> vertex connectivity index
+ * f2v_lst <-- face -> vertex connectivity list
+ * count <-> array used to count the number of values already added
+ * v2v_idx <-- vertex -> vertex connect. index
+ * v2v_lst <-> vertex -> vertex connect. list to build (can be used again)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_build_edges_lst(cs_int_t n_faces,
+ const cs_int_t faces[],
+ const cs_int_t f2v_idx[],
+ const cs_int_t f2v_lst[],
+ cs_int_t count[],
+ const cs_int_t v2v_idx[],
+ cs_int_t v2v_lst[]);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_JOIN_UTIL_H__ */
diff --git a/include/base/cs_matrix.h b/include/base/cs_matrix.h
new file mode 100644
index 0000000..e17addd
--- /dev/null
+++ b/include/base/cs_matrix.h
@@ -0,0 +1,274 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MATRIX_H__
+#define __CS_MATRIX_H__
+
+/*============================================================================
+ * Sparse Matrix Representation and Operations
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+#include "cs_halo.h"
+#include "cs_numbering.h"
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Matrix types
+ *----------------------------------------------------------------------------*/
+
+typedef enum {
+
+ CS_MATRIX_NATIVE, /* Native matrix format */
+ CS_MATRIX_CSR, /* Compressed Sparse Row storage format */
+ CS_MATRIX_N_TYPES /* Number of known matrix types */
+
+} cs_matrix_type_t;
+
+/* Structure associated with opaque matrix object */
+
+typedef struct _cs_matrix_t cs_matrix_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/* Short names for matrix types */
+
+extern const char *cs_matrix_type_name[];
+
+/* Full names for matrix types */
+
+extern const char *cs_matrix_type_fullname[];
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a matrix Structure.
+ *
+ * Note that the structure created maps to the given existing
+ * cell global number, face -> cell connectivity arrays, and cell halo
+ * structure, so it must be destroyed before they are freed
+ * (usually along with the code's main face -> cell structure).
+ *
+ * Note that the resulting matrix structure will contain either a full or
+ * an empty main diagonal, and that the extra-diagonal structure is always
+ * symmetric (though the coefficients my not be, and we may choose a
+ * matrix format that does not exploit ths symmetry). If the face_cell
+ * connectivity argument is NULL, the matrix will be purely diagonal.
+ *
+ * parameters:
+ * type --> Type of matrix considered
+ * symmetric --> Indicates if a symmetric variant of the matrix type
+ * should be used
+ * have_diag --> Indicates if the diagonal structure contains nonzeroes
+ * periodic --> Indicates if periodicity is present
+ * n_cells --> Local number of cells
+ * n_cells_ext --> Local number of cells + ghost cells sharing a face
+ * n_faces --> Local number of internal faces
+ * cell_num --> Global cell numbers (1 to n)
+ * face_cell --> Face -> cells connectivity (1 to n)
+ * halo --> Halo structure associated with cells, or NULL
+ * numbering --> vectorization or thread-related numbering info, or NULL
+ *
+ * returns:
+ * pointer to created matrix structure;
+ *----------------------------------------------------------------------------*/
+
+cs_matrix_t *
+cs_matrix_create(cs_matrix_type_t type,
+ cs_bool_t symmetric,
+ cs_bool_t have_diag,
+ cs_bool_t periodic,
+ cs_int_t n_cells,
+ cs_int_t n_cells_ext,
+ cs_int_t n_faces,
+ const fvm_gnum_t *cell_num,
+ const cs_int_t *face_cell,
+ const cs_halo_t *halo,
+ const cs_numbering_t *numbering);
+
+/*----------------------------------------------------------------------------
+ * Destroy a matrix structure.
+ *
+ * parameters:
+ * matrix <-> Pointer to matrix structure pointer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_destroy(cs_matrix_t **matrix);
+
+/*----------------------------------------------------------------------------
+ * Return number of columns in matrix.
+ *
+ * parameters:
+ * matrix --> Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+cs_int_t
+cs_matrix_get_n_columns(const cs_matrix_t *matrix);
+
+/*----------------------------------------------------------------------------
+ * Return number of rows in matrix.
+ *
+ * parameters:
+ * matrix --> Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+cs_int_t
+cs_matrix_get_n_rows(const cs_matrix_t *matrix);
+
+/*----------------------------------------------------------------------------
+ * Set matrix coefficients.
+ *
+ * Depending on current options and initialization, values will be copied
+ * or simply mapped.
+ *
+ * parameters:
+ * matrix <-> Pointer to matrix structure
+ * symmetric --> Indicates if matrix coefficients are symmetric
+ * da --> Diagonal values (NULL if zero)
+ * xa --> Extradiagonal values (NULL if zero)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_set_coefficients(cs_matrix_t *matrix,
+ cs_bool_t symmetric,
+ const cs_real_t *da,
+ const cs_real_t *xa);
+
+/*----------------------------------------------------------------------------
+ * Release matrix coefficients.
+ *
+ * parameters:
+ * matrix <-> Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_release_coefficients(cs_matrix_t *matrix);
+
+/*----------------------------------------------------------------------------
+ * Get matrix diagonal values.
+ *
+ * parameters:
+ * matrix --> Pointer to matrix structure
+ * da --> Diagonal (pre-allocated, size: n_cells)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_get_diagonal(const cs_matrix_t *matrix,
+ cs_real_t *restrict da);
+
+/*----------------------------------------------------------------------------
+ * Matrix.vector product y = A.x
+ *
+ * This function includes a halo update of x prior to multiplication by A.
+ *
+ * parameters:
+ * rotation_mode --> Halo update option for rotational periodicity
+ * matrix --> Pointer to matrix structure
+ * x <-> Multipliying vector values (ghost values updated)
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_vector_multiply(cs_perio_rota_t rotation_mode,
+ const cs_matrix_t *matrix,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y);
+
+/*----------------------------------------------------------------------------
+ * Matrix.vector product y = A.x with no prior halo update of x.
+ *
+ * This function does not include a halo update of x prior to multiplication
+ * by A, so it should be called only when the halo of x is known to already
+ * be up to date (in which case we avoid the performance penalty of a
+ * redundant update by using this variant of the matrix.vector product).
+ *
+ * parameters:
+ * matrix --> Pointer to matrix structure
+ * x --> Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_vector_multiply_nosync(const cs_matrix_t *matrix,
+ const cs_real_t *x,
+ cs_real_t *restrict y);
+
+/*----------------------------------------------------------------------------
+ * Matrix.vector product y = alpha.A.x + beta.y
+ *
+ * This function includes a halo update of x prior to multiplication by A.
+ *
+ * parameters:
+ * rotation_mode --> Halo update option for rotational periodicity
+ * alpha --> Scalar, alpha in alpha.A.x + beta.y
+ * beta --> Scalar, beta in alpha.A.x + beta.y
+ * matrix --> Pointer to matrix structure
+ * x <-> Multipliying vector values (ghost values updated)
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_alpha_a_x_p_beta_y(cs_perio_rota_t rotation_mode,
+ cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MATRIX_H__ */
diff --git a/include/base/cs_mesh.h b/include/base/cs_mesh.h
new file mode 100644
index 0000000..f875a7d
--- /dev/null
+++ b/include/base/cs_mesh.h
@@ -0,0 +1,382 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_H__
+#define __CS_MESH_H__
+
+/*============================================================================
+ * Main structure associated to a mesh
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+#include <fvm_group.h>
+#include <fvm_selector.h>
+#include <fvm_periodicity.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+#include "cs_numbering.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/* Mesh structure definition */
+/* ------------------------- */
+
+typedef struct {
+
+ /* General features */
+
+ cs_int_t dim; /* Space dimension */
+ cs_int_t domain_num; /* Local domain number */
+ cs_int_t n_domains; /* Number of domains */
+
+
+ /* Local dimensions */
+
+ cs_int_t n_cells; /* Number of cells */
+ cs_int_t n_i_faces; /* Number of internal faces */
+ cs_int_t n_b_faces; /* Number of border faces */
+ cs_int_t n_vertices; /* Number of vertices */
+
+ cs_int_t i_face_vtx_connect_size; /* Size of the connectivity
+ internal faces -> vertices */
+ cs_int_t b_face_vtx_connect_size; /* Size of the connectivity
+ border faces -> vertices */
+
+ /* Local structures */
+
+ cs_real_t *vtx_coord; /* Vertex coordinates */
+
+ cs_int_t *i_face_cells; /* Internal faces -> cells connectivity */
+ cs_int_t *b_face_cells; /* Border faces -> cells connectivity */
+
+ cs_int_t *i_face_vtx_idx; /* Internal faces -> vertices index */
+ cs_int_t *i_face_vtx_lst; /* Interior faces -> vertices connectivity */
+
+ cs_int_t *b_face_vtx_idx; /* Boundary faces -> vertices index */
+ cs_int_t *b_face_vtx_lst; /* Boundary faces -> vertices connectivity */
+
+
+ /* Global dimension */
+
+ fvm_gnum_t n_g_cells; /* Global number of cells */
+ fvm_gnum_t n_g_i_faces; /* Global number of internal faces */
+ fvm_gnum_t n_g_b_faces; /* Global number of border faces */
+ fvm_gnum_t n_g_vertices; /* Global number of vertices */
+
+ /* Global numbering */
+
+ fvm_gnum_t *global_cell_num; /* Global cell numbering */
+ fvm_gnum_t *global_i_face_num; /* Global internal face numbering */
+ fvm_gnum_t *global_b_face_num; /* Global border face numbering */
+ fvm_gnum_t *global_vtx_num; /* Global vertex numbering */
+
+ /* Periodictity features */
+
+ int n_init_perio; /* Number of initial periodicities */
+ int n_transforms; /* Number of transformations */
+
+ int have_rotation_perio; /* Periodicity rotation indicator */
+
+ fvm_periodicity_t *periodicity; /* parameters of each periodicity */
+
+ /* Parallelism and/or periodic features */
+
+ cs_halo_type_t halo_type; /* Halo type */
+
+ cs_int_t n_cells_with_ghosts; /* Total number of cells on the local rank
+ (n_cells + n_ghost_cells) */
+ cs_int_t n_ghost_cells; /* Number of "ghost" cells */
+
+ cs_halo_t *halo; /* Structure used to manage ghost cells */
+
+ cs_numbering_t *i_face_numbering; /* Interior face numbering info */
+ cs_numbering_t *b_face_numbering; /* Boundary face numbering info */
+
+ /* Extended neighborhood features */
+
+ cs_int_t *cell_cells_idx; /* "cell -> cells" connectivity index for
+ extended halo. Only defined if extended
+ neighborhood is built. */
+ cs_int_t *cell_cells_lst; /* "cell -> cells" connectivity list for
+ extended halo. Only defined if extended
+ neighborhood is built. */
+
+ cs_int_t *gcell_vtx_idx; /* ghost cells -> vertices index */
+ cs_int_t *gcell_vtx_lst; /* ghost cells -> vertices list */
+
+ /* Group and family features */
+
+ cs_int_t n_groups; /* Number of groups */
+ cs_int_t *group_idx; /* Starting index in the in group_lst */
+ char *group_lst; /* List of group names */
+
+ cs_int_t n_families; /* Number of families */
+ cs_int_t n_max_family_items; /* Max. number of items for one family */
+ cs_int_t *family_item; /* Family items */
+ cs_int_t *cell_family; /* Cell family */
+ cs_int_t *i_face_family; /* Interior face family */
+ cs_int_t *b_face_family; /* Border face family */
+
+ fvm_group_class_set_t *class_defs;
+
+ fvm_selector_t *select_cells; /* Cell selection object */
+ fvm_selector_t *select_i_faces; /* Internal faces selection object */
+ fvm_selector_t *select_b_faces; /* Border faces selection object */
+
+} cs_mesh_t ;
+
+/* Structure used for building mesh structure */
+/* ------------------------------------------ */
+
+typedef struct {
+
+ /* Periodic features */
+
+ cs_int_t *per_face_idx; /* Index on periodicity for per_face_lst */
+
+ cs_int_t *per_face_lst; /* Periodic faces list. For each couple,
+ we have the local face number on local rank
+ and the local face number on distant rank */
+
+ cs_int_t *per_rank_lst; /* Remote ranks list. For each couple,
+ we have the distant rank number. Exist
+ only in case of parallelism. */
+
+} cs_mesh_builder_t ;
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+extern cs_mesh_t *cs_glob_mesh; /* Pointer to main mesh structure */
+
+extern cs_mesh_builder_t *cs_glob_mesh_builder; /* Pointer to builder mesh
+ structure */
+
+/*============================================================================
+ * Public functions definition for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Return the group number corresponding to a given name. If the group exists,
+ * the number corresponds to the group rank (starting from 1) in the list of
+ * the meshe's groups, multiplied by -1. This numbering is that used in
+ * family (group class) description array IPRFML(NFML, NPRFML).
+ *
+ * If the group of the given name is not found, 9999 is returned.
+ *
+ * Fortran interface:
+ *
+ * FUNCTION NUMGRP (NAME, LEN)
+ * ***************
+ *
+ * CHARACTER* NAME : <-- : Name of the group
+ * INTEGER LEN : <-- : Group name length
+ *----------------------------------------------------------------------------*/
+
+cs_int_t CS_PROCF (numgrp, NUMGRP)
+(
+ const char *name, /* <-- Group name */
+ const cs_int_t *len /* <-- Name length */
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create an empty mesh structure
+ *
+ * returns:
+ * pointer to created mesh structure
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_t *
+cs_mesh_create(void);
+
+/*----------------------------------------------------------------------------
+ * Create an empty mesh builder structure
+ *
+ * returns:
+ * A pointer to a mesh builder structure.
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_builder_t *
+cs_mesh_builder_create(void);
+
+/*----------------------------------------------------------------------------
+ * Destroy a mesh structure
+ *
+ * mesh <-> pointer to a mesh structure
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_t *
+cs_mesh_destroy(cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Destroy a mesh builder structure
+ *
+ * mesh_builder <-> pointer to a mesh structure
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_builder_t *
+cs_mesh_builder_destroy(cs_mesh_builder_t *mesh_builder);
+
+/*----------------------------------------------------------------------------
+ * Renumber vertices.
+ *
+ * We ensure:
+ * If i < j then mesh->global_vtx_num[i] < mesh->global_vtx_num[j]
+ * which is not insured by the initial numbering from the pre-processor.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_order_vertices(cs_mesh_t *const mesh);
+
+/*----------------------------------------------------------------------------
+ * Print mesh characteristics
+ *
+ * parameters:
+ * mesh --> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_info(const cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Compute global number of elements (cells, vertices, internal and border
+ * faces) and sync cell family.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_mesh_t structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_parall(cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Creation and initialization of halo structures.
+ *
+ * Treatment of parallel and/or periodic halos for standard and extended
+ * ghost cells according to halo type requested by global options.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_halo(cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Get the global number of ghost cells.
+ *
+ * parameters:
+ * mesh <-- pointer to a mesh structure
+ *
+ * returns:
+ * Global number of ghost cells
+ *---------------------------------------------------------------------------*/
+
+cs_int_t
+cs_mesh_n_g_ghost_cells(cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Define group classes for a mesh based on its family definitions.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_group_classes(cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------
+ * Assign selectors to global mesh.
+ *
+ * Should be called once the mesh is fully built.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_selectors(void);
+
+/*----------------------------------------------------------------------------
+ * Print information on a mesh structure.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure.
+ * name <-- associated name.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_print_info(const cs_mesh_t *mesh,
+ const char *name);
+
+/*----------------------------------------------------------------------------
+ * Dump of a mesh structure.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_dump(const cs_mesh_t *mesh);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_H__ */
diff --git a/include/base/cs_mesh_coherency.h b/include/base/cs_mesh_coherency.h
new file mode 100644
index 0000000..27c7958
--- /dev/null
+++ b/include/base/cs_mesh_coherency.h
@@ -0,0 +1,60 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_COHERENCY_H__
+#define __CS_MESH_COHERENCY_H__
+
+/*============================================================================
+ * Functions checking the coherency of the mesh
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check the coherency of the global mesh structure.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_coherency_check(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_COHERENCY_H__ */
diff --git a/include/base/cs_mesh_connect.h b/include/base/cs_mesh_connect.h
new file mode 100644
index 0000000..be14db6
--- /dev/null
+++ b/include/base/cs_mesh_connect.h
@@ -0,0 +1,153 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_CONNECT_H__
+#define __CS_MESH_CONNECT_H__
+
+/*============================================================================
+ * Extract nodal connectivity mesh representations from a native mesh.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include "fvm_nodal.h"
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Extract a mesh's "cells -> faces" connectivity.
+ *
+ * We consider a common numbering for internal and boundary faces, in which
+ * boundary faces are defined first. The common id for the i-th boundary
+ * face is thus i, and that of the j-th interior face is n_b_faces + j.
+ *
+ * If ind_cel_extr != NULL, then:
+ * --- ind_cel_extr[cell_id] = id in the list to extract (0 to n-1)
+ * if cell cell_id should be extracted
+ * --- ind_cel_extr[cell_id] = -1 if cells cell_id should be ignored
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * extr_cell_size <-- size of extr_cell_id[] array
+ * extr_cell_id <-- extr_cell_id = ids of extracted cells, or -1
+ * p_cell_faces_idx --> cells -> faces index
+ * p_cell_faces_val --> cells -> faces connectivity
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_connect_get_cell_faces(const cs_mesh_t *mesh,
+ fvm_lnum_t extr_cell_size,
+ const fvm_lnum_t extr_cell_id[],
+ fvm_lnum_t * *const p_cell_faces_idx,
+ fvm_lnum_t * *const p_cell_faces_val);
+
+/*----------------------------------------------------------------------------
+ * Build a nodal connectivity structure from a subset of a mesh's cells.
+ *
+ * The list of cells to extract is optional (if none is given, all cells
+ * faces are extracted by default); it does not need to be ordered on input,
+ * but is always ordered on exit (as cells are extracted by increasing number
+ * traversal, the list is reordered to ensure the coherency of the extracted
+ * mesh's link to its parent cells, built using this list).
+ *
+ * parameters:
+ * mesh <-- base mesh
+ * name <-- extracted mesh name
+ * cell_list_size <-- size of cell_list[] array
+ * cell_list <-> list of cells (1 to n), or NULL
+ *
+ * returns:
+ * pointer to extracted nodal mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_nodal_t *
+cs_mesh_connect_cells_to_nodal(const cs_mesh_t *mesh,
+ const char *name,
+ fvm_lnum_t cell_list_size,
+ fvm_lnum_t cell_list[]);
+
+/*----------------------------------------------------------------------------
+ * Build a nodal connectivity structure from a subset of a mesh's faces.
+ *
+ * The lists of faces to extract are optional (if none is given, boundary
+ * faces are extracted by default); they do not need to be ordered on input,
+ * but they are always ordered on exit (as faces are extracted by increasing
+ * number traversal, the lists are reordered to ensure the coherency of
+ * the extracted mesh's link to its parent faces, built using these lists).
+ *
+ * parameters:
+ * mesh <-- base mesh
+ * name <-- extracted mesh name
+ * i_face_list_size <-- size of i_face_list[] array
+ * b_face_list_size <-- size of b_face_list[] array
+ * i_face_list <-> list of interior faces (1 to n), or NULL
+ * b_face_list <-> list of boundary faces (1 to n), or NULL
+ *
+ * returns:
+ * pointer to extracted nodal mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_nodal_t *
+cs_mesh_connect_faces_to_nodal(const cs_mesh_t *mesh,
+ const char *name,
+ fvm_lnum_t i_face_list_size,
+ fvm_lnum_t b_face_list_size,
+ fvm_lnum_t i_face_list[],
+ fvm_lnum_t b_face_list[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_CONNECT_H__ */
diff --git a/include/base/cs_mesh_halo.h b/include/base/cs_mesh_halo.h
new file mode 100644
index 0000000..d485bf6
--- /dev/null
+++ b/include/base/cs_mesh_halo.h
@@ -0,0 +1,76 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_HALO_H__
+#define __CS_MESH_HALO_H__
+
+/*============================================================================
+ * Structure and function headers handling with ghost cells
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_interface.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define halo structures for internal and distant ghost cells.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure.
+ * p_gcell_vtx_idx <-- pointer to the connectivity index
+ * p_gcell_vtx_lst <-- pointer to the connectivity list
+ *---------------------------------------------------------------------------*/
+
+void
+cs_mesh_halo_define(cs_mesh_t *mesh,
+ fvm_interface_set_t *interface_set,
+ cs_int_t *p_gcell_vtx_idx[],
+ cs_int_t *p_gcell_vtx_lst[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_HALO_H__ */
diff --git a/include/base/cs_mesh_quality.h b/include/base/cs_mesh_quality.h
new file mode 100644
index 0000000..47f9a30
--- /dev/null
+++ b/include/base/cs_mesh_quality.h
@@ -0,0 +1,95 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_QUALITY_H__
+#define __CS_MESH_QUALITY_H__
+
+/*============================================================================
+ * Compute several mesh quality criteria.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Evaluate face warping angle for internal and border faces..
+ *
+ * parameters:
+ * mesh --> pointer to a cs_mesh_t structure
+ * i_face_normal --> internal face normal
+ * b_face_normal --> border face normal
+ * i_face_warping <-- face warping angle for internal faces
+ * b_face_warping <-- face warping angle for border faces
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quality_compute_warping(const cs_mesh_t *mesh,
+ const cs_real_t i_face_normal[],
+ const cs_real_t b_face_normal[],
+ cs_real_t i_face_warping[],
+ cs_real_t b_face_warping[]);
+
+/*----------------------------------------------------------------------------
+ * Compute mesh quality indicators
+ *
+ * parameters:
+ * mesh --> pointer to a mesh structure.
+ * mesh_quantities --> pointer to a mesh quantities structures.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quality(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_QUALITY_H__ */
diff --git a/include/base/cs_mesh_quantities.h b/include/base/cs_mesh_quantities.h
new file mode 100644
index 0000000..d2a25d7
--- /dev/null
+++ b/include/base/cs_mesh_quantities.h
@@ -0,0 +1,205 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_QUANTITIES_H__
+#define __CS_MESH_QUANTITIES_H__
+
+/*============================================================================
+ * Management of mesh quantities
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definition
+ *============================================================================*/
+
+/* Structure associated to mesh quantities management */
+
+typedef struct {
+
+ cs_real_t *cell_cen; /* Cell center coordinates */
+ cs_real_t *cell_vol; /* Cell volume */
+
+ cs_real_t *i_face_normal; /* Surface normal of internal faces.
+ (L2 norm equals area of the face) */
+ cs_real_t *b_face_normal; /* Surface normal of border faces.
+ (L2 norm equals area of the face) */
+ cs_real_t *i_face_cog; /* Center of gravity of internal faces */
+ cs_real_t *b_face_cog; /* Center of gravity of border faces */
+
+} cs_mesh_quantities_t ;
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Pointer to mesh quantities structure associated to the main mesh */
+
+extern cs_mesh_quantities_t *cs_glob_mesh_quantities;
+
+/*============================================================================
+ * Public functions definition for API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Query or modification of the option for computing cell centers.
+ *
+ * This function returns 1 or 2 according to the selected algorithm.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE ALGCEN (IOPT)
+ * *****************
+ *
+ * INTEGER IOPT : <-> : Choice of the algorithm
+ * < 0 : query
+ * 0 : computation based
+ * on faces (default choice)
+ * 1 : computation based
+ * on vertices
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (algcen, ALGCEN) (cs_int_t *const iopt);
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Query or modification of the option for computing cell centers.
+ *
+ * < 0 : query
+ * 0 : computation based on faces (default choice)
+ * 1 : computation based on vertices
+ *
+ * algo_choice <-- choice of algorithm to compute cell centers.
+ *
+ * returns:
+ * 1 or 2 according to the selected algorithm.
+ *----------------------------------------------------------------------------*/
+
+int
+cs_mesh_quantities_cell_cen_choice(const int algo_choice);
+
+/*----------------------------------------------------------------------------
+ * Create a mesh quantities structure.
+ *
+ * returns:
+ * pointer to created cs_mesh_quantities_t structure
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_quantities_t *
+cs_mesh_quantities_create(void);
+
+/*----------------------------------------------------------------------------
+ * Destroy a mesh quantities structure
+ *
+ * parameters:
+ * mesh_quantities <-- pointer to a cs_mesh_quantities_t structure
+ *
+ * returns:
+ * NULL
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_quantities_t *
+cs_mesh_quantities_destroy(cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------
+ * Compute mesh quantities
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * mesh_quantities <-> pointer to a cs_mesh_quantities_t structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_compute(const cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------
+ * Compute internal and border face normal.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * p_i_face_normal <-> pointer to the internal face normal array
+ * p_b_face_normal <-> pointer to the border face normal array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_face_normal(const cs_mesh_t *mesh,
+ cs_real_t *p_i_face_normal[],
+ cs_real_t *p_b_face_normal[]);
+
+/*----------------------------------------------------------------------------
+ * Compute border face centers and normals.
+ *
+ * The corresponding arrays are allocated by this function, and it is the
+ * caller's responsibility to free them when they are no longer needed.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * p_b_face_cog <-> pointer to the border face center array
+ * p_b_face_normal <-> pointer to the border face normal array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_b_faces(const cs_mesh_t *mesh,
+ cs_real_t *p_b_face_cog[],
+ cs_real_t *p_b_face_normal[]);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_mesh_quantities_t structure
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * mesh_quantities <-- pointer to a cs_mesh_quantities_t structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_dump(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_QUANTITIES_H__ */
diff --git a/include/base/cs_mesh_solcom.h b/include/base/cs_mesh_solcom.h
new file mode 100644
index 0000000..627c07a
--- /dev/null
+++ b/include/base/cs_mesh_solcom.h
@@ -0,0 +1,127 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_SOLCOM_H__
+#define __CS_MESH_SOLCOM_H__
+
+/*============================================================================
+ * Read a mesh in "SolCom" format
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Local type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public functions prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update mesh size information after reading a "SolCom" format file header.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DIMGEO (NDIM , NCELET, NCEL , NFAC , NFABOR, NSOM ,
+ * *****************
+ * LNDFAC, LNDFBR, NFML , NPRFML,
+ * NTETRA, NPYRAM, NPRISM, NHEXAE )
+ *
+ * INTEGER NDIM : <-- : spatial dimension (3)
+ * INTEGER NCELET : <-- : number of extended cells
+ * INTEGER NCEL : <-- : number of true cells
+ * INTEGER NFAC : <-- : number of interior faces
+ * INTEGER NFABOR : <-- : number of boundary faces
+ * INTEGER NSOM : <-- : number of vertices (optional)
+ * INTEGER LNDFAC : <-- : length of SOMFAC (optional)
+ * INTEGER LNDFBR : <-- : length of SOMFBR (optional)
+ * INTEGER NFML : <-- : number of families
+ * INTEGER NPRFML : <-- : max. number of properties per family
+ * INTEGER NTETRA : <-- : number of tetrahedra
+ * INTEGER NPYRAM : <-- : number of pyramids
+ * INTEGER NPRISM : <-- : number of prisms
+ * INTEGER NHEXAE : <-- : number of hexahedra
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (dimgeo, DIMGEO)
+(
+ const cs_int_t *ndim,
+ const cs_int_t *ncelet,
+ const cs_int_t *ncel,
+ const cs_int_t *nfac,
+ const cs_int_t *nfabor,
+ const cs_int_t *nsom,
+ const cs_int_t *lndfac,
+ const cs_int_t *lndfbr,
+ const cs_int_t *nfml,
+ const cs_int_t *nprfml,
+ const cs_int_t *ntetra,
+ const cs_int_t *npyram,
+ const cs_int_t *nprism,
+ const cs_int_t *nhexae
+);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Read a mesh in "SolCom" format (prior to Code_Saturne 1.0)
+ *
+ * parameters:
+ * mesh <-- associated mesh
+ * mesh_quantities <-- associated quantities
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_solcom_read(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_SOLCOM_H__ */
diff --git a/include/base/cs_mesh_warping.h b/include/base/cs_mesh_warping.h
new file mode 100644
index 0000000..dd0c6e8
--- /dev/null
+++ b/include/base/cs_mesh_warping.h
@@ -0,0 +1,78 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MESH_WARPING_H__
+#define __CS_MESH_WARPING_H__
+
+/*============================================================================
+ * Cut warped faces in serial or parallel with/without periodicity.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Cut warped faces.
+ *
+ * Updates border face connectivity and associated mesh quantities.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure.
+ * max_warp_angle --> criterion to know which face to cut
+ * post_tag --> tag to know if we have to post-treat cut faces.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_warping_cut_faces(cs_mesh_t *mesh,
+ double max_warp_angle,
+ cs_bool_t post_tag);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MESH_WARPING_H__ */
diff --git a/include/base/cs_multigrid.h b/include/base/cs_multigrid.h
new file mode 100644
index 0000000..74228a4
--- /dev/null
+++ b/include/base/cs_multigrid.h
@@ -0,0 +1,161 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_MULTIGRID_H__
+#define __CS_MULTIGRID_H__
+
+/*============================================================================
+ * Multigrid solver.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build a hierarchy of meshes starting from a fine mesh, for an
+ * ACM (Additive Corrective Multigrid) method, grouping cells at
+ * most 2 by 2.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(clmlga, CLMLGA)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname, /* <-- variable name length */
+ const cs_int_t *ncelet, /* <-- Number of cells, halo included */
+ const cs_int_t *ncel, /* <-- Number of local cells */
+ const cs_int_t *nfac, /* <-- Number of internal faces */
+ const cs_int_t *isym, /* <-- Symmetry indicator:
+ 1: symmetric; 2: not symmetric */
+ cs_int_t *iagmax, /* <-> Maximum agglomeration count */
+ const cs_int_t *nagmax, /* <-- Agglomeration count limit */
+ const cs_int_t *ncpost, /* <-- If > 0, postprocess coarsening, using
+ coarse cell numbers modulo ncpost */
+ const cs_int_t *iwarnp, /* <-- Verbosity level */
+ const cs_int_t *ngrmax, /* <-- Maximum number of grid levels */
+ const cs_int_t *ncegrm, /* <-- Maximum local number of cells on
+ coarsest grid */
+ const cs_real_t *dam, /* <-- Matrix diagonal */
+ const cs_real_t *xam /* <-- Matrix extra-diagonal terms */
+);
+
+/*----------------------------------------------------------------------------
+ * Destroy a hierarchy of meshes starting from a fine mesh, keeping
+ * the corresponding system information for future calls.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(dsmlga, DSMLGA)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname /* <-- variable name length */
+);
+
+/*----------------------------------------------------------------------------
+ * General sparse linear system resolution
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(resmgr, RESMGR)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname, /* <-- variable name length */
+ const cs_int_t *ncelet, /* <-- Number of cells, halo included */
+ const cs_int_t *ncel, /* <-- Number of local cells */
+ const cs_int_t *nfac, /* <-- Number of faces */
+ const cs_int_t *isym, /* <-- Symmetry indicator:
+ 1: symmetric; 2: not symmetric */
+ const cs_int_t *iresds, /* <-- Descent smoother type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *iresas, /* <-- Ascent smoother type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *ireslp, /* <-- Coarse Resolution type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *ipol, /* <-- Preconditioning polynomial degree
+ (0: diagonal) */
+ const cs_int_t *ncymxp, /* <-- Max number of cycles */
+ const cs_int_t *nitmds, /* <-- Max number of iterations for descent */
+ const cs_int_t *nitmas, /* <-- Max number of iterations for ascent */
+ const cs_int_t *nitmap, /* <-- Max number of iterations for
+ coarsest solution */
+ const cs_int_t *iinvpe, /* <-- Indicator to cancel increments
+ in rotational periodicity (2) or
+ to exchange them as scalars (1) */
+ const cs_int_t *iwarnp, /* <-- Verbosity level */
+ cs_int_t *ncyclf, /* --> Number of cycles done */
+ cs_int_t *niterf, /* --> Number of iterations done */
+ const cs_real_t *epsilp, /* <-- Precision for iterative resolution */
+ const cs_real_t *rnorm, /* <-- Residue normalization */
+ cs_real_t *residu, /* --> Final non normalized residue */
+ const cs_int_t *ifacel, /* <-- Face -> cell connectivity */
+ const cs_real_t *rhs, /* <-- System right-hand side */
+ cs_real_t *vx /* <-> System solution */
+);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize multigrid solver API.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_multigrid_initialize(void);
+
+/*----------------------------------------------------------------------------
+ * Finalize multigrid solver API.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_multigrid_finalize(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_MULTIGRID_H__ */
diff --git a/include/base/cs_numbering.h b/include/base/cs_numbering.h
new file mode 100644
index 0000000..09ac859
--- /dev/null
+++ b/include/base/cs_numbering.h
@@ -0,0 +1,160 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_NUMBERING_H__
+#define __CS_NUMBERING_H__
+
+/*============================================================================
+ * Numbering information for vectorization or multithreading
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/* Renumbering types */
+
+typedef enum {
+
+ CS_NUMBERING_VECTORIZE, /* Numbered for vectorization */
+ CS_NUMBERING_THREADS /* Numbered for threads */
+
+} cs_numbering_type_t;
+
+/* Renumbering structure */
+
+typedef struct {
+
+ cs_numbering_type_t type; /* Numbering type */
+
+ int vector_size; /* Vector size if vectorized, 1 otherwise */
+
+ int n_threads; /* Number of threads */
+ int n_groups; /* Number of associated groups */
+
+ fvm_lnum_t *group_index; /* For thread t and group g, the start and end
+ ids for entities in a given group and thread
+ are group_index[t*n_groups*2 + g] and
+ group_index[t*n_groups*2 + g + 1] respectively.
+ (size: n_groups * n_threads * 2) */
+
+} cs_numbering_t;
+
+/*=============================================================================
+ * Global variable definitions
+ *============================================================================*/
+
+/* Names for numbering types */
+
+extern const char *cs_numbering_type_name[];
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a numbering information structure in case of vectorization.
+ *
+ * parameters:
+ * vector_size <-- vector size used for this vectorization
+ *
+ * returns:
+ * pointer to created cs_numbering_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_numbering_t *
+cs_numbering_create_vectorized(int vector_size);
+
+/*----------------------------------------------------------------------------
+ * Create a numbering information structure in case of threading.
+ *
+ * parameters:
+ * n_threads <-- number of threads
+ * n_groups <-- number of groups
+ * group_index <-- group_index[thread_id*group_id*2 + group_id*2] and
+ * group_index[thread_id*group_id*2 + group_id*2 +1] define
+ * the start and end ids for entities in a given group and
+ * thread; (size: n_groups *2 * n_threads)
+ *
+ * returns:
+ * pointer to created cs_numbering_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_numbering_t *
+cs_numbering_create_threaded(int n_threads,
+ int n_groups,
+ fvm_lnum_t group_index[]);
+
+/*----------------------------------------------------------------------------
+ * Destroy a numbering information structure.
+ *
+ * parameters:
+ * numbering <-> pointer to cs_numbering_t structure pointer (or NULL)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_numbering_destroy(cs_numbering_t **numbering);
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_numbering_t structure.
+ *
+ * parameters:
+ * numbering <-- pointer to cs_numbering_t structure (or NULL)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_numbering_dump(const cs_numbering_t *numbering);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_NUMBERING_H__ */
diff --git a/include/base/cs_opts.h b/include/base/cs_opts.h
new file mode 100644
index 0000000..54d5872
--- /dev/null
+++ b/include/base/cs_opts.h
@@ -0,0 +1,151 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_OPTS_H__
+#define __CS_OPTS_H__
+
+/*============================================================================
+ * Parsing of program arguments and associated initializations
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Code_Saturne base options structure
+ *----------------------------------------------------------------------------*/
+
+typedef struct {
+
+ cs_int_t ifoenv; /* 0 if not using Preprocessor, 1 otherwise */
+
+ /* Redirection of standard output */
+
+ cs_int_t ilisr0; /* Redirection for rank 0
+ (0: not redirected;
+ 1: redirected to "listing" file) */
+ cs_int_t ilisrp; /* Redirection for ranks > 0
+ (0: not redirected;
+ 1: redirected to "listing_n*" file;
+ 2: redirected to "/dev/null", suppressed) */
+
+ /* Other options */
+
+ cs_bool_t verif; /* Mesh quality verification mode */
+
+ int benchmark; /* Benchmark mode:
+ 0: not used;
+ 1: timing (CPU + Walltime) mode
+ 2: MPI trace-friendly mode */
+
+ /* Cut of warped faces */
+
+ cs_bool_t cwf; /* true if cut is required */
+ cs_bool_t cwf_post; /* true if post-treatment is required */
+ double cwf_criterion; /* Criterion to choose which face to cut */
+
+ /* Server socket for SYRTHES 3 coupling */
+
+ int syr_socket; /* socket number to use, or -1 */
+
+ /* Connection with YACS or proxy */
+
+ char *yacs_module; /* Path to YACS module */
+
+ char *proxy_socket; /* Name of proxy socket */
+ int proxy_key; /* Key for connection to proxy */
+
+} cs_opts_t;
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Print logfile header
+ *
+ * parameters:
+ * argc --> number of command line arguments
+ * argv --> array of command line arguments
+ *----------------------------------------------------------------------------*/
+
+void
+cs_opts_logfile_head(int argc,
+ char *argv[]);
+
+/*----------------------------------------------------------------------------
+ * First analysis of the command line to determine if we require MPI,
+ * and initialization if necessary
+ *
+ * parameters:
+ * argc <-> number of command line arguments
+ * argv <-> array of command line arguments
+ *
+ * returns:
+ * -1 if MPI is not needed, or application number in MPI_COMM_WORLD of
+ * processes associated with this instance of Code_Saturne
+ *----------------------------------------------------------------------------*/
+
+int
+cs_opts_mpi_init(int *argc,
+ char **argv[]);
+
+/*----------------------------------------------------------------------------
+ * Define options and call some associated initializations
+ * based on command line arguments
+ *
+ * parameters:
+ * argc --> number of command line arguments
+ * argv --> array of command line arguments
+ * opts <-- options structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_opts_define(int argc,
+ char *argv[],
+ cs_opts_t *opts);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_OPTS_H__ */
diff --git a/include/base/cs_parall.h b/include/base/cs_parall.h
new file mode 100644
index 0000000..4b03471
--- /dev/null
+++ b/include/base/cs_parall.h
@@ -0,0 +1,599 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_PARALL_H__
+#define __CS_PARALL_H__
+
+/*============================================================================
+ * Functions dealing with parallelism
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_interface.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public functions definition for API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update a buffer on cells in case of parallelism
+ *
+ * This function copies values of the cells in the send_halo (local cells) to
+ * ghost cells on distant ranks.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE PARCOM (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR(NCELET) : <-> : variable on cells, output is an update
+ * of VAR(NCEL+1..NCELET)
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcom, PARCOM)(cs_real_t var[]);
+
+/*----------------------------------------------------------------------------
+ * Update a buffer on cells in case of parallelism
+ *
+ * This function copies values of the cells in the entire (i.e. std + ext)
+ * send_halo (local cells) to ghost cells on distant ranks.
+ *
+ * PVAR has to be well allocated => n_cells + n_cells_with_ghosts where
+ * n_cells_with_ghosts = n_std_ghost_cells + n_ext_ghost_cells.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE PARCVE
+ * *****************
+ *
+ * DOUBLE PRECISION PVAR : <-> : variable buffer to sync
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcve, PARCVE)(cs_real_t pvar[]);
+
+/*----------------------------------------------------------------------------
+ * Compute the maximum value of a counter (int) for the entire domain in
+ * case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARCMX (IND)
+ * *****************
+ *
+ * INTEGER COUNTER <-> : input = local counter
+ * output = global max counter
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcmx, PARCMX)(cs_int_t *counter);
+
+/*----------------------------------------------------------------------------
+ * Compute the minimum value of a counter (int) for the entire domain in
+ * case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARCMN (IND)
+ * *****************
+ *
+ * INTEGER COUNTER <-> : input = local counter
+ * output = global min counter
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcmn, PARCMN)(cs_int_t *counter);
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum of a counter (int) for the entire domain in case
+ * of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARCPT (CPT)
+ * *****************
+ *
+ * INTEGER COUNTER : <-> : input = counter to sum
+ * output = global sum
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcpt, PARCPT)(cs_int_t *counter);
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum of a real for the entire domain in case of parellism
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARSOM (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR : <-> : input = value to sum
+ * output = global sum
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parsom, PARSOM)(cs_real_t *var);
+
+/*----------------------------------------------------------------------------
+ * Compute the maximum value of a real variable for the entire domain in case
+ * of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARMAX (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR : <-> : input = local maximum value
+ * output = global maximum value
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmax, PARMAX)(cs_real_t *var);
+
+/*----------------------------------------------------------------------------
+ * Compute the minimum value of a real variable for the entire domain in case
+ * of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARMIN (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR : <-> : input = local minimum value
+ * output = global minimum value
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmin, PARMIN)(cs_real_t *var);
+
+/*----------------------------------------------------------------------------
+ * Maximum value of a real and its related rank for the entire domain in
+ * case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARMXL (NBR, VAR, XYZVAR)
+ * *****************
+ *
+ * INTEGER NBR : -> : nombre de valeurs associees
+ * DOUBLE PRECISION VAR : <-> : input: local max. value
+ * output: global max. value
+ * DOUBLE PRECISION XYZVAR(NBR) : <-> : input: value related to local max.
+ * output: value related to global max.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmxl, PARMXL)(cs_int_t *nbr,
+ cs_real_t *var,
+ cs_real_t xyzvar[]);
+
+/*----------------------------------------------------------------------------
+ * Minimum value of a real and its related rank for the entire domain in
+ * case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE PARMNL (NBR, VAR, XYZVAR)
+ * *****************
+ *
+ * INTEGER NBR : --> : size of the related variable
+ * DOUBLE PRECISION VAR : <-> : input: local max. value
+ * output: global max. value
+ * DOUBLE PRECISION XYZVAR(NBR) : <-> : input: value related to local max.
+ * output: value related to global max.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmnl, PARMNL)(cs_int_t *nbr,
+ cs_real_t *var,
+ cs_real_t xyzvar[]);
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum for each element of an array of int in case of
+ * parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARISM (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * INTEGER ARRAY(*) : <-> : input = local array
+ * output = array of global sum values.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parism, PARISM)(cs_int_t *n_elts,
+ cs_int_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Compute the global maximum value for each element of an array of int in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARIMX (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * INTEGER ARRAY(*) : <-> : input = local array
+ * output = array of global max. values.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parimx, PARIMX)(cs_int_t *n_elts,
+ cs_int_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Compute the global minimum value for each element of an array of int in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARIMN (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * INTEGER ARRAY(*) : <-> : input = local array
+ * output = array of global min. values.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parimn, PARIMN)(cs_int_t *n_elts,
+ cs_int_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum for each element of an array of real in case of
+ * parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARRSM (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * DOUBLE PRECISION ARRAY(*) : <-> : input = local array
+ * output = array of global sum values.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parrsm, PARRSM)(cs_int_t *n_elts,
+ cs_real_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Compute the global maximum value for each element of an array of real in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARRMX (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array
+ * DOUBLE PRECISION ARRAY(*) : <-> : input = local array
+ * output = array of global max. values.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parrmx, PARRMX)(cs_int_t *n_elts,
+ cs_real_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Compute the global minimum value for each element of an array of real in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARRMN (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array
+ * DOUBLE PRECISION ARRAY(*) : <-> : input = local array
+ * output = array of global min. values.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parrmn, PARRMN)(cs_int_t *n_elts,
+ cs_real_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Broadcast to all the ranks the value of each element of an array of int.
+ * (encapsulation of MPI_Bcast())
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARBCI (IRANK, N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER IRANK : --> : rank related to the sending process
+ * INTEGER N_ELTS : --> : size of the array
+ * INTEGER ARRAY(*) : <-> : array of int
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parbci, PARBCI)(cs_int_t *irank,
+ cs_int_t *n_elts,
+ cs_int_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Broadcast to all the ranks the value of each element of an array of real.
+ * (encapsulation of MPI_Bcast())
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARBCR (IRANK, N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER IRANK : --> : rank related to the sending process
+ * INTEGER N_ELTS : --> : size of the array
+ * DOUBLE PRECISION ARRAY(*) : <-> : array of real
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parbcr, PARBCR)(cs_int_t *irank,
+ cs_int_t *n_elts,
+ cs_real_t array[]);
+
+/*----------------------------------------------------------------------------
+ * Build a global array from each local array in each domain. The size of
+ * each local array can be different.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARAGV (NVAR, NVARGB, VAR, VARGB)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the local array
+ * INTEGER N_G_ELTS : --> : size of the global array
+ * DOUBLE PRECISION ARRAY(*) : --> : local array
+ * DOUBLE PRECISION G_ARRAY(*) : <-- : global array
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (paragv, PARAGV)(cs_int_t *n_elts,
+ cs_int_t *n_g_elts,
+ cs_real_t array[],
+ cs_real_t *g_array);
+
+/*----------------------------------------------------------------------------
+ * Find a node which minimizes a given distance and its related rank.
+ * May be used to locate a node among several domains.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARFPT (NODE, NDRANG, DIS2MN)
+ * *****************
+ *
+ * INTEGER NODE : <-> : local number of the closest node
+ * INTEGER NDRANG : <-- : rank id for which the distance is the
+ * smallest
+ * DOUBLE PRECISION DIS2MN : --> : square distance between the closest node
+ * and the wanted node.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parfpt, PARFPT)(cs_int_t *node,
+ cs_int_t *ndrang,
+ cs_real_t *dis2mn);
+
+/*----------------------------------------------------------------------------
+ * Return the value associated to a probe.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARHIS (NODE, NDRANG, VAR, VARCAP)
+ * *****************
+ *
+ * INTEGER NODE : --> : local number of the element related to
+ * a measure node
+ * INTEGER NDRANG : --> : rank of the process owning the closest
+ * node from the measure node
+ * DOUBLE PRECISION VAR(*) : --> : values of the variable on local elements
+ * DOUBLE PRECISION VARCAP : <-- : value of the variable for the element
+ * related to the measure node
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parhis, PARHIS)(cs_int_t *node,
+ cs_int_t *ndrang,
+ cs_real_t var[],
+ cs_real_t *varcap);
+
+/*----------------------------------------------------------------------------
+ * Return the global cell number of a local cell.
+ * (send to all the processes)
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARCEL (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local cell number
+ * INTEGER RANKID : --> : rank of the domain (0 to N-1)
+ * INTEGER GNUM : <-- : global cell number
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcel, PARCEL)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum);
+
+/*----------------------------------------------------------------------------
+ * Return the global cell number knowing its related local cell number. No
+ * communication is useful.
+ * Return the local cell number in serial mode.
+ * Return 0 if the local cell number > mesh->n_cells
+ * Return 0 if the current rank domain != RANKID
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE PARCLG (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local cell number
+ * INTEGER RANKID : --> : rank of the current domain (0 to N-1)
+ * INTEGER GNUM : <-- : global cell number
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parclg, PARCLG)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum);
+
+/*----------------------------------------------------------------------------
+ * Return the global internal face number knowing its related local internal
+ * face number. No communication is useful.
+ * Return the local internal face number in serial mode.
+ * Return 0 if the local internal face number > mesh->n_i_faces
+ * Return 0 if the current rank domain != RANKID
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARFIG (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local internal face number
+ * INTEGER RANKID : --> : rank of the current domain (0 to N-1)
+ * INTEGER GNUM : <-- : global internal face number
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parfig, PARFIG)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum);
+
+/*----------------------------------------------------------------------------
+ * Return the global border face number knowing its related local border face
+ * number. No communication is useful.
+ * Return the local border face number in serial mode.
+ * Return 0 if the local border face number > mesh->n_b_faces
+ * Return 0 if the current rank domain != RANKID
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARFBG (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local border face number
+ * INTEGER RANKID : --> : rank of the current domain (0 to N-1)
+ * INTEGER GNUM : <-- : global border face number
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parfbg, PARFBG)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum);
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute the sum of real values for entities belonging to a fvm_interface_t
+ * structure.
+ *
+ * Only the values of entities belonging to the interface are summed.
+ *
+ * parameters:
+ * interfaces --> pointer to a fvm_interface_set_t structure
+ * var_size --> number of elements in var buffer
+ * stride --> number of values (no interlaced) by entity
+ * var <-> variable buffer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_parall_interface_sr(fvm_interface_set_t *interfaces,
+ cs_int_t var_size,
+ cs_int_t stride,
+ cs_real_t *var);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_PARALL_H__ */
diff --git a/include/base/cs_perio.h b/include/base/cs_perio.h
new file mode 100644
index 0000000..be36f50
--- /dev/null
+++ b/include/base/cs_perio.h
@@ -0,0 +1,636 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_PERIO_H__
+#define __CS_PERIO_H__
+
+/*============================================================================
+ * Structure and function headers associated to periodicity
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Macro Definition
+ *============================================================================*/
+
+#define CS_NPHSMX 1 /* Max number of phases */
+ /* Keep it coherent with NPHSMX in paramx.h */
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Periodicity treatment for the halo when the periodicity is a rotation
+ *----------------------------------------------------------------------------*/
+
+typedef enum {
+
+ CS_PERIO_ROTA_COPY , /* Copy halo (for scalar) */
+ CS_PERIO_ROTA_RESET , /* Reset halo in case of rotation */
+ CS_PERIO_ROTA_IGNORE /* Ignore halo in case of rotation */
+
+} cs_perio_rota_t ;
+
+/*============================================================================
+ * Public function header for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update values of periodic cells on standard halos.
+ *
+ * VARIJ stands for the periodic variable to deal with.
+ *
+ * Several cases are possible:
+ *
+ * IDIMTE = 0 : VAR11 is a scalar.
+ * IDIMTE = 1 : VAR11, VAR22, VAR33 is a vector.
+ * IDIMTE = 2 : VARIJ is a 3*3 matrix.
+ * IDIMTE = 21 : VARIJ is a diagonal 3*3 matrix (VAR11, VAR22, VAR33).
+ *
+ * Translation is always treated. Several treatment can be done for rotation:
+ *
+ * ITENSO = 0 : only copy values of elements generated by rotation
+ * ITENSO = 1 : ignore rotation.
+ * ITENSO = 11 : reset values of elements generated by rotation
+ *
+ * - Periodicity for a scalar (IDIMTE = 0, ITENSO = 0). We update VAR11
+ * for translation or rotation periodicity.
+ * - Periodicity for a scalar (IDIMTE = 0, ITENSO = 1). We update VAR11 only
+ * for translation periodicity.
+ * - Periodicity for a scalar (IDIMTE = 0, ITENSO = 11). We update VAR11 only
+ * for translation periodicity. VAR11 is reseted for rotation periodicicty.
+ *
+ * We use this option to cancel the halo for rotational periodicities
+ * in iterative solvers when solving for vectors and tensors by
+ * increment. This is an approximative solution, which does not seem
+ * worse than another.
+ *
+ * - with a vector (IDIMTE = 0, ITENSO = 2), we update
+ * VAR11, VAR22, VAR33, for translation only.
+ * - with a vector (IDIMTE = 1, ITENSO = *), we update
+ * VAR11, VAR22, VAR33, for translation and rotation.
+ * - with a tensor of rank 2 (IDIMTE = 2, ITENSO = *), we update
+ * VAR11, V12, VAR13, VAR21, VAR22, VAR23, VAR31, VAR32, VAR33,
+ * for translation and rotation.
+ * - with a tensor or rank 2 (IDIMTE = 21, ITENSO = *) , we update
+ * VAR11, VAR22, VAR33, for translation and rotation (the tensor
+ * is considered diagonal).
+ *
+ * Fortran API:
+ *
+ * SUBROUTINE PERCOM
+ * *****************
+ *
+ * INTEGER IDIMTE : -> : variable dimension (maximum 3)
+ * 0 : scalar (VAR11), or considered
+ * scalar
+ * 1 : vector (VAR11,VAR22,VAR33)
+ * 2 : tensor of rank 2 (VARIJ)
+ * 21 : tensor of rank 2 supposed
+ * diagonal (VAR11, VAR22, VAR33)
+ * INTEGER ITENSO : -> : to define rotation behavior
+ * 0 : scalar (VAR11)
+ * 1 : tensor or vector component
+ * (VAR11), implicit in
+ * translation case
+ * 11 : same as ITENSO=1 with vector
+ * or tensor component cancelled
+ * for rotation
+ * 2 : vector (VAR11, VAR22, VAR33)
+ * implicit for rotation
+ * DOUBLE PRECISION VAR11(NCELET) : - : component 11 of rank 2 tensor
+ * DOUBLE PRECISION VAR12(NCELET) : - : component 12 of rank 2 tensor
+ * DOUBLE PRECISION VAR13(NCELET) : - : component 13 of rank 2 tensor
+ * DOUBLE PRECISION VAR21(NCELET) : - : component 21 of rank 2 tensor
+ * DOUBLE PRECISION VAR22(NCELET) : - : component 22 of rank 2 tensor
+ * DOUBLE PRECISION VAR23(NCELET) : - : component 23 of rank 2 tensor
+ * DOUBLE PRECISION VAR31(NCELET) : - : component 31 of rank 2 tensor
+ * DOUBLE PRECISION VAR32(NCELET) : - : component 32 of rank 2 tensor
+ * DOUBLE PRECISION VAR33(NCELET) : - : component 33 of rank 2 tensor
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (percom, PERCOM) (const cs_int_t *idimte,
+ const cs_int_t *itenso,
+ cs_real_t var11[],
+ cs_real_t var12[],
+ cs_real_t var13[],
+ cs_real_t var21[],
+ cs_real_t var22[],
+ cs_real_t var23[],
+ cs_real_t var31[],
+ cs_real_t var32[],
+ cs_real_t var33[]);
+
+/*----------------------------------------------------------------------------
+ * Update values of periodic cells on extended halos.
+ *
+ * Except for the extended halo, this function is the same as PERCOM.
+ *
+ * Fortran API:
+ *
+ * SUBROUTINE PERCVE
+ * *****************
+ *
+ * INTEGER IDIMTE : -> : variable dimension (maximum 3)
+ * 0 : scalar (VAR11), or considered
+ * scalar
+ * 1 : vector (VAR11,VAR22,VAR33)
+ * 2 : tensor of rank 2 (VARIJ)
+ * 21 : tensor of rank 2 supposed
+ * diagonal (VAR11, VAR22, VAR33)
+ * INTEGER ITENSO : -> : to define rotation behavior
+ * 0 : scalar (VAR11)
+ * 1 : tensor or vector component
+ * (VAR11), implicit in
+ * translation case
+ * 11 : same as ITENSO=1 with vector
+ * or tensor component cancelled
+ * for rotation
+ * 2 : vector (VAR11, VAR22, VAR33)
+ * implicit for rotation
+ * DOUBLE PRECISION VAR11(NCELET) : - : component 11 of rank 2 tensor
+ * DOUBLE PRECISION VAR12(NCELET) : - : component 12 of rank 2 tensor
+ * DOUBLE PRECISION VAR13(NCELET) : - : component 13 of rank 2 tensor
+ * DOUBLE PRECISION VAR21(NCELET) : - : component 21 of rank 2 tensor
+ * DOUBLE PRECISION VAR22(NCELET) : - : component 22 of rank 2 tensor
+ * DOUBLE PRECISION VAR23(NCELET) : - : component 23 of rank 2 tensor
+ * DOUBLE PRECISION VAR31(NCELET) : - : component 31 of rank 2 tensor
+ * DOUBLE PRECISION VAR32(NCELET) : - : component 32 of rank 2 tensor
+ * DOUBLE PRECISION VAR33(NCELET) : - : component 33 of rank 2 tensor
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (percve, PERCVE) (const cs_int_t *idimte,
+ const cs_int_t *itenso,
+ cs_real_t var11[],
+ cs_real_t var12[],
+ cs_real_t var13[],
+ cs_real_t var21[],
+ cs_real_t var22[],
+ cs_real_t var23[],
+ cs_real_t var31[],
+ cs_real_t var32[],
+ cs_real_t var33[]);
+
+/*----------------------------------------------------------------------------
+ * Periodicity management for INIMAS
+ *
+ * If INIMAS is called by NAVSTO :
+ * We assume that gradient on ghost cells given by a rotation is known
+ * and is equal to the velocity one for the previous time step.
+ * If INIMAS is called by DIVRIJ
+ * We assume that (more justifiable than in previous case) gradient on
+ * ghost cells given by rotation is equal to Rij gradient for the previous
+ * time step.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PERMAS
+ * *****************
+ *
+ * INTEGER IMASPE : -> : suivant l'appel de INIMAS
+ * = 1 si appel de RESOLP ou NAVSTO
+ * = 2 si appel de DIVRIJ
+ * INTEGER IPHAS : -> : numero de phase courante
+ * INTEGER IMASPE : -> : indicateur d'appel dans INIMAS
+ * = 1 si appel au debut
+ * = 2 si appel a la fin
+ * DOUBLE PRECISION ROM(NCELET) : -> : masse volumique aux cellules
+ * DOUBLE PRECISION DUDXYZ : -> : gradient de U aux cellules halo pour
+ * l'approche explicite en periodicite
+ * DOUBLE PRECISION DRDXYZ : -> : gradient de R aux cellules halo pour
+ * l'approche explicite en periodicite
+ * DOUBLE PRECISION WDUDXY : - : tableau de travail pour DUDXYZ
+ * DOUBLE PRECISION WDRDXY : - : tableau de travail pour DRDXYZ
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (permas, PERMAS)(const cs_int_t *imaspe,
+ const cs_int_t *iphas,
+ const cs_int_t *iappel,
+ cs_real_t rom[],
+ cs_real_t *dudxyz,
+ cs_real_t *drdxyz,
+ cs_real_t *wdudxy,
+ cs_real_t *wdrdxy);
+
+/*----------------------------------------------------------------------------
+ * Process DPDX, DPDY, DPDZ buffers in case of rotation on velocity vector and
+ * Reynolds stress tensor.
+ *
+ * We retrieve the gradient given by PERINU and PERINR (PHYVAR) for the
+ * velocity and the Reynolds stress tensor in a buffer on ghost cells. Then
+ * we define DPDX, DPDY and DPDZ gradient (1 -> n_cells_with_ghosts).
+ *
+ * We can't implicitly take into account rotation of a gradient of a non-scalar
+ * variable because we have to know the all three components in GRADRC.
+ *
+ * Otherwise, we can implicitly treat values given by translation. There will
+ * be replace further in GRADRC.
+ *
+ * We define IDIMTE to 0 and ITENSO to 2 for the velocity vector and the
+ * Reynolds stress tensor. We will still have to apply translation to these
+ * variables so we define a tag to not forget to do it.
+ *
+ * We assume that is correct to treat implicitly periodicities for the other
+ * variables in GRADRC. We define IDIMTE to 1 and ITENSO to 0.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PERING
+ * *****************
+ *
+ * INTEGER NPHAS : -> : numero de phase courante
+ * INTEGER IVAR : -> : numero de la variable
+ * INTEGER IDIMTE : <- : dimension de la variable (maximum 3)
+ * 0 : scalaire (VAR11), ou assimile
+ * scalaire
+ * 1 : vecteur (VAR11,VAR22,VAR33)
+ * 2 : tenseur d'ordre 2 (VARIJ)
+ * 21 : tenseur d'ordre 2 suppose
+ * diagonal (VAR11, VAR22, VAR33)
+ * INTEGER ITENSO : <- : pour l'explicitation de la rotation
+ * 0 : scalaire (VAR11)
+ * 1 : composante de vecteur ou de
+ * tenseur (VAR11) implicite pour
+ * la translation
+ * 11 : reprend le traitement ITENSO=1
+ * et composante de vecteur ou de
+ * tenseur annulee pour la rotation
+ * 2 : vecteur (VAR11 et VAR22 et VAR33)
+ * implicite pour la rotation
+ * INTEGER IPEROT : -> : indicateur du nombre de periodicte de
+ * rotation
+ * INTEGER IGUPER : -> : 0/1 indique qu'on a /n'a pas calcule
+ * les gradients dans DUDXYZ
+ * INTEGER IGRPER : -> : 0/1 indique qu'on a /n'a pas calcule
+ * les gradients dans DRDXYZ
+ * INTEGER IU : -> : position de la Vitesse(x,y,z)
+ * INTEGER IV : -> : dans RTP, RTPA
+ * INTEGER IW : -> : " "
+ * INTEGER ITYTUR : -> : turbulence (Rij-epsilon ITYTUR = 3)
+ * INTEGER IR11 : -> : position des Tensions de Reynolds
+ * INTEGER IR22 : -> : en Rij dans RTP, RTPA
+ * INTEGER IR33 : -> : " "
+ * INTEGER IR12 : -> : " "
+ * INTEGER IR13 : -> : " "
+ * INTEGER IR23 : -> : " "
+ * DOUBLE PRECISION DPDX(NCELET) : <-> : gradient de IVAR
+ * DOUBLE PRECISION DPDY(NCELET) : <-> : " "
+ * DOUBLE PRECISION DPDZ(NCELET) : <-> : " "
+ * DOUBLE PRECISION DUDXYZ : -> : gradient de U aux cellules halo pour
+ * l'approche explicite en periodicite
+ * DOUBLE PRECISION DRDXYZ : -> : gradient de R aux cellules halo pour
+ * l'approche explicite en periodicite
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (pering, PERING)(const cs_int_t *nphas,
+ const cs_int_t *ivar,
+ cs_int_t *idimte,
+ cs_int_t *itenso,
+ const cs_int_t *iperot,
+ const cs_int_t *iguper,
+ const cs_int_t *igrper,
+ const cs_int_t iu[CS_NPHSMX],
+ const cs_int_t iv[CS_NPHSMX],
+ const cs_int_t iw[CS_NPHSMX],
+ const cs_int_t itytur[CS_NPHSMX],
+ const cs_int_t ir11[CS_NPHSMX],
+ const cs_int_t ir22[CS_NPHSMX],
+ const cs_int_t ir33[CS_NPHSMX],
+ const cs_int_t ir12[CS_NPHSMX],
+ const cs_int_t ir13[CS_NPHSMX],
+ const cs_int_t ir23[CS_NPHSMX],
+ cs_real_t dpdx[],
+ cs_real_t dpdy[],
+ cs_real_t dpdz[],
+ const cs_real_t *dudxyz,
+ const cs_real_t *drdxyz);
+
+/*----------------------------------------------------------------------------
+ * Exchange buffers for PERINU
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PEINU1
+ * *****************
+ *
+ * INTEGER ISOU : -> : component of the velocity vector
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DUDXYZ : -> : gradient of the velocity vector
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ * DOUBLE PRECISION W1..3(NCELET) : - : working buffers
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinu1, PEINU1)(const cs_int_t *isou,
+ const cs_int_t *iphas,
+ cs_real_t *dudxyz,
+ cs_real_t w1[],
+ cs_real_t w2[],
+ cs_real_t w3[]);
+
+/*----------------------------------------------------------------------------
+ * Apply rotation on DUDXYZ tensor.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PEINU2 (VAR)
+ * *****************
+ *
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DUDXYZ : <-> : gradient of the velocity vector
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinu2, PEINU2)(const cs_int_t *iphas,
+ cs_real_t *dudxyz);
+
+/*----------------------------------------------------------------------------
+ * Exchange buffers for PERINR
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PEINR1 (VAR)
+ * *****************
+ *
+ * INTEGER ISOU : -> : component of the Reynolds stress tensor
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DRDXYZ : <-> : gradient of the Reynolds stress tensor
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ * DOUBLE PRECISION W1..3(NCELET) : - : working buffers
+ *
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinr1, PEINR1)(const cs_int_t *isou,
+ const cs_int_t *iphas,
+ cs_real_t *drdxyz,
+ cs_real_t w1[],
+ cs_real_t w2[],
+ cs_real_t w3[]);
+
+/*----------------------------------------------------------------------------
+ * Apply rotation on the gradient of Reynolds stress tensor
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PEINR2 (VAR)
+ * *****************
+ *
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DRDXYZ : -> : gradient of the Reynolds stress tensor
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ *
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinr2, PEINR2)(const cs_int_t *iphas,
+ cs_real_t *drdxyz);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Apply transformation on coordinates.
+ *
+ * parameters:
+ * halo <-> halo associated with coordinates to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * coords --> coordinates on which transformation have to be done.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_coords(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t *coords);
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real scalar between periodic elements.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * rota_mode --> Kind of treatment to do on periodic cells of the halo:
+ * COPY, IGNORE or RESET
+ * var <-> scalar to synchronize
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_scal(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_perio_rota_t rota_mode,
+ cs_real_t var[]);
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real vector between periodic cells.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * rota_mode --> Kind of treatment to do on periodic cells of the halo:
+ * COPY, IGNORE or RESET
+ * var_x <-> component of the vector to update
+ * var_y <-> component of the vector to update
+ * var_z <-> component of the vector to update
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_vect(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_perio_rota_t rota_mode,
+ cs_real_t var_x[],
+ cs_real_t var_y[],
+ cs_real_t var_z[]);
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real tensor between periodic cells.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * var11 <-> component of the tensor to update
+ * var12 <-> component of the tensor to update
+ * var13 <-> component of the tensor to update
+ * var21 <-> component of the tensor to update
+ * var22 <-> component of the tensor to update
+ * var23 <-> component of the tensor to update
+ * var31 <-> component of the tensor to update
+ * var32 <-> component of the tensor to update
+ * var33 <-> component of the tensor to update
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_tens(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var11[],
+ cs_real_t var12[],
+ cs_real_t var13[],
+ cs_real_t var21[],
+ cs_real_t var22[],
+ cs_real_t var23[],
+ cs_real_t var31[],
+ cs_real_t var32[],
+ cs_real_t var33[]);
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real diagonal tensor between periodic cells.
+ *
+ * We only know the diagonal of the tensor.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * var11 <-> component of the tensor to update
+ * var22 <-> component of the tensor to update
+ * var33 <-> component of the tensor to update
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_diag(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var11[],
+ cs_real_t var22[],
+ cs_real_t var33[]);
+
+/*----------------------------------------------------------------------------
+ * Update global halo backup buffer size so as to be usable with a given halo.
+ *
+ * This function should be called at the end of any halo creation,
+ * so that buffer sizes are increased if necessary.
+ *
+ * parameters:
+ * halo --> pointer to cs_mesh_halo_t structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_perio_update_buffer(const cs_halo_t *halo);
+
+/*----------------------------------------------------------------------------
+ * Update free global halo backup buffer.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_perio_free_buffer(void);
+
+/*----------------------------------------------------------------------------
+ * Save rotation terms of a halo to an internal buffer.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * op_type --> kind of halo treatment (standard or extended)
+ * var --> variable whose halo rotation terms are to be saved
+ * (size: halo->n_local_elts + halo->n_elts[opt_type])
+ *
+ * returns:
+ * local number of values saved or restored.
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_perio_save_rotation_halo(const cs_halo_t *halo,
+ cs_halo_type_t op_type,
+ const cs_real_t var[]);
+
+/*----------------------------------------------------------------------------
+ * Restore rotation terms of a halo from an internal buffer.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * op_type --> kind of halo treatment (standard or extended)
+ * var <-> variable whose halo rotation terms are to be restored
+ *
+ * returns:
+ * local number of values saved or restored.
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_perio_restore_rotation_halo(const cs_halo_t *halo,
+ cs_halo_type_t op_type,
+ cs_real_t var[]);
+
+/*----------------------------------------------------------------------------
+ * Define parameters for building an interface set structure on the main mesh.
+ *
+ * parameters:
+ * p_n_periodic_lists <-> pointer to the number of periodic lists (may
+ * be local)
+ * p_periodic_num <-> pointer to the periodicity number (1 to n)
+ * associated with each periodic list (primary
+ * periodicities only)
+ * p_n_periodic_couples <-> pointer to the number of periodic couples
+ * p_periodic_couples <-> pointer to the periodic couple list
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_define_couples(int *p_n_periodic_lists,
+ int *p_periodic_num[],
+ fvm_lnum_t *p_n_periodic_couples[],
+ fvm_gnum_t **p_periodic_couples[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_PERIO_H__ */
+
diff --git a/include/base/cs_post.h b/include/base/cs_post.h
new file mode 100644
index 0000000..10b7522
--- /dev/null
+++ b/include/base/cs_post.h
@@ -0,0 +1,971 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_POST_H__
+#define __CS_POST_H__
+
+/*============================================================================
+ * Post-processing management
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_writer.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Local type definitions
+ *============================================================================*/
+
+/* Datatype enumeration */
+
+typedef enum {
+ CS_POST_TYPE_cs_int_t,
+ CS_POST_TYPE_cs_real_t,
+ CS_POST_TYPE_int,
+ CS_POST_TYPE_float,
+ CS_POST_TYPE_double
+} cs_post_type_t;
+
+/* Function pointer associated with a specific post-processing variables
+ output: such functions are registered using the cs_post_add_time_dep_var(),
+ and all registered functions are automatically called by PSTVAR. */
+
+typedef void
+(cs_post_time_dep_var_t) (int instance_id,
+ int nt_cur_abs,
+ cs_real_t t_cur_abs);
+
+/*=============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public Fortran function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a writer based on Fortran data; this object is based on a choice
+ * of a case, directory, and format, as well as indicator for associated
+ * meshe's time dependency, and the default output frequency for associated
+ * variables.
+ *
+ * Fortran Interface: use PSTCWR (see cs_post_util.F)
+ *
+ * SUBROUTINE PSTCW1 (NUMGEP, NOMCAS, NOMREP, NOMFMT, OPTFMT,
+ * *****************
+ * LNMCAS, LNMFMT, LNMREP, LOPFMT,
+ * INDMOD, NTCHR)
+ *
+ * INTEGER NUMWRI : <-- : Number of writer to create (< 0 for
+ * : : standard writer, > 0 for user writer)
+ * CHARACTER NOMCAS : <-- : Name of associated case
+ * CHARACTER NOMREP : <-- : Name of associated directory
+ * INTEGER NOMFMT : <-- : Name of associated format
+ * INTEGER OPTFMT : <-- : Additional format options
+ * INTEGER LNMCAS : <-- : Case name length
+ * INTEGER LNMREP : <-- : Directory name length
+ * INTEGER LNMFMT : <-- : Format name length
+ * INTEGER LOPFMT : <-- : Format options string length
+ * INTEGER INDMOD : <-- : 0 if fixed, 1 if deformable,
+ * : : 2 if topology changes
+ * INTEGER NTCHR : <-- : Default output frequency
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstcw1, PSTCW1)
+(
+ const cs_int_t *numwri,
+ const char *nomcas,
+ const char *nomrep,
+ const char *nomfmt,
+ const char *optfmt,
+ const cs_int_t *lnmcas,
+ const cs_int_t *lnmrep,
+ const cs_int_t *lnmfmt,
+ const cs_int_t *lopfmt,
+ const cs_int_t *indmod,
+ const cs_int_t *ntchr
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*----------------------------------------------------------------------------
+ * Create a post-processing mesh; lists of cells or faces to extract are
+ * sorted upon exit, whether they were sorted upon calling or not.
+ *
+ * The list of associated cells is only necessary if the number of cells
+ * to extract is strictly greater than 0 and less than the number of cells
+ * of the computational mesh.
+ *
+ * Lists of faces are ignored if the number of extracted cells is nonzero;
+ * otherwise, if the number of boundary faces to extract is equal to the
+ * number of boundary faces in the computational mesh, and the number of
+ * interior faces to extract is zero, than we extrac by default the boundary
+ * mesh, and the list of associated boundary faces is thus not necessary.
+ *
+ * Fortran interface: use PSTCMA (see cs_post_util.F)
+ *
+ * SUBROUTINE PSTCM1 (NUMMAI, NOMMAI, LNMMAI,
+ * *****************
+ * NBRCEL, NBRFAC, NBRFBR, LSTCEL, LSTFAC, LSTFBR)
+ *
+ * INTEGER NUMMAI : <-- : Number of output mesh to create
+ * : : (< 0 for standard mesh,
+ * : : > 0 for user mesh)
+ * CHARACTER NOMMAI : <-- : Name of associated output mesh
+ * INTEGER LNMMAI : <-- : Mesh name length
+ * INTEGER NBRCEL : <-- : Number of associated cells
+ * INTEGER NBRFAC : <-- : Number of associated interior faces
+ * INTEGER NBRFBR : <-- : Nulber of associated boundary faces
+ * INTEGER LSTCEL : <-- : List of associated cells
+ * INTEGER LSTFAC : <-- : List of associated interior faces
+ * INTEGER LSTFBR : <-- : List of associated boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstcm1, PSTCM1)
+(
+ const cs_int_t *nummai,
+ const char *nommai,
+ const cs_int_t *lnmmai,
+ const cs_int_t *nbrcel,
+ const cs_int_t *nbrfac,
+ const cs_int_t *nbrfbr,
+ cs_int_t lstcel[],
+ cs_int_t lstfac[],
+ cs_int_t lstfbr[]
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*----------------------------------------------------------------------------
+ * Create a mesh based upon the extraction of edges from an existing mesh.
+ *
+ * The newly created edges have no link to their parent elements, so
+ * no variable referencing parent elements may be output to this mesh,
+ * whose main use is to visualize "true" face edges when polygonal faces
+ * are subdivided by the writer. In this way, even highly non-convex
+ * faces may be visualized correctly if their edges are overlaid on
+ * the surface mesh with subdivided polygons.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTEDG (NUMMAI, NUMREF)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the edges mesh to create
+ * INTEGER NUMREF : <-- : Number of the existing mesh
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstedg, PSTEDG)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numref
+);
+
+/*----------------------------------------------------------------------------
+ * Assign a category to a post-processing mesh.
+ *
+ * By default, each mesh is assigned a category id identical to its id.
+ * The automatic variables output associated with the main volume and
+ * boundary meshes will also be applied to meshes of the same categories
+ * (i.e. -1 and -2 respectively, whether meshes -1 and -2 are actually
+ * defined or not), so setting a user meshe's category to one of these
+ * values will automatically provide the same automatic variable output to
+ * the user mesh.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTCAT (NUMMAI, NUMWRI)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the alias to create
+ * INTEGER NUMCAT : <-- : Number of the assigned category
+ * (-1: as volume, -2: as boundary)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstcat, PSTCAT)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numcat
+);
+
+/*----------------------------------------------------------------------------
+ * Create an alias to a post-processing mesh.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTALM (NUMMAI, NUMREF)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the alias to create
+ * INTEGER NUMREF : <-- : Number of the associated output mesh
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstalm, PSTALM)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numref
+);
+
+/*----------------------------------------------------------------------------
+ * Associate a writer to a post-processing mesh.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTASS (NUMMAI, NUMWRI)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the associated output mesh
+ * INTEGER NUMWRI : <-- : Number of the writer to associate
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstass, PSTASS)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numwri
+);
+
+/*----------------------------------------------------------------------------
+ * Update the "active" or "inactive" flag for writers based on the current
+ * time step and their default output frequency.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTNTC (NTCABS)
+ * *****************
+ *
+ * INTEGER NTCABS : <-- : Current time step number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstntc, PSTNTC)
+(
+ const cs_int_t *ntcabs
+);
+
+/*----------------------------------------------------------------------------
+ * Force the "active" or "inactive" flag for a specific writer or for all
+ * writers for the current time step.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTNTC (NUMWRI, INDACT)
+ * *****************
+ *
+ * INTEGER NUMWRI : <-- : Writer number, or 0 for all writers
+ * INTEGER INDACT : <-- : 0 to deactivate, 1 to activate
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstact, PSTACT)
+(
+ const cs_int_t *numwri,
+ const cs_int_t *indact
+);
+
+/*----------------------------------------------------------------------------
+ * Output post-processing meshes using associated writers.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTEMA (NTCABS, TTCABS)
+ * *****************
+ *
+ * INTEGER NTCABS : <-- : Current time step number
+ * DOUBLE PRECISION TTCABS : <-- : Current physical time
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstema, PSTEMA)
+(
+ const cs_int_t *ntcabs,
+ const cs_real_t *ttcabs
+);
+
+/*----------------------------------------------------------------------------
+ * Loop on post-processing meshes to output variables
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTVAR (IDBIA0, IDBRA0,
+ * *****************
+ * NDIM, NTCABS, NCELET, NCEL, NFAC, NFABOR,
+ * NFML, NPRFML, NNOD, LNDFAC, LNDFBR, NCELBR,
+ * NVAR, NSCAL, NPHAS, NVLSTA, NVISBR,
+ * NIDEVE, NRDEVE, NITUSE, NRTUSE,
+ * IFACEL, IFABOR, IFMFBR, IFMCEL, IPRFML,
+ * IPNFAC, NODFAC, IPNFBR, NODFBR,
+ * IDEVEL, ITUSER, IA,
+ * TTCABS, XYZCEN, SURFAC, SURFBO, CDGFAC, CDGFBO,
+ * XYZNOD, VOLUME,
+ * DT, RTPA, RTP, PROPCE, PROPFA, PROPFB,
+ * COEFA, COEFB,
+ * STATCE, STATIV, STATFB,
+ * RDEVEL, RTUSER, RA)
+ *
+ * INTEGER IDBIA0 : <-- : Number of first free position in IA
+ * INTEGER IDBRA0 : <-- : Number of first free position in RA
+ * INTEGER NDIM : <-- : Spatial dimension
+ * INTEGER NTCABS : --> : Current time step number
+ * INTEGER NCELET : <-- : Number of extended (real + ghost) cells
+ * INTEGER NFAC : <-- : Number of interior faces
+ * INTEGER NFABOR : <-- : Number of boundary faces
+ * INTEGER NFML : <-- : Number of families (group classes)
+ * INTEGER NPRFML : <-- : Number of family properties
+ * INTEGER NNOD : <-- : Number of vertices
+ * INTEGER LNDFAC : <-- : Size of nodfac
+ * INTEGER LNDFBR : <-- : Size of nodfbr
+ * INTEGER NCELBR : <-- : Number of cells on boundary
+ * INTEGER NVAR : <-- : Number of variables
+ * INTEGER NSCAL : <-- : Number of scalars
+ * INTEGER NPHAS : <-- : Number of phases
+ * INTEGER NVLSTA : <-- : Number of statistical variables (lagr)
+ * INTEGER NVISBR : <-- : Number of boundary stat. variables (lagr)
+ * INTEGER NIDEVE : <-- : Size of IDEVEL integer array
+ * INTEGER NRDEVE : <-- : Size of RDEVEL floating-point array
+ * INTEGER NITUSE : <-- : Size of ITUSER integer array
+ * INTEGER NRTUSE : <-- : Size of RTUSER floating-point array
+ * INTEGER IFACEL : <-- : Interior faces -> cells connectivity
+ * INTEGER IFABOR : <-- : Boundary faces -> cell connectivity
+ * INTEGER IFMFBR : <-- : Boundary face families
+ * INTEGER IFMCEL : <-- : Cell families
+ * INTEGER IPRFML : <-- : List of family properties
+ * INTEGER IPNFAC : <-- : Interior faces -> vertices connect. idx.
+ * INTEGER NODFAC : <-- : Interior faces -> vertices connectivity
+ * INTEGER IPNFBR : <-- : Boundary faces -> vertices connect. idx.
+ * INTEGER NODFBR : <-- : Boundary faces -> vertices connectivity
+ * INTEGER IDEVEL : <-- : IDEVEL integer array
+ * INTEGER ITUSER : <-- : ITUSER integer array
+ * INTEGER IA : <-- : IA integer array
+ * DOUBLE PRECISION TTCABS : <-- : Current physical time
+ * DOUBLE PRECISION XYZCEN : <-- : Points associated with cell centers
+ * DOUBLE PRECISION SURFAC : <-- : Interior face surface vectors
+ * DOUBLE PRECISION SURFBO : <-- : Boundary face surface vectors
+ * DOUBLE PRECISION CDGFAC : <-- : Interior face centers
+ * DOUBLE PRECISION CDGFBO : <-- : Boundary face vectors
+ * DOUBLE PRECISION XYZNOD : <-- : Vertex coordinates (optional)
+ * DOUBLE PRECISION VOLUME : <-- : Cell volumes
+ * DOUBLE PRECISION DT : <-- : Local time step
+ * DOUBLE PRECISION RTPA : <-- : Cell variables at previous time step
+ * DOUBLE PRECISION RTP : <-- : Cell variables
+ * DOUBLE PRECISION PROPCE : <-- : Cell physical properties
+ * DOUBLE PRECISION PROPFA : <-- : Interior face physical properties
+ * DOUBLE PRECISION PROPFB : <-- : Boundary face physical properties
+ * DOUBLE PRECISION COEFA : <-- : Boundary conditions array
+ * DOUBLE PRECISION COEFB : <-- : Boundary conditions array
+ * DOUBLE PRECISION STATCE : <-- : Cell statistics (Lagrangian)
+ * DOUBLE PRECISION STATIV : <-- : Cell variance statistics (Lagrangian)
+ * DOUBLE PRECISION STATFB : <-- : Boundary face statistics (Lagrangian)
+ * DOUBLE PRECISION RDEVEL : <-- : RDEVEL floating-point array
+ * DOUBLE PRECISION RTUSER : <-- : RTUSER floating-point array
+ * DOUBLE PRECISION RA : <-- : RA floating-point array
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstvar, PSTVAR)
+(
+ const cs_int_t *idbia0,
+ const cs_int_t *idbra0,
+ const cs_int_t *ndim,
+ const cs_int_t *ntcabs,
+ const cs_int_t *ncelet,
+ const cs_int_t *ncel,
+ const cs_int_t *nfac,
+ const cs_int_t *nfabor,
+ const cs_int_t *nfml,
+ const cs_int_t *nprfml,
+ const cs_int_t *nnod,
+ const cs_int_t *lndfac,
+ const cs_int_t *lndfbr,
+ const cs_int_t *ncelbr,
+ const cs_int_t *nvar,
+ const cs_int_t *nscal,
+ const cs_int_t *nphas,
+ const cs_int_t *nvlsta,
+ const cs_int_t *nvisbr,
+ const cs_int_t *nideve,
+ const cs_int_t *nrdeve,
+ const cs_int_t *nituse,
+ const cs_int_t *nrtuse,
+ const cs_int_t ifacel[],
+ const cs_int_t ifabor[],
+ const cs_int_t ifmfbr[],
+ const cs_int_t ifmcel[],
+ const cs_int_t iprfml[],
+ const cs_int_t ipnfac[],
+ const cs_int_t nodfac[],
+ const cs_int_t ipnfbr[],
+ const cs_int_t nodfbr[],
+ const cs_int_t idevel[],
+ cs_int_t ituser[],
+ cs_int_t ia[],
+ const cs_real_t *ttcabs,
+ const cs_real_t xyzcen[],
+ const cs_real_t surfac[],
+ const cs_real_t surfbo[],
+ const cs_real_t cdgfac[],
+ const cs_real_t cdgfbo[],
+ const cs_real_t xyznod[],
+ const cs_real_t volume[],
+ const cs_real_t dt[],
+ const cs_real_t rtpa[],
+ const cs_real_t rtp[],
+ const cs_real_t propce[],
+ const cs_real_t propfa[],
+ const cs_real_t propfb[],
+ const cs_real_t coefa[],
+ const cs_real_t coefb[],
+ const cs_real_t statce[],
+ const cs_real_t stativ[],
+ const cs_real_t statfb[],
+ const cs_real_t rdevel[],
+ cs_real_t rtuser[],
+ cs_real_t ra[]
+);
+
+/*----------------------------------------------------------------------------
+ * Post-processing output of a variable defined on cells or faces of a mesh
+ * using associated writers.
+ *
+ * Fortran interface; use PSTEVA (see cs_post_util.F)
+ *
+ * SUBROUTINE PSTEV1 (NUMMAI, NOMVAR, LNMVAR, IDIMT, IENTLA, IVARPR,
+ * *****************
+ * NTCABS, TTCABS, VARCEL, VARFAC, VARFBR)
+ *
+ * INTEGER NUMMAI : <-- : Number of associated output mesh
+ * CHARACTER NOMVAR : <-- : Name of associated variable
+ * INTEGER LNMVAR : <-- : Variable name length
+ * INTEGER IDIMT : <-- : 1 for scalar, 3 for vector
+ * INTEGER IENTLA : <-- : If a vector, 1 for interlaced values
+ * : : (x1, y1, z1, x2, y2, ..., yn, zn),
+ * : : 0 otherwise (x1, x2, ...xn, y1, y2, ...)
+ * INTEGER IVARPR : <-- : 1 if variable is defined on "parent"
+ * : : mesh, 2 if defined on output mesh
+ * INTEGER NTCABS : <-- : Current time step number
+ * DOUBLE PRECISION TTCABS : <-- : Current physical time
+ * DOUBLE PRECISION VARCEL(*) : <-- : Cell values
+ * DOUBLE PRECISION VARFAC(*) : <-- : Interior face values
+ * DOUBLE PRECISION VARFBO(*) : <-- : Boundary face values
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstev1, PSTEV1)
+(
+ const cs_int_t *nummai,
+ const char *nomvar,
+ const cs_int_t *lnmvar,
+ const cs_int_t *idimt,
+ const cs_int_t *ientla,
+ const cs_int_t *ivarpr,
+ const cs_int_t *ntcabs,
+ const cs_real_t *ttcabs,
+ const cs_real_t varcel[],
+ const cs_real_t varfac[],
+ const cs_real_t varfbr[]
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a writer; this objects manages a case's name, directory, and format,
+ * as well as associated meshe's time dependency, and the default output
+ * frequency for associated variables.
+ *
+ * parameters:
+ * writer_id <-- id of writer to create (< 0 reserved, > 0 for user)
+ * case_name <-- associated case name
+ * dir_name <-- associated directory name
+ * fmt_name <-- associated format name
+ * fmt_opts <-- associated format options
+ * mod_flag <-- 0 if fixed, 1 if deformable, 2 if topolygy changes,
+ * +10 add a displacement field
+ * frequency <-- default output frequency
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_writer(int writer_id,
+ const char *case_name,
+ const char *dir_name,
+ const char *fmt_name,
+ const char *fmt_opts,
+ cs_int_t mod_flag,
+ cs_int_t frequency);
+
+/*----------------------------------------------------------------------------
+ * Create a post-processing mesh; lists of cells or faces to extract are
+ * sorted upon exit, whether they were sorted upon calling or not.
+ *
+ * The list of associated cells is only necessary if the number of cells
+ * to extract is strictly greater than 0 and less than the number of cells
+ * of the computational mesh.
+ *
+ * Lists of faces are ignored if the number of extracted cells is nonzero;
+ * otherwise, if the number of boundary faces to extract is equal to the
+ * number of boundary faces in the computational mesh, and the number of
+ * interior faces to extract is zero, than we extrac by default the boundary
+ * mesh, and the list of associated boundary faces is thus not necessary.
+ *
+ * parameters:
+ * mesh_id <-- id of mesh to create (< 0 reserved, > 0 for user)
+ * mesh_name <-- associated mesh name
+ * n_cells <-- number of associated cells
+ * n_i_faces <-- number of associated interior faces
+ * n_b_faces <-- number of associated boundary faces
+ * cell_list <-> list of associated cells
+ * i_face_list <-> list of associated interior faces
+ * b_face_list <-> list of associated boundary faces
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_mesh(int mesh_id,
+ const char *mesh_name,
+ cs_int_t n_cells,
+ cs_int_t n_i_faces,
+ cs_int_t n_b_faces,
+ cs_int_t cell_list[],
+ cs_int_t i_face_list[],
+ cs_int_t b_face_list[]);
+
+/*----------------------------------------------------------------------------
+ * Create a post-processing mesh associated with an existing exportable mesh
+ * representation.
+ *
+ * If the exportable mesh is not intended to be used elsewhere, one can choose
+ * to transfer its property to the post-processing mesh, which will then
+ * manage its lifecycle based on its own requirements.
+ *
+ * If the exportable mesh must still be shared, one must be careful to
+ * maintain consistency between this mesh and the post-processing output.
+ *
+ * The mesh in exportable dimension may be of a lower dimension than
+ * its parent mesh, if it has been projected. In this case, a
+ * dim_shift value of 1 indicates that parent cells are mapped to
+ * exportable faces, and faces to edges, while a dim_shift value of 2
+ * would indicate that parent cells are mapped to edges.
+ * This is important when variables values are exported.
+ *
+ * parameters:
+ * mesh_id <-- number of mesh to create (< 0 reserved, > 0 for user)
+ * exp_mesh <-- mesh in exportable representation (i.e. fvm_nodal_t)
+ * dim_shift <-- nonzero if exp_mesh has been projected
+ * transfer <-- if true, ownership of exp_mesh is transferred to the
+ * post-processing mesh
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_existing_mesh(int mesh_id,
+ fvm_nodal_t *exp_mesh,
+ int dim_shift,
+ cs_bool_t transfer);
+
+/*----------------------------------------------------------------------------
+ * Create a mesh based upon the extraction of edges from an existing mesh.
+ *
+ * The newly created edges have no link to their parent elements, so
+ * no variable referencing parent elements may be output to this mesh,
+ * whose main use is to visualize "true" face edges when polygonal faces
+ * are subdivided by the writer. In this way, even highly non-convex
+ * faces may be visualized correctly if their edges are overlaid on
+ * the surface mesh with subdivided polygons.
+ *
+ * parameters:
+ * edges_id <-- id of edges mesh to create (< 0 reserved, > 0 for user)
+ * base_id <-- id of existing mesh (< 0 reserved, > 0 for user)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_mesh_edges(int edges_id,
+ int base_id);
+
+/*----------------------------------------------------------------------------
+ * Assign a category post-processing mesh.
+ *
+ * By default, each mesh is assigned a category id identical to its id.
+ * The automatic variables output associated with the main volume and
+ * boundary meshes will also be applied to meshes of the same categories
+ * (i.e. -1 and -2 respectively, whether meshes -1 and -2 are actually
+ * defined or not), so setting a user meshe's category to one of these
+ * values will automatically provide the same automatic variable output to
+ * the user mesh.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * category_id <-- id of mesh category (-1: as volume, -2: as boundary)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_set_mesh_category(int mesh_id,
+ int category_id);
+
+/*----------------------------------------------------------------------------
+ * Create an alias to a post-processing mesh.
+ *
+ * An alias allows association of an extra identifier (number) to an
+ * existing post-processing mesh, and thus to associate different writers
+ * than those associated with the existing mesh. For example, this allows
+ * outputting a set of main variables every n1 time steps with one writer,
+ * and outputting a specific set of variables every n2 time time steps to
+ * another post-processing set using another writer, without the overhead
+ * that would be incurred by duplication of the post-processing mesh.
+ *
+ * An alias is thus treated in all points like its associated mesh;
+ * if the definition of either one is modified, that of the other is
+ * modified also.
+ *
+ * It is forbidden to associate an alias to another alias (as there is no
+ * identified use for this, and it would make consistency checking more
+ * difficult), but multiple aliases may be associated with a given mesh.
+ *
+ * parameters:
+ * alias_id <-- id of alias to create (< 0 reserved, > 0 for user)
+ * mesh_id <-- id of associated mesh
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_alias_mesh(int alias_id,
+ int mesh_id);
+
+/*----------------------------------------------------------------------------
+ * Check for the existence of a writer of the given id.
+ *
+ * parameters:
+ * writer_id <-- writer id to check
+ *
+ * returns:
+ * true if writer with this id exists, false otherwise
+ *----------------------------------------------------------------------------*/
+
+cs_bool_t
+cs_post_writer_exists(int writer_id);
+
+/*----------------------------------------------------------------------------
+ * Return a pointer to the FVM library writer associated to a writer_id.
+ *
+ * parameters:
+ * writer_id <-- associated writer id
+ *
+ * Returns:
+ * a pointer to a fvm_writer_t structure
+ *----------------------------------------------------------------------------*/
+
+fvm_writer_t *
+cs_post_get_writer(cs_int_t writer_id);
+
+/*----------------------------------------------------------------------------
+ * Check for the existence of a post-processing mesh of the given id.
+ *
+ * parameters:
+ * mesh_id <-- mesh id to check
+ *
+ * returns:
+ * true if mesh with this id exists, false otherwise
+ *----------------------------------------------------------------------------*/
+
+cs_bool_t
+cs_post_mesh_exists(int mesh_id);
+
+/*----------------------------------------------------------------------------
+ * Modify an existing post-processing mesh.
+ *
+ * The lists of cells or faces are redefined, for example to update an
+ * extracted mesh based in "interesting" zones.
+ *
+ * It is not necessary to use this function if a mesh is simply deformed.
+ *
+ * parameters:
+ * mesh_id <-- id of mesh to modify (< 0 reserved, > 0 for user)
+ * n_cells <-- number of associated cells
+ * n_i_faces <-- number of associated interior faces
+ * n_b_faces <-- number of associated boundary faces
+ * cell_list <-> list of associated cells
+ * i_face_list <-> list of associated interior faces
+ * b_face_list <-> list of associated boundary faces
+ *
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_modify_mesh(int mesh_id,
+ cs_int_t n_cells,
+ cs_int_t n_i_faces,
+ cs_int_t n_b_faces,
+ cs_int_t cell_list[],
+ cs_int_t i_face_list[],
+ cs_int_t b_face_list[]);
+
+/*----------------------------------------------------------------------------
+ * Return the next "reservable" (i.e. non-user) writer id available.
+ *
+ * Returns:
+ * the smallest negative integer present, -1
+ *----------------------------------------------------------------------------*/
+
+int
+cs_post_get_free_writer_id(void);
+
+/*----------------------------------------------------------------------------
+ * Return the next "reservable" (i.e. non-user) mesh id available.
+ *
+ * Returns:
+ * the smallest negative integer present, -1
+ *----------------------------------------------------------------------------*/
+
+int
+cs_post_get_free_mesh_id(void);
+
+/*----------------------------------------------------------------------------
+ * Associate a writer with a post-processing mesh.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * writer_id <-- id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_associate(int mesh_id,
+ int writer_id);
+
+/*----------------------------------------------------------------------------
+ * Update "active" or "inactive" flag of writers whose output frequency
+ * is a divisor of the current time step number.
+ *
+ * parameters:
+ * nt_cur_abs <-- current time step number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_activate_if_default(int nt_cur_abs);
+
+/*----------------------------------------------------------------------------
+ * Force the "active" or "inactive" flag for a specific writer or for all
+ * writers for the current time step.
+ *
+ * parameters:
+ * writer_id <-- writer id, or 0 for all writers
+ * activate <-- 0 to deactivate, 1 to activate
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_activate_writer(int writer_id,
+ int activate);
+
+/*----------------------------------------------------------------------------
+ * Output post-processing meshes using associated writers.
+ *
+ * parameters:
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_write_meshes(int nt_cur_abs,
+ double t_cur_abs);
+
+/*----------------------------------------------------------------------------
+ * Output a variable defined at cells or faces of a post-processing mesh
+ * using associated writers.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * var_name <-- name of variable to output
+ * var_dim <-- 1 for scalar, 3 for vector
+ * interlace <-- if a vector, true for interlaced values, false otherwise
+ * use_parent <-- true if values are defined on "parent" mesh,
+ * false if values are defined on post-processing mesh
+ * var_type <-- variable's data type
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ * cel_vals <-- cell values
+ * i_face_vals <-- interior face values
+ * b_face_vals <-- boundary face values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_write_var(int mesh_id,
+ const char *var_name,
+ cs_int_t var_dim,
+ cs_bool_t interlace,
+ cs_bool_t use_parent,
+ cs_post_type_t var_type,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs,
+ const void *cel_vals,
+ const void *i_face_vals,
+ const void *b_face_vals);
+
+/*----------------------------------------------------------------------------
+ * Output a variable defined at vertices of a post-processing mesh using
+ * associated writers.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * var_name <-- name of variable to output
+ * var_dim <-- 1 for scalar, 3 for vector
+ * interlace <-- if a vector, true for interlaced values, false otherwise
+ * use_parent <-- true if values are defined on "parent" mesh,
+ * false if values are defined on post-processing mesh
+ * var_type <-- variable's data type
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ * vtx_vals <-- vertex values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_write_vertex_var(int mesh_id,
+ const char *var_name,
+ cs_int_t var_dim,
+ cs_bool_t interlace,
+ cs_bool_t use_parent,
+ cs_post_type_t var_type,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs,
+ const void *vtx_vals);
+
+/*----------------------------------------------------------------------------
+ * Update references to parent mesh of post-processing meshes in case of
+ * computational mesh cell renumbering.
+ *
+ * This function may be called only once, after possible renumbering of cells,
+ * to update existing post-processing meshes. Post-processing meshes defined
+ * after renumbering will automatically be based upon the new numbering,
+ * so this function will not need to be called again.
+ *
+ * parameters:
+ * init_cell_num <-- initial cell numbering (1 to n, new -> old)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_renum_cells(const cs_int_t init_cell_num[]);
+
+/*----------------------------------------------------------------------------
+ * Update references to parent mesh of post-processing meshes in case of
+ * computational mesh interior and/or boundary faces renumbering.
+ *
+ * This function may be called only once, after possible renumbering of faces,
+ * to update existing post-processing meshes. Post-processing meshes defined
+ * after renumbering will automatically be based upon the new numbering,
+ * so this function will not need to be called again.
+ *
+ * parameters:
+ * init_i_face_num <-- initial interior numbering (1 to n, new -> old)
+ * init_b_face_num <-- initial boundary numbering (1 to n, new -> old)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_renum_faces(const cs_int_t init_i_face_num[],
+ const cs_int_t init_b_face_num[]);
+
+/*----------------------------------------------------------------------------
+ * Destroy all structures associated with post-processing
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_finalize(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize main post-processing writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_init_main_writer(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize main post-processing meshes
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_init_main_meshes(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing writer with same format and associated
+ * options as default writer, but no time dependency, intended to
+ * troubleshoot errors.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_init_error_writer(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing writer with same format and associated
+ * options as default writer, but no time dependency, and associate
+ * and output global volume mesh.
+ *
+ * This is intended to help troubleshoot errors using fields based
+ * on cells.
+ *
+ * returns:
+ * id of error output mesh (< 0), or 0 if all writers are deactivated
+ *----------------------------------------------------------------------------*/
+
+int
+cs_post_init_error_writer_cells(void);
+
+/*----------------------------------------------------------------------------
+ * Register a processing of a time-dependent variable to the call to PSTVAR.
+ *
+ * The instance identifier associated with the function allows registering
+ * the same function several times, with a diferent identifier allowing the
+ * function to select a specific operation or data.
+ *
+ * parameters:
+ * function <-- function to register
+ * instance_id <-- instance id associated with this registration
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_time_dep_var(cs_post_time_dep_var_t *function,
+ int instance_id);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_POST_H__ */
diff --git a/include/base/cs_preprocessor_data.h b/include/base/cs_preprocessor_data.h
new file mode 100644
index 0000000..0be8f30
--- /dev/null
+++ b/include/base/cs_preprocessor_data.h
@@ -0,0 +1,102 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_PRE_PROCESSOR_DATA_H__
+#define __CS_PRE_PROCESSOR_DATA_H__
+
+/*============================================================================
+ * Exchange of data between Code_Saturne Kernel and Preprocessor
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public functions definition for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Receive messages from the pre-processor about the dimensions of mesh
+ * parameters
+ *
+ * FORTRAN Interface:
+ *
+ * SUBROUTINE LEDEVI(NOMRUB, TYPENT, NBRENT, TABENT)
+ * *****************
+ *
+ * INTEGER NDIM : <-- : Spacial dimension (3)
+ * INTEGER NFML : <-- : Number of families (group classes)
+ * INTEGER NPRFML : <-- : Number of properties per family
+ * INTEGER IPERIO : <-- : Periodicity indicator
+ * INTEGER IPEROT : <-- : Number of rotation periodicities
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(ledevi, LEDEVI)
+(
+ cs_int_t *ndim,
+ cs_int_t *nfml,
+ cs_int_t *nprfml,
+ cs_int_t *iperio,
+ cs_int_t *iperot
+);
+
+/*============================================================================
+ * Public functions definition
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Read pre-processor mesh data and finalize input.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * mesh_builder <-- pointer to mesh builder structure
+ *
+ * returns:
+ *----------------------------------------------------------------------------*/
+
+void
+cs_preprocessor_data_read_mesh(cs_mesh_t *mesh,
+ cs_mesh_builder_t *mesh_builder);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_PRE_PROCESSOR_DATA_H__ */
+
diff --git a/include/base/cs_prototypes.h b/include/base/cs_prototypes.h
new file mode 100644
index 0000000..88a2433
--- /dev/null
+++ b/include/base/cs_prototypes.h
@@ -0,0 +1,720 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_PROTOTYPES_H__
+#define __CS_PROTOTYPES_H__
+
+/*============================================================================
+ * Prototypes for Fortran functions and subroutines callable from C
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Fortran function/subroutine prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute coarsening array for algebraic multigrid
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (autmgr, AUTMGR)
+(
+ const cs_int_t *igr, /* <-- new grid level (0 = base) */
+ const cs_int_t *isym, /* <-- 1: symmetric; 2 nonsymmteric */
+ const cs_int_t *iagmax, /* <-- max fine cells per coarse cell */
+ const cs_int_t *nagmax, /* <-- fine cells per coarse cell limit */
+ const cs_int_t *ncelf, /* <-- number of cells in fine grid */
+ const cs_int_t *ncelfe, /* <-- number of cells with halo in fine grid */
+ const cs_int_t *nfacf, /* <-- number of faces in fine grid */
+ const cs_int_t *iwarnp, /* <-- verbosity level */
+ const cs_int_t ifacef[], /* <-- fine grid face->cell connectivity */
+ const cs_real_t daf[], /* <-- diagonal terms of fine grid */
+ const cs_real_t xaf[], /* <-- extradiagonal terms of fine grid */
+ const cs_real_t surfaf[], /* <-- fine grid face surface vectors */
+ const cs_real_t volumf[], /* <-- fine grid cell volumes */
+ const cs_real_t xyzfin[], /* <-- fine grid cell centers */
+ cs_int_t irscel[], /* --> Fine -> coarse cell connectivity */
+ cs_int_t indic[], /* --- work array of size ncelfe */
+ cs_int_t inombr[], /* --- work array of size ncelfe */
+ cs_int_t irsfac[], /* --- work array of size nfacf */
+ cs_int_t indicf[], /* --- work array of size nfacf */
+ cs_real_t w1[], /* --- work array of size ncelfe */
+ cs_real_t w2[] /* --- work array of size ncelfe */
+);
+
+/*----------------------------------------------------------------------------
+ * Main Fortran subroutine
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (caltri, CALTRI)
+(
+ const cs_int_t *iverif, /* <-- activate elementary tests */
+ const cs_int_t *nideve, /* <-- size of IDEVEL integer array */
+ const cs_int_t *nrdeve, /* <-- size of rdevel floating-point array */
+ const cs_int_t *nituse, /* <-- size of ITUSER integer array */
+ const cs_int_t *nrtuse, /* <-- size of RTUSER floating-point array */
+ const cs_int_t *ifacel, /* <-- interior faces -> cells connectivity */
+ const cs_int_t *ifabor, /* <-- boundary faces -> cells connectivity */
+ const cs_int_t *ifmfbr, /* <-- boundary face family (group class) number */
+ const cs_int_t *ifmcel, /* <-- cell family (group class) number */
+ const cs_int_t *iprfml, /* <-- family (group class) properties */
+ const cs_int_t *ipnfac, /* <-- interior faces -> vertices connect. index */
+ const cs_int_t *nodfac, /* <-- interior faces -> vertices connectivity */
+ const cs_int_t *ipnfbr, /* <-- boundary faces -> vertices connect. index */
+ const cs_int_t *nodfbr, /* <-- boundary faces -> vertices connectivity */
+ cs_int_t *idevel, /* --> IDEVEL integer array */
+ cs_int_t *ituser, /* --> ITUSER integer array */
+ cs_int_t *ia, /* --> IA integer array */
+ cs_real_t *xyzcen, /* <-> points associated with cell centers */
+ cs_real_t *surfac, /* <-> interior face surface vectors */
+ cs_real_t *surfbo, /* <-> boundary face surface vectors */
+ cs_real_t *cdgfac, /* <-> interior face centers */
+ cs_real_t *cdgfbr, /* <-> boundary face vectors */
+ cs_real_t *xyznod, /* <-> vertex coordinates (optional) */
+ cs_real_t *volume, /* <-> cell volumes */
+ cs_real_t *rdevel, /* --> RDEVEL floating-point array */
+ cs_real_t *rtuser, /* --> RTUSER floating-point array */
+ cs_real_t *ra /* --> RA floating-point array */
+);
+
+/*----------------------------------------------------------------------------
+ * Compute coarsening grid values for algebraic multigrid
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (crstgr, CRSTGR)
+(
+ const cs_int_t *iappel, /* <-- call number (0 or 1) */
+ const cs_int_t *isym, /* <-- 1: symmetric; 2 nonsymmteric */
+ const cs_int_t *igr, /* <-- new grid level (0 = base) */
+ const cs_int_t *ncelf, /* <-- number of cells in fine grid */
+ const cs_int_t *ncelg, /* <-- number of cells in coarse grid */
+ const cs_int_t *ncelfe, /* <-- number of cells with halo in fine grid */
+ const cs_int_t *ncelge, /* <-- number of cells with halo coarse grid */
+ const cs_int_t *nfacf, /* <-- number of faces in fine grid */
+ const cs_int_t *nfacg, /* <-- number of faces in coarse grid */
+ const cs_int_t *iwarnp, /* <-- verbosity level */
+ const cs_int_t ifacef[], /* <-- fine grid face->cell connectivity */
+ const cs_int_t ifaceg[], /* <-- coarse grid face->cell connectivity */
+ const cs_int_t irscel[], /* <-- Fine -> coarse cell connectivity */
+ const cs_int_t irsfac[], /* <-- Fine -> coarse face connectivity */
+ const cs_real_t volumf[], /* <-- fine grid cell volumes */
+ const cs_real_t xyzfin[], /* <-- fine grid cell centers */
+ const cs_real_t surfaf[], /* <-- fine grid face surface vectors */
+ const cs_real_t xaf0[], /* <-- symmetrized extradiagonal, fine */
+ const cs_real_t xaf0ij[], /* <-- matrix coarsening term, fine */
+ const cs_real_t daf[], /* <-- diagonal terms of fine grid */
+ const cs_real_t xaf[], /* <-- extradiagonal terms of fine grid */
+ const cs_real_t volumg[], /* <-- coarse grid cell volumes */
+ const cs_real_t xyzgro[], /* <-- coarse grid cell centers */
+ const cs_real_t surfag[], /* <-- coarse grid face surface vectors */
+ cs_real_t xag0[], /* --> symmetrized extradiagonal, coarse */
+ cs_real_t xag0ij[], /* --> matrix coarsening term, coarse */
+ cs_real_t dag[], /* --> diagonal terms of coarse grid */
+ cs_real_t xag[], /* --> extradiagonal terms, coarse grid */
+ cs_real_t rwc1[], /* --- work array of size ncelfe */
+ cs_real_t rwc2[], /* --- work array of size ncelfe */
+ cs_real_t rwc3[], /* --- work array of size ncelfe */
+ cs_real_t rwc4[] /* --- work array of size ncelfe */
+);
+
+/*----------------------------------------------------------------------------
+ * Close log (listing) handled by Fortran: (CLose LIsting)
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (csclli, CSCLLI)
+(
+ void
+);
+
+/*----------------------------------------------------------------------------
+ * Flush standard output.
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (csflsh, CSFLSH)
+(
+ void
+);
+
+/*----------------------------------------------------------------------------
+ * Initialize Fortran log (listing) files
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (csinit, CSINIT)
+(
+ const cs_int_t *ifoenv, /* <-- 0: SolCom mesh; 1: Preprocesor mesh */
+ const cs_int_t *irgpar, /* <-- MPI Rank in parallel, -1 otherwise */
+ const cs_int_t *nrgpar, /* <-- Number of MPI processes, or 1 */
+ const cs_int_t *nthpar, /* <-- Number of threads */
+ const cs_int_t *ilisr0, /* <-- Output of main log (listing (rank 0): */
+ /* 0: non redirected; 1: to 'listing' file */
+ const cs_int_t *ilisrp /* <-- Output of logs for ranks > 0: */
+ /* 0: non redirected; 1: to 'listing_n*' files */
+ /* 2: to '/dev/null' (suppressed) */
+);
+
+/*----------------------------------------------------------------------------
+ * Print a message to standard output.
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (csprnt, CSPRNT)
+(
+ char *cs_buf_print,
+ cs_int_t *msgsize
+);
+
+/*----------------------------------------------------------------------------
+ * Developper function for output of variables on a post-processing mesh
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (dvvpst, DVVPST)
+(
+ const cs_int_t *idbia0, /* <-> number of first free position in IA */
+ const cs_int_t *idbra0, /* <-> number of first free position in RA */
+ const cs_int_t *nummai, /* <-- number or post-processing mesh */
+ const cs_int_t *numtyp, /* <-- number or post-processing type
+ * (-1 as volume, -2 as boundary, or nummai) */
+ const cs_int_t *ndim, /* <-- spatial dimension */
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *nfml, /* <-- number of families (group classes) */
+ const cs_int_t *nprfml, /* <-- number of family (group class) properties */
+ const cs_int_t *nnod, /* <-- number of vertices */
+ const cs_int_t *lndfac, /* <-- size of nodfac */
+ const cs_int_t *lndfbr, /* <-- size of nodfbr */
+ const cs_int_t *ncelbr, /* <-- number of cells on boundary */
+ const cs_int_t *nvar, /* <-- number of variables */
+ const cs_int_t *nscal, /* <-- number of scalars */
+ const cs_int_t *nphas, /* <-- nulber of phases */
+ const cs_int_t *nvlsta, /* <-- number of statistical variables (lagr) */
+ const cs_int_t *nvisbr, /* <-- number of boundary stat. variables (lagr) */
+ const cs_int_t *ncelps, /* <-- number of post-processed cells */
+ const cs_int_t *nfacps, /* <-- number of post processed interior faces */
+ const cs_int_t *nfbrps, /* <-- number of post processed boundary faces */
+ const cs_int_t *nideve, /* <-- size of IDEVEL integer array */
+ const cs_int_t *nrdeve, /* <-- size of rdevel floating-point array */
+ const cs_int_t *nituse, /* <-- size of ITUSER integer array */
+ const cs_int_t *nrtuse, /* <-- size of RTUSER floating-point array */
+ const cs_int_t itypps[3], /* <-- flag (0 or 1) for presence of cells, */
+ /* interior faces, and boundary faces */
+ const cs_int_t ifacel[], /* <-- interior faces / cells connectivity */
+ const cs_int_t ifabor[], /* <-- boundary faces / cell connectivity */
+ const cs_int_t ifmfbr[], /* <-- boundary face families */
+ const cs_int_t ifmcel[], /* <-- cell families */
+ const cs_int_t iprfml[], /* <-- list of family properties */
+ const cs_int_t ipnfac[], /* <-- interior faces -> vertices connect. index */
+ const cs_int_t nodfac[], /* <-- interior faces -> vertices connectivity */
+ const cs_int_t ipnfbr[], /* <-- boundary faces -> vertices connect. index */
+ const cs_int_t nodfbr[], /* <-- boundary faces -> vertices connectivity */
+ const cs_int_t lstcel[], /* <-- list of post-processed cells */
+ const cs_int_t lstfac[], /* <-- list of post-processed interior faces */
+ const cs_int_t lstfbr[], /* <-- list of post-processed boundary faces */
+ const cs_int_t idevel[], /* <-- IDEVEL integer array */
+ cs_int_t ituser[], /* <-- ITUSER integer array */
+ cs_int_t ia[], /* <-- IA integer array */
+ const cs_real_t xyzcen[], /* <-- points associated with cell centers */
+ const cs_real_t surfac[], /* <-- interior face surface vectors */
+ const cs_real_t surfbo[], /* <-- boundary face surface vectors */
+ const cs_real_t cdgfac[], /* <-- interior face centers */
+ const cs_real_t cdgfbr[], /* <-- boundary face vectors */
+ const cs_real_t xyznod[], /* <-- vertex coordinates (optional) */
+ const cs_real_t volume[], /* <-- cell volumes */
+ const cs_real_t dt[], /* <-- local time step */
+ const cs_real_t rtpa[], /* <-- cell variables at previous time step */
+ const cs_real_t rtp[], /* <-- cell variables */
+ const cs_real_t propce[], /* <-- cell physical properties */
+ const cs_real_t propfa[], /* <-- interior face physical properties */
+ const cs_real_t propfb[], /* <-- boundary face physical properties */
+ const cs_real_t coefa[], /* <-- boundary conditions array */
+ const cs_real_t coefb[], /* <-- boundary conditions array */
+ const cs_real_t statce[], /* <-- cell statistics (Lagrangian) */
+ const cs_real_t stativ[], /* <-- cell variance statistics (Lagrangian) */
+ const cs_real_t statfb[], /* <-- boundary face statistics (Lagrangian) */
+ cs_real_t tracel[], /* --- work array for output cells */
+ cs_real_t trafac[], /* --- work array for output interior faces */
+ cs_real_t trafbr[], /* --- work array for output boundary faces */
+ const cs_real_t rdevel[], /* <-- RDEVEL floating-point array */
+ cs_real_t rtuser[], /* <-- RTUSER floating-point array */
+ cs_real_t ra[] /* <-- RA floating-point array */
+);
+
+/*----------------------------------------------------------------------------
+ * Find the nearest cell's center from a node
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (findpt, FINDPT)
+(
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_real_t *xyzcen, /* <-- cell centers */
+ const cs_real_t *xx, /* <-- node coordinate X */
+ const cs_real_t *yy, /* <-- node coordinate Y */
+ const cs_real_t *zz, /* <-- node coordinate Z */
+ cs_int_t *node, /* --> node we are looking for, zero if error */
+ cs_int_t *ndrang /* --> rank of associated process */
+);
+
+/*----------------------------------------------------------------------------
+ * Compute gradients using least squares method (standard or extended
+ * neighborhood)
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (gradmc, GRADMC)
+(
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *ncelbr, /* <-- number of cells on boundary */
+ const cs_int_t *inc, /* <-- 0 or 1: increment or not */
+ const cs_int_t *iccocg, /* <-- 1 or 0: recompute COCG or not */
+ const cs_int_t *nswrgp, /* <-- >1: with reconstruction */
+ const cs_int_t *idimte, /* <-- 0, 1, 2: scalar, vector, tensor */
+ const cs_int_t *itenso, /* <-- for rotational periodicity */
+ const cs_int_t *iphydp, /* <-- use hydrosatatic pressure */
+ const cs_int_t *imrgra, /* <-- gradient computation mode */
+ const cs_int_t *iwarnp, /* <-- verbosity level */
+ const cs_int_t *nfecra, /* <-- standard output unit */
+ const cs_real_t *epsrgp, /* <-- precision for iterative gradient calc. */
+ const cs_real_t *extrap, /* <-- extrapolate gradient at boundary */
+ const cs_int_t ifacel[], /* <-- interior face->cell connectivity */
+ const cs_int_t ifabor[], /* <-- boundary face->cell connectivity */
+ const cs_int_t icelbr[], /* <-- list of cells on boundary */
+ const cs_int_t ipcvse[], /* <-- cells -> ext. neighborhood cells index */
+ const cs_int_t ielvse[], /* <-- cells -> ext. neighborhood cells list */
+ const cs_int_t isympa[], /* <-- indicator for symmetry faces */
+ const cs_real_t volume[], /* <-- cell volumes */
+ const cs_real_t surfac[], /* <-- surfaces of interior faces */
+ const cs_real_t surfbo[], /* <-- surfaces of boundary faces */
+ const cs_real_t surfbn[], /* <-- norm of surfbo */
+ const cs_real_t pond[], /* <-- interior faces geometric weight */
+ const cs_real_t dist[], /* <-- interior faces I' to J' distance */
+ const cs_real_t distbr[], /* <-- boundary faces I' to J' distance */
+ const cs_real_t dijpf[], /* <-- interior faces I'J' vector */
+ const cs_real_t diipb[], /* <-- boundary faces II' vector */
+ const cs_real_t fextx[], /* <-- components of the exterior force */
+ const cs_real_t fexty[], /* generating the hydrostatic pressure */
+ const cs_real_t fextz[],
+ const cs_real_t xyzcen[], /* <-- cell centers */
+ const cs_real_t cdgfac[], /* <-- interior face centers of gravity */
+ const cs_real_t cdgfbo[], /* <-- boundary face centers of gravity */
+ const cs_real_t coefap[], /* <-- boundary condition term */
+ const cs_real_t coefbp[], /* <-- boundary condition term */
+ const cs_real_t pvar[], /* <-- gradient's base variable */
+ cs_real_t cocgb[], /* <-> contribution to COCG of cells on
+ on boundary's interior faces */
+ cs_real_t cocg[], /* <-> contribution to COCG of cells on
+ on boundary's boundary faces */
+ cs_real_t dpdx[], /* --> gradient x component */
+ cs_real_t dpdy[], /* --> gradient y component */
+ cs_real_t dpdz[], /* --> gradient z component */
+ cs_real_t bx[], /* --- local work array */
+ cs_real_t by[], /* --- local work array */
+ cs_real_t bz[] /* --- local work array */
+);
+
+/*----------------------------------------------------------------------------
+ * Main Fortran options initialization
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (initi1, INITI1)
+(
+ const cs_int_t *iverif /* <-- Activate elementary tests */
+);
+
+/*----------------------------------------------------------------------------
+ * Get parameters necessary for post-processing initialization from
+ * the Fortran API.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (inipst, INIPST)
+(
+ const cs_int_t *ichrvl, /* <-- fluid volume post processing indicator */
+ const cs_int_t *ichrbo, /* <-- boundary faces post processing indicator */
+ const cs_int_t *ichrsy, /* <-- post processing indicator for faces
+ * coupled with SYRTHES */
+ const cs_int_t *ichrze, /* <-- post processing indicator for cooling
+ * tower exchange zones */
+ const cs_int_t *ipstmd, /* <-- deformable mesh flag
+ * 0: no time dependency
+ * 1: deformable post processing meshes
+ * 2: output of a displacement field */
+ const cs_int_t *ntchr, /* <-- frequency of post processing output */
+ const char *fmtchr, /* <-- name of main output format */
+ const char *optchr /* <-- options for main output format */
+);
+
+/*----------------------------------------------------------------------------
+ * Read geometric entities in "SolCom" format
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (letgeo, LETGEO)
+(
+ const cs_int_t *ndim, /* <-- space dimension */
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *nfml, /* <-- number of familes */
+ const cs_int_t *nprfml, /* <-- number of family properties */
+ const cs_int_t *nnod, /* <-- number of vertices */
+ const cs_int_t *lndfac, /* <-- size of interior faces -> vertices array */
+ const cs_int_t *lndfbr, /* <-- size of boundary faces -> vertices array */
+ const cs_int_t *ntetra, /* <-- number of tetrahedra */
+ const cs_int_t *npyram, /* <-- number of pyramids */
+ const cs_int_t *nprism, /* <-- number of prisms */
+ const cs_int_t *nhexae, /* <-- number of hexahedra */
+ cs_int_t *inodal, /* --> indicates if we should read the nodal */
+ /* connectivity for post-processing */
+ cs_int_t ifacel[], /* --> interior faces -> cells connectivity */
+ cs_int_t ifabor[], /* --> boundary faces -> cells connectivity */
+ cs_int_t ifmfbr[], /* --> boundary face families */
+ cs_int_t ifmcel[], /* --> cell families */
+ cs_int_t iprfml[], /* --> list of family properties */
+ cs_int_t icotet[], /* --> nodal connectivity for tetrahedra */
+ cs_int_t icopyr[], /* --> nodal connectivity for pyramids */
+ cs_int_t icopri[], /* --> nodal conncetivity for prisms */
+ cs_int_t icohex[], /* --> nodal connectivity for hexahedra */
+ cs_int_t ipnfac[], /* --> interior faces -> vertices index */
+ cs_int_t nodfac[], /* --> interior faces -> vertices connectivity */
+ cs_int_t ipnfbr[], /* --> boundary faces -> vertices index */
+ cs_int_t nodfbr[], /* --> boundary faces -> vertices connectivity */
+ cs_real_t xyzcen[], /* --> cell centers */
+ cs_real_t surfac[], /* --> interior face surface vectors */
+ cs_real_t surfbo[], /* --> boundary face surface vectors */
+ cs_real_t cdgfac[], /* --> interior face centers */
+ cs_real_t cdgfbo[], /* --> boundary face centers */
+ cs_real_t xyznod[] /* --> vertex coordinates */
+);
+
+/*----------------------------------------------------------------------------
+ * Update mesh dimensions in Fortran commons
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (majgeo, MAJGEO)
+(
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *nsom, /* <-- number of vertices */
+ const cs_int_t *lndfac, /* <-- interior face -> vertices array size */
+ const cs_int_t *lndfbr, /* <-- boundary face -> vertices array size */
+ const cs_int_t *ncelgb, /* <-- global number of cells */
+ const cs_int_t *nfacgb, /* <-- global number of interior faces */
+ const cs_int_t *nfbrgb, /* <-- global number of boundary faces */
+ const cs_int_t *nsomgb, /* <-- global number of vertices */
+ const cs_int_t *nthrdi, /* <-- max threads per interior faces group */
+ const cs_int_t *nthrdb, /* <-- max threads per boundary faces group */
+ const cs_int_t *ngrpi, /* <-- number of interior face groups */
+ const cs_int_t *ngrpb, /* <-- number of boundary face groups */
+ const cs_int_t *idxfi, /* <-- interior face group/thread start/end ids */
+ const cs_int_t *idxfb /* <-- boundary face group/thread start/end ids */
+);
+
+/*----------------------------------------------------------------------------
+ * Initialize Fortran working array sizes
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (memini, MEMINI)
+(
+ cs_int_t *iasize, /* --- size of IA integer array */
+ cs_int_t *rasize, /* --- size of RA integer array */
+ cs_int_t *nideve, /* --- size of IDEVEL integer array */
+ cs_int_t *nrdeve, /* --- size of rdevel floating-point array */
+ cs_int_t *nituse, /* --- size of ITUSER integer array */
+ cs_int_t *nrtuse /* --- size of RTUSER floating-point array */
+);
+
+/*----------------------------------------------------------------------------
+ * Mesh renumbering for vector processors
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (numvec, NUMVEC)
+(
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of local cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *lregis, /* <-- vector registor length */
+ cs_int_t *irveci, /* <-> interior face vectorization indic. */
+ cs_int_t *irvecb, /* <-> boundary face vectorization indic. */
+ cs_int_t ifacel[], /* <-- interior face->cell connectivity */
+ cs_int_t ifabor[], /* <-- boundary face->cell connectivity */
+ cs_int_t inumfi[], /* <-> interior faces renumbering (size: nfac) */
+ cs_int_t inumfb[], /* <-> boundary faces renumbering (size: nfabor) */
+ cs_int_t iworkf[], /* --- work array, size: max(nfac, nfabor) */
+ cs_int_t ismbs[] /* --- work array, size: ncelet */
+);
+
+/*----------------------------------------------------------------------------
+ * Test renumbering for vector processors
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (tstvec, TSTVEC)
+(
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of local cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t ifacel[], /* <-- interior face->cell connectivity */
+ const cs_int_t ifabor[], /* <-- boundary face->cell connectivity */
+ cs_int_t iworkf[], /* --- work array, size: max(nfac, nfabor) */
+ cs_int_t ismbs[], /* --- work array, size: ncelet */
+ cs_int_t ismbv[], /* --- work array, size: ncelet */
+ cs_real_t rworkf[], /* --- work array, size: max(nfac, nfabor) */
+ cs_real_t rsmbs[], /* --- work array, size: ncelet */
+ cs_real_t rsmbv[] /* --- work array, size: ncelet */
+);
+
+/*----------------------------------------------------------------------------
+ * User function for mesh joining definition
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (usjoin, USJOIN) (void);
+
+/*----------------------------------------------------------------------------
+ * User subroutine for geometry modification
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (usmodg, USMODG)
+(
+ const cs_int_t *ndim, /* <-- spatial dimension */
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *nfml, /* <-- number of families (group classes) */
+ const cs_int_t *nprfml, /* <-- number of family (group class) properties */
+ const cs_int_t *nnod, /* <-- number of vertices */
+ const cs_int_t *lndfac, /* <-- size of nodfac */
+ const cs_int_t *lndfbr, /* <-- size of nodfbr */
+ const cs_int_t ifacel[], /* <-- interior faces / cells connectivity */
+ const cs_int_t ifabor[], /* <-- boundary faces / cell connectivity */
+ const cs_int_t ifmfbr[], /* <-- boundary face families */
+ const cs_int_t ifmcel[], /* <-- cell families */
+ const cs_int_t iprfml[], /* <-- list of family properties */
+ const cs_int_t ipnfac[], /* <-- interior faces -> vertices connect. index */
+ const cs_int_t nodfac[], /* <-- interior faces -> vertices connectivity */
+ const cs_int_t ipnfbr[], /* <-- boundary faces -> vertices connect. index */
+ const cs_int_t nodfbr[], /* <-- boundary faces -> vertices connectivity */
+ cs_real_t xyznod[] /* --> vertex coordinates */
+);
+
+/*----------------------------------------------------------------------------
+ * User function for modification of a post-processing mesh
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (usmpst, USMPST)
+(
+ const cs_int_t *idbia0, /* <-> number of first free position in IA */
+ const cs_int_t *idbra0, /* <-> number of first free position in RA */
+ const cs_int_t *nummai, /* <-- number or post-processing mesh */
+ const cs_int_t *ndim, /* <-- spatial dimension */
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *nfml, /* <-- number of families (group classes) */
+ const cs_int_t *nprfml, /* <-- number of family (group class) properties */
+ const cs_int_t *nnod, /* <-- number of vertices */
+ const cs_int_t *lndfac, /* <-- size of nodfac */
+ const cs_int_t *lndfbr, /* <-- size of nodfbr */
+ const cs_int_t *ncelbr, /* <-- number of cells on boundary */
+ const cs_int_t *nvar, /* <-- number of variables */
+ const cs_int_t *nscal, /* <-- number of scalars */
+ const cs_int_t *nphas, /* <-- number of phases */
+ const cs_int_t *nvlsta, /* <-- number of statistical variables (lagr) */
+ cs_int_t *ncelps, /* <-> number of post-processed cells */
+ cs_int_t *nfacps, /* <-> number of post processed interior faces */
+ cs_int_t *nfbrps, /* <-> number of post processed boundary faces */
+ const cs_int_t *nideve, /* <-- size of IDEVEL integer array */
+ const cs_int_t *nrdeve, /* <-- size of rdevel floating-point array */
+ const cs_int_t *nituse, /* <-- size of ITUSER integer array */
+ const cs_int_t *nrtuse, /* <-- size of RTUSER floating-point array */
+ cs_int_t *imodif, /* <-> 1 if mesh is modified, 0 otherwise */
+ const cs_int_t itypps[3], /* <-- flag (0 or 1) for presence of cells, */
+ /* interior faces, and boundary faces */
+ const cs_int_t ifacel[], /* <-- interior faces / cells connectivity */
+ const cs_int_t ifabor[], /* <-- boundary faces / cell connectivity */
+ const cs_int_t ifmfbr[], /* <-- boundary face families */
+ const cs_int_t ifmcel[], /* <-- cell families */
+ const cs_int_t iprfml[], /* <-- list of family properties */
+ const cs_int_t ipnfac[], /* <-- interior faces -> vertices connect. index */
+ const cs_int_t nodfac[], /* <-- interior faces -> vertices connectivity */
+ const cs_int_t ipnfbr[], /* <-- boundary faces -> vertices connect. index */
+ const cs_int_t nodfbr[], /* <-- boundary faces -> vertices connectivity */
+ cs_int_t lstcel[], /* <-> list of post-processed cells */
+ cs_int_t lstfac[], /* <-> list of post-processed interior faces */
+ cs_int_t lstfbr[], /* <-> list of post-processed boundary faces */
+ const cs_int_t idevel[], /* <-- IDEVEL integer array */
+ cs_int_t ituser[], /* <-- ITUSER integer array */
+ cs_int_t ia[], /* <-- IA integer array */
+ const cs_real_t xyzcen[], /* <-- points associated with cell centers */
+ const cs_real_t surfac[], /* <-- interior face surface vectors */
+ const cs_real_t surfbo[], /* <-- boundary face surface vectors */
+ const cs_real_t cdgfac[], /* <-- interior face centers */
+ const cs_real_t cdgfbr[], /* <-- boundary face vectors */
+ const cs_real_t xyznod[], /* <-- vertex coordinates (optional) */
+ const cs_real_t volume[], /* <-- cell volumes */
+ const cs_real_t dt[], /* <-- local time step */
+ const cs_real_t rtpa[], /* <-- cell variables at previous time step */
+ const cs_real_t rtp[], /* <-- cell variables */
+ const cs_real_t propce[], /* <-- cell physical properties */
+ const cs_real_t propfa[], /* <-- interior face physical properties */
+ const cs_real_t propfb[], /* <-- boundary face physical properties */
+ const cs_real_t coefa[], /* <-- boundary conditions array */
+ const cs_real_t coefb[], /* <-- boundary conditions array */
+ const cs_real_t statce[], /* <-- cell statistics (Lagrangian) */
+ cs_real_t tracel[], /* --- work array for output cells */
+ cs_real_t trafac[], /* --- work array for output interior faces */
+ cs_real_t trafbr[], /* --- work array for output boundary faces */
+ const cs_real_t rdevel[], /* <-- RDEVEL floating-point array */
+ cs_real_t rtuser[], /* <-- RTUSER floating-point array */
+ cs_real_t ra[] /* <-- RA floating-point array */
+);
+
+/*----------------------------------------------------------------------------
+ * User function for output of variables on a post-processing mesh
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (usvpst, USVPST)
+(
+ const cs_int_t *idbia0, /* <-> number of first free position in IA */
+ const cs_int_t *idbra0, /* <-> number of first free position in RA */
+ const cs_int_t *nummai, /* <-- number or post-processing mesh */
+ const cs_int_t *ndim, /* <-- spatial dimension */
+ const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
+ const cs_int_t *ncel, /* <-- number of cells */
+ const cs_int_t *nfac, /* <-- number of interior faces */
+ const cs_int_t *nfabor, /* <-- number of boundary faces */
+ const cs_int_t *nfml, /* <-- number of families (group classes) */
+ const cs_int_t *nprfml, /* <-- number of family (group class) properties */
+ const cs_int_t *nnod, /* <-- number of vertices */
+ const cs_int_t *lndfac, /* <-- size of nodfac */
+ const cs_int_t *lndfbr, /* <-- size of nodfbr */
+ const cs_int_t *ncelbr, /* <-- number of cells on boundary */
+ const cs_int_t *nvar, /* <-- number of variables */
+ const cs_int_t *nscal, /* <-- number of scalars */
+ const cs_int_t *nphas, /* <-- number of phases */
+ const cs_int_t *nvlsta, /* <-- number of statistical variables (lagr) */
+ const cs_int_t *ncelps, /* <-- number of post-processed cells */
+ const cs_int_t *nfacps, /* <-- number of post processed interior faces */
+ const cs_int_t *nfbrps, /* <-- number of post processed boundary faces */
+ const cs_int_t *nideve, /* <-- size of IDEVEL integer array */
+ const cs_int_t *nrdeve, /* <-- size of RDEVEL floating-point array */
+ const cs_int_t *nituse, /* <-- size of ITUSER integer array */
+ const cs_int_t *nrtuse, /* <-- size of RTUSER floating-point array */
+ const cs_int_t itypps[3], /* <-- flag (0 or 1) for presence of cells, */
+ /* interior faces, and boundary faces */
+ const cs_int_t ifacel[], /* <-- interior faces / cells connectivity */
+ const cs_int_t ifabor[], /* <-- boundary faces / cell connectivity */
+ const cs_int_t ifmfbr[], /* <-- boundary face families */
+ const cs_int_t ifmcel[], /* <-- cell families */
+ const cs_int_t iprfml[], /* <-- list of family properties */
+ const cs_int_t ipnfac[], /* <-- interior faces -> vertices connect. index */
+ const cs_int_t nodfac[], /* <-- interior faces -> vertices connectivity */
+ const cs_int_t ipnfbr[], /* <-- boundary faces -> vertices connect. index */
+ const cs_int_t nodfbr[], /* <-- boundary faces -> vertices connectivity */
+ const cs_int_t lstcel[], /* <-- list of post-processed cells */
+ const cs_int_t lstfac[], /* <-- list of post-processed interior faces */
+ const cs_int_t lstfbr[], /* <-- list of post-processed boundary faces */
+ const cs_int_t idevel[], /* <-- IDEVEL integer array */
+ cs_int_t ituser[], /* <-- ITUSER integer array */
+ cs_int_t ia[], /* <-- IA integer array */
+ const cs_real_t xyzcen[], /* <-- points associated with cell centers */
+ const cs_real_t surfac[], /* <-- interior face surface vectors */
+ const cs_real_t surfbo[], /* <-- boundary face surface vectors */
+ const cs_real_t cdgfac[], /* <-- interior face centers */
+ const cs_real_t cdgfbr[], /* <-- boundary face vectors */
+ const cs_real_t xyznod[], /* <-- vertex coordinates (optional) */
+ const cs_real_t volume[], /* <-- cell volumes */
+ const cs_real_t dt[], /* <-- local time step */
+ const cs_real_t rtpa[], /* <-- cell variables at previous time step */
+ const cs_real_t rtp[], /* <-- cell variables */
+ const cs_real_t propce[], /* <-- cell physical properties */
+ const cs_real_t propfa[], /* <-- interior face physical properties */
+ const cs_real_t propfb[], /* <-- boundary face physical properties */
+ const cs_real_t coefa[], /* <-- boundary conditions array */
+ const cs_real_t coefb[], /* <-- boundary conditions array */
+ const cs_real_t statce[], /* <-- cell statistics (Lagrangian) */
+ cs_real_t tracel[], /* --- work array for output cells */
+ cs_real_t trafac[], /* --- work array for output interior faces */
+ cs_real_t trafbr[], /* --- work array for output boundary faces */
+ const cs_real_t rdevel[], /* <-- RDEVEL floating-point array */
+ cs_real_t rtuser[], /* <-- RTUSER floating-point array */
+ cs_real_t ra[] /* <-- RA floating-point array */
+);
+
+/*----------------------------------------------------------------------------
+ * User function to compute coarsening array for algebraic multigrid
+ *----------------------------------------------------------------------------*/
+
+extern void CS_PROCF (ustmgr, USTMGR)
+(
+ const cs_int_t *iappel, /* <-- 1: initialization call
+ 2: computional call */
+ const cs_int_t *igr, /* <-- new grid level (0 = base) */
+ const cs_int_t *isym, /* <-- 1: symmetric; 2 nonsymmteric */
+ const cs_int_t *ncelf, /* <-- number of cells in fine grid */
+ const cs_int_t *ncelfe, /* <-- number of cells with halo in fine grid */
+ const cs_int_t *nfacf, /* <-- number of faces in fine grid */
+ const cs_int_t *iwarnp, /* <-- verbosity level */
+ cs_int_t *iusmgr, /* --> 0: automatic method
+ 1: use this sub-routine */
+ cs_int_t *niw, /* --> size of iw for call 2 */
+ cs_int_t *nrw, /* --> size of rw for call 2 */
+ const cs_int_t ifacef[], /* <-- fine grid face->cell connectivity */
+ const cs_real_t daf[], /* <-- diagonal terms of fine grid */
+ const cs_real_t xaf[], /* <-- extradiagonal terms of fine grid */
+ const cs_real_t surfaf[], /* <-- fine grid face surface vectors */
+ const cs_real_t volumf[], /* <-- fine grid cell volumes */
+ const cs_real_t xyzfin[], /* <-- fine grid cell centers */
+ cs_int_t irscel[], /* --> Fine -> coarse cell connectivity */
+ cs_int_t iw[], /* --> work array of size niw (call 2) */
+ cs_real_t rw[] /* --> work array of size nrw (call 2) */
+);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_PROTOTYPES_H__ */
diff --git a/include/base/cs_proxy_comm.h b/include/base/cs_proxy_comm.h
new file mode 100644
index 0000000..7c6e582
--- /dev/null
+++ b/include/base/cs_proxy_comm.h
@@ -0,0 +1,208 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_PROXY_COMM_H__
+#define __CS_PROXY_COMM_H__
+
+/*============================================================================
+ * Base communication functions for use with proxy
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+#define CS_PROXY_COMM_CMD_ABORT "cmd:abort"
+#define CS_PROXY_COMM_CMD_STOP "cmd:stop"
+#define CS_PROXY_COMM_FORWARD "forward"
+
+#define CS_PROXY_COMM_L_SEC_NAME 32
+
+/*============================================================================
+ * Type and structure definitions
+ *============================================================================*/
+
+typedef enum {
+ CS_PROXY_TYPE_string,
+ CS_PROXY_TYPE_int,
+ CS_PROXY_TYPE_float,
+ CS_PROXY_TYPE_double,
+} cs_proxy_type_t;
+
+typedef enum {
+
+ CS_PROXY_COMM_MSG_NONE, /* Not a message */
+ CS_PROXY_COMM_MSG_ABORT, /* Emergency stop */
+ CS_PROXY_COMM_MSG_STOP, /* End of communication */
+ CS_PROXY_COMM_MSG_FORWARD, /* Message to forward */
+ CS_PROXY_COMM_MSG_OTHER /* Undefined message type */
+
+} cs_proxy_comm_msg_t;
+
+typedef enum {
+
+ CS_PROXY_COMM_TYPE_SOCKET, /* Communicate through sockets */
+ CS_PROXY_COMM_TYPE_NULL /* Null communicator */
+
+} cs_proxy_comm_type_t;
+
+typedef struct _cs_proxy_comm_t cs_proxy_comm_t;
+
+/* Public structure used to save data from a message header, simplifying
+ the transfer of this data to processing functions */
+
+typedef struct {
+
+ cs_proxy_comm_msg_t msg_type;
+ int sec_num;
+ char sec_name[CS_PROXY_COMM_L_SEC_NAME + 1];
+ int n_elts;
+ cs_type_t elt_type;
+
+} cs_proxy_comm_msg_header_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Establish a connection to a proxy.
+ *
+ * parameters:
+ * port_name <-- name of server port (host:port for IP sockets)
+ * key <-- key for authentification
+ * type <-- communication type
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_initialize(const char *port_name,
+ int key,
+ cs_proxy_comm_type_t type);
+
+/*----------------------------------------------------------------------------
+ * Finalize a connection to a proxy.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_finalize(void);
+
+/*----------------------------------------------------------------------------
+ * Write a record to a proxy.
+ *
+ * parameters:
+ * rec <-- pointer to data to write
+ * size <-- size of each data element, in bytes
+ * count <-- number of data elements
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_write(const void *rec,
+ size_t size,
+ size_t count);
+
+/*----------------------------------------------------------------------------
+ * Read a record from a proxy.
+ *
+ * parameters:
+ * rec --> pointer to data to write
+ * size <-- size of each data element, in bytes
+ * count <-- number of data elements
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_read(void *rec,
+ size_t size,
+ size_t count);
+
+/*----------------------------------------------------------------------------
+ * Send a function-relay request to a proxy.
+ *
+ * parameters:
+ * func_name <-- name of function associated with request
+ * comp_id <-- associated component id
+ * n_ints <-- number of integer arguments
+ * n_doubles <-- number of floating-point arguments
+ * n_strings <-- number of string arguments
+ * int_vals <-- integer argument values
+ * double_vals <-- floating-point argument values
+ * string_vals <-- string argument values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_write_request(const char *func_name,
+ int comp_id,
+ int n_ints,
+ int n_doubles,
+ int n_strings,
+ const int int_vals[],
+ const double double_vals[],
+ const char *string_vals[]);
+
+/*----------------------------------------------------------------------------
+ * Read a function-relay response from a proxy.
+ *
+ * Return value arrays must be large enough to receive all values.
+ *
+ * parameters:
+ * n_ints <-- number of integer arguments
+ * n_doubles <-- number of floating-point arguments
+ * n_strings <-- number of string arguments
+ * int_vals --> integer argument values
+ * double_vals --> floating-point argument values
+ * string_vals --> string argument values
+ *
+ * returns:
+ * the relayed function's return value
+ *----------------------------------------------------------------------------*/
+
+int
+cs_proxy_comm_read_response(int n_ints,
+ int n_doubles,
+ int n_strings,
+ int int_vals[],
+ double double_vals[],
+ char *string_vals[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_PROXY_COMM_H__ */
diff --git a/include/base/cs_renumber.h b/include/base/cs_renumber.h
new file mode 100644
index 0000000..1935443
--- /dev/null
+++ b/include/base/cs_renumber.h
@@ -0,0 +1,78 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_RENUMBER_H__
+#define __CS_RENUMBER_H__
+
+/*============================================================================
+ * Optional mesh renumbering
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Renumber mesh elements for vectorization or OpenMP depending on code
+ * options and target machine.
+ *
+ * Currently, only the legacy vectorizing renumbering is handled.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_renumber_mesh(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_RENUMBER_H__ */
diff --git a/include/base/cs_restart.h b/include/base/cs_restart.h
new file mode 100644
index 0000000..dd8be57
--- /dev/null
+++ b/include/base/cs_restart.h
@@ -0,0 +1,415 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_RESTART_H__
+#define __CS_RESTART_H__
+
+/*============================================================================
+ * Manage checkpoint / restart files
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/* Error codes */
+
+#define CS_RESTART_SUCCES 0 /* Success */
+#define CS_RESTART_ERR_FILE_NUM -1 /* No restart file for the given number */
+#define CS_RESTART_ERR_LOCATION -2 /* Undefined location / incorrect size */
+#define CS_RESTART_ERR_VAL_TYPE -3 /* Unknown or unexpected value type */
+#define CS_RESTART_ERR_N_VALS -4 /* Number of values does not match */
+#define CS_RESTART_ERR_MODE -5 /* Incompatible access mode */
+#define CS_RESTART_ERR_EXISTS -6 /* Section not available */
+
+/*============================================================================
+ * Local type definitions
+ *============================================================================*/
+
+/* Read or write mode */
+
+typedef enum {
+
+ CS_RESTART_MODE_READ, /* Read mode */
+ CS_RESTART_MODE_WRITE /* Write mode */
+
+} cs_restart_mode_t;
+
+/* Predefined location types for a given section */
+
+typedef enum {
+
+ CS_RESTART_LOCATION_NONE, /* Global (no location) */
+ CS_RESTART_LOCATION_CELL, /* Values defined at cells */
+ CS_RESTART_LOCATION_I_FACE, /* Values defined at interior faces */
+ CS_RESTART_LOCATION_B_FACE, /* Values defined at boundary faces */
+ CS_RESTART_LOCATION_VERTEX /* Values defined at vertices */
+
+} cs_restart_location_t;
+
+/*
+ Pointeur associated with a restart file structure. The structure itself
+ is defined in "cs_restart.c", and is opaque outside that unit.
+*/
+
+typedef struct _cs_restart_t cs_restart_t;
+
+/*=============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public Fortran function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Open a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE OPNSUI (NOMSUI, LNGNOM, IREAWR, NUMSUI, IERROR)
+ * *****************
+ *
+ * CHARACTER* NOMSUI : --> : Restart file name
+ * INTEGER LNGNOM : --> : Restart file name length
+ * INTEGER IREAWR : --> : 1: read; 2: write
+ * INTEGER NUMSUI : <-- : Number of opened restart file
+ * INTEGER IERROR : <-- : 0: success; < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (opnsui, OPNSUI)
+(
+ const char *nomsui,
+ const cs_int_t *lngnom,
+ const cs_int_t *ireawr,
+ cs_int_t *numsui,
+ cs_int_t *ierror
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*----------------------------------------------------------------------------
+ * Close a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE CLSSUI (NUMSUI)
+ * *****************
+ *
+ * INTEGER NUMSUI : <-> : number of restart file to close
+ * INTEGER IERROR : <-- : 0: success; < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (clssui, CLSSUI)
+(
+ const cs_int_t *numsui,
+ cs_int_t *ierror
+);
+
+/*----------------------------------------------------------------------------
+ * Check the locations associated with a restart file.
+ *
+ * For each type of entity, return 1 if the associated number of entities
+ * matches the current value (and so that we consider the mesh locations are
+ * the same), 0 otherwise.
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE TSTSUI (NUMSUI, INDCEL, INDFAC, INDFBR, INDSOM)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ * INTEGER INDCEL : <-- : Matching cells flag
+ * INTEGER INDFAC : <-- : Matching interior faces flag
+ * INTEGER INDFBR : <-- : Matching boundary faces flag
+ * INTEGER INDSOM : <-- : Matching vertices flag
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tstsui, TSTSUI)
+(
+ const cs_int_t *numsui,
+ cs_int_t *indcel,
+ cs_int_t *indfac,
+ cs_int_t *indfbr,
+ cs_int_t *indsom
+);
+
+/*----------------------------------------------------------------------------
+ * Print index associated with a restart file in read mode
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE INFSUI (NUMSUI)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (infsui, INFSUI)
+(
+ const cs_int_t *numsui
+);
+
+/*----------------------------------------------------------------------------
+ * Read a section from a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE LECSUI (NUMSUI, NOMRUB, LNGNOM, ITYSUP, NBVENT, IRTYPE, TABVAR)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ * CHARACTER* NOMRUB : --> : Section name
+ * INTEGER LNGNOM : --> : Section name length
+ * INTEGER ITYSUP : --> : Location type:
+ * : : 0: scalar (no location)
+ * : : 1: cells
+ * : : 2: interior faces
+ * : : 3: boundary faces
+ * : : 4: vertices (if available)
+ * INTEGER NBVENT : --> : N. values per location entity
+ * INTEGER IRTYPE : --> : 1 for integers, 2 for double precision
+ * (?) TABVAR : <-> : Array of values to read
+ * INTEGER IERROR : <-- : 0: success, < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lecsui, LECSUI)
+(
+ const cs_int_t *numsui,
+ const char *nomrub,
+ const cs_int_t *lngnom,
+ const cs_int_t *itysup,
+ const cs_int_t *nbvent,
+ const cs_int_t *irtype,
+ void *tabvar,
+ cs_int_t *ierror
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*----------------------------------------------------------------------------
+ * Write a section to a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE ECRSUI (NUMSUI, NOMRUB, LNGNOM, ITYSUP, NBVENT, IRTYPE, TABVAR)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ * CHARACTER* NOMRUB : --> : Section name
+ * INTEGER LNGNOM : --> : Section name length
+ * INTEGER ITYSUP : --> : Location type:
+ * : : 0: scalar (no location)
+ * : : 1: cells
+ * : : 2: interior faces
+ * : : 3: boundary faces
+ * : : 4: vertices (if available)
+ * INTEGER NBVENT : --> : N. values per location entity
+ * INTEGER IRTYPE : --> : 1 for integers, 2 for double precision
+ * (?) TABVAR : --> : Array of values to write
+ * INTEGER IERROR : <-- : 0: success, < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ecrsui, ECRSUI)
+(
+ const cs_int_t *numsui,
+ const char *nomrub,
+ const cs_int_t *lngnom,
+ const cs_int_t *itysup,
+ const cs_int_t *nbvent,
+ const cs_int_t *irtype,
+ const void *tabvar,
+ cs_int_t *ierror
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a restart file
+ *
+ * parameters:
+ * name <-- file name
+ * mode <-- read or write
+ *
+ * returns:
+ * pointer to initialized restart file structure
+ *----------------------------------------------------------------------------*/
+
+cs_restart_t *
+cs_restart_create(const char *name,
+ cs_restart_mode_t mode);
+
+/*----------------------------------------------------------------------------
+ * Destroy structure associated with a restart file (and close the file).
+ *
+ * parameters:
+ * restart <-- pointer to restart file structure
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+cs_restart_t *
+cs_restart_destroy(cs_restart_t *restart);
+
+/*----------------------------------------------------------------------------
+ * Check the locations associated with a restart file.
+ *
+ * For each type of entity, the corresponding flag is set to true if the
+ * associated number of entities matches the current value (and so that we
+ * consider the mesh locations are the same), false otherwise.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * match_cell <-- matching cells flag
+ * match_i_face <-- matching interior faces flag
+ * match_b_face <-- matching boundary faces flag
+ * match_vertex <-- matching vertices flag
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_check_base_location(const cs_restart_t *restart,
+ cs_bool_t *match_cell,
+ cs_bool_t *match_i_face,
+ cs_bool_t *match_b_face,
+ cs_bool_t *match_vertex);
+
+/*----------------------------------------------------------------------------
+ * Add a location definition.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * location_name <-- name associated with the location
+ * n_glob_ents <-- global number of entities
+ * n_ents <-- local number of entities
+ * ent_global_num <-- global entity numbers, or NULL
+ *
+ * returns:
+ * the location id assigned, or -1 in case of error
+ *----------------------------------------------------------------------------*/
+
+int
+cs_restart_add_location(cs_restart_t *restart,
+ const char *location_name,
+ fvm_gnum_t n_glob_ents,
+ fvm_lnum_t n_ents,
+ const fvm_gnum_t *ent_global_num);
+
+/*----------------------------------------------------------------------------
+ * Print the index associated with a restart file in read mode
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_dump_index(const cs_restart_t *restart);
+
+/*----------------------------------------------------------------------------
+ * Read a section from a restart file.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * sec_name <-- section name
+ * location_id <-- id of corresponding location
+ * n_location_vals <-- number of values per location (interlaced)
+ * val_type <-- value type
+ * val --> array of values
+ *
+ * returns: 0 (CS_RESTART_SUCCES) in case of success,
+ * or error code (CS_RESTART_ERR_xxx) in case of error
+ *----------------------------------------------------------------------------*/
+
+int
+cs_restart_read_section(cs_restart_t *restart,
+ const char *sec_name,
+ int location_id,
+ cs_int_t n_location_vals,
+ cs_type_t val_type,
+ void *val);
+
+/*----------------------------------------------------------------------------
+ * Write a section to a restart file.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * sec_name <-- section name
+ * location_id <-- id of corresponding location
+ * n_location_vals <-- number of values per location (interlaced)
+ * val_type <-- value type
+ * val <-- array of values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_write_section(cs_restart_t *restart,
+ const char *sec_name,
+ int location_id,
+ cs_int_t n_location_vals,
+ cs_type_t val_type,
+ const void *val);
+
+/*----------------------------------------------------------------------------
+ * Print statistics associated with restart files
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_print_stats(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_RESTART_H__ */
diff --git a/include/base/cs_sat_coupling.h b/include/base/cs_sat_coupling.h
new file mode 100644
index 0000000..e9efbb8
--- /dev/null
+++ b/include/base/cs_sat_coupling.h
@@ -0,0 +1,428 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SAT_COUPLING_H__
+#define __CS_SAT_COUPLING_H__
+
+/*============================================================================
+ * Functions associated with code coupling.
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Structure Definitions
+ *============================================================================*/
+
+typedef struct _cs_sat_coupling_t cs_sat_coupling_t;
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get number of code coupling
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NBCCPL
+ * *****************
+ *
+ * INTEGER NBRCPL : <-- : number of code couplings
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (nbccpl, NBCCPL)
+(
+ cs_int_t *nbrcpl
+);
+
+/*----------------------------------------------------------------------------
+ * Set the list of cells and boundary faces associated to a coupling
+ * and a cloud of point.
+ *
+ * The local "support" cells and boundary faces are used to localize
+ * the values in the distant "coupled" cells and faces.
+ * Depending on the role of sender and/or receiver of the current process
+ * in the coupling, some of these sets can be empty or not.
+ *
+ * The cell values are always localized and interpolated on the distant
+ * "cells" support. The face values are localized and interpolated on
+ * the distant "face" support if present, or on the distant "cell" support
+ * if not.
+ *
+ * If the input arrays LCESUP and LFBSUP are not ordered, they will be
+ * orderd in output.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DEFCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCESUP : --> : number of "support" cells
+ * INTEGER NFBSUP : --> : number of "support" boundary faces
+ * INTEGER NCECPL : --> : number of coupled cells
+ * INTEGER NFBCPL : --> : number of coupled boundary faces
+ * INTEGER LCESUP(NCESUP) : <-> : list of "support" cells
+ * INTEGER LFBSUP(NFBSUP) : <-> : list of "support" boundary faces
+ * INTEGER LCECPL(NCECPL) : --> : list of coupled cells
+ * INTEGER LFBCPL(NFBCPL) : --> : list of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (defcpl, DEFCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *ncesup,
+ const cs_int_t *nfbsup,
+ const cs_int_t *ncecpl,
+ const cs_int_t *nfbcpl,
+ cs_int_t lcesup[],
+ cs_int_t lfbsup[],
+ const cs_int_t lcecpl[],
+ const cs_int_t lfbcpl[]
+);
+
+/*----------------------------------------------------------------------------
+ * Get the number of cells and boundary faces, "support", coupled and not
+ * localized associated to a given coupling
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NBECPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCESUP : <-- : number of "support" cells
+ * INTEGER NFBSUP : <-- : number of "support" boundary faces
+ * INTEGER NCECPL : <-- : number of coupled cells
+ * INTEGER NFBCPL : <-- : number of coupled boundary faces
+ * INTEGER NCENCP : <-- : number of not coupled cells
+ * : : (since not localized)
+ * INTEGER NFBNCP : <-- : number of not coupled boundary faces
+ * : : (since not localized)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (nbecpl, NBECPL)
+(
+ const cs_int_t *numcpl,
+ cs_int_t *ncesup,
+ cs_int_t *nfbsup,
+ cs_int_t *ncecpl,
+ cs_int_t *nfbcpl,
+ cs_int_t *ncencp,
+ cs_int_t *nfbncp
+);
+
+/*----------------------------------------------------------------------------
+ * Get the lists of coupled cells and boundary faces (i.e. receiving)
+ * associated to a given coupling
+ *
+ * The number of cells and boundary faces, got with NBECPL(), are used
+ * for arguments coherency checks.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LELCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCECPL : --> : number of coupled cells
+ * INTEGER NFBCPL : --> : number of coupled boundary faces
+ * INTEGER LCECPL(*) : <-- : list of coupled cells
+ * INTEGER LFBCPL(*) : <-- : list of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lelcpl, LELCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *ncecpl,
+ const cs_int_t *nfbcpl,
+ cs_int_t *lcecpl,
+ cs_int_t *lfbcpl
+);
+
+/*----------------------------------------------------------------------------
+ * Get the lists of not coupled cells and boundary faces (i.e. receiving but
+ * not localized) associated to a given coupling
+ *
+ * The number of cells and boundary faces, got with NBECPL(), are used
+ * for arguments coherency checks.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LENCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCENCP : --> : number of not coupled cells
+ * INTEGER NFBNCP : --> : number of not coupled boundary faces
+ * INTEGER LCENCP(*) : <-- : list of not coupled cells
+ * INTEGER LFBNCP(*) : <-- : list of not coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lencpl, LENCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *ncencp,
+ const cs_int_t *nfbncp,
+ cs_int_t *lcencp,
+ cs_int_t *lfbncp
+);
+
+/*----------------------------------------------------------------------------
+ * Get the number of distant point associated to a given coupling
+ * and localized on the local domain
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NPDCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCEDIS : <-- : number of distant cells
+ * INTEGER NFBDIS : <-- : numbre de distant boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (npdcpl, NPDCPL)
+(
+ const cs_int_t *numcpl,
+ cs_int_t *ncedis,
+ cs_int_t *nfbdis
+);
+
+/*----------------------------------------------------------------------------
+ * Get the distant points coordinates associated to a given coupling
+ * and a list of points, and the elements number and type (cell or face)
+ * "containing" this points.
+ *
+ * The number of distant points NBRPTS must be equal to one the arguments
+ * NCEDIS or NFBDIS given by NPDCPL(), and is given here for coherency checks
+ * between the arguments NUMCPL and ITYSUP.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE COOCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRPTS : --> : number of distant points
+ * INTEGER ITYDIS : --> : 1 : access to the points associated
+ * : : to the distant cells
+ * : : 2 : access to the points associated
+ * : : to the distant boundary faces
+ * INTEGER ITYLOC : <-- : 1 : localization on the local cells
+ * : : 2 : localization on the local faces
+ * INTEGER LOCPTS(*) : <-- : "containing" number associated to
+ * : : each point
+ * DOUBLE PRECISION COOPTS(3,*) : <-- : distant point coordinates
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (coocpl, COOCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrpts,
+ const cs_int_t *itydis,
+ cs_int_t *ityloc,
+ cs_int_t *locpts,
+ cs_real_t *coopts,
+ cs_real_t *djppts,
+ cs_real_t *dofpts,
+ cs_real_t *pndpts
+);
+
+/*----------------------------------------------------------------------------
+ * Get the weighting coefficient needed for a centred-like interpolation
+ * in the case of a coupling on boundary faces.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PNDCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRCPL : --> : number of distant points
+ * INTEGER ITYLOC : <-- : 1 : localization on the local cells
+ * : : 2 : localization on the local faces
+ * DOUBLE PRECISION PONDCP(*) : <-- : weighting coefficients
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pndcpl, PNDCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrcpl,
+ cs_int_t *ityloc,
+ cs_real_t *pondcp,
+ cs_real_t *distof
+);
+
+/*----------------------------------------------------------------------------
+ * Exchange a variable associated to a set of point and a coupling.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE VARCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRDIS : --> : number of values to send
+ * INTEGER NBRLOC : --> : number of values to receive
+ * INTEGER ITYVAR : --> : 1 : variables defined at cells
+ * : : 2 : variables defined at faces
+ * DOUBLE PRECISION VARDIS(*) : --> : distant variable(to send)
+ * DOUBLE PRECISION VARLOC(*) : <-- : local variable (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (varcpl, VARCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrdis,
+ const cs_int_t *nbrloc,
+ const cs_int_t *ityvar,
+ cs_real_t *vardis,
+ cs_real_t *varloc
+);
+
+/*----------------------------------------------------------------------------
+ * Array of integers exchange, associated to a given coupling.
+ *
+ * It is assumed that the arrays have the same size and the same values on
+ * each group of processus (local and distant).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TBICPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRDIS : --> : number of values to send
+ * INTEGER NBRLOC : --> : number of values to receive
+ * INTEGER TABDIS(*) : --> : distant values (to send)
+ * INTEGER TABLOC(*) : <-- : local values (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tbicpl, TBICPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrdis,
+ const cs_int_t *nbrloc,
+ cs_int_t *vardis,
+ cs_int_t *varloc
+);
+
+
+/*----------------------------------------------------------------------------
+ * Array of reals exchange, associated to a given coupling.
+ *
+ * It is assumed that the arrays have the same size and the same values on
+ * each group of processus (local and distant).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TBRCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRDIS : --> : number of values to send
+ * INTEGER NBRLOC : --> : number of values to receive
+ * DOUBLE PRECISION TABDIS(*) : --> : distant values (to send)
+ * DOUBLE PRECISION TABLOC(*) : <-- : local values (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tbrcpl, TBRCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrdis,
+ const cs_int_t *nbrloc,
+ cs_real_t *vardis,
+ cs_real_t *varloc
+);
+
+/*----------------------------------------------------------------------------
+ * Compute the maximum value of an integer variable associated to a coupling.
+ *
+ * It is assumed that the integer value is the same for each group of
+ * processus (local and distant).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE MXICPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER VALDIS : --> : distant value (to send)
+ * INTEGER VALMAX : <-- : local maximum (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (mxicpl, MXICPL)
+(
+ const cs_int_t *const numcpl,
+ cs_int_t *const vardis,
+ cs_int_t *const varmax
+);
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Add a coupling.
+ *
+ * Couplings are allowed either with process totally distinct from the
+ * application communicator (cs_glob_mpi_comm), or within this same
+ * communicator.
+ *
+ * parameters:
+ * rang_deb <-- root rank of distant process leader in MPI_COMM_WORLD
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sat_coupling_add(const int root_rank);
+
+/*----------------------------------------------------------------------------
+ * Destroy all couplings
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sat_coupling_all_finalize(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_COUPLAGE_H__ */
diff --git a/include/base/cs_search.h b/include/base/cs_search.h
new file mode 100644
index 0000000..be28fdf
--- /dev/null
+++ b/include/base/cs_search.h
@@ -0,0 +1,117 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SEARCH_H__
+#define __CS_SEARCH_H__
+
+/*============================================================================
+ * Search elements in arrays
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search. Array or list must be ordered.
+ *
+ * parameters:
+ * size <-- size of list
+ * gnum <-- find index for this number
+ * lst <-- list of ordered global numbers to scan
+ *
+ * returns:
+ * id associated to the current number. If not found, returned -1.
+ *---------------------------------------------------------------------------*/
+
+int
+cs_search_g_binary(size_t size,
+ fvm_gnum_t gnum,
+ const fvm_gnum_t lst[]);
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search (binary search). Array or list must be ordered.
+ *
+ * parameters:
+ * size <-- size of list
+ * num <-- find index for this number
+ * lst <-- list of ordered numbers to scan
+ *
+ * returns:
+ * id associated to the current number. If not found, return -1.
+ *---------------------------------------------------------------------------*/
+
+int
+cs_search_binary(size_t size,
+ cs_int_t num,
+ const cs_int_t lst[]);
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search (binary search). Index must be ordered and without null range.
+ *
+ * parameters:
+ * size <-- size of index -1
+ * gnum <-- number for which we want the position in index
+ * index <-- index array
+ *
+ * returns:
+ * id in index of gnum. If not found, returned -1.
+ *---------------------------------------------------------------------------*/
+
+int
+cs_search_gindex_binary(size_t size,
+ fvm_gnum_t gnum,
+ const fvm_gnum_t index[]);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SEARCH_H__ */
diff --git a/include/base/cs_selector.h b/include/base/cs_selector.h
new file mode 100644
index 0000000..cf804fe
--- /dev/null
+++ b/include/base/cs_selector.h
@@ -0,0 +1,137 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SELECTOR_H__
+#define __CS_SELECTOR_H__
+
+/*============================================================================
+ * Build selection lists for faces or cells
+ *============================================================================*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public functions definition for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build a list of boundary faces verifying a given selection criteria.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csgfbr, CSGFBR)
+(
+ const char *const fstr, /* <-- Fortran string */
+ cs_int_t *const len, /* <-- String Length */
+ cs_int_t *const n_faces, /* --> number of faces */
+ cs_int_t *const face_list /* --> face list */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*----------------------------------------------------------------------------
+ * Build a list of interior faces verifying a given selection criteria.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csgfac, CSGFAC)
+(
+ const char *const fstr, /* <-- Fortran string */
+ cs_int_t *const len, /* <-- String Length */
+ cs_int_t *const n_faces, /* --> number of faces */
+ cs_int_t *const face_list /* --> face list */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*----------------------------------------------------------------------------
+ * Build a list of cells verifying a given selection criteria.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csgcel, CSGCEL)
+(
+ const char *const fstr, /* <-- Fortran string */
+ cs_int_t *const len, /* <-- String Length */
+ cs_int_t *const n_cells, /* --> number of cells */
+ cs_int_t *const cell_list /* --> cell list */
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Fill a list of boundary faces verifying a given selection criteria.
+ *
+ * parameters:
+ * criteria <-- selection criteria string
+ * n_b_faces --> number of selected interior faces
+ * b_face_list --> list of selected boundary faces
+ * (1 to n, preallocated to cs_glob_mesh->n_b_faces)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_selector_get_b_face_list(const char *criteria,
+ fvm_lnum_t *n_b_faces,
+ fvm_lnum_t b_face_list[]);
+
+/*----------------------------------------------------------------------------
+ * Fill a list of interior faces verifying a given selection criteria.
+ *
+ * parameters:
+ * criteria <-- selection criteria string
+ * n_i_faces --> number of selected interior faces
+ * i_face_list --> list of selected interior faces
+ * (1 to n, preallocated to cs_glob_mesh->n_i_faces)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_selector_get_i_face_list(const char *criteria,
+ fvm_lnum_t *n_i_faces,
+ fvm_lnum_t i_face_list[]);
+
+/*----------------------------------------------------------------------------
+ * Fill a list of cells verifying a given selection criteria.
+ *
+ * parameters:
+ * criteria <-- selection criteria string
+ * n_cells --> number of selected cells
+ * cell_list --> list of selected cells
+ * (1 to n, preallocated to cs_glob_mesh->n_cells)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_selector_get_cell_list(const char *criteria,
+ fvm_lnum_t *n_cells,
+ fvm_lnum_t cell_list[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SELECTOR_H__ */
diff --git a/include/base/cs_sles.h b/include/base/cs_sles.h
new file mode 100644
index 0000000..c60e2c0
--- /dev/null
+++ b/include/base/cs_sles.h
@@ -0,0 +1,260 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SLES_H__
+#define __CS_SLES_H__
+
+/*============================================================================
+ * Sparse Linear Equation Solvers
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_matrix.h"
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Solver types
+ *----------------------------------------------------------------------------*/
+
+typedef enum {
+
+ CS_SLES_PCG, /* Preconditionned conjugate gradient */
+ CS_SLES_JACOBI, /* Jacobi */
+ CS_SLES_BICGSTAB, /* Bi-conjugate gradient stabilized */
+ CS_SLES_N_TYPES /* Number of implemented resolution algorithms */
+
+} cs_sles_type_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/* Short names for matrix types */
+
+extern const char *cs_sles_type_name[];
+
+/*=============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * General sparse linear system resolution
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(reslin, RESLIN)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname, /* <-- variable name length */
+ const cs_int_t *ncelet, /* <-- Number of cells, halo included */
+ const cs_int_t *ncel, /* <-- Number of local cells */
+ const cs_int_t *nfac, /* <-- Number of faces */
+ const cs_int_t *isym, /* <-- Symmetry indicator:
+ 1: symmetric; 2: not symmetric */
+ const cs_int_t *ireslp, /* <-- Resolution type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *ipol, /* <-- Preconditioning polynomial degree
+ (0: diagonal) */
+ const cs_int_t *nitmap, /* <-- Number of max iterations */
+ const cs_int_t *iinvpe, /* <-- Indicator to cancel increments
+ in rotational periodicty (2) or
+ to exchange them as scalars (1) */
+ const cs_int_t *iwarnp, /* <-- Verbosity level */
+ cs_int_t *niterf, /* --> Number of iterations done */
+ const cs_real_t *epsilp, /* <-- Precision for iterative resolution */
+ const cs_real_t *rnorm, /* <-- Residue normalization */
+ cs_real_t *residu, /* --> Final non normalized residue */
+ const cs_int_t *ifacel, /* <-- Face -> cell connectivity */
+ const cs_real_t *dam, /* <-- Matrix diagonal */
+ const cs_real_t *xam, /* <-- Matrix extra-diagonal terms */
+ const cs_real_t *smbrp, /* <-- System right-hand side */
+ cs_real_t *vx /* <-> System solution */
+);
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize sparse linear equation solver API.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_initialize(void);
+
+/*----------------------------------------------------------------------------
+ * Finalize sparse linear equation solver API.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_finalize(void);
+
+/*----------------------------------------------------------------------------
+ * Test if a general sparse linear system needs solving or if the right-hand
+ * side is already zero within convergence criteria.
+ *
+ * The computed residue is also updated;
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * solver_name <-- Name of solver
+ * n_rows <-- Number of (non ghost) rows in rhs
+ * verbosity <-- Verbosity level
+ * r_norm <-- Residue normalization
+ * residue <-> Residue
+ * rhs <-- Right hand side
+ *
+ * returns:
+ * 1 if solving is required, 0 if the rhs is already zero within tolerance
+ * criteria (precision of residue normalization)
+ *----------------------------------------------------------------------------*/
+
+int
+cs_sles_needs_solving(const char *var_name,
+ const char *solver_name,
+ cs_int_t n_rows,
+ int verbosity,
+ double r_norm,
+ double *residue,
+ const cs_real_t *rhs);
+
+/*----------------------------------------------------------------------------
+ * General sparse linear system resolution.
+ *
+ * Note that in most cases (if the right-hand side is not already zero
+ * within convergence criteria), coefficients are assigned to matrixes
+ * then released by this function, so coefficients need not be assigned
+ * prior to this call, and will have been released upon returning.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * solver_type <-- Type of solver (PCG, Jacobi, ...)
+ * update_stats <-- Automatic solver statistics indicator
+ * symmetric <-- Symmetric coefficients indicator
+ * ad_coeffs <-- Diagonal coefficients of linear equation matrix
+ * ax_coeffs <-- Non-diagonal coefficients of linear equation matrix
+ * a <-> Matrix
+ * ax <-> Non-diagonal part of linear equation matrix
+ * (only necessary if poly_degree > 0)
+ * poly_degree <-- Preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * verbosity <-- Verbosity level
+ * n_max_iter <-- Maximum number of iterations
+ * precision <-- Precision limit
+ * r_norm <-- Residue normalization
+ * n_iter --> Number of iterations
+ * residue <-> Residue
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * iteration number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+int
+cs_sles_solve(const char *var_name,
+ cs_sles_type_t solver_type,
+ cs_bool_t update_stats,
+ cs_bool_t symmetric,
+ const cs_real_t *ad_coeffs,
+ const cs_real_t *ax_coeffs,
+ cs_matrix_t *a,
+ cs_matrix_t *ax,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ int verbosity,
+ int n_max_iter,
+ double precision,
+ double r_norm,
+ int *n_iter,
+ double *residue,
+ const cs_real_t *rhs,
+ cs_real_t *vx,
+ size_t aux_size,
+ void *aux_vectors);
+
+/*----------------------------------------------------------------------------
+ * Output default post-processing data for failed system convergence.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * mesh_id <-- id of error output mesh, or 0 if none
+ * symmetric <-- indicates if matrix values are symmetric
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * ad <-- Diagonal part of linear equation matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * rhs <-- Right hand side
+ * vx <-> Current system solution
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_post_error_output_def(const char *var_name,
+ int mesh_id,
+ cs_bool_t symmetric,
+ cs_perio_rota_t rotation_mode,
+ const cs_real_t *ad,
+ const cs_real_t *ax,
+ const cs_real_t *rhs,
+ cs_real_t *vx);
+
+/*----------------------------------------------------------------------------
+ * Output post-processing variable for failed system convergence.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * mesh_id <-- id of error output mesh, or 0 if none
+ * var <-- Variable values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_post_error_output_var(const char *var_name,
+ int mesh_id,
+ cs_real_t *var);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SLES_H__ */
diff --git a/include/base/cs_sort.h b/include/base/cs_sort.h
new file mode 100644
index 0000000..590af9f
--- /dev/null
+++ b/include/base/cs_sort.h
@@ -0,0 +1,137 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+#ifndef __CS_SORT_H__
+#define __CS_SORT_H__
+
+/*============================================================================
+ * Functions related to in-place sorting of arrays.
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Macro definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *===========================================================================*/
+
+/*=============================================================================
+ * Static global variables
+ *===========================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" between its left bound "l" and its right bound "r"
+ * thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l <-- left bound
+ * r <-- right bound
+ * a <-> array to sort
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_shell(cs_int_t l,
+ cs_int_t r,
+ cs_int_t a[]);
+
+/*----------------------------------------------------------------------------
+ * Sort a global array "a" between its left bound "l" and its right bound "r"
+ * thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l <-- left bound
+ * r <-- right bound
+ * a <-> array to sort
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_gnum_shell(cs_int_t l,
+ cs_int_t r,
+ fvm_gnum_t a[]);
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" and apply the sort to its associated array "b" (local
+ * numbering)
+ * Sort is realized thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l --> left bound
+ * r --> right bound
+ * a <-> array to sort
+ * b <-> associated array
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_coupled_shell(cs_int_t l,
+ cs_int_t r,
+ cs_int_t a[],
+ cs_int_t b[]);
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" and apply the sort to its associated array "b" (local
+ * numbering)
+ * Sort is realized thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l --> left bound
+ * r --> right bound
+ * a <-> array to sort
+ * b <-> associated array
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_coupled_gnum_shell(cs_int_t l,
+ cs_int_t r,
+ fvm_gnum_t a[],
+ fvm_gnum_t b[]);
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SORT_H__ */
diff --git a/include/base/cs_syr3_comm.h b/include/base/cs_syr3_comm.h
new file mode 100644
index 0000000..40fde00
--- /dev/null
+++ b/include/base/cs_syr3_comm.h
@@ -0,0 +1,209 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SYR3_COMM_H__
+#define __CS_SYR3_COMM_H__
+
+/*============================================================================
+ * Communication with SYRTHES 3
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+#define CS_SYR3_COMM_FIN_FICHIER "EOF"
+
+#define CS_SYR3_COMM_H_LEN 32 /* Length of a header name */
+
+/* Socket communications: we suppose a maximum of 8 coupled SYRTHES instances;
+ this value may be modified through the CS_SYR3_COMM_SOCKET_NBR_MAX
+ environment variable */
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Message type
+ *----------------------------------------------------------------------------*/
+
+typedef enum {
+
+ CS_SYR3_COMM_TYPE_NONE, /* No communication (pre-initialization) */
+ CS_SYR3_COMM_TYPE_MPI, /* MPI messages */
+ CS_SYR3_COMM_TYPE_SOCKET /* IP sockets */
+
+} cs_syr3_comm_type_t;
+
+/* Pointer associated with an opaque communicator structure. */
+
+typedef struct _cs_syr3_comm_t cs_syr3_comm_t;
+
+/* Structure used to save message header data, to simplify its use. */
+
+typedef struct {
+
+ char sec_name[CS_SYR3_COMM_H_LEN + 1];
+ cs_int_t n_elts;
+ cs_type_t elt_type;
+
+} cs_syr3_comm_msg_header_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a communication
+ *
+ * parameters:
+ * number, <-- coupling number
+ * proc_rank, <-- communicating process rank (< 0 if using sockets)
+ * type, <-- communication type
+ * echo <-- echo on main output (< 0 if none, header if 0,
+ * n first and last elements if n)
+ *
+ * returns:
+ * pointer to communication structure
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_t *
+cs_syr3_comm_initialize(int number,
+#if defined(HAVE_MPI)
+ int proc_rank,
+#endif
+ cs_syr3_comm_type_t type,
+ cs_int_t echo);
+
+/*----------------------------------------------------------------------------
+ * Finalize a communication
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_t *
+cs_syr3_comm_finalize(cs_syr3_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Return a pointer to a communicator name
+ *
+ * parameters:
+ * comm <-- communicator
+ *
+ * returns:
+ * pointer to communicator name
+ *----------------------------------------------------------------------------*/
+
+const char *
+cs_syr3_comm_get_name(const cs_syr3_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Send message
+ *
+ * parameters:
+ * nom_rub <-- section name
+ * n_elts <-- number of elements
+ * elt_type <-- element type if n_elts > 0
+ * elts <-- elements if n_elts > 0
+ * comm <-- communicator
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_send_message(const char nom_rub[CS_SYR3_COMM_H_LEN],
+ cs_int_t n_elts,
+ cs_type_t elt_type,
+ void *elts,
+ const cs_syr3_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Receive message header
+ *
+ * parameters:
+ * header --> message header
+ * comm <-- communicator
+ *
+ * returns
+ * number of elements in message body
+ *----------------------------------------------------------------------------*/
+
+cs_int_t
+cs_syr3_comm_receive_header(cs_syr3_comm_msg_header_t *header,
+ const cs_syr3_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Receive a message body
+ *
+ * parameters:
+ * header <-- message header
+ * elt --> received body values
+ * comm <-- communicator
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_receive_body(const cs_syr3_comm_msg_header_t *header,
+ void *elt,
+ const cs_syr3_comm_t *comm);
+
+#if defined(HAVE_SOCKET)
+
+/*----------------------------------------------------------------------------
+ * Open an IP socket to prepare for this communication mode
+ *
+ * parameters:
+ * port_num <-- port number (only used for rank 0; automatic on others)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_init_socket(int port_num);
+
+/*----------------------------------------------------------------------------
+ * Close an IP socket associated with this communication mode
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_finalize_socket(void);
+
+#endif /* HAVE_SOCKET */
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SYR3_COMM_H__ */
diff --git a/include/base/cs_syr3_coupling.h b/include/base/cs_syr3_coupling.h
new file mode 100644
index 0000000..e7abb6b
--- /dev/null
+++ b/include/base/cs_syr3_coupling.h
@@ -0,0 +1,284 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SYR3_COUPLING_H__
+#define __CS_SYR3_COUPLING_H__
+
+/*============================================================================
+ * Syrthes 3 coupling
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_syr3_comm.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Structure definition
+ *============================================================================*/
+
+/* Structure associated to Syrthes coupling */
+
+typedef struct _cs_syr3_coupling_t cs_syr3_coupling_t;
+
+/*============================================================================
+ * Global variables definition
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get number of SYRTHES couplings.
+ *
+ * returns:
+ * number of SYRTHES couplings
+ *----------------------------------------------------------------------------*/
+
+int
+cs_syr3_coupling_n_couplings(void);
+
+/*----------------------------------------------------------------------------
+ * Get pointer to SYRTHES coupling.
+ *
+ * parameters:
+ * coupling_id <-- Id (0 to n-1) of SYRTHES coupling
+ *
+ * returns:
+ * pointer to SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_coupling_t *
+cs_syr3_coupling_by_id(int coupling_id);
+
+/*----------------------------------------------------------------------------
+ * Get communicator type associated with SYRTHES coupling
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * communicator type
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_type_t
+cs_syr3_coupling_get_comm_type(const cs_syr3_coupling_t *syr_coupling);
+
+/*----------------------------------------------------------------------------
+ * Get communicator associated with SYRTHES coupling
+ *
+ * parameters:
+ * syr_coupling <-- coupling structure associated with SYRTHES
+ *
+ * returns:
+ * pointer to communicator
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_t *
+cs_syr3_coupling_get_comm(const cs_syr3_coupling_t *syr_coupling);
+
+/*----------------------------------------------------------------------------
+ * Get number of vertices in coupled mesh
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * number of vertices in coupled mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_syr3_coupling_get_n_vertices(const cs_syr3_coupling_t *syr_coupling);
+
+/*----------------------------------------------------------------------------
+ * Get number of associated coupled faces in main mesh
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * number of vertices in coupled mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_syr3_coupling_get_n_faces(const cs_syr3_coupling_t *syr_coupling);
+
+/*----------------------------------------------------------------------------
+ * Get local list of coupled faces
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * coupl_face_list --> List of coupled faces (1 to n)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_get_face_list(const cs_syr3_coupling_t *syr_coupling,
+ fvm_lnum_t coupl_face_list[]);
+
+/*----------------------------------------------------------------------------
+ * Create a syr3_coupling_t structure.
+ *
+ * parameters:
+ * dim <-- spatial mesh dimension
+ * ref_axis <-- reference axis
+ * face_sel_criterion <-- criterion for selection of boundary faces
+ * syr_num <-- SYRTHES number
+ * syr_proc_rank <-- syrthes process rank for MPI
+ * comm_type <-- communicator type
+ * verbosity <-- verbosity level
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_add(int dim,
+ int ref_axis,
+ const char *face_sel_criterion,
+ int syr_num,
+ int syr_proc_rank,
+ cs_syr3_comm_type_t comm_type,
+ int verbosity);
+
+/*----------------------------------------------------------------------------
+ * Initialize communicator for Syrthes coupling
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * syr_id <-- SYRTHRS coupling id
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_init_comm(cs_syr3_coupling_t *syr_coupling,
+ int syr_id);
+
+/*----------------------------------------------------------------------------
+ * Destroy cs_syr3_coupling_t structures
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_all_destroy(void);
+
+/*----------------------------------------------------------------------------
+ * Define coupled mesh and send it to SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_init_mesh(cs_syr3_coupling_t *syr_coupling);
+
+/*----------------------------------------------------------------------------
+ * Interpolate a vertex field to an element-centered field
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * vtx_values <-- values defined on vertices
+ * elt_values <-> values defined on elements
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_vtx_to_elt(const cs_syr3_coupling_t *syr_coupling,
+ const cs_real_t *vtx_values,
+ cs_real_t *elt_values);
+
+/*----------------------------------------------------------------------------
+ * Interpolate an element-centered field to a vertex field.
+ *
+ * The size of vtx_values array must be twice the number of vertices.
+ * The first half gets values and the second half is used as a working array.
+ * The two parts must be contiguous in parallel mode for MPI transfers.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * elt_values <-> array of values defined on elements
+ * n_vtx_values <-- number of values defined on vertices
+ * vtx_values <-> array of values defined on vertices
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_elt_to_vtx(const cs_syr3_coupling_t *syr_coupling,
+ const cs_real_t *elt_values,
+ fvm_lnum_t n_vertices,
+ cs_real_t *vtx_values);
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing of a Syrthes coupling
+ *
+ * parameters:
+ * coupling_id <-- Id of SYRTHES coupling
+ * writer_id <-- Id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_post_init(int coupling_id,
+ cs_int_t writer_id);
+
+/*----------------------------------------------------------------------------
+ * Update post-processing variables of a Syrthes coupling
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * step <-- 0: var = wall temperature
+ * 1: var = fluid temperature
+ * 2: var = exchange coefficient
+ * var <-- Pointer to variable values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_post_var_update(cs_syr3_coupling_t *syr_coupling,
+ int step,
+ const cs_real_t *var);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SYR3_COUPLING_H__ */
diff --git a/include/base/cs_syr3_messages.h b/include/base/cs_syr3_messages.h
new file mode 100644
index 0000000..7963495
--- /dev/null
+++ b/include/base/cs_syr3_messages.h
@@ -0,0 +1,127 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SYR3_MESSAGES_H__
+#define __CS_SYR3_MESSAGES_H__
+
+/*============================================================================
+ * Manage messages for Syrthes coupling: sending, receiving and interpolation
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check if Syrthes coupling continues or if we must finalize communications.
+ *
+ * parameters:
+ * nt_cur_abs <-- current iteration number
+ * nt_max_abs <-> maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_test_iter(int nt_cur_abs,
+ int *nt_max_abs);
+
+/*----------------------------------------------------------------------------
+ * Synchronize new time step
+ *
+ * parameters:
+ * nt_cur_abs <-- current iteration number
+ * nt_max_abs --> maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_new_time_step(int nt_cur_abs,
+ int nt_max_abs);
+
+/*----------------------------------------------------------------------------
+ * Receive coupling variables from Syrthes
+ *
+ * parameters:
+ * syr_num <-- Syrthes 3 coupling number
+ * twall --> wall temperature
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_recv_twall(cs_int_t syr_num,
+ cs_real_t twall[]);
+
+/*----------------------------------------------------------------------------
+ * Send coupling variables to Syrthes
+ *
+ * parameters:
+ * syr_num <-- Syrthes 3 coupling number
+ * tfluid <-- wall exchange coefficient
+ * hwall <-- wall exchange coefficient
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_send_tf_hwall(cs_int_t syr_num,
+ cs_real_t tfluid[],
+ cs_real_t hwall[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SYR3_MESSAGES_H__ */
diff --git a/include/base/cs_syr4_coupling.h b/include/base/cs_syr4_coupling.h
new file mode 100644
index 0000000..15c26ac
--- /dev/null
+++ b/include/base/cs_syr4_coupling.h
@@ -0,0 +1,255 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SYR4_COUPLING_H__
+#define __CS_SYR4_COUPLING_H__
+
+/*============================================================================
+ * Syrthes 4 coupling
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Structure definition
+ *============================================================================*/
+
+/* Structure associated to Syrthes coupling */
+
+typedef struct _cs_syr4_coupling_t cs_syr4_coupling_t;
+
+/*============================================================================
+ * Global variables definition
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get number of SYRTHES couplings.
+ *
+ * returns:
+ * number of SYRTHES couplings
+ *----------------------------------------------------------------------------*/
+
+int
+cs_syr4_coupling_n_couplings(void);
+
+/*----------------------------------------------------------------------------
+ * Get pointer to SYRTHES coupling.
+ *
+ * parameters:
+ * coupling_id <-- Id (0 to n-1) of SYRTHES coupling
+ *
+ * returns:
+ * pointer to SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+cs_syr4_coupling_t *
+cs_syr4_coupling_by_id(cs_int_t coupling_id);
+
+/*----------------------------------------------------------------------------
+ * Create a syr4_coupling_t structure.
+ *
+ * parameters:
+ * dim <-- spatial mesh dimension
+ * ref_axis <-- reference axis
+ * face_sel_criterion <-- criterion for selection of boundary faces
+ * cell_sel_criterion <-- criterion for selection of cells
+ * app_num <-- SYRTHES application number, or -1
+ * app_name <-- SYRTHES application name, or NULL
+ * verbosity <-- verbosity level
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_add(fvm_lnum_t dim,
+ fvm_lnum_t ref_axis,
+ const char *face_sel_criterion,
+ const char *cell_sel_criterion,
+ int app_num,
+ const char *app_name,
+ int verbosity);
+
+/*----------------------------------------------------------------------------
+ * Destroy cs_syr4_coupling_t structures
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_all_destroy(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize communicator for SYRTHES coupling
+ *
+ * parameters:
+ * syr_coupling <-> Syrthes coupling structure
+ * coupling_id <-- id of this coupling (for log file message)
+ * syr_root_rank <-- SYRTHES root rank
+ * n_syr_ranks <-- Number of ranks associated with SYRTHES
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_init_comm(cs_syr4_coupling_t *syr_coupling,
+ int coupling_id,
+ int syr_root_rank,
+ int n_syr_ranks);
+
+/*----------------------------------------------------------------------------
+ * Exchange new iteration or stop message with SYRTHES.
+ *
+ * If nt_cur_abs < nt_max_abs, a new iteration message is sent;
+ * otherwise, a stop message is sent. A corresponding message
+ * is received, and if it is a stop message, nt_max_abs is
+ * set to nt_cur_abs.
+ *
+ * parameters:
+ * nt_cur_abs <-- current iteration number
+ * nt_max_abs <-> maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_sync_iter(int nt_cur_abs,
+ int *nt_max_abs);
+
+/*----------------------------------------------------------------------------
+ * Synchronize new time step
+ *
+ * parameters:
+ * nt_cur_abs <-- current iteration number
+ * nt_max_abs --> maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_new_time_step(int nt_cur_abs,
+ int nt_max_abs);
+
+/*----------------------------------------------------------------------------
+ * Define coupled mesh and send it to SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_init_mesh(cs_syr4_coupling_t *syr_coupling);
+
+/*----------------------------------------------------------------------------
+ * Get number of associated coupled faces in main mesh
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * number of vertices in coupled mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_syr4_coupling_get_n_faces(const cs_syr4_coupling_t *syr_coupling);
+
+/*----------------------------------------------------------------------------
+ * Get local numbering of coupled faces
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * coupl_face_list --> List of coupled faces (1 to n)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_get_face_list(const cs_syr4_coupling_t *syr_coupling,
+ cs_int_t coupl_face_list[]);
+
+/*----------------------------------------------------------------------------
+ * Receive coupling variables from SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * twall --> wall temperature
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_recv_twall(cs_syr4_coupling_t *syr_coupling,
+ cs_real_t twall[]);
+
+/*----------------------------------------------------------------------------
+ * Send coupling variables to SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * tf <-- fluid temperature
+ * hwall <-- wall heat exchange coefficient (numerical, not physical)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_send_tf_hwall(cs_syr4_coupling_t *syr_coupling,
+ cs_real_t tf[],
+ cs_real_t hwall[]);
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing of a SYRTHES coupling
+ *
+ * parameters:
+ * coupling_id --> Id of SYRTHES coupling
+ * writer_id --> Id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_post_init(int coupling_id,
+ cs_int_t writer_id);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SYR4_COUPLING_H__ */
diff --git a/include/base/cs_syr_coupling.h b/include/base/cs_syr_coupling.h
new file mode 100644
index 0000000..d0fb533
--- /dev/null
+++ b/include/base/cs_syr_coupling.h
@@ -0,0 +1,347 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_SYR_COUPLING_H__
+#define __CS_SYR_COUPLING_H__
+
+/*============================================================================
+ * SYRTHES coupling
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Structure definition
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables definition
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define new SYRTHES coupling.
+ *
+ * In the case of a single Code_Saturne and single SYRTHES instance, the
+ * syrthes_app_num and syrthes_name arguments are ignored.
+ *
+ * In case of multiple couplings, a coupling will be matched with available
+ * SYRTHES instances prioritarily based on the syrthes_name argument, then
+ * on the syrthes_app_num argument. If syrthes_name is empty, matching will
+ * be based on syrthes_app_num only.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE DEFSY1
+ * *****************
+ *
+ * INTEGER syrthes_app_num : <-- : application number of coupled
+ * : : SYRTHES instance, or -1
+ * CHARACTER* syrthes_name : <-- : name of coupled SYRTHES instance
+ * CHARACTER projection_axis : <-- : ' ' for 3D, 'x', 'y', or 'z'
+ * : : for 2D projection
+ * CHARACTER* boundary_criteria : <-- : boundary face selection criteria,
+ * : : empty if no boundary coupling
+ * CHARACTER* volume_criteria : <-- : volume cell selection criteria,
+ * : : empty if no volume coupling
+ * INTEGER verbosity : <-- : verbosity level
+ * INTEGER syrthes_n_len : <-- : length of syrthes_name
+ * INTEGER boundary_c_len : <-- : length of boundary_criteria
+ * INTEGER volume_c_len : <-- : length of volume_criteria
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(defsy1, DEFSY1)
+(
+ cs_int_t *syrthes_app_num,
+ const char *syrthes_name,
+ char *projection_axis,
+ const char *boundary_criteria,
+ const char *volume_criteria,
+ cs_int_t *verbosity,
+ cs_int_t *syrthes_n_len,
+ cs_int_t *boundary_c_len,
+ cs_int_t *volume_c_len
+ CS_ARGF_SUPP_CHAINE
+);
+
+/*----------------------------------------------------------------------------
+ * Get number of SYRTHES couplings.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE NBCSYR
+ * *****************
+ *
+ * INTEGER n_couplings : <-- : number of SYRTHES couplings
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(nbcsyr, NBCSYR)
+(
+ cs_int_t *const n_couplings
+);
+
+/*----------------------------------------------------------------------------
+ * Create nodal coupled mesh.
+ * Send vertices's coordinates and connectivity of coupled mesh.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE GEOSYR
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(geosyr, GEOSYR)
+(
+ void
+);
+
+/*----------------------------------------------------------------------------
+ * Check if SYRTHES coupling continues or if we must stop.
+ *
+ * For SYRTHES 4 couplings, if nt_cur_abs < nt_max_abs, a new iteration
+ * message is sent; otherwise, a stop message is sent. A corresponding
+ * message is received, and if it is a stop message, nt_max_abs is
+ * set to nt_cur_abs.
+ *
+ * For SYRTHES 3 couplings, A message (stop or new iteration) is
+ * received. No iteration start message is sent, as this is done
+ * by ITDSYR.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE TSTSYR (IMSFIN)
+ * *****************
+ *
+ * INTEGER NTMABS : <-> : Maximum iteration number
+ * INTEGER NTCABS : --> : Current iteration numbern
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(tstsyr, TSTSYR)
+(
+ cs_int_t *ntmabs,
+ cs_int_t *ntcabs
+);
+
+/*----------------------------------------------------------------------------
+ * Synchronize new time step message for SYRTHES 3 couplings.
+ *
+ * This function is not necessary for SYRTHES 4, as all synchronization
+ * is done by TSTSYR. For SYRTHES 3, it is necessary to distinguish
+ * the last iteration from other iterations (to allow for SYRTHES 3 to
+ * determine in advance that it will need to output postprocessing/restart
+ * data), so using this separate function allows it to be placed after
+ * MODPAR in the main time loop, in case NTMABS is changed by that function.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ITDSYR (NTCABS, NTMABS)
+ * *****************
+ *
+ * INTEGER NTMABS : --> : Maximum iteration number
+ * INTEGER NTCABS : --> : Current iteration number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(itdsyr, ITDSYR)
+(
+ cs_int_t *ntcabs,
+ cs_int_t *ntmabs
+);
+
+/*----------------------------------------------------------------------------
+ * Get number of boundary faces coupled with SYRTHES.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE NBFSYR
+ * *****************
+ *
+ * INTEGER coupl_num : --> : coupling number
+ * INTEGER n_coupl_faces : <-- : number of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(nbfsyr, NBFSYR)
+(
+ const cs_int_t *coupl_num,
+ cs_int_t *n_coupl_faces
+);
+
+/*----------------------------------------------------------------------------
+ * Get local numbering of coupled faces
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LFASYR
+ * *****************
+ *
+ * INTEGER coupl_num : --> : coupling number
+ * INTEGER coupl_face_list : <-- : list of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(lfasyr, LFASYR)
+(
+ const cs_int_t *coupl_num,
+ fvm_lnum_t *coupl_face_list
+);
+
+/*----------------------------------------------------------------------------
+ * Receive coupling variables from SYRTHES
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE VARSYI (NUMSYR, TWALL)
+ * *****************
+ *
+ * INTEGER NUMSYR : --> : Number of SYRTHES coupling
+ * DOUBLE PRECISION TWALL : <-- : Wall temerature
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (varsyi, VARSYI)
+(
+ cs_int_t *numsyr,
+ cs_real_t *twall
+);
+
+/*----------------------------------------------------------------------------
+ * Send coupling variables to SYRTHES
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE VARSYO (NUMSYR, TFLUID, HWALL)
+ * *****************
+ *
+ * INTEGER NUMSYR : --> : Number of SYRTHES coupling
+ * DOUBLE PRECISION TFLUID : --> : Fluid temperature
+ * DOUBLE PRECISION HWALL : --> : Exchange coefficient
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (varsyo, VARSYO)
+(
+ cs_int_t *numsyr,
+ cs_real_t *tfluid,
+ cs_real_t *hwall
+);
+
+/*----------------------------------------------------------------------------
+ * Initialize post processing of SYRTHES couplings.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PSTISY
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(pstisy, PSTISY)
+(
+ void
+);
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define new SYRTHES coupling.
+ *
+ * In the case of a single Code_Saturne and single SYRTHES instance, the
+ * syrthes_app_num and syrthes_name arguments are ignored.
+ *
+ * In case of multiple couplings, a coupling will be matched with available
+ * SYRTHES instances prioritarily based on the syrthes_name argument, then
+ * on the syrthes_app_num argument. If syrthes_name is empty, matching will
+ * be based on syrthes_app_num only.
+ *
+ * arguments:
+ * syrthes_app_num <-- number of SYRTHES application, or -1
+ * syrthes_name <-- name of SYRTHES instance, or NULL
+ * boundary_criteria <-- boundary face selection criteria, or NULL
+ * volume_criteria <-- volume cell selection criteria, or NULL
+ * projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
+ * independent), or ' ' for standard 3D coupling
+ * verbosity <-- verbosity level
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr_coupling_define(int syrthes_app_num,
+ const char *syrthes_name,
+ const char *boundary_criteria,
+ const char *volume_criteria,
+ char projection_axis,
+ int verbosity);
+
+/*----------------------------------------------------------------------------
+ * Initialize SYRTHES couplings.
+ *
+ * This function may be called once all couplings have been defined,
+ * and it will match defined couplings with available applications.
+ *
+ * parameters:
+ * port_num <-- port number for rank 0 to enable sockets,
+ * < 0 to disable sockets
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr_coupling_all_init(int port_num);
+
+/*----------------------------------------------------------------------------
+ * Finalize all SYRTHES couplings.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr_coupling_all_finalize(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_SYR_COUPLING_H__ */
diff --git a/include/base/cs_tpar1d.h b/include/base/cs_tpar1d.h
new file mode 100644
index 0000000..87b41ca
--- /dev/null
+++ b/include/base/cs_tpar1d.h
@@ -0,0 +1,204 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_TPAR1D_H__
+#define __CS_TPAR1D_H__
+
+/*============================================================================
+ * Modelling the thermal wall with 1D approach
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create the 1D mesh for each face and initialize the temperature
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE MAIT1D
+ * ******************
+ *
+ * INTEGER NFPT1D : <- : number of coupled faces
+ * INTEGER NPPT1D(NFPT1D) : <- : number of mesh points for each face
+ * DOUBLE PRECISION EPPT1D(NFPT1D) : <- : wall thickness for each face
+ * DOUBLE PRECISION RGPT1D(NFPT1D) : <- : mesh geometric ratio for each face
+ * DOUBLE PRECISION TPPT1D(NFPT1D) : <- : temperature initizalition value
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (mait1d,MAIT1D)
+(
+ cs_int_t *nf,
+ cs_int_t n[],
+ cs_real_t e[],
+ cs_real_t r[],
+ cs_real_t tp[]
+);
+
+/*----------------------------------------------------------------------------
+ * Solve the 1D equation for a given face
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TPAR1D
+ * ******************
+ *
+ * INTEGER II : <- : face number
+ * INTEGER ICLT1D : <- : type of exterior boundary condition
+ * DOUBLE PRECISION TBORD : <- : fluid temperature at the boundary
+ * DOUBLE PRECISION HBORD : <- : exchange coefficient for the fluid
+ * : : at the boundary
+ * DOUBLE PRECISION TET1D : <- : temperature on the exterior boundary
+ * : : (Dirichlet boundary condition)
+ * DOUBLE PRECISION HET1D : <- : exchange coefficient on the exterior wall
+ * DOUBLE PRECISION FET1D : <- : flux on the exterior wall
+ * : : (Neumann boundary condition)
+ * DOUBLE PRECISION LAMT1D : <- : conductivity (lambda)
+ * DOUBLE PRECISION RCPT1D : <- : rho*Cp product
+ * DOUBLE PRECISION DTPT1D : <-> : time-step for the solid resolution
+ * DOUBLE PRECISION TPPT1D : <-> : physical temperature at the fluid/solid
+ * : : interface
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tpar1d,TPAR1D)
+(
+ cs_int_t *ii,
+ cs_int_t *icdcle,
+ cs_real_t *tf,
+ cs_real_t *hf,
+ cs_real_t *te,
+ cs_real_t *he,
+ cs_real_t *fe,
+ cs_real_t *lb,
+ cs_real_t *rocp,
+ cs_real_t *dtf,
+ cs_real_t *tp
+);
+
+/*----------------------------------------------------------------------------
+ * Read the restart file of the 1D-wall thermal module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECT1D
+ * *****************
+ *
+ * CHARACTER NOMSUI : <-- : Name of the restart file
+ * INTEGER LNGNOM : <-- : Name length
+ * INTEGER NFPT1D : <-- : Number of coupled faces
+ * INTEGER NFPT1T : <-- : Total number of coupled faces
+ * INTEGER NMXT1D : <-- : Max number of points on the 1D meshes
+ * INTEGER NFABOR : <-- : Number of boundary faces
+ * INTEGER NPPT1D : <-- : Number of points of each face 1D-mesh
+ * INTEGER IFPT1D : <-- : Indirection array for 1D-module faces
+ * DOUBLE PRECISION EPPT1D : <-- : Wall thickness of each face
+ * DOUBLE PRECISION RGPT1D : <-- : Geometric reason associated to faces
+ * DOUBLE PRECISION TPPT1D : --> : Wall temperature
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lect1d, LECT1D)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom,
+ const cs_int_t *const nfpt1d,
+ const cs_int_t *const nfpt1t,
+ const cs_int_t *const nmxt1d,
+ const cs_int_t *const nfabor,
+ const cs_int_t *const nppt1d,
+ const cs_int_t *const ifpt1d,
+ const cs_real_t *const eppt1d,
+ const cs_real_t *const rgpt1d,
+ cs_real_t *const tppt1d
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*----------------------------------------------------------------------------
+ * Write the restart file of the 1D-wall thermal module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECT1D
+ * *****************
+ *
+ * CHARACTER NOMSUI : <-- : Name of the restart file
+ * INTEGER LNGNOM : <-- : Name length
+ * INTEGER NFPT1D : <-- : Number of coupled faces
+ * INTEGER NMXT1D : <-- : Max number of points on the 1D meshes
+ * INTEGER NFABOR : <-- : Number of boundary faces
+ * DOUBLE PRECISION TPPT1D : --> : Wall temperature
+ * INTEGER IFPT1D : <-- : Indirection array for 1D-module faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ecrt1d, ECRT1D)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom,
+ const cs_int_t *const nfpt1d,
+ const cs_int_t *const nmxt1d,
+ const cs_int_t *const nfabor,
+ const cs_real_t *const tppt1d,
+ const cs_int_t *const ifpt1d
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+);
+
+/*----------------------------------------------------------------------------
+ * Free allocated memory
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lbrt1d, LBRT1D)(void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_TPAR1D_H__ */
+
diff --git a/include/base/cs_ventil.h b/include/base/cs_ventil.h
new file mode 100644
index 0000000..6b7b827
--- /dev/null
+++ b/include/base/cs_ventil.h
@@ -0,0 +1,293 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_VENTIL_H__
+#define __CS_VENTIL_H__
+
+/*============================================================================
+ * Management of fans
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Structure definition
+ *============================================================================*/
+
+typedef struct _cs_ventil_t cs_ventil_t;
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get the number of fans.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TSTVTL
+ * *****************
+ *
+ * INTEGER NBRVTL : --> : number of fans
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tstvtl, TSTVTL)
+(
+ cs_int_t *const nbrvtl
+);
+
+/*----------------------------------------------------------------------------
+ * Adds a fan.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DEFVTL
+ * *****************
+ *
+ * INTEGER DIMMOD : <-- : Fan model dimension:
+ * : : 1: constant_f; 2: force_profile;
+ * : : 3: force_profile + tangential couple
+ * INTEGER DIMVTL : <-- : Fan dimension:
+ * : : 2: pseudo-2D (extruded mesh)
+ * : : 3: 3D (standard)
+ * DOUBLE PRECISION XYZVT1(3) : <-- : Coo. of the axis point in upstream face
+ * DOUBLE PRECISION XYZVT2(3) : <-- : Coo. of the axis point in downstream face
+ * DOUBLE PRECISION RVVT : <-- : Fan radius
+ * DOUBLE PRECISION RPVT : <-- : Blades radius
+ * DOUBLE PRECISION RMVT : <-- : Hub radius
+ * DOUBLE PRECISION CCARAC(3) : <-- : Coefficients of degre 0, 1 and 2
+ * : : of the characteristic curve
+ * DOUBLE PRECISION TAUVT : <-- : Fan axial couple
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (defvtl, DEFVTL)
+(
+ const cs_int_t *const dimmod,
+ const cs_int_t *const dimvtl,
+ const cs_real_t xyzvt1[3],
+ const cs_real_t xyzvt2[3],
+ const cs_real_t *const rvvt,
+ const cs_real_t *const rpvt,
+ const cs_real_t *const rmvt,
+ const cs_real_t ccarac[3],
+ const cs_real_t *const tauvt
+);
+
+/*----------------------------------------------------------------------------
+ * Build the list of cells associated to the fans
+ *
+ * Fotrtran interface:
+ *
+ * SUBROUTINE INIVTL
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (inivtl, INIVTL)
+(
+ void
+);
+
+/*----------------------------------------------------------------------------
+ * Mark the fans and associate the fan number to the cells belonging to
+ * thus fan, 0 otherwise.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NUMVTL (INDIC)
+ * *****************
+ *
+ * INTEGER INDIC(NCELET) : --> : Fan number (0 if outside the fan)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (numvtl, NUMVTL)
+(
+ cs_int_t indic[]
+);
+
+/*----------------------------------------------------------------------------
+ * Calculate the flows through the fans
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DEBVTL
+ * *****************
+ *
+ * DOUBLE PRECISION FLUMAS(*) : <-- : Interior faces mass flux
+ * DOUBLE PRECISION FLUMAB(*) : <-- : Boundary faces mass flux
+ * DOUBLE PRECISION RHOFAC(*) : <-- : Density at cells
+ * DOUBLE PRECISION RHOFAB(*) : <-- : Density at boundary faces
+ * DOUBLE PRECISION DEBENT(NBRVTL) : --> : Inlet flow through the fan
+ * DOUBLE PRECISION DEBSOR(NBRVTL) : --> : Outlet flow through the fan
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (debvtl, DEBVTL)
+(
+ cs_real_t flumas[],
+ cs_real_t flumab[],
+ cs_real_t rhofac[],
+ cs_real_t rhofab[],
+ cs_real_t debent[],
+ cs_real_t debsor[]
+);
+
+/*----------------------------------------------------------------------------
+ * Calculate the force induced by the fans (needs a previous calculation
+ * of the flows through each fan).
+ *
+ * The induced force is added to the array CRVXEP (which can have other
+ * other contributions).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TSVVTL (DEBENT, DEBSOR)
+ * *****************
+ *
+ * INTEGER IDIMTS : <-- : Dimension associated to the source
+ * : : term of velocity (1: X; 2: Y; 3: Z)
+ * DOUBLE PRECISION CRVEXP(NCELET) : <-> : Explicit source term (velocity)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tsvvtl, TSVVTL)
+(
+ cs_int_t *idimts,
+ cs_real_t crvexp[]
+);
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Fan definition (added to the ones previously defined)
+ *
+ * parameters:
+ * dim_modele <-- Fan model dimension:
+ * 1: constant_f
+ * 2: force_profile
+ * 3: force_profile + tangential couple
+ * dim_ventil <-- Fan dimension:
+ * 2: pseudo-2D (extruded mesh)
+ * 3: 3D (standard)
+ * coo_axe_amont <-- Coo. of the axis point in upstream face
+ * coo_axe_aval <-- Coo. of the axis point in downstream face
+ * ray_ventil <-- Fan radius
+ * ray_pales <-- Blades radius
+ * ray_moyeu <-- Hub radius
+ * coeff_carac <-- Coefficients of degre 0, 1 and 2 of
+ the characteristic curve
+ * couple_axial <-- Fan axial couple
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_definit(const cs_int_t dim_modele,
+ const cs_int_t dim_ventil,
+ const cs_real_t coo_axe_amont[3],
+ const cs_real_t coo_axe_aval[3],
+ const cs_real_t ray_ventil,
+ const cs_real_t ray_pales,
+ const cs_real_t ray_moyeu,
+ const cs_real_t coeff_carac[3],
+ const cs_real_t couple_axial);
+
+/*----------------------------------------------------------------------------
+ * Destroy the structures associated to fans
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_detruit_tous(void);
+
+/*----------------------------------------------------------------------------
+ * Looks for the cells belonging to the different fans.
+ *
+ * parameters:
+ * mesh <-- associated mesh structure
+ * mesh_quantities <-- mesh quantities
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_cree_listes(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------
+ * Calculate the flows through the fans
+ *
+ * parameters:
+ * mesh <-- mesh structure
+ * mesh_qantities <-- mesh quantities
+ * flux_masse_fac <-- interior faces mass flux
+ * flux_masse_fbr <-- boundary faces mass flux
+ * densite_cel <-- density at cells
+ * densite_fbr <-- density at boundary faces
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_calcul_debits(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities,
+ const cs_real_t flux_masse_fac[],
+ const cs_real_t flux_masse_fbr[],
+ const cs_real_t densite_cel[],
+ const cs_real_t densite_fbr[]);
+
+/*----------------------------------------------------------------------------
+ * Calculate the force induced by the fans (needs a previous calculation
+ * of the flows through each fan).
+ *
+ * The induced force is added to the array CRVXEP (which can have other
+ * other contributions).
+ *
+ * parameters:
+ * mesh_quantities <-- mesh quantities
+ * idim_source <-- Dimension associated to the source term of velocity
+ * (1: X; 2: Y; 3: Z)
+ * t_source <-> Explicit source term for the velocity
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_calcul_force(const cs_mesh_quantities_t *mesh_quantities,
+ const cs_int_t idim_source,
+ cs_real_t t_source[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_VENTIL_H__ */
diff --git a/include/base/cstnum.h b/include/base/cstnum.h
new file mode 100644
index 0000000..35841fc
--- /dev/null
+++ b/include/base/cstnum.h
@@ -0,0 +1,35 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! cstnum.h
+!===============================================================================
+
+double precision epzero ,rinfin ,grand , &
+ zero ,pi
+parameter (epzero=1.d-12,rinfin=1.d+30,grand=1.d+12, &
+ zero =0.d0 ,pi=3.141592653589793d0)
+
diff --git a/include/base/cstphy.h b/include/base/cstphy.h
new file mode 100644
index 0000000..dcfe258
--- /dev/null
+++ b/include/base/cstphy.h
@@ -0,0 +1,200 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! cstphy.h
+!===============================================================================
+
+! KELVIN
+
+! TKELVI --> = 273,15
+! TKELVN --> = -273,15
+
+double precision tkelvi , tkelvn
+parameter ( tkelvi = 273.15d0, tkelvn = -273.15d0)
+
+! CALORIES
+
+! 1 cal = XCAL2J J
+
+double precision xcal2j
+parameter ( xcal2j = 4.1855d0)
+
+! STEPHAN BOLTZMANN
+
+double precision stephn
+parameter ( stephn = 5.6703d-8)
+
+! GRAVITE
+
+double precision gx,gy,gz
+common / rgravi / gx,gy,gz
+
+! Vecteur rotation
+
+integer icorio
+common / irotat / icorio
+
+double precision omegax, omegay, omegaz
+common / rrotat / omegax, omegay, omegaz
+
+! CONSTANTES PHYSIQUES DU FLUIDE
+! IXYZP0 : INDICATEUR DE REMPLISSAGE DE XYZP0
+! RO0 : MASSE VOLUMIQUE DE REFERENCE
+! VISCL0 : VISCOSITE DE REFERENCE
+! P0 : PRESSION TOTALE DE REFERENCE
+! PRED0 : PRESSION REDUITE DE REFERENCE
+! XYZP0 : POSITION PRESSION DE REFERENCE
+! T0 : TEMPERATURE DE REFERENCE
+! CP0 : CHALEUR SPECIFIQUE DE REFERENCE
+
+integer ixyzp0(nphsmx)
+common / icstfl / ixyzp0
+double precision ro0(nphsmx) , viscl0(nphsmx), &
+ p0 (nphsmx) , pred0 (nphsmx), &
+ xyzp0(3,nphsmx), t0 (nphsmx), &
+ cp0(nphsmx)
+common / rcstfl / ro0 , viscl0 , &
+ p0 , pred0 , &
+ xyzp0 , t0 , &
+ cp0
+
+! TURBULENCE
+! IVISLS = 0 : VISCOSITE LAMINAIRE CONSTANTE = VISLS0
+! XKAPPA : CST DE KARMAN (~0.42)
+! CSTLOG : CST DE LA LOI LOG: 1/XKAPPA*LOG(YPLUS) + CSTLOG (~5.2)
+! YPLULI : YPLUS LIMITE 1./XKAPPA OU 10.88 SI IDEUCH=2
+! *POW : COEFF WERNER AND WENGLE
+! CMU025 = CMU**0.25
+! CE1, CE2, SIGMAK, SIGMAE :
+! CONSTANTES DU K-EPSILON
+! C*RIJ* : CONSTANTES DU Rij-EPSILON STANDARD (LRR)
+! CSSG* : CONSTANTES SPECIFIQUES DU RIJ-EPSILON SSG
+! CV2F* : CONSTANTES SPECIFIQUES DU V2F PHI-MODEL
+! CKW* : CONSTANTES SPECIFIQUES DU K-OMEGA SST
+! (SK=SIGMA_K, SW=SIGMA_W, BT=BETA, GM=GAMMA)
+! ALMAX : ECHELLE DE LONGUEUR TURBULENTE
+! UREF : VITESSE DE REFERENCE
+! XLOMLG : LONGUEUR POUR LONGUEUR DE MELANGE
+! XLESFL, ALES, BLES
+! DELTA = XLESFL * (ALES*VOLUME)^BLES (largeur du filtre utilise
+! en fonction du volume de la cellule)
+! CSMAGO
+! La constante de Smagorinsky theorique vaut 0.18
+! pour un canal plan, on prendra cependant plutot 0.065
+! XLESFD
+! Dans le cas d un modele dynamique, XLESFD est le rapport entre la
+! largeur du filtre explicite et celle du filtre implicite
+! SMAGMX
+! Constante de Smagorinsky maximale souhaitee (on peut prendre 10*CSMAGO)
+! IDRIES
+! Amortissement Van Driest active (=1) ou non (=0)
+! CDRIES
+! Constante de Van Driest dans (1-exp(-y+/CDRIES))
+! CE4 : Coefficient du terme interfacial dans k-eps
+! (Ce coefficient sert en Lagrangien)
+! VOLMIN : VOLUME DE CONTROLE MINIMAL
+! VOLMAX : VOLUME DE CONTROLE MAXIMAL
+! VOLTOT : VOLUME TOTAL DU DOMAINE
+
+double precision xkappa , cstlog , ypluli(nphsmx) , &
+ apow , bpow , cpow , dpow , &
+ cmu , cmu025 , ce1 , ce2 , ce4 , &
+ sigmak , sigmae , &
+ crij1 , crij2 , crij3 , crijep , csrij , &
+ crijp1 , crijp2 , &
+ cssge2 , cssgs1 , cssgs2 , &
+ cssgr1 , cssgr2 , cssgr3 , cssgr4 , cssgr5 , &
+ cv2fa1 , cv2fe2 , cv2fmu , cv2fc1 , cv2fc2 , &
+ cv2fct , cv2fcl , cv2fet , &
+ ckwsk1 , ckwsk2 , ckwsw1 , ckwsw2 , ckwbt1 , &
+ ckwbt2 , ckwgm1 , ckwgm2 , ckwa1 , ckwc1 , &
+ volmin , volmax , voltot , &
+ almax (nphsmx) , uref (nphsmx), &
+ xlomlg(nphsmx) , &
+ xlesfl(nphsmx) , ales (nphsmx), bles(nphsmx), &
+ csmago(nphsmx) , cdries(nphsmx), &
+ xlesfd(nphsmx) , smagmx(nphsmx), &
+ cwale(nphsmx)
+common / rturbu / xkappa , cstlog , ypluli , &
+ apow , bpow , cpow , dpow , &
+ cmu , cmu025 , ce1 , ce2 , ce4 , &
+ sigmak , sigmae , &
+ crij1 , crij2 , crij3 , crijep , csrij , &
+ crijp1 , crijp2 , &
+ cssge2 , cssgs1 , cssgs2 , &
+ cssgr1 , cssgr2 , cssgr3 , cssgr4 , cssgr5 , &
+ cv2fa1 , cv2fe2 , cv2fmu , cv2fc1 , cv2fc2 , &
+ cv2fct , cv2fcl , cv2fet , &
+ ckwsk1 , ckwsk2 , ckwsw1 , ckwsw2 , ckwbt1 , &
+ ckwbt2 , ckwgm1 , ckwgm2 , ckwa1 , ckwc1 , &
+ volmin , volmax , voltot , &
+ almax , uref , &
+ xlomlg , &
+ xlesfl , ales , bles , &
+ csmago , cdries , &
+ xlesfd , smagmx
+
+! CONSTANTES POUR LES SCALAIRES
+
+! ISCSTH :
+! -1 : DE TYPE TEMPERATURE EN C ( CP POUR LA LOI DE PAROI)
+! 0 : SCALAIRE PASSIF (IE PAS DE CP POUR LA LOI DE PAROI)
+! 1 : DE TYPE TEMPERATURE EN K ( CP POUR LA LOI DE PAROI)
+! 2 : ENTHALPIE (IE PAS DE CP POUR LA LOI DE PAROI)
+! LA DISTINCTION C/K SERT EN RAYONNEMENT
+! IVISLS : SI POSITIF STRICTEMENT, INDIQUE QUE LA VISCOSITE ASSOCIEE
+! AU SCALAIRE EST VARIABLE, ET LA VALEUR EST LE NUMERO
+! D'ORDRE DE LA VISCOSITE DANS LE TABLEAU DES VISCOSITES
+! VARIABLES
+! IVISSA : COMME IVISLS SAUF QUE SERT AU STOCKAGE DE LA VISCOSITE AU
+! PAS DE TEMPS PRECEDENT
+! ICLVFL : 0 : CLIPPING DES VARIANCES A ZERO
+! 1 : CLIPPING DES VARIANCES A ZERO ET A f(1-f)
+! 2 : CLIPPING DES VARIANCES A MAX(ZERO,SCAMIN) ET SCAMAX
+! ISCAVR : NUMERO DU SCALAIRE ASSOCIE A LA VARIANCE OU ZERO
+! SI LE SCALAIRE N'EST PAS UNE VARIANCE
+! IPHSCA : NUMERO DE LA PHASE PORTEUSE
+! SCAMIN, SCAMAX : MIN ET MAX POUR CLIPPING DES SCALAIRES
+! ON NE CLIPPE QUE SI SCAMIN < SCAMAX
+! VISLS0 : VISCOSITE DES SCALAIRES SI CONSTANTE
+! SIGMAS : PRANDTL DES SCALAIRES
+! RVARFL : COEFF DE DISSIPATION DES VARIANCES
+
+integer iscsth(nscamx),ivisls(nscamx),ivissa(nscamx), &
+ iclvfl(nscamx), &
+ iscavr(nscamx),iphsca(nscamx)
+double precision scamin(nscamx),scamax(nscamx), &
+ visls0(nscamx),sigmas(nscamx), &
+ rvarfl(nscamx)
+common / iscala / iscsth ,ivisls ,ivissa , &
+ iclvfl , &
+ iscavr ,iphsca
+common / rscala / scamin ,scamax , &
+ visls0 ,sigmas , &
+ rvarfl
+
+! FIN
diff --git a/include/base/dimens.h b/include/base/dimens.h
new file mode 100644
index 0000000..9a7e99a
--- /dev/null
+++ b/include/base/dimens.h
@@ -0,0 +1,50 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! dimens.h
+!===============================================================================
+
+!... DONNEES DU MAILLAGE
+
+integer ncelet,ncel,nfac,nfabor,ncelbr, &
+ nprfml,nfml,nnod,lndfac,lndfbr
+common / igeome / ncelet,ncel,nfac,nfabor,ncelbr, &
+ nprfml,nfml,nnod,lndfac,lndfbr
+
+integer ndim
+common / indim3 / ndim
+
+integer nvar, nscal, nvisls, nphas
+common / ivaria / nvar, nscal, nvisls, nphas
+
+integer ncofab
+common / ipclim / ncofab
+
+integer nproce, nprofa, nprofb, nfluma
+common / iprpph / nproce, nprofa, nprofb, nfluma
+
+! FIN
diff --git a/include/base/dimfbr.h b/include/base/dimfbr.h
new file mode 100644
index 0000000..1250e4f
--- /dev/null
+++ b/include/base/dimfbr.h
@@ -0,0 +1,36 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! dimfbr.h
+!===============================================================================
+
+!... DIMENSION FACTICE DES TABLEAUX PROPFB, COEFA ET COEFB
+! QUAND NFABOR = 0 (pour eviter des problemes sous certaines
+! architectures liees a des passages de tableaux de dimension vide)
+
+integer ndimfb
+common / idimfb / ndimfb
diff --git a/include/base/entsor.h b/include/base/entsor.h
new file mode 100644
index 0000000..46c6a17
--- /dev/null
+++ b/include/base/entsor.h
@@ -0,0 +1,341 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! entsor.h
+!===============================================================================
+
+! --- SORTIE STD
+! NFECRA : UNITE SORTIE STD
+! IWARNI : NIVEAU D'IMPRESSION
+
+integer nfecra,iwarni(nvarmx)
+common / icontr / nfecra,iwarni
+
+! --- FICHIER GEOMETRIE
+
+character*6 ficgeo
+common / ageotl / ficgeo
+
+integer impgeo
+common / igeotl / impgeo
+
+! --- FICHIER SUITE AMONT
+! -------------------
+! FICAMO --> fichier suite de base
+! FICAMX --> fichier suite auxiliaire
+! FICMT1 --> fichier suite module thermique 1D
+! FICMCT --> fichier suite module aerorefrigerants
+! FICMVO,IMPMVO --> fichier suite methode des vortex (ASCII
+! obligatoirement, structure specifique)
+! IMPDVO --> fichier de donnees de la methode des vortex
+! (nom FICDAT laisse a l'utilisateur dans usvort)
+
+character*13 ficamo,ficamx,ficmt1,ficmct,ficmvo
+common / afamon / ficamo,ficamx,ficmt1,ficmct,ficmvo
+
+integer impmvo, impdvo
+common / ifamon / impmvo, impdvo
+
+! --- FICHIERS SUITE AVAL
+! -------------------
+! FICAVA --> fichier suite de base
+! FICAVX --> fichier suite auxiliaire
+! FICVT1 --> fichier suite module thermique 1D
+! FICVCT --> fichier suite module aerorefrigerants
+! FICVVO,IMPVVO --> fichier suite methode des vortex (ASCII
+! obligatoirement, structure specifique)
+
+
+character*13 ficava,ficavx,ficvt1,ficvct,ficvvo
+common / afaval / ficava,ficavx,ficvt1,ficvct,ficvvo
+
+integer ntsuit, impvvo
+common / ifaval / ntsuit, impvvo
+
+! --- FICHIER SUITE AMONT RAYONNEMENT
+
+character*13 ficamr
+common / afamrd / ficamr
+
+! --- FICHIER SUITE AVAL RAYONNEMENT
+
+character*13 ficavr
+common / afavrd / ficavr
+
+integer ntsuir
+common / ifavrd / ntsuir
+
+
+! --- FICHIER NSTOP
+
+character*6 ficstp
+common / afarre / ficstp
+
+integer impstp
+common / ifarre / impstp
+
+! --- LECTURE PREPROCESSEUR
+
+integer ifoenv
+common / ifenvp / ifoenv
+
+! --- SORTIES POST TRAITEMENT (via FVM)
+
+! ICHRVL : Post traitement du domaine fluide
+! ICHRBO : Post traitement du bord du domaine
+! ICHRSY : Post traitement des zones de bord couplees avec SYRTHES
+! ICHRZE : Post traitement des zones d'echange aerorefrigerants
+! ICHRMD : Indique si les maillages ecrits seront :
+! 0 : fixes,
+! 1 : deformables a topologie constante,
+! 2 : modifiables (pourront etre completement redefinis
+! en cours de calcul via le sous-programme USMPST),
+! 10 : comme INDMOD = 0, avec champ de deplacement,
+! 11 : comme INDMOD = 1, avec champ de deplacement,
+! 12 : comme INDMOD = 2, avec champ de deplacement.
+! NTCHR : frequence de sortie par defaut ( > 0 ou -1 (a la fin) )
+! ICHRVR : on sort la variable (1) ou non (0) ou non initialise
+! FMTCHR : format de sortie ('EnSight Gold', 'MED_fichier', 'CGNS')
+! OPTCHR : options associees au format de sortie
+
+integer ichrvl, ichrbo, ichrsy, ichrze, &
+ ichrmd, ntchr , ichrvr(nvppmx)
+common / iepost / ichrvl, ichrbo, ichrsy, ichrze, &
+ ichrmd, ntchr, ichrvr
+
+character*32 fmtchr
+character*96 optchr
+common / aepost / fmtchr, optchr
+
+! --- FICHIER THERMOPHYSIQUE SPECIFIQUE PHYSIQUE PARTICULIERE
+
+! IMP --> Unite logique du fichier
+! FPP --> Fichier utilisateur lorsqu'on utilise Janaf
+! JNF --> Janaf
+! JON --> Utilisation de Janaf ou non
+
+character*6 ficfpp
+character*5 ficjnf
+common / afcppp / ficfpp, ficjnf
+
+integer impfpp, impjnf, indjon
+common / ifcppp / impfpp, impjnf, indjon
+
+! --- INPUT FILES FOR THE ATMOSPHERIC SPECIFIC PHYSICS
+! IMPMET --> logical unit of the meteo profile file
+! FICMET --> name of the meteo profile file
+
+ integer impmet
+ common / ifcmet / impmet
+
+ character*10 ficmet
+ common / afcmet / ficmet
+
+! --- FICHIERS HISTORIQUES
+
+! IMPHIS : fichier stock + unite d'ecriture des variables
+! EMPHIS : EMPlacement
+! PREHIS : PREfixe des fichiers
+! EXTHIS : EXTension des fichiers
+! IMPUSH : Unite fichiers specifiques ushist
+! FICUSH : Nom fichiers specifiques ushist
+! IMPSTH : fichier stock + unite d'ecriture des variables
+! des structures mobiles
+
+character*80 emphis, prehis, exthis
+common / avhist / emphis, prehis, exthis
+
+character*13 ficush(nushmx)
+common / afhist / ficush
+
+integer imphis(2), impush(nushmx), impsth(2)
+common / ifhist / imphis, impush, impsth
+
+! NCAPT : nombre de sondes total (limite a NCAPTM)
+! NTHIST : Frequence de sortie
+! ( > 0 ou -1 (jamais) ou non initialise -999)
+! NTHSAV : Frequence de sauvegarde
+! ( > 0 ou -1 (a la fin) ou non initialise -999)
+! IHISVR : nb de sonde et numero par variable
+! (-999 non initialise)
+! IHISTR : indicateur d'ecriture des historiques des structures
+! mobiles internes (=0 ou 1)
+! NCAPT : nombre de sondes total (limite a NCAPTM)
+! NODCAP : element correspondant aux sondes
+! NDRCAP : rang processus contenant NODCAP (parallelisme)
+! XYZCAP : position demandee des sondes
+
+integer ncapt, nthist, nthsav, &
+ ihisvr(nvppmx,ncaptm+1), ihistr, &
+ nodcap(ncaptm), ndrcap(ncaptm)
+
+common / ivhist / ncapt , nthist, nthsav, &
+ ihisvr, ihistr, &
+ nodcap, ndrcap
+
+double precision xyzcap(3,ncaptm)
+common / rvhist / xyzcap
+
+
+! --- FICHIERS LAGRANGIENS
+
+! - FICHIER SUITE ET SUITE STATISTISQUE AMONT LAGRANGIEN
+
+character*13 ficaml, ficmls
+common / afamla / ficaml, ficmls
+
+! - FICHIER SUITE ET SUITE STATISTISQUE AVAL LAGRANGIEN
+
+character*13 ficavl, ficvls
+common / afavla / ficavl, ficvls
+
+
+! - FICHIER LISTING LAGRANGIEN
+
+! FICLAL : Nom du fichier
+! IMPLAL : Unite du fichier
+! NTLAL : Periode de sortie du listing
+character*6 ficlal
+common / afalal / ficlal
+
+integer implal, ntlal
+common / ifalal / implal, ntlal
+
+! - FICHIER HISTORIQUE LAGRANGIEN
+
+integer impli1, impli2
+common / ifalah / impli1, impli2
+
+! - AUTRES FICHIERS LAGRANGIEN
+
+integer impla1 , impla2 , impla3 , impla4 , impla5(15)
+common / ifalag / impla1 , impla2 , impla3 , impla4 , impla5
+
+
+! --- FICHIERS UTILISATEURS
+
+character*13 ficusr(nusrmx)
+common / afuser / ficusr
+
+integer impusr(nusrmx)
+common / ifuser / impusr
+
+
+! --- SORTIES LISTING
+
+! COMMUNES
+! IPP* : Pointeurs de reperage des variables pour les sorties
+! NOMVAR : Nom des variables
+! ILISVR : on suit la variable (1) ou non (0) ou non initialise
+! ITRSVR : numero de variable si IPP correspond a une variable resolue (p,u,k...)
+! 0 si IPP correspond a une variable annexe (cp, mut...)ou a rien
+! NTLIST : periode ecriture
+! ( -1 : dernier pas de temps : > 0 : periode)
+
+integer ipprtp(nvarmx), &
+ ipppro(npromx), &
+ ippdt , &
+ ipptx , ippty , ipptz , &
+ ipp2ra(nvppmx)
+common / ipntpp / ipprtp , &
+ ipppro , &
+ ippdt , &
+ ipptx , ippty , ipptz , &
+ ipp2ra
+
+character*80 nomvar(nvppmx)
+common / anampp / nomvar
+
+integer ilisvr(nvppmx),itrsvr(nvppmx)
+common / ipostp / ilisvr ,itrsvr
+
+
+integer ntlist
+common / ilisti / ntlist
+
+! PARAMETRES DE SUIVI DE CALCUL, MIN-MAX, CLIPMIN, CLIPMAX
+
+integer iclpmn(nvppmx) , iclpmx(nvppmx)
+common / isuivi / iclpmn , iclpmx
+
+double precision varmin(nvppmx) , varmax(nvppmx), &
+ varmna(nvppmx) , varmxa(nvppmx)
+common / rsuivi / varmin , varmax, &
+ varmna , varmxa
+
+
+! PARAMETRES DE CONVERGENCE, NORME DU SECOND MEMBRE, NOMBRE ITERATIONS
+! RESIDU NORME, DERIVE
+
+integer nbivar(nvppmx)
+common / iconvg / nbivar
+
+double precision rnsmbr(nvppmx) , &
+ resvar(nvppmx) , dervar(nvppmx)
+common / rconvg / rnsmbr , &
+ resvar , dervar
+
+
+! PARAMETRES DU PAS DE TEMPS LOCAL =
+! NB COURANT, FOURIER ET COMBINE MIN ET MAX + POINTS ASSOCIES
+! PTPLOC(.,1) = NOMBRE , PTPLOC(.,2 3 et 4) = POINT ASSOCIE
+! PTPLOC(1 2,.) = COURANT MIN/MAX
+! PTPLOC(3 4,.) = FOURIER MIN/MAX
+! PTPLOC(5 6,.) = COU/FOU MIN/MAX
+! PTPLOC(7 8,.) = DT MIN/MAX
+! NCLPTR = NB DE CLIPPINGS PAR LE PDT MAX LIE AUX EFFETS DE DENSITE
+! RPDTRO = RAPPORT MAX ENTRE DT ET DTmax LIE AUX EFFETS DE DENSITE
+! +LOCALISATION
+
+integer nclptr
+common / iptloc / nclptr
+
+double precision ptploc(8,4), rpdtro(4)
+common / rptloc / ptploc, rpdtro
+
+
+! PARAMETRES DES SORTIES AU BORD =
+
+! IPSTDV = PROPRIETES POST TRAITEES
+! IPSTDV EST LE PRODUIT DES VALEURS ENTIERES SUIVANTES (NOMBRES PREMIERS) :
+! IPSTYP => YPLUS
+! IPSTCL => VARIABLES NON RECONSTRUITES (suffisant pour Dirichlet)
+! IPSTFT => FLUX THERMIQUE RECONSTRUIT
+
+! SI IPSTDV = 1 = PAS DE SORTIE
+
+
+integer ipstdv
+common / iipstd / ipstdv
+
+
+! --- TEMPS CPU
+
+double precision tmarus
+common / temcpu / tmarus
+
+! FIN
diff --git a/include/base/ihmpre.h b/include/base/ihmpre.h
new file mode 100644
index 0000000..601b241
--- /dev/null
+++ b/include/base/ihmpre.h
@@ -0,0 +1,39 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! imhpre.h
+!===============================================================================
+
+! IIHMPR : INDIQUE S'IL Y A UN FICHIER DE DONNEES INTERFACE CONSULTE
+
+! On pourrait se passer de ce common en interrogeant une structure C
+
+integer iihmpr
+
+common / iiihmp / iihmpr
+
+! FIN
diff --git a/include/base/mltgrd.h b/include/base/mltgrd.h
new file mode 100644
index 0000000..640e669
--- /dev/null
+++ b/include/base/mltgrd.h
@@ -0,0 +1,46 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! mltgrd.h
+!===============================================================================
+
+! MULTIGRILLE
+! -----------
+! NCEGRM : NOMBRE MAX DE CELLULES SUR MAILLAGE LE PLUS GROSSIER
+! NGRMAX : NOMBRE MAX DE NIVEAUX DE MAILLAGES
+! NAGMX0 : PARAMETRE CONSTRUCTION DE MAILLAGE AUTOMATIQUE
+! IAGMX0 : PARAMETRE CONSTRUCTION DE MAILLAGE AUTOMATIQUE
+! NCPMGR : Si > 0, active le post traitement de l'agglomeration, en
+! projetant les numeros de cellules grossieres sur le
+! maillage fin (modulo NCPMGR(IVAR))
+
+integer ncegrm, ngrmax, &
+ nagmx0(nvarmx), iagmx0(nvarmx), ncpmgr(nvarmx)
+common / imultg / ncegrm, ngrmax, &
+ nagmx0, iagmx0, ncpmgr
+
+! FIN
diff --git a/include/base/numvar.h b/include/base/numvar.h
new file mode 100644
index 0000000..6284c06
--- /dev/null
+++ b/include/base/numvar.h
@@ -0,0 +1,129 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! numvar.h
+!===============================================================================
+
+! POSITION DES VARIABLES
+! ( Dans RTP, RTPA )
+
+! IPR Pression
+! IU IV IW Vitesse(x,y,z)
+! IK Energie Turbulente en k-epsilon
+! IR11, IR22, IR33, ...
+! ... IR12, IR13, IR23 Tensions de Reynolds en Rij
+! IEP Dissipation turbulente
+! IPHI, IFB Variables phi et f_barre du v2f phi-model
+! IOMG Variable Omega du k-omega SST
+! ISCA(i) Scalaire numero i
+! ISCAPP(i) No du scalaire physique particuliere i
+! NSCAUS Nbre de scalaires utilisateur
+! NSCAPP Nbre de scalaires physique particuliere
+! IUMA, IVMA, IWMA Vitesse de maillage en ALE
+
+
+integer ipr(nphsmx) , &
+ iu(nphsmx) , iv(nphsmx) , iw(nphsmx) , &
+ ik(nphsmx) , iep(nphsmx) , &
+ ir11(nphsmx), ir22(nphsmx) , ir33(nphsmx), &
+ ir12(nphsmx), ir13(nphsmx) , ir23(nphsmx), &
+ iphi(nphsmx), ifb(nphsmx) , iomg(nphsmx), &
+ isca(nscamx), iscapp(nscamx), &
+ nscaus , nscapp , &
+ iuma , ivma , iwma
+common / iposvr / ipr , &
+ iu , iv , iw , &
+ ik , iep , &
+ ir11 , ir22 , ir33 , &
+ ir12 , ir13 , ir23 , &
+ iphi , ifb , iomg , &
+ isca , iscapp , &
+ nscaus , nscapp , &
+ iuma , ivma , iwma
+
+! POSITION DES PROPRIETES (Physiques ou numeriques)
+! ( Dans PROPCE, PROPFA et PROPFB)
+! Le numero des proprietes est unique, quelle aue soit la
+! localisation de ces dernieres (cellule, face, face de bord)
+! Voir usclim pour quelques exemples
+
+! IPPROC : Pointeurs dans PROPCE
+! IPPROF : Pointeurs dans PROPFA
+! IPPROB : Pointeurs dabs PROPFB
+
+! IROM : Masse volumique des phases
+! IROMA : Masse volumique des phases au pas de temps precedent
+! IVISCL : Viscosite moleculaire dynamique en kg/(ms) des phases
+! IVISCT : Viscosite turbulente des phases
+! IVISLA : Viscosite moleculaire dynamique en kg/(ms) des phases au pas
+! de temps precedent
+! IVISTA : Viscosite turbulente des phases au pas de temps precedent
+! ICP : Chaleur specifique des phases
+! ICPA : Chaleur specifique des phases au pas de temps precedent
+! ITSNSA : Terme source Navier Stokes des phases au pas de temps precedent
+! ITSTUA : Terme source des grandeurs turbulentes au pas de temps precedent
+! ITSSCA : Terme source des scalaires au pas de temps precedent
+! IESTIM : Estimateur d'erreur pour Navier-Stokes
+! IFLUMA : Flux de masse associe aux variables
+! IFLUAA : Flux de masse explicite (plus vu comme un tableau de travail)
+! associe aux variables
+! ISMAGO : constante de Smagorinsky dynamique
+! ICOUR : Nombre de Courant des phases
+! IFOUR : Nombre de Fourier des phases
+! IPRTOT : Pression totale au centre des cellules Ptot=P*+rho*g.(x-x0)
+! - - -
+! IVISMA : Viscosite de maillage en ALE (eventuellement orthotrope)
+
+integer ipproc(npromx), ipprof(npromx), ipprob(npromx), &
+ irom (nphsmx), iroma (nphsmx), iviscl(nphsmx), &
+ ivisct(nphsmx), ivisla(nphsmx), ivista(nphsmx), &
+ icp (nphsmx), icpa (nphsmx), itsnsa(nphsmx), &
+ itstua(nphsmx), itssca(nscamx), &
+ iestim(nestmx,nphsmx) , ifluma(nvarmx), &
+ ifluaa(nvarmx), ismago(nphsmx), icour (nphsmx), &
+ ifour (nphsmx), iprtot(nphsmx), ivisma(3)
+common / ipospp / ipproc , ipprof , ipprob , &
+ irom , iroma , iviscl , &
+ ivisct , ivisla , ivista , &
+ icp , icpa , itsnsa , &
+ itstua , itssca , &
+ iestim , ifluma , &
+ ifluaa , ismago , icour , &
+ ifour , iprtot , ivisma
+
+
+! POSITION DES CONDITIONS AUX LIMITES
+! (Position dans COEFA et COEFB des coef (coef. coef.f) relatifs a
+! une variable donnee)
+
+! ICOEF : coef numeros 1 (anciens coefa coefb)
+! ICOEFF : coef numeros 2 (anciens coefaf coefbf)
+! ICLRTP : pointeur dans COEFA et COEFB
+
+integer icoef , icoeff , iclrtp(nvarmx,2)
+common / iposcl / icoef , icoeff , iclrtp
+
diff --git a/include/base/optcal.h b/include/base/optcal.h
new file mode 100644
index 0000000..263930f
--- /dev/null
+++ b/include/base/optcal.h
@@ -0,0 +1,617 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! optcal.h
+!===============================================================================
+
+! DEFINITION DES EQUATIONS
+! ISTAT
+! = 1 PRISE EN COMPTE DU TERME INSTATIONNAIRE
+! = 0 PRISE EN COMPTE DU TERME INSTATIONNAIRE
+! ICONV
+! = 1 PRISE EN COMPTE DE LA CONVECTION
+! = 0 NON PRISE EN COMPTE DE LA CONVECTION
+! IDIFF
+! = 1 PRISE EN COMPTE DE LA DIFFUSION (MOLECULAIRE ET TURBULENTE)
+! = 0 NON PRISE EN COMPTE DE LA DIFFUSION (MOLECULAIRE ET TURBULENTE)
+! IDIFFT : SI IDIFF = 1
+! = 1 PRISE EN COMPTE DE LA DIFFUSION TURBULENTE
+! = 0 NON PRISE EN COMPTE DE LA DIFFUSION TURBULENTE
+
+integer istat (nvarmx),iconv (nvarmx),idiff (nvarmx), &
+ idifft(nvarmx)
+common / iequat / istat ,iconv ,idiff , &
+ idifft
+
+
+! PROPRIETES PHYSIQUES RHO ET VISCL CONSTANTES OU VARIABLES
+! =1 VARIABLE, =0 CONSTANT
+! SERT LORS DES LECTURES DE FICHIER SUITE POUR EVITER D'ECRASER
+! LA VALEUR FOURNIE PAR LA VALEUR DE L'ANCIEN CALCUL.
+integer irovar(nphsmx),ivivar(nphsmx)
+common / iphvar / irovar ,ivivar
+
+! SCHEMA EN TEMPS
+
+! ISCHTP : INDICATEUR DE SCHEMA EN TEMPS
+! = 2 : ORDRE 2
+! = 1 : STANDARD
+! ISTMPF : INDICATEUR DE SCHEMA FLUX DE MASSE
+! = 2 THETA SCHEMA avec THETA > 0 (= 0.5 : ordre 2)
+! = 0 THETA SCHEMA avec THETA = 0 (explicite)
+! = 1 SCHEMA STANDARD V1.0
+! NTERUP : Nombre d'iteration sur navier-stokes pour couplage vitesse/
+! pression
+! ISNO2T : INDICATEUR D'EXTRAPOLATION DE TERMES SOURCES NAVIER STOKES
+! POUR LE SCHEMA EN TEMPS
+! ISTO2T : INDICATEUR D'EXTRAPOLATION DE TERMES SOURCES DES GRANDEURS
+! TURBULENTES POUR LE SCHEMA EN TEMPS
+! ISSO2T : INDICATEUR D'EXTRAPOLATION DE TERMES SOURCES DES SCALAIRES
+! POUR LE THETA SCHEMA EN TEMPS
+! IROEXT : INDICATEUR D'EXTRAPOLATION DE LA MASSE VOLUMIQUE
+! POUR LE SCHEMA EN TEMPS
+! IVIEXT : INDICATEUR D'EXTRAPOLATION DE LA VISCOSITE TOTALE
+! POUR LE SCHEMA EN TEMPS
+! IVSEXT : INDICATEUR D'EXTRAPOLATION DE LA DIFFUSIVITE SCALAIRE
+
+! INITVI : =1 SI VISCOSITE TOTALE RELUE DANS UN SUITE
+
+! INITRO : =1 SI MASSE VOLUMIQUE RELUE DANS UN SUITE
+
+! ICPEXT : INDICATEUR D'EXTRAPOLATION DE LA MASSE VOLUMIQUE
+! POUR LE SCHEMA EN TEMPS
+
+! INITCP : =1 SI CHALEUR SPECIFIQUE RELUE DANS UN SUITE
+! INITVS : =1 SI DIFFUSIVITE SCALAIRE RELUE DANS UN SUITE
+
+! THETAV : PONDERATION ENTRE LES PAS DE TEMPS N ET N+1 POUR LES
+! VARIABLE PRINCIPALES
+! = 1 : SCHEMA EULER IMPLICITE
+! =1/2: SCHEMA CENTRE EN TEMPS
+
+! THETSN : SCHEMA EN TEMPS POUR LES TERMES SOURCES DE NAVIER STOKES
+! = 0 : VISCOSITE SECONDAIRE EXPLICITE
+! =1/2: VISCOSITE SECONDAIRE EXTRAPOLEE EN N+1/2
+! = 1 : VISCOSITE SECONDAIRE EXTRAPOLEE EN N+1
+! THETST : SCHEMA EN TEMPS POUR LES TERMES SOURCES DES GRANDEURS TURBULENTES
+! = 0 : VISCOSITE SECONDAIRE EXPLICITE
+! =1/2: VISCOSITE SECONDAIRE EXTRAPOLEE EN N+1/2
+! = 1 : VISCOSITE SECONDAIRE EXTRAPOLEE EN N+1
+! THETSS : SCHEMA EN TEMPS POUR LES TERMES SOURCES DES SCALAIRES
+! = 0 : VISCOSITE SECONDAIRE EXPLICITE
+! =1/2: VISCOSITE SECONDAIRE EXTRAPOLEE EN N+1/2
+! = 1 : VISCOSITE SECONDAIRE EXTRAPOLEE EN N+1
+! THETFL : SCHEMA EN TEMPS POUR LE FLUX DE MASSE
+! = 0 : FLUX DE MASSE EXPLICITE
+! =1/2: FLUX DE MASSE EXTRAPOLE EN N+1/2
+! = 1 : FLUX DE MASSE EXTRAPOLE EN N+1
+! THETVI : SCHEMA EN TEMPS POUR LA VISCOSITE TOTALE
+! = 0 : VISCOSITE TOTALE EXPLICITE
+! =1/2: VISCOSITE TOTALE EXTRAPOLEE EN N+1/2
+! = 1 : VISCOSITE TOTALE EXTRAPOLEE EN N+1
+! THETRO : SCHEMA EN TEMPS POUR LA MASSE VOLUMIQUE
+! = 0 : MASSE VOLUMIQUE TOTALE EXPLICITE
+! =1/2: MASSE VOLUMIQUE TOTALE EXTRAPOLEE EN N+1/2
+! = 1 : MASSE VOLUMIQUE EXTRAPOLEE EN N+1
+! THETCP : SCHEMA EN TEMPS POUR LA MASSE VOLUMIQUE
+! = 0 : CHALEUR SPECIFIQUE TOTALE EXPLICITE
+! =1/2: CHALEUR SPECIFIQUE TOTALE EXTRAPOLEE EN N+1/2
+! = 1 : CHALEUR SPECIFIQUE EXTRAPOLEE EN N+1
+! EPSUP : TESTS DE CONVERGENCE DU SYSTEME VITESSE/PRESSION QUAND CE
+! DERNIER EST RESOLU PAR SOUS-ITERATIONS (POINT FIXE)
+! XNRMU : NORME DE U(k+1) - U(k)
+! XNRMU0 : NORME DE U(0)
+
+integer nterup, &
+ ischtp(nphsmx), istmpf(nphsmx), &
+ isno2t(nphsmx), isto2t(nphsmx), isso2t(nscamx), &
+ iroext(nphsmx), &
+ iviext(nphsmx), icpext(nphsmx), ivsext(nscamx), &
+ initro(nphsmx), initvi(nphsmx), &
+ initcp(nphsmx), initvs(nscamx)
+common / ievtmp / nterup, &
+ ischtp , istmpf , &
+ isno2t , isto2t , isso2t , &
+ iroext , &
+ iviext , icpext , ivsext , &
+ initro , initvi , &
+ initcp , initvs
+double precision thetav(nvarmx), thetsn(nphsmx), thetst(nphsmx), &
+ thetss(nscamx), &
+ thetfl(nphsmx), thetro(nphsmx), thetvi(nphsmx), &
+ thetcp(nphsmx), thetvs(nscamx), epsup (nphsmx), &
+ xnrmu0(nphsmx), xnrmu (nphsmx)
+common / revtmp / thetav , thetsn , thetst , &
+ thetss , &
+ thetfl , thetro , thetvi , &
+ thetcp , thetvs , epsup , &
+ xnrmu0 , xnrmu
+
+! SCHEMA CONVECTIF
+
+! BLENCV : 100*(1-BLENCV) EST LE POURCENTAGE D'UPWIND
+! = 1 : PAS D'UPWIND EN DEHORS DU TEST DE PENTE
+! = 0 : UPWIND
+! ISCHCV : SCHEMA CONVECTIF CENTRE OU SECOND ORDER
+! = 1 : CENTRE
+! = 0 : SECOND ORDER
+! ISSTPC : INDICATEUR SANS OU AVEC TEST DE PENTE
+! = 1 : SANS TEST DE PENTE
+! = 0 : AVEC TEST DE PENTE
+
+integer ischcv(nvarmx), isstpc(nvarmx)
+common / icnvsc / ischcv , isstpc
+double precision blencv(nvarmx)
+common / rcnvsc / blencv
+
+
+! RECONSTRUCTION DES GRADIENTS ET DES SECONDS MEMBRES
+! IMRGRA : METHODE DE RECONTRUCTION DES GRADIENTS
+! = 0 : RECONTRUCTION 97
+! = 1 : MOINDRES CARRES 99
+! = 2 : MOINDRES CARRES SUPPORT ETENDU COMPLET
+! = 3 : MOINDRES CARRES AVEC SELECTION DU SUPPORT ETENDU
+! = 4 : RECONSTRUCTION 97 AVEC INITIALISATION MOINDRES CARRES
+! ANOMAX : ANGLE DE NON ORTHOGONALITE DES FACES EN RADIAN AU DELA DUQUEL
+! ON RETIENT DANS LE SUPPORT ETENDU DES CELLULES VOISINES
+! DE LA FACE LES CELLULES DONT UN NOEUD EST SUR LA FACE
+! NSWRGR : NOMBRE DE SWEEPS DE RECONSTRUCTION DES GRADIENTS 97
+! NSWRSM : NOMBRE DE SWEEPS DE RECONSTRUCTION DES SECONDS MEMBRES
+! EPSRGR : PRECISION POUR LA RECONSTRUCTION DES GRADIENTS 97
+! EPSRSM : PRECISION POUR LA RECONSTRUCTION DES SECONDS MEMBRES
+! IMLIGR : LIMITATION DES GRADIENTS
+! < 0 : PAS DE LIMITATION DES GRADIENTS
+! = 0 : PREMIER ORDRE
+! = 1 : SECOND ORDRE
+! CLIMGR : FACTEUR DE LIMITATION (>=1, =1 : FORTE LIMITATION)
+! IRCFLU : RECONSTRUCTION DES FLUX AUX FACES
+! = 0 : NON
+! = 1 : OUI
+! EXTRAG : EXTRAPOLATION DES GRADIENTS AU BORD (0 <= EXTRAG <= 1)
+! = 0 : NON
+! = 1 : OUI
+
+integer imrgra, nswrgr(nvarmx), nswrsm(nvarmx), &
+ imligr(nvarmx) , ircflu(nvarmx)
+common / irecgr / imrgra, nswrgr , nswrsm , &
+ imligr , ircflu
+
+double precision anomax , &
+ epsrgr(nvarmx), epsrsm(nvarmx), &
+ climgr(nvarmx), extrag(nvarmx)
+common / rrecgr / anomax , &
+ epsrgr , epsrsm , &
+ climgr , extrag
+
+
+! SOLVEURS ITERATIFS
+! NITMAX : NOMBRE D'ITERATIONS MAX
+! EPSILO : PRECISION RELATIVE CHERCHEE
+! IRESOL
+! =-1 : CALCULE AUTOMATIQUEMENT (0 SI ICONV=0, 1 SINON)
+! = 0 : GRADIENT CONJUGUE
+! = 1 : JACOBI
+! = 2 : BI-CGSTAB
+! et ON AJOUTE IPOL*1000 OU IPOL EST LE DEGRE DU POLYNOME DE
+! PRECONDITIONNEMENT DE NEUMANN
+! En pratique, il semble que ce preconditonnement ne soit pas efficace
+! on gagne 10% CPU sur un cas, on perd 3% sur un autre avec IPOL=1
+! on perd avec IPOL=2
+! Ces valeurs ont ete obtenues sur de petits cas.
+! IDIRCL : DECALAGE DE LA DIAGONALE DE LA MATRICE S'IL N'Y A PAS DE DIRICHLET
+! = 0 : NON
+! = 1 : OUI
+! Le code calcule automatiquement pour chaque variable NDIRCL, nombre de
+! CL de Dirichlet, et en deduit s'il doit decaler ou pas la diagonale
+
+integer nitmax(nvarmx),iresol(nvarmx),idircl(nvarmx), &
+ ndircl(nvarmx)
+common / inivcv / nitmax ,iresol ,idircl , &
+ ndircl
+
+double precision epsilo(nvarmx)
+common / rnivcv / epsilo
+
+
+! MULTIGRILLE
+! IMGR
+! = 0 PAS DE MULTIGRILLE
+! = 1 MULTIGRILLE ALGEBRIQUE
+! NCYMAX : NOMBRE MAX DE CYCLES
+! NITMGF : NOMBRE D'ITER SUR MAILLAGE FIN
+! RLXP1 :
+
+integer imgr(nvarmx), ncymax(nvarmx), nitmgf(nvarmx)
+common / imultg / imgr , ncymax , nitmgf
+
+double precision rlxp1
+common / rmultg / rlxp1
+
+
+! GESTION DU CALCUL
+! ISUITE : SUITE DE CALCUL
+! = 0 POUR SFS
+! = 1 POUR SUITE DE CALCUL
+! ISCOLD : correspondance nouveaux-anciens scalaires
+! IECAUX : ecriture du suite auxiliaire
+! ILEAUX : lecture du suite auxiliaire
+! ISUIT1 : suite du module thermique 1d en paroi
+! ISUICT : suite du module aerorefrigerant
+! ISUIVO : suite de la methode des vortex
+
+integer isuite , ileaux, iecaux, iscold(nscamx), &
+ isuit1 , isuict, isuivo
+common / istart / isuite , ileaux, iecaux, iscold, isuit1, isuict, isuivo
+
+
+! GESTION DES PAS DE TEMPS
+! NTPABS : PAS DE TEMPS PRECEDENT ABSOLU
+! NTCABS : PAS DE TEMPS COURANT ABSOLU
+! NTMABS : PAS DE TEMPS MAX ABSOLU
+! TTPABS : TEMPS PRECEDENT ABSOLU
+! TTCABS : TEMPS COURANT ABSOLU
+! TTMABS : TEMPS MAX ABSOLU
+! INPDT0 : INDICATEUR "ZERO PAS DE TEMPS"
+
+! NTMABS = numero absolu du dernier pas de temps desire
+! Si on a deja fait 10 pas de temps
+! et qu'on veut en faire 10 autres,
+! il faut affecter 10 + 10 = 20 a NTMABS
+! NTPABS = numero relu dans le fichier suite
+! NTCABS = incremente au debut du pas de temps
+! et donc initialise a NTPABS
+! INPDT0 = 1 pour ne faire aucun pas de temps (0 sinon)
+! Pour les calculs non suite :
+! on saute uniquement les resolutions (navier-stokes,
+! turbulence, scalaires...)
+! Pour les calculs suite :
+! on saute les resolutions (navier-stokes,
+! turbulence, scalaires...) et le calcul des proprietes
+! physiques, les conditions aux limites (les grandeurs
+! sont lues dans le fichier suite)
+
+integer ntpabs, ntcabs, ntmabs, inpdt0
+common / itemps / ntpabs, ntcabs, ntmabs, inpdt0
+
+double precision ttpabs, ttcabs
+common / rtemps / ttpabs, ttcabs
+
+
+! OPTION PAS DE TEMPS
+! IDTVAR : PAS DE TEMPS VARIABLE
+! = 0 : PAS DE TEMPS CONSTANT
+! = 1 : PAS DE TEMPS UNIFORME EN ESPACE ET VARIABLE EN TEMPS
+! = 2 : PAS DE TEMPS VARIABLE EN ESPACE ET VARIABLE EN TEMPS
+! IPTLRO : LIMITATION DU PAS DE TEMPS LIEE AUX EFFETS DE DENSITE
+! = 0 : NON
+! = 1 : OUI
+! COUMAX : NOMBRE DE COURANT MAXIMUM (IDTVAR NON NUL)
+! FOUMAX : NOMBRE DE FOURIER MAXIMUM (IDTVAR NON NUL)
+! VARRDT : VARIATION RELATIVE PERMISE DE DT (IDTVAR NON NUL)
+! DTMIN, DTMAX : VALEUR LIMITE MIN ET MAX DE DT (IDTVAR NON NUL)
+! PRENDRE POUR DTMAX = MAX (Ld/Ud, SQRT(Lt/(gDelta rho/rho)), ...)
+! CDTVAR : COEF MULTIPLICATIF POUR LE PAS DE TEMPS DE CHAQUE VARIABLE
+! POUR U,V,W,P IL EST INUTILISE
+! POUR K,E ON PREND LA MEME VALEUR : CELLE DE K
+! POUR RIJ, E ON PREND LA MEME VALEUR : CELLE DE R11
+! RELAXV : RELAXATION DES VARIABLES (1 PAS DE RELAX)
+! RELXST : COEFFICIENT DE RELAXATION DE BASE STATIONNAIRE
+
+integer idtvar,iptlro
+common / iptvar / idtvar,iptlro
+
+double precision dtref,coumax,foumax, &
+ dtmin,dtmax ,varrdt,cdtvar(nvarmx), &
+ relaxv(nvarmx), relxst
+common / rptvar / dtref,coumax,foumax, &
+ dtmin,dtmax ,varrdt,cdtvar,relaxv,relxst
+
+
+! TURBULENCE
+! ITURB
+! = 0 PAS DE TURBULENCE
+! = 10 LONGUEUR DE MELANGE
+! = 20, 21 K-EPSILON
+! * 20 MODELE STANDARD
+! * 21 MODELE A PRODUCTION LINEAIRE
+! = 30, 31 RIJ-EPSILON
+! * 30 MODELE STANDARD (LRR)
+! * 31 MODELE SSG
+! = 40, 41, 42 LES
+! * 40 MODELE DE SMAGORINSKY CONSTANT
+! * 41 MODELE DE SMAGORINSKY DYNAMIQUE "CLASSIQUE"
+! * 42 MODELE DE SMAGORINSKY DYNAMIQUE DE "PIOMELLI ET LIU"
+! = 50 v2f phi-model
+! = 60 K-OMEGA SST
+! ITYTUR
+! = INT(ITURB/10) POUR DISTINGUER RAPIDEMENT LES CLASSES DE MODELES
+! IDEUCH
+! = 0 UNE ECHELLE (DEUX ECHELLES = FAUX)
+! = 1 DEUX ECHELLES (DEUX ECHELLES = VRAI)
+! = 2 DEUX ECHELLES LIMITATION DE YPLUS A YPLULI (SCALABLE WALL FUNCTION)
+! ILOGPO
+! = 0 UNE ECHELLE AVEC LOI EN PUISSANCE
+! = 1 UNE ECHELLES AVEC LOI LOG
+! ICLKEP
+! = 0 CLIPPING EN VALEUR ABSOLUE DE K ET EPSILON
+! = 1 CLIPPING COUPLE K-EPSILON BASE SUR DES RELATIONS PHYSIQUES
+! IGRHOK
+! = 1 PRISE EN COMPTE DE 2/3 RHO GRAD K DANS NAVIER STOKES
+! = 0 NON PRISE EN COMPTE DE 2/3 RHO GRAD K DANS NAVIER STOKES
+! IGRAKE
+! = 1 GRAVITE DANS K-EPSILON
+! = 0 SINON
+! IGRARI
+! = 1 GRAVITE DANS RIJ-EPSILON
+! = 0 SINON
+! ISCALT NUMERO DU SCALAIRE QUI TIENT LIEU DE TEMPERATURE
+! DONC VARIABLE ISCA(ISCALT)
+! IKECOU
+! = 1 K-EPSILON COUPLE EN INCREMENTS
+! = 0 SINON
+! IRIJNU
+! = 1 VISCOSITE DANS LA MATRICE EN INCREMENTS DE VITESSE (RIJ)
+! = 0 SINON
+! IRIJRB
+! = 1 TRAITEMENT PRECIS DE RIJ AU BORD, VOIR CONDLI (RIJ)
+! = 0 SINON
+! IDIFRE
+! = 1 TRAITEMENT COMPLET DE LA DIAGONALE DU TENSEUR DE
+! DIFFUSION DE RIJ ET EPSILON (RIJ)
+! = 0 TRAITEMENT SIMPLIFIE
+! ICLSYR
+! = 1 IMPLICITATION PARTIELLE DE RIJ DANS LES CL DE SYMETRIE
+! = 0 PAS D'IMPLICITATION
+! ICLPTR
+! = 1 IMPLICITATION PARTIELLE DE RIJ ET EPSILON DANS LES CL
+! DE PAROI TURBULENTE
+! = 0 PAS D'IMPLICITATION
+! IDRIES : AMORTISSEMENT DE TYPE VAN DRIEST A LA PAROI
+! = 0 SANS AMORTISSEMENT
+! = 1 AVEC AMORTISSEMENT
+! IVRTEX : UTILISATION DE LA METHODE DES VORTEX
+! = 0 SANS METHODE DES VORTEX
+! = 1 AVEC METHODE DES VORTEX
+
+integer iturb(nphsmx) , itytur(nphsmx), &
+ ideuch(nphsmx), ilogpo(nphsmx), iclkep(nphsmx), &
+ igrhok(nphsmx), igrake(nphsmx), &
+ iscalt(nphsmx), ikecou(nphsmx), &
+ irijnu(nphsmx), irijrb(nphsmx), irijec(nphsmx), &
+ igrari(nphsmx), idifre(nphsmx), iclsyr(nphsmx), &
+ iclptr(nphsmx), idries(nphsmx), ivrtex
+common / iturbu / iturb , itytur , &
+ ideuch , ilogpo , iclkep , &
+ igrhok , igrake , &
+ iscalt , ikecou , &
+ irijnu , irijrb , irijec , &
+ igrari , idifre , iclsyr , &
+ iclptr , idries , ivrtex
+
+
+
+! IVISSE PRISE EN COMPTE DE -2/3 GRAD(MU DIV(U)) + DIV(MU (GRAD_T(U)))
+
+integer ivisse(nphsmx)
+common / ivisc2 / ivisse
+
+! STOKES
+! IREVMC
+! = 2 POUR RECONSTRUCTION DES VITESSES DE TYPE RT0
+! = 1 POUR RECONSTRUCTION DES VITESSES AVEC GRADIENT DE L'INCREMENT
+! DE PRESSION PAR MOINDRES CARRES
+! = 0 SINON
+! IPRCO
+! = 0 POUR CALCUL SANS PRESSION CONTINUITE
+! = 1 POUR CALCUL AVEC PRESSION CONTINUITE
+! ARAK PROPORTION D'ARAKAWA (1 POUR ARAKAWA COMPLET)
+! RELAXV RELAXATION DES VARIABLES (1 PAS DE RELAX)
+! RNORMP NORMALISATION POUR LA CONVERGENCE DE RESOLP
+
+integer irevmc(nphsmx), iprco , irnpnw
+common / istoke / irevmc , iprco , irnpnw
+
+double precision rnormp(nphsmx), arak(nphsmx)
+common / rstoke / rnormp , arak
+
+
+! IPUCOU ALGORITHME COUPLAGE INSTATIONNAIRE VITESSE/PRESSION
+
+integer ipucou
+common / coupup / ipucou
+
+
+! ICCVFG CALCUL A CHAMP DE VITESSE FIGE
+
+integer iccvfg
+common / icfige / iccvfg
+
+! CALCUL DE LA VISCOSITE
+
+integer imvisf
+common / rvscfa / imvisf
+
+! TYPE DES CONDITIONS LIMITES ET INDEX MIN ET MAX
+! DES SOUS LISTES DEFACES DE BORD
+
+integer idebty(ntypmx,nphsmx), ifinty(ntypmx,nphsmx)
+common / itycli / idebty , ifinty
+
+
+! ITRBRB = 1 TRAITEMENT PRECIS DE LA TEMPERATURE AU BORD, VOIR CONDLI
+! (UTILISE POUR COUPLAGE SYRTHES)
+! = 0 SINON
+! ICPSYR = 1 SI SCALAIRE COUPLE A SYRTHES
+! DONC POUR LE MOMENT VAUT 1 POUR ISCALT UNIQUEMENT
+
+integer itbrrb, icpsyr(nscamx)
+common / couplb / itbrrb, icpsyr
+
+! PRISE EN COMPTE DE l'EQUILIBRE ENTRE LE GRADIENT DE PRESSION
+! ET LES TERMES SOURCES DE GRAVITE ET DE PERTE DE CHARGE
+
+! IPHYDR = 0 ALGORITHME SANS PRISE EN COMPTE DE L'EQUILIBRE
+! = 1 ALGORITHME AVEC PRISE EN COMPTE DE L'EQUILIBRE
+! ICALHY = 0 PAS DE CALCUL DE LA PRESSION HYDROSTATIQUE POUR LES
+! DIRICHLETS DE PRESSION EN SORTIE
+! = 1 CALCUL DE LA PRESSION HYDROSTATIQUE POUR LES
+! DIRICHLETS DE PRESSION EN SORTIE
+
+integer iphydr, icalhy
+common / iprehy / iphydr, icalhy
+
+
+! CALCUL DES ESTIMATEURS
+
+integer iescal(nestmx,nphsmx)
+common / icaest / iescal
+
+
+! CALCUL DES MOYENNES TEMPORELLES (CALCUL DES MOMENTS)
+
+! NBMOMT : NOMBRE DE MOYENNES DEMANDEES
+! NBDTCM : NOMBRE DE TABLEAUX NCEL POUR LE TEMPS CUMULE
+! NTDMOM : NUMERO DU PAS DE TEMPS INITIAL POUR LE CALCUL DU MOMENT
+! IMOOLD : NUMERO DE L'ANCIEN MOMENT CORRESPONDANT EN CAS DE SUITE
+! ICMOME : POINTEUR POUR LES MOMENTS (donne un numero de propriete)
+! s'utilise ainsi PROPCE(IEL,IPPROC(ICMOME(IMOM)))
+! IDTMOM : NUMERO DU TEMPS CUMULE ASSOCIE AUX MOMENTS
+! ce numero va de 1 a n pour les temps cumules non uniformes
+! et de -1 a -p pour les temps cumules uniformes
+! s'utilise ainsi :
+! si IDTMOM(IMOM) > 0 PROPCE(IEL,IPROPC(ICDTMO(IDTMOM(IMOM))))
+! si IDTMOM(IMOM) < 0 DTCMOM(-IDTMOM(IMOM))
+! IDFMOM : NUMERO DES VARIABLES COMPOSANT LE MOMENT IDFMOM(JJ,IMOM)
+! IDGMOM : DEGRE DU MOMENT
+! ICDTMO : NUMERO DE PROPRIETE DU TEMPS CUMULE (voir IDTMOM)
+! IPPMOM : REPERE POUR LE POST SI ON DOIT DIVISER LA VARIABLE
+! PAR UN TEMPS CUMULE (voir memtri et useevo)
+! DTCMOM : VALEUR DU PAS DE TEMPS CUMULE QUAND IL EST UNIFORME (voir IDTMOM).
+
+integer nbmomt, nbdtcm, &
+ ntdmom(nbmomx), imoold(nbmomx), &
+ icmome(nbmomx), idtmom(nbmomx), &
+ idfmom(ndgmox,nbmomx), idgmom(nbmomx), &
+ icdtmo(nbmomx), ippmom(nvppmx)
+common / imomen / nbmomt, nbdtcm, &
+ ntdmom , imoold , &
+ icmome , idtmom , &
+ idfmom , idgmom , &
+ icdtmo , ippmom
+double precision dtcmom(nbmomx)
+common / rmomen / dtcmom
+
+
+! INDICATEUR PERTES DE CHARGE GLOBAL (IE SOMME SUR LES PROCESSEURS
+! DE NCEPDC)
+
+integer ncpdct(nphsmx)
+common / icpdct / ncpdct
+
+! INDICATEUR MODULE THERMIQUE 1D GLOBAL (IE SOMME SUR LES PROCESSEURS
+! DE NFPT1D)
+
+integer nfpt1t
+common / ict1dt / nfpt1t
+
+! INDICATEUR TERMES SOURCES DE MASSE GLOBAL (IE SOMME SUR LES PROCESSEURS
+! DE NCETSM)
+
+integer nctsmt(nphsmx)
+common / ictsmt / nctsmt
+
+! INDICATEUR DE PASSAGE DANS L'INITIALISATION DES
+! VARIABLES PAR L'UTILISATEUR
+! IUSINI = 1 PASSAGE DANS USINIV OU PPINIV
+! 0 PAS DE PASSAGE (NI IUSINI NI PPINIV)
+! IUSCFP = 1 PASSAGE DANS USCFPV
+! 0 PAS DE PASSAGE
+
+integer iusini, iuscfp
+common / iusspg / iusini, iuscfp
+
+! PARAMETRES NUMERIQUES POUR LE CALCUL DE LA DISTANCE A LA PAROI
+
+! INEEDY : = 1 DISTANCE A LA PAROI EST NECESSAIRE POUR LE CALCUL
+! = 0 DISTANCE A LA PAROI N'EST PAS NECESSAIRE
+! IMAJDY : = 1 DISTANCE A LA PAROI A ETE MISE A JOUR
+! = 0 DISTANCE A LA PAROI N'A PAS ETE MISE A JOUR
+! ICDPAR : = 1 CALCUL STANDARD (ET RELECTURE EN SUITE DE CALCUL)
+! = 2 CALCUL ANCIEN (ET RELECTURE EN SUITE DE CALCUL)
+! =-1 FORCER LE RECALCUL EN SUITE (PAR CALCUL STANDARD)
+! =-2 FORCER LE RECALCUL EN SUITE (PAR CALCUL ANCIEN)
+! NITMAY : NOMBRE MAX D'ITERATIONS POUR LES RESOLUTIONS ITERATIVES
+! NSWRSY : NOMBRE DE SWEEP POUR RECONSTRUCTION DES S.M.
+! NSWRGY : NOMBRE DE SWEEP POUR RECONSTRUCTION DES GRADIENTS
+! IMLIGY : METHODE DE LIMITATION DU GRADIENT
+! IRCFLY : INDICATEUR POUR RECONSTRUCTION DES FLUX
+! ISCHCY : INDICATEUR DU SCHEMA EN ESPACE
+! ISSTPY : INDICATEUR POUR TEST DE PENTE
+! IMGRPY : MULTIGRILLE
+! IWARNY : NIVEAU D'IMPRESSION
+! NTCMXY : NOMBRE MAX D'ITERATION POUR LA CONVECTION DE Y
+
+integer ineedy , imajdy , icdpar , &
+ nitmay , nswrsy , nswrgy , &
+ imligy , ircfly , ischcy , &
+ isstpy , imgrpy , iwarny , &
+ ntcmxy
+common / idpopt / ineedy , imajdy , icdpar , &
+ nitmay , nswrsy , nswrgy , &
+ imligy , ircfly , ischcy , &
+ isstpy , imgrpy , iwarny , &
+ ntcmxy
+
+! BLENCY : 1 - PROPORTION D'UPWIND
+! EPSILY : PRECISION POUR RESOLUTION ITERATIVE
+! EPSRSY : PRECISION POUR LA RECONSTRUCTION DU SECOND MEMBRE
+! EPSRGY : PRECISION POUR LA RECONSTRUCTION DES GRADIENTS
+! CLIMGY : COEF GRADIENT*DISTANCE/ECART
+! EXTRAY : COEF D'EXTRAPOLATION DES GRADIENTS
+! COUMXY : VALEUR MAX DU COURANT POUR EQUATION CONVECTION
+! EPSCVY : PRECISION POUR CONVERGENCE EQUATION CONVECTION STATIONNAIRE
+! YPLMXY : VALEUR MAX DE YPLUS AU DESSUS DE LAQUELLE L'AMORTISSEMENT DE
+! VAN DRIEST EST SANS EFFET ET DONC POUR LAQUELLE UN CALCUL DE
+! YPLUS MOINS PRECIS EST SUFFISANT
+
+double precision blency , epsily , epsrsy , &
+ epsrgy , climgy , extray , &
+ coumxy , epscvy , yplmxy
+common / rdpopt / blency , epsily , epsrsy , &
+ epsrgy , climgy , extray , &
+ coumxy , epscvy , yplmxy
+
+
+! PARAMETRES NUMERIQUES POUR LE CALCUL DES EFFORTS AUX BORDS
+
+! INEEDF : = 1 ON CALCULE LES EFFORTS AUX PAROIS
+! = 0 ON NE CALCULE PAS LES EFFORTS AUX PAROIS
+integer ineedf
+common / iforbr / ineedf
+
+! FIN
+
diff --git a/include/base/parall.h b/include/base/parall.h
new file mode 100644
index 0000000..ed04d71
--- /dev/null
+++ b/include/base/parall.h
@@ -0,0 +1,64 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! parall.h
+!===============================================================================
+
+
+! Gestion du parallellisme
+
+! irangp : rang du processus
+! = -1 en mode sequentiel
+! = r (0 < r < nb_processus) en execution parallelle distribuee
+! nrangp : nombre de processus (=1 si sequentiel)
+! nthrdi : nombre de sous ensembles independants de faces internes max
+! dans un groupe (>= 1 avec OpenMP, 1 sinon)
+! nthrdb : nombre de sous ensembles independants de faces de bord max
+! dans un groupe (>= 1 avec OpenMP, 1 sinon)
+! ngrpi : nombre de groupes de faces internes (> 1 avec OpenMP, 1 sinon)
+! ngrpb : nombre de groupes de faces de bord (> 1 avec OpenMP, 1 sinon)
+! iompli : bornes par thread pour les faces internes
+! iomplb : bornes par thread pour les faces de bord
+! pour le groupe (couleur) j et le thread i, boucles
+! de iompl.(1, j, i) à iompl.(2, j, i)
+
+integer irangp, nrangp, nthrdi, nthrdb, ngrpi, ngrpb, &
+ iompli(2, nthrd1, nthrd2), iomplb(2, nthrd1, nthrd2)
+common / iparal / irangp, nrangp, nthrdi, nthrdb, ngrpi, ngrpb, &
+ iompli, iomplb
+
+
+! Dimensions globales (i.e. independantes de decoupage parallele)
+! ncelgb : nombre de cellules global
+! nfacgb : nombre de faces internes global
+! nfbrgb : nombre de faces de bord global
+! nsomgb : nombre de sommets global
+
+integer ncelgb, nfacgb, nfbrgb, nsomgb
+common / igeogb / ncelgb, nfacgb, nfbrgb, nsomgb
+
+! FIN
diff --git a/include/base/paramx.h b/include/base/paramx.h
new file mode 100644
index 0000000..2440779
--- /dev/null
+++ b/include/base/paramx.h
@@ -0,0 +1,183 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! paramx.h
+!===============================================================================
+
+
+
+
+
+! =================
+! =================
+
+! ATTENTION
+
+! =================
+! =================
+
+
+
+
+
+
+! LA MODIFICATION DES PARAMETRES CI DESSOUS
+
+
+
+! EST INTERDITE
+
+! =================
+! =================
+
+
+
+
+
+
+
+
+! Elle demande la recompilation de la totalite de la bibliotheque
+! operation qui ne peut etre effectuee que si l'on dispose de
+! la totalite des sources.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+! PARAMETRES DIVERS
+! =================
+
+! NPHSMX : NOMBRE MAX DE PHASES
+! (keep it coherent with CS_NPHSMX in cs_perio.h)
+! NSCAMX : NOMBRE MAX DE SCALAIRES
+! NVARMX : NOMBRE MAX DE VARIABLES =
+! NOMBRE MAX DE SCALAIRES + 12 (U,V,W,P,Rij,E,ALP)*NPHSMX
+! NPRCMX : NOMBRE MAX DE PROPRIETES PHYSIQUES AUX CELLULES (TOTAL) =
+! NSCAMX (Lambda) + 7 (RHO,CP,VISCL,VISCT,COU,FOU,IPRTOT) NPHSMX
+! + 4 (ESTIM) NPHSMX
+! NPRFMX : NOMBRE MAX DE PROPRIETES PHYSIQUES AUX FACES INTERNES =
+! NSCAMX (Flumas) + 2*NPHSMX(Flumas,ALP)
+! NPRBMX : NOMBRE MAX DE PROPRIETES PHYSIQUES AUX FACES DE BORD =
+! NSCAMX (Flumab) + 3*NPHSMX(Flumab,ALP, ROMB)
+! NPROMX : NOMBRE MAX DE PROPRIETES PHYSIQUES TOUT CONFONDU
+! Majore par NPRCMX+NPRFMX+NPRBMX
+! NGRDMX : NOMBRE MAX DE GRANDEURS =
+! NVARMX + NPROMX
+! NSMAMX : NOMBRE MAX DE CASES POUR LES TABLEAUX TERMES SOURCE DE MASSE
+! NVARMX + NPHSMX pour SMACEL
+! NVPPMX : NOMBRE DE VARIABLES POUR AFFICHAGES
+! NGRDMX + 20 (20 couvre DT, TPUCOU, et une marge de 16 ...)
+
+integer nphsmx, nscamx, nvarmx, nprcmx, nprfmx, nprbmx, npromx
+integer ngrdmx, nsmamx, nvppmx
+parameter(nphsmx=1)
+parameter(nscamx=200)
+parameter(nvarmx=nscamx+12*nphsmx)
+parameter(nprcmx=nscamx+11*nphsmx)
+parameter(nprfmx=nscamx+ 2*nphsmx)
+parameter(nprbmx=nscamx+ 3*nphsmx)
+parameter(npromx=nprcmx+ nprfmx+nprbmx)
+parameter(ngrdmx=nvarmx+ npromx)
+parameter(nsmamx=nvarmx+ nphsmx)
+parameter(nvppmx=ngrdmx+20)
+
+! NUSHMX : NOMBRE MAX DE FICHIERS UTILISATEUR POUR HISTORIQUES
+integer nushmx
+parameter(nushmx=16)
+
+! NUSRMX : NOMBRE MAX DE FICHIERS UTILISATEUR
+integer nusrmx
+parameter(nusrmx=10)
+
+! NCAPTM : NOMBRE MAX DE SONDES (POUR HISTORIQUES)
+! Voir le format associe dans ecrhis
+integer ncaptm
+parameter(ncaptm=100)
+
+! NTYPMX NOMBRE DE TYPES DE CONDITIONS AUX LIMITES POSSIBLES
+
+integer ntypmx
+parameter(ntypmx=200)
+
+integer iindef, ientre, isolib, isymet, iparoi, &
+ iparug, iesicf, isspcf, isopcf, ierucf, &
+ ieqhcf, icscpl
+
+parameter(iindef=1, ientre=2, isolib=3, isymet=4, iparoi=5, &
+ iparug=6, iesicf=7, isspcf=8, isopcf=9, ierucf=10, &
+ ieqhcf=11, icscpl=12)
+
+! NESTMX : NOMBRE MAX D'ESTIMATEURS
+! IESPRE, IESDER, IESCOR, IESTOT : Numeros
+integer nestmx
+parameter (nestmx=4)
+integer iespre , iesder , iescor , iestot
+parameter (iespre=1, iesder=2, iescor=3, iestot=4)
+
+! NBMOMX : NOMBRE MAX DE MOYENNES (MOMENTS) CALCULE
+! NDGMOX : DEGRE MAX DES MOMENTS
+integer nbmomx, ndgmox
+parameter (nbmomx = 50, ndgmox = 5)
+
+! IPST* : SELECTION POST TRAITEMENT AUTOMATIQUE BORD : VOIR IPSTDV
+
+integer ipstyp , ipstcl , ipstft, ipstfo
+parameter (ipstyp=2, ipstcl=3, ipstft=5, ipstfo=7)
+
+! CONDITIONS AUX LIMITES POSSIBLES POUR LA VITESSE DE MAILLAGE EN ALE
+
+integer ibfixe, igliss, ivimpo
+parameter(ibfixe=1, igliss=2, ivimpo=3 )
+
+! NOMBRE DE STRUCTURES MAX EN ALE
+
+integer nstrmx
+parameter (nstrmx=20)
+
+! NOMBRE DE STRUCTURES MAX EN ALE ET COUPLAGE CODE_ASTER
+
+integer nastmx
+parameter (nastmx=20)
+
+! DIMENSIONS MAXIMALES DES TABLEAUX CONTENANT LES BORNES PAR THREAD
+
+integer nthrd1, nthrd2
+parameter (nthrd1=4, nthrd2=16)
+
diff --git a/include/base/period.h b/include/base/period.h
new file mode 100644
index 0000000..a65b407
--- /dev/null
+++ b/include/base/period.h
@@ -0,0 +1,44 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! period.h
+!===============================================================================
+
+! IPERIO : INDIQUE S'IL Y A AU MOINS UNE PERIODICITE
+! VALEUR ADMISSIBLES : 0 ou 1 ; VALEUR PAR DEFAUT : 0
+! IPEROT : INDIQUE LE NOMBRE DE PERIODICITES DE ROTATION
+! (COMPLETE AUTOMATIQUEMENT)
+! VALEUR PAR DEFAUT : 0
+
+! IGUPER : 0/1 INDIQUE QU'ON A /N'A PAS CALCULE LES GRADIENTS DANS DUDXYZ
+! IGRPER : 0/1 INDIQUE QU'ON A /N'A PAS CALCULE LES GRADIENTS DANS DRDXYZ
+
+integer iperio, iperot, iguper, igrper
+
+common / iiiper / iperio, iperot, iguper, igrper
+
+! FIN
diff --git a/include/base/pointe.h b/include/base/pointe.h
new file mode 100644
index 0000000..c1a137a
--- /dev/null
+++ b/include/base/pointe.h
@@ -0,0 +1,148 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! pointe.h
+!===============================================================================
+
+!... GEOMETRIE
+! ACCESSIBLES DIRECTEMENT DANS IA, RA
+
+! Pointeur Dimension Description
+! IICELB ! NCELBR ! REPERAGE DES CELLULES DE BORD
+! ISRFAN ! NFAC ! SURFACE DES FACES INTERNES
+! ISRFBN ! NFABOR ! SURFACE DES FACES DE BORD
+! IDIST ! NFAC ! IJ.Nij
+! IDISTB ! NFABOR ! EQUIVALENT DE IDIST AU BORD
+! IPOND ! NFAC ! PONDERATION (Aij=POND Ai+(1-POND)Aj)
+! IDIJPF ! NFAC*NDIM ! VECTEUR I'J'
+! IDIIPB ! NFAC*NDIM ! EQUIVALENT DE IDIIPF AU BORD
+! IDOFIJ ! NFAC*NDIM ! VECTEUR OF A LA FACE IJ
+
+integer iicelb , &
+ isrfan , isrfbn , idist , idistb , ipond , &
+ idijpf , idiipb , idofij
+common / ipgeom / iicelb , &
+ isrfan , isrfbn , idist , idistb , ipond , &
+ idijpf , idiipb , idofij
+
+
+!... AUXILIAIRES INDEPENDANTS DU NOMBRE DE PHASES
+! ACCESSIBLES DIRECTEMENT DANS IA, RA
+
+! Pointeur Dimension Description
+! ICOCG ! NCELET*9 ! STOCKAGE POUR GRADIENT
+! ICOCGB ! NCELBR*9 ! STOCKAGE POUR GRADIENT BORD
+! ICOCI ! NCELET*9 ! STOCKAGE POUR GRADIENT SI INIT. PAR MC
+! ICOCIB ! NCELBR*9 ! STOCKAGE POUR GRADIENT BORD SI INIT. PAR MC
+! ITPUCO ! - ! VARIABLES DU COUPLAGE U-P
+! IDIPAR ! NCELET ! DISTANCE A LA FACE DE TYPE 5 (PHASE 1) LA
+! PLUS PROCHE
+! IYPPAR ! NCELET ! YPLUS ASSOCIE (LES only)
+! IFORBR ! NFABOR*3 ! EFFORTS AUX BORDS (SI POSTTRAITE)
+! IIDFST ! NFABOR ! TABLEAU D'INDIRECTION POUR LES STRUCTURES
+! MOBILES EN ALE
+
+!... PARAMETRES DU MODULE THERMIQUE 1D
+! NFPT1D ! ! NB DE FACES DE BORD AVEC MODULE THERMIQUE 1D
+! INPPT1 ! NFPT1D ! NOMBRE DE MAILLES DANS LA PAROI
+! IEPPT1 ! NFPT1D ! EPAISSEUR DE LA PAROI
+! IRGPT1 ! NFPT1D ! RAISON DU MAILLAGE
+! IIFPT1 ! NFPT1D ! NUMERO DE LA FACE
+! ITPPT1 ! NFPT1D ! TEMPERATURE DE PAROI
+! IICLT1 ! NFPT1D ! TYPE DE CONDITION LIMITE
+! ITEPT1 ! NFPT1D ! TEMPERATURE EXTERIEURE
+! IHEPT1 ! NFPT1D ! COEFFICIENT D ECHANGE EXTERIEUR
+! IFEPT1 ! NFPT1D ! FLUX THERMIQUE EXTERIEUR
+! IXLMT1 ! NFPT1D ! DIFFUSIVITE THERMIQUE
+! IRCPT1 ! NFPT1D ! RHO*CP
+! IDTPT1 ! NFPT1D ! PAS DE TEMPS
+
+integer icocg , icocgb , icoci , icocib , &
+ itpuco , idipar , iyppar , iforbr , iidfst , &
+ nfpt1d , nmxt1d , inppt1 , iifpt1 , iiclt1 , &
+ ieppt1 , irgpt1 , itppt1 , &
+ itept1 , ihept1 , ifept1 , &
+ ixlmt1 , ircpt1 , idtpt1
+
+common / ipaux0 / icocg , icocgb , icoci , icocib , &
+ itpuco , idipar , iyppar , iforbr , iidfst , &
+ nfpt1d , nmxt1d , inppt1 , iifpt1 , iiclt1 , &
+ ieppt1 , irgpt1 , itppt1 , &
+ itept1 , ihept1 , ifept1 , &
+ ixlmt1 , ircpt1 , idtpt1
+
+!... AUXILIAIRES ACCESSIBLES DIRECTEMENT DANS IA, RA
+! TOUS CES TABLEAUX SONT (Dimension,NPHAS)
+
+! Pointeur Dimension Description
+! IITYPF ! NFABOR ! TYPE DES FACES DE BORD
+! IITRIF ! NFABOR ! INDIRECTION POUR TRI FACES DE BORD
+! IYPLBR ! NFABOR ! YPLUS BORD (SI POST-TRAITE)
+! IISYMP ! NFABOR ! ZERO POUR ANNULER LE FLUX DE MASSE
+! ! ! (SYMETRIES ET PAROIS AVEC CL COUPLEES)
+! ! ! UN SINON
+! IIFAPA ! NCELET ! NUMERO DE FACE DE BORD 5 LA PLUS PROCHE
+! NCEPDC ! ! NOMBRE DE CELLULES AVEC PDC
+! IICEPD ! NCEPDC ! NUMERO DES CELLULES AVEC PerteDeCharge
+! ICKUPD ! (NCEPDC,6) ! VALEUR DES COEFF DE PDC
+! NCETSM ! ! NOMBRE DE CELLULES AVEC TSM
+! IICESM ! NCETSM ! NUMERO DES CELLULES AVEC TSMasse
+! IITPSM ! NCETSM ! TYPE DE TSM
+! ISMACE ! NCETSM ! VALEUR DE TSM
+! IS2KW ! NCELET ! STOCKAGE DE 2 Sij.Sij EN K-OMEGA
+! IDVUKW ! NCELET ! STOCKAGE DE DIVU EN K-OMEGA (EN MEME TEMPS QUE S2KW)
+
+integer iitypf , iitrif , &
+ iisymp , iyplbr , &
+ iifapa(nphsmx), ncepdc(nphsmx), &
+ iicepd(nphsmx), ickupd(nphsmx), ncetsm(nphsmx), &
+ iicesm(nphsmx), iitpsm(nphsmx), ismace(nphsmx), &
+ is2kw (nphsmx), idvukw(nphsmx)
+common / iposup / iitypf , iitrif , &
+ iisymp , iyplbr , &
+ iifapa , ncepdc , &
+ iicepd , ickupd , ncetsm , &
+ iicesm , iitpsm , ismace , &
+ is2kw , idvukw
+
+
+!... AUXILIAIRES ACCESSIBLES DIRECTEMENT DANS IA, RA
+! POUR LA PERODICITE
+
+! Pointeur Dimension | Description
+! IDUDXY ! (NCELET-NCEL,3,3,NPHAS) ! SAUVEGARDE DU GRADIENT DE LA
+! ! ! VITESSE EN CAS DE ROTATION
+! IWDUDX ! (NCELET-NCEL,3,3,NPHAS) ! TABLEAU DE TRAVAIL LIE A DUDXYZ
+! IDRDXY ! (NCELET-NCEL,6,3,NPHAS) ! SAUVEGARDE DU GRADIENT DE RIJ
+! ! ! EN CAS DE ROTATION
+! IWDRDX ! (NCELET-NCEL,6,3,NPHAS) ! TABLEAU DE TRAVAIL LIE A DRDXYZ
+
+integer idudxy,idrdxy,iwdudx,iwdrdx
+common / ipaux1 / idudxy,idrdxy,iwdudx,iwdrdx
+
+
+! FIN
diff --git a/include/base/tcpumx.h b/include/base/tcpumx.h
new file mode 100644
index 0000000..4bec0a1
--- /dev/null
+++ b/include/base/tcpumx.h
@@ -0,0 +1,71 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_TCPUMX_H__
+#define __CS_TCPUMX_H__
+
+/*============================================================================
+ * Query time allocated to this process (useful mainly under PBS)
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Query CPU time allocated to this process
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TCPUMX (TPS , RET)
+ * *****************
+ *
+ * DOUBLE PRECISION TPS : <-- : remaining time (default: 7 days)
+ * INTEGER RET : <-- : return code:
+ * : : -1: error
+ * : : 0: no limit using this method
+ * : : 1: CPU limit determined
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tcpumx, TCPUMX) (double *tps,
+ int *ret);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* _CS_TCPUMX_H_ */
diff --git a/include/base/tremai.h b/include/base/tremai.h
new file mode 100644
index 0000000..111e06a
--- /dev/null
+++ b/include/base/tremai.h
@@ -0,0 +1,71 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_TREMAI_H__
+#define __CS_TREMAI_H__
+
+/*============================================================================
+ * Compute remaining time allocated to this process
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute remaining time allocated to this process
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TREMAI (TPS , RET)
+ * *****************
+ *
+ * DOUBLE PRECISION TPS : <-- : remaining time (default: 7 days)
+ * INTEGER RET : <-- : return code:
+ * : : -1: error
+ * : : 0: no limit using this method
+ * : : 1: CPU limit determined
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tremai, TREMAI) (double *tps,
+ int *ret);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* _CS_TREMAI_H_ */
diff --git a/include/base/vector.h b/include/base/vector.h
new file mode 100644
index 0000000..6d2cbd2
--- /dev/null
+++ b/include/base/vector.h
@@ -0,0 +1,35 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! vector.h
+!===============================================================================
+
+! IVECTI,IVECTB INDICATEUR (1/0) DE VECTORISATION
+! FORCEE OU NON (FACES INTERNES ET DE BORD)
+
+integer ivecti , ivectb
+common / ivecto / ivecti , ivectb
diff --git a/include/base/vortex.h b/include/base/vortex.h
new file mode 100644
index 0000000..48bd550
--- /dev/null
+++ b/include/base/vortex.h
@@ -0,0 +1,178 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! vortex.h
+!===============================================================================
+
+! METHODE DES VORTEX POUR CONDITIONS AUX LIMITES D'ENTREE EN L.E.S.
+
+! --------------
+! PARAMETRES MAX
+! --------------
+integer nentmx, ndatmx
+parameter (nentmx = 10)
+parameter (ndatmx = 10000)
+
+! NENTMX : NOMBRE D'ENTREE MAX
+! NDATMX : NOMBRE DE POINTS MAX POUR LE FICHIER DES DONNEES
+
+! ----------
+! DIMENSIONS
+! ----------
+integer icvor(nentmx) , icvor2(nentmx) , &
+ icvmax , nvomax
+
+common /idimvo/ icvor , icvor2 , icvmax , nvomax
+
+! ICVOR : NOMBRE DE FACES (GLOBAL) UTILISANT DES VORTEX
+! POUR CHAQUE ENTREE
+! ICVOR2 : COMPTEUR DU NOMBRE LOCAL DE FACES UTILISANT DES VORTEX
+! ICVMAX : NOMBRE MAX DE FACES UTILISANT DES VORTEX (SUR TOUTES ENTREES
+! CONFONDUES)
+! NVOMAX : NOMBRE MAX DE VORTEX UTILISE (TOUTES ENTREES CONFONDUES)
+
+! ---------
+! POINTEURS
+! ---------
+
+integer iirepv , iifagl , iivrce , &
+ ixyzv , ivisv , &
+ iyzcel , iuvort , ivvort , iwvort , &
+ iyzvor , iyzvoa , isignv , ixsigm , &
+ ixgamm , ixtmp , ixtmpl , &
+ iw1x , iw1y , iw1z , iw1v , &
+ iw2x , iw2y , iw2z , iw2v
+
+common /iivort/ iirepv , iifagl , iivrce , &
+ ixyzv , ivisv , &
+ iyzcel , iuvort , ivvort , iwvort , &
+ iyzvor , iyzvoa , isignv , ixsigm , &
+ ixgamm , ixtmp , ixtmpl , &
+ iw1x , iw1y , iw1z , iw1v , &
+ iw2x , iw2y , iw2z , iw2v
+
+! IIREPV : DEBUT DU TABLEAU ASSOCIANT AUX FACES DE BORD
+! LE NUMERO D'UNE ENTREE
+! IIFAGL : DEBUT DU TABLEAU DE CONNECTIVITE
+! IIVRCE : DEBUT DU TABLEAU REPERANT LA CELLULE LA PLUS VOISINE
+! DE CHAQUE VORTEX
+! IXYZV : DEBUT DU TABLEAUX CONTENANT LES COORDONNEES DE
+! TOUTES LES FACES D'ENTREE
+! IVISV : DEBUT DU TABLEAU CONTENANT LA VISCOSITE SUR
+! TOUTES LES FACES D'ENTREE
+! IYZCEL : DEBUT DU TABLEAU CONTENANT LES COORDONNEES DES
+! FACES D'ENTREE DANS LE REPERE LOCAL
+! IUVORT,...: DEBUTS DES TABLEAUX CONTENANT LES COMPOSANTES DE VITESSE
+! IYZVOR : DEBUT DU TABLEAU CONTENANT LA POSITION DES VORTEX
+! DANS LE REPERE LOCAL
+! IYZVOA : DEBUT DU TABLEAU CONTENANT LA POSITION DES VORTEX
+! DANS LE REPERE LOCAL AU PAS DE TEMPS PRECEDENT
+! ISIGNV : DEBUT DU TABLEAU CONTENANT LE SENS DE ROTATION DES
+! VORTEX
+! IXSIGM : DEBUT DU TABLEAU CONTENANT LA TAILLE DES VORTEX
+! IXGAMM : DEBUT DU TABLEAU CONTENANT L'INTENSITE DES VORTEX
+! IXTMP : DEBUT DU TABLEAU CONTENANT LE TEMPS CUMULE
+! IXTMPL : DEBUT DU TABLEAU CONTENANT LE TEMPS DE VIE DES VORTEX
+! IW1X,.. : DEBUT DES TABLEAUX DE TRAVAILS SERVANT A COMMUNIQUER
+! LES DONNEES AUX ENTREES A TOUS LES PROCESSEURS
+! (PLUS UTILISE APRES VORPRE)
+
+! -----------------
+! OPTIONS DE CALCUL
+! -----------------
+
+integer nnent , nvort(nentmx) , &
+ initvo(nentmx) , &
+ icas(nentmx) , itlivo(nentmx) , &
+ isgmvo(nentmx) , idepvo(nentmx) , &
+ iclvor(4,nentmx), ndat(nentmx)
+
+common /ioptvo/ nnent , nvort , initvo , &
+ icas , itlivo , isgmvo , idepvo , &
+ iclvor , ndat
+
+! NNENT : NOMBRE D ENTREES UTILISEES
+! NVORT : NOMBRE DE VORTEX
+! INITVO : INDICATEUR DE REINITIALISATION
+! ICAS : TYPE DE GEOMETRIE POUR L'ENTREE
+! ITLIVO : TYPE DE MODELE POUR LA DUREE DE VIE
+! ISGMVO : TYPE DE MODELE POUR LA TAILLE DES VORTEX
+! IDEPVO : TYPE DE MODELE POUR LA MARCHE EN TEMPS
+! ICLVOR : TYPE DE CONDITION AUX LIMITES
+! NDAT : NOMBRE DE LIGNES DU FICHIER DE DONNEES
+
+! -------
+! DONNEES
+! -------
+
+double precision tlimvo(nentmx), xsgmvo(nentmx), ud(nentmx), &
+ xdat(ndatmx,nentmx), &
+ ydat(ndatmx,nentmx), zdat(ndatmx,nentmx), &
+ udat(ndatmx,nentmx), &
+ vdat(ndatmx,nentmx), wdat(ndatmx,nentmx), &
+ dudat(ndatmx,nentmx), &
+ kdat(ndatmx,nentmx), epsdat(ndatmx,nentmx), &
+ udebit(nentmx), kdebit(nentmx), edebit(nentmx), &
+ dir1(3,nentmx), dir2(3,nentmx), dir3(3,nentmx), &
+ cen(3,nentmx) , surf(3,nentmx), &
+ ymax(nentmx) , ymin(nentmx), &
+ zmax(nentmx) , zmin(nentmx), &
+ xsurfv(nentmx), llz(nentmx), &
+ lly(nentmx) , lld(nentmx)
+
+common /roptvo/ tlimvo , xsgmvo , ud , &
+ xdat , ydat , zdat , &
+ udat , vdat , wdat , &
+ dudat , kdat , &
+ epsdat , udebit , kdebit , edebit , &
+ dir1 , dir2 , dir3 , cen , surf , &
+ ymax , ymin , zmax , zmin , &
+ xsurfv , llz , lly , lld
+
+
+! TLIMVO : TEMPS DE VIE MAX DES VORTEX IMPOSE PAR L'UTILISATEUR
+! XSGMVO : DIAMETRE DES VORTEX IMPOSE PAR L'UTILISATEUR
+! UD : VITESSE DE DEPLACEMENT (MAX) IMPOSEE PAR L'UTILISATEUR
+! XDAT, ... : COORDONNEES DES POINTS OU SONT CONNUES LES DONNEES
+! UDAT : VITESSE MOYENNE PRINCIPALE (FICHIER DE DONNEES)
+! VDAT,WDAT : VITESSE MOYENNE TRANSVERSE (FICHIER DE DONNEES)
+! DUDAT : DERIVE NORMALE DE LA VITESSE PRINCIPALE (FICHIER D'ENTREE)
+! KDAT : EC MOYENNE (FICHIER D'ENTREE)
+! EPSDAT : DISSIPATION (FICHIER D'ENTREE)
+! UDEBIT : VITESSE MOYENNE IMPOSEE PAR L'UTILISATEUR EN ENTREE
+! KDEBIT : EC IMPOSEE PAR L'UTILISATEUR EN ENTREE
+! EDEBIT : DISSIPATION IMPOSEE PAR L'UTILISATEUR EN ENTREE
+! DIR1,... : VECTEURS DEFINISSANT LE REPERE LOCAL DANS LE PLAN D'ENTREE
+! CEN : COORDONNEES DU CENTRE DE L'ENTREE
+! SURF : VECTEUR SURFACE DU PLAN D'ENTREE (SUPPOSEE PLANE)
+! XMAX,... : DIMENSIONS MAX DE L'ENTREE DANS LE REPERE LOCAL
+! LLZ,LLY,LLD : DIMENSIONS DE L'ENTREE DANS LE CALCUL
+
+character*50 ficvor(nentmx)
+common /coptvo/ ficvor
+
+! FICVOR : NOM DU FICHIER DE DONNEE
diff --git a/include/cfbl/cfpoin.h b/include/cfbl/cfpoin.h
new file mode 100644
index 0000000..6131d9d
--- /dev/null
+++ b/include/cfbl/cfpoin.h
@@ -0,0 +1,45 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! cfpoin.h
+!===============================================================================
+
+
+! ACCESSIBLES DIRECTEMENT DANS IA, RA
+
+! Pointeur Dimension Description
+! IIFBET ! NFABOR*NPHAS ! INDICATEUR FLUX THERMIQUE AU BORD IMPOSE
+! (il faut annuler des contributions de bord
+! de l'eq de E)
+! IIFBRU ! NFABOR*NPHAS ! INDICATEUR FLUX DE BORD CALCULE PAR RUSANOV
+! (il faut annuler des contributions de bord
+! de l'eq de Qdm et de l'eq de E)
+
+integer iifbet , iifbru
+common / ipfbcf/ iifbet , iifbru
+
+! FIN
diff --git a/include/cogz/coincl.h b/include/cogz/coincl.h
new file mode 100644
index 0000000..0316ac4
--- /dev/null
+++ b/include/cogz/coincl.h
@@ -0,0 +1,137 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! coincl.h
+
+!===============================================================================
+
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE RELATIF A
+! LA COMBUSTION GAZ
+
+! Necessite ppppar.h
+
+!-------------------------------------------------------------------------------
+
+!--> MODELE FLAMME DE DIFFUSION (CHIMIE 3 POINTS)
+
+! ---- Grandeurs fournies par l'utilisateur dans usd3pc.F
+
+! TINOXY --> Temperature d'entree pour l'oxydant en K
+! TINFUE --> Temperature d'entree pour le fuel en K
+! IENTOX --> indicateur oxydant par type de facette d'entree
+! IENTFU --> indicateur fuel par type de facette d'entree
+
+! ---- Grandeurs deduiites
+
+! HINOXY --> Enthalpie massique d'entree pour l'oxydant
+! HINFUE --> Enthalpie massique d'entree pour le fuel
+! HSTOEA --> Temperature a la stoechiometrie adiabatique
+! NMAXF --> Nb de points de tabulation en F
+! NMAXFM --> Nb maximal de points de tabulation en F
+! NMAXH --> Nb de points de tabulation en H
+! NMAXHM --> Nb maximal de points de tabulation en H
+! HH --> Enthalpie stoechiometrique tabulee
+! FF --> Richesse tabulee
+! TFH(IF,IH) --> Tabulation richesse - enthalpie stoechiometrique
+
+integer nmaxf, nmaxfm, nmaxh, nmaxhm
+parameter( nmaxfm = 15 , nmaxhm = 15)
+integer ientox(nozppm), ientfu(nozppm)
+
+double precision tinoxy, tinfue, hinfue, hinoxy, hstoea
+double precision hh(nmaxhm), ff(nmaxfm), tfh(nmaxfm,nmaxhm)
+
+
+!--> MODELE FLAMME DE PREMELANGE (MODELE EBU)
+
+! ---- Grandeurs fournies par l'utilisateur dans usebuc.F
+
+! IENTGF --> indicateur gaz frais par type de facette d'entree
+! IENTGB --> indicateur gaz brules par type de facette d'entree
+! QIMP --> Debit impose en kg/s
+! FMENT --> Taux de melange par type de facette d'entree
+! TKENT --> Temperature en K par type de facette d'entree
+! FRMEL --> Taux de melange constant pour modeles 0 et 1
+! TGF --> Temperature gaz frais en K identique
+! pour premelange frais et dilution
+! CEBU --> Constante Eddy break-Up
+
+! ---- Grandeurs deduites
+
+! HGF --> Enthalpie massique gaz frais identique
+! pour premelange frais et dilution
+! TGBAD --> Temperature adiabatique gaz brules en K
+
+
+integer ientgf(nozppm), ientgb(nozppm)
+double precision fment(nozppm), tkent(nozppm), qimp(nozppm)
+double precision frmel, tgf, cebu, hgf, tgbad
+
+
+!--> DEFINITION DES COMMONS
+
+common / icocom / nmaxf , nmaxh , ientgf, ientgb, ientox, ientfu
+common / rcocom / tinoxy, tinfue, hinfue, hinoxy, hstoea, &
+ hh , ff , tfh , &
+ fment , tkent , qimp , &
+ frmel , tgf , cebu , &
+ hgf , tgbad
+
+
+!--> MODELE DE FLAMME DE PREMELANGE LWC
+
+! NDRACM : nombre de pics de Dirac maximum
+! NDIRAC : nombre de Dirac (en fonction du modele)
+ integer ndracm
+ parameter (ndracm = 5)
+
+ integer ndirac
+ common / ilwcdi / ndirac
+
+! --- Grandeurs fournies par l'utilisateur dans uslwc1.F
+
+! VREF : Vitesse de reference
+! LREF : Longueur de reference
+! TA : Temperature d'activation
+! TSTAR : Temperature de cross-over
+
+integer irhol(ndracm), iteml(ndracm), ifmel(ndracm)
+integer ifmal(ndracm), iampl(ndracm), itscl(ndracm)
+integer imaml(ndracm), ihhhh(ndracm), imam
+
+common / rlwcet / irhol, iteml, ifmel, ifmal, iampl, &
+ itscl, imaml, ihhhh, imam
+
+double precision vref, lref, ta, tstar
+double precision fmin, fmax, hmin, hmax
+double precision coeff1, coeff2, coeff3
+
+common / rlwcst / vref, lref, ta, tstar, &
+ fmin, fmax, hmin, hmax, &
+ coeff1, coeff2, coeff3
+
+
diff --git a/include/cplv/cpincl.h b/include/cplv/cpincl.h
new file mode 100644
index 0000000..4860bae
--- /dev/null
+++ b/include/cplv/cpincl.h
@@ -0,0 +1,315 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! cpincl.h
+
+!===============================================================================
+
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE RELATIF
+! A LA COMBUSTION DU CHARBON PULVERISE
+
+! Necessite ppppar.h et ppthch
+!-------------------------------------------------------------------------------
+
+!--> POINTEURS VARIABLES COMBUSTION CHARBON PULVERISE cpincl, ppincl
+
+! -------voir ppppar
+!C NCHARM --> Nombre maximal de charbons
+!C NCPCMX --> Nombre maximal de classes par charbon
+!C NCLCPM --> Nombre total de classes
+!C
+! INTEGER NCHARM , NCPCMX , NCLCPM
+! PARAMETER (NCHARM=3, NCPCMX=10, NCLCPM=NCHARM*NCPCMX)
+
+!C ------
+! EPSICP : Precision pour les tests
+
+ double precision epsicp
+ parameter ( epsicp = 1.d-8 )
+
+
+!--> DONNEES RELATIVES AU CHARBON
+
+! NCHARB --> Nombre de charbons
+integer ncharb
+
+! ---- PAR CHARBON (grandeurs fournies)
+
+! - Distribution granulometrique
+! NCLPCH(CH) --> Nombre de classes par charbon
+
+integer nclpch(ncharm)
+
+! - Proprietes sur charbon sec
+! CCH(CH) --> Composition elementaire en C, H, O sur sec (%)
+! HCH(CH) du charbon
+! OCH(CH)
+! ALPHA(CH) --> Composition du charbon reactif
+! BETA(CH) sous la forme CH(ALPHA)O(BETA)
+! ALPHA(CH) = HCH(CH)/CCH(CH)
+! BETA(CH) = OCH(CH)/CCH(CH)
+! ALPHAM --> ALPHA moyen
+! BETAM --> BETA moyen
+! PCICH(CH) --> PCI (J/kg) charbon
+! RHO0CH(CH) --> Masse volumique initiale (kg/m3)
+! - Proprietes sur charbon sec du coke
+! CCK(CH) --> Composition elementaire en C, H, O sur sec (%)
+! HCK(CH) du coke
+! OCK(CH)
+! GAMMA(CH) --> Composition du coke
+! DELTA(CH) sous la forme CH(GAMMA)O(DELTA)
+! GAMMA(CH) = HCK(CH)/CCK(CH)
+! DELTA(CH) = OCK(CH)/CCK(CH)
+! PCICK(CH) --> PCI (J/kg) coke
+! RHOCK(CH) --> Masse volumique coke
+! - Proprietes sur charbon sec des cendres (ou humide)
+! XASHCH(CH) --> Taux de cendre (kg/kg)
+! CPASHC(CH) --> CP des cendres (J/kg/K)
+! H0ASHC(CH) --> Enthalpie de formation des cendres (J/kg)
+! H02CH --> H0 du Charbon
+! CPCH --> CP du Charbon
+! XWATCH(CH) --> Taux d'humidite (kg/kg)
+
+double precision cch (ncharm), hch (ncharm), och (ncharm), &
+ alpha (ncharm), beta (ncharm), alpham, betam , &
+ pcich (ncharm), rho0ch(ncharm), &
+ cck (ncharm), hck (ncharm), ock (ncharm), &
+ gamma (ncharm), delta (ncharm), &
+ rhock (ncharm), pcick (ncharm), &
+ xashch(ncharm), cpashc(ncharm), &
+ h0ashc(ncharm), &
+ h02ch (ncharm), cp2ch (ncharm), &
+ xwatch(ncharm), cp2wat(ncharm)
+
+! - Parametres cinetiques pour la devolatilisation
+! (Modele de Kobayashi)
+! IY1CH(CH) --> Indicateur : 0 si MVl = {CH4;CO}
+! 1 si MVl = {CHz;CO}
+! Y1CH(CH) --> Coefficient stoechiometrique (adim)
+! calcule si IY1CH = 0 ; donne si IY1CH = 1
+! A1CH(CH) --> Facteur pre-exponetielle (1/s)
+! E1CH(CH) --> Energie d'activation (J/mol)
+! IY2CH(CH) --> Indicateur : 0 si MVL = {C2H4;CO}
+! 1 si MVL = {CxHy;CO}
+! Y2CH(CH) --> Coefficient stoechiometrique (adim)
+! calcule si IY2CH = 0 ; donne si IY2CH = 1
+! A2CH(CH) --> Constante preexponetielle (1/s)
+! E2CH(CH) --> Energie d'activation (J/mol)
+! - Parametres cinetiques pour la combustion heterogene du coke avec O2
+! (Modele a sphere retrecissante)
+! AHETCH(CH) --> Constante pre-exponentielle (kg/m2/s/atm)
+! EHETCH(CH) --> Energie d'activation (kcal/mol)
+! IOCHET(CH) --> Ordre de la reaction 0.5 si = 0 1 si = 1
+
+! - Parametres cinetiques pour la combustion heterogene du coke avec CO2
+! (Modele a sphere retrecissante)
+! AHETC2(CH) --> Constante pre-exponentielle (kg/m2/s/atm)
+! EHETC2(CH) --> Energie d'activation (kcal/mol)
+! IOETC2(CH) --> Ordre de la reaction 0.5 si = 0 1 si = 1
+
+integer iy1ch (ncharm), iy2ch (ncharm)
+integer iochet (ncharm) , ioetc2(ncharm)
+double precision y1ch (ncharm), a1ch (ncharm), e1ch (ncharm), &
+ y2ch (ncharm), a2ch (ncharm), e2ch (ncharm), &
+ ahetch(ncharm), ehetch(ncharm), &
+ ahetc2(ncharm), ehetc2(ncharm)
+
+! - Enthalpie du charbon reactif, coke et cendres
+! ICH(CH) --> Pointeur dans le tableau EHSOLI pour
+! le Charbon Reactif
+! ICK(CH) --> Pointeur dans le tableau EHSOLI pour
+! le Coke
+! IASH(CH) --> Pointeur dans le tableau EHSOLI pour
+! les cendres
+! IWAT(CH) --> Pointeur dans le tableau EHSOLI pour
+! l'humidite
+! NSOLID --> Nb constituants solides (Ch.Reactif, Coke, Ash)
+! NSOLIM --> Nb maximal de constituants solides
+! EHSOLI(S,IT) --> Enthalpie massique (J/kg) du constituant solide
+! no S a la temperature T(IT)
+! WMOLS(S) --> Masse molaire du constituant solide
+! EH0SOL(S) --- Enthalpie de formation (J/kg) du constituant solide
+! no S
+
+integer nsolim
+parameter( nsolim = 4*ncharm )
+
+integer nsolid, ich(ncharm), ick(ncharm), iash(ncharm)
+integer iwat(ncharm)
+double precision ehsoli(nsolim,npot), wmols(nsolim)
+double precision eh0sol(nsolim)
+
+! ---- PAR CLASSES (grandeurs deduites)
+
+! NCLACP --> Nb de classes
+
+integer nclacp
+
+! - Proprietes
+! ICHCOR(CL) --> = ICH si la classe consideree appartient
+! au charbon ICH (1, 2, ...)
+! DIAM20(CL) --> Diametre initial (m)
+! DIA2MN(CL) --> Diametre minimum (m)
+! RHO20(CL) --> Masse volumique initiale (kg/m3)
+! RHO2MN(CL) --> Masse volumique minimale (kg/m3)
+! XMP0(CL) --> Masse initiale de la particule (m)
+! XMASH(CL) --> Masse de cendres de la particule (m)
+
+integer ichcor(nclcpm)
+double precision diam20(nclcpm), dia2mn(nclcpm), &
+ rho20 (nclcpm), rho2mn(nclcpm), &
+ xmp0 (nclcpm), xmash (nclcpm)
+
+!--> DONNEES RELATIVES AUX OXYDANTS
+
+
+! NOXYD --> Nombre d'Oxydants (Maximum 3)
+
+integer noxyd
+
+! OXYO2 --> composition des oxydants en O2
+! OXYN2 --> composition des oxydants en N2
+! OXYH2O --> composition des oxydants en H2O
+! OXYCO2 --> composition des oxydants en CO2
+
+double precision oxyo2(3),oxyn2(3),oxyh2o(3),oxyco2(3)
+
+!--> DONNEES RELATIVES A LA COMBUSTION DES ESPECES GAZEUSES
+
+! ICHX1C(CH) --> Pointeur CHx1 pour EHGAZE et WMOLE
+! ICHX2C(CH) --> Pointeur CHx2 pour EHGAZE et WMOLE
+! ICHX1 --> Pointeur CHx1m pour EHGAZE et WMOLE
+! ICHX2 --> Pointeur CHx2m pour EHGAZE et WMOLE
+! ICO --> Pointeur CO pour EHGAZE et WMOLE
+! IO2 --> Pointeur O2 pour EHGAZE et WMOLE
+! ICO2 --> Pointeur CO2 pour EHGAZE et WMOLE
+! IH2O --> Pointeur H2O pour EHGAZE et WMOLE
+! IN2 --> Pointeur N2 pour EHGAZE et WMOLE
+! CHX1(CH) --> Composition de l'hydrocarbure relatif
+! au MVl : CH(X1)
+! CHX2(CH) --> Composition de l'hydrocarbure relatif
+! au MVL : CH(X2)
+! A1(CH), --> Coefficients stoechiometriques molaires pour
+! B1(CH) la reaction de devolatilisation a basses T
+! C1(CH)
+! A2(CH), --> Coefficients stoechiometriques molaires pour
+! B2(CH) la reaction de devolatilisation a basses T
+! C2(CH)
+
+integer ichx1c(ncharm), ichx2c(ncharm), &
+ ichx1, ichx2, ico, io2, ico2, ih2o, in2
+double precision chx1(ncharm), chx2(ncharm), &
+ a1(ncharm), b1(ncharm),c1(ncharm), &
+ a2(ncharm), b2(ncharm),c2(ncharm)
+
+!--> DONNEES COMPLEMENTAIRES RELATIVES AU CALCUL DE RHO
+! SUR LES FACETTES DE BORD
+
+! IENTAT(IENT) --> Indicateur air par type de facette d'entree
+! IENTCP(IENT) --> Indicateur CP par type de facette d'entree
+! INMOXY(IENT) --> Numero de l'oxydant
+! TIMPAT(IENT) --> Temperature en K pour l'air relative
+! a l'entree IENT
+! X20(IENT, --> Fraction massique dans le melange de charbon
+! ICLA ) de la classe ICLA relative a l'entree IENT
+
+integer ientat(nozppm), ientcp(nozppm)
+integer inmoxy(nozppm)
+double precision timpat(nozppm), x20(nozppm,nclcpm)
+
+!--> POINTEURS DANS LE TABLEAU TBMCR
+
+integer if1mc(ncharm) , if2mc(ncharm)
+integer ix1mc ,ix2mc, ichx1f1, ichx2f2
+integer icof1, icof2, ih2of1 , ih2of2
+
+!--> DEFINITION DES COMMONS
+
+common / icpcom / ncharb, nclpch, nclacp, iy1ch , iy2ch , &
+ ichcor, &
+ nsolid, ich , ick , iash , iwat , &
+ ichx1c, ichx2c, &
+ ichx1 , ichx2 , &
+ ico , io2 , ico2 , ih2o , in2 , &
+ ientat, ientcp, inmoxy, &
+ if1mc , if2mc , &
+ ix1mc , ix2mc , ichx1f1, ichx2f2, &
+ icof1 , icof2 , iochet , ioetc2 , &
+ ih2of1 , ih2of2 , noxyd
+
+common / rcpcom / cch , hch , och , &
+ alpha , beta , alpham, betam , &
+ pcich , rho0ch, &
+ cck , hck , ock , &
+ gamma , delta , &
+ rhock , pcick , &
+ xashch, cpashc, h0ashc, xwatch , &
+ h02ch , cp2ch , &
+ y1ch , a1ch , e1ch , y2ch , a2ch , e2ch , &
+ ahetch, ehetch, ahetc2 , ehetc2 , &
+ ehsoli, wmols , &
+ diam20, dia2mn, rho20 , rho2mn, &
+ xmp0 , xmash , &
+ chx1 , chx2 , &
+ a1 , b1 , c1 , a2 , b2 , c2 , &
+ timpat, x20 , &
+ eh0sol, cp2wat, oxyo2 , oxyn2 , oxyh2o, oxyco2
+
+!--> GRANDEURS FOURNIES PAR L'UTILISATEUR EN CONDITIONS AUX LIMITES
+! PERMETTANT DE CALCULER AUTOMATIQUEMENT LA VITESSE, LA TURBULENCE,
+! L'ENTHALPIE D'ENTREE.
+
+! POUR LES ENTREES UNIQUEMENT , IENT ETANT LE NUMERO DE ZONE FRONTIERE
+
+! QIMPAT(IENT) --> Debit Air en kg/s
+! TIMPAT(IENT) --> Temperature Air en K
+! QIMPCP(IENT,ICHA) --> Debit Charbon ICHA en kg/s
+! TIMPCP(IENT,ICHA) --> Temperature Charbon ICHA en K
+! DISTCH(IENT,ICHA,ICLA) --> Distribution en %masse de la classe ICLA
+! pour le charbon ICHA
+
+double precision qimpat(nozppm)
+double precision qimpcp(nozppm,ncharm), timpcp(nozppm,ncharm)
+double precision distch(nozppm,ncharm,ncpcmx)
+! DOUBLE PRECISION COEFE(NGAZEM), XSOLID(NSOLIM)
+! DOUBLE PRECISION F1MC(NCHARM) , F2MC(NCHARM)
+
+common / rcpcli / qimpat , &
+ qimpcp , timpcp , &
+ distch
+! & COEFE , XSOLID ,
+! & F1MC , F2MC
+
+! Complement Table
+
+ double precision thc(npot)
+ common/tablec/ thc
+
+ integer npoc
+ common/itablc/ npoc
+
+! FIN
diff --git a/include/ctwr/cs_ctwr.h b/include/ctwr/cs_ctwr.h
new file mode 100644
index 0000000..a43c782
--- /dev/null
+++ b/include/ctwr/cs_ctwr.h
@@ -0,0 +1,618 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_CTWR_H__
+#define __CS_CTWR_H__
+
+/*============================================================================
+ * Main for cooling towers related functions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_locator.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+typedef struct _cs_ctwr_zone_t cs_ctwr_zone_t;
+
+
+/* Cooling tower exchange zone structure definition */
+/*--------------------------------------------------*/
+
+struct _cs_ctwr_zone_t {
+
+ int idimct; /* Problem dimension (2 or 3) */
+ int num; /* Exchange zone number */
+ char *ze_name; /* Exchange zone elements name */
+ int imctch; /* 0: None; 1: Poppe's model; 2: Merkel's model */
+ int ntypct; /* 1: Counter currents; 2: Crossed-currents;
+ 3: Rain zone */
+ int nelect; /* Number of nodes on each vertical mesh for
+ the water mesh */
+
+ cs_real_t hmin; /* Minimum vertical height of exchange zone */
+ cs_real_t hmax; /* Maximum height of exchange zone */
+ cs_real_t deltat; /* Temperature delta required for exchange zone */
+
+ cs_real_t cl_teau; /* Water entry temperature */
+ cs_real_t cl_fem; /* Water flow */
+
+ cs_real_t xap; /* Exchange law lambda coefficient */
+ cs_real_t xnp; /* Exchange law n exponent */
+
+ cs_real_t surface_in; /* Water inlet surface */
+ cs_real_t surface_out; /* Water outlet surface */
+ cs_real_t surface; /* Total surface */
+
+ cs_int_t nnpsct; /* Number of points on top face */
+
+ cs_int_t nbfac_sct; /* Number of top "interior faces" */
+ cs_int_t nbfac_ict; /* Number of bottom "interior faces" */
+ cs_int_t nbfac_lct; /* Number of lateral "interior faces" */
+ cs_int_t nbfac_ct; /* Number of inside "interior faces" */
+ cs_int_t nbfbr_sct; /* Number of top "boundary faces" */
+ cs_int_t nbfbr_ict; /* Number of bottom "boundary faces" */
+ cs_int_t nbfbr_lct; /* Number of lateral "boundary faces" */
+
+ cs_int_t nbevct; /* Number of air cells belonging to the zone */
+
+ cs_int_t id_amont; /* Number of upstream exchange zone (if any) */
+
+ fvm_nodal_t *face_sup_mesh; /* Nodal Mesh of the zone's top faces */
+ fvm_nodal_t *face_inf_mesh; /* Nodal mesh of the zone's bottom faces */
+ fvm_nodal_t *face_lat_mesh; /* Nodal mesh of the zone's lateral faces */
+ fvm_nodal_t *cell_mesh; /* Nodal mesh of cells in the zone */
+ fvm_nodal_t *fac_mesh; /* Nodal mesh of internal faces in the zone */
+
+ fvm_nodal_t *water_mesh; /* Nodal mesh of water in the exchange area */
+
+ cs_int_t *ze_cell_list; /* List of cells of ct criteria */
+ cs_int_t *voiseau; /* List of water neighbors of air cells */
+ cs_int_t *pvoiseau; /* Positions in the list of water neighbors */
+ cs_int_t *voisair; /* List of air neighbors of water points */
+ cs_int_t *pvoisair; /* Positions in the list of air neighbors */
+ cs_int_t *mark_ze; /* Cell marker for ct */
+
+ cs_int_t *fac_sup_connect_idx; /* Top faces point connectivity index */
+ cs_int_t *fac_sup_connect_lst; /* Top faces point connectivity */
+
+ cs_real_t *surf_fac_sup; /* Top faces surfaces */
+
+ cs_real_t *coefeau; /* Water -> air interpolation coefficients */
+ cs_real_t *coefair; /* Air -> water interpolation coefficients */
+
+ cs_real_t *teau; /* Water temperature field */
+ cs_real_t *fem; /* Water flow field */
+ cs_real_t *vgoutte; /* Water drop velocity field (rain zones) */
+
+ cs_real_t fem_e; /* Water entry flow */
+ cs_real_t fem_s; /* Water exit flow */
+ cs_real_t teau_e; /* Mean water entry temperature */
+ cs_real_t teau_s; /* Mean water exit temperature */
+ cs_real_t heau_e; /* Mean water entry enthalpy */
+ cs_real_t heau_s; /* Mean water exit enthalpy */
+ cs_real_t tair_e; /* Mean air entry temperature */
+ cs_real_t tair_s; /* Mean air exit temperature */
+ cs_real_t xair_e; /* Mean air entry humidity */
+ cs_real_t xair_s; /* Mean air exit humidity */
+ cs_real_t hair_e; /* Mean air entry enthalpy */
+ cs_real_t hair_s; /* Mean air exit enthalpy */
+ cs_real_t debit_e; /* Air entry flow */
+ cs_real_t debit_s; /* Air exit flow */
+
+ cs_real_t dgout; /* Drop diameter for rain zones */
+
+ fvm_locator_t *locat_air_water; /* Locator water -> air interpolation */
+ fvm_locator_t *locat_water_air; /* Locator for air -> water interpolation */
+ fvm_locator_t * *locat_cell_ct_upwind;
+
+ cs_int_t post_mesh_id; /* 0 if post-processing is not active,
+ mesh_id if post-processing is active */
+
+ /* Parallelism and/or periodic features */
+
+ cs_halo_type_t halo_type; /* Halo type */
+
+ cs_int_t *cs_array_rank; /* Array of process ranks which
+ have an exchange area */
+ cs_int_t nnpsct_with_ghosts; /* Total number of water nodes
+ (nnpsct + n_ghost_wcells) */
+
+ cs_halo_t *water_halo; /* Structure used to manage ghost cells */
+
+};
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* array of exchanges area */
+
+
+extern cs_int_t cs_glob_ct_nbr_max;
+extern cs_int_t cs_glob_ct_nbr;
+extern cs_ctwr_zone_t ** cs_glob_ct_tab;
+
+/* array containing the stacking of the exchange area*/
+extern cs_int_t * cs_stack_ct;
+
+/* array containing the treatment order of the exchanges areas */
+extern cs_int_t * cs_chain_ct;
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define an exchange zone
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DEFCT1
+ * *****************
+ *
+ * INTEGER IDIMCT : --> : problem dimension (2 or 3)
+ * INTEGER IMCTCH : --> : 1: Poppe's Model; 2: Merkel's model
+ * INTEGER NTYPCT : --> : 1: Counter-currents
+ * : : 2: Crossed-currents
+ * : : 3: Rain zones
+ * INTEGER NELECT : --> : number of nodes on each water line
+ * : : (i.e. vertical resolution)
+ * DOUBLE PRECISION DELTAT : --> : imposed water infow/outflow
+ * : --> : temperature delta
+ * DOUBLE PRECISION TEAU : --> : water inlet mean temperature
+ * DOUBLE PRECISION FEM : --> : water inlet flow
+ * DOUBLE PRECISION XAP : --> : exchange law lambda coeffcient
+ * DOUBLE PRECISION XNP : --> : exchange law n exponent
+ * DOUBLE PRECISION DGOUT : --> : drop diameter for rain zones
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (defct1, DEFCT1)
+(
+ const cs_int_t *idimct,
+ const char *zecrit,
+ cs_int_t *ze_n_len,
+ const cs_int_t *imctch,
+ const cs_int_t *ntypct,
+ const cs_int_t *nelect,
+ const cs_real_t *deltat,
+ const cs_real_t *teau,
+ const cs_real_t *fem,
+ const cs_real_t *xap,
+ const cs_real_t *xnp,
+ const cs_real_t *surface,
+ const cs_real_t *dgout
+);
+
+/*----------------------------------------------------------------------------
+ * Get number of cooling tower exchange zones.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NBZECT
+ * *****************
+ *
+ * INTEGER NBRCTZ : --> : number of exchange zones
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (nbzect, NBZECT)
+(
+ cs_int_t *nbrctz
+);
+
+/*----------------------------------------------------------------------------
+ * Indicate if the cooling tower model used is that of Poppe or Merkel.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE AEMODE
+ * *****************
+ *
+ * INTEGER IMCTCH : --> : model type (1: Poppe; 2: Merkel)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aemode, AEMODE)
+(
+ cs_int_t *imctch
+);
+
+/*----------------------------------------------------------------------------
+ * Add a constant to the temperature vector for all exchange zones.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE AEPROT
+ * *****************
+ *
+ * DOUBLE PRECISION DELTA : --> : type de ct (Poppe ou Merkel)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aeprot, AEPROT)
+(
+ cs_real_t *delta
+);
+
+/*----------------------------------------------------------------------------
+ * Resolution of water variables
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE AETEAU ( )
+ *
+ * DOUBLE PRECISION TEMP(*) : --> : air temperature
+ * DOUBLE PRECISION XA(*) : --> : air humidity
+ * DOUBLE PRECISION RHO(*) : --> : air density
+ * DOUBLE PRECISION VITX(*) : --> : air velocity component (x)
+ * DOUBLE PRECISION VITY(*) : --> : air velocity component (y)
+ * DOUBLE PRECISION VITZ(*) : --> : air velocity component (z)
+ * DOUBLE PRECISION GX : --> : gravity component x
+ * DOUBLE PRECISION GY : --> : gravity component y
+ * DOUBLE PRECISION GZ : --> : gravity component z
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aeteau, AETEAU)
+(
+ cs_real_t temp[],
+ cs_real_t xa[],
+ cs_real_t rho[],
+ cs_real_t vitx[],
+ cs_real_t vity[],
+ cs_real_t vitz[]
+);
+
+/*----------------------------------------------------------------------------
+ * Calculation of source terms for air equations
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE AETSSC
+ * *****************
+ *
+ * INTEGER ISCAL : : scalar number
+ * DOUBLE PRECISION TEMP : : air temperature
+ * DOUBLE PRECISION XA : : air humidity
+ * DOUBLE PRECISION RHO : : air density
+ * DOUBLE PRECISION UTSIM : : implicite source term
+ * DOUBLE PRECISION UTSEX : : explicite source term
+ * DOUBLE PRECISION VITX : : air velocity along x
+ * DOUBLE PRECISION VITY : : air velocity along y
+ * DOUBLE PRECISION VITZ : : air velocity along z
+ * DOUBLE PRECISION GX : : x component of the gravity vector
+ * DOUBLE PRECISION GY : : y component of the gravity vector
+ * DOUBLE PRECISION GZ : : z component of the gravity vector
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aetssc, AETSSC)
+(
+ const cs_int_t *iscal,
+ cs_real_t temp[],
+ cs_real_t xa[],
+ cs_real_t rho[],
+ cs_real_t utsim[],
+ cs_real_t utsex[],
+ cs_real_t vitx[],
+ cs_real_t vity[],
+ cs_real_t vitz[]
+);
+
+/*----------------------------------------------------------------------------
+ * Calculation of induced head loss in rain zones
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE AETSVI
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aetsvi, AETSVI)
+(
+ const cs_int_t *const idim,
+ const cs_real_t rho[], /* masse volumique air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[], /* vitesse air suivant z */
+ const cs_real_t xair[], /* humidite de l'air */
+ cs_real_t utsex[] /* terme source explicite */
+);
+
+/*----------------------------------------------------------------------------
+ * Bilan dans les ct
+ *
+ * Fortran interface:
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE BILANct ( )
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (bilanct, BILANCT)
+(
+ const cs_real_t *const time,
+ cs_real_t fem_entree[], /* debit eau entree */
+ cs_real_t fem_sortie[], /* debit eau sortie */
+ cs_real_t teau_entree[], /* temperature eau entree */
+ cs_real_t teau_sortie[], /* temperature eau sortie */
+ cs_real_t heau_entree[], /* enthalpie eau entree */
+ cs_real_t heau_sortie[], /* enthalpie eau sortie */
+ cs_real_t tair_entree[], /* temperature air entree */
+ cs_real_t tair_sortie[], /* temperature air sortie */
+ cs_real_t xair_entree[], /* */
+ cs_real_t xair_sortie[], /* */
+ cs_real_t hair_entree[], /* */
+ cs_real_t hair_sortie[], /* */
+ cs_real_t debit_entree[], /* */
+ cs_real_t debit_sortie[], /* */
+
+ const cs_real_t temp[], /* Temperature air */
+ const cs_real_t xa[], /* humidite air */
+ const cs_real_t flux_masse_fac[], /* vitesse verticale air */
+ const cs_real_t flux_masse_fbr[], /* vitesse horizontale air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[] /* vitesse air suivant z */
+);
+
+/*----------------------------------------------------------------------------
+ * Initialize post processing.
+ *
+ * Fortran interface:
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PSTICT
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(pstict, PSTICT)
+(
+ void
+);
+
+/*----------------------------------------------------------------------------
+ * Write the restart file of the cooling tower module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECT1D
+ * *****************
+ *
+ * CHARACTER NOMSUI : <-- : Name of the restart file
+ * INTEGER LNGNOM : <-- : Name length
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ecrctw, ECRCTW)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom
+);
+
+/*----------------------------------------------------------------------------
+ * Read the restart file of the cooling tower module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECT1D
+ * *****************
+ *
+ * CHARACTER NOMSUI : <-- : Name of the restart file
+ * INTEGER LNGNOM : <-- : Name length
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lecctw, LECCTW)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom
+);
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Definition d'une zone d'echange (qui est ajoute a celles deja definies)
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_definit
+(
+ const cs_int_t idimct, /* Dimemsion du probleme 2:2D 3:3D */
+ const char *ze_crit, /* Critere de selection */
+ const cs_int_t imctch, /* 1: Modele de Poppe
+ 2: Merkel
+ 0: Rien */
+ const cs_int_t ntypct, /* 1: Contre courant
+ 2: Courant croises
+ 3: Zone de pluie */
+ const cs_int_t nelect, /* Nombre d'elements sur chaque ligne
+ du maillage eau pour la zone de
+ noeuds par segment eau */
+ const cs_real_t deltat, /* Ecart de temperature impose en entree
+ de la zone d'echange */
+ const cs_real_t teau_cl, /* Teau en entree de la zone d'echange */
+ const cs_real_t fem_cl, /* debit en entree de la zone d'echange */
+ const cs_real_t xap, /* coefficient lambda de la loi d'echange */
+ const cs_real_t xnp, /* exposant n de la loi d'echange */
+
+ const cs_real_t surface, /* Surface arrivee d eau de la ct */
+
+ const cs_real_t dgout /* Diametre de goutte pour les zones
+ de pluie */
+);
+
+/*----------------------------------------------------------------------------
+ * Destruction des structures associees aux ventilateurs
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_all_destroy(void);
+
+/*----------------------------------------------------------------------------
+ * Resolution des variables eau
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_aeteau
+(
+ cs_real_t temp[], /* Temperature air */
+ cs_real_t xa[], /* humidite air */
+ cs_real_t rho[], /* masse volumique air */
+ cs_real_t vitx[], /* vitesse air suivant x */
+ cs_real_t vity[], /* vitesse air suivant y */
+ cs_real_t vitz[] /* vitesse air suivant z */
+);
+
+/*----------------------------------------------------------------------------
+ * Calcul des termes source pour l'air
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_aetssc
+(
+ const cs_int_t iscal, /* */
+
+ cs_real_t temp[], /* Temperature air */
+ cs_real_t xa[], /* humidite air */
+ cs_real_t rho[], /* masse volumique air */
+ cs_real_t utsim[], /* vitesse verticale air */
+ cs_real_t utsex[], /* vitesse horizontale air */
+ cs_real_t vitx[], /* vitesse air suivant x */
+ cs_real_t vity[], /* vitesse air suivant y */
+ cs_real_t vitz[] /* vitesse air suivant z */
+);
+
+/*----------------------------------------------------------------------------
+ * Calcul des PdC induites dans les zones de pluie
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_aetsvi
+(
+ const cs_int_t idim,
+ const cs_real_t rho[], /* masse volumique air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[], /* vitesse air suivant z */
+ const cs_real_t xair[], /* humidite de l'air */
+ cs_real_t utsex[] /* terme source explicite */
+);
+
+/*----------------------------------------------------------------------------
+ * Bilan dans les ct
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_bilanct
+(
+ const cs_real_t time, /* */
+ cs_real_t fem_entree[], /* debit eau entree */
+ cs_real_t fem_sortie[], /* debit eau sortie */
+ cs_real_t teau_entree[], /* temperature eau entree */
+ cs_real_t teau_sortie[], /* temperature eau sortie */
+ cs_real_t heau_entree[], /* enthalpie eau entree */
+ cs_real_t heau_sortie[], /* enthalpie eau sortie */
+ cs_real_t tair_entree[], /* temperature air entree */
+ cs_real_t tair_sortie[], /* temperature air sortie */
+ cs_real_t xair_entree[], /* */
+ cs_real_t xair_sortie[], /* */
+ cs_real_t hair_entree[], /* */
+ cs_real_t hair_sortie[], /* */
+ cs_real_t debit_entree[], /* */
+ cs_real_t debit_sortie[], /* */
+
+ const cs_real_t temp[], /* Temperature air */
+ const cs_real_t xa[], /* humidite air */
+ const cs_real_t flux_masse_fac[], /* vitesse verticale air */
+ const cs_real_t flux_masse_fbr[], /* vitesse horizontale air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[], /* vitesse air suivant z */
+ const cs_mesh_t *mesh, /* <-- structure maillage associee */
+ const cs_mesh_quantities_t *mesh_quantities /* <-- grandeurs du maillage */
+);
+
+/*----------------------------------------------------------------------------
+ * Initialict post-processing
+ *
+ * parameters:
+ * ct_id --> Id of exchange area
+ * writer_id --> Id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_post_init(cs_int_t ct_id,
+ cs_int_t writer_id);
+
+/*----------------------------------------------------------------------------
+ * Post process variables associated with exchange area
+ *
+ * parameters:
+ * coupling_id --> Id of exchange area
+ * nt_cur_abs --> Current time step
+ * t_cur_abs --> Current time value
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_post_function(cs_int_t ct_id,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs);
+
+/*----------------------------------------------------------------------------
+ * Get pointer to exchange area.
+ *
+ * parameters:
+ * ct_id <-- Id (0 to n-1) of exchange area
+ *
+ * returns:
+ * pointer to exchange area structure
+ *----------------------------------------------------------------------------*/
+
+cs_ctwr_zone_t *
+cs_ctwr_by_id(cs_int_t ct_id);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_CTWR_H__ */
diff --git a/include/ctwr/cs_ctwr_air_props.h b/include/ctwr/cs_ctwr_air_props.h
new file mode 100644
index 0000000..7bd3e53
--- /dev/null
+++ b/include/ctwr/cs_ctwr_air_props.h
@@ -0,0 +1,218 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_CTWR_AIR_PROPS_H__
+#define __CS_CTWR_AIR_PROPS_H__
+
+/*============================================================================
+ * Specific laws for air properties (temperature, enthalpy)
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Structure definition
+ *============================================================================*/
+
+/* Structure associated to general properties */
+
+typedef struct {
+
+ cs_real_t cpa; /* Capacite calorifique de l air */
+ cs_real_t cpv; /* Capacite calorifique de la vapeur */
+ cs_real_t cpe; /* Capacite calorifique de l eau */
+ cs_real_t hv0; /* Chaleur latente */
+ cs_real_t rhoe; /* Masse volumique de l eau*/
+ cs_real_t visc; /* Viscosite Dynamique */
+ cs_real_t cond; /* Conductivite */
+ cs_real_t gravx; /* Gravite x */
+ cs_real_t gravy; /* Gravite y */
+ cs_real_t gravz; /* Gravite z */
+
+} cs_ctwr_fluid_props_t;
+
+extern cs_ctwr_fluid_props_t *cs_glob_ctwr_props;
+
+/* Structure associated to air properties */
+
+typedef struct {
+
+ cs_real_t rho_ref; /* Reference density */
+ cs_real_t p_ref; /* Reference pressure */
+ cs_real_t t_ref; /* Reference temperature */
+ cs_real_t delta;
+
+ cs_real_t g[3]; /* Gravity vector */
+
+} cs_ctwr_air_props_t;
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Calculation of the air humidity at saturation for a given temperature
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE XSATH
+ * ****************
+ *
+ * DOUBLE PRECISION TH : <- : temperature in Celsius degree
+ * DOUBLE PRECISION XSAT : -> : absolute humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (xsath, XSATH)
+(
+ const cs_real_t *th,
+ cs_real_t *xsat
+);
+
+/*----------------------------------------------------------------------------
+ * Calculation of the derivative of the absolute humidity at saturation
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DXSATH
+ * *****************
+ *
+ * DOUBLE PRECISION TH : <- : temperature in Celsius degree
+ * DOUBLE PRECISION DXSAT : -> : derivative of the humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (dxsath, DXSATH)
+(
+ const cs_real_t *th,
+ cs_real_t *dxsat
+);
+
+/*----------------------------------------------------------------------------
+ * Communication des proprietes physiques
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE COMPPF
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ctprof, CTPROF)
+(
+ const cs_real_t *cpa, /* Capacite calorifique de l air */
+ const cs_real_t *cpv, /* Capacite calorifique de la vapeur */
+ const cs_real_t *cpe, /* Capacite calorifique de l eau */
+ const cs_real_t *hv0, /* Chaleur latente */
+ const cs_real_t *rhoe, /* Masse volumique de l eau*/
+ const cs_real_t *visc, /* Viscosite Dynamique */
+ const cs_real_t *cond, /* Conductivite */
+ const cs_real_t *gravx, /* Gravite x */
+ const cs_real_t *gravy, /* Gravite y */
+ const cs_real_t *gravz /* Gravite z */
+);
+
+/*============================================================================
+ * Prototypes of public function
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Calculation of the air humidity at saturation for a given temperature
+ *
+ * parameters:
+ * th <-- temperature in Celsius degree
+ *
+ * returns:
+ * absolute humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_xsath(const cs_real_t th);
+
+/*----------------------------------------------------------------------------
+ * Calculation of moist air mass enthalpy
+ *
+ * parameters:
+ * xair <-- absolute humidity of saturated air
+ * tair <-- air temperature in Celsius degree
+ *
+ * returns:
+ * air mass enthalpy
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_enthair(const cs_real_t xair,
+ const cs_real_t tair);
+
+/*----------------------------------------------------------------------------
+ * Calculation water mass enthalpy
+ *
+ * parameters:
+ * teau <-- water temperature in Celsius degree
+ *
+ * returns:
+ * water mass enthalpy
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_heau(const cs_real_t teau);
+
+/*----------------------------------------------------------------------------
+ * Calculation of the derivate of the absolute humidity at saturation
+ *
+ * parameters:
+ * th <-- temperature in Celsius degree
+ *
+ * returns:
+ * derivative of the humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_dxsath(const cs_real_t th);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_CTWR_AIR_PROPERTIES_H__ */
diff --git a/include/ctwr/cs_ctwr_halo.h b/include/ctwr/cs_ctwr_halo.h
new file mode 100644
index 0000000..47f4071
--- /dev/null
+++ b/include/ctwr/cs_ctwr_halo.h
@@ -0,0 +1,85 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_CTWR_HALO_H__
+#define __CS_CTWR_HALO_H__
+
+/*============================================================================
+ * Structure and function headers handling with ghost cells
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_interface.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_ctwr.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*---------------------------------------------------------------------------
+ * Reverse "ghost cells -> vertex" connectivity into "vertex -> ghost cells"
+ * connectivity for out_halo elements.
+ * Build the connectivity list.
+ *
+ * parameters:
+ *---------------------------------------------------------------------------*/
+
+void
+cs_reverse_vtx_faces_connect(const fvm_nodal_t *this_nodal,
+ cs_int_t *faces_vtx_idx[],
+ cs_int_t *faces_vtx_lst[]);
+
+/*----------------------------------------------------------------------------
+ * Define halo structures for internal and distant ghost cells.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_ctwr_halo_define(cs_ctwr_zone_t *ct,
+ fvm_interface_set_t *interface_set);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_CTWR_HALO_H__ */
diff --git a/include/ctwr/cs_ctwr_mesh.h b/include/ctwr/cs_ctwr_mesh.h
new file mode 100644
index 0000000..997edc8
--- /dev/null
+++ b/include/ctwr/cs_ctwr_mesh.h
@@ -0,0 +1,104 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_CTWR_MESH_H__
+#define __CS_CTWR_MESH_H__
+
+/*============================================================================
+ * Specific mesh functions for cooling towers modelling
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create nodal coupled mesh.
+ * Send vertices's coordinates and connectivity of coupled mesh.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE GEOct
+ * *****************
+ *
+ * INTEGER n_ct : <-- : number of exchange area
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(geoct, GEOCT) (void);
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Construction du maillage eau
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_maille
+(
+ const cs_mesh_t *mesh, /* <-- structure maillage associee */
+ const cs_mesh_quantities_t *mesh_quantities /* <-- grandeurs du maillage */
+);
+
+/*----------------------------------------------------------------------------
+ * Interpolation AIR -> EAU
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_adeau(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities);
+
+/*----------------------------------------------------------------------------
+ * Interpolation EAU -> AIR
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_adair (void);
+
+/*----------------------------------------------------------------------------*
+ * Chaining of the exchange area *
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_stacking (void);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_CTWR_MESH_H__ */
diff --git a/include/ctwr/ctincl.h b/include/ctwr/ctincl.h
new file mode 100644
index 0000000..148a7ed
--- /dev/null
+++ b/include/ctwr/ctincl.h
@@ -0,0 +1,53 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! ctincl.h
+
+!===============================================================================
+
+! INCLUDE POUR LE MODULE AEROREFRIGERANTS
+
+!-------------------------------------------------------------------------------
+
+! IAEERI : ACTIVATION DE L'ECART IMPOSE
+! IAEERP : FREQUENCE DE MODIFICATION DE LA TEMPERATURE
+
+integer iaeeri, iaeerp, nbzsup, nbzinf
+
+common / ictvar / iaeeri, iaeerp, nbzsup, nbzinf
+
+! VAEERI : ECART DE REFRIGERATION A IMPOSER
+! PASERI : PAS DE TEMPERATURE POUR LE CALCUL DE LA PENTE DE ECARTREF(TEAU)
+! AETEMN : MINIMUM DE LA TEMPERATURE D'EAU REFROIDIE MOYENNE PONDEREE
+! AETEMX : MAXIMUM DE LA TEMPERATURE D'EAU CHAUDE MOYENNE PONDEREE
+
+double precision vaeeri, paseri, aetemn, aetemx, inbaei, &
+ lizsup(100), lizinf(100)
+
+common / rctvar / vaeeri, paseri, aetemn, aetemx, inbaei, &
+ lizsup, lizinf
+
diff --git a/include/elec/elincl.h b/include/elec/elincl.h
new file mode 100644
index 0000000..72b62ef
--- /dev/null
+++ b/include/elec/elincl.h
@@ -0,0 +1,165 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! elincl.h
+
+!===============================================================================
+
+! INCLUDE POUR LES VERSION ELECTRIQUES
+
+!-------------------------------------------------------------------------------
+
+!--> DEFINITION DES PARAMETERS
+! =========================
+
+! PERMVI : Mu zero, permeabilite magnetique du vide H/m
+! EPSZER : Epsilon zero, permittivite du vide F/m
+
+double precision permvi , epszer
+parameter ( permvi = 1.2566d-6, epszer = 8.854d-12 )
+
+!--> DONNEES EN COMMON POUR LE CHAUFFAGE EFFET JOULE
+! ===============================================
+
+! TH, NPOT et NPO sont deja dans ppthch.h
+
+! ----- Fournies par l'utilisateur
+! IENTM1 --> indicateur entree matiere premiere
+! IELPH1 --> indicateur electrode phase 1
+! IELPH2 --> indicateur electrode phase 2
+! IELPH3 --> indicateur electrode phase 3
+! IELNEU --> indicateur electrode neutre
+! ENH --> tabulation enthalpie(temperature)
+! USRHO --> - - - - - inverse masse volumique - - -
+! SIG --> - - - - - conductivite - - - -
+! KAB --> - - - - - coeff absorption - -
+! VIS --> - - - - - viscosite - - - - - -
+! LCP --> - - - - - Lambda/Cp
+
+integer ientm1(ntypmx),ielph1(ntypmx),ielph2(ntypmx)
+integer ielph3(ntypmx),ielneu(ntypmx)
+common / ichjou / ientm1 ,ielph1 ,ielph2 , &
+ ielph3 ,ielneu
+
+
+! ENHEL --> tabulation enthalpie (temperature)
+! RHOEL --> - - - - - masse volumique - - -
+! CPEL --> - - - - - CP - - -
+! SIGEL --> - - - - - conductivite elec - - - -
+! XLABEL --> - - - - - conductivite thermique - -
+! XKABEL --> - - - - - coeff absorption (pour Srad)- -
+! VISEL --> - - - - - viscosite dynamique - - - - - -
+
+double precision rhoel (ngazgm,npot), cpel (ngazgm,npot)
+double precision sigel (ngazgm,npot), visel (ngazgm,npot)
+double precision xlabel(ngazgm,npot), xkabel(ngazgm,npot)
+common / rchjou / rhoel , cpel , &
+ sigel , visel , &
+ xlabel , xkabel
+
+
+! CL sur les electrodes
+
+integer nelemx,nbtrmx
+parameter (nelemx = 1000 , nbtrmx = 100)
+
+integer nbelec , nbtrf , ntfref
+common /eletrf / nbelec , nbtrf , ntfref
+
+integer ielecc(nelemx),ielect(nelemx),ielecb(nelemx)
+common/eletrf/ielecc ,ielect ,ielecb
+
+integer ibrpr(nbtrmx),ibrsec(nbtrmx)
+common/brtrsf/ibrpr ,ibrsec
+
+double precision tenspr(nbtrmx),rnbs(nbtrmx)
+double precision zr(nbtrmx) ,zi(nbtrmx)
+common/crtrsf/ tenspr , rnbs , zr , zi
+
+double precision uroff(nbtrmx) ,uioff(nbtrmx)
+common/offser/ uroff ,uioff
+
+!--> PARAMETRES POUR LA VERSION ARC ELECTRIQUE
+! ========================================
+
+! IXKABE : valeur lue dans le fichier dp_elec
+! = 0 la derniere colonne du fichier est lue mais pas utilisee
+! = 1 la derniere colonne du fivhier represente le coefficient
+! d'absorption
+! = 2 la derniere colonne du fivhier represente le TS radiatif
+
+integer ixkabe
+common / ioptel / ixkabe
+
+
+
+! Grandeurs necessaires au claquage
+
+! NTDCLA : iterration de debut du claquage
+! ICLAQ : indicateur pour savoir si on fait actuellement un claquage
+! = 0 Pas de claquage
+! = 1 Claquage
+! XCLAQ ,YCLAQ ZCLAQ : Position de point de claquage
+
+integer ntdcla , iclaq
+common / iclaqu / ntdcla , iclaq
+
+double precision xclaq , yclaq , zclaq
+common / rclaqu / xclaq , yclaq , zclaq
+
+
+!--> DONNEES SUR LA CORRECTION DES VARIABLES ELECTRIQUES
+! EN FONCTION D'UNE INTENSITE DE COURANT DONNEES
+! ========================================
+
+! IELCOR : = 0 pas de correction
+! = 1 correction
+
+! COUIMP : intensite de courant impose par l'utilisateur
+! pour Arc Electrique
+! PUISIM : puissance imposee pour Joule
+! DPOT : Delta du potentiel electrique entre l'Anode et la cathode
+! (arc et Joule)
+! COEJOU : coefficient de correction pour version Joule
+
+integer ielcor
+common / iecorr / ielcor
+
+double precision couimp , dpot , puisim , coejou
+common / recorr / couimp , dpot , puisim , coejou
+
+!--> DONNEES POUR LES ESPECES AYANT UN IMPACT
+! SUR LE PROBLEME ELECTRIQUE
+! ========================================
+
+! QESPEL : Charge massique des especes C/kg
+! SUSCEP : Susceptibilite (relation champ - mobilite) m2/s/V
+
+double precision qespel(ngazgm), suscep(ngazgm)
+common / rdpbel / qespel , suscep
+
+
diff --git a/include/fuel/fuincl.h b/include/fuel/fuincl.h
new file mode 100644
index 0000000..fcd9442
--- /dev/null
+++ b/include/fuel/fuincl.h
@@ -0,0 +1,203 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! fuincl.h
+
+!===============================================================================
+
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE RELATIF
+! A LA COMBUSTION DU FUEL
+
+! Necessite ppppar.h et ppthch
+!-------------------------------------------------------------------------------
+! EPSIFL : Precision pour les tests
+
+ double precision epsifl
+ parameter ( epsifl = 1.d-8 )
+
+!--> DONNEES RELATIVES AU FUEL
+
+! - Proprietes du fuel
+! CFOL --> fractions massiques elementaires en C, H, O, S, In (%)
+! HFOL du fuel oil liquid
+! OFOL
+! SFOL
+! XInFOL
+! PCIFOL --> PCI (J/kg) fuel oil liquid
+! RHO0FL --> Masse volumique initiale (kg/m3)
+! - Proprietes du coke
+! CKF --> Fractions massiques elementaires en C, H, O, S, In (%)
+! HKF du coke
+! OKF
+! SKF
+! XInKF
+! GAMMA --> Composition du coke
+! DELTA sous la forme CH(GAMMA)O(DELTA)
+! GAMMA = HCK/CCK
+! DELTA = OCK/CCK
+! PCIKF --> PCI (J/kg) coke
+! RHOKF --> Masse volumique coke
+! FKC --> Fraction massique initiale de coke dans le fuel
+! H02FOL --> H0 du fuel oil liquid
+! CPFOL --> CP du fuel oil liquid
+! HRFVAP --> H formation vapeur a Tebu
+! Fractions massiques dans les vapeurs
+! HSFOV --> H2S
+! COFOV --> CO
+! CHFOV --> CHn
+! nHCFOV --> n dans la formule CHn (un reel, car formule molaire moyenne)
+
+! DFOL --> densite du fuel liquide
+
+double precision cfol , hfol , ofol , sfol, xinfol, &
+ pcifol , rho0fl , rhokf, &
+ h02fol , cp2fol , hrfvap, dfol, &
+ ckf , hkf , okf , skf, xinkf, pcikf, fkc, &
+ hsfov, cofov, chfov, nhcfov
+
+! - Parametres pour l'evaporation
+! TEVAP1 --> temperature de debut d'evaporation
+! TEVAP2 --> temperature de fin d'evaporation
+
+
+
+! - Parametres cinetiques pour la combustion heterogene du coke
+! (Modele a sphere retrecissante)
+! AHETFL --> Constante pre-exponentielle (kg/m2/s/atm)
+! EHETFL --> Energie d'activation (kcal/mol)
+! IOFHET --> Ordre de la reaction 0.5 si = 0 1 si = 1
+
+double precision yfol , afol , efol , &
+ ahetfl , ehetfl, tevap1, tevap2
+integer iofhet
+
+! - Enthalpie du fuel et coke
+! IFOL --> Pointeur dans le tableau EHSOLI pour
+! le fuel oil liquid
+! IKF --> Pointeur dans le tableau EHSOLI pour
+! le Coke
+! EHSOLI(S,IT) --> Enthalpie massique (J/kg) du constituant solide
+! no S a la temperature T(IT)
+
+integer ifol, ikf
+
+! ---- PAR CLASSES (grandeurs deduites)
+
+! NCLAFU --> Nb de classes
+
+integer nclafu
+
+! - Proprietes : on garde le meme max que pour le charbon qui
+! est definis dans ppppar.h
+! DINIFL(CL) --> Diametre initial (mm)
+! DINIKF(CL) --> Diametre coke (mm)
+! DINIIN(CL) --> Diametre min (mm)
+
+double precision dinifl(nclcpm),dinikf(nclcpm),diniin(nclcpm)
+
+!--> DONNEES RELATIVES A LA COMBUSTION DES ESPECES GAZEUSES
+
+! IIFOV --> Pointeur FOV pour EHGAZE et WMOLE
+! IICO --> Pointeur CO pour EHGAZE et WMOLE
+! IIO2 --> Pointeur O2 pour EHGAZE et WMOLE
+! IICO2 --> Pointeur CO2 pour EHGAZE et WMOLE
+! IIH2O --> Pointeur H2O pour EHGAZE et WMOLE
+! IIN2 --> Pointeur N2 pour EHGAZE et WMOLE
+! IIH2S --> Pointeur H2S pour EHGAZE et WMOLE
+! IISO2 --> Pointeur SO2 pour EHGAZE et WMOLE
+
+! XSI --> XSI = 3,76 pour de l'air
+! FVAPMX --> Maximum pour le traceur F3
+! FOV --> Composition de l'hydrocarbure relatif
+! aux matieres volatiles
+! A, --> Coefficients stoechiometriques molaires pour
+! B la reaction d'evaporation
+
+! Concentrations dans les especes globales
+! AFOVF1 nb de moles de vapeur associees a un kg de traceur 1
+! ACOF1 CO
+! AH2SF1 H2S
+! AH2SF3 H2S
+! AH2OF3 H2O
+! FF3MAX fraction massqique maximale du traceur F3
+! (correspondant a la masse liberee par combustion heterogene il
+! ne peut exister pur)
+
+
+double precision fvapmx, fov, a, b
+integer ifov,ih2s,iso2
+
+!--> DONNEES COMPLEMENTAIRES RELATIVES AU CALCUL DE RHO
+! SUR LES FACETTES DE BORD
+
+! IENTAT(IENT) --> Indicateur air par type de facette d'entree
+! IENTFL(IENT) --> Indicateur CFOL par type de facette d'entree
+! TIMPAT(IENT) --> Temperature en K pour l'air relative
+! a l'entree IENT
+
+integer ientfl(nozppm)
+
+!--> POINTEURS DANS LE TABLEAU TBMCR
+
+double precision afovf1,acof1,ah2sf1,ah2sf3
+double precision ff3max
+
+!--> DEFINITION DES COMMONS
+
+common / ifucom / ifol, ikf, ientfl, iofhet, nclafu
+
+common / ifuesp / ifov,ih2s,iso2
+common / rfuesp / afovf1,acof1,ah2sf1,ah2sf3, &
+ ff3max
+
+common / rfucom / cfol , hfol , ofol , sfol, xinfol, &
+ pcifol , rho0fl, rhokf , &
+ ckf , hkf , okf , skf , xinkf, &
+ pcikf,fkc, &
+ hsfov,cofov,chfov,nhcfov, &
+ h02fol , cp2fol , hrfvap, &
+ yfol , afol , efol , dfol, &
+ ahetfl, ehetfl,tevap1, tevap2 , &
+ fvapmx, fov, a , b , &
+ dinifl , dinikf , diniin
+
+!--> GRANDEURS FOURNIES PAR L'UTILISATEUR EN CONDITIONS AUX LIMITES
+! PERMETTANT DE CALCULER AUTOMATIQUEMENT LA VITESSE, LA TURBULENCE,
+! L'ENTHALPIE D'ENTREE.
+
+! POUR LES ENTREES UNIQUEMENT , IENT ETANT LE NUMERO DE ZONE FRONTIERE
+
+! QIMPFL(IENT) --> Debit Fuel Oil Liquid en kg/s
+! TIMPFL(IENT) --> Temperature FOL en K
+
+double precision qimpfl(nozppm), timpfl(nozppm)
+double precision distfu(nozppm,nclcpm)
+double precision hlfm
+
+common / rcpcli / qimpfl , timpfl , hlfm, distfu
+
+! FIN
diff --git a/include/lagr/cs_lagr.h b/include/lagr/cs_lagr.h
new file mode 100644
index 0000000..d8a6157
--- /dev/null
+++ b/include/lagr/cs_lagr.h
@@ -0,0 +1,130 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_LAGR_H__
+#define __CS_LAGR_H__
+
+/*============================================================================
+ * Utilitarian functions for the diphasic lagrangian module
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check if IEEE 754 standard is respected for floating storage for this
+ * architecture. If the standard is not respected the particle trajectography
+ * may be wrong.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (csieee,CSIEEE)(void);
+
+/*----------------------------------------------------------------------------
+ * Check the relative localization of two vertices. We want to know if these
+ * two vertices are identical.
+ *
+ * pvalmax --> upperbound on coordinates
+ * px --> X coordinate of the vertex P
+ * py --> Y coordinate of the vertex P
+ * pz --> Z coordinate of the vertex P
+ * qx --> X coordinate of the vertex Q
+ * qy --> Y coordinate of the vertex Q
+ * qz --> Z coordinate of the vertex Q
+ * sign <-> return tag (1 -> identical else 0)
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (coloca,COLOCA)(cs_real_t *pvalmax,
+ cs_real_t *px,
+ cs_real_t *py,
+ cs_real_t *pz,
+ cs_real_t *qx,
+ cs_real_t *qy,
+ cs_real_t *qz,
+ cs_int_t *sign);
+
+/*----------------------------------------------------------------------------
+ * Look for coordinate system orientation to locate particles in relation to
+ * faces.
+ *
+ * pvalmax --> upper bound on coordinates
+ * px --> X coordinate of the first vertex
+ * py --> Y coordinate of the first vertex
+ * pz --> Z coordinate of the first vertex
+ * qx --> X coordinate of the second vertex
+ * qy --> Y coordinate of the second vertex
+ * qz --> Z coordinate of the second vertex
+ * cdgx --> X coordinate of the third vertex
+ * cdgy --> Y coordinate of the third vertex
+ * cdgz --> Z coordinate of the third vertex
+ * crgx --> X coordinate of the fourth vertex
+ * crgy --> Y coordinate of the fourth vertex
+ * crgz --> Z coordinate of the fourth vertex
+ * sign <-> orientation of the four vertices.
+ * pturb <->
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (coturn,COTURN)(cs_real_t *pvalmax,
+ cs_real_t *px,
+ cs_real_t *py,
+ cs_real_t *pz,
+ cs_real_t *qx,
+ cs_real_t *qy,
+ cs_real_t *qz,
+ cs_real_t *cdgx,
+ cs_real_t *cdgy,
+ cs_real_t *cdgz,
+ cs_real_t *crdx,
+ cs_real_t *crdy,
+ cs_real_t *crdz,
+ cs_int_t *sign,
+ cs_int_t *pturb);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_LAGR_H__ */
diff --git a/include/lagr/cs_lagr_perio.h b/include/lagr/cs_lagr_perio.h
new file mode 100644
index 0000000..184f16b
--- /dev/null
+++ b/include/lagr/cs_lagr_perio.h
@@ -0,0 +1,113 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef __CS_LAGR_PERIO_H__
+#define __CS_LAGR_PERIO_H__
+
+/*============================================================================
+ * Management of the periodicity for particles
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public functions definition for API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build buffers to keep the link between a given halo cell and :
+ * - the related real cell
+ * - the transformation id
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PERLOC
+ * *****************
+ *
+ * INTEGER ICELCR(NCELET-NCEL) : <- : related real cell buffer
+ * INTEGER IPERCR(NCELET-NCEL) : <- : transformation id buffer
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (perloc, PERLOC)(cs_int_t *icelcr,
+ cs_int_t *ipercr);
+
+/*----------------------------------------------------------------------------
+ * Apply rotation to the location of a particle.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE LAGPER
+ * *****************
+ *
+ * INTEGER ITRANS : -> : transformation id buffer
+ * DOUBLE PRECISION VTX_A : -> : location of vertex before transform.
+ * DOUBLE PRECISION VTX_B : <- : location of the vertex after transform.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (lagper, LAGPER)(const cs_int_t *itrans,
+ const cs_real_t vtx_a[],
+ cs_real_t vtx_b[]);
+
+/*----------------------------------------------------------------------------
+ * Apply rotation on the velocity vector of a particle.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE LAGVEC
+ * *****************
+ *
+ * INTEGER ITRANS : -> : transformation id
+ * DOUBLE PRECISION VECTI : -> : vector before transformation
+ * DOUBLE PRECISION VECTF : <- : vector after transformation
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (lagvec, LAGVEC)(const cs_int_t *itrans,
+ const cs_real_t vecti[],
+ cs_real_t vectf[]);
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
+#endif /* __CS_LAGR_PERIO_H__ */
diff --git a/include/lagr/lagdim.h b/include/lagr/lagdim.h
new file mode 100644
index 0000000..fbcb7f3
--- /dev/null
+++ b/include/lagr/lagdim.h
@@ -0,0 +1,84 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! lagdim.h
+!===============================================================================
+
+!===============================================================================
+
+! Include pour le module Lagrangien : dimensions
+
+! Trois fichiers complementaires
+! lagran.h qui porte les non dimensions
+! lagdim.h qui porte les dimensions variables
+! lagpar.h qui porte les parametres
+
+!===============================================================================
+! 1. Connectivite
+
+! LONGUEUR DU TABLEAU DU CONNECTIVITE CELLULES -> FACES
+! (calcule dans le sous-programme LAGINI)
+
+integer lndnod
+common / ilagd1 / lndnod
+
+!===============================================================================
+! 2. Classes et particules
+
+! NBPMAX : NOMBRE MAXIMAL DE PARTICULES AUTORISE DANS LE DOMAINE
+! AU COUR DU CALCUL (UTILE SI INJECTION INSTATIONNAIRE)
+
+integer nbpmax
+common / ilagd2 / nbpmax
+
+!===============================================================================
+! 3. Dimensions des tableaux particulaires
+
+! NVP : NOMBRE DE VARIABLES SUR LES PARTICULES
+
+! NVP1 : NOMBRE DE VARIABLES SUR LES PARTICULES
+! EN ENLEVANT POSITION, VITESSE PARTICULE
+! ET VITESSE FLUIDE
+
+! NVEP : NOMBRE D'INFO SUR LES PARTICULES (REELS)
+
+! NIVEP : NOMBRE D'INFO SUR LES PARTICULES (ENTIERS)
+
+! NTERSL : NOMBRE DE TERMES SOURCES POUR COUPLAGE RETOUR
+
+! NVLSTA : NOMBRE DE VARIABLES STATISTIQUES
+
+! NVISBR : NOMBRE DE VARIABLES A ENREGISTRER SUR LES FRONTIERES
+
+
+integer nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr
+common / ilagd3 / nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr
+
+! FIN
+
diff --git a/include/lagr/lagpar.h b/include/lagr/lagpar.h
new file mode 100644
index 0000000..99aa95b
--- /dev/null
+++ b/include/lagr/lagpar.h
@@ -0,0 +1,152 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! lagpar.h
+!===============================================================================
+
+!===============================================================================
+
+! Include pour le module Lagrangien : dimensions
+
+! Trois fichiers complementaires
+! lagran.h qui porte les non dimensions
+! lagdim.h qui porte les dimensions variables
+! lagpar.h qui porte les parametres
+
+!===============================================================================
+! 1. Classes et particules
+
+! NCLAGM : NOMBRE MAXIMAL DE CLASSES DE PARTICULES
+
+integer nclagm
+parameter (nclagm = 20)
+
+! NCHARM2 : NOMBRE MAXIMAL DE CLASSES DE CHARBON (voir cpincl.h)
+
+integer ncharm2
+parameter (ncharm2 = 3)
+
+! NCLSTM : NOMBRE MAXIMUM DE STATISTIQUES VOLUMIQUE PAR GROUPE
+
+integer nclstm
+parameter (nclstm = 100)
+
+!===============================================================================
+! 2. Conditions aux limites
+
+! NFLAGM : NOMBRE MAXIMAL DE ZONE FRONTIERES
+
+integer nflagm
+parameter (nflagm = 100)
+
+!===============================================================================
+! 3. Conditions aux limites
+
+! NDLAGM : NOMBRE MAXIMAL DE DONNEES SUR LES PARTICULES (REELS)
+
+integer ndlagm
+parameter (ndlagm = 50)
+
+! NDLAIM : NOMBRE MAXIMAL DE DONNEES SUR LES PARTICULES (ENTIERS)
+
+integer ndlaim
+parameter (ndlaim = 10)
+
+!===============================================================================
+! 4. Schema en temps
+
+! NVGAUS : NOMBRE DE VARIABLES ALEATOIRES GAUSSIENNES PAR PARTICULES
+
+integer nvgaus
+parameter (nvgaus = 9)
+
+
+!===============================================================================
+! 5. Mouvement Brownien
+
+! NVGAUS : NOMBRE DE VARIABLES ALEATOIRES GAUSSIENNES PAR PARTICULES
+
+integer nbrgau
+parameter (nbrgau = 6)
+
+
+!===============================================================================
+! 6. Variables utilisateurs supplementaires
+
+! NUSVAR : Nombre maximum de variables utilisateur supplementaires
+
+integer nusvar
+parameter (nusvar = 10)
+
+! NUSSTA : Nombre maximum de stats utilisateur supplementaires
+
+integer nussta
+parameter (nussta = 20)
+
+! NUSBRD : Nombre maximum interactions particules/frontieres
+! utilisateur supplementaires
+
+integer nusbrd
+parameter (nusbrd = 10)
+
+!===============================================================================
+! 7. Affichages et fichiers suite
+
+! NVPLMX : Nombre maximum de variables
+
+integer nvplmx
+parameter (nvplmx = 50)
+
+!===============================================================================
+! 8. Visualisation particulaires
+
+! NLISTE : Nombre maximum de particules visualisable
+
+integer nliste
+parameter (nliste = 500)
+
+!===============================================================================
+! 9. Types d'interaction au bord
+
+! NLISTE : Nombre maximum de particules visualisable
+
+integer ientrl , isortl , irebol
+integer idepo1 , idepo2 , idepo3
+integer iencrl , jbord1 , jbord2
+integer jbord3 , jbord4 , jbord5
+integer idepfa
+
+parameter (ientrl = 1, isortl = 2, irebol = 3)
+parameter (idepo1 = 4, idepo2 = 5, idepo3 = 6)
+parameter (iencrl = 7, jbord1 = 8, jbord2 = 9)
+parameter (jbord3 = 10, jbord4 = 11, jbord5 = 12)
+parameter (idepfa = 13)
+
+!===============================================================================
+
+! FIN
+
diff --git a/include/lagr/lagran.h b/include/lagr/lagran.h
new file mode 100644
index 0000000..ded5b55
--- /dev/null
+++ b/include/lagr/lagran.h
@@ -0,0 +1,659 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! lagran.h
+!===============================================================================
+
+!===============================================================================
+
+! Include pour le module Lagrangien
+
+! Trois fichiers complementaires
+! lagran.h qui porte les non dimensions
+! lagdim.h qui porte les dimensions variables
+! lagpar.h qui porte les parametres
+
+!===============================================================================
+! 1. Base
+
+! IILAGR = 0 : PAS DE CALCUL LAGRANGIEN
+! = 1 : DIPHASIQUE LAGRANGIEN SANS COUPLAGE RETOUR
+! = 2 : DIPHASIQUE LAGRANGIEN AVEC COUPLAGE RETOUR
+
+! ISUILA = 0 : PAS SUITE LAGRANGIEN
+! = 1 : SUITE LAGRANGIEN
+
+! ISTTIO = 0 : calcul instationnaire pour le lagrangien
+! = 1 : calcul stationnaire pour le lagrangien
+
+! ILPHAS : Numero de la phase continue sur laquelle le
+! module prend ses infos et vers laquelle il
+! renvoie les termes sources de couplage retour.
+
+integer iilagr , isuila , isttio , ilphas
+common / ilag11 / iilagr , isuila , isttio , ilphas
+
+!===============================================================================
+! 2. Compteurs de particules (sans et avec poids statistique)
+
+! NBPART/DNBPAR : NOMBRE DE PARTICULES PRESENTES DANS LE DOMAINE
+! A CHAQUE ITERATION
+
+! NBPNEW/DNBPNW : NOMBRE DE NOUVELLES PARTICULES ENTRANTES
+
+! NBPERR/DNBPER : NOMBRE DE PARTICULES ELIMINEES EN ERREUR
+
+! NBPERT : NOMBRE DE PARTICULES ELIMINEES EN ERREUR DANS
+! LE CALCUL DEPUIS LE DEBUT, SUITES COMPRISES
+
+! NBPTOT : NOMBRE DE PARTICULES TOTAL INJECTE DANS
+! LE CALCUL DEPUIS LE DEBUT SUITE COMPRISE
+
+! NBPOUT/DNBPOU : Contient les particules sorties de facon normal,
+! plus les particules sorties en erreur de reperage.
+
+! NDEPOT : Nombre de particules deposees definitivement
+! dont on garde une trace en memoire pour le
+! post-processing en mode deplacement.
+
+! NPCLON/DNPCLO : NOMBRE DE NOUVELLES PARTICULES PAR CLONNAGE
+
+! NPKILL/DNPKIL : NOMBRE DE PARTICULES VICTIMES DE LA ROULETTE RUSSE
+
+! NPCSUP/DNPCSU : NOMBRE DE PARTICULES QUI ON SUBIT LE CLONNAGE
+
+
+integer nbpart , nbpnew , nbperr , nbptot , nbpout , &
+ nbpert , ndepot
+common / ilag21 / nbpart , nbpnew , nbperr , nbptot , nbpout , &
+ nbpert , ndepot
+
+double precision dnbpar , dnbpnw , dnbper , dnbpou
+common / rlag21 / dnbpar , dnbpnw , dnbper , dnbpou
+
+integer npclon , npkill , npcsup
+common / ilag22 / npclon , npkill , npcsup
+
+double precision dnpclo , dnpkil , dnpcsu
+common / rlag22 / dnpclo , dnpkil , dnpcsu
+
+!===============================================================================
+! 4. Physiques particulieres
+
+! SI IPHYLA = 1 ALORS
+
+! ITPVAR : EQUATION SUR LA TEMPERATURE
+! IDPVAR : EQUATION SUR LE DIAMETRE
+! IMPVAR : EQUATION SUR LA MASSE
+
+
+integer iphyla, itpvar, idpvar, impvar
+common / ilag41 / iphyla, itpvar, idpvar, impvar
+
+
+! SI SUITE ET ENCLENCHEMENT ITPVAR =1 EN COUR DE CALCUL
+
+! TPART : Temperature d initialisation en degres Celsius
+! CPPART : Chaleur massique specifique (J/kg/K)
+
+double precision tpart , cppart
+common / rlag41 / tpart , cppart
+
+
+!===============================================================================
+! 5. Pas de temps Lagrangien
+
+! IPLAS : NOMBRE DE PASSAGES ABSOLUS DANS LE MODULE LAGRANGIEN
+! IPLAR : NOMBRE DE PASSAGES RELATIFS DANS LE MODULE LAGRANGIEN
+
+integer iplas , iplar
+common / ilag51 / iplas , iplar
+
+! DTP : duree d une iteration lagrangienne
+! TTCLAG : temps courant physique lagrangien
+
+double precision dtp , ttclag
+common / rlag51 / dtp , ttclag
+
+!===============================================================================
+! 6. Indicateur d erreur
+
+integer ierr
+common / ilag61 / ierr
+
+!===============================================================================
+! 3. Pointeurs particules
+
+! Tableau ETTP
+! ^^^^^^^^^^^^
+
+! JXP,JYP,JZP : COORDONNES DE LA POSITION DE LA PARTICULE
+! JUP,JVP,JWP : COMPOSANTES DE LA VITESSE ABSOLUE
+! JUF,JVF,JWF : COMPOSANTES DE LA VITESSE DU FLUIDE VU
+
+! JMP,JDP : MASSE, DIAMETRE
+! JTP,JTF,JCP : TEMPERATURE PARTICULE ET FLUIDE ET CHALEUR SPECIFIQUE
+! JVLS(NUSVAR) : VARIABLE SUPPLEMENTAIRES
+
+! Charbon
+! -------
+! JHP : TEMPERATURE DES GRAINS DE CHARBON
+! JMCH : MASSE DE CHARBON REACTIF
+! JMCK : MASSE DE COKE
+
+
+integer jxp , jyp , jzp , &
+ jup , jvp , jwp , &
+ juf , jvf , jwf , &
+ jmp , jdp , jtp , jtf , jcp , &
+ jhp , jmch, jmck, &
+ jvls(nusvar)
+
+common / ilag31 / jxp , jyp , jzp , &
+ jup , jvp , jwp , &
+ juf , jvf , jwf , &
+ jmp , jdp , jtp , jtf , jcp , &
+ jhp , jmch, jmck, &
+ jvls
+
+! Tableau TEPA
+! ^^^^^^^^^^^^
+
+! JRTSP : TEMPS DE SEJOUR DES PARTICULES
+! JRPOI : POIDS DES PARTICULES
+! JREPS : EMISSIVITE DES PARTICULES
+
+! Charbon
+! -------
+! JRDCK : DIAMETRE DU COEUR RETRECISSANT
+! JRD0P : DIAMETRE INITIAL DES PARTICULES
+! JRR0P : MASSE VOLUMIQUE INITIALE DES PARTICULES
+
+integer jrtsp, jrpoi, jreps, jrd0p, jrr0p, jrdck
+common / ilag32 / jrtsp, jrpoi, jreps, jrd0p, jrr0p, jrdck
+
+! Tableau ITEPA
+! ^^^^^^^^^^^^^
+
+! JISOR : MAILLE D ARRIVEE
+
+! Statistique par classe
+! ----------------------
+
+! JCLST : classe (statique ) a laquelle la particule appartient
+
+! Charbon
+! -------
+! JINCH : NUMERO DU CHARBON DE LA PARTICULE
+
+integer jisor, jinch , jclst
+common / ilag33 / jisor, jinch , jclst
+
+! NVLS : NOMBRE DE VARIABLES UTILISATEUR SUPPLEMENTAIRES
+! (DEJA CONTENU DANS NVP et NVP1)
+
+integer nvls
+common / ilag34 / nvls
+
+!===============================================================================
+! 7. Conditions aux limites
+
+! TABLEAUX POUR LES CONDITIONS AUX LIMITES
+! ----------------------------------------
+
+! NFRLAG : nbr de zones frontieres
+! INJCON : INJECTION CONTINUE OU NON
+! ILFLAG : liste des numeros des zones frontieres
+! IUSNCL : nbr de classes par zones
+! IUSCLB : conditions au bord pour les particules
+! = IENTRL
+! = ISORTL -> particule sortie du domaine par une face fluide
+! = IREBOL -> rebond elastique
+! = IDEPO1 -> deposition definitive (particule eliminee de la memoire)
+! = IDEPO2 -> deposition definitive (part. non eliminee de la memoire)
+! = IDEPO3 -> deposition temporaire (remise en suspension possible)
+! = IENCRL -> encrassement (Charbon uniquement IPHYLA = 2)
+! = JBORD1 -> interactions utilisateur
+! = JBORD2 -> interactions utilisateur
+! = JBORD3 -> interactions utilisateur
+! = JBORD4 -> interactions utilisateur
+! = JBORD5 -> interactions utilisateur
+! IUSMOY : tableau si on fait une moyenne par zone sur la zone considere
+! IUSLAG : tableau d info par classe et par frontieres
+! DEBLAG : debit massique par zone
+
+
+integer nfrlag, injcon, &
+ ilflag(nflagm), &
+ iusncl(nflagm), &
+ iusclb(nflagm), &
+ iusmoy(nflagm), &
+ iuslag(nclagm, nflagm, ndlaim)
+
+common / ilag71 / nfrlag, injcon, &
+ ilflag, iusncl, &
+ iusclb, &
+ iusmoy, iuslag
+
+double precision deblag(nflagm)
+common / rlag71 / deblag
+
+
+
+! IJNBP : nbr de part par classe et zones frontieres
+! IJFRE : frequence d injection
+! (si < 0 : on ne rentre des particles qu a la 1ere iter)
+! IJUVW : type de condition vitesse
+! = -1 vitesse fluide imposee
+! = 0 vitesse imposee selon la direction normale
+! a la face de bord et de norme IUNO
+! = 1 vitesse imposee : on donne IUPT IVPT IWPT
+! = 2 profil de vitesse donne par l'utilisateur
+! IJPRPD = 1 distribution uniforme
+! = 2 profil de taux de presence donne par l'utilisateur
+! IJPRTP = 1 profil plat de temperature donne par la valeur dans uslag2
+! = 2 profil de temperature donne par l'utilisateur
+! IJPRDP = 1 profil plat de diametre donne par la valeur dans uslag2
+! = 2 profil dediametre donne par l'utilisateur
+! INUCHL : numero du charbon de la particule (si IPHYLA=2)
+! ICLST : numero du groupe de statistiques
+
+
+integer ijnbp, ijfre, ijuvw, ijprtp, ijprdp, ijprpd
+integer inuchl, iclst
+common / ilag72 / ijnbp, ijfre, ijuvw, ijprtp, ijprdp, ijprpd, &
+ inuchl, iclst
+
+
+! RUSLAG : tableau d info par classe et par frontieres
+
+
+double precision ruslag(nclagm, nflagm, ndlagm)
+common / rlag73 / ruslag
+
+
+! IUNO : Norme de la vitesse
+! IUPT : U par classe et zones
+! IVPT : V par classe et zones
+! IWPT : W par classe et zones
+! IDEBT : Debit
+! IPOIT : Poids de la particule
+! IDPT : Diametre
+! IVDPT : Variance du diametre
+! ITPT : Temperature
+! ICPT : Cp
+! IEPSI : Emissivite des particules
+! IROPT : Masse volumique
+! IHPT : Temperature
+! IMCHT : Masse de charbon reactif
+! IMCKT : Masse de coke
+! IDCKT : Diametre du coeur retrecissant
+
+
+integer iuno, iupt, ivpt, iwpt, &
+ itpt, idpt, ivdpt, iropt, &
+ icpt, ipoit, idebt, iepsi, &
+ ihpt, imcht, imckt, idckt
+
+common / ilag74 / iuno, iupt, ivpt, iwpt, &
+ itpt, idpt, ivdpt, iropt, &
+ icpt, ipoit, idebt, iepsi, &
+ ihpt, imcht, imckt, idckt
+
+!===============================================================================
+! 8. Statistiques
+
+! POINTEURS POUR LES STATISTIQUES
+! -------------------------------
+
+! ILVX,ILVY,ILVZ : Vitesse
+! ILFV : Concentration volumique
+! ILPD : Somme des poids statistiques
+! ILTS : Temps de sejour
+
+! ILTP : Temperature
+! ILDP : Diametre
+! ILMP : Masse
+
+! ILHP : Temperature
+! ILMCH : Masse de charbon reactif
+! ILMCK : Masse de coke
+! ILDCK : Diametre du coeur retrecissant
+
+! ILVU(NUSSTA) : Statistiques supplementaires utilisateur
+
+integer ilvx , ilvy , ilvz , &
+ ilpd , ilfv , ilts , &
+ iltp , ildp , ilmp , &
+ ilhp , ilmch , ilmck , ildck , &
+ ilvu(nussta)
+
+common / ilagr7 / ilvx , ilvy , ilvz , &
+ ilpd , ilfv , ilts , &
+ iltp , ildp , ilmp , &
+ ilhp , ilmch , ilmck , ildck , &
+ ilvu
+
+
+! DONNEES POUR LES STATISTIQUES VOLUMIQUES
+! ----------------------------------------
+
+! ISTALA : Calcul statistiques si >= 1 sinon pas de stat
+! ISUIST : Suite calcul statistiques si >= 1 sinon pas de stat
+! NVLSTS : NOMBRE DE VARIABLES STATISTIQUES SUPPLEMENTAIRES
+! UTILISATEUR (CONTENU DANS NVLSTA)
+! IDSTNT : Numero du pas de temps pour debut statistque
+! NSTIST : Debut calcul stationnaire
+! NPST : Nombre de pas de temps pour le cumul des stats
+! NPSTT : Nombre de pas de temps total des stats depuis le debut
+! du calcul, partie instationnaire comprise
+! TSTAT : Temps physique des stats volumiques
+! SEUIL : Seuil en POIDS STAT de particules pour les stats
+
+
+integer istala , isuist , nvlsts , &
+ idstnt , nstist , &
+ npst , npstt
+
+common / ilasta / istala , isuist , nvlsts , &
+ idstnt , nstist , &
+ npst , npstt
+
+double precision tstat , seuil
+common / rlasta / tstat , seuil
+
+
+! NOMS DES VARIABLES STATISTIQUES (MOYENNES ET VARIANCES)
+! -------------------------------------------------------
+! Taille limitee par le fait qu on utilise NOMBRD dans
+! l ecriture des fichiers suites (lagout)
+
+character*50 nomlag(nvplmx) , nomlav(nvplmx)
+common / alasts / nomlag , nomlav
+
+! OPTION POUR LES HISTORIQUES SUR LES STATS
+! -----------------------------------------
+
+integer ihslag(nvplmx)
+common / ilophl / ihslag
+
+! STATISTIQUE PAR ZONE ET PAR CLASSE
+! ----------------------------------
+
+integer nbclst
+common / ilstcl / nbclst
+
+!===============================================================================
+! 9. Termes Sources
+
+! OPTION TERMES SOURCES
+! ---------------------
+! Dynamique
+! Masse
+! Thermique
+
+integer ltsdyn , ltsmas , ltsthe
+common /ilopts / ltsdyn , ltsmas , ltsthe
+
+! POINTEURS POUR LES TERMES SOURCES
+! ---------------------------------
+
+! ITSVX,ITSVY,ITVZ : Termes sources sur la vitesse
+! ITSLI : Terme source implicite (vitesse+turbulence)
+! ITSKE : Terme source sur la turbulence en k-eps
+! ITSR11,ITR12,ITSR13 : Termes sources sur la turbulence en Rij-Eps
+! ITSR22,ITR23,ITSR33
+! ITSTE, ITSTI : Termes sources pour la thermique
+! ITSMAS : Terme source pour la masse
+! ITSMV1 : Terme source sur F1 (MV legeres)
+! ITSMV2 : Terme source sur F2 (MV loudres)
+! ITSCO : Terme source sur F3 (C sous forme de CO)
+! ITSFP4 : Variance du traceur relatif a l air
+
+
+integer itsvx , itsvy , itsvz , itsli , &
+ itske , &
+ itsr11 , itsr12 , itsr13 , &
+ itsr22 , itsr23 , itsr33 , &
+ itste , itsti , &
+ itsmas , itsmv1(ncharm2), itsmv2(ncharm2) , &
+ itsco , itsfp4
+
+common / ilag91 / itsvx , itsvy , itsvz, itsli , &
+ itske , &
+ itsr11 , itsr12 , itsr13 , &
+ itsr22 , itsr23 , itsr33 , &
+ itste , itsti , &
+ itsmas , itsmv1 , itsmv2 , &
+ itsco , itsfp4
+
+
+! DONNEES POUR LES TERMES SOURCES
+! -------------------------------
+
+! NSTITS : debut calcul terme source stationnaire
+! NPTS : nombre de pas de temps pour le cumul des termes sources
+! NTXERR : nombre de cellules qui un taux vol > 0.8
+! VMAX : taux volumique max atteint
+! TMAMAX : taux massique max atteint
+
+integer nstits , npts , ntxerr
+common / ilag92 / nstits , npts , ntxerr
+
+double precision vmax , tmamax
+common / ilag93 / vmax , tmamax
+
+!===============================================================================
+! 10. Clonage/fusion des particules
+
+! INDICATEUR D ACTIVATION DE LA ROULETTE RUSSE
+
+
+integer iroule
+common / ila101 / iroule
+
+!===============================================================================
+! 11. Encrassement
+
+! DONNEES POUR L ENCRASSEMENT
+
+integer iencra , npencr
+common / ila111 / iencra , npencr
+
+
+double precision enc1(ncharm2) , enc2(ncharm2) , &
+ tprenc(ncharm2) , visref(ncharm2) , dnpenc
+common / rla112 / enc1 , enc2 , tprenc , visref , dnpenc
+
+
+!===============================================================================
+! 12. Forces chimiques
+
+! 1) FORCES DE VAN DER WAALS
+! 2) FORCES ELECTROSTATIQUES
+
+integer ladlvo
+common / iladlv / ladlvo
+
+! CSTHAM : constante d'Hamaker
+! CSTFAR : constant de FARADET
+! EPSEAU : Constante dielectrique de l'eau
+! EPSEAU : Constante dielectrique du vide
+! PHI1 : potentiel solide 1
+! PHI1 : potentiel solide 2
+! FION : force ionique
+! GAMASV : energie de surface
+! DPARMN : distance entre particule/paroi minimum
+
+double precision cstham , epseau , epsvid , phi1 , phi2
+double precision fion , gamasv , dcoup , sigch
+double precision cstfar , dparmn
+common / rladlv / cstham , epseau , epsvid , phi1 , phi2 , &
+ fion , gamasv , dcoup , sigch, &
+ cstfar , dparmn
+
+
+!===============================================================================
+! 13. Mouvement brownien
+
+! ACTIVATION DU MOUVEMENT BROWNIEN :
+
+integer lamvbr
+common / ilambr / lamvbr
+
+double precision kboltz
+parameter (kboltz = 1.38d-23)
+
+
+!===============================================================================
+! 14. Schema en temps, dispersion turbulente et equation de poisson
+
+! NOR : numero du sous-pas Lagrangien (1 ou 2)
+
+! NORDRE : ordre de la methode d integration (1 ou 2)
+
+! MODCPL : = 0 pour le modele incomplet
+! > 0 pour le modele complet, est egal au nombre de
+! passages avant mise en route du modele complet
+
+! IDIRLA : = 1 ou 2 ou 3 direction du modele complet
+
+! IDISTU : = 0 pas de prise en compte de la dispersion turbulente (la
+! vitesse instantanee est egale a la vitesse moyenne)
+! > 0 prise en compte de la dispersion turbulente (si k-eps
+! ou Rij-eps)
+
+! IDIFFL : =1 la dispersion turbulente de la particule est celle de
+! la particule fluide (=0 sinon)
+
+! ILAPOI : = 0 Pas de correction de pression
+! = 1 Correction de pression
+
+
+integer nor , nordre , modcpl , idirla , &
+ idistu , idiffl , ilapoi
+
+common / ila121 / nor , nordre , modcpl , idirla , &
+ idistu , idiffl , ilapoi
+
+
+!===============================================================================
+! 15. Traitement des statistiques interactions particules/frontieres
+
+! DONNEES POUR LES STATISTIQUES AUX FRONTIERES
+! --------------------------------------------
+
+! NUSBOR : NOMBRE DE VARIABLES A ENREGISTRER SUR LES FRONTIERES
+! SUPPLEMENTAIRES UTILISATEUR (CONTENU DANS NVISBR)
+! NSTBOR : debut calcul stationnaire
+! NPSTF : nombre de pas de temps pour le cumul des stats
+! NPSTF : nombre de pas de temps total des stats depuis le debut
+! du calcul, partie instationnaire comprise
+! TSTATP : Temps physique des stats aux frontieres stationnaires
+! SEUILF : Seuil en POIDS STAT de particules pour les stats
+! IMOYBR : Type de moyenne applicable pour affichage et
+! post-procesing
+
+integer nusbor , nstbor , &
+ npstf , npstft , &
+ inbrbd , iflmbd , iangbd , ivitbd , iencbd , &
+ inbr , iflm , iang , ivit , ienc , &
+ iusb(nusbrd) , imoybr(nusbrd+10)
+
+common / lagbrd / nusbor , nstbor , &
+ npstf , npstft , &
+ inbrbd , iflmbd , iangbd , ivitbd , iencbd , &
+ inbr , iflm , iang , ivit , ienc , &
+ iusb , imoybr
+
+
+double precision tstatp , seuilf
+common / rlabrd / tstatp , seuilf
+
+! NOMS DES VARIABLES STATISTIQUES
+! -------------------------------
+! Taille limitee par le fait qu on utilise NOMBRD dans
+! l ecriture des fichiers suites (lagout)
+
+character*50 nombrd(nvplmx)
+common / alabrd / nombrd
+
+! IIFRLA Pointeur dans IA sur IFRLAG pour reperage des zones
+! frontieres associees aux faces de bord
+
+integer iifrla
+common / irlord / iifrla
+
+!===============================================================================
+! 16. Visu
+
+!... NBVIS : nombre de particules a visualiser a l instant t
+! LISTE : numero des particules a visualiser
+! LIST0 : sauvegarde de LISTE pour post-processing trajectoires
+! NPLIST : nombre d enregistrement par particule
+! NVISLA : periode d aquisition
+
+integer nbvis, liste(nliste), list0(nliste), &
+ nplist(nliste), nvisla
+common / ienla1 / nbvis, liste, list0, nplist, nvisla
+
+!... Type de visualisation :
+! IENSI1 : trajectoires
+! IENSI2 : deplacements
+! IENSI3 : interaction particules/frontieres
+
+
+integer iensi1 , iensi2 , iensi3
+common / ienla3 / iensi1 , iensi2 , iensi3
+
+
+!... Contenu des flichiers resultats
+
+
+integer ivisv1 , ivisv2 , ivistp , &
+ ivisdm , iviste , ivismp , &
+ ivishp , ivisch , ivisck , ivisdk
+common / ienla5 / ivisv1 , ivisv2 , ivistp , &
+ ivisdm , iviste , ivismp , &
+ ivishp , ivisch , ivisck , ivisdk
+
+
+!... visualisation de type deplacement
+! ITLAG : nombre d enregistrement
+! TIMLAG : temps physiques lagrangien pour la visualisation
+
+
+integer itlag
+common / ienla6 / itlag
+
+double precision timlag(9999)
+common / renla7 / timlag
+
+!===============================================================================
+
+! FIN
+
diff --git a/include/mati/matiss.h b/include/mati/matiss.h
new file mode 100644
index 0000000..a837706
--- /dev/null
+++ b/include/mati/matiss.h
@@ -0,0 +1,338 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! matiss.h
+
+!===============================================================================
+
+! INCLUDE POUR MATISSE
+
+!-------------------------------------------------------------------------------
+
+
+! --> PARAMETRES PHYSIQUES EN DUR
+
+! TRFMAT : Temperature de reference pour l'air en degre
+! RRFMAT : Masse volumique de reference de l'air a TRFMAT degres
+! CRFMAT : CP de reference pour l'air
+! XMUMAT : Viscosite moleculaire dynamique de l'air consideree
+! RTURB0 : Intensite turbulente (selon k = (3/2)*(V_ref*RTURB0/100)**2)
+
+double precision trfmat, rrfmat, crfmat, xmumat, rturb0
+parameter(trfmat=20.d0)
+parameter(rrfmat=1.177d0)
+parameter(crfmat=1004.d0)
+parameter(xmumat=1.85d-5)
+parameter(rturb0=30.d0)
+
+
+! --> INDICATEUR MATISSE
+
+! IMATIS : Indicateur permettant de savoir si on utilise Matisse
+integer imatis
+common /imtmat/ imatis
+
+
+! --> VARIABLES NUMERIQUES
+
+! IMPMAT : Unite logique du fichier de resultats
+integer impmat
+common /imtfic/ impmat
+
+! IICONR : "pointeur" sur ICONRA (connectivite rayonnement et panaches)
+integer iiconr
+common /imtmem/ iiconr
+
+! ICNROK : indique si la connectivite pour le rayonnement ICONRA
+! a ete calculee ( = 1) ou non ( = 0)
+integer icnrok
+common /imtray/ icnrok
+
+
+! --> DONNEES GEOMETRIQUES
+
+! - Entiers
+
+! NPTRAN : Nombre de pas d espace transversal
+! NPLGRS : Nombre de pas d espace longitudinal
+! NELGRS : Nombre d'elements par pas longitudinal
+! NCHEST : Nombre de couche d element dans la zone stockage
+! ITYPEN : Type d'entreposage
+! * 1 : Emm
+! * 0 : Vault
+
+! - Reels
+
+! EPREGI : Epaisseur des registres/cloisons amont et aval (en y)
+! EPCHEM : Epaisseur des cheminees (en y)
+! HCONVE : Hauteur du convergent eventuel
+! RCONVE : Rapport du convergent eventuel sur le maillage (>=1)
+! HCHALI : Hauteur de la cheminee d alimentation
+! HCHEVA : Hauteur de la cheminee d evacuation
+! HFTTOI : Hauteur du faite du toit
+! PTRRES : Pas transversal du reseau de conteneur
+! FRDTRA : Facteur de reduction transversal du modele/reel
+! PLGRES : Pas longitudinal du reseau de conteneur
+! EPCHEL : Epaisseur d une couche d element (zone stockage)
+! DMCONT : Diametre des conteneurs
+! HRESO : Hauteur du reseau de colis
+! HPLEN : Hauteur du plenum inferieur (cas alveole uniquement)
+
+integer nptran, nplgrs, nelgrs, nchest, netran
+integer itypen
+common /imtgeo/ nptran, nplgrs, nelgrs, nchest, netran, &
+ itypen
+
+double precision epregi, epchem, hconve, rconve, hchali, hcheva
+double precision hfttoi, ptrres, frdtra, plgres, epchel, dmcont
+double precision hreso , hplen
+common /rmtgeo/ epregi, epchem, hconve, rconve, hchali, hcheva, &
+ hfttoi, ptrres, frdtra, plgres, epchel, dmcont, &
+ hreso , hplen
+
+
+! --> DONNEES PHYSIQUES
+
+! - Entiers
+
+! IMDCNT (0 ou 1) : Modelisation des panaches de convection naturelle
+! ICOFOR (0 ou 1) : Regime hydraulique de circulation forcee
+! ICONLG (0 ou 1) : Reseau de conteneur en ligne (pas triangulaire sinon)
+! IALVEO (0 ou 1) : Entreposage en alveole
+
+! - Reels
+
+! DTDTMX : Delta temperature max / pas de temps
+! PUICON : Puissance d'un conteneur
+! TINIT : Temperature d'air en entree en degres C
+! TCRIT : Temperature d'air de sortie critique en degres C
+! EMICON : Emissivite des conteneurs
+! EMIMUR : Emissivite des murs
+! HEPCNT : Hauteur d erosion des panaches de convection naturelle
+! DHPCNT : Debit enthalpique des panaches de convection naturelle
+! DEBMAS : Debit de circulation forcee
+! PDCCHA : Perte de charge du diffuseur de cheminee d'ALIMENTATION
+! PDCFCH : Perte de charge du filtre de cheminee d'ALIMENTATION
+! DHCHEA : Diametre hydraulique de cheminee d'ALIMENTATION
+! SDCHEA : Surface debitante de cheminee d'ALIMENTATION
+! PDCCHE : Perte de charge du diffuseur de cheminee d'EVACUATION
+! PDCCCH : Perte de charge du clapet de cheminee d'EVACUATION
+! DHCHES : Diametre hydraulique de cheminee d'EVACUATION
+! SDCHES : Surface debitante de cheminee d'EVACUATION
+! PDCALG : Perte de charge porte d'entree AMONT longitudinal
+! PDCATV : Perte de charge porte d'entree AMONT transversale (sur z)
+! ARGAMT : Angle d inclinaison du registre AMONT (degre)
+! PDCSLG : Perte de charge porte de sortie AVAL longitudinale
+! PDCSTV : Perte de charge porte de sortie AVAL transversale (sur z)
+! ARGAVL : Angle d inclinaison du registre AVAL (degre)
+! AMPPDC : Amplification des pertes de charge de reseau
+! DHALVE : Diametre hydraulique de l'alveole
+! VITREF : Vitesse de reference pour calculer les pertes de charge
+! PUITOT : Puissance totale de l'installation
+! DPVENT : Differentiel de pression athmospherique entree/sortie
+
+integer imdcnt, icofor, iconlg, ialveo
+common /imtphy/ imdcnt, icofor, iconlg, ialveo
+
+double precision dtdtmx, puicon, tinit , tcrit , emicon, emimur
+double precision hepcnt, dhpcnt, debmas, pdccha, pdcfch, dhchea
+double precision sdchea, pdcche, pdccch, dhches, sdches, pdcalg
+double precision pdcatv, argamt, pdcslg, pdcstv, argavl, amppdc
+double precision dhalve, vitref, puitot, debcon, cfecca, cfecma
+double precision dpvent
+common /rmtphy/ dtdtmx, puicon, tinit , tcrit , emicon, emimur, &
+ hepcnt, dhpcnt, debmas, pdccha, pdcfch, dhchea, &
+ sdchea, pdcche, pdccch, dhches, sdches, pdcalg, &
+ pdcatv, argamt, pdcslg, pdcstv, argavl, amppdc, &
+ dhalve, vitref, puitot, debcon, cfecca, cfecma, &
+ dpvent
+
+
+! --> CARTES 2D ET 3D
+
+! - Dimensions
+
+! NZONMX : nombre de zones maximum pour la definition des
+! - Cartes 2D des pertes de charges de porte d'entree
+! - Cartes 2D des pertes de charges de porte de sortie
+! - Cartes 3D des pertes de charges reseau
+! - Cartes 3D des puissances
+! NCARTE : nombre de cartes 2D et 3D a definir
+! NMTDIR : nombre de directions d'espace
+
+! - Indicateurs de numero de carte (pour NZOCAR et VIZCAR)
+! de 1 a NCARTE
+
+! ICPDCE : indicateur carte 2D pdc de porte d'entree
+! ICPDCS : indicateur carte 2D pdc de porte de sortie
+! ICPDCR : indicateur carte 2D pdc de reseau
+! ICPUIS : indicateur carte 3D puissance
+
+! - Indicateurs de direction pour les cartes (NZOCAR, VIZCAR, VZOCAR)
+! de 1 a NMTDIR
+
+! ILIGNE : ligne ( x variable, une ligne = (y;z) constant )
+! IRANGE : rangee ( y variable, une rangee = (x;z) constant )
+! IALTIT : altitude ( z variable, une altitude = (x;y) constant )
+
+! - Tableaux de donnees
+
+! NZOCAR(NMTDIR, NCARTE)
+! : nombre de zones pour chaque direction de chaque carte
+! VIZCAR(2, NZONMX, NMTDIR, NCARTE)
+! : definition du debut et de la fin des zones pour
+! chaque zone dans chaque direction de chaque carte
+! c'est un reel puisque l'on peut definir une demi ligne
+! par exemple
+! VZOCAR(NZONMX, NMTDIR)
+! : valeurs associees a la carte 3D de puissance pour
+! chaque zone dans chaque direction
+! en x et y, valeurs comprises entre 0 et 1, indiquant
+! la fraction de colis representee sur une maille
+! en z, les valeurs sont renormalisees a l'unite
+
+! il n'est plus necessaire de stocker les valeurs pour les
+! cartes de pertes de charges car il n'y a que 2 valeurs
+! possibles : 1. perte de charge (colis present)
+! 0. pas de perte de charge
+! par defaut, on considere qu'il n'y a pas de perte de
+! charge ; on repere avec VIZCAR le debut et la fin
+! des zones dans lesquelles les pertes de charges doivent
+! etre activees
+
+! - Parametres des zones
+
+integer nzonmx
+parameter(nzonmx=100)
+
+! - Parametres des types de carte
+
+integer ncarte
+parameter(ncarte=4)
+
+integer icpdce, icpdcs, icpdcr, icpuis
+parameter(icpdce=1)
+parameter(icpdcs=2)
+parameter(icpdcr=3)
+parameter(icpuis=4)
+
+! - Parametres des directions
+
+integer nmtdir
+parameter(nmtdir=3)
+
+integer iligne, irange, ialtit
+parameter(iligne=1)
+parameter(irange=2)
+parameter(ialtit=3)
+
+! - Numero des cartes
+
+integer nzocar(nmtdir, ncarte)
+common /imtcar/ nzocar
+
+! - Valeur des cartes
+
+double precision vizcar(2, nzonmx, nmtdir, ncarte)
+double precision vcarth(nzonmx, nmtdir)
+common /rmtcar/ vizcar, vcarth
+
+
+! --> NUMERO DES SCALAIRES
+
+! ITAAMT : temperature air ambiant
+! ITPCMT : temperature de peau des colis
+! ITPPMT : temperature de peau des parois
+! (murs et alveoles eventuelles)
+! A utiliser comme
+! ISCA(ITAAMT), ISCA(ITPCMT), ISCA(ITPPMT)
+
+integer itaamt, itpcmt, itppmt
+parameter(itaamt=1)
+parameter(itpcmt=2)
+parameter(itppmt=3)
+
+
+! --> NUMERO DES COULEURS
+
+! - Couleurs d'elements
+
+! ICMTDF : couleur par defaut ("df" pour "defaut")
+! ICMTST : zone de stockage ("st" pour "stockage")
+! ICMTCI : cheminee d'alimentation ("ci" pour "cheminee inlet")
+! ICMTCO : cheminee d'evacuation ("co" pour "cheminee outlet")
+! ICMTRI : registre amont ("ri" pour "registre inlet")
+! ICMTRO : registre aval ("ro" pour "registre outlet")
+! ICMTJI : jeu entre colis et registre amont
+! ("ji" pour "jeu inlet")
+! ICMTJO : jeu entre colis et registre aval
+! ("jo" pour "jeu outlet")
+
+! ICMTCI et ICMTCO designent la partie des cheminees situees
+! au dessus des convergents enventuels
+! ICMTJI et ICMTJO ne sont utilises que pour les configurations
+! avec alveoles (et il n'y a pas de jeu aval en cathedrale)
+
+integer icmtdf, icmtst
+integer icmtci, icmtco, icmtri, icmtro, icmtji, icmtjo
+parameter(icmtdf = 0)
+parameter(icmtst = 8)
+parameter(icmtci = 3)
+parameter(icmtco = 6)
+parameter(icmtri = 2)
+parameter(icmtro = 4)
+parameter(icmtji = 7)
+parameter(icmtjo = 9)
+
+! - Couleurs de faces (conditions aux limites)
+
+! ICMTFI : entree ("i" pour "in")
+! ICMTFO : sortie ("o" pour "out")
+! ICMTFG : sol ("g" pour "ground")
+! ICMTFC : plafond ("c" pour "ceiling")
+! ICMTFS : symetrie ("s" pour "symmetry")
+! ICMTFW : paroi ("w" pour "wall")
+
+integer icmtfi, icmtfo, icmtfg, icmtfc, icmtfs, icmtfw
+parameter(icmtfi = 5)
+parameter(icmtfo = 1)
+parameter(icmtfg = 10)
+parameter(icmtfc = 11)
+parameter(icmtfs = 12)
+parameter(icmtfw = 13)
+
+
+! --> VARIABLES DEDUITES
+
+! HERCNT : Hauteur d'erosion HEPCNT reduite a un nombre entier de
+! mailles en altitude (ici pour eviter de faire le calcul
+! plusieurs fois, et donc de risquer des erreurs)
+
+double precision hercnt
+common /rmtbid/ hercnt
+
+! FIN
diff --git a/include/pprt/ppcpfu.h b/include/pprt/ppcpfu.h
new file mode 100644
index 0000000..dc287b2
--- /dev/null
+++ b/include/pprt/ppcpfu.h
@@ -0,0 +1,98 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! cpincl.h
+
+!===============================================================================
+
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE
+! VARIABLE COMMUNE ENTRE
+! COMBUSTION DU CHARBON PULVERISE
+! COMBUSTION DU FIOUL LOURD
+
+! XSI --> XSI = 3,76 pour de l'air
+
+double precision xsi
+common / rcpfu1 / xsi
+
+! nb de moles de I dans J
+
+double precision ao2f3,acof3,an2f3,ah2of3
+double precision ao2f4,an2f4,ah2of4,aco2f4
+double precision ah2of5
+double precision ao2f6,an2f6,ah2of6,aco2f6
+double precision ao2f7,an2f7,ah2of7,aco2f7
+
+common / rcpfu2 / ao2f3,acof3,an2f3,ah2of3, &
+ ao2f4,an2f4,ah2of4,aco2f4, &
+ ah2of5, &
+ ao2f6,an2f6,ah2of6,aco2f6, &
+ ao2f7,an2f7,ah2of7,aco2f7
+
+! Equation sur YCO2
+
+ integer ieqco2 , iyco2
+ common/equco2 / ieqco2 , iyco2
+
+! Combustion heterogene avec le CO2
+
+ integer ihtco2
+ common/ehtco2 / ihtco2
+
+! Equation sur NOX :
+! ================
+
+! IEQNOX = 0 pas de NOx
+! = 1 calcul du NOx
+
+ integer ieqnox
+ common/equnox / ieqnox
+
+! Scalaires supplementaires : fraction massique de HCN et NO
+! temperature air
+
+ integer iyhcn , iyno , itaire
+ common/equnox / iyhcn , iyno , itaire
+
+! Propce supplementaires :
+
+! Conversion HCN en NO : EXP(-E1/RT)
+! Conversion HCN en NO : EXP(-E2/RT)
+! NO thermique (Zel'dovitch) : EXP(-E3/RT)
+
+
+ integer ighcn1 , ighcn2 , ignoth
+ common/pronox / ighcn1 , ighcn2 , ignoth
+
+! Temperature moyenne d'entree
+! Taux de vapeur moyen
+
+ double precision taire
+ common /noxdbl/ taire
+
+
+! FIN
diff --git a/include/pprt/ppincl.h b/include/pprt/ppincl.h
new file mode 100644
index 0000000..3f915de
--- /dev/null
+++ b/include/pprt/ppincl.h
@@ -0,0 +1,340 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! ppincl.h
+
+!===============================================================================
+
+! INCLUDE GENERAL PROPRE A LA PHYSIQUE PARTICULIERE
+
+! necessite ppthch et ppppar
+!-------------------------------------------------------------------------------
+
+
+!--> TABLEAU INDICATEURS DU CHOIX DE LA PHYSIQUE PARTICULIERE CHOISIE
+
+integer nmodmx
+parameter(nmodmx = 50)
+integer ippmod(nmodmx)
+common / iippmd / ippmod
+
+! ---- Indicateur global de physique particuliere
+! IPPMOD(IPHPAR) = 0 : pas de physique particuliere
+! 1 : physique particuliere enclenchee
+! 2 : physique particuliere avec pilotage du
+! rayonnement par fichier parametrique
+integer iphpar
+
+! ---- Modeles propres a la combustion gaz ICO...
+integer icod3p, icodeq, icoebu, icobml, icolwc
+
+! ---- Modeles propres a la combustion charbon pulverise ICP...
+integer icp3pl
+
+! ---- Modeles propres aux versions effet Joule et conduction ionique
+integer ieljou, ielarc, ielion
+
+! ---- Modeles propres a la combustion charbon pulverise couplee Lagrangien
+integer icpl3c
+! ---- Modeles propres a la combustion fuel
+integer icfuel
+
+! ---- Modele compressible
+integer icompf
+
+! ---- Modele atmospherique
+integer iatmos
+
+! ---- Modele aerorefrigerants
+integer iaeros
+
+parameter (iphpar = 1 , icod3p = 2 , icodeq = 3 , &
+ icoebu = 4 , icobml = 5 , icolwc = 6 , &
+ icp3pl = 7 , icpl3c = 8 , icfuel = 9 , &
+ ieljou = 10, ielarc = 11, ielion = 12, &
+ icompf = 13, iatmos = 14, iaeros = 15)
+
+
+!--> NOMBRE DE VARIABLES ALGEBRIQUES OU D'ETAT
+! pour la physique particuliere NSALPP
+! total NSALTO
+integer nsalpp, nsalto
+
+
+!--> POINTEURS VARIABLES COMBUSTION GAZ
+
+! ---- Variables transportees
+integer ifm, ifp2m, iygfm, icm, icp2m, ifpcpm
+integer iyfm, iyfp2m, icoyfp
+
+! ---- Variables d'etat
+integer iym(ngazgm), itemp, ifmin, ifmax
+integer ickabs, it4m, it3m
+
+! --- Pointeurs proprietes (PROPCE)
+integer itsc
+
+!--> POINTEURS VARIABLES COMBUSTION CHARBON PULVERISE
+
+! ---- Variables transportees
+! Phase continue (melange gazeux)
+integer if1m(ncharm), if2m(ncharm)
+integer if3m, if4m, if4p2m, if5m, if6m, if7m
+integer if3mc2
+! Phase dispersee (classe de particules)
+integer ixck(nclcpm), ixch(nclcpm), inp(nclcpm)
+integer ih2(nclcpm) , ixwt(nclcpm)
+
+! ---- Variables d'etat
+! Phase continue (melange gazeux)
+integer iym1(ngazem), itemp1 , irom1 , immel
+! Phase dispersee (classes de particules)
+integer itemp2(nclcpm), irom2(nclcpm), idiam2(nclcpm)
+integer ix2(nclcpm)
+integer igmdch(nclcpm), igmhet(nclcpm) , ighco2(nclcpm)
+integer igmdv1(nclcpm), igmdv2(nclcpm)
+integer igmsec(nclcpm)
+
+!--> POINTEURS VARIABLES COMBUSTION FUEL
+
+! ---- Variables transportees
+! Phase continue
+ integer ifvap, ifhtf
+! Phase dispersee
+ integer ihlf(nclcpm)
+ integer ixkf(nclcpm), ixfol(nclcpm), ing(nclcpm)
+ integer itemp3(nclcpm), irom3(nclcpm), idiam3(nclcpm)
+ integer ix3(nclcpm)
+
+! ---- Variables d'etat
+! Phase continue
+ integer iyfol(nclcpm)
+! Phase dispersee
+ integer ih1hlf(nclcpm), igmhtf(nclcpm), igmeva(nclcpm)
+
+!--> POINTEURS VARIABLES VERSION ELECTRIQUES
+
+! Dimension des 'vecteurs electriques' = NDIMVE
+integer ndimve
+parameter (ndimve = 3)
+
+! ---- Variables transportees
+! Potentiel reel = IPOTR
+! Potentiel imaginaire = IPOTI
+! Composantes du potentiel vecteur magnetique = IPOTVA()
+! Fraction massique des constituants = IYCOEL()
+
+integer ipotr, ipoti, ipotva(ndimve), iycoel(ngazgm)
+
+! ---- Variables d'etat dans PROPCE
+! Puissance volumique dissipee par effet Joule W/m3 = IEFJOU
+! Forces electromagnetiques de Laplace en N/m3 = ILAPLA()
+! Charge electrique volumique C/m3 = IQELEC
+! Densite de courant electrique reelle A/m2 = IDJR()
+! Puissance volumique rayonnee W/m3
+! Densite de courant electrique imaginaire en A/m2 = IDJI()
+! ou coeff d'absorption en m-1 = IDRAD
+
+! Les autres variables deduites seront locales pour
+! economiser de la place memoire.
+! Cela n'empeche pas de les sortir en post-traitement.
+! Gradient du potentiel reel en V/m = IGPOTR()
+! Gradient du potentiel imaginaire en V/m = IGPOTI()
+! Composantes du champ magnetique en Tesla = IBMG()
+
+
+integer iefjou , iqelec , ilapla(ndimve)
+integer idjr(ndimve) , idji(ndimve) , idrad
+
+!--> POINTEURS VARIABLES CONDUCTION IONIQUE
+
+integer nesiom
+parameter (nesiom = 10)
+integer nespio
+
+! ---- Variables transportees
+! par espece
+integer iymion(nesiom)
+
+! ---- Variables d'etat
+
+
+!--> POINTEURS COMPRESSIBLE
+
+! ---- Variables transportees par phase
+integer irho(nphsmx), ienerg(nphsmx), itempk(nphsmx)
+! ---- Proprietes supplementaires par phase
+integer icv(nphsmx), iviscv(nphsmx), ieos(nphsmx)
+
+! COMMON complete plus bas
+
+! ---- Aliases pour les conditions aux limites
+integer irun(nphsmx), irunh(nphsmx)
+
+common / iaclcf / irun , irunh
+
+! ---- Proprietes supplementaires par phase
+double precision cv0(nphsmx), viscv0(nphsmx)
+
+common / rpocfp / cv0 , viscv0
+
+! ---- Prediction de pression par une equation d'evolution
+integer ippred(nphsmx)
+! ---- Flux de masse specifique pour la vitesse
+integer iflmau(nphsmx)
+! ---- Utilisation de la pression predite pour resoudre Navier-Stokes
+integer igrdpp(nphsmx)
+! --- Conditions aux limites prenant en compte l'equilibre hydrostatique
+integer icfgrp(nphsmx)
+
+common / ipocfo / ippred , iflmau , igrdpp , icfgrp
+
+! ---- Flux de bord convectifs QDM et energie (numero de PROPFB)
+integer ifbrhu(nphsmx) , ifbrhv(nphsmx) , &
+ ifbrhw(nphsmx) , ifbene(nphsmx)
+
+common / ipobcf/ ifbrhu , ifbrhv , &
+ ifbrhw , ifbene
+
+
+!--> POINTEURS AEROREFRIGERANTS
+
+! ---- Variables transportees
+integer itemp4, ihumid
+
+
+!--> POINTEUR RELATIF A LA VARIABLE ENTHALPIE
+
+integer ihm
+
+
+!--> REMPLISSAGE COMMON POINTEURS VARIABLES TRANSPORTEES
+! VARIABLES D'ETAT
+
+common / ipovst / &
+
+! ---- Combustion gaz
+ ifm, ifp2m, iygfm, icm, icp2m, ifpcpm, &
+ iyfm, iyfp2m, icoyfp, &
+! ---- Combustion charbon pulverise
+ if1m, if2m, if3m, if4m, if4p2m, if5m, &
+ if6m, if7m, if3mc2 , &
+ ixck, ixch, inp , ih2 , ixwt , &
+! ---- Combustion fuel
+ ihlf, ifvap, ifhtf, &
+ ixkf, ixfol, ing, ix3 , &
+
+! ---- Versions electriques
+ ipoti, ipotr, ipotva, iycoel, &
+! ---- Conduction ionique
+ nespio, iymion, &
+
+! ---- Compressible
+ irho , ienerg , itempk , &
+ icv , iviscv , ieos , &
+! ---- Enthalpie
+ ihm
+
+common / ipovsa / &
+
+! ---- Nb de variables d'etat ou algebriques
+ nsalpp, nsalto, &
+! ---- Combustion gaz
+ iym, itemp, ifmin, ifmax, ickabs, it4m, &
+ it3m, &
+! ---- Combustion charbon pulverise
+ iym1, itemp1, irom1 ,immel, &
+ itemp2, irom2, idiam2, ix2, &
+ igmdch, igmdv1, igmdv2, igmhet, ighco2 , &
+ igmsec, &
+! ---- Combustion fuel
+ iyfol, itemp3, irom3 , idiam3, &
+ ih1hlf, igmeva, igmhtf, &
+! ---- Versions electriques
+ iefjou, ilapla , iqelec , &
+ idjr , idji , idrad , &
+! ---- Version aerorefrigerant
+ itemp4, ihumid
+
+!--> Modele de flamme de premelange LWC
+
+common / ilwcpp / itsc
+
+!--> OPTIONS NUMERIQUES
+
+! ---- Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+double precision srrom
+
+common / roptcp / srrom
+
+
+!--> GRANDEURS FOURNIES PAR L'UTILISATEUR EN CONDITIONS AUX LIMITES
+! PERMETTANT DE CALCULER AUTOMATIQUEMENT LA VITESSE, LA TURBULENCE,
+! L'ENTHALPIE D'ENTREE.
+! LES GRANDEURS CI-DESSOUS SONT COMMUNES A LA COMBUSTION GAZ ET AU
+! CHARBON.
+
+! POUR LES ENTREES UNIQUEMENT , IENT ETANT LE NUMERO DE ZONE FRONTIERE
+
+! IQIMP (IENT) --> Indicateur zone a debit impose
+! ICALKE(IENT) --> Indicateur type de condition sur la turbulence
+! 0 : Utilisateur donne les valeurs
+! 1 : Automatique a partir de DH
+! et de la vitesse d'entree
+! 2 : Automatique a partir de l'intensite turbulente
+! et de la vitesse d'entree
+! XINTUR(IENT) --> Intensite turbulente (k=1.5(UREF*XINTUR)**2)
+! DH (IENT) --> Diametre hydraulique
+! QCALC (IENT) --> Debit calcule : raf la ; direc ds le sspgm
+
+integer iqimp(nozppm) , icalke(nozppm)
+double precision xintur(nozppm) , dh(nozppm)
+!, QCALC(NOZPPM)
+
+common / ippcli / iqimp , icalke
+common / rppcli / xintur , dh
+!, QCALC
+
+
+! Pointeur dans IA sur IZFPPP pour reperage des zones frontieres associees
+! aux faces de bord
+! Peut etre serait il plus approprie de le verser dans pointe
+
+
+integer iizfpp
+common / ifropp / iizfpp
+
+! NZFPPP Nombre de zones de bord (sur le proc courant)
+! ILZPPP Liste des numeros de zone de bord (du proc courant)
+! NOZAPM Numero de zone de bord atteint max
+! exemple zones 1 4 2 : NZFPPP=3,NOZAPM=4
+
+integer nozapm, nzfppp, ilzppp(nbzppm)
+common / izonpp / nozapm, nzfppp, ilzppp
+
+! FIN
diff --git a/include/pprt/ppppar.h b/include/pprt/ppppar.h
new file mode 100644
index 0000000..a873a2e
--- /dev/null
+++ b/include/pprt/ppppar.h
@@ -0,0 +1,54 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! ppppar.h
+
+!===============================================================================
+
+! INCLUDE GENERAL PROPRE A LA PHYSIQUE PARTICULIERE
+! CONTENANT DES PARAMETRES COMMUNS
+! (A PLUSIEURS INCLUDES)
+!-------------------------------------------------------------------------------
+
+! --> NB DE ZONES DE BORD MAXIMAL
+integer nbzppm
+parameter (nbzppm=2000)
+! --> NUMERO DE ZONE DE BORD MAXIMAL
+integer nozppm
+parameter (nozppm=2000)
+
+
+!--> POINTEURS VARIABLES COMBUSTION CHARBON PULVERISE cpincl, ppincl
+
+! NCHARM --> Nombre maximal de charbons
+! NCPCMX --> Nombre maximal de classes par charbon
+! NCLCPM --> Nombre total de classes
+
+integer ncharm , ncpcmx , nclcpm
+parameter (ncharm=3, ncpcmx=10, nclcpm=ncharm*ncpcmx)
+! -->
+! FIN
diff --git a/include/pprt/ppthch.h b/include/pprt/ppthch.h
new file mode 100644
index 0000000..87afe54
--- /dev/null
+++ b/include/pprt/ppthch.h
@@ -0,0 +1,101 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! ppthch.h
+
+!===============================================================================
+
+! INCLUDE THERMOCHIMIE POUR LA PHYSIQUE PARTICULIERE
+
+!-------------------------------------------------------------------------------
+
+
+
+!--> CONSTANTES THERMOCHIMIE
+
+! RR --> Constante des gaz parfaits en J/mol/K
+! TREFTH --> Temperature de reference (K)
+! VOLMOL --> Volume molaire dans les conditions NTP
+! T = 0 C et P = 1 atm
+
+double precision rr
+double precision trefth, prefth, volmol
+parameter ( rr = 8.31434d0 , &
+ trefth = 25.d0 + tkelvi , &
+ prefth = 1.01325d5 , &
+ volmol = 22.41d-3 )
+
+!--> DONNEES
+
+! NRGAZ --> Nb de reactions globales en phase gaz
+! NRGAZM --> Nb maximal de reactions globales en phase gaz
+! NATO --> Nb d especes atomiques (C,H,..)
+! NATOM --> Nb maximal d especes atomiques (C,H,..)
+! NGAZE --> Nb de constituants gazeux elementaires
+! NGAZEM --> Nb maximal de constituants gazeux elementaires
+! NGAZG --> Nb d especes globales (ex:Fuel,Oxyd,Prod1,Prod2)
+! NGAZGM --> Nb maximal d especes globales
+! NPO --> Nb de points de tabulation
+! NPOT --> Nb maximal de points de tabulation
+! TH --> Temperature en Kelvin
+! EHGAZG(G,IT) --> Enthalpie massique (J/kg) de l espece globale
+! no G a la temperature T(IT)
+! WMOLG(G) --> Masse molaire de l espece globale
+! EHGAZE(G) --> Enthalpie massique (J/kg) constituant gazeux
+! elementaire no E a la temperature T(IT)
+! WMOLE(G) --> Masse molaire du constituant gazeux elementaire
+! WMOLAT(E) --> Masse molaire des atomes (C,H,..)
+! IATC, IATH --> Pointeur dans WMOLEL pour les ecpeces
+! IATO, IATN, IATS elementaires (C,H,..)
+! FS(R) --> Taux de melange pour la reaction gloable R
+! STOEG(G,R) --> Stoechio en especes globales des reactions
+! pour l espece no G et pour la reaction no R
+! CKABSG(G) --> Coefficient d'absorption des especes globales
+! CKABS1 --> Coefficient d'absorption du melange gazeux
+! (en CP)
+! DIFTL0 --> Diffusivite dynamique en kg/(m s)
+
+integer ngazgm, ngazem, npot, natom, nrgazm
+parameter( ngazgm = 25 , ngazem = 20 , &
+ npot = 500 , natom = 5 , nrgazm = 1 )
+integer iatc, iath, iato, iatn , iats
+parameter( iatc = 1, iath = 2, iato = 3, iatn = 4 , iats = 5 )
+
+integer npo, ngaze, ngazg, nato, nrgaz
+common / tchppi / npo, ngaze, ngazg, nato, nrgaz
+
+double precision th(npot), &
+ ehgaze(ngazem,npot), ehgazg(ngazgm,npot), &
+ wmole(ngazem), wmolg(ngazgm), wmolat(natom), &
+ stoeg(ngazgm,nrgazm), fs(nrgazm), &
+ ckabsg(ngazgm), ckabs1, &
+ diftl0, xco2, xh2o
+! ..v.7..1....v ....2....v....3....v....4....v....5....v....6....v....7.I
+common / tchppr / th, ehgaze, ehgazg, wmole, wmolg, wmolat, &
+ stoeg, fs, ckabsg, ckabs1, diftl0, xco2, xh2o
+
+
diff --git a/include/rayt/radiat.h b/include/rayt/radiat.h
new file mode 100644
index 0000000..8db7efb
--- /dev/null
+++ b/include/rayt/radiat.h
@@ -0,0 +1,217 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! radiat.h
+!===============================================================================
+
+
+!--> IIRAYO = 0 pas de rayonnement, 1 DOM, 2 P-1
+!--> NPHASC = 1 (phase qui rayonne) augmentee eventuellement
+! du nombre de classe (Charbon)
+!--> IRAPHA = numero de la phase du rayonnement
+!--> IIMPAR = 0,1,2 niveau d'impression du calcul des temperatures de paroi
+!--> IIMLUM = 0,1,2 niveau d'impression de la resolution luminance
+!--> IMODAK = 1 calcul du coefficient d'absorption a l'aide de Modak
+! = 0 on n'utilise pas Modak
+
+integer iirayo , &
+ nphasc , &
+ irapha , &
+ iimpar , &
+ iimlum , &
+ imodak
+common / iiiray / iirayo , &
+ nphasc , &
+ irapha , &
+ iimpar , &
+ iimlum , &
+ imodak
+
+
+
+!--> pointeur dans le macrotableau PROPCE :
+
+! ITSRE --> Terme source explicite
+! ITSRI --> Terme source implicite
+! IQX,IQY,IQZ --> Composantes du vecteur densite de flux radiatif
+! IABS --> part d'absorption dans le terme source explicite
+! IEMI --> part d'emission dans le terme source explicite
+! ICAK --> coefficient d'absorption
+! ILUMIN --> POINTEUR QUI PERMET DE REPERER L INTEGRALE DE LA
+! LUMINANCE DANS LA TABLEAU PROPCE
+
+
+integer itsre(1+nclcpm) , &
+ itsri(1+nclcpm) , &
+ iqx , &
+ iqy , &
+ iqz , &
+ iabs(1+nclcpm) , &
+ iemi(1+nclcpm) , &
+ icak(1+nclcpm) , &
+ ilumin
+
+common / iprayo / itsre , &
+ itsri , &
+ iqx , &
+ iqy , &
+ iqz , &
+ iabs , &
+ iemi , &
+ icak , &
+ ilumin
+
+!--> pointeur dans le macrotableau PROPFB :
+! ITPARO --> temperature de paroi
+! IQINCI --> densite de flux incident radiatif
+! IXLAM --> conductivite thermique de la paroi
+! IEPA --> epaisseur de la paroi
+! IEPS --> emissivite de la paroi
+! IFNET --> Flux Net radiatif
+! IFCONV --> Flux Convectif
+! IHCONV --> Coef d'echange fluide
+
+integer itparo , &
+ iqinci , &
+ ixlam , &
+ iepa , &
+ ieps , &
+ ifnet , &
+ ifconv , &
+ ihconv
+
+common / imrayo / itparo , &
+ iqinci , &
+ ixlam , &
+ iepa , &
+ ieps , &
+ ifnet , &
+ ifconv , &
+ ihconv
+
+
+!--> XNP1MX : pour le modele P-1,
+! pourcentage de cellules pour lesquelles on admet que l'epaisseur
+! optique depasse l'unite bien que ce ne soit pas souhaitable
+
+double precision xnp1mx
+common / rrayp1 / xnp1mx
+
+!--> ISTPP1 : pour le modele P-1,
+! indicateur d'arret mis a 1 dans ppcabs si le pourcentage de cellules
+! pour lesquelles l'epaisseur optique depasse l'unite est superieur a
+! XNP1MX (on s'arrete a la fin du pas de temps)
+
+integer istpp1
+common / irayp1 / istpp1
+
+!--> IDIVER =0 1 ou 2 suivant le calcul du terme source explicite
+
+integer idiver
+common / ikrayo / idiver
+
+!--> parametre sur le nombre de directions de discretisation angulaire
+
+integer ndirs8
+parameter ( ndirs8 = 16 )
+
+!--> suite de calcul (0 : non, 1 : oui)
+
+integer isuird
+common / israyo / isuird
+
+!--> frequence de passage dans le module (=1 si tous les pas de temps)
+
+integer nfreqr
+common / ifrayo / nfreqr
+
+!--> nombre de bandes spectrales
+
+integer nbande
+common / ibande / nbande
+
+!--> nombre de directions de discretisation angulaire
+
+integer ndirec
+common / idirec / ndirec
+
+
+!--> Informations sur les zones frontieres
+
+! NBZRDM Nombre max. de zones frontieres
+! NOZRDM Numero max. des zones frontieres
+
+integer nbzrdm
+parameter (nbzrdm=2000)
+integer nozrdm
+parameter (nozrdm=2000)
+
+! IIZFRD Pointeur dans IA sur IZFRAD pour reperage des zones
+! frontieres associees aux faces de bord
+
+integer iizfrd
+common / ifrord / iizfrd
+
+! NZFRAD Nombre de zones de bord (sur le proc courant)
+! ILZRAY Liste des numeros de zone de bord (du proc courant)
+! NOZARM Numero de zone de bord atteint max
+! exemple zones 1 4 2 : NZFRAD=3,NOZARM=4
+
+integer nozarm, nzfrad, ilzrad(nbzrdm)
+common / izonrd / nozarm, nzfrad, ilzrad
+
+
+!--> Types de condition pour les temperatures de paroi :
+! ITPIMP Profil de temperature imposee
+! IPGRNO Parois grises ou noires
+! IPREFL Parois reflechissante
+! IFGRNO Flux de conduction impose dans la paroi
+! ET paroi non reflechissante (EPS non nul)
+! IFREFL Flux de conduction impose dans la paroi
+! ET paroi reflechissante (EPS = 0)
+
+integer itpimp , ipgrno , iprefl , ifgrno , ifrefl
+parameter(itpimp=1 , ipgrno=21, iprefl=22, ifgrno=31, ifrefl=32)
+
+
+!--> sortie postprocessing sur les facettes de bord
+
+integer nbrayf
+parameter ( nbrayf = 8 )
+
+character*80 nbrvaf(nbrayf)
+common / aenray / nbrvaf
+
+integer irayvf(nbrayf)
+common / ienray / irayvf
+
+
+integer itparp , iqincp , ixlamp , iepap , &
+ iepsp , ifnetp , ifconp , ihconp
+parameter ( itparp=1 , iqincp=2 , ixlamp=3 , iepap=4 , &
+ iepsp=5 , ifnetp=6 , ifconp=7 , ihconp=8 )
+
diff --git a/libsyrcs/Makefile.am b/libsyrcs/Makefile.am
new file mode 100644
index 0000000..17a5e56
--- /dev/null
+++ b/libsyrcs/Makefile.am
@@ -0,0 +1,40 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_CPPFLAGS = @BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MPI_CPPFLAGS@
+AM_CFLAGS =
+AM_LDFLAGS =
+
+# Library source files
+
+lib_LTLIBRARIES = libsyrcs.la
+libsyrcs_la_LIBADD =
+
+libsyrcs_la_SOURCES = \
+syr_comm.c \
+syr_coupling.c \
+syr_cs.c \
+syr_defs.c
+
+libsyrcs_la_LDFLAGS = -no-undefined -version-info 0:0:0
diff --git a/libsyrcs/Makefile.in b/libsyrcs/Makefile.in
new file mode 100644
index 0000000..ba39eae
--- /dev/null
+++ b/libsyrcs/Makefile.in
@@ -0,0 +1,601 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = libsyrcs
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libsyrcs_la_DEPENDENCIES =
+am_libsyrcs_la_OBJECTS = syr_comm.lo syr_coupling.lo syr_cs.lo \
+ syr_defs.lo
+libsyrcs_la_OBJECTS = $(am_libsyrcs_la_OBJECTS)
+libsyrcs_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libsyrcs_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libsyrcs_la_SOURCES)
+DIST_SOURCES = $(libsyrcs_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = @BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MPI_CPPFLAGS@
+AM_CFLAGS =
+AM_LDFLAGS =
+
+# Library source files
+lib_LTLIBRARIES = libsyrcs.la
+libsyrcs_la_LIBADD =
+libsyrcs_la_SOURCES = \
+syr_comm.c \
+syr_coupling.c \
+syr_cs.c \
+syr_defs.c
+
+libsyrcs_la_LDFLAGS = -no-undefined -version-info 0:0:0
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsyrcs/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu libsyrcs/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libsyrcs.la: $(libsyrcs_la_OBJECTS) $(libsyrcs_la_DEPENDENCIES)
+ $(libsyrcs_la_LINK) -rpath $(libdir) $(libsyrcs_la_OBJECTS) $(libsyrcs_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/syr_comm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/syr_coupling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/syr_cs.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/syr_defs.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-libLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libsyrcs/syr_comm.c b/libsyrcs/syr_comm.c
new file mode 100644
index 0000000..b367735
--- /dev/null
+++ b/libsyrcs/syr_comm.c
@@ -0,0 +1,1718 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*===========================================================================
+ * Definitions of base communication functions
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+#if defined(HAVE_SOCKET)
+#include <netdb.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_file.h>
+#include <bft_error.h>
+
+/*---------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "syr_defs.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "syr_comm.h"
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* Fake brace to force Emacs auto-indentation back to column 0 */
+#endif
+#endif /* __cplusplus */
+
+/*===========================================================================
+ * Constants and Macros
+ *===========================================================================*/
+
+#define CS_COMM_SOCKET_HEADER "CS_comm_socket"
+
+#define CS_COMM_SOCKET_N_MAX 65
+#define CS_COMM_L_HOSTNAME 256
+#define CS_COMM_L_NOM_MAX 256
+
+#define SYR_COMM_L_TYPE_NAME 2
+
+/* If SSIZE_MAX is not defined by the sytem headers, we take the minimum value
+ required by POSIX (for low level reads/writes with sockets). */
+
+#if !defined(SSIZE_MAX)
+# define SSIZE_MAX 32767
+#endif
+
+typedef enum {
+
+ SYR_COMM_MODE_RECEIVE, /* Receive */
+ SYR_COMM_MODE_SEND /* Send */
+
+} syr_comm_mode_t;
+
+/*===========================================================================
+ * Structure definition
+ *===========================================================================*/
+
+struct _syr_comm_t {
+
+ char *name; /* Communicator name */
+
+ int proc_rank; /* Rank of first distant process (MPI) */
+ int *socket; /* Array of socket numbers */
+
+ int swap_endian; /* Force big-endian communications */
+
+ syr_comm_type_t type; /* Communicator type */
+ int n_procs; /* Number of communicating processes */
+ int echo; /* Log (printout) level of communications */
+
+ int *n_sec_elts; /* Number of elements in a section for each
+ proc (when reading) */
+
+};
+
+/*===========================================================================
+ * Global variables
+ *===========================================================================*/
+
+#if defined(HAVE_SOCKET)
+
+static char syr_glob_comm_err_socket[]
+ = "Error in socket communication:\n"
+ "%s (proc %4d)\n";
+
+#endif
+
+/*===========================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*--------------------------------------------------------------------------
+ * Print "wait on message"
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_echo_pre(const syr_comm_t *comm,
+ int proc_id,
+ syr_comm_mode_t mode)
+{
+ assert(comm != NULL);
+
+ switch(mode) {
+
+ case SYR_COMM_MODE_RECEIVE:
+ if (comm->n_procs == 1)
+ printf("\nMessage recu sur \"%s\":\n", comm->name);
+ else
+ printf("\nMessage recu sur \"%s\" (proc %d):\n",
+ comm->name, proc_id + 1);
+
+ break;
+
+ case SYR_COMM_MODE_SEND:
+ if (comm->n_procs == 1)
+ printf("\nMessage envoye sur \"%s\":\n", comm->name);
+ else
+ printf("\nMessage envoye sur \"%s\" (proc %d):\n",
+ comm->name, proc_id + 1);
+
+ break;
+
+ default:
+ assert (mode == SYR_COMM_MODE_RECEIVE ||
+ mode == SYR_COMM_MODE_SEND );
+
+ }
+
+ fflush(stdout);
+}
+
+/*--------------------------------------------------------------------------
+ * Print a section header
+ *
+ * 1. section name
+ * 2. number of elements
+ * 3. element type name
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_echo_header(const syr_comm_t *comm,
+ const char *sec_name,
+ int n_elts,
+ const char *type_name)
+{
+ char sec_name_out[SYR_COMM_L_SEC_NAME + 1];
+
+ assert(comm != NULL);
+
+ strncpy(sec_name_out, sec_name, SYR_COMM_L_SEC_NAME);
+ sec_name_out[SYR_COMM_L_SEC_NAME] = '\0';
+
+ printf(" nom de rubrique : \"%s\"\n"
+ " nombre de valeurs : %d\n",
+ sec_name_out, n_elts);
+
+ if (n_elts > 0) {
+
+ char type_name_wri[SYR_COMM_L_TYPE_NAME + 1];
+
+ strncpy(type_name_wri, type_name, SYR_COMM_L_TYPE_NAME);
+ type_name_wri[SYR_COMM_L_TYPE_NAME] = '\0';
+
+ printf(" type de valeurs : \"%s\"\n", type_name_wri);
+
+ }
+
+ fflush(stdout);
+
+}
+
+/*--------------------------------------------------------------------------
+ * Print (part of) a section's body
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_echo_body(const syr_comm_t *comm,
+ int n_elts,
+ syr_type_t type,
+ void *sec_elts)
+{
+ int start_id;
+ int end_id;
+ int id;
+
+ if (n_elts == 0) return;
+
+ assert(comm != NULL);
+
+ start_id = 0;
+
+ if (comm->echo * 2 < n_elts) {
+
+ end_id = comm->echo;
+ printf(" %d premieres et dernieres valeurs :\n", comm->echo);
+
+ }
+ else {
+
+ end_id = n_elts;
+ printf(" valeurs :\n");
+
+ }
+
+ do {
+
+ switch(type) {
+
+ case SYR_TYPE_int: {
+
+ int *sec_elts_int = (int *)sec_elts;
+
+ for (id = start_id; id < end_id; id++)
+ printf(" %10d : %12d\n", id + 1, *(sec_elts_int + id));
+
+ }
+ break;
+
+ case SYR_TYPE_float: {
+
+ float *sec_elts_float = (float *)sec_elts;
+
+ for (id = start_id; id < end_id; id++)
+ printf(" %10d : %12.5e\n", id + 1,
+ (double)(*(sec_elts_float + id)));
+
+ }
+ break;
+
+ case SYR_TYPE_double: {
+
+ double *sec_elts_double = (double *)sec_elts;
+
+ for (id = start_id; id < end_id; id++)
+ printf(" %10d : %14.7e\n", id + 1, *(sec_elts_double + id));
+
+ }
+ break;
+
+ case SYR_TYPE_char: {
+
+ char *sec_elts_char = (char *) sec_elts;
+
+ for (id = start_id; id < end_id; id++) {
+ if (*(sec_elts_char + id) != '\0')
+ printf(" %10d : '%c'\n", id + 1, *(sec_elts_char + id));
+ else
+ printf(" %10d : '\\0'\n", id + 1);
+ }
+
+ }
+ break;
+
+ default:
+
+ assert(type == SYR_TYPE_int ||
+ type == SYR_TYPE_double ||
+ type == SYR_TYPE_float ||
+ type == SYR_TYPE_char );
+
+ } /* End of switch on element type */
+
+ if (end_id < n_elts) {
+
+ printf(" .......... ............\n");
+
+ start_id = n_elts - comm->echo;
+ end_id = n_elts;
+
+ }
+ else {
+
+ assert(end_id == n_elts);
+ end_id = n_elts + 1;
+
+ }
+
+ } while (end_id <= n_elts);
+
+ fflush(stdout);
+}
+
+#if defined(HAVE_MPI)
+
+/*--------------------------------------------------------------------------
+ * Print message in case of MPI communication error
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_msg_err(const syr_comm_t *comm,
+ int proc_id,
+ int error)
+{
+ char buffer[MPI_MAX_ERROR_STRING];
+ int buffer_len;
+
+ MPI_Error_string(error, buffer, &buffer_len);
+
+ bft_error(__FILE__, __LINE__, 0,
+ "Erreur MPI pour la communication : %s (proc %4d)\n"
+ "Type d'erreur : %s", comm->name, proc_id + 1, buffer);
+}
+
+/*--------------------------------------------------------------------------
+ * Exchange a section header using MPI
+ *
+ * A section header contains:
+ *
+ * 1. section name
+ * 2. number of elements
+ * 3. element type
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_header(char *sec_name,
+ int *n_sec_elts,
+ char *type_name,
+ const syr_comm_t *comm,
+ syr_comm_mode_t mode,
+ int proc_id)
+{
+
+#undef SYR_COMM_MPI_PACK_SIZE
+#define SYR_COMM_MPI_PACK_SIZE SYR_COMM_L_SEC_NAME \
+ + SYR_COMM_L_TYPE_NAME \
+ + (sizeof(int) * 2)
+
+ char buffer[SYR_COMM_MPI_PACK_SIZE];
+
+ int position, ierror;
+
+ MPI_Status status;
+
+ assert(comm != NULL);
+
+ /* Receive mode */
+ /*------------- */
+
+ if (mode == SYR_COMM_MODE_RECEIVE) {
+
+ /* Receive message */
+
+ ierror = MPI_Recv(buffer,
+ SYR_COMM_MPI_PACK_SIZE,
+ MPI_PACKED,
+ comm->proc_rank + proc_id,
+ MPI_ANY_TAG,
+ MPI_COMM_WORLD,
+ &status);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_msg_err(comm,
+ proc_id,
+ ierror);
+
+ /* Extract elements from buffer */
+
+ position = 0;
+
+ MPI_Unpack(buffer, SYR_COMM_MPI_PACK_SIZE, &position, sec_name,
+ SYR_COMM_L_SEC_NAME, MPI_CHAR, MPI_COMM_WORLD);
+
+ MPI_Unpack(buffer, SYR_COMM_MPI_PACK_SIZE, &position, n_sec_elts,
+ 1, MPI_INT, MPI_COMM_WORLD);
+
+ if (*n_sec_elts > 0)
+ MPI_Unpack(buffer, SYR_COMM_MPI_PACK_SIZE, &position, type_name,
+ SYR_COMM_L_TYPE_NAME, MPI_CHAR, MPI_COMM_WORLD);
+
+ }
+
+ /* Send mode */
+ /*---------- */
+
+ else { /* if (mode == SYR_COMM_MODE_SEND) */
+
+ /* Assemble buffer */
+
+ position = 0;
+
+ MPI_Pack(sec_name, SYR_COMM_L_SEC_NAME, MPI_CHAR, buffer,
+ SYR_COMM_MPI_PACK_SIZE, &position, MPI_COMM_WORLD);
+
+ MPI_Pack(n_sec_elts, 1, MPI_INT, buffer, SYR_COMM_MPI_PACK_SIZE,
+ &position, MPI_COMM_WORLD);
+
+ if (*n_sec_elts > 0)
+ MPI_Pack(type_name, SYR_COMM_L_TYPE_NAME, MPI_CHAR, buffer,
+ SYR_COMM_MPI_PACK_SIZE, &position, MPI_COMM_WORLD);
+
+ /* Send message */
+
+ ierror = MPI_Send(buffer,
+ position,
+ MPI_PACKED,
+ comm->proc_rank + proc_id,
+ 0,
+ MPI_COMM_WORLD);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_msg_err(comm,
+ proc_id,
+ ierror);
+ }
+}
+
+/*--------------------------------------------------------------------------
+ * Exchange section data using MPI
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_body(void *sec_elts,
+ int n_sec_elts,
+ syr_type_t type,
+ const syr_comm_t *comm,
+ syr_comm_mode_t mode,
+ int proc_id)
+{
+ int ierror = MPI_SUCCESS;
+ int n_elts = n_sec_elts;
+
+ MPI_Status status;
+ MPI_Datatype datatype;
+
+ assert(comm != NULL);
+ assert(n_sec_elts >= 0);
+
+ /* Set datatype */
+
+ switch (type) {
+ case SYR_TYPE_int:
+ datatype = MPI_INT;
+ break;
+ case SYR_TYPE_float:
+ datatype = MPI_FLOAT;
+ break;
+ case SYR_TYPE_double:
+ datatype = MPI_DOUBLE;
+ break;
+ case SYR_TYPE_char:
+ datatype = MPI_CHAR;
+ break;
+ default:
+ assert(0);
+ }
+
+ /* Receive or send */
+ /*---------------- */
+
+ if (mode == SYR_COMM_MODE_RECEIVE)
+ ierror = MPI_Recv(sec_elts,
+ n_elts,
+ datatype,
+ comm->proc_rank + proc_id,
+ MPI_ANY_TAG,
+ MPI_COMM_WORLD,
+ &status);
+
+ else /* if (mode == SYR_COMM_MODE_SEND) */
+ ierror = MPI_Send(sec_elts,
+ n_elts,
+ datatype,
+ comm->proc_rank + proc_id,
+ 0,
+ MPI_COMM_WORLD);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_msg_err(comm, proc_id, ierror);
+}
+
+#endif /* defined(HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+/*--------------------------------------------------------------------------
+ * Read a record from an interface socket
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_read_sock(const syr_comm_t *comm,
+ int proc_id,
+ char *rec,
+ size_t n,
+ syr_type_t type)
+{
+ size_t start_id;
+ size_t end_id;
+ size_t n_loc;
+ size_t n_bytes;
+ size_t size;
+ ssize_t ret;
+
+ assert(rec != NULL);
+ assert(comm != NULL);
+ assert(comm->socket != NULL);
+
+ /* Determine associated size */
+
+ switch (type) {
+ case SYR_TYPE_int:
+ size = sizeof(int);
+ break;
+ case SYR_TYPE_float:
+ size = sizeof(float);
+ break;
+ case SYR_TYPE_double:
+ size = sizeof(double);
+ break;
+ case SYR_TYPE_char:
+ size = sizeof(char);
+ break;
+ default:
+ assert(0);
+ }
+
+ n_bytes = size * n;
+
+ /* Read record from socket */
+
+ start_id = 0;
+
+ while (start_id < n_bytes) {
+
+ end_id = SYR_MIN(start_id + SSIZE_MAX, n_bytes);
+ n_loc = end_id - start_id;
+
+ ret = read(comm->socket[proc_id], (void *)(rec + start_id), n_loc);
+
+ if (ret < 1)
+ bft_error(__FILE__, __LINE__, errno,
+ "Communication %s (proc %d) :\n"
+ "Erreur a la reception via un socket",
+ comm->name, proc_id + 1);
+
+ start_id += ret;
+
+ }
+
+ if (comm->swap_endian == 1 && size > 1)
+ bft_file_swap_endian(rec, rec, size, n);
+}
+
+/*--------------------------------------------------------------------------
+ * Write a record to an interface socket
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_write_sock(const syr_comm_t *comm,
+ int proc_id,
+ const char *rec,
+ size_t n,
+ syr_type_t type)
+{
+ size_t start_id;
+ size_t end_id;
+ size_t n_loc;
+ size_t n_bytes;
+ size_t size;
+ ssize_t ret;
+
+ char *rec_tmp;
+
+ assert(rec != NULL);
+ assert(comm != NULL);
+ assert(comm->socket != NULL);
+
+ /* Determine associated size */
+
+ switch(type) {
+ case SYR_TYPE_int:
+ size = sizeof(int);
+ break;
+ case SYR_TYPE_double:
+ size = sizeof(double);
+ break;
+ case SYR_TYPE_float:
+ size = sizeof(float);
+ break;
+ case SYR_TYPE_char:
+ size = sizeof(char);
+ break;
+ default:
+ assert(0);
+ }
+
+ n_bytes = size * n;
+
+ /* Convert if "little-endian" */
+
+ if (comm->swap_endian == 1 && size != 1) {
+ BFT_MALLOC(rec_tmp, n_bytes, char);
+ bft_file_swap_endian(rec_tmp, rec, size, n);
+ }
+ else
+ rec_tmp = NULL;
+
+ /* Write record to socket */
+
+ start_id = 0;
+
+ while (start_id < n_bytes) {
+
+ end_id = SYR_MIN(start_id + SSIZE_MAX, n_bytes);
+ n_loc = end_id - start_id;
+
+ if (rec_tmp == NULL)
+ ret = write(comm->socket[proc_id], (const void *)(rec + start_id),
+ n_loc);
+ else
+ ret = write(comm->socket[proc_id], (const void *)(rec_tmp + start_id),
+ n_loc);
+
+ if (ret < 1)
+ bft_error(__FILE__, __LINE__, errno,
+ "Communication %s (proc %d) :\n"
+ "Erreur a l'envoi via un socket",
+ comm->name, proc_id + 1);
+
+ start_id += ret;
+ }
+
+ if (rec_tmp != NULL)
+ BFT_FREE(rec_tmp);
+}
+
+#endif /* defined(HAVE_SOCKET) */
+
+/*--------------------------------------------------------------------------
+ * Write then read a "magic string" to check file format
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_magic_string(syr_comm_t *comm,
+ int proc_id,
+ const char *magic_string)
+{
+ char *comm_magic_string;
+
+ int lng_magic_string = strlen(magic_string);
+
+ BFT_MALLOC(comm_magic_string, lng_magic_string + 1, char);
+
+ /* Write magic string */
+ /*--------------------*/
+
+ strncpy(comm_magic_string, magic_string, lng_magic_string);
+
+ switch (comm->type) {
+
+#if defined(HAVE_MPI)
+ case SYR_COMM_TYPE_MPI:
+ {
+ int ierror = MPI_Send(comm_magic_string,
+ lng_magic_string, MPI_CHAR,
+ comm->proc_rank + proc_id,
+ 0,
+ MPI_COMM_WORLD);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_msg_err(comm,
+ proc_id,
+ ierror);
+
+ }
+ break;
+#endif /* HAVE_MPI */
+
+#if defined(HAVE_SOCKET)
+ case SYR_COMM_TYPE_SOCKET:
+ {
+ _comm_write_sock(comm,
+ proc_id,
+ (const char *)(comm_magic_string),
+ strlen(magic_string),
+ SYR_TYPE_char);
+ }
+ break;
+#endif
+
+ default:
+ break;
+
+ }
+
+ /* Read magic string */
+ /*--------------------*/
+
+ switch (comm->type) {
+
+#if defined(HAVE_MPI)
+ case SYR_COMM_TYPE_MPI:
+ {
+ int ierror;
+ MPI_Status status;
+
+ ierror = MPI_Recv(comm_magic_string,
+ lng_magic_string,
+ MPI_CHAR,
+ comm->proc_rank + proc_id,
+ MPI_ANY_TAG,
+ MPI_COMM_WORLD,
+ &status);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_msg_err(comm,
+ proc_id,
+ ierror);
+
+ }
+ break;
+#endif /* HAVE_MPI */
+
+#if defined(HAVE_SOCKET)
+ case SYR_COMM_TYPE_SOCKET:
+ {
+ _comm_read_sock(comm,
+ proc_id,
+ (char *)(comm_magic_string),
+ strlen(magic_string),
+ SYR_TYPE_char);
+ }
+ break;
+#endif
+
+ default:
+ break;
+
+ }
+ comm_magic_string[lng_magic_string] = '\0';
+
+ /* If the magic string does not correspond, we have an error */
+
+ if (strcmp(comm_magic_string, magic_string) != 0)
+ bft_error(__FILE__, __LINE__, 0,
+ "Error a la lecture de : \"%s\".\n"
+ "La version du format d'interface est incompatible.\n"
+ "La chaine magique indique la version du format d'interface :\n"
+ "chaine magique lue : \"%s\"\n"
+ "chaine magique attendue : \"%s\"",
+ comm->name, comm_magic_string, magic_string);
+
+ BFT_FREE(comm_magic_string);
+}
+
+#if defined(HAVE_MPI)
+
+/*--------------------------------------------------------------------------
+ * Initialize an MPI communication by sending or reading a "magic string"
+ * allowing format verification
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_open(syr_comm_t *comm,
+ int proc_id,
+ const char *magic_string)
+{
+ int comm_size;
+
+ MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
+
+ if (comm->proc_rank + proc_id >= comm_size)
+ bft_error(__FILE__, __LINE__, 0,
+ "Communication impossible avec :\n"
+ "%s (proc %4d) comme le rang du processus correspondant\n"
+ "(rang_base + (id_proc - 1)) = %d + %d est superieur ou\n"
+ "egal au nombre de processus MPI (%d).",
+ comm->name, comm->proc_rank, comm->proc_rank,
+ proc_id, comm_size);
+
+ /* Write and read "magic string" */
+ /*------------------------------ */
+
+ _comm_magic_string(comm,
+ proc_id,
+ magic_string);
+}
+
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+/*--------------------------------------------------------------------------
+ * Connection for socket connection initialization
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_sock_connect(syr_comm_t *comm,
+ int proc_id,
+ const char *host_name,
+ int port_num)
+{
+
+#if defined(__linux__) || defined(__linux) || defined(linux)
+ socklen_t sock_len;
+#else
+ size_t sock_len;
+#endif
+
+ struct sockaddr_in sock_addr;
+ struct hostent *host_ent;
+
+ /* Create socket interface descriptor */
+
+ comm->socket[proc_id] = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (comm->socket[proc_id] == -1)
+ bft_error(__FILE__, __LINE__, errno,
+ "Erreur a l'initialisation de la communication par socket "
+ "(proc %d).\n",
+ proc_id + 1);
+
+ /* Prepare connection */
+
+ sock_len = sizeof(sock_addr);
+
+ memset((char *) &sock_addr, 0, sock_len);
+
+ sock_addr.sin_family = AF_INET;
+ sock_addr.sin_addr.s_addr = inet_addr(host_name);
+
+ if (sock_addr.sin_addr.s_addr == INADDR_NONE) {
+ host_ent = gethostbyname(host_name);
+
+ if (!host_ent)
+ bft_error(__FILE__, __LINE__, 0,
+ "Communication par socket : hote \"%s\" inconnu.",
+ host_name);
+
+ memcpy(&sock_addr.sin_addr, host_ent->h_addr_list[0], host_ent->h_length);
+ }
+
+ sock_addr.sin_port = port_num;
+
+ if (comm->swap_endian == 1)
+ bft_file_swap_endian((char *)&(sock_addr.sin_port),
+ (char *)&(sock_addr.sin_port),
+ sizeof(sock_addr.sin_port),
+ 1);
+
+ if ( connect(comm->socket[proc_id],
+ (struct sockaddr *)&sock_addr, sock_len) < 0)
+ bft_error(__FILE__, __LINE__, errno,
+ "Communication par socket : erreur de connexion a\n"
+ "%s (port %d)\n", host_name, port_num);
+
+}
+
+/*--------------------------------------------------------------------------
+ * Initialize socket communication
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_sock_init(syr_comm_t *comm,
+ const char *sock_serv)
+{
+ int i, port_num, id, proc_id, name_len;
+
+ char str_len[7] = " ";
+ char *host_name = NULL;
+
+ /* Decode sock_serv string */
+
+ for (id = strlen(sock_serv) - 1;
+ id > 0 && sock_serv[id] != ':'; id--);
+
+ port_num = atoi(sock_serv + id + 1);
+
+ BFT_MALLOC(host_name, id + 1, char);
+ strncpy(host_name, sock_serv, id);
+ host_name[id] = '\0';
+
+ /* Establish communication with rank 0 on Code_Saturne side */
+
+ _comm_sock_connect(comm, 0, host_name, port_num);
+
+ /* Receive number of ranks */
+
+ if (read(comm->socket[0], str_len, 6) < 6)
+ bft_error(__FILE__, __LINE__, errno,
+ syr_glob_comm_err_socket, comm->name, 1);
+
+ str_len[6] = '\0';
+ comm->n_procs = atoi(str_len);
+
+ if (comm->n_procs > 1) {
+ BFT_REALLOC(comm->socket, comm->n_procs, int);
+ for (i = 1; i < comm->n_procs; i++)
+ comm->socket[i] = 0;
+ }
+
+ /* Receive max hostname size */
+
+ if (comm->n_procs > 1) {
+
+ /* Receive max hostname size */
+
+ if (read(comm->socket[0], str_len, 4) < 4)
+ bft_error(__FILE__, __LINE__, errno,
+ syr_glob_comm_err_socket, comm->name, 1);
+
+ str_len[4] = '\0';
+ name_len = atoi(str_len);
+
+ BFT_REALLOC(host_name, name_len + 1, char);
+
+ for (proc_id = 1; proc_id < comm->n_procs; proc_id++) {
+
+ /* Receive hostname */
+
+ if (read(comm->socket[0], host_name, name_len) < name_len)
+ bft_error(__FILE__, __LINE__, errno,
+ syr_glob_comm_err_socket, comm->name, proc_id + 1);
+
+ host_name[name_len] = '\0';
+
+ /* Receive port number */
+
+ if (read(comm->socket[0], str_len, 6) < 6)
+ bft_error(__FILE__, __LINE__, errno,
+ syr_glob_comm_err_socket, comm->name, proc_id + 1);
+
+ str_len[6] = '\0';
+ port_num = atoi(str_len);
+
+ /* Establish connection */
+
+ _comm_sock_connect(comm, proc_id, host_name, port_num);
+
+ }
+
+ } /* End of n_procs > 1 case */
+
+ BFT_FREE(host_name);
+}
+
+/*--------------------------------------------------------------------------
+ * Initialize a socket for communication
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_sock_open(syr_comm_t *comm,
+ int proc_id,
+ const char *magic_string)
+{
+ char comm_header[] = CS_COMM_SOCKET_HEADER;
+
+ /* Send initialization message to each proc */
+
+ if (write(comm->socket[proc_id], comm_header, strlen(comm_header))
+ < (ssize_t)strlen(comm_header))
+ bft_error(__FILE__, __LINE__, errno,
+ "Erreur dans la communication par socket.");
+
+ /* Write or read "magic string" */
+
+ _comm_magic_string(comm,
+ proc_id,
+ magic_string);
+}
+
+/*--------------------------------------------------------------------------
+ * Close an interface socket
+ *--------------------------------------------------------------------------*/
+
+static void
+_comm_sock_close(syr_comm_t *comm,
+ int proc_id)
+{
+ if (close(comm->socket[proc_id]) != 0)
+ bft_error(__FILE__, __LINE__, errno,
+ "Communication %s (proc %d) :\n"
+ "Erreur a la fermeture d'un socket.",
+ comm->name, proc_id + 1);
+
+ comm->socket[proc_id] = -1;
+}
+
+#endif /* defined(HAVE_SOCKET) */
+
+/*===========================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a communicator
+ *
+ * arguments:
+ * coupling_num <-- Coupling number
+ * cs_root_rank <-- Root rank associated with Code_Saturne
+ * cs_n_ranks <-- Number of MPI ranks associated with Code_Saturne
+ * sock_str <-- Communicating host and port (hostname:port)
+ * type <-- Communication type
+ * echo <-- Echo on main output
+ *----------------------------------------------------------------------------*/
+
+syr_comm_t *
+syr_comm_initialize(int coupling_num,
+ int cs_root_rank,
+ int cs_n_ranks,
+ const char *sock_str,
+ syr_comm_type_t type,
+ int echo)
+{
+ unsigned int_endian;
+
+ syr_comm_t *comm;
+ int proc_id;
+
+ const char magic_string[] = "CFD_SYRTHES_COUPLING_2.2";
+ const char base_name[] = "CFD_";
+
+ BFT_MALLOC(comm, 1, syr_comm_t);
+
+ /* Build communicator name */
+ /*------------------------ */
+
+ BFT_MALLOC(comm->name, strlen(base_name) + 4 + 1, char);
+
+ sprintf(comm->name, "%s%04d", base_name, coupling_num);
+
+ /* Initialize other fields */
+
+ comm->type = type;
+ comm->n_procs = -1;
+ comm->proc_rank = -1;
+ comm->socket = NULL;
+ comm->echo = echo;
+
+ comm->n_sec_elts = NULL;
+
+ /* Test if system is big-endian */
+
+ comm->swap_endian = 0; /* Use "big-endian" mode to communicate */
+
+ int_endian = 0;
+ *((char *) (&int_endian)) = '\1';
+
+ if (int_endian == 1)
+ comm->swap_endian = 1;
+
+#if defined(DEBUG) && !defined(NDEBUG)
+ else {
+ int_endian = 0;
+ *((char *) (&int_endian) + sizeof(unsigned) - 1) = '\1';
+ assert (int_endian == 1);
+ }
+#endif
+
+ if (type == SYR_COMM_TYPE_MPI) {
+#if defined(HAVE_MPI)
+ comm->proc_rank = cs_root_rank;
+ comm->n_procs = cs_n_ranks;
+#else
+ bft_error
+ (__FILE__, __LINE__, 0,
+ "Librarie compilee sans support MPI, donc le type communicateur\n"
+ "doit etre different de SYR_COMM_TYPE_MPI (%d).",
+ (int)SYR_COMM_TYPE_MPI);
+#endif
+ }
+
+ if (type == SYR_COMM_TYPE_SOCKET) {
+#if defined(HAVE_SOCKET)
+ BFT_MALLOC(comm->socket, 1, int);
+ comm->socket[0] = 0;
+
+ /* Using sockets communication, the number of associated ranks
+ may be updated during communication initialization */
+
+ _comm_sock_init(comm, sock_str);
+#else
+ bft_error
+ (__FILE__, __LINE__, 0,
+ "Librarie compilee sans support \"socket\", donc le type communicateur\n"
+ "doit etre different de SYR_COMM_TYPE_SOCKET (%d).",
+ (int)SYR_COMM_TYPE_SOCKET);
+#endif
+ }
+
+ /* Jump one line in log file */
+
+ printf("\n");
+
+ /* Build interfaces */
+
+ for (proc_id = 0; proc_id < comm->n_procs; proc_id++) {
+
+ /* Build interface file name */
+ /*-------------------------- */
+
+ /* Info on interface creation */
+
+ if (comm->n_procs == 1)
+ printf(" Ouverture de la communication : %s ...",
+ comm->name);
+ else
+ printf(" Ouverture de la communication : %s (proc %4d) ...",
+ comm->name, proc_id + 1);
+
+ fflush(stdout);
+
+ /* Create a descriptor for the interface file */
+ /*------------------------------------------- */
+
+ if (comm->proc_rank >= 0) {
+
+#if defined(HAVE_MPI)
+ _comm_mpi_open(comm, proc_id, magic_string);
+#else
+ assert(comm->proc_rank < 0);
+#endif
+
+ }
+
+#if defined(HAVE_SOCKET)
+ else if (comm->type == SYR_COMM_TYPE_SOCKET)
+ _comm_sock_open(comm, proc_id, magic_string);
+#endif
+
+ /* Info on interface creation success */
+
+ printf(" [ok]\n");
+ fflush(stdout);
+
+ }
+
+ BFT_MALLOC(comm->n_sec_elts, comm->n_procs, int);
+ for (proc_id = 0; proc_id < comm->n_procs; proc_id++)
+ comm->n_sec_elts[proc_id] = 0;
+
+ /* Fin */
+
+ return comm;
+}
+
+
+/*--------------------------------------------------------------------------
+ * Finalize a communicator
+ *--------------------------------------------------------------------------*/
+
+syr_comm_t *
+syr_comm_finalize(syr_comm_t *comm)
+{
+ int proc_id;
+
+ printf("\n");
+
+ if (comm->n_procs == 1) {
+
+ /* Info on closing interface files */
+
+ printf(" Fermeture de la communication: %s\n",
+ comm->name);
+
+#if defined(HAVE_SOCKET)
+ if (comm->socket != NULL)
+ _comm_sock_close(comm, 0);
+#endif
+
+ }
+ else {
+
+ for (proc_id = 0; proc_id < comm->n_procs; proc_id++) {
+
+ /* Info on closing interface files */
+
+ printf(" Fermeture de la communication: %s (proc %4d)\n",
+ comm->name, proc_id + 1);
+
+#if defined(HAVE_SOCKET)
+ if (comm->socket != NULL)
+ _comm_sock_close(comm, proc_id);
+#endif
+
+ }
+
+ }
+
+#if defined(HAVE_SOCKET)
+ if (comm->socket != NULL)
+ BFT_FREE(comm->socket);
+#endif
+
+ BFT_FREE(comm->name);
+ BFT_FREE(comm->n_sec_elts);
+
+ BFT_FREE(comm);
+
+ return NULL;
+}
+
+/*--------------------------------------------------------------------------
+ * Get a communicator's name
+ *
+ * This function returns a pointer to an existing name, so the string
+ * returned should not be freed by the user.
+ *--------------------------------------------------------------------------*/
+
+const char *
+syr_comm_get_name(const syr_comm_t *comm)
+{
+ return comm->name;
+}
+
+/*--------------------------------------------------------------------------
+ * Get a communicator's number of distant processes
+ *--------------------------------------------------------------------------*/
+
+int
+syr_comm_get_n_procs(const syr_comm_t *comm)
+{
+ return comm->n_procs;
+}
+
+/*--------------------------------------------------------------------------
+ * Get the number of values to be read for each sub-domain in a communicator.
+ *
+ * This function should only be called between syr_comm_read_header()
+ * and syr_comm_read_data(). It returns a pointer to an array belonging to
+ * the communicator, which should not be freed.
+ *--------------------------------------------------------------------------*/
+
+const int *
+syr_comm_get_n_section_elements(const syr_comm_t *comm)
+{
+ return comm->n_sec_elts;
+}
+
+
+/*--------------------------------------------------------------------------
+ * Write a section to the communication interface.
+ *
+ * A section contains:
+ *
+ * 1. section name
+ * 2. number of elements
+ * 3. element type
+ * 4. element values
+ *--------------------------------------------------------------------------*/
+
+void
+syr_comm_write_section(const char *sec_name,
+ int n_elts,
+ void *elts,
+ syr_type_t elt_type,
+ const syr_comm_t *comm,
+ int proc_id)
+{
+ char sec_name_out [SYR_COMM_L_SEC_NAME + 1];
+ char type_name [SYR_COMM_L_TYPE_NAME + 1];
+ char type_name_out[SYR_COMM_L_TYPE_NAME + 1];
+
+ assert(comm != NULL);
+ assert(n_elts >= 0);
+
+ /* Section name */
+
+ sprintf(sec_name_out,
+ "%-*.*s",
+ SYR_COMM_L_SEC_NAME,
+ SYR_COMM_L_SEC_NAME,
+ sec_name);
+
+ /* Element type name */
+
+ if (n_elts != 0) {
+
+ switch(elt_type) {
+
+ case SYR_TYPE_int:
+ strcpy(type_name, "i ");
+ break;
+
+ case SYR_TYPE_double:
+ strcpy(type_name, "r8");
+ break;
+
+ case SYR_TYPE_float:
+ strcpy(type_name, "r4");
+ break;
+
+ case SYR_TYPE_char:
+ strcpy(type_name, "c ");
+ break;
+
+ default:
+ assert(0);
+ }
+
+ sprintf(type_name_out,
+ "%-*.*s",
+ SYR_COMM_L_TYPE_NAME,
+ SYR_COMM_L_TYPE_NAME,
+ type_name);
+
+ }
+
+ if (comm->echo >= 0)
+ _comm_echo_pre(comm, proc_id, SYR_COMM_MODE_SEND);
+
+#if defined(HAVE_MPI)
+
+ /* MPI communication */
+ /*------------------ */
+
+ if (comm->type == SYR_COMM_TYPE_MPI) {
+
+ int n_elts_wri = n_elts;
+
+ _comm_mpi_header(sec_name_out,
+ &n_elts_wri,
+ type_name_out,
+ comm,
+ SYR_COMM_MODE_SEND,
+ proc_id);
+
+ if (n_elts > 0)
+ _comm_mpi_body((void *)elts,
+ n_elts,
+ elt_type,
+ comm,
+ SYR_COMM_MODE_SEND,
+ proc_id);
+
+ }
+
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+ /* Socket communication */
+ /*--------------------- */
+
+ if (comm->type == SYR_COMM_TYPE_SOCKET) {
+
+ /* 1. section name */
+
+ _comm_write_sock(comm,
+ proc_id,
+ (const char *)sec_name_out,
+ SYR_COMM_L_SEC_NAME,
+ SYR_TYPE_char);
+
+ /* 2. number of elements */
+
+ _comm_write_sock(comm,
+ proc_id,
+ (const char *)(&n_elts),
+ 1,
+ SYR_TYPE_int);
+
+ if (n_elts != 0) {
+
+ /* 3. element type name */
+
+ _comm_write_sock(comm,
+ proc_id,
+ (const char *)type_name_out,
+ SYR_COMM_L_TYPE_NAME,
+ SYR_TYPE_char);
+
+ /* 4. element values */
+
+ _comm_write_sock(comm,
+ proc_id,
+ (const char *)elts,
+ (size_t)n_elts,
+ elt_type);
+
+ }
+
+ }
+
+#endif /* (HAVE_SOCKET) */
+
+ /* Optional logging */
+ /*----------------- */
+
+ if (comm->echo >= 0)
+ _comm_echo_header(comm,
+ sec_name_out,
+ n_elts,
+ type_name_out);
+
+ if (comm->echo > 0)
+ _comm_echo_body(comm,
+ n_elts,
+ elt_type,
+ elts);
+}
+
+
+/*--------------------------------------------------------------------------
+ * Read a section header from the communication interface.
+ *
+ * A section contains:
+ *
+ * 1. section name (size: SYR_COMM_L_SEC_NAME + 1)
+ * 2. number of elements
+ * 3. element type
+ * 4. element values
+ *
+ * The first 3 of which constitute its header.
+ *--------------------------------------------------------------------------*/
+
+void
+syr_comm_read_header(char *sec_name,
+ int *n_elts,
+ syr_type_t *elt_type,
+ const syr_comm_t *comm,
+ int proc_id)
+{
+ char type_name[SYR_COMM_L_TYPE_NAME + 1];
+
+ assert(comm != NULL);
+
+ *n_elts = 0;
+
+ if (comm->echo >= 0)
+ _comm_echo_pre(comm,
+ proc_id,
+ SYR_COMM_MODE_RECEIVE);
+
+#if defined(HAVE_MPI)
+
+ /* MPI communication */
+ /*------------------ */
+
+ if (comm->type == SYR_COMM_TYPE_MPI) {
+
+ _comm_mpi_header(sec_name,
+ &(comm->n_sec_elts[proc_id]),
+ type_name,
+ comm,
+ SYR_COMM_MODE_RECEIVE,
+ proc_id);
+
+ *n_elts = comm->n_sec_elts[proc_id];
+
+ }
+
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+ /* Socket communication */
+ /*--------------------- */
+
+ if (comm->type == SYR_COMM_TYPE_SOCKET) {
+
+ /* 1. section name */
+
+ _comm_read_sock(comm,
+ proc_id,
+ (char *)sec_name,
+ SYR_COMM_L_SEC_NAME,
+ SYR_TYPE_char);
+
+ sec_name[SYR_COMM_L_SEC_NAME] = '\0';
+
+ /* 2. number of elements */
+
+ _comm_read_sock(comm,
+ proc_id,
+ (char *) &(comm->n_sec_elts[proc_id]),
+ 1,
+ SYR_TYPE_int);
+
+ *n_elts = comm->n_sec_elts[proc_id];
+
+ if (comm->n_sec_elts[proc_id] != 0) {
+
+ /* 3. element type name */
+
+ _comm_read_sock(comm,
+ proc_id,
+ (char *)type_name,
+ SYR_COMM_L_TYPE_NAME,
+ SYR_TYPE_char);
+
+ }
+
+ }
+
+#endif /* (HAVE_SOCKET) */
+
+ sec_name[SYR_COMM_L_SEC_NAME] = '\0';
+ type_name[SYR_COMM_L_TYPE_NAME] = '\0';
+
+ /* Optional logging */
+ /*----------------- */
+
+ if (comm->echo >= 0)
+ _comm_echo_header(comm,
+ sec_name,
+ comm->n_sec_elts[proc_id],
+ type_name);
+
+ if (comm->n_sec_elts[proc_id] != 0) {
+
+ type_name[SYR_COMM_L_TYPE_NAME] = '\0';
+
+ if (strcmp(type_name, "i ") == 0)
+ *elt_type = SYR_TYPE_int;
+
+ else if (strcmp(type_name, "r4") == 0)
+ *elt_type = SYR_TYPE_float;
+
+ else if (strcmp(type_name, "r8") == 0)
+ *elt_type = SYR_TYPE_double;
+
+ else if (strcmp(type_name, "c ") == 0)
+ *elt_type = SYR_TYPE_char;
+
+ else
+ assert(0);
+ }
+
+}
+
+/*--------------------------------------------------------------------------
+ * Read a section body from the communication interface.
+ *
+ * A section contains:
+ *
+ * 1. section name
+ * 2. number of elements
+ * 3. element type
+ * 4. element values
+ *
+ * The last of which constitutes its body.
+ *
+ * If a buffer destined to receive data already exists, we give a pointer to
+ * this buffer with the sec_elts argument, and this same pointer is returned.
+ * Otherwise (setting the argument to NULL), memory is allocated, and a pointer
+ * to this newly allocated memory is returned (and should be freed by the
+ * caller once finished).
+ *--------------------------------------------------------------------------*/
+
+void *
+syr_comm_read_body(int n_sec_elts,
+ void *sec_elts,
+ syr_type_t elt_type,
+ const syr_comm_t *comm,
+ int proc_id)
+{
+ void *_sec_elts;
+
+ assert(comm != NULL);
+ assert(n_sec_elts >= 0);
+
+ _sec_elts = sec_elts;
+
+ if (_sec_elts == NULL && n_sec_elts != 0) {
+
+ switch(elt_type) {
+
+ case SYR_TYPE_int:
+ {
+ int *sec_elts_int;
+
+ BFT_MALLOC(sec_elts_int, n_sec_elts, int);
+ _sec_elts = (void *)sec_elts_int;
+ }
+ break;
+
+ case SYR_TYPE_float:
+ {
+ float *sec_elts_flo;
+
+ BFT_MALLOC(sec_elts_flo, n_sec_elts, float);
+ _sec_elts = (void *)sec_elts_flo;
+ }
+ break;
+
+ case SYR_TYPE_double:
+ {
+ double *sec_elts_dou;
+
+ BFT_MALLOC(sec_elts_dou, n_sec_elts, double);
+ _sec_elts = (void *)sec_elts_dou;
+ }
+ break;
+
+ case SYR_TYPE_char:
+ {
+ char *sec_elts_cha;
+
+ BFT_MALLOC(sec_elts_cha, n_sec_elts + 1, char);
+ _sec_elts = (void *)sec_elts_cha;
+ }
+ break;
+
+ default:
+ assert(elt_type == SYR_TYPE_int ||
+ elt_type == SYR_TYPE_float ||
+ elt_type == SYR_TYPE_double ||
+ elt_type == SYR_TYPE_char );
+
+ }
+
+ }
+
+ /* 5. Element values */
+
+ if (n_sec_elts != 0) {
+
+ /* Effective read */
+
+#if defined(HAVE_MPI)
+ if (comm->type == SYR_COMM_TYPE_MPI)
+ _comm_mpi_body((void *)_sec_elts,
+ n_sec_elts,
+ elt_type,
+ comm,
+ SYR_COMM_MODE_RECEIVE,
+ proc_id);
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+ if (comm->type == SYR_COMM_TYPE_SOCKET)
+ _comm_read_sock(comm,
+ proc_id,
+ (char *)_sec_elts,
+ (size_t)n_sec_elts,
+ elt_type);
+#endif /* (HAVE_SOCKET) */
+
+ /* Verification */
+ /*------------- */
+
+ if (elt_type == SYR_TYPE_char) {
+
+ char *sec_elts_cha = (char *)_sec_elts;
+
+ sec_elts_cha[comm->n_sec_elts[proc_id]] = '\0';
+
+ }
+
+ /* Optional logging */
+ /*----------------- */
+
+ if (comm->echo > 0)
+ _comm_echo_body(comm,
+ n_sec_elts,
+ elt_type,
+ _sec_elts);
+
+ }
+
+ /* Return pointer to values read */
+
+ return _sec_elts;
+}
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
diff --git a/libsyrcs/syr_comm.h b/libsyrcs/syr_comm.h
new file mode 100644
index 0000000..8622aa1
--- /dev/null
+++ b/libsyrcs/syr_comm.h
@@ -0,0 +1,204 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef _SYR_COMM_H_
+#define _SYR_COMM_H_
+
+/*============================================================================*
+ * Definitions of base communication functions
+ *
+ * Library: Code_Saturne Copyright EDF 2006-2009
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * System and BFT headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "syr_defs.h"
+
+/*----------------------------------------------------------------------------
+ * Communication types
+ *----------------------------------------------------------------------------*/
+
+typedef enum {
+
+ SYR_COMM_TYPE_MPI, /* Comunicate through MPI */
+ SYR_COMM_TYPE_SOCKET, /* Communicate through IP sockets */
+ SYR_COMM_TYPE_NULL /* Null communicator */
+
+} syr_comm_type_t;
+
+/*----------------------------------------------------------------------------
+ * Macro definitions
+ *----------------------------------------------------------------------------*/
+
+#define SYR_COMM_L_SEC_NAME 32
+
+/*----------------------------------------------------------------------------
+ * Structure definitions
+ *----------------------------------------------------------------------------*/
+
+typedef struct _syr_comm_t syr_comm_t;
+
+/* Public structure used to save data from a message header, simplifying
+ the transfer of this data to processing functions */
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a communicator
+ *
+ * arguments:
+ * coupling_num <-- Coupling number
+ * cs_root_rank <-- Root rank associated with Code_Saturne
+ * cs_n_ranks <-- Number of MPI ranks associated with Code_Saturne
+ * sock_str <-- Communicating host and port (hostname:port)
+ * type <-- Communication type
+ * echo <-- Echo on main output
+ *----------------------------------------------------------------------------*/
+
+syr_comm_t *
+syr_comm_initialize(int coupling_num,
+ int cs_root_rank,
+ int cs_n_ranks,
+ const char *sock_str,
+ syr_comm_type_t type,
+ int echo);
+
+/*----------------------------------------------------------------------------
+ * Finalize a communicator
+ *----------------------------------------------------------------------------*/
+
+syr_comm_t *
+syr_comm_finalize(syr_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Get a communicator's name
+ *
+ * This function returns a pointer to an existing name, so the string
+ * returned should not be freed by the user.
+ *----------------------------------------------------------------------------*/
+
+const char *
+syr_comm_get_name(const syr_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Get a communicator's number of distant processes
+ *----------------------------------------------------------------------------*/
+
+int
+syr_comm_get_n_procs(const syr_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Get the number of values to be read for each sub-domain in a communicator.
+ *
+ * This function should only be called between syr_comm_read_header()
+ * and syr_comm_read_data(). It returns a pointer to an array belonging to
+ * the communicator, which should not be freed.
+ *----------------------------------------------------------------------------*/
+
+const int *
+syr_comm_get_n_section_elements(const syr_comm_t *comm);
+
+/*----------------------------------------------------------------------------
+ * Write a section to the communication interface.
+ *
+ * A section contains:
+ *
+ * 1. section name
+ * 2. number of elements
+ * 3. element type
+ * 4. element values
+ *----------------------------------------------------------------------------*/
+
+void
+syr_comm_write_section(const char *sec_name,
+ int n_elts,
+ void *elts,
+ syr_type_t elt_type,
+ const syr_comm_t *comm,
+ int proc_id);
+
+/*----------------------------------------------------------------------------
+ * Read a section header from the communication interface.
+ *
+ * A section contains:
+ *
+ * 1. section name (size: SYR_COMM_L_SEC_NAME + 1)
+ * 2. number of elements
+ * 3. element type
+ * 4. element values
+ *
+ * The first 3 of which constitute its header.
+ *----------------------------------------------------------------------------*/
+
+void
+syr_comm_read_header(char *sec_name,
+ int *n_elts,
+ syr_type_t *elt_type,
+ const syr_comm_t *comm,
+ int proc_id);
+
+/*----------------------------------------------------------------------------
+ * Read a section body from the communication interface.
+ *
+ * A section contains:
+ *
+ * 1. section name
+ * 2. number of elements
+ * 3. element type
+ * 4. element values
+ *
+ * The last of which constitutes its body.
+ *
+ * If a buffer destined to receive data already exists, we give a pointer to
+ * this buffer with the sec_elts argument, and this same pointer is returned.
+ * Otherwise (setting the argument to NULL), memory is allocated, and a pointer
+ * to this newly allocated memory is returned (and should be freed by the
+ * caller once finished).
+ *----------------------------------------------------------------------------*/
+
+void *
+syr_comm_read_body(int n_sec_elts,
+ void *sec_elts,
+ syr_type_t elt_type,
+ const syr_comm_t *comm,
+ int proc_id);
+
+/*----------------------------------------------------------------------------*/
+
+#endif /* _SYR_COMM_H_ */
diff --git a/libsyrcs/syr_coupling.c b/libsyrcs/syr_coupling.c
new file mode 100644
index 0000000..62fb1d9
--- /dev/null
+++ b/libsyrcs/syr_coupling.c
@@ -0,0 +1,1002 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*===========================================================================
+ * Main API functions for coupling between Syrthes 3 and Code_Saturne
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "syr_defs.h"
+#include "syr_comm.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "syr_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* Fake brace to force Emacs auto-indentation back to column 0 */
+#endif
+#endif /* __cplusplus */
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/* Auxiliary structure to determine how data is distributed across
+ distant ranks */
+
+typedef struct {
+
+ int n_ranks; /* Number of ranks containing data */
+ int n_elts_g; /* Global number of elements */
+ int n_elts_max; /* Maximum local number of elements */
+
+ int *proc_id; /* Proc id (global rank) for each local rank */
+ int *index; /* Start index for each rank (n_ranks + 1) */
+ int *elt_num; /* Global number (1 to n_elts_g) associated with each
+ element */
+
+} syr_coupling_dist_t;
+
+struct _syr_coupling_t {
+
+ int syr_id; /* Id of current Syrthes instance (usually 1) */
+ int comm_echo; /* Optional echo to standard output */
+
+ syr_comm_t *comm; /* Communicator */
+
+ int *cs_rank; /* Array of ranks in Code_Saturne */
+
+ syr_coupling_dist_t dist; /* Distribution structure for variables */
+
+};
+
+/*===========================================================================
+ * Static global variables
+ *===========================================================================*/
+
+static char syr_glob_coupling_sec_name_error[]
+ = "Erreur dans la communication : \"%s\".\n"
+ "Nom de rubrique <%s> recue du rang <%d>\n"
+ "est different de <%s> recue du rang <1>";
+
+/*===========================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*---------------------------------------------------------------------------
+ * Finalize syr_coupling_dist_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_syr_coupling_dist_finalize(syr_coupling_dist_t *dist)
+{
+ if (dist != NULL) {
+
+ if (dist->n_elts_g != 0) {
+ dist->n_elts_g = 0;
+ dist->n_elts_max = 0;
+ BFT_FREE(dist->proc_id);
+ BFT_FREE(dist->index);
+ BFT_FREE(dist->elt_num);
+ }
+
+ }
+}
+
+/*---------------------------------------------------------------------------
+ * Gather variable values from a communication buffer
+ *---------------------------------------------------------------------------*/
+
+static void
+_syr_coupling_gather_var(const syr_coupling_t *coupling,
+ int proc_id,
+ const double buffer[],
+ double var[])
+{
+ /* Gather values */
+
+ int ii;
+ const syr_coupling_dist_t *dist = &(coupling->dist);
+ int n_elts = dist->index[proc_id+1] - dist->index[proc_id];
+
+ if (dist->elt_num != NULL) {
+
+ const int *elt_num = dist->elt_num + dist->index[proc_id];
+ for (ii = 0; ii < n_elts; ii++)
+ var[elt_num[ii] - 1] = buffer[ii];
+
+ }
+ else {
+
+ for (ii = 0; ii < n_elts; ii++)
+ var[dist->index[proc_id] + ii] = buffer[ii];
+
+ }
+}
+
+/*---------------------------------------------------------------------------
+ * Scatter variable values to a communication buffer
+ *---------------------------------------------------------------------------*/
+
+static void
+_syr_coupling_scatter_var(const syr_coupling_t *coupling,
+ int proc_id,
+ double buffer[],
+ const double var[])
+{
+ /* Scatter values */
+
+ int ii;
+ const syr_coupling_dist_t *dist = &(coupling->dist);
+ int n_elts = dist->index[proc_id+1] - dist->index[proc_id];
+
+ if (dist->elt_num != NULL) {
+
+ const int *elt_num = dist->elt_num + dist->index[proc_id];
+ for (ii = 0; ii < n_elts; ii++)
+ buffer[ii] = var[elt_num[ii] - 1];
+
+ }
+ else {
+
+ for (ii = 0; ii < n_elts; ii++)
+ buffer[ii] = var[dist->index[proc_id] + ii];
+
+ }
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize syr_coupling_t structure
+ *
+ * arguments:
+ * syr_num <-- Id of Syrthes instance (usually 1)
+ * coupling_id <-- Id of Syrthes coupling (0 to n-1)
+ * cs_appnum <-- Application number of Code_Saturne MPI process, or -1
+ * sock_str <-- hostname:socknum of first coupled
+ * Code_Saturne process, or NULL
+ * comm_type <-- Type of comunication used
+ * comm_echo <-- Optional echo to standard output
+ *----------------------------------------------------------------------------*/
+
+syr_coupling_t *
+syr_coupling_initialize(int syr_num,
+ int coupling_id,
+ int cs_appnum,
+ const char *sock_str,
+ syr_comm_type_t comm_type,
+ int comm_echo)
+{
+ int root_rank = -1, n_ranks = -1;
+
+ syr_coupling_t *coupling = NULL;
+
+ /* Allocate syr_coupling_t structure */
+
+ BFT_MALLOC(coupling, 1, syr_coupling_t);
+
+ /* Default initialization */
+
+ coupling->syr_id = syr_num;
+ coupling->comm_echo = comm_echo;
+
+ coupling->cs_rank = NULL;
+
+#ifdef HAVE_MPI
+ if (cs_appnum > -1)
+ syr_mpi_appinfo(cs_appnum, &root_rank, &n_ranks);
+#endif
+
+ /* Initialize communicator */
+
+ coupling->comm = NULL;
+
+ coupling->comm = syr_comm_initialize(coupling_id + 1,
+ root_rank,
+ n_ranks,
+ sock_str,
+ comm_type,
+ comm_echo);
+
+ /* Variable distribution will be defined later */
+
+ coupling->dist.n_ranks = 0;
+ coupling->dist.n_elts_g = 0;
+ coupling->dist.n_elts_max = 0;
+ coupling->dist.proc_id = NULL;
+ coupling->dist.index = NULL;
+ coupling->dist.elt_num = NULL;
+
+ return coupling;
+}
+
+/*---------------------------------------------------------------------------
+ * Finalize syr_coupling_t structure
+ *---------------------------------------------------------------------------*/
+
+syr_coupling_t *
+syr_coupling_finalize(syr_coupling_t *coupling)
+{
+ /* Finalize send and receive communicators */
+
+ coupling->comm = syr_comm_finalize(coupling->comm);
+
+ if (coupling->cs_rank != NULL)
+ BFT_FREE(coupling->cs_rank);
+
+ /* Finalize distribution */
+
+ _syr_coupling_dist_finalize(&(coupling->dist));
+
+ BFT_FREE(coupling);
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Receive Code_Saturne's coupled surface mesh
+ *
+ * the elt_connect and vtx_coords arrays are allocated here.
+ *
+ * arguments:
+ * coupling <-- Associated coupling object
+ * sp_dim --> Spatial dimension for fluid
+ * n_vtx, --> Number of vertices
+ * n_elts, --> Number of segments or triangles
+ * vtx_coords --> Vertex coordinates
+ * elt_connect --> Segment or triangle connectivity
+ *----------------------------------------------------------------------------*/
+
+void
+syr_coupling_receive_bc_mesh(syr_coupling_t *coupling,
+ int *sp_dim,
+ int *n_vtx,
+ int *n_elts,
+ double *vtx_coords[],
+ int *elt_connect[])
+{
+ char sec_name[SYR_COMM_L_SEC_NAME + 1];
+ char sec_name_cmp[SYR_COMM_L_SEC_NAME + 1];
+ int ii, jj, kk;
+ int proc_id;
+ syr_type_t elt_type;
+
+ int n_ranks = 0;
+ int stride = 0;
+ int max_msg_size = 0;
+ int msg_size = 0;
+ syr_coupling_dist_t *dist = NULL;
+ syr_coupling_dist_t elt_dist;
+
+ const syr_comm_t *comm = coupling->comm;
+
+ /* Temporary distribution for elements */
+
+ elt_dist.n_ranks = 0;
+ elt_dist.n_elts_g = 0;
+ elt_dist.n_elts_max = 0;
+ elt_dist.proc_id = NULL;
+ elt_dist.index = NULL;
+ elt_dist.elt_num = NULL;
+
+ /* Number of ranks of coupled Code_Saturne processes */
+
+ n_ranks = syr_comm_get_n_procs(coupling->comm);
+
+ /* Default initializations */
+
+ *sp_dim = 3;
+
+ *n_elts = 0;
+
+ *vtx_coords = NULL;
+ *elt_connect = NULL;
+
+ /* Loop on messages */
+
+ while (1) {
+
+ /* Read message header */
+ /*---------------------*/
+
+ syr_comm_read_header(sec_name,
+ &msg_size,
+ &elt_type,
+ comm,
+ 0);
+
+ /* Partial decoding so as to handle messages by rank 0 only */
+ /*----------------------------------------------------------*/
+
+ /* End of initialization data (try this first) */
+
+ if (!strncmp("coupl:b:start", sec_name, strlen("coupl:b:start")))
+ break;
+
+ /* Spatial dimension */
+
+ else if (!strncmp("coupl:b:ndim_", sec_name, strlen("coupl:b:ndim_"))) {
+ syr_comm_read_body(1,
+ sp_dim,
+ elt_type,
+ comm,
+ 0);
+ continue;
+ }
+
+ /* Other messages should be received from all ranks, so read headers */
+ /*-------------------------------------------------------------------*/
+
+ strncpy(sec_name_cmp, sec_name, SYR_COMM_L_SEC_NAME);
+ sec_name_cmp[SYR_COMM_L_SEC_NAME] = '\0';
+ max_msg_size = 0;
+
+ for (proc_id = 1; proc_id < n_ranks; proc_id++) {
+
+ syr_comm_read_header(sec_name,
+ &msg_size,
+ &elt_type,
+ comm,
+ proc_id);
+
+ /* Sanity test */
+
+ if (strncmp(sec_name_cmp, sec_name, SYR_COMM_L_SEC_NAME))
+ bft_error(__FILE__, __LINE__, 0,
+ syr_glob_coupling_sec_name_error,
+ syr_comm_get_name(comm), sec_name,
+ proc_id + 1, sec_name_cmp);
+
+ /* Number of elements in body */
+
+ max_msg_size = SYR_MAX(msg_size, max_msg_size);
+
+ }
+
+ /* Decode headers received from all ranks */
+ /*-----------------------------------------*/
+
+ /* Read the local number of vertices or elements */
+ /*-----------------------------------------------*/
+
+ if ( !strncmp("coupl:b:npoinf", sec_name, strlen("coupl:b:npoinf"))
+ || !strncmp("coupl:b:nelebf", sec_name, strlen("coupl:b:nelebf"))) {
+
+ int rank_count = 0;
+ int *_n_elts = NULL;
+
+ BFT_MALLOC(_n_elts, n_ranks, int);
+
+ /* Set distribution based on vertices or elements */
+
+ if (!strncmp("coupl:b:npoinf", sec_name, strlen("coupl:b:npoinf")))
+ dist = &(coupling->dist);
+ else
+ dist = &elt_dist;
+
+ /* Receive data */
+
+ for (proc_id = 0; proc_id < n_ranks ; proc_id++) {
+
+ syr_comm_read_body(1,
+ &(_n_elts[proc_id]),
+ elt_type,
+ comm,
+ proc_id);
+
+ }
+
+ /* Reduce n_ranks to those ranks owning at least one element */
+
+ for (proc_id = 0; proc_id < n_ranks ; proc_id++) {
+ if (_n_elts[proc_id] > 0)
+ rank_count += 1;
+ }
+
+ dist->n_ranks = rank_count;
+
+ /* Build the list of coupled ranks, and associated index */
+
+ if (dist->proc_id != NULL) {/* in case of re-definition */
+ BFT_FREE(dist->proc_id);
+ BFT_FREE(dist->index);
+ }
+
+ BFT_MALLOC(dist->proc_id, dist->n_ranks, int);
+ BFT_MALLOC(dist->index, dist->n_ranks + 1, int);
+
+ dist->index[0] = 0;
+ rank_count = 0;
+
+ for (proc_id = 0; proc_id < n_ranks ; proc_id++) {
+
+ if (_n_elts[proc_id] > 0) {
+
+ if (_n_elts[proc_id] > dist->n_elts_max)
+ dist->n_elts_max = _n_elts[proc_id];
+
+ dist->proc_id[rank_count] = proc_id;
+ dist->index[rank_count + 1] = ( dist->index[rank_count]
+ + _n_elts[proc_id]);
+ rank_count += 1;
+
+ }
+
+ }
+
+ /* If there is only one distant rank, the local and
+ global number of vertices are the same, and the latter
+ might not be re-sent later; for elements, we can
+ always compute the global number of elements, as
+ they do not overlap on processor boundaries */
+
+ if (n_ranks == 1)
+ dist->n_elts_g = _n_elts[0];
+
+ if (dist == &elt_dist)
+ dist->n_elts_g = dist->index[dist->n_ranks];
+
+ BFT_FREE(_n_elts);
+
+ } /* End reading the local number of entities */
+
+ /* Read the global number of vertices */
+ /*------------------------------------*/
+
+ else if (!strncmp("coupl:b:g:npoinf",
+ sec_name,
+ strlen("coupl:b:g:npoinf"))) {
+
+ for (proc_id = 0; proc_id < n_ranks; proc_id++) {
+
+ syr_comm_read_body(1,
+ &(coupling->dist.n_elts_g),
+ elt_type,
+ comm,
+ proc_id);
+
+ }
+
+ }
+
+ /* Read the global numbering of vertices or elements */
+ /*---------------------------------------------------*/
+
+ else if ( !strncmp("coupl:b:g:vtxnum",
+ sec_name,
+ strlen("coupl:b:g:vtxnum"))
+ || !strncmp("coupl:b:g:eltnum",
+ sec_name,
+ strlen("coupl:b:g:eltnum"))) {
+
+ /* Set distribution based on vertices or elements */
+
+ if (!strncmp("coupl:b:g:vtxnum", sec_name, strlen("coupl:b:g:vtxnum")))
+ dist = &(coupling->dist);
+ else
+ dist = &elt_dist;
+
+ /* Receive data */
+
+ if (dist->elt_num != NULL) /* in case of re-definition */
+ BFT_FREE(dist->elt_num);
+
+ BFT_MALLOC(dist->elt_num, dist->index[dist->n_ranks], int);
+
+ for (ii = 0; ii < dist->n_ranks; ii++) {
+
+ syr_comm_read_body((dist->index[ii+1] - dist->index[ii]),
+ (dist->elt_num + dist->index[ii]),
+ elt_type,
+ comm,
+ dist->proc_id[ii]);
+
+ }
+
+ }
+
+ /* Read the vertices's coordinates (non-interlaced) */
+ /*--------------------------------------------------*/
+
+ else if (!strncmp("coupl:b:xyzf", sec_name, strlen("coupl:b:xyzf") )) {
+
+ double *buffer = NULL;
+
+ dist = &(coupling->dist);
+ stride = *sp_dim;
+
+ /* Allocate necessary memory then receive data */
+
+ BFT_MALLOC(*vtx_coords, dist->n_elts_g * stride, double);
+
+ if (dist->n_ranks > 1)
+ BFT_MALLOC(buffer, max_msg_size * stride, double);
+ else
+ buffer = *vtx_coords;
+
+ for (ii = 0; ii < dist->n_ranks; ii++) {
+
+ int glob_id;
+ int n_elts_loc = dist->index[ii+1] - dist->index[ii];
+
+ syr_comm_read_body(n_elts_loc * stride,
+ buffer,
+ elt_type,
+ comm,
+ dist->proc_id[ii]);
+
+ /* Assemble coordinates if necessary */
+
+ if (buffer != *vtx_coords) {
+ for (jj = 0; jj < n_elts_loc; jj++) {
+ if (dist->elt_num != NULL)
+ glob_id = dist->elt_num[dist->index[ii] + jj] - 1;
+ else
+ glob_id = dist->index[ii] + jj;
+
+ for (kk = 0; kk < stride; kk++) {
+ (*vtx_coords)[(dist->n_elts_g * kk) + glob_id]
+ = buffer[(n_elts_loc * kk) + jj];
+ }
+ }
+ }
+
+ } /* End of loop on distant ranks */
+
+ if (buffer != *vtx_coords) {
+ BFT_FREE(buffer);
+ }
+
+ *n_vtx = dist->n_elts_g;
+
+ }
+
+ /* Read segment or triangle connectivity (non-interlaced) */
+ /*--------------------------------------------------------*/
+
+ else if (!strncmp("coupl:b:nodebf", sec_name, strlen("coupl:b:nodebf") )) {
+
+ int *buffer = NULL;
+ syr_coupling_dist_t *vtx_dist = &(coupling->dist);
+
+ stride = *sp_dim; /* 2 for 2d segments, 3 for 3d triangles */
+ dist = &elt_dist;
+
+ /* Allocate necessary memory then receive data */
+
+ BFT_MALLOC(*elt_connect, dist->n_elts_g * stride, int);
+
+ if (dist->n_ranks > 1)
+ BFT_MALLOC(buffer, max_msg_size * stride, int);
+ else
+ buffer = *elt_connect;
+
+ for (ii = 0; ii < dist->n_ranks; ii++) {
+
+ int elt_id, vtx_id, global_vtx_num;
+ int n_elts_loc = dist->index[ii+1] - dist->index[ii];
+
+ syr_comm_read_body(n_elts_loc * stride,
+ buffer,
+ elt_type,
+ comm,
+ dist->proc_id[ii]);
+
+ /* Assemble connectivity if necessary */
+
+ if (buffer != *elt_connect) {
+ for (jj = 0; jj < n_elts_loc; jj++) {
+ if (dist->elt_num != NULL)
+ elt_id = dist->elt_num[dist->index[ii] + jj] - 1;
+ else
+ elt_id = dist->index[ii] + jj;
+
+ assert( elt_id != -1 && elt_id <= dist->n_elts_g );
+
+ for (kk = 0; kk < stride; kk++) {
+
+ vtx_id = buffer[(n_elts_loc * kk) + jj] - 1;
+
+ assert(vtx_id != -1);
+
+ global_vtx_num = vtx_dist->elt_num[vtx_dist->index[ii] + vtx_id];
+
+ assert(global_vtx_num != 0);
+ assert(global_vtx_num <= vtx_dist->n_elts_g);
+
+ (*elt_connect)[(dist->n_elts_g * kk) + elt_id] = global_vtx_num;
+
+
+ } /* End of loop on stride */
+
+ } /* End of loop on local elements */
+
+ } /* End if buffer != *elt_connect */
+
+ } /* End of loop on distant ranks */
+
+ if (buffer != (*elt_connect)) {
+ BFT_FREE(buffer);
+ }
+
+ /* Set return values */
+
+ *n_elts = dist->n_elts_g;
+
+ }
+
+ /* Otherwise unknown or unexpected message */
+ /*-----------------------------------------*/
+
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ "Message \"%s\" inconnu ou inattendu a cette etape :\n"
+ "--> abandon.",
+ sec_name);
+
+ } /* End of loop on messages */
+
+ /* Free values that will be needed no more */
+
+ _syr_coupling_dist_finalize(&elt_dist);
+
+ /* Check all data was received */
+
+ if (*n_vtx == 0 || *vtx_coords == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ "Aucune donnee sur les sommets n'a ete recue.");
+
+ if (*n_elts == 0 || *elt_connect == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ "Aucune donnee sur les elements n'a ete recue.");
+
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange of synchronization (supervision) messages
+ *
+ * parameters:
+ * coupling <-- Associated coupling object
+ * is_last --> Last time step or iteration indicator
+ * is_end --> Calculation stop indicator
+ *----------------------------------------------------------------------------*/
+
+void
+syr_coupling_supervise(syr_coupling_t *coupling,
+ int *is_last,
+ int *is_end)
+{
+ char sec_name[SYR_COMM_L_SEC_NAME + 1];
+
+ syr_type_t elt_type;
+
+ int msg_size = 0;
+
+ const int syr_id = coupling->syr_id;
+ const int comm_echo = coupling->comm_echo;
+ const syr_comm_t *comm = coupling->comm;
+
+ /* Send a command message to Code_Saturne */
+ /*----------------------------------------*/
+
+ if (*is_end == 1)
+ syr_comm_write_section("cmd:stop",
+ 0,
+ NULL,
+ SYR_TYPE_void,
+ comm,
+ 0);
+
+ else /* Ready to start a new iteration */
+ syr_comm_write_section("cmd:iter:start",
+ 0,
+ NULL,
+ SYR_TYPE_void,
+ comm,
+ 0);
+
+ /* Receive a command message from Code_Saturne */
+ /*---------------------------------------------*/
+
+ syr_comm_read_header(sec_name,
+ &msg_size,
+ &elt_type,
+ comm,
+ 0);
+
+ /* If message indicates calculation stop */
+ /*---------------------------------------*/
+
+ if ( !strncmp("EOF", sec_name, strlen("EOF"))
+ || !strncmp("cmd:stop", sec_name, strlen("cmd:stop"))) {
+
+ printf("\txxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
+ "\tx Couplage %2d arrete par Code_Saturne x\n"
+ "\txxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", syr_id);
+ fflush(stdout);
+
+ *is_end = 1;
+
+ }
+
+ /* If message indicates last iteration */
+ /*-------------------------------------*/
+
+ else if (!strncmp("cmd:iter:start:last", sec_name,
+ strlen("cmd:iter:start:last"))) {
+
+ if (comm_echo >= 0) {
+ printf("\t*** Code_Saturne indique une derniere iteration.\n\n");
+ fflush(stdout);
+ }
+
+ *is_last = 1;
+
+ }
+
+ /* If message indicates a new iteration */
+ /*--------------------------------------*/
+
+ else if (!strncmp("cmd:iter:start", sec_name, strlen("cmd:iter:start"))) {
+
+ if (comm_echo >= 0) {
+ printf("\t*** Code_Saturne indique une nouvelle iteration.\n\n");
+ fflush(stdout);
+ }
+
+ }
+
+ /* Otherwise, message is unknown */
+ /*-------------------------------*/
+
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ "Message \"%s\" inconnu ou inattendu a cette etape :\n"
+ "--> abandon.",
+ sec_name);
+
+ assert(msg_size == 0);
+}
+
+/*----------------------------------------------------------------------------
+ * Data exchange prior to iteration
+ *
+ * Send wall temperature
+ * Receive fluid temperature and pseudo-exchange coefficient
+ * Possibly receive CFD code time step
+ *
+ * parameters:
+ * coupling <-- Associated coupling object
+ * tpf <-> Wall Temperature in, Fluid temperature out
+ * hht --> Pseudo-exchange coefficient
+ * dtfluid --> Time step set by CFD code if received, -1 otherwise
+ *----------------------------------------------------------------------------*/
+
+void
+syr_coupling_exchange_var(syr_coupling_t *coupling,
+ double *tpf,
+ double *hht,
+ double *dtfluid)
+{
+ char sec_name[SYR_COMM_L_SEC_NAME + 1];
+ char sec_name_cmp[SYR_COMM_L_SEC_NAME + 1];
+
+ int ii;
+ int r_tf = 0, r_hht = 0;
+ int n_elts = 0;
+ syr_type_t elt_type;
+ double *buffer = NULL, *recv_var = NULL;
+ syr_coupling_dist_t *dist = NULL;
+
+ const syr_comm_t *comm = coupling->comm;
+
+ /* Initialize dtfluid in case the corresponding information
+ is not set by the CFD code */
+
+ *dtfluid = -1;
+
+ /* Send wall temperature calculated by Syrthes */
+ /*---------------------------------------------*/
+
+ /* Define section name */
+
+ sprintf(sec_name, "coupl:b:tparoi");
+
+ /* Loop on communicating ranks */
+
+ dist = &(coupling->dist);
+
+ BFT_MALLOC(buffer, dist->n_elts_max, double);
+
+ for (ii = 0; ii < dist->n_ranks; ii++) {
+
+ /* Scatter to local buffer then write */
+
+ _syr_coupling_scatter_var(coupling,
+ ii,
+ buffer,
+ tpf);
+
+ syr_comm_write_section(sec_name,
+ (dist->index[ii + 1] - dist->index[ii]),
+ (void *)buffer,
+ SYR_TYPE_double,
+ comm,
+ dist->proc_id[ii]);
+
+ } /* End of loop on communicating ranks */
+
+ /*-------------------------------------------------------------------------*/
+ /* Receive fluid temperature and exchange coefficient computed by the */
+ /* Code_Saturne kernel(s) */
+ /*-------------------------------------------------------------------------*/
+
+ while (r_tf == 0 || r_hht == 0) {
+
+ n_elts = 0;
+ recv_var = NULL;
+
+ /* Read message header */
+ /*-------------------- */
+
+ for (ii = 0; ii < dist->n_ranks; ii++) {
+
+ syr_comm_read_header(sec_name,
+ &n_elts,
+ &elt_type,
+ comm,
+ dist->proc_id[ii]);
+
+ /* Optional time step message may have been inserted first */
+
+ if (!strncmp("coupl:dtfluid:",
+ sec_name,
+ strlen("coupl:dtfluid:"))) {
+
+ assert(n_elts == 1);
+ assert(elt_type == SYR_TYPE_double);
+
+ syr_comm_read_body(1,
+ dtfluid,
+ elt_type,
+ comm,
+ dist->proc_id[ii]);
+
+ /* Read next header */
+
+ syr_comm_read_header(sec_name,
+ &n_elts,
+ &elt_type,
+ comm,
+ dist->proc_id[ii]);
+ }
+
+ if (ii == 0) {
+
+ if (!strncmp("coupl:b:tfluid",
+ sec_name,
+ strlen("coupl:b:tfluid"))) {
+ recv_var = tpf;
+ r_tf = 1;
+ }
+ else if (!strncmp("coupl:b:hparoi",
+ sec_name,
+ strlen("coupl:b:hparoi"))) {
+ recv_var = hht;
+ r_hht = 1;
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ "Message \"%s\" inconnu ou inattendu a cette etape",
+ sec_name);
+
+ strncpy(sec_name_cmp, sec_name, SYR_COMM_L_SEC_NAME);
+ sec_name_cmp[SYR_COMM_L_SEC_NAME] = '\0';
+
+ }
+
+ /* Sanity test */
+
+ else if ( ii > 0
+ && strncmp(sec_name_cmp, sec_name, SYR_COMM_L_SEC_NAME))
+ bft_error(__FILE__, __LINE__, 0,
+ syr_glob_coupling_sec_name_error,
+ syr_comm_get_name(comm), sec_name, ii + 1,
+ sec_name_cmp);
+
+ /* Receive fluid temperature or exchange coefficient */
+ /*-------------------------------------------------- */
+
+ if (recv_var != NULL) {
+
+ assert(n_elts <= dist->n_elts_max);
+
+ syr_comm_read_body(n_elts,
+ buffer,
+ elt_type,
+ comm,
+ dist->proc_id[ii]);
+
+ _syr_coupling_gather_var(coupling,
+ ii,
+ buffer,
+ recv_var);
+
+ }
+
+ }
+
+ }
+
+ BFT_FREE(buffer);
+}
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
diff --git a/libsyrcs/syr_coupling.h b/libsyrcs/syr_coupling.h
new file mode 100644
index 0000000..e7bd211
--- /dev/null
+++ b/libsyrcs/syr_coupling.h
@@ -0,0 +1,143 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef _SYR_COUPLING_H_
+#define _SYR_COUPLING_H_
+
+/*============================================================================
+ * Main API functions for coupling between Syrthes and Code_Saturne
+ *
+ * Library: Code_Saturne Copyright EDF 2006-2008
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * System and BFT headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "syr_comm.h"
+
+/*----------------------------------------------------------------------------
+ * Structure definitions
+ *----------------------------------------------------------------------------*/
+
+typedef struct _syr_coupling_t syr_coupling_t;
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize syr_coupling_t structure
+ *
+ * arguments:
+ * syr_num <-- Id of Syrthes instance (usually 1)
+ * coupling_id <-- Id of Syrthes coupling (0 to n-1)
+ * cs_appnum <-- Application number of Code_Saturne MPI process, or -1
+ * sock_str <-- hostname:socknum of first coupled
+ * Code_Saturne process, or NULL
+ * comm_type <-- Type of comunication used
+ * comm_echo <-- Optional echo to standard output
+ *----------------------------------------------------------------------------*/
+
+syr_coupling_t *
+syr_coupling_initialize(int syr_num,
+ int coupling_id,
+ int cs_appnum,
+ const char *sock_str,
+ syr_comm_type_t comm_type,
+ int comm_echo);
+
+/*----------------------------------------------------------------------------
+ * Finalize syr_coupling_t structure
+ *----------------------------------------------------------------------------*/
+
+syr_coupling_t *
+syr_coupling_finalize(syr_coupling_t *coupling);
+
+/*----------------------------------------------------------------------------
+ * Receive Code_Saturne's coupled surface mesh
+ *
+ * the elt_connect and vtx_coords arrays are allocated here.
+ *
+ * arguments:
+ * coupling <-- Associated coupling object
+ * sp_dim --> Spacial dimension for fluid
+ * n_vtx, --> Number of vertices
+ * n_elts, --> Number of segments
+ * vtx_coords --> Vertex coordinates
+ * elt_connect --> Segment or triangle connectivity
+ *----------------------------------------------------------------------------*/
+
+void
+syr_coupling_receive_bc_mesh(syr_coupling_t *coupling,
+ int *sp_dim,
+ int *n_vtx,
+ int *n_elts,
+ double **vtx_coords,
+ int **elt_connect);
+
+/*----------------------------------------------------------------------------
+ * Exchange of synchronization (supervision) messages
+ *
+ * parameters:
+ * coupling <-- Associated coupling object
+ * is_last --> Last time step or iteration indicator
+ * is_end --> Calculation stop indicator
+ *----------------------------------------------------------------------------*/
+
+void
+syr_coupling_supervise(syr_coupling_t *coupling,
+ int *is_last,
+ int *is_end);
+
+/*----------------------------------------------------------------------------
+ * Data exchange prior to iteration
+ *
+ * Send wall temperature
+ * Receive fluid temperature and pseudo-exchange coefficient
+ * Possibly receive CFD code time step
+ *
+ * parameters:
+ * coupling <-- Associated coupling object
+ * tpf <-> Wall Temperature in, Fluid temperature out
+ * hht --> Pseudo-exchange coefficient
+ * dtfluid --> Time step set by CFD code if received, -1 otherwise
+ *----------------------------------------------------------------------------*/
+
+void
+syr_coupling_exchange_var(syr_coupling_t *coupling,
+ double *tpf,
+ double *hht,
+ double *dtfluid);
+
+/*----------------------------------------------------------------------------*/
+
+#endif /* _SYR_COUPLING_H_ */
diff --git a/libsyrcs/syr_cs.c b/libsyrcs/syr_cs.c
new file mode 100644
index 0000000..2bb14ba
--- /dev/null
+++ b/libsyrcs/syr_cs.c
@@ -0,0 +1,686 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================*/
+/* SYRTHES wrapper for coupling with Code_Saturne */
+/*============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "syr_defs.h"
+#include "syr_coupling.h"
+#include "syr_comm.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* Fake brace to force Emacs auto-indentation back to column 0 */
+#endif
+#endif /* __cplusplus */
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Prototypes for SYRTHES coupling functions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * SYRTHES initialization for Code_Saturne coupling
+ *----------------------------------------------------------------------------*/
+
+void
+proc(syrtc1, SYRTC1)(int *ndim_,
+ int *npoinf,
+ int *nodebf,
+ int *nelebf,
+ double *xyzf,
+ double *tf,
+ double *hht);
+
+/*----------------------------------------------------------------------------
+ * SYRTHES solver for Code_Saturne coupling
+ *----------------------------------------------------------------------------*/
+
+void
+proc(syrtc2, SYRTC2)(int *fin,
+ int *npoinf,
+ double *dtfluid,
+ double *tf,
+ double *hht);
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Print help and information on command-line options
+ *
+ * parameters:
+ * nom <-- name of executable program
+ * niveau <-- 1: options list; 2: description
+ *----------------------------------------------------------------------------*/
+
+static void
+syr_cs_loc_aidelc(char *nom,
+ int niveau)
+{
+ FILE *e = stderr;
+
+#ifdef HAVE_MPI
+ char opt_mpi[] = " [-comm-mpi <n1> <n2> ...]\n";
+#else
+ char opt_mpi[] = "";
+#endif
+
+#ifdef HAVE_SOCKET
+ char opt_sock[]
+ = " [-comm-socket <machine1:port> <machine2:port> ...]\n";
+#else
+ char opt_sock[] = "";
+#endif
+
+ fprintf(e,
+ "\nUtilisation : %s\n%s%s"
+ " [-app_num n] [-echo-comm <n>] [-h]\n",
+ nom, opt_sock, opt_mpi);
+
+ if (niveau == 2) {
+ fprintf(e, "\nOptions de la ligne de commandes :\n\n");
+ fprintf(e, " -app-num : numero d'application SYRTHES (defaut: 0)\n");
+#ifdef HAVE_MPI
+ fprintf(e, " -comm-mpi : communication par MPI\n");
+ fprintf(e, " n : numero d'application Code_Saturne\n");
+#endif
+#ifdef HAVE_SOCKET
+ fprintf(e, " -comm-socket <machine:port> : communication par sockets IP\n");
+#endif
+ fprintf(e, " -echo-comm : echo de la communication ;\n");
+ fprintf(e, " -1 : erreur seulement (defaut)\n");
+ fprintf(e, " 0 : impression des entetes des messages\n");
+ fprintf(e, " n : impression des entetes des messages ainsi\n");
+ fprintf(e, " que des n premiers et derniers elements\n");
+ fprintf(e, " -h : appel de l'aide (cet affichage)\n\n");
+ }
+}
+
+/*----------------------------------------------------------------------------*
+ * Convert integer argument to integer with validity check
+ *
+ * parameters:
+ * numarg <-- number of argument to convert
+ * argc <-- number of arguments in command line
+ * argv <-- array of command-line arguments
+ * argerr <-- error code
+ *----------------------------------------------------------------------------*/
+
+static int
+syr_cs_loc_argint(int numarg,
+ int argc,
+ char *argv[],
+ int *argerr)
+{
+ char *argdeb;
+ char *argfin;
+ int valint = 0;
+
+ if (numarg < argc) {
+ argdeb = argv[numarg];
+ argfin = argdeb + strlen(argdeb);
+ valint = strtol(argdeb, &argfin, 0);
+ if (argfin != argdeb + strlen(argdeb)) *argerr = 1;
+ }
+ else {
+ *argerr = 1;
+ }
+
+ return valint;
+}
+
+/*============================================================================
+ * Main function
+ *============================================================================*/
+
+int
+main(int argc,
+ char *argv[])
+{
+ int i, i_cas_sat, j_cas_sat;
+ int icoo, isom, ielt;
+
+ char *s = NULL;
+
+ int *dernier = NULL;
+ int *fin = NULL;
+
+ int *idx_som = NULL;
+ int *idx_elt = NULL;
+
+ int fin_syr = 0;
+
+ int *_ndim_ = NULL;
+ int *_npoinf = NULL;
+ int *_nelebf = NULL;
+ int **_nodebf = NULL;
+ double **_xyzf = NULL;
+
+ int ndim_ = 0;
+ int npoinf = 0;
+ int nelebf = 0;
+ int *nodebf = NULL;
+ double *xyzf = NULL;
+
+ double *tf = NULL;
+ double *hht = NULL;
+
+ double *_dtfluid = NULL;
+ double dtfluid = -1;
+
+ int fin_total = 0;
+ int numarg = 0, argerr = 0;
+
+ /* ------------------------------------------ */
+ /* Default initialization of coupling options */
+ /* ------------------------------------------ */
+
+ syr_coupling_t **syrcoupl = NULL;
+
+ int nbr_cas_sat = 0; /* number of Code_Saturne - SYRTHES couplings */
+ int *app_sat = NULL; /* application numbers of coupled Code_Saturne
+ instances in the global communicator */
+ int num_syr = -1; /* number of this SYRTHES application */
+ int echo_comm = -1; /* Communication verbosity */
+ syr_comm_type_t type_comm = SYR_COMM_TYPE_NULL; /* Communication type */
+ char **sock_str = NULL; /* strings for server sockets description */
+
+ /* Initialize error handler */
+
+ syr_errhandler_initialize();
+
+ /* Initialize memory management */
+
+ syr_mem_initialize();
+
+ /* Initialize MPI if necessary (pre-analyze command line) */
+
+#if defined (HAVE_MPI)
+ syr_mpi_initialize(&argc, &argv);
+ atexit(syr_mpi_exit_force);
+#endif
+
+ /* ---------------------------- */
+ /* Parse command-line arguments */
+ /* ---------------------------- */
+
+ printf("\n*** Interpretation de la ligne de commande ***\n");
+ for (numarg = 0; numarg < argc; numarg++)
+ printf("%s ",argv[numarg]);
+ fflush(stdout);
+
+ numarg = 0;
+
+ while (++numarg < argc) {
+
+ s = argv[numarg];
+
+ if (strcmp(s, "-app-num") == 0) {
+ num_syr = (int)syr_cs_loc_argint(++numarg, argc, argv, &argerr);
+ if (num_syr < 0)
+ argerr = 2;
+ }
+
+#ifdef HAVE_MPI
+ else if (strcmp(s, "-comm-mpi") == 0) {
+ type_comm = SYR_COMM_TYPE_MPI;
+
+ while ( numarg + 1 < argc
+ && *(argv[numarg + 1]) != '-') {
+ BFT_REALLOC(app_sat, nbr_cas_sat + 1, int);
+ BFT_REALLOC(sock_str, nbr_cas_sat + 1, char *);
+ app_sat[nbr_cas_sat]
+ = (int)syr_cs_loc_argint(++numarg, argc, argv, &argerr);
+ sock_str[nbr_cas_sat] = NULL;
+ nbr_cas_sat++;
+ }
+
+ }
+#endif
+#ifdef HAVE_SOCKET
+ else if (strcmp(s, "-comm-socket") == 0) {
+ type_comm = SYR_COMM_TYPE_SOCKET;
+
+ while (numarg + 1 < argc && *(argv[numarg + 1]) != '-') {
+ BFT_REALLOC(app_sat, nbr_cas_sat + 1, int);
+ BFT_REALLOC(sock_str, nbr_cas_sat + 1, char *);
+ app_sat[nbr_cas_sat] = -1;
+ BFT_MALLOC(sock_str[nbr_cas_sat], strlen(argv[numarg + 1]) + 1, char);
+ strcpy(sock_str[nbr_cas_sat], argv[++numarg]);
+ nbr_cas_sat++;
+ }
+
+ }
+#endif
+ else if (strcmp(s, "-echo-comm") == 0 || strcmp(s, "-ec") == 0) {
+ if (numarg + 1 < argc && *(argv[numarg + 1]) != '-')
+ echo_comm = (int)syr_cs_loc_argint(++numarg, argc, argv, &argerr);
+ }
+ else if (strcmp(s, "-h") == 0) {
+ syr_cs_loc_aidelc(argv[0], 2);
+ syr_exit(EXIT_SUCCESS);
+ }
+ else
+ argerr = 1;
+ }
+
+ /* Final default initializations */
+
+ if (echo_comm < -1) argerr = 2;
+ if (num_syr < 0) num_syr = 0;
+
+ /* Print help if necessary */
+
+ if (argerr != 0) {
+ syr_cs_loc_aidelc(argv[0], argerr);
+ bft_error(__FILE__, __LINE__, 0,
+ "Erreur lors de la lecture de la ligne de commande.\n");
+ }
+
+ /* ----------------------------------------*/
+ /* Initialize of syr_coupling_t structures */
+ /* ----------------------------------------*/
+
+ if (echo_comm >= 0) {
+ printf
+ ("\n*** Initialisation des structures SYRTHES pour le couplage\n");
+ fflush(stdout);
+ }
+
+ BFT_MALLOC(syrcoupl, nbr_cas_sat, syr_coupling_t *);
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+
+ syrcoupl[i_cas_sat] = syr_coupling_initialize(num_syr,
+ i_cas_sat,
+ app_sat[i_cas_sat],
+ sock_str[i_cas_sat],
+ type_comm,
+ echo_comm);
+
+#if defined (HAVE_SOCKET)
+ BFT_FREE(sock_str[i_cas_sat]);
+#endif
+
+ }
+
+#if defined (HAVE_SOCKET)
+ BFT_FREE(sock_str);
+#endif
+
+ BFT_FREE(app_sat);
+
+ /* Allocate working arrays */
+ /* ----------------------- */
+
+ BFT_MALLOC(_ndim_, nbr_cas_sat, int);
+
+ BFT_MALLOC(_npoinf, nbr_cas_sat, int);
+ BFT_MALLOC(_nelebf, nbr_cas_sat, int);
+
+ BFT_MALLOC(idx_som, nbr_cas_sat + 1, int);
+ BFT_MALLOC(idx_elt, nbr_cas_sat + 1, int);
+
+ for (i = 0; i < nbr_cas_sat; i++) {
+ _npoinf[i] = 0;
+ _nelebf[i] = 0;
+ idx_som[i] = 0;
+ idx_elt[i] = 0;
+ }
+
+ /* Element connectivity and vertex coordinates */
+
+ BFT_MALLOC(_nodebf, nbr_cas_sat, int *);
+ BFT_MALLOC(_xyzf, nbr_cas_sat, double *);
+
+ for (i = 0; i < nbr_cas_sat; i++) {
+ _xyzf[i] = NULL;
+ _nodebf[i] = NULL;
+ }
+
+ if (echo_comm >= 0) {
+ printf("\n*** Reception du maillage couple depuis le(s) noyau(x)\n");
+ fflush(stdout);
+ }
+
+ /* ----------------------------------------- */
+ /* Receive data necessary required by syrtc1 */
+ /* ----------------------------------------- */
+
+ idx_som[0] = 0;
+ idx_elt[0] = 0;
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+
+ syr_coupling_receive_bc_mesh(syrcoupl[i_cas_sat],
+ &_ndim_[i_cas_sat],
+ &_npoinf[i_cas_sat],
+ &_nelebf[i_cas_sat],
+ &_xyzf[i_cas_sat],
+ &_nodebf[i_cas_sat]);
+
+ if (echo_comm >= 0) {
+ printf("\n------------------------------------------------\n");
+ printf("\tCouplage numero: %d\n", i_cas_sat);
+ printf("\tNombre de sommets couples : %9d\n",
+ _npoinf[i_cas_sat]);
+ printf("\tNombre d'elements couples : %9d\n",
+ _nelebf[i_cas_sat]);
+ printf("------------------------------------------------\n\n");
+ fflush(stdout);
+ }
+
+ idx_som[i_cas_sat + 1] = idx_som[i_cas_sat] + _npoinf[i_cas_sat];
+ idx_elt[i_cas_sat + 1] = idx_elt[i_cas_sat] + _nelebf[i_cas_sat];
+
+ }
+
+ npoinf = idx_som[nbr_cas_sat];
+ nelebf = idx_elt[nbr_cas_sat];
+
+ /* Check that all couplings returned the same value for ndim */
+
+ ndim_ = _ndim_[0];
+
+ /* Append arrays in case of multiple couplings */
+
+ if (nbr_cas_sat > 1) {
+
+ BFT_MALLOC(xyzf, npoinf * ndim_, double);
+ BFT_MALLOC(nodebf, nelebf * ndim_, int);
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+
+ for (isom = 0; isom < _npoinf[i_cas_sat]; isom++) {
+
+ for (icoo = 0; icoo < ndim_; icoo++)
+ xyzf[isom + idx_som[i_cas_sat] + (npoinf*icoo)]
+ = _xyzf[i_cas_sat][isom + (_npoinf[i_cas_sat]*icoo)];
+
+ }
+
+ for (ielt = 0 ; ielt < _nelebf[i_cas_sat] ; ielt++) {
+
+ for (icoo = 0; icoo < ndim_; icoo++) {
+
+ int this_value = _nodebf[i_cas_sat][ielt + (_nelebf[i_cas_sat]*icoo)];
+
+ nodebf[ielt + idx_elt[i_cas_sat] + (nelebf*icoo)]
+ = this_value + idx_som[i_cas_sat];
+
+ }
+
+ }
+
+ } /* End of loop on Code_Saturne instance */
+
+ /* Free arrays not needed anymore */
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+ BFT_FREE(_xyzf[i_cas_sat]);
+ BFT_FREE(_nodebf[i_cas_sat]);
+ }
+
+ }
+ else {
+
+ xyzf = _xyzf[0];
+ nodebf = _nodebf[0];
+
+ }
+
+ BFT_FREE(idx_elt);
+
+ BFT_FREE(_ndim_);
+ BFT_FREE(_xyzf);
+ BFT_FREE(_nodebf);
+ BFT_FREE(_npoinf);
+ BFT_FREE(_nelebf);
+
+ /* Allocate arrays for exchanged variables: */
+ /* fluid temperature and exchange coefficient */
+
+ BFT_MALLOC(tf, npoinf, double);
+ BFT_MALLOC(hht, npoinf, double);
+
+ BFT_MALLOC(_dtfluid, nbr_cas_sat, double);
+
+ /* ----------- */
+ /* Call syrtc1 */
+ /* ----------- */
+
+ proc(syrtc1, SYRTC1)(&ndim_,
+ &npoinf,
+ nodebf,
+ &nelebf,
+ xyzf,
+ tf,
+ hht);
+
+ /* Free nodebf and xyzf, which are not needed anymore */
+
+ BFT_FREE(xyzf);
+ BFT_FREE(nodebf);
+
+ /* Prepare for time loop */
+ /* --------------------- */
+
+ BFT_MALLOC(dernier, nbr_cas_sat, int);
+ BFT_MALLOC(fin, nbr_cas_sat, int);
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+ dernier[i_cas_sat] = 0;
+ fin[i_cas_sat] = 0;
+ }
+
+ /* ------------------- */
+ /* Start time stepping */
+ /* ------------------- */
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+
+ syr_coupling_supervise(syrcoupl[i_cas_sat],
+ &dernier[i_cas_sat],
+ &fin[i_cas_sat]);
+
+ /* Send wall temperature and receive
+ fluid temperature and exchange coefficient */
+
+ if (fin[i_cas_sat] == 0)
+ syr_coupling_exchange_var(syrcoupl[i_cas_sat],
+ tf + idx_som[i_cas_sat],
+ hht + idx_som[i_cas_sat],
+ _dtfluid + i_cas_sat);
+
+ if (dernier[i_cas_sat] == 1 || fin[i_cas_sat] == 1)
+ fin_syr = 1;
+
+ }
+
+ /* ------------- */
+ /* Time stepping */
+ /* ------------- */
+
+ while (fin_total == 0) {
+
+ /* Handle time step if given by CFD code */
+
+ dtfluid = -1;
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+ if ( _dtfluid[i_cas_sat] > 0
+ && (dtfluid < 0 || dtfluid > _dtfluid[i_cas_sat]))
+ dtfluid = _dtfluid[i_cas_sat];
+ }
+
+ /* Call to syrtc2 => SYRTHES calculation in solid mesh */
+
+ proc(syrtc2, SYRTC2)(&fin_syr,
+ &npoinf,
+ &dtfluid,
+ tf,
+ hht);
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+
+ if (fin_syr == 1)
+ fin[i_cas_sat] = 1;
+
+ syr_coupling_supervise(syrcoupl[i_cas_sat],
+ &dernier[i_cas_sat],
+ &fin[i_cas_sat]);
+
+ /* Send wall temperature and receive
+ fluid temperature and exchange coefficient */
+
+ if (fin[i_cas_sat] == 0)
+ syr_coupling_exchange_var(syrcoupl[i_cas_sat],
+ tf + idx_som[i_cas_sat],
+ hht + idx_som[i_cas_sat],
+ _dtfluid + i_cas_sat);
+
+ if (dernier[i_cas_sat] == 1 || fin[i_cas_sat] == 1)
+ fin_syr = 1;
+
+ for (j_cas_sat = 0; j_cas_sat < nbr_cas_sat; j_cas_sat++) {
+ if (fin[j_cas_sat] == 1)
+ fin_total = 1;
+ else {
+ fin_total = 0;
+ break;
+ }
+ }
+
+ } /* Loop on couplings with Code_Saturne */
+
+ } /* End of loop on time steps */
+
+ /* ------- */
+ /* Cleanup */
+ /* ------- */
+
+ for (i_cas_sat = 0; i_cas_sat < nbr_cas_sat; i_cas_sat++) {
+
+ /* Destroy structures used for coupling */
+
+ if (echo_comm >= 0) {
+ printf
+ ("\n*** Destruction des structures SYRTHES lie au couplage %d\n",
+ i_cas_sat);
+ fflush(stdout);
+ }
+
+ syrcoupl[i_cas_sat] = syr_coupling_finalize(syrcoupl[i_cas_sat]);
+
+ }
+
+ BFT_FREE(syrcoupl);
+
+ BFT_FREE(idx_som);
+
+ BFT_FREE(fin);
+ BFT_FREE(dernier);
+
+ BFT_FREE(tf);
+ BFT_FREE(hht);
+
+ BFT_FREE(_dtfluid);
+
+ /* Finalize memory management */
+
+ syr_mem_finalize();
+
+ /* Close MPI communications if necessary */
+
+#if defined (HAVE_MPI)
+ if (type_comm == SYR_COMM_TYPE_MPI)
+ syr_mpi_finalize();
+#endif
+
+ /* Normal program exit */
+
+ syr_exit(EXIT_SUCCESS);
+
+ /* The next instruction is never called, but is used to avoid
+ compiler warnings about a function returning no value */
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
diff --git a/libsyrcs/syr_defs.c b/libsyrcs/syr_defs.c
new file mode 100644
index 0000000..e30d035
--- /dev/null
+++ b/libsyrcs/syr_defs.c
@@ -0,0 +1,582 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Definitions, Global variables, and basic functions
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_mem.h>
+#include <bft_mem_usage.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#if defined(HAVE_MPI)
+#include <fvm_coupling.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "syr_defs.h"
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* Fake brace to force Emacs auto-indentation back to column 0 */
+#endif
+#endif /* __cplusplus */
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+int syr_glob_base_rank = - 1; /* Parallel rank; -1 if serial */
+
+char syr_glob_build_date[] = __DATE__; /* Build date */
+
+#if defined(HAVE_MPI)
+fvm_coupling_mpi_world_t *syr_glob_coupling_world = NULL;
+#endif
+
+/*===========================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Basic error handler
+ *----------------------------------------------------------------------------*/
+
+static void _syr_error_handler
+(
+ const char *const filename,
+ const int linenum,
+ const int sys_err_code,
+ const char *const format,
+ va_list arg_ptr
+)
+{
+ fflush(stdout);
+
+ fprintf(stderr, "\n"
+ "Erreur a l'execution de Syrthes\n"
+ "===============================\n");
+
+ if (sys_err_code != 0)
+ fprintf(stderr, "\nErreur Systeme : %s\n", strerror(sys_err_code));
+
+ fprintf(stderr, "\n%s:%d: Erreur fatale.\n\n", filename, linenum);
+
+ vfprintf(stderr, format, arg_ptr);
+
+ fprintf(stderr, "\n\n");
+
+ assert(0); /* Use of assert() here allows interception by a debugger. */
+
+#if defined(HAVE_MPI)
+ {
+ int mpi_flag;
+
+ MPI_Initialized(&mpi_flag);
+
+ if (mpi_flag != 0) {
+ MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
+ }
+ }
+#endif /* HAVE_MPI */
+
+ exit(EXIT_FAILURE);
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * First analysis of the command line to determine if we require MPI,
+ * and initialization if necessary
+ *
+ * parameters:
+ * argc <-> number of command line arguments
+ * argv <-> array of command line arguments
+ *----------------------------------------------------------------------------*/
+
+static void
+_mpi_test_and_initialize(int *argc,
+ char **argv[])
+{
+ int arg_id = 0, flag = 0;
+ int use_mpi = 0;
+
+#if defined(MPICH_NAME)
+
+ /*
+ Using standard MPICH1 1.2.x with the p4 (default) mechanism,
+ the information required by MPI_Init() are transferred through
+ the command line, which is then modified by MPI_Init();
+ in this case, only rank 0 knows the "user" command line arguments
+ at program startup, the other processes obtaining them only upon
+ calling MPI_Init(). In this case, it is thus necessary to initialize
+ MPI before parsing the command line.
+ */
+
+ for (arg_id = 0; arg_id < *argc; arg_id++) {
+ if ( !strcmp((*argv)[arg_id], "-p4pg") /* For process 0 */
+ || !strcmp((*argv)[arg_id], "-p4rmrank")) { /* For other processes */
+ use_mpi = 1;
+ break;
+ }
+ }
+
+ if (getenv("GMPI_ID") != NULL) /* In case we are using MPICH-GM */
+ use_mpi = 1;
+
+#elif defined(__blrts__) || defined(__bgp__) \
+ || defined(__CRAYXT_COMPUTE_LINUX_TARGET)
+ use_mpi = 1;
+
+#elif defined(LAM_MPI)
+ if (getenv("LAMRANK") != NULL)
+ use_mpi = 1;
+
+#elif defined(OPEN_MPI)
+ if (getenv("OMPI_MCA_ns_nds_vpid") != NULL)
+ use_mpi = 1;
+ else if (getenv("OMPI_COMM_WORLD_RANK") != NULL)
+ use_mpi = 1;
+
+#elif defined(MPICH2)
+ if (getenv("PMI_RANK") != NULL)
+ use_mpi = 1;
+
+#endif /* Tests for known MPI variants */
+
+ /* If we have determined from known MPI environment variables
+ of command line arguments that we are running under MPI,
+ initialize MPI */
+
+ if (use_mpi == 1) {
+ MPI_Initialized(&flag);
+ if (!flag)
+ MPI_Init(argc, argv);
+ }
+
+ /* Loop on command line arguments */
+
+ arg_id = 0;
+
+ while (++arg_id < *argc) {
+
+ if (strcmp((*argv)[arg_id], "-comm-mpi") == 0)
+ use_mpi = 1;
+
+ } /* End of loop on command line arguments */
+
+ if (use_mpi == 1) {
+ MPI_Initialized(&flag);
+ if (!flag)
+ MPI_Init(argc, argv);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * First analysis of the command line to determine if we require MPI,
+ * and initialization if necessary
+ *
+ * parameters:
+ * argc <-- number of command line arguments
+ * argv <-- array of command line arguments
+ *
+ * returns:
+ * -1 if MPI is not needed, or application number in MPI_COMM_WORLD of
+ * processes associated with this instance of Code_Saturne
+ *----------------------------------------------------------------------------*/
+
+static int
+_mpi_app_num(int argc,
+ char *argv[])
+{
+ char *s;
+
+ int arg_id = 0, flag = 0;
+ int appnum = -1;
+
+ /* Loop on command line arguments */
+
+ arg_id = 0;
+
+ while (++arg_id < argc) {
+
+ s = argv[arg_id];
+
+ if (strcmp(s, "-app-num") == 0) {
+ int _appnum = 0;
+ if (arg_id + 1 < argc) {
+ if (sscanf(argv[arg_id + 1], "%d", &_appnum) == 1)
+ appnum = _appnum;
+ }
+ }
+
+ }
+
+ /*
+ If appnum was not given through the command line but we
+ are running under MPI-2, appnum may be available through
+ the MPI_APPNUM attribute.
+ */
+
+#if defined(MPI_VERSION) && (MPI_VERSION >= 2)
+ if (appnum < 0) {
+ void *attp = NULL;
+ MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_APPNUM, &attp, &flag);
+ if (flag != 0)
+ appnum = *(int *)attp;
+ }
+#endif
+
+ if (appnum < 0)
+ appnum = 0;
+
+ return appnum;
+}
+
+#endif /* HAVE_MPI */
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Error initialization and handling
+ *----------------------------------------------------------------------------*/
+
+void
+syr_errhandler_initialize(void)
+{
+ bft_error_handler_set(_syr_error_handler);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize memory management
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mem_initialize(void)
+{
+ char *base_name;
+ char *full_name = NULL;
+
+ /* Initialize memory counting */
+
+ bft_mem_usage_init();
+
+ /* Initialize memory management */
+
+ if ((base_name = getenv("SYR_FIC_MEM")) != NULL) {
+
+ full_name = (char *)(malloc((strlen(base_name) + 6) * sizeof (char)));
+
+ if (full_name != NULL)
+ strcpy(full_name, base_name);
+
+ }
+
+ bft_mem_init(full_name);
+
+ if (full_name != NULL)
+ free(full_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize memory management
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mem_finalize(void)
+{
+ double rval;
+ int ii;
+
+ const char unit[] = {'k', 'm', 'g', 't', 'p'};
+
+ /* Memory summary */
+
+ printf("\nBilan de l'occupation memoire :\n\n");
+
+ rval = (double) bft_mem_usage_max_pr_size();
+
+ for (ii = 0; rval > 1024. && unit[ii] != 'p'; ii++)
+ rval /= 1024.;
+
+ /* Printout */
+
+ printf (" Consommation memoire totale mesuree : %12.3f %co\n",
+ rval, unit[ii]);
+
+ /* Finalize memory managment */
+
+ bft_mem_end();
+
+ /* Finalize memory count */
+
+ bft_mem_usage_end();
+}
+
+#if defined (HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Initialize MPI communication if necessary
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_initialize(int *argc,
+ char **argv[])
+{
+ int mpi_init_flag, rank;
+ MPI_Comm mpi_comm_syr = MPI_COMM_NULL;
+ int app_num = -1, app_num_max = -1;
+ int ierror = 0;
+
+ /* Initialize MPI */
+
+ _mpi_test_and_initialize(argc, argv);
+
+ MPI_Initialized(&mpi_init_flag);
+ if (!mpi_init_flag)
+ return;
+
+ app_num = _mpi_app_num(*argc, *argv);
+
+ /*
+ Split MPI_COMM_WORLD to separate different coupled applications
+ (collective operation, like all MPI communicator creation operations).
+
+ We suppose the color argument to MPI_Comm_split is equal to the
+ application number, given through the command line or through
+ mpiexec and passed here as an argument.
+ */
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+ MPI_Allreduce(&app_num, &app_num_max, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
+
+ if (app_num_max > 0)
+ ierror = MPI_Comm_split(MPI_COMM_WORLD, app_num, rank, &mpi_comm_syr);
+ else
+ ierror = 1;
+
+ if (ierror != 0)
+ bft_error(__FILE__, __LINE__, 0,
+ "Erreur a la creation d'un communicateur local a SYRTHES.\n");
+
+ /* Discover other applications in the same MPI root communicator
+ (and participate in correspondig communication). */
+
+ syr_glob_coupling_world = fvm_coupling_mpi_world_create(app_num,
+ "SYRTHES 3.4",
+ NULL,
+ mpi_comm_syr);
+
+ /* mpi_comm_syr is not used anymore */
+
+ if (mpi_comm_syr != MPI_COMM_NULL)
+ MPI_Comm_free(&mpi_comm_syr);
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize MPI communication
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_finalize(void)
+{
+ int ierror = 0;
+
+ fvm_coupling_mpi_world_destroy(&syr_glob_coupling_world);
+
+ assert(syr_glob_coupling_world == NULL);
+
+ ierror = MPI_Barrier(MPI_COMM_WORLD);
+
+ if (ierror != 0)
+ bft_error(__FILE__, __LINE__, 0,
+ "Erreur dans MPI_Barrier lors de la finalisation du\n"
+ "communicateur global cote SYRTHES.");
+
+ ierror = MPI_Finalize();
+
+ if (ierror != 0)
+ bft_error(__FILE__, __LINE__, 0,
+ "Erreur lors de la finalisation du\n"
+ "communicateur global cote SYRTHES.");
+}
+
+/*----------------------------------------------------------------------------
+ * Force abort of MPI communication (for atexit)
+ *
+ * This function only forces finalization if an MPI coupling world is defined,
+ * so it should do nothing in case of a normal exit, in which the MPI coupling
+ * world info structure should have been destroyed through a regular call
+ * to syr_mpi_finalize.
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_exit_force(void)
+{
+ if (syr_glob_coupling_world != NULL)
+ MPI_Abort(MPI_COMM_WORLD, 1);
+}
+
+/*----------------------------------------------------------------------------
+ * Recover rank information on a given application number
+ *
+ * parameters:
+ * app_num <-- application number
+ * root_rank --> associated root rank
+ * n_ranks --> number of associated ranks
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_appinfo(int app_num,
+ int *root_rank,
+ int *n_ranks)
+{
+ int n_apps = 0;
+
+ *root_rank = -1;
+ *n_ranks = -1;
+
+ if (syr_glob_coupling_world != NULL) {
+
+ int i;
+
+ n_apps = fvm_coupling_mpi_world_n_apps(syr_glob_coupling_world);
+
+ for (i = 0; i < n_apps; i++) {
+
+ const fvm_coupling_mpi_world_info_t
+ ai = fvm_coupling_mpi_world_get_info(syr_glob_coupling_world, i);
+
+ if (ai.app_num == app_num) {
+
+ *root_rank = ai.root_rank;
+ *n_ranks = ai.n_ranks;
+
+ printf(" Couplage CFD:\n"
+ " Numero d'application MPI : %d\n"
+ " type d'application : \"%s\"\n"
+ " nom de l'instance : \"%s\"\n"
+ " rang racine MPI : %d\n"
+ " nombre de rangs MPI : %d\n\n",
+ ai.app_num, ai.app_type, ai.app_name,
+ ai.root_rank, ai.n_ranks);
+
+ break;
+ }
+ }
+ }
+
+ if (*root_rank < 0)
+ bft_error(__FILE__, __LINE__, 0,
+ "Application MPI numero %d non trouvee.", app_num);
+}
+
+#endif /* defined (HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Exit / Stop
+ *----------------------------------------------------------------------------*/
+
+void
+syr_exit(int status)
+{
+ if (status == EXIT_FAILURE) {
+
+ fprintf(stdout, "\n\n %s \n\n", "SYRTHES : erreur(s) rencontree(s).");
+
+#if defined(DEBUG) || !defined(NDEBUG)
+ assert(0);
+#endif
+
+#if defined(HAVE_MPI)
+ {
+ int mpi_flag;
+
+ MPI_Initialized(&mpi_flag);
+
+ if (mpi_flag != 0)
+ MPI_Abort(MPI_COMM_WORLD, status);
+ }
+#endif
+
+ }
+
+ exit(status);
+}
+
+/*----------------------------------------------------------------------------
+ * Print warning
+ *----------------------------------------------------------------------------*/
+
+void
+syr_warn(void)
+{
+ printf("\n"
+ "Attention (SYRTHES)\n"
+ "===================\n");
+ fflush(stdout);
+}
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
diff --git a/libsyrcs/syr_defs.h b/libsyrcs/syr_defs.h
new file mode 100644
index 0000000..ef03197
--- /dev/null
+++ b/libsyrcs/syr_defs.h
@@ -0,0 +1,183 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#ifndef _SYR_DEF_H_
+#define _SYR_DEF_H_
+
+/*============================================================================
+ * Definitions, Global variables, and basic functions
+ *
+ * Library: Code_Saturne Copyright EDF 2006-2008
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/* Enum for datatype description */
+
+typedef enum {
+ SYR_TYPE_char,
+ SYR_TYPE_int,
+ SYR_TYPE_float,
+ SYR_TYPE_double,
+ SYR_TYPE_void
+} syr_type_t;
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/* "Classical" macros */
+
+#define SYR_MIN(a,b) ((a) > (b) ? (b) : (a))
+#define SYR_MAX(a,b) ((a) < (b) ? (b) : (a))
+
+/* Copy of SYRTHES macros for C/Fortran interoperability */
+
+#if defined(__sgi) || defined(__uxpv__) || defined(__aix__) \
+ || defined(__linux__)
+
+#define name2(a,b) a##b
+#define proc(x,y) name2(x,_)
+#define proci(x) x
+
+#elif defined(sun) || defined(__alpha)
+
+#define name2(a,b) a/**/b
+#define proc(x,y) name2(x,_)
+#define proci(x) x
+
+#elif defined(CRAY)
+
+#define name2(a,b) a/**/b
+#define proc(x,y) y
+#define proci(x) x
+
+#else
+
+#define name2(a,b) a/**/b
+#define proc(x,y) x
+#define proci(x) name2(x,_)
+
+#endif
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+extern int syr_glob_base_rank; /* Parallel rank; -1 if serial */
+
+extern char syr_glob_build_date[]; /* Build date */
+
+/*============================================================================
+ * Function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Error initialization and handling
+ *----------------------------------------------------------------------------*/
+
+void
+syr_errhandler_initialize(void);
+
+/*----------------------------------------------------------------------------
+ * Initialize memory management
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mem_initialize(void);
+
+/*----------------------------------------------------------------------------
+ * Finalize memory management
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mem_finalize(void);
+
+#if defined (HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Initialize MPI communication
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_initialize(int *argc,
+ char **argv[]);
+
+/*----------------------------------------------------------------------------
+ * Finalize MPI communication
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_finalize(void);
+
+/*----------------------------------------------------------------------------
+ * Force abort of MPI communication (for atexit)
+ *
+ * This function only forces finalization if an MPI coupling world is defined,
+ * so it should do nothing in case of a normal exit, in which the MPI coupling
+ * world info structure should have been destroyed through a regular call
+ * to syr_mpi_finalize.
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_exit_force(void);
+
+/*----------------------------------------------------------------------------
+ * Recover rank information on a given application number
+ *
+ * parameters:
+ * app_num <-- application number
+ * root_rank --> associated root rank
+ * n_ranks --> number of associated ranks
+ *----------------------------------------------------------------------------*/
+
+void
+syr_mpi_appinfo(int app_num,
+ int *root_rank,
+ int *n_ranks);
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Exit / Stop
+ *----------------------------------------------------------------------------*/
+
+void
+syr_exit(int status);
+
+/*----------------------------------------------------------------------------
+ * Print warning
+ *----------------------------------------------------------------------------*/
+
+void
+syr_warn(void);
+
+/*----------------------------------------------------------------------------*/
+
+#endif /* _SYR_DEF_H_ */
diff --git a/patches/README b/patches/README
new file mode 100644
index 0000000..2eb4088
--- /dev/null
+++ b/patches/README
@@ -0,0 +1,7 @@
+Patches directory
+=================
+
+This directory contains files fixing potential problems that could arise
+in some particular situations. These patches have not been fully validated
+and therefore are NOT SUPPORTED.
+
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..b69b6a2
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,3 @@
+# Set of available languages.
+fr
+
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..fecf500
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,429 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper <drepper at gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.17
+GETTEXT_MACRO_VERSION = 0.17
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SHELL = /bin/sh
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: check-macro-version all- at USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+check-macro-version:
+ @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+ exit 1; \
+ }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
+ package_gnu='GNU '; \
+ else \
+ package_gnu=''; \
+ fi; \
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
+ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ *) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --package-name="$${package_gnu}@PACKAGE@" \
+ --package-version='@VERSION@' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ esac
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(srcdir)/$(DOMAIN).pot
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data- at USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ $(mkdir_p) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data- at USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ $(mkdir_p) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data- at USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && $(SHELL) ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..3236e07
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=ISO_8859-15
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = EDF S.A.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = saturne-support at edf.fr
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/Makevars.template b/po/Makevars.template
new file mode 100644
index 0000000..32692ab
--- /dev/null
+++ b/po/Makevars.template
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS =
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..1c5f6cc
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,70 @@
+src/apps/cs_solver.c
+src/base/cs_ale.c
+src/base/cs_ast_coupling.c
+src/base/cs_base.c
+src/base/cs_benchmark.c
+src/base/cs_blas.c
+src/base/cs_boundary_conditions.c
+src/base/cs_calcium.c
+src/base/cs_coupling.c
+src/base/cs_ext_neighborhood.c
+src/base/cs_gradient.c
+src/base/cs_grid.c
+src/base/cs_gui_boundary_conditions.c
+src/base/cs_gui.c
+src/base/cs_gui_matisse.c
+src/base/cs_gui_mobile_mesh.c
+src/base/cs_gui_particles.c
+src/base/cs_gui_radiative_transfer.c
+src/base/cs_gui_specific_physics.c
+src/base/cs_gui_util.c
+src/base/cs_halo.c
+src/base/cs_io.c
+src/base/cs_join.c
+src/base/cs_join_intersect.c
+src/base/cs_join_merge.c
+src/base/cs_join_mesh.c
+src/base/cs_join_post.c
+src/base/cs_join_set.c
+src/base/cs_join_split.c
+src/base/cs_join_update.c
+src/base/cs_join_util.c
+src/base/cs_matrix.c
+src/base/cs_mesh.c
+src/base/cs_mesh_coherency.c
+src/base/cs_mesh_connect.c
+src/base/cs_mesh_halo.c
+src/base/cs_mesh_quality.c
+src/base/cs_mesh_quantities.c
+src/base/cs_mesh_solcom.c
+src/base/cs_mesh_warping.c
+src/base/cs_multigrid.c
+src/base/cs_numbering.c
+src/base/cs_opts.c
+src/base/cs_parall.c
+src/base/cs_perio.c
+src/base/cs_post.c
+src/base/cs_preprocessor_data.c
+src/base/cs_proxy_comm.c
+src/base/cs_renumber.c
+src/base/cs_restart.c
+src/base/cs_sat_coupling.c
+src/base/cs_search.c
+src/base/cs_selector.c
+src/base/cs_sles.c
+src/base/cs_sort.c
+src/base/cs_syr3_comm.c
+src/base/cs_syr3_coupling.c
+src/base/cs_syr3_messages.c
+src/base/cs_syr4_coupling.c
+src/base/cs_syr_coupling.c
+src/base/cs_tpar1d.c
+src/base/cs_ventil.c
+src/base/tcpumx.c
+src/base/tremai.c
+src/ctwr/cs_ctwr_air_props.c
+src/ctwr/cs_ctwr.c
+src/ctwr/cs_ctwr_halo.c
+src/ctwr/cs_ctwr_mesh.c
+src/lagr/cs_lagr.c
+src/lagr/cs_lagr_perio.c
diff --git a/po/Rules-install b/po/Rules-install
new file mode 100644
index 0000000..a1312e6
--- /dev/null
+++ b/po/Rules-install
@@ -0,0 +1,3 @@
+# Create new empty target for documentation installation
+# This is a trick to fool the Makefile.in.in
+install-ps install-pdf install-html:
diff --git a/po/Rules-quot b/po/Rules-quot
new file mode 100644
index 0000000..9c2a995
--- /dev/null
+++ b/po/Rules-quot
@@ -0,0 +1,47 @@
+# Special Makefile rules for English message catalogs with quotation marks.
+
+DISTFILES.common.extra1 = quot.sed boldquot.sed en at quot.header en at boldquot.header insert-header.sin Rules-quot
+
+.SUFFIXES: .insert-header .po-update-en
+
+en at quot.po-create:
+ $(MAKE) en at quot.po-update
+en at boldquot.po-create:
+ $(MAKE) en at boldquot.po-update
+
+en at quot.po-update: en at quot.po-update-en
+en at boldquot.po-update: en at boldquot.po-update-en
+
+.insert-header.po-update-en:
+ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ ll=`echo $$lang | sed -e 's/@.*//'`; \
+ LC_ALL=C; export LC_ALL; \
+ cd $(srcdir); \
+ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "creation of $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+en at quot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en at quot.header/g' $(srcdir)/insert-header.sin > en at quot.insert-header
+
+en at boldquot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en at boldquot.header/g' $(srcdir)/insert-header.sin > en at boldquot.insert-header
+
+mostlyclean: mostlyclean-quot
+mostlyclean-quot:
+ rm -f *.insert-header
diff --git a/po/boldquot.sed b/po/boldquot.sed
new file mode 100644
index 0000000..4b937aa
--- /dev/null
+++ b/po/boldquot.sed
@@ -0,0 +1,10 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+s/“/“[1m/g
+s/”/[0m”/g
+s/‘/‘[1m/g
+s/’/[0m’/g
diff --git a/po/en at boldquot.header b/po/en at boldquot.header
new file mode 100644
index 0000000..fedb6a0
--- /dev/null
+++ b/po/en at boldquot.header
@@ -0,0 +1,25 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
diff --git a/po/en at quot.header b/po/en at quot.header
new file mode 100644
index 0000000..a9647fc
--- /dev/null
+++ b/po/en at quot.header
@@ -0,0 +1,22 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..2ced461
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,5097 @@
+# translation of fr.po to
+# French translations for ncs package.
+# Copyright (C) 2008 EDF S.A.
+# This file is distributed under the same license as the ncs package.
+#
+# Automatically generated, 2008.
+# Saturne <saturne-support at edf.fr>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: ncs 1.3\n"
+"Report-Msgid-Bugs-To: saturne-support at edf.fr\n"
+"POT-Creation-Date: 2009-07-22 19:03+0200\n"
+"PO-Revision-Date: 2009-03-25 16:40+0100\n"
+"Last-Translator: Code_Saturne <saturne-support at edf.fr>\n"
+"Language-Team: French <traduc at traduc.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: src/apps/cs_solver.c:295
+#, c-format
+msgid ""
+"\n"
+" Cutting warped faces (%.3g s)\n"
+msgstr ""
+"\n"
+" Découpage des faces gauches (%.3g s)\n"
+
+#: src/apps/cs_solver.c:301
+msgid ""
+"\n"
+" Renumbering mesh:\n"
+msgstr ""
+"\n"
+" Renumérotation du maillage:\n"
+
+#: src/apps/cs_solver.c:357
+msgid "Mesh"
+msgstr "Maillage"
+
+#: src/apps/cs_solver.c:371
+#, c-format
+msgid ""
+"\n"
+" Computing geometric quantities (%.3g s)\n"
+msgstr ""
+"\n"
+" Calcul des grandeurs géométriques (%.3g s)\n"
+
+#: src/apps/cs_solver.c:387
+msgid ""
+"\n"
+" Computing quality criteria\n"
+msgstr ""
+"\n"
+" Calcul des critères de qualité\n"
+
+#: src/apps/cs_solver.c:404
+#, c-format
+msgid ""
+"\n"
+" --- Main Fortran work arrays:\n"
+" LONGIA = %10d (Number of integers)\n"
+" LONGRA = %10d (Number of reals)\n"
+" (%d bytes/integer, %d bytes/real)\n"
+msgstr ""
+"\n"
+" --- Tableaux de travail Fortran principaux :\n"
+" LONGIA = %10d (Nombre d'entiers)\n"
+" LONGRA = %10d (Nombre de réels)\n"
+" (%d octets/entier, %d octets/réel)\n"
+
+#: src/apps/cs_solver.c:414
+#, c-format
+msgid ""
+"\n"
+" --- Developer Fortran work arrays:\n"
+" NIDEVE = %10d (Number of integer)\n"
+" NRDEVE = %10d (Number of reals)\n"
+msgstr ""
+"\n"
+" --- Tableaux de travail Fortran développeur :\n"
+" NIDEVE = %10d (Nombre d'entiers)\n"
+" NRDEVE = %10d (Nombre de réels)\n"
+
+#: src/apps/cs_solver.c:420
+#, c-format
+msgid ""
+"\n"
+" --- User Fortran work arrays:\n"
+" NITUSE = %10d (Number of integers)\n"
+" NRTUSE = %10d (Number of reals)\n"
+"\n"
+msgstr ""
+"\n"
+" --- Tableaux de travail Fortran utilisateur :\n"
+" NITUSE = %10d (Nombre d'entiers)\n"
+" NRTUSE = %10d (Nombre de réels)\n"
+"\n"
+
+#: src/apps/cs_solver.c:482
+msgid ""
+"\n"
+" Destroying structures and ending computation\n"
+msgstr ""
+"\n"
+" Destruction des structures et clôture du calcul\n"
+
+#: src/base/cs_base.c:239
+#, c-format
+msgid ""
+"Fatal error: bft_printf() called on a message of size %d\n"
+"whereas the print buffer is of size %d."
+msgstr ""
+"Erreur fatale: bft_printf() appellé sur message de taille %d\n"
+"alors que le tampon d'impression est de taille %d."
+
+#: src/base/cs_base.c:403
+#, c-format
+msgid ""
+"\n"
+"System error: %s\n"
+msgstr ""
+"\n"
+"Erreur système : %s\n"
+
+#: src/base/cs_base.c:405
+#, c-format
+msgid ""
+"\n"
+"%s:%d: Fatal error.\n"
+"\n"
+msgstr ""
+"\n"
+"%s:%d: Erreur fatale.\n"
+"\n"
+
+#: src/base/cs_base.c:425
+msgid ""
+"\n"
+"\n"
+"Memory allocation summary\n"
+"-------------------------\n"
+"\n"
+msgstr ""
+"\n"
+"\n"
+"Résumé de l'allocation mémoire\n"
+"------------------------------\n"
+"\n"
+
+#: src/base/cs_base.c:432
+#, c-format
+msgid "Theoretical current allocated memory: %lu kB\n"
+msgstr "Mémoire dynamique instrumentée théorique : %lu ko\n"
+
+#: src/base/cs_base.c:436
+#, c-format
+msgid "Theoretical maximum allocated memory: %lu kB\n"
+msgstr "Mémoire dynamique instrumentée théorique : %lu ko\n"
+
+#: src/base/cs_base.c:446
+#, c-format
+msgid "Maximum program memory measure: %lu kB\n"
+msgstr "Mémoire programme mesurée maximale: %lu ko\n"
+
+#: src/base/cs_base.c:454
+#, c-format
+msgid "Current program memory measure: %lu kB\n"
+msgstr "Mémoire programme mesurée courante: %lu ko\n"
+
+#: src/base/cs_base.c:516
+msgid ""
+"\n"
+"Call stack:\n"
+msgstr ""
+"\n"
+"Pile d'appels :\n"
+
+#: src/base/cs_base.c:544
+msgid ""
+"End of stack\n"
+"\n"
+msgstr ""
+"Fin de la pile\n"
+"\n"
+
+#: src/base/cs_base.c:562
+msgid ""
+"SIGHUP signal (hang-up) intercepted.\n"
+"--> computation interrupted.\n"
+msgstr ""
+"Signal SIGHUP (déconnexion) intercepté.\n"
+"--> calcul interrompu.\n"
+
+#: src/base/cs_base.c:568
+msgid ""
+"SIGINT signal (Control+C or equivalent) received.\n"
+"--> computation interrupted by user.\n"
+msgstr ""
+"Signal SIGINT (Control+C ou équivalent) reçu.\n"
+"--> calcul interrompu par l'utilisateur.\n"
+
+#: src/base/cs_base.c:573
+msgid ""
+"SIGTERM signal (termination) received.\n"
+"--> computation interrupted by environment.\n"
+msgstr ""
+"Signal SIGTERM (terminaison) reçu.\n"
+"--> calcul interrompu par l'environnement.\n"
+
+#: src/base/cs_base.c:578
+msgid "SIGFPE signal (floating point exception) intercepted!\n"
+msgstr "Signal SIGFPE (exception en virgule flottante) intercepté !\n"
+
+#: src/base/cs_base.c:583
+msgid "SIGSEGV signal (forbidden memory area access) intercepted!\n"
+msgstr "Signal SIGSEGV (accès à une zone mémoire interdite) intercepté !\n"
+
+#: src/base/cs_base.c:589
+msgid "SIGXCPU signal (CPU time limit reached) intercepted.\n"
+msgstr "Signal SIGXCPU (temps CPU limite atteint) intercepté.\n"
+
+#: src/base/cs_base.c:595
+#, c-format
+msgid "Signal %d intercepted!\n"
+msgstr "Signal %d intercepté !\n"
+
+#: src/base/cs_base.c:658
+#, c-format
+msgid ""
+"\n"
+"MPI error (communicator %s):\n"
+"%s\n"
+msgstr ""
+"\n"
+"Erreur MPI (communicateur %s):\n"
+"%s\n"
+
+#: src/base/cs_base.c:661
+#, c-format
+msgid ""
+"\n"
+"MPI error:\n"
+"%s\n"
+msgstr ""
+"\n"
+"Erreur MPI :\n"
+"%s\n"
+
+#: src/base/cs_base.c:863
+#, c-format
+msgid ""
+" Sub-routine calling IASIZE: %s\n"
+" Memory needed in IA (number of integers): %d\n"
+" available: %d\n"
+"\n"
+" ----> Define IASIZE to a value at least equal to %d integers)."
+msgstr ""
+" Sous-programme appelant IASIZE : %s\n"
+" Mémoire nécessaire dans IA (en nombre d'entiers) : %d\n"
+" disponible : %d\n"
+"\n"
+" ----> Définir IASIZE au moins égale à %d entiers)."
+
+#: src/base/cs_base.c:907
+#, c-format
+msgid ""
+" Sub-routine calling RASIZE: %s\n"
+" Memory needed in RA (number of reals): %d\n"
+" available: %d\n"
+"\n"
+" ----> Define RASIZE to a value at least equal to %d reals)."
+msgstr ""
+" Sous-programme appelant RASIZE : %s\n"
+" Mémoire nécessaire dans RA (en nombre de réels) : %d\n"
+" disponible : %d\n"
+"\n"
+" ----> Définir RASIZE au moins égale à %d réels)."
+
+#: src/base/cs_base.c:1193
+msgid "Total memory used: "
+msgstr "Consommation mémoire totale mesurée : "
+
+#: src/base/cs_base.c:1194
+msgid "Theoretical instrumented dynamic memory: "
+msgstr "Mémoire dynamique instrumentée théorique :"
+
+#: src/base/cs_base.c:1198
+msgid ""
+"\n"
+"Memory use summary:\n"
+"\n"
+msgstr ""
+"\n"
+"Bilan de l'occupation mémoire :\n"
+"\n"
+
+#: src/base/cs_base.c:1261
+#, c-format
+msgid " %s %12.3f %cb\n"
+msgstr " %s %12.3f %co\n"
+
+#: src/base/cs_base.c:1266
+#, c-format
+msgid " local minimum: %12.3f %cb (rank %d)\n"
+msgstr " minimum local : %12.3f %co (rang %d)\n"
+
+#: src/base/cs_base.c:1269
+#, c-format
+msgid " local maximum: %12.3f %cb (rank %d)\n"
+msgstr " maximum local : %12.3f %co (rang %d)\n"
+
+#: src/base/cs_base.c:1309
+#, c-format
+msgid ""
+"\n"
+" Fortran work arrays memory use:\n"
+" %-12lu integers needed (maximum reached in %s)\n"
+" %-12lu reals needed (maximum reached in %s)\n"
+"\n"
+" Local maximum work memory requested %12.3f %cb\n"
+" used %12.3f %cb\n"
+msgstr ""
+"\n"
+" Utilisation des tableaux de travail Fortran :\n"
+" %-12lu entiers nécessaires (maximum atteint dans %s)\n"
+" %-12lu réels nécessaires (maximum atteint dans %s)\n"
+"\n"
+" Mémoire de travail maximale locale demandée %12.3f %co\n"
+" utilisée %12.3f %co\n"
+
+#: src/base/cs_base.c:1346
+msgid ""
+"\n"
+"Calculation time summary:\n"
+msgstr ""
+"\n"
+"Bilan des temps de calcul :\n"
+
+#: src/base/cs_base.c:1360
+#, c-format
+msgid ""
+"\n"
+" User CPU time: %12.3f s\n"
+msgstr ""
+"\n"
+" Temps CPU utilisateur : %12.3f s\n"
+
+#: src/base/cs_base.c:1362
+#, c-format
+msgid " System CPU time: %12.3f s\n"
+msgstr " Temps CPU système : %12.3f s\n"
+
+#: src/base/cs_base.c:1367
+#, c-format
+msgid ""
+"\n"
+" CPU time: %12.3f s\n"
+msgstr ""
+"\n"
+" Temps CPU : %12.3f s\n"
+
+#: src/base/cs_base.c:1376
+#, c-format
+msgid " Total CPU time: %12.3f s\n"
+msgstr " Temps CPU cumulé : %12.3f s\n"
+
+#: src/base/cs_base.c:1387
+#, c-format
+msgid ""
+"\n"
+" Elapsed time: %12.3f s\n"
+msgstr ""
+"\n"
+" Temps écoulé : %12.3f s\n"
+
+#: src/base/cs_base.c:1390
+#, c-format
+msgid " CPU / elapsed time %12.3f\n"
+msgstr " Temps CPU / écoulé %12.3f\n"
+
+#: src/base/cs_base.c:1482
+msgid "Local case configuration:\n"
+msgstr "Configuration locale du cas :\n"
+
+#: src/base/cs_base.c:1484
+msgid "Date: "
+msgstr "Date : "
+
+#: src/base/cs_base.c:1492
+msgid "System: "
+msgstr "Système : "
+
+#: src/base/cs_base.c:1494
+msgid "Machine: "
+msgstr "Machine : "
+
+#: src/base/cs_base.c:1498
+msgid "Processor: "
+msgstr "Processeur : "
+
+#: src/base/cs_base.c:1501
+msgid "Memory: "
+msgstr "Mémoire : "
+
+#: src/base/cs_base.c:1504
+msgid "User: "
+msgstr "Utilisateur : "
+
+#: src/base/cs_base.c:1508
+msgid "Directory: "
+msgstr "Répertoire : "
+
+#: src/base/cs_base.c:1511
+msgid "MPI ranks: "
+msgstr "Rangs MPI : "
+
+#: src/base/cs_base.c:1514
+msgid "OpenMP threads: "
+msgstr "Threads OpenMP: "
+
+#: src/base/cs_base.c:1546
+#, c-format
+msgid ""
+"\n"
+"\n"
+"Code_Saturne: %s:%d: Warning\n"
+msgstr ""
+"\n"
+"\n"
+"Code_Saturne : %s:%d : Avertissement\n"
+
+#: src/base/cs_benchmark.c:164
+#, c-format
+msgid ""
+" Wall clock : %12.5e\n"
+" CPU : %12.5e\n"
+msgstr ""
+" Temps écoulé: %12.5e\n"
+" CPU: %12.5e\n"
+
+#: src/base/cs_benchmark.c:193
+#, c-format
+msgid ""
+" Min Max Total\n"
+" Wall clock : %12.5e %12.5e\n"
+" CPU : %12.5e %12.5e %12.5e\n"
+msgstr ""
+" Min Max Total\n"
+" Écoulé : %12.5e %12.5e\n"
+" CPU : %12.5e %12.5e %12.5e\n"
+
+#: src/base/cs_benchmark.c:221
+#, c-format
+msgid ""
+" N ops : %12ld\n"
+" Wall clock : %12.5e\n"
+" CPU : %12.5e\n"
+" GFLOPS : %12.5e\n"
+msgstr ""
+" N ops : %12ld\n"
+" Wall clock : %12.5e\n"
+" CPU : %12.5e\n"
+" GFLOPS : %12.5e\n"
+
+#: src/base/cs_benchmark.c:268
+#, c-format
+msgid ""
+" Min Max Total\n"
+" N ops : %12ld %12ld %12ld\n"
+" Wall clock : %12.5e %12.5e\n"
+" CPU : %12.5e %12.5e %12.5e\n"
+" GFLOPS : %12.5e %12.5e %12.5e\n"
+msgstr ""
+" Min Max Total\n"
+" N ops : %12ld %12ld %12ld\n"
+" Wall clock : %12.5e %12.5e\n"
+" CPU : %12.5e %12.5e %12.5e\n"
+" GFLOPS : %12.5e %12.5e %12.5e\n"
+
+#: src/base/cs_benchmark.c:280
+#, c-format
+msgid ""
+" Min Max Total Single\n"
+" N ops : %12ld %12ld %12ld %12ld\n"
+" Wall clock : %12.5e %12.5e\n"
+" CPU : %12.5e %12.5e %12.5e\n"
+" GFLOPS : %12.5e %12.5e %12.5e %12.5e\n"
+msgstr ""
+" Min Max Total Single\n"
+" N ops : %12ld %12ld %12ld %12ld\n"
+" Wall clock : %12.5e %12.5e\n"
+" CPU : %12.5e %12.5e %12.5e\n"
+" GFLOPS : %12.5e %12.5e %12.5e %12.5e\n"
+
+#: src/base/cs_benchmark.c:356
+#, c-format
+msgid ""
+"\n"
+"Simple local dot product %s with BLAS\n"
+"-------------------------------------\n"
+msgstr ""
+"\n"
+"Produit scalaire local simple %s avec BLAS\n"
+"------------------------------------------\n"
+
+#: src/base/cs_benchmark.c:361
+#, c-format
+msgid ""
+"\n"
+"Simple global dot product %s with BLAS\n"
+"---------------------------------------\n"
+msgstr ""
+"\n"
+"Produit scalaire global simple %s avec BLAS\n"
+"--------------------------------------------\n"
+
+#: src/base/cs_benchmark.c:366 src/base/cs_benchmark.c:403
+#: src/base/cs_benchmark.c:458 src/base/cs_benchmark.c:483
+#: src/base/cs_benchmark.c:544 src/base/cs_benchmark.c:568
+#: src/base/cs_benchmark.c:998 src/base/cs_benchmark.c:1024
+#: src/base/cs_benchmark.c:1054 src/base/cs_benchmark.c:1084
+#: src/base/cs_benchmark.c:1136 src/base/cs_benchmark.c:1349
+#: src/base/cs_benchmark.c:1374 src/base/cs_benchmark.c:1402
+#, c-format
+msgid " (calls: %d; test sum: %12.5f)\n"
+msgstr " (appels : %d; somme test : %12.5f)\n"
+
+#: src/base/cs_benchmark.c:393
+#, c-format
+msgid ""
+"\n"
+"Simple local dot product %s\n"
+"---------------------------\n"
+msgstr ""
+"\n"
+"Produit scalaire local simple %s\n"
+"--------------------------------\n"
+
+#: src/base/cs_benchmark.c:398
+#, c-format
+msgid ""
+"\n"
+"Simple global dot product %s\n"
+"----------------------------\n"
+msgstr ""
+"\n"
+"Produit scalaire global simple %s\n"
+"---------------------------------\n"
+
+#: src/base/cs_benchmark.c:455
+msgid ""
+"\n"
+"Double local dot product X.X, Y.Y with BLAS\n"
+"-------------------------------------------\n"
+msgstr ""
+"\n"
+"Produit scalaire local double X.X, X.Y avec BLAS\n"
+"------------------------------------------------\n"
+
+#: src/base/cs_benchmark.c:479
+msgid ""
+"\n"
+"Double local dot product X.X, Y.Y\n"
+"---------------------------------\n"
+msgstr ""
+"\n"
+"Produit scalaire local double X.X, X.Y\n"
+"--------------------------------------\n"
+
+#: src/base/cs_benchmark.c:540
+msgid ""
+"\n"
+"Y <- aX + Y with BLAS\n"
+"---------------------\n"
+msgstr ""
+"\n"
+"Y <- aX + Y avec BLAS\n"
+"---------------------\n"
+
+#: src/base/cs_benchmark.c:564
+msgid ""
+"\n"
+"Y <- aX + Y\n"
+"-----------\n"
+msgstr ""
+"\n"
+"Y <- aX + Y\n"
+"-----------\n"
+
+#: src/base/cs_benchmark.c:624
+msgid ""
+"\n"
+"Division z = x/y\n"
+"----------------\n"
+msgstr ""
+"\n"
+"Division z = x/y\n"
+"----------------\n"
+
+#: src/base/cs_benchmark.c:645
+msgid ""
+"\n"
+"Division y = 1/x\n"
+"----------------\n"
+msgstr ""
+"\n"
+"Division y = 1/x\n"
+"----------------\n"
+
+#: src/base/cs_benchmark.c:666
+msgid ""
+"\n"
+"Division x <- 1/x\n"
+"-----------------\n"
+msgstr ""
+"\n"
+"Division x <- 1/x\n"
+"-----------------\n"
+
+#: src/base/cs_benchmark.c:719
+msgid ""
+"\n"
+"y = sqrt(x)\n"
+"-----------\n"
+msgstr ""
+"\n"
+"y = sqrt(x)\n"
+"-----------\n"
+
+#: src/base/cs_benchmark.c:740
+msgid ""
+"\n"
+"x = sqrt(x)\n"
+"-----------\n"
+msgstr ""
+"\n"
+"x = sqrt(x)\n"
+"-----------\n"
+
+#: src/base/cs_benchmark.c:809
+#, c-format
+msgid ""
+"\n"
+"Matrix construction / destruction (%s)\n"
+"---------------------------------\n"
+msgstr ""
+"\n"
+"Construction / Destruction d'une matrice (%s)\n"
+"----------------------------------------\n"
+
+#: src/base/cs_benchmark.c:813 src/base/cs_benchmark.c:894
+#, c-format
+msgid " (calls: %d)\n"
+msgstr " (appels : %d)\n"
+
+#: src/base/cs_benchmark.c:890
+#, c-format
+msgid ""
+"\n"
+"Matrix value assignment (%s)\n"
+"-----------------------\n"
+msgstr ""
+"\n"
+"Affectation de valeurs à une matrice (%s)\n"
+"------------------------------------\n"
+
+#: src/base/cs_benchmark.c:994
+#, c-format
+msgid ""
+"\n"
+"Matrix.vector product (%s)\n"
+"---------------------\n"
+msgstr ""
+"\n"
+"Produit matrice.vecteur (%s)\n"
+"-----------------------\n"
+
+#: src/base/cs_benchmark.c:1020
+#, c-format
+msgid ""
+"\n"
+"Local matrix.vector product (%s)\n"
+"---------------------------\n"
+msgstr ""
+"\n"
+"Produit matrice.vecteur local (%s)\n"
+"-----------------------------\n"
+
+#: src/base/cs_benchmark.c:1050
+#, c-format
+msgid ""
+"\n"
+"Matrix.vector product alpha.A.x + beta.y (%s)\n"
+"----------------------------------------\n"
+msgstr ""
+"\n"
+"Produit matrice.vecteur alpha.A.x + beta.y (%s)\n"
+"------------------------------------------\n"
+
+#: src/base/cs_benchmark.c:1080
+#, c-format
+msgid ""
+"\n"
+"(Matrix-diagonal).vector product (%s)\n"
+"--------------------------------\n"
+msgstr ""
+"\n"
+"Produit (matrice-diagonale).vecteur (%s)\n"
+"-----------------------------------\n"
+
+#: src/base/cs_benchmark.c:1132
+#, c-format
+msgid ""
+"\n"
+"(Matrix without diagonal).vector product (%s)\n"
+"----------------------------------------\n"
+msgstr ""
+"\n"
+"Produit (matrice sans diagonale).vecteur (%s)\n"
+"----------------------------------------\n"
+
+#: src/base/cs_benchmark.c:1345
+msgid ""
+"\n"
+"Matrix.vector product, extradiagonal part, variant 0\n"
+"---------------------\n"
+msgstr ""
+"\n"
+"Produit matrice.vecteur, partie extradiagonale, variante 0\n"
+"-----------------------\n"
+
+#: src/base/cs_benchmark.c:1370
+msgid ""
+"\n"
+"Matrix.vector product, extradiagonal part, variant 1\n"
+"---------------------\n"
+msgstr ""
+"\n"
+"Produit matrice.vecteur, partie extradiagonale, variante 1\n"
+"-----------------------\n"
+
+#: src/base/cs_benchmark.c:1398
+msgid ""
+"\n"
+"Matrix.vector product, face values only\n"
+"---------------------\n"
+msgstr ""
+"\n"
+"Produit matrice.vecteur, valeurs aux faces uniquement\n"
+"-----------------------\n"
+
+#: src/base/cs_benchmark.c:1481
+msgid ""
+"\n"
+"Benchmark mode activated\n"
+"========================\n"
+msgstr ""
+"\n"
+"Activation du mode Benchmark\n"
+"============================\n"
+
+#: src/base/cs_benchmark.c:1523 src/base/cs_benchmark.c:1553
+#: src/base/cs_benchmark.c:1596 src/base/cs_matrix.c:312
+msgid "native"
+msgstr "native"
+
+#: src/base/cs_benchmark.c:1533 src/base/cs_benchmark.c:1569
+#: src/base/cs_benchmark.c:1610 src/base/cs_matrix.c:313
+msgid "CSR"
+msgstr "CSR"
+
+#: src/base/cs_benchmark.c:1541
+msgid "CSR sym"
+msgstr "CSR sym"
+
+#: src/base/cs_benchmark.c:1560 src/base/cs_benchmark.c:1603
+msgid "native, sym coeffs"
+msgstr "native, sym coeffs"
+
+#: src/base/cs_benchmark.c:1576
+msgid "CSR, sym coeffs"
+msgstr "CSR, sym coeffs"
+
+#: src/base/cs_benchmark.c:1583 src/base/cs_benchmark.c:1617
+msgid "CSR_sym"
+msgstr "CSR_sym"
+
+#: src/base/cs_boundary_conditions.c:307
+#, c-format
+msgid ""
+"\n"
+"Phase %d:\n"
+" "
+msgstr ""
+"\n"
+"Phase %d :\n"
+" "
+
+#: src/base/cs_boundary_conditions.c:309
+#, c-format
+msgid ""
+"\n"
+"First face with boundary condition definition error\n"
+" (out of %lu)\n"
+" has boundary condition type %d, center (%g, %g, %g)\n"
+"\n"
+msgstr ""
+"\n"
+"Première face avec une mauvaise définition de conditions aux limites\n"
+" (sur %lu)\n"
+" a une condition aux limites de type %d, un centre (%g, %g, %g)\n"
+"\n"
+
+#: src/base/cs_boundary_conditions.c:350
+msgid "Faces with B.C. error"
+msgstr "Faces avec erreur de C.L."
+
+#: src/base/cs_boundary_conditions.c:376
+msgid "Faces with valid B.C.'s"
+msgstr "Faces avec C.L. valides"
+
+#: src/base/cs_boundary_conditions.c:401
+#, c-format
+msgid "Phase %d, "
+msgstr "Phase %d,"
+
+#: src/base/cs_boundary_conditions.c:407
+msgid "BC type"
+msgstr "Type de CL"
+
+#: src/base/cs_boundary_conditions.c:430
+msgid ""
+"\n"
+"Some boundary condition definitions are incomplete or incorrect.\n"
+"\n"
+" For details, read the end of the calculation log,\n"
+" or visualize the error postprocessing output."
+msgstr ""
+"\n"
+"Certaines définitions de conditions aux limites sont incomplètes\n"
+"ou incorrectes :\n"
+"\n"
+" Pour plus de détails, vérifiez la fin du \"listing\" de calcul,\n"
+" ou visualisez le post traitement dédié aux erreurs."
+
+#: src/base/cs_calcium.c:262 src/base/cs_syr3_comm.c:877
+#, c-format
+msgid " %d first and last elements:\n"
+msgstr " %d premiers et derniers éléments :\n"
+
+#: src/base/cs_calcium.c:268 src/base/cs_syr3_comm.c:881
+msgid " elements:\n"
+msgstr " éléments :\n"
+
+#: src/base/cs_calcium.c:327
+msgid " .......... ............\n"
+msgstr " .......... ............\n"
+
+#: src/base/cs_calcium.c:375 src/base/cs_calcium.c:445
+#, c-format
+msgid ""
+"\n"
+"Component %d [%p]:\n"
+msgstr ""
+"\n"
+"Composant %d [%p]:\n"
+
+#: src/base/cs_calcium.c:378 src/base/cs_calcium.c:448
+#, c-format
+msgid ""
+"\n"
+"Component %d:\n"
+msgstr ""
+"\n"
+"Composant %d:\n"
+
+#: src/base/cs_calcium.c:380
+#, c-format
+msgid ""
+"Reading up to %d values of type %s, time_dependency %s\n"
+" (min/max time %f/%f, iteration %d) ..."
+msgstr ""
+"Lecture d'au plus %d valeurs de type %s, dep_temps %s\n"
+" (temps min/max %f/%f, itération %d) ..."
+
+#: src/base/cs_calcium.c:410
+#, c-format
+msgid ""
+"[ok]\n"
+"Read %d values (min time %f, iteration %d).\n"
+msgstr ""
+"[ok]\n"
+"Lu %d valeurs (temps min %f, itération %d).\n"
+
+#: src/base/cs_calcium.c:450
+#, c-format
+msgid ""
+"Writing %d values of type %s, time_dependency %s\n"
+" (time %f, iteration %d) ..."
+msgstr ""
+"Écriture de %d valeurs de type %s, dep_temps %s\n"
+" (temps %f, itération %d) ..."
+
+#: src/base/cs_calcium.c:475 src/base/cs_syr4_coupling.c:210
+msgid "[ok]\n"
+msgstr "[ok]\n"
+
+#: src/base/cs_calcium.c:678
+#, c-format
+msgid "Error calling dlsym: %s\n"
+msgstr "Erreur à l'appel de dlsym : %s\n"
+
+#: src/base/cs_calcium.c:1184
+#, c-format
+msgid "Error loading %s: %s."
+msgstr "Erreur au chargement de %s : %s."
+
+#: src/base/cs_calcium.c:1221
+#, c-format
+msgid ""
+"Shared library support not available.\n"
+"Unable to load: %s\n"
+msgstr ""
+"Support de librairies partagées non disponible.\n"
+"Impossible de charger : %s\n"
+
+#: src/base/cs_coupling.c:123
+msgid ""
+"\n"
+"Applications accessible through MPI:\n"
+"------------------------------------\n"
+"\n"
+msgstr ""
+"\n"
+"Applications accessibles grâce à MPI :\n"
+"--------------------------------------\n"
+
+#: src/base/cs_coupling.c:150
+#, c-format
+msgid ""
+" %d; type: \"%s\"%s\n"
+" case name: \"%s\"\n"
+" lead rank: %d; n_ranks: %d\n"
+"\n"
+msgstr ""
+" %d; type : \"%s\"%s\n"
+" nom de cas : \"%s\"\n"
+" rang racine : %d ; nb_rangs : %d\n"
+"\n"
+
+#: src/base/cs_ext_neighborhood.c:977
+msgid ""
+"\n"
+"WARNING\n"
+"The extended neighborhood is empty whereas the least-squares\n"
+"method on extended neighborhood for gradient computation\n"
+"is activated. This situation can arise in some particular\n"
+"cases (1D mesh). Verify that it is your case, otherwise\n"
+"contact support.\n"
+msgstr ""
+"\n"
+"ATTENTION\n"
+"Le voisinage étendu est nul alors que la méthode de calcul\n"
+"des gradients par moindres carrés sur support étendu est\n"
+"activée. Ceci peut arriver dans certains cas spécifiques\n"
+"(maillage 1D). Vérifiez que c'est bien votre cas, sinon\n"
+"contactez le support.\n"
+
+#: src/base/cs_ext_neighborhood.c:1116
+#, c-format
+msgid ""
+"\n"
+" Extended neighborhood reduced by non-orthogonality\n"
+" --------------------------------------------------\n"
+"\n"
+" Size of complete cell-cell connectivity: %12lu\n"
+" Size of filtered cell-cell conectivity: %12lu\n"
+" %lu connections removed, for a ratio of %4.2g %% used\n"
+msgstr ""
+"\n"
+" Limitation du voisinage étendu par non-orthogonalité\n"
+" ----------------------------------------------------\n"
+"\n"
+" Taille de la connectivité cellules-cellules complète : %12lu\n"
+" Taille de la connectivité cellules-cellules filtrée : %12lu\n"
+" %lu connexions supprimées, soit un ratio de %4.2g %% utilisées\n"
+
+#: src/base/cs_gradient.c:598
+#, c-format
+msgid ""
+" GRADIENT LIMITATION in %10d cells\n"
+" MINIMUM FACTOR = %14.5e; MAXIMUM FACTOR = %14.5e\n"
+msgstr ""
+" LIMITATION DE GRADIENT en %10d CELLULES\n"
+" FACTEUR MINIMUM = %14.5e ; FACTEUR MAXIMUM = %14.5e\n"
+
+#: src/base/cs_grid.c:876
+#, c-format
+msgid ""
+"Connectivity error:\n"
+"Face %d has same cell %d on both sides."
+msgstr ""
+"Erreur de connectivité :\n"
+"La face %d voit la cellule %d des deux cotés."
+
+#: src/base/cs_gui_boundary_conditions.c:467
+#, c-format
+msgid "Invalid number of coal-> dp_FCP: %i xml: %i\n"
+msgstr ""
+
+#: src/base/cs_gui_boundary_conditions.c:568 src/base/cs_gui.c:4488
+#: src/base/cs_gui.c:4536 src/base/cs_gui.c:4584 src/base/cs_gui.c:4632
+#: src/base/cs_gui.c:4706 src/base/cs_gui_mobile_mesh.c:281
+#, c-format
+msgid "Error: can not interprete expression: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_boundary_conditions.c:574 src/base/cs_gui.c:4492
+#: src/base/cs_gui.c:4540 src/base/cs_gui.c:4588 src/base/cs_gui.c:4636
+#: src/base/cs_gui.c:4710 src/base/cs_gui_mobile_mesh.c:291
+#, c-format
+msgid "Error: can not find the required symbol: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_boundary_conditions.c:892
+#, c-format
+msgid ""
+"@ \n"
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+"@ \n"
+"@ @@ WARNING: BOUNDARY CONDITIONS ERROR \n"
+"@ ******* \n"
+"@ \n"
+"@ In the zone %s has a face already marked \n"
+"@ with a zone number. \n"
+"@ \n"
+"@ new zone number: %i \n"
+"@ previous zone number: %i \n"
+"@ \n"
+"@ It seems that zones definitions are overlapping. \n"
+"@ \n"
+"@ The calculation will stop. \n"
+"@ \n"
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+"@ \n"
+msgstr ""
+
+#: src/base/cs_gui_boundary_conditions.c:1063
+#, c-format
+msgid "zone's label number %i is greater than %i, the maximum allowed \n"
+msgstr ""
+
+#: src/base/cs_gui_boundary_conditions.c:1081 src/base/cs_selector.c:243
+#, c-format
+msgid ""
+"The group or attribute \"%s\" in the selection\n"
+"criteria:\n"
+"\"%s\"\n"
+" does not correspond to any boundary face.\n"
+msgstr ""
+"Le groupe ou attribut \"%s\" figurant dans le\n"
+"critère de sélection:\n"
+"\"%s\"\n"
+" ne correspond à aucune face de bord.\n"
+
+#: src/base/cs_gui_boundary_conditions.c:1649
+#: src/base/cs_gui_boundary_conditions.c:1812
+#, c-format
+msgid "boundary nature %s is unknown \n"
+msgstr ""
+
+#: src/base/cs_gui_boundary_conditions.c:1825
+#, c-format
+msgid ""
+"@ \n"
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+"@ \n"
+"@ @@ WARNING: BOUNDARY CONDITIONS ERROR \n"
+"@ ******* \n"
+"@ \n"
+"@ The zone %s does not have the same id number \n"
+"@ in the GUI and in the user subroutine. \n"
+"@ \n"
+"@ GUI zone number: %i \n"
+"@ USER SUBROUTINE zone number: %i \n"
+"@ \n"
+"@ The id number given in the GUI cannot be modified \n"
+"@ in the user subroutine (fortran array IZFPPP). \n"
+"@ \n"
+"@ The calculation will stop. \n"
+"@ \n"
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+"@ \n"
+msgstr ""
+
+#: src/base/cs_gui_boundary_conditions.c:1864
+#, c-format
+msgid ""
+"@ \n"
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+"@ \n"
+"@ @@ WARNING: BOUNDARY CONDITIONS ERROR \n"
+"@ ******* \n"
+"@ \n"
+"@ The zone %s does not have the same nature \n"
+"@ in the GUI and in the user subroutine. \n"
+"@ \n"
+"@ GUI zone nature: %s \n"
+"@ USER SUBROUTINE ITYPFB: %i \n"
+"@ \n"
+"@ The nature given in the GUI cannot be modified \n"
+"@ in the user subroutine (fortran array ITYPFB). \n"
+"@ \n"
+"@ The calculation will stop. \n"
+"@ \n"
+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+"@ \n"
+msgstr ""
+
+#: src/base/cs_gui.c:164 src/base/cs_gui_radiative_transfer.c:447
+#, c-format
+msgid "Variable index %d out of bounds (1 to %d)"
+msgstr ""
+
+#: src/base/cs_gui.c:207 src/base/cs_gui.c:366 src/base/cs_gui.c:1379
+#: src/base/cs_gui.c:1514 src/base/cs_gui.c:1640 src/base/cs_gui.c:1770
+#: src/base/cs_gui.c:1963 src/base/cs_gui.c:2137 src/base/cs_gui.c:2538
+#: src/base/cs_gui_matisse.c:116 src/base/cs_gui_matisse.c:139
+#: src/base/cs_gui_matisse.c:159 src/base/cs_gui_matisse.c:189
+#: src/base/cs_gui_mobile_mesh.c:158 src/base/cs_gui_mobile_mesh.c:220
+#: src/base/cs_gui_util.c:537 src/base/cs_gui_util.c:637
+#: src/base/cs_gui_util.c:734 src/base/cs_gui_util.c:884
+#: src/base/cs_gui_util.c:927
+#, c-format
+msgid "Invalid xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui.c:261
+#, c-format
+msgid "Invalid thermal model: %s\n"
+msgstr ""
+
+#: src/base/cs_gui.c:1316
+#, c-format
+msgid ""
+"Coordinate %s of the monitoring probe number %i not found.\n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui.c:2459
+#, c-format
+msgid ""
+"Invalid xpath: %s\n"
+" name not found"
+msgstr ""
+
+#: src/base/cs_gui.c:2509
+#, c-format
+msgid ""
+"Invalid markup name: %s\n"
+" label not found"
+msgstr ""
+
+#: src/base/cs_gui.c:2660
+#, c-format
+msgid "Invalid turbulence model: %s.\n"
+msgstr ""
+
+#: src/base/cs_gui.c:2770
+#, c-format
+msgid "Scalar: %i and its variance: %i are the same.\n"
+msgstr ""
+
+#: src/base/cs_gui.c:3130
+#, c-format
+msgid ""
+"The kernel variables number %i and the calculated one by the GUI %i are not "
+"the same.\n"
+msgstr ""
+
+#: src/base/cs_gui.c:3561
+msgid "Specific heat value is zero or not found in the xml file.\n"
+msgstr ""
+
+#: src/base/cs_gui.c:3582
+msgid "mass molar value is zero or not found in the xml file.\n"
+msgstr ""
+
+#: src/base/cs_gui.c:3590
+msgid "Density value is zero or not found in the xml file.\n"
+msgstr ""
+
+#: src/base/cs_gui.c:3835 src/base/cs_gui_radiative_transfer.c:744
+#: src/base/cs_gui_specific_physics.c:532
+#, c-format
+msgid "number of properties is not correct: %i instead of: %i\n"
+msgstr ""
+
+#: src/base/cs_gui.c:4215 src/base/cs_gui_particles.c:778
+#: src/base/cs_gui_particles.c:784 src/base/cs_gui_particles.c:790
+#: src/base/cs_gui_radiative_transfer.c:845
+#, c-format
+msgid "Name of variable %i was never set.\n"
+msgstr ""
+
+#: src/base/cs_gui.c:4321 src/base/cs_selector.c:315
+#, c-format
+msgid ""
+"The group or attribute \"%s\" in the selection\n"
+"criteria:\n"
+"\"%s\"\n"
+" does not correspond to any cell.\n"
+msgstr ""
+"Le groupe ou attribut \"%s\" figurant dans le\n"
+"critère de sélection:\n"
+"\"%s\"\n"
+" ne correspond à aucune cellule.\n"
+
+#: src/base/cs_gui.c:4898 src/base/cs_gui_util.c:159
+#, c-format
+msgid "Unable to open the file: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_matisse.c:527
+#, c-format
+msgid "Missing 'min' markup for xpath : %s\n"
+msgstr ""
+
+#: src/base/cs_gui_matisse.c:537
+#, c-format
+msgid "Missing 'max' markup for xpath : %s\n"
+msgstr ""
+
+#: src/base/cs_gui_matisse.c:547
+#, c-format
+msgid "Missing 'value' markup for xpath : %s\n"
+msgstr ""
+
+#: src/base/cs_gui_mobile_mesh.c:321
+#, c-format
+msgid "Unknow ale property choice %s.\n"
+msgstr ""
+
+#: src/base/cs_gui_mobile_mesh.c:424 src/base/cs_gui_mobile_mesh.c:494
+#, c-format
+msgid "Boundary nature formula is null for %s.\n"
+msgstr ""
+
+#: src/base/cs_gui_mobile_mesh.c:628
+#, c-format
+msgid "cannot get value for %s %s %s"
+msgstr ""
+
+#: src/base/cs_gui_mobile_mesh.c:760
+#, c-format
+msgid "Formula is null for %s %s"
+msgstr ""
+
+#: src/base/cs_gui_mobile_mesh.c:949
+msgid "Formula is null for ale.\n"
+msgstr ""
+
+#: src/base/cs_gui_particles.c:478 src/base/cs_gui_particles.c:508
+#: src/base/cs_gui_particles.c:538
+#, c-format
+msgid "Variable index %i out of bounds (1 to %i)"
+msgstr ""
+
+#: src/base/cs_gui_radiative_transfer.c:306
+#, c-format
+msgid "unknow type %s\n"
+msgstr "type inconnu %s \n"
+
+#: src/base/cs_gui_radiative_transfer.c:395
+#, c-format
+msgid "Xpath request failed %s \n"
+msgstr ""
+
+#: src/base/cs_gui_radiative_transfer.c:560
+#, c-format
+msgid "--output boundary faces: %s value %i \n"
+msgstr ""
+
+#: src/base/cs_gui_radiative_transfer.c:1009
+msgid ""
+"One tries to define radiative boundary conditions on boundary which is not a "
+"wall.\n"
+"The definition of the boundaries natures given in GUI (wall, inlet, "
+"outlet,...) \n"
+"is modified in a users subroutine (like USCLIM, USCPCL,...). \n"
+"The radiative boundary conditions given in GUI must be coherent \n"
+"with these new natures.\n"
+msgstr ""
+
+#: src/base/cs_gui_specific_physics.c:211
+#, c-format
+msgid "Invalid coal model: %s.\n"
+msgstr ""
+
+#: src/base/cs_gui_specific_physics.c:223
+#, c-format
+msgid "Invalid atmospheric flow model: %s.\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:182
+#, c-format
+msgid "Unable to parse the file: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:206 src/base/cs_gui_util.c:286
+#: src/base/cs_gui_util.c:569 src/base/cs_gui_util.c:666
+#: src/base/cs_gui_util.c:765 src/base/cs_gui_util.c:895
+#: src/base/cs_gui_util.c:956
+msgid "Code_Saturne has been compiled without Xml support."
+msgstr ""
+
+#: src/base/cs_gui_util.c:238
+#, c-format
+msgid ""
+"========================================================\n"
+" ** INVALID VERSION OF THE XML FILE\n"
+" -------------------------------------- \n"
+" XML FILE VERSION: %.1f \n"
+" XML READER VERSION: %.1f \n"
+"========================================================\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:249
+#, c-format
+msgid ""
+"========================================================\n"
+" ** INCOMPATIBLE VERSION OF THE XML FILE\n"
+" -------------------------------------- \n"
+" XML FILE VERSION: %.1f \n"
+" XML READER VERSION: %.1f \n"
+"\n"
+" YOU SHOULD RESTART YOUR CALCUL WITH A NEW XML FILE\n"
+"========================================================\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:558
+#, c-format
+msgid ""
+"The node type is not XML_ATTRIBUTE_NODE.\n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:598
+#, c-format
+msgid ""
+"Several attributes found: %i \n"
+"The first one is %s \n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:655
+#, c-format
+msgid ""
+"The node type is not XML_ELEMENT_NODE.\n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:695
+#, c-format
+msgid ""
+"Several nodes name found: %i \n"
+"The first one is %s \n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:754 src/base/cs_gui_util.c:944
+#, c-format
+msgid ""
+"The node type is not XML_TEXT_NODE.\n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:793
+#, c-format
+msgid ""
+"Several text node found: %i \n"
+"The first one is %s \n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:933
+#, c-format
+msgid "No markup found: %s \n"
+msgstr ""
+
+#: src/base/cs_gui_util.c:992
+#, c-format
+msgid ""
+"Invalid attribute value: %s \n"
+"Xpath: %s\n"
+msgstr ""
+
+#: src/base/cs_io.c:283 src/base/cs_io.c:324
+#, c-format
+msgid ""
+"Compilation configuration / porting error:\n"
+"Unable to determine a 64-bit unsigned int type.\n"
+"size_t is %d bits, unsigned long long %d bits"
+msgstr ""
+
+#: src/base/cs_io.c:629
+#, c-format
+msgid ""
+"Error reading file: \"%s\".\n"
+"File format is not the correct version.\n"
+"The first 64 bytes expected contain:\n"
+"\"%s\"\n"
+"The first 64 bytes read contain:\n"
+"\"%s\"\n"
+msgstr ""
+"Erreur à la lecture du fichier : \"%s\".\n"
+"Le format du fichier n'est pas à la bonne version.\n"
+"Les 64 premiers octets attendus contiennent :\n"
+"\"%s\"\n"
+"Les 64 premiers octets lus contiennent :\n"
+"\"%s\"\n"
+
+#: src/base/cs_io.c:649
+#, c-format
+msgid ""
+"Error reading file: \"%s\".\n"
+"The file contents are not of the expected type.\n"
+"\"%s\" was expected,\n"
+"\"%s\" was read."
+msgstr ""
+"Erreur à la lecture du fichier : \"%s.\n"
+"Le contenu du fichier n'est pas du type attendu.\n"
+"On attendait \"%s\"\n"
+"On a lu \"%s\"."
+
+#: src/base/cs_io.c:696
+#, c-format
+msgid "Error writing the header of file: \"%s\".\n"
+msgstr "Erreur à l'écriture de l'entête du fichier : \"%s\".\n"
+
+#: src/base/cs_io.c:845
+#, c-format
+msgid ""
+"Restart file \"%s\"\n"
+"in format 1.1 is not conforming."
+msgstr ""
+"Le fichier suite \"%s\"\n"
+"au format 1.1 n'est pas conforme."
+
+#: src/base/cs_io.c:894
+#, c-format
+msgid ""
+"Restart file \"%s\" does not correspond\n"
+"to part %d of the original restart file."
+msgstr ""
+"Le fichier suite \"%s\" ne correspond pas\n"
+"à la partie %d du fichier suite d'origine."
+
+#: src/base/cs_io.c:1123
+#, c-format
+msgid ""
+"\n"
+" Section read on \"%s\":\n"
+msgstr ""
+"\n"
+" Section lue sur \"%s\" :\n"
+
+#: src/base/cs_io.c:1128
+#, c-format
+msgid ""
+"\n"
+" Section written on \"%s\":\n"
+msgstr ""
+"\n"
+" Section écrite sur \"%s\" :\n"
+
+#: src/base/cs_io.c:1157
+#, c-format
+msgid ""
+" section name: \"%s\"\n"
+" number of elements: %lu\n"
+msgstr ""
+" nom de la rubrique : \"%s\"\n"
+" nombre d'éléments : %lu\n"
+
+#: src/base/cs_io.c:1191 src/base/cs_syr3_comm.c:849
+#, c-format
+msgid " element type name: \"%s\"\n"
+msgstr " nom du type d'élément : \"%s\"\n"
+
+#: src/base/cs_io.c:1235
+msgid " (local)"
+msgstr " (locaux)"
+
+#: src/base/cs_io.c:1256
+#, c-format
+msgid " %d first and last elements%s:\n"
+msgstr " %d premiers et derniers éléments%s :\n"
+
+#: src/base/cs_io.c:1261
+#, c-format
+msgid " elements%s:\n"
+msgstr " éléments%s :\n"
+
+#: src/base/cs_io.c:1809 src/base/cs_io.c:1986 src/base/cs_io.c:3023
+#: src/base/cs_io.c:3110
+#, c-format
+msgid "Error writing %lu bytes to file \"%s\"."
+msgstr "Erreur à l'écriture de %lu octets dans le fichier \"%s\"."
+
+#: src/base/cs_io.c:2009
+#, c-format
+msgid ""
+" %lu indexed records:\n"
+" (name, n_vals, location_id, index_id, n_loc_vals, type, embed, file_id, "
+"offset)\n"
+"\n"
+msgstr ""
+" %lu sections indexées :\n"
+" (nom, n_vals, id_support, id_index, n_vals_loc, type, inclus, id_fichier, "
+"position)\n"
+"\n"
+
+#: src/base/cs_io.c:2022
+#, c-format
+msgid " %40s %10lu %2u %2u %2u %6s %c %2u %ld\n"
+msgstr ""
+
+#: src/base/cs_io.c:2031
+#, c-format
+msgid ""
+"\n"
+" %u associated file(s):\n"
+msgstr ""
+"\n"
+" %u fichier(s) associé(s):\n"
+
+#: src/base/cs_io.c:2034
+#, c-format
+msgid " \"%s\"\n"
+msgstr " \"%s\"\n"
+
+#: src/base/cs_io.c:2109 src/base/cs_io.c:2165
+#, c-format
+msgid ""
+"\n"
+" Reading file: %s\n"
+msgstr ""
+"\n"
+" Lecture du fichier : %s\n"
+
+#: src/base/cs_io.c:2111
+#, c-format
+msgid ""
+"\n"
+" Writing file: %s\n"
+msgstr ""
+"\n"
+" Écriture du fichier : %s\n"
+
+#: src/base/cs_io.c:2222
+#, c-format
+msgid " Finished reading: %s\n"
+msgstr " Fin de la lecture : %s\n"
+
+#: src/base/cs_io.c:2225
+#, c-format
+msgid " Finished writing: %s\n"
+msgstr " Fin de l'écriture : %s\n"
+
+#: src/base/cs_io.c:2491
+#, c-format
+msgid ""
+"Type \"%s\" is not known\n"
+"Known types: \"c \", \"i4\", \"i8\", \"u4\", \"u8\", \"r4\", \"r8\"."
+msgstr ""
+"Type \"%s\" inconnu\n"
+"Types connus : \"c \", \"i4\", \"i8\", \"u4\", \"u8\", \"r4\", \"r8\"."
+
+#: src/base/cs_io.c:2547
+#, c-format
+msgid ""
+"Error reading file: \"%s\".\n"
+"Data type \"%s\" is not recognized."
+msgstr ""
+"Erreur à la lecture du fichier : \"%s\".\n"
+"Le type de données \"%s\" n'est pas reconnu."
+
+#: src/base/cs_io.c:2656
+#, c-format
+msgid ""
+"Error reading file: \"%s\".\n"
+"Type expected for section: \"%s\" is a signed integer\n"
+"and is not convertible from type read: \"%s\"."
+msgstr ""
+"Erreur à la lecture du fichier : \"%s\".\n"
+"Le type attendu pour la section : \n"
+"\"%s\" est un entier signé\n"
+"et n'est pas convertible à partir du type lu : \"%s\"."
+
+#: src/base/cs_io.c:2691
+#, c-format
+msgid ""
+"Error reading file: \"%s\".\n"
+"Type expected for section: \"%s\" is an unsigned integer\n"
+"and is not convertible from type read: \"%s\"."
+msgstr ""
+"Erreur à la lecture du fichier : \"%s\".\n"
+"Le type attendu pour la section : \n"
+"\"%s\" est un entier non signé\n"
+"et n'est pas convertible à partir du type lu : \"%s\"."
+
+#: src/base/cs_io.c:2722
+#, c-format
+msgid ""
+"Error reading file: \"%s\".\n"
+"Type expected for section: \"%s\"\n"
+"is \"r4\" or \"r8\" (real), and not \"%s\"."
+msgstr ""
+"Erreur à la lecture du fichier : \"%s\".\n"
+"Le type attendu pour la section : \"%s\"\n"
+"est \"r4\" ou \"r8\" (réel), et non \"%s\"."
+
+#: src/base/cs_io.c:2958
+#, c-format
+msgid ""
+" first element for next rank:\n"
+" %10lu : %12d\n"
+msgstr ""
+" premier élement rang suivant :\n"
+" %10lu : %12d\n"
+
+#: src/base/cs_io.c:3132
+msgid ""
+"\n"
+"\n"
+" file contents:\n"
+"\n"
+msgstr ""
+"\n"
+"\n"
+" contenu du fichier :\n"
+"\n"
+
+#: src/base/cs_io.c:3135
+#, c-format
+msgid " file: %s\n"
+msgstr " fichier : %s\n"
+
+#: src/base/cs_io.c:3137
+#, c-format
+msgid " contents: \"%s\"\n"
+msgstr " contenu : \"%s\"\n"
+
+#: src/base/cs_io.c:3139
+msgid " mode: CS_IO_MODE_READ\n"
+msgstr " mode : CS_IO_MODE_READ\n"
+
+#: src/base/cs_io.c:3141
+msgid " mode: CS_IO_MODE_WRITE\n"
+msgstr " mode : CS_IO_MODE_WRITE\n"
+
+#: src/base/cs_io.c:3143
+#, c-format
+msgid ""
+" default header size: %lu\n"
+" header alignment: %lu\n"
+" body alignment: %lu\n"
+" verbosity level: %ld\n"
+"\n"
+msgstr ""
+" taille d'en-tête par défaut : %lu\n"
+" alignement des en-têtes : %lu\n"
+" alignement des corps : %lu\n"
+" niveau d'impression : %ld\n"
+"\n"
+
+#: src/base/cs_join.c:411
+#, c-format
+msgid ""
+"Incompatible value for the \"fraction\" parameter.\n"
+"Value must be lower than 1.0 or greater than 0.0\n"
+"The current value is : %f\n"
+msgstr ""
+
+#: src/base/cs_join.c:496
+#, c-format
+msgid ""
+"Incompatible value for the \"vertex tolerance\" parameter\n"
+"Value must be lower than DBL_MAX and current value is : %f (global "
+"numbering : %u)\n"
+msgstr ""
+
+#: src/base/cs_join.c:523
+#, c-format
+msgid ""
+" Global number of selected vertices: %11d\n"
+"\n"
+msgstr ""
+" Nombre global de sommets sélectionnés : %11d\n"
+"\n"
+
+#: src/base/cs_join.c:555
+#, c-format
+msgid ""
+"\n"
+" Definition of local joining mesh:\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Définition du maillage de recollement local :\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join.c:641
+#, c-format
+msgid ""
+"\n"
+" Sorting possible intersections between faces:\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Tri des intersection possibles entre faces:\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join.c:794
+#, c-format
+msgid ""
+"\n"
+" Definition of structures for the joining algorithm:\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Définition de structures pour l'algorithme de recollement :\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join.c:900
+msgid ""
+"\n"
+" Joining operation is conforming.\n"
+msgstr ""
+
+#: src/base/cs_join.c:902
+msgid ""
+"\n"
+" Joining operation is non-conforming.\n"
+msgstr ""
+"\n"
+" L'opération de recollement est non-conforme.\n"
+
+#: src/base/cs_join.c:972
+#, c-format
+msgid ""
+"\n"
+" Edge intersections and vertex creation:\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Intersections d'arêtes et création de sommets :\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join.c:1111
+#, c-format
+msgid ""
+"\n"
+" Merge vertices:\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Fusion des sommets :\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join.c:1185
+#, c-format
+msgid ""
+"\n"
+" Split old faces and reconstruct new faces\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Découpage des anciennes faces et reconstruction de nouvelles faces\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join.c:1354
+#, c-format
+msgid ""
+"Mesh joining: Forbidden value for the fraction parameter.\n"
+" It must be between [0.0, 1.0[ and is here: %f\n"
+msgstr ""
+
+#: src/base/cs_join.c:1361
+#, c-format
+msgid ""
+"Mesh joining: Forbidden value for the tolerance reduction factor.\n"
+" It must be between [0.0, 1.0[ and not: %f\n"
+msgstr ""
+
+#: src/base/cs_join.c:1368
+#, c-format
+msgid ""
+"Mesh joining: Forbidden value for the merge tolerance factor.\n"
+" It must be positive or nul and not: %f\n"
+msgstr ""
+
+#: src/base/cs_join.c:1375
+#, c-format
+msgid ""
+"Mesh joining: Forbidden value for the equivalence tolerance factor.\n"
+" It must be positive or zero and not: %f\n"
+msgstr ""
+
+#: src/base/cs_join.c:1382
+#, c-format
+msgid ""
+"Mesh joining: Forbidden value for the plane parameter.\n"
+" It must be between [0, 90] and is here: %f\n"
+msgstr ""
+
+#: src/base/cs_join.c:1456
+#, c-format
+msgid ""
+"\n"
+" -------------------------------------------------------\n"
+" Joining number %d:\n"
+"\n"
+msgstr ""
+"\n"
+" -------------------------------------------------------\n"
+" Recollement numéro %d :\n"
+"\n"
+
+#: src/base/cs_join.c:1458
+#, c-format
+msgid " Selection criteria: \"%s\"\n"
+msgstr " Critère de sélection : \"%s\"\n"
+
+#: src/base/cs_join.c:1461
+#, c-format
+msgid ""
+"\n"
+" Parameters for the joining operation:\n"
+" Shortest incident edge fraction: %8.5f\n"
+" Main tolerance reduction factor: %8.5f\n"
+" Vertex matching tolerance reduction: %8.5f\n"
+" Merge step tolerance multiplier: %8.5f\n"
+" Maximum angle between joined face planes: %8.5f\n"
+"\n"
+msgstr ""
+"\n"
+" Paramètres de recollement :\n"
+" Fraction de la plus petite arête incidente : %8.5f\n"
+" Facteur de réduction de tolérance principal : %8.5f\n"
+" Réduction de tolérance pour équivalence sommets : %8.5f\n"
+" Multiplicateur de tolérance pour la fusion : %8.5f\n"
+" Angle maximum entre plans de faces recollées : %8.5f\n"
+"\n"
+
+#: src/base/cs_join.c:1473
+msgid " Before joining"
+msgstr " Avant recollement"
+
+#: src/base/cs_join.c:1562
+#, c-format
+msgid ""
+"\n"
+" Number of faces to treat locally: %10d\n"
+msgstr ""
+
+#: src/base/cs_join.c:1636
+msgid ""
+"\n"
+"Stop joining algorithm: no face selected...\n"
+msgstr ""
+"\n"
+"Arrêt du recollement: aucune face sélectionnée...\n"
+
+#: src/base/cs_join.c:1645
+#, c-format
+msgid ""
+"\n"
+" Complete joining treatment for joining %2d\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Traitement pour le recollement %2d terminé\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join.c:1682
+msgid " After joining"
+msgstr " Après recollement"
+
+#: src/base/cs_join.c:1695
+#, c-format
+msgid ""
+"\n"
+" All joining operations successfully finished:\n"
+"\n"
+" Time summary:\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+"\n"
+msgstr ""
+"\n"
+" Fin des étapes de recollement :\n"
+"\n"
+" Temps associés :\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+"\n"
+
+#: src/base/cs_join_intersect.c:403
+#, c-format
+msgid ""
+"\n"
+" Edge - Edge intersection warning between:\n"
+" edge 1: %d (%u) [%d (%u), %d (%u)]\n"
+" edge 2: %d (%u) [%d (%u), %d (%u)]\n"
+" Intersection found for curv. abs. %f (e1) - %f (e2) will be ignored.\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:418
+#, c-format
+msgid ""
+" Failure for edge 1: Distance [v_inter1, v_inter2]: %e > v_inter1.tol: %e\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:422
+#, c-format
+msgid ""
+" Failure for edge 2: Distance [v_inter1, v_inter2]: %e > v_inter2.tol: %e\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:1318
+#, c-format
+msgid ""
+" Determination of possible face intersections:\n"
+"\n"
+" bounding-box tree layout: %dD\n"
+msgstr ""
+" Détermination des intersections possibles entre faces :\n"
+"\n"
+" répartition de l'arbre de boîtes englobantes : %dD\n"
+
+#: src/base/cs_join_intersect.c:1325
+#, c-format
+msgid ""
+" rank mean minimum maximum\n"
+" depth: %10d | %10d | %10d\n"
+" number of leaves: %10lu | %10lu | %10lu\n"
+" number of boxes: %10lu | %10lu | %10lu\n"
+" leaves over threshold: %10lu | %10lu | %10lu\n"
+" boxes per leaf: %10d | %10d | %10d\n"
+" Memory footprint (kb):\n"
+" final search structure: %10lu | %10lu | %10lu\n"
+" temporary search structure: %10lu | %10lu | %10lu\n"
+"\n"
+msgstr ""
+" moyenne des rangs minimum maximum\n"
+" profondeur : %10d | %10d | %10d\n"
+" nombre de feuilles : %10lu | %10lu | %10lu\n"
+" nombre de boîtes : %10lu | %10lu | %10lu\n"
+" feuilles au-dessus du seuil : %10lu | %10lu | %10lu\n"
+" boîtes par feuilles : %10d | %10d | %10d\n"
+" Empreinte mémoire (ko):\n"
+" structure de recherche finale : %10lu | %10lu | %10lu\n"
+" structure intermédiaire : %10lu | %10lu | %10lu\n"
+"\n"
+
+#: src/base/cs_join_intersect.c:1348
+#, c-format
+msgid ""
+" depth: %10d\n"
+" number of leaves: %10lu\n"
+" number of boxes: %10lu\n"
+" leaves over threshold: %10lu\n"
+" boxes per leaf: %10d mean [%d min, %d max]\n"
+" Memory footprint (kb):\n"
+" final search structure: %10lu\n"
+" temporary search structure: %10lu\n"
+"\n"
+msgstr ""
+" profondeur : %10d\n"
+" nombre de feuilles : %10lu\n"
+" nombre de boîtes : %10lu\n"
+" feuilles au-dessus du seuil : %10lu\n"
+" boîtes par feuille : %10d moyenne [%d min, %d max]\n"
+" Empreinte mémoire (ko) :\n"
+" structure de recherche finale : %10lu\n"
+" structure intermédiaire : %10lu\n"
+"\n"
+
+#: src/base/cs_join_intersect.c:1360
+#, c-format
+msgid ""
+" Associated times: construction query\n"
+" wall clock time: %10.3g %10.3g\n"
+msgstr ""
+" Temsp associés: construction requête\n"
+" wall clock time: %10.3g %10.3g\n"
+
+#: src/base/cs_join_intersect.c:1377
+#, c-format
+msgid ""
+" Min local CPU time: %10.3g %10.3g\n"
+" Max local CPU time: %10.3g %10.3g\n"
+msgstr ""
+" temps CPU local min : %10.3g %10.3g\n"
+" temps CPU local max : %10.3g %10.3g\n"
+
+#: src/base/cs_join_intersect.c:1385
+#, c-format
+msgid " CPU time: %10.3g %10.3g\n"
+msgstr " temps CPU : %10.3g %10.3g\n"
+
+#: src/base/cs_join_intersect.c:1656
+#, c-format
+msgid ""
+"\n"
+" Incoherency found in inter_edges structure for edge %d (%u):\n"
+" Bad ordering of curvilinear abscissa.\n"
+" Vertex %d (%u) of abscissa: %f is before vertex %d (%u) of abscissa: %f\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:1667
+#, c-format
+msgid ""
+"\n"
+" Incoherency found in inter_edges structure.\n"
+" Redundancy for edge %d (%u) :\n"
+" v1_num : %d\n"
+" v2_num : %d\n"
+" Vertex %d appears twice.\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:2453
+#, c-format
+msgid ""
+" The received edge global number (%u) is unknown on the current rank.\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:2565
+#, c-format
+msgid ""
+"\n"
+" Add %d new vertices in the %s mesh definition.\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:2727
+#, c-format
+msgid ""
+"\n"
+" Number of intersections detected: %12lu\n"
+" Vertex-Vertex intersections: %12lu\n"
+" Other intersections: %12lu\n"
+msgstr ""
+"\n"
+" Nombre d'intersections détecté : %12lu\n"
+" Intersections sommet-sommet : %12lu\n"
+" Autres intersections : %12lu\n"
+
+#: src/base/cs_join_intersect.c:2734
+#, c-format
+msgid ""
+"\n"
+" Number of edge-edge intersection warnings: %8d\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:2737
+#, c-format
+msgid ""
+"\n"
+" Number of equivalences between existing vertices: %9d\n"
+msgstr ""
+
+#: src/base/cs_join_intersect.c:2746
+#, c-format
+msgid ""
+"\n"
+" Edge intersections (only)\n"
+" wall clock time: %10.3g\n"
+" CPU time: %10.3g\n"
+msgstr ""
+"\n"
+" Intersections d'arêtes (seulement)\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join_merge.c:355
+#, c-format
+msgid ""
+" The number of new vertices to create is not consistent.\n"
+" Previous number: %10d\n"
+" Current number: %10d\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:585
+#, c-format
+msgid ""
+"\n"
+" The authorized maximum number of iterations for the merge of vertices has "
+"been reached.\n"
+" Local counter on iteration : %d (MAX =%d)\n"
+" Check the fraction parameter.\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:690
+#, c-format
+msgid ""
+"\n"
+" The authorized maximum number of iterations for the merge of vertices has "
+"been reached.\n"
+" Global counter on iteration : %d (MAX =%d)\n"
+" Check the fraction parameter.\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:983
+#, c-format
+msgid ""
+"\n"
+" Number of local iterations to converge on vertex equivalences: %3d\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:986
+#, c-format
+msgid ""
+" Number of global iterations to converge on vertex equivalences: %3d\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:1525
+msgid ""
+" Max number of tolerance reductions has been reached.\n"
+" Check your joining parameters.\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:1682
+msgid ""
+"\n"
+" Merge: Local tolerance reduction for the following vertices (global "
+"numbering):\n"
+" "
+msgstr ""
+
+#: src/base/cs_join_merge.c:1894
+msgid ""
+"\n"
+" No need to merge vertices.\n"
+msgstr ""
+"\n"
+" Pas besoin de fusionner des sommets.\n"
+
+#: src/base/cs_join_merge.c:1898
+#, c-format
+msgid ""
+"\n"
+" Max size of a merge list: %lu\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:1969
+#, c-format
+msgid ""
+"\n"
+" Number of tolerance reductions: %4d\n"
+msgstr ""
+"\n"
+" Nombre de réductions de tolérance : %4d\n"
+
+#: src/base/cs_join_merge.c:2045
+#, c-format
+msgid ""
+"\n"
+" Tolerance reduction for %lu elements.\n"
+msgstr ""
+"\n"
+" Réduction de tolérance pour %lu éléments.\n"
+
+#: src/base/cs_join_merge.c:2051
+#, c-format
+msgid ""
+"\n"
+" Max. number of tolerance reductions: %lu\n"
+msgstr ""
+"\n"
+" Nombre max de réductions de tolérance : %lu\n"
+
+#: src/base/cs_join_merge.c:2715
+#, c-format
+msgid " Number of new vertices to create: %10lu\n"
+msgstr " Nombre de nouveaux sommets à créer : %10lu\n"
+
+#: src/base/cs_join_merge.c:2810
+#, c-format
+msgid ""
+" Inconsistent value found in cs_join_vertex_t struct.:\n"
+" Vertex %d is defined by:\n"
+" %u - [%7.4le, %7.4le, %7.4le] - %lg\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:2870
+#, c-format
+msgid ""
+"\n"
+" Final number of equiv. between vertices; local: %9d\n"
+" global: %9lu\n"
+msgstr ""
+
+#: src/base/cs_join_merge.c:2958
+#, c-format
+msgid ""
+"\n"
+" Vertex merge (only)\n"
+" wall clock time: %10.3g\n"
+" cpu time: %10.3g\n"
+msgstr ""
+"\n"
+" Fusion des sommets (seulement)\n"
+" temps écoulé : %10.3g\n"
+" temps CPU : %10.3g\n"
+
+#: src/base/cs_join_mesh.c:352
+#, c-format
+msgid ""
+" The simplified face has less than 3 vertices.\n"
+" Check your joining parameters.\n"
+" Face %d (%u)\n"
+msgstr ""
+" La face simplifiée a moins de 3 sommets.\n"
+" Vérifier les paramètres de recollement.\n"
+" Face %d (%u)\n"
+
+#: src/base/cs_join_mesh.c:368
+#, c-format
+msgid ""
+"\n"
+" Number of simplified faces: %lu\n"
+msgstr ""
+"\n"
+" Nombre de faces simplifiées : %lu\n"
+
+#: src/base/cs_join_mesh.c:586
+#, c-format
+msgid ""
+"\n"
+" Problem in mesh connectivity.\n"
+" Detected when updating connectivity.\n"
+" Edge number: %d (%u) - (%d, %d) in old numbering.\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2256
+#, c-format
+msgid ""
+" The given vertex number: %d is not defined in the edge structure (edges-"
+">vtx_idx).\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2268
+#, c-format
+msgid ""
+" The given couple of vertex numbers :\n"
+" vertex 1 : %d\n"
+" vertex 2 : %d\n"
+" is not defined in the edge structure.\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2362
+#, c-format
+msgid ""
+" Problem in mesh connectivity. Face: %lu\n"
+" Problem detected during connectivity update:\n"
+" The face is defined by less than 3 points (excessive merging has occured).\n"
+"\n"
+" Modify joining parameters to reduce merging (fraction & merge).\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2818 src/base/cs_join_mesh.c:2931
+#, c-format
+msgid ""
+"\n"
+"\n"
+" -- Dump a cs_join_mesh_t structure: (%p) --\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2823 src/base/cs_join_mesh.c:2936
+#, c-format
+msgid ""
+"\n"
+"\n"
+" -- Dump a cs_join_mesh_t structure: %s (%p) --\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2825
+#, c-format
+msgid ""
+"\n"
+" mesh->n_faces: %9d\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2826 src/base/cs_join_mesh.c:2939
+#, c-format
+msgid ""
+" mesh->n_g_faces: %11u\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2835
+#, c-format
+msgid ""
+"\n"
+" face_id: %5d gnum: %9u - n_vertices: %4d\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2858 src/base/cs_join_mesh.c:2876
+#: src/base/cs_join_mesh.c:2971 src/base/cs_join_mesh.c:2990
+#, c-format
+msgid ""
+" Incoherency found in the current mesh definition\n"
+" Face number: %d (global: %u)\n"
+" Vertices: local (%d, %d), global (%u, %u) are defined twice\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2892 src/base/cs_join_mesh.c:3006
+#, c-format
+msgid ""
+"\n"
+" Dump vertex data\n"
+" mesh->vertices : %p\n"
+" mesh->n_vertices : %11d\n"
+" mesh->n_g_vertices : %11u\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2900 src/base/cs_join_mesh.c:3014
+#, c-format
+msgid ""
+" Local Num | Global Num | Tolerance | Coordinates\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2938
+#, c-format
+msgid ""
+"\n"
+" mesh->n_faces: %11d\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:2948
+#, c-format
+msgid ""
+"\n"
+" face_id: %9d gnum: %10u - n_vertices : %4d\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:3044
+msgid ""
+"\n"
+" Edge connectivity used in the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:3045
+#, c-format
+msgid " Number of edges: %8d\n"
+msgstr " Nombre d'arêtes : %8d\n"
+
+#: src/base/cs_join_mesh.c:3046
+#, c-format
+msgid " Number of vertices: %8d\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:3055
+#, c-format
+msgid " Edge %6d (%7u) <Vertex> [%7u %7u]\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:3082
+msgid ""
+"\n"
+" Vertex -> Vertex connectivity :\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_join_mesh.c:3089
+#, c-format
+msgid " Vertex %6d (%7u) - %3d - "
+msgstr ""
+
+#: src/base/cs_join_post.c:238
+msgid ""
+" Size of \"int\" is not 4 or 8 bytes.\n"
+" Check the datatype of the field to export.\n"
+msgstr ""
+
+#: src/base/cs_join_post.c:374
+msgid "Rank"
+msgstr ""
+
+#: src/base/cs_join_post.c:394
+msgid "VtxTolerance"
+msgstr ""
+
+#: src/base/cs_join_set.c:961
+#, c-format
+msgid ""
+" Fail to build an inverted cs_join_gset_t structure.\n"
+" Cannot find %u in element list.\n"
+msgstr ""
+
+#: src/base/cs_join_set.c:1820
+#, c-format
+msgid " Unexpected type (%s) to display in the current dump.\n"
+msgstr ""
+
+#: src/base/cs_join_split.c:866
+msgid ""
+" face splitting with face -> face connectivity is not yet implemented\n"
+msgstr ""
+
+#: src/base/cs_join_split.c:1026
+#, c-format
+msgid ""
+" Joining operation : split face %d\n"
+" Problem in the connectivity. Could not find a connection with the vertex %"
+"d\n"
+msgstr ""
+
+#: src/base/cs_join_split.c:1417
+#, c-format
+msgid ""
+"\n"
+" Global number of faces after splitting: %10u\n"
+msgstr ""
+"\n"
+" Nombre global de faces après subdivision : %10u\n"
+
+#: src/base/cs_join_split.c:1782
+#, c-format
+msgid " Split face: %d with returned code: %d\n"
+msgstr ""
+
+#: src/base/cs_join_split.c:1954
+#, c-format
+msgid ""
+" Warning: (%lu) problem(s) found during the face splitting\n"
+" %12lu open cycles,\n"
+" %12lu edges traversed twice,\n"
+" %12lu faces split into more than max_subfaces (= %d)\n"
+"\n"
+" => Eventually modify joining parameters\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:1185
+#, c-format
+msgid " Add %d new vertices from the single elements sync.\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:2033
+#, c-format
+msgid ""
+" Cannot find the first corresponding vertex between the face connectivity "
+"before/after the merge step.\n"
+" Current global face number: %u\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:2195
+#, c-format
+msgid ""
+" Face %d (%u): Edge with two different descriptions: (%d, %d) [%u, %u]\n"
+" n_subs: %d - previous n_subs: %d\n"
+" Impossible to continue the mesh update after the merge operation.\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:4241
+#, c-format
+msgid ""
+" Incompatible new face type found.\n"
+" n_matches is not to 1 or 2: n_matches = %d\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:4248
+#, c-format
+msgid ""
+"\n"
+" Local configuration after the joining operation:\n"
+" Number of interior faces to add: %9d\n"
+" Number of border faces to add : %9d\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:4265
+#, c-format
+msgid ""
+"\n"
+" Global configuration after the joining operation:\n"
+" Global number of border faces to add : %10u\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:4442
+#, c-format
+msgid " Clean border face %d. New number of vertices: %d\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:4463
+#, c-format
+msgid ""
+"\n"
+" Degenerate connectivity for %d final border faces.\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:4502
+#, c-format
+msgid " Clean interior face %d. New number of vertices: %d\n"
+msgstr ""
+
+#: src/base/cs_join_update.c:4523
+#, c-format
+msgid ""
+" Degenerate connectivity for %d final interior faces.\n"
+" Mesh cleaning done.\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:899
+msgid ""
+"\n"
+" Single border faces for the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:916
+msgid ""
+"\n"
+" Single interior faces for the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1154
+msgid ""
+"\n"
+" Single vertices for the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1276
+msgid ""
+"\n"
+" Coupled vertices for the joining operations:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1756
+#, c-format
+msgid " Number of boundary faces selected for joining: %10u\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1858
+msgid ""
+"\n"
+" Selected faces for the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1865
+msgid ""
+"\n"
+" Select vertices for the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1873
+msgid ""
+"\n"
+" Contiguous border faces for the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1879
+msgid ""
+"\n"
+" Contiguous interior faces for the joining operation:\n"
+msgstr ""
+
+#: src/base/cs_join_util.c:1978 src/base/cs_join_util.c:1994
+#, c-format
+msgid ""
+" Inconsistent mesh definition. Cannot build edges.\n"
+" Face %d has the same vertex %d twice.\n"
+msgstr ""
+
+#: src/base/cs_matrix.c:317
+msgid "diagonal + faces"
+msgstr "diagonale + faces"
+
+#: src/base/cs_matrix.c:318
+msgid "Compressed Sparse Row"
+msgstr ""
+
+#: src/base/cs_matrix.c:323
+msgid ""
+"Matrix product with CS_PERIO_IGNORE rotation mode not yet\n"
+"implemented in this case, use cs_matrix_vector_multiply_nosync\n"
+"with an external halo synchronization, prededed by a backup and\n"
+"followed by a restoration of the rotation halo."
+msgstr ""
+"Produit matriciel avec mode de rotation CS_PERIO_IGNORE non encore\n"
+"implémenté : utiliser dans ce cas cs_matrix_vector_multiply_nosync()\n"
+"avec une synchronisation de halo externe, précédée d'une sauvegarde\n"
+"et suivie d'une restoration du halo de rotation."
+
+#: src/base/cs_matrix.c:2001
+msgid ""
+"Assigning non-symmetric matrix coefficients to a matrix\n"
+"in a symmetric CSR format."
+msgstr ""
+"Affectation de coefficients matriciels non symétriques\n"
+"à une matrice en stockage CSR symmétrique."
+
+#: src/base/cs_matrix.c:2579
+#, c-format
+msgid ""
+"Handling of matrixes in %s format\n"
+"is not operational yet."
+msgstr ""
+"La gestion des matrices au format %s \n"
+"n'est pas encore opérationnelle."
+
+#: src/base/cs_matrix.c:2715 src/base/cs_matrix.c:2732
+#: src/base/cs_matrix.c:2758 src/base/cs_matrix.c:2778
+#: src/base/cs_matrix.c:2800
+msgid "The matrix is not defined."
+msgstr "La matrice n'est pas définie."
+
+#: src/base/cs_mesh.c:155
+msgid "Synchronizing cell families\n"
+msgstr " Synchronisation des familles des cellules\n"
+
+#: src/base/cs_mesh.c:209
+msgid " no value\n"
+msgstr " aucune valeur\n"
+
+#: src/base/cs_mesh.c:217
+#, c-format
+msgid " minimum value = %10d\n"
+msgstr " valeur minimale = %10d\n"
+
+#: src/base/cs_mesh.c:218
+#, c-format
+msgid ""
+" maximum value = %10d\n"
+"\n"
+msgstr ""
+" valeur maximale = %10d\n"
+"\n"
+
+#: src/base/cs_mesh.c:291
+msgid ""
+"\n"
+" Halo creation times summary\n"
+"\n"
+msgstr ""
+"\n"
+" Bilan des temps pour la création du halo\n"
+"\n"
+
+#: src/base/cs_mesh.c:294
+#, c-format
+msgid " Creating interface: %.3g s\n"
+msgstr " Création de l'interface : %.3g s\n"
+
+#: src/base/cs_mesh.c:298
+#, c-format
+msgid " Creating extended connectivity: %.3g s\n"
+msgstr " Création de la connectivité étendue : %.3g s\n"
+
+#: src/base/cs_mesh.c:301
+#, c-format
+msgid ""
+" Creating halo: %.3g s\n"
+"\n"
+msgstr ""
+" Création du halo : %.3g s\n"
+"\n"
+
+#: src/base/cs_mesh.c:305
+#, c-format
+msgid ""
+" Total time for halo creation: %.3g s\n"
+"\n"
+msgstr ""
+" Temps total de création du halo : %.3g s\n"
+"\n"
+
+#: src/base/cs_mesh.c:311
+#, c-format
+msgid " Number of standard cells: %d\n"
+msgstr " Nombre de cellules standard : %d\n"
+
+#: src/base/cs_mesh.c:323
+msgid ""
+"\n"
+" Histogram of the number of cells per rank:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme de la distribution du nombre de cellules sur les rangs :\n"
+"\n"
+
+#: src/base/cs_mesh.c:332
+#, c-format
+msgid ""
+" Number of cells + halo cells: %d\n"
+"\n"
+msgstr ""
+" Nombre de cellules + cellules halo : %d\n"
+"\n"
+
+#: src/base/cs_mesh.c:342
+msgid ""
+"\n"
+" Histogram of number of standard + halo cells (NCELET) per rank:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme de la distribution du nombre de cellules\n"
+" standard + halo (NCELET) sur les rangs :\n"
+"\n"
+
+#: src/base/cs_mesh.c:356
+#, c-format
+msgid ""
+"\n"
+" Local number of ghost cells: %10d\n"
+msgstr ""
+"\n"
+" Nombre de cellules fantômes locales : %10d\n"
+
+#: src/base/cs_mesh.c:358
+#, c-format
+msgid " in the standard neighborhood: %10d\n"
+msgstr " dans le voisinage standard: %10d\n"
+
+#: src/base/cs_mesh.c:360
+#, c-format
+msgid " in the extended neighborhood: %10d\n"
+msgstr " dans le voisinage etendu: %10d\n"
+
+#: src/base/cs_mesh.c:373
+msgid ""
+"\n"
+" Histogram of the number of ghost cells per rank:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme de la distribution des cellules fantômes sur les rangs :\n"
+"\n"
+
+#: src/base/cs_mesh.c:385
+#, c-format
+msgid ""
+"\n"
+" Number of neighboring domains: %d\n"
+msgstr ""
+"\n"
+" Nombre de domaines voisins : %d\n"
+
+#: src/base/cs_mesh.c:397
+msgid ""
+"\n"
+" Histogram of the number of neighboring domains per rank:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme de la distribution du nombre de voisins sur les rangs :\n"
+"\n"
+
+#: src/base/cs_mesh.c:832
+#, c-format
+msgid ""
+"\n"
+" Mesh coordinates: minimum and maximum\n"
+" X : %14.7e %14.7e\n"
+" Y : %14.7e %14.7e\n"
+" Z : %14.7e %14.7e\n"
+msgstr ""
+"\n"
+" Coordonnées du maillage minimale et maximale\n"
+" X : %14.7e %14.7e\n"
+" Y : %14.7e %14.7e\n"
+" Z : %14.7e %14.7e\n"
+
+#: src/base/cs_mesh.c:864
+msgid ""
+"\n"
+" Global definition of the number of elements (cells, vertices, faces...)\n"
+msgstr ""
+"\n"
+" Définition globale du nombre d'éléments (cellules, sommets, faces...)\n"
+
+#: src/base/cs_mesh.c:950
+msgid ""
+"\n"
+" Halo construction with extended neighborhood\n"
+" ============================================\n"
+"\n"
+msgstr ""
+"\n"
+" Construction du halo avec voisinage étendu\n"
+" ==========================================\n"
+"\n"
+
+#: src/base/cs_mesh.c:957
+msgid " Periodicities combination\n"
+msgstr " Composition des périodicités\n"
+
+#: src/base/cs_mesh.c:966
+msgid ""
+"\n"
+" Halo construction with standard neighborhood\n"
+" ============================================\n"
+"\n"
+msgstr ""
+"\n"
+" Construction du halo avec voisinage standard\n"
+" ============================================\n"
+"\n"
+
+#: src/base/cs_mesh.c:994
+msgid " Definition of periodic couples\n"
+msgstr " Définition des couples périodiques\n"
+
+#: src/base/cs_mesh.c:1016
+msgid " Interface creation\n"
+msgstr " Création de l'interface\n"
+
+#: src/base/cs_mesh.c:1049
+msgid " Halo creation\n"
+msgstr " Création des halos\n"
+
+#: src/base/cs_mesh.c:1054
+msgid " Halo definition\n"
+msgstr " Définition des halos\n"
+
+#: src/base/cs_mesh.c:1078
+msgid " Extended neighborhood structures definition\n"
+msgstr " Définition des structures pour le voisinage étendu\n"
+
+#: src/base/cs_mesh.c:1105
+#, c-format
+msgid ""
+"\n"
+" Extended connectivity creation (%.3g s)\n"
+msgstr ""
+"\n"
+" Création de la connectivité étendue (%.3g s)\n"
+
+#: src/base/cs_mesh.c:1254
+#, c-format
+msgid ""
+" %s\n"
+" Number of cells: %lu\n"
+" Number of interior faces: %lu\n"
+" Number of boundary faces: %lu\n"
+" Number of vertices: %lu\n"
+msgstr ""
+" %s\n"
+" Nombre de cellules : %lu\n"
+" Nombre de faces internes : %lu\n"
+" Nombre de faces de bord : %lu\n"
+" Nombre de sommets : %lu\n"
+
+#: src/base/cs_mesh_coherency.c:104
+msgid " Checking the face -> cells connectivity coherency\n"
+msgstr " Test de cohérence de la connectivité faces -> cellules\n"
+
+#: src/base/cs_mesh_coherency.c:110
+#, c-format
+msgid ""
+"Internal face -> cells connectivity value not initialized\n"
+"for face: %d (cell_num1 = %d and cell_num2 = %d)\n"
+msgstr ""
+"Valeur de connectivité faces -> cellules pas initialisée\n"
+"pour la face : %d (num_cell1 = %d et num_cell2 = %d)\n"
+
+#: src/base/cs_mesh_coherency.c:147
+msgid ""
+"\n"
+" Checking the mesh structure coherency:\n"
+msgstr ""
+"\n"
+" Tests de cohérence de la structure de maillage :\n"
+
+#: src/base/cs_mesh_coherency.c:165
+msgid " Coherency criteria definition\n"
+msgstr " Définition des critères de cohérence\n"
+
+#: src/base/cs_mesh_coherency.c:321
+#, c-format
+msgid " Coherency verification on coordinates %d\n"
+msgstr " Vérification de cohérence sur coordonnées %d\n"
+
+#: src/base/cs_mesh_coherency.c:344 src/base/cs_mesh_coherency.c:393
+#, c-format
+msgid ""
+"\n"
+"Info on cell 1: %d\n"
+" cell center: %12.3g %12.3g %12.3g\n"
+" delta: %12.3g\n"
+" box center: %12.3g\n"
+msgstr ""
+"\n"
+"Infos cellule 1 : %d\n"
+" centre cellule : %12.3g %12.3g %12.3g\n"
+" delta : %12.3g\n"
+" centre boîte : %12.3g\n"
+
+#: src/base/cs_mesh_coherency.c:351 src/base/cs_mesh_coherency.c:400
+#, c-format
+msgid ""
+"\n"
+"Info on cell 2: %d\n"
+" cell center: %12.3g %12.3g %12.3g\n"
+" delta: %12.3g\n"
+" box center: %12.3g\n"
+msgstr ""
+"\n"
+"Infos cellule 2 : %d\n"
+" centre cellule : %12.3g %12.3g %12.3g\n"
+" delta : %12.3g\n"
+" centre boîte : %12.3g\n"
+
+#: src/base/cs_mesh_coherency.c:360
+#, c-format
+msgid ""
+"\n"
+"Coherency error in standard halo\n"
+"between cells %d and %d: test = %g\n"
+"(delta = %g, delta_mean = %g)\n"
+msgstr ""
+"\n"
+"Erreur de cohérence dans le halo standard\n"
+"entre les cellules %d et %d : test = %g\n"
+"(delta = %g, delta_moyen = %g)\n"
+
+#: src/base/cs_mesh_coherency.c:409
+#, c-format
+msgid ""
+"\n"
+"Coherency error in extended halo\n"
+"between cells %d and %d: test = %g\n"
+"(delta = %g, delta_mean = %g)\n"
+msgstr ""
+"\n"
+"Erreur de cohérence dans le halo étendu\n"
+"entre les cellules %d et %d : test = %g\n"
+"(delta = %g, delta_moyen = %g)\n"
+
+#: src/base/cs_mesh_coherency.c:429
+msgid " End of coherency check of the mesh structure.\n"
+msgstr " Fin des tests de cohérence de la structure de maillage.\n"
+
+#: src/base/cs_mesh_connect.c:294
+msgid ""
+"The main mesh does not contain any face -> vertices\n"
+"connectivity, necessary for the nodal connectivity\n"
+"reconstruction (cs_mesh_connect_cells_to_nodal)."
+msgstr ""
+"Le maillage principal ne contient pas de connectivité\n"
+"faces->sommets, indispensable à la reconstruction\n"
+"de la connectivité nodale (cs_mesh_connect_cells_to_nodal)."
+
+#: src/base/cs_mesh_connect.c:443
+msgid ""
+"The main mesh does not contain any face -> vertices\n"
+"connectivity, necessary for the nodal connectivity\n"
+"reconstruction (cs_mesh_connect_faces_to_nodal)."
+msgstr ""
+"Le maillage principal ne contient pas de connectivité\n"
+"faces->sommets, indispensable à la reconstruction\n"
+"de la connectivité nodale (cs_mesh_connect_faces_to_nodal)."
+
+#: src/base/cs_mesh_halo.c:314
+#, c-format
+msgid ""
+"_raise_table_int_value:\n"
+"Invalid index. table_int structure has a lower n_elts.\n"
+"Index = %d, n_elts = %d and table size max = %d\n"
+msgstr ""
+
+#: src/base/cs_mesh_halo.c:341
+#, c-format
+msgid ""
+"get_table_int_value:\n"
+"Invalid index. table_int structure has a lower n_elts.\n"
+"Index = %d, n_elts = %d and table size max = %d\n"
+msgstr ""
+
+#: src/base/cs_mesh_halo.c:1918
+#, c-format
+msgid ""
+"Repeated inconsistency in the halo construction.\n"
+"Several local points have the same distant correspondant;\n"
+"this is probably due to a multiple-periodicity construction\n"
+"side effect of the Preprocessor.\n"
+"Coordinates of the first impacted point: [%12.5e, %12.5e %12.5e]."
+msgstr ""
+"Incohérence repérée lors de la construction du halo.\n"
+"Plusieurs points locaux ont le même correspondant distant ;\n"
+"ceci est probablement dû à un effet de bord de la construction\n"
+"de périodicités multiples par le Préprocesseur.\n"
+"Coordonnées du premier point impacté: [%12.5e, %12.5e %12.5e]."
+
+#: src/base/cs_mesh_halo.c:3478 src/ctwr/cs_ctwr_halo.c:1490
+msgid " Local halo definition\n"
+msgstr " Définition du halo local\n"
+
+#: src/base/cs_mesh_halo.c:3490
+msgid " Halo cleaning\n"
+msgstr " Nettoyage des halos\n"
+
+#: src/base/cs_mesh_halo.c:3500
+msgid " Distant halo creation\n"
+msgstr " Création du halo distant\n"
+
+#: src/base/cs_mesh_halo.c:3534
+msgid " Updating the faces -> cells connectivity\n"
+msgstr " Mise à jour de la connectivité faces -> cellules\n"
+
+#: src/base/cs_mesh_quality.c:177
+#, c-format
+msgid " minimum value = %10.5e\n"
+msgstr " valeur minimale = %10.5e\n"
+
+#: src/base/cs_mesh_quality.c:178
+#, c-format
+msgid ""
+" maximum value = %10.5e\n"
+"\n"
+msgstr ""
+" valeur maximale = %10.5e\n"
+"\n"
+
+#: src/base/cs_mesh_quality.c:921
+msgid ""
+"\n"
+" Histogram of the interior faces warping:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme du gauchissement des faces internes :\n"
+"\n"
+
+#: src/base/cs_mesh_quality.c:926
+msgid ""
+"\n"
+" Histogram of the boundary faces warping:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme du gauchissement des faces de bord:\n"
+"\n"
+
+#: src/base/cs_mesh_quality.c:1019
+msgid ""
+"\n"
+" Histogram of the interior faces weighting coefficient:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme des coefficients de pondération des faces internes :\n"
+"\n"
+
+#: src/base/cs_mesh_quality.c:1023
+msgid ""
+"\n"
+" Histogram of the interior faces off-centering coefficient:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme des coefficients de décentrement des faces internes :\n"
+"\n"
+
+#: src/base/cs_mesh_quality.c:1121
+msgid ""
+"\n"
+" Histogram of the interior faces non-orthogonality coefficient (in "
+"degrees):\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme de la non-orthogonalité des faces internes (en degrés) :\n"
+"\n"
+
+#: src/base/cs_mesh_quality.c:1127
+msgid ""
+"\n"
+" Histogram of the boundary faces non-orthogonality coefficient (in "
+"degrees):\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme de la non-orthogonalité des faces de bord (en degrés) :\n"
+"\n"
+
+#: src/base/cs_mesh_quality.c:1197
+msgid ""
+"\n"
+" Histogram of cell volumes:\n"
+"\n"
+msgstr ""
+"\n"
+" Histogramme du volume des cellules :\n"
+"\n"
+
+#: src/base/cs_mesh_quantities.c:164 src/base/cs_mesh_quantities.c:329
+msgid ""
+"Face geometric quantities computation is only\n"
+"implemented in 3D."
+msgstr ""
+"Le calcul des grandeurs géométriques associées aux faces\n"
+"ne sont implantés qu'en 3D."
+
+#: src/base/cs_mesh_quantities.c:568 src/base/cs_mesh_quantities.c:703
+msgid "Cell centre computation is only implemented in 3D."
+msgstr ""
+"Le calcul des centres des cellules\n"
+"ne sont implantés qu'en 3D."
+
+#: src/base/cs_mesh_quantities.c:924
+#, c-format
+msgid ""
+"The algorithm selection indicator for the cell centre of gravity "
+"computation\n"
+"can take the following values:\n"
+" 0: computation based on the face centres and surfaces\n"
+" 1: computation based on the vertices\n"
+"and not %d."
+msgstr ""
+"L'indicateur de choix d'algorithme de calcul du centre de gravité\n"
+"des cellules peut prendre les valeurs suivantes :\n"
+" 0 : calcul basé sur les centres et surfaces des faces\n"
+" 1 : calcul basé sur les sommets\n"
+"et non %d."
+
+#: src/base/cs_mesh_solcom.c:382 src/base/cs_post.c:3379
+msgid "Fluid volume"
+msgstr "Volume fluide"
+
+#: src/base/cs_mesh_warping.c:1028
+msgid ""
+"The faces have been renumbered before cutting.\n"
+"This case should not arise, because the mesh entities\n"
+"should be cut before renumbering."
+msgstr ""
+"On a découpé les faces préalablement renumérotées.\n"
+"Ce cas ne devrait pas se produire, car on devrait découper\n"
+"les entités de maillage avant de les renuméroter."
+
+#: src/base/cs_mesh_warping.c:1036
+#, c-format
+msgid "\t%12d global faces before cutting\n"
+msgstr "\t%12d faces globales avant découpage\n"
+
+#: src/base/cs_mesh_warping.c:1056
+#, c-format
+msgid ""
+"\t%12d global faces after cutting\n"
+"\n"
+msgstr ""
+"\t%12d faces globales après découpage\n"
+"\n"
+
+#: src/base/cs_mesh_warping.c:1102
+msgid "Warped faces to cut"
+msgstr "Faces gauche a decouper"
+
+#: src/base/cs_mesh_warping.c:1123
+msgid "Face warping"
+msgstr "Gauchissement des faces"
+
+#: src/base/cs_mesh_warping.c:1163
+msgid "Warped faces after cutting"
+msgstr "Faces gauche apres decoupage"
+
+#: src/base/cs_mesh_warping.c:1218
+#, c-format
+msgid ""
+"\n"
+"\n"
+" Cutting of warped faces requested\n"
+" ---------------------------------\n"
+"\n"
+" Maximum allowed angle (rad):\t%7.4f\n"
+"\n"
+msgstr ""
+"\n"
+"\n"
+" Découpage des faces gauche demandé\n"
+" ----------------------------------\n"
+"\n"
+" Angle maximal autorisé (rad) :\t%7.4f\n"
+"\n"
+
+#: src/base/cs_mesh_warping.c:1281
+msgid ""
+"\n"
+" No face to cut. Verify the criterion if necessary.\n"
+msgstr ""
+"\n"
+" Aucune face à découper. Revoir le critère si nécessaire.\n"
+
+#: src/base/cs_mesh_warping.c:1328
+#, c-format
+msgid ""
+" Interior faces:\n"
+"\t%12d cut faces to respect the criterion\n"
+"\n"
+"\t%12d local faces before cutting\n"
+"\t%12d local faces after cutting\n"
+"\n"
+msgstr ""
+" Faces internes:\n"
+"\t%12d faces découpées pour respecter le critère\n"
+"\n"
+"\t%12d faces localement avant découpage\n"
+"\t%12d faces localement après découpage\n"
+"\n"
+
+#: src/base/cs_mesh_warping.c:1335 src/base/cs_mesh_warping.c:1375
+#, c-format
+msgid ""
+" Size of the new face -> vertices connectivity: %12d\n"
+"\n"
+msgstr ""
+" Taille de la nouvelle connectivité face -> sommets :%12d\n"
+"\n"
+
+#: src/base/cs_mesh_warping.c:1368
+#, c-format
+msgid ""
+" Boundary faces:\n"
+"\t%12d cut faces to respect the criterion\n"
+"\n"
+"\t%12d local faces before cutting\n"
+"\t%12d local faces after cutting\n"
+"\n"
+msgstr ""
+" Faces de bord:\n"
+"\t%12d faces découpées pour respecter le critère\n"
+"\n"
+"\t%12d faces localement avant découpage\n"
+"\t%12d faces localement après découpage\n"
+"\n"
+
+#: src/base/cs_multigrid.c:280
+#, c-format
+msgid ""
+"\n"
+"Summary of multigrid for \"%s\":\n"
+"\n"
+msgstr ""
+"\n"
+"Bilan du multigrille pour \"%s\" :\n"
+"\n"
+
+#: src/base/cs_multigrid.c:290
+#, c-format
+msgid " Smoother: %s\n"
+msgstr " Lisseur : %s\n"
+
+#: src/base/cs_multigrid.c:292
+#, c-format
+msgid ""
+" Descent smoother: %s\n"
+" Ascent smoother: %s\n"
+msgstr ""
+" Lisseur de descente : %s\n"
+" Lisseur de remontée : %s\n"
+
+#: src/base/cs_multigrid.c:296
+#, c-format
+msgid " Coarsest level solver: %s\n"
+msgstr " Solveur de niveau grossier : %s\n"
+
+#: src/base/cs_multigrid.c:301
+#, c-format
+msgid ""
+" Number of constructions: %d\n"
+" Number of resolutions: %d\n"
+" Number of levels:\n"
+" minimum: %d\n"
+" maximum: %d\n"
+" mean: %d\n"
+" Number of iterations:\n"
+" on finest grid:\n"
+" minimum: %d\n"
+" maximum: %d\n"
+" mean: %d\n"
+" on coarsest grid:\n"
+" minimum: %d\n"
+" maximum: %d\n"
+" mean: %d\n"
+" total on grids:\n"
+" minimum: %d\n"
+" maximum: %d\n"
+" mean: %d\n"
+" equivalent (total weighted by number of cells) :\n"
+" minimum: %d\n"
+" maximum: %d\n"
+" mean: %d\n"
+" Associated times (construction, resolution)\n"
+" total elapsed: %12.3f %12.3f\n"
+msgstr ""
+" Nombre de constructions : %d\n"
+" Nombre de résolutions : %d\n"
+" Nombre de niveaux :\n"
+" minimal : %d\n"
+" maximal : %d\n"
+" moyen : %d\n"
+" Nombre d'itérations :\n"
+" sur grille la plus fine :\n"
+" minimal : %d\n"
+" maximal : %d\n"
+" moyen : %d\n"
+" sur grille la plus grossière :\n"
+" minimal : %d\n"
+" maximal : %d\n"
+" moyen : %d\n"
+" total sur les grilles :\n"
+" minimal : %d\n"
+" maximal : %d\n"
+" moyen : %d\n"
+" équivalent (total pondéré par le nombre de cellules) :\n"
+" minimal : %d\n"
+" maximal : %d\n"
+" moyen : %d\n"
+" Temps associés (construction, résolution)\n"
+" écoulé cumulé : %12.3f %12.3f\n"
+
+#: src/base/cs_multigrid.c:348
+#, c-format
+msgid ""
+" Min local total CPU time: %12.3f %12.3f\n"
+" Max local total CPU time: %12.3f %12.3f\n"
+" Total CPU time: %12.3f %12.3f\n"
+msgstr ""
+" CPU cumulé local min : %12.3f %12.3f\n"
+" CPU cumulé local max : %12.3f %12.3f\n"
+" CPU cumulé total : %12.3f %12.3f\n"
+
+#: src/base/cs_multigrid.c:359
+#, c-format
+msgid " Total CPU time: %12.3f %12.3f\n"
+msgstr " CPU cumulé : %12.3f %12.3f\n"
+
+#: src/base/cs_multigrid.c:735
+msgid ""
+" ---------------------------------------------------\n"
+" n. | Cumulative iterations | Norm. residual\n"
+" cycles | on fine mesh | on fine mesh\n"
+" ---------------------------------------------------\n"
+msgstr ""
+" ---------------------------------------------------\n"
+" nb. | Cumul des iterations | Residu norm.\n"
+" cycles | sur maillage fin | maillage fin\n"
+" ---------------------------------------------------\n"
+
+#: src/base/cs_multigrid.c:740
+msgid " ---------------------------------------------------\n"
+msgstr " ---------------------------------------------------\n"
+
+#: src/base/cs_multigrid.c:742
+#, c-format
+msgid " %4d | %6d | %12.4e\n"
+msgstr " %4d | %6d | %12.4e\n"
+
+#: src/base/cs_multigrid.c:745
+#, c-format
+msgid ""
+" N. cycles: %4d; Fine mesh cumulative iter: %5d; Norm. residual %12.4e\n"
+msgstr ""
+" Nb. cycles : %4d ; Cumul iter maillage fin : %5d ; Residu norme %12.4e\n"
+
+#: src/base/cs_multigrid.c:781
+#, c-format
+msgid ""
+" @@ Warning: algebraic multigrid for [%s]\n"
+" ********\n"
+" Maximum number of cycles (%d) reached.\n"
+msgstr ""
+" @@ Attention : multigrille algébrique pour [%s]\n"
+" *********\n"
+" Nombre de cycles maximal (%d) atteint\n"
+
+#: src/base/cs_multigrid.c:936
+#, c-format
+msgid ""
+"algebraic multigrid [%s]: divergence after %d cycles:\n"
+" initial residual: %11.4e; current residual: %11.4e"
+msgstr ""
+"multigrille algébrique [%s] : divergence après %d cycles :\n"
+" résidu initial : %11.4e ; résidu courant : %11.4e"
+
+#: src/base/cs_multigrid.c:941
+#, c-format
+msgid ""
+"algebraic multigrid [%s]: divergence after %d cycles\n"
+" during resolution at level %d:\n"
+" initial residual: %11.4e; current residual: %11.4e"
+msgstr ""
+"multigrille algébrique [%s] : divergence après %d cycles :\n"
+" au cours de la résolution au niveau %d:\n"
+" résidu initial : %11.4e ; résidu courant : %11.4e"
+
+#: src/base/cs_multigrid.c:1103
+msgid " Multigrid cycle: descent\n"
+msgstr " Cycle multigrille : descente\n"
+
+#: src/base/cs_multigrid.c:1116 src/base/cs_multigrid.c:1300
+#, c-format
+msgid " level %3d: smoother\n"
+msgstr " niveau %3d : lisseur\n"
+
+#: src/base/cs_multigrid.c:1222
+msgid " Resolution on coarsest level\n"
+msgstr " Résolution sur le niveau le plus grossier\n"
+
+#: src/base/cs_multigrid.c:1269
+msgid " Multigrid cycle: ascent\n"
+msgstr " Cycle multigrille : remontée\n"
+
+#: src/base/cs_multigrid.c:1437
+msgid "Multigrid"
+msgstr "Multigrille"
+
+#: src/base/cs_multigrid.c:1469
+#, c-format
+msgid "Multigrid [%s]:\n"
+msgstr "Multigrille [%s]:\n"
+
+#: src/base/cs_multigrid.c:1476
+#, c-format
+msgid "Multigrid [%s]: cycle %4d\n"
+msgstr "Multigrille [%s] : cycle %4d\n"
+
+#: src/base/cs_multigrid.c:1629
+#, c-format
+msgid ""
+"\n"
+" Construction of grid hierarchy for \"%s\"\n"
+msgstr ""
+"\n"
+" Construction de la hiérarchie de grilles pour \"%s\"\n"
+
+#: src/base/cs_multigrid.c:1673
+#, c-format
+msgid ""
+" CLMLGA: maximum number of coarse grids (%d)\n"
+" reached for \"%s\".\n"
+msgstr ""
+" CLMLGA : nombre de maillages grossiers maximal (%d)\n"
+" atteint pour \"%s\".\n"
+
+#: src/base/cs_multigrid.c:1684
+#, c-format
+msgid ""
+"\n"
+" building level %2d grid\n"
+msgstr ""
+"\n"
+" construction de la grille de niveau %2d\n"
+
+#: src/base/cs_multigrid.c:1720
+#, c-format
+msgid ""
+" total min max\n"
+" number of cells: %12lu %10d %10d\n"
+" number of faces: %10d %10d\n"
+msgstr ""
+" total min max\n"
+" nombre de cellules : %12lu %10d %10d\n"
+" nombre de faces : %10d %10d\n"
+
+#: src/base/cs_multigrid.c:1729
+#, c-format
+msgid ""
+" number of cells: %10d\n"
+" number of faces: %10d\n"
+msgstr ""
+" nombre de cellules : %10d\n"
+" nombre de faces : %10d\n"
+
+#: src/base/cs_multigrid.c:1748
+#, c-format
+msgid ""
+" number of coarse grids: %d\n"
+" number of cells in coarsest grid: %lu\n"
+"\n"
+msgstr ""
+" nombre de maillages grossiers : %d\n"
+" nombre de cellules dans le maillage le plus grossier : %lu\n"
+"\n"
+
+#: src/base/cs_numbering.c:80
+msgid "vectorization"
+msgstr "vectorisation"
+
+#: src/base/cs_numbering.c:81
+msgid "threads"
+msgstr ""
+
+#: src/base/cs_opts.c:114
+#, c-format
+msgid "Usage: %s [options]\n"
+msgstr "Utilisation : %s [options]\n"
+
+#: src/base/cs_opts.c:116
+#, c-format
+msgid ""
+"\n"
+"Command line options:\n"
+"\n"
+msgstr ""
+"\n"
+"Options de la ligne de commandes :\n"
+"\n"
+
+#: src/base/cs_opts.c:118
+#, c-format
+msgid ""
+" --solcom stand-alone kernel with \"geomet\" mesh in\n"
+" SolCom format (obsolete)\n"
+msgstr ""
+" --solcom noyau autonome avec maillage \"geomet\" au\n"
+" format SolCom (obsolète)\n"
+
+#: src/base/cs_opts.c:122
+#, c-format
+msgid ""
+" --mpi use MPI for parallelism or coupling\n"
+" [appnum]: number of this application in\n"
+" case of code coupling (default: 0)\n"
+msgstr ""
+" --mpi calcul parallèle ou couplé via MPI ;\n"
+" [appnum] : numéro de cette application en cas de\n"
+" couplage de codes (défaut : 0)\n"
+
+#: src/base/cs_opts.c:128
+#, c-format
+msgid " -q, --quality mesh quality verification mode\n"
+msgstr " -q, --quality vérification de la qualité du maillage\n"
+
+#: src/base/cs_opts.c:130
+#, c-format
+msgid ""
+" --cwf <criterion> cut warped faces\n"
+" -post: activate the post-processing related\n"
+" to the cutting of warped faces\n"
+msgstr ""
+" --cwf <critere> découpage des faces gauches\n"
+" (cut warped faces)\n"
+" -post : active le post-traitement lié au \n"
+" découpage des faces\n"
+
+#: src/base/cs_opts.c:134
+#, c-format
+msgid ""
+" --benchmark elementary operations performance\n"
+" [--mpitrace] operations done only once\n"
+" for light MPI traces\n"
+msgstr ""
+" --benchmark performance des opérations élémentaires\n"
+" [--mpitrace] opérations effectuées une seule\n"
+" fois pour traces MPI légères\n"
+
+#: src/base/cs_opts.c:138
+#, c-format
+msgid ""
+" --log output redirection for rank -1 or 0:\n"
+" 0: standard output\n"
+" 1: output in \"listing\" (default)\n"
+msgstr ""
+" --log redirection des sorties de rang -1 ou 0 :\n"
+" 0 : sortie standard\n"
+" 1 : sorties dans \"listing\" (défaut)\n"
+
+#: src/base/cs_opts.c:142
+#, c-format
+msgid ""
+" --logp output redirection for rank > 0:\n"
+" -1: remove output (default)\n"
+" 0: no redirection (if independant\n"
+" terminals, debugger type)\n"
+" 1: output in \"listing_n<rang>\"\n"
+msgstr ""
+" --logp redirection des sorties de rang > 0 :\n"
+" -1 : sorties supprimees (défaut)\n"
+" 0 : aucune redirection (si terminaux\n"
+" indépendants, type deboggeur)\n"
+" 1 : sorties dans \"listing_n<rang>\"\n"
+
+#: src/base/cs_opts.c:149
+#, c-format
+msgid " -p, --param <file_name> parameter file\n"
+msgstr " -p, --param <nom_du_fichier> fichier de paramètres\n"
+
+#: src/base/cs_opts.c:154
+#, c-format
+msgid ""
+" --syr-socket enable sockets for SYRTHES 3 coupling\n"
+" <port_num> port number on rank 0\n"
+msgstr ""
+
+#: src/base/cs_opts.c:159
+#, c-format
+msgid " --version print version number\n"
+msgstr " --version affiche le numéro de version\n"
+
+#: src/base/cs_opts.c:161
+#, c-format
+msgid ""
+" -h, --help this help message\n"
+"\n"
+msgstr ""
+" -h, --help appel de l'aide (cet affichage)\n"
+"\n"
+
+#: src/base/cs_opts.c:174
+#, c-format
+msgid "%s version %s\n"
+msgstr "%s version %s\n"
+
+#: src/base/cs_opts.c:327
+msgid "command: \n"
+msgstr "commande : \n"
+
+#: src/base/cs_opts.c:342
+#, c-format
+msgid " build %s\n"
+msgstr " build %s\n"
+
+#: src/base/cs_opts.c:346
+#, c-format
+msgid ""
+" MPI version %d.%d (%s)\n"
+"\n"
+msgstr ""
+" Version MPI %d.%d (%s)\n"
+"\n"
+
+#: src/base/cs_opts.c:349
+#, c-format
+msgid ""
+" MPI version %d.%d\n"
+"\n"
+msgstr ""
+" Version MPI %d.%d\n"
+"\n"
+
+#: src/base/cs_perio.c:344
+#, c-format
+msgid ""
+"The %d periodic transformations of the halo do not comply\n"
+"with the main mesh transformations (numbering %d).\n"
+msgstr ""
+"Les %d transformations périodiques du halo ne correspondent\n"
+"pas à celles du maillage principal (au nombre de %d).\n"
+
+#: src/base/cs_perio.c:651 src/base/cs_perio.c:793
+msgid "IDIMTE and/or ITENSO have incoherent values"
+msgstr "IDIMTE et/ou ITENSO ont des valeurs incohérentes"
+
+#: src/base/cs_perio.c:2527
+#, c-format
+msgid ""
+"Attempt to restore halo rotation elements on the\n"
+"variable defined with the adress %p, whereas the last\n"
+"variables of which the halo has been backed up are defined\n"
+"with [%p, %p, %p]."
+msgstr ""
+"On cherche à restaurer des éléments de rotation d'un\n"
+"halo sur la variable définie à partir de l'adresse %p,\n"
+"alors que les dernières variables dont le halo de rotation\n"
+"a été sauvegardé sont définies à partir de [%p, %p, %p]."
+
+#: src/base/cs_post.c:281
+#, c-format
+msgid ""
+"The requested post-processing writer number\n"
+"%d is not defined.\n"
+msgstr ""
+"Le gestionnaire de post traitement numéro %d demandé\n"
+"n'est pas défini.\n"
+
+#: src/base/cs_post.c:312
+#, c-format
+msgid ""
+"The requested post-processing mesh number\n"
+"%d is not defined.\n"
+msgstr ""
+"Le maillage de post traitement numéro %d demandé\n"
+"n'est pas défini.\n"
+
+#: src/base/cs_post.c:342
+msgid ""
+"The requested post-processing mesh number\n"
+"must be < 0 (reserved) or > 0 (user).\n"
+msgstr ""
+"Le numéro de maillage de post traitement demandé\n"
+"doit être < 0 (réservé) ou > 0 (utilisateur).\n"
+
+#: src/base/cs_post.c:348
+#, c-format
+msgid ""
+"The requested post-processing mesh number\n"
+"(%d) has already been assigned.\n"
+msgstr ""
+"Le numéro de maillage de post traitement demandé\n"
+"(%d) a déjà été affecté.\n"
+
+#: src/base/cs_post.c:770
+msgid "parallel domain"
+msgstr ""
+
+#: src/base/cs_post.c:948
+msgid "displacement"
+msgstr ""
+
+#: src/base/cs_post.c:1882
+#, c-format
+msgid ""
+"The PSTEVA sub-routine argument IVARPR must be\n"
+"equal to 0 or 1, and not %d.\n"
+msgstr ""
+"L'argument IVARPR du sous-programme PSTEVA doit être\n"
+"égal à 0 ou 1, et non %d.\n"
+
+#: src/base/cs_post.c:1891
+#, c-format
+msgid ""
+"The PSTEVA sub-routine argument IENTLA must be\n"
+"equal to 0 or 1, and not %d.\n"
+msgstr ""
+"L'argument IENTLA du sous-programme PSTEVA doit être\n"
+"égal à 0 ou 1, et non %d.\n"
+
+#: src/base/cs_post.c:1958
+msgid ""
+"The requested post-processing writer number\n"
+"must be < 0 (reserved) or > 0 (user).\n"
+msgstr ""
+"Le numéro de gestionnaire de post traitement demandé\n"
+"doit être < 0 (réservé) ou > 0 (utilisateur).\n"
+
+#: src/base/cs_post.c:1964
+#, c-format
+msgid ""
+"The requested post-processing writer number\n"
+"(%d) has already been assigned.\n"
+msgstr ""
+"Le numéro de gestionnaire de post traitement demandé\n"
+"(%d) a déjà été affecté.\n"
+
+#: src/base/cs_post.c:2267
+#, c-format
+msgid ""
+"The mesh %d cannot be an alias of mesh %d,\n"
+"which is itself an alias of mesh %d.\n"
+msgstr ""
+"Le maillage %d ne peut être un alias du maillage %d,\n"
+"qui est lui-même déjà un alias du maillage %d.\n"
+
+#: src/base/cs_post.c:2332 src/base/cs_post.c:2335
+msgid " edges"
+msgstr ""
+
+#: src/base/cs_post.c:3224
+#, c-format
+msgid ""
+"\n"
+"Writing of \"%s\" (%s) summary:\n"
+"\n"
+" CPU time for meshes: %12.3f\n"
+" CPU time for variables: %12.3f\n"
+"\n"
+" Elapsed time for meshes: %12.3f\n"
+" Elapsed time for variables: %12.3f\n"
+msgstr ""
+"\n"
+"Bilan des écritures de \"%s\" (%s) :\n"
+"\n"
+" Temps CPU pour les maillages : %12.3f\n"
+" Temps CPU pour les champs : %12.3f\n"
+"\n"
+" Temps écoulé pour les maillages : %12.3f\n"
+" Temps écoulé pour les champs : %12.3f\n"
+
+#: src/base/cs_post.c:3396
+msgid "Boundary"
+msgstr "Bord"
+
+#: src/base/cs_post.c:3520
+msgid "Calculation domain"
+msgstr "Domaine de calcul"
+
+#: src/base/cs_preprocessor_data.c:252
+#, c-format
+msgid " Adding periodicity %d (translation [%10.4e, %10.4e, %10.4e]).\n"
+msgstr " Ajout de la périodicité %d (translation [%10.4e, %10.4e, %10.4e]).\n"
+
+#: src/base/cs_preprocessor_data.c:257
+#, c-format
+msgid " Adding periodicity %d (rotation).\n"
+msgstr " Ajout de la périodicité %d (rotation).\n"
+
+#: src/base/cs_preprocessor_data.c:335 src/base/cs_preprocessor_data.c:2129
+#, c-format
+msgid ""
+"Message of type <%s> on <%s>\n"
+"unexpected or of incorrect size"
+msgstr ""
+"Message de type <%s> sur <%s>\n"
+"inattendu ou de taille incorrecte"
+
+#: src/base/cs_preprocessor_data.c:352
+#, c-format
+msgid ""
+" No \"%s\" file available;\n"
+" an unoptimized domain partitioning will be used.\n"
+msgstr ""
+" Pas de fichier \"%s\" disponible ;\n"
+" un découpage de domaines non optimisé sera utilisé.\n"
+
+#: src/base/cs_preprocessor_data.c:400
+#, c-format
+msgid ""
+"The number of cells reported by file\n"
+"\"%s\" (%lu)\n"
+"does not correspond the those of the mesh (%lu)."
+msgstr ""
+"Le nombre de cellules indiqué par le fichier\n"
+"\"%s\" (%lu)\n"
+"ne correspond pas au maillage courant (%lu)."
+
+#: src/base/cs_preprocessor_data.c:421
+#, c-format
+msgid ""
+"Le number of ranks reported by file\n"
+"\"%s\" (%d) does not\n"
+"correspond to the current number of ranks (%d)."
+msgstr ""
+"Le nombre de rangs indiqué par le fichier\n"
+"\"%s\" (%d)\n"
+"ne correspond pas au nombre de rangs courant (%d)."
+
+#: src/base/cs_preprocessor_data.c:1516 src/base/cs_preprocessor_data.c:1776
+#, c-format
+msgid ""
+"Number of cells on rank %d is zero.\n"
+"(number of cells / number of processes ratio too low)."
+msgstr ""
+"Le nombre de cellules pour le rang %d est nul.\n"
+"(rapport nombre de cellules / nombre de processeurs trop faible)."
+
+#: src/base/cs_preprocessor_data.c:2429
+#, c-format
+msgid ""
+"Section of type <%s> on <%s>\n"
+"inexpected or of incorrect size."
+msgstr ""
+"Section de type <%s> sur <%s>\n"
+"inattendue ou de taille incorrecte"
+
+#: src/base/cs_proxy_comm.c:161
+#, c-format
+msgid ""
+"Communication %s:\n"
+"Error receiving data through socket."
+msgstr ""
+"Communication %s :\n"
+"Erreur de réception de données par socket."
+
+#: src/base/cs_proxy_comm.c:223
+#, c-format
+msgid ""
+"Communication %s:\n"
+"Error sending data through socket."
+msgstr ""
+"Communication %s :\n"
+"Erreur d'envoi de données par socket."
+
+#: src/base/cs_proxy_comm.c:243
+#, c-format
+msgid ""
+"Communication %s:\n"
+"Error closing socket."
+msgstr ""
+"Communication %s :\n"
+"Erreur à la fermeture du socket."
+
+#: src/base/cs_proxy_comm.c:290
+msgid "Error initializing socket communication."
+msgstr "Erreur à l'initialisation de la communication par sockets."
+
+#: src/base/cs_proxy_comm.c:309
+#, c-format
+msgid "Socket communication: host \"%s\" unknown."
+msgstr "Communication par sockets : hôte \"%s\" inconnu."
+
+#: src/base/cs_proxy_comm.c:326
+#, c-format
+msgid ""
+"Socket communication: error connecting to\n"
+"%s (port %d)."
+msgstr ""
+"Communication par sockets : erreur de connexion à\n"
+"%s (port %d)."
+
+#: src/base/cs_proxy_comm.c:370
+msgid "Handshake with proxy failed."
+msgstr "Échec de la \"poignée de main\" avec le proxy."
+
+#: src/base/cs_proxy_comm.c:432
+#, c-format
+msgid "Connecting to proxy: %s ..."
+msgstr "Connexion au proxy : %s ..."
+
+#: src/base/cs_proxy_comm.c:434
+msgid "Connecting to proxy ..."
+msgstr "Connexion au proxy ..."
+
+#: src/base/cs_proxy_comm.c:451
+#, c-format
+msgid ""
+"Library compiled without sockets support, so the communicator\n"
+"type argument to cs_proxy_comm_initialize() must be different\n"
+"from CS_PROXY_COMM_TYPE_SOCKET (%d)."
+msgstr ""
+"Librarie compilée sans support des sockets support, donc l'argument\n"
+"de type du communicator dans l'appel à cs_proxy_comm_initialize()\n"
+"doit être différent de CS_PROXY_COMM_TYPE_SOCKET (%d)."
+
+#: src/base/cs_proxy_comm.c:486
+#, c-format
+msgid "Closing communication: %s\n"
+msgstr "Fermeture de la communication : %s\n"
+
+#: src/base/cs_renumber.c:890
+#, c-format
+msgid ""
+"\n"
+" Vectorization:\n"
+" --------------\n"
+" interior faces: %d ranks (of %d)\n"
+" boundary faces: %d ranks\n"
+"\n"
+msgstr ""
+
+#: src/base/cs_restart.c:259
+#, c-format
+msgid ""
+"Location number %d given for restart file\n"
+"\"%s\" is not valid."
+msgstr ""
+"Le numéro de support %d donné pour le fichier suite\n"
+"\"%s\" est invalide."
+
+#: src/base/cs_restart.c:297
+#, c-format
+msgid ""
+"Restart file \"%s\" declares a location number %d\n"
+"but no location %d has been declared."
+msgstr ""
+"Le fichier suite \"%s\" déclare un support numéro %d\n"
+"alors qu'aucun support numéro %d n'a été déclaré."
+
+#: src/base/cs_restart.c:603 src/base/cs_restart.c:935
+#, c-format
+msgid ""
+"Restart file number <%d> can not be closed\n"
+"(file already closed or invalid number)."
+msgstr ""
+"Le fichier suite numéro <%d> ne peut être fermé\n"
+"(fichier déjà fermé ou numéro invalide)."
+
+#: src/base/cs_restart.c:639
+#, c-format
+msgid ""
+"Location type <%d> given for a restart file section\n"
+"is invalid using the Fortran API."
+msgstr ""
+"Le type de support <%d> indiqué pour une rubrique de\n"
+"fichier suite est invalide pour l'interface Fortran."
+
+#: src/base/cs_restart.c:660
+#, c-format
+msgid ""
+"Value type <%d> given for a restart file section\n"
+"is invalid using the Fortran API."
+msgstr ""
+"Le type de valeur <%d> indiqué pour une rubrique de\n"
+"fichier suite est invalide pour l'interface Fortran."
+
+#: src/base/cs_restart.c:874
+#, c-format
+msgid ""
+"The access mode of the restart file <%s>\n"
+"must be equal to 1 (read) or 2 (write) and not <%d>."
+msgstr ""
+"Le mode d'ouverture du fichier suite <%s>\n"
+"doit être égal à 1 (lecture) ou 2 (écriture) et non <%d>."
+
+#: src/base/cs_restart.c:989 src/base/cs_restart.c:1040
+#, c-format
+msgid ""
+"Information on the restart file number <%d> unavailable\n"
+"(file already closed or invalid number)."
+msgstr ""
+"Infomation sur le fichier suite numéro <%d> indisponible\n"
+"(fichier déjà fermé ou numéro invalide)."
+
+#: src/base/cs_restart.c:1374
+#, c-format
+msgid ""
+"The size of location \"%s\" associated with\n"
+"the restart file \"%s\" is %lu and does not\n"
+"correspond to that of the current mesh (%lu).\n"
+msgstr ""
+"La taille du support \"%s\" associé au fichier suite\n"
+"\"%s\" vaut %lu et ne correspond pas\n"
+"à celle du maillage en cours (%lu).\n"
+
+#: src/base/cs_restart.c:1435
+#, c-format
+msgid ""
+"The restart file \"%s\" references no\n"
+"location named \"%s\"."
+msgstr ""
+"\"Le fichier suite \\\"%s\\\" ne contient \\n\"\n"
+"\" aucun support de nom \\\"%s\\\".\""
+
+#: src/base/cs_restart.c:1495
+#, c-format
+msgid ""
+" Location: %s\n"
+" (number: %03d, n_glob_ents: %lu)\n"
+msgstr ""
+" Support : %s\n"
+" (numéro : %03d, n_glob_ents : %lu)\n"
+
+#: src/base/cs_restart.c:1504
+msgid " General information associated with the restart file:\n"
+msgstr " Informations générales associées au fichier suite :\n"
+
+#: src/base/cs_restart.c:1809
+#, c-format
+msgid ""
+"\n"
+"Checkpoint / restart files summary:\n"
+"\n"
+" Number of files read: %3d\n"
+" Number of files written: %3d\n"
+"\n"
+" Elapsed time for reading: %12.3f\n"
+" Elapsed time for writing: %12.3f\n"
+msgstr ""
+"\n"
+"Bilan des écriture / lecture des fichiers de redémarrage :\n"
+"\n"
+" Nombre de fichiers lus : %3d\n"
+" Nombre de fichiers écrits : %3d\n"
+"\n"
+" Temps écoulé pour la lecture : %12.3f\n"
+" Temps écoulé pour l'écriture : %12.3f\n"
+
+#: src/base/cs_sat_coupling.c:182
+#, c-format
+msgid ""
+"Coupling definition is impossible: a distant root rank equal to\n"
+"%d is required, whereas the local group corresponds to\n"
+"rank %d to %d\n"
+msgstr ""
+"Définition du couplage impossible : on demande un rang de\n"
+"tête de groupe distant égal à %d, alors que le groupe\n"
+"local correspond aux rangs %d à %d\n"
+
+#: src/base/cs_sat_coupling.c:189
+#, c-format
+msgid ""
+"Coupling definition is impossible: a distant root rank equal to\n"
+"%d is required, whereas the global ranks (MPI_COMM_WORLD)\n"
+"range from to 0 to %d\n"
+msgstr ""
+"Définition du couplage impossible : on demande un rang de\n"
+"tête de groupe distant égal à %d, alors que les rangs\n"
+"globaux (MPI_COMM_WORLD) s'étendent de 0 à %d\n"
+
+#: src/base/cs_sat_coupling.c:217
+#, c-format
+msgid "coupling: local_ranks = [%d..%d], distant ranks = [%d..%d]\n"
+msgstr "couplage : rangs locaux = [%d..%d], rangs distants = [%d..%d]\n"
+
+#: src/base/cs_sat_coupling.c:662 src/base/cs_sat_coupling.c:807
+#: src/base/cs_sat_coupling.c:874 src/base/cs_sat_coupling.c:949
+#: src/base/cs_sat_coupling.c:1010 src/base/cs_sat_coupling.c:1080
+#: src/base/cs_sat_coupling.c:1178 src/base/cs_sat_coupling.c:1257
+#: src/base/cs_sat_coupling.c:1348 src/base/cs_sat_coupling.c:1424
+#: src/base/cs_sat_coupling.c:1492
+#, c-format
+msgid "Impossible coupling number %d; there are %d couplings"
+msgstr "Numéro de couplage %d impossible ; on a %d couplages"
+
+#: src/base/cs_sat_coupling.c:887
+#, c-format
+msgid ""
+"Coupling %d: inconsistent arguments for LELCPL()\n"
+"NCECPL = %d and NFBCPL = %d are indicated.\n"
+"The values for this coupling should be %d and %d."
+msgstr ""
+"Couplage %d: arguments incohérents pour LELCPL().\n"
+"On a indiqué NCECPL = %d et NFBCPL = %d.\n"
+"On devrait avoir les valeurs %d et %d pour ce couplage."
+
+#: src/base/cs_sat_coupling.c:962
+#, c-format
+msgid ""
+"Coupling %d: inconsistent arguments for LELNCP()\n"
+"NCENCP = %d and NFBNCP = %d are indicated.\n"
+"The values for this coupling should be %d and %d."
+msgstr ""
+"Couplage %d: arguments incohérents pour LELNCP().\n"
+"On a indiqué NCENCP = %d et NFBNCP = %d.\n"
+"On devrait avoir les valeurs %d et %d pour ce couplage."
+
+#: src/base/cs_sat_coupling.c:1104
+#, c-format
+msgid ""
+"Coupling %d: inconsistent arguments for COOCPL()\n"
+"ITYDIS = %d and NBRPTS = %d are indicated.\n"
+"The value for NBRPTS should be %d."
+msgstr ""
+"Couplage %d: arguments incohérents pour COOCPL().\n"
+"On a indiqué ITYDIS = %d et NBRPTS = %d.\n"
+"On devrait avoir la valeur %d pour NBRPTS."
+
+#: src/base/cs_sat_coupling.c:1185
+msgid ""
+"The centred interpolation scheme is not available\n"
+"when coupling cells"
+msgstr ""
+
+#: src/base/cs_sat_coupling.c:1196
+#, c-format
+msgid ""
+"Coupling %d: inconsistent arguments for PNDCPL().\n"
+"ITYLOC = %d and NBRPTS = %d are indicated.\n"
+"NBRPTS should be %d."
+msgstr ""
+"Couplage %d: arguments incohérents pour PNDCPL().\n"
+"On a indiqué ITYLOC = %d et NBRPTS = %d.\n"
+"On devrait avoir la valeur %d pour NBRPTS."
+
+#: src/base/cs_sat_coupling.c:1274
+#, c-format
+msgid ""
+"Coupling %d: inconsistent arguments for VARCPL()\n"
+"ITYVAR = %d and NBRDIS = %d are indicated.\n"
+"NBRDIS should be 0 or %d."
+msgstr ""
+"Couplage %d: arguments incohérents pour VARCPL().\n"
+"On a indiqué ITYVAR = %d et NBRDIS = %d.\n"
+"On devrait avoir la valeur 0 ou %d pour NBRDIS."
+
+#: src/base/cs_sat_coupling.c:1281
+#, c-format
+msgid ""
+"Coupling %d: inconsistent arguments for VARCPL()\n"
+"ITYVAR = %d and NBRLOC = %d are indicated.\n"
+"NBRLOC should be 0 or %d."
+msgstr ""
+"Couplage %d: arguments incohérents pour VARCPL().\n"
+"On a indiqué ITYVAR = %d et NBRLOC = %d.\n"
+"On devrait avoir la valeur 0 ou %d pour NBRLOC."
+
+#: src/base/cs_selector.c:279
+#, c-format
+msgid ""
+"The group or attribute \"%s\" in the selection\n"
+"criteria:\n"
+"\"%s\"\n"
+" does not correspond to any interior face.\n"
+msgstr ""
+"Le groupe ou attribut \"%s\" figurant dans le\n"
+"critère de sélection:\n"
+"\"%s\"\n"
+" ne correspond à aucune face interne.\n"
+
+#: src/base/cs_sles.c:174
+msgid "Conjugate gradient"
+msgstr "Gradient conjugué"
+
+#: src/base/cs_sles.c:175
+msgid "Jacobi"
+msgstr "Jacobi"
+
+#: src/base/cs_sles.c:176
+msgid "Bi-CGstab"
+msgstr "Bi-CGstab"
+
+#: src/base/cs_sles.c:249
+#, c-format
+msgid ""
+"\n"
+"Summary of resolutions for %s (%s):\n"
+"\n"
+" Number of calls: %d\n"
+" Minimum number of iterations: %d\n"
+" Maximum number of iterations: %d\n"
+" Mean number of iterations: %d\n"
+" Total elapsed time: %12.3f\n"
+msgstr ""
+"\n"
+"Bilan des résolutions pour \"%s\" (%s) :\n"
+"\n"
+" Nombre d'appels : %d\n"
+" Nombre d'itérations minimal : %d\n"
+" Nombre d'itérations maximal : %d\n"
+" Nombre d'itérations moyen : %d\n"
+" Temps écoulé cumulé : %12.3f\n"
+
+#: src/base/cs_sles.c:275
+#, c-format
+msgid ""
+" Min local total CPU time: %12.3f\n"
+" Max local total CPU time: %12.3f\n"
+" Total CPU time: %12.3f\n"
+msgstr ""
+" Temps CPU cumulé local min : %12.3f\n"
+" Temps CPU cumulé local max : %12.3f\n"
+" Temps CPU cumulé total : %12.3f\n"
+
+#: src/base/cs_sles.c:285
+#, c-format
+msgid " Total CPU time: %12.3f\n"
+msgstr " Temps CPU cumulé : %12.3f\n"
+
+#: src/base/cs_sles.c:394
+msgid " n_iter res_abs res_nor\n"
+msgstr " n_iter res_abs res_nor\n"
+
+#: src/base/cs_sles.c:424 src/base/cs_sles.c:1370
+#, c-format
+msgid " n_iter : %5d, res_abs : %11.4e, res_nor : %11.4e\n"
+msgstr " n_iter : %5d, res_abs : %11.4e, res_nor : %11.4e\n"
+
+#: src/base/cs_sles.c:450
+#, c-format
+msgid ""
+"\n"
+"\n"
+"%s [%s]: divergence after %u iterations:\n"
+" initial residual: %11.4e; current residual: %11.4e\n"
+msgstr ""
+"\n"
+"\n"
+"%s [%s] : divergence après %u itérations :\n"
+" résidu initial : %11.4e ; résidu courant : %11.4e\n"
+
+#: src/base/cs_sles.c:468
+msgid " @@ Warning: non convergence\n"
+msgstr " @@ Attention : non convergence\n"
+
+#: src/base/cs_sles.c:1382
+#, c-format
+msgid ""
+"\n"
+"\n"
+"%s [%s]:\n"
+" @@ Warning: non convergence and abort\n"
+"\n"
+" Alpha coefficient is lower than %12.4e\n"
+"\n"
+" The matrix cannot be considered as invertible anymore."
+msgstr ""
+"\n"
+"\n"
+"%s [%s]:\n"
+" @@ Attention : non convergence et arrêt\n"
+"\n"
+" Le coefficient alpha est inférieur à %12.4e\n"
+"\n"
+" La matrice ne peut plus être considérée come inversible."
+
+#: src/base/cs_sles.c:1448
+#, c-format
+msgid ""
+"\n"
+"\n"
+"%s [%s]:\n"
+" @@ Warning: non convergence and abort\n"
+"\n"
+" The square of the norm of the descent vector\n"
+" is lower than %12.4e\n"
+"\n"
+" The resolution does not progress anymore."
+msgstr ""
+"\n"
+"\n"
+"%s [%s]:\n"
+" @@ Attention : non convergence et arrêt\n"
+"\n"
+" Le carre de la norme du vecteur de descente\n"
+" est inférieur à %12.4e\n"
+"\n"
+" La résolution ne progresse plus."
+
+#: src/base/cs_sles.c:1756
+#, c-format
+msgid "%s: error (divergence) solving for %s"
+msgstr ""
+
+#: src/base/cs_sles.c:1871
+#, c-format
+msgid ""
+"%s [%s]:\n"
+" immediate exit; r_norm = %11.4e, residual = %11.4e\n"
+msgstr ""
+"%s [%s]:\n"
+" sortie immédiate ; r_norm = %11.4e, residu = %11.4e\n"
+
+#: src/base/cs_syr3_comm.c:151
+#, c-format
+msgid "Error in socket communication: %s (node %4d)\n"
+msgstr "Erreur pour la communication par socket : %s (noeud %4d)\n"
+
+#: src/base/cs_syr3_comm.c:175
+#, c-format
+msgid ""
+"MPI error for communication: %s\n"
+"Error type: %s"
+msgstr ""
+"Erreur MPI pour la communication : %s\n"
+"Type d'erreur : %s"
+
+#: src/base/cs_syr3_comm.c:204
+#, c-format
+msgid ""
+"Impossible to establish the communication: %s\n"
+"because the requested process rank (%d)\n"
+"is greater than or equal to the number of MPI processes (%d)"
+msgstr ""
+"Impossible d'établir la communication : %s\n"
+"car le rang du processus recherché (%d)\n"
+"est supérieur ou égal au nombre de processus MPI (%d)."
+
+#: src/base/cs_syr3_comm.c:228
+#, c-format
+msgid ""
+"Error for communication: \"%s\".\n"
+"The interface version is not correct.\n"
+"The magic string indicates an incorrect interface format version.\n"
+"magic string read: \"%s\"\n"
+"magic string expected: \"%s\"\n"
+msgstr ""
+"Erreur pour la communication : \"%s\".\n"
+"Le format de l'interface n'est pas à la bonne version.\n"
+"La chaîne magique indique une mauvaise version du format de l'interface.\n"
+"chaîne magique lue : \"%s\"\n"
+"chaîne magique attendue : \"%s\"\n"
+
+#: src/base/cs_syr3_comm.c:488
+#, c-format
+msgid ""
+"Communication %s:\n"
+"Error while receiving data by socket.\n"
+msgstr ""
+"Communication %s :\n"
+"Erreur de réception de données par socket.\n"
+
+#: src/base/cs_syr3_comm.c:570
+#, c-format
+msgid ""
+"Communication %s:\n"
+"Error sending data by socket.\n"
+msgstr ""
+"Communication %s :\n"
+"Erreur d'envoi de données par socket.\n"
+
+#: src/base/cs_syr3_comm.c:626 src/base/cs_syr3_comm.c:679
+#: src/base/cs_syr3_comm.c:688 src/base/cs_syr3_comm.c:696
+msgid "Error in socket communication\n"
+msgstr "Erreur de communication par socket\n"
+
+#: src/base/cs_syr3_comm.c:646
+msgid ""
+"Error while sending the host name through MPI in sockets initialization.\n"
+msgstr ""
+"Erreur lors de l'envoi via MPI du nom de l'hôte en initialisant les "
+"sockets.\n"
+
+#: src/base/cs_syr3_comm.c:656
+msgid ""
+"Error while sending the port number through MPI in sockets initialization.\n"
+msgstr ""
+"Erreur lors de l'envoi via MPI du numéro du port en initialisant les "
+"sockets.\n"
+
+#: src/base/cs_syr3_comm.c:666
+msgid "MPI is needed for socket initialization.\n"
+msgstr "Besoin de MPI lors de l'initialisation des sockets.\n"
+
+#: src/base/cs_syr3_comm.c:734
+msgid ""
+"Attempt to connect to the communication port with\n"
+"an unknown message format\n"
+msgstr ""
+"Tentative de connexion au port de communication avec\n"
+"un format de message non reconnu\n"
+
+#: src/base/cs_syr3_comm.c:753
+#, c-format
+msgid ""
+"Error while initializating communication: \"%s\".\n"
+"The interface version is not correct.\n"
+"The magic string indicates the interface format version:\n"
+"magic string read: \"%s\"\n"
+"magic string expected: \"%s\"\n"
+msgstr ""
+"Erreur à l'initialisation de la communication : \"%s\".\n"
+"Le format de l'interface n'est pas à la bonne version.\n"
+"La chaîne magique repère la version du format d'interface :\n"
+"chaîne magique lue : \"%s\"\n"
+"chaîne magique actuelle : \"%s\"\n"
+
+#: src/base/cs_syr3_comm.c:780
+#, c-format
+msgid ""
+"Communication %s):\n"
+"Error closing the socket.\n"
+msgstr ""
+"Communication %s) :\n"
+"Erreur à la fermeture du socket.\n"
+
+#: src/base/cs_syr3_comm.c:800
+#, c-format
+msgid ""
+"\n"
+"Message received on \"%s\":\n"
+msgstr ""
+"\n"
+"Message reçu sur \"%s\" :\n"
+
+#: src/base/cs_syr3_comm.c:803
+#, c-format
+msgid ""
+"\n"
+"Message sent on \"%s\":\n"
+msgstr ""
+"\n"
+"Message envoyé sur \"%s\" :\n"
+
+#: src/base/cs_syr3_comm.c:825
+#, c-format
+msgid ""
+" section name: \"%s\"\n"
+" number of elements: %d\n"
+msgstr ""
+" nom de la rubrique : \"%s\"\n"
+" nombre d'éléments : %d\n"
+
+#: src/base/cs_syr3_comm.c:1017
+#, c-format
+msgid ""
+"\n"
+" Opening communication: %s ..."
+msgstr ""
+"\n"
+" Ouverture de la communication : %s ..."
+
+#: src/base/cs_syr3_comm.c:1063
+#, c-format
+msgid ""
+"\n"
+" Closing communication: %s\n"
+msgstr ""
+"\n"
+" Fermeture de la communication : %s\n"
+
+#: src/base/cs_syr3_comm.c:1536 src/base/cs_syr3_comm.c:1574
+#: src/base/cs_syr3_comm.c:1578 src/base/cs_syr3_comm.c:1586
+msgid "Initialization error for socket communication support.\n"
+msgstr "Erreur d'initialisation du support de communication par socket.\n"
+
+#: src/base/cs_syr3_comm.c:1564
+msgid "Error obtaining computer's name"
+msgstr "Erreur de récupération du nom de la machine"
+
+#: src/base/cs_syr3_comm.c:1633
+msgid ""
+"\n"
+"Closing socket...\t [ok]\n"
+msgstr ""
+"\n"
+"Fermeture du socket ...\t [ok]\n"
+
+#: src/base/cs_syr3_coupling.c:228
+#, c-format
+msgid ""
+"\n"
+"Extracting \"%s\" mesh\n"
+msgstr ""
+"\n"
+"Extraction du maillage \"%s\"\n"
+
+#: src/base/cs_syr3_coupling.c:263
+msgid ""
+"\n"
+" *** Renumbering of the boundary faces list ..."
+msgstr ""
+"\n"
+" *** Renumerotation de la liste des faces de bord ..."
+
+#: src/base/cs_syr3_coupling.c:827 src/base/cs_syr4_coupling.c:624
+msgid "Wall T"
+msgstr "T Paroi"
+
+#: src/base/cs_syr3_coupling.c:837 src/base/cs_syr4_coupling.c:624
+msgid "Flux"
+msgstr "Flux"
+
+#: src/base/cs_syr3_coupling.c:1096
+msgid ""
+"Coupling with SYRTHES impossible.\n"
+"No selection criteria for faces to couple."
+msgstr ""
+"Couplage avec SYRTHES impossible.\n"
+"Aucun critère de sélection pour les faces à coupler."
+
+#: src/base/cs_syr3_coupling.c:1223
+msgid ""
+"\n"
+"Structures associated with SYRTHES 3 coupling freed.\n"
+msgstr ""
+"\n"
+"Libération des structures associées au couplage avec SYRTHES 3.\n"
+
+#: src/base/cs_syr3_coupling.c:1253 src/base/cs_syr4_coupling.c:977
+#, c-format
+msgid ""
+"\n"
+" ** Processing the mesh for SYRTHES coupling \"%d\"\n"
+"\n"
+msgstr ""
+"\n"
+" ** Traitement du maillage pour le couplage SYRTHES \"%d\"\n"
+"\n"
+
+#: src/base/cs_syr3_coupling.c:1275
+msgid ""
+"Coupling with SYRTHES impossible.\n"
+"No face to couple.\n"
+msgstr ""
+"Couplage avec SYRTHES impossible.\n"
+"Aucune face à coupler.\n"
+
+#: src/base/cs_syr3_coupling.c:1283
+#, c-format
+msgid "Triangulation of the extracted mesh (%d faces) ..."
+msgstr "Triangulation du maillage extrait (%d faces) ..."
+
+#: src/base/cs_syr3_coupling.c:1296
+#, c-format
+msgid "Splitting the extracted mesh in edges (%d faces) ..."
+msgstr "Décomposition en arêtes du maillage extrait (%d faces) ..."
+
+#: src/base/cs_syr3_coupling.c:1311
+msgid "Error triangulating the extracted mesh before sending to SYRTHES.\n"
+msgstr "Erreur lors du découpage du maillage extrait avant envoi à Syrthes.\n"
+
+#: src/base/cs_syr3_coupling.c:1405
+#, c-format
+msgid ""
+"\n"
+"Extracted mesh built of %d triangles"
+msgstr ""
+"\n"
+"Maillage extrait composé de %d triangles"
+
+#: src/base/cs_syr3_coupling.c:1407
+#, c-format
+msgid ""
+"\n"
+"Extracted mesh built of %d edges"
+msgstr ""
+"\n"
+"Maillage extrait composé de %d arêtes"
+
+#: src/base/cs_syr3_coupling.c:1411
+#, c-format
+msgid " and %d vertices (locally)\n"
+msgstr " et %d sommets (localement)\n"
+
+#: src/base/cs_syr3_coupling.c:1491
+msgid "\tInterpolation from vertices to elements ..."
+msgstr "\tInterpolation des sommets vers les éléments ..."
+
+#: src/base/cs_syr3_coupling.c:1580
+msgid "\tInterpolation from elements to vertices ..."
+msgstr "\tInterpolation des éléments sur les sommets ..."
+
+#: src/base/cs_syr3_messages.c:157 src/base/cs_syr4_coupling.c:934
+#, c-format
+msgid ""
+"========================================================\n"
+" ** Stop on SYRTHES request\n"
+" -----------------------\n"
+" received message: \"%s\"\n"
+"========================================================\n"
+msgstr ""
+"========================================================\n"
+" ** Arret par demande de SYRTHES\n"
+" ----------------------------\n"
+" message recu : \"%s\"\n"
+"========================================================\n"
+
+#: src/base/cs_syr3_messages.c:172
+#, c-format
+msgid ""
+"========================================================\n"
+" ** Unexpected message in cs_syr3_messages_test_iter\n"
+" ------------------------------------------------\n"
+" received message: \"%s\"\n"
+" expected message: cmd:iter:start \n"
+"========================================================\n"
+msgstr ""
+"========================================================\n"
+" ** Message inattendu dans cs_syr3_messages_test_iter\n"
+" -------------------------------------------------\n"
+" message reçu : \"%s\"\n"
+" message attendu : cmd:iter:start\n"
+"========================================================\n"
+
+#: src/base/cs_syr3_messages.c:276 src/base/cs_syr3_messages.c:359
+#: src/base/cs_syr_coupling.c:793 src/base/cs_syr_coupling.c:834
+#: src/base/cs_syr_coupling.c:873 src/base/cs_syr_coupling.c:912
+#, c-format
+msgid "SYRTHES coupling number %d impossible; there are %d couplings"
+msgstr "Numéro de couplage SYRTHES %d impossible ; on a %d couplages"
+
+#: src/base/cs_syr3_messages.c:307
+#, c-format
+msgid ""
+"Unexpected message in the SYRTHES coupling %d:\n"
+" expected \"%s\" (%d elements, type %d)\n"
+" received \"%s\" (%d elements, type %d)\n"
+msgstr ""
+"Message inatendu dans le couplage SYRTHES %d :\n"
+" on attendait \"%s\" (%d éléments, type %d)\n"
+" on a reçu \"%s\"(%d éléments, type %d)\n"
+
+#: src/base/cs_syr4_coupling.c:200
+#, c-format
+msgid " SYRTHES coupling %d: initializing MPI communication ... "
+msgstr " Couplage SYRTHES %d : initialisation de la communication MPI ..."
+
+#: src/base/cs_syr4_coupling.c:211
+#, c-format
+msgid ""
+" Local ranks = [%d..%d], distant ranks = [%d..%d].\n"
+"\n"
+msgstr "Rangs locaux = [%d..%d], rangs distants = [%d..%d].\n"
+
+#: src/base/cs_syr4_coupling.c:350
+msgid ""
+"\n"
+"Extracting coupled mesh ..."
+msgstr ""
+"\n"
+"Extraction du maillage couplé ..."
+
+#: src/base/cs_syr4_coupling.c:358
+#, c-format
+msgid "SYRTHES_cells_%d"
+msgstr "Cellules_SYRTHES_%d"
+
+#: src/base/cs_syr4_coupling.c:379
+#, c-format
+msgid "SYRTHES_faces_%d"
+msgstr "Faces_SYRTHES_%d"
+
+#: src/base/cs_syr4_coupling.c:406
+#, c-format
+msgid ""
+" Selection criteria:\n"
+" \"%s\"\n"
+" leads to an empty mesh for SYRTHES coupling.\n"
+msgstr ""
+" Le critère de sélection :\n"
+" \"%s\"\n"
+" produit un maillage vide pour le couplage SYRTHES.\n"
+
+#: src/base/cs_syr4_coupling.c:421
+msgid "Projecting the extracted mesh to 2D ..."
+msgstr "Projection 2D du maillage extrait ..."
+
+#: src/base/cs_syr4_coupling.c:429
+msgid "Error projecting the extracted mesh."
+msgstr "Erreur lors de la projection du maillage extrait."
+
+#: src/base/cs_syr4_coupling.c:456
+#, c-format
+msgid ""
+"\n"
+"Extracted mesh built of %lu elements.\n"
+msgstr ""
+"\n"
+"Maillage extrait composé de %lu éléments.\n"
+
+#: src/base/cs_syr4_coupling.c:507
+#, c-format
+msgid ""
+"Coupling with SYRTHES impossible:\n"
+"%lu element centers from mesh \"%s\"\n"
+"not located on SYRTHES mesh."
+msgstr ""
+"Couplage avec SYRTHES impossible :\n"
+"%lu centres d'éléments du maillage \"%s\"\n"
+"non localisés sur le maillage SYRTHES."
+
+#: src/base/cs_syr4_coupling.c:763
+msgid ""
+"Coupling with SYRTHES impossible.\n"
+"No selection criteria for faces or cells to couple."
+msgstr ""
+"Couplage avec SYRTHES impossible.\n"
+"Aucun critère de sélection pour les faces ou les cellules à coupler."
+
+#: src/base/cs_syr4_coupling.c:831
+msgid ""
+"\n"
+"Structures associated with SYRTHES 4 coupling freed.\n"
+msgstr ""
+"\n"
+"Libération des structures associées au couplage avec SYRTHES 4.\n"
+
+#: src/base/cs_syr4_coupling.c:878
+#, c-format
+msgid ""
+"========================================================\n"
+" ** Incompatible SYRTHES coupling options:\n"
+" ------------------------------------------------\n"
+" Code_Saturne options: \"%s\"\n"
+" SYRTHES options: \"%s\"\n"
+"========================================================\n"
+msgstr ""
+"========================================================\n"
+" ** Options de couplage avec SYRTHES incompatibles :\n"
+" ------------------------------------------------ \n"
+" Options Code_Saturne : \"%s\"\n"
+" Options SYRTHES : \"%s\"\n"
+"========================================================\n"
+
+#: src/base/cs_syr4_coupling.c:949
+#, c-format
+msgid ""
+"========================================================\n"
+" ** Unexpected message in cs_syr4_messages_test_iter\n"
+" ------------------------------------------------\n"
+" received message: \"%s\"\n"
+" expected message: cmd:iter:start \n"
+"========================================================\n"
+msgstr ""
+"========================================================\n"
+" ** Message inattendu dans cs_syr4_messages_test_iter\n"
+" -------------------------------------------------\n"
+" message reçu : \"%s\"\n"
+" message attendu : cmd:iter:start\n"
+"========================================================\n"
+
+#: src/base/cs_syr4_coupling.c:1008
+#, c-format
+msgid ""
+" Message received from SYRTHES: \"%s\"\n"
+" indicates an error or is unexpected."
+msgstr ""
+" Le message reçu de SYRTHES: \"%s\"\n"
+" indique une erreur ou est inattendu."
+
+#: src/base/cs_syr4_coupling.c:1013
+#, c-format
+msgid ""
+"\n"
+" ** Mesh located for SYRTHES coupling \"%d\".\n"
+"\n"
+msgstr ""
+"\n"
+" ** Localisation du maillage pour le couplage SYRTHES \"%d\".\n"
+"\n"
+
+#: src/base/cs_syr_coupling.c:192
+#, c-format
+msgid ""
+" SYRTHES coupling:\n"
+" coupling id: %d\n"
+" local name: \"%s\"\n"
+" local number: %d\n"
+"\n"
+msgstr ""
+" Couplage SYRTHES :\n"
+" id de couplage : %d\n"
+" nom local : \"%s\"\n"
+" numéro local : %d\n"
+"\n"
+
+#: src/base/cs_syr_coupling.c:309
+#, c-format
+msgid ""
+" SYRTHES coupling:\n"
+" coupling id: %d\n"
+" version: \"%s\"\n"
+" local name: \"%s\"\n"
+" distant application name: \"%s\"\n"
+" local number: %d\n"
+" MPI application number: %d\n"
+" MPI root rank: %d\n"
+" number of MPI ranks: %d\n"
+"\n"
+msgstr ""
+" Couplage SYRTHES :\n"
+" id de couplage : %d\n"
+" version : \"%s\"\n"
+" nom local : \"%s\"\n"
+" nom d'application distante : \"%s\"\n"
+" numéro local : %d\n"
+" numéro d'application MPI : %d\n"
+" rang racine MPI : %d\n"
+" nombre de rangs MPI : %d\n"
+"\n"
+
+#: src/base/cs_syr_coupling.c:1080
+msgid ""
+"At least 1 SYRTHES coupling was defined for which\n"
+"no communication with a SYRTHES instance is possible."
+msgstr ""
+"Au moins 1 couplage SYRTHES a été défini pour lequel\n"
+"aucune communication avec une instance de SYRTHES n'est possible."
+
+#: src/base/cs_tpar1d.c:443
+#, c-format
+msgid ""
+"Abort while opening the 1D-wall thermal module restart file in read mode.\n"
+"Verify the existence and the name of the restart file: %s\n"
+msgstr ""
+"Arret à l'ouverture en lecture du fichier suite du module thermique 1D en "
+"paroi.\n"
+"Vérifier l'existence et le nom du fichier suite: %s \n"
+
+#: src/base/cs_tpar1d.c:460
+msgid ""
+"Abort while reading the 1D-wall thermal module restart file.\n"
+"The number of boundary faces has been modified\n"
+"Verify that the restart file corresponds to the present study.\n"
+msgstr ""
+"Arret de lecture du fichier suite du modulethermique 1D en paroi.\n"
+"Le nombre de faces de bord a été modifié\n"
+"Vérifier que le fichier suite correspond bien au cas traité.\n"
+
+#: src/base/cs_tpar1d.c:485
+#, c-format
+msgid ""
+"WARNING: ABORT WHILE READING THE RESTART FILE\n"
+"******** 1D-WALL THERMAL MODULE\n"
+" INCORRECT FILE TYPE\n"
+"\n"
+"The file %s does not seem to be a restart file\n"
+"for the 1D-wall thermal module.\n"
+"The calculation will not be run.\n"
+"\n"
+"Verify that the restart file corresponds to a\n"
+"restart file for the 1D-wall thermal module.\n"
+msgstr ""
+"ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE\n"
+"********* MODULE THERMIQUE 1D EN PAROI\n"
+" TYPE DE FICHIER INCORRECT\n"
+"\n"
+"Le fichier %s ne semble pas etre un fichier\n"
+"suite de module thermique 1D en paroi.\n"
+"Le calcul ne peut etre execute.\n"
+"\n"
+"Verifier que le fichier suite utilise correspond bien\n"
+"a un fichier suite de module thermique 1D en paroi.\n"
+
+#: src/base/cs_tpar1d.c:524 src/base/cs_tpar1d.c:612 src/base/cs_tpar1d.c:666
+#: src/base/cs_tpar1d.c:702
+#, c-format
+msgid ""
+"Problem while reading section in the restart file\n"
+"for the 1D-wall thermal module:\n"
+"<%s>\n"
+"The calculation will not be run.\n"
+msgstr ""
+"Problème à la lecture de la rubrique dans le fichier suite du module "
+"thermique 1D en paroi:\n"
+"<%s>\n"
+"Le calcul ne sera pas executé.\n"
+
+#: src/base/cs_tpar1d.c:543
+#, c-format
+msgid ""
+"WARNING: ABORT WHILE READING THE RESTART FILE\n"
+"******** 1D-WALL THERMAL MODULE\n"
+" CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+"\n"
+"The number of faces with 1D thermal module has\n"
+"been modified.\n"
+"PREVIOUS: %d boundary faces (total)\n"
+"CURRENT: %d boundary faces (total)\n"
+"\n"
+"The calculation will not be run.\n"
+"\n"
+"Verify that the restart file corresponds to a\n"
+"restart file for the 1D-wall thermal module.\n"
+"Verify uspt1d.\n"
+msgstr ""
+"ATTENTION : LECTURE DU FICHIER SUITE\n"
+"********* MODULE THERMIQUE 1D EN PAROI\n"
+" DONNEES AMONT ET ACTUELLES DIFFERENTES\n"
+"\n"
+"Le nombre de faces avec module thermique 1D a été\n"
+"modifié.\n"
+"AMONT : %d faces de bord au total\n"
+"ACTUEL : %d faces de bord au total\n"
+"\n"
+"Le calcul ne peut être exécuté.\n"
+"\n"
+"Vérifier que le fichier suite utilisé correspond bien\n"
+"au cas traité.\n"
+"Vérifier uspt1d.\n"
+
+#: src/base/cs_tpar1d.c:569
+msgid ""
+"WARNING: ABORT WHILE READING THE RESTART FILE\n"
+"******** 1D-WALL THERMAL MODULE\n"
+" CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+"\n"
+"IFPT1D or NPPT1D has been modified with respect\n"
+"to the restart file on at least on face with\n"
+"1D thermal module\n"
+"\n"
+"The calculation will not be run.\n"
+"\n"
+"Verify that the restart file correspond to\n"
+"the present study.\n"
+"Verify uspt1d\n"
+"(refer to the user manual for the specificities\n"
+"of the test on IFPT1D)"
+msgstr ""
+"ATTENTION : LECTURE DU FICHIER SUITE\n"
+"********* MODULE THERMIQUE 1D EN PAROI\n"
+" DONNEES AMONT ET ACTUELLES DIFFERENTES\n"
+"\n"
+"IFPT1D ou NPPT1D a été modifié par rapport au\n"
+"fichier suite sur au moins une face avec module\n"
+"thermique 1D.\n"
+"\n"
+"Le calcul ne peut être executé.\n"
+"\n"
+"Vérifier que le fichier suite utilisé correspond bien\n"
+"au cas traité.\n"
+"Vérifier uspt1d\n"
+"(se reporter à la documentation utilisateur pour les\n"
+"spécificités du test sur IFPT1D)"
+
+#: src/base/cs_tpar1d.c:625
+msgid ""
+"WARNING: ABORT WHILE READING THE RESTART FILE\n"
+"******** 1D-WALL THERMAL MODULE\n"
+" CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+"\n"
+"The parameter EPPT1D has been modified with respect\n"
+"to the restart file on at least on face with\n"
+"1D thermal module\n"
+"\n"
+"The calculation will not be run.\n"
+"\n"
+"Verify that the restart file corresponds to\n"
+"the present study.\n"
+"Verify uspt1d\n"
+msgstr ""
+"ATTENTION : LECTURE DU FICHIER SUITE\n"
+"********* MODULE THERMIQUE 1D EN PAROI\n"
+" DONNEES AMONT ET ACTUELLES DIFFERENTES\n"
+"\n"
+"Le paramètre EPPT1D a été modifié par rapport au fichier\n"
+"fichier suite sur au moins une face avec module\n"
+"thermique 1D.\n"
+"\n"
+"Le calcul ne peut être exécuté.\n"
+"\n"
+"Vérifier que le fichier suite utilisé correspond bien\n"
+"au cas traité.\n"
+"Vérifier uspt1d.\n"
+
+#: src/base/cs_tpar1d.c:721
+msgid ""
+"WARNING: ABORT WHILE READING THE RESTART FILE\n"
+"******** 1D-WALL THERMAL MODULE\n"
+" CURRENT AND OLD DATA ARE DIFFERENT\n"
+"\n"
+"The parameter RGPT1D has been modified with respect\n"
+"to the restart file on at least on face with\n"
+"1D thermal module\n"
+"\n"
+"The calculation will not be run.\n"
+"\n"
+"Verify that the restart file correspond to\n"
+"the present study\n"
+"Verify uspt1d\n"
+msgstr ""
+"ATTENTION : LECTURE DU FICHIER SUITE\n"
+"********* MODULE THERMIQUE 1D EN PAROI \n"
+" DONNEES AMONT ET ACTUELLES DIFFERENTES\n"
+"\n"
+"Le parametre RGPT1D a été modifié par rapport au fichier\n"
+"fichier suite sur au moins une face avec module\n"
+"thermique 1D.\n"
+"\n"
+"Le calcul ne peut être exécuté.\n"
+"\n"
+"Vérifier que le fichier suite utilise correspond bien\n"
+"au cas traité.\n"
+"Verifier uspt1d.\n"
+
+#: src/base/cs_tpar1d.c:767
+#, c-format
+msgid ""
+"Problem while reading the section in the restart file\n"
+"for the 1D-wall thermal module:\n"
+"<%s>\n"
+msgstr ""
+"Problème à la lecture de la rubrique dans le fichier suite du module "
+"thermique 1D en paroi:\n"
+"<%s>\n"
+
+#: src/base/cs_tpar1d.c:836
+#, c-format
+msgid ""
+"Abort while opening the 1D-wall thermal module restart file in write mode.\n"
+"Verify the existence and the name of the restart file: %s\n"
+msgstr ""
+"Arret à l''ouverture en écriture du fichier suite du module thermique 1D en "
+"paroi.\n"
+"Vérifier l''existence et le nom du fichier suite: %s \n"
+
+#: src/ctwr/cs_ctwr.c:2097
+msgid "T water"
+msgstr ""
+
+#: src/ctwr/cs_ctwr.c:2109
+msgid "Flux water"
+msgstr ""
+
+#: src/ctwr/cs_ctwr_halo.c:1521
+msgid " Updating the vertex -> faces connectivity\n"
+msgstr " Mise à jour de la connectivité faces -> cellules\n"
+
+#: src/ctwr/cs_ctwr_halo.c:1553
+msgid " Distant halo definition\n"
+msgstr " Création du halo distant\n"
+
+#: src/ctwr/cs_ctwr_mesh.c:1233
+msgid " Création des halos\n"
+msgstr ""
+
+#: src/ctwr/cs_ctwr_mesh.c:1238
+msgid " Définition des halos\n"
+msgstr ""
+
+#: src/lagr/cs_lagr.c:175
+#, c-format
+msgid ""
+"overflow |%g| > %g\n"
+"Verify the bounding box for your data."
+msgstr ""
+"Dépassement |%g| > %g\n"
+"Vérifiez la boite englobante pour vos données."
+
+#: src/lagr/cs_lagr.c:414
+msgid "IEEE 754 arithmetic is not supported by the current architecture."
+msgstr ""
+"L'arithmétique IEEE 754 n'est pas respectée par l'architecture courante."
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100644
index 0000000..b26de01
--- /dev/null
+++ b/po/insert-header.sin
@@ -0,0 +1,23 @@
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/quot.sed b/po/quot.sed
new file mode 100644
index 0000000..0122c46
--- /dev/null
+++ b/po/quot.sed
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644
index 0000000..2436c49
--- /dev/null
+++ b/po/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/sbin/backup b/sbin/backup
new file mode 100755
index 0000000..4f15060
--- /dev/null
+++ b/sbin/backup
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+PREFIX=`dirname $0`
+PREFIX=`cd "$PREFIX/.." ; pwd`
+SUBDIR=`basename $PREFIX`
+
+ARCHNAME=${SUBDIR}.tar
+\rm -f $ARCHNAME.gz
+
+RUNDIR=`pwd`
+
+if [ `uname -s` = Linux ] ; then
+ TMPDIR=`mktemp -d /tmp/cs_backup.XXXXXX`
+else
+ TMPDIR=/tmp/ncs_`basename $0`
+ mkdir $TMPDIR
+fi
+if [ $? -ne 0 ]; then
+ echo "$0: Error creating temporary directory..."
+ exit 1
+fi
+
+cp -p -r $PREFIX $TMPDIR/
+cd $TMPDIR || exit 1
+
+# Clean copy
+
+find "$TMPDIR" -name .svn -exec \rm -rf {} \;
+find "$TMPDIR" -name *~ -exec \rm {} \;
+find "$TMPDIR" -name \#* -exec \rm {} \;
+find "$TMPDIR" -name \.\#* -exec \rm {} \;
+
+cd `basename "$PREFIX"`/doc
+if [ $? = 0 ]; then
+ make distclean
+ cd $TMPDIR || exit 1
+fi
+
+PREFIX_BASE=`basename $PREFIX`
+
+tar cvf $ARCHNAME $PREFIX_BASE/ChangeLog $PREFIX/ABOUT-NLS $PREFIX_BASE/AUTHORS \
+ $PREFIX_BASE/COPYING $PREFIX_BASE/INSTALL $PREFIX_BASE/NEWS \
+ $PREFIX_BASE/COMPATIBILITY $PREFIX_BASE/QUALITY_ASSURANCE \
+ $PREFIX_BASE/README $PREFIX_BASE/TODO $PREFIX_BASE/cs_config.h.in \
+ $PREFIX_BASE/config* $PREFIX_BASE/Makefile.* \
+ $PREFIX_BASE/bin $PREFIX_BASE/data $PREFIX_BASE/doc \
+ $PREFIX_BASE/examples $PREFIX_BASE/extras \
+ $PREFIX_BASE/gui $PREFIX_BASE/include \
+ $PREFIX_BASE/libsyrcs $PREFIX_BASE/patches \
+ $PREFIX_BASE/po $PREFIX_BASE/sbin $PREFIX_BASE/src \
+ $PREFIX_BASE/users
+
+gzip $ARCHNAME
+mv $ARCHNAME.gz $RUNDIR
+
+cd $RUNDIR
+\rm -rf $TMPDIR
+
diff --git a/sbin/bootstrap b/sbin/bootstrap
new file mode 100755
index 0000000..3828adb
--- /dev/null
+++ b/sbin/bootstrap
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+if [ ! -d sbin ]; then
+ echo "$0 must be called from top directory (../$0)"
+ exit 1
+fi
+
+# To add gettext support, use :
+# gettextize -f -c --no-changelog --intl
+# rm -f config/gettext.m4
+
+# To use an external gettext version, do not use --intl
+# To use a link instead of copy, do not use -c
+
+if [ ! -f config/gettext.m4 ]; then
+ echo "running gettextize"
+ \rm -rf configure.ac~ Makefile.am~
+ sed -e "s/read dummy/# read dummy/" `which gettextize` > ./tmp_gettextize
+ chmod +x ./tmp_gettextize
+ ./tmp_gettextize -f -c --no-changelog
+ if [ -f configure.ac~ ]; then
+ mv configure.ac~ configure.ac
+ fi
+ if [ -f Makefile.am~ ]; then
+ mv Makefile.am~ Makefile.am
+ fi
+ rm -rf po/*~ tmp_gettextize
+fi
+
+echo "running aclocal"
+aclocal -I config
+
+echo "running autoconf"
+autoconf
+
+if [ ! -f config/ltmain.sh ]; then
+ echo "running libtoolize"
+ libtoolize --force --copy
+fi
+
+echo "running autoheader"
+autoheader
+
+echo "running automake"
+automake -a -c
+
+echo "removing autom4te.cache"
+\rm -rf autom4te.cache
+
diff --git a/sbin/clean b/sbin/clean
new file mode 100755
index 0000000..7bada1e
--- /dev/null
+++ b/sbin/clean
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+echo "cleaning *~, #* and .#*"
+
+find . -name "*~" -print0 | xargs -0r \rm
+find . -name \#* -print0 | xargs -0r \rm
+find . -name "\.#*" -print0 | xargs -0r \rm
+find . -name semantic.cache -print0 | xargs -0r \rm
+
diff --git a/sbin/rmb b/sbin/rmb
new file mode 100755
index 0000000..cc02c2c
--- /dev/null
+++ b/sbin/rmb
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+PREFIX=`dirname $0`
+PREFIX="$PREFIX/.."
+
+RMBDIR=tmp_rmb
+
+mkdir $RMBDIR || exit 1
+
+for file in $PREFIX/src/*/*.c $PREFIX/src/*/*.f90 $PREFIX/users/*/*.f90 $PREFIX/include/*/*.h
+do
+ tmpfile=`basename $file`
+ sed -e 's/ *$//' -e 's/ / /g' $file > $RMBDIR/$tmpfile
+ diff $file $RMBDIR/$tmpfile > /dev/null 2>&1
+ if [ $? = 1 ]
+ then
+ echo $file
+ mv $RMBDIR/$tmpfile $file
+ fi
+done
+
+\rm -rf $RMBDIR
+
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..e19d354
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,23 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+SUBDIRS = base pprt atmo cfbl cogz cplv ctwr elec fuel lagr mati rayt apps
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..1647933
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,599 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = base pprt atmo cfbl cogz cplv ctwr elec fuel lagr mati rayt apps
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/apps/Makefile.am b/src/apps/Makefile.am
new file mode 100644
index 0000000..8323ca7
--- /dev/null
+++ b/src/apps/Makefile.am
@@ -0,0 +1,66 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/lagr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MEI_CPPFLAGS@ @MPI_CPPFLAGS@ @LIBXML2_CPPFLAGS@ @BLAS_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Library source files
+
+lib_LTLIBRARIES = libsaturne.la
+libsaturne_la_SOURCES = cs_solver.c
+libsaturne_la_LIBADD = \
+$(top_builddir)/src/base/libcshot.la \
+$(top_builddir)/src/base/libcsbase.la \
+$(top_builddir)/src/pprt/libcspprt.la \
+$(top_builddir)/src/atmo/libcsatmo.la \
+$(top_builddir)/src/cfbl/libcscfbl.la \
+$(top_builddir)/src/cogz/libcscogz.la \
+$(top_builddir)/src/cplv/libcscplv.la \
+$(top_builddir)/src/ctwr/libcsctwr.la \
+$(top_builddir)/src/elec/libcselec.la \
+$(top_builddir)/src/fuel/libcsfuel.la \
+$(top_builddir)/src/lagr/libcslagr.la \
+$(top_builddir)/src/mati/libcsmati.la \
+$(top_builddir)/src/rayt/libcsrayt.la
+libsaturne_la_LDFLAGS = -no-undefined -version 0:0:0
+
+# Main program
+
+bin_PROGRAMS = cs_solver
+cs_solver_SOURCES =
+cs_solver_LDADD = libsaturne.la \
+ at MEI_LDFLAGS@ @MEI_LIBS@ \
+ at FVM_LDFLAGS@ @FVM_LIBS@ \
+ at BFT_LDFLAGS@ @BFT_LIBS@ \
+ at MPI_LDFLAGS@ @MPI_LIBS@ \
+ at LIBXML2_LDFLAGS@ @LIBXML2_LIBS@ \
+ at BLAS_LDFLAGS@ @BLAS_LIBS@ \
+ at FCLIBS@
diff --git a/src/apps/Makefile.in b/src/apps/Makefile.in
new file mode 100644
index 0000000..ac8d522
--- /dev/null
+++ b/src/apps/Makefile.in
@@ -0,0 +1,674 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+bin_PROGRAMS = cs_solver$(EXEEXT)
+subdir = src/apps
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libsaturne_la_DEPENDENCIES = $(top_builddir)/src/base/libcshot.la \
+ $(top_builddir)/src/base/libcsbase.la \
+ $(top_builddir)/src/pprt/libcspprt.la \
+ $(top_builddir)/src/atmo/libcsatmo.la \
+ $(top_builddir)/src/cfbl/libcscfbl.la \
+ $(top_builddir)/src/cogz/libcscogz.la \
+ $(top_builddir)/src/cplv/libcscplv.la \
+ $(top_builddir)/src/ctwr/libcsctwr.la \
+ $(top_builddir)/src/elec/libcselec.la \
+ $(top_builddir)/src/fuel/libcsfuel.la \
+ $(top_builddir)/src/lagr/libcslagr.la \
+ $(top_builddir)/src/mati/libcsmati.la \
+ $(top_builddir)/src/rayt/libcsrayt.la
+am_libsaturne_la_OBJECTS = cs_solver.lo
+libsaturne_la_OBJECTS = $(am_libsaturne_la_OBJECTS)
+libsaturne_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libsaturne_la_LDFLAGS) $(LDFLAGS) -o $@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_cs_solver_OBJECTS =
+cs_solver_OBJECTS = $(am_cs_solver_OBJECTS)
+cs_solver_DEPENDENCIES = libsaturne.la
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libsaturne_la_SOURCES) $(cs_solver_SOURCES)
+DIST_SOURCES = $(libsaturne_la_SOURCES) $(cs_solver_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/lagr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MEI_CPPFLAGS@ @MPI_CPPFLAGS@ @LIBXML2_CPPFLAGS@ @BLAS_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@
+AM_LDFLAGS =
+
+# Library source files
+lib_LTLIBRARIES = libsaturne.la
+libsaturne_la_SOURCES = cs_solver.c
+libsaturne_la_LIBADD = \
+$(top_builddir)/src/base/libcshot.la \
+$(top_builddir)/src/base/libcsbase.la \
+$(top_builddir)/src/pprt/libcspprt.la \
+$(top_builddir)/src/atmo/libcsatmo.la \
+$(top_builddir)/src/cfbl/libcscfbl.la \
+$(top_builddir)/src/cogz/libcscogz.la \
+$(top_builddir)/src/cplv/libcscplv.la \
+$(top_builddir)/src/ctwr/libcsctwr.la \
+$(top_builddir)/src/elec/libcselec.la \
+$(top_builddir)/src/fuel/libcsfuel.la \
+$(top_builddir)/src/lagr/libcslagr.la \
+$(top_builddir)/src/mati/libcsmati.la \
+$(top_builddir)/src/rayt/libcsrayt.la
+
+libsaturne_la_LDFLAGS = -no-undefined -version 0:0:0
+cs_solver_SOURCES =
+cs_solver_LDADD = libsaturne.la \
+ at MEI_LDFLAGS@ @MEI_LIBS@ \
+ at FVM_LDFLAGS@ @FVM_LIBS@ \
+ at BFT_LDFLAGS@ @BFT_LIBS@ \
+ at MPI_LDFLAGS@ @MPI_LIBS@ \
+ at LIBXML2_LDFLAGS@ @LIBXML2_LIBS@ \
+ at BLAS_LDFLAGS@ @BLAS_LIBS@ \
+ at FCLIBS@
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/apps/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/apps/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libsaturne.la: $(libsaturne_la_OBJECTS) $(libsaturne_la_DEPENDENCIES)
+ $(libsaturne_la_LINK) -rpath $(libdir) $(libsaturne_la_OBJECTS) $(libsaturne_la_LIBADD) $(LIBS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+cs_solver$(EXEEXT): $(cs_solver_OBJECTS) $(cs_solver_DEPENDENCIES)
+ @rm -f cs_solver$(EXEEXT)
+ $(LINK) $(cs_solver_OBJECTS) $(cs_solver_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_solver.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
+install-binPROGRAMS: install-libLTLIBRARIES
+
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+ clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libLTLIBRARIES clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-libLTLIBRARIES \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/apps/cs_solver.c b/src/apps/cs_solver.c
new file mode 100644
index 0000000..0853348
--- /dev/null
+++ b/src/apps/cs_solver.c
@@ -0,0 +1,651 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Main program
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+#if defined(__linux__) || defined(__linux) || defined(linux)
+#define _GNU_SOURCE
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <errno.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(_GNU_SOURCE)
+#include <fenv.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_config.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+#if !defined(_GNU_SOURCE)
+#include <bft_fp_trap.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_selector.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_benchmark.h"
+#include "cs_base.h"
+#include "cs_calcium.h"
+#include "cs_coupling.h"
+#include "cs_ctwr.h"
+#include "cs_gui.h"
+#include "cs_io.h"
+#include "cs_join.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_mesh_solcom.h"
+#include "cs_mesh_quality.h"
+#include "cs_mesh_warping.h"
+#include "cs_mesh_coherency.h"
+#include "cs_multigrid.h"
+#include "cs_opts.h"
+#include "cs_post.h"
+#include "cs_preprocessor_data.h"
+#include "cs_prototypes.h"
+#include "cs_proxy_comm.h"
+#include "cs_renumber.h"
+#include "cs_restart.h"
+#include "cs_sles.h"
+#include "cs_sat_coupling.h"
+#include "cs_syr_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Main function for Code_Saturne run.
+ *
+ * This function is called either by main() in the standard case, or by
+ * a SALOME standalone module's yacsinit() function. As the latter cannot
+ * return, almost all of the code's execution steps (except command-line
+ * initialization, required to know if we are running in standard mode or
+ * pluging a SALOME module) are done here.
+ *
+ * As yacsinit() can take no arguments, the command-line options must be
+ * defined as a static global variable by main() so as to be usable
+ * by run().
+ *----------------------------------------------------------------------------*/
+
+void
+cs_run(void);
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+static int app_num = -1;
+static cs_opts_t opts;
+
+#if defined(_GNU_SOURCE)
+static int _fenv_set = 0; /* Indicates if behavior modified */
+static fenv_t _fenv_old; /* Old exception mask */
+#endif
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Main function for Code_Saturne run.
+ *
+ * This function is called either by main() in the standard case, or by
+ * a SALOME standalone module's yacsinit() function. As the latter cannot
+ * return, almost all of the code's execution steps (except command-line
+ * initialization, required to know if we are running in standard mode or
+ * pluging a SALOME module) are done here.
+ *
+ * As yacsinit() can take no arguments, the command-line options must be
+ * defined as a static global variable by main() so as to be usable
+ * by run().
+ *----------------------------------------------------------------------------*/
+
+void
+cs_run(void)
+{
+ double t1, t2;
+
+ cs_int_t iasize, rasize;
+ cs_int_t nituse, nrtuse, nideve, nrdeve;
+
+ int _verif = -1;
+
+ cs_int_t *ia = NULL;
+ cs_int_t *ituser = NULL;
+ cs_int_t *idevel = NULL;
+
+ cs_real_t *ra = NULL;
+ cs_real_t *rtuser = NULL;
+ cs_real_t *rdevel = NULL;
+
+ /* System information */
+
+ cs_base_system_info();
+
+ /* Initialize global structures for main mesh */
+
+ cs_glob_mesh = cs_mesh_create();
+ cs_glob_mesh_builder = cs_mesh_builder_create();
+ cs_glob_mesh_quantities = cs_mesh_quantities_create();
+
+ /* Initialize reading of Preprocessor output */
+
+ if (opts.ifoenv != 0) {
+#if defined(FVM_HAVE_MPI)
+ cs_glob_pp_io = cs_io_initialize("preprocessor_output",
+ "Face-based mesh definition, R0",
+ CS_IO_MODE_READ,
+ cs_glob_io_hints,
+ CS_IO_ECHO_OPEN_CLOSE,
+ cs_glob_mpi_comm);
+#else
+ cs_glob_pp_io = cs_io_initialize("preprocessor_output",
+ "Face-based mesh definition, R0",
+ CS_IO_MODE_READ,
+ CS_IO_ECHO_OPEN_CLOSE,
+ -1);
+#endif
+ }
+
+ /* Call main calculation initialization function or help */
+
+ _verif = (opts.verif == true || opts.benchmark > 0) ? 1 : 0;
+
+ CS_PROCF(initi1, INITI1)(&_verif);
+
+ /* Discover applications visible through MPI (requires communication);
+ this is done after main calculation initialization so that the user
+ may have the option of assigning a name to this instance. */
+
+#if defined(HAVE_MPI)
+ cs_coupling_discover_mpi_apps(app_num, NULL);
+#endif
+
+ /* Initialize SYRTHES couplings and communication if necessary */
+
+ cs_syr_coupling_all_init(opts.syr_socket);
+
+ if (opts.ifoenv == 0) {
+
+ /* Read file in obsolete "SolCom" format */
+
+ cs_mesh_solcom_read(cs_glob_mesh,
+ cs_glob_mesh_quantities);
+
+ }
+ else {
+
+ /* Read Preprocessor output */
+
+ cs_preprocessor_data_read_mesh(cs_glob_mesh,
+ cs_glob_mesh_builder);
+
+ }
+
+ /* Initialize main post-processing */
+
+ cs_post_init_main_writer();
+
+ /* Join meshes if necessary */
+
+ CS_PROCF (usjoin, USJOIN)();
+
+ cs_join_all();
+
+ /* Initialize ghost cells and other parallelism-related structures */
+
+ cs_mesh_init_halo(cs_glob_mesh);
+ cs_mesh_init_parall(cs_glob_mesh);
+
+ /* Possible geometry modification */
+
+ CS_PROCF (usmodg, USMODG)(&(cs_glob_mesh->dim),
+ &(cs_glob_mesh->n_cells_with_ghosts),
+ &(cs_glob_mesh->n_cells),
+ &(cs_glob_mesh->n_i_faces),
+ &(cs_glob_mesh->n_b_faces),
+ &(cs_glob_mesh->n_families),
+ &(cs_glob_mesh->n_max_family_items),
+ &(cs_glob_mesh->n_vertices),
+ &(cs_glob_mesh->i_face_vtx_connect_size),
+ &(cs_glob_mesh->b_face_vtx_connect_size),
+ cs_glob_mesh->i_face_cells,
+ cs_glob_mesh->b_face_cells,
+ cs_glob_mesh->b_face_family,
+ cs_glob_mesh->cell_family,
+ cs_glob_mesh->family_item,
+ cs_glob_mesh->i_face_vtx_idx,
+ cs_glob_mesh->i_face_vtx_lst,
+ cs_glob_mesh->b_face_vtx_idx,
+ cs_glob_mesh->b_face_vtx_lst,
+ cs_glob_mesh->vtx_coord);
+
+ /* Triangulate warped faces if necessary */
+
+ if (opts.cwf == true) {
+
+ t1 = bft_timer_wtime();
+ cs_mesh_warping_cut_faces(cs_glob_mesh, opts.cwf_criterion, opts.cwf_post);
+ t2 = bft_timer_wtime();
+
+ bft_printf(_("\n Cutting warped faces (%.3g s)\n"), t2-t1);
+
+ }
+
+ /* Renumber mesh based on code options */
+
+ bft_printf(_("\n Renumbering mesh:\n"));
+ bft_printf_flush();
+ cs_renumber_mesh(cs_glob_mesh,
+ cs_glob_mesh_quantities);
+
+ /* Initialize meshes for the main post-processing */
+
+ cs_post_init_main_meshes();
+
+ /* Update Fortran mesh sizes and quantities */
+
+ {
+ cs_int_t n_g_cells = cs_glob_mesh->n_g_cells;
+ cs_int_t n_g_i_faces = cs_glob_mesh->n_g_i_faces;
+ cs_int_t n_g_b_faces = cs_glob_mesh->n_g_b_faces;
+ cs_int_t n_g_vertices = cs_glob_mesh->n_g_vertices;
+ cs_int_t nthrdi = 1;
+ cs_int_t nthrdb = 1;
+ cs_int_t ngrpi = 1;
+ cs_int_t ngrpb = 1;
+ const cs_int_t *idxfi = NULL;
+ const cs_int_t *idxfb = NULL;
+
+ if (cs_glob_mesh->i_face_numbering != NULL) {
+ const cs_numbering_t *_n = cs_glob_mesh->i_face_numbering;
+ nthrdi = _n->n_threads;
+ ngrpi = _n->n_groups;
+ idxfi = _n->group_index;
+ }
+
+ if (cs_glob_mesh->b_face_numbering != NULL) {
+ const cs_numbering_t *_n = cs_glob_mesh->b_face_numbering;
+ nthrdb = _n->n_threads;
+ ngrpb = _n->n_groups;
+ idxfb = _n->group_index;
+ }
+
+ CS_PROCF (majgeo, MAJGEO)(&(cs_glob_mesh->n_cells),
+ &(cs_glob_mesh->n_cells_with_ghosts),
+ &(cs_glob_mesh->n_i_faces),
+ &(cs_glob_mesh->n_b_faces),
+ &(cs_glob_mesh->n_vertices),
+ &(cs_glob_mesh->i_face_vtx_connect_size),
+ &(cs_glob_mesh->b_face_vtx_connect_size),
+ &n_g_cells,
+ &n_g_i_faces,
+ &n_g_b_faces,
+ &n_g_vertices,
+ &nthrdi,
+ &nthrdb,
+ &ngrpi,
+ &ngrpb,
+ idxfi,
+ idxfb);
+ }
+
+ cs_mesh_print_info(cs_glob_mesh, _("Mesh"));
+
+ /* Destroy the temporary structure used to build the main mesh */
+
+ cs_glob_mesh_builder = cs_mesh_builder_destroy(cs_glob_mesh_builder);
+
+ /* Compute geometric quantities related to the mesh */
+
+ bft_printf_flush();
+
+ t1 = bft_timer_wtime();
+ cs_mesh_quantities_compute(cs_glob_mesh, cs_glob_mesh_quantities);
+ t2 = bft_timer_wtime();
+
+ bft_printf(_("\n Computing geometric quantities (%.3g s)\n"), t2-t1);
+
+ cs_mesh_info(cs_glob_mesh);
+
+ /* Initialize selectors for the mesh */
+ cs_mesh_init_selectors();
+
+#if 0
+ /* For debugging purposes */
+ cs_mesh_dump(cs_glob_mesh);
+ cs_mesh_quantities_dump(cs_glob_mesh, cs_glob_mesh_quantities);
+#endif
+
+ /* Compute iterations or quality criteria depending on verification options */
+
+ if (opts.verif == true) {
+ bft_printf(_("\n Computing quality criteria\n"));
+ cs_mesh_quality(cs_glob_mesh, cs_glob_mesh_quantities);
+ cs_mesh_coherency_check();
+ }
+
+ if (opts.benchmark > 0) {
+ int mpi_trace_mode = (opts.benchmark == 2) ? 1 : 0;
+ cs_benchmark(mpi_trace_mode);
+ }
+
+ if (opts.benchmark <= 0) {
+
+ /* Allocate Fortran working arrays */
+
+ CS_PROCF(memini, MEMINI)(&iasize, &rasize,
+ &nideve, &nrdeve, &nituse, &nrtuse);
+
+ bft_printf(_("\n"
+ " --- Main Fortran work arrays:\n"
+ " LONGIA = %10d (Number of integers)\n"
+ " LONGRA = %10d (Number of reals)\n"
+ " (%d bytes/integer, %d bytes/real)\n"),
+ iasize, rasize,
+ sizeof(cs_int_t)/sizeof(char),
+ sizeof(cs_real_t)/sizeof(char));
+
+ if (nideve > 0 || nrdeve >0)
+ bft_printf(_("\n"
+ " --- Developer Fortran work arrays:\n"
+ " NIDEVE = %10d (Number of integer)\n"
+ " NRDEVE = %10d (Number of reals)\n"),
+ nideve, nrdeve);
+
+ bft_printf(_("\n"
+ " --- User Fortran work arrays:\n"
+ " NITUSE = %10d (Number of integers)\n"
+ " NRTUSE = %10d (Number of reals)\n\n"),
+ nituse, nrtuse);
+
+ cs_base_mem_init_work(iasize, rasize, &ia, &ra);
+
+ BFT_MALLOC(ituser, nituse, cs_int_t);
+ BFT_MALLOC(rtuser, nrtuse, cs_real_t);
+
+ BFT_MALLOC(idevel, nideve, cs_int_t);
+ BFT_MALLOC(rdevel, nrdeve, cs_real_t);
+
+ /* Initialize sparse linear systems resolution */
+
+ cs_sles_initialize();
+ cs_multigrid_initialize();
+
+ /*----------------------------------------------
+ * Call main calculation function (code Kernel)
+ *----------------------------------------------*/
+
+ CS_PROCF(caltri, CALTRI)(&_verif,
+ &nideve, &nrdeve, &nituse, &nrtuse,
+ cs_glob_mesh->i_face_cells,
+ cs_glob_mesh->b_face_cells,
+ cs_glob_mesh->b_face_family,
+ cs_glob_mesh->cell_family,
+ cs_glob_mesh->family_item,
+ cs_glob_mesh->i_face_vtx_idx,
+ cs_glob_mesh->i_face_vtx_lst,
+ cs_glob_mesh->b_face_vtx_idx,
+ cs_glob_mesh->b_face_vtx_lst,
+ idevel, ituser, ia,
+ cs_glob_mesh_quantities->cell_cen,
+ cs_glob_mesh_quantities->i_face_normal,
+ cs_glob_mesh_quantities->b_face_normal,
+ cs_glob_mesh_quantities->i_face_cog,
+ cs_glob_mesh_quantities->b_face_cog,
+ cs_glob_mesh->vtx_coord,
+ cs_glob_mesh_quantities->cell_vol,
+ rdevel, rtuser, ra);
+
+ /* Finalize sparse linear systems resolution */
+
+ cs_multigrid_finalize();
+ cs_sles_finalize();
+
+ /* Free working arrays */
+
+ BFT_FREE(ia);
+ BFT_FREE(ra);
+
+ BFT_FREE(ituser);
+ BFT_FREE(rtuser);
+
+ BFT_FREE(idevel);
+ BFT_FREE(rdevel);
+
+ }
+
+ bft_printf(_("\n Destroying structures and ending computation\n"));
+ bft_printf_flush();
+
+ /* Free coupling-related data */
+
+ cs_syr_coupling_all_finalize();
+#if defined(HAVE_MPI)
+ cs_sat_coupling_all_finalize();
+ cs_coupling_finalize();
+#endif
+
+ /* Free cooling towers related structures */
+
+ cs_ctwr_all_destroy();
+
+ /* Free post processing related structures */
+
+ cs_post_finalize();
+
+ /* Free main mesh */
+
+ cs_mesh_quantities_destroy(cs_glob_mesh_quantities);
+ cs_mesh_destroy(cs_glob_mesh);
+
+ /* End of possible communication with a proxy */
+
+ cs_proxy_comm_finalize();
+
+ /* CPU times and memory management finalization */
+
+ cs_restart_print_stats();
+
+ cs_base_bilan_temps();
+ cs_base_mem_fin();
+}
+
+/*============================================================================
+ * Main program
+ *============================================================================*/
+
+int
+main(int argc,
+ char *argv[])
+{
+ /* First analysis of the command line to determine if MPI is required,
+ and MPI initialization if it is. */
+
+#if defined(HAVE_MPI)
+ app_num = cs_opts_mpi_init(&argc, &argv);
+ if (app_num > -1)
+ cs_base_mpi_init(app_num);
+#endif
+
+#if defined(HAVE_OPENMP) /* Determine default number of OpenMP threads */
+ {
+ int t_id;
+#pragma omp parallel private(t_id)
+ {
+ t_id = omp_get_thread_num();
+ if (t_id == 0)
+ cs_glob_n_threads = omp_get_num_threads();
+ }
+ }
+#endif
+
+ /* Default initialization */
+
+#if defined(_CS_ARCH_Linux)
+
+ if (getenv("LANG") != NULL)
+ setlocale(LC_ALL,"");
+ else
+ setlocale(LC_ALL, "C");
+ setlocale(LC_NUMERIC, "C");
+
+#endif
+
+#if defined(ENABLE_NLS)
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+
+ (void)bft_timer_wtime();
+
+ /* Trap floating-point exceptions */
+
+#if defined(_GNU_SOURCE)
+ if (_fenv_set == 0) {
+ if (fegetenv(&_fenv_old) == 0) {
+ feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
+ _fenv_set = 1;
+ /* To revert to initial behavior: fesetenv(&_fenv_old); */
+ }
+ }
+#else
+ bft_fp_trap_set();
+#endif
+
+ /* Initialize memory management and signals */
+
+ cs_base_mem_init();
+ cs_base_error_init();
+
+ /* Parse command line */
+
+ cs_opts_define(argc, argv, &opts);
+
+ /* Open 'listing' (log) files */
+
+ {
+ cs_int_t _n_threads = cs_glob_n_threads;
+ cs_int_t _rank_id = cs_glob_rank_id, _n_ranks = cs_glob_n_ranks;
+
+ CS_PROCF(csinit, CSINIT)(&(opts.ifoenv),
+ &_rank_id,
+ &_n_ranks,
+ &_n_threads,
+ &(opts.ilisr0),
+ &(opts.ilisrp));
+ }
+
+ cs_base_bft_printf_set();
+
+ /* Log-file header and command line arguments recap */
+
+ cs_opts_logfile_head(argc, argv);
+
+ /* In case of use with SALOME, optional connection with CFD_Proxy
+ launcher or load and start of YACS module */
+
+ /* For verbose output, uncomment the following */
+ /*cs_calcium_set_verbosity(3);*/
+
+ /* Using CFD_Proxy, simply initialize connection before standard run */
+ if (opts.proxy_socket != NULL) {
+ cs_proxy_comm_initialize(opts.proxy_socket,
+ opts.proxy_key,
+ CS_PROXY_COMM_TYPE_SOCKET);
+ BFT_FREE(opts.proxy_socket);
+ opts.proxy_key = -1;
+ cs_calcium_set_comm_proxy();
+ }
+
+ /* Running as a standalone SALOME component, load YACS component
+ library and run yacsinit() component initialization and event loop,
+ which should itself include the standard run routine */
+
+ if (opts.yacs_module != NULL) {
+ cs_calcium_load_yacs(opts.yacs_module);
+ BFT_FREE(opts.yacs_module);
+ cs_calcium_start_yacs(); /* Event-loop does not return as of this version */
+ cs_calcium_unload_yacs();
+ }
+
+ /* In standard case or with CFD_Proxy, simply call regular run() method */
+
+ else
+ cs_run();
+
+ /* Return */
+
+ cs_exit(EXIT_SUCCESS);
+
+ /* Never called, but avoids compiler warning */
+ return 0;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/atmo/Makefile.am b/src/atmo/Makefile.am
new file mode 100644
index 0000000..c1b5ea4
--- /dev/null
+++ b/src/atmo/Makefile.am
@@ -0,0 +1,65 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/atmo/atincl.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcsatmo.la
+libcsatmo_la_SOURCES = \
+atini1.f90 \
+atiniv.f90 \
+atlecm.f90 \
+atmcls.f90 \
+atphyv.f90 \
+atprke.f90 \
+atprop.f90 \
+attycl.f90 \
+atvarp.f90 \
+intprf.f90 \
+mematm.f90
+libcsatmo_la_LDFLAGS = -no-undefined
+
+libcsatmo_la_SOURCES += \
+$(top_srcdir)/users/atmo/usatcl.f90 \
+$(top_srcdir)/users/atmo/usati1.f90 \
+$(top_srcdir)/users/atmo/usativ.f90
+
+atmodir = $(pkgdatadir)/users/atmo
+atmo_DATA = \
+$(top_srcdir)/users/atmo/usatcl.f90 \
+$(top_srcdir)/users/atmo/usati1.f90 \
+$(top_srcdir)/users/atmo/usativ.f90
diff --git a/src/atmo/Makefile.in b/src/atmo/Makefile.in
new file mode 100644
index 0000000..bebcadc
--- /dev/null
+++ b/src/atmo/Makefile.in
@@ -0,0 +1,626 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/atmo
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcsatmo_la_LIBADD =
+am_libcsatmo_la_OBJECTS = atini1.lo atiniv.lo atlecm.lo atmcls.lo \
+ atphyv.lo atprke.lo atprop.lo attycl.lo atvarp.lo intprf.lo \
+ mematm.lo usatcl.lo usati1.lo usativ.lo
+libcsatmo_la_OBJECTS = $(am_libcsatmo_la_OBJECTS)
+libcsatmo_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcsatmo_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcsatmo_la_SOURCES)
+DIST_SOURCES = $(libcsatmo_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(atmodir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+atmoDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(atmo_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/atmo/atincl.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcsatmo.la
+libcsatmo_la_SOURCES = atini1.f90 atiniv.f90 atlecm.f90 atmcls.f90 \
+ atphyv.f90 atprke.f90 atprop.f90 attycl.f90 atvarp.f90 \
+ intprf.f90 mematm.f90 $(top_srcdir)/users/atmo/usatcl.f90 \
+ $(top_srcdir)/users/atmo/usati1.f90 \
+ $(top_srcdir)/users/atmo/usativ.f90
+libcsatmo_la_LDFLAGS = -no-undefined
+atmodir = $(pkgdatadir)/users/atmo
+atmo_DATA = \
+$(top_srcdir)/users/atmo/usatcl.f90 \
+$(top_srcdir)/users/atmo/usati1.f90 \
+$(top_srcdir)/users/atmo/usativ.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/atmo/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/atmo/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcsatmo.la: $(libcsatmo_la_OBJECTS) $(libcsatmo_la_DEPENDENCIES)
+ $(libcsatmo_la_LINK) $(libcsatmo_la_OBJECTS) $(libcsatmo_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+usatcl.lo: $(top_srcdir)/users/atmo/usatcl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usatcl.lo `test -f '$(top_srcdir)/users/atmo/usatcl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/atmo/usatcl.f90
+
+usati1.lo: $(top_srcdir)/users/atmo/usati1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usati1.lo `test -f '$(top_srcdir)/users/atmo/usati1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/atmo/usati1.f90
+
+usativ.lo: $(top_srcdir)/users/atmo/usativ.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usativ.lo `test -f '$(top_srcdir)/users/atmo/usativ.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/atmo/usativ.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-atmoDATA: $(atmo_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(atmodir)" || $(MKDIR_P) "$(DESTDIR)$(atmodir)"
+ @list='$(atmo_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(atmoDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(atmodir)/$$f'"; \
+ $(atmoDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(atmodir)/$$f"; \
+ done
+
+uninstall-atmoDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(atmo_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(atmodir)/$$f'"; \
+ rm -f "$(DESTDIR)$(atmodir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(atmodir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-atmoDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-atmoDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-atmoDATA install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-saturneincludeHEADERS \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-atmoDATA uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/atmo/atini1.f90 b/src/atmo/atini1.f90
new file mode 100644
index 0000000..2ce784b
--- /dev/null
+++ b/src/atmo/atini1.f90
@@ -0,0 +1,272 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atini1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR LA VERSION ATMOSPHERIQUE
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "ihmpre.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "atincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer iphas, ii, isc, jj, ipp
+
+!===============================================================================
+
+
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH pour IPPMOD(IATMOS) = 1 or 2
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+if ( ippmod(iatmos).ge.1 ) then
+ do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+ endif
+ enddo
+
+ do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ call csexit (1)
+ !==========
+ endif
+ enddo
+endif
+
+
+!===============================================================================
+! 1. INFORMATIONS GENERALES
+!===============================================================================
+
+! ---> Initialisation
+iphas = 1
+rair = 287.d0
+
+! ---> Masse volumique et viscosite
+irovar(iphas) = 0
+ivivar(iphas) = 0
+
+!===============================================================================
+! 2. VARIABLES TRANSPORTEES pour IPPMOD(IATMOS) = 1 or 2
+!===============================================================================
+
+! 2.1 Dry atmosphere
+! =====================
+
+if ( ippmod(iatmos).eq.1 ) then
+
+ iscsth(itempp) = 1
+ iscalt(iphas) = itempp
+ scamin(itempp) = -grand
+ scamax(itempp) = +grand
+
+! for the dry atmosphere case, non constant density
+ irovar(iphas) = 1
+
+! --> Donnees physiques ou numeriques propres aux scalaires
+
+ do isc = 1, nscapp
+
+ jj = iscapp(isc)
+
+ if (iscavr(jj).le.0) then
+ visls0(jj) = viscl0(iphsca(jj))
+ endif
+
+ blencv(isca(jj)) = 1.d0
+
+ enddo
+
+ ipp = ipprtp(isca(itempp))
+ nomvar(IPP) = 'PotTemp'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+endif
+
+! 2.2 Humid atmosphere
+! =====================
+
+if ( ippmod(iatmos).eq.2 ) then
+
+ iscsth(itempl) = 1
+ iscsth(itotwt) = 0
+ iscsth(intdrp) = 0
+
+ iscalt(iphas) = itempl
+
+! for the humid atmosphere case, non constant density
+ irovar(iphas) = 1
+
+
+ ipp = ipprtp(isca(itempl))
+ nomvar(IPP) = 'LqPotTmp'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+ ipp = ipprtp(isca(itotwt))
+ nomvar(IPP) = 'TotWater'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+ ipp = ipprtp(isca(intdrp))
+ nomvar(IPP) = 'TotDrop'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+endif
+
+!===============================================================================
+! 3. VARIABLES D'ETAT pour IPPMOD(IATMOS) = 1 or 2
+!===============================================================================
+
+! 3.1 Dry or humid atmosphere
+! =============================
+
+if ( ippmod(iatmos).eq.1.or. ippmod(iatmos).eq.2) then
+
+ ipp = ipppro(ipproc(itempc))
+ nomvar(IPP) = 'TempC'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+endif
+
+
+!===============================================================================
+! 4. ON DONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+! - Interface Code_Saturne
+! ======================
+
+if (iihmpr.eq.1) then
+
+ call uiati1 (imeteo)
+ !==========
+
+endif
+
+call usati1
+!==========
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (ATMOSPHERIQUE) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (ATMOSPHERIQUE) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/atmo/atiniv.f90 b/src/atmo/atiniv.f90
new file mode 100644
index 0000000..aba21a7
--- /dev/null
+++ b/src/atmo/atiniv.f90
@@ -0,0 +1,274 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atiniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : ECOULEMENTS ATMOSPHERIQUES
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "atincl.h"
+
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, imode
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. READING THE METEO PROFILE FILE (IF IMETEO = 1 DEFAULT OPTION):
+!===============================================================================
+
+
+if (imeteo.gt.0) then
+
+ imode = 1
+ call atlecm &
+ !==========
+ ( imode , &
+ ra(itmmet) , ra(iztmet) , ra(izdmet) , &
+ ra(ixmet) , ra(iymet) , ra(ipmer) , &
+ ra(ittmet) , ra(iqvmet) , &
+ ra(iumet) , ra(ivmet) , &
+ ra(iekmet) , ra(iepmet) , &
+ ra(irmet) , ra(itpmet) , ra(iphmet) )
+
+endif
+
+!===============================================================================
+! 3. USER OPTIONS
+!===============================================================================
+
+call usativ &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbmetd , nbmett , nbmetm , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ ra(itmmet) , ra(iztmet) , ra(izdmet) , &
+ ra(ixmet) , ra(iymet) , ra(ipmer) , &
+ ra(ittmet) , ra(iqvmet) , ra(iumet) , &
+ ra(ivmet) , ra(iekmet) , ra(iepmet) , &
+ ra(irmet) , ra(itpmet) , ra(iphmet) , &
+ rdevel , rtuser , ra )
+
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/atmo/atlecm.f90 b/src/atmo/atlecm.f90
new file mode 100644
index 0000000..fe05f2b
--- /dev/null
+++ b/src/atmo/atlecm.f90
@@ -0,0 +1,553 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atlecm &
+!================
+
+ ( imode , tmprom , ztprom , zdprom , &
+ xmet , ymet , pmer , &
+ ttprom , qvprom , &
+ uprom , vprom , ekprom , epprom, &
+ rprom , tpprom , phprom )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+
+! READING THE METEO PROFILE DATA
+
+! SPECIFIC PHYSICS ATMOSPHERIC MODULE
+
+! IMODE = 0 : READING OF DIMENSIONS ONLY
+! IMODE = 1 : READING OF DATA
+
+! WARNING : ARGUMENTS ARE DEFINED ONLY ON SECOND CALL
+! OF THE ROUTINE (IMODE=1)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "vector.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "atincl.h"
+
+!===============================================================================
+
+! Arguments
+integer imode
+double precision tmprom(nbmetm)
+double precision ztprom(nbmett) , zdprom(nbmetd)
+double precision xmet(nbmetm) , ymet(nbmetm) , pmer(nbmetm)
+double precision ttprom(nbmett,nbmetm) , qvprom(nbmett,nbmetm)
+double precision uprom(nbmetd,nbmetm) , vprom(nbmetd,nbmetm)
+double precision ekprom(nbmetd,nbmetm) , epprom(nbmetd,nbmetm)
+double precision rprom(nbmett,nbmetm) , tpprom(nbmett,nbmetm)
+double precision phprom(nbmett,nbmetm)
+
+! VARIABLES LOCALES
+
+integer itp, ii, ios, k, iphas
+double precision annee,quant,heure,minute,second
+double precision psol,rap,rscp,tmoy
+character*80 ccomnt
+character*1 csaute
+
+!===============================================================================
+
+if (imode.eq.0) then
+ WRITE(NFECRA,*) 'reading of dimensions for meteo profiles'
+else
+ WRITE(NFECRA,*) 'reading of meteo profiles data'
+ endif
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+CSAUTE = '/'
+
+! --> Ouverture du fichier
+open ( unit=impmet, file=ficmet, &
+ STATUS='OLD', FORM='FORMATTED', ACCESS='SEQUENTIAL', &
+ iostat=ios, err=99 )
+rewind(unit=impmet,err=99)
+
+itp=0
+
+!===============================================================================
+! 1. LOOP ON TIME
+!===============================================================================
+
+ 100 continue
+itp = itp+1
+
+! ---> READING THE COMMENTS
+! ---------------------------
+
+ 101 READ(IMPMET,'(A80)',ERR=999,END=906) CCOMNT
+
+if(ccomnt(1:1).eq.csaute) go to 101
+backspace(impmet)
+
+!===============================================================================
+! 2. READING THE TIME OF THE PROFILE
+!===============================================================================
+
+! --> annee, quantieme, heure, minute, seconde du profil (TU)
+
+if (imode.eq.0) then
+ read(impmet,*,err=999,end=906)
+else
+ read(impmet,*,err=999,end=906) annee, quant,heure,minute,second
+
+! --> calcul du temps relatif au debut de la simulation
+! TTPROM(NBMETM) = instants correspondant aux profils
+! TD!!!! calcul par rapport ANNDEB, QUADEB, HEUDEB, MINDEB, SCDDEB
+! + tests d'incoh�rence
+
+ tmprom(itp)= second
+
+
+! --> verification de l'ordre chronologique des profils
+
+ if(itp.gt.1) then
+ if(tmprom(itp).lt.tmprom(itp-1)) then
+ write(nfecra,8000)
+ call csexit (1)
+ !==========
+ endif
+ endif
+
+endif
+
+!===============================================================================
+! 3. READING THE POSITION OF THE PROFILE
+!===============================================================================
+
+ 102 READ(IMPMET,'(A80)',ERR=999,END=999) CCOMNT
+
+if(ccomnt(1:1).eq.csaute) go to 102
+backspace(impmet)
+
+
+if (imode.eq.0) then
+ read(impmet,*,err=999,end=999)
+else
+ read(impmet,*,err=999,end=999) xmet(itp), ymet(itp)
+endif
+
+!===============================================================================
+! 4. READING THE SEA-LEVEL PRESSURE
+!===============================================================================
+
+ 103 READ(IMPMET,'(A80)',ERR=999,END=999) CCOMNT
+
+if(ccomnt(1:1).eq.csaute) go to 103
+backspace(impmet)
+
+
+if (imode.eq.0) then
+ read(impmet,*,err=999,end=999)
+else
+ read(impmet,*,err=999,end=999) pmer(itp)
+endif
+
+!=================================================================================
+! 5. READING THE TEMPERATURE AND HUMIDITY PROFILES
+!=================================================================================
+
+ 104 READ(IMPMET,'(A80)',ERR=999,END=999) CCOMNT
+
+if(ccomnt(1:1).eq.csaute) go to 104
+backspace(impmet)
+
+
+if (imode.eq.0) then
+ read(impmet,*,err=999,end=999) nbmett
+
+ if(nbmett.le.1) then
+ write(nfecra,8001)
+ call csexit (1)
+ !==========
+ endif
+
+ do ii=1,nbmett
+ read (impmet,*,err=999,end=999)
+ enddo
+
+else
+
+ read(impmet,*,err=999,end=999)
+
+ do ii=1,nbmett
+
+! Altitude, temperature, humidite
+ read (impmet,*,err=999,end=999) ztprom(ii), &
+ ttprom(ii,itp), qvprom(ii,itp)
+
+ enddo
+
+endif
+
+!===============================================================================
+! 6. COMPUTING HYDRO PRESSURE PROFILE (LAPLACE INTEGRATION)
+!===============================================================================
+! NOTE : BASEE SUR LA PRESSION PMER
+! ET UNE INTEGRATION DE LAPLACE DE BAS EN HAUT
+
+if (imode.eq.1) then
+ iphas = 1
+ phprom(1,itp)=pmer(itp)
+ psol=p0(iphas)
+ rscp=rair/cp0(iphas)
+
+ do k=2,nbmett
+ tmoy=0.5*(ttprom(k-1,itp)+ttprom(k,itp))+tkelvi
+! RHMOY=RAIR*(1.+(RVSRA-1.)*
+! & (QVPROM(K-1,ITP)+QVPROM(K,ITP))/2.*IH2O)
+! RAP=-ABS(GZ)*(ZK-ZKM1)/RHMOY/TMOY
+ rap=-abs(gz)*(ztprom(k)-ztprom(k-1))/rair/tmoy
+ phprom(k,itp)=phprom(k-1,itp)*exp(rap)
+ enddo
+
+endif
+
+!===============================================================================
+! 7. COMPUTING THE POT. TEMPERATURE PROFILE AND THE DENSITY PROFILE
+!===============================================================================
+
+if (imode.eq.1) then
+ do k=1,nbmett
+! RHUM=RAIR*(1.D0+(RVSRA-1.D0)*QVPROM(K,ITP)*IH2O)
+
+! IF ((ISCALT(IPHAS).EQ.-1).OR.(IPHYSI.EQ.0)) THEN
+! MASSE VOLUMIQUE CONSTANTE
+! RPROM(K,ITP)=PMER/(TPROM(K,ITP)+TKELVI)/RHUM
+! ELSE
+! MASSE VOLUMIQUE VARIABLE
+! RPROM(K,ITP)=PHPROM(K,ITP)/(TTPROM(K,ITP)+TKELVI)/RHUM
+! ENDIF
+ rprom(k,itp)=phprom(k,itp)/(ttprom(k,itp)+tkelvi)/rair
+! & *(1.D0+(RVSRA-CPVCPA)*QVPROM(K,ITP)*IH2O)
+ tpprom(k,itp)=(ttprom(k,itp)+tkelvi)* &
+ ((psol/phprom(k,itp))**rscp)
+ enddo
+
+endif
+
+!================================================================================
+! 8. READING THE VELOCITY PROFILE
+!================================================================================
+
+
+ 105 READ(IMPMET,'(A80)',ERR=999,END=999) CCOMNT
+
+if(ccomnt(1:1).eq.csaute) go to 105
+backspace(impmet)
+
+
+if (imode.eq.0) then
+
+ read(impmet,*,err=999,end=999) nbmetd
+
+ if(nbmetd.le.1) then
+ write(nfecra,8002)
+ call csexit (1)
+ !==========
+ endif
+
+ do ii=1,nbmetd
+ read (impmet,*,err=999,end=999)
+ enddo
+
+else
+
+ read(impmet,*,err=999,end=999)
+
+ do ii=1,nbmetd
+! Altitude, u, v, k, epsilon
+ read (impmet,*,err=999,end=999) zdprom(ii), &
+ uprom(ii,itp), vprom(ii,itp),&
+ ekprom(ii,itp), epprom(ii,itp)
+
+ enddo
+
+endif
+
+!================================================================================
+! 9. PRINTINGS
+!================================================================================
+
+if (imode.eq.1) then
+ if(itp.eq.1) then
+ write(nfecra,*)
+ write(nfecra,*) '==================================================='
+ write(nfecra,*) 'printing meteo profiles'
+ endif
+ write(nfecra,*) 'year, quant-day , hour, minute, second'
+ write(nfecra,7995) annee, quant,heure,minute,second
+ 7995 format(1x, 5f8.2)
+ write(nfecra,*) 'tmprom(itp)'
+ write(nfecra,7996) tmprom(itp)
+ 7996 format(1x, f8.2)
+ write(nfecra,*) 'zdprom,uprom,vprom,ekprom,epprom'
+ do ii=1,nbmetd
+ write(nfecra,7997) &
+ zdprom(ii), uprom(ii,itp), vprom(ii,itp), &
+ ekprom(ii,itp), epprom(ii,itp)
+ 7997 format(1x, 3f8.2,2e10.3)
+ enddo
+ write(nfecra,*) 'ztprom,ttprom,tpprom,rprom,phprom,qvprom'
+ do ii=1,nbmett
+ write(nfecra,7998) &
+ ztprom(ii), ttprom(ii,itp), tpprom(ii,itp), &
+ rprom(ii,itp), phprom(ii,itp), qvprom(ii,itp)
+ 7998 format(1x, 3f8.2,f8.4,f12.3,e10.3)
+ enddo
+
+endif
+
+!================================================================================
+! 10. END OF THE LOOP ON TIME
+!================================================================================
+
+goto 100
+
+ 906 continue
+
+if (imode.eq.0) nbmetm= itp-1
+
+close(unit=impmet)
+
+! ---
+! END
+! ---
+return
+
+!============================
+! XX. ERROR OUTPUTS
+!============================
+
+ 99 continue
+write ( nfecra,9998 )
+call csexit (1)
+!==========
+
+ 999 continue
+write ( nfecra,9999 )
+call csexit (1)
+!==========
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+ 8000 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ATDIMM) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ATMOSPHERIQUE ',/, &
+'@ ',/,&
+'@ Erreur dans le fichier meteo: ',/,&
+'@ ordre chronologique des profils non respecte ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ATDIMM) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ATMOSPHERIQUE ',/,&
+'@ ',/,&
+'@ Erreur dans le fichier meteo: ',/,&
+'@ le nombre de mesures de temperatures doit �tre ',/,&
+'@ superieur a 2 ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8002 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ATDIMM) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ATMOSPHERIQUE ',/,&
+'@ ',/,&
+'@ Erreur dans le fichier meteo: ',/,&
+'@ le nombre de mesures de vitesses doit �tre ',/,&
+'@ superieur a 2 ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ATDIMM) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ATMOSPHERIQUE ',/,&
+'@ ',/,&
+'@ Erreur a l''ouverture du fichier meteo ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ATDIMM) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ATMOSPHERIQUE ',/,&
+'@ ',/,&
+'@ Erreur a la lecture du fichier meteo. ',/,&
+'@ Le fichier a ete ouvert mais est peut etre incomplet ',/,&
+'@ ou son format inadapte. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 8000 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA (ATDIMM) ',/,&
+'@ ======= ',/,&
+'@ ATMOSPHERIC SPECIFIC PHYSICS ',/,&
+'@ ',/,&
+'@ Error in the meteo profile file: ',/,&
+'@ non chronological meteo profiles ',/,&
+'@ ',/,&
+'@ The computation will not be run ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA (ATDIMM) ',/,&
+'@ ======= ',/,&
+'@ ATMOSPHERIC SPECIFIC PHYSICS ',/,&
+'@ ',/,&
+'@ Error in the meteo profile file: ',/,&
+'@ the number of temperature measurements must be larger ',/,&
+'@ than 2 ',/,&
+'@ ',/,&
+'@ The computation will not be run ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8002 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA (ATDIMM) ',/,&
+'@ ======= ',/,&
+'@ ATMOSPHERIC SPECIFIC PHYSICS ',/,&
+'@ ',/,&
+'@ Error in the meteo profile file: ',/,&
+'@ the number of velocity measurements must be larger ',/,&
+'@ than 2 ',/,&
+'@ ',/,&
+'@ The computation will not be run ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA (ATDIMM) ',/,&
+'@ ======= ',/,&
+'@ ATMOSPHERIC SPECIFIC PHYSICS ',/,&
+'@ ',/,&
+'@ Error opening the meteo profile file ',/,&
+'@ ',/,&
+'@ The computation will not be run ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA (ATDIMM) ',/,&
+'@ ======= ',/,&
+'@ ATMOSPHERIC SPECIFIC PHYSICS ',/,&
+'@ ',/,&
+'@ Error opening the meteo profile file ',/,&
+'@ The meteo profile file has been opened but its content ',/,&
+'@ is incomplete or under a wrong format ',/,&
+'@ ',/,&
+'@ The computation will not be run ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+end
+
+
diff --git a/src/atmo/atmcls.f90 b/src/atmo/atmcls.f90
new file mode 100644
index 0000000..0b7b049
--- /dev/null
+++ b/src/atmo/atmcls.f90
@@ -0,0 +1,350 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atmcls &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , ifac , iel , &
+ uk , utau , yplus , &
+ uet , &
+ gredu , q0 , e0 , rib , lmo , &
+ cfnnu , cfnns , cfnnk , cfnne , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FUNCTION :
+! --------
+! Compute u*, q0, e0, (momentum, sensible heat and latent heat fluxes)
+! for a non neutral atmospheric surface layer using the explicit formula
+! developped for the ECMWF by Louis (1982)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifac ! e ! <-- ! face de bord traitee !
+! iel ! e ! <-- ! cellule de bord en regard de la face !
+! ! ! ! traitee !
+! uk ! r ! <-- ! vitesse de frottement cf entete !
+! utau ! r ! <-- ! vitesse moyenne tangentielle !
+! yplus ! r ! <-- ! distance adim a la paroi !
+! ! ! ! calculee au moyen de uk !
+! uet ! r ! <-- ! vitesse de frottement cf entete !
+! gredu ! r ! --> ! reduced gravity for non horizontal wall !
+! q0, e0 ! r ! <-- ! sensible and latent heat flux !
+! rib, lmo ! r ! <-- ! Richardson number and Monin-Obukhov length !
+! coeffu,s,k,e ! r ! <-- ! non neutral correction coefficients for !
+! ! ! ! profiles of momentum scalar turbulence !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "atincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ifac , iel
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision uk, utau, yplus, uet
+double precision gredu, rib, lmo, q0, e0
+double precision cfnnu, cfnns, cfnnk,cfnne
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+double precision tpot1,tpot2,tpotv1,tpotv2
+double precision rscp1,rscp2
+double precision actu,actt,b,c,d
+double precision fm,fh,fmden1,fmden2,fhden
+double precision rugd,rugt,distbf
+
+!===============================================================================
+
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+b = 5.d0
+c = 5.d0
+d = 5.d0
+rib = 0.d0
+lmo = 999.d0
+q0 = 0.d0
+e0 = 0.d0
+
+rugd = rcodcl(ifac,iu(iphas),3)
+distbf = yplus*rugd
+rugt = rcodcl(ifac,isca(iscalt(iphas)),3)
+actu = xkappa/log((distbf+rugd)/rugd)
+actt = xkappa/log((distbf+rugt)/rugt)
+
+! prise en compte de l'humidite dans le rapport r/cp
+!if ( ippmod(iatmos).eq.2 ) then
+! rscp1=(rair/cp0(iphas))*(1.+(rvsra-cpvcpa)*qvs(ifac))
+! rscp2=(rair/cp0(iphas))*(1.+(rvsra-cpvcpa)*qv(iel))
+!else
+ rscp1 = rair/cp0(iphas)
+ rscp2 = rair/cp0(iphas)
+!endif
+
+ tpot1 = rcodcl(ifac,isca(iscalt(iphas)),1)
+ tpot2 = rtp(iel,isca(iscalt(iphas)))
+
+! ......... ............................................
+! 3.2 - compute virtual potential temperature at two levels
+! ......... ............................................
+!if ( ippmod(iatmos).eq.2 ) then
+! tpotv1=tpot1*(1.+(rvsra-1.)*qvs(ifac))
+! tpotv2=tpot2*(1.+(rvsra-1.)*qv(iel))
+!else
+ tpotv1 = tpot1
+ tpotv2 = tpot2
+!endif
+
+! ......... .....................................
+! 3.3 - compute layer average Richardson number
+! ......... .....................................
+
+if (abs(utau).le.epzero) then
+ rib = 0.d0
+else
+ rib = 2.d0*gredu*distbf*(tpotv2-tpotv1)/(tpotv1+tpotv2)/utau/utau
+endif
+
+! ......... ..................................................
+! 3.4 - compute corrction factors based on ECMWF parametrisation
+! Louis (1982)
+! ...............................................................
+
+ if (rib.ge.0.d0) then
+ fm = 1./(1.+2.*b*rib/sqrt(1.+d*rib))
+ fh = 1/(1.+3.*b*rib*sqrt(1.+d*rib))
+ else
+ fmden1 = (distbf+rugt)*abs(rib)/rugt
+ fmden2 = 1.+3.d0*b*c*actu*actt*sqrt(fmden1)
+ fm = 1.d0-2.*b*rib/fmden2
+ fhden = 3.d0*b*c*actu*actt*sqrt((distbf+rugt)/rugt)
+ fh = 1.d0-(3.d0*b*rib)/(1.d0+fhden*sqrt(abs(rib)))
+ endif
+
+ cfnnu = 1.d0/sqrt(fm)
+ cfnns = sqrt(fm)/fh
+ cfnnk = sqrt(1.d0-rib) ! +correction with turbulent Prandtl
+ cfnne = (1.d0-rib)/sqrt(fm)
+
+! ------------------------------------
+! 4 - compute friction velocity uet
+! ------------------------------------
+
+ uet = actu * utau * sqrt(fm)
+
+! -----------------------------------------
+! 5 - compute surface sensible heat flux q0
+! -----------------------------------------
+
+ q0 = (tpot1-tpot2) * uet * actt * fh / sqrt(fm)
+
+! -----------------------------------------------
+! 6 - compute Monin-Obukhov lenght (Garratt p 38)
+! -----------------------------------------------
+
+if (abs(gredu*q0).le.epzero) then
+ lmo = -99999.d0
+else
+ lmo = -uet**3*(t0(iphas)+tkelvi)/(xkappa*abs(gredu)*q0)
+endif
+
+! ---------------------------------------
+! 7 - compute surface latent heat flux e0
+! ---------------------------------------
+
+! if ( ippmod(iatmos).eq.2 ) then
+! e0 = (qvs(ifac)-qv(iel)) * uet * actt * fh / sqrt(fm)
+! endif
+
+!----
+! fin
+!----
+
+return
+end subroutine
diff --git a/src/atmo/atphyv.f90 b/src/atmo/atphyv.f90
new file mode 100644
index 0000000..443489e
--- /dev/null
+++ b/src/atmo/atphyv.f90
@@ -0,0 +1,367 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! REMPLISSAGE DES VARIABLES PHYSIQUES : Atmospheric Version
+
+
+! ATTENTION :
+! =========
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "atincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivart, iclvar, iel, iphas
+integer ipcrom, ipbrom, ipcvis, ipccp, ipctem
+integer ipcvsl, ith, iscal, ii
+integer iutile
+double precision vara, varb, varc, varam, varbm, varcm, vardm
+double precision varal, varbl, varcl, vardl
+double precision varac, varbc
+double precision xrtp,pp,zent
+
+!===============================================================================
+
+
+
+!===============================================================================
+! 0. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+! (et de ses conditions limites)
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ if (iscalt(iphas).gt.0) then
+ ivart = isca(iscalt(iphas))
+ else
+ write(nfecra,9010) iscalt(iphas)
+ call csexit (1)
+ endif
+
+! --- Position des conditions limites de la variable IVART
+
+ iclvar = iclrtp(ivart,icoef)
+
+! --- Rang de la masse volumique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCROM
+! dans PROPFB, prop. physiques au centre des faces de bord : IPBROM
+
+ ipcrom = ipproc(irom(iphas))
+ ipbrom = ipprob(irom(iphas))
+ ipctem = ipproc(itempc)
+
+! From potential temperature, compute:
+! - Temperature in Celsius
+! - Density
+! ----------------------
+
+ do iel = 1, ncel
+
+ xrtp = rtp(iel,ivart) ! The thermal scalar is potential temperature
+
+! Pressure profile from meteo file:
+ zent=xyzcen(3,iel)
+ call intprf &
+! ===========
+ ( nbmett, nbmetm, &
+ ra(iztmet) , ra(itmmet) , ra(iphmet) , zent, ttcabs, pp )
+
+! Temperature in Celsius in cell centers:
+! ---------------------------------------
+! law: T = theta * (p/psol) ** (Rair/Cp0)
+
+ propce(iel, ipctem) = xrtp*(pp/p0(iphas))**(rair/cp0(iphas))
+ propce(iel, ipctem) = propce(iel, ipctem) - tkelvi
+
+! Density in cell centers:
+! ------------------------
+! law: RHO = P / ( Rair * T(K) )
+
+ propce(iel,ipcrom) = pp/(rair*xrtp)*(p0(iphas)/pp)**(rair/cp0(iphas))
+
+ enddo
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+
+!===============================================================================
+! FORMATS
+!----
+
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ APPEL A csexit DANS LE SOUS PROGRAMME atphyv ',/,&
+'@ ',/,&
+'@ La variable dont dependent les proprietes physiques ne ',/,&
+'@ semble pas etre une variable de calcul. ',/,&
+'@ En effet, on cherche a utiliser la temperature alors que',/,&
+'@ ISCALT(IPHAS) = ',I10 ,/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage de usphyv (et le test lors de la ',/,&
+'@ definition de IVART). ',/,&
+'@ Verifier la definition des variables de calcul dans ',/,&
+'@ usini1. Si un scalaire doit jouer le role de la ',/,&
+'@ temperature, verifier que ISCALT a ete renseigne. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end subroutine
diff --git a/src/atmo/atprke.f90 b/src/atmo/atprke.f90
new file mode 100644
index 0000000..d7cdd44
--- /dev/null
+++ b/src/atmo/atprke.f90
@@ -0,0 +1,295 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atprke &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , ipcvto, &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ tinstk , tinste , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! FONCTION :
+! --------
+! SPECIFIQUE AU CAS ATMOSPHERIQUE :
+! CALCUL DU TERME DE PRODUCTION LIEE A LA FLOTTABILITE:
+! G = G*GRAD(THETA)/PRDTUR/THETA
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel)
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! irespr(ncelet ! te ! --- ! tab entier multigrille !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord
+! coefa, coefb ! tr ! <- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord
+! w1...6(ncelet ! tr ! --- ! tableaux de travail !
+!tinstk(ncelet) ! tr ! <-- ! prod et terme de gravite pour eq k !
+!tinste(ncelet) ! tr ! <-- ! prod et terme de gravite pour eq eps !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse, iphas
+integer ipcvto
+
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rtp (ncelet,*), rtpa (ncelet,*)
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision tinstk(ncelet), tinste(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+integer idebra, idebia
+integer iel
+integer itpp , icltpp
+integer iccocg, inc
+integer iivar, iphydp
+integer nswrgp, epsrgp, imligp
+integer iwarnp, climgp, extrap
+
+double precision gravke, prdtur
+
+
+!
+!===============================================================================
+!
+!===============================================================================
+! 1. Initialisation
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. Calcul des derivees de la temperature potentielle
+!===============================================================================
+
+if (ippmod(iatmos).eq.1) then
+
+
+ itpp = isca(iscalt(iphas))
+ icltpp = iclrtp(itpp,icoef)
+
+! ---- Options de calcul:
+
+ iccocg = 1
+ inc = 1
+
+ nswrgp = nswrgr(itpp)
+ epsrgp = epsrgr(itpp)
+ imligp = imligr(itpp)
+ iwarnp = iwarni(itpp)
+ climgp = climgr(itpp)
+ extrap = extrag(itpp)
+
+ iivar = 0
+
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iivar , imrgra , inc , iccocg , nswrgp ,imligp, iphydp, &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo ,xyznod , volume, &
+ w1 , w1 , w1 , &
+ rtpa(1,itpp), coefa(1,icltpp) , coefb(1,icltpp) , &
+ w4 , w5 , w6 , &
+! ------ ------ ------
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+
+! Production et terme de gravite
+! TINSTK=P+G et TINSTE=P+(1-CE3)*G
+
+ if(iscalt(iphas).gt.0.and.nscal.ge.iscalt(iphas)) then
+ prdtur = sigmas(iscalt(iphas))
+ else
+ prdtur = 1.d0
+ endif
+
+! En production lineaire, on multiplie tout de suite le terme
+! de gravite par VISCT, car le reste est deja multiplie.
+! Dans les autres cas, la multiplication est faite plus tard.
+ if (iturb(iphas).eq.21) then
+ do iel = 1, ncel
+ gravke = -(w4(iel)*gx + w5(iel)*gy + w6(iel)*gz) &
+ / (rtp(iel,itpp)*prdtur)
+ tinste(iel) = tinstk(iel) + propce(iel,ipcvto)*max(gravke,zero)
+ tinstk(iel) = tinstk(iel) + propce(iel,ipcvto)*gravke
+ enddo
+ else
+ do iel = 1, ncel
+ gravke = -(w4(iel)*gx + w5(iel)*gy + w6(iel)*gz) &
+ / (rtp(iel,itpp)*prdtur)
+ tinste(iel) = tinstk(iel) + max(gravke,zero)
+ tinstk(iel) = tinstk(iel) + gravke
+ enddo
+ endif
+
+endif
+!----
+! FIN
+!----
+return
+end subroutine
diff --git a/src/atmo/atprop.f90 b/src/atmo/atprop.f90
new file mode 100644
index 0000000..c109256
--- /dev/null
+++ b/src/atmo/atprop.f90
@@ -0,0 +1,163 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atprop &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT
+! POUR LE MODULE ATMOSPHERIQUE
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! <-- ! numero de la derniere propriete !
+! ! ! ! (les proprietes sont dans propce, !
+! ! ! ! propfa ou prpfb) !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "atincl.h"
+include "ppincl.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp, ipppst
+
+! VARIABLES LOCALES
+
+integer iprop, ipropc
+
+!===============================================================================
+! 1. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFA, PROPFB
+! Atmospheric modules: dry and humid atmosphere
+!===============================================================================
+
+
+! ---> Temperature (IPPMOD(IATMOS) = 1 or 2)
+!-------------------------------------------------------------------------------
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+iprop = ipropp
+
+iprop = iprop + 1
+itempc = iprop
+
+! ---> Liquid water content (IPPMOD(IATMOS) = 2)
+!-------------------------------------------------------------------------------
+
+if ( ippmod(iatmos).eq.2) then
+ iprop = iprop + 1
+ iliqwt = iprop
+endif
+
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+nsalpp = iprop - ipropp
+nsalto = iprop
+
+! ---- On renvoie IPROPP au cas ou d'autres proprietes devraient
+! etre numerotees ensuite
+
+ipropp = iprop
+
+
+! ---> Positionnement dans le tableau PROPCE
+! et reperage du rang pour le post-traitement
+
+iprop = nproce
+
+iprop = iprop + 1
+ipproc(itempc) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+if (ippmod(iatmos).eq.2) then
+
+ iprop = iprop + 1
+ ipproc(iliqwt) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+endif
+
+nproce = iprop
+
+
+! - Interface Code_Saturne
+! ======================
+
+if (iihmpr.eq.1) then
+
+ call uiatpr &
+ !==========
+( nsalpp, nsalto, ippmod, iatmos, &
+ ipppro, ipproc, itempc, iliqwt)
+
+endif
+
+return
+end subroutine
diff --git a/src/atmo/attycl.f90 b/src/atmo/attycl.f90
new file mode 100644
index 0000000..fa54695
--- /dev/null
+++ b/src/atmo/attycl.f90
@@ -0,0 +1,396 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine attycl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbmetd , nbmett , nbmetm , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , iprofm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ tmprom , ztprom , zdprom , xmet , ymet , pmer , &
+ ttprom , qvprom , uprom , vprom , ekprom , epprom , &
+ rprom , tpprom , phprom , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! ECOULEMENTS ATMOSPHERIQUES
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbmetd , nbmett , nbmetm
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor), iprofm(nozppm)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision tmprom(nbmetm)
+double precision ztprom(nbmett) , zdprom(nbmetd)
+double precision xmet(nbmetm) , ymet(nbmetm) , pmer(nbmetm)
+double precision ttprom(nbmett,nbmetm) , qvprom(nbmett,nbmetm)
+double precision uprom(nbmetd,nbmetm) , vprom(nbmetd,nbmetm)
+double precision ekprom(nbmetd,nbmetm) , epprom(nbmetd,nbmetm)
+double precision rprom(nbmett,nbmetm) , tpprom(nbmett,nbmetm)
+double precision phprom(nbmett,nbmetm)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, izone, iphas
+double precision d2s3, zent, vs, xuent, xvent
+double precision xkent, xeent, tpent
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+xuent = 0.d0
+xvent = 0.d0
+xkent = 0.d0
+xeent = 0.d0
+tpent = 0.d0
+
+!===============================================================================
+! 2. SI IPROFM = 1 : CHOIX ENTREE/SORTIE SUIVANT LE PROFIL METEO SI
+! ITYPFB N'A PAS ETE MODIFIE
+! VARIABLES TIREES DU PROFIL METEO SI
+! RCODCL(IFAC,IVAR,1) N'A PAS ETE MODIFIE
+
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+ if (iprofm(izone).eq.1) then
+
+! On recupere les valeurs du profil et on met a jour RCODCL s'il n'a pas
+! ete modifie. Il servira si la face est une face d'entree ou si c'est une
+! face de sortie (si le flux est rentrant).
+ zent=cdgfbo(3,ifac)
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, uprom , zent , ttcabs, xuent )
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, vprom , zent , ttcabs, xvent )
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, ekprom, zent , ttcabs, xkent )
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, epprom, zent , ttcabs, xeent )
+
+ call intprf &
+ !==========
+ (nbmett, nbmetm, &
+ ztprom, tmprom, tpprom, zent , ttcabs, tpent )
+!
+ vs = xuent*surfbo(1,ifac) + xvent*surfbo(2,ifac)
+
+ do iphas = 1, nphas
+
+
+! On met a jour le type de face de bord s'il n'a pas ete specifie
+! par l'utilisateur.
+! Pour une entree, on remplit la condition de Dirichlet si elle n'a pas
+! ete specifiee par utilisateur.
+
+ if (vs.gt.0) then
+ if (itypfb(ifac,iphas).eq.0) itypfb(ifac,iphas) = isolib
+ else
+ if (itypfb(ifac,iphas).eq.0) itypfb(ifac,iphas) = ientre
+
+
+ if (rcodcl(ifac,iu(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iu(iphas),1) = xuent
+ if (rcodcl(ifac,iv(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iv(iphas),1) = xvent
+ if (rcodcl(ifac,iw(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+ if (itytur(iphas).eq.2) then
+
+ if (rcodcl(ifac,ik(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ik(iphas),1) = xkent
+ if (rcodcl(ifac,iep(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ if (rcodcl(ifac,ir11(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ if (rcodcl(ifac,ir22(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ if (rcodcl(ifac,ir33(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ if (rcodcl(ifac,ir12(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ if (rcodcl(ifac,ir13(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ if (rcodcl(ifac,ir23(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ if (rcodcl(ifac,iep(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ if (rcodcl(ifac,ik(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ik(iphas),1) = xkent
+ if (rcodcl(ifac,iep(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iep(iphas),1) = xeent
+ if (rcodcl(ifac,iphi(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ if (rcodcl(ifac,ifb(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ if (rcodcl(ifac,ik(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ik(iphas),1) = xkent
+ if (rcodcl(ifac,iomg(iphas),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ if (iscalt(iphas).ne.-1) then
+
+ if (rcodcl(ifac,isca(iscalt(iphas)),1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,isca(iscalt(iphas)),1) = tpent
+
+ endif
+
+ endif
+
+ enddo
+
+ endif
+
+enddo
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/atmo/atvarp.f90 b/src/atmo/atvarp.f90
new file mode 100644
index 0000000..00ab2c7
--- /dev/null
+++ b/src/atmo/atvarp.f90
@@ -0,0 +1,144 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine atvarp
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES POUR LE MODULE ATMOSPHERIQUE
+! REMPLISSAGE DES PARAMETRES (DEJA DEFINIS) POUR LES SCALAIRES PP
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "atincl.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer isc, iphas
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! 1.1 Dry atmosphere
+! =====================
+
+if ( ippmod(iatmos).eq.1 ) then
+
+! ---- Potential temperature
+ itempp = iscapp(1)
+
+endif
+
+
+! 1.2 Humid atmosphere
+! =====================
+
+if ( ippmod(iatmos).eq.2 ) then
+
+ ! ---- liquid potential temperature
+ itempl = iscapp(1)
+ ! ---- total water content
+ itotwt = iscapp(2)
+ ! ---- total number of droplets
+ intdrp = iscapp(3)
+
+endif
+
+! - Interface Code_Saturne
+! ======================
+
+if (iihmpr.eq.1) then
+
+ call uiatsc (ippmod, iatmos, itempp, itempl, itotwt, intdrp)
+ !==========
+
+endif
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+! A RENSEIGNER OBLIGATOIREMENT (sinon pb dans varpos)
+! IPHSCA, IVISLS, ICP
+!===============================================================================
+
+do isc = 1, nscapp
+
+ if ( iscavr(iscapp(isc)).le.0 ) then
+
+ ! ---- Notre physique particuliere est monophasique
+ iphsca(iscapp(isc)) = 1
+
+ ! ---- Viscosite dynamique moleculaire constante pour les
+ ! scalaires ISCAPP(ISC)
+ ivisls(iscapp(isc)) = 0
+
+ endif
+
+enddo
+
+! ---- Cp est constant
+iphas = iphsca(iscapp(1))
+icp(iphas) = 0
+
+return
+end
+
diff --git a/src/atmo/intprf.f90 b/src/atmo/intprf.f90
new file mode 100644
index 0000000..ef96df2
--- /dev/null
+++ b/src/atmo/intprf.f90
@@ -0,0 +1,150 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2007 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine intprf &
+!================
+! ------------------------------------------------------
+ ( nprofz , nproft , &
+ profz , proft , profv , xz , temps , var )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INTERPOLATION VERTICALE-TEMPORELLE OPTIMISEE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! vi ! r ! --> ! resultat de l'interpolation !
+! zi ! r ! <-- ! altitude a laquelle on interpole !
+! ti ! r ! <-- ! temps physique auquel on interpole !
+! aprom ! tr ! <-- ! variables des profils meteo a !
+! ! ! ! interpoler !
+! tmprom ! tr ! <-- ! instants des profils meteo a !
+! ! ! ! interpoler !
+! zdprom ! e ! <-- ! altitudes des profils meteo a !
+! ! ! ! interpoler !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer nprofz, nprofv, nproft
+double precision profz(nprofz), proft(nproft)
+double precision profv(nprofz,nproft)
+double precision xz, temps, var
+
+! VARIABLES LOCALES
+
+integer it, it1, it2
+integer iz, iz1, iz2
+double precision alphaz, alphat, var1, var2
+
+!===============================================================================
+
+!===============================================================================
+! 1. INTERPOLATION EN TEMPS
+!===============================================================================
+
+if (temps.le.proft(1)) then
+ it1 = 1
+ it2 = 1
+ alphat = 1.d0
+else if (temps.ge.proft(nproft)) then
+ it1 = nproft
+ it2 = nproft
+ alphat = 1.d0
+! sinon on a forcement NPROFT>1
+else
+ it = 1
+ 102 continue
+ if (temps.gt.proft(it+1)) then
+ it = it + 1
+ goto 102
+ else
+ it1 = it
+ it2 = it+1
+ alphat = (proft(it2)-temps)/(proft(it2)-proft(it1))
+ endif
+endif
+
+!===============================================================================
+! 2. INTERPOLATION VERTICALE EN ESPACE
+!===============================================================================
+
+if (xz.le.profz(1)) then
+ iz1 = 1
+ iz2 = 1
+ alphaz = 1.d0
+else if (xz.ge.profz(nprofz)) then
+ iz1 = nprofz
+ iz2 = nprofz
+ alphaz = 1.d0
+! sinon on a forcement NPROFZ>1
+else
+ iz = 1
+ 103 continue
+ if (xz.gt.profz(iz+1)) then
+ iz = iz + 1
+ goto 103
+ else
+ iz1 = iz
+ iz2 = iz+1
+ alphaz = (profz(iz2)-xz)/(profz(iz2)-profz(iz1))
+ endif
+endif
+
+!===============================================================================
+! 3. INTERPOLATION
+!===============================================================================
+
+var1 = alphaz*profv(iz1,it1) + (1.d0-alphaz)*profv(iz2,it1)
+var2 = alphaz*profv(iz1,it2) + (1.d0-alphaz)*profv(iz2,it2)
+
+var = alphat*var1 + (1.d0-alphat)*var2
+
+end
+
+
+
+
diff --git a/src/atmo/mematm.f90 b/src/atmo/mematm.f90
new file mode 100644
index 0000000..41bddb7
--- /dev/null
+++ b/src/atmo/mematm.f90
@@ -0,0 +1,153 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mematm &
+!================
+
+ ( idbia0 , idbra0 , ifinia , ifinra , ra )
+!===============================================================================
+! FONCTION
+! --------
+
+! MEMORY MANAGEMENT FOR THE ATMOSPHERIC SPECIFIC PHYSICS MODULE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._______________.________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! COMMON DATA
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "ppppar.h"
+include "atincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0, ifinia, ifinra
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, imode
+double precision w1
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. MEMORY MANAGEMENT FOR THE METEO PROFILES
+!===============================================================================
+
+! 2.1 READING THE METEO FILE IN ORDER TO ESTIMATE THE REQUIRED SIZE OF
+! THE TABLES
+!-------------------------------------------------------------------------------
+if (imeteo.gt.0) then
+
+ imode = 0
+
+! Nb les arguments ne sont pas utilises quand IMODE=0
+ call atlecm &
+ !==========
+ ( imode , &
+ w1 , w1 , w1 , &
+ w1 , w1 , w1 , &
+ w1 , w1 , &
+ w1 , w1 , &
+ w1 , w1 , &
+ w1 , w1 , w1 )
+
+ endif
+
+! 2.2 MEMORY MANAGEMENT :
+! ------------------------
+
+! --> Integer
+
+ifinia = idebia
+
+! --> Real
+
+itmmet = idebra
+izdmet = itmmet + nbmetm
+iztmet = izdmet + nbmetd
+iumet = iztmet + nbmett
+ivmet = iumet + nbmetd*nbmetm
+iwmet = ivmet + nbmetd*nbmetm
+iekmet = iwmet + nbmetd*nbmetm
+iepmet = iekmet + nbmetd*nbmetm
+ittmet = iepmet + nbmetd*nbmetm
+iqvmet = ittmet + nbmett*nbmetm
+ipmer = iqvmet + nbmett*nbmetm
+ixmet = ipmer + nbmetm
+iymet = ixmet + nbmetm
+irmet = iymet + nbmetm
+itpmet = irmet + nbmett*nbmetm
+iphmet = itpmet + nbmett*nbmetm
+ifinra = iphmet + nbmett*nbmetm
+
+! --> Verification
+
+CALL IASIZE('MEMATM',IFINIA)
+!==========
+
+CALL RASIZE('MEMATM',IFINRA)
+!==========
+
+!----
+! FIN
+!----
+
+return
+end
+
+
diff --git a/src/base/Makefile.am b/src/base/Makefile.am
new file mode 100644
index 0000000..a5f055f
--- /dev/null
+++ b/src/base/Makefile.am
@@ -0,0 +1,477 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/lagr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MEI_CPPFLAGS@ @MPI_CPPFLAGS@ @LIBXML2_CPPFLAGS@ @BLAS_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+-I$(top_srcdir)/include/cfbl \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/mati \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/base/alaste.h \
+$(top_srcdir)/include/base/albase.h \
+$(top_srcdir)/include/base/alstru.h \
+$(top_srcdir)/include/base/cplsat.h \
+$(top_srcdir)/include/base/cs_ale.h \
+$(top_srcdir)/include/base/cs_ast_coupling.h \
+$(top_srcdir)/include/base/cs_base.h \
+$(top_srcdir)/include/base/cs_benchmark.h \
+$(top_srcdir)/include/base/cs_blas.h \
+$(top_srcdir)/include/base/cs_boundary_conditions.h \
+$(top_srcdir)/include/base/cs_calcium.h \
+$(top_srcdir)/include/base/cs_coupling.h \
+$(top_srcdir)/include/base/cs_ext_neighborhood.h \
+$(top_srcdir)/include/base/cs_gradient.h \
+$(top_srcdir)/include/base/cs_grid.h \
+$(top_srcdir)/include/base/cs_gui.h \
+$(top_srcdir)/include/base/cs_gui_boundary_conditions.h \
+$(top_srcdir)/include/base/cs_gui_matisse.h \
+$(top_srcdir)/include/base/cs_gui_mobile_mesh.h \
+$(top_srcdir)/include/base/cs_gui_particles.h \
+$(top_srcdir)/include/base/cs_gui_radiative_transfer.h \
+$(top_srcdir)/include/base/cs_gui_specific_physics.h \
+$(top_srcdir)/include/base/cs_gui_util.h \
+$(top_srcdir)/include/base/cs_gui_variables.h \
+$(top_srcdir)/include/base/cs_halo.h \
+$(top_srcdir)/include/base/cs_io.h \
+$(top_srcdir)/include/base/cs_join.h \
+$(top_srcdir)/include/base/cs_join_intersect.h \
+$(top_srcdir)/include/base/cs_join_merge.h \
+$(top_srcdir)/include/base/cs_join_mesh.h \
+$(top_srcdir)/include/base/cs_join_post.h \
+$(top_srcdir)/include/base/cs_join_set.h \
+$(top_srcdir)/include/base/cs_join_split.h \
+$(top_srcdir)/include/base/cs_join_update.h \
+$(top_srcdir)/include/base/cs_join_util.h \
+$(top_srcdir)/include/base/cs_matrix.h \
+$(top_srcdir)/include/base/cs_mesh_coherency.h \
+$(top_srcdir)/include/base/cs_mesh_connect.h \
+$(top_srcdir)/include/base/cs_mesh.h \
+$(top_srcdir)/include/base/cs_mesh_halo.h \
+$(top_srcdir)/include/base/cs_mesh_quality.h \
+$(top_srcdir)/include/base/cs_mesh_quantities.h \
+$(top_srcdir)/include/base/cs_mesh_solcom.h \
+$(top_srcdir)/include/base/cs_mesh_warping.h \
+$(top_srcdir)/include/base/cs_multigrid.h \
+$(top_srcdir)/include/base/cs_numbering.h \
+$(top_srcdir)/include/base/cs_opts.h \
+$(top_srcdir)/include/base/cs_parall.h \
+$(top_srcdir)/include/base/cs_perio.h \
+$(top_srcdir)/include/base/cs_post.h \
+$(top_srcdir)/include/base/cs_preprocessor_data.h \
+$(top_srcdir)/include/base/cs_prototypes.h \
+$(top_srcdir)/include/base/cs_proxy_comm.h \
+$(top_srcdir)/include/base/cs_renumber.h \
+$(top_srcdir)/include/base/cs_restart.h \
+$(top_srcdir)/include/base/cs_sat_coupling.h \
+$(top_srcdir)/include/base/cs_search.h \
+$(top_srcdir)/include/base/cs_selector.h \
+$(top_srcdir)/include/base/cs_sles.h \
+$(top_srcdir)/include/base/cs_sort.h \
+$(top_srcdir)/include/base/cs_syr3_comm.h \
+$(top_srcdir)/include/base/cs_syr3_coupling.h \
+$(top_srcdir)/include/base/cs_syr3_messages.h \
+$(top_srcdir)/include/base/cs_syr4_coupling.h \
+$(top_srcdir)/include/base/cs_syr_coupling.h \
+$(top_srcdir)/include/base/cstnum.h \
+$(top_srcdir)/include/base/cs_tpar1d.h \
+$(top_srcdir)/include/base/cstphy.h \
+$(top_srcdir)/include/base/cs_ventil.h \
+$(top_srcdir)/include/base/dimens.h \
+$(top_srcdir)/include/base/dimfbr.h \
+$(top_srcdir)/include/base/entsor.h \
+$(top_srcdir)/include/base/ihmpre.h \
+$(top_srcdir)/include/base/mltgrd.h \
+$(top_srcdir)/include/base/numvar.h \
+$(top_srcdir)/include/base/optcal.h \
+$(top_srcdir)/include/base/parall.h \
+$(top_srcdir)/include/base/paramx.h \
+$(top_srcdir)/include/base/period.h \
+$(top_srcdir)/include/base/pointe.h \
+$(top_srcdir)/include/base/tcpumx.h \
+$(top_srcdir)/include/base/tremai.h \
+$(top_srcdir)/include/base/vector.h \
+$(top_srcdir)/include/base/vortex.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcshot.la \
+ libcsbase.la
+
+libcshot_la_CFLAGS = @CFLAGS_DBG@ @CFLAGS_HOT@
+libcshot_la_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+-I$(top_srcdir)/include/cfbl \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/mati \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_HOT@
+libcshot_la_SOURCES = \
+cs_benchmark.c \
+cs_blas.c \
+cs_matrix.c \
+cs_sles.c \
+gradmc.f90 \
+gradrc.f90 \
+prods2.f90 \
+prods3.f90 \
+prodsc.f90 \
+promav.f90
+libcshot_la_LDFLAGS = -no-undefined
+
+###
+
+libcsbase_la_SOURCES = \
+alelap.f90 \
+alemaj.f90 \
+altycl.f90 \
+armtps.f90 \
+autmgr.f90 \
+bilsc2.f90 \
+calgeo.f90 \
+calhyd.f90 \
+calmom.f90 \
+caltri.f90 \
+catsma.f90 \
+causta.f90 \
+clca66.f90 \
+cldijp.f90 \
+cldipo.f90 \
+clipke.f90 \
+clprij.f90 \
+clpsca.f90 \
+clptrg.f90 \
+clptur.f90 \
+clpv2f.f90 \
+clsurn.f90 \
+clsyvt.f90 \
+clvolc.f90 \
+codits.f90 \
+condli.f90 \
+cou1di.f90 \
+cou1do.f90 \
+coupbi.f90 \
+coupbo.f90 \
+covofi.f90 \
+cregeo.f90 \
+crstgr.f90 \
+cs_ale.c \
+cs_ast_coupling.c \
+cs_base.c \
+cs_boundary_conditions.c \
+cs_calcium.c \
+csc2cl.f90 \
+csc2ts.f90 \
+csccel.f90 \
+cscfbr.f90 \
+cscini.f90 \
+csclli.f90 \
+cscloc.f90 \
+cscpce.f90 \
+cscpfb.f90 \
+cs_coupling.c \
+cs_ext_neighborhood.c \
+csflsh.f90 \
+cs_gradient.c \
+cs_grid.c \
+cs_gui.c \
+cs_gui_boundary_conditions.c \
+cs_gui_matisse.c \
+cs_gui_mobile_mesh.c \
+cs_gui_particles.c \
+cs_gui_radiative_transfer.c \
+cs_gui_specific_physics.c \
+cs_gui_util.c \
+cs_halo.c \
+csinit.f90 \
+cs_io.c \
+cs_join.c \
+cs_join_f2c.f90 \
+cs_join_intersect.c \
+cs_join_merge.c \
+cs_join_mesh.c \
+cs_join_post.c \
+cs_join_set.c \
+cs_join_split.c \
+cs_join_update.c \
+cs_join_util.c \
+cs_mesh.c \
+cs_mesh_coherency.c \
+cs_mesh_connect.c \
+cs_mesh_halo.c \
+cs_mesh_quality.c \
+cs_mesh_quantities.c \
+cs_mesh_solcom.c \
+cs_mesh_warping.c \
+cs_multigrid.c \
+cs_numbering.c \
+cs_opts.c \
+cs_parall.c \
+cs_perio.c \
+cs_post.c \
+cs_post_f2c.f90 \
+cs_preprocessor_data.c \
+cs_proxy_comm.c \
+cs_renumber.c \
+cs_restart.c \
+cs_sat_coupling.c \
+cs_search.c \
+cs_selector.c \
+cs_selector_f2c.f90 \
+cs_sort.c \
+cs_syr3_comm.c \
+cs_syr3_coupling.c \
+cs_syr3_messages.c \
+cs_syr4_coupling.c \
+cs_syr_coupling.c \
+cs_syr_f2c.f90 \
+cs_tpar1d.c \
+cs_ventil.c \
+csprnt.f90 \
+distpr.f90 \
+distyp.f90 \
+divmas.f90 \
+divrij.f90 \
+dttvar.f90 \
+dvvpst.f90 \
+ecrava.f90 \
+ecrhis.f90 \
+ecrlis.f90 \
+findpt.f90 \
+grdcel.f90 \
+haltyp.f90 \
+hturbp.f90 \
+idrbla.f90 \
+impini.f90 \
+iniini.f90 \
+inimas.f90 \
+inipst.f90 \
+initi1.f90 \
+initi2.f90 \
+iniusi.f90 \
+iniva0.f90 \
+inivar.f90 \
+invers.f90 \
+iprbla.f90 \
+itrgrp.f90 \
+itrmas.f90 \
+lecamo.f90 \
+lecamp.f90 \
+lecamx.f90 \
+ledgeo.f90 \
+letgeo.f90 \
+majgeo.f90 \
+matrdt.f90 \
+matrix.f90 \
+memale.f90 \
+memcbr.f90 \
+memclg.f90 \
+memcli.f90 \
+memcs1.f90 \
+memcs2.f90 \
+memdis.f90 \
+memdtv.f90 \
+memdyp.f90 \
+memini.f90 \
+memkep.f90 \
+memkom.f90 \
+memnav.f90 \
+mempdc.f90 \
+memphy.f90 \
+memrij.f90 \
+memsca.f90 \
+memt1d.f90 \
+memtri.f90 \
+memtsm.f90 \
+memv2f.f90 \
+memvor.f90 \
+modini.f90 \
+modpar.f90 \
+navsto.f90 \
+newmrk.f90 \
+numvec.f90 \
+ordita.f90 \
+pergra.f90 \
+perinr.f90 \
+perinu.f90 \
+phyvar.f90 \
+precli.f90 \
+preduv.f90 \
+prmoy0.f90 \
+projts.f90 \
+proxav.f90 \
+recvmc.f90 \
+reseps.f90 \
+resolp.f90 \
+resrij.f90 \
+resssg.f90 \
+resv2f.f90 \
+rijech.f90 \
+rijthe.f90 \
+scalai.f90 \
+schtmp.f90 \
+stdtcl.f90 \
+strdep.f90 \
+strhis.f90 \
+strini.f90 \
+strpre.f90 \
+tcpumx.c \
+tdesi1.f90 \
+testel.f90 \
+tremai.c \
+tridim.f90 \
+tsepdc.f90 \
+tstvec.f90 \
+turbke.f90 \
+turbkw.f90 \
+turent.f90 \
+turrij.f90 \
+typecl.f90 \
+undscr.f90 \
+vandri.f90 \
+varpos.f90 \
+vectds.f90 \
+vericl.f90 \
+verini.f90 \
+verlon.f90 \
+vert1d.f90 \
+viscfa.f90 \
+visdyn.f90 \
+vislmg.f90 \
+visort.f90 \
+vissec.f90 \
+vissma.f90 \
+vissst.f90 \
+viswal.f90 \
+vor2cl.f90 \
+vordep.f90 \
+vorimp.f90 \
+vorin0.f90 \
+vorini.f90 \
+vorlgv.f90 \
+vorpre.f90 \
+vortex.f90 \
+vorver.f90 \
+vorvit.f90 \
+zufall.f90
+
+libcsbase_la_SOURCES += \
+$(top_srcdir)/users/base/usalcl.f90 \
+$(top_srcdir)/users/base/usalin.f90 \
+$(top_srcdir)/users/base/usaste.f90 \
+$(top_srcdir)/users/base/usclim.f90 \
+$(top_srcdir)/users/base/usdpst.f90 \
+$(top_srcdir)/users/base/ushist.f90 \
+$(top_srcdir)/users/base/usini1.f90 \
+$(top_srcdir)/users/base/usiniv.f90 \
+$(top_srcdir)/users/base/usjoin.f90 \
+$(top_srcdir)/users/base/uskpdc.f90 \
+$(top_srcdir)/users/base/usmodg.f90 \
+$(top_srcdir)/users/base/usmpst.f90 \
+$(top_srcdir)/users/base/usnpst.f90 \
+$(top_srcdir)/users/base/usphyv.f90 \
+$(top_srcdir)/users/base/usproj.f90 \
+$(top_srcdir)/users/base/uspt1d.f90 \
+$(top_srcdir)/users/base/ussatc.f90 \
+$(top_srcdir)/users/base/ussmag.f90 \
+$(top_srcdir)/users/base/usstru.f90 \
+$(top_srcdir)/users/base/ussyrc.f90 \
+$(top_srcdir)/users/base/usthht.f90 \
+$(top_srcdir)/users/base/ustmgr.f90 \
+$(top_srcdir)/users/base/ustske.f90 \
+$(top_srcdir)/users/base/ustskw.f90 \
+$(top_srcdir)/users/base/ustsma.f90 \
+$(top_srcdir)/users/base/ustsns.f90 \
+$(top_srcdir)/users/base/ustsri.f90 \
+$(top_srcdir)/users/base/ustssc.f90 \
+$(top_srcdir)/users/base/ustsv2.f90 \
+$(top_srcdir)/users/base/usvima.f90 \
+$(top_srcdir)/users/base/usvist.f90 \
+$(top_srcdir)/users/base/usvort.f90 \
+$(top_srcdir)/users/base/usvpst.f90
+
+basedir = $(pkgdatadir)/users/base
+base_DATA = \
+$(top_srcdir)/users/base/usalcl.f90 \
+$(top_srcdir)/users/base/usalin.f90 \
+$(top_srcdir)/users/base/usaste.f90 \
+$(top_srcdir)/users/base/usclim.f90 \
+$(top_srcdir)/users/base/usdpst.f90 \
+$(top_srcdir)/users/base/ushist.f90 \
+$(top_srcdir)/users/base/usini1.f90 \
+$(top_srcdir)/users/base/usiniv.f90 \
+$(top_srcdir)/users/base/usjoin.f90 \
+$(top_srcdir)/users/base/uskpdc.f90 \
+$(top_srcdir)/users/base/usmodg.f90 \
+$(top_srcdir)/users/base/usmpst.f90 \
+$(top_srcdir)/users/base/usnpst.f90 \
+$(top_srcdir)/users/base/usphyv.f90 \
+$(top_srcdir)/users/base/usproj.f90 \
+$(top_srcdir)/users/base/uspt1d.f90 \
+$(top_srcdir)/users/base/ussatc.f90 \
+$(top_srcdir)/users/base/ussmag.f90 \
+$(top_srcdir)/users/base/usstru.f90 \
+$(top_srcdir)/users/base/ussyrc.f90 \
+$(top_srcdir)/users/base/usthht.f90 \
+$(top_srcdir)/users/base/ustmgr.f90 \
+$(top_srcdir)/users/base/ustske.f90 \
+$(top_srcdir)/users/base/ustskw.f90 \
+$(top_srcdir)/users/base/ustsma.f90 \
+$(top_srcdir)/users/base/ustsns.f90 \
+$(top_srcdir)/users/base/ustsri.f90 \
+$(top_srcdir)/users/base/ustssc.f90 \
+$(top_srcdir)/users/base/ustsv2.f90 \
+$(top_srcdir)/users/base/usvima.f90 \
+$(top_srcdir)/users/base/usvist.f90 \
+$(top_srcdir)/users/base/usvort.f90 \
+$(top_srcdir)/users/base/usvpst.f90
diff --git a/src/base/Makefile.in b/src/base/Makefile.in
new file mode 100644
index 0000000..7c9be7c
--- /dev/null
+++ b/src/base/Makefile.in
@@ -0,0 +1,1161 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/base
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcsbase_la_LIBADD =
+am_libcsbase_la_OBJECTS = alelap.lo alemaj.lo altycl.lo armtps.lo \
+ autmgr.lo bilsc2.lo calgeo.lo calhyd.lo calmom.lo caltri.lo \
+ catsma.lo causta.lo clca66.lo cldijp.lo cldipo.lo clipke.lo \
+ clprij.lo clpsca.lo clptrg.lo clptur.lo clpv2f.lo clsurn.lo \
+ clsyvt.lo clvolc.lo codits.lo condli.lo cou1di.lo cou1do.lo \
+ coupbi.lo coupbo.lo covofi.lo cregeo.lo crstgr.lo cs_ale.lo \
+ cs_ast_coupling.lo cs_base.lo cs_boundary_conditions.lo \
+ cs_calcium.lo csc2cl.lo csc2ts.lo csccel.lo cscfbr.lo \
+ cscini.lo csclli.lo cscloc.lo cscpce.lo cscpfb.lo \
+ cs_coupling.lo cs_ext_neighborhood.lo csflsh.lo cs_gradient.lo \
+ cs_grid.lo cs_gui.lo cs_gui_boundary_conditions.lo \
+ cs_gui_matisse.lo cs_gui_mobile_mesh.lo cs_gui_particles.lo \
+ cs_gui_radiative_transfer.lo cs_gui_specific_physics.lo \
+ cs_gui_util.lo cs_halo.lo csinit.lo cs_io.lo cs_join.lo \
+ cs_join_f2c.lo cs_join_intersect.lo cs_join_merge.lo \
+ cs_join_mesh.lo cs_join_post.lo cs_join_set.lo \
+ cs_join_split.lo cs_join_update.lo cs_join_util.lo cs_mesh.lo \
+ cs_mesh_coherency.lo cs_mesh_connect.lo cs_mesh_halo.lo \
+ cs_mesh_quality.lo cs_mesh_quantities.lo cs_mesh_solcom.lo \
+ cs_mesh_warping.lo cs_multigrid.lo cs_numbering.lo cs_opts.lo \
+ cs_parall.lo cs_perio.lo cs_post.lo cs_post_f2c.lo \
+ cs_preprocessor_data.lo cs_proxy_comm.lo cs_renumber.lo \
+ cs_restart.lo cs_sat_coupling.lo cs_search.lo cs_selector.lo \
+ cs_selector_f2c.lo cs_sort.lo cs_syr3_comm.lo \
+ cs_syr3_coupling.lo cs_syr3_messages.lo cs_syr4_coupling.lo \
+ cs_syr_coupling.lo cs_syr_f2c.lo cs_tpar1d.lo cs_ventil.lo \
+ csprnt.lo distpr.lo distyp.lo divmas.lo divrij.lo dttvar.lo \
+ dvvpst.lo ecrava.lo ecrhis.lo ecrlis.lo findpt.lo grdcel.lo \
+ haltyp.lo hturbp.lo idrbla.lo impini.lo iniini.lo inimas.lo \
+ inipst.lo initi1.lo initi2.lo iniusi.lo iniva0.lo inivar.lo \
+ invers.lo iprbla.lo itrgrp.lo itrmas.lo lecamo.lo lecamp.lo \
+ lecamx.lo ledgeo.lo letgeo.lo majgeo.lo matrdt.lo matrix.lo \
+ memale.lo memcbr.lo memclg.lo memcli.lo memcs1.lo memcs2.lo \
+ memdis.lo memdtv.lo memdyp.lo memini.lo memkep.lo memkom.lo \
+ memnav.lo mempdc.lo memphy.lo memrij.lo memsca.lo memt1d.lo \
+ memtri.lo memtsm.lo memv2f.lo memvor.lo modini.lo modpar.lo \
+ navsto.lo newmrk.lo numvec.lo ordita.lo pergra.lo perinr.lo \
+ perinu.lo phyvar.lo precli.lo preduv.lo prmoy0.lo projts.lo \
+ proxav.lo recvmc.lo reseps.lo resolp.lo resrij.lo resssg.lo \
+ resv2f.lo rijech.lo rijthe.lo scalai.lo schtmp.lo stdtcl.lo \
+ strdep.lo strhis.lo strini.lo strpre.lo tcpumx.lo tdesi1.lo \
+ testel.lo tremai.lo tridim.lo tsepdc.lo tstvec.lo turbke.lo \
+ turbkw.lo turent.lo turrij.lo typecl.lo undscr.lo vandri.lo \
+ varpos.lo vectds.lo vericl.lo verini.lo verlon.lo vert1d.lo \
+ viscfa.lo visdyn.lo vislmg.lo visort.lo vissec.lo vissma.lo \
+ vissst.lo viswal.lo vor2cl.lo vordep.lo vorimp.lo vorin0.lo \
+ vorini.lo vorlgv.lo vorpre.lo vortex.lo vorver.lo vorvit.lo \
+ zufall.lo usalcl.lo usalin.lo usaste.lo usclim.lo usdpst.lo \
+ ushist.lo usini1.lo usiniv.lo usjoin.lo uskpdc.lo usmodg.lo \
+ usmpst.lo usnpst.lo usphyv.lo usproj.lo uspt1d.lo ussatc.lo \
+ ussmag.lo usstru.lo ussyrc.lo usthht.lo ustmgr.lo ustske.lo \
+ ustskw.lo ustsma.lo ustsns.lo ustsri.lo ustssc.lo ustsv2.lo \
+ usvima.lo usvist.lo usvort.lo usvpst.lo
+libcsbase_la_OBJECTS = $(am_libcsbase_la_OBJECTS)
+libcshot_la_LIBADD =
+am_libcshot_la_OBJECTS = libcshot_la-cs_benchmark.lo \
+ libcshot_la-cs_blas.lo libcshot_la-cs_matrix.lo \
+ libcshot_la-cs_sles.lo libcshot_la-gradmc.lo \
+ libcshot_la-gradrc.lo libcshot_la-prods2.lo \
+ libcshot_la-prods3.lo libcshot_la-prodsc.lo \
+ libcshot_la-promav.lo
+libcshot_la_OBJECTS = $(am_libcshot_la_OBJECTS)
+libcshot_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(libcshot_la_FCFLAGS) $(FCFLAGS) \
+ $(libcshot_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcsbase_la_SOURCES) $(libcshot_la_SOURCES)
+DIST_SOURCES = $(libcsbase_la_SOURCES) $(libcshot_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(basedir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+baseDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(base_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/lagr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MEI_CPPFLAGS@ @MPI_CPPFLAGS@ @LIBXML2_CPPFLAGS@ @BLAS_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+-I$(top_srcdir)/include/cfbl \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/mati \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/base/alaste.h \
+$(top_srcdir)/include/base/albase.h \
+$(top_srcdir)/include/base/alstru.h \
+$(top_srcdir)/include/base/cplsat.h \
+$(top_srcdir)/include/base/cs_ale.h \
+$(top_srcdir)/include/base/cs_ast_coupling.h \
+$(top_srcdir)/include/base/cs_base.h \
+$(top_srcdir)/include/base/cs_benchmark.h \
+$(top_srcdir)/include/base/cs_blas.h \
+$(top_srcdir)/include/base/cs_boundary_conditions.h \
+$(top_srcdir)/include/base/cs_calcium.h \
+$(top_srcdir)/include/base/cs_coupling.h \
+$(top_srcdir)/include/base/cs_ext_neighborhood.h \
+$(top_srcdir)/include/base/cs_gradient.h \
+$(top_srcdir)/include/base/cs_grid.h \
+$(top_srcdir)/include/base/cs_gui.h \
+$(top_srcdir)/include/base/cs_gui_boundary_conditions.h \
+$(top_srcdir)/include/base/cs_gui_matisse.h \
+$(top_srcdir)/include/base/cs_gui_mobile_mesh.h \
+$(top_srcdir)/include/base/cs_gui_particles.h \
+$(top_srcdir)/include/base/cs_gui_radiative_transfer.h \
+$(top_srcdir)/include/base/cs_gui_specific_physics.h \
+$(top_srcdir)/include/base/cs_gui_util.h \
+$(top_srcdir)/include/base/cs_gui_variables.h \
+$(top_srcdir)/include/base/cs_halo.h \
+$(top_srcdir)/include/base/cs_io.h \
+$(top_srcdir)/include/base/cs_join.h \
+$(top_srcdir)/include/base/cs_join_intersect.h \
+$(top_srcdir)/include/base/cs_join_merge.h \
+$(top_srcdir)/include/base/cs_join_mesh.h \
+$(top_srcdir)/include/base/cs_join_post.h \
+$(top_srcdir)/include/base/cs_join_set.h \
+$(top_srcdir)/include/base/cs_join_split.h \
+$(top_srcdir)/include/base/cs_join_update.h \
+$(top_srcdir)/include/base/cs_join_util.h \
+$(top_srcdir)/include/base/cs_matrix.h \
+$(top_srcdir)/include/base/cs_mesh_coherency.h \
+$(top_srcdir)/include/base/cs_mesh_connect.h \
+$(top_srcdir)/include/base/cs_mesh.h \
+$(top_srcdir)/include/base/cs_mesh_halo.h \
+$(top_srcdir)/include/base/cs_mesh_quality.h \
+$(top_srcdir)/include/base/cs_mesh_quantities.h \
+$(top_srcdir)/include/base/cs_mesh_solcom.h \
+$(top_srcdir)/include/base/cs_mesh_warping.h \
+$(top_srcdir)/include/base/cs_multigrid.h \
+$(top_srcdir)/include/base/cs_numbering.h \
+$(top_srcdir)/include/base/cs_opts.h \
+$(top_srcdir)/include/base/cs_parall.h \
+$(top_srcdir)/include/base/cs_perio.h \
+$(top_srcdir)/include/base/cs_post.h \
+$(top_srcdir)/include/base/cs_preprocessor_data.h \
+$(top_srcdir)/include/base/cs_prototypes.h \
+$(top_srcdir)/include/base/cs_proxy_comm.h \
+$(top_srcdir)/include/base/cs_renumber.h \
+$(top_srcdir)/include/base/cs_restart.h \
+$(top_srcdir)/include/base/cs_sat_coupling.h \
+$(top_srcdir)/include/base/cs_search.h \
+$(top_srcdir)/include/base/cs_selector.h \
+$(top_srcdir)/include/base/cs_sles.h \
+$(top_srcdir)/include/base/cs_sort.h \
+$(top_srcdir)/include/base/cs_syr3_comm.h \
+$(top_srcdir)/include/base/cs_syr3_coupling.h \
+$(top_srcdir)/include/base/cs_syr3_messages.h \
+$(top_srcdir)/include/base/cs_syr4_coupling.h \
+$(top_srcdir)/include/base/cs_syr_coupling.h \
+$(top_srcdir)/include/base/cstnum.h \
+$(top_srcdir)/include/base/cs_tpar1d.h \
+$(top_srcdir)/include/base/cstphy.h \
+$(top_srcdir)/include/base/cs_ventil.h \
+$(top_srcdir)/include/base/dimens.h \
+$(top_srcdir)/include/base/dimfbr.h \
+$(top_srcdir)/include/base/entsor.h \
+$(top_srcdir)/include/base/ihmpre.h \
+$(top_srcdir)/include/base/mltgrd.h \
+$(top_srcdir)/include/base/numvar.h \
+$(top_srcdir)/include/base/optcal.h \
+$(top_srcdir)/include/base/parall.h \
+$(top_srcdir)/include/base/paramx.h \
+$(top_srcdir)/include/base/period.h \
+$(top_srcdir)/include/base/pointe.h \
+$(top_srcdir)/include/base/tcpumx.h \
+$(top_srcdir)/include/base/tremai.h \
+$(top_srcdir)/include/base/vector.h \
+$(top_srcdir)/include/base/vortex.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcshot.la \
+ libcsbase.la
+
+libcshot_la_CFLAGS = @CFLAGS_DBG@ @CFLAGS_HOT@
+libcshot_la_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+-I$(top_srcdir)/include/cfbl \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/mati \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_HOT@
+
+libcshot_la_SOURCES = \
+cs_benchmark.c \
+cs_blas.c \
+cs_matrix.c \
+cs_sles.c \
+gradmc.f90 \
+gradrc.f90 \
+prods2.f90 \
+prods3.f90 \
+prodsc.f90 \
+promav.f90
+
+libcshot_la_LDFLAGS = -no-undefined
+
+###
+libcsbase_la_SOURCES = alelap.f90 alemaj.f90 altycl.f90 armtps.f90 \
+ autmgr.f90 bilsc2.f90 calgeo.f90 calhyd.f90 calmom.f90 \
+ caltri.f90 catsma.f90 causta.f90 clca66.f90 cldijp.f90 \
+ cldipo.f90 clipke.f90 clprij.f90 clpsca.f90 clptrg.f90 \
+ clptur.f90 clpv2f.f90 clsurn.f90 clsyvt.f90 clvolc.f90 \
+ codits.f90 condli.f90 cou1di.f90 cou1do.f90 coupbi.f90 \
+ coupbo.f90 covofi.f90 cregeo.f90 crstgr.f90 cs_ale.c \
+ cs_ast_coupling.c cs_base.c cs_boundary_conditions.c \
+ cs_calcium.c csc2cl.f90 csc2ts.f90 csccel.f90 cscfbr.f90 \
+ cscini.f90 csclli.f90 cscloc.f90 cscpce.f90 cscpfb.f90 \
+ cs_coupling.c cs_ext_neighborhood.c csflsh.f90 cs_gradient.c \
+ cs_grid.c cs_gui.c cs_gui_boundary_conditions.c \
+ cs_gui_matisse.c cs_gui_mobile_mesh.c cs_gui_particles.c \
+ cs_gui_radiative_transfer.c cs_gui_specific_physics.c \
+ cs_gui_util.c cs_halo.c csinit.f90 cs_io.c cs_join.c \
+ cs_join_f2c.f90 cs_join_intersect.c cs_join_merge.c \
+ cs_join_mesh.c cs_join_post.c cs_join_set.c cs_join_split.c \
+ cs_join_update.c cs_join_util.c cs_mesh.c cs_mesh_coherency.c \
+ cs_mesh_connect.c cs_mesh_halo.c cs_mesh_quality.c \
+ cs_mesh_quantities.c cs_mesh_solcom.c cs_mesh_warping.c \
+ cs_multigrid.c cs_numbering.c cs_opts.c cs_parall.c cs_perio.c \
+ cs_post.c cs_post_f2c.f90 cs_preprocessor_data.c \
+ cs_proxy_comm.c cs_renumber.c cs_restart.c cs_sat_coupling.c \
+ cs_search.c cs_selector.c cs_selector_f2c.f90 cs_sort.c \
+ cs_syr3_comm.c cs_syr3_coupling.c cs_syr3_messages.c \
+ cs_syr4_coupling.c cs_syr_coupling.c cs_syr_f2c.f90 \
+ cs_tpar1d.c cs_ventil.c csprnt.f90 distpr.f90 distyp.f90 \
+ divmas.f90 divrij.f90 dttvar.f90 dvvpst.f90 ecrava.f90 \
+ ecrhis.f90 ecrlis.f90 findpt.f90 grdcel.f90 haltyp.f90 \
+ hturbp.f90 idrbla.f90 impini.f90 iniini.f90 inimas.f90 \
+ inipst.f90 initi1.f90 initi2.f90 iniusi.f90 iniva0.f90 \
+ inivar.f90 invers.f90 iprbla.f90 itrgrp.f90 itrmas.f90 \
+ lecamo.f90 lecamp.f90 lecamx.f90 ledgeo.f90 letgeo.f90 \
+ majgeo.f90 matrdt.f90 matrix.f90 memale.f90 memcbr.f90 \
+ memclg.f90 memcli.f90 memcs1.f90 memcs2.f90 memdis.f90 \
+ memdtv.f90 memdyp.f90 memini.f90 memkep.f90 memkom.f90 \
+ memnav.f90 mempdc.f90 memphy.f90 memrij.f90 memsca.f90 \
+ memt1d.f90 memtri.f90 memtsm.f90 memv2f.f90 memvor.f90 \
+ modini.f90 modpar.f90 navsto.f90 newmrk.f90 numvec.f90 \
+ ordita.f90 pergra.f90 perinr.f90 perinu.f90 phyvar.f90 \
+ precli.f90 preduv.f90 prmoy0.f90 projts.f90 proxav.f90 \
+ recvmc.f90 reseps.f90 resolp.f90 resrij.f90 resssg.f90 \
+ resv2f.f90 rijech.f90 rijthe.f90 scalai.f90 schtmp.f90 \
+ stdtcl.f90 strdep.f90 strhis.f90 strini.f90 strpre.f90 \
+ tcpumx.c tdesi1.f90 testel.f90 tremai.c tridim.f90 tsepdc.f90 \
+ tstvec.f90 turbke.f90 turbkw.f90 turent.f90 turrij.f90 \
+ typecl.f90 undscr.f90 vandri.f90 varpos.f90 vectds.f90 \
+ vericl.f90 verini.f90 verlon.f90 vert1d.f90 viscfa.f90 \
+ visdyn.f90 vislmg.f90 visort.f90 vissec.f90 vissma.f90 \
+ vissst.f90 viswal.f90 vor2cl.f90 vordep.f90 vorimp.f90 \
+ vorin0.f90 vorini.f90 vorlgv.f90 vorpre.f90 vortex.f90 \
+ vorver.f90 vorvit.f90 zufall.f90 \
+ $(top_srcdir)/users/base/usalcl.f90 \
+ $(top_srcdir)/users/base/usalin.f90 \
+ $(top_srcdir)/users/base/usaste.f90 \
+ $(top_srcdir)/users/base/usclim.f90 \
+ $(top_srcdir)/users/base/usdpst.f90 \
+ $(top_srcdir)/users/base/ushist.f90 \
+ $(top_srcdir)/users/base/usini1.f90 \
+ $(top_srcdir)/users/base/usiniv.f90 \
+ $(top_srcdir)/users/base/usjoin.f90 \
+ $(top_srcdir)/users/base/uskpdc.f90 \
+ $(top_srcdir)/users/base/usmodg.f90 \
+ $(top_srcdir)/users/base/usmpst.f90 \
+ $(top_srcdir)/users/base/usnpst.f90 \
+ $(top_srcdir)/users/base/usphyv.f90 \
+ $(top_srcdir)/users/base/usproj.f90 \
+ $(top_srcdir)/users/base/uspt1d.f90 \
+ $(top_srcdir)/users/base/ussatc.f90 \
+ $(top_srcdir)/users/base/ussmag.f90 \
+ $(top_srcdir)/users/base/usstru.f90 \
+ $(top_srcdir)/users/base/ussyrc.f90 \
+ $(top_srcdir)/users/base/usthht.f90 \
+ $(top_srcdir)/users/base/ustmgr.f90 \
+ $(top_srcdir)/users/base/ustske.f90 \
+ $(top_srcdir)/users/base/ustskw.f90 \
+ $(top_srcdir)/users/base/ustsma.f90 \
+ $(top_srcdir)/users/base/ustsns.f90 \
+ $(top_srcdir)/users/base/ustsri.f90 \
+ $(top_srcdir)/users/base/ustssc.f90 \
+ $(top_srcdir)/users/base/ustsv2.f90 \
+ $(top_srcdir)/users/base/usvima.f90 \
+ $(top_srcdir)/users/base/usvist.f90 \
+ $(top_srcdir)/users/base/usvort.f90 \
+ $(top_srcdir)/users/base/usvpst.f90
+basedir = $(pkgdatadir)/users/base
+base_DATA = \
+$(top_srcdir)/users/base/usalcl.f90 \
+$(top_srcdir)/users/base/usalin.f90 \
+$(top_srcdir)/users/base/usaste.f90 \
+$(top_srcdir)/users/base/usclim.f90 \
+$(top_srcdir)/users/base/usdpst.f90 \
+$(top_srcdir)/users/base/ushist.f90 \
+$(top_srcdir)/users/base/usini1.f90 \
+$(top_srcdir)/users/base/usiniv.f90 \
+$(top_srcdir)/users/base/usjoin.f90 \
+$(top_srcdir)/users/base/uskpdc.f90 \
+$(top_srcdir)/users/base/usmodg.f90 \
+$(top_srcdir)/users/base/usmpst.f90 \
+$(top_srcdir)/users/base/usnpst.f90 \
+$(top_srcdir)/users/base/usphyv.f90 \
+$(top_srcdir)/users/base/usproj.f90 \
+$(top_srcdir)/users/base/uspt1d.f90 \
+$(top_srcdir)/users/base/ussatc.f90 \
+$(top_srcdir)/users/base/ussmag.f90 \
+$(top_srcdir)/users/base/usstru.f90 \
+$(top_srcdir)/users/base/ussyrc.f90 \
+$(top_srcdir)/users/base/usthht.f90 \
+$(top_srcdir)/users/base/ustmgr.f90 \
+$(top_srcdir)/users/base/ustske.f90 \
+$(top_srcdir)/users/base/ustskw.f90 \
+$(top_srcdir)/users/base/ustsma.f90 \
+$(top_srcdir)/users/base/ustsns.f90 \
+$(top_srcdir)/users/base/ustsri.f90 \
+$(top_srcdir)/users/base/ustssc.f90 \
+$(top_srcdir)/users/base/ustsv2.f90 \
+$(top_srcdir)/users/base/usvima.f90 \
+$(top_srcdir)/users/base/usvist.f90 \
+$(top_srcdir)/users/base/usvort.f90 \
+$(top_srcdir)/users/base/usvpst.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/base/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/base/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcsbase.la: $(libcsbase_la_OBJECTS) $(libcsbase_la_DEPENDENCIES)
+ $(FCLINK) $(libcsbase_la_OBJECTS) $(libcsbase_la_LIBADD) $(LIBS)
+libcshot.la: $(libcshot_la_OBJECTS) $(libcshot_la_DEPENDENCIES)
+ $(libcshot_la_LINK) $(libcshot_la_OBJECTS) $(libcshot_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ale.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ast_coupling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_base.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_boundary_conditions.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_calcium.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_coupling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ext_neighborhood.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gradient.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui_boundary_conditions.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui_matisse.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui_mobile_mesh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui_particles.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui_radiative_transfer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui_specific_physics.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_gui_util.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_halo.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_io.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_intersect.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_merge.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_mesh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_post.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_set.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_split.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_update.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_join_util.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh_coherency.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh_connect.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh_halo.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh_quality.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh_quantities.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh_solcom.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_mesh_warping.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_multigrid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_numbering.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_opts.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_parall.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_perio.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_post.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_preprocessor_data.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_proxy_comm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_renumber.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_restart.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_sat_coupling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_search.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_selector.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_sort.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_syr3_comm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_syr3_coupling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_syr3_messages.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_syr4_coupling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_syr_coupling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_tpar1d.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ventil.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcshot_la-cs_benchmark.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcshot_la-cs_blas.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcshot_la-cs_matrix.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcshot_la-cs_sles.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tcpumx.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tremai.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libcshot_la-cs_benchmark.lo: cs_benchmark.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -MT libcshot_la-cs_benchmark.lo -MD -MP -MF $(DEPDIR)/libcshot_la-cs_benchmark.Tpo -c -o libcshot_la-cs_benchmark.lo `test -f 'cs_benchmark.c' || echo '$(srcdir)/'`cs_benchmark.c
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcshot_la-cs_benchmark.Tpo $(DEPDIR)/libcshot_la-cs_benchmark.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cs_benchmark.c' object='libcshot_la-cs_benchmark.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -c -o libcshot_la-cs_benchmark.lo `test -f 'cs_benchmark.c' || echo '$(srcdir)/'`cs_benchmark.c
+
+libcshot_la-cs_blas.lo: cs_blas.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -MT libcshot_la-cs_blas.lo -MD -MP -MF $(DEPDIR)/libcshot_la-cs_blas.Tpo -c -o libcshot_la-cs_blas.lo `test -f 'cs_blas.c' || echo '$(srcdir)/'`cs_blas.c
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcshot_la-cs_blas.Tpo $(DEPDIR)/libcshot_la-cs_blas.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cs_blas.c' object='libcshot_la-cs_blas.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -c -o libcshot_la-cs_blas.lo `test -f 'cs_blas.c' || echo '$(srcdir)/'`cs_blas.c
+
+libcshot_la-cs_matrix.lo: cs_matrix.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -MT libcshot_la-cs_matrix.lo -MD -MP -MF $(DEPDIR)/libcshot_la-cs_matrix.Tpo -c -o libcshot_la-cs_matrix.lo `test -f 'cs_matrix.c' || echo '$(srcdir)/'`cs_matrix.c
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcshot_la-cs_matrix.Tpo $(DEPDIR)/libcshot_la-cs_matrix.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cs_matrix.c' object='libcshot_la-cs_matrix.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -c -o libcshot_la-cs_matrix.lo `test -f 'cs_matrix.c' || echo '$(srcdir)/'`cs_matrix.c
+
+libcshot_la-cs_sles.lo: cs_sles.c
+ at am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -MT libcshot_la-cs_sles.lo -MD -MP -MF $(DEPDIR)/libcshot_la-cs_sles.Tpo -c -o libcshot_la-cs_sles.lo `test -f 'cs_sles.c' || echo '$(srcdir)/'`cs_sles.c
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libcshot_la-cs_sles.Tpo $(DEPDIR)/libcshot_la-cs_sles.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cs_sles.c' object='libcshot_la-cs_sles.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcshot_la_CFLAGS) $(CFLAGS) -c -o libcshot_la-cs_sles.lo `test -f 'cs_sles.c' || echo '$(srcdir)/'`cs_sles.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+usalcl.lo: $(top_srcdir)/users/base/usalcl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usalcl.lo `test -f '$(top_srcdir)/users/base/usalcl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usalcl.f90
+
+usalin.lo: $(top_srcdir)/users/base/usalin.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usalin.lo `test -f '$(top_srcdir)/users/base/usalin.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usalin.f90
+
+usaste.lo: $(top_srcdir)/users/base/usaste.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usaste.lo `test -f '$(top_srcdir)/users/base/usaste.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usaste.f90
+
+usclim.lo: $(top_srcdir)/users/base/usclim.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usclim.lo `test -f '$(top_srcdir)/users/base/usclim.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usclim.f90
+
+usdpst.lo: $(top_srcdir)/users/base/usdpst.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usdpst.lo `test -f '$(top_srcdir)/users/base/usdpst.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usdpst.f90
+
+ushist.lo: $(top_srcdir)/users/base/ushist.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ushist.lo `test -f '$(top_srcdir)/users/base/ushist.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ushist.f90
+
+usini1.lo: $(top_srcdir)/users/base/usini1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usini1.lo `test -f '$(top_srcdir)/users/base/usini1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usini1.f90
+
+usiniv.lo: $(top_srcdir)/users/base/usiniv.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usiniv.lo `test -f '$(top_srcdir)/users/base/usiniv.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usiniv.f90
+
+usjoin.lo: $(top_srcdir)/users/base/usjoin.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usjoin.lo `test -f '$(top_srcdir)/users/base/usjoin.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usjoin.f90
+
+uskpdc.lo: $(top_srcdir)/users/base/uskpdc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uskpdc.lo `test -f '$(top_srcdir)/users/base/uskpdc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/uskpdc.f90
+
+usmodg.lo: $(top_srcdir)/users/base/usmodg.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usmodg.lo `test -f '$(top_srcdir)/users/base/usmodg.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usmodg.f90
+
+usmpst.lo: $(top_srcdir)/users/base/usmpst.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usmpst.lo `test -f '$(top_srcdir)/users/base/usmpst.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usmpst.f90
+
+usnpst.lo: $(top_srcdir)/users/base/usnpst.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usnpst.lo `test -f '$(top_srcdir)/users/base/usnpst.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usnpst.f90
+
+usphyv.lo: $(top_srcdir)/users/base/usphyv.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usphyv.lo `test -f '$(top_srcdir)/users/base/usphyv.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usphyv.f90
+
+usproj.lo: $(top_srcdir)/users/base/usproj.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usproj.lo `test -f '$(top_srcdir)/users/base/usproj.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usproj.f90
+
+uspt1d.lo: $(top_srcdir)/users/base/uspt1d.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uspt1d.lo `test -f '$(top_srcdir)/users/base/uspt1d.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/uspt1d.f90
+
+ussatc.lo: $(top_srcdir)/users/base/ussatc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ussatc.lo `test -f '$(top_srcdir)/users/base/ussatc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ussatc.f90
+
+ussmag.lo: $(top_srcdir)/users/base/ussmag.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ussmag.lo `test -f '$(top_srcdir)/users/base/ussmag.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ussmag.f90
+
+usstru.lo: $(top_srcdir)/users/base/usstru.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usstru.lo `test -f '$(top_srcdir)/users/base/usstru.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usstru.f90
+
+ussyrc.lo: $(top_srcdir)/users/base/ussyrc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ussyrc.lo `test -f '$(top_srcdir)/users/base/ussyrc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ussyrc.f90
+
+usthht.lo: $(top_srcdir)/users/base/usthht.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usthht.lo `test -f '$(top_srcdir)/users/base/usthht.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usthht.f90
+
+ustmgr.lo: $(top_srcdir)/users/base/ustmgr.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustmgr.lo `test -f '$(top_srcdir)/users/base/ustmgr.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustmgr.f90
+
+ustske.lo: $(top_srcdir)/users/base/ustske.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustske.lo `test -f '$(top_srcdir)/users/base/ustske.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustske.f90
+
+ustskw.lo: $(top_srcdir)/users/base/ustskw.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustskw.lo `test -f '$(top_srcdir)/users/base/ustskw.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustskw.f90
+
+ustsma.lo: $(top_srcdir)/users/base/ustsma.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustsma.lo `test -f '$(top_srcdir)/users/base/ustsma.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustsma.f90
+
+ustsns.lo: $(top_srcdir)/users/base/ustsns.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustsns.lo `test -f '$(top_srcdir)/users/base/ustsns.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustsns.f90
+
+ustsri.lo: $(top_srcdir)/users/base/ustsri.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustsri.lo `test -f '$(top_srcdir)/users/base/ustsri.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustsri.f90
+
+ustssc.lo: $(top_srcdir)/users/base/ustssc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustssc.lo `test -f '$(top_srcdir)/users/base/ustssc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustssc.f90
+
+ustsv2.lo: $(top_srcdir)/users/base/ustsv2.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o ustsv2.lo `test -f '$(top_srcdir)/users/base/ustsv2.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/ustsv2.f90
+
+usvima.lo: $(top_srcdir)/users/base/usvima.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usvima.lo `test -f '$(top_srcdir)/users/base/usvima.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usvima.f90
+
+usvist.lo: $(top_srcdir)/users/base/usvist.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usvist.lo `test -f '$(top_srcdir)/users/base/usvist.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usvist.f90
+
+usvort.lo: $(top_srcdir)/users/base/usvort.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usvort.lo `test -f '$(top_srcdir)/users/base/usvort.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usvort.f90
+
+usvpst.lo: $(top_srcdir)/users/base/usvpst.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usvpst.lo `test -f '$(top_srcdir)/users/base/usvpst.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/base/usvpst.f90
+
+libcshot_la-gradmc.lo: gradmc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(libcshot_la_FCFLAGS) $(FCFLAGS) -c -o libcshot_la-gradmc.lo `test -f 'gradmc.f90' || echo '$(srcdir)/'`gradmc.f90
+
+libcshot_la-gradrc.lo: gradrc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(libcshot_la_FCFLAGS) $(FCFLAGS) -c -o libcshot_la-gradrc.lo `test -f 'gradrc.f90' || echo '$(srcdir)/'`gradrc.f90
+
+libcshot_la-prods2.lo: prods2.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(libcshot_la_FCFLAGS) $(FCFLAGS) -c -o libcshot_la-prods2.lo `test -f 'prods2.f90' || echo '$(srcdir)/'`prods2.f90
+
+libcshot_la-prods3.lo: prods3.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(libcshot_la_FCFLAGS) $(FCFLAGS) -c -o libcshot_la-prods3.lo `test -f 'prods3.f90' || echo '$(srcdir)/'`prods3.f90
+
+libcshot_la-prodsc.lo: prodsc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(libcshot_la_FCFLAGS) $(FCFLAGS) -c -o libcshot_la-prodsc.lo `test -f 'prodsc.f90' || echo '$(srcdir)/'`prodsc.f90
+
+libcshot_la-promav.lo: promav.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(libcshot_la_FCFLAGS) $(FCFLAGS) -c -o libcshot_la-promav.lo `test -f 'promav.f90' || echo '$(srcdir)/'`promav.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-baseDATA: $(base_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(basedir)" || $(MKDIR_P) "$(DESTDIR)$(basedir)"
+ @list='$(base_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(baseDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(basedir)/$$f'"; \
+ $(baseDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(basedir)/$$f"; \
+ done
+
+uninstall-baseDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(base_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(basedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(basedir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(basedir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-baseDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-baseDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-baseDATA install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-saturneincludeHEADERS \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-baseDATA uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/base/alelap.f90 b/src/base/alelap.f90
new file mode 100644
index 0000000..3ee7867
--- /dev/null
+++ b/src/base/alelap.f90
@@ -0,0 +1,365 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine alelap &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , viscf , viscb , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DE L'EQUATION DE DIFFUSION POUR LA VITESSE DE MAILLAGE
+! EN ALE
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel
+integer iclvar, iclvaf, ivar
+integer ipcvmx, ipcvmy, ipcvmz, ii, ipp
+integer iflmas, iflmab
+integer nswrgp, imligp, iwarnp
+integer iconvp, idiffp, ndircp, ireslp
+integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+double precision blencp, epsilp, epsrgp, climgp, extrap, thetv
+double precision epsrsp
+double precision relaxp
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipcvmx = ipproc(ivisma(1))
+ipcvmy = ipproc(ivisma(2))
+ipcvmz = ipproc(ivisma(3))
+! Flux de masse necessaire pour l'appel mais non utilise (ICONV=0)
+iflmas = ipprof(ifluma(iu(1)))
+iflmab = ipprob(ifluma(iu(1)))
+
+if(iwarni(iuma).ge.1) then
+ write(nfecra,1000)
+endif
+
+
+!===============================================================================
+! 2. RESOLUTION EFFECTIVE DE L'EQUATION DE VITESSE DE MAILLAGE
+!===============================================================================
+
+do ii = 1, 3
+
+ if (ii.eq.1) ivar = iuma
+ if (ii.eq.2) ivar = ivma
+ if (ii.eq.3) ivar = iwma
+
+ ipp = ipprtp(ivar)
+ iclvar = iclrtp(ivar,icoef )
+ iclvaf = iclrtp(ivar,icoeff)
+
+ if(iwarni(ivar).ge.1) then
+ write(nfecra,1100) nomvar(ipp)
+ endif
+
+ do iel = 1, ncel
+ smbr(iel) = 0.d0
+ rovsdt(iel) = 0.d0
+ enddo
+
+ if (ipcvmx.eq.ipcvmy) then
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcvmx), &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+ else
+ call visort &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcvmx), propce(1,ipcvmy), propce(1,ipcvmz), &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+ endif
+
+ iconvp = iconv (ivar)
+ idiffp = idiff (ivar)
+ ireslp = iresol(ivar)
+ ndircp = ndircl(ivar)
+ nitmap = nitmax(ivar)
+ nswrsp = nswrsm(ivar)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ ircflp = ircflu(ivar)
+ ischcp = ischcv(ivar)
+ isstpp = isstpc(ivar)
+ iescap = 0
+ imgrp = imgr (ivar)
+ ncymxp = ncymax(ivar)
+ nitmfp = nitmgf(ivar)
+ iwarnp = iwarni(ivar)
+ blencp = blencv(ivar)
+ epsilp = epsilo(ivar)
+ epsrsp = epsrsm(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ relaxp = 1.d0
+ thetv = 1.d0
+
+ call codits &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+enddo
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ** RESOLUTION DE LA VITESSE DE MAILLAGE ',/,&
+' ------------------------------------ ',/)
+ 1100 format(/,' RESOLUTION POUR LA VARIABLE ',A8,/)
+
+#else
+
+ 1000 format(/, &
+' ** SOLVING MESH VELOCITY' ,/,&
+' ---------------------' ,/)
+ 1100 format(/,' SOLVING VARIABLE ',A8 ,/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/alemaj.f90 b/src/base/alemaj.f90
new file mode 100644
index 0000000..286c76e
--- /dev/null
+++ b/src/base/alemaj.f90
@@ -0,0 +1,291 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine alemaj &
+!================
+
+ ( idbia0 , idbra0 , itrale , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , impale , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , depale , xyzno0 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! MISE A JOUR DU MAILLAGE EN METHODE ALE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! itrale ! e ! <-- ! numero d'iteration pour l'ale !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! impale(nnod) ! te ! <-- ! indicateur de delacement impose !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! depale(nnod,3 ! tr ! <-- ! deplacement aux noeuds !
+! xyzno0(3,nnod ! tr ! <-- ! coordonnees noeuds maillage initial !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , itrale
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer impale(nnod)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision depale(nnod,3), xyzno0(3,nnod)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifinra
+integer inod
+integer iel
+integer idproj
+
+integer icluma, iclvma, iclwma, idim
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+if(iwarni(iuma).ge.1) then
+ write(nfecra,1000)
+endif
+
+idebia = idbia0
+idebra = idbra0
+
+icluma = iclrtp(iuma,icoef )
+iclvma = iclrtp(ivma,icoef )
+iclwma = iclrtp(iwma,icoef )
+
+!===============================================================================
+! 2. MISE A JOUR DE LA GEOMETRIE
+!===============================================================================
+! (en utilisant le deplacement predit)
+
+! Projection du deplacement calcule sur les noeuds
+
+idproj = idebra
+ifinra = idproj + ndim*nnod
+CALL RASIZE('ALEMAJ',IFINRA)
+!==========
+
+call aldepl &
+!==========
+ ( ifacel , ifabor , ipnfac , nodfac , ipnfbr , nodfbr , &
+ rtp(1,iuma), rtp(1,ivma), rtp(1,iwma), &
+ coefa(1,icluma), coefa(1,iclvma), coefa(1,iclwma), &
+ coefb(1,icluma), coefb(1,iclvma), coefb(1,iclwma), &
+ dt, ra(idproj) )
+
+! Mise a jour du deplacement sur les noeuds ou on ne l'a pas impose
+! (DEPALE a alors la valeur du deplacement au pas de temps precedent)
+
+do inod = 1, nnod
+ if (impale(inod).eq.0) then
+ do idim = 1, 3
+ depale(inod,idim) = depale(inod,idim) + &
+ ra(idproj+(idim-1)*nnod+inod-1)
+ enddo
+ endif
+enddo
+
+! Mise a jour de la geometrie
+
+do inod = 1, nnod
+ do idim = 1, ndim
+ xyznod(idim,inod) = xyzno0(idim,inod) + depale(inod,idim)
+ enddo
+enddo
+
+call algrma
+!==========
+
+call calgeo &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ volmin , volmax , voltot , &
+ rdevel , rtuser , ra )
+
+! Si on est a l'iteration d'initialisation, on remet les vitesses de maillage
+! a leur valeur initiale
+if (itrale.eq.0) then
+ do iel = 1, ncelet
+ rtp(iel,iuma) = rtpa(iel,iuma)
+ rtp(iel,ivma) = rtpa(iel,ivma)
+ rtp(iel,iwma) = rtpa(iel,iwma)
+ enddo
+endif
+!--------
+! FORMATS
+!--------
+
+ 1000 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' MISE A JOUR DU MAILLAGE (ALE) ',/,&
+' ============================= ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/altycl.f90 b/src/base/altycl.f90
new file mode 100644
index 0000000..c476375
--- /dev/null
+++ b/src/base/altycl.f90
@@ -0,0 +1,533 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine altycl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , ialtyb , icodcl , impale , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ rcodcl , xyzno0 , depale , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! TRAITEMENT DES CODES DE CONDITIONS AUX LIMITES IALTYB POUR L'ALE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! ialtyb(nfabor ! te ! <-- ! type des faces de bord pour l'ale !
+! icodcl ! te ! <-- ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! impale(nnod) ! te ! <-- ! indicateur de delacement impose !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! <-- ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! depale(nnod,3 ! tr ! <-- ! deplacement aux noeuds !
+! xyzno0(3,nnod ! tr ! <-- ! coordonnees noeuds maillage initial !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itypfb(nfabor,nphas)
+integer ialtyb(nfabor), icodcl(nfabor,nvar)
+integer impale(nnod)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision depale(nnod,3), xyzno0(3,nnod)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, iphas, iuiph, iviph, iwiph
+integer ii, inod, iecrw, icpt, ierror
+double precision ddepx, ddepy, ddepz
+double precision srfbnf, rnx, rny, rnz
+double precision rcodcx, rcodcy, rcodcz, rcodsn
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! Mise a zero des RCODCL non specifies
+do ifac = 1, nfabor
+ if (rcodcl(ifac,iuma,1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iuma,1) = 0.d0
+ if (rcodcl(ifac,ivma,1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,ivma,1) = 0.d0
+ if (rcodcl(ifac,iwma,1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iwma,1) = 0.d0
+enddo
+
+!===============================================================================
+! 2. VERIFICATION DE LA CONSISTANCE DES IALTYB DONNES DANS USALCL
+!===============================================================================
+! (valeur 0 autorisee)
+
+ierror = 0
+do ifac = 1, nfabor
+ if (ialtyb(ifac).ne.0 .and. &
+ ialtyb(ifac).ne.ibfixe .and. &
+ ialtyb(ifac).ne.igliss .and. &
+ ialtyb(ifac).ne.ivimpo ) then
+ write(nfecra,1000)ifac,iprfml(ifmfbr(ifac),1), &
+ ialtyb(ifac)
+ ierror = ierror + 1
+ endif
+enddo
+
+
+!===============================================================================
+! 3. CONVERSION EN RCODCL ICODCL
+!===============================================================================
+
+! Calcul ou ecrasement de RCODCL a partir du deplacement impose,
+! si tous les noeuds d'une face sont a deplacement impose
+
+do ifac = 1, nfabor
+ iecrw = 0
+ ddepx = 0.d0
+ ddepy = 0.d0
+ ddepz = 0.d0
+ icpt = 0
+ do ii = ipnfbr(ifac), ipnfbr(ifac+1)-1
+ inod = nodfbr(ii)
+ if (impale(inod).eq.0) iecrw = iecrw + 1
+ icpt = icpt + 1
+ ddepx = ddepx + depale(inod,1)+xyzno0(1,inod)-xyznod(1,inod)
+ ddepy = ddepy + depale(inod,2)+xyzno0(2,inod)-xyznod(2,inod)
+ ddepz = ddepz + depale(inod,3)+xyzno0(3,inod)-xyznod(3,inod)
+ enddo
+ if (iecrw.eq.0) then
+ iel = ifabor(ifac)
+ ialtyb(ifac) = ivimpo
+ rcodcl(ifac,iuma,1) = ddepx/dt(iel)/icpt
+ rcodcl(ifac,ivma,1) = ddepy/dt(iel)/icpt
+ rcodcl(ifac,iwma,1) = ddepz/dt(iel)/icpt
+ endif
+enddo
+
+! Remplissage des autres RCODCL a partir des ITYALB
+
+do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --> Faces fixes
+! On force alors les noeuds en question a etre fixes, pour eviter
+! des problemes eventuels aux coins
+
+ if (ialtyb(ifac).eq.ibfixe) then
+ icpt = 0
+ if (icodcl(ifac,iuma).eq.0) then
+ icpt = icpt + 1
+ icodcl(ifac,iuma) = 1
+ rcodcl(ifac,iuma,1) = 0.d0
+ endif
+ if (icodcl(ifac,ivma).eq.0) then
+ icpt = icpt + 1
+ icodcl(ifac,ivma) = 1
+ rcodcl(ifac,ivma,1) = 0.d0
+ endif
+ if (icodcl(ifac,iwma).eq.0) then
+ icpt = icpt + 1
+ icodcl(ifac,iwma) = 1
+ rcodcl(ifac,iwma,1) = 0.d0
+ endif
+! Si on a fixe les trois composantes, alors on fixe les noeuds
+! correspondants. Sinon c'est que l'utilisateur a modifie quelque
+! chose ... on le laisse seul maitre
+ if (icpt.eq.3) then
+ do ii = ipnfbr(ifac), ipnfbr(ifac+1)-1
+ inod = nodfbr(ii)
+ if (impale(inod).eq.0) then
+ depale(inod,1) = 0.d0
+ depale(inod,2) = 0.d0
+ depale(inod,3) = 0.d0
+ impale(inod) = 1
+ endif
+ enddo
+ endif
+
+
+! --> Faces de glissement
+ elseif (ialtyb(ifac).eq.igliss) then
+
+ if (icodcl(ifac,iuma).eq.0) icodcl(ifac,iuma) = 4
+ if (icodcl(ifac,ivma).eq.0) icodcl(ifac,ivma) = 4
+ if (icodcl(ifac,iwma).eq.0) icodcl(ifac,iwma) = 4
+
+! --> Faces a vitesse imposee
+ elseif (ialtyb(ifac).eq.ivimpo) then
+
+ if (icodcl(ifac,iuma).eq.0) icodcl(ifac,iuma) = 1
+ if (icodcl(ifac,ivma).eq.0) icodcl(ifac,ivma) = 1
+ if (icodcl(ifac,iwma).eq.0) icodcl(ifac,iwma) = 1
+
+ endif
+
+enddo
+
+!===============================================================================
+! 4. VERIFICATION DE LA CONSISTANCE DES ICODCL
+!===============================================================================
+
+! IERROR a ete initialise plus haut
+do ifac = 1, nfabor
+
+ if (icodcl(ifac,iuma).ne.1 .and. &
+ icodcl(ifac,iuma).ne.3 .and. &
+ icodcl(ifac,iuma).ne.4 ) then
+ write(nfecra,2000) ifac,iprfml(ifmfbr(ifac),1), &
+ icodcl(ifac,iuma)
+ ierror = ierror + 1
+ endif
+ if (icodcl(ifac,ivma).ne.1 .and. &
+ icodcl(ifac,ivma).ne.3 .and. &
+ icodcl(ifac,ivma).ne.4 ) then
+ write(nfecra,2001) ifac,iprfml(ifmfbr(ifac),1), &
+ icodcl(ifac,ivma)
+ ierror = ierror + 1
+ endif
+ if (icodcl(ifac,iwma).ne.1 .and. &
+ icodcl(ifac,iwma).ne.3 .and. &
+ icodcl(ifac,iwma).ne.4 ) then
+ write(nfecra,2002) ifac,iprfml(ifmfbr(ifac),1), &
+ icodcl(ifac,iwma)
+ ierror = ierror + 1
+ endif
+
+ if ( ( icodcl(ifac,iuma).eq.4 .or. &
+ icodcl(ifac,ivma).eq.4 .or. &
+ icodcl(ifac,iwma).eq.4 ) .and. &
+ ( icodcl(ifac,iuma).ne.4 .or. &
+ icodcl(ifac,ivma).ne.4 .or. &
+ icodcl(ifac,iwma).ne.4 ) ) then
+ write(nfecra,3000) ifac,iprfml(ifmfbr(ifac),1), &
+ icodcl(ifac,iuma),icodcl(ifac,ivma),icodcl(ifac,iwma)
+ ierror = ierror + 1
+ endif
+
+enddo
+
+if (ierror.gt.0) then
+ write(nfecra,4000)
+ call csexit(1)
+ !==========
+endif
+
+!===============================================================================
+! 5. VITESSE DE DEFILEMENT POUR LES PAROIS FLUIDES ET SYMETRIES
+!===============================================================================
+
+! Pour les symetries on rajoute toujours la vitesse de maillage, car on
+! ne conserve que la vitesse normale
+! Pour les parois, on prend la vitesse de maillage si l'utilisateur n'a
+! pas specifie RCODCL, sinon on laisse RCODCL pour la vitesse tangente
+! et on prend la vitesse de maillage pour la composante normale.
+! On se base uniquement sur ITYPFB, a l'utilisateur de gere les choses
+! s'il rentre en CL non standards.
+iphas = 1
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+do ifac = 1, nfabor
+
+ if (ialtyb(ifac).eq.ivimpo) then
+
+ if ( itypfb(ifac,iphas).eq.isymet ) then
+ rcodcl(ifac,iuiph,1) = rcodcl(ifac,iuma,1)
+ rcodcl(ifac,iviph,1) = rcodcl(ifac,ivma,1)
+ rcodcl(ifac,iwiph,1) = rcodcl(ifac,iwma,1)
+ endif
+
+ if ( itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug ) then
+! Si une des composantes de vitesse de glissement a ete
+! modifiee par l'utilisateur, on ne fixe que la vitesse
+! normale
+ if (rcodcl(ifac,iuiph,1).gt.rinfin*0.5d0 .and. &
+ rcodcl(ifac,iviph,1).gt.rinfin*0.5d0 .and. &
+ rcodcl(ifac,iwiph,1).gt.rinfin*0.5d0) then
+ rcodcl(ifac,iuiph,1) = rcodcl(ifac,iuma,1)
+ rcodcl(ifac,iviph,1) = rcodcl(ifac,ivma,1)
+ rcodcl(ifac,iwiph,1) = rcodcl(ifac,iwma,1)
+ else
+! On met a 0 les composantes de RCODCL non specifiees
+ if (rcodcl(ifac,iuiph,1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iuiph,1) = 0.d0
+ if (rcodcl(ifac,iviph,1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iviph,1) = 0.d0
+ if (rcodcl(ifac,iwiph,1).gt.rinfin*0.5d0) &
+ rcodcl(ifac,iwiph,1) = 0.d0
+
+ srfbnf = ra(isrfbn-1+ifac)
+ rnx = surfbo(1,ifac)/srfbnf
+ rny = surfbo(2,ifac)/srfbnf
+ rnz = surfbo(3,ifac)/srfbnf
+ rcodcx = rcodcl(ifac,iuiph,1)
+ rcodcy = rcodcl(ifac,iviph,1)
+ rcodcz = rcodcl(ifac,iwiph,1)
+ rcodsn = (rcodcl(ifac,iuma,1)-rcodcx)*rnx &
+ + (rcodcl(ifac,ivma,1)-rcodcy)*rny &
+ + (rcodcl(ifac,ivma,1)-rcodcz)*rnz
+ rcodcl(ifac,iuiph,1) = rcodcx + rcodsn*rnx
+ rcodcl(ifac,iviph,1) = rcodcy + rcodsn*rny
+ rcodcl(ifac,iwiph,1) = rcodcz + rcodsn*rnz
+ endif
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! FORMATS
+!===============================================================================
+
+ 1000 format( &
+'@ ',/,&
+'@ METHODE ALE ',/,&
+'@ TYPE DE BORD NON RECONNU ',/,&
+'@ FACE ',I10 ,' ; PROPRIETE 1 :',I10 ,/,&
+'@ ALTYB FACE : ', I10 ,/,&
+'@ ' )
+ 2000 format( &
+'@ ',/,&
+'@ METHODE ALE ',/,&
+'@ TYPE DE CONDITION A LA LIMITE NON RECONNU POUR LA VITESSE ',/,&
+'@ DE MAILLAGE SELON X (IUMA) ',/,&
+'@ FACE ',I10 ,' ; PROPRIETE 1 :',I10 ,/,&
+'@ ICODCL : ', I10 ,/,&
+'@ ',/,&
+'@ Les seules valeurs autorisees pour ICODCL sont ',/,&
+'@ 1 : Dirichlet ',/,&
+'@ 3 : Neumann ',/,&
+'@ 4 : Glissement ',/,&
+'@ ' )
+ 2001 format( &
+'@ ',/,&
+'@ METHODE ALE ',/,&
+'@ TYPE DE CONDITION A LA LIMITE NON RECONNU POUR LA VITESSE ',/,&
+'@ DE MAILLAGE SELON Y (IVMA) ',/,&
+'@ FACE ',I10 ,' ; PROPRIETE 1 :',I10 ,/,&
+'@ ICODCL : ', I10 ,/,&
+'@ ',/,&
+'@ Les seules valeurs autorisees pour ICODCL sont ',/,&
+'@ 1 : Dirichlet ',/,&
+'@ 3 : Neumann ',/,&
+'@ 4 : Glissement ',/,&
+'@ ' )
+ 2002 format( &
+'@ ',/,&
+'@ METHODE ALE ',/,&
+'@ TYPE DE CONDITION A LA LIMITE NON RECONNU POUR LA VITESSE ',/,&
+'@ DE MAILLAGE SELON Z (IWMA) ',/,&
+'@ FACE ',I10 ,' ; PROPRIETE 1 :',I10 ,/,&
+'@ ICODCL : ', I10 ,/,&
+'@ ',/,&
+'@ Les seules valeurs autorisees pour ICODCL sont ',/,&
+'@ 1 : Dirichlet ',/,&
+'@ 3 : Neumann ',/,&
+'@ 4 : Glissement ',/,&
+'@ ' )
+ 3000 format( &
+'@ ',/,&
+'@ METHODE ALE ',/,&
+'@ INCOHERENCE DANS LES TYPES DE CONDITIONS A LA LIMITE ',/,&
+'@ POUR LA VITESSE DE MAILLAGE ',/,&
+'@ FACE ',I10 ,' ; PROPRIETE 1 :',I10 ,/,&
+'@ ICODCL(.,IUMA) : ', I10 ,/,&
+'@ ICODCL(.,IVMA) : ', I10 ,/,&
+'@ ICODCL(.,IWMA) : ', I10 ,/,&
+'@ ',/,&
+'@ Si une composante est traitee en glissement (ICODCL=4), ',/,&
+'@ toutes les composantes doivent etre traitees en ',/,&
+'@ glissement. ',/,&
+'@ ' )
+ 4000 format( &
+'@ ',/,&
+'@ METHODE ALE ',/,&
+'@ INCOHERENCE DANS LES CONDITIONS AUX LIMITES POUR LA VITESSE',/,&
+'@ DE MAILLAGE ',/,&
+'@ (cf. message(s) ci-dessus) ',/,&
+'@ ',/,&
+'@ Verifier usalcl.F ',/,&
+'@ ' )
+
+
+return
+end
diff --git a/src/base/armtps.f90 b/src/base/armtps.f90
new file mode 100644
index 0000000..63738bf
--- /dev/null
+++ b/src/base/armtps.f90
@@ -0,0 +1,309 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine armtps &
+!================
+
+ ( ntcabs , ntmabs )
+
+!===============================================================================
+
+! FONCTION :
+! --------
+! ROUTINE PERMETTANT DE STOPPER LE CALCUL PROPREMENT SI
+! LE TEMPS RESTANT ALLOUE AU PROCESS EST INSUFFISANT
+! UNIQUEMENT POUR VPP ET CLUSTER LINUX
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ntcabs ! e ! <-- ! numero absolu du pas de temps courant !
+! ntmabs ! e ! <-- ! numero absolu du pas de temps final !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ntcabs , ntmabs
+
+! VARIABLES LOCALES
+
+integer irangs, lng, itmp(1), itlim
+integer imetho
+data imetho /-1/
+save imetho
+
+integer ntcab0
+save ntcab0
+double precision trest0, trestp, tcpupr
+save trest0, trestp, tcpupr
+
+double precision tmoy00, titpre, trestc, tmoyit, alpha, titsup
+double precision tmarge, aa, bb, cc, tmamin
+double precision tcpuco
+double precision tresmn, titsmx
+
+!===============================================================================
+
+! La variable IMETHO indique si l'on a utilise avec succes
+! TREMAIN (1), TCPUMX (2) pour determiner le temps CPU limite,
+! ou s'il ne semble avoir aucune limite ou que les deux methodes
+! on echou� (0). Avant le premier passage, elle vaut -1.
+
+if (imetho.ne.0) then
+
+!===============================================================================
+! 1. AU PREMIER PASSAGE : INITIALISATIONS
+!===============================================================================
+
+ if (imetho.eq.-1) then
+
+! --- Premier passage : on essaie d'abord TREMAI
+! Si l'on obtient pas de temps CPU limite, on essaie
+! TCPUMX, qui se base sur la presence de la variable
+! d'environnement CS_MAXTIME.
+
+ call tremai(trest0, itlim)
+ !==========
+ if (itlim.eq.1) then
+ imetho = 1
+ else
+ call tcpumx(trest0, itlim)
+ !==========
+ if (itlim.eq.1) then
+ imetho = 2
+ endif
+ endif
+
+! Si une des methodes fonctionne et indique une limite :
+
+ if (imetho.ge.0) then
+
+ ntcab0 = ntcabs
+
+! --- Temps restant et temps CPU a l'iteration courante
+! (qui sera ensuite la precedente)
+
+ trestp = trest0
+
+ call dmtmps(tcpupr)
+ !==========
+
+ endif
+
+ else
+
+!===============================================================================
+! 2. TEMPS MOYEN PAR ITERATION
+!===============================================================================
+
+! --- Temps de l'iteration precedente
+
+ call dmtmps(tcpuco)
+ !==========
+ titpre = tcpuco-tcpupr
+
+
+! --- Temps restant courant (temps restant pour le process en cours,
+! le temps des autres processes, compilation etc. non compris)
+! --- Temps moyen par iteration depuis le debut
+
+ if (imetho.eq.1) then
+ call tremai(trestc, itlim)
+ !==========
+ tmoy00 = (trest0-trestc)/dble(ntcabs-ntcab0)
+ else if (imetho.eq.2) then
+! Ici on utilise le temps alloue initialement
+ trestc = max(trest0 - tcpuco,0.d0)
+ tmoy00 = tcpuco/dble(ntcabs-ntcab0)
+ endif
+
+! --- Estimation du temps par iteration
+! ALPHA -> 0 EST PLUS SUR
+
+ alpha = 0.25d0
+ tmoyit = alpha*titpre + (1.d0-alpha)*tmoy00
+
+! --- Temps restant iteration courante (qui sera ensuite la precedente)
+
+ trestp = trestc
+
+! --- Temps CPU iteration courante (qui sera ensuite la precedente)
+
+ tcpupr = tcpuco
+
+!===============================================================================
+! 3. TEMPS NECESSAIRE POUR UNE ITERATION DE PLUS
+!===============================================================================
+
+! --- Marge pour les sorties ...
+! 100 fois une iteration ou 10% du temps alloue au process (-lt)
+! et au moins 50s ou 1% du temps alloue alloue au process (-lt)
+
+! Soit pour des jobs de
+! moins de 1000 iter : 10% du temps alloue
+! plus de 1000 iter et
+! moins de 10000 iter : 100 fois une iter
+! plus de 10000 iter : 1% du temps alloue
+
+
+ if (tmarus.lt.0.d0) then
+
+ aa = 100.d0
+ bb = 0.10d0
+ cc = 0.01d0
+ tmamin = 50.d0
+
+ tmarge = min(tmoyit*aa,trest0*bb)
+ tmarge = max(tmarge,tmamin)
+ tmarge = max(tmarge,trest0*cc)
+
+ else
+
+ tmarge = tmarus
+
+ endif
+
+
+! --- Temps necessaire pour une iteration de plus
+
+ titsup = tmoyit + tmarge
+
+!===============================================================================
+! 4. TEST (en parallele, le processeur 0 commande)
+!===============================================================================
+
+! On s'arrete si le temps restant minimum est inferieur au
+! temps maximum estime pour une iter de plus.
+! Les notions de min et de max sont relatives aux calculs en parallele.
+! En effet, les temps sont estimes separement par les differents
+! processeurs et il faut qu'ils aient tous le temps de finir.
+! Avec cette methode la marge est la meme pour tous.
+! Bien noter que UN SEUL processeur doit decider d'arreter le calcul.
+
+ tresmn = trestc
+ titsmx = titsup
+ if(irangp.ge.0) then
+ call parmin(tresmn)
+ call parmax(titsmx)
+ endif
+ if(irangp.lt.0.or.irangp.eq.0) then
+ if (tresmn.lt.titsmx) then
+ ntmabs = ntcabs
+ write(nfecra,1000) ntmabs
+ endif
+ else
+ ntmabs = 0
+ endif
+! Broadcast
+ if(irangp.ge.0) then
+ irangs = 0
+ lng = 1
+ itmp(1) = ntmabs
+ call parbci(irangs,lng,itmp)
+ ntmabs = itmp(1)
+ endif
+
+ if (ntcabs.eq.ntmabs) then
+ write(nfecra,1100) trestc, titsup, tmoy00, titpre, tmarge
+ endif
+
+ endif
+
+endif
+
+
+!===============================================================================
+! 5. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+'===============================================================',&
+/,' ** ARRET PAR MANQUE DE TEMPS ', &
+/,' ------------------------- ', &
+/,' NOMBRE DE PAS DE TEMPS MAX IMPOSE A NTCABS : ',I10, /,&
+'===============================================================',&
+ /)
+
+ 1100 format(/, &
+'===============================================================',&
+/,' ** GESTION DU TEMPS RESTANT ', &
+/,' ------------------------ ', &
+/,' TEMPS RESTANT ALLOUE AU PROCESS : ',E14.5, &
+/,' TEMPS ESTIME POUR UNE ITERATION DE PLUS : ',E14.5, &
+/,' DUREE MOYENNE D''UNE ITERATION EN TEMPS : ',E14.5, &
+/,' DUREE DE L''ITERATION PRECEDENTE : ',E14.5, &
+/,' MARGE DE SECURITE : ',E14.5, /, &
+'===============================================================',&
+ /)
+
+#else
+
+ 1000 format(/, &
+'===============================================================',&
+/,' ** STOP BECAUSE OF TIME EXCEEDED' &
+/,' -----------------------------', &
+/,' MAX NUMBER OF TIME STEP SET TO NTCABS: ',I10, /,&
+'===============================================================',&
+ /)
+
+ 1100 format(/, &
+'===============================================================',&
+/,' ** REMAINING TIME MANAGEMENT ', &
+/,' ------------------------- ', &
+/,' REMAINING TIME ALLOCATED TO THE PROCESS : ',E14.5, &
+/,' ESTIMATED TIME FOR ANOTHER TIME STEP : ',E14.5, &
+/,' MEAN TIME FOR A TIME STEP : ',E14.5, &
+/,' TIME FOR THE PREVIOUS TIME STEP : ',E14.5, &
+/,' SECURITY MARGIN : ',E14.5, /,&
+'===============================================================',&
+ /)
+
+#endif
+
+end
diff --git a/src/base/autmgr.f90 b/src/base/autmgr.f90
new file mode 100644
index 0000000..073c334
--- /dev/null
+++ b/src/base/autmgr.f90
@@ -0,0 +1,376 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine autmgr &
+!================
+
+ ( igr , isym , iagmax , nagmax , &
+ ncelf , ncelfe , nfacf , iwarnp , &
+ ifacef , &
+ daf , xaf , surfaf , volumf , xyzfin , &
+ irscel , &
+ indic , inombr , irsfac , indicf , w1 , w2 )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! MULTIGRILLE ALGEBRIQUE :
+! CONSTRUCTION D'UN NIVEAU DE MAILLAGE GROSSIER A PARTIR
+! DU NIVEAU SUPERIEUR SUIVANT CRITERE AUTOMATIQUE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nfecra ! e ! <-- ! numero du fichier d'impressions !
+! isym ! e ! <-- ! indicateur = 1 matrice sym !
+! ! ! ! = 2 matrice non sym !
+! igr ! e ! <-- ! niveau du maillage grossier !
+! ncelf ! e ! <-- ! nombre d'elements maillage fin !
+! ncelfe ! e ! <-- ! nombre d'elements etendus fin !
+! nfacf ! e ! <-- ! nombre de faces internes maill. fin !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! ifacef ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfacf) ! ! ! du maillage fin !
+! daf(ncelfe) ! tr ! <-- ! diagonale matrice maillage fin !
+! xaf ! tr ! <-- ! extradiagonale matrice maillage fin !
+! (nfacf, isym) ! ! ! !
+! surfaf ! tr ! <-- ! surfaces faces internes maillage fin !
+! (3, nfacf) ! ! ! !
+! volumf ! tr ! <-- ! volumes des cellules du maillage fin !
+! (ncelfe) ! ! ! !
+! xyzfin ! tr ! <-- ! centres des cellules du maillage fin !
+! (3, ncelfe) ! ! ! !
+! irscel ! te ! --> ! cellule fine -> cellule grossiere !
+! (ncelfe) ! ! ! !
+! indic(ncelfe) ! te ! --- ! tableau de travail !
+! inombr ! te ! --- ! tableau de travail !
+! (ncelfe) ! ! ! !
+! irsfac ! te ! --- ! face fine -> face grossiere !
+! (nfacf) ! ! ! (tableau de travail) !
+! indicf(nfacf) ! te ! --- ! indicateur de regroupement des faces !
+! icelfa ! te ! --- ! connectivite cellules->faces mailla- !
+! (2*nfacf) ! ! ! ge fin !
+! icelce ! te ! --- ! connectivite cellules->cellules !
+! (2*nfacf) ! ! ! voisines du maillage fin !
+! rw(ncelf) ! tr ! --- ! tableau de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "optcal.h"
+include "parall.h"
+
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+integer igr, isym, iagmax, nagmax
+integer ncelf, ncelfe, nfacf
+integer iwarnp
+
+integer ifacef(2, nfacf)
+integer irscel(ncelfe)
+integer indic(ncelfe), inombr(ncelfe)
+integer indicf(nfacf), irsfac(nfacf)
+
+double precision daf(ncelfe), xaf(nfacf,isym)
+double precision surfaf(3,nfacf), volumf(ncelfe)
+double precision xyzfin(3,ncelfe)
+double precision w1(ncelfe), w2(ncelfe)
+
+! Local variables
+
+double precision critr, epslon
+
+integer ncelg, icel, ifac , ifac1, icelg
+integer nfacn,nfacnr,npass,npasmx
+integer inditt, noaglo, ngros, incvoi
+integer ihist(10)
+integer i, j, imin, imax
+
+!===============================================================================
+
+! Default parameters
+
+epslon = +1.d-6
+ngros = 8
+npasmx = 10
+incvoi = 1
+
+!===============================================================================
+! 1. Initialization
+!===============================================================================
+
+do icel = 1, ncelfe
+ indic(icel) = -1
+ irscel(icel) = 0
+ inombr(icel) = 1
+enddo
+do ifac = 1, nfacf
+ indicf(ifac) = ifac
+ irsfac(ifac) = ifac
+enddo
+
+! Compute cardinality (number of neighbors for each cell -1)
+
+do ifac = 1, nfacf
+ i = ifacef(1,ifac)
+ j = ifacef(2,ifac)
+ indic(i) = indic(i) + 1
+ indic(j) = indic(j) + 1
+enddo
+
+ncelg = 0
+nfacnr = nfacf
+npass = 0
+noaglo = ncelf
+
+! Passes
+
+do while (npass .lt. npasmx)
+
+ npass = npass+1
+ nfacn = nfacnr
+ iagmax= iagmax +1
+ iagmax= min(iagmax, nagmax)
+
+ do ifac=1,nfacn
+ irsfac(ifac) = indicf(ifac)
+ indicf(ifac) = 0
+ enddo
+ if (nfacn .lt. nfacf) then
+ do ifac = nfacn+1, nfacf
+ indicf(ifac) = 0
+ irsfac(ifac) = 0
+ enddo
+ endif
+
+ if (iwarnp .gt. 3) then
+ write(nfecra,2001) npass, nfacnr, noaglo
+ endif
+
+ ! Increment number of neighbors
+
+ do icel = 1, ncelf
+ indic(icel) = indic(icel) + incvoi
+ enddo
+
+ ! Initialize non-eliminated faces
+
+ nfacnr = 0
+
+ ! Loop on non-eliminated faces
+
+ do ifac1 = 1, nfacn
+
+ ifac = irsfac(ifac1)
+ i = ifacef(1,ifac)
+ j = ifacef(2,ifac)
+
+ ! Exclude faces on parallel or periodic boundary, so as not to
+ ! coarsen the grid across those boundaries (which would change
+ ! the communication pattern and require a more complex algorithm).
+
+ if (i.le.ncelf .and. j.le.ncelf) then
+
+ inditt = 0
+ critr = (daf(i)/indic(i))*(daf(j)/indic(j)) &
+ /( xaf(ifac,1)*xaf(ifac,isym))
+
+ if (critr.lt.(1.d0-epslon) .and. irscel(i)*irscel(j).le.0) then
+
+ if (irscel(i).gt.0 .and. irscel(j).le.0) then
+ if(inombr(irscel(i)) .le. iagmax) then
+ irscel(j) = irscel(i)
+ inombr(irscel(i)) = inombr(irscel(i)) +1
+ inditt = inditt +1
+ endif
+ else if (irscel(i).le.0 .and. irscel(j).gt.0) then
+ if (inombr(irscel(j)).le.iagmax) then
+ irscel(i) = irscel(j)
+ inombr(irscel(j)) = inombr(irscel(j)) + 1
+ inditt = inditt +1
+ endif
+ else if (irscel(i).le.0 .and. irscel(j).le.0) then
+ ncelg = ncelg+1
+ irscel(i) = ncelg
+ irscel(j) = ncelg
+ inombr(ncelg) = inombr(ncelg) +1
+ inditt = inditt +1
+ endif
+
+ endif
+
+ if (inditt.eq.0 .and. irscel(i)*irscel(j).le.0) then
+ nfacnr = nfacnr +1
+ indicf(nfacnr) = ifac
+ endif
+
+ endif
+
+ enddo
+
+ ! Check the number of coarse cells created
+
+ noaglo = 0
+ do icel=1,ncelf
+ if (irscel(icel).le.0) noaglo = noaglo+1
+ enddo
+
+ ! Additional passes if agglomeration is insufficient
+
+ if ( (noaglo.eq.0) &
+ .or. ((ncelg+noaglo)*ngros .lt. ncelf) &
+ .or. (nfacnr.eq.0)) then
+ npasmx = npass
+ endif
+
+enddo ! Loop on passes
+
+! Finish assembly
+
+do icel = 1, ncelf
+ if (irscel(icel).le.0) then
+ ncelg = ncelg+1
+ irscel(icel) = ncelg
+ endif
+enddo
+
+! Various checks
+
+imax = 0
+imin = 2*ncelf
+do icelg =1,ncelg
+ imax = max(imax, inombr(icelg))
+ imin = min(imin, inombr(icelg))
+enddo
+
+if (irangp .ge. 0) then
+ call parcmn(imin)
+ call parcmx(imax)
+endif
+
+if (iwarnp.gt.3) then
+
+ write(nfecra,2002) imin, imax, nagmax
+ write(nfecra,2003)
+ noaglo=imax-imin+1
+ if (noaglo.gt.0) then
+ if (noaglo.gt.10) then
+ write(nfecra,*) ' ihist badly dimensioned in autmgr'
+ call csexit(1)
+ endif
+ do i = 1, noaglo
+ ihist(i) = 0
+ enddo
+ do icelg = 1, ncelg
+ do i = 1, noaglo
+ if (inombr(icelg).eq.(imin+i-1))then
+ ihist(i)=ihist(i)+1
+ endif
+ enddo
+ enddo
+ if (irangp .ge. 0) then
+ call parism(noaglo, ihist)
+ endif
+ do i = 1, noaglo
+ epslon = 100.d0*ihist(i)/ncelg
+ write(nfecra,2004) imin+i-1, epslon
+ enddo
+ endif
+
+endif
+
+do icel = 1, ncelf
+ indic(icel) = 0
+enddo
+do icel = 1, ncelf
+ icelg = irscel(icel)
+ indic(icelg) = indic(icelg) +1
+enddo
+
+i=0
+j=2*ncelf
+noaglo = 0
+do icelg = 1, ncelg
+ i = max(i, indic(icelg))
+ j = min(j, indic(icelg))
+ noaglo = noaglo + indic(icelg)
+enddo
+
+if (irangp .ge. 0) then
+ call parcmn(j)
+ call parcmx(j)
+endif
+
+if (iwarnp.gt.3) then
+ write(nfecra,2005) j, i
+endif
+
+if (noaglo .ne. ncelf) then
+ write(nfecra,*) ' Bug in autmgr, contact support.'
+ call csexit(1)
+endif
+
+!--------
+! Formats
+!--------
+
+ 2001 format(&
+ ' autmgr: pass ', i3, 'nfacnr = ', i10, ' noaglo = ', i10)
+ 2002 format(&
+ ' autmgr: inombr min = ', i10, ' max = ', i10, ' target = ', i10)
+ 2003 format(&
+ ' histogram ')
+ 2004 format(&
+ ' regroupment ', i10,' = ', e12.5,' %')
+ 2005 format(&
+ ' autmgr: agglomeration min = ', i10, ' max= ', i10)
+!==============================================================================
+
+return
+end
+
diff --git a/src/base/bilsc2.f90 b/src/base/bilsc2.f90
new file mode 100644
index 0000000..6a34c9b
--- /dev/null
+++ b/src/base/bilsc2.f90
@@ -0,0 +1,1360 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine bilsc2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvar , pvara , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscf , viscb , &
+ smbrp , &
+ dpdx , dpdy , dpdz , dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! CALCUL DU BILAN EXPLICITE DE LA VARIABLE PVAR (VITESSE,SCALAIRES)
+
+! -- . -----> -->
+! SMBRP = SMBRP - \ m PVAR +Visc ( grad PVAR ) . n
+! /__ ij ij ij ij ij
+! j
+
+! ATTENTION : SMBRP DEJA INITIALISE AVANT L'APPEL A BILSCA
+! IL CONTIENT LES TERMES SOURCES EXPLICITES, ETC....
+
+! BLENCP = 1 : PAS D'UPWIND EN DEHORS DU TEST DE PENTE
+! BLENCP = 0 : UPWIND
+! ISCHCP = 1 : CENTRE
+! ISCHCP = 0 : SECOND ORDER
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtvar ! e ! <-- ! indicateur du schema temporel !
+! ivar ! e ! <-- ! numero de la variable !
+! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
+! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! ircflp ! e ! <-- ! indicateur = 1 rec flux, 0 sinon !
+! ischcp ! e ! <-- ! indicateur = 1 centre , 0 2nd order !
+! isstpp ! e ! <-- ! indicateur = 1 sans test de pente !
+! ! ! ! = 0 avec test de pente !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! ipp ! e ! <-- ! numero de variable pour post !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! blencp ! r ! <-- ! 1 - proportion d'upwind !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! relaxp ! r ! <-- ! coefficient de relaxation !
+! thetap ! r ! <-- ! coefficient de ponderation pour le !
+! ! ! ! theta-schema (on ne l'utilise pour le !
+! ! ! ! moment que pour u,v,w et les scalaire !
+! ! ! ! - thetap = 0.5 correspond a un schema !
+! ! ! ! totalement centre en temps (mixage !
+! ! ! ! entre crank-nicolson et adams- !
+! ! ! ! bashforth) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! pvar (ncelet ! tr ! <-- ! variable resolue (instant courant) !
+! pvar (ncelet ! tr ! <-- ! variable resolue (instant precedent) !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour p !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! cofafp, b ! tr ! <-- ! tableaux des cond lim pour le flux de !
+! (nfabor) ! ! ! diffusion de p !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! viscf (nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
+! ! ! ! pour second membre !
+! viscb (nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
+! ! ! ! pour second membre !
+! smbrp(ncelet ! tr ! <-- ! bilan au second membre !
+! dpdx,y,z ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet) ! ! ! !
+! dpdxa,ya,za ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet) ! ! ! avec decentrement amont !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "vector.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer idtvar
+integer ivar , iconvp , idiffp , nswrgp , imligp
+integer ircflp , ischcp , isstpp
+integer inc , imrgra , iccocg
+integer iwarnp , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision blencp , epsrgp , climgp, extrap, relaxp , thetap
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pvar (ncelet), pvara(ncelet)
+double precision coefap(nfabor), coefbp(nfabor)
+double precision cofafp(nfabor), cofbfp(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision viscf (nfac), viscb (nfabor)
+double precision smbrp(ncelet)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+character*8 cnom
+integer idebia, idebra
+integer ifac,ii,jj,infac,iel,iupwin, iij, iii, iok
+integer itenso, idimte, iphydp
+integer iiu(nphsmx),iiv(nphsmx),iiw(nphsmx)
+integer iitytu(nphsmx)
+integer iir11(nphsmx),iir22(nphsmx),iir33(nphsmx)
+integer iir12(nphsmx),iir13(nphsmx),iir23(nphsmx)
+double precision pfac,pfacd,flui,fluj,flux,fluxi,fluxj
+double precision difx,dify,difz,djfx,djfy,djfz
+double precision pif,pjf,pip,pjp,pir,pjr,pipr,pjpr
+double precision pifr,pjfr,pifri,pifrj,pjfri,pjfrj
+double precision testi,testj,testij
+double precision dpxf,dpyf,dpzf
+double precision dcc, ddi, ddj, tesqck
+double precision dijpfx, dijpfy, dijpfz
+double precision diipfx, diipfy, diipfz
+double precision djjpfx, djjpfy, djjpfz
+double precision diipbx, diipby, diipbz
+double precision pond, dist, surfan
+double precision pfac1, pfac2, pfac3, unsvol
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+chaine = nomvar(ipp)
+cnom = chaine(1:8)
+
+if(iwarnp.ge.2) then
+ if (ischcp.eq.1) then
+ WRITE(NFECRA,1000)CNOM,' CENTRE ', &
+ (1.d0-blencp)*100.d0
+ else
+ WRITE(NFECRA,1000)CNOM,' 2ND ORDER ', &
+ (1.d0-blencp)*100.d0
+ endif
+endif
+
+iupwin = 0
+if(blencp.eq.0.d0) iupwin = 1
+
+!===============================================================================
+! 2. CALCUL DU BILAN AVEC TECHNIQUE DE RECONSTRUCTION
+!===============================================================================
+
+! ======================================================================
+! ---> CALCUL DU GRADIENT DE P
+! ======================================================================
+! DPDX sert a la fois pour la reconstruction des flux et pour le test
+! de pente. On doit donc le calculer :
+! - quand on a de la diffusion et qu'on reconstruit les flux
+! - quand on a de la convection SOLU
+! - quand on a de la convection, qu'on n'est pas en upwind pur
+! et qu'on reconstruit les flux
+! - quand on a de la convection, qu'on n'est pas en upwind pur
+! et qu'on n'a pas shunte le test de pente
+
+if( (idiffp.ne.0 .and. ircflp.eq.1) .or. &
+ (iconvp.ne.0 .and. iupwin.eq.0 .and. &
+ (ischcp.eq.0 .or. ircflp.eq.1 .or. isstpp.eq.0)) ) then
+
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dpdxa , dpdxa , dpdxa , &
+ pvar , coefap , coefbp , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+else
+ do iel = 1, ncelet
+ dpdx(iel) = 0.d0
+ dpdy(iel) = 0.d0
+ dpdz(iel) = 0.d0
+ enddo
+endif
+
+
+! ======================================================================
+! ---> CALCUL DU GRADIENT DECENTRE DPDXA, DPDYA, DPDZA POUR TST DE PENTE
+! ======================================================================
+
+do iel = 1, ncelet
+ dpdxa(iel) = 0.d0
+ dpdya(iel) = 0.d0
+ dpdza(iel) = 0.d0
+enddo
+
+if( iconvp.gt.0.and.iupwin.eq.0.and.isstpp.eq.0 ) then
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+ pif = pvar(ii) +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ pfac = pjf
+ if( flumas(ifac ).gt.0.d0 ) pfac = pif
+
+ pfac1 = pfac*surfac(1,ifac )
+ pfac2 = pfac*surfac(2,ifac )
+ pfac3 = pfac*surfac(3,ifac )
+
+ dpdxa(ii) = dpdxa(ii) +pfac1
+ dpdya(ii) = dpdya(ii) +pfac2
+ dpdza(ii) = dpdza(ii) +pfac3
+
+ dpdxa(jj) = dpdxa(jj) -pfac1
+ dpdya(jj) = dpdya(jj) -pfac2
+ dpdza(jj) = dpdza(jj) -pfac3
+
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+ pif = pvar(ii) +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ pfac = pjf
+ if( flumas(ifac ).gt.0.d0 ) pfac = pif
+
+ pfac1 = pfac*surfac(1,ifac )
+ pfac2 = pfac*surfac(2,ifac )
+ pfac3 = pfac*surfac(3,ifac )
+
+ dpdxa(ii) = dpdxa(ii) +pfac1
+ dpdya(ii) = dpdya(ii) +pfac2
+ dpdza(ii) = dpdza(ii) +pfac3
+
+ dpdxa(jj) = dpdxa(jj) -pfac1
+ dpdya(jj) = dpdya(jj) -pfac2
+ dpdza(jj) = dpdza(jj) -pfac3
+
+ enddo
+
+ endif
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac )
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+ pfac = inc*coefap(ifac ) &
+ +coefbp(ifac )*(pvar(ii)+diipbx*dpdx(ii) &
+ +diipby*dpdy(ii)+diipbz*dpdz(ii) )
+ dpdxa(ii) = dpdxa(ii) +pfac*surfbo(1,ifac )
+ dpdya(ii) = dpdya(ii) +pfac*surfbo(2,ifac )
+ dpdza(ii) = dpdza(ii) +pfac*surfbo(3,ifac )
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac =1,nfabor
+ ii = ifabor(ifac )
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+ pfac = inc*coefap(ifac ) &
+ +coefbp(ifac )*(pvar(ii)+diipbx*dpdx(ii) &
+ +diipby*dpdy(ii)+diipbz*dpdz(ii) )
+ dpdxa(ii) = dpdxa(ii) +pfac*surfbo(1,ifac )
+ dpdya(ii) = dpdya(ii) +pfac*surfbo(2,ifac )
+ dpdza(ii) = dpdza(ii) +pfac*surfbo(3,ifac )
+ enddo
+
+ endif
+
+ do iel = 1, ncel
+ unsvol = 1.d0/volume(iel)
+ dpdxa(iel) = dpdxa(iel)*unsvol
+ dpdya(iel) = dpdya(iel)*unsvol
+ dpdza(iel) = dpdza(iel)*unsvol
+ enddo
+
+! TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (dpdxa)
+ !==========
+ call parcom (dpdya)
+ !==========
+ call parcom (dpdza)
+ !==========
+ endif
+
+! TRAITEMENT DE LA PERIODICITE
+
+! On echange pour la translation
+! pour la rotation, on prend le gradient simple (pas de temps precedent)
+
+ if(iperio.eq.1) then
+
+! Pour les rotations
+! avec la vitesse et les tensions de Reynolds,
+! on utilise la valeur du gradient simple (PERING) a defaut de mieux.
+! Dans les autres cas, on echange DPDXA
+
+! On recupere d'abord certains COMMON necessaires a PERING
+
+ call pergra &
+ !==========
+ ( nphsmx , nphas , &
+ iiu , iiv , iiw , &
+ iitytu , &
+ iir11 , iir22 , iir33 , iir12 , iir13 , iir23 )
+
+ call pering &
+ !==========
+ ( nphas , ivar , &
+ idimte , itenso , iperot , iguper , igrper , &
+ iiu , iiv , iiw , iitytu , &
+ iir11 , iir22 , iir33 , iir12 , iir13 , iir23 , &
+ dpdxa , dpdya , dpdza , &
+ ra(idudxy) , ra(idrdxy) )
+
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dpdxa , dpdxa , dpdxa , &
+ dpdya , dpdya , dpdya , &
+ dpdza , dpdza , dpdza )
+ endif
+
+endif
+
+
+! ======================================================================
+! ---> ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+! ======================================================================
+
+infac = 0
+
+if(ncelet.gt.ncel) then
+ do iel = ncel+1, ncelet
+ smbrp(iel) = 0.d0
+ enddo
+endif
+
+
+! --> FLUX UPWIND PUR
+! =====================
+
+if(iupwin.eq.1) then
+
+! Stationnaire
+ if (idtvar.lt.0) then
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+! en parallele, la face sera comptee d'un cote OU (exclusif) de l'autre
+ if (ii.le.ncel) then
+ infac = infac+1
+ endif
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+! reconstruction uniquement si IRCFLP = 1
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+ pipr = pvar(ii)/relaxp - (1.d0-relaxp)/relaxp * pvara(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjpr = pvar(jj)/relaxp - (1.d0-relaxp)/relaxp * pvara(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+ pifr = pvar(ii)/relaxp - (1.d0-relaxp)/relaxp * pvara(ii)
+ pjfr = pvar(jj)/relaxp - (1.d0-relaxp)/relaxp * pvara(jj)
+
+
+ fluxi = iconvp*( flui*pifr +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pipr -pjp )
+ fluxj = iconvp*( flui*pif +fluj*pjfr ) &
+ + idiffp*viscf(ifac)*( pip -pjpr )
+
+ smbrp(ii) = smbrp(ii) - fluxi
+ smbrp(jj) = smbrp(jj) + fluxj
+
+ enddo
+
+! Instationnaire
+ else
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+! en parallele, la face sera comptee d'un cote OU (exclusif) de l'autre
+ if (ii.le.ncel) then
+ infac = infac+1
+ endif
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+ smbrp(ii) = smbrp(ii) - thetap * flux
+ smbrp(jj) = smbrp(jj) + thetap * flux
+
+ enddo
+
+ endif
+
+
+! --> FLUX SANS TEST DE PENTE
+! ============================
+
+elseif(isstpp.eq.1) then
+
+! Stationnaire
+ if (idtvar.lt.0) then
+
+ iok = 0
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+ pipr = pvar(ii)/relaxp - (1.d0 - relaxp)/relaxp*pvara(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjpr = pvar(jj)/relaxp - (1.d0 - relaxp)/relaxp*pvara(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pir = pvar(ii)/relaxp - (1.d0 - relaxp)/relaxp*pvara(ii)
+ pjr = pvar(jj)/relaxp - (1.d0 - relaxp)/relaxp*pvara(jj)
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pifri = pond*pipr +(1.d0-pond)*pjp
+ pjfri = pifri
+ pifrj = pond*pip +(1.d0-pond)*pjpr
+ pjfrj = pifrj
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pifri = pir + difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pifrj = pvar(ii) &
+ +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjfrj = pjr + djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+ pjfri = pvar(jj) &
+ +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+
+! BLENDING
+! ----------
+
+ pifri = blencp*pifri+(1.d0-blencp)*pir
+ pifrj = blencp*pifrj+(1.d0-blencp)*pvar(ii)
+ pjfri = blencp*pjfri+(1.d0-blencp)*pvar(jj)
+ pjfrj = blencp*pjfrj+(1.d0-blencp)*pjr
+
+
+! FLUX
+! ------
+
+ fluxi = iconvp*( flui*pifri + fluj*pjfri ) &
+ +idiffp*viscf(ifac)*( pipr -pjp )
+ fluxj = iconvp*( flui*pifrj +fluj*pjfrj ) &
+ +idiffp*viscf(ifac)*( pip -pjpr )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) - fluxi
+ smbrp(jj) = smbrp(jj) + fluxj
+
+ enddo
+! Position "hors boucle" du CALL CSEXIT pour raisons
+! historiques,pour eviter de devectoriser la boucle
+! -> a conserver si on recherche a optimiser la boucle en
+! vectorisation
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+! Instationnaire
+ else
+
+ iok = 0
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pif = pond*pip +(1.d0-pond)*pjp
+ pjf = pif
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pif = pvar(ii) &
+ +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) &
+ +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+
+! BLENDING
+! ----------
+
+ pif = blencp*pif+(1.d0-blencp)*pvar(ii)
+ pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
+
+
+! FLUX
+! ------
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) - thetap * flux
+ smbrp(jj) = smbrp(jj) + thetap * flux
+
+ enddo
+! Position "hors boucle" du CALL CSEXIT pour raisons
+! historiques,pour eviter de devectoriser la boucle
+! -> a conserver si on recherche a optimiser la boucle en
+! vectorisation
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+ endif
+
+
+
+
+! --> FLUX AVEC TEST DE PENTE (separe pour vectorisation eventuelle)
+! =============================
+
+else
+
+! Stationnaire
+ if (idtvar.lt.0) then
+
+ iok = 0
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+ dist = ra(idist-1+ifac)
+ surfan = ra(isrfan-1+ifac)
+
+! ON RECALCULE II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+ pipr = pvar(ii)/relaxp - (1.d0 - relaxp)/relaxp*pvara(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjpr = pvar(jj)/relaxp - (1.d0 - relaxp)/relaxp*pvara(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pir = pvar(ii)/relaxp - (1.d0 - relaxp)/relaxp*pvara(ii)
+ pjr = pvar(jj)/relaxp - (1.d0 - relaxp)/relaxp*pvara(jj)
+
+! TEST DE PENTE
+! ---------------
+
+ testi = dpdxa(ii)*surfac(1,ifac) +dpdya(ii)*surfac(2,ifac) &
+ + dpdza(ii)*surfac(3,ifac)
+ testj = dpdxa(jj)*surfac(1,ifac) +dpdya(jj)*surfac(2,ifac) &
+ + dpdza(jj)*surfac(3,ifac)
+ testij= dpdxa(ii)*dpdxa(jj) +dpdya(ii)*dpdya(jj) &
+ + dpdza(ii)*dpdza(jj)
+
+ if( flumas(ifac).gt.0.d0) then
+ dcc = dpdx(ii)*surfac(1,ifac) +dpdy(ii)*surfac(2,ifac) &
+ + dpdz(ii)*surfac(3,ifac)
+ ddi = testi
+ ddj = ( pvar(jj)-pvar(ii) )/dist *surfan
+ else
+ dcc = dpdx(jj)*surfac(1,ifac) +dpdy(jj)*surfac(2,ifac) &
+ + dpdz(jj)*surfac(3,ifac)
+ ddi = ( pvar(jj)-pvar(ii) )/dist *surfan
+ ddj = testj
+ endif
+ tesqck = dcc**2 -(ddi-ddj)**2
+
+
+! UPWIND
+! --------
+
+!MO IF( (TESTI*TESTJ).LE.0.D0 .OR. TESTIJ.LE.0.D0 ) THEN
+ if( tesqck.le.0.d0 .or. testij.le.0.d0 ) then
+
+ pifri = pir
+ pifrj = pvar(ii)
+ pjfri = pvar(jj)
+ pjfrj = pjr
+! en parallele, la face sera comptee d'un cote OU (exclusif) de l'autre
+ if (ii.le.ncel) then
+ infac = infac+1
+ endif
+
+ else
+
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pifri = pond*pipr +(1.d0-pond)*pjp
+ pjfri = pifri
+ pifrj = pond*pip +(1.d0-pond)*pjpr
+ pjfrj = pifrj
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pifri = pir + difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pifrj = pvar(ii) &
+ +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjfrj = pjr + djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+ pjfri = pvar(jj) &
+ +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+ endif
+
+
+! BLENDING
+! ----------
+
+ pifri = blencp*pifri+(1.d0-blencp)*pir
+ pifrj = blencp*pifrj+(1.d0-blencp)*pvar(ii)
+ pjfri = blencp*pjfri+(1.d0-blencp)*pvar(jj)
+ pjfrj = blencp*pjfrj+(1.d0-blencp)*pjr
+
+
+! FLUX
+! ------
+
+ fluxi = iconvp*( flui*pifri + fluj*pjfri ) &
+ +idiffp*viscf(ifac)*( pipr -pjp )
+ fluxj = iconvp*( flui*pifrj +fluj*pjfrj ) &
+ +idiffp*viscf(ifac)*( pip -pjpr )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) - fluxi
+ smbrp(jj) = smbrp(jj) + fluxj
+
+ enddo
+! Position "hors boucle" du CALL CSEXIT pour raisons
+! historiques,pour eviter de devectoriser la boucle
+! -> a conserver si on recherche a optimiser la boucle en
+! vectorisation
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+! Instationnaire
+ else
+
+ iok = 0
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+ dist = ra(idist-1+ifac)
+ surfan = ra(isrfan-1+ifac)
+
+! ON RECALCULE II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+
+! TEST DE PENTE
+! ---------------
+
+ testi = dpdxa(ii)*surfac(1,ifac) +dpdya(ii)*surfac(2,ifac) &
+ + dpdza(ii)*surfac(3,ifac)
+ testj = dpdxa(jj)*surfac(1,ifac) +dpdya(jj)*surfac(2,ifac) &
+ + dpdza(jj)*surfac(3,ifac)
+ testij= dpdxa(ii)*dpdxa(jj) +dpdya(ii)*dpdya(jj) &
+ + dpdza(ii)*dpdza(jj)
+
+ if( flumas(ifac).gt.0.d0) then
+ dcc = dpdx(ii)*surfac(1,ifac) +dpdy(ii)*surfac(2,ifac) &
+ + dpdz(ii)*surfac(3,ifac)
+ ddi = testi
+ ddj = ( pvar(jj)-pvar(ii) )/dist *surfan
+ else
+ dcc = dpdx(jj)*surfac(1,ifac) +dpdy(jj)*surfac(2,ifac) &
+ + dpdz(jj)*surfac(3,ifac)
+ ddi = ( pvar(jj)-pvar(ii) )/dist *surfan
+ ddj = testj
+ endif
+ tesqck = dcc**2 -(ddi-ddj)**2
+
+
+! UPWIND
+! --------
+
+!MO IF( (TESTI*TESTJ).LE.0.D0 .OR. TESTIJ.LE.0.D0 ) THEN
+ if( tesqck.le.0.d0 .or. testij.le.0.d0 ) then
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+! en parallele, la face sera comptee d'un cote OU (exclusif) de l'autre
+ if (ii.le.ncel) then
+ infac = infac+1
+ endif
+
+ else
+
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pif = pond*pip +(1.d0-pond)*pjp
+ pjf = pif
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pif = pvar(ii) &
+ + difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) &
+ + djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+ endif
+
+
+! BLENDING
+! ----------
+
+ pif = blencp*pif+(1.d0-blencp)*pvar(ii)
+ pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
+
+
+! FLUX
+! ------
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) - thetap * flux
+ smbrp(jj) = smbrp(jj) + thetap * flux
+
+ enddo
+! Position "hors boucle" du CALL CSEXIT pour raisons
+! historiques,pour eviter de devectoriser la boucle
+! -> a conserver si on recherche a optimiser la boucle en
+! vectorisation
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+ endif
+
+endif
+
+
+
+if(iwarnp.ge.2) then
+ if (irangp.ge.0) call parcpt(infac)
+ write(nfecra,1100)cnom,infac,nfacgb
+endif
+
+
+! ======================================================================
+! ---> ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+! ======================================================================
+
+! Stationnaire
+if (idtvar.lt.0) then
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pir = pvar(ii)/relaxp - (1.d0-relaxp)/relaxp*pvara(ii)
+ pipr = pir &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pipr
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pipr
+
+ flux = iconvp*( flui*pir +fluj*pfac ) &
+ + idiffp*viscb(ifac)*( pipr -pfacd )
+ smbrp(ii) = smbrp(ii) - flux
+
+ enddo
+
+! Instationnaire
+else
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pip = pvar(ii) &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
+
+ flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
+ + idiffp*viscb(ifac)*( pip -pfacd )
+ smbrp(ii) = smbrp(ii) - thetap * flux
+
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(1X,A8,' : CONVECTION EN ',A11, &
+ ' BLENDING A ',F4.0,' % D''UPWIND')
+ 1100 format(1X,A8,' : ',I10,' FACES UPWIND SUR ', &
+ I10,' FACES INTERNES ')
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS bilsc2 ',/,&
+'@ ========= ',/,&
+'@ APPEL DE bilsc2 POUR ',A8 ,' AVEC ISCHCP = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format(1X,A8,' : CONVECTION IN ',A11, &
+ ' BLENDING WITH ',F4.0,' % OF UPWIND')
+ 1100 format(1X,A8,' : ',I10,' FACES WITH UPWIND ON ', &
+ I10,' INTERIOR FACES ')
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN bilsc2 ',/,&
+'@ ======== ',/,&
+'@ CALL OF bilsc2 FOR ',A8 ,' WITH ISCHCP = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/calgeo.f90 b/src/base/calgeo.f90
new file mode 100644
index 0000000..576eabb
--- /dev/null
+++ b/src/base/calgeo.f90
@@ -0,0 +1,239 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine calgeo &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ volmin , volmax , voltot , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! CALCUL DES ENTITES GEOMETRIQUES DEDUITES
+! DU JEU DE DONNEES MINIMAL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! --> ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! volmin ! r ! --> ! volume de controle minimal !
+! volmax ! r ! --> ! volume de controle maximal !
+! voltot ! r ! --> ! volume total du domaine !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "pointe.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision volmin, volmax, voltot
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+! 1. ON SAUVEGARDE LA POSITION DE LA MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. ON CALCULE LE VOLUME MIN et TOTAL DES ELEMENTS
+!===============================================================================
+
+call clvolc &
+!==========
+ ( ncelet , ncel , &
+ volmin , volmax , voltot , volume )
+
+!===============================================================================
+! 3. ON CALCULE LES SURFACES DES FACES
+!===============================================================================
+
+call clsurn &
+!==========
+ ( idebia , idebra , &
+ nfac , nfabor , &
+ surfac , surfbo , &
+ ra(isrfan) , ra(isrfbn) , &
+ ia , ra )
+
+
+!===============================================================================
+! 4. ON CALCULE LE PRODUIT SCALAIRE DE LA NORMALE NORMEE A UNE FACE ET
+! DU VECTEUR DEFINI PAR LES VOISINS (VOISIN 1 : ORIGINE,
+! VOISIN 2 : EXTREMITE)
+! LA PONDERATION RESULTANTE POND = D2/(D1+D2)
+! OU D1 ET D2 SONT LES PROJETES SUR LA NORMALE A LA FACE DES
+! VECTEURS DEFINIS RESPECTIVEMENT PAR
+! D1 : (ORIGINE : VOISIN 1, EXTREMITE : CENTRE DE GRAVITE DE LA FACE)
+! D2 : (ORIGINE : CENTRE DE GRAVITE DE LA FACE, EXTREMITE : VOISIN 2)
+!===============================================================================
+
+call cldipo &
+!==========
+ ( idebia , idebra , &
+ nfac , nfabor , ncelet , ncel , &
+ ifacel , ifabor , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ ra(isrfan) , ra(isrfbn) , &
+ ra(idist) , ra(idistb) , ra(ipond) , &
+ ia , ra )
+
+!===============================================================================
+! 5. ON CALCULE LES VECTEURS IIP ET JJP POUR LES RECONSTRUCTIONS
+!===============================================================================
+
+call cldijp &
+!==========
+ ( idebia , idebra , &
+ nfac , nfabor , ncelet , ncel , &
+ ifacel , ifabor , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ ra(isrfan) , ra(isrfbn) , &
+ ra(ipond) , &
+ ra(idijpf) , ra(idiipb) , ra(idofij) , &
+ ia , ra )
+
+
+!===============================================================================
+! 6. FILTRAGE DU VOISINAGE ETENDU POUR LE GRADIENT PAR MOINDRES CARRES
+!===============================================================================
+
+if (imrgra.eq.3) then
+
+ call redvse (anomax)
+ !==========
+
+endif
+
+
+!===============================================================================
+! 8. FIN
+!===============================================================================
+
+
+return
+end
diff --git a/src/base/calhyd.f90 b/src/base/calhyd.f90
new file mode 100644
index 0000000..ab0471e
--- /dev/null
+++ b/src/base/calhyd.f90
@@ -0,0 +1,606 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine calhyd &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ indhyd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ fextx , fexty , fextz , &
+ dfextx , dfexty , dfextz , &
+ phydr , flumas , flumab , &
+ coefa , coefb , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION D'UNE EQUATION DE POISSON SUR LA PRESSION HYDROSTATIQUE
+! DIV( GRAD(P) ) = DIV( F )
+! ---- -
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! indhyd ! e ! --> ! indicateur de mise a jour de phydr !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! phydr(ncelet) ! tr ! <-- ! increment de pression hydrostatique !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor) ! ! ! faces de bord !
+! fextx,fexty ! tr ! <-- ! force exterieure generant la pression !
+! fextz(ncelet) ! ! ! hydrostatique !
+! dfextx,dfexty ! tr ! <-- ! increment de force exterieure !
+! dfextz(ncelet ! ! ! generant la pression hydrostatique !
+! viscf(nfac) ! tr ! --- ! 1*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! 1*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr (ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! w1..10(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstnum.h"
+include "optcal.h"
+include "period.h"
+include "parall.h"
+include "mltgrd.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer indhyd
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision fextx(ncelet),fexty(ncelet),fextz(ncelet)
+double precision dfextx(ncelet),dfexty(ncelet),dfextz(ncelet)
+double precision phydr(ncelet)
+double precision flumas(nfac), flumab(nfabor)
+double precision coefa(nfabor), coefb(nfabor)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet)
+double precision smbr(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer lchain
+integer idebia, idebra
+integer iccocg, inc , init , isym , ipol , isqrt
+integer iel , ical
+integer ireslp, nswmpr
+integer isweep, niterf, icycle
+integer iphydp
+integer nswrgp, imligp, iwarnp
+integer ipriph
+integer iinvpe
+integer idiffp, iconvp, ndircp
+integer nitmap, imgrp , ncymap, nitmgp
+integer iagmax, nagmax, npstmg
+double precision residu, rnorm , rnrmf , rnrmdf
+double precision epsrgp, climgp, extrap, epsilp
+double precision precre, precab, thetap
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+
+! --- Variables
+ipriph = ipr(iphas)
+
+
+
+! --- Options de resolution
+! Symetrique
+! Preconditionnement diagonal par defaut
+isym = 1
+if (iresol(ipriph).eq.-1) then
+ ireslp = 0
+ ipol = 0
+else
+ ireslp = mod(iresol(ipriph),1000)
+ ipol = (iresol(ipriph)-ireslp)/1000
+endif
+
+isqrt = 1
+
+! TEST DE VARIATION DE LA PRESSION HYDROSTATIQUE EN SORTIE
+
+
+! on regarde si les terme source ont varie
+! on ne passe dans calhyd que si on a des faces de sortie std
+! la precision pour les tests est a peu pres arbitraire.
+precre = sqrt(epzero)
+precab = 1.d2*epzero
+
+ical = 0
+do iel = 1, ncel
+ rnrmf = fextx(iel)**2+fexty(iel)**2+fextz(iel)**2
+ rnrmdf = dfextx(iel)**2+dfexty(iel)**2+dfextz(iel)**2
+ if ((rnrmdf.ge.precre*rnrmf).and.(rnrmdf.ge.precab)) then
+ ical = 1
+ endif
+enddo
+if (irangp.ge.0) then
+ call parcpt (ical)
+endif
+if (ical.eq.0) then
+ do iel = 1,ncel
+ phydr(iel) = 0.d0
+ enddo
+ indhyd = 0
+ return
+endif
+
+if ( mod(ntcabs,ntlist).eq.0 .or. iwarni(iu(1)) .ge.0 ) &
+ write(nfecra,1000)
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' Calcul de la pression hydrostatique : ',/, &
+' mise a jour des Dirichlets en sortie (CALHYD)',/)
+
+#else
+
+ 1000 format( &
+' Hydrostatic pressure computation: ',/, &
+' updating the Dirichlets at the end (CALHYD)',/)
+
+#endif
+
+indhyd = 1
+
+!===============================================================================
+! 2. PREPARATION DE LA MATRICE DU SYSTEME A RESOUDRE
+!===============================================================================
+
+! ---> TERME INSTATIONNAIRE
+
+do iel = 1, ncel
+ w1(iel) = 0.d0
+enddo
+
+! ---> "VITESSE" DE DIFFUSION FACETTE
+
+do iel = 1, ncel
+ w10(iel) = 1.d0
+enddo
+
+call viscfa &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w10 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+
+iconvp = 0
+idiffp = 1
+! On resout avec des CL de flux nul partout
+ndircp = 0
+
+thetap = 1.d0
+call matrix &
+!==========
+ ( ncelet , ncel , nfac , nfabor , &
+ iconvp , idiffp , ndircp , &
+ isym , nfecra , &
+ thetap , &
+ ifacel , ifabor , &
+ coefb , w1 , &
+ flumas , flumab , viscf , viscb , &
+ dam , xam )
+
+
+!===============================================================================
+! 4. INITIALISATION DU FLUX DE MASSE
+!===============================================================================
+
+
+! PROJECTION AUX FACES DES TERMES SOURCES
+init = 1
+inc = 0
+iccocg = 1
+nswrgp = nswrgr(ipriph)
+imligp = imligr(ipriph)
+iwarnp = iwarni(ipriph)
+epsrgp = epsrgr(ipriph)
+climgp = climgr(ipriph)
+
+call projts &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfextx , dfexty , dfextz , &
+ coefb , &
+ flumas, flumab , &
+ viscf , viscb , &
+ w10 , w10 , w10 , &
+ rdevel , rtuser , ra )
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,flumas,flumab,w7)
+call prodsc(ncelet,ncel,isqrt,w7,w7,rnorm)
+
+
+!===============================================================================
+! 5. PREPARATION DU MULTIGRILLE ALGEBRIQUE
+!===============================================================================
+
+if (imgr(ipriph).gt.0) then
+
+! --- Creation de la hierarchie de maillages
+
+ CHAINE = 'PresHydr'
+ iwarnp = iwarni(ipriph)
+ iagmax = iagmx0(ipriph)
+ nagmax = nagmx0(ipriph)
+ npstmg = ncpmgr(ipriph)
+ lchain = 8
+
+ call clmlga &
+ !==========
+ ( chaine(1:8) , lchain , &
+ ncelet , ncel , nfac , &
+ isym , iagmax , nagmax , npstmg , iwarnp , &
+ ngrmax , ncegrm , &
+ dam , xam )
+
+endif
+
+!===============================================================================
+! 6. BOUCLES SUR LES NON ORTHOGONALITES (RESOLUTION)
+!===============================================================================
+
+! --- Nombre de sweeps
+nswmpr = nswrsm(ipriph)
+
+! --- Mise a zero des variables
+! RTP(.,IPR) sera l'increment de pression cumule
+! DRTP sera l'increment d'increment a chaque sweep
+! W7 sera la divergence du flux de masse predit
+do iel = 1,ncel
+ phydr(iel) = 0.d0
+ drtp(iel) = 0.d0
+ smbr(iel) = 0.d0
+enddo
+
+
+! --- Boucle de reconstruction : debut
+do isweep = 1, nswmpr
+
+! --- Mise a jour du second membre
+! (signe "-" a cause de celui qui est implicitement dans la matrice)
+ do iel = 1, ncel
+ smbr(iel) = - w7(iel) - smbr(iel)
+ enddo
+
+! --- Test de convergence du calcul
+
+ call prodsc(ncelet,ncel,isqrt,smbr,smbr,residu)
+ if (iwarni(ipriph).ge.2) then
+ CHAINE = 'PresHydr'
+ write(nfecra,1400)chaine(1:8),isweep,residu
+ endif
+
+!MO IL FAUDRA VERIFIER LA PERTINENCE DU TEST
+
+ if( residu .le. 10.d0*epsrsm(ipriph)*rnorm ) then
+! Si convergence, sortie
+
+ goto 101
+
+ endif
+
+! --- Resolution implicite sur l'increment d'increment DRTP
+ do iel = 1, ncel
+ drtp(iel) = 0.d0
+ enddo
+
+ CHAINE = 'PresHydr'
+ nitmap = nitmax(ipriph)
+ imgrp = imgr (ipriph)
+ ncymap = ncymax(ipriph)
+ nitmgp = nitmgf(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsilp = epsilo(ipriph)
+ iinvpe = 1
+
+ call invers &
+ !==========
+ ( chaine(1:8) , idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isym , ipol , ireslp , nitmap , imgrp , &
+ ncymap , nitmgp , &
+ iwarnp , nfecra , niterf , icycle , iinvpe , &
+ epsilp , rnorm , residu , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dam , xam , smbr , drtp , &
+ w3 , w4 , w5 , w6 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+ if( isweep.eq.nswmpr ) then
+! Mise a jour de l'increment de pression
+ do iel = 1, ncel
+ phydr(iel) = phydr(iel) + drtp(iel)
+ enddo
+
+
+ else
+
+! --- Si ce n'est pas le dernier sweep
+! Mise a jour de l'increment de pression et calcul direct de la
+! partie en gradient d'increment de pression du second membre
+! (avec reconstruction)
+
+ do iel = 1, ncel
+ phydr(iel) = phydr(iel) + drtp(iel)
+ enddo
+
+ iccocg = 1
+ init = 1
+ inc = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+ extrap = 0.d0
+ iphydp = 1
+
+ call itrgrp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfextx , dfexty , dfextz , &
+ phydr , &
+ coefa , coefb , &
+ viscf , viscb , &
+ w10 , w10 , w10 , &
+ smbr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+enddo
+! --- Boucle de reconstruction : fin
+
+if(iwarni(ipriph).ge.2) then
+ CHAINE = 'PresHydr'
+ write( nfecra,1600)chaine(1:8),nswmpr
+endif
+
+ 101 continue
+
+
+!===============================================================================
+! 7. SUPPRESSION DE LA HIERARCHIE DE MAILLAGES
+!===============================================================================
+
+if (imgr(ipriph).gt.0) then
+ CHAINE = 'PresHydr'
+ lchain = 8
+ call dsmlga(chaine(1:8), lchain)
+ !==========
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1400 format(1X,A8,' : SWEEP = ',I5,' NORME SECOND MEMBRE = ',E14.6)
+ 1600 format( &
+'@ ',/,&
+'@ @@ ATTENTION : ',A8 ,' ETAPE DE PRESSION HYDROSTATIQUE ',/,&
+'@ ========= ',/,&
+'@ Nombre d''iterations maximal ',I10 ,' atteint ',/,&
+'@ ' )
+
+#else
+
+ 1400 format(1X,A8,' : SWEEP = ',I5,' RIGHT HAND SIDE NORM = ',E14.6)
+ 1600 format( &
+'@ ',/,&
+'@ @@ WARNING: ',A8 ,' HYDROSTATIC PRESSURE STEP ',/,&
+'@ ======== ',/,&
+'@ Maximum number of iterations ',I10 ,' reached ',/,&
+'@ ' )
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/calmom.f90 b/src/base/calmom.f90
new file mode 100644
index 0000000..d08860d
--- /dev/null
+++ b/src/base/calmom.f90
@@ -0,0 +1,180 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine calmom &
+!================
+
+ ( idbia0 , idbra0 , ncel , ncelet , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ rtp , dt , propce , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DE LA MOYENNE TEMPORELLE DE CORRELATIONS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre de cellules !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rtp ! tr ! <-- ! tableaux des variables au pdt courant !
+! (ncelet,* ) ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "numvar.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , ncel , ncelet
+integer nideve , nrdeve , nituse , nrtuse
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+double precision rtp(ncelet,*) , dt(ncelet), propce(ncelet,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ii, iel, imom, icmom, idtcm, itravm, ifinra
+integer jmom, icumut
+
+!===============================================================================
+
+! PHASE DE CUMUL DES TERMES
+! =========================
+
+! Pour un tableau, on reserve la memoire ici.
+
+itravm = idbra0
+ifinra = itravm + ncelet
+CALL RASIZE('CALMOM',IFINRA)
+
+! Boucle et test sur les moments a calculer
+do imom = 1, nbmomt
+ if(ntcabs.ge.ntdmom(imom)) then
+
+! Position dans PROPCE du tableau de cumul des moments
+ icmom = ipproc(icmome(imom))
+
+! Tableau de travail pour recueillir la correlation par cellule
+ do iel = 1, ncel
+ ra(itravm+iel-1) = 1.d0
+ enddo
+
+! Calcul de la correlation (on suppose qu'il y a au moins une variable)
+ do ii = 1, idgmom(imom)
+
+! Si la variable est dans RTP
+ if(idfmom(ii,imom).gt.0) then
+ do iel = 1, ncel
+ ra(itravm+iel-1) = &
+ ra(itravm+iel-1) * rtp(iel,idfmom(ii,imom))
+ enddo
+! Si la variable est dans PROPCE
+ elseif(idfmom(ii,imom).lt.0) then
+ do iel = 1, ncel
+ ra(itravm+iel-1) = &
+ ra(itravm+iel-1) * propce(iel,ipproc(-idfmom(ii,imom)))
+ enddo
+ endif
+
+ enddo
+
+! Incrementation du tableau de cumul des correlations
+ do iel = 1, ncel
+ propce(iel,icmom) = &
+ propce(iel,icmom) + dt(iel)*ra(itravm+iel-1)
+ enddo
+
+! Incrementation du tableau de cumul du temps (ncel ou constante)
+
+! Si plusieurs moyennes partagent le meme cumul temporel,
+! il ne faut incrementer que pour une seule (la premiere)
+
+! On decide si on doit incrementer
+ icumut = 1
+ if (imom.gt.1) then
+ do jmom = 1, imom-1
+ if(idtmom(jmom).eq.idtmom(imom)) then
+ icumut = 0
+ endif
+ enddo
+ endif
+
+! On incremente
+ if(icumut.eq.1) then
+ if(idtmom(imom).gt.0) then
+ idtcm = ipproc(icdtmo(idtmom(imom)))
+ do iel = 1, ncel
+ propce(iel,idtcm) = propce(iel,idtcm) + dt(iel)
+ enddo
+ elseif(idtmom(imom).lt.0) then
+ idtcm = -idtmom(imom)
+ dtcmom(idtcm) = dtcmom(idtcm) + dt(1)
+ endif
+ endif
+
+ endif
+enddo
+
+return
+
+end
diff --git a/src/base/caltri.f90 b/src/base/caltri.f90
new file mode 100644
index 0000000..55f6929
--- /dev/null
+++ b/src/base/caltri.f90
@@ -0,0 +1,1862 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine caltri &
+!================
+
+ ( iverif , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! GESTION DU PROGRAMME (LECTURE, RESOLUTION, ECRITURE)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iverif ! e ! <-- ! indicateur des tests elementaires !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! (ndim,nnod) ! ! ! !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "pointe.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "coincl.h"
+include "cpincl.h"
+include "lagpar.h"
+include "lagdim.h"
+include "lagran.h"
+include "vortex.h"
+include "ihmpre.h"
+include "matiss.h"
+include "radiat.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nideve , nrdeve , nituse , nrtuse
+
+integer iverif
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ipropc , ipropf , ipropb
+integer icoefa , icoefb
+integer irtp , irtpa
+integer idt
+integer iisstd , ifrcx
+
+integer idebia , idebra
+integer ifinia , ifinra , idbia1 , idbra1, idbia2
+integer iditia, iditra
+integer ifnia1 , ifnra1 , ifnia2 , ifnia3, ifnra2
+integer jcelbr
+integer iiii
+
+integer modhis, iappel, modntl, iisuit, iwarn0
+integer ntsdef, nthdef, ntcrel, ntcam1
+integer iphas , ivar
+
+integer iicoce , iityce
+integer iiitep , iitepa , istatc , istatf
+integer iettp , iettpa , iauxl , itslag , istatv
+integer itaup , iitlag , ipiil , iindep , iibord
+integer ivagau , itsuf , itsup , ibx , iauxl2
+integer ibrgau , itebru
+integer igradp , igradv , icroul
+integer itepct , itsfex , itsvar
+integer icpgd1 , icpgd2 , icpght
+integer ilagia , ilagra , iiwork
+integer iw1 , iw2 , iw3
+integer inod , idim
+integer itrale , indact , indwri
+integer maxelt , ils
+
+double precision titer1, titer2
+double precision tecrf1, tecrf2
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! Initialisation de la premiere case libre des tableaux IA et RA
+idebia = 1
+idebra = 1
+
+! Initialisation du generateur de nombres aleatoires
+! (pas toujours necessaire mais ne coute rien)
+call zufalli(0)
+!===========
+
+!---> MISE A ZERO DES TABLEAUX UTILISATEUR ET DEVELOPPEUR
+
+if(nituse.gt.0) then
+ do iiii = 1, nituse
+ ituser(iiii) = 0
+ enddo
+endif
+if(nrtuse.gt.0) then
+ do iiii = 1, nrtuse
+ rtuser(iiii) = 0.d0
+ enddo
+endif
+
+if(nideve.gt.0) then
+ do iiii = 1, nideve
+ idevel(iiii) = 0
+ enddo
+endif
+if(nrdeve.gt.0) then
+ do iiii = 1, nrdeve
+ rdevel(iiii) = 0.d0
+ enddo
+endif
+
+!---> Test d'arret mis a 1 si le rayonnement P-1 voit trop de cellules
+! a epaisseur optique superieure a l'unite (voir ppcabs)
+istpp1 = 0
+
+!---> Nombre max d'elements pour le selector
+maxelt = max(ncelet,nfac,nfabor)
+
+!===============================================================================
+! 2. GEOMETRIE
+!===============================================================================
+
+!---> CALCULS GEOMETRIQUES
+
+! (MEMCLG remplit directement pointe.h)
+call memclg &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifinia , ifinra )
+
+!---> La memoire sera conservee jusqu'a la fin.
+idebia = ifinia
+idebra = ifinra
+
+
+call cregeo &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ rdevel , rtuser , ra )
+
+
+
+!---> CALCUL DE JCELBR (=NCELBR) et REMPLISSAGE DE IA(IICELB)
+! directement en passant par le pointeur et IA.
+! (c'est pas bien, mais c'est mieux qu'avant)
+
+iicelb = idebia
+call memcbr &
+!==========
+ ( iicelb , ncelet , ncel , nfabor , &
+ jcelbr , ifinia , &
+ ifabor , &
+ ia )
+
+!---> La memoire sera conservee jusqu'a la fin.
+idebia = ifinia
+idebra = ifinra
+
+!===============================================================================
+! 3. FIN INITIALISATION DES COMMONS
+!===============================================================================
+
+call initi2 &
+!==========
+ ( idebia , idebra , &
+ jcelbr , &
+ ia , ra )
+
+if (iilagr.gt.0) then
+
+!--> Calcul de LNDNOD (lagran.h)
+
+! Tableau NCELET de travail entier
+ iiwork = idebia
+ ifinia = iiwork + ncelet
+ call iasize ('lagini',ifinia)
+
+ ifinra = idebra
+
+ call lagini &
+ !==========
+ ( ifinia , ifinra , &
+ ncelet , ncel , nfac , nfabor , &
+ lndnod , &
+ ifacel , ifabor , &
+ ia(iiwork) , &
+ ia , ra )
+
+endif
+
+
+!===============================================================================
+! 4. AUTRES TABLEAUX
+!===============================================================================
+
+!---> GESTION MEMOIRE
+
+call memtri &
+!==========
+ ( idebia , idebra , iverif , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncofab , nproce , nprofa , nprofb , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iisstd , ifrcx , &
+ idt , irtp , irtpa , ipropc , ipropf , ipropb , &
+ icoefa , icoefb , &
+ ifinia , ifinra )
+
+! Reservations complementaires pour Matisse
+! On remplit un pointeur dans matiss.h, pour eviter de charger
+! les arguments par des tableaux specifiques a Matisse.
+
+if (imatis.eq.1) then
+
+ idbia1 = ifinia
+ idbra1 = ifinra
+ call memmat &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncofab , nproce , nprofa , nprofb , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifinia , ifinra )
+
+endif
+
+! Reservations memoire pour les tableaux complementaires
+! necesaires pour les physiques particulieres
+
+idbia1 = ifinia
+idbra1 = ifinra
+
+call memppt &
+!==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nvar , nscal , nphas , &
+ ifinia , ifinra )
+
+
+!===============================================================================
+! 4.1 RESERVATION DE LA MEMOIRE POUR LE RAYONNEMENT SEMI-TRANSPARENT
+!===============================================================================
+
+if (iirayo.gt.0) then
+
+ idbia1 = ifinia
+ idbra1 = ifinra
+
+ call memra1 &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nvar , nscal , nphas , &
+ ifinia , ifinra )
+
+endif
+
+!===============================================================================
+! 4.2 RESERVATION DE LA MEMOIRE POUR LE LAGRANGIEN
+!===============================================================================
+
+! Si on ne fait pas de Lagrangien, on initialise
+! quand meme les "pointeurs".
+
+idbia1 = ifinia
+idbra1 = ifinra
+
+call memla1 &
+!==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ lndnod , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ iiitep , iicoce , iityce , &
+ iettp , iettpa , iitepa , istatc , istatv, itslag , istatf , &
+ ifinia , ifinra )
+
+!===============================================================================
+! 4.3 TESTS ELEMENTAIRES : APPEL A TESTEL.F
+!===============================================================================
+
+if (iverif.eq.1) then
+
+ write(nfecra, 1000)
+
+ call testel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , nvar , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , ra(irtp) , &
+ ra(icoefa) , ra(icoefb) , &
+ rdevel , rtuser , ra )
+
+ goto 200
+
+endif
+
+!===============================================================================
+! 5. INITIALISATIONS PAR DEFAUT
+!===============================================================================
+
+call iniva0 &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncofab , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtp) , ra(ipropc) , ra(ipropf) , ra(ipropb),&
+ ra(icoefa) , ra(icoefb) , ra(ifrcx ) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 6. CALCUL SUITE EVENTUEL
+!===============================================================================
+
+if (isuite.eq.1) then
+
+ call lecamo &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nnod , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ ra(idt) , ra(irtp) , ra(ipropc) , ra(ipropf) , ra(ipropb),&
+ ra(icoefa) , ra(icoefb) , ra(ifrcx ) , &
+ rdevel , rtuser , ra )
+
+! En ALE, il faut recalculer les parametres geometriques
+ if (iale.eq.1) then
+
+ do inod = 1, nnod
+ do idim = 1, ndim
+ xyznod(idim,inod) = ra(ixyzn0+(inod-1)*ndim+idim-1) &
+ + ra(idepal+(idim-1)*nnod+inod-1)
+ enddo
+ enddo
+
+ call algrma
+ !==========
+ call calgeo &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ volmin , volmax , voltot , &
+ rdevel , rtuser , ra )
+
+ endif
+
+endif
+
+!===============================================================================
+! 7. INITIALISATIONS (Utilisateur et complementaires)
+! RTP DT ROM ROMB VISCL VISCT VISCLS
+! (TPUCOU en PERIODICITE)
+!===============================================================================
+
+call inivar &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncofab , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtp) , ra(ipropc) , ra(ipropf) , ra(ipropb),&
+ ra(icoefa) , ra(icoefb) , ra(ifrcx ) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 8.1 MODULE DE RAYONNEMENT : CALCUL SUITE EVENTUEL
+!===============================================================================
+
+if (iirayo.gt.0 .and. isuird.eq.1) then
+
+ call raylec &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ ra(ipropc) , ra(ipropb) , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 8.2 INITIALISATIONS DES PARTICULES POUR LE LAGRANGIEN
+!===============================================================================
+
+if (iilagr.gt.0) then
+
+ call laglec &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ ia(iiitep) , ia , &
+ ra(irtpa) , ra(ipropc) , &
+ ra(iettp) , ra(iitepa) , ra(istatc) , ra(istatv) , &
+ ra(istatf) , ra(itslag) , ra )
+
+endif
+
+!===============================================================================
+! 8.3 INITIALISATIONS POUR LE MODULE THERMIQUE 1D EN PAROI
+!===============================================================================
+! On suppose que toutes les phases voient la meme temperature de paroi
+! USPT1D a un fonctionnement similaire a USKPDC et USTSMA, mais comme
+! on ecrit des infos dans un fichier suite, on a besoin d'une partie de
+! la memoire meme apres la boucle en temps -> IFPT1D et TPPT1D
+! (IFNIA1 et IFNRA1)
+
+idbia1 = ifinia
+idbra1 = ifinra
+
+ils = idbia1
+ifnia2 = ils + maxelt
+call iasize('caltri',ifnia2)
+
+iphas = 1
+
+! Premier appel : definition de NFPT1D et ISUIT1
+iappel = 1
+call uspt1d &
+!==========
+ ( ifnia2 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nfpt1d , iphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(idbia1) , ia(idbia1) , ia(idbia1) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idbra1) , ra(idbra1) , ra(idbra1) , &
+ ra(idbra1) , ra(idbra1) , ra(idbra1) , &
+ ra(idbra1) , ra(idbra1) , ra(idbra1) , &
+ ra(idt) , ra(irtpa) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ rdevel , rtuser , ra )
+
+iappel = 1
+call vert1d &
+!==========
+ (idbia1 , idbra1 , &
+ nfabor , nfpt1d , iappel , &
+ ia(idbia1) , ia(idbia1) , ia(idbia1) , ia , &
+ ra(idbra1) , ra(idbra1) , &
+ ra(idbra1) , ra(idbra1) , ra(idbra1) , ra )
+
+call memt1d &
+!==========
+ ( idbia1 , idbra1 , nfabor , ifnia1 , ifnra1 ,ifnia2 , ifnra2 , &
+ ifinia , ifinra , ia , ra )
+
+! On appelle uspt1d lorqu'il y a sur un processeur au moins des faces de
+! bord avec module thermique 1D.
+
+if (nfpt1t.gt.0) then
+! Deuxieme appel : remplissage des tableaux de definition de la geometrie
+! et de l'initialisation (IFPT1D,NPPT1D,EPPT1D,RGPT1D,TPPT1D)
+ ils = ifinia
+ ifnia3 = ils + maxelt
+ call iasize('caltri',ifnia3)
+
+ iappel = 2
+ call uspt1d &
+ !===========
+ ( ifnia3 , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nfpt1d , iphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iifpt1) , ia(inppt1) , ia(iiclt1) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(itppt1) , ra(irgpt1) , ra(ieppt1) , &
+ ra(itept1) , ra(ihept1) , ra(ifept1) , &
+ ra(ixlmt1) , ra(ircpt1) , ra(idtpt1) , &
+ ra(idt) , ra(irtpa) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ rdevel , rtuser , ra )
+
+ iappel = 2
+ call vert1d &
+ !==========
+ (ifinia , ifinra , &
+ nfabor , nfpt1d , iappel , &
+ ia(iifpt1) , ia(inppt1) , ia(iiclt1) , ia , &
+ ra(irgpt1) , ra(ieppt1) , &
+ ra(ixlmt1) , ra(ircpt1) , ra(idtpt1) , ra )
+
+! Calcul du max des NPPT1D (pour les fichiers suite)
+ nmxt1d = 0
+ do iiii = 1, nfpt1d
+ nmxt1d = max(ia(inppt1+iiii-1),nmxt1d)
+ enddo
+ if (irangp.ge.0) call parcmx(nmxt1d)
+ !==========
+
+ if (isuit1.eq.1) then
+
+ call lect1d &
+ !==========
+ ( ficmt1 , len(ficmt1), nfpt1d , nfpt1t , &
+ nmxt1d , nfabor , ia(inppt1) , ia(iifpt1) , ra(ieppt1),&
+ ra(irgpt1) , ra(itppt1))
+
+ else
+! Creation du maillage, initialisation de la temperature.
+
+ call mait1d &
+ !==========
+ ( nfpt1d, ia(inppt1), ra(ieppt1), ra(irgpt1),ra(itppt1))
+
+ endif
+
+endif
+! Les infos sur l'epaisseur de la paroi, le nombre de points de
+! discretisation et la raison geometrique ont ete transmises a
+! la structure C. Elles sont maintenant inutiles dans le Fortran.
+! -> on libere la memoire.
+ifinia = ifnia2
+ifinra = ifnra2
+
+!===============================================================================
+! 9. TABLEAUX POUR BLC EN TEMPS MAIS A OUBLIER ENSUITE
+!===============================================================================
+
+! En fin de bloc en temps on doit retrouver IFNIA1 et IFNRA1
+iditia = ifnia1
+iditra = ifnra1
+
+idbia1 = ifinia
+idbra1 = ifinra
+
+
+do iphas = 1, nphas
+
+ iappel = 1
+
+ if (imatis.eq.1) then
+
+! Noter que uskpdc n'est pas permis avec Matisse
+! (si necessaire, on pourrait regrouper toutes les pertes de
+! charge de Matisse dans un unique sous-programme et reactiver
+! uskpdc)
+
+ call mtkpdc &
+ !===========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdc(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(idbia1), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , ra(idbra1) , &
+ rdevel , rtuser , ra )
+
+ else
+
+ ils = idbia1
+ idbia2 = ils + maxelt
+ call iasize('caltri',idbia2)
+
+ call uskpdc &
+ !===========
+ ( idbia2 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdc(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(idbia1), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , ra(idbra1) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+enddo
+
+call mempdc &
+!==========
+ ( idbia1, idbra1, ncelet, ncel, nphas, ndim, ifinia, ifinra)
+
+
+! On appelle uskpdc lorqu'il y a sur un processeur au moins des cellules
+! avec terme source de masse.
+! On ne fait que remplir le tableau d'indirection des cellules
+! On appelle cependant uskpdc avec tous les processeurs, au cas ou
+! l'utilisateur aurait mis en oeuvre des operations globales.
+
+do iphas = 1, nphas
+
+ if(ncpdct(iphas).gt.0) then
+
+ iappel = 2
+
+ if (imatis.eq.1) then
+
+ call mtkpdc &
+ !===========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdc(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , ra(ickupd(iphas)) , &
+ rdevel , rtuser , ra )
+
+ else
+
+ ils = ifinia
+ ifnia2 = ils + maxelt
+ call iasize('caltri',ifnia2)
+
+ call uskpdc &
+ !===========
+ ( ifnia2 , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdc(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , ra(ickupd(iphas)) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+enddo
+
+idbia1 = ifinia
+idbra1 = ifinra
+
+ils = idbia1
+idbia2 = ils + maxelt
+call iasize('caltri',idbia2)
+
+do iphas = 1, nphas
+
+ iappel = 1
+ call ustsma &
+ !===========
+ ( idbia2 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdc(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncetsm(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , &
+ ia(idbia1) , ia(idbia1), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , ra(ickupd(iphas)) , ra(idbra1),&
+ rdevel , rtuser , ra )
+
+enddo
+
+call memtsm &
+!==========
+ ( idbia1 , idbra1 , &
+ ncelet , ncel , nvar , nphas , &
+ ifinia , ifinra )
+
+! On appelle ustsma lorqu'il y a sur un processeur au moins des cellules
+! avec terme source de masse.
+! On ne fait que remplir le tableau d'indirection des cellules
+! On appelle cependant ustsma avec tous les processeurs, au cas ou
+! l'utilisateur aurait mis en oeuvre des operations globales.
+
+do iphas = 1, nphas
+
+ if(nctsmt(iphas).gt.0) then
+
+ ils = ifinia
+ ifnia2 = ils + maxelt
+ call iasize('caltri',ifnia2)
+
+ iappel = 2
+ call ustsma &
+ !===========
+ ( ifnia2 , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdc(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncetsm(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , &
+ ia(iicesm(iphas)) , ia(iitpsm(iphas)), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , ra(ickupd(iphas)), ra(ismace(iphas)),&
+ rdevel , rtuser , ra )
+
+ endif
+
+enddo
+
+
+! -- Methode des vortex pour la L.E.S.
+! (dans verini on s'est deja assure que ITYTUR=4 si IVRTEX=1)
+
+if (ivrtex.eq.1) then
+
+ idbia1 = ifinia
+ idbra1 = ifinra
+
+ iphas = 1
+ iappel = 1
+
+! On met une valeur factice a certains parametres non utilise en IAPPEL=1
+
+ call memvor &
+ !==========
+ ( idbia1 , idbra1 , iappel , nfabor , ifinia , ifinra )
+
+ call vorin0( nfabor , ia(iirepv) )
+ !==========
+
+ ils = ifinia
+ ifnia2 = ils + maxelt
+ call iasize('caltri',ifnia2)
+
+ call usvort &
+ !==========
+ ( ifnia2 , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iirepv) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ rdevel , rtuser , ra )
+
+ call vorver ( nfabor , ia(iirepv) , iappel )
+ !==========
+
+ idbia1 = ifinia
+ idbra1 = ifinra
+
+! Attention, vorpre reserve de la memoire qu'il faut garder ensuite
+! (-> on utilise IFINIA/IFINRA ensuite)
+
+ call vorpre &
+ !==========
+ ( idbia1 , idbra1 , ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iirepv), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ rdevel , rtuser , ra )
+
+endif
+
+! -- Fin de zone Methode des vortex pour la L.E.S.
+
+! -- Structures mobiles en ALE
+
+if (iale.eq.1) then
+
+ idbia1 = ifinia
+ idbra1 = ifinra
+
+! Attention, strini reserve de la memoire qu'il faut garder ensuite
+! (-> on utilise IFINIA/IFINRA ensuite)
+ call strini &
+ !==========
+ ( idbia1 , idbra1 , ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , ra(idt), &
+ rdevel , rtuser , ra )
+
+endif
+
+! -- Fin de zone Structures mobiles en ALE
+
+! -- Couplage Code_Saturne/Code_Saturne
+
+call cscini &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 10. DEBUT DE LA BOUCLE EN TEMPS
+!===============================================================================
+
+write(nfecra,2000)
+
+ntcabs = ntpabs
+ttcabs = ttpabs
+
+iwarn0 = 1
+do ivar = 1, nvar
+ iwarn0 = max(iwarn0,iwarni(ivar))
+enddo
+
+if(iwarn0.gt.0) then
+ write(nfecra,3000)
+endif
+
+if(inpdt0.eq.1) then
+ ntmabs = ntcabs
+endif
+
+! Nb d'iter ALE (nb relatif a l'execution en cours)
+! Si ITALIN=1, on fait une iteration d'initialisation
+! (si ITALIN=-999, c'est qu'on a fait une suite de calculs
+! sans relire lecamx -> comme si on faisait une suite
+! d'un calcul sans ALE)
+if (italin.eq.-999) italin = 1
+itrale = 1
+if (italin.eq.1) then
+ itrale = 0
+ write(nfecra,3002) ttcabs
+endif
+
+! En cas de couplage avec SYRTHES, on lit des maintenant l'entete
+! du premier message, au cas ou il s'agisse d'un message de
+! terminaison.
+
+if (itrale.gt.0) then
+
+ ntcam1 = ntcabs - 1
+
+ call tstsyr (ntmabs, ntcam1)
+ !==========
+
+ if (ntmabs .eq. ntcam1) then
+ call csexit (0)
+ !==========
+ endif
+
+endif
+
+ 100 continue
+
+if(inpdt0.eq.0 .and. itrale.gt.0) then
+ ntcabs = ntcabs + 1
+ if(idtvar.eq.0.or.idtvar.eq.1) then
+ ttcabs = ttcabs + ra(idt)
+ else
+ ttcabs = ttcabs + dtref
+ endif
+ if(iwarn0.gt.0) then
+ write(nfecra,3001) ttcabs,ntcabs
+ endif
+endif
+
+
+!===============================================================================
+! 11. AVANCEE EN TEMPS
+!===============================================================================
+
+
+! On teste la presence de ficstp pour modifier NTMABS le cas echeant
+call modpar(ntcabs,ntmabs)
+!==========
+
+call dmtmps(titer1)
+!==========
+
+! Synchronisation Syrthes 3, si ITRALE>0
+if (itrale.gt.0) then
+ call itdsyr(ntcabs,ntmabs)
+ !==========
+endif
+
+call tridim &
+!==========
+ ( ifinia , ifinra , itrale , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iisstd), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(itslag) , ra(icoefa) , ra(icoefb) , &
+ ra(ifrcx) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 12. CALCUL DES MOYENNES TEMPORELLES (ACCUMULATION)
+!===============================================================================
+
+
+if(inpdt0.eq.0 .and. itrale.gt.0) then
+call calmom &
+!==========
+ ( ifinia , ifinra , ncel , ncelet , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ ra(irtp ) , ra(idt ) , ra(ipropc) , &
+ rdevel , rtuser , ra )
+endif
+
+
+!===============================================================================
+! 13. APPEL DU MODULE LAGRANGIEN
+!===============================================================================
+
+if (iilagr.gt.0 .and. inpdt0.eq.0 .and. itrale.gt.0) then
+
+ call memla2 &
+ !==========
+ ( ifinia , ifinra , &
+ nfabor , ncelet , nfac , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ iindep , iibord , iettpa , iauxl , iauxl2 , &
+ itaup , iitlag , ipiil , &
+ ivagau , itsuf , itsup , ibx , &
+ igradp , igradv , icroul , &
+ itepct , itsfex , itsvar , &
+ icpgd1 , icpgd2 , icpght , &
+ ibrgau , itebru , &
+ iw1 , iw2 , iw3 , &
+ ilagia , ilagra )
+
+ call lagune &
+ !==========
+ ( ilagia , ilagra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicoce) , ia(iityce) , ia(iifrla) , ia(iiitep) , &
+ ia(iindep) , ia(iibord) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ ra(iettp) , ra(iettpa) , ra(iitepa) , ra(istatc) , ra(istatv),&
+ ra(itslag), &
+ ra(istatf) , ra(itaup) , ra(iitlag) , ra(ipiil) , ra(ibx ) ,&
+ ra(ivagau) , ra(itsuf ) , ra(itsup ) , ra(itsvar) , &
+ ra(itepct) , ra(itsfex) , &
+ ra(icpgd1) , ra(icpgd2) , ra(icpght) , &
+ ra(igradp) , ra(igradv) , ra(icroul) , &
+ ra(ibrgau) , ra(itebru) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iauxl) , ra(iauxl2),&
+ rdevel , rtuser , ra )
+
+!--> Ici on libere la memoire reserve par MEMLA2
+! (i.e. on oublie ILAGIA et ILAGRA)
+
+endif
+
+!===============================================================================
+! 14. BRANCHEMENT UTILISATEUR POUR MODIF DES VARIABLES EVENTUELLES
+!===============================================================================
+
+! Appel pour Matisse d'une routine de bilans, d'impression, ...
+if (imatis.eq.1 .and. itrale.gt.0) then
+
+ call mtproj &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvep , nivep , ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iiitep), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ ra(iettp) , ra(iettpa) , ra(iitepa) , ra(istatc) , ra(itslag),&
+ ra(istatf) , &
+ rdevel , rtuser , ra )
+
+endif
+
+if (itrale.gt.0) then
+
+! Sortie postprocessing de profils 1D
+
+ if (iihmpr.eq.1) then
+ call uiprof &
+ !==========
+ ( ncelet , ncel, &
+ ntmabs, ntcabs, ttcabs, &
+ xyzcen, ra(irtp), ra(ipropc) )
+ endif
+
+ ils = ifinia
+ ifnia2 = ils + maxelt
+ call iasize('caltri',ifnia2)
+
+ call usproj &
+ !==========
+ ( ifnia2 , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvep , nivep , ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iiitep), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ ra(iettp) , ra(iettpa) , ra(iitepa) , ra(istatc) , ra(istatv),&
+ ra(itslag) , ra(istatf) , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 15. MISE A JOUR DU MAILLAGE (ALE)
+!===============================================================================
+
+if (iale.eq.1 .and. inpdt0.eq.0) then
+
+ if (itrale.eq.0 .or. itrale.gt.nalinf) then
+
+ call alemaj &
+ !==========
+ ( ifinia , ifinra , itrale , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iimpal) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ ra(idepal) , ra(ixyzn0) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+endif
+
+!===============================================================================
+! 16. TEST D'ARRET PAR MANQUE DE TEMPS
+!===============================================================================
+
+call armtps(ntcabs,ntmabs)
+!==========
+
+!===============================================================================
+! 17. TEST D'ARRET ISSU DU MODULE DE RAYONNEMENT P-1
+!===============================================================================
+if (istpp1.eq.1) then
+ ntmabs = ntcabs
+endif
+
+!===============================================================================
+! 18. TEST D'ARRET PAR DEMANDE DE SYRTHES
+!===============================================================================
+
+! En cas de couplage, on lit des maintenant l'entete du premier
+! message du pas de temps suivant, au cas ou il s'agisse d'un
+! message de terminaison (pas de test sur ITRALE ici, car
+! il serait sur ITRALE + 1, toujours > 0).
+
+call tstsyr (ntmabs, ntcabs)
+!==========
+
+!===============================================================================
+! 19. SORTIE EVENTUELLE DU FICHIER SUITE
+! (SAUF SI ON EST AU DERNIER PAS DE TEMPS :
+! ON LE FERA APRES)
+!===============================================================================
+
+iisuit = 0
+if(ntcabs.lt.ntmabs) then
+ if(ntsuit.eq.0) then
+ ntsdef = max((ntmabs-ntpabs)/4,10)
+ if(ntsdef.gt.0) then
+ if(mod(ntcabs-ntpabs,ntsdef).eq.0) then
+ iisuit = 1
+ endif
+ endif
+ elseif(ntsuit.gt.0) then
+ if(mod(ntcabs,ntsuit).eq.0) then
+ iisuit = 1
+ endif
+ endif
+ if (itrale.eq.0) iisuit = 0
+else if(ntcabs.eq.ntmabs) then
+ iisuit = 1
+ if(iwarn0.gt.0) then
+ write(nfecra,4000)
+ endif
+endif
+
+if (iisuit.eq.1) then
+
+ call dmtmps(tecrf1)
+ !==========
+
+ call ecrava &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nnod , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo ,&
+ ra(idt) , ra(irtp) , ra(ipropc) , ra(ipropf) , ra(ipropb),&
+ ra(icoefa) , ra(icoefb) , ra(ifrcx) , &
+ rdevel , rtuser , ra )
+
+ if (nfpt1t.gt.0) then
+ call ecrt1d &
+ !==========
+ ( ficvt1 , len(ficvt1), nfpt1d , nmxt1d , &
+ nfabor , ra(itppt1) , ia(iifpt1))
+ endif
+
+ if (ippmod(iaeros).ge.0) then
+ call ecrctw ( ficvct , len(ficvct) )
+ !==========
+ endif
+
+ if (iilagr.gt.0) then
+
+ call lagout &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicoce) , ia(iityce) , ia(iiitep) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ ra(iettp) , ra(iitepa) , ra(istatf) , &
+ ra(istatc) , ra(istatv) , ra(itslag) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ if (iirayo.gt.0) then
+ call rayout &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ rdevel , rtuser , ra )
+ endif
+
+ call dmtmps(tecrf2)
+ !==========
+
+ if(iwarn0.gt.0) then
+ write(nfecra,3020)ntcabs,ttcabs, tecrf2-tecrf1
+ endif
+
+endif ! iisuit = 1
+
+!===============================================================================
+! 20. TEST POUR SAVOIR SI ON SORT UN FICHIER POST OU NON
+!===============================================================================
+
+call usnpst &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , ra(istatc) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 21. SORTIE DES FICHIERS POST STANDARDS
+!===============================================================================
+
+! Si ITRALE=0 on desactive tous les writers (car la geometrie n'a pas ete
+! ecrite)
+if (itrale.eq.0) then
+ indwri = 0
+ indact = 0
+ call pstact(indwri, indact)
+ !==========
+endif
+
+call pstvar &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ntcabs , ncelet , ncel , nfac , nfabor , &
+ nfml , nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ ttcabs , xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ ra(istatc) , ra(istatv) , ra(istatf) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 22. HISTORIQUES
+!===============================================================================
+
+! ON STOCKE SUR TMP SI ON A DECIDE DE LE FAIRE ET QUE C'EST LE MOMENT
+! ON SAUVE SI ON A DECIDE DE LE FAIRE, QUE C'EST LE MOMENT ET
+! QUE CE N'EST PAS LE DERNIER PAS DE TEMPS
+
+if(nthist.gt.0 .and. itrale.gt.0) then
+ if(mod(ntcabs,nthist).eq.0) then
+ modhis = 0
+ if(nthsav.gt.0) then
+ if(mod(ntcabs,nthsav).lt.nthist ) modhis = 1
+ elseif(nthsav.eq.0) then
+ ntcrel = ntcabs-ntpabs
+ nthdef = (ntmabs-ntpabs)/4
+ if( (ntcrel-10).ge.0 .and. (ntcrel-10).lt.nthist) then
+ modhis = 1
+ elseif(nthdef.gt.0) then
+ if(mod(ntcrel,nthdef).lt.nthist) then
+ modhis = 1
+ endif
+ endif
+ endif
+ if (ntcabs.eq.ntmabs) modhis=0
+
+ call ecrhis &
+ !==========
+ (ifinia , ifinra , ndim , ncelet , ncel, &
+ nideve , nrdeve , nituse , nrtuse , &
+ modhis , &
+ idevel , ituser , ia , &
+ xyzcen , &
+ rdevel , rtuser , ra )
+
+ if (iilagr.gt.0) then
+ call laghis &
+ !==========
+ (ifinia , ifinra , ndim , ncelet , ncel, &
+ nideve , nrdeve , nituse , nrtuse , &
+ modhis , nvlsta , &
+ idevel , ituser , ia , &
+ xyzcen , volume , &
+ ra(istatc) , ra(istatv) , &
+ rdevel , rtuser , ra )
+ endif
+
+ if (ihistr.eq.1) then
+ call strhis &
+ !==========
+ (ifinia , ifinra , ncelet , ncel, &
+ nideve , nrdeve , nituse , nrtuse , &
+ modhis , &
+ idevel , ituser , ia , &
+ rdevel , rtuser , ra )
+ endif
+
+ endif
+endif
+
+call ushist &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 23. ECRITURE LISTING TOUTES LES NTLIST ITERATIONS
+!===============================================================================
+
+if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+else
+ modntl = 1
+endif
+if(modntl.eq.0) then
+ call ecrlis &
+ !==========
+ ( ifinia , ifinra , &
+ nvar , nphas , ndim , ncelet , ncel , &
+ nideve , nrdeve , nituse , nrtuse , irtp , &
+ idevel , ituser , ia , &
+ ra(irtp ) , ra(irtpa ) , ra(idt ) , volume , xyzcen, &
+ rdevel , rtuser , ra )
+
+ if (iilagr.gt.0) then
+
+ call laglis &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iiitep), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(idt) , ra(irtpa) , ra(irtp) , &
+ ra(ipropc) , ra(ipropf) , ra(ipropb) , &
+ ra(icoefa) , ra(icoefb) , &
+ ra(iettp) , ra(iitepa) , ra(istatc) , ra(istatv) , &
+ ra(itslag) , ra(istatf), &
+ rdevel , rtuser , ra )
+
+ endif
+
+endif
+
+call dmtmps(titer2)
+!==========
+
+if(iwarn0.gt.0) then
+ if (itrale.gt.0) then
+ write(nfecra,3010)ntcabs,titer2-titer1
+ else
+ write(nfecra,3012)titer2-titer1
+ endif
+endif
+
+
+!===============================================================================
+! 24. FIN DE LA BOUCLE EN TEMPS
+!===============================================================================
+
+itrale = itrale + 1
+
+if(ntcabs.lt.ntmabs) goto 100
+
+
+! LIBERATION DES TABLEAUX INTERMEDIAIRES (PDC+TSM)
+
+ifinia = iditia
+ifinra = iditra
+
+
+!===============================================================================
+! 25. FINALISATION HISTORIQUES
+!===============================================================================
+
+call dmtmps(tecrf1)
+!==========
+
+! ICI ON SAUVE LES HISTORIQUES (SI ON EN A STOCKE)
+
+modhis = 2
+call ecrhis &
+!==========
+( ifinia , ifinra , ndim , ncelet , ncel, &
+ nideve , nrdeve , nituse , nrtuse , &
+ modhis , &
+ idevel , ituser , ia , &
+ xyzcen , &
+ rdevel , rtuser , ra )
+
+if (iilagr.gt.0) then
+ call laghis &
+ !==========
+ (ifinia , ifinra , ndim , ncelet , ncel, &
+ nideve , nrdeve , nituse , nrtuse , &
+ modhis , nvlsta , &
+ idevel , ituser , ia , &
+ xyzcen , volume , &
+ ra(istatc) , ra(istatv) , &
+ rdevel , rtuser , ra )
+endif
+if (ihistr.eq.1) then
+ call strhis &
+ !==========
+ (ifinia , ifinra , ncelet , ncel, &
+ nideve , nrdeve , nituse , nrtuse , &
+ modhis , &
+ idevel , ituser , ia , &
+ rdevel , rtuser , ra )
+endif
+
+! LE CAS ECHEANT, ON LIBERE LES STRUCTURES C DU MODULE THERMIQUE 1D
+! ET/OU ON FERME LE LISTING LAGRANGIEN
+
+if (nfpt1d.gt.0) then
+ call lbrt1d
+ !==========
+endif
+
+if (iale.gt.0) then
+ call lbrale
+ !==========
+endif
+
+if (iilagr.gt.0) close(implal)
+
+call dmtmps(tecrf2)
+!==========
+
+if(iwarn0.gt.0) then
+ write(nfecra,4010)tecrf2-tecrf1
+endif
+
+ 200 continue
+
+!===============================================================================
+! 26. MEMOIRE UTILISEE
+!===============================================================================
+
+! Liberation des structures liees a la lecture du fichier xml
+
+if (iihmpr.eq.1) then
+
+ call memui2
+ !==========
+
+ call memui1(ncharb)
+ !==========
+endif
+
+
+write(nfecra,7000)
+
+!----
+! FORMATS
+!----
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+'===============================================================',&
+ /,/,&
+' FONCTIONNEMENT EN MODE VERIFICATION ',/,&
+' =================================== ',/,&
+' ',/,&
+' =========================================================== ',/,&
+ /,&
+ /)
+
+ 2000 format(/,/, &
+'===============================================================',&
+ /,/,&
+ /,&
+ /,&
+' CORPS DU CALCUL ',/,&
+' =============== ',/,&
+ /,&
+ /,&
+'===============================================================',&
+ /,/,&
+ /)
+ 3000 format(/, &
+'===============================================================',&
+ /)
+ 3001 format(/,' INSTANT ',E18.9, ' ITERATION NUMERO ',I15,/, &
+' ============================================================= ',&
+ /,/)
+ 3002 format(/,' INSTANT ',E18.9, ' INITIALISATION ALE ',/, &
+' ============================================================= ',&
+ /,/)
+ 3010 format(/,' TEMPS CPU POUR L''ITERATION ',I15,' : ',E14.5,/,/, &
+'===============================================================',&
+ /)
+ 3012 format(/,' TEMPS CPU POUR L''INITIALISATION ALE : ',E14.5,/,/, &
+'===============================================================',&
+ /)
+ 3020 format(/,/, &
+ ' Sortie intermediaire de fichiers suite',/, &
+ ' Sauvegarde a l''iteration ', I10, ', Temps physique ',E14.5,/,&
+ ' Temps CPU pour les fichiers suite : ',E14.5,/,/)
+
+ 4000 format(/,/, &
+'===============================================================',&
+ /,/,&
+ /,&
+ /,&
+' ETAPES FINALES DU CALCUL ',/,&
+' ======================== ',/,&
+ /,&
+ /,&
+' =========================================================== ',/,&
+ /,&
+ /)
+ 4010 format( /,&
+ 3X,'** TEMPS CPU POUR LES SORTIES FINALES : ',E14.5 ,/,&
+ 3X,' ---------------------------------- ',/)
+ 7000 format(/,/, &
+' =========================================================== ',/,&
+ /,/,&
+ /,&
+ /,&
+' FIN DE L''EXECUTION DU CALCUL ',/,&
+' ============================ ',/,&
+ /,&
+ /,&
+'===============================================================')
+
+#else
+
+ 1000 format(/, &
+'===============================================================',&
+ /,/,&
+' RUNNING IN VERIFICATION MODE ',/,&
+' ============================ ',/,&
+' ',/,&
+' =========================================================== ',/,&
+ /,&
+ /)
+
+ 2000 format(/,/, &
+'===============================================================',&
+ /,/,&
+ /,&
+ /,&
+' MAIN CALCULATION ',/,&
+' ================ ',/,&
+ /,&
+ /,&
+'===============================================================',&
+ /,/,&
+ /)
+ 3000 format(/, &
+'===============================================================',&
+ /)
+ 3001 format(/,' INSTANT ',E18.9, ' TIME STEP NUMBER ',I15,/, &
+' ============================================================= ',&
+ /,/)
+ 3002 format(/,' INSTANT ',E18.9, ' ALE INITIALIZATION ',/, &
+' ============================================================= ',&
+ /,/)
+ 3010 format(/,' CPU TIME FOR THE TIME STEP ',I15,': ',E14.5,/,/, &
+'===============================================================',&
+ /)
+ 3012 format(/,' CPU TIME FOR ALE INITIALIZATION: ',E14.5,/,/, &
+'===============================================================',&
+ /)
+ 3020 format(/,/, &
+ ' Write intermediate restart files',/, &
+ ' checkpoint at iteration ', I10, ', Physical time ',E14.5,/, &
+ ' CPU time for restart files: ',E14.5,/,/)
+
+ 4000 format(/,/, &
+'===============================================================',&
+ /,/,&
+ /,&
+ /,&
+' FINAL STAGE OF THE CALCULATION ',/,&
+' ============================== ',/,&
+ /,&
+ /,&
+' =========================================================== ',/,&
+ /,&
+ /)
+ 4010 format( /,&
+ 3X,'** CPU TIME FOR FINAL WRITING: ',E14.5 ,/,&
+ 3X,' --------------------------- ',/)
+ 7000 format(/,/, &
+' =========================================================== ',/,&
+ /,/,&
+ /,&
+ /,&
+' END OF CALCULATION ',/,&
+' ================== ',/,&
+ /,&
+ /,&
+'===============================================================')
+
+#endif
+
+!===============================================================================
+! 26. FIN
+!===============================================================================
+
+
+return
+end
diff --git a/src/base/catsma.f90 b/src/base/catsma.f90
new file mode 100644
index 0000000..3d5829f
--- /dev/null
+++ b/src/base/catsma.f90
@@ -0,0 +1,147 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine catsma &
+!================
+
+ ( ncelet , ncel , ncesmp , iterns , isnexp , &
+ thetv , &
+ icetsm , itpsmp , &
+ volume , pvara , smcelp , gamma , &
+ tsexp , tsimp , gapinj )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES TERMES SOURCES IMPLICITE ET EXPLICITE
+! VENANT DES SOURCES DE MASSE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre de cellules !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! iterns ! e ! <-- ! numero d'iteration sur navsto !
+! isnexp ! e ! <-- ! indicateur pour extrapolation des !
+! ! ! ! termes sources de la phase traitee !
+! thetv ! r ! <-- ! theta sch. pour la variable !
+! ! ! ! thetv v(n+1) + (1-thetv) v(n) !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itpsmp(ncesmp ! te ! <-- ! type de source de masse pour la !
+! ! ! ! variable traitee (cf. ustsma) !
+! volume(ncel) ! tr ! <-- ! volume des cellules !
+! pvara(ncel) ! tr ! <-- ! valeur de la variable en debut de pas !
+! ! ! ! de temps !
+! smcelp(ncesmp ! tr ! <-- ! valeur de la variable associee a la !
+! ! ! ! source de masse !
+! gamma(ncesmp) ! tr ! <-- ! valeur du flux de masse !
+! tsexp(ncel) ! tr ! <-- ! part du terme source explicite !
+! ! ! ! lineaire par rapport a la variable !
+! tsimp(ncel) ! tr ! <-- ! valeur associee a tsexp qui ira dans !
+! ! ! ! la matrice !
+! gapinj(ncel) ! tr ! --> ! part du terme source explicite !
+! ! ! ! independant de la variable !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+integer ncelet, ncel , ncesmp, iterns, isnexp
+integer icetsm(ncesmp), itpsmp(ncesmp)
+double precision thetv
+double precision volume(ncelet)
+double precision pvara (ncelet)
+double precision smcelp(ncesmp), gamma (ncesmp)
+double precision tsexp (ncelet), tsimp (ncelet), gapinj(ncelet)
+
+! VARIABLES LOCALES
+
+integer ii, iel
+
+!===============================================================================
+
+! Explication des tests GAMMA(II).GT.0.D0 .AND. ITPSMP(II).EQ.1 :
+! Si on enleve de la matiere ou si on entre a la valeur de la
+! cellule alors l'equation de IVAR n'est pas modifiee
+! Sinon, on ajoute le terme source GAMMA*(f_i-f^(n+1))
+
+! Dans TSIMP, on ajoute le terme qui ira sur la diagonale,
+! soit Gamma (*theta en cas d'ordre 2)
+! Dans TSEXP on ajoute le terme correspondant du second membre
+! cad Gamma * Pvar (avec Pvar)
+! Dans GAPINJ on place le terme Gamma Pinj qui ira au second membre
+
+! La distinction entre TSEXP et W1 (qui vont finalement tous les
+! deux au second membre) sert pour l'ordre 2 en temps.
+
+if(iterns.eq.1) then
+ do iel = 1, ncel
+ gapinj(iel) = 0.d0
+ enddo
+ do ii = 1, ncesmp
+ iel = icetsm(ii)
+ if (gamma(ii).gt.0.d0 .and. itpsmp(ii).eq.1) then
+ tsexp(iel) = tsexp(iel) - volume(iel)*gamma(ii) * pvara(iel)
+ gapinj(iel) = volume(iel)*gamma(ii) * smcelp(ii)
+ endif
+ enddo
+endif
+
+! Sur la diagonale
+if(isnexp.gt.0) then
+ do ii = 1, ncesmp
+ iel = icetsm(ii)
+ if (gamma(ii).gt.0.d0 .and. itpsmp(ii).eq.1) then
+ tsimp(iel) = tsimp(iel) + volume(iel)*gamma(ii)*thetv
+ endif
+ enddo
+else
+ do ii = 1, ncesmp
+ iel = icetsm(ii)
+ if (gamma(ii).gt.0.d0 .and. itpsmp(ii).eq.1) then
+ tsimp(iel) = tsimp(iel) + volume(iel)*gamma(ii)
+ endif
+ enddo
+endif
+
+return
+end
diff --git a/src/base/causta.f90 b/src/base/causta.f90
new file mode 100644
index 0000000..f5868f7
--- /dev/null
+++ b/src/base/causta.f90
@@ -0,0 +1,209 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine causta &
+!================
+
+ ( iface , imp , xkappa , cstlog , ypluli , &
+ apow , bpow , dpow , &
+ uu , dp , xnu , uet )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA VITESSE DE FROTTEMENT UET PAR UNE METHODE DE NEWTON
+! EN SUPPOSANT QUE UU VITESSE TANGENTIELLE REPOND A LA LOI
+! UU/UET = 1/XKAPPA LOG (YPLUS) + CSTLOG
+! YPLUS = UET*DP/XNU
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iface ! e ! <-- ! numero d'entite traitee !
+! imp ! e ! <-- ! niveau d'impression !
+! ! ! ! > 0 en cas d'erreur fatale !
+! ! ! ! > 1 non respect d'un critere !
+! ! ! ! > 2 mini pour bonne analyse !
+! ! ! ! > 3 intervention inhabituelle du code !
+! ! ! ! > 4 impression pour info !
+! ! ! ! > 5 idem + complements !
+! xkappa ! r ! <-- ! cst de karman !
+! cstlog ! r ! <-- ! cst de la loi log !
+! ypluli ! r ! <-- ! yplus limite !
+! *pow ! r ! <-- ! coefficients de la loi de werner !
+! uu ! r ! <-- ! vitesse tangentielle a la paroi !
+! dp ! r ! <-- ! dist a la paroi du pt ou est pris uu !
+! xnu ! r ! <-- ! viscosite cinematique moleculaire !
+! uet ! r ! --> ! vitesse de frottement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iface, imp
+double precision xkappa, cstlog, ypluli, apow, bpow, dpow
+double precision uu, dp, xnu, uet
+
+! VARIABLES LOCALES
+
+integer ipos, nitm, nit
+double precision eps, rr, yp, uetwer, uetmin, ueta, ysurnu
+
+!===============================================================================
+
+! -------------------
+! 1 - INITIALISATIONS
+! -------------------
+
+eps = 0.001d0
+nitm = 100
+nit = 0
+
+ipos = 0
+if ( imp .gt. 4 ) then
+ write ( nfecra,1000 ) iface
+ ipos = 1
+ write ( nfecra,1100 ) uu, dp
+endif
+
+! --------------------------
+! 2 - CALCUL DU REYNOLDS LOCAL
+! --------------------------
+
+ysurnu = dp / xnu
+rr = uu * ysurnu
+
+! ------------------------------------------
+! 3 - CALCUL DE LA VITESSE DE FROTTEMENT UET
+! ------------------------------------------
+
+! SOUS-COUCHE VISQUEUSE
+
+if ( rr .le. ypluli**2 ) then
+ uet = sqrt( uu / ysurnu )
+else
+
+! RESOLUTION ITERATIVE PAR UNE METHODE DE NEWTON
+
+! On initialise par Werner ou la borne inf de uet assurant la cv
+! de la methode
+ uetwer = ( abs(uu)/apow/(ysurnu**bpow) )**dpow
+ uetmin = exp(-cstlog*xkappa)/ysurnu
+ uet = max(uetwer,uetmin)
+
+ 300 continue
+ nit = nit+1
+
+ ueta = uet
+ uet = (xkappa*uu + uet)/(log(ysurnu*uet)+xkappa*cstlog+1.d0)
+
+ if ( abs ( uet-ueta ) .le. eps * ueta ) then
+ if ( imp .gt. 5 ) write ( nfecra,3000 ) nit, eps
+ else if ( nit .ge. nitm ) then
+ if ( imp .gt. 1 ) then
+ if ( ipos .le. 0 ) write ( nfecra,1000 ) iface
+ ipos = 1
+ write ( nfecra,3100 ) nitm, eps
+ endif
+ else
+ go to 300
+ endif
+
+endif
+
+! ------------------------------------------------------
+! 4 - POSITION DU POINT INTERIEUR DANS LA COUCHE LIMITE
+! ------------------------------------------------------
+
+if ( imp .gt. 4 ) then
+ yp = ysurnu*uet
+ if ( yp .le. ypluli ) then
+ write ( nfecra,4000 ) yp
+ else
+ write ( nfecra,4100 ) yp
+ endif
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 FORMAT ( 5X,'APPEL DU SOUS-PROGRAMME CAUSTA A LA FACE IFAC=',I9)
+ 1100 FORMAT ( 10X,'CONDITIONS D''ENTREE : UU=',E10.3,2X,'DP=',E10.3 )
+ 3000 FORMAT ( 10X,'CONVERGENCE DU CALCUL DE UET APRES NIT=',I4, &
+ 1X,'ITERATIONS, PRECISION DEMANDEE EPS=',E10.3 )
+ 3100 FORMAT ( 10X,'NOMBRE MAXIMAL D''ITERATIONS ATTEINT POUR LE', &
+ 1X,'CALCUL DE UET : NITM=',I4,', PRECISION', &
+ 1X,'DEMANDEE EPS=',E10.3 )
+ 4000 FORMAT ( 10X,'LE PREMIER POINT INTERIEUR EST DANS LA SOUS-COUCHE',&
+ 1X,'VISQUEUSE, Y+=',E10.3 )
+ 4100 FORMAT ( 10X,'LE PREMIER POINT INTERIEUR EST A LA DISTANCE DE', &
+ 1X,'LA PAROI, Y+=',E10.3 )
+
+#else
+
+ 1000 FORMAT ( 5X,'CAUSTA SUBROUTINE CALLED FOR FACE IFAC=',I9)
+ 1100 FORMAT ( 10X,'INPUT CONDITIONS: UU=',E10.3,2X,'DP=',E10.3 )
+ 3000 FORMAT ( 10X,'UET COMPUTATION CONVERGENCE AFTER NIT=',I4, &
+ 1X,'ITERATIONS, DESIRED PRECISION EPS=',E10.3 )
+ 3100 FORMAT ( 10X,'MAXIMUM NUMBER OF ITERATIONS REACHED FOR THE', &
+ 1X,'COMPUTATION OF UET: NITM=',I4,', DESIRED PRECISION', &
+ 1X,'EPS=',E10.3 )
+ 4000 FORMAT ( 10X,'THE FIRST POINT IS IN THE VISCOUS SUBLAYER', &
+ 1X,' Y+=',E10.3 )
+ 4100 FORMAT ( 10X,'THE FIRST POINT IS AT A WALL-DISTANCE OF', &
+ 1X,' Y+=',E10.3 )
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/clca66.f90 b/src/base/clca66.f90
new file mode 100644
index 0000000..6ce02b8
--- /dev/null
+++ b/src/base/clca66.f90
@@ -0,0 +1,182 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine clca66 &
+!================
+
+ ( clsyme , eloglo , alpha )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA MATRICE ALPHA (VOIR CNDRIJ)
+! POUR LES CONDITIONS AUX LIMITES EN PAROI ET SYMETRIE EN RIJ-EPS
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! clsyme ! r ! <-- ! indicateur symetrie = 1., paroi = 0. !
+! eloglo ! tr ! <-- ! matrice de changement de base !
+! (6,6) ! ! ! local -> global !
+! alpha ! tr ! --> ! voir cndrij !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+double precision clsyme
+double precision eloglo(3,3),alpha(6,6)
+
+! VARIABLES LOCALES
+
+integer ii,jj,kk,pp,jj1,jj2
+
+!===============================================================================
+
+!===============================================================================
+! CALCUL DE ALPHA(I,J) POUR I DANS [1,3] ET J DANS [1,3] : 9 TERMES
+!===============================================================================
+
+ do ii = 1,3
+ do jj = 1,3
+
+ alpha(ii,jj) = eloglo(ii,1)**2*eloglo(jj,1)**2 + &
+ eloglo(ii,2)**2*eloglo(jj,2)**2 + &
+ eloglo(ii,3)**2*eloglo(jj,3)**2 + &
+ 2.d0*clsyme*eloglo(ii,1)*eloglo(ii,3)*eloglo(jj,1)*eloglo(jj,3)
+
+ enddo
+ enddo
+
+!===============================================================================
+! CALCUL DE ALPHA(I,J) POUR I DANS [1,3] ET J DANS [4,6] : 9 TERMES
+!===============================================================================
+
+ do ii=1,3
+ do jj=1,3
+
+ if (jj.eq.1) then
+ kk=1
+ pp=2
+ else if (jj.eq.2) then
+ kk=1
+ pp=3
+ else if (jj.eq.3) then
+ kk=2
+ pp=3
+ endif
+
+ alpha(ii,jj+3) = 2.d0*( &
+ eloglo(ii,1)**2*eloglo(kk,1)*eloglo(pp,1) + &
+ eloglo(ii,2)**2*eloglo(kk,2)*eloglo(pp,2) + &
+ eloglo(ii,3)**2*eloglo(kk,3)*eloglo(pp,3) + &
+ clsyme*eloglo(ii,3)*eloglo(ii,1)* &
+ (eloglo(kk,1)*eloglo(pp,3)+eloglo(kk,3)*eloglo(pp,1)))
+
+ enddo
+ enddo
+
+!===============================================================================
+! CALCUL DE ALPHA(I,J) POUR I DANS [4,6] ET J DANS [1,3] : 9 TERMES
+!===============================================================================
+
+ do ii=1,3
+ do jj=1,3
+
+ if (ii.eq.1) then
+ kk=1
+ pp=2
+ else if (ii.eq.2) then
+ kk=1
+ pp=3
+ else if (ii.eq.3) then
+ kk=2
+ pp=3
+ endif
+ alpha(ii+3,jj) = &
+ eloglo(kk,1)*eloglo(pp,1)*eloglo(jj,1)**2 + &
+ eloglo(kk,2)*eloglo(pp,2)*eloglo(jj,2)**2 + &
+ eloglo(kk,3)*eloglo(pp,3)*eloglo(jj,3)**2 + &
+ clsyme*eloglo(jj,3)*eloglo(jj,1)* &
+ (eloglo(kk,1)*eloglo(pp,3)+eloglo(kk,3)*eloglo(pp,1))
+
+ enddo
+ enddo
+
+
+!===============================================================================
+! CALCUL DE ALPHA(I,J) POUR I DANS [4,6] ET J DANS [4,6] : 9 TERMES
+!===============================================================================
+
+ do ii=1,3
+ do jj=1,3
+
+ if (ii.eq.1) then
+ kk=1
+ pp=2
+ else if (ii.eq.2) then
+ kk=1
+ pp=3
+ else if (ii.eq.3) then
+ kk=2
+ pp=3
+ endif
+ if (jj.eq.1) then
+ jj1=1
+ jj2=2
+ else if (jj.eq.2) then
+ jj1=1
+ jj2=3
+ else if (jj.eq.3) then
+ jj1=2
+ jj2=3
+ endif
+ alpha(ii+3,jj+3)= &
+ 2.d0*(eloglo(kk,1)*eloglo(pp,1)*eloglo(jj1,1)*eloglo(jj2,1)+ &
+ eloglo(kk,2)*eloglo(pp,2)*eloglo(jj1,2)*eloglo(jj2,2)+ &
+ eloglo(kk,3)*eloglo(pp,3)*eloglo(jj1,3)*eloglo(jj2,3))+&
+ clsyme*(eloglo(kk,1)*eloglo(pp,3)+eloglo(kk,3)*eloglo(pp,1))*&
+ (eloglo(jj1,3)*eloglo(jj2,1)+eloglo(jj1,1)*eloglo(jj2,3))
+
+ enddo
+ enddo
+
+ return
+ end
diff --git a/src/base/cldijp.f90 b/src/base/cldijp.f90
new file mode 100644
index 0000000..58bd6fd
--- /dev/null
+++ b/src/base/cldijp.f90
@@ -0,0 +1,239 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cldijp &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfac , nfabor , ncelet , ncel , &
+ ifacel , ifabor , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ surfan , surfbn , &
+ pond , &
+ dijpf , diipb , dofij , &
+ ia , ra )
+
+!===============================================================================
+
+! FONCTION :
+! --------
+
+! CALCUL DE VECTEURS POUR TERMES DE NON ORTHOGONALITE :
+
+! SOIT UNE FACE A,B,C ET I,J LES CENTRES DES VOLUMES VOISINS.
+! (SEUL I EST DEFINI POUR UNE FACE DE BORD)
+
+! LA FACE EST ORIENTEE DE I VERS J, DE NORMALE NIJ.
+! (LES FACES DE BORD SONT ORIENTEES VERS L'EXTERIEUR)
+! LA NORME DE NIJ VAUT 1.
+! SIJ EST LA SURFACE DE LA FACE ABC.
+! ON DEFINIT I' ET J' LES PROJETES ORTHOGONAUX DE
+! I ET J SUR LA DROITE ORTHOGONALE A ABC PASSANT PAR SON CDG F
+! (SEUL I' EST DEFINI POUR LES FACES DE BORD)
+
+! ON CALCULE ICI LE VECTEUR I'J' AUX FACES INTERNES (DIJPF)
+! LE VECTEUR II' AUX FACES DE BORD (DIIPB)
+! LE VECTEUR OF AUX FACES INTERNES (DOFIJ)
+
+! NOTER LES RELATIONS
+! II' = IG - (IG.NIJ)NIJ
+! JJ' = JG - (JG.NIJ)NIJ
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nfac ! e ! <-- ! nombre total de faces internes !
+! nfabor ! e ! <-- ! nombre total de faces de bord !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! ifacel ! te ! <-- ! ifacel(iel,ifac) num glob de l'elemnt !
+! (2,nfac) ! ! ! vois iel (1 ou 2) de la fac int ifac !
+! ifabor ! te ! <-- ! ifabor(ifac ) num glob de l'elt !
+! nfabor ) ! ! ! voisin iel (1) de la fac de brd ifac !
+! xyzcen ! tr ! <-- ! coords du "centre" des nelem elements !
+! (3,ncelet ! ! ! !
+! surfac ! tr ! <-- ! coords du vecteur surface des nfac !
+! (3,nfac ) ! ! ! faces internes; dirige du vois 1 vers !
+! ! ! ! le vois 2 (ifacel) ; non unitaire !
+! surfbo ! tr ! <-- ! coords du vecteur surface des nfabor !
+! (3,nfabor) ! ! ! faces de bord ; dirige vers !
+! ! ! ! l'exterieur du domaine; non unitaire !
+! surfan ! tr ! <-- ! norme de surfac (surface des faces !
+! (nfac ) ! ! ! internes) !
+! surfbn ! tr ! <-- ! norme de surfbo (surface des faces !
+! (nfabor ) ! ! ! de bord) !
+! cdgfac ! tr ! <-- ! coords du centre de gravite des faces !
+! 3,nfac ) ! ! ! internes !
+! cdgfbo ! tr ! <-- ! coords du centre de gravite des faces !
+! 3,nfabor) ! ! ! de bord !
+! pond ! tr ! --> ! ponderation pour face interne !
+! (nfac ) ! ! ! = d2/(d1+d2) ou d1 et d2 sont les !
+! ! ! ! projetes sur la normale a la face !
+! ! ! ! des vecteurs definis resp. par : !
+! ! ! !d1(orig: voisin 1, extremite: cdg face !
+! ! ! !d2(orig: cdg face, extremite: voisin 2 !
+! dijpf ! tr ! --> ! vecteur i'j' pour les faces internes !
+! (ndim,nfac ) ! ! ! !
+! diipb ! tr ! --> ! vecteur ii' pour les faces de bord !
+! (ndim,nfabor) ! ! ! !
+! dofij ! tr ! --> ! vecteur of pour les faces internes !
+! (ndim,nfac ) ! ! ! o : intersection de ij et la face !
+! ! ! ! f : centre de la face !
+! ia ! te ! --- ! tableau de travail entier !
+! ra ! tr ! --- ! tableau de travail reel !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0,idbra0
+integer nfac,nfabor,ncelet,ncel
+integer ifacel(2,nfac)
+integer ifabor(nfabor)
+integer ia(*)
+double precision xyzcen(3,ncelet)
+double precision surfac(3,nfac),surfbo(3,nfabor)
+double precision surfan(nfac),surfbn(nfabor)
+double precision cdgfac(3,nfac),cdgfbo(3,nfabor)
+double precision pond(nfac)
+double precision dijpf(3,nfac)
+double precision diipb(3,nfabor)
+double precision dofij(3,nfac)
+double precision ra(*)
+
+integer ifac,ivois1,ivois2
+double precision surfnx,surfny,surfnz
+double precision vecigx,vecigy,vecigz
+double precision vecijx,vecijy,vecijz
+double precision dipjp
+double precision psi
+
+!===============================================================================
+! 1. FACES INTERNES
+!===============================================================================
+
+do ifac = 1, nfac
+
+!---> NUMERO DES VOISINS
+
+ ivois1 = ifacel(1,ifac)
+ ivois2 = ifacel(2,ifac)
+
+!---> NORMALE NORMEE
+
+ surfnx = surfac(1,ifac)/surfan(ifac)
+ surfny = surfac(2,ifac)/surfan(ifac)
+ surfnz = surfac(3,ifac)/surfan(ifac)
+
+!---> IJ
+
+ vecijx = xyzcen(1,ivois2)-xyzcen(1,ivois1)
+ vecijy = xyzcen(2,ivois2)-xyzcen(2,ivois1)
+ vecijz = xyzcen(3,ivois2)-xyzcen(3,ivois1)
+
+!---> DIJPP = IJ.NIJ
+
+ dipjp = vecijx*surfnx + vecijy*surfny + &
+ vecijz*surfnz
+
+!---> DIJPF = (IJ.NIJ).NIJ
+
+ dijpf(1,ifac) = dipjp * surfnx
+ dijpf(2,ifac) = dipjp * surfny
+ dijpf(3,ifac) = dipjp * surfnz
+
+!---> DOFIJ = OF
+
+ dofij(1,ifac) = cdgfac(1,ifac) - &
+ (pond(ifac) * xyzcen(1,ivois1) + &
+ (1.d0-pond(ifac))*xyzcen(1,ivois2))
+ dofij(2,ifac) = cdgfac(2,ifac) - &
+ (pond(ifac)*xyzcen(2,ivois1) + &
+ (1.d0-pond(ifac))*xyzcen(2,ivois2))
+ dofij(3,ifac) = cdgfac(3,ifac) - &
+ (pond(ifac)*xyzcen(3,ivois1) + &
+ (1.d0-pond(ifac))*xyzcen(3,ivois2))
+
+enddo
+
+!===============================================================================
+! 2. FACES DE BORD
+!===============================================================================
+
+do ifac = 1, nfabor
+
+!---> NUMERO DU VOISIN
+
+ ivois1 = ifabor(ifac)
+
+!---> NORMALE NORMEE
+
+ surfnx = surfbo(1,ifac)/surfbn(ifac)
+ surfny = surfbo(2,ifac)/surfbn(ifac)
+ surfnz = surfbo(3,ifac)/surfbn(ifac)
+
+!---> IG
+
+ vecigx = cdgfbo(1,ifac)-xyzcen(1,ivois1)
+ vecigy = cdgfbo(2,ifac)-xyzcen(2,ivois1)
+ vecigz = cdgfbo(3,ifac)-xyzcen(3,ivois1)
+
+!---> PSI = IG.NIJ
+
+ psi = vecigx*surfnx+vecigy*surfny+vecigz*surfnz
+
+!---> DIIPB = IG - (IG.NIJ)NIJ
+
+ diipb(1,ifac) = vecigx - psi*surfnx
+ diipb(2,ifac) = vecigy - psi*surfny
+ diipb(3,ifac) = vecigz - psi*surfnz
+
+enddo
+
+!===============================================================================
+! 3. FIN
+!===============================================================================
+
+return
+end
diff --git a/src/base/cldipo.f90 b/src/base/cldipo.f90
new file mode 100644
index 0000000..c4c913f
--- /dev/null
+++ b/src/base/cldipo.f90
@@ -0,0 +1,202 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cldipo &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfac , nfabor , ncelet , ncel , &
+ ifacel , ifabor , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , surfan , surfbn , &
+ dist , distbo , pond , &
+ ia , ra )
+
+!===============================================================================
+
+! FONCTION :
+! --------
+! CALCUL DES DISTANCES RELATIVES AUX FACES
+! ET DES PONDERATIONS ASSOCIEES
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nfac /nfabor ! e ! <-- ! nombre total de faces internes/de bor !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! ifacel ! te ! <-- ! ifacel(iel,ifac) num glob de l'elemnt !
+! (2,nfac) ! ! ! vois iel (1 ou 2) de la fac int ifac !
+! ifabor ! te ! <-- ! ifabor(ifac) num glob de l'element !
+! nfac ,2) ! ! ! voisin iel (1) de la fac de brd ifac !
+! xyzcen ! tr ! <-- ! coords du "centre" des nelem elements !
+! (3,ncelet ) ! ! ! !
+! surfac ! tr ! <-- ! coords du vecteur surface des nfaglo !
+! (3,nfac ) ! ! ! faces internes; dirige du vois 1 vers !
+! ! ! ! le voisin 2 (ifacel) ; non unitaire !
+! surfbo ! tr ! <-- ! coords du vecteur surface des nfagbr !
+! (3,nfabor) ! ! ! faces de brd;dirige vers l'exterieur !
+! ! ! ! du domaine ; non unitaire !
+! cdgfac ! tr ! <-- ! coords du centre de gravite des faces !
+! (ndim,nfac ) ! ! ! internes !
+! cdgfbo ! tr ! <-- ! coords du centre de gravite des faces !
+! (ndim,nfabor) ! ! ! de bord !
+! dist ! tr ! --> ! prod.scal. de la normale normee a une !
+! (nfac ) ! ! ! face interne et du vecteur defini !
+! ! ! ! par les voisins (voisin 1 : origine, !
+! ! ! ! voisin 2 : extremite) !
+! pond ! tr ! --> ! ponderation pour face interne !
+! (nfac ) ! ! ! = d2/(d1+d2) ou d1 et d2 sont les !
+! ! ! ! projetes sur la normale a la face !
+! ! ! ! des vecteurs definis resp. par : !
+! ! ! !d1(orig: voisin 1, extremite: cdg face !
+! ! ! !d2(orig: cdg face, extremite: voisin 2 !
+! distbo ! tr ! --> ! prod. scal. de la normale normee !
+! (nfabor) ! ! ! une face de bord et du vecteur !
+! ! ! ! voisin cdg face ((voisin : origine, !
+! ! ! ! cdg face : extremite) !
+! ia ! te ! --- ! tableau de travail entier !
+! ra ! tr ! --- ! tableau de travail reel !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+include "paramx.h"
+include "cstnum.h"
+include "entsor.h"
+
+integer idbia0, idbra0
+integer nfac , nfabor, ncelet, ncel
+integer ifacel(2,nfac), ifabor(nfabor)
+integer ia(*)
+double precision xyzcen(3,ncelet)
+double precision surfac(3,nfac ),surfbo(3,nfabor)
+double precision cdgfac(3,nfac ),cdgfbo(3,nfabor)
+double precision surfan(nfac ),surfbn(nfabor)
+double precision dist(nfac)
+double precision distbo(nfabor)
+double precision pond(nfac)
+double precision ra(*)
+
+integer ifac, ivois1,ivois2,ipond0
+double precision surfx,surfy,surfz, surfn,dist2f
+double precision xvn,yvn,zvn,xvv,yvv,zvv
+
+!===============================================================================
+! 1. TRAITEMENT DES FACES INTERNES
+!===============================================================================
+
+ipond0 = 0
+do ifac = 1, nfac
+
+ surfx = surfac(1,ifac)
+ surfy = surfac(2,ifac)
+ surfz = surfac(3,ifac)
+ surfn = surfan(ifac)
+
+ ivois1 = ifacel(1,ifac)
+ ivois2 = ifacel(2,ifac)
+
+! (CDG FACE,VOISIN2)
+ xvn = xyzcen(1,ivois2) - cdgfac(1,ifac)
+ yvn = xyzcen(2,ivois2) - cdgfac(2,ifac)
+ zvn = xyzcen(3,ivois2) - cdgfac(3,ifac)
+
+! (PRODUIT SCALAIRE AVEC LA NORMALE NORMEE)
+ dist2f = (xvn*surfx + yvn*surfy + zvn*surfz)/surfn
+
+! (VOISIN1, VOISIN2)
+ xvv = xyzcen(1,ivois2) - xyzcen(1,ivois1)
+ yvv = xyzcen(2,ivois2) - xyzcen(2,ivois1)
+ zvv = xyzcen(3,ivois2) - xyzcen(3,ivois1)
+
+! (PRODUIT SCALAIRE AVEC LA NORMALE NORMEE)
+ dist(ifac) = (xvv*surfx + yvv*surfy + zvv*surfz)/surfn
+
+ if (abs(dist(ifac)).ge.epzero) then
+ pond(ifac) = dist2f / dist(ifac)
+ else
+ ipond0 = ipond0 + 1
+ pond(ifac) = 0.5d0
+ endif
+
+enddo
+
+!===============================================================================
+! 2. TRAITEMENT DES FACES DE BORD
+!===============================================================================
+
+do ifac = 1, nfabor
+
+ surfx = surfbo(1,ifac)
+ surfy = surfbo(2,ifac)
+ surfz = surfbo(3,ifac)
+ surfn = surfbn(ifac)
+
+ ivois1 = ifabor(ifac)
+
+! (VOISIN 1, CDG FACE)
+ xvn = cdgfbo(1,ifac) - xyzcen(1,ivois1)
+ yvn = cdgfbo(2,ifac) - xyzcen(2,ivois1)
+ zvn = cdgfbo(3,ifac) - xyzcen(3,ivois1)
+
+ distbo(ifac) = (xvn*surfx + yvn*surfy + zvn*surfz)/surfn
+
+enddo
+
+!===============================================================================
+! 3. FIN
+!===============================================================================
+
+if(ipond0.ne.0) then
+ write(nfecra,1000) ipond0
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(' CLDIPO : ',I10,' DISTANCES NULLES ENTRE CENTRES ',/, &
+ ' ON MET POND A 0.5 ')
+
+#else
+
+ 1000 format(' CLDIPO : ',I10,' NULL DISTANCES BETWEEN CENTRES ',/, &
+ ' POND IS SET TO 0.5 ')
+
+#endif
+
+return
+end
diff --git a/src/base/clipke.f90 b/src/base/clipke.f90
new file mode 100644
index 0000000..4eda937
--- /dev/null
+++ b/src/base/clipke.f90
@@ -0,0 +1,304 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clipke &
+!================
+
+ ( ncelet , ncel , nvar , nphas , &
+ iphas , iclip , iwarnk , &
+ propce , rtp )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CLIPPING DE K ET EPSILON
+
+!-------------------------------------------------------------------------------
+! Arguments
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nvar ! e ! <-- ! nombre de variables !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nphas ! e ! <-- ! nombre de phases !
+! iphas ! e ! <-- ! numero de la phase a traiter !
+! iclip ! e ! <-- ! indicateur = 0 on utilise viscl0 !
+! ! ! ! sinon on utilise viscl !
+! iwarnk ! e ! <-- ! niveau d'impression !
+! propce ! tr ! <-- ! tableaux des variables au pdt courant !
+!(ncelet,* ! ! ! !
+! rtp ! tr ! <-- ! tableaux des variables au pdt courant !
+! (ncelet ) ! ! ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "optcal.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nvar, ncelet, ncel, nphas
+integer iphas, iclip, iwarnk
+double precision propce(ncelet,*)
+double precision rtp(ncelet,nvar)
+
+! VARIABLES LOCALES
+
+integer iclpke,iel,iclpk2,iclpe2
+integer ivar,ipp,ii,iikiph,iieiph,iivisc,iiromc
+double precision xepmin,xepm,xe,xkmin,xkm,xk, vmin, vmax, var
+double precision epz2
+
+!===============================================================================
+
+iikiph = ik(iphas)
+iieiph = iep(iphas)
+iivisc = ipproc(iviscl(iphas))
+iiromc = ipproc(irom(iphas))
+
+
+! Une petite valeur pour eviter des valeurs exactement nulles.
+
+epz2 = epzero**2
+
+!===============================================================================
+! ---> Stockage Min et Max pour listing
+!===============================================================================
+
+do ii = 1, 2
+ if(ii.eq.1) then
+ ivar = iikiph
+ elseif(ii.eq.2) then
+ ivar = iieiph
+ endif
+ ipp = ipprtp(ivar)
+
+ vmin = grand
+ vmax = -grand
+ do iel = 1, ncel
+ var = rtp(iel,ivar)
+ vmin = min(vmin,var)
+ vmax = max(vmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmax (vmax)
+ !==========
+ call parmin (vmin)
+ !==========
+ endif
+ varmna(ipp) = vmin
+ varmxa(ipp) = vmax
+
+enddo
+
+!===============================================================================
+! ---> Detection des valeurs hors norme "physiques"
+! uniquement pour avertissement
+! ou dans le cas ICLKEP = 1
+!===============================================================================
+
+if (iwarnk.ge.2.or.iclkep(iphas).eq.1) then
+
+ if(iclip.eq.1) then
+
+ xkm = 1296.d0*sqrt(cmu)/almax(iphas)**2
+ xepm = 46656.d0*cmu/almax(iphas)**4
+ iclpke = 0
+ do iel=1,ncel
+ xk = rtp(iel,iikiph)
+ xe = rtp(iel,iieiph)
+ xkmin = xkm*(propce(iel,iivisc)/propce(iel,iiromc))**2
+ xepmin = xepm*(propce(iel,iivisc)/propce(iel,iiromc))**3
+ if(xk.le.xkmin.or.xe.le.xepmin) then
+ if(iclkep(iphas).eq.1) then
+ rtp(iel,iikiph) = xkmin
+ rtp(iel,iieiph) = xepmin
+ endif
+ iclpke = iclpke + 1
+ endif
+ enddo
+
+ elseif(iclip.eq.0) then
+
+ xkmin = 1296.d0*sqrt(cmu)/almax(iphas)**2* &
+ (viscl0(iphas)/ro0(iphas))**2
+ xepmin = 46656.d0*cmu/almax(iphas)**4* &
+ (viscl0(iphas)/ro0(iphas))**3
+ iclpke = 0
+ do iel=1,ncel
+ xk = rtp(iel,iikiph)
+ xe = rtp(iel,iieiph)
+ if(xk.le.xkmin.or.xe.le.xepmin) then
+ if(iclkep(iphas).eq.1) then
+ rtp(iel,iikiph) = xkmin
+ rtp(iel,iieiph) = xepmin
+ endif
+ iclpke = iclpke + 1
+ endif
+ enddo
+
+ else
+
+ write(nfecra,1000)iclip
+ call csexit (1)
+
+ endif
+
+ if (irangp.ge.0) call parcpt (iclpke)
+ !==========
+
+! --- Impression eventuelle
+
+ if(iwarnk.ge.2) then
+
+ write(nfecra,1010)iclpke
+
+ endif
+
+! --- Stockage nb de clippings pour listing
+
+ if(iclkep(iphas).eq.1) then
+ iclpmn(ipprtp(iikiph)) = iclpke
+ iclpmn(ipprtp(iieiph)) = iclpke
+ endif
+
+endif
+
+!===============================================================================
+! ---> Clipping "standard" ICLKEP = 0
+!===============================================================================
+
+if(iclkep(iphas).eq.0) then
+
+ iclpk2 = 0
+ iclpe2 = 0
+ do iel = 1, ncel
+ xk = rtp(iel,iikiph)
+ xe = rtp(iel,iieiph)
+ if (abs(xk).le.epz2) then
+ iclpk2 = iclpk2 + 1
+ rtp(iel,iikiph) = max(rtp(iel,iikiph),epz2)
+ elseif(xk.le.0.d0) then
+ iclpk2 = iclpk2 + 1
+ rtp(iel,iikiph) = -xk
+ endif
+ if (abs(xe).le.epz2) then
+ iclpe2 = iclpe2 + 1
+ rtp(iel,iieiph) = max(rtp(iel,iieiph),epz2)
+ elseif(xe.le.0.d0) then
+ iclpe2 = iclpe2 + 1
+ rtp(iel,iieiph) = -xe
+ endif
+ enddo
+
+ if (irangp.ge.0) then
+ call parcpt (iclpk2)
+ !==========
+ call parcpt (iclpe2)
+ !==========
+ endif
+
+! --- Stockage nb de clippings pour listing
+
+ iclpmn(ipprtp(iikiph)) = iclpk2
+ iclpmn(ipprtp(iieiph)) = iclpe2
+
+endif
+
+
+!===============================================================================
+! ---> Formats
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS clipke ',/,&
+'@ ========= ',/,&
+'@ APPEL DE clipke AVEC OPTION = ',I10 ,/,&
+'@ Phase : ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1010 format( &
+ I10,' VALEURS DU K-EPS AU DELA DES ECHELLES BASEES SUR ALMAX')
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN clipke ',/,&
+'@ ======== ',/,&
+'@ CALL OF clipke WITH OPTION = ',I10 ,/,&
+'@ Phase : ',I10 ,/,&
+'@ ',/,&
+'@ The calulation will not be run. ',/,&
+'@ ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1010 format( &
+ I10,' K-EPS VALUES BEYOND THE SCALES BASED ON ALMAX')
+
+#endif
+
+return
+
+end
diff --git a/src/base/clprij.f90 b/src/base/clprij.f90
new file mode 100644
index 0000000..4a9e518
--- /dev/null
+++ b/src/base/clprij.f90
@@ -0,0 +1,290 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clprij &
+!================
+
+ ( ncelet , ncel , nvar , nphas , &
+ iphas , iclip , &
+ propce , rtpa , rtp )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CLIPPING DE Rij ET EPSILON
+
+!-------------------------------------------------------------------------------
+! Arguments
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre de cellules !
+! nvar ! e ! <-- ! nombre de variables !
+! nphas ! e ! <-- ! nombre de phases !
+! iphas ! e ! <-- ! numero de la phase a traiter !
+! iclip ! e ! <-- ! indicateur = 1 on n'utilise pas rtpa !
+! ! ! ! (inivar) !
+! ! ! ! sinon on peut (turrij) !
+! propce ! tr ! <-- ! tableaux des variables au pdt courant !
+!(ncelet,* ! ! ! !
+! rtpa ! tr ! <-- ! tableaux des variables au pdt precedt !
+! (ncelet,nvar) ! ! ! !
+! rtp ! tr ! <-- ! tableaux des variables au pdt courant !
+! (ncelet,nvar) ! ! ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "numvar.h"
+include "cstnum.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nvar, ncelet, ncel, nphas
+integer iphas, iclip
+double precision propce(ncelet,*)
+double precision rtpa(ncelet,nvar)
+double precision rtp(ncelet,nvar)
+
+! VARIABLES LOCALES
+
+integer icleps, iel, ivar, ivar1, ivar2, isou, ipp
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer iepip
+integer iclrij(6)
+double precision vmin, vmax, var, rijmin, varrel, und0, epz2
+
+!===============================================================================
+
+
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+iepip = iep(iphas)
+
+! Une petite valeur pour eviter des valeurs exactement nulles.
+
+epz2 = epzero**2
+
+!===============================================================================
+! ---> Stockage Min et Max pour listing
+!===============================================================================
+
+do isou = 1, 7
+ if (isou.eq.1) then
+ ivar = ir11ip
+ elseif(isou.eq.2) then
+ ivar = ir22ip
+ elseif(isou.eq.3) then
+ ivar = ir33ip
+ elseif(isou.eq.4) then
+ ivar = ir12ip
+ elseif(isou.eq.5) then
+ ivar = ir13ip
+ elseif(isou.eq.6) then
+ ivar = ir23ip
+ elseif(isou.eq.7) then
+ ivar = iepip
+ endif
+ ipp = ipprtp(ivar)
+
+ vmin = grand
+ vmax = -grand
+ do iel = 1, ncel
+ var = rtp(iel,ivar)
+ vmin = min(vmin,var)
+ vmax = max(vmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin(vmin)
+ !==========
+ call parmax(vmax)
+ !==========
+ endif
+ varmna(ipp) = vmin
+ varmxa(ipp) = vmax
+
+enddo
+
+! ---> Clipping (modif pour eviter les valeurs exactement nulles)
+
+if(iclip.eq.1) then
+
+ do isou = 1, 3
+
+ iclrij(isou) = 0
+
+ if(isou.eq.1) ivar=ir11ip
+ if(isou.eq.2) ivar=ir22ip
+ if(isou.eq.3) ivar=ir33ip
+
+ do iel = 1, ncel
+ if (abs(rtp(iel,ivar)).le.epz2) then
+ iclrij(isou) = iclrij(isou) + 1
+ rtp(iel,ivar) = max(rtp(iel,ivar),epz2)
+ elseif(rtp(iel,ivar).le.0.d0) then
+ iclrij(isou) = iclrij(isou) + 1
+ rtp(iel,ivar) = abs(rtp(iel,ivar))
+ endif
+ enddo
+
+ enddo
+
+ icleps = 0
+ do iel = 1, ncel
+ if (abs(rtp(iel,iepip)).le.epz2) then
+ icleps = icleps + 1
+ rtp(iel,iepip) = max(rtp(iel,iepip),epz2)
+ elseif(rtp(iel,iepip).le.0.d0) then
+ icleps = icleps + 1
+ rtp(iel,iepip) = abs(rtp(iel,iepip))
+ endif
+ enddo
+
+else
+
+ varrel = 1.1d0
+
+ do isou = 1, 3
+
+ iclrij(isou) = 0
+
+ if(isou.eq.1) ivar=ir11ip
+ if(isou.eq.2) ivar=ir22ip
+ if(isou.eq.3) ivar=ir33ip
+
+ do iel = 1, ncel
+ if (abs(rtp(iel,ivar)).le.epz2) then
+ iclrij(isou) = iclrij(isou) + 1
+ rtp(iel,ivar) = max(rtp(iel,ivar),epz2)
+ elseif(rtp(iel,ivar).le.0.d0) then
+ iclrij(isou) = iclrij(isou) + 1
+ rtp(iel,ivar) = &
+ min(abs(rtp(iel,ivar)), varrel*abs(rtpa(iel,ivar)))
+ endif
+ enddo
+
+ enddo
+
+ icleps = 0
+ do iel = 1, ncel
+ if (abs(rtp(iel,iepip)).lt.epz2) then
+ icleps = icleps + 1
+ rtp(iel,iepip) = max(rtp(iel,iepip),epz2)
+ elseif(rtp(iel,iepip).le.0.d0) then
+ icleps = icleps + 1
+ rtp(iel,iepip) = &
+ min(abs(rtp(iel,iepip )), varrel*abs(rtpa(iel,iepip )))
+ endif
+ enddo
+
+endif
+
+! On force l'inegalite de Cauchy Schwarz
+
+do isou = 4, 6
+
+ iclrij(isou) = 0
+
+ if(isou.eq.4) then
+ ivar = ir12ip
+ ivar1 = ir11ip
+ ivar2 = ir22ip
+ elseif(isou.eq.5) then
+ ivar = ir13ip
+ ivar1 = ir11ip
+ ivar2 = ir33ip
+ elseif(isou.eq.6) then
+ ivar = ir23ip
+ ivar1 = ir22ip
+ ivar2 = ir33ip
+ endif
+ und0 = 1.d0
+ do iel = 1 , ncel
+ rijmin = sqrt(rtp(iel,ivar1)*rtp(iel,ivar2))
+ if(rijmin.lt.abs(rtp(iel,ivar))) then
+ rtp(iel,ivar) = sign(und0,rtp(iel,ivar)) * rijmin
+ iclrij(isou) = iclrij(isou) + 1
+ endif
+ enddo
+
+enddo
+
+
+! ---> Stockage nb de clippings pour listing
+
+if (irangp.ge.0) then
+ call parcpt (iclrij(1))
+ !==========
+ call parcpt (iclrij(2))
+ !==========
+ call parcpt (iclrij(3))
+ !==========
+ call parcpt (iclrij(4))
+ !==========
+ call parcpt (iclrij(5))
+ !==========
+ call parcpt (iclrij(6))
+ !==========
+ call parcpt (icleps)
+ !==========
+endif
+
+iclpmn(ipprtp(ir11ip)) = iclrij(1)
+iclpmn(ipprtp(ir22ip)) = iclrij(2)
+iclpmn(ipprtp(ir33ip)) = iclrij(3)
+iclpmn(ipprtp(ir12ip)) = iclrij(4)
+iclpmn(ipprtp(ir13ip)) = iclrij(5)
+iclpmn(ipprtp(ir23ip)) = iclrij(6)
+iclpmn(ipprtp(iepip )) = icleps
+
+return
+
+end
diff --git a/src/base/clpsca.f90 b/src/base/clpsca.f90
new file mode 100644
index 0000000..3023a8d
--- /dev/null
+++ b/src/base/clpsca.f90
@@ -0,0 +1,242 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clpsca &
+!================
+
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , scandd , rtp )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CLIPPING
+! POUR UN SCALAIRE OU VARIANCE
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iscal ! e ! <-- ! numero du scalaire !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! scandd ! tr ! <-- ! scalaire auquel est associe la !
+! (ncelet) ! ! ! variance traitee (si c'en est une) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer nvar , nscal
+integer iscal
+
+double precision rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision scandd(ncelet)
+
+! VARIABLES LOCALES
+
+integer ivar, iel
+integer iclmax, iclmin, iiscav
+integer ippvar
+double precision vmin, vmax, vfmin, vfmax
+double precision scmax, scmin
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Numero de variable de calcul et de post associe au scalaire traite
+ivar = isca(iscal)
+ippvar = ipprtp(ivar)
+
+! --- Numero du scalaire eventuel associe dans le cas fluctuation
+iiscav = iscavr(iscal)
+
+!===============================================================================
+! 2. IMPRESSIONS ET CLIPPINGS
+!===============================================================================
+
+! IL Y A TOUJOURS CLIPPING DES VARIANCES A DES VALEURS POSITIVES
+
+! --- Calcul du min et max
+vmin = rtp(1,ivar)
+vmax = rtp(1,ivar)
+do iel = 1, ncel
+ vmin = min(vmin,rtp(iel,ivar))
+ vmax = max(vmax,rtp(iel,ivar))
+enddo
+if (irangp.ge.0) then
+ call parmin(vmin)
+ !==========
+ call parmax(vmax)
+ !==========
+endif
+varmna(ippvar) = vmin
+varmxa(ippvar) = vmax
+
+if(iiscav.eq.0) then
+
+! --- Clipping des scalaires non variances
+
+ iclmax = 0
+ iclmin = 0
+ if(scamax(iscal).gt.scamin(iscal))then
+ do iel = 1, ncel
+ if(rtp(iel,ivar).gt.scamax(iscal))then
+ iclmax = iclmax + 1
+ rtp(iel,ivar) = scamax(iscal)
+ endif
+ if(rtp(iel,ivar).lt.scamin(iscal))then
+ iclmin = iclmin + 1
+ rtp(iel,ivar) = scamin(iscal)
+ endif
+ enddo
+ endif
+
+ if (irangp.ge.0) then
+ call parcpt (iclmin)
+ !==========
+ call parcpt (iclmax)
+ !==========
+ endif
+
+ iclpmn(ippvar) = iclmin
+ iclpmx(ippvar) = iclmax
+
+else
+
+! --- Clipping des variances
+
+ iclmax = 0
+ iclmin = 0
+
+! -- Clipping minimal au minimum 0.
+ if(iclvfl(iscal).eq.0) then
+ do iel = 1, ncel
+ if(rtp(iel,ivar).lt.0.d0) then
+ iclmin = iclmin + 1
+ rtp(iel,ivar) = 0.d0
+ endif
+ enddo
+
+! -- Clipping a partir des valeurs du scalaire (ou 0 au min)
+ elseif(iclvfl(iscal).eq.1) then
+ do iel = 1, ncel
+ if(rtp(iel,ivar).lt.0.d0) then
+ iclmin = iclmin + 1
+ rtp(iel,ivar) = 0.d0
+ endif
+ enddo
+
+ scmax = scamax(iscavr(iscal))
+ scmin = scamin(iscavr(iscal))
+ do iel = 1, ncel
+ vfmax = (scandd(iel)-scmin)*(scmax-scandd(iel))
+ if(rtp(iel,ivar).gt.vfmax) then
+ iclmax = iclmax + 1
+ rtp(iel,ivar) = vfmax
+ endif
+ enddo
+
+! -- Clipping a partir des valeurs donnees par l'utilisateur
+! (ou 0 au min)
+ elseif(iclvfl(iscal).eq.2) then
+ vfmin = 0.d0
+ vfmin = max(scamin(iscal),vfmin)
+ vfmax = scamax(iscal)
+ if(vfmax.gt.vfmin)then
+ do iel = 1, ncel
+ if(rtp(iel,ivar).gt.vfmax)then
+ iclmax = iclmax + 1
+ rtp(iel,ivar) = vfmax
+ endif
+ if(rtp(iel,ivar).lt.vfmin)then
+ iclmin = iclmin + 1
+ rtp(iel,ivar) = vfmin
+ endif
+ enddo
+ endif
+ endif
+
+ if (irangp.ge.0) then
+ call parcpt (iclmin)
+ !==========
+ call parcpt (iclmax)
+ !==========
+ endif
+
+ iclpmn(ippvar) = iclmin
+ iclpmx(ippvar) = iclmax
+
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/clptrg.f90 b/src/base/clptrg.f90
new file mode 100644
index 0000000..fd9d135
--- /dev/null
+++ b/src/base/clptrg.f90
@@ -0,0 +1,1210 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clptrg &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , isvhb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefu , rijipb , coefa , coefb , uetbor , visvdr , &
+ hbord , thbord , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS LIMITES EN PAROI RUGUEUSE POUR TOUTES LES VARIABLES
+! DE LA PHASE IPHAS
+
+! ON SUPPOSE QUE ICODCL(IU) = 6 =>
+! PAROI RUGUEUSE POUR TOUTES LES VARIABLES TURBULENTES
+! (A PRIORI PEU RESTRICTIF EN MONOPHASIQUE)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! iphas ! e ! <-- ! numero de phase !
+! isvhb ! e ! <-- ! indicateur de sauvegarde des !
+! ! ! ! coefficients d'echange aux bords !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefu ! tr ! <-- ! tab de trav pour valeurs en iprime !
+! (nfabor,3 ) ! ! ! des comp de la vitesse au bord !
+! rijipb ! tr ! <-- ! tab de trav pour valeurs en iprime !
+! (nfabor,6 ) ! ! ! des rij au bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! uetbor ! tr ! --> ! vitesse de frottement au bord !
+! (nfabor,nphas ! ! ! pour van driest en les !
+! visvdr(nphas) ! tr ! <-- ! viscosite dynamique ds les cellules !
+! (ncelet,nphas ! ! ! de bord apres amortisst de v driest !
+! hbord ! tr ! --> ! coefficients d'echange aux bords !
+! (nfabor) ! ! ! !
+! thbord ! tr ! <-- ! temperature aux bords en i' !
+! (nfabor) ! ! ! (plus exactmt : var. energetique) !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "albase.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , isvhb
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefu(nfabor,ndim), rijipb(nfabor,6)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision uetbor(nfabor,nphas), visvdr(ncelet,nphas)
+double precision hbord(nfabor),thbord(nfabor)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ivar, isou, ii, jj, kk, ll, isvhbl
+integer ihcp, iscal
+integer modntl
+integer iuiptn
+integer iuiph , iviph , iwiph
+integer ikiph , iepiph, iphiph, ifbiph, iomgip
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer iclu , iclv , iclw , iclk , iclep
+integer icl11 , icl22 , icl33 , icl12 , icl13 , icl23
+integer icluf , iclvf , iclwf , iclphi, iclfb , iclomg
+integer ipcrom, ipcvis, ipcvst, ipccp , ipccv
+integer iclvar, ipcvsl, iclvaf
+integer iyplbp
+double precision rnx, rny, rnz, rxnn
+double precision tx, ty, tz, txn, txn0, t2x, t2y, t2z
+double precision utau, upx, upy, upz, usn
+double precision uiptn, uiptnf, uiptmn, uiptmx
+double precision uetmax, uetmin, ukmax, ukmin, yplumx, yplumn
+double precision uk, uet, tet, yplus
+double precision gredu, rib, lmo, q0, e0
+double precision cfnnu, cfnns, cfnnk, cfnne
+double precision sqrcmu, clsyme, ek
+double precision xmutlm
+double precision rcprod, rcflux
+double precision cpp, rkl, prdtl
+double precision hflui, hredui, hint, hext, pimp
+double precision und0, deuxd0
+double precision eloglo(3,3), alpha(6,6)
+double precision rcodcx, rcodcy, rcodcz, rcodsn
+double precision visclc, visctc, romc , distbf, srfbnf, cpscv
+double precision distbf0,rugd,rugt,ydep,act,uiptfn,uiptfx
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Constantes
+uet = 1.d0
+utau = 1.d0
+sqrcmu = sqrt(cmu)
+
+! --- Constantes de relaxation en atmosphere non neutre
+cfnnu=1.d0
+cfnns=1.d0
+cfnnk=1.d0
+cfnne=1.d0
+
+und0 = 1.d0
+deuxd0 = 2.d0
+
+! --- Variables
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+if(itytur(iphas).eq.2) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+elseif(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ iepiph = iep (iphas)
+elseif(iturb(iphas).eq.50) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+ iphiph = iphi(iphas)
+ ifbiph = ifb (iphas)
+elseif(iturb(iphas).eq.60) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+endif
+
+! --- Conditions aux limites
+iclu = iclrtp(iuiph ,icoef)
+iclv = iclrtp(iviph ,icoef)
+iclw = iclrtp(iwiph ,icoef)
+if(itytur(iphas).eq.2) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclep = iclrtp(iepiph,icoef)
+elseif(itytur(iphas).eq.3) then
+ icl11 = iclrtp(ir11ip,icoef)
+ icl22 = iclrtp(ir22ip,icoef)
+ icl33 = iclrtp(ir33ip,icoef)
+ icl12 = iclrtp(ir12ip,icoef)
+ icl13 = iclrtp(ir13ip,icoef)
+ icl23 = iclrtp(ir23ip,icoef)
+ iclep = iclrtp(iepiph,icoef)
+elseif(iturb(iphas).eq.50) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclep = iclrtp(iepiph,icoef)
+ iclphi = iclrtp(iphiph,icoef)
+ iclfb = iclrtp(ifbiph,icoef)
+elseif(iturb(iphas).eq.60) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclomg = iclrtp(iomgip,icoef)
+endif
+
+icluf = iclrtp(iuiph ,icoeff)
+iclvf = iclrtp(iviph ,icoeff)
+iclwf = iclrtp(iwiph ,icoeff)
+
+! --- Grandeurs physiques
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+else
+ ipccp = 0
+endif
+
+! --- Compressible
+
+if ( ippmod(icompf) .ge. 0 ) then
+ if(icv(iphas).gt.0) then
+ ipccv = ipproc(icv (iphas))
+ else
+ ipccv = 0
+ endif
+endif
+
+! --- Post traitement de Yplus
+iyplbp = iyplbr+(iphas-1)*nfabor
+
+
+! MIN ET MAX DE LA VITESSE TANGENTIELLE EN PAROI
+uiptmx = -grand
+uiptmn = grand
+
+! MIN ET MAX DE LA VITESSE DE FROTTEMENT EN PAROI
+uetmax = -grand
+uetmin = grand
+ukmax = -grand
+ukmin = grand
+
+! MIN ET MAX DE YPLUS
+yplumx = -grand
+yplumn = grand
+
+! COMPTEUR RETOURNEMENT
+
+iuiptn = 0
+
+
+! En v2f on met directement u=0 donc UIPTMX et UIPTMN vaudront
+! forcement 0
+if (iturb(iphas).eq.50) then
+ uiptmx = 0.d0
+ uiptmn = 0.d0
+endif
+
+! --- Boucle sur les faces : debut
+do ifac = 1, nfabor
+
+! --- Test sur la presence d'une condition de paroi rugueuse
+ if( icodcl(ifac,iuiph).eq.6 ) then
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visclc = propce(iel,ipcvis)
+ visctc = propce(iel,ipcvst)
+ romc = propce(iel,ipcrom)
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+ srfbnf = ra(isrfbn-1+ifac)
+
+!===============================================================================
+! 1. REPERE LOCAL
+!===============================================================================
+
+
+! ---> NORMALE UNITAIRE
+
+ rnx = surfbo(1,ifac)/srfbnf
+ rny = surfbo(2,ifac)/srfbnf
+ rnz = surfbo(3,ifac)/srfbnf
+
+! ---> PRISE EN COMPTE DE LA VITESSE DE DEFILEMENT
+
+ rcodcx = rcodcl(ifac,iuiph,1)
+ rcodcy = rcodcl(ifac,iviph,1)
+ rcodcz = rcodcl(ifac,iwiph,1)
+
+! Si on n'est pas en ALE, on force la vitesse de deplacement
+! de la face a etre tangentielle (et on met a jour rcodcl
+! pour une utilisation eventuelle)
+ if (iale.eq.0) then
+ rcodsn = rcodcx*rnx+rcodcy*rny+rcodcz*rnz
+ rcodcx = rcodcx -rcodsn*rnx
+ rcodcy = rcodcy -rcodsn*rny
+ rcodcz = rcodcz -rcodsn*rnz
+ rcodcl(ifac,iuiph,1) = rcodcx
+ rcodcl(ifac,iviph,1) = rcodcy
+ rcodcl(ifac,iwiph,1) = rcodcz
+ endif
+
+
+! ---> VITESSE TANGENTIELLE RELATIVE
+
+ upx = coefu(ifac,1) - rcodcx
+ upy = coefu(ifac,2) - rcodcy
+ upz = coefu(ifac,3) - rcodcz
+
+ usn = upx*rnx+upy*rny+upz*rnz
+ tx = upx -usn*rnx
+ ty = upy -usn*rny
+ tz = upz -usn*rnz
+ txn = sqrt( tx**2 +ty**2 +tz**2 )
+ utau= txn
+
+! ---> TANGENTE UNITAIRE
+
+ if( txn.ge.epzero) then
+
+ txn0 = 1.d0
+
+ tx = tx/txn
+ ty = ty/txn
+ tz = tz/txn
+
+ elseif(itytur(iphas).eq.3) then
+
+! SI LA VITESSE EST NULLE, LE VECTEUR T EST NORMAL ET QCQUE
+! ON EN A BESOIN POUR LE CHGT DE REPERE DE RIJ
+! ET ON ANNULERA LA VITESSE
+
+ txn0 = 0.d0
+
+ if(abs(rny).ge.epzero.or.abs(rnz).ge.epzero)then
+ rxnn = sqrt(rny**2+rnz**2)
+ tx = 0.d0
+ ty = rnz/rxnn
+ tz = -rny/rxnn
+ elseif(abs(rnx).ge.epzero.or.abs(rnz).ge.epzero)then
+ rxnn = sqrt(rnx**2+rnz**2)
+ tx = rnz/rxnn
+ ty = 0.d0
+ tz = -rnx/rxnn
+ else
+ write(nfecra,1000)ifac,rnx,rny,rnz
+ call csexit (1)
+ endif
+
+ else
+
+! SI LA VITESSE EST NULLE ET QU'ON N'EST PAS EN RIJ
+! TX, TY, TZ NE SERT PAS (ON ANNULE LA VITESSE)
+! ET ON LUI DONNE UNE VALEUR BIDON (NULLE PAR EXEMPLE)
+
+ txn0 = 0.d0
+
+ tx = 0.d0
+ ty = 0.d0
+ tz = 0.d0
+
+ endif
+
+! ---> ON COMPLETE EVENTUELLEMENT POUR LE RIJ-EPSILON
+
+ if (itytur(iphas).eq.3) then
+
+! --> T2 = RN X T (OU X EST LE PRODUIT VECTORIEL)
+
+
+ t2x = rny*tz - rnz*ty
+ t2y = rnz*tx - rnx*tz
+ t2z = rnx*ty - rny*tx
+
+! --> MATRICE ORTHOGONALE DE CHANGEMENT DE BASE ELOGLOij
+! (DE LA BASE LOCALE VERS LA BASE GLOBALE)
+
+! |TX -RNX T2X|
+! ELOGLO = |TY -RNY T2Y|
+! |TZ -RNZ T2Z|
+
+! SA TRANSPOSEE ELOGLOt EST SON INVERSE
+
+
+ eloglo(1,1) = tx
+ eloglo(1,2) = -rnx
+ eloglo(1,3) = t2x
+ eloglo(2,1) = ty
+ eloglo(2,2) = -rny
+ eloglo(2,3) = t2y
+ eloglo(3,1) = tz
+ eloglo(3,2) = -rnz
+ eloglo(3,3) = t2z
+
+! --> ON CALCULE ALPHA(6,6)
+
+! SOIT f LE CENTRE DE LA FACE DE BORD ET
+! I LE CENTRE DE LA CELLULE CORRESPONDANTE
+
+! EN NOTE RG (RESP RL) INDICE PAR f OU PAR I
+! LE TENSEUR DE REYNOLDS DANS LA BASE GLOBALE (RESP LOCALE)
+
+! LA MATRICE ALPHA APPLIQUEE AU VECTEUR GLOBAL EN I'
+! (RG11,I'|RG22,I'|RG33,I'|RG12,I'|RG13,I'|RG23,I')t
+! DOIT DONNER LES VALEURS A IMPOSER A LA FACE
+! (RG11,f |RG22,f |RG33,f |RG12,f |RG13,f |RG23,f )t
+! AUX CONDITIONS LIMITES DE DIRICHLET PRES (AJOUTEES ENSUITE)
+
+! ON LA DEFINIT EN CALCULANT RG,f EN FONCTION DE RG,I' COMME SUIT
+
+! RG,f = ELOGLO.RL,f.ELOGLOt (PRODUITS MATRICIELS)
+
+! | RL,I'(1,1) B*U*.Uk C*RL,I'(1,3) |
+! AVEC RL,f = | B*U*.Uk RL,I'(2,2) 0 |
+! | C*RL,I'(1,3) 0 RL,I'(3,3) |
+
+! AVEC RL,I = ELOGLOt.RG,I'.ELOGLO
+! B = 0
+! ET C = 0 EN PAROI (1 EN SYMETRIE)
+
+
+
+! ON CALCULE EN FAIT ELOGLO.PROJECTEUR.ELOGLOt
+
+
+ clsyme=0.d0
+ call clca66 ( clsyme , eloglo , alpha )
+ !==========
+
+ endif
+
+!===============================================================================
+! 2. VITESSES DE FROTTEMENT
+!==========================================================================
+
+! RUGD : rugosite de paroi pour les variables dynamiques
+! seule la valeur stockee pour IU est utilisee
+ rugd=rcodcl(ifac,iuiph,3)
+! NB: en rugueux la signification de yplus change !
+ yplus=distbf/rugd
+
+! PSEUDO DECALAGE DE LA PAROI de RUGD ((DISTBF+RUGD)/RUGD):
+ uet = utau/log(yplus+1.d0)*xkappa
+
+ if (ideuch(iphas).eq.0) then
+ uk = uet
+ else
+! Si IDEUCH=1 ou 2 on calcule uk et uet
+
+ if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ ek = rtp(iel,ikiph)
+ elseif(itytur(iphas).eq.3) then
+ ek = 0.5d0* &
+ (rtp(iel,ir11ip)+rtp(iel,ir22ip)+rtp(iel,ir33ip))
+ endif
+
+ uk = cmu025*sqrt(ek)
+
+ endif
+
+ if (ippmod(iatmos).ge.1) then
+
+ ! Compute reduced gravity for non horizontal walls :
+ gredu = gx*rnx + gy*rny + gz*rnz
+
+ call atmcls &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , ifac , iel , &
+ uk , utau , yplus , &
+ uet , &
+ gredu , q0 , e0 , rib ,lmo , &
+ cfnnu , cfnns , cfnnk , cfnne , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ if(ideuch(iphas).eq.0) then
+ uk = uet
+ endif
+
+ uetmax = max(uet,uetmax)
+ uetmin = min(uet,uetmin)
+ ukmax = max(uk,ukmax)
+ ukmin = min(uk,ukmin)
+ yplumx = max(yplus,yplumx)
+ yplumn = min(yplus,yplumn)
+
+! Sauvegarde de la vitesse de frottement et de la viscosite turbulente
+! apres amortissement de van Driest pour la LES
+! On n'amortit pas mu_t une seconde fois si on l'a deja fait
+! (car une cellule peut avoir plusieurs faces de paroi)
+
+ if(itytur(iphas).eq.4.and.idries(iphas).eq.1) then
+ uetbor(ifac,iphas) = uet
+ if (visvdr(iel,iphas).lt.-900.d0) then
+ propce(iel,ipcvst) = propce(iel,ipcvst)
+! NB amortissement de van Driest a revoir en rugueux :
+! & *(1.D0-EXP(-YPLUS/CDRIES(IPHAS)))**2
+ visvdr(iel,iphas) = propce(iel,ipcvst)
+ visctc = propce(iel,ipcvst)
+ endif
+ endif
+
+
+! Sauvegarde de yplus si post traite
+
+ if(mod(ipstdv,ipstyp).eq.0) then
+ ra(iyplbp+ifac-1) = yplus
+ endif
+
+
+!===============================================================================
+! 3. CONDITIONS AUX LIMITES SUR LA VITESSE
+!===============================================================================
+
+! UIPTN respecte la production de k
+! de facon conditionnelle --> Coef RCPROD
+! UIPTNF respecte le flux
+! de facon conditionnelle --> Coef RCFLUX
+
+! On traite tous les modeles de la meme maniere (a revisiter)
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.60 &
+ .or.iturb(iphas).eq.0 .or.iturb(iphas).eq.10.or. &
+ itytur(iphas).eq.3.or.itytur(iphas).eq.4) then
+
+! Pseudo decalage de la paroi de la distance RUGD :
+! modified for non neutral boundary layer (cfnnu)
+ distbf0=distbf+rugd
+ xmutlm = xkappa*uk*distbf0*romc
+
+ rcprod = max(distbf/distbf0, &
+ deuxd0*distbf*sqrt(xmutlm/visctc/distbf0**2) &
+ -1./(2.+rugd/distbf0))
+
+ rcflux = max(xmutlm,visctc)/(visclc+visctc)*distbf/distbf0
+
+ uiptn = min(utau,max(utau - uk/xkappa*rcprod*cfnnu,0.d0))
+ uiptnf = utau - uet/xkappa*rcflux*cfnnu
+
+! Clipping :
+! On borne U_f,grad entre 0 et Utau (il y a surement mieux...)
+! - 0 : on interdit le retournement en face de bord, qui est en
+! contradiction avec l'hypoth�se de loi log.
+! - Utau : la production turbulente ne peut etre nulle
+! On empeche U_f,flux d'etre negatif
+
+ if (uiptnf.lt.epzero) uiptnf = 0.d0
+
+ uiptmx = max(uiptn,uiptmx)
+ uiptmn = min(uiptn,uiptmn)
+
+ if(uiptn.lt.-epzero) iuiptn = iuiptn + 1
+
+ uiptfx = max(uiptnf,uiptfx)
+ uiptfn = min(uiptnf,uiptfn)
+ uetmax = max(uet,uetmax)
+ uetmin = min(uet,uetmin)
+ ukmax = max(uk,ukmax)
+ ukmin = min(uk,ukmin)
+
+ coefa(ifac,iclu) = uiptn *tx *txn0
+ coefa(ifac,iclv) = uiptn *ty *txn0
+ coefa(ifac,iclw) = uiptn *tz *txn0
+ coefa(ifac,icluf) = uiptnf*tx *txn0
+ coefa(ifac,iclvf) = uiptnf*ty *txn0
+ coefa(ifac,iclwf) = uiptnf*tz *txn0
+
+ coefa(ifac,iclu) = coefa(ifac,iclu) +rcodcx
+ coefa(ifac,iclv) = coefa(ifac,iclv) +rcodcy
+ coefa(ifac,iclw) = coefa(ifac,iclw) +rcodcz
+ coefa(ifac,icluf) = coefa(ifac,icluf) +rcodcx
+ coefa(ifac,iclvf) = coefa(ifac,iclvf) +rcodcy
+ coefa(ifac,iclwf) = coefa(ifac,iclwf) +rcodcz
+
+ coefb(ifac,iclu) = 0.d0
+ coefb(ifac,iclv) = 0.d0
+ coefb(ifac,iclw) = 0.d0
+ coefb(ifac,icluf) = 0.d0
+ coefb(ifac,iclvf) = 0.d0
+ coefb(ifac,iclwf) = 0.d0
+
+
+ elseif(iturb(iphas).eq.50) then
+
+! Avec ces conditions, pas besoin de calculer UIPTMX, UIPTMN
+! et IUIPTN qui sont nuls (valeur d'initialisation)
+
+ coefa(ifac,iclu) = rcodcx
+ coefa(ifac,iclv) = rcodcy
+ coefa(ifac,iclw) = rcodcz
+
+ coefb(ifac,iclu) = 0.d0
+ coefb(ifac,iclv) = 0.d0
+ coefb(ifac,iclw) = 0.d0
+
+ endif
+
+!===============================================================================
+! 4. CONDITIONS AUX LIMITES SUR K ET EPSILON
+!===============================================================================
+
+ ydep = distbf*0.5d0+rugd
+ if (itytur(iphas).eq.2) then
+
+ coefa(ifac,iclk) = uk**2/sqrcmu*cfnnk
+ coefb(ifac,iclk) = 0.d0
+
+ coefa(ifac,iclep) = uk**3/(xkappa*ydep**2)*distbf*cfnne
+ coefb(ifac,iclep) = 1.d0
+
+!===============================================================================
+! 5. CONDITIONS AUX LIMITES SUR RIJ ET EPSILON
+!===============================================================================
+
+ elseif (itytur(iphas).eq.3) then
+
+! ---> TENSEUR RIJ (PARTIELLEMENT IMPLICITE)
+
+ do isou = 1, 6
+
+ if(isou.eq.1) iclvar = icl11
+ if(isou.eq.2) iclvar = icl22
+ if(isou.eq.3) iclvar = icl33
+ if(isou.eq.4) iclvar = icl12
+ if(isou.eq.5) iclvar = icl13
+ if(isou.eq.6) iclvar = icl23
+
+ coefa(ifac,iclvar) = 0.0d0
+ coefb(ifac,iclvar) = 0.0d0
+
+ enddo
+
+ do isou = 1,6
+
+ if(isou.eq.1) then
+ iclvar = icl11
+ jj = 1
+ kk = 1
+ else if(isou.eq.2) then
+ iclvar = icl22
+ jj = 2
+ kk = 2
+ else if(isou.eq.3) then
+ iclvar = icl33
+ jj = 3
+ kk = 3
+ else if(isou.eq.4) then
+ iclvar = icl12
+ jj = 1
+ kk = 2
+ else if(isou.eq.5) then
+ iclvar = icl13
+ jj = 1
+ kk = 3
+ else if(isou.eq.6) then
+ iclvar = icl23
+ jj = 2
+ kk = 3
+ endif
+
+ if (iclptr(iphas).eq.1) then
+ do ii = 1, 6
+ if(ii.ne.isou) then
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) + &
+ alpha(isou,ii) * rijipb(ifac,ii)
+ endif
+ enddo
+ coefb(ifac,iclvar) = alpha(isou,isou)
+ else
+ do ii = 1, 6
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) + &
+ alpha(isou,ii) * rijipb(ifac,ii)
+ enddo
+ coefb(ifac,iclvar) = 0.d0
+ endif
+
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) - &
+ (eloglo(jj,1)*eloglo(kk,2)+ &
+ eloglo(jj,2)*eloglo(kk,1))*uet*uk*cfnnk
+
+ enddo
+
+! ---> SCALAIRE EPSILON
+! on traite comme en k-eps
+
+
+ coefa(ifac,iclep) = uk**3/(xkappa*ydep**2)*distbf*cfnne
+ coefb(ifac,iclep) = 1.d0
+
+!===============================================================================
+! 6. CONDITIONS AUX LIMITES SUR K, EPSILON, F_BARRE ET PHI
+!===============================================================================
+
+ elseif (iturb(iphas).eq.50) then
+
+ coefa(ifac,iclk) = 0.d0
+ coefb(ifac,iclk) = 0.d0
+ coefa(ifac,iclep) = &
+ 2.0d0*propce(iel,ipcvis)/propce(iel,ipcrom) &
+ *rtp(iel,ikiph)/distbf**2
+ coefb(ifac,iclep) = 0.d0
+ coefa(ifac,iclphi) = 0.0d0
+ coefb(ifac,iclphi) = 0.0d0
+ coefa(ifac,iclfb) = 0.0d0
+ coefb(ifac,iclfb) = 0.0d0
+!===============================================================================
+! 7. CONDITIONS AUX LIMITES SUR K ET OMEGA
+!===============================================================================
+
+ elseif (iturb(iphas).eq.60) then
+
+! on est toujours hors de la sous couche visqeuse
+ coefa(ifac,iclk) = uk**2/sqrcmu
+ coefb(ifac,iclk) = 0.d0
+ coefa(ifac,iclomg) = distbf*4.d0*uk**3*romc**2/ &
+ (sqrcmu*xkappa*visclc**2*yplus**2)
+ coefb(ifac,iclomg) = 1.d0
+
+ endif
+
+!===============================================================================
+! 8. CONDITIONS AUX LIMITES SUR LES SCALAIRES
+! (AUTRES QUE PRESSION, K, EPSILON, RIJ, VARIANCES)
+! Pour les variances, pas de traitement specifique en paroi : voir
+! condli.
+!===============================================================================
+
+ if(nscal.ge.1) then
+
+ do ll = 1, nscal
+
+ if(iphsca(ll).eq.iphas.and.iscavr(ll).le.0) then
+
+ ivar = isca(ll)
+ iclvar = iclrtp(ivar,icoef)
+ iclvaf = iclrtp(ivar,icoeff)
+
+ isvhbl = 0
+ if(ll.eq.isvhb) then
+ isvhbl = isvhb
+ endif
+
+ ihcp = 0
+ iscal = ll
+ if(iscsth(iscal).eq.0.or.iscsth(iscal).eq.2 &
+ .or.iscsth(iscal).eq.3) then
+ ihcp = 0
+ elseif(abs(iscsth(iscal)).eq.1) then
+ if(ipccp.gt.0) then
+ ihcp = 2
+ else
+ ihcp = 1
+ endif
+ endif
+
+ cpp = 1.d0
+ if(ihcp.eq.0) then
+ cpp = 1.d0
+ elseif(ihcp.eq.2) then
+ cpp = propce(iel,ipccp )
+ elseif(ihcp.eq.1) then
+ cpp = cp0(iphas)
+ endif
+ hint = cpp
+
+ if(ivisls(ll).gt.0) then
+ ipcvsl = ipproc(ivisls(ll))
+ else
+ ipcvsl = 0
+ endif
+ if (ipcvsl.le.0) then
+ rkl = visls0(ll)
+ prdtl = visclc/rkl
+ else
+ rkl = propce(iel,ipcvsl)
+ prdtl = visclc/rkl
+ endif
+
+! Compressible : On suppose que le nombre de Pr doit etre
+! defini de la meme fa�on que l'on resolve
+! en enthalpie ou en energie, soit Mu*Cp/Lambda.
+! Si l'on resout en energie, on a calcule ci-dessus
+! Mu*Cv/Lambda.
+
+ if ( ippmod(icompf).ge.0 ) then
+ if(iscsth(iscal).eq.3) then
+ if(ipccp.gt.0) then
+ prdtl = prdtl*propce(iel,ipccp )
+ else
+ prdtl = prdtl*cp0(iphas)
+ endif
+ if(ipccv.gt.0) then
+ prdtl = prdtl/propce(iel,ipccv )
+ else
+ prdtl = prdtl/cv0(iphas)
+ endif
+ endif
+ endif
+
+! CAS TURBULENT
+ if (iturb(iphas).ne.0) then
+ if ( ippmod(icompf) .ge. 0 ) then
+! En compressible, pour l'energie LAMBDA/CV+CP/CV*(MUT/SIGMAS)
+ if(ipccp.gt.0) then
+ cpscv = propce(iel,ipproc(icp(iphas)))
+ else
+ cpscv = cp0(iphas)
+ endif
+ if(ipccv.gt.0) then
+ cpscv = cpscv/propce(iel,ipproc(icv(iphas)))
+ else
+ cpscv = cpscv/cv0(iphas)
+ endif
+ hint = hint*(rkl+cpscv*visctc/sigmas(ll))/distbf
+ else
+ hint = hint*(rkl+visctc/sigmas(ll))/distbf
+ endif
+! CAS LAMINAIRE
+ else
+ hint = hint*rkl/distbf
+ endif
+
+ if(iturb(iphas).ne.0.and.icodcl(ifac,ivar).eq.6)then
+
+! Loi rugueuse, on recalcule le coefficient d'echange fluide - paroi
+ rugt=rcodcl(ifac,ivar,3)
+ act = xkappa/log((distbf+rugt)/rugt)
+ hflui = romc*cpp*uet*act*cfnns
+ else
+ hflui = hint
+ endif
+
+ if (isvhbl .gt. 0) hbord(ifac) = hflui
+
+
+
+! ---> C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+
+! Si on a deux types de conditions aux limites (ICLVAR, ICLVAF)
+! il faut que le flux soit traduit par ICLVAF.
+! Si on n'a qu'un type de condition, peu importe (ICLVAF=ICLVAR)
+! Pour le moment, dans cette version compressible, on impose un
+! flux nul pour ICLVAR, lorsqu'il est diff�rent de ICLVAF (cette
+! condition ne sert qu'� la reconstruction des gradients et
+! s'applique � l'energie totale qui inclut l'energie cin�tique :
+
+
+ if( icodcl(ifac,ivar).eq.6 ) then
+ hext = rcodcl(ifac,ivar,2)
+ pimp = rcodcl(ifac,ivar,1)
+ hredui = hint/hflui
+ coefa(ifac,iclvaf) = hext*pimp/(hint+hext*hredui)
+ coefb(ifac,iclvaf) = (hint-(1.d0-hredui)*hext)/ &
+ (hint+hext*hredui)
+ if(iclvar.ne.iclvaf) then
+ coefa(ifac,iclvar) = 0.d0
+ coefb(ifac,iclvar) = 1.d0
+ endif
+
+!--> Rayonnement :
+
+! On stocke le coefficient d'echange lambda/distance
+! (ou son equivalent en turbulent) quelle que soit la
+! variable thermique transportee (temperature ou enthalpie)
+! car on l'utilise pour realiser des bilans aux parois qui
+! sont faits en temperature (on cherche la temperature de
+! paroi quelle que soit la variable thermique transportee pour
+! ecrire des eps sigma T4.
+
+! donc :
+
+! lorsque la variable transportee est la temperature
+! ABS(ISCSTH(II)).EQ.1 : RA(IHCONV-1+IFAC+NFABOR*(IPH-1)) = HINT
+! puisque HINT = VISLS * CP / DISTBR
+! = lambda/distance en W/(m2 K)
+
+! lorsque la variable transportee est l'enthalpie
+! ISCSTH(II).EQ.2 : RA(IHCONV-1+IFAC+NFABOR*(IPH-1)) = HINT*CPR
+! avec
+! IF(IPCCP.GT.0) THEN
+! CPR = PROPCE(IEL,IPCCP )
+! ELSE
+! CPR = CP0(IPHAS)
+! ENDIF
+! puisque HINT = VISLS / DISTBR
+! = lambda/(CP * distance)
+
+! lorsque la variable transportee est l'energie (compressible)
+! ISCSTH(II).EQ.3 :
+! on procede comme pour l'enthalpie avec CV au lieu de CP
+! (rq : il n'y a pas d'hypoth�se, sf en non orthogonal :
+! le flux est le bon et le coef d'echange aussi)
+
+! De meme dans condli.
+
+
+
+! Si on rayonne sur la phase et que
+! le scalaire est la variable energetique
+
+ if (iirayo.ge.1 .and. &
+ ll.eq.iscalt(iphas) .and. iphas.eq.irapha ) then
+
+! On calcule le coefficient d'echange en W/(m2 K)
+
+! Si on resout en enthalpie
+ if(iscsth(ll).eq.2) then
+! Si Cp variable
+ if(ipccp.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hflui*propce(iel,ipccp )
+ else
+ propfb(ifac,ipprob(ihconv)) = hflui*cp0(iphas)
+ endif
+
+! Si on resout en energie (compressible)
+ elseif(iscsth(ll).eq.3) then
+! Si Cv variable
+ if(ipccv.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hflui*propce(iel,ipccv )
+ else
+ propfb(ifac,ipprob(ihconv)) = hflui*cv0(iphas)
+ endif
+
+! Si on resout en temperature
+ elseif(abs(iscsth(ll)).eq.1) then
+ propfb(ifac,ipprob(ihconv)) = hflui
+ endif
+
+! On recupere le flux h(Ti'-Tp) (sortant ou
+! negatif si gain pour le fluide) en W/m2
+
+ propfb(ifac,ipprob(ifconv)) = &
+ hint*( (1.d0-coefb(ifac,iclvaf))*thbord(ifac) &
+ - coefa(ifac,iclvaf))
+ endif
+
+ endif
+
+! ---> C.L DE TYPE FLUX : VOIR CONDLI
+
+ endif
+
+ enddo
+
+ endif
+
+
+ endif
+! --- Test sur la presence d'une condition de paroi vitesse : fin
+
+
+
+enddo
+! --- Boucle sur les faces : fin
+
+if (irangp.ge.0) then
+ call parmin (uiptmn)
+ !==========
+ call parmax (uiptmx)
+ !==========
+ call parmin (uetmin)
+ !==========
+ call parmax (uetmax)
+ !==========
+ call parmin (ukmin)
+ !==========
+ call parmax (ukmax)
+ !==========
+ call parmin (yplumn)
+ !==========
+ call parmax (yplumx)
+ !==========
+ call parcpt (iuiptn)
+ !==========
+endif
+
+!===============================================================================
+! 9. IMPRESSIONS
+!===============================================================================
+
+! Remarque : afin de ne pas surcharger les listings dans le cas ou
+! quelques yplus ne sont pas corrects, on ne produit le message
+! qu'aux deux premiers pas de temps ou le message apparait et
+! aux deux derniers pas de temps du calcul, ou si IWARNI est >= 2
+! On indique aussi le numero du dernier pas de temps auquel on
+! a rencontre des yplus hors bornes admissibles
+
+if(iwarni(iuiph).ge.0) then
+ if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+ elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+ else
+ modntl = 1
+ endif
+
+ if (modntl.eq.0 .or. iwarni(iuiph).ge.2) then
+ write(nfecra,2010) iphas, &
+ uiptmn,uiptmx,uetmin,uetmax,ukmin,ukmax,yplumn,yplumx, &
+ iuiptn
+ endif
+
+endif
+
+!===============================================================================
+! 10. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' LA NORMALE A LA FACE DE BORD DE PAROI ',I10,/, &
+ ' EST NULLE ; COORDONNEES : ',3E12.5)
+
+ 2010 format(/, &
+ 3X,'** CONDITIONS AUX LIMITES EN PAROI RUGUEUSE',/, &
+ ' -------------------------------------------',/, &
+ '------------------------------------------------------------',/,&
+ ' Phase ',I6,' Minimum Maximum',/,&
+ '------------------------------------------------------------',/,&
+ ' Vitesse rel. en paroi uiptn : ',2E12.5 ,/,&
+ ' Vitesse de frottement uet : ',2E12.5 ,/,&
+ ' Vitesse de frottement uk : ',2E12.5 ,/,&
+ ' Distance adim. rugueuse yplus : ',2E12.5 ,/,&
+ ' ------------------------------------------------------ ',/,&
+ ' Nbre de retournements de la vitesse en paroi : ',I10 ,/,&
+ '------------------------------------------------------------', &
+ /,/)
+
+
+#else
+
+ 1000 format(/,' THE NORMAL TO THE WALL BOUNDARY FACE ',I10,/, &
+ ' IS NULL; COORDINATES: ',3E12.5)
+
+ 2010 format(/, &
+ 3X,'** BOUNDARY CONDITIONS FOR ROUGH WALLS',/, &
+ ' --------------------------------------',/, &
+ '------------------------------------------------------------',/,&
+ ' Phase ',I6,' Minimum Maximum',/,&
+ '------------------------------------------------------------',/,&
+ ' Rel velocity at the wall uiptn : ',2E12.5 ,/,&
+ ' Friction velocity uet : ',2E12.5 ,/,&
+ ' Friction velocity uk : ',2E12.5 ,/,&
+ ' Rough dimensionless dist yplus : ',2E12.5 ,/,&
+ ' ------------------------------------------------------ ',/,&
+ ' Nb of reversal of the velocity at the wall : ',I10 ,/,&
+ '------------------------------------------------------------', &
+ /,/)
+
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/clptur.f90 b/src/base/clptur.f90
new file mode 100644
index 0000000..2adc141
--- /dev/null
+++ b/src/base/clptur.f90
@@ -0,0 +1,1539 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clptur &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , isvhb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefu , rijipb , coefa , coefb , uetbor , visvdr , &
+ hbord , thbord , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS LIMITES EN PAROI TURBULENTE POUR TOUTES LES VARIABLES
+! DE LA PHASE IPHAS
+
+! ON SUPPOSE QUE ICODCL(IU) = 5 =>
+! PAROI POUR TOUTES LES VARIABLES TURBULENTES
+! (A PRIORI PEU RESTRICTIF EN MONOPHASIQUE)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! iphas ! e ! <-- ! numero de phase !
+! isvhb ! e ! <-- ! indicateur de sauvegarde des !
+! ! ! ! coefficients d'echange aux bords !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefu ! tr ! <-- ! tab de trav pour valeurs en iprime !
+! (nfabor,3 ) ! ! ! des comp de la vitesse au bord !
+! rijipb ! tr ! <-- ! tab de trav pour valeurs en iprime !
+! (nfabor,6 ) ! ! ! des rij au bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! uetbor ! tr ! --> ! vitesse de frottement au bord !
+! (nfabor,nphas ! ! ! pour van driest en les !
+! visvdr(nphas) ! tr ! <-- ! viscosite dynamique ds les cellules !
+! (ncelet,nphas ! ! ! de bord apres amortisst de v driest !
+! hbord ! tr ! --> ! coefficients d'echange aux bords !
+! (nfabor) ! ! ! !
+! thbord ! tr ! <-- ! temperature aux bords en i' !
+! (nfabor) ! ! ! (plus exactmt : var. energetique) !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "albase.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , isvhb
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefu(nfabor,ndim), rijipb(nfabor,6)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision uetbor(nfabor,nphas), visvdr(ncelet,nphas)
+double precision hbord(nfabor),thbord(nfabor)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ivar, isou, ii, jj, kk, ll, isvhbl
+integer ihcp, iscal
+integer imprim, modntl
+integer inturb, inlami, iuiptn
+integer iuiph , iviph , iwiph
+integer ikiph , iepiph, iphiph, ifbiph, iomgip
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer iclu , iclv , iclw , iclk , iclep
+integer icl11 , icl22 , icl33 , icl12 , icl13 , icl23
+integer icluf , iclvf , iclwf , iclphi, iclfb , iclomg
+integer ipcrom, ipcvis, ipcvst, ipccp , ipccv
+integer iclvar, ipcvsl, iclvaf
+integer iyplbp
+double precision rnx, rny, rnz, rxnn
+double precision tx, ty, tz, txn, txn0, t2x, t2y, t2z
+double precision utau, upx, upy, upz, usn
+double precision uiptn, uiptnf, uiptmn, uiptmx
+double precision uetmax, uetmin, ukmax, ukmin, yplumx, yplumn
+double precision uk, uet, nusury, yplus, unturb, dplus
+double precision sqrcmu, clsyme, ek
+double precision xnuii, xmutlm
+double precision rcprod, rcflux
+double precision cpp, rkl, prdtl
+double precision hflui, hredui, hint, hext, pimp
+double precision und0, deuxd0
+double precision eloglo(3,3), alpha(6,6)
+double precision rcodcx, rcodcy, rcodcz, rcodsn
+double precision visclc, visctc, romc , distbf, srfbnf, cpscv
+
+integer ntlast , iaff
+data ntlast , iaff /-1 , 0/
+save ntlast , iaff
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Constantes
+uet = 1.d0
+utau = 1.d0
+sqrcmu = sqrt(cmu)
+
+und0 = 1.d0
+deuxd0 = 2.d0
+
+! --- Variables
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+if(itytur(iphas).eq.2) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+elseif(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ iepiph = iep (iphas)
+elseif(iturb(iphas).eq.50) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+ iphiph = iphi(iphas)
+ ifbiph = ifb (iphas)
+elseif(iturb(iphas).eq.60) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+endif
+
+! --- Conditions aux limites
+iclu = iclrtp(iuiph ,icoef)
+iclv = iclrtp(iviph ,icoef)
+iclw = iclrtp(iwiph ,icoef)
+if(itytur(iphas).eq.2) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclep = iclrtp(iepiph,icoef)
+elseif(itytur(iphas).eq.3) then
+ icl11 = iclrtp(ir11ip,icoef)
+ icl22 = iclrtp(ir22ip,icoef)
+ icl33 = iclrtp(ir33ip,icoef)
+ icl12 = iclrtp(ir12ip,icoef)
+ icl13 = iclrtp(ir13ip,icoef)
+ icl23 = iclrtp(ir23ip,icoef)
+ iclep = iclrtp(iepiph,icoef)
+elseif(iturb(iphas).eq.50) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclep = iclrtp(iepiph,icoef)
+ iclphi = iclrtp(iphiph,icoef)
+ iclfb = iclrtp(ifbiph,icoef)
+elseif(iturb(iphas).eq.60) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclomg = iclrtp(iomgip,icoef)
+endif
+
+icluf = iclrtp(iuiph ,icoeff)
+iclvf = iclrtp(iviph ,icoeff)
+iclwf = iclrtp(iwiph ,icoeff)
+
+! --- Grandeurs physiques
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+else
+ ipccp = 0
+endif
+
+! --- Compressible
+
+if ( ippmod(icompf) .ge. 0 ) then
+ if(icv(iphas).gt.0) then
+ ipccv = ipproc(icv (iphas))
+ else
+ ipccv = 0
+ endif
+endif
+
+! --- Post traitement de Yplus
+iyplbp = iyplbr+(iphas-1)*nfabor
+
+
+! MIN ET MAX DE LA VITESSE TANGENTIELLE EN PAROI
+uiptmx = -grand
+uiptmn = grand
+
+! MIN ET MAX DE LA VITESSE DE FROTTEMENT EN PAROI
+uetmax = -grand
+uetmin = grand
+ukmax = -grand
+ukmin = grand
+
+! MIN ET MAX DE YPLUS
+yplumx = -grand
+yplumn = grand
+
+! COMPTEURS (TURBULENT, LAMINAIRE, RETOURNEMENT, CORRECTION
+! D'ECHELLE )
+inturb = 0
+inlami = 0
+iuiptn = 0
+
+
+! En v2f on met directement u=0 donc UIPTMX et UIPTMN vaudront
+! forcement 0
+if (iturb(iphas).eq.50) then
+ uiptmx = 0.d0
+ uiptmn = 0.d0
+endif
+
+! --- Boucle sur les faces : debut
+do ifac = 1, nfabor
+
+! --- Test sur la presence d'une condition de paroi vitesse : debut
+ if( icodcl(ifac,iuiph).eq.5 ) then
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visclc = propce(iel,ipcvis)
+ visctc = propce(iel,ipcvst)
+ romc = propce(iel,ipcrom)
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+ srfbnf = ra(isrfbn-1+ifac)
+
+!===============================================================================
+! 1. REPERE LOCAL
+!===============================================================================
+
+
+! ---> NORMALE UNITAIRE
+
+ rnx = surfbo(1,ifac)/srfbnf
+ rny = surfbo(2,ifac)/srfbnf
+ rnz = surfbo(3,ifac)/srfbnf
+
+! ---> PRISE EN COMPTE DE LA VITESSE DE DEFILEMENT
+
+ rcodcx = rcodcl(ifac,iuiph,1)
+ rcodcy = rcodcl(ifac,iviph,1)
+ rcodcz = rcodcl(ifac,iwiph,1)
+
+! Si on n'est pas en ALE, on force la vitesse de deplacement
+! de la face a etre tangentielle (et on met a jour rcodcl
+! pour une utilisation eventuelle)
+ if (iale.eq.0) then
+ rcodsn = rcodcx*rnx+rcodcy*rny+rcodcz*rnz
+ rcodcx = rcodcx -rcodsn*rnx
+ rcodcy = rcodcy -rcodsn*rny
+ rcodcz = rcodcz -rcodsn*rnz
+ rcodcl(ifac,iuiph,1) = rcodcx
+ rcodcl(ifac,iviph,1) = rcodcy
+ rcodcl(ifac,iwiph,1) = rcodcz
+ endif
+
+
+! ---> VITESSE TANGENTIELLE RELATIVE
+
+ upx = coefu(ifac,1) - rcodcx
+ upy = coefu(ifac,2) - rcodcy
+ upz = coefu(ifac,3) - rcodcz
+
+ usn = upx*rnx+upy*rny+upz*rnz
+ tx = upx -usn*rnx
+ ty = upy -usn*rny
+ tz = upz -usn*rnz
+ txn = sqrt( tx**2 +ty**2 +tz**2 )
+ utau= txn
+
+! ---> TANGENTE UNITAIRE
+
+ if( txn.ge.epzero) then
+
+ txn0 = 1.d0
+
+ tx = tx/txn
+ ty = ty/txn
+ tz = tz/txn
+
+ elseif(itytur(iphas).eq.3) then
+
+! SI LA VITESSE EST NULLE, LE VECTEUR T EST NORMAL ET QCQUE
+! ON EN A BESOIN POUR LE CHGT DE REPERE DE RIJ
+! ET ON ANNULERA LA VITESSE
+
+ txn0 = 0.d0
+
+ if(abs(rny).ge.epzero.or.abs(rnz).ge.epzero)then
+ rxnn = sqrt(rny**2+rnz**2)
+ tx = 0.d0
+ ty = rnz/rxnn
+ tz = -rny/rxnn
+ elseif(abs(rnx).ge.epzero.or.abs(rnz).ge.epzero)then
+ rxnn = sqrt(rnx**2+rnz**2)
+ tx = rnz/rxnn
+ ty = 0.d0
+ tz = -rnx/rxnn
+ else
+ write(nfecra,1000)ifac,rnx,rny,rnz
+ call csexit (1)
+ endif
+
+ else
+
+! SI LA VITESSE EST NULLE ET QU'ON N'EST PAS EN RIJ
+! TX, TY, TZ NE SERT PAS (ON ANNULE LA VITESSE)
+! ET ON LUI DONNE UNE VALEUR BIDON (NULLE PAR EXEMPLE)
+
+ txn0 = 0.d0
+
+ tx = 0.d0
+ ty = 0.d0
+ tz = 0.d0
+
+ endif
+
+! ---> ON COMPLETE EVENTUELLEMENT POUR LE RIJ-EPSILON
+
+ if (itytur(iphas).eq.3) then
+
+! --> T2 = RN X T (OU X EST LE PRODUIT VECTORIEL)
+
+
+ t2x = rny*tz - rnz*ty
+ t2y = rnz*tx - rnx*tz
+ t2z = rnx*ty - rny*tx
+
+! --> MATRICE ORTHOGONALE DE CHANGEMENT DE BASE ELOGLOij
+! (DE LA BASE LOCALE VERS LA BASE GLOBALE)
+
+! |TX -RNX T2X|
+! ELOGLO = |TY -RNY T2Y|
+! |TZ -RNZ T2Z|
+
+! SA TRANSPOSEE ELOGLOt EST SON INVERSE
+
+
+ eloglo(1,1) = tx
+ eloglo(1,2) = -rnx
+ eloglo(1,3) = t2x
+ eloglo(2,1) = ty
+ eloglo(2,2) = -rny
+ eloglo(2,3) = t2y
+ eloglo(3,1) = tz
+ eloglo(3,2) = -rnz
+ eloglo(3,3) = t2z
+
+! --> ON CALCULE ALPHA(6,6)
+
+! SOIT f LE CENTRE DE LA FACE DE BORD ET
+! I LE CENTRE DE LA CELLULE CORRESPONDANTE
+
+! EN NOTE RG (RESP RL) INDICE PAR f OU PAR I
+! LE TENSEUR DE REYNOLDS DANS LA BASE GLOBALE (RESP LOCALE)
+
+! LA MATRICE ALPHA APPLIQUEE AU VECTEUR GLOBAL EN I'
+! (RG11,I'|RG22,I'|RG33,I'|RG12,I'|RG13,I'|RG23,I')t
+! DOIT DONNER LES VALEURS A IMPOSER A LA FACE
+! (RG11,f |RG22,f |RG33,f |RG12,f |RG13,f |RG23,f )t
+! AUX CONDITIONS LIMITES DE DIRICHLET PRES (AJOUTEES ENSUITE)
+
+! ON LA DEFINIT EN CALCULANT RG,f EN FONCTION DE RG,I' COMME SUIT
+
+! RG,f = ELOGLO.RL,f.ELOGLOt (PRODUITS MATRICIELS)
+
+! | RL,I'(1,1) B*U*.Uk C*RL,I'(1,3) |
+! AVEC RL,f = | B*U*.Uk RL,I'(2,2) 0 |
+! | C*RL,I'(1,3) 0 RL,I'(3,3) |
+
+! AVEC RL,I = ELOGLOt.RG,I'.ELOGLO
+! B = 0
+! ET C = 0 EN PAROI (1 EN SYMETRIE)
+
+
+
+! ON CALCULE EN FAIT ELOGLO.PROJECTEUR.ELOGLOt
+
+
+ clsyme=0.d0
+ call clca66 ( clsyme , eloglo , alpha )
+ !==========
+
+ endif
+
+!===============================================================================
+! 2. VITESSES DE FROTTEMENT
+!===============================================================================
+
+! ---> ON CALCULE UET SUIVANT SI ON EST DANS LA ZONE LOG OU NON
+! EN UNE OU DEUX ECHELLES DE VITESSE
+! ET UK A PARTIR DE EK
+
+ nusury = visclc/(distbf*romc)
+! PSEUDO DECALAGE DE LA PAROI QUAND IDEUCH = 2
+ dplus = 0.d0
+
+ if (ideuch(iphas).eq.0) then
+
+ if(ilogpo(iphas).eq.0) then
+! AVEC LOI EN PUISSANCE (WERNER & WENGLE)
+ uet = (utau/(apow*(1.0d0/nusury)**bpow))**dpow
+ else
+! AVEC LOI LOG
+ imprim = max(iwarni(iuiph),2)
+ xnuii = visclc/romc
+ call causta &
+ !==========
+ ( ifac , imprim , xkappa , cstlog , ypluli(iphas) , &
+ apow , bpow , dpow , &
+ utau , distbf , xnuii , uet )
+ endif
+
+! On reprend les deux lignes suivantes apres
+! l'appel eventuel a la fonction utilisateur
+ uk = uet
+ yplus = uk/nusury
+
+ else
+! Si IDEUCH=1 ou 2 on calcule uk et uet
+
+ if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ ek = rtp(iel,ikiph)
+ elseif(itytur(iphas).eq.3) then
+ ek = 0.5d0* &
+ (rtp(iel,ir11ip)+rtp(iel,ir22ip)+rtp(iel,ir33ip))
+ endif
+
+ uk = cmu025*sqrt(ek)
+ yplus = uk/nusury
+ uet = utau/(log(yplus)/xkappa+cstlog)
+
+ endif
+
+ if(ideuch(iphas).eq.0) then
+ uk = uet
+ yplus = uk/nusury
+ endif
+
+! ---> ON TRAITE LES CAS OU YPLUS TEND VERS ZERO
+! En une echelle, CAUSTA calcule d'abord u* en supposant une loi lineaire,
+! puis si necessaire teste une loi log. Mais comme YPLULI est fixe a 1/kappa et pas
+! 10,88 (valeur de continuite), la loi log peut donner une valeur de u* qui redonne
+! un y+<YPLULI. Dans ce cas, on recalcule u* et y+ a partir de la loi lineaire : on
+! obtient un y+ superieur a YPLULI, mais le frottement est sans doute correct.
+! -> travail en cours sur les lois de paroi
+
+ if (yplus.gt.ypluli(iphas)) then
+
+! On est hors ss couche visqueuse : uet, uk et yplus sont bons
+ unturb = 1.d0
+ inturb = inturb + 1
+ else
+
+! On est en sous couche visqueuse :
+
+! Si on utilise les "scalable wall functions", on decale la valeur de YPLUS,
+! on recalcule uet et on se considere hors de la sous-couche visqueuse
+ if (ideuch(iphas).eq.2) then
+ dplus = ypluli(iphas) - yplus
+ yplus = ypluli(iphas)
+ uet = utau/(log(yplus)/xkappa+cstlog)
+ unturb = 1.d0
+ inturb = inturb + 1
+ else
+! Sinon on est reellement en sous-couche visqueuse
+ unturb = 0.d0
+ inlami = inlami + 1
+! On annule uk pour annuler les CL
+ uk = 0.d0
+
+! On recalcule les valeurs fausses
+! en une echelle : uet et yplus sont faux
+! en deux echelles : uet est faux
+
+! En deux echelles :
+! On recalcule uet mais il ne sert plus a rien
+! (il intervient dans des termes multiplies par UNTURB=0)
+ if(ideuch(iphas).eq.1) then
+ if(yplus.gt.epzero) then
+ uet = abs(utau/yplus)
+ else
+ uet = 0.d0
+ endif
+! En une echelle :
+! On recalcule uet : il sert pour la LES
+! On recalcule yplus (qui etait deduit de uet) : il sert pour hturbp
+ else
+ uet = sqrt(utau*nusury)
+ yplus = uet/nusury
+ endif
+! On est en ss couche visqueuse
+
+ endif
+
+ endif
+
+ uetmax = max(uet,uetmax)
+ uetmin = min(uet,uetmin)
+ ukmax = max(uk,ukmax)
+ ukmin = min(uk,ukmin)
+ yplumx = max(yplus,yplumx)
+ yplumn = min(yplus,yplumn)
+
+! Sauvegarde de la vitesse de frottement et de la viscosite turbulente
+! apres amortissement de van Driest pour la LES
+! On n'amortit pas mu_t une seconde fois si on l'a deja fait
+! (car une cellule peut avoir plusieurs faces de paroi)
+
+ if(itytur(iphas).eq.4.and.idries(iphas).eq.1) then
+ uetbor(ifac,iphas) = uet
+ if (visvdr(iel,iphas).lt.-900.d0) then
+ propce(iel,ipcvst) = propce(iel,ipcvst) &
+ *(1.d0-exp(-yplus/cdries(iphas)))**2
+ visvdr(iel,iphas) = propce(iel,ipcvst)
+ visctc = propce(iel,ipcvst)
+ endif
+ endif
+
+
+! Sauvegarde de yplus si post traite
+
+ if(mod(ipstdv,ipstyp).eq.0) then
+ ra(iyplbp+ifac-1) = yplus
+ endif
+
+
+!===============================================================================
+! 3. CONDITIONS AUX LIMITES SUR LA VITESSE
+!===============================================================================
+
+! UIPTN respecte la production de k
+! de facon conditionnelle --> Coef RCPROD
+! UIPTNF respecte le flux
+! de facon conditionnelle --> Coef RCFLUX
+
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.60) then
+
+ xmutlm = xkappa*visclc*yplus
+
+! Si YPLUS=0, on met UIPTN et UIPTNF a 0 directement pour eviter les divisions
+! par 0. De toute facon, dans ce cas UNTURB=0
+ if (yplus.gt.epzero) then
+ rcprod = &
+ min(xkappa , max(und0,sqrt(xmutlm/visctc))/yplus )
+ rcflux = max(xmutlm,visctc)/(visclc+visctc)
+
+ uiptn = utau + distbf*uet*uk*romc/xkappa/visclc*( &
+ und0/(deuxd0*yplus-dplus) - deuxd0*rcprod )
+ uiptnf = utau - distbf*uet*uk*romc/xmutlm*rcflux
+ else
+ uiptn = 0.d0
+ uiptnf = 0.d0
+ endif
+
+ uiptmx = max(uiptn*unturb,uiptmx)
+ uiptmn = min(uiptn*unturb,uiptmn)
+ if(uiptn*unturb.lt.-epzero) iuiptn = iuiptn + 1
+
+ coefa(ifac,iclu) = uiptn *tx*unturb *txn0
+ coefa(ifac,iclv) = uiptn *ty*unturb *txn0
+ coefa(ifac,iclw) = uiptn *tz*unturb *txn0
+ coefa(ifac,icluf) = uiptnf*tx*unturb *txn0
+ coefa(ifac,iclvf) = uiptnf*ty*unturb *txn0
+ coefa(ifac,iclwf) = uiptnf*tz*unturb *txn0
+
+ coefa(ifac,iclu) = coefa(ifac,iclu) + rcodcx
+ coefa(ifac,iclv) = coefa(ifac,iclv) + rcodcy
+ coefa(ifac,iclw) = coefa(ifac,iclw) + rcodcz
+ coefa(ifac,icluf) = coefa(ifac,icluf) + rcodcx
+ coefa(ifac,iclvf) = coefa(ifac,iclvf) + rcodcy
+ coefa(ifac,iclwf) = coefa(ifac,iclwf) + rcodcz
+
+ coefb(ifac,iclu) = 0.d0
+ coefb(ifac,iclv) = 0.d0
+ coefb(ifac,iclw) = 0.d0
+ coefb(ifac,icluf) = 0.d0
+ coefb(ifac,iclvf) = 0.d0
+ coefb(ifac,iclwf) = 0.d0
+
+ elseif(iturb(iphas).eq.0 .or.iturb(iphas).eq.10.or. &
+ itytur(iphas).eq.3) then
+
+! Si ILOGPO=0, alors on a forcement IDEUCH=0
+ if(ilogpo(iphas).eq.0) then
+ uiptn = utau &
+ + uet*apow*bpow*yplus**bpow*(2.d0**(bpow-1.d0)-2.d0)
+ else
+! Si YPLUS=0, on met UIPTN a 0 directement pour eviter une division
+! par 0. De toute facon, dans ce cas UNTURB=0
+ if (yplus.gt.epzero) then
+ uiptn = utau - distbf*romc*uet*uk/xkappa/visclc*( &
+ deuxd0/yplus - und0/(deuxd0*yplus-dplus) )
+ else
+ uiptn = 0.d0
+ endif
+ endif
+
+ uiptmx = max(uiptn*unturb,uiptmx)
+ uiptmn = min(uiptn*unturb,uiptmn)
+ if(uiptn*unturb.lt.-epzero) iuiptn = iuiptn + 1
+
+ coefa(ifac,iclu) = uiptn *tx*unturb *txn0
+ coefa(ifac,iclv) = uiptn *ty*unturb *txn0
+ coefa(ifac,iclw) = uiptn *tz*unturb *txn0
+
+ coefa(ifac,iclu) = coefa(ifac,iclu) + rcodcx
+ coefa(ifac,iclv) = coefa(ifac,iclv) + rcodcy
+ coefa(ifac,iclw) = coefa(ifac,iclw) + rcodcz
+
+ coefb(ifac,iclu) = 0.d0
+ coefb(ifac,iclv) = 0.d0
+ coefb(ifac,iclw) = 0.d0
+
+! En LES on est forcement en IDEUCH=0, pas la peine d'exprimer les flux en version "scalable
+! wall function".
+ elseif(itytur(iphas).eq.4) then
+ if(ilogpo(iphas).eq.0) then
+ uiptn = utau &
+ + uet*apow*bpow*yplus**bpow*(2.d0**(bpow-1.d0)-2.d0)
+ else
+ uiptn = utau - uet/xkappa*1.5d0
+ endif
+
+! Si (mu+mut) devient nul (mod�les dynamiques), on impose une valeur bidon
+! (flux nul) mais ce n'est pas grave car le flux est vraiment nul � travers
+! cette face
+
+ if(visctc+visclc.le.0) then
+ uiptnf = utau
+ else
+ uiptnf = utau -romc*distbf*(uet**2)/(visctc+visclc)
+ endif
+
+ uiptmx = max(uiptn*unturb,uiptmx)
+ uiptmn = min(uiptn*unturb,uiptmn)
+ if(uiptn*unturb.lt.-epzero) iuiptn = iuiptn + 1
+
+ coefa(ifac,iclu) = uiptn *tx*unturb *txn0
+ coefa(ifac,iclv) = uiptn *ty*unturb *txn0
+ coefa(ifac,iclw) = uiptn *tz*unturb *txn0
+ coefa(ifac,icluf) = uiptnf*tx*unturb *txn0
+ coefa(ifac,iclvf) = uiptnf*ty*unturb *txn0
+ coefa(ifac,iclwf) = uiptnf*tz*unturb *txn0
+
+ coefa(ifac,iclu) = coefa(ifac,iclu) + rcodcx
+ coefa(ifac,iclv) = coefa(ifac,iclv) + rcodcy
+ coefa(ifac,iclw) = coefa(ifac,iclw) + rcodcz
+ coefa(ifac,icluf) = coefa(ifac,icluf) + rcodcx
+ coefa(ifac,iclvf) = coefa(ifac,iclvf) + rcodcy
+ coefa(ifac,iclwf) = coefa(ifac,iclwf) + rcodcz
+
+ coefb(ifac,iclu) = 0.d0
+ coefb(ifac,iclv) = 0.d0
+ coefb(ifac,iclw) = 0.d0
+ coefb(ifac,icluf) = 0.d0
+ coefb(ifac,iclvf) = 0.d0
+ coefb(ifac,iclwf) = 0.d0
+
+ elseif(iturb(iphas).eq.50) then
+
+! Avec ces conditions, pas besoin de calculer UIPTMX, UIPTMN
+! et IUIPTN qui sont nuls (valeur d'initialisation)
+
+ coefa(ifac,iclu) = rcodcx
+ coefa(ifac,iclv) = rcodcy
+ coefa(ifac,iclw) = rcodcz
+
+ coefb(ifac,iclu) = 0.d0
+ coefb(ifac,iclv) = 0.d0
+ coefb(ifac,iclw) = 0.d0
+
+ endif
+
+!===============================================================================
+! 4. CONDITIONS AUX LIMITES SUR K ET EPSILON
+!===============================================================================
+
+ if (itytur(iphas).eq.2) then
+
+ coefa(ifac,iclk) = uk**2/sqrcmu
+ coefb(ifac,iclk) = 0.d0
+
+! Si YPLUS=0, on met COEFA a 0 directement pour eviter une division
+! par 0.
+ if (yplus.gt.epzero) then
+ coefa(ifac,iclep) = distbf*4.d0*uk**5*romc**2/ &
+ (xkappa*visclc**2*(yplus+dplus)**2)
+ else
+ coefa(ifac,iclep) = 0.d0
+ endif
+ coefb(ifac,iclep) = 1.d0
+
+!===============================================================================
+! 5. CONDITIONS AUX LIMITES SUR RIJ ET EPSILON
+!===============================================================================
+
+ elseif (itytur(iphas).eq.3) then
+
+! ---> TENSEUR RIJ (PARTIELLEMENT IMPLICITE)
+
+ do isou = 1, 6
+
+ if(isou.eq.1) iclvar = icl11
+ if(isou.eq.2) iclvar = icl22
+ if(isou.eq.3) iclvar = icl33
+ if(isou.eq.4) iclvar = icl12
+ if(isou.eq.5) iclvar = icl13
+ if(isou.eq.6) iclvar = icl23
+
+ coefa(ifac,iclvar) = 0.0d0
+ coefb(ifac,iclvar) = 0.0d0
+
+ enddo
+
+ do isou = 1,6
+
+ if(isou.eq.1) then
+ iclvar = icl11
+ jj = 1
+ kk = 1
+ else if(isou.eq.2) then
+ iclvar = icl22
+ jj = 2
+ kk = 2
+ else if(isou.eq.3) then
+ iclvar = icl33
+ jj = 3
+ kk = 3
+ else if(isou.eq.4) then
+ iclvar = icl12
+ jj = 1
+ kk = 2
+ else if(isou.eq.5) then
+ iclvar = icl13
+ jj = 1
+ kk = 3
+ else if(isou.eq.6) then
+ iclvar = icl23
+ jj = 2
+ kk = 3
+ endif
+
+ if (iclptr(iphas).eq.1) then
+ do ii = 1, 6
+ if(ii.ne.isou) then
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) + &
+ alpha(isou,ii) * rijipb(ifac,ii)
+ endif
+ enddo
+ coefb(ifac,iclvar) = alpha(isou,isou)
+ else
+ do ii = 1, 6
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) + &
+ alpha(isou,ii) * rijipb(ifac,ii)
+ enddo
+ coefb(ifac,iclvar) = 0.d0
+ endif
+
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) - &
+ (eloglo(jj,1)*eloglo(kk,2)+ &
+ eloglo(jj,2)*eloglo(kk,1))*uet*uk
+
+! si laminaire : tensions nulles
+
+ if(unturb.le.epzero) then
+ coefa(ifac,iclvar) = 0.d0
+ coefb(ifac,iclvar) = 0.d0
+ endif
+
+ enddo
+
+! ---> SCALAIRE EPSILON
+! ICI AUSSI, POSSIBILITE DE FORME FLUX OU DIRICHLET ...
+! ON NE RECONSTRUIT PAS EPSILON
+! POSSIBILITE D'IMPLICITATION PARTIELLE
+
+! Si YPLUS=0, on met COEFA a 0 directement pour eviter une division
+! par 0.
+ if (yplus.gt.epzero) then
+ coefa(ifac,iclep) = distbf*4.d0*uk**5*romc**2/ &
+ (xkappa*visclc**2*(yplus+dplus)**2)
+ else
+ coefa(ifac,iclep) = 0.d0
+ endif
+ if (iclptr(iphas).eq.1) then
+ coefb(ifac,iclep) = 1.d0
+ else
+ coefa(ifac,iclep) = rtp(iel,iclep) + coefa(ifac,iclep)
+ coefb(ifac,iclep) = 0.d0
+ endif
+
+!===============================================================================
+! 6. CONDITIONS AUX LIMITES SUR K, EPSILON, F_BARRE ET PHI
+!===============================================================================
+
+ elseif (iturb(iphas).eq.50) then
+
+ coefa(ifac,iclk) = 0.d0
+ coefb(ifac,iclk) = 0.d0
+ coefa(ifac,iclep) = &
+ 2.0d0*propce(iel,ipcvis)/propce(iel,ipcrom) &
+ *rtp(iel,ikiph)/distbf**2
+ coefb(ifac,iclep) = 0.d0
+ coefa(ifac,iclphi) = 0.0d0
+ coefb(ifac,iclphi) = 0.0d0
+ coefa(ifac,iclfb) = 0.0d0
+ coefb(ifac,iclfb) = 0.0d0
+!===============================================================================
+! 7. CONDITIONS AUX LIMITES SUR K ET OMEGA
+!===============================================================================
+
+ elseif (iturb(iphas).eq.60) then
+
+! Si on est hors de la sous-couche visqueuse (reellement ou via les
+! scalable wall functions)
+ if (unturb.eq.1) then
+ coefa(ifac,iclk) = uk**2/sqrcmu
+ coefb(ifac,iclk) = 0.d0
+! Comme UNTURB=1 YPLUS est forcement >0
+ coefa(ifac,iclomg) = distbf*4.d0*uk**3*romc**2/ &
+ (sqrcmu*xkappa*visclc**2*(yplus+dplus)**2)
+ coefb(ifac,iclomg) = 1.d0
+
+ else
+! Si on est en sous-couche visqueuse
+ coefa(ifac,iclk) = 0.d0
+ coefb(ifac,iclk) = 0.d0
+ coefa(ifac,iclomg) = distbf*120.d0*8.d0*visclc/romc &
+ /(ckwbt1*distbf**3)
+ coefb(ifac,iclomg) = 1.d0
+ endif
+
+ endif
+
+!===============================================================================
+! 8. CONDITIONS AUX LIMITES SUR LES SCALAIRES
+! (AUTRES QUE PRESSION, K, EPSILON, RIJ, VARIANCES)
+! Pour les variances, pas de traitement specifique en paroi : voir
+! condli.
+!===============================================================================
+
+ if(nscal.ge.1) then
+
+ do ll = 1, nscal
+
+ if(iphsca(ll).eq.iphas.and.iscavr(ll).le.0) then
+
+ ivar = isca(ll)
+ iclvar = iclrtp(ivar,icoef)
+ iclvaf = iclrtp(ivar,icoeff)
+
+ isvhbl = 0
+ if(ll.eq.isvhb) then
+ isvhbl = isvhb
+ endif
+
+ ihcp = 0
+ iscal = ll
+ if(iscsth(iscal).eq.0.or.iscsth(iscal).eq.2 &
+ .or.iscsth(iscal).eq.3) then
+ ihcp = 0
+ elseif(abs(iscsth(iscal)).eq.1) then
+ if(ipccp.gt.0) then
+ ihcp = 2
+ else
+ ihcp = 1
+ endif
+ endif
+
+ cpp = 1.d0
+ if(ihcp.eq.0) then
+ cpp = 1.d0
+ elseif(ihcp.eq.2) then
+ cpp = propce(iel,ipccp )
+ elseif(ihcp.eq.1) then
+ cpp = cp0(iphas)
+ endif
+ hint = cpp
+
+ if(ivisls(ll).gt.0) then
+ ipcvsl = ipproc(ivisls(ll))
+ else
+ ipcvsl = 0
+ endif
+ if (ipcvsl.le.0) then
+ rkl = visls0(ll)
+ prdtl = visclc/rkl
+ else
+ rkl = propce(iel,ipcvsl)
+ prdtl = visclc/rkl
+ endif
+
+! Compressible : On suppose que le nombre de Pr doit etre
+! defini de la meme fa�on que l'on resolve
+! en enthalpie ou en energie, soit Mu*Cp/Lambda.
+! Si l'on resout en energie, on a calcule ci-dessus
+! Mu*Cv/Lambda.
+
+ if ( ippmod(icompf).ge.0 ) then
+ if(iscsth(iscal).eq.3) then
+ if(ipccp.gt.0) then
+ prdtl = prdtl*propce(iel,ipccp )
+ else
+ prdtl = prdtl*cp0(iphas)
+ endif
+ if(ipccv.gt.0) then
+ prdtl = prdtl/propce(iel,ipccv )
+ else
+ prdtl = prdtl/cv0(iphas)
+ endif
+ endif
+ endif
+
+! CAS TURBULENT
+ if (iturb(iphas).ne.0) then
+ if ( ippmod(icompf) .ge. 0 ) then
+! En compressible, pour l'energie LAMBDA/CV+CP/CV*(MUT/SIGMAS)
+ if(ipccp.gt.0) then
+ cpscv = propce(iel,ipproc(icp(iphas)))
+ else
+ cpscv = cp0(iphas)
+ endif
+ if(ipccv.gt.0) then
+ cpscv = cpscv/propce(iel,ipproc(icv(iphas)))
+ else
+ cpscv = cpscv/cv0(iphas)
+ endif
+ hint = hint*(rkl+cpscv*visctc/sigmas(ll))/distbf
+ else
+ hint = hint*(rkl+visctc/sigmas(ll))/distbf
+ endif
+! CAS LAMINAIRE
+ else
+ hint = hint*rkl/distbf
+ endif
+
+ if(iturb(iphas).ne.0.and.icodcl(ifac,ivar).eq.5)then
+ call hturbp (prdtl,sigmas(ll),xkappa,yplus,hflui)
+ !==========
+ hflui = cpp*rkl/distbf *hflui
+ else
+ hflui = hint
+ endif
+
+ if (isvhbl .gt. 0) hbord(ifac) = hflui
+
+
+
+! ---> C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+
+! Si on a deux types de conditions aux limites (ICLVAR, ICLVAF)
+! il faut que le flux soit traduit par ICLVAF.
+! Si on n'a qu'un type de condition, peu importe (ICLVAF=ICLVAR)
+! Pour le moment, dans cette version compressible, on impose un
+! flux nul pour ICLVAR, lorsqu'il est diff�rent de ICLVAF (cette
+! condition ne sert qu'� la reconstruction des gradients et
+! s'applique � l'energie totale qui inclut l'energie cin�tique :
+
+
+ if( icodcl(ifac,ivar).eq.5 ) then
+ hext = rcodcl(ifac,ivar,2)
+ pimp = rcodcl(ifac,ivar,1)
+ hredui = hint/hflui
+ coefa(ifac,iclvaf) = hext*pimp/(hint+hext*hredui)
+ coefb(ifac,iclvaf) = (hint-(1.d0-hredui)*hext)/ &
+ (hint+hext*hredui)
+ if(iclvar.ne.iclvaf) then
+ coefa(ifac,iclvar) = 0.d0
+ coefb(ifac,iclvar) = 1.d0
+ endif
+
+!--> Rayonnement :
+
+! On stocke le coefficient d'echange lambda/distance
+! (ou son equivalent en turbulent) quelle que soit la
+! variable thermique transportee (temperature ou enthalpie)
+! car on l'utilise pour realiser des bilans aux parois qui
+! sont faits en temperature (on cherche la temperature de
+! paroi quelle que soit la variable thermique transportee pour
+! ecrire des eps sigma T4.
+
+! donc :
+
+! lorsque la variable transportee est la temperature
+! ABS(ISCSTH(II)).EQ.1 : RA(IHCONV-1+IFAC+NFABOR*(IPH-1)) = HINT
+! puisque HINT = VISLS * CP / DISTBR
+! = lambda/distance en W/(m2 K)
+
+! lorsque la variable transportee est l'enthalpie
+! ISCSTH(II).EQ.2 : RA(IHCONV-1+IFAC+NFABOR*(IPH-1)) = HINT*CPR
+! avec
+! IF(IPCCP.GT.0) THEN
+! CPR = PROPCE(IEL,IPCCP )
+! ELSE
+! CPR = CP0(IPHAS)
+! ENDIF
+! puisque HINT = VISLS / DISTBR
+! = lambda/(CP * distance)
+
+! lorsque la variable transportee est l'energie (compressible)
+! ISCSTH(II).EQ.3 :
+! on procede comme pour l'enthalpie avec CV au lieu de CP
+! (rq : il n'y a pas d'hypoth�se, sf en non orthogonal :
+! le flux est le bon et le coef d'echange aussi)
+
+! De meme dans condli.
+
+
+
+! Si on rayonne sur la phase et que
+! le scalaire est la variable energetique
+
+ if (iirayo.ge.1 .and. &
+ ll.eq.iscalt(iphas) .and. iphas.eq.irapha ) then
+
+! On calcule le coefficient d'echange en W/(m2 K)
+
+! Si on resout en enthalpie
+ if(iscsth(ll).eq.2) then
+! Si Cp variable
+ if(ipccp.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hflui*propce(iel,ipccp )
+ else
+ propfb(ifac,ipprob(ihconv)) = hflui*cp0(iphas)
+ endif
+
+! Si on resout en energie (compressible)
+ elseif(iscsth(ll).eq.3) then
+! Si Cv variable
+ if(ipccv.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hflui*propce(iel,ipccv )
+ else
+ propfb(ifac,ipprob(ihconv)) = hflui*cv0(iphas)
+ endif
+
+! Si on resout en temperature
+ elseif(abs(iscsth(ll)).eq.1) then
+ propfb(ifac,ipprob(ihconv)) = hflui
+ endif
+
+! On recupere le flux h(Ti'-Tp) (sortant ou
+! negatif si gain pour le fluide) en W/m2
+
+ propfb(ifac,ipprob(ifconv)) = &
+ hint*( (1.d0-coefb(ifac,iclvaf))*thbord(ifac) &
+ - coefa(ifac,iclvaf))
+ endif
+
+ endif
+
+! ---> C.L DE TYPE FLUX : VOIR CONDLI
+
+ endif
+
+ enddo
+
+ endif
+
+
+ endif
+! --- Test sur la presence d'une condition de paroi vitesse : fin
+
+
+
+enddo
+! --- Boucle sur les faces : fin
+
+if (irangp.ge.0) then
+ call parmin (uiptmn)
+ !==========
+ call parmax (uiptmx)
+ !==========
+ call parmin (uetmin)
+ !==========
+ call parmax (uetmax)
+ !==========
+ call parmin (ukmin)
+ !==========
+ call parmax (ukmax)
+ !==========
+ call parmin (yplumn)
+ !==========
+ call parmax (yplumx)
+ !==========
+ call parcpt (inturb)
+ !==========
+ call parcpt (inlami)
+ !==========
+ call parcpt (iuiptn)
+ !==========
+endif
+
+!===============================================================================
+! 9. IMPRESSIONS
+!===============================================================================
+
+! Remarque : afin de ne pas surcharger les listings dans le cas ou
+! quelques yplus ne sont pas corrects, on ne produit le message
+! qu'aux deux premiers pas de temps ou le message apparait et
+! aux deux derniers pas de temps du calcul, ou si IWARNI est >= 2
+! On indique aussi le numero du dernier pas de temps auquel on
+! a rencontre des yplus hors bornes admissibles
+
+if(iwarni(iuiph).ge.0) then
+ if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+ elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+ else
+ modntl = 1
+ endif
+
+ if ( (iturb(iphas).eq.0.and.inturb.ne.0) .or. &
+ (iturb(iphas).eq.50.and.inturb.ne.0) .or. &
+ ((itytur(iphas).eq.2.or.itytur(iphas).eq.3) &
+ .and.inlami.gt.0) ) &
+ ntlast = ntcabs
+
+ if ( (ntlast.eq.ntcabs.and.iaff.lt.2 ).or. &
+ (ntlast.ge.0 .and.ntcabs.ge.ntmabs-1).or. &
+ (ntlast.eq.ntcabs.and.iwarni(iuiph).ge.2) ) then
+ iaff = iaff + 1
+ write(nfecra,2010) iphas, &
+ uiptmn,uiptmx,uetmin,uetmax,ukmin,ukmax,yplumn,yplumx, &
+ iuiptn,inlami,inlami+inturb
+ if (iturb(iphas).eq. 0) &
+ write(nfecra,2020) iphas,ntlast,ypluli(iphas)
+ if (iturb(iphas).eq.50) &
+ write(nfecra,2030) iphas,ntlast,ypluli(iphas)
+ if (itytur(iphas).eq.2.or.itytur(iphas).eq.3) &
+ write(nfecra,2040) iphas,ntlast,ypluli(iphas)
+ if (iwarni(iuiph).lt.2) then
+ write(nfecra,2050)
+ else
+ write(nfecra,2060)
+ endif
+
+ else if (modntl.eq.0 .or. iwarni(iuiph).ge.2) then
+ write(nfecra,2010) iphas, &
+ uiptmn,uiptmx,uetmin,uetmax,ukmin,ukmax,yplumn,yplumx, &
+ iuiptn,inlami,inlami+inturb
+ endif
+
+endif
+
+!===============================================================================
+! 10. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' LA NORMALE A LA FACE DE BORD DE PAROI ',I10,/, &
+ ' EST NULLE ; COORDONNEES : ',3E12.5)
+
+ 2010 format(/, &
+ 3X,'** CONDITIONS AUX LIMITES EN PAROI LISSE',/, &
+ ' ----------------------------------------',/, &
+ '------------------------------------------------------------',/,&
+ ' Phase ',I6,' Minimum Maximum',/,&
+ '------------------------------------------------------------',/,&
+ ' Vitesse rel. en paroi uiptn : ',2E12.5 ,/,&
+ ' Vitesse de frottement uet : ',2E12.5 ,/,&
+ ' Vitesse de frottement uk : ',2E12.5 ,/,&
+ ' Distance adimensionnelle yplus : ',2E12.5 ,/,&
+ ' ------------------------------------------------------ ',/,&
+ ' Nbre de retournements de la vitesse en paroi : ',I10 ,/,&
+ ' Nbre de faces en sous couche visqueuse : ',I10 ,/,&
+ ' Nbre de faces de paroi total : ',I10 ,/,&
+ '------------------------------------------------------------', &
+ /,/)
+
+ 2020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAFFINEMENT INSUFFISANT DU MAILLAGE EN PAROI',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ Le maillage semble insuffisamment raffine en paroi ',/,&
+'@ pour pouvoir realiser un calcul laminaire. ',/,&
+'@ ',/,&
+'@ Le dernier pas de temps auquel ont ete observees de trop',/,&
+'@ grandes valeurs de la distance adimensionnelle a la ',/,&
+'@ paroi (yplus) est le pas de temps ',I10 ,/,&
+'@ ',/,&
+'@ La valeur minimale de yplus doit etre inferieure a la ',/,&
+'@ valeur limite YPLULI = ',E14.5 ,/,&
+'@ ',/,&
+'@ Observer la repartition de yplus en paroi (sous Ensight ',/,&
+'@ par exemple) pour determiner dans quelle mesure la ',/,&
+'@ qualite des resultats est susceptible d etre affectee.')
+
+ 2030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAFFINEMENT INSUFFISANT DU MAILLAGE EN PAROI',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ Le maillage semble insuffisamment raffine en paroi ',/,&
+'@ pour pouvoir realiser un calcul v2f. ',/,&
+'@ ',/,&
+'@ Le dernier pas de temps auquel ont ete observees de trop',/,&
+'@ grandes valeurs de la distance adimensionnelle a la ',/,&
+'@ paroi (yplus) est le pas de temps ',I10 ,/,&
+'@ ',/,&
+'@ La valeur minimale de yplus doit etre inferieure a la ',/,&
+'@ valeur limite YPLULI = ',E14.5 ,/,&
+'@ ',/,&
+'@ Observer la repartition de yplus en paroi (sous Ensight ',/,&
+'@ par exemple) pour determiner dans quelle mesure la ',/,&
+'@ qualite des resultats est susceptible d etre affectee.')
+
+ 2040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MAILLAGE TROP FIN EN PAROI ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ Le maillage semble trop raffine en paroi pour utiliser ',/,&
+'@ un modele de turbulence haut Reynolds. ',/,&
+'@ ',/,&
+'@ Le dernier pas de temps auquel ont ete observees des ',/,&
+'@ valeurs trop faibles de la distance adimensionnelle a ',/,&
+'@ la paroi (yplus) est le pas de temps ',I10 ,/,&
+'@ ',/,&
+'@ La valeur minimale de yplus doit etre superieure a la ',/,&
+'@ valeur limite YPLULI = ',E14.5 ,/,&
+'@ ',/,&
+'@ Observer la repartition de yplus en paroi (sous Ensight ',/,&
+'@ par exemple) pour determiner dans quelle mesure la ',/,&
+'@ qualite des resultats est susceptible d etre affectee.')
+ 2050 format( &
+'@ ',/,&
+'@ Ce message ne s''affiche qu''aux deux premieres ',/,&
+'@ occurences du probleme et aux deux derniers pas de ',/,&
+'@ temps du calcul. La disparition du message ne signifie',/,&
+'@ pas forcement la disparition du probleme. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format(/,' THE NORMAL TO THE WALL BOUNDARY FACE ',I10,/, &
+ ' IS NULL; COORDINATES: ',3E12.5)
+
+ 2010 format(/, &
+ 3X,'** BOUNDARY CONDITIONS FOR SMOOTH WALLS',/, &
+ ' ---------------------------------------',/, &
+ '------------------------------------------------------------',/,&
+ ' Phase ',I6,' Minimum Maximum',/,&
+ '------------------------------------------------------------',/,&
+ ' Rel velocity at the wall uiptn : ',2E12.5 ,/,&
+ ' Friction velocity uet : ',2E12.5 ,/,&
+ ' Friction velocity uk : ',2E12.5 ,/,&
+ ' Dimensionless distance yplus : ',2E12.5 ,/,&
+ ' ------------------------------------------------------ ',/,&
+ ' Nb of reversal of the velocity at the wall : ',I10 ,/,&
+ ' Nb of faces within the viscous sub-layer : ',I10 ,/,&
+ ' Total number of wall faces : ',I10 ,/,&
+ '------------------------------------------------------------', &
+ /,/)
+
+ 2020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: MESH NOT ENOUGH REFINED AT THE WALL ',/,&
+'@ ======== ',/,&
+'@ PHASE ',I10 ,/,&
+'@ The mesh does not seem to be enough refined at the wall ',/,&
+'@ to be able to run a laminar simulation. ',/,&
+'@ ',/,&
+'@ The last time step at which too large values for the ',/,&
+'@ dimensionless distance to the wall (yplus) have been ',/,&
+'@ observed is the time step ',I10 ,/,&
+'@ ',/,&
+'@ The minimum value for yplus must be lower than the ',/,&
+'@ limit value YPLULI = ',E14.5 ,/,&
+'@ ',/,&
+'@ Have a look at the distribution of yplus at the wall ',/,&
+'@ (with EnSight for example) to conclude on the way ',/,&
+'@ the results quality might be affected. ')
+
+ 2030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: MESH NOT ENOUGH REFINED AT THE WALL ',/,&
+'@ ======== ',/,&
+'@ PHASE ',I10 ,/,&
+'@ The mesh does not seem to be enough refined at the wall ',/,&
+'@ to be able to run a v2f simulation. ',/,&
+'@ ',/,&
+'@ The last time step at which too large values for the ',/,&
+'@ dimensionless distance to the wall (yplus) have been ',/,&
+'@ observed is the time step ',I10 ,/,&
+'@ ',/,&
+'@ The minimum value for yplus must be lower than the ',/,&
+'@ limit value YPLULI = ',E14.5 ,/,&
+'@ ',/,&
+'@ Have a look at the distribution of yplus at the wall ',/,&
+'@ (with EnSight for example) to conclude on the way ',/,&
+'@ the results quality might be affected. ')
+
+ 2040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: MESH TOO REFINED AT THE WALL ',/,&
+'@ ======== ',/,&
+'@ PHASE ',I10 ,/,&
+'@ The mesh seems to be too refined at the wall to use ',/,&
+'@ a high-Reynolds turbulence model. ',/,&
+'@ ',/,&
+'@ The last time step at which too small values for the ',/,&
+'@ dimensionless distance to the wall (yplus) have been ',/,&
+'@ observed is the time step ',I10 ,/,&
+'@ ',/,&
+'@ The minimum value for yplus must be greater than the ',/,&
+'@ limit value YPLULI = ',E14.5 ,/,&
+'@ ',/,&
+'@ Have a look at the distribution of yplus at the wall ',/,&
+'@ (with EnSight for example) to conclude on the way ',/,&
+'@ the results quality might be affected. ')
+ 2050 format( &
+'@ ',/,&
+'@ This warning is only printed at the first two ',/,&
+'@ occurences of the problem and at the last time step ',/,&
+'@ of the calculation. The vanishing of the message does ',/,&
+'@ not necessarily mean the vanishing of the problem. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/clpv2f.f90 b/src/base/clpv2f.f90
new file mode 100644
index 0000000..68fad03
--- /dev/null
+++ b/src/base/clpv2f.f90
@@ -0,0 +1,172 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine clpv2f &
+!================
+
+ ( ncelet , ncel , nvar , nphas , &
+ iphas , iwaphi , &
+ propce , rtp )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CLIPPING DE PHI EN V2F (PAS DE CLIPPING SUR F_BARRE)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre de cellules !
+! nvar ! e ! <-- ! nombre de variables !
+! nphas ! e ! <-- ! nombre de phases !
+! iphas ! e ! <-- ! numero de la phase a traiter !
+! iwaphi ! e ! <-- ! niveau d'impression !
+! propce ! tr ! <-- ! tableaux des variables au pdt courant !
+!(ncelet,* ! ! ! !
+! rtp ! tr ! <-- ! tableaux des variables au pdt courant !
+! (ncelet,nvar) ! ! ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "numvar.h"
+include "cstnum.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nvar, ncelet, ncel, nphas
+integer iphas, iwaphi
+double precision propce(ncelet,*)
+double precision rtp(ncelet,nvar)
+
+! VARIABLES LOCALES
+
+integer iel, ipp
+integer iphiph
+integer nclpmx, nclpmn
+double precision xphi, vmin, vmax, var
+
+!===============================================================================
+
+
+iphiph = iphi(iphas)
+
+!===============================================================================
+! ---> Stockage Min et Max pour listing
+!===============================================================================
+
+ipp = ipprtp(iphiph)
+
+vmin = grand
+vmax = -grand
+do iel = 1, ncel
+ var = rtp(iel,iphiph)
+ vmin = min(vmin,var)
+ vmax = max(vmax,var)
+enddo
+if (irangp.ge.0) then
+ call parmin(vmin)
+ !==========
+ call parmax(vmax)
+ !==========
+endif
+varmna(ipp) = vmin
+varmxa(ipp) = vmax
+
+!==============================================================================
+! ---> Reperage des valeurs superieures a 2, pour affichage seulement
+!==============================================================================
+
+if (iwaphi.ge.2) then
+ nclpmx = 0
+ do iel = 1, ncel
+ if (rtp(iel,iphiph).gt.2.d0) nclpmx = nclpmx+1
+ enddo
+ if(irangp.ge.0) call parcpt(nclpmx)
+ !==========
+ if (nclpmx.gt.0) write(nfecra,1000) iphas,nclpmx
+endif
+
+!==============================================================================
+! ---> Clipping en valeur absolue pour les valeurs negatives
+!==============================================================================
+
+nclpmn = 0
+do iel = 1, ncel
+ xphi = rtp(iel,iphiph)
+ if (xphi.lt.0.d0) then
+ rtp(iel,iphiph) = -xphi
+ nclpmn = nclpmn + 1
+ endif
+enddo
+if(irangp.ge.0) call parcpt(nclpmn)
+ !==========
+iclpmn(ipp) = nclpmn
+
+!===============================================================================
+! ---> Formats
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format('ATTENTION VARIABLE PHI, PHASE ',I3,/, &
+ 'VALEUR MAXIMALE PHYSIQUE DE 2 DEPASSEE SUR ',I10, &
+ ' CELLULES')
+
+#else
+
+ 1000 format('WARNING VARIABLE PHI, PHASE ',I3,/, &
+ 'MAXIMUM PHYSICAL VALUE OF 2 EXCEEDED FOR ',I10, &
+ ' CELLS')
+
+#endif
+
+return
+
+end
diff --git a/src/base/clsurn.f90 b/src/base/clsurn.f90
new file mode 100644
index 0000000..6f60cda
--- /dev/null
+++ b/src/base/clsurn.f90
@@ -0,0 +1,124 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clsurn &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfac , nfabor , &
+ surfac , surfbo , &
+ surfan , surfbn , &
+ ia , ra )
+
+!===============================================================================
+
+! FONCTION :
+! ----------
+
+! CALCUL DES SURFACES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nfac /nfabor ! e ! <-- ! nombre total de faces internes/de brd !
+! surfac ! tr ! <-- ! coords du vecteur surface des nfaglo !
+! (3,nfac ) ! ! ! faces internes ; dirige du vois 1 !
+! ! ! ! vers le voisin 2 (ifacel) !
+! ! ! ! non unitaire !
+! surfbo ! tr ! <-- ! coords du vecteur surface des nfagbr !
+! (3,nfabor) ! ! ! faces de bord ; dirige vers l' !
+! ! ! ! exterieur du domaine ; non unitaire !
+! surfan ! tr ! <-- ! surface des faces internes !
+! (nfac ) ! ! ! (norme de surfac) !
+! surfbn ! tr ! <-- ! surface des faces de bord !
+! (nfabor ) ! ! ! (norme de surfbo) !
+! ia ! te ! --- ! tableau de travail entier !
+! ra ! tr ! --- ! tableau de travail reel !
+!__________________.______________!_____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0,idbra0
+integer nfac,nfabor
+integer ia(*)
+double precision surfac(3,nfac ),surfbo(3,nfabor)
+double precision surfan(nfac ),surfbn(nfabor )
+double precision ra(*)
+
+integer ifac
+double precision surfx,surfy,surfz
+
+!-------------------------------------------------------------------------------
+! 1. FACES INTERNES
+!-------------------------------------------------------------------------------
+
+do ifac = 1, nfac
+
+ surfx = surfac(1,ifac)
+ surfy = surfac(2,ifac)
+ surfz = surfac(3,ifac)
+ surfan(ifac) = sqrt(surfx**2 + surfy**2 + surfz**2)
+
+enddo
+
+!-------------------------------------------------------------------------------
+! 2. FACES DE BORD
+!-------------------------------------------------------------------------------
+
+do ifac = 1, nfabor
+
+ surfx = surfbo(1,ifac)
+ surfy = surfbo(2,ifac)
+ surfz = surfbo(3,ifac)
+ surfbn(ifac) = sqrt(surfx**2 + surfy**2 + surfz**2)
+
+enddo
+
+!-------------------------------------------------------------------------------
+! 3. FIN
+!-------------------------------------------------------------------------------
+
+return
+end
diff --git a/src/base/clsyvt.f90 b/src/base/clsyvt.f90
new file mode 100644
index 0000000..16be9c0
--- /dev/null
+++ b/src/base/clsyvt.f90
@@ -0,0 +1,530 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clsyvt &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , isympa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefu , rijipb , coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS LIMITES EN SYMETRIE POUR LES VECTEURS ET TENSEURS
+
+! ON SUPPOSE QUE ICODCL(IU) = 4 =>
+! SYMETRIE POUR LA VITESSE ET RIJ
+! (A PRIORI PEU RESTRICTIF EN MONOPHASIQUE)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! isympa ! te ! <-- ! zero pour annuler le flux de masse !
+! (nfabor ) ! ! !(symetries et parois avec cl couplees) !
+! ! ! ! un sinon !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefu ! tr ! <-- ! tab de trav pour valeurs en iprime !
+! (nfabor,3 ) ! ! ! des comp de la vitesse au bord !
+! rijipb ! tr ! <-- ! tab de trav pour valeurs en iprime !
+! (nfabor,6 ) ! ! ! des rij au bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "albase.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar), isympa(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefu(nfabor,ndim), rijipb(nfabor,6)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ii, isou
+integer iuiph , iviph , iwiph
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer iclu , iclv , iclw
+integer icl11 , icl22 , icl33 , icl12 , icl13 , icl23
+integer icluf , iclvf , iclwf
+integer iclvar
+double precision rnx, rny, rnz, rxnn
+double precision upx, upy, upz, usn
+double precision tx, ty, tz, txn, t2x, t2y, t2z
+double precision clsyme
+double precision eloglo(3,3), alpha(6,6)
+double precision srfbnf, rcodcn
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+! --- Variables
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+if(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+endif
+
+! --- Conditions aux limites
+iclu = iclrtp(iuiph ,icoef)
+iclv = iclrtp(iviph ,icoef)
+iclw = iclrtp(iwiph ,icoef)
+if(itytur(iphas).eq.3) then
+ icl11 = iclrtp(ir11ip,icoef)
+ icl22 = iclrtp(ir22ip,icoef)
+ icl33 = iclrtp(ir33ip,icoef)
+ icl12 = iclrtp(ir12ip,icoef)
+ icl13 = iclrtp(ir13ip,icoef)
+ icl23 = iclrtp(ir23ip,icoef)
+endif
+
+icluf = iclrtp(iuiph ,icoeff)
+iclvf = iclrtp(iviph ,icoeff)
+iclwf = iclrtp(iwiph ,icoeff)
+
+
+! --- Boucle sur les faces de bord : debut
+do ifac = 1, nfabor
+
+! --- Test sur la presence d'une condition de symetrie vitesse : debut
+ if( icodcl(ifac,iuiph).eq.4 ) then
+
+! --- Pour annuler le flux de masse
+ isympa(ifac) = 0
+
+! --- Grandeurs geometriques
+ srfbnf = ra(isrfbn-1+ifac)
+
+!===============================================================================
+! 1. REPERE LOCAL
+! POUR LA VITESSE, SEULE EST NECESSAIRE LA NORMALE
+! POUR RIJ, IL FAUT LE REPERE COMPLET
+!===============================================================================
+
+! ---> NORMALE UNITAIRE
+
+ rnx = surfbo(1,ifac)/srfbnf
+ rny = surfbo(2,ifac)/srfbnf
+ rnz = surfbo(3,ifac)/srfbnf
+
+! En ALE, on a eventuellement une vitesse de deplacement de la face
+! donc seule la composante normale importe (on continue a determiner
+! TX a partir de la vitesse tangentielle absolue car l'orientation
+! de TX et T2X est sans importance pour les symetries)
+ rcodcn = 0.d0
+ if (iale.eq.1) then
+ rcodcn = rcodcl(ifac,iuiph,1)*rnx &
+ + rcodcl(ifac,iviph,1)*rny &
+ + rcodcl(ifac,iwiph,1)*rnz
+ endif
+
+ upx = coefu(ifac,1)
+ upy = coefu(ifac,2)
+ upz = coefu(ifac,3)
+
+ if (itytur(iphas).eq.3) then
+
+! ---> VITESSE TANGENTIELLE RELATIVE
+
+ usn = upx*rnx+upy*rny+upz*rnz
+ tx = upx -usn*rnx
+ ty = upy -usn*rny
+ tz = upz -usn*rnz
+ txn = sqrt( tx**2 +ty**2 +tz**2 )
+
+! ---> TANGENTE UNITAIRE
+
+ if( txn.ge.epzero) then
+
+ tx = tx/txn
+ ty = ty/txn
+ tz = tz/txn
+
+ else
+
+! SI LA VITESSE EST NULLE, LE VECTEUR T EST NORMAL ET QCQUE
+
+ if(abs(rny).ge.epzero.or.abs(rnz).ge.epzero)then
+ rxnn = sqrt(rny**2+rnz**2)
+ tx = 0.d0
+ ty = rnz/rxnn
+ tz = -rny/rxnn
+ elseif(abs(rnx).ge.epzero.or.abs(rnz).ge.epzero)then
+ rxnn = sqrt(rnx**2+rnz**2)
+ tx = rnz/rxnn
+ ty = 0.d0
+ tz = -rnx/rxnn
+ else
+ write(nfecra,1000)ifac,rnx,rny,rnz
+ call csexit (1)
+ endif
+
+ endif
+
+
+! ---> T2 = RN X T (OU X EST LE PRODUIT VECTORIEL)
+
+ t2x = rny*tz - rnz*ty
+ t2y = rnz*tx - rnx*tz
+ t2z = rnx*ty - rny*tx
+
+! --> MATRICE ORTHOGONALE DE CHANGEMENT DE BASE ELOGLOij
+! (DE LA BASE LOCALE VERS LA BASE GLOBALE)
+
+! |TX -RNX T2X|
+! ELOGLO = |TY -RNY T2Y|
+! |TZ -RNZ T2Z|
+
+! SA TRANSPOSEE ELOGLOt EST SON INVERSE
+
+
+ eloglo(1,1) = tx
+ eloglo(1,2) = -rnx
+ eloglo(1,3) = t2x
+ eloglo(2,1) = ty
+ eloglo(2,2) = -rny
+ eloglo(2,3) = t2y
+ eloglo(3,1) = tz
+ eloglo(3,2) = -rnz
+ eloglo(3,3) = t2z
+
+! --> ON CALCULE ALPHA(6,6)
+
+! SOIT f LE CENTRE DE LA FACE DE BORD ET
+! I LE CENTRE DE LA CELLULE CORRESPONDANTE
+
+! EN NOTE RG (RESP RL) INDICE PAR f OU PAR I
+! LE TENSEUR DE REYNOLDS DANS LA BASE GLOBALE (RESP LOCALE)
+
+! LA MATRICE ALPHA APPLIQUEE AU VECTEUR GLOBAL EN I'
+! (RG11,I'|RG22,I'|RG33,I'|RG12,I'|RG13,I'|RG23,I')t
+! DOIT DONNER LES VALEURS A IMPOSER A LA FACE
+! (RG11,f |RG22,f |RG33,f |RG12,f |RG13,f |RG23,f )t
+! AUX CONDITIONS LIMITES DE DIRICHLET PRES (AJOUTEES ENSUITE)
+
+! ON LA DEFINIT EN CALCULANT RG,f EN FONCTION DE RG,I' COMME SUIT
+
+! RG,f = ELOGLO.RL,f.ELOGLOt (PRODUITS MATRICIELS)
+
+! | RL,I'(1,1) B*U*.Uk C*RL,I'(1,3) |
+! AVEC RL,f = | B*U*.Uk RL,I'(2,2) 0 |
+! | C*RL,I'(1,3) 0 RL,I'(3,3) |
+
+! AVEC RL,I = ELOGLOt.RG,I'.ELOGLO
+! B = 0
+! ET C = 0 EN PAROI (1 EN SYMETRIE)
+
+
+
+! ON CALCULE EN FAIT ELOGLO.PROJECTEUR.ELOGLOt
+
+
+ clsyme=1.d0
+ call clca66 ( clsyme , eloglo , alpha )
+ !==========
+
+ endif
+
+!===============================================================================
+! 2. CONDITIONS SUR LES VITESSES (PARTIELLEMENT IMPLICITES)
+!===============================================================================
+
+ coefa(ifac,iclu) = rcodcn*rnx - rnx*(rny*upy+rnz*upz)
+ coefb(ifac,iclu) = 1.d0-rnx**2
+ coefa(ifac,iclv) = rcodcn*rny - rny*(rnz*upz+rnx*upx)
+ coefb(ifac,iclv) = 1.d0-rny**2
+ coefa(ifac,iclw) = rcodcn*rnz - rnz*(rnx*upx+rny*upy)
+ coefb(ifac,iclw) = 1.d0-rnz**2
+
+!===============================================================================
+! 3. CONDITIONS SUR RIJ (PARTIELLEMENT IMPLICITES)
+!===============================================================================
+
+ if (itytur(iphas).eq.3) then
+
+ do isou = 1, 6
+
+ if(isou.eq.1) iclvar = icl11
+ if(isou.eq.2) iclvar = icl22
+ if(isou.eq.3) iclvar = icl33
+ if(isou.eq.4) iclvar = icl12
+ if(isou.eq.5) iclvar = icl13
+ if(isou.eq.6) iclvar = icl23
+
+ coefa(ifac,iclvar) = 0.0d0
+ coefb(ifac,iclvar) = 0.0d0
+
+ enddo
+
+ do isou = 1,6
+
+ if(isou.eq.1) then
+ iclvar = icl11
+ else if(isou.eq.2) then
+ iclvar = icl22
+ else if(isou.eq.3) then
+ iclvar = icl33
+ else if(isou.eq.4) then
+ iclvar = icl12
+ else if(isou.eq.5) then
+ iclvar = icl13
+ else if(isou.eq.6) then
+ iclvar = icl23
+ endif
+
+! IMPLICITATION PARTIELLE EVENTUELLE DES CL
+ if (iclsyr(iphas).eq.1) then
+ do ii = 1, 6
+ if (ii.ne.isou) then
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) + &
+ alpha(isou,ii) * rijipb(ifac,ii)
+ endif
+ enddo
+ coefb(ifac,iclvar) = alpha(isou,isou)
+ else
+ do ii = 1, 6
+ coefa(ifac,iclvar) = coefa(ifac,iclvar) + &
+ alpha(isou,ii) * rijipb(ifac,ii)
+ enddo
+ coefb(ifac,iclvar) = 0.d0
+ endif
+
+ enddo
+
+ endif
+
+ endif
+! --- Test sur la presence d'une condition de symetrie vitesse : fin
+
+enddo
+! --- Boucle sur les faces de bord : fin
+
+!===============================================================================
+! 4. COEFAF et COEFBF BIDONS POUR LES VITESSES
+!===============================================================================
+
+ if(iclu.ne.icluf) then
+ do ifac = 1, nfabor
+ if( icodcl(ifac,iuiph).eq.4) then
+ coefa(ifac,icluf) = coefa(ifac,iclu)
+ coefb(ifac,icluf) = coefb(ifac,iclu)
+ coefa(ifac,iclvf) = coefa(ifac,iclv)
+ coefb(ifac,iclvf) = coefb(ifac,iclv)
+ coefa(ifac,iclwf) = coefa(ifac,iclw)
+ coefb(ifac,iclwf) = coefb(ifac,iclw)
+ endif
+ enddo
+ endif
+
+!===============================================================================
+! 7. FORMATS
+!===============================================================================
+
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' LA NORMALE A LA FACE DE BORD DE SYMETRIE ',I10,/,&
+ ' EST NULLE ; COORDONNEES : ',3E12.5)
+
+#else
+
+ 1000 format(/,' THE NORMAL TO THE SYMMETRY BOUNDARY FACE ',I10,/,&
+ ' IS NULL; COORDINATES: ',3E12.5)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/clvolc.f90 b/src/base/clvolc.f90
new file mode 100644
index 0000000..f0bdac1
--- /dev/null
+++ b/src/base/clvolc.f90
@@ -0,0 +1,190 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine clvolc &
+!================
+
+ ( ncelet , ncel , &
+ volmin , volmax , voltot , volume )
+
+!===============================================================================
+
+! FONCTION :
+! --------
+
+! CALCUL DU VOLUME GEOMETRIQUE DES ELEMENTS
+! FORMULE DE GREEN : 3*VOLUME = SOMME DIV(R) AVEC R = t(X,Y,Z)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! volmin ! r ! --> ! volume de controle minimal !
+! volmax ! r ! --> ! volume de controle maximal !
+! voltot ! r ! --> ! volume total du domaine !
+! volume ! tr ! --> ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel
+double precision volmin, volmax, voltot
+double precision volume(ncelet)
+
+integer iel, idimte, itenso
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+! 1. INITIALISATION EFFECTUEE DANS cs_maillage_grd.c
+!===============================================================================
+
+ipass = ipass + 1
+
+!===============================================================================
+! 2. ON PREND LES MIN ET MAX
+!===============================================================================
+
+volmin = 1.d+12
+volmax = -1.d+12
+voltot = 0.d0
+
+do iel = 1, ncel
+
+ volmin = min(volmin, volume(iel))
+ volmax = max(volmax, volume(iel))
+ voltot = voltot + volume(iel)
+
+enddo
+
+! On communique le volume au halo pour les filtrages des modeles
+! dynamiques de L.E.S.
+! Dans le cas d'un voisinage etendu traite separement, l'appel a
+! PARCVE est fait directement dans la routine CFLITR (ce qui d'ailleurs
+! pourrait etre optimise)
+if (irangp.ge.0) then
+ call parcom(volume)
+ !==========
+ call parmin (volmin)
+ !==========
+ call parmax (volmax)
+ !==========
+ call parsom (voltot)
+ !==========
+endif
+if(iperio.eq.1) then
+
+ idimte = 0
+ itenso = 0
+
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ volume , volume , volume , &
+ volume , volume , volume , &
+ volume , volume , volume )
+
+endif
+
+! En ALE, on passe plusieurs fois ici.
+! Au premier passage (avant calculs) on ecrit, on teste et on s'arrete
+! si pb.
+! Aux passages suivants, on n'ecrit pas, on teste et on finit le pas
+! de temps si pb.
+if (ipass.eq.1) then
+ write(nfecra,1000) volmin, volmax, voltot
+ if (volmin.le.0.d0) then
+ write(nfecra,1002)
+ call csexit (1)
+ endif
+else
+ if (volmin.le.0.d0) then
+ write(nfecra,1001) volmin, volmax, voltot
+ write(nfecra,1002)
+ ntmabs = ntcabs
+ endif
+endif
+!===============================================================================
+! 5. FIN
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' --- Information sur les volumes ',/,&
+' Volume de controle minimal = ',4X,E18.9 ,/,&
+' Volume de controle maximal = ',4X,E18.9 ,/,&
+' Volume total du domaine = ',4X,E18.9 )
+ 1001 format(/,' CLVOLC : VOLUME DE CONTROLE MINIMAL = ',E18.9,/, &
+ ' VOLUME DE CONTROLE MAXIMAL = ',E18.9,/, &
+ ' VOLUME TOTAL DU DOMAINE = ',E18.9,/,/)
+ 1002 format(/,' CLVOLC : ARRET SUITE A LA DETECTION D''UN',/, &
+ ' VOLUME NEGATIF',/)
+
+#else
+
+ 1000 format( &
+' --- Information on the volumes ',/,&
+' Minimum control volume = ',4X,E18.9 ,/,&
+' Maximum control volume = ',4X,E18.9 ,/,&
+' Total volume for the domain = ',4X,E18.9 )
+ 1001 format(/,' CLVOLC : MINIMUM CONTROL VOLUME = ',E18.9,/, &
+ ' MAXIMUM CONTROL VOLUME = ',E18.9,/, &
+ ' TOTAL VOLUME FOR THE DOMAIN = ',E18.9,/,/)
+ 1002 format(/,' CLVOLC : ABORT DUE TO THE DETECTION OF A ',/, &
+ ' NEGATIVE VOLUME',/)
+
+#endif
+
+return
+end
diff --git a/src/base/codits.f90 b/src/base/codits.f90
new file mode 100644
index 0000000..0b083aa
--- /dev/null
+++ b/src/base/codits.f90
@@ -0,0 +1,757 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine codits &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvara , pvark , &
+ coefap , coefbp , cofafp , cofbfp , flumas , flumab , &
+ viscfm , viscbm , viscfs , viscbs , &
+ rovsdt , smbrp , pvar , &
+ dam , xam , dpvar , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , smbini , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION SUR UN PAS DE TEMPS D'UNE EQUATION DE CONVECTION
+! /DIFFUSION/TERME SOURCE POUR LA VARIABLE PVAR
+
+! ROVSDT.( PVAR -PVARA )
+! ( -> ---> )
+! + DIV( RO.U PVAR -VISC GRAD( PVAR ) ).VOLUME = S
+! ( )
+
+! ON RESOUT EN FAIT :
+
+! ROVSDT.DPVAR
+! ( -> ---> )
+! + DIV( RO.U DPVAR -VISC GRAD( DPVAR ) ).VOLUME = SMBR1
+! ( )
+! AVEC
+! SMBR1 = S
+! ( ->n ---> )
+! - DIV( RO.U PVARA -VISC GRAD( PVARA ) ).VOLUME
+! ( )
+! ET DPVAR = INCREMENT VARIABLE PVAR = PVAR-PVARA
+
+
+! ET PLUS EXACTEMENT
+
+! ROVSDT.DPVAR
+! ( -> ---> )
+! + DIV( RO.U DPVAR -VISC GRAD( DPVAR ) ).VOLUME = SMBR2
+! ( )
+! AVEC
+! SMBR2 = S - ROVSDT.( PVARi -PVARA )
+! ( ->n ---> )
+! - DIV( RO.U PVARi -VISC GRAD( PVARi ) ).VOLUME
+! ( )
+! ET DPVAR = INCREMENT VARIABLE PVAR = PVAR-PVARi
+
+
+
+! ATTENTION : IL EST INTERDIT DE MODIFIER ROVSDT ICI
+! ======== ======
+
+! il sert 32 fois dans le rayonnement (raysol).
+! et dans le calcul de y+ (distyp)
+
+
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtvar ! e ! <-- ! indicateur du schema temporel !
+! ivar ! e ! <-- ! variable traitee !
+! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
+! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
+! ndircp ! e ! <-- ! indicateur = 0 si decalage diagonale !
+! ireslp ! e ! <-- ! indicateur = 0 gradco !
+! ! ! ! = 1 jacobi !
+! ! ! ! = 2 bi-cgstab !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! nswrsp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! du second membre !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! ircflp ! e ! <-- ! indicateur = 1 rec flux ; 0 sinon !
+! ischcp ! e ! <-- ! indicateur = 1 centre , 0 2nd order !
+! isstpp ! e ! <-- ! indicateur = 1 sans test de pente !
+! ! ! ! = 0 avec test de pente !
+! iescap ! e ! <-- ! =1 calcul de l'indicateur prediction !
+! imgrp ! e ! <-- ! indicateur = 0 pas de mgm !
+! ! ! ! = 1 sinon !
+! nitmap ! e ! <-- ! nombre max d'iter pour resol iterativ !
+! ipp ! e ! <-- ! numero de variable pour post !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! nfecrl ! e ! <-- ! unite du fichier sortie std !
+! blencp ! r ! <-- ! 1 - proportion d'upwind !
+! epsilp ! r ! <-- ! precision pour resol iter !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! relaxp ! r ! <-- ! coefficient de relaxation !
+! thetap ! r ! <-- ! coefficient de ponderation pour le !
+! ! ! ! theta-schema (on ne l'utilise pour le !
+! ! ! ! moment que pour u,v,w et les scalaire !
+! ! ! ! - thetap = 0.5 correspond a un schema !
+! ! ! ! totalement centre en temps (mixage !
+! ! ! ! entre crank-nicolson et adams- !
+! ! ! ! bashforth) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! pvara(ncelet ! tr ! <-- ! variable resolue (instant precedent) !
+! pvark(ncelet ! tr ! <-- ! variable de la sous-iteration !
+! ! ! ! precedente. pour un point fixe sur !
+! ! ! ! navsto elle permet d'initialiser par !
+! ! ! ! autre chose que pvara (elle vaut !
+! ! ! ! pvar=pvara pour les scalaires) !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour p !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! cofafp, b ! tr ! <-- ! tableaux des cond lim pour le flux de !
+! (nfabor) ! ! ! diffusion de p !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! viscfm(nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
+! ! ! ! pour la matrice !
+! viscbm(nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
+! ! ! ! pour la matrice !
+! viscfs(nfac) ! tr ! <-- ! idem viscfm pour second membre !
+! viscbs(nfabor ! tr ! <-- ! idem viscbm pour second membre !
+! rovsdt(ncelet ! tr ! <-- ! rho*volume/dt !
+! smbrp(ncelet ! tr ! <-- ! bilan au second membre !
+! pvar (ncelet ! tr ! <-- ! variable resolue !
+! dam(ncelet ! tr ! --> ! tableau de travail pour matrice !
+! ! ! ! et resultat estimateur !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! smbini(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+include "mltgrd.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer idtvar , ivar , iconvp , idiffp , ndircp
+integer nitmap
+integer imrgra , nswrsp , nswrgp , imligp , ircflp
+integer ischcp , isstpp , iescap , imgrp
+integer ncymxp , nitmfp
+integer ipp , iwarnp
+double precision blencp , epsilp , epsrgp , climgp , extrap
+double precision relaxp , thetap , epsrsp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pvara(ncelet), pvark(ncelet)
+double precision coefap(nfabor), coefbp(nfabor)
+double precision cofafp(nfabor), cofbfp(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision viscfm(nfac), viscbm(nfabor)
+double precision viscfs(nfac), viscbs(nfabor)
+double precision rovsdt(ncelet), smbrp(ncelet)
+double precision pvar(ncelet)
+double precision dam(ncelet), xam(nfac ,2)
+double precision dpvar(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet), w4(ncelet)
+double precision w5(ncelet), w6(ncelet), w7(ncelet), w8(ncelet)
+double precision smbini(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+character*8 cnom
+integer lchain
+integer idebia, idebra
+integer isym,ireslp,ireslq,ipol,isqrt
+integer inc,isweep,niterf,iccocg,iel,icycle,nswmod
+integer iphas,idimte,itenso,iinvpe, iinvpp
+integer idtva0
+integer iagmax, nagmax, npstmg
+double precision residu,rnorm
+double precision thetex
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! NOMS
+chaine = nomvar(ipp)
+cnom = chaine(1:8)
+
+! MATRICE A PRIORI SYMETRIQUE ( = 1)
+isym = 1
+if( iconvp.gt.0 ) isym = 2
+
+! METHODE DE RESOLUTION ET DEGRE DU PRECOND DE NEUMANN
+! 0 SI CHOIX AUTOMATIQUE GRADCO OU BICGSTAB
+! 0 SI CHOIX AUTOMATIQUE JACOBI
+! DONNE PAR IRESLP/1000 SI NON AUTOMATIQUE
+if (ireslp.eq.-1) then
+ ireslq = 0
+ ipol = 0
+ if( iconvp.gt.0 ) then
+ ireslq = 1
+ ipol = 0
+ endif
+else
+ ireslq = mod(ireslp,1000)
+ ipol = (ireslp-ireslq)/1000
+endif
+
+
+! PRISE DE SQRT DANS PS
+isqrt = 1
+
+! PRISE EN COMPTE DE LA PERIODICITE
+
+! Initialisation pour test avant promav
+iinvpe = 0
+
+if(iperio.eq.1) then
+
+
+! Par defaut, toutes les periodicites seront traitees dans percom,
+! les variables etant assimilees a des scalaires (meme si ce sont
+! des composantes de vecteurs ou de tenseur)
+ idimte = 0
+ itenso = 0
+
+ iinvpe = 1
+
+ do iphas = 1, nphas
+ if(ivar.eq.iu(iphas).or.ivar.eq.iv(iphas).or. &
+ ivar.eq.iw(iphas).or. &
+ ivar.eq.ir11(iphas).or.ivar.eq.ir12(iphas).or. &
+ ivar.eq.ir13(iphas).or.ivar.eq.ir22(iphas).or. &
+ ivar.eq.ir23(iphas).or.ivar.eq.ir33(iphas)) then
+
+! Pour la vitesse et les tensions de Reynolds, et les tpucou
+! seules seront echangees les informations sur les faces periodiques
+! de translation dans percom ; on ne touche pas aux informations
+! relatives aux faces de periodicite de rotation.
+ idimte = 0
+ itenso = 1
+
+! Lors de la resolution par increments, on echangera egalement les
+! informations relatives aux faces de periodicite de translation.
+! Pour les faces de periodicite de rotation, l'increment sera
+! annule dans percom (iinvpe=2).
+ iinvpe = 2
+
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 1. CONSTRUCTION MATRICE "SIMPLIFIEE" DE RESOLUTION
+!===============================================================================
+
+
+call matrix &
+!==========
+ ( ncelet , ncel , nfac , nfabor , &
+ iconvp , idiffp , ndircp , isym , nfecra , &
+ thetap , &
+ ifacel , ifabor , &
+ coefbp , rovsdt , flumas , flumab , viscfm , viscbm , &
+ dam , xam )
+
+! En stationnaire, on relaxe la diagonale
+if (idtvar.lt.0) then
+ do iel = 1, ncel
+ dam(iel) = dam(iel)/relaxp
+ enddo
+endif
+! CREATION DE LA HIERARCHIE DE MAILLAGE SI MULTIGRILLE
+
+if (imgrp.gt.0) then
+
+! --- Creation de la hierarchie de maillages
+
+ chaine = nomvar(ivar)
+ iwarnp = iwarni(ivar)
+ iagmax = iagmx0(ivar)
+ nagmax = nagmx0(ivar)
+ npstmg = ncpmgr(ivar)
+ lchain = 8
+
+ call clmlga &
+ !==========
+ ( chaine(1:8) , lchain , &
+ ncelet , ncel , nfac , &
+ isym , iagmax , nagmax , npstmg , iwarnp , &
+ ngrmax , ncegrm , &
+ dam , xam )
+
+endif
+
+
+!===============================================================================
+! 2. BOUCLES SUR LES NON ORTHOGONALITES
+! (A PARTIR DE LA SECONDE ITERATION)
+!===============================================================================
+
+! Application du theta schema
+
+! On calcule le bilan explicite total
+thetex = 1.d0 - thetap
+
+
+! Si THETEX=0, ce n'est pas la peine d'en rajouter
+if(abs(thetex).gt.epzero) then
+ inc = 1
+! ON POURRAIT METTRE ICCOCG A 0 DANS LES APPELS SUIVANT
+ iccocg = 1
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetex , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvara , pvara , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscfs , viscbs , &
+ smbrp , &
+! ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+endif
+
+! AVANT DE BOUCLER SUR LES SWEEP, ON STOCKE LE SECOND MEMBRE SANS
+! RECONSTRUCTION DANS LE TABLEAU AUXILIAIRE SMBINI
+
+do iel = 1, ncel
+ smbini(iel) = smbrp(iel)
+enddo
+
+! On initialise sur NCELET pour eviter une communication
+do iel = 1, ncelet
+ pvar(iel) = pvark(iel)
+enddo
+
+! On passe toujours dans bilsc2 avec INC=1
+inc = 1
+! Sauf pour les matrices poids (NSWRSP=-1)
+if (nswrsp.eq.-1) then
+ nswrsp = 1
+ inc = 0
+endif
+
+
+! Attention, pour les matrices poids il faut pouvoir ne faire
+! qu'un seul sweep
+nswmod = max( nswrsp, 1 )
+do 100 isweep = 1, nswmod
+
+! ---> INCREMENTATION ET RECONSTRUCTION DU SECOND MEMBRE
+! ON NE RECALCULE COCG QU'AU PREMIER PASSAGE (PRESQUE)
+
+ if( isweep.eq.1) then
+ iccocg = 1
+
+! On est entre avec un smb explicite base sur PVARA.
+! si on initialise avec PVAR avec autre chose que PVARA
+! on doit donc corriger SMBR (c'est le cas lorsqu'on itere sur navsto)
+ do iel = 1, ncel
+ smbini(iel) = smbini(iel) - &
+ rovsdt(iel)*(pvar(iel) - pvara(iel))
+ smbrp(iel) = smbini(iel)
+ enddo
+
+ else
+ iccocg = 0
+ do iel = 1, ncel
+! SMBINI CONTIENT LES TERMES INSTAT, EN DIV(RHO U) ET SOURCE DE MASSE
+! DU SECOND MEMBRE MIS A JOUR A CHAQUE SWEEP
+ smbini(iel) = smbini(iel) - rovsdt(iel)*dpvar(iel)
+ smbrp(iel) = smbini(iel)
+ enddo
+ endif
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvar , pvara , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscfs , viscbs , &
+ smbrp , &
+! ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ call prodsc(ncelet,ncel,isqrt,smbrp,smbrp,residu)
+
+! ---> RESIDU DE NORMALISATION CALCULE AU PREMIER SWEEP
+! (NORME C.L +TERMES SOURCES+ TERMES DE NON ORTHOGONALITE)
+
+! Attention, lors de l'appel a promav, ici pour une variable qui
+! n'est pas en increments et qui est supposee initialisee
+! y compris dans le halo.
+! Pour les variables vitesse et les tensions de Reynolds
+! (IINVPE=2), il ne faudra donc pas annuler le halo
+! des periodicites de rotation, mais au contraire le laisser
+! inchange.
+! Pour les autres variables (scalaires) IINVPE=1 permettra de
+! tout echanger, meme si c'est superflu.
+ if( isweep.eq.1 ) then
+ if(iinvpe.eq.2) then
+ iinvpp = 3
+ else
+ iinvpp = iinvpe
+ endif
+ call promav(ncelet,ncel,nfac,isym,iinvpp,ifacel, &
+ dam,xam,pvar,w1)
+ do iel = 1, ncel
+ w1(iel) = w1(iel) + smbrp(iel)
+ enddo
+ call prodsc(ncelet,ncel,isqrt,w1,w1,rnorm)
+ rnsmbr(ipp) = rnorm
+ endif
+
+! ---> RESOLUTION IMPLICITE SUR L'INCREMENT DPVAR
+
+ do iel = 1, ncel
+ dpvar(iel) = 0.d0
+ enddo
+
+ call invers &
+ !==========
+ ( cnom , idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isym , ipol , ireslq , nitmap , imgrp , &
+ ncymxp , nitmfp , &
+ iwarnp , nfecra , niterf , icycle , iinvpe , &
+ epsilp , rnorm , residu , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dam , xam , smbrp , dpvar , &
+ w3 , w4 , w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+
+ nbivar(ipp) = niterf
+ if(abs(rnorm).gt.epzero) then
+ resvar(ipp) = residu/rnorm
+ else
+ resvar(ipp) = 0.d0
+ endif
+
+! ---> INCREMENTATION SOLUTION
+
+ do iel = 1, ncel
+ pvar(iel) = pvar(iel)+dpvar(iel)
+ enddo
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (pvar)
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE : SEULE LA PERIODICITE IMPLICITE
+! EST ASSUREE (SCALAIRE ET TRANSLATION DE VECTEUR ET DE TENSEUR)
+
+if(iperio.eq.1) then
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar )
+endif
+
+! ---> TEST DE CONVERGENCE
+
+call prodsc(ncelet,ncel,isqrt,smbrp,smbrp,residu)
+
+if( residu.le.epsrsp*rnorm ) then
+ if(iwarnp.ge.1) then
+ write( nfecra,1000) cnom,isweep,residu,rnorm
+ endif
+ goto 200
+endif
+
+if(iwarnp.ge.3) then
+ write( nfecra,1000) cnom,isweep,residu,rnorm
+endif
+
+ 100 continue
+
+if(iwarnp.ge.2) then
+ write( nfecra,1100)cnom, nswmod
+endif
+
+!===============================================================================
+! 3. SORTIE OU CALCUL D'ESTIMATEURS POUR LES VITESSES
+! A L'ETAPE DE PREDICTION
+!===============================================================================
+
+ 200 continue
+
+! ---> TEST DE PASSAGE DANS LE CALCUL
+
+if (iescap.gt.0) then
+
+! ---> CALCUL DE LA CONTRIBUTION COMPOSANTE PAR COMPOSANTE. DE L ESTIMATEUR
+
+
+! SMBINI CONTIENT LES TERMES INSTAT ET EN DIV(U) DU SECOND MEMBRE
+! MIS A JOUR A CHAQUE SWEEP,DONC AU DERNIER, POUR KMAX +1, ON A:
+
+ do iel = 1,ncel
+ smbrp(iel) = smbini(iel) - rovsdt(iel)*dpvar(iel)
+ enddo
+
+ inc = 1
+ iccocg = 1
+! On calcule sans relaxation meme en stationnaire
+ idtva0 = 0
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtva0 , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvar , pvara , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscfs , viscbs , &
+ smbrp , &
+! ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! CONTRIBUTION DES NORMES L2 DES DIFFERENTES COMPOSANTES
+! DANS LE TABLEAU DAM QUI EST ICI DISPONIBLE.
+
+ do iel = 1,ncel
+ dam(iel) = (smbrp(iel)/ volume(iel))**2
+ enddo
+
+endif
+
+! SUPPRESSION DE LA HIERARCHIE DE MAILLAGES
+
+if (imgrp.gt.0) then
+ chaine = nomvar(ipp)
+ lchain = 8
+ call dsmlga(chaine(1:8), lchain)
+ !==========
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format ( &
+ 1X,A8,' : CV-DIF-TS',I5,' IT - RES= ',E12.5,' NORME= ', E12.5)
+ 1100 format ( &
+'@ ',/,&
+'@ @@ ATTENTION : ',A8 ,' CONVECTION-DIFFUSION-TERMES SOURCES ',/,&
+'@ ========= ',/,&
+'@ Nombre d''iterations maximal ',I10 ,' atteint ',/,&
+'@ ' )
+
+#else
+
+ 1000 format ( &
+ 1X,A8,' : CV-DIF-TS',I5,' IT - RES= ',E12.5,' NORM= ', E12.5)
+ 1100 format ( &
+'@ ',/,&
+'@ @@ WARNING: ',A8 ,' CONVECTION-DIFFUSION-SOURCE TERMS ',/,&
+'@ ======== ',/,&
+'@ Maximum number of iterations ',I10 ,' reached ',/,&
+'@ ' )
+
+#endif
+
+!12345678 : CV-DIF-TS 2000 IT - RES= 1234567890234 NORME= 12345678901234
+!ATTENTION 12345678 : NON CONVERGENCE DU SYSTEME CONV-DIFF-TS
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/condli.f90 b/src/base/condli.f90
new file mode 100644
index 0000000..45e0670
--- /dev/null
+++ b/src/base/condli.f90
@@ -0,0 +1,1873 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine condli &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , isvhb , isvtb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefa , coefb , uetbor , visvdr , hbord , thbord , frcxt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ coefu , rijipb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! TRADUCTION DES CONDITIONS AUX LIMITES FOURNIES PAR USCLIM.F
+! SOUS UNE FORME "SIMPLEMENT" ADMISSIBLE PAR LE SOLVEUR
+
+! CETTE TRADUCTION SE PRESENTE SOUS LA FORME D'UNE VALEUR PFAC DE
+! LA VARIABLE P CONSIDEREE A LA FACETTE :
+! PFAC = COEFA +COEFB.P(I)
+! P(I) : VALEUR DE LA VARIABLE DANS LA CELLULE FLUIDE ADJACENTE
+
+! ATTENTION : SI ON CONSIDERE L'INCREMENT DE LA VARIABLE, LA C.L SE
+! REDUIT A : d(PFAC) = COEFB.d(P(I))
+
+! CAS PARTICULIER DES VITESSES :
+! --> C.L PEUVENT COUPLER LES 3 COMPOSANTES DE VITESSES
+! (POUR L'INSTANT CE N'EST PAS LE CAS)
+
+! UXFAC = COEFAX +COEFBX *UX(I) +COEFU(1)*UY(I) +COEFU(2)*UZ(I)
+! UYFAC = COEFAY +COEFU(1)*UX(I) +COEFBY *UY(I) +COEFU(3)*UZ(I)
+! UZFAC = COEFAZ +COEFU(2)*UX(I) +COEFU(3)*UY(I) +COEFBZ *UZ(I)
+
+! On dispose du tableau de tri des faces de bord du
+! pas de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! isvhb ! e ! <-- ! indicateur de sauvegarde des !
+! ! ! ! coefficients d'echange aux bords !
+! isvtb ! e ! <-- ! indicateur de sauvegarde des !
+! ! ! ! temperatures aux bords !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! isostd ! te ! --> ! indicateur de sortie standard !
+! (nfabor+1) ! ! ! +numero de la face de reference !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! uetbor ! tr ! --> ! vitesse de frottement au bord !
+! (nfabor,nphas ! ! ! pour van driest en les !
+! visvdr(nphas) ! tr ! --> ! viscosite dynamique ds les cellules !
+! (ncelet,nphas ! ! ! de bord apres amortisst de v driest !
+! hbord ! tr ! --> ! coefficients d'echange aux bords !
+! (nfabor) ! ! ! !
+! thbord ! tr ! --> ! temperature aux bords en i' !
+! (nfabor) ! ! ! (plus exactmt : var. energetique) !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav pour valeurs en iprime !
+! (nfabor,3 ) ! ! ! des comp de la vitesse au bord !
+! rijipb ! tr ! --- ! tab de trav pour valeurs en iprime !
+! (nfabor,6 ) ! ! ! des rij au bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "albase.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "parall.h"
+include "matiss.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer isvhb , isvtb
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer isostd(nfabor+1,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision frcxt(ncelet,3,nphas)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision uetbor(nfabor,nphas), visvdr(ncelet,nphas)
+double precision hbord(nfabor),thbord(nfabor)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim), rijipb(nfabor,6)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac , iel , ivar , iphas
+integer isou , ii , iii , iiph
+integer ihcp , iscal , iscat
+integer inc , iccocg, iphydp
+integer iok , iok1
+integer icodcu
+integer isoent, isorti
+integer iclsym, ipatur, ipatrg, isvhbl
+integer iuiph , iviph , iwiph , ipriph
+integer ikiph , iepiph, iphiph, ifbiph, iomgip
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ipcvis, ipcvst, ipccp , ipcvsl, ipccv
+integer iclpr , iclu , iclv , iclw , iclk , iclep
+integer icl11 , icl22 , icl33 , icl12 , icl13 , icl23
+integer icluf , iclvf , iclwf , iclphi, iclfb , iclomg
+integer iclvar, iclvaf, icluma, iclvma, iclwma
+integer iismph, iyplbp
+integer nswrgp, imligp, iwarnp, icliva
+integer iph
+double precision sigma , cpp , rkl
+double precision hint , hext , pimp , xdis
+double precision flumbf, visclc, visctc, distbf, surfbn
+double precision epsrgp, climgp, extrap
+double precision ro0iph, p0iph , pr0iph, xxp0, xyp0, xzp0
+double precision srfbnf, rnx , rny , rnz
+double precision upx , upy , upz , vistot
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! On a besoin des COEFA et COEFB pour le calcul des gradients
+! pour les cond lim turb en paroi
+! Leur valeur en entree n'est donc pas ecrasee (au premier pas de
+! temps ils sont initialises dans INIVAR a flux nul)
+
+! COEFU sert a stocker la vitesse en I'
+! On l'utilise aussi pour stocker la pression en I' (dans TYPECL), etc
+
+idebia = idbia0
+idebra = idbra0
+
+! Initialisation du tableau pour stockage de yplus
+! On le remplit dans clptur
+
+if(mod(ipstdv,ipstyp).eq.0) then
+ do iphas = 1, nphas
+ iyplbp = iyplbr+(iphas-1)*nfabor
+ do ifac = 1, nfabor
+ ra(iyplbp+ifac-1) = 0.d0
+ enddo
+ enddo
+endif
+
+
+!===============================================================================
+! 2. TRAITEMENT DES CONDITIONS DONNES PAR ITYPFB
+!===============================================================================
+
+
+if(ippmod(iphpar).ge.1) then
+ call pptycl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , ia(iitrif) , ia(iitypf) , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+endif
+
+if (imatis.eq.1) then
+ call mttycl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iitypf) , ia(iitrif) , icodcl , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , frcxt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+endif
+
+if (iale.eq.1) then
+ call altycl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iitypf) , ia(iialty) , icodcl , ia(iimpal) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ rcodcl , ra(ixyzn0) , ra(idepal) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+endif
+
+call typecl &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iitypf) , ia(iitrif) , icodcl , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , frcxt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 2. VERIFICATION DE LA CONSISTANCE DES CL
+!===============================================================================
+
+call vericl &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 4. DISTANCE A LA PAROI ANCIEN MODELE
+!===============================================================================
+! attention, si on s'en sert pour autre chose, disons le module X
+! bien faire attention dans verini avec quelles options le module
+! X doit alors etre incompatible (perio, parall).
+
+iok1 = 0
+
+if(ineedy.eq.1.and.abs(icdpar).eq.2) then
+
+ do iphas = 1, nphas
+
+ if(ia(iifapa(iphas)).le.0) then
+
+! ON FERA ATTENTION EN PARALLELISME OU PERIODICITE
+! (UNE PAROI PEUT ETRE PLUS PROCHE EN TRAVERSANT UN BORD ...)
+
+ do iel = 1, ncel
+ w1(iel) = grand
+ enddo
+
+ iuiph = iu(iphas)
+
+ do ifac = 1, nfabor
+ icodcu = icodcl(ifac,iuiph)
+ if( icodcu.eq.5 .or. icodcu.eq.6 ) then
+ do iel = 1, ncel
+ xdis = &
+ (cdgfbo(1,ifac)-xyzcen(1,iel))**2 &
+ +(cdgfbo(2,ifac)-xyzcen(2,iel))**2 &
+ +(cdgfbo(3,ifac)-xyzcen(3,iel))**2
+ if(w1(iel).gt.xdis) then
+ w1(iel) = xdis
+ ia(iifapa(iphas)-1+iel) = ifac
+ endif
+ enddo
+ endif
+ enddo
+
+ endif
+
+ iok = 0
+ do iel = 1, ncel
+ if(ia(iifapa(iphas)-1+iel).le.0)then
+ iok = iok + 1
+ endif
+ enddo
+ if(iok.gt.0) then
+ write(nfecra,1000) iphas,iphas,irijec(iphas), &
+ iphas,idries(iphas)
+ iok1 = 1
+ endif
+
+ enddo
+
+endif
+
+! Normalement, on ne passe pas en parallele ici,
+! mais au cas ou ...
+if(irangp.ge.0) then
+ call parcpt(iok1)
+endif
+
+if(iok1.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+
+!===============================================================================
+! 6. DEBUT DE LA BOUCLE SUR LES PHASES
+! ET REPERAGE DES VARIABLES
+!===============================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+! --- Variables
+ ro0iph = ro0 (iphas)
+ p0iph = p0 (iphas)
+ pr0iph = pred0(iphas)
+ xxp0 = xyzp0(1,iphas)
+ xyp0 = xyzp0(2,iphas)
+ xzp0 = xyzp0(3,iphas)
+ ipriph = ipr (iphas)
+ iuiph = iu (iphas)
+ iviph = iv (iphas)
+ iwiph = iw (iphas)
+ if(itytur(iphas).eq.2) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+ elseif(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ iepiph = iep (iphas)
+ elseif(iturb(iphas).eq.50) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+ iphiph = iphi(iphas)
+ ifbiph = ifb (iphas)
+ elseif(iturb(iphas).eq.60) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+ endif
+
+! --- Conditions aux limites
+ iclpr = iclrtp(ipriph,icoef)
+ iclu = iclrtp(iuiph ,icoef)
+ iclv = iclrtp(iviph ,icoef)
+ iclw = iclrtp(iwiph ,icoef)
+ if(itytur(iphas).eq.2) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclep = iclrtp(iepiph,icoef)
+ elseif(itytur(iphas).eq.3) then
+ icl11 = iclrtp(ir11ip,icoef)
+ icl22 = iclrtp(ir22ip,icoef)
+ icl33 = iclrtp(ir33ip,icoef)
+ icl12 = iclrtp(ir12ip,icoef)
+ icl13 = iclrtp(ir13ip,icoef)
+ icl23 = iclrtp(ir23ip,icoef)
+ iclep = iclrtp(iepiph,icoef)
+ elseif(iturb(iphas).eq.50) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclep = iclrtp(iepiph,icoef)
+ iclphi = iclrtp(iphiph,icoef)
+ iclfb = iclrtp(ifbiph,icoef)
+ elseif(iturb(iphas).eq.60) then
+ iclk = iclrtp(ikiph ,icoef)
+ iclomg = iclrtp(iomgip,icoef)
+ endif
+
+ icluf = iclrtp(iuiph ,icoeff)
+ iclvf = iclrtp(iviph ,icoeff)
+ iclwf = iclrtp(iwiph ,icoeff)
+
+! --- Grandeurs physiques
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+ else
+ ipccp = 0
+ endif
+! --- Compressible
+ if ( ippmod(icompf).ge.0 ) then
+ if(icv(iphas).gt.0) then
+ ipccv = ipproc(icv (iphas))
+ else
+ ipccv = 0
+ endif
+ endif
+
+
+
+!===============================================================================
+! 6. CONSTRUCTION DE LA TEMPERATURE OU ENTHALPIE
+! AU CENTRE DES FACES DE BORD (OBTENUS PAR Fi + II'.GRAD(Fi))
+
+! POUR LE COUPLAGE SYRTHES
+! THBORD EST UTILISE PAR COUPBO EN SORTIE DE CONDLI
+! POUR LE COUPLAGE AVEC LE MODULE THERMIQUE 1D DE PAROI
+! THBORD EST UTILISE PAR COU1DO EN SORTIE DE CONDLI
+! POUR LE RAYONNEMENT
+! THBORD EST DANS LA BOUCLE POUR CONSTUIRE LE FLUX QUI SERT
+! DANS RAYPAR.
+
+! LE CAS PLUSIEURS PHASES COUPLEES AVEC SYRTHES N'EST PAS PREVU.
+! LE CAS PLUSIEURS PHASES COUPLEES AVEC LE MODULE 1D N'EST PAS PREVU.
+
+
+! CECI POURRAIT EN PRATIQUE ETRE HORS DE LA BOUCLE.
+
+!===============================================================================
+
+! Pour le couplage SYRTHES ou module thermique 1D
+! -----------------------------------------------
+! Ici, on fait une boucle "inutile" (on ne fait quelque chose
+! que pour ICPSYR(ISCAL) = 1). C'est pour preparer le traitement
+! eventuel de plusieurs temperatures (ie plusieurs couplages
+! SYRTHES a la fois ; noter cependant que meme dans ce cas,
+! une seule temperature sera recue de chaque couplage. En polyph,
+! il faudrait ensuite reconstruire les enthalpies des phases ...
+! plus tard si necessaire).
+! Ici, il ne peut y avoir qu'un seul scalaire avec ICPSYR = 1 et
+! ce uniquement s'il y a effectivement couplage avec SYRTHES
+! (sinon, on s'est arrete dans verini)
+! Dans le cas du couplage avec le module 1D, on utilise le scalaire
+! couple avec Syrthes s'il y a couplage, sinon ISCALT(1).
+! La valeur de ISVTB a ete initialisee dans tridim
+! au numero du scalaire couple.
+
+
+! Pour le rayonnement
+! -------------------
+! On calcule la valeur en I' s'il y a une variable
+! thermique sur la phase
+
+
+! On recherche l'unique scalaire qui convient pour la phase courante
+! (ce peut etre T, H, ou E (en compressible))
+
+ iscat = 0
+
+! Si un scalaire est couple a SYRTHES ou au module 1D
+ if(isvtb.ne.0) then
+! et qu'il est relatif a la phase courante
+ if(iphsca(isvtb).eq.iphas) then
+! si ce n'est pas la variable thermique, ca ne va pas.
+ if(isvtb.ne.iscalt(iphas)) then
+ write(nfecra,8000)isvtb,iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+! sinon, on calcule le gradient.
+ else
+ iscat = isvtb
+ endif
+ endif
+ endif
+
+
+! S'il y a du rayonnement sur la phase
+! (il y a forcement une variable energetique)
+! on en calcule le gradient
+ if(iirayo.ge.1 .and. iphas.eq.irapha) then
+ iscat = iscalt(iphas)
+ endif
+
+! S'il y a un scalaire dont il faut calculer le gradient
+! ... on le calcule.
+ if (iscat .gt. 0) then
+
+ ivar = isca(iscat)
+
+ if (ntcabs.gt.1 .and. itbrrb.eq.1) then
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ icliva = iclrtp(ivar,icoef)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,ivar) , coefa(1,icliva) , coefb(1,icliva) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do ifac = 1 , nfabor
+ iel = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ thbord(ifac) = &
+ w1(iel)*ra(iii+1)+w2(iel)*ra(iii+2)+w3(iel)*ra(iii+3) &
+ + rtpa(iel,ivar)
+ enddo
+
+ else
+
+ do ifac = 1 , nfabor
+ iel = ifabor(ifac)
+ thbord(ifac) = rtpa(iel,ivar)
+ enddo
+
+ endif
+
+ endif
+
+! --- La boucle sur les phases continue
+!===============================================================================
+! 6. CONSTRUCTION DE LA VITESSE ET DU TENSEUR DE REYNOLDS
+! AU CENTRE DES FACES DE BORD (OBTENUS PAR Fi + II'.GRAD(Fi))
+! S'IL Y A DES SYMETRIES OU DES PAROIS TURBULENTES
+!===============================================================================
+
+! ---> INDICATEUR SYMETRIES OU PAROIS TURBULENTES
+
+ iclsym = 0
+ ipatur = 0
+ ipatrg = 0
+ do ifac = 1, nfabor
+ if ( icodcl(ifac,iuiph).eq.4 ) then
+ iclsym = 1
+ elseif ( icodcl(ifac,iuiph).eq.5 ) then
+ ipatur = 1
+ elseif ( icodcl(ifac,iuiph).eq.6 ) then
+ ipatrg = 1
+ endif
+ if (iclsym.ne.0.and.ipatur.ne.0.and.ipatrg.ne.0 ) goto 100
+ enddo
+ 100 continue
+
+ if (irangp.ge.0) then
+ call parcmx(iclsym)
+ call parcmx(ipatur)
+ call parcmx(ipatrg)
+ endif
+
+
+! ---> CONSTRUCTION DE LA VITESSE AU CENTRE DES FACES DE BORD
+
+ if (iclsym.ne.0.or.ipatur.ne.0.or.ipatrg.ne.0) then
+
+
+ do isou = 1, 3
+
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+
+ if(ntcabs.gt.1) then
+
+ iccocg = 1
+ inc = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ icliva = iclrtp(ivar,icoef)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,ivar) , coefa(1,icliva) , coefb(1,icliva) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ coefu(ifac,isou) = &
+ w1(iel)*ra(iii+1)+w2(iel)*ra(iii+2)+w3(iel)*ra(iii+3) &
+ + rtpa(iel,ivar)
+ enddo
+
+ else
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ coefu(ifac,isou) = rtpa(iel,ivar)
+ enddo
+
+ endif
+
+ enddo
+
+ endif
+
+
+! ---> CONSTRUCTION DU TENSEUR DE REYNOLDS AU CENTRE DES FACES DE BORD
+
+ if ((iclsym.ne.0.or.ipatur.ne.0.or.ipatrg.ne.0) &
+ .and.itytur(iphas).eq.3) then
+
+
+ do isou = 1 , 6
+
+ if(isou.eq.1) ivar = ir11ip
+ if(isou.eq.2) ivar = ir22ip
+ if(isou.eq.3) ivar = ir33ip
+ if(isou.eq.4) ivar = ir12ip
+ if(isou.eq.5) ivar = ir13ip
+ if(isou.eq.6) ivar = ir23ip
+
+
+ if(ntcabs.gt.1.and.irijrb(iphas).eq.1) then
+
+! CALCUL DU GRADIENT CELLULE DE Rij EN I
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ icliva = iclrtp(ivar,icoef)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr ,nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,ivar) , coefa(1,icliva) , coefb(1,icliva) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! CALCUL DE LA VALEUR EN I' DE Rij
+
+ do ifac = 1 , nfabor
+ iel = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ rijipb(ifac,isou) = &
+ w1(iel)*ra(iii+1)+w2(iel)*ra(iii+2)+w3(iel)*ra(iii+3) &
+ + rtpa(iel,ivar)
+ enddo
+
+
+! AU PREMIER PAS DE TEMPS, ON NE CONNAIT PAS COEFA ET COEFB
+! (ILS SONT ANNULES DANS CONDLI), LE CALCUL DE RI' EST SIMPLIFIE
+
+ else
+
+ do ifac = 1 , nfabor
+ iel = ifabor(ifac)
+ rijipb(ifac,isou) = rtpa(iel,ivar)
+ enddo
+
+ endif
+
+ enddo
+
+ endif
+
+! --- La boucle sur les phases continues
+!===============================================================================
+! 7. TURBULENCE EN PAROI : TOUTES LES VARIABLES CONCERNEES PAR PHASE
+! (U,V,W,K,EPSILON,RIJ,TEMPERATURE)
+!===============================================================================
+! --- On a besoin de COEFU et de RIJIPB (et THBORD pour le rayonnement)
+! --- On suppose que tout scalaire qui dispose de cl de paroi est
+! associe a une phase (qui permet entre autre de calculer yplus)
+
+! On initialise VISVDR a -999.D0.
+! Dans clptur, on amortit la viscosite turbulente sur les cellules
+! de paroi si on a active van Driest. La valeur finale est aussi
+! stockee dans VISVDR.
+! Plus loin, dans vandri, la viscosite sur les cellules
+! de paroi sera amortie une seconde fois. On se sert alors de
+! VISVDR pour lui redonner une valeur correcte.
+ if(itytur(iphas).eq.4.and.idries(iphas).eq.1) then
+ do iel=1,ncel
+ visvdr(iel,iphas) = -999.d0
+ enddo
+ endif
+
+ if (ipatur.ne.0) then
+
+! Smooth wall laws
+ call clptur &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , isvhb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefu , rijipb , coefa , coefb , uetbor , visvdr , &
+ hbord , thbord , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ if (ipatrg.ne.0) then
+
+! Rough wall laws
+ call clptrg &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , isvhb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefu , rijipb , coefa , coefb , uetbor , visvdr , &
+ hbord , thbord , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! --- La boucle sur les phases continue
+!===============================================================================
+! 7. SYMETRIES POUR LES VECTEURS ET TENSEURS
+! (U,V,W,RIJ)
+!===============================================================================
+! On a besoin de COEFU et de RIJIPB
+
+ iismph = iisymp +nfabor*(iphas-1)
+ do ifac = 1, nfabor
+ ia(iismph+ifac-1) = 1
+ enddo
+
+ if (iclsym.ne.0) then
+
+ call clsyvt &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefu , rijipb , coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! --- La boucle sur les phases continue
+!===============================================================================
+! 8. VITESSE : SORTIE, DIRICHLET, NEUMANN
+!===============================================================================
+
+! ---> SORTIE : SI FLUX ENTRANT, ON "BLOQUE" A L'INFINI AVAL
+
+ isoent = 0
+ isorti = 0
+ do ifac = 1, nfabor
+
+ flumbf = propfb(ifac,ipprob(ifluma(iuiph)))
+
+ if( icodcl(ifac,iuiph).eq.9 ) then
+
+ isorti = isorti + 1
+ if( flumbf.lt.-epzero) then
+ coefa(ifac,iclu) = 0.d0
+ coefb(ifac,iclu) = 0.d0
+ coefa(ifac,iclv) = 0.d0
+ coefb(ifac,iclv) = 0.d0
+ coefa(ifac,iclw) = 0.d0
+ coefb(ifac,iclw) = 0.d0
+ isoent = isoent + 1
+ else
+ coefa(ifac,iclu) = 0.d0
+ coefb(ifac,iclu) = 1.d0
+ coefa(ifac,iclv) = 0.d0
+ coefb(ifac,iclv) = 1.d0
+ coefa(ifac,iclw) = 0.d0
+ coefb(ifac,iclw) = 1.d0
+ endif
+
+ endif
+
+ enddo
+
+ if ( mod(ntcabs,ntlist).eq.0 .or. iwarni(iu(1)).ge. 0 ) then
+ if(isorti.gt.0.and.(iwarni(iuiph).ge.2.or.isoent.gt.0)) then
+ write(nfecra,3010)iphas, isoent,isorti
+ endif
+ endif
+
+! ---> DIRICHLET ET FLUX
+
+ do ii = 1, 3
+
+ if(ii.eq.1) then
+ ivar = iuiph
+ iclvar = iclu
+ elseif(ii.eq.2) then
+ ivar = iviph
+ iclvar = iclv
+ elseif(ii.eq.3) then
+ ivar = iwiph
+ iclvar = iclw
+ endif
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visclc = propce(iel,ipcvis)
+ visctc = propce(iel,ipcvst)
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+ if (itytur(iphas).eq.3) then
+ hint = visclc /distbf
+ else
+ hint = ( visclc+visctc )/distbf
+ endif
+
+! C.L DE TYPE DIRICHLET
+ if( icodcl(ifac,ivar).eq.1 ) then
+ hext = rcodcl(ifac,ivar,2)
+ if(abs(hext).gt.rinfin*0.5d0) then
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = pimp
+ coefb(ifac,iclvar) = 0.d0
+ else
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint +hext)
+ coefb(ifac,iclvar) = hint /(hint +hext)
+ endif
+
+! C.L DE TYPE FLUX
+ elseif( icodcl(ifac,ivar).eq.3 ) then
+ coefa(ifac,iclvar) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvar) = 1.d0
+ endif
+
+ enddo
+
+ enddo
+
+! ---> COEFAF ET COEFBF
+! POUR TOUS LES CODES SAUF 4, 5 ET 6 TRAITES SEPAREMENT
+
+ do ii = 1, 3
+
+ if(ii.eq.1) then
+ ivar = iuiph
+ iclvar = iclu
+ iclvaf = icluf
+ elseif(ii.eq.2) then
+ ivar = iviph
+ iclvar = iclv
+ iclvaf = iclvf
+ elseif(ii.eq.3) then
+ ivar = iwiph
+ iclvar = iclw
+ iclvaf = iclwf
+ endif
+
+ if(iclvaf.ne.iclvar) then
+ do ifac = 1, nfabor
+ if( icodcl(ifac,ivar).eq.1.or.icodcl(ifac,ivar).eq.3.or. &
+ icodcl(ifac,ivar).eq.9 ) then
+ coefa(ifac,iclvaf) = coefa(ifac,iclvar)
+ coefb(ifac,iclvaf) = coefb(ifac,iclvar)
+ endif
+ enddo
+ endif
+
+ enddo
+
+
+! --- La boucle sur les phases continue
+!===============================================================================
+! 9. PRESSION : DIRICHLET, NEUMANN
+!===============================================================================
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+! ON MET UN FLUX EN DT.GRAD P (W/m2) DANS USCLIM
+ hint = dt(iel)/distbf
+
+! On doit remodifier la valeur du Dirichlet de pression de mani�re
+! � retrouver P*. Car dans typecl.F on a travaill� avec la pression
+! totale fournie par l'utilisateur : Ptotale= P*+ rho.g.r
+! En compressible, on laisse RCODCL tel quel
+
+! C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+
+ if( icodcl(ifac,ipriph).eq.1 ) then
+ hext = rcodcl(ifac,ipriph,2)
+ if ( ippmod(icompf).ge.0 ) then
+ pimp = rcodcl(ifac,ipriph,1)
+ else
+ pimp = rcodcl(ifac,ipriph,1) &
+ - ro0iph*( gx*(cdgfbo(1,ifac)-xxp0) &
+ + gy*(cdgfbo(2,ifac)-xyp0) &
+ + gz*(cdgfbo(3,ifac)-xzp0) ) &
+ + pr0iph - p0iph
+ endif
+ if( abs(hext).gt.rinfin*0.5d0 ) then
+ coefa(ifac,iclpr) = pimp
+ coefb(ifac,iclpr) = 0.d0
+ else
+ coefa(ifac,iclpr) = hext*pimp/(hint +hext)
+ coefb(ifac,iclpr) = hint /(hint +hext)
+ endif
+ endif
+
+! C.L DE TYPE FLUX
+ if( icodcl(ifac,ipriph).eq.3 ) then
+ coefa(ifac,iclpr) = -rcodcl(ifac,ipriph,3)/hint
+ coefb(ifac,iclpr) = 1.d0
+ endif
+
+ enddo
+
+
+! --- La boucle sur les phases continue
+!===============================================================================
+! 10. K, EPSILON, RIJ, V2F, OMEGA : DIRICHLET, NEUMANN
+!===============================================================================
+
+! ---> K-EPSILON ET K-OMEGA
+
+ if(itytur(iphas).eq.2 .or. iturb(iphas).eq.60) then
+
+ do ii = 1, 2
+
+! Pour le k-omega, on met les valeurs sigma_k2 et sigma_w2 car ce terme
+! ne concerne en pratique que les entrees (pas de pb en paroi ou en flux
+! nul)
+ if(ii.eq.1 .and. itytur(iphas).eq.2) then
+ ivar = ikiph
+ iclvar = iclk
+ sigma = sigmak
+ elseif(ii.eq.1 .and. iturb(iphas).eq.60) then
+ ivar = ikiph
+ iclvar = iclk
+ sigma = ckwsk2
+ elseif (itytur(iphas).eq.2) then
+ ivar = iepiph
+ iclvar = iclep
+ sigma = sigmae
+ else
+ ivar = iomgip
+ iclvar = iclomg
+ sigma = ckwsw2
+ endif
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visclc = propce(iel,ipcvis)
+ visctc = propce(iel,ipcvst)
+ flumbf = propfb(ifac,ipprob(ifluma(ikiph)))
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+ hint = (visclc+visctc/sigma)/distbf
+
+! C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+ if(icodcl(ifac,ivar).eq.1) then
+ hext = rcodcl(ifac,ivar,2)
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint +hext)
+ coefb(ifac,iclvar) = hint /(hint +hext)
+! C.L DE TYPE FLUX
+ elseif(icodcl(ifac,ivar).eq.3)then
+ coefa(ifac,iclvar) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvar) = 1.d0
+ endif
+ enddo
+
+ enddo
+
+! ---> RIJ-EPSILON
+! (ATTENTION, PAS DE VISCT)
+
+ elseif(itytur(iphas).eq.3) then
+
+! --> RIJ
+
+ do isou = 1, 6
+
+ if(isou.eq.1) then
+ ivar = ir11ip
+ iclvar = icl11
+ elseif(isou.eq.2) then
+ ivar = ir22ip
+ iclvar = icl22
+ elseif(isou.eq.3) then
+ ivar = ir33ip
+ iclvar = icl33
+ elseif(isou.eq.4) then
+ ivar = ir12ip
+ iclvar = icl12
+ elseif(isou.eq.5) then
+ ivar = ir13ip
+ iclvar = icl13
+ elseif(isou.eq.6) then
+ ivar = ir23ip
+ iclvar = icl23
+ endif
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visclc = propce(iel,ipcvis)
+ flumbf = propfb(ifac,ipprob(ifluma(ir11ip)))
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+ if(icodcl(ifac,ivar).eq.1) then
+ hint = visclc/distbf
+
+ hext = rcodcl(ifac,ivar,2)
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint +hext)
+ coefb(ifac,iclvar) = hint /(hint +hext)
+
+ elseif(icodcl(ifac,ivar).eq.3)then
+
+ hint = visclc/distbf
+
+ coefa(ifac,iclvar) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvar) = 1.d0
+
+ endif
+
+ enddo
+
+ enddo
+
+
+! --> EPSILON
+
+ ivar = iepiph
+ iclvar = iclep
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visclc = propce(iel,ipcvis)
+ flumbf = propfb(ifac,ipprob(ifluma(iepiph)))
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+ hint = visclc/distbf
+
+! C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+ if( icodcl(ifac,ivar).eq.1) then
+ hext = rcodcl(ifac,ivar,2)
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint +hext)
+ coefb(ifac,iclvar) = hint /(hint +hext)
+! C.L DE TYPE FLUX
+ elseif( &
+ icodcl(ifac,ivar).eq.3)then
+ coefa(ifac,iclvar) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvar) = 1.d0
+ endif
+
+ enddo
+
+! ---> V2F
+
+ elseif(iturb(iphas).eq.50) then
+
+! --> K, EPSILON ET PHI
+ do ii = 1, 3
+
+ if(ii.eq.1) then
+ ivar = ikiph
+ iclvar = iclk
+ sigma = sigmak
+ elseif(ii.eq.2) then
+ ivar = iepiph
+ iclvar = iclep
+ sigma = sigmae
+ else
+ ivar = iphiph
+ iclvar = iclphi
+ sigma = sigmak
+ endif
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visclc = propce(iel,ipcvis)
+ visctc = propce(iel,ipcvst)
+ flumbf = propfb(ifac,ipprob(ifluma(ikiph)))
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+ hint = (visclc+visctc/sigma)/distbf
+
+! C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+ if(icodcl(ifac,ivar).eq.1) then
+ hext = rcodcl(ifac,ivar,2)
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint +hext)
+ coefb(ifac,iclvar) = hint /(hint +hext)
+! C.L DE TYPE FLUX
+
+ elseif(icodcl(ifac,ivar).eq.3)then
+ coefa(ifac,iclvar) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvar) = 1.d0
+ endif
+ enddo
+
+ enddo
+
+! --> FB
+
+ ivar = ifbiph
+ iclvar = iclfb
+
+ do ifac = 1, nfabor
+
+! --- Proprietes physiques
+ visclc = 1.d0
+ flumbf = propfb(ifac,ipprob(ifluma(ifbiph)))
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+ hint = visclc/distbf
+
+! C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+ if( icodcl(ifac,ivar).eq.1) then
+ hext = rcodcl(ifac,ivar,2)
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint +hext)
+ coefb(ifac,iclvar) = hint /(hint +hext)
+! C.L DE TYPE FLUX
+ elseif(icodcl(ifac,ivar).eq.3)then
+ coefa(ifac,iclvar) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvar) = 1.d0
+ endif
+
+ enddo
+
+ endif
+
+! --- La boucle sur les phases continue
+!===============================================================================
+! 11. SCALAIRES (AUTRES QUE PRESSION, K, EPSILON, RIJ, OMEGA, VARIANCES)
+! : DIRICHLET, NEUMANN
+!===============================================================================
+
+ if(nscal.ge.1) then
+
+ do ii = 1, nscal
+
+ if(iphsca(ii).eq.iphas) then
+
+ ivar = isca(ii)
+ iclvar = iclrtp(ivar,icoef)
+ iclvaf = iclrtp(ivar,icoeff)
+
+ isvhbl = 0
+ if(ii.eq.isvhb) then
+ isvhbl = isvhb
+ endif
+
+ if(ivisls(ii).gt.0) then
+ ipcvsl = ipproc(ivisls(ii))
+ else
+ ipcvsl = 0
+ endif
+
+! --- Indicateur de prise en compte de Cp ou non
+! (selon si le scalaire (scalaire associe pour une fluctuation)
+! doit etre ou non traite comme une temperature)
+! Si le scalaire est une variance et que le
+! scalaire associe n'est pas resolu, on suppose alors qu'il
+! doit etre traite comme un scalaire passif (defaut IHCP = 0)
+ ihcp = 0
+ if(iscavr(ii).le.nscal) then
+ if(iscavr(ii).gt.0) then
+ iscal = iscavr(ii)
+ else
+ iscal = ii
+ endif
+ if(iscsth(iscal).eq.0.or.iscsth(iscal).eq.2 &
+ .or.iscsth(iscal).eq.3) then
+ ihcp = 0
+ elseif(abs(iscsth(iscal)).eq.1) then
+ if(ipccp.gt.0) then
+ ihcp = 2
+ else
+ ihcp = 1
+ endif
+ endif
+ endif
+
+! --- Boucle sur les faces
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+! --- Proprietes physiques
+ visctc = propce(iel,ipcvst)
+ flumbf = propfb(ifac,ipprob(ifluma(ivar)))
+
+! --- Grandeurs geometriques
+ distbf = ra(idistb-1+ifac)
+
+! --- Prise en compte de Cp ou CV
+! (dans le Cas compressible IHCP=0)
+
+ cpp = 1.d0
+ if(ihcp.eq.0) then
+ cpp = 1.d0
+ elseif(ihcp.eq.2) then
+ cpp = propce(iel,ipccp )
+ elseif(ihcp.eq.1) then
+ cpp = cp0(iphas)
+ endif
+ hint = cpp
+
+! --- Viscosite variable ou non
+ if (ipcvsl.le.0) then
+ rkl = visls0(ii)
+ else
+ rkl = propce(iel,ipcvsl)
+ endif
+
+! --- Cas turbulent
+ if (iturb(iphas).ne.0) then
+ hint = hint*(rkl+visctc/sigmas(ii))/distbf
+! Cas laminaire
+ else
+ hint = hint*rkl/distbf
+ endif
+
+! ---> C.L DE TYPE DIRICHLET AVEC OU SANS COEFFICIENT D'ECHANGE
+
+ if( icodcl(ifac,ivar).eq.1) then
+ hext = rcodcl(ifac,ivar,2)
+ if(abs(hext).ge.rinfin*0.5d0) then
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = pimp
+ coefb(ifac,iclvar) = 0.d0
+ else
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint+hext)
+ coefb(ifac,iclvar) = hint /(hint+hext)
+ endif
+
+! On utilise le Dirichlet pour les calculs de gradients
+! et pour les flux de bord.
+
+ if(iclvaf.ne.iclvar) then
+ coefa(ifac,iclvaf) = coefa(ifac,iclvar)
+ coefb(ifac,iclvaf) = coefb(ifac,iclvar)
+ endif
+
+! ---> COUPLAGE : on stocke le hint (lambda/d en temperature,
+! lambda/(cp d) en enthalpie,
+! lambda/(cv d) en energie)
+
+ if (isvhbl .gt. 0) then
+ hbord(ifac) = hint
+ endif
+
+
+!--> Rayonnement :
+
+! On stocke le coefficient d'echange lambda/distance
+! (ou son equivalent en turbulent) quelle que soit la
+! variable thermique transportee (temperature ou enthalpie)
+! car on l'utilise pour realiser des bilans aux parois qui
+! sont faits en temperature (on cherche la temperature de
+! paroi quelle que soit la variable thermique transportee pour
+! ecrire des eps sigma T4).
+
+! donc :
+
+! lorsque la variable transportee est la temperature
+! ABS(ISCSTH(II)).EQ.1 : RA(IHCONV-1+IFAC+NFABOR*(IPH-1)) = HINT
+! puisque HINT = VISLS * CP / DISTBR
+! = lambda/distance en W/(m2 K)
+
+! lorsque la variable transportee est l'enthalpie
+! ISCSTH(II).EQ.2 : RA(IHCONV-1+IFAC+NFABOR*(IPH-1)) = HINT*CPR
+! avec
+! IF(IPCCP.GT.0) THEN
+! CPR = PROPCE(IEL,IPCCP )
+! ELSE
+! CPR = CP0(IPHAS)
+! ENDIF
+! puisque HINT = VISLS / DISTBR
+! = lambda/(CP * distance)
+
+! lorsque la variable transportee est l'energie
+! ISCSTH(II).EQ.3 :
+! on procede comme pour l'enthalpie avec CV au lieu de CP
+! (rq : il n'y a pas d'hypoth�se, sf en non orthogonal :
+! le flux est le bon et le coef d'echange aussi)
+
+! De meme plus bas et de meme dans clptur.
+
+! Si on rayonne sur la phase et que
+! le scalaire est la variable energetique
+
+ if (iirayo.ge.1 .and. &
+ ii.eq.iscalt(iphas) .and. iphas.eq.irapha ) then
+
+! On calcule le coefficient d'echange en W/(m2 K)
+
+! Si on resout en enthalpie
+ if(iscsth(ii).eq.2) then
+! Si Cp variable
+ if(ipccp.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hint*propce(iel,ipccp )
+ else
+ propfb(ifac,ipprob(ihconv)) = hint*cp0(iphas)
+ endif
+! Si on resout en energie (compressible)
+ elseif(iscsth(ii).eq.3) then
+! Si Cv variable
+ if(ipccv.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hint*propce(iel,ipccv )
+ else
+ propfb(ifac,ipprob(ihconv)) = hint*cv0(iphas)
+ endif
+! Si on resout en temperature
+ elseif(abs(iscsth(ii)).eq.1) then
+ propfb(ifac,ipprob(ihconv)) = hint
+ endif
+
+! On recupere le flux h(Ti'-Tp) (sortant ou
+! negatif si gain pour le fluide) en W/m2
+
+ propfb(1,ipprob(ifconv)-1+ifac) = &
+ hint*( (1.d0-coefb(ifac,iclvaf))*thbord(ifac) &
+ - coefa(ifac,iclvaf))
+
+ endif
+
+! ---> C.L DE TYPE FLUX
+
+ elseif(icodcl(ifac,ivar).eq.3)then
+ coefa(ifac,iclvaf) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvaf) = 1.d0
+ if(iclvar.ne.iclvaf) then
+ coefa(ifac,iclvar) = 0.d0
+ coefb(ifac,iclvar) = 1.d0
+ endif
+ if (isvhbl .gt. 0) hbord(ifac) = hint
+
+
+!--> Rayonnement :
+
+ if (iirayo.ge.1 .and. &
+ ii.eq.iscalt(iphas) .and. iphas.eq.irapha ) then
+
+! On calcule le coefficient d'echange en W/(m2 K)
+
+! Si on resout en enthalpie
+ if(iscsth(ii).eq.2) then
+! Si Cp variable
+ if(ipccp.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hint*propce(iel,ipccp )
+ else
+ propfb(ifac,ipprob(ihconv)) = hint*cp0(iphas)
+ endif
+ elseif(iscsth(ii).eq.3) then
+! Si Cv variable
+ if(ipccv.gt.0) then
+ propfb(ifac,ipprob(ihconv)) = hint*propce(iel,ipccv )
+ else
+ propfb(ifac,ipprob(ihconv)) = hint*cv0(iphas)
+ endif
+! Si on resout en temperature
+ elseif(abs(iscsth(ii)).eq.1) then
+ propfb(ifac,ipprob(ihconv)) = hint
+ endif
+
+! On recupere le flux h(Ti'-Tp) (sortant ou
+! negatif si gain pour le fluide)
+
+ propfb(ifac,ipprob(ifconv)) = rcodcl(ifac,ivar,3)
+ endif
+
+ endif
+
+ enddo
+
+ endif
+
+ enddo
+
+ endif
+
+enddo
+! --- Boucle sur les phases : fin
+!===============================================================================
+! 13. VITESSE DE MAILLAGE EN ALE : DIRICHLET, NEUMANN
+!===============================================================================
+! (les conditions de glissement on ete traitees dans ALTYCL
+
+if (iale.eq.1) then
+
+ icluma = iclrtp(iuma ,icoef)
+ iclvma = iclrtp(ivma ,icoef)
+ iclwma = iclrtp(iwma ,icoef)
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+ distbf = ra(idistb-1+ifac)
+ surfbn = ra(isrfbn-1+ifac)**2
+ if (iortvm.eq.0) then
+ hint = propce(iel,ipproc(ivisma(1)))/distbf
+ else
+ hint = ( propce(iel,ipproc(ivisma(1)))*surfbo(1,ifac)**2 &
+ + propce(iel,ipproc(ivisma(2)))*surfbo(2,ifac)**2 &
+ + propce(iel,ipproc(ivisma(3)))*surfbo(3,ifac)**2 ) &
+ /distbf/surfbn
+ endif
+
+ do ii = 1, 3
+ if (ii.eq.1) ivar = iuma
+ if (ii.eq.2) ivar = ivma
+ if (ii.eq.3) ivar = iwma
+ iclvar = iclrtp(ivar,icoef)
+
+! C.L DE TYPE DIRICHLET
+ if( icodcl(ifac,ivar).eq.1 ) then
+ hext = rcodcl(ifac,ivar,2)
+ if(abs(hext).gt.rinfin*0.5d0) then
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = pimp
+ coefb(ifac,iclvar) = 0.d0
+ else
+ pimp = rcodcl(ifac,ivar,1)
+ coefa(ifac,iclvar) = hext*pimp/(hint +hext)
+ coefb(ifac,iclvar) = hint /(hint +hext)
+ endif
+
+! C.L DE TYPE FLUX
+ elseif( icodcl(ifac,ivar).eq.3 ) then
+ coefa(ifac,iclvar) = -rcodcl(ifac,ivar,3)/hint
+ coefb(ifac,iclvar) = 1.d0
+ endif
+
+ enddo
+
+ if (icodcl(ifac,iuma).eq.4) then
+! Face de glissement (si IUMA est de type 4, les autres aussi)
+! On force la vitesse de maillage normale a etre nulle, CL de Neumann
+! sur les autres composantes (calque sur CLSYVT). On prend directement
+! la valeur au centre de la cellule et pas reconstruite a la face (on
+! ne cherche pas une precision particuliere sur w)
+ srfbnf = ra(isrfbn-1+ifac)
+ rnx = surfbo(1,ifac)/srfbnf
+ rny = surfbo(2,ifac)/srfbnf
+ rnz = surfbo(3,ifac)/srfbnf
+ upx = rtpa(iel,iuma)
+ upy = rtpa(iel,ivma)
+ upz = rtpa(iel,iwma)
+ coefa(ifac,iuma) = - rnx*(rny*upy+rnz*upz)
+ coefb(ifac,iuma) = 1.d0-rnx**2
+ coefa(ifac,ivma) = - rny*(rnz*upz+rnx*upx)
+ coefb(ifac,ivma) = 1.d0-rny**2
+ coefa(ifac,iwma) = - rnz*(rnx*upx+rny*upy)
+ coefb(ifac,iwma) = 1.d0-rnz**2
+ endif
+
+ enddo
+
+endif
+
+!===============================================================================
+! 14. CALCUL DES EFFORTS AUX BORDS (partie 1/5)
+!===============================================================================
+
+if (ineedf.eq.1) then
+ iphas = 1
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ visclc = propce(iel,ipproc(iviscl(iphas)))
+ visctc = propce(iel,ipproc(ivisct(iphas)))
+ if (itytur(iphas).eq.3) then
+ vistot = visclc
+ else
+ vistot = visclc + visctc
+ endif
+ distbf = ra(idistb-1+ifac)
+ srfbnf = ra(isrfbn-1+ifac)
+ ra(iforbr+(ifac-1)*ndim) = -vistot * ( coefa(ifac,icluf) &
+ + (coefb(ifac,icluf)-1.d0)*coefu(ifac,1) )/distbf*srfbnf
+ ra(iforbr+(ifac-1)*ndim + 1) = -vistot * ( coefa(ifac,iclvf) &
+ + (coefb(ifac,iclvf)-1.d0)*coefu(ifac,2) )/distbf*srfbnf
+ ra(iforbr+(ifac-1)*ndim + 2) = -vistot * ( coefa(ifac,iclwf) &
+ + (coefb(ifac,iclwf)-1.d0)*coefu(ifac,3) )/distbf*srfbnf
+ enddo
+endif
+
+!===============================================================================
+! 15. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE ENTRE OPTIONS DE CALCUL ET COND. LIM. ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,' ',/,&
+'@ la prise en compte des termes d''echo de paroi ',/,&
+'@ du modele de turbulence Rij-epsilon est activee ',/,&
+'@ IRIJEC(',I10 ,') = ',I10,' ',/,&
+'@ Ou bien l amortissement de la viscosite turbulente ',/,&
+'@ est active IDRIES(',I10 ,') = ',I10,'en LES ',/,&
+'@ mais aucune face de bord de type paroi n''est detectee. ',/,&
+'@ L''incoherence indiquee ci-dessus n''est pas bloquante ',/,&
+'@ mais peut resulter d''une erreur lors de la ',/,&
+'@ specification des conditions aux limites. ',/,&
+'@ ',/,&
+'@ Par securite, le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans usclim si le ',/,&
+'@ domaine comporte des parois. ',/,&
+'@ Eliminer l''option IRIJEC de usini1 si le domaine ne ',/,&
+'@ comporte pas de paroi (ou conditions ICODCL = 5 en ',/,&
+'@ vitesse). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+ 'Phase ',I4,' debit entrant retenu en ',I10 , &
+ ' faces de sortie sur ',I10)
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ Le scalaire ',I10 ,' est couple a SYRTHES ',/,&
+'@ Il est relatif a la phase ',I10 ,/,&
+'@ mais n''est pas la variable energetique ',/,&
+'@ ISCALT(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE BOUNDARY CONDITIONS SPECIFICATION ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCY BETWEEN CALCULATION OPTIONS AND BOUND COND',/,&
+'@ ',/,&
+'@ For phase ',I10 ,' ',/,&
+'@ The wall-echo terms of the Rij-epsilon turbulence ',/,&
+'@ model are taken into account ',/,&
+'@ IRIJEC(',I10 ,') = ',I10,' ',/,&
+'@ Or the Van Driest damping of the turbulent viscosity ',/,&
+'@ is active IDRIES(',I10 ,') = ',I10,'in LES ',/,&
+'@ but no wall boundary face is detected. ',/,&
+'@ This incoherency is not blocking but may result from ',/,&
+'@ an error during the boundary conditions ',/,&
+'@ specification. ',/,&
+'@ ',/,&
+'@ By safety, the calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the boundary conditions in usclim if the domain ',/,&
+'@ has any walls. ',/,&
+'@ Remove the option IRIJEC from usini1 if the domain does ',/,&
+'@ not have any wall (or conditions ICODCL = 5 for the ',/,&
+'@ velocity). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+ 'Phase ',I4,' incoming flow detained for ', I10 , &
+ ' outlet faces on ',I10)
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: BOUNDARY CONDITIONS ',/,&
+'@ ======== ',/,&
+'@ The scalar ',I10 ,' is coupled with SYRTHES ',/,&
+'@ It is relative to phase ',I10 ,/,&
+'@ but is not the energy variable ',/,&
+'@ ISCALT(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/cou1di.f90 b/src/base/cou1di.f90
new file mode 100644
index 0000000..20fc57a
--- /dev/null
+++ b/src/base/cou1di.f90
@@ -0,0 +1,176 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cou1di &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfabor , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isvtb , icodcl , idevel , ituser , ia , &
+ rcodcl , rdevel , rtuser , ra )
+
+!===============================================================================
+
+! FONCTION :
+! ---------
+
+! LECTURE DE DONNEES RELATIVES A UN COUPLAGE AVEC SYRTHES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! isvtb ! e ! <-- ! numero du scalaire couple !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0
+integer nfabor
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer isvtb , icodcl(nfabor,nvar)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+double precision rcodcl(nfabor,nvar,3)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+
+integer ii , ivar
+integer ifac
+integer idebia, idebra
+integer icldef
+integer mode
+double precision temper, enthal
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! Sans specification, une face couplee est une face de type paroi
+icldef = 5
+
+ivar = isca(isvtb)
+
+do ii = 1, nfpt1d
+
+ ifac = ia(iifpt1+ii-1)
+
+ if ((icodcl(ifac,ivar) .ne. 1) .and. &
+ (icodcl(ifac,ivar) .ne. 5) .and. &
+ (icodcl(ifac,ivar) .ne. 6)) icodcl(ifac,ivar) = icldef
+
+ rcodcl(ifac,ivar,1) = ra(itppt1+ii-1)
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+enddo
+
+
+if(iscsth(ii).eq.2) then
+ do ii = 1, nfpt1d
+ ifac = ia(iifpt1+ii-1)
+
+ temper = rcodcl(ifac,ivar,1)
+ mode = -1
+ call usthht(mode,enthal,temper)
+ !==========
+ rcodcl(ifac,ivar,1) = enthal
+
+ enddo
+
+endif
+
+end
+
+
diff --git a/src/base/cou1do.f90 b/src/base/cou1do.f90
new file mode 100644
index 0000000..eff34cf
--- /dev/null
+++ b/src/base/cou1do.f90
@@ -0,0 +1,300 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cou1do &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncp , nfpt1d , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ientha , ifpt1d , iclt1d , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ tppt1d , tept1d , hept1d , fept1d , &
+ xlmbt1 , rcpt1d , dtpt1d , dt , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ cpcst , cp , hbord , tbord , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ECRITURE DE DONNEES RELATIVES A UN COUPLAGE AVEC SYRTHES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncp ! e ! <-- ! dimension de cp (ncelet ou 1) !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nfpt1d ! e ! <-- ! nombre de faces avec module therm 1d !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ientha ! e ! <-- ! 1 si tparoi est une enthalpie !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifpt1d ! te ! <-- ! numero de la face en traitement !
+! ! ! ! thermique en paroi !
+! iclt1d ! te ! <-- ! type de condition limite !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! cpcst ! r ! <-- ! chaleur specifique si constante !
+! cp(ncp) ! tr ! <-- ! chaleur specifique si variable !
+! hbord ! tr ! <-- ! coefficients d'echange aux bords !
+! (nfabor) ! ! ! !
+! tbord ! tr ! <-- ! temperatures aux bords !
+! (nfabor) ! ! ! !
+! tppt1d ! tr ! <-- ! temperature de paroi !
+! tept1d ! tr ! <-- ! temperature exterieure !
+! hept1d ! tr ! <-- ! coefficient d'echange exterieur !
+! fept1d ! tr ! <-- ! flux exterieur !
+! xlmbt1 ! tr ! <-- ! diffusivite thermique !
+! rcpt1d ! tr ! <-- ! rocp !
+! dtpt1d ! tr ! <-- ! pas de temps !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfpt1d
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , ncp
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer ifpt1d(nfpt1d), iclt1d(nfpt1d)
+integer ientha
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision hbord(nfabor),tbord(nfabor)
+double precision cpcst, cp(ncp)
+double precision tppt1d(nfpt1d)
+double precision tept1d(nfpt1d), hept1d(nfpt1d), fept1d(nfpt1d)
+double precision xlmbt1(nfpt1d), rcpt1d(nfpt1d), dtpt1d(nfpt1d)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, mode
+integer iphas , iappel
+integer ifac, iel , ii
+integer maxelt, ils, idbia1
+double precision enthal, temper
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! SI ENTHALPIE, ON TRANSFORME EN TEMPERATURE
+! Il est necessaire de transmettre a SYRTHES des Temperatures
+! Afin de conserver le flux Phi = (lambda/d ) Delta T
+! ou Phi = (lambda/(d Cp)) Delta H
+! on multiplie HBORD = lambda/(d Cp) par Cp pris dans la
+! cellule adjacente.
+! Le resultat n'est pas garanti (conservation en particulier),
+! on ajoute donc un avertissement.
+
+! On ne change les TBORD et HBORD que sur les faces couplees. Du coup ces
+! tableaux contiennent des choses differentes suivant les faces.
+! C'est dangereux mais pas trop grave car on les jette juste apres
+! (COUPBO passe avant).
+
+if(ientha.eq.1) then
+ write(nfecra,1000)
+ mode = 1
+ do ii = 1, nfpt1d
+ ifac = ifpt1d(ii)
+ iel = ifabor(ifac)
+ enthal = tbord(ifac)
+ call usthht (mode , enthal , temper )
+ !==========
+ tbord(ifac) = temper
+ if(ncp.eq.ncelet) then
+ hbord(ifac) = hbord(ifac)*cp(iel)
+ else
+ hbord(ifac) = hbord(ifac)*cpcst
+ endif
+ enddo
+endif
+
+! Pour l'instant on bloque le couplage si la variable est l'energie
+! -> on pourra le calquer sur coupbo si necessaire.
+if (ientha.eq.2) then
+ write(nfecra,2000)
+ call csexit(1)
+endif
+
+! Mise a jour des conditions aux limites externes du module 1D
+iphas = 1
+iappel = 3
+
+maxelt = max(ncelet,nfac,nfabor)
+ils = idebia
+idbia1 = ils + maxelt
+CALL IASIZE('COU1DO',IDBIA1)
+
+call uspt1d &
+! ============
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nfpt1d , iphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ifpt1d , ia(idebia), iclt1d , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ tppt1d , ra(idebra), ra(idebra), &
+ tept1d , hept1d , fept1d , &
+ xlmbt1 , rcpt1d , dtpt1d , &
+ dt , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , ra )
+
+iappel = 3
+call vert1d &
+!==========
+ (idebia , idebra , &
+ nfabor , nfpt1d , iappel , &
+ ifpt1d , ia(idebia) , iclt1d , ia , &
+ ra(idebra) , ra(idebra) , &
+ xlmbt1 , rcpt1d , dtpt1d , ra )
+
+do ii = 1, nfpt1d
+
+ ifac = ifpt1d(ii)
+
+ call tpar1d &
+ !==========
+ ( ii-1 , iclt1d(ii), tbord(ifac), hbord(ifac), &
+ tept1d(ii), hept1d(ii), fept1d(ii) , xlmbt1(ii) , &
+ rcpt1d(ii), dtpt1d(ii), tppt1d(ii) )
+
+
+enddo
+
+! --> FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@ @@ ATTENTION : COUPLAGE SYRTHES/MODULE 1D AVEC CALCUL EN ',/,&
+'@ ENTHALPIE ',/,&
+'@ ========= ',/,&
+'@ OPTION NON VALIDEE - CONTACTER L''EQUIPE DE DVPT ',/,&
+'@ ')
+ 2000 format( &
+'@ ',/,&
+'@ @@ ATTENTION : COUPLAGE SYRTHES/MODULE 1D AVEC CALCUL EN ',/,&
+'@ ENERGIE ',/, &
+'@ ========= ',/,&
+'@ OPTION NON PERMISE - CONTACTER L''EQUIPE DE DVPT ',/,&
+'@ ',/,&
+'@ Le calcul s''arrete ',/,&
+'@ ')
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@ @@ WARNING: 1D MODULE COUPLING WITH ENTHALPY CALCULATION ',/,&
+'@ ======== ',/,&
+'@ OPTION NOT VALIDATED - CONTACT THE SUPPORT ',/,&
+'@ ')
+ 2000 format( &
+'@ ',/,&
+'@ @@ WARNING: 1D MODULE COUPLING WITH ENERGY CALCULATION ',/,&
+'@ ======== ',/,&
+'@ OPTION NOT AVAILABLE - CONTACT THE SUPPORT ',/,&
+'@ ',/,&
+'@ The calculation will not be run ',/,&
+'@ ')
+
+#endif
+
+return
+end
diff --git a/src/base/coupbi.f90 b/src/base/coupbi.f90
new file mode 100644
index 0000000..16ac8f7
--- /dev/null
+++ b/src/base/coupbi.f90
@@ -0,0 +1,294 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine coupbi &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfabor , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ icodcl , &
+ idevel , ituser , ia , &
+ rcodcl , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! LECTURE DE DONNEES RELATIVES A UN COUPLAGE AVEC SYRTHES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0
+integer nfabor
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer icodcl(nfabor,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+double precision rcodcl(nfabor,nvar,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ll, nbccou, inbcou, inbcoo, nbfcou
+integer ifac, iloc, iscal , iphas
+integer idebia, idebra, ifinia, ifinra, ipfcou, ithpar
+integer icldef
+integer mode
+double precision temper, enthal
+
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! COUPLAGE SYRTHES : RECUPERATION DE LA TEMPERATURE DE PAROI
+!===============================================================================
+
+! RECUPERATION DU NOMBRE DE CAS DE COUPLAGE
+
+call nbcsyr (nbccou)
+!==========
+
+!---> BOUCLE SUR LES COUPLAGES : RECEPTION DES TABLEAUX TPAROI POUR
+! CHAQUE COUPLAGE ET APPLICATION DE
+! LA CONDITION LIMITE CORRESPONDANTE
+
+do inbcou = 1, nbccou
+
+! NOMBRE DE FACES DE BORD PAR CAS DE COUPLAGE
+ inbcoo = inbcou
+ call nbfsyr (inbcoo, nbfcou)
+ !==========
+
+! GESTION MEMOIRE POUR RECEVOIR LE TABLEAU
+
+ ipfcou = idebia
+ ifinia = ipfcou + nbfcou
+
+ ithpar = idebra
+ ifinra = ithpar + nbfcou
+
+ CALL IASIZE('COUPBI',IFINIA)
+ !==========
+ CALL RASIZE('COUPBI',IFINRA)
+ !==========
+
+! LECTURE DU MESSAGE (TEMPERATURE PAROI) ET
+! INTERPOLATION DES VALEURS AUX SOMMETS AUX FACES
+ call varsyi (inbcou, ra(ithpar))
+ !==========
+
+! ON IMPOSE LA TEMPERATURE A LA PAROI
+
+ inbcoo = inbcou
+ call lfasyr(inbcoo, ia(ipfcou))
+ !==========
+
+! TYPE DE CONDITION PAR DEFAUT
+ icldef = 5
+
+
+ do iscal = 1, nscal
+
+ if(icpsyr(iscal).eq.1) then
+
+! --- Pour les scalaires qui sont couples a SYRTHES
+! on impose une condition de Dirichlet aux faces couplees
+! Pour le moment, on ne passe ici qu'une seule fois,
+! etant entendu que un seul scalaire est couple a SYRTHES
+! Pour le module compressible, on resout en energie, mais on
+! stocke la temperature a part, pour que ce soit plus clair
+! dans les conditions aux limites
+
+
+ ll = isca(iscal)
+ if(ippmod(icompf).ge.0) then
+ iphas = iphsca(iscal)
+ if(iscal.eq.ienerg(iphas)) then
+ ll = isca(itempk(iphas))
+ else
+ write(nfecra,9000)ienerg(iphas),iscal
+ call csexit (1)
+ endif
+ endif
+
+
+ do iloc = 1, nbfcou
+
+ ifac = ia(ipfcou+iloc-1)
+
+ if ((icodcl(ifac,ll) .ne. 1) .and. &
+ (icodcl(ifac,ll) .ne. 5) .and. &
+ (icodcl(ifac,ll) .ne. 6)) icodcl(ifac,ll) = icldef
+
+ rcodcl(ifac,ll,1) = ra(ithpar+iloc-1)
+ rcodcl(ifac,ll,2) = rinfin
+ rcodcl(ifac,ll,3) = 0.d0
+
+ enddo
+
+! Conversion eventuelle temperature -> enthalpie
+
+ if(iscsth(ll).eq.2) then
+
+ do iloc = 1, nbfcou
+ ifac = ia(ipfcou+iloc-1)
+
+ temper = rcodcl(ifac,ll,1)
+ mode = -1
+ call usthht(mode,enthal,temper)
+ !==========
+ rcodcl(ifac,ll,1) = enthal
+
+ enddo
+
+ endif
+
+ endif
+
+ enddo
+
+enddo
+
+!===============================================================================
+! FIN DES COUPLAGES DE BORD
+!===============================================================================
+
+return
+
+! FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU COUPLAGE SYRTHES ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Avec le module compressible, seul le scalaire ',I10 ,/,&
+'@ peut etre couple a SYRTHES. Ici, on cherche a coupler ',/,&
+'@ le scalaire ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE SYRTHES COUPLING ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ With the compressible module, only the scalar ',I10 ,/,&
+'@ may be coupled with SYRTHES. Here, one tries to couple ',/,&
+'@ with the scalar ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+end
diff --git a/src/base/coupbo.f90 b/src/base/coupbo.f90
new file mode 100644
index 0000000..8f4da4f
--- /dev/null
+++ b/src/base/coupbo.f90
@@ -0,0 +1,339 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine coupbo &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , isvtb , &
+ nideve , nrdeve , nituse , nrtuse , ncp , ncv , ientha , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cpcst , cp , cvcst , cv , &
+ hbord , tbord , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ECRITURE DE DONNEES RELATIVES A UN COUPLAGE AVEC SYRTHES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncp ! e ! <-- ! dimension de cp (ncelet ou 1) !
+! ncv ! e ! <-- ! dimension de cv (ncelet ou 1) !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ientha ! e ! <-- ! 1 si tparoi est une enthalpie !
+! ! e ! <-- ! 2 si tparoi est une energie !
+! ! ! ! (compressible) !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! cpcst ! r ! <-- ! chaleur specifique si constante !
+! cvcst ! r ! <-- ! chaleur specifique si constante !
+! cp(ncp) ! tr ! <-- ! chaleur specifique si variable !
+! cv(ncp) ! tr ! <-- ! chaleur specifique si variable !
+! hbord ! tr ! <-- ! coefficients d'echange aux bords !
+! (nfabor) ! ! ! !
+! tbord ! tr ! <-- ! temperatures aux bords !
+! (nfabor) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstphy.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer isvtb
+integer nideve , nrdeve , nituse , nrtuse
+integer ncp , ncv , ientha
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision cpcst , cvcst
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*),propfa(nfac,*),propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision cp(ncp), cv(ncv)
+double precision hbord(nfabor),tbord(nfabor)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer nbccou, inbcou, inbcoo, nbfcou, ifac, iloc, iel
+integer itflui, ihparo
+integer idebia, idebra, ifinia, ifinra, ipfcou, mode
+integer iccfth, imodif, iphas
+integer iepsel, iepsfa, igamag, ixmasm
+double precision enthal, temper, energ, cvt
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! COUPLAGE SYRTHES : CALCUL DE LA TEMPERATURE FLUIDE ET DU
+! COEFFICIENT D'ECHANGE
+!===============================================================================
+
+! RECUPERATION DU NOMBRE DE CAS DE COUPLAGE
+
+call nbcsyr (nbccou)
+!==========
+
+!---> BOUCLE SUR LES CAS DE COUPLAGE DE TYPE SYRTHES
+
+do inbcou = 1, nbccou
+
+! NOMBRE DE FACES DE BORD PAR CAS DE COUPLAGE
+ inbcoo = inbcou
+ call nbfsyr (inbcoo, nbfcou)
+ !==========
+
+! GESTION MEMOIRE POUR CONSTRUIRE LES TABLEAUX
+
+ ipfcou = idebia
+ ifinia = ipfcou + nbfcou
+
+ itflui = idebra
+ ihparo = itflui + nbfcou
+ ifinra = ihparo + nbfcou
+
+! Compressible : couplage avec l'energie
+
+ if(ientha .eq. 2) then
+ iepsel = ifinra
+ iepsfa = iepsel + ncelet
+ igamag = iepsfa + nfabor
+ ixmasm = igamag + ncelet
+ ifinra = ixmasm + ncelet
+ endif
+
+! Fin Compressible
+
+ CALL RASIZE('COUPBO',IFINIA)
+ !==========
+ CALL RASIZE('COUPBO',IFINRA)
+ !==========
+
+! BOUCLE SUR LES FACES DE COUPLAGE ET CALCUL DES COEFFICIENTS
+
+ inbcoo = inbcou
+ call lfasyr(inbcoo, ia(ipfcou))
+ !==========
+
+ do iloc = 1, nbfcou
+
+ ifac = ia(ipfcou+iloc-1)
+
+! TEMPERATURES FLUIDES SAUVEGARDEES
+ ra(itflui+iloc-1) = tbord(ifac)
+
+! COEFFICIENTS D'ECHANGE SAUVEGARDES
+ ra(ihparo+iloc-1) = hbord(ifac)
+
+ enddo
+
+! SI ENTHALPIE, ON TRANSFORME EN TEMPERATURE
+! Il est necessaire de transmettre a SYRTHES des Temperatures
+! Afin de conserver le flux Phi = (lambda/d ) Delta T
+! ou Phi = (lambda/(d Cp)) Delta H
+! on multiplie HBORD = lambda/(d Cp) par Cp pris dans la
+! cellule adjacente.
+! Le resultat n'est pas garanti (conservation en particulier),
+! on ajoute donc un avertissement.
+
+
+ if(ientha.eq.1) then
+
+ write(nfecra,1000)
+ mode = 1
+ do iloc = 1, nbfcou
+ ifac = ia(ipfcou+iloc-1)
+ iel = ifabor(ifac)
+ enthal = ra(itflui+iloc-1)
+ call usthht (mode , enthal , temper )
+ !==========
+ ra(itflui+iloc-1) = temper
+ if(ncp.eq.ncelet) then
+ ra(ihparo+iloc-1) = ra(ihparo+iloc-1)*cp(iel)
+ else
+ ra(ihparo+iloc-1) = ra(ihparo+iloc-1)*cpcst
+ endif
+ enddo
+
+ else if(ientha.eq.2) then
+
+! SI ENERGIE, ON TRANSFORME EN TEMPERATURE
+! Il est necessaire de transmettre a SYRTHES des Temperatures
+! Afin de conserver le flux Phi = (lambda/d ) Delta T
+! ou Phi = (lambda/(d Cv)) (Ei - Ep)
+! on multiplie HBORD = lambda/(d Cv) par Cv pris dans la
+! cellule adjacente.
+! noter que Ei = Cv Ti + 1/2 Ui*Ui + Epsilon_sup_i
+! et que Ep = Cv Tp + 1/2 Ui*Ui + Epsilon_sup_i
+! (l'ecart est donc bien Cv Delta T)
+
+! Modif temperature et coeff d'echange
+
+! Calcul de e - CvT
+
+ iccfth = 7
+ imodif = 0
+ iphas = iphsca(isvtb)
+
+ call uscfth &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iepsel) , ra(iepsfa) , ra(igamag) , ra(ixmasm) , &
+! ---------- ---------
+ rdevel , rtuser , ra )
+
+ do iloc = 1, nbfcou
+ ifac = ia(ipfcou+iloc-1)
+ iel = ifabor(ifac)
+ energ = ra(itflui+iloc-1)
+ cvt = energ &
+ -(0.5d0*( rtp(iel,iu(iphas))**2 &
+ +rtp(iel,iv(iphas))**2 &
+ +rtp(iel,iw(iphas))**2) &
+ + ra(iepsel+iel-1) )
+ if(ncv.eq.ncelet) then
+ ra(itflui+iloc-1) = cvt/cv(iel)
+ ra(ihparo+iloc-1) = ra(ihparo+iloc-1)*cv(iel)
+ else
+ ra(itflui+iloc-1) = cvt/cvcst
+ ra(ihparo+iloc-1) = ra(ihparo+iloc-1)*cvcst
+ endif
+ enddo
+
+ endif
+
+! ENVOI DE LA TEMPERATURE FLUIDE ET DU COEFFICIENT D'ECHANGE
+
+ inbcoo = inbcou
+ call varsyo (inbcoo, ra(itflui), ra(ihparo))
+ !==========
+
+enddo
+
+!===============================================================================
+! FIN DES COUPLAGES DE BORD
+!===============================================================================
+
+return
+
+! FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@ @@ ATTENTION : COUPLAGE SYRTHES AVEC CALCUL EN ENTHALPIE ',/,&
+'@ ========= ',/,&
+'@ OPTION NON VALIDEE - CONTACTER L''EQUIPE DE DVPT ',/,&
+'@ ')
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@ @@ WARNING: SYRTHES COUPLING WITH ENTHALPY CALCULATION ',/,&
+'@ ======== ',/,&
+'@ OPTION NOT VALIDATED - CONTACT THE SUPPORT ',/,&
+'@ ')
+
+#endif
+
+end
diff --git a/src/base/covofi.f90 b/src/base/covofi.f90
new file mode 100644
index 0000000..775f70e
--- /dev/null
+++ b/src/base/covofi.f90
@@ -0,0 +1,909 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine covofi &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , itspdv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , tslagr , &
+ coefa , coefb , ckupdc , smacel , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR UN SCALAIRE SUR UN PAS DE TEMPS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! itspdv ! e ! <-- ! calcul termes sources prod et dissip !
+! ! ! ! (0 : non , 1 : oui) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "lagpar.h"
+include "lagran.h"
+include "matiss.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal , itspdv
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision tslagr(ncelet,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , iphas
+integer ifac , iel
+integer init , inc , iccocg, isqrt, iii, iiun, ibcl
+integer ivarsc, iscala
+integer iiscav, iicp
+integer ikiph , ieiph , iomgip
+integer ir11ip, ir22ip, ir33ip
+integer iclvar, iclvaf
+integer ipcrom, ipcvst, ipcvsl, iflmas, iflmab
+integer ippvar, ipp , iphydp, iptsca, ipcvso
+integer nswrgp, imligp, iwarnp
+integer iconvp, idiffp, ndircp, ireslp, nitmap
+integer nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer maxelt, ils , idbia1
+double precision epsrgp, climgp, extrap, relaxp, blencp, epsilp
+double precision epsrsp
+double precision rhovst, xk , xe , sclnor
+double precision thetv , thets , thetap, thetp1
+double precision smbexp
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero de phase associee au scalaire traite
+iphas = iphsca(iscal)
+
+! --- Numero de variable de calcul et de post associe au scalaire traite
+ivar = isca(iscal)
+ippvar = ipprtp(ivar)
+
+! --- Numero du scalaire eventuel associe dans le cas fluctuation
+! et numero de variable de calcul
+iiscav = iscavr(iscal)
+if(iiscav.gt.0.and.iiscav.le.nscal) then
+ ivarsc = isca(iiscav)
+else
+ ivarsc = 0
+endif
+
+! --- Numero des variables de calcul
+if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50) then
+ ikiph = ik (iphas)
+ ieiph = iep (iphas)
+elseif(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ieiph = iep (iphas)
+elseif(iturb(iphas).eq.60) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+endif
+
+! --- Numero des conditions aux limites
+iclvar = iclrtp(ivar,icoef)
+iclvaf = iclrtp(ivar,icoeff)
+
+! --- Numero des grandeurs physiques
+ipcrom = ipproc(irom (iphas))
+ipcvst = ipproc(ivisct(iphas))
+iflmas = ipprof(ifluma(ivar ))
+iflmab = ipprob(ifluma(ivar ))
+if(ivisls(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+else
+ ipcvsl = 0
+endif
+
+! --- Numero du terme source dans PROPCE si extrapolation
+if(isso2t(iscal).gt.0) then
+ iptsca = ipproc(itssca(iscal))
+else
+ iptsca = 0
+endif
+
+! S pour Source, V pour Variable
+thets = thetss(iscal)
+thetv = thetav(ivar )
+
+chaine = nomvar(ippvar)
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+endif
+
+!===============================================================================
+! 2. TERMES SOURCES
+!===============================================================================
+
+! --> Initialisation
+
+
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+do iel = 1, ncel
+ smbrs(iel) = 0.d0
+enddo
+
+iscala = iscal
+
+
+if (imatis.eq.1) then
+
+! Matisse
+ call mttssc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iiconr) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , drtp , dam , &
+ rdevel , rtuser , ra )
+
+else
+
+! Utilisateur standard
+
+ maxelt = max(ncelet,nfac,nfabor)
+ ils = idebia
+ idbia1 = ils + maxelt
+ CALL IASIZE('COVOFI',IDBIA1)
+
+ call ustssc &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , drtp , dam , &
+ rdevel , rtuser , ra )
+
+endif
+
+! Si on extrapole les TS :
+! SMBRS recoit -theta PROPCE du pas de temps precedent
+! (on aurait pu le faire avant ustssc, mais avec le risque que
+! l'utilisateur l'ecrase)
+! SMBRS recoit la partie du terme source qui depend de la variable
+! A l'ordre 2, on suppose que le ROVSDT fourni par l'utilisateur est <0
+! on implicite le terme (donc ROVSDT*RTPA va dans SMBRS)
+! En std, on adapte le traitement au signe de ROVSDT, mais ROVSDT*RTPA va
+! quand meme dans SMBRS (pas d'autre choix)
+if(isso2t(iscal).gt.0) then
+ do iel = 1, ncel
+! Stockage temporaire pour economiser un tableau
+ smbexp = propce(iel,iptsca)
+! Terme source utilisateur explicite
+ propce(iel,iptsca) = smbrs(iel)
+! Terme source du pas de temps precedent et
+! On suppose -ROVSDT > 0 : on implicite
+! le terme source utilisateur (le reste)
+ smbrs(iel) = rovsdt(iel)*rtpa(iel,ivar) - thets*smbexp
+! Diagonale
+ rovsdt(iel) = - thetv*rovsdt(iel)
+ enddo
+! Si on n'extrapole pas les TS :
+else
+ do iel = 1, ncel
+! Terme source utilisateur
+ smbrs(iel) = smbrs(iel) + rovsdt(iel)*rtpa(iel,ivar)
+! Diagonale
+ rovsdt(iel) = max(-rovsdt(iel),zero)
+ enddo
+endif
+
+! --> Physique particulieres
+! Ordre 2 non pris en compte
+
+if (ippmod(iphpar).ge.1) then
+ call pptssc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , tslagr , &
+! ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , drtp , dam , &
+ rdevel , rtuser , ra )
+endif
+
+! --> Rayonnement
+! Ordre 2 non pris en compte
+
+if ( iirayo.ge.1 .and. iphas.eq.irapha) then
+
+ if (iscal.eq.iscalt(iphas)) then
+ call raysca &
+ !==========
+ ( iscalt(iphas),ncelet,ncel, &
+ smbrs, rovsdt,volume,propce )
+ endif
+
+ !-> Charbon pulverise
+ ! Ordre 2 non pris en compte
+
+ if ( ippmod(icp3pl) .gt. 0 ) then
+ if ( isca(iscal).ge.isca(ih2(1)) .and. &
+ isca(iscal).le.isca(ih2(nclacp)) ) then
+
+ call cprays &
+ !==========
+ ( ivar ,ncelet, ncel , &
+ volume,propce,smbrs,rovsdt)
+
+ endif
+ endif
+
+ ! -> Fuel
+ ! Ordre 2 non pris en compte
+ ! Pour l'instant rayonnement non compatible avec Fuel
+
+ if ( ippmod(icfuel) .ge. 0 ) then
+ if ( isca(iscal).ge.isca(ihlf(1)) .and. &
+ isca(iscal).le.isca(ihlf(nclafu)) ) then
+
+ call furays &
+ !==========
+ ( ivar ,ncelet, ncel , &
+ volume,propce,smbrs,rovsdt)
+
+ endif
+ endif
+
+endif
+
+! --> Lagrangien (couplage retour thermique)
+! Ordre 2 non pris en compte
+
+if (iilagr.eq.2 .and. ltsthe.eq.1 .and. iphas.eq.ilphas) then
+
+ if (iscsth(iscal).eq.2) then
+
+! --> Enthalpie
+
+ do iel = 1,ncel
+ smbrs (iel) = smbrs(iel) + tslagr(iel,itste)
+ rovsdt(iel) = rovsdt(iel) + max(tslagr(iel,itsti),zero)
+ enddo
+
+ else if (iscsth(iscal).eq.1 .or. iscsth(iscal).eq.-1 ) then
+
+! --> Temperature :
+
+ if (icp(iphas).eq.0) then
+
+! --> Cp constant
+
+ do iel = 1,ncel
+ smbrs (iel) = smbrs(iel) + tslagr(iel,itste)/cp0(iphas)
+ rovsdt(iel) = rovsdt(iel) + max(tslagr(iel,itsti),zero)
+ enddo
+
+ else if (icp(iphas).gt.0) then
+
+! --> Cp variable
+
+ iicp = ipproc(icp(iphas))
+ do iel = 1,ncel
+ smbrs (iel) = smbrs(iel) + tslagr(iel,itste) &
+ / propce(iel,iicp)
+ rovsdt(iel) = rovsdt(iel) + max(tslagr(iel,itsti),zero)
+ enddo
+ endif
+
+ endif
+
+endif
+
+
+! TERMES DE SOURCE DE MASSE
+
+if (ncesmp.gt.0) then
+
+! Entier egal a 1 (pour navsto : nb de sur-iter)
+ iiun = 1
+
+! On incremente SMBRS par -Gamma RTPA et ROVSDT par Gamma (*theta)
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , isso2t(iscal) , thetv , &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipr(iphas)), &
+ smbrs , rovsdt , w1)
+
+! Si on extrapole les TS on met Gamma Pinj dans PROPCE
+ if(isso2t(iscal).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsca) = propce(iel,iptsca) + w1(iel)
+ enddo
+! Sinon on le met directement dans SMBRS
+ else
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + w1(iel)
+ enddo
+ endif
+
+endif
+
+
+! TERME D'ACCUMULATION DE MASSE -(dRO/dt)*VOLUME
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w1)
+
+! Extrapolation ou non, le terme d'accumulation de masse va dans SMBRS
+do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) &
+ + iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+enddo
+
+! Extrapolation ou non le terme d'accumulation de masse a la meme forme
+! par coherence avec bilsc2
+do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) - iconv(ivar)*w1(iel)*thetv
+enddo
+
+
+! TERME INSTATIONNAIRE
+
+do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel)
+enddo
+
+
+
+! SI ON CALCULE LA VARIANCE DES FLUCTUATIONS D'UN SCALAIRE,
+! ON RAJOUTE LES TERMES DE PRODUCTION ET DE DISSIPATION
+
+if (itspdv.eq.1) then
+
+ if(itytur(iphas).eq.2.or.itytur(iphas).eq.3 &
+ .or.iturb(iphas).eq.50 .or. iturb(iphas).eq.60) then
+
+! Remarque : on a prevu la possibilite de scalaire associe non
+! variable de calcul, mais des adaptations sont requises
+
+ if(ivarsc.gt.0) then
+ iii = ivarsc
+ else
+ write(nfecra,9000)ivarsc
+ call csexit(1)
+ endif
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(iii)
+ imligp = imligr(iii)
+ iwarnp = iwarni(iii)
+ epsrgp = epsrgr(iii)
+ climgp = climgr(iii)
+ extrap = extrag(iii)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iii , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iii) , coefa(1,iclrtp(iii,icoef)) , &
+ coefb(1,iclrtp(iii,icoef)) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Traitement de la production
+! On utilise MAX(PROPCE,ZERO) car en LES dynamique on fait un clipping
+! tel que (mu + mu_t)>0, donc mu_t peut etre negatif et donc
+! potentiellement (lambda/Cp + mu_t/sigma) aussi
+! Ceci ne pose probleme que quand on resout une equation de variance
+! de scalaire avec un modele LES ... ce qui serait curieux mais n'est
+! pas interdit par le code.
+! Si extrapolation : dans PROPCE
+ if (isso2t(iscal).gt.0) then
+! On prend la viscosite a l'instant n, meme si elle est extrapolee
+ ipcvso = ipcvst
+ if(iviext(iphas).gt.0) ipcvso = ipproc(ivista(iphas))
+ do iel = 1, ncel
+ propce(iel,iptsca) = propce(iel,iptsca) &
+ + 2.d0*max(propce(iel,ipcvso),zero) &
+ *volume(iel)/sigmas(iscal) &
+ *(w1(iel)**2 + w2(iel)**2 + w3(iel)**2)
+ enddo
+! Sinon : dans SMBRS
+ else
+ ipcvso = ipcvst
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) &
+ + 2.d0*max(propce(iel,ipcvso),zero) &
+ *volume(iel)/sigmas(iscal) &
+ *(w1(iel)**2 + w2(iel)**2 + w3(iel)**2)
+ enddo
+ endif
+
+! Traitement de la dissipation
+ if (isso2t(iscal).gt.0) then
+ thetap = thetv
+ else
+ thetap = 1.d0
+ endif
+ do iel = 1, ncel
+ if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50) then
+ xk = rtpa(iel,ikiph)
+ xe = rtpa(iel,ieiph)
+ elseif(itytur(iphas).eq.3) then
+ xk = &
+ 0.5d0*(rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip))
+ xe = rtpa(iel,ieiph)
+ elseif(iturb(iphas).eq.60) then
+ xk = rtpa(iel,ikiph)
+ xe = cmu*xk*rtpa(iel,iomgip)
+ endif
+ rhovst = propce(iel,ipcrom)*xe/ &
+ (xk * rvarfl(iscal))*volume(iel)
+! La diagonale recoit eps/Rk, (*theta eventuellement)
+ rovsdt(iel) = rovsdt(iel) + rhovst*thetap
+! SMBRS recoit la dissipation
+ smbrs(iel) = smbrs(iel) - rhovst*rtpa(iel,ivar)
+ enddo
+
+ endif
+
+endif
+
+
+if(isso2t(iscal).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + thetp1 * propce(iel,iptsca)
+ enddo
+endif
+
+! "VITESSE" DE DIFFUSION FACETTE
+
+! On prend le MAX(mu_t,0) car en LES dynamique mu_t peut etre negatif
+! (clipping sur (mu + mu_t)). On aurait pu prendre
+! MAX(K + K_t,0) mais cela autoriserait des K_t negatif, ce qui est
+! considere ici comme non physique.
+if( idiff(ivar).ge. 1 ) then
+ if(ipcvsl.eq.0)then
+ do iel = 1, ncel
+ w1(iel) = visls0(iscal) &
+ + idifft(ivar)*max(propce(iel,ipcvst),zero)/sigmas(iscal)
+ enddo
+ else
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvsl) &
+ + idifft(ivar)*max(propce(iel,ipcvst),zero)/sigmas(iscal)
+ enddo
+ endif
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+
+!===============================================================================
+! 3. RESOLUTION
+!===============================================================================
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+ipp = ippvar
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbrs , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 4. IMPRESSIONS ET CLIPPINGS
+!===============================================================================
+
+if(ivarsc.gt.0) then
+ iii = ivarsc
+else
+! Valeur bidon
+ iii = 1
+endif
+
+call clpsca &
+!==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , rtp(1,iii) , rtp )
+
+
+! BILAN EXPLICITE (VOIR CODITS : ON ENLEVE L'INCREMENT)
+! Ceci devrait etre valable avec le theta schema sur les Termes source
+
+if (iwarni(ivar).ge.2) then
+ if(nswrsm(ivar).gt.1) then
+ ibcl = 1
+ else
+ ibcl = 0
+ endif
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) &
+ - istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel)&
+ *(rtp(iel,ivar)-rtpa(iel,ivar))*ibcl
+ enddo
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,smbrs,smbrs,sclnor)
+ write(nfecra,1200)chaine(1:8) ,sclnor
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ** RESOLUTION POUR LA VARIABLE ',A8 ,/,&
+' --------------------------- ',/)
+ 1200 format(1X,A8,' : BILAN EXPLICITE = ',E14.5)
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS COVOFI ',/,&
+'@ ========= ',/,&
+'@ IVARSC DOIT ETRE UN ENTIER POSITIF STRICTEMENT ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format(/, &
+' ** SOLVING VARIABLE ',A8 ,/,&
+' ----------------' ,/)
+ 1200 format(1X,A8,' : EXPLICIT BALANCE = ',E14.5)
+ 9000 format( &
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ERROR IN COVOFI' ,/,&
+'@ ========' ,/,&
+'@ IVARSC MUST BE A STRICTLY POSITIVE INTEGER' ,/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@' ,/,&
+'@ The calculation will not be run.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/cregeo.f90 b/src/base/cregeo.f90
new file mode 100644
index 0000000..f3bfa7b
--- /dev/null
+++ b/src/base/cregeo.f90
@@ -0,0 +1,285 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cregeo &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION
+! ---------
+
+! CREATION DES ENTITES GEOMETRIQUES, PAR CALCUL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! --> ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ilcel , ilfaci , ilfacb
+integer maxelt , ils
+integer ifinia , ifinra , nbrsyr , nbzech
+
+!===============================================================================
+! 1. INITIALISATION DE LA MEMOIRE EN LOCAL POUR LES TAB DE TRAV
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! MEMOIRE DE TRAVAIL POUR LA DEFINITION DE COUPES
+
+ilcel = idebia
+ilfaci = ilcel + ncelet
+ilfacb = ilfaci + nfac
+ifinia = ilfacb + nfabor
+
+! VERIFICATION DE LA DISPONIBILITE DE LA MEMOIRE
+
+CALL IASIZE ('CREGEO', IFINIA)
+!==========
+
+!===============================================================================
+! 2. DEFINITION DE MAILLAGES ET FORMATS DE POST TRAITEMENT UTILISATEUR
+!===============================================================================
+
+call usdpst &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(ilcel) , ia(ilfaci) , ia(ilfacb) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 3. CREATION DU MAILLAGE EXTRAIT COUPLE AVEC SYRTHES
+! ENVOI DES DONNEES GEOMETRIQUES A SYRTHES SI NECESSAIRE
+!===============================================================================
+
+! NOMBRE DE COUPLAGES SYRTHES DEFINIS
+
+call nbcsyr(nbrsyr)
+!==========
+
+if (nbrsyr .gt. 0) then
+ call geosyr
+ !==========
+ if (ichrsy.gt.0) then
+ call pstisy
+ !==========
+ endif
+endif
+
+
+!===============================================================================
+! 3. CREATION DU MAILLAGE EXTRUDE POUR LES ZONES D'ECHANGE AERO
+!===============================================================================
+
+if (ippmod(iaeros).ge.0) then
+
+ maxelt = max(ncelet,nfac,nfabor)
+
+ ils = idebia
+ ifinia = ils + maxelt
+ CALL IASIZE('CREGEO',IFINIA)
+ !==========
+
+ call usctdz &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+ call nbzect(nbzech)
+ !==========
+
+ if (nbzech .gt. 0) then
+ call geoct
+ !=========
+ if (ichrze.gt.0) then
+ call pstict
+ !==========
+ endif
+ endif
+
+ if (ippmod(iaeros).ge.0.and.isuict.eq.1) then
+ call lecctw ( ficmct , len(ficmct) )
+ !==========
+ endif
+
+endif
+
+
+!===============================================================================
+! 4. ECRITURE DES MAILLAGES DE POST TRAITEMENT INDEPENDANTS DU TEMPS
+!===============================================================================
+
+call pstema (ntcabs, ttcabs)
+!==========
+
+!===============================================================================
+! 5. CALCUL DES TABLEAUX COMPLEMENTAIRES
+!===============================================================================
+
+call calgeo &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ volmin , volmax , voltot , &
+ rdevel , rtuser , ra )
+
+return
+end
diff --git a/src/base/crstgr.f90 b/src/base/crstgr.f90
new file mode 100644
index 0000000..67bc0a8
--- /dev/null
+++ b/src/base/crstgr.f90
@@ -0,0 +1,558 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine crstgr &
+!================
+
+( iappel , isym , igr , &
+ ncelf , ncelg , ncelfe , ncelge , nfacf , nfacg , &
+ iwarnp , &
+ ifaclf , ifaclg , irscel , irsfac , &
+ volumf , xyzfin , surfaf , xaf0 , xaf0ij , &
+ daf , xaf , &
+ volumg , xyzgro , surfag , xag0 , xag0ij , &
+ dag , xag , &
+ w1 , w2 , w3 , w4 )
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! MULTIGRILLE ALGEBRIQUE :
+! CONSTRUCTION D'UN NIVEAU DE MAILLAGE GROSSIER A PARTIR
+! DU NIVEAU SUPERIEUR
+
+! structure grille fine ==> grille grossiere
+! ------------------------------------------
+! [ NCELF,NFACF,IFACLF,ROVDTF,XAF0,VOLUMF,XYZFIN,
+! SURFAF,XAF,XAF0,XAF0IJ ]
+! [ NCELG,NFACG,IFACLG,ROVDTG,XAG0,VOLUMG,XYZGRO,
+! SURFAG,XAG,XAG0,XAG0IJ ]
+
+! explicit� dans le cartouche
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iappel ! e ! <-- ! numero d'appel !
+! isym ! e ! <-- ! indicateur = 1 matrice sym !
+! ! ! ! = 2 matrice non sym !
+! igr ! e ! <-- ! niveau du maillage grossier !
+! ncelf ! e ! <-- ! nombre d'elements maillage fin !
+! ncelg ! e ! <-- ! nombre d'elements maillage grossier !
+! ncelfe ! e ! <-- ! nombre d'elements etendus fin !
+! ncelge ! e ! <-- ! nombre d'elements etendus grossier !
+! nfacf ! e ! <-- ! nombre de faces internes maill. fin !
+! nfacg ! e ! <-- ! nombre de faces internes maill. gro. !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! ifacef ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfacf) ! ! ! sur maillage fin !
+! ifaceg ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfacg) ! ! ! sur maillage grossier !
+! irscel ! te ! <-- ! cellule fine -> cellule grossiere !
+! (ncelfe) ! ! ! !
+! irsfac ! te ! <-- ! face fine -> face grossiere !
+! (nfacf) ! ! ! = 0 : face interne cel. grossiere !
+! ! ! ! < 0 : orientation inverse !
+! ! ! ! > 0 : orientation identique !
+! daf(ncelf) ! tr ! <-- ! diagonale de la matrice mail fin !
+! xaf ! tr ! <-- ! extradiagonale matrice maillage fin !
+! (nfacf,isym) ! ! ! !
+! dag(ncelg) ! tr ! --> ! diagonale matrice maillage grossier !
+! xag ! tr ! --> ! extradiagonale matrice maillage !
+! (nfacg,isym) ! ! ! grossier !
+! ivois(ncelf) ! te ! --- ! indicateur de voisinage cellules !
+! ip(ncelf) ! te ! --- ! pointeurs sur voisins pour connecti- !
+! ! ! ! vite inverse !
+! icelfa ! te ! --- ! connectivite cellules->faces mailla- !
+! (2*nfacf) ! ! ! ge fin !
+! icelce ! te ! --- ! connectivite cellules->cellules !
+! (2*nfacf) ! ! ! voisines du maillage fin !
+! rw(ncelf) ! tr ! --- ! tableau de travail !
+! ifaclf(2,nfacf ! te ! <-- ! cell. voisines face intrn maill fin !
+! xaf0(nfacf,isym) ! tr ! <-- ! extradiagonale matrice p0 mailage fin !
+! volumf(ncelf) ! tr ! <-- ! volume cellule maillage fin !
+! xyzfin(3,ncelf) ! tr ! <-- ! coordonnes cellule maillage fin !
+! surfaf(3,nfacf) ! tr ! <-- ! surface face interne maillage fin !
+! xafxf0(2,nfacf) ! tr ! <-- ! integ. xaf0*coord.cell adj. mail.fin !
+! ncelg ! e ! <-- ! nombre d'elements maillage grossier !
+! nfacg ! e ! <-- ! nombre faces internes maill. grossier !
+! ifaclg(2,nfacg) ! te ! <-- ! cell. voisines face internes maillage grossier !
+! xag0(nfacg,isym) ! tr ! <-- ! extradiagonale matrice p0 maillage grossier !
+! volumg(ncelg) ! tr ! <-- ! volume cellule maillage grossier !
+! xyzgro(3,ncelg) ! tr ! <-- ! coordonnes cellule maillage grossier !
+! surfag(3,nfacg) ! tr ! <-- ! surface face interne maillage grossier !
+! xagxg0(2,nfacg) ! tr ! <-- ! integ. xag0*coord.cell adj. maillage grossier !
+! w1,..,4(ncel) ! tr ! <-> ! tableaux de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+include "paramx.h"
+include "entsor.h"
+include "optcal.h"
+include "cstnum.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iappel, isym, igr
+integer ncelf, ncelfe, nfacf, ncelg, ncelge, nfacg
+integer iwarnp
+
+double precision daf(ncelf), xaf(nfacf,2)
+double precision dag(ncelge), xag(nfacg,2)
+
+integer ifaclf(2, nfacf), ifaclg(2, nfacg)
+integer irscel(ncelf), irsfac(nfacf)
+
+double precision xaf0(nfacf),volumf(ncelfe), xyzfin(3, ncelfe)
+double precision xag0(nfacg),volumg(ncelge), xyzgro(3, ncelge)
+double precision surfaf(3, nfacf), xaf0ij(3, nfacf)
+double precision surfag(3, nfacg), xag0ij(3, nfacg)
+double precision w1(ncelfe), w2(ncelfe), w3(ncelfe), w4(ncelfe)
+
+! Local variables
+
+integer iel, ii, jj, ig, jg
+integer ifacg, imin, imax
+integer ifac
+integer interp
+
+double precision dsigjg, dsxaij
+double precision rmin, rmax, cclip
+double precision anmin(2), anmax(2)
+
+
+!===============================================================================
+
+! Compute volume and center of coarse cells: xyzgro(3,ncelg)
+!==========================================================================
+
+if (iappel .eq. 1) then
+
+ do ig = 1, ncelge
+ volumg(ig) = 0.d0
+ enddo
+ do ig = 1, ncelge
+ xyzgro(1, ig) = 0.d0
+ xyzgro(2, ig) = 0.d0
+ xyzgro(3, ig) = 0.d0
+ enddo
+
+ do ii = 1, ncelf
+ ig = irscel(ii)
+ volumg(ig) = volumg(ig) + volumf(ii)
+ xyzgro(1, ig) = xyzgro(1, ig) + volumf(ii)*xyzfin(1, ii)
+ xyzgro(2, ig) = xyzgro(2, ig) + volumf(ii)*xyzfin(2, ii)
+ xyzgro(3, ig) = xyzgro(3, ig) + volumf(ii)*xyzfin(3, ii)
+ enddo
+ do ig = 1, ncelg
+ xyzgro(1, ig) = xyzgro(1, ig) / volumg(ig)
+ xyzgro(2, ig) = xyzgro(2, ig) / volumg(ig)
+ xyzgro(3, ig) = xyzgro(3, ig) / volumg(ig)
+ enddo
+
+! Return to calling function for parallel / periodic synchronization
+! of xyzgro and volumg
+
+ return
+
+endif
+
+! P0 restriction of matrixes, "internal" surface:
+! xag0(nfacg), surfag(3,nfacgl), xagxg0(2,nfacg)
+!==========================================================================
+
+imax = 0
+
+do ifacg = 1, nfacg
+ xag0(ifacg) = 0.d0
+ surfag(1, ifacg) = 0.d0
+ surfag(2, ifacg) = 0.d0
+ surfag(3, ifacg) = 0.d0
+ xag0ij(1, ifacg) = 0.d0
+ xag0ij(2, ifacg) = 0.d0
+ xag0ij(3, ifacg) = 0.d0
+enddo
+
+do ifac = 1, nfacf
+
+ if (irsfac(ifac).gt.0) then
+
+ ifacg = irsfac(ifac)
+
+ xag0(ifacg) = xag0(ifacg) + xaf0(ifac)
+
+ surfag(1, ifacg) = surfag(1, ifacg) + surfaf(1, ifac)
+ surfag(2, ifacg) = surfag(2, ifacg) + surfaf(2, ifac)
+ surfag(3, ifacg) = surfag(3, ifacg) + surfaf(3, ifac)
+ xag0ij(1, ifacg) = xag0ij(1, ifacg) + xaf0ij(1, ifac)
+ xag0ij(2, ifacg) = xag0ij(2, ifacg) + xaf0ij(2, ifac)
+ xag0ij(3, ifacg) = xag0ij(3, ifacg) + xaf0ij(3, ifac)
+
+ else if (irsfac(ifac).lt.0) then
+
+ ifacg = - irsfac(ifac)
+
+ xag0(ifacg) = xag0(ifacg) + xaf0(ifac)
+
+ surfag(1, ifacg) = surfag(1, ifacg) - surfaf(1, ifac)
+ surfag(2, ifacg) = surfag(2, ifacg) - surfaf(2, ifac)
+ surfag(3, ifacg) = surfag(3, ifacg) - surfaf(3, ifac)
+ xag0ij(1, ifacg) = xag0ij(1, ifacg) - xaf0ij(1, ifac)
+ xag0ij(2, ifacg) = xag0ij(2, ifacg) - xaf0ij(2, ifac)
+ xag0ij(3, ifacg) = xag0ij(3, ifacg) - xaf0ij(3, ifac)
+
+ endif
+
+enddo
+
+
+!===============================================================================
+! Finalize computation of matrix in dag, xag
+!===============================================================================
+
+! interp = 0 : P0 restriction / P0 prolongation => XAG = XAG0
+! interp = 1 : P0 restriction / P1 prolongation => XAG = XAG0ij/IgJg
+
+! Initialization
+
+interp = 0
+interp = 1
+
+! Initialize non differential fine mesh term saved in w1
+
+do iel = 1, ncelf
+ w1(iel) = daf(iel)
+enddo
+do iel = ncelf + 1, ncelfe
+ w1(iel) = 0.d0
+enddo
+do ifac = 1, nfacf
+ ii = ifaclf(1, ifac)
+ jj = ifaclf(2, ifac)
+ w1(ii) = w1(ii) + xaf(ifac, 1)
+ w1(jj) = w1(jj) + xaf(ifac, isym)
+enddo
+
+! Initialize coarse matrix storage on (dag, xag)
+
+do iel = 1, ncelge
+ dag(iel) = 0.d0
+enddo
+do ifac = 1, nfacg
+ xag(ifac, 1)= 0.d0
+ xag(ifac, isym)= 0.d0
+enddo
+
+! Extradiagonal terms
+! (symmetric matrixes for now, even with non symmetric storage isym=2)
+
+! Matrix intialized to xag0 (interp=0)
+
+do ifacg = 1, nfacg
+ xag(ifacg, 1) = xag0(ifacg)
+ xag(ifacg, isym) = xag0(ifacg)
+enddo
+
+if (interp.eq.1) then
+
+ imin = 0
+ imax = 0
+
+ do ifacg = 1, nfacg
+
+ ig = ifaclg(1, ifacg)
+ jg = ifaclg(2, ifacg)
+
+ dsigjg = (xyzgro(1, jg)-xyzgro(1, ig))*surfag(1, ifacg) &
+ + (xyzgro(2, jg)-xyzgro(2, ig))*surfag(2, ifacg) &
+ + (xyzgro(3, jg)-xyzgro(3, ig))*surfag(3, ifacg)
+
+ dsxaij = xag0ij(1, ifacg)*surfag(1, ifacg) &
+ + xag0ij(2, ifacg)*surfag(2, ifacg) &
+ + xag0ij(3, ifacg)*surfag(3, ifacg)
+
+ if (abs(dsigjg) .gt. epzero) then
+
+ ! Standard
+ xag(ifacg, 1) = dsxaij/dsigjg
+ xag(ifacg, isym) = dsxaij/dsigjg
+
+ ! Clipped matrix
+ cclip = dsxaij/dsigjg
+ if (cclip .lt. xag0(ifacg)) imin = imin+1
+ if (cclip .gt. 0.d0) imax = imax +1
+ if (cclip .lt. xag0(ifacg) .or. cclip .gt. 0.d0) then
+ xag(ifacg, 1) = xag0(ifacg)
+ xag(ifacg, isym) = xag0(ifacg)
+ endif
+
+ endif
+
+ enddo
+
+ if(iwarnp.gt.3) then
+ if (irangp .ge. 0) then
+ call parcpt(imin)
+ call parcpt(imax)
+ endif
+ write(nfecra, 2001) imin, imax
+ endif
+
+ ! Possible P1 matrix / P0 matrix relaxation defined by the user in usini1.f90
+
+ do ifacg = 1, nfacg
+ xag(ifacg, 1) = rlxp1*xag(ifacg, 1) +(1.d0-rlxp1)*xag0(ifacg)
+ xag(ifacg, isym) = rlxp1*xag(ifacg, isym) +(1.d0-rlxp1)*xag0(ifacg)
+ enddo
+
+endif
+
+if (interp.ne.0 .and. interp.ne.1) then
+
+ write(nfecra,*) 'interp incorrectly defined in crstgr'
+ write(nfecra,*) '--> Stop in crstgr '
+ call csexit(1)
+
+endif
+
+
+! Diagonal term
+
+do ii = 1, ncelf
+ ig = irscel(ii)
+ dag(ig) = dag(ig) + w1(ii)
+enddo
+
+do ifacg = 1, nfacg
+
+ ig = ifaclg(1, ifacg)
+ jg = ifaclg(2, ifacg)
+
+ dag(ig) = dag(ig) - xag(ifacg, 1)
+ dag(jg) = dag(jg) - xag(ifacg, isym)
+
+enddo
+
+! Check
+!======
+
+if (iwarnp .gt. 3) then
+
+ ! Evaluate fine and coarse matrixes anisotropy
+
+ do ii = 1, ncelfe
+ w1(ii) =-1.d12
+ w2(ii) =+1.d12
+ w3(ii) =-1.d12
+ w4(ii) =+1.d12
+ enddo
+
+ do ifac = 1, nfacf
+ ii = ifaclf(1, ifac)
+ jj = ifaclf(2, ifac)
+ w1(ii) = max(abs(xaf(ifac, 1)), w1(ii))
+ w2(ii) = min(abs(xaf(ifac, 1)), w2(ii))
+ w1(jj) = max(abs(xaf(ifac, isym)), w1(jj))
+ w2(jj) = min(abs(xaf(ifac, isym)), w2(jj))
+ enddo
+
+ do ifacg = 1, nfacg
+ ig = ifaclg(1, ifacg)
+ jg = ifaclg(2, ifacg)
+ w3(ig) = max(abs(xag(ifacg,1)), w3(ig))
+ w4(ig) = min(abs(xag(ifacg,1)), w4(ig))
+ w3(jg) = max(abs(xag(ifacg, isym)), w3(jg))
+ w4(jg) = min(abs(xag(ifacg, isym)), w4(jg))
+ enddo
+
+ do ii = 1, ncelf
+ w1(ii) = w2(ii)/w1(ii)
+ enddo
+
+ do ig = 1, ncelg
+ w3(ig) = w4(ig)/w3(ig)
+ enddo
+
+ anmin(1) = w1(1)
+ anmax(1) = w1(1)
+ do ii = 2, ncelf
+ if (w1(ii) .lt. anmin(1)) then
+ anmin(1) = w1(ii)
+ else if (w1(ii) .gt. anmax(1)) then
+ anmax(1) = w1(ii)
+ endif
+ enddo
+
+ anmin(2) = w3(1)
+ anmax(2) = w3(1)
+ do ig = 2, ncelg
+ if (w3(ig) .lt. anmin(2)) then
+ anmin(2) = w3(ig)
+ else if (w3(ig) .gt. anmax(2)) then
+ anmax(2) = w3(ig)
+ endif
+ enddo
+
+ if (irangp .ge. 0) then
+ ii = 2
+ call parrmn(ii, anmin)
+ call parrmx(ii, anmax)
+ endif
+
+ write (nfecra, 2002) anmin(1), anmax(1), anmin(2), anmax(2)
+
+ if (interp .eq. 1) then
+
+ rmin = +1.d10
+ rmax = -1.d10
+ do ifacg=1,nfacg
+ rmin = min(rmin, xag(ifacg,1)/xag0(ifacg))
+ rmax = max(rmax, xag(ifacg,1)/xag0(ifacg))
+ enddo
+
+ if (irangp .ge. 0) then
+ call parmin(rmin)
+ call parmax(rmax)
+ endif
+
+ write(nfecra, 2003) rmin, rmax
+
+ endif
+
+ ! Evaluate fine and coarse matrixes diagonal dominance
+
+ do ii = 1, ncelf
+ w1(ii) = abs(daf(ii))
+ enddo
+ do ii = ncelf+1, ncelfe
+ w1(ii) = 0.d0
+ enddo
+ do ig = 1, ncelg
+ w3(ig) = abs(dag(ig))
+ enddo
+ do ig = ncelg+1, ncelge
+ w3(ig) = 0.d0
+ enddo
+
+ do ifac = 1, nfacf
+ ii = ifaclf(1, ifac)
+ jj = ifaclf(2, ifac)
+ w1(ii) = w1(ii) - abs(xaf(ifac, 1))
+ w1(jj) = w1(jj) - abs(xaf(ifac, isym))
+ enddo
+
+ do ifacg = 1, nfacg
+ ig = ifaclg(1, ifacg)
+ jg = ifaclg(2, ifacg)
+ w3(ig) = w3(ig) - abs(xag(ifacg, 1))
+ w3(jg) = w3(jg) - abs(xag(ifacg, isym))
+ enddo
+
+ do ii = 1, ncelf
+ w1(ii) = w1(ii) / abs(daf(ii))
+ enddo
+ do ig = 1, ncelg
+ w3(ig) = w3(ig) / abs(dag(ig))
+ enddo
+
+ anmin(1) = w1(1)
+ anmax(1) = w1(1)
+ do ii = 2, ncelf
+ if (w1(ii) .lt. anmin(1)) then
+ anmin(1) = w1(ii)
+ else if (w1(ii) .gt. anmax(1)) then
+ anmax(1) = w1(ii)
+ endif
+ enddo
+
+ anmin(2) = w3(1)
+ anmax(2) = w3(1)
+ do ig = 2, ncelg
+ if (w3(ig) .lt. anmin(2)) then
+ anmin(2) = w3(ig)
+ else if (w3(ig) .gt. anmax(2)) then
+ anmax(2) = w3(ig)
+ endif
+ enddo
+
+ if (irangp .ge. 0) then
+ ii = 2
+ call parrmn(ii, anmin)
+ call parrmx(ii, anmax)
+ endif
+
+ write (nfecra, 2004) anmin(1), anmax(1), anmin(2), anmax(2)
+
+endif
+
+!--------
+! Formats
+!--------
+
+ 2001 format(&
+ ' crstgr: coarse matrix < xag0 at ', i10,' faces', /, &
+ ' > 0 at ', i10,' faces')
+ 2002 format(&
+ ' fine mesh anisotropy: min = ', e12.5, /, &
+ ' max = ', e12.5, /, &
+ ' coarse mesh anisotropy: min = ', e12.5, /, &
+ ' max = ', e12.5, /)
+ 2003 format(&
+ ' minimum xag_p1/xag_p0 = ', e12.5, /, &
+ ' maximum xag_p1/xag_p0 = ', e12.5, /)
+
+ 2004 format(&
+ ' fine mesh diag dominance: min = ', e12.5, /, &
+ ' max = ', e12.5, /, &
+ ' coarse mesh diag dominance: min = ', e12.5, /, &
+ ' max = ', e12.5, /)
+!----
+! End
+!----
+
+return
+end subroutine
diff --git a/src/base/cs_ale.c b/src/base/cs_ale.c
new file mode 100644
index 0000000..b3dfa4f
--- /dev/null
+++ b/src/base/cs_ale.c
@@ -0,0 +1,289 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions associated to ALE formulation
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_config.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_interface.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_parall.h"
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ale.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+static fvm_interface_set_t *_ale_interface = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute cell and face centre of gravity, cell volume.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE ALGRMA
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (algrma, ALGRMA)(void)
+{
+
+ cs_mesh_quantities_compute(cs_glob_mesh,
+ cs_glob_mesh_quantities);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Projection on mesh vertices of the displacement (computed on cell center)
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE ALDEPL
+ * *****************
+ *
+ * INTEGER IFACEL(2,NFAC) : --> : Interior faces -> cells connectivity
+ * INTEGER IFABOR(NFABOR) : --> : Border faces -> cells connectivity
+ * INTEGER IPNFAC(NFAC+1) : --> : Interior faces -> vertices index
+ * INTEGER NODFAC(LNDFAC) : --> : Interior faces -> vertices list
+ * INTEGER IPNFBR(NFABOR+1): --> : Border faces -> vertices index
+ * INTEGER NODFBR(LNDFBR) : --> : Border faces -> vertices list
+ * DOUBLE PRECISION UMA(NCELET) : --> : Mesh velocity along X
+ * DOUBLE PRECISION VMA(NCELET) : --> : Mesh velocity along Y
+ * DOUBLE PRECISION WMA(NCELET) : --> : Mesh velocity along Z
+ * DOUBLE PRECISION COEFAU(NCELET) : --> : Boundary conditions A for UMA
+ * DOUBLE PRECISION COEFAV(NCELET) : --> : Boundary conditions A pour VMA
+ * DOUBLE PRECISION COEFAW(NCELET) : --> : Boundary conditions A pour WMA
+ * DOUBLE PRECISION COEFBU(NCELET) : --> : Boundary conditions B pour UMA
+ * DOUBLE PRECISION COEFBV(NCELET) : --> : Boundary conditions B pour VMA
+ * DOUBLE PRECISION COEFBW(NCELET) : --> : Boundary conditions B pour WMA
+ * DOUBLE PRECISION DT(NCELET) : --> : Time step
+ * DOUBLE PRECISION DEPROJ(NNOD,3)): <-- : Displacement projected on vertices
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (aldepl, ALDEPL)(const cs_int_t i_face_cells[],
+ const cs_int_t b_face_cells[],
+ const cs_int_t i_face_vtx_idx[],
+ const cs_int_t i_face_vtx_lst[],
+ const cs_int_t b_face_vtx_idx[],
+ const cs_int_t b_face_vtx_lst[],
+ cs_real_t *uma,
+ cs_real_t *vma,
+ cs_real_t *wma,
+ cs_real_t *coefau,
+ cs_real_t *coefav,
+ cs_real_t *coefaw,
+ cs_real_t *coefbu,
+ cs_real_t *coefbv,
+ cs_real_t *coefbw,
+ cs_real_t *dt,
+ cs_real_t *disp_proj)
+{
+ cs_int_t i, j, face_id, vtx_id, cell_id, cell_id1, cell_id2;
+
+ cs_real_t *vtx_counter = NULL;
+
+ const cs_int_t n_vertices = cs_glob_mesh->n_vertices;
+ const cs_int_t n_cells = cs_glob_mesh->n_cells;
+ const cs_int_t n_b_faces = cs_glob_mesh->n_b_faces;
+ const cs_int_t n_i_faces = cs_glob_mesh->n_i_faces;
+ const cs_int_t dim = cs_glob_mesh->dim;
+
+ if (cs_glob_mesh->global_vtx_num != NULL && _ale_interface == NULL)
+ _ale_interface
+ = fvm_interface_set_create(n_vertices,
+ NULL,
+ cs_glob_mesh->global_vtx_num,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ NULL);
+
+ BFT_MALLOC(vtx_counter, n_vertices, cs_real_t);
+
+ for (vtx_id = 0; vtx_id < n_vertices; vtx_id++) {
+
+ vtx_counter[vtx_id] = 0.;
+ for (i = 0; i < dim; i++)
+ disp_proj[n_vertices*i + vtx_id] = 0.;
+
+ }
+
+ /* Internal face treatment */
+
+ for (face_id = 0; face_id < n_i_faces; face_id++) {
+
+ cell_id1 = i_face_cells[2*face_id] - 1;
+ cell_id2 = i_face_cells[2*face_id+1] - 1;
+
+ if (cell_id1 <= n_cells) { /* Test to take into account face only once */
+
+ for (j = i_face_vtx_idx[face_id]; j < i_face_vtx_idx[face_id+1]; j++) {
+
+ /* Get the vertex number */
+
+ vtx_id = i_face_vtx_lst[j-1] - 1;
+
+ disp_proj[vtx_id] +=
+ 0.5 *(dt[cell_id1]*uma[cell_id1] + dt[cell_id2]*uma[cell_id2]);
+
+ disp_proj[vtx_id+n_vertices] +=
+ 0.5 *(dt[cell_id1]*vma[cell_id1] + dt[cell_id2]*vma[cell_id2]);
+
+ disp_proj[vtx_id+2*n_vertices] +=
+ 0.5 *(dt[cell_id1]*wma[cell_id1] + dt[cell_id2]*wma[cell_id2]);
+
+ vtx_counter[vtx_id] += 1.;
+
+ }
+
+ }
+
+ } /* End of loop on internal faces */
+
+ /* Border face treatment.
+ We reintialize vtx_counter on border faces in order to take into account
+ only border face contribution */
+
+ for (face_id = 0; face_id < n_b_faces; face_id++) {
+
+ for (j = b_face_vtx_idx[face_id]; j < b_face_vtx_idx[face_id+1]; j++) {
+
+ vtx_id = b_face_vtx_lst[j-1] - 1;
+ vtx_counter[vtx_id] = 0.;
+
+ for (i = 0; i < dim; i++) disp_proj[vtx_id+i*n_vertices]=0.;
+
+ }
+
+ } /* End of loop on border faces */
+
+ for (face_id = 0; face_id < n_b_faces; face_id++) {
+
+ cell_id = b_face_cells[face_id] - 1;
+
+ for (j = b_face_vtx_idx[face_id]; j < b_face_vtx_idx[face_id+1]; j++) {
+
+ vtx_id = b_face_vtx_lst[j-1] - 1;
+
+ disp_proj[vtx_id] +=
+ dt[cell_id]*(coefau[face_id] + coefbu[face_id]*uma[cell_id]);
+
+ disp_proj[vtx_id + n_vertices] +=
+ dt[cell_id]*(coefav[face_id] + coefbv[face_id]*vma[cell_id]);
+
+ disp_proj[vtx_id + 2*n_vertices] +=
+ dt[cell_id]*(coefaw[face_id] + coefbw[face_id]*wma[cell_id]);
+
+ vtx_counter[vtx_id] += 1.;
+
+ }
+
+ } /* End of loop on border faces */
+
+ if (cs_glob_mesh->global_vtx_num != NULL) {
+ cs_parall_interface_sr(_ale_interface, n_vertices, 3, disp_proj);
+ cs_parall_interface_sr(_ale_interface, n_vertices, 1, vtx_counter);
+ }
+
+
+ for (vtx_id = 0; vtx_id < n_vertices; vtx_id++)
+ for (i = 0; i < dim; i++)
+ disp_proj[vtx_id + i*n_vertices] /= vtx_counter[vtx_id];
+
+ BFT_FREE(vtx_counter);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy if necessary the associated fvm_interface_set_t structure
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE LBRALE
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (lbrale, LBRALE)(void)
+{
+
+ if (_ale_interface != NULL)
+ _ale_interface = fvm_interface_set_destroy(_ale_interface);
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_ast_coupling.c b/src/base/cs_ast_coupling.c
new file mode 100644
index 0000000..60d41ec
--- /dev/null
+++ b/src/base/cs_ast_coupling.c
@@ -0,0 +1,674 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Code_Aster coupling
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_error.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_interface.h>
+#include <fvm_nodal_extract.h>
+#include <fvm_nodal_project.h>
+#include <fvm_nodal_triangulate.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_calcium.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_mesh_connect.h"
+#include "cs_parall.h"
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ast_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+struct _cs_ast_coupling_t {
+
+ fvm_gnum_t n_g_faces;
+ fvm_gnum_t n_g_nodes;
+
+//#if defined(HAVE_MPI)
+
+ cs_int_t *n_faces_by_domain;
+ cs_int_t *n_nodes_by_domain;
+
+ cs_int_t *face_index;
+ cs_int_t *node_index;
+
+ fvm_gnum_t *NUM_GLOB_PTS;
+
+//#endif
+
+};
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+cs_ast_coupling_t *cs_glob_ast_coupling = NULL;
+
+
+static int comp_id = 0;
+
+static double cur_time = 0.;
+static double min_time = 0.;
+static double max_time = 0.;
+
+static cs_calcium_timedep_t time_dep = CALCIUM_iteration;
+
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Send nodes coordinates and structure numbering of coupled mesh.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astgeo, ASTGEO)
+(
+ cs_int_t *nbfast,
+ cs_int_t *nbnast,
+ cs_int_t *lstfac,
+ cs_int_t *idfast,
+ cs_int_t *idnast,
+ cs_real_t *almax
+)
+{
+ int i,j, n_faces, nbpts;
+ int n_nodes;
+ int max = 0;
+
+ fvm_nodal_t *ifs_mesh;
+
+ fvm_gnum_t *num_glob_points = NULL;
+ fvm_gnum_t *num_glob_points_tot = NULL;
+
+ cs_int_t *index = NULL;
+ cs_int_t *faces_color = NULL;
+ cs_int_t *nodes_color = NULL;
+ cs_int_t *inter_nodes_color = NULL;
+
+ cs_real_t *coords = NULL;
+ cs_real_t *inter_coords = NULL;
+ cs_real_t *faces_coords = NULL;
+ cs_real_t *nodes_coords = NULL;
+ cs_real_t *coords_rang0 = NULL;
+
+ cs_real_t *b_face_cog = cs_glob_mesh_quantities->b_face_cog;
+
+ cs_ast_coupling_t *ast_coupling = cs_glob_ast_coupling;
+
+#if defined(HAVE_MPI)
+ MPI_Status status;
+#endif
+
+ n_faces = *(nbfast);
+
+ ifs_mesh = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ "MaillageExtraitAster_1",
+ 0,
+ n_faces,
+ NULL,
+ lstfac);
+
+ n_nodes = (cs_int_t) fvm_nodal_get_n_entities(ifs_mesh, 0);
+
+
+ assert(cs_glob_n_ranks == 1);
+
+ /* Creation of the information structure for Code_Saturne/Code_Aster
+ coupling */
+
+ BFT_MALLOC(ast_coupling, 1, cs_ast_coupling_t);
+
+ ast_coupling->n_g_nodes = fvm_nodal_get_n_g_vertices(ifs_mesh);
+ ast_coupling->n_g_faces = n_faces;
+
+ BFT_MALLOC(ast_coupling->n_faces_by_domain, cs_glob_n_ranks, cs_int_t);
+ BFT_MALLOC(ast_coupling->n_nodes_by_domain, cs_glob_n_ranks, cs_int_t);
+
+ ast_coupling->n_nodes_by_domain[0] = n_nodes;
+ ast_coupling->n_faces_by_domain[0] = n_faces;
+
+
+ BFT_MALLOC(faces_color, n_faces, cs_int_t);
+ BFT_MALLOC(nodes_color, n_nodes, cs_int_t);
+ BFT_MALLOC(faces_coords, 3*n_faces, cs_real_t);
+ BFT_MALLOC(nodes_coords, 3*n_nodes, cs_real_t);
+
+ assert(sizeof(fvm_coord_t)==sizeof(cs_real_t));
+
+ fvm_nodal_get_vertex_coords(ifs_mesh, FVM_INTERLACE,
+ (fvm_coord_t *) nodes_coords);
+
+ for (j = 0; j < n_faces; j++) {
+
+ faces_coords[3*j] = b_face_cog[3*(lstfac[j]-1)];
+ faces_coords[3*j+1] = b_face_cog[3*(lstfac[j]-1)+1];
+ faces_coords[3*j+2] = b_face_cog[3*(lstfac[j]-1)+2];
+
+ faces_color[j] = idfast[j];
+
+ }
+
+ for (j = 0; j < n_nodes; j++) {
+
+ nodes_color[j] = idnast[j];
+
+ }
+
+
+ /* TODO: Adapter l'algo parallel en sequentiel */
+
+ if (cs_glob_rank_id <= 0) {
+
+ cs_int_t *geom = NULL;
+
+ BFT_MALLOC(geom,2,cs_int_t);
+
+ geom[0] = n_faces;
+ geom[1] = n_nodes;
+
+ cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
+ "dongeo", 2, &(geom[0]));
+
+ BFT_FREE(geom);
+
+ cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
+ "almaxi", 1, almax);
+
+ cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
+ "coofac", 3*n_faces,&(faces_coords[0]));
+
+ cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
+ "coonod", 3*n_nodes,&(nodes_coords[0]));
+
+ cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
+ "colfac", n_faces, &(faces_color[0]));
+
+ cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
+ "colnod", n_nodes, &(nodes_color[0]));
+
+ }
+
+ cs_glob_ast_coupling = ast_coupling;
+
+ BFT_FREE(faces_color);
+ BFT_FREE(nodes_color);
+ BFT_FREE(faces_coords);
+ BFT_FREE(nodes_coords);
+}
+
+/*----------------------------------------------------------------------------
+ * Send stresses acting on the fluid/structure interface.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astfor, ASTFOR)
+(
+ cs_int_t *ntcast,
+ cs_int_t *nbfast,
+ cs_real_t *forast
+)
+{
+ cs_ast_coupling_t *ast_coupling = cs_glob_ast_coupling;
+
+ const int n_faces = *nbfast;
+ const int n_g_faces = ast_coupling->n_g_faces;
+
+ cs_real_t *_forast;
+
+
+ if (cs_glob_rank_id <= 0)
+ BFT_MALLOC(_forast, 3*n_g_faces, cs_real_t);
+
+
+ if (cs_glob_n_ranks == 1) {
+
+ int i;
+
+ assert(n_faces == n_g_faces);
+
+ for (i = 0; i < 3*n_g_faces; i++)
+ _forast[i] = forast[i];
+
+ }
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ MPI_Gatherv(forast, 3*n_faces, CS_MPI_REAL,
+ _forast, ast_coupling->n_faces_by_domain,
+ ast_coupling->face_index, CS_MPI_REAL,
+ 0, cs_glob_mpi_comm);
+
+ }
+
+#endif
+
+ if (cs_glob_rank_id <= 0) {
+
+ cs_calcium_write_double(comp_id, time_dep, cur_time, *ntcast,
+ "forsat", 3*n_g_faces, _forast);
+
+ BFT_FREE(_forast);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Receive predicted or exact displacement of the fluid/structure interface
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astcin, ASTCIN)
+(
+ cs_int_t *ntcast,
+ cs_int_t *nbfast,
+ cs_int_t *lstfac,
+ cs_real_t *depale
+)
+{
+ cs_int_t i;
+ cs_int_t *parent_num = NULL;
+ cs_int_t num_node_parent = 0;
+
+ const cs_int_t n_vertices = cs_glob_mesh->n_vertices;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0 : cs_glob_rank_id;
+
+ cs_ast_coupling_t *ast_coupling = cs_glob_ast_coupling;
+
+ int n_nodes;
+ const int n_g_nodes = ast_coupling->n_g_nodes;
+ const int n_faces = *nbfast;
+
+ fvm_nodal_t *mesh_ifs;
+
+ cs_real_t *_xast, *xast;
+
+ n_nodes = ast_coupling->n_nodes_by_domain[local_rank];
+
+ BFT_MALLOC(xast, 3*n_nodes, cs_real_t);
+
+ if (cs_glob_rank_id <= 0) {
+
+ int n_val_read = 0;
+
+ BFT_MALLOC(_xast, 3*n_g_nodes, cs_real_t);
+
+ cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
+ ntcast,
+ "depsat", 3*n_g_nodes,
+ &n_val_read, _xast);
+
+ assert(n_val_read == 3*n_g_nodes);
+
+ }
+
+ if (cs_glob_n_ranks == 1) {
+
+ assert(n_nodes == n_g_nodes);
+
+ for (i = 0; i < 3*n_nodes; i++)
+ xast[i] = _xast[i];
+
+ }
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ MPI_Scatterv(_xast, ast_coupling->n_nodes_by_domain,
+ ast_coupling->node_index, CS_MPI_REAL,
+ xast, n_nodes,
+ CS_MPI_REAL, 0, cs_glob_mpi_comm);
+
+ }
+
+#endif
+
+ if (cs_glob_rank_id <= 0)
+ BFT_FREE(_xast);
+
+ /* Creation maillage */
+
+ mesh_ifs = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ "MaillageExtraitAster_1",
+ 0,
+ n_faces,
+ NULL,
+ lstfac);
+
+ /* Tableau de numerotation */
+
+ BFT_MALLOC(parent_num, n_nodes, cs_int_t);
+ fvm_nodal_get_parent_num(mesh_ifs, 0, parent_num);
+
+ /* On remplit dans DEPALE les valeurs de deplacement aux noeuds
+ couples a deplacement impose */
+
+ for (i = 0; i < n_nodes; i++) {
+
+ num_node_parent = parent_num[i];
+
+ depale[ num_node_parent-1] = xast[3*i];
+ depale[ n_vertices + num_node_parent-1] = xast[3*i + 1];
+ depale[2*n_vertices + num_node_parent-1] = xast[3*i + 2];
+
+ }
+
+ /* Liberation du(des) tableau(x) */
+ BFT_FREE(parent_num);
+}
+
+
+/*----------------------------------------------------------------------------
+ * Receive coupling parameters
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astpar, ASTPAR)
+(
+ cs_int_t *nbpdt,
+ cs_int_t *nbsspdt,
+ cs_real_t *delta,
+ cs_int_t *ihi,
+ cs_int_t *chro,
+ cs_real_t *tt,
+ cs_real_t *dt
+)
+{
+ /* Initialisation calcium */
+
+ if (cs_glob_rank_id <= 0) {
+
+ int n_val_read = 0;
+ int iteration = *nbpdt;
+
+ /* Initialization of communication with calcium */
+
+ char *instance = NULL;
+
+ double ttanc = 0.;
+
+ BFT_MALLOC(instance,200,char);
+
+ cs_calcium_connect(comp_id, instance);
+
+ BFT_FREE(instance);
+
+
+ /* Reception des donnees */
+
+ iteration = 0;
+
+ /* commande reception nb iterations */
+ cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
+ &iteration,
+ "nbpdtm", 1, &n_val_read, nbpdt);
+ /* commande reception nb sous-it. */
+ cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
+ &iteration,
+ "nbssit",1,&n_val_read, nbsspdt);
+ /* commande reception de la variable epsilo */
+ cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
+ &iteration,
+ "epsilo",1,&n_val_read, delta);
+ /* commande reception de la variable isyncp */
+ cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
+ &iteration,
+ "isyncp",1,&n_val_read, ihi);
+ /* commande reception de la variable ntchr */
+ cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
+ &iteration,
+ "ntchro",1,&n_val_read, chro);
+ /* commande reception de la variable ttinit */
+ cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
+ &iteration,
+ "ttinit",1,&n_val_read, &ttanc);
+ /* commande reception de la variable dtref */
+ cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
+ &iteration,
+ "pdtref",1,&n_val_read, dt);
+
+ if (fabs(*tt - ttanc) > 1.e-16)
+ bft_error(__FILE__, __LINE__, 0,
+ "Arret du calcul: ttinit different de ttpabs \n");
+
+ }
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ MPI_Bcast(nbpdt, 1, CS_MPI_INT, 0, cs_glob_mpi_comm);
+ MPI_Bcast(nbsspdt, 1, CS_MPI_INT, 0, cs_glob_mpi_comm);
+ MPI_Bcast(ihi, 1, CS_MPI_INT, 0, cs_glob_mpi_comm);
+ MPI_Bcast(chro, 1, CS_MPI_INT, 0, cs_glob_mpi_comm);
+ MPI_Bcast(delta, 1, CS_MPI_REAL, 0, cs_glob_mpi_comm);
+ MPI_Bcast(dt, 1, CS_MPI_REAL, 0, cs_glob_mpi_comm);
+
+ }
+
+#endif
+
+ /* Warning */
+
+ bft_printf("@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"
+ "@ @@ ATTENTION : MODIFICATION DES PARAMETRES UTILISATEURS \n"
+ "@ ********* \n"
+ "@ \n"
+ "@ Presence du couplage Code_Saturne/Code_Aster : \n"
+ "@ Les donnees rentrees dans l'outil 'Milieu' \n"
+ "@ ecrasent les donnees rentrees par l'utilisateur \n"
+ "@ \n"
+ "@ Nouvelles valeurs: \n"
+ "@ NTMABS = %i \n"
+ "@ NALIMX = %i \n"
+ "@ EPALIM = %f \n"
+ "@ ISYNCP = %i \n"
+ "@ NTCHR = %i \n"
+ "@ DTREF = %f \n"
+ "@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n",
+ *nbpdt, *nbsspdt, *delta, *ihi, *chro, *dt);
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange time-step
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astpdt, ASTPDT)
+(
+ cs_real_t *dttab,
+ cs_int_t *ncelet,
+ cs_int_t *nbpdt
+)
+{
+ int i;
+ cs_real_t dttmp = 0.;
+
+ if (cs_glob_rank_id <= 0) {
+
+ int n_val_read = 0;
+ double dtloc = 0.;
+
+ dttmp = dttab[0];
+
+ /* Send time step (calculated in "ddtvar" Subroutine) to'Milieu'*/
+ cs_calcium_write_double(comp_id, time_dep, 0.0, *nbpdt,
+ "dtsat", 1, &dttmp);
+
+ /* Receive time step sent by 'Milieu' */
+ cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
+ nbpdt,
+ "dtcalc", 1, &n_val_read, &(dtloc));
+
+ assert(n_val_read == 1);
+
+ dttmp = dtloc;
+
+ }
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1)
+ MPI_Bcast(&dttmp, 1, CS_MPI_REAL, 0, cs_glob_mpi_comm);
+
+#endif
+
+
+ for (i = 0; i < *ncelet; i++)
+ dttab[i] = dttmp;
+
+
+ bft_printf("@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"
+ "@ @@ ATTENTION : MODIFICATION DE LA VALEUR DU PAS DE TEMPS \n"
+ "@ ********* \n"
+ "@ \n"
+ "@ Presence du couplage Saturne/Aster: \n"
+ "@ les options : \n"
+ "@ - pdt uniforme et constant (IDTVAR=0) \n"
+ "@ - pdt uniforme en espace et variable en temps (IDTVAR=1)\n"
+ "@ restent activables \n"
+ "@ \n"
+ "@ l' option : \n"
+ "@ - pdt variable en espace et en temps (IDTVAR=2) \n"
+ "@ est desactivee \n"
+ "@ \n"
+ "@ Valeur du pas de temps retenue pour le calcul couple: \n"
+ "@ dt = %f \n"
+ "@ \n"
+ "@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n",
+ dttmp);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Receive convergence value of Code_Saturne/Code_Aster coupling
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astcv1, ASTCV1)
+(
+ cs_int_t *ntcast,
+ cs_int_t *icv
+)
+{
+ if (cs_glob_rank_id <= 0) {
+
+ int n_val_read = 0;
+
+ cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time, ntcast,
+ "icvext", 1, &n_val_read, icv);
+
+ assert(n_val_read == 1);
+
+ }
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1)
+ MPI_Bcast(icv, 1, CS_MPI_INT, 0, cs_glob_mpi_comm);
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Send global convergence value of IFS calculations
+ * (internal and external structures)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(astcv2, ASTCV2)
+(
+ cs_int_t *ntcast,
+ cs_int_t *icv
+)
+{
+ if (cs_glob_rank_id <= 0) {
+
+ cs_calcium_write_int(comp_id, time_dep, cur_time, *ntcast,
+ "icv", 1, icv);
+
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_base.c b/src/base/cs_base.c
new file mode 100644
index 0000000..5f62748
--- /dev/null
+++ b/src/base/cs_base.c
@@ -0,0 +1,1639 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <time.h>
+
+#if defined(HAVE_GETCWD) || defined(HAVE_SLEEP)
+#include <unistd.h>
+#endif
+
+#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
+#include <pwd.h>
+#endif
+
+#if defined(HAVE_UNAME)
+#include <sys/utsname.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_backtrace.h>
+#include <bft_mem_usage.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+#include <bft_sys_info.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_config.h>
+#if !defined(HAVE_MPI) && defined(FVM_HAVE_MPI)
+#error "Either both or neither Code_Saturne and FVM must be configured with MPI"
+#endif
+
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* Fortran API */
+/*-------------*/
+
+/*
+ * 'usual' maximum name length; a longer name is possible, but will
+ * provoque a dynamic memory allocation.
+ */
+
+#define CS_BASE_N_STRINGS 5
+#define CS_BASE_STRING_LEN 64
+
+/*============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+#if defined(HAVE_MPI)
+
+typedef struct
+{
+ long val;
+ int rank;
+} _cs_base_mpi_long_int_t;
+
+typedef struct
+{
+ double val;
+ int rank;
+} _cs_base_mpi_double_int_t;
+
+#endif
+
+/* Type to backup signal handlers */
+
+typedef void (*_cs_base_sighandler_t) (int);
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+int cs_glob_n_threads = 1; /* Number of threads */
+
+int cs_glob_rank_id = -1; /* Rank of process in communicator */
+int cs_glob_n_ranks = 1; /* Number of processes in communicator */
+
+#if defined(HAVE_MPI)
+MPI_Comm cs_glob_mpi_comm = MPI_COMM_NULL; /* Intra-communicator */
+#endif
+
+static bft_error_handler_t *cs_glob_base_gest_erreur_save = NULL;
+
+/* Static (private) global variables */
+/*-----------------------------------*/
+
+static cs_bool_t cs_glob_base_bft_mem_init = false;
+
+static cs_bool_t cs_glob_base_str_init = false;
+static cs_bool_t cs_glob_base_str_is_free[CS_BASE_N_STRINGS];
+static char cs_glob_base_str[CS_BASE_N_STRINGS]
+ [CS_BASE_STRING_LEN + 1];
+
+/* Global variables associated with signal handling */
+
+#if defined(SIGHUP)
+static _cs_base_sighandler_t cs_glob_base_sighup_save = SIG_DFL;
+#endif
+
+static _cs_base_sighandler_t cs_glob_base_sigint_save = SIG_DFL;
+static _cs_base_sighandler_t cs_glob_base_sigterm_save = SIG_DFL;
+static _cs_base_sighandler_t cs_glob_base_sigfpe_save = SIG_DFL;
+static _cs_base_sighandler_t cs_glob_base_sigsegv_save = SIG_DFL;
+
+#if defined(SIGXCPU)
+static _cs_base_sighandler_t cs_glob_base_sigcpu_save = SIG_DFL;
+#endif
+
+/* Global variables for handling of Fortran work arrays */
+
+static char _cs_glob_srt_ia_peak[7] = "------";
+static char _cs_glob_srt_ra_peak[7] = "------";
+static cs_int_t _cs_glob_mem_ia_peak = 0;
+static cs_int_t _cs_glob_mem_ra_peak = 0;
+static cs_int_t _cs_glob_mem_ia_size = 0;
+static cs_int_t _cs_glob_mem_ra_size = 0;
+
+/* Global variables for instrumentation */
+
+#if defined(HAVE_MPI) && defined(HAVE_MPE)
+int cs_glob_mpe_broadcast_a = 0;
+int cs_glob_mpe_broadcast_b = 0;
+int cs_glob_mpe_synchro_a = 0;
+int cs_glob_mpe_synchro_b = 0;
+int cs_glob_mpe_send_a = 0;
+int cs_glob_mpe_send_b = 0;
+int cs_glob_mpe_rcv_a = 0;
+int cs_glob_mpe_rcv_b = 0;
+int cs_glob_mpe_reduce_a = 0;
+int cs_glob_mpe_reduce_b = 0;
+int cs_glob_mpe_compute_a = 0;
+int cs_glob_mpe_compute_b = 0;
+#endif
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Print a message to standard output
+ *----------------------------------------------------------------------------*/
+
+static int
+_cs_base_bft_printf(const char *const format,
+ va_list arg_ptr)
+{
+ cs_int_t line;
+ cs_int_t msgsize;
+
+ /* Buffer for printing from C code: print to a character string, which will
+ be printed to file by Fortran code.
+ If Fortran output is completely replaced by C output in the future,
+ we will be able to remove this step, but it is currently necessary
+ so as to ensure that the same output files may be used and output
+ remains ordered. */
+
+#undef CS_BUF_PRINT_F_SIZE
+#define CS_BUF_PRINT_F_SIZE 16384
+
+ static char cs_buf_print_f[CS_BUF_PRINT_F_SIZE];
+
+ /* Write to buffer */
+
+#if (_CS_STDC_VERSION < 199901L)
+ msgsize = vsprintf (cs_buf_print_f, format, arg_ptr);
+#else
+ msgsize = vsnprintf (cs_buf_print_f, CS_BUF_PRINT_F_SIZE, format, arg_ptr);
+#endif
+
+ line = __LINE__ - 1;
+
+ if (msgsize == -1 || msgsize > CS_BUF_PRINT_F_SIZE - 1) {
+ fprintf(stderr,
+ _("Fatal error: bft_printf() called on a message of size %d\n"
+ "whereas the print buffer is of size %d."),
+ msgsize, CS_BUF_PRINT_F_SIZE);
+
+ /* Try to force segmentation fault (to call signal handlers);
+ as stack has most likely been corrupted, this is the most
+ "similar" error that allows for portable handling. */
+ {
+ int *_force_err = NULL;
+ *_force_err = 0;
+ }
+ cs_exit(EXIT_FAILURE);
+ }
+
+ /* Effective output by Fortran code */
+
+ CS_PROCF (csprnt, CSPRNT) (cs_buf_print_f, &msgsize);
+
+ return msgsize;
+}
+
+/*----------------------------------------------------------------------------
+ * Flush log output buffer
+ *----------------------------------------------------------------------------*/
+
+static int
+_cs_base_bft_printf_flush(void)
+{
+ CS_PROCF (csflsh, CSFLSH) ();
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------
+ * Print a message to the error output
+ *
+ * The message is repeated on the standard output and an error file.
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_err_vprintf(const char *format,
+ va_list arg_ptr)
+{
+ static cs_bool_t initialized = false;
+
+ /* message to the standard output */
+
+#if defined(va_copy) || defined(__va_copy)
+ {
+ va_list arg_ptr_2;
+
+#if defined(va_copy)
+ va_copy(arg_ptr_2, arg_ptr);
+#else
+ __va_copy(arg_ptr_2, arg_ptr);
+#endif
+ _cs_base_bft_printf(format, arg_ptr_2);
+ va_end(arg_ptr_2);
+ }
+#endif
+
+ /* message on a specific error output, initialized only if the
+ error output is really necessary */
+
+ if (initialized == false) {
+
+ char nom_fic_err[81];
+
+ if (cs_glob_rank_id < 1)
+ strcpy(nom_fic_err, "error");
+
+ else {
+#if defined(HAVE_SLEEP)
+ int wait_time = (cs_glob_n_ranks < 64) ? 1: 10;
+ sleep(wait_time); /* Wait a few seconds, so that if rank 0 also
+ has encountered an error, it may kill
+ other ranks through MPI_Abort, so that
+ only rank 0 will generate an error file.
+ If rank 0 has not encountered the error,
+ proceed normally after the wait. */
+#endif
+ sprintf(nom_fic_err, "error_n%04d", cs_glob_rank_id + 1);
+ }
+
+ freopen(nom_fic_err, "w", stderr);
+
+ initialized = true;
+ }
+
+ vfprintf(stderr, format, arg_ptr);
+}
+
+/*----------------------------------------------------------------------------
+ * Print a message to error output
+ *
+ * The message is repeated on the standard output and an error file.
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_err_printf(const char *format,
+ ...)
+{
+ /* Initialisation de la liste des arguments */
+
+ va_list arg_ptr;
+
+ va_start(arg_ptr, format);
+
+ /* message sur les sorties */
+
+ _cs_base_err_vprintf(format, arg_ptr);
+
+ /* Finalisation de la liste des arguments */
+
+ va_end(arg_ptr);
+}
+
+/*----------------------------------------------------------------------------
+ * Exit function
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_exit(int status)
+{
+#if defined(HAVE_MPI)
+ {
+ int mpi_flag;
+
+ MPI_Initialized(&mpi_flag);
+
+ if (mpi_flag != 0) {
+
+ if (status != EXIT_SUCCESS)
+ MPI_Abort(cs_glob_mpi_comm, EXIT_FAILURE);
+
+ else { /* if (status == EXIT_SUCCESS) */
+
+ MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Finalize();
+
+ }
+ }
+ }
+#endif /* HAVE_MPI */
+
+ exit(status);
+}
+
+/*----------------------------------------------------------------------------
+ * Stop the code in case of error
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_gestion_erreur(const char *nom_fic,
+ int num_ligne,
+ int code_err_sys,
+ const char *format,
+ va_list arg_ptr)
+{
+ bft_printf_flush();
+
+ _cs_base_err_printf("\n");
+
+ if (code_err_sys != 0)
+ _cs_base_err_printf(_("\nSystem error: %s\n"), strerror(code_err_sys));
+
+ _cs_base_err_printf(_("\n%s:%d: Fatal error.\n\n"), nom_fic, num_ligne);
+
+ _cs_base_err_vprintf(format, arg_ptr);
+
+ _cs_base_err_printf("\n\n");
+
+ bft_backtrace_print(3);
+
+ _cs_base_exit(EXIT_FAILURE);
+}
+
+/*----------------------------------------------------------------------------
+ * Print memory usage summary in case of error
+ *----------------------------------------------------------------------------*/
+
+static void
+_error_mem_summary(void)
+{
+ size_t mem_usage;
+
+ _cs_base_err_printf(_("\n\n"
+ "Memory allocation summary\n"
+ "-------------------------\n\n"));
+
+ /* Available memory usage information */
+
+ _cs_base_err_printf
+ (_("Theoretical current allocated memory: %lu kB\n"),
+ (unsigned long)(bft_mem_size_current()));
+
+ _cs_base_err_printf
+ (_("Theoretical maximum allocated memory: %lu kB\n"),
+ (unsigned long)(bft_mem_size_max()));
+
+ if (bft_mem_usage_initialized() == 1) {
+
+ /* Maximum measured memory */
+
+ mem_usage = bft_mem_usage_max_pr_size();
+ if (mem_usage > 0)
+ _cs_base_err_printf
+ (_("Maximum program memory measure: %lu kB\n"),
+ (unsigned long)mem_usage);
+
+ /* Current measured memory */
+
+ mem_usage = bft_mem_usage_pr_size();
+ if (mem_usage > 0)
+ _cs_base_err_printf
+ (_("Current program memory measure: %lu kB\n"),
+ (unsigned long)mem_usage);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Memory allocation error handler.
+ *
+ * Memory status is written to the error output, and the general error
+ * handler used by bft_error() is called (which results in the termination
+ * of the current process).
+ *
+ * parameters:
+ * file_name <-- name of source file from which error handler called.
+ * line_num <-- line of source file from which error handler called.
+ * sys_error_code <-- error code if error in system or libc call, 0 otherwise.
+ * format <-- format string, as printf() and family.
+ * arg_ptr <-> variable argument list based on format string.
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_mem_error_handler(const char *file_name,
+ int line_num,
+ int sys_error_code,
+ const char *format,
+ va_list arg_ptr)
+{
+ bft_error_handler_t * general_err_handler;
+
+ _error_mem_summary();
+
+ general_err_handler = bft_error_handler_get();
+ general_err_handler(file_name, line_num, sys_error_code, format, arg_ptr);
+}
+
+/*----------------------------------------------------------------------------
+ * Print a stack trace
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_backtrace_print(int niv_debut)
+{
+ size_t ind;
+ bft_backtrace_t *tr = NULL;
+
+ tr = bft_backtrace_create();
+
+ if (tr != NULL) {
+
+ char s_func_buf[67];
+
+ const char *s_file;
+ const char *s_func;
+ const char *s_addr;
+
+ const char s_inconnu[] = "?";
+ const char s_vide[] = "";
+ const char *s_prefix = s_vide;
+
+ size_t nbr = bft_backtrace_size(tr);
+
+ if (nbr > 0)
+ _cs_base_err_printf(_("\nCall stack:\n"));
+
+ for (ind = niv_debut ; ind < nbr ; ind++) {
+
+ s_file = bft_backtrace_file(tr, ind);
+ s_func = bft_backtrace_function(tr, ind);
+ s_addr = bft_backtrace_address(tr, ind);
+
+ if (s_file == NULL)
+ s_file = s_inconnu;
+ if (s_func == NULL)
+ strcpy(s_func_buf, "?");
+ else {
+ s_func_buf[0] = '<';
+ strncpy(s_func_buf + 1, s_func, 64);
+ strcat(s_func_buf, ">");
+ }
+ if (s_addr == NULL)
+ s_addr = s_inconnu;
+
+ _cs_base_err_printf("%s%4d: %-12s %-32s (%s)\n", s_prefix,
+ ind-niv_debut+1, s_addr, s_func_buf, s_file);
+
+ }
+
+ bft_backtrace_destroy(tr);
+
+ if (nbr > 0)
+ _cs_base_err_printf(_("End of stack\n\n"));
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Handle a fatal signal (such as SIGFPE or SIGSEGV)
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_sig_fatal(int signum)
+{
+ bft_printf_flush();
+
+ switch (signum) {
+
+#if defined(SIGHUP)
+ case SIGHUP:
+ _cs_base_err_printf(_("SIGHUP signal (hang-up) intercepted.\n"
+ "--> computation interrupted.\n"));
+ break;
+#endif
+
+ case SIGINT:
+ _cs_base_err_printf(_("SIGINT signal (Control+C or equivalent) received.\n"
+ "--> computation interrupted by user.\n"));
+ break;
+
+ case SIGTERM:
+ _cs_base_err_printf(_("SIGTERM signal (termination) received.\n"
+ "--> computation interrupted by environment.\n"));
+ break;
+
+ case SIGFPE:
+ _cs_base_err_printf(_("SIGFPE signal (floating point exception) "
+ "intercepted!\n"));
+ break;
+
+ case SIGSEGV:
+ _cs_base_err_printf(_("SIGSEGV signal (forbidden memory area access) "
+ "intercepted!\n"));
+ break;
+
+#if defined(SIGXCPU)
+ case SIGXCPU:
+ _cs_base_err_printf(_("SIGXCPU signal (CPU time limit reached) "
+ "intercepted.\n"));
+ break;
+#endif
+
+ default:
+ _cs_base_err_printf(_("Signal %d intercepted!\n"), signum);
+ }
+
+ bft_backtrace_print(3);
+
+ _cs_base_exit(EXIT_FAILURE);
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Finalisation MPI
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_mpi_fin(void)
+{
+#if defined(HAVE_MPE)
+ if (cs_glob_n_ranks > 1)
+ _cs_base_prof_mpe_fin();
+#endif
+
+#if defined(FVM_HAVE_MPI)
+ fvm_parall_set_mpi_comm(MPI_COMM_NULL);
+#endif
+
+ bft_error_handler_set(cs_glob_base_gest_erreur_save);
+
+ if ( cs_glob_mpi_comm != MPI_COMM_NULL
+ && cs_glob_mpi_comm != MPI_COMM_WORLD)
+ MPI_Comm_free(&cs_glob_mpi_comm);
+}
+
+
+#if defined(DEBUG) || !defined(NDEBUG)
+
+/*----------------------------------------------------------------------------
+ * MPI error handler
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_erreur_mpi(MPI_Comm *comm,
+ int *errcode,
+ ...)
+{
+ int err_len;
+ char err_string[MPI_MAX_ERROR_STRING + 1];
+
+#if defined MPI_MAX_OBJECT_NAME
+ int name_len = 0;
+ char comm_name[MPI_MAX_OBJECT_NAME + 1];
+#endif
+
+ bft_printf_flush();
+
+ _cs_base_err_printf("\n");
+
+ MPI_Error_string(*errcode, err_string, &err_len);
+ err_string[err_len] = '\0';
+
+#if defined MPI_MAX_OBJECT_NAME
+ MPI_Comm_get_name(*comm, comm_name, &name_len);
+ comm_name[name_len] = '\0';
+ _cs_base_err_printf(_("\nMPI error (communicator %s):\n"
+ "%s\n"), comm_name, err_string);
+#else
+ _cs_base_err_printf(_("\nMPI error:\n"
+ "%s\n"), err_string);
+#endif
+
+ _cs_base_err_printf("\n\n");
+
+ bft_backtrace_print(3);
+
+ _cs_base_exit(EXIT_FAILURE);
+}
+
+#endif
+#endif /* HAVE_MPI */
+
+
+#if defined(HAVE_MPI) && defined(HAVE_MPE)
+
+/*----------------------------------------------------------------------------
+ * Initialize MPE instrumentation
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_prof_mpe_init(int rank)
+{
+ int flag;
+
+ MPI_Initialized(&flag);
+
+ /* MPE_Init_log() and MPE_finish_log() are NOT required if the liblmpe.a
+ library is linked with Code_Saturne. In this case, MPI_Init()
+ handles the call toe MPE_Init_log() */
+
+ if (flag) {
+
+ MPE_Init_log();
+
+ MPE_Log_get_state_eventIDs(&cs_glob_mpe_broadcast_a,
+ &cs_glob_mpe_broadcast_b);
+ MPE_Log_get_state_eventIDs(&cs_glob_mpe_synchro_a,
+ &cs_glob_mpe_synchro_b);
+ MPE_Log_get_state_eventIDs(&cs_glob_mpe_send_a,
+ &cs_glob_mpe_send_b);
+ MPE_Log_get_state_eventIDs(&cs_glob_mpe_rcv_a,
+ &cs_glob_mpe_rcv_b);
+ MPE_Log_get_state_eventIDs(&cs_glob_mpe_reduce_a,
+ &cs_glob_mpe_reduce_b);
+ MPE_Log_get_state_eventIDs(&cs_glob_mpe_compute_a,
+ &cs_glob_mpe_compute_b);
+
+ if (rank == 0) {
+
+ MPE_Describe_state(cs_glob_mpe_broadcast_a,
+ cs_glob_mpe_broadcast_b,
+ "Broadcast", "orange");
+ MPE_Describe_state(cs_glob_mpe_synchro_a,
+ cs_glob_mpe_synchro_b,
+ "MPI Barrier", "blue");
+ MPE_Describe_state(cs_glob_mpe_send_a,
+ cs_glob_mpe_send_b,
+ "Send", "yellow");
+ MPE_Describe_state(cs_glob_mpe_rcv_a,
+ cs_glob_mpe_rcv_b,
+ "Receive", "red");
+ MPE_Describe_state(cs_glob_mpe_reduce_a,
+ cs_glob_mpe_reduce_b,
+ "Reduce", "white");
+ MPE_Describe_state(cs_glob_mpe_compute_a,
+ cs_glob_mpe_compute_b,
+ "Compute", "green");
+
+ MPE_Start_log();
+ MPE_Log_event(cs_glob_mpe_compute_a, 0, NULL);
+
+ }
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize MPE instrumentation
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_prof_mpe_fin(void)
+{
+ int flag, rank;
+
+ MPI_Initialized(&flag);
+
+ if (flag)
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+ MPE_Log_event(cs_glob_mpe_compute_b, 0, NULL);
+ MPE_Log_sync_clocks();
+
+ if (rank == 0)
+ MPE_Finish_log("Code_Saturne");
+}
+
+#endif /* defined(HAVE_MPI) && defined(HAVE_MPE) */
+
+/*----------------------------------------------------------------------------
+ * Maximum value of a counter and associated 6 character string
+ * (used for Fortan maximum memory count in IA/RA).
+ *
+ * parameters:
+ * mem_peak <-> maximum value reached
+ * srt_peak <-> associated subroutine name
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_base_work_mem_max(cs_int_t *mem_peak,
+ char srt_peak[6])
+{
+#if defined(HAVE_MPI)
+
+ _cs_base_mpi_long_int_t val_in, val_max;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ val_in.val = *mem_peak;
+ val_in.rank = cs_glob_rank_id;
+
+ MPI_Allreduce(&val_in, &val_max, 1, MPI_LONG_INT, MPI_MAXLOC,
+ cs_glob_mpi_comm);
+
+ *mem_peak = val_max.val;
+
+ MPI_Bcast(srt_peak, 6, MPI_CHAR, val_max.rank, cs_glob_mpi_comm);
+#endif
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Call exit routine from Fortran code
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE CSEXIT (STATUS)
+ * *****************
+ *
+ * INTEGER STATUS : --> : 0 for success, 1+ for error
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csexit, CSEXIT)
+(
+ const cs_int_t *status
+)
+{
+ cs_exit (*status);
+}
+
+/*----------------------------------------------------------------------------
+ * CPU time used since execution start
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DMTMPS (TCPU)
+ * *****************
+ *
+ * DOUBLE PRECISION TCPU : --> : CPU time (user + system)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (dmtmps, DMTMPS)
+(
+ cs_real_t *tcpu
+)
+{
+ *tcpu = bft_timer_cpu_time();
+}
+
+/*----------------------------------------------------------------------------
+ * Check that main integer working array memory reservation fits within
+ * the allocated size of IA.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE IASIZE (CALLER, MEMINT)
+ * *****************
+ *
+ * CHARACTER*6 CALLER : --> : Name of calling subroutine
+ * INTEGER MEMINT : --> : Last required element in IA
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (iasize, IASIZE)
+(
+ const char caller[6],
+ cs_int_t *memint
+)
+{
+ /* Test if enough memory is available */
+
+ if (*memint > _cs_glob_mem_ia_size) {
+ char _caller[7];
+ strncpy(_caller, caller, 6);
+ _caller[6] = '\0';
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _(" Sub-routine calling IASIZE: %s\n"
+ " Memory needed in IA (number of integers): %d\n"
+ " available: %d\n\n"
+ " ----> Define IASIZE to a value at least equal to %d integers)."),
+ _caller, *memint, _cs_glob_mem_ia_size, *memint);
+ }
+
+ /* Update _cs_glob_mem_ia_peak and _cs_glob_srt_ia_peak */
+
+ else if (*memint > _cs_glob_mem_ia_peak) {
+
+ _cs_glob_mem_ia_peak = *memint;
+ strncpy(_cs_glob_srt_ia_peak, caller, 6);
+ _cs_glob_srt_ia_peak[6] = '\0';
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Check that main floating-point working array memory reservation fits
+ * within the allocated size of RA.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE RASIZE (CALLER, MEMINT)
+ * *****************
+ *
+ * CHARACTER*6 CALLER : --> : Name of calling subroutine
+ * INTEGER MEMRDP : --> : Last required element in RA
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (rasize, RASIZE)
+(
+ const char caller[6],
+ cs_int_t *memrdp
+)
+{
+ /* Test if enough memory is available */
+
+ if (*memrdp > _cs_glob_mem_ra_size) {
+ char _caller[7];
+ strncpy(_caller, caller, 6);
+ _caller[6] = '\0';
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _(" Sub-routine calling RASIZE: %s\n"
+ " Memory needed in RA (number of reals): %d\n"
+ " available: %d\n\n"
+ " ----> Define RASIZE to a value at least equal to %d reals)."),
+ _caller, *memrdp, _cs_glob_mem_ra_size, *memrdp);
+ }
+
+ /* Update _cs_glob_mem_ra_peak and _cs_glob_srt_ra_peak */
+
+ else if (*memrdp > _cs_glob_mem_ra_peak) {
+
+ _cs_glob_mem_ra_peak = *memrdp;
+ strncpy(_cs_glob_srt_ra_peak, caller, 6);
+ _cs_glob_srt_ra_peak[6] = '\0';
+ }
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Complete MPI setup.
+ *
+ * MPI should have been initialized by cs_opts_mpi_init().
+ *
+ * Global variables `cs_glob_n_ranks' (number of Code_Saturne processes)
+ * and `cs_glob_rank_id' (rank of local process) are set by this function.
+ *
+ * parameters:
+ * app_num <-- -1 if MPI is not needed, or application number in
+ * MPI_COMM_WORLD of this instance of Code_Saturne.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mpi_init(int app_num)
+{
+ int nbr, rank;
+
+ int app_num_l = app_num, app_num_max = -1;
+
+#if defined(DEBUG) || !defined(NDEBUG)
+ MPI_Errhandler errhandler;
+#endif
+
+ /*
+ If necessary, split MPI_COMM_WORLD to separate different coupled
+ applications (collective operation, like all MPI communicator
+ creation operations).
+
+ We suppose the color argument to MPI_Comm_split is equal to the
+ application number, given through the command line or through
+ mpiexec and passed here as an argument.
+ */
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+ MPI_Allreduce(&app_num_l, &app_num_max, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
+
+ if (app_num_max > 0)
+ MPI_Comm_split(MPI_COMM_WORLD, app_num, rank, &cs_glob_mpi_comm);
+ else
+ cs_glob_mpi_comm = MPI_COMM_WORLD;
+
+ MPI_Comm_size(cs_glob_mpi_comm, &nbr);
+ MPI_Comm_rank(cs_glob_mpi_comm, &rank);
+
+ cs_glob_n_ranks = nbr;
+
+ if (cs_glob_n_ranks > 1)
+ cs_glob_rank_id = rank;
+
+ /* cs_glob_mpi_comm may not be freed at this stage, as it
+ it may be needed to build intercommunicators for couplings,
+ but we may set cs_glob_rank_id to its serial value if
+ we are only using MPI for coupling. */
+
+ if (cs_glob_n_ranks == 1 && app_num_max > 0)
+ cs_glob_rank_id = -1;
+
+ /* Initialize associated libraries */
+
+#if defined(FVM_HAVE_MPI)
+ if (cs_glob_rank_id > -1)
+ fvm_parall_set_mpi_comm(cs_glob_mpi_comm);
+ else
+ fvm_parall_set_mpi_comm(MPI_COMM_NULL);
+#endif
+
+#if defined(DEBUG) || !defined(NDEBUG)
+ if (nbr > 1 || cs_glob_mpi_comm != MPI_COMM_NULL) {
+ MPI_Errhandler_create(&_cs_base_erreur_mpi, &errhandler);
+ MPI_Errhandler_set(MPI_COMM_WORLD, errhandler);
+ if ( cs_glob_mpi_comm != MPI_COMM_WORLD
+ && cs_glob_mpi_comm != MPI_COMM_NULL)
+ MPI_Errhandler_set(cs_glob_mpi_comm, errhandler);
+ MPI_Errhandler_free(&errhandler);
+ }
+#endif
+
+#if defined(HAVE_MPE)
+ if (cs_glob_n_ranks > 1)
+ _cs_base_prof_mpe_init(rank);
+#endif
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Exit, with handling for both normal and error cases.
+ *
+ * Finalize MPI if necessary.
+ *
+ * parameters:
+ * status <-- value to be returned to the parent:
+ * EXIT_SUCCESS / 0 for the normal case,
+ * EXIT_FAILURE or other nonzero code for error cases.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_exit(int status)
+{
+ if (status == EXIT_FAILURE) {
+
+ bft_printf_flush();
+ bft_backtrace_print(2);
+
+ }
+
+ CS_PROCF(csclli, CSCLLI)(); /* Close log files */
+
+#if defined(HAVE_MPI)
+
+ {
+ int mpi_flag;
+
+ MPI_Initialized(&mpi_flag);
+
+ if (mpi_flag != 0) {
+
+ if (status != EXIT_FAILURE) {
+ _cs_base_mpi_fin();
+ }
+ }
+ }
+
+#endif /* HAVE_MPI */
+
+ _cs_base_exit(status);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize error and signal handlers.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_error_init(void)
+{
+ /* Error handler */
+
+ cs_glob_base_gest_erreur_save = bft_error_handler_get();
+ bft_error_handler_set(_cs_base_gestion_erreur);
+
+ /* Signal handlers */
+
+ bft_backtrace_print_set(_cs_base_backtrace_print);
+
+#if defined(SIGHUP)
+ if (cs_glob_rank_id <= 0)
+ cs_glob_base_sighup_save = signal(SIGHUP, _cs_base_sig_fatal);
+#endif
+
+ if (cs_glob_rank_id <= 0) {
+ cs_glob_base_sigint_save = signal(SIGINT, _cs_base_sig_fatal);
+ cs_glob_base_sigterm_save = signal(SIGTERM, _cs_base_sig_fatal);
+ }
+
+ cs_glob_base_sigfpe_save = signal(SIGFPE, _cs_base_sig_fatal);
+ cs_glob_base_sigsegv_save = signal(SIGSEGV, _cs_base_sig_fatal);
+
+#if defined(SIGXCPU)
+ if (cs_glob_rank_id <= 0)
+ cs_glob_base_sigcpu_save = signal(SIGXCPU, _cs_base_sig_fatal);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize management of memory allocated through BFT.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mem_init(void)
+{
+ char *nom_base;
+ char *nom_complet = NULL;
+
+ /* Set error handler */
+
+ bft_mem_error_handler_set(_cs_mem_error_handler);
+
+ /* Memory usage measure initialization */
+
+ bft_mem_usage_init();
+
+ /* Memory management initialization */
+
+ if ((nom_base = getenv("CS_FIC_MEM")) != NULL) {
+
+ /* We may not use BFT_MALLOC here as memory management has
+ not yet been initialized using bft_mem_init() */
+
+ nom_complet = malloc((strlen(nom_base) + 6) * sizeof (char));
+
+ if (nom_complet != NULL) {
+
+ /* In parallel, we will have one trace file per MPI process */
+ if (cs_glob_rank_id >= 0)
+ sprintf(nom_complet, "%s.%04d", nom_base, cs_glob_rank_id + 1);
+ else
+ strcpy(nom_complet, nom_base);
+
+ }
+
+ }
+
+ if (bft_mem_initialized())
+ cs_glob_base_bft_mem_init = false;
+
+ else {
+ cs_glob_base_bft_mem_init = true;
+ bft_mem_init(nom_complet);
+ }
+
+ if (nom_complet != NULL)
+ free (nom_complet);
+}
+
+/*----------------------------------------------------------------------------
+ * Allocate Fortran work arrays and prepare for their use.
+ *
+ * parameters:
+ * iasize <-- integer working array size (maximum number of values)
+ * rasize <-- floating-point working array size (maximum number of values)
+ * ia --> pointer to integer working array
+ * ra --> pointer to floating-point working array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mem_init_work(size_t iasize,
+ size_t rasize,
+ cs_int_t **ia,
+ cs_real_t **ra)
+{
+ /* Allocate work arrays */
+
+ BFT_MALLOC(*ia, iasize, cs_int_t);
+ BFT_MALLOC(*ra, rasize, cs_real_t);
+
+ _cs_glob_mem_ia_size = iasize;
+ _cs_glob_mem_ra_size = rasize;
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize management of memory allocated through BFT.
+ *
+ * A summary of the consumed memory is given.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_mem_fin(void)
+{
+ int ind_bil, itot;
+ double valreal[2];
+
+#if defined(HAVE_MPI)
+ int imax, imin;
+ double val_somme[2];
+ int ind_min[2];
+ _cs_base_mpi_double_int_t val_in[2], val_min[2], val_max[2];
+#endif
+
+ int ind_val[2] = {1, 1};
+ char unite[] = {'k', 'm', 'g', 't', 'p'};
+
+ const char * type_bil[] = {N_("Total memory used: "),
+ N_("Theoretical instrumented dynamic memory: ")};
+
+ /* Memory summary */
+
+ bft_printf(_("\nMemory use summary:\n\n"));
+
+ valreal[0] = (double)bft_mem_usage_max_pr_size();
+ valreal[1] = (double)bft_mem_size_max();
+
+ /* Ignore inconsistent measurements */
+
+ for (ind_bil = 0; ind_bil < 2; ind_bil++) {
+ if (valreal[ind_bil] < 1.0)
+ ind_val[ind_bil] = 0;
+ }
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+ MPI_Reduce(ind_val, ind_min, 2, MPI_INT, MPI_MIN,
+ 0, cs_glob_mpi_comm);
+ MPI_Reduce(valreal, val_somme, 2, MPI_DOUBLE, MPI_SUM,
+ 0, cs_glob_mpi_comm);
+ for (ind_bil = 0; ind_bil < 2; ind_bil++) {
+ val_in[ind_bil].val = valreal[ind_bil];
+ val_in[ind_bil].rank = cs_glob_rank_id;
+ }
+ MPI_Reduce(&val_in, &val_min, 2, MPI_DOUBLE_INT, MPI_MINLOC,
+ 0, cs_glob_mpi_comm);
+ MPI_Reduce(&val_in, &val_max, 2, MPI_DOUBLE_INT, MPI_MAXLOC,
+ 0, cs_glob_mpi_comm);
+ if (cs_glob_rank_id == 0) {
+ for (ind_bil = 0; ind_bil < 2; ind_bil++) {
+ ind_val[ind_bil] = ind_min[ind_bil];
+ valreal[ind_bil] = val_somme[ind_bil];
+ }
+ }
+ }
+#endif
+
+ /* Similar handling of several instrumentation methods */
+
+ for (ind_bil = 0 ; ind_bil < 2 ; ind_bil++) {
+
+ /* If an instrumentation method returns an apparently consistent
+ result, print it. */
+
+ if (ind_val[ind_bil] == 1) {
+
+ for (itot = 0 ;
+ valreal[ind_bil] > 1024. && unite[itot] != 'p' ;
+ itot++)
+ valreal[ind_bil] /= 1024.;
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1 && cs_glob_rank_id == 0) {
+ for (imin = 0 ;
+ val_min[ind_bil].val > 1024. && unite[imin] != 'p' ;
+ imin++)
+ val_min[ind_bil].val /= 1024.;
+ for (imax = 0 ;
+ val_max[ind_bil].val > 1024. && unite[imax] != 'p' ;
+ imax++)
+ val_max[ind_bil].val /= 1024.;
+ }
+#endif
+
+ /* Print to log file */
+
+ bft_printf (_(" %s %12.3f %cb\n"),
+ _(type_bil[ind_bil]), valreal[ind_bil], unite[itot]);
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1 && cs_glob_rank_id == 0) {
+ bft_printf (_(" "
+ "local minimum: %12.3f %cb (rank %d)\n"),
+ val_min[ind_bil].val, unite[imin], val_min[ind_bil].rank);
+ bft_printf (_(" "
+ "local maximum: %12.3f %cb (rank %d)\n"),
+ val_max[ind_bil].val, unite[imax], val_max[ind_bil].rank);
+ }
+#endif
+ }
+
+ }
+
+ /* Information on Fortran working arrays */
+
+ if (cs_glob_n_ranks > 1) {
+ _cs_base_work_mem_max(&_cs_glob_mem_ia_peak, _cs_glob_srt_ia_peak);
+ _cs_base_work_mem_max(&_cs_glob_mem_ra_peak, _cs_glob_srt_ra_peak);
+ }
+
+ if (_cs_glob_mem_ia_size > 0 || _cs_glob_mem_ra_size > 0) {
+
+ size_t wk_unit[2] = {0, 0};
+ double wk_size[2] = {0., 0.};
+
+ wk_size[0] = ( sizeof(cs_int_t)*_cs_glob_mem_ia_size
+ + sizeof(cs_real_t)*_cs_glob_mem_ra_size) / 1000;
+ wk_size[1] = ( sizeof(cs_int_t)*_cs_glob_mem_ia_peak
+ + sizeof(cs_real_t)*_cs_glob_mem_ra_peak) / 1000;
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+ double _wk_size_loc = wk_size[0];
+ MPI_Allreduce(&_wk_size_loc, &(wk_size[0]), 1, MPI_DOUBLE, MPI_MAX,
+ cs_glob_mpi_comm);
+ }
+#endif
+
+ for (ind_bil = 0; ind_bil < 2; ind_bil++) {
+ for (itot = 0; wk_size[ind_bil] > 1024. && unite[itot] != 'p'; itot++)
+ wk_size[ind_bil] /= 1024.;
+ wk_unit[ind_bil] = itot;
+ }
+
+ bft_printf(_("\n"
+ " Fortran work arrays memory use:\n"
+ " %-12lu integers needed (maximum reached in %s)\n"
+ " %-12lu reals needed (maximum reached in %s)\n\n"
+ " Local maximum work memory requested %12.3f %cb\n"
+ " used %12.3f %cb\n"),
+ (unsigned long)_cs_glob_mem_ia_peak, _cs_glob_srt_ia_peak,
+ (unsigned long)_cs_glob_mem_ra_peak, _cs_glob_srt_ra_peak,
+ wk_size[0], unite[wk_unit[0]],
+ wk_size[1], unite[wk_unit[1]]);
+
+ }
+
+ /* Finalize memory handling */
+
+ if (cs_glob_base_bft_mem_init == true)
+ bft_mem_end();
+
+ /* Finalize memory usage count */
+
+ bft_mem_usage_end();
+}
+
+/*----------------------------------------------------------------------------
+ * Print summary of running time, including CPU and elapsed times.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_bilan_temps(void)
+{
+ double utime;
+ double stime;
+ double time_cpu;
+ double time_tot;
+
+ /*xxxxxxxxxxxxxxxxxxxxxxxxxxx Instructions xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
+
+ bft_printf(_("\nCalculation time summary:\n"));
+
+ bft_timer_cpu_times(&utime, &stime);
+
+ if (utime > 0. || stime > 0.)
+ time_cpu = utime + stime;
+
+ else
+ time_cpu = bft_timer_cpu_time();
+
+
+ /* CPU time */
+
+ if (utime > 0. || stime > 0.) {
+ bft_printf (_("\n User CPU time: %12.3f s\n"),
+ (float)utime);
+ bft_printf (_(" System CPU time: %12.3f s\n"),
+ (float)stime);
+ }
+
+ else if (time_cpu > 0.)
+ bft_printf (_("\n CPU time: %12.3f s\n"),
+ (float)time_cpu);
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+ double time_cumul;
+ MPI_Reduce (&time_cpu, &time_cumul, 1, MPI_DOUBLE, MPI_SUM,
+ 0, cs_glob_mpi_comm);
+ if (cs_glob_rank_id == 0)
+ bft_printf (_(" Total CPU time: %12.3f s\n"),
+ time_cumul);
+ }
+#endif
+
+ /* Elapsed (wall-clock) time */
+
+ time_tot = bft_timer_wtime();
+
+ if (time_tot > 0.) {
+
+ bft_printf (_("\n Elapsed time: %12.3f s\n"),
+ time_tot);
+
+ bft_printf (_(" CPU / elapsed time %12.3f\n"),
+ (float)(time_cpu/time_tot));
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Print available system information.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_system_info(void)
+{
+ time_t date;
+ size_t ram;
+
+#if defined(HAVE_UNAME)
+ struct utsname sys_config;
+#endif
+
+#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
+ struct passwd *pwd_user = NULL;
+#endif
+
+#if !defined(PATH_MAX)
+#define PATH_MAX 1024
+#endif
+
+ char str_date[81];
+ char str_directory[PATH_MAX] = "";
+ char *str_user = NULL;
+
+ /* Date */
+
+ if ( time(&date) == -1
+ || strftime(str_date, 80, "%c", localtime(&date)) == 0)
+ strcpy(str_date, "");
+
+ /* Available memory */
+
+ ram = bft_sys_info_mem_ram();
+
+ /* User */
+
+#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
+
+ /* Functions not available on IBM Blue Gene or Cray XT,
+ but a stub may exist, so we make sure we ignore it */
+#if defined(__blrts__) || defined(__bgp__) \
+ || defined(__CRAYXT_COMPUTE_LINUX_TARGET)
+ pwd_user = NULL;
+#else
+ pwd_user = getpwuid(geteuid());
+#endif
+
+ if (pwd_user != NULL) {
+
+ size_t l_user = strlen(pwd_user->pw_name);
+ size_t l_info = 0;
+
+ if (pwd_user->pw_gecos != NULL) {
+ for (l_info = 0;
+ ( pwd_user->pw_gecos[l_info] != '\0'
+ && pwd_user->pw_gecos[l_info] != ',');
+ l_info++);
+ }
+
+ BFT_MALLOC(str_user, l_info + l_user + 3 + 1, char);
+ strcpy(str_user, pwd_user->pw_name);
+
+ if (pwd_user->pw_gecos != NULL) {
+ strcat(str_user, " (");
+ strncpy(str_user + l_user + 2, pwd_user->pw_gecos, l_info);
+ str_user[l_user + 2 + l_info] = ')';
+ str_user[l_user + 2 + l_info + 1] = '\0';
+ }
+
+ }
+
+#endif /* defined(HAVE_GETPWUID) && defined(HAVE_GETEUID) */
+
+ /* Working directory */
+
+#if defined(HAVE_GETCWD)
+ if (getcwd(str_directory, 1024) == NULL)
+ strcpy(str_directory, "");
+#endif
+
+ /* Print local configuration */
+ /*---------------------------*/
+
+ bft_printf("\n%s\n", _("Local case configuration:\n"));
+
+ bft_printf(" %s%s\n", _("Date: "), str_date);
+
+
+ /* System and machine */
+
+#if defined(HAVE_UNAME)
+
+ if (uname(&sys_config) != -1) {
+ bft_printf(" %s%s %s\n", _("System: "),
+ sys_config.sysname, sys_config.release);
+ bft_printf(" %s%s\n", _("Machine: "), sys_config.nodename);
+ }
+#endif
+
+ bft_printf(" %s%s\n", _("Processor: "), bft_sys_info_cpu());
+
+ if (ram > 0)
+ bft_printf(" %s%lu\n", _("Memory: "), (unsigned long)ram);
+
+ if (str_user != NULL) {
+ bft_printf(" %s%s\n", _("User: "), str_user);
+ BFT_FREE(str_user);
+ }
+
+ bft_printf(" %s%s\n", _("Directory: "), str_directory);
+
+#if defined(HAVE_MPI)
+ bft_printf(" %s%d\n", _("MPI ranks: "), cs_glob_n_ranks);
+#endif
+#if defined(HAVE_OPENMP)
+ bft_printf(" %s%d\n", _("OpenMP threads: "), cs_glob_n_threads);
+#endif
+
+ bft_printf("\n");
+}
+
+/*----------------------------------------------------------------------------
+ * Replace default bft_printf() mechanism with internal mechanism.
+ *
+ * This is necessary for good consistency of messages output from C or
+ * from Fortran, and to handle parallel and serial logging options.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_bft_printf_set(void)
+{
+ bft_printf_proxy_set(_cs_base_bft_printf);
+ bft_printf_flush_proxy_set(_cs_base_bft_printf_flush);
+}
+
+/*----------------------------------------------------------------------------
+ * Print a warning message header.
+ *
+ * parameters:
+ * file_name <-- name of source file
+ * line_nume <-- line number in source file
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_warn(const char *file_name,
+ int line_num)
+{
+ bft_printf(_("\n\nCode_Saturne: %s:%d: Warning\n"),
+ file_name, line_num);
+}
+
+/*----------------------------------------------------------------------------
+ * Convert a character string from the Fortran API to the C API.
+ *
+ * Eventual leading and trailing blanks are removed.
+ *
+ * parameters:
+ * f_str <-- Fortran string
+ * f_len <-- Fortran string length
+ *
+ * returns:
+ * pointer to C string
+ *----------------------------------------------------------------------------*/
+
+char *
+cs_base_string_f_to_c_create(const char *f_str,
+ int f_len)
+{
+ char * c_str = NULL;
+ int i, i1, i2, l;
+
+ /* Initialization if necessary */
+
+ if (cs_glob_base_str_init == false) {
+ for (i = 0 ; i < CS_BASE_N_STRINGS ; i++)
+ cs_glob_base_str_is_free[i] = true;
+ cs_glob_base_str_init = true;
+ }
+
+ /* Handle name for C API */
+
+ for (i1 = 0 ;
+ i1 < f_len && (f_str[i1] == ' ' || f_str[i1] == '\t') ;
+ i1++);
+
+ for (i2 = f_len - 1 ;
+ i2 > i1 && (f_str[i2] == ' ' || f_str[i2] == '\t') ;
+ i2--);
+
+ l = i2 - i1 + 1;
+
+ /* Allocation if necessary */
+
+ if (l < CS_BASE_STRING_LEN) {
+ for (i = 0 ; i < CS_BASE_N_STRINGS ; i++) {
+ if (cs_glob_base_str_is_free[i] == true) {
+ c_str = cs_glob_base_str[i];
+ cs_glob_base_str_is_free[i] = false;
+ break;
+ }
+ }
+ }
+
+ if (c_str == NULL)
+ BFT_MALLOC(c_str, l + 1, char);
+
+ for (i = 0 ; i < l ; i++, i1++)
+ c_str[i] = f_str[i1];
+
+ c_str[l] = '\0';
+
+ return c_str;
+}
+
+/*----------------------------------------------------------------------------
+ * Free a string converted from the Fortran API to the C API.
+ *
+ * parameters:
+ * str <-> pointer to C string
+ *----------------------------------------------------------------------------*/
+
+void
+cs_base_string_f_to_c_free(char **c_str)
+{
+ cs_int_t ind;
+
+ for (ind = 0 ; ind < CS_BASE_N_STRINGS ; ind++) {
+ if (*c_str == cs_glob_base_str[ind]) {
+ cs_glob_base_str_is_free[ind] = true;
+ *c_str = NULL;
+ break;
+ }
+ }
+
+ if (ind == CS_BASE_N_STRINGS && *c_str != NULL)
+ BFT_FREE(*c_str);
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_benchmark.c b/src/base/cs_benchmark.c
new file mode 100644
index 0000000..e60bfdd
--- /dev/null
+++ b/src/base/cs_benchmark.c
@@ -0,0 +1,1649 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Low-level operator benchmarking
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(__STDC_VERSION__) /* size_t */
+#if (__STDC_VERSION__ == 199901L)
+# include <stddef.h>
+# else
+# include <stdlib.h>
+# endif
+#else
+#include <stdlib.h>
+#endif
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_blas.h"
+#include "cs_halo.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_matrix.h"
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_benchmark.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Start timer.
+ *
+ * parameters:
+ * wt --> wall-clock time (start in, stop - start out)
+ * cpu --> CPU time (start in, stop - start out)
+ *----------------------------------------------------------------------------*/
+
+static void
+_timer_start(double *wt,
+ double *cpu)
+{
+ *wt = bft_timer_wtime();
+ *cpu = bft_timer_cpu_time();
+}
+
+/*----------------------------------------------------------------------------
+ * Stop timer.
+ *
+ * parameters:
+ * n_runs <-- Number of timing runs
+ * wt <-> wall-clock time (start in, stop - start out)
+ * cpu <-> CPU time (start in, stop - start out)
+ *----------------------------------------------------------------------------*/
+
+static void
+_timer_stop(int n_runs,
+ double *wt,
+ double *cpu)
+{
+ double wt_s, cpu_s;
+
+ wt_s = bft_timer_wtime();
+ cpu_s = bft_timer_cpu_time();
+
+ *wt = (wt_s - *wt) / (double)n_runs;
+ *cpu = (cpu_s - *cpu) / (double)n_runs;
+ }
+
+/*----------------------------------------------------------------------------
+ * Print overhead.
+ *
+ * parameters:
+ * wt <-- wall-clock time
+ * cpu <-- CPU time
+ *----------------------------------------------------------------------------*/
+
+static void
+_print_overhead(double wt,
+ double cpu)
+{
+ if (cs_glob_n_ranks == 1)
+ bft_printf(_(" Wall clock : %12.5e\n"
+ " CPU : %12.5e\n"),
+ wt);
+
+ else {
+
+ double loc_count[2], glob_min[2], glob_max[2], cpu_tot;
+
+ loc_count[0] = wt;
+ loc_count[1] = cpu;
+
+#if defined(HAVE_MPI)
+ MPI_Allreduce(loc_count, glob_min, 2, MPI_DOUBLE, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(loc_count, glob_max, 2, MPI_DOUBLE, MPI_MAX,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(&cpu, &cpu_tot, 1, MPI_DOUBLE, MPI_SUM,
+ cs_glob_mpi_comm);
+#else
+ { /* We should never enter here unless we have an alternative to MPI */
+ int i;
+ for (i = 0; i < 3; i++) {
+ glob_min[i] = loc_count[i];
+ glob_max[i] = loc_count[i];
+ }
+ cpu_tot = cpu;
+ }
+#endif
+
+ bft_printf(_(" Min Max Total\n"
+ " Wall clock : %12.5e %12.5e\n"
+ " CPU : %12.5e %12.5e %12.5e\n"),
+ glob_min[0], glob_max[0],
+ glob_min[1], glob_max[1], cpu_tot);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Count number of operations.
+ *
+ * parameters:
+ * n_ops <-- Local number of operations
+ * n_ops_single <-- Single-processor equivalent number of operations
+ * (without ghosts); ignored if 0
+ * wt <-- wall-clock time
+ * cpu <-- CPU time
+ *----------------------------------------------------------------------------*/
+
+static void
+_print_stats(long n_ops,
+ long n_ops_single,
+ double wt,
+ double cpu)
+{
+ double fm = 1.0 / (1.e9 * wt);
+
+ if (cs_glob_n_ranks == 1)
+ bft_printf(_(" N ops : %12ld\n"
+ " Wall clock : %12.5e\n"
+ " CPU : %12.5e\n"
+ " GFLOPS : %12.5e\n"),
+ n_ops, wt, cpu, n_ops*fm);
+
+ else {
+
+ long n_ops_min, n_ops_max, n_ops_tot;
+ double loc_count[3], glob_min[3], glob_max[3], cpu_tot, fmg;
+
+ loc_count[0] = wt;
+ loc_count[1] = cpu;
+ loc_count[2] = n_ops*fm;
+
+#if defined(HAVE_MPI)
+
+ MPI_Allreduce(&n_ops, &n_ops_min, 1, MPI_LONG, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(&n_ops, &n_ops_max, 1, MPI_LONG, MPI_MAX,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(&n_ops, &n_ops_tot, 1, MPI_LONG, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ MPI_Allreduce(loc_count, glob_min, 3, MPI_DOUBLE, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(loc_count, glob_max, 3, MPI_DOUBLE, MPI_MAX,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(&cpu, &cpu_tot, 1, MPI_DOUBLE, MPI_SUM,
+ cs_glob_mpi_comm);
+
+#else
+ { /* We should never enter here unless we have an alternative to MPI */
+ int i;
+ n_ops_min = n_ops; n_ops_max = n_ops; n_ops_tot = n_ops;
+ for (i = 0; i < 3; i++) {
+ glob_min[i] = loc_count[i];
+ glob_max[i] = loc_count[i];
+ }
+ cpu_tot = cpu;
+ }
+#endif
+
+ fmg = 1.0 / (1.e9 * glob_max[0]); /* global flops multiplier */
+
+ if (n_ops_single == 0)
+ bft_printf
+ (_(" Min Max Total\n"
+ " N ops : %12ld %12ld %12ld\n"
+ " Wall clock : %12.5e %12.5e\n"
+ " CPU : %12.5e %12.5e %12.5e\n"
+ " GFLOPS : %12.5e %12.5e %12.5e\n"),
+ n_ops_min, n_ops_max, n_ops_tot,
+ glob_min[0], glob_max[0],
+ glob_min[1], glob_max[1], cpu_tot,
+ glob_min[2], glob_max[2], n_ops_tot*fmg);
+
+ else
+ bft_printf
+ (_(" Min Max Total Single\n"
+ " N ops : %12ld %12ld %12ld %12ld\n"
+ " Wall clock : %12.5e %12.5e\n"
+ " CPU : %12.5e %12.5e %12.5e\n"
+ " GFLOPS : %12.5e %12.5e %12.5e %12.5e\n"),
+ n_ops_min, n_ops_max, n_ops_tot, n_ops_single,
+ glob_min[0], glob_max[0],
+ glob_min[1], glob_max[1], cpu_tot,
+ glob_min[2], glob_max[2], n_ops_tot*fmg, n_ops_single*fmg);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Simple dot product.
+ *
+ * parameters:
+ * global <-- 0 for local use, 1 for MPI sum
+ * n_runs <-- number of operation runs
+ * n_cells <-- number of cells (array size)
+ * x <-- Vector
+ * y <-- Vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_dot_product_1(int global,
+ int n_runs,
+ size_t n_cells,
+ const cs_real_t *x,
+ const cs_real_t *y)
+{
+ double wt, cpu;
+ int run_id;
+ long n_ops;
+ size_t ii;
+
+ double test_sum_mult = 1.0/n_runs;
+ double test_sum = 0.0;
+ int _global = global;
+
+ char type_name[] = "X.Y";
+
+ if (n_runs < 1)
+ return;
+
+ if (x == y)
+ type_name[2] = 'X';
+
+ if (cs_glob_n_ranks == 1)
+ _global = 0;
+
+ n_ops = n_cells;
+
+ /* First simple local x.x version */
+
+ _timer_start(&wt, &cpu);
+
+#if defined(HAVE_BLAS)
+
+ test_sum = 0.0;
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ double s1 = cblas_ddot(n_cells, x, 1, y, 1);
+#if defined(HAVE_MPI)
+ if (_global) {
+ double s1_glob = 0.0;
+ MPI_Allreduce(&s1, &s1_glob, 1, MPI_DOUBLE, MPI_SUM,
+ cs_glob_mpi_comm);
+ s1 = s1_glob;
+ }
+#endif
+ test_sum += test_sum_mult*s1;
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ if (_global == 0)
+ bft_printf(_("\n"
+ "Simple local dot product %s with BLAS\n"
+ "-------------------------------------\n"),
+ type_name);
+ else
+ bft_printf(_("\n"
+ "Simple global dot product %s with BLAS\n"
+ "---------------------------------------\n"),
+ type_name);
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+#endif /* defined(HAVE_BLAS) */
+
+ test_sum = 0.0;
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ double s1 = 0.0;
+ for (ii = 0; ii < n_cells; ii++)
+ s1 += x[ii] * y[ii];
+#if defined(HAVE_MPI)
+ if (_global) {
+ double s1_glob = 0.0;
+ MPI_Allreduce(&s1, &s1_glob, 1, MPI_DOUBLE, MPI_SUM,
+ cs_glob_mpi_comm);
+ s1 = s1_glob;
+ }
+#endif
+ test_sum += test_sum_mult*s1;
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ if (_global == 0)
+ bft_printf(_("\n"
+ "Simple local dot product %s\n"
+ "---------------------------\n"),
+ type_name);
+ else
+ bft_printf(_("\n"
+ "Simple global dot product %s\n"
+ "----------------------------\n"),
+ type_name);
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+ }
+
+/*----------------------------------------------------------------------------
+ * Double local dot product.
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * n_cells <-- number of cells (array size)
+ * x <-- Vector
+ * y <-- Vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_dot_product_2(int n_runs,
+ size_t n_cells,
+ const cs_real_t *x,
+ const cs_real_t *y)
+{
+ double wt, cpu;
+ int run_id;
+ long n_ops;
+ size_t ii;
+
+ double test_sum_mult = 1.0/n_runs;
+ double test_sum = 0.0;
+
+ if (n_runs < 1)
+ return;
+
+ n_ops = n_cells * 2;
+
+ /* First simple local x.x version */
+
+ _timer_start(&wt, &cpu);
+
+#if defined(HAVE_BLAS)
+
+ test_sum = 0.0;
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ double s1 = cblas_ddot(n_cells, x, 1, x, 1);
+ double s2 = cblas_ddot(n_cells, x, 1, y, 1);
+ test_sum += test_sum_mult*(s1+s2);
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Double local dot product X.X, Y.Y with BLAS\n"
+ "-------------------------------------------\n"));
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+#endif /* defined(HAVE_BLAS) */
+
+ test_sum = 0.0;
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ double s1 = 0.0;
+ double s2 = 0.0;
+ for (ii = 0; ii < n_cells; ii++) {
+ s1 += x[ii] * x[ii];
+ s2 += x[ii] * y[ii];
+ }
+ test_sum += test_sum_mult*(s1+s2);
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Double local dot product X.X, Y.Y\n"
+ "---------------------------------\n"));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+ }
+
+/*----------------------------------------------------------------------------
+ * y -> ax + y test
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * n_cells <-- number of cells (array size)
+ * x <-- Vector
+ * y <-> Vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_axpy_(int n_runs,
+ size_t n_cells,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ double wt, cpu;
+ int run_id;
+ long n_ops;
+ size_t ii;
+
+ double test_sum_mult = 1.0/n_runs;
+ double test_sum = 0.0;
+
+ if (n_runs < 1)
+ return;
+
+ n_ops = n_cells * 2;
+
+ /* First simple local x.x version */
+
+ for (ii = 0; ii < n_cells; ii++)
+ y[ii] = 0.0;
+
+ _timer_start(&wt, &cpu);
+
+#if defined(HAVE_BLAS)
+
+ test_sum = 0.0;
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+
+ cblas_daxpy(n_cells, test_sum_mult, x, 1, y, 1);
+
+ test_sum += test_sum_mult*y[run_id%n_cells];
+
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Y <- aX + Y with BLAS\n"
+ "---------------------\n"));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+#endif /* defined(HAVE_BLAS) */
+
+ test_sum = 0.0;
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+
+ for (ii = 0; ii < n_cells; ii++)
+ y[ii] += test_sum_mult * x[ii];
+
+ test_sum += test_sum_mult*y[run_id%n_cells];
+
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Y <- aX + Y\n"
+ "-----------\n"));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Simple divisions on a vector.
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * n_cells <-- number of cells (array size)
+ *----------------------------------------------------------------------------*/
+
+static void
+_division_test(int n_runs,
+ size_t n_cells)
+{
+ double wt, cpu;
+ int run_id;
+ long n_ops;
+ size_t ii;
+
+ cs_real_t *x = NULL, *y = NULL, *z = NULL;
+
+ if (n_runs < 1)
+ return;
+
+ BFT_MALLOC(x, n_cells, cs_real_t);
+ BFT_MALLOC(y, n_cells, cs_real_t);
+ BFT_MALLOC(z, n_cells, cs_real_t);
+
+ n_ops = n_cells;
+
+ /* Division */
+ /*----------*/
+
+ for (ii = 0; ii < n_cells; ii++) {
+ x[ii] = 2.0 + ii%3;
+ y[ii] = 2.0 + (ii+1)%3;
+ }
+
+ /* Division of two vectors */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+
+ for (ii = 0; ii < n_cells; ii++)
+ z[ii] = x[ii] / y[ii];
+
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Division z = x/y\n"
+ "----------------\n"));
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+ BFT_FREE(z);
+
+ /* Copy inverse of a vector */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+
+ for (ii = 0; ii < n_cells; ii++)
+ y[ii] = 1.0 / x[ii];
+
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Division y = 1/x\n"
+ "----------------\n"));
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+ BFT_FREE(y);
+
+ /* Inverse of a vector */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+
+ for (ii = 0; ii < n_cells; ii++)
+ x[ii] = 1.0 / x[ii];
+
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Division x <- 1/x\n"
+ "-----------------\n"));
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+ BFT_FREE(x);
+
+ }
+
+/*----------------------------------------------------------------------------
+ * Simple square root on a vector.
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * n_cells <-- number of cells (array size)
+ *----------------------------------------------------------------------------*/
+
+static void
+_sqrt_test(int n_runs,
+ size_t n_cells)
+{
+ double wt, cpu;
+ int run_id;
+ long n_ops;
+ size_t ii;
+
+ cs_real_t *x = NULL, *y = NULL;
+
+ if (n_runs < 1)
+ return;
+
+ BFT_MALLOC(x, n_cells, cs_real_t);
+ BFT_MALLOC(y, n_cells, cs_real_t);
+
+ n_ops = n_cells;
+
+ for (ii = 0; ii < n_cells; ii++)
+ x[ii] = 2.0 + ii%3;
+
+ /* Copy square root of a vector */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+
+ for (ii = 0; ii < n_cells; ii++)
+ y[ii] = sqrt(x[ii]);
+
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "y = sqrt(x)\n"
+ "-----------\n"));
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+ BFT_FREE(y);
+
+ /* In place square root of a vector */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+
+ for (ii = 0; ii < n_cells; ii++)
+ x[ii] = sqrt(x[ii]);
+
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "x = sqrt(x)\n"
+ "-----------\n"));
+
+ _print_stats(n_ops, 0, wt, cpu);
+
+ BFT_FREE(x);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Measure matrix creation + destruction related performance.
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * type_name <-- type name
+ * type <-- matrix type
+ * symmetric <-- symmetric structure (if available)
+ * n_cells <-- number of local cells
+ * n_cells_ext <-- number of cells including ghost cells (array size)
+ * n_faces <-- local number of internal faces
+ * cell_num <-- global cell numbers (1 to n)
+ * face_cell <-- face -> cells connectivity (1 to n)
+ * halo <-- cell halo structure
+ * numbering <-- vectorization or thread-related numbering info, or NULL
+ *----------------------------------------------------------------------------*/
+
+static void
+_matrix_creation_test(int n_runs,
+ const char *type_name,
+ cs_matrix_type_t type,
+ cs_bool_t symmetric,
+ cs_int_t n_cells,
+ cs_int_t n_cells_ext,
+ cs_int_t n_faces,
+ const fvm_gnum_t *cell_num,
+ const cs_int_t *face_cell,
+ const cs_halo_t *halo,
+ const cs_numbering_t *numbering)
+{
+ double wt, cpu;
+ int run_id;
+
+ cs_matrix_t *m = NULL;
+
+ if (n_runs < 1)
+ return;
+
+ /* First count creation/destruction overhead */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ m = cs_matrix_create(type,
+ symmetric,
+ true,
+ false,
+ n_cells,
+ n_cells_ext,
+ n_faces,
+ cell_num,
+ face_cell,
+ halo,
+ numbering);
+ cs_matrix_destroy(&m);
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Matrix construction / destruction (%s)\n"
+ "---------------------------------\n"), _(type_name));
+
+ bft_printf(_(" (calls: %d)\n"), n_runs);
+
+ _print_overhead(wt, cpu);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Measure matrix assignment performance.
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * type_name <-- type name
+ * type <-- matrix type
+ * sym_struct <-- symmetric structure (if available)
+ * sym_coeffs <-- symmetric coefficients
+ * n_cells <-- number of local cells
+ * n_cells_ext <-- number of cells including ghost cells (array size)
+ * n_faces <-- local number of internal faces
+ * cell_num <-- global cell numbers (1 to n)
+ * face_cell <-- face -> cells connectivity (1 to n)
+ * halo <-- cell halo structure
+ * numbering <-- vectorization or thread-related numbering info, or NULL
+ * da <-- diagonal values
+ * xa <-- extradiagonal values
+ *----------------------------------------------------------------------------*/
+
+static void
+_matrix_assignment_test(int n_runs,
+ const char *type_name,
+ cs_matrix_type_t type,
+ cs_bool_t sym_struct,
+ cs_bool_t sym_coeffs,
+ cs_int_t n_cells,
+ cs_int_t n_cells_ext,
+ cs_int_t n_faces,
+ const fvm_gnum_t *cell_num,
+ const cs_int_t *face_cell,
+ const cs_halo_t *halo,
+ const cs_numbering_t *numbering,
+ const cs_real_t *restrict da,
+ const cs_real_t *restrict xa)
+{
+ double wt, cpu;
+ int run_id;
+
+ cs_matrix_t *m = NULL;
+
+ if (n_runs < 1)
+ return;
+
+ /* Count assignment overhead */
+
+ m = cs_matrix_create(type,
+ sym_struct,
+ true,
+ false,
+ n_cells,
+ n_cells_ext,
+ n_faces,
+ cell_num,
+ face_cell,
+ halo,
+ numbering);
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ cs_matrix_set_coefficients(m,
+ sym_coeffs,
+ da,
+ xa);
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ cs_matrix_destroy(&m);
+
+ bft_printf(_("\n"
+ "Matrix value assignment (%s)\n"
+ "-----------------------\n"), _(type_name));
+
+ bft_printf(_(" (calls: %d)\n"), n_runs);
+
+ _print_overhead(wt, cpu);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Measure matrix.vector product related performance.
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * type_name <-- type name
+ * type <-- matrix type
+ * sym_struct <-- symmetric structure (if available)
+ * sym_coeffs <-- symmetric coefficients
+ * n_cells <-- number of local cells
+ * n_cells_ext <-- number of cells including ghost cells (array size)
+ * n_faces <-- local number of internal faces
+ * cell_num <-- global cell numbers (1 to n)
+ * face_cell <-- face -> cells connectivity (1 to n)
+ * halo <-- cell halo structure
+ * numbering <-- vectorization or thread-related numbering info, or NULL
+ * da <-- diagonal values
+ * xa <-- extradiagonal values
+ * x <-> vector
+ * y --> vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_matrix_vector_test(int n_runs,
+ const char *type_name,
+ cs_matrix_type_t type,
+ cs_bool_t sym_struct,
+ cs_bool_t sym_coeffs,
+ cs_int_t n_cells,
+ cs_int_t n_cells_ext,
+ cs_int_t n_faces,
+ const fvm_gnum_t *cell_num,
+ const cs_int_t *face_cell,
+ const cs_halo_t *halo,
+ const cs_numbering_t *numbering,
+ const cs_real_t *restrict da,
+ const cs_real_t *restrict xa,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii;
+ double wt, cpu;
+ int run_id;
+ long n_ops, n_ops_glob;
+
+ double test_sum = 0.0;
+ cs_matrix_t *m = NULL;
+
+ if (n_runs < 1)
+ return;
+
+ n_ops = n_cells + n_faces*2;
+
+ if (cs_glob_n_ranks == 1)
+ n_ops_glob = n_ops;
+ else
+ n_ops_glob = ( cs_glob_mesh->n_g_cells
+ + cs_glob_mesh->n_g_i_faces*2);
+
+ m = cs_matrix_create(type,
+ sym_struct,
+ true,
+ false,
+ n_cells,
+ n_cells_ext,
+ n_faces,
+ cell_num,
+ face_cell,
+ halo,
+ numbering);
+
+ cs_matrix_set_coefficients(m,
+ sym_coeffs,
+ da,
+ xa);
+
+ /* Matrix.vector product */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ cs_matrix_vector_multiply(CS_PERIO_ROTA_COPY,
+ m,
+ x,
+ y);
+ test_sum += y[n_cells-1];
+#if 0
+ for (int jj = 0; jj < n_cells; jj++)
+ bft_printf("y[%d] = %12.4f\n", jj, y[jj]);
+#endif
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Matrix.vector product (%s)\n"
+ "---------------------\n"), _(type_name));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+ /* Local timing in parallel mode */
+
+ if (cs_glob_n_ranks > 1) {
+
+ test_sum = 0.0;
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ cs_matrix_vector_multiply_nosync(m,
+ x,
+ y);
+ test_sum += y[n_cells-1];
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Local matrix.vector product (%s)\n"
+ "---------------------------\n"), _(type_name));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+ }
+
+ /* Combined matrix.vector product: alpha.A.x + beta.y */
+
+ test_sum = 0.0;
+ for (ii = 0; ii < n_cells_ext; y[ii++] = 0.0);
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ cs_matrix_alpha_a_x_p_beta_y(CS_PERIO_ROTA_COPY,
+ 0.5,
+ 0.0,
+ m,
+ x,
+ y);
+ test_sum += y[n_cells-1];
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Matrix.vector product alpha.A.x + beta.y (%s)\n"
+ "----------------------------------------\n"), _(type_name));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+ /* (Matrix - diagonal).vector product (with diagonal structure) */
+
+ cs_matrix_set_coefficients(m,
+ sym_coeffs,
+ NULL,
+ xa);
+
+ test_sum = 0.0;
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ cs_matrix_vector_multiply(CS_PERIO_ROTA_COPY,
+ m,
+ x,
+ y);
+ test_sum += y[n_cells-1];
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "(Matrix-diagonal).vector product (%s)\n"
+ "--------------------------------\n"), _(type_name));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+ /* (Matrix - diagonal).vector product */
+
+ cs_matrix_destroy(&m);
+
+ n_ops = n_faces*2;
+
+ if (cs_glob_n_ranks == 1)
+ n_ops_glob = n_ops;
+ else
+ n_ops_glob = ( cs_glob_mesh->n_g_cells
+ + cs_glob_mesh->n_g_i_faces*2);
+
+ m = cs_matrix_create(type,
+ sym_struct,
+ false,
+ false,
+ n_cells,
+ n_cells_ext,
+ n_faces,
+ cell_num,
+ face_cell,
+ halo,
+ numbering);
+
+ cs_matrix_set_coefficients(m,
+ sym_coeffs,
+ NULL,
+ xa);
+
+ test_sum = 0.0;
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ cs_matrix_vector_multiply(CS_PERIO_ROTA_COPY,
+ m,
+ x,
+ y);
+ test_sum += y[n_cells-1];
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "(Matrix without diagonal).vector product (%s)\n"
+ "----------------------------------------\n"), _(type_name));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+ cs_matrix_destroy(&m);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Measure matrix.vector product extradiagonal terms related performance
+ * (symmetric matrix case).
+ *
+ * parameters:
+ * n_faces <-- local number of internal faces
+ * face_cell <-- face -> cells connectivity (1 to n)
+ * xa <-- extradiagonal values
+ * x <-- vector
+ * y <-> vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_exdiag_native(cs_int_t n_faces,
+ const cs_int_t *face_cell,
+ const cs_real_t *restrict xa,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, face_id;
+
+ /* Tell IBM compiler not to alias */
+#if defined(__xlc__)
+#pragma disjoint(*x, *y, *xa)
+#endif
+
+ const cs_int_t *restrict face_cel_p = face_cell;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ y[ii] += xa[face_id] * x[jj];
+ y[jj] += xa[face_id] * x[ii];
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Measure matrix.vector product extradiagonal terms related performance
+ * (symmetric matrix case, variant 1).
+ *
+ * parameters:
+ * n_faces <-- local number of internal faces
+ * face_cell <-- face -> cells connectivity (1 to n)
+ * xa <-- extradiagonal values
+ * x <-- vector
+ * y <-> vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_exdiag_native_v1(cs_int_t n_faces,
+ const cs_int_t *face_cell,
+ const cs_real_t *restrict xa,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, ii_prev, kk, face_id, kk_max;
+ cs_real_t y_it, y_it_prev;
+
+ const int l1_cache_size = 508;
+
+ /*
+ * 1/ Split y[ii] and y[jj] computation into 2 loops to remove compiler
+ * data dependency assertion between y[ii] and y[jj].
+ * 2/ keep index (*face_cel_p) in L1 cache from y[ii] loop to y[jj] loop
+ * and xa in L2 cache.
+ * 3/ break high frequency occurence of data dependency from one iteration
+ * to another in y[ii] loop (nonzero matrix value on the same line ii).
+ */
+
+ const cs_int_t *restrict face_cel_p = face_cell;
+
+ for (face_id = 0;
+ face_id < n_faces;
+ face_id += l1_cache_size) {
+
+ kk_max = CS_MIN((n_faces - face_id), l1_cache_size);
+
+ /* sub-loop to compute y[ii] += xa[face_id] * x[jj] */
+
+ ii = face_cel_p[0] - 1;
+ ii_prev = ii;
+ y_it_prev = y[ii_prev] + xa[face_id] * x[face_cel_p[1] - 1];
+
+ for (kk = 1; kk < kk_max; ++kk) {
+ ii = face_cel_p[2*kk] - 1;
+ /* y[ii] += xa[face_id+kk] * x[jj]; */
+ if(ii == ii_prev) {
+ y_it = y_it_prev;
+ }
+ else {
+ y_it = y[ii];
+ y[ii_prev] = y_it_prev;
+ }
+ ii_prev = ii;
+ y_it_prev = y_it + xa[face_id+kk] * x[face_cel_p[2*kk+1] - 1];
+ }
+ y[ii] = y_it_prev;
+
+ /* sub-loop to compute y[ii] += xa[face_id] * x[jj] */
+
+ for (kk = 0; kk < kk_max; ++kk) {
+ y[face_cel_p[2*kk+1] - 1]
+ += xa[face_id+kk] * x[face_cel_p[2*kk] - 1];
+ }
+ face_cel_p += 2 * l1_cache_size;
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Measure matrix.vector product extradiagonal terms related performance
+ * with contribution to face-based array instead of cell-based array
+ * (symmetric matrix case).
+ *
+ * parameters:
+ * n_faces <-- local number of internal faces
+ * face_cell <-- face -> cells connectivity (1 to n)
+ * xa <-- extradiagonal values
+ * x <-- vector
+ * ya <-> vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_exdiag_part_p1(cs_int_t n_faces,
+ const cs_int_t *face_cell,
+ const cs_real_t *restrict xa,
+ cs_real_t *restrict x,
+ cs_real_t *restrict ya)
+{
+ cs_int_t ii, jj, face_id;
+
+ /* Tell IBM compiler not to alias */
+#if defined(__xlc__)
+#pragma disjoint(*x, *xa, *ya)
+#endif
+
+ const cs_int_t *restrict face_cel_p = face_cell;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ ya[face_id] += xa[face_id] * x[ii];
+ ya[face_id] += xa[face_id] * x[jj];
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Measure matrix.vector product local extradiagonal part related performance.
+ *
+ * parameters:
+ * n_runs <-- number of operation runs
+ * n_cells <-- number of cells
+ * n_cells_ext <-- number of cells including ghost cells (array size)
+ * n_faces <-- local number of internal faces
+ * face_cell <-- face -> cells connectivity (1 to n)
+ * xa <-- extradiagonal values
+ * x <-> vector
+ * y --> vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_sub_matrix_vector_test(int n_runs,
+ cs_int_t n_cells,
+ cs_int_t n_cells_ext,
+ cs_int_t n_faces,
+ const cs_int_t *face_cell,
+ const cs_real_t *restrict xa,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ double wt, cpu;
+ int run_id;
+ long n_ops, n_ops_glob;
+ double *ya = NULL;
+
+ double test_sum = 0.0;
+
+ if (n_runs < 1)
+ return;
+
+ n_ops = n_faces*2;
+
+ if (cs_glob_n_ranks == 1)
+ n_ops_glob = n_ops;
+ else
+ n_ops_glob = ( cs_glob_mesh->n_g_cells
+ + cs_glob_mesh->n_g_i_faces*2);
+
+ for (int jj = 0; jj < n_cells_ext; jj++)
+ y[jj] = 0.0;
+
+ /* Matrix.vector product, variant 0 */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ _mat_vec_exdiag_native(n_faces, face_cell, xa, x, y);
+ test_sum += y[n_cells-1];
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Matrix.vector product, extradiagonal part, variant 0\n"
+ "---------------------\n"));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+ for (int jj = 0; jj < n_cells_ext; jj++)
+ y[jj] = 0.0;
+
+ test_sum = 0.0;
+
+ /* Matrix.vector product, variant 1 */
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ _mat_vec_exdiag_native_v1(n_faces, face_cell, xa, x, y);
+ test_sum += y[n_cells-1];
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ bft_printf(_("\n"
+ "Matrix.vector product, extradiagonal part, variant 1\n"
+ "---------------------\n"));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+ /* Matrix.vector product, contribute to faces only */
+
+ BFT_MALLOC(ya, n_faces, cs_real_t);
+ for (int jj = 0; jj < n_faces; jj++)
+ ya[jj] = 0.0;
+
+ test_sum = 0.0;
+
+ _timer_start(&wt, &cpu);
+
+ for (run_id = 0; run_id < n_runs; run_id++) {
+ _mat_vec_exdiag_part_p1(n_faces, face_cell, xa, x, ya);
+ test_sum += y[n_cells-1];
+ }
+
+ _timer_stop(n_runs, &wt, &cpu);
+
+ BFT_FREE(ya);
+
+ bft_printf(_("\n"
+ "Matrix.vector product, face values only\n"
+ "---------------------\n"));
+
+ bft_printf(_(" (calls: %d; test sum: %12.5f)\n"),
+ n_runs, test_sum);
+
+ _print_stats(n_ops, n_ops_glob, wt, cpu);
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Run simple benchmarks.
+ *
+ * parameters:
+ * mpi_trace_mode <-- indicates if timing mode (0) or MPI trace-friendly
+ * mode (1) is to be used
+ *----------------------------------------------------------------------------*/
+
+void
+cs_benchmark(int mpi_trace_mode)
+{
+ /* Local variable definitions */
+ /*----------------------------*/
+
+ int n_runs;
+ size_t ii;
+
+ cs_real_t *x1 = NULL, *x2 = NULL;
+ cs_real_t *y1 = NULL, *y2 = NULL;
+ cs_real_t *da = NULL, *xa = NULL;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_mesh_quantities_t *mesh_v = cs_glob_mesh_quantities;
+
+ size_t n_cells = mesh->n_cells;
+ size_t n_cells_ext = mesh->n_cells_with_ghosts;
+ size_t n_faces = mesh->n_i_faces;
+
+ /* Allocate and initialize working arrays */
+ /*-----------------------------------------*/
+
+ BFT_MALLOC(x1, n_cells_ext, cs_real_t);
+ BFT_MALLOC(x2, n_cells_ext, cs_real_t);
+
+ for (ii = 0; ii < n_cells_ext; ii++) {
+ x1[ii] = mesh_v->cell_cen[ii*3];
+ x2[ii] = mesh_v->cell_cen[ii*3 + 1];
+ }
+
+ if (CS_MEM_ALIGN > 0) {
+
+ BFT_MEMALIGN(y1, CS_MEM_ALIGN, n_cells_ext, cs_real_t);
+ BFT_MEMALIGN(y2, CS_MEM_ALIGN, n_cells_ext, cs_real_t);
+
+ }
+ else {
+
+ BFT_MALLOC(y1, n_cells_ext, cs_real_t);
+ BFT_MALLOC(y2, n_cells_ext, cs_real_t);
+
+ }
+
+ BFT_MALLOC(da, n_cells_ext, cs_real_t);
+ BFT_MALLOC(xa, n_faces*2, cs_real_t);
+
+ for (ii = 0; ii < n_cells_ext; ii++) {
+ da[ii] = 1.0 + ii/n_cells_ext;
+ xa[ii] = mesh_v->cell_cen[ii*3 + 1];
+ }
+
+ for (ii = 0; ii < n_faces; ii++) {
+ xa[ii] = 0.5*(1.0 + ii/n_faces);
+ xa[ii + n_faces] = -0.5*(1.0 + ii/n_faces);
+ }
+
+ /* Run tests */
+ /*-----------*/
+
+ bft_printf(_("\n"
+ "Benchmark mode activated\n"
+ "========================\n"));
+
+ /* Dot product test */
+ /*------------------*/
+
+ n_runs = (mpi_trace_mode) ? 1 : 10000;
+
+ _dot_product_1(0, n_runs, n_cells, x1, x1);
+ _dot_product_1(0, n_runs, n_cells, x1, x2);
+ _dot_product_2(n_runs, n_cells, x1, x2);
+ _axpy_(n_runs, n_cells, x1, y1);
+
+ _division_test(n_runs/5, n_cells);
+ _sqrt_test(n_runs/10, n_cells);
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ n_runs = (mpi_trace_mode) ? 1 : 10000;
+
+ _dot_product_1(1, n_runs, n_cells, x1, x1);
+ _dot_product_1(1, n_runs, n_cells, x1, x2);
+
+ }
+
+#endif /* HAVE_MPI */
+
+ /* Matrix test */
+ /*-------------*/
+
+ n_runs = (mpi_trace_mode) ? 0 : 500;
+
+ if (!mpi_trace_mode) {
+
+ /* Creation tests */
+
+ n_runs = 2000;
+
+ _matrix_creation_test(n_runs,
+ _("native"),
+ CS_MATRIX_NATIVE, false,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo,
+ mesh->i_face_numbering);
+
+ n_runs = 300;
+
+ _matrix_creation_test(n_runs,
+ _("CSR"),
+ CS_MATRIX_CSR, false,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo,
+ mesh->i_face_numbering);
+
+ _matrix_creation_test(n_runs,
+ _("CSR sym"),
+ CS_MATRIX_CSR, true,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo,
+ mesh->i_face_numbering);
+
+ /* Assignment tests */
+
+ n_runs = 2000;
+
+ _matrix_assignment_test(n_runs,
+ _("native"),
+ CS_MATRIX_NATIVE, false, false,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo, mesh->i_face_numbering, da, xa);
+
+ _matrix_assignment_test(n_runs,
+ _("native, sym coeffs"),
+ CS_MATRIX_NATIVE, false, true,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo, mesh->i_face_numbering, da, xa);
+
+ n_runs = 300;
+
+ _matrix_assignment_test(n_runs,
+ _("CSR"),
+ CS_MATRIX_CSR, false, false,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo, mesh->i_face_numbering, da, xa);
+
+ _matrix_assignment_test(n_runs,
+ _("CSR, sym coeffs"),
+ CS_MATRIX_CSR, false, true,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo, mesh->i_face_numbering, da, xa);
+
+ _matrix_assignment_test(n_runs,
+ _("CSR_sym"),
+ CS_MATRIX_CSR, true, true,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells,
+ mesh->halo, mesh->i_face_numbering, da, xa);
+
+ }
+
+ /* Matrix.vector tests */
+
+ n_runs = (mpi_trace_mode) ? 1 : 1000;
+
+ _matrix_vector_test(n_runs,
+ _("native"),
+ CS_MATRIX_NATIVE, false, false,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells, mesh->halo,
+ mesh->i_face_numbering, da, xa, x1, y1);
+
+ _matrix_vector_test(n_runs,
+ _("native, sym coeffs"),
+ CS_MATRIX_NATIVE, false, true,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells, mesh->halo,
+ mesh->i_face_numbering, da, xa, x1, y1);
+
+ _matrix_vector_test(n_runs,
+ _("CSR"),
+ CS_MATRIX_CSR, false, false,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells, mesh->halo,
+ mesh->i_face_numbering, da, xa, x1, y1);
+
+ _matrix_vector_test(n_runs,
+ _("CSR_sym"),
+ CS_MATRIX_CSR, true, true,
+ n_cells, n_cells_ext, n_faces,
+ mesh->global_cell_num, mesh->i_face_cells, mesh->halo,
+ mesh->i_face_numbering, da, xa, x1, y1);
+
+ _sub_matrix_vector_test(n_runs,
+ n_cells,
+ n_cells_ext,
+ n_faces,
+ mesh->i_face_cells,
+ xa,
+ x1,
+ y1);
+
+ /* Free working arrays */
+ /*---------------------*/
+
+ BFT_FREE(x1);
+ BFT_FREE(x2);
+
+ BFT_FREE(y1);
+ BFT_FREE(y2);
+
+ BFT_FREE(da);
+ BFT_FREE(xa);
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_blas.c b/src/base/cs_blas.c
new file mode 100644
index 0000000..c39699d
--- /dev/null
+++ b/src/base/cs_blas.c
@@ -0,0 +1,521 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Portability and fallback layer for BLAS functions
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * External library headers
+ *----------------------------------------------------------------------------*/
+
+#include <math.h>
+
+#if defined(HAVE_CBLAS)
+#include <cblas.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_blas.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function definitions (see BLAS reference)
+ *============================================================================*/
+
+#if defined(HAVE_FBLAS) && !defined(HAVE_CBLAS) \
+ && !defined(HAVE_ESSL) && !defined (HAVE_MKL)
+
+/* If we have F77 BLAS but no C BLAS functions, define C BLAS as F77 wrappers */
+/*----------------------------------------------------------------------------*/
+
+/* Sum of the absolute values of a vector */
+
+double cblas_dasum(cs_int_t n,
+ const double *x,
+ cs_int_t incx)
+{
+ return CS_PROCF(dasum, DASUM)(&n, x, &incx);
+}
+
+/* Constant times a vector plus a vector: y <-- ax + y */
+
+void cblas_daxpy(cs_int_t n,
+ double a,
+ const double *x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy)
+{
+ CS_PROCF(daxpy, DAXPY)(&n, &a, x, &incx, y, &incy);
+}
+
+/* Copy a vector x to a vector y: y <-- x */
+
+void cblas_dcopy(cs_int_t n,
+ const double *x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy)
+{
+ CS_PROCF(dcopy, DCOPY)(&n, x, &incx, y, &incy);
+}
+
+/* Return the dot product of 2 vectors: x.y */
+
+double cblas_ddot(cs_int_t n,
+ const double *x,
+ cs_int_t incx,
+ const double *y,
+ cs_int_t incy)
+{
+ return CS_PROCF(ddot, DDOT)(&n, x, &incx, y, &incy);
+}
+
+/* Return the euclidean norm of a vector */
+
+double cblas_dnrm2(cs_int_t n,
+ const double *x,
+ cs_int_t incx)
+{
+ return CS_PROCF(dnrm2, DNRM2)(&n, x, &incx);
+}
+
+/* Scales a vector by a constant: x <-- ax */
+
+void cblas_dscal(cs_int_t n,
+ double a,
+ double *x,
+ cs_int_t incx)
+{
+ CS_PROCF(dscal, DSCAL)(&n, &a, x, &incx);
+}
+
+/* Interchange vectors */
+
+void cblas_dswap(cs_int_t n,
+ double *restrict x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy)
+{
+ CS_PROCF(dswap, DSWAP)(&n, x, &incx, y, &incy);
+}
+
+/* Finds the index of element having max absolute value */
+
+cs_int_t cblas_idamax(cs_int_t n,
+ const double *x,
+ cs_int_t incx)
+{
+ return CS_PROCF(idamax, IDAMAX)(&n, x, &incx);
+}
+
+#endif /* defined(HAVE_FBLAS) && !defined(HAVE_CBLAS) \
+ && !defined(HAVE_ESSL) && !defined (HAVE_MKL) */
+
+#if !defined(HAVE_FBLAS) \
+ && !defined(HAVE_ESSL) && !defined (HAVE_MKL)
+
+/* If we have no F77 BLAS functions, define F77 BLAS as C wrappers */
+/*-----------------------------------------------------------------*/
+
+/* Sum of the absolute values of a vector */
+
+double CS_PROCF(dasum, DASUM)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx)
+{
+ return cblas_dasum(*n, x, *incx);
+}
+
+/* Constant times a vector plus a vector: y <-- ax + y */
+
+void CS_PROCF(daxpy, DAXPY)(const cs_int_t *n,
+ const double *a,
+ const double *x,
+ const cs_int_t *incx,
+ double *restrict y,
+ const cs_int_t *incy)
+{
+ cblas_daxpy(*n, *a, x, *incx, y, *incy);
+}
+
+/* Copy a vector x to a vector y: y <-- x */
+
+void CS_PROCF(dcopy, DCOPY)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx,
+ double *restrict y,
+ const cs_int_t *incy)
+{
+ cblas_dcopy(*n, x, *incx, y, *incy);
+}
+
+/* Return the dot product of 2 vectors: x.y */
+
+double CS_PROCF(ddot, DDOT)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx,
+ const double *y,
+ const cs_int_t *incy)
+{
+ return cblas_ddot(*n, x, *incx, y, *incy);
+}
+
+/* Return the euclidean norm of a vector */
+
+double CS_PROCF(dnrm2, DNRM2)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx)
+{
+ return cblas_dnrm2(*n, x, *incx);
+}
+
+/* Scales a vector by a constant: x <-- ax */
+
+void CS_PROCF(dscal, DSCAL)(const cs_int_t *n,
+ const double *a,
+ double *x,
+ const cs_int_t *incx)
+{
+ cblas_dscal(*n, *a, x, *incx);
+}
+
+/* Interchange vectors */
+
+void CS_PROCF(dswap, DSWAP)(const cs_int_t *n,
+ double *restrict x,
+ const cs_int_t *incx,
+ double *restrict y,
+ const cs_int_t *incy)
+{
+ cblas_dswap(*n, x, *incx, y, *incy);
+}
+
+/* Finds the index of element having max absolute value */
+
+cs_int_t CS_PROCF(idamax, IDAMAX)(const cs_int_t *n,
+ const double *x,
+ const cs_int_t *incx)
+{
+ return cblas_idamax(*n, x, *incx);
+}
+
+#endif /* !defined(HAVE_FBLAS) \
+ && !defined(HAVE_ESSL) && !defined (HAVE_MKL) */
+
+#if !defined(HAVE_BLAS)
+
+/* If we have no external BLAS, define fallback legacy C BLAS */
+/*------------------------------------------------------------*/
+
+/* Return the sum of absolute values */
+
+double cblas_dasum(cs_int_t n,
+ const double *x,
+ cs_int_t incx)
+{
+ cs_int_t i;
+ cs_int_t inc_x = CS_ABS(incx);
+
+ double sum = 0;
+
+ if (n < 0) return sum;
+
+ if (inc_x == 1) {
+ for (i = 0; i < n; i++) {
+ sum += CS_ABS(x[i]);
+ }
+ }
+ else {
+ cs_int_t j;
+ for (i = 0, j = 0; i < n; i++, j += inc_x) {
+ sum += CS_ABS(x[j]);
+ }
+ }
+
+ return sum;
+}
+
+/* Constant times a vector plus a vector: y <-- ax + y */
+
+void cblas_daxpy(cs_int_t n,
+ double a,
+ const double *x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy)
+{
+ cs_int_t i;
+ cs_int_t inc_x = CS_ABS(incx);
+ cs_int_t inc_y = CS_ABS(incy);
+
+ if (n < 0) return;
+
+ if (inc_x == 1 && inc_y == 1) {
+ for (i = 0; i < n; i++) {
+ y[i] += (a * x[i]);
+ }
+ }
+ else {
+ cs_int_t j, k;
+ for (i = 0, j = 0, k = 0; i < n; i++, j += inc_x, k += inc_y) {
+ y[k] += (a * x[j]);
+ }
+ }
+}
+
+/* Copy a vector x to a vector y: y <-- x */
+
+void cblas_dcopy(cs_int_t n,
+ const double *x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy)
+{
+ cs_int_t i;
+ cs_int_t inc_x = CS_ABS(incx);
+ cs_int_t inc_y = CS_ABS(incy);
+
+ if (n < 0) return;
+
+ if (inc_x == 1 && inc_y == 1) {
+ for (i = 0; i < n; i++) {
+ y[i] = x[i];
+ }
+ }
+ else {
+ cs_int_t j, k;
+ for (i = 0, j = 0, k = 0; i < n; i++, j += inc_x, k += inc_y) {
+ y[k] = x[j];
+ }
+ }
+}
+
+/* Return the dot product of 2 vectors: x.y */
+
+double cblas_ddot(cs_int_t n,
+ const double *x,
+ cs_int_t incx,
+ const double *y,
+ cs_int_t incy)
+{
+ cs_int_t i;
+ cs_int_t inc_x = CS_ABS(incx);
+ cs_int_t inc_y = CS_ABS(incy);
+
+ double sum = 0;
+
+ if (n < 0) return sum;
+
+ if (inc_x == 1 && inc_y == 1) {
+ for (i = 0; i < n; i++) {
+ sum += (x[i] * y[i]);
+ }
+ }
+ else {
+ cs_int_t j, k;
+ for (i = 0, j = 0, k = 0; i < n; i++, j += inc_x, k += inc_y) {
+ sum += (x[j] * y[k]);
+ }
+ }
+
+ return sum;
+}
+
+/* Return the euclidean norm of a vector */
+
+double cblas_dnrm2(cs_int_t n,
+ const double *x,
+ cs_int_t incx)
+{
+ cs_int_t i, j;
+ cs_int_t inc_x = CS_ABS(incx);
+ double absx, temp;
+ double scale = 1e-18; /* Close to zero */
+ double ssq = 0.0;
+
+ if (n < 0) return ssq;
+
+ for (i = 0, j = 0; i < n; i++, j += inc_x) {
+ absx = CS_ABS(x[j]);
+ if (scale < absx) {
+ temp = scale / absx;
+ scale = absx;
+ ssq = 1.0 + (ssq * (temp*temp));
+ }
+ else {
+ temp = absx / scale;
+ ssq += (temp * temp);
+ }
+ }
+
+ return (scale * sqrt(ssq));
+}
+
+/* Scales a vector by a constant: x <-- ax */
+
+void cblas_dscal(cs_int_t n,
+ double a,
+ double *x,
+ cs_int_t incx)
+{
+ cs_int_t i;
+ cs_int_t inc_x = CS_ABS(incx);
+
+ if (n < 0) return;
+
+ if (inc_x == 1) {
+ for (i = 0; i < n; i++) {
+ x[i] *= a;
+ }
+ }
+ else {
+ cs_int_t j;
+ for (i = 0, j = 0; i < n; i++, j += inc_x) {
+ x[j] *= a;
+ }
+ }
+}
+
+/* Interchange vectors */
+
+void cblas_dswap(cs_int_t n,
+ double *restrict x,
+ cs_int_t incx,
+ double *restrict y,
+ cs_int_t incy)
+{
+ cs_int_t i;
+ cs_int_t inc_x = CS_ABS(incx);
+ cs_int_t inc_y = CS_ABS(incy);
+
+ double temp;
+
+ if (n < 0) return;
+
+ if (inc_x == 1 && inc_y == 1) {
+ for (i = 0; i < n; i++) {
+ temp = x[i];
+ x[i] = y[i];
+ y[i] = temp;
+ }
+ }
+ else {
+ cs_int_t j, k;
+ for (i = 0, j = 0, k = 0; i < n; i++, j += inc_x, k += inc_y) {
+ temp = x[j];
+ x[j] = y[k];
+ y[k] = temp;
+ }
+ }
+}
+
+/* Finds the index of element having max absolute value */
+
+cs_int_t cblas_idamax(cs_int_t n,
+ const double *x,
+ cs_int_t incx)
+{
+ cs_int_t i;
+ cs_int_t inc_x = CS_ABS(incx);
+ double dmax;
+
+ cs_int_t index_max = 0;
+
+ if (n < 1 || inc_x < 0) return index_max;
+
+ index_max = 1;
+ dmax = CS_ABS(x[0]);
+
+ if (inc_x == 1) {
+ for (i = 0; i < n; i++) {
+ if (CS_ABS(x[i]) > dmax) {
+ index_max = i+1;
+ dmax= CS_ABS(x[i]);
+ }
+ }
+ }
+ else {
+ cs_int_t j;
+ for (i = 0, j = 0; i < n; i++, j += inc_x) {
+ if (CS_ABS(x[j]) > dmax) {
+ index_max = i+1;
+ dmax= CS_ABS(x[j]);
+ }
+ }
+ }
+
+ return index_max;
+}
+
+#endif /* !defined(HAVE_CBLAS) && !defined(HAVE_FBLAS) */
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_boundary_conditions.c b/src/base/cs_boundary_conditions.c
new file mode 100644
index 0000000..d832976
--- /dev/null
+++ b/src/base/cs_boundary_conditions.c
@@ -0,0 +1,437 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Boundary condition handling.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+#include "cs_matrix.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_prototypes.h"
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_boundary_conditions.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/* Mappings to MPI datatypes */
+
+#if defined(HAVE_MPI)
+
+typedef struct
+{
+ int val;
+ int rank;
+} _mpi_int_int_t;
+
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Local Structure Definitions
+ *----------------------------------------------------------------------------*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Transfer info on face with lowest global number to rank 0.
+ *
+ * parameters:
+ * face_gnum <-> pointer to global face number
+ * face_coo <-> pointer to face coordinates
+ * face_type <-> pointer to face type
+ *----------------------------------------------------------------------------*/
+
+static void
+_min_gnum_face(fvm_gnum_t *face_gnum,
+ int *face_type,
+ double face_coo[3])
+{
+#if defined(HAVE_MPI)
+
+ /* local variables */
+
+ fvm_gnum_t min_face_gnum;
+ _mpi_int_int_t val_in, val_min;
+
+ /* Return immediately if not running under MPI */
+
+ if (cs_glob_n_ranks < 2)
+ return;
+
+ /* Obtain the lowest global face number with an error; use minloc
+ with a marker, rather than with a global number directly, in
+ case fvm_gnum_t is larger than an integer) */
+
+ MPI_Allreduce(face_gnum, &min_face_gnum, 1, FVM_MPI_GNUM, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ if (*face_gnum == min_face_gnum)
+ val_in.val = 0;
+ else
+ val_in.val = 1;
+ val_in.rank = cs_glob_rank_id;
+
+ MPI_Allreduce(&val_in, &val_min, 1, MPI_2INT, MPI_MINLOC,
+ cs_glob_mpi_comm);
+
+ /* Now exchange values */
+
+ if (val_min.rank > 0) {
+
+ if (val_min.rank == cs_glob_rank_id) {
+ MPI_Send(face_gnum, 1, FVM_MPI_GNUM, 0, 1, cs_glob_mpi_comm);
+ MPI_Send(face_type, 1, MPI_INT, 0, 2, cs_glob_mpi_comm);
+ MPI_Send(face_coo, 3, MPI_DOUBLE, 0, 3, cs_glob_mpi_comm);
+ }
+ else if (cs_glob_rank_id == 0) {
+ MPI_Status status;
+ MPI_Recv(face_gnum, 1, FVM_MPI_GNUM, val_min.rank, 1,
+ cs_glob_mpi_comm, &status);
+ MPI_Recv(face_type, 1, MPI_INT, val_min.rank, 2,
+ cs_glob_mpi_comm, &status);
+ MPI_Recv(face_coo, 3, MPI_DOUBLE, val_min.rank, 3,
+ cs_glob_mpi_comm, &status);
+ }
+
+ }
+
+#endif
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Handling of boundary condition definition errors and associated output.
+ *
+ * For each boundary face, itypfb defines the boundary condition type.
+ * As a convention here, zero values correspond to undefined types,
+ * positive values to defined types (with no error), and negative values
+ * to defined types with inconsistent or incompatible values, the
+ * absolute value indicating the original boundary condition type.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE BCDERR (NPHAS , ITYPFB)
+ * *****************
+ *
+ * INTEGER NPHAS : --> : Number of active phases
+ * INTEGER ITYPFB : <-> : Array of BC type ids (per phase)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (bcderr, BCDERR)
+(
+ const cs_int_t *nphas,
+ cs_int_t *itypfb
+)
+{
+ cs_boundary_conditions_error(*nphas, itypfb);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Handling of boundary condition definition errors and associated output.
+ *
+ * For each boundary face, bc_type defines the boundary condition type.
+ * As a convention here, zero values correspond to undefined types,
+ * positive values to defined types (with no error), and negative values
+ * to defined types with inconsistent or incompatible values, the
+ * absolute value indicating the original boundary condition type.
+ *
+ *
+ * parameters:
+ * n_phases <-- number of active phases
+ * bc_type <-- array of BC type ids (per phase)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_boundary_conditions_error(int n_phases,
+ const cs_int_t bc_type[])
+{
+ /* local variables */
+
+ int phase_id;
+ fvm_lnum_t face_id;
+
+ fvm_gnum_t n_errors = 0;
+
+ unsigned char *face_marker = NULL;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_mesh_quantities_t *mesh_q = cs_glob_mesh_quantities;
+
+ const fvm_lnum_t n_b_faces = mesh->n_b_faces;
+
+ /* Prepare face marker */
+
+ BFT_MALLOC(face_marker, n_b_faces, unsigned char);
+
+ for (face_id = 0; face_id < n_b_faces; face_id++)
+ face_marker[face_id] = 0;
+
+ /* Count and mark faces with problems */
+
+ for (phase_id = 0; phase_id < n_phases; phase_id++) {
+
+ int err_face_type;
+ cs_real_t err_face_coo[3];
+ fvm_gnum_t err_face_gnum = 0;
+
+ const cs_int_t *_bc_type = bc_type + phase_id*n_b_faces;
+
+ for (face_id = 0; face_id < n_b_faces; face_id++) {
+
+ /* _bc_type[] used to determine if we have an error */
+
+ if (_bc_type[face_id] < 1) {
+
+ fvm_gnum_t face_gnum;
+
+ if (mesh->global_b_face_num != NULL)
+ face_gnum = mesh->global_b_face_num[face_id];
+ else
+ face_gnum = face_id + 1;
+
+ face_marker[face_id] = 1;
+
+ if (err_face_gnum == 0 || face_gnum < err_face_gnum) {
+ int coo_id;
+ err_face_type = _bc_type[face_id];
+ for (coo_id = 0; coo_id < 3; coo_id++)
+ err_face_coo[coo_id] = mesh_q->b_face_cog[face_id*3 + coo_id];
+ }
+
+ n_errors += 1;
+ }
+ }
+
+ fvm_parall_counter(&n_errors, 1);
+
+ /* Obtain the lowest global face number with an error,
+ and print associated info */
+
+ _min_gnum_face(&err_face_gnum, &err_face_type, err_face_coo);
+
+ if (cs_glob_rank_id < 1) {
+
+ if (n_phases > 1)
+ bft_printf(_("\nPhase %d:\n "), phase_id + 1);
+
+ bft_printf(_("\nFirst face with boundary condition definition error\n"
+ " (out of %lu)\n"
+ " has boundary condition type %d, center (%g, %g, %g)\n\n"),
+ (unsigned long)n_errors , abs(err_face_type),
+ err_face_coo[0], err_face_coo[1], err_face_coo[2]);
+ }
+
+ }
+
+ /* If post-processing is active, output boundary condition info */
+ /*--------------------------------------------------------------*/
+
+ if (mesh->i_face_vtx_idx != NULL || mesh->b_face_vtx_idx) {
+
+ int ii;
+
+ cs_int_t face_list_size = 0;
+ cs_int_t *face_list = NULL;
+ int mesh_id[2] = {0, 0};
+
+ const int writer_id = -2;
+
+ n_errors = 0;
+
+ cs_post_init_error_writer();
+
+ /* Prepare face marker */
+
+ BFT_MALLOC(face_list, n_b_faces, cs_int_t);
+
+ /* Mesh for invalid faces */
+
+ face_list_size = 0;
+ for (face_id = 0; face_id < n_b_faces; face_id++) {
+ if (face_marker[face_id] != 0)
+ face_list[face_list_size++] = face_id + 1;
+ }
+
+ mesh_id[0] = cs_post_get_free_mesh_id();
+
+ cs_post_add_mesh(mesh_id[0],
+ _("Faces with B.C. error"),
+ 0,
+ 0,
+ face_list_size,
+ NULL,
+ NULL,
+ face_list);
+
+ cs_post_associate(mesh_id[0], writer_id);
+
+ /* Mesh for valid faces */
+
+ face_list_size = 0;
+ for (face_id = 0; face_id < n_b_faces; face_id++) {
+ if (face_marker[face_id] == 0)
+ face_list[face_list_size++] = face_id + 1;
+ }
+
+ n_errors = face_list_size;
+ fvm_parall_counter(&n_errors, 1);
+
+ if (n_errors < mesh->n_g_b_faces) {
+
+ mesh_id[1] = cs_post_get_free_mesh_id();
+
+ cs_post_add_mesh(mesh_id[1],
+ _("Faces with valid B.C.'s"),
+ 0,
+ 0,
+ face_list_size,
+ NULL,
+ NULL,
+ face_list);
+
+ cs_post_associate(mesh_id[1], writer_id);
+ }
+
+ BFT_FREE(face_marker);
+
+ cs_post_activate_writer(writer_id, 1);
+
+ cs_post_write_meshes(-1, 0.0);
+
+ for (phase_id = 0; phase_id < n_phases; phase_id++) {
+
+ size_t name_size = 0;
+ char var_name[32];
+
+ const cs_int_t *_bc_type = bc_type + phase_id*n_b_faces;
+
+ if (n_phases > 1) {
+ sprintf(var_name, _("Phase %d, "), phase_id + 1);
+ name_size = strlen(var_name);
+ }
+ else
+ var_name[0] = '\0';
+
+ strncpy(var_name + name_size, _("BC type"), 31 - name_size);
+
+ for (ii = 0; ii < 2; ii++) {
+
+ if (mesh_id[ii] != 0)
+ cs_post_write_var(mesh_id[ii],
+ var_name,
+ 1,
+ false, /* no interlace */
+ true, /* use parents */
+ CS_POST_TYPE_cs_int_t,
+ -1,
+ 0.0,
+ NULL,
+ NULL,
+ _bc_type);
+
+ }
+ }
+ }
+
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _("\nSome boundary condition definitions are incomplete or incorrect.\n\n"
+ " For details, read the end of the calculation log,\n"
+ " or visualize the error postprocessing output."));
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_calcium.c b/src/base/cs_calcium.c
new file mode 100644
index 0000000..de6432e
--- /dev/null
+++ b/src/base/cs_calcium.c
@@ -0,0 +1,1274 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Basic CALCIUM-mappable functions for code coupling using SALOME's YACS
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#if defined(HAVE_DLOPEN)
+#include <dlfcn.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_proxy_comm.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_calcium.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* Maximum string Lengths (based on CALCIUM's limits) */
+
+#define CS_CALCIUM_INSTANCE_LEN 72
+#define CS_CALCIUM_VARIABLE_LEN 144
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/* CALCIUM datatypes */
+
+typedef enum {
+
+ CALCIUM_integer, /* Integer values */
+ CALCIUM_real, /* Floating-point values */
+ CALCIUM_double, /* Double-precision floating-point values */
+ CALCIUM_complex, /* Complex values (not used by Code_Saturne) */
+ CALCIUM_string, /* character string */
+ CALCIUM_logical /* Logical values */
+
+} cs_calcium_datatype_t;
+
+/*----------------------------------------------------------------------------
+ * Function pointer types
+ *----------------------------------------------------------------------------*/
+
+typedef int
+(cs_calcium_yacsinit_t)(void);
+
+typedef int
+(cs_calcium_connect_t)(void *component,
+ char *s);
+
+typedef int
+(cs_calcium_disconnect_t)(void *component,
+ int cont);
+
+typedef int
+(cs_calcium_read_int_t)(void *component,
+ int time_dep,
+ float *min_time,
+ float *max_time,
+ int *iteration,
+ char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ int val[]);
+
+typedef int
+(cs_calcium_read_float_t)(void *component,
+ int time_dep,
+ float *min_time,
+ float *max_time,
+ int *iteration,
+ char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ float val[]);
+
+typedef int
+(cs_calcium_read_double_t)(void *component,
+ int time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ double val[]);
+
+typedef int
+(cs_calcium_write_int_t)(void *component,
+ int time_dep,
+ float cur_time,
+ int iteration,
+ char *var_name,
+ int n_val,
+ int val[]);
+
+typedef int
+(cs_calcium_write_float_t)(void *component,
+ int time_dep,
+ float cur_time,
+ int iteration,
+ char *var_name,
+ int n_val,
+ float val[]);
+
+typedef int
+(cs_calcium_write_double_t)(void *component,
+ int time_dep,
+ double cur_time,
+ int iteration,
+ char *var_name,
+ int n_val,
+ double val[]);
+
+/*=============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Use communication with proxy ? */
+
+static int _cs_calcium_comm_proxy = 0;
+
+/* Verbosity (none if -1, headers if 0,
+ headers + n first and last elements if > 0 */
+
+static int _cs_calcium_n_echo = -1;
+
+/* Pointer of type Superv_Component_i* to the supervisable SALOME component */
+
+static void *_cs_calcium_component[8] = {NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL};
+
+/* Map from enumerated values to SALOME's Calcium API defined values */
+
+static int _cs_calcium_timedep_map[3] = {40, /* CP_TEMPS = 40 */
+ 41, /* CP_ITERATION = 41 */
+ 42}; /* CP_SEQUENTIAL = 42 */
+
+static int _cs_calcium_continuation_map[2] = {20, /* CP_CONT = 20 */
+ 21}; /* CP_ARRET = 21 */
+
+/* Calcium datatype names */
+
+static const char *cs_calcium_datatype_name[] = {"integer", "real", "double",
+ "complex", "string",
+ "logical"};
+static const char *cs_calcium_timedep_name[] = {"T", "I", "S"};
+
+/* YACS dynamic library, initialization, and specific error handling */
+
+static void *_cs_calcium_yacslib = NULL;
+
+static cs_calcium_yacsinit_t *_cs_calcium_yacsinit = NULL;
+
+/* Calcium function pointers */
+
+static cs_calcium_connect_t *_cs_calcium_connect = NULL;
+static cs_calcium_disconnect_t *_cs_calcium_disconnect = NULL;
+static cs_calcium_read_int_t *_cs_calcium_read_int = NULL;
+static cs_calcium_read_float_t *_cs_calcium_read_float = NULL;
+static cs_calcium_read_double_t *_cs_calcium_read_double = NULL;
+static cs_calcium_write_int_t *_cs_calcium_write_int = NULL;
+static cs_calcium_write_float_t *_cs_calcium_write_float = NULL;
+static cs_calcium_write_double_t *_cs_calcium_write_double = NULL;
+
+/*=============================================================================
+ * Local function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Print (part of) an array
+ *
+ * parameters:
+ * datatype <-- section data type
+ * n_echo <-- number of beginning and end values to print
+ * n_val <-- number of values in array
+ * val <-- array values
+ *----------------------------------------------------------------------------*/
+
+static void
+_calcium_echo_body(cs_calcium_datatype_t datatype,
+ int n_echo,
+ int n_val,
+ const void *val)
+{
+ int start_id, end_id, id;
+
+ if (n_val == 0) return;
+
+ assert(val != NULL);
+
+ start_id = 0;
+
+ if (n_echo * 2 < n_val) {
+
+ end_id = n_echo;
+ bft_printf(_(" %d first and last elements:\n"), n_echo);
+
+ }
+ else {
+
+ end_id = n_val;
+ bft_printf(_(" elements:\n"));
+
+ }
+
+ do {
+
+ switch(datatype) {
+
+ case CALCIUM_integer:
+ {
+ const int *_val = val;
+ for (id = start_id; id < end_id; id++)
+ bft_printf(" %10d : %12d\n", id + 1, *(_val + id));
+ }
+ break;
+
+ case CALCIUM_real:
+ {
+ const float *_val = val;
+ for (id = start_id; id < end_id; id++)
+ bft_printf(" %10d : %12.5e\n", id + 1,
+ (double)(*(_val + id)));
+ }
+ break;
+
+ case CALCIUM_double:
+ {
+ const double *_val = val;
+ for (id = start_id; id < end_id; id++)
+ bft_printf(" %10d : %14.7e\n", id + 1, *(_val + id));
+ }
+ break;
+
+ case CALCIUM_complex:
+ {
+ const float *_val = val;
+ for (id = start_id; id < end_id; id++)
+ bft_printf(" %10d : (%12.5e, %12.5e)\n", id + 1,
+ (double)(*(_val + 2*id)), (double)(*(_val + 2*id + 1)));
+
+ }
+ break;
+
+ case CALCIUM_string:
+ {
+ const char *const *_val = val;
+ for (id = start_id; id < end_id; id++)
+ bft_printf(" %10d : '%s\n", id + 1, _val[id]);
+ }
+ break;
+
+ default:
+
+ assert(0);
+
+ } /* End of switch on element type */
+
+ if (end_id < n_val) {
+
+ bft_printf(_(" .......... ............\n"));
+
+ start_id = n_val - n_echo;
+ end_id = n_val;
+
+ }
+ else {
+
+ assert(end_id == n_val);
+ end_id = n_val + 1;
+
+ }
+
+ } while (end_id <= n_val);
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Print message indicating that we are ready to read data
+ *
+ * parameters:
+ * comp_id <-- coupled component id
+ * var_name <-- variable name
+ * time_dep <-- time dependency
+ * min_time <-- time interval low
+ * max_time <-- time interval high
+ * iteration <-- iteration step
+ * datatype <-- section data type
+ * n_max_vals <-- maximum number of values to read
+ *----------------------------------------------------------------------------*/
+
+static void
+_calcium_echo_pre_read(int comp_id,
+ const char *var_name,
+ cs_calcium_timedep_t time_dep,
+ double min_time,
+ double max_time,
+ int iteration,
+ cs_calcium_datatype_t datatype,
+ int n_max_vals)
+{
+ if (_cs_calcium_n_echo < 0)
+ return;
+
+ assert(var_name != NULL);
+
+ if (_cs_calcium_component[comp_id] != NULL)
+ bft_printf(_("\nComponent %d [%p]:\n"),
+ comp_id, _cs_calcium_component[comp_id]);
+ else
+ bft_printf(_("\nComponent %d:\n"), comp_id);
+
+ bft_printf(_("Reading up to %d values of type %s, time_dependency %s\n"
+ " (min/max time %f/%f, iteration %d) ..."),
+ n_max_vals, cs_calcium_datatype_name[datatype],
+ cs_calcium_timedep_name[time_dep],
+ min_time, max_time, iteration);
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Print message indicating that we are finished reading data, and optionnaly
+ * print a part of the corresponding data.
+ *
+ * parameters:
+ * min_time <-- time interval low
+ * iteration <-- iteration step
+ * datatype <-- section data type
+ * n_val <-- number of values in array
+ * val <-- array values
+ *----------------------------------------------------------------------------*/
+
+static void
+_calcium_echo_post_read(double min_time,
+ int iteration,
+ cs_calcium_datatype_t datatype,
+ int n_val,
+ const void *val)
+{
+ if (_cs_calcium_n_echo < 0)
+ return;
+
+ bft_printf(_("[ok]\n"
+ "Read %d values (min time %f, iteration %d).\n"),
+ n_val, min_time, iteration);
+
+ _calcium_echo_body(datatype, _cs_calcium_n_echo, n_val, val);
+}
+
+/*----------------------------------------------------------------------------
+ * Print message indicating that we are ready to write data
+ *
+ * parameters:
+ * comp_id <-- coupled component id
+ * var_name <-- variable name
+ * time_dep <-- time dependency
+ * cur_time <-- current time
+ * iteration <-- iteration step
+ * datatype <-- section data type
+ * n_vals <-- number of values to read
+ *----------------------------------------------------------------------------*/
+
+static void
+_calcium_echo_pre_write(int comp_id,
+ const char *var_name,
+ cs_calcium_timedep_t time_dep,
+ double cur_time,
+ int iteration,
+ cs_calcium_datatype_t datatype,
+ int n_vals)
+{
+ if (_cs_calcium_n_echo < 0)
+ return;
+
+ assert(var_name != NULL);
+
+ if (_cs_calcium_component[comp_id] != NULL)
+ bft_printf(_("\nComponent %d [%p]:\n"),
+ comp_id, _cs_calcium_component[comp_id]);
+ else
+ bft_printf(_("\nComponent %d:\n"), comp_id);
+
+ bft_printf(_("Writing %d values of type %s, time_dependency %s\n"
+ " (time %f, iteration %d) ..."),
+ n_vals, cs_calcium_datatype_name[datatype],
+ cs_calcium_timedep_name[time_dep], cur_time, iteration);
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Print message indicating that we are finished writing data, and optionnaly
+ * print a part of the corresponding data.
+ *
+ * parameters:
+ * datatype <-- section data type
+ * n_val <-- number of values in array
+ * val <-- array values
+ *----------------------------------------------------------------------------*/
+
+static void
+_calcium_echo_post_write(cs_calcium_datatype_t datatype,
+ int n_val,
+ const void *val)
+{
+ if (_cs_calcium_n_echo < 0)
+ return;
+
+ bft_printf(_("[ok]\n"));
+
+ _calcium_echo_body(datatype, _cs_calcium_n_echo, n_val, val);
+}
+
+/*----------------------------------------------------------------------------
+ * Call CALCIUM-type connection through inter-process communication
+ * with a proxy.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * s --> name of calling instance
+ * (CS_CALCIUM_INSTANCE_LEN chars max)
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+static int
+_proxy_comm_connect(int comp_id,
+ char *s)
+{
+ int retval = 0;
+
+ char *string_out[] = {s};
+
+ cs_proxy_comm_write_request("cp_cd", comp_id,
+ 0, 0, 0, NULL, NULL, NULL);
+
+ retval = cs_proxy_comm_read_response(0, 0, 1, NULL, NULL, string_out);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Call CALCIUM-type disconnection through inter-process communication
+ * with a proxy.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * cont <-- continuation directive
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+static int
+_proxy_comm_disconnect(int comp_id,
+ int cont)
+{
+ int retval = 0;
+
+ const int int_in[] = {cont};
+
+ cs_proxy_comm_write_request("cp_fin", comp_id,
+ 1, 0, 0, int_in, NULL, NULL);
+
+ retval = cs_proxy_comm_read_response(0, 0, 0,
+ NULL, NULL, NULL);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Base function for reading values, relaying the CALCIUM-type call through
+ * inter-process communication with a proxy.
+ *
+ * parameters:
+ * func_name <-- associated function name
+ * blocking <-- use blocking variant (1) or non-blocking (0)
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * min_time <-> lower bound of read interval
+ * max_time <-- upper bound of read interval
+ * iteration <-> iteration number of read
+ * var_name <-- name of the variable to read
+ * n_val_max <-- maximum number of values to read
+ * n_val_read <-- maximum number of values to read
+ * val --> values read
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+static int
+_proxy_comm_read_any(const char *func_name,
+ int blocking,
+ int comp_id,
+ int time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ const char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ size_t type_size,
+ void *val)
+{
+ int retval = 0;
+
+ int int_out[2];
+ double double_out[1];
+
+ const int int_in[] = {time_dep, *iteration, n_val_max};
+ const double double_in[] = {*min_time, *max_time};
+ const char *string_in[] = {var_name};
+
+ cs_proxy_comm_write_request(func_name, comp_id,
+ 3, 2, 1,
+ int_in, double_in, string_in);
+
+ retval = cs_proxy_comm_read_response(2, 1, 0,
+ int_out, double_out, NULL);
+
+ if (blocking == 0 && retval == 13) /* 13: CPATTENTE */
+ return retval;
+
+ *min_time = double_out[0];
+ *iteration = int_out[0];
+ *n_val_read = int_out[1];
+
+ if (*n_val_read > 0)
+ cs_proxy_comm_read(val, type_size, *n_val_read);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Base function for writing values, relaying the CALCIUM-type call through
+ * inter-process communication with a proxy.
+ *
+ * parameters:
+ * func_name <-- associated function name
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * cur_time <-- current time
+ * iteration <-> iteration number of read
+ * var_name <-- name of the variable to read
+ * n_val <-- maximum number of values to write
+ * val <-- values written
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+static int
+_proxy_comm_write_any(const char *func_name,
+ int comp_id,
+ int time_dep,
+ double cur_time,
+ int iteration,
+ const char *var_name,
+ int n_val,
+ size_t type_size,
+ void *val)
+{
+ int retval = 0;
+
+ const int int_in[] = {time_dep, iteration, n_val};
+ const double double_in[] = {cur_time};
+ const char *string_in[] = {var_name};
+
+ cs_proxy_comm_write_request(func_name, comp_id,
+ 3, 1, 1,
+ int_in, double_in, string_in);
+
+ if (n_val > 0)
+ cs_proxy_comm_write(val, type_size, n_val);
+
+ retval = cs_proxy_comm_read_response(0, 0, 0, NULL, NULL, NULL);
+
+ return retval;
+}
+
+#if defined(HAVE_DLOPEN)
+
+/*----------------------------------------------------------------------------
+ * Get a shared library function pointer
+ *
+ * parameters:
+ * handle <-- pointer to shared library (result of dlopen)
+ * name <-- name of function symbol in library
+ * errors_are_fatal <-- abort if true, silently ignore if false
+ *
+ * returns:
+ * pointer to function in shared library
+ *----------------------------------------------------------------------------*/
+
+static void *
+_get_dl_function_pointer(void *handle,
+ const char *name,
+ cs_bool_t errors_are_fatal)
+{
+ void *retval = NULL;
+ char *error = NULL;
+
+ dlerror(); /* Clear any existing error */
+
+ retval = dlsym(handle, name);
+ error = dlerror();
+
+ if (error != NULL && errors_are_fatal)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error calling dlsym: %s\n"), dlerror());
+
+ return retval;
+}
+
+#endif /* defined(HAVE_DLOPEN)*/
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Connection
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * s --> name of calling instance
+ * (CS_CALCIUM_INSTANCE_LEN chars max)
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_connect(int comp_id,
+ char *s)
+{
+ int retval = 0;
+
+ if (_cs_calcium_connect != NULL)
+ retval = _cs_calcium_connect(_cs_calcium_component[comp_id],
+ s);
+
+ else if (_cs_calcium_comm_proxy)
+ retval = _proxy_comm_connect(comp_id, s);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Disconnection
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * cont --> continuation directive (continue with last values or stop)
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_disconnect(int comp_id,
+ cs_calcium_continuation_t cont)
+{
+ int _cont = _cs_calcium_continuation_map[cont];
+ int retval = 0;
+
+ if (_cs_calcium_disconnect != NULL)
+ retval = _cs_calcium_disconnect(_cs_calcium_component[comp_id],
+ _cont);
+
+ else if (_cs_calcium_comm_proxy)
+ retval = _proxy_comm_disconnect(comp_id, _cont);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Read integer values, blocking until they are available.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * min_time <-> lower bound of read interval
+ * max_time <-- upper bound of read interval
+ * iteration <-> iteration number of read
+ * var_name <-- name of the variable to read
+ * n_val_max <-- maximum number of values to read
+ * n_val_read <-- maximum number of values to read
+ * val --> values read
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_read_int(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ const char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ int val[])
+{
+ char _var_name[CS_CALCIUM_VARIABLE_LEN + 1];
+ int _time_dep = _cs_calcium_timedep_map[time_dep];
+ float _min_time = *min_time;
+ float _max_time = *max_time;
+ int _retval = 0;
+
+ strncpy(_var_name, var_name, CS_CALCIUM_VARIABLE_LEN);
+
+ _calcium_echo_pre_read(comp_id,
+ _var_name, time_dep, *min_time, *max_time, *iteration,
+ CALCIUM_integer, n_val_max);
+
+ if (_cs_calcium_read_int != NULL) {
+ _retval = _cs_calcium_read_int(_cs_calcium_component[comp_id],
+ _time_dep,
+ &_min_time,
+ &_max_time,
+ iteration,
+ _var_name,
+ n_val_max,
+ n_val_read,
+ val);
+ *min_time = _min_time;
+ *max_time = _max_time;
+ }
+
+ else if (_cs_calcium_comm_proxy)
+ _retval = _proxy_comm_read_any("cp_len", 1, comp_id,
+ _time_dep, min_time, max_time, iteration,
+ _var_name, n_val_max, n_val_read,
+ sizeof(int), val);
+
+ _calcium_echo_post_read(*min_time, *iteration,
+ CALCIUM_integer, *n_val_read, val);
+
+ return _retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Read single-precision floating-point values,
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * min_time <-> lower bound of read interval
+ * max_time <-- upper bound of read interval
+ * iteration <-> iteration number of read
+ * var_name <-- name of the variable to read
+ * n_val_max <-- maximum number of values to read
+ * n_val_read <-- maximum number of values to read
+ * val --> values read
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_read_float(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ const char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ float val[])
+{
+ char _var_name[CS_CALCIUM_VARIABLE_LEN + 1];
+ int _time_dep = _cs_calcium_timedep_map[time_dep];
+ float _min_time = *min_time;
+ float _max_time = *max_time;
+ int _retval = 0;
+
+ strncpy(_var_name, var_name, CS_CALCIUM_VARIABLE_LEN);
+
+ _calcium_echo_pre_read(comp_id,
+ _var_name, time_dep, *min_time, *max_time, *iteration,
+ CALCIUM_real, n_val_max);
+
+ if (_cs_calcium_read_float != NULL) {
+ _retval = _cs_calcium_read_float(_cs_calcium_component[comp_id],
+ _time_dep,
+ &_min_time,
+ &_max_time,
+ iteration,
+ _var_name,
+ n_val_max,
+ n_val_read,
+ val);
+ *min_time = _min_time;
+ *max_time = _max_time;
+ }
+
+ else if (_cs_calcium_comm_proxy)
+ _retval = _proxy_comm_read_any("cp_lre", 1, comp_id,
+ _time_dep, min_time, max_time, iteration,
+ _var_name, n_val_max, n_val_read,
+ sizeof(float), val);
+
+ _calcium_echo_post_read(*min_time, *iteration,
+ CALCIUM_real, *n_val_read, val);
+
+ return _retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Read double-precision floating-point values,
+ * blocking until they are available.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * min_time <-> lower bound of read interval
+ * max_time <-- upper bound of read interval
+ * iteration <-> iteration number of read
+ * var_name <-- name of the variable to read
+ * n_val_max <-- maximum number of values to read
+ * n_val_read <-- maximum number of values to read
+ * val --> values read
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_read_double(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double *min_time,
+ double *max_time,
+ int *iteration,
+ const char *var_name,
+ int n_val_max,
+ int *n_val_read,
+ double val[])
+{
+ char _var_name[CS_CALCIUM_VARIABLE_LEN + 1];
+ int _time_dep = _cs_calcium_timedep_map[time_dep];
+ int _retval = 0;
+
+ strncpy(_var_name, var_name, CS_CALCIUM_VARIABLE_LEN);
+
+ _calcium_echo_pre_read(comp_id,
+ _var_name, time_dep, *min_time, *max_time, *iteration,
+ CALCIUM_double, n_val_max);
+
+ if (_cs_calcium_read_double != NULL)
+ _retval = _cs_calcium_read_double(_cs_calcium_component[comp_id],
+ _time_dep,
+ min_time,
+ max_time,
+ iteration,
+ _var_name,
+ n_val_max,
+ n_val_read,
+ val);
+
+ else if (_cs_calcium_comm_proxy)
+ _retval = _proxy_comm_read_any("cp_ldb", 1, comp_id,
+ _time_dep, min_time, max_time, iteration,
+ _var_name, n_val_max, n_val_read,
+ sizeof(double), val);
+
+ _calcium_echo_post_read(*min_time, *iteration,
+ CALCIUM_double, *n_val_read, val);
+
+ return _retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Write integer values.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * cur_time <-- current time
+ * iteration <-- iteration number
+ * var_name <-- name of the variable to read
+ * n_val <-- number of values to read
+ * val <-- values written
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_write_int(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double cur_time,
+ int iteration,
+ const char *var_name,
+ int n_val,
+ const int val[])
+{
+ char _var_name[CS_CALCIUM_VARIABLE_LEN + 1];
+ int _time_dep = _cs_calcium_timedep_map[time_dep];
+ int *_val = NULL;
+
+ int retval = 0;
+
+ strncpy(_var_name, var_name, CS_CALCIUM_VARIABLE_LEN);
+
+ _calcium_echo_pre_write(comp_id,
+ _var_name, time_dep, cur_time, iteration,
+ CALCIUM_integer, n_val);
+
+ BFT_MALLOC(_val, n_val, int);
+ memcpy(_val, val, n_val * sizeof(int));
+
+ if (_cs_calcium_write_int != NULL)
+ retval = _cs_calcium_write_int(_cs_calcium_component[comp_id],
+ _time_dep,
+ cur_time,
+ iteration,
+ _var_name,
+ n_val,
+ _val);
+
+ else if (_cs_calcium_comm_proxy)
+ _proxy_comm_write_any("cp_een", comp_id, _time_dep,
+ cur_time, iteration, _var_name,
+ n_val, sizeof(int), _val);
+
+ BFT_FREE(_val);
+
+ _calcium_echo_post_write(CALCIUM_integer, n_val, val);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Write float values.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * cur_time <-- current time
+ * iteration <-- iteration number
+ * var_name <-- name of the variable to read
+ * n_val <-- number of values to read
+ * val <-- values written
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_write_float(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double cur_time,
+ int iteration,
+ const char *var_name,
+ int n_val,
+ const float val[])
+{
+ char _var_name[CS_CALCIUM_VARIABLE_LEN + 1];
+ int _time_dep = _cs_calcium_timedep_map[time_dep];
+ float *_val = NULL;
+
+ int retval = 0;
+
+ strncpy(_var_name, var_name, CS_CALCIUM_VARIABLE_LEN);
+
+ _calcium_echo_pre_write(comp_id,
+ _var_name, time_dep, cur_time, iteration,
+ CALCIUM_real, n_val);
+
+ BFT_MALLOC(_val, n_val, float);
+ memcpy(_val, val, n_val * sizeof(float));
+
+ if (_cs_calcium_write_float != NULL)
+ retval = _cs_calcium_write_float(_cs_calcium_component[comp_id],
+ _time_dep,
+ cur_time,
+ iteration,
+ _var_name,
+ n_val,
+ _val);
+
+ else if (_cs_calcium_comm_proxy)
+ _proxy_comm_write_any("cp_ere", comp_id, _time_dep,
+ cur_time, iteration, _var_name,
+ n_val, sizeof(float), _val);
+
+ BFT_FREE(_val);
+
+ _calcium_echo_post_write(CALCIUM_real, n_val, val);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Write double-precision float values.
+ *
+ * parameters:
+ * comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
+ * time_dep <-- type of time dependency (time or iteration)
+ * cur_time <-- current time
+ * iteration <-- iteration number
+ * var_name <-- name of the variable to read
+ * n_val <-- number of values to read
+ * val <-- values written
+ *
+ * returns:
+ * 0 in case of success, error code otherwise
+ *----------------------------------------------------------------------------*/
+
+int
+cs_calcium_write_double(int comp_id,
+ cs_calcium_timedep_t time_dep,
+ double cur_time,
+ int iteration,
+ const char *var_name,
+ int n_val,
+ const double val[])
+{
+ char _var_name[CS_CALCIUM_VARIABLE_LEN + 1];
+ int _time_dep = _cs_calcium_timedep_map[time_dep];
+ double *_val = NULL;
+
+ int retval = 0;
+
+ strncpy(_var_name, var_name, CS_CALCIUM_VARIABLE_LEN);
+
+ _calcium_echo_pre_write(comp_id,
+ _var_name, time_dep, cur_time, iteration,
+ CALCIUM_double, n_val);
+
+ BFT_MALLOC(_val, n_val, double);
+ memcpy(_val, val, n_val * sizeof(double));
+
+ if (_cs_calcium_write_double != NULL)
+ retval = _cs_calcium_write_double(_cs_calcium_component[comp_id],
+ _time_dep,
+ cur_time,
+ iteration,
+ _var_name,
+ n_val,
+ _val);
+
+ else if (_cs_calcium_comm_proxy)
+ _proxy_comm_write_any("cp_edb", comp_id, _time_dep,
+ cur_time, iteration, _var_name,
+ n_val, sizeof(double), _val);
+
+ BFT_FREE(_val);
+
+ _calcium_echo_post_write(CALCIUM_double, n_val, val);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Assign a component and its id
+ *
+ * parameters:
+ * comp_id <-- id of component (0 to n-1, Code_Saturne local)
+ * comp <-- pointer to component
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_set_component(int comp_id,
+ void *comp)
+{
+ assert(comp_id > -1 && comp_id < 8); /* Current limit, easily made dynamic */
+
+ _cs_calcium_component[comp_id] = comp;
+}
+
+/*----------------------------------------------------------------------------
+ * Set proxy IPC communication mode
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_set_comm_proxy(void)
+{
+ _cs_calcium_comm_proxy = 1;
+}
+
+/*----------------------------------------------------------------------------
+ * Set the CALCIUM-mappable function's verbosity
+ *
+ * parameters:
+ * n_echo <-- verbosity (none if -1, headers if 0,
+ * headers + n first and last elements if > 0.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_set_verbosity(int n_echo)
+{
+ _cs_calcium_n_echo = n_echo;
+}
+
+/*----------------------------------------------------------------------------
+ * Load YACS and corresponding Calcium functions.
+ *
+ * parameters:
+ * lib_path <-- path to shared library containing the yacsinit() function.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_load_yacs(const char *lib_path)
+{
+#if defined(HAVE_DLOPEN)
+
+ /* Load symbols from shared library */
+
+ _cs_calcium_yacslib = dlopen(lib_path, RTLD_LAZY);
+
+ if (_cs_calcium_yacslib == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error loading %s: %s."), lib_path, dlerror());
+
+ _cs_calcium_yacsinit
+ = _get_dl_function_pointer(_cs_calcium_yacslib, "yacsinit", true);
+
+ _cs_calcium_read_int
+ = _get_dl_function_pointer(_cs_calcium_yacslib, "cp_len", true);
+
+ _cs_calcium_write_int
+ = _get_dl_function_pointer(_cs_calcium_yacslib, "cp_een", true);
+
+ _cs_calcium_read_float
+ = _get_dl_function_pointer(_cs_calcium_yacslib, "cp_lre", true);
+
+ _cs_calcium_write_float
+ = _get_dl_function_pointer(_cs_calcium_yacslib, "cp_ere", true);
+
+ _cs_calcium_read_double
+ = _get_dl_function_pointer(_cs_calcium_yacslib, "cp_ldb", true);
+
+ _cs_calcium_write_double
+ = _get_dl_function_pointer(_cs_calcium_yacslib, "cp_edb", true);
+
+ if ( _cs_calcium_yacsinit == NULL
+ || _cs_calcium_read_int == NULL
+ || _cs_calcium_write_int == NULL
+ || _cs_calcium_read_float == NULL
+ || _cs_calcium_write_float == NULL
+ || _cs_calcium_read_double== NULL
+ || _cs_calcium_write_double == NULL) {
+ dlclose(_cs_calcium_yacslib);
+ _cs_calcium_yacslib = NULL;
+ }
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Shared library support not available.\n"
+ "Unable to load: %s\n"), lib_path);
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Unload YACS and corresponding Calcium functions
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_unload_yacs(void)
+{
+#if defined(HAVE_DLOPEN)
+
+ if (_cs_calcium_yacslib != NULL)
+ dlclose(_cs_calcium_yacslib);
+
+ /* Reset function pointers to NULL */
+
+ _cs_calcium_yacslib = NULL;
+
+ _cs_calcium_yacsinit = NULL;
+
+ _cs_calcium_read_int = NULL;
+ _cs_calcium_write_int = NULL;
+ _cs_calcium_read_float = NULL;
+ _cs_calcium_write_float = NULL;
+ _cs_calcium_read_double = NULL;
+ _cs_calcium_write_double = NULL;
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize YACS component and enter event loop.
+ *
+ * This must be called after cs_calcium_load_yacs().
+ *
+ * Note that the YACS event loop does not return, sot the YACS component
+ * description should ensure that the code's main run() method (or similar)
+ * is called in the component body.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_calcium_start_yacs(void)
+{
+ if (_cs_calcium_yacslib != NULL)
+ _cs_calcium_yacsinit();
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_coupling.c b/src/base/cs_coupling.c
new file mode 100644
index 0000000..b75d8f8
--- /dev/null
+++ b/src/base/cs_coupling.c
@@ -0,0 +1,190 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Common functionnality for various coupling types.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_coupling.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+#if defined(FVM_HAVE_MPI)
+
+static int _cs_glob_coupling_mpi_app_num = -1;
+static fvm_coupling_mpi_world_t *_cs_glob_coupling_mpi_app_world = NULL;
+
+#endif
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Discover other applications in the same MPI root communicator.
+ *
+ * parameters:
+ * app_num <-- application number for this instance of Code_Saturne (>= 0)
+ * app_name <-- optional name of this instance of Code_Saturne, or NULL.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_coupling_discover_mpi_apps(int app_num,
+ const char *app_name)
+{
+ if (app_num > -1 && cs_glob_mpi_comm != MPI_COMM_WORLD) {
+
+ int i, n_apps, app_id;
+
+ _cs_glob_coupling_mpi_app_num = app_num;
+
+ /* App_type contains a string such as
+ "Code_Saturne 1.4.0" or "NEPTUNE_CFD 1.2.1" */
+
+ const char app_type[] = CS_APP_NAME " " CS_APP_VERSION;
+
+ if (cs_glob_rank_id < 1) {
+ bft_printf(_("\n"
+ "Applications accessible through MPI:\n"
+ "------------------------------------\n\n"));
+ bft_printf_flush();
+ }
+
+ _cs_glob_coupling_mpi_app_world
+ = fvm_coupling_mpi_world_create(app_num,
+ app_type,
+ app_name,
+ cs_glob_mpi_comm);
+
+ n_apps = fvm_coupling_mpi_world_n_apps(_cs_glob_coupling_mpi_app_world);
+ app_id = fvm_coupling_mpi_world_get_app_id(_cs_glob_coupling_mpi_app_world);
+
+ if (cs_glob_rank_id < 1) {
+
+ const char local_add[] = " (this instance)";
+ const char nolocal_add[] = "";
+
+ for (i = 0; i< n_apps; i++) {
+ const char *is_local = nolocal_add;
+ fvm_coupling_mpi_world_info_t
+ ai = fvm_coupling_mpi_world_get_info(_cs_glob_coupling_mpi_app_world,
+ i);
+ if (i == app_id)
+ is_local = local_add;
+ bft_printf(_(" %d; type: \"%s\"%s\n"
+ " case name: \"%s\"\n"
+ " lead rank: %d; n_ranks: %d\n\n"),
+ ai.app_num, ai.app_type, is_local,
+ ai.app_name, ai.root_rank, ai.n_ranks);
+ }
+
+ bft_printf_flush();
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize MPI coupling helper structures.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_coupling_finalize(void)
+{
+ if (_cs_glob_coupling_mpi_app_world != NULL)
+ fvm_coupling_mpi_world_destroy(&_cs_glob_coupling_mpi_app_world);
+}
+
+/*----------------------------------------------------------------------------
+ * Return info on other applications in the same MPI root communicator.
+ *
+ * returns:
+ * info on other applications structure.
+ *----------------------------------------------------------------------------*/
+
+const fvm_coupling_mpi_world_t *
+cs_coupling_get_mpi_apps(void)
+{
+ return _cs_glob_coupling_mpi_app_world;
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_ext_neighborhood.c b/src/base/cs_ext_neighborhood.c
new file mode 100644
index 0000000..0eb658a
--- /dev/null
+++ b/src/base/cs_ext_neighborhood.c
@@ -0,0 +1,1363 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Fortran interfaces of functions needing a synchronization of the extended
+ * neighborhood.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_halo.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ext_neighborhood.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definition
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Extract a mesh's "cell -> internal faces" connectivity.
+ *
+ * parameters:
+ * mesh --> pointer to a cs_mesh_t structure
+ * p_cell_i_faces_idx <-- pointer to the "cell -> faces" connectivity index
+ * (1 to n numbering)
+ * p_cell_i_faces_lst <-- pointer to the "cell -> faces" connectivity list
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_cell_i_faces_connectivity(const cs_mesh_t *mesh,
+ cs_int_t * *const p_cell_i_faces_idx,
+ cs_int_t * *const p_cell_i_faces_lst)
+{
+
+ cs_int_t i, j, j1, j2;
+
+ cs_int_t *cell_faces_count = NULL;
+ cs_int_t *cell_faces_idx = NULL;
+ cs_int_t *cell_faces_lst = NULL;
+
+ /* Allocate and initialize index */
+
+ BFT_MALLOC(cell_faces_idx, mesh->n_cells + 1, cs_int_t);
+
+ for (i = 0 ; i < mesh->n_cells + 1 ; i++)
+ cell_faces_idx[i] = 0;
+
+ /* Count number of faces per cell (we assign the temporary counter
+ * to i and cell_faces_idx[i + 1] instead of cell_faces_idx[i]
+ * to simplify the next stage) */
+
+ /* Note: test if j < mesh->n_cells on internal faces to ignore
+ parallel and/or periodic ghost cells */
+
+ for (i = 0 ; i < mesh->n_i_faces ; i++) {
+ j1 = mesh->i_face_cells[i*2 ] - 1;
+ j2 = mesh->i_face_cells[i*2 + 1] - 1;
+ if (j1 < mesh->n_cells)
+ cell_faces_idx[j1 + 1] += 1;
+ if (j2 < mesh->n_cells)
+ cell_faces_idx[j2 + 1] += 1;
+ }
+
+ /* Build position index */
+
+ cell_faces_idx[0] = 1;
+ for (j = 0 ; j < mesh->n_cells ; j++)
+ cell_faces_idx[j + 1] = cell_faces_idx[j] + cell_faces_idx[j + 1];
+
+ /* Build array of values */
+
+ BFT_MALLOC(cell_faces_lst, cell_faces_idx[mesh->n_cells] - 1, cs_int_t);
+ BFT_MALLOC(cell_faces_count, mesh->n_cells, cs_int_t);
+
+ for (i = 0 ; i < mesh->n_cells ; i++)
+ cell_faces_count[i] = 0;
+
+ for (i = 0 ; i < mesh->n_i_faces ; i++) {
+ j1 = mesh->i_face_cells[i*2 ] - 1;
+ j2 = mesh->i_face_cells[i*2 + 1] - 1;
+ if (j1 < mesh->n_cells) {
+ cell_faces_lst[cell_faces_idx[j1] + cell_faces_count[j1] - 1] = i + 1;
+ cell_faces_count[j1] += 1;
+ }
+ if (j2 < mesh->n_cells) {
+ cell_faces_lst[cell_faces_idx[j2] + cell_faces_count[j2] - 1] = -(i + 1);
+ cell_faces_count[j2] += 1;
+ }
+ }
+
+ BFT_FREE(cell_faces_count);
+
+ /* Set return values */
+
+ *p_cell_i_faces_idx = cell_faces_idx;
+ *p_cell_i_faces_lst = cell_faces_lst;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Create a "vertex -> cells" connectivity.
+ *
+ * parameters:
+ * mesh --> pointer to a cs_mesh_t structure
+ * p_vtx_cells_idx <-- pointer to the "vtx -> cells" connectivity index
+ * p_vtx_cells_lst <-- pointer to the "vtx -> cells" connectivity list
+ *----------------------------------------------------------------------------*/
+
+static void
+_create_vtx_cells_connect(cs_mesh_t *mesh,
+ cs_int_t *p_vtx_cells_idx[],
+ cs_int_t *p_vtx_cells_lst[])
+{
+ cs_int_t i, j, idx;
+ cs_int_t vtx_id, face_id, cell_num;
+
+ cs_bool_t already_seen;
+
+ cs_int_t vtx_cells_connect_size = 0;
+
+ cs_int_t *vtx_faces_idx = NULL, *vtx_faces_lst = NULL;
+ cs_int_t *vtx_cells_idx = NULL, *vtx_cells_lst = NULL;
+
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t n_faces = mesh->n_i_faces;
+ const cs_int_t *face_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *face_vtx_lst = mesh->i_face_vtx_lst;
+ const cs_int_t *face_cells = mesh->i_face_cells;
+
+ cs_int_t vtx_cells_estimated_connect_size = 3 * n_vertices;
+
+ BFT_MALLOC(vtx_cells_idx, n_vertices + 1, cs_int_t);
+ BFT_MALLOC(vtx_faces_idx, n_vertices + 1, cs_int_t);
+
+ for (vtx_id = 0; vtx_id < n_vertices + 1; vtx_id++) {
+ vtx_cells_idx[vtx_id] = 0;
+ vtx_faces_idx[vtx_id] = 0;
+ }
+
+ /* Define vtx -> faces connectivity index */
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+
+ for (i = face_vtx_idx[face_id] - 1; i < face_vtx_idx[face_id+1] - 1; i++) {
+ vtx_id = face_vtx_lst[i] - 1;
+ vtx_faces_idx[vtx_id + 1] += 1;
+ }
+
+ } /* End of loop on faces */
+
+ vtx_faces_idx[0] = 1;
+ for (vtx_id = 0; vtx_id < n_vertices; vtx_id++)
+ vtx_faces_idx[vtx_id + 1] += vtx_faces_idx[vtx_id];
+
+ /* Allocation and definiton of "vtx -> faces" connectivity list */
+
+ BFT_MALLOC(vtx_faces_lst, vtx_faces_idx[n_vertices] - 1, cs_int_t);
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+
+ for (i = face_vtx_idx[face_id] - 1; i < face_vtx_idx[face_id+1] - 1; i++) {
+
+ vtx_id = face_vtx_lst[i] - 1;
+ vtx_faces_lst[vtx_faces_idx[vtx_id]-1] = face_id + 1;
+ vtx_faces_idx[vtx_id] += 1;
+
+ }
+
+ } /* End of loop on faces */
+
+ for (vtx_id = n_vertices; vtx_id > 0; vtx_id--)
+ vtx_faces_idx[vtx_id] = vtx_faces_idx[vtx_id-1];
+ vtx_faces_idx[0] = 1;
+
+ /* Define "vertex -> cells" connectivity.
+ Use "vertex -> faces" connectivity and "face -> cells" connectivity */
+
+ BFT_MALLOC(vtx_cells_lst, vtx_cells_estimated_connect_size, cs_int_t);
+
+ vtx_cells_idx[0] = 1;
+
+ for (vtx_id = 0; vtx_id < n_vertices; vtx_id++) {
+
+ for (i = vtx_faces_idx[vtx_id] - 1; i < vtx_faces_idx[vtx_id+1] - 1; i++) {
+
+ face_id = vtx_faces_lst[i] - 1;
+
+ for (j = 0; j < 2; j++) { /* For the cells sharing this face */
+
+ cell_num = face_cells[2*face_id + j];
+
+ already_seen = false;
+ idx = vtx_cells_idx[vtx_id] - 1;
+
+ while ((already_seen == false) && (idx < vtx_cells_connect_size)) {
+ if (cell_num == vtx_cells_lst[idx])
+ already_seen = true;
+ idx++;
+ }
+
+ if (already_seen == false) {
+
+ if (vtx_cells_connect_size + 1 > vtx_cells_estimated_connect_size) {
+ vtx_cells_estimated_connect_size *= 2;
+ BFT_REALLOC(vtx_cells_lst,
+ vtx_cells_estimated_connect_size, cs_int_t);
+ }
+
+ vtx_cells_lst[vtx_cells_connect_size] = cell_num;
+ vtx_cells_connect_size += 1;
+
+ }
+
+ } /* End of loop on cells sharing this face */
+
+ } /* End of loop on faces sharing this vertex */
+
+ vtx_cells_idx[vtx_id+1] = vtx_cells_connect_size + 1;
+
+ } /* End of loop on vertices */
+
+ BFT_REALLOC(vtx_cells_lst, vtx_cells_connect_size, cs_int_t);
+
+ /* Free memory */
+
+ BFT_FREE(vtx_faces_idx);
+ BFT_FREE(vtx_faces_lst);
+
+ *p_vtx_cells_idx = vtx_cells_idx;
+ *p_vtx_cells_lst = vtx_cells_lst;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Create a "vertex -> cells" connectivity.
+ *
+ * parameters:
+ * face_id --> identification number for the face
+ * cell_id --> identification number for the cell sharing this face
+ * mesh --> pointer to a cs_mesh_t structure
+ * vtx_cells_idx <-- pointer to the "vtx -> cells" connectivity index
+ * vtx_cells_lst <-- pointer to the "vtx -> cells" connectivity list
+ * vtx_gcells_idx <-- pointer to the "vtx -> gcells" connectivity index
+ * vtx_gcells_lst <-- pointer to the "vtx -> gcells" connectivity list
+ *----------------------------------------------------------------------------*/
+
+static void
+_tag_cells(cs_int_t face_id,
+ cs_int_t cell_id,
+ cs_mesh_t *mesh,
+ cs_int_t vtx_cells_idx[],
+ cs_int_t vtx_cells_lst[],
+ cs_int_t vtx_gcells_idx[],
+ cs_int_t vtx_gcells_lst[])
+{
+ cs_int_t i, j, k;
+ cs_int_t vtx_id, ext_cell_num, cell_num;
+
+ cs_int_t *cell_cells_lst = mesh->cell_cells_lst;
+ cs_int_t *cell_cells_idx = mesh->cell_cells_idx;
+
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t *face_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *face_vtx_lst = mesh->i_face_vtx_lst;
+
+ if (cell_id < n_cells) {
+
+ for (i = cell_cells_idx[cell_id] - 1;
+ i < cell_cells_idx[cell_id+1] - 1;
+ i++) {
+
+ ext_cell_num = cell_cells_lst[i];
+
+ /* For cell not tagged yet */
+
+ if (ext_cell_num > 0) {
+
+ /* Cells sharing a vertex with the face */
+
+ for (j = face_vtx_idx[face_id] - 1;
+ j < face_vtx_idx[face_id+1] - 1;
+ j++) {
+
+ vtx_id = face_vtx_lst[j] - 1;
+
+ if (ext_cell_num <= n_cells) { /* true cell */
+
+ for (k = vtx_cells_idx[vtx_id] - 1;
+ k < vtx_cells_idx[vtx_id+1] - 1;
+ k++) {
+
+ cell_num = vtx_cells_lst[k];
+
+ /* Comparison and selection */
+
+ if (cell_num == ext_cell_num && cell_cells_lst[i] > 0)
+ cell_cells_lst[i] = - cell_cells_lst[i];
+
+ } /* End of loop on cells sharing this vertex */
+
+ }
+ else { /* ext_cell_num >= n_cells; i.e. ghost cell */
+
+ for (k = vtx_gcells_idx[vtx_id];
+ k < vtx_gcells_idx[vtx_id+1];
+ k++) {
+
+ cell_num = vtx_gcells_lst[k] + n_cells + 1;
+
+ /* Comparison and selection */
+
+ if (cell_num == ext_cell_num && cell_cells_lst[i] > 0)
+ cell_cells_lst[i] = - cell_cells_lst[i];
+
+ }
+
+ }
+
+ } /* End of loop on vertices of the face */
+
+ }
+
+ } /* End of loop on cells in the extended neighborhood */
+
+ } /* End if cell_id < n_cells */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Reverse "ghost cell -> vertex" connectivity into "vertex -> ghost cells"
+ * connectivity for halo elements.
+ * Build the connectivity index.
+ *
+ * parameters:
+ * halo --> pointer to a cs_halo_t structure
+ * rank_id --> rank number to work with
+ * checker <-> temporary array to check vertices
+ * gcell_vtx_idx --> "ghost cell -> vertices" connectivity index
+ * gcell_vtx_lst --> "ghost cell -> vertices" connectivity list
+ * vtx_gcells_idx <-> "vertex -> ghost cells" connectivity index
+ *---------------------------------------------------------------------------*/
+
+static void
+_reverse_connectivity_idx(cs_halo_t *halo,
+ cs_int_t n_vertices,
+ cs_int_t rank_id,
+ cs_int_t *checker,
+ cs_int_t *gcell_vtx_idx,
+ cs_int_t *gcell_vtx_lst,
+ cs_int_t *vtx_gcells_idx)
+{
+ cs_int_t i, j, id, vtx_id, start_idx, end_idx;
+
+ /* Initialize index */
+
+ vtx_gcells_idx[0] = 0;
+ for (i = 0; i < n_vertices; i++) {
+ vtx_gcells_idx[i+1] = 0;
+ checker[i] = -1;
+ }
+
+ if (rank_id == -1) {
+ start_idx = 0;
+ end_idx = halo->n_elts[CS_HALO_EXTENDED];
+ }
+ else { /* Call with rank_id > 1 for standard halo */
+ start_idx = halo->index[2*rank_id];
+ end_idx = halo->index[2*rank_id+1];
+ }
+
+ /* Define index */
+
+ for (id = start_idx; id < end_idx; id++) {
+
+ for (j = gcell_vtx_idx[id]; j < gcell_vtx_idx[id+1]; j++) {
+
+ vtx_id = gcell_vtx_lst[j] - 1;
+
+ if (checker[vtx_id] != id) {
+ checker[vtx_id] = id;
+ vtx_gcells_idx[vtx_id+1] += 1;
+ }
+
+ }
+
+ } /* End of loop of ghost cells */
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_gcells_idx[i+1] += vtx_gcells_idx[i];
+
+}
+
+/*---------------------------------------------------------------------------
+ * Reverse "ghost cells -> vertex" connectivity into "vertex -> ghost cells"
+ * connectivity for halo elements.
+ * Build the connectivity list.
+ *
+ * parameters:
+ * halo --> pointer to a cs_halo_t structure
+ * n_vertices --> number of vertices
+ * rank_id --> rank number to work with
+ * counter <-> temporary array to count vertices
+ * checker <-> temporary array to check vertices
+ * gcell_vtx_idx --> "ghost cell -> vertices" connectivity index
+ * gcell_vtx_lst --> "ghost cell -> vertices" connectivity list
+ * vtx_gcells_idx --> "vertex -> ghost cells" connectivity index
+ * vtx_gcells_lst <-> "vertex -> ghost cells" connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_reverse_connectivity_lst(cs_halo_t *halo,
+ cs_int_t n_vertices,
+ cs_int_t rank_id,
+ cs_int_t *counter,
+ cs_int_t *checker,
+ cs_int_t *gcell_vtx_idx,
+ cs_int_t *gcell_vtx_lst,
+ cs_int_t *vtx_gcells_idx,
+ cs_int_t *vtx_gcells_lst)
+{
+ cs_int_t i, j, id, shift, vtx_id, start_idx, end_idx;
+
+ /* Initialize buffers */
+
+ for (i = 0; i < n_vertices; i++) {
+ counter[i] = 0;
+ checker[i] = -1;
+ }
+
+ if (rank_id == -1) {
+ start_idx = 0;
+ end_idx = halo->n_elts[CS_HALO_EXTENDED];
+ }
+ else {
+ start_idx = halo->index[2*rank_id];
+ end_idx = halo->index[2*rank_id+1];
+ }
+
+ /* Fill the connectivity list */
+
+ for (id = start_idx; id < end_idx; id++) {
+
+ for (j = gcell_vtx_idx[id]; j < gcell_vtx_idx[id+1]; j++) {
+
+ vtx_id = gcell_vtx_lst[j] - 1;
+
+ if (checker[vtx_id] != id) {
+
+ checker[vtx_id] = id;
+ shift = vtx_gcells_idx[vtx_id] + counter[vtx_id];
+ vtx_gcells_lst[shift] = id;
+ counter[vtx_id] += 1;
+
+ }
+
+ }
+
+ } /* End of loop of ghost cells */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Create a "vertex -> ghost cells" connectivity.
+ * Add mesh->n_cells to all the elements of vtx_gcells_lst to obtain
+ * the local cell numbering.
+ *
+ * parameters:
+ * halo --> pointer to a cs_halo_t structure
+ * n_vertices --> number of vertices
+ * gcell_vtx_idx --> "ghost cell -> vertices" connectivity index
+ * gcell_vtx_lst --> "ghost cell -> vertices" connectivity list
+ * p_vtx_gcells_idx <-- pointer to "vertex -> ghost cells" index
+ * p_vtx_gcells_lst <-- pointer to "vertex -> ghost cells" list
+ *---------------------------------------------------------------------------*/
+
+static void
+_create_vtx_gcells_connect(cs_halo_t *halo,
+ cs_int_t n_vertices,
+ cs_int_t *gcells_vtx_idx,
+ cs_int_t *gcells_vtx_lst,
+ cs_int_t *p_vtx_gcells_idx[],
+ cs_int_t *p_vtx_gcells_lst[])
+{
+ cs_int_t *vtx_buffer = NULL, *vtx_counter = NULL, *vtx_checker = NULL;
+ cs_int_t *vtx_gcells_idx = NULL, *vtx_gcells_lst = NULL;
+
+ BFT_MALLOC(vtx_buffer, 2*n_vertices, cs_int_t);
+ vtx_counter = &(vtx_buffer[0]);
+ vtx_checker = &(vtx_buffer[n_vertices]);
+
+ BFT_MALLOC(vtx_gcells_idx, n_vertices + 1, cs_int_t);
+
+ /* Create a vertex -> ghost cells connectivity */
+
+ _reverse_connectivity_idx(halo,
+ n_vertices,
+ -1,
+ vtx_checker,
+ gcells_vtx_idx,
+ gcells_vtx_lst,
+ vtx_gcells_idx);
+
+ BFT_MALLOC(vtx_gcells_lst, vtx_gcells_idx[n_vertices], cs_int_t);
+
+ _reverse_connectivity_lst(halo,
+ n_vertices,
+ -1,
+ vtx_counter,
+ vtx_checker,
+ gcells_vtx_idx,
+ gcells_vtx_lst,
+ vtx_gcells_idx,
+ vtx_gcells_lst);
+
+ *p_vtx_gcells_idx = vtx_gcells_idx;
+ *p_vtx_gcells_lst = vtx_gcells_lst;
+
+ /* Free memory */
+
+ BFT_FREE(vtx_buffer);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Create a "vertex -> cells" connectivity.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * cell_i_faces_idx --> "cell -> internal faces" connectivity index
+ * cell_i_faces_lst --> "cell -> internal faces" connectivity list
+ * p_vtx_cells_idx <-- pointer to "vertex -> cells" connectivity index
+ * p_vtx_cells_lst <-- pointer to "vertex -> cells" connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_create_vtx_cells_connect2(cs_mesh_t *mesh,
+ cs_int_t *cell_i_faces_idx,
+ cs_int_t *cell_i_faces_lst,
+ cs_int_t *p_vtx_cells_idx[],
+ cs_int_t *p_vtx_cells_lst[])
+{
+ cs_int_t i, cell_id, fac_id, i_vtx;
+ cs_int_t shift, vtx_id;
+
+ cs_int_t *vtx_buffer = NULL, *vtx_count = NULL, *vtx_tag = NULL;
+ cs_int_t *vtx_cells_idx = NULL, *vtx_cells_lst = NULL;
+
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t *fac_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *fac_vtx_lst = mesh->i_face_vtx_lst;
+
+ /* Initialize buffers */
+
+ BFT_MALLOC(vtx_buffer, 2*n_vertices, cs_int_t);
+ BFT_MALLOC(vtx_cells_idx, n_vertices + 1, cs_int_t);
+
+ vtx_count = &(vtx_buffer[0]);
+ vtx_tag = &(vtx_buffer[n_vertices]);
+
+ vtx_cells_idx[0] = 0;
+ for (i = 0; i < n_vertices; i++) {
+
+ vtx_cells_idx[i + 1] = 0;
+ vtx_tag[i] = -1;
+ vtx_count[i] = 0;
+
+ }
+
+ /* Define index */
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ for (i = cell_i_faces_idx[cell_id]; i < cell_i_faces_idx[cell_id+1]; i++) {
+
+ fac_id = CS_ABS(cell_i_faces_lst[i-1]) - 1;
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id+1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx-1] - 1;
+
+ if (vtx_tag[vtx_id] != cell_id) {
+
+ vtx_cells_idx[vtx_id+1] += 1;
+ vtx_tag[vtx_id] = cell_id;
+
+ } /* Add this cell to the connectivity of the vertex */
+
+ } /* End of loop on vertices */
+
+ } /* End of loop on cell's faces */
+
+ } /* End of loop on cells */
+
+ for (i = 0; i < n_vertices; i++) {
+
+ vtx_cells_idx[i+1] += vtx_cells_idx[i];
+ vtx_tag[i] = -1;
+
+ }
+
+ BFT_MALLOC(vtx_cells_lst, vtx_cells_idx[n_vertices], cs_int_t);
+
+ /* Fill list */
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ for (i = cell_i_faces_idx[cell_id]; i < cell_i_faces_idx[cell_id+1]; i++) {
+
+ fac_id = CS_ABS(cell_i_faces_lst[i-1]) - 1;
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id+1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx-1] - 1;
+
+ if (vtx_tag[vtx_id] != cell_id) {
+
+ shift = vtx_cells_idx[vtx_id] + vtx_count[vtx_id];
+ vtx_tag[vtx_id] = cell_id;
+ vtx_cells_lst[shift] = cell_id;
+ vtx_count[vtx_id] += 1;
+
+ } /* Add this cell to the connectivity of the vertex */
+
+ } /* End of loop on vertices */
+
+ } /* End of loop on cell's faces */
+
+ } /* End of loop on cells */
+
+ BFT_FREE(vtx_buffer);
+
+ *p_vtx_cells_idx = vtx_cells_idx;
+ *p_vtx_cells_lst = vtx_cells_lst;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Create a "cell -> cells" connectivity.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * cell_i_faces_idx --> "cell -> faces" connectivity index
+ * cell_i_faces_lst --> "cell -> faces" connectivity list
+ * vtx_gcells_idx <-- "vertex -> ghost cells" connectivity index
+ * vtx_gcells_lst <-- "vertex -> ghost cells" connectivity list
+ * vtx_cells_idx <-- "vertex -> cells" connectivity index
+ * vtx_cells_lst <-- "vertex -> cells" connectivity list
+ * p_cell_cells_idx <-- pointer to "cell -> cells" connectivity index
+ * p_cell_cells_lst <-- pointer to "cell -> cells" connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_create_cell_cells_connect(cs_mesh_t *mesh,
+ cs_int_t *cell_i_faces_idx,
+ cs_int_t *cell_i_faces_lst,
+ cs_int_t *vtx_gcells_idx,
+ cs_int_t *vtx_gcells_lst,
+ cs_int_t *vtx_cells_idx,
+ cs_int_t *vtx_cells_lst,
+ cs_int_t *p_cell_cells_idx[],
+ cs_int_t *p_cell_cells_lst[])
+{
+ cs_int_t i, j, i_cel, fac_id, i_vtx;
+ cs_int_t cell_id, vtx_id, shift;
+
+ cs_int_t *cell_buffer = NULL, *cell_tag = NULL, *cell_count = NULL;
+ cs_int_t *cell_cells_idx = NULL, *cell_cells_lst = NULL;
+
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_cells_wghosts = mesh->n_cells_with_ghosts;
+ const cs_int_t *face_cells = mesh->i_face_cells;
+ const cs_int_t *fac_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *fac_vtx_lst = mesh->i_face_vtx_lst;
+
+ /* Allocate and initialize buffers */
+
+ BFT_MALLOC(cell_cells_idx, n_cells + 1, cs_int_t);
+ BFT_MALLOC(cell_buffer, n_cells_wghosts + n_cells, cs_int_t);
+
+ cell_tag = &(cell_buffer[0]);
+ cell_count = &(cell_buffer[n_cells_wghosts]);
+
+ cell_cells_idx[0] = 1;
+ for (i = 0; i < n_cells; i++) {
+ cell_cells_idx[i+1] = 0;
+ cell_count[i] = 0;
+ }
+
+ for (i = 0; i < n_cells_wghosts; i++)
+ cell_tag[i] = -1;
+
+ /* Define index */
+
+ for (i_cel = 0; i_cel < n_cells; i_cel++) {
+
+ /* First loop on faces to tag cells sharing a face */
+
+ for (i = cell_i_faces_idx[i_cel]; i < cell_i_faces_idx[i_cel+1]; i++) {
+
+ fac_id = CS_ABS(cell_i_faces_lst[i-1]) - 1;
+
+ cell_tag[face_cells[2*fac_id] - 1] = i_cel;
+ cell_tag[face_cells[2*fac_id+1] - 1] = i_cel;
+
+ } /* End of loop on cell's faces */
+
+ /* Second loop on faces to update index */
+
+ for (i = cell_i_faces_idx[i_cel]; i < cell_i_faces_idx[i_cel+1]; i++) {
+
+ fac_id = CS_ABS(cell_i_faces_lst[i-1]) - 1;
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id+1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx-1] - 1;
+
+ /* For cells belonging to this rank, get vertex -> cells connect. */
+
+ for (j = vtx_cells_idx[vtx_id]; j < vtx_cells_idx[vtx_id+1]; j++) {
+
+ cell_id = vtx_cells_lst[j];
+
+ if (cell_tag[cell_id] != i_cel) {
+ cell_cells_idx[i_cel+1] += 1;
+ cell_tag[cell_id] = i_cel;
+ }
+
+ }
+
+ if (n_cells_wghosts - n_cells > 0) { /* If there are ghost cells */
+
+ /* For ghost cells, get vertex -> ghost cells connect. */
+
+ for (j = vtx_gcells_idx[vtx_id]; j < vtx_gcells_idx[vtx_id+1]; j++) {
+
+ cell_id = vtx_gcells_lst[j] + n_cells;
+
+ if (cell_tag[cell_id] != i_cel) {
+ cell_cells_idx[i_cel+1] += 1;
+ cell_tag[cell_id] = i_cel;
+ }
+
+ }
+
+ } /* If there are ghost cells */
+
+ } /* End of loop on vertices */
+
+ } /* End of loop on cell's faces */
+
+ } /* End of loop on cells */
+
+ /* Create index */
+
+ for (i = 0; i < n_cells; i++)
+ cell_cells_idx[i+1] += cell_cells_idx[i];
+
+ for (i = 0; i < n_cells_wghosts; i++)
+ cell_tag[i] = -1;
+
+ BFT_MALLOC(cell_cells_lst, cell_cells_idx[n_cells] - 1, cs_int_t);
+
+ /* Fill list */
+
+ for (i_cel = 0; i_cel < n_cells; i_cel++) {
+
+ /* First loop on faces to tag cells sharing a face */
+
+ for (i = cell_i_faces_idx[i_cel]; i < cell_i_faces_idx[i_cel+1]; i++) {
+
+ fac_id = CS_ABS(cell_i_faces_lst[i-1]) - 1;
+
+ cell_tag[face_cells[2*fac_id] - 1] = i_cel;
+ cell_tag[face_cells[2*fac_id+1] - 1] = i_cel;
+
+ } /* End of loop on cell's faces */
+
+ /* Second loop on faces to update list */
+
+ for (i = cell_i_faces_idx[i_cel]; i < cell_i_faces_idx[i_cel+1]; i++) {
+
+ fac_id = CS_ABS(cell_i_faces_lst[i-1]) - 1;
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id+1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx-1] - 1;
+
+ /* For cells belonging to this rank, get vertex -> cells connect. */
+
+ for (j = vtx_cells_idx[vtx_id]; j < vtx_cells_idx[vtx_id+1]; j++) {
+
+ cell_id = vtx_cells_lst[j];
+
+ if (cell_tag[cell_id] != i_cel) {
+
+ shift = cell_cells_idx[i_cel] - 1 + cell_count[i_cel];
+ cell_cells_lst[shift] = cell_id + 1;
+ cell_tag[cell_id] = i_cel;
+ cell_count[i_cel] += 1;
+
+ } /* Add this cell_id */
+
+ }
+
+ if (n_cells_wghosts - n_cells > 0) { /* If there are ghost cells */
+
+ /* For ghost cells, get vertex -> ghost cells connect. */
+
+ for (j = vtx_gcells_idx[vtx_id]; j < vtx_gcells_idx[vtx_id+1]; j++){
+
+ cell_id = vtx_gcells_lst[j] + n_cells;
+
+ if (cell_tag[cell_id] != i_cel) {
+
+ shift = cell_cells_idx[i_cel] - 1 + cell_count[i_cel];
+ cell_cells_lst[shift] = cell_id + 1;
+ cell_tag[cell_id] = i_cel;
+ cell_count[i_cel] += 1;
+
+ }
+
+ }
+
+ } /* If there are ghost cells */
+
+ } /* End of loop on vertices */
+
+ } /* End of loop on cell's faces */
+
+ } /* End of loop on cells */
+
+ *p_cell_cells_idx = cell_cells_idx;
+ *p_cell_cells_lst = cell_cells_lst;
+
+ /* Free memory */
+
+ BFT_FREE(cell_buffer);
+
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define a new "cell -> cells" connectivity for the extended neighborhood
+ * in case of computation of gradient whith the least squares algorithm
+ * (imrgra = 3).
+ * The "cell -> cells" connectivity is clipped by a non-orthogonality
+ * criterion.
+ *
+ * Warning : Only cells sharing a vertex or vertices
+ * (not a face => mesh->face_cells) belong to the
+ * "cell -> cells" connectivity.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE REDVSE
+ * *****************
+ * & ( ANOMAX )
+ *
+ * parameters:
+ * anomax --> non-orthogonality angle (rad) above which cells
+ * are selected for the extended neighborhood
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (redvse, REDVSE) (const cs_real_t *anomax)
+{
+ cs_int_t i, face_id, cell_id, cell_i, cell_j;
+ size_t init_cell_cells_connect_size;
+
+ cs_real_t v_ij[3];
+ cs_real_t face_normal[3];
+ cs_real_t norm_ij, face_norm, cos_ij_fn;
+ cs_real_t dprod;
+ double ratio;
+
+ cs_int_t n_deleted_cells = 0;
+ cs_int_t previous_idx = 0, new_idx = -1;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_mesh_quantities_t *mesh_quantities = cs_glob_mesh_quantities;
+ cs_int_t *vtx_cells_idx = NULL, *vtx_cells_lst = NULL;
+ cs_int_t *vtx_gcells_idx = NULL, *vtx_gcells_lst = NULL;
+ cs_int_t *cell_cells_idx = mesh->cell_cells_idx;
+ cs_int_t *cell_cells_lst = mesh->cell_cells_lst;
+
+ const cs_int_t n_faces = mesh->n_i_faces;
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t *face_cells = mesh->i_face_cells;
+
+ const cs_real_t cos_ij_fn_min = cos((*anomax));
+ const cs_real_t *cell_cen = mesh_quantities->cell_cen;
+
+ /* Currently limited to 1 call, but the algorithm would work just the same
+ with multiple calls (as we re-build a new cell -> cells connectivity
+ instead of just filtering the one we already have) */
+
+ static cs_int_t _first_call = 0;
+
+ enum {X, Y, Z};
+
+#define CS_LOC_MODULE(vect) \
+ sqrt(vect[X] * vect[X] + vect[Y] * vect[Y] + vect[Z] * vect[Z])
+
+ assert(mesh->dim == 3);
+
+ /* First call: select the cells */
+
+ if (_first_call == 0) {
+
+ /* Update counter */
+
+ _first_call = 1;
+
+ /* Warn if there is no extended neighborhood */
+
+ if ( mesh->cell_cells_lst == NULL
+ || mesh->cell_cells_idx == NULL
+ || mesh->halo_type == CS_HALO_STANDARD) {
+ bft_printf
+ (_("\n"
+ "WARNING\n"
+ "The extended neighborhood is empty whereas the least-squares\n"
+ "method on extended neighborhood for gradient computation\n"
+ "is activated. This situation can arise in some particular\n"
+ "cases (1D mesh). Verify that it is your case, otherwise\n"
+ "contact support.\n"));
+ }
+ else {
+
+ /*
+ For each internal face, we select in the extended neighborhood
+ of the two cells sharing this face all the cells sharing a
+ vertex of this face if the non-orthogonality angle is above a
+ criterion.
+ */
+
+ /*
+ First: re-build a "vertex -> cells" connectivity
+ ------------------------------------------------
+ We have to invert the "face -> vertices" connectivity and then
+ we will use the "face -> cells" conectivity.
+ */
+
+ _create_vtx_cells_connect(mesh,
+ &vtx_cells_idx,
+ &vtx_cells_lst);
+
+ if (cs_mesh_n_g_ghost_cells(mesh) > 0)
+ _create_vtx_gcells_connect(mesh->halo,
+ mesh->n_vertices,
+ mesh->gcell_vtx_idx,
+ mesh->gcell_vtx_lst,
+ &vtx_gcells_idx,
+ &vtx_gcells_lst);
+
+ /* Tag cells to eliminate (set a negative number) */
+
+ for (face_id = 0 ; face_id < n_faces ; face_id++) {
+
+ /* We compute the cosine of the non-orthogonality angle
+ of internal faces (angle between the normal of the face
+ and the line between I (center of the cell I) and J (center
+ of the cell J) */
+
+ /* Vector IJ and normal of the face */
+
+ cell_i = face_cells[2*face_id] - 1;
+ cell_j = face_cells[2*face_id + 1] - 1;
+ dprod = 0;
+
+ for (i = 0; i < 3; i++) {
+ v_ij[i] = cell_cen[3*cell_j + i] - cell_cen[3*cell_i + i];
+ face_normal[i] = mesh_quantities->i_face_normal[3*face_id + i];
+ dprod += v_ij[i]*face_normal[i];
+ }
+
+ norm_ij = CS_LOC_MODULE(v_ij);
+ face_norm = CS_LOC_MODULE(face_normal);
+
+ assert(norm_ij > 0.);
+ assert(face_norm > 0.);
+
+ /* Dot product : norm_ij . face_norm */
+
+ cos_ij_fn = dprod / (norm_ij * face_norm);
+
+ /* Comparison to a predefined limit.
+ This is non-orthogonal if we are below the limit and so we keep
+ the cell in the extended neighborhood of the two cells sharing
+ the face. (The cell is tagged (<0) then we will change the sign
+ and eliminate all cells < 0 */
+
+ if (cos_ij_fn <= cos_ij_fn_min) {
+
+ /* For each cell sharing the face : intersection between
+ cells in the extended neighborhood and cells sharing a
+ vertex of the face. */
+
+ _tag_cells(face_id, cell_i, mesh,
+ vtx_cells_idx, vtx_cells_lst,
+ vtx_gcells_idx, vtx_gcells_lst);
+ _tag_cells(face_id, cell_j, mesh,
+ vtx_cells_idx, vtx_cells_lst,
+ vtx_gcells_idx, vtx_gcells_lst);
+
+ }
+
+ } /* End of loop on faces */
+
+ /* Free "vertex -> cells" connectivity */
+
+ BFT_FREE(vtx_cells_idx);
+ BFT_FREE(vtx_cells_lst);
+
+ if (cs_mesh_n_g_ghost_cells(mesh) > 0) {
+ BFT_FREE(vtx_gcells_idx);
+ BFT_FREE(vtx_gcells_lst);
+ }
+
+ /* Change all signs in cell_cells_lst in order to have cells to
+ eliminate < 0 */
+
+ for (i = 0 ; i < mesh->cell_cells_idx[n_cells]-1 ; i++)
+ mesh->cell_cells_lst[i] = - mesh->cell_cells_lst[i];
+
+ /* Delete negative cells */
+
+ init_cell_cells_connect_size = cell_cells_idx[n_cells] - 1;
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ for (i = previous_idx; i < cell_cells_idx[cell_id+1] - 1; i++) {
+
+ if (cell_cells_lst[i] > 0) {
+ new_idx++;
+ cell_cells_lst[new_idx] = cell_cells_lst[i];
+ }
+ else
+ n_deleted_cells++;
+
+ } /* End of loop on cells in the extended neighborhood of cell_id+1 */
+
+ previous_idx = cell_cells_idx[cell_id+1] - 1;
+ cell_cells_idx[cell_id+1] -= n_deleted_cells;
+
+ } /* End of loop on cells */
+
+ /* Reallocation of cell_cells_lst */
+
+ BFT_REALLOC(mesh->cell_cells_lst, cell_cells_idx[n_cells]-1, cs_int_t);
+
+ /* Output for listing */
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ unsigned long count_g[2];
+ unsigned long count_l[2] = {init_cell_cells_connect_size,
+ n_deleted_cells};
+ MPI_Allreduce(count_l, count_g, 2, MPI_UNSIGNED_LONG,
+ MPI_SUM, cs_glob_mpi_comm);
+
+ init_cell_cells_connect_size = count_g[0];
+ n_deleted_cells = count_g[1];
+ }
+
+#endif
+
+ ratio = 100. * (init_cell_cells_connect_size - n_deleted_cells)
+ / init_cell_cells_connect_size;
+
+ bft_printf
+ (_("\n"
+ " Extended neighborhood reduced by non-orthogonality\n"
+ " --------------------------------------------------\n"
+ "\n"
+ " Size of complete cell-cell connectivity: %12lu\n"
+ " Size of filtered cell-cell conectivity: %12lu\n"
+ " %lu connections removed, for a ratio of %4.2g %% used\n"),
+ (unsigned long)init_cell_cells_connect_size,
+ (unsigned long)(init_cell_cells_connect_size - n_deleted_cells),
+ (unsigned long)n_deleted_cells,
+ ratio);
+
+#if 0 /* For debugging purpose */
+ for (i = 0; i < mesh->n_cells ; i++) {
+ cs_int_t j;
+ bft_printf(" cell %d :: ", i+1);
+ for (j = mesh->cell_cells_idx[i]-1;
+ j < mesh->cell_cells_idx[i+1]-1;
+ j++)
+ bft_printf(" %d ", mesh->cell_cells_lst[j]);
+ bft_printf("\n");
+ }
+#endif
+
+ } /* If there is and extended neighborhood */
+
+ } /* If _first_call == 0 */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute filters for dynamic models. This function deals with the standard
+ * or extended neighborhood.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE CFILTR (VAR, F_VAR, WBUF1, WBUF2)
+ * *****************
+ *
+ * DOUBLE PRECISION(*) var[] --> array of variables to filter
+ * DOUBLE PRECISION(*) f_var[] --> filtered variable array
+ * DOUBLE PRECISION(*) wbuf1[] --> working buffer
+ * DOUBLE PRECISION(*) wbuf2[] --> working buffer
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (cfiltr, CFILTR)(cs_real_t var[],
+ cs_real_t f_var[],
+ cs_real_t wbuf1[],
+ cs_real_t wbuf2[])
+{
+ cs_int_t i, j, k;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t *cell_cells_idx = mesh->cell_cells_idx;
+ const cs_int_t *cell_cells_lst = mesh->cell_cells_lst;
+ const cs_real_t *cell_vol = cs_glob_mesh_quantities->cell_vol;
+
+ assert(cell_cells_idx != NULL);
+
+ /* Synchronize variable */
+
+ if (mesh->halo != NULL) {
+
+ cs_halo_sync_var(mesh->halo, CS_HALO_EXTENDED, var);
+
+ if (mesh->n_init_perio > 0)
+ cs_perio_sync_var_scal(mesh->halo,
+ CS_HALO_EXTENDED,
+ CS_PERIO_ROTA_COPY,
+ var);
+
+ }
+
+ /* Allocate and initialize working buffers */
+
+ for (i = 0; i < n_cells; i++) {
+ wbuf1[i] = 0;
+ wbuf2[i] = 0;
+ }
+
+ /* Define filtered variable array */
+
+ for (i = 0; i < n_cells; i++) {
+
+ wbuf1[i] += var[i] * cell_vol[i];
+ wbuf2[i] += cell_vol[i];
+
+ /* Loop on connected cells (without cells sharing a face) */
+
+ for (j = cell_cells_idx[i] - 1; j < cell_cells_idx[i+1] - 1; j++) {
+
+ k = cell_cells_lst[j] - 1;
+ wbuf1[i] += var[k] * cell_vol[k];
+ wbuf2[i] += cell_vol[k];
+
+ }
+
+ } /* End of loop on cells */
+
+ for (k = 0; k < mesh->n_i_faces; k++) {
+
+ i = mesh->i_face_cells[2*k] - 1;
+ j = mesh->i_face_cells[2*k + 1] - 1;
+
+ wbuf1[i] += var[j] * cell_vol[j];
+ wbuf2[i] += cell_vol[j];
+ wbuf1[j] += var[i] * cell_vol[i];
+ wbuf2[j] += cell_vol[i];
+
+ }
+
+ for (i = 0; i < n_cells; i++)
+ f_var[i] = wbuf1[i]/wbuf2[i];
+
+ /* Synchronize variable */
+
+ if (mesh->halo != NULL) {
+
+ cs_halo_sync_var(mesh->halo, CS_HALO_STANDARD, f_var);
+
+ if (mesh->n_init_perio > 0)
+ cs_perio_sync_var_scal(mesh->halo,
+ CS_HALO_STANDARD,
+ CS_PERIO_ROTA_COPY,
+ f_var);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Create the "cell -> cells" connectivity
+ *
+ * parameters:
+ * mesh <-> pointer to a mesh structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_ext_neighborhood_define(cs_mesh_t *mesh)
+{
+ cs_int_t *vtx_gcells_idx = NULL, *vtx_gcells_lst = NULL;
+ cs_int_t *vtx_cells_idx = NULL, *vtx_cells_lst = NULL;
+ cs_int_t *cell_i_faces_idx = NULL, *cell_i_faces_lst = NULL;
+ cs_int_t *cell_cells_idx = NULL, *cell_cells_lst = NULL;
+
+ cs_halo_t *halo = mesh->halo;
+
+ /* Get "cell -> faces" connectivity for the local mesh */
+
+ _get_cell_i_faces_connectivity(mesh,
+ &cell_i_faces_idx,
+ &cell_i_faces_lst);
+
+ /* Create a "vertex -> cell" connectivity */
+
+ _create_vtx_cells_connect2(mesh,
+ cell_i_faces_idx,
+ cell_i_faces_lst,
+ &vtx_cells_idx,
+ &vtx_cells_lst);
+
+ if (cs_mesh_n_g_ghost_cells(mesh) > 0) {
+
+ /* Create a "vertex -> ghost cells" connectivity */
+
+ _create_vtx_gcells_connect(halo,
+ mesh->n_vertices,
+ mesh->gcell_vtx_idx,
+ mesh->gcell_vtx_lst,
+ &vtx_gcells_idx,
+ &vtx_gcells_lst);
+
+ }
+
+ /* Create the "cell -> cells" connectivity for the extended halo */
+
+ _create_cell_cells_connect(mesh,
+ cell_i_faces_idx,
+ cell_i_faces_lst,
+ vtx_gcells_idx,
+ vtx_gcells_lst,
+ vtx_cells_idx,
+ vtx_cells_lst,
+ &cell_cells_idx,
+ &cell_cells_lst);
+
+ mesh->cell_cells_idx = cell_cells_idx;
+ mesh->cell_cells_lst = cell_cells_lst;
+
+ /* Free memory */
+
+ BFT_FREE(vtx_gcells_idx);
+ BFT_FREE(vtx_gcells_lst);
+
+ BFT_FREE(cell_i_faces_idx);
+ BFT_FREE(cell_i_faces_lst);
+ BFT_FREE(vtx_cells_idx);
+ BFT_FREE(vtx_cells_lst);
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gradient.c b/src/base/cs_gradient.c
new file mode 100644
index 0000000..44e8e0f
--- /dev/null
+++ b/src/base/cs_gradient.c
@@ -0,0 +1,636 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Gradient reconstruction.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_halo.h"
+#include "cs_mesh.h"
+#include "cs_ext_neighborhood.h"
+#include "cs_mesh_quantities.h"
+#include "cs_perio.h"
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gradient.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Encapsulation of the call to GRADMC (Fortran routine for the computation of
+ * gradients by the least squares method). Add data for taking into account
+ * the extended neighborhood.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE CGRDMC
+ * *****************
+ *
+ * ( NCELET , NCEL , NFAC , NFABOR , NCELBR ,
+ * INC , ICCOCG , NSWRGP , IDIMTE , ITENSO , IPHYDP , IMRGRA ,
+ * IWARNP , NFECRA , EPSRGP , EXTRAP ,
+ * IFACEL , IFABOR , IA(IICELB) , IA(IISYMP) ,
+ * VOLUME , SURFAC , SURFBO , RA(ISRFBN) , RA(IPOND) ,
+ * RA(IDIST) , RA(IDISTB) ,
+ * RA(IDIJPF) , RA(IDIIPB) ,
+ * FEXTX , FEXTY , FEXTZ ,
+ * XYZCEN , CDGFAC , CDGFBO , COEFAP , COEFBP , PVAR ,
+ * RA(ICOCGB) , RA(ICOCG) ,
+ * DPDX , DPDY , DPDZ ,
+ * DPDXA , DPDYA , DPDZA )
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cgrdmc, CGRDMC)
+(
+ const cs_int_t *const ncelet, /* --> number of extended cells */
+ const cs_int_t *const ncel, /* --> number of cells */
+ const cs_int_t *const nfac, /* --> number of internal faces */
+ const cs_int_t *const nfabor, /* --> number of boundary faces */
+ const cs_int_t *const ncelbr, /* --> number of cells on boundary */
+ const cs_int_t *const inc, /* --> 0 or 1: increment or not */
+ const cs_int_t *const iccocg, /* --> 1 or 0: recompute COCG or not */
+ const cs_int_t *const nswrgp, /* --> >1: with reconstruction */
+ const cs_int_t *const idimte, /* --> 0, 1, 2: scalar, vector, tensor */
+ const cs_int_t *const itenso, /* --> for rotational periodicity */
+ const cs_int_t *const iphydp, /* --> use hydrosatatic pressure */
+ const cs_int_t *const imrgra, /* --> gradient computation mode */
+ const cs_int_t *const iwarnp, /* --> verbosity level */
+ const cs_int_t *const nfecra, /* --> standard output unit */
+ const cs_real_t *const epsrgp, /* --> precision for iterative gradient
+ calculation */
+ const cs_real_t *const extrap, /* --> extrapolate gradient at boundary */
+ const cs_int_t ifacel[], /* --> interior face->cell connectivity */
+ const cs_int_t ifabor[], /* --> boundary face->cell connectivity */
+ const cs_int_t icelbr[], /* --> list of cells on boundary */
+ const cs_int_t isympa[], /* --> indicator for symmetry faces */
+ const cs_real_t volume[], /* --> cell volumes */
+ const cs_real_t surfac[], /* --> surfaces of internal faces */
+ const cs_real_t surfbo[], /* --> surfaces of boundary faces */
+ const cs_real_t surfbn[], /* --> norm of surfbo */
+ const cs_real_t pond[], /* --> interior faces geometric weight */
+ const cs_real_t dist[], /* --> interior faces I' to J' distance */
+ const cs_real_t distbr[], /* --> boundary faces I' to J' distance */
+ const cs_real_t dijpf[], /* --> interior faces I'J' vector */
+ const cs_real_t diipb[], /* --> boundary faces II' vector */
+ cs_real_t fextx[], /* --> components of the exterior force */
+ cs_real_t fexty[], /* generating the hydrostatic */
+ cs_real_t fextz[], /* pressure */
+ const cs_real_t xyzcen[], /* --> cell centers */
+ const cs_real_t cdgfac[], /* --> interior face centers of gravity */
+ const cs_real_t cdgfbo[], /* --> boundary face centers of gravity */
+ const cs_real_t coefap[], /* --> boundary condition term */
+ const cs_real_t coefbp[], /* --> boundary condition term */
+ cs_real_t pvar[], /* --> gradient's base variable */
+ cs_real_t cocgb[], /* <-> contribution to COCG of cells
+ on boundary's internal faces */
+ cs_real_t cocg[], /* <-> contribution to COCG of cells
+ on boundary's boundary faces */
+ cs_real_t dpdx[], /* <-- gradient x component */
+ cs_real_t dpdy[], /* <-- gradient y component */
+ cs_real_t dpdz[], /* <-- gradient z component */
+ cs_real_t bx[], /* --- local work array */
+ cs_real_t by[], /* --- local work array */
+ cs_real_t bz[] /* --- local work array */
+)
+{
+ cs_int_t *ipcvse = NULL;
+ cs_int_t *ielvse = NULL;
+ cs_halo_type_t halo_type = CS_HALO_STANDARD;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_halo_t *halo = mesh->halo;
+
+ if (*imrgra == 2 || *imrgra == 3)
+ halo_type = CS_HALO_EXTENDED;
+
+ /* Synchronize variable */
+
+ if (halo != NULL) {
+
+ if (*itenso == 2)
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, pvar);
+ else
+ cs_halo_sync_var(halo, halo_type, pvar);
+
+ /* TODO: check if fext* components are all up to date, in which
+ * case we need no special treatment for *itenso = 2 */
+
+ if (*iphydp != 0) {
+
+ if (*itenso == 2){
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, fextx);
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, fexty);
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, fextz);
+ }
+ else {
+ cs_halo_sync_var(halo, halo_type, fextx);
+ cs_halo_sync_var(halo, halo_type, fexty);
+ cs_halo_sync_var(halo, halo_type, fextz);
+ cs_perio_sync_var_vect(halo, halo_type, CS_PERIO_ROTA_COPY,
+ fextx, fexty, fextz);
+ }
+ }
+
+ }
+
+ /* "cell -> cells" connectivity for the extended neighborhood */
+
+ ipcvse = mesh->cell_cells_idx;
+ ielvse = mesh->cell_cells_lst;
+
+ /* Compute gradient */
+
+ CS_PROCF(gradmc, GRADMC)
+ (ncelet, ncel , nfac , nfabor, ncelbr,
+ inc , iccocg, nswrgp, idimte, itenso, iphydp, imrgra,
+ iwarnp, nfecra, epsrgp, extrap,
+ ifacel, ifabor, icelbr, ipcvse, ielvse, isympa,
+ volume, surfac, surfbo, surfbn, pond ,
+ dist , distbr, dijpf , diipb ,
+ fextx , fexty , fextz , xyzcen,
+ cdgfac, cdgfbo, coefap, coefbp, pvar ,
+ cocgb , cocg ,
+ dpdx , dpdy , dpdz ,
+ bx , by , bz );
+
+}
+
+/*----------------------------------------------------------------------------
+ * Clip the gradient if necessary. This function deals with the standard or
+ * extended neighborhood.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE CLMGRD
+ * *****************
+ *
+ * & ( IMRGRA , IMLIGP , IWARNP , CLIMGP ,
+ * & VAR , DPDX , DPDY , DPDZ )
+ *
+ * parameters:
+ * imrgra --> type of computation for the gradient
+ * imligp --> type of clipping for the computation of the gradient
+ * iwarnp --> output level
+ * itenso --> for rotational periodicity
+ * climgp --> clipping coefficient for the computation of the gradient
+ * var --> variable
+ * dpdx --> X component of the pressure gradient
+ * dpdy --> Y component of the pressure gradient
+ * dpdz --> Z component of the pressure gradient
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (clmgrd, CLMGRD)(const cs_int_t *imrgra,
+ const cs_int_t *imligp,
+ const cs_int_t *iwarnp,
+ const cs_int_t *itenso,
+ const cs_real_t *climgp,
+ cs_real_t var[],
+ cs_real_t dpdx[],
+ cs_real_t dpdy[],
+ cs_real_t dpdz[])
+{
+ cs_int_t i, i1, i2, j, k;
+ cs_real_t dist[3];
+ cs_real_t dvar, dist1, dist2, dpdxf, dpdyf, dpdzf;
+ cs_real_t global_min_factor, global_max_factor, factor1, factor2;
+
+ cs_int_t n_clip = 0, n_g_clip =0;
+ cs_real_t min_factor = 1;
+ cs_real_t max_factor = 0;
+ cs_real_t *restrict buf = NULL, *restrict clip_factor = NULL;
+ cs_real_t *restrict denom = NULL, *restrict denum = NULL;
+
+ cs_halo_type_t halo_type = CS_HALO_STANDARD;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_cells_wghosts = mesh->n_cells_with_ghosts;
+ const cs_int_t *cell_cells_idx = mesh->cell_cells_idx;
+ const cs_int_t *cell_cells_lst = mesh->cell_cells_lst;
+ const cs_real_t *cell_cen = cs_glob_mesh_quantities->cell_cen;
+
+ const cs_halo_t *halo = mesh->halo;
+
+ if (*imligp < 0)
+ return;
+
+ if (*imrgra == 2 || *imrgra == 3)
+ halo_type = CS_HALO_EXTENDED;
+
+ /* Synchronize variable */
+
+ if (halo != NULL) {
+
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, var);
+
+ /* Exchange for the gradients. Not useful for working array */
+
+ if (*imligp == 1) {
+
+ if (*itenso == 2){
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, dpdx);
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, dpdy);
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, dpdz);
+ }
+ else {
+ cs_halo_sync_var(halo, halo_type, dpdx);
+ cs_halo_sync_var(halo, halo_type, dpdy);
+ cs_halo_sync_var(halo, halo_type, dpdz);
+ cs_perio_sync_var_vect(halo, halo_type, CS_PERIO_ROTA_COPY,
+ dpdx, dpdy, dpdz);
+ }
+
+ } /* End if imligp == 1 */
+
+ } /* End if halo */
+
+ /* Allocate and initialize working buffers */
+
+ if (*imligp == 1)
+ BFT_MALLOC(buf, 3*n_cells_wghosts, cs_real_t);
+ else
+ BFT_MALLOC(buf, 2*n_cells_wghosts, cs_real_t);
+
+ denum = buf;
+ denom = buf + n_cells_wghosts;
+
+ if (*imligp == 1)
+ clip_factor = buf + 2*n_cells_wghosts;
+
+ for (i = 0; i < n_cells_wghosts; i++) {
+ denum[i] = 0;
+ denom[i] = 0;
+ }
+
+ /* First computations:
+ denum holds the maximum variation of the gradient
+ denom holds the maximum variation of the variable */
+
+ if (*imligp == 0) {
+
+ for (i = 0; i < n_i_faces; i++) {
+
+ i1 = mesh->i_face_cells[2*i] - 1;
+ i2 = mesh->i_face_cells[2*i + 1] - 1;
+
+ for (j = 0; j < 3; j++)
+ dist[j] = cell_cen[3*i1 + j] - cell_cen[3*i2 + j];
+
+ dist1 = CS_ABS(dist[0]*dpdx[i1] + dist[1]*dpdy[i1] + dist[2]*dpdz[i1]);
+ dist2 = CS_ABS(dist[0]*dpdx[i2] + dist[1]*dpdy[i2] + dist[2]*dpdz[i2]);
+
+ dvar = CS_ABS(var[i1] - var[i2]);
+
+ denum[i1] = CS_MAX(denum[i1], dist1);
+ denum[i2] = CS_MAX(denum[i2], dist2);
+ denom[i1] = CS_MAX(denom[i1], dvar);
+ denom[i2] = CS_MAX(denom[i2], dvar);
+
+ } /* End of loop on faces */
+
+ /* Complement for extended neighborhood */
+
+ if (cell_cells_idx != NULL && halo_type == CS_HALO_EXTENDED) {
+
+ for (i1 = 0; i1 < n_cells; i1++) {
+ for (j = cell_cells_idx[i1] - 1; j < cell_cells_idx[i1+1] - 1; j++) {
+
+ i2 = cell_cells_lst[j] - 1;
+
+ for (k = 0; k < 3; k++)
+ dist[k] = cell_cen[3*i1 + k] - cell_cen[3*i2 + k];
+
+ dist1 = CS_ABS( dist[0]*dpdx[i1]
+ + dist[1]*dpdy[i1]
+ + dist[2]*dpdz[i1]);
+ dvar = CS_ABS(var[i1] - var[i2]);
+
+ denum[i1] = CS_MAX(denum[i1], dist1);
+ denom[i1] = CS_MAX(denom[i1], dvar);
+
+ }
+ }
+
+ } /* End for extended halo */
+
+ }
+ else if (*imligp == 1) {
+
+ for (i = 0; i < n_i_faces; i++) {
+
+ i1 = mesh->i_face_cells[2*i] - 1;
+ i2 = mesh->i_face_cells[2*i + 1] - 1;
+
+ for (j = 0; j < 3; j++)
+ dist[j] = cell_cen[3*i1 + j] - cell_cen[3*i2 + j];
+
+ dpdxf = 0.5 * (dpdx[i1] + dpdx[i2]);
+ dpdyf = 0.5 * (dpdy[i1] + dpdy[i2]);
+ dpdzf = 0.5 * (dpdz[i1] + dpdz[i2]);
+
+ dist1 = CS_ABS(dist[0]*dpdxf + dist[1]*dpdyf + dist[2]*dpdzf);
+ dvar = CS_ABS(var[i1] - var[i2]);
+
+ denum[i1] = CS_MAX(denum[i1], dist1);
+ denum[i2] = CS_MAX(denum[i2], dist1);
+ denom[i1] = CS_MAX(denom[i1], dvar);
+ denom[i2] = CS_MAX(denom[i2], dvar);
+
+ } /* End of loop on faces */
+
+ /* Complement for extended neighborhood */
+
+ if (cell_cells_idx != NULL && halo_type == CS_HALO_EXTENDED) {
+
+ for (i1 = 0; i1 < n_cells; i1++) {
+ for (j = cell_cells_idx[i1] - 1; j < cell_cells_idx[i1+1] - 1; j++) {
+
+ i2 = cell_cells_lst[j] - 1;
+
+ for (k = 0; k < 3; k++)
+ dist[k] = cell_cen[3*i1 + k] - cell_cen[3*i2 + k];
+
+ dpdxf = 0.5 * (dpdx[i1] + dpdx[i2]);
+ dpdyf = 0.5 * (dpdy[i1] + dpdy[i2]);
+ dpdzf = 0.5 * (dpdz[i1] + dpdz[i2]);
+
+ dist1 = CS_ABS(dist[0]*dpdxf + dist[1]*dpdyf + dist[2]*dpdzf);
+ dvar = CS_ABS(var[i1] - var[i2]);
+
+ denum[i1] = CS_MAX(denum[i1], dist1);
+ denom[i1] = CS_MAX(denom[i1], dvar);
+
+ }
+ }
+
+ } /* End for extended neighborhood */
+
+ } /* End if *imligp == 1 */
+
+ /* Clipping of the gradient if denum/denom > climgp */
+
+ if (*imligp == 0) {
+
+ for (i = 0; i < n_cells; i++) {
+
+ if (denum[i] > *climgp * denom[i]) {
+
+ factor1 = *climgp * denom[i]/denum[i];
+ dpdx[i] *= factor1;
+ dpdy[i] *= factor1;
+ dpdz[i] *= factor1;
+
+ min_factor = CS_MIN( factor1, min_factor);
+ max_factor = CS_MAX( factor1, max_factor);
+ n_clip++;
+
+ } /* If clipping */
+
+ } /* End of loop on cells */
+
+ }
+ else if (*imligp == 1) {
+
+ for (i = 0; i < n_cells_wghosts; i++)
+ clip_factor[i] = (cs_real_t)DBL_MAX;
+
+
+ /* Synchronize variable */
+
+ if (halo != NULL) {
+ if (*itenso == 2) {
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, denom);
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, denum);
+ }
+ else {
+ cs_halo_sync_var(halo, halo_type, denom);
+ cs_halo_sync_var(halo, halo_type, denum);
+ }
+ }
+
+ for (i = 0; i < n_i_faces; i++) {
+
+ i1 = mesh->i_face_cells[2*i] - 1;
+ i2 = mesh->i_face_cells[2*i + 1] - 1;
+
+ factor1 = 1.0;
+ if (denum[i1] > *climgp * denom[i1])
+ factor1 = *climgp * denom[i1]/denum[i1];
+
+ factor2 = 1.0;
+ if (denum[i2] > *climgp * denom[i2])
+ factor2 = *climgp * denom[i2]/denum[i2];
+
+ min_factor = CS_MIN(factor1, factor2);
+
+ clip_factor[i1] = CS_MIN( clip_factor[i1], min_factor);
+ clip_factor[i2] = CS_MIN( clip_factor[i2], min_factor);
+
+ } /* End of loop on faces */
+
+ /* Complement for extended neighborhood */
+
+ if (cell_cells_idx != NULL && halo_type == CS_HALO_EXTENDED) {
+
+ for (i1 = 0; i1 < n_cells; i1++) {
+
+ factor1 = 1.0;
+
+ for (j = cell_cells_idx[i1] - 1; j < cell_cells_idx[i1+1] - 1; j++) {
+
+ i2 = cell_cells_lst[j] - 1;
+ factor2 = 1.0;
+
+ if (denum[i2] > *climgp * denom[i2])
+ factor2 = *climgp * denom[i2]/denum[i2];
+
+ factor1 = CS_MIN(factor1, factor2);
+
+ }
+
+ clip_factor[i1] = CS_MIN(clip_factor[i1], factor1);
+
+ } /* End of loop on cells */
+
+ } /* End for extended neighborhood */
+
+ for (i = 0; i < n_cells; i++) {
+
+ dpdx[i] *= clip_factor[i];
+ dpdy[i] *= clip_factor[i];
+ dpdz[i] *= clip_factor[i];
+
+ if (clip_factor[i] < 0.99) {
+
+ max_factor = CS_MAX(max_factor, clip_factor[i]);
+ min_factor = CS_MIN(min_factor, clip_factor[i]);
+ n_clip++;
+
+ }
+
+ } /* End of loop on cells */
+
+ } /* End if *imligp == 1 */
+
+ /* Update min/max and n_clip in case of parallelism */
+
+#if defined(HAVE_MPI)
+
+ if (mesh->n_domains > 1) {
+
+ assert(sizeof(cs_real_t) == sizeof(double));
+
+ /* Global Max */
+
+ MPI_Allreduce(&max_factor, &global_max_factor, 1, CS_MPI_REAL,
+ MPI_MAX, cs_glob_mpi_comm);
+
+ max_factor = global_max_factor;
+
+ /* Global min */
+
+ MPI_Allreduce(&min_factor, &global_min_factor, 1, CS_MPI_REAL,
+ MPI_MIN, cs_glob_mpi_comm);
+
+ min_factor = global_min_factor;
+
+ /* Sum number of clippings */
+
+ assert(sizeof(cs_int_t) == sizeof(int));
+
+ MPI_Allreduce(&n_clip, &n_g_clip, 1, CS_MPI_INT,
+ MPI_SUM, cs_glob_mpi_comm);
+
+ n_clip = n_g_clip;
+
+ } /* If n_domains > 1 */
+
+#endif /* defined(HAVE_MPI) */
+
+ /* Output warning if necessary */
+
+ if (*iwarnp > 1)
+ bft_printf(_(" GRADIENT LIMITATION in %10d cells\n"
+ " MINIMUM FACTOR = %14.5e; MAXIMUM FACTOR = %14.5e\n"),
+ n_clip, min_factor, max_factor);
+
+ /* Synchronize dpdx, dpdy, dpdz */
+
+ if (halo != NULL) {
+
+ if (*itenso == 2) {
+
+ /* If the gradient is not treated as a "true" vector */
+
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, dpdx);
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, dpdy);
+ cs_halo_sync_component(halo, halo_type, CS_HALO_ROTATION_IGNORE, dpdz);
+
+ }
+ else {
+
+ cs_halo_sync_var(halo, halo_type, dpdx);
+ cs_halo_sync_var(halo, halo_type, dpdy);
+ cs_halo_sync_var(halo, halo_type, dpdz);
+
+ cs_perio_sync_var_vect(halo,
+ halo_type,
+ CS_PERIO_ROTA_COPY,
+ dpdx, dpdy, dpdz);
+
+ }
+
+ }
+
+ BFT_FREE(buf);
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_grid.c b/src/base/cs_grid.c
new file mode 100644
index 0000000..1a85e13
--- /dev/null
+++ b/src/base/cs_grid.c
@@ -0,0 +1,1773 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Grid connectivity and data used for multgrid coarsening
+ * and associated matrix construction.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(__STDC_VERSION__) /* size_t */
+#if (__STDC_VERSION__ == 199901L)
+# include <stddef.h>
+# else
+# include <stdlib.h>
+# endif
+#else
+#include <stdlib.h>
+#endif
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+#include "cs_matrix.h"
+#include "cs_prototypes.h"
+#include "cs_perio.h"
+#include "cs_sles.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_grid.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local Structure Definitions
+ *----------------------------------------------------------------------------*/
+
+/* Structure associated with grid */
+/*--------------------------------*/
+
+struct _cs_grid_t {
+
+ int level; /* Level in multigrid hierarchy */
+ cs_bool_t symmetric; /* Symmetric matrix coefficients
+ indicator */
+
+ fvm_lnum_t n_cells; /* Local number of cells */
+ fvm_lnum_t n_cells_ext; /* Local number of participating cells
+ (cells + ghost cells sharing a face) */
+ fvm_lnum_t n_faces; /* Local number of faces */
+ fvm_gnum_t n_g_cells; /* Global number of cells */
+
+ /* Grid hierarchy information */
+
+ const struct _cs_grid_t *parent; /* Pointer to parent (finer) grid */
+
+ /* Connectivity information */
+
+ const fvm_lnum_t *face_cell; /* Face -> cells connectivity (1 to n) */
+ fvm_lnum_t *_face_cell; /* Face -> cells connectivity
+ (private array) */
+
+ /* Restriction from parent to current level */
+
+ fvm_lnum_t *coarse_cell; /* Fine -> coarse cell connectivity
+ (1 to n); size: parent n_cells_ext */
+ fvm_lnum_t *coarse_face; /* Fine -> coarse face connectivity
+ (1 to n, signed:
+ = 0 fine face inside coarse cell
+ > 0 orientation same as parent
+ < 0 orientation opposite as parent);
+ size: parent n_faces */
+
+ /* Geometric data */
+
+ const cs_real_t *cell_cen; /* Cell center (shared) */
+ cs_real_t *_cell_cen; /* Cell center (private) */
+
+ const cs_real_t *cell_vol; /* Cell volume (shared) */
+ cs_real_t *_cell_vol; /* Cell volume (private) */
+
+ const cs_real_t *face_normal; /* Surface normal of internal faces.
+ (shared; L2 norm = face area) */
+ cs_real_t *_face_normal; /* Surface normal of internal faces.
+ (private; L2 norm = face area) */
+
+ /* Parallel / periodic halo */
+
+ const cs_halo_t *halo; /* Halo for this connectivity (shared) */
+ cs_halo_t *_halo; /* Halo for this connectivity (private) */
+
+ /* Matrix-related data */
+
+ const cs_real_t *da; /* Diagonal (shared) */
+ cs_real_t *_da; /* Diagonal (private) */
+
+ const cs_real_t *xa; /* Extra-diagonal (shared) */
+ cs_real_t *_xa; /* Extra-diagonal (private) */
+
+ const cs_real_t *xa0; /* Symmetrized extra-diagonal (shared) */
+ cs_real_t *_xa0; /* Symmetrized extra-diagonal (private) */
+
+ cs_real_t *xa0ij;
+
+ cs_matrix_t *matrix; /* Associated matrix structure */
+};
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Allocate empty grid structure
+ *
+ * - Periodic faces are not handled yet
+ *
+ * returns:
+ * empty grid structure
+ *----------------------------------------------------------------------------*/
+
+static cs_grid_t *
+_create_grid(void)
+{
+ cs_grid_t *g;
+
+ BFT_MALLOC(g, 1, cs_grid_t);
+
+ g->level = 0;
+
+ g->n_cells = 0;
+ g->n_cells_ext = 0;
+ g->n_faces = 0;
+ g->n_g_cells = 0;
+
+ g->parent = NULL;
+
+ g->face_cell = NULL;
+ g->_face_cell = NULL;
+
+ g->coarse_cell = NULL;
+ g->coarse_face = NULL;
+
+ g->cell_cen = NULL;
+ g->_cell_cen = NULL;
+ g->cell_vol = NULL;
+ g->_cell_vol = NULL;
+ g->face_normal = NULL;
+ g->_face_normal = NULL;
+
+ g->halo = NULL;
+ g->_halo = NULL;
+
+ g->da = NULL;
+ g->_da = NULL;
+ g->xa = NULL;
+ g->_xa = NULL;
+ g->xa0 = NULL;
+ g->_xa0 = NULL;
+
+ g->xa0ij = NULL;
+
+ g->matrix = NULL;
+
+ return g;
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize coarse grid from fine grid
+ *
+ * This creates au quasi-empty grid structure, with only symmetry and
+ * level information initialized, and coarsening array allocated and
+ * zeroed.
+ *
+ * After this function is called, the coarsening array mus be determined,
+ * then _coarsen must be called to complete the coarse grid.
+ *
+ * parameters:
+ * f <-- Pointer to fine (parent) grid structure
+ *
+ * returns:
+ * coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+static cs_grid_t *
+_coarse_init(const cs_grid_t *f)
+{
+ fvm_lnum_t ii;
+ cs_grid_t *c = NULL;
+
+ c = _create_grid();
+
+ c->parent = f;
+
+ c->level = f->level + 1;
+ c->symmetric = f->symmetric;
+
+ BFT_MALLOC(c->coarse_cell, f->n_cells_ext, fvm_lnum_t);
+
+ for (ii = 0; ii < f->n_cells_ext; ii++)
+ c->coarse_cell[ii] = 0;
+
+ return c;
+}
+
+/*----------------------------------------------------------------------------
+ * Build fine -> coarse face connectivity and coarse grid face->cell
+ * connectivity (also determining the number of coarse faces) from
+ * fine grid and cell coarsening array.
+ *
+ * Also, it is the caller's responsibility to free arrays coarse_face[]
+ * and coarse_face_cell_id[] when they are no longer used.
+ *
+ * parameters:
+ * fine <-- Pointer to fine (parent) grid structure
+ * coarse_cell <-- Fine -> coarse cell id (1 to n numbering)
+ * size: fine->n_cells_ext
+ * n_coarse_cells <-- Number of coarse cells
+ * n_coarse_faces --> Number of coarse faces
+ * coarse_face --> Fine -> coarse face connectivity (1 to n, signed:
+ * = 0 fine face inside coarse cell
+ * > 0 orientation same as parent
+ * < 0 orientation opposite as parent);
+ * size: fine->n_faces
+ * coarse_face_cell --> coarse face -> cell connectivity (1 to n numbering)
+ * size: n_coarse_facees * 2
+ *----------------------------------------------------------------------------*/
+
+static void
+_coarsen_faces(const cs_grid_t *fine,
+ const fvm_lnum_t *restrict coarse_cell,
+ fvm_lnum_t n_coarse_cells,
+ fvm_lnum_t *n_coarse_faces,
+ fvm_lnum_t **coarse_face,
+ fvm_lnum_t **coarse_face_cell)
+{
+ fvm_lnum_t ii, jj, face_id, connect_size;
+
+ fvm_lnum_t *restrict c_cell_cell_cnt = NULL;
+ fvm_lnum_t *restrict c_cell_cell_idx = NULL;
+ fvm_lnum_t *restrict c_cell_cell_id = NULL;
+ fvm_lnum_t *restrict c_cell_cell_face = NULL;
+
+ fvm_lnum_t *restrict _coarse_face = NULL;
+ fvm_lnum_t *restrict _c_face_cell = NULL;
+
+ fvm_lnum_t c_n_faces = 0;
+
+ const fvm_lnum_t c_n_cells = n_coarse_cells;
+ const fvm_lnum_t f_n_faces = fine->n_faces;
+ const fvm_lnum_t *restrict f_face_cell = fine->face_cell;
+
+ /* Pre-allocate return values
+ (coarse face->cell connectivity is over-allocated) */
+
+ BFT_MALLOC(_coarse_face, f_n_faces, fvm_lnum_t);
+ BFT_MALLOC(_c_face_cell, f_n_faces*2, fvm_lnum_t);
+
+ for (face_id = 0; face_id < f_n_faces; _coarse_face[face_id++] = 0);
+
+ /* Allocate index */
+
+ BFT_MALLOC(c_cell_cell_idx, c_n_cells + 1, fvm_lnum_t);
+
+ for (ii = 0; ii <= c_n_cells; c_cell_cell_idx[ii++] = 0);
+
+ for (face_id = 0; face_id < f_n_faces; face_id++) {
+
+ ii = coarse_cell[f_face_cell[face_id*2] - 1] - 1;
+ jj = coarse_cell[f_face_cell[face_id*2 + 1] - 1] - 1;
+
+ if (ii < jj)
+ c_cell_cell_idx[ii+1] += 1;
+ else if (ii > jj)
+ c_cell_cell_idx[jj+1] += 1;
+
+ }
+
+ /* Transform to index */
+
+ for (ii = 0; ii < c_n_cells; ii++)
+ c_cell_cell_idx[ii+1] += c_cell_cell_idx[ii];
+
+ BFT_MALLOC(c_cell_cell_id,
+ c_cell_cell_idx[c_n_cells],
+ fvm_lnum_t);
+
+ BFT_MALLOC(c_cell_cell_face,
+ c_cell_cell_idx[c_n_cells],
+ fvm_lnum_t);
+
+ for (ii = 0, connect_size = c_cell_cell_idx[c_n_cells];
+ ii < connect_size;
+ c_cell_cell_face[ii++] = 0);
+
+ /* Use a counter for array population, as array will usually
+ not be fully populated */
+
+ BFT_MALLOC(c_cell_cell_cnt, c_n_cells, fvm_lnum_t);
+
+ for (ii = 0; ii < c_n_cells; c_cell_cell_cnt[ii++] = 0);
+
+ /* Build connectivity */
+
+ c_n_faces = 0;
+
+ for (face_id = 0; face_id < f_n_faces; face_id++) {
+
+ fvm_lnum_t kk, start_id, end_id;
+ fvm_lnum_t sign = 1;
+
+ ii = coarse_cell[f_face_cell[face_id*2] - 1] - 1;
+ jj = coarse_cell[f_face_cell[face_id*2 + 1] - 1] - 1;
+
+ if (ii != jj) {
+
+ if (ii > jj) {
+ sign = -1;
+ kk = ii;
+ ii = jj;
+ jj = kk;
+ }
+
+ start_id = c_cell_cell_idx[ii];
+ end_id = c_cell_cell_idx[ii] + c_cell_cell_cnt[ii];
+
+ for (kk = start_id; kk < end_id; kk++) {
+ if (c_cell_cell_id[kk] == jj)
+ break;
+ }
+ if (kk == end_id) {
+ c_cell_cell_id[kk] = jj;
+ c_cell_cell_face[kk] = c_n_faces + 1;
+ _c_face_cell[c_n_faces*2] = ii + 1;
+ _c_face_cell[c_n_faces*2 + 1] = jj + 1;
+ c_n_faces++;
+ c_cell_cell_cnt[ii] += 1;
+ }
+ _coarse_face[face_id] = sign*c_cell_cell_face[kk];
+
+ }
+
+ }
+
+ /* Free temporary arrays */
+
+ BFT_FREE(c_cell_cell_cnt);
+ BFT_FREE(c_cell_cell_face);
+ BFT_FREE(c_cell_cell_id);
+ BFT_FREE(c_cell_cell_idx);
+
+ /* Set return values */
+
+ BFT_REALLOC(_c_face_cell, c_n_faces*2, fvm_lnum_t);
+
+ *n_coarse_faces = c_n_faces;
+ *coarse_face = _coarse_face;
+ *coarse_face_cell = _c_face_cell;
+}
+
+/*----------------------------------------------------------------------------
+ * Send prepared coarsening ids (based on halo send lists) and receive
+ * similar values to a cell coarsening array halo.
+ *
+ * parameters:
+ * halo <-> pointer to halo structure
+ * coarse_send <-> values defined on halo send lists
+ * coarse_cell <-> pointer to local cell coarsening array
+ * whose halo values are to be received
+ *----------------------------------------------------------------------------*/
+
+static void
+_exchange_halo_coarsening(const cs_halo_t *halo,
+ cs_int_t coarse_send[],
+ cs_int_t coarse_cell[])
+{
+ fvm_lnum_t i, start, length;
+
+ int local_rank_id = (cs_glob_n_ranks == 1) ? 0 : -1;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ int rank_id;
+ int request_count = 0;
+ const int local_rank = cs_glob_rank_id;
+
+ MPI_Request _request[128];
+ MPI_Request *request = _request;
+ MPI_Status _status[128];
+ MPI_Status *status = _status;
+
+ /* Allocate if necessary */
+
+ if (halo->n_c_domains*2 > 128) {
+ BFT_MALLOC(request, halo->n_c_domains*2, MPI_Request);
+ BFT_MALLOC(status, halo->n_c_domains*2, MPI_Status);
+ }
+
+ /* Receive data from distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start = halo->index[2*rank_id];
+ length = halo->index[2*rank_id + 2] - halo->index[2*rank_id] ;
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ MPI_Irecv(coarse_cell + halo->n_local_elts + start,
+ length,
+ CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+
+ }
+ else
+ local_rank_id = rank_id;
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(cs_glob_mpi_comm);
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ /* If this is not the local rank */
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ start = halo->send_index[2*rank_id];
+ length = halo->send_index[2*rank_id + 2] - halo->send_index[2*rank_id];
+
+ MPI_Isend(coarse_send + start,
+ length,
+ CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ local_rank,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, request, status);
+
+ if (request != _request) {
+ BFT_FREE(request);
+ BFT_FREE(status);
+ }
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ /* Copy local values in case of periodicity */
+
+ if (halo->n_transforms > 0) {
+
+ if (local_rank_id > -1) {
+
+ cs_int_t *_coarse_cell
+ = coarse_cell + halo->n_local_elts + halo->index[2*local_rank_id];
+
+ start = halo->send_index[2*local_rank_id];
+ length = halo->send_index[2*local_rank_id + 2]
+ - halo->send_index[2*local_rank_id];
+
+ for (i = 0; i < length; i++)
+ _coarse_cell[i] = coarse_send[start + i];
+
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Build a halo for a coarse grid from a fine grid and its halo.
+ *
+ * The coarse grid must previously have been initialized with _coarse_init()
+ * and its coarsening indicator determined for the local cells.
+ *
+ * parameters:
+ * f <-- Pointer to fine (parent) grid structure
+ * c <-> Pointer to coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_coarsen_halo(const cs_grid_t *f,
+ cs_grid_t *c)
+{
+ int domain_id, tr_id, section_id;
+ fvm_lnum_t ii, jj;
+ fvm_lnum_t start_id, end_id, sub_count;
+
+ fvm_lnum_t *start_end_id = NULL;
+ fvm_lnum_t *sub_num = NULL;
+ cs_int_t *coarse_send = NULL;
+
+ fvm_lnum_t *restrict coarse_cell = c->coarse_cell;
+
+ cs_halo_t *c_halo = NULL;
+ const cs_halo_t *f_halo = f->halo;
+
+ const fvm_lnum_t c_n_cells = c->n_cells;
+
+ const int stride = f_halo->n_c_domains*4;
+ const int n_sections = f_halo->n_transforms + 1;
+ const int n_f_send = f_halo->n_send_elts[1]; /* Size of full list */
+
+ c_halo = cs_halo_create_from_ref(f_halo);
+
+ c->halo = c_halo;
+ c->_halo = c_halo;
+
+ /* Initialize coarse halo counters */
+
+ c_halo->n_local_elts = c_n_cells;
+ c_halo->n_send_elts[0] = 0;
+ c_halo->n_send_elts[1] = 0;
+
+ for (ii = f->n_cells; ii < f->n_cells_ext; coarse_cell[ii++] = 0);
+
+ /* Allocate and initialize counters */
+
+ BFT_MALLOC(start_end_id, n_sections*2, fvm_lnum_t);
+ BFT_MALLOC(sub_num, c_n_cells, fvm_lnum_t);
+ BFT_MALLOC(coarse_send, n_f_send, cs_int_t);
+
+ for (ii = 0; ii < c_n_cells; ii++)
+ sub_num[ii] = -1;
+
+ for (ii = 0; ii < n_f_send; ii++)
+ coarse_send[ii] = -1;
+
+ /* Counting and marking pass */
+ /*---------------------------*/
+
+ /* Proceed halo section by halo section */
+
+ for (domain_id = 0; domain_id < f_halo->n_c_domains; domain_id++) {
+
+ /* Handle purely parallel cells */
+
+ start_end_id[0] = f_halo->send_index[domain_id*2];
+
+ if (f_halo->n_transforms == 0)
+ start_end_id[1] = f_halo->send_index[(domain_id+1)*2];
+ else
+ start_end_id[1] = f_halo->send_perio_lst[4*domain_id];
+
+ /* Now handle periodic cells transformation by transformation */
+
+ for (tr_id = 0; tr_id < f_halo->n_transforms; tr_id++) {
+ start_end_id[tr_id*2 + 2]
+ = f_halo->send_perio_lst[stride*tr_id + 4*domain_id];
+ start_end_id[tr_id*2 + 3]
+ = start_end_id[tr_id*2 + 2]
+ + f_halo->send_perio_lst[stride*tr_id + 4*domain_id + 1];
+ }
+
+ /* We can now loop on sections independently of the transform */
+
+ for (section_id = 0; section_id < n_sections; section_id++) {
+
+ start_id = start_end_id[section_id*2];
+ end_id = start_end_id[section_id*2 + 1];
+
+ sub_count = 0;
+
+ if (section_id > 0)
+ c_halo->send_perio_lst[stride*(section_id-1) + 4*domain_id]
+ = c_halo->n_send_elts[0];
+
+ /* Build halo renumbering */
+
+ for (ii = start_id; ii < end_id; ii++) {
+ jj = coarse_cell[f_halo->send_list[ii]] - 1;
+ if (sub_num[jj] == -1) {
+ sub_num[jj] = sub_count;
+ sub_count += 1;
+ }
+ coarse_send[ii] = sub_num[jj];
+ }
+
+ /* Update send_list indexes and counts */
+
+ c_halo->n_send_elts[0] += sub_count;
+
+ if (section_id > 0) {
+ c_halo->send_perio_lst[stride*(section_id-1) + 4*domain_id + 1]
+ = sub_count;
+ c_halo->send_perio_lst[stride*(section_id-1) + 4*domain_id + 2]
+ = c_halo->n_send_elts[0];
+ c_halo->send_perio_lst[stride*(section_id-1) + 4*domain_id + 3]
+ = 0;
+ }
+
+ /* Reset sub_num for next section or domain */
+
+ for (ii = start_id; ii < end_id; ii++)
+ sub_num[coarse_cell[f_halo->send_list[ii]] - 1] = -1;
+
+ }
+
+ /* Update send index (initialized at halo creation) */
+
+ c_halo->send_index[domain_id*2 + 1] = c_halo->n_send_elts[0];
+ c_halo->send_index[domain_id*2 + 2] = c_halo->n_send_elts[0];
+
+ }
+
+ /* Exchange and update coarsening list halo */
+ /*------------------------------------------*/
+
+ _exchange_halo_coarsening(f_halo, coarse_send, coarse_cell);
+
+ BFT_FREE(coarse_send);
+
+ /* Proceed halo section by halo section */
+
+ c_halo->n_elts[0] = 0;
+ c_halo->index[0] = 0;
+
+ for (domain_id = 0; domain_id < f_halo->n_c_domains; domain_id++) {
+
+ /* Handle purely parallel cells */
+
+ start_end_id[0] = f_halo->index[domain_id*2];
+
+ if (f_halo->n_transforms == 0)
+ start_end_id[1] = f_halo->index[(domain_id+1)*2];
+ else
+ start_end_id[1] = f_halo->perio_lst[4*domain_id];
+
+ /* Now handle periodic cells transformation by transformation */
+
+ for (tr_id = 0; tr_id < f_halo->n_transforms; tr_id++) {
+ start_end_id[tr_id*2 + 2]
+ = f_halo->perio_lst[stride*tr_id + 4*domain_id];
+ start_end_id[tr_id*2 + 3]
+ = start_end_id[tr_id*2 + 2]
+ + f_halo->perio_lst[stride*tr_id + 4*domain_id + 1];
+ }
+
+ /* We can now loop on sections independently of the transform */
+
+ for (section_id = 0; section_id < n_sections; section_id++) {
+
+ start_id = f_halo->n_local_elts + start_end_id[section_id*2];
+ end_id = f_halo->n_local_elts + start_end_id[section_id*2 + 1];
+
+ sub_count = 0;
+
+ /* Build halo renumbering */
+
+ for (ii = start_id, jj = -1; ii < end_id; ii++) {
+ if (coarse_cell[ii] > jj)
+ jj += 1;
+ coarse_cell[ii] += c_n_cells + c_halo->n_elts[0] + 1;
+ }
+
+ if (section_id > 0) {
+ c_halo->perio_lst[stride*(section_id-1) + 4*domain_id]
+ = c_halo->n_elts[0];
+ c_halo->perio_lst[stride*(section_id-1) + 4*domain_id + 1]
+ = jj + 1;
+ }
+
+ c_halo->n_elts[0] += jj + 1;
+
+ }
+
+ for (tr_id = 0; tr_id < f_halo->n_transforms; tr_id++) {
+ c_halo->perio_lst[stride*tr_id + 4*domain_id + 2]
+ = c_halo->n_elts[0];
+ c_halo->perio_lst[stride*tr_id + 4*domain_id + 3]
+ = 0;
+ }
+
+ /* Update index */
+
+ c_halo->n_elts[1] = c_halo->n_elts[0];
+
+ c_halo->index[domain_id*2 + 1] = c_halo->n_elts[0];
+ c_halo->index[domain_id*2 + 2] = c_halo->n_elts[0];
+ }
+
+ /* Pass to build send list */
+ /*-------------------------*/
+
+ BFT_MALLOC(c_halo->send_list, c_halo->n_send_elts[0], cs_int_t);
+
+ c_halo->n_send_elts[0] = 0;
+
+ /* Proceed halo section by halo section */
+
+ for (domain_id = 0; domain_id < f_halo->n_c_domains; domain_id++) {
+
+ /* Handle purely parallel cells */
+
+ start_end_id[0] = f_halo->send_index[domain_id*2];
+
+ if (f_halo->n_transforms == 0)
+ start_end_id[1] = f_halo->send_index[(domain_id+1)*2];
+ else
+ start_end_id[1] = f_halo->send_perio_lst[4*domain_id];
+
+ /* Now handle periodic cells transformation by transformation */
+
+ for (tr_id = 0; tr_id < f_halo->n_transforms; tr_id++) {
+ start_end_id[tr_id*2 + 2]
+ = f_halo->send_perio_lst[stride*tr_id + 4*domain_id];
+ start_end_id[tr_id*2 + 3]
+ = start_end_id[tr_id*2 + 2]
+ + f_halo->send_perio_lst[stride*tr_id + 4*domain_id + 1];
+ }
+
+ /* We can now loop on sections independently of the transform */
+
+ for (section_id = 0; section_id < n_sections; section_id++) {
+
+ start_id = start_end_id[section_id*2];
+ end_id = start_end_id[section_id*2 + 1];
+
+ sub_count = 0;
+
+ if (section_id > 0)
+ c_halo->send_perio_lst[stride*(section_id-1) + 4*domain_id]
+ = c_halo->n_send_elts[0];
+
+ /* Build halo renumbering */
+
+ for (ii = start_id; ii < end_id; ii++) {
+ jj = coarse_cell[f_halo->send_list[ii]] - 1;
+ if (sub_num[jj] == -1) {
+ sub_num[jj] = sub_count;
+ c_halo->send_list[c_halo->n_send_elts[0] + sub_count] = jj;
+ sub_count += 1;
+ }
+ }
+
+ c_halo->n_send_elts[0] += sub_count;
+
+ /* Reset sub_num for next section or domain */
+
+ for (ii = start_id; ii < end_id; ii++)
+ sub_num[coarse_cell[f_halo->send_list[ii]] - 1] = -1;
+
+ }
+
+ }
+
+ c_halo->n_send_elts[1] = c_halo->n_send_elts[0];
+
+ /* Free memory */
+
+ BFT_FREE(coarse_send);
+ BFT_FREE(sub_num);
+ BFT_FREE(start_end_id);
+}
+
+/*----------------------------------------------------------------------------
+ * Build coarse grid from fine grid
+ *
+ * The coarse grid must previously have been initialized with _coarse_init()
+ * and its coarsening indicator determined (at least for the local cells;
+ * it is extended to halo cells here if necessary).
+ *
+ * - Periodic faces are not handled yet
+ *
+ * parameters:
+ * f <-- Pointer to fine (parent) grid structure
+ * c <-> Pointer to coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_coarsen(const cs_grid_t *f,
+ cs_grid_t *c)
+{
+ fvm_lnum_t ii, jj, face_id;
+
+ fvm_lnum_t c_n_cells = 0;
+
+ const fvm_lnum_t f_n_faces = f->n_faces;
+ const fvm_lnum_t *restrict f_face_cell = f->face_cell;
+
+ /* Sanity check */
+
+ for (face_id = 0; face_id < f_n_faces; face_id++) {
+ ii = f_face_cell[face_id*2] - 1;
+ jj = f_face_cell[face_id*2 + 1] - 1;
+ if (ii == jj)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Connectivity error:\n"
+ "Face %d has same cell %d on both sides."),
+ (int)(face_id+1), (int)(ii+1));
+ }
+
+ /* Compute number of coarse cells */
+
+ for (ii = 0; ii < f->n_cells; ii++) {
+ if (c->coarse_cell[ii] > c_n_cells)
+ c_n_cells = c->coarse_cell[ii];
+ }
+
+ c->n_cells = c_n_cells;
+ c->n_g_cells = c_n_cells;
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+ fvm_gnum_t _c_n_cells = c_n_cells;
+ MPI_Allreduce(&_c_n_cells, &(c->n_g_cells), 1, FVM_MPI_GNUM, MPI_SUM,
+ cs_glob_mpi_comm);
+ }
+#endif
+
+ /* Prolong mesh coarsening indicator to halo cells and build
+ coarse mesh halos if necessary */
+
+ if (f->halo != NULL) {
+ _coarsen_halo(f, c);
+ c->n_cells_ext = c->n_cells + c->halo->n_elts[0];
+ }
+
+ else
+ c->n_cells_ext = c_n_cells;
+
+ /* Build face coarsening and coarse grid face -> cells connectivity */
+
+ _coarsen_faces(f,
+ c->coarse_cell,
+ c->n_cells,
+ &(c->n_faces),
+ &(c->coarse_face),
+ &(c->_face_cell));
+
+ c->face_cell = c->_face_cell;
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create base grid by mapping from shared mesh values.
+ *
+ * Note that as arrays given as arguments are shared by the created grid
+ * (which can only access them, not modify them), the grid should be
+ * destroyed before those arrays.
+ *
+ * parameters:
+ * n_cells <-- Local number of cells
+ * n_cells_ext <-- Local number of cells + ghost cells
+ * n_faces <-- Local number of faces
+ * symmetric <-- True if xam is symmetric, false otherwise
+ * face_cell <-- Face -> cells connectivity (1 to n)
+ * halo <-- Halo structure associated with this level, or NULL.
+ * numbering <-- vectorization or thread-related numbering info, or NULL
+ * cell_cen <-- Cell center (size: 3.n_cells_ext)
+ * cell_vol <-- Cell volume (size: n_cells_ext)
+ * face_normal <-- Internal face normals (size: 3.n_faces)
+ * da <-- Matrix diagonal (size: n_cell_ext)
+ * xa <-- Matrix extra-diagonal terms
+ * (size: n_faces if symmetric, 2.n_faces otherwise)
+ *
+ * returns:
+ * base grid structure
+ *----------------------------------------------------------------------------*/
+
+cs_grid_t *
+cs_grid_create_from_shared(fvm_lnum_t n_cells,
+ fvm_lnum_t n_cells_ext,
+ fvm_lnum_t n_faces,
+ cs_bool_t symmetric,
+ const fvm_lnum_t *face_cell,
+ const cs_halo_t *halo,
+ const cs_numbering_t *numbering,
+ const cs_real_t *cell_cen,
+ const cs_real_t *cell_vol,
+ const cs_real_t *face_normal,
+ const cs_real_t *da,
+ const cs_real_t *xa)
+{
+ fvm_lnum_t ii, jj, kk, face_id;
+
+ cs_grid_t *g = NULL;
+
+ /* Create empty structure and map base data */
+
+ g = _create_grid();
+
+ g->level = 0;
+ g->symmetric = symmetric;
+
+ g->n_cells = n_cells;
+ g->n_cells_ext = n_cells_ext;
+ g->n_faces = n_faces;
+ g->n_g_cells = n_cells;
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+ fvm_gnum_t _n_cells = n_cells;
+ MPI_Allreduce(&_n_cells, &(g->n_g_cells), 1, FVM_MPI_GNUM, MPI_SUM,
+ cs_glob_mpi_comm);
+ }
+#endif
+
+ g->face_cell = face_cell;
+
+ g->cell_cen = cell_cen;
+ g->cell_vol = cell_vol;
+ g->face_normal = face_normal;
+
+ g->halo = halo;
+
+ /* Set shared matrix coefficients */
+
+ g->da = da;
+ g->_da = NULL;
+
+ g->xa = xa;
+ g->_xa = NULL;
+
+ /* Build symmetrized extra-diagonal terms if necessary,
+ or point to existing terms if already symmetric */
+
+ if (symmetric == true) {
+ g->xa0 = g->xa;
+ g->_xa0 = NULL;
+ }
+ else {
+ const cs_real_t *xa_sym = xa + n_faces;
+ BFT_MALLOC(g->_xa0, n_faces, cs_real_t);
+ for (face_id = 0; face_id < n_faces; face_id++)
+ g->_xa0[face_id] = 0.5 * (xa[face_id] + xa_sym[face_id]);
+ g->xa0 = g->_xa0;
+ }
+
+ /* Compute multigrid-specific terms */
+
+ BFT_MALLOC(g->xa0ij, n_faces*3, cs_real_t);
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = face_cell[face_id*2] - 1;
+ jj = face_cell[face_id*2 + 1] - 1;
+ for (kk = 0; kk < 3; kk++)
+ g->xa0ij[face_id*3 + kk] = g->xa0[face_id] * ( cell_cen[jj*3 + kk]
+ - cell_cen[ii*3 + kk]);
+ }
+
+ g->matrix = cs_matrix_create(CS_MATRIX_NATIVE,
+ symmetric,
+ true,
+ false, /* No periodicity here yet */
+ n_cells,
+ n_cells_ext,
+ n_faces,
+ NULL,
+ face_cell,
+ halo,
+ numbering);
+
+ return g;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a grid structure.
+ *
+ * parameters:
+ * grid <-> Pointer to grid structure pointer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_destroy(cs_grid_t **grid)
+{
+ if (grid != NULL && *grid != NULL) {
+
+ cs_grid_t *g = *grid;
+
+ BFT_FREE(g->_face_cell);
+
+ BFT_FREE(g->coarse_cell);
+ BFT_FREE(g->coarse_face);
+
+ if (g->_cell_cen != NULL)
+ BFT_FREE(g->_cell_cen);
+ if (g->_cell_vol != NULL)
+ BFT_FREE(g->_cell_vol);
+ if (g->_face_normal != NULL)
+ BFT_FREE(g->_face_normal);
+
+ if (g->_halo != NULL)
+ g->_halo = cs_halo_destroy(g->_halo);
+
+ if (g->_da != NULL)
+ BFT_FREE(g->_da);
+ if (g->_xa != NULL)
+ BFT_FREE(g->_xa);
+ if (g->_xa0 != NULL)
+ BFT_FREE(g->_xa0);
+
+ BFT_FREE(g->xa0ij);
+
+ cs_matrix_destroy(&(g->matrix));
+
+ BFT_FREE(*grid);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Get grid information.
+ *
+ * parameters:
+ * g <-- Grid structure
+ * level --> Level in multigrid hierarchy (or NULL)
+ * symmetric --> Symmetric matrix coefficients indicator (or NULL)
+ * n_cells_ext --> Number of local cells (or NULL)
+ * n_cells_ext --> Number of cells including ghosts (or NULL)
+ * n_cells_ext --> Number of faces (or NULL)
+ * n_g_cells --> Number of global cells (or NULL)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_get_info(const cs_grid_t *g,
+ int *level,
+ cs_bool_t *symmetric,
+ fvm_lnum_t *n_cells,
+ fvm_lnum_t *n_cells_ext,
+ fvm_lnum_t *n_faces,
+ fvm_gnum_t *n_g_cells)
+{
+ assert(g != NULL);
+
+ if (level != NULL)
+ *level = g->level;
+
+ if (symmetric != NULL)
+ *symmetric = g->symmetric;
+
+ if (n_cells != NULL)
+ *n_cells = g->n_cells;
+ if (n_cells_ext != NULL)
+ *n_cells_ext = g->n_cells_ext;
+ if (n_faces != NULL)
+ *n_faces = g->n_faces;
+
+ if (n_g_cells != NULL)
+ *n_g_cells = g->n_g_cells;
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of cells corresponding to a grid.
+ *
+ * parameters:
+ * g <-- Grid structure
+ *
+ * returns:
+ * number of cells of grid structure
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_grid_get_n_cells(const cs_grid_t *g)
+{
+ assert(g != NULL);
+
+ return g->n_cells;
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of extended (local + ghost) cells corresponding to a grid.
+ *
+ * parameters:
+ * g <-- Grid structure
+ *
+ * returns:
+ * number of extended cells of grid structure
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_grid_get_n_cells_ext(const cs_grid_t *g)
+{
+ assert(g != NULL);
+
+ return g->n_cells_ext;
+}
+
+/*----------------------------------------------------------------------------
+ * Get global number of cells corresponding to a grid.
+ *
+ * parameters:
+ * g <-- Grid structure
+ *
+ * returns:
+ * global number of cells of grid structure
+ *----------------------------------------------------------------------------*/
+
+fvm_gnum_t
+cs_grid_get_n_g_cells(const cs_grid_t *g)
+{
+ assert(g != NULL);
+
+ return g->n_g_cells;
+}
+
+/*----------------------------------------------------------------------------
+ * Get grid's associated matrix information.
+ *
+ * parameters:
+ * g <-- Grid structure
+ * da --> Diagonal matrix coefficients
+ * xa --> Non-diagonal matrix coefficients
+ * m --> Associated matrix structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_get_matrix(const cs_grid_t *g,
+ const cs_real_t **da,
+ const cs_real_t **xa,
+ cs_matrix_t **m)
+{
+ assert(g != NULL);
+
+ if (da != NULL)
+ *da = g->da;
+
+ if (xa != NULL)
+ *xa = g->xa;
+
+ if (m != NULL)
+ *m = g->matrix;
+}
+
+/*----------------------------------------------------------------------------
+ * Create coarse grid from fine grid.
+ *
+ * parameters:
+ * f <-- Fine grid structure
+ * verbosity <-- Verbosity level
+ * agglomeration_limit <-- Maximum allowed fine cells per coarse cell
+ * max_agglomeration <-> Maximum fine cells per coarse cell
+ *
+ * returns:
+ * coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+cs_grid_t *
+cs_grid_coarsen(const cs_grid_t *f,
+ int verbosity,
+ int agglomeration_limit,
+ int *max_agglomeration)
+{
+ cs_int_t iappel, iusmgr;
+ cs_int_t igr;
+ cs_int_t isym = 2;
+ cs_int_t niw = 0, nrw = 0;
+
+ cs_int_t iwarnp = verbosity;
+ cs_int_t f_n_cells = f->n_cells;
+ cs_int_t f_n_cells_ext = f->n_cells_ext;
+ cs_int_t f_n_faces = f->n_faces;
+ cs_int_t c_n_cells = 0;
+ cs_int_t c_n_cells_ext = 0;
+ cs_int_t c_n_faces = 0;
+
+ cs_real_t *rwc1 = NULL, *rwc2 = NULL, *rwc3 = NULL, *rwc4 = NULL;
+
+ cs_grid_t *c = NULL;
+
+ assert(f != NULL);
+
+ /* Initialization */
+
+ c = _coarse_init(f);
+
+ if (f->symmetric == true)
+ isym = 1;
+
+ igr = c->level;
+
+ /* Determine if user or automatic method is chosen */
+
+ iusmgr = 0;
+
+ CS_PROCF (ustmgr, USTMGR) (&iappel, &igr, &isym,
+ &f_n_cells, &f_n_cells_ext, &f_n_faces, &iwarnp,
+ &iusmgr, &niw, &nrw,
+ f->face_cell,
+ f->da, f->xa,
+ f->face_normal, f->cell_vol, f->cell_cen,
+ NULL, NULL, NULL);
+
+ /* Automatic coarsening */
+
+ if (iusmgr == 0) {
+
+ cs_int_t nagmax = agglomeration_limit;
+ cs_int_t iagmax = *max_agglomeration;
+ cs_int_t *indic = NULL, *inombr = NULL;
+ cs_int_t *irsfac = NULL, *indicf = NULL;
+ cs_real_t *w1 = NULL, *w2 = NULL;
+
+ /* Allocate working arrays */
+
+ BFT_MALLOC(indic, f_n_cells_ext*3 + f_n_faces*2, cs_int_t);
+ inombr = indic + f_n_cells_ext;
+ irsfac = inombr + f_n_cells_ext;
+ indicf = irsfac + f_n_faces;
+
+ BFT_MALLOC(w1, f_n_cells_ext*2, cs_real_t);
+ w2 = w1 + f_n_cells_ext;
+
+ /* Determine fine->coarse cell connectivity (agglomeration) */
+
+ CS_PROCF(autmgr, AUTMGR) (&igr, &isym, &iagmax, &nagmax,
+ &f_n_cells, &f_n_cells_ext, &f_n_faces, &iwarnp,
+ f->face_cell,
+ f->da, f->xa,
+ f->face_normal, f->cell_vol, f->cell_cen,
+ c->coarse_cell,
+ indic, inombr, irsfac, indicf, w1, w2);
+
+ /* Free working arrays */
+
+ BFT_FREE(indic);
+ inombr = NULL;
+ irsfac = NULL;
+ indicf = NULL;
+
+ BFT_FREE(w1);
+ w2 = NULL;
+
+ *max_agglomeration = iagmax;
+ }
+
+ /* User coarsening */
+
+ else { /* if iusmgr == 1 */
+
+ cs_int_t *iw = NULL;
+ cs_real_t *rw = NULL;
+
+ BFT_MALLOC(iw, niw, cs_int_t);
+ BFT_MALLOC(rw, nrw, cs_real_t);
+
+ iappel = 2;
+
+ CS_PROCF (ustmgr, USTMGR) (&iappel, &igr, &isym,
+ &f_n_cells, &f_n_cells_ext, &f_n_faces, &iwarnp,
+ &iusmgr, &niw, &nrw,
+ f->face_cell,
+ f->da, f->xa,
+ f->face_normal, f->cell_vol, f->cell_cen,
+ c->coarse_cell,
+ iw, rw);
+
+ BFT_FREE(iw);
+ BFT_FREE(rw);
+
+ }
+
+ /* Build coarse grid connectivity */
+
+ _coarsen(f, c);
+
+ /* Allocate permanent arrays in coarse grid */
+
+ BFT_MALLOC(c->_cell_cen, c->n_cells_ext*3, cs_real_t);
+ c->cell_cen = c->_cell_cen;
+
+ BFT_MALLOC(c->_cell_vol, c->n_cells_ext, cs_real_t);
+ c->cell_vol = c->_cell_vol;
+
+ BFT_MALLOC(c->_face_normal, c->n_faces*3, cs_real_t);
+ c->face_normal = c->_face_normal;
+
+ BFT_MALLOC(c->_da, c->n_cells_ext, cs_real_t);
+ c->da = c->_da;
+
+ BFT_MALLOC(c->_xa, c->n_faces*isym, cs_real_t);
+ c->xa = c->_xa;
+
+ /* We could have xa0 point to xa if symmetric, but this would require
+ caution in CRSTGR to avoid overwriting. */
+
+ BFT_MALLOC(c->_xa0, c->n_faces, cs_real_t);
+ c->xa0 = c->_xa0;
+
+ BFT_MALLOC(c->xa0ij, c->n_faces*3, cs_real_t);
+
+ /* Matrix-related data */
+
+ c_n_cells = c->n_cells;
+ c_n_cells_ext = c->n_cells_ext;
+ c_n_faces = c->n_faces;
+
+ BFT_MALLOC(rwc1, f_n_cells_ext*4, cs_real_t);
+ rwc2 = rwc1 + f_n_cells_ext;
+ rwc3 = rwc2 + f_n_cells_ext;
+ rwc4 = rwc3 + f_n_cells_ext;
+
+ iappel = 1;
+
+ CS_PROCF(crstgr, CRSTGR) (&iappel, &isym, &igr,
+ &f_n_cells, &c_n_cells,
+ &f_n_cells_ext, &c_n_cells_ext,
+ &f_n_faces, &c_n_faces,
+ &iwarnp,
+ f->face_cell, c->face_cell,
+ c->coarse_cell, c->coarse_face,
+ f->cell_vol, f->cell_cen, f->face_normal,
+ f->xa0, f->xa0ij, f->da, f->xa,
+ c->cell_vol, c->cell_cen, c->face_normal,
+ c->_xa0, c->xa0ij, c->_da, c->_xa,
+ rwc1, rwc2, rwc3, rwc4);
+
+ /* Synchronize grid's geometric quantities */
+
+ if (c->halo != NULL) {
+
+ cs_halo_sync_var_strided(c->halo, CS_HALO_STANDARD, c->_cell_cen, 3);
+ if (c->halo->n_transforms > 0)
+ cs_perio_sync_coords(c->halo, CS_HALO_STANDARD, c->_cell_cen);
+
+ cs_halo_sync_var(c->halo, CS_HALO_STANDARD, c->_cell_vol);
+
+ }
+
+ iappel = 2;
+
+ CS_PROCF(crstgr, CRSTGR) (&iappel, &isym, &igr,
+ &f_n_cells, &c_n_cells,
+ &f_n_cells_ext, &c_n_cells_ext,
+ &f_n_faces, &c_n_faces,
+ &iwarnp,
+ f->face_cell, c->face_cell,
+ c->coarse_cell, c->coarse_face,
+ f->cell_vol, f->cell_cen, f->face_normal,
+ f->xa0, f->xa0ij, f->da, f->xa,
+ c->cell_vol, c->cell_cen, c->face_normal,
+ c->_xa0, c->xa0ij, c->_da, c->_xa,
+ rwc1, rwc2, rwc3, rwc4);
+
+ /* Synchronize matrix's geometric quantities */
+
+ if (c->halo != NULL)
+ cs_halo_sync_var(c->halo, CS_HALO_STANDARD, c->_da);
+
+ BFT_FREE(rwc1);
+ rwc2 = NULL;
+ rwc3 = NULL;
+ rwc4 = NULL;
+
+ c->matrix = cs_matrix_create(CS_MATRIX_NATIVE,
+ c->symmetric,
+ true,
+ false, /* No periodicity here yet */
+ c->n_cells,
+ c->n_cells_ext,
+ c->n_faces,
+ NULL,
+ c->face_cell,
+ c->halo,
+ NULL);
+
+ /* Return new (coarse) grid */
+
+ return c;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute coarse cell variable values from fine cell values
+ *
+ * parameters:
+ * f <-- Fine grid structure
+ * c <-- Fine grid structure
+ * f_var <-- Variable defined on fine grid cells
+ * c_var --> Variable defined on coarse grid cells
+ *
+ * returns:
+ * coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_restrict_cell_var(const cs_grid_t *f,
+ const cs_grid_t *c,
+ const cs_real_t *f_var,
+ cs_real_t *c_var)
+{
+ fvm_lnum_t ii;
+
+ const fvm_lnum_t *coarse_cell;
+
+ fvm_lnum_t f_n_cells = f->n_cells;
+ fvm_lnum_t c_n_cells_ext = c->n_cells_ext;
+
+ assert(f != NULL);
+ assert(c != NULL);
+ assert(c->coarse_cell != NULL);
+ assert(f_var != NULL);
+ assert(c_var != NULL);
+
+ /* Set coarse values */
+
+ coarse_cell = c->coarse_cell;
+
+ for (ii = 0; ii < c_n_cells_ext; ii++)
+ c_var[ii] = 0.0;
+
+ for (ii = 0; ii < f_n_cells; ii++)
+ c_var[coarse_cell[ii] - 1] += f_var[ii];
+}
+
+/*----------------------------------------------------------------------------
+ * Compute fine cell variable values from coarse cell values
+ *
+ * parameters:
+ * c <-- Fine grid structure
+ * f <-- Fine grid structure
+ * c_var --> Variable defined on coarse grid cells
+ * f_var <-- Variable defined on fine grid cells
+ *
+ * returns:
+ * coarse grid structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_prolong_cell_var(const cs_grid_t *c,
+ const cs_grid_t *f,
+ const cs_real_t *c_var,
+ cs_real_t *f_var)
+{
+ fvm_lnum_t ii;
+ const fvm_lnum_t *coarse_cell;
+
+ fvm_lnum_t f_n_cells = f->n_cells;
+
+ assert(f != NULL);
+ assert(c != NULL);
+ assert(c->coarse_cell != NULL);
+ assert(f_var != NULL);
+ assert(c_var != NULL);
+
+ /* Set fine values */
+
+ coarse_cell = c->coarse_cell;
+
+ for (ii = 0; ii < f_n_cells; ii++)
+ f_var[ii] = c_var[coarse_cell[ii] - 1];
+}
+
+/*----------------------------------------------------------------------------
+ * Project coarse grid cell numbers to base grid.
+ *
+ * If a global coarse grid cell number is larger than max_num, its
+ * value modulo max_num is used.
+ *
+ * parameters:
+ * g <-- Grid structure
+ * n_base_cells <-- Number of cells in base grid
+ * max_num <-- Values of c_cell_num = global_num % max_num
+ * c_cell_num --> Global coarse cell number (modulo max_num)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_project_cell_num(const cs_grid_t *g,
+ fvm_lnum_t n_base_cells,
+ int max_num,
+ int c_cell_num[])
+{
+ fvm_lnum_t ii = 0;
+ fvm_gnum_t base_shift = 1;
+ fvm_gnum_t _max_num = max_num;
+
+ assert(g != NULL);
+ assert(c_cell_num != NULL);
+
+ /* Initialize array */
+
+ for (ii = 0; ii < n_base_cells; ii++)
+ c_cell_num[ii] = 0;
+
+ if (g->level == 0)
+ return;
+
+ /* Compute local base starting cell number in parallel mode */
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+ fvm_gnum_t local_shift = g->n_cells;
+ fvm_gnum_t global_shift = 0;
+ MPI_Scan(&local_shift, &global_shift, 1, FVM_MPI_GNUM, MPI_SUM,
+ cs_glob_mpi_comm);
+ base_shift = 1 + global_shift - g->n_cells;
+ }
+#endif
+
+ if (g->level == 1) {
+
+ for (ii = 0; ii < n_base_cells; ii++)
+ c_cell_num[ii]
+ = ((fvm_gnum_t)(g->coarse_cell[ii]) + base_shift) % _max_num;
+
+ }
+ else { /* if g->level > 1) */
+
+ fvm_lnum_t *tmp_num_1 = NULL, *tmp_num_2 = NULL;
+ const cs_grid_t *_g = g;
+
+ /* Allocate temporary arrays */
+
+ BFT_MALLOC(tmp_num_1, n_base_cells, fvm_lnum_t);
+ BFT_MALLOC(tmp_num_2, n_base_cells, fvm_lnum_t);
+
+ for (ii = 0; ii < g->n_cells; ii++)
+ tmp_num_1[ii] = ii;
+
+ for (_g = g; _g->level > 1; _g = _g->parent) {
+
+ fvm_lnum_t n_parent_cells = _g->parent->n_cells;
+
+ for (ii = 0; ii < n_parent_cells; ii++)
+ tmp_num_2[ii] = tmp_num_1[_g->coarse_cell[ii] - 1];
+
+ for (ii = 0; ii < n_parent_cells; ii++)
+ tmp_num_1[ii] = tmp_num_2[ii];
+
+ }
+
+ assert(_g->level == 1);
+ assert(_g->parent->n_cells == n_base_cells);
+
+ for (ii = 0; ii < n_base_cells; ii++)
+ c_cell_num[ii]
+ = ((fvm_gnum_t)(tmp_num_1[_g->coarse_cell[ii] - 1]) + base_shift)
+ % _max_num;
+
+ /* Free temporary arrays */
+
+ BFT_FREE(tmp_num_1);
+ BFT_FREE(tmp_num_2);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Project variable from coarse grid to base grid
+ *
+ * parameters:
+ * g <-- Grid structure
+ * n_base_cells <-- Number of cells in base grid
+ * c_var <-- Cell variable on coarse grid
+ * f_var --> Cell variable projected to fine grid
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_project_var(const cs_grid_t *g,
+ fvm_lnum_t n_base_cells,
+ const cs_real_t c_var[],
+ cs_real_t f_var[])
+{
+ fvm_lnum_t ii;
+
+ assert(g != NULL);
+ assert(c_var != NULL);
+ assert(f_var != NULL);
+
+ if (g->level == 0)
+ memcpy(f_var, c_var, n_base_cells*sizeof(cs_real_t));
+
+ /* Project to finer levels */
+
+ else if (g->level == 1) {
+
+ for (ii = 0; ii < n_base_cells; ii++)
+ f_var[ii] = c_var[g->coarse_cell[ii] - 1];
+
+ }
+ else { /* if g->level > 1) */
+
+ cs_real_t *tmp_var_1 = NULL, *tmp_var_2 = NULL;
+ const cs_grid_t *_g = g;
+
+ /* Allocate temporary arrays */
+
+ BFT_MALLOC(tmp_var_1, n_base_cells, cs_real_t);
+ BFT_MALLOC(tmp_var_2, n_base_cells, cs_real_t);
+
+ for (ii = 0; ii < g->n_cells; ii++)
+ tmp_var_1[ii] = c_var[ii];
+
+ for (_g = g; _g->level > 1; _g = _g->parent) {
+
+ fvm_lnum_t n_parent_cells = _g->parent->n_cells;
+
+ for (ii = 0; ii < n_parent_cells; ii++)
+ tmp_var_2[ii] = tmp_var_1[_g->coarse_cell[ii] - 1];
+
+ for (ii = 0; ii < n_parent_cells; ii++)
+ tmp_var_1[ii] = tmp_var_2[ii];
+
+ }
+
+ assert(_g->level == 1);
+ assert(_g->parent->n_cells == n_base_cells);
+
+ for (ii = 0; ii < n_base_cells; ii++)
+ f_var[ii] = tmp_var_1[_g->coarse_cell[ii] - 1];
+
+ /* Free temporary arrays */
+
+ BFT_FREE(tmp_var_1);
+ BFT_FREE(tmp_var_2);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Compute diagonal dominance metric and project it to base grid
+ *
+ * parameters:
+ * g <-- Grid structure
+ * n_base_cells <-- Number of cells in base grid
+ * diag_dom --> Diagonal dominance metric (on fine grid)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_grid_project_diag_dom(const cs_grid_t *g,
+ fvm_lnum_t n_base_cells,
+ cs_real_t diag_dom[])
+{
+ fvm_lnum_t ii, jj, face_id;
+
+ cs_real_t *dd = NULL;
+
+ assert(g != NULL);
+ assert(diag_dom != NULL);
+
+ if (g->level == 0)
+ dd = diag_dom;
+ else
+ BFT_MALLOC(dd, g->n_cells_ext, cs_real_t);
+
+ /* Compute coarse diagonal dominance */
+
+ {
+ const fvm_lnum_t n_cells = g->n_cells;
+ const fvm_lnum_t n_faces = g->n_faces;
+ const fvm_lnum_t *face_cel = g->face_cell;
+
+ /* Diagonal part of matrix.vector product */
+
+ for (ii = 0; ii < n_cells; ii++)
+ dd[ii] = fabs(g->da[ii]);
+
+ if (g->halo != NULL)
+ cs_halo_sync_var(g->halo, CS_HALO_STANDARD, dd);
+
+ if (g->symmetric) {
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = face_cel[2*face_id] -1;
+ jj = face_cel[2*face_id + 1] -1;
+ dd[ii] -= fabs(g->xa[face_id]);
+ dd[jj] -= fabs(g->xa[face_id]);
+ }
+ }
+ else {
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = face_cel[2*face_id] -1;
+ jj = face_cel[2*face_id + 1] -1;
+ dd[ii] -= fabs(g->xa[face_id]);
+ dd[jj] -= fabs(g->xa[face_id + n_faces]);
+ }
+ }
+
+ for (ii = 0; ii < n_cells; ii++) {
+ if (fabs(g->da[ii]) > 1.e-18)
+ dd[ii] /= fabs(g->da[ii]);
+ }
+
+ }
+
+ /* Now project to finer levels */
+
+ if (dd != diag_dom) {
+ cs_grid_project_var(g, n_base_cells, dd, diag_dom);
+ BFT_FREE(dd);
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui.c b/src/base/cs_gui.c
new file mode 100644
index 0000000..d7fdd50
--- /dev/null
+++ b/src/base/cs_gui.c
@@ -0,0 +1,5077 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: main parameters
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * libxml2 library headers
+ *----------------------------------------------------------------------------*/
+
+#if defined(HAVE_LIBXML2)
+
+#include <libxml/tree.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include "fvm_selector.h"
+
+/*----------------------------------------------------------------------------
+ * MEI library headers
+ *----------------------------------------------------------------------------*/
+
+#ifdef HAVE_MEI
+
+#include "mei_evaluate.h"
+
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui_util.h"
+#include "cs_gui_variables.h"
+#include "cs_gui_boundary_conditions.h"
+#include "cs_gui_specific_physics.h"
+#include "cs_gui_mobile_mesh.h"
+#include "cs_mesh.h"
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* debugging switch */
+#define _XML_DEBUG_ 0
+
+/*============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * External global variables
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Management of the XML document
+ *----------------------------------------------------------------------------*/
+
+#if defined(HAVE_LIBXML2)
+extern xmlXPathContextPtr xpathCtx; /* Pointer on the Context */
+extern xmlNodePtr node; /* Pointer on the root node */
+#endif
+
+/*============================================================================
+ * Private global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Pointer on the main variable structure */
+
+cs_var_t *cs_glob_var = NULL;
+cs_label_t *cs_glob_label = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Copy a variable name to private variable names array
+ *
+ * parameters:
+ * varname --> name or label of the variable/scalar/property
+ * ipp --> index from the fortran array associated to varname
+ *----------------------------------------------------------------------------*/
+
+static void
+_gui_copy_varname(const char *varname, int ipp)
+{
+ size_t l;
+
+ if (ipp < 1 || ipp > cs_glob_label->_cs_gui_last_var)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Variable index %d out of bounds (1 to %d)"),
+ ipp, cs_glob_label->_cs_gui_last_var);
+
+ l = strlen(varname);
+
+ if (cs_glob_label->_cs_gui_var_name[ipp-1] == NULL)
+ BFT_MALLOC(cs_glob_label->_cs_gui_var_name[ipp-1], l + 1, char);
+
+ else if (strlen(cs_glob_label->_cs_gui_var_name[ipp-1]) != l)
+ BFT_REALLOC(cs_glob_label->_cs_gui_var_name[ipp-1], l + 1, char);
+
+ strcpy(cs_glob_label->_cs_gui_var_name[ipp-1], varname);
+}
+
+/*----------------------------------------------------------------------------
+ * Turbulence model parameters.
+ *
+ * parameters:
+ * param --> name of the parameters
+ * keyword <-- turbulence model parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_advanced_options_turbulence(const char *const param,
+ int *const keyword)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "thermophysical_models", "turbulence", param);
+
+ if (cs_gui_strcmp("gravity_terms", param)) {
+
+ cs_xpath_add_attribute(&path, "status");
+ if (cs_gui_get_status(path, &result)) *keyword = result;
+
+ } else if (cs_gui_strcmp("scale_model", param)) {
+
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_int(path, &result)) *keyword = result;
+
+ } else
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the name of the related scalar if the scalar "num_sca" is a variance
+ *
+ * parameter:
+ * num_sca --> scalar number
+ *----------------------------------------------------------------------------*/
+
+static char *
+cs_gui_scalar_variance(const int num_sca)
+{
+ char *path = NULL;
+ char *variance = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "additional_scalars");
+ cs_xpath_add_element_num(&path, "scalar", num_sca);
+ cs_xpath_add_element(&path, "variance");
+ cs_xpath_add_function_text(&path);
+
+ variance = cs_gui_get_text_value(path);
+
+ BFT_FREE(path);
+
+ return variance;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the user thermal scalar indicator.
+ *----------------------------------------------------------------------------*/
+
+static int
+cs_gui_thermal_scalar(void)
+{
+ char *model_name = NULL;
+ int test = 0;
+
+ model_name = cs_gui_get_thermophysical_model("thermal_scalar");
+
+ if (cs_gui_strcmp(model_name, "off"))
+ test = 0;
+ else {
+ if (cs_gui_strcmp(model_name, "enthalpy"))
+ test = 2 ;
+ else if (cs_gui_strcmp(model_name, "temperature_kelvin"))
+ test = 1 ;
+ else if (cs_gui_strcmp(model_name, "temperature_celsius"))
+ test = -1 ;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid thermal model: %s\n"), model_name);
+ }
+
+ BFT_FREE(model_name);
+
+ return test;
+}
+
+/*----------------------------------------------------------------------------
+ * Get thermal user scalar number if it is exist.
+ *
+ * parameters:
+ * iscalt <-- thermal scalar number order
+ * iscsth <-- nature of the thermal scalar (C, K, J/kg)
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_thermal_scalar_number(int *const iscalt,
+ int *const iscsth)
+{
+ int ind_thermal;
+ int i, index, size;
+ int iphas = 0;
+ char *path = NULL;
+ char **name = NULL;
+
+ ind_thermal = cs_gui_thermal_scalar();
+
+ if (ind_thermal) {
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "additional_scalars", "/@type");
+ name = cs_gui_get_attribute_values(path, &size);
+
+ index = -1;
+ for (i=0; i < size; i++) {
+ if (cs_gui_strcmp(name[i], "thermal")) index = i;
+ }
+ iscalt[iphas] = index+1;
+ iscsth[index] = ind_thermal;
+
+ BFT_FREE(path);
+ for (i=0; i < size; i++) BFT_FREE(name[i]);
+ BFT_FREE(name);
+ }
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the name of the diffusion_coefficient property for a scalar
+ *
+ * parameters:
+ * scalar_index --> index of the scalar
+ *----------------------------------------------------------------------------*/
+
+static char *
+_scalar_diffusion_coefficient_name(const int idx)
+{
+ int ncar = 0;
+ char *name = NULL;
+ char *suf = NULL;
+
+ ncar = cs_gui_characters_number(idx+1);
+ BFT_MALLOC(name, strlen("diffusion_coefficient") +2 +ncar, char);
+ BFT_MALLOC(suf, 1 + ncar, char);
+ sprintf(suf, "%i", idx+1);
+ strcpy(name, "diffusion_coefficient");
+ strcat(name, "_");
+ strcat(name, suf);
+ BFT_FREE(suf);
+ return name;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the value of choice for user scalar's property
+ *
+ * parameters:
+ * scalar_num --> number of scalar
+ * choice --> choice for property
+ *----------------------------------------------------------------------------*/
+
+static int
+cs_gui_scalar_properties_choice(const int scalar_num, int *const choice)
+{
+ char *path = NULL;
+ char *buff = NULL;
+ int ichoice;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "additional_scalars");
+ cs_xpath_add_element_num(&path, "scalar", scalar_num);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_attribute(&path, "choice");
+
+ buff = cs_gui_get_attribute_value(path);
+
+ if (buff == NULL) {
+ ichoice = 0;
+
+ } else {
+ ichoice = 1;
+
+ if (cs_gui_strcmp(buff, "variable") || cs_gui_strcmp(buff, "user_law"))
+ *choice = 1;
+ else if (cs_gui_strcmp(buff, "constant"))
+ *choice = 0;
+ else
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+ }
+
+ BFT_FREE(path);
+ BFT_FREE(buff);
+
+ return ichoice;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return value of diffusion coefficient for user scalars
+ * return 1 if value exists
+ * return 0 if not
+ *
+ * parameters:
+ * num_sca --> number of scalar
+ * value <-- value of diffusion coefficient
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_scalar_diffusion_value(const int num_sca,
+ double *const value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "additional_scalars");
+ cs_xpath_add_element_num(&path, "scalar", num_sca);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_element(&path, "initial_value");
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ *value = result;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get the status of steady management.
+ *
+ * parameter:
+ * keyword <-- if 1 unsteady management else steady management
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_get_steady_status(int *const keyword)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "steady_management");
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result))
+ *keyword = result;
+ else
+ *keyword = 1;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return parameters for steady management.
+ *
+ * parameter:
+ * param --> steady parameter
+ * keyword <-- new value for the steady parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_steady_parameters(const char *const param,
+ double *const keyword)
+{
+ char *path = NULL;
+ double result = 0.0;
+ int status = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "steady_management", param);
+
+ if (cs_gui_strcmp(param,"zero_iteration")){
+
+ cs_xpath_add_attribute(&path, "status");
+ if(cs_gui_get_status(path, &status)) *keyword = status;
+
+ } else {
+
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_double(path, &result)) *keyword = result;
+
+ }
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Modify time parameters.
+ *
+ * parameters:
+ * param --> time parameter
+ * keyword <-- new value of the time parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_time_parameters(const char *const param,
+ double *const keyword)
+{
+ char *path = NULL;
+ double result = 0.0;
+ int status = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "time_parameters", param);
+
+ if (cs_gui_strcmp(param,"zero_time_step") ||
+ cs_gui_strcmp(param,"thermal_time_step")) {
+
+ cs_xpath_add_attribute(&path, "status");
+ if(cs_gui_get_status(path, &status)) *keyword = status;
+
+ } else {
+
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_double(path, &result)) *keyword = result;
+
+ }
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Modify restart parameters.
+ *
+ * parameters:
+ * param --> restart parameter
+ * keyword <--> new value of the restart parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_restart_parameters_status(const char *const param,
+ int *const keyword)
+{
+ int result;
+ char *path = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "calcul_management", "start_restart", param);
+ cs_xpath_add_attribute(&path, "status");
+
+ if(cs_gui_get_status(path, &result))
+ *keyword = result;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return value of numerical parameter markup
+ *
+ * parameters:
+ * variable_type --> name of variable
+ * value_type --> name of numerical parameter parkup
+ * value <-- value of numerical parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_variable_value(const char *const variable_type,
+ const char *const value_type,
+ double *const value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "variable");
+ cs_xpath_add_test_attribute(&path, "name", variable_type);
+ cs_xpath_add_element(&path, value_type);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result)) *value = result;
+
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the attribute value from the xpath query.
+ *
+ * parameters:
+ * path --> path for xpath query
+ * child --> child markup
+ * keyword <-- value of attribute node
+ *----------------------------------------------------------------------------*/
+
+static void
+_attribute_value( char * path,
+ const char *const child,
+ int *const keyword)
+{
+ char *choice = NULL;
+ int result;
+
+ assert(path != NULL);
+ assert(child != NULL);
+
+ if (cs_gui_strcmp(child, "order_scheme")) {
+
+ /* *keyword = 1; */
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+
+ if (cs_gui_strcmp(choice, "centered"))
+ *keyword = 1;
+ else if (cs_gui_strcmp(choice, "solu"))
+ *keyword = 0;
+ BFT_FREE(choice);
+
+ } else {
+
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result)) {
+ *keyword = result;
+
+ if (cs_gui_strcmp(child, "slope_test")) {
+ if (result == 1) *keyword = 0;
+ if (result == 0) *keyword = 1;
+ }
+ } else {
+
+ if (cs_gui_strcmp(child, "postprocessing_recording") ||
+ cs_gui_strcmp(child, "listing_printing")) *keyword = 1;
+
+ }
+ }
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the attribute value associated to a child markup from a variable.
+ *
+ * parameters:
+ * name --> name of the variable markup
+ * child --> child markup
+ * keyword <-- value of attribute node contained in the child markup
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_variable_attribute(const char *const name,
+ const char *const child,
+ int *const keyword)
+{
+ char *path = NULL;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "variable");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, child);
+
+ _attribute_value(path, child, keyword);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the text value associated to a child markup from a scalar.
+ *
+ * parameters:
+ * label --> label of the scalar markup
+ * child --> name of the child markup
+ * value <-- value of text node contained in the child markup
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_scalar_value(const char *const label,
+ const char *const child,
+ double *const value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "scalar");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, child);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result)) *value = result;
+
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the attribute value associated to a child markup from a scalar.
+ *
+ * parameters:
+ * label --> name of the scalar markup
+ * child --> child markup
+ * keyword <-- value of attribute node contained in the child markup
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_scalar_attribute(const char *const label,
+ const char *const child,
+ int *const keyword)
+{
+ char *path = NULL;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "scalar");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, child);
+
+ _attribute_value(path, child, keyword);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get values related the modelling scalar: min, max ...
+ *
+ * returns:
+ * 1 if value exists
+ * 0 otherwise
+ * the result is stored in "value"
+ *----------------------------------------------------------------------------*/
+
+
+static void
+cs_gui_model_scalar_value(const char *const model,
+ const char *const name,
+ const char *const keyword,
+ double *const value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "scalar");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, keyword);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path,&result))
+ *value = result;
+
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the attribute value associated to a child markup from a scalar.
+ *
+ * parameters:
+ * model --> model markup
+ * name --> name of the scalar markup
+ * child --> child markup
+ * keyword <-- value of attribute node contained in the child markup
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_model_scalar_output_status(const char *const model,
+ const char *const name,
+ const char *const child,
+ int *const keyword)
+{
+ char *path = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "scalar");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, child);
+
+ _attribute_value(path, child, keyword);
+}
+
+/*-----------------------------------------------------------------------------
+ * Modify double numerical parameters.
+ *
+ * parameters:
+ * param --> label of the numerical parameter
+ * keyword <--> value of the numerical parameter
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_numerical_double_parameters(const char *const param,
+ double *const keyword)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "numerical_parameters");
+ cs_xpath_add_element(&path, param);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ *keyword = result;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Modify integer numerical parameters.
+ *
+ * parameters:
+ * param --> label of the numerical parameter
+ * keyword <--> value of the numerical parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_numerical_int_parameters(const char *const param,
+ int *const keyword)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "numerical_parameters");
+ cs_xpath_add_element(&path, param);
+
+ if (cs_gui_strcmp(param, "gradient_reconstruction")){
+
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+ if (choice) *keyword = atoi(choice);
+ BFT_FREE(choice);
+
+ } else {
+
+ cs_xpath_add_attribute(&path, "status");
+ if (cs_gui_get_status(path, &result)) *keyword = result;
+
+ }
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Modify gravity parameters.
+ *
+ * parameters:
+ * param --> gravity parameter (GX, GY, GZ)
+ * keyword <--> new value of the gravity parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_gravity_value(const char *const param,
+ double *const value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "physical_properties", "gravity", param);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result)) *value = result;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get initial value from property markup.
+ *
+ * parameters:
+ * property_name --> name of the property
+ * value <-- new initial value of the property
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_properties_value(const char *const property_name,
+ double *const value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", property_name);
+ cs_xpath_add_element(&path, "initial_value");
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result)) *value = result;
+
+ BFT_FREE(path);
+}
+/*----------------------------------------------------------------------------
+ * Return the value of the choice attribute from a property name.
+ *
+ * parameters:
+ * property_name --> name of the property
+ *----------------------------------------------------------------------------*/
+
+static char*
+_properties_choice(const char *const property_name)
+{
+ char *path = NULL;
+ char *choice = NULL;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", property_name);
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+ BFT_FREE(path);
+ return choice;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the value of the choice attribute from a property markup.
+ * Return 1 if the xpath request has succeeded, 0 otherwise.
+ *
+ * parameters:
+ * property_name --> name of the property
+ * choice <-- value of the attribute choice
+ *----------------------------------------------------------------------------*/
+
+static int
+cs_gui_properties_choice(const char *const property_name, int *choice)
+{
+ char *buff = NULL;
+ int iok = 0;
+
+ buff = _properties_choice(property_name);
+ if (buff)
+ {
+ iok = 1;
+ if (cs_gui_strcmp(buff, "variable") || cs_gui_strcmp(buff, "user_law"))
+ *choice = 1;
+ else if (cs_gui_strcmp(buff, "constant"))
+ *choice = 0;
+ }
+ else
+ iok = 0;
+ BFT_FREE(buff);
+ return iok;
+}
+
+/*-----------------------------------------------------------------------------
+ * Get reference value of pressure
+ *
+ * parameters:
+ * p0 <-- value of pressure
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_reference_pressure(double *const p0)
+{
+ char *path = NULL;
+ double value;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "reference_pressure");
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &value))
+ *p0 = value;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get reference value of temperature
+ *
+ * parameters:
+ * model --> name of activated model
+ * t0 <-- value of temperature
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_reference_temperature(char *const model, double *const t0)
+{
+ char *path = NULL;
+ double value;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_elements(&path, 2, model,"reference_temperature");
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &value)) *t0 = value;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get reference value of mass molar molecular
+ *
+ * parameters:
+ * model --> name of activated model
+ * m0 <-- value of mass molar molecular
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_reference_mass_molar(char *const model, double *const m0)
+{
+ char *path = NULL;
+ double value;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_elements(&path, 2, model,"reference_mass_molar");
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &value)) *m0 = value;
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Turbulence model parameters.
+ *
+ * parameters:
+ * param --> name of the parameters
+ * keyword <-- turbulence model parameter
+ *----------------------------------------------------------------------------*/
+
+static void _option_turbulence_double(const char *const param,
+ double *const keyword)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "thermophysical_models", "turbulence", param);
+
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_double(path, &result)) *keyword = result;
+
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialization choice of the turbulence variables parameters.
+ *
+ * parameters:
+ * param --> name of the parameters
+ * value <-- initialization choice
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_turbulence_initialization(const char *const param,
+ double *const value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4,
+ "thermophysical_models",
+ "turbulence",
+ "initialization",
+ param);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result)) *value = result;
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Return the initialization choice of the turbulence variables.
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_turbulence_initialization_choice(void)
+{
+ char *path = NULL;
+ char *initialization_choice;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3,
+ "thermophysical_models",
+ "turbulence",
+ "initialization");
+ cs_xpath_add_attribute(&path, "choice");
+
+ initialization_choice = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return initialization_choice;
+}
+
+/*================================
+ * Input / Output
+ *===============================*/
+
+/*----------------------------------------------------------------------------
+ * Get output control value parameters.
+ *
+ * parameters:
+ * param --> name of the parameter
+ * keyword <-- output control parameter
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_output_value(const char *const param,
+ int *const keyword)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "output", param);
+
+ if (cs_gui_strcmp(param, "auxiliary_restart_file_writing") ||
+ cs_gui_strcmp(param, "fluid_domain") ||
+ cs_gui_strcmp(param, "domain_boundary") ||
+ cs_gui_strcmp(param, "syrthes_boundary") ) {
+
+ cs_xpath_add_attribute(&path, "status");
+ if(cs_gui_get_status(path, &result)) *keyword = result;
+
+ }else if (cs_gui_strcmp(param, "postprocessing_mesh_options")){
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+ if (choice) *keyword = atoi(choice);
+ } else {
+
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_int(path, &result)) *keyword = result;
+
+ }
+
+ BFT_FREE(choice);
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Return the output format and options for postprocessing.
+ *
+ * parameters:
+ * param --> "postprocessing_format" or "postprocessing_options"
+ *----------------------------------------------------------------------------*/
+
+static char *
+_output_choice(const char *const param)
+{
+ char *path = NULL;
+ char *choice = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "output", param);
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+ BFT_FREE(path);
+ return choice;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the output format and options for postprocessing.
+ *
+ * parameters:
+ * param --> name of the parameter
+ * keyword <-- output control parameter
+ * size_key --> keyword string size
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_output_choice(const char *const param,
+ char *const keyword,
+ const int *const size_key)
+{
+ char *choice = NULL;
+ choice = _output_choice(param);
+ if (choice != NULL) cs_gui_strcpy_c2f(keyword, choice, *size_key);
+ BFT_FREE(choice);
+}
+
+/*----------------------------------------------------------------------------
+ * Get postprocessing value parameters for surfacic variables
+ *
+ * parameters:
+ * name --> name of the parameter
+ * keyword <-- output control parameter
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_surfacic_variable_post(const char *const name,
+ const int *const param,
+ int *const ipstdv)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, "postprocessing_recording");
+ cs_xpath_add_attribute(&path, "status");
+ if (cs_gui_get_status(path, &result)) {
+ if (result == 0)
+ *ipstdv = *ipstdv / *param;
+ }
+ BFT_FREE(path);
+}
+
+
+/*==================================
+ * TREATMENTS FOR TIME AVERAGES
+ *=================================*/
+
+/*----------------------------------------------------------------------------
+ * Get list of variables or properties or scalar's names for calculation mean
+ *
+ * parameters:
+ * id --> number of mean (imom)
+ * list <-- output control parameter
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_get_mean_names_number( int const id)
+{
+ char *path = NULL;
+ char *str_id = NULL;
+ int number = 0;
+
+ BFT_MALLOC(str_id,
+ cs_gui_characters_number(id)+1,
+ char);
+ sprintf(str_id, "%i", id);
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "time_averages", "time_average");
+ cs_xpath_add_test_attribute(&path, "id", str_id);
+ cs_xpath_add_element(&path, "var_prop");
+ number = cs_gui_get_nb_element(path);
+
+ BFT_FREE(str_id);
+ BFT_FREE(path);
+
+ return number;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get mean value parameters.
+ *
+ * parameters:
+ * id --> number of mean (imom)
+ * param --> name of the parameter
+ * keyword <-- output control parameter
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_get_mean_value( int const id,
+ const char *const param,
+ int *const keyword)
+{
+ char *path = NULL;
+ char *str_id = NULL;
+ int result = 0;
+
+ BFT_MALLOC(str_id,
+ cs_gui_characters_number(id)+1,
+ char);
+ sprintf(str_id, "%i", id);
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "time_averages", "time_average");
+ cs_xpath_add_test_attribute(&path,"id",str_id);
+ cs_xpath_add_element(&path, param);
+
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_int(path, &result)) *keyword = result;
+
+ BFT_FREE(path);
+ BFT_FREE(str_id);
+}
+
+/*----------------------------------------------------------------------------
+ * Get variable or properties or scalar's name for one mean
+ *
+ * parameters:
+ * id --> number of mean (imom)
+ * nb --> number of order in list of var_prop of the mean
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_get_mean_prop(const int id, const int nb)
+{
+ char *path = NULL;
+ char *name = NULL;
+ char *str_id = NULL;
+
+ BFT_MALLOC(str_id,
+ cs_gui_characters_number(id)+1,
+ char);
+ sprintf(str_id, "%i", id);
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "time_averages", "time_average");
+ cs_xpath_add_test_attribute(&path,"id",str_id);
+ cs_xpath_add_element_num(&path, "var_prop", nb);
+ cs_xpath_add_attribute(&path, "name");
+
+ name = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+ BFT_FREE(str_id);
+
+ return name;
+}
+
+/*----------------------------------------------------------------------------
+ * Get label of mean
+ *
+ * parameters:
+ * nb --> number of order in list of mean
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_get_mean_label(const int nb)
+{
+ char *path = NULL;
+ char *label = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "analysis_control", "time_averages");
+ cs_xpath_add_element_num(&path, "time_average", nb);
+ cs_xpath_add_attribute(&path,"label");
+
+ label = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return label;
+}
+
+/*===================
+ * FOR PROBES
+ *==================*/
+
+/*-----------------------------------------------------------------------------
+ * Return a single coordinate of a monitoring probe
+ *
+ * parameters
+ * num_probe --> number aka name of the monitoring probe
+ * probe_coord --> one coordinate of the monitoring probe
+ *----------------------------------------------------------------------------*/
+
+static double cs_gui_probe_coordinate(const int num_probe,
+ const char *const probe_coord)
+{
+ char *path = NULL;
+ char *str_num_probe = NULL;
+ double result = 0.0;
+
+ assert(num_probe>0);
+
+ BFT_MALLOC(str_num_probe,
+ cs_gui_characters_number(num_probe)+1,
+ char);
+ sprintf(str_num_probe, "%i", num_probe);
+
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "analysis_control", "output", "probe");
+ cs_xpath_add_test_attribute(&path, "name", str_num_probe);
+ cs_xpath_add_element(&path, probe_coord);
+ cs_xpath_add_function_text(&path);
+
+ if (!cs_gui_get_double(path, &result))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coordinate %s of the monitoring probe number %i "
+ "not found.\nXpath: %s\n"), probe_coord, num_probe, path);
+
+ BFT_FREE(str_num_probe);
+ BFT_FREE(path);
+
+ return result;
+}
+
+/*-----------------------------------------------------------------------------
+ * Retourne le nombre de sous-balises "probe recording" situees dans la balise
+ * <variable>
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_variable_number_probes (const char *const variable)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int nb_probes ;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "variable");
+ cs_xpath_add_test_attribute(&path, "name", variable);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+
+ if (choice) {
+ nb_probes = atoi(choice);
+ } else
+ nb_probes = -1;
+
+ BFT_FREE(choice);
+ BFT_FREE(path);
+
+ return nb_probes;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return probe number for balice "probe_recording" for variable
+ *
+ * parameters:
+ * variable --> name of variable
+ * num_probe --> number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_variable_probe_name (const char *const variable,
+ int num_probe)
+{
+ char *path = NULL;
+ char *strvalue = NULL;
+ int intvalue;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "variable");
+ cs_xpath_add_test_attribute(&path, "name", variable);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_element_num(&path, "probe_recording", num_probe);
+ cs_xpath_add_attribute(&path, "name");
+
+ strvalue = cs_gui_get_attribute_value(path);
+
+ if (strvalue == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ intvalue = atoi(strvalue);
+
+ BFT_FREE(strvalue);
+ BFT_FREE(path);
+
+ return intvalue;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return label of variable
+ *
+ * parameters:
+ * variable --> name of variable
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_variable_label (const char *const variable)
+{
+ char *path = NULL;
+ char *label = NULL;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "variable");
+ cs_xpath_add_test_attribute(&path, "name", variable);
+ cs_xpath_add_attribute(&path, "label");
+
+ label = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return label;
+}
+
+/*-----------------------------------------------------------------------------
+ * Post-processing options for variables (velocity, pressure, ...)
+ * the "globale" array is built in CSENSO
+ * globale[num_probe] = num_saturne_probe
+ * where num_saturne_probe is the probe number in the code
+ * num_probe and num_saturne_probe are different when some probes
+ * are de-activated in the XML file
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_thermophysical_post(const char *const variable,
+ const int ipp,
+ int *const ihisvr,
+ int *const ilisvr,
+ int *const ichrvr,
+ const int *const nvppmx)
+{
+ int nb_probes;
+ int iprob;
+ char *varname = NULL;
+ int num_probe;
+
+ if (ipp == 1) return;
+
+ cs_gui_variable_attribute(variable,
+ "postprocessing_recording",
+ &ichrvr[ipp-1]);
+
+ cs_gui_variable_attribute(variable,
+ "listing_printing",
+ &ilisvr[ipp-1]);
+
+ nb_probes = cs_gui_variable_number_probes(variable);
+
+ ihisvr[0 + (ipp - 1)] = nb_probes;
+
+ if (nb_probes > 0) {
+ for (iprob =0; iprob < nb_probes; iprob++) {
+ num_probe = cs_gui_variable_probe_name(variable, iprob+1);
+ ihisvr[(iprob+1)*(*nvppmx) + (ipp - 1)] = num_probe;
+ }
+ }
+
+ varname = cs_gui_variable_label(variable);
+ _gui_copy_varname(varname, ipp);
+
+ BFT_FREE(varname);
+}
+
+/*-----------------------------------------------------------------------------
+ * Number of sub-headers "probe_recording" for the user scalars
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_scalar_number_probes(const int scalar_num)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int nb_probes ;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "additional_scalars");
+ cs_xpath_add_element_num(&path, "scalar", scalar_num);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+
+ if (choice) {
+ nb_probes = atoi(choice);
+ BFT_FREE(choice);
+ } else
+ nb_probes = -1;
+
+ BFT_FREE(path);
+
+ return nb_probes;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return probe number for number of balise "probe_recording"
+ *
+ * parameters:
+ * scalar_num --> number of scalar
+ * num_probe --> number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_scalar_probe_name(const int scalar_num,
+ const int num_probe)
+{
+ char *path = NULL;
+ char *strvalue = NULL;
+ int value;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "additional_scalars");
+ cs_xpath_add_element_num(&path, "scalar", scalar_num);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_element_num(&path, "probe_recording", num_probe);
+ cs_xpath_add_attribute(&path, "name");
+
+ strvalue = cs_gui_get_attribute_value(path);
+
+ if (strvalue == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ value = atoi(strvalue);
+
+ BFT_FREE(path);
+ BFT_FREE(strvalue);
+
+ return value;
+}
+
+/*-----------------------------------------------------------------------------
+ * Post-processing options for scalars
+ * the "globale" array is built in CSENSO
+ * globale[num_probe] = num_saturne_probe
+ * where num_saturne_probe is the probe number in the code
+ * num_probe and num_saturne_probe are different when some probes
+ * are de-activated in the XML file
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_scalar_post(const int num_sca,
+ int *const ihisvr,
+ int *const ilisvr,
+ int *const ichrvr,
+ const int *const ipprtp,
+ const int *const isca,
+ const int *const nvppmx)
+{
+ int ipp;
+ int nb_probes;
+ int iprob;
+ int num_probe;
+
+ cs_var_t *vars = cs_glob_var;
+
+ ipp = ipprtp[isca[num_sca] -1 ];
+
+ if (ipp == 1) return;
+
+ /* EnSight outputs frequency */
+ cs_gui_scalar_attribute(vars->label[num_sca],
+ "postprocessing_recording",
+ &ichrvr[ipp - 1]);
+
+ /* Listing output frequency */
+ cs_gui_scalar_attribute(vars->label[num_sca],
+ "listing_printing",
+ &ilisvr[ipp - 1]);
+
+ /* Activated probes */
+ nb_probes = cs_gui_scalar_number_probes(num_sca+1);
+ ihisvr[0 + (ipp - 1)] = nb_probes;
+
+ if (nb_probes > 0) {
+ for (iprob=0; iprob < nb_probes; iprob++){
+ num_probe = cs_gui_scalar_probe_name(num_sca+1, iprob+1);
+ ihisvr[(iprob+1)*(*nvppmx) + (ipp - 1)] = num_probe;
+ }
+ }
+
+ _gui_copy_varname(vars->label[num_sca], ipp);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return number of sub balises "probe_recording" for model scalars
+ *
+ * parameters:
+ * model --> Type of model
+ * name --> scalar name
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_model_scalar_number_probes(const char* const model,
+ const char *const name)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int nb_probes ;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "scalar");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+
+ if (choice) {
+ nb_probes = atoi(choice);
+ BFT_FREE(choice);
+ } else
+ nb_probes = -1;
+
+ BFT_FREE(path);
+
+ return nb_probes;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return probe number for sub balise "probe_recording" for model scalar
+ *
+ * parameters:
+ * model --> type of model
+ * name --> scalar name
+ * num_probe --> number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_model_scalar_probe_name (const char *const model,
+ const char *const name,
+ const int num_probe)
+{
+ char *path = NULL;
+ char *strvalue = NULL;
+ int value;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "scalar");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_element_num(&path, "probe_recording", num_probe);
+ cs_xpath_add_attribute(&path, "name");
+
+ strvalue = cs_gui_get_attribute_value(path);
+
+ if (strvalue == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ value = atoi(strvalue);
+
+ BFT_FREE(path);
+ BFT_FREE(strvalue);
+
+ return value;
+}
+
+/*-----------------------------------------------------------------------------
+ * Post-processing options for thermal and modelling scalars
+ * the "globale" array is built in CSENSO
+ * globale[num_probe] = num_saturne_probe
+ * where num_saturne_probe is the probe number in the code
+ * num_probe and num_saturne_probe are different when some probes
+ * are de-activated in the XML file
+ *----------------------------------------------------------------------------*/
+
+
+static void cs_gui_model_scalar_post(const char *const model,
+ const int num_sca,
+ int *const ihisvr,
+ int *const ilisvr,
+ int *const ichrvr,
+ const int *const ipprtp,
+ const int *const isca,
+ const int *const nvppmx)
+{
+ int ipp;
+ int nb_probes;
+ int iprob;
+ int num_probe;
+
+ cs_var_t *vars = cs_glob_var;
+
+ ipp = ipprtp[isca[num_sca] -1];
+
+ if (ipp == 1) return;
+
+ /* EnSight outputs frequency */
+ cs_gui_model_scalar_output_status(model, vars->label[num_sca],
+ "postprocessing_recording",
+ &ichrvr[ipp - 1]);
+
+ /* Listing output frequency */
+ cs_gui_model_scalar_output_status(model, vars->label[num_sca],
+ "listing_printing",
+ &ilisvr[ipp - 1]);
+
+ /* Activated probes */
+ nb_probes = cs_gui_model_scalar_number_probes(model, vars->label[num_sca]);
+
+ ihisvr[0 + (ipp - 1)] = nb_probes;
+
+ if (nb_probes > 0) {
+ for (iprob =0; iprob < nb_probes; iprob++) {
+ num_probe = cs_gui_model_scalar_probe_name(model, vars->label[num_sca], iprob+1);
+ ihisvr[(iprob+1)*(*nvppmx) + (ipp - 1)] = num_probe;
+ }
+ }
+
+ _gui_copy_varname(vars->label[num_sca], ipp);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return number of sub balises "probe_recording" for propeety of model scalar
+ *
+ * parameters:
+ * model --> Type of model
+ * num_sca --> scalar number
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_model_property_number_probes(const char *const model,
+ const char *const name)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int nb_probes ;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+
+ if (choice) {
+ nb_probes = atoi(choice);
+ BFT_FREE(choice);
+ } else
+ nb_probes = -1;
+
+ BFT_FREE(path);
+
+ return nb_probes;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return probe number for sub balise "probe_recording" for physical model's
+ * property
+ *
+ * parameters:
+ * model --> type of model
+ * num_prop --> number of property
+ * num_probe --> number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_model_property_probe_name(const char *const model,
+ const char *const name,
+ const int num_probe)
+{
+ char *path = NULL;
+ char *strvalue = NULL;
+ int value;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_element_num(&path, "probe_recording", num_probe);
+ cs_xpath_add_attribute(&path, "name");
+
+ strvalue = cs_gui_get_attribute_value(path);
+
+ if (strvalue == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ value = atoi(strvalue);
+
+ BFT_FREE(path);
+ BFT_FREE(strvalue);
+
+ return value;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the label model's property
+ *
+ * parameters:
+ * model --> modele
+ * num_prop <-- property's number
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_get_model_property_label(const char *const model,
+ const char *const name)
+{
+ char *path = NULL;
+ char *label_name = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_attribute(&path, "label");
+
+ label_name = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return label_name;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return status of the property for physical model
+ *
+ * parameters:
+ * model --> type of model
+ * num_pro --> property name
+ * value_type --> type of value (listing_printing, postprocessing ..)
+ * keyword <-- value for the Fortran array
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_model_property_output_status (const char *const model,
+ const char *const name,
+ const char *const value_type,
+ int *const keyword)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_element(&path, value_type);
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result))
+ *keyword = result;
+ else
+ *keyword = 1;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Post-processing options for properties
+ * the "globale" array is built in CSENSO
+ * globale[num_probe] = num_saturne_probe
+ * where num_saturne_probe is the probe number in the code
+ * num_probe and num_saturne_probe are different when some probes
+ * are de-activated in the XML file
+ *----------------------------------------------------------------------------*/
+
+
+static void
+cs_gui_model_property_post (const char *const model,
+ const int num_prop,
+ int *const ihisvr,
+ int *const ilisvr,
+ int *const ichrvr,
+ const int *const nvppmx)
+{
+ int ipp;
+ int nb_probes;
+ int iprob;
+ int num_probe;
+ char *varname = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ ipp = vars->properties_ipp[num_prop];
+
+ if (ipp == 1) return;
+
+ /* EnSight outputs frequency */
+ cs_gui_model_property_output_status(model,
+ vars->properties_name[num_prop],
+ "postprocessing_recording",
+ &ichrvr[ipp - 1]);
+
+ /* Listing output frequency */
+ cs_gui_model_property_output_status(model,
+ vars->properties_name[num_prop],
+ "listing_printing",
+ &ilisvr[ipp - 1]);
+
+
+ /* Activated probes */
+ nb_probes = cs_gui_model_property_number_probes(model,
+ vars->properties_name[num_prop]);
+
+ ihisvr[0 + (ipp - 1)] = nb_probes;
+
+ if (nb_probes > 0) {
+ for (iprob=0; iprob<nb_probes; iprob++){
+ num_probe = cs_gui_model_property_probe_name(model,
+ vars->properties_name[num_prop],
+ iprob+1);
+ ihisvr[(iprob+1)*(*nvppmx) + (ipp - 1)] = num_probe;
+ }
+ }
+
+ /* Take into account labels */
+
+ varname = cs_gui_get_model_property_label(model, vars->properties_name[num_prop]);
+ _gui_copy_varname(varname, ipp);
+
+ BFT_FREE(varname);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return number of probes for property
+ *
+ * parameters:
+ * property_name --> name of property
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_properties_number_probes(const char *const property_name)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int nb_probes ;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", property_name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+
+ if (choice) {
+ nb_probes = atoi(choice);
+ BFT_FREE(choice);
+ } else
+ nb_probes = -1;
+
+ BFT_FREE(path);
+
+ return nb_probes;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return probe number for sub balise "probe_recording" for properties
+ *
+ * parameters:
+ * property_name --> name of property
+ * num_probe --> number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_properties_probe_name(const char *const property_name,
+ const int num_probe)
+{
+ char *path = NULL;
+ char *strvalue = NULL;
+ int value;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", property_name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_element_num(&path, "probe_recording", num_probe);
+ cs_xpath_add_attribute(&path, "name");
+
+ strvalue = cs_gui_get_attribute_value(path);
+
+ if (strvalue == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ value = atoi(strvalue);
+
+ BFT_FREE(path);
+ BFT_FREE(strvalue);
+
+ return value;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the label attribute of a property markup.
+ *
+ * parameters:
+ * property_name --> name of the property
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_properties_label(const char *const property_name)
+{
+ char *path = NULL;
+ char *label = NULL;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", property_name);
+ cs_xpath_add_attribute(&path, "label");
+
+ label = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return label;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return status of thr property markup
+ *
+ * parameters:
+ * property_name --> name of property
+ * value_type --> type of balise (listing_printing, postprocessing ..)
+ * keyword <-- number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_properties_status(const char *const property_name,
+ const char *const value_type,
+ int *const keyword)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", property_name);
+ cs_xpath_add_element(&path, value_type);
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result))
+ *keyword = result;
+ else
+ *keyword = 1;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Post-processing options for physical properties
+ * the "globale" array is built in CSENSO
+ * globale[num_probe] = num_saturne_probe
+ * where num_saturne_probe is the probe number in the code
+ * num_probe and num_saturne_probe are different when some probes
+ * are de-activated in the XML file
+ *----------------------------------------------------------------------------*/
+
+
+static void cs_gui_properties_post(const char *const property_name,
+ const int ipp,
+ int *const ichrvr,
+ int *const ilisvr,
+ int *const ihisvr,
+ const int *const nvppmx)
+{
+ int nb_probes;
+ int iprob;
+ char *varname = NULL;
+ int num_probe;
+
+ if (ipp == 1) return;
+
+ varname = cs_gui_properties_label(property_name);
+ if (varname == NULL) return;
+
+ _gui_copy_varname(varname, ipp);
+ BFT_FREE(varname);
+
+ cs_gui_properties_status(property_name,
+ "postprocessing_recording",
+ &ichrvr[ipp - 1]);
+
+ cs_gui_properties_status(property_name,
+ "listing_printing",
+ &ilisvr[ipp - 1]);
+
+ nb_probes = cs_gui_properties_number_probes(property_name);
+
+ ihisvr[0 + (ipp - 1)] = nb_probes;
+
+ if (nb_probes > 0) {
+ for (iprob =0; iprob < nb_probes; iprob++){
+ num_probe = cs_gui_properties_probe_name(property_name,
+ iprob+1);
+
+ ihisvr[(iprob+1)*(*nvppmx) + (ipp - 1)] = num_probe;
+ }
+ }
+
+}
+
+/*-----------------------------------------------------------------------------
+ * Return number of probes for time average of property
+ *
+ * parameters:
+ * property_name --> label of property
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_time_average_number_probes(const char *const property_name)
+{
+ char *path = NULL;
+ char *choice = NULL;
+ int nb_probes ;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "time_average");
+ cs_xpath_add_test_attribute(&path, "label", property_name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_attribute(&path, "choice");
+ choice = cs_gui_get_attribute_value(path);
+
+ if (choice) {
+ nb_probes = atoi(choice);
+ BFT_FREE(choice);
+ } else
+ nb_probes = -1;
+
+ BFT_FREE(path);
+
+ return nb_probes;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return probe number for sub balise "probe_recording" for time average of
+ * properties
+ *
+ * parameters:
+ * property_name --> label of property
+ * num_probe --> number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_time_average_probe_name(const char *const property_name,
+ const int num_probe)
+{
+ char *path = NULL;
+ char *strvalue = NULL;
+ int value;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "time_average");
+ cs_xpath_add_test_attribute(&path, "label", property_name);
+ cs_xpath_add_element(&path, "probes");
+ cs_xpath_add_element_num(&path, "probe_recording", num_probe);
+ cs_xpath_add_attribute(&path, "name");
+
+ strvalue = cs_gui_get_attribute_value(path);
+
+ if (strvalue == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ value = atoi(strvalue);
+
+ BFT_FREE(path);
+ BFT_FREE(strvalue);
+
+ return value;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return status of time average markup
+ *
+ * parameters:
+ * property_name --> label of property
+ * value_type --> type of balise (listing_printing, postprocessing ..)
+ * keyword <-- number of balise "probe_recording"
+ *----------------------------------------------------------------------------*/
+
+
+static void cs_gui_time_average_status(const char *const property_name,
+ const char *const value_type,
+ int *const keyword)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "time_average");
+ cs_xpath_add_test_attribute(&path, "label", property_name);
+ cs_xpath_add_element(&path, value_type);
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result))
+ *keyword = result;
+ else
+ *keyword = 1;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Post-processing options for temporal averaging
+ * the "globale" array is built in CSENSO
+ * globale[num_probe] = num_saturne_probe
+ * where num_saturne_probe is the probe number in the code
+ * num_probe and num_saturne_probe are different when some probes
+ * are de-activated in the XML file
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_time_average_post (const char *const property_name,
+ const int ipp,
+ int *const ichrvr,
+ int *const ilisvr,
+ int *const ihisvr,
+ const int *const nvppmx)
+{
+ int nb_probes;
+ int iprob;
+ int num_probe;
+
+ if (ipp == 1) return;
+
+ cs_gui_time_average_status(property_name,
+ "postprocessing_recording",
+ &ichrvr[ipp - 1]);
+
+ cs_gui_time_average_status(property_name,
+ "listing_printing",
+ &ilisvr[ipp - 1]);
+
+ nb_probes = cs_gui_time_average_number_probes(property_name);
+
+ ihisvr[0 + (ipp - 1)] = nb_probes;
+
+ if (nb_probes > 0) {
+ for (iprob =0; iprob < nb_probes; iprob++){
+ num_probe = cs_gui_time_average_probe_name(property_name,
+ iprob+1);
+
+ ihisvr[(iprob+1)*(*nvppmx) + (ipp - 1)] = num_probe;
+ }
+ }
+ _gui_copy_varname(property_name, ipp);
+
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the label attribute of scalars.
+ *
+ * parameters:
+ * markup --> parent markup of the scalar
+ * scalar_num <-- number of the searching scalar
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_scalar_label(const char *const markup,
+ const int scalar_num)
+{
+ char *path = NULL;
+ char *strvalue = NULL;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, markup);
+ cs_xpath_add_element_num(&path, "scalar", scalar_num);
+ cs_xpath_add_attribute(&path, "label");
+
+ strvalue = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return strvalue;
+}
+
+/*==========================
+ * FOR VOLUMICS ZONES
+ *==========================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the name of the volumic zone
+ *
+ * parameters:
+ * ith_zone --> id of volumic zone
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_volumic_zone_name(const int ith_zone)
+{
+ char *path = NULL;
+ char *name = NULL;
+
+ /* 1) get the name of the ith initialization zone */
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "solution_domain", "volumic_conditions");
+ cs_xpath_add_element_num(&path, "zone", ith_zone);
+ cs_xpath_add_attribute(&path, "name");
+
+ name = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return name;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the localisation for the volumic zone named name
+ *
+ * parameters:
+ * name --> name of volumic zone
+ *----------------------------------------------------------------------------*/
+
+static char *cs_gui_volumic_zone_localization(const char *const name)
+{
+ char *path = NULL;
+ char *description = NULL;
+
+ /* 2) get the description (color and groups) of the ith initialization zone */
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "solution_domain",
+ "volumic_conditions",
+ "zone");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ cs_xpath_add_function_text(&path);
+
+ description = cs_gui_get_text_value(path);
+
+ BFT_FREE(path);
+
+ return description;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the initial value of variable for the volumic zone named name
+ *
+ * parameters:
+ * variable_name --> name of variable
+ * zone_name --> name of volumic zone
+ * initial_value <-- initial value
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_variable_initial_value(const char *const variable_name,
+ const char *const zone_name,
+ double *const initial_value)
+{
+ char *path = NULL;
+ double result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "variable");
+ cs_xpath_add_test_attribute(&path, "name", variable_name);
+ cs_xpath_add_element(&path, "initial_value");
+ cs_xpath_add_test_attribute(&path, "zone", zone_name);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ *initial_value = result;
+ else
+ *initial_value = 0.0;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the initial value of scalar for the volumic zone named name
+ *
+ * parameters:
+ * parent --> name of balise parent for the scalar
+ * label --> label of scalar
+ * zone_name --> name of volumic zone
+ * initial_value <-- initial value
+ *----------------------------------------------------------------------------*/
+
+static void cs_gui_scalar_initial_value(const char *const parent,
+ const char *const label,
+ const char *const zone_name,
+ double *const initial_value)
+{
+ char *path = NULL;
+ char *scalar_name = NULL;
+ double result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_elements(&path, 2, parent, "scalar");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, "initial_value");
+ cs_xpath_add_test_attribute(&path, "zone", zone_name);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ *initial_value = result;
+ else
+ *initial_value = 0.0;
+
+ BFT_FREE(scalar_name);
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Return integer value for calculation of size of user arrays
+ *----------------------------------------------------------------------------*/
+
+static int _user_array(const char *const keyword1,
+ const char *const keyword2)
+{
+ char *path = NULL;
+ int value = 0;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_elements(&path, 2, keyword1, keyword2);
+ cs_xpath_add_function_text(&path);
+ cs_gui_get_int(path, &value);
+ BFT_FREE(path);
+ return value;
+}
+
+/*----------------------------------------------------------------------------
+ * Get label of 1D profile file name
+ *
+ * parameters:
+ * id --> number of order in list of 1D profile
+ *----------------------------------------------------------------------------*/
+
+static char *_get_profile_label(const int id)
+{
+ char *path = NULL;
+ char *label = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "analysis_control", "profiles");
+ cs_xpath_add_element_num(&path, "profile", id+1);
+ cs_xpath_add_attribute(&path, "label");
+
+ label = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return label;
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of variables or properties or scalar for 1D profile
+ *
+ * parameters:
+ * id --> number of 1D profile
+ *----------------------------------------------------------------------------*/
+
+static int _get_profile_names_number(const int id)
+{
+ char *path = NULL;
+ int number = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "analysis_control", "profiles");
+ cs_xpath_add_element_num(&path, "profile", id+1);
+ cs_xpath_add_element(&path, "var_prop");
+ number = cs_gui_get_nb_element(path);
+
+ BFT_FREE(path);
+
+ return number;
+}
+
+/*----------------------------------------------------------------------------
+ * Return the name of variables or properties or scalar for 1D profile
+ *
+ * parameters:
+ * id --> number of 1D profile
+ * nm --> number of the variable name of the idst 1D profile
+ *----------------------------------------------------------------------------*/
+
+static char *_get_profile_name(const int id, const int nm)
+{
+ char *path = NULL;
+ char *name = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "analysis_control", "profiles");
+ cs_xpath_add_element_num(&path, "profile", id+1);
+ cs_xpath_add_element_num(&path, "var_prop", nm+1);
+ cs_xpath_add_attribute(&path, "name");
+
+ name = cs_gui_get_attribute_value(path);
+ if (name == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid xpath: %s\n name not found"), path);
+ BFT_FREE(path);
+
+ return name;
+}
+
+/*----------------------------------------------------------------------------
+ * Return the label of variables or properties or scalar for 1D profile
+ *
+ * parameters:
+ * id --> number of 1D profile
+ * nm --> number of the variable name of the idst 1D profile
+ *----------------------------------------------------------------------------*/
+
+static char *_get_profile_label_name(const int id, const int nm)
+{
+ char *path = NULL;
+ char *name = NULL;
+ char *label = NULL;
+ int j, ll;
+
+ cs_var_t *vars = cs_glob_var;
+
+ name = _get_profile_name(id, nm);
+
+ for (j=0 ; j < (vars->nvar - vars->nscapp - vars->nscaus) ; j++) {
+ if (cs_gui_strcmp(name, vars->name[j]))
+ label = cs_gui_variable_label(name);
+ }
+
+ if (vars->nscaus > 0 || vars->nscapp > 0) {
+ for (j=0 ; j < vars->nscaus + vars->nscapp; j++) {
+ if (cs_gui_strcmp(name, vars->label[j])) {
+ ll = strlen(vars->label[j])+1;
+ BFT_REALLOC(label, ll, char);
+ strcpy(label, vars->label[j]);
+ }
+ }
+ }
+
+ for (j=0; j < vars->nprop; j++) {
+ if (cs_gui_strcmp(name, vars->properties_name[j])) {
+ if (label != NULL)
+ BFT_FREE(label);
+ label = cs_gui_properties_label(vars->properties_name[j]);
+ }
+ }
+
+ if (label == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid markup name: %s\n label not found"), name);
+
+ BFT_FREE(path);
+ BFT_FREE(name);
+
+ return label;
+}
+
+/*----------------------------------------------------------------------------
+ * Get coordinates or output frequency for 1D profile
+ *
+ * parameters:
+ * id --> number of 1D profile
+ * x <-- name of the coordinate (x1, y1, z1, x2, y2, z2)
+ * or the output frequency
+ *----------------------------------------------------------------------------*/
+
+static double _get_profile_coordinate(const int id, const char *const x)
+{
+ char *path = NULL;
+ double coordinate = 0.0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "analysis_control", "profiles");
+ cs_xpath_add_element_num(&path, "profile", id+1);
+ cs_xpath_add_element(&path, x);
+ cs_xpath_add_function_text(&path);
+
+ if (!cs_gui_get_double(path, &coordinate))
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ BFT_FREE(path);
+
+ return coordinate;
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialise the global 'vars' structure.
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiinit
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiinit, UIINIT) (void)
+{
+ assert(cs_glob_var == NULL);
+
+ BFT_MALLOC(cs_glob_var, 1, cs_var_t);
+
+ cs_glob_var->model = NULL;
+ cs_glob_var->model_value = NULL;
+ cs_glob_var->head = NULL;
+ cs_glob_var->type = NULL;
+ cs_glob_var->name = NULL;
+ cs_glob_var->label = NULL;
+ cs_glob_var->rtp = NULL;
+ cs_glob_var->nvar = 0;
+ cs_glob_var->nscaus = 0;
+ cs_glob_var->nscapp = 0;
+ cs_glob_var->nprop = 0;
+ cs_glob_var->nsalpp = 0;
+ cs_glob_var->ntimaver = 0;
+ cs_glob_var->properties_name = NULL;
+ cs_glob_var->properties_ipp = NULL;
+ cs_glob_var->propce = NULL;
+
+ BFT_MALLOC(cs_glob_label, 1, cs_label_t);
+
+ cs_glob_label->_cs_gui_max_vars = 0;
+ cs_glob_label->_cs_gui_last_var = 0;
+ cs_glob_label->_cs_gui_var_name = NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Turbulence model.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSTURB (ITURB, IDEUCH, IGRAKE, IGRAKI, XLOMLG)
+ * *****************
+ *
+ * INTEGER ITURB <-- turbulence model
+ * INTEGER IDEUCH <-- wall law treatment
+ * INTEGER IGRAKE <-- k-eps gravity effects
+ * INTEGER IGRAKI <-- Rij-eps gravity effects
+ * DOUBLE PRECISION XLOMLG <-- mixing_length_scale
+ *----------------------------------------------------------------------------*/
+
+
+void CS_PROCF (csturb, CSTURB) (int *const iturb,
+ int *const ideuch,
+ int *const igrake,
+ int *const igrari,
+ double *const xlomlg)
+{
+ char *model = NULL;
+ int iphas = 0;
+
+ model = cs_gui_get_thermophysical_model("turbulence");
+ if (model == NULL) return;
+
+ if (cs_gui_strcmp(model, "off"))
+ iturb[iphas] = 0;
+ else if (cs_gui_strcmp(model, "mixing_length")){
+ iturb[iphas] = 10;
+ _option_turbulence_double("mixing_length_scale", &xlomlg[iphas]);
+ }
+ else if (cs_gui_strcmp(model, "k-epsilon")){
+ iturb[iphas] = 20;
+ cs_gui_advanced_options_turbulence("scale_model", &ideuch[iphas]);
+ cs_gui_advanced_options_turbulence("gravity_terms", &igrake[iphas]);
+ }
+ else if (cs_gui_strcmp(model, "k-epsilon-PL")){
+ iturb[iphas] = 21;
+ cs_gui_advanced_options_turbulence("scale_model", &ideuch[iphas]);
+ cs_gui_advanced_options_turbulence("gravity_terms", &igrake[iphas]);
+ }
+ else if (cs_gui_strcmp(model, "Rij-epsilon")){
+ iturb[iphas] = 30;
+ cs_gui_advanced_options_turbulence("scale_model", &ideuch[iphas]);
+ cs_gui_advanced_options_turbulence("gravity_terms", &igrari[iphas]);
+ }
+ else if (cs_gui_strcmp(model, "Rij-SSG")){
+ iturb[iphas] = 31;
+ cs_gui_advanced_options_turbulence("scale_model", &ideuch[iphas]);
+ cs_gui_advanced_options_turbulence("gravity_terms", &igrari[iphas]);
+ }
+ else if (cs_gui_strcmp(model, "LES_Smagorinsky")){
+ iturb[iphas] = 40;
+ }
+ else if (cs_gui_strcmp(model, "LES_dynamique")){
+ iturb[iphas] = 41;
+ }
+ else if (cs_gui_strcmp(model, "v2f-phi")){
+ iturb[iphas] = 50;
+ cs_gui_advanced_options_turbulence("scale_model", &ideuch[iphas]);
+ cs_gui_advanced_options_turbulence("gravity_terms", &igrake[iphas]);
+ }
+ else if (cs_gui_strcmp(model, "k-omega-SST")){
+ iturb[iphas] = 60;
+ cs_gui_advanced_options_turbulence("scale_model", &ideuch[iphas]);
+ cs_gui_advanced_options_turbulence("gravity_terms", &igrake[iphas]);
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid turbulence model: %s.\n"), model);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSTURB\n");
+ bft_printf("--model: %s\n", model);
+ bft_printf("--iturb = %i\n", iturb[iphas]);
+ bft_printf("--igrake = %i\n", igrake[iphas]);
+ bft_printf("--igrari = %i\n", igrari[iphas]);
+ bft_printf("--ideuch = %i\n", ideuch[iphas]);
+ bft_printf("--xlomlg = %f\n", xlomlg[iphas]);
+#endif
+
+ BFT_FREE(model);
+}
+
+/*----------------------------------------------------------------------------
+ * Specific heat variable or constant indicator.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSCPVA (ICP)
+ * *****************
+ *
+ * INTEGER ICP <-- specific heat variable or constant indicator
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cscpva, CSCPVA) (int *const icp)
+{
+ int choice;
+ int iphas = 0;
+
+ if (cs_gui_properties_choice("specific_heat", &choice)) icp[iphas] = choice;
+
+#if _XML_DEBUG_
+ bft_printf("==>CSCPVA\n");
+ bft_printf("--icp = %i\n", icp[iphas]);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * User scalars number.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSNSCA (NSCAUS)
+ * *****************
+ *
+ * INTEGER NSCAUS <-- user scalars number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csnsca, CSNSCA) (int *const nscaus)
+{
+ int i = 0;
+ char *label = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ *nscaus = cs_gui_get_tag_number("/additional_scalars/scalar", 1);
+
+ cs_glob_var->nscaus = *nscaus;
+
+ BFT_MALLOC(vars->label, *nscaus, char*);
+
+ for (i=0; i<vars->nscaus; i++) {
+ label = cs_gui_scalar_label("additional_scalars", i+1);
+ BFT_MALLOC(cs_glob_var->label[i], strlen(label)+1, char);
+ strcpy(cs_glob_var->label[i], label);
+ BFT_FREE(label);
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>CSNSCA\n");
+ bft_printf("--user scalars number: %i\n", vars->nscaus);
+ for (i=0; i<*nscaus; i++)
+ bft_printf("--label of scalar[%i]: %s\n", i, vars->label[i]);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * User scalars which are variance.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSISCA (ISCAVR)
+ * *****************
+ *
+ * INTEGER ISCAVR <-- user scalars variance array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csisca, CSISCA) (int *const iscavr)
+{
+ int i;
+ int j;
+ char *variance = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ if (vars->nscaus > 0) {
+
+ for (i=0; i < vars->nscaus; i++) {
+ variance = cs_gui_scalar_variance(i+1);
+
+ if (variance != NULL) {
+
+ for (j=0 ; j < vars->nscaus ; j++) {
+
+ if (cs_gui_strcmp(variance, vars->label[j])) {
+
+ if ( i == j )
+ bft_error(__FILE__, __LINE__, 0,
+ _("Scalar: %i and its variance: %i are the same.\n"),
+ i, j);
+ iscavr[i] = j + 1;
+ }
+ }
+ BFT_FREE(variance);
+ }
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>CSISCA\n");
+ for (i = 0 ; i < vars->nscaus ; i++)
+ bft_printf("--iscavr[%i] = %i \n", i, iscavr[i]);
+#endif
+ }
+ return;
+}
+
+/*----------------------------------------------------------------------------
+ * Constant or variable indicator for the user scalar laminar viscosity.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIVIS (ISCAVR, IVISLS, ISCALT, ISCSTH)
+ * *****************
+ *
+ * INTEGER ISCAVR <--> number of the related variance if any
+ * INTEGER IVISLS <-- indicator for the user scalar viscosity
+ * INTEGER ISCALT <--> number of the user thermal scalar if any
+ * INTEGER ISCSTH <--> type of the user thermal scalar
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csivis, CSIVIS) (int *const iscavr,
+ int *const ivisls,
+ int *const iscalt,
+ int *const iscsth)
+{
+ int iphas = 0;
+ int i;
+ int choice1, choice2;
+ int test1, test2;
+
+ cs_var_t *vars = cs_glob_var;
+
+ if (vars->nscaus > 0) {
+
+ if (cs_gui_thermal_scalar()) {
+ test1 = cs_gui_properties_choice("thermal_conductivity", &choice1);
+ test2 = cs_gui_properties_choice("specific_heat", &choice2);
+
+ if (test1 && test2) {
+ cs_gui_thermal_scalar_number(iscalt, iscsth);
+
+ if (choice1 || choice2)
+ ivisls[iscalt[iphas]-1] = 1;
+ else
+ ivisls[iscalt[iphas]-1] = 0;
+ }
+ }
+
+ for (i=0 ; i < vars->nscaus; i++) {
+ if (iscavr[i] <= 0 ) {
+ if (cs_gui_scalar_properties_choice(i+1, &choice1))
+ if (iscalt[iphas] != i+1) ivisls[i] = choice1;
+ }
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>CSIVIS\n");
+ for (i=0 ; i < vars->nscaus ; i++)
+ bft_printf("--ivisls[%i] = %i\n", i, ivisls[i]);
+#endif
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Time passing parameter.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIDTV (IDTVAR)
+ * *****************
+ *
+ * INTEGER IDTVAR <-- fixed or variable time step
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csidtv, CSIDTV) (int *const idtvar)
+{
+ double param;
+ int steady = 0;
+
+ cs_gui_get_steady_status(&steady);
+ if (steady){
+ *idtvar = -1;
+ }
+ else{
+ param = (double) *idtvar;
+ cs_gui_time_parameters("time_passing", ¶m);
+ *idtvar = (int) param;
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>CSIDTV\n");
+ bft_printf("--idtvar = %i\n", *idtvar);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Hydrostatic pressure parameter.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIPHY (IPHYDR)
+ * *****************
+ *
+ * INTEGER IPHYDR <-- hydrostatic pressure
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csiphy, CSIPHY) (int *const iphydr)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "hydrostatic_pressure");
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result)) *iphydr = result;
+
+ BFT_FREE(path);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSIPHY\n");
+ bft_printf("--iphydr = %i\n", *iphydr);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Constructs an indirection between an internal index vars->rtp and
+ * the fortran array RTP.
+ * This function is called after the third call to VARPOS routine.
+ * Warning: in vars->rtp, variables are stored first and then
+ * scalars (not like VARPOS because of ALE variables).
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSVNUM
+ * *****************
+ *
+ * INTEGER IPHYDR <-- hydrostatic pressure
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csvnum, CSVNUM) (const int *const nvar,
+ const int *const iu,
+ const int *const iv,
+ const int *const iw,
+ const int *const ipr,
+ const int *const iturb,
+ const int *const ik,
+ const int *const iep,
+ const int *const ir11,
+ const int *const ir22,
+ const int *const ir33,
+ const int *const ir12,
+ const int *const ir13,
+ const int *const ir23,
+ const int *const iomg,
+ const int *const iphi,
+ const int *const ifb,
+ const int *const iale,
+ const int *const iuma,
+ const int *const ivma,
+ const int *const iwma,
+ const int *const isca,
+ const int *const iscapp)
+{
+ int iphas = 0;
+ int n = 0;
+ int i, j, k;
+
+ BFT_MALLOC(cs_glob_var->rtp, *nvar, int);
+ BFT_MALLOC(cs_glob_var->head, *nvar, char*);
+ BFT_MALLOC(cs_glob_var->type, *nvar, char*);
+ BFT_MALLOC(cs_glob_var->name, *nvar, char*);
+
+ /* Warning!! vars->nscaus is already fill in CSNSCA */
+ /* vars->label is already fill in CSNSCA */
+ /* vars->nscapp is already fill in UIPPMO */
+
+ cs_glob_var->nvar = *nvar;
+
+ /* 1) pressure and velocity variables */
+
+ k = n;
+ cs_glob_var->rtp[n] = ipr[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("pressure")+1, char);
+ strcpy(cs_glob_var->name[n++], "pressure");
+
+ cs_glob_var->rtp[n] = iu[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("velocity_U")+1, char);
+ strcpy(cs_glob_var->name[n++], "velocity_U");
+
+ cs_glob_var->rtp[n] = iv[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("velocity_V")+1, char);
+ strcpy(cs_glob_var->name[n++], "velocity_V");
+
+ cs_glob_var->rtp[n] = iw[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("velocity_W")+1, char);
+ strcpy(cs_glob_var->name[n++], "velocity_W");
+
+ for (i=k; i < n; i++) {
+ BFT_MALLOC(cs_glob_var->head[i], strlen("velocity_pressure")+1, char);
+ strcpy(cs_glob_var->head[i], "velocity_pressure");
+ }
+
+ /* 2) turbulence variables */
+
+ k = n;
+
+ if (iturb[iphas] == 20 || iturb[iphas] == 21) {
+
+ cs_glob_var->rtp[n] = ik[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_k")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_k");
+
+ cs_glob_var->rtp[n] = iep[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_eps")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_eps");
+
+ } else if (iturb[iphas] == 30 || iturb[iphas] == 31) {
+
+ cs_glob_var->rtp[n] = ir11[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("component_R11")+1, char);
+ strcpy(cs_glob_var->name[n++], "component_R11");
+
+ cs_glob_var->rtp[n] = ir22[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("component_R22")+1, char);
+ strcpy(cs_glob_var->name[n++], "component_R22");
+
+ cs_glob_var->rtp[n] = ir33[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("component_R33")+1, char);
+ strcpy(cs_glob_var->name[n++], "component_R33");
+
+ cs_glob_var->rtp[n] = ir12[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("component_R12")+1, char);
+ strcpy(cs_glob_var->name[n++], "component_R12");
+
+ cs_glob_var->rtp[n] = ir13[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("component_R13")+1, char);
+ strcpy(cs_glob_var->name[n++], "component_R13");
+
+ cs_glob_var->rtp[n] = ir23[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("component_R23")+1, char);
+ strcpy(cs_glob_var->name[n++], "component_R23");
+
+ cs_glob_var->rtp[n] = iep[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_eps")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_eps");
+
+ } else if (iturb[iphas] == 50) {
+
+ cs_glob_var->rtp[n] = ik[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_k")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_k");
+
+ cs_glob_var->rtp[n] = iep[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_eps")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_eps");
+
+ cs_glob_var->rtp[n] = iphi[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_phi")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_phi");
+
+ cs_glob_var->rtp[n] = ifb[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_fb")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_fb");
+
+ } else if (iturb[iphas] == 60) {
+
+ cs_glob_var->rtp[n] = ik[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_k")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_k");
+
+ cs_glob_var->rtp[n] = iomg[iphas] -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("turb_omega")+1, char);
+ strcpy(cs_glob_var->name[n++], "turb_omega");
+ }
+
+ for (i=k; i < n; i++) {
+ BFT_MALLOC(cs_glob_var->head[i], strlen("turbulence")+1, char);
+ strcpy(cs_glob_var->head[i], "turbulence");
+ }
+
+ /* 3) ALE variables */
+
+ if (*iale) {
+ k = n;
+
+ cs_glob_var->rtp[n] = *iuma -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("mesh_velocity_U")+1, char);
+ strcpy(cs_glob_var->name[n++], "mesh_velocity_U");
+
+ cs_glob_var->rtp[n] = *ivma -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("mesh_velocity_V")+1, char);
+ strcpy(cs_glob_var->name[n++], "mesh_velocity_V");
+
+ cs_glob_var->rtp[n] = *iwma -1;
+ BFT_MALLOC(cs_glob_var->name[n], strlen("mesh_velocity_W")+1, char);
+ strcpy(cs_glob_var->name[n++], "mesh_velocity_W");
+
+ for (i=k; i < n; i++) {
+ BFT_MALLOC(cs_glob_var->head[i], strlen("ale_method")+1, char);
+ strcpy(cs_glob_var->head[i], "ale_method");
+ }
+ }
+
+ /* 4) update vars->type for variables */
+
+ k = cs_glob_var->nvar -cs_glob_var->nscapp -cs_glob_var->nscaus;
+ for (i=0; i < k; i++) {
+ BFT_MALLOC(cs_glob_var->type[i], strlen("variable")+1, char);
+ strcpy(cs_glob_var->type[i], "variable");
+ }
+
+ /* 5) user scalars */
+
+ for (i=0; i < cs_glob_var->nscaus; i++) {
+ cs_glob_var->rtp[n++] = isca[i] -1;
+
+ BFT_MALLOC(cs_glob_var->name[k+i], strlen(cs_glob_var->label[i]) +1, char);
+ strcpy(cs_glob_var->name[k+i], cs_glob_var->label[i]);
+
+ BFT_MALLOC(cs_glob_var->type[k+i], strlen("scalar")+1, char);
+ strcpy(cs_glob_var->type[k+i], "scalar");
+
+ BFT_MALLOC(cs_glob_var->head[k+i], strlen("additional_scalar")+1, char);
+ strcpy(cs_glob_var->head[k+i], "additional_scalar");
+ }
+
+ /* 6) model scalars */
+
+ k = cs_glob_var->nvar - cs_glob_var->nscapp;
+ for (i=0; i < cs_glob_var->nscapp; i++) {
+ j = iscapp[i] -1;
+ cs_glob_var->rtp[n++] = isca[j] -1;
+
+ BFT_MALLOC(cs_glob_var->name[k+j], strlen(cs_glob_var->label[j]) +1, char);
+ strcpy(cs_glob_var->name[k+j], cs_glob_var->label[j]);
+
+ BFT_MALLOC(cs_glob_var->type[k+j], strlen("scalar")+1, char);
+ strcpy(cs_glob_var->type[k+j], "scalar");
+
+ BFT_MALLOC(cs_glob_var->head[k+j], strlen(cs_glob_var->model)+1, char);
+ strcpy(cs_glob_var->head[k+j], cs_glob_var->model);
+ }
+
+ /* 7) check for errors */
+
+ if (n != *nvar)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The kernel variables number %i and the "
+ "calculated one by the GUI %i are not the same.\n"),
+ *nvar, n);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSVNUM\n");
+ bft_printf("--variables and scalars name: \n");
+ for (i=0; i < cs_glob_var->nvar; i++)
+ bft_printf("---name: %s\n", cs_glob_var->name[i]);
+ /* for (i=0; i < vars->nscapp+vars->nscaus; i++)
+ bft_printf("--scalars: %s\n", vars->label[i]); */
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Restart parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSISUI (ISUITE, ILEAUX, ICCVFG)
+ * *****************
+ *
+ * INTEGER ISUITE <-- restart
+ * INTEGER ILEAUX <-- restart with auxiliary
+ * INTEGER ICCFVG <-- restart with frozen field
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csisui, CSISUI) (int *const isuite,
+ int *const ileaux,
+ int *const iccvfg)
+{
+ cs_gui_restart_parameters_status("restart", isuite);
+ cs_gui_restart_parameters_status("restart_with_auxiliary", ileaux);
+ cs_gui_restart_parameters_status("frozen_field", iccvfg);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSISUI\n");
+ bft_printf("--isuite = %i\n", *isuite);
+ bft_printf("--ileaux = %i\n", *ileaux);
+ bft_printf("--iccvfg = %i\n", *iccvfg);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Time passing parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSTIME (INPDT0, IPTLTO, NTMABS, DTREF,
+ * ***************** DTMIN, DTMAX, COUMAX, FOUMAX, VARRDT)
+ *
+ * INTEGER INPDT0 <-- zero time step
+ * INTEGER IPTLTO <-- thermal time step control
+ * INTEGER NTMABS <-- iterations numbers
+ * INTEGER IDTVAR <-- time steps'options
+ * DOUBLE PRECISION DTREF <-- time step
+ * DOUBLE PRECISION DTMIN <-- minimal time step
+ * DOUBLE PRECISION DTMAX <-- maximal time step
+ * DOUBLE PRECISION COUMAX <-- maximal courant number
+ * DOUBLE PRECISION FOUMAX <-- maximal fournier number
+ * DOUBLE PRECISION VARRDT <-- max time step variation between 2 iterations
+ * DOUBLE PRECISION RELXST <-- relaxation coefficient id idtvar = -1
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cstime, CSTIME) (int *const inpdt0,
+ int *const iptlro,
+ int *const ntmabs,
+ int *const idtvar,
+ double *const dtref,
+ double *const dtmin,
+ double *const dtmax,
+ double *const coumax,
+ double *const foumax,
+ double *const varrdt,
+ double *const relxst)
+{
+ double value;
+
+ if (*idtvar == -1){
+ cs_gui_steady_parameters("relaxation_coefficient", relxst);
+
+ value =(double) *inpdt0;
+ cs_gui_steady_parameters("zero_iteration", &value);
+ *inpdt0 = (int) value;
+
+ value =(double) *ntmabs;
+ cs_gui_steady_parameters("iterations", &value);
+ *ntmabs = (int) value;
+ }
+ else{
+ cs_gui_time_parameters("time_step_ref", dtref);
+ cs_gui_time_parameters("time_step_min", dtmin);
+ cs_gui_time_parameters("time_step_max", dtmax);
+ cs_gui_time_parameters("max_courant_num", coumax);
+ cs_gui_time_parameters("max_fourier_num", foumax);
+ cs_gui_time_parameters("time_step_var", varrdt);
+
+ value =(double) *ntmabs;
+ cs_gui_time_parameters("iterations", &value);
+ *ntmabs = (int) value;
+
+ value =(double) *inpdt0;
+ cs_gui_time_parameters("zero_time_step", &value);
+ *inpdt0 = (int) value;
+
+ value =(double) *iptlro;
+ cs_gui_time_parameters("thermal_time_step", &value);
+ *iptlro = (int) value;
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>CSTIME\n");
+ bft_printf("--idtvar = %i\n", *idtvar);
+ if (*idtvar == -1){
+ bft_printf("--inpdt0 = %i\n", *inpdt0);
+ bft_printf("--relxst = %i\n", *relxst);
+ }
+ else{
+ bft_printf("--inpdt0 = %i\n", *inpdt0);
+ bft_printf("--iptlro = %i\n", *iptlro);
+ bft_printf("--ntmabs = %i\n", *ntmabs);
+ bft_printf("--dtref = %f\n", *dtref);
+ bft_printf("--dtmin = %f\n", *dtmin);
+ bft_printf("--dtmax = %f\n", *dtmax);
+ bft_printf("--coumax = %f\n", *coumax);
+ bft_printf("--foumax = %f\n", *foumax);
+ bft_printf("--varrdt = %f\n", *varrdt);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Check if a users thermal scalar is defined.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSSCA1 (ISCALT, ISCSTH)
+ * *****************
+ *
+ * INTEGER ISCALT <-- number of the user thermal scalar if any
+ * INTEGER ISCSTH <-- type of the user thermal scalar
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cssca1, CSSCA1) (int *const iscalt,
+ int *const iscsth)
+{
+ cs_gui_thermal_scalar_number(iscalt, iscsth);
+
+#if _XML_DEBUG_
+ {
+ int i;
+ int iphas = 0;
+ cs_var_t *vars = cs_glob_var;
+ bft_printf("==>CSSCA1\n");
+ bft_printf("--iscalt[0]=%i \n", iscalt[iphas]);
+ for (i = 0 ; i < vars->nscaus ; i++)
+ bft_printf("--iscsth[%i]=%i \n", i, iscsth[i]);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Treatment of local numerical aspects:
+ * BLENCV, ISCHCV, ISSTPC, IRCFLU, CDTVAR, NITMAX, EPSILO
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uinum1, UINUM1) (const int *const isca,
+ const int *const iscapp,
+ double *const blencv,
+ int *const ischcv,
+ int *const isstpc,
+ int *const ircflu,
+ double *const cdtvar,
+ int *const nitmax,
+ double *const epsilo)
+{
+ int i, j, jj, k;
+ double tmp;
+
+ cs_var_t *vars = cs_glob_var;
+
+ k = vars->nvar - vars->nscaus - vars->nscapp;
+
+ /* 1) variables from velocity_pressure and turbulence */
+ /* 1-a) for pressure */
+ j = vars->rtp[0];
+ cs_gui_variable_value(vars->name[0], "solveur_precision", &epsilo[j]);
+ tmp = (double) nitmax[j];
+ cs_gui_variable_value(vars->name[0], "max_iter_number", &tmp);
+ nitmax[j] = (int) tmp;
+
+ /* 1-b) for the other variables */
+ for (i=1; i < k; i++) {
+ j = vars->rtp[i];
+ cs_gui_variable_value(vars->name[i], "blending_factor", &blencv[j]);
+ cs_gui_variable_value(vars->name[i], "solveur_precision", &epsilo[j]);
+ tmp = (double) nitmax[j];
+ cs_gui_variable_value(vars->name[i], "max_iter_number", &tmp);
+ nitmax[j] = (int) tmp;
+ cs_gui_variable_attribute(vars->name[i], "order_scheme", &ischcv[j]);
+ cs_gui_variable_attribute(vars->name[i], "slope_test", &isstpc[j]);
+ cs_gui_variable_attribute(vars->name[i], "flux_reconstruction", &ircflu[j]);
+ }
+
+ /* 2) user scalars */
+
+ if (vars->nscaus > 0 ) {
+ for (i=0 ; i < vars->nscaus; i++) {
+ j = isca[i]-1;
+ cs_gui_scalar_value(vars->label[i], "blending_factor", &blencv[j]);
+ cs_gui_scalar_value(vars->label[i], "solveur_precision", &epsilo[j]);
+ cs_gui_scalar_value(vars->label[i], "time_step_factor", &cdtvar[j]);
+ tmp = (double) nitmax[j];
+ cs_gui_scalar_value(vars->label[i], "max_iter_number", &tmp);
+ nitmax[j] = (int) tmp;
+ cs_gui_scalar_attribute(vars->label[i], "order_scheme", &ischcv[j]);
+ cs_gui_scalar_attribute(vars->label[i], "slope_test", &isstpc[j]);
+ cs_gui_scalar_attribute(vars->label[i], "flux_reconstruction", &ircflu[j]);
+ }
+ }
+
+ /* 3) model scalars */
+
+ if (vars->nscapp > 0 ) {
+ for (i=0 ; i < vars->nscapp ; i++) {
+ j = iscapp[i] -1;
+ jj = isca[j]-1;
+ cs_gui_model_scalar_value(vars->model, vars->label[j], "blending_factor", &blencv[jj]);
+ cs_gui_model_scalar_value(vars->model, vars->label[j], "solveur_precision", &epsilo[jj]);
+ cs_gui_model_scalar_value(vars->model, vars->label[j], "time_step_factor", &cdtvar[jj]);
+ tmp = (double) nitmax[jj];
+ cs_gui_model_scalar_value(vars->model, vars->label[j], "max_iter_number", &tmp);
+ nitmax[jj] = (int) tmp;
+ cs_gui_model_scalar_output_status(vars->model, vars->label[j], "order_scheme", &ischcv[jj]);
+ cs_gui_model_scalar_output_status(vars->model, vars->label[j], "slope_test", &isstpc[jj]);
+ cs_gui_model_scalar_output_status(vars->model, vars->label[j], "flux_reconstruction", &ircflu[jj]);
+ }
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>UINUM1\n");
+ for (i=0; i < vars->nvar; i++) {
+ bft_printf("-->variable[%i] = %s\n", i, vars->name[i]);
+ bft_printf("--blencv = %f\n", blencv[vars->rtp[i]]);
+ bft_printf("--epsilo = %g\n", epsilo[vars->rtp[i]]);
+ bft_printf("--cdtvar = %g\n", cdtvar[vars->rtp[i]]);
+ bft_printf("--nitmax = %i\n", nitmax[vars->rtp[i]]);
+ bft_printf("--ischcv = %i\n", ischcv[vars->rtp[i]]);
+ bft_printf("--isstpc = %i\n", isstpc[vars->rtp[i]]);
+ bft_printf("--ircflu = %i\n", ircflu[vars->rtp[i]]);
+ }
+ for (i=0 ; i < vars->nscaus + vars->nscapp ; i++) {
+ bft_printf("-->scalar[%i]: %s\n", isca[i]-1, vars->label[i]);
+ bft_printf("--blencv = %f\n", blencv[isca[i]-1]);
+ bft_printf("--epsilo = %g\n", epsilo[isca[i]-1]);
+ bft_printf("--cdtvar = %g\n", cdtvar[isca[i]-1]);
+ bft_printf("--nitmax = %i\n", nitmax[isca[i]-1]);
+ bft_printf("--ischcv = %i\n", ischcv[isca[i]-1]);
+ bft_printf("--isstpc = %i\n", isstpc[isca[i]-1]);
+ bft_printf("--ircflu = %i\n", ircflu[isca[i]-1]);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Global numerical parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSNUM2 (IVISSE, RELAXP, IPUCOU, EXTRAG, IMRGRA, IMGRPR)
+ * *****************
+ * INTEGER IVISSE <-- gradient transposed
+ * DOUBLE PRECISION RELAXP <-- pressure relaxation
+ * INTEGER IPUCOU <-- velocity pressure coupling
+ * DOUBLE PRECISION EXTRAG <-- wall pressure extrapolation
+ * INTEGER IMRGRA <-- gradient reconstruction
+ * INTEGER IMGRPR <-- multigrid algorithm for pressure
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csnum2, CSNUM2)( int *const ivisse,
+ double *const relaxp,
+ int *const ipucou,
+ double *const extrag,
+ int *const imrgra,
+ int *const imgrpr)
+{
+ cs_gui_numerical_int_parameters("gradient_transposed", ivisse);
+ cs_gui_numerical_int_parameters("velocity_pressure_coupling", ipucou);
+ cs_gui_numerical_int_parameters("gradient_reconstruction", imrgra);
+ cs_gui_numerical_int_parameters("multigrid", imgrpr);
+ cs_gui_numerical_double_parameters("wall_pressure_extrapolation", extrag);
+ cs_gui_numerical_double_parameters("pressure_relaxation", relaxp);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSNUM2\n");
+ bft_printf("--ivisse = %i\n", *ivisse);
+ bft_printf("--ipucou = %i\n", *ipucou);
+ bft_printf("--imrgra = %i\n", *imrgra);
+ bft_printf("--extrag = %f\n", *extrag);
+ bft_printf("--relaxp = %f\n", *relaxp);
+ bft_printf("--imgrpr = %i\n", *imgrpr);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Treatment of gravity and fluid physical properties
+ * Initialize reference pressure and temperature if present
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csphys, CSPHYS)
+(
+ const int *const nmodpp,
+ int *const irovar,
+ int *const ivivar,
+ int *const icorio,
+ double *const gx,
+ double *const gy,
+ double *const gz,
+ double *const omegax,
+ double *const omegay,
+ double *const omegaz,
+ double *const ro0,
+ double *const viscl0,
+ double *const cp0,
+ double *const t0,
+ double *const p0
+)
+{
+ int iphas = 0;
+ int choice;
+
+ cs_var_t *vars = cs_glob_var;
+
+ cs_gui_gravity_value("gravity_x", gx);
+ cs_gui_gravity_value("gravity_y", gy);
+ cs_gui_gravity_value("gravity_z", gz);
+
+ cs_gui_properties_value("density", &ro0[iphas]);
+ cs_gui_properties_value("molecular_viscosity", &viscl0[iphas]);
+ cs_gui_properties_value("specific_heat", &cp0[iphas]);
+
+ cs_gui_reference_pressure(p0);
+
+ /* Variable rho and viscl */
+ if (*nmodpp == 0) {
+ if (cs_gui_properties_choice("density", &choice))
+ irovar[iphas] = choice;
+
+ if (cs_gui_properties_choice("molecular_viscosity", &choice))
+ ivivar[iphas] = choice;
+ }
+
+ /* T0 if necessary */
+
+ if (vars->model != NULL)
+ cs_gui_reference_temperature(vars->model, t0);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSPHYS\n");
+ bft_printf("--gx = %f \n",*gx);
+ bft_printf("--gy = %f \n",*gy);
+ bft_printf("--gz = %f \n",*gz);
+ bft_printf("--rho = %g , variable %i\n", ro0[iphas], irovar[iphas]);
+ bft_printf("--mu = %g , variable %i \n", viscl0[iphas], ivivar[iphas]);
+ bft_printf("--Cp = %g \n", cp0[0]);
+ bft_printf("--T0 = %f \n", *t0);
+ bft_printf("--P0 = %f \n", *p0);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * User scalar min and max values for clipping.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSSCA2 (ISCAVR, SCAMIN, SCAMAX)
+ * *****************
+ *
+ * INTEGER ISCAVR --> number of the related variance if any
+ * DOUBLE PRECISION SCAMIN <-- user scalar min array
+ * DOUBLE PRECISION SCAMAX <-- user scalar max array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cssca2, CSSCA2) (const int *const iscavr,
+ double *const scamin,
+ double *const scamax)
+{
+ /* Specific physics: the min max of the model scalar are not given */
+
+ int i;
+ cs_var_t *vars = cs_glob_var;
+
+ if (vars->nscaus > 0 ) {
+ for (i=0 ; i < vars->nscaus; i++) {
+ if (iscavr[i] <= 0 ) {
+ cs_gui_scalar_value(vars->label[i], "min_value", &scamin[i]);
+ cs_gui_scalar_value(vars->label[i], "max_value", &scamax[i]);
+ }
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>CSSCA2\n");
+ for (i=0 ; i < vars->nscaus ; i++) {
+ bft_printf("--scamin[%i] = %f\n", i, scamin[i]);
+ bft_printf("--scamax[%i] = %f\n", i, scamax[i]);
+ }
+#endif
+ }
+}
+
+
+/*----------------------------------------------------------------------------
+ * Read reference dynamic and user scalar viscosity
+ *----------------------------------------------------------------------------*/
+
+
+void CS_PROCF (cssca3, CSSCA3) (const int *const iscalt,
+ const int *const iscavr,
+ double *const visls0,
+ double *const t0,
+ double *const p0)
+{
+ int i, iphas = 0;
+ double result, coeff, density;
+
+ cs_var_t *vars = cs_glob_var;
+
+ if (vars->nscaus > 0) {
+
+ if (cs_gui_thermal_scalar()) {
+ result = 0;
+ cs_gui_properties_value("specific_heat", &result);
+ if (result <= 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Specific heat value is zero or not found in the xml file.\n"));
+
+ i = iscalt[iphas]-1;
+ cs_gui_properties_value("thermal_conductivity", &visls0[i]);
+ visls0[i] = visls0[i]/result;
+ }
+
+ /* User scalar
+ In the interface, the user gives the diffusion coefficient, whereas in
+ the solver, one sets the diffusivity, thus one need to multiply
+ this coefficient by the density to remain coherent */
+
+ for (i=0 ; i < vars->nscaus; i++) {
+ if (iscavr[i] <= 0 && i != iscalt[iphas]-1) {
+
+ if (vars->model != NULL) {
+ /* Air molar mass */
+ result = 0.028966;
+ cs_gui_reference_mass_molar(vars->model, &result);
+ if (result <= 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("mass molar value is zero or not found in the xml file.\n"));
+ density = *p0 * result / (8.31434 *(*t0));
+ }
+ else
+ cs_gui_properties_value("density", &density);
+
+ if (density <= 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Density value is zero or not found in the xml file.\n"));
+
+ coeff = visls0[i] / density ;
+ cs_gui_scalar_diffusion_value(i+1, &coeff);
+ visls0[i] = coeff * density;
+ }
+ }
+#if _XML_DEBUG_
+ bft_printf("==>CSSCA3\n");
+ for (i=0 ; i < vars->nscaus; i++)
+ bft_printf("--visls0[%i] = %f\n", i, visls0[i]);
+#endif
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Turbulence initialization parameters.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSTINI (UREF, ALMAX)
+ * *****************
+ *
+ * INTEGER UREF <-- reference velocity
+ * INTEGER ALMAX <-- reference length
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (cstini, CSTINI) (double *const uref,
+ double *const almax)
+{
+ int iphas = 0;
+ char* turb_ini_choice = NULL;
+
+ cs_gui_turbulence_initialization("reference_velocity", &uref[iphas]);
+
+ turb_ini_choice = cs_gui_turbulence_initialization_choice();
+
+ if (cs_gui_strcmp(turb_ini_choice, "reference_velocity_length"))
+ cs_gui_turbulence_initialization("reference_length", &almax[iphas]);
+
+ BFT_FREE(turb_ini_choice);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSTINI\n");
+ bft_printf("--almax = %f\n", almax[iphas]);
+ bft_printf("--uref = %f\n", uref[iphas]);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Properties array used in the calculation
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiprop, UIPROP) (const int *const irom,
+ const int *const iviscl,
+ const int *const ivisct,
+ const int *const ivisls,
+ const int *const icour,
+ const int *const ifour,
+ const int *const ismago,
+ const int *const iale,
+ const int *const icp,
+ const int *const iscalt,
+ const int *const iscavr,
+ const int *const iprtot,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const icmome,
+ const int *const ipptx,
+ const int *const ippty,
+ const int *const ipptz,
+ const int *const ippdt,
+ const int *const ivisma,
+ const int *const iappel)
+{
+ int iphas = 0;
+ int itype = 0;
+ int n;
+ int i = 0;
+ int nbp = 6;
+ char *name = NULL;
+
+ /* Compute the new size of vars->properties_name,
+ vars->properties_ipp and vars->propce */
+
+ if (ismago[iphas] != -1 ) nbp++;
+
+ if (icp[iphas]>0) nbp++;
+
+ if (cs_glob_var->nscaus > 0) {
+ for (i=0; i < cs_glob_var->nscaus; i++)
+ if (ivisls[i] > 0 && iscavr[i] <= 0) nbp++;
+ }
+
+ if (*iale) {
+ cs_gui_get_ale_viscosity_type(&itype);
+ if (itype == 1) {
+ nbp = nbp + 3;
+ } else {
+ nbp++;
+ }
+ }
+
+ n = cs_glob_var->nprop;
+
+ if (*iappel == 0) {
+
+ cs_glob_var->nprop += nbp;
+
+ /* Fisrt step : before the third call of VARPOS in INIUSI */
+
+ BFT_REALLOC(cs_glob_var->properties_ipp, cs_glob_var->nprop, int);
+ BFT_REALLOC(cs_glob_var->propce, cs_glob_var->nprop, int);
+ BFT_REALLOC(cs_glob_var->properties_name, cs_glob_var->nprop, char*);
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ irom[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = irom[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("density")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "density");
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ iviscl[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = iviscl[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("molecular_viscosity")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "molecular_viscosity");
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ ivisct[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = ivisct[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("turb_viscosity")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "turb_viscosity");
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ icour[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = icour[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("courant_number")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "courant_number");
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ ifour[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = ifour[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("fourier_number")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "fourier_number");
+
+ if (ismago[iphas] != -1 ) {
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ ismago[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = ismago[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("smagorinsky_constant")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "smagorinsky_constant");
+ }
+
+ if (icp[iphas] > 0) {
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ icp[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = icp[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("specific_heat")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "specific_heat");
+ }
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ iprtot[iphas]-1 ]-1 ];
+ cs_glob_var->propce[n] = iprtot[iphas];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("total_pressure")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "total_pressure");
+
+ if (*iale) {
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ ivisma[0]-1 ]-1 ];
+ cs_glob_var->propce[n] = ivisma[0];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("mesh_viscosity_1")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "mesh_viscosity_1");
+
+ if (itype == 1) {
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ ivisma[1]-1 ]-1 ];
+ cs_glob_var->propce[n] = ivisma[1];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("mesh_viscosity_2")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "mesh_viscosity_2");
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ ivisma[2]-1 ]-1 ];
+ cs_glob_var->propce[n] = ivisma[2];
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("mesh_viscosity_3")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "mesh_viscosity_3");
+ }
+
+ }
+
+ /* scalar diffusivity */
+
+ if (cs_glob_var->nscaus > 0) {
+
+ /* search lenght of first character of scalar property's suffixe : '_' */
+ for (i=0; i < cs_glob_var->nscaus; i++) {
+
+ if (iscavr[i] <= 0 && ivisls[i] > 0) {
+
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ ivisls[i]-1 ]-1 ];
+ cs_glob_var->propce[n] = ivisls[iphas];
+
+ if (iscalt[iphas] == i+1) {
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("thermal_conductivity")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "thermal_conductivity");
+ } else {
+ name = _scalar_diffusion_coefficient_name(i);
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen(name)+1, char);
+ strcpy(cs_glob_var->properties_name[n++], name);
+ BFT_FREE(name);
+ }
+ }
+ }
+ }
+
+ } else {
+
+ /* Second step : before the fourth call of VARPOS in INIUSI */
+
+ cs_glob_var->nprop = cs_glob_var->nprop + 4 + cs_glob_var->ntimaver;
+ BFT_REALLOC(cs_glob_var->properties_ipp, cs_glob_var->nprop, int);
+ BFT_REALLOC(cs_glob_var->propce, cs_glob_var->nprop, int);
+ BFT_REALLOC(cs_glob_var->properties_name, cs_glob_var->nprop, char*);
+
+ cs_glob_var->properties_ipp[n] = *ippdt;
+ cs_glob_var->propce[n] = -1;
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("local_time_step")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "local_time_step");
+
+ cs_glob_var->properties_ipp[n] = *ipptx;
+ cs_glob_var->propce[n] = -1;
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("weight_matrix_X")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "weight_matrix_X");
+
+ cs_glob_var->properties_ipp[n] = *ippty;
+ cs_glob_var->propce[n] = -1;
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("weight_matrix_Y")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "weight_matrix_Y");
+
+ cs_glob_var->properties_ipp[n] = *ipptz;
+ cs_glob_var->propce[n] = -1;
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen("weight_matrix_Z")+1, char);
+ strcpy(cs_glob_var->properties_name[n++], "weight_matrix_Z");
+
+ for (i=0; i < cs_glob_var->ntimaver; i++) {
+ cs_glob_var->properties_ipp[n] = ipppro[ ipproc[ icmome[i]-1 ]-1 ];
+ cs_glob_var->propce[n] = icmome[i];
+ name = cs_gui_get_mean_label(i+1);
+ BFT_MALLOC(cs_glob_var->properties_name[n], strlen(name)+1, char);
+ strcpy(cs_glob_var->properties_name[n++], name);
+ BFT_FREE(name);
+ }
+ }
+
+ if (n != cs_glob_var->nprop)
+ bft_error(__FILE__, __LINE__, 0,
+ _("number of properties is not correct: %i instead of: %i\n"),
+ n, cs_glob_var->nprop);
+
+#if _XML_DEBUG_
+ bft_printf("==>UIPROP %i\n",*iappel);
+ bft_printf("-->nombre de proprietes = %i\n", cs_glob_var->nprop);
+ for (i=0; i < cs_glob_var->nprop; i++) {
+ bft_printf("-->properties_ipp[%i]: %i propce[%i]: %i "
+ "properties_name[%i]: %s\n",
+ i, cs_glob_var->properties_ipp[i],
+ i, cs_glob_var->propce[i],
+ i, cs_glob_var->properties_name[i]);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Temporal averaging treatment
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uimoyt, UIMOYT) (const int *const ndgmox,
+ int *const ntdmom,
+ int *const imoold,
+ int *const idfmom)
+{
+ int nmean = 0;
+ int imom = 0;
+ int isuite = 0;
+ int i, j, n, nb;
+ char *name = NULL;
+
+ cs_glob_var->ntimaver
+ = cs_gui_get_tag_number("/analysis_control/time_averages/time_average", 1);
+
+ /* for each average */
+ for (i=0; i < cs_glob_var->ntimaver; i++) {
+
+ imom = i + 1;
+ cs_gui_get_mean_value(imom, "time_step_start", &ntdmom[i]);
+
+ /* test on isuite */
+ cs_gui_restart_parameters_status("restart", &isuite);
+
+ if (isuite != 0) {
+ cs_gui_get_mean_value(imom, "restart_from_time_average", &imoold[i]);
+ if (imoold[i] == imom) imoold[i] = -2;
+ }
+
+ nmean = cs_gui_get_mean_names_number(imom);
+
+ for (n=0; n<nmean; n++) {
+
+ nb = n + 1;
+ name = cs_gui_get_mean_prop(imom, nb);
+
+ for (j=0; j < cs_glob_var->nvar; j++){
+ if (cs_gui_strcmp(name, cs_glob_var->name[j])) {
+ idfmom[(imom-1)*(*ndgmox) + n] = cs_glob_var->rtp[j] +1;
+ }
+ }
+ for (j=0 ; j < cs_glob_var->nprop; j++) {
+ if (cs_gui_strcmp(name, cs_glob_var->properties_name[j]))
+ idfmom[(imom-1)*(*ndgmox) + n] = -(cs_glob_var->propce[j]);
+ }
+
+ BFT_FREE(name);
+ }
+
+ }
+#if _XML_DEBUG_
+ bft_printf("==>UIMOYT\n");
+ for (i=0; i < cs_glob_var->ntimaver; i++) {
+ bft_printf("-->ntdmom = %i\n", ntdmom[i]);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Input/output treatment
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csenso, CSENSO)
+(
+ const int *const nvppmx,
+ int *const ncapt,
+ int *const nthist,
+ int *const ntlist,
+ int *const ichrvl,
+ int *const ichrbo,
+ int *const ichrsy,
+ int *const ichrmd,
+ char *const fmtchr,
+ int *const size_fmt,
+ char *const optchr,
+ int *const size_opt,
+ int *const ntchr,
+ int *const iecaux,
+ int *const ipstdv,
+ int *const ipstyp,
+ int *const ipstcl,
+ int *const ipstft,
+ int *const ipstfo,
+ int *const ichrvr,
+ int *const ilisvr,
+ int *const ihisvr,
+ const int *const isca,
+ const int *const iscapp,
+ const int *const ipprtp,
+ double *const xyzcap)
+{
+ int i, j;
+ int ipp;
+
+ cs_var_t *vars = cs_glob_var;
+
+ cs_gui_output_value("fluid_domain", ichrvl);
+ cs_gui_output_value("domain_boundary", ichrbo);
+ cs_gui_output_value("syrthes_boundary", ichrsy);
+ cs_gui_output_value("auxiliary_restart_file_writing", iecaux);
+ cs_gui_output_value("listing_printing_frequency", ntlist);
+ cs_gui_output_value("postprocessing_frequency", ntchr);
+ cs_gui_output_value("probe_recording_frequency", nthist);
+ cs_gui_output_value("postprocessing_mesh_options", ichrmd);
+ cs_gui_output_choice("postprocessing_format", fmtchr, size_fmt);
+ cs_gui_output_choice("postprocessing_options", optchr, size_opt);
+
+ /* Surfacic variables output */
+ cs_gui_surfacic_variable_post("yplus", ipstyp, ipstdv);
+ cs_gui_surfacic_variable_post("effort", ipstfo, ipstdv);
+ cs_gui_surfacic_variable_post("all_variables",ipstcl, ipstdv);
+ cs_gui_surfacic_variable_post("input_thermal_flux",ipstft, ipstdv);
+
+ *ncapt = cs_gui_get_tag_number("/analysis_control/output/probe", 1);
+ for (i=0; i < *ncapt; i++) {
+ xyzcap[0 + i*3] = cs_gui_probe_coordinate(i+1, "probe_x");
+ xyzcap[1 + i*3] = cs_gui_probe_coordinate(i+1, "probe_y");
+ xyzcap[2 + i*3] = cs_gui_probe_coordinate(i+1, "probe_z");
+ }
+
+ /* Velocity and turbulence output */
+ for (i=0; i<vars->nvar - vars->nscaus - vars->nscapp; i++) {
+ ipp = ipprtp[vars->rtp[i]];
+ cs_gui_thermophysical_post(vars->name[i],
+ ipp,
+ ihisvr, ilisvr, ichrvr,
+ nvppmx);
+ }
+
+ /* User scalar */
+ if (vars->nscaus > 0 ) {
+ for (i=0 ; i < vars->nscaus; i++) {
+ cs_gui_scalar_post(i, ihisvr, ilisvr, ichrvr,
+ ipprtp, isca, nvppmx);
+ }
+ }
+
+ /* Specific physics scalars */
+ if (vars->nscapp > 0) {
+ for (i=0 ; i < vars->nscapp; i++) {
+ j = iscapp[i]-1 ;
+ cs_gui_model_scalar_post(vars->model, j,
+ ihisvr, ilisvr, ichrvr,
+ ipprtp, isca, nvppmx);
+ }
+ }
+
+ /* Physical properties */
+
+ if (vars->nsalpp > 0) {
+ for (i=0 ; i < vars->nsalpp; i++) {
+ cs_gui_model_property_post(vars->model, i,
+ ihisvr, ilisvr, ichrvr, nvppmx);
+ }
+ }
+
+ for (i=vars->nsalpp ; i < vars->nprop ; i++) {
+ if (vars->ntimaver != 0 && i >= vars->nprop - vars->ntimaver) {
+ cs_gui_time_average_post(vars->properties_name[i],
+ vars->properties_ipp[i],
+ ichrvr,
+ ilisvr,
+ ihisvr,
+ nvppmx);
+ }
+ else
+ cs_gui_properties_post(vars->properties_name[i],
+ vars->properties_ipp[i],
+ ichrvr,
+ ilisvr,
+ ihisvr,
+ nvppmx);
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>CSENSO\n");
+ bft_printf("--iecaux = %i\n", *iecaux);
+ bft_printf("--ichrvl = %i\n", *ichrvl);
+ bft_printf("--ichrbo = %i\n", *ichrbo);
+ bft_printf("--ichrsy = %i\n", *ichrsy);
+ bft_printf("--fmtchr = %s\n", "need to be checked in Fortran");
+ bft_printf("--optchr = %s\n", "need to be checked in Fortran");
+ bft_printf("--ntlist = %i\n", *ntlist);
+ bft_printf("--ntchr = %i\n", *ntchr);
+ bft_printf("--nthist = %i\n", *nthist);
+ bft_printf("--ncapt = %i\n", *ncapt);
+ for (i = 0; i < *ncapt; i++) {
+ bft_printf("--xyzcap[%i][0] = %f\n", i, xyzcap[0 +i*3]);
+ bft_printf("--xyzcap[%i][1] = %f\n", i, xyzcap[1 +i*3]);
+ bft_printf("--xyzcap[%i][2] = %f\n", i, xyzcap[2 +i*3]);
+ }
+ for (i=0; i < vars->nvar - vars->nscaus - vars->nscapp; i++){
+ ipp = ipprtp[vars->rtp[i]];
+ bft_printf("-->variable ipprtp[%i] = %s\n", ipp, vars->name[i]);
+ bft_printf("--ichrvr[%i] = %i \n", ipp, ichrvr[ipp-1]);
+ bft_printf("--ilisvr[%i] = %i \n", ipp, ilisvr[ipp-1]);
+ bft_printf("--ihisvr[0][%i]= %i \n", ipp, ihisvr[0 + (ipp-1)]);
+ if (ihisvr[0 + (ipp-1)]>0)
+ for (j=0; j<ihisvr[0 + (ipp-1)]; j++)
+ bft_printf("--ihisvr[%i][%i]= %i \n", j+1, ipp,
+ ihisvr[(j+1)*(*nvppmx) + (ipp-1)]);
+ }
+ for (i=0 ; i < vars->nscaus + vars->nscapp ; i++) {
+ ipp = ipprtp[isca[i] -1];
+ bft_printf("-->scalar ipprtp[%i]: %s\n", ipp, vars->label[i]);
+ bft_printf("--ichrvr[%i] = %i \n", ipp, ichrvr[ipp-1]);
+ bft_printf("--ilisvr[%i] = %i \n", ipp, ilisvr[ipp-1]);
+ bft_printf("--ihisvr[0][%i]= %i \n", ipp, ihisvr[0 + (ipp-1)]);
+ if (ihisvr[0 + (ipp-1)]>0)
+ for (j=0; j<ihisvr[0 + (ipp-1)]; j++)
+ bft_printf("--ihisvr[%i][%i]= %i \n", j+1, ipp,
+ ihisvr[(j+1)*(*nvppmx) + (ipp-1)]);
+ }
+ for (i=0 ; i<vars->nprop ; i++) {
+ ipp = vars->properties_ipp[i];
+ bft_printf("-->properties_name[%i]: %s\n", i, vars->properties_name[i]);
+ bft_printf("--ichrvr[%i] = %i \n", ipp, ichrvr[ipp-1]);
+ bft_printf("--ilisvr[%i] = %i \n", ipp, ilisvr[ipp-1]);
+ bft_printf("--ihisvr[0][%i]= %i \n", ipp, ihisvr[0 + (ipp-1)]);
+ if (ihisvr[0 + (ipp-1)]>0)
+ for (j=0; j<ihisvr[0 + (ipp-1)]; j++)
+ bft_printf("--ihisvr[%i][%i]= %i \n", j+1, ipp,
+ ihisvr[(j+1)*(*nvppmx) + (ipp-1)]);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Users arrays
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIUSAR (ICOFTU)
+ * *****************
+ *
+ * INTEGER ICOFTU --> Dimension coef for user arrays
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiusar, UIUSAR) (int *const icoftu)
+{
+ icoftu[0] = _user_array("integer_user_array", "ncelet");
+ icoftu[1] = _user_array("integer_user_array", "nfac");
+ icoftu[2] = _user_array("integer_user_array", "nfabor");
+ icoftu[3] = _user_array("integer_user_array", "dimless");
+
+ icoftu[4] = _user_array("real_user_array", "ncelet");
+ icoftu[5] = _user_array("real_user_array", "nfac");
+ icoftu[6] = _user_array("real_user_array", "nfabor");
+ icoftu[7] = _user_array("real_user_array", "dimless");
+
+ icoftu[8] = _user_array("integer_work_array", "ncelet");
+ icoftu[9] = _user_array("integer_work_array", "nfac");
+ icoftu[10] = _user_array("integer_work_array", "nfabor");
+ icoftu[11] = _user_array("integer_work_array", "dimless");
+
+ icoftu[12] = _user_array("real_work_array", "ncelet");
+ icoftu[13] = _user_array("real_work_array", "nfac");
+ icoftu[14] = _user_array("real_work_array", "nfabor");
+ icoftu[15] = _user_array("real_work_array", "dimless");
+
+
+#if _XML_DEBUG_
+ bft_printf("==>UIUSAR\n");
+ bft_printf("--icoftu = %i %i %i %i\n",
+ icoftu[0],icoftu[1],icoftu[2],icoftu[3]);
+ bft_printf(" %i %i %i %i\n",
+ icoftu[4],icoftu[5],icoftu[6],icoftu[7]);
+ bft_printf("--icoftu = %i %i %i %i\n",
+ icoftu[8],icoftu[9],icoftu[10],icoftu[11]);
+ bft_printf(" %i %i %i %i\n",
+ icoftu[12],icoftu[13],icoftu[14],icoftu[15]);
+#endif
+}
+
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fcnmva, FCNMVA)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i, i1, i2, l;
+ char *cstr = NULL;
+
+ assert(*var_id > 0);
+
+ /* Resize array if necessary */
+
+ if (*var_id > cs_glob_label->_cs_gui_max_vars) {
+
+ if (cs_glob_label->_cs_gui_max_vars == 0)
+ cs_glob_label->_cs_gui_max_vars = 16;
+
+ while (cs_glob_label->_cs_gui_max_vars <= *var_id)
+ cs_glob_label->_cs_gui_max_vars *= 2;
+
+ BFT_REALLOC(cs_glob_label->_cs_gui_var_name, cs_glob_label->_cs_gui_max_vars, char *);
+ for (i = cs_glob_label->_cs_gui_last_var; i < cs_glob_label->_cs_gui_max_vars; i++)
+ cs_glob_label->_cs_gui_var_name[i] = NULL;
+ }
+
+ /* Compute string length (removing start or end blanks) */
+
+ for (i1 = 0;
+ i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
+ i1++);
+
+ for (i2 = *len - 1;
+ i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
+ i2--);
+
+ l = i2 - i1 + 1;
+
+ /* Should be called once per variable only */
+ assert(cs_glob_label->_cs_gui_var_name[*var_id - 1] == NULL);
+
+ if (l > 0) {
+
+ /* Allocate and copy */
+ BFT_MALLOC(cstr, l + 1, char);
+
+ for (i = 0 ; i < l ; i++, i1++)
+ cstr[i] = fstr[i1];
+
+ cstr[l] = '\0';
+
+ cs_glob_label->_cs_gui_var_name[*var_id - 1] = cstr;
+
+ }
+
+ /* Update variable counter */
+ cs_glob_label->_cs_gui_last_var = *var_id;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from C to Fortran
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(cfnmva, CFNMVA)
+(
+ char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i;
+ int l = 0;
+ char *cstr = NULL;
+
+ /* Check that variable name was set */
+
+ if (*var_id < 1 || *var_id > cs_glob_label->_cs_gui_last_var)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Name of variable %i was never set.\n"), *var_id);
+
+ /* Copy string */
+
+ cstr = cs_glob_label->_cs_gui_var_name[*var_id - 1];
+
+ if (cstr != NULL) {
+
+ /* Compute string length (removing start or end blanks) */
+
+ l = strlen(cstr);
+ if (l > *len)
+ l = *len;
+
+ for (i = 0; i < l; i++)
+ fstr[i] = cstr[i];
+
+ }
+
+ /* Pad with blanks if necessary */
+
+ for (i = l; i < *len; i++)
+ fstr[i] = ' ';
+}
+
+/*----------------------------------------------------------------------------
+ * Clean memory for fortran name of variables
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(nvamem, NVAMEM) (void)
+{
+ int i;
+#if _XML_DEBUG_
+ bft_printf("==>NVAMEM\n");
+ for (i = 0; i < cs_glob_label->_cs_gui_max_vars; i++)
+ if (cs_glob_label->_cs_gui_var_name[i])
+ bft_printf("-->label[%i] = %s\n", i, cs_glob_label->_cs_gui_var_name[i]);
+#endif
+
+ for (i = 0; i < cs_glob_label->_cs_gui_max_vars; i++)
+ BFT_FREE(cs_glob_label->_cs_gui_var_name[i]);
+
+ BFT_FREE(cs_glob_label->_cs_gui_var_name);
+
+ cs_glob_label->_cs_gui_max_vars = 0;
+ cs_glob_label->_cs_gui_last_var = 0;
+}
+
+/*----------------------------------------------------------------------------
+ * Variables and user scalars initialization
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIINIV (NCELET, ISCA, RTP)
+ * *****************
+ *
+ * INTEGER NCELET --> number of cells with halo
+ * INTEGER ISCA --> indirection array for scalar number
+ * DOUBLE PRECISION RTP <-- variables and scalars array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(uiiniv, UIINIV)(const int *const ncelet,
+ const int *const isca,
+ double *const rtp)
+{
+ /* Coal combustion: the initialization of the model scalar are not given */
+
+ int i, j, icel, iel, c_id;
+ int zones = 0;
+ int cells = 0;
+ int *cells_list = NULL;
+ double initial_value = 0;
+ char *choice = NULL;
+ char *name = NULL;
+ char *description = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ /* number of volumic zone */
+
+ zones
+ = cs_gui_get_tag_number("/solution_domain/volumic_conditions/zone", 1);
+
+#if _XML_DEBUG_
+ bft_printf("==>UIINIV\n");
+ bft_printf("--initialization zones number: %i\n", zones);
+#endif
+
+ for (i=1; i < zones+1; i++) {
+
+ /* name and description (color or group) of the ith initialization zone */
+ name = cs_gui_volumic_zone_name(i);
+ description = cs_gui_volumic_zone_localization(name);
+
+ /* build list of cells */
+ BFT_MALLOC(cells_list, *ncelet, int);
+
+ c_id = fvm_selector_get_list(cs_glob_mesh->select_cells,
+ description,
+ &cells,
+ cells_list);
+
+ if (fvm_selector_n_missing(cs_glob_mesh->select_cells, c_id) > 0) {
+ const char *missing
+ = fvm_selector_get_missing(cs_glob_mesh->select_cells, c_id, 0);
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("The group or attribute \"%s\" in the selection\n"
+ "criteria:\n"
+ "\"%s\"\n"
+ " does not correspond to any cell.\n"),
+ missing, description);
+ }
+
+
+ /* Velocity variables initialization */
+ for (j=1; j < 4; j++) {
+
+ cs_gui_variable_initial_value(vars->name[j], name, &initial_value);
+
+ for (icel = 0; icel < cells; icel++) {
+ iel = cells_list[icel]-1;
+ rtp[vars->rtp[j]*(*ncelet) + iel] = initial_value;
+ }
+ }
+
+ /* Turbulence variables initialization */
+ choice = cs_gui_turbulence_initialization_choice();
+
+ if (cs_gui_strcmp(choice, "values")) {
+ for (j=4; j < vars->nvar - vars->nscaus - vars->nscapp; j++) {
+
+ cs_gui_variable_initial_value(vars->name[j], name, &initial_value);
+
+ for (icel = 0; icel < cells; icel++) {
+ iel = cells_list[icel]-1;
+ rtp[vars->rtp[j]*(*ncelet) + iel] = initial_value;
+ }
+ }
+ }
+ BFT_FREE(choice);
+
+ /* User Scalars initialization */
+ for (j=0; j < vars->nscaus; j++) {
+
+ cs_gui_scalar_initial_value("additional_scalars",
+ vars->label[j],
+ name,
+ &initial_value);
+
+ for (icel = 0; icel < cells; icel++) {
+ iel = cells_list[icel]-1;
+ rtp[(isca[j]-1)*(*ncelet) + iel] = initial_value;
+ }
+ }
+ BFT_FREE(cells_list);
+
+#if _XML_DEBUG_
+ bft_printf("--zone name and description: %s, %s\n", name, description);
+ bft_printf("--zone's element number: %i\n", cells);
+
+ for (j=1; j < vars->nvar - vars->nscaus - vars->nscapp; j++){
+ cs_gui_variable_initial_value(vars->name[j], name, &initial_value);
+ bft_printf("--initial value for %s: %f\n",
+ vars->name[j], initial_value);
+ }
+
+ for (j=0; j < vars->nscaus; j++) {
+ cs_gui_scalar_initial_value("additional_scalars",
+ vars->label[j],
+ name,
+ &initial_value);
+ bft_printf("--initial value for %s: %f\n", vars->label[j], initial_value);
+ }
+#endif
+ BFT_FREE(name);
+ BFT_FREE(description);
+ } /* zones+1 */
+}
+
+/*----------------------------------------------------------------------------
+ * User law for material properties
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIPHYV
+ * *****************
+ *
+ * INTEGER NCEL --> number of cells whithout halo
+ * INTEGER NCELET --> number of cells whith halo
+ * INTEGER NSCAUS --> number of user scalar including thermal scalar
+ * INTEGER IROM --> pointer for density rho
+ * INTEGER IVISCL --> pointer for mulecular viscosity mu
+ * INTEGER ICP --> pointer for specific heat Cp
+ * INTEGER IVISLS --> pointer for Lambda/Cp
+ * INTEGER IROVAR --> =1 if rho variable, =0 if rho constant
+ * INTEGER IVIVAR --> =1 if mu variable, =0 if mu constant
+ * INTEGER ISCA --> indirection array for scalar number
+ * INTEGER ISCALT --> pointer for the thermal scalar in ISCA
+ * INTEGER ISCAVR --> scalars that are variance
+ * INTEGER IPPROC --> indirection array for cell properties
+ * DOUBLE PRECISION RO0 --> value of density if IROVAR=0
+ * DOUBLE PRECISION CP0 --> value of specific heat if ICP=0
+ * DOUBLE PRECISION RTP --> variables and scalars array
+ * DOUBLE PRECISION PROPCE <-- cell properties array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(uiphyv, UIPHYV)(const cs_int_t *const ncel,
+ const cs_int_t *const ncelet,
+ const cs_int_t *const nscaus,
+ const cs_int_t irom[],
+ const cs_int_t iviscl[],
+ const cs_int_t icp[],
+ const cs_int_t ivisls[],
+ const cs_int_t irovar[],
+ const cs_int_t ivivar[],
+ const cs_int_t isca[],
+ const cs_int_t iscalt[],
+ const cs_int_t iscavr[],
+ const cs_int_t ipproc[],
+ const cs_real_t ro0[],
+ const cs_real_t cp0[],
+ const cs_real_t rtp[],
+ cs_real_t propce[])
+{
+#if defined(HAVE_MEI)
+
+ cs_var_t *vars = cs_glob_var;
+ mei_tree_t *ev_rho = NULL;
+ mei_tree_t *ev_mu = NULL;
+ mei_tree_t *ev_cp = NULL;
+ mei_tree_t *ev_la = NULL;
+ mei_tree_t *ev_Ds = NULL;
+ char *law_rho = NULL;
+ char *law_mu = NULL;
+ char *law_cp = NULL;
+ char *law_la = NULL;
+ char *law_Ds = NULL;
+
+ cs_int_t iphas = 0;
+ char *path = NULL;
+ int i, j, iel;
+ double tmp;
+
+ int ipcrom = ipproc[ irom [iphas] -1 ] -1;
+ int ipcvis = ipproc[ iviscl[iphas] -1 ] -1;
+ int ipccp = ipproc[ icp [iphas] -1 ] -1;
+ int ipcvsl = ipproc[ ivisls[iscalt[iphas] -1 ] -1 ] -1; /* Lambda/Cp from the current thermal scalar */
+
+ /* law for density */
+
+ if (irovar[iphas] == 1 && cs_gui_strcmp(_properties_choice("density"), "user_law"))
+ {
+ /* search the formula for the law */
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", "density");
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ law_rho = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+
+ /* return an empty interpreter */
+
+ ev_rho = mei_tree_new(law_rho);
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_rho, vars->label[i], 0.0);
+
+ /* try to build the interpreter */
+
+ if (mei_tree_builder(ev_rho))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not interprete expression: %s\n"), ev_rho->string);
+
+ if (mei_tree_find_symbol(ev_rho, "rho"))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not find the required symbol: %s\n"), "rho");
+
+ /* for each cell, update the value of the table of symbols for each scalar
+ (including the thermal scalar), and evaluate the interpreter */
+
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_rho,
+ vars->label[i],
+ rtp[(isca[i] -1) * (*ncelet) + iel]);
+
+ tmp = mei_evaluate(ev_rho);
+ propce[ipcrom * (*ncelet) + iel] = mei_tree_lookup(ev_rho, "rho");
+ }
+
+ mei_tree_destroy(ev_rho);
+ }
+
+ /* law for molecular viscosity */
+
+ if (ivivar[iphas] == 1 && cs_gui_strcmp(_properties_choice("molecular_viscosity"), "user_law"))
+ {
+ /* search the formula for the law */
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", "molecular_viscosity");
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ law_mu = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+
+ /* return an empty interpreter */
+
+ ev_mu = mei_tree_new(law_mu);
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_mu, vars->label[i], 0.0);
+
+ /* try to build the interpreter */
+
+ if (mei_tree_builder(ev_mu))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not interprete expression: %s\n"), ev_mu->string);
+
+ if (mei_tree_find_symbol(ev_mu, "mu"))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not find the required symbol: %s\n"), "mu");
+
+ /* for each cell, update the value of the table of symbols for each scalar
+ (including the thermal scalar), and evaluate the interpreter */
+
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_mu,
+ vars->label[i],
+ rtp[(isca[i] -1) * (*ncelet) + iel]);
+
+ tmp = mei_evaluate(ev_mu);
+ propce[ipcvis * (*ncelet) + iel] = mei_tree_lookup(ev_mu, "mu");
+ }
+
+ mei_tree_destroy(ev_mu);
+ }
+
+ /* law for specific heat */
+
+ if (icp[iphas] > 0 && cs_gui_strcmp(_properties_choice("specific_heat"), "user_law"))
+ {
+ /* search the formula for the law */
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", "specific_heat");
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ law_cp = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+
+ /* return an empty interpreter */
+
+ ev_cp = mei_tree_new(law_cp);
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_cp, vars->label[i], 0.0);
+
+ /* try to build the interpreter */
+
+ if (mei_tree_builder(ev_cp))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not interprete expression: %s\n"), ev_cp->string);
+
+ if (mei_tree_find_symbol(ev_cp, "cp"))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not find the required symbol: %s\n"), "cp");
+
+ /* for each cell, update the value of the table of symbols for each scalar
+ (including the thermal scalar), and evaluate the interpreter */
+
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_cp,
+ vars->label[i],
+ rtp[(isca[i] -1) * (*ncelet) + iel]);
+
+ tmp = mei_evaluate(ev_cp);
+ propce[ipccp * (*ncelet) + iel] = mei_tree_lookup(ev_cp, "cp");
+ }
+
+ mei_tree_destroy(ev_rho);
+ }
+
+ /* law for thermal conductivity */
+
+ if (ivisls[iscalt[iphas] -1] > 0 && cs_gui_strcmp(_properties_choice("thermal_conductivity"), "user_law"))
+ {
+ /* search the formula for the law */
+
+ path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_test_attribute(&path, "name", "thermal_conductivity");
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ law_la = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+
+ /* return an empty interpreter */
+
+ ev_la = mei_tree_new(law_la);
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_la, vars->label[i], 0.0);
+
+ /* try to build the interpreter */
+
+ if (mei_tree_builder(ev_la))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not interprete expression: %s\n"), ev_la->string);
+
+ if (mei_tree_find_symbol(ev_la, "lambda"))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not find the required symbol: %s\n"), "lambda");
+
+ /* for each cell, update the value of the table of symbols for each scalar
+ (including the thermal scalar), and evaluate the interpreter */
+
+ if (icp[iphas] > 0)
+ {
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_la,
+ vars->label[i],
+ rtp[(isca[i] -1) * (*ncelet) + iel]);
+
+ tmp = mei_evaluate(ev_la);
+ propce[ipcvsl * (*ncelet) + iel] =
+ mei_tree_lookup(ev_la, "lambda") / propce[ipccp * (*ncelet) + iel];
+ }
+ }
+ else
+ {
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_la,
+ vars->label[i],
+ rtp[(isca[i] -1) * (*ncelet) + iel]);
+
+ tmp = mei_evaluate(ev_la);
+ propce[ipcvsl * (*ncelet) + iel] =
+ mei_tree_lookup(ev_la, "lambda") / cp0[iphas];
+ }
+ }
+ mei_tree_destroy(ev_la);
+ }
+
+ /* law for scalar diffusivity */
+
+ for (j = 0; j < *nscaus; j++)
+ {
+ char *name = _scalar_diffusion_coefficient_name(j);
+
+ if (j != iscalt[iphas] -1 && iscavr[j] <= 0 && ivisls[j] > 0 &&
+ cs_gui_strcmp(_properties_choice(name), "user_law"))
+ {
+ ipcvsl = ipproc[ ivisls[j] -1 ] -1;
+
+ /* search the formula for the law */
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "additional_scalars");
+ cs_xpath_add_element_num(&path, "scalar", j+1);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ law_Ds = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+
+ /* return an empty interpreter */
+
+ ev_Ds = mei_tree_new(law_Ds);
+ BFT_FREE(law_Ds);
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_Ds, vars->label[i], 0.0);
+
+ /* try to build the interpreter */
+
+ if (mei_tree_builder(ev_Ds))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not interprete expression: %s\n"), ev_Ds->string);
+
+ if (mei_tree_find_symbol(ev_Ds, "diffusivity"))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not find the required symbol: %s\n"), "diffusivity");
+
+ /* for each cell, update the value of the table of symbols for each scalar
+ (including the thermal scalar), and evaluate the interpreter */
+
+ if (irovar[iphas] == 1)
+ {
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_Ds,
+ vars->label[i],
+ rtp[(isca[i] -1) * (*ncelet) + iel]);
+
+ tmp = mei_evaluate(ev_Ds);
+ propce[ipcvsl * (*ncelet) + iel] =
+ mei_tree_lookup(ev_Ds, "diffusivity") * propce[ipcrom * (*ncelet) + iel];
+ }
+ }
+ else
+ {
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ for (i = 0; i < *nscaus; i++)
+ mei_tree_insert(ev_Ds,
+ vars->label[i],
+ rtp[(isca[i] -1) * (*ncelet) + iel]);
+
+ tmp = mei_evaluate(ev_Ds);
+ propce[ipcvsl * (*ncelet) + iel] =
+ mei_tree_lookup(ev_Ds, "diffusivity") * ro0[iphas];
+ }
+ }
+ mei_tree_destroy(ev_Ds);
+ }
+ BFT_FREE(name);
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>UIPHYV\n");
+ if (irovar[iphas] == 1)
+ bft_printf("--law for density: %s\n", law_rho);
+
+ if (ivivar[iphas] == 1)
+ bft_printf("--law for viscosity: %s\n", law_mu);
+
+ if (icp[iphas] > 0)
+ bft_printf("--law for specific heat: %s\n", law_cp);
+
+ if (ivisls[iscalt[iphas] -1] > 0)
+ bft_printf("--law for thermal conductivity: %s\n", law_la);
+
+ for (j = 0; j < *nscaus; j++)
+ {
+ if (j != iscalt[iphas] -1 && iscavr[j] <= 0 && ivisls[j] > 0)
+ {
+ ipcvsl = ipproc[ ivisls[j] -1 ] -1;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "additional_scalars");
+ cs_xpath_add_element_num(&path, "scalar", j+1);
+ cs_xpath_add_element(&path, "property");
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ law_Ds = cs_gui_get_text_value(path);
+ bft_printf("--law for the coefficient of diffusity of the scalar %s: %s\n",
+ vars->label[j], law_Ds);
+ BFT_FREE(path);
+ BFT_FREE(law_Ds);
+ }
+ }
+#endif
+
+ BFT_FREE(law_rho);
+ BFT_FREE(law_mu);
+ BFT_FREE(law_cp);
+ BFT_FREE(law_la);
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * 1D profile postprocessing
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIPROF
+ * *****************
+ *
+ * INTEGER NCELET --> number of cells with halo
+ * INTEGER NCEL --> number of cells without halo
+ * INTEGER NTMABS --> max iterations numbers
+ * INTEGER NTCABS --> current iteration number
+ * DOUBLE PRECISION TTCABS --> current physical time
+ * DOUBLE PRECISION XYZCEN --> cell's gravity center
+ * DOUBLE PRECISION RTP --> variables and scalars array
+ * DOUBLE PRECISION PROPCE --> property array
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiprof, UIPROF) (const int *const ncelet,
+ const int *const ncel,
+ const int *const ntmabs,
+ const int *const ntcabs,
+ const double *const ttcabs,
+ const double *const xyzcen,
+ const double *const rtp,
+ const double *const propce)
+{
+ FILE *file = NULL;
+ char *filename = NULL;
+ char *buffer = NULL;
+ char *name = NULL;
+ char *buf1 = NULL;
+ char *buf2 = NULL;
+
+ int fic_nbr = 0;
+ int i, ii, iii, j;
+ int npoint, iel1, irang1, iel, irangv;
+ int nvar_prop, nvar_prop4, output_frequency;
+ double x1, x2, y1, y2, z1, z2;
+ double xx, yy, zz, xyz[3];
+ double a, aa;
+ double *array;
+
+ cs_var_t *vars = cs_glob_var;
+
+ /* get the number of 1D profile file to write*/
+
+ fic_nbr = cs_gui_get_tag_number("/analysis_control/profiles/profile", 1);
+
+ if (!fic_nbr) return;
+
+ for (i = 0 ; i < fic_nbr ; i++) {
+
+ /* for each profile, check the output frequency */
+
+ output_frequency = _get_profile_coordinate(i, "output_frequency");
+
+ if ((output_frequency == -1 && *ntmabs == *ntcabs) ||
+ (output_frequency > 0 && (*ntcabs % output_frequency) == 0)) {
+
+ x1 = _get_profile_coordinate(i, "x1");
+ y1 = _get_profile_coordinate(i, "y1");
+ z1 = _get_profile_coordinate(i, "z1");
+ x2 = _get_profile_coordinate(i, "x2");
+ y2 = _get_profile_coordinate(i, "y2");
+ z2 = _get_profile_coordinate(i, "z2");
+
+ nvar_prop = _get_profile_names_number(i);
+ nvar_prop4 = nvar_prop + 4;
+ BFT_MALLOC(array, nvar_prop4, double);
+
+ /* Only the first processor rank opens the file */
+
+ if (cs_glob_rank_id <= 0) {
+
+ filename = _get_profile_label(i);
+
+ if (output_frequency > 0) {
+
+ /* Extension creation : format stored in 'buffer' */
+ j = cs_gui_characters_number(*ntmabs);
+
+ BFT_MALLOC(buffer, 3, char);
+ BFT_MALLOC(buf2, j+1, char);
+ strcpy(buffer, "%.");
+ sprintf(buf2, "%i", j);
+ BFT_REALLOC(buffer, j+1, char);
+ strcat(buffer, buf2);
+ strcat(buffer, "i");
+
+ BFT_MALLOC(buf1, j+1, char);
+ sprintf(buf1, buffer, *ntcabs);
+
+ BFT_REALLOC(filename, j, char);
+ strcat(filename, "_");
+ strcat(filename, buf1);
+
+ BFT_FREE(buf1);
+ BFT_FREE(buf2);
+ BFT_FREE(buffer);
+ }
+
+ file = fopen(filename, "w");
+
+ if (file == NULL) {
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf( _("Unable to open the file: %s\n"), filename);
+ break;
+ }
+
+ fprintf(file, "# Code_Saturne 1D result's profile\n#\n");
+ fprintf(file, "# Iteration output: %i\n", *ntcabs);
+ fprintf(file, "# Time output: %12.5e\n#\n", *ttcabs);
+ fprintf(file, "# Start point: x = %12.5e y = %12.5e z = %12.5e\n",
+ x1, y1, z1);
+ fprintf(file, "# End point: x = %12.5e y = %12.5e z = %12.5e\n#\n",
+ x2, y2, z2);
+ fprintf(file, "#TITLE: %s\n", filename);
+ fprintf(file, "#COLUMN_TITLES: Distance | X | Y | Z");
+ for (ii = 0 ; ii < nvar_prop ; ii++) {
+ buffer = _get_profile_label_name(i, ii);
+ fprintf(file, " | %s", buffer);
+ BFT_FREE(buffer);
+ }
+ fprintf(file, "\n");
+ BFT_FREE(filename);
+ }
+
+ npoint = 200;
+ iel1 = -999;
+ irang1 = -999;
+
+ a = 1. / (double) (npoint-1);
+
+ for (ii = 0; ii < npoint; ii++) {
+
+ aa = ii*a;
+ xyz[0] = aa * (x2 - x1) + x1;
+ xyz[1] = aa * (y2 - y1) + y1;
+ xyz[2] = aa * (z2 - z1) + z1;
+
+ CS_PROCF(findpt, FINDPT)(ncelet, ncel, xyzcen,
+ &xyz[0], &xyz[1], &xyz[2],
+ &iel, &irangv);
+
+ if ((iel != iel1) || (irangv != irang1)) {
+ iel1 = iel;
+ irang1 = irangv;
+
+ if (cs_glob_rank_id == irangv) {
+
+ iel--;
+ xx = xyzcen[3 * iel + 0];
+ yy = xyzcen[3 * iel + 1];
+ zz = xyzcen[3 * iel + 2];
+ array[1] = xx;
+ array[2] = yy;
+ array[3] = zz;
+ xx = xx - x1;
+ yy = yy - y1;
+ zz = zz - z1;
+ array[0] = sqrt(xx*xx + yy*yy + zz*zz);
+
+ for (iii=0; iii < nvar_prop; iii++) {
+
+ name = _get_profile_name(i, iii);
+
+ for (j=0; j < vars->nvar; j++) {
+ if (cs_gui_strcmp(name, vars->name[j]))
+ array[iii+4] = rtp[vars->rtp[j] * (*ncelet) + iel];
+ }
+
+ for (j=0; j < vars->nprop; j++) {
+ if (cs_gui_strcmp(name, vars->properties_name[j]))
+ array[iii+4]
+ = propce[(vars->propce[j]-1) * (*ncelet) + iel];
+ }
+
+ BFT_FREE(name);
+ }
+
+ } else {
+
+ for (iii=0; iii < nvar_prop4; iii++)
+ array[iii] = 0.0;
+ }
+
+ /* Send to other processors if parallel */
+#if defined(HAVE_MPI)
+ if (cs_glob_rank_id >= 0) {
+ MPI_Bcast(array,
+ nvar_prop4,
+ CS_MPI_REAL,
+ irangv,
+ cs_glob_mpi_comm);
+ }
+#endif
+
+ if (cs_glob_rank_id <= 0) {
+ for (iii=0; iii < nvar_prop4; iii++)
+ fprintf(file, "%12.5e ", array[iii]);
+ fprintf(file, "\n");
+ }
+ }
+ }
+
+ if (cs_glob_rank_id <= 0) fclose(file);
+
+ BFT_FREE(array);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Free memory: clean global private variables and libxml2 variables
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE MEMUI1
+ * *****************
+ *
+ * INTEGER NCHARB --> number of coal
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (memui1, MEMUI1) (const int *const ncharb)
+{
+ int i;
+
+ cs_gui_boundary_conditions_free_memory(ncharb);
+
+ /* clean memory for global private structure vars */
+
+ for (i=0; i < cs_glob_var->nvar; i++)
+ {
+ BFT_FREE(cs_glob_var->type[i]);
+ BFT_FREE(cs_glob_var->head[i]);
+ BFT_FREE(cs_glob_var->name[i]);
+ }
+
+ for (i=0; i < cs_glob_var->nscaus + cs_glob_var->nscapp; i++)
+ BFT_FREE(cs_glob_var->label[i]);
+
+ for (i=0; i < cs_glob_var->nprop; i++)
+ BFT_FREE(cs_glob_var->properties_name[i]);
+
+ BFT_FREE(cs_glob_var->label);
+ BFT_FREE(cs_glob_var->model);
+ BFT_FREE(cs_glob_var->model_value);
+ BFT_FREE(cs_glob_var->rtp);
+ BFT_FREE(cs_glob_var->name);
+ BFT_FREE(cs_glob_var->type);
+ BFT_FREE(cs_glob_var->head);
+ BFT_FREE(cs_glob_var->properties_name);
+ BFT_FREE(cs_glob_var->properties_ipp);
+ BFT_FREE(cs_glob_var->propce);
+ BFT_FREE(cs_glob_var);
+
+
+ for (i = 0; i < cs_glob_label->_cs_gui_max_vars; i++)
+ BFT_FREE(cs_glob_label->_cs_gui_var_name[i]);
+
+ BFT_FREE(cs_glob_label->_cs_gui_var_name);
+ BFT_FREE(cs_glob_label);
+
+ /* clean memory for xml document */
+
+#if defined(HAVE_LIBXML2)
+ if (xpathCtx != NULL) xmlXPathFreeContext(xpathCtx);
+ if (node != NULL) xmlFreeNode(node);
+#endif
+
+ /* Shutdown libxml */
+
+#if defined(HAVE_LIBXML2)
+ xmlCleanupParser();
+ xmlMemoryDump();
+#endif
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui_boundary_conditions.c b/src/base/cs_gui_boundary_conditions.c
new file mode 100644
index 0000000..23c046b
--- /dev/null
+++ b/src/base/cs_gui_boundary_conditions.c
@@ -0,0 +1,1973 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: boundary conditions
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include "fvm_selector.h"
+
+/*----------------------------------------------------------------------------
+ * MEI library headers
+ *----------------------------------------------------------------------------*/
+
+#ifdef HAVE_MEI
+#include "mei_evaluate.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui_util.h"
+#include "cs_gui_variables.h"
+#include "cs_mesh.h"
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui_boundary_conditions.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* debugging switch */
+#define _XML_DEBUG_ 0
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Pointer on the main boundaries structure */
+
+cs_boundary_t *boundaries = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the choice for the scalar of boundary condition type
+ *
+ * parameters:
+ * nature --> nature of boundary condition (inlet, wall, symmetry ..)
+ * label --> label of boundary condition
+ * var_sca --> name of variable(velocity_pressure, turbulence ...)
+ *----------------------------------------------------------------------------*/
+
+static char*
+_boundary_choice(const char *const nature,
+ const char *const label,
+ const char *const var_sca,
+ const char *const choice)
+{
+ char *path = NULL;
+ char *c = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", nature);
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, var_sca);
+ cs_xpath_add_attribute(&path, choice);
+
+ c = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return c;
+}
+
+/*-----------------------------------------------------------------------------
+ * Value of velocity for sliding wall.
+ *
+ * parameters:
+ * label --> label of wall boundary condition
+ * izone --> number of zone
+ * ivar --> number of variable
+ *----------------------------------------------------------------------------*/
+
+static void
+_sliding_wall(const char *const label,
+ const int izone,
+ const int ivar)
+{
+ char *path = NULL;
+ double result = 0.0;
+
+ cs_var_t *vars = cs_glob_var;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "boundary_conditions");
+ cs_xpath_add_element(&path, "wall");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, "velocity_pressure");
+ cs_xpath_add_test_attribute(&path, "choice", "on");
+ cs_xpath_add_element(&path, "dirichlet");
+ cs_xpath_add_test_attribute(&path, "name", vars->name[ivar]);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ {
+ boundaries->type_code[vars->rtp[ivar]][izone] = DIRICHLET;
+ boundaries->values[vars->rtp[ivar]][izone].val1 = result;
+ }
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Value of roughness for wall
+ *
+ * parameters:
+ * label --> label of boundary condition
+ * izone --> number of zone
+ *----------------------------------------------------------------------------*/
+
+static void
+_wall_roughness(const char *const label,
+ const int izone)
+{
+ char *path = NULL;
+ double result = 0.0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "wall");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_elements(&path, 2, "velocity_pressure", "roughness");
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ boundaries->rough[izone] = result;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get value of data for inlet velocity.
+ *
+ * parameters:
+ * label --> label of the inlet
+ * tag --> name of researched data
+ * data <-- value associated to the data
+ *----------------------------------------------------------------------------*/
+
+static void
+_inlet_data(const char *const label,
+ const char *const tag,
+ double *data)
+{
+ char *path = NULL;
+ double result = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "inlet");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_elements(&path, 2, "velocity_pressure", tag);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ *data = result;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get status of data for inlet or outlet information.
+ *
+ * parameters:
+ * nature --> nature of the boundary
+ * label --> label of the inlet or the outlet
+ * tag --> name of researched data
+ * data <-- value associated to the data
+ *----------------------------------------------------------------------------*/
+
+static void
+_boundary_status(const char *const nature,
+ const char *const label,
+ const char *const tag,
+ int *data)
+{
+ char *path = NULL;
+ int result = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", nature);
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_elements(&path, 2, "velocity_pressure", tag);
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result))
+ *data = result;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Formula inlet velocity.
+ *
+ * parameters:
+ * label --> label of the inlet
+ *----------------------------------------------------------------------------*/
+
+static char*
+_inlet_formula(const char *const label,
+ const char *const choice)
+{
+ char *path = NULL;
+ char *form = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "inlet");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_elements(&path, 2, "velocity_pressure", choice);
+ cs_xpath_add_function_text(&path);
+
+ form = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+ return form;
+}
+
+/*-----------------------------------------------------------------------------
+ * Values for turbulence variable for the current inlet.
+ *
+ * parameters:
+ * choice --> type of choice to calculate turbulence
+ * izone --> number of zone
+ *----------------------------------------------------------------------------*/
+
+static void
+_inlet_turbulence(const char *const choice,
+ const int izone)
+{
+ char *path1 = NULL;
+ char *path2 = NULL;
+ double result;
+
+ if (cs_gui_strcmp(choice, "hydraulic_diameter"))
+ {
+ boundaries->icalke[izone] = 1 ;
+ }
+ else if(cs_gui_strcmp(choice, "turbulent_intensity"))
+ {
+ boundaries->icalke[izone] = 2 ;
+ }
+ else
+ return;
+
+ path1 = cs_xpath_init_path();
+ cs_xpath_add_elements(&path1, 2, "boundary_conditions", "inlet");
+ cs_xpath_add_test_attribute(&path1, "label", boundaries->label[izone]);
+ cs_xpath_add_element(&path1, "turbulence");
+
+ BFT_MALLOC(path2, strlen(path1) + 1, char);
+ strcpy(path2, path1);
+
+ cs_xpath_add_element(&path1, "hydraulic_diameter");
+ cs_xpath_add_function_text(&path1);
+
+ if (cs_gui_get_double(path1, &result))
+ boundaries->dh[izone] = result;
+
+ BFT_FREE(path1);
+
+ if(cs_gui_strcmp(choice, "turbulent_intensity"))
+ {
+ cs_xpath_add_element(&path2, "turbulent_intensity");
+ cs_xpath_add_function_text(&path2);
+
+ if (cs_gui_get_double(path2, &result))
+ boundaries->xintur[izone] = result * 0.01;
+ }
+
+ BFT_FREE(path2);
+
+}
+
+/*-----------------------------------------------------------------------------
+ * get scalar's values
+ *
+ * parameters:
+ * nature --> nature of boundary condition
+ * izone --> number of zone
+ * nsca --> number of user scalar
+ *----------------------------------------------------------------------------*/
+
+static void
+_boundary_scalar(const char *const nature,
+ const int izone,
+ const int nsca)
+{
+ int numvar;
+ char *path = NULL;
+ char *path_commun = NULL;
+ char *path2 = NULL;
+ char *choice = NULL;
+ double result;
+
+ cs_var_t *vars = cs_glob_var;
+
+ numvar = vars->nvar - vars->nscaus - vars->nscapp;
+ numvar = numvar + nsca;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", nature);
+ cs_xpath_add_test_attribute(&path, "label", boundaries->label[izone]);
+ cs_xpath_add_element(&path, "scalar");
+ cs_xpath_add_test_attribute(&path, "label", vars->label[nsca]);
+
+ BFT_MALLOC(path_commun, strlen(path)+1, char);
+ strcpy(path_commun, path);
+
+ BFT_MALLOC(path2, strlen(path)+1, char);
+ strcpy(path2, path);
+
+ cs_xpath_add_attribute(&path_commun, "choice");
+ choice = cs_gui_get_attribute_value(path_commun);
+
+ if (choice != NULL) {
+
+ if (cs_gui_strcmp(choice, "dirichlet") || cs_gui_strcmp(choice, "exchange_coefficient") || cs_gui_strcmp(choice, "wall_function")) {
+ cs_xpath_add_element(&path, "dirichlet");
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_double(path, &result)) {
+ if (cs_gui_strcmp(choice, "wall_function")) {
+ boundaries->type_code[vars->rtp[numvar]][izone] = WALL_FUNCTION;
+ } else {
+ boundaries->type_code[vars->rtp[numvar]][izone] = DIRICHLET;
+ }
+ boundaries->values[vars->rtp[numvar]][izone].val1 = result;
+ }
+
+ } else if(cs_gui_strcmp(choice, "neumann")) {
+ cs_xpath_add_element(&path, "neumann");
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_double(path, &result)) {
+ boundaries->type_code[vars->rtp[numvar]][izone] = NEUMANN;
+ boundaries->values[vars->rtp[numvar]][izone].val3 = result;
+ }
+ }
+
+ if (cs_gui_strcmp(choice, "exchange_coefficient")) {
+ cs_xpath_add_element(&path2, "exchange_coefficient");
+ cs_xpath_add_function_text(&path2);
+ if (cs_gui_get_double(path2, &result)) {
+ boundaries->type_code[vars->rtp[numvar]][izone] = COEF_ECHANGE;
+ boundaries->values[vars->rtp[numvar]][izone].val2 = result;
+ }
+ }
+
+ BFT_FREE(choice);
+ }
+
+ BFT_FREE(path);
+ BFT_FREE(path2);
+ BFT_FREE(path_commun);
+}
+
+/*-----------------------------------------------------------------------------
+ * Get coal's data for inlet. Check if the current zone is an inlet only
+ * for an oxydant, of for oxydant and coal.
+ *
+ * parameters:
+ * izone --> number of the current zone
+ * ncharb --> number of coals (1 to 3)
+ * nclpch --> number of class for eah coal
+ *----------------------------------------------------------------------------*/
+
+static void
+_inlet_coal(const int izone,
+ const int *const ncharb,
+ const int *const nclpch)
+{
+ int icoal;
+ int iratio;
+ int size = 0;
+ double value;
+ char *path1 = NULL;
+ char *path2 = NULL;
+ char *path3 = NULL;
+ char *path4 = NULL;
+ char *path5 = NULL;
+ char **list_of_coals = NULL;
+ char **list_of_classes = NULL;
+
+ path1 = cs_xpath_init_path();
+ cs_xpath_add_elements(&path1, 2, "boundary_conditions", "inlet");
+ cs_xpath_add_test_attribute(&path1, "label", boundaries->label[izone]);
+ cs_xpath_add_elements(&path1, 2, "velocity_pressure", "coal");
+
+ list_of_coals = cs_gui_get_attribute_values(path1, &size);
+
+ /* if there is no coal, it is an inlet only for oxydant */
+ if (size == 0)
+ {
+ boundaries->ientat[izone] = 1;
+ boundaries->ientcp[izone] = 0;
+ }
+ else
+ {
+ if (size != *ncharb)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid number of coal-> dp_FCP: %i xml: %i\n"), *ncharb, size);
+
+ boundaries->ientat[izone] = 0;
+ boundaries->ientcp[izone] = 1;
+
+ /* loop on number of coals */
+
+ for (icoal = 0; icoal < *ncharb; icoal++)
+ {
+ BFT_MALLOC(path2, strlen(path1) + 1, char);
+ strcpy(path2, path1);
+ //sprintf(coalname, "%.4s%2.2i", "coal", icharb+1);
+ cs_xpath_add_test_attribute(&path2, "name", list_of_coals[icoal]);
+
+ BFT_MALLOC(path3, strlen(path2) + 1, char);
+ strcpy(path3, path2);
+
+ BFT_MALLOC(path4, strlen(path2) + 1, char);
+ strcpy(path4, path2);
+
+ /* mass flow rate of coal */
+
+ cs_xpath_add_element(&path3, "flow1");
+ cs_xpath_add_function_text(&path3);
+ if (cs_gui_get_double(path3, &value))
+ boundaries->qimpcp[izone][icoal] = value;
+
+ /* temperature of coal */
+
+ cs_xpath_add_element(&path4, "temperature");
+ cs_xpath_add_function_text(&path4);
+ if (cs_gui_get_double(path4, &value))
+ boundaries->timpcp[izone][icoal] = value;
+
+ /* loop on number of class by coal for ratio */
+
+ cs_xpath_add_element(&path2, "ratio");
+ list_of_classes = cs_gui_get_attribute_values(path2, &size);
+
+ for (iratio=0; iratio < nclpch[icoal]; iratio++)
+ {
+ BFT_MALLOC(path5, strlen(path2) + 1, char);
+ strcpy(path5, path2);
+
+ //sprintf(classname, "%.5s%2.2i", "class", iratio+1);
+ cs_xpath_add_test_attribute(&path5, "name", list_of_classes[iratio]);
+ cs_xpath_add_function_text(&path5);
+
+ if (cs_gui_get_double(path5, &value))
+ boundaries->distch[izone][icoal][icoal] = value;
+
+ BFT_FREE(path5);
+ }
+
+ for (iratio=0; iratio < nclpch[icoal]; iratio++)
+ BFT_FREE(list_of_classes[icoal]);
+ BFT_FREE(list_of_classes);
+
+ BFT_FREE(path2);
+ BFT_FREE(path3);
+ BFT_FREE(path4);
+ }
+
+ for (icoal = 0; icoal < *ncharb; icoal++)
+ BFT_FREE(list_of_coals[icoal]);
+ BFT_FREE(list_of_coals);
+
+ BFT_FREE(path1);
+ }
+}
+
+/*-----------------------------------------------------------------------------
+ * Initialize mei tree and check for symbols existence
+ *
+ * parameters:
+ * formula --> mei formula
+ * symbols --> array of symbol to check
+ * symbol_size --> number of symbol in symbols
+ *----------------------------------------------------------------------------*/
+
+#ifdef HAVE_MEI
+static mei_tree_t *_boundary_init_mei_tree(const char *formula,
+ const char *symbols[],
+ const int symbol_size)
+{
+ int i = 0;
+
+ /* return an empty interpreter */
+ mei_tree_t *tree = mei_tree_new(formula);
+
+ /* add commun variables */
+ mei_tree_insert(tree, "dt", 0.0);
+ mei_tree_insert(tree, "t", 0.0);
+ mei_tree_insert(tree, "iter", 0.0);
+ mei_tree_insert(tree, "x", 0.0);
+ mei_tree_insert(tree, "y", 0.0);
+ mei_tree_insert(tree, "z", 0.0);
+
+ /* try to build the interpreter */
+ if (mei_tree_builder(tree))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not interprete expression: %s\n"), tree->string);
+
+ /* check for symbols */
+ for( i = 0; i < symbol_size; ++i )
+ if (mei_tree_find_symbol(tree, symbols[i]))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not find the required symbol: %s\n"), symbols[i]);
+
+ return tree;
+}
+#endif // HAVE_MEI
+
+/*----------------------------------------------------------------------------
+ * Boundary conditions treatment: global structure initialization
+ *
+ * parameters:
+ * nfabor --> number of boundary faces
+ * nozppm --> max number of boundary conditions zone
+ * ncharb --> number of simulated coals
+ * nclpch --> number of simulated class per coals
+ * izfppp --> zone number for each boundary face
+ *----------------------------------------------------------------------------*/
+
+static void
+_init_boundaries(const int *const nfabor,
+ const int *const nozppm,
+ const int *const ncharb,
+ const int *const nclpch,
+ int *const izfppp)
+{
+ int faces = 0;
+ int zones = 0;
+ int ifac, izone, ith_zone, zone_nbr;
+ int ifbr, i;
+ int ivar, isca, icharb;
+ char *choice = NULL;
+ char *choice_v = NULL;
+ char *choice_d = NULL;
+ char *nature = NULL;
+ char *label = NULL;
+ int *faces_list = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+ assert(boundaries == NULL);
+
+ zones = cs_gui_boundary_zones_number();
+
+ BFT_MALLOC(boundaries, 1, cs_boundary_t);
+ BFT_MALLOC(boundaries->label, zones, char* );
+ BFT_MALLOC(boundaries->nature, zones, char* );
+ BFT_MALLOC(boundaries->type_code, vars->nvar, int* );
+ BFT_MALLOC(boundaries->values, vars->nvar, cs_val_t* );
+ BFT_MALLOC(boundaries->iqimp, zones, int );
+ BFT_MALLOC(boundaries->qimp, zones, double );
+ BFT_MALLOC(boundaries->icalke, zones, int );
+ BFT_MALLOC(boundaries->dh, zones, double );
+ BFT_MALLOC(boundaries->xintur, zones, double );
+ BFT_MALLOC(boundaries->rough, zones, double );
+ BFT_MALLOC(boundaries->norm, zones, double );
+ BFT_MALLOC(boundaries->dirx, zones, double );
+ BFT_MALLOC(boundaries->diry, zones, double );
+ BFT_MALLOC(boundaries->dirz, zones, double );
+
+#if defined(HAVE_MEI)
+ BFT_MALLOC(boundaries->velocity, zones, mei_tree_t* );
+ BFT_MALLOC(boundaries->direction, zones, mei_tree_t* );
+#endif
+
+ if (cs_gui_strcmp(vars->model, "pulverized_coal"))
+ {
+ BFT_MALLOC(boundaries->ientat, zones, int );
+ BFT_MALLOC(boundaries->inmoxy, zones, double );
+ BFT_MALLOC(boundaries->timpat, zones, double );
+ BFT_MALLOC(boundaries->ientcp, zones, int );
+ BFT_MALLOC(boundaries->qimpcp, zones, double* );
+ BFT_MALLOC(boundaries->timpcp, zones, double* );
+ BFT_MALLOC(boundaries->distch, zones, double** );
+
+ for (izone=0; izone < zones; izone++)
+ {
+ BFT_MALLOC(boundaries->qimpcp[izone], *ncharb, double );
+ BFT_MALLOC(boundaries->timpcp[izone], *ncharb, double );
+ BFT_MALLOC(boundaries->distch[izone], *ncharb, double*);
+
+ for (icharb = 0; icharb < *ncharb; icharb++)
+ BFT_MALLOC(boundaries->distch[izone][icharb],
+ nclpch[icharb],
+ double);
+ }
+ }
+ else
+ {
+ boundaries->ientat = NULL;
+ boundaries->timpat = NULL;
+ boundaries->ientcp = NULL;
+ boundaries->qimpcp = NULL;
+ boundaries->timpcp = NULL;
+ boundaries->distch = NULL;
+ }
+
+ if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ {
+ BFT_MALLOC(boundaries->meteo, zones, cs_meteo_t);
+ }
+ else
+ {
+ boundaries->meteo = NULL;
+ }
+
+ for (ivar = 0; ivar < vars->nvar; ivar++)
+ {
+ i = vars->rtp[ivar];
+ BFT_MALLOC(boundaries->type_code[i], zones, int);
+ BFT_MALLOC(boundaries->values[i], zones, cs_val_t);
+ }
+
+ for (izone = 0; izone < zones; izone++)
+ {
+ boundaries->iqimp[izone] = 0;
+ boundaries->qimp[izone] = 0;
+ boundaries->norm[izone] = 0;
+ boundaries->icalke[izone] = 0;
+ boundaries->dh[izone] = 0;
+ boundaries->xintur[izone] = 0;
+ boundaries->rough[izone] = -999;
+#if defined(HAVE_MEI)
+ boundaries->velocity[izone] = NULL;
+ boundaries->direction[izone] = NULL;
+#endif
+
+ if (cs_gui_strcmp(vars->model, "pulverized_coal"))
+ {
+ boundaries->ientat[izone] = 0;
+ boundaries->inmoxy[izone] = 1;
+ boundaries->ientcp[izone] = 0;
+ boundaries->timpat[izone] = 0;
+
+ for (icharb = 0; icharb < *ncharb; icharb++)
+ {
+ boundaries->qimpcp[izone][icharb] = 0;
+ boundaries->timpcp[izone][icharb] = 0;
+
+ for (ivar = 0; ivar < nclpch[icharb]; ivar++)
+ boundaries->distch[izone][icharb][ivar] = 0;
+ }
+ }
+ else if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ {
+ boundaries->meteo[izone].read_data = 0;
+ boundaries->meteo[izone].automatic = 0;
+ }
+ }
+
+ /* Initialization of boundary->type_code and boundary->values */
+
+ for (ivar = 0; ivar < vars->nvar; ivar++)
+ {
+ i = vars->rtp[ivar];
+ for (izone = 0; izone < zones; izone++)
+ {
+ boundaries->type_code[i][izone] = -1;
+ boundaries->values[i][izone].val1 = 1.e30;
+ boundaries->values[i][izone].val2 = 1.e30;
+ boundaries->values[i][izone].val3 = 0.;
+ }
+ }
+
+ for (ifac = 0; ifac < *nfabor; ifac++)
+ izfppp[ifac] = 0;
+
+ /* filling of the "boundaries" structure */
+
+ for (izone = 0; izone < zones; izone++)
+ {
+ /* nature, label of the ith initialization zone */
+
+ ith_zone = izone + 1;
+ nature = cs_gui_boundary_zone_nature(ith_zone);
+ label = cs_gui_boundary_zone_label(ith_zone);
+
+ BFT_MALLOC(boundaries->label[izone], strlen(label)+1, char);
+ strcpy(boundaries->label[izone], label);
+
+ BFT_MALLOC(boundaries->nature[izone], strlen(nature)+1, char);
+ strcpy(boundaries->nature[izone], nature);
+
+ if (cs_gui_strcmp(nature, "inlet"))
+ {
+ /* Inlet: VELOCITY */
+ choice_v = _boundary_choice("inlet", label, "velocity_pressure", "choice");
+ choice_d = _boundary_choice("inlet", label, "velocity_pressure", "direction");
+
+ if (cs_gui_strcmp(choice_v, "norm"))
+ {
+ _inlet_data(label, "norm", &boundaries->norm[izone]);
+ }
+ else if (cs_gui_strcmp(choice_v, "flow1"))
+ {
+ _inlet_data(label, "flow1", &boundaries->qimp[izone]);
+ boundaries->iqimp[izone] = 1;
+ }
+ else if (cs_gui_strcmp(choice_v, "flow2"))
+ {
+ _inlet_data(label, "flow2", &boundaries->qimp[izone]);
+ boundaries->iqimp[izone] = 2;
+ }
+#if defined(HAVE_MEI)
+ else if (cs_gui_strcmp(choice_v, "norm_formula"))
+ {
+ const char *sym[] = {"u_norm"};
+ boundaries->velocity[izone] = _boundary_init_mei_tree(_inlet_formula(label, choice_v), sym, 1);
+ }
+ else if (cs_gui_strcmp(choice_v, "flow1_formula"))
+ {
+ const char *sym[] = {"q_m"};
+ boundaries->velocity[izone] = _boundary_init_mei_tree(_inlet_formula(label, choice_v), sym, 1);
+ boundaries->iqimp[izone] = 1;
+ }
+ else if (cs_gui_strcmp(choice_v, "flow2_formula"))
+ {
+ const char *sym[] = {"q_v"};
+ boundaries->velocity[izone] = _boundary_init_mei_tree(_inlet_formula(label, choice_v), sym, 1);
+ boundaries->iqimp[izone] = 2;
+ }
+#endif
+ if (cs_gui_strcmp(choice_d, "coordinates"))
+ {
+ _inlet_data(label, "direction_x", &boundaries->dirx[izone]);
+ _inlet_data(label, "direction_y", &boundaries->diry[izone]);
+ _inlet_data(label, "direction_z", &boundaries->dirz[izone]);
+ }
+#if defined(HAVE_MEI)
+ else if (cs_gui_strcmp(choice_d, "formula"))
+ {
+ const char *sym[] = {"dir_x", "dir_y", "dir_z"};
+ boundaries->direction[izone] =
+ _boundary_init_mei_tree(_inlet_formula(label, "direction_formula"), sym, 3);
+ }
+#endif
+ BFT_FREE(choice_v);
+ BFT_FREE(choice_d);
+
+ /* Inlet: data for COAL */
+ if (cs_gui_strcmp(vars->model, "pulverized_coal"))
+ {
+ _inlet_data(label, "temperature", &boundaries->timpat[izone]);
+ _inlet_data(label, "oxydant", &boundaries->inmoxy[izone]);
+ _inlet_coal(izone, ncharb, nclpch);
+ }
+
+ /* Inlet: data for ATMOSPHERIC FLOWS */
+ if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ {
+ _boundary_status("inlet", label, "meteo_data", &boundaries->meteo[izone].read_data);
+ _boundary_status("inlet", label, "meteo_automatic", &boundaries->meteo[izone].automatic);
+ }
+
+ /* Inlet: TURBULENCE */
+ choice = _boundary_choice("inlet", label, "turbulence", "choice");
+ _inlet_turbulence(choice, izone);
+ BFT_FREE(choice);
+
+ /* Inlet: USER SCALARS */
+ for (isca = 0; isca < vars->nscaus; isca++)
+ _boundary_scalar("inlet", izone, isca);
+
+ }
+ else if (cs_gui_strcmp(nature, "wall"))
+ {
+ /* Wall: VELOCITY */
+ choice = _boundary_choice("wall", label, "velocity_pressure", "choice");
+
+ if (cs_gui_strcmp(choice, "on"))
+ {
+ for (ivar = 1; ivar < 4; ivar++)
+ _sliding_wall(label, izone, ivar);
+ }
+ BFT_FREE(choice);
+
+ /* Wall: ROUGH */
+ _wall_roughness(label, izone);
+
+ /* Wall: USER SCALARS */
+ for (isca = 0; isca < vars->nscaus; isca++)
+ _boundary_scalar("wall", izone, isca);
+
+ }
+ else if (cs_gui_strcmp(nature, "outlet"))
+ {
+ /* Outlet: data for ATMOSPHERIC FLOWS */
+ if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ {
+ _boundary_status("outlet", label, "meteo_data", &boundaries->meteo[izone].read_data);
+ _boundary_status("outlet", label, "meteo_automatic", &boundaries->meteo[izone].automatic);
+ }
+
+ /* Outlet: USER SCALARS */
+ for (isca = 0; isca < vars->nscaus; isca++)
+ _boundary_scalar("outlet", izone, isca);
+
+ } /* if (cs_gui_strcmp(nature, "outlet")) */
+ BFT_FREE(nature);
+ BFT_FREE(label);
+
+ } /* for izones */
+
+ for (izone = 0 ; izone < zones ; izone++)
+ {
+ zone_nbr = cs_gui_boundary_zone_number(izone + 1);
+ faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor,
+ *nozppm,
+ &faces);
+
+ /* check if faces are already marked with a zone number */
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+
+ if (izfppp[ifbr] != 0)
+ {
+ bft_error(__FILE__, __LINE__, 0,
+ _("@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"
+ "@ @@ WARNING: BOUNDARY CONDITIONS ERROR \n"
+ "@ ******* \n"
+ "@ \n"
+ "@ In the zone %s has a face already marked \n"
+ "@ with a zone number. \n"
+ "@ \n"
+ "@ new zone number: %i \n"
+ "@ previous zone number: %i \n"
+ "@ \n"
+ "@ It seems that zones definitions are overlapping. \n"
+ "@ \n"
+ "@ The calculation will stop. \n"
+ "@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"),
+ boundaries->label[izone], zone_nbr, izfppp[ifbr]);
+
+ }
+ else
+ {
+ izfppp[ifbr] = zone_nbr;
+ }
+ } /* for ifac */
+ BFT_FREE(faces_list);
+ } /* for izone */
+}
+
+/*============================================================================
+ * C API public functions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return number of boundary regions definition
+ *----------------------------------------------------------------------------*/
+
+int cs_gui_boundary_zones_number(void)
+{
+ int zones = 0;
+ char *path = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "boundary_conditions");
+ cs_xpath_add_element(&path, "boundary");
+
+ zones = cs_gui_get_nb_element(path);
+
+ BFT_FREE(path);
+
+ return zones;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the nature of boundary condition for the given zone
+ *----------------------------------------------------------------------------*/
+
+char *cs_gui_boundary_zone_nature(const int ith_zone)
+{
+ char *path = NULL;
+ char *nature = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "boundary_conditions");
+ cs_xpath_add_element_num(&path, "boundary", ith_zone);
+ cs_xpath_add_attribute(&path, "nature");
+
+ nature = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return nature;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Return the label of boundary condition for the given zone
+ *----------------------------------------------------------------------------*/
+
+char *cs_gui_boundary_zone_label(const int ith_zone)
+{
+ char *path = NULL;
+ char *label = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "boundary_conditions");
+ cs_xpath_add_element_num(&path, "boundary", ith_zone);
+ cs_xpath_add_attribute(&path, "label");
+
+ label = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return label;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Return the zone number of boundary condition for the given zone
+ *----------------------------------------------------------------------------*/
+
+int cs_gui_boundary_zone_number(const int ith_zone)
+{
+ char *path = NULL;
+ char *czone = NULL;
+ int zone;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "boundary_conditions");
+ cs_xpath_add_element_num(&path, "boundary", ith_zone);
+ cs_xpath_add_attribute(&path, "name");
+
+ czone = cs_gui_get_attribute_value(path);
+ zone = atoi(czone);
+
+ BFT_FREE(path);
+ BFT_FREE(czone);
+
+ return zone;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the description of a boundary zone
+ *
+ * parameters:
+ * label --> label of boundary zone
+ *----------------------------------------------------------------------------*/
+
+char *cs_gui_boundary_zone_localization(const char *const label)
+{
+ char *path = NULL;
+ char *localization = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "boundary");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_function_text(&path);
+
+ localization = cs_gui_get_text_value(path);
+
+ BFT_FREE(path);
+
+ return localization;
+}
+
+/*-----------------------------------------------------------------------------
+ * Helper to get the face list for the izone
+ *
+ * parameters:
+ * izone --> zone index
+ * label --> boundary label
+ * nfabor --> number of boundary faces
+ * nozppm --> max number of boundary zone for preefined physics
+ * faces <-- number of face
+ *----------------------------------------------------------------------------*/
+
+int*
+cs_gui_get_faces_list(const int izone,
+ const char *label,
+ const int nfabor,
+ const int nozppm,
+ int *faces )
+{
+ int c_id = 0;
+ int *faces_list = NULL;
+
+ int boundary_zones = cs_gui_boundary_zone_number(izone + 1);
+
+ if (nozppm && boundary_zones > nozppm)
+ bft_error(__FILE__, __LINE__, 0,
+ _("zone's label number %i is greater than %i,"
+ " the maximum allowed \n"), boundary_zones , nozppm);
+
+ char *description = cs_gui_boundary_zone_localization(label);
+
+ /* list of faces building */
+ BFT_MALLOC(faces_list, nfabor, int);
+
+ c_id = fvm_selector_get_list(cs_glob_mesh->select_b_faces,
+ description,
+ faces,
+ faces_list);
+
+ if (fvm_selector_n_missing(cs_glob_mesh->select_b_faces, c_id) > 0)
+ {
+ const char *missing
+ = fvm_selector_get_missing(cs_glob_mesh->select_b_faces, c_id, 0);
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("The group or attribute \"%s\" in the selection\n"
+ "criteria:\n" "\"%s\"\n"
+ " does not correspond to any boundary face.\n"),
+ missing, description);
+ }
+ BFT_FREE(description);
+ return faces_list;
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Boundary conditions treatment
+ *
+ * Remember: rdoccl[k][j][i] = rcodcl[ k * dim1 *dim2 + j *dim1 + i]
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UICLIM
+ * *****************
+ *
+ * INTEGER NTCABS --> current iteration number
+ * INTEGER NFABOR --> number of boundary faces
+ * INTEGER NOZPPM --> max number of boundary conditions zone
+ * INTEGER NCHARM --> maximal number of coals
+ * INTEGER NCHARB --> number of simulated coals
+ * INTEGER NCLPCH --> number of simulated class per coals
+ * INTEGER IINDEF --> type of boundary: not defined
+ * INTEGER IENTRE --> type of boundary: inlet
+ * INTEGER IPAROI --> type of boundary: smooth wall
+ * INTEGER IPARUG --> type of boundary: rough wall
+ * INTEGER ISYMET --> type of boundary: symetry
+ * INTEGER ISOLIB --> type of boundary: outlet
+ * INTEGER IQIMP --> 1 if flow rate is applied
+ * INTEGER ICALKE --> 1 for automatic turbulent boundary conditions
+ * INTEGER IENTAT --> 1 for air temperature boundary conditions (coal)
+ * INTEGER IENTCP --> 1 for coal temperature boundary conditions (coal)
+ * integer inmoxy --> coal: number of oxydant for the current inlet
+ * integer iprofm --> atmospheric flows: on/off for profile from data
+ * INTEGER ITYPFB --> type of boundary for each face
+ * INTEGER IZFPPP --> zone number for each boundary face
+ * INTEGER ICODCL --> boundary conditions array type
+ * DOUBLE PRECISION DTREF --> time step
+ * DOUBLE PRECISION TTCABS --> current time
+ * DOUBLE PRECISION SURFBO --> boundary faces surface
+ * DOUBLE PRECISION CGDFBO --> boundary faces center of gravity
+ * DOUBLE PRECISION QIMP --> inlet flow rate
+ * DOUBLE PRECISION QIMPAT --> inlet air flow rate (coal)
+ * DOUBLE PRECISION QIMPCP --> inlet coal flow rate (coal)
+ * DOUBLE PRECISION DH --> hydraulic diameter
+ * DOUBLE PRECISION XINTUR --> turbulent intensity
+ * DOUBLE PRECISION TIMPAT --> air temperature boundary conditions (coal)
+ * DOUBLE PRECISION TIMPCP --> inlet coal temperature (coal)
+ * DOUBLE PRECISION DISTCH --> ratio for each coal
+ * DOUBLE PRECISION RCODCL --> boundary conditions array value
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiclim, UICLIM)(const int *const ntcabs,
+ const int *const nfabor,
+ const int *const nozppm,
+ const int *const ncharm,
+ const int *const ncharb,
+ const int *const nclpch,
+ const int *const iindef,
+ const int *const ientre,
+ const int *const iparoi,
+ const int *const iparug,
+ const int *const isymet,
+ const int *const isolib,
+ int *const iqimp,
+ int *const icalke,
+ int *const ientat,
+ int *const ientcp,
+ int *const inmoxy,
+ int *const iprofm,
+ int *const itypfb,
+ int *const izfppp,
+ int *const icodcl,
+ double *const dtref,
+ double *const ttcabs,
+ double *const surfbo,
+ double *const cdgfbo,
+ double *const qimp,
+ double *const qimpat,
+ double *const qimpcp,
+ double *const dh,
+ double *const xintur,
+ double *const timpat,
+ double *const timpcp,
+ double *const distch,
+ double *const rcodcl)
+{
+ int iphas = 0;
+ int faces = 0;
+ int zones = 0;
+ int izone, ith_zone, zone_nbr;
+ int ifac, ifbr;
+ int i, k, ivar, icharb, iwall;
+ double norm = 0.;
+ double X[3];
+ int *faces_list = NULL;
+ char *choice_v = NULL;
+ char *choice_d = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ zones = cs_gui_boundary_zones_number();
+
+ /* First iteration only: memory allocation */
+
+ if (boundaries == NULL)
+ _init_boundaries(nfabor, nozppm, ncharb, nclpch, izfppp);
+
+ /* At each time-step, loop on boundary faces:
+ One sets itypfb, rcodcl and icodcl thanks to the arrays
+ of the structures "conditions.limites" defined
+ in the first part ofthe function */
+
+ for (izone=0 ; izone < zones ; izone++)
+ {
+ ith_zone = izone + 1;
+ zone_nbr = cs_gui_boundary_zone_number(ith_zone);
+
+ faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor, *nozppm, &faces);
+
+ if (cs_gui_strcmp(boundaries->nature[izone], "inlet"))
+ {
+ choice_v = _boundary_choice("inlet", boundaries->label[izone], "velocity_pressure", "choice");
+ choice_d = _boundary_choice("inlet", boundaries->label[izone], "velocity_pressure", "direction");
+
+ /* Update the depending zone's arrays (iqimp, dh, xintur, icalke, qimp,...)
+ because they are initialized at each time step
+ in PRECLI and PPPRCL routines */
+
+ /* data by zone */
+
+ iqimp[zone_nbr-1] = boundaries->iqimp[izone];
+ dh[zone_nbr-1] = boundaries->dh[izone];
+ xintur[zone_nbr-1] = boundaries->xintur[izone];
+ icalke[zone_nbr-1] = boundaries->icalke[izone];
+
+ if (cs_gui_strcmp(vars->model, "pulverized_coal"))
+ {
+ ientat[zone_nbr-1] = boundaries->ientat[izone];
+ inmoxy[zone_nbr-1] = (int) boundaries->inmoxy[izone];
+ ientcp[zone_nbr-1] = boundaries->ientcp[izone];
+ qimpat[zone_nbr-1] = boundaries->qimp[izone];
+ timpat[zone_nbr-1] = boundaries->timpat[izone];
+
+ for (icharb = 0; icharb < *ncharb; icharb++)
+ {
+ qimpcp[icharb *(*nozppm)+zone_nbr-1] = boundaries->qimpcp[izone][icharb];
+ timpcp[icharb *(*nozppm)+zone_nbr-1] = boundaries->timpcp[izone][icharb];
+
+ for (k = 0; k < nclpch[icharb]; k++)
+ distch[k * (*nozppm) * (*ncharm) +icharb * (*nozppm) +zone_nbr-1]
+ = boundaries->distch[izone][icharb][k];
+ }
+ }
+ else
+ {
+#ifdef HAVE_MEI
+ if (cs_gui_strcmp(choice_v, "flow1_formula") || cs_gui_strcmp(choice_v, "flow2_formula") )
+ {
+ mei_tree_insert(boundaries->velocity[izone], "t", *ttcabs);
+ mei_tree_insert(boundaries->velocity[izone], "dt", *dtref);
+ mei_tree_insert(boundaries->velocity[izone], "iter", *ntcabs);
+ mei_evaluate(boundaries->velocity[izone]);
+
+ if (cs_gui_strcmp(choice_v, "flow1_formula"))
+ qimp[zone_nbr-1] = mei_tree_lookup(boundaries->velocity[izone], "q_m");
+ else if (cs_gui_strcmp(choice_v, "flow2_formula"))
+ qimp[zone_nbr-1] = mei_tree_lookup(boundaries->velocity[izone], "q_v");
+ }
+ else
+ {
+#endif
+ qimp[zone_nbr-1] = boundaries->qimp[izone];
+#ifdef HAVE_MEI
+ }
+#endif
+ }
+
+ /* data by boundary faces */
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]- 1;
+
+ /* zone number and nature of boundary */
+ izfppp[ifbr] = zone_nbr;
+ itypfb[iphas * (*nfabor) + ifbr] = *ientre;
+
+ /* dirichlet for turbulent variables and scalars */
+
+ for (i = 0; i < vars->nvar; i++)
+ rcodcl[vars->rtp[i] * (*nfabor) + ifbr] = boundaries->values[vars->rtp[i]][izone].val1;
+ }
+
+ if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ {
+ iprofm[zone_nbr-1] = boundaries->meteo[izone].read_data;
+ if (boundaries->meteo[izone].automatic)
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]- 1;
+ itypfb[iphas * (*nfabor) + ifbr] = 0;
+ }
+ }
+ }
+
+ /* dirichlet for velocity */
+
+ if (cs_gui_strcmp(choice_d, "coordinates"))
+ {
+ if (cs_gui_strcmp(choice_v, "norm"))
+ {
+ norm = boundaries->norm[izone] /
+ sqrt( boundaries->dirx[izone] * boundaries->dirx[izone]
+ + boundaries->diry[izone] * boundaries->diry[izone]
+ + boundaries->dirz[izone] * boundaries->dirz[izone]);
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+ rcodcl[vars->rtp[1] * (*nfabor) + ifbr] = boundaries->dirx[izone] * norm;
+ rcodcl[vars->rtp[2] * (*nfabor) + ifbr] = boundaries->diry[izone] * norm;
+ rcodcl[vars->rtp[3] * (*nfabor) + ifbr] = boundaries->dirz[izone] * norm;
+ }
+ }
+ else if (cs_gui_strcmp(choice_v, "flow1") || cs_gui_strcmp(choice_v, "flow2")
+ || cs_gui_strcmp(choice_v, "flow1_formula") || cs_gui_strcmp(choice_v, "flow2_formula"))
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+ rcodcl[vars->rtp[1] * (*nfabor) + ifbr] = boundaries->dirx[izone];
+ rcodcl[vars->rtp[2] * (*nfabor) + ifbr] = boundaries->diry[izone];
+ rcodcl[vars->rtp[3] * (*nfabor) + ifbr] = boundaries->dirz[izone];
+ }
+ }
+#ifdef HAVE_MEI
+ else if (cs_gui_strcmp(choice_v, "norm_formula"))
+ {
+ mei_tree_insert(boundaries->velocity[izone], "t", *ttcabs);
+ mei_tree_insert(boundaries->velocity[izone], "dt", *dtref);
+ mei_tree_insert(boundaries->velocity[izone], "iter", *ntcabs);
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+
+ mei_tree_insert(boundaries->velocity[izone], "x", cdgfbo[3 * ifbr + 0]);
+ mei_tree_insert(boundaries->velocity[izone], "y", cdgfbo[3 * ifbr + 1]);
+ mei_tree_insert(boundaries->velocity[izone], "z", cdgfbo[3 * ifbr + 2]);
+
+ mei_evaluate(boundaries->velocity[izone]);
+
+ norm = mei_tree_lookup(boundaries->velocity[izone], "u_norm") /
+ sqrt( boundaries->dirx[izone] * boundaries->dirx[izone]
+ + boundaries->diry[izone] * boundaries->diry[izone]
+ + boundaries->dirz[izone] * boundaries->dirz[izone]);
+
+ rcodcl[vars->rtp[1] * (*nfabor) + ifbr] = boundaries->dirx[izone] * norm;
+ rcodcl[vars->rtp[2] * (*nfabor) + ifbr] = boundaries->diry[izone] * norm;
+ rcodcl[vars->rtp[3] * (*nfabor) + ifbr] = boundaries->dirz[izone] * norm;
+ }
+ }
+#endif
+ }
+ else if (cs_gui_strcmp(choice_d, "normal"))
+ {
+ if (cs_gui_strcmp(choice_v, "norm"))
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+
+ norm = boundaries->norm[izone] /
+ sqrt( surfbo[3 * ifbr + 0] * surfbo[3 * ifbr + 0]
+ + surfbo[3 * ifbr + 1] * surfbo[3 * ifbr + 1]
+ + surfbo[3 * ifbr + 2] * surfbo[3 * ifbr + 2]);
+
+ for (i = 1; i < 4; i++)
+ rcodcl[vars->rtp[i] * (*nfabor) + ifbr] = -surfbo[3 * ifbr + vars->rtp[i]-1] * norm;
+ }
+ }
+ else if (cs_gui_strcmp(choice_v, "flow1") || cs_gui_strcmp(choice_v, "flow2")
+ || cs_gui_strcmp(choice_v, "flow1_formula") || cs_gui_strcmp(choice_v, "flow2_formula"))
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+ rcodcl[vars->rtp[1] * (*nfabor) + ifbr] = -surfbo[3 * ifbr + vars->rtp[1] -1];
+ rcodcl[vars->rtp[2] * (*nfabor) + ifbr] = -surfbo[3 * ifbr + vars->rtp[2] -1];
+ rcodcl[vars->rtp[3] * (*nfabor) + ifbr] = -surfbo[3 * ifbr + vars->rtp[3] -1];
+ }
+ }
+#ifdef HAVE_MEI
+ else if (cs_gui_strcmp(choice_v, "norm_formula"))
+ {
+ norm = boundaries->norm[izone] /
+ sqrt( boundaries->dirx[izone] * boundaries->dirx[izone]
+ + boundaries->diry[izone] * boundaries->diry[izone]
+ + boundaries->dirz[izone] * boundaries->dirz[izone]);
+
+ mei_tree_insert(boundaries->velocity[izone], "t", *ttcabs);
+ mei_tree_insert(boundaries->velocity[izone], "dt", *dtref);
+ mei_tree_insert(boundaries->velocity[izone], "iter", *ntcabs);
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+
+ mei_tree_insert(boundaries->velocity[izone], "x", cdgfbo[3 * ifbr + 0]);
+ mei_tree_insert(boundaries->velocity[izone], "y", cdgfbo[3 * ifbr + 1]);
+ mei_tree_insert(boundaries->velocity[izone], "z", cdgfbo[3 * ifbr + 2]);
+
+ mei_evaluate(boundaries->velocity[izone]);
+
+ norm = mei_tree_lookup(boundaries->velocity[izone], "u_norm") /
+ sqrt( surfbo[3 * ifbr + 0] * surfbo[3 * ifbr + 0]
+ + surfbo[3 * ifbr + 1] * surfbo[3 * ifbr + 1]
+ + surfbo[3 * ifbr + 2] * surfbo[3 * ifbr + 2]);
+
+ for (i = 1; i < 4; i++)
+ rcodcl[vars->rtp[i] * (*nfabor) + ifbr] = -surfbo[3 * ifbr + vars->rtp[i]-1] * norm;
+ }
+ }
+ }
+ else if (cs_gui_strcmp(choice_d, "formula"))
+ {
+ mei_tree_insert(boundaries->direction[izone], "t", *ttcabs);
+ mei_tree_insert(boundaries->direction[izone], "dt", *dtref);
+ mei_tree_insert(boundaries->direction[izone], "iter", *ntcabs);
+
+ if (cs_gui_strcmp(choice_v, "norm"))
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+
+ mei_tree_insert(boundaries->direction[izone], "x", cdgfbo[3 * ifbr + 0]);
+ mei_tree_insert(boundaries->direction[izone], "y", cdgfbo[3 * ifbr + 1]);
+ mei_tree_insert(boundaries->direction[izone], "z", cdgfbo[3 * ifbr + 2]);
+
+ mei_evaluate(boundaries->direction[izone]);
+
+ X[0] = mei_tree_lookup(boundaries->direction[izone], "dir_x");
+ X[1] = mei_tree_lookup(boundaries->direction[izone], "dir_y");
+ X[2] = mei_tree_lookup(boundaries->direction[izone], "dir_z");
+
+ norm = boundaries->norm[izone] /
+ sqrt( X[0] * X[0] + X[1] * X[1] + X[2] * X[2]);
+
+ for (i = 1; i < 4; i++)
+ rcodcl[vars->rtp[i] * (*nfabor) + ifbr] = X[i-1] * norm;
+ }
+ }
+ else if (cs_gui_strcmp(choice_v, "flow1") || cs_gui_strcmp(choice_v, "flow2")
+ || cs_gui_strcmp(choice_v, "flow1_formula") || cs_gui_strcmp(choice_v, "flow2_formula"))
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+
+ mei_tree_insert(boundaries->direction[izone], "x", cdgfbo[3 * ifbr + 0]);
+ mei_tree_insert(boundaries->direction[izone], "y", cdgfbo[3 * ifbr + 1]);
+ mei_tree_insert(boundaries->direction[izone], "z", cdgfbo[3 * ifbr + 2]);
+
+ mei_evaluate(boundaries->direction[izone]);
+
+ X[0] = mei_tree_lookup(boundaries->direction[izone], "dir_x");
+ X[1] = mei_tree_lookup(boundaries->direction[izone], "dir_y");
+ X[2] = mei_tree_lookup(boundaries->direction[izone], "dir_z");
+
+ rcodcl[vars->rtp[1] * (*nfabor) + ifbr] = X[0];
+ rcodcl[vars->rtp[2] * (*nfabor) + ifbr] = X[1];
+ rcodcl[vars->rtp[3] * (*nfabor) + ifbr] = X[2];
+ }
+ }
+ else if (cs_gui_strcmp(choice_v, "norm_formula"))
+ {
+ mei_tree_insert(boundaries->velocity[izone], "t", *ttcabs);
+ mei_tree_insert(boundaries->velocity[izone], "dt", *dtref);
+ mei_tree_insert(boundaries->velocity[izone], "iter", *ntcabs);
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+
+ mei_tree_insert(boundaries->velocity[izone], "x", cdgfbo[3 * ifbr + 0]);
+ mei_tree_insert(boundaries->velocity[izone], "y", cdgfbo[3 * ifbr + 1]);
+ mei_tree_insert(boundaries->velocity[izone], "z", cdgfbo[3 * ifbr + 2]);
+
+ mei_tree_insert(boundaries->direction[izone], "x", cdgfbo[3 * ifbr + 0]);
+ mei_tree_insert(boundaries->direction[izone], "y", cdgfbo[3 * ifbr + 1]);
+ mei_tree_insert(boundaries->direction[izone], "z", cdgfbo[3 * ifbr + 2]);
+
+ mei_evaluate(boundaries->velocity[izone]);
+ mei_evaluate(boundaries->direction[izone]);
+
+ X[0] = mei_tree_lookup(boundaries->direction[izone], "dir_x");
+ X[1] = mei_tree_lookup(boundaries->direction[izone], "dir_y");
+ X[2] = mei_tree_lookup(boundaries->direction[izone], "dir_z");
+
+ norm = mei_tree_lookup(boundaries->velocity[izone], "u_norm") /
+ sqrt( X[0] * X[0] + X[1] * X[1] + X[2] * X[2]);
+
+ for (i = 1; i < 4; i++)
+ rcodcl[vars->rtp[i] * (*nfabor) + ifbr] = X[i-1] * norm;
+ }
+ }
+#endif
+ }
+ BFT_FREE(choice_v);
+ BFT_FREE(choice_d);
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "wall"))
+ {
+ if (boundaries->rough[izone] >= 0.0)
+ {
+ /* roughness value is only stored in Velocity_U */
+ /* Remember: rcodcl(ifac, ivar, 1) -> rcodcl[k][j][i] = rcodcl[ k*dim1*dim2 + j*dim1 + i] */
+ iwall = *iparug;
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac] -1;
+ rcodcl[2 * (*nfabor * (vars->nvar)) + vars->rtp[1] * (*nfabor) + ifbr]
+ = boundaries->rough[izone];
+ }
+ }
+ else
+ {
+ iwall = *iparoi;
+ }
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ izfppp[ifbr] = zone_nbr;
+ itypfb[iphas *(*nfabor) +ifbr] = iwall;
+ }
+
+ for (i = 0; i < vars->nvar; i++)
+ {
+ ivar = vars->rtp[i];
+
+ switch (boundaries->type_code[ivar][izone])
+ {
+ case NEUMANN:
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ icodcl[ivar *(*nfabor) + ifbr] = 3;
+ rcodcl[2 * (*nfabor * (vars->nvar)) + ivar * (*nfabor) + ifbr]
+ = boundaries->values[ivar][izone].val3;
+ }
+ break;
+
+ case DIRICHLET:
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ icodcl[ivar *(*nfabor) + ifbr] = 5;
+ /* if wall_function --> icodcl[ivar *(*nfabor) + ifbr] = 1; */
+ rcodcl[0 * (*nfabor * (vars->nvar)) + ivar * (*nfabor) + ifbr]
+ = boundaries->values[ivar][izone].val1;
+ }
+ break;
+
+ case WALL_FUNCTION:
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ icodcl[ivar *(*nfabor) + ifbr] = 5;
+ rcodcl[0 * (*nfabor * (vars->nvar)) + ivar * (*nfabor) + ifbr]
+ = boundaries->values[ivar][izone].val1;
+ }
+ break;
+
+ case COEF_ECHANGE:
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ icodcl[ivar *(*nfabor) + ifbr] = 5;
+ rcodcl[0 * (*nfabor * (vars->nvar)) + ivar * (*nfabor) + ifbr]
+ = boundaries->values[ivar][izone].val1;
+ rcodcl[1 * (*nfabor * (vars->nvar)) + ivar * (*nfabor) + ifbr]
+ = boundaries->values[ivar][izone].val2;
+ }
+ break;
+ } /* switch */
+ } /* for (i = 0; i < vars->nvar; i++) */
+
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "outlet"))
+ {
+
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ izfppp[ifbr] = zone_nbr;
+ itypfb[iphas *(*nfabor) +ifbr] = *isolib;
+ }
+
+ for (i = 0; i < vars->nvar; i++)
+ {
+ ivar = vars->rtp[i];
+
+ switch (boundaries->type_code[ivar][izone])
+ {
+
+ case DIRICHLET:
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ icodcl[ivar *(*nfabor) + ifbr] = 1;
+ rcodcl[0 * (*nfabor * (vars->nvar)) + ivar * (*nfabor) + ifbr]
+ = boundaries->values[ivar][izone].val1;
+ }
+ break;
+ }
+ }
+
+ if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ {
+ iprofm[zone_nbr-1] = boundaries->meteo[izone].read_data;
+ if (boundaries->meteo[izone].automatic)
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]- 1;
+ itypfb[iphas * (*nfabor) + ifbr] = 0;
+ }
+ }
+ }
+
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "symmetry"))
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ izfppp[ifbr] = zone_nbr;
+ itypfb[iphas *(*nfabor) +ifbr] = *isymet;
+ }
+
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "undefined"))
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ izfppp[ifbr] = zone_nbr;
+ itypfb[iphas *(*nfabor) +ifbr] = *iindef;
+ }
+
+ }
+ else
+ {
+ bft_error(__FILE__, __LINE__, 0,
+ _("boundary nature %s is unknown \n"),
+ boundaries->nature[izone]);
+ }
+ BFT_FREE(faces_list);
+
+ } /* for (izone=0 ; izone < zones ; izone++) */
+
+#if _XML_DEBUG_
+ bft_printf("==>UICLIM\n");
+ bft_printf("--boundary zones number: %i\n", zones);
+
+ for (izone = 0 ; izone < zones ; izone++) {
+
+ faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor, *nozppm, &faces);
+
+ zone_nbr = cs_gui_boundary_zone_number(izone+1);
+
+ bft_printf("\n---zone %i label: %s\n", zone_nbr, boundaries->label[izone]);
+ bft_printf("---zone %i nature: %s\n", zone_nbr, boundaries->nature[izone]);
+ bft_printf("---zone %i number of faces: %i\n", zone_nbr, faces);
+ bft_printf("----localization: %s\n", cs_gui_boundary_zone_localization(boundaries->label[izone]));
+
+ if (cs_gui_strcmp(boundaries->nature[izone], "inlet"))
+ {
+ choice_v = _boundary_choice("inlet", boundaries->label[izone], "velocity_pressure", "choice");
+ choice_d = _boundary_choice("inlet", boundaries->label[izone], "velocity_pressure", "direction");
+
+ if (cs_gui_strcmp(choice_v, "norm"))
+ bft_printf("-----velocity: %s => %12.5e \n", choice_v, boundaries->norm[izone]);
+ if (cs_gui_strcmp(choice_v, "flow1") || cs_gui_strcmp(choice_v, "flow2"))
+ bft_printf("-----velocity: %s => %12.5e \n", choice_v, boundaries->qimp[izone]);
+ if (cs_gui_strcmp(choice_v, "norm_formula") || cs_gui_strcmp(choice_v, "flow1_formula")
+ || cs_gui_strcmp(choice_v, "flow2_formula"))
+ bft_printf("-----velocity: %s => %s \n", choice_v, boundaries->velocity[izone]->string);
+ if (cs_gui_strcmp(choice_d, "coordinates"))
+ bft_printf("-----direction: %s => %12.5e %12.5e %12.5e \n",
+ choice_v, boundaries->dirx[izone], boundaries->diry[izone], boundaries->dirz[izone]);
+ if (cs_gui_strcmp(choice_d, "formula"))
+ bft_printf("-----direction: %s => %s \n", choice_d, boundaries->direction[izone]->string);
+ BFT_FREE(choice_v);
+ BFT_FREE(choice_d);
+
+ if (cs_gui_strcmp(vars->model, "pulverized_coal"))
+ {
+ bft_printf("-----iqimp=%i, qimpat=%12.5e \n",
+ iqimp[zone_nbr-1], qimpat[zone_nbr-1]);
+ bft_printf("-----ientat=%i, ientcp=%i, timpat=%12.5e \n",
+ ientat[zone_nbr-1], ientcp[zone_nbr-1], timpat[zone_nbr-1]);
+
+ for (icharb = 0; icharb < *ncharb; icharb++)
+ {
+ bft_printf("-----coal=%i, qimpcp=%12.5e, timpcp=%12.5e \n",
+ icharb, qimpcp[icharb *(*nozppm)+zone_nbr-1],
+ timpcp[icharb *(*nozppm)+zone_nbr-1]);
+
+ for (k = 0; k < nclpch[icharb]; k++)
+ bft_printf("-----coal=%i, class=%i, distch=%f \n",
+ icharb, k,
+ distch[k * (*nozppm) * (*ncharm) +icharb * (*nozppm) +zone_nbr-1]);
+ }
+ }
+ else
+ {
+ bft_printf("-----iqimp=%i, qimp=%12.5e \n",
+ iqimp[zone_nbr-1], qimp[zone_nbr-1]);
+ }
+ bft_printf("-----icalke=%i, dh=%12.5e, xintur=%12.5e \n",
+ icalke[zone_nbr-1], dh[zone_nbr-1], xintur[zone_nbr-1]);
+
+ if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ bft_printf("-----iprofm=%i, automatic=%i \n",
+ iprofm[zone_nbr-1], boundaries->meteo[izone].automatic);
+ }
+
+ if (faces > 0)
+ {
+ ifbr = faces_list[0]-1;
+
+ for (i = 0; i < vars->nvar ; i++)
+ {
+ ivar = vars->rtp[i];
+ bft_printf("------%s: icodcl=%i, "
+ "rcodcl(1)=%12.5e, rcodcl(2)=%12.5e, rcodcl(3)=%12.5e\n",
+ vars->name[ivar],
+ icodcl[ivar *(*nfabor) +ifbr ],
+ rcodcl[0 * (*nfabor * (vars->nvar)) +ivar * (*nfabor) +ifbr],
+ rcodcl[1 * (*nfabor * (vars->nvar)) +ivar * (*nfabor) +ifbr],
+ rcodcl[2 * (*nfabor * (vars->nvar)) +ivar * (*nfabor) +ifbr]);
+ }
+ }
+ BFT_FREE(faces_list);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Boundary conditions input verification
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UICLVE
+ * *****************
+ *
+ * INTEGER NFABOR --> number of boundary faces
+ * INTEGER NOZPPM --> max number of boundary conditions zone
+ * INTEGER IINDEF --> type of boundary: not defined
+ * INTEGER IENTRE --> type of boundary: inlet
+ * INTEGER IPAROI --> type of boundary: smooth wall
+ * INTEGER IPARUG --> type of boundary: rough wall
+ * INTEGER ISYMET --> type of boundary: symetry
+ * INTEGER ISOLIB --> type of boundary: outlet
+ * INTEGER ITYPFB --> type of boundary for each face
+ * INTEGER IZFPPP --> zone number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiclve, UICLVE)(const int *const nfabor,
+ const int *const nozppm,
+ const int *const iindef,
+ const int *const ientre,
+ const int *const iparoi,
+ const int *const iparug,
+ const int *const isymet,
+ const int *const isolib,
+ int *const itypfb,
+ int *const izfppp)
+{
+ int ifbr, ifac;
+ int izone, zones, zone_nbr;
+ int inature = 0;
+ int inature2 = 0;
+ int *faces_list = NULL;
+ int faces = 0, iphas = 0;
+
+ zones = cs_gui_boundary_zones_number();
+
+ for (izone=0 ; izone < zones ; izone++)
+ {
+ if (cs_gui_strcmp(boundaries->nature[izone], "inlet"))
+ {
+ inature = *ientre;
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "wall"))
+ {
+ inature = *iparug;
+ if (boundaries->rough[izone] < 0.0)
+ inature = *iparoi;
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "outlet"))
+ {
+ inature = *isolib;
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "symmetry"))
+ {
+ inature = *isymet;
+ }
+ else if (cs_gui_strcmp(boundaries->nature[izone], "undefined"))
+ {
+ inature = *iindef;
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("boundary nature %s is unknown \n"),
+ boundaries->nature[izone]);
+
+ zone_nbr = cs_gui_boundary_zone_number(izone + 1);
+ faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor, *nozppm, &faces);
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+
+ if (izfppp[ifbr] != zone_nbr)
+ bft_error(__FILE__, __LINE__, 0,
+ _("@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"
+ "@ @@ WARNING: BOUNDARY CONDITIONS ERROR \n"
+ "@ ******* \n"
+ "@ \n"
+ "@ The zone %s does not have the same id number \n"
+ "@ in the GUI and in the user subroutine. \n"
+ "@ \n"
+ "@ GUI zone number: %i \n"
+ "@ USER SUBROUTINE zone number: %i \n"
+ "@ \n"
+ "@ The id number given in the GUI cannot be modified \n"
+ "@ in the user subroutine (fortran array IZFPPP). \n"
+ "@ \n"
+ "@ The calculation will stop. \n"
+ "@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"),
+ boundaries->label[izone], zone_nbr, izfppp[ifbr]);
+
+ inature2 = itypfb[iphas *(*nfabor) +ifbr];
+
+ /* The nature of the boundary can be changed from smooth wall to
+ rough wall or vice-versa between the GUI and the FORTRAN */
+ if (inature2 == *iparug ) inature2 = *iparoi;
+ if (inature == *iparug ) inature = *iparoi;
+
+ if (cs_gui_strcmp(cs_glob_var->model, "atmospheric_flows"))
+ {
+ if (boundaries->meteo[izone].automatic)
+ {
+ if ((inature == *ientre || inature == *isolib) && inature2 == 0)
+ inature2 = inature;
+ }
+ }
+
+ if (inature2 != inature)
+ bft_error(__FILE__, __LINE__, 0,
+ _("@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"
+ "@ @@ WARNING: BOUNDARY CONDITIONS ERROR \n"
+ "@ ******* \n"
+ "@ \n"
+ "@ The zone %s does not have the same nature \n"
+ "@ in the GUI and in the user subroutine. \n"
+ "@ \n"
+ "@ GUI zone nature: %s \n"
+ "@ USER SUBROUTINE ITYPFB: %i \n"
+ "@ \n"
+ "@ The nature given in the GUI cannot be modified \n"
+ "@ in the user subroutine (fortran array ITYPFB). \n"
+ "@ \n"
+ "@ The calculation will stop. \n"
+ "@ \n"
+ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
+ "@ \n"),
+ boundaries->label[izone], boundaries->nature[izone], inature2);
+ }
+ BFT_FREE(faces_list);
+ } /* for izone */
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Free memory
+ *
+ * INTEGER NCHARB --> number of coal
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_boundary_conditions_free_memory(const int *const ncharb)
+{
+ int i;
+ int ivar;
+ int izone;
+ int zones;
+ int icharb;
+
+ cs_var_t *vars = cs_glob_var;
+
+ /* clean memory for global private structure boundaries */
+
+ if (boundaries != NULL)
+ {
+ zones = cs_gui_boundary_zones_number();
+ for (izone=0 ; izone < zones ; izone++) {
+ BFT_FREE(boundaries->label[izone]);
+ BFT_FREE(boundaries->nature[izone]);
+#if defined(HAVE_MEI)
+ mei_tree_destroy(boundaries->velocity[izone]);
+ mei_tree_destroy(boundaries->direction[izone]);
+#endif
+ }
+
+ for (i=0; i < vars->nvar; i++) {
+ ivar = vars->rtp[i];
+ BFT_FREE(boundaries->type_code[ivar]);
+ BFT_FREE(boundaries->values[ivar]);
+ }
+
+ if (cs_gui_strcmp(vars->model, "pulverized_coal")) {
+ for (izone=0 ; izone < zones ; izone++) {
+ BFT_FREE(boundaries->qimpcp[izone]);
+ BFT_FREE(boundaries->timpcp[izone]);
+ for (icharb=0; icharb < *ncharb; icharb++)
+ BFT_FREE(boundaries->distch[izone][icharb]);
+ BFT_FREE(boundaries->distch[izone]);
+ }
+ BFT_FREE(boundaries->ientat);
+ BFT_FREE(boundaries->ientcp);
+ BFT_FREE(boundaries->inmoxy);
+ BFT_FREE(boundaries->timpat);
+ BFT_FREE(boundaries->qimpcp);
+ BFT_FREE(boundaries->timpcp);
+ BFT_FREE(boundaries->distch);
+ }
+ if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ BFT_FREE(boundaries->meteo);
+
+ BFT_FREE(boundaries->label);
+ BFT_FREE(boundaries->nature);
+ BFT_FREE(boundaries->iqimp);
+ BFT_FREE(boundaries->icalke);
+ BFT_FREE(boundaries->qimp);
+ BFT_FREE(boundaries->dh);
+ BFT_FREE(boundaries->xintur);
+ BFT_FREE(boundaries->type_code);
+ BFT_FREE(boundaries->values);
+ BFT_FREE(boundaries->rough);
+ BFT_FREE(boundaries->norm);
+ BFT_FREE(boundaries->dirx);
+ BFT_FREE(boundaries->diry);
+ BFT_FREE(boundaries->dirz);
+#if defined(HAVE_MEI)
+ BFT_FREE(boundaries->velocity);
+ BFT_FREE(boundaries->direction);
+#endif
+ BFT_FREE(boundaries);
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui_matisse.c b/src/base/cs_gui_matisse.c
new file mode 100644
index 0000000..f77753e
--- /dev/null
+++ b/src/base/cs_gui_matisse.c
@@ -0,0 +1,567 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: Matisse module
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui_util.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui_matisse.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* debugging switch */
+#define _XML_DEBUG_ 0
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+static const char *const cs_matisse_map_type[4]=
+{ "inlet_range",
+ "outlet_range",
+ "network",
+ "thermal_capacity" };
+
+static const char *const cs_matisse_map_axis[3]=
+{ "line",
+ "row",
+ "height" };
+
+/*============================================================================
+ * Private functions prototypes
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return a Matisse value of type "double"
+ *----------------------------------------------------------------------------*/
+
+static double
+cs_gui_data_matisse_double(const char *const markup1,
+ const char *const markup2,
+ const char *const data)
+{
+ char *path;
+ double result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4, "matisse", markup1, markup2, data);
+ cs_xpath_add_function_text(&path);
+
+ if (!cs_gui_get_double(path, &result))
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ BFT_FREE(path);
+ return result;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Return a Matisse value of type "integer"
+ *----------------------------------------------------------------------------*/
+
+static int
+cs_gui_data_matisse_int(const char *const markup,
+ const char *const data)
+{
+ char *path;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4, "matisse", markup, "geometry", data);
+ cs_xpath_add_function_text(&path);
+
+ if (!cs_gui_get_int(path, &result))
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ BFT_FREE(path);
+ return result;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return a Matisse value of type "integer" (XML status attribute)
+ *----------------------------------------------------------------------------*/
+
+static int cs_gui_data_matisse_att_status(const char *const data)
+{
+ char *path;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4, "matisse", "compute", "physical_model", data);
+ cs_xpath_add_attribute(&path, "status");
+
+ if (!cs_gui_get_status(path, &result))
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ BFT_FREE(path);
+ return result;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the type of warehousing (1 pour Emm, 0 pour Vault)
+ *----------------------------------------------------------------------------*/
+
+static int
+cs_gui_warehousing_type(void)
+{
+ char *path;
+ char *value;
+ int intval;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4, "matisse", "compute", "geometry", "typent");
+ cs_xpath_add_attribute(&path, "label");
+
+ value = cs_gui_get_attribute_value(path);
+
+ if (cs_gui_strcmp(value, "vault"))
+ intval = 0;
+
+ else if (cs_gui_strcmp(value,"emm"))
+ intval = 1;
+
+ else
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ BFT_FREE(path);
+ BFT_FREE(value);
+
+ return intval;
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Treatment of geometric "integer" parameters in the Matisse module
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csgein, CSGEIN) (int *const nptran,
+ int *const nplgrs,
+ int *const nelgrs,
+ int *const nchest,
+ int *const netran,
+ int *const itypen)
+{
+ *nptran = cs_gui_data_matisse_int("compute", "nptran");
+ *nplgrs = cs_gui_data_matisse_int("compute", "nplgrs");
+ *nelgrs = cs_gui_data_matisse_int("compute", "nelgrs");
+ *nchest = cs_gui_data_matisse_int("compute", "nchest");
+ *netran = cs_gui_data_matisse_int("compute", "netran");
+ *itypen = cs_gui_warehousing_type();
+
+#if _XML_DEBUG_
+ bft_printf("==>CSGEIN\n");
+ bft_printf("--nptran = %d\n", *nptran);
+ bft_printf("--nplgrs = %d\n", *nplgrs);
+ bft_printf("--nelgrs = %d\n", *nelgrs);
+ bft_printf("--nchest = %d\n", *nchest);
+ bft_printf("--netran = %d\n", *netran);
+ bft_printf("--itypen = %d\n", *itypen);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Treatment of geometric "real" parameters in the Matisse module
+ * not keeped in the COMMON blocks
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csmhdb, CSMHDB) (double *const jeuchr,
+ double *const jeurcl,
+ double *const jeuclr,
+ double *const jeurch,
+ int *const nechrg,
+ int *const nergrs,
+ int *const neclrg,
+ int *const nergch,
+ double *const hbdtoi,
+ int *const neciel)
+{
+ *nechrg = cs_gui_data_matisse_int("mesh", "nechrg");
+ *nergrs = cs_gui_data_matisse_int("mesh", "nergrs");
+ *neclrg = cs_gui_data_matisse_int("mesh", "neclrg");
+ *nergch = cs_gui_data_matisse_int("mesh", "nergch");
+ *neciel = cs_gui_data_matisse_int("mesh", "neciel");
+
+ *jeuchr = cs_gui_data_matisse_double("mesh", "geometry", "jeuchr");
+ *jeurcl = cs_gui_data_matisse_double("mesh", "geometry", "jeurcl");
+ *jeuclr = cs_gui_data_matisse_double("mesh", "geometry", "jeuclr");
+ *jeurch = cs_gui_data_matisse_double("mesh", "geometry", "jeurch");
+ *hbdtoi = cs_gui_data_matisse_double("mesh", "geometry", "hbdtoi");
+
+#if _XML_DEBUG_
+ bft_printf("==>CSMHDB\n");
+
+ bft_printf("--nechrg = %i\n", *nechrg);
+ bft_printf("--nergrs = %i\n", *nergrs);
+ bft_printf("--neclrg = %i\n", *neclrg);
+ bft_printf("--nergch = %i\n", *nergch);
+ bft_printf("--jeuchr = %f\n", *jeuchr);
+ bft_printf("--jeurcl = %f\n", *jeurcl);
+ bft_printf("--jeuclr = %f\n", *jeuclr);
+ bft_printf("--jeurch = %f\n", *jeurch);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Treatment of geometric "real" parameters in the Matisse module
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csgedb, CSGEDB) (double *const epregi,
+ double *const epchem,
+ double *const hconve,
+ double *const rconve,
+ double *const hchali,
+ double *const hcheva,
+ double *const hfttoi,
+ double *const ptrres,
+ double *const frdtra,
+ double *const plgres,
+ double *const epchel,
+ double *const dmcont)
+{
+ *epregi = cs_gui_data_matisse_double("compute", "geometry", "epregi");
+ *epchem = cs_gui_data_matisse_double("compute", "geometry", "epchem");
+ *hconve = cs_gui_data_matisse_double("compute", "geometry", "hconve");
+ *rconve = cs_gui_data_matisse_double("compute", "geometry", "rconve");
+ *hchali = cs_gui_data_matisse_double("compute", "geometry", "hchali");
+ *hcheva = cs_gui_data_matisse_double("compute", "geometry", "hcheva");
+ *hfttoi = cs_gui_data_matisse_double("compute", "geometry", "hfttoi");
+ *ptrres = cs_gui_data_matisse_double("compute", "geometry", "ptrres");
+ *frdtra = cs_gui_data_matisse_double("compute", "geometry", "frdtra");
+ *plgres = cs_gui_data_matisse_double("compute", "geometry", "plgres");
+ *epchel = cs_gui_data_matisse_double("compute", "geometry", "epchel");
+ *dmcont = cs_gui_data_matisse_double("compute", "geometry", "dmcont");
+
+#if _XML_DEBUG_
+ bft_printf("==>CSGEDB\n");
+ bft_printf("--epregi = %f\n", *epregi);
+ bft_printf("--epchem = %f\n", *epchem);
+ bft_printf("--hconve = %f\n", *hconve);
+ bft_printf("--rconve = %f\n", *rconve);
+ bft_printf("--hchali = %f\n", *hchali);
+ bft_printf("--hcheva = %f\n", *hcheva);
+ bft_printf("--hfttoi = %f\n", *hfttoi);
+ bft_printf("--ptrres = %f\n", *ptrres);
+ bft_printf("--frdtra = %f\n", *frdtra);
+ bft_printf("--plgres = %f\n", *plgres);
+ bft_printf("--epchel = %f\n", *epchel);
+ bft_printf("--dmcont = %f\n", *dmcont);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Treatment of physical "double precision" parameters in the Matisse module
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csphdb, CSPHDB) (double *const dtdtmx,
+ double *const puicon,
+ double *const tinit,
+ double *const tcrit,
+ double *const emicon,
+ double *const emimur,
+ double *const hepcnt,
+ double *const dhpcnt,
+ double *const debmas,
+ double *const pdccha,
+ double *const pdcfch,
+ double *const dhchea,
+ double *const sdchea,
+ double *const pdcche,
+ double *const pdccch,
+ double *const dhches,
+ double *const sdches,
+ double *const pdcalg,
+ double *const pdcatv,
+ double *const argamt,
+ double *const pdcslg,
+ double *const pdcstv,
+ double *const argavl,
+ double *const amppdc,
+ double *const dhalve,
+ double *const hreso,
+ double *const hplen,
+ double *const dpvent)
+{
+ *dtdtmx = cs_gui_data_matisse_double("compute", "physical_model", "dtdtmx");
+ *puicon = cs_gui_data_matisse_double("compute", "physical_model", "puicon");
+ *tinit = cs_gui_data_matisse_double("compute", "physical_model", "tinit");
+ *tcrit = cs_gui_data_matisse_double("compute", "physical_model", "tcrit");
+ *emicon = cs_gui_data_matisse_double("compute", "physical_model", "emicon");
+ *emimur = cs_gui_data_matisse_double("compute", "physical_model", "emimur");
+ *hepcnt = cs_gui_data_matisse_double("compute", "physical_model", "hepcnt");
+ *dhpcnt = cs_gui_data_matisse_double("compute", "physical_model", "dhpcnt");
+ *debmas = cs_gui_data_matisse_double("compute", "physical_model", "debmas");
+ *pdccha = cs_gui_data_matisse_double("compute", "physical_model", "pdccha");
+ *pdcfch = cs_gui_data_matisse_double("compute", "physical_model", "pdcfch");
+ *dhchea = cs_gui_data_matisse_double("compute", "physical_model", "dhchea");
+ *sdchea = cs_gui_data_matisse_double("compute", "physical_model", "sdchea");
+ *pdcche = cs_gui_data_matisse_double("compute", "physical_model", "pdcche");
+ *pdccch = cs_gui_data_matisse_double("compute", "physical_model", "pdccch");
+ *dhches = cs_gui_data_matisse_double("compute", "physical_model", "dhches");
+ *sdches = cs_gui_data_matisse_double("compute", "physical_model", "sdches");
+ *pdcalg = cs_gui_data_matisse_double("compute", "physical_model", "pdcalg");
+ *pdcatv = cs_gui_data_matisse_double("compute", "physical_model", "pdcatv");
+ *argamt = cs_gui_data_matisse_double("compute", "physical_model", "argamt");
+ *pdcslg = cs_gui_data_matisse_double("compute", "physical_model", "pdcslg");
+ *pdcstv = cs_gui_data_matisse_double("compute", "physical_model", "pdcstv");
+ *argavl = cs_gui_data_matisse_double("compute", "physical_model", "argavl");
+ *amppdc = cs_gui_data_matisse_double("compute", "physical_model", "amppdc");
+ *dhalve = cs_gui_data_matisse_double("compute", "physical_model", "dhalve");
+ *hreso = cs_gui_data_matisse_double("compute", "physical_model", "hreso");
+ *hplen = cs_gui_data_matisse_double("compute", "physical_model", "hplen");
+ *dpvent = cs_gui_data_matisse_double("compute", "physical_model", "dpvent");
+
+#if _XML_DEBUG_
+ bft_printf("==>CSPHDB\n");
+ bft_printf("--dtdtmx = %f\n", *dtdtmx);
+ bft_printf("--puicon = %f\n", *puicon);
+ bft_printf("--tinit = %f\n", *tinit);
+ bft_printf("--tcrit = %f\n", *tcrit);
+ bft_printf("--emicon = %f\n", *emicon);
+ bft_printf("--emimur = %f\n", *emimur);
+ bft_printf("--hepcnt = %f\n", *hepcnt);
+ bft_printf("--dhpcnt = %f\n", *dhpcnt);
+ bft_printf("--debmas = %f\n", *debmas);
+ bft_printf("--pdccha = %f\n", *pdccha);
+ bft_printf("--pdcfch = %f\n", *pdcfch);
+ bft_printf("--dhchea = %f\n", *dhchea);
+ bft_printf("--sdchea = %f\n", *sdchea);
+ bft_printf("--pdcche = %f\n", *pdcche);
+ bft_printf("--pdccch = %f\n", *pdccch);
+ bft_printf("--dhches = %f\n", *dhches);
+ bft_printf("--sdches = %f\n", *sdches);
+ bft_printf("--pdcalg = %f\n", *pdcalg);
+ bft_printf("--pdcatv = %f\n", *pdcatv);
+ bft_printf("--argamt = %f\n", *argamt);
+ bft_printf("--pdcslg = %f\n", *pdcslg);
+ bft_printf("--pdcstv = %f\n", *pdcstv);
+ bft_printf("--argavl = %f\n", *argavl);
+ bft_printf("--amppdc = %f\n", *amppdc);
+ bft_printf("--dhalve = %f\n", *dhalve);
+ bft_printf("--hreso = %f\n", *hreso);
+ bft_printf("--hplen = %f\n", *hplen);
+ bft_printf("--dpvent = %f\n", *dpvent);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Treatment of the physical "XML attribute" parameters in the Matisse module
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csphat, CSPHAT)(int *const imdcnt,
+ int *const icofor,
+ int *const iconlg,
+ int *const ialveo)
+{
+ *imdcnt = cs_gui_data_matisse_att_status("imdcnt");
+ *icofor = cs_gui_data_matisse_att_status("icofor");
+ *iconlg = cs_gui_data_matisse_att_status("iconlg");
+ *ialveo = cs_gui_data_matisse_att_status("ialveo");
+
+#if _XML_DEBUG_
+ bft_printf("==>CSPHAT\n");
+ bft_printf("--imdcnt = %d\n", *imdcnt);
+ bft_printf("--icofor = %d\n", *icofor);
+ bft_printf("--iconlg = %d\n", *iconlg);
+ bft_printf("--ialveo = %d\n", *ialveo);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Test if the Matisse header is in the XML file
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csmtpr,CSMTPR)(int *imatis)
+{
+ char *path;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "matisse");
+
+ if (cs_gui_get_nb_element(path) > 0 )
+ *imatis = 1;
+ else
+ *imatis = 0;
+
+#if _XML_DEBUG_
+ bft_printf("==>CSMTPR\n");
+ bft_printf("--imatis = %d\n", *imatis);
+#endif
+
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the number of zone for given map and direction
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csnbmp,CSNBMP) (int *const direction,
+ int *const carte,
+ int *const nb)
+{
+ char *path;
+ int icarte = (*carte)-1;
+ int idirec = (*direction)-1;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "matisse", "compute", "map");
+ if (!cs_gui_strcmp(cs_matisse_map_type[icarte], "thermal_capacity"))
+ cs_xpath_add_element(&path, "headloss");
+ cs_xpath_add_element(&path, cs_matisse_map_type[icarte]);
+ cs_xpath_add_element(&path, cs_matisse_map_axis[idirec]);
+ cs_xpath_add_element(&path, "area");
+
+ *nb = cs_gui_get_nb_element(path);
+
+ BFT_FREE(path);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSNBMP\n");
+ bft_printf("--Zones number for the map %i in the direction %i: %i\n",
+ *carte, *direction, *nb);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Fill the 2D and 3D maps for head loss and thermal power
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csdfmp,CSDFMP) ( int *const zone,
+ int *const direction,
+ int *const carte,
+ double *const min,
+ double *const max,
+ double *const value)
+{
+ char *path;
+ char *pathtmp;
+ int icarte = (*carte)-1;
+ int idirec = (*direction)-1;
+ int izone = (*zone)-1;
+
+ /* Build the request */
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "matisse", "compute", "map");
+ if (!cs_gui_strcmp(cs_matisse_map_type[icarte], "thermal_capacity"))
+ cs_xpath_add_element(&path, "headloss");
+ cs_xpath_add_element(&path, cs_matisse_map_type[icarte]);
+ cs_xpath_add_element(&path, cs_matisse_map_axis[idirec]);
+ cs_xpath_add_element_num(&path, "area" , izone+1);
+
+
+ /* Retrieve the minimum */
+ BFT_MALLOC(pathtmp, strlen(path)+1, char);
+ strcpy(pathtmp, path);
+ cs_xpath_add_element(&path, "min");
+ cs_xpath_add_function_text(&path);
+
+ if (!cs_gui_get_double(path, min))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Missing 'min' markup for xpath : %s\n"), path);
+
+
+ /* Retrieve the maximum */
+ strcpy(path, pathtmp);
+ cs_xpath_add_element(&path, "max");
+ cs_xpath_add_function_text(&path);
+
+ if (!cs_gui_get_double(path, max))
+ bft_error (__FILE__, __LINE__, 0,
+ _("Missing 'max' markup for xpath : %s\n"), path);
+
+ /* Retrieve the value */
+ if (cs_gui_strcmp(cs_matisse_map_type[icarte], "thermal_capacity")) {
+ strcpy(path, pathtmp);
+ cs_xpath_add_element(&path, "value");
+ cs_xpath_add_function_text(&path);
+
+ if (!cs_gui_get_double(path, value))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Missing 'value' markup for xpath : %s\n"), path);
+
+ }
+
+ BFT_FREE(path);
+ BFT_FREE(pathtmp);
+
+#if _XML_DEBUG_
+ bft_printf("==>CSDFMP\n");
+ if (cs_gui_strcmp(cs_matisse_map_type[icarte], "thermal_capacity"))
+ bft_printf("--Zone %i Direction %i Map %i = %f %f %f \n",
+ *zone, *direction, *carte, *min, *max, *value);
+ else
+ bft_printf("--Zone %i Direction %i Map %i = %f %f \n",
+ *zone, *direction, *carte, *min, *max );
+#endif
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui_mobile_mesh.c b/src/base/cs_gui_mobile_mesh.c
new file mode 100644
index 0000000..8c5a3cb
--- /dev/null
+++ b/src/base/cs_gui_mobile_mesh.c
@@ -0,0 +1,1321 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: mobile mesh
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include "fvm_selector.h"
+
+/*----------------------------------------------------------------------------
+ * MEI library headers
+ *----------------------------------------------------------------------------*/
+
+#ifdef HAVE_MEI
+#include "mei_evaluate.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui_util.h"
+#include "cs_gui_variables.h"
+#include "cs_gui_boundary_conditions.h"
+#include "cs_mesh.h"
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui_mobile_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* debugging switch */
+#define _XML_DEBUG_ 0
+
+/*============================================================================
+ * Static variables
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * ALE property choice possible value
+ *----------------------------------------------------------------------------*/
+
+enum ale_property_choice
+{
+ ale_property_choice_user_function,
+ ale_property_choice_user_subroutine
+};
+
+/*-----------------------------------------------------------------------------
+ * Possible values for boundary nature
+ *----------------------------------------------------------------------------*/
+
+enum ale_boundary_nature
+{
+ ale_boundary_nature_fixed_wall,
+ ale_boundary_nature_sliding_wall,
+ ale_boundary_nature_internal_coupling,
+ ale_boundary_nature_external_coupling,
+ ale_boundary_nature_fixed_velocity,
+ ale_boundary_nature_fixed_displacement,
+};
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return value for iale method
+ *
+ * parameters:
+ * param --> iale parameter
+ * keyword <-- value of the iale parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_iale_parameter(const char *const param,
+ double *const keyword)
+{
+ char *path = NULL;
+ char *type = NULL;
+ double result = 0.0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "thermophysical_models", "ale_method", param);
+
+ if (cs_gui_strcmp(param,"mesh_viscosity") ){
+
+ cs_xpath_add_attribute(&path, "type");
+ type = cs_gui_get_attribute_value(path);
+ if(cs_gui_strcmp(type, "isotrop"))
+ *keyword = 0;
+ else if (cs_gui_strcmp(type, "orthotrop"))
+ *keyword = 1;
+ else
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ } else {
+
+ cs_xpath_add_function_text(&path);
+ if (cs_gui_get_double(path, &result)) *keyword = result;
+
+ }
+ BFT_FREE(type);
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the status of ALE method
+ *
+ * parameters:
+ * keyword <-- status of ale balise
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_gui_get_ale_status(int *const keyword)
+{
+ char *path = NULL;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "thermophysical_models", "ale_method");
+ cs_xpath_add_attribute(&path, "status");
+
+ if(cs_gui_get_status(path, &result))
+ *keyword = result;
+ else
+ *keyword = 0;
+
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the viscosity's type of ALE method
+ *
+ * parameters:
+ * type <-- type of viscosity's type
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_get_ale_viscosity_type(int * type)
+{
+ char *path = NULL;
+ char *buff = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "thermophysical_models", "ale_method", "mesh_viscosity");
+ cs_xpath_add_attribute(&path, "type");
+
+ buff = cs_gui_get_attribute_value(path);
+
+ if (cs_gui_strcmp(buff, "orthotrop"))
+ *type = 1;
+ else if (cs_gui_strcmp(buff, "isotrop"))
+ *type = 0;
+ else
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ BFT_FREE(path);
+ BFT_FREE(buff);
+}
+
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Initialize mei tree and check for symbols existence
+ *
+ * parameters:
+ * formula --> mei formula
+ * symbols --> array of symbol to check
+ * symbol_nbr --> number of symbol in symbols
+ * variables --> variables required in the formula
+ * variable_nbr --> number of variable in variables
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+#ifdef HAVE_MEI
+static mei_tree_t *
+cs_gui_init_mei_tree(char *formula,
+ const char **symbols,
+ unsigned int symbol_nbr,
+ const char **variables,
+ const double *variables_value,
+ unsigned int variable_nbr,
+ const double dtref,
+ const double ttcabs,
+ const int ntcabs )
+{
+ unsigned int i = 0;
+
+ /* return an empty interpreter */
+ mei_tree_t *tree = mei_tree_new(formula);
+
+ /* Insert variables into mei_tree */
+ for( i = 0; i < variable_nbr; ++i )
+ {
+ double value = 0;
+
+ /* Read value from variables_value if it is not null 0 otherwise */
+ if( variables_value )
+ value = variables_value[i];
+ mei_tree_insert(tree, variables[i], value );
+ }
+
+ /* Add commun variables: dt, t, nbIter */
+ mei_tree_insert(tree, "dt", dtref);
+ mei_tree_insert(tree, "t", ttcabs);
+ mei_tree_insert(tree, "iter", ntcabs);
+
+ /* try to build the interpreter */
+ if (mei_tree_builder(tree))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not interprete expression: %s\n"), tree->string);
+
+ /* Check for symbols */
+ for( i = 0; i < symbol_nbr; ++i )
+ {
+ const char* symbol = symbols[i];
+
+ if (mei_tree_find_symbol(tree, symbol))
+ {
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error: can not find the required symbol: %s\n"), symbol);
+ }
+ }
+
+ return tree;
+}
+#endif // HAVE_MEI
+
+/*----------------------------------------------------------------------------
+ * Get the ale property choice
+ *----------------------------------------------------------------------------*/
+
+static enum ale_property_choice
+get_ale_property_choice(void)
+{
+ enum ale_property_choice choice = ale_property_choice_user_function;
+ char *path = cs_xpath_init_path();
+
+ cs_xpath_add_elements(&path, 3, "thermophysical_models", "ale_method", "property");
+ cs_xpath_add_test_attribute(&path, "label", "mesh_vi1");
+ cs_xpath_add_attribute(&path, "choice");
+
+ char *choice_str = cs_gui_get_attribute_value(path);
+
+ if (cs_gui_strcmp( choice_str , "user_function" ) )
+ choice = ale_property_choice_user_function;
+ else if (cs_gui_strcmp( choice_str , "user_subroutine" ) )
+ choice = ale_property_choice_user_subroutine;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Unknow ale property choice %s.\n"), choice);
+ BFT_FREE(choice_str);
+ BFT_FREE(path);
+ return choice;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the ale boundary nature
+ *----------------------------------------------------------------------------*/
+
+static char *
+get_ale_formula(void)
+{
+ char *path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "ale_method");
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ char *aleFormula = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+ return aleFormula;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the ale mesh viscosity
+ *----------------------------------------------------------------------------*/
+
+static char *
+get_ale_mesh_viscosity(void)
+{
+ char *path = cs_xpath_short_path();
+ cs_xpath_add_element(&path, "ale_method");
+ cs_xpath_add_element(&path, "mesh_viscosity");
+ cs_xpath_add_attribute(&path, "type");
+
+ char *viscosityType = cs_gui_get_attribute_value(path);
+ BFT_FREE(path);
+ return viscosityType;
+}
+
+/*-----------------------------------------------------------------------------
+ * Get the ale boundary formula
+ *
+ * parameters:
+ * label --> boundary label
+ * choice --> nature: "fixed_velocity" or "fixed_displacement"
+ *----------------------------------------------------------------------------*/
+
+static char*
+get_ale_boundary_formula(const char *const label,
+ const char *const choice)
+{
+ char *path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "wall");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, "ale");
+ cs_xpath_add_test_attribute(&path, "choice", choice);
+ cs_xpath_add_element(&path, "formula");
+ cs_xpath_add_function_text(&path);
+
+ char* formula = cs_gui_get_text_value(path);
+ BFT_FREE(path);
+
+ return formula;
+}
+
+/*-----------------------------------------------------------------------------
+ * Get uialcl data for fixed displacement
+ *
+ * parameters:
+ * label --> boundary label
+ * begin --> begin index for nodfbr
+ * end --> end index for nodfbr
+ * nnod --> number of node
+ * nodfbr --> NODFBR
+ * impale <-- IMPALE
+ * depale <-- DEPALE
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+static void
+uialcl_fixed_displacement(const char *const label,
+ const int begin,
+ const int end,
+ const int *const nnod,
+ const int *const nodfbr,
+ int *const impale,
+ double *const depale,
+ const double dtref,
+ const double ttcabs,
+ const int ntcabs )
+{
+#ifdef HAVE_MEI
+ const char* variables[3] = { "mesh_x", "mesh_y", "mesh_z" };
+ unsigned int variable_nbr = 3;
+
+ /* Get formula */
+ char* formula = get_ale_boundary_formula(label, "fixed_displacement");
+
+ if (!formula)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Boundary nature formula is null for %s.\n"), label );
+
+ /* Init mei */
+ mei_tree_t *ev = cs_gui_init_mei_tree(formula, variables, variable_nbr,
+ 0, 0, 0, dtref, ttcabs, ntcabs );
+
+ mei_evaluate(ev);
+
+ /* Get mei results */
+ double X_mesh = mei_tree_lookup(ev, "mesh_x");
+ double Y_mesh = mei_tree_lookup(ev, "mesh_y");
+ double Z_mesh = mei_tree_lookup(ev, "mesh_z");
+
+ BFT_FREE(formula);
+ mei_tree_destroy(ev);
+#endif // HAVE_MEI
+
+ /* Set depale and impale */
+ int ii = 0;
+ for( ii = begin; ii < end; ++ii )
+ {
+ int inod = nodfbr[ii-1] - 1;
+ if (impale[inod] == 0)
+ {
+#ifdef HAVE_MEI
+ depale[inod + 0 * (*nnod)] = X_mesh;
+ depale[inod + 1 * (*nnod)] = Y_mesh;
+ depale[inod + 2 * (*nnod)] = Z_mesh;
+#endif // HAVE_MEI
+ impale[inod] = 1;
+ }
+ }
+}
+
+/*-----------------------------------------------------------------------------
+ * Get uialcl data for fixed velicity
+ *
+ * parameters:
+ * label --> boundary label
+ * iuma --> IUMA
+ * ivma --> IVMA
+ * iwma --> IWMA
+ * nfabor --> Number of boundary faces
+ * ifbr --> ifbr
+ * rcodcl <-- RCODCL
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+static void
+uialcl_fixed_velocity( const char* label,
+ const int iuma,
+ const int ivma,
+ const int iwma,
+ const int nfabor,
+ const int ifbr,
+ double *const rcodcl,
+ const double dtref,
+ const double ttcabs,
+ const int ntcabs )
+{
+#ifdef HAVE_MEI
+ const char* variables[3] = { "mesh_u", "mesh_v", "mesh_w" };
+
+ // Get formula
+ char* formula = get_ale_boundary_formula(label, "fixed_velocity");
+
+ if (!formula)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Boundary nature formula is null for %s.\n"), label );
+
+ // Init MEI
+ mei_tree_t *ev = cs_gui_init_mei_tree(formula, variables, 3, 0, 0, 0,
+ dtref, ttcabs, ntcabs );
+
+ mei_evaluate(ev);
+
+ // Fill rcodcl
+ rcodcl[ (iuma-1) * nfabor + ifbr ] = mei_tree_lookup(ev, "mesh_u");
+ rcodcl[ (ivma-1) * nfabor + ifbr ] = mei_tree_lookup(ev, "mesh_v");
+ rcodcl[ (iwma-1) * nfabor + ifbr ] = mei_tree_lookup(ev, "mesh_w");
+
+ BFT_FREE(formula);
+ mei_tree_destroy(ev);
+#endif // HAVE_MEI
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the ale boundary nature
+ *
+ * parameters:
+ * label --> label of boundary zone
+ *----------------------------------------------------------------------------*/
+
+static enum ale_boundary_nature
+get_ale_boundary_nature( const char *const label)
+{
+ enum ale_boundary_nature nature = ale_boundary_nature_fixed_wall;
+
+ char *path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "wall");
+
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, "ale");
+ cs_xpath_add_attribute(&path, "choice");
+ char *ale_boundary_nature = cs_gui_get_attribute_value(path);
+
+ if (cs_gui_strcmp(ale_boundary_nature, "fixed_boundary"))
+ nature = ale_boundary_nature_fixed_wall;
+ if (cs_gui_strcmp(ale_boundary_nature, "sliding_boundary"))
+ nature = ale_boundary_nature_sliding_wall;
+ else if (cs_gui_strcmp(ale_boundary_nature, "internal_coupling"))
+ nature = ale_boundary_nature_internal_coupling;
+ else if (cs_gui_strcmp(ale_boundary_nature, "external_coupling"))
+ nature = ale_boundary_nature_external_coupling;
+ else if (cs_gui_strcmp(ale_boundary_nature, "fixed_velocity"))
+ nature = ale_boundary_nature_fixed_velocity;
+ else if (cs_gui_strcmp(ale_boundary_nature, "fixed_displacement"))
+ nature = ale_boundary_nature_fixed_displacement;
+
+ BFT_FREE(path);
+ BFT_FREE(ale_boundary_nature);
+
+ return nature;
+}
+
+/*-----------------------------------------------------------------------------
+ * Get boundary attribute like nature or label
+ *
+ * parameters:
+ * ith_zone --> boundary index
+ * nodeName --> xml attribute name. for example, "nature" or "label"
+ *----------------------------------------------------------------------------*/
+
+static char*
+get_boundary_attribute(unsigned int ith_zone,
+ const char *nodeName)
+{
+ char *path = cs_xpath_init_path();
+
+ cs_xpath_add_element(&path, "boundary_conditions");
+ cs_xpath_add_element_num(&path, "boundary", ith_zone);
+ cs_xpath_add_attribute(&path, nodeName);
+
+ char *result = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+ return result;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Init xpath for internal coupling with:
+
+ boundary_conditions/wall[label=label]/
+ ale[choice=internal_coupling]/node_name, node_sub_name/text()
+
+ * parameters:
+ * label --> boundary label
+ * node_name --> xml node name ("initial_displacement")
+ * node_sub_name --> xml child node of node_name ("X")
+ *----------------------------------------------------------------------------*/
+
+static char*
+init_internal_coupling_xpath(const char* label,
+ const char* node_name,
+ const char* node_sub_name)
+{
+ char *path = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "wall");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, "ale");
+ cs_xpath_add_test_attribute(&path, "choice", "internal_coupling");
+ cs_xpath_add_element(&path, node_name);
+ cs_xpath_add_element(&path, node_sub_name);
+ cs_xpath_add_function_text(&path);
+
+ return path;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Get internal coupling double
+ *
+ * parameters:
+ * label --> boundary label
+ * node_name --> xml node name ("initial_displacement")
+ * node_sub_name --> xml child node of node_name ("X")
+ *----------------------------------------------------------------------------*/
+
+static double
+get_internal_coupling_double(const char* label,
+ const char* node_name,
+ const char* node_sub_name)
+{
+ double value = 0;
+ char *path = init_internal_coupling_xpath(label, node_name, node_sub_name);
+
+ if( !cs_gui_get_double(path, &value ) )
+ {
+ bft_error(__FILE__, __LINE__, 0,
+ _("cannot get value for %s %s %s"),
+ label, node_name, node_sub_name);
+ }
+ BFT_FREE(path);
+
+ return value;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Get internal coupling string
+ *
+ * parameters:
+ * label --> boundary label
+ * node_name --> xml node name ("initial_displacement")
+ * node_sub_name --> xml child node of node_name ("formula")
+ *----------------------------------------------------------------------------*/
+
+static char*
+get_internal_coupling_string(const char* label,
+ const char* node_name,
+ const char* node_sub_name)
+{
+ char *path = init_internal_coupling_xpath(label, node_name, node_sub_name);
+ char* str = cs_gui_get_text_value(path);
+
+ BFT_FREE(path);
+
+ return str;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Retreive internal coupling x, y and z XML values
+ *
+ * parameters:
+ * label --> boundary label
+ * node_name --> xml node name ("initial_displacement")
+ * xyz <-- result matrix
+ *----------------------------------------------------------------------------*/
+
+static void
+get_internal_coupling_xyz_values(const char *label,
+ const char *node_name,
+ double xyz[3] )
+{
+ xyz[0] = get_internal_coupling_double(label, node_name, "X");
+ xyz[1] = get_internal_coupling_double(label, node_name, "Y");
+ xyz[2] = get_internal_coupling_double(label, node_name, "Z");
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Retreive internal coupling advanced windows double value
+ *
+ * parameters:
+ * node_name --> xml node name ("displacement_prediction_alpha")
+ *----------------------------------------------------------------------------*/
+
+static void
+get_uistr1_advanced_double(const char *const keyword,
+ double *const value)
+{
+ double result = 0;
+ char *path = cs_xpath_init_path();
+
+ cs_xpath_add_elements(&path, 3, "thermophysical_models", "ale_method", keyword);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ *value = result;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Retreive internal coupling advanced windows checkbox value
+ *
+ * parameters:
+ * node_name --> xml node name ("monitor_point_synchronisation")
+ *----------------------------------------------------------------------------*/
+
+static void
+get_uistr1_advanced_checkbox(const char *const keyword, int *const value)
+{
+ int result = 0;
+ char *path = cs_xpath_init_path();
+
+ cs_xpath_add_elements(&path, 3, "thermophysical_models", "ale_method", keyword);
+ cs_xpath_add_attribute(&path, "status");
+
+ if (cs_gui_get_status(path, &result))
+ *value = result;
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Retreive data the internal coupling matrices
+ *
+ * parameters:
+ * label --> boundary label
+ * node_name --> xml matrix node name
+ * symbols --> see cs_gui_init_mei_tree
+ * symbol_nbr --> see cs_gui_init_mei_tree
+ * variables --> see cs_gui_init_mei_tree
+ * variables_value --> see cs_gui_init_mei_tree
+ * variable_nbr --> see cs_gui_init_mei_tree
+ * output_matrix, <-- result matrix
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+static void
+get_internal_coupling_matrix(const char *label,
+ const char *node_name,
+ const char *symbols[],
+ unsigned int symbol_nbr,
+ const char **variables,
+ const double *variables_value,
+ unsigned int variable_nbr,
+ double *output_matrix,
+ const double dtref,
+ const double ttcabs,
+ const int ntcabs)
+{
+#ifdef HAVE_MEI
+ // Get the formula
+ unsigned int i = 0;
+ char *matrix = get_internal_coupling_string(label, node_name, "formula");
+
+ if (!matrix)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Formula is null for %s %s"), label, node_name);
+
+ // Initialize mei
+ mei_tree_t *tree = cs_gui_init_mei_tree(matrix, symbols, symbol_nbr,
+ variables, variables_value, variable_nbr,
+ dtref, ttcabs, ntcabs );
+ mei_evaluate(tree);
+
+ // Read matrix values
+ for (i = 0; i < symbol_nbr; ++i)
+ {
+ const char *symbol = symbols[i];
+ output_matrix[i] = mei_tree_lookup(tree, symbol);
+ }
+ BFT_FREE(matrix);
+ mei_tree_destroy(tree);
+#endif // HAVE_MEI
+}
+
+/*-----------------------------------------------------------------------------
+ * Retreive data for internal coupling for a specific boundary
+ *
+ * parameters:
+ * label --> boundary label
+ * xmstru <-- Mass matrix
+ * xcstr <-- Damping matrix
+ * xkstru <-- Stiffness matrix
+ * forstr <-- Fluid force matrix
+ * istruc --> internal coupling boundary index
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+static void
+get_uistr2_data(const char *label,
+ double *const xmstru,
+ double *const xcstru,
+ double *const xkstru,
+ double *const forstr,
+ unsigned int istruc,
+ const double dtref,
+ const double ttcabs,
+ const int ntcabs)
+{
+ const char *symbols[] = {"m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33"};
+ unsigned int symbol_nbr = sizeof(symbols) / sizeof(symbols[0]);
+
+ const char *force_symbols[] = {"fx", "fy", "fz"};
+ unsigned int force_symbol_nbr = sizeof(force_symbols) / sizeof(force_symbols[0]);
+
+ // Get mass matrix, damping matrix and stiffness matrix
+ get_internal_coupling_matrix(label, "mass_matrix", symbols,
+ symbol_nbr, 0, 0, 0,
+ &xmstru[istruc * symbol_nbr],
+ dtref, ttcabs, ntcabs);
+ get_internal_coupling_matrix(label, "damping_matrix", symbols,
+ symbol_nbr, 0, 0, 0,
+ &xcstru[istruc * symbol_nbr],
+ dtref, ttcabs, ntcabs);
+ get_internal_coupling_matrix(label, "stiffness_matrix", symbols,
+ symbol_nbr, 0, 0, 0,
+ &xkstru[istruc * symbol_nbr],
+ dtref, ttcabs, ntcabs);
+
+ const unsigned int variable_nbr = 3;
+ const char *variables[3] = { "fluid_fx", "fluid_fy", "fluid_fz" };
+ double variable_values[3];
+
+ // Set variable for fluid force matrix
+ variable_values[0] = forstr[istruc * force_symbol_nbr + 0 ];
+ variable_values[1] = forstr[istruc * force_symbol_nbr + 1 ];
+ variable_values[2] = forstr[istruc * force_symbol_nbr + 2 ];
+
+ // Get fluid force matrix
+ get_internal_coupling_matrix(label, "fluid_force_matrix",
+ force_symbols, force_symbol_nbr,
+ variables, variable_values, variable_nbr,
+ &forstr[istruc * force_symbol_nbr],
+ dtref, ttcabs, ntcabs );
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the post synchronization status
+ *
+ * <thermophysical_models>
+ * <ale_method status="on">
+ * <external_coupling_post_synchronization ***status="off"*** />
+ *
+ *----------------------------------------------------------------------------*/
+
+static int
+get_coupling_post_synchronization_status(void)
+{
+ char *path = cs_xpath_init_path();
+
+ cs_xpath_add_elements(&path, 3, "thermophysical_models",
+ "ale_method",
+ "external_coupling_post_synchronization");
+ cs_xpath_add_attribute(&path, "status");
+
+ char *statusStr = cs_gui_get_attribute_value(path);
+ int status = cs_gui_strcmp(statusStr, "on");
+
+ BFT_FREE(statusStr);
+ BFT_FREE(path);
+
+ return status;
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Return the external coupling DDL value
+ *
+ * <boundary_conditions>
+ * <wall label=label_argument">
+ * <ale choice="external_coupling">
+ * <node_name_argument choice="off"/>
+ *
+ * label --> The wall label.
+ * node_name --> Node name: DDLX, DDLY or DDLZ.
+*----------------------------------------------------------------------------*/
+
+static int
+get_external_coupling_ddl(const char *const label,
+ const char *const node_name)
+{
+ char *path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "boundary_conditions", "wall");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_element(&path, "ale");
+ cs_xpath_add_test_attribute(&path, "choice", "external_coupling");
+ cs_xpath_add_element(&path, node_name);
+ cs_xpath_add_attribute(&path, "choice");
+
+ char* choice = cs_gui_get_attribute_value(path);
+ int isOn = cs_gui_strcmp(choice, "on");
+
+ BFT_FREE(choice);
+ BFT_FREE(path);
+
+ return isOn;
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * uivima
+ *
+ * ncel --> number of cells whithout halo
+ * viscmx <-- VISCMX
+ * viscmy <-- VISCMY
+ * viscmz <-- VISCMZ
+ * xyzcen --> cell's gravity center
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uivima, UIVIMA) ( const cs_int_t *const ncel,
+ double *const viscmx,
+ double *const viscmy,
+ double *const viscmz,
+ const double *const xyzcen,
+ double *const dtref,
+ double *const ttcabs,
+ const int *const ntcabs)
+{
+#if defined(HAVE_MEI)
+ int iel = 0;
+ const char* symbols[3] = { "x", "y", "z" };
+ const char* variables[3] = { "mesh_vi1", "mesh_vi2", "mesh_vi3" };
+ unsigned int variable_nbr = 1;
+
+ /* Check if user function is selection */
+ if( get_ale_property_choice() == ale_property_choice_user_function )
+ {
+ /* Get formula */
+ char *aleFormula = get_ale_formula();
+ char *viscosityType = get_ale_mesh_viscosity();
+ unsigned int isOrthotrop = cs_gui_strcmp(viscosityType, "orthotrop");
+
+ if (isOrthotrop)
+ variable_nbr = 3;
+
+ if (!aleFormula)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Formula is null for ale.\n"));
+
+ /* Init mei */
+ mei_tree_t *ev = cs_gui_init_mei_tree(aleFormula, variables,
+ variable_nbr, symbols, 0, 3,
+ *dtref, *ttcabs, *ntcabs);
+
+ /* for each cell, update the value of the table of symbols for each scalar
+ (including the thermal scalar), and evaluate the interpreter */
+ for (iel = 0; iel < *ncel; iel++)
+ {
+ /* insert symbols */
+ mei_tree_insert(ev, "x", xyzcen[3 * iel + 0]);
+ mei_tree_insert(ev, "y", xyzcen[3 * iel + 1]);
+ mei_tree_insert(ev, "z", xyzcen[3 * iel + 2]);
+
+ mei_evaluate(ev);
+
+ // Set viscmx, viscmy and viscmz
+ viscmx[iel] = mei_tree_lookup(ev, "mesh_vi1");
+ if (isOrthotrop)
+ {
+ viscmy[iel] = mei_tree_lookup(ev, "mesh_vi2");
+ viscmz[iel] = mei_tree_lookup(ev, "mesh_vi3");
+ }
+ }
+ mei_tree_destroy(ev);
+ BFT_FREE(aleFormula);
+ BFT_FREE(viscosityType);
+ }
+#endif // HAVE_MEI
+}
+
+/*----------------------------------------------------------------------------
+ * ALE related keywords
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIALIN
+ * *****************
+ *
+ * INTEGER IALE <-- iale method activation
+ * INTEGER NALINF <-- number of sub iteration of initialization
+ * of fluid
+ * INTEGER NALIMX <-- max number of iterations of implicitation of
+ * the displacement of the structures
+ * DOUBLE EPALIM <-- realtive precision of implicitation of
+ * the displacement of the structures
+ * INTEGER IORTVM <-- type of viscosity of mesh
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uialin, UIALIN) (int *const iale,
+ int *const nalinf,
+ int *const nalimx,
+ double *const epalim,
+ int *const iortvm)
+{
+ double value;
+
+ cs_gui_get_ale_status(iale);
+
+ if (*iale) {
+ value =(double) *nalinf;
+ cs_gui_iale_parameter("fluid_initialization_sub_iterations", &value);
+ *nalinf = (int) value;
+
+ value =(double) *nalimx;
+ cs_gui_iale_parameter("max_iterations_implicitation", &value);
+ *nalimx = (int) value;
+
+ cs_gui_iale_parameter("implicitation_precision", epalim);
+
+ value =(double) *iortvm;
+ cs_gui_iale_parameter("mesh_viscosity", &value);
+ *iortvm = (int) value;
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>UIALIN\n");
+ bft_printf("--iale = %i\n", *iale);
+ if (*iale) {
+ bft_printf("--nalinf = %i\n", *nalinf);
+ bft_printf("--nalimx = %i\n", *nalimx);
+ bft_printf("--epalim = %g\n", *epalim);
+ bft_printf("--iortvm = %i\n", *iortvm);
+ }
+#endif
+}
+
+/*-----------------------------------------------------------------------------
+ * uialcl
+ *
+ * parameters:
+ * nfabor --> Number of boundary faces
+ * nozppm --> Max number of boundary conditions zone
+ * ialtyb --> ialtyb
+ * ipnfbr --> First node position for each boundary in nodfbr
+ * nodfbr --> uialcl_fixed_displacement
+ * impale --> uialcl_fixed_displacement
+ * depale --> See uialcl_fixed_displacement
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ * iuma --> See uialcl_fixed_velocity
+ * ivma --> See uialcl_fixed_velocity
+ * iwma --> See uialcl_fixed_velocity
+ * rcodcl --> See uialcl_fixed_velocity
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uialcl, UIALCL) ( const int *const nfabor,
+ const int *const nozppm,
+ const int *const ibfixe,
+ const int *const igliss,
+ const int *const ivimpo,
+ int *const ialtyb,
+ const int *const ipnfbr,
+ const int *const nnod,
+ const int *const nodfbr,
+ int *const impale,
+ double *const depale,
+ double *const dtref,
+ double *const ttcabs,
+ const int *const ntcabs,
+ const int *const iuma,
+ const int *const ivma,
+ const int *const iwma,
+ double *const rcodcl )
+{
+ int izone = 0;
+ int ifac = 0;
+ int faces = 0;
+
+ int zones = cs_gui_boundary_zones_number();
+
+ /* At each time-step, loop on boundary faces: */
+ for (izone=0 ; izone < zones ; izone++)
+ {
+ int* faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor,
+ *nozppm,
+ &faces);
+
+ /* get the ale choice */
+ const char* label = boundaries->label[izone];
+ enum ale_boundary_nature nature = get_ale_boundary_nature(label);
+
+ if (nature == ale_boundary_nature_fixed_wall)
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ int ifbr = faces_list[ifac]-1;
+ ialtyb[ifbr] = *ibfixe;
+ }
+ }
+ else if (nature == ale_boundary_nature_sliding_wall)
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ int ifbr = faces_list[ifac]-1;
+ ialtyb[ifbr] = *igliss;
+ }
+ }
+ else if( nature == ale_boundary_nature_fixed_displacement )
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ int ifbr = faces_list[ifac]-1;
+ uialcl_fixed_displacement(label, ipnfbr[ifbr], ipnfbr[ifbr+1],
+ nnod, nodfbr, impale, depale,
+ *dtref, *ttcabs, *ntcabs);
+ }
+ }
+ else if( nature == ale_boundary_nature_fixed_velocity )
+ {
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ int ifbr = faces_list[ifac]-1;
+ uialcl_fixed_velocity(label, *iuma, *ivma, *iwma,
+ *nfabor, ifbr, rcodcl,
+ *dtref, *ttcabs, *ntcabs );
+ ialtyb[ifbr] = *ivimpo;
+ }
+ }
+ BFT_FREE(faces_list);
+ }
+}
+
+/*-----------------------------------------------------------------------------
+ * Retreive data for internal coupling. Called once at initialization
+ *
+ * parameters:
+ * nfabor --> Number of boundary faces
+ * idfstr --> Structure definition
+ * aexxst <-- Displacement prediction alpha
+ * bexxst <-- Displacement prediction beta
+ * cfopre <-- Stress prediction alpha
+ * ihistr <-- Monitor point synchronisation
+ * xstr0 <-- Values of the initial displacement
+ * xstreq <-- Values of the equilibrium displacement
+ * vstr0 <-- Values of the initial velocity
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uistr1, UISTR1) ( const int *const nfabor,
+ int *const idfstr,
+ double *aexxst,
+ double *bexxst,
+ double *cfopre,
+ int *ihistr,
+ double *xstr0,
+ double *xstreq,
+ double *vstr0 )
+{
+ int izone = 0;
+ int ifac = 0;
+ int faces = 0;
+ int ifbr = 0;
+ int *faces_list = NULL;
+ unsigned int istruct = 0;
+
+ // Get advanced data
+ get_uistr1_advanced_double("displacement_prediction_alpha", aexxst);
+ get_uistr1_advanced_double("displacement_prediction_beta", bexxst);
+ get_uistr1_advanced_double("stress_prediction_alpha", cfopre);
+ get_uistr1_advanced_checkbox("monitor_point_synchronisation", ihistr);
+
+ int zones = cs_gui_boundary_zones_number();
+
+ // At each time-step, loop on boundary faces
+ for (izone=0 ; izone < zones ; izone++)
+ {
+ char *nature = get_boundary_attribute(izone + 1, "nature");
+ char *label = get_boundary_attribute(izone + 1, "label");
+
+ // Keep only internal coupling
+ if (get_ale_boundary_nature(label) == ale_boundary_nature_internal_coupling)
+ {
+ // Read initial_displacement, equilibrium_displacement and initial_velocity
+ get_internal_coupling_xyz_values(label, "initial_displacement",
+ &xstr0[3 * istruct]);
+ get_internal_coupling_xyz_values(label, "equilibrium_displacement",
+ &xstreq[3 * istruct]);
+ get_internal_coupling_xyz_values(label, "initial_velocity",
+ &vstr0[3 * istruct]);
+
+ faces_list = cs_gui_get_faces_list(izone, label, *nfabor, 0, &faces);
+ // Set idfstr to positiv index starting at 1
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ idfstr[ifbr] = istruct + 1;
+ }
+ ++istruct;
+ BFT_FREE(faces_list);
+ }
+ BFT_FREE(nature);
+ BFT_FREE(label);
+ }
+}
+
+/*-----------------------------------------------------------------------------
+ * Retreive data for internal coupling. Called at each step
+ *
+ * parameters:
+ * xmstru <-- Mass matrix
+ * xcstr <-- Damping matrix
+ * xkstru <-- Stiffness matrix
+ * forstr <-- Fluid force matrix
+ * dtref --> time step
+ * ttcabs --> current time
+ * ntcabs --> current iteration number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uistr2, UISTR2) (double *const xmstru,
+ double *const xcstru,
+ double *const xkstru,
+ double *const forstr,
+ double *const dtref,
+ double *const ttcabs,
+ int *const ntcabs)
+{
+ int izone = 0;
+ unsigned int istru = 0;
+
+ int zones = cs_gui_boundary_zones_number();
+
+ // At each time-step, loop on boundary faces
+ for (izone=0 ; izone < zones ; izone++)
+ {
+ const char *label = boundaries->label[izone];
+
+ // Keep only internal coupling
+ if (get_ale_boundary_nature(label) == ale_boundary_nature_internal_coupling)
+ {
+ // Read internal coupling data for boundaries
+ //for (int ii=0; ii<3; ii++)
+ //{
+ // xmstru = 0.
+ // xkstru = 0.
+ // xcstru = 0.
+ //}
+ get_uistr2_data(label,
+ xmstru,
+ xcstru,
+ xkstru,
+ forstr,
+ istru,
+ *dtref,
+ *ttcabs,
+ *ntcabs);
+ ++istru;
+ }
+ }
+}
+
+/*-----------------------------------------------------------------------------
+ * Retreive data for external coupling
+ *
+ * parameters:
+ * nfabor <-- Number of boundary faces
+ * idfstr <-- Structure definition
+ * asddlf <-- Block of the DDL forces
+ * isyncp <---
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (uiaste, UIASTE) (const int *const nfabor,
+ int *const idfstr,
+ double *const asddlf,
+ int *const isyncp )
+{
+ int faces = 0;
+ int izone = 0;
+ int istruct = 0;
+ int ifbr = 0;
+ int ifac = 0;
+
+ int zones = cs_gui_boundary_zones_number();
+
+ // Get the coupling post synchronization status
+ *isyncp = get_coupling_post_synchronization_status() ? 1 : 0;
+
+ // At each time-step, loop on boundary faces
+ for (izone=0 ; izone < zones ; izone++)
+ {
+ const char *label = boundaries->label[izone];
+
+ // Keep only internal coupling
+ if (get_ale_boundary_nature(label) == ale_boundary_nature_external_coupling)
+ {
+ int* faces_list = cs_gui_get_faces_list(izone, label, *nfabor, 0, &faces);
+
+ // Get DDLX, DDLY and DDLZ values
+ asddlf[istruct * 3 + 0] = get_external_coupling_ddl(label, "DDLX") ? 0 : 1;
+ asddlf[istruct * 3 + 1] = get_external_coupling_ddl(label, "DDLY") ? 0 : 1;
+ asddlf[istruct * 3 + 2] = get_external_coupling_ddl(label, "DDLZ") ? 0 : 1;
+
+ // Set idfstr with negativ value starting from -1
+ for (ifac = 0; ifac < faces; ifac++)
+ {
+ ifbr = faces_list[ifac]-1;
+ idfstr[ifbr] = -istruct - 1;
+ }
+ ++istruct;
+ BFT_FREE(faces_list);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui_particles.c b/src/base/cs_gui_particles.c
new file mode 100644
index 0000000..4555ab5
--- /dev/null
+++ b/src/base/cs_gui_particles.c
@@ -0,0 +1,1647 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: particles tracking
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui.h"
+#include "cs_gui_util.h"
+#include "cs_gui_boundary_conditions.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui_particles.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* debugging switch */
+#define _XML_DEBUG_ 0
+
+// rcodcl[ k * dim1 *dim2 + j *dim1 + i]
+// iuslag (iclas,izone,ijnbp)
+// iuslag[ijnbp][izone][iclas]
+// iuslag[ijnbp*nclagm*nflagm + izone*nclagm + iclas]
+// iuslag[ijnbp*nclagm*nflagm + izone*nclagm + iclas]
+
+// F77: IUSLAG(ICLAS, IZONE, I)
+// C : &iuslag[i][izone][iclas] = &iuslag[ i*(*nclagm)*(*nflagm) + izone*(*nclagm) + iclas ]
+
+/* simplfied access for fortran arrays */
+#define IUSLAG(I_,J_,K_) (*(iuslag +I_*(*nclagm)*(*nflagm) +J_*(*nclagm) +K_))
+#define RUSLAG(I_,J_,K_) (*(ruslag +I_*(*nclagm)*(*nflagm) +J_*(*nclagm) +K_))
+
+/*============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Structures associated to lagrangian particles definition
+ *----------------------------------------------------------------------------*/
+
+typedef struct {
+ char **label; /* label for each boundary zone */
+ char **nature; /* nature for each boundary zone */
+ char **p_nature; /* specific nature of the boundary for particles */
+ int *n_classes; /* number of classes for each zone */
+ int **n_particles; /* number of particles for each class */
+ int **frequency; /* frequency of injection for each class */
+ int **statistical_groups;/* frequency of injection for each class */
+ double **statistical_weight;/* number of real particles for numerical particles*/
+ double **mass_flow_rate; /* mass flow rate of particles */
+ double **density; /* density for each class */
+ double **diameter; /* diameter for each class */
+ double **standard_deviation;/* standard deviation of diameter for each class */
+ double **specific_heat; /* specific heat for each class */
+ double **emissivity; /* emissivity for each class */
+#if defined(HAVE_MEI)
+// mei_tree_t **velocity; /* formula for norm or mass flow rate of velocity */
+// mei_tree_t **direction; /* formula for direction of velocity */
+#endif
+} cs_particles_boundary_t;
+
+/*----------------------------------------------------------------------------
+ * Private global variables for the treatment
+ * of NOMLAG, NOMLAV and NOMBRD (characters fortran arrays).
+ *----------------------------------------------------------------------------*/
+
+static int _max_mean_vars = 0;
+static int _last_mean_var = 0;
+static char ** _array_mean_varname = NULL;
+
+static int _max_variance_vars = 0;
+static int _last_variance_var = 0;
+static char ** _array_variance_varname = NULL;
+
+static int _max_boundary_vars = 0;
+static int _last_boundary_var = 0;
+static char ** _array_boundary_varname = NULL;
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Pointer on the main boundaries structure */
+
+extern cs_boundary_t *boundaries;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return value of the particles model
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_particles_model(const char *const model, int *const imodel)
+{
+ char *path;
+ char *attr;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "lagrangian", model);
+ cs_xpath_add_attribute(&path, "model");
+ attr = cs_gui_get_attribute_value(path);
+
+ if (attr != NULL) {
+ if (cs_gui_strcmp(attr, "off"))
+ *imodel = 0;
+ else if (cs_gui_strcmp(attr, "one_way"))
+ *imodel = 1;
+ else if (cs_gui_strcmp(attr, "two_way"))
+ *imodel = 2;
+ else if (cs_gui_strcmp(attr, "frozen"))
+ *imodel = 3;
+ else if (cs_gui_strcmp(attr, "thermal"))
+ *imodel = 1;
+ else if (cs_gui_strcmp(attr, "coal"))
+ *imodel = 2;
+ BFT_FREE(attr);
+ }
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return value of the parameter of the character type for lagrangian
+ *
+ * parameters:
+ * keyword <-- value of parameter
+ * nbr --> size of the labels list
+ * ... --> list of labels in the path
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_status(int *const keyword, const int nbr, ...)
+{
+ va_list list;
+
+ char *elt = NULL;
+ char *path;
+ int i;
+ int result;
+
+ path = cs_xpath_init_path();
+
+ va_start(list, nbr);
+
+ for(i=0; i<nbr; i++) {
+
+ elt = va_arg(list, char *);
+
+ if (elt != NULL) {
+
+ BFT_REALLOC(path,
+ strlen(path)+ strlen(elt)+ strlen("/") +1,
+ char);
+
+ strcat(path, "/");
+ strcat(path, elt);
+ }
+ }
+ va_end(list);
+
+ cs_xpath_add_attribute(&path, "status");
+ if(cs_gui_get_status(path, &result))
+ *keyword = result;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return integer parameters for lagrangian
+ *
+ * parameters:
+ * keyword <-- value of parameter
+ * nbr --> size of the labels list
+ * ... --> list of labels in the path
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_int(int *const keyword, const int nbr, ...)
+{
+ va_list list;
+
+ char *elt = NULL;
+ char *path;
+ int value = 0;
+ int i;
+
+ path = cs_xpath_init_path();
+
+ va_start(list, nbr);
+
+ for(i=0; i<nbr; i++) {
+
+ elt = va_arg(list, char *);
+
+ if (elt != NULL) {
+
+ BFT_REALLOC(path,
+ strlen(path)+ strlen(elt)+ strlen("/") +1,
+ char);
+
+ strcat(path, "/");
+ strcat(path, elt);
+ }
+ }
+ va_end(list);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_int(path, &value))
+ *keyword = value;
+
+ BFT_FREE(path);
+
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Return float parameters for lagrangian
+ *
+ * parameters:
+ * keyword <-- value of parameter
+ * nbr --> size of the labels list
+ * ... --> list of labels in the path
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_double(double *const keyword, const int nbr, ...)
+{
+ va_list list;
+
+ char *elt = NULL;
+ char *path;
+ double value = 0;
+ int i;
+
+ path = cs_xpath_init_path();
+
+ va_start(list, nbr);
+
+ for(i=0; i<nbr; i++) {
+
+ elt = va_arg(list, char *);
+
+ if (elt != NULL) {
+
+ BFT_REALLOC(path,
+ strlen(path)+ strlen(elt)+ strlen("/") +1,
+ char);
+
+ strcat(path, "/");
+ strcat(path, elt);
+ }
+ }
+ va_end(list);
+
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &value))
+ *keyword = value;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return value of the attribute of the character type for larangian
+ *
+ * parameters:
+ * param <-- name of the attribute
+ * nbr --> size of the labels list
+ * ... --> list of labels in the path
+ *----------------------------------------------------------------------------*/
+
+static char*
+_get_attr(const char *const param, const int nbr, ...)
+{
+ va_list list;
+
+ int i;
+ char *elt = NULL;
+ char *path;
+ char *name;
+
+ path = cs_xpath_init_path();
+
+ va_start(list, nbr);
+
+ for(i=0; i<nbr; i++) {
+
+ elt = va_arg(list, char *);
+
+ if (elt != NULL) {
+
+ BFT_REALLOC(path,
+ strlen(path)+ strlen(elt)+ strlen("/") +1,
+ char);
+
+ strcat(path, "/");
+ strcat(path, elt);
+ }
+ }
+ va_end(list);
+
+ cs_xpath_add_attribute(&path, param);
+
+ name = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return name;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return float parameters for coal parameters
+ *
+ * parameters:
+ * param --> value to modify
+ * name --> name of property
+ * icoal --> number of coal
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_coal_double(double *const param, const char *const name, int icoal)
+{
+ double result = 0;
+ char *path = NULL;
+ char scoal[2];
+
+ sprintf(scoal, "%i", icoal);
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4, "lagrangian", "particles_models", "coal_fouling", name);
+ cs_xpath_add_test_attribute(&path, "coal", scoal);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &result))
+ *param = result;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return status and label of the property for post treatment
+ *
+ * parameters:
+ * type --> type of property ('volume' or 'boundary')
+ * name --> name of property
+ * list_value <-- status for listing
+ * record_value <-- status for post processing
+ *----------------------------------------------------------------------------*/
+
+static char*
+_get_char_post(const char *const type,
+ const char *const name,
+ int *list_value,
+ int *record_value)
+{
+ char *path, *path1, *path2 = NULL;
+ char *label = NULL;
+ int result;
+
+ *list_value = 1;
+ *record_value = 1;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4, "lagrangian", "statistics", type, "property");
+ cs_xpath_add_test_attribute(&path, "name", name);
+ BFT_MALLOC(path1, strlen(path)+1, char);
+ strcpy(path1, path);
+ BFT_MALLOC(path2, strlen(path)+1, char);
+ strcpy(path2, path);
+ cs_xpath_add_attribute(&path, "label");
+ label = cs_gui_get_attribute_value(path);
+
+ if (cs_gui_strcmp(type, "volume")) {
+
+ cs_xpath_add_element(&path1, "monitoring_point");
+ cs_xpath_add_attribute(&path1, "status");
+ if (cs_gui_get_status(path1, &result))
+ *list_value = result;
+ }
+
+ else if (cs_gui_strcmp(type, "boundary")) {
+
+ cs_xpath_add_element(&path1, "listing_printing");
+ cs_xpath_add_attribute(&path1, "status");
+ if (cs_gui_get_status(path1, &result))
+ *list_value = result;
+
+ cs_xpath_add_element(&path2, "postprocessing_recording");
+ cs_xpath_add_attribute(&path2, "status");
+ if (cs_gui_get_status(path2, &result))
+ *record_value = -1;
+ }
+
+ BFT_FREE(path);
+ BFT_FREE(path1);
+ BFT_FREE(path2);
+
+ return label;
+}
+
+/*-----------------------------------------------------------------------------
+ * Copy a variable name to the variable names array
+ *
+ * parameters:
+ * varname --> name or label of the variable/scalar/property
+ * ipp --> index from the fortran array associated to varname
+ *----------------------------------------------------------------------------*/
+
+static void
+_copy_mean_varname(char *varname, int ipp)
+{
+ size_t l;
+ assert(ipp > 0);
+
+ if (ipp < 1 || ipp > _last_mean_var+1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Variable index %i out of bounds (1 to %i)"),
+ ipp, _last_mean_var);
+
+ l = strlen(varname);
+
+ if (_array_mean_varname[ipp-1] == NULL)
+ BFT_MALLOC(_array_mean_varname[ipp-1], l + 1, char);
+
+ else if (strlen(_array_mean_varname[ipp-1]) != l)
+ BFT_REALLOC(_array_mean_varname[ipp-1], l + 1, char);
+
+ strcpy(_array_mean_varname[ipp-1], varname);
+}
+
+/*-----------------------------------------------------------------------------
+ * Copy a variable name to the variance variable names array
+ *
+ * parameters:
+ * varname --> name or label of the variable/scalar/property
+ * ipp --> index from the fortran array associated to varname
+ *----------------------------------------------------------------------------*/
+
+static void
+_copy_variance_varname(char *varname, int ipp)
+{
+ size_t l;
+ assert(ipp > 0);
+
+ if (ipp < 1 || ipp > _last_variance_var+1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Variable index %i out of bounds (1 to %i)"),
+ ipp, _last_variance_var);
+
+ l = strlen(varname);
+
+ if (_array_variance_varname[ipp-1] == NULL)
+ BFT_MALLOC(_array_variance_varname[ipp-1], l + 1, char);
+
+ else if (strlen(_array_variance_varname[ipp-1]) != l)
+ BFT_REALLOC(_array_variance_varname[ipp-1], l + 1, char);
+
+ strcpy(_array_variance_varname[ipp-1], varname);
+}
+
+/*-----------------------------------------------------------------------------
+ * Copy a variable name to the variance variable names array
+ *
+ * parameters:
+ * varname --> name or label of the variable/scalar/property
+ * ipp --> index from the fortran array associated to varname
+ *----------------------------------------------------------------------------*/
+
+static void
+_copy_boundary_varname(char *varname, int ipp)
+{
+ size_t l;
+ assert(ipp > 0);
+
+ if (ipp < 1 || ipp > _last_boundary_var+1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Variable index %i out of bounds (1 to %i)"),
+ ipp, _last_boundary_var);
+
+ l = strlen(varname);
+
+ if (_array_boundary_varname[ipp-1] == NULL)
+ BFT_MALLOC(_array_boundary_varname[ipp-1], l + 1, char);
+
+ else if (strlen(_array_boundary_varname[ipp-1]) != l)
+ BFT_REALLOC(_array_boundary_varname[ipp-1], l + 1, char);
+
+ strcpy(_array_boundary_varname[ipp-1], varname);
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fclag1, FCLAG1)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i, i1, i2, l;
+ char *cstr = NULL;
+
+ assert(*var_id > 0);
+
+ /* Resize array if necessary */
+
+ if (*var_id > _max_mean_vars) {
+
+ if (_max_mean_vars == 0)
+ _max_mean_vars = 16;
+
+ while (_max_mean_vars <= *var_id)
+ _max_mean_vars *= 2;
+
+ BFT_REALLOC(_array_mean_varname, _max_mean_vars, char *);
+ for (i = _last_mean_var; i < _max_mean_vars; i++)
+ _array_mean_varname[i] = NULL;
+ }
+
+ /* Compute string length (removing start or end blanks) */
+
+ for (i1 = 0;
+ i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
+ i1++);
+
+ for (i2 = *len - 1;
+ i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
+ i2--);
+
+ l = i2 - i1 + 1;
+
+ /* Should be called once per variable only */
+ assert(_array_mean_varname[*var_id - 1] == NULL);
+
+ if (l > 0) {
+
+ /* Allocate and copy */
+ BFT_MALLOC(cstr, l + 1, char);
+
+ for (i = 0 ; i < l ; i++, i1++)
+ cstr[i] = fstr[i1];
+
+ cstr[l] = '\0';
+
+ _array_mean_varname[*var_id - 1] = cstr;
+
+ }
+
+ /* Update variable counter */
+ _last_mean_var = *var_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fclag2, FCLAG2)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i, i1, i2, l;
+ char *cstr = NULL;
+
+ assert(*var_id > 0);
+
+ /* Resize array if necessary */
+
+ if (*var_id > _max_variance_vars) {
+
+ if (_max_variance_vars == 0)
+ _max_variance_vars = 16;
+
+ while (_max_variance_vars <= *var_id)
+ _max_variance_vars *= 2;
+
+ BFT_REALLOC(_array_variance_varname, _max_variance_vars, char *);
+ for (i = _last_variance_var; i < _max_variance_vars; i++)
+ _array_variance_varname[i] = NULL;
+ }
+
+ /* Compute string length (removing start or end blanks) */
+
+ for (i1 = 0;
+ i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
+ i1++);
+
+ for (i2 = *len - 1;
+ i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
+ i2--);
+
+ l = i2 - i1 + 1;
+
+ /* Should be called once per variable only */
+ assert(_array_variance_varname[*var_id - 1] == NULL);
+
+ if (l > 0) {
+
+ /* Allocate and copy */
+ BFT_MALLOC(cstr, l + 1, char);
+
+ for (i = 0 ; i < l ; i++, i1++)
+ cstr[i] = fstr[i1];
+
+ cstr[l] = '\0';
+
+ _array_variance_varname[*var_id - 1] = cstr;
+
+ }
+
+ /* Update variable counter */
+ _last_variance_var = *var_id;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fclag3, FCLAG3)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i, i1, i2, l;
+ char *cstr = NULL;
+
+ assert(*var_id > 0);
+
+ /* Resize array if necessary */
+
+ if (*var_id > _max_boundary_vars) {
+
+ if (_max_boundary_vars == 0)
+ _max_boundary_vars = 16;
+
+ while (_max_boundary_vars <= *var_id)
+ _max_boundary_vars *= 2;
+
+ BFT_REALLOC(_array_boundary_varname, _max_boundary_vars, char *);
+ for (i = _last_boundary_var; i < _max_boundary_vars; i++)
+ _array_boundary_varname[i] = NULL;
+ }
+
+ /* Compute string length (removing start or end blanks) */
+
+ for (i1 = 0;
+ i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
+ i1++);
+
+ for (i2 = *len - 1;
+ i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
+ i2--);
+
+ l = i2 - i1 + 1;
+
+ /* Should be called once per variable only */
+ assert(_array_boundary_varname[*var_id - 1] == NULL);
+
+ if (l > 0) {
+
+ /* Allocate and copy */
+ BFT_MALLOC(cstr, l + 1, char);
+
+ for (i = 0 ; i < l ; i++, i1++)
+ cstr[i] = fstr[i1];
+
+ cstr[l] = '\0';
+
+ _array_boundary_varname[*var_id - 1] = cstr;
+
+ }
+
+ /* Update variable counter */
+ _last_boundary_var = *var_id;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from C to Fortran
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(cfname, CFNAME)
+(
+ int *const flag, /* --> flag for array = 1, 2, or 3 */
+ char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i;
+ int l = 0;
+ char *cstr = NULL;
+
+ assert( *flag==1 || *flag==2 || *flag==3 );
+
+ /* Check that variable name was set and copy string */
+
+ switch(*flag) {
+ case 1:
+ if (*var_id < 1 || *var_id > _last_mean_var)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Name of variable %i was never set.\n"), *var_id);
+ cstr = _array_mean_varname[*var_id - 1];
+ break;
+ case 2:
+ if (*var_id < 1 || *var_id > _last_variance_var)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Name of variable %i was never set.\n"), *var_id);
+ cstr = _array_variance_varname[*var_id - 1];
+ break;
+ case 3:
+ if (*var_id < 1 || *var_id > _last_boundary_var)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Name of variable %i was never set.\n"), *var_id);
+ cstr = _array_boundary_varname[*var_id - 1];
+ break;
+ }
+
+ if (cstr != NULL) {
+
+ /* Compute string length (removing start or end blanks) */
+
+ l = strlen(cstr);
+ if (l > *len)
+ l = *len;
+
+ for (i = 0; i < l; i++)
+ fstr[i] = cstr[i];
+
+ }
+
+ /* Pad with blanks if necessary */
+
+ for (i = l; i < *len; i++)
+ fstr[i] = ' ';
+}
+
+/*----------------------------------------------------------------------------
+ * Fortran Interface:
+ *
+ * SUBROUTINE UILAG1
+ * *****************
+ *
+ * INTEGER IILAGR <-- type of lagrangian model used
+ * INTEGER ISUILA <-- lagrangian restart
+ * INTEGER ISUIST <-- lagrangian restart for statistics
+ * INTEGER NBPMAX <-- maximum number of particles
+ * INTEGER ISTTIO <-- stationnary calculus
+ * INTEGER INJCON <-- continuous injection of particles
+ * INTEGER IPHYLA <-- physical model for particles
+ * INTEGER IDPVAR <-- equation on diameter if iphyla = 1
+ * INTEGER IMPVAR <-- equation on mass if iphyla = 1
+ * INTEGER ITPVAR <-- equation on temperature if iphyla = 1
+ * INTEGER IENCRA <-- coal fouliing if iphyla = 2
+ * DOUBLE TPRENC <-- particle coal temperature if iphyla = 2
+ * DOUBLE VISREF <-- particle critical viscosity if iphyla = 2
+ * DOUBLE ENC1 <-- Watt and Fereday coefficient 1
+ * DOUBLE ENC2 <-- Watt and Fereday coefficient 2
+ * INTEGER NSTITS <-- iteration number for instationnary
+ * INTEGER LTSDYN <-- reverse coupling on dynamic
+ * INTEGER LTSMAS <-- reverse coupling on mass
+ * INTEGER LTSTHE <-- reverse coupling on temperature
+ * INTEGER NORDRE <-- stochastic differential equation order
+ * INTEGER IDISTU <-- particle turbulent dispersion
+ * INTEGER IDIFFL <-- particle fluid diffusion
+ * INTEGER MODCPL <-- complete turbulent dispersion model
+ * INTEGER IDIRLA <-- direction of the complete model
+ * INTEGER IENSI1 <-- post-processing in trajectory mode
+ * INTEGER IENSI2 <-- post-processing in movement mode
+ * INTEGER NTLAL <-- listing printing frequency
+ * INTEGER NBVIS <-- number of particles for display
+ * INTEGER NVISLA <-- output period for post-processing
+ * INTEGER IVISV1 <-- display of variable 'fluid velocity'
+ * INTEGER IVISV2 <-- display of variable 'particles velocity'
+ * INTEGER IVISTP <-- display of variable 'resident time'
+ * INTEGER IVISDM <-- display of variable 'particle diameter'
+ * INTEGER IVISTE <-- display of variable 'particle temperature'
+ * INTEGER IVISMP <-- display of variable 'particle mass'
+ * INTEGER IVISHP <-- display of variable 'coal temp. particle'
+ * INTEGER IVISDK <-- display of variable 'core diameter of part.'
+ * INTEGER IVISCH <-- display of variable 'mass of reactive coal'
+ * INTEGER IVISCK <-- display of variable 'mass of char'
+ * INTEGER ISTALA <-- calculation of volumic statistics
+ * INTEGER NBCLST <-- number of particle clusters
+ * INTEGER SEUIL <-- limit statistical weight value for volumic stat.
+ * INTEGER IDSTNT <-- iteration number for volumic statistics
+ * CHAR NOMLAG <-- mean variable name of volumic statistics
+ * CHAR NOMLAV <-- variance variable name of volumic statistics
+ * INTEGER IHSLAG <-- output of variable
+ * INTEGER IENSI3 <-- calculation of boundaries statistics
+ * INTEGER SEUILF <-- limit statistical weight value for boundaries stat.
+ * INTEGER NSTBOR <-- iteration number for boundaries statistics
+ * INTEGER INBRBD <-- recording of particle/boundary interactions
+ * INTEGER IFLMBD <-- recording of mass flow related to interactions
+ * INTEGER IANGBD <-- recording of angle between particle traj./boundary
+ * INTEGER IVITBD <-- recording of velocity of particle in an interaction
+ * INTEGER IENCBD <-- recording of mass of coal particles
+ * CHAR NOMBRD <-- variable name of boundaries statistics
+ * INTEGER IMOYBR <-- cumulated value for particule/boundary interaction
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uilag1, UILAG1) (int *const iilagr,
+ int *const isuila,
+ int *const isuist,
+ int *const nbpmax,
+ int *const isttio,
+ int *const injcon,
+ int *const iphyla,
+ int *const idpvar,
+ int *const itpvar,
+ int *const impvar,
+ int *const iencra,
+ double tprenc[],
+ double visref[],
+ double enc1[],
+ double enc2[],
+ int *const nstits,
+ int *const ltsdyn,
+ int *const ltsmas,
+ int *const ltsthe,
+ int *const nordre,
+ int *const idistu,
+ int *const idiffl,
+ int *const modcpl,
+ int *const idirla,
+ int *const iensi1,
+ int *const iensi2,
+ int *const ntlal,
+ int *const nbvis,
+ int *const nvisla,
+ int *const ivisv1,
+ int *const ivisv2,
+ int *const ivistp,
+ int *const ivisdm,
+ int *const iviste,
+ int *const ivismp,
+ int *const ivishp,
+ int *const ivisdk,
+ int *const ivisch,
+ int *const ivisck,
+ int *const istala,
+ int *const nbclst,
+ double *const seuil,
+ int *const idstnt,
+ int ihslag[],
+ int *const iensi3,
+ double *const seuilf,
+ int *const nstbor,
+ int *const inbrbd,
+ int *const iflmbd,
+ int *const iangbd,
+ int *const ivitbd,
+ int *const iencbd,
+ int imoybr[])
+{
+ int i, icoal, ncoals = 0;
+ int list_ind, record_ind = 1;
+ char *label = NULL;
+ char *attr = NULL;
+ char *path1 = NULL;
+ char *fmt, *opt;
+
+ attr = _get_attr("model", 1, "lagrangian");
+ if (attr == NULL || cs_gui_strcmp(attr, "off"))
+ {
+ *iilagr = 0;
+#if _XML_DEBUG_
+ bft_printf("==>UILAG1\n");
+ bft_printf("--iilagr = %i\n", *iilagr);
+#endif
+ BFT_FREE(attr);
+ return;
+ }
+
+ /* Global settings */
+
+ _get_particles_model("coupling_mode", iilagr);
+ _get_status(isuila, 2, "lagrangian", "restart");
+ _get_status(isttio, 2, "lagrangian", "carrier_field_stationary");
+ _get_status(injcon, 2, "lagrangian", "continuous_injection");
+ _get_int(nbpmax, 2, "lagrangian", "particles_max_number");
+
+ /* Particles model */
+
+ _get_particles_model("particles_models", iphyla);
+
+ switch (*iphyla) {
+ case 1:
+ _get_status(idpvar, 3, "lagrangian", "particles_models", "break_up");
+ _get_status(impvar, 3, "lagrangian", "particles_models", "evaporation");
+ _get_status(itpvar, 3, "lagrangian", "particles_models", "thermal");
+// if (*itpvar == 1) {
+// _get_double(tpart, 4, "lagrangian", "particles_models", "thermal", "particle_temperature");
+// _get_double(cppart, 4, "lagrangian", "particles_models", "thermal", "particle_specific_heat");
+// }
+ break;
+ case 2:
+ _get_status(iencra, 3, "lagrangian", "particles_models", "coal_fouling");
+ path1 = cs_xpath_init_path();
+ cs_xpath_add_elements(&path1, 4, "lagrangian", "particles_models", "coal_fouling", "threshold_temperature");
+ ncoals = cs_gui_get_nb_element(path1);
+ BFT_FREE(path1);
+
+ for (icoal=1; icoal <= ncoals; icoal++)
+ {
+ _get_coal_double(&tprenc[icoal-1], "threshold_temperature", icoal);
+ _get_coal_double(&visref[icoal-1], "critical_viscosity", icoal);
+ _get_coal_double(&enc1[icoal-1], "fouling_coefficient_1", icoal);
+ _get_coal_double(&enc2[icoal-1], "fouling_coefficient_2", icoal);
+ }
+ break;
+ }
+
+ /* Two-way coupling */
+
+ if (*iilagr == 2) {
+ _get_int(nstits, 3, "lagrangian", "two_way_coupling", "iteration_start");
+ _get_status(ltsdyn, 3, "lagrangian", "two_way_coupling", "dynamic");
+ _get_status(ltsmas, 3, "lagrangian", "two_way_coupling", "mass");
+ _get_status(ltsthe, 3, "lagrangian", "two_way_coupling", "thermal");
+ }
+
+ /* Numerical modeling */
+
+ attr = _get_attr("choice", 2, "lagrangian", "scheme_order");
+ if (attr) {
+ *nordre = atoi(attr);
+ BFT_FREE(attr);
+ }
+ attr = _get_attr("choice", 2, "lagrangian", "complete_model_direction");
+ if (attr) {
+ *idirla = atoi(attr);
+ BFT_FREE(attr);
+ }
+ _get_status(idistu, 2, "lagrangian", "turbulent_dispersion");
+ _get_status(idiffl, 2, "lagrangian", "fluid_particles_turbulent_diffusion");
+ _get_int(modcpl, 2, "lagrangian", "complete_model");
+
+ /* Output */
+
+ _get_status(iensi1, 3, "lagrangian", "output", "trajectory");
+ _get_status(iensi2, 3, "lagrangian", "output", "particles");
+ _get_status(ivisv1, 3, "lagrangian", "output", "velocity_fluid_seen");
+ _get_status(ivisv2, 3, "lagrangian", "output", "velocity_particles");
+ _get_status(ivistp, 3, "lagrangian", "output", "resident_time");
+ _get_status(ivisdm, 3, "lagrangian", "output", "diameter");
+ _get_status(iviste, 3, "lagrangian", "output", "temperature");
+ _get_status(ivismp, 3, "lagrangian", "output", "mass");
+
+ if (*iphyla == 2) {
+ _get_status(ivishp, 3, "lagrangian", "output", "coal_temperature");
+ _get_status(ivisdk, 3, "lagrangian", "output", "shrinking_core_diameter");
+ _get_status(ivisch, 3, "lagrangian", "output", "raw_coal_mass_fraction");
+ _get_status(ivisck, 3, "lagrangian", "output", "char_mass_fraction");
+ }
+
+ _get_int(nbvis, 3, "lagrangian", "output", "number_of_particles");
+ _get_int(nvisla, 3, "lagrangian", "output", "postprocessing_frequency");
+ _get_int(ntlal, 3, "lagrangian", "output", "listing_printing_frequency");
+ fmt = _get_attr("choice", 3, "lagrangian", "output", "postprocessing_format");
+ opt = _get_attr("choice", 3, "lagrangian", "output", "postprocessing_options");
+ BFT_FREE(fmt);
+ BFT_FREE(opt);
+
+ /* Statistics */
+
+ _get_int(nbclst, 3, "lagrangian", "statistics", "statistics_groups_of_particles");
+ _get_status(isuist, 3, "lagrangian", "statistics", "restart");
+ _get_status(istala, 3, "lagrangian", "statistics", "volume");
+
+ if (*istala == 1) {
+ _get_double(seuil, 4, "lagrangian", "statistics", "volume", "threshold_volume");
+ _get_int(idstnt, 4, "lagrangian", "statistics", "volume", "iteration_start_volume");
+
+ /* labels */
+
+ label = _get_char_post("volume", "mean_velocity_U", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, 1);
+ ihslag[1] = list_ind;
+
+ label = _get_char_post("volume", "variance_velocity_U", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, 1);
+
+ label = _get_char_post("volume", "mean_velocity_V", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, 2);
+ ihslag[2] = list_ind;
+
+ label = _get_char_post("volume", "variance_velocity_V", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, 2);
+
+ label = _get_char_post("volume", "mean_velocity_W", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, 3);
+ ihslag[3] = list_ind;
+
+ label = _get_char_post("volume", "variance_velocity_W", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, 3);
+
+ label = _get_char_post("volume", "mean_mass_fraction", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, 4);
+ ihslag[4] = list_ind;
+
+ label = _get_char_post("volume", "variance_mass_fraction", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, 4);
+
+ label = _get_char_post("volume", "mean_resident_time", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, 5);
+ ihslag[5] = list_ind;
+
+ label = _get_char_post("volume", "variance_resident_time", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, 5);
+
+ i = 5;
+
+ if (*iphyla == 1) {
+
+ if (*itpvar == 1) {
+ i++;
+ label = _get_char_post("volume", "mean_temperature", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, i);
+ ihslag[i] = list_ind;
+
+ label = _get_char_post("volume", "variance_temperature", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, i);
+ }
+
+ if (*idpvar == 1) {
+ i++;
+ label = _get_char_post("volume", "mean_diameter", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, i);
+ ihslag[i] = list_ind;
+
+ label = _get_char_post("volume", "variance_diameter", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, i);
+ }
+ }
+
+ else if (*iphyla == 2) {
+ /*
+ i++;
+ label = _get_char_post("volume", "coal_temperature", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, i);
+
+ label = _get_char_post("volume", "coal_temperature", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, i);
+ */
+ i++;
+ label = _get_char_post("volume", "mean_shrinking_core_diameter", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, i);
+ ihslag[i] = list_ind;
+
+ label = _get_char_post("volume", "variance_shrinking_core_diameter", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, i);
+
+ i++;
+ label = _get_char_post("volume", "mean_raw_coal_mass_fraction", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, i);
+ ihslag[i] = list_ind;
+
+ label = _get_char_post("volume", "variance_raw_coal_mass_fraction", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, i);
+
+ i++;
+ label = _get_char_post("volume", "mean_char_mass_fraction", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, i);
+ ihslag[i] = list_ind;
+
+ label = _get_char_post("volume", "variance_char_mass_fraction", &list_ind, &record_ind);
+ if (label) _copy_variance_varname(label, i);
+ }
+
+ i++;
+ label = _get_char_post("volume", "statistical_weight", &list_ind, &record_ind);
+ if (label) _copy_mean_varname(label, i);
+ ihslag[i] = list_ind;
+ }
+
+ _get_status(iensi3, 3, "lagrangian", "statistics", "boundary");
+
+ if (*iensi3 == 1) {
+
+ _get_double(seuilf, 4, "lagrangian", "statistics", "boundary", "threshold_boundary");
+ _get_int(nstbor, 4, "lagrangian", "statistics", "boundary", "iteration_start_boundary");
+
+ i = 0;
+
+ label = _get_char_post("boundary", "impacts", inbrbd, &record_ind);
+ if (*inbrbd) {
+ i++;
+ if (label) _copy_boundary_varname(label, i);
+ imoybr[i] = record_ind;
+ }
+
+ label = _get_char_post("boundary", "mass_flux", iflmbd, &record_ind);
+ if (*iflmbd) {
+ i++;
+ if (label) _copy_boundary_varname(label, i);
+ imoybr[i] = record_ind;
+ }
+
+ label = _get_char_post("boundary", "angle", iangbd, &record_ind);
+ if (*iangbd) {
+ i++;
+ if (label) _copy_boundary_varname(label, i);
+ imoybr[i] = record_ind;
+ }
+
+ label = _get_char_post("boundary", "velocity", ivitbd, &record_ind);
+ if (*ivitbd) {
+ i++;
+ if (label) _copy_boundary_varname(label, i);
+ imoybr[i] = record_ind;
+ }
+ label = _get_char_post("boundary", "coal_fouling", iencbd, &record_ind);
+ if (*iencbd) {
+ i++;
+ if (label) _copy_boundary_varname(label, i);
+ imoybr[i] = record_ind;
+ }
+ }
+ BFT_FREE(label);
+
+#if _XML_DEBUG_
+ bft_printf("==>UILAG1\n");
+ bft_printf("--iilagr = %i\n", *iilagr);
+ bft_printf("--isuila = %i\n", *isuila);
+ bft_printf("--isttio = %i\n", *isttio);
+ bft_printf("--nbpmax = %i\n", *nbpmax);
+ bft_printf("--isttio = %i\n", *isttio);
+ bft_printf("--injcon = %i\n", *injcon);
+ bft_printf("--iphyla = %i\n", *iphyla);
+ switch(*iphyla) {
+ case 0:
+ break;
+ case 1:
+ bft_printf("--idpvar = %i\n", *idpvar);
+ bft_printf("--impvar = %i\n", *impvar);
+ bft_printf("--itpvar = %i\n", *itpvar);
+ break;
+ case 2:
+ bft_printf("--iencra = %i\n", *iencra);
+ for (icoal=1; icoal<=ncoals; icoal++)
+ {
+ bft_printf("--tprenc[%i] = %f\n", icoal, tprenc[icoal-1]);
+ bft_printf("--visref[%i] = %f\n", icoal, visref[icoal-1]);
+ bft_printf("--enc1[%i] = %f\n", icoal, enc1[icoal-1]);
+ bft_printf("--enc2[%i] = %f\n", icoal, enc2[icoal-1]);
+ }
+ break;
+ }
+
+ if (*iilagr == 2) {
+ bft_printf("--nstits = %i\n", *nstits);
+ bft_printf("--ltsdyn = %i\n", *ltsdyn);
+ bft_printf("--ltsmas = %i\n", *ltsmas);
+ bft_printf("--ltsthe = %i\n", *ltsthe);
+ }
+
+ bft_printf("--nordre = %i\n", *nordre);
+ bft_printf("--idistu = %i\n", *idistu);
+ bft_printf("--idiffl = %i\n", *idiffl);
+ bft_printf("--modcpl = %i\n", *modcpl);
+ bft_printf("--idirla = %i\n", *idirla);
+
+ bft_printf("--iensi1 = %i\n", *iensi1);
+ bft_printf("--iensi2 = %i\n", *iensi2);
+ bft_printf("--ivisv1 = %i\n", *ivisv1);
+ bft_printf("--ivisv2 = %i\n", *ivisv2);
+ bft_printf("--ivistp = %i\n", *ivistp);
+ bft_printf("--ivisdm = %i\n", *ivisdm);
+ bft_printf("--iviste = %i\n", *iviste);
+ bft_printf("--ivismp = %i\n", *ivismp);
+
+ if (*iphyla == 2) {
+ bft_printf("--ivishp = %i\n", *ivishp);
+ bft_printf("--ivisdk = %i\n", *ivisdk);
+ bft_printf("--ivisch = %i\n", *ivisch);
+ bft_printf("--ivisck = %i\n", *ivisck);
+ }
+
+ bft_printf("--nbvis = %i\n", *nbvis);
+ bft_printf("--nvisla = %i\n", *nvisla);
+
+ bft_printf("--isuist = %i\n", *isuist);
+ bft_printf("--nbclst = %i\n", *nbclst);
+
+ bft_printf("--istala = %i\n", *istala);
+ if (*istala == 1) {
+ bft_printf("--idstnt = %i\n", *idstnt);
+ bft_printf("--seuil = %f\n", *seuil);
+
+ /*
+ bft_printf("--i nomlag nomlav ihslag\n");
+ for (i=1; i <= 5; i++)
+ bft_printf(" %i %30s %30s %5i\n", i, nomlag[i], nomlav[i], ihslag[i]);
+ i = 5;
+ if (*iphyla == 1) {
+ if (*itpvar == 1) {
+ i++;
+ bft_printf(" %i %s %s \n", i, nomlag[i], nomlav[i]);
+ }
+ if (*idpvar == 1) {
+ i++;
+ bft_printf(" %i %s %s \n", i, nomlag[i], nomlav[i]);
+ }
+ }
+ else if (*iphyla == 2) {
+ //i++;
+ //bft_printf(" %i %s %s \n", i, nomlag[i], nomlav[i]);
+ i++;
+ bft_printf(" %i %s %s \n", i, nomlag[i], nomlav[i]);
+ i++;
+ bft_printf(" %i %s %s \n", i, nomlag[i], nomlav[i]);
+ i++;
+ bft_printf(" %i %s %s \n", i, nomlag[i], nomlav[i]);
+ }
+ i++;
+ bft_printf(" %i %s \n", i, nomlag[i]);
+ */
+ }
+
+ bft_printf("--iensi3 = %i\n", *iensi3);
+ if (*iensi3 == 1) {
+ bft_printf("--nstbor = %i\n", *nstbor);
+ bft_printf("--seuilf = %f\n", *seuilf);
+ bft_printf("--inbrbd = %i\n", *inbrbd);
+ bft_printf("--iflmbd = %i\n", *iflmbd);
+ bft_printf("--iangbd = %i\n", *iangbd);
+ bft_printf("--ivitbd = %i\n", *ivitbd);
+ bft_printf("--iencbd = %i\n", *iencbd);
+ }
+
+#endif
+
+}
+
+/*-----------------------------------------------------------------------------
+ * Fortran Interface:
+ *
+ * subroutine uilag2
+ * *****************
+ *
+ * integer nfabor --> number of boundary faces
+ * integer nozppm --> max number of boundary conditions zone
+ * integer nclagm --> max number of classes
+ * integer nflagm --> max number of boundaries
+ * integer iphyla --> physica model associated to the particles
+ * integer iusncl <-- array for particles class(es) number
+ * integer iusclb <-- array for particles boundary conditions
+ * integer iuslag <-- array for integer variables
+ * double precision ruslag <-- array for real variables
+ *----------------------------------------------------------------------------*/
+
+
+void CS_PROCF (uilag2, UILAG2) (const int *const nfabor,
+ const int *const nozppm,
+ const int *const nclagm,
+ const int *const nflagm,
+ const int *const nbclst,
+ const int *const ientrl,
+ const int *const isortl,
+ const int *const idepo1,
+ const int *const idepo2,
+ const int *const idepo3,
+ const int *const idepfa,
+ const int *const iencrl,
+ const int *const irebol,
+ const int *const iphyla,
+ const int *const ijnbp,
+ const int *const ijfre,
+ const int *const iclst,
+ const int *const ijuvw,
+ const int *const iuno,
+ const int *const iupt,
+ const int *const ivpt,
+ const int *const iwpt,
+ const int *const ijprpd,
+ const int *const ipoit,
+ const int *const idebt,
+ const int *const ijprdp,
+ const int *const idpt,
+ const int *const ivdpt,
+ const int *const iropt,
+ const int *const ijprtp,
+ const int *const itpt,
+ const int *const icpt,
+ const int *const iepsi,
+ const int *const ihpt,
+ const int *const inuchl,
+ const int *const imcht,
+ const int *const imckt,
+ int ichcor[],
+ int cp2ch[],
+ int diam20[],
+ int rho0ch[],
+ int xashch[],
+ int ifrlag[],
+ int iusncl[],
+ int iusclb[],
+ int iuslag[],
+ double ruslag[])
+{
+ int izone, zones;
+ int iclas;
+ int ielt, ifac, nelt = 0;
+ char *interaction = NULL;
+ char sclass[10];
+ char *path1, *path2;
+ char *choice;
+ int *faces_list = NULL;
+
+ zones = cs_gui_boundary_zones_number();
+
+ /* First iteration only: memory allocation */
+
+// if (boundaries == NULL)
+// _init_boundaries(nfabor, nozppm);
+
+
+ for (izone=0; izone < zones; izone++) {
+
+ faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor, *nozppm, &nelt);
+
+ for ( ielt=0; ielt < nelt; ielt++ ) {
+ ifac = faces_list[ielt];
+ ifrlag[ifac-1] = izone+1;
+ }
+
+ path2 = cs_xpath_init_path();
+ cs_xpath_add_elements(&path2, 2, "boundary_conditions", boundaries->nature[izone]);
+ cs_xpath_add_test_attribute(&path2, "label", boundaries->label[izone]);
+ cs_xpath_add_element(&path2, "particles");
+
+ BFT_MALLOC(path1, strlen(path2)+1, char);
+ strcpy(path1, path2);
+ cs_xpath_add_attribute(&path1, "choice");
+ interaction = cs_gui_get_attribute_value(path1);
+
+ if (interaction != NULL) {
+
+ if (cs_gui_strcmp(interaction, "inlet")) {
+
+ iusclb[izone] = *ientrl;
+ strcpy(path1, path2);
+ cs_xpath_add_element(&path1, "class");
+ iusncl[izone] = cs_gui_get_nb_element(path1);
+ strcpy(path1, path2);
+
+ for (iclas=0; iclas < iusncl[izone]; iclas++) {
+
+ sprintf(sclass, "class[%i]", iclas+1);
+ BFT_REALLOC(path2, 20+strlen(boundaries->nature[izone])+10+strlen(boundaries->label[izone])+13+strlen(sclass)+1, char);
+ strcpy(path2, "");
+ sprintf(path2,
+ "boundary_conditions/%s[@label='%s']/particles/%s",
+ boundaries->nature[izone],
+ boundaries->label[izone],
+ sclass);
+
+ _get_int(&IUSLAG((*ijnbp -1), izone, iclas), 2, path2, "number");
+ _get_int(&IUSLAG((*ijfre -1), izone, iclas), 2, path2, "frequency");
+ _get_int(&IUSLAG((*iclst -1), izone, iclas), 2, path2, "statistical_groups");
+
+ /* velocity */
+
+ choice = _get_attr("choice", 2, path2, "velocity");
+
+ if (cs_gui_strcmp(choice, "fluid"))
+ //iuslag[3*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = -1;
+ IUSLAG((*ijuvw -1), izone, iclas) = -1;
+
+ else if (cs_gui_strcmp(choice, "norm")) {
+ IUSLAG((*ijuvw -1), izone, iclas) = 0;
+ //_get_double(&ruslag[1*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "norm");
+ _get_double(&RUSLAG((*iuno -1), izone, iclas), 3, path2, "velocity", "norm");
+ }
+ else if (cs_gui_strcmp(choice, "components")) {
+ //_get_double(&ruslag[1*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "velocity_x");
+ //_get_double(&ruslag[2*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "velocity_y");
+ //_get_double(&ruslag[3*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "velocity_z");
+ IUSLAG((*ijuvw -1), izone, iclas) = 1;
+ _get_double(&RUSLAG((*iupt -1), izone, iclas), 3, path2, "velocity", "velocity_x");
+ _get_double(&RUSLAG((*ivpt -1), izone, iclas), 3, path2, "velocity", "velocity_y");
+ _get_double(&RUSLAG((*iwpt -1), izone, iclas), 3, path2, "velocity", "velocity_z");
+ }
+ else if (cs_gui_strcmp(choice, "subroutine"))
+ IUSLAG((*ijuvw -1), izone, iclas) = 2;
+
+ /* statistical_weight, mass_flow_rate*/
+
+ choice = _get_attr("choice", 2, path2, "statistical_weight");
+
+ if (cs_gui_strcmp(choice, "prescribed")) {
+ //iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1;
+ //_get_double(&ruslag[10*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "statistical_weight");
+ IUSLAG((*ijprpd -1), izone, iclas) = 1;
+ _get_double(&RUSLAG((*ipoit -1), izone, iclas), 2, path2, "statistical_weight");
+ RUSLAG((*idebt -1), izone, iclas) = 0;
+ }
+ else if (cs_gui_strcmp(choice, "rate")) {
+ //iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1;
+ //_get_double(&ruslag[11*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "mass_flow_rate");
+ IUSLAG((*ijprpd -1), izone, iclas) = 1;
+ _get_double(&RUSLAG((*idebt -1), izone, iclas), 2, path2, "mass_flow_rate");
+ RUSLAG((*ipoit -1), izone, iclas) = 1;
+ }
+ else if (cs_gui_strcmp(choice, "subroutine")) {
+ //iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 2;
+ //_get_double(&ruslag[10*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "statistical_weight");
+ IUSLAG((*ijprpd -1), izone, iclas) = 2;
+ _get_double(&RUSLAG((*ipoit -1), izone, iclas), 2, path2, "statistical_weight");
+ RUSLAG((*idebt -1), izone, iclas) = 0;
+ }
+
+ /* diameter */
+
+ choice = _get_attr("choice", 2, path2, "diameter");
+
+ if (cs_gui_strcmp(choice, "prescribed")) {
+ //iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1;
+ //_get_double(&ruslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "diameter");
+ //_get_double(&ruslag[6*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "diameter_standard_deviation");
+ IUSLAG((*ijprdp -1), izone, iclas) = 1;
+ _get_double(&RUSLAG((*idpt -1), izone, iclas), 2, path2, "diameter");
+ _get_double(&RUSLAG((*ivdpt -1), izone, iclas), 2, path2, "diameter_standard_deviation");
+
+ }
+ else if (cs_gui_strcmp(choice, "subroutine"))
+ IUSLAG((*ijprdp -1), izone, iclas) = 2;
+
+ /* density */
+
+ //_get_double(&ruslag[7*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "density");
+ _get_double(&RUSLAG((*iropt -1), izone, iclas), 2, path2, "density");
+
+ if (*iphyla == 1) {
+
+ /* temperature, specific_heat, emissivity */
+
+ choice = _get_attr("choice", 2, path2, "temperature");
+
+ if (cs_gui_strcmp(choice, "prescribed")) {
+ //iuslag[4*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1;
+ //_get_double(&ruslag[4*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "temperature");
+ IUSLAG((*ijprtp -1), izone, iclas) = 1;
+ _get_double(&RUSLAG((*itpt -1), izone, iclas), 2, path2, "temperature");
+ }
+ else if (cs_gui_strcmp(choice, "subroutine"))
+ IUSLAG((*ijprtp -1), izone, iclas) = 2;
+
+ //_get_double(&ruslag[8*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "specific_heat");
+ //_get_double(&ruslag[9*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "emissivity");
+ _get_double(&RUSLAG((*icpt -1), izone, iclas), 2, path2, "specific_heat");
+ _get_double(&RUSLAG((*iepsi -1), izone, iclas), 2, path2, "emissivity");
+ }
+
+ /* coal */
+
+ if (*iphyla == 2) {
+ //_get_int(&iuslag[6*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "coal_number");
+ //_get_double(&ruslag[12*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "coal_temperature");
+ //_get_double(&ruslag[13*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "raw_coal_mass_fraction");
+ //_get_double(&ruslag[14*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "char_mass_fraction");
+ _get_int(&IUSLAG((*inuchl -1), izone, iclas), 2, path2, "coal_number");
+ _get_double(&RUSLAG((*ihpt -1), izone, iclas), 2, path2, "coal_temperature");
+ _get_double(&RUSLAG((*imcht -1), izone, iclas), 2, path2, "raw_coal_mass_fraction");
+ _get_double(&RUSLAG((*imckt -1), izone, iclas), 2, path2, "char_mass_fraction");
+ }
+ }
+ }
+
+ else if(cs_gui_strcmp(interaction, "outlet"))
+ iusclb[izone] = *isortl;
+
+ else if(cs_gui_strcmp(interaction, "bounce"))
+ iusclb[izone] = *irebol;
+
+ else if(cs_gui_strcmp(interaction, "deposit1"))
+ iusclb[izone] = *idepo1;
+
+ else if(cs_gui_strcmp(interaction, "deposit2"))
+ iusclb[izone] = *idepo2;
+
+ else if(cs_gui_strcmp(interaction, "deposit3"))
+ iusclb[izone] = *idepo3;
+
+ else if(cs_gui_strcmp(interaction, "fouling") && *iphyla == 2)
+ iusclb[izone] = *iencrl;
+
+ else if(cs_gui_strcmp(interaction, "fouling") && (*iphyla == 0 || *iphyla == 1))
+ iusclb[izone] = *idepfa;
+
+ }
+ BFT_FREE(path1);
+ BFT_FREE(path2);
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>UILAG2\n");
+ for (izone=0; izone<zones; izone++) {
+
+ bft_printf("--iusclb[%i] = %i has %i class(es) \n", izone, iusclb[izone], iusncl[izone]);
+
+ for (iclas=0; iclas < iusncl[izone]; iclas++) {
+
+ bft_printf("--zone %i : class number %i \n", izone, iusncl[izone]);
+ bft_printf("-- : label %s \n", boundaries->label[izone]);
+ bft_printf("-- : nature %s \n", boundaries->nature[izone]);
+ bft_printf("-- : p_nature %i \n", iusclb[izone]);
+
+ if ( (iusclb[izone] == *ientrl) && (iusncl[izone] != 0) ) {
+ bft_printf("---number = %i \n", IUSLAG((*ijnbp -1), izone, iclas));
+ bft_printf("---frequency = %i \n", IUSLAG((*ijfre -1), izone, iclas));
+ bft_printf("---statistical_groups = %i \n", IUSLAG((*iclst -1), izone, iclas));
+
+ bft_printf("---velocity choice: %i (-1: fluid, 0: norm, 1: components, 2: subroutine)\n", IUSLAG((*ijuvw -1), izone, iclas));
+
+ if (IUSLAG((*ijuvw -1), izone, iclas) == 0)
+
+ bft_printf("----norm = %f \n", RUSLAG((*iuno -1), izone, iclas));
+
+ else if (IUSLAG((*ijuvw -1), izone, iclas) == 1) {
+
+ bft_printf("----u = %f \n", RUSLAG((*iupt -1), izone, iclas));
+ bft_printf("----v = %f \n", RUSLAG((*ivpt -1), izone, iclas));
+ bft_printf("----w = %f \n", RUSLAG((*iwpt -1), izone, iclas));
+ }
+
+ bft_printf("---statistical weight choice: %i (1: prescribed, 2: subroutine)\n", IUSLAG((*ijprpd -1), izone, iclas));
+
+ if (IUSLAG((*ijprpd -1), izone, iclas) == 1) {
+ bft_printf("----statistical weight = %f \n", RUSLAG((*ipoit -1), izone, iclas));
+ bft_printf("----mass flow rate = %f \n", RUSLAG((*idebt -1), izone, iclas));
+ }
+
+ bft_printf("---diameter choice = %i (1: prescribed, 2: subroutine)\n", IUSLAG((*ijprdp -1), izone, iclas));
+
+ if (IUSLAG((*ijprdp -1), izone, iclas) == 1) {
+ bft_printf("----diameter = %f \n", RUSLAG((*idpt -1), izone, iclas));
+ bft_printf("----standard deviation = %f \n", RUSLAG((*ivdpt -1), izone, iclas));
+ }
+
+ bft_printf("---density = %f \n", RUSLAG((*iropt -1), izone, iclas));
+
+ if (*iphyla == 1) {
+
+ bft_printf("---temperature choice = %i (1: prescribed, 2: subroutine)\n", IUSLAG((*ijprtp -1), izone, iclas));
+
+ if (IUSLAG((*ijprtp -1), izone, iclas) == 1)
+ bft_printf("----temperature = %f \n", RUSLAG((*itpt -1), izone, iclas));
+
+ bft_printf("---specific heat = %f \n", RUSLAG((*icpt -1), izone, iclas));
+ bft_printf("---emissivity = %f \n", RUSLAG((*iepsi -1), izone, iclas));
+ }
+
+ if (*iphyla == 2) {
+ bft_printf("---coal number = %i \n", IUSLAG((*inuchl -1), izone, iclas));
+ bft_printf("---coal temperature = %f \n", RUSLAG((*ihpt -1), izone, iclas));
+ bft_printf("---raw coal mass fraction = %f \n", RUSLAG((*imcht -1), izone, iclas));
+ bft_printf("---char mass fraction = %f \n", RUSLAG((*imckt -1), izone, iclas));
+ }
+ }
+ }
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui_radiative_transfer.c b/src/base/cs_gui_radiative_transfer.c
new file mode 100644
index 0000000..4029daf
--- /dev/null
+++ b/src/base/cs_gui_radiative_transfer.c
@@ -0,0 +1,1178 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: radiative transfer
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include "fvm_selector.h"
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui_variables.h"
+#include "cs_gui_util.h"
+#include "cs_gui_boundary_conditions.h"
+#include "cs_gui_specific_physics.h"
+#include "cs_gui.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui_radiative_transfer.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* debugging switch */
+#define _XML_DEBUG_ 0
+
+/*============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Structure associated to boundary conditions definition
+ *----------------------------------------------------------------------------*/
+
+typedef struct {
+ char **label; /* label for each boundary zone */
+ char **nature; /* nature for each boundary zone */
+ int *output_zone;
+ int *type;
+ double *emissivity;
+ double *conductivity;
+ double *thickness;
+ double *thermal_conductivity;
+ double *external_temp;
+ double *internal_temp;
+ double *conduction_flux;
+} cs_radiative_boundary_t;
+
+/*----------------------------------------------------------------------------
+ * Private global variables for boundary conditions
+ *----------------------------------------------------------------------------*/
+
+static cs_radiative_boundary_t *boundary = NULL;
+
+/*----------------------------------------------------------------------------
+ * Private global variables for the treatment
+ * of NOMVAR. NOMVAR is a characters fortran array
+ *----------------------------------------------------------------------------*/
+
+static int _cs_gui_max_vars = 0;
+static int _cs_gui_last_var = 0;
+static char ** _cs_gui_var_rayt = NULL;
+
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return integer parameters for radiation
+ *
+ * parameters:
+ * param --> name of parameter
+ * keyword <-- value of parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+_radiative_transfer_int(const char *const param,
+ int *const keyword)
+{
+ char *path;
+ int value = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3,
+ "thermophysical_models",
+ "radiative_transfer",
+ param);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_int(path, &value)) *keyword = value;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return float parameters for radiation
+ *
+ * parameters:
+ * param --> name of parameter
+ * keyword <-- value of parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+_radiative_transfer_double(const char *const param,
+ double *const keyword)
+{
+ char *path;
+ double value;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3,
+ "thermophysical_models",
+ "radiative_transfer",
+ param);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &value)) *keyword = value;
+
+ BFT_FREE(path);
+}
+
+/*-----------------------------------------------------------------------------
+ * Return value of the parameter of the character type for radiation
+ *
+ * parameters:
+ * param --> name of parameter
+ * keyword <-- value of parameter
+ *----------------------------------------------------------------------------*/
+
+static void
+_radiative_transfer_char(const char *const param,
+ int *const keyword)
+{
+ char *path;
+ int result;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3,
+ "thermophysical_models",
+ "radiative_transfer",
+ param);
+ cs_xpath_add_attribute(&path, "status");
+
+ if(cs_gui_get_status(path, &result)) *keyword = result;
+
+ BFT_FREE(path);
+}
+
+
+/*-----------------------------------------------------------------------------
+ * Return status and label of the property for post treatment of radiation
+ *
+ * parameters:
+ * name --> name of property
+ * value <-- value of status
+ *----------------------------------------------------------------------------*/
+
+static char *
+_radiative_transfer_char_post(const char *const name,
+ int *const list_value,
+ int *const record_value)
+{
+ char *path = NULL;
+ char *path1 = NULL;
+ char *path2 = NULL;
+ char *label = NULL;
+ int result;
+
+ path = cs_xpath_init_path();
+
+ cs_xpath_add_elements(&path, 3,
+ "thermophysical_models",
+ "radiative_transfer",
+ "property");
+ cs_xpath_add_test_attribute(&path, "name", name);
+
+ BFT_MALLOC(path1, strlen(path)+1, char);
+ strcpy(path1, path);
+ BFT_MALLOC(path2, strlen(path)+1, char);
+ strcpy(path2, path);
+
+ cs_xpath_add_attribute(&path, "label");
+ label = cs_gui_get_attribute_value(path);
+
+ cs_xpath_add_element(&path1, "listing_printing");
+ cs_xpath_add_attribute(&path1, "status");
+ if (cs_gui_get_status(path1, &result)) {
+ *list_value = 1;
+ }
+
+ cs_xpath_add_element(&path2, "postprocessing_recording");
+ cs_xpath_add_attribute(&path2, "status");
+ if (cs_gui_get_status(path2, &result)) {
+ *record_value = -1;
+ }
+
+ BFT_FREE(path);
+ BFT_FREE(path1);
+ BFT_FREE(path2);
+
+ return label;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return value of the type of absorption coefficient for radiation
+ *
+ * parameters:
+ * param --> name of parameter "absorption coefficient"
+ * keyword <-- value of the type of the coefficent
+ *----------------------------------------------------------------------------*/
+
+static void
+_radiative_transfer_type(const char *const param,
+ int *const keyword)
+{
+ char *path;
+ char *type;
+
+ path = cs_xpath_init_path();
+
+ cs_xpath_add_elements(&path, 3,
+ "thermophysical_models",
+ "radiative_transfer",
+ param);
+
+ cs_xpath_add_attribute(&path, "type");
+
+ type = cs_gui_get_attribute_value(path);
+
+ if (type != NULL) {
+ if (cs_gui_strcmp(type, "constant"))
+ *keyword = 0;
+ else if (cs_gui_strcmp(type, "variable"))
+ *keyword = 1;
+ else if (cs_gui_strcmp(type, "formula"))
+ *keyword = 2;
+ else if (cs_gui_strcmp(type, "modak"))
+ *keyword = 3;
+ else {
+ bft_error (__FILE__, __LINE__, 0,
+ _("unknow type %s\n"), type);
+ }
+ BFT_FREE(type);
+ }
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Return value of radiative variable
+ *
+ * parameters:
+ * label --> label of boundary nature
+ * param --> name of the variable
+ * value <-- value of the variable
+ *----------------------------------------------------------------------------*/
+
+static void
+_radiative_boundary(const char *const label,
+ const char *const param,
+ double *const value)
+{
+ char *path = NULL;
+ double res = 0.0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2,
+ "boundary_conditions",
+ "wall");
+ cs_xpath_add_test_attribute(&path, "label", label);
+ cs_xpath_add_elements(&path, 2,
+ "radiative_data",
+ param);
+ cs_xpath_add_function_text(&path);
+
+ if (cs_gui_get_double(path, &res)){
+ if (res != *value)
+ *value = res;
+ }
+
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Return int value of the type of radiative condition
+ *
+ * parameters:
+ * label --> label of boundary "wall"
+ * itpimp <-- if wall faces with imposed temperature
+ * ipgrno <-- if grey or black wall faces
+ * iprefl <-- if reflecting wall faces
+ * ifgrno <-- if grey or black wall faces and conduction flux imposed
+ * ifrefl <-- if refecting wall faces and conduction flux imposed
+ *----------------------------------------------------------------------------*/
+
+static int
+_radiative_boundary_type(const char *const label,
+ const int itpimp,
+ const int ipgrno,
+ const int iprefl,
+ const int ifgrno,
+ const int ifrefl)
+{
+ char *path = NULL;
+ char *type = NULL;
+ int result = -999;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2,
+ "boundary_conditions",
+ "wall");
+ cs_xpath_add_test_attribute(&path, "label", label);
+
+ cs_xpath_add_element(&path, "radiative_data");
+ cs_xpath_add_attribute(&path,"choice");
+ type = cs_gui_get_attribute_value(path);
+
+ if (cs_gui_strcmp(type, "itpimp"))
+ result = itpimp;
+ else if (cs_gui_strcmp(type, "ipgrno"))
+ result = ipgrno;
+ else if (cs_gui_strcmp(type, "iprefl"))
+ result = iprefl;
+ else if (cs_gui_strcmp(type, "ifgrno"))
+ result = ifgrno;
+ else if (cs_gui_strcmp(type, "ifrefl"))
+ result = ifrefl;
+
+ if (result == -999)
+ bft_error (__FILE__, __LINE__, 0,
+ _("Xpath request failed %s \n"), path);
+
+ BFT_FREE(path);
+ BFT_FREE(type);
+
+ return result;
+}
+
+/*----------------------------------------------------------------------------
+ * Return maximum value of output zone
+ *----------------------------------------------------------------------------*/
+
+static int
+_radiative_boundary_output_zone_max(void)
+{
+ char *path;
+ int nb_zone, zone_max = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 4,
+ "boundary_conditions",
+ "wall",
+ "radiative_data",
+ "output_zone" );
+
+ nb_zone = cs_gui_get_nb_element(path);
+
+ if (nb_zone > 0) {
+ cs_xpath_add_function_text(&path);
+ zone_max = cs_gui_get_max_value(path);
+ }
+
+ BFT_FREE(path);
+
+ return zone_max;
+}
+
+/*-----------------------------------------------------------------------------
+ * Copy a variable name to private variable names array
+ *
+ * parameters:
+ * varname --> name or label of the variable/scalar/property
+ * ipp --> index from the fortran array associated to varname
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_gui_copy_varname(const char *varname, int ipp)
+{
+ size_t l;
+
+ if (ipp < 1 || ipp > _cs_gui_last_var)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Variable index %d out of bounds (1 to %d)"),
+ ipp, _cs_gui_last_var);
+
+ l = strlen(varname);
+
+ if (_cs_gui_var_rayt[ipp-1] == NULL)
+ BFT_MALLOC(_cs_gui_var_rayt[ipp-1], l + 1, char);
+
+ else if (strlen(_cs_gui_var_rayt[ipp-1]) != l)
+ BFT_REALLOC(_cs_gui_var_rayt[ipp-1], l + 1, char);
+
+ strcpy(_cs_gui_var_rayt[ipp-1], varname);
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiray1, UIRAY1) (int *const iirayo,
+ int *const isuird,
+ int *const ndirec,
+ int *const nfreqr,
+ int *const idiver,
+ int *const iimpar,
+ int *const iimlum)
+{
+ char *model = NULL;
+
+ model = cs_gui_get_thermophysical_model("radiative_transfer");
+
+ if (cs_gui_strcmp(model, "off"))
+ *iirayo = 0;
+ else if (cs_gui_strcmp(model, "dom"))
+ *iirayo = 1;
+ else if (cs_gui_strcmp(model, "p-1"))
+ *iirayo = 2;
+
+ if (*iirayo)
+ {
+ _radiative_transfer_char("restart", isuird);
+ _radiative_transfer_int("directions_number", ndirec);
+ _radiative_transfer_int("frequency", nfreqr);
+ _radiative_transfer_int("thermal_radiative_source_term", idiver);
+ _radiative_transfer_int("temperature_listing_printing", iimpar);
+ _radiative_transfer_int("intensity_resolution_listing_printing", iimlum);
+ }
+#if _XML_DEBUG_
+ bft_printf("==>UIRAY1\n");
+ bft_printf("--rayonnement : %s (iirayo = %i)\n", model, *iirayo);
+ if (*iirayo)
+ {
+ bft_printf("--isuird = %d\n", *isuird);
+ bft_printf("--ndirec = %d\n", *ndirec);
+ bft_printf("--nfreqr = %d\n", *nfreqr);
+ bft_printf("--idiver = %d\n", *idiver);
+ bft_printf("--iimpar = %d\n", *iimpar);
+ bft_printf("--iimlum = %d\n", *iimlum);
+ }
+#endif
+ BFT_FREE(model);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiray4, UIRAY4) (int *const nbrayf,
+ int *const nphas,
+ int *const iirayo,
+ int *const irayvf)
+{
+ int i, iphas = 0;
+ int list_ind, record_ind = 0;
+ char *label = NULL;
+
+ const char *const _cs_properties_name2[8] = {
+ "wall_temp",
+ "flux_incident",
+ "thickness",
+ "thermal_conductivity",
+ "emissivity",
+ "flux_net",
+ "flux_convectif",
+ "coeff_ech_conv"};
+
+ if (*iirayo)
+ {
+ for (i=0 ; i < *nbrayf ; i++)
+ {
+ list_ind = 1;
+ record_ind = 1;
+ label = _radiative_transfer_char_post(_cs_properties_name2[i], &list_ind, &record_ind);
+ for (iphas=0 ; iphas < *nphas ; iphas++)
+ {
+ irayvf[(*nbrayf)*iphas + i] = record_ind;
+ if (label)
+ _cs_gui_copy_varname(label, i + 1 + (*nbrayf)*iphas);
+ }
+ BFT_FREE(label);
+ }
+ }
+#if _XML_DEBUG_
+ bft_printf("==>UIRAY4\n");
+ if (*iirayo)
+ {
+ for (i=0 ; i < *nbrayf ; i++)
+ {
+ for (iphas=0 ; iphas < *nphas ; iphas++)
+ {
+ bft_printf(_("--output boundary faces: %s value %i \n"),
+ _cs_gui_var_rayt[i + (*nbrayf)*iphas],
+ irayvf[(*nbrayf)*iphas + i]);
+ }
+ }
+ }
+#endif
+}
+
+/*-----------------------------------------------------------------------------
+ * Indirection between the solver numbering and the XML one
+ * for physical properties of radiative transfer
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uirapr, UIRAPR) (const int *const nprayc,
+ const int *const nprayb,
+ const int *const nphasc,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const ilumin,
+ const int *const iqx,
+ const int *const iqy,
+ const int *const iqz,
+ const int *const itsre,
+ const int *const itsri,
+ const int *const iabs,
+ const int *const iemi,
+ const int *const icak)
+{
+ int i = 0;
+ int n;
+ char *name = NULL;
+ char *snumpp = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ n = vars->nprop;
+ vars->nprop += *nprayc;
+ vars->nprayc = *nprayc;
+
+ BFT_REALLOC(vars->properties_ipp, vars->nprop, int);
+ BFT_REALLOC(vars->propce, vars->nprop, int);
+ BFT_REALLOC(vars->properties_name, vars->nprop, char*);
+
+ /* ILUMIN */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *ilumin -1 ]-1 ];
+ vars->propce[n] = *ilumin;
+ BFT_MALLOC(vars->properties_name[n], strlen("intensity")+1, char);
+ strcpy(vars->properties_name[n++], "intensity");
+
+ /* IQX */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *iqx -1 ]-1 ];
+ vars->propce[n] = *iqx;
+ BFT_MALLOC(vars->properties_name[n], strlen("qrad_x")+1, char);
+ strcpy(vars->properties_name[n++], "qrad_x");
+
+ /* IQY */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *iqy -1 ]-1 ];
+ vars->propce[n] = *iqy;
+ BFT_MALLOC(vars->properties_name[n], strlen("qrad_y")+1, char);
+ strcpy(vars->properties_name[n++], "qrad_y");
+
+ /* IQZ */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *iqz -1 ]-1 ];
+ vars->propce[n] = *iqz;
+ BFT_MALLOC(vars->properties_name[n], strlen("qrad_z")+1, char);
+ strcpy(vars->properties_name[n++], "qrad_z");
+
+ /* ITSRE */
+ vars->properties_ipp[n] = ipppro[ ipproc[ itsre[0] -1 ]-1 ];
+ vars->propce[n] = itsre[0];
+ BFT_MALLOC(vars->properties_name[n], strlen("radiative_source_term")+1, char);
+ strcpy(vars->properties_name[n++], "radiative_source_term");
+
+ /* ITSRE loop on classes */
+ BFT_MALLOC(name, strlen("radiative_source_term_")+1 + 2, char);
+ BFT_MALLOC(snumpp, 1 + 2, char);
+ strcpy(name, "radiative_source_term_");
+ for (i = 1; i < *nphasc; i++)
+ {
+ sprintf(snumpp, "%2.2i", i);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ itsre[i] -1 ]-1 ];
+ vars->propce[n] = itsre[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "radiative_source_term_");
+ }
+
+ /* ITSRI */
+ vars->properties_ipp[n] = ipppro[ ipproc[ itsri[0] -1 ]-1 ];
+ vars->propce[n] = itsri[0];
+ BFT_MALLOC(vars->properties_name[n], strlen("implicit_source_term")+1, char);
+ strcpy(vars->properties_name[n++], "implicit_source_term");
+
+ /* ITSRI loop on classes */
+ BFT_REALLOC(name, strlen("implicit_source_term_")+1 + 2, char);
+ strcpy(name, "implicit_source_term_");
+ for (i = 1; i < *nphasc; i++)
+ {
+ sprintf(snumpp, "%2.2i", i);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ itsri[i] -1 ]-1 ];
+ vars->propce[n] = itsri[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "implicit_source_term_");
+ }
+
+ /* IABS */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iabs[0] -1 ]-1 ];
+ vars->propce[n] = iabs[0];
+ BFT_MALLOC(vars->properties_name[n], strlen("absorption")+1, char);
+ strcpy(vars->properties_name[n++], "absorption");
+
+ /* IABS loop on classes */
+ BFT_REALLOC(name, strlen("absorption_")+1 + 2, char);
+ strcpy(name, "absorption_");
+ for (i = 1; i < *nphasc; i++)
+ {
+ sprintf(snumpp, "%2.2i", i);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ iabs[i] -1 ]-1 ];
+ vars->propce[n] = iabs[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "absorption_");
+ }
+
+ /* IEMI */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iemi[0] -1 ]-1 ];
+ vars->propce[n] = iemi[0];
+ BFT_MALLOC(vars->properties_name[n], strlen("emission")+1, char);
+ strcpy(vars->properties_name[n++], "emission");
+
+ /* IEMI loop on classes */
+ BFT_REALLOC(name, strlen("emission_")+1 + 2, char);
+ strcpy(name, "emission_");
+ for (i = 1; i < *nphasc; i++)
+ {
+ sprintf(snumpp, "%2.2i", i);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ iemi[i] -1 ]-1 ];
+ vars->propce[n] = iemi[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "emission_");
+ }
+
+ /* ICAK */
+ vars->properties_ipp[n] = ipppro[ ipproc[ icak[0] -1 ]-1 ];
+ vars->propce[n] = icak[0];
+ BFT_MALLOC(vars->properties_name[n], strlen("absorption_coefficient")+1, char);
+ strcpy(vars->properties_name[n++], "absorption_coefficient");
+
+ /* ICAK loop on classes */
+ BFT_REALLOC(name, strlen("absorption_coefficient_")+1 + 2, char);
+ strcpy(name, "absorption_coefficient_");
+ for (i = 1; i < *nphasc; i++)
+ {
+ sprintf(snumpp, "%2.2i", i);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ icak[i] -1 ]-1 ];
+ vars->propce[n] = icak[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "absorption_coefficient_");
+ }
+
+ BFT_FREE(name);
+ BFT_FREE(snumpp);
+
+ if (n != vars->nprop)
+ bft_error(__FILE__, __LINE__, 0,
+ _("number of properties is not correct: %i instead of: %i\n"),
+ n, vars->nsalpp);
+
+#if _XML_DEBUG_
+ bft_printf("==>UIRAPR\n");
+ bft_printf("-->nombre de proprietes = %i\n", vars->nprop);
+ for (i=0 ; i<vars->nprop ; i++)
+ bft_printf("-->properties_ipp[%i]: %i propce[%i]: %i "
+ "properties_name[%i]: %s\n",
+ i, vars->properties_ipp[i],
+ i, vars->propce[i],
+ i, vars->properties_name[i]);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from Fortran to C
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(fcnmra, FCNMRA)
+(
+ const char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i, i1, i2, l;
+ char *cstr = NULL;
+
+ assert(*var_id > 0);
+
+ /* Resize array if necessary */
+
+ if (*var_id > _cs_gui_max_vars) {
+
+ if (_cs_gui_max_vars == 0)
+ _cs_gui_max_vars = 16;
+
+ while (_cs_gui_max_vars <= *var_id)
+ _cs_gui_max_vars *= 2;
+
+ BFT_REALLOC(_cs_gui_var_rayt, _cs_gui_max_vars, char *);
+ for (i = _cs_gui_last_var; i < _cs_gui_max_vars; i++)
+ _cs_gui_var_rayt[i] = NULL;
+ }
+
+ /* Compute string length (removing start or end blanks) */
+
+ for (i1 = 0;
+ i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
+ i1++);
+
+ for (i2 = *len - 1;
+ i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
+ i2--);
+
+ l = i2 - i1 + 1;
+
+ /* Should be called once per variable only */
+ assert(_cs_gui_var_rayt[*var_id - 1] == NULL);
+
+ if (l > 0) {
+
+ /* Allocate and copy */
+ BFT_MALLOC(cstr, l + 1, char);
+
+ for (i = 0 ; i < l ; i++, i1++)
+ cstr[i] = fstr[i1];
+
+ cstr[l] = '\0';
+
+ _cs_gui_var_rayt[*var_id - 1] = cstr;
+
+ }
+
+ /* Update variable counter */
+ _cs_gui_last_var = *var_id;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Copy variable name from C to Fortran
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(cfnmra, CFNMRA)
+(
+ char *const fstr, /* --> Fortran string */
+ int *const len, /* --> String Length */
+ int *const var_id /* --> Variable Id (1 to n) */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ int i;
+ int l = 0;
+ char *cstr = NULL;
+
+ /* Check that variable name was set */
+
+ if (*var_id < 1 || *var_id > _cs_gui_last_var)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Name of variable %i was never set.\n"), *var_id);
+
+ /* Copy string */
+
+ cstr = _cs_gui_var_rayt[*var_id - 1];
+
+ if (cstr != NULL) {
+
+ /* Compute string length (removing start or end blanks) */
+
+ l = strlen(cstr);
+ if (l > *len)
+ l = *len;
+
+ for (i = 0; i < l; i++)
+ fstr[i] = cstr[i];
+
+ }
+
+ /* Pad with blanks if necessary */
+
+ for (i = l; i < *len; i++)
+ fstr[i] = ' ';
+}
+
+/*----------------------------------------------------------------------------
+ * Radiative transfer model usray2.F
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiray2, UIRAY2)
+(
+ const int *const itypfb,
+ const int *const iparoi,
+ const int *const iparug,
+ const int *const ivart,
+ int *const izfrdp,
+ int *const isothp,
+ const int *const itpimp,
+ const int *const ipgrno,
+ const int *const iprefl,
+ const int *const ifgrno,
+ const int *const ifrefl,
+ const int *const nozppm,
+ const int *const nfabor,
+ const int *const nvar,
+ double *const epsp,
+ double *const epap,
+ double *const tintp,
+ double *const textp,
+ double *const xlamp,
+ double *const rcodcl
+)
+{
+ int zones = 0;
+ int output_zone_max = 0;
+ int izone;
+ int ith_zone;
+ int ifbr;
+ int j, n;
+ int *faces_list = NULL;
+ int faces = 0;
+ int iok = 0;
+ double tmp = 0.;
+ char *nature = NULL;
+ char *label = NULL;
+
+ zones = cs_gui_boundary_zones_number();
+ output_zone_max = _radiative_boundary_output_zone_max();
+
+ /* Fisrt iteration only : memory allocation */
+ if (boundary == NULL) {
+
+ BFT_MALLOC(boundary, 1, cs_radiative_boundary_t);
+ BFT_MALLOC(boundary->label, zones, char* );
+ BFT_MALLOC(boundary->nature, zones, char* );
+ BFT_MALLOC(boundary->output_zone, zones, int );
+ BFT_MALLOC(boundary->type, zones, int );
+ BFT_MALLOC(boundary->emissivity, zones, double );
+ BFT_MALLOC(boundary->thickness, zones, double );
+ BFT_MALLOC(boundary->thermal_conductivity, zones, double );
+ BFT_MALLOC(boundary->external_temp, zones, double );
+ BFT_MALLOC(boundary->internal_temp, zones, double );
+ BFT_MALLOC(boundary->conduction_flux, zones, double );
+
+ for (izone = 0; izone < zones; izone++) {
+
+ /* nature, label and description (color or group)
+ of the ith initialization zone */
+
+ ith_zone = izone + 1;
+
+ nature = cs_gui_boundary_zone_nature(ith_zone);
+
+ label = cs_gui_boundary_zone_label(ith_zone);
+
+ BFT_MALLOC(boundary->label[izone], strlen(label)+1, char);
+ strcpy(boundary->label[izone], label);
+
+ BFT_MALLOC(boundary->nature[izone], strlen(nature)+1, char);
+ strcpy(boundary->nature[izone], nature);
+
+ faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor, *nozppm, &faces);
+
+ /* Default initialization: these values are the same that in raycli
+ but given on each face in raycli whereas here one does not
+ necessarily have boundary faces (parallism) -> duplication */
+ boundary->type[izone] = -1;
+ boundary->output_zone[izone] = -1;
+ boundary->emissivity[izone] = -1.e12;
+ boundary->thickness[izone] = -1.e12;
+ boundary->thermal_conductivity[izone] = -1.e12;
+ boundary->external_temp[izone] = -1.e12;
+ boundary->internal_temp[izone] = -1.e12;
+ boundary->conduction_flux[izone] = 1.e30;
+
+ if (cs_gui_strcmp(nature, "wall")) {
+ boundary->type[izone] = _radiative_boundary_type(label,
+ *itpimp, *ipgrno, *iprefl,
+ *ifgrno, *ifrefl);
+ tmp = (double) boundary->output_zone[izone];
+ _radiative_boundary(label, "output_zone", &tmp);
+ boundary->output_zone[izone] = (int) tmp;
+ _radiative_boundary(label, "emissivity", &boundary->emissivity[izone]);
+ _radiative_boundary(label, "thickness", &boundary->thickness[izone]);
+ _radiative_boundary(label, "thermal_conductivity", &boundary->thermal_conductivity[izone]);
+ _radiative_boundary(label, "external_temperature_profile", &boundary->external_temp[izone]);
+ _radiative_boundary(label, "internal_temperature_profile", &boundary->internal_temp[izone]);
+ _radiative_boundary(label, "flux", &boundary->conduction_flux[izone]);
+
+ } /* if (cs_gui_strcmp(nature, "wall")) */
+
+ BFT_FREE(nature);
+ BFT_FREE(label);
+
+ } /* for izones */
+
+ } /* if (boundaries == NULL)*/
+
+ for (izone = 0; izone < zones; izone++) {
+
+ /* list of faces building */
+
+// description = cs_gui_boundary_zone_localization(boundary->label[izone]);
+//
+// fvm_selector_get_list(cs_glob_mesh->select_b_faces,
+// description,
+// &faces,
+// faces_list);
+//
+// BFT_FREE(description);
+ faces_list = cs_gui_get_faces_list(izone,
+ boundaries->label[izone],
+ *nfabor, *nozppm, &faces);
+
+ if (cs_gui_strcmp(boundary->nature[izone], "wall"))
+ {
+ for (n = 0; n < faces; n++)
+ {
+ ifbr = faces_list[n]-1;
+
+ if (itypfb[ifbr] != *iparoi && itypfb[ifbr] != *iparug)
+ bft_error(__FILE__, __LINE__, 0,
+ _("One tries to define radiative boundary conditions on boundary which is not a wall.\n"
+ "The definition of the boundaries natures given in GUI (wall, inlet, outlet,...) \n"
+ "is modified in a users subroutine (like USCLIM, USCPCL,...). \n"
+ "The radiative boundary conditions given in GUI must be coherent \n"
+ "with these new natures.\n"));
+
+ izfrdp[ifbr] = boundary->output_zone[izone];
+ isothp[ifbr] = boundary->type[izone];
+ if (isothp[ifbr] == *itpimp)
+ {
+ epsp[ifbr] = boundary->emissivity[izone];
+ tintp[ifbr] = boundary->internal_temp[izone];
+ }
+ else if (isothp[ifbr] == *ipgrno)
+ {
+ xlamp[ifbr] = boundary->thermal_conductivity[izone];
+ epap[ifbr] = boundary->thickness[izone];
+ textp[ifbr] = boundary->external_temp[izone];
+ tintp[ifbr] = boundary->internal_temp[izone];
+ epsp[ifbr] = boundary->emissivity[izone];
+ if (boundary->emissivity[izone] == 0.)
+ isothp[ifbr] = *iprefl;
+ }
+ else if (isothp[ifbr] == *ifgrno)
+ {
+ rcodcl[2 * (*nfabor) * (*nvar) + (*ivart) * (*nfabor) + ifbr] = boundary->conduction_flux[izone];
+ tintp[ifbr] = boundary->internal_temp[izone];
+ epsp[ifbr] = boundary->emissivity[izone];
+ if (boundary->emissivity[izone] != 0.)
+ isothp[ifbr] = *ifrefl;
+ }
+ }
+
+ } else {
+ j = output_zone_max++;
+ for (n = 0; n < faces; n++) {
+ ifbr = faces_list[n]-1;
+ izfrdp[ifbr] = j;
+ }
+ } /* if nature == "wall" */
+
+ } /* for izone */
+
+ BFT_FREE(faces_list);
+
+ iok = 0;
+ for (n = 0; n < *nfabor; n++) {
+ if (izfrdp[n] == -1) iok = 1;
+ }
+ if (iok == 1) {
+ bft_printf("Warning: radiative boundary conditions in GUI are not totally defined \n");
+ if (zones)
+ bft_printf("These are radiative boundary conditions defined in GUI: \n");
+ for (izone = 0; izone < zones; izone++) {
+ bft_printf(" nature: %s label: %s\n", boundary->nature[izone], boundary->label[izone]);
+ if (cs_gui_strcmp(boundary->nature[izone], "wall")) {
+ bft_printf(" output_zone = %i\n", boundary->output_zone[izone]);
+ bft_printf(" type = %i\n", boundary->type[izone]);
+ bft_printf(" emissivity = %f\n", boundary->emissivity[izone]);
+ bft_printf(" thickness= %f\n", boundary->thickness[izone]);
+ bft_printf(" thermal_conductivity = %f\n", boundary->thermal_conductivity[izone]);
+ bft_printf(" external_temp = %f\n", boundary->external_temp[izone]);
+ bft_printf(" internal_temp = %f\n", boundary->internal_temp[izone]);
+ bft_printf(" conduction_flux= %f\n", boundary->conduction_flux[izone]);
+ }
+ }
+ }
+
+#if _XML_DEBUG_
+ bft_printf("==>UIRAY2\n");
+ for (izone = 0; izone < zones; izone++) {
+ bft_printf("--label zone = %s\n", boundary->label[izone]);
+ if (cs_gui_strcmp(boundary->nature[izone], "wall")) {
+ bft_printf("----output_zone = %i\n", boundary->output_zone[izone]);
+ bft_printf("----type = %i\n", boundary->type[izone]);
+ bft_printf("----emissivity = %f\n", boundary->emissivity[izone]);
+ bft_printf("----thickness= %f\n", boundary->thickness[izone]);
+ bft_printf("----thermal_conductivity = %f\n", boundary->thermal_conductivity[izone]);
+ bft_printf("----external_temp = %f\n", boundary->external_temp[izone]);
+ bft_printf("----internal_temp = %f\n", boundary->internal_temp[izone]);
+ bft_printf("----conduction_flux= %f\n", boundary->conduction_flux[izone]);
+ }
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Radiative transfer model usray3.F
+ *----------------------------------------------------------------------------*/
+
+
+void CS_PROCF (uiray3, UIRAY3) ( double *const ck,
+ const int *const ncel,
+ int *const imodak)
+{
+ double value = 0.;
+ int i, type = 0;
+
+ if (!cs_gui_get_activ_thermophysical_model())
+ {
+ _radiative_transfer_type("absorption_coefficient", &type);
+ _radiative_transfer_double("absorption_coefficient", &value);
+
+ if (type == 0)
+ {
+ for(i = 0; i < *ncel; i++)
+ ck[i] = value;
+ }
+ else if (type == 3)
+ {
+ *imodak = 1;
+ }
+#if _XML_DEBUG_
+ bft_printf("==>UIRAY3\n");
+ bft_printf("--absorption coefficient type: %d\n", type);
+ bft_printf("--absorption coefficient by modak: %i\n", imodak);
+ if (type == 0)
+ bft_printf("--absorption coefficient value = %f\n", value);
+#endif
+ }
+}
+
+/*-----------------------------------------------------------------------------
+ * Free memory: clean global private variables.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE MEMUI2
+ * *****************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (memui2, MEMUI2) (void)
+{
+ int zones = 0;
+ int i;
+
+ if (boundary != NULL) {
+
+ /* clean memory for global private structure boundaries */
+
+ zones = cs_gui_boundary_zones_number();
+ for (i=0 ; i < zones ; i++) {
+ BFT_FREE(boundary->label[i]);
+ BFT_FREE(boundary->nature[i]);
+ }
+ BFT_FREE(boundary->label);
+ BFT_FREE(boundary->nature);
+ BFT_FREE(boundary->output_zone);
+ BFT_FREE(boundary->type);
+ BFT_FREE(boundary->emissivity);
+ BFT_FREE(boundary->thickness);
+ BFT_FREE(boundary->thermal_conductivity);
+ BFT_FREE(boundary->external_temp);
+ BFT_FREE(boundary->internal_temp);
+ BFT_FREE(boundary->conduction_flux);
+ BFT_FREE(boundary);
+ }
+
+ /* clean memory for fortran name of variables */
+
+ for (i = 0; i < _cs_gui_max_vars; i++)
+ BFT_FREE(_cs_gui_var_rayt[i]);
+ BFT_FREE(_cs_gui_var_rayt);
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui_specific_physics.c b/src/base/cs_gui_specific_physics.c
new file mode 100644
index 0000000..183a1f9
--- /dev/null
+++ b/src/base/cs_gui_specific_physics.c
@@ -0,0 +1,986 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: specific physics
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include "fvm_selector.h"
+
+/*----------------------------------------------------------------------------
+ * MEI library headers
+ *----------------------------------------------------------------------------*/
+
+#ifdef HAVE_MEI
+#include "mei_evaluate.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui_util.h"
+#include "cs_gui_variables.h"
+#include "cs_mesh.h"
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui_specific_physics.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* debugging switch */
+#define _XML_DEBUG_ 0
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the activated specific physics scalar number
+ *----------------------------------------------------------------------------*/
+
+static int
+_scalar_number(const char* model)
+{
+ char *path = NULL;
+ int nb;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_element(&path, "thermophysical_models");
+ cs_xpath_add_element(&path, model);
+ cs_xpath_add_element(&path, "scalar");
+
+ nb = cs_gui_get_nb_element(path);
+
+ BFT_FREE(path);
+
+ return nb;
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Predefined physics indicator.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UIPPMO
+ * *****************
+ *
+ * INTEGER IPPMOD <-- specific physics indicator array
+ * INTEGER ICOD3P --> diffusion flame in fast complete chemistry
+ * INTEGER ICODEQ --> diffusion flame in fast chemistry towards balance
+ * INTEGER ICOEBU --> Eddy Break Up premixing flame
+ * INTEGER ICOBML --> Bray - Moss - Libby premixing flame
+ * INTEGER ICOLWC --> Libby Williams premixing flame
+ * INTEGER ICP3PL --> Coal combustion. Combustible moyen local
+ * INTEGER ICPL3C --> Coal combustion coupled with lagrangien approach
+ * INTEGER ICFUEL --> Fuel combustion
+ * INTEGER IELJOU --> Joule effect
+ * INTEGER IELARC --> electrical arc
+ * INTEGER IELION --> ionique mobility
+ * INTEGER ICOMPF --> compressible without shock
+ * INTEGER IATMOS --> atmospheric flows
+ * INTEGER IAEROS --> cooling tower
+ * INTEGER INDJON --> INDJON=1: a JANAF enthalpy-temperature
+ * tabulation is used. INDJON=1: users tabulation
+ * INTEGER IEQCO2 --> CO2 massic fraction transport
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uippmo, UIPPMO)(int *const ippmod,
+ int *const icod3p,
+ int *const icodeq,
+ int *const icoebu,
+ int *const icobml,
+ int *const icolwc,
+ int *const icp3pl,
+ int *const icpl3c,
+ int *const icfuel,
+ int *const ieljou,
+ int *const ielarc,
+ int *const ielion,
+ int *const icompf,
+ int *const iatmos,
+ int *const iaeros,
+ int *const indjon,
+ int *const ieqco2)
+{
+ int isactiv = 0;
+ int nscapp = 0;
+
+ cs_var_t *vars = cs_glob_var;
+
+ ippmod[*icod3p - 1] = -1;
+ ippmod[*icodeq - 1] = -1;
+ ippmod[*icoebu - 1] = -1;
+ ippmod[*icobml - 1] = -1;
+ ippmod[*icolwc - 1] = -1;
+ ippmod[*icp3pl - 1] = -1;
+ ippmod[*icpl3c - 1] = -1;
+ ippmod[*icfuel - 1] = -1;
+ ippmod[*ieljou - 1] = -1;
+ ippmod[*ielarc - 1] = -1;
+ ippmod[*ielion - 1] = -1;
+ ippmod[*icompf - 1] = -1;
+ ippmod[*iatmos - 1] = -1;
+ ippmod[*iaeros - 1] = -1;
+
+ *indjon = 1;
+ *ieqco2 = 0;
+
+ /* Look for the active specific physics and give the value of the associated
+ model attribute */
+ isactiv = cs_gui_get_activ_thermophysical_model();
+
+ if (isactiv)
+ {
+ if (cs_gui_strcmp(vars->model, "pulverized_coal"))
+ {
+ if (cs_gui_strcmp(vars->model_value, "coal_homo"))
+ ippmod[*icp3pl - 1] = 0;
+ else if (cs_gui_strcmp(vars->model_value, "coal_homo2"))
+ ippmod[*icp3pl - 1] = 1;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid coal model: %s.\n"), vars->model_value);
+ }
+ else if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
+ {
+ if (cs_gui_strcmp(vars->model_value, "constant"))
+ ippmod[*iatmos - 1] = 0;
+ else if (cs_gui_strcmp(vars->model_value, "dry"))
+ ippmod[*iatmos - 1] = 1;
+ else if (cs_gui_strcmp(vars->model_value, "humid"))
+ ippmod[*iatmos - 1] = 2;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid atmospheric flow model: %s.\n"),
+ vars->model_value);
+ }
+
+ /* If the model is active, one only takes the specific physics scalars */
+ nscapp = _scalar_number(vars->model);
+ }
+
+ vars->nscapp = nscapp;
+
+#if _XML_DEBUG_
+ bft_printf("==>UIPPMO\n");
+ if (isactiv)
+ {
+ bft_printf("--thermophysical model: %s\n", vars->model);
+ bft_printf("--thermophysical value: %s\n", vars->model_value);
+ bft_printf("--model scalars number: %i\n", vars->nscapp);
+ }
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Density under relaxation
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE UICPI1 (SRROM)
+ * *****************
+ * DOUBLE PRECISION SRROM <-- density relaxation
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uicpi1, UICPI1) (double *const srrom)
+{
+ cs_gui_numerical_double_parameters("density_relaxation", srrom);
+
+#if _XML_DEBUG_
+ bft_printf("==>UICPI1\n");
+ bft_printf("--srrom = %f\n", *srrom);
+#endif
+}
+
+/*-----------------------------------------------------------------------------
+ * Indirection between the solver numbering and the XML one
+ * for physical properties of the activated specific physics
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uicppr, UICPPR) (const int *const nclass,
+ const int *const nsalpp,
+ const int *const nsalto,
+ const int *const ippmod,
+ const int *const icp3pl,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const ihtco2,
+ const int *const itemp1,
+ const int *const irom1,
+ const int *const iym1,
+ const int *const immel,
+ const int *const itemp2,
+ const int *const ix2,
+ const int *const irom2,
+ const int *const idiam2,
+ const int *const igmdch,
+ const int *const igmdv1,
+ const int *const igmdv2,
+ const int *const igmhet,
+ const int *const ighco2,
+ const int *const igmsec)
+{
+ int i = 0;
+ int n;
+ char *name = NULL;
+ char *snumpp = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ n = vars->nprop;
+ vars->nprop += *nsalpp;
+ vars->nsalpp = *nsalpp;
+
+ BFT_REALLOC(vars->properties_ipp, vars->nprop, int);
+ BFT_REALLOC(vars->propce, vars->nprop, int);
+ BFT_REALLOC(vars->properties_name, vars->nprop, char*);
+
+ /* ITEMP1 */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *itemp1 -1 ]-1 ];
+ vars->propce[n] = *itemp1;
+ BFT_MALLOC(vars->properties_name[n], strlen("Temp_GAZ")+1, char);
+ strcpy(vars->properties_name[n++], "Temp_GAZ");
+
+ /* IROM1 */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *irom1 -1 ]-1 ];
+ vars->propce[n] = *irom1;
+ BFT_MALLOC(vars->properties_name[n], strlen("ROM_GAZ")+1, char);
+ strcpy(vars->properties_name[n++], "ROM_GAZ");
+
+ /* YM_CHX1M */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iym1[0] -1 ]-1 ];
+ vars->propce[n] = iym1[0];
+ BFT_MALLOC(vars->properties_name[n], strlen("YM_CHx1m")+1, char);
+ strcpy(vars->properties_name[n++], "YM_CHx1m");
+
+ /* YM_CHX2M */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iym1[1] -1 ]-1 ];
+ vars->propce[n] = iym1[1];
+ BFT_MALLOC(vars->properties_name[n], strlen("YM_CHx2m")+1, char);
+ strcpy(vars->properties_name[n++], "YM_CHx2m");
+
+ /* YM_CO */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iym1[2] -1 ]-1 ];
+ vars->propce[n] = iym1[2];
+ BFT_MALLOC(vars->properties_name[n], strlen("YM_CO")+1, char);
+ strcpy(vars->properties_name[n++], "YM_CO");
+
+ /* YM_O2 */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iym1[3] -1 ]-1 ];
+ vars->propce[n] = iym1[3];
+ BFT_MALLOC(vars->properties_name[n], strlen("YM_O2")+1, char);
+ strcpy(vars->properties_name[n++], "YM_O2");
+
+ /* YM_CO2 */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iym1[4] -1 ]-1 ];
+ vars->propce[n] = iym1[4];
+ BFT_MALLOC(vars->properties_name[n], strlen("YM_CO2")+1, char);
+ strcpy(vars->properties_name[n++], "YM_CO2");
+
+ /* YM_H2O */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iym1[5] -1 ]-1 ];
+ vars->propce[n] = iym1[5];
+ BFT_MALLOC(vars->properties_name[n], strlen("YM_H2O")+1, char);
+ strcpy(vars->properties_name[n++], "YM_H2O");
+
+ /* YM_N2 */
+ vars->properties_ipp[n] = ipppro[ ipproc[ iym1[6] -1 ]-1 ];
+ vars->propce[n] = iym1[6];
+ BFT_MALLOC(vars->properties_name[n], strlen("YM_N2")+1, char);
+ strcpy(vars->properties_name[n++], "YM_N2");
+
+ /* IMEL */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *immel -1 ]-1 ];
+ vars->propce[n] = *immel;
+ BFT_MALLOC(vars->properties_name[n], strlen("XM")+1, char);
+ strcpy(vars->properties_name[n++], "XM");
+
+ /* ITEMP2 loop on classes */
+ BFT_MALLOC(name, strlen("Temp_CP")+1 + 2, char);
+ BFT_MALLOC(snumpp, 1 + 2, char);
+ strcpy(name, "Temp_CP");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ itemp2[i] -1 ]-1 ];
+ vars->propce[n] = itemp2[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Temp_CP");
+ }
+
+ /* IX2 loop on classes */
+ BFT_REALLOC(name, strlen("Frm_CP")+1 + 2, char);
+ strcpy(name, "Frm_CP");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ ix2[i] -1 ]-1 ];
+ vars->propce[n] = ix2[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Frm_CP");
+ }
+
+ /* IROM2 loop on classes */
+ BFT_REALLOC(name, strlen("Rho_CP")+1 + 2, char);
+ strcpy(name, "Rho_CP");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ irom2[i] -1 ]-1 ];
+ vars->propce[n] = irom2[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Rho_CP");
+ }
+
+ /* IDIAM2 loop on classes */
+ BFT_REALLOC(name, strlen("Dia_CK")+1 + 2, char);
+ strcpy(name, "Dia_CK");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ idiam2[i] -1 ]-1 ];
+ vars->propce[n] = idiam2[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Dia_CK");
+ }
+
+ /* IGMDCH loop on classes */
+ BFT_REALLOC(name, strlen("Ga_DCH")+1 + 2, char);
+ strcpy(name, "Ga_DCH");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ igmdch[i] -1 ]-1 ];
+ vars->propce[n] = igmdch[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Ga_DCH");
+ }
+
+ /* IGMDV1 loop on classes */
+ BFT_REALLOC(name, strlen("Ga_DV1")+1 + 2, char);
+ strcpy(name, "Ga_DV1");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ igmdv1[i] -1 ]-1 ];
+ vars->propce[n] = igmdv1[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Ga_DV1");
+ }
+
+ /* IGMDV2 loop on classes */
+ BFT_REALLOC(name, strlen("Ga_DV2")+1 + 2, char);
+ strcpy(name, "Ga_DV2");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ igmdv2[i] -1 ]-1 ];
+ vars->propce[n] = igmdv2[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Ga_DV2");
+ }
+
+ /* IGMHET loop on classes */
+ BFT_REALLOC(name, strlen("Ga_HET_O2")+1 + 2, char);
+ strcpy(name, "Ga_HET_O2");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ igmhet[i] -1 ]-1 ];
+ vars->propce[n] = igmhet[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Ga_HET_O2");
+ }
+
+ if (*ihtco2 == 1)
+ {
+ /* IGHCO2 loop on classes */
+ BFT_REALLOC(name, strlen("Ga_HET_CO2")+1 + 2, char);
+ strcpy(name, "Ga_HET_CO2");
+ for (i = 0; i < *nclass; i++)
+ {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ ighco2[i] -1 ]-1 ];
+ vars->propce[n] = ighco2[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Ga_HET_CO2");
+ }
+ }
+
+ if (ippmod[*icp3pl -1] == 1)
+ {
+ /* IGMSEC loop on classes */
+ BFT_REALLOC(name, strlen("Ga_SEC")+1 + 2, char);
+ strcpy(name, "Ga_SEC");
+ for (i = 0; i < *nclass; i++)
+ {
+ sprintf(snumpp, "%2.2i", i+1);
+ strcat(name, snumpp);
+
+ vars->properties_ipp[n] = ipppro[ ipproc[ igmsec[i] -1 ]-1 ];
+ vars->propce[n] = igmsec[i];
+ BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
+ strcpy(vars->properties_name[n++], name);
+
+ strcpy(name, "Ga_SEC");
+ }
+ }
+
+ BFT_FREE(name);
+ BFT_FREE(snumpp);
+
+ if (n != vars->nsalpp)
+ bft_error(__FILE__, __LINE__, 0,
+ _("number of properties is not correct: %i instead of: %i\n"),
+ n, vars->nsalpp);
+
+#if _XML_DEBUG_
+ bft_printf("==>UICPPR\n");
+ bft_printf("-->nombre de proprietes = %i\n", vars->nprop);
+ for (i=0 ; i<vars->nprop ; i++)
+ bft_printf("-->properties_ipp[%i]: %i propce[%i]: %i "
+ "properties_name[%i]: %s\n",
+ i, vars->properties_ipp[i],
+ i, vars->propce[i],
+ i, vars->properties_name[i]);
+#endif
+}
+
+/*------------------------------------------------------------------------------
+ * Indirection between the solver numbering and the XML one
+ * for the model scalar
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uicpsc, UICPSC) (const int *const ncharb,
+ const int *const nclass,
+ const int *const noxyd,
+ const int *const ippmod,
+ const int *const icp3pl,
+ const int *const ieqco2,
+ const int *const ihtco2,
+ const int *const ihm,
+ const int *const inp,
+ const int *const ixch,
+ const int *const ixck,
+ const int *const ixwt,
+ const int *const ih2,
+ const int *const if1m,
+ const int *const if2m,
+ const int *const if3m,
+ const int *const if3mc2,
+ const int *const if4p2m,
+ const int *const if5m,
+ const int *const if6m,
+ const int *const if7m,
+ const int *const iyco2)
+{
+ int i;
+ char *name = NULL;
+ char *snumsca = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ if (vars->nscaus > 0) {
+ BFT_REALLOC(vars->label, vars->nscapp + vars->nscaus, char*);
+ } else {
+ BFT_MALLOC(vars->label, vars->nscapp, char*);
+ }
+
+ /* IHM */
+ BFT_MALLOC(vars->label[*ihm -1], strlen("Enthalpy")+1, char);
+ strcpy(vars->label[*ihm -1], "Enthalpy");
+
+ /* Loop on classes IH2, INP, IXCH, IXCK */
+ BFT_MALLOC(snumsca, 1 + 2, char);
+
+ /* IH2 */
+ BFT_MALLOC(name, strlen("ENT_CP")+1 + 2, char);
+ strcpy(name, "ENT_CP");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumsca,"%2.2i", i+1);
+ strcat(name, snumsca);
+
+ BFT_MALLOC(vars->label[ih2[i] -1], strlen(name)+1, char);
+ strcpy(vars->label[ih2[i] -1], name);
+
+ strcpy(name, "ENT_CP");
+ }
+
+ /* INP */
+ BFT_REALLOC(name, strlen("NP_CP")+1 + 2, char);
+ strcpy(name, "NP_CP");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumsca,"%2.2i", i+1);
+ strcat(name, snumsca);
+
+ BFT_MALLOC(vars->label[inp[i] -1], strlen(name)+1, char);
+ strcpy(vars->label[inp[i] -1], name);
+
+ strcpy(name, "NP_CP");
+ }
+
+ /* IXCH */
+ BFT_REALLOC(name, strlen("XCH_CP")+1 + 2, char);
+ strcpy(name, "XCH_CP");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumsca,"%2.2i", i+1);
+ strcat(name, snumsca);
+
+ BFT_MALLOC(vars->label[ixch[i] -1], strlen(name)+1, char);
+ strcpy(vars->label[ixch[i] -1], name);
+
+ strcpy(name, "XCH_CP");
+ }
+
+ /* IXCK */
+ BFT_REALLOC(name, strlen("XCK_CP")+1 + 2, char);
+ strcpy(name, "XCK_CP");
+ for (i = 0; i < *nclass; i++) {
+ sprintf(snumsca,"%2.2i", i+1);
+ strcat(name, snumsca);
+
+ BFT_MALLOC(vars->label[ixck[i] -1], strlen(name)+1, char);
+ strcpy(vars->label[ixck[i] -1], name);
+
+ strcpy(name, "XCK_CP");
+ }
+
+ /* Loop on coals IFM1 IFM2 */
+
+ BFT_REALLOC(name, strlen("Fr_MV1")+1 + 2, char);
+ strcpy(name, "Fr_MV1");
+ for (i = 0; i < *ncharb; i++) {
+ sprintf(snumsca,"%2.2i",i+1);
+ strcat(name, snumsca);
+
+ BFT_MALLOC(vars->label[if1m[i] -1], strlen(name)+1, char);
+ strcpy(vars->label[if1m[i] -1], name);
+
+ strcpy(name, "Fr_MV1");
+ }
+
+ BFT_REALLOC(name, strlen("Fr_MV2")+1 + 2, char);
+ strcpy(name, "Fr_MV2");
+ for (i = 0; i < *ncharb; i++) {
+ sprintf(snumsca,"%2.2i",i+1);
+ strcat(name, snumsca);
+
+ BFT_MALLOC(vars->label[if2m[i] -1], strlen(name)+1, char);
+ strcpy(vars->label[if2m[i] -1], name);
+
+ strcpy(name, "Fr_MV2");
+ }
+
+ /* IF3M */
+ BFT_MALLOC(vars->label[*if3m -1], strlen("Fr_HET_O2")+1, char);
+ strcpy(vars->label[*if3m -1], "Fr_HET_O2");
+
+ if (*ihtco2 == 1)
+ {
+ /* IF3MC2 */
+ BFT_MALLOC(vars->label[*if3mc2 -1], strlen("Fr_HET_CO2")+1, char);
+ strcpy(vars->label[*if3mc2 -1], "Fr_HET_CO2");
+ }
+
+ /* IF4P2M */
+ BFT_MALLOC(vars->label[*if4p2m -1], strlen("Var_AIR")+1, char);
+ strcpy(vars->label[*if4p2m -1], "Var_AIR");
+
+ if (ippmod[*icp3pl -1] == 1)
+ {
+ /* IXWT */
+ BFT_MALLOC(name, strlen("XWT_CP")+1 + 2, char);
+ strcpy(name, "XWT_CP");
+ for (i = 0; i < *nclass; i++)
+ {
+ sprintf(snumsca,"%2.2i", i+1);
+ strcat(name, snumsca);
+
+ BFT_MALLOC(vars->label[ixwt[i] -1], strlen(name)+1, char);
+ strcpy(vars->label[ixwt[i] -1], name);
+ strcpy(name, "XWT_CP");
+ }
+
+ /* IF5M */
+ BFT_MALLOC(vars->label[*if5m -1], strlen("FR_H20")+1, char);
+ strcpy(vars->label[*if5m -1], "FR_H20");
+ }
+
+
+ if (*noxyd >= 2)
+ {
+ /* IF6M */
+ BFT_MALLOC(vars->label[*if6m -1], strlen("FR_OXYD2")+1, char);
+ strcpy(vars->label[*if6m -1], "FR_OXYD2");
+ }
+
+ if (*noxyd == 3)
+ {
+ /* IF7M */
+ BFT_MALLOC(vars->label[*if7m -1], strlen("FR_OXYD3")+1, char);
+ strcpy(vars->label[*if7m -1], "FR_OXYD3");
+ }
+
+ if (*ieqco2 == 1)
+ {
+ /* IYCO2 */
+ BFT_MALLOC(vars->label[*iyco2 -1], strlen("FR_CO2")+1, char);
+ strcpy(vars->label[*iyco2 -1], "FR_CO2");
+ }
+
+ BFT_FREE(name);
+ BFT_FREE(snumsca);
+
+#if _XML_DEBUG_
+ bft_printf("==>UICPSC\n");
+ for (i=0; i< vars->nscaus+vars->nscapp; i++)
+ bft_printf("--label of scalar[%i]: %s\n", i, vars->label[i]);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Atmospheric flows: read of meteorological file of data
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiati1
+ * *****************
+ * integer imeteo <-- on/off index
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiati1, UIATI1) (int *const imeteo)
+{
+ char *path = NULL;
+ int status = 0;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 3, "thermophysical_models",
+ "atmospheric_flows",
+ "read_meteo_data");
+
+ cs_xpath_add_attribute(&path, "status");
+ if (cs_gui_get_status(path, &status))
+ *imeteo = status;
+ BFT_FREE(path);
+
+#if _XML_DEBUG_
+ bft_printf("==>UIATI1\n");
+ bft_printf("--imeteo = %i\n", *imeteo);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Atmospheric flows: indirection between the solver numbering and the XML one
+ * for physical properties.
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiatpr
+ * *****************
+ * integer nsalpp -->
+ * integer nsalto -->
+ * integer ippmod --> specific physics indicator array
+ * integer iatmos --> index for atmospheric flow
+ * integer ipppro -->
+ * integer ipproc -->
+ * integer itempc --> index for real temperature
+ * integer iliqwt --> index for liquid water
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiatpr, UIATPR) (const int *const nsalpp,
+ const int *const nsalto,
+ const int *const ippmod,
+ const int *const iatmos,
+ const int *const ipppro,
+ const int *const ipproc,
+ const int *const itempc,
+ const int *const iliqwt)
+{
+ int n;
+ cs_var_t *vars = cs_glob_var;
+
+ n = vars->nprop;
+ vars->nprop += *nsalpp;
+ vars->nsalpp = *nsalpp;
+
+ BFT_REALLOC(vars->properties_ipp, vars->nprop, int);
+ BFT_REALLOC(vars->propce, vars->nprop, int);
+ BFT_REALLOC(vars->properties_name, vars->nprop, char*);
+
+ /* itempc */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *itempc -1 ]-1 ];
+ vars->propce[n] = *itempc;
+ BFT_MALLOC(vars->properties_name[n], strlen("real_temperature")+1, char);
+ strcpy(vars->properties_name[n++], "real_temperature");
+
+ if (ippmod[*iatmos -1] == 2)
+ {
+ /* iliqwt */
+ vars->properties_ipp[n] = ipppro[ ipproc[ *iliqwt -1 ]-1 ];
+ vars->propce[n] = *iliqwt;
+ BFT_MALLOC(vars->properties_name[n], strlen("liquid_water")+1, char);
+ strcpy(vars->properties_name[n++], "liquid_water");
+ }
+#if _XML_DEBUG_
+ {
+ int i;
+ bft_printf("==>UIATPR\n");
+ bft_printf("-->nombre de proprietes = %i\n", vars->nprop);
+ for (i=0 ; i<vars->nprop ; i++)
+ bft_printf("-->properties_ipp[%i]: %i propce[%i]: %i "
+ "properties_name[%i]: %s\n",
+ i, vars->properties_ipp[i],
+ i, vars->propce[i],
+ i, vars->properties_name[i]);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Atmospheric flows: indirection between the solver numbering and the XML one
+ * for models scalars.
+ *
+ * Fortran Interface:
+ *
+ * subroutine uiatsc
+ * *****************
+ * integer ippmod --> specific physics indicator array
+ * integer iatmos --> index for atmospheric flow
+ * integer itempp --> index for potential temperature
+ * integer itempl --> index for liquid potential temperature
+ * integer itotwt --> index for total water content
+ * integer intdrp --> index for total number of droplets
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (uiatsc, UIATSC) (const int *const ippmod,
+ const int *const iatmos,
+ const int *const itempp,
+ const int *const itempl,
+ const int *const itotwt,
+ const int *const intdrp)
+{
+ cs_var_t *vars = cs_glob_var;
+
+ if (vars->nscaus > 0)
+ {
+ BFT_REALLOC(vars->label, vars->nscapp + vars->nscaus, char*);
+ }
+ else
+ {
+ BFT_MALLOC(vars->label, vars->nscapp, char*);
+ }
+
+ if (ippmod[*iatmos -1] == 1)
+ {
+ /* itempp */
+ BFT_MALLOC(vars->label[*itempp -1], strlen("potential_temperature")+1, char);
+ strcpy(vars->label[*itempp -1], "potential_temperature");
+ }
+ else if (ippmod[*iatmos -1] == 2)
+ {
+ /* itempl */
+ BFT_MALLOC(vars->label[*itempl -1], strlen("liquid_potential_temperature")+1, char);
+ strcpy(vars->label[*itempl -1], "liquid_potential_temperature");
+
+ /* itotwt */
+ BFT_MALLOC(vars->label[*itotwt -1], strlen("total_water")+1, char);
+ strcpy(vars->label[*itotwt -1], "total_water");
+
+ /* intdrp */
+ BFT_MALLOC(vars->label[*intdrp -1], strlen("number_of_droplets")+1, char);
+ strcpy(vars->label[*intdrp -1], "number_of_droplets");
+ }
+#if _XML_DEBUG_
+ {
+ int i;
+ bft_printf("==>UIATSC\n");
+ for (i=0; i< vars->nscaus+vars->nscapp; i++)
+ bft_printf("--label of scalar[%i]: %s\n", i, vars->label[i]);
+ }
+#endif
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the name of a thermophysical model.
+ *
+ * parameter:
+ * model_thermo --> thermophysical model
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_gui_get_thermophysical_model(const char *const model_thermo)
+{
+ char *model = NULL;
+ char *path = NULL;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_elements(&path, 2, "thermophysical_models", model_thermo);
+ cs_xpath_add_attribute(&path, "model");
+
+ model = cs_gui_get_attribute_value(path);
+
+ BFT_FREE(path);
+
+ return model;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return 1 if a specific physics model is activated. Store in the global
+ * structure vars:
+ * vars->model <= thermophysical model
+ * vars->model_value <= related model name
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_activ_thermophysical_model(void)
+{
+ int i, isactiv = 0;
+ char *value = NULL;
+
+ cs_var_t *vars = cs_glob_var;
+
+ const char *name[] = { "pulverized_coal",
+ "gas_combustion",
+ "joule_effect",
+ "atmospheric_flows" };
+ int name_nbr = sizeof(name) / sizeof(name[0]);
+
+ if (vars->model != NULL && vars->model_value != NULL)
+ {
+ isactiv = 1;
+ return isactiv;
+ }
+ else
+ {
+ vars->model = NULL;
+ vars->model_value = NULL;
+ }
+
+ for (i = 0; i < name_nbr; i++)
+ {
+ value = cs_gui_get_thermophysical_model(name[i]);
+
+ if (value && !cs_gui_strcmp(value, "off"))
+ {
+ BFT_MALLOC(vars->model, strlen(name[i])+1, char);
+ strcpy(vars->model, name[i]);
+
+ BFT_MALLOC(vars->model_value, strlen(value)+1, char);
+ strcpy(vars->model_value, value);
+
+ isactiv = 1;
+ break;
+ }
+ }
+
+ BFT_FREE(value);
+
+ return isactiv;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_gui_util.c b/src/base/cs_gui_util.c
new file mode 100644
index 0000000..4d59450
--- /dev/null
+++ b/src/base/cs_gui_util.c
@@ -0,0 +1,1099 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the GUI parameters file: xpath request and utilities
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * libxml2 library headers
+ *----------------------------------------------------------------------------*/
+
+#if defined(HAVE_LIBXML2)
+
+#include <libxml/tree.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_gui_util.h"
+
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define XML_READER_VERSION 1.0
+
+/*=============================================================================
+ * Global variables
+ *============================================================================*/
+
+#if defined(HAVE_LIBXML2)
+xmlDocPtr docxml = NULL; /* Pointer on the XML document */
+xmlXPathContextPtr xpathCtx = NULL; /* Pointer on the XPath Context */
+xmlNodePtr node = NULL; /* Pointer on the root node */
+const char *xmlRootName = NULL; /* Name of the root node */
+#endif
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*-----------------------------------------------------------------------------
+ * Return the information if the requested xml file is missing or not.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE CSIHMP (IIHMPR)
+ * *****************
+ *
+ * INTEGER IIHMPR <-- 1 if the file exists, 0 otherwise
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (csihmp, CSIHMP) (int *const iihmpr)
+{
+#if defined(HAVE_LIBXML2)
+ if (docxml == NULL)
+ *iihmpr = 0;
+ else
+ *iihmpr = 1;
+#else
+ *iihmpr = 0;
+#endif
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Load the xml file in memory. Return an error code for the main program.
+ *
+ * parameter:
+ * filename --> xml file containing the parameters
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_file_loading(const char *const filename)
+{
+#if defined(HAVE_LIBXML2)
+
+ int file_descriptor = 0;
+ int argerr = 0;
+
+ assert(filename);
+
+ /* Verification of the existence of the file while opening it */
+
+ file_descriptor = open(filename, O_RDONLY);
+
+ if (file_descriptor == -1) {
+
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf( _("Unable to open the file: %s\n"), filename);
+ argerr = 2;
+ return argerr;
+
+ }
+ else {
+
+ /* If file exists, close it. It will be reopen by xmlParseFile */
+ close(file_descriptor);
+
+ }
+
+ /* libxml initialization */
+ xmlInitParser();
+ LIBXML_TEST_VERSION
+
+ /* Loading the xml file */
+ docxml = xmlParseFile(filename);
+
+
+ if (docxml == NULL) {
+
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf (_("Unable to parse the file: %s\n"), filename);
+ argerr = 2;
+
+ }
+ else {
+
+ /* Contexte definition */
+ xpathCtx = xmlXPathNewContext(docxml);
+
+ /* Get the root node of the xml document and more particularly
+ of its label */
+ node = xmlDocGetRootElement(docxml);
+ xmlRootName = (const char*) node->name;
+
+ }
+
+ /* Check the Interface version */
+ cs_gui_get_version();
+
+ return argerr;
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Code_Saturne has been compiled without Xml support."));
+
+ return -1;
+
+#endif
+}
+
+/*-----------------------------------------------------------------------------
+ * Check the xml file version.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_get_version(void)
+{
+ char *path;
+ char *version;
+ double version_number;
+ double version_sat = XML_READER_VERSION;
+ double major, minus;
+ double maj_sat, min_sat;
+
+ path = cs_xpath_init_path();
+ cs_xpath_add_attribute(&path, "version");
+
+ version = cs_gui_get_attribute_value(path);
+ version_number = atof(version);
+
+ minus = modf(version_number, &major);
+ min_sat = modf(version_sat, &maj_sat);
+
+ if (major != maj_sat)
+ bft_error(__FILE__, __LINE__, 0,
+ _("========================================================\n"
+ " ** INVALID VERSION OF THE XML FILE\n"
+ " -------------------------------------- \n"
+ " XML FILE VERSION: %.1f \n"
+ " XML READER VERSION: %.1f \n"
+ "========================================================\n"),
+ version_number, version_sat);
+
+ if (minus != min_sat) {
+
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("========================================================\n"
+ " ** INCOMPATIBLE VERSION OF THE XML FILE\n"
+ " -------------------------------------- \n"
+ " XML FILE VERSION: %.1f \n"
+ " XML READER VERSION: %.1f \n"
+ "\n"
+ " YOU SHOULD RESTART YOUR CALCUL WITH A NEW XML FILE\n"
+ "========================================================\n"),
+ version_number, version_sat);
+
+ }
+
+ BFT_FREE(version);
+ BFT_FREE(path);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize the path for the xpath request with the root node.
+ * Return the root path.
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_xpath_init_path(void)
+{
+#if defined(HAVE_LIBXML2)
+
+ char *path = NULL;
+
+ BFT_MALLOC(path, strlen("/") + strlen(xmlRootName) + 1, char);
+ strcpy(path, "/");
+ strcat(path, xmlRootName);
+
+ return path;
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Code_Saturne has been compiled without Xml support."));
+
+ return NULL;
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize the path for the xpath request with a short way.
+ * Return the short path.
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_xpath_short_path(void)
+{
+ char *path = NULL;
+
+ BFT_MALLOC(path, strlen("/")+1, char);
+ strcpy(path, "/");
+
+ return path;
+}
+
+/*----------------------------------------------------------------------------
+ * Add all element (*) to the path.
+ *
+ * parameter:
+ * path <--> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_all_elements(char **path)
+{
+ assert(path);
+
+ BFT_REALLOC(*path,
+ strlen(*path) +strlen("/*") +1,
+ char);
+
+ strcat(*path, "/*");
+}
+
+/*----------------------------------------------------------------------------
+ * Add an element (i.e. markup's label) to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * element --> label of the new element in the path
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_element( char ** path,
+ const char *const element)
+{
+ assert(path);
+
+ if (element != NULL) {
+
+ BFT_REALLOC(*path,
+ strlen(*path)+ strlen(element)+ strlen("/") +1,
+ char);
+
+ strcat(*path, "/");
+ strcat(*path, element);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Add a list of elements (i.e. markup's label) to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * nbr --> size of the labels list
+ * ... --> list of labels of new elements in the path
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_elements( char **path,
+ const int nbr, ...)
+{
+ va_list list;
+ char *elt = NULL;
+ int i;
+
+ assert(path);
+
+ va_start(list, nbr);
+
+ for(i=0; i<nbr; i++) {
+
+ elt = va_arg(list, char *);
+
+ if (elt != NULL) {
+
+ BFT_REALLOC(*path,
+ strlen(*path)+ strlen(elt)+ strlen("/") +1,
+ char);
+
+ strcat(*path, "/");
+ strcat(*path, elt);
+ }
+ }
+
+ va_end(list);
+}
+
+/*----------------------------------------------------------------------------
+ * Add an element's attribute to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * attribute_name --> label of the new attribute in the path
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_attribute( char **path,
+ const char *const attribute_name)
+{
+ assert(path);
+ assert(attribute_name);
+
+ BFT_REALLOC(*path,
+ strlen(*path)+ strlen(attribute_name)+ strlen("/@")+1,
+ char);
+
+ strcat(*path, "/@");
+ strcat(*path, attribute_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Add the i'st element to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * element --> label of the new element in the path
+ * num --> number of the element's markup
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_element_num( char ** path,
+ const char *const element,
+ const int num)
+{
+ int nfigures = 0;
+ char *strnum = NULL;
+
+ assert(path);
+ assert(element);
+
+ nfigures = cs_gui_characters_number(num);
+
+ BFT_MALLOC(strnum, nfigures+1, char);
+
+ BFT_REALLOC(*path,
+ strlen(*path)+
+ strlen("/")+
+ strlen(element)+
+ strlen("[")+
+ nfigures+
+ strlen("]")+1,
+ char);
+
+ strcat(*path, "/");
+ strcat(*path, element);
+ sprintf(strnum,"%d", num);
+ strcat(*path, "[");
+ strcat(*path, strnum);
+ strcat(*path, "]");
+
+ BFT_FREE(strnum);
+}
+
+/*----------------------------------------------------------------------------
+ * Add a test on a value associated to an attribute to the path.
+ *
+ * parameters:
+ * path <--> path for the xpath request
+ * attribute_type --> label of the attribute for the test in the path
+ * attribute_value --> value of the attribute for the test in the path
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_test_attribute( char ** path,
+ const char *const attribute_type,
+ const char *const attribute_value)
+{
+ assert(path);
+ assert(attribute_type);
+ assert(attribute_value);
+
+ BFT_REALLOC(*path, strlen(*path)+
+ strlen("[@")+
+ strlen(attribute_type)+
+ strlen("='")+
+ strlen(attribute_value)+
+ strlen("']")+1,
+ char);
+
+ strcat(*path, "[@");
+ strcat(*path, attribute_type);
+ strcat(*path, "='");
+ strcat(*path, attribute_value);
+ strcat(*path, "']");
+}
+
+/*----------------------------------------------------------------------------
+ * Add the 'text()' xpath function to the path.
+ *
+ * parameter:
+ * path <--> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+void
+cs_xpath_add_function_text(char **path)
+{
+ assert(path);
+
+ BFT_REALLOC(*path,
+ strlen(*path)+ strlen("/text()")+1,
+ char);
+
+ strcat(*path, "/text()");
+}
+
+/*----------------------------------------------------------------------------
+ * Return a list of attributes nodes name from the xpath request in an array.
+ * Example: from <a attr="c"/><b attr="d"/> return {c,d}
+ *
+ * parameter:
+ * path --> path for the xpath request
+ * size <-- array size
+ *----------------------------------------------------------------------------*/
+
+char**
+cs_gui_get_attribute_values(char *const path,
+ int *const size)
+{
+#if defined(HAVE_LIBXML2)
+
+ char **nodes_name = NULL;
+ xmlNodeSetPtr nodes;
+ xmlNodePtr cur;
+ xmlXPathObjectPtr xpathObj;
+ int i;
+
+ assert(path);
+
+ xpathObj = xmlXPathEvalExpression(BAD_CAST path, xpathCtx);
+
+ if (xpathObj == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ nodes = xpathObj->nodesetval;
+ *size = (nodes) ? nodes->nodeNr : 0;
+
+ if (*size != 0) {
+
+ BFT_MALLOC(nodes_name, *size, char*);
+
+ for (i =0; i < *size; i++) {
+ assert(nodes->nodeTab[0]);
+
+ if (nodes->nodeTab[i]->type == XML_ATTRIBUTE_NODE) {
+ cur = nodes->nodeTab[i];
+ BFT_MALLOC(nodes_name[i],
+ strlen((char *) cur->children->content)+1,
+ char);
+ strcpy(nodes_name[i], (char*) cur->children->content);
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("The node type is not XML_ATTRIBUTE_NODE.\nXpath: %s\n"),
+ path);
+ }
+ }
+
+ xmlXPathFreeObject(xpathObj);
+ return nodes_name;
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Code_Saturne has been compiled without Xml support."));
+
+ return NULL;
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Return the value of an element's attribute.
+ * Example: from <a b="c"/> return c
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_gui_get_attribute_value(char *const path)
+{
+ char **array = NULL;
+ char *attr = NULL;
+ int size;
+
+ array = cs_gui_get_attribute_values(path, &size);
+
+ if ((array == NULL) || (size == 0))
+ return NULL;
+
+ if (size > 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Several attributes found: %i \n"
+ "The first one is %s \nXpath: %s\n"),
+ size, array[0], path);
+
+ BFT_MALLOC(attr, strlen(array[0])+1, char);
+ strcpy(attr, array[0]);
+
+ BFT_FREE(array[0]);
+ BFT_FREE(array);
+
+ return attr;
+}
+
+/*----------------------------------------------------------------------------
+ * Return a list of children nodes name from the xpath request in an array.
+ * Example: from <a>3<\a><b>4<\b> return {a,b}
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * size <-- array size
+ *----------------------------------------------------------------------------*/
+
+char**
+cs_gui_get_nodes_name(char *const path,
+ int *const size)
+{
+#if defined(HAVE_LIBXML2)
+
+ char **nodes_name = NULL;
+ xmlXPathObjectPtr xpathObj;
+ xmlNodeSetPtr nodes;
+ xmlNodePtr cur;
+ int i;
+
+ assert(path);
+
+ xpathObj = xmlXPathEvalExpression(BAD_CAST path, xpathCtx);
+
+ if (xpathObj == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ nodes = xpathObj->nodesetval;
+ *size = (nodes) ? nodes->nodeNr : 0;
+
+ if (*size != 0) {
+
+ BFT_MALLOC(nodes_name, *size, char*);
+
+ for (i =0; i < *size; i++) {
+ assert(nodes->nodeTab[0]);
+
+ if (nodes->nodeTab[i]->type == XML_ELEMENT_NODE) {
+ cur = nodes->nodeTab[i];
+ BFT_MALLOC(nodes_name[i], strlen((const char *) cur->name)+1, char);
+ strcpy(nodes_name[i], (const char*) cur->name);
+ } else
+ bft_error(__FILE__, __LINE__, 0,
+ _("The node type is not XML_ELEMENT_NODE.\nXpath: %s\n"),
+ path);
+ }
+ }
+
+ xmlXPathFreeObject(xpathObj);
+ return nodes_name;
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Code_Saturne has been compiled without Xml support."));
+
+ return NULL;
+
+#endif
+}
+
+
+/*----------------------------------------------------------------------------
+ * Return a single node's name from the xpath request.
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_gui_get_node_name(char *const path)
+{
+ char **array = NULL;
+ char *name = NULL;
+ int size;
+
+ array = cs_gui_get_nodes_name(path, &size);
+
+ if ((array == NULL) || (size == 0))
+ return NULL;
+
+ if (size > 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Several nodes name found: %i \n"
+ "The first one is %s \nXpath: %s\n"),
+ size, array[0], path);
+
+ BFT_MALLOC(name, strlen(array[0])+1, char);
+ strcpy(name, array[0]);
+
+ BFT_FREE(array[0]);
+ BFT_FREE(array);
+
+ return name;
+}
+
+/*----------------------------------------------------------------------------
+ * Return a list of children text nodes from the xpath request in an array.
+ * Example: from <a>3<\a><a>4<\a> return {3,4}
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * size <-- array size
+ *----------------------------------------------------------------------------*/
+
+char**
+cs_gui_get_text_values(char *const path,
+ int *const size)
+{
+#if defined(HAVE_LIBXML2)
+
+ char **text_name = NULL;
+ xmlXPathObjectPtr xpathObj;
+ xmlNodeSetPtr nodes;
+ xmlNodePtr cur;
+ int i;
+
+ assert(path);
+
+ xpathObj = xmlXPathEvalExpression(BAD_CAST path, xpathCtx);
+
+ if (xpathObj == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ nodes = xpathObj->nodesetval;
+ *size = (nodes) ? nodes->nodeNr : 0;
+
+ if (*size != 0) {
+
+ BFT_MALLOC(text_name, *size, char*);
+
+ for (i =0; i < *size; i++) {
+
+ assert(nodes->nodeTab[0]);
+
+ if (nodes->nodeTab[i]->type == XML_TEXT_NODE) {
+ cur = nodes->nodeTab[i];
+ BFT_MALLOC(text_name[i], strlen((char *) cur->content)+1, char);
+ strcpy(text_name[i], (char*) cur->content);
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("The node type is not XML_TEXT_NODE.\nXpath: %s\n"),
+ path);
+ }
+ }
+
+ xmlXPathFreeObject(xpathObj);
+ return text_name;
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Code_Saturne has been compiled without Xml support."));
+
+ return NULL;
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Return a single children text node from the xpath request.
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+char*
+cs_gui_get_text_value(char *const path)
+{
+ char **array = NULL;
+ char *text = NULL;
+ int size;
+
+ array = cs_gui_get_text_values(path, &size);
+
+ if ((array == NULL) || (size == 0))
+ return NULL;
+
+ if (size > 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Several text node found: %i \n"
+ "The first one is %s \nXpath: %s\n"),
+ size, array[0], path);
+
+ BFT_MALLOC(text, strlen(array[0])+1, char);
+ strcpy(text, array[0]);
+
+ BFT_FREE(array[0]);
+ BFT_FREE(array);
+
+ return text;
+}
+
+/*----------------------------------------------------------------------------
+ * Modify the value parameter and return 1 if the xpath request succeeded,
+ * otherwise just return 0.
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * value <-- double result of the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_double(char *const path,
+ double *const value)
+{
+ char *text_name = NULL;
+ int test;
+
+ text_name = cs_gui_get_text_value(path);
+
+ if (text_name == NULL)
+ test = 0;
+ else {
+ *value = atof(text_name);
+ BFT_FREE(text_name);
+ test = 1;
+ }
+ return test;
+}
+
+/*----------------------------------------------------------------------------
+ * Modify the value parameter and return 1 if the xpath request succeeded,
+ * otherwise just return 0.
+ *
+ * parameters:
+ * path --> path for the xpath request
+ * value <-- integer result of the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_int(char *const path,
+ int *const value)
+{
+ char *text_name = NULL;
+ int test;
+
+ text_name = cs_gui_get_text_value(path);
+
+ if (text_name == NULL)
+ test = 0;
+ else {
+ *value = atoi(text_name);
+ BFT_FREE(text_name);
+ test = 1;
+ }
+ return test;
+}
+
+/*----------------------------------------------------------------------------
+ * Return the number of elements (i.e. the number of xml markups)
+ * from a xpath request.
+ * Example: from <a>3<\a><a>4<\a> return 2
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_nb_element(char *const path)
+{
+#if defined(HAVE_LIBXML2)
+
+ xmlXPathObjectPtr xpathObj;
+ int nb;
+
+ assert(path);
+
+ xpathObj = xmlXPathEvalExpression(BAD_CAST path, xpathCtx);
+
+ if (xpathObj == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ nb = (xpathObj->nodesetval) ? xpathObj->nodesetval->nodeNr : 0;
+
+ xmlXPathFreeObject(xpathObj);
+
+ return nb;
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Code_Saturne has been compiled without Xml support."));
+
+ return 0;
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Return the integer max value from a list, which is a xpath request result.
+ * Example: from <a>3<\a><a>4<\a> return 4
+ *
+ * parameter:
+ * path --> path for the xpath request
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_max_value(char *const path)
+{
+#if defined(HAVE_LIBXML2)
+
+ xmlXPathObjectPtr xpathObj;
+ xmlNodeSetPtr nodes;
+ xmlNodePtr cur;
+ int max_val=0;
+ int size;
+ int i;
+
+ assert(path);
+
+ xpathObj = xmlXPathEvalExpression(BAD_CAST path, xpathCtx);
+
+ if (xpathObj == NULL)
+ bft_error(__FILE__, __LINE__, 0, _("Invalid xpath: %s\n"), path);
+
+ nodes=xpathObj->nodesetval;
+ size = (nodes) ? nodes->nodeNr : 0;
+
+ if (size == 0)
+ bft_error (__FILE__, __LINE__, 0, _("No markup found: %s \n"), path);
+
+ else {
+ for (i=0; i <size; i++) {
+ assert(nodes->nodeTab[i]);
+ if(nodes->nodeTab[i]->type == XML_TEXT_NODE) {
+ cur = nodes->nodeTab[i];
+ max_val = CS_MAX(max_val, atoi((char*) cur->content));
+ }
+ else {
+ bft_error(__FILE__, __LINE__, 0,
+ _("The node type is not XML_TEXT_NODE.\nXpath: %s\n"), path);
+ }
+ }
+ }
+
+ xmlXPathFreeObject(xpathObj);
+
+ return max_val;
+
+#else
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Code_Saturne has been compiled without Xml support."));
+
+ return 0;
+
+#endif
+}
+
+/*-----------------------------------------------------------------------------
+ * Evaluate the "status" attribute value.
+ * Return 1 if the xpath request has succeeded, 0 otherwise.
+ *
+ * parameter:
+ * path --> path for the xpath request
+ * result <-- status="on" return 1, status="off" return 0
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_status(char *const path,
+ int *const result)
+{
+ char *status;
+ int istatus;
+
+ status = cs_gui_get_attribute_value(path);
+
+ if (status == NULL)
+ istatus = 0;
+ else {
+ istatus = 1;
+
+ if (cs_gui_strcmp(status, "on"))
+ *result = 1;
+ else if (cs_gui_strcmp(status, "off"))
+ *result = 0;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Invalid attribute value: %s \nXpath: %s\n"), status, path);
+
+ BFT_FREE(status);
+ }
+
+ return istatus;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the xml markup quantity
+ *
+ * parameters:
+ * markup --> path for the markup
+ * flag --> 1: initialize the path with the root node;
+ * 0: initialize the path with a short way
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_get_tag_number(const char *const markup, const int flag)
+{
+ char *path = NULL;
+ int number = 0;
+
+ if (flag) {
+ path = cs_xpath_init_path();
+ } else {
+ BFT_MALLOC(path, strlen("/")+1, char);
+ strcpy(path, "/");
+ }
+ cs_xpath_add_element(&path, markup);
+ number = cs_gui_get_nb_element(path);
+
+ BFT_FREE(path);
+
+ return number;
+}
+
+/*-----------------------------------------------------------------------------
+ * Return the number of characters needed to write an integer number
+ *
+ * parameter:
+ * num --> integer number
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_characters_number(const int num)
+{
+ int i = 1;
+ int number = 0;
+
+ assert(num > 0);
+
+ if (num == 0)
+ number ++;
+ else
+ for (i=1; i <= num; i *= 10)
+ number++;
+
+ return number;
+}
+
+/*-----------------------------------------------------------------------------
+ * Comparison between two string: return 1 if the two string are equal, 0
+ * otherwise.
+ *
+ * parameters:
+ * s1 --> first string
+ * s2 --> second string
+ *----------------------------------------------------------------------------*/
+
+int
+cs_gui_strcmp(const char *const s1,
+ const char *const s2)
+{
+ if (s1 == NULL || s2 == NULL) return 0;
+ if ( strlen(s1) != strlen(s2)) return 0;
+ if (!strncmp(s1, s2, strlen(s1))) return 1;
+ return 0;
+}
+
+/*-----------------------------------------------------------------------------
+ * Copy a C string into a Fortran string.
+ *
+ * parameters:
+ * chainef <--> Fortran string
+ * chainc --> C string
+ * lstrF --> maximum length of the Fortran string
+ *----------------------------------------------------------------------------*/
+
+void
+cs_gui_strcpy_c2f( char *const chainef,
+ const char *const chainec,
+ const int lstrF)
+{
+ int i;
+
+ assert(chainec != NULL);
+ assert(lstrF > 0);
+
+ strncpy(chainef, chainec, strlen(chainec));
+
+ for (i = strlen(chainec); i < lstrF ; i++)
+ chainef[i] = ' ';
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_halo.c b/src/base/cs_halo.c
new file mode 100644
index 0000000..29f0661
--- /dev/null
+++ b/src/base/cs_halo.c
@@ -0,0 +1,1268 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions dealing with ghost cells
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_interface.h>
+#include <fvm_periodicity.h>
+#include <fvm_order.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_halo.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Number of defined halos */
+
+static int _cs_glob_n_halos = 0;
+
+#if defined(HAVE_MPI)
+
+/* Send buffer for synchronization */
+
+static size_t _cs_glob_halo_send_buffer_size = 0;
+static void *_cs_glob_halo_send_buffer = NULL;
+
+/* MPI Request and status arrays */
+
+static int _cs_glob_halo_request_size = 0;
+static MPI_Request *_cs_glob_halo_request = NULL;
+static MPI_Status *_cs_glob_halo_status = NULL;
+
+#endif
+
+/* Buffer to save rotation halo values */
+
+static size_t _cs_glob_halo_rot_backup_size = 0;
+static cs_real_t *_cs_glob_halo_rot_backup = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Save rotation terms of a halo to an internal buffer.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * var --> variable whose halo rotation terms are to be saved
+ * (size: halo->n_local_elts + halo->n_elts[opt_type])
+ *----------------------------------------------------------------------------*/
+
+static void
+_save_rotation_values(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ const cs_real_t var[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ size_t save_count = 0;
+
+ cs_real_t *save_buffer = _cs_glob_halo_rot_backup;
+
+ const int n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = halo->periodicity;
+
+ assert(halo != NULL);
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ /* Loop on transforms */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ if ( fvm_periodicity_get_type(periodicity, t_id)
+ >= FVM_PERIODICITY_ROTATION) {
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = n_elts + halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++)
+ save_buffer[save_count++] = var[i];
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = n_elts + halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++)
+ save_buffer[save_count++] = var[i];
+
+ }
+
+ }
+
+ } /* End if perio_type >= FVM_PERIODICITY_ROTATION) */
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Restore rotation terms of a halo from an internal buffer.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * var <-> variable whose halo rotation terms are to be restored
+ *----------------------------------------------------------------------------*/
+
+static void
+_restore_rotation_values(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ size_t restore_count = 0;
+
+ const cs_real_t *save_buffer = _cs_glob_halo_rot_backup;
+ const int n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = halo->periodicity;
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ /* Loop on transforms */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ if ( fvm_periodicity_get_type(periodicity, t_id)
+ >= FVM_PERIODICITY_ROTATION) {
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = n_elts + halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++)
+ var[i] = save_buffer[restore_count++];
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = n_elts + halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++)
+ var[i] = save_buffer[restore_count++];
+
+ }
+
+ }
+
+ } /* End if perio_type >= FVM_PERIODICITY_ROTATION) */
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Set rotation terms of a halo to zero.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * var <-> variable whose halo rotation terms are to be zeroed
+ *----------------------------------------------------------------------------*/
+
+static void
+_zero_rotation_values(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ const int n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = halo->periodicity;
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ /* Loop on transforms */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ if ( fvm_periodicity_get_type(periodicity, t_id)
+ >= FVM_PERIODICITY_ROTATION) {
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = n_elts + halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++)
+ var[i] = 0.0;
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = n_elts + halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++)
+ var[i] = 0.0;
+
+ }
+
+ }
+
+ } /* End if perio_type >= FVM_PERIODICITY_ROTATION) */
+
+ }
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a halo structure.
+ *
+ * parameters:
+ * ifs --> pointer to a fvm_interface_set structure
+ *
+ * returns:
+ * pointer to created cs_halo_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_halo_t *
+cs_halo_create(fvm_interface_set_t *ifs)
+{
+ cs_int_t i, tmp_id, perio_lst_size;
+
+ cs_int_t loc_id = -1;
+
+ cs_halo_t *halo = NULL;
+
+ const fvm_interface_t *interface = NULL;
+
+ BFT_MALLOC(halo, 1, cs_halo_t);
+
+ halo->n_c_domains = fvm_interface_set_size(ifs);
+ halo->n_transforms = 0;
+
+ halo->periodicity = fvm_interface_set_periodicity(ifs);
+ halo->n_rotations = 0;
+
+ halo->n_local_elts = 0;
+
+ for (i = 0; i < CS_HALO_N_TYPES; i++) {
+ halo->n_send_elts[i] = 0;
+ halo->n_elts [i] = 0;
+ }
+
+ BFT_MALLOC(halo->c_domain_rank, halo->n_c_domains, int);
+
+ /* Check if cs_glob_rank_id belongs to interface set in order to
+ order ranks with local rank at first place */
+
+ for (i = 0; i < halo->n_c_domains; i++) {
+
+ interface = fvm_interface_set_get(ifs, i);
+ halo->c_domain_rank[i] = fvm_interface_rank(interface);
+
+ if (cs_glob_rank_id == fvm_interface_rank(interface))
+ loc_id = i;
+
+ } /* End of loop on ranks */
+
+ if (loc_id > 0) {
+
+ tmp_id = halo->c_domain_rank[loc_id];
+ halo->c_domain_rank[loc_id] = halo->c_domain_rank[0];
+ halo->c_domain_rank[0] = tmp_id;
+
+ }
+
+ /* Order ranks */
+
+ if ( halo->n_c_domains > 2
+ && fvm_order_local_test(&(halo->c_domain_rank[1]),
+ NULL,
+ halo->n_c_domains-1) == 0) {
+
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *buffer = NULL;
+
+ assert(sizeof(fvm_lnum_t) == sizeof(cs_int_t));
+
+ BFT_MALLOC(order, halo->n_c_domains - 1, fvm_lnum_t);
+ BFT_MALLOC(buffer, halo->n_c_domains - 1, fvm_gnum_t);
+
+ for (i = 1; i < halo->n_c_domains; i++)
+ buffer[i-1] = (fvm_gnum_t)halo->c_domain_rank[i];
+
+ fvm_order_local_allocated(NULL,
+ buffer,
+ order,
+ halo->n_c_domains - 1);
+
+ for (i = 0; i < halo->n_c_domains - 1; i++)
+ halo->c_domain_rank[i+1] = (cs_int_t)buffer[order[i]];
+
+ BFT_FREE(buffer);
+ BFT_FREE(order);
+
+ } /* End of ordering ranks */
+
+ BFT_MALLOC(halo->send_index, 2*halo->n_c_domains + 1, cs_int_t);
+ BFT_MALLOC(halo->index, 2*halo->n_c_domains + 1, cs_int_t);
+
+ for (i = 0; i < 2*halo->n_c_domains + 1; i++) {
+ halo->send_index[i] = 0;
+ halo->index[i] = 0;
+ }
+
+ halo->send_perio_lst = NULL;
+ halo->perio_lst = NULL;
+
+ if (halo->periodicity != NULL) {
+
+ halo->n_transforms = fvm_periodicity_get_n_transforms(halo->periodicity);
+
+ for (i = 0; i < halo->n_transforms; i++) {
+ if ( fvm_periodicity_get_type(halo->periodicity, i)
+ >= FVM_PERIODICITY_ROTATION)
+ halo->n_rotations += 1;
+ }
+
+ /* We need 2 values per transformation and there are n_transforms
+ transformations. For each rank, we need a value for standard and
+ extended halo. */
+
+ perio_lst_size = 2*halo->n_transforms * 2*halo->n_c_domains;
+
+ BFT_MALLOC(halo->send_perio_lst, perio_lst_size, cs_int_t);
+ BFT_MALLOC(halo->perio_lst, perio_lst_size, cs_int_t);
+
+ for (i = 0; i < perio_lst_size; i++) {
+ halo->send_perio_lst[i] = 0;
+ halo->perio_lst[i] = 0;
+ }
+
+ }
+
+ halo->send_list = NULL;
+
+ _cs_glob_n_halos += 1;
+
+ return halo;
+}
+
+/*----------------------------------------------------------------------------
+ * Create a halo structure, using a reference halo
+ *
+ * parameters:
+ * ref --> pointer to reference halo
+ *
+ * returns:
+ * pointer to created cs_halo_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_halo_t *
+cs_halo_create_from_ref(const cs_halo_t *ref)
+{
+ cs_int_t i;
+
+ cs_halo_t *halo = NULL;
+
+ BFT_MALLOC(halo, 1, cs_halo_t);
+
+ halo->n_c_domains = ref->n_c_domains;
+ halo->n_transforms = ref->n_transforms;
+
+ halo->periodicity = ref->periodicity;
+ halo->n_rotations = ref->n_rotations;
+
+ halo->n_local_elts = 0;
+
+ BFT_MALLOC(halo->c_domain_rank, halo->n_c_domains, int);
+
+ for (i = 0; i < halo->n_c_domains; i++)
+ halo->c_domain_rank[i] = ref->c_domain_rank[i];
+
+ BFT_MALLOC(halo->send_index, 2*halo->n_c_domains + 1, cs_int_t);
+ BFT_MALLOC(halo->index, 2*halo->n_c_domains + 1, cs_int_t);
+
+ for (i = 0; i < 2*halo->n_c_domains + 1; i++) {
+ halo->send_index[i] = 0;
+ halo->index[i] = 0;
+ }
+
+ halo->send_perio_lst = NULL;
+ halo->perio_lst = NULL;
+
+ if (halo->n_transforms > 0) {
+
+ cs_int_t perio_lst_size = 2*halo->n_transforms * 2*halo->n_c_domains;
+
+ BFT_MALLOC(halo->send_perio_lst, perio_lst_size, cs_int_t);
+ BFT_MALLOC(halo->perio_lst, perio_lst_size, cs_int_t);
+
+ for (i = 0; i < perio_lst_size; i++) {
+ halo->send_perio_lst[i] = 0;
+ halo->perio_lst[i] = 0;
+ }
+
+ }
+
+ halo->send_list = NULL;
+
+ _cs_glob_n_halos += 1;
+
+ return halo;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a halo structure
+ *
+ * parameters:
+ * halo --> pointer to cs_halo_t structure to destroy
+ *
+ * Returns:
+ * pointer to deleted halo structure (NULL)
+ *---------------------------------------------------------------------------*/
+
+cs_halo_t *
+cs_halo_destroy(cs_halo_t *halo)
+{
+ if (halo == NULL)
+ return NULL;
+
+ halo->n_c_domains = 0;
+ BFT_FREE(halo->c_domain_rank);
+
+ BFT_FREE(halo->send_perio_lst);
+ BFT_FREE(halo->send_index);
+ BFT_FREE(halo->perio_lst);
+ BFT_FREE(halo->index);
+
+ if (halo->send_list != NULL)
+ BFT_FREE(halo->send_list);
+
+ BFT_FREE(halo);
+
+ _cs_glob_n_halos -= 1;
+
+ /* Delete buffers if no halo remains */
+
+ if (_cs_glob_n_halos == 0) {
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ _cs_glob_halo_send_buffer_size = 0;
+ _cs_glob_halo_request_size = 0;
+
+ BFT_FREE(_cs_glob_halo_send_buffer);
+
+ BFT_FREE(_cs_glob_halo_request);
+ BFT_FREE(_cs_glob_halo_status);
+ }
+
+#endif
+
+ }
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Update global buffer sizes so as to be usable with a given halo.
+ *
+ * Calls to halo synchronizations with variable strides up to 3 are
+ * expected. For strides greater than 3, the halo will be resized if
+ * necessary directly by the synchronization function.
+ *
+ * This function should be called at the end of any halo creation,
+ * so that buffer sizes are increased if necessary.
+ *
+ * parameters:
+ * halo --> pointer to cs_halo_t structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_halo_update_buffers(const cs_halo_t *halo)
+{
+ if (halo == NULL)
+ return;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ size_t send_buffer_size = CS_MAX(halo->n_send_elts[CS_HALO_EXTENDED],
+ halo->n_elts[CS_HALO_EXTENDED])
+ * CS_MAX(sizeof(cs_int_t), sizeof(cs_real_t)) * 3;
+
+ int n_requests = halo->n_c_domains*2;
+
+ if (send_buffer_size > _cs_glob_halo_send_buffer_size) {
+ _cs_glob_halo_send_buffer_size = send_buffer_size;
+ BFT_REALLOC(_cs_glob_halo_send_buffer,
+ _cs_glob_halo_send_buffer_size,
+ char);
+ }
+
+ if (n_requests > _cs_glob_halo_request_size) {
+ _cs_glob_halo_request_size = n_requests;
+ BFT_REALLOC(_cs_glob_halo_request,
+ _cs_glob_halo_request_size,
+ MPI_Request);
+ BFT_REALLOC(_cs_glob_halo_status,
+ _cs_glob_halo_request_size,
+ MPI_Status);
+
+ }
+
+ }
+
+#endif
+
+ /* Buffer to save and restore rotation halo values */
+
+ if (halo->n_rotations > 0) {
+
+ int rank_id, t_id, shift;
+ size_t save_count = 0;
+
+ const fvm_periodicity_t *periodicity = halo->periodicity;
+
+ /* Loop on transforms */
+
+ for (t_id = 0; t_id < halo->n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ if ( fvm_periodicity_get_type(periodicity, t_id)
+ >= FVM_PERIODICITY_ROTATION) {
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+ save_count += halo->perio_lst[shift + 4*rank_id + 1];
+ save_count += halo->perio_lst[shift + 4*rank_id + 3];
+ }
+ }
+
+ }
+
+ if (save_count > _cs_glob_halo_rot_backup_size) {
+ _cs_glob_halo_rot_backup_size = save_count;
+ BFT_REALLOC(_cs_glob_halo_rot_backup,
+ _cs_glob_halo_rot_backup_size,
+ cs_real_t);
+ }
+
+ } /* End of test on presence of rotations */
+}
+
+/*----------------------------------------------------------------------------
+ * Apply cell renumbering to a halo
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * new_cell_id --> array indicating old -> new cell id (0 to n-1)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_halo_renumber_cells(cs_halo_t *halo,
+ const cs_int_t new_cell_id[])
+{
+ if (halo != NULL) {
+
+ cs_int_t i;
+ const cs_int_t n_elts = halo->n_send_elts[CS_HALO_EXTENDED];
+
+ for (i = 0; i < n_elts; i++)
+ halo->send_list[i] = new_cell_id[halo->send_list[i]];
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Update array of integer halo values in case of parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * num <-> pointer to local number value array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_num(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_int_t num[])
+{
+ fvm_lnum_t i, start, length;
+
+ cs_int_t end_shift = 0;
+ int local_rank_id = (cs_glob_n_ranks == 1) ? 0 : -1;
+
+ if (sync_mode == CS_HALO_STANDARD)
+ end_shift = 1;
+
+ else if (sync_mode == CS_HALO_EXTENDED)
+ end_shift = 2;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ int rank_id;
+ int request_count = 0;
+ cs_int_t *build_buffer = (cs_int_t *)_cs_glob_halo_send_buffer;
+ cs_int_t *buffer = NULL;
+ const int local_rank = cs_glob_rank_id;
+
+ /* Receive data from distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start = halo->index[2*rank_id];
+ length = halo->index[2*rank_id + end_shift] - halo->index[2*rank_id];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ buffer = num + halo->n_local_elts + start ;
+
+ MPI_Irecv(buffer,
+ length,
+ CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(_cs_glob_halo_request[request_count++]));
+
+ }
+ else
+ local_rank_id = rank_id;
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(cs_glob_mpi_comm);
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ /* If this is not the local rank */
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ start = halo->send_index[2*rank_id];
+ length = halo->send_index[2*rank_id + end_shift]
+ - halo->send_index[2*rank_id];
+
+ for (i = 0; i < length; i++)
+ build_buffer[start + i] = num[halo->send_list[start + i]];
+
+ buffer = build_buffer + start;
+
+ MPI_Isend(buffer,
+ length,
+ CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ local_rank,
+ cs_glob_mpi_comm,
+ &(_cs_glob_halo_request[request_count++]));
+
+ }
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, _cs_glob_halo_request, _cs_glob_halo_status);
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ /* Copy local values in case of periodicity */
+
+ if (halo->n_transforms > 0) {
+
+ if (local_rank_id > -1) {
+
+ cs_int_t *recv_num
+ = num + halo->n_local_elts + halo->index[2*local_rank_id];
+
+ start = halo->send_index[2*local_rank_id];
+ length = halo->send_index[2*local_rank_id + end_shift]
+ - halo->send_index[2*local_rank_id];
+
+ for (i = 0; i < length; i++)
+ recv_num[i] = num[halo->send_list[start + i]];
+
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Update array of variable (floating-point) halo values in case of
+ * parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * var <-> pointer to variable value array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_var(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var[])
+{
+ fvm_lnum_t i, start, length;
+
+ cs_int_t end_shift = 0;
+ int local_rank_id = (cs_glob_n_ranks == 1) ? 0 : -1;
+
+ if (sync_mode == CS_HALO_STANDARD)
+ end_shift = 1;
+
+ else if (sync_mode == CS_HALO_EXTENDED)
+ end_shift = 2;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ int rank_id;
+ int request_count = 0;
+ cs_real_t *build_buffer = (cs_real_t *)_cs_glob_halo_send_buffer;
+ cs_real_t *buffer = NULL;
+ const int local_rank = cs_glob_rank_id;
+
+ /* Receive data from distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start = halo->index[2*rank_id];
+ length = halo->index[2*rank_id + end_shift] - halo->index[2*rank_id];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ buffer = var + halo->n_local_elts + start ;
+
+ MPI_Irecv(buffer,
+ length,
+ CS_MPI_REAL,
+ halo->c_domain_rank[rank_id],
+ halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(_cs_glob_halo_request[request_count++]));
+
+ }
+ else
+ local_rank_id = rank_id;
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(cs_glob_mpi_comm);
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ /* If this is not the local rank */
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ start = halo->send_index[2*rank_id];
+ length = halo->send_index[2*rank_id + end_shift]
+ - halo->send_index[2*rank_id];
+
+ for (i = 0; i < length; i++)
+ build_buffer[start + i] = var[halo->send_list[start + i]];
+
+ buffer = build_buffer + start;
+
+ MPI_Isend(buffer,
+ length,
+ CS_MPI_REAL,
+ halo->c_domain_rank[rank_id],
+ local_rank,
+ cs_glob_mpi_comm,
+ &(_cs_glob_halo_request[request_count++]));
+
+ }
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, _cs_glob_halo_request, _cs_glob_halo_status);
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ /* Copy local values in case of periodicity */
+
+ if (halo->n_transforms > 0) {
+
+ if (local_rank_id > -1) {
+
+ cs_real_t *recv_var
+ = var + halo->n_local_elts + halo->index[2*local_rank_id];
+
+ start = halo->send_index[2*local_rank_id];
+ length = halo->send_index[2*local_rank_id + end_shift]
+ - halo->send_index[2*local_rank_id];
+
+ for (i = 0; i < length; i++)
+ recv_var[i] = var[halo->send_list[start + i]];
+
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Update array of strided variable (floating-point) values in case
+ * of parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * var <-> pointer to variable value array
+ * stride --> number of (interlaced) values by entity
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_var_strided(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var[],
+ int stride)
+{
+ fvm_lnum_t i, j, start, length;
+
+ cs_int_t end_shift = 0;
+ int local_rank_id = (cs_glob_n_ranks == 1) ? 0 : -1;
+
+#if defined(HAVE_MPI)
+
+ const size_t send_buffer_size = halo->n_elts[sync_mode]
+ * sizeof(cs_real_t) * stride;
+
+ if (send_buffer_size > _cs_glob_halo_send_buffer_size) {
+ _cs_glob_halo_send_buffer_size = send_buffer_size;
+ BFT_REALLOC(_cs_glob_halo_send_buffer,
+ _cs_glob_halo_send_buffer_size,
+ char);
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ if (sync_mode == CS_HALO_STANDARD)
+ end_shift = 1;
+
+ else if (sync_mode == CS_HALO_EXTENDED)
+ end_shift = 2;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ int rank_id;
+ int request_count = 0;
+ cs_real_t *build_buffer = (cs_real_t *)_cs_glob_halo_send_buffer;
+ cs_real_t *buffer = NULL;
+ const int local_rank = cs_glob_rank_id;
+
+ /* Receive data from distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ length = ( halo->index[2*rank_id + end_shift]
+ - halo->index[2*rank_id]) * stride;
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ buffer = var + (halo->n_local_elts + halo->index[2*rank_id])*stride;
+
+ MPI_Irecv(buffer,
+ length,
+ CS_MPI_REAL,
+ halo->c_domain_rank[rank_id],
+ halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(_cs_glob_halo_request[request_count++]));
+
+ }
+ else
+ local_rank_id = rank_id;
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(cs_glob_mpi_comm);
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ /* If this is not the local rank */
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ start = halo->send_index[2*rank_id];
+ length = ( halo->send_index[2*rank_id + end_shift]
+ - halo->send_index[2*rank_id]);
+
+ if (stride == 3) { /* Unroll loop for this case */
+ for (i = 0; i < length; i++) {
+ build_buffer[(start + i)*3]
+ = var[(halo->send_list[start + i])*3];
+ build_buffer[(start + i)*3 + 1]
+ = var[(halo->send_list[start + i])*3 + 1];
+ build_buffer[(start + i)*3 + 2]
+ = var[(halo->send_list[start + i])*3 + 2];
+ }
+ }
+ else {
+ for (i = 0; i < length; i++) {
+ for (j = 0; j < stride; j++)
+ build_buffer[(start + i)*stride + j]
+ = var[(halo->send_list[start + i])*stride + j];
+ }
+ }
+
+ buffer = build_buffer + start*stride;
+
+ MPI_Isend(buffer,
+ length*stride,
+ CS_MPI_REAL,
+ halo->c_domain_rank[rank_id],
+ local_rank,
+ cs_glob_mpi_comm,
+ &(_cs_glob_halo_request[request_count++]));
+
+ }
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, _cs_glob_halo_request, _cs_glob_halo_status);
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ /* Copy local values in case of periodicity */
+
+ if (halo->n_transforms > 0) {
+
+ if (local_rank_id > -1) {
+
+ cs_real_t *recv_var
+ = var + (halo->n_local_elts + halo->index[2*local_rank_id])*stride;
+
+ start = halo->send_index[2*local_rank_id];
+ length = halo->send_index[2*local_rank_id + end_shift]
+ - halo->send_index[2*local_rank_id];
+
+ if (stride == 3) { /* Unroll loop for this case */
+ for (i = 0; i < length; i++) {
+ recv_var[i*3] = var[(halo->send_list[start + i])*3];
+ recv_var[i*3 + 1] = var[(halo->send_list[start + i])*3 + 1];
+ recv_var[i*3 + 2] = var[(halo->send_list[start + i])*3 + 2];
+ }
+ }
+ else {
+ for (i = 0; i < length; i++) {
+ for (j = 0; j < stride; j++)
+ recv_var[i*stride + j]
+ = var[(halo->send_list[start + i])*stride + j];
+ }
+ }
+
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Update array of vector variable component (floating-point) halo values
+ * in case of parallelism or periodicity.
+ *
+ * This function aims at copying main values from local elements
+ * (id between 1 and n_local_elements) to ghost elements on distant ranks
+ * (id between n_local_elements + 1 to n_local_elements_with_halo).
+ *
+ * If rotation_op is equal to CS_HALO_ROTATION_IGNORE, halo values
+ * corresponding to periodicity with rotation are left unchanged from their
+ * previous values.
+ *
+ * If rotation_op is set to CS_HALO_ROTATION_ZERO, halo values
+ * corresponding to periodicity with rotation are set to 0.
+ *
+ * If rotation_op is equal to CS_HALO_ROTATION_COPY, halo values
+ * corresponding to periodicity with rotation are exchanged normally, so
+ * the behavior is the same as that of cs_halo_sync_var().
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * sync_mode --> synchronization mode (standard or extended)
+ * var <-> pointer to variable value array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_halo_sync_component(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_halo_rotation_t rotation_op,
+ cs_real_t var[])
+{
+ if ( halo->n_rotations > 0
+ && rotation_op == CS_HALO_ROTATION_IGNORE)
+ _save_rotation_values(halo, sync_mode, var);
+
+ cs_halo_sync_var(halo, sync_mode, var);
+
+ if (halo->n_rotations > 0) {
+ if (rotation_op == CS_HALO_ROTATION_IGNORE)
+ _restore_rotation_values(halo, sync_mode, var);
+ else if (rotation_op == CS_HALO_ROTATION_ZERO)
+ _zero_rotation_values(halo, sync_mode, var);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_halo_t structure.
+ *
+ * parameters:
+ * halo --> pointer to cs_halo_t struture
+ * print_level --> 0 only dimensions and indexes are printed, else (1)
+ * everything is printed
+ *---------------------------------------------------------------------------*/
+
+void
+cs_halo_dump(const cs_halo_t *halo,
+ cs_int_t print_level)
+{
+ cs_int_t i, j, halo_id;
+
+ if (halo == NULL) {
+ bft_printf("\n\n halo: nil\n");
+ return;
+ }
+
+ bft_printf("\n halo: %p\n"
+ " n_transforms: %d\n"
+ " n_c_domains: %d\n"
+ " periodicity: %p\n"
+ " n_rotations: %d\n"
+ " n_local_elts: %d\n",
+ halo, halo->n_transforms, halo->n_c_domains,
+ halo->periodicity, halo->n_rotations, halo->n_local_elts);
+
+ bft_printf("\nRanks on halo frontier:\n");
+ for (i = 0; i < halo->n_c_domains; i++)
+ bft_printf("%5d", halo->c_domain_rank[i]);
+
+ for (halo_id = 0; halo_id < 2; halo_id++) {
+
+ cs_int_t n_elts[2];
+ cs_int_t *index = NULL, *list = NULL, *perio_lst = NULL;
+
+ bft_printf("\n ---------\n");
+
+ if (halo_id == 0) {
+
+ bft_printf(" send_list:\n");
+ n_elts[0] = halo->n_send_elts[0];
+ n_elts[1] = halo->n_send_elts[1];
+ index = halo->send_index;
+ list = halo->send_list;
+ perio_lst = halo->send_perio_lst;
+
+ }
+ else if (halo_id == 1) {
+
+ bft_printf(" halo:\n");
+ n_elts[0] = halo->n_elts[0];
+ n_elts[1] = halo->n_elts[1];
+ index = halo->index;
+ list = NULL;
+ perio_lst = halo->perio_lst;
+
+ }
+
+ bft_printf(" ---------\n\n");
+ bft_printf(" n_ghost_cells: %d\n"
+ " n_std_ghost_cells: %d\n", n_elts[1], n_elts[0]);
+
+ if (index == NULL)
+ return;
+
+ if (halo->n_transforms > 0) {
+
+ const cs_int_t stride = 4*halo->n_c_domains;
+
+ for (i = 0; i < halo->n_transforms; i++) {
+
+ bft_printf("\nTransformation number: %d\n", i+1);
+
+ for (j = 0; j < halo->n_c_domains; j++) {
+
+ bft_printf(" rank %3d <STD> %5d %5d <EXT> %5d %5d\n",
+ halo->c_domain_rank[j],
+ perio_lst[i*stride + 4*j],
+ perio_lst[i*stride + 4*j+1],
+ perio_lst[i*stride + 4*j+2],
+ perio_lst[i*stride + 4*j+3]);
+ }
+
+ } /* End of loop on perio */
+
+ } /* End if n_perio > 0 */
+
+ for (i = 0; i < halo->n_c_domains; i++) {
+
+ bft_printf("\n rank %d:\n", halo->c_domain_rank[i]);
+
+ if (index[2*i+1] - index[2*i] > 0) {
+
+ bft_printf("\n Standard halo\n");
+ bft_printf(" idx start %d: idx end %d:\n",
+ index[2*i], index[2*i+1]);
+
+ if (print_level == 1 && list != NULL) {
+ bft_printf("\n id cell number\n");
+ for (j = index[2*i]; j < index[2*i+1]; j++)
+ bft_printf(" %10d %10d %10d\n",
+ j, list[j]+1, halo->n_local_elts+j+1);
+ }
+
+ } /* there are elements on standard neighborhood */
+
+ if (index[2*i+2] - index[2*i+1] > 0) {
+
+ bft_printf("\n Extended halo\n");
+ bft_printf(" idx start %d: idx end %d:\n",
+ index[2*i+1], index[2*i+2]);
+
+ if (print_level == 1 && list != NULL) {
+ bft_printf("\n id cell number\n");
+ for (j = index[2*i+1]; j < index[2*i+2]; j++)
+ bft_printf(" %10d %10d %10d\n",
+ j, list[j]+1, halo->n_local_elts+j+1);
+ }
+
+ } /* If there are elements on extended neighborhood */
+
+ } /* End of loop on involved ranks */
+
+ } /* End of loop on halos (send_halo/halo) */
+
+ bft_printf("\n\n");
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_io.c b/src/base/cs_io.c
new file mode 100644
index 0000000..45f6119
--- /dev/null
+++ b/src/base/cs_io.c
@@ -0,0 +1,3156 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Low level file I/O utility functions for Preprocessor and restart files
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+#undef HAVE_STDINT_H
+#if defined(__STDC_VERSION__)
+# if (__STDC_VERSION__ >= 199901L)
+# define HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT and FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_file.h>
+#include <bft_error.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+#include <fvm_file.h>
+
+#if defined(HAVE_MPI)
+#include <fvm_parall.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_io.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local types and structures
+ *============================================================================*/
+
+/* Structure used to index cs_io_file contents when reading */
+/*----------------------------------------------------------*/
+
+typedef struct {
+
+ size_t size; /* Current number of entries */
+ size_t max_size; /* Maximum number of entries */
+
+ /* For each entry, we need 8 values, which we store in h_vals :
+ * 0: number of values in section
+ * 1: location_id
+ * 2: index id
+ * 3: number of values per location
+ * 4: index of section name in names array
+ * 5: index of embedded data in data array + 1 if data is
+ * embedded, 0 otherwise
+ * 6: datatype id in file
+ * 7: associated file id (in case of multiple files)
+ */
+
+ fvm_file_off_t *h_vals; /* Base values associated
+ with each header */
+
+ fvm_file_off_t *offset; /* Position of associated data
+ in file (-1 if embedded) */
+
+ size_t max_names_size; /* Maximum size of names array */
+ size_t names_size; /* Current size of names array */
+ char *names; /* Array containing section names */
+
+ size_t max_data_size; /* Maximum size of embedded data array */
+ size_t data_size; /* Current size of data array */
+ unsigned char *data; /* Array containing embedded data */
+
+ /* An index maintains its own list of files, in case multiple
+ files are used to contain the data */
+
+ size_t n_files; /* Number of associated files */
+ fvm_file_t **f; /* Pointers to associated files */
+
+} cs_io_sec_index_t;
+
+/* Main kernel IO state structure */
+/*--------------------------------*/
+
+struct _cs_io_t {
+
+ /* File information */
+
+ fvm_file_t *f; /* Pointer to associated file */
+
+ char contents[64]; /* String describing file contents */
+
+ cs_io_mode_t mode; /* File access mode */
+
+ size_t header_size; /* Header default size */
+ size_t header_align; /* Header alignment */
+ size_t body_align; /* Body alignment */
+
+ cs_io_sec_index_t *index; /* Optional section index (on read) */
+
+ /* Current section buffer state */
+
+ size_t buffer_size; /* Current size of header buffer */
+ unsigned char *buffer; /* Header buffer */
+
+ fvm_file_off_t n_vals; /* Number of values in section header */
+ size_t location_id; /* Id of location, or 0 */
+ size_t index_id; /* Id of index, or 0 */
+ size_t n_loc_vals; /* Number of values per location */
+ size_t type_size; /* Size of current type */
+ char *sec_name; /* Pointer to name in section header */
+ char *type_name; /* Pointer to type in section header */
+ void *data; /* Pointer to data in section header
+ (if embedded; NULL otherwise) */
+
+ /* Other flags */
+
+ long echo; /* Data echo level (verbosity) */
+};
+
+/*============================================================================
+ * Constants and Macros
+ *============================================================================*/
+
+#define CS_IO_MPI_TAG 'C'+'S'+'_'+'I'+'O'
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+static char _type_name_char[] = "c "; /* Character string */
+static char _type_name_i4[] = "i4"; /* Signed 32 bit integer */
+static char _type_name_i8[] = "i8"; /* Signed 64 bit integer */
+static char _type_name_u4[] = "u4"; /* Unsigned 32 bit integer */
+static char _type_name_u8[] = "u8"; /* Unsigned 64 bit integer */
+static char _type_name_r4[] = "r4"; /* Single precision real */
+static char _type_name_r8[] = "r8"; /* Double precsision real */
+
+/* Default hints for files using this API (for MPI-IO) */
+#if defined(FVM_HAVE_MPI_IO)
+int cs_glob_io_hints = FVM_FILE_EXPLICIT_OFFSETS;
+#else
+int cs_glob_io_hints = 0;
+#endif
+
+/* Global pointer on preprocessor data file handle */
+cs_io_t *cs_glob_pp_io = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Default conversion rule from type in file to type in memory.
+ *
+ * parameters:
+ * type_read <-- type in file
+ *
+ * returns:
+ * default corresponding type in memory (may need conversion)
+ *----------------------------------------------------------------------------*/
+
+static fvm_datatype_t
+_type_read_to_elt_type(fvm_datatype_t type_read)
+{
+ fvm_datatype_t elt_type = FVM_DATATYPE_NULL;
+
+ if (type_read == FVM_INT32 || type_read == FVM_INT64) {
+ assert(sizeof(fvm_lnum_t) == 4 || sizeof(fvm_lnum_t) == 8);
+ if (sizeof(fvm_lnum_t) == 4)
+ elt_type = FVM_INT32;
+ else
+ elt_type = FVM_INT64;
+ }
+
+ else if (type_read == FVM_UINT32 || type_read == FVM_UINT64) {
+ assert(sizeof(fvm_gnum_t) == 4 || sizeof(fvm_gnum_t) == 8);
+ if (sizeof(fvm_gnum_t) == 4)
+ elt_type = FVM_UINT32;
+ else
+ elt_type = FVM_UINT64;
+ }
+
+ else if (type_read == FVM_FLOAT || type_read == FVM_DOUBLE) {
+ if (sizeof(cs_real_t) == 4)
+ elt_type = FVM_FLOAT;
+ else
+ elt_type = FVM_DOUBLE;
+ }
+
+ else if (type_read == FVM_CHAR)
+ elt_type = FVM_CHAR;
+
+ return elt_type;
+}
+
+/*----------------------------------------------------------------------------
+ * Convert a buffer of type uint64_t to fvm_file_off_t
+ *
+ * parameters:
+ * buf <-- buffer
+ * val --> array to which values are converted
+ * n <-- number of values to convert
+ *----------------------------------------------------------------------------*/
+
+static void
+_convert_to_offset(const unsigned char buf[],
+ fvm_file_off_t val[],
+ size_t n)
+{
+ size_t i;
+
+#if defined(HAVE_STDINT_H)
+
+ for (i = 0; i < n; i++)
+ val[i] = ((const uint64_t *)buf)[i];
+
+#else
+
+ if (sizeof(size_t) == 8) {
+ for (i = 0; i < n; i++)
+ val[i] = ((const size_t *)buf)[i];
+ }
+ else if (sizeof(unsigned long long) == 8) {
+ for (i = 0; i < n; i++)
+ val[i] = ((const unsigned long long *)buf)[i];
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Compilation configuration / porting error:\n"
+ "Unable to determine a 64-bit unsigned int type.\n"
+ "size_t is %d bits, unsigned long long %d bits"),
+ sizeof(size_t)*8, sizeof(unsigned long long)*8);
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Convert a buffer of type fvm_file_off_t to uint64_t
+ *
+ * parameters:
+ * buf --> buffer
+ * val <-- array from which values are converted
+ * n <-- number of values to convert
+ *----------------------------------------------------------------------------*/
+
+static void
+_convert_from_offset(unsigned char buf[],
+ const fvm_file_off_t val[],
+ size_t n)
+{
+ size_t i;
+
+#if defined(HAVE_STDINT_H)
+
+ for (i = 0; i < n; i++)
+ ((uint64_t *)buf)[i]= val[i];
+
+#else
+
+ if (sizeof(size_t) == 8) {
+ for (i = 0; i < n; i++)
+ ((size_t *)buf)[i] = val[i];
+ }
+ else if (sizeof(unsigned long long) == 8) {
+ for (i = 0; i < n; i++)
+ ((unsigned long long *)buf)[i] = val[i];
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Compilation configuration / porting error:\n"
+ "Unable to determine a 64-bit unsigned int type.\n"
+ "size_t is %d bits, unsigned long long %d bits"),
+ sizeof(size_t)*8, sizeof(unsigned long long)*8);
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Return an empty kernel IO file structure.
+ *
+ * parameters:
+ * mode --> read or write
+ * echo --> echo on main output (< 0 if none, header if 0,
+ * n first and last elements if n > 0)
+ *
+ * returns:
+ * pointer to kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+static cs_io_t *
+_cs_io_create(cs_io_mode_t mode,
+ size_t echo)
+{
+ cs_io_t *cs_io = NULL;
+
+ BFT_MALLOC(cs_io, 1, cs_io_t);
+
+ /* Set structure fields */
+
+ cs_io->mode = mode;
+
+ cs_io->f = NULL;
+
+ memset(cs_io->contents, 0, 64);
+
+ cs_io->header_size = 0;
+ cs_io->header_align = 0;
+ cs_io->body_align = 0;
+
+ cs_io->index = NULL;
+
+ /* Current section buffer state */
+
+ cs_io->buffer_size = 0;
+ cs_io->buffer = NULL;
+
+ cs_io->n_vals = 0;
+ cs_io->type_size = 0;
+ cs_io->sec_name = NULL;
+ cs_io->type_name = NULL;
+ cs_io->data = NULL;
+
+ /* Verbosity */
+
+ cs_io->echo = echo;
+
+ return cs_io;
+}
+
+/*----------------------------------------------------------------------------
+ * Add an empty index structure to a cs_io_t structure.
+ *
+ * parameters:
+ * inp <-> pointer to cs_io_t structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_create_index(cs_io_t *inp)
+{
+ cs_io_sec_index_t *idx = NULL;
+
+ BFT_MALLOC(idx, 1, cs_io_sec_index_t);
+
+ /* Set structure fields */
+
+ idx->size = 0;
+ idx->max_size = 32;
+
+ BFT_MALLOC(idx->h_vals, idx->max_size*8, fvm_file_off_t);
+ BFT_MALLOC(idx->offset, idx->max_size, fvm_file_off_t);
+
+ idx->max_names_size = 256;
+ idx->names_size = 0;
+
+ BFT_MALLOC(idx->names, idx->max_names_size, char);
+
+ idx->max_data_size = 256;
+ idx->data_size = 0;
+
+ BFT_MALLOC(idx->data, idx->max_data_size, unsigned char);
+
+ idx->n_files = 0;
+ idx->f = NULL;
+
+ /* Add structure */
+
+ inp->index = idx;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_io_t structure's optional index structure.
+ *
+ * parameters:
+ * inp <-> pointer to cs_io_t structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_destroy_index(cs_io_t *inp)
+{
+ size_t i;
+ cs_io_sec_index_t *idx = inp->index;
+
+ if (idx == NULL)
+ return;
+
+ BFT_FREE(idx->h_vals);
+ BFT_FREE(idx->offset);
+ BFT_FREE(idx->names);
+ BFT_FREE(idx->data);
+
+ for (i = 0; i < idx->n_files; i++) {
+ if (idx->f[i] == inp->f)
+ idx->f[i] = NULL;
+ else if (idx->f[i] != NULL)
+ idx->f[i] = fvm_file_free(idx->f[i]);
+ }
+ BFT_FREE(idx->f);
+
+ BFT_FREE(inp->index);
+}
+
+/*----------------------------------------------------------------------------
+ * Update an index structure with info from the last header read
+ *
+ * Also sets the file position for the next read
+ *
+ * parameters:
+ * inp <-> input kernel IO structure
+ * header <-- header structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_index_and_shift(cs_io_t *inp,
+ cs_io_sec_header_t *header)
+{
+ size_t id = 0;
+ size_t new_names_size = 0;
+ size_t new_data_size = 0;
+
+ cs_io_sec_index_t *idx = inp->index;
+
+ if (idx == NULL)
+ return;
+
+ /* Reallocate if necessary */
+
+ if (idx->size + 1 == idx->max_size) {
+ if (idx->max_size == 0)
+ idx->max_size = 32;
+ else
+ idx->max_size *= 2;
+ BFT_REALLOC(idx->h_vals, idx->max_size*8, fvm_file_off_t);
+ BFT_REALLOC(idx->offset, idx->max_size, fvm_file_off_t);
+ };
+
+ new_names_size = idx->names_size + strlen(inp->sec_name) + 1;
+
+ if (inp->data != NULL)
+ new_data_size
+ = idx->data_size + ( inp->n_vals
+ * fvm_datatype_size[header->type_read]);
+
+ if (new_names_size > idx->max_names_size) {
+ if (idx->max_names_size == 0)
+ idx->max_names_size = 128;
+ while (new_names_size > idx->max_names_size)
+ idx->max_names_size *= 2;
+ BFT_REALLOC(idx->names, idx->max_names_size, char);
+ }
+
+ if (new_data_size > idx->max_data_size) {
+ if (idx->max_data_size == 0)
+ idx->max_data_size = 128;
+ while (new_data_size > idx->max_data_size)
+ idx->max_data_size *= 2;
+ BFT_REALLOC(idx->data, idx->max_data_size, unsigned char);
+ }
+
+ /* Set values */
+
+ id = idx->size;
+
+ idx->h_vals[id*8] = inp->n_vals;
+ idx->h_vals[id*8 + 1] = inp->location_id;
+ idx->h_vals[id*8 + 2] = inp->index_id;
+ idx->h_vals[id*8 + 3] = inp->n_loc_vals;
+ idx->h_vals[id*8 + 4] = idx->names_size;
+ idx->h_vals[id*8 + 5] = 0;
+ idx->h_vals[id*8 + 6] = header->type_read;
+ idx->h_vals[id*8 + 7] = idx->n_files - 1;
+
+ strcpy(idx->names + idx->names_size, inp->sec_name);
+ idx->names[new_names_size - 1] = '\0';
+ idx->names_size = new_names_size;
+
+ if (inp->data == NULL) {
+ fvm_file_off_t offset = fvm_file_tell(inp->f);
+ fvm_file_off_t data_shift = inp->n_vals * inp->type_size;
+ if (inp->body_align > 0) {
+ size_t ba = inp->body_align;
+ idx->offset[id] = offset + (ba - (offset % ba)) % ba;
+ }
+ else
+ idx->offset[id] = offset;
+ fvm_file_seek(inp->f, idx->offset[id] + data_shift, FVM_FILE_SEEK_SET);
+ }
+ else {
+ idx->h_vals[id*8 + 5] = idx->data_size + 1;
+ memcpy(idx->data + idx->data_size,
+ inp->data,
+ new_data_size - idx->data_size);
+ idx->data_size = new_data_size;
+ idx->offset[id] = -1;
+ }
+
+ idx->size += 1;
+}
+
+/*----------------------------------------------------------------------------
+ * Open the interface file descriptor and initialize the file by writing
+ * or reading a "magic string" used to check the file content type.
+ *
+ * parameters:
+ * cs_io <-> kernel IO structure
+ * name <-- file name
+ * magic_string <-- magic string associated with file content type
+ * hints <-- file handling method options (0 for default)
+ * comm <-- associated MPI communicator
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+static void
+_file_open(cs_io_t *cs_io,
+ const char *name,
+ const char *magic_string,
+ int hints,
+ MPI_Comm comm)
+#else
+static void
+_file_open(cs_io_t *cs_io,
+ const char *name,
+ const char *magic_string,
+ int hints)
+#endif
+{
+ fvm_file_mode_t f_mode;
+ char header_data[128 + 24];
+ fvm_file_off_t header_vals[3];
+
+ char base_header[] = "Code_Saturne I/O, BE, R0";
+
+ /* Prepare file open */
+
+ switch(cs_io->mode) {
+
+ case CS_IO_MODE_READ:
+ f_mode = FVM_FILE_MODE_READ;
+ break;
+
+ case CS_IO_MODE_WRITE:
+ f_mode = FVM_FILE_MODE_WRITE;
+ break;
+
+ default:
+ assert( cs_io->mode == CS_IO_MODE_READ
+ || cs_io->mode == CS_IO_MODE_WRITE);
+ }
+
+
+ /* Create interface file descriptor */
+
+#if defined(HAVE_MPI)
+ cs_io->f = fvm_file_open(name, f_mode, hints, comm);
+#else
+ cs_io->f = fvm_file_open(name, f_mode, hints);
+#endif
+
+ fvm_file_set_big_endian(cs_io->f);
+
+ /* Write or read a magic string */
+ /*------------------------------*/
+
+ if (cs_io->mode == CS_IO_MODE_READ) {
+
+ fvm_file_read_global(cs_io->f, header_data, 1, 128 + 24);
+
+ header_data[63] = '\0';
+ header_data[127] = '\0';
+
+ /* If the format does not correspond, we have an error */
+
+ if (strncmp(header_data, base_header, 64) != 0) {
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error reading file: \"%s\".\n"
+ "File format is not the correct version.\n"
+ "The first 64 bytes expected contain:\n"
+ "\"%s\"\n"
+ "The first 64 bytes read contain:\n"
+ "\"%s\"\n"),
+ fvm_file_get_name(cs_io->f), base_header, header_data);
+
+ }
+
+ /* Copy magic string */
+
+ strncpy(cs_io->contents, header_data + 64, 64);
+ cs_io->contents[63] = '\0';
+
+ /* If the magic string does not correspond, we have an error */
+
+ if (magic_string != NULL) {
+ if (strncmp(cs_io->contents, magic_string, 64) != 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error reading file: \"%s\".\n"
+ "The file contents are not of the expected type.\n"
+ "\"%s\" was expected,\n"
+ "\"%s\" was read."),
+ fvm_file_get_name(cs_io->f), magic_string, cs_io->contents);
+ }
+
+ /* Now decode the sizes */
+
+ if (fvm_file_get_swap_endian(cs_io->f) == 1)
+ bft_file_swap_endian(header_data + 128, header_data + 128, 8, 3);
+
+ _convert_to_offset((unsigned char *)(header_data + 128), header_vals, 3);
+
+ cs_io->header_size = header_vals[0];
+ cs_io->header_align = header_vals[1];
+ cs_io->body_align = header_vals[2];
+
+ }
+ else if (cs_io->mode == CS_IO_MODE_WRITE) {
+
+ size_t n_written = 0;
+
+ memset(header_data, 0, sizeof(header_data));
+ strcpy(header_data, base_header);
+ strncpy(header_data + 64, magic_string, 64);
+ header_data[127] = '\0';
+
+ /* Set default header size and alignments */
+
+ cs_io->header_size = 128;
+ cs_io->header_align = 64;
+ cs_io->body_align = 64;
+
+ header_vals[0] = cs_io->header_size;
+ header_vals[1] = cs_io->header_align;
+ header_vals[2] = cs_io->body_align;
+
+ _convert_from_offset((unsigned char *)(header_data + 128), header_vals, 3);
+
+ if (fvm_file_get_swap_endian(cs_io->f) == 1)
+ bft_file_swap_endian(header_data + 128, header_data + 128, 8, 3);
+
+ n_written = fvm_file_write_global(cs_io->f, header_data, 1, 128 + 24);
+
+ if (n_written < 128 + 24)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error writing the header of file: \"%s\".\n"),
+ fvm_file_get_name(cs_io->f));
+ }
+
+ cs_io->buffer_size = cs_io->header_size;
+ BFT_MALLOC(cs_io->buffer, cs_io->buffer_size, unsigned char);
+}
+
+/*----------------------------------------------------------------------------
+ * Add fictitious sections for mesh sizes for a legacy restart file.
+ *
+ * parameters:
+ * inp <-> kernel IO input structure
+ * sizes <-- number of cells, interior face, bountery face, and vertices
+ *----------------------------------------------------------------------------*/
+
+static void
+_file_legacy_add_sizes(cs_io_t *inp,
+ fvm_lnum_t sizes[4])
+{
+ int i;
+ cs_io_sec_header_t h;
+
+ char _sec_name[32];
+ const char *sec_name[] = {"cells",
+ "interior_faces",
+ "boundary_faces",
+ "vertices"};
+
+ assert(inp->mode == CS_IO_MODE_READ);
+ assert(inp->index != NULL);
+
+ /* Common initializations */
+
+ h.n_location_vals = 1;
+ h.type_read = FVM_INT32;
+ h.elt_type = FVM_INT32;
+
+ /* Add 4 sizes and associated locations as sections with embedded data */
+
+ for (i = 0; i < 4; i++) {
+
+ size_t embedded_val = sizes[i];
+
+ strcpy(_sec_name, sec_name[i]); /* Copy to avoid const warnings */
+ inp->sec_name = _sec_name;
+ inp->n_vals = 1;
+ inp->location_id = i+1;
+ inp->index_id = 0;
+ inp->n_loc_vals = 1;
+ inp->data = &embedded_val;
+
+ h.sec_name = inp->sec_name;
+ h.n_vals = inp->n_vals;
+ h.location_id = inp->location_id;
+
+ assert(sizeof(size_t) == 4 || sizeof(size_t) == 8);
+
+ if (sizeof(size_t) == 4)
+ h.type_read = FVM_UINT32;
+ else
+ h.type_read = FVM_UINT64;
+ h.elt_type = _type_read_to_elt_type(h.type_read);
+
+ /* Todo add to index */
+
+ _update_index_and_shift(inp, &h);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Check if a file is a Code_Saturne version 1.1 - 1.3 restart file,
+ * and open it if it is.
+ *
+ * parameters:
+ * inp <-> kernel IO input structure
+ * name <-- file name
+ * sizes <-- location sizes
+ * comm <-- associated MPI communicator
+ *
+ * returns:
+ * 1 if file is a legacy restart file, 0 otherwise.
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+static int
+_file_legacy_restart_open(cs_io_t *inp,
+ const char *name,
+ fvm_lnum_t sizes[4],
+ MPI_Comm comm)
+#else
+static int
+_file_legacy_restart_open(cs_io_t *inp,
+ const char *name,
+ fvm_lnum_t sizes[4])
+#endif
+{
+ char expected_header[] = "Code_Saturne_1.1_bin_reprise\n";
+ char header_read[32] = "";
+ fvm_lnum_t expected_len = strlen(expected_header);
+
+ fvm_lnum_t n_read = 0;
+ int retval = 0;
+
+ assert(inp->mode == CS_IO_MODE_READ);
+
+ /* Create interface file descriptor */
+
+#if defined(HAVE_MPI)
+ inp->f = fvm_file_open(name, FVM_FILE_MODE_READ, FVM_FILE_NO_MPI_IO, comm);
+#else
+ inp->f = fvm_file_open(name, FVM_FILE_MODE_READ, 0);
+#endif
+
+ fvm_file_set_big_endian(inp->f);
+
+ /* Read first characters and compare */
+ /*-----------------------------------*/
+
+ n_read = fvm_file_read_global(inp->f, header_read, 1, expected_len);
+
+ if (n_read == expected_len) {
+ header_read[expected_len] = '\0';
+ if (strcmp(header_read, expected_header) == 0)
+ retval = 1;
+ }
+
+ /* Close file and return if it is not what we are looking for */
+
+ if (retval == 0) {
+ inp->f = fvm_file_free(inp->f);
+ return retval;
+ }
+
+ /* From here on, we know the file is in the legacy restart format */
+ /*----------------------------------------------------------------*/
+
+ if (inp->buffer_size == 0) {
+ inp->buffer_size = 128;
+ BFT_MALLOC(inp->buffer, inp->buffer_size, unsigned char);
+ memset(inp->buffer, 0, inp->buffer_size);
+ }
+
+ /* Read location sizes */
+
+ n_read = fvm_file_read_global(inp->f, sizes, sizeof(fvm_lnum_t), 4);
+ if (n_read < 4) {
+ bft_error(__FILE__, __LINE__, 0,
+ _("Restart file \"%s\"\n"
+ "in format 1.1 is not conforming."),
+ fvm_file_get_name(inp->f));
+
+ /* following code will not be reached as long as errors are fatal */
+ inp->f = fvm_file_free(inp->f);
+ retval = 0;
+ }
+
+ /* Update index file section */
+ if (inp->index != NULL) {
+ BFT_REALLOC(inp->index->f, inp->index->n_files + 1, fvm_file_t *);
+ inp->index->f[inp->index->n_files] = inp->f;
+ inp->index->n_files += 1;
+ }
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Test if a file is a legacy restart file, and open it if it is.
+ *
+ * parameters:
+ * inp <-> kernel IO input structure
+ * name <-- file name
+ * comm <-- associated MPI communicator
+ *
+ * returns:
+ * 1 if file is a legacy restart file, 0 otherwise.
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+static int
+_file_legacy_restart_index(cs_io_t *inp,
+ const char *name,
+ MPI_Comm comm)
+#else
+static int
+_file_legacy_restart_index(cs_io_t *inp,
+ const char *name)
+#endif
+{
+ fvm_lnum_t sizes[4] = {0, 0, 0, 0};
+
+ fvm_lnum_t n_read = 0;
+ int end_of_file = 0;
+ int retval = 0;
+
+ const char incorrect_next_file_msg[]
+ = N_("Restart file \"%s\" does not correspond\n"
+ "to part %d of the original restart file.");
+
+#if defined(FVM_HAVE_MPI)
+ retval = _file_legacy_restart_open(inp, name, sizes, comm);
+#else
+ retval = _file_legacy_restart_open(inp, name, sizes);
+#endif
+
+ if (retval == 0)
+ return retval;
+
+ /* From here on, we know the file is in the legacy restart format */
+
+ _file_legacy_add_sizes(inp, sizes);
+
+ /* Now analyze the file */
+
+ inp->header_size = 0;
+ inp->header_align = 0;
+ inp->body_align = 0;
+ inp->data = NULL;
+
+ while (end_of_file == 0) {
+
+ fvm_lnum_t buf[4];
+ char *sec_name = NULL;
+
+ /* Read section */
+
+ n_read = fvm_file_read_global(inp->f, buf, sizeof(fvm_lnum_t), 4);
+
+ if (n_read < 4) {
+ end_of_file = 1;
+ break;
+ }
+
+ if (buf[0] + 56 >= (fvm_lnum_t)(inp->buffer_size)) {
+ while (buf[0] + 56 >= (fvm_lnum_t)(inp->buffer_size))
+ inp->buffer_size *= 2;
+ BFT_REALLOC(inp->buffer, inp->buffer_size, unsigned char);
+ }
+ sec_name = (char *)(inp->buffer + 56);
+
+ n_read = fvm_file_read_global(inp->f, sec_name, 1, buf[0]);
+ sec_name[n_read] = '\0';
+
+ if (n_read < buf[0]) {
+ end_of_file = 1;
+ break;
+ }
+
+ /* Now handle section, starting with special records */
+ /*---------------------------------------------------*/
+
+ /* If contents continue on another file, switch files */
+
+ if (strcmp(sec_name, "reprise : fic suivant") == 0) {
+
+ size_t ii;
+ fvm_lnum_t cmp_sizes[4] = {0, 0, 0, 0};
+ size_t _name_len = strlen(name) + strlen("_pxx");
+ char *_name = NULL;
+
+ /* Build next restart file name */
+ BFT_MALLOC(_name, _name_len + 1, char);
+ sprintf(_name, "%s_p%02d", name, (int)(inp->index->n_files + 1));
+
+ /* Open new file */
+ end_of_file = 0;
+ inp->index->f[inp->index->n_files - 1] = inp->f;
+#if defined(FVM_HAVE_MPI)
+ retval = _file_legacy_restart_open(inp, _name, cmp_sizes, comm);
+#else
+ retval = _file_legacy_restart_open(inp, _name, cmp_sizes);
+#endif
+ if (retval == 0)
+ end_of_file = 1;
+
+ for (ii = 0; ii < 4; ii++) {
+ if (sizes[ii] != cmp_sizes[ii]) {
+ bft_error(__FILE__, __LINE__, 0, _(incorrect_next_file_msg),
+ fvm_file_get_name(inp->f), (int)(inp->index->n_files));
+ end_of_file = 1;
+ }
+ }
+ BFT_FREE(_name);
+ }
+
+ /* If end of file is indicated */
+
+ else if (strcmp(sec_name, "reprise : fin") == 0)
+ end_of_file = 1;
+
+ /* If the beginning of a new file is indicated */
+
+ else if (strcmp(sec_name, "reprise : partie num") == 0) {
+ if (buf[0] != (fvm_lnum_t)(inp->index->n_files)) {
+ bft_error(__FILE__, __LINE__, 0, _(incorrect_next_file_msg),
+ fvm_file_get_name(inp->f), (int)(inp->index->n_files));
+ end_of_file = 1;
+ }
+ continue;
+ }
+
+ /* Standard record */
+
+ else {
+
+ /* Prepare addition to index */
+
+ cs_io_sec_header_t h;
+
+ inp->sec_name = sec_name;
+ inp->n_vals = buf[2];
+ if (buf[1] > 0)
+ inp->n_vals *= buf[2] * sizes[buf[1] - 1];
+ inp->location_id = buf[1];
+ inp->index_id = 0;
+ inp->n_loc_vals = buf[2];
+
+ h.sec_name = inp->sec_name;
+ h.n_vals = inp->n_vals;
+ h.location_id = inp->location_id;
+ h.n_location_vals = inp->n_loc_vals;
+ h.type_read = FVM_DATATYPE_NULL;
+ if (buf[3] == 0)
+ h.type_read = FVM_CHAR;
+ else if (buf[3] == 1)
+ h.type_read = FVM_INT32;
+ else if (buf[3] == 2)
+ h.type_read = FVM_DOUBLE;
+ h.elt_type = _type_read_to_elt_type(h.type_read);
+
+ inp->type_size = fvm_datatype_size[h.type_read];
+
+ /* Todo add to index */
+
+ _update_index_and_shift(inp, &h);
+
+ }
+ }
+
+ return 1;
+}
+
+/*----------------------------------------------------------------------------
+ * Re-open the interface file descriptor when building an index.
+ *
+ * parameters:
+ * inp <-> kernel IO structure
+ * hints <-- file handling method options (0 for default)
+ * comm <-- associated MPI communicator
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+static void
+_file_reopen_read(cs_io_t *inp,
+ int hints,
+ MPI_Comm comm)
+#else
+static void
+_file_reopen_read(cs_io_t *inp,
+ int hints)
+#endif /* FVM_HAVE_MPI */
+{
+ size_t i;
+ char _tmpname[128];
+ char *tmpname = _tmpname;
+
+ assert(inp->index != NULL);
+
+ for (i = 0; i < inp->index->n_files; i++) {
+
+ const char *filename = fvm_file_get_name(inp->index->f[i]);
+
+ if (strlen(filename) >= 128)
+ BFT_MALLOC(tmpname, strlen(filename) + 1, char);
+ strcpy(tmpname, filename);
+
+ inp->index->f[i] = fvm_file_free(inp->index->f[i]);
+
+#if defined(HAVE_MPI)
+ inp->index->f[i] = fvm_file_open(tmpname, FVM_FILE_MODE_READ, hints, comm);
+#else
+ inp->index->f[i] = fvm_file_open(tmpname, FVM_FILE_MODE_READ, hints);
+#endif
+
+ fvm_file_set_big_endian(inp->index->f[i]);
+
+ if (tmpname != _tmpname)
+ BFT_FREE(tmpname);
+ }
+
+ if (inp->index->n_files > 0)
+ inp->f = inp->index->f[0];
+ else
+ inp->f = NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Close the interface file.
+ *
+ * parameters:
+ * cs_io <-> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_file_close(cs_io_t *cs_io)
+{
+ if (cs_io->f != NULL)
+ cs_io->f = fvm_file_free(cs_io->f);
+}
+
+/*----------------------------------------------------------------------------
+ * Echo pending section read or write
+ *
+ * parameters:
+ * cs_io --> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_echo_pre(const cs_io_t *cs_io)
+{
+ assert(cs_io != NULL);
+
+ switch(cs_io->mode) {
+
+ case CS_IO_MODE_READ:
+ bft_printf(_("\n Section read on \"%s\":\n"),
+ fvm_file_get_name(cs_io->f));
+ break;
+
+ case CS_IO_MODE_WRITE:
+ bft_printf(_("\n Section written on \"%s\":\n"),
+ fvm_file_get_name(cs_io->f));
+ break;
+
+ default:
+ assert( cs_io->mode == CS_IO_MODE_READ
+ || cs_io->mode == CS_IO_MODE_WRITE);
+ }
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Echo a section header
+ *
+ * parameters:
+ * sec_name --> section name
+ * n_elts --> number of elements
+ * elt_type --> expected (final) element type
+ * type --> element type in file
+ *----------------------------------------------------------------------------*/
+
+static void
+_echo_header(const char *sec_name,
+ fvm_gnum_t n_elts,
+ fvm_datatype_t type)
+{
+ /* Instructions */
+
+ bft_printf(_(" section name: \"%s\"\n"
+ " number of elements: %lu\n"),
+ sec_name, (unsigned long)n_elts);
+
+ if (n_elts > 0) {
+
+ char *type_name;
+
+ switch(type) {
+ case FVM_CHAR:
+ type_name = _type_name_char;
+ break;
+ case FVM_INT32:
+ type_name = _type_name_i4;
+ break;
+ case FVM_INT64:
+ type_name = _type_name_i8;
+ break;
+ case FVM_UINT32:
+ type_name = _type_name_u4;
+ break;
+ case FVM_UINT64:
+ type_name = _type_name_u8;
+ break;
+ case FVM_FLOAT:
+ type_name = _type_name_r4;
+ break;
+ case FVM_DOUBLE:
+ type_name = _type_name_r8;
+ break;
+ default:
+ assert(0);
+ }
+
+ bft_printf(_(" element type name: \"%s\"\n"), type_name);
+
+ }
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Partial echo of a section's contents.
+ *
+ * FVM datatypes must have been converted to the corresponding
+ * Code_Saturne compatible datatype before calling this function:
+ * FVM_CHAR -> char
+ * FVM_INT32 / FVM_INT64 -> fvm_lnum_t / cs_int_t
+ * FVM_UINT32 / FVM_UINT64 -> fvm_gnum_t
+ * FVM_REAL / FVM_FLOAT -> double / cs_real_t
+ *
+ * If global_num_start and global_num_end are > 0, the echo shows that
+ * a different block is assigned to each processor. Otherwise, the full
+ * data is replicated for each processor, and this is also indicated.
+ *
+ * parameters:
+ * echo --> echo level
+ * n_elts --> number of elements
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * (1 to n numbering)
+ * elt_type --> element type
+ * elts --> element buffer
+ *----------------------------------------------------------------------------*/
+
+static void
+_echo_data(size_t echo,
+ fvm_file_off_t n_elts,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ fvm_datatype_t elt_type,
+ const void *elts)
+{
+ fvm_gnum_t i;
+ fvm_gnum_t num_shift = 1;
+ size_t _n_elts = n_elts;
+ fvm_file_off_t echo_start = 0;
+ fvm_file_off_t echo_end = 0;
+ const char *_loc_glob[] = {N_(" (local)"), ""};
+ const char *loc_glob = _loc_glob[1];
+
+ /* Instructions */
+
+ if (n_elts == 0) return;
+
+ if (cs_glob_n_ranks == 1)
+ loc_glob = _loc_glob[0];
+ else if (global_num_start > 0) {
+ loc_glob = _loc_glob[0];
+ num_shift = global_num_start;
+ }
+
+ if (global_num_start > 0 && global_num_end > 0) {
+ assert(global_num_end >= global_num_start);
+ _n_elts = global_num_end - global_num_start;
+ }
+
+ if (echo * 2 < _n_elts) {
+ echo_end = echo;
+ bft_printf(_(" %d first and last elements%s:\n"),
+ echo, loc_glob);
+ }
+ else {
+ echo_end = _n_elts;
+ bft_printf(_(" elements%s:\n"), _(loc_glob));
+ }
+
+ /* Note that FVM datatypes will have been converted to
+ the corresponding datatype if necessary before
+ calling this function, hence the identical treatment
+ for different cases. */
+
+ do {
+
+ switch (elt_type) {
+
+ case FVM_INT32:
+ case FVM_INT64:
+ {
+ const fvm_lnum_t *_elts = elts;
+
+ for (i = echo_start ; i < echo_end ; i++)
+ bft_printf(" %10lu : %12d\n",
+ (unsigned long)(i + num_shift), *(_elts + i));
+ }
+ break;
+
+ case FVM_UINT32:
+ case FVM_UINT64:
+ {
+ const fvm_gnum_t *_elts = elts;
+
+ for (i = echo_start ; i < echo_end ; i++)
+ bft_printf(" %10lu : %12lu\n",
+ (unsigned long)(i + num_shift),
+ (unsigned long)*(_elts + i));
+ }
+ break;
+
+ case FVM_FLOAT:
+ case FVM_DOUBLE:
+ {
+ const cs_real_t *_elts = elts;
+
+ for (i = echo_start ; i < echo_end ; i++)
+ bft_printf(" %10lu : %12.5e\n",
+ (unsigned long)(i + num_shift), *(_elts + i));
+ }
+ break;
+
+ case FVM_CHAR:
+ {
+ const char *_elts = elts;
+
+ for (i = echo_start ; i < echo_end ; i++) {
+ if (*(_elts + i) != '\0')
+ bft_printf(" %10lu : '%c'\n",
+ (unsigned long)(i + num_shift), *(_elts + i));
+ else
+ bft_printf(" %10lu : '\\0'\n",
+ (unsigned long)(i + num_shift));
+ }
+ }
+ break;
+
+ default:
+ assert(0);
+
+ }
+
+ if (echo_end < n_elts) {
+ bft_printf(" .......... ............\n");
+ echo_start = n_elts - echo;
+ echo_end = n_elts;
+ }
+ else {
+ assert(echo_end == n_elts);
+ echo_end = n_elts + 1;
+ }
+
+ } while (echo_end <= n_elts);
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Convert read data.
+ *
+ * dest_type must have been set to the corresponding
+ * Code_Saturne compatible datatype before calling this function and
+ * conversion will be done accordingly:
+ * FVM_INT32 / FVM_INT64 -> fvm_lnum_t / cs_int_t
+ * FVM_UINT32 / FVM_UINT64 -> fvm_gnum_t
+ * FVM_REAL / FVM_FLOAT -> double / cs_real_t
+ *
+ * parameters:
+ * buffer --> input buffer
+ * dest <-- output buffer
+ * n_elts --> number of elements
+ * buffer_type --> input buffer element type
+ * dest_type --> output buffer element type
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_io_convert_read(void *buffer,
+ void *dest,
+ fvm_file_off_t n_elts,
+ fvm_datatype_t buffer_type,
+ fvm_datatype_t dest_type)
+{
+ fvm_file_off_t ii;
+ size_t buffer_type_size = fvm_datatype_size[buffer_type];
+
+ assert(dest_type != buffer_type);
+
+ /* Note that dest will have been set to the corresponding datatype
+ before calling this function, hence the identical treatment
+ for different cases. */
+
+ switch(dest_type) {
+
+ case FVM_INT32:
+ case FVM_INT64:
+ {
+ fvm_lnum_t *_dest = dest;
+
+ if ( buffer_type == FVM_INT32
+ || buffer_type == FVM_INT64) {
+
+ if (sizeof(long) == buffer_type_size) {
+ long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(long long) == buffer_type_size) {
+ long long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(int) == buffer_type_size) {
+ int * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(short) == buffer_type_size) {
+ short * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+
+ }
+
+ else if ( buffer_type == FVM_UINT32
+ || buffer_type == FVM_UINT64) {
+
+ if (sizeof(unsigned long) == buffer_type_size) {
+ unsigned long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(unsigned long long) == buffer_type_size) {
+ unsigned long long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(unsigned int) == buffer_type_size) {
+ unsigned int * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(unsigned short) == buffer_type_size) {
+ unsigned short * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+
+ }
+
+ assert( sizeof(long) == buffer_type_size
+ || sizeof(long long) == buffer_type_size
+ || sizeof(int) == buffer_type_size
+ || sizeof(short) == buffer_type_size);
+ }
+ break;
+
+ case FVM_UINT32:
+ case FVM_UINT64:
+ {
+ fvm_gnum_t *_dest = dest;
+
+ if ( buffer_type == FVM_INT32
+ || buffer_type == FVM_INT64) {
+
+ if (sizeof(long) == buffer_type_size) {
+ long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(long long) == buffer_type_size) {
+ long long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(int) == buffer_type_size) {
+ int * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(short) == buffer_type_size) {
+ short * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+
+ }
+
+ else if ( buffer_type == FVM_UINT32
+ || buffer_type == FVM_UINT64) {
+
+ if (sizeof(unsigned long) == buffer_type_size) {
+ unsigned long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(unsigned long long) == buffer_type_size) {
+ unsigned long long * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(unsigned int) == buffer_type_size) {
+ unsigned int * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ else if (sizeof(unsigned short) == buffer_type_size) {
+ unsigned short * _buffer = buffer;
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+
+ }
+
+ assert( sizeof(long) == buffer_type_size
+ || sizeof(long long) == buffer_type_size
+ || sizeof(int) == buffer_type_size
+ || sizeof(short) == buffer_type_size);
+ }
+ break;
+
+ case FVM_FLOAT:
+ {
+ cs_real_t *_dest = dest;
+ double * _buffer = buffer;
+
+ assert(buffer_type == FVM_DOUBLE);
+
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ break;
+
+ case FVM_DOUBLE:
+ {
+ cs_real_t *_dest = dest;
+ float * _buffer = buffer;
+
+ assert(buffer_type == FVM_FLOAT);
+
+ for (ii = 0; ii < n_elts; ii++)
+ _dest[ii] = _buffer[ii];
+ }
+ break;
+
+ default:
+ assert(0);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Read a section body.
+ *
+ * If global_num_start and global_num_end are > 0, a different block is
+ * assigned to each processor. Otherwise, the full data is replicated
+ * for each processor.
+ *
+ * If location_id > 0 and header->n_location_vals > 1, then
+ * global_num_start and global_num_end will be based on location element
+ * numbers, so the total number of values read equals
+ * (global_num_end - global_num_start) * header->n_location_vals.
+ *
+ * If the array intended to receive the data already exists, we pass an
+ * "elt" pointer to this array; this same pointer is then returned.
+ * Otherwise, if this pointer is passed as NULL, memory is allocated
+ * by this function, and the corresponding pointer is returned. It is
+ * the caller's responsibility to free this array.
+ *
+ * parameters:
+ * header <-- header structure
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * (1 to n numbering)
+ * elts <-> pointer to data array, or NULL
+ * inp --> input kernel IO structure
+ *
+ * returns:
+ * elts if non NULL, or pointer to allocated array otherwise
+ *----------------------------------------------------------------------------*/
+
+static void *
+_cs_io_read_body(const cs_io_sec_header_t *header,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ void *elts,
+ cs_io_t *inp)
+{
+ size_t type_size = 0;
+ fvm_file_off_t n_vals = inp->n_vals;
+ cs_bool_t convert_type = false;
+ void *_elts = NULL;
+ void *_buf = NULL;
+ size_t stride = 1;
+
+ assert(inp != NULL);
+
+ assert(header->n_vals == inp->n_vals);
+
+ assert(global_num_end <= header->n_vals + 1);
+
+ /* Choose global or block mode */
+
+ if (header->n_location_vals > 1)
+ stride = header->n_location_vals;
+
+ if (global_num_start > 0 && global_num_end > 0) {
+ assert(global_num_end >= global_num_start);
+ n_vals = (global_num_end - global_num_start)*stride;
+ }
+
+ /* Datatype size given by FVM datatype */
+
+ type_size = fvm_datatype_size[header->type_read];
+
+ /* Assign or allocate */
+
+ _elts = elts;
+
+ if (_elts == NULL && n_vals != 0) {
+ if (header->elt_type == FVM_CHAR)
+ BFT_MALLOC(_elts, n_vals + 1, char);
+ else
+ BFT_MALLOC(_elts, n_vals*type_size, char);
+ }
+
+ /* Element values */
+
+ if (n_vals != 0 && header->elt_type != header->type_read)
+ convert_type = true;
+
+ if (inp->data != NULL)
+ _buf = NULL;
+ else if (convert_type == true
+ && ( fvm_datatype_size[header->type_read]
+ != fvm_datatype_size[header->elt_type]))
+ BFT_MALLOC(_buf, n_vals*type_size, char);
+ else
+ _buf = _elts;
+
+ /* Read data from file */
+
+ if (inp->data == NULL) {
+
+ /* Position read pointer if necessary */
+
+ if (inp->body_align > 0) {
+ fvm_file_off_t offset = fvm_file_tell(inp->f);
+ size_t ba = inp->body_align;
+ offset += (ba - (offset % ba)) % ba;
+ fvm_file_seek(inp->f, offset, FVM_FILE_SEEK_SET);
+ }
+
+ /* Read local or global values */
+
+ if (global_num_start > 0 && global_num_end > 0)
+ fvm_file_read_block(inp->f,
+ _buf,
+ type_size,
+ stride,
+ global_num_start,
+ global_num_end);
+ else if (n_vals > 0)
+ fvm_file_read_global(inp->f,
+ _buf,
+ type_size,
+ n_vals);
+
+ }
+
+ /* If data is embedded in header, simply point to it */
+
+ else {
+
+ if (global_num_start > 0 && global_num_end > 0)
+ _buf = ((unsigned char *)inp->data)
+ + ( (global_num_start - 1) * stride
+ * fvm_datatype_size[header->type_read]);
+ else
+ _buf = inp->data;
+
+ }
+
+ /* Convert data if necessary */
+
+ if (convert_type == true) {
+ _cs_io_convert_read(_buf,
+ _elts,
+ n_vals,
+ header->type_read,
+ header->elt_type);
+ if ( inp->data == NULL
+ && _buf != _elts)
+ BFT_FREE(_buf);
+ }
+ else if (inp->data != NULL) {
+ memcpy(_elts, _buf, n_vals*fvm_datatype_size[header->type_read]);
+ _buf = NULL;
+ }
+
+ if (inp->data != NULL) /* Reset for next read */
+ inp->data = NULL;
+
+ /* Add null character at end of string to ensure C-type string */
+
+ if (n_vals != 0 && header->elt_type == FVM_CHAR)
+ ((char *)_elts)[header->n_vals] = '\0';
+
+ /* Optional echo */
+
+ if (header->n_vals != 0 && inp->echo > CS_IO_ECHO_HEADERS)
+ _echo_data(inp->echo,
+ n_vals,
+ (global_num_start-1)*stride + 1,
+ (global_num_end-1)*stride + 1,
+ header->elt_type,
+ _elts);
+
+ /* Return read values */
+
+ return _elts;
+}
+
+/*----------------------------------------------------------------------------
+ * Build an index for a kernel IO file structure in read mode.
+ *
+ * The magic string may be NULL, if we choose to ignore it.
+ *
+ * parameters:
+ * inp <-> empty input kernel IO file structure
+ * name <-- file name
+ * magic_string <-- magic string associated with file type
+ * comm <-- associated MPI communicator
+ *
+ * returns:
+ * pointer to kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+static void
+_cs_io_initialize_with_index(cs_io_t *inp,
+ const char *file_name,
+ const char *magic_string,
+ MPI_Comm comm)
+#else
+static void
+_cs_io_initialize_with_index(cs_io_t *inp,
+ const char *file_name,
+ const char *magic_string)
+#endif /* FVM_HAVE_MPI */
+{
+ cs_io_sec_header_t h;
+ int end_reached = 0;
+
+ /* Create interface file descriptor; do not use MPI-IO at this
+ stage, as we only read global headers of limited size, and
+ a "lighter" method than MPI-IO should be well adapted. */
+
+#if defined(FVM_HAVE_MPI)
+ _file_open(inp, file_name, magic_string, FVM_FILE_NO_MPI_IO, comm);
+#else
+ _file_open(inp, file_name, magic_string, 0);
+#endif
+
+ /* Update index file section */
+
+ if (inp->index != NULL) {
+ BFT_REALLOC(inp->index->f, inp->index->n_files + 1, fvm_file_t *);
+ inp->index->f[inp->index->n_files] = inp->f;
+ inp->index->n_files += 1;
+ }
+
+ /* Read headers to build index index */
+
+ while (end_reached == 0) {
+
+ end_reached = cs_io_read_header(inp, &h);
+
+ if (end_reached == 0)
+ _update_index_and_shift(inp, &h);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Write padding with zero bytes if necessary to ensure alignment.
+ *
+ * Under MPI, data is only written by the associated communicator's root
+ * rank. The section data on other ranks is ignored, though the file offset
+ * is updated (i.e. the call to this function is collective).
+ *
+ * parameters:
+ * align <-- required alignment
+ * outp --> output kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_write_padding(size_t align,
+ cs_io_t *outp)
+{
+ if (align > 0) {
+
+ fvm_file_off_t offset = fvm_file_tell(outp->f);
+ fvm_file_off_t add_offset = (align - (offset % align)) % align;
+
+ if (add_offset > 0) {
+
+ size_t pad_size = add_offset;
+ size_t n_written = 0;
+
+ if (pad_size > outp->buffer_size) {
+ while (pad_size > outp->buffer_size)
+ outp->buffer_size *=2;
+ BFT_REALLOC(outp->buffer, outp->buffer_size, unsigned char);
+ }
+
+ memset(outp->buffer, 0, pad_size);
+
+ n_written = fvm_file_write_global(outp->f,
+ outp->buffer,
+ 1,
+ pad_size);
+
+ if (pad_size != n_written)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error writing %lu bytes to file \"%s\"."),
+ (unsigned long)pad_size, fvm_file_get_name(outp->f));
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Write a section header, with possibly embedded data.
+ *
+ * Under MPI, data is only written by the associated communicator's root
+ * rank. The section data on other ranks is ignored, though the file offset
+ * is updated (i.e. the call to this function is collective).
+ *
+ * parameters:
+ * section_name <-- section name
+ * n_vals <-- total number of values
+ * location_id <-- id of associated location, or 0
+ * index_id <-- id of associated index, or 0
+ * n_location_vals <-- number of values per location
+ * elt_type <-- element type
+ * elts <-- pointer to element data, if it may be embedded
+ * outp --> output kernel IO structure
+ *
+ * returns:
+ * true if element data is embedded, false otherwise
+ *----------------------------------------------------------------------------*/
+
+static cs_bool_t
+_write_header(const char *sec_name,
+ fvm_gnum_t n_vals,
+ size_t location_id,
+ size_t index_id,
+ size_t n_location_vals,
+ fvm_datatype_t elt_type,
+ const void *elts,
+ cs_io_t *outp)
+{
+ size_t name_size = 0, name_pad_size = 0;
+ fvm_file_off_t write_size = 0;
+ fvm_file_off_t data_size = n_vals * fvm_datatype_size[elt_type];
+ fvm_file_off_t header_vals[6];
+ size_t n_written = 0;
+
+ cs_bool_t embed = false;
+
+ assert(outp != NULL);
+
+ if (outp->echo >= CS_IO_ECHO_HEADERS)
+ _echo_pre(outp);
+
+ _write_padding(outp->header_align, outp); /* Pad if necessary */
+
+ /* Prepare header data */
+ /*---------------------*/
+
+ header_vals[0] = 56;
+ header_vals[1] = n_vals;
+ header_vals[2] = location_id;
+ header_vals[3] = index_id;
+
+ if (n_vals > 0)
+ header_vals[4] = n_location_vals;
+ else
+ header_vals[4] = 0;
+
+ name_size = strlen(sec_name);
+ name_pad_size = 8-(name_size%8); /* At least 1 NULL
+ character with this rule */
+
+ header_vals[5] = name_size + name_pad_size;
+ header_vals[0] += (name_size + name_pad_size);
+
+ /* Decide if data is to be embedded */
+
+ if ( n_vals > 0
+ && elts != NULL
+ && (header_vals[0] + data_size <= (fvm_file_off_t)(outp->header_size))) {
+ header_vals[0] += data_size;
+ embed = true;
+ }
+
+ /* Ensure buffer is big enough for data */
+
+ if (header_vals[0] > (fvm_file_off_t)(outp->buffer_size)) {
+ while (header_vals[0] > (fvm_file_off_t)(outp->buffer_size))
+ outp->buffer_size *=2;
+ BFT_REALLOC(outp->buffer, outp->buffer_size, unsigned char);
+ }
+
+ memset(outp->buffer, 0, outp->buffer_size);
+
+ /* Now build buffer */
+
+ _convert_from_offset(outp->buffer, header_vals, 6);
+
+ if (fvm_file_get_swap_endian(outp->f) == 1)
+ bft_file_swap_endian(outp->buffer, outp->buffer, 8, 6);
+
+ /* Element type name */
+
+ outp->type_name = (char *)outp->buffer + 48;
+
+ if (n_vals > 0) {
+ switch(elt_type) {
+ case FVM_FLOAT:
+ outp->type_name[0] = 'r';
+ if (sizeof(float) == 4)
+ outp->type_name[1] = '4';
+ else
+ outp->type_name[1] = '8';
+ assert(sizeof(float) == 4 || sizeof(float) == 8);
+ break;
+ case FVM_DOUBLE:
+ outp->type_name[0] = 'r';
+ if (sizeof(double) == 8)
+ outp->type_name[1] = '8';
+ else {
+ outp->type_name[1] = '1';
+ outp->type_name[2] = '6';
+ }
+ assert(sizeof(double) == 8 || sizeof(float) == 16);
+ break;
+ case FVM_INT32:
+ outp->type_name[0] = 'i';
+ outp->type_name[1] = '4';
+ break;
+ case FVM_INT64:
+ outp->type_name[0] = 'i';
+ outp->type_name[1] = '4';
+ break;
+ case FVM_UINT32:
+ outp->type_name[0] = 'u';
+ outp->type_name[1] = '4';
+ break;
+ case FVM_UINT64:
+ outp->type_name[0] = 'u';
+ outp->type_name[1] = '4';
+ break;
+ case FVM_CHAR:
+ outp->type_name[0] = 'c';
+ outp->type_name[1] = ' ';
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (embed == true)
+ outp->type_name[7] = 'e';
+
+ /* Section name */
+
+ strcpy((char *)(outp->buffer) + 56, sec_name);
+
+ if (embed == true) {
+
+ unsigned char *data = (unsigned char *)(outp->buffer)
+ + (56 + name_size + name_pad_size);
+
+ memcpy(data, elts, data_size);
+
+ if ( fvm_file_get_swap_endian(outp->f) == 1
+ && fvm_datatype_size[elt_type] > 1)
+ bft_file_swap_endian(data, data, fvm_datatype_size[elt_type], n_vals);
+ }
+
+ /* Now write header data */
+
+ write_size = CS_MAX((fvm_file_off_t)(outp->header_size), header_vals[0]);
+
+ n_written = fvm_file_write_global(outp->f,
+ outp->buffer,
+ 1,
+ write_size);
+
+ if (write_size != (fvm_file_off_t)n_written)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error writing %lu bytes to file \"%s\"."),
+ (unsigned long)write_size, fvm_file_get_name(outp->f));
+
+ if (outp->echo >= CS_IO_ECHO_HEADERS)
+ _echo_header(sec_name, n_vals, elt_type);
+
+ return embed;
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a kernel IO file handle's metadata.
+ *
+ * parameters:
+ * idx <-- kernel IO index
+ *----------------------------------------------------------------------------*/
+
+static void
+_dump_index(const cs_io_sec_index_t *idx)
+{
+ size_t ii;
+
+ assert(idx != NULL);
+
+ bft_printf(_(" %lu indexed records:\n"
+ " (name, n_vals, location_id, index_id, n_loc_vals, type, "
+ "embed, file_id, offset)\n\n"), (unsigned long)(idx->size));
+
+ for (ii = 0; ii < idx->size; ii++) {
+
+ char embed = 'n';
+ fvm_file_off_t *h_vals = idx->h_vals + ii*8;
+ const char *name = idx->names + h_vals[4];
+
+ if (h_vals[5] > 0)
+ embed = 'y';
+
+ bft_printf(_(" %40s %10lu %2u %2u %2u %6s %c %2u %ld\n"),
+ name, (unsigned long)(h_vals[0]),
+ (unsigned)(h_vals[1]), (unsigned)(h_vals[2]),
+ (unsigned)(h_vals[3]), fvm_datatype_name[h_vals[6]],
+ embed, (unsigned)(h_vals[7]),
+ (long)(idx->offset[ii]));
+
+ }
+
+ bft_printf(_("\n %u associated file(s):\n"), (unsigned)(idx->n_files));
+
+ for (ii = 0; ii < idx->n_files; ii++)
+ bft_printf(_(" \"%s\"\n"), fvm_file_get_name(idx->f[ii]));
+
+ bft_printf("\n");
+}
+
+/*============================================================================
+ * Public functions definition for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Set the default kernel IO hints to the specified value.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE IOHINT (IHINT)
+ * *****************
+ *
+ * INTEGER IHINT : <-> : IO hints (bit mask)
+ * 0: default
+ * 1: disable MPI IO
+ * 4: MPI IO uses explicit offsets
+ * 8: MPI IO uses individual pointers
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (iohint, IOHINT) (const cs_int_t *ihint)
+{
+ cs_glob_io_hints = *ihint;
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a kernel IO file structure.
+ *
+ * The magic string may be NULL only in read mode, if we choose to ignore it.
+ *
+ * parameters:
+ * name <-- file name
+ * magic_string <-- magic string associated with file type
+ * mode <-- read or write
+ * hints <-- optional flags for file access method (see fvm_file.h)
+ * echo <-- echo on main output (< 0 if none, header if 0,
+ * n first and last elements if n > 0)
+ * comm <-- associated MPI communicator
+ *
+ * returns:
+ * pointer to kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+cs_io_t *
+cs_io_initialize(const char *file_name,
+ const char *magic_string,
+ cs_io_mode_t mode,
+ int hints,
+ long echo,
+ MPI_Comm comm)
+#else
+cs_io_t *
+cs_io_initialize(const char *file_name,
+ const char *magic_string,
+ cs_io_mode_t mode,
+ int hints,
+ long echo)
+#endif /* FVM_HAVE_MPI */
+{
+ cs_io_t *cs_io =_cs_io_create(mode, echo);
+
+ /* Info on interface creation */
+
+ if (echo >= CS_IO_ECHO_OPEN_CLOSE) {
+ if (mode == CS_IO_MODE_READ)
+ bft_printf(_("\n Reading file: %s\n"), file_name);
+ else
+ bft_printf(_("\n Writing file: %s\n"), file_name);
+ bft_printf_flush();
+ }
+
+ /* Create interface file descriptor */
+
+#if defined(FVM_HAVE_MPI)
+ _file_open(cs_io, file_name, magic_string, hints, comm);
+#else
+ _file_open(cs_io, file_name, magic_string, hints);
+#endif
+
+ return cs_io;
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize a kernel IO file structure in read mode, building an index.
+ *
+ * The magic string may be NULL, if we choose to ignore it.
+ *
+ * parameters:
+ * name <-- file name
+ * magic_string <-- magic string associated with file type
+ * hints <-- optional flags for file access method (see fvm_file.h)
+ * echo <-- echo on main output (< 0 if none, header if 0,
+ * n first and last elements if n > 0)
+ * comm <-- associated MPI communicator
+ *
+ * returns:
+ * pointer to kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+#if defined(FVM_HAVE_MPI)
+cs_io_t *
+cs_io_initialize_with_index(const char *file_name,
+ const char *magic_string,
+ int hints,
+ long echo,
+ MPI_Comm comm)
+#else
+cs_io_t *
+cs_io_initialize_with_index(const char *file_name,
+ const char *magic_string,
+ int hints,
+ long echo)
+#endif /* FVM_HAVE_MPI */
+{
+ int retval = 0;
+
+ cs_io_t *inp =_cs_io_create(CS_IO_MODE_READ, echo);
+
+ /* Info on interface creation */
+
+ if (echo >= CS_IO_ECHO_OPEN_CLOSE) {
+ bft_printf(_("\n Reading file: %s\n"), file_name);
+ bft_printf_flush();
+ }
+
+ /* Initialize index */
+
+ _create_index(inp);
+
+ /* Test for legacy restart format first */
+
+#if defined(FVM_HAVE_MPI)
+ retval = _file_legacy_restart_index(inp, file_name, comm);
+#else
+ retval = _file_legacy_restart_index(inp, file_name);
+
+#endif
+
+ if (retval == 0) {
+
+#if defined(FVM_HAVE_MPI)
+ _cs_io_initialize_with_index(inp, file_name, magic_string, comm);
+#else
+ _cs_io_initialize_with_index(inp, file_name, magic_string);
+#endif
+
+ }
+
+ /* Now reopen all indexed files using hints */
+
+#if defined(FVM_HAVE_MPI)
+ _file_reopen_read(inp, hints, comm);
+#else
+ _file_reopen_read(inp, hints);
+#endif
+
+ return inp;
+}
+
+/*----------------------------------------------------------------------------
+ * Free a kernel IO file structure, closing the associated file.
+ *
+ * parameters:
+ * cs_io <-> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_finalize(cs_io_t **cs_io)
+{
+ cs_io_t *_cs_io = *cs_io;
+
+ if(_cs_io->mode == CS_IO_MODE_WRITE)
+ cs_io_write_global("EOF", 0, 0, 0, 0, FVM_DATATYPE_NULL, NULL, _cs_io);
+
+ /* Info on closing of interface file */
+
+ if (_cs_io->echo >= CS_IO_ECHO_OPEN_CLOSE) {
+ if (_cs_io->mode == CS_IO_MODE_READ)
+ bft_printf(_(" Finished reading: %s\n"),
+ fvm_file_get_name(_cs_io->f));
+ else
+ bft_printf(_(" Finished writing: %s\n"),
+ fvm_file_get_name(_cs_io->f));
+ bft_printf_flush();
+ }
+
+ if (_cs_io->index != NULL)
+ _destroy_index(_cs_io);
+
+ _file_close(_cs_io);
+
+ _cs_io->buffer_size = 0;
+ BFT_FREE(_cs_io->buffer);
+
+ BFT_FREE(*cs_io);
+}
+
+/*----------------------------------------------------------------------------
+ * Return a pointer to a kernel IO structure's name.
+ *
+ * parameters:
+ * cs_io <-- kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+const char *
+cs_io_get_name(const cs_io_t *cs_io)
+{
+ assert(cs_io != NULL);
+
+ return(fvm_file_get_name(cs_io->f));
+}
+
+/*----------------------------------------------------------------------------
+ * Return the number of indexed entries in a kernel IO structure.
+ *
+ * parameters:
+ * inp <-- input kernel IO structure
+ *
+ * returns:
+ * size of index if present, 0 otherwise,
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_io_get_index_size(const cs_io_t *inp)
+{
+ size_t retval = 0;
+
+ if (inp != NULL && inp->index != NULL)
+ retval = inp->index->size;
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Return the name of an indexed section in a kernel IO structure.
+ *
+ * parameters:
+ * inp <-- input kernel IO structure
+ * id <-- id of section in index (0 to n-1 numbering)
+ *
+ * returns:
+ * pointer to section name if id in index range, NULL otherwise
+ *----------------------------------------------------------------------------*/
+
+const char *
+cs_io_get_indexed_sec_name(const cs_io_t *inp,
+ size_t id)
+{
+ const char *retval = NULL;
+
+ if (inp != NULL && inp->index != NULL) {
+ if (id < inp->index->size) {
+ size_t name_id = inp->index->h_vals[8*id + 4];
+ retval = inp->index->names + name_id;
+ }
+ }
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Return header data for an indexed section in a kernel IO structure.
+ *
+ * parameters:
+ * inp <-- input kernel IO structure
+ * id <-- id of section in index (0 to n-1 numbering)
+ *
+ * returns:
+ * section header data (if id not in index range, fields set to zero)
+ *----------------------------------------------------------------------------*/
+
+cs_io_sec_header_t
+cs_io_get_indexed_sec_header(const cs_io_t *inp,
+ size_t id)
+{
+ cs_io_sec_header_t h;
+
+ h.sec_name = NULL;
+
+ if (inp != NULL && inp->index != NULL) {
+ if (id < inp->index->size) {
+
+ size_t name_id = inp->index->h_vals[8*id + 4];
+
+ h.sec_name = inp->index->names + name_id;
+
+ h.n_vals = inp->index->h_vals[8*id];
+ h.location_id = inp->index->h_vals[8*id + 1];
+ h.index_id = inp->index->h_vals[8*id + 2];
+ h.n_location_vals = inp->index->h_vals[8*id + 3];
+ h.type_read = inp->index->h_vals[8*id + 6];
+ h.elt_type = _type_read_to_elt_type(h.type_read);
+ }
+ }
+
+ if (h.sec_name == NULL) {
+ h.n_vals = 0;
+ h.location_id = 0;
+ h.index_id = 0;
+ h.n_location_vals = 0;
+ h.type_read = FVM_DATATYPE_NULL;
+ h.elt_type = h.type_read;
+ }
+
+ return h;
+}
+
+/*----------------------------------------------------------------------------
+ * Return a kernel IO structure's echo (verbosity) level.
+ *
+ * parameters:
+ * cs_io --> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_io_get_echo(const cs_io_t *cs_io)
+{
+ assert(cs_io != NULL);
+
+ return (size_t)(cs_io->echo);
+}
+
+/*----------------------------------------------------------------------------
+ * Read a section header.
+ *
+ * The header values remain valid until the next section header read
+ * or the file is closed.
+ *
+ * parameters:
+ * inp --> input kernel IO structure
+ * header <-- header structure
+ *
+ * returns:
+ * 0 if a header was read, 1 in case of error or end-of-file
+ *----------------------------------------------------------------------------*/
+
+int
+cs_io_read_header(cs_io_t *inp,
+ cs_io_sec_header_t *header)
+{
+ int type_name_error = 0;
+ fvm_file_off_t body_size = 0;
+ fvm_file_off_t header_vals[6];
+ size_t n_read = 0;
+
+ assert(inp != NULL);
+
+ if (inp->echo >= CS_IO_ECHO_HEADERS)
+ _echo_pre(inp);
+
+ /* Position read pointer if necessary */
+ /*------------------------------------*/
+
+ if (inp->header_align > 0) {
+ size_t ha = inp->header_align;
+ fvm_file_off_t offset = fvm_file_tell(inp->f);
+ fvm_file_off_t add_offset = (ha - (offset % ha)) % ha;
+ if (add_offset > 0) {
+ int errcode = 0;
+ errcode = fvm_file_seek(inp->f, add_offset, FVM_FILE_SEEK_CUR);
+ if (errcode != 0)
+ return 1;
+ }
+ }
+
+ inp->n_vals = 0;
+
+ /* Read header */
+ /*-------------*/
+
+ n_read = fvm_file_read_global(inp->f, inp->buffer, 1, inp->header_size);
+
+ if (n_read < inp->header_size)
+ return 1;
+
+ if (fvm_file_get_swap_endian(inp->f) == 1)
+ bft_file_swap_endian(inp->buffer, inp->buffer, 8, 6);
+
+ _convert_to_offset(inp->buffer, header_vals, 6);
+
+ if (header_vals[0] > (fvm_file_off_t)(inp->header_size)) {
+
+ size_t n_add = header_vals[0] - inp->header_size;
+
+ if (header_vals[0] > (fvm_file_off_t)(inp->buffer_size)) {
+ while (header_vals[0] > (fvm_file_off_t)(inp->buffer_size))
+ inp->buffer_size *=2;
+ BFT_REALLOC(inp->buffer, inp->buffer_size, unsigned char);
+ }
+
+ n_read = fvm_file_read_global(inp->f,
+ inp->buffer + inp->header_size,
+ 1,
+ n_add);
+
+ if (n_read < n_add)
+ return 1;
+ }
+
+ /* Set pointers to data fields */
+
+ inp->n_vals = header_vals[1];
+ inp->location_id = header_vals[2];
+ inp->index_id = header_vals[3];
+ inp->n_loc_vals = header_vals[4];
+ inp->type_size = 0;
+ inp->data = NULL;
+ inp->type_name = (char *)(inp->buffer + 48);
+ inp->sec_name = (char *)(inp->buffer + 56);
+
+ if (header_vals[1] > 0 && inp->type_name[7] == 'e')
+ inp->data = inp->buffer + 56 + header_vals[5];
+
+ inp->type_size = 0;
+
+ /* Return immediately if we have an end-of file marker */
+
+ if ((inp->n_vals == 0) && (strcmp(inp->sec_name, "EOF") == 0))
+ return 1;
+
+ if (inp->n_vals > 0) {
+
+ /* Check type name and compute size of data */
+
+ if (inp->type_name[0] == 'c') {
+ if (inp->type_name[1] != ' ')
+ type_name_error = 1;
+ else
+ inp->type_size = 1;
+ }
+ else if ( inp->type_name[0] == 'i'
+ || inp->type_name[0] == 'u'
+ || inp->type_name[0] == 'r') {
+
+ if (inp->type_name[1] == '4')
+ inp->type_size = 4;
+ else if (inp->type_name[1] == '8')
+ inp->type_size = 8;
+ else
+ type_name_error = 1;
+
+ }
+ else
+ type_name_error = 1;
+
+ if (type_name_error)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Type \"%s\" is not known\n"
+ "Known types: \"c \", \"i4\", \"i8\", \"u4\", \"u8\", "
+ "\"r4\", \"r8\"."), inp->type_name);
+
+ else if (inp->data == NULL)
+ body_size = inp->type_size*inp->n_vals;
+
+ else if (fvm_file_get_swap_endian(inp->f) == 1 && inp->type_size > 1)
+ bft_file_swap_endian(inp->data,
+ inp->data,
+ inp->type_size,
+ inp->n_vals);
+ }
+
+ /* Set externally visible header values */
+ /*--------------------------------------*/
+
+ header->sec_name = inp->sec_name;
+ header->n_vals = inp->n_vals;
+ header->location_id = inp->location_id;
+ header->index_id = inp->index_id;
+ header->n_location_vals = inp->n_loc_vals;
+
+ /* Initialize data type */
+ /*----------------------*/
+
+ assert(sizeof(unsigned long) == 8 || sizeof(unsigned long long) == 8);
+
+ if (header->n_vals != 0) {
+
+ const char *elt_type_name = inp->type_name;
+
+ if ( strcmp(elt_type_name, _type_name_i4) == 0
+ || strcmp(elt_type_name, "i ") == 0)
+ header->type_read = FVM_INT32;
+
+ else if (strcmp(elt_type_name, _type_name_i8) == 0)
+ header->type_read = FVM_INT64;
+
+ else if (strcmp(elt_type_name, _type_name_u4) == 0)
+ header->type_read = FVM_UINT32;
+
+ else if (strcmp(elt_type_name, _type_name_u8) == 0)
+ header->type_read = FVM_UINT64;
+
+ else if (strcmp(elt_type_name, _type_name_r4) == 0)
+ header->type_read = FVM_FLOAT;
+
+ else if (strcmp(elt_type_name, _type_name_r8) == 0)
+ header->type_read = FVM_DOUBLE;
+
+ else if (strcmp(elt_type_name, _type_name_char) == 0)
+ header->type_read = FVM_CHAR;
+
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error reading file: \"%s\".\n"
+ "Data type \"%s\" is not recognized."),
+ fvm_file_get_name(inp->f), elt_type_name);
+
+ header->elt_type = _type_read_to_elt_type(header->type_read);
+ }
+
+ /* Possible echo */
+
+ if (inp->echo >= CS_IO_ECHO_HEADERS)
+ _echo_header(header->sec_name,
+ header->n_vals,
+ header->elt_type);
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------
+ * Set a kernel IO's state so as to be ready to read an indexed section.
+ *
+ * The header values and position in the file are set so as to be equivalent
+ * to those they would have if the corresponding header had just been read.
+ *
+ * parameters:
+ * inp <-> input kernel IO structure
+ * header --> associated header
+ * id <-- id of section in index (0 to n-1 numbering)
+ *
+ * returns:
+ * 0 in case of success, 1 in case of error
+ *----------------------------------------------------------------------------*/
+
+int
+cs_io_set_indexed_position(cs_io_t *inp,
+ cs_io_sec_header_t *header,
+ size_t id)
+{
+ int retval = 0;
+
+ /* Return immediately if out of range */
+
+ if (inp == NULL || inp->index == NULL)
+ return 1;
+ if (id >= inp->index->size)
+ return 1;
+
+ header->sec_name = inp->index->names + inp->index->h_vals[8*id + 4];
+
+ header->n_vals = inp->index->h_vals[8*id];
+ header->location_id = inp->index->h_vals[8*id + 1];
+ header->index_id = inp->index->h_vals[8*id + 2];
+ header->n_location_vals = inp->index->h_vals[8*id + 3];
+ header->type_read = inp->index->h_vals[8*id + 6];
+ header->elt_type = _type_read_to_elt_type(header->type_read);
+
+ inp->n_vals = header->n_vals;
+ inp->location_id = header->location_id;
+ inp->index_id = header->index_id;
+ inp->n_loc_vals = header->n_location_vals;
+ inp->type_size = fvm_datatype_size[header->type_read];
+
+ /* The following values are not taken from the header buffer as
+ usual, but are base on the index */
+
+ strcpy((char *)(inp->buffer + 56), header->sec_name);
+ inp->sec_name = (char *)(inp->buffer + 56);
+ inp->type_name = NULL; /* should not be needed now that datatype is known */
+
+ /* Non-embedded values */
+
+ if (inp->index->h_vals[8*id + 5] == 0) {
+ size_t file_id = inp->index->h_vals[8*id + 7];
+ fvm_file_off_t offset = inp->index->offset[id];
+ inp->f = inp->index->f[file_id];
+ retval = fvm_file_seek(inp->f, offset, FVM_FILE_SEEK_SET);
+ }
+
+ /* Embedded values */
+
+ else {
+ size_t data_id = inp->index->h_vals[8*id + 5] - 1;
+ unsigned char *_data = inp->index->data + data_id;
+ inp->data = _data;
+ }
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Set a section's final data type to fvm_lnum_t.
+ *
+ * It the datatype is not compatible, throw an error.
+ *
+ * parameters:
+ * header <-- header structure
+ * cs_io --> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_set_fvm_lnum(cs_io_sec_header_t *header,
+ const cs_io_t *cs_io)
+{
+ assert(header != NULL);
+
+ if ( header->type_read != FVM_INT32
+ && header->type_read != FVM_INT64
+ && header->type_read != FVM_UINT32
+ && header->type_read != FVM_UINT64)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error reading file: \"%s\".\n"
+ "Type expected for section: "
+ "\"%s\" is a signed integer\n"
+ "and is not convertible from type read: \"%s\"."),
+ fvm_file_get_name(cs_io->f), cs_io->type_name);
+
+ assert(sizeof(fvm_lnum_t) == 4 || sizeof(fvm_lnum_t) == 8);
+
+ if (sizeof(fvm_lnum_t) == 4)
+ header->elt_type = FVM_INT32;
+ else
+ header->elt_type = FVM_INT64;
+}
+
+/*----------------------------------------------------------------------------
+ * Set a section's final data type to fvm_gnum_t.
+ *
+ * It the datatype is not compatible, throw an error.
+ *
+ * parameters:
+ * header <-- header structure
+ * cs_io --> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_set_fvm_gnum(cs_io_sec_header_t *header,
+ const cs_io_t *cs_io)
+{
+ assert(header != NULL);
+
+ if ( header->type_read != FVM_INT32
+ && header->type_read != FVM_INT64
+ && header->type_read != FVM_UINT32
+ && header->type_read != FVM_UINT64)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error reading file: \"%s\".\n"
+ "Type expected for section: "
+ "\"%s\" is an unsigned integer\n"
+ "and is not convertible from type read: \"%s\"."),
+ fvm_file_get_name(cs_io->f), cs_io->type_name);
+
+ assert(sizeof(fvm_gnum_t) == 4 || sizeof(fvm_gnum_t) == 8);
+
+ if (sizeof(fvm_gnum_t) == 4)
+ header->elt_type = FVM_UINT32;
+ else
+ header->elt_type = FVM_UINT64;
+}
+
+/*----------------------------------------------------------------------------
+ * Check that a section's final data type corresponds to cs_real_t.
+ *
+ * parameters:
+ * header <-- header structure
+ * cs_io --> kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_assert_cs_real(const cs_io_sec_header_t *header,
+ const cs_io_t *cs_io)
+{
+ assert(header != NULL);
+
+ if ( header->elt_type != FVM_FLOAT
+ && header->elt_type != FVM_DOUBLE)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error reading file: \"%s\".\n"
+ "Type expected for section: \"%s\"\n"
+ "is \"r4\" or \"r8\" (real), and not \"%s\"."),
+ fvm_file_get_name(cs_io->f), cs_io->type_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Read a section body and replicate it to all processors.
+ *
+ * If the array intended to receive the data already exists, we pass an
+ * "elt" pointer to this array; this same pointer is then returned.
+ * Otherwise, if this pointer is passed as NULL, memory is allocated
+ * by this function, and the corresponding pointer is returned. It is
+ * the caller's responsibility to free this array.
+ *
+ * parameters:
+ * header <-- header structure
+ * elts <-> pointer to data array, or NULL
+ * cs_io --> kernel IO structure
+ *
+ * returns:
+ * elts if non NULL, or pointer to allocated array otherwise
+ *----------------------------------------------------------------------------*/
+
+void *
+cs_io_read_global(const cs_io_sec_header_t *header,
+ void *elts,
+ cs_io_t *cs_io)
+{
+ return _cs_io_read_body(header, 0, 0, elts, cs_io);
+}
+
+/*----------------------------------------------------------------------------
+ * Read a section body, assigning a different block to each processor.
+ *
+ * If location_id > 0 and header->n_location_vals > 1, then
+ * global_num_start and global_num_end will be based on location element
+ * numbers, so the total number of values read equals
+ * (global_num_end - global_num_start) * header->n_location_vals.
+ *
+ * If the array intended to receive the data already exists, we pass an
+ * "elt" pointer to this array; this same pointer is then returned.
+ * Otherwise, if this pointer is passed as NULL, memory is allocated
+ * by this function, and the corresponding pointer is returned. It is
+ * the caller's responsibility to free this array.
+ *
+ * parameters:
+ * header <-- header structure
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * (1 to n numbering)
+ * elts <-> pointer to data array, or NULL
+ * cs_io --> kernel IO structure
+ *
+ * returns:
+ * elts if non NULL, or pointer to allocated array otherwise
+ *----------------------------------------------------------------------------*/
+
+void *
+cs_io_read_block(const cs_io_sec_header_t *header,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ void *elts,
+ cs_io_t *cs_io)
+{
+ assert(global_num_start > 0);
+ assert(global_num_end >= global_num_start);
+
+ return _cs_io_read_body(header,
+ global_num_start,
+ global_num_end,
+ elts,
+ cs_io);
+}
+
+/*----------------------------------------------------------------------------
+ * Read a section body, assigning a different block to each processor,
+ * when the body corresponds to an index.
+ *
+ * In serial mode, this function behaves just like cs_io_read_block(),
+ * except that it allows only unsigned integer values (fvm_gnum_t).
+ *
+ * In parallel mode, global_num_end should be set to the past-the-end value
+ * of the base data block, the same as for regular data (and not increased
+ * by 1 for the last rank, as this will be handled internally).
+ * On each rank, the buffer size should be:
+ * global_num_end - global_num_start + 1, as the past-the end index
+ * for the local block is added automatically.
+ *
+ * If the array intended to receive the data already exists, we pass an
+ * "elt" pointer to this array; this same pointer is then returned.
+ * Otherwise, if this pointer is passed as NULL, memory is allocated
+ * by this function, and the corresponding pointer is returned. It is
+ * the caller's responsibility to free this array.
+ *
+ * parameters:
+ * header <-- header structure
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * (1 to n numbering)
+ * elts <-> pointer to data array, or NULL
+ * cs_io --> kernel IO structure
+ *
+ * returns:
+ * elts if non NULL, or pointer to allocated array otherwise
+ *----------------------------------------------------------------------------*/
+
+void *
+cs_io_read_index_block(cs_io_sec_header_t *header,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ fvm_gnum_t *elts,
+ cs_io_t *cs_io)
+{
+ fvm_gnum_t _global_num_start = global_num_start;
+ fvm_gnum_t _global_num_end = global_num_end;
+ fvm_gnum_t *retval = NULL;
+ cs_bool_t last_data_rank = false;
+ cs_bool_t past_last_data_rank = false;
+
+ assert(global_num_start > 0);
+ assert(global_num_end >= global_num_start);
+
+ /* Check type */
+
+ cs_io_set_fvm_gnum(header, cs_io);
+
+ /* Increase _global_num_end by 1 for the last rank */
+
+ if (header->n_vals == global_num_end) {
+
+ _global_num_end += 1;
+ last_data_rank = true;
+
+ /* Also shift start values for possibly empty
+ blocks past the last rank reading data */
+
+ if (global_num_end <= global_num_start) {
+ _global_num_start += 1;
+ past_last_data_rank = true;
+ }
+
+ }
+
+ retval = _cs_io_read_body(header,
+ _global_num_start,
+ _global_num_end,
+ elts,
+ cs_io);
+
+ /* Exchange past-the-end values */
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ int needs_safe_algo_loc = 0;
+ int needs_safe_algo = 0;
+ int rank = cs_glob_rank_id;
+ int send_rank = rank - 1;
+ int recv_rank = rank + 1;
+ MPI_Comm comm = cs_glob_mpi_comm;
+ MPI_Status status;
+ fvm_gnum_t past_last_recv = 0;
+ fvm_gnum_t past_last_send = 0;
+
+ /* Prepare for MPI_Sendrecv */
+
+ if (last_data_rank == true)
+ recv_rank = MPI_PROC_NULL;
+
+ if (past_last_data_rank == true) {
+ send_rank = MPI_PROC_NULL;
+ recv_rank = MPI_PROC_NULL;
+ }
+
+ if (rank == 0)
+ send_rank = MPI_PROC_NULL;
+
+ /* For empty blocks, past_last_send was initialized to 0,
+ and this situation will lead to resorting to a safer
+ but slower algorithm */
+
+ if (global_num_end > global_num_start)
+ past_last_send = retval[0];
+
+ MPI_Sendrecv(&past_last_send, 1, FVM_MPI_GNUM, send_rank, CS_IO_MPI_TAG,
+ &past_last_recv, 1, FVM_MPI_GNUM, recv_rank, CS_IO_MPI_TAG,
+ comm, &status);
+
+ if (recv_rank != MPI_PROC_NULL && past_last_recv == 0)
+ needs_safe_algo_loc = 1;
+
+ /* Check that everything is OK (i.e. no empty intermediate blocks) */
+
+ MPI_Allreduce(&needs_safe_algo_loc, &needs_safe_algo, 1, MPI_INT, MPI_MAX,
+ comm);
+
+ if (needs_safe_algo == 1) {
+
+ int n_ranks = 1;
+ int i;
+ fvm_gnum_t *past_last = NULL;
+
+ MPI_Comm_size(comm, &n_ranks);
+
+ if (rank == 0)
+ BFT_MALLOC(past_last, n_ranks, fvm_gnum_t);
+
+ MPI_Gather(&past_last_send, 1, FVM_MPI_GNUM,
+ &past_last, 1, FVM_MPI_GNUM,
+ 0, comm);
+
+ /* Propagate values from higher ranks if necessary */
+
+ for (i = n_ranks - 1; i > 1; i--) {
+ if (past_last[i-1] == 0)
+ past_last[i-1] = past_last[i];
+ }
+
+ MPI_Scatter(&past_last, 1, FVM_MPI_GNUM,
+ &past_last_recv, 1, FVM_MPI_GNUM,
+ 0, comm);
+
+ if (rank == 0)
+ BFT_FREE(past_last);
+
+ } /* End of condition on safer algorithm */
+
+ if (last_data_rank == false && global_num_end > global_num_start)
+ retval[global_num_end - global_num_start] = past_last_recv;
+
+ }
+
+ if ( header->n_vals != 0 && header->n_vals != global_num_end
+ && cs_io->echo > CS_IO_ECHO_HEADERS)
+ bft_printf(_(" first element for next rank:\n"
+ " %10lu : %12d\n"),
+ (unsigned long)(global_num_end),
+ (unsigned long)retval[global_num_end - global_num_start]);
+
+#endif /* defined(HAVE_MPI) */
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Write a global section.
+ *
+ * Under MPI, data is only written by the associated communicator's root
+ * rank. The section data on other ranks is ignored, though the file offset
+ * is updated (i.e. the call to this function is collective).
+ *
+ * parameters:
+ * section_name <-- section name
+ * n_vals <-- total number of values
+ * location_id <-- id of associated location, or 0
+ * index_id <-- id of associated index, or 0
+ * n_location_vals <-- number of values per location
+ * elt_type <-- element type
+ * elts <-- pointer to element data
+ * outp <-> output kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_write_global(const char *sec_name,
+ fvm_gnum_t n_vals,
+ size_t location_id,
+ size_t index_id,
+ size_t n_location_vals,
+ fvm_datatype_t elt_type,
+ const void *elts,
+ cs_io_t *outp)
+{
+ cs_bool_t embed = false;
+
+ if (outp->echo >= CS_IO_ECHO_HEADERS)
+ _echo_header(sec_name, n_vals, elt_type);
+
+ embed = _write_header(sec_name,
+ n_vals,
+ location_id,
+ index_id,
+ n_location_vals,
+ elt_type,
+ elts,
+ outp);
+
+ if (n_vals > 0 && embed == false) {
+
+ size_t n_written = 0;
+
+ _write_padding(outp->body_align, outp);
+
+ n_written = fvm_file_write_global(outp->f,
+ elts,
+ fvm_datatype_size[elt_type],
+ n_vals);
+
+ if (n_vals != n_written)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error writing %lu bytes to file \"%s\"."),
+ (unsigned long)n_vals, fvm_file_get_name(outp->f));
+
+ }
+
+ if (n_vals != 0 && outp->echo > CS_IO_ECHO_HEADERS)
+ _echo_data(outp->echo, n_vals, 1, n_vals + 1, elt_type, elts);
+}
+
+/*----------------------------------------------------------------------------
+ * Write a section to file, each associated process providing a contiguous
+ * of the section's body.
+ *
+ * Each process should provide a (possibly empty) block of the body,
+ * and we should have:
+ * global_num_start at rank 0 = 1
+ * global_num_start at rank i+1 = global_num_end at rank i.
+ * Otherwise, behavior (especially positioning for future reads) is undefined.
+ *
+ * If location_id > 0 and n_location_vals > 1, then global_num_start
+ * and global_num_end will be based on location element numbers, so the
+ * total number of values read equals
+ * (global_num_end - global_num_start) * header->n_location_vals.
+ *
+ * This function is intended to be used mainly data that is already of
+ * copy of original data (such as data that has been redistributed across
+ * processors just for the sake of output), or that is to be deleted after
+ * writing, so it may modify the values in its input buffer (notably to
+ * convert from little-endian to big-endian of vice-versa if necessary).
+ *
+ * parameters:
+ * section_name <-- section name
+ * n_g_elts <-- number of global elements (locations)
+ * global_num_start <-- global number of first block item (1 to n numbering)
+ * global_num_end <-- global number of past-the end block item
+ * location_id <-- id of associated location, or 0
+ * index_id <-- id of associated index, or 0
+ * n_location_vals <-- number of values per location
+ * elt_type <-- element type
+ * (1 to n numbering)
+ * elts <-- pointer to element data
+ * outp <-> output kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_write_block_buffer(const char *sec_name,
+ fvm_gnum_t n_g_elts,
+ fvm_gnum_t global_num_start,
+ fvm_gnum_t global_num_end,
+ size_t location_id,
+ size_t index_id,
+ size_t n_location_vals,
+ fvm_datatype_t elt_type,
+ void *elts,
+ cs_io_t *outp)
+{
+ size_t n_written = 0;
+ size_t n_g_vals = n_g_elts;
+ size_t n_vals = global_num_end - global_num_start;
+ size_t stride = 1;
+
+ if (n_location_vals > 1) {
+ stride = n_location_vals;
+ n_g_vals *= n_location_vals;
+ n_vals *= n_location_vals;
+ }
+
+ _write_header(sec_name,
+ n_g_vals,
+ location_id,
+ index_id,
+ n_location_vals,
+ elt_type,
+ NULL,
+ outp);
+
+ _write_padding(outp->body_align, outp);
+
+ n_written = fvm_file_write_block_buffer(outp->f,
+ elts,
+ fvm_datatype_size[elt_type],
+ stride,
+ global_num_start,
+ global_num_end);
+
+ if (n_vals != n_written)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error writing %lu bytes to file \"%s\"."),
+ (unsigned long)n_vals, fvm_file_get_name(outp->f));
+
+ if (n_vals != 0 && outp->echo > CS_IO_ECHO_HEADERS)
+ _echo_data(outp->echo, n_g_vals,
+ (global_num_start-1)*stride + 1,
+ (global_num_end -1)*stride + 1,
+ elt_type, elts);
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a kernel IO file handle's metadata.
+ *
+ * parameters:
+ * cs_io <-- kernel IO structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_io_dump(const cs_io_t *cs_io)
+{
+ assert(cs_io != NULL);
+
+ bft_printf(_("\n\n file contents:\n\n"));
+
+ if (cs_io->f != NULL)
+ bft_printf(_(" file: %s\n"), fvm_file_get_name(cs_io->f));
+
+ bft_printf(_(" contents: \"%s\"\n"), cs_io->contents);
+ if (cs_io->mode == CS_IO_MODE_READ)
+ bft_printf(_(" mode: CS_IO_MODE_READ\n"), cs_io->contents);
+ else if (cs_io->mode == CS_IO_MODE_WRITE)
+ bft_printf(_(" mode: CS_IO_MODE_WRITE\n"), cs_io->contents);
+
+ bft_printf(_(" default header size: %lu\n"
+ " header alignment: %lu\n"
+ " body alignment: %lu\n"
+ " verbosity level: %ld\n\n"),
+ cs_io->header_size, cs_io->header_align, cs_io->body_align,
+ cs_io->echo);
+
+ if (cs_io->index != NULL)
+ _dump_index(cs_io->index);
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_join.c b/src/base/cs_join.c
new file mode 100644
index 0000000..0ec667e
--- /dev/null
+++ b/src/base/cs_join.c
@@ -0,0 +1,1733 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Management of conforming and non-conforming joining
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+#include <float.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_mesh_quantities.h"
+#include "cs_post.h"
+#include "cs_join_intersect.h"
+#include "cs_join_merge.h"
+#include "cs_join_mesh.h"
+#include "cs_join_post.h"
+#include "cs_join_set.h"
+#include "cs_join_split.h"
+#include "cs_join_update.h"
+#include "cs_join_util.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Structure Definitions
+ *===========================================================================*/
+
+typedef struct {
+
+ cs_join_param_t param; /* Set of parameters used to control
+ the joining operations */
+
+ char *criteria; /* Criteria used to select border faces
+ implied in the joining operation */
+
+} cs_join_t;
+
+/*============================================================================
+ * Static global variables
+ *===========================================================================*/
+
+static int cs_glob_n_joinings = 0;
+
+static cs_join_t **cs_glob_join_array = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute the distance between two vertices.
+ *
+ * parameters:
+ * a <-- coordinates of the first vertex.
+ * b <-- coordinates of the second vertex.
+ *
+ * returns:
+ * distance between a and b.
+ *---------------------------------------------------------------------------*/
+
+inline static double
+_compute_length(const cs_real_t a[3],
+ const cs_real_t b[3])
+{
+ double length;
+
+ length = sqrt( (b[0] - a[0])*(b[0] - a[0])
+ + (b[1] - a[1])*(b[1] - a[1])
+ + (b[2] - a[2])*(b[2] - a[2]));
+
+ return length;
+}
+
+/*----------------------------------------------------------------------------
+ * Define for each vertex a tolerance which is the radius of the
+ * sphere in which the vertex can be fused with another vertex.
+ * This tolerance is computed from the given list of faces (interior or border)
+ *
+ * parameters:
+ * vertex_coords <-- coordinates of vertices.
+ * vertex_tolerance <-> local tolerance affected to each vertex and
+ * to be updated
+ * n_faces <-- number of selected faces
+ * face_lst <-- list of faces selected to compute the tolerance
+ * face_vtx_idx <-- "face -> vertex" connect. index
+ * face_vtx_lst <-- "face -> vertex" connect. list
+ * fraction <-- parameter used to compute the tolerance
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_local_tolerance(const cs_real_t vtx_coords[],
+ double vtx_tolerance[],
+ const cs_int_t n_faces,
+ const cs_int_t face_lst[],
+ const cs_int_t face_vtx_idx[],
+ const cs_int_t face_vtx_lst[],
+ double fraction)
+{
+ cs_int_t i, j, k, start, end, face_id, vtx_id1, vtx_id2;
+ double length, tolerance;
+ cs_real_t a[3], b[3];
+
+ for (i = 0; i < n_faces; i++) {
+
+ face_id = face_lst[i] - 1;
+ start = face_vtx_idx[face_id] - 1;
+ end = face_vtx_idx[face_id + 1] - 1;
+
+ /* Loop on the vertices of the face */
+
+ for (j = start; j < end - 1; j++) {
+
+ vtx_id1 = face_vtx_lst[j] - 1;
+ vtx_id2 = face_vtx_lst[j+1] - 1;
+
+ for (k = 0; k < 3; k++) {
+ a[k] = vtx_coords[3*vtx_id1 + k];
+ b[k] = vtx_coords[3*vtx_id2 + k];
+ }
+
+ length = _compute_length(a, b);
+ tolerance = length * fraction;
+ vtx_tolerance[vtx_id1] = FVM_MIN(vtx_tolerance[vtx_id1], tolerance);
+ vtx_tolerance[vtx_id2] = FVM_MIN(vtx_tolerance[vtx_id2], tolerance);
+
+ }
+
+ /* Case end - start */
+
+ vtx_id1 = face_vtx_lst[end-1] - 1;
+ vtx_id2 = face_vtx_lst[start] - 1;
+
+ for (k = 0; k < 3; k++) {
+ a[k] = vtx_coords[3*vtx_id1 + k];
+ b[k] = vtx_coords[3*vtx_id2 + k];
+ }
+
+ length = _compute_length(a, b);
+ tolerance = length * fraction;
+ vtx_tolerance[vtx_id1] = FVM_MIN(vtx_tolerance[vtx_id1], tolerance);
+ vtx_tolerance[vtx_id2] = FVM_MIN(vtx_tolerance[vtx_id2], tolerance);
+
+ } /* End of loop on faces */
+
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Exchange local vertex tolerances to get a global vertex tolerance.
+ *
+ * parameters:
+ * n_vertices <-- number of local selected vertices
+ * select_vtx_io_num <-- fvm_io_num_t structure for the selected vertices
+ * vertex_data <-> data associated to each selected vertex
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_global_tolerance(cs_int_t n_vertices,
+ const fvm_io_num_t *select_vtx_io_num,
+ cs_join_vertex_t vtx_data[])
+{
+ cs_int_t i, rank, vtx_id, block_size, shift;
+ fvm_gnum_t first_vtx_gnum;
+
+ double *g_vtx_tolerance = NULL, *send_list = NULL, *recv_list = NULL;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ fvm_gnum_t *send_glist = NULL, *recv_glist = NULL;
+ fvm_gnum_t n_g_vertices = fvm_io_num_get_global_count(select_vtx_io_num);
+ const fvm_gnum_t *io_gnum = fvm_io_num_get_global_num(select_vtx_io_num);
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* Define a fvm_io_num_t structure on vertices */
+
+ block_size = n_g_vertices / n_ranks;
+ if (n_g_vertices % n_ranks > 0)
+ block_size += 1;
+
+ /* Count the number of vertices to send to each rank */
+ /* ------------------------------------------------- */
+
+ BFT_MALLOC(send_count, n_ranks, int);
+ BFT_MALLOC(recv_count, n_ranks, int);
+ BFT_MALLOC(send_shift, n_ranks + 1, int);
+ BFT_MALLOC(recv_shift, n_ranks + 1, int);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++)
+ send_count[rank] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+ rank = (io_gnum[i] - 1)/block_size;
+ send_count[rank] += 1;
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ assert(send_shift[n_ranks] == n_vertices);
+
+ /* Send the global numbering for each vertex */
+ /* ----------------------------------------- */
+
+ BFT_MALLOC(send_glist, n_vertices, fvm_gnum_t);
+ BFT_MALLOC(recv_glist, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (rank = 0; rank < n_ranks; rank++)
+ send_count[rank] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+ rank = (io_gnum[i] - 1)/block_size;
+ shift = send_shift[rank] + send_count[rank];
+ send_count[rank] += 1;
+ send_glist[shift] = io_gnum[i];
+ }
+
+ MPI_Alltoallv(send_glist, send_count, send_shift, FVM_MPI_GNUM,
+ recv_glist, recv_count, recv_shift, FVM_MPI_GNUM, mpi_comm);
+
+ /* Send the vertex tolerance for each vertex */
+ /* ----------------------------------------- */
+
+ BFT_MALLOC(send_list, n_vertices, double);
+ BFT_MALLOC(recv_list, recv_shift[n_ranks], double);
+
+ for (rank = 0; rank < n_ranks; rank++)
+ send_count[rank] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+ rank = (io_gnum[i] - 1)/block_size;
+ shift = send_shift[rank] + send_count[rank];
+ send_count[rank] += 1;
+ send_list[shift] = vtx_data[i].tolerance;
+ }
+
+ MPI_Alltoallv(send_list, send_count, send_shift, MPI_DOUBLE,
+ recv_list, recv_count, recv_shift, MPI_DOUBLE, mpi_comm);
+
+ /* Define the global tolerance array */
+
+ BFT_MALLOC(g_vtx_tolerance, block_size, double);
+
+ for (i = 0; i < block_size; i++)
+ g_vtx_tolerance[i] = DBL_MAX;
+
+ first_vtx_gnum = block_size * local_rank + 1;
+
+ for (i = 0; i < recv_shift[n_ranks]; i++) {
+ vtx_id = recv_glist[i] - first_vtx_gnum;
+ g_vtx_tolerance[vtx_id] = FVM_MIN(g_vtx_tolerance[vtx_id], recv_list[i]);
+ }
+
+ /* Replace local vertex tolerance by the new computed global tolerance */
+
+ for (i = 0; i < recv_shift[n_ranks]; i++) {
+ vtx_id = recv_glist[i] - first_vtx_gnum;
+ recv_list[i] = g_vtx_tolerance[vtx_id];
+ }
+
+ MPI_Alltoallv(recv_list, recv_count, recv_shift, MPI_DOUBLE,
+ send_list, send_count, send_shift, MPI_DOUBLE, mpi_comm);
+
+ for (rank = 0; rank < n_ranks; rank++)
+ send_count[rank] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+ rank = (io_gnum[i] - 1)/block_size;
+ shift = send_shift[rank] + send_count[rank];
+ send_count[rank] += 1;
+ vtx_data[i].tolerance = send_list[shift];
+ }
+
+ /* Free memory */
+
+ BFT_FREE(recv_glist);
+ BFT_FREE(send_glist);
+ BFT_FREE(send_list);
+ BFT_FREE(recv_list);
+ BFT_FREE(recv_count);
+ BFT_FREE(send_count);
+ BFT_FREE(recv_shift);
+ BFT_FREE(send_shift);
+ BFT_FREE(g_vtx_tolerance);
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Define a cs_join_mesh_t structure from a selection of faces and its
+ * related vertices.
+ *
+ * parameters:
+ * name <-- mesh name of the resulting cs_join_mesh_t structure
+ * param <-- set of user-defined parameters for the joining
+ * selection <-> selected entities
+ * b_f2v_idx <-- border "face -> vertex" connectivity index
+ * b_f2v_lst <-- border "face -> vertex" connectivity
+ * i_f2v_idx <-- interior "face -> vertex" connectivity index
+ * i_f2v_lst <-- interior "face -> vertex" connectivity
+ * n_vertices <-- number of vertices in the parent mesh
+ * vtx_coord <-- coordinates of vertices in parent mesh
+ * vtx_gnum <-- global numbering of vertices
+ *---------------------------------------------------------------------------*/
+
+static cs_join_mesh_t *
+_extract_mesh(const char *name,
+ const cs_join_param_t param,
+ cs_join_select_t *selection,
+ const cs_int_t b_f2v_idx[],
+ const cs_int_t b_f2v_lst[],
+ const cs_int_t i_f2v_idx[],
+ const cs_int_t i_f2v_lst[],
+ const cs_int_t n_vertices,
+ const cs_real_t vtx_coord[],
+ const fvm_gnum_t vtx_gnum[])
+{
+ int i;
+ double clock_start, clock_end, cpu_start, cpu_end;
+
+ double *vtx_tolerance = NULL;
+ cs_join_vertex_t *vtx_data = NULL;
+ cs_join_mesh_t *join_mesh = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ /*
+ Define a tolerance around each vertex in the selection list.
+ Tolerance is the radius of the sphere in which the vertex can be merged
+ with another vertex. Radius is the min(fraction * edge_length) on all
+ edges connected to a vertex.
+ Store all data about a vertex in a cs_join_vertex_t structure.
+ */
+
+ if (param.fraction >= 1.0 || param.fraction < 0.0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Incompatible value for the \"fraction\" parameter.\n"
+ "Value must be lower than 1.0 or greater than 0.0\n"
+ "The current value is : %f\n"), param.fraction);
+
+ if (selection->n_vertices > 0) {
+
+ BFT_MALLOC(vtx_tolerance, n_vertices, double);
+
+ /* Compute the tolerance for each vertex of the mesh */
+
+ if (param.fraction > 0.0) {
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_tolerance[i] = DBL_MAX;
+
+ /* Define local tolerance */
+
+ _get_local_tolerance(vtx_coord,
+ vtx_tolerance,
+ selection->n_faces,
+ selection->faces,
+ b_f2v_idx,
+ b_f2v_lst,
+ param.fraction);
+
+ if (param.include_adj_faces == true) {
+
+ /* Update local tolerance with adjacent border faces */
+
+ _get_local_tolerance(vtx_coord,
+ vtx_tolerance,
+ selection->n_b_adj_faces,
+ selection->b_adj_faces,
+ b_f2v_idx,
+ b_f2v_lst,
+ param.fraction);
+
+ /* Update local tolerance with adjacent interior faces */
+
+ _get_local_tolerance(vtx_coord,
+ vtx_tolerance,
+ selection->n_i_adj_faces,
+ selection->i_adj_faces,
+ i_f2v_idx,
+ i_f2v_lst,
+ param.fraction);
+
+ } /* Include adjacent faces in the computation of the vertex tolerance */
+
+ } /* End if tolerance > 0.0 */
+
+ else
+ for (i = 0; i < n_vertices; i++)
+ vtx_tolerance[i] = 0.0;
+
+
+ /* Initialize vtx_data array */
+
+ BFT_MALLOC(vtx_data, selection->n_vertices, cs_join_vertex_t);
+
+ for (i = 0; i < selection->n_vertices; i++) {
+
+ cs_int_t vtx_id = selection->vertices[i]-1;
+
+ if (n_ranks > 1)
+ vtx_data[i].gnum = vtx_gnum[vtx_id];
+ else
+ vtx_data[i].gnum = vtx_id + 1;
+
+ vtx_data[i].coord[0] = vtx_coord[3*vtx_id];
+ vtx_data[i].coord[1] = vtx_coord[3*vtx_id+1];
+ vtx_data[i].coord[2] = vtx_coord[3*vtx_id+2];
+
+ vtx_data[i].tolerance = vtx_tolerance[vtx_id];
+
+ }
+
+ BFT_FREE(vtx_tolerance);
+
+ } /* End if selection->n_vertices > 0 */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Sanity check */
+ for (i = 0; i < selection->n_vertices; i++)
+ if (vtx_data[i].tolerance > (DBL_MAX - 1.))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Incompatible value for the \"vertex tolerance\" parameter\n"
+ "Value must be lower than DBL_MAX and current value is : %f"
+ " (global numbering : %u)\n"),
+ vtx_data[i].tolerance, vtx_data[i].gnum);
+#endif
+
+ /* Parallel treatment : synchro over the ranks */
+
+#if defined(HAVE_MPI)
+
+ if (n_ranks > 1) {
+
+ /* Global number of selected vertices and associated
+ fvm_io_num_t structure */
+
+ fvm_io_num_t *select_vtx_io_num = fvm_io_num_create(selection->vertices,
+ vtx_gnum,
+ selection->n_vertices,
+ 0);
+
+ selection->n_g_vertices = fvm_io_num_get_global_count(select_vtx_io_num);
+
+ _get_global_tolerance(selection->n_vertices,
+ select_vtx_io_num,
+ vtx_data);
+
+ if (param.verbosity > 1)
+ bft_printf(_(" Global number of selected vertices: %11d\n\n"),
+ selection->n_g_vertices);
+
+ fvm_io_num_destroy(select_vtx_io_num);
+
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ /* Define the join mesh strcuture from the selected faces and the
+ related vtx_data on selected vertices */
+
+ join_mesh = cs_join_mesh_create_from_extract(name,
+ selection->n_faces,
+ selection->n_g_faces,
+ selection->faces,
+ selection->compact_face_gnum,
+ b_f2v_idx,
+ b_f2v_lst,
+ selection->n_vertices,
+ selection->n_g_vertices,
+ selection->vertices,
+ vtx_data);
+
+ /* Free memory */
+
+ BFT_FREE(vtx_data);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ if (param.verbosity > 2)
+ bft_printf(_("\n Definition of local joining mesh:\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+
+ if (param.verbosity > 1)
+ cs_join_post_dump_mesh("LocalMesh", join_mesh, param);
+
+ return join_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Define a cs_join_mesh_t structure on only faces which will be
+ * potentially modified by the joining operation.
+ *
+ * In serial mode, this is a subset of the local join mesh.
+ * In parallel mode, this is a distributed subset of the global join mesh.
+ *
+ * Subset is a restriction on faces which could intersect each other.
+ *
+ * Distribution is made so that ther is a well-balanced number of faces
+ * on each rank and so that faces in the mesh are spatially coherent
+ * to insure no problem for differents joining operations.
+ *
+ * Get the associated edges and the list of possible intersections
+ * between these edges.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter
+ * rank_face_gnum_index <-- index on face global numering to determine
+ * the related rank
+ * local_mesh <-- pointer to a cs_join_mesh_t structure
+ * p_work_mesh --> pointer to the work cs_join_mesh_t structure
+ * p_work_edges --> pointer to the cs_join_edges_t structure
+ * p_work_face_normal --> pointer to the normal of faces defined in
+ * the work mesh struture.
+ * p_edge_edge_vis --> pointer to a cs_join_gset_t structure storing
+ * the visibility between edges
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_work_struct(cs_join_param_t param,
+ const fvm_gnum_t rank_face_gnum_index[],
+ const cs_join_mesh_t *local_mesh,
+ cs_join_mesh_t **p_work_mesh,
+ cs_join_edges_t **p_work_edges,
+ cs_real_t *p_work_face_normal[],
+ cs_join_gset_t **p_edge_edge_vis)
+{
+ double clock_start, clock_end, cpu_start, cpu_end;
+
+ cs_int_t n_inter_faces = 0;
+ char *mesh_name = NULL;
+ cs_real_t *face_normal = NULL;
+ fvm_gnum_t *intersect_face_gnum = NULL;
+ cs_join_gset_t *face_face_vis = NULL, *edge_edge_vis = NULL;
+ cs_join_mesh_t *work_mesh = NULL;
+ cs_join_edges_t *work_edges = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+
+ /*
+ Build a bounding box for each selected face.
+ Find intersections between bounding boxes for the whole selected mesh
+ and retrieve a list (cs_join_gset_t structure) which has been
+ distributed over the ranks containing this information.
+ */
+
+ face_face_vis = cs_join_intersect_faces(param, local_mesh);
+
+ /* Define an ordered list of all implied faces without redundancy */
+
+ /* TODO: check if this is necessary after cleanup done in face_face_vis */
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ cs_join_gset_single_order(face_face_vis,
+ &n_inter_faces,
+ &intersect_face_gnum);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ if (param.verbosity > 1)
+ bft_printf(_("\n Sorting possible intersections between faces:\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+
+ /* Define a distributed cs_join_mesh_t structure to store the connectivity
+ of the intersecting faces associated to their bounding boxes in
+ face_inter list */
+
+ if (n_ranks > 1) {
+
+ BFT_MALLOC(mesh_name, strlen("WorkMesh_j_n") + 2 + 5 + 1, char);
+ sprintf(mesh_name,"%s%02d%s%05d",
+ "WorkMesh_j", param.num, "_n", local_rank);
+
+ }
+ else {
+
+ BFT_MALLOC(mesh_name, strlen("WorkMesh_j") + 2 + 1, char);
+ sprintf(mesh_name,"%s%02d", "WorkMesh_j", param.num);
+
+ }
+
+ work_mesh = cs_join_mesh_create_from_glob_sel(mesh_name,
+ n_inter_faces,
+ intersect_face_gnum,
+ rank_face_gnum_index,
+ local_mesh);
+
+ /* Define a cs_join_edges_t structure associated to a cs_join_mesh_t
+ structure on which we work */
+
+ work_edges = cs_join_mesh_define_edges(work_mesh);
+
+ /* Transform face_inter into edge_inter */
+
+ edge_edge_vis = cs_join_intersect_face_to_edge(work_mesh,
+ work_edges,
+ face_face_vis);
+
+ /* Define the normal vector for each selected face before any modification */
+
+ face_normal = cs_join_mesh_get_face_normal(work_mesh);
+
+ /* Free memory */
+
+ BFT_FREE(mesh_name);
+ BFT_FREE(intersect_face_gnum);
+
+ cs_join_gset_destroy(&face_face_vis);
+
+ /* Return pointers */
+
+ *p_work_mesh = work_mesh;
+ *p_work_edges = work_edges;
+ *p_edge_edge_vis = edge_edge_vis;
+ *p_work_face_normal = face_normal;
+}
+
+/*----------------------------------------------------------------------------
+ * Build several structures useful to join faces.
+ *
+ * parameters:
+ * join_param <-- set of parameters for the joining operation
+ * join_selection <-> list of implied entities in the joining operation
+ * mesh <-- pointer of pointer to cs_mesh_t structure
+ * p_loc_join_mesh --> local cs_join_mesh_t structure based on local face
+ * selection
+ * p_work_join_mesh --> distributed and balanced cs_join_mesh_t structure
+ * based on the global face selection
+ * p_work_join_edges --> edges definition related to work_join_mesh
+ * p_work_face_normal --> unitary normal for the faces of work_join_mesh
+ * p_edge_edge_vis --> list of all potential intersections between edges
+ *---------------------------------------------------------------------------*/
+
+static void
+_build_join_structures(cs_join_param_t join_param,
+ cs_join_select_t *join_selection,
+ const cs_mesh_t *mesh,
+ cs_join_mesh_t **p_loc_join_mesh,
+ cs_join_mesh_t **p_work_join_mesh,
+ cs_join_edges_t **p_work_join_edges,
+ cs_real_t *p_work_face_normal[],
+ cs_join_gset_t **p_edge_edge_vis)
+{
+ double clock_start, clock_end, cpu_start, cpu_end;
+
+ char *mesh_name = NULL;
+ cs_real_t *work_face_normal = NULL;
+ cs_join_gset_t *edge_edge_vis = NULL;
+ cs_join_mesh_t *loc_mesh = NULL, *work_mesh = NULL;
+ cs_join_edges_t *work_edges = NULL;
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ /* Define a cs_join_mesh_structure from the selected connectivity */
+
+ if (cs_glob_n_ranks > 1) {
+ BFT_MALLOC(mesh_name, strlen("LocalMesh_n") + 5 + 1, char);
+ sprintf(mesh_name,"%s%05d", "LocalMesh_n", CS_MAX(cs_glob_rank_id, 0));
+ }
+ else {
+ BFT_MALLOC(mesh_name, strlen("LocalMesh") + 1, char);
+ sprintf(mesh_name,"%s", "LocalMesh");
+ }
+
+ loc_mesh = _extract_mesh(mesh_name,
+ join_param,
+ join_selection,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ mesh->i_face_vtx_idx,
+ mesh->i_face_vtx_lst,
+ mesh->n_vertices,
+ mesh->vtx_coord,
+ mesh->global_vtx_num);
+
+ /* Partial free memory */
+
+ BFT_FREE(mesh_name);
+
+ /*
+
+ Define a cs_join_mesh_t structure on only faces which will be
+ potentially modified by the joining operation.
+
+ In serial mode, this is a subset of the local join mesh.
+ In parallel mode, this is a distributed subset of the global join mesh.
+
+ Subset is a restriction on faces which could be intersected each other.
+
+ Distribution is made so that there is a well-balanced number of faces
+ on each rank and so that faces in the mesh are spatially coherent
+ to insure no problem during the different joining operations.
+
+ Get the associated edges and the list of potential intersections
+ between these edges through an edge-edge visibility.
+
+ */
+
+ _get_work_struct(join_param,
+ join_selection->compact_rank_index,
+ loc_mesh,
+ &work_mesh,
+ &work_edges,
+ &work_face_normal,
+ &edge_edge_vis);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ if (join_param.verbosity > 0)
+ bft_printf(_("\n Definition of structures for the joining algorithm:\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+
+ /* Return pointers */
+
+ *p_loc_join_mesh = loc_mesh;
+ *p_work_join_mesh = work_mesh;
+ *p_work_join_edges = work_edges;
+ *p_edge_edge_vis = edge_edge_vis;
+ *p_work_face_normal = work_face_normal;
+
+}
+
+
+/*----------------------------------------------------------------------------
+ * From real intersection between edges, define new vertices and/or
+ * update old vertices.
+ * Keep the relation between two intersecting edges through an equivalence
+ * between the vertex of each edge.
+ * Store also the new description of initial edges through a
+ * cs_join_inter_edges_t structure and synchronize it to get all the
+ * possible equivalences between vertices.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter for the joining
+ * work_join_mesh <-> pointer to a cs_join_mesh_t structure
+ * work_join_edges <-- pointer to a cs_join_edges_t structure
+ * p_edge_edge_vis <-> pointer to a cs_join_glist_t structure
+ * (freed here)
+ * n_g_ifm_vertices <-- global number of vertices on the full mesh before
+ * joining. Use to create the new glob. vertex num.
+ * p_n_g_new_vertices --> global number of vertices created during the
+ * intersection of edges
+ * p_vtx_eset --> structure storing equivalences between vertices
+ * Two vertices are equivalent if they are each
+ * other in their tolerance
+ * p_inter_edges --> structure storing the definition of new vertices
+ * on initial edges
+ *---------------------------------------------------------------------------*/
+
+static void
+_intersect_edges(cs_join_param_t param,
+ cs_join_mesh_t *work_join_mesh,
+ const cs_join_edges_t *work_join_edges,
+ cs_join_gset_t **p_edge_edge_vis,
+ fvm_gnum_t n_g_ifm_vertices,
+ fvm_gnum_t *p_n_g_new_vertices,
+ cs_join_eset_t **p_vtx_eset,
+ cs_join_inter_edges_t **p_inter_edges)
+{
+ double clock_start, clock_end, cpu_start, cpu_end;
+ cs_join_type_t join_type;
+
+ fvm_gnum_t n_g_new_vertices = 0;
+ cs_join_inter_edges_t *inter_edges = NULL;
+ cs_join_eset_t *vtx_eset = NULL;
+ cs_join_inter_set_t *inter_set = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ /*
+ Compute the intersections between edges.
+ Store the output in two data structures:
+ - a cs_join_eset_t struct. to store equiv. between vertices
+ issued from the same intersection
+ - a cs_join_inter_set_t struct. to store detected intersections
+ Return the type of the joining operation: conform or not.
+ */
+
+ join_type = cs_join_intersect_edges(param,
+ *p_edge_edge_vis,
+ work_join_edges,
+ work_join_mesh,
+ &vtx_eset,
+ &inter_set);
+
+ cs_join_gset_destroy(p_edge_edge_vis);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Dump structures after inter. */
+ cs_join_inter_set_dump(inter_set, work_join_edges, work_join_mesh);
+#endif
+
+ /* Synchronize join_type */
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) {
+
+ int tag = (join_type == CS_JOIN_TYPE_CONFORM ? 0 : 1);
+ int sync_tag = tag;
+
+ MPI_Allreduce(&tag, &sync_tag, 1, MPI_INT, MPI_MAX, cs_glob_mpi_comm);
+
+ if (sync_tag == 0)
+ join_type = CS_JOIN_TYPE_CONFORM;
+ else
+ join_type = CS_JOIN_TYPE_NO_CONFORM;
+
+ }
+#endif
+
+ if (join_type == CS_JOIN_TYPE_CONFORM)
+ bft_printf(_("\n Joining operation is conforming.\n"));
+ else if (join_type == CS_JOIN_TYPE_NO_CONFORM)
+ bft_printf(_("\n Joining operation is non-conforming.\n"));
+ bft_printf_flush();
+
+ if (join_type == CS_JOIN_TYPE_NO_CONFORM) {
+
+ /* Creation of new vertices. Update list of equivalent vertices.
+ Associate to each intersection a vertex (old or created) */
+
+ cs_join_create_new_vertices(param.verbosity,
+ work_join_edges,
+ work_join_mesh,
+ inter_set,
+ n_g_ifm_vertices,
+ &n_g_new_vertices,
+ &vtx_eset);
+
+ inter_edges = cs_join_inter_edges_define(work_join_edges, inter_set);
+ inter_set = cs_join_inter_set_destroy(inter_set);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Dump structures after inter. */
+ cs_join_inter_edges_dump(inter_edges, work_join_edges, work_join_mesh);
+#endif
+
+ /* Synchronize inter_edges structure definition */
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1 ) {
+
+ cs_join_inter_edges_t *sync_block = NULL;
+
+ sync_block = cs_join_inter_edges_part_to_block(work_join_mesh,
+ work_join_edges,
+ inter_edges);
+
+ cs_join_inter_edges_block_to_part(work_join_edges->n_g_edges,
+ sync_block,
+ inter_edges);
+
+ cs_join_intersect_update_struct(work_join_edges,
+ work_join_mesh,
+ &inter_edges);
+
+ sync_block = cs_join_inter_edges_destroy(sync_block);
+
+ }
+#endif
+
+ /* Find if there are new equivalences between vertices on a same edge */
+
+ cs_join_add_equiv_from_edges(param,
+ work_join_mesh,
+ work_join_edges,
+ inter_edges,
+ vtx_eset);
+
+ } /* no conform joining operation */
+
+ /* Order and delete redundant equivalences */
+
+ cs_join_eset_clean(&vtx_eset);
+
+ /* Memory management: final state for vtx_eset (no more equiv. to get) */
+
+ vtx_eset->n_max_equiv = vtx_eset->n_equiv;
+ BFT_REALLOC(vtx_eset->equiv_couple, 2*vtx_eset->n_equiv, cs_int_t);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ if (param.verbosity > 0)
+ bft_printf(_("\n"
+ " Edge intersections and vertex creation:\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+
+ /* Returns pointers */
+
+ *p_vtx_eset = vtx_eset;
+ *p_inter_edges = inter_edges;
+ *p_n_g_new_vertices = n_g_new_vertices;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Dump structures after inter. */
+ cs_join_inter_edges_dump(inter_edges, work_join_edges, work_join_mesh);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Merge vertices from equivalences found between vertices.
+ * Update local and work structures after the merge step.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter for the joining
+ * join_select <-- list of all implied entities in the
+ * joining operation
+ * n_iwm_vertices <-- initial number of vertices in work struct.
+ * n_g_ifm_vertices <-- initial global number of vertices for the full
+ * mesh
+ * n_g_new_vertices <-- global number of vertices created with the
+ * intersection of edges
+ * rank_face_gnum_index <-- index on face global numering to determine the
+ * related rank
+ * vtx_equiv_set <-- structure storing equivalences between vertices
+ * Two vertices are equivalent if they are each
+ * other in their tolerance
+ * inter_edges <-- structure storing the definition of new vertices
+ * on initial edges.
+ * p_work <-> pointer to a cs_join_mesh_t structure
+ * p_edges <-> pointer to a cs_join_edges_t structure
+ * p_local_join_mesh <-> pointer to a cs_join_mesh_t structure
+ * mesh <-> pointer to a cs_mesh_t struct. to update
+ *---------------------------------------------------------------------------*/
+
+static void
+_merge_vertices(cs_join_param_t param,
+ cs_join_select_t *join_select,
+ cs_int_t n_iwm_vertices,
+ fvm_gnum_t n_g_ifm_vertices,
+ fvm_gnum_t n_g_new_vertices,
+ cs_join_eset_t *vtx_eset,
+ cs_join_inter_edges_t *inter_edges,
+ cs_join_mesh_t **p_work_join_mesh,
+ cs_join_edges_t **p_work_join_edges,
+ cs_join_mesh_t **p_local_join_mesh,
+ cs_mesh_t *mesh)
+{
+ int i;
+ double clock_start, clock_end, cpu_start, cpu_end;
+
+ fvm_gnum_t n_g_ai_vertices = n_g_ifm_vertices + n_g_new_vertices;
+ fvm_gnum_t *rank_face_gnum_index = join_select->compact_rank_index;
+ fvm_gnum_t *iwm_vtx_gnum = NULL;
+ fvm_gnum_t *o2n_vtx_gnum = NULL;
+ cs_join_mesh_t *local_join_mesh = *p_local_join_mesh;
+ cs_join_mesh_t *work_join_mesh = *p_work_join_mesh;
+ cs_join_edges_t *work_join_edges = *p_work_join_edges;
+
+ assert(local_join_mesh != NULL);
+ assert(work_join_mesh != NULL);
+ assert(work_join_edges != NULL);
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ /*
+ Store the initial global vertex numbering
+ Initial vertices are between [0, n_init_vertices[
+ Added vertices from inter. are between [n_init_vertices, n_vertices]
+ */
+
+ BFT_MALLOC(iwm_vtx_gnum, n_iwm_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_iwm_vertices; i++)
+ iwm_vtx_gnum[i] = (work_join_mesh->vertices[i]).gnum;
+
+ /* Merge vertices */
+
+ cs_join_merge_vertices(param,
+ n_g_ai_vertices, /* ai: after intersection */
+ work_join_mesh,
+ vtx_eset);
+
+ cs_join_eset_destroy(&vtx_eset);
+
+ /* Keep the evolution of vertex global numbering.
+ Update work and local structures after vertex merge */
+
+ cs_join_merge_update_struct(param,
+ n_iwm_vertices,
+ n_g_ifm_vertices,
+ iwm_vtx_gnum,
+ rank_face_gnum_index,
+ &work_join_mesh,
+ &work_join_edges,
+ &inter_edges,
+ &local_join_mesh,
+ &o2n_vtx_gnum);
+
+ /* Free memory */
+
+ BFT_FREE(iwm_vtx_gnum);
+
+ inter_edges = cs_join_inter_edges_destroy(inter_edges);
+
+ /* Post if required and level of verbosity is reached */
+
+ if (param.verbosity > 1)
+ cs_join_post_dump_mesh("MergeWorkMesh", work_join_mesh, param);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (param.verbosity > 2) { /* Dump distributed face connectivity */
+ bft_printf("\n\n cs_join_edges_t structure after vertex merge\n");
+ cs_join_mesh_dump_edges(work_join_edges, work_join_mesh);
+ }
+#endif
+
+ /* Update cs_mesh_t structure after the vertex merge */
+
+ cs_join_update_mesh_after_merge(param,
+ join_select,
+ o2n_vtx_gnum, /* free inside */
+ local_join_mesh,
+ mesh);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ if (param.verbosity > 0)
+ bft_printf(_("\n"
+ " Merge vertices:\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+
+ /* Set return pointers */
+
+ *p_local_join_mesh = local_join_mesh;
+ *p_work_join_mesh = work_join_mesh;
+ *p_work_join_edges = work_join_edges;
+}
+
+/*----------------------------------------------------------------------------
+ * Split faces and update cs_mesh_t structure.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter
+ * join_select <-- list of all implied entities in the
+ * joining operation
+ * work_join_edges <-- pointer to a cs_join_edges_t structure
+ * work_face_normal <-- normal based on the original face definition
+ * rank_face_gnum_index <-- index on face global numering to determine the
+ * related rank
+ * p_work_join_mesh <-> pointer to a cs_join_mesh_t structure
+ * local_join_mesh <-- pointer to a cs_join_mesh_t structure
+ * p_mesh <-> pointer to cs_mesh_t struct.
+ *---------------------------------------------------------------------------*/
+
+static void
+_split_faces(cs_join_param_t param,
+ cs_join_select_t *join_select,
+ cs_join_edges_t *work_join_edges,
+ fvm_coord_t *work_face_normal,
+ cs_join_mesh_t **p_work_join_mesh,
+ cs_join_mesh_t *local_join_mesh,
+ cs_mesh_t **p_mesh)
+{
+ double clock_start, clock_end, cpu_start, cpu_end;
+
+ fvm_gnum_t *rank_face_gnum_index = join_select->compact_rank_index;
+ cs_join_gset_t *old2new_hist = NULL;
+ cs_mesh_t *mesh = *p_mesh;
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ cs_join_split_faces(param,
+ work_face_normal,
+ work_join_edges,
+ p_work_join_mesh,
+ &old2new_hist);
+
+ /* Send back to the original rank the new face description */
+
+ cs_join_split_update_struct(*p_work_join_mesh,
+ rank_face_gnum_index,
+ &old2new_hist,
+ &local_join_mesh);
+
+ /* Update cs_mesh_t structure after the face splitting */
+
+ cs_join_update_mesh_after_split(param,
+ join_select,
+ old2new_hist,
+ local_join_mesh,
+ mesh);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ /* Partial free memory */
+
+ if (param.verbosity > 0)
+ bft_printf(_("\n"
+ " Split old faces and reconstruct new faces\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+
+ /* Post if required and level of verbosity is reached */
+
+ if (param.verbosity > 1)
+ cs_join_post_dump_mesh("SplitWorkMesh", *p_work_join_mesh, param);
+
+ /* Free memory */
+
+ cs_join_gset_destroy(&old2new_hist);
+}
+
+/*----------------------------------------------------------------------------
+ * Delete all cs_join_t structures.
+ *---------------------------------------------------------------------------*/
+
+static void
+_destroy_all_joinings(void)
+{
+ cs_int_t i;
+
+ for (i = 0; i < cs_glob_n_joinings; i++) {
+
+ cs_join_t *join = cs_glob_join_array[i];
+
+ BFT_FREE(join->criteria);
+ BFT_FREE(join);
+
+ cs_glob_join_array[i] = NULL;
+
+ } /* End of loop on cs_join_t structures */
+
+ cs_glob_n_joinings = 0;
+ BFT_FREE(cs_glob_join_array);
+
+}
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define new boundary faces joining.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE DEFJO1
+ * *****************
+ *
+ * CHARACTER* joining_criteria : <-- : boundary face selection criteria,
+ * REAL fraction : <-- : parameter for merging vertices
+ * REAL plane : <-- : parameter for splitting faces
+ * REAL rtf : <-- : reduction of tolerance factor
+ * REAL mtf : <-- : merge tolerance coefficient
+ * REAL etf : <-- : equivalence tolerance coefficient
+ * INTEGER verbosity : <-- : verbosity level
+ * INTEGER joining_c_len : <-- : length of joining_criteria
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(defjo1, DEFJO1)
+(
+ const char *joining_criteria,
+ cs_real_t *fraction,
+ cs_real_t *plane,
+ cs_real_t *rtf,
+ cs_real_t *mtf,
+ cs_real_t *etf,
+ cs_int_t *verbosity,
+ cs_int_t *joining_c_len
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ char *_joining_criteria = NULL;
+ int tml, tmb, max_sub_faces;
+ double tmr;
+
+ if (joining_criteria != NULL && *joining_c_len > 0)
+ _joining_criteria = cs_base_string_f_to_c_create(joining_criteria,
+ *joining_c_len);
+ if (_joining_criteria != NULL && strlen(_joining_criteria) == 0)
+ cs_base_string_f_to_c_free(&_joining_criteria);
+
+ /* Maximum allowable number of sub-faces for a given face */
+
+ max_sub_faces = 100;
+
+ /* Default values for tree-base algorithm control parameters.
+ * These parameters are not available on the user side and must be
+ * modified here if needed. */
+
+ /* Tree Max. Level: deepest level reachable during the tree building */
+
+ tml = 30;
+
+ /* Tree Max. Boxes: max. number of boxes which can be related to a leaf of
+ * the tree if level != tree_max_level */
+
+ tmb = 30;
+
+ /* Tree Max. Ratio: stop tree building if n_linked_boxes in the whole tree
+ * is greater than tree_max_box_ratio*n_init_boxes */
+
+ tmr = 10.0;
+
+ cs_join_add(_joining_criteria,
+ *fraction,
+ *plane,
+ *rtf,
+ *mtf,
+ *etf,
+ max_sub_faces,
+ tml,
+ tmb,
+ tmr,
+ *verbosity);
+
+ if (_joining_criteria != NULL)
+ cs_base_string_f_to_c_free(&_joining_criteria);
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create and initialize a cs_join_t structure.
+ *
+ * parameters:
+ * sel_criteria <-- boundary face selection criteria
+ * fraction <-- value of the fraction parameter
+ * plane <-- value of the plane parameter
+ * rtf <-- value of the "reduction tolerance factor" parameter
+ * mtf <-- value of the "merge tolerance factor" parameter
+ * etf <-- value of the "edge equiv. tolerance factor" parameter
+ * max_sub_faces <-- value of the max_sub_faces
+ * tml <-- value of the "tree max level" parameter
+ * tmb <-- value of the "tree max boxes" parameter
+ * tmr <-- value of the "tree max ratio" parameter
+ * verbosity <-- level of verbosity required
+ *
+ * returns:
+ * a pointer to a cs_join_t structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_add(char *sel_criteria,
+ float fraction,
+ float plane,
+ float rtf,
+ float mtf,
+ float etf,
+ int max_sub_faces,
+ int tml,
+ int tmb,
+ float tmr,
+ int verbosity)
+{
+ size_t l;
+
+ cs_join_t *join = NULL;
+
+ /* Check parameters value */
+
+ if (fraction < 0.0 || fraction >= 1.0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Mesh joining:"
+ " Forbidden value for the fraction parameter.\n"
+ " It must be between [0.0, 1.0[ and is here: %f\n"),
+ fraction);
+
+ if (rtf < 0.0 || rtf >= 1.0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Mesh joining:"
+ " Forbidden value for the tolerance reduction factor.\n"
+ " It must be between [0.0, 1.0[ and not: %f\n"),
+ rtf);
+
+ if (mtf < 0.0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Mesh joining:"
+ " Forbidden value for the merge tolerance factor.\n"
+ " It must be positive or nul and not: %f\n"),
+ mtf);
+
+ if (etf < 0.0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Mesh joining:"
+ " Forbidden value for the equivalence tolerance factor.\n"
+ " It must be positive or zero and not: %f\n"),
+ etf);
+
+ if (plane < 0.0 || plane >= 90.0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Mesh joining:"
+ " Forbidden value for the plane parameter.\n"
+ " It must be between [0, 90] and is here: %f\n"),
+ plane);
+
+ /* Allocate and initialize a cs_join_t structure */
+
+ BFT_REALLOC(cs_glob_join_array, cs_glob_n_joinings + 1, cs_join_t *);
+ BFT_MALLOC(join, 1, cs_join_t);
+
+ join->param = cs_join_param_define(cs_glob_n_joinings,
+ fraction,
+ plane,
+ rtf,
+ mtf,
+ etf,
+ max_sub_faces,
+ tml,
+ tmb,
+ tmr,
+ verbosity);
+
+ /* Copy the selection criteria for future use */
+
+ l = strlen(sel_criteria);
+ BFT_MALLOC(join->criteria, l + 1, char);
+ strcpy(join->criteria, sel_criteria);
+
+ /* Update global array */
+
+ cs_glob_join_array[cs_glob_n_joinings] = join;
+ cs_glob_n_joinings++;
+}
+
+/*----------------------------------------------------------------------------
+ * Apply all the defined joining operations.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_join_all(void)
+{
+ cs_int_t join_id;
+ double clock_start, clock_end, cpu_start, cpu_end;
+ double full_clock_start, full_clock_end, full_cpu_start, full_cpu_end;
+
+ cs_real_t *b_face_cog = NULL, *b_face_normal = NULL;
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ if (cs_glob_n_joinings < 1)
+ return;
+
+ /* Sanity checks */
+
+ assert(sizeof(cs_int_t) == sizeof(fvm_lnum_t));
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ full_clock_start = bft_timer_wtime();
+ full_cpu_start = bft_timer_cpu_time();
+
+ cs_join_post_init();
+
+ /* Loop on each defined joining to deal with */
+
+ for (join_id = 0; join_id < cs_glob_n_joinings; join_id++) {
+
+ cs_join_t *join_info = cs_glob_join_array[join_id];
+ cs_join_param_t join_param = join_info->param;
+ cs_join_select_t *join_select = NULL;
+
+ clock_start = bft_timer_wtime(); /* Start timer */
+ cpu_start = bft_timer_cpu_time();
+
+ /* Print information into listing file */
+
+ bft_printf(_("\n -------------------------------------------------------\n"
+ " Joining number %d:\n\n"), join_id + 1);
+ bft_printf(_(" Selection criteria: \"%s\"\n"), join_info->criteria);
+
+ if (join_param.verbosity > 0) {
+ bft_printf(_("\n"
+ " Parameters for the joining operation:\n"
+ " Shortest incident edge fraction: %8.5f\n"
+ " Main tolerance reduction factor: %8.5f\n"
+ " Vertex matching tolerance reduction: %8.5f\n"
+ " Merge step tolerance multiplier: %8.5f\n"
+ " Maximum angle between joined face planes: %8.5f\n\n"),
+ join_param.fraction,
+ join_param.reduce_tol_factor,
+ join_param.edge_equiv_tol_coef,
+ join_param.merge_tol_coef,
+ join_param.plane);
+ cs_mesh_print_info(mesh, _(" Before joining"));
+ bft_printf("\n");
+ }
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ {
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_InitMesh_.dat")+1+4+2;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_InitMesh_%04d.dat",
+ join_id+1, fvm_parall_get_rank());
+ dbg_file = fopen(filename, "w");
+
+ cs_mesh_dump_file(dbg_file, mesh);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+ }
+#endif
+
+ /* Build arrays and structures required for selection;
+ will be destoyed after joining and rebuilt once all
+ join operations are finished */
+
+ cs_mesh_init_group_classes(mesh);
+
+ cs_mesh_quantities_b_faces(mesh, &b_face_cog, &b_face_normal);
+
+ cs_glob_mesh->select_b_faces
+ = fvm_selector_create(mesh->dim,
+ mesh->n_b_faces,
+ mesh->class_defs,
+ mesh->b_face_family,
+ 1,
+ b_face_cog,
+ b_face_normal);
+
+ /* Get selected faces for this joining and define the related
+ cs_join_face_select_t structure.
+ - Compute the global number of selected faces
+ - Get the adjacent faces, ... */
+
+ join_select = cs_join_select_create(join_info->criteria,
+ join_param.verbosity);
+
+ /* Free arrays and structures needed for selection */
+
+ BFT_FREE(b_face_cog);
+ BFT_FREE(b_face_normal);
+
+ mesh->class_defs = fvm_group_class_set_destroy(mesh->class_defs);
+
+ if (mesh->select_b_faces != NULL)
+ mesh->select_b_faces = fvm_selector_destroy(mesh->select_b_faces);
+ if (mesh->class_defs != NULL)
+ mesh->class_defs = fvm_group_class_set_destroy(mesh->class_defs);
+
+ /* Now execute the joining operation */
+
+ if (join_select->n_g_faces > 0) {
+
+ cs_int_t n_iwm_vertices; /* iwm: initial work mesh */
+ fvm_gnum_t n_g_ifm_vertices; /* ifm: initial full mesh */
+ fvm_gnum_t n_g_new_vertices;
+
+ cs_real_t *work_face_normal = NULL;
+ cs_join_gset_t *edge_edge_visibility = NULL;
+ cs_join_mesh_t *work_join_mesh = NULL, *local_join_mesh = NULL;
+ cs_join_edges_t *work_join_edges = NULL;
+ cs_join_eset_t *vtx_eset = NULL;
+ cs_join_inter_edges_t *inter_edges = NULL;
+
+ _build_join_structures(join_param,
+ join_select,
+ mesh,
+ &local_join_mesh,
+ &work_join_mesh,
+ &work_join_edges,
+ &work_face_normal,
+ &edge_edge_visibility);
+
+ n_iwm_vertices = work_join_mesh->n_vertices;
+ n_g_ifm_vertices = mesh->n_g_vertices;
+
+ if (join_param.verbosity > 2)
+ bft_printf(_("\n Number of faces to treat locally: %10d\n"),
+ work_join_mesh->n_faces);
+
+ /*
+
+ Define new vertices and/or update old vertices from the real
+ intersection found between edges,
+ Keep the relation between two intersecting edges through an
+ equivalence between the vertex of each edge.
+ Store also the new description of the initial edges through a
+ cs_join_inter_edges_t structure and synchronize it to get all the
+ possible equivalences between vertices.
+ Work mesh structure is not yet fully updated by the new vertices
+ because the synchronization step has to be done.
+
+ */
+
+ _intersect_edges(join_param,
+ work_join_mesh,
+ work_join_edges,
+ &edge_edge_visibility, /* free during this step */
+ mesh->n_g_vertices,
+ &n_g_new_vertices,
+ &vtx_eset,
+ &inter_edges);
+
+ /*
+ Merge vertices from equivalences found between vertices.
+ Update work structures after the merge step.
+ Keep the evolution of the global numbering of initial vertices and
+ get the sync_block cs_join_inter_edges_t structure to enable the
+ local structure update after the merge step.
+ */
+
+ _merge_vertices(join_param,
+ join_select,
+ n_iwm_vertices,
+ n_g_ifm_vertices,
+ n_g_new_vertices,
+ vtx_eset, /* free during this step */
+ inter_edges, /* free during this step */
+ &work_join_mesh,
+ &work_join_edges,
+ &local_join_mesh,
+ mesh);
+
+ /*
+ Split faces in work_join_mesh. Apply modification to the
+ local_join_mesh. Keep a history between old --> new faces.
+ Update cs_mesh_t structure.
+ */
+
+ _split_faces(join_param,
+ join_select,
+ work_join_edges,
+ work_face_normal,
+ &work_join_mesh,
+ local_join_mesh,
+ &mesh);
+
+ /* Free memory */
+
+ cs_join_mesh_destroy(&local_join_mesh);
+ cs_join_mesh_destroy(&work_join_mesh);
+ cs_join_mesh_destroy_edges(&work_join_edges);
+
+ BFT_FREE(work_face_normal);
+
+ /* Clean mesh (delete redundant edge definition) */
+
+ cs_join_update_mesh_clean(join_param, mesh);
+
+ }
+ else
+ bft_printf(_("\nStop joining algorithm: no face selected...\n"));
+
+ /* Free memory */
+
+ cs_join_select_destroy(&join_select);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ bft_printf(_("\n"
+ " Complete joining treatment for joining %2d\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ join_id+1, clock_end - clock_start, cpu_end - cpu_start);
+ bft_printf_flush();
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (join_param.verbosity > 2) {
+
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_FinalMesh_.dat")+1+4+2;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_FinalMesh_%04d.dat",
+ join_id+1, fvm_parall_get_rank());
+ dbg_file = fopen(filename, "w");
+
+ cs_mesh_dump_file(dbg_file, mesh);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+ }
+
+ cs_debug_glob_mesh_dump("FinalGlobalVertices", mesh);
+#endif
+
+#if defined(HAVE_MPI) /* Synchronization */
+ if (cs_glob_n_ranks > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ if (join_param.verbosity > 0) {
+ bft_printf("\n");
+ cs_mesh_print_info(mesh, _(" After joining"));
+ bft_printf("\n");
+ }
+
+ } /* End of loop on joinings */
+
+ /* Destroy all remaining structures relative to joining operation */
+
+ _destroy_all_joinings();
+
+ full_clock_end = bft_timer_wtime();
+ full_cpu_end = bft_timer_cpu_time();
+
+ bft_printf(_("\n"
+ " All joining operations successfully finished:\n"
+ "\n"
+ " Time summary:\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n\n"),
+ full_clock_end - full_clock_start,
+ full_cpu_end - full_cpu_start);
+
+ bft_printf_flush();
+}
+
+/*---------------------------------------------------------------------------*/
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ {
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_.dat")+ strlen(local_join_mesh->name) + 4 + 1 + 2;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_%s%04d.dat",
+ join_param.num, local_join_mesh->name, fvm_parall_get_rank());
+ dbg_file = fopen(filename, "w");
+
+ cs_join_mesh_dump_file(dbg_file, local_join_mesh);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+ }
+#endif
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ cs_debug_glob_mesh_dump("FinalGlobalVertices", mesh);
+#endif
+
+END_C_DECLS
diff --git a/src/base/cs_join_f2c.f90 b/src/base/cs_join_f2c.f90
new file mode 100644
index 0000000..dc4e805
--- /dev/null
+++ b/src/base/cs_join_f2c.f90
@@ -0,0 +1,89 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine defjoi &
+!================
+
+ ( critjo, fract, plane, rtf, mtf, etf, iwarni )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! DEFINITION DE RECOLLEMENT DE MAILLAGES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! critjo ! a ! <-- ! critere de selection des faces de !
+! ! ! ! bord a recoller !
+! fract ! r ! <-- ! parametre fraction !
+! plane ! r ! <-- ! coefficient de coplaneite !
+! rtf ! r ! <-- ! reduction of tolerance factor !
+! mtf ! r ! <-- ! merge tolerance coefficient !
+! etf ! r ! <-- ! equivalence tolerance coefficient !
+! iwarni ! e ! <-- ! niveau d'impression !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*(*) critjo
+integer iwarni
+double precision fract, plane, rtf, mtf, etf
+
+! Variables locales
+
+integer lcritj
+
+!===============================================================================
+
+lcritj = len(critjo)
+
+call defjo1(critjo, fract, plane, rtf, mtf, etf, iwarni, lcritj)
+!==========
+
+return
+
+end subroutine
+
diff --git a/src/base/cs_join_intersect.c b/src/base/cs_join_intersect.c
new file mode 100644
index 0000000..0519ae7
--- /dev/null
+++ b/src/base/cs_join_intersect.c
@@ -0,0 +1,3129 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Set of subroutines useful for intersecting entities during the joining
+ * operations:
+ * - Intersections of bounding boxes thanks to a box-tree structure,
+ * - Creation of new vertices from edge intersections,
+ * - Synchronizing intersections in parallel mode.
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_timer.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_neighborhood.h>
+#include <fvm_io_num.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_mesh.h"
+#include "cs_join_set.h"
+#include "cs_join_util.h"
+#include "cs_search.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_intersect.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Structure and type definitions
+ *===========================================================================*/
+
+/* -------------------------------------------------------------
+ * Definition of a structure useful for exchanging intersections
+ * between ranks (_sync_edge_inter())
+ * ------------------------------------------------------------- */
+
+typedef struct {
+
+ fvm_gnum_t vtx_gnum; /* vertex global number relative to the inter. */
+ float curv_abs; /* curvilinear abscissa of the intersection */
+
+} exch_inter_t;
+
+/*============================================================================
+ * Global variable definitions
+ *===========================================================================*/
+
+static int _n_inter_tolerance_warnings;
+
+static const double _cs_join_tol_eps_coef = 1.0001;
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" and apply the sort to its associated array "b" (local
+ * numbering)
+ * Sort is realized thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l <-- left bound
+ * r <-- right bound
+ * a <-> array to sort
+ * b <-> associated array
+ *---------------------------------------------------------------------------*/
+
+inline static void
+_adapted_lshellsort(cs_int_t l,
+ cs_int_t r,
+ float a[],
+ cs_int_t b[])
+{
+ int i, j, h;
+ cs_int_t size = r - l;
+
+ if (size == 0)
+ return;
+
+ /* Compute stride */
+ for (h = 1; h <= size/9; h = 3*h+1) ;
+
+ /* Sort array */
+ for ( ; h > 0; h /= 3) {
+
+ for (i = l+h; i < r; i++) {
+
+ float va = a[i];
+ cs_int_t vb = b[i];
+
+ j = i;
+ while ( (j >= l+h) && (va < a[j-h]) ) {
+ a[j] = a[j-h];
+ b[j] = b[j-h];
+ j -= h;
+ }
+ a[j] = va;
+ b[j] = vb;
+
+ } /* Loop on array elements */
+
+ } /* End of loop on stride */
+}
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" and apply the sort to its associated array "b" (global
+ * numbering)
+ * Sort is realized thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l <-- left bound
+ * r <-- right bound
+ * a <-> array to sort
+ * b <-> associated array
+ *---------------------------------------------------------------------------*/
+
+inline static void
+_adapted_gshellsort(cs_int_t l,
+ cs_int_t r,
+ float a[],
+ fvm_gnum_t b[])
+{
+ int i, j, h;
+ cs_int_t size = r - l;
+
+ if (size == 0)
+ return;
+
+ /* Compute stride */
+ for (h = 1; h <= size/9; h = 3*h+1) ;
+
+ /* Sort array */
+ for ( ; h > 0; h /= 3) {
+
+ for (i = l+h; i < r; i++) {
+
+ float va = a[i];
+ fvm_gnum_t vb = b[i];
+
+ j = i;
+ while ( (j >= l+h) && (va < a[j-h]) ) {
+ a[j] = a[j-h];
+ b[j] = b[j-h];
+ j -= h;
+ }
+ a[j] = va;
+ b[j] = vb;
+
+ } /* Loop on array elements */
+
+ } /* End of loop on stride */
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the dot product of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ *
+ * returns:
+ * the resulting dot product (v1.v2)
+ *----------------------------------------------------------------------------*/
+
+inline static double
+_dot_product(const double v1[],
+ const double v2[])
+{
+ int i;
+ double result = 0.0;
+
+ for (i = 0; i < 3; i++)
+ result += v1[i] * v2[i];
+
+ return result;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the min/max coordinates for the current face in taking into account
+ * the fraction parameter.
+ *
+ * parameters:
+ * face_start <-- start index in face_vtx_lst
+ * face_end <-- end index in face_vtx_lst
+ * face_vtx_lst <-- list of vertices for "face->vertices" connectivity
+ * n_vertices <-- number of vertices
+ * vertices <-- array on data associated to each selected vertex
+ * extents --> min. and max coordinates of the bounding box
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_face_extents(const cs_int_t face_start,
+ const cs_int_t face_end,
+ const cs_int_t face_vtx_lst[],
+ const cs_int_t n_vertices,
+ const cs_join_vertex_t *vertices,
+ fvm_coord_t extents[6])
+{
+ cs_int_t i, j;
+
+ /* Initalization */
+
+ for (i = 0; i < 3; i++) {
+ extents[i] = DBL_MAX;
+ extents[3 + i] = -DBL_MAX;
+ }
+
+ /* Loop on vertices */
+
+ for (i = face_start - 1; i < face_end - 1; i++) {
+
+ cs_int_t vtx_id = face_vtx_lst[i] - 1;
+ cs_join_vertex_t vtx = vertices[vtx_id];
+
+ assert(vtx_id < n_vertices);
+
+ for (j = 0; j < 3; j++) {
+ extents[j] = CS_MIN(extents[j], vtx.coord[j] - vtx.tolerance);
+ extents[3 + j] = CS_MAX(extents[3 + j], vtx.coord[j] + vtx.tolerance);
+ }
+
+ } /* End of loop on face->vertices connectivity */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the length of a segment between two vertices.
+ *
+ * parameters:
+ * v1 <-- cs_join_vertex_t structure for the first vertex of the segment
+ * v2 <-- cs_join_vertex_t structure for the second vertex of the segment
+ *
+ * returns:
+ * length of the segment
+ *---------------------------------------------------------------------------*/
+
+inline static cs_real_t
+_compute_length(cs_join_vertex_t v1,
+ cs_join_vertex_t v2)
+{
+ cs_int_t k;
+ cs_real_t len = 0.0, d2 = 0.0;
+
+ for (k = 0; k < 3; k++) {
+ cs_real_t d = v1.coord[k] - v2.coord[k];
+ d2 += d * d;
+ }
+ len = sqrt(d2);
+
+ return len;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute a new cs_join_vertex_t structure.
+ *
+ * parameters:
+ * curv_abs <-- curvilinear abscissa of the intersection
+ * gnum <-- global number associated to the new
+ * cs_join_vertex_t structure
+ * vtx_couple <-- couple of vertex numbers defining the current edge
+ * work <-- local cs_join_mesh_t structure
+ *
+ * returns:
+ * a new cs_join_vertex_t structure
+ *---------------------------------------------------------------------------*/
+
+static cs_join_vertex_t
+_get_new_vertex(float curv_abs,
+ fvm_gnum_t gnum,
+ const cs_int_t *vtx_couple,
+ const cs_join_mesh_t *work)
+{
+ cs_int_t k;
+ cs_join_vertex_t new_vtx_data;
+
+ cs_join_vertex_t v1 = work->vertices[vtx_couple[0]-1];
+ cs_join_vertex_t v2 = work->vertices[vtx_couple[1]-1];
+
+ assert(curv_abs >= 0.0);
+ assert(curv_abs <= 1.0);
+
+ /* New global number */
+
+ new_vtx_data.gnum = gnum;
+
+ /* New tolerance */
+
+ new_vtx_data.tolerance = (1-curv_abs)*v1.tolerance + curv_abs*v2.tolerance;
+
+ /* New coordinates */
+
+ for (k = 0; k < 3; k++)
+ new_vtx_data.coord[k] = (1-curv_abs)*v1.coord[k] + curv_abs*v2.coord[k];
+
+ return new_vtx_data;
+}
+
+/*----------------------------------------------------------------------------
+ * Check the coherency of an equivalence. Return true if vertices are each
+ * other under their tolerance.
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure
+ * mesh <-- cs_join_mesh_t structure associated
+ * e1_id <-- first edge implied in the equivalence
+ * curv_abs1 <-- curvilinear abscissa of the intersection on edge 1
+ * e2_id <-- second edge implied in the equivalence
+ * curv_abs2 <-- curvilinear abscissa of the intersection on edge 2
+ * verbosity <-- level of accuracy in information display
+ *
+ * returns:
+ * true if the check is ok, false otherwise
+ *---------------------------------------------------------------------------*/
+
+static cs_bool_t
+_check_equiv(const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh,
+ cs_int_t e1_id,
+ float curv_abs1,
+ cs_int_t e2_id,
+ float curv_abs2,
+ int verbosity)
+{
+ cs_join_vertex_t p1 = _get_new_vertex(curv_abs1, 1,
+ &(edges->def[2*e1_id]), mesh);
+ cs_join_vertex_t p2 = _get_new_vertex(curv_abs2, 2,
+ &(edges->def[2*e2_id]), mesh);
+ cs_real_t d12 = _compute_length(p1, p2);
+
+ if (p1.tolerance < d12 || p2.tolerance < d12) {
+
+ cs_int_t v1e1_id = edges->def[2*e1_id]-1;
+ cs_int_t v2e1_id = edges->def[2*e1_id+1]-1;
+ cs_int_t v1e2_id = edges->def[2*e2_id]-1;
+ cs_int_t v2e2_id = edges->def[2*e2_id+1]-1;
+
+ _n_inter_tolerance_warnings++;
+
+ if (verbosity > 2)
+ bft_printf(_("\n"
+ " Edge - Edge intersection warning between:\n"
+ " edge 1: %d (%u) [%d (%u), %d (%u)]\n"
+ " edge 2: %d (%u) [%d (%u), %d (%u)]\n"
+ " Intersection found for curv. abs. %f (e1) - %f (e2)"
+ " will be ignored.\n"),
+ e1_id+1, edges->gnum[e1_id],
+ v1e1_id+1, mesh->vertices[v1e1_id].gnum,
+ v2e1_id+1, mesh->vertices[v2e1_id].gnum,
+ e2_id+1, edges->gnum[e2_id],
+ v1e2_id+1, mesh->vertices[v1e2_id].gnum,
+ v2e2_id+1, mesh->vertices[v2e2_id].gnum,
+ curv_abs1, curv_abs2);
+
+ if (p1.tolerance < d12 && verbosity > 3)
+ bft_printf(_(" Failure for edge 1: "
+ " Distance [v_inter1, v_inter2]: %e > v_inter1.tol: %e\n"),
+ d12, p1.tolerance);
+ if (p2.tolerance < d12 && verbosity > 3)
+ bft_printf(_(" Failure for edge 2: "
+ " Distance [v_inter1, v_inter2]: %e > v_inter2.tol: %e\n"),
+ d12, p1.tolerance);
+
+ return false;
+ }
+ else
+ return true;
+}
+
+/*----------------------------------------------------------------------------
+ * Add new equivalences between vertices in cs_join_eset_t structure.
+ *
+ * parameters:
+ * e1_id <-- data relative to edge E1
+ * e2_id <-- data relative to edge E2
+ * abs_e1 <-- curvilinear abscissa of intersection for edge E1
+ * abs_e2 <-- curvilinear abscissa of intersection for edge E2
+ * edges <-- list of edges
+ * vtx_equiv <-> pointer to a structure dealing with vertex equivalences
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_trivial_equiv(cs_int_t e1_id,
+ cs_int_t e2_id,
+ double abs_e1,
+ double abs_e2,
+ const cs_join_edges_t *edges,
+ cs_join_eset_t *vtx_equiv)
+{
+ cs_int_t v1_num, v2_num;
+
+ cs_int_t equiv_id = vtx_equiv->n_equiv;
+
+ cs_join_eset_check_size(equiv_id, &vtx_equiv);
+
+ assert(abs_e1 <= 0.0 || abs_e1 >= 1.0);
+ assert(abs_e2 <= 0.0 || abs_e2 >= 1.0);
+
+ /* abs_ei is either 0 or 1, but we avoid exact floating-point comparisons */
+
+ if (abs_e1 < 0.5)
+ v1_num = edges->def[2*e1_id];
+ else
+ v1_num = edges->def[2*e1_id+1];
+
+ if (abs_e2 < 0.5)
+ v2_num = edges->def[2*e2_id];
+ else
+ v2_num = edges->def[2*e2_id+1];
+
+ if (v1_num < v2_num) {
+ vtx_equiv->equiv_couple[2*equiv_id] = v1_num;
+ vtx_equiv->equiv_couple[2*equiv_id+1] = v2_num;
+ }
+ else {
+ vtx_equiv->equiv_couple[2*equiv_id] = v2_num;
+ vtx_equiv->equiv_couple[2*equiv_id+1] = v1_num;
+ }
+
+ vtx_equiv->n_equiv += 1;
+}
+
+/*----------------------------------------------------------------------------
+ * Add a no trivial intersection in a cs_join_inter_set_t structure.
+ *
+ * parameters:
+ * e1_id <-- data relative to edge E1
+ * e2_id <-- data relative to edge E2
+ * abs_e1 <-- curvilinear abscissa of intersection(s) for edge E1
+ * abs_e2 <-- curvilinear abscissa of intersection(s) for edge E2
+ * inter_set <-> pointer to the structure maintaining data about edge-edge
+ * intersections
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_inter(cs_int_t e1_id,
+ cs_int_t e2_id,
+ double abs_e1,
+ double abs_e2,
+ cs_join_inter_set_t *inter_set)
+{
+ cs_join_inter_t new_inter_e1, new_inter_e2;
+
+ cs_int_t inter_id = inter_set->n_inter;
+
+ if (inter_id + 1 > inter_set->n_max_inter) {
+
+ inter_set->n_max_inter *= 2;
+
+ BFT_REALLOC(inter_set->inter_lst,
+ 2*inter_set->n_max_inter,
+ cs_join_inter_t);
+
+ }
+
+ new_inter_e1.edge_id = e1_id;
+ new_inter_e1.vtx_id = -1;
+ new_inter_e1.curv_abs = abs_e1;
+
+ new_inter_e2.edge_id = e2_id;
+ new_inter_e2.vtx_id = -1;
+ new_inter_e2.curv_abs = abs_e2;
+
+ if (e1_id < e2_id) {
+ inter_set->inter_lst[2*inter_id] = new_inter_e1;
+ inter_set->inter_lst[2*inter_id+1] = new_inter_e2;
+ }
+ else {
+ inter_set->inter_lst[2*inter_id] = new_inter_e2;
+ inter_set->inter_lst[2*inter_id+1] = new_inter_e1;
+ }
+
+ inter_set->n_inter += 1;
+}
+
+/*----------------------------------------------------------------------------
+ * Get 3D intersection location(s) between two edges in curvilinear abscissa.
+ *
+ * We successively try to find vertices-vertices matching,
+ * vertex-vertex matching,
+ * a "real" intersection.
+ *
+ * Each vertex owns a tolerance which drives to a sphere in which intersection
+ * is possible.
+ * When an intersection is found, we store the related curvilinear abscissa
+ * for each edge.
+ * If curvilinear abscissa : 0 => -0.01 / 1 => 1.01 in order to test an
+ * inequality rather than an equality.
+ *
+ * Let be two edges E1 (P1E1, P2E1) and E2 (P1E2, P2E2) :
+ * a point on edge E1 is defined by :
+ * P1E1 + s * (P2E1 - P1E1) with 0 <= s <= 1
+ * a point on edge B is defined by :
+ * P1E2 + t * (P2E2 - P1E2) with 0 <= t <= 1
+ *
+ * The squared distance between a point from A and a point from B is :
+ * len(s, t) = || P1E2 - P1E1 + t * (P2E2 - P1E1) - s * (P2E1 - P1E1) ||^2
+ * equivalent to :
+ * len(s, t) = a.s^2 + 2b.s.t + c.t^2 + 2d.s + 2e.t + f = d2_e1e2(s,t)
+ *
+ * We try to find (s, t) such as len(s,t) is minimal
+ * with 0 <= s <= 1 and 0 <= t <= 1
+ *
+ * -> ->
+ * a = v0 . v0 ->
+ * v0
+ * -> -> P1E1 x--------------> P2E1
+ * b = - v0 . v1 \
+ * \ P2E2
+ * -> -> \ ^
+ * c = v1 . v1 \ /
+ * -> \ /
+ * -> -> v2 \ / ->
+ * d = - v0 . v2 \ / v1
+ * \ /
+ * -> -> \ /
+ * e = v1 . v2 x
+ * P1E2
+ *
+ * ->
+ * v0 = vector (P1E1, P2E1)
+ * ->
+ * v1 = vector (P1E2, P2E2)
+ * ->
+ * v2 = vector (P1E1, P1E2)
+ *
+ * parameters:
+ * mesh <-- pointer to joining mesh
+ * edges <-- pointer to edges
+ * p1e1 <-- pointer to the associated P1E1 cs_join_vertex_t structure
+ * p2e1 <-- pointer to the associated P2E1 cs_join_vertex_t structure
+ * p1e2 <-- pointer to the associated P1E2 cs_join_vertex_t structure
+ * p2e2 <-- pointer to the associated P2E2 cs_join_vertex_t structure
+ * fraction <-- global tolerance for geometrical intersection.
+ * abs_e1 <-- intersection location on E1 (curvilinear abscissa)
+ * abs_e2 <-- intersection location on E2 (curvilinear abscissa)
+ * n_inter <-> number of intersections detected.
+ *---------------------------------------------------------------------------*/
+
+static void
+_edge_edge_3d_inter(const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ double fraction,
+ cs_int_t e1_id,
+ double abs_e1[2],
+ cs_int_t e2_id,
+ double abs_e2[2],
+ int verbosity,
+ int *n_inter)
+{
+ int k;
+ double a, b, c, d, e, f, s, t;
+ double d2_limit_e1, d_limit_e1, d2_limit_e2, d_limit_e2, d2_e1e2;
+ cs_real_t v0[3], v1[3], v2[3];
+
+ cs_bool_t int_p1e2 = false, int_p2e2 = false;
+
+ cs_int_t p1e1_id = edges->def[2*e1_id] - 1;
+ cs_int_t p2e1_id = edges->def[2*e1_id+1] - 1;
+ cs_int_t p1e2_id = edges->def[2*e2_id] - 1;
+ cs_int_t p2e2_id = edges->def[2*e2_id+1] - 1;
+
+ const cs_join_vertex_t p1e1 = mesh->vertices[p1e1_id];
+ const cs_join_vertex_t p2e1 = mesh->vertices[p2e1_id];
+ const cs_join_vertex_t p1e2 = mesh->vertices[p1e2_id];
+ const cs_join_vertex_t p2e2 = mesh->vertices[p2e2_id];
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ cs_bool_t tst_dbg = (verbosity > 5 &&
+ (p1e1.gnum == 716852 || p2e1.gnum == 716852 ||
+ p1e2.gnum == 716852 || p2e2.gnum == 716852) ?
+ true : false);
+#endif
+
+ /* Initialize parameters */
+
+ *n_inter = 0 ;
+
+ assert(p1e1.gnum != p2e1.gnum);
+ assert(p1e2.gnum != p2e2.gnum);
+
+ if (p1e1.gnum == p1e2.gnum || p2e1.gnum == p2e2.gnum)
+ return;
+
+ if (p1e1.gnum == p2e2.gnum || p2e1.gnum == p1e2.gnum)
+ return;
+
+ /* Compute local vectors and parameters */
+
+ for (k = 0; k < 3; k++) {
+ v0[k] = p2e1.coord[k] - p1e1.coord[k];
+ v1[k] = p2e2.coord[k] - p1e2.coord[k];
+ v2[k] = p1e2.coord[k] - p1e1.coord[k];
+ }
+
+ a = _dot_product(v0, v0);
+ b = - _dot_product(v0, v1);
+ c = _dot_product(v1, v1);
+ d = - _dot_product(v0, v2);
+ e = _dot_product(v1, v2);
+ f = _dot_product(v2, v2);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg) {
+ bft_printf("\n\np1e1 : %10u - [%12.6e %12.6e %12.6e] - tol: %12.6g\n",
+ p1e1.gnum, p1e1.coord[0], p1e1.coord[1], p1e1.coord[2], p1e1.tolerance);
+ bft_printf("p2e1 : %10u - [%12.6e %12.6e %12.6e] - tol: %12.6g\n",
+ p2e1.gnum, p2e1.coord[0], p2e1.coord[1], p2e1.coord[2], p2e1.tolerance);
+ bft_printf("p1e2 : %10u - [%12.6e %12.6e %12.6e] - tol: %12.6g\n",
+ p1e2.gnum, p1e2.coord[0], p1e2.coord[1], p1e2.coord[2], p1e2.tolerance);
+ bft_printf("p2e2 : %10u - [%12.6e %12.6e %12.6e] - tol: %12.6g\n\n",
+ p2e2.gnum, p2e2.coord[0], p2e2.coord[1], p2e2.coord[2], p2e2.tolerance);
+ bft_printf("v0 : [ %12.6e %12.6e %12.6e]\n", v0[0], v0[1], v0[2]);
+ bft_printf("v1 : [ %12.6e %12.6e %12.6e]\n", v1[0], v1[1], v1[2]);
+ bft_printf("v2 : [ %12.6e %12.6e %12.6e]\n\n", v2[0], v2[1], v2[2]);
+ bft_printf("a : %12.6e, b : %12.6e, c : %12.6e\n", a, b, c);
+ bft_printf("d : %12.6e, e : %12.6e, f : %12.6e\n", d, e, f);
+ }
+#endif
+
+ /* Check size of each edge is not equal to 0 */
+
+ assert(a > 0);
+ assert(c > 0);
+
+ /* Check computation of the tolerance */
+
+ assert(sqrt(a) * fraction * 1.00001 >= p1e1.tolerance);
+ assert(sqrt(a) * fraction * 1.00001 >= p2e1.tolerance);
+ assert(sqrt(c) * fraction * 1.00001 >= p1e2.tolerance);
+ assert(sqrt(c) * fraction * 1.00001 >= p2e2.tolerance);
+
+ /*-----------------------------------------------------------------
+ * First part : we try to find under the current tolerance if
+ * "parallel edges", "extremity-extremity" or "extremity-interior"
+ * are possible.
+ *-----------------------------------------------------------------*/
+
+ /* Distance between P1E1 (s = 0) and a point on E2 */
+ /* ----------------------------------------------- */
+
+ t = -e / c; /* Nearest point on E2 if s = 0 => t = -e/c */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" [I] Test inter. P1E1 - E2: t = %12.6e\n", t);
+#endif
+
+ if (t > -fraction && t < 1.0 + fraction) { /* filter */
+
+ d2_e1e2 = t*(c*t + 2.0*e) + f;
+ assert(d2_e1e2 >= -1.e-8);
+
+ /* Tolerance for vertex p1e1 (s = 0) */
+
+ d2_limit_e1 = p1e1.tolerance * p1e1.tolerance;
+
+ if (d2_e1e2 <= d2_limit_e1) { /* Under the tolerance for vertex P1E1 */
+
+ /* Tolerance for a vertex on E2 located at "t" */
+
+ d_limit_e2 = (1-t)*p1e2.tolerance + t*p2e2.tolerance;
+ d2_limit_e2 = d_limit_e2 * d_limit_e2;
+
+ if (d2_e1e2 <= d2_limit_e2) {
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[I]-3: Under tol. for P1E1 and a point of E2\n"
+ "\td2_e1e2 = %12.6e, d2_lim_e1: %12.6e, d2_lim_e2: %12.6e\n",
+ d2_e1e2, d2_limit_e1, d2_limit_e2);
+#endif
+
+ /* We are under tolerance for edge E2. We try to find if it is
+ a vertex-vertex intersection */
+
+ if (t < 0.0) { /* Test intersection P1E1-P1E2 */
+
+ d2_e1e2 = f; /* s = t = 0.0 */
+ d2_limit_e2 = p1e2.tolerance * p1e2.tolerance;
+
+ if (d2_e1e2 <= d2_limit_e1 && d2_e1e2 <= d2_limit_e2) {
+
+ if (_check_equiv(edges, mesh, e1_id, 0.0, e2_id, 0.0, verbosity)) {
+
+ /* "extremity-extremity" intersection with s = t = 0.0
+ under the tolerance is possible */
+
+ int_p1e2 = true;
+ abs_e1[*n_inter] = 0.0;
+ abs_e2[*n_inter] = 0.0;
+
+ *n_inter += 1;
+ assert(*n_inter == 1);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[I]-4: Add inter. Vtx-Vtx (0.00, 0.00)\n");
+#endif
+ }
+ }
+ }
+ else if (t > 1.0) { /* Test intersection P1E1-P2E2 */
+
+ d2_e1e2 = c + 2.0*e + f; /* s = 0.0 and t = 1.0 */
+ d2_limit_e2 = p2e2.tolerance * p2e2.tolerance;
+
+ if (d2_e1e2 <= d2_limit_e1 && d2_e1e2 <= d2_limit_e2) {
+
+ if (_check_equiv(edges, mesh, e1_id, 0.0, e2_id, 1.0, verbosity)) {
+
+ /* "extremity-extremity" intersection with s = 0.0, t = 1.0
+ under the tolerance is possible */
+
+ int_p2e2 = true;
+ abs_e1[*n_inter] = 0.0;
+ abs_e2[*n_inter] = 1.0;
+
+ *n_inter += 1;
+ assert(*n_inter == 1);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[I]-5: Add inter. Vtx-Vtx (0.00, 1.00)\n");
+#endif
+
+ }
+ }
+ }
+ else {
+
+ assert(0.0 <= t && t <= 1.0);
+
+ /* It's an "extremity-interior" intersection */
+
+ abs_e1[*n_inter] = 0.00;
+ abs_e2[*n_inter] = t;
+
+ if (abs_e2[*n_inter] <= 0.0)
+ int_p1e2 = true;
+ if (abs_e2[*n_inter] >= 1.0)
+ int_p2e2 = true;
+
+ *n_inter += 1;
+ assert(*n_inter == 1);
+
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[I]-6: Add inter. Vtx-Edge (0.00, %12.6e)\n", t);
+#endif
+
+ }
+
+ } /* End if d2_e1e2 <= d2_limit_e2 */
+
+ } /* End if d2_e1e2 <= d2_limit_e1 */
+
+ } /* End if -fraction < t < 1 + fraction */
+
+ /* Distance between P2E1 (s = 1) and a point on edge E2 */
+ /* ---------------------------------------------------- */
+
+ t = -(b + e) / c; /* Minimum for d2_e1e2 is reached for t = -(b+e) / c
+ when s = 1. */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" [II] Test inter. P2E1 - E2: t = %12.6e\n", t);
+#endif
+
+ if (t > -fraction && t < 1.0 + fraction) { /* filter */
+
+ d2_e1e2 = CS_ABS((a + 2.0*(b*t + d)) + t*(c*t + 2.0*e) + f);
+
+ assert(d2_e1e2 >= -1.e-8);
+
+ /* Tolerance for vertex p2e1 (s = 1) */
+
+ d2_limit_e1 = p2e1.tolerance * p2e1.tolerance;
+
+ if (d2_e1e2 <= d2_limit_e1) { /* Under the tolerance for vertex P2E1 */
+
+ d_limit_e2 = (1.0-t)*p1e2.tolerance + t*p2e2.tolerance;
+ d2_limit_e2 = d_limit_e2 * d_limit_e2;
+
+ if (d2_e1e2 <= d2_limit_e2) { /* Under tolerance for edge 2 */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[II]-3: Under tol. for P2E1 and a point of E2\n"
+ "\td2_e1e2 = %12.6e, d2_lim_e1: %12.6e, d2_lim_e2: %12.6e\n",
+ d2_e1e2, d2_limit_e1, d2_limit_e2);
+#endif
+
+ /* We are under tolerance for edge E2. We try to find if it is
+ a vertex-vertex intersection */
+
+ if (t < 0.0) { /* Test intersection P2E1-P1E2 */
+
+ d2_e1e2 = CS_ABS(a + 2.0*d + f);
+ d2_limit_e2 = p1e2.tolerance * p1e2.tolerance;
+
+ if (d2_e1e2 <= d2_limit_e1 && d2_e1e2 <= d2_limit_e2) {
+
+ if (_check_equiv(edges, mesh, e1_id, 1.0, e2_id, 0.0, verbosity)) {
+
+ /* "extremity-extremity" intersection with s = 1.0, t = 0.0
+ under the tolerance is possible */
+
+ int_p1e2 = true;
+ abs_e1[*n_inter] = 1.0;
+ abs_e2[*n_inter] = 0.0;
+
+ *n_inter += 1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[II]-4: Add inter. Vtx-Vtx (1.00, 0.00)\n");
+#endif
+
+ }
+ }
+ }
+ else if (t > 1.0) { /* Test intersection P2E1-P2E2 */
+
+ d2_e1e2 = CS_ABS(a + 2.0*(b + d + e) + c + f);
+ d2_limit_e2 = p2e2.tolerance * p2e2.tolerance;
+
+ if (d2_e1e2 <= d2_limit_e1 && d2_e1e2 <= d2_limit_e2) {
+
+ if (_check_equiv(edges, mesh, e1_id, 1.0, e2_id, 1.0, verbosity)) {
+
+ /* "extremity-extremity" intersection with s = t = 1.0
+ under the tolerance is possible */
+
+ int_p2e2 = true;
+ abs_e1[*n_inter] = 1.00;
+ abs_e2[*n_inter] = 1.00;
+
+ *n_inter += 1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[II]-5: Add inter. Vtx-Vtx (1.00, 1.00)\n");
+#endif
+
+ }
+ }
+ }
+ else {
+
+ assert(0.0 <= t && t <= 1.0);
+
+ /* It's an "extremity-interior" intersection */
+
+ abs_e1[*n_inter] = 1.00;
+ abs_e2[*n_inter] = t;
+
+ if (abs_e2[*n_inter] <= 0.0)
+ int_p1e2 = true;
+ if (abs_e2[*n_inter] >= 1.0)
+ int_p2e2 = true;
+
+ *n_inter += 1;
+ assert(*n_inter <= 2);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[II]-6: Add inter. Vtx-Edge (1.00, %12.6e)\n", t);
+#endif
+ }
+
+ } /* End if d2_e1e2 <= d2_limit_e2 */
+
+ } /* End if d2_e1e2 <= d2_limit_e1 */
+
+ } /* End if -fraction < t < 1 + fraction */
+
+ /* If two intersections are already detected, we stop here */
+
+ if (*n_inter == 2)
+ return;
+
+ /* If vertices from edge E2 are not implied in an intersection
+ we do a test for each vertex */
+
+ if (int_p1e2 == false) {
+
+ /* Distance between P1E2 (t = 0.0) on edge E2 and a point on edge E1 */
+ /* ----------------------------------------------------------------- */
+
+ s = -d / a; /* t = 0.0 */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" [III] Test inter. P1E2 - E1: s = %12.6e\n", s);
+#endif
+
+ if (s > 0.0 && s < 1.0) { /* s = 0.0 and s = 1.0 are already tested */
+
+ d2_e1e2 = CS_ABS(s*(a*s + 2.0*d) + f);
+ d2_limit_e2 = p1e2.tolerance * p1e2.tolerance;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t [III-1a] d2_e1e2: %12.6e - d2_lim_e2: %12.6e\n",
+ d2_e1e2, d2_limit_e2);
+#endif
+
+ if (d2_e1e2 <= d2_limit_e2) { /* Under the tolerance for vertex P1E2 */
+
+ d_limit_e1 = (1.0-s)*p1e1.tolerance + s*p2e1.tolerance;
+ d2_limit_e1 = d_limit_e1 * d_limit_e1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t [IV-1b] d2_e1e2: %12.6e - d2_lim_e1: %12.6e\n",
+ d2_e1e2, d2_limit_e1);
+#endif
+
+ if (d2_e1e2 <= d2_limit_e1) {
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[III]-2: Under tol. for P1E2 and a point of E1\n"
+ "\t d2_e1e2 = %12.6e, d2_lim_e1: %12.6e, d2_lim_e2: %12.6e\n",
+ d2_e1e2, d2_limit_e1, d2_limit_e2);
+#endif
+
+ /* We are under tolerance for edge E1. There is an intersection
+ between P1E2 and a point on edge E1 */
+
+ abs_e1[*n_inter] = s;
+ abs_e2[*n_inter] = 0.0;
+
+ *n_inter += 1;
+ assert(*n_inter <= 2);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[III]-3: Add inter. Edge-Vtx (%12.6e, 0.00)\n", s);
+#endif
+
+ if (*n_inter == 2)
+ return;
+
+ } /* End if d2_e1e2 < d2_limit_e1 */
+
+ } /* End if d2_e1e2 < d2_limit_e2 */
+
+ } /* 0.0 < s < 1.0 */
+
+ } /* If int_p1e2 == false */
+
+ if (int_p2e2 == false) {
+
+ /* Distance between P2E2 (t = 1.0) on edge E2 and a point on edge E1 */
+ /* ----------------------------------------------------------------- */
+
+ s = -(b + d) / a; /* t = 1 */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" [IV] Test inter. P2E2 - E1: s = %12.6e\n", s);
+#endif
+
+ if (s > 0.0 && s < 1.0) { /* s = 0.0 and s = 1.0 are already tested */
+
+ d2_e1e2 = CS_ABS(s*(a*s + 2.0*(b + d)) + c + 2.0*e + f);
+ d2_limit_e2 = p2e2.tolerance * p2e2.tolerance;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t [IV-1a] d2_e1e2: %12.6e - d2_lim_e2: %12.6e\n",
+ d2_e1e2, d2_limit_e2);
+#endif
+
+ if (d2_e1e2 <= d2_limit_e2) { /* Under the tolerance for vertex P2E2 */
+
+ d_limit_e1 = (1.0-s)*p1e1.tolerance + s*p2e1.tolerance;
+ d2_limit_e1 = d_limit_e1 * d_limit_e1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t [IV-1b] d2_e1e2: %12.6e - d2_lim_e1: %12.6e\n",
+ d2_e1e2, d2_limit_e1);
+#endif
+
+ if (d2_e1e2 <= d2_limit_e1) {
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[IV]-2: Under tol. for P2E2 and a point of E1\n"
+ "\t d2_e1e2 = %12.6e, d2_lim_e1: %12.6e, d2_lim_e2: %12.6e\n",
+ d2_e1e2, d2_limit_e1, d2_limit_e2);
+#endif
+
+ /* We are under tolerance for edge E1. There is an intersection
+ between P2E2 and a point on edge E1 */
+
+ abs_e1[*n_inter] = s;
+ abs_e2[*n_inter] = 1.0;
+
+ *n_inter += 1;
+ assert(*n_inter <= 2);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[IV]-3: Add inter (%12.6e, 1.01)\n", s);
+#endif
+
+ if (*n_inter == 2)
+ return;
+
+ } /* End if d2_e1e2 < d2_limit_e1 */
+
+ } /* End if d2_e1e2 < d2_limit_e2 */
+
+ } /* 0.0 < s < 1.0 */
+
+ } /* If int_p2e2 == false */
+
+ /* If there is at least one intersection, we stop here. */
+
+ if (*n_inter > 0)
+ return;
+
+ {
+ /*------------------------------------------------------------------
+ * Second part : no intersection has been found ("parallel edges",
+ * "extremity-extremity" or "extremity-interior"). The only
+ * remaining possibility is an intersection with 0 < s < 1 and
+ * 0 < t < 1.
+ *------------------------------------------------------------------*/
+
+ /* Edges are parallel if a.c - b^2 = 0.
+ * However, this term is o(length^4). So, we will prefer work with angle
+ * If two edges are not parallel => a.c - b^2 > 0.
+ *
+ * cos(theta) = v0.v1 / ||v0||.||v1||
+ * cos^2 (theta) = (v0.v1)^2 / ((v0.v0).(v1.v1))^2 = (-b)^2 / (a.c)
+ * sin^2 (theta) = 1 - b^2 / (a.c)
+ *
+ * || v0 ^ v1 ||^2 = ||v0||^2 . ||v1||^2 . sin^2(thetha)
+ *
+ */
+
+ double inv_cross_norm2;
+ double cross_norm2 = CS_ABS(a * c - b * b);
+ double parall_eps2 = 1e-6; /* default value : eps * eps */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" [V]: Test inter. E1 - E2: cross_norm2: %12.6e\n"
+ "\ta = %12.6e, b = %12.6e, c = %12.6e, a*c = %12.6e\n",
+ cross_norm2, a, b, c, a*c);
+#endif
+
+ if (cross_norm2 < parall_eps2 * a * c) /* <=> 1 - b^2/(a.c) < epsilon^2
+ <=> sin^2(theta) < epsilon^2 */
+ return;
+
+ /* Edges are not parallel.
+ Define s and t if there is an intersection on interior points.
+
+ -> -> ->
+ v2 + s.v0 = t.v1 and cross_norm2 = a.c - b^2 != 0.0
+
+ => s = (b.e - c.d)/cross_norm2
+ => t = (e.a - b.d)/cross_norm2
+ */
+
+ s = b * e - c * d;
+ t = b * d - a * e;
+
+ if (s >= 0. && s <= cross_norm2) {
+ if (t >= 0. && t <= cross_norm2) {
+
+ /* If tests are OK, we are on an interior point for E1 and E2 */
+
+ inv_cross_norm2 = 1.0 / cross_norm2;
+ s *= inv_cross_norm2;
+ t *= inv_cross_norm2;
+ d2_e1e2 = CS_ABS(s*(a*s + 2.0*(b*t + d)) + t*(c*t + 2.0*e) + f);
+ d_limit_e1 = (1.0-s) * p1e1.tolerance + s * p2e1.tolerance;
+ d_limit_e2 = (1.0-t) * p1e2.tolerance + t * p2e2.tolerance;
+ d2_limit_e1 = d_limit_e1 * d_limit_e1;
+ d2_limit_e2 = d_limit_e2 * d_limit_e2;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[V]-2: s = %12.6e, t = %12.6e\n"
+ "\t d2_e1e2: %12.6e, d2_limit_e1: %12.6e, "
+ "d2_limit_e2: %12.6e\n",
+ s, t, d2_e1e2, d2_limit_e1, d2_limit_e2);
+#endif
+
+ if (d2_e1e2 <= d2_limit_e1 && d2_e1e2 <= d2_limit_e2) {
+
+ /* Under tolerance for edges E1 and E2 => intersection is possible */
+
+ assert(0.0 <= s && s <= 1.0);
+ assert(0.0 <= t && t <= 1.0);
+
+ abs_e1[*n_inter] = s;
+ abs_e2[*n_inter] = t;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t[V]-3: Add inter. Edge-Edge (%12.6e,%12.6e)\n", s, t);
+#endif
+
+ *n_inter += 1;
+ assert(*n_inter == 1);
+
+ } /* If we are under tolerance */
+
+ } /* If it is an interior point for edge E2 */
+ } /* If it is an interior point for edge E1 */
+
+ } /* End of last test : inter. E1 - E2 */
+
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Create a MPI_Datatype for the exch_inter_t structure.
+ *
+ * returns:
+ * a MPI_Datatype associated to the exch_inter_t structure.
+ *---------------------------------------------------------------------------*/
+
+static MPI_Datatype
+_create_exch_inter_datatype(void)
+{
+ exch_inter_t inter;
+ MPI_Datatype new_type;
+
+ int blocklengths[2] = {1, 1};
+ MPI_Aint displacements[2] = {0 , 0};
+ MPI_Datatype types[2] = {FVM_MPI_GNUM, MPI_FLOAT};
+
+ /* Initialize exch_inter_t */
+
+ inter.vtx_gnum = 1;
+ inter.curv_abs = 0.0;
+
+ /* Define array of displacements */
+
+ MPI_Get_address(&inter, displacements);
+ MPI_Get_address(&inter.curv_abs, displacements + 1);
+
+ displacements[1] -= displacements[0];
+ displacements[0] = 0;
+
+ /* Create new datatype */
+
+ MPI_Type_create_struct(2, blocklengths, displacements, types, &new_type);
+ MPI_Type_commit(&new_type);
+
+ return new_type;
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Check if we have to add the current intersection into the definition
+ * of the reference edge description.
+ *
+ * parameters:
+ * inter <-- intersection to test
+ * ref <-- list of reference edges
+ * edge_id <-- id of the edge to treat
+ * cur_shift <-- shift on edges (current used positions)
+ *
+ * returns:
+ * true if we should add this intersection to the cs_join_edge_inter_t
+ * structure, false otherwise.
+ *---------------------------------------------------------------------------*/
+
+inline static cs_bool_t
+_need_to_add_exch_inter(exch_inter_t inter,
+ const cs_join_inter_edges_t *ref,
+ cs_int_t edge_id,
+ const cs_int_t *cur_shift)
+{
+ cs_int_t i;
+
+ cs_bool_t ret = true;
+
+ for (i = ref->index[edge_id]; i < cur_shift[edge_id]; i++) {
+
+ if (ref->vtx_glst[i] == inter.vtx_gnum) {
+ if (fabs(ref->abs_lst[i] - inter.curv_abs) < 1e-30) {
+ ret = false;
+ break;
+ }
+ }
+
+ } /* End of loop on sub-elements of the current edge */
+
+ return ret;
+}
+
+/*----------------------------------------------------------------------------
+ * Print statistics and timings for face bounding-box intersection search.
+ *
+ * parameters:
+ * face_neighborhood <-- pointer to face neighborhood management structure.
+ * box_wtime <-- bounding box construction wall-clock time
+ * box_wtime <-- bounding box construction CPU time
+ *---------------------------------------------------------------------------*/
+
+static void
+_face_bbox_search_stats(const fvm_neighborhood_t *face_neighborhood,
+ double box_wtime,
+ double box_cpu_time)
+{
+ int i;
+ int dim;
+ int depth[3];
+ fvm_lnum_t _n_leaves[3], _n_boxes[3];
+ fvm_lnum_t _n_threshold_leaves[3], _n_leaf_boxes[3];
+ size_t _mem_final[3], _mem_required[3];
+ unsigned long n_leaves[3], n_boxes[3], n_threshold_leaves[3];
+ int n_leaf_boxes[3];
+ unsigned long mem_final[3], mem_required[3];
+ double build_wtime, build_cpu_time, query_wtime, query_cpu_time;
+
+ dim = fvm_neighborhood_get_box_stats(face_neighborhood,
+ depth,
+ _n_leaves,
+ _n_boxes,
+ _n_threshold_leaves,
+ _n_leaf_boxes,
+ _mem_final,
+ _mem_required);
+
+ /* Convert to unsigned long (so as to ensure correct logging
+ whether fvm_lnum_t is 32 or 64-bit) */
+ for (i = 0; i < 3; i++) {
+ n_leaves[i] = _n_leaves[i];
+ n_boxes[i] = _n_boxes[i];
+ n_threshold_leaves[i] = _n_threshold_leaves[i];
+ n_leaf_boxes[i] = _n_leaf_boxes[i];
+ mem_final[i] = _mem_final[i] / 1024;
+ mem_required[i] = _mem_required[i] /1024;
+ }
+
+ fvm_neighborhood_get_times(face_neighborhood,
+ &build_wtime,
+ &build_cpu_time,
+ &query_wtime,
+ &query_cpu_time);
+
+ bft_printf(_(" Determination of possible face intersections:\n\n"
+ " bounding-box tree layout: %dD\n"), dim);
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1)
+ bft_printf
+ (_(" rank mean"
+ " minimum maximum\n"
+ " depth: %10d | %10d | %10d\n"
+ " number of leaves: %10lu | %10lu | %10lu\n"
+ " number of boxes: %10lu | %10lu | %10lu\n"
+ " leaves over threshold: %10lu | %10lu | %10lu\n"
+ " boxes per leaf: %10d | %10d | %10d\n"
+ " Memory footprint (kb):\n"
+ " final search structure: %10lu | %10lu | %10lu\n"
+ " temporary search structure: %10lu | %10lu | %10lu\n\n"),
+ depth[0], depth[1], depth[2],
+ n_leaves[0], n_leaves[1], n_leaves[2],
+ n_boxes[0], n_boxes[1], n_boxes[2],
+ n_threshold_leaves[0], n_threshold_leaves[1],
+ n_threshold_leaves[2],
+ n_leaf_boxes[0], n_leaf_boxes[1], n_leaf_boxes[2],
+ mem_final[0], mem_final[1], mem_final[2],
+ mem_required[0], mem_required[1], mem_required[2]);
+
+#endif /* defined(HAVE_MPI) */
+
+ if (cs_glob_n_ranks == 1)
+ bft_printf
+ (_(" depth: %10d\n"
+ " number of leaves: %10lu\n"
+ " number of boxes: %10lu\n"
+ " leaves over threshold: %10lu\n"
+ " boxes per leaf: %10d mean [%d min, %d max]\n"
+ " Memory footprint (kb):\n"
+ " final search structure: %10lu\n"
+ " temporary search structure: %10lu\n\n"),
+ depth[0], n_leaves[0], n_boxes[0], n_threshold_leaves[0],
+ n_leaf_boxes[0], n_leaf_boxes[1], n_leaf_boxes[2],
+ mem_final[0], mem_required[0]);
+
+ bft_printf(_(" Associated times: construction query\n"
+ " wall clock time: %10.3g %10.3g\n"),
+ build_wtime + box_wtime, query_wtime);
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ double cpu_min[2], cpu_max[2], cpu_loc[2];
+ cpu_loc[0] = build_cpu_time + box_cpu_time;
+ cpu_loc[1] = query_cpu_time;
+
+ MPI_Allreduce(cpu_loc, cpu_min, 2, MPI_DOUBLE, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(cpu_loc, cpu_max, 2, MPI_DOUBLE, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ bft_printf(_(" Min local CPU time: %10.3g %10.3g\n"
+ " Max local CPU time: %10.3g %10.3g\n"),
+ cpu_min[0], cpu_min[1], cpu_max[0], cpu_max[1]);
+ }
+
+#endif
+
+ if (cs_glob_n_ranks == 1)
+ bft_printf(_(" CPU time: %10.3g %10.3g\n"),
+ build_cpu_time + box_cpu_time, query_cpu_time);
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a new cs_join_inter_set_t structure.
+ *
+ * parameters:
+ * init_size <-- number of init. cs_join_inter_t structure to allocate
+ *
+ * returns:
+ * a pointer to a new inter_set_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_set_t *
+cs_join_inter_set_create(cs_int_t init_size)
+{
+ cs_join_inter_set_t *new_set = NULL;
+
+ BFT_MALLOC(new_set, 1, cs_join_inter_set_t);
+
+ new_set->n_max_inter = init_size; /* default value */
+ new_set->n_inter = 0;
+
+ BFT_MALLOC(new_set->inter_lst, 2*new_set->n_max_inter, cs_join_inter_t);
+
+ return new_set;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_inter_set_t structure.
+ *
+ * parameter:
+ * inter_set <-- a pointer to the inter_set_t structure to destroy
+ *
+ * returns:
+ * a NULL pointer.
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_set_t *
+cs_join_inter_set_destroy(cs_join_inter_set_t *inter_set)
+{
+ if (inter_set == NULL)
+ return inter_set;
+
+ BFT_FREE(inter_set->inter_lst);
+ BFT_FREE(inter_set);
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_inter_set_t structure.
+ *
+ * parameters:
+ * i_set <-- cs_join_inter_set_t structure to dump
+ * edges <-- associated cs_join_edge_t structure
+ * mesh <-- associated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_inter_set_dump(const cs_join_inter_set_t *i_set,
+ const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh)
+{
+ int i;
+
+ bft_printf("\n Dump an inter_set_t structure (%p)\n", i_set);
+
+ bft_printf(" n_max_inter: %10d\n", i_set->n_max_inter);
+ bft_printf(" n_inter : %10d\n\n", i_set->n_inter);
+
+ for (i = 0; i < i_set->n_inter; i++) {
+
+ cs_join_inter_t inter1 = i_set->inter_lst[2*i];
+ cs_join_inter_t inter2 = i_set->inter_lst[2*i+1];
+ cs_int_t v1e1_id = edges->def[2*inter1.edge_id] - 1;
+ cs_int_t v2e1_id = edges->def[2*inter1.edge_id+1] - 1;
+ cs_int_t v1e2_id = edges->def[2*inter2.edge_id] - 1;
+ cs_int_t v2e2_id = edges->def[2*inter2.edge_id+1] - 1;
+ fvm_gnum_t v1e1 = (mesh->vertices[v1e1_id]).gnum;
+ fvm_gnum_t v2e1 = (mesh->vertices[v2e1_id]).gnum;
+ fvm_gnum_t v1e2 = (mesh->vertices[v1e2_id]).gnum;
+ fvm_gnum_t v2e2 = (mesh->vertices[v2e2_id]).gnum;
+
+ bft_printf("\n%5d - (%9u - %9d)\n",
+ i, edges->gnum[inter1.edge_id], edges->gnum[inter2.edge_id]);
+ bft_printf("E1 [%5u %5u] (%6.3f)\n", v1e1, v2e1, inter1.curv_abs);
+ bft_printf("E2 [%5u %5u] (%6.3f)\n", v1e2, v2e2, inter2.curv_abs);
+
+ } /* End of loop on edge intersections */
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Allocate and initialize a new cs_join_inter_edges_t structure.
+ *
+ * parameters:
+ * n_edges <-- number of edges
+ *
+ * returns:
+ * a pointer to the created cs_join_inter_edges_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_create(cs_int_t n_edges)
+{
+ cs_int_t i;
+
+ cs_join_inter_edges_t *inter_edges = NULL;
+
+ if (n_edges == 0)
+ return NULL;
+
+ /* Allocate and initialize structure */
+
+ BFT_MALLOC(inter_edges, 1, cs_join_inter_edges_t);
+
+ inter_edges->n_edges = n_edges;
+
+ /* Build inter_edges_idx */
+
+ BFT_MALLOC(inter_edges->index, n_edges + 1, cs_int_t);
+
+ for (i = 0; i < n_edges + 1; i++)
+ inter_edges->index[i] = 0;
+
+ BFT_MALLOC(inter_edges->edge_gnum, n_edges, fvm_gnum_t);
+
+ for (i = 0; i < n_edges; i++)
+ inter_edges->edge_gnum[i] = 0;
+
+ inter_edges->max_sub_size = 0;
+
+ inter_edges->vtx_lst = NULL;
+ inter_edges->vtx_glst = NULL;
+ inter_edges->abs_lst = NULL;
+
+ return inter_edges;
+}
+
+/*----------------------------------------------------------------------------
+ * Build a cs_join_inter_edges_t structure (useful to find equivalence on
+ * edges and to apply vertex merge to a cs_join_mesh_t structure).
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure
+ * inter_set <-- structure storing data on edge intersections
+ *
+ * returns:
+ * a pointer to the created cs_join_inter_edges_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_define(const cs_join_edges_t *edges,
+ const cs_join_inter_set_t *inter_set)
+{
+ cs_int_t i, lst_size, n_edge_inter;
+
+ cs_int_t max_n_sub_inter = 0;
+ cs_int_t *counter = NULL;
+ cs_join_inter_edges_t *inter_edges = NULL;
+
+ /* Sanity checks */
+
+ assert(edges != NULL);
+ assert(inter_set != NULL);
+
+ /* Allocate and initialize structure */
+
+ inter_edges = cs_join_inter_edges_create(edges->n_edges);
+
+ for (i = 0; i < edges->n_edges; i++)
+ inter_edges->edge_gnum[i] = edges->gnum[i];
+
+ n_edge_inter = 2*inter_set->n_inter;
+
+ if (n_edge_inter == 0)
+ return inter_edges;
+
+ for (i = 0; i < n_edge_inter; i++) {
+
+ cs_join_inter_t inter = inter_set->inter_lst[i];
+ cs_int_t edge_id = inter.edge_id;
+
+ assert(edge_id < edges->n_edges);
+
+ if (inter.curv_abs > 0.0 && inter.curv_abs < 1.0)
+ inter_edges->index[edge_id+1] += 1;
+
+ }
+
+ for (i = 0; i < edges->n_edges; i++) {
+
+ cs_int_t n_sub_inter = inter_edges->index[i+1];
+
+ max_n_sub_inter = CS_MAX(max_n_sub_inter, n_sub_inter);
+ inter_edges->index[i+1] += inter_edges->index[i];
+
+ }
+
+ inter_edges->max_sub_size = max_n_sub_inter;
+ lst_size = inter_edges->index[edges->n_edges];
+
+ /* Fill structures */
+
+ BFT_MALLOC(inter_edges->vtx_lst, lst_size, cs_int_t);
+ BFT_MALLOC(inter_edges->abs_lst, lst_size, float);
+
+ BFT_MALLOC(counter, edges->n_edges, cs_int_t);
+
+ for (i = 0; i < edges->n_edges; i++)
+ counter[i] = 0;
+
+ for (i = 0; i < n_edge_inter; i++) {
+
+ cs_join_inter_t inter = inter_set->inter_lst[i];
+ cs_int_t edge_id = inter.edge_id;
+
+ if (inter.curv_abs > 0.0 && inter.curv_abs < 1.0) {
+
+ cs_int_t shift = inter_edges->index[edge_id] + counter[edge_id];
+
+ inter_edges->vtx_lst[shift] = inter.vtx_id+1;
+ inter_edges->abs_lst[shift] = inter.curv_abs;
+ counter[edge_id] += 1;
+
+ }
+
+ } /* End of loop on intersections */
+
+ /* Order lists */
+
+ for (i = 0; i < edges->n_edges; i++) {
+
+ cs_int_t start = inter_edges->index[i];
+ cs_int_t end = inter_edges->index[i+1];
+
+ if (end - start > 1)
+ _adapted_lshellsort(start,
+ end,
+ inter_edges->abs_lst,
+ inter_edges->vtx_lst);
+
+ } /* End of loop on edges */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Sanity check */
+
+ for (i = 0; i < edges->n_edges; i++) {
+
+ cs_int_t j;
+ cs_int_t start = inter_edges->index[i];
+ cs_int_t end = inter_edges->index[i+1];
+
+ if (end - start > 0) {
+
+ assert(inter_edges->abs_lst[start] < 1.0);
+ assert(inter_edges->abs_lst[start] > 0.0);
+
+ for (j = start; j < end - 1; j++) {
+
+ assert(inter_edges->abs_lst[j+1] < 1.0);
+ assert(inter_edges->abs_lst[j+1] > 0.0);
+
+ if (inter_edges->abs_lst[j] > inter_edges->abs_lst[j+1])
+ bft_error(__FILE__, __LINE__, 0,
+ _("\n Incoherency found in inter_edges structure for"
+ " edge %d (%u):\n"
+ " Bad ordering of curvilinear abscissa.\n"
+ " Vertex %d (%u) of abscissa: %f is before vertex %d"
+ " (%u) of abscissa: %f\n"),
+ i+1, edges->gnum[i], inter_edges->vtx_lst[j],
+ inter_edges->abs_lst[j], inter_edges->vtx_lst[j+1],
+ inter_edges->abs_lst[j+1]);
+
+ if (inter_edges->vtx_lst[j] == inter_edges->vtx_lst[j+1])
+ bft_error(__FILE__, __LINE__, 0,
+ _("\n Incoherency found in inter_edges structure.\n"
+ " Redundancy for edge %d (%u) :\n"
+ " v1_num : %d\n"
+ " v2_num : %d\n"
+ " Vertex %d appears twice.\n"), i+1, edges->gnum[i],
+ edges->def[2*i], edges->def[2*i+1],
+ inter_edges->vtx_lst[j]);
+
+ }
+
+ } /* n_sub_inter > 1 */
+
+ } /* End of loop on edges */
+#endif
+
+ /* Free memory */
+
+ BFT_FREE(counter);
+
+ /* Return pointer */
+
+ return inter_edges;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy an cs_join_inter_edges_t structure.
+ *
+ * parameters:
+ * inter_edges <-> cs_join_inter_edges_t structure to destroy
+ *
+ * returns:
+ * a NULL pointer
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_destroy(cs_join_inter_edges_t *inter_edges)
+{
+ if (inter_edges == NULL)
+ return inter_edges;
+
+ BFT_FREE(inter_edges->index);
+ BFT_FREE(inter_edges->edge_gnum);
+ BFT_FREE(inter_edges->vtx_lst);
+ BFT_FREE(inter_edges->vtx_glst);
+ BFT_FREE(inter_edges->abs_lst);
+ BFT_FREE(inter_edges);
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Find non-trivial equivalences between vertices sharing the same edges.
+ *
+ * For instance an equivalence between a vertex from the extremity of an edge
+ * and a vertex created by an edge-edge intersection.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter
+ * mesh <-- pointer to the local cs_join_mesh_t structure
+ * which has initial vertex data
+ * edges <-- list of edges
+ * inter_edges <-- structure including data on edge intersections
+ * vtx_equiv <-> structure dealing with vertex equivalences
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_add_equiv_from_edges(const cs_join_param_t param,
+ const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_join_inter_edges_t *inter_edges,
+ cs_join_eset_t *vtx_equiv)
+{
+ cs_int_t i, j, k, i1, i2;
+
+ cs_int_t *tmp_vtx_lst = NULL;
+ float *tmp_abs_lst = NULL;
+ double *tmp_tol_lst = NULL;
+
+ if (inter_edges == NULL)
+ return;
+
+ if (inter_edges->index[inter_edges->n_edges] == 0)
+ return; /* Intersections only on the extremities */
+
+ assert(inter_edges->vtx_lst != NULL);
+ assert(inter_edges->abs_lst != NULL);
+
+ BFT_MALLOC(tmp_vtx_lst, inter_edges->max_sub_size + 2, cs_int_t);
+ BFT_MALLOC(tmp_abs_lst, inter_edges->max_sub_size + 2, float);
+ BFT_MALLOC(tmp_tol_lst, inter_edges->max_sub_size + 2, double);
+
+ /* Main loop */
+
+ for (i = 0; i < inter_edges->n_edges; i++) {
+
+ cs_int_t v1_num = edges->def[2*i];
+ cs_int_t v2_num = edges->def[2*i+1];
+ cs_int_t v1_id = v1_num - 1;
+ cs_int_t v2_id = v2_num - 1;
+ cs_int_t start = inter_edges->index[i];
+ cs_int_t end = inter_edges->index[i+1];
+ cs_int_t n_sub_elts = 2 + end - start;
+ cs_real_t edge_length = _compute_length(mesh->vertices[v1_id],
+ mesh->vertices[v2_id]);
+
+ /* Build temporay lists */
+
+ tmp_vtx_lst[0] = v1_num;
+ tmp_abs_lst[0] = 0.0;
+ tmp_tol_lst[0] = (mesh->vertices[v1_id]).tolerance
+ * _cs_join_tol_eps_coef * param.edge_equiv_tol_coef;
+
+ for (j = start, k = 1; j < end; j++, k++) {
+ tmp_vtx_lst[k] = inter_edges->vtx_lst[j];
+ tmp_abs_lst[k] = inter_edges->abs_lst[j];
+ tmp_tol_lst[k] = (mesh->vertices[tmp_vtx_lst[k]-1]).tolerance
+ * _cs_join_tol_eps_coef * param.edge_equiv_tol_coef;
+ }
+
+ tmp_vtx_lst[k] = v2_num;
+ tmp_abs_lst[k] = 1.0;
+ tmp_tol_lst[k] = (mesh->vertices[v2_id]).tolerance
+ * _cs_join_tol_eps_coef * param.edge_equiv_tol_coef;
+
+ /* Loop on couples of vertices to find if two vertices are equivalent */
+
+ for (i1 = 0; i1 < n_sub_elts - 1; i1++) {
+
+ for (i2 = i1 + 1; i2 < n_sub_elts; i2++) {
+
+ if (tmp_vtx_lst[i1] != tmp_vtx_lst[i2]) {
+
+ float ds = tmp_abs_lst[i2] - tmp_abs_lst[i1];
+ cs_real_t range = ds * edge_length;
+
+ assert(range >= 0.0);
+
+ /* Add an equivalence if test is true */
+
+ if (tmp_tol_lst[i1] >= range && tmp_tol_lst[i2] >= range) {
+
+ cs_int_t equiv_id = vtx_equiv->n_equiv;
+
+ cs_join_eset_check_size(equiv_id, &vtx_equiv);
+
+ if (tmp_vtx_lst[i1] < tmp_vtx_lst[i2]) {
+ vtx_equiv->equiv_couple[2*equiv_id] = tmp_vtx_lst[i1];
+ vtx_equiv->equiv_couple[2*equiv_id+1] = tmp_vtx_lst[i2];
+ }
+ else {
+ vtx_equiv->equiv_couple[2*equiv_id] = tmp_vtx_lst[i2];
+ vtx_equiv->equiv_couple[2*equiv_id+1] = tmp_vtx_lst[i1];
+ }
+ vtx_equiv->n_equiv += 1;
+
+ }
+ else
+ break;
+
+ } /* End if vtx_lst[i1/i2] != */
+
+ } /* End of loop on i2 */
+
+ } /* End of loop on i1 */
+
+ } /* End of loop on edge intersections */
+
+ /* Free memory */
+
+ BFT_FREE(tmp_vtx_lst);
+ BFT_FREE(tmp_abs_lst);
+ BFT_FREE(tmp_tol_lst);
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Synchronize the definition of intersections on each edge by block.
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure
+ * mesh <-- cs_join_mesh_t structure
+ * part <-- structure storing data on edge intersections by partition
+ *
+ * returns:
+ * newly allocated cs_join_inter_edges_t, synchronized and defined on
+ * a block
+ *---------------------------------------------------------------------------*/
+
+cs_join_inter_edges_t *
+cs_join_inter_edges_part_to_block(const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_join_inter_edges_t *part)
+{
+ cs_int_t i, j, rank, shift, sub_shift;
+ cs_int_t send_list_size, recv_list_size;
+ cs_int_t send_inter_list_size, recv_inter_list_size;
+ fvm_gnum_t ii;
+ cs_join_block_info_t block_info;
+
+ cs_int_t _max = 0;
+ cs_int_t *new_index = NULL, *shift_ref = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_inter_count = NULL, *recv_inter_count = NULL;
+ fvm_gnum_t *send_glist = NULL, *recv_glist = NULL;
+ exch_inter_t *send_inter_list = NULL, *recv_inter_list = NULL;
+ cs_join_inter_edges_t *block = NULL;
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+ MPI_Datatype MPI_JOIN_EXCH_INTER = _create_exch_inter_datatype();
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const cs_int_t n_edges = edges->n_edges;
+
+ /* Sanity check */
+
+ assert(mesh != NULL);
+ assert(part != NULL);
+ assert(part->n_edges == n_edges);
+
+ block_info = cs_join_get_block_info(edges->n_g_edges,
+ n_ranks,
+ local_rank);
+
+ /* Allocate parameters for MPI functions */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ /* Count number of edges to send */
+
+ for (i = 0; i < n_edges; i++) {
+ rank = (part->edge_gnum[i] - 1)/block_info.size;
+ send_count[rank] += 2;
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ assert(send_shift[n_ranks] == 2*edges->n_edges);
+
+ send_list_size = send_shift[n_ranks];
+ recv_list_size = recv_shift[n_ranks];
+
+ /* Build send_list */
+
+ BFT_MALLOC(send_glist, send_list_size, fvm_gnum_t);
+ BFT_MALLOC(recv_glist, recv_list_size, fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_edges; i++) {
+
+ rank = (part->edge_gnum[i] - 1)/block_info.size;
+ shift = send_shift[rank] + send_count[rank];
+ send_glist[shift] = part->edge_gnum[i];
+ send_glist[shift+1] = part->index[i+1] - part->index[i];
+ send_count[rank] += 2;
+
+ }
+
+ MPI_Alltoallv(send_glist, send_count, send_shift, FVM_MPI_GNUM,
+ recv_glist, recv_count, recv_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ /* Build send_inter_list and exchange information */
+
+ BFT_MALLOC(send_inter_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_inter_count, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++) {
+ send_inter_count[i] = 0;
+ recv_inter_count[i] = 0;
+ }
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = send_shift[rank]; i < send_shift[rank+1]; i+= 2)
+ send_inter_count[rank] += send_glist[i+1];
+
+ for (i = recv_shift[rank]; i < recv_shift[rank+1]; i+= 2)
+ recv_inter_count[rank] += recv_glist[i+1];
+
+ }
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_inter_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_inter_count[rank];
+ }
+
+ assert(send_shift[n_ranks] == part->index[edges->n_edges]);
+
+ send_inter_list_size = send_shift[n_ranks];
+ recv_inter_list_size = recv_shift[n_ranks];
+
+ BFT_MALLOC(send_inter_list, send_inter_list_size, exch_inter_t);
+ BFT_MALLOC(recv_inter_list, recv_inter_list_size, exch_inter_t);
+
+ /* Fill the send_inter_list buffer */
+
+ for (i = 0; i < n_ranks; i++)
+ send_inter_count[i] = 0;
+
+ for (i = 0; i < n_edges; i++) {
+
+ cs_int_t start = part->index[i];
+ cs_int_t end = part->index[i+1];
+
+ rank = (part->edge_gnum[i] - 1)/block_info.size;
+ shift = send_shift[rank] + send_inter_count[rank];
+
+ for (j = start; j < end; j++) {
+
+ cs_int_t vtx_id = part->vtx_lst[j] - 1;
+
+ (send_inter_list[shift]).vtx_gnum = (mesh->vertices[vtx_id]).gnum;
+ (send_inter_list[shift]).curv_abs = part->abs_lst[j];
+ shift++;
+
+ }
+
+ send_inter_count[rank] += end - start;
+
+ }
+
+ /* Exchange buffers */
+
+ MPI_Alltoallv(send_inter_list, send_inter_count, send_shift,
+ MPI_JOIN_EXCH_INTER,
+ recv_inter_list, recv_inter_count, recv_shift,
+ MPI_JOIN_EXCH_INTER, mpi_comm);
+
+ /* Synchronize the definition of each edge.
+ Define a new cs_join_inter_edges_t struct. */
+
+ block = cs_join_inter_edges_create(block_info.local_size);
+
+ for (ii = 0; ii < block_info.local_size; ii++)
+ block->edge_gnum[ii] = block_info.first_gnum + ii;
+
+ /* First scan : fill index_ref */
+
+ for (i = 0; i < recv_list_size; i+= 2) {
+
+ fvm_gnum_t num = recv_glist[i] - block_info.first_gnum + 1;
+ cs_int_t n_sub_elts = recv_glist[i+1];
+
+ assert(num <= block_info.local_size);
+ block->index[num] += n_sub_elts;
+
+ }
+
+ BFT_MALLOC(shift_ref, block_info.local_size, cs_int_t);
+
+ for (ii = 0; ii < block_info.local_size; ii++) {
+ block->index[ii+1] += block->index[ii];
+ shift_ref[ii] = block->index[ii];
+ }
+
+ BFT_MALLOC(block->vtx_glst,
+ block->index[block_info.local_size],
+ fvm_gnum_t);
+
+ BFT_MALLOC(block->abs_lst,
+ block->index[block_info.local_size],
+ float);
+
+ /* Second scan : fill buffers */
+
+ sub_shift = 0;
+
+ for (i = 0; i < recv_list_size; i+= 2) {
+
+ fvm_gnum_t block_id = recv_glist[i] - block_info.first_gnum;
+ cs_int_t n_sub_elts = recv_glist[i+1];
+
+ assert(block_id < block_info.local_size);
+
+ for (j = 0; j < n_sub_elts; j++) {
+
+ exch_inter_t exch_inter = recv_inter_list[sub_shift + j];
+
+ if (_need_to_add_exch_inter(exch_inter,
+ block,
+ block_id,
+ shift_ref)) {
+
+ cs_int_t _shift = shift_ref[block_id];
+
+ assert(_shift < block->index[block_id+1]);
+
+ block->vtx_glst[_shift] = exch_inter.vtx_gnum;
+ block->abs_lst[_shift] = exch_inter.curv_abs;
+ shift_ref[block_id] += 1;
+
+ } /* End of adding a new intersection in the edge definition */
+
+ } /* End of loop on sub_elts */
+
+ sub_shift += n_sub_elts;
+
+ } /* End of loop on edge descriptions */
+
+ /* Compact block */
+
+ shift = 0;
+ for (ii = 0; ii < block_info.local_size; ii++) {
+
+ for (j = block->index[ii]; j < shift_ref[ii]; j++) {
+
+ block->vtx_glst[shift] = block->vtx_glst[j];
+ block->abs_lst[shift] = block->abs_lst[j];
+ shift++;
+
+ }
+
+ }
+
+ BFT_MALLOC(new_index, block_info.local_size + 1, cs_int_t);
+
+ new_index[0] = 0;
+ for (ii = 0; ii < block_info.local_size; ii++)
+ new_index[ii+1] = new_index[ii] + shift_ref[ii] - block->index[ii];
+
+ BFT_FREE(block->index);
+
+ block->index = new_index;
+
+ BFT_REALLOC(block->vtx_glst, block->index[block_info.local_size], fvm_gnum_t);
+ BFT_REALLOC(block->abs_lst, block->index[block_info.local_size], float);
+
+ /* Sort intersection by increasing curvilinear abscissa for each edge */
+
+ for (ii = 0; ii < block_info.local_size; ii++)
+ _max = CS_MAX(_max, new_index[ii+1] - new_index[ii]);
+
+ block->max_sub_size = _max;
+
+ for (ii = 0; ii < block_info.local_size; ii++) {
+
+ cs_int_t start = block->index[ii];
+ cs_int_t end = block->index[ii+1];
+
+ if (end - start > 0)
+ _adapted_gshellsort(start, end, block->abs_lst, block->vtx_glst);
+
+ } /* End of loop on edges of block */
+
+ /* Free memory */
+
+ MPI_Type_free(&MPI_JOIN_EXCH_INTER);
+
+ BFT_FREE(shift_ref);
+ BFT_FREE(send_count);
+ BFT_FREE(recv_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(recv_shift);
+ BFT_FREE(send_glist);
+ BFT_FREE(recv_glist);
+ BFT_FREE(recv_inter_count);
+ BFT_FREE(send_inter_count);
+ BFT_FREE(send_inter_list);
+ BFT_FREE(recv_inter_list);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ cs_join_inter_edges_dump(inter_edges, edges, mesh);
+#endif
+
+ return block;
+}
+
+/*----------------------------------------------------------------------------
+ * Synchronize the definition of intersections on each edge from a
+ * cs_join_inter_edges_t structure defined on a block.
+ *
+ * parameters:
+ * n_g_egdes <-- global number of edges
+ * block <-- synchronized cs_join_inter_edges_t struct. by block
+ * part <-> cs_join_inter_edges_t to synchronized on partition
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_inter_edges_block_to_part(fvm_gnum_t n_g_edges,
+ const cs_join_inter_edges_t *block,
+ cs_join_inter_edges_t *part)
+{
+ cs_int_t i, j, rank, shift;
+ cs_int_t list_to_send_size, list_to_recv_size;
+ cs_int_t send_inter_list_size, recv_inter_list_size;
+
+ cs_int_t _max = 0;
+ cs_int_t *send_rank_index = NULL, *recv_rank_index = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *nsubs_to_send = NULL, *nsubs_to_recv = NULL;
+ fvm_gnum_t *glist_to_send = NULL, *glist_to_recv = NULL;
+ exch_inter_t *send_inter_list = NULL, *recv_inter_list = NULL;
+
+ MPI_Datatype MPI_JOIN_EXCH_INTER = _create_exch_inter_datatype();
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const cs_join_block_info_t block_info = cs_join_get_block_info(n_g_edges,
+ n_ranks,
+ local_rank);
+
+ /* Sanity check */
+
+ assert(block != NULL);
+ assert((size_t)(block->n_edges) == block_info.local_size);
+
+ /* Allocate parameters for MPI functions */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ /* Count number of edges we want to receive */
+
+ for (i = 0; i < part->n_edges; i++) {
+ rank = (part->edge_gnum[i] - 1)/block_info.size;
+ send_count[rank] += 1;
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ BFT_MALLOC(recv_rank_index, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(send_rank_index, n_ranks + 1, cs_int_t);
+
+ recv_rank_index[0] = 0;
+ send_rank_index[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ recv_rank_index[rank + 1] = recv_rank_index[rank] + send_count[rank];
+ send_rank_index[rank + 1] = send_rank_index[rank] + recv_count[rank];
+ }
+
+ assert(recv_rank_index[n_ranks] == part->n_edges);
+
+ list_to_recv_size = recv_rank_index[n_ranks];
+ list_to_send_size = send_rank_index[n_ranks];
+
+ /* Build lists to exchange */
+
+ BFT_MALLOC(glist_to_recv, list_to_recv_size, fvm_gnum_t);
+ BFT_MALLOC(glist_to_send, list_to_send_size, fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < part->n_edges; i++) {
+
+ rank = (part->edge_gnum[i] - 1)/block_info.size;
+ shift = recv_rank_index[rank] + send_count[rank];
+ glist_to_recv[shift] = part->edge_gnum[i];
+ send_count[rank] += 1;
+
+ }
+
+ MPI_Alltoallv(glist_to_recv, send_count, recv_rank_index, FVM_MPI_GNUM,
+ glist_to_send, recv_count, send_rank_index, FVM_MPI_GNUM,
+ mpi_comm);
+
+ /* block send the requested global edges to all the part on
+ the distant ranks */
+
+ /* Send the number of sub_elements for each requested edges */
+
+ BFT_MALLOC(nsubs_to_send, list_to_send_size, cs_int_t);
+ BFT_MALLOC(nsubs_to_recv, list_to_recv_size, cs_int_t);
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = send_rank_index[rank]; i < send_rank_index[rank+1]; i++) {
+
+ fvm_gnum_t s_id = glist_to_send[i] - block_info.first_gnum;
+
+ nsubs_to_send[i] = block->index[s_id+1] - block->index[s_id];
+
+ }
+
+ } /* End of loop on ranks */
+
+ MPI_Alltoallv(nsubs_to_send, recv_count, send_rank_index, MPI_INT,
+ nsubs_to_recv, send_count, recv_rank_index, MPI_INT,
+ mpi_comm);
+
+ /* block struct. send the requested global edges to all the part struct
+ on the distant ranks */
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++)
+ for (i = send_rank_index[rank]; i < send_rank_index[rank+1]; i++)
+ send_count[rank] += nsubs_to_send[i];
+
+ BFT_FREE(nsubs_to_send);
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ send_inter_list_size = send_shift[n_ranks];
+ recv_inter_list_size = recv_shift[n_ranks];
+
+ BFT_MALLOC(send_inter_list, send_inter_list_size, exch_inter_t);
+ BFT_MALLOC(recv_inter_list, recv_inter_list_size, exch_inter_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = send_rank_index[rank]; i < send_rank_index[rank+1]; i++) {
+
+ fvm_gnum_t s_id = glist_to_send[i] - block_info.first_gnum;
+ cs_int_t start = block->index[s_id];
+ cs_int_t end = block->index[s_id+1];
+
+ shift = send_shift[rank] + send_count[rank];
+
+ for (j = start; j < end; j++) {
+
+ (send_inter_list[shift]).vtx_gnum = block->vtx_glst[j];
+ (send_inter_list[shift]).curv_abs = block->abs_lst[j];
+ shift++;
+
+ }
+
+ send_count[rank] += end - start;
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Exchange buffers */
+
+ MPI_Alltoallv(send_inter_list, send_count, send_shift,
+ MPI_JOIN_EXCH_INTER,
+ recv_inter_list, recv_count, recv_shift,
+ MPI_JOIN_EXCH_INTER, mpi_comm);
+
+ /* Partial free memory */
+
+ BFT_FREE(recv_count);
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(send_inter_list);
+ BFT_FREE(recv_rank_index);
+ BFT_FREE(send_rank_index);
+ BFT_FREE(glist_to_send);
+
+ /* Update recv_inter_edges */
+
+ for (i = 0; i < part->n_edges; i++)
+ part->edge_gnum[i] = glist_to_recv[i];
+
+ _max = 0;
+ part->index[0] = 0;
+ for (i = 0; i < part->n_edges; i++) {
+ _max = CS_MAX(_max, nsubs_to_recv[i]);
+ part->index[i+1] = nsubs_to_recv[i];
+ }
+
+ part->max_sub_size = _max;
+
+ for (i = 0; i < part->n_edges; i++)
+ part->index[i+1] += part->index[i];
+
+ BFT_FREE(part->vtx_lst);
+ part->vtx_lst = NULL;
+ BFT_REALLOC(part->vtx_glst, recv_shift[n_ranks], fvm_gnum_t);
+ BFT_REALLOC(part->abs_lst, recv_shift[n_ranks], float);
+
+ for (i = 0; i < recv_shift[n_ranks]; i++) {
+
+ part->vtx_glst[i] = (recv_inter_list[i]).vtx_gnum;
+ part->abs_lst[i] = (recv_inter_list[i]).curv_abs;
+
+ }
+
+ /* Free memory */
+
+ MPI_Type_free(&MPI_JOIN_EXCH_INTER);
+
+ BFT_FREE(recv_shift);
+ BFT_FREE(nsubs_to_recv);
+ BFT_FREE(glist_to_recv);
+ BFT_FREE(recv_inter_list);
+
+}
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Redefine a cs_join_inter_edges_t structure to be consistent with the local
+ * numbering of a given couple of cs_join_mesh_t structure and
+ * cs_join_edges_t structure.
+ * Add future new vertices for the face definition in cs_join_mesh_t
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure
+ * mesh <-> cs_join_mesh_t structure
+ * inter_edges <-> current cs_join_inter_edges_t struct. to work with
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_intersect_update_struct(const cs_join_edges_t *edges,
+ cs_join_mesh_t *mesh,
+ cs_join_inter_edges_t **inter_edges)
+{
+ cs_int_t i, j, shift, o_id, max_size;
+
+ cs_int_t n_new_vertices = 0;
+ fvm_gnum_t *vtx_gnum = NULL, *edge_gnum = NULL;
+ fvm_lnum_t *edge_order = NULL, *vtx_order = NULL;
+ cs_join_inter_edges_t *_inter_edges = *inter_edges;
+ cs_join_inter_edges_t *new_inter_edges = NULL;
+ cs_join_vertex_t *new_vertices = NULL;
+
+ const cs_int_t n_edges = edges->n_edges;
+ const cs_int_t n_init_vertices = mesh->n_vertices;
+
+ assert(inter_edges != NULL);
+ assert(n_edges == _inter_edges->n_edges);
+
+ /* Check if we have to re-order inter_edges */
+
+ for (i = 0; i < n_edges; i++)
+ if (_inter_edges->edge_gnum[i] != edges->gnum[i])
+ break;
+
+ if (i != n_edges) {
+
+ new_inter_edges = cs_join_inter_edges_create(n_edges);
+
+ /* Order global edge numbering */
+
+ BFT_MALLOC(edge_order, n_edges, fvm_lnum_t);
+ BFT_MALLOC(edge_gnum, n_edges, fvm_gnum_t);
+
+ fvm_order_local_allocated(NULL, edges->gnum, edge_order, n_edges);
+
+ for (i = 0; i < n_edges; i++)
+ edge_gnum[i] = edges->gnum[edge_order[i]];
+
+ /* edge_gnum -> edge_id */
+
+ for (i = 0; i < n_edges; i++) {
+
+ fvm_gnum_t e_gnum = _inter_edges->edge_gnum[i];
+ cs_int_t e_id = cs_search_g_binary(n_edges, e_gnum, edge_gnum);
+
+ if (e_id == -1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" The received edge global number (%u) is unknown"
+ " on the current rank.\n"), _inter_edges->edge_gnum[i]);
+
+ o_id = edge_order[e_id];
+ new_inter_edges->edge_gnum[o_id] = e_gnum;
+
+ new_inter_edges->index[o_id+1] =
+ _inter_edges->index[i+1] - _inter_edges->index[i];
+
+ }
+
+ for (i = 0; i < n_edges; i++)
+ new_inter_edges->index[i+1] += new_inter_edges->index[i];
+
+ BFT_MALLOC(new_inter_edges->vtx_glst,
+ new_inter_edges->index[n_edges], fvm_gnum_t);
+ BFT_MALLOC(new_inter_edges->abs_lst,
+ new_inter_edges->index[n_edges], float);
+
+ for (i = 0; i < n_edges; i++) {
+
+ fvm_gnum_t e_gnum = _inter_edges->edge_gnum[i];
+ cs_int_t e_id = cs_search_g_binary(n_edges, e_gnum, edge_gnum);
+
+ o_id = edge_order[e_id];
+ shift = new_inter_edges->index[o_id];
+
+ for (j = _inter_edges->index[i]; j < _inter_edges->index[i+1]; j++) {
+
+ new_inter_edges->vtx_glst[shift] = _inter_edges->vtx_glst[j];
+ new_inter_edges->abs_lst[shift] = _inter_edges->abs_lst[j];
+ shift++;
+
+ }
+
+ }
+
+ /* Partial memory free */
+
+ BFT_FREE(edge_gnum);
+ BFT_FREE(edge_order);
+
+ _inter_edges = cs_join_inter_edges_destroy(_inter_edges);
+
+ } /* End if re-order necessary */
+
+ else
+ new_inter_edges = _inter_edges;
+
+ if (new_inter_edges->vtx_lst == NULL)
+ BFT_MALLOC(new_inter_edges->vtx_lst,
+ new_inter_edges->index[n_edges], cs_int_t);
+
+ /* Order global vertex numbering */
+
+ BFT_MALLOC(vtx_gnum, n_init_vertices, fvm_gnum_t);
+ BFT_MALLOC(vtx_order, n_init_vertices, fvm_lnum_t);
+
+ for (i = 0; i < n_init_vertices; i++)
+ vtx_gnum[i] = mesh->vertices[i].gnum;
+
+ fvm_order_local_allocated(NULL, vtx_gnum, vtx_order, n_init_vertices);
+
+ for (i = 0; i < n_init_vertices; i++)
+ vtx_gnum[i] = mesh->vertices[vtx_order[i]].gnum;
+
+ /* Pre-allocate a buffer to store data on possible new vertices */
+
+ max_size = 25;
+ BFT_MALLOC(new_vertices, max_size, cs_join_vertex_t);
+
+ /* Fill vtx_lst array of the cs_join_inter_edges_t structure */
+
+ for (i = 0; i < n_edges; i++) {
+
+ cs_int_t start = new_inter_edges->index[i];
+ cs_int_t end = new_inter_edges->index[i+1];
+
+ for (j = start; j < end; j++) {
+
+ cs_int_t id = cs_search_g_binary(n_init_vertices,
+ new_inter_edges->vtx_glst[j],
+ vtx_gnum);
+
+ if (id == -1) { /* New vertex to add in the mesh structure */
+
+ if (n_new_vertices >= max_size) {
+ max_size *= 2;
+ BFT_REALLOC(new_vertices, max_size, cs_join_vertex_t);
+ }
+
+ new_vertices[n_new_vertices]
+ = _get_new_vertex(new_inter_edges->abs_lst[j],
+ new_inter_edges->vtx_glst[j],
+ &(edges->def[2*i]),
+ mesh);
+
+ /* update new_inter_edges */
+
+ n_new_vertices++;
+ new_inter_edges->vtx_lst[j] = n_init_vertices + n_new_vertices;
+
+ }
+ else
+ new_inter_edges->vtx_lst[j] = vtx_order[id] + 1;
+
+ } /* End of loop on intersection description */
+
+ } /* End of loop on edges */
+
+ if (n_new_vertices > 0) {
+
+ bft_printf(_("\n Add %d new vertices in the %s mesh definition.\n"),
+ n_new_vertices, mesh->name);
+
+ BFT_REALLOC(mesh->vertices,
+ n_init_vertices + n_new_vertices,
+ cs_join_vertex_t);
+
+ for (i = 0; i < n_new_vertices; i++)
+ mesh->vertices[n_init_vertices + i] = new_vertices[i];
+
+ mesh->n_vertices = n_init_vertices + n_new_vertices;
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(vtx_gnum);
+ BFT_FREE(vtx_order);
+ BFT_FREE(new_vertices);
+
+ /* Returns pointer */
+
+ *inter_edges = new_inter_edges;
+}
+
+/*----------------------------------------------------------------------------
+ * Get all real edges intersections among possible edges intersections.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters for the joining
+ * edge_edge_vis <-- a pointer to a cs_join_gset_t structure
+ * edges <-- pointer to a structure defining edges
+ * mesh <-- pointer to the cs_join_mesh_t structure
+ * which has the face connectivity
+ * inter_set <-> pointer to a structure including data on edge
+ * intersections
+ * vtx_eset <-> pointer to a structure dealing with vertex
+ * equivalences
+ *
+ * returns:
+ * the type of joining encountered (conforming or not)
+ *---------------------------------------------------------------------------*/
+
+cs_join_type_t
+cs_join_intersect_edges(cs_join_param_t param,
+ const cs_join_gset_t *edge_edge_vis,
+ const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh,
+ cs_join_eset_t **vtx_eset,
+ cs_join_inter_set_t **inter_set)
+{
+ cs_int_t i, j, k, n_inter;
+ double clock_start, clock_end, cpu_start, cpu_end;
+ double abs_e1[2], abs_e2[2];
+
+ cs_join_type_t join_type = CS_JOIN_TYPE_CONFORM;
+ cs_int_t n_inter_detected = 0, n_real_inter = 0, n_trivial_inter = 0;
+ cs_join_inter_set_t *_inter_set = NULL;
+ cs_join_eset_t *_vtx_eset = NULL;
+
+ /* Sanity checks */
+
+ assert(mesh != NULL);
+ assert(edges != NULL);
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ /* Initialization of structures */
+
+ _n_inter_tolerance_warnings = 0;
+
+ _inter_set = cs_join_inter_set_create(25);
+ _vtx_eset = cs_join_eset_create(15);
+
+ /* Loop on edges */
+
+ for (i = 0; i < edge_edge_vis->n_elts; i++) {
+
+ cs_int_t e1_id = edge_edge_vis->g_elts[i] - 1;
+
+ for (j = edge_edge_vis->index[i]; j < edge_edge_vis->index[i+1]; j++) {
+
+ cs_int_t e2_id = edge_edge_vis->g_list[j] - 1;
+
+ assert(e1_id != e2_id);
+
+ /* Get edge-edge intersection */
+
+ _edge_edge_3d_inter(mesh,
+ edges,
+ param.fraction,
+ e1_id, abs_e1,
+ e2_id, abs_e2,
+ param.verbosity,
+ &n_inter);
+
+ n_inter_detected += n_inter;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (param.verbosity > 2 && n_inter > 0) {
+
+ cs_int_t v1e1 = edges->def[2*e1_id] - 1;
+ cs_int_t v2e1 = edges->def[2*e1_id+1] - 1;
+ cs_int_t v1e2 = edges->def[2*e2_id] - 1;
+ cs_int_t v2e2 = edges->def[2*e2_id+1] - 1;
+
+ bft_printf("\n Intersection: E1 (%u) [%u - %u] / E2 (%u) [%u - %u]\n",
+ edges->gnum[e1_id], mesh->vertices[v1e1].gnum,
+ mesh->vertices[v2e1].gnum, edges->gnum[e2_id],
+ mesh->vertices[v1e2].gnum, mesh->vertices[v2e2].gnum);
+ bft_printf(" n_inter: %d ", n_inter);
+ for (k = 0; k < n_inter; k++)
+ bft_printf(" (%d) - s_e1 = %g, s_e2 = %g", k, abs_e1[k], abs_e2[k]);
+ bft_printf_flush();
+
+ }
+#endif
+
+ for (k = 0; k < n_inter; k++) {
+
+ cs_bool_t trivial = false;
+
+ if (abs_e1[k] <= 0.0 || abs_e1[k] >= 1.0)
+ if (abs_e2[k] <= 0.0 || abs_e2[k] >= 1.0)
+ trivial = true;
+
+ if (trivial) {
+
+ _add_trivial_equiv(e1_id,
+ e2_id,
+ abs_e1[k],
+ abs_e2[k],
+ edges,
+ _vtx_eset);
+
+ n_trivial_inter += 1;
+
+ }
+ else {
+
+ if (join_type == CS_JOIN_TYPE_CONFORM)
+ join_type = CS_JOIN_TYPE_NO_CONFORM;
+
+ _add_inter(e1_id, e2_id, abs_e1[k], abs_e2[k], _inter_set);
+
+ }
+
+ } /* End of loop on detected edge_edge_vis */
+
+ } /* End of loop on entities intersecting elements */
+
+ } /* End of loop on elements in intersection list */
+
+ n_real_inter = n_inter_detected - n_trivial_inter;
+
+ /* Order and delete redundant equivalences */
+
+ cs_join_eset_clean(&_vtx_eset);
+
+ if (param.verbosity > 0) {
+
+ bft_printf(_("\n"
+ " Number of intersections detected: %12lu\n"
+ " Vertex-Vertex intersections: %12lu\n"
+ " Other intersections: %12lu\n"),
+ n_inter_detected, n_trivial_inter, n_real_inter);
+
+ if (param.verbosity > 1)
+ bft_printf(_("\n Number of edge-edge intersection warnings: %8d\n"),
+ _n_inter_tolerance_warnings);
+
+ bft_printf(_("\n Number of equivalences between existing vertices: %9d\n"),
+ _vtx_eset->n_equiv);
+
+ }
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ if (param.verbosity > 1)
+ bft_printf(_("\n"
+ " Edge intersections (only)\n"
+ " wall clock time: %10.3g\n"
+ " CPU time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+ bft_printf_flush();
+
+ /* Return pointer */
+
+ *inter_set = _inter_set;
+ *vtx_eset = _vtx_eset;
+
+ return join_type;
+}
+
+/*----------------------------------------------------------------------------
+ * Build a tree structure on which we associate leaves and face bounding boxes.
+ * Create a cs_join_gset_t structure (indexed list on global numbering)
+ * storing potential intersections between face bounding boxes.
+ *
+ * parameters:
+ * param <-- set of user-defined parameter
+ * join_mesh <-- cs_join_mesh_t structure where faces are defined
+ *
+ * returns:
+ * a new allocated pointer to a cs_join_gset_t structure storing the
+ * face - face visibility.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_intersect_faces(const cs_join_param_t param,
+ const cs_join_mesh_t *join_mesh)
+{
+ cs_int_t i;
+ double extents_wtime, extents_cpu_time;
+
+ fvm_coord_t *f_extents = NULL;
+ fvm_neighborhood_t *face_neighborhood = NULL;
+ cs_join_gset_t *face_visibility = NULL;
+
+ assert(join_mesh != NULL);
+
+ extents_wtime = bft_timer_wtime();
+ extents_cpu_time = bft_timer_cpu_time();
+
+#if defined HAVE_MPI
+ face_neighborhood = fvm_neighborhood_create(cs_glob_mpi_comm);
+#else
+ face_neighborhood = fvm_neighborhood_create();
+#endif
+
+ fvm_neighborhood_set_options(face_neighborhood,
+ param.tree_max_level,
+ param.tree_n_max_boxes,
+ param.tree_max_box_ratio);
+
+ /* Allocate temporary extent arrays */
+
+ BFT_MALLOC(f_extents, join_mesh->n_faces*6, fvm_coord_t);
+
+ /* Define each bounding box for the selected faces */
+
+ for (i = 0; i < join_mesh->n_faces; i++)
+ _get_face_extents(join_mesh->face_vtx_idx[i],
+ join_mesh->face_vtx_idx[i+1],
+ join_mesh->face_vtx_lst,
+ join_mesh->n_vertices,
+ join_mesh->vertices,
+ f_extents + i*6);
+
+ extents_wtime = bft_timer_wtime() - extents_wtime;
+ extents_cpu_time = bft_timer_cpu_time() - extents_cpu_time;
+
+ fvm_neighborhood_by_boxes(face_neighborhood,
+ 3, /* spatial dimension */
+ join_mesh->n_faces,
+ join_mesh->face_gnum,
+ NULL,
+ NULL,
+ &f_extents);
+
+ if (param.verbosity > 0)
+ _face_bbox_search_stats(face_neighborhood,
+ extents_wtime,
+ extents_cpu_time);
+
+ /* Retrieve face -> face visibility */
+
+ BFT_MALLOC(face_visibility, 1, cs_join_gset_t);
+
+ assert(sizeof(cs_int_t) == sizeof(fvm_lnum_t));
+
+ fvm_neighborhood_transfer_data(face_neighborhood,
+ &(face_visibility->n_elts),
+ &(face_visibility->g_elts),
+ &(face_visibility->index),
+ &(face_visibility->g_list));
+
+ fvm_neighborhood_destroy(&face_neighborhood);
+
+ return face_visibility;
+}
+
+/*----------------------------------------------------------------------------
+ * Transform face visibility into edge visibility.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ * edges <-- pointer to a cs_join_edges_t structure
+ * face_visib <-- pointer to a cs_join_gset_t structure
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure holding edge visibility
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_intersect_face_to_edge(const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_join_gset_t *face_visib)
+{
+ cs_int_t i, j, k, edge_num, edge_id, shift;
+
+ cs_int_t size = 0, size_max = 0;
+ cs_int_t *count = NULL, *face2edge_idx = NULL, *face2edge_lst = NULL;
+ fvm_gnum_t *tmp = NULL;
+ cs_join_gset_t *edge_visib = NULL;
+
+ /* Create a local "face -> edge" connectivity
+ First, count number of edges for each face */
+
+ BFT_MALLOC(face2edge_idx, mesh->n_faces + 1, cs_int_t);
+
+ face2edge_idx[0] = 0;
+ for (i = 0; i < mesh->n_faces; i++)
+ face2edge_idx[i+1] = mesh->face_vtx_idx[i+1] - mesh->face_vtx_idx[i];
+
+ for (i = 0; i < mesh->n_faces; i++)
+ face2edge_idx[i+1] += face2edge_idx[i];
+
+ /* Build face2edge_lst */
+
+ BFT_MALLOC(face2edge_lst, face2edge_idx[mesh->n_faces], cs_int_t);
+ BFT_MALLOC(count, mesh->n_faces, cs_int_t);
+
+ for (i = 0; i < mesh->n_faces; i++)
+ count[i] = 0;
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ cs_int_t start = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end = mesh->face_vtx_idx[i+1] - 1;
+
+ for (j = start; j < end - 1; j++) {
+
+ edge_num = cs_join_mesh_get_edge(mesh->face_vtx_lst[j],
+ mesh->face_vtx_lst[j+1],
+ edges);
+
+ shift = face2edge_idx[i] + count[i];
+ count[i] += 1;
+ face2edge_lst[shift] = CS_ABS(edge_num);
+
+ }
+
+ edge_num = cs_join_mesh_get_edge(mesh->face_vtx_lst[end-1],
+ mesh->face_vtx_lst[start],
+ edges);
+
+ shift = face2edge_idx[i] + count[i];
+ count[i] += 1;
+ face2edge_lst[shift] = CS_ABS(edge_num);
+
+ } /* End of loop on faces */
+
+ /* Transform numbering in face_visib to match numbering
+ in the current cs_join_mesh_t structure */
+
+ for (i = 0; i < face_visib->n_elts; i++) {
+
+ cs_int_t face_id = cs_search_g_binary(mesh->n_faces,
+ face_visib->g_elts[i],
+ mesh->face_gnum);
+
+ face_visib->g_elts[i] = face_id;
+
+ for (j = face_visib->index[i]; j < face_visib->index[i+1]; j++) {
+
+ cs_int_t adj_id = cs_search_g_binary(mesh->n_faces,
+ face_visib->g_list[j],
+ mesh->face_gnum);
+
+ face_visib->g_list[j] = adj_id;
+
+ }
+
+ } /* End of loop on bounding boxes */
+
+ /* Create edge_visib. Unfold face_visib */
+
+ for (i = 0; i < face_visib->n_elts; i++) {
+ j = face_visib->g_elts[i];
+ size += face2edge_idx[j+1] - face2edge_idx[j];
+ }
+
+ edge_visib = cs_join_gset_create(size);
+
+ edge_id = 0;
+
+ for (i = 0; i < face_visib->n_elts; i++) {
+
+ cs_int_t face_id = face_visib->g_elts[i];
+ cs_int_t start = face2edge_idx[face_id];
+ cs_int_t end = face2edge_idx[face_id+1];
+
+ size = 0;
+ for (j = face_visib->index[i]; j < face_visib->index[i+1]; j++) {
+
+ cs_int_t adj_id = face_visib->g_list[j];
+
+ size += face2edge_idx[adj_id+1] - face2edge_idx[adj_id];
+
+ }
+
+ size_max = CS_MAX(size, size_max);
+
+ for (j = start; j < end; j++) {
+
+ edge_visib->g_elts[edge_id] = face2edge_lst[j];
+ edge_visib->index[edge_id+1] = size;
+ edge_id++;
+
+ }
+
+ } /* End of loop on bounding boxes */
+
+ assert(edge_id == edge_visib->n_elts);
+
+ /* Build index */
+
+ for (i = 0; i < edge_visib->n_elts; i++)
+ edge_visib->index[i+1] += edge_visib->index[i];
+
+ BFT_MALLOC(edge_visib->g_list,
+ edge_visib->index[edge_visib->n_elts],
+ fvm_gnum_t);
+
+ BFT_MALLOC(tmp, size_max, fvm_gnum_t);
+
+ /* Build list */
+
+ edge_id = 0;
+
+ for (i = 0; i < face_visib->n_elts; i++) {
+
+ cs_int_t _count = 0;
+ cs_int_t face_id = face_visib->g_elts[i];
+ cs_int_t n_edges = face2edge_idx[face_id+1] - face2edge_idx[face_id];
+ cs_int_t b_start = face_visib->index[i];
+ cs_int_t b_end = face_visib->index[i+1];
+
+ /* Unfold face->edge connectivity for the current list of bounding boxes */
+
+ for (j = b_start; j < b_end; j++) {
+
+ cs_int_t adj_face_id = face_visib->g_list[j];
+ cs_int_t n_adj_edges = face2edge_idx[adj_face_id+1]
+ - face2edge_idx[adj_face_id];
+
+ shift = face2edge_idx[adj_face_id];
+
+ for (k = 0; k < n_adj_edges; k++)
+ tmp[_count + k] = face2edge_lst[shift + k];
+ _count += n_adj_edges;
+
+ }
+
+ for (j = 0; j < n_edges; j++, edge_id++) {
+
+ cs_int_t e_start = edge_visib->index[edge_id];
+ cs_int_t e_end = edge_visib->index[edge_id+1];
+
+ assert(_count == e_end - e_start);
+
+ shift = edge_visib->index[edge_id];
+
+ for (k = 0; k < _count; k++)
+ edge_visib->g_list[shift + k] = tmp[k];
+
+ } /* End of loop on edges */
+
+ } /* End of loop on bounding boxes */
+
+ /* Free memory */
+
+ BFT_FREE(face2edge_idx);
+ BFT_FREE(face2edge_lst);
+ BFT_FREE(count);
+ BFT_FREE(tmp);
+
+ /* Delete redundancies in g_list */
+
+ cs_join_gset_clean(edge_visib);
+
+ /* Delete redundancies in g_elts and compact data */
+
+ cs_join_gset_merge_elts(edge_visib, 0); /* g_elts is not ordered */
+
+ cs_join_gset_compress(edge_visib);
+
+ /* Return pointers */
+
+ return edge_visib;
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_inter_edges_t structure.
+ *
+ * parameters:
+ * inter_edges <-- cs_join_inter_edges_t structure to dump
+ * edges <-- list of edges
+ * mesh <-- associated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_inter_edges_dump(const cs_join_inter_edges_t *inter_edges,
+ const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh)
+{
+ int i, j, k;
+
+ bft_printf("\n Dump of a cs_join_inter_edges_t structure (%p)\n",
+ inter_edges);
+
+ if (inter_edges == NULL)
+ return;
+
+ bft_printf(" n_edges: %10d\n", inter_edges->n_edges);
+ bft_printf(" max_sub_size: %10d\n\n", inter_edges->max_sub_size);
+
+ for (i = 0; i < inter_edges->n_edges; i++) {
+
+ cs_int_t v1_num = edges->def[2*i];
+ cs_int_t v2_num = edges->def[2*i+1];
+ fvm_gnum_t v1_gnum = (mesh->vertices[v1_num-1]).gnum;
+ fvm_gnum_t v2_gnum = (mesh->vertices[v2_num-1]).gnum;
+ cs_int_t start = inter_edges->index[i];
+ cs_int_t end = inter_edges->index[i+1];
+
+ bft_printf("\n%6d: [%9u] = (%7d [%9u] - %7d [%9u])\n",
+ i, edges->gnum[i], v1_num, v1_gnum, v2_num, v2_gnum);
+
+ assert(v1_num != v2_num);
+ assert(v1_gnum != v2_gnum);
+
+ bft_printf(" n_sub_inter: %4d - index : %7d <-- %7d\n",
+ end-start, start, end);
+
+ if (inter_edges->vtx_glst == NULL) {
+
+ for (j = start, k = 0; j < end; j++, k++)
+ bft_printf(" %7d (%9u) - (%7d, %8.6e)\n",
+ k, inter_edges->vtx_lst[j],
+ mesh->vertices[inter_edges->vtx_lst[j]-1].gnum,
+ inter_edges->abs_lst[j]);
+
+ }
+ else {
+
+ for (j = start, k = 0; j < end; j++, k++)
+ bft_printf(" %9u - (%7d, %8.6e)\n",
+ k, inter_edges->vtx_glst[j], inter_edges->abs_lst[j]);
+
+ }
+
+ } /* End of loop on edge intersections */
+
+ bft_printf_flush();
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_join_merge.c b/src/base/cs_join_merge.c
new file mode 100644
index 0000000..e4ee336
--- /dev/null
+++ b/src/base/cs_join_merge.c
@@ -0,0 +1,3086 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Set of subroutines for:
+ * - merging equivalent vertices,
+ * - managing tolerance reduction
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_timer.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_io_num.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_search.h"
+#include "cs_join_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_merge.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Structure and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Macro definitions
+ *===========================================================================*/
+
+/* Turn on (1) or off (0) the tolerance reduc. */
+#define CS_JOIN_MERGE_TOL_REDUC 1
+#define CS_JOIN_MERGE_INV_TOL 0
+
+/*============================================================================
+ * Global variable definitions
+ *===========================================================================*/
+
+/* Parameters to control the vertex merge */
+
+enum {
+
+ CS_JOIN_MERGE_MAX_GLOB_ITERS = 5, /* Max. number of glob. iter. for finding
+ equivalent vertices */
+ CS_JOIN_MERGE_MAX_LOC_ITERS = 15, /* Max. number of loc. iter. for finding
+ equivalent vertices */
+ CS_JOIN_MERGE_MAX_REDUCTIONS = 100 /* Max. number of loc. iter. for
+ reducing the tolerance */
+
+};
+
+/* Coefficient to deal with rounding approximations */
+
+static const double cs_join_tol_eps_coef2 = 1.0001*1.001;
+
+/* Counter on the number of loops useful to converge for the merge operation */
+
+static int _glob_merge_counter = 0, _loc_merge_counter = 0;
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize counter for the merge operation
+ *---------------------------------------------------------------------------*/
+
+static void
+_initialize_merge_counter(void)
+{
+ _glob_merge_counter = 0;
+ _loc_merge_counter = 0;
+}
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+
+/*----------------------------------------------------------------------------
+ * Dump an cs_join_eset_t structure on vertices.
+ *
+ * parameters:
+ * e_set <-- cs_join_eset_t structure to dump
+ * mesh <-- cs_join_mesh_t structure associated
+ *---------------------------------------------------------------------------*/
+
+static void
+_dump_vtx_eset(const cs_join_eset_t *e_set,
+ const cs_join_mesh_t *mesh)
+{
+ int i;
+
+ bft_printf("\n Dump an cs_join_eset_t structure (%p)\n", e_set);
+ bft_printf(" n_max_equiv: %10d\n", e_set->n_max_equiv);
+ bft_printf(" n_equiv : %10d\n\n", e_set->n_equiv);
+
+ for (i = 0; i < e_set->n_equiv; i++) {
+
+ cs_int_t v1_num = e_set->equiv_couple[2*i];
+ cs_int_t v2_num = e_set->equiv_couple[2*i+1];
+
+ bft_printf(" %10d - local: (%9d, %9d) - global: (%10u, %10u)\n",
+ i, v1_num, v2_num, (mesh->vertices[v1_num-1]).gnum,
+ (mesh->vertices[v2_num-1]).gnum);
+
+ }
+ bft_printf_flush();
+}
+
+#endif /* Only in debug mode */
+
+/*----------------------------------------------------------------------------
+ * Compute the length of a segment between two vertices.
+ *
+ * parameters:
+ * v1 <-- cs_join_vertex_t structure for the first vertex of the segment
+ * v2 <-- cs_join_vertex_t structure for the second vertex of the segment
+ *
+ * returns:
+ * length of the segment
+ *---------------------------------------------------------------------------*/
+
+inline static cs_real_t
+_compute_length(cs_join_vertex_t v1,
+ cs_join_vertex_t v2)
+{
+ cs_int_t k;
+ cs_real_t len = 0.0, d2 = 0.0;
+
+ for (k = 0; k < 3; k++) {
+ cs_real_t d = v1.coord[k] - v2.coord[k];
+ d2 += d * d;
+ }
+ len = sqrt(d2);
+
+ return len;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute a new cs_join_vertex_t structure.
+ *
+ * parameters:
+ * curv_abs <-- curvilinear abscissa of the intersection
+ * gnum <-- global number associated to the new
+ * cs_join_vertex_t structure
+ * vtx_couple <-- couple of vertex numbers defining the current edge
+ * work <-- local cs_join_mesh_t structure
+ *
+ * returns:
+ * a new cs_join_vertex_t structure
+ *---------------------------------------------------------------------------*/
+
+static cs_join_vertex_t
+_get_new_vertex(float curv_abs,
+ fvm_gnum_t gnum,
+ const cs_int_t vtx_couple[],
+ const cs_join_mesh_t *work)
+{
+ cs_int_t k;
+ cs_join_vertex_t new_vtx_data;
+
+ cs_join_vertex_t v1 = work->vertices[vtx_couple[0]-1];
+ cs_join_vertex_t v2 = work->vertices[vtx_couple[1]-1];
+
+ assert(curv_abs >= 0.0);
+ assert(curv_abs <= 1.0);
+
+ /* New global number */
+
+ new_vtx_data.gnum = gnum;
+
+ /* New tolerance */
+
+ new_vtx_data.tolerance = (1-curv_abs)*v1.tolerance + curv_abs*v2.tolerance;
+
+ /* New coordinates */
+
+ for (k = 0; k < 3; k++)
+ new_vtx_data.coord[k] = (1-curv_abs)*v1.coord[k] + curv_abs*v2.coord[k];
+
+ return new_vtx_data;
+}
+
+/*----------------------------------------------------------------------------
+ * Define a tag (3 values) to globally order intersections.
+ *
+ * parameters:
+ * tag <-> tag to fill
+ * e1_gnum <-- global number for the first edge
+ * e2_gnum <-- global number for the second edge
+ * link_vtx_gnum <-- global number of the vertex associated to the current
+ * intersection
+ *---------------------------------------------------------------------------*/
+
+static void
+_define_inter_tag(fvm_gnum_t tag[],
+ fvm_gnum_t e1_gnum,
+ fvm_gnum_t e2_gnum,
+ fvm_gnum_t link_vtx_gnum)
+{
+ if (e1_gnum < e2_gnum) {
+ tag[0] = e1_gnum;
+ tag[1] = e2_gnum;
+ }
+ else {
+ tag[0] = e2_gnum;
+ tag[1] = e1_gnum;
+ }
+
+ tag[2] = link_vtx_gnum;
+}
+
+/*----------------------------------------------------------------------------
+ * Creation of new vertices.
+ *
+ * Update list of equivalent vertices.
+ *
+ * parameters:
+ * work <-- pointer to a cs_join_mesh_t structure
+ * edges <-- list of edges
+ * inter_set <-- structure including data on edge intersections
+ * n_g_vertices <-- global number of vertices (initial full mesh)
+ * n_iwm_vertices <-- initial local number of vertices (work struct)
+ * n_new_vertices <-- local number of new vertices to define
+ * p_n_g_new_vertices <-> pointer to the global number of new vertices
+ * p_new_vtx_gnum <-> pointer to the global numbering array for the
+ * new vertices
+ *---------------------------------------------------------------------------*/
+
+static void
+_compute_new_vertex_gnum(const cs_join_mesh_t *work,
+ const cs_join_edges_t *edges,
+ const cs_join_inter_set_t *inter_set,
+ fvm_gnum_t n_g_vertices,
+ cs_int_t n_iwm_vertices,
+ cs_int_t n_new_vertices,
+ fvm_gnum_t *p_n_g_new_vertices,
+ fvm_gnum_t *p_new_vtx_gnum[])
+{
+ cs_int_t i;
+
+ fvm_gnum_t n_g_new_vertices = 0;
+ cs_int_t n_new_vertices_save = n_new_vertices;
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *inter_tag = NULL, *adjacency = NULL, *new_vtx_gnum = NULL;
+ fvm_io_num_t *new_vtx_io_num = NULL;
+
+ /* Define a fvm_io_num_t structure to get the global numbering
+ for the new vertices.
+ First, build a tag associated to each intersection */
+
+ BFT_MALLOC(new_vtx_gnum, n_new_vertices, fvm_gnum_t);
+ BFT_MALLOC(inter_tag, 3*n_new_vertices, fvm_gnum_t);
+
+ n_new_vertices = 0;
+
+ for (i = 0; i < inter_set->n_inter; i++) {
+
+ cs_join_inter_t inter1 = inter_set->inter_lst[2*i];
+ cs_join_inter_t inter2 = inter_set->inter_lst[2*i+1];
+ fvm_gnum_t e1_gnum = edges->gnum[inter1.edge_id];
+ fvm_gnum_t e2_gnum = edges->gnum[inter2.edge_id];
+
+ if (inter1.vtx_id + 1 > n_iwm_vertices) {
+
+ if (inter2.vtx_id + 1 > n_iwm_vertices)
+ _define_inter_tag(&(inter_tag[3*n_new_vertices]),
+ e1_gnum, e2_gnum,
+ 0);
+ else
+ _define_inter_tag(&(inter_tag[3*n_new_vertices]),
+ e1_gnum, e2_gnum,
+ (work->vertices[inter2.vtx_id]).gnum);
+
+ n_new_vertices++;
+
+ } /* New vertices for this intersection */
+
+ if (inter2.vtx_id + 1 > n_iwm_vertices) {
+
+ if (inter1.vtx_id + 1 > n_iwm_vertices)
+ _define_inter_tag(&(inter_tag[3*n_new_vertices]),
+ e1_gnum, e2_gnum,
+ n_g_vertices + 1);
+ else
+ _define_inter_tag(&(inter_tag[3*n_new_vertices]),
+ e1_gnum, e2_gnum,
+ (work->vertices[inter1.vtx_id]).gnum);
+
+ n_new_vertices++;
+
+ } /* New vertices for this intersection */
+
+ } /* End of loop on intersections */
+
+ if (n_new_vertices != n_new_vertices_save)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" The number of new vertices to create is not consistent.\n"
+ " Previous number: %10d\n"
+ " Current number: %10d\n\n"),
+ n_new_vertices_save, n_new_vertices);
+
+ /* Create a new fvm_io_num_t structure */
+
+ BFT_MALLOC(order, n_new_vertices, fvm_lnum_t);
+
+ fvm_order_local_allocated_s(NULL, inter_tag, 3, order, n_new_vertices);
+
+ BFT_MALLOC(adjacency, 3*n_new_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_new_vertices; i++) {
+
+ cs_int_t o_id = order[i];
+
+ adjacency[3*i] = inter_tag[3*o_id];
+ adjacency[3*i+1] = inter_tag[3*o_id+1];
+ adjacency[3*i+2] = inter_tag[3*o_id+2];
+
+ }
+
+ BFT_FREE(inter_tag);
+
+ if (cs_glob_n_ranks > 1) {
+
+ const fvm_gnum_t *global_num = NULL;
+
+ new_vtx_io_num =
+ fvm_io_num_create_from_adj_s(NULL, adjacency, n_new_vertices, 3);
+
+ n_g_new_vertices = fvm_io_num_get_global_count(new_vtx_io_num);
+ global_num = fvm_io_num_get_global_num(new_vtx_io_num);
+
+ for (i = 0; i < n_new_vertices; i++)
+ new_vtx_gnum[order[i]] = global_num[i] + n_g_vertices;
+
+ fvm_io_num_destroy(new_vtx_io_num);
+
+ } /* End of parallel treatment */
+
+ else {
+
+ if (n_new_vertices > 0) {
+
+ fvm_gnum_t new_gnum = n_g_vertices + 1;
+
+ new_vtx_gnum[order[0]] = new_gnum;
+
+ for (i = 1; i < n_new_vertices; i++) {
+
+ if (adjacency[3*i] != adjacency[3*(i-1)])
+ new_gnum += 1;
+ else {
+ if (adjacency[3*i+1] != adjacency[3*(i-1)+1])
+ new_gnum += 1;
+ else
+ if (adjacency[3*i+2] != adjacency[3*(i-1)+2])
+ new_gnum += 1;
+ }
+
+ new_vtx_gnum[order[i]] = new_gnum;
+
+ }
+
+ } /* End if n_new_vertices > 0 */
+
+ n_g_new_vertices = n_new_vertices;
+
+ } /* End of serial treatment */
+
+ /* Free memory */
+
+ BFT_FREE(order);
+ BFT_FREE(adjacency);
+
+ /* Return pointer */
+
+ *p_n_g_new_vertices = n_g_new_vertices;
+ *p_new_vtx_gnum = new_vtx_gnum;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get vertex id associated to the current intersection.
+ *
+ * Create a new vertex id if needed. Update n_new_vertices in this case.
+ *
+ * parameters:
+ * inter <-- a inter_t structure
+ * vtx_couple <-- couple of vertex numbers defining the current edge
+ * n_init_vertices <-- initial number of vertices
+ * n_new_vertices <-- number of new vertices created
+ *
+ * returns:
+ * vertex id associated to the current intersection.
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t
+_get_vtx_id(cs_join_inter_t inter,
+ const cs_int_t vtx_couple[],
+ cs_int_t n_init_vertices,
+ cs_int_t *p_n_new_vertices)
+{
+ cs_int_t vtx_id = -1;
+ cs_int_t n_new_vertices = *p_n_new_vertices;
+
+ assert(inter.curv_abs >= 0.0);
+ assert(inter.curv_abs <= 1.0);
+
+ if (inter.curv_abs <= 0.0)
+ vtx_id = vtx_couple[0] - 1;
+
+ else if (inter.curv_abs >= 1.0)
+ vtx_id = vtx_couple[1] - 1;
+
+ else {
+
+ assert(inter.curv_abs > 0 && inter.curv_abs < 1.0);
+ vtx_id = n_init_vertices + n_new_vertices;
+ n_new_vertices++;
+
+ }
+
+ assert(vtx_id != -1);
+
+ *p_n_new_vertices = n_new_vertices;
+
+ return vtx_id;
+}
+
+
+/*----------------------------------------------------------------------------
+ * Test if we have to continue to spread the tag associate to each vertex
+ *
+ * parameters:
+ * n_vertices <-- local number of vertices
+ * prev_vtx_tag <-- previous tag for each vertex
+ * vtx_tag <-- tag for each vertex
+ *
+ * returns:
+ * true or false
+ *---------------------------------------------------------------------------*/
+
+static cs_bool_t
+_is_spread_not_converged(cs_int_t n_vertices,
+ const fvm_gnum_t prev_vtx_tag[],
+ const fvm_gnum_t vtx_tag[])
+{
+ cs_int_t i;
+
+ cs_bool_t have_to_continue = true;
+
+ for (i = 0; i < n_vertices; i++)
+ if (vtx_tag[i] != prev_vtx_tag[i])
+ break;
+
+ if (i == n_vertices)
+ have_to_continue = false;
+
+ return have_to_continue;
+}
+
+/*----------------------------------------------------------------------------
+ * Spread the tag associated to each vertex according the rule:
+ * Between two equivalent vertices, the tag associated to each considered
+ * vertex is equal to the minimal global number.
+ *
+ * parameters:
+ * vtx_eset <-- structure dealing with vertices equivalences
+ * vtx_tag <-> tag for each vertex
+ *---------------------------------------------------------------------------*/
+
+static void
+_spread_tag(const cs_join_eset_t *vtx_eset,
+ fvm_gnum_t vtx_tag[])
+{
+ cs_int_t i;
+
+ cs_int_t *equiv_lst = vtx_eset->equiv_couple;
+
+ for (i = 0; i < vtx_eset->n_equiv; i++) {
+
+ cs_int_t v1_id = equiv_lst[2*i] - 1;
+ cs_int_t v2_id = equiv_lst[2*i+1] - 1;
+ fvm_gnum_t v1_gnum = vtx_tag[v1_id];
+ fvm_gnum_t v2_gnum = vtx_tag[v2_id];
+
+ if (v1_gnum != v2_gnum) {
+
+ fvm_gnum_t min_gnum = CS_MIN(v1_gnum, v2_gnum);
+
+ vtx_tag[v1_id] = min_gnum;
+ vtx_tag[v2_id] = min_gnum;
+ }
+
+ } /* End of loop on vertex equivalences */
+}
+
+/*----------------------------------------------------------------------------
+ * Define an array wich keeps the new vertex id of each vertex.
+ *
+ * If two vertices have the same vertex id, they should merge.
+ *
+ * parameters:
+ * vtx_eset <-- structure dealing with vertex equivalences
+ * n_vertices <-- local number of vertices
+ * prev_vtx_tag <-> previous tag for each vertex
+ * vtx_tag <-> tag for each vertex
+ *---------------------------------------------------------------------------*/
+
+static void
+_local_spread(const cs_join_eset_t *vtx_eset,
+ cs_int_t n_vertices,
+ fvm_gnum_t prev_vtx_tag[],
+ fvm_gnum_t vtx_tag[])
+{
+ cs_int_t i;
+
+ _loc_merge_counter++;
+
+ _spread_tag(vtx_eset, vtx_tag);
+
+ while (_is_spread_not_converged(n_vertices, prev_vtx_tag, vtx_tag)) {
+
+ _loc_merge_counter++;
+
+ if (_loc_merge_counter > CS_JOIN_MERGE_MAX_LOC_ITERS)
+ bft_error(__FILE__, __LINE__, 0,
+ _("\n The authorized maximum number of iterations "
+ " for the merge of vertices has been reached.\n"
+ " Local counter on iteration : %d (MAX =%d)\n"
+ " Check the fraction parameter.\n"),
+ _loc_merge_counter, CS_JOIN_MERGE_MAX_LOC_ITERS);
+
+ for (i = 0; i < n_vertices; i++)
+ prev_vtx_tag[i] = vtx_tag[i];
+
+ _spread_tag(vtx_eset, vtx_tag);
+ }
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Exchange local vtx_tag buffer over the ranks and update global vtx_tag
+ * buffers. Apply modifications observed on the global vtx_tag to the local
+ * vtx_tag.
+ *
+ * parameters:
+ * block_size <-- size of block for the current rank
+ * work <-- local cs_join_mesh_t structure which has initial
+ * vertex data
+ * vtx_tag <-> local vtx_tag for the local vertices
+ * glob_vtx_tag <-> global vtx_tag affected to the local rank
+ * (size: block_size)
+ * prev_glob_vtx_tag <-> same but for the previous iteration
+ * recv2glob <-> buffer used to place correctly receive elements
+ * send_count <-> buffer used to count the number of elts to send
+ * send_shift <-> index on ranks of the elements to send
+ * send_glob_buffer <-> buffer used to save elements to send
+ * recv_count <-> buffer used to count the number of elts to receive
+ * recv_shift <-> index on ranks of the elements to receive
+ * recv_glob_buffer <-> buffer used to save elements to receive
+ *
+ * returns:
+ * true if we have to continue the spread, false otherwise.
+ *---------------------------------------------------------------------------*/
+
+static cs_bool_t
+_global_spread(cs_int_t block_size,
+ const cs_join_mesh_t *work,
+ fvm_gnum_t vtx_tag[],
+ fvm_gnum_t glob_vtx_tag[],
+ fvm_gnum_t prev_glob_vtx_tag[],
+ fvm_gnum_t recv2glob[],
+ cs_int_t send_count[],
+ cs_int_t send_shift[],
+ fvm_gnum_t send_glob_buffer[],
+ cs_int_t recv_count[],
+ cs_int_t recv_shift[],
+ fvm_gnum_t recv_glob_buffer[])
+{
+ cs_bool_t ret_value;
+ cs_int_t i, local_value, global_value;
+
+ cs_int_t n_vertices = work->n_vertices;
+ int n_ranks = cs_glob_n_ranks;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ _glob_merge_counter++;
+
+ /* Push modifications in local vtx_tag to the global vtx_tag */
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+
+ int rank = (work->vertices[i].gnum - 1) % n_ranks;
+ cs_int_t shift = send_shift[rank] + send_count[rank];
+
+ send_glob_buffer[shift] = vtx_tag[i];
+ send_count[rank] += 1;
+
+ }
+
+ MPI_Alltoallv(send_glob_buffer, send_count, send_shift, FVM_MPI_GNUM,
+ recv_glob_buffer, recv_count, recv_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ /* Apply update to glob_vtx_tag */
+
+ for (i = 0; i < recv_shift[n_ranks]; i++) {
+ cs_int_t cur_id = recv2glob[i];
+ glob_vtx_tag[cur_id] = CS_MIN(glob_vtx_tag[cur_id], recv_glob_buffer[i]);
+ }
+
+ ret_value = _is_spread_not_converged(block_size,
+ prev_glob_vtx_tag,
+ glob_vtx_tag);
+
+ if (ret_value == false)
+ local_value = 0;
+ else
+ local_value = 1;
+
+ MPI_Allreduce(&local_value, &global_value, 1, MPI_INT, MPI_SUM, mpi_comm);
+
+ if (global_value > 0) { /* Store the current state as the previous one
+ Update local vtx_tag */
+
+ if (_glob_merge_counter > CS_JOIN_MERGE_MAX_GLOB_ITERS)
+ bft_error(__FILE__, __LINE__, 0,
+ _("\n The authorized maximum number of iterations "
+ " for the merge of vertices has been reached.\n"
+ " Global counter on iteration : %d (MAX =%d)\n"
+ " Check the fraction parameter.\n"),
+ _glob_merge_counter, CS_JOIN_MERGE_MAX_GLOB_ITERS);
+
+ for (i = 0; i < block_size; i++)
+ prev_glob_vtx_tag[i] = glob_vtx_tag[i];
+
+ for (i = 0; i < recv_shift[n_ranks]; i++)
+ recv_glob_buffer[i] = glob_vtx_tag[recv2glob[i]];
+
+ MPI_Alltoallv(recv_glob_buffer, recv_count, recv_shift, FVM_MPI_GNUM,
+ send_glob_buffer, send_count, send_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ /* Update vtx_tag */
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ assert(send_shift[n_ranks] == n_vertices);
+
+ for (i = 0; i < n_vertices; i++) {
+
+ int rank = (work->vertices[i].gnum - 1) % n_ranks;
+ cs_int_t shift = send_shift[rank] + send_count[rank];
+
+ vtx_tag[i] = CS_MIN(send_glob_buffer[shift], vtx_tag[i]);
+ send_count[rank] += 1;
+
+ }
+
+ return true;
+
+ } /* End if prev_glob_vtx_tag != glob_vtx_tag */
+
+ else
+ return false; /* No need to continue */
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize and allocate buffers for the tag operation in parallel mode.
+ *
+ * parameters:
+ * n_g_vertices_to_treat <-- global number of vertices to consider for the
+ * merge operation (existing + created vertices)
+ * work <-- local cs_join_mesh_t structure which has
+ * initial vertex data
+ * p_block_size <-> size of block for the current rank
+ * p_send_count <-> buf. for counting the number of elts to send
+ * p_send_shift <-> index on ranks of the elements to send
+ * p_send_glob_buf <-> buf. for saving elements to send
+ * p_recv_count <-> buf. for counting the number of elts to receive
+ * p_recv_shift <-> index on ranks of the elements to receive
+ * p_recv_glob_buf <-> buf. for storing elements to receive
+ * p_recv2glob <-> buf. for putting correctly received elements
+ * p_glob_vtx_tag <-> vtx_tag locally treated (size = block_size)
+ * p_prev_glob_vtx_tag <-> idem but for the previous iteration
+ *---------------------------------------------------------------------------*/
+
+static void
+_parall_tag_init(fvm_gnum_t n_g_vertices_to_treat,
+ const cs_join_mesh_t *work,
+ cs_int_t *p_block_size,
+ cs_int_t *p_send_count[],
+ cs_int_t *p_send_shift[],
+ fvm_gnum_t *p_send_glob_buf[],
+ cs_int_t *p_recv_count[],
+ cs_int_t *p_recv_shift[],
+ fvm_gnum_t *p_recv_glob_buf[],
+ fvm_gnum_t *p_recv2glob[],
+ fvm_gnum_t *p_glob_vtx_tag[],
+ fvm_gnum_t *p_prev_glob_vtx_tag[])
+{
+ cs_int_t i;
+
+ cs_int_t n_vertices = work->n_vertices;
+ cs_int_t block_size = 0, left_over = 0;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ fvm_gnum_t *recv2glob = NULL;
+ fvm_gnum_t *recv_glob_buffer = NULL, *send_glob_buffer = NULL;
+ fvm_gnum_t *glob_vtx_tag = NULL, *prev_glob_vtx_tag = NULL;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+
+ /* Allocate and intialize vtx_tag associated to the local rank */
+
+ block_size = n_g_vertices_to_treat / n_ranks;
+ left_over = n_g_vertices_to_treat % n_ranks;
+ if (local_rank < left_over)
+ block_size += 1;
+
+ BFT_MALLOC(glob_vtx_tag, block_size, fvm_gnum_t);
+ BFT_MALLOC(prev_glob_vtx_tag, block_size, fvm_gnum_t);
+
+ for (i = 0; i < block_size; i++) {
+ prev_glob_vtx_tag[i] = i*n_ranks + local_rank + 1;
+ glob_vtx_tag[i] = i*n_ranks + local_rank + 1;
+ }
+
+ /* Allocate and define send/recv_count/shift */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+ int rank = (work->vertices[i].gnum - 1) % n_ranks;
+ send_count[rank] += 1;
+ }
+
+ MPI_Alltoall(&(send_count[0]), 1, FVM_MPI_LNUM,
+ &(recv_count[0]), 1, FVM_MPI_LNUM, mpi_comm);
+
+ /* Build index */
+
+ for (i = 0; i < n_ranks; i++) {
+ send_shift[i+1] = send_shift[i] + send_count[i];
+ recv_shift[i+1] = recv_shift[i] + recv_count[i];
+ }
+
+ assert(send_shift[n_ranks] == n_vertices);
+
+ /* Allocate and define recv2glob */
+
+ BFT_MALLOC(send_glob_buffer, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv2glob, recv_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv_glob_buffer, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+
+ int rank = (work->vertices[i].gnum - 1) % n_ranks;
+ cs_int_t shift = send_shift[rank] + send_count[rank];
+
+ send_glob_buffer[shift] = (work->vertices[i].gnum - 1) / n_ranks;
+ send_count[rank] += 1;
+
+ }
+
+ MPI_Alltoallv(send_glob_buffer, send_count, send_shift, FVM_MPI_GNUM,
+ recv2glob, recv_count, recv_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ /* Return pointers */
+
+ *p_block_size = block_size;
+ *p_send_count = send_count;
+ *p_recv_count = recv_count;
+ *p_send_shift = send_shift;
+ *p_recv_shift = recv_shift;
+ *p_send_glob_buf = send_glob_buffer;
+ *p_recv_glob_buf = recv_glob_buffer;
+ *p_recv2glob = recv2glob;
+ *p_glob_vtx_tag = glob_vtx_tag;
+ *p_prev_glob_vtx_tag = prev_glob_vtx_tag;
+
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Tag with the same number all the vertices which might be merged together
+ *
+ * parameters:
+ * n_g_vertices_tot <-- global number of vertices to consider for the
+ * merge operation (existing + created vertices)
+ * vtx_eset <-- structure dealing with vertex equivalences
+ * work <-- local cs_join_mesh_t structure which has initial
+ * vertex data
+ * verbosity <-- level of accuracy in information display
+ * p_vtx_tag --> pointer to the vtx_tag for the local vertices
+ *---------------------------------------------------------------------------*/
+
+static void
+_tag_equiv_vertices(fvm_gnum_t n_g_vertices_tot,
+ const cs_join_eset_t *vtx_eset,
+ const cs_join_mesh_t *work,
+ int verbosity,
+ fvm_gnum_t *p_vtx_tag[])
+{
+ cs_int_t i;
+
+ fvm_gnum_t *vtx_tag = NULL;
+ fvm_gnum_t *prev_vtx_tag = NULL;
+
+ const cs_int_t n_vertices = work->n_vertices;
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* Local initialization : we tag each vertex by its global number */
+
+ BFT_MALLOC(prev_vtx_tag, n_vertices, fvm_gnum_t);
+ BFT_MALLOC(vtx_tag, n_vertices, fvm_gnum_t);
+
+ for (i = 0; i < work->n_vertices; i++) {
+
+ fvm_gnum_t v_gnum = work->vertices[i].gnum;
+
+ vtx_tag[i] = v_gnum;
+ prev_vtx_tag[i] = v_gnum;
+
+ }
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ for (i = 0; i < n_vertices; i++)
+ bft_printf(" Initial vtx_tag[%6d] = %9u\n", i, vtx_tag[i]);
+ bft_printf_flush();
+#endif
+
+ /* Compute vtx_tag */
+
+ _local_spread(vtx_eset, n_vertices, prev_vtx_tag, vtx_tag);
+
+ if (n_ranks > 1) { /* Parallel treatment */
+
+ cs_bool_t go_on;
+
+ cs_int_t block_size = 0;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ fvm_gnum_t *recv2glob = NULL;
+ fvm_gnum_t *recv_glob_buffer = NULL, *send_glob_buffer = NULL;
+ fvm_gnum_t *glob_vtx_tag = NULL, *prev_glob_vtx_tag = NULL;
+
+#if defined(HAVE_MPI)
+ _parall_tag_init(n_g_vertices_tot,
+ work,
+ &block_size,
+ &send_count, &send_shift, &send_glob_buffer,
+ &recv_count, &recv_shift, &recv_glob_buffer,
+ &recv2glob,
+ &glob_vtx_tag,
+ &prev_glob_vtx_tag);
+
+ go_on = _global_spread(block_size,
+ work,
+ vtx_tag,
+ glob_vtx_tag,
+ prev_glob_vtx_tag,
+ recv2glob,
+ send_count, send_shift, send_glob_buffer,
+ recv_count, recv_shift, recv_glob_buffer);
+
+ while (go_on == true) {
+
+ /* Local convergence of vtx_tag */
+
+ _local_spread(vtx_eset, n_vertices, prev_vtx_tag, vtx_tag);
+
+ /* Global update and test to continue */
+
+ go_on = _global_spread(block_size,
+ work,
+ vtx_tag,
+ glob_vtx_tag,
+ prev_glob_vtx_tag,
+ recv2glob,
+ send_count, send_shift, send_glob_buffer,
+ recv_count, recv_shift, recv_glob_buffer);
+
+ }
+
+ /* Partial free */
+
+ BFT_FREE(glob_vtx_tag);
+ BFT_FREE(prev_glob_vtx_tag);
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(send_glob_buffer);
+ BFT_FREE(recv_count);
+ BFT_FREE(recv_shift);
+ BFT_FREE(recv2glob);
+ BFT_FREE(recv_glob_buffer);
+
+#endif
+ } /* End of parallel treatment */
+
+ BFT_FREE(prev_vtx_tag);
+
+ if (verbosity > 2) {
+ bft_printf(_("\n Number of local iterations to converge on vertex"
+ " equivalences: %3d\n"), _loc_merge_counter);
+ if (n_ranks > 1)
+ bft_printf(_(" Number of global iterations to converge on vertex"
+ " equivalences: %3d\n\n"), _glob_merge_counter);
+ bft_printf_flush();
+ }
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ for (i = 0; i < n_vertices; i++)
+ bft_printf(" Final vtx_tag[%6d] = %9u\n", i, vtx_tag[i]);
+ bft_printf_flush();
+#endif
+
+ /* Returns pointer */
+
+ *p_vtx_tag = vtx_tag;
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Build in parallel a cs_join_gset_t structure to store all the potential
+ * merges between vertices and its associated cs_join_vertex_t structure.
+ *
+ * parameters:
+ * work <-- local cs_join_mesh_t structure which
+ * has initial vertex data
+ * vtx_tag <-- local vtx_tag for the local vertices
+ * send_count <-> buffer used to count the number of elts to send
+ * send_shift <-> index on ranks of the elements to send
+ * recv_count <-> buffer used to count the number of elts to receive
+ * recv_shift <-> index on ranks of the elements to receive
+ * p_vtx_merge_data <-> a pointer to a cs_join_vertex_t structure which
+ * stores data about merged vertices
+ * p_merge_set <-> pointer to a cs_join_gset_t struct. storing the
+ * evolution of each global vtx number
+ *---------------------------------------------------------------------------*/
+
+static void
+_build_parall_merge_structures(const cs_join_mesh_t *work,
+ const fvm_gnum_t vtx_tag[],
+ cs_int_t send_count[],
+ cs_int_t send_shift[],
+ cs_int_t recv_count[],
+ cs_int_t recv_shift[],
+ cs_join_vertex_t *p_vtx_merge_data[],
+ cs_join_gset_t **p_merge_set)
+{
+ cs_int_t i;
+
+ cs_int_t n_vertices = work->n_vertices;
+ fvm_gnum_t *recv_gbuf = NULL, *send_gbuf = NULL;
+ cs_join_vertex_t *send_vtx_data = NULL, *recv_vtx_data = NULL;
+ cs_join_gset_t *merge_set = NULL;
+
+ MPI_Datatype CS_MPI_JOIN_VERTEX = cs_join_mesh_create_vtx_datatype();
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+ int rank = (vtx_tag[i] - 1) % n_ranks;
+ send_count[rank] += 1;
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ /* Build index */
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (i = 0; i < n_ranks; i++) {
+ send_shift[i+1] = send_shift[i] + send_count[i];
+ recv_shift[i+1] = recv_shift[i] + recv_count[i];
+ }
+
+ assert(send_shift[n_ranks] == n_vertices);
+
+ /* Allocate and define recv_gbuf and send_gbuf */
+
+ BFT_MALLOC(send_gbuf, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv_gbuf, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+
+ int rank = (vtx_tag[i] - 1) % n_ranks;
+ cs_int_t shift = send_shift[rank] + send_count[rank];
+
+ send_gbuf[shift] = vtx_tag[i];
+ send_count[rank] += 1;
+
+ }
+
+ MPI_Alltoallv(send_gbuf, send_count, send_shift, FVM_MPI_GNUM,
+ recv_gbuf, recv_count, recv_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ /* Allocate and build send_vtx_data, receive recv_vtx_data. */
+
+ BFT_MALLOC(recv_vtx_data, recv_shift[n_ranks], cs_join_vertex_t);
+ BFT_MALLOC(send_vtx_data, send_shift[n_ranks], cs_join_vertex_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+
+ int rank = (vtx_tag[i] - 1) % n_ranks;
+ cs_int_t shift = send_shift[rank] + send_count[rank];
+
+ send_vtx_data[shift] = work->vertices[i];
+ send_count[rank] += 1;
+
+ }
+
+ MPI_Alltoallv(send_vtx_data, send_count, send_shift, CS_MPI_JOIN_VERTEX,
+ recv_vtx_data, recv_count, recv_shift, CS_MPI_JOIN_VERTEX,
+ mpi_comm);
+
+ /* Partial free memory */
+
+ BFT_FREE(send_vtx_data);
+ BFT_FREE(send_gbuf);
+ MPI_Type_free(&CS_MPI_JOIN_VERTEX);
+
+ /* Build merge set */
+
+ merge_set = cs_join_gset_create_from_tag(recv_shift[n_ranks], recv_gbuf);
+
+ cs_join_gset_sort_sublist(merge_set);
+
+ /* Free memory */
+
+ BFT_FREE(recv_gbuf);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n Number of vertices to treat for the merge step: %d\n",
+ recv_shift[n_ranks]);
+ bft_printf(" List of vertices to treat:\n");
+ for (i = 0; i < recv_shift[n_ranks]; i++) {
+ bft_printf(" %9d - ", i);
+ cs_join_mesh_dump_vertex(recv_vtx_data[i]);
+ }
+ bft_printf_flush();
+#endif
+
+ /* Set return pointers */
+
+ *p_merge_set = merge_set;
+ *p_vtx_merge_data = recv_vtx_data;
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange the updated cs_join_vertex_t array over the ranks.
+ *
+ * parameters:
+ * work <-- local cs_join_mesh_t structure which
+ * has initial vertex data
+ * vtx_tag <-- local vtx_tag for the local vertices
+ * send_count <-- buffer used to count the number of elts to send
+ * send_shift <-- index on ranks of the elements to send
+ * recv_count <-- buffer used to count the number of elts to receive
+ * recv_shift <-- index on ranks of the elements to receive
+ * vtx_merge_data <-- pointer to a cs_join_vertex_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_exchange_merged_vertices(const cs_join_mesh_t *work,
+ const fvm_gnum_t vtx_tag[],
+ cs_int_t send_count[],
+ cs_int_t send_shift[],
+ cs_int_t recv_count[],
+ cs_int_t recv_shift[],
+ cs_join_vertex_t vtx_merge_data[])
+{
+ cs_int_t i;
+
+ cs_join_vertex_t *updated_vtx_data = NULL;
+ int n_ranks = cs_glob_n_ranks;
+ MPI_Datatype cs_mpi_join_vertex = cs_join_mesh_create_vtx_datatype();
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ /* Allocate send_vtx_data and exchange vtx_merge_data */
+
+ BFT_MALLOC(updated_vtx_data, send_shift[n_ranks], cs_join_vertex_t);
+
+ MPI_Alltoallv(vtx_merge_data, recv_count, recv_shift, cs_mpi_join_vertex,
+ updated_vtx_data, send_count, send_shift, cs_mpi_join_vertex,
+ mpi_comm);
+
+ /* Replace work->vertices by the updated structure after merge
+ of vertices */
+
+ assert(send_shift[n_ranks] == work->n_vertices);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < work->n_vertices; i++) {
+
+ int rank = (vtx_tag[i] - 1) % n_ranks;
+ cs_int_t shift = send_shift[rank] + send_count[rank];
+
+ work->vertices[i] = updated_vtx_data[shift];
+ send_count[rank] += 1;
+
+ }
+
+ /* Free memory */
+
+ MPI_Type_free(&cs_mpi_join_vertex);
+ BFT_FREE(updated_vtx_data);
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Check if all vertices in the list include the target_vertex in their
+ * tolerance.
+ *
+ * If check is ok, no need to apply a reduction of the tolerance.
+ *
+ * parameters:
+ * start <-- index for the last vertex in id_lst
+ * end <-- index for the last vertex in id_lst
+ * list <-- list of id in vertices
+ * vertices <-- pointer to an array of cs_join_vertex_t structures
+ * ref_vertex <-- vertex resulting of the merge
+ *
+ * returns:
+ * true if all vertices have ref_vertex in their tolerance, false otherwise
+ *---------------------------------------------------------------------------*/
+
+static cs_bool_t
+_is_in_tolerance(cs_int_t start,
+ cs_int_t end,
+ const fvm_gnum_t list[],
+ const cs_join_vertex_t vertices[],
+ cs_join_vertex_t ref_vertex)
+{
+ cs_int_t i;
+
+ for (i = start; i < end; i++) {
+
+ cs_join_vertex_t cur_vertex = vertices[list[i]];
+ cs_real_t d_cur_ref = _compute_length(cur_vertex, ref_vertex);
+ cs_real_t tolerance = cur_vertex.tolerance * cs_join_tol_eps_coef2;
+
+ if (d_cur_ref > tolerance)
+ return false;
+
+ } /* End of loop on each vertex of the list */
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the resulting cs_join_vertex_t structure after the merge of a list
+ * of vertices.
+ *
+ * parameters:
+ * ref_gnum <-- global number associated to the current list of vertices
+ * start <-- index for the first vertex in id_list
+ * end <-- index for the last vertex in id_list
+ * list <-- list of id in vertices array
+ * vertices <-- array of cs_join_vertex_t structures
+ *
+ * returns:
+ * a cs_join_vertex_t structure for the resulting vertex
+ *---------------------------------------------------------------------------*/
+
+static cs_join_vertex_t
+_get_merged_vertex(fvm_gnum_t ref_gnum,
+ cs_int_t start,
+ cs_int_t end,
+ const fvm_gnum_t list[],
+ const cs_join_vertex_t vertices[])
+{
+ cs_int_t i, k;
+ cs_join_vertex_t merged_vertex;
+
+ cs_int_t n_elts = end - start;
+
+ /* Initialize cs_join_vertex_t structure */
+
+ merged_vertex.gnum = ref_gnum;
+ merged_vertex.tolerance = vertices[list[start]].tolerance;
+
+ /* Compute the resulting vertex data of the merge */
+
+ for (i = start; i < end; i++)
+ merged_vertex.tolerance = CS_MIN(vertices[list[i]].tolerance,
+ merged_vertex.tolerance);
+
+ assert(n_elts > 0);
+
+ /* Compute the resulting coordinates of the merged vertices */
+
+ for (k = 0; k < 3; k++)
+ merged_vertex.coord[k] = 0.0;
+
+#if CS_JOIN_MERGE_INV_TOL
+ {
+ cs_real_t denum = 0.0;
+
+ for (i = start; i < end; i++)
+ denum += 1.0/vertices[list[i]].tolerance;
+
+ for (k = 0; k < 3; k++) {
+
+ for (i = start; i < end; i++)
+ merged_vertex.coord[k] +=
+ 1.0/vertices[list[i]].tolerance * vertices[list[i]].coord[k];
+
+ merged_vertex.coord[k] /= denum;
+
+ } /* End of loop on coordinates */
+
+ }
+#else
+
+ for (k = 0; k < 3; k++) {
+
+ for (i = start; i < end; i++)
+ merged_vertex.coord[k] += vertices[list[i]].coord[k];
+ merged_vertex.coord[k] /= n_elts;
+
+ }
+#endif
+
+ return merged_vertex;
+}
+
+/*----------------------------------------------------------------------------
+ * Merge between identical vertices.
+ *
+ * Only the vertex numbering and the related tolerance may be different.
+ * Store new data associated to the merged vertices in vertices array.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters
+ * merge_set <-> a pointer to a cs_join_vertex_t structure which
+ * stores data about merged vertices
+ * n_vertices <-- number of vertices in vertices array
+ * vertices <-> array of cs_join_vertex_t structures
+ * equiv_gnum --> equivalence between id in vertices (same global number
+ * initially or identical vertices: same coordinates)
+ *---------------------------------------------------------------------------*/
+
+static void
+_trivial_merge(cs_join_param_t param,
+ cs_join_gset_t *merge_set,
+ cs_join_vertex_t vertices[],
+ cs_join_gset_t **p_equiv_gnum)
+{
+ cs_int_t i, j, j1, j2, k, k1, k2, n_sub_elts;
+ cs_real_t delta;
+
+ cs_int_t max_n_sub_elts = 0;
+ cs_int_t *merge_index = merge_set->index;
+ fvm_gnum_t *merge_list = merge_set->g_list;
+ fvm_gnum_t *sub_list = NULL, *init_list = NULL;
+ cs_join_gset_t *equiv_gnum = NULL;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (param.verbosity > 2) {
+
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_InitMergeSet.dat")+1+2+4;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_InitMergeSet%04d.dat",
+ param.num, CS_MAX(cs_glob_rank_id, 0));
+ dbg_file = fopen(filename, "w");
+
+ cs_join_gset_dump(dbg_file, merge_set);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+
+ }
+#endif
+
+ /* Compute the max. size of a sub list */
+
+ for (i = 0; i < merge_set->n_elts; i++)
+ max_n_sub_elts = CS_MAX(max_n_sub_elts,
+ merge_index[i+1] - merge_index[i]);
+
+ BFT_MALLOC(sub_list, max_n_sub_elts, fvm_gnum_t);
+
+ /* Store initial merge list */
+
+ BFT_MALLOC(init_list, merge_index[merge_set->n_elts], fvm_gnum_t);
+
+ for (i = 0; i < merge_index[merge_set->n_elts]; i++)
+ init_list[i] = merge_list[i];
+
+ /* Apply merge */
+
+ for (i = 0; i < merge_set->n_elts; i++) {
+
+ cs_int_t f_s = merge_index[i];
+ cs_int_t f_e = merge_index[i+1];
+
+ n_sub_elts = f_e - f_s;
+
+ for (j = f_s, k = 0; j < f_e; j++, k++)
+ sub_list[k] = merge_list[j];
+
+ for (j1 = 0; j1 < n_sub_elts - 1; j1++) {
+
+ cs_int_t v1_id = sub_list[j1];
+ cs_join_vertex_t v1 = vertices[v1_id];
+
+ for (j2 = j1 + 1; j2 < n_sub_elts; j2++) {
+
+ cs_int_t v2_id = sub_list[j2];
+ cs_join_vertex_t v2 = vertices[v2_id];
+
+ if (v1.gnum == v2.gnum) { /* Possible if n_ranks > 1 */
+
+ if (sub_list[j1] < sub_list[j2])
+ k1 = j1, k2 = j2;
+ else
+ k1 = j2, k2 = j1;
+
+ for (k = 0; k < n_sub_elts; k++)
+ if (sub_list[k] == sub_list[k2])
+ sub_list[k] = sub_list[k1];
+
+ }
+ else {
+
+ if (fabs(v1.tolerance - v2.tolerance) < 1e-30) {
+
+ delta = 0.0;
+ for (k = 0; k < 3; k++)
+ delta += v1.coord[k] - v2.coord[k];
+
+ if (fabs(delta) < 1e-30) { /* Identical vertices */
+
+ if (v1.gnum < v2.gnum)
+ k1 = j1, k2 = j2;
+ else
+ k1 = j2, k2 = j1;
+
+ for (k = 0; k < n_sub_elts; k++)
+ if (sub_list[k] == sub_list[k2])
+ sub_list[k] = sub_list[k1];
+
+ } /* End if delta == 0.0 */
+
+ } /* End if v1.tol != v2.tol */
+
+ } /* v1.gnum != v2.gnum */
+
+ } /* End of loop on j2 */
+ } /* End of loop on j1 */
+
+ /* Update vertices */
+
+ for (j = f_s, k = 0; j < f_e; j++, k++)
+ vertices[merge_list[j]] = vertices[sub_list[k]];
+
+ /* Update merge list */
+
+ for (j = f_s, k = 0; j < f_e; j++, k++)
+ merge_list[j] = sub_list[k];
+
+ } /* End of loop on merge_set elements */
+
+ /* Keep equivalences between identical vertices in equiv_gnum */
+
+ equiv_gnum = cs_join_gset_create_by_equiv(merge_set, init_list);
+
+ /* Clean merge set */
+
+ cs_join_gset_clean(merge_set);
+
+ /* Free memory */
+
+ BFT_FREE(sub_list);
+ BFT_FREE(init_list);
+
+ /* Return pointer */
+
+ *p_equiv_gnum = equiv_gnum;
+}
+
+/*----------------------------------------------------------------------------
+ * Apply the tolerance reduction until each vertex of the list has
+ * a resulting vertex under its tolerance.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters
+ * start <-- index for the last vertex in sub_list
+ * end <-- index for the last vertex in sub_list
+ * list <-- list of id in vertices
+ * vertices <-> pointer to a cs_join_vertex_t structure
+ * distances <-- list of distance between couples of vertices
+ * ref_tags <-> list of reference tags for each vertex of sub_list
+ * work_tags <-> list of working tags for each vertex of sub_list
+ * bool_lst <-> list of booleans
+ * n_reductions <-> number of tolerance reduction done
+ *---------------------------------------------------------------------------*/
+
+static void
+_reduce_tolerance(cs_join_param_t param,
+ cs_int_t start,
+ cs_int_t end,
+ const fvm_gnum_t list[],
+ cs_join_vertex_t vertices[],
+ const cs_real_t distances[],
+ fvm_gnum_t ref_tags[],
+ fvm_gnum_t work_tags[],
+ cs_bool_t bool_lst[],
+ int *n_reductions)
+{
+ cs_int_t i;
+
+ cs_bool_t reduc_tol = true;
+
+ while (reduc_tol == true) {
+
+ cs_int_t i1, i2, shift;
+
+ *n_reductions += 1;
+
+ if (*n_reductions > CS_JOIN_MERGE_MAX_REDUCTIONS)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Max number of tolerance reductions has been reached.\n"
+ " Check your joining parameters.\n"));
+
+ /* Reduce tolerance by the constant "reduce_tol_factor" */
+
+ for (i = start; i < end; i++)
+ vertices[list[i]].tolerance *= param.reduce_tol_factor;
+
+ /* Define a boolean list on couples of vertices which are under
+ tolerance each other */
+
+ for (shift = 0, i1 = start; i1 < end - 1; i1++) {
+
+ cs_join_vertex_t v1 = vertices[list[i1]];
+
+ for (i2 = i1 + 1; i2 < end; i2++) {
+
+ cs_join_vertex_t v2 = vertices[list[i2]];
+
+ if (v2.tolerance < distances[shift] || v1.tolerance < distances[shift])
+ bool_lst[shift++] = false;
+ else
+ bool_lst[shift++] = true;
+
+ }
+
+ }
+
+ /* Update tag list according to the values of bool_lst */
+
+ for (i = start; i < end; i++)
+ work_tags[i] = ref_tags[i];
+
+ for (shift = 0, i1 = start; i1 < end - 1; i1++) {
+ for (i2 = i1 + 1; i2 < end; i2++) {
+
+ if (bool_lst[shift] == true) {
+
+ fvm_gnum_t _min = CS_MIN(work_tags[i1], work_tags[i2]);
+
+ work_tags[i1] = _min;
+ work_tags[i2] = _min;
+
+ }
+ shift++;
+
+ } /* End of loop on i2 */
+ } /* End of loop on i1 */
+
+ /* Check if the reduction of the tolerance is sufficient */
+
+ reduc_tol = false;
+
+ for (shift = 0, i1 = start; i1 < end - 1; i1++) {
+ for (i2 = i1 + 1; i2 < end; i2++) {
+
+ if (bool_lst[shift] == true) {
+ if (work_tags[i1] != work_tags[i2])
+ reduc_tol = true;
+ }
+ else {/* bool_lst = false */
+ if (work_tags[i1] == work_tags[i2])
+ reduc_tol = true;
+ }
+ shift++;
+
+ } /* End of loop on i2 */
+ } /* End of loop on i1 */
+
+ } /* End of while reduc_tol = true */
+
+ /* Store new equivalences between vertices in ref_tags */
+
+ for (i = start; i < end; i++) {
+ ref_tags[i] = work_tags[i];
+ work_tags[i] = i;
+ }
+
+ { /* Order ref_tags and keep the original position in work_tags */
+
+ int h, j;
+ cs_int_t n_sub_elts = end - start;
+
+ /* Compute stride */
+ for (h = 1; h <= n_sub_elts/9; h = 3*h+1) ;
+
+ /* Sort array */
+ for ( ; h > 0; h /= 3) {
+
+ for (i = start + h; i < end; i++) {
+
+ fvm_gnum_t vr = ref_tags[i];
+ fvm_gnum_t vw = work_tags[i];
+
+ j = i;
+ while ( (j >= start+h) && (vr < ref_tags[j-h]) ) {
+ ref_tags[j] = ref_tags[j-h];
+ work_tags[j] = work_tags[j-h];
+ j -= h;
+ }
+ ref_tags[j] = vr;
+ work_tags[j] = vw;
+
+ } /* Loop on array elements */
+
+ } /* End of loop on stride */
+
+ } /* End of sort */
+
+ for (i = start; i < end; i++)
+ work_tags[i] = list[work_tags[i]];
+
+}
+
+/*----------------------------------------------------------------------------
+ * Apply a reduction of the tolerance until each vertex of the list has
+ * the resulting vertex of the merge under its tolerance.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters
+ * start <-- index for the last vertex in sub_list
+ * end <-- index for the last vertex in sub_list
+ * sub_list <-> list of id in vertices for each vertex of the sub list
+ * vertices <-> pointer to a cs_join_vertex_t structure
+ * distances <-> list of distance between couples of vertices
+ * ref_tag_list <-> list of reference tags for each vertex of sub_list
+ * work_tag_list <-> list of working tags for each vertex of sub_list
+ * bool_lst <-> list of booleans
+ * n_reductions <-> number of tolerance reduction done
+ *---------------------------------------------------------------------------*/
+
+static void
+_merge_with_tol_reduction(cs_join_param_t param,
+ cs_int_t start,
+ cs_int_t end,
+ fvm_gnum_t sub_list[],
+ cs_join_vertex_t vertices[],
+ cs_real_t distances[],
+ fvm_gnum_t ref_tags[],
+ fvm_gnum_t work_tags[],
+ cs_bool_t bool_list[],
+ int *n_reductions)
+{
+ cs_int_t i1, i2, i, j;
+
+ cs_int_t shift = 0;
+ cs_int_t n_sub_equiv = 1;
+ cs_int_t n_sub_elts = end - start;
+ cs_int_t *sub_index = NULL;
+
+ /* Sanity checks */
+
+ assert(param.reduce_tol_factor >= 0.0);
+ assert(param.reduce_tol_factor < 1.0);
+
+ if (param.verbosity > 2) { /* Display information */
+
+ bft_printf(_("\n"
+ " Merge: Local tolerance reduction for the"
+ " following vertices (global numbering):\n"
+ " "));
+ for (j = start; j < end; j++)
+ bft_printf("%u ", vertices[sub_list[j]].gnum);
+ bft_printf("\n");
+ }
+
+ /* Initialize temporary buffers */
+
+ for (i = start; i < end; i++)
+ ref_tags[i] = vertices[sub_list[i]].gnum;
+
+ for (i1 = start; i1 < end - 1; i1++)
+ for (i2 = i1 + 1; i2 < end; i2++)
+ distances[shift++] = _compute_length(vertices[sub_list[i1]],
+ vertices[sub_list[i2]]);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\t\t\t (BEGIN) Reduce tolerance\n");
+ cs_join_dump_array("gnum", "sub_list", n_sub_elts, &(sub_list[start]));
+ cs_join_dump_array("gnum", "ref_tags", n_sub_elts, &(ref_tags[start]));
+ shift = 0;
+ bft_printf("\n distances:\n");
+ for (i1 = start; i1 < end - 1; i1++) {
+ bft_printf(" %10u : ", ref_tags[i1]);
+ for (i2 = i1+1; i2 < end; i2++)
+ bft_printf(" (%10u, %le)", ref_tags[i2], distances[shift++]);
+ bft_printf("\n");
+ }
+ bft_printf("\n");
+ bft_printf_flush();
+#endif
+
+ /* Reduce tolerance until coherent sub-equivalences appear.
+ Local operation. */
+
+ _reduce_tolerance(param,
+ start,
+ end,
+ sub_list,
+ vertices,
+ distances,
+ ref_tags,
+ work_tags,
+ bool_list,
+ n_reductions);
+
+ /* Define an index on new sub equivalences */
+
+ BFT_MALLOC(sub_index, n_sub_elts+1, cs_int_t);
+
+ sub_index[0] = start;
+ sub_index[n_sub_equiv] = start + 1;
+
+ for (i = start + 1; i < end; i++) {
+
+ if (ref_tags[i] != ref_tags[i-1]) {
+ sub_index[n_sub_equiv + 1] = sub_index[n_sub_equiv] + 1;
+ n_sub_equiv++;
+ }
+ else
+ sub_index[n_sub_equiv] += 1;
+
+ }
+
+ assert(n_sub_equiv > 1);
+
+ /* Loop on sub-equivalences */
+
+ for (i = 0; i < n_sub_equiv; i++) {
+
+ cs_bool_t ok;
+ cs_join_vertex_t merged_vertex;
+
+ cs_int_t sub_start = sub_index[i];
+ cs_int_t sub_end = sub_index[i+1];
+
+ /* Define a sub_list */
+
+ for (j = sub_start; j < sub_end; j++)
+ sub_list[j] = work_tags[j];
+
+ if (sub_end - sub_start > 1) {
+
+ merged_vertex = _get_merged_vertex(ref_tags[sub_start],
+ sub_start,
+ sub_end,
+ sub_list,
+ vertices);
+
+ /* Check if the vertex resulting of the merge is in the tolerance
+ for each vertex of the list. Previous op. should assume this. */
+
+ ok = _is_in_tolerance(sub_start,
+ sub_end,
+ sub_list,
+ vertices,
+ merged_vertex);
+
+ assert(ok == true); /* One call to _reduce_tolerance should be enough */
+
+ for (j = sub_start; j < sub_end; j++)
+ vertices[sub_list[j]] = merged_vertex;
+
+ } /* n_sub_sub_list > 1 */
+
+ } /* End of loop on sub-equivalences */
+
+ BFT_FREE(sub_index);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Merge between vertices. Store new data associated to the merged vertices
+ * in vertices.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters
+ * merge_set <-> a pointer to a cs_join_vertex_t structure which
+ * stores data about merged vertices
+ * n_vertices <-- number of vertices in vertices array
+ * vertices <-> array of cs_join_vertex_t structures
+ *---------------------------------------------------------------------------*/
+
+static void
+_merge_vertices(cs_join_param_t param,
+ cs_join_gset_t *merge_set,
+ cs_int_t n_vertices,
+ cs_join_vertex_t vertices[])
+{
+ cs_int_t i, j, k, tmp_size, n_sub_elts;
+ cs_join_vertex_t merged_vertex;
+ cs_bool_t ok;
+
+ int n_reduction_counter = 0, n_max_tol_reductions = 0;
+ cs_int_t max_n_sub_elts = 0;
+
+ cs_join_gset_t *equiv_gnum = NULL;
+ cs_bool_t *bool_list = NULL;
+ cs_int_t *merge_index = NULL;
+ fvm_gnum_t *merge_list = NULL, *merge_ref_elts = NULL;
+ fvm_gnum_t *sub_list = NULL, *tmp_buffer = NULL;
+ fvm_gnum_t *ref_tags = NULL, *work_tags = NULL;
+ cs_real_t *distances = NULL;
+
+ const int verbosity = param.verbosity;
+
+ /* Sanity check */
+
+ assert(param.merge_tol_coef >= 0.0);
+
+ /* Pre-merge of identical vertices */
+
+ _trivial_merge(param, merge_set, vertices, &equiv_gnum);
+
+ merge_index = merge_set->index;
+ merge_list = merge_set->g_list;
+ merge_ref_elts = merge_set->g_elts;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+
+ if (verbosity > 2) {
+
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_MergeSet.dat")+1+2+4;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_MergeSet%04d.dat",
+ param.num, CS_MAX(cs_glob_rank_id, 0));
+ dbg_file = fopen(filename, "w");
+
+ cs_join_gset_dump(dbg_file, merge_set);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+
+ }
+
+#endif /* defined(DEBUG) && !defined(NDEBUG) */
+
+ /* Compute the max. size of a sub list */
+
+ for (i = 0; i < merge_set->n_elts; i++) {
+ n_sub_elts = merge_index[i+1] - merge_index[i];
+ max_n_sub_elts = CS_MAX(max_n_sub_elts, n_sub_elts);
+ }
+
+ /* Modify the tolerance for the merge operation if needed */
+
+ if (fabs(param.merge_tol_coef - 1.0) > 1e-30) {
+ for (i = 0; i < n_vertices; i++)
+ vertices[i].tolerance *= param.merge_tol_coef;
+ }
+
+ /* Compute the max. size of a sub list */
+
+ for (i = 0; i < merge_set->n_elts; i++) {
+ n_sub_elts = merge_index[i+1] - merge_index[i];
+ max_n_sub_elts = CS_MAX(max_n_sub_elts, n_sub_elts);
+ }
+
+ if (verbosity > 0) { /* Display information */
+
+ fvm_lnum_t g_max_n_sub_elts = max_n_sub_elts;
+ fvm_parall_counter_max(&g_max_n_sub_elts, 1);
+
+ if (g_max_n_sub_elts < 2) {
+ bft_printf(_("\n No need to merge vertices.\n"));
+ return;
+ }
+ else
+ bft_printf(_("\n Max size of a merge list: %lu\n"),
+ (unsigned long)g_max_n_sub_elts);
+ }
+
+ /* Temporary buffers */
+
+ BFT_MALLOC(tmp_buffer, 3*max_n_sub_elts, fvm_gnum_t);
+
+ sub_list = tmp_buffer;
+ ref_tags = &(tmp_buffer[max_n_sub_elts]);
+ work_tags = &(tmp_buffer[2*max_n_sub_elts]);
+
+ tmp_size = ((max_n_sub_elts-1)*max_n_sub_elts)/2;
+ BFT_MALLOC(distances, tmp_size, cs_real_t);
+ BFT_MALLOC(bool_list, tmp_size, cs_bool_t);
+
+ /* Apply merge */
+
+ for (i = 0; i < merge_set->n_elts; i++) {
+
+ n_sub_elts = merge_index[i+1] - merge_index[i];
+
+ if (n_sub_elts > 1) {
+
+ for (k = merge_index[i], j = 0; k < merge_index[i+1]; k++, j++)
+ sub_list[j] = merge_list[k];
+
+ if (verbosity > 2) { /* Display information */
+
+ bft_printf("\n Begin merge for ref. elt: %u - n_sub_elts: %d\n",
+ merge_ref_elts[i], merge_index[i+1] - merge_index[i]);
+ for (j = 0; j < n_sub_elts; j++) {
+ bft_printf("%9u -", sub_list[j]);
+ cs_join_mesh_dump_vertex(vertices[sub_list[j]]);
+ }
+ bft_printf("\n");
+
+ }
+
+ /* Define the resulting cs_join_vertex_t structure of the merge */
+
+ merged_vertex = _get_merged_vertex(merge_ref_elts[i],
+ 0, n_sub_elts,
+ sub_list,
+ vertices);
+
+ /* Check if the vertex resulting of the merge is in the tolerance
+ for each vertex of the list */
+
+ ok = _is_in_tolerance(0, n_sub_elts, sub_list, vertices, merged_vertex);
+
+#if CS_JOIN_MERGE_TOL_REDUC
+
+ if (ok == false) { /* Reduction of the tolerance is necessary */
+
+ int n_tol_reductions = 0;
+
+ n_reduction_counter += 1;
+
+ _merge_with_tol_reduction(param,
+ 0,
+ n_sub_elts,
+ sub_list,
+ vertices,
+ distances,
+ ref_tags,
+ work_tags,
+ bool_list,
+ &n_tol_reductions);
+
+ if (verbosity > 1) /* Display information */
+ bft_printf(_("\n Number of tolerance reductions: %4d\n"),
+ n_tol_reductions);
+
+ n_max_tol_reductions = CS_MAX(n_max_tol_reductions,
+ n_tol_reductions);
+
+ }
+
+ else /* New vertex data for the sub-elements */
+
+#endif /* CS_JOIN_MERGE_TOL_REDUC */
+
+ for (j = 0; j < n_sub_elts; j++)
+ vertices[sub_list[j]] = merged_vertex;
+
+ if (verbosity > 2) { /* Display information */
+
+ bft_printf("\n End merge for ref. elt: %u - n_sub_elts: %d\n",
+ merge_ref_elts[i], merge_index[i+1] - merge_index[i]);
+ for (j = 0; j < n_sub_elts; j++) {
+ bft_printf("%7u -", sub_list[j]);
+ cs_join_mesh_dump_vertex(vertices[sub_list[j]]);
+ }
+ bft_printf("\n");
+
+ }
+
+ } /* sub_list_size > 1 */
+
+ } /* End of loop on potential merges */
+
+ /* Apply merge to vertex initially identical */
+
+ if (equiv_gnum != NULL) {
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+
+ if (verbosity > 2) {
+
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_EquivMerge.dat")+1+2+4;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_EquivMerge%04d.dat",
+ param.num, CS_MAX(cs_glob_rank_id, 0));
+ dbg_file = fopen(filename, "w");
+
+ cs_join_gset_dump(dbg_file, equiv_gnum);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+
+ }
+
+#endif /* defined(DEBUG) && !defined(NDEBUG) */
+
+ for (i = 0; i < equiv_gnum->n_elts; i++) {
+
+ cs_int_t start = equiv_gnum->index[i];
+ cs_int_t end = equiv_gnum->index[i+1];
+ cs_int_t ref_id = equiv_gnum->g_elts[i];
+
+ for (j = start; j < end; j++)
+ vertices[equiv_gnum->g_list[j]] = vertices[ref_id];
+
+ }
+ }
+
+ if (verbosity > 0) {
+
+ fvm_gnum_t n_g_reduction_counter = n_reduction_counter;
+ fvm_parall_counter(&n_g_reduction_counter, 1);
+
+ bft_printf(_("\n Tolerance reduction for %lu elements.\n"),
+ (unsigned long)n_g_reduction_counter);
+
+ if (verbosity > 1) {
+ fvm_lnum_t g_n_max_tol_reductions = n_max_tol_reductions;
+ fvm_parall_counter_max(&g_n_max_tol_reductions, 1);
+ bft_printf(_("\n Max. number of tolerance reductions: %lu\n"),
+ (unsigned long)g_n_max_tol_reductions);
+ }
+ }
+
+ /* Free memory */
+
+ BFT_FREE(tmp_buffer);
+ BFT_FREE(distances);
+ BFT_FREE(bool_list);
+
+ cs_join_gset_destroy(&equiv_gnum);
+}
+
+/*----------------------------------------------------------------------------
+ * Keep an history of the evolution of each vertex id before/after the merge
+ * operation.
+ *
+ * parameters:
+ * n_iwm_vertices <-- number of vertices before intersection for the work
+ * cs_join_mesh_t structure
+ * n_g_ifm_vertices <-- global number of vertices on the initial full mesh
+ * iwm_vtx_gnum <-- initial global vertex num. (work mesh struct.)
+ * n_vertices <-- number of vertices before merge/after intersection
+ * vertices <-- array of cs_join_vertex_t structures
+ * p_o2n_vtx_gnum --> distributed array by block on the new global vertex
+ * numbering for the initial vertices (before inter.)
+ *---------------------------------------------------------------------------*/
+
+static void
+_keep_global_vtx_evolution(cs_int_t n_iwm_vertices,
+ fvm_gnum_t n_g_ifm_vertices,
+ const fvm_gnum_t iwm_vtx_gnum[],
+ cs_int_t n_vertices,
+ const cs_join_vertex_t vertices[],
+ fvm_gnum_t *p_o2n_vtx_gnum[])
+{
+ cs_int_t i;
+ cs_join_block_info_t block_info;
+
+ int n_ranks = cs_glob_n_ranks;
+ fvm_gnum_t *o2n_vtx_gnum = NULL;
+
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+
+ assert(n_iwm_vertices <= n_vertices); /* after inter. >= init */
+
+ block_info = cs_join_get_block_info(n_g_ifm_vertices,
+ n_ranks,
+ local_rank);
+
+ BFT_MALLOC(o2n_vtx_gnum, block_info.local_size, fvm_gnum_t);
+
+ if (n_ranks == 1) {
+
+ for (i = 0; i < n_iwm_vertices; i++)
+ o2n_vtx_gnum[i] = vertices[i].gnum;
+
+ /* Return pointer */
+
+ *p_o2n_vtx_gnum = o2n_vtx_gnum;
+
+ return;
+ }
+
+#if defined(HAVE_MPI) /* Parallel treatment */
+ {
+ fvm_gnum_t ii;
+ cs_int_t shift, rank, n_recv_elts;
+
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ fvm_gnum_t *send_glist = NULL, *recv_glist = NULL;
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ /* Initialize o2n_vtx_gnum */
+
+ for (ii = 0; ii < block_info.local_size; ii++)
+ o2n_vtx_gnum[ii] = block_info.first_gnum + ii;
+
+ /* Send new vtx global number to the related rank = the good block */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_iwm_vertices; i++) {
+ rank = (iwm_vtx_gnum[i] - 1)/block_info.size;
+ send_count[rank] += 2;
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ assert(send_shift[n_ranks] == 2*n_iwm_vertices);
+
+ /* Build send_list */
+
+ BFT_MALLOC(send_glist, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv_glist, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_iwm_vertices; i++) {
+
+ rank = (iwm_vtx_gnum[i] - 1)/block_info.size;
+ shift = send_shift[rank] + send_count[rank];
+
+ send_glist[shift] = iwm_vtx_gnum[i]; /* Old global number */
+ send_glist[shift+1] = vertices[i].gnum; /* New global number */
+ send_count[rank] += 2;
+
+ }
+
+ MPI_Alltoallv(send_glist, send_count, send_shift, FVM_MPI_GNUM,
+ recv_glist, recv_count, recv_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ n_recv_elts = recv_shift[n_ranks]/2;
+
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(send_glist);
+ BFT_FREE(recv_count);
+
+ /* Update o2n_vtx_gnum */
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = recv_shift[rank]; i < recv_shift[rank+1]; i+=2) {
+
+ fvm_gnum_t o_gnum = recv_glist[i];
+ fvm_gnum_t n_gnum = recv_glist[i+1];
+ cs_int_t id = o_gnum - block_info.first_gnum;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (o2n_vtx_gnum[id] != block_info.first_gnum + id)
+ assert(o2n_vtx_gnum[id] == n_gnum);
+#endif
+
+ o2n_vtx_gnum[id] = n_gnum;
+
+ }
+
+ } /* End of loop on ranks */
+
+ BFT_FREE(recv_shift);
+ BFT_FREE(recv_glist);
+
+ }
+#endif /* HAVE_MPI */
+
+ /* Set return pointer */
+
+ *p_o2n_vtx_gnum = o2n_vtx_gnum;
+}
+
+/*----------------------------------------------------------------------------
+ * Keep a history of the evolution of each vertex id before/after the merge
+ * operation for the current mesh (local point of view).
+ *
+ * parameters:
+ * n_vertices <-- number of vertices before merge/after intersection
+ * vertices <-- array of cs_join_vertex_t structures
+ * p_n_af_vertices --> number of vertices after the merge step
+ * p_o2n_vtx_id --> array keeping the evolution of the vertex ids
+ *---------------------------------------------------------------------------*/
+
+static void
+_keep_local_vtx_evolution(cs_int_t n_vertices,
+ const cs_join_vertex_t vertices[],
+ cs_int_t *p_n_af_vertices,
+ cs_int_t *p_o2n_vtx_id[])
+{
+ cs_int_t i;
+ fvm_gnum_t prev;
+
+ cs_int_t n_af_vertices = 0;
+ cs_int_t *o2n_vtx_id = NULL;
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *vtx_gnum = NULL;
+
+ if (n_vertices == 0)
+ return;
+
+ BFT_MALLOC(vtx_gnum, n_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_gnum[i] = vertices[i].gnum;
+
+ /* Order vertices according to their global numbering */
+
+ BFT_MALLOC(order, n_vertices, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL, vtx_gnum, order, n_vertices);
+
+ /* Delete vertices sharing the same global number. Keep only one */
+
+ BFT_MALLOC(o2n_vtx_id, n_vertices, cs_int_t);
+
+ prev = vtx_gnum[order[0]];
+ o2n_vtx_id[order[0]] = n_af_vertices;
+
+ for (i = 1; i < n_vertices; i++) {
+
+ cs_int_t o_id = order[i];
+ fvm_gnum_t cur = vtx_gnum[o_id];
+
+ if (cur != prev) {
+ prev = cur;
+ n_af_vertices++;
+ o2n_vtx_id[o_id] = n_af_vertices;
+ }
+ else
+ o2n_vtx_id[o_id] = n_af_vertices;
+
+ } /* End of loop on vertices */
+
+ /* n_af_vertices is an id */
+ n_af_vertices += 1;
+
+ assert(n_af_vertices <= n_vertices); /* after merge <= after inter. */
+
+ /* Free memory */
+
+ BFT_FREE(order);
+ BFT_FREE(vtx_gnum);
+
+ /* Set return pointers */
+
+ *p_n_af_vertices = n_af_vertices;
+ *p_o2n_vtx_id = o2n_vtx_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Update a cs_join_inter_edges_t structure after the merge operation.
+ * cs_join_inter_edges_t structure should be not NULL.
+ *
+ * parameters:
+ * o2n_vtx_id <-- array keeping the evolution of the vertex ids
+ * p_inter_edges <-> pointer to the structure keeping data on
+ * edge intersections
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_inter_edges_after_merge(const cs_int_t o2n_vtx_id[],
+ cs_join_inter_edges_t **p_inter_edges)
+{
+ cs_int_t i, j, prev_num, new_num;
+
+ cs_int_t *new_index = NULL;
+ cs_join_inter_edges_t *inter_edges = *p_inter_edges;
+ cs_int_t n_edges = inter_edges->n_edges;
+
+ /* No need to update vtx_glst because it's no more used */
+
+ if (inter_edges->vtx_glst != NULL)
+ BFT_FREE(inter_edges->vtx_glst);
+
+ /* Update cs_join_inter_edges_t structure */
+
+ for (i = 0; i < n_edges; i++) {
+
+ cs_int_t start = inter_edges->index[i];
+ cs_int_t end = inter_edges->index[i+1];
+
+ for (j = start; j < end; j++) {
+
+ cs_int_t old_id = inter_edges->vtx_lst[j] - 1;
+
+ inter_edges->vtx_lst[j] = o2n_vtx_id[old_id] + 1;
+
+ }
+
+ }
+
+ /* Delete redundancies and define a new index */
+
+ BFT_MALLOC(new_index, n_edges + 1, cs_int_t);
+
+ for (i = 0; i < n_edges + 1; i++)
+ new_index[i] = 0;
+
+ for (i = 0; i < n_edges; i++) {
+
+ cs_int_t start = inter_edges->index[i];
+ cs_int_t end = inter_edges->index[i+1];
+
+ if (end - start > 0) {
+
+ prev_num = inter_edges->vtx_lst[start];
+ new_index[i+1] += 1;
+
+ for (j = start + 1; j < end; j++) {
+
+ new_num = inter_edges->vtx_lst[j];
+
+ if (prev_num != new_num) {
+ prev_num = new_num;
+ new_index[i+1] += 1;
+ }
+
+ }
+
+ } /* end - start > 0 */
+
+ } /* End of loop on edge intersections */
+
+ inter_edges->max_sub_size = 0;
+
+ for (i = 0; i < n_edges; i++) {
+
+ inter_edges->max_sub_size = CS_MAX(inter_edges->max_sub_size,
+ new_index[i+1]);
+ new_index[i+1] += new_index[i];
+
+ }
+
+ for (i = 0; i < n_edges; i++) {
+
+ cs_int_t start = inter_edges->index[i];
+ cs_int_t end = inter_edges->index[i+1];
+
+ if (end - start > 0) {
+
+ cs_int_t shift = new_index[i];
+
+ inter_edges->vtx_lst[shift] = inter_edges->vtx_lst[start];
+ inter_edges->abs_lst[shift++] = inter_edges->abs_lst[start];
+
+ prev_num = inter_edges->vtx_lst[start];
+
+ for (j = start + 1; j < end; j++) {
+
+ new_num = inter_edges->vtx_lst[j];
+
+ if (prev_num != new_num) {
+ inter_edges->vtx_lst[shift] = new_num;
+ inter_edges->abs_lst[shift++] = inter_edges->abs_lst[j];
+ prev_num = new_num;
+ }
+
+ }
+
+ } /* end - start > 0 */
+
+ } /* End of loop on edge intersections */
+
+ /* Apply updates to the structure */
+
+ BFT_FREE(inter_edges->index);
+ inter_edges->index = new_index;
+
+ BFT_REALLOC(inter_edges->vtx_lst, inter_edges->index[n_edges], cs_int_t);
+ BFT_REALLOC(inter_edges->abs_lst, inter_edges->index[n_edges], float);
+
+ /* Return pointer */
+
+ *p_inter_edges = inter_edges;
+}
+
+/*----------------------------------------------------------------------------
+ * Define send_rank_index and send_faces to prepare the exchange of new faces
+ * between mesh structures.
+ *
+ * parameters:
+ * n_faces <-- number of faces to send
+ * n_g_faces <-- global number of faces to be joined
+ * face_gnum <-- global face number
+ * gnum_rank_index <-- index on ranks for the init. global face numbering
+ * p_send_rank_index --> index on ranks for sending face
+ * p_send_faces --> list of face ids to send
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_faces_to_send(cs_int_t n_faces,
+ fvm_gnum_t n_g_faces,
+ const fvm_gnum_t face_gnum[],
+ const fvm_gnum_t gnum_rank_index[],
+ cs_int_t *p_send_rank_index[],
+ cs_int_t *p_send_faces[])
+{
+ cs_int_t i, rank, shift;
+ fvm_gnum_t start_gnum, end_gnum;
+ cs_join_block_info_t block_info;
+
+ cs_int_t reduce_size = 0;
+ cs_int_t *send_rank_index = NULL, *send_faces = NULL;
+ cs_int_t *reduce_ids = NULL, *count = NULL;
+ fvm_gnum_t *reduce_index = NULL;
+
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* Sanity checks */
+
+ assert(gnum_rank_index != NULL);
+ assert(n_ranks > 1);
+
+ /* Compute block_size */
+
+ block_info = cs_join_get_block_info(n_g_faces, n_ranks, local_rank);
+ start_gnum = block_info.first_gnum;
+ end_gnum = block_info.first_gnum + block_info.local_size;
+
+ /* Compact init. global face distribution. Remove ranks without face
+ at the begining */
+
+ for (i = 0; i < n_ranks; i++)
+ if (gnum_rank_index[i] < gnum_rank_index[i+1])
+ reduce_size++;
+
+ BFT_MALLOC(reduce_index, reduce_size+1, fvm_gnum_t);
+ BFT_MALLOC(reduce_ids, reduce_size, cs_int_t);
+
+ reduce_size = 0;
+ reduce_index[0] = gnum_rank_index[0] + 1;
+
+ for (i = 0; i < n_ranks; i++) {
+
+ /* Add +1 to gnum_rank_index because it's an id and we work on numbers */
+
+ if (gnum_rank_index[i] < gnum_rank_index[i+1]) {
+ reduce_index[reduce_size+1] = gnum_rank_index[i+1] + 1;
+ reduce_ids[reduce_size++] = i;
+ }
+
+ }
+
+ BFT_MALLOC(send_rank_index, n_ranks + 1, cs_int_t);
+
+ for (i = 0; i < n_ranks + 1; i++)
+ send_rank_index[i] = 0;
+
+ /* Count number of ranks associated to each new face */
+
+ for (i = 0; i < n_faces; i++) {
+
+ if (face_gnum[i] >= start_gnum && face_gnum[i] < end_gnum) {
+
+ /* The current face is a "main" face for the local rank */
+
+ int reduce_rank = cs_search_gindex_binary(reduce_size,
+ face_gnum[i],
+ reduce_index);
+
+ assert(reduce_rank != -1);
+ assert(reduce_rank < reduce_size);
+
+ rank = reduce_ids[reduce_rank];
+ send_rank_index[rank+1] += 1;
+
+ }
+
+ }
+
+ for (i = 0; i < n_ranks; i++)
+ send_rank_index[i+1] += send_rank_index[i];
+
+ BFT_MALLOC(send_faces, send_rank_index[n_ranks], cs_int_t);
+ BFT_MALLOC(count, n_faces, cs_int_t);
+
+ for (i = 0; i < n_faces; i++)
+ count[i] = 0;
+
+ /* Fill the list of ranks */
+
+ for (i = 0; i < n_faces; i++) {
+
+ if (face_gnum[i] >= start_gnum && face_gnum[i] < end_gnum) {
+
+ /* The current face is a "main" face for the local rank */
+
+ int reduce_rank = cs_search_gindex_binary(reduce_size,
+ face_gnum[i],
+ reduce_index);
+
+ rank = reduce_ids[reduce_rank];
+ shift = send_rank_index[rank] + count[rank];
+ send_faces[shift] = i;
+ count[rank] += 1;
+
+ } /* End of loop on initial faces */
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(count);
+ BFT_FREE(reduce_ids);
+ BFT_FREE(reduce_index);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ for (rank = 0; rank < n_ranks; rank++) {
+ bft_printf(" rank %d: ", rank);
+ for (i = send_rank_index[rank]; i < send_rank_index[rank+1]; i++)
+ bft_printf(" %d (%u)", send_faces[i], face_gnum[send_faces[i]]);
+ bft_printf("\n");
+ bft_printf_flush();
+ }
+#endif
+
+ /* Set return pointers */
+
+ *p_send_rank_index = send_rank_index;
+ *p_send_faces = send_faces;
+}
+
+/*----------------------------------------------------------------------------
+ * Update local_mesh by redistributing mesh.
+ * Send back to the original rank the new face and vertex description.
+ *
+ * parameters:
+ * gnum_rank_index <-- index on ranks for the old global face numbering
+ * send_mesh <-- distributed mesh on faces to join
+ * p_recv_mesh <-> mesh on local selected faces to be joined
+ *---------------------------------------------------------------------------*/
+
+static void
+_redistribute_mesh(const fvm_gnum_t gnum_rank_index[],
+ const cs_join_mesh_t *send_mesh,
+ cs_join_mesh_t **p_recv_mesh)
+{
+ cs_join_mesh_t *recv_mesh = *p_recv_mesh;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* sanity checks */
+
+ assert(send_mesh != NULL);
+ assert(recv_mesh != NULL);
+
+ if (n_ranks == 1)
+ cs_join_mesh_copy(&recv_mesh, send_mesh);
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) { /* Parallel mode */
+
+ cs_int_t *send_rank_index = NULL, *send_faces = NULL;
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ /* Free some structures of the mesh */
+
+ cs_join_mesh_reset(recv_mesh);
+
+ _get_faces_to_send(send_mesh->n_faces,
+ send_mesh->n_g_faces,
+ send_mesh->face_gnum,
+ gnum_rank_index,
+ &send_rank_index,
+ &send_faces);
+
+ assert(send_rank_index[n_ranks] <= send_mesh->n_faces);
+
+ /* Get the new face connectivity from the distributed send_mesh */
+
+ cs_join_mesh_exchange(n_ranks,
+ send_rank_index,
+ send_faces,
+ send_mesh,
+ recv_mesh,
+ mpi_comm);
+
+ BFT_FREE(send_faces);
+ BFT_FREE(send_rank_index);
+
+ }
+#endif
+
+ /* Return pointers */
+
+ *p_recv_mesh = recv_mesh;
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Creation of new vertices.
+ *
+ * Update list of equivalent vertices, and assign a vertex (existing or
+ * newly created) to each intersection.
+ *
+ * parameters:
+ * verbosity <-- verbosity level
+ * edges <-- list of edges
+ * work <-> joining mesh maintaining initial vertex data
+ * inter_set <-> cs_join_inter_set_t structure including
+ * data on edge-edge intersections
+ * n_g_vertices <-- global number of vertices (initial parent mesh)
+ * p_n_g_new_vertices <-> pointer to the global number of new vertices
+ * p_vtx_eset <-> pointer to a structure dealing with vertex
+ * equivalences
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_create_new_vertices(int verbosity,
+ const cs_join_edges_t *edges,
+ cs_join_mesh_t *work,
+ cs_join_inter_set_t *inter_set,
+ fvm_gnum_t n_g_vertices,
+ fvm_gnum_t *p_n_g_new_vertices,
+ cs_join_eset_t **p_vtx_eset)
+{
+ cs_int_t i;
+
+ cs_int_t n_new_vertices = 0;
+ fvm_gnum_t n_g_new_vertices = 0;
+ fvm_gnum_t *new_vtx_gnum = NULL;
+ cs_int_t n_iwm_vertices = work->n_vertices;
+ cs_join_eset_t *vtx_equiv = *p_vtx_eset;
+
+ /* Count the number of new vertices. Update cs_join_inter_set_t struct. */
+
+ for (i = 0; i < inter_set->n_inter; i++) {
+
+ cs_join_inter_t inter1 = inter_set->inter_lst[2*i];
+ cs_join_inter_t inter2 = inter_set->inter_lst[2*i+1];
+
+ inter1.vtx_id = _get_vtx_id(inter1,
+ &(edges->def[2*inter1.edge_id]),
+ n_iwm_vertices,
+ &n_new_vertices);
+
+ inter2.vtx_id = _get_vtx_id(inter2,
+ &(edges->def[2*inter2.edge_id]),
+ n_iwm_vertices,
+ &n_new_vertices);
+
+ inter_set->inter_lst[2*i] = inter1;
+ inter_set->inter_lst[2*i+1] = inter2;
+
+ } /* End of loop on intersections */
+
+ /* Compute the global numbering for the new vertices (Take into account
+ potential redundancies) */
+
+ _compute_new_vertex_gnum(work,
+ edges,
+ inter_set,
+ n_g_vertices,
+ n_iwm_vertices,
+ n_new_vertices,
+ &n_g_new_vertices,
+ &new_vtx_gnum);
+
+ if (verbosity > 0)
+ bft_printf(_(" Number of new vertices to create: %10lu\n"),
+ (unsigned long)n_g_new_vertices);
+
+ /* Define new vertices */
+
+ work->n_vertices += n_new_vertices;
+ work->n_g_vertices += n_g_new_vertices;
+
+ BFT_REALLOC(work->vertices, work->n_vertices, cs_join_vertex_t);
+
+#if defined(DEBUG) && !defined(NDEBUG) /* Prepare sanity checks */
+ {
+ cs_join_vertex_t incoherency;
+
+ /* Initialize to incoherent values new vertices structures */
+
+ incoherency.gnum = 0;
+ incoherency.coord[0] = -9999.9999;
+ incoherency.coord[1] = -9999.9999;
+ incoherency.coord[2] = -9999.9999;
+ incoherency.tolerance = -1.0;
+
+ for (i = 0; i < n_new_vertices; i++)
+ work->vertices[n_iwm_vertices + i] = incoherency;
+
+ }
+#endif
+
+ /* Fill vertices structure with new vertex definitions */
+
+ for (i = 0; i < inter_set->n_inter; i++) {
+
+ cs_join_inter_t inter1 = inter_set->inter_lst[2*i];
+ cs_join_inter_t inter2 = inter_set->inter_lst[2*i+1];
+ cs_int_t v1_num = inter1.vtx_id + 1;
+ cs_int_t v2_num = inter2.vtx_id + 1;
+ cs_int_t equiv_id = vtx_equiv->n_equiv;
+
+ assert(inter1.vtx_id < work->n_vertices);
+ assert(inter2.vtx_id < work->n_vertices);
+
+ /* Create new vertices if needed */
+
+ if (v1_num > n_iwm_vertices) { /* Add a new vertex */
+
+ cs_int_t shift = inter1.vtx_id - n_iwm_vertices;
+ cs_join_vertex_t new = _get_new_vertex(inter1.curv_abs,
+ new_vtx_gnum[shift],
+ &(edges->def[2*inter1.edge_id]),
+ work);
+
+ work->vertices[inter1.vtx_id] = new;
+
+ }
+
+ if (v2_num > n_iwm_vertices) { /* Add a new vertex */
+
+ cs_int_t shift = inter2.vtx_id - n_iwm_vertices;
+ cs_join_vertex_t new = _get_new_vertex(inter2.curv_abs,
+ new_vtx_gnum[shift],
+ &(edges->def[2*inter2.edge_id]),
+ work);
+
+ work->vertices[inter2.vtx_id] = new;
+
+ }
+
+ /* Add equivalence between the two current vertices */
+
+ cs_join_eset_check_size(equiv_id, &vtx_equiv);
+
+ if (v1_num < v2_num) {
+ vtx_equiv->equiv_couple[2*equiv_id] = v1_num;
+ vtx_equiv->equiv_couple[2*equiv_id+1] = v2_num;
+ }
+ else {
+ vtx_equiv->equiv_couple[2*equiv_id] = v2_num;
+ vtx_equiv->equiv_couple[2*equiv_id+1] = v1_num;
+ }
+
+ vtx_equiv->n_equiv += 1;
+
+ } /* End of loop on intersections */
+
+ /* Free memory */
+
+ BFT_FREE(new_vtx_gnum);
+
+#if defined(DEBUG) && !defined(NDEBUG) /* Sanity checks */
+ for (i = 0; i < work->n_vertices; i++) {
+
+ cs_join_vertex_t vtx = work->vertices[i];
+
+ if (vtx.gnum == 0 || vtx.tolerance < -0.99)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Inconsistent value found in cs_join_vertex_t struct.:\n"
+ " Vertex %d is defined by:\n"
+ " %u - [%7.4le, %7.4le, %7.4le] - %lg\n"),
+ i, vtx.gnum, vtx.coord[0], vtx.coord[1], vtx.coord[2],
+ vtx.tolerance);
+
+ } /* End of loop on vertices */
+
+#if 0
+ if (verbosity > 3) /* Dump local structures */
+ _dump_vtx_eset(vtx_equiv, work);
+#endif
+#endif
+
+ /* Set return pointers */
+
+ *p_n_g_new_vertices = n_g_new_vertices;
+ *p_vtx_eset = vtx_equiv;
+}
+
+/*----------------------------------------------------------------------------
+ * Merge of equivalent vertices (and tolerance reduction if necessary)
+ *
+ * Define a new cs_join_vertex_t structure (stored in "work" structure).
+ * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters for the joining
+ * n_g_vertices_tot <-- global number of vertices (initial parent mesh)
+ * work <-> pointer to a cs_join_mesh_t structure
+ * vtx_eset <-- structure storing equivalences between vertices
+ * (two vertices are equivalent if they are within
+ * each other's tolerance)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_merge_vertices(cs_join_param_t param,
+ fvm_gnum_t n_g_vertices_tot,
+ cs_join_mesh_t *work,
+ const cs_join_eset_t *vtx_eset)
+{
+ double clock_start, clock_end, cpu_start, cpu_end;
+
+ fvm_gnum_t *vtx_tags = NULL;
+ cs_join_gset_t *merge_set = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* Initialize counters for the merge operation */
+
+ _initialize_merge_counter();
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Dump local structures */
+ if (param.verbosity > 3)
+ _dump_vtx_eset(vtx_eset, work);
+#endif
+
+ if (param.verbosity > 1) {
+ fvm_gnum_t g_n_equiv = vtx_eset->n_equiv;
+ fvm_parall_counter(&g_n_equiv, 1);
+ bft_printf(_("\n"
+ " Final number of equiv. between vertices; local: %9d\n"
+ " global: %9lu\n"),
+ vtx_eset->n_equiv, (unsigned long)g_n_equiv);
+ }
+
+ /* Operate merge between equivalent vertices.
+ Manage reduction of tolerance if necessary */
+
+ clock_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ /* Tag with the same number all the vertices which might be merged together */
+
+ _tag_equiv_vertices(n_g_vertices_tot,
+ vtx_eset,
+ work,
+ param.verbosity,
+ &vtx_tags);
+
+ if (n_ranks == 1) { /* Serial mode */
+
+ /* Build a merge list */
+
+ merge_set = cs_join_gset_create_from_tag(work->n_vertices, vtx_tags);
+
+ /* Merge of equivalent vertices */
+
+ _merge_vertices(param,
+ merge_set,
+ work->n_vertices,
+ work->vertices);
+
+ }
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) { /* Parallel mode: we work by block */
+
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ cs_join_vertex_t *vtx_merge_data = NULL;
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+ BFT_MALLOC(send_shift, n_ranks+1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks+1, cs_int_t);
+
+ /* Build a merge list in parallel */
+
+ _build_parall_merge_structures(work,
+ vtx_tags,
+ send_count, send_shift,
+ recv_count, recv_shift,
+ &vtx_merge_data,
+ &merge_set);
+
+ /* Merge of equivalent vertices for the current block */
+
+ _merge_vertices(param,
+ merge_set,
+ recv_shift[n_ranks],
+ vtx_merge_data);
+
+ _exchange_merged_vertices(work,
+ vtx_tags,
+ send_count, send_shift,
+ recv_count, recv_shift,
+ vtx_merge_data);
+
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(recv_count);
+ BFT_FREE(recv_shift);
+ BFT_FREE(vtx_merge_data);
+
+ }
+#endif /* HAVE_MPI */
+
+ /* Free memory */
+
+ BFT_FREE(vtx_tags);
+
+ clock_end = bft_timer_wtime();
+ cpu_end = bft_timer_cpu_time();
+
+ cs_join_gset_destroy(&merge_set);
+
+ if (param.verbosity > 1)
+ bft_printf(_("\n"
+ " Vertex merge (only)\n"
+ " wall clock time: %10.3g\n"
+ " cpu time: %10.3g\n"),
+ clock_end - clock_start, cpu_end - cpu_start);
+}
+
+/*----------------------------------------------------------------------------
+ * Merge of equivalent vertices (and reduction of tolerance if necessary)
+ *
+ * Define a new cs_join_vertex_t structure (stored in "work" structure)
+ * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters for the joining
+ * n_iwm_vertices <-- initial number of vertices (work mesh struct.)
+ * n_g_ifm_vertices <-- initial global number of vertices (full mesh)
+ * iwm_vtx_gnum <-- initial global vertex num. (work mesh struct)
+ * rank_face_gnum_index <-- index on face global numbering to determine
+ * the related rank
+ * p_mesh <-> pointer to cs_join_mesh_t structure
+ * p_edges <-> pointer to cs_join_edges_t structure
+ * p_inter_edges <-> pointer to a cs_join_inter_edges_t struct.
+ * p_local_mesh <-> pointer to a cs_join_mesh_t structure
+ * p_o2n_vtx_gnum --> array on blocks on the new global vertex
+ * numbering for the init. vertices (before inter.)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_merge_update_struct(cs_join_param_t param,
+ cs_int_t n_iwm_vertices,
+ fvm_gnum_t n_g_ifm_vertices,
+ const fvm_gnum_t iwm_vtx_gnum[],
+ const fvm_gnum_t rank_face_gnum_index[],
+ cs_join_mesh_t **p_mesh,
+ cs_join_edges_t **p_edges,
+ cs_join_inter_edges_t **p_inter_edges,
+ cs_join_mesh_t **p_local_mesh,
+ fvm_gnum_t *p_o2n_vtx_gnum[])
+{
+ cs_int_t n_af_vertices = 0; /* new number of vertices after merge */
+ cs_int_t *o2n_vtx_id = NULL;
+ fvm_gnum_t *o2n_vtx_gnum = NULL;
+ cs_join_mesh_t *mesh = *p_mesh;
+ cs_join_mesh_t *local_mesh = *p_local_mesh;
+ cs_join_edges_t *edges = *p_edges;
+ cs_join_inter_edges_t *inter_edges = *p_inter_edges;
+
+ /* Keep an history of the evolution of each vertex */
+
+ _keep_global_vtx_evolution(n_iwm_vertices, /* n_vertices before inter */
+ n_g_ifm_vertices,
+ iwm_vtx_gnum,
+ mesh->n_vertices, /* n_vertices after inter */
+ mesh->vertices,
+ &o2n_vtx_gnum); /* defined by block in // */
+
+ _keep_local_vtx_evolution(mesh->n_vertices, /* n_vertices after inter */
+ mesh->vertices,
+ &n_af_vertices, /* n_vertices after merge */
+ &o2n_vtx_id);
+
+ /* Update all structures which keeps data about vertices */
+
+ if (inter_edges != NULL) { /* The join type is not conform */
+
+ /* Update inter_edges structure */
+
+ _update_inter_edges_after_merge(o2n_vtx_id, &inter_edges);
+
+ assert(edges->n_edges == inter_edges->n_edges); /* Else: problem for
+ future synchro. */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Dump local structures */
+ cs_join_inter_edges_dump(inter_edges, edges, mesh);
+#endif
+
+ /* Update cs_join_mesh_t structure after the merge of vertices
+ numbering of the old vertices + add new vertices */
+
+ cs_join_mesh_update(mesh,
+ edges,
+ inter_edges->index,
+ inter_edges->vtx_lst,
+ n_af_vertices,
+ o2n_vtx_id);
+
+ } /* End if inter_edges != NULL */
+
+ else
+ /* Update cs_join_mesh_t structure after the merge of vertices
+ numbering of the old vertices + add new vertices */
+
+ cs_join_mesh_update(mesh,
+ edges,
+ NULL,
+ NULL,
+ n_af_vertices,
+ o2n_vtx_id);
+
+ BFT_FREE(o2n_vtx_id);
+
+ /* Update local_mesh by redistributing mesh */
+
+ _redistribute_mesh(rank_face_gnum_index,
+ mesh,
+ &local_mesh);
+
+ /* Clean mesh: remove degenerate and empty edges */
+
+ cs_join_mesh_clean(mesh, param.verbosity);
+
+ /* Define a new cs_join_edges_t structure */
+
+ cs_join_mesh_destroy_edges(&edges);
+ edges = cs_join_mesh_define_edges(mesh);
+
+ /* Set return pointers */
+
+ *p_mesh = mesh;
+ *p_edges = edges;
+ *p_inter_edges = inter_edges;
+ *p_o2n_vtx_gnum = o2n_vtx_gnum;
+ *p_local_mesh = local_mesh;
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_join_mesh.c b/src/base/cs_join_mesh.c
new file mode 100644
index 0000000..339f14b
--- /dev/null
+++ b/src/base/cs_join_mesh.c
@@ -0,0 +1,3111 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Manipulation of a cs_join_mesh_t structure
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_timer.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_io_num.h>
+#include <fvm_nodal.h>
+#include <fvm_nodal_from_desc.h>
+#include <fvm_nodal_order.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_search.h"
+#include "cs_join_post.h"
+#include "cs_join_set.h"
+#include "cs_join_util.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_mesh.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute the cross product of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ *
+ * returns:
+ * the resulting cross product (v1 x v2)
+ *----------------------------------------------------------------------------*/
+
+inline static void
+_cross_product(const double v1[],
+ const double v2[],
+ double result[])
+{
+ result[0] = v1[1] * v2[2] - v2[1] * v1[2];
+ result[1] = v2[0] * v1[2] - v1[0] * v2[2];
+ result[2] = v1[0] * v2[1] - v2[0] * v1[1];
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the dot product of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ *
+ * returns:
+ * the resulting dot product (v1.v2)
+ *----------------------------------------------------------------------------*/
+
+inline static double
+_dot_product(const double v1[],
+ const double v2[])
+{
+ int i;
+ double result = 0.0;
+
+ for (i = 0; i < 3; i++)
+ result += v1[i] * v2[i];
+
+ return result;
+}
+
+/*----------------------------------------------------------------------------
+ * Find for each face of the list its related rank
+ *
+ * parameters:
+ * n_elts <-- number of elements in the glob. list
+ * glob_list <-- global numbering list (must be ordered)
+ * rank_index <-- index defining a range of global numbers related
+ * to a rank
+ *
+ * returns:
+ * an array of size n_elts
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t *
+_get_rank_from_index(cs_int_t n_elts,
+ const fvm_gnum_t glob_list[],
+ const fvm_gnum_t rank_index[])
+{
+ cs_int_t i, rank;
+
+ cs_int_t *rank_list = NULL;
+
+ if (n_elts == 0)
+ return NULL;
+
+ BFT_MALLOC(rank_list, n_elts, cs_int_t);
+
+ for (i = 0, rank = 0; i < n_elts; i++) {
+
+ for (;rank_index[rank+1] < glob_list[i]; rank++);
+
+ assert(rank < fvm_parall_get_size());
+ rank_list[i] = rank;
+
+ } /* End of loop on elements */
+
+ return rank_list;
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Get the index on ranks and th list of faces to send from a list of global
+ * faces to receive.
+ *
+ * parameters:
+ * n_ranks <-- number of ranks
+ * gnum_rank_index <-- index on ranks for the global elements
+ * n_elts <-- number of elements to get
+ * glob_list <-- global number of faces to get (ordered)
+ * send_rank_index --> index on ranks for the faces to send
+ * send_faces --> list of face ids to send
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_send_faces(int n_ranks,
+ const fvm_gnum_t gnum_rank_index[],
+ cs_int_t n_elts,
+ const fvm_gnum_t glob_list[],
+ cs_int_t *send_rank_index[],
+ cs_int_t *send_faces[])
+{
+ int i, rank, shift;
+ fvm_gnum_t first_gface_id;
+
+ cs_int_t *gface_ranks = NULL, *_send_faces = NULL, *_send_rank_index = NULL;
+ cs_int_t *send_count = NULL, *recv_count = NULL, *send_shift = NULL;
+ fvm_gnum_t *gfaces_to_send = NULL, *gfaces_to_recv = NULL;
+
+ MPI_Comm comm = cs_glob_mpi_comm;
+
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+
+ /* Sanity checks */
+
+ assert(n_ranks > 1);
+ assert(gnum_rank_index != NULL);
+
+ /* Find for each element of the list, the rank which owns the element */
+
+ gface_ranks = _get_rank_from_index(n_elts, glob_list, gnum_rank_index);
+
+ first_gface_id = gnum_rank_index[local_rank];
+
+ /* Count the number of faces for which we want the connectivity */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_elts; i++)
+ send_count[gface_ranks[i]] += 1;
+
+ /* Exchange number of elements for which we want a connectivity */
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, comm);
+
+ /* Build index arrays */
+
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(_send_rank_index, n_ranks + 1, cs_int_t);
+
+ send_shift[0] = 0;
+ _send_rank_index[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ _send_rank_index[rank+1] = _send_rank_index[rank] + recv_count[rank];
+ send_shift[rank+1] = send_shift[rank] + send_count[rank];
+
+ }
+
+ /* Build gfaces_to_recv = glob_list but potentially in a different order.
+ List of face (global numbering) for which we want the connectivity */
+
+ BFT_MALLOC(gfaces_to_recv, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(gfaces_to_send, _send_rank_index[n_ranks], fvm_gnum_t);
+
+ assert(send_shift[n_ranks] == n_elts);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < n_elts; i++) {
+
+ rank = gface_ranks[i];
+ shift = send_count[rank] + send_shift[rank];
+ gfaces_to_recv[shift] = glob_list[i];
+ send_count[rank] += 1;
+
+ }
+
+ /* Exchange list of global num. to exchange */
+
+ MPI_Alltoallv(gfaces_to_recv, send_count, send_shift, FVM_MPI_GNUM,
+ gfaces_to_send, recv_count, _send_rank_index, FVM_MPI_GNUM,
+ comm);
+
+ BFT_MALLOC(_send_faces, _send_rank_index[n_ranks], cs_int_t);
+
+ /* Define face ids to send */
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = _send_rank_index[rank]; i < _send_rank_index[rank + 1]; i++)
+ _send_faces[i] = gfaces_to_send[i] - 1 - first_gface_id;
+
+ } /* End of loop on ranks */
+
+ /* Free memory */
+
+ BFT_FREE(gface_ranks);
+ BFT_FREE(gfaces_to_recv);
+ BFT_FREE(send_shift);
+ BFT_FREE(send_count);
+ BFT_FREE(recv_count);
+ BFT_FREE(gfaces_to_send);
+
+ /* Set return pointers */
+
+ *send_rank_index = _send_rank_index;
+ *send_faces = _send_faces;
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Clean the given cs_join_mesh_t structure: remove empty edges.
+ *
+ * parameters:
+ * mesh <-> pointer to the cs_join_mesh_t structure to clean
+ * verbosity <-- level of display
+ *---------------------------------------------------------------------------*/
+
+static void
+_remove_empty_edges(cs_join_mesh_t *mesh,
+ int verbosity)
+{
+ cs_int_t i, j, n_face_vertices;
+
+ cs_int_t shift = 0, n_simplified_faces = 0;
+ cs_int_t *new_face_vtx_idx = NULL;
+
+ BFT_MALLOC(new_face_vtx_idx, mesh->n_faces + 1, cs_int_t);
+
+ new_face_vtx_idx[0] = 1;
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ cs_int_t s = mesh->face_vtx_idx[i] - 1;
+ cs_int_t e = mesh->face_vtx_idx[i+1] - 1;
+
+ mesh->face_vtx_lst[shift++] = mesh->face_vtx_lst[s];
+
+ /* Loop on face vertices */
+
+ for (j = s + 1; j < e - 1; j++)
+ if (mesh->face_vtx_lst[j] != mesh->face_vtx_lst[j+1])
+ mesh->face_vtx_lst[shift++] = mesh->face_vtx_lst[j];
+
+ if (mesh->face_vtx_lst[e-1] != mesh->face_vtx_lst[s])
+ mesh->face_vtx_lst[shift++] = mesh->face_vtx_lst[e-1];
+
+ new_face_vtx_idx[i+1] = shift + 1;
+
+ n_face_vertices = new_face_vtx_idx[i+1] - new_face_vtx_idx[i];
+
+ if (n_face_vertices < e - s) {
+
+ n_simplified_faces++;
+ if (verbosity > 2)
+ bft_printf(" Simplified face %d (%u)\n", i+1, mesh->face_gnum[i]);
+
+ if (n_face_vertices < 3)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" The simplified face has less than 3 vertices.\n"
+ " Check your joining parameters.\n"
+ " Face %d (%u)\n"), i+1, mesh->face_gnum[i]);
+ }
+
+ } /* End of loop on faces */
+
+ BFT_FREE(mesh->face_vtx_idx);
+ mesh->face_vtx_idx = new_face_vtx_idx;
+
+ BFT_REALLOC(mesh->face_vtx_lst,
+ new_face_vtx_idx[mesh->n_faces]-1, cs_int_t);
+
+ if (verbosity > 1) {
+ fvm_gnum_t n_g_simplified_faces = n_simplified_faces;
+ fvm_parall_counter(&n_g_simplified_faces, 1);
+ bft_printf(_("\n Number of simplified faces: %lu\n"),
+ (unsigned long)n_simplified_faces);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Clean the given cs_join_mesh_t structure: remove degenerate edges.
+ *
+ * parameters:
+ * mesh <-> pointer to the cs_join_mesh_t structure to clean
+ * verbosity <-- level of display
+ *---------------------------------------------------------------------------*/
+
+static void
+_remove_degenerate_edges(cs_join_mesh_t *mesh,
+ int verbosity)
+{
+ /*
+ - In the definition of faces based on new edges, a same edge may be
+ traversed twice, in the opposite direction; this is due to merging
+ of edges, as shown below.
+
+ x x
+ |\ |
+ | \ |
+ a2| \a3 A2|
+ | \ |
+ | \ a4 Merge of |
+ ---s1----s2------ vertices x
+ | \ s1 and s2 / \
+ | \ / \
+ a1| \a4 A1/ \A3
+ | \ / \
+ | \ / \
+ x-----------x x-----------x
+ a5 A4
+
+
+ Face: a1 a2 a3 a4 a5 Face: A1 A2 -A2 A3 A4
+
+
+ Caution: the final configuration may be
+ A2 A1 A3 A4 -A2
+ where the references of edges to delete may be at the
+ beginning or end of the face definition
+
+ Remark: several edge pairs may possibly be referenced twice,
+ in the form
+ ... A1 A2 -A2 -A1 ... (where the removal of A2 will
+ make ... A1 -A1 ... appear); We thus run as many passes
+ as necessary on a given face.
+ */
+
+ cs_int_t i, j, k, count, n_face_vertices;
+
+ cs_int_t shift = 0;
+ cs_int_t n_faces = mesh->n_faces;
+ cs_int_t n_modified_faces = 0;
+ fvm_gnum_t n_g_modified_faces = 0;
+ cs_join_rset_t *tmp = NULL;
+ cs_join_rset_t *kill = NULL;
+
+ tmp = cs_join_rset_create(8);
+ kill = cs_join_rset_create(8);
+
+ for (i = 0; i < n_faces; i++) {
+
+ cs_int_t start_id = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end_id = mesh->face_vtx_idx[i+1] - 1;
+ cs_int_t n_init_vertices = end_id - start_id;
+ cs_int_t n_elts = n_init_vertices + 2;
+
+ assert(n_init_vertices > 2);
+
+ /* Build a temporary list based on the face connectivity */
+
+ cs_join_rset_resize(&tmp, n_elts);
+ cs_join_rset_resize(&kill, n_elts);
+
+ for (j = start_id, k = 0; j < end_id; j++, k++) {
+ tmp->array[k] = mesh->face_vtx_lst[j];
+ kill->array[k] = 0;
+ }
+
+ tmp->array[k] = mesh->face_vtx_lst[start_id];
+ kill->array[k++] = 0;
+ tmp->array[k] = mesh->face_vtx_lst[start_id+1];
+ kill->array[k++] = 0;
+
+ assert(n_elts == k);
+ tmp->n_elts = n_elts;
+ kill->n_elts = n_elts;
+
+ /* Find degenerate edges */
+
+ count = 1;
+ n_face_vertices = n_init_vertices;
+
+ while (count > 0) {
+
+ count = 0;
+ for (j = 0; j < n_face_vertices; j++) {
+ if (tmp->array[j] == tmp->array[j+2]) {
+ count++;
+ kill->array[j] = 1;
+ kill->array[(j+1)%n_face_vertices] = 1;
+ }
+ }
+
+ tmp->n_elts = 0;
+ for (j = 0; j < n_face_vertices; j++) {
+ if (kill->array[j] == 0)
+ tmp->array[tmp->n_elts++] = tmp->array[j];
+ }
+
+ n_face_vertices = tmp->n_elts;
+ tmp->array[tmp->n_elts++] = tmp->array[0];
+ tmp->array[tmp->n_elts++] = tmp->array[1];
+
+ kill->n_elts = tmp->n_elts;
+ for (j = 0; j < kill->n_elts; j++)
+ kill->array[j] = 0;
+
+ } /* End of while */
+
+ if (n_face_vertices != n_init_vertices) {
+
+ n_modified_faces += 1;
+
+ if (verbosity > 2) { /* Display the degenerate face */
+
+ bft_printf("\n Degenerate connectivity for face: %d [%u]:",
+ i+1, mesh->face_gnum[i]);
+
+ bft_printf("\n Initial def: ");
+ for (j = start_id; j < end_id; j++) {
+ cs_int_t v_id = mesh->face_vtx_lst[j] - 1;
+ bft_printf(" %d (%u) ", v_id+1, mesh->vertices[v_id].gnum);
+ }
+
+ bft_printf("\n Final def: ");
+ for (j = 0; j < n_face_vertices; j++) {
+ cs_int_t v_id = tmp->array[j] - 1;
+ bft_printf(" %d (%u) ", v_id+1, mesh->vertices[v_id].gnum);
+ }
+
+ bft_printf("\n");
+ bft_printf_flush();
+ }
+
+ } /* End if n_face_vertices != n_init_vertices */
+
+ for (j = 0; j < n_face_vertices; j++)
+ mesh->face_vtx_lst[shift++] = tmp->array[j];
+ mesh->face_vtx_idx[i] = shift;
+
+ } /* End of loop on faces */
+
+ fvm_parall_counter(&n_g_modified_faces, 1);
+
+ bft_printf(" Degenerate connectivity for %lu faces.\n"
+ " Mesh cleaning done.\n",
+ (unsigned long)n_g_modified_faces);
+
+ for (i = n_faces; i > 0; i--)
+ mesh->face_vtx_idx[i] = mesh->face_vtx_idx[i-1] + 1;
+ mesh->face_vtx_idx[0] = 1;
+
+ BFT_REALLOC(mesh->face_vtx_lst, mesh->face_vtx_idx[n_faces], cs_int_t);
+
+ /* Free memory */
+
+ cs_join_rset_destroy(&tmp);
+ cs_join_rset_destroy(&kill);
+}
+
+/*----------------------------------------------------------------------------
+ * Count the number of new vertices to add in the new face definition
+ *
+ * parameters:
+ * v1_num <-- first vertex number
+ * v2_num <-- second vertex number
+ * old2new <-- indirection array between old and new numbering
+ * edges <-- cs_join_edges_t structure
+ * edge_index <-- edge -> new added vertex connectivity index
+ * edge_new_vtx_lst <-- edge -> new added vertex connectivity list
+ *
+ * returns:
+ * a number of vertices to add
+ *---------------------------------------------------------------------------*/
+
+static int
+_count_new_added_vtx_to_edge(cs_int_t v1_num,
+ cs_int_t v2_num,
+ const cs_int_t old2new[],
+ const cs_join_edges_t *edges,
+ const cs_int_t edge_index[],
+ const cs_int_t edge_new_vtx_lst[])
+{
+ cs_int_t i, edge_id, edge_num;
+
+ cs_int_t new_v1_num = old2new[v1_num-1] + 1;
+ cs_int_t new_v2_num = old2new[v2_num-1] + 1;
+ cs_int_t n_adds = 0;
+
+ assert(v1_num > 0);
+ assert(v2_num > 0);
+ assert(new_v1_num > 0);
+ assert(new_v2_num > 0);
+ assert(edge_index != NULL);
+
+ /* Find the related edge */
+
+ edge_num = cs_join_mesh_get_edge(v1_num, v2_num, edges);
+ edge_id = CS_ABS(edge_num) - 1;
+
+ if (v1_num == v2_num)
+ bft_error(__FILE__, __LINE__, 0,
+ _("\n Problem in mesh connectivity.\n"
+ " Detected when updating connectivity.\n"
+ " Edge number: %d (%u) - (%d, %d) in old numbering.\n"),
+ edge_num, edges->gnum[edge_id], v1_num, v2_num);
+
+ /* Add the first vertex (new_v1_num) */
+
+ n_adds = 1;
+
+ /* Add another vertices if needed */
+
+ for (i = edge_index[edge_id]; i < edge_index[edge_id+1]; i++) {
+
+ cs_int_t new_vtx_num = edge_new_vtx_lst[i];
+
+ if (new_vtx_num != new_v1_num && new_vtx_num != new_v2_num)
+ n_adds++;
+
+ }
+
+ return n_adds;
+}
+
+/*----------------------------------------------------------------------------
+ * Add new vertex to the face -> vertex connectivity
+ *
+ * parameters:
+ * v1_num <-- first vertex number
+ * v2_num <-- second vertex number
+ * old2new <-- indirection array between old and new numbering
+ * edges <-- cs_join_edges_t structure
+ * edge_index <-- edge -> new added vertex connectivity index
+ * edge_new_vtx_lst <-- edge -> new added vertex connectivity list
+ * new_face_vtx_lst <-> new face -> vertex connectivity list
+ * p_shift <-> pointer to the shift in the connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_new_vtx_to_edge(cs_int_t v1_num,
+ cs_int_t v2_num,
+ const cs_int_t old2new[],
+ const cs_join_edges_t *edges,
+ const cs_int_t edge_index[],
+ const cs_int_t edge_new_vtx_lst[],
+ cs_int_t new_face_vtx_lst[],
+ cs_int_t *p_shift)
+{
+ cs_int_t new_v1_num = old2new[v1_num-1] + 1;
+ cs_int_t shift = *p_shift;
+
+ /* Add first vertex num to the connectivity list */
+
+ new_face_vtx_lst[shift++] = new_v1_num;
+
+ if (edge_new_vtx_lst != NULL) {
+
+ cs_int_t i, edge_id, edge_num, e_start, e_end;
+
+ cs_int_t new_v2_num = old2new[v2_num-1] + 1;
+
+ /* Find the related edge */
+
+ edge_num = cs_join_mesh_get_edge(v1_num, v2_num, edges);
+ edge_id = CS_ABS(edge_num) - 1;
+ e_start = edge_index[edge_id];
+ e_end = edge_index[edge_id+1];
+
+ /* Add a vertex if needed */
+
+ if (edge_num > 0) {
+
+ for (i = e_start; i < e_end; i++) {
+
+ cs_int_t new_vtx_num = edge_new_vtx_lst[i];
+
+ if (new_vtx_num != new_v1_num && new_vtx_num != new_v2_num)
+ new_face_vtx_lst[shift++] = new_vtx_num;
+
+ }
+ }
+ else { /* edge_num < 0 */
+
+ for (i = e_end - 1; i > e_start - 1; i--) {
+
+ cs_int_t new_vtx_num = edge_new_vtx_lst[i];
+
+ if (new_vtx_num != new_v1_num && new_vtx_num != new_v2_num)
+ new_face_vtx_lst[shift++] = new_vtx_num;
+
+ }
+
+ } /* End if edge_num < 0 */
+
+ } /* End if edge_new_vtx_lst != NULL */
+
+ /* Return pointer */
+
+ *p_shift = shift;
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Create a MPI_Datatype for the cs_join_vertex_t structure.
+ *
+ * returns:
+ * a MPI_Datatype associated to the cs_join_vertex_t structure
+ *---------------------------------------------------------------------------*/
+
+MPI_Datatype
+cs_join_mesh_create_vtx_datatype(void)
+{
+ int j;
+ cs_join_vertex_t v_data;
+ MPI_Datatype new_type;
+
+ int blocklengths[3] = {1, 1, 3};
+ MPI_Aint displacements[3] = {0 , 0, 0};
+ MPI_Datatype types[3] = {MPI_DOUBLE, FVM_MPI_GNUM, FVM_MPI_COORD};
+
+ /* Initialize bbox */
+
+ v_data.tolerance = 0.0;
+ v_data.gnum = 1;
+ for (j = 0; j < 3; j++)
+ v_data.coord[j] = 0.;
+
+ /* Define array of displacements */
+
+ MPI_Get_address(&v_data, displacements);
+ MPI_Get_address(&v_data.gnum, displacements + 1);
+ MPI_Get_address(&v_data.coord, displacements + 2);
+
+ displacements[2] -= displacements[0];
+ displacements[1] -= displacements[0];
+ displacements[0] = 0;
+
+ /* Create new datatype */
+
+ MPI_Type_create_struct(3, blocklengths, displacements, types, &new_type);
+
+ MPI_Type_commit(&new_type);
+
+ return new_type;
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Allocate and initialize a new cs_join_mesh_t structure.
+ *
+ * parameters:
+ * name <-- name of the mesh
+ *
+ * returns:
+ * a pointer to a cs_join_mesh_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create(const char *name)
+{
+ cs_join_mesh_t *new_mesh = NULL;
+
+ BFT_MALLOC(new_mesh, 1, cs_join_mesh_t);
+
+ if (name != NULL) {
+
+ int len = strlen(name);
+
+ BFT_MALLOC(new_mesh->name, len + 1, char);
+ strncpy(new_mesh->name, name, len);
+ new_mesh->name[len] = '\0';
+
+ }
+ else
+ new_mesh->name = NULL;
+
+ new_mesh->n_faces = 0;
+ new_mesh->n_g_faces = 0;
+ new_mesh->face_gnum = NULL;
+ new_mesh->face_vtx_idx = NULL;
+ new_mesh->face_vtx_lst = NULL;
+ new_mesh->n_vertices = 0;
+ new_mesh->n_g_vertices = 0;
+ new_mesh->vertices = NULL;
+
+ return new_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Get a cs_join_mesh_t structure with the given list of global faces inside.
+ *
+ * Exchange between ranks to get the connectivity associated to each
+ * face of the global numbering list.
+ *
+ * parameters:
+ * mesh_name <-- name of the created mesh
+ * n_elts <-- number of elements in the global list
+ * glob_sel <-- list of global elements (ordered)
+ * gnum_rank_index <-- index on ranks for the global elements
+ * local_mesh <-- pointer to the local part of the distributed
+ * cs_join_mesh_t structure on selected elements
+ *
+ * returns:
+ * a pointer to a new allocated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create_from_glob_sel(const char *mesh_name,
+ cs_int_t n_elts,
+ const fvm_gnum_t glob_sel[],
+ const fvm_gnum_t gnum_rank_index[],
+ const cs_join_mesh_t *local_mesh)
+{
+ cs_join_mesh_t *new_mesh = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ if (n_ranks == 1) {
+
+ cs_int_t i;
+ cs_int_t *loc_sel = NULL;
+
+ BFT_MALLOC(loc_sel, n_elts, cs_int_t);
+
+ for (i = 0; i < n_elts; i++)
+ loc_sel[i] = glob_sel[i];
+
+ new_mesh = cs_join_mesh_create_from_subset(mesh_name,
+ n_elts,
+ loc_sel,
+ local_mesh);
+
+ BFT_FREE(loc_sel);
+ }
+
+#if defined(HAVE_MPI)
+
+ else { /* Parallel mode */
+
+ cs_int_t *send_rank_index = NULL, *send_faces = NULL;
+
+ new_mesh = cs_join_mesh_create(mesh_name);
+
+ /* Define a send list (face ids to send) from the global list of faces
+ to receive. */
+
+ _get_send_faces(n_ranks,
+ gnum_rank_index,
+ n_elts,
+ glob_sel,
+ &send_rank_index,
+ &send_faces);
+
+ /* Get useful connectivity on ranks for computing local intersections */
+
+ cs_join_mesh_exchange(n_ranks,
+ send_rank_index,
+ send_faces,
+ local_mesh,
+ new_mesh,
+ cs_glob_mpi_comm);
+
+ BFT_FREE(send_faces);
+ BFT_FREE(send_rank_index);
+ }
+
+#endif
+
+ return new_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Allocate and define a cs_join_mesh_t structure relative to an extraction
+ * of selected faces.
+ *
+ * The selection must be ordered.
+ *
+ * parameters:
+ * mesh_name <-- name of the name to create
+ * subset_size <-- number of selected faces in the subset
+ * selection <-- list of selected faces. Numbering in parent mesh
+ * parent_mesh <-- parent cs_join_mesh_t structure
+ *
+ * returns:
+ * a pointer to a cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create_from_subset(const char *mesh_name,
+ cs_int_t subset_size,
+ const cs_int_t selection[],
+ const cs_join_mesh_t *parent_mesh)
+{
+ cs_int_t i, j, shift, parent_id, vtx_num, start, end;
+
+ cs_int_t n_select_vertices = 0;
+ cs_int_t *select_vtx_id = NULL;
+
+ cs_join_mesh_t *mesh = NULL;
+
+ /* Get the selected vertices relative to the subset selection */
+
+ BFT_MALLOC(select_vtx_id, parent_mesh->n_vertices, cs_int_t);
+
+ for (i = 0; i < parent_mesh->n_vertices; i++)
+ select_vtx_id[i] = -1;
+
+ for (i = 0; i < subset_size; i++) {
+
+ parent_id = selection[i] - 1;
+
+ for (j = parent_mesh->face_vtx_idx[parent_id] - 1;
+ j < parent_mesh->face_vtx_idx[parent_id+1] - 1;
+ j++) {
+ select_vtx_id[parent_mesh->face_vtx_lst[j] - 1] = 0;
+ }
+
+ }
+
+ n_select_vertices = 0;
+ for (i = 0; i < parent_mesh->n_vertices; i++) {
+ if (select_vtx_id[i] > -1)
+ select_vtx_id[i] = n_select_vertices++;
+ }
+
+ /* Create a new cs_join_mesh_t structure */
+
+ mesh = cs_join_mesh_create(mesh_name);
+
+ mesh->n_faces = subset_size;
+
+ /* Build face_vtx_idx */
+
+ BFT_MALLOC(mesh->face_vtx_idx, mesh->n_faces + 1, cs_int_t);
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ parent_id = selection[i] - 1;
+ mesh->face_vtx_idx[i+1] = parent_mesh->face_vtx_idx[parent_id+1]
+ - parent_mesh->face_vtx_idx[parent_id];
+
+ }
+
+ mesh->face_vtx_idx[0] = 1;
+ for (i = 0; i < mesh->n_faces; i++)
+ mesh->face_vtx_idx[i+1] += mesh->face_vtx_idx[i];
+
+ BFT_MALLOC(mesh->face_vtx_lst,
+ mesh->face_vtx_idx[mesh->n_faces] - 1, cs_int_t);
+
+ /* Build face_vtx_lst */
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ parent_id = selection[i] - 1;
+ start = parent_mesh->face_vtx_idx[parent_id] - 1;
+ end = parent_mesh->face_vtx_idx[parent_id+1] - 1;
+ shift = mesh->face_vtx_idx[i] - 1;
+
+ for (j = start; j < end; j++) {
+
+ vtx_num = parent_mesh->face_vtx_lst[j];
+
+ mesh->face_vtx_lst[shift + j - start]
+ = select_vtx_id[parent_mesh->face_vtx_lst[j] - 1] + 1;
+
+ }
+
+ } /* End of loop on selected faces */
+
+ /* Define vertices */
+
+ mesh->n_vertices = n_select_vertices;
+
+ BFT_MALLOC(mesh->vertices, n_select_vertices, cs_join_vertex_t);
+
+ n_select_vertices = 0;
+ for (i = 0; i < parent_mesh->n_vertices; i++) {
+ if (select_vtx_id[i] > -1)
+ mesh->vertices[n_select_vertices++] = parent_mesh->vertices[i];
+ }
+
+ /* Define global face numbering and linked global cell numbering */
+
+ BFT_MALLOC(mesh->face_gnum, mesh->n_faces, fvm_gnum_t);
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ parent_id = selection[i] - 1;
+ mesh->face_gnum[i] = parent_mesh->face_gnum[parent_id];
+
+ }
+
+ if (cs_glob_n_ranks == 1) {
+
+ mesh->n_g_faces = mesh->n_faces;
+ mesh->n_g_vertices = mesh->n_vertices;
+
+ }
+ else {
+
+ fvm_io_num_t *io_num = NULL;
+ fvm_gnum_t *vtx_gnum = NULL;
+
+ const fvm_gnum_t *io_gnum = NULL;
+
+ /* Get the global number of faces in the subset */
+
+ io_num = fvm_io_num_create(NULL, mesh->face_gnum, subset_size, 0);
+
+ mesh->n_g_faces = fvm_io_num_get_global_count(io_num);
+
+ io_num = fvm_io_num_destroy(io_num);
+
+ /* Get the global number of vertices in the subset */
+
+ BFT_MALLOC(vtx_gnum, mesh->n_vertices, fvm_gnum_t);
+
+ for (i = 0; i < mesh->n_vertices; i++)
+ vtx_gnum[i] = mesh->vertices[i].gnum;
+
+ io_num = fvm_io_num_create(NULL, vtx_gnum, mesh->n_vertices, 0);
+
+ mesh->n_g_vertices = fvm_io_num_get_global_count(io_num);
+
+ io_gnum = fvm_io_num_get_global_num(io_num);
+
+ for (i = 0; i < mesh->n_vertices; i++)
+ mesh->vertices[i].gnum = io_gnum[i];
+
+ io_num = fvm_io_num_destroy(io_num);
+
+ BFT_FREE(vtx_gnum);
+ }
+
+ /* Free memory */
+
+ BFT_FREE(select_vtx_id);
+
+ return mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Allocate and define a cs_join_mesh_t structure relative to an extraction
+ * of selected faces.
+ *
+ * parameters:
+ * mesh_name <-- name of the mesh to create
+ * n_faces <-- number of selected faces
+ * n_g_faces <-- global number of selected faces
+ * selected_faces <-- list of selected faces (based on parent mesh)
+ * face_gnum <-- global face numbers
+ * face_vtx_idx <-- "face -> vertex" connectivity index
+ * face_vtx_lst <-- "face -> vertex" connectivity
+ * n_select_vertices <-- number of vertices used in joining operation
+ * n_g_select_vertices <-- global number of vertices used in joining
+ * select_vertices <-- list of selected vertices (based on parent mesh)
+ * vtx_data <-- array on data associated to selected vertices
+ *
+ * returns:
+ * a pointer to a cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_mesh_t *
+cs_join_mesh_create_from_extract(const char *mesh_name,
+ cs_int_t n_faces,
+ fvm_gnum_t n_g_faces,
+ const cs_int_t selected_faces[],
+ const fvm_gnum_t face_gnum[],
+ const cs_int_t face_vtx_idx[],
+ const cs_int_t face_vtx_lst[],
+ cs_int_t n_select_vertices,
+ fvm_gnum_t n_g_select_vertices,
+ const cs_int_t selected_vertices[],
+ const cs_join_vertex_t *vtx_data)
+{
+ cs_int_t i, j, shift, id, face_id, vtx_num, start, end;
+
+ cs_join_mesh_t *mesh = NULL;
+
+ mesh = cs_join_mesh_create(mesh_name);
+
+ /* Define face connectivity */
+
+ mesh->n_faces = n_faces;
+ mesh->n_g_faces = n_g_faces;
+
+ /* Define face_vtx_idx */
+
+ BFT_MALLOC(mesh->face_vtx_idx, n_faces + 1, cs_int_t);
+
+ for (i = 0; i < n_faces; i++) {
+
+ face_id = selected_faces[i] - 1;
+ mesh->face_vtx_idx[i+1] = face_vtx_idx[face_id+1] - face_vtx_idx[face_id];
+
+ }
+
+ mesh->face_vtx_idx[0] = 1;
+ for (i = 0; i < n_faces; i++)
+ mesh->face_vtx_idx[i+1] += mesh->face_vtx_idx[i];
+
+ BFT_MALLOC(mesh->face_vtx_lst, mesh->face_vtx_idx[n_faces] - 1, cs_int_t);
+
+ /* Define face_vtx_lst */
+
+ for (i = 0; i < n_faces; i++) {
+
+ face_id = selected_faces[i] - 1;
+ start = face_vtx_idx[face_id] - 1;
+ end = face_vtx_idx[face_id+1] - 1;
+ shift = mesh->face_vtx_idx[i] - 1;
+
+ for (j = 0; j < end - start; j++) {
+
+ vtx_num = face_vtx_lst[start + j];
+
+ id = cs_search_binary(n_select_vertices,
+ vtx_num,
+ selected_vertices);
+
+ mesh->face_vtx_lst[shift + j] = id + 1;
+
+ }
+
+ } /* End of loop on selected faces */
+
+ /* Define global face numbering */
+
+ BFT_MALLOC(mesh->face_gnum, mesh->n_faces, fvm_gnum_t);
+
+ if (face_gnum == NULL)
+ for (i = 0; i < n_faces; i++)
+ mesh->face_gnum[i] = selected_faces[i];
+ else
+ for (i = 0; i < n_faces; i++)
+ mesh->face_gnum[i] = face_gnum[i];
+
+ /* Define vertices */
+
+ mesh->n_vertices = n_select_vertices;
+ mesh->n_g_vertices = n_g_select_vertices;
+
+ BFT_MALLOC(mesh->vertices, n_select_vertices, cs_join_vertex_t);
+
+ for (i = 0; i < n_select_vertices; i++)
+ mesh->vertices[i] = vtx_data[i];
+
+ return mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-> pointer to pointer to cs_join_mesh_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_destroy(cs_join_mesh_t **mesh)
+{
+ if (*mesh != NULL) {
+ cs_join_mesh_t *m = *mesh;
+ BFT_FREE(m->name);
+ BFT_FREE(m->face_vtx_idx);
+ BFT_FREE(m->face_vtx_lst);
+ BFT_FREE(m->face_gnum);
+ BFT_FREE(m->vertices);
+ BFT_FREE(*mesh);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Re-initialize an existing cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_reset(cs_join_mesh_t *mesh)
+{
+ if (mesh == NULL)
+ return;
+
+ mesh->n_faces = 0;
+ mesh->n_g_faces = 0;
+
+ BFT_FREE(mesh->face_gnum);
+ BFT_FREE(mesh->face_vtx_lst);
+ BFT_FREE(mesh->face_vtx_idx);
+
+ mesh->n_vertices = 0;
+ mesh->n_g_vertices = 0;
+
+ BFT_FREE(mesh->vertices);
+}
+
+/*----------------------------------------------------------------------------
+ * Copy a cs_join_mesh_t structure into another.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_join_mesh_t structure to fill
+ * ref_mesh <-- pointer to the reference
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_copy(cs_join_mesh_t **mesh,
+ const cs_join_mesh_t *ref_mesh)
+{
+ cs_int_t i;
+ cs_join_mesh_t *_mesh = *mesh;
+
+ if (ref_mesh == NULL) {
+ cs_join_mesh_destroy(mesh);
+ return;
+ }
+
+ if (_mesh == NULL)
+ _mesh = cs_join_mesh_create(ref_mesh->name);
+
+ _mesh->n_faces = ref_mesh->n_faces;
+ _mesh->n_g_faces = ref_mesh->n_g_faces;
+
+ BFT_REALLOC(_mesh->face_gnum, _mesh->n_faces, fvm_gnum_t);
+ BFT_REALLOC(_mesh->face_vtx_idx, _mesh->n_faces + 1, cs_int_t);
+
+ _mesh->face_vtx_idx[0] = 1;
+
+ for (i = 0; i < _mesh->n_faces; i++) {
+ _mesh->face_gnum[i] = ref_mesh->face_gnum[i];
+ _mesh->face_vtx_idx[i+1] = ref_mesh->face_vtx_idx[i+1];
+ }
+
+ BFT_REALLOC(_mesh->face_vtx_lst,
+ _mesh->face_vtx_idx[_mesh->n_faces]-1,
+ cs_int_t);
+
+ for (i = 0; i < _mesh->face_vtx_idx[_mesh->n_faces]-1; i++)
+ _mesh->face_vtx_lst[i] = ref_mesh->face_vtx_lst[i];
+
+ _mesh->n_vertices = ref_mesh->n_vertices;
+ _mesh->n_g_vertices = ref_mesh->n_g_vertices;
+
+ BFT_REALLOC(_mesh->vertices, _mesh->n_vertices, cs_join_vertex_t);
+
+ memcpy(_mesh->vertices,
+ ref_mesh->vertices,
+ _mesh->n_vertices*sizeof(cs_join_vertex_t));
+
+ /* Set return pointer */
+
+ *mesh = _mesh;
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Get the connectivity of a list of global elements distributed over the
+ * ranks.
+ *
+ * parameters:
+ * n_ranks <-- number of ranks in the MPI communicator
+ * send_rank_index <-- index on ranks for the face distribution
+ * send_faces <-- list of face ids to send
+ * send_mesh <-- pointer to the sending cs_join_mesh_t structure
+ * recv_mesh <-> pointer to the receiving cs_join_mesh_t structure
+ * comm <-- mpi communicator on which take places comm.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_exchange(int n_ranks,
+ const cs_int_t send_rank_index[],
+ const cs_int_t send_faces[],
+ const cs_join_mesh_t *send_mesh,
+ cs_join_mesh_t *recv_mesh,
+ MPI_Comm comm)
+{
+ int i, j, rank, shift, start, end, face_id, vtx_id, vtx_count;
+ int local_rank;
+
+ cs_int_t n_face_to_recv = 0, n_vertices = 0, vtx_tag_size = 0;
+ cs_int_t *vtx_shift = NULL, *vtx_tag = NULL;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ fvm_gnum_t *send_gbuf = NULL, *recv_gbuf = NULL;
+ cs_join_vertex_t *send_vtx_buf = NULL, *recv_vtx_buf = NULL;
+
+ MPI_Datatype MPI_JOIN_VERTEX = cs_join_mesh_create_vtx_datatype();
+
+ /* Sanity checks */
+
+#if defined(DEBUG) && !defined(NDEBUG)
+ int n_verif_ranks;
+
+ MPI_Comm_size(comm, &n_verif_ranks);
+
+ assert(n_ranks == n_verif_ranks);
+#endif
+
+ assert(send_mesh != NULL);
+ assert(recv_mesh != NULL);
+ assert(send_rank_index != NULL);
+ assert(n_ranks > 1);
+
+ MPI_Comm_rank(comm, &local_rank);
+
+ /* Count the number of faces to recv */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = send_rank_index[i+1] - send_rank_index[i];
+
+ /* Exchange number of elements to send */
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, comm);
+
+ for (i = 0; i < n_ranks; i++)
+ n_face_to_recv += recv_count[i];
+
+ /* Update cs_join_mesh_t structure */
+
+ recv_mesh->n_faces = n_face_to_recv;
+
+ BFT_MALLOC(recv_mesh->face_gnum, n_face_to_recv, fvm_gnum_t);
+ BFT_MALLOC(recv_mesh->face_vtx_idx, n_face_to_recv + 1, cs_int_t);
+
+ /*
+ The mesh doesn't change from a global point of view.
+ It's only a redistribution of the elements according to the send_faces
+ list.
+ */
+
+ recv_mesh->n_g_faces = send_mesh->n_g_faces;
+ recv_mesh->n_g_vertices = send_mesh->n_g_vertices;
+
+ /* Exchange face connect. count */
+
+ BFT_MALLOC(vtx_tag, send_mesh->n_vertices, cs_int_t);
+ BFT_MALLOC(vtx_shift, n_ranks+1, cs_int_t);
+
+ vtx_shift[0] = 0;
+
+ for (i = 0; i < n_ranks; i++) {
+ vtx_shift[i+1] = 0;
+ send_count[i] = 0;
+ }
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = 0; i < send_mesh->n_vertices; i++)
+ vtx_tag[i] = -1;
+
+ for (i = send_rank_index[rank]; i < send_rank_index[rank+1]; i++) {
+
+ face_id = send_faces[i];
+ start = send_mesh->face_vtx_idx[face_id] - 1;
+ end = send_mesh->face_vtx_idx[face_id+1] - 1;
+ n_vertices = end - start;
+
+ for (j = start; j < end; j++) {
+
+ vtx_id = send_mesh->face_vtx_lst[j] - 1;
+
+ if (vtx_tag[vtx_id] < 0) {
+ vtx_tag[vtx_id] = 1;
+ vtx_shift[rank+1] += 1;
+ }
+
+ }
+
+ send_count[rank] += 1 /* face_gnum */
+ + 1 /* n_vertices */
+ + n_vertices; /* face connect. */
+
+ }
+
+ } /* End of loop on ranks */
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, comm);
+
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+
+ /* Build index arrays */
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ recv_shift[rank+1] = recv_shift[rank] + recv_count[rank];
+ send_shift[rank+1] = send_shift[rank] + send_count[rank];
+ vtx_shift[rank+1] += vtx_shift[rank];
+
+ }
+
+ /* Build send_gbuf to exchange face connectivity */
+
+ BFT_MALLOC(send_gbuf, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv_gbuf, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ vtx_count = 0;
+
+ for (i = 0; i < send_mesh->n_vertices; i++)
+ vtx_tag[i] = -1;
+
+ for (i = send_rank_index[rank]; i < send_rank_index[rank + 1]; i++) {
+
+ shift = send_shift[rank] + send_count[rank];
+ face_id = send_faces[i];
+
+ start = send_mesh->face_vtx_idx[face_id] - 1;
+ end = send_mesh->face_vtx_idx[face_id+1] - 1;
+ n_vertices = end - start;
+
+ send_gbuf[shift++] = send_mesh->face_gnum[face_id];
+ send_gbuf[shift++] = n_vertices;
+
+ for (j = start; j < end; j++) {
+
+ vtx_id = send_mesh->face_vtx_lst[j] - 1;
+
+ if (vtx_tag[vtx_id] < 0)
+ vtx_tag[vtx_id] = vtx_count++;
+
+ send_gbuf[shift++] = vtx_tag[vtx_id];
+
+ }
+
+ send_count[rank] += 1 /* face_gnum */
+ + 1 /* n_vertices */
+ + n_vertices; /* face connect. */
+
+ }
+
+ } /* End of loop on ranks */
+
+ MPI_Alltoallv(send_gbuf, send_count, send_shift, FVM_MPI_GNUM,
+ recv_gbuf, recv_count, recv_shift, FVM_MPI_GNUM, comm);
+
+ BFT_FREE(send_gbuf);
+
+ /* Scan recv_gbuf to build face->vertex connect. index */
+
+ shift = 0;
+ face_id = 0;
+
+ while (shift < recv_shift[n_ranks]) {
+
+ recv_mesh->face_gnum[face_id] = recv_gbuf[shift++];
+ n_vertices = recv_gbuf[shift++];
+ recv_mesh->face_vtx_idx[face_id+1] = n_vertices;
+
+ face_id++;
+ shift += n_vertices;
+
+ }
+
+ assert(n_face_to_recv == face_id);
+ assert(shift == recv_shift[n_ranks]);
+
+ recv_mesh->face_vtx_idx[0] = 1;
+ for (i = 0; i < recv_mesh->n_faces; i++)
+ recv_mesh->face_vtx_idx[i+1] += recv_mesh->face_vtx_idx[i];
+
+ /* Scan recv_gbuf to build face->vertex connectivity list */
+
+ BFT_MALLOC(recv_mesh->face_vtx_lst,
+ recv_mesh->face_vtx_idx[n_face_to_recv], cs_int_t);
+
+ vtx_tag_size = send_mesh->n_vertices;
+
+ if (recv_mesh->face_vtx_idx[n_face_to_recv] > send_mesh->n_vertices) {
+
+ vtx_tag_size = recv_mesh->face_vtx_idx[n_face_to_recv];
+ BFT_REALLOC(vtx_tag, recv_mesh->face_vtx_idx[n_face_to_recv], cs_int_t);
+
+ }
+
+ /* Store vtx_shift data into send_count in order to re-use it */
+
+ for (rank = 0; rank < n_ranks; rank++)
+ send_count[rank] = vtx_shift[rank+1] - vtx_shift[rank];
+
+ for (rank = 0; rank < n_ranks + 1; rank++)
+ vtx_shift[rank] = 0;
+
+ shift = 0;
+ face_id = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ vtx_count = 0;
+
+ for (i = 0; i < vtx_tag_size; i++)
+ vtx_tag[i] = -1;
+
+ while (shift < recv_shift[rank + 1]) {
+
+ shift += 1; /* skip face_gnum */
+ n_vertices = recv_gbuf[shift++];
+ start = recv_mesh->face_vtx_idx[face_id] - 1;
+
+ for (j = 0; j < n_vertices; j++) {
+
+ vtx_id = recv_gbuf[shift++];
+
+ if (vtx_tag[vtx_id] < 0) {
+ vtx_count++;
+ vtx_tag[vtx_id] = vtx_shift[rank] + vtx_count;
+ }
+
+ recv_mesh->face_vtx_lst[start + j] = vtx_tag[vtx_id];
+
+ }
+
+ face_id++;
+
+ } /* Scan recv_gbuf for the current rank */
+
+ vtx_shift[rank+1] = vtx_shift[rank] + vtx_count;
+
+ } /* End of loop on ranks */
+
+ /* Exchange number of vertices to communicate */
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, comm);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank+1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank+1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ /* Partial memory management */
+
+ BFT_FREE(vtx_shift);
+ BFT_FREE(recv_gbuf);
+
+ BFT_MALLOC(send_vtx_buf, send_shift[n_ranks], cs_join_vertex_t);
+ BFT_MALLOC(recv_vtx_buf, recv_shift[n_ranks], cs_join_vertex_t);
+
+ /* Exchange vertex buffers */
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ vtx_count = 0;
+
+ for (i = 0; i < vtx_tag_size; i++)
+ vtx_tag[i] = -1;
+
+ for (i = send_rank_index[rank]; i < send_rank_index[rank + 1]; i++) {
+
+ face_id = send_faces[i];
+ start = send_mesh->face_vtx_idx[face_id] - 1;
+ end = send_mesh->face_vtx_idx[face_id+1] - 1;
+ n_vertices = end - start;
+
+ for (j = start; j < end; j++) {
+
+ vtx_id = send_mesh->face_vtx_lst[j] - 1;
+
+ if (vtx_tag[vtx_id] < 0) { /* add the vertex to send_vtx_buf */
+
+ shift = send_shift[rank] + vtx_count;
+ vtx_tag[vtx_id] = vtx_count++;
+ send_vtx_buf[shift] = send_mesh->vertices[vtx_id];
+
+ }
+
+ } /* End of loop on the face connectivity */
+
+ } /* End of loop on faces to send to the current rank */
+
+ } /* End of loop on ranks */
+
+ MPI_Alltoallv(send_vtx_buf, send_count, send_shift, MPI_JOIN_VERTEX,
+ recv_vtx_buf, recv_count, recv_shift, MPI_JOIN_VERTEX,
+ comm);
+
+ /* Update cs_join_mesh_t structure */
+
+ recv_mesh->n_vertices = recv_shift[n_ranks];
+
+ BFT_MALLOC(recv_mesh->vertices, recv_shift[n_ranks], cs_join_vertex_t);
+
+ memcpy(recv_mesh->vertices,
+ recv_vtx_buf,
+ recv_shift[n_ranks]*sizeof(cs_join_vertex_t));
+
+ /* Delete vertices which appear several times */
+
+ cs_join_mesh_vertex_clean(recv_mesh);
+
+ /* Free memory */
+
+ MPI_Type_free(&MPI_JOIN_VERTEX);
+ BFT_FREE(vtx_tag);
+ BFT_FREE(send_count);
+ BFT_FREE(recv_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(recv_shift);
+ BFT_FREE(send_vtx_buf);
+ BFT_FREE(recv_vtx_buf);
+
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_edges_t structure.
+ *
+ * parameters:
+ * edges <-> pointer to pointer to cs_join_edges_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_destroy_edges(cs_join_edges_t **edges)
+{
+ if (*edges != NULL) {
+
+ cs_join_edges_t *e = *edges;
+
+ if (e->n_edges > 0) {
+
+ BFT_FREE(e->gnum);
+ BFT_FREE(e->def);
+
+ BFT_FREE(e->vtx_idx);
+ BFT_FREE(e->adj_vtx_lst);
+ BFT_FREE(e->edge_lst);
+ }
+
+ BFT_FREE(*edges);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Order a cs_join_mesh_t structure according to the global face numbering
+ *
+ * Delete redundancies.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_join_mesh_t structure to order
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_face_order(cs_join_mesh_t *mesh)
+{
+ int i, j, o_id;
+ cs_int_t shift, start, end, n_new_faces;
+ fvm_gnum_t prev, cur;
+
+ cs_int_t n_faces = mesh->n_faces;
+ cs_int_t *num_buf = NULL, *selection = NULL;
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *gnum_buf = NULL;
+
+ assert(mesh != NULL);
+
+ if (n_faces == 0)
+ return;
+
+ /* Order faces according to their global numbering */
+
+ BFT_MALLOC(order, n_faces, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL, mesh->face_gnum, order, n_faces);
+
+ /* Order global face numbering */
+
+ BFT_MALLOC(gnum_buf, n_faces, fvm_gnum_t);
+ BFT_MALLOC(selection, n_faces, cs_int_t);
+
+ for (i = 0; i < n_faces; i++)
+ gnum_buf[i] = mesh->face_gnum[i];
+
+ prev = 0;
+ n_new_faces = 0;
+
+ for (i = 0; i < n_faces; i++) {
+
+ o_id = order[i];
+ cur = gnum_buf[o_id];
+
+ if (prev != cur) {
+ prev = cur;
+ selection[n_new_faces] = o_id;
+ mesh->face_gnum[n_new_faces] = cur;
+ n_new_faces++;
+ }
+
+ }
+
+ mesh->n_faces = n_new_faces;
+
+ BFT_FREE(gnum_buf);
+ BFT_FREE(order);
+
+ BFT_REALLOC(mesh->face_gnum, n_new_faces, fvm_gnum_t);
+ BFT_REALLOC(selection, n_new_faces, cs_int_t);
+
+ /* Order face -> vertex connectivity list */
+
+ BFT_MALLOC(num_buf, mesh->face_vtx_idx[n_faces], cs_int_t);
+
+ for (i = 0; i < mesh->face_vtx_idx[n_faces] - 1; i++)
+ num_buf[i] = mesh->face_vtx_lst[i];
+
+ shift = 0;
+
+ for (i = 0; i < n_new_faces; i++) {
+
+ o_id = selection[i];
+ start = mesh->face_vtx_idx[o_id] - 1;
+ end = mesh->face_vtx_idx[o_id+1] - 1;
+
+ for (j = start; j < end; j++)
+ mesh->face_vtx_lst[shift++] = num_buf[j];
+
+ } /* End of loop on faces */
+
+ BFT_REALLOC(num_buf, n_faces, cs_int_t);
+
+ for (i = 0; i < n_faces; i++)
+ num_buf[i] = mesh->face_vtx_idx[i+1] - mesh->face_vtx_idx[i];
+
+ for (i = 0; i < n_new_faces; i++) {
+ o_id = selection[i];
+ mesh->face_vtx_idx[i+1] = mesh->face_vtx_idx[i] + num_buf[o_id];
+ }
+
+ /* Memory management */
+
+ BFT_FREE(selection);
+ BFT_FREE(num_buf);
+ BFT_REALLOC(mesh->face_vtx_idx, n_new_faces+1, cs_int_t);
+ BFT_REALLOC(mesh->face_vtx_lst, mesh->face_vtx_idx[n_new_faces], cs_int_t);
+}
+
+/*----------------------------------------------------------------------------
+ * Delete vertices which appear several times (same global number) and
+ * vertices which are not used in face definition.
+ *
+ * parameters:
+ * mesh <-> pointer to cs_join_mesh_t structure to clean
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_vertex_clean(cs_join_mesh_t *mesh)
+{
+ cs_int_t i, j, shift, n_init_vertices, n_final_vertices;
+ fvm_gnum_t prev, cur;
+
+ fvm_lnum_t *order = NULL;
+ cs_int_t *init2final = NULL, *tag = NULL;
+ fvm_gnum_t *gnum_buf = NULL;
+ cs_join_vertex_t *final_vertices = NULL;
+
+ assert(mesh != NULL);
+
+ n_init_vertices = mesh->n_vertices;
+
+ if (n_init_vertices < 2)
+ return;
+
+ /* Count the final number of vertices */
+
+ BFT_MALLOC(order, n_init_vertices, fvm_lnum_t);
+ BFT_MALLOC(tag, n_init_vertices, cs_int_t);
+ BFT_MALLOC(gnum_buf, n_init_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_init_vertices; i++) {
+ gnum_buf[i] = mesh->vertices[i].gnum;
+ tag[i] = 0;
+ }
+
+ /* Tag vertices really used in the mesh definition */
+
+ for (i = 0; i < mesh->n_faces; i++)
+ for (j = mesh->face_vtx_idx[i] - 1; j < mesh->face_vtx_idx[i+1] - 1; j++)
+ tag[mesh->face_vtx_lst[j] - 1] = 1;
+
+ /* Order vertices by increasing global number */
+
+ fvm_order_local_allocated(NULL, gnum_buf, order, n_init_vertices);
+
+ n_final_vertices = 0;
+ prev = 0;
+
+ for (i = 0; i < n_init_vertices; i++) {
+
+ shift = order[i];
+ cur = gnum_buf[shift];
+
+ if (prev != cur && tag[i] > 0) {
+ n_final_vertices++;
+ prev = cur;
+ }
+
+ }
+
+ /* Define the final vertices structure and indirection between
+ initial numbering and final numbering */
+
+ BFT_MALLOC(final_vertices, n_final_vertices, cs_join_vertex_t);
+ BFT_MALLOC(init2final, n_init_vertices, cs_int_t);
+
+ n_final_vertices = 0;
+ prev = 0;
+
+ for (i = 0; i < n_init_vertices; i++) {
+
+ shift = order[i];
+ cur = gnum_buf[shift];
+
+ if (prev != cur && tag[i] > 0) {
+
+ final_vertices[n_final_vertices++] = mesh->vertices[shift];
+ prev = cur;
+
+ }
+
+ init2final[shift] = n_final_vertices;
+
+ }
+
+ BFT_FREE(mesh->vertices);
+
+ mesh->vertices = final_vertices;
+ mesh->n_vertices = n_final_vertices;
+
+ /* Update face->vertex connectivity list */
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ for (j = mesh->face_vtx_idx[i] - 1; j < mesh->face_vtx_idx[i+1] - 1; j++)
+ mesh->face_vtx_lst[j] = init2final[mesh->face_vtx_lst[j]-1];
+
+ } /* end of loop on faces */
+
+ BFT_FREE(init2final);
+ BFT_FREE(gnum_buf);
+ BFT_FREE(tag);
+ BFT_FREE(order);
+}
+
+/*----------------------------------------------------------------------------
+ * Clean the given cs_join_mesh_t structure, removing degenerate edges.
+ *
+ * parameters:
+ * mesh <-> pointer to the cs_join_mesh_t structure to clean
+ * verbosity <-- level of display
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_clean(cs_join_mesh_t *mesh,
+ int verbosity)
+{
+
+ /* Delete empty edge:
+ These edges are generated during the merge step. If two vertices
+ sharing the same edge are fused, we have to delete the resulting
+ edge.
+ */
+
+ _remove_empty_edges(mesh, verbosity);
+
+ /* Delete degenerate edge:
+ These edges are generated during the merge step.
+
+
+ x x
+ |\ |
+ | \ |
+ a2| \a3 A2|
+ | \ Merge |
+ | \ a4 of |
+ ---s1----s2------ vertices x
+ | \ s1 and s2 / \
+ | \ / \
+ a1| \a4 A1/ \A3
+ | \ / \
+ | \ / \
+ x-----------x x-----------x
+ a5 A4
+
+ */
+
+ _remove_degenerate_edges(mesh, verbosity);
+}
+
+/*----------------------------------------------------------------------------
+ * Define a list of edges associated to a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ *
+ * returns:
+ * a pointer to the new defined cs_join_edges_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_edges_t *
+cs_join_mesh_define_edges(const cs_join_mesh_t *mesh)
+{
+ int i, j;
+ cs_int_t v1_num, v2_num, o_id1, o_id2;
+ cs_int_t edge_shift, shift, n_init_edges;
+ fvm_gnum_t v1_gnum, v2_gnum;
+
+ fvm_lnum_t *order = NULL;
+ cs_int_t *vtx_counter = NULL, *vtx_lst = NULL;
+ fvm_gnum_t *adjacency = NULL;
+ cs_join_edges_t *edges = NULL;
+
+ if (mesh == NULL)
+ return edges;
+
+ /* Initialization and structure allocation */
+
+ BFT_MALLOC(edges, 1, cs_join_edges_t);
+
+ edges->n_edges = 0;
+ edges->def = NULL;
+ edges->gnum = NULL;
+ edges->n_vertices = mesh->n_vertices;
+ edges->vtx_idx = NULL;
+ edges->adj_vtx_lst = NULL;
+ edges->edge_lst = NULL;
+
+ /* Define edges */
+
+ n_init_edges = mesh->face_vtx_idx[mesh->n_faces] - 1;
+
+ if (n_init_edges == 0)
+ return edges;
+
+ BFT_MALLOC(edges->def, 2*n_init_edges, cs_int_t);
+ BFT_MALLOC(edges->vtx_idx, mesh->n_vertices + 1, cs_int_t);
+
+ for (i = 0; i < mesh->n_vertices + 1; i++)
+ edges->vtx_idx[i] = 0;
+
+ /* Loop on faces to initialize edge list */
+
+ BFT_MALLOC(vtx_lst, 2*n_init_edges, cs_int_t);
+ BFT_MALLOC(adjacency, 2*n_init_edges, fvm_gnum_t);
+
+ for (shift = 0, i = 0; i < mesh->n_faces; i++) {
+
+ cs_int_t start = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end = mesh->face_vtx_idx[i+1] - 1;
+
+ for (j = start; j < end - 1; j++) {
+
+ v1_num = mesh->face_vtx_lst[j];
+ v1_gnum = (mesh->vertices[v1_num-1]).gnum;
+ v2_num = mesh->face_vtx_lst[j+1];
+ v2_gnum = (mesh->vertices[v2_num-1]).gnum;
+
+ if (v1_gnum > v2_gnum) {
+
+ vtx_lst[2*shift] = v2_num;
+ adjacency[2*shift] = v2_gnum;
+ vtx_lst[2*shift+1] = v1_num;
+ adjacency[2*shift+1] = v1_gnum;
+
+ }
+ else {
+
+ vtx_lst[2*shift] = v1_num;
+ adjacency[2*shift] = v1_gnum;
+ vtx_lst[2*shift+1] = v2_num;
+ adjacency[2*shift+1] = v2_gnum;
+
+ }
+
+ shift++;
+
+ } /* End of loop on n-1 first vertices */
+
+ v1_num = mesh->face_vtx_lst[end-1];
+ v1_gnum = (mesh->vertices[v1_num-1]).gnum;
+ v2_num = mesh->face_vtx_lst[start];
+ v2_gnum = (mesh->vertices[v2_num-1]).gnum;
+
+ if (v1_gnum > v2_gnum) {
+
+ vtx_lst[2*shift] = v2_num;
+ adjacency[2*shift] = v2_gnum;
+ vtx_lst[2*shift+1] = v1_num;
+ adjacency[2*shift+1] = v1_gnum;
+
+ }
+ else {
+
+ vtx_lst[2*shift] = v1_num;
+ adjacency[2*shift] = v1_gnum;
+ vtx_lst[2*shift+1] = v2_num;
+ adjacency[2*shift+1] = v2_gnum;
+
+ }
+
+ shift++;
+
+ } /* End of loop on faces */
+
+ assert(shift == n_init_edges);
+
+ BFT_MALLOC(order, n_init_edges, fvm_lnum_t);
+
+ fvm_order_local_allocated_s(NULL, adjacency, 2, order, n_init_edges);
+
+ /* Fill cs_join_edges_t structure */
+
+ o_id1 = order[0];
+ edges->def[0] = vtx_lst[2*o_id1];
+ edges->def[1] = vtx_lst[2*o_id1+1];
+ edges->vtx_idx[vtx_lst[2*o_id1]] += 1;
+ edges->vtx_idx[vtx_lst[2*o_id1+1]] += 1;
+ edge_shift = 1;
+
+ for (i = 1; i < n_init_edges; i++) {
+
+ o_id1 = order[i-1];
+ o_id2 = order[i];
+
+ if ( vtx_lst[2*o_id1] != vtx_lst[2*o_id2]
+ || vtx_lst[2*o_id1+1] != vtx_lst[2*o_id2+1]) {
+
+ edges->vtx_idx[vtx_lst[2*o_id2]] += 1;
+ edges->vtx_idx[vtx_lst[2*o_id2+1]] += 1;
+ edges->def[2*edge_shift] = vtx_lst[2*o_id2];
+ edges->def[2*edge_shift+1] = vtx_lst[2*o_id2+1];
+ edge_shift++;
+
+ }
+
+ } /* End of loop on edges */
+
+ edges->n_edges = edge_shift;
+ BFT_REALLOC(edges->def, 2*edges->n_edges, cs_int_t);
+
+ /* Build adj_vtx_lst and edge_lst */
+
+ BFT_MALLOC(vtx_counter, mesh->n_vertices, cs_int_t);
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+ edges->vtx_idx[i+1] += edges->vtx_idx[i];
+ vtx_counter[i] = 0;
+ }
+
+ BFT_MALLOC(edges->adj_vtx_lst, edges->vtx_idx[mesh->n_vertices], cs_int_t);
+ BFT_MALLOC(edges->edge_lst, edges->vtx_idx[mesh->n_vertices], cs_int_t);
+
+ {
+ cs_int_t vtx_id_a, vtx_id_b, shift_a, shift_b;
+ fvm_gnum_t vtx_gnum_a, vtx_gnum_b;
+
+ cs_int_t cur_edge_num = 1;
+
+ /* Initiate edge_lst and adj_vtx_lst building */
+
+ o_id1 = order[0];
+
+ vtx_id_a = vtx_lst[2*o_id1]-1;
+ vtx_id_b = vtx_lst[2*o_id1+1]-1;
+
+ vtx_gnum_a = (mesh->vertices[vtx_id_a]).gnum;
+ vtx_gnum_b = (mesh->vertices[vtx_id_a]).gnum;
+
+ shift_a = edges->vtx_idx[vtx_id_a];
+ shift_b = edges->vtx_idx[vtx_id_b];
+
+ vtx_counter[vtx_id_a] += 1;
+ vtx_counter[vtx_id_b] += 1;
+
+ edges->adj_vtx_lst[shift_a] = vtx_id_b + 1;
+ edges->adj_vtx_lst[shift_b] = vtx_id_a + 1;
+
+ if (vtx_gnum_a > vtx_gnum_b) {
+ edges->edge_lst[shift_a] = -cur_edge_num;
+ edges->edge_lst[shift_b] = cur_edge_num;
+ }
+ else {
+ edges->edge_lst[shift_a] = cur_edge_num;
+ edges->edge_lst[shift_b] = -cur_edge_num;
+ }
+
+ cur_edge_num++;
+
+ for (i = 1; i < n_init_edges; i++) {
+
+ o_id1 = order[i-1];
+ o_id2 = order[i];
+
+ if ( vtx_lst[2*o_id1] != vtx_lst[2*o_id2]
+ || vtx_lst[2*o_id1+1] != vtx_lst[2*o_id2+1]) {
+
+ vtx_id_a = vtx_lst[2*o_id2]-1;
+ vtx_id_b = vtx_lst[2*o_id2+1]-1;
+
+ vtx_gnum_a = (mesh->vertices[vtx_id_a]).gnum;
+ vtx_gnum_b = (mesh->vertices[vtx_id_a]).gnum;
+
+ shift_a = edges->vtx_idx[vtx_id_a] + vtx_counter[vtx_id_a];
+ shift_b = edges->vtx_idx[vtx_id_b] + vtx_counter[vtx_id_b];
+
+ vtx_counter[vtx_id_a] += 1;
+ vtx_counter[vtx_id_b] += 1;
+
+ edges->adj_vtx_lst[shift_a] = vtx_id_b + 1;
+ edges->adj_vtx_lst[shift_b] = vtx_id_a + 1;
+
+ if (vtx_gnum_a > vtx_gnum_b) {
+ edges->edge_lst[shift_a] = -cur_edge_num;
+ edges->edge_lst[shift_b] = cur_edge_num;
+ }
+ else {
+ edges->edge_lst[shift_a] = cur_edge_num;
+ edges->edge_lst[shift_b] = -cur_edge_num;
+ }
+
+ cur_edge_num++;
+
+ }
+
+ } /* End of loop on edges */
+
+ assert(cur_edge_num - 1 == edges->n_edges);
+
+ } /* End of adj_vtx_lst and edge_lst building */
+
+ /* Partial clean-up */
+
+ BFT_FREE(vtx_lst);
+ BFT_FREE(vtx_counter);
+
+ /* Define a global numbering on edges */
+
+ BFT_MALLOC(edges->gnum, edges->n_edges, fvm_gnum_t);
+ BFT_REALLOC(adjacency, 2*edges->n_edges, fvm_gnum_t);
+
+ for (i = 0; i < edges->n_edges; i++) {
+
+ cs_int_t v1_id = edges->def[2*i] - 1;
+ cs_int_t v2_id = edges->def[2*i+1] - 1;
+
+ v1_gnum = (mesh->vertices[v1_id]).gnum;
+ v2_gnum = (mesh->vertices[v2_id]).gnum;
+
+ if (v1_gnum > v2_gnum) {
+ adjacency[2*i] = v2_gnum;
+ adjacency[2*i+1] = v1_gnum;
+ }
+ else {
+ adjacency[2*i] = v1_gnum;
+ adjacency[2*i+1] = v2_gnum;
+ }
+
+ } /* End of loop on edges */
+
+ /* Order vtx_lst and build an order list into adjacency */
+
+ fvm_order_local_allocated_s(NULL, adjacency, 2, order, edges->n_edges);
+
+ if (cs_glob_n_ranks == 1) { /* Serial treatment */
+
+ edges->n_g_edges = edges->n_edges;
+
+ for (i = 0; i < edges->n_edges; i++) {
+
+ cs_int_t o_id = order[i];
+
+ edges->gnum[i] = o_id+1;
+
+ }
+
+ }
+ else { /* Parallel treatment */
+
+ fvm_gnum_t *order_couples = NULL;
+ fvm_io_num_t *edge_io_num = NULL;
+ const fvm_gnum_t *edges_gnum = NULL;
+
+ assert(cs_glob_n_ranks > 1);
+
+ BFT_MALLOC(order_couples, 2*edges->n_edges, fvm_gnum_t);
+
+ for (i = 0; i < edges->n_edges; i++) {
+
+ cs_int_t o_id = order[i];
+
+ order_couples[2*i] = adjacency[2*o_id];
+ order_couples[2*i+1] = adjacency[2*o_id+1];
+
+ } /* End of loop on edges */
+
+ edge_io_num = fvm_io_num_create_from_adj_s(NULL,
+ order_couples,
+ edges->n_edges,
+ 2);
+
+ edges->n_g_edges = fvm_io_num_get_global_count(edge_io_num);
+ edges_gnum = fvm_io_num_get_global_num(edge_io_num);
+
+ for (i = 0; i < edges->n_edges; i++)
+ edges->gnum[i] = edges_gnum[i];
+
+ /* Partial Clean-up */
+
+ BFT_FREE(order_couples);
+ fvm_io_num_destroy(edge_io_num);
+
+ }
+
+ /* Memory management */
+
+ BFT_FREE(adjacency);
+ BFT_FREE(order);
+
+ /* Return pointers */
+
+ return edges;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the edge number relative to a couple of vertex numbers.
+ *
+ * edge_num > 0 if couple is in the same order as the edge->def
+ * edge_num < 0 otherwise
+ *
+ * parameters:
+ * v1_num <-- vertex number for the first vertex
+ * v2_num <-- vertex number for the second vertex
+ * edges <-- pointer to a cs_join_edges_t structure
+ *
+ * returns:
+ * an edge number relative to the couple of vertices
+ *---------------------------------------------------------------------------*/
+
+cs_int_t
+cs_join_mesh_get_edge(cs_int_t v1_num,
+ cs_int_t v2_num,
+ const cs_join_edges_t *edges)
+{
+ cs_int_t i;
+ cs_int_t edge_num = 0;
+
+ assert(edges != NULL);
+ assert(v1_num > 0);
+ assert(v2_num > 0);
+
+ if (edges->vtx_idx[v1_num] - edges->vtx_idx[v1_num-1] == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" The given vertex number: %d is not defined"
+ " in the edge structure (edges->vtx_idx).\n"), v1_num);
+
+ for (i = edges->vtx_idx[v1_num-1]; i < edges->vtx_idx[v1_num]; i++) {
+ if (edges->adj_vtx_lst[i] == v2_num) {
+ edge_num = edges->edge_lst[i];
+ break;
+ }
+ }
+
+ if (edge_num == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" The given couple of vertex numbers :\n"
+ " vertex 1 : %d\n"
+ " vertex 2 : %d\n"
+ " is not defined in the edge structure.\n"), v1_num, v2_num);
+
+ assert(edge_num != 0);
+
+ return edge_num;
+}
+
+/*----------------------------------------------------------------------------
+ * Re-organize the cs_join_mesh_t structure after a renumbering of
+ * the vertices following the merge operation + a new description of each
+ * face.
+ *
+ * parameters:
+ * mesh <-> pointer to the cs_join_mesh_t structure to update
+ * edges <-- pointer to a cs_join_edges_t structure
+ * edge_index <-- index on edges for the new vertices
+ * edge_new_vtx_lst <-- list of new vertices for each edge
+ * n_new_vertices <-- new local number of vertices after merge
+ * old2new <-- array storing the relation between old/new vertex id
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_update(cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ const cs_int_t edge_index[],
+ const cs_int_t edge_new_vtx_lst[],
+ cs_int_t n_new_vertices,
+ const cs_int_t old2new[])
+{
+ cs_int_t i, j, n_adds;
+
+ cs_join_vertex_t *new_vertices = NULL;
+ cs_int_t *new_face_vtx_idx = NULL, *new_face_vtx_lst = NULL;
+
+ /* Sanity checks */
+
+ assert(mesh != NULL);
+ assert(edges != NULL);
+
+ /* Update description and numbering for face -> vertex connectivity */
+
+ if (edge_new_vtx_lst != NULL) {
+
+ BFT_MALLOC(new_face_vtx_idx, mesh->n_faces + 1, cs_int_t);
+
+ for (i = 0; i < mesh->n_faces + 1; i++)
+ new_face_vtx_idx[i] = 0;
+
+ /* Update face -> vertex connectivity.
+ add new vertices between the existing one */
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ cs_int_t start_id = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end_id = mesh->face_vtx_idx[i+1] - 1;
+
+ for (j = start_id; j < end_id - 1; j++) {
+
+ n_adds = _count_new_added_vtx_to_edge(mesh->face_vtx_lst[j],
+ mesh->face_vtx_lst[j+1],
+ old2new,
+ edges,
+ edge_index,
+ edge_new_vtx_lst);
+
+ new_face_vtx_idx[i+1] += n_adds;
+
+ }
+
+ /* Case end - start */
+
+ n_adds = _count_new_added_vtx_to_edge(mesh->face_vtx_lst[end_id-1],
+ mesh->face_vtx_lst[start_id],
+ old2new,
+ edges,
+ edge_index,
+ edge_new_vtx_lst);
+
+ new_face_vtx_idx[i+1] += n_adds;
+
+ } /* End of loop on faces */
+
+ /* Build new face_vtx_idx */
+
+ new_face_vtx_idx[0] = 1;
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ new_face_vtx_idx[i+1] += new_face_vtx_idx[i];
+
+ if (new_face_vtx_idx[i+1] < 3)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Problem in mesh connectivity."
+ " Face: %lu\n"
+ " Problem detected during connectivity update:\n"
+ " The face is defined by less than 3 points"
+ " (excessive merging has occured).\n\n"
+ " Modify joining parameters to reduce merging"
+ " (fraction & merge).\n"),
+ (unsigned long)(mesh->face_gnum[i]));
+
+ }
+
+ /* Build new_face_vtx_lst */
+
+ BFT_MALLOC(new_face_vtx_lst, new_face_vtx_idx[mesh->n_faces], cs_int_t);
+
+ } /* End if edge_new_vtx_lst != NULL */
+
+ else { /* edge_new_vtx_lst == NULL */
+
+ new_face_vtx_idx = mesh->face_vtx_idx;
+ new_face_vtx_lst = mesh->face_vtx_lst;
+
+ }
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ cs_int_t start_id = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end_id = mesh->face_vtx_idx[i+1] - 1;
+ cs_int_t shift = new_face_vtx_idx[i] - 1;
+
+ for (j = start_id; j < end_id-1; j++)
+ _add_new_vtx_to_edge(mesh->face_vtx_lst[j],
+ mesh->face_vtx_lst[j+1],
+ old2new,
+ edges,
+ edge_index,
+ edge_new_vtx_lst,
+ new_face_vtx_lst,
+ &shift);
+
+ /* Case end - start */
+
+ _add_new_vtx_to_edge(mesh->face_vtx_lst[end_id-1],
+ mesh->face_vtx_lst[start_id],
+ old2new,
+ edges,
+ edge_index,
+ edge_new_vtx_lst,
+ new_face_vtx_lst,
+ &shift);
+
+ } /* End of loop on faces */
+
+ if (edge_new_vtx_lst != NULL) {
+
+ BFT_FREE(mesh->face_vtx_idx);
+ BFT_FREE(mesh->face_vtx_lst);
+
+ mesh->face_vtx_idx = new_face_vtx_idx;
+ mesh->face_vtx_lst = new_face_vtx_lst;
+ }
+
+ /* Define the new_vertices structure */
+
+ BFT_MALLOC(new_vertices, n_new_vertices, cs_join_vertex_t);
+
+ for (i = 0; i < mesh->n_vertices; i++)
+ new_vertices[old2new[i]] = mesh->vertices[i];
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n\n Dump Old2New array : "
+ "n_old_vertices = %d - n_new_vertices = %d\n",
+ mesh->n_vertices, n_new_vertices);
+ for (i = 0; i < mesh->n_vertices; i++)
+ bft_printf("Old num : %7d (%9u) => New num : %7d (%9u)\n",
+ i+1 , mesh->vertices[i].gnum,
+ old2new[i]+1, new_vertices[old2new[i]].gnum);
+ bft_printf_flush();
+#endif
+
+ /* Update mesh structure */
+
+ BFT_FREE(mesh->vertices);
+
+ mesh->n_vertices = n_new_vertices;
+ mesh->n_g_vertices = n_new_vertices;
+ mesh->vertices = new_vertices;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ fvm_gnum_t *vtx_gnum = NULL;
+ fvm_io_num_t *io_num = NULL;
+
+ /* Global number of selected vertices and associated
+ fvm_io_num_t structure */
+
+ BFT_MALLOC(vtx_gnum, n_new_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_new_vertices; i++)
+ vtx_gnum[i] = (mesh->vertices[i]).gnum;
+
+ io_num = fvm_io_num_create(NULL, vtx_gnum, n_new_vertices, 0);
+
+ mesh->n_g_vertices = fvm_io_num_get_global_count(io_num);
+
+ fvm_io_num_destroy(io_num);
+
+ BFT_FREE(vtx_gnum);
+
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Compute for each face of the cs_join_mesh_t structure the face normal.
+ * || face_normal || = 1 (divided by the area of the face)
+ *
+ * The caller is responsible for freeing the returned array.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ *
+ * Pi+1
+ * *---------* B : barycenter of the polygon
+ * / . . \
+ * / . . \ Pi : vertices of the polygon
+ * / . . \
+ * / . . Ti \ Ti : triangle
+ * *.........B.........* Pi
+ * Pn-1 \ . . /
+ * \ . . /
+ * \ . . /
+ * \ . T0 . /
+ * *---------*
+ * P0
+ *
+ *
+ * returns:
+ * an array with the face normal for each face of the mesh
+ *---------------------------------------------------------------------------*/
+
+cs_real_t *
+cs_join_mesh_get_face_normal(const cs_join_mesh_t *mesh)
+{
+ cs_int_t i, j, k, vid;
+ double inv_norm;
+
+ cs_int_t n_max_vertices = 0;
+ cs_real_t *face_vtx_coord = NULL;
+ cs_real_t *face_normal = NULL;
+
+ if (mesh == NULL)
+ return face_normal;
+
+ if (mesh->n_faces == 0)
+ return face_normal;
+
+ BFT_MALLOC(face_normal, 3*mesh->n_faces, cs_real_t);
+
+ for (i = 0; i < 3*mesh->n_faces; i++)
+ face_normal[i] = 0.0;
+
+ /* Compute n_max_vertices */
+
+ for (i = 0; i < mesh->n_faces; i++)
+ n_max_vertices = CS_MAX(n_max_vertices,
+ mesh->face_vtx_idx[i+1] - mesh->face_vtx_idx[i]);
+
+ BFT_MALLOC(face_vtx_coord, 3*(n_max_vertices+1), cs_real_t);
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ cs_real_t v1[3], v2[3], tri_normal[3];
+
+ cs_int_t shift = 0;
+ cs_int_t s = mesh->face_vtx_idx[i] - 1;
+ cs_int_t e = mesh->face_vtx_idx[i+1] - 1;
+ cs_int_t n_face_vertices = e - s;
+ double inv_n_face_vertices = 1/(double)n_face_vertices;
+
+ cs_real_t bary[3] = { 0.0, 0.0, 0.0};
+ cs_real_t fnorm[3] = { 0.0, 0.0, 0.0};
+
+ /* Fill face_vtx_coord */
+
+ for (j = s; j < e; j++) {
+ vid = mesh->face_vtx_lst[j] - 1;
+ for (k = 0; k < 3; k++)
+ face_vtx_coord[shift++] = mesh->vertices[vid].coord[k];
+ }
+
+ vid = mesh->face_vtx_lst[s] - 1;
+ for (k = 0; k < 3; k++)
+ face_vtx_coord[shift++] = mesh->vertices[vid].coord[k];
+
+ /* Compute the barycenter of the face */
+
+ for (j = 0; j < n_face_vertices; j++)
+ for (k = 0; k < 3; k++)
+ bary[k] += face_vtx_coord[3*j+k];
+
+ for (k = 0; k < 3; k++)
+ bary[k] *= inv_n_face_vertices;
+
+ /* Loop on the triangles of the face defined by an edge of the face
+ and the barycenter */
+
+ for (j = 0; j < n_face_vertices; j++) {
+
+ /* Computation of the normal of each triangle Ti:
+ -> --> -->
+ N(Ti) = 1/2 ( BPi X BPi+1 )
+ */
+
+ for (k = 0; k < 3; k++) {
+ v1[k] = face_vtx_coord[3*j + k] - bary[k];
+ v2[k] = face_vtx_coord[3*(j+1)+ k] - bary[k];
+ }
+
+ _cross_product(v1, v2, tri_normal);
+
+ /* Computation of the normal of the polygon
+ => vectorial sum of normals of each triangle
+
+ -> n-1 ->
+ N(P) = Sum ( N(Ti) )
+ i=0
+ */
+
+ for (k = 0; k < 3; k++)
+ fnorm[k] += 0.5 * tri_normal[k];
+
+ } /* End of loop on vertices of the face */
+
+ inv_norm = 1/sqrt(_dot_product(fnorm, fnorm));
+
+ for (k = 0; k < 3; k++)
+ face_normal[3*i+k] = inv_norm * fnorm[k];
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf(" Face_num: %5d (%u)- face_normal [%8.4e, %8.4e, %8.4e]\n",
+ i+1, mesh->face_gnum[i],
+ face_normal[3*i], face_normal[3*i+1], face_normal[3*i+2]);
+ bft_printf_flush();
+#endif
+
+ } /* End of loop on faces */
+
+ /* Free memory */
+
+ BFT_FREE(face_vtx_coord);
+
+ return face_normal;
+}
+
+/*----------------------------------------------------------------------------
+ * Allocate and define an "edge -> face" connectivity
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure
+ * edges <-- pointer to a cs_join_edges_t structure
+ * edge_face_idx --> pointer to the edge -> face connect. index
+ * edge_face_lst --> pointer to the edge -> face connect. list
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_get_edge_face_adj(const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ cs_int_t *edge_face_idx[],
+ cs_int_t *edge_face_lst[])
+{
+ cs_int_t i, j, k, edge_id, shift;
+ cs_int_t n_edges, n_faces;
+
+ cs_int_t n_max_vertices = 0;
+ cs_int_t *counter = NULL;
+ cs_int_t *face_connect = NULL;
+ cs_int_t *_edge_face_idx = NULL;
+ cs_int_t *_edge_face_lst = NULL;
+
+ if (mesh == NULL || edges == NULL)
+ return;
+
+ n_edges = edges->n_edges;
+ n_faces = mesh->n_faces;
+
+ /* Compute n_max_vertices */
+
+ for (i = 0; i < n_faces; i++)
+ n_max_vertices = CS_MAX(n_max_vertices,
+ mesh->face_vtx_idx[i+1]-mesh->face_vtx_idx[i]);
+
+ BFT_MALLOC(face_connect, n_max_vertices + 1, cs_int_t);
+ BFT_MALLOC(counter, n_edges, cs_int_t);
+
+ /* Build an edge -> face connectivity */
+
+ BFT_MALLOC(_edge_face_idx, n_edges+1, cs_int_t);
+
+ for (i = 0; i < n_edges+1; i++)
+ _edge_face_idx[i] = 0;
+
+ for (i = 0; i < n_edges; i++)
+ counter[i] = 0;
+
+ /* Build index */
+
+ for (i = 0; i < n_faces; i++) {
+
+ cs_int_t start_id = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end_id = mesh->face_vtx_idx[i+1] - 1;
+ cs_int_t n_face_vertices = end_id - start_id;
+
+ for (j = start_id, k = 0; j < end_id; j++, k++)
+ face_connect[k] = mesh->face_vtx_lst[j];
+ face_connect[n_face_vertices] = mesh->face_vtx_lst[start_id];
+
+ assert(n_face_vertices == k);
+
+ for (j = 0; j < n_face_vertices; j++) {
+
+ cs_int_t vtx_id1 = face_connect[j] - 1;
+
+ for (k = edges->vtx_idx[vtx_id1]; k < edges->vtx_idx[vtx_id1+1]; k++)
+ if (edges->adj_vtx_lst[k] == face_connect[j+1])
+ break;
+
+ assert(k != edges->vtx_idx[vtx_id1+1]);
+
+ _edge_face_idx[CS_ABS(edges->edge_lst[k])] += 1;
+
+ } /* End of loop on vertices of the face */
+
+ } /* End of loop on faces */
+
+ for (i = 0; i < n_edges; i++)
+ _edge_face_idx[i+1] += _edge_face_idx[i];
+
+ BFT_MALLOC(_edge_face_lst, _edge_face_idx[n_edges], cs_int_t);
+
+ /* Fill "edge -> face" connectivity list */
+
+ for (i = 0; i < n_faces; i++) {
+
+ cs_int_t start_id = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end_id = mesh->face_vtx_idx[i+1] - 1;
+ cs_int_t n_face_vertices = end_id - start_id;
+
+ for (j = start_id, k = 0; j < end_id; j++, k++)
+ face_connect[k] = mesh->face_vtx_lst[j];
+ face_connect[n_face_vertices] = mesh->face_vtx_lst[start_id];
+
+ for (j = 0; j < n_face_vertices; j++) {
+
+ cs_int_t vtx_id1 = face_connect[j] - 1;
+
+ for (k = edges->vtx_idx[vtx_id1];
+ k < edges->vtx_idx[vtx_id1+1]; k++)
+ if (edges->adj_vtx_lst[k] == face_connect[j+1])
+ break;
+
+ edge_id = CS_ABS(edges->edge_lst[k]) - 1;
+ shift = _edge_face_idx[edge_id] + counter[edge_id];
+ _edge_face_lst[shift] = i+1;
+ counter[edge_id] += 1;
+
+ } /* End of loop on vertices of the face */
+
+ } /* End of loop on faces */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n DUMP EDGE -> FACE CONNECTIVITY:\n\n");
+
+ for (i = 0; i < n_edges; i++) {
+
+ cs_int_t start = _edge_face_idx[i];
+ cs_int_t end = _edge_face_idx[i+1];
+ cs_int_t v1_id = edges->def[2*i] - 1;
+ cs_int_t v2_id = edges->def[2*i+1] - 1;
+
+ bft_printf(" edge_num: %6d (%9u) [%9u - %9u]: size: %4d, faces: ",
+ i+1, edges->gnum[i],
+ mesh->vertices[v1_id].gnum, mesh->vertices[v2_id].gnum,
+ end-start);
+ for (j = start; j < end; j++)
+ bft_printf(" %u ", mesh->face_gnum[_edge_face_lst[j]-1]);
+ bft_printf("\n");
+ bft_printf_flush();
+ }
+ bft_printf("\n");
+#endif
+
+ /* Set return pointers */
+
+ *edge_face_idx = _edge_face_idx;
+ *edge_face_lst = _edge_face_lst;
+
+ /* Free memory*/
+
+ BFT_FREE(counter);
+ BFT_FREE(face_connect);
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_vertex_t structure.
+ *
+ * parameters:
+ * vertex <-- cs_join_vertex_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_vertex(const cs_join_vertex_t vertex)
+{
+ assert(vertex.gnum > 0);
+ assert(vertex.tolerance >= 0.0);
+
+ bft_printf(" %10u | %11.6f | [ %12.6g %12.6g %12.6g]\n",
+ vertex.gnum, vertex.tolerance,
+ vertex.coord[0], vertex.coord[1], vertex.coord[2]);
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_vertex_t structure into a file.
+ *
+ * parameters:
+ * file <-- pointer to a FILE structure
+ * vertex <-- cs_join_vertex_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_vertex_file(FILE *file,
+ const cs_join_vertex_t vertex)
+{
+ assert(vertex.gnum > 0);
+ assert(vertex.tolerance >= 0.0);
+
+ fprintf(file," %10u | %11.6f | [ %12.6g %12.6g %12.6g]\n",
+ vertex.gnum, vertex.tolerance,
+ vertex.coord[0], vertex.coord[1], vertex.coord[2]);
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_join_mesh_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump(const cs_join_mesh_t *mesh)
+{
+ int i, j;
+
+ if (mesh == NULL) {
+ bft_printf(_("\n\n -- Dump a cs_join_mesh_t structure: (%p) --\n"),
+ mesh);
+ return;
+ }
+
+ bft_printf(_("\n\n -- Dump a cs_join_mesh_t structure: %s (%p) --\n"),
+ mesh->name, mesh);
+ bft_printf(_("\n mesh->n_faces: %9d\n"), mesh->n_faces);
+ bft_printf(_(" mesh->n_g_faces: %11u\n\n"), mesh->n_g_faces);
+
+ if (mesh->face_vtx_idx != NULL) {
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ cs_int_t start = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end = mesh->face_vtx_idx[i+1] - 1;
+
+ bft_printf(_("\n face_id: %5d gnum: %9u - n_vertices: %4d\n"),
+ i, mesh->face_gnum[i], end-start);
+
+ for (j = start; j < end; j++) {
+
+ cs_int_t vtx_id = mesh->face_vtx_lst[j]-1;
+ cs_join_vertex_t v_data = mesh->vertices[vtx_id];
+
+ bft_printf(" %6d - %8u - [ %8.4f %8.4f %8.4f]\n",
+ vtx_id+1, v_data.gnum,
+ v_data.coord[0], v_data.coord[1], v_data.coord[2]);
+
+ }
+ bft_printf("\n");
+
+ /* Check if there is no incoherency in the mesh definition */
+
+ for (j = start; j < end - 1; j++) {
+
+ cs_int_t vtx_id1 = mesh->face_vtx_lst[j]-1;
+ cs_int_t vtx_id2 = mesh->face_vtx_lst[j+1]-1;
+
+ if (vtx_id1 == vtx_id2) {
+ bft_printf(_(" Incoherency found in the current mesh definition\n"
+ " Face number: %d (global: %u)\n"
+ " Vertices: local (%d, %d), global (%u, %u)"
+ " are defined twice\n"),
+ i+1, mesh->face_gnum[i], vtx_id1+1, vtx_id2+1,
+ (mesh->vertices[vtx_id1]).gnum,
+ (mesh->vertices[vtx_id2]).gnum);
+ bft_printf_flush();
+ assert(0);
+ }
+
+ }
+
+ {
+ cs_int_t vtx_id1 = mesh->face_vtx_lst[end-1]-1;
+ cs_int_t vtx_id2 = mesh->face_vtx_lst[start]-1;
+
+ if (vtx_id1 == vtx_id2) {
+ bft_printf(_(" Incoherency found in the current mesh definition\n"
+ " Face number: %d (global: %u)\n"
+ " Vertices: local (%d, %d), global (%u, %u)"
+ " are defined twice\n"),
+ i+1, mesh->face_gnum[i], vtx_id1+1, vtx_id2+1,
+ (mesh->vertices[vtx_id1]).gnum,
+ (mesh->vertices[vtx_id2]).gnum);
+ bft_printf_flush();
+ assert(0);
+ }
+ }
+
+ } /* End of loop on faces */
+
+ } /* End if face_vtx_idx != NULL */
+
+ bft_printf(_("\n Dump vertex data\n"
+ " mesh->vertices : %p\n"
+ " mesh->n_vertices : %11d\n"
+ " mesh->n_g_vertices : %11u\n\n"),
+ mesh->vertices, mesh->n_vertices, mesh->n_g_vertices);
+
+ if (mesh->n_vertices > 0) {
+
+ bft_printf(_(" Local Num | Global Num | Tolerance |"
+ " Coordinates\n\n"));
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+
+ bft_printf(" %9d |", i+1);
+ cs_join_mesh_dump_vertex(mesh->vertices[i]);
+
+ }
+
+ }
+ bft_printf("\n");
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_mesh_t structure into a file.
+ *
+ * parameters:
+ * file <-- pointer to a FILE structure
+ * mesh <-- pointer to cs_join_mesh_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_file(FILE *file,
+ const cs_join_mesh_t *mesh)
+{
+ int i, j;
+
+ if (mesh == NULL) {
+ fprintf(file,
+ _("\n\n -- Dump a cs_join_mesh_t structure: (%p) --\n"),
+ (const void *)mesh);
+ return;
+ }
+
+ fprintf(file,_("\n\n -- Dump a cs_join_mesh_t structure: %s (%p) --\n"),
+ mesh->name, (const void *)mesh);
+ fprintf(file,_("\n mesh->n_faces: %11d\n"), mesh->n_faces);
+ fprintf(file,_(" mesh->n_g_faces: %11u\n\n"), mesh->n_g_faces);
+
+ if (mesh->face_vtx_idx != NULL) {
+
+ for (i = 0; i < mesh->n_faces; i++) {
+
+ cs_int_t start = mesh->face_vtx_idx[i] - 1;
+ cs_int_t end = mesh->face_vtx_idx[i+1] - 1;
+
+ fprintf(file,_("\n face_id: %9d gnum: %10u - n_vertices : %4d\n"),
+ i, mesh->face_gnum[i],end-start);
+
+ for (j = start; j < end; j++) {
+
+ cs_int_t vtx_id = mesh->face_vtx_lst[j]-1;
+ cs_join_vertex_t v_data = mesh->vertices[vtx_id];
+
+ fprintf(file," %9d - %10u - [ %12.6g %12.6g %12.6g]\n",
+ vtx_id+1, v_data.gnum,
+ v_data.coord[0], v_data.coord[1], v_data.coord[2]);
+
+ }
+ fprintf(file,"\n");
+
+ /* Check if there is no incoherency in the mesh definition */
+
+ for (j = start; j < end - 1; j++) {
+
+ cs_int_t vtx_id1 = mesh->face_vtx_lst[j]-1;
+ cs_int_t vtx_id2 = mesh->face_vtx_lst[j+1]-1;
+
+ if (vtx_id1 == vtx_id2) {
+ fprintf(file,_(" Incoherency found in the current mesh definition\n"
+ " Face number: %d (global: %u)\n"
+ " Vertices: local (%d, %d), global (%u, %u)"
+ " are defined twice\n"),
+ i+1, mesh->face_gnum[i], vtx_id1+1, vtx_id2+1,
+ (mesh->vertices[vtx_id1]).gnum,
+ (mesh->vertices[vtx_id2]).gnum);
+ fflush(file);
+ assert(0);
+ }
+
+ }
+
+ {
+ cs_int_t vtx_id1 = mesh->face_vtx_lst[end-1]-1;
+ cs_int_t vtx_id2 = mesh->face_vtx_lst[start]-1;
+
+ if (vtx_id1 == vtx_id2) {
+ fprintf(file,
+ _(" Incoherency found in the current mesh definition\n"
+ " Face number: %d (global: %u)\n"
+ " Vertices: local (%d, %d), global (%u, %u)"
+ " are defined twice\n"),
+ i+1, mesh->face_gnum[i], vtx_id1+1, vtx_id2+1,
+ (mesh->vertices[vtx_id1]).gnum,
+ (mesh->vertices[vtx_id2]).gnum);
+ fflush(file);
+ assert(0);
+ }
+ }
+
+ } /* End of loop on faces */
+
+ } /* End if face_vtx_idx != NULL */
+
+ fprintf(file,_("\n Dump vertex data\n"
+ " mesh->vertices : %p\n"
+ " mesh->n_vertices : %11d\n"
+ " mesh->n_g_vertices : %11u\n\n"),
+ (const void *)mesh->vertices, mesh->n_vertices, mesh->n_g_vertices);
+
+ if (mesh->n_vertices > 0) {
+
+ fprintf(file,_(" Local Num | Global Num | Tolerance |"
+ " Coordinates\n\n"));
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+ fprintf(file," %9d |", i+1);
+ cs_join_mesh_dump_vertex_file(file, mesh->vertices[i]);
+ }
+
+ }
+ fprintf(file,"\n");
+ fflush(file);
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a list of cs_join_edge_t structures.
+ *
+ * parameters:
+ * edges <-- cs_join_edges_t structure to dump
+ * mesh <-- associated cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_mesh_dump_edges(const cs_join_edges_t *edges,
+ const cs_join_mesh_t *mesh)
+{
+ cs_int_t i, j;
+
+ if (edges == NULL)
+ return;
+
+ bft_printf(_("\n Edge connectivity used in the joining operation:\n"));
+ bft_printf(_(" Number of edges: %8d\n"), edges->n_edges);
+ bft_printf(_(" Number of vertices: %8d\n"), edges->n_vertices);
+
+ for (i = 0; i < edges->n_edges; i++) { /* Dump edge connectivity */
+
+ cs_int_t v1_id = edges->def[2*i] - 1;
+ cs_int_t v2_id = edges->def[2*i+1] - 1;
+ fvm_gnum_t v1_gnum = (mesh->vertices[v1_id]).gnum;
+ fvm_gnum_t v2_gnum = (mesh->vertices[v2_id]).gnum;
+
+ bft_printf(_(" Edge %6d (%7u) <Vertex> [%7u %7u]\n"),
+ i+1, edges->gnum[i], v1_gnum, v2_gnum);
+
+ /* Check coherency */
+
+ if (v1_id == v2_id) {
+ bft_printf(" Incoherency found in the current edge definition\n"
+ " Edge number: %d\n"
+ " Vertices: local (%d, %d), global (%u, %u)"
+ " are defined twice\n",
+ i+1, v1_id+1, v2_id+1, v1_gnum, v2_gnum);
+ bft_printf_flush();
+ assert(0);
+ }
+
+ if (v1_gnum == v2_gnum) {
+ bft_printf(" Incoherency found in the current edge definition\n"
+ " Edge number: %d\n"
+ " Vertices: local (%d, %d), global (%u, %u)"
+ " are defined twice\n",
+ i+1, v1_id+1, v2_id+1, v1_gnum, v2_gnum);
+ bft_printf_flush();
+ assert(0);
+ }
+
+ } /* End of loop on edges */
+
+ bft_printf(_("\n Vertex -> Vertex connectivity :\n\n"));
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+
+ cs_int_t start = edges->vtx_idx[i];
+ cs_int_t end = edges->vtx_idx[i+1];
+
+ bft_printf(_(" Vertex %6d (%7u) - %3d - "),
+ i+1, (mesh->vertices[i]).gnum, end - start);
+
+ for (j = start; j < end; j++) {
+ if (edges->edge_lst[j] > 0)
+ bft_printf(" [ v: %7u, e: %7u] ",
+ (mesh->vertices[edges->adj_vtx_lst[j]-1]).gnum,
+ edges->gnum[edges->edge_lst[j] - 1]);
+ else
+ bft_printf(" [ v: %7u, e: %7u] ",
+ (mesh->vertices[edges->adj_vtx_lst[j]-1]).gnum,
+ edges->gnum[- edges->edge_lst[j] - 1]);
+ }
+ bft_printf("\n");
+
+ }
+
+ bft_printf_flush();
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_join_post.c b/src/base/cs_join_post.c
new file mode 100644
index 0000000..3de9b2d
--- /dev/null
+++ b/src/base/cs_join_post.c
@@ -0,0 +1,728 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Management of post-treatment for joining operation
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_mem.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_nodal_order.h>
+#include <fvm_nodal_from_desc.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_prototypes.h"
+#include "cs_join_post.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+typedef struct {
+
+ int writer_num; /* identifier for the related writer */
+ fvm_writer_t *writer; /* writer used for post-processing */
+
+} cs_join_post_t;
+
+/*============================================================================
+ * Static global variables
+ *===========================================================================*/
+
+static cs_join_post_t _cs_join_post_param;
+
+static cs_bool_t _cs_join_post_initialized = false;
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing writer with same format and associated
+ * options as default writer, but no time dependency, intended to
+ * post elements implied in the joining operations.
+ *
+ * returns:
+ * id of associated writer
+ *----------------------------------------------------------------------------*/
+
+static int
+_init_join_writer(void)
+{
+ /* Default values */
+
+ cs_int_t writer_id = -3;
+ cs_int_t indic_vol = -1, indic_brd = -1, indic_syr = -1, indic_ze = -1;
+ cs_int_t indic_mod = -1;
+ char fmtchr[32 + 1] = "";
+ char optchr[96 + 1] = "";
+ cs_int_t ntchr = -1;
+
+ const char casename[] = "joining";
+ const char dirname_ens[] = "joining.ensight";
+ const char dirname_def[] = ".";
+ const char *dirname = NULL;
+
+ /* Get parameters from Fortran COMMON blocks */
+
+ CS_PROCF(inipst, INIPST)(&indic_vol,
+ &indic_brd,
+ &indic_syr,
+ &indic_ze,
+ &indic_mod,
+ &ntchr,
+ fmtchr,
+ optchr);
+
+ fmtchr[32] = '\0';
+ optchr[96] = '\0';
+
+ /* Create default writer */
+
+ if (fmtchr[0] == 'e' || fmtchr[0] == 'E')
+ dirname = dirname_ens;
+ else
+ dirname = dirname_def;
+
+ writer_id = cs_post_get_free_writer_id();
+
+ cs_post_add_writer(writer_id,
+ casename,
+ dirname,
+ fmtchr,
+ optchr,
+ -1, /* No time dependency here */
+ ntchr);
+
+ return writer_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Write a field of "double" on the vertices of the selected mesh.
+ * Variable is interlaced.
+ *
+ * parameters:
+ * mesh <-- mesh on which we want to write the current field.
+ * varname <-- name of the field.
+ * dim <-- dimension of the field to export.
+ * field <-- variable to write.
+ *---------------------------------------------------------------------------*/
+
+static void
+_post_vtx_dfield(fvm_nodal_t *mesh,
+ const char *varname,
+ int dim,
+ const double *field)
+{
+ fvm_writer_t *writer = _cs_join_post_param.writer;
+
+ cs_int_t parent_num_shift[2] = {0, 0};
+
+ const double *var_ptr[9] = {NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL};
+
+ assert(writer != NULL);
+ assert(sizeof(double) == 8);
+
+ var_ptr[0] = field;
+
+ fvm_writer_export_field(writer,
+ mesh,
+ varname,
+ FVM_WRITER_PER_NODE,
+ dim,
+ FVM_INTERLACE,
+ 0,
+ parent_num_shift,
+ FVM_DOUBLE,
+ -1,
+ 0.,
+ (const void **)var_ptr);
+}
+
+/*----------------------------------------------------------------------------
+ * Write an integer field on the elements of the selected mesh.
+ * Variable is interlaced.
+ *
+ * parameters:
+ * mesh <-- mesh on which we want to write the current field.
+ * varname <-- name of the field.
+ * dim <-- dimension of the field to export.
+ * field <-- variable to write.
+ *---------------------------------------------------------------------------*/
+
+static void
+_post_elt_ifield(fvm_nodal_t *mesh,
+ const char *varname,
+ int dim,
+ const int *field)
+{
+ fvm_writer_t *writer = _cs_join_post_param.writer;
+
+ cs_int_t parent_num_shift[2] = {0, 0};
+ fvm_datatype_t datatype = FVM_DATATYPE_NULL;
+
+ const int *var_ptr[9] = {NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL};
+
+ assert(writer != NULL);
+ assert(sizeof(cs_int_t) == sizeof(int));
+
+ if (sizeof(int) == 4)
+ datatype = FVM_INT32;
+ else if (sizeof(int) == 8)
+ datatype = FVM_INT64;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Size of \"int\" is not 4 or 8 bytes.\n"
+ " Check the datatype of the field to export.\n"));
+
+ var_ptr[0] = field;
+
+ fvm_writer_export_field(writer,
+ mesh,
+ varname,
+ FVM_WRITER_PER_ELEMENT,
+ dim,
+ FVM_INTERLACE,
+ 0,
+ parent_num_shift,
+ datatype,
+ -1,
+ 0.,
+ (const void **)var_ptr);
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a writer to output post-processing files for a joining operation.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_init(void)
+{
+ int writer_num;
+
+ if (_cs_join_post_initialized == true)
+ return;
+
+ _cs_join_post_initialized = true;
+
+ writer_num = _init_join_writer();
+
+ cs_post_activate_writer(writer_num, 1);
+
+ _cs_join_post_param.writer = cs_post_get_writer(writer_num);
+
+ _cs_join_post_param.writer_num = writer_num;
+}
+
+/*----------------------------------------------------------------------------
+ * Post-treatment of a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh_name <-- name of the mesh for the post-processing
+ * mesh <-- pointer to a cs_join_mesh_t structure to post-process
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_mesh(const char *mesh_name,
+ const cs_join_mesh_t *join_mesh)
+{
+ int i, j;
+ cs_int_t n_vertices;
+
+ const char *name = NULL;
+ int *ifield = NULL;
+ double *dfield = NULL;
+ fvm_gnum_t *vertex_gnum = NULL;
+ cs_real_t *vertex_coord = NULL;
+ cs_int_t *parent_vtx_num = NULL;
+ fvm_nodal_t *post_mesh = NULL;
+ fvm_writer_t *writer = _cs_join_post_param.writer;
+
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const cs_int_t face_list_shift[2] = {0, join_mesh->n_faces};
+ const cs_int_t *face_vertex_idx[1] = {join_mesh->face_vtx_idx};
+ const cs_int_t *face_vertex_lst[1] = {join_mesh->face_vtx_lst};
+
+ /* Define an fvm_nodal_mesh_t structure from a cs_join_mesh_t structure */
+
+ /* Create an empty fvm_nodal_t structure. */
+
+ if (mesh_name == NULL)
+ name = join_mesh->name;
+ else
+ name = mesh_name;
+
+ post_mesh = fvm_nodal_create(name, 3);
+
+ /* Define fvm_nodal_t structure */
+
+ fvm_nodal_from_desc_add_faces(post_mesh,
+ join_mesh->n_faces,
+ NULL,
+ 1,
+ face_list_shift,
+ face_vertex_idx,
+ face_vertex_lst,
+ NULL);
+
+ /* Define vertex_coord for fvm_nodal_set_shared_vertices() */
+
+ BFT_MALLOC(vertex_coord, 3*join_mesh->n_vertices, cs_real_t);
+
+ for (i = 0; i < join_mesh->n_vertices; i++)
+ for (j = 0; j < 3; j++)
+ vertex_coord[3*i+j] = (join_mesh->vertices[i]).coord[j];
+
+ fvm_nodal_set_shared_vertices(post_mesh, vertex_coord);
+
+ /* Order faces by increasing global number */
+
+ fvm_nodal_order_faces(post_mesh, join_mesh->face_gnum);
+ fvm_nodal_init_io_num(post_mesh, join_mesh->face_gnum, 2);
+
+ /* Order vertices by increasing global number */
+
+ BFT_MALLOC(vertex_gnum, join_mesh->n_vertices, fvm_gnum_t);
+
+ for (i = 0; i < join_mesh->n_vertices; i++)
+ vertex_gnum[i] = (join_mesh->vertices[i]).gnum;
+
+ fvm_nodal_order_vertices(post_mesh, vertex_gnum);
+ fvm_nodal_init_io_num(post_mesh, vertex_gnum, 0);
+
+ /* Write current mesh */
+
+ fvm_writer_export_nodal(writer, post_mesh);
+
+ BFT_FREE(vertex_gnum);
+ BFT_FREE(vertex_coord);
+
+ /* Write rank associated to each face */
+
+ BFT_MALLOC(ifield, join_mesh->n_faces, int);
+
+ for (i = 0; i < join_mesh->n_faces; i++)
+ ifield[i] = local_rank;
+
+ _post_elt_ifield(post_mesh, _("Rank"), 1, ifield);
+
+ BFT_FREE(ifield);
+
+ /* Write vertex tolerance */
+
+ n_vertices = fvm_nodal_get_n_entities(post_mesh, 0);
+
+ BFT_MALLOC(parent_vtx_num, n_vertices, cs_int_t);
+ BFT_MALLOC(dfield, n_vertices, double);
+
+ fvm_nodal_get_parent_num(post_mesh, 0, parent_vtx_num);
+
+ for (i = 0; i < n_vertices; i++) {
+
+ cs_join_vertex_t data = join_mesh->vertices[parent_vtx_num[i]-1];
+
+ dfield[i] = data.tolerance;
+ }
+
+ _post_vtx_dfield(post_mesh, _("VtxTolerance"), 1, dfield);
+
+ BFT_FREE(parent_vtx_num);
+ BFT_FREE(dfield);
+
+ post_mesh = fvm_nodal_destroy(post_mesh);
+}
+
+/*----------------------------------------------------------------------------
+ * Post-process a subset of faces of a cs_join_mesh_t structure.
+ *
+ * parameters:
+ * mesh_name <-- name of the sub-set mesh
+ * mesh <-- pointer to the parent cs_join_mesh_t structure
+ * n_selected_faces <-- number of selected faces (size of the sub-set)
+ * selected_faces <-- list of local number in parent mesh
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_faces_subset(const char *mesh_name,
+ const cs_join_mesh_t *parent_mesh,
+ cs_int_t n_select_faces,
+ const cs_int_t selected_faces[])
+{
+ cs_join_mesh_t *subset_mesh = NULL;
+
+ assert(parent_mesh != NULL);
+
+ subset_mesh = cs_join_mesh_create_from_subset(mesh_name,
+ n_select_faces,
+ selected_faces,
+ parent_mesh);
+
+ cs_join_post_mesh(subset_mesh->name, subset_mesh);
+
+ cs_join_mesh_destroy(&subset_mesh);
+}
+
+/*----------------------------------------------------------------------------
+ * Post-process mesh after the update following the merge operation.
+ *
+ * parameters:
+ * join_param <-- set of parameters for the joining operation
+ * join_select <-- list of participating entities in the joining operation
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_after_merge(cs_join_param_t join_param,
+ const cs_join_select_t *join_select)
+{
+ cs_int_t adj_mesh_id, sel_mesh_id;
+
+ char *mesh_name = NULL;
+
+ if (_cs_join_post_initialized == false)
+ return;
+
+ adj_mesh_id = cs_post_get_free_mesh_id();
+
+ BFT_MALLOC(mesh_name, strlen("AdjacentJoinFaces_j") + 2 + 1, char);
+ sprintf(mesh_name,"%s%02d", "AdjacentJoinFaces_j", join_param.num);
+
+ cs_post_add_mesh(adj_mesh_id,
+ mesh_name,
+ 0,
+ join_select->n_i_adj_faces,
+ join_select->n_b_adj_faces,
+ NULL,
+ join_select->i_adj_faces,
+ join_select->b_adj_faces);
+
+ cs_post_associate(adj_mesh_id, _cs_join_post_param.writer_num);
+
+ sel_mesh_id = cs_post_get_free_mesh_id();
+
+ BFT_REALLOC(mesh_name, strlen("JoinFacesAfterMerge_j") + 2 + 1, char);
+ sprintf(mesh_name,"%s%02d", "JoinFacesAfterMerge_j", join_param.num);
+
+ cs_post_add_mesh(sel_mesh_id,
+ mesh_name,
+ 0,
+ 0,
+ join_select->n_faces,
+ NULL,
+ NULL,
+ join_select->faces);
+
+ cs_post_associate(sel_mesh_id, _cs_join_post_param.writer_num);
+
+ /* Post */
+
+ cs_post_activate_writer(_cs_join_post_param.writer_num, 1);
+ cs_post_write_meshes(1,0);
+
+ BFT_FREE(mesh_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Post-process mesh after the update following the split operation.
+ *
+ * parameters:
+ * n_old_i_faces <-- initial number of interior faces
+ * n_new_i_faces <-- number of interior faces added to the mesh definition
+ * n_old_b_faces <-- initial number of border faces
+ * n_new_b_faces <-- number of border faces added to the mesh definition
+ * n_g_new_b_faces <-- global number of new border faces
+ * n_select_faces <-- number of selected faces
+ * mesh <-- pointer to a cs_mesh_t structure
+ * join_param <-- set of parameters for the joining operation
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_after_split(cs_int_t n_old_i_faces,
+ cs_int_t n_new_i_faces,
+ cs_int_t n_old_b_faces,
+ cs_int_t n_new_b_faces,
+ fvm_gnum_t n_g_new_b_faces,
+ cs_int_t n_select_faces,
+ const cs_mesh_t *mesh,
+ cs_join_param_t join_param)
+{
+ cs_int_t i, j;
+
+ cs_int_t *post_i_faces = NULL, *post_b_faces = NULL;
+ char *mesh_name = NULL;
+
+ if (_cs_join_post_initialized == false)
+ return;
+
+ /* Define list of faces to post-treat */
+
+ BFT_MALLOC(post_i_faces, n_new_i_faces, cs_int_t);
+ BFT_MALLOC(post_b_faces, n_new_b_faces, cs_int_t);
+
+ for (i = n_old_i_faces, j = 0; i < mesh->n_i_faces; i++, j++)
+ post_i_faces[j] = i + 1;
+
+ for (i = n_old_b_faces-n_select_faces, j = 0; i < mesh->n_b_faces; i++, j++)
+ post_b_faces[j] = i + 1;
+
+ if (join_param.verbosity < 2) {
+
+ int post_mesh_id = cs_post_get_free_mesh_id();
+
+ BFT_MALLOC(mesh_name, strlen("JoinedFaces_j") + 2 + 1, char);
+ sprintf(mesh_name, "%s%02d", "JoinedFaces_j", join_param.num);
+
+ cs_post_add_mesh(post_mesh_id,
+ mesh_name,
+ 0,
+ n_new_i_faces,
+ n_new_b_faces,
+ NULL,
+ post_i_faces,
+ post_b_faces);
+
+ cs_post_associate(post_mesh_id, _cs_join_post_param.writer_num);
+
+ }
+ else {
+
+ cs_int_t post_i_mesh_id = cs_post_get_free_mesh_id();
+
+ BFT_MALLOC(mesh_name, strlen("InteriorJoinedFaces_j") + 2 + 1, char);
+ sprintf(mesh_name,"%s%02d", "InteriorJoinedFaces_j", join_param.num);
+
+ cs_post_add_mesh(post_i_mesh_id,
+ mesh_name,
+ 0,
+ n_new_i_faces,
+ 0,
+ NULL,
+ post_i_faces,
+ NULL);
+
+ cs_post_associate(post_i_mesh_id, _cs_join_post_param.writer_num);
+
+ if (n_g_new_b_faces > 0) {
+
+ int post_b_mesh_id = cs_post_get_free_mesh_id();
+
+ BFT_REALLOC(mesh_name, strlen("BorderJoinedFaces_j") + 2 + 1, char);
+ sprintf(mesh_name,"%s%02d", "BorderJoinedFaces_j", join_param.num);
+
+ cs_post_add_mesh(post_b_mesh_id,
+ mesh_name,
+ 0,
+ 0,
+ n_new_b_faces,
+ NULL,
+ NULL,
+ post_b_faces);
+
+ cs_post_associate(post_b_mesh_id, _cs_join_post_param.writer_num);
+ }
+
+ }
+
+ /* Post */
+
+ cs_post_activate_writer(_cs_join_post_param.writer_num, 1);
+ cs_post_write_meshes(1,0);
+
+ BFT_FREE(post_i_faces);
+ BFT_FREE(post_b_faces);
+ BFT_FREE(mesh_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Post-process mesh after the update following the split operation.
+ *
+ * parameters:
+ * n_i_clean_faces <-- number of interior faces cleaned
+ * i_clean_faces <-> list of interior face numbers (ordered on exit)
+ * n_b_clean_faces <-- number of border faces cleaned
+ * b_clean_faces <-> list of border face numbers (ordered on exit)
+ * param <-- set of parameters for the joining operation
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_cleaned_faces(cs_int_t n_i_clean_faces,
+ cs_int_t i_clean_faces[],
+ cs_int_t n_b_clean_faces,
+ cs_int_t b_clean_faces[],
+ cs_join_param_t param)
+{
+ int post_mesh_id = cs_post_get_free_mesh_id();
+ char *name = NULL;
+
+ if (_cs_join_post_initialized == false)
+ return;
+
+ BFT_MALLOC(name, strlen("CleanFaces_j") + 2 + 1, char);
+ sprintf(name,"%s%02d", "CleanFaces_j", param.num);
+
+ cs_post_add_mesh(post_mesh_id,
+ name,
+ 0,
+ n_i_clean_faces,
+ n_b_clean_faces,
+ NULL,
+ i_clean_faces,
+ b_clean_faces);
+
+ /* Otput post-processing data */
+
+ cs_post_associate(post_mesh_id, _cs_join_post_param.writer_num);
+
+ cs_post_activate_writer(_cs_join_post_param.writer_num, 1);
+ cs_post_write_meshes(1,0);
+
+ BFT_FREE(name);
+}
+
+/*----------------------------------------------------------------------------
+ * Output processor-specific post-processing data for a cs_join_mesh_t
+ * structure according to the verbosity level.
+ *
+ * parameters:
+ * basename <-- generic name for the mesh to post
+ * mesh <-- fvm_join_mesh_t structure to post-process
+ * param <-- fvm_join_param_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_post_dump_mesh(const char *basename,
+ const cs_join_mesh_t *mesh,
+ cs_join_param_t param)
+{
+ int rank;
+ cs_join_mesh_t *tmp;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int rank_id = CS_MAX(cs_glob_rank_id, 0);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Dump mesh structure */
+ if (param.verbosity > 1) {
+
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_.dat") + strlen(basename) + 4 + 2 + 1;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_%s%04d.dat",
+ param.num, basename, rank_id);
+ dbg_file = fopen(filename, "w");
+
+ cs_join_mesh_dump_file(dbg_file, mesh);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+
+ }
+#endif
+
+ if (_cs_join_post_initialized == true && param.verbosity > 2) {
+
+ if (n_ranks == 1)
+ cs_join_post_mesh(basename, mesh);
+
+ else { /* Parallel */
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ char *mesh_name = NULL;
+
+ BFT_MALLOC(mesh_name, strlen(basename) + 2 + 2 + 5 + 1, char);
+ sprintf(mesh_name,"%s%02d%s%05d", basename, param.num, "_n", rank);
+
+ if (rank_id == rank)
+ cs_join_post_mesh(mesh_name, mesh);
+
+ else { /* Pieces empty on other ranks */
+ tmp = cs_join_mesh_create(mesh_name);
+ cs_join_post_mesh(mesh_name, tmp);
+ cs_join_mesh_destroy(&tmp);
+ }
+
+ BFT_FREE(mesh_name);
+
+ } /* End of loop on ranks */
+ } /* End of parallel treatment */
+ }
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_join_set.c b/src/base/cs_join_set.c
new file mode 100644
index 0000000..2daf755
--- /dev/null
+++ b/src/base/cs_join_set.c
@@ -0,0 +1,1868 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Manipulation of global indexed list
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_io_num.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_util.h"
+#include "cs_search.h"
+#include "cs_sort.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_set.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" and apply the sort to its associated array "b"
+ * (global numbering).
+ *
+ * Sort is realized using a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l <-- left bound
+ * r <-- right bound
+ * a <-> array to sort
+ * b <-> associated array
+ *---------------------------------------------------------------------------*/
+
+static void
+_coupled_adapted_gnum_shellsort(int l,
+ int r,
+ fvm_gnum_t a[],
+ fvm_gnum_t b[])
+{
+ int i, start;
+ fvm_gnum_t ref;
+
+ int size = r - l;
+
+ if (size == 0)
+ return;
+
+ cs_sort_coupled_gnum_shell(l, r, a, b);
+
+ /* Order b array for each sub-list where a[] is constant */
+
+ start = l;
+ while (start < r) {
+
+ ref = a[start];
+ for (i = start; i < r && ref == a[i]; i++);
+
+ cs_sort_gnum_shell(start, i, b);
+ start = i;
+
+ }
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Allocate a resizable array.
+ *
+ * parameters:
+ * max_size <-- initial number of elements to allocate
+ *
+ * returns:
+ * pointer to a new alloacted resizable array
+ *---------------------------------------------------------------------------*/
+
+cs_join_rset_t *
+cs_join_rset_create(cs_int_t max_size)
+{
+ cs_join_rset_t *new_set = NULL;
+
+ if (max_size > 0) {
+
+ BFT_MALLOC(new_set, 1, cs_join_rset_t);
+
+ new_set->n_max_elts = max_size;
+ new_set->n_elts = 0;
+
+ BFT_MALLOC(new_set->array, max_size, cs_int_t);
+
+ }
+
+ return new_set;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_rset_t structure.
+ *
+ * parameter:
+ * set <-- pointer to pointer to the cs_join_rset_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_rset_destroy(cs_join_rset_t **set)
+{
+ if (*set != NULL) {
+ BFT_FREE((*set)->array);
+ BFT_FREE(*set);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Check if we need to resize the current cs_join_rset_t structure and do
+ * it if necessary.
+ *
+ * parameters:
+ * set <-- pointer to pointer to the cs_join_rset_t structure to test
+ * test_size <-- target size
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_rset_resize(cs_join_rset_t **set,
+ cs_int_t test_size)
+{
+ if (*set != NULL) {
+
+ if (test_size > 0) {
+
+ cs_join_rset_t *_set = *set;
+
+ if (_set->n_max_elts == 0)
+ _set->n_max_elts = test_size;
+ else if (test_size >= _set->n_max_elts) {
+ while (test_size >= _set->n_max_elts)
+ _set->n_max_elts *= 2; /* Double the list size */
+ }
+
+ BFT_REALLOC(_set->array, _set->n_max_elts, cs_int_t);
+ assert(test_size <= _set->n_max_elts);
+
+ }
+
+ }
+ else
+ *set = cs_join_rset_create(test_size);
+}
+
+/*----------------------------------------------------------------------------
+ * Create a new cs_join_eset_t structure.
+ *
+ * parameters:
+ * init_size <-- number of initial equivalences to allocate
+ *
+ * returns:
+ * a pointer to a new cs_join_eset_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_eset_t *
+cs_join_eset_create(cs_int_t init_size)
+{
+ cs_join_eset_t *new_set = NULL;
+
+ BFT_MALLOC(new_set, 1, cs_join_eset_t);
+
+ new_set->n_max_equiv = init_size; /* default value */
+ new_set->n_equiv = 0;
+
+ BFT_MALLOC(new_set->equiv_couple, 2*new_set->n_max_equiv, cs_int_t);
+
+ return new_set;
+}
+
+/*----------------------------------------------------------------------------
+ * Check if the requested size if allocated in the structure.
+ *
+ * Reallocate cs_join_eset_t structure if necessary.
+ *
+ * parameters:
+ * request_size <-- necessary size
+ * equiv_set <-> pointer to pointer to the cs_join_eset_t struct.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_eset_check_size(cs_int_t request_size,
+ cs_join_eset_t **equiv_set)
+{
+ cs_join_eset_t *eset = *equiv_set;
+
+ if (eset == NULL)
+ eset = cs_join_eset_create(request_size);
+
+ if (request_size + 1 > eset->n_max_equiv) {
+
+ if (eset->n_max_equiv == 0)
+ eset->n_max_equiv = 2;
+
+ eset->n_max_equiv *= 2;
+
+ BFT_REALLOC(eset->equiv_couple, 2*eset->n_max_equiv, cs_int_t);
+
+ }
+
+ /* Ensure return value is set */
+
+ *equiv_set = eset;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_eset_t structure.
+ *
+ * parameter:
+ * equiv_set <-- pointer to pointer to the structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_eset_destroy(cs_join_eset_t **equiv_set)
+{
+ if (*equiv_set != NULL) {
+ BFT_FREE((*equiv_set)->equiv_couple);
+ BFT_FREE(*equiv_set);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Clean a cs_join_eset_t structure.
+ *
+ * If necessary, create a new cs_join_eset_t structure with no redundancy.
+ *
+ * parameters:
+ * eset <-- pointer to pointer to the cs_join_eset_t structure to clean
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_eset_clean(cs_join_eset_t **eset)
+{
+ int i;
+ cs_int_t prev, current;
+
+ cs_int_t count = 0;
+ fvm_lnum_t *order = NULL;
+ cs_join_eset_t *new_eset = NULL;
+ cs_join_eset_t *_eset = *eset;
+
+ assert(sizeof(fvm_gnum_t) == sizeof(fvm_lnum_t));
+
+ if (_eset == NULL)
+ return;
+
+ if (_eset->n_equiv == 1)
+ return;
+
+ BFT_MALLOC(order, _eset->n_equiv, fvm_lnum_t);
+
+ if (fvm_order_local_test_s(NULL,
+ (fvm_gnum_t *)_eset->equiv_couple,
+ 2,
+ _eset->n_equiv) == false) {
+
+ /* Order equiv_lst */
+
+ fvm_order_local_allocated_s(NULL,
+ (fvm_gnum_t *)_eset->equiv_couple,
+ 2,
+ order,
+ _eset->n_equiv);
+
+ }
+ else
+ for (i = 0; i < _eset->n_equiv; i++)
+ order[i] = i;
+
+ /* Count the number of redundancies */
+
+ count = 0;
+
+ for (i = 1; i < _eset->n_equiv; i++) {
+
+ prev = order[i-1];
+ current = order[i];
+
+ if (_eset->equiv_couple[2*prev] == _eset->equiv_couple[2*current])
+ if (_eset->equiv_couple[2*prev+1] == _eset->equiv_couple[2*current+1])
+ count++;
+
+ } /* End of loop on equivalences */
+
+ new_eset = cs_join_eset_create(_eset->n_equiv - count);
+
+ new_eset->n_equiv = _eset->n_equiv - count;
+
+ if (new_eset->n_equiv > new_eset->n_max_equiv) {
+ new_eset->n_max_equiv = new_eset->n_equiv;
+ BFT_REALLOC(new_eset->equiv_couple, 2*new_eset->n_max_equiv, cs_int_t);
+ }
+
+ if (new_eset->n_equiv > 0) {
+
+ new_eset->equiv_couple[0] = _eset->equiv_couple[2*order[0]];
+ new_eset->equiv_couple[1] = _eset->equiv_couple[2*order[0]+1];
+ count = 1;
+
+ for (i = 1; i < _eset->n_equiv; i++) {
+
+ prev = order[i-1];
+ current = order[i];
+
+ if (_eset->equiv_couple[2*prev] != _eset->equiv_couple[2*current]) {
+ new_eset->equiv_couple[2*count] = _eset->equiv_couple[2*current];
+ new_eset->equiv_couple[2*count+1] = _eset->equiv_couple[2*current+1];
+ count++;
+ }
+ else {
+
+ if (_eset->equiv_couple[2*prev+1] != _eset->equiv_couple[2*current+1]) {
+ new_eset->equiv_couple[2*count] = _eset->equiv_couple[2*current];
+ new_eset->equiv_couple[2*count+1] = _eset->equiv_couple[2*current+1];
+ count++;
+ }
+
+ }
+
+ } /* End of loop on equivalences */
+
+ assert(count == new_eset->n_equiv);
+
+ }
+
+ *eset = new_eset;
+
+ /* Free memory */
+
+ cs_join_eset_destroy(&_eset);
+
+ BFT_FREE(order);
+}
+
+/*----------------------------------------------------------------------------
+ * Create a cs_join_gset_t structure (indexed list on global numbering)
+ *
+ * parameters:
+ * n_elts <-- number of elements composing the list
+ *
+ * returns:
+ * a new allocated pointer to a cs_join_gset_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_create(cs_int_t n_elts)
+{
+ cs_int_t i;
+
+ cs_join_gset_t *new_set = NULL;
+
+ BFT_MALLOC(new_set, 1, cs_join_gset_t);
+ BFT_MALLOC(new_set->g_elts, n_elts, fvm_gnum_t);
+
+ new_set->n_elts = n_elts;
+ new_set->index = NULL;
+
+ BFT_MALLOC(new_set->index, n_elts + 1, cs_int_t);
+
+ for (i = 0; i < n_elts + 1; i++)
+ new_set->index[i] = 0;
+
+ new_set->g_list = NULL;
+
+ return new_set;
+}
+
+/*----------------------------------------------------------------------------
+ * Build a cs_join_gset_t structure to store all the potential groups
+ * between elements.
+ *
+ * Values in g_elts are the tag values and values in g_list
+ * are position in tag array.
+ *
+ * parameters:
+ * n_elts <-- number of elements in tag array
+ * tag <-- tag array used to define a new cs_join_gset_t
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_create_from_tag(cs_int_t n_elts,
+ const fvm_gnum_t tag[])
+{
+ cs_int_t i, n_list_elts;
+ fvm_gnum_t prev;
+
+ fvm_lnum_t *order = NULL;
+ cs_join_gset_t *set = NULL;
+
+ if (n_elts == 0)
+ return NULL;
+
+ /* Order tag */
+
+ assert(tag != NULL);
+
+ BFT_MALLOC(order, n_elts, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL, tag, order, n_elts);
+
+ /* Create a cs_join_gset_t structure to store the initial position of equiv.
+ element in tag */
+
+ prev = tag[order[0]];
+ n_list_elts = 1;
+
+ /* Count the number of elements which will compose the set->g_elts */
+
+ for (i = 1; i < n_elts; i++) {
+
+ fvm_gnum_t cur = tag[order[i]];
+
+ if (prev != cur) {
+ n_list_elts++;
+ prev = cur;
+ }
+
+ }
+
+ set = cs_join_gset_create(n_list_elts);
+
+ if (n_list_elts > 0) {
+
+ cs_int_t shift;
+ cs_int_t count = 0;
+
+ /* Define the list of elements in set->g_elts and count the number of
+ associated entities */
+
+ prev = tag[order[0]];
+ set->g_elts[0] = prev;
+ set->index[1] += 1;
+ n_list_elts = 1;
+
+ for (i = 1; i < n_elts; i++) {
+
+ fvm_gnum_t cur = tag[order[i]];
+
+ if (prev != cur) {
+ prev = cur;
+ set->g_elts[n_list_elts] = cur;
+ n_list_elts++;
+ set->index[n_list_elts] += 1;
+ }
+ else
+ set->index[n_list_elts] += 1;
+
+ }
+
+ /* Build index for the set */
+
+ for (i = 0; i < set->n_elts; i++)
+ set->index[i+1] += set->index[i];
+
+ /* Fill list */
+
+ BFT_MALLOC(set->g_list, set->index[set->n_elts], fvm_gnum_t);
+
+ n_list_elts = 0;
+ prev = tag[order[0]];
+ set->g_list[0] = order[0];
+
+ for (i = 1; i < n_elts; i++) {
+
+ fvm_lnum_t o_id = order[i];
+ fvm_gnum_t cur = tag[o_id];
+
+ if (prev != cur) {
+ prev = cur;
+ count = 0;
+ n_list_elts++;
+ shift = set->index[n_list_elts];
+ set->g_list[shift] = o_id;
+ }
+ else {
+ count++;
+ shift = count + set->index[n_list_elts];
+ set->g_list[shift] = o_id;
+ }
+
+ }
+
+ } /* End if n_elts > 0 */
+
+ /* Free memory */
+
+ BFT_FREE(order);
+
+ /* Returns pointers */
+
+ return set;
+}
+
+/*----------------------------------------------------------------------------
+ * Create a new cs_join_gset_t which holds equivalences between elements of
+ * g_list in cs_join_gset_t.
+ *
+ * For a subset of equivalences, we store their initial value in the return
+ * cs_join_gset_t structure. A subset is defined if at least two elements
+ * are equivalent.
+ *
+ * The behavior of this function is near from cs_join_gset_create_from_tag
+ * but we don't store the position in init_array but its value in init_array.
+ *
+ * parameters:
+ * set <-- pointer to a cs_join_gset_t structure
+ * init_array <-- initial values of set->g_list
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_create_by_equiv(const cs_join_gset_t *set,
+ const fvm_gnum_t init_array[])
+{
+ cs_int_t i, list_size, n_equiv_grp, count, shift, o_id;
+ fvm_gnum_t prev, cur;
+
+ cs_int_t save_i = -1;
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *couple_list = NULL;
+ cs_join_gset_t *equiv = NULL;
+
+ if (init_array == NULL)
+ return NULL;
+
+ assert(set != NULL);
+
+ list_size = set->index[set->n_elts];
+
+ /* Order set->g_list */
+
+ BFT_MALLOC(order, list_size, fvm_lnum_t);
+ BFT_MALLOC(couple_list, 2*list_size, fvm_gnum_t);
+
+ for (i = 0; i < list_size; i++) {
+ couple_list[2*i] = set->g_list[i];
+ couple_list[2*i+1] = init_array[i];
+ }
+
+ fvm_order_local_allocated_s(NULL, couple_list, 2, order, list_size);
+
+ /* Create a cs_join_gset_t structure to store the initial value of equiv.
+ element in set->g_list */
+
+ /* Count the number of elements which will compose the equiv->g_elts */
+
+ n_equiv_grp = 0;
+ prev = set->g_list[order[0]];
+ count = 0;
+
+ for (i = 1; i < list_size; i++) {
+
+ cur = set->g_list[order[i]];
+
+ if (prev != cur) {
+ count = 0;
+ prev = cur;
+ }
+ else {
+ count++;
+ if (count == 1)
+ n_equiv_grp++;
+ }
+
+ }
+
+ equiv = cs_join_gset_create(n_equiv_grp);
+
+ if (n_equiv_grp > 0) {
+
+ /* Define the list of elements in equiv->g_list and count the number of
+ associated elements */
+
+ n_equiv_grp = 0;
+ prev = set->g_list[order[0]];
+ count = 0;
+
+ for (i = 1; i < list_size; i++) {
+
+ cur = set->g_list[order[i]];
+
+ if (prev != cur) {
+ count = 0;
+ prev = cur;
+ }
+ else {
+ count++;
+ if (count == 1) { /* Add this group */
+ equiv->g_elts[n_equiv_grp] = cur;
+ n_equiv_grp++;
+ equiv->index[n_equiv_grp] = 1;
+ }
+ else {
+ assert(count > 1);
+ equiv->index[n_equiv_grp] += 1;
+ }
+
+ } /* cur == prev */
+
+ } /* End of loop on list_size */
+
+ /* Build index for the set */
+
+ for (i = 0; i < equiv->n_elts; i++)
+ equiv->index[i+1] += equiv->index[i];
+
+ /* Fill list */
+
+ BFT_MALLOC(equiv->g_list, equiv->index[equiv->n_elts], fvm_gnum_t);
+
+ n_equiv_grp = 0;
+ prev = set->g_list[order[0]] + 1;
+
+ for (i = 0; i < list_size; i++) {
+
+ o_id = order[i];
+ cur = set->g_list[o_id];
+
+ if (prev != cur) {
+ count = 0;
+ prev = cur;
+ save_i = o_id;
+ }
+ else {
+
+ if (count == 0)
+ n_equiv_grp++;
+
+ shift = count + equiv->index[n_equiv_grp-1];
+ if (cur != init_array[o_id])
+ equiv->g_list[shift] = init_array[o_id];
+ else
+ equiv->g_list[shift] = init_array[save_i];
+ count++;
+
+ } /* cur == prev */
+
+ } /* End of loop on list_size */
+
+ } /* End if n_elts > 0 */
+
+ /* Free memory */
+
+ BFT_FREE(couple_list);
+ BFT_FREE(order);
+
+ /* Returns pointer */
+
+ return equiv;
+}
+
+/*----------------------------------------------------------------------------
+ * Copy a cs_join_gset_t structure.
+ *
+ * parameters:
+ * src <-- pointer to the cs_join_gset_t structure to copy
+ *
+ * returns:
+ * a new allocated cs_join_gset_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_copy(const cs_join_gset_t *src)
+{
+ cs_int_t i;
+
+ cs_join_gset_t *copy = NULL;
+
+ if (src == NULL)
+ return copy;
+
+ copy = cs_join_gset_create(src->n_elts);
+
+ for (i = 0; i < src->n_elts; i++)
+ copy->g_elts[i] = src->g_elts[i];
+
+ for (i = 0; i < src->n_elts + 1; i++)
+ copy->index[i] = src->index[i];
+
+ for (i = 0; i < src->index[src->n_elts]; i++)
+ copy->g_list[i] = src->g_list[i];
+
+ return copy;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-- pointer to pointer to the cs_join_gset_t structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_destroy(cs_join_gset_t **set)
+{
+ if (*set != NULL) {
+ BFT_FREE((*set)->index);
+ BFT_FREE((*set)->g_elts);
+ BFT_FREE((*set)->g_list);
+ BFT_FREE(*set);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Sort a cs_join_gset_t structure according to the global numbering of
+ * the g_elts in cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-> pointer to the structure to order
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_sort_elts(cs_join_gset_t *set)
+{
+ int i, j, k, o_id, shift;
+ cs_int_t n_elts;
+
+ cs_int_t *new_index = NULL;
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *tmp = NULL, *g_elts = NULL, *g_list = NULL;
+
+ if (set == NULL)
+ return;
+
+ g_elts = set->g_elts;
+ g_list = set->g_list;
+ n_elts = set->n_elts;
+
+ BFT_MALLOC(order, n_elts, fvm_lnum_t);
+ BFT_MALLOC(tmp, n_elts, fvm_gnum_t);
+ BFT_MALLOC(new_index, n_elts + 1, cs_int_t);
+
+ for (i = 0; i < n_elts; i++)
+ tmp[i] = g_elts[i];
+
+ /* Sort g_elts */
+
+ fvm_order_local_allocated(NULL, g_elts, order, n_elts);
+
+ /* Reshape cs_join_gset_t according to the new ordering */
+
+ new_index[0] = 0;
+
+ for (i = 0; i < n_elts; i++) {
+
+ o_id = order[i];
+ g_elts[i] = tmp[o_id];
+ new_index[i+1] = new_index[i] + set->index[o_id+1] - set->index[o_id];
+
+ } /* End of loop on elements */
+
+ assert(new_index[n_elts] == set->index[n_elts]);
+
+ /* Define new g_list */
+
+ BFT_REALLOC(tmp, set->index[n_elts], fvm_gnum_t);
+
+ for (i = 0; i < set->index[n_elts]; i++)
+ tmp[i] = g_list[i];
+
+ for (i = 0; i < n_elts; i++) {
+
+ o_id = order[i];
+ shift = new_index[i];
+
+ for (k = 0, j = set->index[o_id]; j < set->index[o_id+1]; j++, k++)
+ g_list[shift + k] = tmp[j];
+
+ } /* End of loop on elements */
+
+ /* Free memory */
+
+ BFT_FREE(set->index);
+ BFT_FREE(order);
+ BFT_FREE(tmp);
+
+ /* Return structure */
+
+ set->index = new_index;
+ set->g_elts = g_elts;
+ set->g_list = g_list;
+}
+
+/*----------------------------------------------------------------------------
+ * Sort each sub-list of the g_list array in a cs_join_gset_t structure.
+ *
+ * parameters:
+ * p_set <-> pointer to the structure to sort
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_sort_sublist(cs_join_gset_t *set)
+{
+ int i;
+
+ if (set == NULL)
+ return;
+
+ /* Sort each sub-list */
+
+ for (i = 0; i < set->n_elts; i++)
+ cs_sort_gnum_shell(set->index[i], set->index[i+1], set->g_list);
+}
+
+/*----------------------------------------------------------------------------
+ * Invert a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-- pointer to the cs_join_gset_t structure to work with
+ *
+ * returns:
+ * the new allocated and inverted set structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_invert(const cs_join_gset_t *set)
+{
+ int i, j, o_id, shift, elt_id;
+ fvm_gnum_t prev, cur;
+
+ cs_int_t list_size = 0, n_elts = 0;
+ cs_int_t *count = NULL;
+ fvm_lnum_t *order = NULL;
+ cs_join_gset_t *invert_set = NULL;
+
+ if (set == NULL)
+ return invert_set;
+
+ /* Order g_list to count the number of different entities */
+
+ list_size = set->index[set->n_elts];
+
+ if (list_size == 0)
+ return cs_join_gset_create(list_size);
+
+ BFT_MALLOC(order, list_size, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL, set->g_list, order, list_size);
+
+ /* Count the number of elements */
+
+ prev = set->g_list[order[0]] + 1;
+
+ for (i = 0; i < list_size; i++) {
+
+ o_id = order[i];
+ cur = set->g_list[o_id];
+
+ if (prev != cur) {
+ prev = cur;
+ n_elts++;
+ }
+
+ }
+
+ invert_set = cs_join_gset_create(n_elts);
+
+ /* Fill g_elts for the inverted set */
+
+ n_elts = 0;
+ prev = set->g_list[order[0]] + 1;
+
+ for (i = 0; i < list_size; i++) {
+
+ o_id = order[i];
+ cur = set->g_list[o_id];
+
+ if (prev != cur) {
+ prev = cur;
+ invert_set->g_elts[n_elts] = cur;
+ n_elts++;
+ }
+
+ }
+
+ BFT_FREE(order);
+
+ /* Define an index for the inverted set */
+
+ for (i = 0; i < set->n_elts; i++) {
+ for (j = set->index[i]; j < set->index[i+1]; j++) {
+
+ elt_id = cs_search_g_binary(invert_set->n_elts,
+ set->g_list[j],
+ invert_set->g_elts);
+
+ if (elt_id == -1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Fail to build an inverted cs_join_gset_t structure.\n"
+ " Cannot find %u in element list.\n"), set->g_list[j]);
+
+ invert_set->index[elt_id+1] += 1;
+
+ }
+ } /* End of loop on elements of list */
+
+ for (i = 0; i < invert_set->n_elts; i++)
+ invert_set->index[i+1] += invert_set->index[i];
+
+ BFT_MALLOC(invert_set->g_list,
+ invert_set->index[invert_set->n_elts],
+ fvm_gnum_t);
+
+ /* Define invert_set->g_list */
+
+ BFT_MALLOC(count, invert_set->n_elts, cs_int_t);
+
+ for (i = 0; i < invert_set->n_elts; i++)
+ count[i] = 0;
+
+ for (i = 0; i < set->n_elts; i++) {
+ for (j = set->index[i]; j < set->index[i+1]; j++) {
+
+ elt_id = cs_search_g_binary(invert_set->n_elts,
+ set->g_list[j],
+ invert_set->g_elts);
+
+ shift = count[elt_id] + invert_set->index[elt_id];
+ invert_set->g_list[shift] = set->g_elts[i];
+ count[elt_id] += 1;
+
+ }
+
+ } /* End of loop on elements of list */
+
+ BFT_FREE(count);
+
+ return invert_set;
+}
+
+/*----------------------------------------------------------------------------
+ * Delete redudancies in a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-> pointer to the structure to clean
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_clean(cs_join_gset_t *set)
+{
+ int i, j, l, r, save, n_elts;
+
+ int shift = 0;
+ fvm_gnum_t *g_list = NULL;
+
+ if (set == NULL)
+ return;
+
+ g_list = set->g_list;
+ n_elts = set->n_elts;
+
+ /* Sort g_list for each element in index */
+
+ cs_join_gset_sort_sublist(set);
+
+ /* Define a new index without redundant elements */
+
+ save = set->index[0];
+
+ for (i = 0; i < n_elts; i++) {
+
+ l = save;
+ r = set->index[i+1];
+
+ if (r - l > 0) {
+
+ g_list[shift++] = g_list[l];
+
+ for (j = l + 1; j < r; j++)
+ if (g_list[j] != g_list[j-1])
+ g_list[shift++] = g_list[j];
+
+ }
+
+ save = r;
+ set->index[i+1] = shift;
+
+ } /* End of loop on elements */
+}
+
+/*----------------------------------------------------------------------------
+ * Delete redudancies in g_list array of a cs_join_gset_t structure.
+ *
+ * parameters:
+ * set <-> pointer to the structure to clean
+ * linked_array <-> array for which redundancies are scanned
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_clean_from_array(cs_join_gset_t *set,
+ fvm_gnum_t linked_array[])
+{
+ int i, j, l, r;
+ cs_int_t n_elts;
+
+ int shift = 0;
+ cs_int_t *new_index = NULL;
+ fvm_gnum_t *g_list = NULL;
+
+ if (set == NULL)
+ return;
+
+ if (linked_array == NULL)
+ return;
+
+ g_list = set->g_list;
+ n_elts = set->n_elts;
+
+ /* Sort linked_array and apply change to g_list for each element in index */
+
+ for (i = 0; i < n_elts; i++)
+ _coupled_adapted_gnum_shellsort(set->index[i],
+ set->index[i+1],
+ linked_array,
+ g_list);
+
+ /* Define a new index without redundant elements */
+
+ BFT_MALLOC(new_index, n_elts + 1, cs_int_t);
+ new_index[0] = 0;
+
+ for (i = 0; i < n_elts; i++) {
+
+ l = set->index[i];
+ r = set->index[i+1];
+
+ if (r - l > 0) {
+
+ g_list[shift] = g_list[l];
+ shift++;
+
+ for (j = l + 1; j < r; j++) {
+
+ if (linked_array[j] != linked_array[j-1]) {
+ g_list[shift] = g_list[j];
+ shift++;
+ }
+ assert(g_list[shift-1] <= g_list[j]);
+
+ }
+ new_index[i+1] = shift;
+
+ }
+ else { /* No match for this element */
+
+ new_index[i+1] = new_index[i];
+
+ }
+
+ } /* End of loop on elements */
+
+ /* Reshape cs_join_gset_t structure */
+
+ BFT_REALLOC(g_list, new_index[n_elts], fvm_gnum_t);
+ BFT_FREE(set->index);
+
+ set->index = new_index;
+ set->g_list = g_list;
+}
+
+/*----------------------------------------------------------------------------
+ * Concatenate the two g_elts and g_list arrays.
+ *
+ * Order the new concatenated array and delete redundant elements.
+ * We get a single ordered array.
+ *
+ * parameters:
+ * set <-- pointer to the structure to work with
+ * n_elts --> number of elements in the new set
+ * new_array --> pointer to the new created array
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_single_order(const cs_join_gset_t *set,
+ cs_int_t *n_elts,
+ fvm_gnum_t *new_array[])
+{
+ cs_int_t _n_elts = 0;
+ fvm_gnum_t *_new_array = NULL;
+
+ *n_elts = _n_elts;
+ *new_array = _new_array;
+
+ if (set == NULL) /* Nothing to do */
+ return;
+
+ _n_elts = set->n_elts;
+
+ if (_n_elts > 0) {
+
+ cs_int_t i, shift;
+ fvm_gnum_t prev;
+
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *elt_list = NULL;
+
+ _n_elts += set->index[_n_elts]; /* Add number of elements in g_list */
+
+ BFT_MALLOC(elt_list, _n_elts, fvm_gnum_t);
+
+ for (i = 0; i < set->n_elts; i++)
+ elt_list[i] = set->g_elts[i];
+
+ shift = set->n_elts;
+ for (i = 0; i < set->index[set->n_elts]; i++)
+ elt_list[shift + i] = set->g_list[i];
+
+ /* Define an ordered list of elements */
+
+ BFT_MALLOC(_new_array, _n_elts, fvm_gnum_t);
+ BFT_MALLOC(order, _n_elts, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL, elt_list, order, _n_elts);
+
+ for (i = 0; i < _n_elts; i++)
+ _new_array[i] = elt_list[order[i]];
+
+ /* Delete redundant elements */
+
+ shift = 0;
+ prev = _new_array[0] + 1;
+
+ for (i = 0; i < _n_elts; i++) {
+
+ if (prev != _new_array[i]) {
+
+ _new_array[shift] = _new_array[i];
+ prev = _new_array[i];
+ shift++;
+
+ }
+
+ }
+ _n_elts = shift; /* Real number of elements without redundancy */
+
+ /* Memory management */
+
+ BFT_FREE(order);
+ BFT_FREE(elt_list);
+ BFT_REALLOC(_new_array, _n_elts, fvm_gnum_t);
+
+ } /* End if n_elts > 0 */
+
+ /* Set return pointers */
+
+ *n_elts = _n_elts;
+ *new_array = _new_array;
+}
+
+/*----------------------------------------------------------------------------
+ * Compress a g_list such as for each element "e" in g_elts:
+ * - there is no redundancy for the linked elements of set->g_list
+ * - there is no element in set->g_list < e
+ *
+ * parameters:
+ * set <-> pointer to the structure to work with
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_compress(cs_join_gset_t *set)
+{
+ cs_int_t i, j, start, end, save, shift;
+ fvm_gnum_t cur;
+
+ if (set == NULL)
+ return;
+
+ if (set->n_elts == 0)
+ return;
+
+ shift = 0;
+ save = set->index[0];
+
+ for (i = 0; i < set->n_elts; i++) {
+
+ cur = set->g_elts[i];
+ start = save;
+ end = set->index[i+1];
+
+ if (end - start > 0) {
+
+ cs_sort_gnum_shell(start, end, set->g_list);
+
+ if (cur < set->g_list[start])
+ set->g_list[shift++] = set->g_list[start];
+
+ for (j = start + 1; j < end; j++)
+ if (cur < set->g_list[j])
+ if (set->g_list[j-1] != set->g_list[j])
+ set->g_list[shift++] = set->g_list[j];
+
+ }
+
+ save = end;
+ set->index[i+1] = shift;
+
+ } /* End of loop on elements in g_elts */
+
+ /* Reshape cs_join_gset_t structure if necessary */
+
+ if (save != set->index[set->n_elts]) {
+
+ assert(save > set->index[set->n_elts]);
+ BFT_REALLOC(set->g_list, set->index[set->n_elts], fvm_gnum_t);
+
+ }
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ cs_join_gset_dump(NULL, set);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Delete redundancies in set->g_elts.
+ *
+ * Merge sub-arrays associated to a common set->g_elts[i].
+ *
+ * parameters:
+ * set <-- pointer to the structure to work with
+ * order_tag <-- 0: set->g_elts is not ordered, 1: ordered
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_merge_elts(cs_join_gset_t *set,
+ int order_tag)
+{
+ cs_int_t i, save, start, end, n_init_elts, n_sub_elts;
+ fvm_gnum_t prev, cur;
+
+ if (set == NULL)
+ return;
+
+ n_init_elts = set->n_elts;
+
+ if (n_init_elts < 2)
+ return;
+
+ assert(order_tag == 0 || order_tag == 1);
+
+ /* Delete redundancies in g_elts. Merge sub-lists associated to common
+ g_elts */
+
+ if (order_tag == 0)
+ cs_join_gset_sort_elts(set);
+
+ set->n_elts = 0; /* Reset and will be redefinied */
+ prev = set->g_elts[0] + 1; /* Force prev to be different from g_elts[0] */
+ save = set->index[0];
+
+ for (i = 0; i < n_init_elts; i++) {
+
+ cur = set->g_elts[i];
+ start = save;
+ end = set->index[i+1];
+ save = end;
+ n_sub_elts = end - start;
+
+ if (prev != cur) {
+
+ set->g_elts[set->n_elts] = cur;
+ set->n_elts += 1;
+ set->index[set->n_elts] = n_sub_elts;
+ prev = cur;
+
+ }
+ else {
+
+ set->index[set->n_elts] += n_sub_elts;
+
+ } /* prev != next */
+
+ } /* Loop on elements of set->g_elts */
+
+ /* Get the new index */
+
+ for (i = 0; i < set->n_elts; i++)
+ set->index[i+1] += set->index[i];
+
+ /* Reshape cs_join_gset_t structure if necessary */
+
+ if (n_init_elts != set->n_elts) {
+
+ assert(n_init_elts > set->n_elts);
+
+ BFT_REALLOC(set->g_elts, set->n_elts, fvm_gnum_t);
+ BFT_REALLOC(set->index, set->n_elts + 1, cs_int_t);
+ BFT_REALLOC(set->g_list, set->index[set->n_elts], fvm_gnum_t);
+
+ }
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ cs_join_gset_dump(NULL, set);
+#endif
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Synchronize a cs_join_gset_t structure and distribute the resulting set
+ * over the rank by block
+ *
+ * parameters:
+ * n_g_elts <-- global number of elements
+ * loc_set <-> pointer to the local structure to work with
+ * comm <-- mpi_comm on which synchro. and distribution take place
+ *
+ * returns:
+ * a synchronized and distributed cs_join_gset_t structure.
+ *---------------------------------------------------------------------------*/
+
+cs_join_gset_t *
+cs_join_gset_sync_by_block(fvm_gnum_t n_g_elts,
+ cs_join_gset_t *loc_set,
+ MPI_Comm comm)
+{
+ int i, j, shift, block_id;
+ int rank, local_rank, n_ranks, n_recv_elts, n_sub_elts;
+ fvm_gnum_t gnum;
+ cs_join_block_info_t block_info;
+
+ cs_int_t *send_count = NULL, *recv_count = NULL, *counter = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ fvm_gnum_t *send_buffer = NULL, *recv_buffer = NULL;
+ cs_join_gset_t *sync_set = NULL;
+
+ if (n_g_elts == 0)
+ return sync_set;
+
+ MPI_Comm_rank(comm, &local_rank);
+ MPI_Comm_size(comm, &n_ranks);
+
+ block_info = cs_join_get_block_info(n_g_elts, n_ranks, local_rank);
+
+ /* Allocate parameters for MPI functions */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+
+ /* Initialization */
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ /* Synchronize list definition for each global element */
+
+ for (i = 0; i < loc_set->n_elts; i++) {
+
+ rank = (loc_set->g_elts[i] - 1)/block_info.size;
+ n_sub_elts = loc_set->index[i+1] - loc_set->index[i];
+ send_count[rank] += 2 + n_sub_elts;
+
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, comm);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ /* Fill send_buffer: global number and number of elements in index */
+
+ BFT_MALLOC(send_buffer, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv_buffer, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < loc_set->n_elts; i++) {
+
+ gnum = loc_set->g_elts[i];
+ rank = (gnum - 1)/block_info.size;
+ shift = send_shift[rank] + send_count[rank];
+ n_sub_elts = loc_set->index[i+1] - loc_set->index[i];
+
+ send_buffer[shift++] = gnum;
+ send_buffer[shift++] = n_sub_elts;
+
+ for (j = 0; j < n_sub_elts; j++)
+ send_buffer[shift + j] = loc_set->g_list[loc_set->index[i] + j];
+
+ send_count[rank] += 2 + n_sub_elts;
+
+ }
+
+ MPI_Alltoallv(send_buffer, send_count, send_shift, FVM_MPI_GNUM,
+ recv_buffer, recv_count, recv_shift, FVM_MPI_GNUM,
+ comm);
+
+ n_recv_elts = recv_shift[n_ranks];
+
+ /* Partial free memory */
+
+ BFT_FREE(send_buffer);
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(recv_count);
+ BFT_FREE(recv_shift);
+
+ /* Define sync_set: a distributed cs_join_gset_t structure which
+ synchronize data over the ranks */
+
+ sync_set = cs_join_gset_create(block_info.local_size);
+
+ for (i = 0; i < sync_set->n_elts; i++)
+ sync_set->g_elts[i] = block_info.first_gnum + i;
+
+ /* Fill sync_set->index and define a new recv_count for the next comm. */
+
+ i = 0; /* position in recv_buffer */
+
+ while (i < n_recv_elts) {
+
+ block_id = recv_buffer[i++] - block_info.first_gnum;
+
+ assert(sync_set->g_elts[block_id] == recv_buffer[i-1]);
+
+ n_sub_elts = recv_buffer[i++];
+ sync_set->index[block_id+1] += n_sub_elts;
+ i += n_sub_elts;
+
+ } /* End of loop on ranks */
+
+ /* Build index on elements of sync_set */
+
+ for (i = 0; i < sync_set->n_elts; i++)
+ sync_set->index[i+1] += sync_set->index[i];
+
+ BFT_MALLOC(sync_set->g_list,
+ sync_set->index[sync_set->n_elts],
+ fvm_gnum_t);
+
+ /* Fill g_list of sync_set */
+
+ BFT_MALLOC(counter, sync_set->n_elts, cs_int_t);
+
+ for (i = 0; i < sync_set->n_elts; i++)
+ counter[i] = 0;
+
+ i = 0; /* position in recv_buffer */
+
+ while (i < n_recv_elts) {
+
+ block_id = recv_buffer[i++] - block_info.first_gnum;
+ shift = sync_set->index[block_id] + counter[block_id];
+
+ n_sub_elts = recv_buffer[i++];
+
+ for (j = 0; j < n_sub_elts; j++)
+ sync_set->g_list[j + shift] = recv_buffer[i++];
+
+ counter[block_id] += n_sub_elts;
+
+ } /* End of loop on ranks */
+
+ BFT_FREE(recv_buffer);
+ BFT_FREE(counter);
+
+ /* Return pointer */
+
+ cs_join_gset_clean(sync_set);
+
+ return sync_set;
+}
+
+/*----------------------------------------------------------------------------
+ * Update a local cs_join_gset_t structure from a distributed and
+ * synchronized cs_join_gset_t structure.
+ *
+ * parameters:
+ * n_g_elts <-- global number of elements
+ * sync_set <-- pointer to the structure which holds a synchronized block
+ * loc_set <-> pointer to a local structure holding elements to update
+ * comm <-- comm on which synchronization and distribution take place
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_update_from_block(fvm_gnum_t n_g_elts,
+ const cs_join_gset_t *sync_set,
+ cs_join_gset_t *loc_set,
+ MPI_Comm comm)
+{
+ int i, j, k, shift, block_id, start, end;
+ int rank, local_rank, n_ranks, n_sub_elts, n_recv_elts;
+ fvm_gnum_t gnum;
+ cs_join_block_info_t block_info;
+
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL, *wanted_rank_index = NULL;
+ fvm_gnum_t *send_buffer = NULL, *recv_buffer = NULL, *wanted_elts = NULL;
+
+ if (n_g_elts == 0)
+ return;
+
+ /* Sanity checks */
+
+ assert(sync_set != NULL);
+
+ /* loc_set should not have redundant elements. */
+
+ /* Build a cs_join_block_info_t structure */
+
+ MPI_Comm_rank(comm, &local_rank);
+ MPI_Comm_size(comm, &n_ranks);
+
+ block_info = cs_join_get_block_info(n_g_elts, n_ranks, local_rank);
+
+ /* Allocate parameters for MPI functions */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(wanted_rank_index, n_ranks + 1, cs_int_t);
+
+ /* Initialization */
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ /* Get a synchronized list definition for each global element */
+
+ for (i = 0; i < loc_set->n_elts; i++) {
+ rank = (loc_set->g_elts[i] - 1)/block_info.size;
+ send_count[rank] += 1;
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, comm);
+
+ send_shift[0] = 0;
+ wanted_rank_index[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ wanted_rank_index[rank + 1] = wanted_rank_index[rank] + recv_count[rank];
+ }
+
+ /* Fill send_buffer: global number */
+
+ BFT_MALLOC(send_buffer, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(wanted_elts, wanted_rank_index[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < loc_set->n_elts; i++) {
+
+ gnum = loc_set->g_elts[i];
+ rank = (gnum - 1)/block_info.size;
+ shift = send_shift[rank] + send_count[rank];
+
+ send_buffer[shift] = gnum;
+ send_count[rank] += 1;
+
+ }
+
+ MPI_Alltoallv(send_buffer, send_count, send_shift, FVM_MPI_GNUM,
+ wanted_elts, recv_count, wanted_rank_index, FVM_MPI_GNUM,
+ comm);
+
+ /* Send new list definition holding by sync_set to ranks which have
+ request it */
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = wanted_rank_index[rank]; i < wanted_rank_index[rank+1]; i++) {
+
+ block_id = wanted_elts[i] - block_info.first_gnum;
+ n_sub_elts = sync_set->index[block_id+1] - sync_set->index[block_id];
+
+ send_count[rank] += 2 + n_sub_elts; /* glob. num,
+ n_sub_elts,
+ g_list */
+
+ }
+
+ } /* End of loop on ranks */
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, comm);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ BFT_REALLOC(send_buffer, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv_buffer, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = wanted_rank_index[rank]; i < wanted_rank_index[rank+1]; i++) {
+
+ shift = send_shift[rank] + send_count[rank];
+ block_id = wanted_elts[i] - block_info.first_gnum;
+
+ start = sync_set->index[block_id];
+ end = sync_set->index[block_id+1];
+ n_sub_elts = end - start;
+
+ send_buffer[shift++] = wanted_elts[i];
+ send_buffer[shift++] = n_sub_elts;
+
+ for (j = start, k = 0; j < end; j++, k++)
+ send_buffer[shift+k] = sync_set->g_list[j];
+
+ send_count[rank] += 2 + n_sub_elts; /* glob. num, n_sub_elts, g_list */
+
+ }
+
+ } /* End of loop on ranks */
+
+ MPI_Alltoallv(send_buffer, send_count, send_shift, FVM_MPI_GNUM,
+ recv_buffer, recv_count, recv_shift, FVM_MPI_GNUM,
+ comm);
+
+ n_recv_elts = recv_shift[n_ranks];
+
+ /* Partial free memory */
+
+ BFT_FREE(send_buffer);
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(recv_count);
+ BFT_FREE(recv_shift);
+
+ /* Re-initialize loc_set
+ As loc_set->g_elts and sync_set->g_elts are ordered, it's easier.
+ We can take values as they come */
+
+ /* First redefine index */
+
+ assert(loc_set->index[0] == 0);
+
+ for (i = 0; i < loc_set->n_elts; i++)
+ loc_set->index[i+1] = 0;
+
+ i = 0; /* id in recv_buffer */
+ j = 0; /* id in g_elts */
+
+ while (i < n_recv_elts) {
+
+ gnum = recv_buffer[i++];
+
+ assert(loc_set->g_elts[j] = gnum);
+
+ n_sub_elts = recv_buffer[i++];
+ loc_set->index[j+1] = n_sub_elts;
+
+ i += n_sub_elts;
+ j++; /* go to the next elements */
+
+ } /* End of loop on elements of recv_buffer */
+
+ /* Define the new index */
+
+ for (i = 0; i < loc_set->n_elts; i++)
+ loc_set->index[i+1] += loc_set->index[i];
+
+ BFT_REALLOC(loc_set->g_list, loc_set->index[loc_set->n_elts], fvm_gnum_t);
+
+ i = 0; /* id in recv_buffer */
+ j = 0; /* id in g_elts */
+
+ while (i < n_recv_elts) {
+
+ gnum = recv_buffer[i++];
+ n_sub_elts = recv_buffer[i++];
+
+ assert(loc_set->g_elts[j] = gnum);
+
+ for (k = 0; k < n_sub_elts; k++)
+ loc_set->g_list[loc_set->index[j] + k] = recv_buffer[i + k];
+
+ i += n_sub_elts;
+ j++; /* go to the next elements */
+
+ } /* End of loop on elements of recv_buffer */
+
+ BFT_FREE(recv_buffer);
+ BFT_FREE(wanted_elts);
+ BFT_FREE(wanted_rank_index);
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Dump an array (int or double).
+ *
+ * This function is called according to the verbosity.
+ *
+ * parameters:
+ * type <-- type of the array to display
+ * header <-- header to display in front of the array
+ * n_elts <-- number of elements to display
+ * array <-- array to display
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_dump_array(const char *type,
+ const char *header,
+ int n_elts,
+ const void *array)
+{
+ int i;
+
+ bft_printf(" %s: ", header);
+
+ if (!strncmp(type, "int", strlen("int"))) { /* "int" array */
+
+ const int *i_array = array;
+
+ for (i = 0; i < n_elts; i++)
+ bft_printf(" %d ", i_array[i]);
+
+ }
+ else if (!strncmp(type, "double", strlen("double"))) { /* "double" array */
+
+ const double *d_array = array;
+
+ for (i = 0; i < n_elts; i++)
+ bft_printf(" %e ", d_array[i]);
+
+ }
+ else if (!strncmp(type, "gnum", strlen("gnum"))) { /* "gnum" array */
+
+ const fvm_gnum_t *u_array = array;
+
+ for (i = 0; i < n_elts; i++)
+ bft_printf(" %u ", u_array[i]);
+
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Unexpected type (%s) to display in the current dump.\n"),
+ type);
+
+ bft_printf("\n");
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_join_gset_t structure.
+ *
+ * parameters:
+ * file <-- pointer to an output file or NULL
+ * set <-- pointer to the cs_join_gset_t structure to dump
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_gset_dump(FILE *file,
+ const cs_join_gset_t *set)
+{
+ int i, j, n_matches;
+
+ if (set == NULL)
+ return;
+
+ if (file == NULL)
+ file = stdout;
+
+ fprintf(file, "\nDump cs_join_gset_t structure: %p\n", (const void *)set);
+ fprintf(file,"number of elements: %10d\n", set->n_elts);
+ fprintf(file,"size of the list : %10d\n\n", set->index[set->n_elts]);
+
+ for (i = 0; i < set->n_elts; i++) {
+
+ n_matches = set->index[i+1] - set->index[i];
+
+ fprintf(file, "Global num.: %8u | n_matches : %3d |",
+ set->g_elts[i], n_matches);
+
+ for (j = set->index[i]; j < set->index[i+1]; j++)
+ fprintf(file, "%8u ", set->g_list[j]);
+ fprintf(file, "\n");
+
+ } /* End of loop on boxes */
+
+ fflush(file);
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_join_split.c b/src/base/cs_join_split.c
new file mode 100644
index 0000000..70bdc12
--- /dev/null
+++ b/src/base/cs_join_split.c
@@ -0,0 +1,2223 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Split faces during the joining operation
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_timer.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_io_num.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_search.h"
+#include "cs_join_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_split.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Structure and type definitions
+ *===========================================================================*/
+
+/* enum structure to define a category for each kind of problem
+ which can be encountered during the face splitting operation */
+
+typedef enum {
+
+ NO_SPLIT_ERROR,
+ OPEN_CYCLE_ERROR,
+ EDGE_TRAVERSED_TWICE_ERROR,
+ LOOP_LIMIT_ERROR,
+ MAX_SPLIT_ERROR
+
+} cs_join_split_error_t;
+
+/* ----------------------------------------------------------------- */
+/* Definition of a structure used to build the new face connectivity */
+/* ----------------------------------------------------------------- */
+
+typedef struct {
+
+ cs_int_t n_faces;
+ cs_int_t *face_index; /* Face -> Subface index */
+ cs_join_rset_t *subface_index; /* Subface -> vertex connect. index */
+ cs_join_rset_t *subface_connect; /* Subface -> vertex connect. list */
+
+ /* The two following arrays are built after the face splitting. So, they
+ don't need to be resizable */
+
+ fvm_gnum_t n_g_subfaces; /* Global number of subfaces after splitting */
+ fvm_gnum_t *subface_gconnect; /* Subface -> glob. vertex list */
+ fvm_gnum_t *subface_gnum; /* Subface global numbering */
+
+} face_builder_t;
+
+/*============================================================================
+ * Global variable definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute the cross product of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ * result --> cross product v1xv2
+ *
+ * returns:
+ * the resulting cross product (v1 x v2)
+ *---------------------------------------------------------------------------*/
+
+inline static void
+_cross_product(double v1[],
+ double v2[],
+ double result[])
+{
+ result[0] = v1[1] * v2[2] - v2[1] * v1[2];
+ result[1] = v2[0] * v1[2] - v1[0] * v2[2];
+ result[2] = v1[0] * v2[1] - v2[0] * v1[1];
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the dot product of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ *
+ * returns:
+ * the resulting dot product (v1.v2)
+ *---------------------------------------------------------------------------*/
+
+inline static double
+_dot_product(double v1[],
+ double v2[])
+{
+ int i;
+ double result = 0.0;
+
+ for (i = 0; i < 3; i++)
+ result += v1[i] * v2[i];
+
+ return result;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the norm of a vector.
+ *
+ * parameters:
+ * v <-> vector to work with.
+ *---------------------------------------------------------------------------*/
+
+inline static double
+_norm(double v[])
+{
+ return sqrt(_dot_product(v, v));
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the cosine of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ *
+ * returns: / \
+ * the resulting cosine of (v1.v2)
+ *---------------------------------------------------------------------------*/
+
+inline static double
+_cosine(double v1[],
+ double v2[])
+{
+ double dprod = _dot_product(v1, v2);
+ double n1 = _norm(v1);
+ double n2 = _norm(v2);
+ double result = dprod / (n1 * n2);
+
+ return result;
+}
+
+/*----------------------------------------------------------------------------
+ * Locally renumber an indexed list of global elements according to an
+ * ordering array.
+ *
+ * parameters:
+ * n_elts <-- number of elements in index
+ * order <-- ordering array
+ * index <-- unordered index on global elements (index[0] = 0)
+ * glist <-- unordered indexed list of global elements
+ * new_index --> ordered index on global elements (index[0] = 0)
+ * new_glist --> ordered indexed list of global elements
+ *---------------------------------------------------------------------------*/
+
+static void
+_renumber_local_ordered_i(cs_int_t n_elts,
+ const fvm_lnum_t order[],
+ const cs_int_t index[],
+ fvm_gnum_t glist[],
+ cs_int_t *new_index[],
+ fvm_gnum_t *new_glist[])
+{
+ cs_int_t i, j, k, o_id;
+
+ cs_int_t *_new_index = NULL;
+ fvm_gnum_t *_new_glist = NULL;
+
+ if (n_elts < 1)
+ return;
+
+ assert(index[0] == 0); /* case index[0] = 1 coulb be coded in the future */
+
+ /* Build a new index */
+
+ BFT_MALLOC(_new_index, n_elts + 1, cs_int_t);
+
+ for (i = 0; i < n_elts; i++) {
+ o_id = order[i];
+ _new_index[i+1] = index[o_id+1] - index[o_id];
+ }
+
+ _new_index[0] = 0;
+ for (i = 0; i < n_elts; i++)
+ _new_index[i+1] += _new_index[i];
+
+ /* Build a new list */
+
+ BFT_MALLOC(_new_glist, _new_index[n_elts], fvm_gnum_t);
+
+ for (i = 0; i < n_elts; i++) {
+
+ o_id = order[i];
+
+ for (j = index[o_id], k = _new_index[i]; j < index[o_id+1]; j++, k++)
+ _new_glist[k] = glist[j];
+ }
+
+ /* Return pointers */
+
+ *new_index = _new_index;
+ *new_glist = _new_glist;
+}
+
+/*----------------------------------------------------------------------------
+ * Define send_rank_index and send_faces to prepare the exchange of new faces
+ * between mesh structures.
+ *
+ * parameters:
+ * o2n_hist <-- old -> new global face numbering
+ * gnum_rank_index <-- index on ranks for the old global face numbering
+ * send_rank_index --> index on ranks for sending face
+ * send_faces --> list of face ids to send
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_faces_to_send(const cs_join_gset_t *o2n_hist,
+ const fvm_gnum_t gnum_rank_index[],
+ cs_int_t *send_rank_index[],
+ cs_int_t *send_faces[])
+{
+ cs_int_t i, j, rank, start, end;
+
+ cs_int_t reduce_size = 0;
+ cs_int_t *_send_rank_index = NULL, *_send_faces = NULL, *reduce_ids = NULL;
+ fvm_gnum_t *reduce_index = NULL;
+ cs_join_gset_t *new_face_rank = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* Sanity checks */
+
+ assert(gnum_rank_index != NULL);
+ assert(o2n_hist != NULL);
+ assert(n_ranks > 1);
+
+ new_face_rank = cs_join_gset_create(n_ranks);
+
+ for (i = 0; i < n_ranks; i++)
+ new_face_rank->g_elts[i] = 0; /* used to store local count */
+
+ /* Compact init. global face distribution. Remove ranks without face
+ at the begining */
+
+ for (i = 0; i < n_ranks; i++)
+ if (gnum_rank_index[i] < gnum_rank_index[i+1])
+ reduce_size++;
+
+ BFT_MALLOC(reduce_index, reduce_size+1, fvm_gnum_t);
+ BFT_MALLOC(reduce_ids, reduce_size, cs_int_t);
+
+ reduce_size = 0;
+ reduce_index[0] = gnum_rank_index[0] + 1;
+
+ for (i = 0; i < n_ranks; i++) {
+
+ /* Add +1 to gnum_rank_index because it's an id and we work on numbers */
+
+ if (gnum_rank_index[i] < gnum_rank_index[i+1]) {
+ reduce_index[reduce_size+1] = gnum_rank_index[i+1] + 1;
+ reduce_ids[reduce_size++] = i;
+ }
+
+ }
+
+ /* Count number of ranks associated to each new face */
+
+ for (i = 0; i < o2n_hist->n_elts; i++) {
+
+ int reduce_rank = cs_search_gindex_binary(reduce_size,
+ o2n_hist->g_elts[i],
+ reduce_index);
+
+ assert(reduce_rank != -1);
+ assert(reduce_rank < reduce_size);
+
+ rank = reduce_ids[reduce_rank];
+ new_face_rank->index[rank+1] += o2n_hist->index[i+1] - o2n_hist->index[i];
+
+ }
+
+ for (i = 0; i < n_ranks; i++)
+ new_face_rank->index[i+1] += new_face_rank->index[i];
+
+ BFT_MALLOC(new_face_rank->g_list, new_face_rank->index[n_ranks], fvm_gnum_t);
+
+ /* Fill the list of ranks */
+
+ for (i = 0; i < o2n_hist->n_elts; i++) {
+
+ int reduce_rank = cs_search_gindex_binary(reduce_size,
+ o2n_hist->g_elts[i],
+ reduce_index);
+
+ assert(reduce_rank != -1);
+ assert(reduce_rank < reduce_size);
+
+ rank = reduce_ids[reduce_rank];
+ start = o2n_hist->index[i];
+ end = o2n_hist->index[i+1];
+
+ for (j = start; j < end; j++) {
+
+ cs_int_t shift = new_face_rank->index[rank]
+ + new_face_rank->g_elts[rank];
+ cs_int_t new_fid = o2n_hist->g_list[j] - 1;
+
+ new_face_rank->g_list[shift] = new_fid;
+ new_face_rank->g_elts[rank] += 1;
+
+ } /* End of loop on new faces */
+
+ } /* End of loop on initial faces */
+
+ /* Free memory */
+
+ BFT_FREE(reduce_ids);
+ BFT_FREE(reduce_index);
+
+ cs_join_gset_clean(new_face_rank);
+
+ /* Define arrays to return */
+
+ BFT_MALLOC(_send_rank_index, n_ranks + 1, cs_int_t);
+
+ for (i = 0; i < n_ranks + 1; i++)
+ _send_rank_index[i] = new_face_rank->index[i];
+
+ BFT_MALLOC(_send_faces, _send_rank_index[n_ranks], cs_int_t);
+
+ for (i = 0; i < _send_rank_index[n_ranks]; i++)
+ _send_faces[i] = new_face_rank->g_list[i];
+
+ cs_join_gset_destroy(&new_face_rank);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n Exchange to do after the splitting operation:\n");
+ for (i = 0; i < n_ranks; i++) {
+ start = _send_rank_index[i];
+ end = _send_rank_index[i+1];
+ bft_printf(" Send to rank %5d (n = %10d):", i, end - start);
+ for (j = start; j < end; j++)
+ bft_printf(" %d ", _send_faces[j]);
+ bft_printf("\n");
+ }
+#endif
+
+ /* Return pointers */
+
+ *send_rank_index = _send_rank_index;
+ *send_faces = _send_faces;
+}
+
+/*----------------------------------------------------------------------------
+ * Define the head_edges and ext_edges lists.
+ *
+ * Use a permutation number "perm" to build lists with a shift.
+ *
+ * Note: perm < n_face_vertices
+ *
+ * parameters:
+ * face_id <-- face_id of the current in the cs_join_mesh_t struct.
+ * mesh <-- cs_join_mesh_t structure
+ * edges <-- cs_join_edges_t structure
+ * head_edges <-> head edegs list struct.
+ * ext_edges <-> exterior edge list struct.
+ * perm <-- permutation shift
+ *---------------------------------------------------------------------------*/
+
+static void
+_define_head_and_ext_edges(cs_int_t face_id,
+ const cs_join_mesh_t *mesh,
+ const cs_join_edges_t *edges,
+ cs_join_rset_t *head_edges,
+ cs_join_rset_t *ext_edges,
+ cs_int_t perm)
+{
+ cs_int_t i, j, k, shift;
+ cs_int_t couple[2];
+
+ cs_int_t start_id = mesh->face_vtx_idx[face_id]-1;
+ cs_int_t end_id = mesh->face_vtx_idx[face_id+1]-1;
+ cs_int_t n_face_vertices = end_id - start_id;
+
+ assert(perm < n_face_vertices);
+
+ for (k = 0, i = start_id; i < end_id-1; i++) {
+
+ couple[0] = mesh->face_vtx_lst[i];
+ couple[1] = mesh->face_vtx_lst[i+1];
+
+ for (j = edges->vtx_idx[couple[0]-1];
+ j < edges->vtx_idx[couple[0]]; j++)
+ if (edges->adj_vtx_lst[j] == couple[1])
+ break;
+
+ shift = (k + perm) % n_face_vertices;
+ head_edges->array[shift] = edges->edge_lst[j];
+ ext_edges->array[shift] = edges->edge_lst[j];
+ k++;
+
+ } /* End of loop on face vertices */
+
+ /* Last couple : last vertex and first vertex */
+
+ couple[0] = mesh->face_vtx_lst[end_id-1];
+ couple[1] = mesh->face_vtx_lst[start_id];
+
+ for (j = edges->vtx_idx[couple[0]-1];
+ j < edges->vtx_idx[couple[0]]; j++)
+ if (edges->adj_vtx_lst[j] == couple[1])
+ break;
+
+ shift = (k + perm) % n_face_vertices;
+ head_edges->array[shift] = edges->edge_lst[j];
+ ext_edges->array[shift] = edges->edge_lst[j];
+ k++;
+
+ assert(k == n_face_vertices);
+
+ head_edges->n_elts = n_face_vertices;
+ ext_edges->n_elts = n_face_vertices;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Create a face_builder_t structure.
+ *
+ * parameters:
+ * n_faces <--number of faces associated to the structure
+ *
+ * returns:
+ * a new allocated face_builder_t structure.
+ *---------------------------------------------------------------------------*/
+
+static face_builder_t *
+_create_face_builder(cs_int_t n_faces)
+{
+ cs_int_t i;
+
+ face_builder_t *builder = NULL;
+
+ if (n_faces == 0)
+ return NULL;
+
+ BFT_MALLOC(builder, 1, face_builder_t);
+
+ builder->n_faces = n_faces;
+
+ BFT_MALLOC(builder->face_index, n_faces + 1, cs_int_t);
+
+ for (i = 0; i < n_faces + 1; i++)
+ builder->face_index[i] = 0;
+
+ builder->subface_index = cs_join_rset_create(n_faces + 1);
+ builder->subface_index->array[0] = 0;
+
+ /* Initialize the size of the sub-face connectivity as if all faces drives
+ to one triangular sub-face which is the minimal connectivity size
+ possible */
+
+ builder->subface_connect = cs_join_rset_create(15);
+ builder->subface_gnum = NULL;
+ builder->subface_gconnect = NULL;
+
+ return builder;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a face_builder_t structure.
+ *
+ * parameters:
+ * builder <-- pointer to the structure to delete
+ *
+ * returns:
+ * a NULL pointer.
+ *---------------------------------------------------------------------------*/
+
+static face_builder_t *
+_destroy_face_builder(face_builder_t *builder)
+{
+ if (builder == NULL)
+ return NULL;
+
+ BFT_FREE(builder->face_index);
+
+ cs_join_rset_destroy(&(builder->subface_index));
+ cs_join_rset_destroy(&(builder->subface_connect));
+
+ if (builder->subface_gnum != NULL)
+ BFT_FREE(builder->subface_gnum);
+
+ if (builder->subface_gconnect != NULL)
+ BFT_FREE(builder->subface_gconnect);
+
+ BFT_FREE(builder);
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a face and its subface connect. from a face_builder_t structure.
+ *
+ * parameters:
+ * face_id <-- face_id to dump
+ * builder <-- pointer to the structure to dump
+ *---------------------------------------------------------------------------*/
+
+static void
+_dump_face_builder(cs_int_t face_id,
+ const face_builder_t *builder)
+{
+ cs_int_t i, j;
+ cs_int_t subface_id = 0;
+ cs_int_t face_s = builder->face_index[face_id];
+ cs_int_t face_e = builder->face_index[face_id+1];
+ cs_int_t n_subfaces = face_e - face_s;
+
+ bft_printf(" Face %9d (n_subfaces: %d):\n", face_id+1, n_subfaces);
+
+ for (i = face_s; i <face_e; i++, subface_id++) {
+
+ cs_int_t subface_s = builder->subface_index->array[i];
+ cs_int_t subface_e = builder->subface_index->array[i+1];
+
+ if (builder->subface_gnum == NULL)
+ bft_printf(" subface %4d: (%d, %d) -",
+ subface_id, subface_s, subface_e);
+ else
+ bft_printf(" subface %4d (%10u) - (%d, %d) -",
+ subface_id, builder->subface_gnum[face_s + subface_id],
+ subface_s, subface_e);
+
+ if (builder->subface_gconnect == NULL) {
+ for (j = subface_s; j < subface_e; j++)
+ bft_printf(" %d ", builder->subface_connect->array[j]);
+ }
+ else {
+ for (j = subface_s; j < subface_e; j++)
+ bft_printf(" %u ", builder->subface_gconnect[j]);
+ }
+ bft_printf("\n");
+
+ }
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Split the current face into sub-faces under the "plane" tolerance
+ * (check if two faces are coplanear).
+ *
+ * parameters:
+ * face_id <-- face_id of the current in the cs_join_mesh_t struct.
+ * block_id <-- current id in face_builder_t structure
+ * plane <-- tolerance parameter to check coplanearity
+ * max_subfaces <-- maximum number of sub faces
+ * verbosity <-- level of accuracy in information display
+ * face_normal <-- normal for each face of the mesh
+ * work <-- cs_join_mesh_t structure
+ * edge_face_idx <-- "edge -> face" connect. index
+ * edge_face_lst <-- "edge -> face" connect. list
+ * builder <-> face_builder structure
+ * head_edges <-> pointer to a resizable set structure
+ * subface_edges <-> pointer to a resizable set structure
+ * ext_edges <-> pointer to a resizable set structure
+ * int_edges <-> pointer to a resizable set structure
+ *
+ * returns:
+ * an error code (enum: cs_join_split_error_t)
+ *---------------------------------------------------------------------------*/
+
+static cs_join_split_error_t
+_split_face(cs_int_t face_id,
+ cs_int_t block_id,
+ double plane,
+ int max_subfaces,
+ int verbosity,
+ const cs_real_t face_normal[],
+ const cs_join_mesh_t *work,
+ const cs_join_edges_t *edges,
+ const cs_int_t *edge_face_idx,
+ const cs_int_t *edge_face_lst,
+ face_builder_t *builder,
+ cs_join_rset_t **head_edges,
+ cs_join_rset_t **subface_edges,
+ cs_join_rset_t **ext_edges,
+ cs_join_rset_t **int_edges)
+{
+ cs_int_t i, j, k, i1, i2, i_int, i_ext;
+ cs_int_t first_vid, vid1, vid2;
+ cs_int_t subface_shift, connect_shift, connect_start;
+ cs_int_t next_vertex, next_edge;
+ cs_real_t face_norm[3], v1v2_vect[3], connect_vect[3];
+
+ cs_real_t min_max_d = 0.0;
+ cs_int_t n_subfaces = 0, head_edge_shift = 0;
+ cs_int_t start_id = work->face_vtx_idx[face_id]-1;
+ cs_int_t end_id = work->face_vtx_idx[face_id+1]-1;
+
+ cs_real_t max_coord[3] = {-DBL_MAX, -DBL_MAX, -DBL_MAX};
+ cs_real_t min_coord[3] = {DBL_MAX, DBL_MAX, DBL_MAX};
+
+ cs_join_rset_t *_head_edges = *head_edges;
+ cs_join_rset_t *_subface_edges = *subface_edges;
+ cs_join_rset_t *_ext_edges = *ext_edges;
+ cs_join_rset_t *_int_edges = *int_edges;
+
+ const cs_join_vertex_t *vertices = work->vertices;
+ const cs_real_t min_limit_cos = -1.1, max_limit_cos = 1.1;
+
+ cs_bool_t tst_dbg = (verbosity > 3 ? true : false);
+
+ /* To be implemented ... */
+ cs_int_t *face_face_connect = NULL;
+
+ /* Min./Max. coordinates of the current face */
+
+ for (i = start_id; i < end_id; i++) {
+
+ cs_int_t vid = work->face_vtx_lst[i] - 1;
+
+ for (j = 0; j < 3; j++) {
+ min_coord[j] = CS_MIN(min_coord[j], vertices[vid].coord[j]);
+ max_coord[j] = CS_MAX(max_coord[j], vertices[vid].coord[j]);
+ }
+
+ }
+
+ for (j = 0; j < 3; j++)
+ min_max_d = CS_MAX(min_max_d, max_coord[j] - min_coord[j]);
+
+ for (j = 0; j < 3; j++) {
+ min_coord[j] -= 0.5 * min_max_d;
+ max_coord[j] += 0.5 * min_max_d;
+ }
+
+ /* Fill the current face normal */
+
+ for (j = 0; j < 3; j++)
+ face_norm[j] = face_normal[3*face_id+j];
+
+ /* Loop on head edges */
+
+ subface_shift = builder->face_index[block_id];
+ connect_shift = builder->subface_index->array[subface_shift];
+ connect_start = connect_shift;
+
+ assert(connect_start == builder->subface_connect->n_elts);
+
+ while (_head_edges->n_elts > 0) { /* Loop until there is one head edge */
+
+ _int_edges->n_elts = 0;
+ head_edge_shift = 0;
+ _subface_edges->n_elts = 0;
+
+ assert(_head_edges->n_elts == _ext_edges->n_elts);
+
+ while (head_edge_shift < _head_edges->n_elts) { /* Build a new sub-face */
+
+ cs_int_t head_edge_num = _head_edges->array[head_edge_shift];
+ cs_int_t edge_num = head_edge_num;
+ cs_int_t edge_id = FVM_ABS(edge_num) - 1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" face_gnum: %u, head_shift: %d, edge_num: %d\n",
+ work->face_gnum[face_id], head_edge_shift, edge_num);
+#endif
+
+ if (edge_num > 0) {
+ vid1 = edges->def[2*edge_id] - 1;
+ vid2 = edges->def[2*edge_id+1] - 1;
+ }
+ else {
+ vid1 = edges->def[2*edge_id+1] - 1;
+ vid2 = edges->def[2*edge_id] - 1;
+ }
+
+ cs_join_rset_resize(&(builder->subface_connect), connect_shift + 1);
+ cs_join_rset_resize(&_subface_edges, _subface_edges->n_elts);
+
+ builder->subface_connect->array[connect_shift++] = vid1+1;
+ builder->subface_connect->array[connect_shift++] = vid2+1;
+
+ _subface_edges->array[_subface_edges->n_elts++] = edge_num;
+
+ first_vid = vid1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" v1: %u, v2: %u, first: %u\n", vertices[vid1].gnum,
+ vertices[vid2].gnum, vertices[first_vid].gnum);
+#endif
+
+ while (vid2 != first_vid) {
+
+ /* Look for the connected vertices and its associated edge */
+
+ cs_int_t v2v_start = edges->vtx_idx[vid2];
+ cs_int_t v2v_end = edges->vtx_idx[vid2+1];
+ cs_int_t n_connect_vertices = v2v_end - v2v_start;
+
+ next_edge = 0;
+ next_vertex = 0; /* To enable a check at the end */
+
+ if (n_connect_vertices > 2) { /* Look for the edge which is
+ the most on the left */
+
+ cs_int_t left_next_edge = -1, left_next_vertex = -1;
+ cs_int_t right_next_edge = -1, right_next_vertex = -1;
+ cs_real_t left_min_cos = max_limit_cos;
+ cs_real_t right_max_cos = min_limit_cos;
+
+ for (j = 0; j < 3; j++)
+ v1v2_vect[j] = vertices[vid2].coord[j]- vertices[vid1].coord[j];
+
+ /* Loop on connected vertices */
+
+ for (i = v2v_start; i < v2v_end; i++) {
+
+ cs_int_t connect_vid = edges->adj_vtx_lst[i]-1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" (%d) vertex connected to v2: %u\n",
+ i, vertices[connect_vid].gnum);
+#endif
+
+ if (connect_vid != vid1) {
+
+ cs_bool_t is_inside = true;
+ cs_int_t connect_edge_id = CS_ABS(edges->edge_lst[i]) - 1;
+
+ /* Test if the connected vertex is inside the face */
+
+ for (k = 0; k < 3; k++)
+ if ( vertices[connect_vid].coord[k] < min_coord[k]
+ || vertices[connect_vid].coord[k] > max_coord[k])
+ is_inside = false;
+
+ if (is_inside == true) {
+
+ cs_bool_t found = false;
+
+ for (k = 0; k < 3; k++)
+ connect_vect[k] = vertices[connect_vid].coord[k]
+ - vertices[vid2].coord[k];
+
+ /* Loop on faces sharing this edge */
+
+ for (j = edge_face_idx[connect_edge_id];
+ (j < edge_face_idx[connect_edge_id+1] && found == false);
+ j++) {
+
+ cs_int_t adj_face_id = edge_face_lst[j] - 1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t Adj face (%u) through edge (%u)\n",
+ work->face_gnum[adj_face_id],
+ edges->gnum[connect_edge_id]);
+#endif
+
+ if (adj_face_id != face_id) {
+
+ cs_real_t dprod, dprod2;
+ cs_real_t adj_face_norm[3];
+
+ for (k = 0; k < 3; k++)
+ adj_face_norm[k] = face_normal[3*adj_face_id+k];
+
+ dprod = _dot_product(adj_face_norm, face_norm);
+ dprod2 = dprod * dprod;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t dp: %g, dp2: %g Vs plane: %g -"
+ " AdjNorm: [%g %g %g] - Norm: [%g %g %g]\n",
+ dprod, dprod2, plane, adj_face_norm[0],
+ adj_face_norm[1], adj_face_norm[2],
+ face_norm[0], face_norm[1], face_norm[2]);
+#endif
+
+ if (dprod2 > plane) {
+
+ if (face_face_connect == NULL) {
+ found = true;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t -> Adj face is OK\n");
+#endif
+ }
+ else { /* To be implemented ... */
+
+ assert(face_face_connect != NULL);
+ bft_error(__FILE__, __LINE__, 0,
+ _(" face splitting with face -> face"
+ " connectivity is not yet implemented\n"));
+
+ /* Check if adj_face_id+1 is in face-face connect. */
+ }
+
+ }
+
+ } /* End if adj_face_id != face_id */
+ else {
+
+ assert(adj_face_id == face_id);
+ found = true;
+
+ }
+
+ } /* End of loop on faces sharing this edge */
+
+ if (found == true) {
+
+ /* Continue to build the new sub-face connectivity.
+ adj_edge_id is in the plane as edge_id
+
+ We look for the edge which is the most on the
+ left among all the adjacent edges.
+
+ |
+ \ | /
+ adj. edge : E2 ==> \ | /
+ \ | / Left part
+ \|/
+ current edge : E1 ==> -->----o------ ............
+ /|\
+ / | \ Right part
+ / | \
+ / | \
+
+ E2 is in the left part if :
+ - angle A between E1 and E2 is in [0, Pi[
+ - i.e. sin(A) >= 0
+ -> -> -> ->
+ - (E1 X E2).n >= 0 where n is the face normal vector
+
+ Edge which is the most on the left is the one which has
+ the minimal cos(A)
+
+ If there is no edge in the left part, we choose the edge
+ in the right part with the biggest cos(A)
+
+ */
+
+ cs_real_t cprod[3], dprod, cosine;
+
+ _cross_product(v1v2_vect, connect_vect, cprod);
+ dprod = _dot_product(cprod, face_norm);
+ cosine = _cosine(v1v2_vect, connect_vect);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf("\t dot_prod: %g, cosine: %g\n",
+ dprod, cosine);
+#endif
+
+ if (dprod > 0) { /* Left part. We choose the edge
+ with the smallest cosine */
+
+ if (cosine < left_min_cos) {
+ left_min_cos = cosine;
+ left_next_vertex = connect_vid + 1;
+ left_next_edge = edges->edge_lst[i];
+ }
+
+ } /* dprod > 0 */
+
+ else { /* In the right part. We choose the edge with
+ the biggest cosine. */
+
+ if (cosine > right_max_cos) {
+ right_max_cos = cosine;
+ right_next_vertex = connect_vid + 1;
+ right_next_edge = edges->edge_lst[i];
+ }
+
+ } /* End if dot_prod < 0 */
+
+ } /* End if found = true */
+
+ } /* The connected vertex is inside the face bounding box */
+
+ } /* connect_vid != vid1 */
+
+ } /* End of loop on connected vertices */
+
+ if (left_min_cos < max_limit_cos) {
+ next_edge = left_next_edge;
+ next_vertex = left_next_vertex;
+ }
+ else if (right_max_cos > min_limit_cos) {
+ next_edge = right_next_edge;
+ next_vertex = right_next_vertex;
+ }
+ else if ( left_min_cos >= max_limit_cos
+ && right_max_cos <= min_limit_cos) {
+
+ /* Set return pointers */
+
+ *head_edges = _head_edges;
+ *ext_edges = _ext_edges;
+ *int_edges = _int_edges;
+ *subface_edges = _subface_edges;
+
+ if (verbosity > 1)
+ bft_printf("\nWarning: open cycle for global face %u\n",
+ work->face_gnum[face_id]);
+
+ return OPEN_CYCLE_ERROR; /* open cycle */
+
+ }
+
+ assert(next_edge != 0);
+ assert(next_vertex != 0);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" Result: next_vertex: %u - next_edge: %u\n",
+ vertices[next_vertex-1].gnum,
+ edges->gnum[CS_ABS(next_edge)-1]);
+#endif
+
+ } /* End if n_connect_vertices > 2 */
+
+ else if (n_connect_vertices == 2) {
+
+ /* Loop on connected vertices */
+
+ for (i = v2v_start; i < v2v_end; i++) {
+
+ cs_int_t connect_vid = edges->adj_vtx_lst[i]-1;
+
+ if (connect_vid != vid1) {
+ next_edge = edges->edge_lst[i];
+ next_vertex = connect_vid + 1;
+ }
+
+ } /* End of loop on connected vertices */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" Result (connect only by 2):"
+ " next_vertex: %u - next_edge: %u\n",
+ vertices[next_vertex-1].gnum,
+ edges->gnum[CS_ABS(next_edge)-1]);
+#endif
+
+ }
+ else {
+
+ assert(n_connect_vertices < 2);
+
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Joining operation : split face %d\n"
+ " Problem in the connectivity. Could not find a "
+ "connection with the vertex %d\n"),
+ face_id, vid1+1);
+
+
+ } /* End of test on the number of vertices connected to vid2 */
+
+ /* Add the next edge in the sub-face definition */
+
+ cs_join_rset_resize(&_subface_edges, _subface_edges->n_elts);
+ _subface_edges->array[_subface_edges->n_elts++] = next_edge;
+
+ if (next_vertex != first_vid + 1) {
+
+ /* Add the next vertex in the sub-face definition */
+
+ cs_join_rset_resize(&(builder->subface_connect), connect_shift);
+ builder->subface_connect->array[connect_shift++] = next_vertex;
+
+ }
+
+ /* To avoid an infinite loop. We check that the next_edge is not
+ already in the sub-face definition */
+
+ for (i1 = 0; i1 < _subface_edges->n_elts - 1; i1++) {
+
+ cs_int_t e1 = CS_ABS(_subface_edges->array[i1]);
+
+ for (i2 = i1 + 1; i2 < _subface_edges->n_elts; i2++) {
+
+ cs_int_t e2 = CS_ABS(_subface_edges->array[i2]);
+
+ if (e1 == e2) {
+
+ /* Returns pointers */
+
+ *head_edges = _head_edges;
+ *ext_edges = _ext_edges;
+ *int_edges = _int_edges;
+ *subface_edges = _subface_edges;
+
+ if (verbosity > 1)
+ bft_printf("\nWarning: global face %u traversed twice.\n",
+ work->face_gnum[face_id]);
+
+ return EDGE_TRAVERSED_TWICE_ERROR; /* Face building problem */
+
+ }
+
+ }
+
+ } /* End of loop on sub-face edges to check no-redundancy */
+
+ /* Clean _head_edges if next_edge belongs to this list */
+
+ for (j = 0; j < _head_edges->n_elts; j++)
+ if (CS_ABS(next_edge) == CS_ABS(_head_edges->array[j]))
+ break;
+
+ if (j != _head_edges->n_elts) {
+ _head_edges->n_elts -= 1;
+ for (k = j; k < _head_edges->n_elts; k++)
+ _head_edges->array[k] = _head_edges->array[k+1];
+ }
+
+ /* Update the couple (vid1, vid2) to continue the sub-face building */
+
+ vid1 = vid2;
+ vid2 = next_vertex - 1;
+
+ /* Test if next_edge is in _ext_edges */
+
+ for (i_ext = 0; i_ext < _ext_edges->n_elts; i_ext++)
+ if (CS_ABS(next_edge) == CS_ABS(_ext_edges->array[i_ext]))
+ break;
+
+ /* Test if next_edges is in the _int_edges list.
+ If not : store next_edge in the _int_edges list.
+ If yes : delete it.
+ */
+
+ if (i_ext != 0 && i_ext == _ext_edges->n_elts) {
+
+ for (i_int = 0; i_int < _int_edges->n_elts; i_int++)
+ if (CS_ABS(next_edge) == CS_ABS(_int_edges->array[i_int]))
+ break;
+
+ if (i_int == _int_edges->n_elts) { /* Add next_edge to the list */
+
+ cs_join_rset_resize(&_int_edges, _int_edges->n_elts);
+ _int_edges->array[_int_edges->n_elts++] = next_edge;
+
+ }
+ else { /* Delete next_edge of the list */
+
+ _int_edges->n_elts -= 1;
+
+ for (k = i_int; k < _int_edges->n_elts; k++)
+ _int_edges->array[k] = _int_edges->array[k+1];
+
+ }
+
+ } /* Next_edge is an interior edge */
+
+ } /* End of while vid2 != first_vid */
+
+ /* End of building the sub-face */
+
+ builder->subface_connect->n_elts = connect_shift;
+ connect_start = connect_shift;
+ _subface_edges->n_elts = 0;
+
+ subface_shift++;
+ builder->subface_index->n_elts = subface_shift;
+ cs_join_rset_resize(&(builder->subface_index), subface_shift);
+ builder->subface_index->array[subface_shift] = connect_start;
+
+ head_edge_shift++;
+ n_subfaces++;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (tst_dbg)
+ bft_printf(" END OF BUILDING subface %d\n\n", n_subfaces);
+#endif
+
+ if (n_subfaces > max_subfaces) { /* Too many sub-faces */
+
+ /* Set return pointers */
+
+ *head_edges = _head_edges;
+ *ext_edges = _ext_edges;
+ *int_edges = _int_edges;
+ *subface_edges = _subface_edges;
+
+ if (verbosity > 1)
+ bft_printf("\nWarning: loop limit exceeded for global face %u\n.",
+ work->face_gnum[face_id]);
+
+ return LOOP_LIMIT_ERROR;
+ }
+
+ } /* End of while head_shift < head_edge->n_elts */
+
+ /* Build a _head_edges set from _int_edges. We have to invert
+ edge direction to be consistent in the sub-face definition */
+
+ cs_join_rset_resize(&_head_edges, _int_edges->n_elts);
+ cs_join_rset_resize(&_ext_edges, _int_edges->n_elts);
+
+ _head_edges->n_elts = 0;
+ _ext_edges->n_elts = 0;
+
+ for (i_int = 0; i_int < _int_edges->n_elts; i_int++) {
+ _head_edges->array[_head_edges->n_elts++] = -_int_edges->array[i_int];
+ _ext_edges->array[_ext_edges->n_elts++] = -_int_edges->array[i_int];
+ }
+
+ } /* End of loop on head edges */
+
+ builder->face_index[block_id+1] = builder->face_index[block_id] + n_subfaces;
+
+ assert(builder->face_index[block_id+1] = subface_shift);
+
+ /* Returns pointers */
+
+ *head_edges = _head_edges;
+ *ext_edges = _ext_edges;
+ *int_edges = _int_edges;
+ *subface_edges = _subface_edges;
+
+ return NO_SPLIT_ERROR;
+}
+
+/*----------------------------------------------------------------------------
+ * Compare two elements in an indexed list and returns true if element in
+ * position i1 is strictly greater than element in position i2.
+ *
+ * parameters:
+ * i1 <-- position in index for the first element
+ * i2 <-- position in index for the second element
+ * index <-- number of values to compare for each entity
+ * number <-- pointer to numbers of entities that should be ordered.
+ * (if NULL, a default 1 to n numbering is considered)
+ *
+ * returns:
+ * true or false
+ *---------------------------------------------------------------------------*/
+
+inline static cs_bool_t
+_indexed_is_greater(size_t i1,
+ size_t i2,
+ const cs_int_t index[],
+ const fvm_gnum_t number[])
+{
+ int i;
+
+ cs_int_t i1_s = index[i1], i1_e = index[i1+1], s1 = i1_e - i1_s;
+ cs_int_t i2_s = index[i2], i2_e = index[i2+1], s2 = i2_e - i2_s;
+
+ if (s1 > s2) {
+
+ for (i = 0; i < s2; i++) {
+ if (number[i1_s + i] > number[i2_s + i])
+ return true;
+ else if (number[i1_s + i] < number[i2_s + i])
+ return false;
+ }
+
+ return true;
+ }
+ else { /* s1 <= s2 */
+
+ for (i = 0; i < s1; i++) {
+ if (number[i1_s + i] > number[i2_s + i])
+ return true;
+ else if (number[i1_s + i] < number[i2_s + i])
+ return false;
+ }
+
+ return false;
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Define a global numbering for the subfaces after splitting faces.
+ *
+ * parameters:
+ * builder <-> pointer to a face builder structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_subface_gnum(face_builder_t *builder)
+{
+ cs_int_t i, j, k, shift;
+ fvm_gnum_t min_val;
+
+ cs_int_t max_size = 0;
+ cs_int_t n_subfaces = builder->face_index[builder->n_faces];
+ cs_int_t *index = builder->subface_index->array;
+ fvm_gnum_t *gconnect = builder->subface_gconnect;
+ fvm_gnum_t *glob_list = NULL, *tmp = NULL;
+ fvm_io_num_t *subface_io_num = NULL;
+
+ const fvm_gnum_t *global_num = NULL;
+
+ assert(index != NULL);
+ assert(gconnect != NULL);
+
+ /* Allocate the buffer we want to define */
+
+ BFT_MALLOC(builder->subface_gnum, n_subfaces, fvm_gnum_t);
+
+ /* Re-arrange gconnect in order to have for each subface:
+ - vertex with the minimal glob. num. in first place,
+ - vertex with the minimal glob. num. between the two possible one
+ in second place
+ */
+
+ for (i = 0; i < n_subfaces; i++)
+ max_size = FVM_MAX(max_size, index[i+1] - index[i]);
+
+ BFT_MALLOC(tmp, max_size, fvm_gnum_t);
+ BFT_MALLOC(glob_list, index[n_subfaces], fvm_gnum_t);
+
+ /* Build glob_list */
+
+ for (i = 0; i < n_subfaces; i++) {
+
+ cs_int_t start = index[i], end = index[i+1];
+ cs_int_t n_elts = end - start;
+
+ assert(n_elts > 1);
+
+ for (j = start; j < end; j++)
+ glob_list[j] = gconnect[j];
+
+ min_val = glob_list[start];
+ k = 0;
+
+ for (j = start + 1; j < end; j++) {
+ if (glob_list[j] < min_val) {
+ min_val = glob_list[j];
+ k = j - start;
+ }
+ }
+
+ k = (n_elts - k) % n_elts; /* Define the permutation factor */
+
+ /* Permutation in order to the kth element in first position */
+
+ for (j = 0; j < n_elts; j++) {
+ shift = (j + k) % n_elts;
+ tmp[shift] = glob_list[start + j];
+ }
+
+ assert(tmp[0] == min_val);
+ glob_list[start] = tmp[0];
+
+ if (tmp[1] > tmp[n_elts-1]) { /* Inverse order */
+ for (j = 1; j < n_elts; j++)
+ glob_list[start + j] = tmp[n_elts - j];
+ }
+ else { /* Keep the current order */
+ for (j = 1; j < n_elts; j++)
+ glob_list[start + j] = tmp[j];
+ }
+
+ } /* End of loop on subfaces */
+
+ /* Copy glob_list as the new subface global connectivity */
+
+ for (i = 0; i < index[n_subfaces]; i++)
+ gconnect[i] = glob_list[i];
+
+ if (cs_glob_n_ranks > 1) { /* Parallel treatment */
+
+ /* Local ordering */
+
+ cs_int_t *order_index = NULL;
+ fvm_gnum_t *order_glob_list = NULL;
+ fvm_lnum_t *order = fvm_order_local_i(NULL,
+ glob_list,
+ index,
+ n_subfaces);
+
+ _renumber_local_ordered_i(n_subfaces,
+ order,
+ index,
+ glob_list,
+ &order_index,
+ &order_glob_list);
+
+ subface_io_num = fvm_io_num_create_from_adj_i(NULL,
+ order_index,
+ order_glob_list,
+ n_subfaces);
+
+ assert(subface_io_num != NULL);
+ assert(n_subfaces == fvm_io_num_get_local_count(subface_io_num));
+
+ global_num = fvm_io_num_get_global_num(subface_io_num);
+
+ for (i = 0; i < n_subfaces; i++)
+ builder->subface_gnum[order[i]] = global_num[i];
+
+ builder->n_g_subfaces = fvm_io_num_get_global_count(subface_io_num);
+
+ BFT_FREE(order);
+ BFT_FREE(order_index);
+ BFT_FREE(order_glob_list);
+
+ subface_io_num = fvm_io_num_destroy(subface_io_num);
+
+ }
+ else { /* Serial treatment */
+
+ fvm_gnum_t gnum = 1;
+ fvm_lnum_t *order = fvm_order_local_i(NULL,
+ glob_list,
+ index,
+ n_subfaces);
+
+ builder->subface_gnum[order[0]] = gnum;
+
+ for (i = 1; i < n_subfaces; i++) {
+ if (_indexed_is_greater(order[i], order[i-1], index, glob_list)) gnum++;
+ builder->subface_gnum[order[i]] = gnum;
+ }
+ builder->n_g_subfaces = gnum;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ for (i = 0; i < n_subfaces; i++) {
+
+ cs_int_t start = index[i], end = index[i+1];
+ cs_int_t n_elts = end - start;
+
+ bft_printf(" subface %5d - gnum: %u - connect_size: %d - ",
+ i+1, builder->subface_gnum[i], n_elts);
+ for (j = start; j < end; j++)
+ bft_printf(" %u ", glob_list[j]);
+ bft_printf("\n");
+
+ }
+ bft_printf_flush();
+#endif
+
+ BFT_FREE(order);
+
+ }
+
+ bft_printf(_("\n Global number of faces after splitting: %10u\n"),
+ builder->n_g_subfaces);
+ bft_printf_flush();
+
+ /* Free memory */
+
+ BFT_FREE(tmp);
+ BFT_FREE(glob_list);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update a cs_join_mesh_t structure thanks to a face_builder_t structure.
+ *
+ * parameters:
+ * block_info <-- set of paramaters defining a contiguous distribution
+ * builder <-- pointer to the distributed face builder structure
+ * mesh <-> pointer to the local cs_join_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_mesh_after_split(cs_join_block_info_t block_info,
+ face_builder_t *builder,
+ cs_join_mesh_t **mesh)
+{
+ cs_int_t i, j, k, id, shift, n_subfaces, o_id;
+ fvm_gnum_t prev, cur;
+
+ cs_int_t n_new_faces = 0;
+ char *new_mesh_name = NULL;
+ cs_int_t *subfaces = NULL;
+ fvm_lnum_t *order = NULL;
+ cs_join_mesh_t *init_mesh = *mesh;
+ cs_join_mesh_t *new_mesh = NULL;
+
+ /* Sanity checks */
+
+ assert(init_mesh != NULL);
+
+ /* Create a new cs_join_mesh_t structure */
+
+ BFT_MALLOC(new_mesh_name, strlen("AfterSplitting_n") + 5 + 1, char);
+ sprintf(new_mesh_name,"%s%05d", "AfterSplitting_n",
+ CS_MAX(cs_glob_rank_id, 0));
+
+ new_mesh = cs_join_mesh_create(new_mesh_name);
+
+ BFT_FREE(new_mesh_name);
+
+ if (builder == NULL) { /* No face to treat for the current rank */
+
+ assert(block_info.local_size == 0);
+
+ cs_join_mesh_destroy(&init_mesh);
+
+ /* Return pointers */
+
+ *mesh = new_mesh;
+
+ return;
+ }
+
+ assert((int)block_info.local_size == builder->n_faces);
+
+ /* Compute the number of new faces */
+
+ n_subfaces = builder->face_index[builder->n_faces];
+
+ BFT_MALLOC(order, n_subfaces, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL, builder->subface_gnum, order, n_subfaces);
+
+ prev = 0;
+ n_new_faces = 0;
+
+ for (i = 0; i < n_subfaces; i++) {
+
+ cur = builder->subface_gnum[order[i]];
+ if (prev != cur) {
+ prev = cur;
+ n_new_faces++;
+ }
+
+ } /* End of loop on subfaces */
+
+ /* Build new cell_gnum array */
+
+ BFT_MALLOC(subfaces, n_new_faces, cs_int_t);
+
+ prev = 0;
+ n_new_faces = 0;
+
+ for (i = 0; i < n_subfaces; i++) {
+
+ o_id = order[i];
+ cur = builder->subface_gnum[o_id];
+
+ if (prev != cur) {
+ prev = cur;
+ subfaces[n_new_faces] = o_id;
+ n_new_faces++;
+ }
+
+ }
+
+ /* Define the new face connectivities */
+
+ new_mesh->n_faces = n_new_faces;
+ new_mesh->n_g_faces = builder->n_g_subfaces;
+
+ BFT_MALLOC(new_mesh->face_gnum, n_new_faces, fvm_gnum_t);
+ BFT_MALLOC(new_mesh->face_vtx_idx, n_new_faces + 1, cs_int_t);
+
+ for (i = 0; i < n_new_faces; i++) {
+
+ id = subfaces[i];
+ new_mesh->face_gnum[i] = builder->subface_gnum[id];
+ new_mesh->face_vtx_idx[i+1] = builder->subface_index->array[id+1]
+ - builder->subface_index->array[id];
+
+ } /* End of loop on new faces */
+
+ new_mesh->face_vtx_idx[0] = 1;
+ for (i = 0; i < n_new_faces; i++)
+ new_mesh->face_vtx_idx[i+1] += new_mesh->face_vtx_idx[i];
+
+ BFT_MALLOC(new_mesh->face_vtx_lst,
+ new_mesh->face_vtx_idx[n_new_faces]-1,
+ cs_int_t);
+
+ for (i = 0; i < n_new_faces; i++) {
+
+ id = subfaces[i];
+ shift = new_mesh->face_vtx_idx[i] - 1;
+
+ for (j = builder->subface_index->array[id], k = 0;
+ j < builder->subface_index->array[id+1]; j++, k++)
+ new_mesh->face_vtx_lst[shift + k] = builder->subface_connect->array[j];
+
+ } /* End of loop on new faces */
+
+ /* Copy vertex data */
+
+ new_mesh->n_g_vertices = init_mesh->n_g_vertices;
+ new_mesh->n_vertices = init_mesh->n_vertices;
+
+ BFT_MALLOC(new_mesh->vertices, new_mesh->n_vertices, cs_join_vertex_t);
+
+ for (i = 0; i < init_mesh->n_vertices; i++)
+ new_mesh->vertices[i] = init_mesh->vertices[i];
+
+ cs_join_mesh_vertex_clean(new_mesh);
+
+ /* Free memory */
+
+ BFT_FREE(subfaces);
+ BFT_FREE(order);
+
+ cs_join_mesh_destroy(&init_mesh);
+
+ /* Set return pointer */
+
+ *mesh = new_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * For each new sub-face we keep a relation between new and old
+ * face global number.
+ *
+ * parameters:
+ * mesh <-- mesh on sub-faces after splitting
+ * block_info <-- set of paramaters defining a contiguous distribution
+ * builder <-- pointer to the distributed face builder structure
+ *
+ * returns:
+ * a pointer to a cs_join_gset_t structure saving relation between new
+ * and old faces
+ *---------------------------------------------------------------------------*/
+
+static cs_join_gset_t *
+_keep_history(cs_join_mesh_t *mesh,
+ cs_join_block_info_t block_info,
+ face_builder_t *builder)
+{
+ cs_int_t i, j;
+
+ cs_join_gset_t *o2n_hist = NULL;
+
+ assert(mesh != NULL);
+
+ /* Create structure in which we keep the history of each new face */
+
+ o2n_hist = cs_join_gset_create(block_info.local_size);
+
+ if (block_info.local_size > 0) {
+
+ assert(builder != NULL);
+ assert(builder->n_faces == (cs_int_t)block_info.local_size);
+
+ /* Historic is a part of the data held in builder structure */
+
+ for (i = 0; i < (cs_int_t)block_info.local_size; i++)
+ /* store old glob. face num. */
+ o2n_hist->g_elts[i] = block_info.first_gnum + i;
+
+ for (i = 0; i < builder->n_faces + 1; i++)
+ o2n_hist->index[i] = builder->face_index[i];
+
+ BFT_MALLOC(o2n_hist->g_list,
+ o2n_hist->index[o2n_hist->n_elts],
+ fvm_gnum_t);
+
+ for (i = 0; i < builder->n_faces; i++) {
+ for (j = builder->face_index[i]; j < builder->face_index[i+1]; j++) {
+
+ cs_int_t id = cs_search_g_binary(mesh->n_faces,
+ builder->subface_gnum[j],
+ mesh->face_gnum);
+
+ assert(id != -1);
+ o2n_hist->g_list[j] = id + 1; /* store local face num. */
+
+ }
+ }
+
+ } /* block.local_size > 0 */
+
+ /* Free memory */
+
+ return o2n_hist;
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build new faces after the vertex fusion operation. Split initial faces into
+ * subfaces and keep the historic between initial/final faces.
+ *
+ * parameters:
+ * param <-- set of user-defined parameters
+ * face_normal <-- array of normal vector on each face
+ * edges <-- list of edges
+ * work <-> pointer to a cs_join_mesh_t structure
+ * old2new_history <-> relation between new faces and old one:
+ * old global face -> new local face
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_split_faces(cs_join_param_t param,
+ const cs_real_t face_normal[],
+ const cs_join_edges_t *edges,
+ cs_join_mesh_t **work,
+ cs_join_gset_t **old2new_history)
+{
+ cs_int_t i, j, face_s, subface_s, block_id;
+ cs_join_split_error_t code;
+ cs_join_block_info_t block_info;
+
+ cs_int_t _n_problems = 0, n_face_problems = 0, n_max_face_vertices = 0;
+ cs_int_t *edge_face_idx = NULL, *edge_face_lst = NULL;
+ cs_join_gset_t *_old2new_history = NULL;
+ cs_join_rset_t *open_cycle = NULL, *edge_traversed_twice = NULL;
+ cs_join_rset_t *loop_limit = NULL, *head_edges = NULL;
+ cs_join_rset_t *subface_edges = NULL, *ext_edges = NULL, *int_edges = NULL;
+ face_builder_t *loc_builder = NULL;
+ cs_join_mesh_t *_work = *work;
+
+ const double plane = cos(param.plane *acos(-1.0)/180.);
+
+ const cs_int_t n_init_faces = _work->n_faces;
+ const int n_ranks = cs_glob_n_ranks;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+
+ assert(_work != NULL);
+ assert(edges != NULL);
+
+ /* Use the cs_join_edges_t structure to build
+ the "edge -> face" connectivity */
+
+ cs_join_mesh_get_edge_face_adj(_work, edges, &edge_face_idx, &edge_face_lst);
+
+ /* Define buffers to manage errors */
+
+ open_cycle = cs_join_rset_create(2);
+ edge_traversed_twice = cs_join_rset_create(2);
+ loop_limit = cs_join_rset_create(2);
+
+ /* Define buffers and structures to build the new faces */
+
+ head_edges = cs_join_rset_create(5);
+ subface_edges = cs_join_rset_create(5);
+ ext_edges = cs_join_rset_create(5);
+ int_edges = cs_join_rset_create(5);
+
+ /* Compute block_size */
+
+ block_info = cs_join_get_block_info(_work->n_g_faces, n_ranks, local_rank);
+
+ loc_builder = _create_face_builder(block_info.local_size);
+
+ /*
+ We only have to treat faces for the current rank's block because the
+ initial face distribution assumes that the current rank can correctly
+ split only faces in its block.
+ Main loop on faces.
+ */
+
+ for (i = 0, block_id = 0; i < n_init_faces; i++) {
+
+ int block_rank = (_work->face_gnum[i] - 1)/block_info.size;
+
+ if (block_rank == local_rank) { /* This face is a "main" face for the
+ local rank */
+
+ cs_int_t n_face_vertices =
+ _work->face_vtx_idx[i+1] - _work->face_vtx_idx[i];
+
+ /* Manage list size */
+
+ if (n_face_vertices > n_max_face_vertices) {
+
+ n_max_face_vertices = n_face_vertices;
+ cs_join_rset_resize(&head_edges, n_face_vertices);
+ cs_join_rset_resize(&subface_edges, n_face_vertices);
+ cs_join_rset_resize(&ext_edges, n_face_vertices);
+ cs_join_rset_resize(&int_edges, n_face_vertices);
+
+ }
+
+ /* Fill head_edges and ext_edges */
+
+ _define_head_and_ext_edges(i, /* face_id */
+ _work,
+ edges,
+ head_edges,
+ ext_edges,
+ 0); /* No permutation */
+
+ /* Store initial loc_builder state in case of code > 0 */
+
+ face_s = loc_builder->face_index[block_id];
+ subface_s = loc_builder->subface_index->array[face_s];
+
+ /* Split the current face into subfaces */
+
+ code = _split_face(i, /* face_id */
+ block_id,
+ plane,
+ param.max_sub_faces,
+ param.verbosity,
+ face_normal,
+ _work,
+ edges,
+ edge_face_idx,
+ edge_face_lst,
+ loc_builder,
+ &head_edges,
+ &subface_edges,
+ &ext_edges,
+ &int_edges);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (param.verbosity > 1 && code != NO_SPLIT_ERROR) {
+ bft_printf(_(" Split face: %d with returned code: %d\n"), i+1, code);
+ _dump_face_builder(block_id, loc_builder);
+ }
+#endif
+
+ if (code > NO_SPLIT_ERROR) { /* Manage error */
+
+ _n_problems++;
+
+ /* We change the starting edge for traversing edges to build
+ the new face. This may be enough to solve the problem when
+ the face is warped. */
+
+ while (_n_problems < n_face_vertices && code > NO_SPLIT_ERROR) {
+
+ /* Fill head_edges and ext_edges */
+
+ _define_head_and_ext_edges(i, /* face_id */
+ _work,
+ edges,
+ head_edges,
+ ext_edges,
+ _n_problems); /* permutation */
+
+ /* Retrieve initial loc_builder state */
+
+ loc_builder->face_index[block_id] = face_s;
+ loc_builder->subface_index->array[face_s] = subface_s;
+ loc_builder->subface_connect->n_elts = subface_s;
+
+ /* Split the current face into subfaces */
+
+ code = _split_face(i, /* face_id */
+ block_id,
+ plane,
+ param.max_sub_faces,
+ param.verbosity,
+ face_normal,
+ _work,
+ edges,
+ edge_face_idx,
+ edge_face_lst,
+ loc_builder,
+ &head_edges,
+ &subface_edges,
+ &ext_edges,
+ &int_edges);
+
+ _n_problems++;
+
+ } /* End of while */
+
+ if (_n_problems >= n_face_vertices && code != NO_SPLIT_ERROR) {
+
+ n_face_problems++;
+
+ switch (code) {
+
+ case OPEN_CYCLE_ERROR:
+ cs_join_rset_resize(&open_cycle, open_cycle->n_elts);
+ open_cycle->array[open_cycle->n_elts] = i + 1;
+ open_cycle->n_elts += 1;
+ break;
+
+ case EDGE_TRAVERSED_TWICE_ERROR:
+ cs_join_rset_resize(&edge_traversed_twice,
+ edge_traversed_twice->n_elts);
+ edge_traversed_twice->array[edge_traversed_twice->n_elts] = i + 1;
+ edge_traversed_twice->n_elts += 1;
+ break;
+
+ case LOOP_LIMIT_ERROR:
+ cs_join_rset_resize(&loop_limit, loop_limit->n_elts);
+ loop_limit->array[loop_limit->n_elts] = i + 1;
+ loop_limit->n_elts += 1;
+ break;
+
+ case NO_SPLIT_ERROR: /* To avoid a warning */
+ assert(0);
+ break;
+
+ case MAX_SPLIT_ERROR: /* To avoid a warning */
+ assert(0);
+ break;
+
+ }
+
+ /* Keep the initial face connectivity */
+
+ loc_builder->face_index[block_id] = face_s;
+ loc_builder->face_index[block_id+1] = face_s + 1;
+
+ /* face -> subface connectivity index update */
+
+ cs_join_rset_resize(&(loc_builder->subface_index), face_s+1);
+
+ loc_builder->subface_index->n_elts = face_s + 1;
+ loc_builder->subface_index->array[face_s] = subface_s;
+ loc_builder->subface_index->array[face_s+1]
+ = subface_s + n_face_vertices;
+
+ /* face -> subface connectivity list update */
+
+ cs_join_rset_resize(&(loc_builder->subface_connect),
+ subface_s + n_face_vertices);
+
+ loc_builder->subface_connect->n_elts = subface_s + n_face_vertices;
+
+ for (j = 0; j < n_face_vertices; j++)
+ loc_builder->subface_connect->array[subface_s + j]
+ = _work->face_vtx_lst[j + _work->face_vtx_idx[i] - 1];
+
+ if (param.verbosity > 1) {
+ bft_printf("\n Keep initial connectivity for face %d (%u):\n",
+ i+1, _work->face_gnum[i]);
+ _dump_face_builder(block_id, loc_builder);
+ }
+
+ } /* End if n_current_face_problems >= n_face_vertices */
+
+ _n_problems = 0;
+
+ } /* End of error managing */
+
+ /* Ready to treat the next face in the block of the current rank */
+
+ block_id++;
+
+ } /* End if current face is in rank block */
+
+ } /* End of loop on faces */
+
+ /* Delete lists */
+
+ cs_join_rset_destroy(&head_edges);
+ cs_join_rset_destroy(&subface_edges);
+ cs_join_rset_destroy(&ext_edges);
+ cs_join_rset_destroy(&int_edges);
+
+ /* Display information in case of problem during the face splitting */
+
+ {
+ fvm_gnum_t g_in_buf[4], g_out_buf[4];
+
+ fvm_gnum_t n_g_face_problems = n_face_problems;
+ fvm_gnum_t n_g_open_cycles = open_cycle->n_elts;
+ fvm_gnum_t n_g_edges_twice = edge_traversed_twice->n_elts;
+ fvm_gnum_t n_g_loop_limit = loop_limit->n_elts;
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) {
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ g_in_buf[0] = n_g_face_problems;
+ g_in_buf[1] = n_g_open_cycles;
+ g_in_buf[2] = n_g_edges_twice;
+ g_in_buf[3] = n_g_loop_limit;
+
+ MPI_Allreduce(g_in_buf, g_out_buf, 4, FVM_MPI_GNUM, MPI_SUM, mpi_comm);
+
+ n_g_face_problems = g_out_buf[0];
+ n_g_open_cycles = g_out_buf[1];
+ n_g_edges_twice = g_out_buf[2];
+ n_g_loop_limit = g_out_buf[3];
+
+ }
+#endif
+
+ if (n_g_face_problems > 0) {
+
+ bft_printf
+ (_(" Warning: (%lu) problem(s) found during the face splitting\n"
+ " %12lu open cycles,\n"
+ " %12lu edges traversed twice,\n"
+ " %12lu faces split into more than "
+ "max_subfaces (= %d)\n\n"
+ " => Eventually modify joining parameters\n\n"),
+ (unsigned long)n_g_face_problems,
+ (unsigned long)n_g_open_cycles,
+ (unsigned long)n_g_edges_twice,
+ (unsigned long)n_g_loop_limit, param.max_sub_faces);
+ bft_printf_flush();
+
+ assert( n_g_face_problems
+ == n_g_open_cycles + n_g_edges_twice + n_g_loop_limit);
+
+ /* post-processing of encountered problems */
+
+ cs_join_post_init(); /* Init. post-processing anyway */
+
+ if (n_g_open_cycles > 0)
+ cs_join_post_faces_subset("OpenCycleErr",
+ _work,
+ open_cycle->n_elts,
+ open_cycle->array);
+
+ if (n_g_edges_twice > 0)
+ cs_join_post_faces_subset("EdgeScannedTwiceErr",
+ _work,
+ edge_traversed_twice->n_elts,
+ edge_traversed_twice->array);
+
+ if (n_g_loop_limit > 0)
+ cs_join_post_faces_subset("LoopLimitErr",
+ _work,
+ loop_limit->n_elts,
+ loop_limit->array);
+
+ } /* End of information display */
+
+ } /* Manage potential errors during face splitting */
+
+ /* Free vtx_struct structure */
+
+ BFT_FREE(edge_face_idx);
+ BFT_FREE(edge_face_lst);
+
+ /* Define a global number for each new sub-faces */
+
+ if (loc_builder != NULL) {
+
+ cs_int_t n_subfaces = loc_builder->face_index[loc_builder->n_faces];
+ cs_int_t sub_connect_size = loc_builder->subface_index->array[n_subfaces];
+
+ /* Define subface_gconnect */
+
+ BFT_MALLOC(loc_builder->subface_gconnect, sub_connect_size, fvm_gnum_t);
+
+ for (i = 0; i < sub_connect_size; i++) {
+
+ cs_int_t vid = loc_builder->subface_connect->array[i] - 1;
+ fvm_gnum_t vgnum = _work->vertices[vid].gnum;
+
+ loc_builder->subface_gconnect[i] = vgnum;
+
+ }
+
+ if (sub_connect_size > 0)
+ _get_subface_gnum(loc_builder);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\nFINAL BUILDER STATE\n");
+ for (i = 0; i < loc_builder->n_faces; i++)
+ _dump_face_builder(i, loc_builder);
+#endif
+
+ BFT_FREE(loc_builder->subface_gconnect);
+
+ }
+
+ /* Delete error management lists */
+
+ cs_join_rset_destroy(&open_cycle);
+ cs_join_rset_destroy(&edge_traversed_twice);
+ cs_join_rset_destroy(&loop_limit);
+
+ /* Update cs_join_mesh_t structure and keep a relation between
+ new and old faces.
+
+ Delete redundancies in the sub-face connectivity.
+ Some new interior faces can be defined twice. See the example below.
+
+ .-------------------------.
+ First | |
+ initial | |
+ face | .-------------------+--------.
+ | | | |
+ | | interior sub-face | |
+ | | defined twice | |
+ | | | |
+ `-----+-------------------' | Second
+ | | initial
+ | | face
+ `----------------------------'
+ */
+
+ /* Reduce the definition of the working mesh to the set of new
+ global face numbers built from the local block. */
+
+ _update_mesh_after_split(block_info, loc_builder, &_work);
+
+ /* For each new sub-face we maintain a relation between new and old
+ face global number */
+
+ _old2new_history = _keep_history(_work,
+ block_info,
+ loc_builder);
+
+ /* Free face_builder_t structure */
+
+ loc_builder = _destroy_face_builder(loc_builder);
+
+ /* Set return pointers */
+
+ *work = _work;
+ *old2new_history = _old2new_history;
+}
+
+/*----------------------------------------------------------------------------
+ * Update after face splitting of the local join mesh structure.
+ * Send back to the original rank the new face description.
+ *
+ * parameters:
+ * work_mesh <-- distributed mesh on faces to join
+ * gnum_rank_index <-- index on ranks for the old global face numbering
+ * o2n_hist <-> old global face -> new local face numbering
+ * local_mesh <-> mesh on local selected faces to be joined
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_split_update_struct(const cs_join_mesh_t *work_mesh,
+ const fvm_gnum_t gnum_rank_index[],
+ cs_join_gset_t **o2n_hist,
+ cs_join_mesh_t **local_mesh)
+{
+ cs_int_t i;
+
+ cs_join_gset_t *_o2n_hist = *o2n_hist;
+ cs_join_mesh_t *_local_mesh = *local_mesh;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* sanity checks */
+
+ assert(work_mesh != NULL);
+ assert(_local_mesh != NULL);
+ assert(_o2n_hist != NULL || (_o2n_hist == NULL && work_mesh->n_faces == 0));
+
+ if (n_ranks == 1)
+ cs_join_mesh_copy(&_local_mesh, work_mesh);
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) { /* Parallel mode */
+
+ cs_int_t j, subface_id;
+ cs_int_t *send_rank_index = NULL, *send_faces = NULL;
+ fvm_gnum_t *init_face_gnum = NULL;
+ cs_join_gset_t *distrib_sync_hist = NULL;
+ cs_int_t n_init_faces = _local_mesh->n_faces;
+ fvm_gnum_t n_g_init_faces = _local_mesh->n_g_faces;
+
+ MPI_Comm mpi_comm = fvm_parall_get_mpi_comm();
+
+ /* Save the initial global face numbering */
+
+ BFT_MALLOC(init_face_gnum, n_init_faces, fvm_gnum_t);
+
+ for (i = 0; i < n_init_faces; i++)
+ init_face_gnum[i] = _local_mesh->face_gnum[i];
+
+ /* Free some structures of the mesh */
+
+ cs_join_mesh_reset(_local_mesh);
+
+ _get_faces_to_send(_o2n_hist, /* Local subface num is stored up to now */
+ gnum_rank_index,
+ &send_rank_index,
+ &send_faces);
+
+ /* Get the new face connectivity from the distributed work_mesh */
+
+ cs_join_mesh_exchange(n_ranks,
+ send_rank_index,
+ send_faces,
+ work_mesh,
+ _local_mesh,
+ mpi_comm);
+
+ BFT_FREE(send_faces);
+ BFT_FREE(send_rank_index);
+
+ /* Order face by increasing global number */
+
+ cs_join_mesh_face_order(_local_mesh);
+
+ /* Move to a global numbering of the subfaces */
+
+ for (i = 0; i < _o2n_hist->n_elts; i++) {
+ for (j = _o2n_hist->index[i]; j < _o2n_hist->index[i+1]; j++) {
+ subface_id = _o2n_hist->g_list[j] - 1;
+ _o2n_hist->g_list[j] = work_mesh->face_gnum[subface_id];
+ }
+ }
+
+ /* Synchronize _o2n_hist */
+
+ distrib_sync_hist = cs_join_gset_sync_by_block(n_g_init_faces,
+ _o2n_hist,
+ mpi_comm);
+
+ cs_join_gset_destroy(&_o2n_hist);
+ _o2n_hist = cs_join_gset_create(n_init_faces);
+
+ for (i = 0; i < n_init_faces; i++)
+ _o2n_hist->g_elts[i] = init_face_gnum[i];
+
+ BFT_FREE(init_face_gnum);
+
+ cs_join_gset_update_from_block(n_g_init_faces,
+ distrib_sync_hist,
+ _o2n_hist,
+ mpi_comm);
+
+ cs_join_gset_destroy(&distrib_sync_hist);
+
+
+ }
+#endif /* HAVE_MPI */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ { /* Full dump of structures */
+
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_o2nFaceHist.dat")+1+4;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "JoinDBG_o2nFaceHist%04d.dat",
+ CS_MAX(cs_glob_rank_id, 0));
+ dbg_file = fopen(filename, "w");
+
+ cs_join_gset_dump(dbg_file, _o2n_hist);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+
+ }
+#endif
+
+ /* Set return pointers */
+
+ *o2n_hist = _o2n_hist;
+ *local_mesh = _local_mesh;
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
+
diff --git a/src/base/cs_join_update.c b/src/base/cs_join_update.c
new file mode 100644
index 0000000..7128b7d
--- /dev/null
+++ b/src/base/cs_join_update.c
@@ -0,0 +1,3863 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Management of conforming and non-conforming join
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+#include <float.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_io_num.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_search.h"
+#include "cs_sort.h"
+#include "cs_join_post.h"
+#include "cs_join_util.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_update.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Static global variables
+ *===========================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *===========================================================================*/
+
+/* Local structure to update the mesh connectivty after the merge step */
+
+typedef struct {
+
+ cs_int_t n_vertices; /* v2v_idx size - 1 */
+ cs_int_t n_edges; /* v2v_lst size */
+
+ cs_int_t *v2v_idx;
+ cs_int_t *v2v_lst;
+
+ cs_int_t *v2v_sub_idx;
+ cs_int_t *v2v_sub_lst; /* if -1: edge has been deleted */
+
+} edge_builder_t;
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute the cross product of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ * result --> cross product v1xv2
+ *
+ * returns:
+ * the resulting cross product (v1 x v2)
+ *----------------------------------------------------------------------------*/
+
+inline static void
+_cross_product(double v1[],
+ double v2[],
+ double result[])
+{
+ result[0] = v1[1] * v2[2] - v2[1] * v1[2];
+ result[1] = v2[0] * v1[2] - v1[0] * v2[2];
+ result[2] = v1[0] * v2[1] - v2[0] * v1[1];
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the dot product of two vectors.
+ *
+ * parameters:
+ * v1 <-- first vector
+ * v2 <-- second vector
+ *
+ * returns:
+ * the resulting dot product (v1.v2)
+ *----------------------------------------------------------------------------*/
+
+inline static double
+_dot_product(double v1[],
+ double v2[])
+{
+ int i;
+ double result = 0.0;
+
+ for (i = 0; i < 3; i++)
+ result += v1[i] * v2[i];
+
+ return result;
+}
+
+/*----------------------------------------------------------------------------
+ * Normalize a vector.
+ *
+ * parameters:
+ * v <-> vector to normalize
+ *----------------------------------------------------------------------------*/
+
+inline static void
+_normalize(double v[])
+{
+ int i;
+ double norm, inv_norm;
+
+ norm = sqrt(_dot_product(v, v));
+ inv_norm = 1/norm;
+
+ for (i = 0; i < 3; i++)
+ v[i] *= inv_norm;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the related edge id in edge_builder_t structure from a couple of
+ * vertex ids.
+ *
+ * parameters:
+ * v1_id <-- first vertex id
+ * v2_id <-- second vertex id
+ * edge_builder <-- pointer to an edge_builder_t structure
+ *
+ * returns:
+ * related edge_id in edge_builder_t structure
+ *---------------------------------------------------------------------------*/
+
+inline static cs_int_t
+_get_join_edge_id(cs_int_t v1_id,
+ cs_int_t v2_id,
+ const edge_builder_t *edge_builder)
+{
+ cs_int_t i, va, vb;
+ cs_int_t edge_id = -1;
+
+ if (v1_id < v2_id)
+ va = v1_id, vb = v2_id;
+ else
+ vb = v1_id, va = v2_id;
+
+ for (i = edge_builder->v2v_idx[va]; i < edge_builder->v2v_idx[va+1]; i++)
+ if (edge_builder->v2v_lst[i] == vb + 1)
+ break;
+
+ if (i != edge_builder->v2v_idx[va+1])
+ edge_id = i;
+
+ return edge_id;
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Retrieve the local new global numbering for the initial vertices from
+ * the new vertex global numbering defined by block.
+ *
+ * parameters:
+ * mesh <-- pointer of pointer to cs_mesh_t structure
+ * p_o2n_vtx_gnum <-> in : array on blocks on the new global vertex
+ * out: local array on the new global vertex
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_local_o2n_vtx_gnum(cs_mesh_t *mesh,
+ fvm_gnum_t *p_o2n_vtx_gnum[])
+{
+ cs_int_t i, shift, rank;
+ fvm_gnum_t new_gnum;
+
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ fvm_gnum_t *send_glist = NULL, *recv_glist = NULL;
+ fvm_gnum_t *block_gnum = *p_o2n_vtx_gnum;
+ fvm_gnum_t *local_gnum = NULL;
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const cs_join_block_info_t block_info
+ = cs_join_get_block_info(mesh->n_g_vertices,
+ n_ranks,
+ local_rank);
+
+ BFT_MALLOC(local_gnum, mesh->n_vertices, fvm_gnum_t);
+
+ /* Request the new vtx gnum related to the initial vtx gnum */
+
+ BFT_MALLOC(send_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_count, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+ rank = (mesh->global_vtx_num[i] - 1)/block_info.size;
+ send_count[rank] += 1;
+ }
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ BFT_MALLOC(send_shift, n_ranks + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_ranks + 1, cs_int_t);
+
+ send_shift[0] = 0;
+ recv_shift[0] = 0;
+
+ for (rank = 0; rank < n_ranks; rank++) {
+ send_shift[rank + 1] = send_shift[rank] + send_count[rank];
+ recv_shift[rank + 1] = recv_shift[rank] + recv_count[rank];
+ }
+
+ /* Build send_list */
+
+ BFT_MALLOC(send_glist, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(recv_glist, recv_shift[n_ranks], fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+
+ rank = (mesh->global_vtx_num[i] - 1)/block_info.size;
+ shift = send_shift[rank] + send_count[rank];
+ send_glist[shift] = mesh->global_vtx_num[i]; /* Old global number */
+ send_count[rank] += 1;
+
+ }
+
+ MPI_Alltoallv(send_glist, send_count, send_shift, FVM_MPI_GNUM,
+ recv_glist, recv_count, recv_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ /* Send back to the original rank the new global vertex number */
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = recv_shift[rank]; i < recv_shift[rank+1]; i++) {
+
+ shift = recv_glist[i] - block_info.first_gnum;
+ new_gnum = block_gnum[shift];
+ recv_glist[i] = new_gnum;
+
+ }
+
+ } /* End of loop on ranks */
+
+ MPI_Alltoallv(recv_glist, recv_count, recv_shift, FVM_MPI_GNUM,
+ send_glist, send_count, send_shift, FVM_MPI_GNUM,
+ mpi_comm);
+
+ for (i = 0; i < n_ranks; i++)
+ send_count[i] = 0;
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+
+ rank = (mesh->global_vtx_num[i] - 1)/block_info.size;
+ shift = send_shift[rank] + send_count[rank];
+ local_gnum[i] = send_glist[shift]; /* New global number */
+ send_count[rank] += 1;
+
+ }
+
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(send_glist);
+ BFT_FREE(recv_glist);
+ BFT_FREE(recv_count);
+ BFT_FREE(recv_shift);
+ BFT_FREE(block_gnum);
+
+ /* Return pointer */
+
+ *p_o2n_vtx_gnum = local_gnum;
+}
+
+/*----------------------------------------------------------------------------
+ * Update elements of a cs_mesh_t structure related to the vertices after the
+ * fusion step.
+ *
+ * parameters:
+ * selection --> list of all implied entities in the joining op.
+ * o2n_vtx_id <-> relation between init. and current local num.
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_sync_single_vertices(const cs_join_select_t *selection,
+ cs_int_t o2n_vtx_id[],
+ cs_mesh_t *mesh)
+{
+ cs_int_t i, s, e, rank, shift, length, request_count;
+
+ cs_int_t *selection_tag = NULL;
+ double *s_buf = NULL, *c_buf = NULL;
+ cs_join_sync_t *s_vertices = selection->s_vertices;
+ cs_join_sync_t *c_vertices = selection->c_vertices;
+ MPI_Request *request = NULL;
+ MPI_Status *status = NULL;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int loc_rank = CS_MAX(cs_glob_rank_id, 0);
+
+ bft_printf("\n Synchronization of the \"single\" elements after the fusion"
+ " step.\n");
+ bft_printf_flush();
+
+ assert(n_ranks > 1);
+
+ /* Allocate MPI buffers used for exchanging data */
+
+ BFT_MALLOC(request, c_vertices->n_ranks + s_vertices->n_ranks, MPI_Request);
+ BFT_MALLOC(status, c_vertices->n_ranks + s_vertices->n_ranks, MPI_Status);
+ BFT_MALLOC(selection_tag, mesh->n_vertices, cs_int_t);
+
+ /* Define a selection tag to find quickly "single" vertices */
+
+ for (i = 0; i < mesh->n_vertices; i++)
+ selection_tag[i] = 0;
+
+ for (i = 0; i < s_vertices->n_elts; i++)
+ selection_tag[s_vertices->array[i]-1] = 1;
+
+ /* Synchronization of vertex coordinates */
+
+ BFT_MALLOC(s_buf, 3*s_vertices->n_elts, double);
+
+ /* Receive data from distant ranks */
+
+ request_count = 0;
+
+ for (i = 0; i < s_vertices->n_ranks; i++) {
+
+ rank = s_vertices->ranks[i];
+ s = s_vertices->index[i];
+ e = s_vertices->index[i+1];
+ length = 3*(e-s);
+
+ MPI_Irecv(&(s_buf[3*s]),
+ length,
+ MPI_DOUBLE,
+ rank,
+ rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(mpi_comm);
+
+ /* Build c_buf = buffer to send */
+
+ BFT_MALLOC(c_buf, 3*c_vertices->n_elts, double);
+
+ for (shift = 0, i = 0; i < c_vertices->n_elts; i++) {
+
+ int new_id = o2n_vtx_id[c_vertices->array[i]-1];
+
+ c_buf[shift++] = mesh->vtx_coord[3*new_id];
+ c_buf[shift++] = mesh->vtx_coord[3*new_id+1];
+ c_buf[shift++] = mesh->vtx_coord[3*new_id+2];
+
+ }
+
+ /* Send data to distant ranks */
+
+ for (i = 0; i < c_vertices->n_ranks; i++) {
+
+ rank = c_vertices->ranks[i];
+ s = c_vertices->index[i];
+ e = c_vertices->index[i+1];
+ length = 3*(e-s);
+
+ MPI_Isend(&(c_buf[3*s]),
+ length,
+ MPI_DOUBLE,
+ rank,
+ loc_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, request, status);
+
+ /* Update vertex coordinates */
+
+ for (shift = 0, i = 0; i < s_vertices->n_elts; i++) {
+
+ int new_id = o2n_vtx_id[s_vertices->array[i]-1];
+
+ mesh->vtx_coord[3*new_id] = s_buf[shift++];
+ mesh->vtx_coord[3*new_id+1] = s_buf[shift++];
+ mesh->vtx_coord[3*new_id+2] = s_buf[shift++];
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(c_buf);
+ BFT_FREE(s_buf);
+ BFT_FREE(request);
+ BFT_FREE(status);
+ BFT_FREE(selection_tag);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update cs_join_edges_t through the synchronization of "single" edges.
+ *
+ * parameters:
+ * selection --> list of all implied entities in the joining op.
+ * n_bm_vertices --> number of vertices in mesh before the merge step
+ * o2n_vtx_id <-> relation between init. and current local num.
+ * n_j_vertices --> number of vertices in join_mesh
+ * join2mesh_vtx_id <-> relation between join mesh and after fusion vertex
+ * join_edges <-> pointer to a cs_join_edges_t structure
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_sync_single_edges(const cs_join_select_t *selection,
+ cs_int_t n_bm_vertices,
+ cs_int_t o2n_vtx_id[],
+ cs_int_t n_j_vertices,
+ cs_int_t join2mesh_vtx_id[],
+ edge_builder_t *edge_builder,
+ cs_mesh_t *mesh)
+{
+ int i, j, k, id, vid, rank, shift, edge_id, vid1, vid2;
+ int length, request_count, distant_rank;
+ fvm_gnum_t cur, prev;
+
+ int c_sub_size = 0, s_sub_size = 0, n_new_vertices = 0;
+ cs_int_t *new_v2v_sub_idx = NULL, *new_v2v_sub_lst = NULL;
+ int *s_count = NULL, *s_sub_index = NULL;
+ int *c_count = NULL, *c_sub_index = NULL;
+ fvm_gnum_t *c_sub_gbuf = NULL, *s_sub_gbuf = NULL;
+ fvm_gnum_t *new_vtx_gnum = NULL;
+ cs_real_t *c_sub_coord = NULL, *s_sub_coord = NULL, *new_coord = NULL;
+
+ MPI_Request *request = NULL;
+ MPI_Status *status = NULL;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int loc_rank = CS_MAX(cs_glob_rank_id, 0);
+ const cs_join_sync_t *s_edges = selection->s_edges;
+ const cs_join_sync_t *c_edges = selection->c_edges;
+
+ assert(n_ranks > 1);
+
+ /* Allocate MPI buffers used for exchanging data */
+
+ BFT_MALLOC(request, c_edges->n_ranks + s_edges->n_ranks, MPI_Request);
+ BFT_MALLOC(status, c_edges->n_ranks + s_edges->n_ranks, MPI_Status);
+
+ /* Get a number of sub-element for each received edge */
+
+ BFT_MALLOC(s_count, s_edges->n_elts, int);
+ BFT_MALLOC(c_count, c_edges->n_elts, int);
+
+ for (i = 0; i < s_edges->n_elts; i++)
+ s_count[i] = 0;
+ for (i = 0; i < c_edges->n_elts; i++)
+ c_count[i] = 0;
+
+ for (i = 0; i < c_edges->n_elts; i++) {
+
+ vid1 = c_edges->array[2*i] - 1;
+ vid2 = c_edges->array[2*i+1] - 1;
+ edge_id = _get_join_edge_id(vid1, vid2, edge_builder);
+
+ assert(edge_id != -1);
+
+ c_count[i] = edge_builder->v2v_sub_idx[edge_id+1]
+ - edge_builder->v2v_sub_idx[edge_id];
+
+ } /* End of loop on c_edges */
+
+ /* Exchange number of sub elements for each edge */
+
+ request_count = 0;
+
+ for (i = 0; i < s_edges->n_ranks; i++) {
+
+ int *recv_buf;
+
+ distant_rank = s_edges->ranks[i];
+ length = s_edges->index[i+1] - s_edges->index[i];
+ recv_buf = s_count + s_edges->index[i];
+
+ MPI_Irecv(recv_buf,
+ length,
+ MPI_INT,
+ distant_rank,
+ distant_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(mpi_comm);
+
+ /* Send data to distant ranks */
+
+ for (i = 0; i < c_edges->n_ranks; i++) {
+
+ int *send_buf;
+
+ distant_rank = c_edges->ranks[i];
+ length = c_edges->index[i+1] - c_edges->index[i];
+ send_buf = c_count + c_edges->index[i];
+
+ MPI_Isend(send_buf,
+ length,
+ MPI_INT,
+ distant_rank,
+ loc_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, request, status);
+
+ /* Define buffer to send whith sub-elements from "coupled" edges to
+ "single" edges */
+
+ BFT_MALLOC(c_sub_index, c_edges->n_ranks + 1, int);
+
+ c_sub_index[0] = 0;
+ for (i = 0; i < c_edges->n_ranks; i++) {
+ c_sub_index[i+1] = 0;
+ for (j = c_edges->index[i]; j < c_edges->index[i+1]; j++)
+ c_sub_index[i+1] += c_count[j];
+ }
+
+ for (i = 0; i < c_edges->n_ranks; i++)
+ c_sub_index[i+1] += c_sub_index[i];
+
+ c_sub_size = c_sub_index[c_edges->n_ranks];
+
+ BFT_MALLOC(c_sub_gbuf, c_sub_size, fvm_gnum_t);
+ BFT_MALLOC(c_sub_coord, 3*c_sub_size, cs_real_t);
+
+ shift = 0;
+ for (rank = 0; rank < c_edges->n_ranks; rank++) {
+
+ for (i = c_edges->index[rank]; i < c_edges->index[rank+1]; i++) {
+
+ vid1 = c_edges->array[2*i] - 1;
+ vid2 = c_edges->array[2*i+1] - 1;
+ edge_id = _get_join_edge_id(vid1, vid2, edge_builder);
+
+ for (j = edge_builder->v2v_sub_idx[edge_id];
+ j < edge_builder->v2v_sub_idx[edge_id+1]; j++) {
+
+ vid = edge_builder->v2v_sub_lst[j] - 1;
+
+ c_sub_gbuf[shift] = mesh->global_vtx_num[vid];
+ for (k = 0; k < 3; k++)
+ c_sub_coord[3*shift+k] = mesh->vtx_coord[3*vid+k];
+
+ shift++;
+
+ }
+
+ } /* End of loop on edges received from rank */
+
+ } /* End of loop on ranks */
+
+ BFT_MALLOC(s_sub_index, s_edges->n_ranks + 1, int);
+
+ s_sub_index[0] = 0;
+ for (i = 0; i < s_edges->n_ranks; i++) {
+ s_sub_index[i+1] = 0;
+ for (j = s_edges->index[i]; j < s_edges->index[i+1]; j++)
+ s_sub_index[i+1] += s_count[j];
+ }
+
+ for (i = 0; i < s_edges->n_ranks; i++)
+ s_sub_index[i+1] += s_sub_index[i];
+
+ s_sub_size = s_sub_index[s_edges->n_ranks];
+
+ BFT_MALLOC(s_sub_gbuf, s_sub_size, fvm_gnum_t);
+ BFT_MALLOC(s_sub_coord, 3*s_sub_size, cs_real_t);
+
+ /* Exchange sub-edge definition: global vertex number */
+
+ request_count = 0;
+
+ for (i = 0; i < s_edges->n_ranks; i++) {
+
+ fvm_gnum_t *recv_gbuf;
+
+ distant_rank = s_edges->ranks[i];
+ length = s_sub_index[i+1] - s_sub_index[i];
+ recv_gbuf = s_sub_gbuf + s_sub_index[i];
+
+ MPI_Irecv(recv_gbuf,
+ length,
+ FVM_MPI_GNUM,
+ distant_rank,
+ distant_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(mpi_comm);
+
+ /* Send data to distant ranks */
+
+ for (i = 0; i < c_edges->n_ranks; i++) {
+
+ fvm_gnum_t *send_gbuf;
+
+ distant_rank = c_edges->ranks[i];
+ length = c_sub_index[i+1] - c_sub_index[i];
+ send_gbuf = c_sub_gbuf + c_sub_index[i];
+
+ MPI_Isend(send_gbuf,
+ length,
+ FVM_MPI_GNUM,
+ distant_rank,
+ loc_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, request, status);
+
+ /* Exchange sub-edge definition: vertex coordinates */
+
+ request_count = 0;
+
+ for (i = 0; i < s_edges->n_ranks; i++) {
+
+ cs_real_t *recv_dbuf;
+
+ distant_rank = s_edges->ranks[i];
+ length = 3*(s_sub_index[i+1] - s_sub_index[i]);
+ recv_dbuf = s_sub_coord + 3*s_sub_index[i];
+
+ MPI_Irecv(recv_dbuf,
+ length,
+ CS_MPI_REAL,
+ distant_rank,
+ distant_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* We wait for posting all receives (often recommended) */
+
+ MPI_Barrier(mpi_comm);
+
+ /* Send data to distant ranks */
+
+ for (i = 0; i < c_edges->n_ranks; i++) {
+
+ cs_real_t *send_dbuf;
+
+ distant_rank = c_edges->ranks[i];
+ length = 3*(c_sub_index[i+1] - c_sub_index[i]);
+ send_dbuf = c_sub_coord + 3*c_sub_index[i];
+
+ MPI_Isend(send_dbuf,
+ length,
+ CS_MPI_REAL,
+ distant_rank,
+ loc_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* Wait for all exchanges */
+
+ MPI_Waitall(request_count, request, status);
+
+ /* Free memory */
+
+ BFT_FREE(c_count);
+ BFT_FREE(c_sub_index);
+ BFT_FREE(c_sub_gbuf);
+ BFT_FREE(c_sub_coord);
+ BFT_FREE(s_sub_index);
+ BFT_FREE(request);
+ BFT_FREE(status);
+
+ if (s_edges->n_elts > 0) {
+
+ fvm_lnum_t *order = NULL, *inv_order = NULL;
+
+ /* Update vertices from list of sub elements. Define new vertices */
+
+ BFT_MALLOC(order, s_sub_size, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL, s_sub_gbuf, order, s_sub_size);
+
+ prev = 0;
+ n_new_vertices = 0;
+
+ for (i = 0; i < s_sub_size; i++) {
+
+ cur = s_sub_gbuf[order[i]];
+ if (cur != prev) {
+ prev = cur;
+ id = cs_search_g_binary(mesh->n_vertices,
+ cur,
+ mesh->global_vtx_num);
+ if (id == -1) /* Add vertex */
+ n_new_vertices++;
+ }
+
+ } /* End of loop on received sub-elements */
+
+ BFT_REALLOC(mesh->global_vtx_num,
+ mesh->n_vertices + n_new_vertices, fvm_gnum_t);
+
+ BFT_REALLOC(mesh->vtx_coord,
+ 3*(mesh->n_vertices + n_new_vertices), cs_real_t);
+
+ prev = 0;
+ n_new_vertices = 0;
+
+ for (i = 0; i < s_sub_size; i++) {
+
+ cur = s_sub_gbuf[order[i]];
+ if (cur != prev) {
+ prev = cur;
+ id = cs_search_g_binary(mesh->n_vertices,
+ cur,
+ mesh->global_vtx_num);
+
+ if (id == -1) { /* Add vertex */
+
+ shift = mesh->n_vertices + n_new_vertices;
+ mesh->global_vtx_num[shift] = cur;
+ for (k = 0; k < 3; k++)
+ mesh->vtx_coord[3*shift+k] = s_sub_coord[3*order[i]+k];
+ n_new_vertices++;
+
+ }
+
+ }
+
+ } /* End of loop on received sub-elements */
+
+ mesh->n_vertices += n_new_vertices;
+ bft_printf(_(" Add %d new vertices from the single elements sync.\n"),
+ n_new_vertices);
+
+ /* Reorder global_vtx_num in order to have an ordered list */
+
+ BFT_REALLOC(order, mesh->n_vertices, fvm_lnum_t);
+
+ fvm_order_local_allocated(NULL,
+ mesh->global_vtx_num,
+ order,
+ mesh->n_vertices);
+
+ BFT_MALLOC(new_vtx_gnum, mesh->n_vertices, fvm_gnum_t);
+
+ for (i = 0; i < mesh->n_vertices; i++)
+ new_vtx_gnum[i] = mesh->global_vtx_num[order[i]];
+
+ BFT_FREE(mesh->global_vtx_num);
+ mesh->global_vtx_num = new_vtx_gnum;
+
+ /* Define a new mesh->vtx_coord */
+
+ BFT_MALLOC(new_coord, 3*mesh->n_vertices, cs_real_t);
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+ vid = order[i];
+ for (k = 0; k < 3; k++)
+ new_coord[3*i+k] = mesh->vtx_coord[3*vid+k];
+ }
+
+ BFT_FREE(mesh->vtx_coord);
+ mesh->vtx_coord = new_coord;
+
+ /* Define a new o2n_vtx_id and o2n_vtx_gnum */
+
+ BFT_MALLOC(inv_order, mesh->n_vertices, fvm_lnum_t);
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+ j = order[i];
+ inv_order[j] = i;
+ }
+
+ for (i = 0; i < n_bm_vertices; i++) {
+ vid = o2n_vtx_id[i];
+ o2n_vtx_id[i] = inv_order[vid];
+ }
+
+ /* Define a new join2mesh_vtx_id */
+
+ for (i = 0; i < n_j_vertices; i++) {
+ vid = join2mesh_vtx_id[i];
+ join2mesh_vtx_id[i] = inv_order[vid];
+ }
+
+ /* Update edge_builder_t structure (v2v_sub_idx and v2v_sub_lst) */
+
+ BFT_MALLOC(new_v2v_sub_idx, edge_builder->n_edges + 1, cs_int_t);
+
+ for (i = 0; i < edge_builder->n_edges; i++)
+ new_v2v_sub_idx[i+1] = edge_builder->v2v_sub_idx[i+1]
+ - edge_builder->v2v_sub_idx[i];
+
+ for (i = 0; i < s_edges->n_elts; i++) {
+
+ vid1 = s_edges->array[2*i] - 1;
+ vid2 = s_edges->array[2*i+1] - 1;
+ edge_id = _get_join_edge_id(vid1, vid2, edge_builder);
+ assert(edge_id != -1);
+ new_v2v_sub_idx[edge_id+1] = s_count[i];
+
+ }
+
+ new_v2v_sub_idx[0] = 0;
+ for (i = 0; i < edge_builder->n_edges; i++)
+ new_v2v_sub_idx[i+1] += new_v2v_sub_idx[i];
+
+ /* Update v2v_sub_lst */
+
+ BFT_MALLOC(new_v2v_sub_lst,
+ new_v2v_sub_idx[edge_builder->n_edges], cs_int_t);
+
+ for (i = 0; i < edge_builder->n_edges; i++) {
+
+ shift = new_v2v_sub_idx[i];
+
+ for (j = edge_builder->v2v_sub_idx[i];
+ j < edge_builder->v2v_sub_idx[i+1]; j++) {
+ vid = edge_builder->v2v_sub_lst[j] - 1;
+ new_v2v_sub_lst[shift++] = inv_order[vid] + 1;
+ }
+
+ }
+
+ /* Update sub list for single edges */
+
+ shift = 0;
+
+ for (i = 0; i < s_edges->n_elts; i++) {
+
+ vid1 = s_edges->array[2*i] - 1;
+ vid2 = s_edges->array[2*i+1] - 1;
+ edge_id = _get_join_edge_id(vid1, vid2, edge_builder);
+ assert(edge_id != -1);
+
+ for (j = new_v2v_sub_idx[edge_id];
+ j < new_v2v_sub_idx[edge_id+1]; j++) {
+
+ id = cs_search_g_binary(mesh->n_vertices,
+ s_sub_gbuf[shift++],
+ mesh->global_vtx_num);
+
+ assert(id != -1);
+ new_v2v_sub_lst[j] = id + 1;
+
+ }
+
+ }
+
+ BFT_FREE(order);
+ BFT_FREE(inv_order);
+ BFT_FREE(edge_builder->v2v_sub_idx);
+ BFT_FREE(edge_builder->v2v_sub_lst);
+
+ edge_builder->v2v_sub_idx = new_v2v_sub_idx;
+ edge_builder->v2v_sub_lst = new_v2v_sub_lst;
+
+ } /* End if s_edges->n_elts > 0 */
+
+ /* Free memory */
+
+ BFT_FREE(s_count);
+ BFT_FREE(s_sub_gbuf);
+ BFT_FREE(s_sub_coord);
+
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Update elements of a cs_mesh_t structure implied in the joining
+ * operation. Update the vertices after the merge step.
+ *
+ * parameters:
+ * o2n_vtx_gnum <-- local array on the new global vertex
+ * join_mesh <-- pointer to a local cs_join_mesh_t struct.
+ * mesh <-> pointer to cs_mesh_t structure
+ * p_join2mesh_vtx_id --> relation between join mesh and after vertex merge
+ * p_o2n_vtx_id --> relation between init. and current local num.
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_vertices_after_merge(const fvm_gnum_t o2n_vtx_gnum[],
+ const cs_join_mesh_t *join_mesh,
+ cs_mesh_t *mesh,
+ cs_int_t *p_join2mesh_vtx_id[],
+ cs_int_t *p_o2n_vtx_id[])
+{
+ cs_int_t i, j, k, o_id, j_id;
+ fvm_gnum_t prev, cur;
+
+ cs_int_t n_am_vertices = -1; /* af: after merge */
+ cs_real_t *new_vtx_coord = NULL;
+ cs_int_t *o2n_vtx_id = NULL, *join2mesh_vtx_id = NULL;
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *new_vtx_gnum = NULL, *tmp_vtx_gnum = NULL;
+
+ const cs_int_t n_bm_vertices = mesh->n_vertices; /* bm: before merge */
+ const cs_int_t j_n_vertices = join_mesh->n_vertices;
+ const cs_join_vertex_t *j_vertices = join_mesh->vertices;
+ const cs_int_t n_vertices = n_bm_vertices + j_n_vertices;
+ const int n_ranks = cs_glob_n_ranks;
+
+ /* Update initial vertices (local and global numbering) */
+
+ BFT_MALLOC(o2n_vtx_id, n_bm_vertices, cs_int_t);
+ BFT_MALLOC(join2mesh_vtx_id, j_n_vertices, cs_int_t);
+ BFT_MALLOC(tmp_vtx_gnum, n_vertices, fvm_gnum_t);
+ BFT_MALLOC(new_vtx_gnum, n_vertices, fvm_gnum_t);
+ BFT_MALLOC(order, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_bm_vertices; i++)
+ tmp_vtx_gnum[i] = o2n_vtx_gnum[i];
+
+ for (i = 0, j = n_bm_vertices; i < j_n_vertices; i++, j++)
+ tmp_vtx_gnum[j] = j_vertices[i].gnum;
+
+ fvm_order_local_allocated(NULL, tmp_vtx_gnum, order, n_vertices);
+
+ /* Define o2n_vtx_id and join2mesh_vtx_id arrays */
+
+ if (order[0] < n_bm_vertices)
+ prev = o2n_vtx_gnum[order[0]] + 1;
+ else
+ prev = j_vertices[order[0]-n_bm_vertices].gnum + 1;
+
+ for (i = 0; i < n_vertices; i++) {
+
+ o_id = order[i];
+
+ if (o_id < n_bm_vertices) { /* Belongs to the initial mesh */
+
+ cur = o2n_vtx_gnum[o_id];
+ assert(cur <= mesh->n_g_vertices);
+
+ if (cur != prev) {
+
+ n_am_vertices++;
+ prev = cur;
+ o2n_vtx_id[o_id] = n_am_vertices;
+ new_vtx_gnum[n_am_vertices] = cur;
+
+ }
+ else
+ o2n_vtx_id[o_id] = n_am_vertices;
+
+ }
+ else { /* Belongs to the join_mesh */
+
+ j_id = o_id - n_bm_vertices;
+ cur = j_vertices[j_id].gnum;
+
+ if (cur != prev) {
+
+ n_am_vertices++;
+ prev = cur;
+ new_vtx_gnum[n_am_vertices] = cur;
+ join2mesh_vtx_id[j_id] = n_am_vertices;
+
+ }
+ else
+ join2mesh_vtx_id[j_id] = n_am_vertices;
+
+ }
+
+ } /* End of loop on vertices */
+
+ /* n_am_vertices was up to now an id. Move to a number */
+ n_am_vertices++;
+
+ /* Partial free memory */
+
+ BFT_FREE(tmp_vtx_gnum);
+ BFT_FREE(order);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n\n Dump Old2New array (local mesh): "
+ "old_n_vertices = %d - new_n_vertices = %d\n",
+ n_bm_vertices, n_am_vertices);
+ for (i = 0; i < n_bm_vertices; i++)
+ bft_printf("Old num : %7d (%9u) => New num : %7d (%9u)\n",
+ i+1, (n_ranks >1 ? mesh->global_vtx_num[i] : (fvm_gnum_t)i+1),
+ o2n_vtx_id[i]+1, o2n_vtx_gnum[i]);
+ bft_printf_flush();
+#endif
+
+ /* Update global vertex information */
+
+ mesh->n_vertices = n_am_vertices;
+ mesh->n_g_vertices = mesh->n_vertices;
+
+ BFT_REALLOC(new_vtx_gnum, n_am_vertices, fvm_gnum_t);
+ BFT_FREE(mesh->global_vtx_num);
+ mesh->global_vtx_num = new_vtx_gnum;
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) { /* Get temporary a no contiguous numbering */
+
+ fvm_gnum_t glob_gmax;
+ fvm_gnum_t loc_gmax = new_vtx_gnum[n_am_vertices - 1];
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ /* Find the max. global number */
+
+ MPI_Allreduce(&loc_gmax, &glob_gmax, 1, FVM_MPI_GNUM, MPI_MAX, mpi_comm);
+
+ mesh->n_g_vertices = glob_gmax;
+
+ }
+#endif
+
+ /* Update vtx_coord for initial vertices */
+
+ BFT_MALLOC(new_vtx_coord, 3*n_am_vertices, cs_real_t);
+
+ for (i = 0; i < n_bm_vertices; i++) /* Initialize new vertex coord. */
+ for (k = 0; k < 3; k++)
+ new_vtx_coord[3*o2n_vtx_id[i]+k] = mesh->vtx_coord[3*i+k];
+
+ /* Update vtx_coord for new vertices */
+
+ for (i = 0; i < join_mesh->n_vertices; i++)
+ for (k = 0; k < 3; k++)
+ new_vtx_coord[3*join2mesh_vtx_id[i]+k] = j_vertices[i].coord[k];
+
+ BFT_FREE(mesh->vtx_coord);
+ mesh->vtx_coord = new_vtx_coord;
+
+ /* Return pointer */
+
+ *p_join2mesh_vtx_id = join2mesh_vtx_id;
+ *p_o2n_vtx_id = o2n_vtx_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Update elements of a cs_mesh_t structure implied in the joining
+ * operation. Update the vertices after the face split step.
+ *
+ * parameters:
+ * join_mesh <-- pointer to a local cs_join_mesh_t struct.
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ * p_join2mesh_vtx_id --> relation between join mesh and after merge vertex
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_vertices_after_split(const cs_join_mesh_t *join_mesh,
+ cs_mesh_t *mesh,
+ cs_int_t *p_join2mesh_vtx_id[])
+{
+ cs_int_t i, j, k, o_id, j_id, v_id;
+ fvm_gnum_t prev, cur;
+
+ cs_int_t n_as_vertices = -1; /* ac: after splitting */
+ fvm_lnum_t *order = NULL;
+ cs_real_t *new_vtx_coord = NULL;
+ cs_int_t *o2n_vtx_id = NULL, *join2mesh_vtx_id = NULL;
+ fvm_gnum_t *new_vtx_gnum = NULL, *tmp_vtx_gnum = NULL;
+
+ const cs_int_t n_bs_vertices = mesh->n_vertices; /* bs: before splitting */
+ const cs_int_t j_n_vertices = join_mesh->n_vertices;
+ const cs_join_vertex_t *j_vertices = join_mesh->vertices;
+ const cs_int_t n_vertices = n_bs_vertices + j_n_vertices;
+
+ /* Update initial vertices (local and global numbering) */
+
+ BFT_MALLOC(o2n_vtx_id, n_bs_vertices, cs_int_t);
+ BFT_MALLOC(join2mesh_vtx_id, j_n_vertices, cs_int_t);
+ BFT_MALLOC(tmp_vtx_gnum, n_vertices, fvm_gnum_t);
+ BFT_MALLOC(new_vtx_gnum, n_vertices, fvm_gnum_t);
+ BFT_MALLOC(order, n_vertices, fvm_lnum_t);
+
+ for (i = 0; i < n_bs_vertices; i++)
+ tmp_vtx_gnum[i] = mesh->global_vtx_num[i];
+
+ for (i = 0, j = n_bs_vertices; i < j_n_vertices; i++, j++)
+ tmp_vtx_gnum[j] = j_vertices[i].gnum;
+
+ fvm_order_local_allocated(NULL, tmp_vtx_gnum, order, n_vertices);
+
+ /* Define o2n_vtx_id and join2mesh_vtx_id arrays */
+
+ if (order[0] < n_bs_vertices)
+ prev = mesh->global_vtx_num[order[0]] + 1;
+ else
+ prev = j_vertices[order[0]-n_bs_vertices].gnum + 1;
+
+ for (i = 0; i < n_vertices; i++) {
+
+ o_id = order[i];
+
+ if (o_id < n_bs_vertices) { /* Belongs to the initial mesh */
+
+ cur = mesh->global_vtx_num[o_id];
+
+ if (cur != prev) {
+
+ n_as_vertices++;
+ prev = cur;
+ o2n_vtx_id[o_id] = n_as_vertices;
+ new_vtx_gnum[n_as_vertices] = cur;
+
+ }
+ else
+ o2n_vtx_id[o_id] = n_as_vertices;
+
+ }
+ else { /* Belongs to the join_mesh */
+
+ j_id = o_id - n_bs_vertices;
+ cur = j_vertices[j_id].gnum;
+
+ if (cur != prev) {
+
+ n_as_vertices++;
+ prev = cur;
+ new_vtx_gnum[n_as_vertices] = cur;
+ join2mesh_vtx_id[j_id] = n_as_vertices;
+
+ }
+ else
+ join2mesh_vtx_id[j_id] = n_as_vertices;
+
+ }
+
+ } /* End of loop on vertices */
+
+ /* n_as_vertices was up to now an id. Move to a number */
+ n_as_vertices++;
+
+ /* Memory management */
+
+ BFT_FREE(tmp_vtx_gnum);
+ BFT_FREE(order);
+ BFT_REALLOC(new_vtx_gnum, n_as_vertices, fvm_gnum_t);
+ BFT_MALLOC(new_vtx_coord, 3*n_as_vertices, cs_real_t);
+
+ mesh->n_vertices = n_as_vertices;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n\n Dump Old2New array (local mesh): "
+ "old_n_vertices = %d - new_n_vertices = %d\n",
+ n_bs_vertices, n_as_vertices);
+ for (i = 0; i < n_bs_vertices; i++)
+ bft_printf("Old num : %7d (%9u) => New num : %7d (%9u)\n",
+ i+1, (cs_glob_n_ranks >1 ? mesh->global_vtx_num[i] : (fvm_gnum_t)i+1),
+ o2n_vtx_id[i]+1, new_vtx_gnum[o2n_vtx_id[i]]);
+ bft_printf_flush();
+#endif
+
+ /* Update vtx_coord for initial vertices */
+
+ for (i = 0; i < n_bs_vertices; i++) /* Initialize new vertex coord. */
+ for (k = 0; k < 3; k++)
+ new_vtx_coord[3*o2n_vtx_id[i]+k] = mesh->vtx_coord[3*i+k];
+
+ /* Update vtx_coord for new vertices */
+
+ for (i = 0; i < join_mesh->n_vertices; i++)
+ for (k = 0; k < 3; k++)
+ new_vtx_coord[3*join2mesh_vtx_id[i]+k] = j_vertices[i].coord[k];
+
+ /* Update interior face connect. */
+
+ for (i = 0; i < mesh->n_i_faces; i++) {
+ for (j = mesh->i_face_vtx_idx[i]-1; j < mesh->i_face_vtx_idx[i+1]-1; j++) {
+ v_id = mesh->i_face_vtx_lst[j] - 1;
+ mesh->i_face_vtx_lst[j] = o2n_vtx_id[v_id] + 1;
+ }
+ }
+
+ /* Update border face connect. */
+
+ for (i = 0; i < mesh->n_b_faces; i++) {
+ for (j = mesh->b_face_vtx_idx[i]-1; j < mesh->b_face_vtx_idx[i+1]-1; j++) {
+ v_id = mesh->b_face_vtx_lst[j] - 1;
+ mesh->b_face_vtx_lst[j] = o2n_vtx_id[v_id] + 1;
+ }
+ }
+
+ /* Free memory */
+
+ BFT_FREE(o2n_vtx_id);
+ BFT_FREE(mesh->vtx_coord);
+ BFT_FREE(mesh->global_vtx_num);
+
+ mesh->vtx_coord = new_vtx_coord;
+ mesh->global_vtx_num = new_vtx_gnum;
+
+ /* Return pointer */
+
+ *p_join2mesh_vtx_id = join2mesh_vtx_id;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Allocate and initialize the definition of a edge_builder_t structure.
+ * Equivalent to build a local edge-based connectivity for the selected faces.
+ *
+ * parameters:
+ * join_select <-- list of entities participating in the join operation
+ * mesh <-- pointer to a cs_mesh_t structure
+ *
+ * returns:
+ * a new allocated pointer to an edge_builder_t structure.
+ *---------------------------------------------------------------------------*/
+
+static edge_builder_t *
+_init_edge_builder(const cs_join_select_t *join_select,
+ const cs_mesh_t *mesh)
+{
+ cs_int_t i, j, save, shift;
+
+ cs_int_t *count = NULL;
+ edge_builder_t *edge_builder = NULL;
+
+ assert(sizeof(cs_int_t) == sizeof(fvm_lnum_t));
+
+ /* Allocate and initialize edge_builder_t structure */
+
+ BFT_MALLOC(edge_builder, 1, edge_builder_t);
+
+ edge_builder->n_vertices = mesh->n_vertices;
+ edge_builder->n_edges = 0;
+ edge_builder->v2v_lst = NULL;
+ edge_builder->v2v_sub_idx = NULL;
+ edge_builder->v2v_sub_lst = NULL;
+
+ BFT_MALLOC(edge_builder->v2v_idx, edge_builder->n_vertices + 1, cs_int_t);
+
+ for (i = 0; i < edge_builder->n_vertices + 1; i++)
+ edge_builder->v2v_idx[i] = 0;
+
+ /* Build vertex -> vertex index */
+
+ cs_join_build_edges_idx(join_select->n_faces,
+ join_select->faces,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ edge_builder->v2v_idx);
+
+ if (cs_glob_n_ranks > 1) { /* Add edges from "single" edges */
+
+ cs_join_sync_t *s_edges = join_select->s_edges;
+
+ assert(s_edges != NULL);
+
+ if (s_edges->n_elts > 0)
+ for (i = 0; i < s_edges->n_elts; i++)
+ edge_builder->v2v_idx[s_edges->array[2*i]] += 1;
+
+ }
+
+ BFT_MALLOC(count, edge_builder->n_vertices, cs_int_t);
+
+ for (i = 0; i < edge_builder->n_vertices; i++) {
+ edge_builder->v2v_idx[i+1] += edge_builder->v2v_idx[i];
+ count[i] = 0;
+ }
+
+ edge_builder->n_edges = edge_builder->v2v_idx[edge_builder->n_vertices];
+
+ /* Build vertex -> vertex list */
+
+ BFT_MALLOC(edge_builder->v2v_lst, edge_builder->n_edges, cs_int_t);
+
+ /* Fill v2v_lst */
+
+ cs_join_build_edges_lst(join_select->n_faces,
+ join_select->faces,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ count,
+ edge_builder->v2v_idx,
+ edge_builder->v2v_lst);
+
+ /* Add edges from "single" edges */
+
+ if (cs_glob_n_ranks > 1) { /* Add edges from "single" edges */
+
+ cs_join_sync_t *s_edges = join_select->s_edges;
+
+ for (i = 0; i < s_edges->n_elts; i++) {
+
+ int vid1 = s_edges->array[2*i] - 1;
+ int vid2 = s_edges->array[2*i+1] - 1;
+
+ assert(vid1 < vid2);
+ shift = edge_builder->v2v_idx[vid1] + count[vid1];
+ edge_builder->v2v_lst[shift] = vid2 + 1;
+ count[vid1] += 1;
+
+ }
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(count);
+
+ /* Ordering in order to clean the list */
+
+ for (i = 0; i < edge_builder->n_vertices; i++)
+ cs_sort_shell(edge_builder->v2v_idx[i],
+ edge_builder->v2v_idx[i+1],
+ edge_builder->v2v_lst);
+
+ /* Delete redundancies. Clean structure. */
+
+ save = edge_builder->v2v_idx[0];
+ shift = 0;
+
+ for (i = 0; i < edge_builder->n_vertices; i++) {
+
+ cs_int_t start = save;
+ cs_int_t end = edge_builder->v2v_idx[i+1];
+
+ if (end - start > 0) {
+
+ edge_builder->v2v_lst[shift++] = edge_builder->v2v_lst[start];
+
+ for (j = start + 1; j < end; j++)
+ if (edge_builder->v2v_lst[j-1] != edge_builder->v2v_lst[j])
+ edge_builder->v2v_lst[shift++] = edge_builder->v2v_lst[j];
+
+ }
+
+ save = end;
+ edge_builder->v2v_idx[i+1] = shift;
+
+ }
+
+ edge_builder->n_edges = edge_builder->v2v_idx[edge_builder->n_vertices];
+ BFT_REALLOC(edge_builder->v2v_lst, edge_builder->n_edges, cs_int_t);
+
+ return edge_builder;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the local face connectivity for the current selected face before/after
+ * the merge step.
+ *
+ * parameters:
+ * select_id <-- id of the selected face in selection array
+ * o2n_vtx_gnum <-- local array on the new global vertex
+ * join_select <-- list of all implied entities in the joining operation
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * mesh <-- pointer to cs_mesh_t structure
+ * bm_tmp <-> connectivity before the merge step
+ * am_tmp <-> connectivity after the merge step
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_local_faces_connect(cs_int_t select_id,
+ const fvm_gnum_t o2n_vtx_gnum[],
+ const cs_join_select_t *join_select,
+ const cs_join_mesh_t *join_mesh,
+ const cs_mesh_t *mesh,
+ cs_int_t bm_tmp[],
+ cs_int_t am_tmp[])
+{
+ cs_int_t i, j, k, v_id, bm_shift;
+ fvm_gnum_t new_gnum, v_gnum;
+
+ cs_int_t fid = join_select->faces[select_id] - 1;
+ fvm_gnum_t fgnum = join_select->compact_face_gnum[select_id];
+ cs_int_t am_s = join_mesh->face_vtx_idx[select_id] - 1;
+ cs_int_t am_e = join_mesh->face_vtx_idx[select_id+1] - 1;
+ cs_int_t n_am_face_vertices = am_e - am_s;
+ cs_int_t bm_s = mesh->b_face_vtx_idx[fid] - 1;
+ cs_int_t bm_e = mesh->b_face_vtx_idx[fid+1] - 1;
+ cs_int_t n_bm_face_vertices = bm_e - bm_s;
+ cs_int_t fst_match_id = -1;
+
+ const cs_join_vertex_t *vertices = join_mesh->vertices;
+ const int n_ranks = cs_glob_n_ranks;
+
+ assert(join_mesh->face_gnum[select_id] == fgnum);
+
+ /* Store the face connectivity before the merge step */
+
+ for (i = bm_s, j = 0; i < bm_e; i++, j++)
+ bm_tmp[j] = mesh->b_face_vtx_lst[i] - 1;
+ bm_tmp[n_bm_face_vertices] = mesh->b_face_vtx_lst[bm_s] - 1;
+
+ /* Store the face connectivity after the merge step */
+
+ for (i = am_s, j = 0; i < am_e; i++, j++)
+ am_tmp[j] = join_mesh->face_vtx_lst[i] - 1;
+ am_tmp[n_am_face_vertices] = join_mesh->face_vtx_lst[am_s] - 1;
+
+ /* Find position of initial vertices in the face connectivity after the
+ merge step. If not found -1 (initialized value) */
+
+ bm_shift = 0;
+ while (fst_match_id == -1 && bm_shift < n_bm_face_vertices) {
+
+ v_id = bm_tmp[bm_shift];
+ v_gnum = (n_ranks > 1 ? mesh->global_vtx_num[v_id] : (fvm_gnum_t)v_id+1);
+ new_gnum = o2n_vtx_gnum[v_id];
+
+ for (k = 0; k < n_am_face_vertices; k++) {
+ if (vertices[am_tmp[k]].gnum == new_gnum) {
+ fst_match_id = k;
+ break;
+ }
+ }
+
+ if (fst_match_id == -1)
+ bm_shift++;
+
+ }
+
+ if (fst_match_id == -1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Cannot find the first corresponding vertex between the face"
+ " connectivity before/after the merge step.\n"
+ " Current global face number: %u\n"), fgnum);
+
+ /* Store the face connectivity before the merge step */
+
+ for (i = 0; i < n_bm_face_vertices; i++) {
+ j = bm_s + (bm_shift + i) % n_bm_face_vertices;
+ bm_tmp[i] = mesh->b_face_vtx_lst[j] - 1;
+ }
+ bm_tmp[n_bm_face_vertices] = mesh->b_face_vtx_lst[bm_s + bm_shift] - 1;
+
+ /* Store the face connectivity after the merge step */
+
+ for (i = 0; i < n_am_face_vertices; i++) {
+ j = am_s + (fst_match_id + i) % n_am_face_vertices;
+ am_tmp[i] = join_mesh->face_vtx_lst[j] - 1;
+ }
+ am_tmp[n_am_face_vertices] = join_mesh->face_vtx_lst[am_s + fst_match_id] -1;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n\n Face: %d (%u)\n", fid+1, fgnum);
+ bft_printf("bm_tmp:%d, n: %2d, v:", i, n_bm_face_vertices+1);
+ for (j = 0; j < n_bm_face_vertices + 1; j++)
+ bft_printf(" %8d (%u)", bm_tmp[j]+1, o2n_vtx_gnum[bm_tmp[j]]);
+ bft_printf("\nam_tmp:%d, n: %2d, v:", i, n_am_face_vertices+1);
+ for (j = 0; j < n_am_face_vertices + 1; j++)
+ bft_printf(" %8d (%u)", am_tmp[j]+1, vertices[am_tmp[j]].gnum);
+ bft_printf("\n");
+ bft_printf_flush();
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Define the new edge connectivity for the initial edges.
+ *
+ * parameters:
+ * join_select <-- keep all implied entities in the joining operation
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * mesh <-- pointer of pointer to cs_mesh_t structure
+ * o2n_vtx_gnum <-- local array on the new global vertex
+ * join2mesh_vtx_id <-- relation between join mesh and vertex after merge
+ * edge_builder <-> pointer to an edge_builder_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_complete_edge_builder(const cs_join_select_t *join_select,
+ const cs_join_mesh_t *join_mesh,
+ const cs_mesh_t *mesh,
+ const fvm_gnum_t o2n_vtx_gnum[],
+ const cs_int_t join2mesh_vtx_id[],
+ edge_builder_t *edge_builder)
+{
+ cs_int_t i, j, j1, j2, k, shift;
+ cs_int_t v1_id, v2_id, edge_id, n_subs;
+ fvm_gnum_t v1_gnum, v2_gnum;
+ cs_bool_t direct_scan, degenerate_edge;
+
+ cs_int_t am_max = 0, bm_max = 0;
+ cs_int_t *am_tmp = NULL, *bm_tmp = NULL;
+
+ const cs_join_vertex_t *vertices = join_mesh->vertices;
+
+ /* Sanity checks */
+
+ assert(edge_builder != NULL);
+ assert(join_mesh->n_faces == join_select->n_faces);
+
+ /* Define a list of new vertices for each initial selected edge */
+
+ BFT_MALLOC(edge_builder->v2v_sub_idx, edge_builder->n_edges + 1, cs_int_t);
+
+ for (i = 0; i < edge_builder->n_edges + 1; i++)
+ edge_builder->v2v_sub_idx[i] = 0;
+
+ for (i = 0; i < join_mesh->n_faces; i++)
+ am_max = CS_MAX(am_max,
+ join_mesh->face_vtx_idx[i+1]-join_mesh->face_vtx_idx[i]);
+
+ for (i = 0; i < join_select->n_faces; i++) {
+ j = join_select->faces[i] - 1;
+ bm_max = CS_MAX(bm_max, mesh->b_face_vtx_idx[j+1]-mesh->b_face_vtx_idx[j]);
+ }
+
+ BFT_MALLOC(am_tmp, am_max + 1, cs_int_t);
+ BFT_MALLOC(bm_tmp, bm_max + 1, cs_int_t);
+
+ /* Count the number of sub-elements to add to each initial edge */
+
+ for (i = 0; i < join_select->n_faces; i++) {
+
+ cs_int_t fid = join_select->faces[i] - 1;
+ fvm_gnum_t fgnum = join_select->compact_face_gnum[i];
+ cs_int_t bm_s = mesh->b_face_vtx_idx[fid] - 1;
+ cs_int_t bm_e = mesh->b_face_vtx_idx[fid+1] - 1;
+ cs_int_t n_bm_face_vertices = bm_e - bm_s;
+ cs_int_t am_s = join_mesh->face_vtx_idx[i] - 1;
+ cs_int_t am_e = join_mesh->face_vtx_idx[i+1] - 1;
+ cs_int_t n_am_face_vertices = am_e - am_s;
+
+ _get_local_faces_connect(i, /* id of the face */
+ o2n_vtx_gnum,
+ join_select,
+ join_mesh,
+ mesh,
+ bm_tmp,
+ am_tmp);
+
+ for (j = 0, j1 = 0, j2 = 0; j < n_bm_face_vertices; j++) {
+
+ degenerate_edge = false;
+ v1_id = bm_tmp[j];
+ v2_id = bm_tmp[j+1];
+ v1_gnum = o2n_vtx_gnum[v1_id];
+ v2_gnum = o2n_vtx_gnum[v2_id];
+
+ if (v1_gnum != vertices[am_tmp[j1]].gnum)
+ j2 = j1 + 1;
+
+ else {
+
+ edge_id = _get_join_edge_id(v1_id, v2_id, edge_builder);
+
+ assert(edge_id != -1);
+
+ if (v1_gnum == v2_gnum) { /* Initial edge has been deleted */
+ n_subs = 1;
+ degenerate_edge = true;
+ }
+ else { /* Look for the next initial vertex */
+
+ for (j2 = j1 + 1; j2 < n_am_face_vertices + 1; j2++)
+ if (v2_gnum == vertices[am_tmp[j2]].gnum)
+ break;
+
+ if (j2 == n_am_face_vertices + 1) { /* Init. edge has been deleted */
+
+ j2 = j1 + 1;
+ degenerate_edge = true;
+ n_subs = 1;
+
+ }
+ else
+ n_subs = j2 - j1 - 1;
+
+ }
+
+ /* Add n_subs elements to the initial edge definition */
+
+ if (edge_builder->v2v_sub_idx[edge_id+1] == 0)
+ edge_builder->v2v_sub_idx[edge_id+1] = n_subs;
+
+ else { /* This edge has already been scanned */
+
+ if (edge_builder->v2v_sub_idx[edge_id+1] != n_subs) {
+
+ /* Different result for the same edge is only possible for
+ a degenerate edge */
+
+ if (degenerate_edge == false && n_subs == 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Face %d (%u): Edge with two different"
+ " descriptions: (%d, %d) [%u, %u]\n"
+ " n_subs: %d - previous n_subs: %d\n"
+ " Impossible to continue the mesh update after the"
+ " merge operation.\n"),
+ fid+1, fgnum, v1_id+1, v2_id+1, v1_gnum, v2_gnum,
+ n_subs, edge_builder->v2v_sub_idx[edge_id+1]);
+ else
+ edge_builder->v2v_sub_idx[edge_id+1] =
+ CS_MAX(n_subs, edge_builder->v2v_sub_idx[edge_id+1]);
+
+ }
+
+ }
+
+ j1 = j2;
+
+ } /* v1_gnum == vertices[am_tmp[j1]].gnum */
+
+ } /* End of loop on initial face connectivity */
+
+ } /* End of loop on selected faces */
+
+ /* Build sub index */
+
+ for (i = 0; i < edge_builder->n_edges; i++)
+ edge_builder->v2v_sub_idx[i+1] += edge_builder->v2v_sub_idx[i];
+
+ BFT_MALLOC(edge_builder->v2v_sub_lst,
+ edge_builder->v2v_sub_idx[edge_builder->n_edges], cs_int_t);
+
+ for (i = 0; i < edge_builder->v2v_sub_idx[edge_builder->n_edges]; i++)
+ edge_builder->v2v_sub_lst[i] = -1; /* value = degenerate edge */
+
+ /* Add sub-elements to each initial edge */
+
+ for (i = 0; i < join_select->n_faces; i++) {
+
+ cs_int_t fid = join_select->faces[i] - 1;
+ cs_int_t bm_s = mesh->b_face_vtx_idx[fid] - 1;
+ cs_int_t bm_e = mesh->b_face_vtx_idx[fid+1] - 1;
+ cs_int_t n_bm_face_vertices = bm_e - bm_s;
+ cs_int_t am_s = join_mesh->face_vtx_idx[i] - 1;
+ cs_int_t am_e = join_mesh->face_vtx_idx[i+1] - 1;
+ cs_int_t n_am_face_vertices = am_e - am_s;
+
+ _get_local_faces_connect(i, /* id of the face */
+ o2n_vtx_gnum,
+ join_select,
+ join_mesh,
+ mesh,
+ bm_tmp,
+ am_tmp);
+
+ for (j = 0, j1 = 0, j2 = 0; j < n_bm_face_vertices; j++) {
+
+ v1_id = bm_tmp[j];
+ v2_id = bm_tmp[j+1];
+ v1_gnum = o2n_vtx_gnum[v1_id];
+ v2_gnum = o2n_vtx_gnum[v2_id];
+
+ if (v1_gnum != vertices[am_tmp[j1]].gnum)
+ j2 = j1 + 1;
+
+ else {
+
+ if (v1_id < v2_id)
+ direct_scan = true;
+ else
+ direct_scan = false;
+
+ edge_id = _get_join_edge_id(v1_id, v2_id, edge_builder);
+
+ if (v1_gnum != v2_gnum) { /* Initial edge is not degenerate */
+
+ for (j2 = j1 + 1; j2 < n_am_face_vertices + 1; j2++)
+ if (v2_gnum == vertices[am_tmp[j2]].gnum)
+ break;
+
+ if (j2 == n_am_face_vertices + 1) /* Initial edge is degenerate */
+ j2 = j1 + 1;
+
+ else { /* Add n_subs elements to the initial edge definition */
+
+ n_subs = j2 - j1 - 1;
+ shift = edge_builder->v2v_sub_idx[edge_id];
+
+ if (direct_scan == true) {
+ for (k = 0; k < n_subs; k++)
+ edge_builder->v2v_sub_lst[shift + k] =
+ join2mesh_vtx_id[am_tmp[j1 + 1 + k]] + 1;
+ }
+ else {
+ for (k = 0; k < n_subs; k++)
+ edge_builder->v2v_sub_lst[shift + k] =
+ join2mesh_vtx_id[am_tmp[j1 + n_subs - k]] + 1;
+ /* j1 + 1 + n_subs - 1 - k */
+ }
+
+ }
+
+ } /* Initial edge is not degenerate */
+
+ j1 = j2;
+
+ } /* v1_gnum == vertices[am_tmp[j]].gnum */
+
+ } /* End of loop on initial face connectivity */
+
+ } /* End of loop on selected faces */
+
+ /* Free memory */
+
+ BFT_FREE(am_tmp);
+ BFT_FREE(bm_tmp);
+}
+
+/*----------------------------------------------------------------------------
+ * Update selected face connectivity after the merge step.
+ *
+ * parameters:
+ * join_select <-- cs_join_select_t struct.
+ * join_mesh <-- cs_join_mesh_t structure
+ * join2mesh_vtx_id <-- relation between vtx_id of join_mesh & cs_mesh_t
+ * n_faces <-- local number of faces in the mesh
+ * p_f2v_idx <-> face -> vertex connectivity index
+ * p_f2v_lst <-> face -> vertex connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_selected_face_connect(const cs_join_select_t *join_select,
+ const cs_join_mesh_t *join_mesh,
+ const cs_int_t join2mesh_vtx_id[],
+ cs_int_t n_faces,
+ cs_int_t *p_f2v_idx[],
+ cs_int_t *p_f2v_lst[])
+{
+ cs_int_t i, j, shift, v_id, select_id, join_fid;
+ fvm_gnum_t fgnum;
+
+ cs_int_t *new_f2v_lst = NULL, *new_f2v_idx = NULL;
+ cs_int_t *f2v_idx = *p_f2v_idx;
+ cs_int_t *f2v_lst = *p_f2v_lst;
+
+ BFT_MALLOC(new_f2v_idx, n_faces + 1, cs_int_t);
+
+ for (i = 0; i < n_faces + 1; i++)
+ new_f2v_idx[i] = 0;
+
+ for (i = 0, select_id = 0; i < n_faces; i++) {
+
+ cs_bool_t in_selection = false;
+
+ if (select_id < join_select->n_faces)
+ if (i+1 == join_select->faces[select_id])
+ in_selection = true;
+
+ if (in_selection) { /* Among selected faces */
+
+ fgnum = join_select->compact_face_gnum[select_id];
+
+ if (join_mesh->face_gnum[select_id] == fgnum)
+ join_fid = select_id;
+ else
+ join_fid = cs_search_g_binary(join_mesh->n_faces,
+ fgnum,
+ join_mesh->face_gnum);
+
+ assert(join_fid < join_mesh->n_faces);
+ assert(join_fid != -1);
+
+ new_f2v_idx[i+1] = join_mesh->face_vtx_idx[join_fid+1]
+ - join_mesh->face_vtx_idx[join_fid];
+
+ select_id++;
+
+ }
+ else /* Not a selected face. Do not update. */
+ new_f2v_idx[i+1] = f2v_idx[i+1] - f2v_idx[i];
+
+ } /* End of loop on border faces */
+
+ new_f2v_idx[0] = 1;
+ for (i = 0; i < n_faces; i++)
+ new_f2v_idx[i+1] += new_f2v_idx[i];
+
+ BFT_MALLOC(new_f2v_lst, new_f2v_idx[n_faces]-1, cs_int_t);
+
+ for (i = 0, select_id = 0; i < n_faces; i++) {
+
+ cs_bool_t in_selection = false;
+
+ if (select_id < join_select->n_faces)
+ if (i+1 == join_select->faces[select_id])
+ in_selection = true;
+
+ shift = new_f2v_idx[i]-1;
+
+ if (in_selection) { /* Among selected faces */
+
+ fgnum = join_select->compact_face_gnum[select_id];
+
+ if (join_mesh->face_gnum[select_id] == fgnum)
+ join_fid = select_id;
+ else
+ join_fid = cs_search_g_binary(join_mesh->n_faces,
+ fgnum,
+ join_mesh->face_gnum);
+
+ for (j = join_mesh->face_vtx_idx[join_fid]-1;
+ j < join_mesh->face_vtx_idx[join_fid+1]-1; j++, shift++) {
+ v_id = join_mesh->face_vtx_lst[j] - 1;
+ new_f2v_lst[shift] = join2mesh_vtx_id[v_id] + 1;
+ }
+
+ select_id++;
+
+ }
+ else { /* Not a selected face. Do not update. */
+
+ for (j = f2v_idx[i]-1; j < f2v_idx[i+1]-1; j++, shift++)
+ new_f2v_lst[shift] = f2v_lst[j];
+
+ }
+
+ } /* End of loop on border faces */
+
+ BFT_FREE(f2v_lst);
+ BFT_FREE(f2v_idx);
+
+ /* Return pointers */
+
+ *p_f2v_idx = new_f2v_idx;
+ *p_f2v_lst = new_f2v_lst;
+}
+
+/*----------------------------------------------------------------------------
+ * Update adjacent face connectivity.
+ *
+ * parameters:
+ * n_adj_faces <-- number of adjacent faces
+ * adj_faces <-- list of adjacent face numbers
+ * edge_builder <-- edge_builder_t structure
+ * o2n_vtx_id <-- relation between old/new vertix id
+ * n_faces <-- local number of faces in the mesh
+ * p_f2v_idx <-- face -> vertex connectivity index
+ * p_f2v_lst <-- face -> vertex connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_adj_face_connect(cs_int_t n_adj_faces,
+ const cs_int_t adj_faces[],
+ const edge_builder_t *edge_builder,
+ const cs_int_t o2n_vtx_id[],
+ cs_int_t n_faces,
+ cs_int_t *p_f2v_idx[],
+ cs_int_t *p_f2v_lst[])
+{
+ cs_int_t i, j, k, l, v1_id, v2_id, n_face_vertices, shift, select_id;
+ cs_int_t s, e, v_s, v_e, v_sub_s, v_sub_e, edge_id;
+
+ cs_int_t max = 0;
+ cs_int_t *new_f2v_lst = NULL, *new_f2v_idx = NULL, *tmp = NULL;
+ cs_int_t *f2v_idx = *p_f2v_idx;
+ cs_int_t *f2v_lst = *p_f2v_lst;
+
+ BFT_MALLOC(new_f2v_idx, n_faces+1, cs_int_t);
+
+ for (i = 0; i < n_faces + 1; i++)
+ new_f2v_idx[i] = 0;
+
+ for (i = 0; i < n_faces; i++)
+ max = CS_MAX(max, f2v_idx[i+1] - f2v_idx[i]);
+
+ BFT_MALLOC(tmp, max + 1, cs_int_t);
+
+ /* first: update index (counting phase) */
+
+ for (i = 0, select_id = 0; i < n_faces; i++) {
+
+ cs_bool_t in_selection = false;
+
+ if (select_id < n_adj_faces)
+ if (i+1 == adj_faces[select_id])
+ in_selection = true;
+
+ if (in_selection) { /* Among selected faces */
+
+ cs_int_t count = 0;
+
+ s = f2v_idx[i] - 1;
+ e = f2v_idx[i+1] - 1;
+ n_face_vertices = e - s;
+
+ for (k = 0; k < n_face_vertices; k++)
+ tmp[k] = f2v_lst[s + k] - 1;
+ tmp[n_face_vertices] = f2v_lst[s] - 1;
+
+ for (j = 0; j < n_face_vertices; j++) { /* Scan edges */
+
+ if (tmp[j] < tmp[j+1])
+ v1_id = tmp[j], v2_id = tmp[j+1];
+ else if (tmp[j+1] < tmp[j])
+ v1_id = tmp[j+1], v2_id = tmp[j];
+ else /* delete the current edge (count += 0) */
+ v1_id = -1;
+
+ /* edge builder->n_vertices is still equal to the initial
+ number of vertices; this should not be a problem,
+ as an edge always starts with a previously existing
+ vertex */
+
+ assert(v1_id < edge_builder->n_vertices);
+
+ if (v1_id > -1 && v1_id < edge_builder->n_vertices) {
+
+ v_s = edge_builder->v2v_idx[v1_id];
+ v_e = edge_builder->v2v_idx[v1_id+1];
+ count += 1; /* for v1_id */
+
+ for (edge_id = v_s; edge_id < v_e; edge_id++)
+ if (edge_builder->v2v_lst[edge_id] == v2_id + 1)
+ break;
+
+ if (edge_id < v_e) {
+
+ v_sub_s = edge_builder->v2v_sub_idx[edge_id];
+ v_sub_e = edge_builder->v2v_sub_idx[edge_id + 1];
+
+ if (v_sub_e - v_sub_s > 0)
+ if (edge_builder->v2v_sub_lst[v_sub_s] != -1)
+ count += v_sub_e - v_sub_s;
+
+ } /* End if exist edge_id */
+
+ } /* End if v1_id > -1 */
+
+ } /* End of loop on face connectivity */
+
+ assert(count > 2); /* At least a triangle */
+ assert(select_id < n_adj_faces);
+
+ new_f2v_idx[i+1] = count;
+ select_id++;
+
+ }
+ else /* Not an adjacent face. Do not update. */
+ new_f2v_idx[i+1] = f2v_idx[i+1] - f2v_idx[i];
+
+ } /* End of loop on faces */
+
+ new_f2v_idx[0] = 1;
+ for (i = 0; i < n_faces; i++)
+ new_f2v_idx[i+1] += new_f2v_idx[i];
+
+ BFT_MALLOC(new_f2v_lst, new_f2v_idx[n_faces]-1, cs_int_t);
+
+ /* second: update list (filling phase) */
+
+ for (i = 0, select_id = 0; i < n_faces; i++) {
+
+ cs_bool_t direct_scan;
+ cs_bool_t in_selection = false;
+
+ if (select_id < n_adj_faces)
+ if (i+1 == adj_faces[select_id])
+ in_selection = true;
+
+ shift = new_f2v_idx[i] - 1;
+
+ if (in_selection) { /* Among selected faces */
+
+ cs_int_t count = 0;
+
+ s = f2v_idx[i] - 1;
+ e = f2v_idx[i+1] - 1;
+ n_face_vertices = e - s;
+
+ for (k = 0; k < n_face_vertices; k++)
+ tmp[k] = f2v_lst[s + k] - 1;
+ tmp[n_face_vertices] = f2v_lst[s] - 1;
+
+ for (j = 0; j < n_face_vertices; j++) { /* Scan edges */
+
+ if (tmp[j] < tmp[j+1]) {
+ v1_id = tmp[j];
+ v2_id = tmp[j+1];
+ direct_scan = true;
+ }
+ else if (tmp[j+1] < tmp[j]) {
+ v1_id = tmp[j+1];
+ v2_id = tmp[j];
+ direct_scan = false;
+ }
+ else /* delete the current edge (count += 0) */
+ v1_id = -1;
+
+ if (v1_id > -1 && v1_id < edge_builder->n_vertices) {
+
+ v_s = edge_builder->v2v_idx[v1_id];
+ v_e = edge_builder->v2v_idx[v1_id+1];
+
+ new_f2v_lst[shift + count] = o2n_vtx_id[tmp[j]] + 1;
+ count += 1; /* for v1_id */
+
+ for (edge_id = v_s; edge_id < v_e; edge_id++)
+ if (edge_builder->v2v_lst[edge_id] == v2_id + 1)
+ break;
+
+ if (edge_id < v_e) {
+
+ v_sub_s = edge_builder->v2v_sub_idx[edge_id];
+ v_sub_e = edge_builder->v2v_sub_idx[edge_id + 1];
+
+ if (v_sub_e - v_sub_s > 0) {
+
+ if (edge_builder->v2v_sub_lst[v_sub_s] != -1) {
+
+ /* Edge is in edge_builder and is not to delete */
+
+ if (direct_scan == true)
+ for (l = v_sub_s; l < v_sub_e; l++, count++)
+ new_f2v_lst[shift + count] = edge_builder->v2v_sub_lst[l];
+ else
+ for (l = v_sub_e - 1; l >= v_sub_s; l--, count++)
+ new_f2v_lst[shift + count] = edge_builder->v2v_sub_lst[l];
+
+ } /* edge is not degenerate */
+
+ } /* There are sub-elements to add */
+
+ } /* End if exist edge_id */
+
+ } /* End if v1_id > -1 */
+
+ } /* End of loop on face connectivity */
+
+ select_id++;
+
+ }
+ else /* Not in selection. Do not update */
+ for (j = f2v_idx[i] - 1; j < f2v_idx[i+1] - 1; j++)
+ new_f2v_lst[shift++] = f2v_lst[j];
+
+ } /* End of loop on faces */
+
+ BFT_FREE(f2v_lst);
+ BFT_FREE(f2v_idx);
+ BFT_FREE(tmp);
+
+ /* Return pointers */
+
+ *p_f2v_idx = new_f2v_idx;
+ *p_f2v_lst = new_f2v_lst;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute barycenter and face normal for the current face.
+ *
+ * parameters:
+ * n_face_vertices <-- number of vertices defining the face
+ * face_vtx_coord <-- coordinates of each vertex of the face
+ * (size: n_face_vertices+1)
+ * face_barycenter --> barycentre of the face
+ * face_normal --> normal of the face (norm = face area)
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_face_quantity(cs_int_t n_face_vertices,
+ const cs_real_t face_vtx_coord[],
+ cs_real_t face_barycenter[],
+ cs_real_t face_normal[])
+{
+ cs_int_t i, coord;
+ cs_real_t v1[3], v2[3], tri_normal[3];
+
+ cs_real_t inv_n_face_vertices = 1/(double)n_face_vertices;
+
+ /* Initialization */
+
+ for (coord = 0; coord < 3; coord++) {
+ face_normal[coord] = 0.0;
+ face_barycenter[coord] = 0.0;
+ }
+
+ /* Compute face barycenter */
+
+ for (i = 0; i < n_face_vertices; i++)
+ for (coord = 0; coord < 3; coord++)
+ face_barycenter[coord] += face_vtx_coord[3*i+coord];
+
+ for (coord = 0; coord < 3; coord++)
+ face_barycenter[coord] *= inv_n_face_vertices;
+
+ /* Compute triangle normal and update face normal */
+
+ for (i = 0; i < n_face_vertices; i++) {
+
+ for (coord = 0; coord < 3; coord++) {
+ v1[coord] = face_vtx_coord[3*i + coord] - face_barycenter[coord];
+ v2[coord] = face_vtx_coord[3*(i+1) + coord] - face_barycenter[coord];
+ }
+
+ _cross_product(v1, v2, tri_normal);
+
+ for (coord = 0; coord < 3; coord++) {
+ tri_normal[coord] *= 0.5;
+ face_normal[coord] += tri_normal[coord];
+ }
+
+ }
+
+ _normalize(face_normal);
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Get the related global cell number for each old global face number
+ *
+ * parameters:
+ * n2o_hist <-- new -> old global face numbering
+ * join_select <-- list all local entities implied in the joining op.
+ * cell_gnum <-> global cell number related to each old face
+ *---------------------------------------------------------------------------*/
+
+static void
+_exchange_cell_gnum(const cs_join_gset_t *n2o_hist,
+ const cs_join_select_t *join_select,
+ fvm_gnum_t cell_gnum[])
+{
+ int i, j, rank, fid, shift;
+ fvm_gnum_t compact_fgnum;
+
+ int reduce_size = 0;
+ int *reduce_ids = NULL, *parent = NULL;
+ int *send_count = NULL, *recv_count = NULL;
+ int *send_shift = NULL, *recv_shift = NULL;
+ fvm_gnum_t *recv_gbuf = NULL, *send_gbuf = NULL, *reduce_index = NULL;
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int loc_rank = CS_MAX(cs_glob_rank_id, 0);
+ const fvm_gnum_t *gnum_rank_index = join_select->compact_rank_index;
+ const fvm_gnum_t loc_rank_s = join_select->compact_rank_index[loc_rank];
+ const fvm_gnum_t loc_rank_e = join_select->compact_rank_index[loc_rank+1];
+
+ /* Sanity checks */
+
+ assert(gnum_rank_index != NULL);
+ assert(n2o_hist != NULL);
+ assert(n_ranks > 1);
+
+ BFT_MALLOC(send_count, n_ranks, int);
+ BFT_MALLOC(send_shift, n_ranks + 1, int);
+
+ send_shift[0] = 0;
+ for (i = 0; i < n_ranks; i++) {
+ send_count[i] = 0;
+ send_shift[i+1] = 0;
+ }
+
+ /* Compact init. global face distribution. Remove ranks without face
+ at the begining */
+
+ for (i = 0; i < n_ranks; i++)
+ if (gnum_rank_index[i] < gnum_rank_index[i+1])
+ reduce_size++;
+
+ BFT_MALLOC(reduce_index, reduce_size+1, fvm_gnum_t);
+ BFT_MALLOC(reduce_ids, reduce_size, int);
+
+ reduce_size = 0;
+
+ /* Add +1 to gnum_rank_index because it's an id and we work on numbers */
+
+ reduce_index[0] = gnum_rank_index[0] + 1;
+ for (i = 0; i < n_ranks; i++) {
+ if (gnum_rank_index[i] < gnum_rank_index[i+1]) {
+ reduce_index[reduce_size+1] = gnum_rank_index[i+1] + 1;
+ reduce_ids[reduce_size++] = i;
+ }
+ }
+
+ /* Count number of ranks associated to each new face */
+
+ for (i = 0; i < n2o_hist->n_elts; i++) {
+
+ for (j = n2o_hist->index[i]; j < n2o_hist->index[i+1]; j++) {
+
+ int reduce_rank = cs_search_gindex_binary(reduce_size,
+ n2o_hist->g_list[j],
+ reduce_index);
+
+ assert(reduce_rank != -1);
+ assert(reduce_rank < reduce_size);
+
+ rank = reduce_ids[reduce_rank];
+ send_shift[rank+1] += 1;
+
+ } /* End of loop on old faces */
+
+ } /* End of loop on new faces */
+
+ for (i = 0; i < n_ranks; i++)
+ send_shift[i+1] += send_shift[i];
+
+ assert(send_shift[n_ranks] == n2o_hist->index[n2o_hist->n_elts]);
+
+ BFT_MALLOC(send_gbuf, send_shift[n_ranks], fvm_gnum_t);
+ BFT_MALLOC(parent, send_shift[n_ranks], int);
+
+ /* Fill the list of ranks */
+
+ for (i = 0; i < n2o_hist->n_elts; i++) {
+
+ for (j = n2o_hist->index[i]; j < n2o_hist->index[i+1]; j++) {
+
+ int reduce_rank = cs_search_gindex_binary(reduce_size,
+ n2o_hist->g_list[j],
+ reduce_index);
+
+ assert(reduce_rank != -1);
+ assert(reduce_rank < reduce_size);
+
+ rank = reduce_ids[reduce_rank];
+ shift = send_shift[rank] + send_count[rank];
+ parent[shift] = j;
+ send_gbuf[shift] = n2o_hist->g_list[j];
+ send_count[rank] += 1;
+
+ } /* End of loop on old faces */
+
+ } /* End of loop on new faces */
+
+ /* Free memory */
+
+ BFT_FREE(reduce_ids);
+ BFT_FREE(reduce_index);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n Exchange to update mesh after the face split operation:\n");
+ for (i = 0; i < n_ranks; i++) {
+ int start = send_shift[i], end = send_shift[i+1];
+ bft_printf(" Send to rank %5d (n = %10d):", i, end - start);
+ for (j = start; j < end; j++)
+ bft_printf(" %u ", send_gbuf[j]);
+ bft_printf("\n");
+ }
+#endif
+
+ /* Count the number of faces to recv */
+
+ BFT_MALLOC(recv_count, n_ranks, int);
+ BFT_MALLOC(recv_shift, n_ranks + 1, int);
+
+ /* Exchange number of elements to send */
+
+ MPI_Alltoall(send_count, 1, MPI_INT, recv_count, 1, MPI_INT, mpi_comm);
+
+ /* Build index arrays */
+
+ recv_shift[0] = 0;
+ for (rank = 0; rank < n_ranks; rank++)
+ recv_shift[rank+1] = recv_shift[rank] + recv_count[rank];
+
+ BFT_MALLOC(recv_gbuf, recv_shift[n_ranks], fvm_gnum_t);
+
+ MPI_Alltoallv(send_gbuf, send_count, send_shift, FVM_MPI_GNUM,
+ recv_gbuf, recv_count, recv_shift, FVM_MPI_GNUM, mpi_comm);
+
+ /* Get the related global cell number for each received face */
+
+ for (rank = 0; rank < n_ranks; rank++) {
+
+ for (i = recv_shift[rank]; i < recv_shift[rank+1]; i++) {
+
+ compact_fgnum = recv_gbuf[i];
+ fid = compact_fgnum - 1 - loc_rank_s;
+
+ assert(loc_rank_s < compact_fgnum);
+ assert(compact_fgnum <= loc_rank_e);
+
+ recv_gbuf[i] = join_select->cell_gnum[fid];
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Return values to send ranks */
+
+ MPI_Alltoallv(recv_gbuf, recv_count, recv_shift, FVM_MPI_GNUM,
+ send_gbuf, send_count, send_shift, FVM_MPI_GNUM, mpi_comm);
+
+ /* Define cell_gnum */
+
+ for (i = 0; i < send_shift[n_ranks]; i++)
+ cell_gnum[parent[i]] = send_gbuf[i];
+
+ /* Free memory */
+
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(send_gbuf);
+ BFT_FREE(recv_count);
+ BFT_FREE(recv_shift);
+ BFT_FREE(recv_gbuf);
+ BFT_FREE(parent);
+
+}
+
+#endif /* HAVE_MPI */
+
+/*----------------------------------------------------------------------------
+ * Get the related global cell numbers connected to the old face numbers.
+ *
+ * parameters:
+ * join_select <-- list of all implied entities in the joining op.
+ * n2o_face_hist <-- face history structure (new -> old)
+ * cell_gnum --> pointer to the created array
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_linked_cell_gnum(const cs_join_select_t *join_select,
+ const cs_join_gset_t *n2o_face_hist,
+ fvm_gnum_t *p_cell_gnum[])
+{
+ cs_int_t i, j;
+ fvm_gnum_t compact_fgnum;
+
+ fvm_gnum_t *cell_gnum = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ BFT_MALLOC(cell_gnum,
+ n2o_face_hist->index[n2o_face_hist->n_elts], fvm_gnum_t);
+
+ if (n_ranks == 1) {
+
+ for (i = 0; i < n2o_face_hist->n_elts; i++) {
+
+ for (j = n2o_face_hist->index[i]; j < n2o_face_hist->index[i+1]; j++) {
+ compact_fgnum = n2o_face_hist->g_list[j];
+ cell_gnum[j] = join_select->cell_gnum[compact_fgnum - 1];
+ }
+
+ } /* End of loop on n2o_face_hist elements */
+
+ }
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1)
+ _exchange_cell_gnum(n2o_face_hist,
+ join_select,
+ cell_gnum);
+#endif
+
+ /* Return pointer */
+
+ *p_cell_gnum = cell_gnum;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update mesh structure by adding new border faces after the face cutting
+ * and deleting old one.
+ *
+ * parameters:
+ * join_select <-- list of all implied entities in the joining op.
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * join2mesh_vtx_id <-- relation between vertices in join_mesh/mesh
+ * n_new_b_faces <-- local number of border faces after the joining
+ * new_face_type <-- type (border/interior) of new faces
+ * n2o_face_hist <-- face history structure (new -> old)
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_new_border_faces(const cs_join_select_t *join_select,
+ const cs_join_mesh_t *join_mesh,
+ const cs_int_t join2mesh_vtx_id[],
+ cs_int_t n_new_b_faces,
+ const cs_join_face_type_t new_face_type[],
+ const cs_join_gset_t *n2o_face_hist,
+ cs_mesh_t *mesh)
+{
+ cs_int_t i, j, select_id, vid, fid, shift, n_face_vertices;
+ fvm_gnum_t compact_old_fgnum;
+
+ cs_int_t n_ib_faces = mesh->n_b_faces, n_fb_faces = 0;
+ fvm_gnum_t n_g_ib_faces = mesh->n_g_b_faces;
+ cs_int_t *new_f2v_idx = NULL, *new_f2v_lst = NULL;
+ cs_int_t *new_face_family = NULL, *new_face_cells = NULL;
+ fvm_gnum_t *new_fgnum = NULL;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int rank = CS_MAX(cs_glob_rank_id, 0);
+ const fvm_gnum_t rank_start = join_select->compact_rank_index[rank] + 1;
+ const fvm_gnum_t rank_end = join_select->compact_rank_index[rank+1] + 1;
+
+ n_fb_faces = n_ib_faces + n_new_b_faces - join_select->n_faces;
+ mesh->n_b_faces = n_fb_faces;
+ mesh->n_g_b_faces = n_fb_faces;
+
+ BFT_MALLOC(new_f2v_idx, n_fb_faces + 1, cs_int_t);
+ BFT_MALLOC(new_face_cells, n_fb_faces, cs_int_t);
+ BFT_MALLOC(new_face_family, n_fb_faces, cs_int_t);
+
+ if (n_ranks > 1)
+ BFT_MALLOC(new_fgnum, n_fb_faces, fvm_gnum_t);
+
+ /* Delete faces included in join_selection. Add other initial faces.
+ - face -> vertex index
+ - face -> cells connectivity
+ - face family
+ - face global num. (first pass)
+ */
+
+ n_fb_faces = 0;
+ for (i = 0, select_id = 0; i < n_ib_faces; i++) {
+
+ cs_bool_t in_selection = false;
+
+ if (select_id < join_select->n_faces) {
+ if (i+1 == join_select->faces[select_id]) {
+ in_selection = true;
+ select_id++;
+ }
+ }
+
+ if (in_selection == false) {
+
+ if (n_ranks > 1)
+ new_fgnum[n_fb_faces] = mesh->global_b_face_num[i];
+
+ new_face_cells[n_fb_faces] = mesh->b_face_cells[i];
+ new_face_family[n_fb_faces] = mesh->b_face_family[i];
+
+ n_fb_faces++;
+ n_face_vertices = mesh->b_face_vtx_idx[i+1] - mesh->b_face_vtx_idx[i];
+ new_f2v_idx[n_fb_faces] = n_face_vertices;
+
+ }
+
+ }
+
+ assert(n_fb_faces == n_ib_faces - join_select->n_faces);
+
+ /* Add faces resulting from the joining operation */
+
+ if (n_new_b_faces > 0) {
+ for (i = 0; i < join_mesh->n_faces; i++) {
+ if (new_face_type[i] == CS_JOIN_FACE_BORDER) {
+
+ shift = n2o_face_hist->index[i];
+ compact_old_fgnum = n2o_face_hist->g_list[shift];
+
+ /* Initial selected border face must be in the selection */
+ assert(rank_start <= compact_old_fgnum);
+ assert(compact_old_fgnum < rank_end);
+
+ fid = join_select->faces[compact_old_fgnum - rank_start] - 1;
+
+ if (n_ranks > 1)
+ new_fgnum[n_fb_faces] = join_mesh->face_gnum[i] + n_g_ib_faces;
+
+ new_face_cells[n_fb_faces] = mesh->b_face_cells[fid];
+ new_face_family[n_fb_faces] = mesh->b_face_family[fid];
+
+ n_fb_faces++;
+ n_face_vertices =
+ join_mesh->face_vtx_idx[i+1] - join_mesh->face_vtx_idx[i];
+ new_f2v_idx[n_fb_faces] = n_face_vertices;
+
+ } /* If new border face */
+ }
+ } /* If n_new_b_faces > 0 */
+
+ assert(mesh->n_b_faces == n_fb_faces);
+
+ /* Build index */
+
+ new_f2v_idx[0] = 1;
+ for (i = 0; i < n_fb_faces; i++)
+ new_f2v_idx[i+1] += new_f2v_idx[i];
+
+ BFT_MALLOC(new_f2v_lst, new_f2v_idx[n_fb_faces]-1, cs_int_t);
+
+ /* Define the face -> vertex connectivity */
+
+ n_fb_faces = 0;
+ for (i = 0, select_id = 0; i < n_ib_faces; i++) {
+
+ cs_bool_t in_selection = false;
+
+ if (select_id < join_select->n_faces) {
+ if (i+1 == join_select->faces[select_id]) {
+ in_selection = true;
+ select_id++;
+ }
+ }
+
+ if (in_selection == false) {
+
+ shift = new_f2v_idx[n_fb_faces]-1;
+
+ for (j = mesh->b_face_vtx_idx[i]-1; j < mesh->b_face_vtx_idx[i+1]-1; j++)
+ new_f2v_lst[shift++] = mesh->b_face_vtx_lst[j];
+
+ n_fb_faces++;
+
+ }
+
+ }
+
+ if (n_new_b_faces > 0) {
+ for (i = 0; i < join_mesh->n_faces; i++) {
+ if (new_face_type[i] == CS_JOIN_FACE_BORDER) {
+
+ shift = new_f2v_idx[n_fb_faces] - 1;
+
+ for (j = join_mesh->face_vtx_idx[i]-1;
+ j < join_mesh->face_vtx_idx[i+1]-1; j++) {
+ vid = join_mesh->face_vtx_lst[j] - 1;
+ new_f2v_lst[shift++] = join2mesh_vtx_id[vid] + 1;
+ }
+
+ n_fb_faces++;
+
+ } /* If new border face */
+ }
+ } /* If n_new_b_faces > 0 */
+
+ if (n_ranks > 1) { /* Get a compact global face numbering */
+
+ fvm_io_num_t *new_io_num = fvm_io_num_create(NULL,
+ new_fgnum,
+ n_fb_faces,
+ 0); /* Not shared */
+
+ const fvm_gnum_t *new_io_gnum = fvm_io_num_get_global_num(new_io_num);
+
+ mesh->n_g_b_faces = fvm_io_num_get_global_count(new_io_num);
+
+ for (i = 0; i < n_fb_faces; i++)
+ new_fgnum[i] = new_io_gnum[i];
+
+ fvm_io_num_destroy(new_io_num);
+
+ BFT_FREE(mesh->global_b_face_num);
+ mesh->global_b_face_num = new_fgnum;
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(mesh->b_face_vtx_idx);
+ BFT_FREE(mesh->b_face_vtx_lst);
+ BFT_FREE(mesh->b_face_cells);
+ BFT_FREE(mesh->b_face_family);
+
+ /* Update structure */
+
+ mesh->b_face_vtx_idx = new_f2v_idx;
+ mesh->b_face_vtx_lst = new_f2v_lst;
+ mesh->b_face_cells = new_face_cells;
+ mesh->b_face_family = new_face_family;
+ mesh->b_face_vtx_connect_size = new_f2v_idx[n_fb_faces]-1;
+}
+
+/*----------------------------------------------------------------------------
+ * Update mesh structure by adding new interior faces after the face split.
+ *
+ * parameters:
+ * join_select <-- list of all implied entities in the joining op.
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * join2mesh_vtx_id <-- relation between vertices in join_mesh/mesh
+ * cell_gnum <-- global cell num. related to each initial face
+ * n_new_i_faces <-- local number of interior faces after the joining
+ * default_family <-- default family num to assign to each int. faces
+ * new_face_type <-- type (border/interior) of new faces
+ * n2o_face_hist <-- face history structure (new -> old)
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_new_interior_faces(const cs_join_select_t *join_select,
+ const cs_join_mesh_t *join_mesh,
+ const cs_int_t join2mesh_vtx_id[],
+ const fvm_gnum_t cell_gnum[],
+ cs_int_t n_new_i_faces,
+ cs_int_t default_family,
+ const cs_join_face_type_t new_face_type[],
+ const cs_join_gset_t *n2o_face_hist,
+ cs_mesh_t *mesh)
+{
+ cs_int_t i, j, k, vid, shift, n_face_vertices, fid[2];
+ fvm_gnum_t compact_fgnum, cgnum[2];
+
+ cs_int_t n_fi_faces = 0, n_ii_faces = mesh->n_i_faces;
+ cs_int_t *new_f2v_idx = mesh->i_face_vtx_idx;
+ cs_int_t *new_f2v_lst = mesh->i_face_vtx_lst;
+ cs_int_t *new_face_family = mesh->i_face_family;
+ cs_int_t *new_face_cells = mesh->i_face_cells;
+ fvm_gnum_t n_g_ii_faces = mesh->n_g_i_faces;
+ fvm_gnum_t *new_fgnum = mesh->global_i_face_num;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int rank = CS_MAX(cs_glob_rank_id, 0);
+ const fvm_gnum_t loc_rank_s = join_select->compact_rank_index[rank];
+ const fvm_gnum_t loc_rank_e = join_select->compact_rank_index[rank+1];
+
+ n_fi_faces = n_ii_faces + n_new_i_faces;
+ mesh->n_i_faces = n_fi_faces;
+ mesh->n_g_i_faces = n_fi_faces;
+
+ BFT_REALLOC(new_f2v_idx, n_fi_faces + 1, cs_int_t);
+ BFT_REALLOC(new_face_cells, 2*n_fi_faces, cs_int_t);
+ BFT_REALLOC(new_face_family, n_fi_faces, cs_int_t);
+
+ /* Add faces resulting from the joining operation
+ - face -> vertex index
+ - face -> cells connectivity
+ - face family
+ */
+
+ n_fi_faces = n_ii_faces;
+ for (i = 0; i < join_mesh->n_faces; i++) {
+
+ if (new_face_type[i] == CS_JOIN_FACE_INTERIOR) {
+
+ for (j = n2o_face_hist->index[i], k = 0;
+ j < n2o_face_hist->index[i+1]; j++, k++) {
+
+ cgnum[k] = cell_gnum[j];
+ compact_fgnum = n2o_face_hist->g_list[j];
+
+ if (loc_rank_s < compact_fgnum && compact_fgnum <= loc_rank_e)
+ fid[k] = join_select->faces[compact_fgnum - loc_rank_s - 1] - 1;
+ else
+ fid[k] = -1;
+
+ }
+
+ if (cgnum[0] < cgnum[1]) { /* Keep the same order */
+
+ if (fid[0] > -1)
+ new_face_cells[2*n_fi_faces] = mesh->b_face_cells[fid[0]];
+ else
+ new_face_cells[2*n_fi_faces] = 0; /* Cell is on a distant rank */
+
+ if (fid[1] > -1)
+ new_face_cells[2*n_fi_faces+1] = mesh->b_face_cells[fid[1]];
+ else
+ new_face_cells[2*n_fi_faces+1] = 0; /* Cell is on a distant rank */
+
+ }
+ else {
+
+ if (fid[0] > -1)
+ new_face_cells[2*n_fi_faces+1] = mesh->b_face_cells[fid[0]];
+ else
+ new_face_cells[2*n_fi_faces+1] = 0; /* Cell is on a distant rank */
+
+ if (fid[1] > -1)
+ new_face_cells[2*n_fi_faces] = mesh->b_face_cells[fid[1]];
+ else
+ new_face_cells[2*n_fi_faces] = 0; /* Cell is on a distant rank */
+
+ }
+
+ new_face_family[n_fi_faces] = default_family; /* Default value.
+ TODO: Define real family
+ */
+
+ n_fi_faces++;
+ n_face_vertices = join_mesh->face_vtx_idx[i+1]-join_mesh->face_vtx_idx[i];
+ new_f2v_idx[n_fi_faces] = n_face_vertices;
+
+ }
+
+ } /* End of loop on join_mesh faces */
+
+ assert(mesh->n_i_faces == n_fi_faces);
+
+ /* Build index */
+
+ for (i = n_ii_faces; i < n_fi_faces; i++)
+ new_f2v_idx[i+1] += new_f2v_idx[i];
+
+ BFT_REALLOC(new_f2v_lst, new_f2v_idx[n_fi_faces]-1, cs_int_t);
+
+ /* Define the face -> vertex connectivity list */
+
+ n_fi_faces = n_ii_faces;
+ for (i = 0; i < join_mesh->n_faces; i++) {
+ if (new_face_type[i] == CS_JOIN_FACE_INTERIOR) {
+
+ shift = new_f2v_idx[n_fi_faces]-1;
+
+ for (j = join_mesh->face_vtx_idx[i]-1;
+ j < join_mesh->face_vtx_idx[i+1]-1; j++) {
+ vid = join_mesh->face_vtx_lst[j]-1;
+ new_f2v_lst[shift++] = join2mesh_vtx_id[vid] + 1;
+ }
+ n_fi_faces++;
+
+ }
+ }
+
+ if (n_ranks > 1) { /* Get a compact global face numbering */
+
+ fvm_io_num_t *new_io_num = NULL;
+ const fvm_gnum_t *new_io_gnum = NULL;
+
+ BFT_REALLOC(new_fgnum, mesh->n_i_faces, fvm_gnum_t);
+
+ n_fi_faces = n_ii_faces;
+ for (i = 0; i < join_mesh->n_faces; i++)
+ if (new_face_type[i] == CS_JOIN_FACE_INTERIOR)
+ new_fgnum[n_fi_faces++] = join_mesh->face_gnum[i] + n_g_ii_faces;
+
+ new_io_num = fvm_io_num_create(NULL, new_fgnum, n_fi_faces, 0);
+ new_io_gnum = fvm_io_num_get_global_num(new_io_num);
+ mesh->n_g_i_faces = fvm_io_num_get_global_count(new_io_num);
+
+ for (i = 0; i < n_fi_faces; i++)
+ new_fgnum[i] = new_io_gnum[i];
+
+ fvm_io_num_destroy(new_io_num);
+
+ }
+
+ /* Update structure */
+
+ mesh->i_face_vtx_idx = new_f2v_idx;
+ mesh->i_face_vtx_lst = new_f2v_lst;
+ mesh->global_i_face_num = new_fgnum;
+ mesh->i_face_cells = new_face_cells;
+ mesh->i_face_family = new_face_family;
+ mesh->i_face_vtx_connect_size = new_f2v_idx[n_fi_faces]-1;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the family number to assign by default to the interior faces.
+ *
+ * parameters:
+ * mesh <-> pointer to cs_mesh_t structure
+ *
+ * returns:
+ * the value of the default family number.
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t
+_get_default_family(cs_mesh_t *mesh)
+{
+ int i, j, n_grp, grp_num, grp_idx, n_colors, new_size;
+
+ char **groups = NULL;
+ int *colors = NULL, *items = NULL;
+ int default_family = -1;
+
+ BFT_MALLOC(groups, mesh->n_max_family_items, char*);
+ BFT_MALLOC(colors, mesh->n_max_family_items, int);
+
+ for (i = 0; i < mesh->n_families; i++) {
+
+ n_colors = 0;
+ n_grp = 0;
+
+ for (j = 0; j < mesh->n_max_family_items; j++) {
+
+ if (mesh->family_item[j * mesh->n_families + i] > 0)
+ colors[n_colors++] = mesh->family_item[j * mesh->n_families + i];
+
+ else if (mesh->family_item[j * cs_glob_mesh->n_families + i] < 0) {
+ grp_num = -mesh->family_item[j * mesh->n_families + i] - 1;
+ grp_idx = mesh->group_idx[grp_num];
+ groups[n_grp++] = mesh->group_lst + grp_idx -1;
+ }
+
+ }
+
+ if (n_grp == 0 && n_colors == 0)
+ default_family = i+1;
+
+ } /* End of loop on families */
+
+ BFT_FREE(groups);
+ BFT_FREE(colors);
+
+ if (default_family == -1) { /* Add a new family */
+
+ mesh->n_families += 1;
+ default_family = mesh->n_families;
+
+ new_size = mesh->n_max_family_items *mesh->n_families;
+ BFT_MALLOC(items, new_size, cs_int_t);
+
+ for (i = 0; i < mesh->n_families - 1; i++)
+ for (j = 0; j < mesh->n_max_family_items; j++)
+ items[j * mesh->n_families + i] =
+ mesh->family_item[j * mesh->n_families + i];
+
+ for (j = 0; j < mesh->n_max_family_items; j++)
+ items[j * (mesh->n_families-1) + (mesh->n_families-1)] = 0;
+
+ BFT_FREE(mesh->family_item);
+ mesh->family_item = items;
+
+ }
+
+ return default_family;
+}
+
+/*----------------------------------------------------------------------------
+ * Re-orientation of joined faces. Check and correct if needed.
+ *
+ * parameters:
+ * mesh <-- pointer to cs_mesh_t structure
+ * n_old_i_faces <-- initial number of interior faces
+ * n_old_b_faces <-- initial number of border faces
+ * n_select_cells <-- number of cells in the selection
+ * cell_selection <-- selection array (size: mesh->n_cells)
+ * select_cell_cen --> cell center for the selected cells
+ *---------------------------------------------------------------------------*/
+
+static void
+_reorient_faces(cs_mesh_t *mesh,
+ cs_int_t n_old_i_faces,
+ cs_int_t n_old_b_faces,
+ cs_int_t n_select_cells,
+ const cs_int_t cell_selection[],
+ cs_real_t select_cell_cen[])
+{
+ cs_int_t i, j, k, shift, s, e, vid, cid1, cid2, n_face_vertices;
+ cs_real_t dot_prod;
+
+ cs_int_t max_connect = 0;
+ cs_int_t *face_connect = NULL;
+ cs_real_t face_barycenter[3], face_normal[3], vect[3];
+ cs_real_t *face_vtx_coord = NULL;
+
+ /* Remark:
+ n_select_cells == join_select->n_faces (see _get_select_cell_cen() ) */
+
+ /* Compute max face -> vertex connect. */
+
+ for (i = n_old_b_faces - n_select_cells; i < mesh->n_b_faces; i++)
+ max_connect = CS_MAX(max_connect,
+ mesh->b_face_vtx_idx[i+1] - mesh->b_face_vtx_idx[i]);
+
+ for (i = n_old_i_faces; i < mesh->n_i_faces; i++)
+ max_connect = CS_MAX(max_connect,
+ mesh->i_face_vtx_idx[i+1] - mesh->i_face_vtx_idx[i]);
+
+ BFT_MALLOC(face_vtx_coord, 3*(max_connect+1), cs_real_t);
+ BFT_MALLOC(face_connect, max_connect, cs_int_t);
+
+ /* Border faces */
+
+ for (i = n_old_b_faces - n_select_cells; i < mesh->n_b_faces; i++) {
+
+ /* Define face_vtx_coord */
+
+ s = mesh->b_face_vtx_idx[i] - 1;
+ e = mesh->b_face_vtx_idx[i+1] - 1;
+ n_face_vertices = e - s;
+ shift = 0;
+
+ for (j = s; j < e; j++) {
+
+ vid = mesh->b_face_vtx_lst[j] - 1;
+ face_connect[shift] = vid + 1;
+ for (k = 0; k < 3; k++)
+ face_vtx_coord[3*shift+k] = mesh->vtx_coord[3*vid+k];
+ shift++;
+
+ }
+
+ vid = mesh->b_face_vtx_lst[s] - 1;
+ for (k = 0; k < 3; k++)
+ face_vtx_coord[3*shift+k] = mesh->vtx_coord[3*vid+k];
+
+ /* Compute face barycenter and face normal */
+
+ _get_face_quantity(n_face_vertices,
+ face_vtx_coord,
+ face_barycenter,
+ face_normal); // unitary
+
+ /* Cb: cell barycenter
+ Fb: face barycenter
+ Nf: face normal
+ ---> ->
+ Good orientation if CbFb . Nf > 0
+ Else if reorientation is required.
+ */
+
+ cid1 = mesh->b_face_cells[i] - 1;
+ assert(cid1 > -1);
+ cid1 = cell_selection[cid1];
+ assert(cid1 > -1);
+
+ for (k = 0; k < 3; k++)
+ vect[k] = face_barycenter[k] - select_cell_cen[3*cid1+k];
+
+ _normalize(vect);
+ dot_prod = _dot_product(vect, face_normal);
+
+ if (dot_prod < 0.0)
+ for (j = s, k = n_face_vertices-1; j < e; j++, k--)
+ mesh->b_face_vtx_lst[j] = face_connect[k];
+
+ } /* End of loop on border faces */
+
+ /* Interior faces */
+
+ for (i = n_old_i_faces; i < mesh->n_i_faces; i++) {
+
+ /* Define face_vtx_coord */
+
+ s = mesh->i_face_vtx_idx[i] - 1;
+ e = mesh->i_face_vtx_idx[i+1] - 1;
+ n_face_vertices = e - s;
+ shift = 0;
+
+ for (j = s; j < e; j++) {
+
+ vid = mesh->i_face_vtx_lst[j] - 1;
+ face_connect[shift] = vid + 1;
+ for (k = 0; k < 3; k++)
+ face_vtx_coord[3*shift+k] = mesh->vtx_coord[3*vid+k];
+ shift++;
+
+ }
+
+ vid = mesh->i_face_vtx_lst[s] - 1;
+ for (k = 0; k < 3; k++)
+ face_vtx_coord[3*shift+k] = mesh->vtx_coord[3*vid+k];
+
+ /* Compute face barycenter and face normal */
+
+ _get_face_quantity(n_face_vertices,
+ face_vtx_coord,
+ face_barycenter,
+ face_normal);
+
+ /* Cb1: cell barycenter for cell 1
+ Cb2: cell barycenter for cell 2
+ Fb : face barycenter
+ Nf : face normal
+
+ if only Cb1 is available:
+ ----> ->
+ Good orientation if Cb1Fb . Nf > 0
+
+ else:
+ -----> ->
+ Good orientation if Cb1Cb2 . Nf > 0
+ */
+
+ /* If we are on a parallel frontier: i_face_cell[] = 0 */
+
+ cid1 = mesh->i_face_cells[2*i] - 1;
+ cid2 = mesh->i_face_cells[2*i+1] - 1;
+
+ if (cid1 > -1)
+ cid1 = cell_selection[cid1];
+ if (cid2 > -1)
+ cid2 = cell_selection[cid2];
+
+ if (cid2 < 0) { /* Parallel frontier. cid2 not available */
+
+ assert(cs_glob_n_ranks > 1);
+
+ for (k = 0; k < 3; k++)
+ vect[k] = face_barycenter[k] - select_cell_cen[3*cid1+k];
+
+ _normalize(vect);
+ dot_prod = _dot_product(vect, face_normal);
+
+ }
+ else if (cid1 < 0) {
+
+ assert(cs_glob_n_ranks > 1);
+
+ for (k = 0; k < 3; k++)
+ vect[k] = select_cell_cen[3*cid2+k] - face_barycenter[k];
+
+ _normalize(vect);
+ dot_prod = _dot_product(vect, face_normal);
+
+ }
+ else {
+
+ for (k = 0; k < 3; k++)
+ vect[k] = select_cell_cen[3*cid2+k] - select_cell_cen[3*cid1+k];
+
+ _normalize(vect);
+ dot_prod = _dot_product(vect, face_normal);
+
+
+ }
+
+ if (dot_prod < 0.0) /* Re-orient */
+ for (j = s, k = n_face_vertices-1; j < e; j++, k--)
+ mesh->i_face_vtx_lst[j] = face_connect[k];
+
+ } /* End of loop on interior faces */
+
+ /* Free memory */
+
+ BFT_FREE(face_vtx_coord);
+ BFT_FREE(face_connect);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Define a new face connectivty without redundant edge definition.
+ *
+ * parameters:
+ * s <-- starting index in f2v_lst
+ * e <-- ending index in f2v_lst
+ * f2v_lst <-- face -> vertex connectivity list
+ * connect --> buffer to store locally the new face connectivity
+ * kill --> buffer to store vertex to delete from the connectivity
+ *
+ * returns:
+ * new number of vertices in the face connectivity.
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t
+_delete_edges(cs_int_t s,
+ cs_int_t e,
+ const cs_int_t f2v_lst[],
+ cs_int_t connect[],
+ cs_int_t kill[])
+{
+ cs_int_t j, k, shift, count;
+
+ cs_int_t connect_size = e - s;
+
+ /* Define local connectivity */
+
+ for (j = s, k = 0; j < e; j++, k++)
+ kill[k] = 0, connect[k] = f2v_lst[j];
+
+ connect[k] = f2v_lst[s], kill[k++] = 0;
+ connect[k] = f2v_lst[s+1], kill[k++] = 0;
+
+ /* Find degenerate edges */
+
+ count = 1;
+ while (count > 0) {
+
+ count = 0;
+ for (j = 0; j < connect_size; j++) {
+ if (connect[j] == connect[j+2]) {
+ count++;
+ kill[j] = 1;
+ kill[(j+1) % connect_size] = 1;
+ }
+ }
+
+ shift = 0;
+ for (j = 0; j < connect_size; j++)
+ if (kill[j] == 0)
+ connect[shift++] = connect[j];
+
+ connect_size = shift;
+ connect[shift++] = connect[0];
+ connect[shift++] = connect[1];
+
+ for (j = 0; j < connect_size + 2; j++)
+ kill[j] = 0;
+
+ } /* End of while */
+
+ /* Find empty edges */
+
+ count = 1;
+ while (count > 0) {
+
+ count = 0;
+ for (j = 0; j < connect_size; j++) {
+ if (connect[j] == connect[j+1]) {
+ count++;
+ kill[(j+1) % connect_size] = 1;
+ }
+ }
+
+ shift = 0;
+ for (j = 0; j < connect_size; j++)
+ if (kill[j] == 0)
+ connect[shift++] = connect[j];
+
+ connect_size = shift;
+ connect[shift++] = connect[0];
+
+ for (j = 0; j < connect_size + 1; j++)
+ kill[j] = 0;
+
+ } /* End of while */
+
+ return connect_size;
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update mesh structure (vertices + faces) after the merge step.
+ *
+ * parameters:
+ * join_param <-- set of parameters for the joining operation
+ * join_select <-- list of all implied entities in the joining op.
+ * o2n_vtx_gnum <-> in : array on blocks on the new global vertex
+ * out: local array on the new global vertex
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_update_mesh_after_merge(cs_join_param_t join_param,
+ const cs_join_select_t *join_select,
+ fvm_gnum_t o2n_vtx_gnum[],
+ cs_join_mesh_t *join_mesh,
+ cs_mesh_t *mesh)
+{
+ cs_int_t i, j, shift, select_id, adj_id, old_id, new_num;
+
+ cs_int_t *o2n_vtx_id = NULL, *join2mesh_vtx_id = NULL;
+ edge_builder_t *edge_builder = NULL;
+
+ const cs_int_t n_bm_vertices = mesh->n_vertices; /* bf: before merge */
+ const cs_int_t n_ranks = cs_glob_n_ranks;
+
+ edge_builder = _init_edge_builder(join_select, mesh);
+
+ /* Build an array keeping relation between old/new global vertex num. */
+
+ if (n_ranks == 1) {
+
+ fvm_gnum_t *loc_vtx_gnum = NULL;
+
+ BFT_MALLOC(loc_vtx_gnum, n_bm_vertices, fvm_gnum_t);
+
+ /* Initialize array */
+
+ for (i = 0; i < n_bm_vertices; i++)
+ loc_vtx_gnum[i] = i+1;
+
+ /* Update value for selected vertices */
+
+ for (i = 0, shift = 0;
+ i < n_bm_vertices && shift < join_select->n_vertices; i++) {
+ if (i + 1 == join_select->vertices[shift])
+ loc_vtx_gnum[i] = o2n_vtx_gnum[shift++];
+ }
+
+ BFT_FREE(o2n_vtx_gnum);
+ o2n_vtx_gnum = loc_vtx_gnum;
+
+ } /* End if serial mode */
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1)
+ _get_local_o2n_vtx_gnum(mesh, &o2n_vtx_gnum);
+#endif
+
+ /* Update mesh structure. Define new vertices */
+
+ _update_vertices_after_merge
+ (o2n_vtx_gnum,
+ join_mesh,
+ mesh,
+ &join2mesh_vtx_id, /* size: join_mesh->n_vertices */
+ &o2n_vtx_id); /* size: n_bm_vertices */
+
+ /* Define the evolution of each initial edge in edge_builder_t struct. */
+
+ _complete_edge_builder(join_select,
+ join_mesh,
+ mesh,
+ o2n_vtx_gnum,
+ join2mesh_vtx_id,
+ edge_builder);
+
+ BFT_FREE(o2n_vtx_gnum); /* Not useful after this point */
+
+#if defined(HAVE_MPI)
+ if (join_select->do_single_sync == true) {
+
+ _sync_single_vertices(join_select,
+ o2n_vtx_id,
+ mesh);
+
+ _sync_single_edges(join_select,
+ n_bm_vertices,
+ o2n_vtx_id,
+ join_mesh->n_vertices,
+ join2mesh_vtx_id,
+ edge_builder,
+ mesh);
+
+ }
+#endif
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* Dump the structure */
+ if (join_param.verbosity > 2) {
+ int k;
+
+ bft_printf("\n Dump edge_builder_t structure (%p)\n", edge_builder);
+
+ if (edge_builder != NULL) {
+ bft_printf(" n_vertices: %10d\n"
+ " n_edges : %10d\n",
+ edge_builder->n_vertices, edge_builder->n_edges);
+
+ for (i = 0; i < mesh->n_vertices; i++) {
+
+ bft_printf("%9d - [%10.4f %10.4f %10.4f]: (%d, %d) v-v:",
+ i+1, mesh->vtx_coord[3*i], mesh->vtx_coord[3*i+1],
+ mesh->vtx_coord[3*i+2], edge_builder->v2v_idx[i],
+ edge_builder->v2v_idx[i+1]);
+
+ for (j = edge_builder->v2v_idx[i]; j < edge_builder->v2v_idx[i+1]; j++) {
+ bft_printf(" %d (", edge_builder->v2v_lst[j]);
+ for (k = edge_builder->v2v_sub_idx[j];
+ k < edge_builder->v2v_sub_idx[j+1]; k++)
+ bft_printf("%d ", edge_builder->v2v_sub_lst[k]);
+ bft_printf(") ");
+ }
+ bft_printf("\n");
+
+ }
+ bft_printf_flush();
+ }
+
+ }
+#endif
+
+ /* Update connectivity for the selected faces */
+
+ _update_selected_face_connect(join_select,
+ join_mesh,
+ join2mesh_vtx_id,
+ mesh->n_b_faces,
+ &(mesh->b_face_vtx_idx),
+ &(mesh->b_face_vtx_lst));
+
+ /* Update adjacent border face connectivity */
+
+ _update_adj_face_connect(join_select->n_b_adj_faces,
+ join_select->b_adj_faces,
+ edge_builder,
+ o2n_vtx_id,
+ mesh->n_b_faces,
+ &(mesh->b_face_vtx_idx),
+ &(mesh->b_face_vtx_lst));
+
+ /* Update adjacent interior face connectivity */
+
+ _update_adj_face_connect(join_select->n_i_adj_faces,
+ join_select->i_adj_faces,
+ edge_builder,
+ o2n_vtx_id,
+ mesh->n_i_faces,
+ &(mesh->i_face_vtx_idx),
+ &(mesh->i_face_vtx_lst));
+
+ /* Free memory */
+
+ BFT_FREE(edge_builder->v2v_idx);
+ BFT_FREE(edge_builder->v2v_lst);
+ BFT_FREE(edge_builder->v2v_sub_idx);
+ BFT_FREE(edge_builder->v2v_sub_lst);
+ BFT_FREE(edge_builder);
+
+ /* Update initial face connectivity for the remaining faces */
+
+ for (i = 0, select_id = 0, adj_id = 0; i < mesh->n_b_faces; i++) {
+
+ cs_bool_t do_update = true;
+
+ if (select_id < join_select->n_faces) {
+ if (i+1 == join_select->faces[select_id]) {
+ do_update = false; /* Already done */
+ select_id++;
+ }
+ }
+
+ if (adj_id < join_select->n_b_adj_faces) {
+ if (i+1 == join_select->b_adj_faces[adj_id]) {
+ do_update = false; /* Already done */
+ adj_id++;
+ }
+ }
+
+ if (do_update == true) {
+
+ for (j = mesh->b_face_vtx_idx[i]-1;
+ j < mesh->b_face_vtx_idx[i+1]-1; j++) {
+
+ old_id = mesh->b_face_vtx_lst[j] - 1;
+ new_num = o2n_vtx_id[old_id] + 1;
+ mesh->b_face_vtx_lst[j] = new_num;
+
+ }
+
+ }
+
+ } /* End of loop on border faces */
+
+ for (i = 0, adj_id = 0; i < mesh->n_i_faces; i++) {
+
+ cs_bool_t do_update = true;
+
+ if (adj_id < join_select->n_i_adj_faces) {
+ if (i+1 == join_select->i_adj_faces[adj_id]) {
+ do_update = false; /* Already done */
+ adj_id++;
+ }
+ }
+
+ if (do_update == true) {
+
+ for (j = mesh->i_face_vtx_idx[i]-1;
+ j < mesh->i_face_vtx_idx[i+1]-1; j++) {
+
+ old_id = mesh->i_face_vtx_lst[j] - 1;
+ new_num = o2n_vtx_id[old_id] + 1;
+ mesh->i_face_vtx_lst[j] = new_num;
+
+ }
+
+ }
+
+ } /* End of loop on interior faces */
+
+ /* Update the cs_join_select_t structure */
+
+ for (i = 0; i < join_select->n_vertices; i++) {
+
+ old_id = join_select->vertices[i] - 1;
+ new_num = o2n_vtx_id[old_id] + 1;
+ join_select->vertices[i] = new_num;
+
+ }
+
+ /* Post if required */
+
+ if (join_param.verbosity > 2)
+ cs_join_post_after_merge(join_param, join_select);
+
+ /* Free memory */
+
+ BFT_FREE(join2mesh_vtx_id);
+ BFT_FREE(o2n_vtx_id);
+}
+
+/*----------------------------------------------------------------------------
+ * Update mesh structure (vertices + faces) after the face split step.
+ *
+ * parameters:
+ * join_param <-- set of parameters for the joining operation
+ * join_select <-- list of all implied entities in the joining op.
+ * o2n_face_hist <-- relation between faces before/after the joining
+ * join_mesh <-- pointer to the local cs_join_mesh_t structure
+ * mesh <-> pointer of pointer to cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_update_mesh_after_split(cs_join_param_t join_param,
+ const cs_join_select_t *join_select,
+ const cs_join_gset_t *o2n_face_hist,
+ const cs_join_mesh_t *join_mesh,
+ cs_mesh_t *mesh)
+{
+ int i, n_matches, default_family;
+
+ fvm_gnum_t n_g_new_b_faces = 0;
+ cs_int_t n_new_i_faces = 0, n_new_b_faces = 0;
+ cs_int_t n_old_i_faces = mesh->n_i_faces;
+ cs_int_t n_old_b_faces = mesh->n_b_faces;
+ cs_int_t *join2mesh_vtx_id = NULL;
+ fvm_gnum_t *cell_gnum = NULL;
+ cs_join_face_type_t *new_face_type = NULL;
+ cs_join_gset_t *n2o_face_hist = NULL;
+ cs_int_t n_select_cells = join_select->n_faces; /* because border faces */
+ cs_int_t *cell_selection = join_select->cell_filter;
+ cs_real_t *select_cell_cen = join_select->cell_cen;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ assert(mesh != NULL);
+
+ /* Invert face historic */
+
+ n2o_face_hist = cs_join_gset_invert(o2n_face_hist);
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) {
+
+ cs_join_gset_t *n2o_sync_block = NULL;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ n2o_sync_block = cs_join_gset_sync_by_block(join_mesh->n_g_faces,
+ n2o_face_hist,
+ mpi_comm);
+
+ cs_join_gset_update_from_block(join_mesh->n_g_faces,
+ n2o_sync_block,
+ n2o_face_hist,
+ mpi_comm);
+
+ cs_join_gset_destroy(&n2o_sync_block);
+
+ }
+#endif
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (join_param.verbosity > 3) { /* Full dump of structures */
+
+ int len;
+ FILE *dbg_file = NULL;
+ char *filename = NULL;
+
+ len = strlen("JoinDBG_n2oFaceHist.dat")+1+2+4;
+ BFT_MALLOC(filename, len, char);
+ sprintf(filename, "Join%02dDBG_n2oFaceHist%04d.dat",
+ join_param.num, CS_MAX(cs_glob_rank_id, 0));
+ dbg_file = fopen(filename, "w");
+
+ cs_join_gset_dump(dbg_file, n2o_face_hist);
+
+ fflush(dbg_file);
+ BFT_FREE(filename);
+ fclose(dbg_file);
+
+ }
+#endif
+
+ /* Get new subfaces evolution */
+
+ assert(n2o_face_hist->n_elts == join_mesh->n_faces);
+ BFT_MALLOC(new_face_type, join_mesh->n_faces, cs_join_face_type_t);
+
+ for (i = 0; i < join_mesh->n_faces; i++) {
+
+ assert(join_mesh->face_gnum[i] == n2o_face_hist->g_elts[i]);
+
+ n_matches = n2o_face_hist->index[i+1] - n2o_face_hist->index[i];
+
+ if (n_matches == 1) {
+ n_new_b_faces += 1;
+ new_face_type[i] = CS_JOIN_FACE_BORDER;
+ }
+ else if (n_matches == 2) {
+ n_new_i_faces += 1;
+ new_face_type[i] = CS_JOIN_FACE_INTERIOR;
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Incompatible new face type found.\n"
+ " n_matches is not to 1 or 2: n_matches = %d\n"),
+ n_matches);
+
+ }
+
+ if (join_param.verbosity > 0)
+ bft_printf(_("\n Local configuration after the joining operation:\n"
+ " Number of interior faces to add: %9d\n"
+ " Number of border faces to add : %9d\n"),
+ n_new_i_faces, n_new_b_faces);
+
+ if (n_ranks == 1)
+ n_g_new_b_faces = n_new_b_faces;
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) {
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ MPI_Allreduce(&n_new_b_faces, &n_g_new_b_faces, 1, FVM_MPI_GNUM,
+ MPI_SUM, mpi_comm);
+
+ if (cs_glob_rank_id <= 0)
+ bft_printf(_("\n Global configuration after the joining operation:\n"
+ " Global number of border faces to add : %10u\n"),
+ n_g_new_b_faces);
+
+ }
+#endif
+
+ /* Get the family number to assign by default to the interior faces */
+
+ default_family = _get_default_family(mesh);
+
+ if (join_param.verbosity > 1)
+ bft_printf("\n Default family for interior joined faces: %d\n",
+ default_family);
+
+ /* Define join2mesh_vtx_id and add new vertices (only in parallel mode)
+ These vertices already exist but only on other ranks. During the face
+ cutting op., these vertices are used to define the new face connect. */
+
+ _update_vertices_after_split(join_mesh, mesh, &join2mesh_vtx_id);
+
+ /* Get associated global cell number */
+
+ _get_linked_cell_gnum(join_select, n2o_face_hist, &cell_gnum);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n List of linked global cell number\n");
+ for (i = 0; i < n2o_face_hist->index[n2o_face_hist->n_elts]; i++)
+ bft_printf(" %9d - %10u - %10u\n",
+ i, n2o_face_hist->g_list[i], cell_gnum[i]);
+ bft_printf_flush();
+#endif
+
+ /* Update mesh structure:
+ - Update first the interior faces because we need the global
+ numbering of the initial border faces
+ - Then update border faces
+ */
+
+ _add_new_interior_faces(join_select,
+ join_mesh,
+ join2mesh_vtx_id,
+ cell_gnum,
+ n_new_i_faces,
+ default_family,
+ new_face_type,
+ n2o_face_hist,
+ mesh);
+
+ _add_new_border_faces(join_select,
+ join_mesh,
+ join2mesh_vtx_id,
+ n_new_b_faces,
+ new_face_type,
+ n2o_face_hist,
+ mesh);
+
+ /* Re-orientaton of joined faces if needed */
+
+ _reorient_faces(mesh,
+ n_old_i_faces,
+ n_old_b_faces,
+ n_select_cells,
+ cell_selection,
+ select_cell_cen);
+
+ /* Update global vertex information */
+
+ if (n_ranks == 1) {
+ mesh->n_g_vertices = mesh->n_vertices;
+ BFT_FREE(mesh->global_vtx_num);
+ }
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) { /* Define a new compact global vertex numbering */
+
+ fvm_io_num_t *vtx_io_num = fvm_io_num_create(NULL,
+ mesh->global_vtx_num,
+ mesh->n_vertices,
+ 0); /* Not shared */
+ const fvm_gnum_t n_g_io_num = fvm_io_num_get_global_count(vtx_io_num);
+ const fvm_gnum_t *io_gnum = fvm_io_num_get_global_num(vtx_io_num);
+
+ mesh->n_g_vertices = n_g_io_num;
+
+ for (i = 0; i < mesh->n_vertices; i++)
+ mesh->global_vtx_num[i] = io_gnum[i];
+
+ fvm_io_num_destroy(vtx_io_num);
+
+ }
+#endif
+
+ /* Free memory */
+
+ BFT_FREE(new_face_type);
+ BFT_FREE(cell_gnum);
+ BFT_FREE(join2mesh_vtx_id);
+
+ cs_join_gset_destroy(&n2o_face_hist);
+
+ /* Post if required */
+
+ cs_join_post_after_split(n_old_i_faces, n_new_i_faces,
+ n_old_b_faces, n_new_b_faces,
+ n_g_new_b_faces,
+ join_select->n_faces,
+ mesh,
+ join_param);
+}
+
+/*----------------------------------------------------------------------------
+ * Clean a cs_mesh_t struct.
+ *
+ * Delete redundant and empty edge definitions.
+ *
+ * parameters:
+ * para <-- set of parameters for the joining operation
+ * mesh <-> pointer to a cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_update_mesh_clean(cs_join_param_t param,
+ cs_mesh_t *mesh)
+{
+ cs_int_t i, j, s, e, n_vertices, n_init_vertices, connect_size;
+
+ cs_int_t connect_shift = 0;
+ cs_int_t max_connect = 0, b_size = 10, i_size = 10;
+ cs_int_t n_b_clean_faces = 0, n_i_clean_faces = 0;
+ cs_int_t *b_clean_faces = NULL, *i_clean_faces = NULL;
+ cs_int_t *kill = NULL, *connect = NULL;
+
+ for (i = 0; i < mesh->n_b_faces; i++)
+ max_connect = CS_MAX(max_connect,
+ mesh->b_face_vtx_idx[i+1] - mesh->b_face_vtx_idx[i]);
+
+ for (i = 0; i < mesh->n_i_faces; i++)
+ max_connect = CS_MAX(max_connect,
+ mesh->i_face_vtx_idx[i+1] - mesh->i_face_vtx_idx[i]);
+
+ BFT_MALLOC(kill, max_connect + 2, cs_int_t);
+ BFT_MALLOC(connect, max_connect + 2, cs_int_t);
+
+ if (param.verbosity > 1) {
+ BFT_MALLOC(b_clean_faces, b_size, cs_int_t);
+ BFT_MALLOC(i_clean_faces, i_size, cs_int_t);
+ }
+
+ /* Border face treatment */
+
+ for (i = 0; i < mesh->n_b_faces; i++) {
+
+ s = mesh->b_face_vtx_idx[i] - 1;
+ e = mesh->b_face_vtx_idx[i+1] - 1;
+ n_init_vertices = e - s;
+ connect_size = -1;
+
+ n_vertices = n_init_vertices;
+ while (connect_size != n_vertices) {
+
+ connect_size = _delete_edges(s, e, mesh->b_face_vtx_lst, connect, kill);
+ assert(connect_size <= n_vertices);
+
+ if (connect_size != n_vertices) {
+ n_vertices = connect_size;
+ connect_size += 1;
+ }
+ else
+ n_vertices = connect_size;
+
+ }
+
+ if (n_init_vertices != n_vertices) {
+
+ if (param.verbosity > 1) {
+
+ bft_printf(_(" Clean border face %d. New number of vertices: %d\n"),
+ i+1, n_vertices);
+
+ if (n_b_clean_faces + 1 > b_size) {
+ b_size *= 2;
+ BFT_REALLOC(b_clean_faces, b_size, cs_int_t);
+ }
+ b_clean_faces[n_b_clean_faces] = i+1;
+
+ }
+ n_b_clean_faces++;
+
+ }
+
+ for (j = 0; j < n_vertices; j++)
+ mesh->b_face_vtx_lst[connect_shift++] = connect[j];
+ mesh->b_face_vtx_idx[i] = connect_shift;
+
+ } /* End of loop on border faces */
+
+ if (param.verbosity > 0)
+ bft_printf(_("\n Degenerate connectivity for %d final border faces.\n"),
+ n_b_clean_faces);
+
+ for (i = mesh->n_b_faces; i > 0; i--)
+ mesh->b_face_vtx_idx[i] = mesh->b_face_vtx_idx[i-1] + 1;
+ mesh->b_face_vtx_idx[0] = 1;
+
+ BFT_REALLOC(mesh->b_face_vtx_lst, mesh->b_face_vtx_idx[mesh->n_b_faces],
+ cs_int_t);
+
+ /* Interior face treatment */
+
+ connect_shift = 0;
+ for (i = 0; i < mesh->n_i_faces; i++) {
+
+ s = mesh->i_face_vtx_idx[i] - 1;
+ e = mesh->i_face_vtx_idx[i+1] - 1;
+ n_init_vertices = e - s;
+ connect_size = -1;
+
+ n_vertices = n_init_vertices;
+ while (connect_size != n_vertices) {
+
+ connect_size = _delete_edges(s, e, mesh->i_face_vtx_lst, connect, kill);
+ assert(connect_size <= n_vertices);
+
+ if (connect_size != n_vertices) {
+ n_vertices = connect_size;
+ connect_size += 1;
+ }
+ else
+ n_vertices = connect_size;
+
+ }
+
+ if (n_init_vertices != n_vertices) {
+
+ if (param.verbosity > 1) {
+
+ bft_printf(_(" Clean interior face %d. New number of vertices: %d\n"),
+ i+1, n_vertices);
+
+ if (n_i_clean_faces + 1 > i_size) {
+ i_size *= 2;
+ BFT_REALLOC(i_clean_faces, i_size, cs_int_t);
+ }
+ i_clean_faces[n_i_clean_faces] = i+1;
+
+ }
+ n_i_clean_faces++;
+
+ }
+
+ for (j = 0; j < n_vertices; j++)
+ mesh->i_face_vtx_lst[connect_shift++] = connect[j];
+ mesh->i_face_vtx_idx[i] = connect_shift;
+
+ } /* End of loop on interior faces */
+
+ if (param.verbosity > 0)
+ bft_printf(_(" Degenerate connectivity for %d final interior faces.\n"
+ " Mesh cleaning done.\n"), n_i_clean_faces);
+
+ for (i = mesh->n_i_faces; i > 0; i--)
+ mesh->i_face_vtx_idx[i] = mesh->i_face_vtx_idx[i-1] + 1;
+ mesh->i_face_vtx_idx[0] = 1;
+
+ BFT_REALLOC(mesh->i_face_vtx_lst, mesh->i_face_vtx_idx[mesh->n_i_faces],
+ cs_int_t);
+
+ if (param.verbosity > 1) { /* Post-treat clean faces */
+
+ if (n_i_clean_faces > 0 || n_b_clean_faces > 0) {
+
+ BFT_REALLOC(i_clean_faces, n_i_clean_faces, cs_int_t);
+ BFT_REALLOC(b_clean_faces, n_b_clean_faces, cs_int_t);
+
+ cs_join_post_cleaned_faces(n_i_clean_faces,
+ i_clean_faces,
+ n_b_clean_faces,
+ b_clean_faces,
+ param);
+
+ }
+
+ BFT_FREE(b_clean_faces);
+ BFT_FREE(i_clean_faces);
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(kill);
+ BFT_FREE(connect);
+
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_join_util.c b/src/base/cs_join_util.c
new file mode 100644
index 0000000..bfe3b61
--- /dev/null
+++ b/src/base/cs_join_util.c
@@ -0,0 +1,2467 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Manipulation of low-level structures for the joining operations
+ *===========================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *---------------------------------------------------------------------------*/
+
+#include <fvm_parall.h>
+#include <fvm_io_num.h>
+#include <fvm_order.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_util.h"
+#include "cs_mesh.h"
+#include "cs_search.h"
+#include "cs_sort.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_join_set.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Reduce numbering for the selected border faces.
+ * After this function, we have a compact global face numbering for the
+ * selected faces.
+ *
+ * parameters:
+ * n_select_faces <-- number of selected faces
+ * p_reduce_gnum <-> pointer to the reduced numbering
+ * p_reduce_gnum_index <-> pointer to an index on ranks for the reduce
+ * numbering
+ *---------------------------------------------------------------------------*/
+
+static void
+_compact_face_gnum_selection(cs_int_t n_select_faces,
+ fvm_gnum_t *reduce_gnum[],
+ fvm_gnum_t *reduce_gnum_index[])
+{
+ cs_int_t i;
+
+ fvm_gnum_t shift = 0;
+ fvm_gnum_t *_reduce_gnum = *reduce_gnum;
+ fvm_gnum_t *_reduce_gnum_index = *reduce_gnum_index;
+
+ const int n_ranks = cs_glob_n_ranks;
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+
+ assert(_reduce_gnum_index == NULL);
+
+ BFT_MALLOC(_reduce_gnum_index, n_ranks + 1, fvm_gnum_t);
+
+ for (i = 0; i < n_ranks; i++)
+ _reduce_gnum_index[i] = 0;
+
+ if (n_ranks > 1) {
+#if defined(HAVE_MPI)
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+ fvm_gnum_t _n_faces = n_select_faces;
+
+ MPI_Allgather(&_n_faces, 1, FVM_MPI_GNUM,
+ &(_reduce_gnum_index[1]), 1, FVM_MPI_GNUM, mpi_comm);
+#endif
+
+ for (i = 0; i < n_ranks; i++)
+ _reduce_gnum_index[i+1] += _reduce_gnum_index[i];
+
+ shift = _reduce_gnum_index[local_rank];
+
+ }
+ else {
+
+ assert(n_ranks == 1);
+ _reduce_gnum_index[n_ranks] = (fvm_gnum_t)n_select_faces;
+
+ }
+
+ BFT_MALLOC(_reduce_gnum, n_select_faces, fvm_gnum_t);
+
+ for (i = 0; i < n_select_faces; i++)
+ _reduce_gnum[i] = shift + i + 1;
+
+ /* Returns pointer */
+
+ *reduce_gnum = _reduce_gnum;
+ *reduce_gnum_index = _reduce_gnum_index;
+}
+
+/*----------------------------------------------------------------------------
+ * Eliminate redundancies found between two lists of elements.
+ * Delete elements in elts[] and keep elements in the reference list.
+ *
+ * parameters:
+ * n_elts <-> number of elements in the list to clean
+ * elts <-> list of elements in the list to clean
+ * n_ref_elts --> number of elements in the reference list
+ * ref_elts --> list of reference elements
+ *---------------------------------------------------------------------------*/
+
+static void
+_clean_selection(cs_int_t *n_elts,
+ cs_int_t *elts[],
+ cs_int_t n_ref_elts,
+ cs_int_t ref_elts[])
+{
+ cs_int_t i = 0, j = 0;
+ cs_int_t _n_elts = 0;
+ cs_int_t *_elts = *elts;
+
+ while (i < *n_elts && j < n_ref_elts) {
+
+ if (_elts[i] < ref_elts[j])
+ _elts[_n_elts++] = _elts[i++];
+ else if (_elts[i] > ref_elts[j])
+ j++;
+ else
+ i++, j++;
+
+ }
+
+ for (;i < *n_elts; i++, _n_elts++)
+ _elts[_n_elts] = _elts[i];
+
+ BFT_REALLOC(_elts, _n_elts, cs_int_t);
+
+ *n_elts = _n_elts;
+ *elts = _elts;
+}
+
+/*----------------------------------------------------------------------------
+ * Extract vertices involved in the current joining operation
+ *
+ * parameters:
+ * n_select_faces <-- number of selected faces
+ * select_faces <-- list of faces selected
+ * f2v_idx <-- "face -> vertex" connect. index
+ * f2v_lst <-- "face -> vertex" connect. list
+ * n_vertices <-- number of vertices
+ * n_select_vertices <-> pointer to the number of selected vertices
+ * select_vertices <-> pointer to the list of selected vertices
+ *---------------------------------------------------------------------------*/
+
+static void
+_extract_vertices(cs_int_t n_select_faces,
+ const cs_int_t *select_faces,
+ const cs_int_t *f2v_idx,
+ const cs_int_t *f2v_lst,
+ cs_int_t n_vertices,
+ cs_int_t *n_select_vertices,
+ cs_int_t *select_vertices[])
+{
+ int i, j, face_id;
+
+ cs_int_t _n_select_vertices = 0;
+ cs_int_t *counter = NULL, *_select_vertices = NULL;
+
+ if (n_select_faces > 0) {
+
+ BFT_MALLOC(counter, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++)
+ counter[i] = 0;
+
+ for (i = 0; i < n_select_faces; i++) {
+
+ face_id = select_faces[i] - 1;
+
+ for (j = f2v_idx[face_id] - 1; j < f2v_idx[face_id+1] - 1; j++)
+ counter[f2v_lst[j]-1] = 1;
+
+ }
+
+ for (i = 0; i < n_vertices; i++)
+ _n_select_vertices += counter[i];
+
+ BFT_MALLOC(_select_vertices, _n_select_vertices, cs_int_t);
+
+ _n_select_vertices = 0;
+ for (i = 0; i < n_vertices; i++)
+ if (counter[i] == 1)
+ _select_vertices[_n_select_vertices++] = i + 1;
+
+ assert(_n_select_vertices > 0);
+
+ BFT_FREE(counter);
+
+ } /* End if n_select_faces > 0 */
+
+ /* Return pointers */
+
+ *n_select_vertices = _n_select_vertices;
+ *select_vertices = _select_vertices;
+}
+
+/*----------------------------------------------------------------------------
+ * Extract faces implied in the current joining operation.
+ * These are faces which share at least one vertex which is in the
+ * select_vertices array.
+ *
+ * parameters:
+ * n_vertices <-- number of vertices in the whole mesh
+ * n_select_vertices <-- number of selected vertices
+ * select_vertices <-- list of selected vertices
+ * n_faces <-- number of faces in the whole mesh
+ * f2v_idx <-- "face -> vertex" connect. index
+ * f2v_lst <-- "face -> vertex" connect. list
+ * n_contig_faces <-> pointer to the number of contiguous faces
+ * contig_faces <-> pointer to the list of contiguous faces
+ *---------------------------------------------------------------------------*/
+
+static void
+_extract_contig_faces(cs_int_t n_vertices,
+ cs_int_t n_select_vertices,
+ const cs_int_t select_vertices[],
+ cs_int_t n_faces,
+ const cs_int_t f2v_idx[],
+ const cs_int_t f2v_lst[],
+ cs_int_t *n_contig_faces,
+ cs_int_t *contig_faces[])
+{
+ cs_int_t i, j, vtx_id, shift;
+
+ cs_int_t _n_contig_faces = 0;
+ cs_int_t *_contig_faces = NULL, *counter = NULL;
+ cs_int_t *v2f_idx = NULL, *v2f_lst = NULL;
+
+ if (n_select_vertices == 0)
+ return;
+
+ /* Reverse face -> vertex connectivity */
+
+ BFT_MALLOC(counter, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++)
+ counter[i] = 0;
+
+ for (i = 0; i < n_faces; i++) {
+ for (j = f2v_idx[i] - 1; j < f2v_idx[i+1] - 1; j++) {
+ vtx_id = f2v_lst[j] - 1;
+ counter[vtx_id] += 1;
+ }
+ } /* End of loop on faces */
+
+ /* Define v2f_idx */
+
+ BFT_MALLOC(v2f_idx, n_vertices + 1, cs_int_t);
+
+ v2f_idx[0] = 0;
+ for (i = 0; i < n_vertices; i++)
+ v2f_idx[i+1] = v2f_idx[i] + counter[i];
+
+ for (i = 0; i < n_vertices; i++)
+ counter[i] = 0;
+
+ /* Define v2f_lst */
+
+ BFT_MALLOC(v2f_lst, v2f_idx[n_vertices], cs_int_t);
+
+ for (i = 0; i < n_faces; i++) {
+
+ for (j = f2v_idx[i] - 1; j < f2v_idx[i+1] - 1; j++) {
+
+ vtx_id = f2v_lst[j] - 1;
+ shift = v2f_idx[vtx_id] + counter[vtx_id];
+ v2f_lst[shift] = i+1;
+ counter[vtx_id] += 1;
+
+ }
+
+ } /* End of loop on faces */
+
+ BFT_REALLOC(counter, n_faces, cs_int_t);
+
+ for (i = 0; i < n_faces; i++)
+ counter[i] = 0;
+
+ /* Count the number of contiguous faces */
+
+ for (i = 0; i < n_select_vertices; i++) {
+
+ vtx_id = select_vertices[i] - 1;
+
+ for (j = v2f_idx[vtx_id]; j < v2f_idx[vtx_id+1]; j++)
+ counter[v2f_lst[j]-1] = 1;
+
+ }
+
+ for (i = 0; i < n_faces; i++)
+ _n_contig_faces += counter[i];
+
+ /* Define contig_faces */
+
+ BFT_MALLOC(_contig_faces, _n_contig_faces, cs_int_t);
+
+ _n_contig_faces = 0;
+ for (i = 0; i < n_faces; i++) {
+ if (counter[i] == 1) {
+ _contig_faces[_n_contig_faces] = i+1;
+ _n_contig_faces += 1;
+ }
+ }
+
+ /* Free memory */
+
+ BFT_FREE(v2f_idx);
+ BFT_FREE(v2f_lst);
+ BFT_FREE(counter);
+
+ /* Return pointers */
+
+ *n_contig_faces = _n_contig_faces;
+ *contig_faces = _contig_faces;
+}
+
+#if defined(HAVE_MPI)
+/*----------------------------------------------------------------------------
+ * Initialize a structure for the synchronization of single
+ * elements
+ *
+ * returns
+ * a pointer to a new structure used for synchronizing single elements
+ *----------------------------------------------------------------------------*/
+
+static cs_join_sync_t *
+_create_join_sync(void)
+{
+ cs_join_sync_t *sync = NULL;
+
+ BFT_MALLOC(sync, 1, cs_join_sync_t);
+
+ sync->n_elts = 0;
+ sync->n_ranks = 0;
+ sync->ranks = NULL;
+ sync->index = NULL;
+ sync->array = NULL;
+
+ return sync;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a structure for the synchronization of single elements.
+ *
+ * parameters:
+ * sync <-> pointer to a structure used for synchronizing single elements
+ *----------------------------------------------------------------------------*/
+
+static void
+_destroy_join_sync(cs_join_sync_t **sync)
+{
+ cs_join_sync_t *_sync = *sync;
+
+ if (_sync->n_elts > 0)
+ BFT_FREE(_sync->array);
+ if (_sync->n_ranks > 0)
+ BFT_FREE(_sync->ranks);
+ BFT_FREE(_sync->index);
+
+ BFT_FREE(_sync);
+
+ *sync = _sync;
+}
+
+/*----------------------------------------------------------------------------
+ * Define a structure used for synchronizing "single" vertices.
+ * Use a fvm_interface_t structure to help the build.
+ *
+ * parameters:
+ * interfaces --> pointer to a fvm_interface_set_t structure
+ * var_size --> number of elements in var buffer
+ * count <-> counter buffer (0: not selected, 1 otherwise)
+ * related_ranks <-> rank associated to each single vertex (size: var_size)
+ * single <-> data about the distribution of single vertices
+ *----------------------------------------------------------------------------*/
+
+static void
+_add_single_vertices(fvm_interface_set_t *interfaces,
+ fvm_lnum_t var_size,
+ fvm_lnum_t *count,
+ fvm_lnum_t *related_ranks,
+ cs_join_sync_t *single)
+{
+ int request_count, distant_rank, n_interfaces, total_size;
+ int i, j, id, ii, shift, last_found_rank;
+
+ int count_size = 0;
+ fvm_lnum_t n_entities = 0;
+ int *buf = NULL, *send_buf = NULL, *recv_buf = NULL;
+
+ MPI_Request *request = NULL;
+ MPI_Status *status = NULL;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const fvm_lnum_t *local_num = NULL;
+ const fvm_interface_t *interface = NULL;
+
+ assert(count != NULL);
+
+ /* Initialize and allocate */
+
+ n_interfaces = fvm_interface_set_size(interfaces);
+
+ for (id = 0; id < n_interfaces; id++) {
+ count_size
+ += fvm_interface_size(fvm_interface_set_get(interfaces, id));
+ }
+
+ total_size = count_size;
+
+ BFT_MALLOC(buf, total_size * 2, int);
+
+ BFT_MALLOC(request, n_interfaces * 2, MPI_Request);
+ BFT_MALLOC(status, n_interfaces * 2, MPI_Status);
+
+ /* Send and Receive data from distant ranks with
+ non-blocking communications */
+
+ request_count = 0;
+ count_size = 0;
+
+ /* Receive */
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+
+ recv_buf = buf + count_size;
+
+ MPI_Irecv(recv_buf,
+ n_entities,
+ MPI_INT,
+ distant_rank,
+ distant_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ count_size += n_entities;
+
+ }
+
+ assert(count_size == total_size);
+
+ /* Send */
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ /* Preparation of data to send */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ send_buf = buf + count_size;
+
+ for (ii = 0; ii < n_entities; ii++)
+ send_buf[ii] = count[local_num[ii]-1];
+
+ MPI_Isend(send_buf,
+ n_entities,
+ MPI_INT,
+ distant_rank,
+ local_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ count_size += n_entities;
+
+ }
+
+ assert(count_size == 2*total_size);
+
+ /* Sync after each rank had received all the messages */
+
+ MPI_Waitall(request_count, request, status);
+
+ BFT_FREE(request);
+ BFT_FREE(status);
+
+ /* Now we had each part to count */
+
+ count_size = 0;
+ last_found_rank = -1;
+
+ for (id = 0 ; id < n_interfaces ; id++) {
+
+ /* Scan data */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ recv_buf = buf + count_size;
+
+ for (ii = 0; ii < n_entities; ii++) {
+
+ int vtx_id = local_num[ii] - 1;
+
+ assert(vtx_id < var_size);
+
+ if (count[vtx_id] == 0 && recv_buf[ii] > 0) {
+
+ if (last_found_rank != distant_rank) {
+ last_found_rank = distant_rank;
+ single->n_ranks++;
+ }
+ single->n_elts++;
+
+ }
+
+ }
+
+ count_size += n_entities;
+
+ }
+
+ if (single->n_elts > 0) {
+
+ int rank_shift = 0, vtx_shift = 0;
+
+ BFT_MALLOC(single->ranks, single->n_ranks, int);
+ BFT_MALLOC(single->index, single->n_ranks + 1, int);
+ BFT_MALLOC(single->array, single->n_elts, int);
+
+ count_size = 0;
+ last_found_rank = -1;
+ single->index[0] = 0;
+
+ for (id = 0 ; id < n_interfaces ; id++) {
+
+ /* Scan data */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ recv_buf = buf + count_size;
+
+ for (ii = 0; ii < n_entities; ii++) {
+
+ int vtx_id = local_num[ii] - 1;
+
+ if (count[vtx_id] == 0 && recv_buf[ii] > 0) {
+
+ if (last_found_rank != distant_rank) {
+ last_found_rank = distant_rank;
+ single->ranks[rank_shift++] = distant_rank;
+ }
+
+ single->array[vtx_shift++] = local_num[ii];
+ single->index[rank_shift] = vtx_shift;
+
+ related_ranks[vtx_id] = distant_rank;
+ count[vtx_id] = recv_buf[ii];
+
+ }
+
+ }
+
+ count_size += n_entities;
+
+ } /* End of loop on interfaces */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n Single vertices for the joining operations:\n");
+ for (i = 0, shift = 0; i < single->n_ranks; i++) {
+ for (j = single->index[i]; j < single->index[i+1]; j++) {
+ bft_printf(" %9d | %6d | %9d\n",
+ shift, single->ranks[i], single->array[j]);
+ shift++;
+ }
+ }
+ bft_printf("\n");
+ bft_printf_flush();
+#endif
+
+ } /* End if single->n_vertices > 0 */
+
+ BFT_FREE(buf);
+
+}
+
+/*-----------------------------------------------------------------------------
+ * Define a structure used for synchronizing "single" vertices.
+ * Use a fvm_interface_t structure to help the build.
+ *
+ * parameters:
+ * interfaces --> pointer to a fvm_interface_set_t structure
+ * var_size --> number of elements in var buffer
+ * related_ranks <-> rank buffer for synchronization
+ * coupled <-> pointer to a structure to build on coupled vertices
+ *----------------------------------------------------------------------------*/
+
+static void
+_add_coupled_vertices(fvm_interface_set_t *interfaces,
+ fvm_lnum_t var_size,
+ int *related_ranks,
+ cs_join_sync_t *coupled)
+{
+ int i, j, id, ii, shift;
+ int request_count, distant_rank, n_interfaces, total_size, last_found_rank;
+
+ int count_size = 0;
+ fvm_lnum_t n_entities = 0;
+ int *buf = NULL, *send_buf = NULL, *recv_buf = NULL;
+
+ MPI_Request *request = NULL;
+ MPI_Status *status = NULL;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const fvm_lnum_t *local_num = NULL;
+ const fvm_interface_t *interface = NULL;
+
+ assert(related_ranks != NULL);
+
+ /* Initialize and allocate */
+
+ n_interfaces = fvm_interface_set_size(interfaces);
+
+ for (id = 0; id < n_interfaces; id++) {
+ count_size
+ += fvm_interface_size(fvm_interface_set_get(interfaces, id));
+ }
+
+ total_size = count_size;
+
+ BFT_MALLOC(buf, total_size * 2, int);
+
+ BFT_MALLOC(request, n_interfaces * 2, MPI_Request);
+ BFT_MALLOC(status, n_interfaces * 2, MPI_Status);
+
+ /* Send and Receive data from distant ranks with
+ non-blocking communications */
+
+ request_count = 0;
+ count_size = 0;
+
+ /* Receive */
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+
+ recv_buf = buf + count_size;
+
+ MPI_Irecv(recv_buf,
+ n_entities,
+ MPI_INT,
+ distant_rank,
+ distant_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ count_size += n_entities;
+
+ }
+
+ assert(count_size == total_size);
+
+ /* Send */
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ /* Preparation of data to send */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ send_buf = buf + count_size;
+
+ for (ii = 0; ii < n_entities; ii++)
+ send_buf[ii] = related_ranks[local_num[ii]-1];
+
+ MPI_Isend(send_buf,
+ n_entities,
+ MPI_INT,
+ distant_rank,
+ local_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ count_size += n_entities;
+
+ }
+
+ assert(count_size == 2*total_size);
+
+ /* Sync after each rank had received all the messages */
+
+ MPI_Waitall(request_count, request, status);
+
+ BFT_FREE(request);
+ BFT_FREE(status);
+
+ /* Now we scan each part to build coupled */
+
+ count_size = 0;
+ coupled->n_elts = 0;
+ coupled->n_ranks = 0;
+ last_found_rank = -1;
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ /* Scan data */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+
+ recv_buf = buf + count_size;
+
+ for (ii = 0 ; ii < n_entities ; ii++) {
+
+ if (recv_buf[ii] == local_rank) {
+ coupled->n_elts++;
+ if (last_found_rank != distant_rank) {
+ last_found_rank = distant_rank;
+ coupled->n_ranks++;
+ }
+ }
+
+ }
+ count_size += n_entities;
+
+ }
+
+ if (coupled->n_elts > 0) {
+
+ int rank_shift = 0, vtx_shift = 0;
+
+ BFT_MALLOC(coupled->array, coupled->n_elts, int);
+ BFT_MALLOC(coupled->index, coupled->n_ranks + 1, int);
+ BFT_MALLOC(coupled->ranks, coupled->n_ranks, int);
+
+ coupled->index[0] = 0;
+
+ count_size = 0;
+ last_found_rank = -1;
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ /* Retrieve data */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ recv_buf = buf + count_size;
+
+ for (ii = 0; ii < n_entities; ii++) {
+
+ if (recv_buf[ii] == local_rank) {
+
+ if (last_found_rank != distant_rank) {
+ last_found_rank = distant_rank;
+ coupled->ranks[rank_shift++] = distant_rank;
+ }
+
+ assert(local_num[ii] <= var_size);
+ coupled->array[vtx_shift++] = local_num[ii];
+ coupled->index[rank_shift] = vtx_shift;
+ }
+
+ }
+ count_size += n_entities;
+
+ }
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n Coupled vertices for the joining operations:\n");
+ for (i = 0, shift = 0; i < coupled->n_ranks; i++) {
+ for (j = coupled->index[i]; j < coupled->index[i+1]; j++) {
+ bft_printf(" %9d | %6d | %9d\n",
+ shift, coupled->ranks[i], coupled->array[j]);
+ shift++;
+ }
+ }
+ bft_printf("\n");
+ bft_printf_flush();
+#endif
+
+ } /* End if coupled->n_elts > 0 */
+
+ BFT_FREE(buf);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the related edge id from a couple of vertex ids.
+ *
+ * parameters:
+ * v1_id --> first vertex id
+ * v2_id --> second vertex id
+ * v2v_idx --> vertex -> vertex connect. index
+ * v2v_lst --> vertex -> vertex connect. list
+ *
+ * return:
+ * related edge_id in cs_join_edges_t structure
+ *---------------------------------------------------------------------------*/
+
+inline static cs_int_t
+_get_edge_id(cs_int_t v1_id,
+ cs_int_t v2_id,
+ cs_int_t v2v_idx[],
+ cs_int_t v2v_lst[])
+{
+ int i, va, vb;
+
+ cs_int_t edge_id = -1;
+
+ if (v1_id < v2_id)
+ va = v1_id, vb = v2_id;
+ else
+ vb = v1_id, va = v2_id;
+
+ for (i = v2v_idx[va]; i < v2v_idx[va+1]; i++)
+ if (v2v_lst[i] == vb + 1)
+ break;
+
+ if (i != v2v_idx[va+1])
+ edge_id = i;
+
+ return edge_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Get the full selection of faces related to "single" vertices.
+ * Done only if the run is parallel.
+ *
+ * parameters:
+ * vertex_tag --> tag to know if a vertices is in selection
+ * v1_id --> first vertex id
+ * v2_id --> second vertex id
+ * ref_v2v_idx --> vertex -> vertex connect. index
+ * ref_v2v_lst --> vertex -> vertex connect. list
+ * p_tmp_size <-> pointer to the current number of single edges
+ * p_max_size <-> pointer to the max allocated size of new_s_vertices
+ * p_tmp_size <-> pointer to the single edges definition
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_s_edge(cs_int_t vertex_tag[],
+ cs_int_t v1_id,
+ cs_int_t v2_id,
+ cs_int_t sel_v2v_idx[],
+ cs_int_t sel_v2v_lst[],
+ int *p_tmp_size,
+ int *p_max_size,
+ int *p_tmp_edges[])
+{
+ int i, a, b, edge_id;
+
+ _Bool is_selected = false, is_found = false;
+
+ int tmp_size = *p_tmp_size;
+ int max_size = *p_max_size;
+ int *tmp_edges = *p_tmp_edges;
+
+ if (vertex_tag[v1_id] > 0)
+ if (vertex_tag[v2_id] > 0)
+ is_selected = true;
+
+ if (is_selected) { /* Check if this edge is in sel_edges */
+
+ edge_id = _get_edge_id(v1_id, v2_id, sel_v2v_idx, sel_v2v_lst);
+
+ if (edge_id == -1) { /* Edge not found among the selected edges */
+
+ if (v1_id < v2_id)
+ a = v1_id + 1, b = v2_id + 1;
+ else
+ a = v2_id + 1, b = v1_id + 1;
+
+ /* n_edges is assumed to be small */
+ for (i = 0; i < tmp_size; i++) {
+ if (tmp_edges[2*i] == a) {
+ if (tmp_edges[2*i+1] == b) {
+ is_found = true;
+ break;
+ }
+ }
+ }
+
+ if (!is_found) {
+
+ tmp_edges[2*tmp_size] = a;
+ tmp_edges[2*tmp_size+1] = b;
+ tmp_size += 1;
+
+ if (tmp_size >= max_size) {
+ max_size *= 2;
+ BFT_REALLOC(tmp_edges, 2*max_size, int);
+ }
+
+ }
+
+ } /* this edge is not among the selection */
+
+ } /* this edge should be among the selected edges */
+
+ /* Return pointers */
+
+ *p_max_size = max_size;
+ *p_tmp_size = tmp_size;
+ *p_tmp_edges = tmp_edges;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the full selection of single edges. Done only if the run is parallel.
+ *
+ * parameters:
+ * ifs --> pointer to the interface set on vertices
+ * n_vertices --> number of vertices in the parent mesh
+ * vertex_tag --> tag to know if a vertices is in selection
+ * selection --> pointer to a fvm_join_selection_t structure
+ * b_f2v_idx --> border "face -> vertex" connect. index
+ * b_f2v_lst --> border "face -> vertex" connect. list
+ * i_f2v_idx --> interior "face -> vertex" connect. index
+ * i_f2v_lst --> interior "face -> vertex" connect. list
+ * s_edges <-> pointer to the single edges structure to define
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_single_edges(fvm_interface_set_t *ifs,
+ cs_int_t n_vertices,
+ cs_int_t vertex_tag[],
+ cs_join_select_t *selection,
+ cs_int_t b_f2v_idx[],
+ cs_int_t b_f2v_lst[],
+ cs_int_t i_f2v_idx[],
+ cs_int_t i_f2v_lst[],
+ cs_join_sync_t *s_edges)
+{
+ cs_int_t i, j, fid, save, shift, s, e, n_sel_edges;
+
+ int tmp_size = 0, max_size = 10;
+ int *tmp_edges = NULL;
+ cs_int_t *count = NULL, *sel_v2v_idx = NULL, *sel_v2v_lst = NULL;
+
+ /* Build selected edges */
+
+ BFT_MALLOC(sel_v2v_idx, n_vertices + 1, cs_int_t);
+
+ for (i = 0; i < n_vertices + 1; i++)
+ sel_v2v_idx[i] = 0;
+
+ cs_join_build_edges_idx(selection->n_faces,
+ selection->faces,
+ b_f2v_idx,
+ b_f2v_lst,
+ sel_v2v_idx);
+
+ BFT_MALLOC(count, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++) {
+ sel_v2v_idx[i+1] += sel_v2v_idx[i];
+ count[i] = 0;
+ }
+
+ BFT_MALLOC(sel_v2v_lst, sel_v2v_idx[n_vertices], cs_int_t);
+
+ cs_join_build_edges_lst(selection->n_faces,
+ selection->faces,
+ b_f2v_idx,
+ b_f2v_lst,
+ count,
+ sel_v2v_idx,
+ sel_v2v_lst);
+
+ BFT_FREE(count);
+
+ /* Order sub-lists and then clean repeated elements */
+
+ for (i = 0; i < n_vertices; i++)
+ cs_sort_shell(sel_v2v_idx[i], sel_v2v_idx[i+1], sel_v2v_lst);
+
+ save = sel_v2v_idx[0];
+ shift = 0;
+
+ for (i = 0; i < n_vertices; i++) {
+
+ s = save;
+ e = sel_v2v_idx[i+1];
+
+ if (e - s > 0) {
+ sel_v2v_lst[shift++] = sel_v2v_lst[s];
+ for (j = s + 1; j < e; j++)
+ if (sel_v2v_lst[j-1] != sel_v2v_lst[j])
+ sel_v2v_lst[shift++] = sel_v2v_lst[j];
+ }
+
+ save = e;
+ sel_v2v_idx[i+1] = shift;
+
+ }
+
+ n_sel_edges = sel_v2v_idx[n_vertices];
+ BFT_REALLOC(sel_v2v_lst, n_sel_edges, cs_int_t);
+
+ /* Scan adjacent faces to find new "single" edges */
+
+ BFT_MALLOC(tmp_edges, 2*max_size, int);
+
+ for (i = 0; i < selection->n_b_adj_faces; i++) {
+
+ fid = selection->b_adj_faces[i] - 1;
+ s = b_f2v_idx[fid] - 1;
+ e = b_f2v_idx[fid+1] - 1;
+
+ for (j = s; j < e - 1; j++)
+ _add_s_edge(vertex_tag,
+ b_f2v_lst[j]-1,
+ b_f2v_lst[j+1]-1,
+ sel_v2v_idx,
+ sel_v2v_lst,
+ &tmp_size,
+ &max_size,
+ &tmp_edges);
+
+ _add_s_edge(vertex_tag,
+ b_f2v_lst[e-1]-1,
+ b_f2v_lst[s]-1,
+ sel_v2v_idx,
+ sel_v2v_lst,
+ &tmp_size,
+ &max_size,
+ &tmp_edges);
+
+ }
+
+ for (i = 0; i < selection->n_i_adj_faces; i++) {
+
+ fid = selection->i_adj_faces[i] - 1;
+ s = i_f2v_idx[fid] - 1;
+ e = i_f2v_idx[fid+1] - 1;
+
+ for (j = s; j < e - 1; j++)
+ _add_s_edge(vertex_tag,
+ i_f2v_lst[j]-1,
+ i_f2v_lst[j+1]-1,
+ sel_v2v_idx,
+ sel_v2v_lst,
+ &tmp_size,
+ &max_size,
+ &tmp_edges);
+
+ _add_s_edge(vertex_tag,
+ i_f2v_lst[e-1]-1,
+ i_f2v_lst[s]-1,
+ sel_v2v_idx,
+ sel_v2v_lst,
+ &tmp_size,
+ &max_size,
+ &tmp_edges);
+
+ }
+
+ /* Find the related ranks for synchronization */
+
+ if (tmp_size > 0) {
+
+ int n_entities, distant_rank;
+
+ int *edge_tag = NULL;
+
+ const int n_interfaces = fvm_interface_set_size(ifs);
+ const fvm_lnum_t *local_num = NULL;
+ const fvm_interface_t *interface = NULL;
+
+ s_edges->n_elts = tmp_size;
+ BFT_REALLOC(tmp_edges, 2*s_edges->n_elts, int);
+
+ BFT_MALLOC(edge_tag, s_edges->n_elts, int);
+ BFT_MALLOC(s_edges->array, 2*s_edges->n_elts, int);
+ BFT_MALLOC(s_edges->index, n_interfaces + 1, int);
+ BFT_MALLOC(s_edges->ranks, n_interfaces, int);
+
+ for (i = 0; i < s_edges->n_elts; i++)
+ edge_tag[i] = 0; /* Not matched */
+
+ for (i = 0; i < n_interfaces; i++) {
+ s_edges->index[i] = 0;
+ s_edges->ranks[i] = -1;
+ }
+
+ for (i = 0; i < n_interfaces; i++) {
+
+ interface = fvm_interface_set_get(ifs, i);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ for (j = 0; j < s_edges->n_elts; j++) {
+
+ if (edge_tag[j] == 0) {
+ if (cs_search_binary(n_entities, tmp_edges[2*j], local_num) > -1) {
+ if (cs_search_binary(n_entities, tmp_edges[2*j+1], local_num) > -1) {
+
+ s_edges->array[2*s_edges->index[i+1]] = tmp_edges[2*j];
+ s_edges->array[2*s_edges->index[i+1]+1] = tmp_edges[2*j+1];
+ s_edges->index[i+1] += 1;
+ edge_tag[j] = 1;
+
+ if (s_edges->n_ranks == 0 ||
+ ( s_edges->n_ranks > 0
+ && s_edges->ranks[s_edges->n_ranks-1] != distant_rank) ) {
+ s_edges->ranks[s_edges->n_ranks] = distant_rank;
+ s_edges->n_ranks++;
+ }
+
+ }
+ }
+ } /* Not matched yet */
+
+ } /* Loop on single edges */
+
+ } /* Loop on interfaces */
+
+ /* sanity check */
+
+ for (j = 0; j < s_edges->n_elts; j++)
+ if (edge_tag[j] == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Can't find the distant rank in the interface set"
+ " for the current edge [%d, %d] (local num.\n"),
+ s_edges->array[2*j], s_edges->array[2*j+1]);
+
+ /* Memory management */
+
+ BFT_REALLOC(s_edges->ranks, s_edges->n_ranks, int);
+ BFT_REALLOC(s_edges->index, s_edges->n_ranks + 1, int);
+ BFT_FREE(edge_tag);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ bft_printf("\n Single edges for the joining operations:\n");
+ for (i = 0, shift = 0; i < s_edges->n_ranks; i++) {
+ for (j = s_edges->index[i]; j < s_edges->index[i+1]; j++) {
+ bft_printf(" %9d | %6d | (%9d, %9d)\n",
+ shift, s_edges->ranks[i],
+ s_edges->array[2*j], s_edges->array[2*j+1]);
+ shift++;
+ }
+ }
+ bft_printf("\n");
+ bft_printf_flush();
+#endif
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(tmp_edges);
+ BFT_FREE(sel_v2v_idx);
+ BFT_FREE(sel_v2v_lst);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Define a structure for the coupled edges. Only done if single edges have
+ * been detected and only in parallel.
+ *
+ * parameters:
+ * ifs --> pointer to the interface set on vertices
+ * s_edges --> single edges structure used to build coupled_edges
+ * c_edges <-> pointer to the coupled edges structure to define
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_coupled_edges(fvm_interface_set_t *ifs,
+ cs_join_sync_t *s_edges,
+ cs_join_sync_t *c_edges)
+{
+ int i, j, id, n_entities;
+ int request_count, rank_shift, distant_rank;
+
+ int *buf = NULL, *recv_buf = NULL, *send_buf = NULL;
+ MPI_Request *request = NULL;
+ MPI_Status *status = NULL;
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ const int local_rank = CS_MAX(cs_glob_rank_id, 0);
+ const fvm_lnum_t *local_num = NULL, *distant_num = NULL;
+ const int n_interfaces = fvm_interface_set_size(ifs);
+ const fvm_interface_t *interface = NULL;
+
+ /* Exchange number of single edges */
+
+ BFT_MALLOC(request, n_interfaces * 2, MPI_Request);
+ BFT_MALLOC(status, n_interfaces * 2, MPI_Status);
+ BFT_MALLOC(buf, 2*n_interfaces, int);
+
+ for (i = 0; i < 2*n_interfaces; i++)
+ buf[i] = 0;
+
+ request_count = 0;
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ interface = fvm_interface_set_get(ifs, id);
+ distant_rank = fvm_interface_rank(interface);
+
+ MPI_Irecv(&(buf[id]),
+ 1,
+ MPI_INT,
+ distant_rank,
+ distant_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+
+ /* Send */
+
+ rank_shift = 0;
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ /* Preparation of data to send */
+
+ interface = fvm_interface_set_get(ifs, id);
+ distant_rank = fvm_interface_rank(interface);
+
+ if (rank_shift < s_edges->n_ranks) {
+ if (s_edges->ranks[rank_shift] == distant_rank) {
+ buf[n_interfaces + id] =
+ s_edges->index[rank_shift+1] - s_edges->index[rank_shift];
+ rank_shift++;
+ }
+ }
+
+ MPI_Isend(&(buf[n_interfaces + id]),
+ 1,
+ MPI_INT,
+ distant_rank,
+ local_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ } /* End of loop on interfaces */
+
+ /* Sync after each rank had received all the messages */
+
+ MPI_Waitall(request_count, request, status);
+
+ /* Define c_edges */
+
+ for (i = 0; i < n_interfaces; i++) {
+ if (buf[i] > 0) {
+ c_edges->n_elts += buf[i];
+ c_edges->n_ranks += 1;
+ }
+ }
+
+ BFT_MALLOC(c_edges->ranks, c_edges->n_ranks, int);
+ BFT_MALLOC(c_edges->index, c_edges->n_ranks + 1, int);
+ BFT_MALLOC(c_edges->array, 2*c_edges->n_elts, int);
+
+ for (i = 0; i < c_edges->n_ranks + 1; i++)
+ c_edges->index[i] = 0;
+
+ rank_shift = 0;
+
+ for (i = 0; i < n_interfaces; i++) {
+ if (buf[i] > 0) {
+
+ interface = fvm_interface_set_get(ifs, i);
+ distant_rank = fvm_interface_rank(interface);
+ c_edges->ranks[rank_shift++] = distant_rank;
+ c_edges->index[rank_shift] = buf[i];
+
+ }
+ }
+
+ assert(rank_shift == c_edges->n_ranks);
+
+ for (i = 0; i < c_edges->n_ranks; i++)
+ c_edges->index[i+1] += c_edges->index[i];
+
+ assert(c_edges->index[c_edges->n_ranks] == c_edges->n_elts);
+
+ BFT_FREE(buf);
+
+ /* Exchange couple of vertices defining coupled edges */
+
+ request_count = 0;
+ rank_shift = 0;
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ interface = fvm_interface_set_get(ifs, id);
+ distant_rank = fvm_interface_rank(interface);
+
+ if (rank_shift < c_edges->n_ranks) {
+ if (c_edges->ranks[rank_shift] == distant_rank) {
+
+ n_entities = c_edges->index[rank_shift+1] - c_edges->index[rank_shift];
+ n_entities *= 2; /* couple of vertices */
+ recv_buf = c_edges->array + 2*c_edges->index[rank_shift];
+ rank_shift++;
+
+ MPI_Irecv(recv_buf, /* receive distant num */
+ n_entities,
+ MPI_INT,
+ distant_rank,
+ distant_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+ }
+
+ } /* End of loop on interfaces */
+
+ /* Send */
+
+ rank_shift = 0;
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ interface = fvm_interface_set_get(ifs, id);
+ distant_rank = fvm_interface_rank(interface);
+
+ if (rank_shift < s_edges->n_ranks) {
+ if (s_edges->ranks[rank_shift] == distant_rank) {
+
+ n_entities = s_edges->index[rank_shift+1] - s_edges->index[rank_shift];
+ n_entities *= 2; /* couple of vertices */
+ send_buf = s_edges->array + 2*s_edges->index[rank_shift];
+ rank_shift++;
+
+ MPI_Isend(send_buf,
+ n_entities,
+ MPI_INT,
+ distant_rank,
+ local_rank,
+ mpi_comm,
+ &(request[request_count++]));
+
+ }
+ }
+
+ } /* End of loop on interfaces */
+
+ /* Sync after each rank had received all the messages */
+
+ MPI_Waitall(request_count, request, status);
+
+ BFT_FREE(request);
+ BFT_FREE(status);
+
+ rank_shift = 0;
+
+ /* Switch received couple vertices from distant num. to local num. */
+
+ for (i = 0; i < n_interfaces; i++) {
+
+ interface = fvm_interface_set_get(ifs, i);
+ distant_rank = fvm_interface_rank(interface);
+
+ if (rank_shift < c_edges->n_ranks) {
+ if (c_edges->ranks[rank_shift] == distant_rank) {
+
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+ distant_num = fvm_interface_get_distant_num(interface);
+
+ for (j = c_edges->index[rank_shift];
+ j < c_edges->index[rank_shift+1]; j++) {
+
+ id = cs_search_binary(n_entities, c_edges->array[2*j], distant_num);
+ assert(id != -1);
+ c_edges->array[2*j] = local_num[id];
+
+ id = cs_search_binary(n_entities, c_edges->array[2*j+1], distant_num);
+ assert(id != -1);
+ c_edges->array[2*j+1] = local_num[id];
+
+ } /* Loop on couple edges */
+
+ rank_shift++;
+
+ } /* This rank is in the list of related ranks */
+ }
+
+ } /* Loop on interfaces */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ if (c_edges->n_elts > 0) {
+ int shift;
+ bft_printf("\n Coupled edges for the joining operations:\n");
+ for (i = 0, shift = 0; i < c_edges->n_ranks; i++) {
+ for (j = c_edges->index[i]; j < c_edges->index[i+1]; j++) {
+ bft_printf(" %9d | %6d | (%9d, %9d)\n",
+ shift, c_edges->ranks[i],
+ c_edges->array[2*j], c_edges->array[2*j+1]);
+ shift++;
+ }
+ }
+ bft_printf("\n");
+ bft_printf_flush();
+ }
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the full selection of vertices to extract. Only in parallel. Somme
+ * vertices may have been selected on another rank and not on the local rank
+ * but you have to take them into account to have a good update of the mesh
+ *
+ * parameters:
+ * b_f2v_idx --> border "face -> vertex" connect. index
+ * b_f2v_lst --> border "face -> vertex" connect. list
+ * i_f2v_idx --> interior "face -> vertex" connect. index
+ * i_f2v_lst --> interior "face -> vertex" connect. list
+ * n_vertices --> number of vertices in the parent mesh
+ * v_gnum --> global vertex numbering (NULL if n_ranks = 1)
+ * join_select <-> pointer to a fvm_join_selection_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_single_elements(cs_int_t b_f2v_idx[],
+ cs_int_t b_f2v_lst[],
+ cs_int_t i_f2v_idx[],
+ cs_int_t i_f2v_lst[],
+ cs_int_t n_vertices,
+ fvm_gnum_t v_gnum[],
+ cs_join_select_t *selection)
+{
+ cs_int_t i;
+ fvm_gnum_t n_g_elts;
+
+ cs_int_t *vtx_tag = NULL, *related_ranks = NULL;
+ fvm_interface_set_t *ifs = NULL;
+
+ MPI_Comm mpi_comm = cs_glob_mpi_comm;
+
+ assert(v_gnum != NULL);
+
+ /* Build an interface on vertices to detect single vertices */
+
+ ifs = fvm_interface_set_create(n_vertices,
+ NULL,
+ v_gnum,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ NULL);
+
+ assert(ifs != NULL);
+
+ /* Define a counter on vertices. 1 if selected, 0 otherwise */
+
+ BFT_MALLOC(vtx_tag, n_vertices, cs_int_t);
+ BFT_MALLOC(related_ranks, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++) {
+ vtx_tag[i] = 0;
+ related_ranks[i] = -1;
+ }
+
+ for (i = 0; i < selection->n_vertices; i++)
+ vtx_tag[selection->vertices[i] - 1] = 1;
+
+ /* Has to be done before the search of single edges because
+ we need a synchronized vtx_tag */
+
+ _add_single_vertices(ifs,
+ n_vertices,
+ vtx_tag,
+ related_ranks,
+ selection->s_vertices);
+
+ MPI_Allreduce(&(selection->s_vertices->n_elts), &n_g_elts, 1, FVM_MPI_GNUM,
+ MPI_SUM, mpi_comm);
+
+ if (n_g_elts > 0) {
+
+ bft_printf("\n Global number of single vertices found: %6u\n", n_g_elts);
+ bft_printf_flush();
+ selection->do_single_sync = true;
+
+ _add_coupled_vertices(ifs,
+ n_vertices,
+ related_ranks,
+ selection->c_vertices);
+
+ } /* End if n_g_s_vertices > 0 */
+
+ _add_single_edges(ifs,
+ n_vertices,
+ vtx_tag,
+ selection,
+ b_f2v_idx,
+ b_f2v_lst,
+ i_f2v_idx,
+ i_f2v_lst,
+ selection->s_edges);
+
+ MPI_Allreduce(&(selection->s_edges->n_elts), &n_g_elts, 1, FVM_MPI_GNUM,
+ MPI_SUM, mpi_comm);
+
+ if (n_g_elts > 0) {
+
+ bft_printf(" Global number of single edges found: %6d\n", n_g_elts);
+ bft_printf_flush();
+ selection->do_single_sync = true;
+
+ _add_coupled_edges(ifs,
+ selection->s_edges,
+ selection->c_edges);
+
+ } /* End if n_g_s_elts > 0 */
+
+ /* Free memory */
+
+ BFT_FREE(vtx_tag);
+ BFT_FREE(related_ranks);
+
+ ifs = fvm_interface_set_destroy(ifs);
+
+}
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Compute the cell center (= barycenter of the cell vertices) for the
+ * selected cells.
+ *
+ * If selection = NULL, the whole mesh is selected.
+ *
+ * The caller is responsible for freeing the returned array.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * n_select_cells <-- number of cells in the selection
+ * selection <-- list of selected cell number (size: n_cells)
+ * cell "i" selected if selection[i] > 0
+ * cell "i" not selected if selection[i] < 0
+ * 0 < selection[i] <= n_select_cells
+ *
+ * returns:
+ * array of cell centers (size: n_select_cells*3, interlaced)
+ *---------------------------------------------------------------------------*/
+
+static cs_real_t *
+_cell_cen_vtx(const cs_mesh_t *mesh,
+ cs_int_t n_select_cells,
+ const cs_int_t selection[])
+{
+ cs_int_t i, j, k, coord, cid, cid1, cid2, fid, vid, shift, vtx_counter;
+ cs_real_t denum;
+
+ cs_int_t *v_tag = NULL, *counter = NULL;
+ cs_int_t *f2v_idx = NULL, *f2v_lst = NULL, *c2f_idx = NULL, *c2f_lst = NULL;
+
+ cs_real_t *cell_cen = NULL;
+
+ if (selection == NULL)
+ n_select_cells = mesh->n_cells;
+
+ if (n_select_cells == 0)
+ return NULL;
+
+ BFT_MALLOC(cell_cen, 3*n_select_cells, cs_real_t);
+
+ /* Extract "cell -> faces" connectivity for the selected faces */
+ /* Build c2f_idx */
+
+ BFT_MALLOC(c2f_idx, n_select_cells + 1, cs_int_t);
+
+ for (i = 0; i < n_select_cells + 1; i++)
+ c2f_idx[i] = 0;
+
+ for (i = 0; i < mesh->n_b_faces; i++) {
+
+ cid = mesh->b_face_cells[i] - 1;
+
+ if (selection != NULL)
+ cid = selection[cid];
+
+ if (cid > -1) /* selected cell */
+ c2f_idx[cid+1] += 1;
+
+ } /* End of loop on border faces */
+
+ for (i = 0; i < mesh->n_i_faces; i++) {
+
+ cid1 = mesh->i_face_cells[2*i ] - 1;
+ cid2 = mesh->i_face_cells[2*i+1] - 1;
+
+ if (selection != NULL) {
+
+ if (cid1 > -1 && cid1 < mesh->n_cells)
+ cid1 = selection[cid1];
+ else
+ cid1 = -1;
+
+ if (cid2 > -1 && cid2 < mesh->n_cells)
+ cid2 = selection[cid2];
+ else
+ cid2 = -1;
+
+ }
+
+ if (cid1 > -1 && cid1 < mesh->n_cells) /* selected cell */
+ c2f_idx[cid1+1] += 1;
+ if (cid2 > -1 && cid2 < mesh->n_cells) /* selected cell */
+ c2f_idx[cid2+1] += 1;
+
+ } /* End of loop on interior faces */
+
+ c2f_idx[0] = 1;
+ for (i = 0; i < n_select_cells; i++)
+ c2f_idx[i+1] += c2f_idx[i];
+
+ /* Build c2f_lst */
+
+ BFT_MALLOC(c2f_lst, c2f_idx[n_select_cells]-1, cs_int_t);
+ BFT_MALLOC(counter, n_select_cells, cs_int_t);
+
+ for (i = 0; i < n_select_cells; i++)
+ counter[i] = 0;
+
+ for (i = 0; i < mesh->n_b_faces; i++) {
+
+ cid = mesh->b_face_cells[i] - 1;
+
+ if (selection != NULL)
+ cid = selection[cid];
+
+ if (cid > -1) { /* selected cell */
+ shift = c2f_idx[cid] - 1 + counter[cid];
+ c2f_lst[shift] = i+1;
+ counter[cid] += 1;
+ }
+
+ } /* End of loop on border faces */
+
+ for (i = 0; i < mesh->n_i_faces; i++) {
+
+ cid1 = mesh->i_face_cells[2*i ] - 1;
+ cid2 = mesh->i_face_cells[2*i+1] - 1;
+
+ if (selection != NULL) {
+
+ if (cid1 > -1 && cid1 < mesh->n_cells)
+ cid1 = selection[cid1];
+ else
+ cid1 = -1;
+
+ if (cid2 > -1 && cid2 < mesh->n_cells)
+ cid2 = selection[cid2];
+ else
+ cid2 = -1;
+
+ }
+
+ if (cid1 > -1 && cid1 < mesh->n_cells) { /* selected cell */
+ shift = c2f_idx[cid1] - 1 + counter[cid1];
+ c2f_lst[shift] = i+1 + mesh->n_b_faces;
+ counter[cid1] += 1;
+ }
+
+ if (cid2 > -1 && cid2 < mesh->n_cells) { /* selected cell */
+ shift = c2f_idx[cid2] - 1 + counter[cid2];
+ c2f_lst[shift] = i+1 + mesh->n_b_faces;
+ counter[cid2] += 1;
+ }
+
+ } /* End of loop on interior faces */
+
+ /* Compute cell centers for the selected vertices */
+
+ for (i = 0; i < 3*n_select_cells; i++)
+ cell_cen[i] = 0.0;
+
+ BFT_MALLOC(v_tag, mesh->n_vertices, cs_int_t);
+
+ for (vid = 0 ; vid < mesh->n_vertices ; vid++)
+ v_tag[vid] = -1;
+
+ /* Loop on selected cells */
+
+ for (i = 0; i < mesh->n_cells; i++) {
+
+ vtx_counter = 0;
+
+ if (selection != NULL)
+ cid = selection[i];
+ else
+ cid = i;
+
+ if (cid > -1) { /* Loop on faces of the cell */
+
+ for (j = c2f_idx[cid] - 1; j < c2f_idx[cid + 1] - 1; j++) {
+
+ cs_int_t face_num = c2f_lst[j];
+
+ /* Interior or border face */
+
+ if (face_num > mesh->n_b_faces) {
+ fid = face_num - mesh->n_b_faces - 1;
+ f2v_idx = mesh->i_face_vtx_idx;
+ f2v_lst = mesh->i_face_vtx_lst;
+ }
+ else {
+ fid = face_num - 1;
+ f2v_idx = mesh->b_face_vtx_idx;
+ f2v_lst = mesh->b_face_vtx_lst;
+ }
+
+ /* Loop on vertices of the face */
+
+ for (k = f2v_idx[fid] - 1; k < f2v_idx[fid + 1] - 1; k++) {
+
+ vid = f2v_lst[k] - 1;
+
+ if (v_tag[vid] < cid) {
+ for (coord = 0 ; coord < 3 ; coord++)
+ cell_cen[3*cid + coord] += mesh->vtx_coord[3*vid + coord];
+ vtx_counter += 1;
+ v_tag[vid] = cid;
+ }
+
+ }
+
+ } /* End of loop on faces of the cell */
+
+ denum = 1/(double)vtx_counter;
+ for (coord = 0; coord < 3; coord++)
+ cell_cen[3*cid + coord] *= denum;
+
+ } /* End if cid >= 0 */
+
+ } /* End of loop on cells */
+
+ /* Free memory */
+
+ BFT_FREE(v_tag);
+ BFT_FREE(counter);
+ BFT_FREE(c2f_idx);
+ BFT_FREE(c2f_lst);
+
+ /* Return result */
+
+ return cell_cen;
+}
+
+/*----------------------------------------------------------------------------
+ * Define the cell center for a selection of cells (those one which are
+ * adjacent to the selected faces).
+ *
+ * parameters:
+ * n_select_faces <-- number of border faces implied in the joining op.
+ * select_faces <-- list of faces implied in the joining op.
+ * mesh <-- pointer to cs_mesh_t structure
+ * cell_filter --> selection array (size: mesh->n_cells)
+ * select_cell_cen --> cell center for the selected cells
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_select_cell_cen(cs_int_t n_select_faces,
+ const cs_int_t select_faces[],
+ const cs_mesh_t *mesh,
+ cs_int_t *cell_filter[],
+ cs_real_t *select_cell_cen[])
+{
+ cs_int_t i, cid, fid, tag;
+
+ cs_int_t n_select_cells = 0;
+ cs_int_t *_cell_filter = NULL;
+ cs_real_t *_select_cell_cen = NULL;
+
+ BFT_MALLOC(_cell_filter, mesh->n_cells, cs_int_t);
+
+ for (i = 0; i < mesh->n_cells; i++)
+ _cell_filter[i] = -1;
+
+ for (i = 0; i < n_select_faces; i++) {
+ fid = select_faces[i] - 1;
+ cid = mesh->b_face_cells[fid] - 1;
+ _cell_filter[cid] = i + 1;
+ }
+
+ /* Order cell selection */
+
+ for (i = 0, tag = 0; i < mesh->n_cells; i++)
+ if (_cell_filter[i] > 0)
+ _cell_filter[i] = tag++;
+
+ n_select_cells = n_select_faces; /* Border faces: 1 Face -> 1 Cell */
+
+ _select_cell_cen = _cell_cen_vtx(mesh, n_select_cells, _cell_filter);
+
+ /* Returns pointers */
+
+ *cell_filter = _cell_filter;
+ *select_cell_cen = _select_cell_cen;
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define a set of parameters to control a contiguous distribution by block.
+ *
+ * parameters:
+ * n_g_elts <-- global number of elements to treat
+ * n_ranks <-- number of ranks in the MPI communicator related to the
+ * cs_join_block_info_t structure to create
+ * local_rank <-- rank in the MPI communicator related to the
+ * cs_join_block_info_t structure to create
+ *
+ * returns:
+ * a new defined cs_join_block_info_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_block_info_t
+cs_join_get_block_info(fvm_gnum_t n_g_elts,
+ int n_ranks,
+ int local_rank)
+{
+ size_t block_size, n_treat_elts;
+ fvm_gnum_t first_glob_num, last_glob_num;
+
+ cs_join_block_info_t block_info;
+
+ /* Compute block_size */
+
+ block_size = n_g_elts/n_ranks;
+ if (n_g_elts % n_ranks > 0)
+ block_size++;
+
+ first_glob_num = local_rank * block_size + 1;
+ last_glob_num = first_glob_num + block_size;
+
+ if (last_glob_num > n_g_elts) {
+
+ if (first_glob_num > n_g_elts) /* n_ranks > n_g_elts */
+ n_treat_elts = 0;
+ else
+ n_treat_elts = n_g_elts - first_glob_num + 1;
+
+ }
+ else
+ n_treat_elts = block_size;
+
+ block_info.n_g_elts = n_g_elts;
+ block_info.first_gnum = first_glob_num;
+
+ block_info.size = block_size;
+ block_info.local_size = n_treat_elts;
+
+ block_info.n_ranks = n_ranks;
+ block_info.local_rank = local_rank;
+
+ return block_info;
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize a cs_join_param_t structure.
+ *
+ * parameters:
+ * join_id <-- id of the current joining operation
+ * fraction <-- value of the fraction parameter
+ * plane <-- value of the plane parameter
+ * rtf <-- value of the "reduction tolerance factor" parameter
+ * ftf <-- value of the "merge tolerance factor" parameter
+ * etf <-- value of the "edge equiv. tolerance factor" parameter
+ * max_sub_faces <-- maximum number of sub-faces allowed during splitting
+ * tml <-- value of the "tree max level" parameter
+ * tmb <-- value of the "tree max boxes" parameter
+ * tmr <-- value of the "tree max ratio" parameter
+ * verbosity <-- level of verbosity required
+ *
+ * returns:
+ * a pointer to a cs_join_param_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_param_t
+cs_join_param_define(int join_id,
+ double fraction,
+ double plane,
+ double rtf,
+ double ftf,
+ double etf,
+ int max_sub_faces,
+ int tml,
+ int tmb,
+ double tmr,
+ int verbosity)
+{
+ cs_join_param_t param;
+
+ param.num = join_id + 1;
+
+ /* geometric parameters */
+
+ /* parameter used to compute the tolerance associated to each vertex.
+ Also used for finding equivalent vertices during edge intersections */
+
+ param.fraction = fraction;
+
+ /* parameter used to judge if two faces are in the same plane (during
+ the face splitting) */
+
+ param.plane = plane;
+
+ /* Coef. used to reduce the tolerance during merge step:
+ new tol. = tol * coef.
+ Values between [0.0, 1.0[ */
+
+ param.reduce_tol_factor = rtf;
+
+ /* Coef. used to modify the tolerance associated to each vertex BEFORE the
+ merge operation.
+ If coef = 0.0 => no vertex merge
+ If coef < 1.0 => reduce vertex merge
+ If coef = 1.0 => no change
+ If coef > 1.0 => increase vertex merge */
+
+ param.merge_tol_coef = ftf;
+
+ /* Coef. used to modify locally the tolerance associated to each vertex
+ BEFORE adding equivalences between vertices after edge intersections.
+ If coef = 0.0 => add no equivalence
+ If coef < 1.0 => reduce the number of equivalences between vertices
+ sharing the same edge
+ If coef = 1.0 => no change
+ If coef > 1.0 => increase the number of equivalences between vertices
+ sharing the same edge. Not advised. */
+
+ param.edge_equiv_tol_coef = etf;
+
+ /* Parameter to switch on/off the influence of adjacent faces in the
+ computation of tolerance */
+
+ param.include_adj_faces = true; /* Default value: true */
+
+ /* Parameter used to define if we get vertex equivalence trough the
+ comparison of vertex tolerance or through the difference of curvilinear
+ abscissa of vertices on edges.
+ If include_adj_faces = false => this parameter should not have any
+ effect. (Not a user-defined parameter) */
+
+ param.edge_equiv_by_tolerance = true; /* Default value: true */
+
+ /* Maximum number of sub-faces */
+
+ param.max_sub_faces = max_sub_faces;
+
+ /* Deepest level reachable during tree building */
+
+ param.tree_max_level = tml;
+
+ /* Max. number of boxes which can be related to a leaf of the tree
+ if level != tree_max_level */
+
+ param.tree_n_max_boxes = tmb;
+
+ /* Stop tree building if: n_linked_boxes > tree_max_box_ratio*n_init_boxes */
+
+ param.tree_max_box_ratio = tmr;
+
+ /* Level of display */
+
+ param.verbosity = verbosity;
+
+ return param;
+}
+
+/*----------------------------------------------------------------------------
+ * Create and initialize a cs_join_select_t structure.
+ *
+ * parameters:
+ * selection_criteria <-- pointer to a cs_mesh_select_t structure
+ * verbosity <-- level of verbosity required
+ *
+ * returns:
+ * pointer to a newly created cs_join_select_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_join_select_t *
+cs_join_select_create(const char *selection_criteria,
+ int verbosity)
+{
+ cs_int_t i, fid, cid;
+
+ cs_join_select_t *selection = NULL;
+ fvm_lnum_t *order = NULL, *ordered_faces = NULL;
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ const int n_ranks = cs_glob_n_ranks;
+
+ assert(mesh != NULL);
+
+ /* Initialize cs_join_select_t struct. */
+
+ BFT_MALLOC(selection, 1, cs_join_select_t);
+
+ selection->n_faces = 0;
+ selection->n_g_faces = 0;
+
+ selection->faces = NULL;
+ selection->compact_face_gnum = NULL;
+ selection->compact_rank_index = NULL;
+
+ selection->cell_filter = NULL;
+ selection->cell_cen = NULL;
+ selection->cell_gnum = NULL;
+
+ selection->n_vertices = 0;
+ selection->n_g_vertices = 0;
+ selection->vertices = NULL;
+
+ selection->n_b_adj_faces = 0;
+ selection->b_adj_faces = NULL;
+ selection->n_i_adj_faces = 0;
+ selection->i_adj_faces = NULL;
+
+ /*
+ Single elements (Only possible in parallel. It appears
+ when the domain splitting has a poor quality and elements
+ on the joining interface are prisms or tetraedrals)
+ s = single / c = coupled
+ */
+
+ selection->do_single_sync = false;
+ selection->s_vertices = _create_join_sync();
+ selection->c_vertices = _create_join_sync();
+ selection->s_edges = _create_join_sync();
+ selection->c_edges = _create_join_sync();
+
+ /* Extract selected border faces */
+
+ BFT_MALLOC(selection->faces, mesh->n_b_faces, fvm_lnum_t);
+
+ cs_selector_get_b_face_list(selection_criteria,
+ &(selection->n_faces),
+ selection->faces);
+
+ BFT_MALLOC(order, selection->n_faces, fvm_lnum_t);
+ BFT_MALLOC(ordered_faces, selection->n_faces, fvm_lnum_t);
+
+ fvm_order_local_allocated(selection->faces, NULL, order, selection->n_faces);
+
+ for (i = 0; i < selection->n_faces; i++)
+ ordered_faces[i] = selection->faces[order[i]];
+
+ BFT_FREE(order);
+ BFT_FREE(selection->faces);
+ selection->faces = ordered_faces;
+
+ /* Define cell_gnum: global numbers of the related cells */
+
+ BFT_MALLOC(selection->cell_gnum, selection->n_faces, fvm_gnum_t);
+
+ if (n_ranks == 1) { /* Serial treatment */
+
+ selection->n_g_faces = selection->n_faces;
+
+ for (i = 0; i < selection->n_faces; i++) {
+ fid = selection->faces[i] - 1;
+ selection->cell_gnum[i] = mesh->b_face_cells[fid];
+ }
+
+ }
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1) { /* Parallel treatment */
+
+ MPI_Allreduce(&(selection->n_faces), &(selection->n_g_faces),
+ 1, FVM_MPI_GNUM, MPI_SUM, cs_glob_mpi_comm);
+
+ for (i = 0; i < selection->n_faces; i++) {
+ fid = selection->faces[i] - 1;
+ cid = mesh->b_face_cells[fid] - 1;
+ selection->cell_gnum[i] = mesh->global_cell_num[cid];
+ }
+
+ }
+#endif
+
+ /* Define the cell center for a selection of cells (those one which are
+ adjacent to the selected faces).
+ This will be used to check the orientation of faces at the end of the
+ joining operation */
+
+ _get_select_cell_cen(selection->n_faces,
+ selection->faces,
+ mesh,
+ &(selection->cell_filter),
+ &(selection->cell_cen));
+
+ if (verbosity > 0)
+ bft_printf(_(" Number of boundary faces selected for joining: %10u\n"),
+ selection->n_g_faces);
+
+ /* Define a compact global numbering on selected border faces and
+ build an index on ranks on this compact numbering */
+
+ _compact_face_gnum_selection(selection->n_faces,
+ &(selection->compact_face_gnum),
+ &(selection->compact_rank_index));
+
+ assert(selection->n_g_faces == selection->compact_rank_index[n_ranks]);
+
+ /* Extract selected vertices from the selected border faces */
+
+ _extract_vertices(selection->n_faces,
+ selection->faces,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ mesh->n_vertices,
+ &(selection->n_vertices),
+ &(selection->vertices));
+
+ /* Extract list of border faces contiguous to the selected vertices */
+
+ _extract_contig_faces(mesh->n_vertices,
+ selection->n_vertices,
+ selection->vertices,
+ mesh->n_b_faces,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ &(selection->n_b_adj_faces),
+ &(selection->b_adj_faces));
+
+ /* Remove border faces already defined in selection->faces */
+
+ _clean_selection(&(selection->n_b_adj_faces),
+ &(selection->b_adj_faces),
+ selection->n_faces,
+ selection->faces);
+
+ /* Extract list of interior faces contiguous to the selected vertices */
+
+ _extract_contig_faces(mesh->n_vertices,
+ selection->n_vertices,
+ selection->vertices,
+ mesh->n_i_faces,
+ mesh->i_face_vtx_idx,
+ mesh->i_face_vtx_lst,
+ &(selection->n_i_adj_faces),
+ &(selection->i_adj_faces));
+
+ /* Check if there is no forgotten vertex in the selection.
+ Otherwise define structures to enable future synchronization.
+ Only possible in parallel. */
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1)
+ _get_single_elements(mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ mesh->i_face_vtx_idx,
+ mesh->i_face_vtx_lst,
+ mesh->n_vertices,
+ mesh->global_vtx_num,
+ selection);
+#endif
+
+ /* Display information according to the level of verbosity */
+
+ if (verbosity > 1) {
+
+ bft_printf("\n Compact index on ranks for the selected faces:\n");
+ for (i = 0; i < n_ranks + 1; i++)
+ bft_printf(" %5d | %11u\n", i, selection->compact_rank_index[i]);
+ bft_printf("\n");
+
+ if (verbosity > 2) {
+
+ if (selection->do_single_sync == true) {
+ bft_printf("\n Information about single/coupled elements:\n");
+ bft_printf(" Number of single vertices : %6d with %3d related ranks\n",
+ selection->s_vertices->n_elts, selection->s_vertices->n_ranks);
+ bft_printf(" Number of coupled vertices: %6d with %3d related ranks\n",
+ selection->c_vertices->n_elts, selection->c_vertices->n_ranks);
+ bft_printf(" Number of single edges : %6d with %3d related ranks\n",
+ selection->s_edges->n_elts, selection->s_edges->n_ranks);
+ bft_printf(" Number of coupled edges : %6d with %3d related ranks\n",
+ selection->c_edges->n_elts, selection->c_edges->n_ranks);
+ }
+
+ bft_printf(_("\n Selected faces for the joining operation:\n"));
+ for (i = 0; i < selection->n_faces; i++)
+ bft_printf(" %9d | %9d | %10u | %10u\n",
+ i, selection->faces[i], selection->compact_face_gnum[i],
+ selection->cell_gnum[i]);
+ bft_printf("\n");
+
+ bft_printf(_("\n Select vertices for the joining operation:\n"));
+ for (i = 0; i < selection->n_vertices; i++)
+ bft_printf(" %9d | %9d\n", i, selection->vertices[i]);
+ bft_printf("\n");
+
+ if (verbosity > 3) {
+
+ bft_printf
+ (_("\n Contiguous border faces for the joining operation:\n"));
+ for (i = 0; i < selection->n_b_adj_faces; i++)
+ bft_printf(" %9d | %9d\n", i, selection->b_adj_faces[i]);
+ bft_printf("\n");
+
+ bft_printf
+ (_("\n Contiguous interior faces for the joining operation:\n"));
+ for (i = 0; i < selection->n_i_adj_faces; i++)
+ bft_printf(" %9d | %9d\n", i, selection->i_adj_faces[i]);
+ bft_printf("\n");
+
+ } /* End if verbosity > 3 */
+
+ } /* End if verbosity > 2 */
+
+ bft_printf_flush();
+
+ } /* End if verbosity > 1 */
+
+ return selection;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a cs_join_select_t structure.
+ *
+ * parameters:
+ * join_select <-- pointer to pointer to structure to destroy
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_select_destroy(cs_join_select_t **join_select)
+{
+ if (*join_select != NULL) {
+
+ cs_join_select_t *_js = *join_select;
+
+ BFT_FREE(_js->faces);
+ BFT_FREE(_js->compact_face_gnum);
+ BFT_FREE(_js->cell_filter);
+ BFT_FREE(_js->cell_cen);
+ BFT_FREE(_js->cell_gnum);
+ BFT_FREE(_js->compact_rank_index);
+ BFT_FREE(_js->vertices);
+ BFT_FREE(_js->b_adj_faces);
+ BFT_FREE(_js->i_adj_faces);
+
+ _destroy_join_sync(&(_js->s_vertices));
+ _destroy_join_sync(&(_js->c_vertices));
+ _destroy_join_sync(&(_js->s_edges));
+ _destroy_join_sync(&(_js->c_edges));
+
+ BFT_FREE(*join_select);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Build vertex -> vertex index for a selection of faces.
+ *
+ * "v2v_idx" is already allocated to the number of vertices in the mesh.
+ * At this stage, it is just a counter.
+ *
+ * parameters:
+ * n_faces <-- number of selected faces
+ * faces <-- list of selected faces
+ * f2v_idx <-- face -> vertex connectivity index
+ * f2v_lst <-- face -> vertex connectivity list
+ * v2v_idx <-> index to build (already allocated and may be used again)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_build_edges_idx(cs_int_t n_faces,
+ const cs_int_t faces[],
+ const cs_int_t f2v_idx[],
+ const cs_int_t f2v_lst[],
+ cs_int_t v2v_idx[])
+{
+ cs_int_t i, j, v1, v2, fid, s, e;
+
+ /* Loop on all selected faces. No need to loop on other faces because
+ the selected vertices are all found with this only step. */
+
+ for (i = 0; i < n_faces; i++) {
+
+ fid = faces[i] - 1;
+ s = f2v_idx[fid] - 1;
+ e = f2v_idx[fid+1] - 1;
+
+ for (j = s; j < e - 1; j++) { /* scan edges */
+
+ v1 = f2v_lst[j];
+ v2 = f2v_lst[j+1];
+
+ if (v1 < v2)
+ v2v_idx[v1] += 1;
+ else if (v2 < v1)
+ v2v_idx[v2] += 1;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Inconsistent mesh definition. Cannot build edges.\n"
+ " Face %d has the same vertex %d twice.\n"), fid+1, v1);
+
+ }
+
+ /* Last edge */
+
+ v1 = f2v_lst[e-1];
+ v2 = f2v_lst[s];
+
+ if (v1 < v2)
+ v2v_idx[v1] += 1;
+ else if (v2 < v1)
+ v2v_idx[v2] += 1;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Inconsistent mesh definition. Cannot build edges.\n"
+ " Face %d has the same vertex %d twice.\n"), fid+1, v1);
+
+ } /* End of loop on selected faces */
+}
+
+/*----------------------------------------------------------------------------
+ * Build vertex -> vertex list for a selection of faces.
+ * "count" and "v2v_lst" are already allocated to the number of vertices in
+ * the mesh.
+ *
+ * parameters:
+ * n_faces <-- number of selected faces
+ * faces <-- list of selected faces
+ * f2v_idx <-- face -> vertex connectivity index
+ * f2v_lst <-- face -> vertex connectivity list
+ * count <-> array used to count the number of values already added
+ * v2v_idx <-- vertex -> vertex connect. index
+ * v2v_lst <-> vertex -> vertex connect. list to build (can be used again)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_join_build_edges_lst(cs_int_t n_faces,
+ const cs_int_t faces[],
+ const cs_int_t f2v_idx[],
+ const cs_int_t f2v_lst[],
+ cs_int_t count[],
+ const cs_int_t v2v_idx[],
+ cs_int_t v2v_lst[])
+{
+ cs_int_t i, j, v1_id, v2_id, fid, s, e, shift;
+
+ for (i = 0; i < n_faces; i++) {
+
+ fid = faces[i] - 1;
+ s = f2v_idx[fid] - 1;
+ e = f2v_idx[fid+1] - 1;
+
+ for (j = s; j < e - 1; j++) { /* Scan edges */
+
+ v1_id = f2v_lst[j] - 1;
+ v2_id = f2v_lst[j+1] - 1;
+
+ if (v1_id < v2_id) {
+ shift = v2v_idx[v1_id] + count[v1_id];
+ v2v_lst[shift] = v2_id + 1;
+ count[v1_id] += 1;
+ }
+ else if (v2_id < v1_id) {
+ shift = v2v_idx[v2_id] + count[v2_id];
+ v2v_lst[shift] = v1_id + 1;
+ count[v2_id] += 1;
+ }
+
+ }
+
+ /* Last edge */
+
+ v1_id = f2v_lst[e-1] - 1;
+ v2_id = f2v_lst[s] - 1;
+
+ if (v1_id < v2_id) {
+ shift = v2v_idx[v1_id] + count[v1_id];
+ v2v_lst[shift] = v2_id + 1;
+ count[v1_id] += 1;
+ }
+ else if (v2_id < v1_id) {
+ shift = v2v_idx[v2_id] + count[v2_id];
+ v2v_lst[shift] = v1_id + 1;
+ count[v2_id] += 1;
+ }
+
+ } /* End of loop on selected faces */
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_matrix.c b/src/base/cs_matrix.c
new file mode 100644
index 0000000..be67f59
--- /dev/null
+++ b/src/base/cs_matrix.c
@@ -0,0 +1,2926 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Sparse Matrix Representation and Operations.
+ *============================================================================*/
+
+/*
+ * Notes:
+ *
+ * The aim of these structures and associated functions is multiple:
+ *
+ * - Provide an "opaque" matrix object for linear solvers, allowing possible
+ * choice of the matrix type based on run-time tuning at code initialization
+ * (depending on matrix size, architecture, and compiler, the most efficient
+ * structure for matrix.vector products may vary).
+ *
+ * - Provide at least a CSR matrix structure in addition to the "native"
+ * matrix structure, as this may allow us to leverage existing librairies.
+ *
+ * - Provide a C interface, also so as to be able to interface more easily
+ * with external libraries.
+ *
+ * The structures used here could easily be extended to block matrixes,
+ * using for example the same structure information with 3x3 blocks which
+ * could arise from coupled velocity components. This would imply that the
+ * corresponding vectors be interlaced (or an interlaced copy be used
+ * for recurring operations such as sparse linear system resolution),
+ * for better memory locality, and possible loop unrolling.
+ */
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(__STDC_VERSION__) /* size_t */
+#if (__STDC_VERSION__ == 199901L)
+# include <stddef.h>
+# else
+# include <stdlib.h>
+# endif
+#else
+#include <stdlib.h>
+#endif
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+#include "cs_numbering.h"
+#include "cs_prototypes.h"
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_matrix.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/* Variant for Intel compiler and on Itanium only (optimized by BULL)
+ (Use compile flag -DNO_BULL_OPTIM to switch back to general code) */
+
+#if (defined(__INTEL_COMPILER) && defined(__ia64__) && !defined(NO_BULL_OPTIM))
+
+#define IA64_OPTIM
+#define IA64_OPTIM_L1_CACHE_SIZE (508)
+
+#endif
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/* Formats currently supported:
+ *
+ * - Native
+ * - Compressed Sparse Row (CSR)
+ */
+
+/* Function pointer types */
+/*------------------------*/
+
+typedef void
+(cs_matrix_set_coeffs_t) (cs_matrix_t *matrix,
+ cs_bool_t symmetric,
+ const cs_real_t *restrict da,
+ const cs_real_t *restrict xa);
+
+typedef void
+(cs_matrix_release_coeffs_t) (cs_matrix_t *matrix);
+
+typedef void
+(cs_matrix_get_diagonal_t) (const cs_matrix_t *matrix,
+ cs_real_t *restrict da);
+
+typedef void
+(cs_matrix_vector_product_t) (const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y);
+
+typedef void
+(cs_matrix_alpha_a_x_p_beta_y_t) (cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y);
+
+/*----------------------------------------------------------------------------
+ * Local Structure Definitions
+ *----------------------------------------------------------------------------*/
+
+/* Native matrix structure representation */
+/*----------------------------------------*/
+
+/* Note: the members of this structure are already available through the top
+ * matrix structure, but are replicated here in case of future removal
+ * from the top structure (which would require computation/assignment of
+ * matrix coefficients in another form) */
+
+typedef struct _cs_matrix_struct_native_t {
+
+ cs_int_t n_cells; /* Local number of cells */
+ cs_int_t n_cells_ext; /* Local number of participating cells
+ (cells + ghost cells sharing a face) */
+ cs_int_t n_faces; /* Local number of faces
+ (for extra-diagonal terms */
+
+ /* Pointers to shared arrays */
+
+ const cs_int_t *face_cell; /* Face -> cells connectivity (1 to n) */
+
+} cs_matrix_struct_native_t;
+
+/* Native matrix coefficients */
+/*----------------------------*/
+
+typedef struct _cs_matrix_coeff_native_t {
+
+ cs_bool_t symmetric; /* Symmetry indicator */
+
+ /* Pointers to possibly shared arrays */
+
+ const cs_real_t *da; /* Diagonal terms */
+ const cs_real_t *xa; /* Extra-diagonal terms */
+
+ /* Pointers to private arrays (NULL if shared) */
+
+ cs_real_t *_da; /* Diagonal terms */
+ cs_real_t *_xa; /* Extra-diagonal terms */
+
+} cs_matrix_coeff_native_t;
+
+/* CSR (Compressed Sparse Row) matrix structure representation */
+/*-------------------------------------------------------------*/
+
+typedef struct _cs_matrix_struct_csr_t {
+
+ cs_bool_t symmetric; /* Symmetry indicator */
+ cs_int_t n_rows; /* Local number of rows */
+ cs_int_t n_cols; /* Local number of columns
+ (> n_rows in case of ghost cells) */
+ cs_int_t n_cols_max; /* Maximum number of nonzero values
+ on a given row */
+
+ /* Pointers to structure arrays and info (row_index, col_id) */
+
+ cs_bool_t direct_assembly; /* True if each value corresponds to
+ a unique face ; false if multiple
+ faces contribute to the same
+ value (i.e. we have split faces) */
+
+ cs_int_t *row_index; /* Row index (0 to n-1) */
+ cs_int_t *col_id; /* Column id (0 to n-1) */
+
+ /* Pointers to optional arrays (built if needed) */
+
+ cs_int_t *diag_index; /* Diagonal index (0 to n-1) for
+ direct access to diagonal terms */
+
+} cs_matrix_struct_csr_t;
+
+/* CSR matrix coefficients representation */
+/*----------------------------------------*/
+
+typedef struct _cs_matrix_coeff_csr_t {
+
+ int n_prefetch_rows; /* Number of rows at a time for which
+ the x values in y = Ax should be
+ prefetched (0 if no prefetch) */
+
+ cs_real_t *val; /* Matrix coefficients */
+
+ cs_real_t *x_prefetch; /* Prefetch array for x in y = Ax */
+
+} cs_matrix_coeff_csr_t;
+
+/* Structure associated with Matrix (representation-independent part) */
+/*--------------------------------------------------------------------*/
+
+struct _cs_matrix_t {
+
+ cs_matrix_type_t type; /* Matrix storage and definition type */
+
+ cs_bool_t periodic; /* Periodicity indicator */
+ cs_bool_t have_diag; /* Has non-zero diagonal */
+
+ cs_int_t n_cells; /* Local number of cells */
+ cs_int_t n_cells_ext; /* Local number of participating cells
+ (cells + ghost cells sharing a face) */
+ cs_int_t n_faces; /* Local Number of mesh faces
+ (necessary to affect coefficients) */
+
+ /* Pointer to possibly shared data */
+
+ const void *structure; /* Matrix structure */
+
+ /* Pointer to private data */
+
+ void *_structure; /* Matrix structure */
+ void *coeffs; /* Matrix coefficients */
+
+ /* Pointers to shared arrays from mesh structure
+ (face->cell connectivity for coefficient assignment,
+ local->local cell numbering for future info or renumbering,
+ and halo) */
+
+ const cs_int_t *face_cell; /* Face -> cells connectivity (1 to n) */
+ const fvm_gnum_t *cell_num; /* Global cell numbers */
+ const cs_halo_t *halo; /* Parallel or periodic halo */
+ const cs_numbering_t *numbering; /* Vectorization or thread-related
+ numbering information */
+
+ /* Function pointers */
+
+ cs_matrix_set_coeffs_t *set_coefficients;
+ cs_matrix_release_coeffs_t *release_coefficients;
+ cs_matrix_get_diagonal_t *get_diagonal;
+
+ cs_matrix_vector_product_t *vector_multiply;
+ cs_matrix_alpha_a_x_p_beta_y_t *alpha_a_x_p_beta_y;
+};
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/* Short names for matrix types */
+
+const char *cs_matrix_type_name[] = {N_("native"),
+ N_("CSR")};
+
+/* Full names for matrix types */
+
+const char *cs_matrix_type_fullname[] = {N_("diagonal + faces"),
+ N_("Compressed Sparse Row")};
+
+static int _cs_glob_matrix_prefetch_rows = 2048;
+
+static char _cs_glob_perio_ignore_error_str[]
+ = N_("Matrix product with CS_PERIO_IGNORE rotation mode not yet\n"
+ "implemented in this case, use cs_matrix_vector_multiply_nosync\n"
+ "with an external halo synchronization, prededed by a backup and\n"
+ "followed by a restoration of the rotation halo.");
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * y[i] = da[i].x[i], with da possibly NULL
+ *
+ * parameters:
+ * da <-- Pointer to coefficients array (usually matrix diagonal)
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ * n_elts <-- Array size
+ *----------------------------------------------------------------------------*/
+
+static inline void
+_diag_vec_p_l(const cs_real_t *restrict da,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y,
+ cs_int_t n_elts)
+{
+ cs_int_t ii;
+
+ #if defined(__xlc__) /* Tell IBM compiler not to alias */
+ #pragma disjoint(*x, *y, *da)
+ #endif
+
+ /* Note: also try with BLAS: DNDOT(n_cells, 1, y, 1, 1, da, x, 1, 1) */
+
+ if (da != NULL) {
+ #pragma omp parallel for
+ for (ii = 0; ii < n_elts; ii++)
+ y[ii] = da[ii] * x[ii];
+ }
+ else {
+ #pragma omp parallel for
+ for (ii = 0; ii < n_elts; ii++)
+ y[ii] = 0.0;
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * y[i] = da[i].x[i], with da possibly NULL
+ *
+ * parameters:
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * da <-- Pointer to coefficients array (usually matrix diagonal)
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ * n_elts <-- Array size
+ *----------------------------------------------------------------------------*/
+
+static inline void
+_diag_x_p_beta_y(cs_real_t alpha,
+ cs_real_t beta,
+ const cs_real_t *restrict da,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y,
+ cs_int_t n_elts)
+{
+ cs_int_t ii;
+
+ #if defined(__xlc__) /* Tell IBM compiler not to alias */
+ #pragma disjoint(*x, *y, *da)
+ #endif
+
+ if (da != NULL) {
+ #pragma omp parallel for firstprivate(alpha, beta)
+ for (ii = 0; ii < n_elts; ii++)
+ y[ii] = (alpha * da[ii] * x[ii]) + (beta * y[ii]);
+ }
+ else {
+ #pragma omp parallel for firstprivate(beta)
+ for (ii = 0; ii < n_elts; ii++)
+ y[ii] *= beta;
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Set values from y[start_id] to y[end_id] to 0.
+ *
+ * parameters:
+ * y --> Resulting vector
+ * start_id <-- start id in array
+ * end_id <-- end id in array
+ *----------------------------------------------------------------------------*/
+
+static inline void
+_zero_range(cs_real_t *restrict y,
+ cs_int_t start_id,
+ cs_int_t end_id)
+{
+ cs_int_t ii;
+
+ #pragma omp parallel for
+ for (ii = start_id; ii < end_id; ii++)
+ y[ii] = 0.0;
+}
+
+/*----------------------------------------------------------------------------
+ * Descend binary tree for the ordering of a fvm_gnum (integer) array.
+ *
+ * parameters:
+ * number <-- pointer to numbers of elements that should be ordered.
+ * (if NULL, a default 1 to n numbering is considered)
+ * level <-- level of the binary tree to descend
+ * n_elts <-- number of elements in the binary tree to descend
+ * order <-> ordering array
+ *----------------------------------------------------------------------------*/
+
+inline static void
+_order_descend_tree(const cs_int_t number[],
+ size_t level,
+ const size_t n_elts,
+ fvm_lnum_t order[])
+{
+ size_t i_save, i1, i2, lv_cur;
+
+ i_save = (size_t)(order[level]);
+
+ while (level <= (n_elts/2)) {
+
+ lv_cur = (2*level) + 1;
+
+ if (lv_cur < n_elts - 1) {
+
+ i1 = (size_t)(order[lv_cur+1]);
+ i2 = (size_t)(order[lv_cur]);
+
+ if (number[i1] > number[i2]) lv_cur++;
+ }
+
+ if (lv_cur >= n_elts) break;
+
+ i1 = i_save;
+ i2 = (size_t)(order[lv_cur]);
+
+ if (number[i1] >= number[i2]) break;
+
+ order[level] = order[lv_cur];
+ level = lv_cur;
+
+ }
+
+ order[level] = i_save;
+}
+
+/*----------------------------------------------------------------------------
+ * Order an array of global numbers.
+ *
+ * parameters:
+ * number <-- array of entity numbers (if NULL, a default 1 to n
+ * numbering is considered)
+ * order <-- pre-allocated ordering table
+ * n_elts <-- number of elements considered
+ *----------------------------------------------------------------------------*/
+
+static void
+_order_local(const cs_int_t number[],
+ cs_int_t order[],
+ const size_t n_elts)
+{
+ size_t i, j, inc;
+ cs_int_t o_save;
+
+ /* Initialize ordering array */
+
+ for (i = 0 ; i < n_elts ; i++)
+ order[i] = i;
+
+ if (n_elts < 2)
+ return;
+
+ /* Use shell sort for short arrays */
+
+ if (n_elts < 20) {
+
+ inc = (n_elts / 2);
+
+ while (inc > 0) {
+ for (i = inc; i < n_elts; i++) {
+ o_save = order[i];
+ j = i;
+ while (j >= inc && number[order[j-inc]] > number[o_save]) {
+ order[j] = order[j-inc];
+ j = j - inc;
+ }
+ order[j] = o_save;
+ }
+ inc = inc / 2.2;
+ }
+
+ }
+
+ else {
+
+ /* Create binary tree */
+
+ i = (n_elts / 2);
+ do {
+ i--;
+ _order_descend_tree(number, i, n_elts, order);
+ } while (i > 0);
+
+ /* Sort binary tree */
+
+ for (i = n_elts - 1 ; i > 0 ; i--) {
+ o_save = order[0];
+ order[0] = order[i];
+ order[i] = o_save;
+ _order_descend_tree(number, 0, i, order);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Create native matrix structure.
+ *
+ * Note that the structure created maps to the given existing
+ * face -> cell connectivity array, so it must be destroyed before this
+ * array (usually the code's main face -> cell structure) is freed.
+ *
+ * parameters:
+ * n_cells <-- Local number of participating cells
+ * n_cells_ext <-- Local number of cells + ghost cells sharing a face
+ * n_faces <-- Local number of faces
+ * face_cell <-- Face -> cells connectivity (1 to n)
+ *
+ * returns:
+ * pointer to allocated native matrix structure.
+ *----------------------------------------------------------------------------*/
+
+static cs_matrix_struct_native_t *
+_create_struct_native(int n_cells,
+ int n_cells_ext,
+ int n_faces,
+ const cs_int_t *face_cell)
+{
+ cs_matrix_struct_native_t *ms;
+
+ /* Allocate and map */
+
+ BFT_MALLOC(ms, 1, cs_matrix_struct_native_t);
+
+ /* Allocate and map */
+
+ ms->n_cells = n_cells;
+ ms->n_cells_ext = n_cells_ext;
+ ms->n_faces = n_faces;
+
+ ms->face_cell = face_cell;
+
+ return ms;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy native matrix structure.
+ *
+ * parameters:
+ * matrix <-> Pointer to native matrix structure pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_destroy_struct_native(cs_matrix_struct_native_t **matrix)
+{
+ if (matrix != NULL && *matrix !=NULL) {
+
+ BFT_FREE(*matrix);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Create native matrix coefficients.
+ *
+ * returns:
+ * pointer to allocated native coefficients structure.
+ *----------------------------------------------------------------------------*/
+
+static cs_matrix_coeff_native_t *
+_create_coeff_native(void)
+{
+ cs_matrix_coeff_native_t *mc;
+
+ /* Allocate */
+
+ BFT_MALLOC(mc, 1, cs_matrix_coeff_native_t);
+
+ /* Initialize */
+
+ mc->da = NULL;
+ mc->xa = NULL;
+
+ mc->_da = NULL;
+ mc->_xa = NULL;
+
+ return mc;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy native matrix coefficients.
+ *
+ * parameters:
+ * coeff <-> Pointer to native matrix coefficients pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_destroy_coeff_native(cs_matrix_coeff_native_t **coeff)
+{
+ if (coeff != NULL && *coeff !=NULL) {
+
+ BFT_FREE(*coeff);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Set Native matrix coefficients.
+ *
+ * Depending on current options and initialization, values will be copied
+ * or simply mapped.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * symmetric <-- Indicates if extradiagonal values are symmetric
+ * da <-- Diagonal values
+ * xa <-- Extradiagonal values
+ *----------------------------------------------------------------------------*/
+
+static void
+_set_coeffs_native(cs_matrix_t *matrix,
+ cs_bool_t symmetric,
+ const cs_real_t *da,
+ const cs_real_t *xa)
+{
+ cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+
+ mc->symmetric = symmetric;
+
+ /* Map or copy values */
+
+ if (da != NULL && matrix->have_diag == true) {
+
+ if (mc->_da == NULL)
+ mc->da = da;
+ else {
+ memcpy(mc->_da, da, sizeof(cs_real_t) * ms->n_cells);
+ mc->da = mc->_da;
+ }
+
+ }
+ else {
+ mc->da = NULL;
+ }
+
+ if (xa != NULL) {
+
+ if (mc->_xa == NULL)
+ mc->xa = xa;
+ else {
+ size_t xa_n_bytes = sizeof(cs_real_t) * ms->n_faces;
+ if (symmetric)
+ xa_n_bytes *= 2;
+ memcpy(mc->_xa, xa, xa_n_bytes);
+ mc->xa = mc->_xa;
+ }
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Release native matrix coefficients.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_release_coeffs_native(cs_matrix_t *matrix)
+{
+ cs_matrix_coeff_native_t *mc = matrix->coeffs;
+
+ if (mc !=NULL) {
+
+ /* Unmap values */
+
+ mc->da = NULL;
+ mc->xa = NULL;
+
+ /* Possibly allocated mc->_da and mc->_xa arrays are not freed
+ here, but simply unmapped from mc->da and mc->xa;
+ they are remapped when _set_coeffs_native() is used. */
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get diagonal of native matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * da --> Diagonal (pre-allocated, size: n_cells)
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_diagonal_native(const cs_matrix_t *matrix,
+ cs_real_t *restrict da)
+{
+ cs_int_t ii;
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ cs_int_t n_cells = ms->n_cells;
+
+ if (mc->da != NULL) {
+
+ #pragma omp parallel for
+ for (ii = 0; ii < n_cells; ii++)
+ da[ii] = mc->da[ii];
+
+ }
+ else {
+
+ #pragma omp parallel for
+ for (ii = 0; ii < n_cells; ii++)
+ da[ii] = 0.0;
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = A.x with native matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_p_l_native(const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, face_id;
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_real_t *restrict xa1 = mc->xa;
+ const cs_real_t *restrict xa2 = mc->xa + ms->n_faces;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *xa1, *xa2)
+ #endif
+
+ /* Diagonal part of matrix.vector product */
+
+ _diag_vec_p_l(mc->da, x, y, ms->n_cells);
+
+ _zero_range(y, ms->n_cells, ms->n_cells_ext);
+
+ /* Note: parallel and periodic synchronization could be delayed to here */
+
+ /* non-diagonal terms */
+
+ if (mc->xa != NULL) {
+
+ if (mc->symmetric) {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += xa1[face_id] * x[jj];
+ y[jj] += xa1[face_id] * x[ii];
+ }
+
+ }
+ else {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += xa1[face_id] * x[jj];
+ y[jj] += xa2[face_id] * x[ii];
+ }
+
+ }
+
+ }
+
+}
+
+#if defined(HAVE_OPENMP) /* OpenMP variant */
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = A.x with native matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_p_l_native_omp(const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ int g_id, t_id;
+ cs_int_t ii, jj, face_id;
+
+ const int n_threads = matrix->numbering->n_threads;
+ const int n_groups = matrix->numbering->n_groups;
+ const fvm_lnum_t *group_index = matrix->numbering->group_index;
+
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_real_t *restrict xa1 = mc->xa;
+ const cs_real_t *restrict xa2 = mc->xa + ms->n_faces;
+
+ assert(matrix->numbering->type == CS_NUMBERING_THREADS);
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *xa1, *xa2)
+ #endif
+
+ /* Diagonal part of matrix.vector product */
+
+ _diag_vec_p_l(mc->da, x, y, ms->n_cells);
+
+ _zero_range(y, ms->n_cells, ms->n_cells_ext);
+
+ /* Note: parallel and periodic synchronization could be delayed to here */
+
+ /* non-diagonal terms */
+
+ if (mc->xa != NULL) {
+
+
+ if (mc->symmetric) {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (g_id=0; g_id < n_groups; g_id++) {
+
+ #pragma omp parallel for private(face_id, ii, jj)
+ for (t_id=0; t_id < n_threads; t_id++) {
+
+ for (face_id = group_index[(t_id*n_groups + g_id)*2];
+ face_id < group_index[(t_id*n_groups + g_id)*2 + 1];
+ face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += xa1[face_id] * x[jj];
+ y[jj] += xa1[face_id] * x[ii];
+ }
+ }
+ }
+ }
+ else {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (g_id=0; g_id < n_groups; g_id++) {
+
+ #pragma omp parallel for private(face_id, ii, jj)
+ for (t_id=0; t_id < n_threads; t_id++) {
+
+ for (face_id = group_index[(t_id*n_groups + g_id)*2];
+ face_id < group_index[(t_id*n_groups + g_id)*2 + 1];
+ face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += xa1[face_id] * x[jj];
+ y[jj] += xa2[face_id] * x[ii];
+ }
+ }
+ }
+ }
+
+ }
+
+}
+
+#endif /* defined(HAVE_OPENMP) */
+
+#if defined(IA64_OPTIM) /* Special variant for IA64 */
+
+static void
+_mat_vec_p_l_native_ia64(const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, ii_prev, kk, face_id, kk_max;
+ cs_real_t y_it, y_it_prev;
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_real_t *restrict da = mc->da;
+ const cs_real_t *restrict xa1 = mc->xa;
+ const cs_real_t *restrict xa2 = mc->xa + ms->n_faces;
+
+ /* Diagonal part of matrix.vector product */
+
+ /* Note: also try with BLAS: DNDOT(n_cells, 1, y, 1, 1, da, x, 1, 1) */
+
+ if (mc->da != NULL) {
+ for (ii = 0; ii < ms->n_cells; ii++)
+ y[ii] = da[ii] * x[ii];
+ }
+ else {
+ for (ii = 0; ii < ms->n_cells; y[ii++] = 0.0);
+ }
+
+ for (ii = ms->n_cells; ii < ms->n_cells_ext; y[ii++] = 0.0);
+
+ /* Note: parallel and periodic synchronization could be delayed to here */
+
+ /* non-diagonal terms */
+
+ if (mc->xa != NULL) {
+
+ /*
+ * 1/ Split y[ii] and y[jj] computation into 2 loops to remove compiler
+ * data dependency assertion between y[ii] and y[jj].
+ * 2/ keep index (*face_cel_p) in L1 cache from y[ii] loop to y[jj] loop
+ * and xa1 in L2 cache.
+ * 3/ break high frequency occurence of data dependency from one iteration
+ * to another in y[ii] loop (nonzero matrix value on the same line ii).
+ */
+
+ if (mc->symmetric) {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (face_id = 0;
+ face_id < ms->n_faces;
+ face_id += IA64_OPTIM_L1_CACHE_SIZE) {
+
+ kk_max = CS_MIN((ms->n_faces - face_id),
+ IA64_OPTIM_L1_CACHE_SIZE);
+
+ /* sub-loop to compute y[ii] += xa1[face_id] * x[jj] */
+
+ ii = face_cel_p[0] - 1;
+ ii_prev = ii;
+ y_it_prev = y[ii_prev] + xa1[face_id] * x[face_cel_p[1] - 1];
+
+ for (kk = 1; kk < kk_max; ++kk) {
+ ii = face_cel_p[2*kk] - 1;
+ /* y[ii] += xa1[face_id+kk] * x[jj]; */
+ if (ii == ii_prev) {
+ y_it = y_it_prev;
+ }
+ else {
+ y_it = y[ii];
+ y[ii_prev] = y_it_prev;
+ }
+ ii_prev = ii;
+ y_it_prev = y_it + xa1[face_id+kk] * x[face_cel_p[2*kk+1] - 1];
+ }
+ y[ii] = y_it_prev;
+
+ /* sub-loop to compute y[ii] += xa1[face_id] * x[jj] */
+
+ for (kk = 0; kk < kk_max; ++kk) {
+ y[face_cel_p[2*kk+1] - 1]
+ += xa1[face_id+kk] * x[face_cel_p[2*kk] - 1];
+ }
+ face_cel_p += 2 * IA64_OPTIM_L1_CACHE_SIZE;
+ }
+
+ }
+ else {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (face_id = 0;
+ face_id < ms->n_faces;
+ face_id+=IA64_OPTIM_L1_CACHE_SIZE) {
+
+ kk_max = CS_MIN((ms->n_faces - face_id),
+ IA64_OPTIM_L1_CACHE_SIZE);
+
+ /* sub-loop to compute y[ii] += xa1[face_id] * x[jj] */
+
+ ii = face_cel_p[0] - 1;
+ ii_prev = ii;
+ y_it_prev = y[ii_prev] + xa1[face_id] * x[face_cel_p[1] - 1];
+
+ for (kk = 1; kk < kk_max; ++kk) {
+ ii = face_cel_p[2*kk] - 1;
+ /* y[ii] += xa1[face_id+i] * x[jj]; */
+ if (ii == ii_prev) {
+ y_it = y_it_prev;
+ }
+ else {
+ y_it = y[ii];
+ y[ii_prev] = y_it_prev;
+ }
+ ii_prev = ii;
+ y_it_prev = y_it + xa1[face_id+kk] * x[face_cel_p[2*kk+1] - 1];
+ }
+ y[ii] = y_it_prev;
+
+ /* sub-loop to compute y[ii] += xa2[face_id] * x[jj] */
+
+ for (kk = 0; kk < kk_max; ++kk) {
+ y[face_cel_p[2*kk+1] - 1]
+ += xa2[face_id+kk] * x[face_cel_p[2*kk] - 1];
+ }
+ face_cel_p += 2 * IA64_OPTIM_L1_CACHE_SIZE;
+ }
+
+ }
+
+ }
+
+}
+
+#endif /* defined(IA64_OPTIM) */
+
+#if defined(SX) && defined(_SX) /* For vector machines */
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = A.x with native matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_p_l_native_vector(const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, face_id;
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_real_t *restrict xa1 = mc->xa;
+ const cs_real_t *restrict xa2 = mc->xa + ms->n_faces;
+
+ assert(matrix->numbering->type == CS_NUMBERING_VECTORIZE);
+
+ /* Diagonal part of matrix.vector product */
+
+ _diag_vec_p_l(mc->da, x, y, ms->n_cells);
+
+ _zero_range(y, ms->n_cells, ms->n_cells_ext);
+
+ /* Note: parallel and periodic synchronization could be delayed to here */
+
+ /* non-diagonal terms */
+
+ if (mc->xa != NULL) {
+
+ if (mc->symmetric) {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ #pragma dir nodep
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += xa1[face_id] * x[jj];
+ y[jj] += xa1[face_id] * x[ii];
+ }
+
+ }
+ else {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ #pragma dir nodep
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += xa1[face_id] * x[jj];
+ y[jj] += xa2[face_id] * x[ii];
+ }
+
+ }
+
+ }
+
+}
+
+#endif /* Vector machine variant */
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = alpha.A.x + beta.y with native matrix.
+ *
+ * parameters:
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y <-> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_alpha_a_x_p_beta_y_native(cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, face_id;
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_real_t *restrict xa1 = mc->xa;
+ const cs_real_t *restrict xa2 = mc->xa + ms->n_faces;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *xa1, *xa2)
+ #endif
+
+ /* Diagonal part of matrix.vector product */
+
+ _diag_x_p_beta_y(alpha, beta, mc->da, x, y, ms->n_cells);
+
+ _zero_range(y, ms->n_cells, ms->n_cells_ext);
+
+ /* Note: parallel and periodic synchronization could be delayed to here */
+
+ /* non-diagonal terms */
+
+ if (mc->xa != NULL) {
+
+ if (mc->symmetric) {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += alpha * xa1[face_id] * x[jj];
+ y[jj] += alpha * xa1[face_id] * x[ii];
+ }
+
+ }
+ else {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += alpha * xa1[face_id] * x[jj];
+ y[jj] += alpha * xa2[face_id] * x[ii];
+ }
+
+ }
+
+ }
+
+}
+
+#if defined(HAVE_OPENMP) /* OpenMP variant */
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = alpha.A.x + beta.y with native matrix.
+ *
+ * parameters:
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y <-> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_alpha_a_x_p_beta_y_native_omp(cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ int g_id, t_id;
+ cs_int_t ii, jj, face_id;
+
+ const int n_threads = matrix->numbering->n_threads;
+ const int n_groups = matrix->numbering->n_groups;
+ const fvm_lnum_t *group_index = matrix->numbering->group_index;
+
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_real_t *restrict xa1 = mc->xa;
+ const cs_real_t *restrict xa2 = mc->xa + ms->n_faces;
+
+ assert(matrix->numbering->type == CS_NUMBERING_THREADS);
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *xa1, *xa2)
+ #endif
+
+ /* Diagonal part of matrix.vector product */
+
+ _diag_x_p_beta_y(alpha, beta, mc->da, x, y, ms->n_cells);
+
+ _zero_range(y, ms->n_cells, ms->n_cells_ext);
+
+ /* Note: parallel and periodic synchronization could be delayed to here */
+
+ /* non-diagonal terms */
+
+ if (mc->xa != NULL) {
+
+ if (mc->symmetric) {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (g_id=0; g_id < n_groups; g_id++) {
+
+ #pragma omp parallel for private(face_id, ii, jj)
+ for (t_id=0; t_id < n_threads; t_id++) {
+
+ for (face_id = group_index[(t_id*n_groups + g_id)*2];
+ face_id < group_index[(t_id*n_groups + g_id)*2 + 1];
+ face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += alpha * xa1[face_id] * x[jj];
+ y[jj] += alpha * xa1[face_id] * x[ii];
+ }
+ }
+
+ }
+
+ }
+ else {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ for (g_id=0; g_id < n_groups; g_id++) {
+
+ #pragma omp parallel for private(face_id, ii, jj)
+ for (t_id=0; t_id < n_threads; t_id++) {
+
+ for (face_id = group_index[(t_id*n_groups + g_id)*2];
+ face_id < group_index[(t_id*n_groups + g_id)*2 + 1];
+ face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += alpha * xa1[face_id] * x[jj];
+ y[jj] += alpha * xa2[face_id] * x[ii];
+ }
+ }
+ }
+
+ }
+
+ } /* if mc-> xa != NULL */
+
+}
+
+#endif
+
+#if defined(SX) && defined(_SX) /* For vector machines */
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = alpha.A.x + beta.y with native matrix.
+ *
+ * parameters:
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y <-> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_alpha_a_x_p_beta_y_native_vector(cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, face_id;
+ const cs_matrix_struct_native_t *ms = matrix->structure;
+ const cs_matrix_coeff_native_t *mc = matrix->coeffs;
+ const cs_real_t *restrict xa1 = mc->xa;
+ const cs_real_t *restrict xa2 = mc->xa + ms->n_faces;
+
+ assert(matrix->numbering->type == CS_NUMBERING_VECTORIZE);
+
+ /* Diagonal part of matrix.vector product */
+
+ _diag_x_p_beta_y(alpha, beta, mc->da, x, y, ms->n_cells);
+
+ _zero_range(y, ms->n_cells, ms->n_cells_ext);
+
+ /* Note: parallel and periodic synchronization could be delayed to here */
+
+ /* non-diagonal terms */
+
+ if (mc->xa != NULL) {
+
+ if (mc->symmetric) {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ #pragma cdir nodep
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += alpha * xa1[face_id] * x[jj];
+ y[jj] += alpha * xa1[face_id] * x[ii];
+ }
+
+ }
+ else {
+
+ const cs_int_t *restrict face_cel_p = ms->face_cell;
+
+ #pragma cdir nodep
+ for (face_id = 0; face_id < ms->n_faces; face_id++) {
+ ii = face_cel_p[2*face_id] -1;
+ jj = face_cel_p[2*face_id + 1] -1;
+ y[ii] += alpha * xa1[face_id] * x[jj];
+ y[jj] += alpha * xa2[face_id] * x[ii];
+ }
+
+ }
+
+ }
+
+}
+
+#endif /* Vector machine variant */
+
+/*----------------------------------------------------------------------------
+ * Create a CSR matrix structure from a native matrix stucture.
+ *
+ * Note that the structure created maps global cell numbers to the given
+ * existing face -> cell connectivity array, so it must be destroyed before
+ * this array (usually the code's global cell numbering) is freed.
+ *
+ * parameters:
+ * symmetric <-- Indicates if symmetric variant should be used
+ * have_diag <-- Indicates if the diagonal is nonzero
+ * (forced to true for symmetric variant)
+ * n_cells <-- Local number of participating cells
+ * n_cells_ext <-- Local number of cells + ghost cells sharing a face
+ * n_faces <-- Local number of faces
+ * cell_num <-- Global cell numbers (1 to n)
+ * face_cell <-- Face -> cells connectivity (1 to n)
+ *
+ * returns:
+ * pointer to allocated CSR matrix structure.
+ *----------------------------------------------------------------------------*/
+
+static cs_matrix_struct_csr_t *
+_create_struct_csr(cs_bool_t symmetric,
+ cs_bool_t have_diag,
+ int n_cells,
+ int n_cells_ext,
+ int n_faces,
+ const cs_int_t *face_cell)
+{
+ int n_cols_max;
+ cs_int_t ii, jj, face_id;
+ const cs_int_t *restrict face_cel_p;
+
+ cs_int_t diag_elts = 1;
+ cs_int_t *ccount = NULL;
+
+ cs_matrix_struct_csr_t *ms;
+
+ /* Allocate and map */
+
+ BFT_MALLOC(ms, 1, cs_matrix_struct_csr_t);
+
+ ms->symmetric = symmetric;
+
+ ms->n_rows = n_cells;
+ ms->n_cols = n_cells_ext;
+
+ ms->direct_assembly = true;
+
+ BFT_MALLOC(ms->row_index, ms->n_rows + 1, cs_int_t);
+ ms->row_index = ms->row_index;
+
+ ms->diag_index = NULL; /* Diagonal index only built if required */
+
+ /* Count number of nonzero elements per row */
+
+ BFT_MALLOC(ccount, ms->n_cols, cs_int_t);
+
+ if (have_diag == false)
+ diag_elts = 0;
+
+ for (ii = 0; ii < ms->n_rows; ii++) /* count starting with diagonal terms */
+ ccount[ii] = diag_elts;
+
+ if (face_cell != NULL) {
+
+ face_cel_p = face_cell;
+
+ if (symmetric == false) {
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ ccount[ii] += 1;
+ ccount[jj] += 1;
+ }
+
+ }
+ else { /* if symmetric == true */
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < jj)
+ ccount[ii] += 1;
+ else
+ ccount[jj] += 1;
+ }
+
+ }
+
+ } /* if (face_cell != NULL) */
+
+ n_cols_max = 0;
+
+ ms->row_index[0] = 0;
+ for (ii = 0; ii < ms->n_rows; ii++) {
+ ms->row_index[ii+1] = ms->row_index[ii] + ccount[ii];
+ if (ccount[ii] > n_cols_max)
+ n_cols_max = ccount[ii];
+ ccount[ii] = diag_elts; /* pre-count for diagonal terms */
+ }
+
+ ms->n_cols_max = n_cols_max;
+
+ /* Build structure */
+
+ BFT_MALLOC(ms->col_id, (ms->row_index[ms->n_rows]), cs_int_t);
+ ms->col_id = ms->col_id;
+
+ if (have_diag == true) {
+ for (ii = 0; ii < ms->n_rows; ii++) { /* diagonal terms */
+ ms->col_id[ms->row_index[ii]] = ii;
+ }
+ }
+
+ if (face_cell != NULL) { /* non-diagonal terms */
+
+ face_cel_p = face_cell;
+
+ if (symmetric == false) {
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < ms->n_rows) {
+ ms->col_id[ms->row_index[ii] + ccount[ii]] = jj;
+ ccount[ii] += 1;
+ }
+ if (jj < ms->n_rows) {
+ ms->col_id[ms->row_index[jj] + ccount[jj]] = ii;
+ ccount[jj] += 1;
+ }
+ }
+
+ }
+ else { /* if symmetric == true */
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < jj && ii < ms->n_rows) {
+ ms->col_id[ms->row_index[ii] + ccount[ii]] = jj;
+ ccount[ii] += 1;
+ }
+ else if (ii > jj && jj < ms->n_rows) {
+ ms->col_id[ms->row_index[jj] + ccount[jj]] = ii;
+ ccount[jj] += 1;
+ }
+ }
+
+ }
+
+ } /* if (face_cell != NULL) */
+
+ BFT_FREE(ccount);
+
+ /* Sort line elements by column id (for better access patterns) */
+
+ if (n_cols_max > 1) {
+
+ cs_int_t *order = NULL;
+ cs_int_t *new_col_id = NULL;
+
+ BFT_MALLOC(order, n_cols_max, fvm_lnum_t);
+ BFT_MALLOC(new_col_id, n_cols_max, cs_int_t);
+
+ for (ii = 0; ii < ms->n_rows; ii++) {
+ cs_int_t *col_id = ms->col_id + ms->row_index[ii];
+ cs_int_t n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+ cs_int_t col_id_prev = -1;
+ _order_local(col_id,
+ order,
+ ms->row_index[ii+1] - ms->row_index[ii]);
+ for (jj = 0; jj < n_cols; jj++) {
+ new_col_id[jj] = col_id[order[jj]];
+ if (new_col_id[jj] == col_id_prev)
+ ms->direct_assembly = false;
+ col_id_prev = new_col_id[jj];
+ }
+ memcpy(col_id, new_col_id, n_cols*sizeof(cs_int_t));
+ }
+
+ BFT_FREE(new_col_id);
+ BFT_FREE(order);
+
+ }
+
+ /* Compact elements if necessary */
+
+ if (ms->direct_assembly == false) {
+
+ cs_int_t *tmp_row_index = NULL;
+ cs_int_t kk = 0;
+
+ BFT_MALLOC(tmp_row_index, ms->n_rows+1, cs_int_t);
+ memcpy(tmp_row_index, ms->row_index, (ms->n_rows+1)*sizeof(cs_int_t));
+
+ kk = 0;
+
+ for (ii = 0; ii < ms->n_rows; ii++) {
+ cs_int_t *col_id = ms->col_id + ms->row_index[ii];
+ cs_int_t n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+ cs_int_t col_id_prev = -1;
+ ms->row_index[ii] = kk;
+ for (jj = 0; jj < n_cols; jj++) {
+ if (col_id_prev != col_id[jj]) {
+ ms->col_id[kk++] = col_id[jj];
+ col_id_prev = col_id[jj];
+ }
+ }
+ }
+ ms->row_index[ms->n_rows] = kk;
+
+ assert(ms->row_index[ms->n_rows] < tmp_row_index[ms->n_rows]);
+
+ BFT_FREE(tmp_row_index);
+ BFT_REALLOC(ms->col_id, (ms->row_index[ms->n_rows]), cs_int_t);
+
+ }
+
+ return ms;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy CSR matrix structure.
+ *
+ * parameters:
+ * matrix <-> Pointer to CSR matrix structure pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_destroy_struct_csr(cs_matrix_struct_csr_t **matrix)
+{
+ if (matrix != NULL && *matrix !=NULL) {
+
+ cs_matrix_struct_csr_t *ms = *matrix;
+
+ if (ms->row_index != NULL)
+ BFT_FREE(ms->row_index);
+
+ if (ms->col_id != NULL)
+ BFT_FREE(ms->col_id);
+
+ if (ms->diag_index != NULL)
+ BFT_FREE(ms->diag_index);
+
+ BFT_FREE(ms);
+
+ *matrix = ms;
+
+ }
+}
+
+#if 0
+/*----------------------------------------------------------------------------
+ * Add a diagonal index to a CSR matrix structure, if applicable.
+ *
+ * parameters:
+ * ms <-> Matrix structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_add_diag_index_struct_csr(cs_matrix_struct_csr_t *ms)
+{
+ cs_int_t ii;
+
+ /* No need to add a diagonal index for a symmetric matrix, as
+ columns are sorted and thus diag_index[ii] == row_index[ii] */
+
+ if (ms->symmetric == true || ms->diag_index != NULL)
+ return;
+
+ BFT_MALLOC(ms->diag_index, ms->n_rows, cs_int_t);
+
+ for (ii = 0; ii < ms->n_rows; ii++) {
+ cs_int_t kk;
+ for (kk = ms->row_index[ii]; kk < ms->row_index[ii+1]; kk++);
+ if (ms->col_id[kk] == ii) {
+ ms->diag_index[ii] = kk;
+ break;
+ }
+ if (kk == ms->row_index[ii+1]) { /* if some rows have no diagonal value */
+ BFT_FREE(ms->diag_index);
+ return;
+ }
+ }
+
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ * Create CSR matrix coefficients.
+ *
+ * returns:
+ * pointer to allocated CSR coefficients structure.
+ *----------------------------------------------------------------------------*/
+
+static cs_matrix_coeff_csr_t *
+_create_coeff_csr(void)
+{
+ cs_matrix_coeff_csr_t *mc;
+
+ /* Allocate */
+
+ BFT_MALLOC(mc, 1, cs_matrix_coeff_csr_t);
+
+ /* Initialize */
+
+ mc->n_prefetch_rows = _cs_glob_matrix_prefetch_rows;
+
+ mc->val = NULL;
+
+ mc->x_prefetch = NULL;
+
+ return mc;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy CSR matrix coefficients.
+ *
+ * parameters:
+ * coeff <-> Pointer to CSR matrix coefficients pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_destroy_coeff_csr(cs_matrix_coeff_csr_t **coeff)
+{
+ if (coeff != NULL && *coeff !=NULL) {
+
+ cs_matrix_coeff_csr_t *mc = *coeff;
+
+ if (mc->val != NULL)
+ BFT_FREE(mc->val);
+
+ if (mc->x_prefetch != NULL)
+ BFT_FREE(mc->x_prefetch);
+
+ BFT_FREE(*coeff);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Set CSR extradiagonal matrix coefficients for the case where direct
+ * assignment is possible (i.e. when there are no multiple contributions
+ * to a given coefficient).
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * symmetric <-- Indicates if extradiagonal values are symmetric
+ * xa <-- Extradiagonal values
+ *----------------------------------------------------------------------------*/
+
+static void
+_set_xa_coeffs_csr_direct(cs_matrix_t *matrix,
+ cs_bool_t symmetric,
+ const cs_real_t *restrict xa)
+{
+ cs_int_t ii, jj, face_id;
+ cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+
+ /* Copy extra-diagonal values */
+
+ assert(matrix->face_cell != NULL);
+
+ if (symmetric == false) {
+
+ const cs_int_t n_faces = matrix->n_faces;
+ const cs_int_t *restrict face_cel_p = matrix->face_cell;
+
+ const cs_real_t *restrict xa1 = xa;
+ const cs_real_t *restrict xa2 = xa + matrix->n_faces;
+
+ assert(ms->symmetric == false);
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ cs_int_t kk, ll;
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < ms->n_rows) {
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != jj; kk++);
+ mc->val[kk] = xa1[face_id];
+ }
+ if (jj < ms->n_rows) {
+ for (ll = ms->row_index[jj]; ms->col_id[ll] != ii; ll++);
+ mc->val[ll] = xa2[face_id];
+ }
+ }
+
+ }
+ else { /* if symmetric == true */
+
+ if (ms->symmetric == true) {
+
+ const cs_int_t n_faces = matrix->n_faces;
+ const cs_int_t *restrict face_cel_p = matrix->face_cell;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ cs_int_t kk;
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < jj && ii < ms->n_rows) {
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != jj; kk++);
+ mc->val[kk] = xa[face_id];
+ }
+ else if (ii > jj && jj < ms->n_rows) {
+ for (kk = ms->row_index[jj]; ms->col_id[kk] != ii; kk++);
+ mc->val[kk] = xa[face_id];
+ }
+ }
+
+ }
+ else { /* if (ms->symmetric == false) */
+
+ const cs_int_t n_faces = matrix->n_faces;
+ const cs_int_t *restrict face_cel_p = matrix->face_cell;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ cs_int_t kk, ll;
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < ms->n_rows) {
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != jj; kk++);
+ mc->val[kk] = xa[face_id];
+ }
+ if (jj < ms->n_rows) {
+ for (ll = ms->row_index[jj]; ms->col_id[ll] != ii; ll++);
+ mc->val[ll] = xa[face_id];
+ }
+
+ }
+
+ }
+
+ } /* end of condition on coefficients symmetry */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Set CSR extradiagonal matrix coefficients for the case where there are
+ * multiple contributions to a given coefficient).
+ *
+ * The matrix coefficients should have been initialized (i.e. set to 0)
+ * some before using this function.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * symmetric <-- Indicates if extradiagonal values are symmetric
+ * xa <-- Extradiagonal values
+ *----------------------------------------------------------------------------*/
+
+static void
+_set_xa_coeffs_csr_increment(cs_matrix_t *matrix,
+ cs_bool_t symmetric,
+ const cs_real_t *restrict xa)
+{
+ cs_int_t ii, jj, face_id;
+ cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+
+ /* Copy extra-diagonal values */
+
+ assert(matrix->face_cell != NULL);
+
+ if (symmetric == false) {
+
+ const cs_int_t n_faces = matrix->n_faces;
+ const cs_int_t *restrict face_cel_p = matrix->face_cell;
+
+ const cs_real_t *restrict xa1 = xa;
+ const cs_real_t *restrict xa2 = xa + matrix->n_faces;
+
+ assert(ms->symmetric == false);
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ cs_int_t kk, ll;
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < ms->n_rows) {
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != jj; kk++);
+ mc->val[kk] += xa1[face_id];
+ }
+ if (jj < ms->n_rows) {
+ for (ll = ms->row_index[jj]; ms->col_id[ll] != ii; ll++);
+ mc->val[ll] += xa2[face_id];
+ }
+ }
+
+ }
+ else { /* if symmetric == true */
+
+ if (ms->symmetric == true) {
+
+ const cs_int_t n_faces = matrix->n_faces;
+ const cs_int_t *restrict face_cel_p = matrix->face_cell;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ cs_int_t kk;
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < jj && ii < ms->n_rows) {
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != jj; kk++);
+ mc->val[kk] += xa[face_id];
+ }
+ else if (ii > jj && jj < ms->n_rows) {
+ for (kk = ms->row_index[jj]; ms->col_id[kk] != ii; kk++);
+ mc->val[kk] += xa[face_id];
+ }
+ }
+
+ }
+ else { /* if (ms->symmetric == false) */
+
+ const cs_int_t n_faces = matrix->n_faces;
+ const cs_int_t *restrict face_cel_p = matrix->face_cell;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ cs_int_t kk, ll;
+ ii = *face_cel_p++ - 1;
+ jj = *face_cel_p++ - 1;
+ if (ii < ms->n_rows) {
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != jj; kk++);
+ mc->val[kk] += xa[face_id];
+ }
+ if (jj < ms->n_rows) {
+ for (ll = ms->row_index[jj]; ms->col_id[ll] != ii; ll++);
+ mc->val[ll] += xa[face_id];
+ }
+
+ }
+
+ }
+
+ } /* end of condition on coefficients symmetry */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Set CSR matrix coefficients.
+ *
+ * parameters:
+ * matrix <-> Pointer to matrix structure
+ * symmetric <-- Indicates if extradiagonal values are symmetric
+ * da <-- Diagonal values (NULL if all zero)
+ * xa <-- Extradiagonal values (NULL if all zero)
+ *----------------------------------------------------------------------------*/
+
+static void
+_set_coeffs_csr(cs_matrix_t *matrix,
+ cs_bool_t symmetric,
+ const cs_real_t *restrict da,
+ const cs_real_t *restrict xa)
+{
+ cs_int_t ii, jj;
+ cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+
+ if (mc->val == NULL)
+ BFT_MALLOC(mc->val, ms->row_index[ms->n_rows], cs_real_t);
+
+ /* Initialize coefficients to zero if assembly is incremental */
+
+ if (ms->direct_assembly == false) {
+ cs_int_t val_size = ms->row_index[ms->n_rows];
+ for (ii = 0; ii < val_size; ii++)
+ mc->val[ii] = 0.0;
+ }
+
+ /* Allocate prefetch buffer */
+
+ if (mc->n_prefetch_rows > 0 && mc->x_prefetch == NULL) {
+ size_t prefetch_size = ms->n_cols_max * mc->n_prefetch_rows;
+ size_t matrix_size = matrix->n_cells + (2 * matrix->n_faces);
+ if (matrix_size > prefetch_size)
+ prefetch_size = matrix_size;
+ BFT_MALLOC(mc->x_prefetch, prefetch_size, cs_real_t);
+ }
+
+ /* Copy diagonal values */
+
+ if (matrix->have_diag == true) {
+
+ if (ms->symmetric == false && ms->diag_index == NULL) {
+
+ if (da != NULL) {
+ for (ii = 0; ii < ms->n_rows; ii++) {
+ cs_int_t kk;
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != ii; kk++);
+ mc->val[kk] = da[ii];
+ }
+ }
+ else {
+ for (ii = 0; ii < ms->n_rows; ii++) {
+ cs_int_t kk;
+ for (kk = ms->row_index[ii]; ms->col_id[kk] != ii; kk++);
+ mc->val[kk] = 0.0;
+ }
+ }
+
+ }
+ else { /* If diagonal index is available, direct assignment */
+
+ const cs_int_t *_diag_index
+ = (ms->symmetric == true) ? ms->row_index : ms->diag_index;
+
+ if (da != NULL) {
+ for (ii = 0; ii < ms->n_rows; ii++)
+ mc->val[_diag_index[ii]] = da[ii];
+ }
+ else {
+ for (ii = 0; ii < ms->n_rows; ii++)
+ mc->val[_diag_index[ii]] = 0.0;
+ }
+
+ }
+
+ }
+
+ /* Copy extra-diagonal values */
+
+ if (matrix->face_cell != NULL) {
+
+ if (xa != NULL) {
+
+ if (symmetric == false && ms->symmetric == true)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Assigning non-symmetric matrix coefficients to a matrix\n"
+ "in a symmetric CSR format."));
+
+ if (ms->direct_assembly == true)
+ _set_xa_coeffs_csr_direct(matrix, symmetric, xa);
+ else
+ _set_xa_coeffs_csr_increment(matrix, symmetric, xa);
+
+ }
+ else { /* if (xa == NULL) */
+
+ for (ii = 0; ii < ms->n_rows; ii++) {
+ const cs_int_t *restrict col_id = ms->col_id + ms->row_index[ii];
+ cs_real_t *m_row = mc->val + ms->row_index[ii];
+ cs_int_t n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++) {
+ if (col_id[jj] != ii)
+ m_row[jj] = 0.0;
+ }
+
+ }
+
+ }
+
+ } /* (matrix->face_cell != NULL) */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Release CSR matrix coefficients.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_release_coeffs_csr(cs_matrix_t *matrix)
+{
+ cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+
+ if (mc !=NULL) {
+ if (mc->val != NULL)
+ BFT_FREE(mc->val);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get diagonal of CSR matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * da --> Diagonal (pre-allocated, size: n_rows)
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_diagonal_csr(const cs_matrix_t *matrix,
+ cs_real_t *restrict da)
+{
+ cs_int_t ii, jj;
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+ const cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+ cs_int_t n_rows = ms->n_rows;
+
+ if (matrix->have_diag == true) {
+
+ if (ms->symmetric == false && ms->diag_index == NULL) {
+
+ /* Full rows for non-symmetric structure,
+ upper triangular + diagonal part in case of symmetric structure */
+
+ for (ii = 0; ii < n_rows; ii++) {
+
+ const cs_int_t *restrict col_id = ms->col_id + ms->row_index[ii];
+ const cs_real_t *restrict m_row = mc->val + ms->row_index[ii];
+ cs_int_t n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++) {
+ if (col_id[jj] == ii) {
+ da[ii] = m_row[jj];
+ break;
+ }
+ da[ii] = 0.0;
+ }
+
+ }
+
+ }
+
+ else { /* if (ms->symmetric == true || ms->diag_index == true) */
+
+ /* If structure is symmetric, diagonal values appear first,
+ sor diag_index == row_index */
+
+ const cs_int_t *diag_index
+ = (ms->symmetric == true) ? ms->row_index : ms->diag_index;
+
+ for (ii = 0; ii < n_rows; ii++)
+ da[ii] = mc->val[diag_index[ii]];
+
+ }
+
+ }
+ else { /* if (have_diag == false) */
+
+ for (ii = 0; ii < n_rows; da[ii++] = 0.0);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = A.x with CSR matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_p_l_csr(const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, n_cols;
+ cs_real_t sii;
+ cs_int_t *restrict col_id;
+ cs_real_t *restrict m_row;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+ const cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+ cs_int_t n_rows = ms->n_rows;
+
+ assert(ms->symmetric == false);
+
+ /* Full rows for non-symmetric structure */
+
+ #pragma omp parallel for private(ii, col_id, m_row, n_cols, sii)
+ for (ii = 0; ii < n_rows; ii++) {
+
+ col_id = ms->col_id + ms->row_index[ii];
+ m_row = mc->val + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+ sii = 0.0;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *m_row, *col_id)
+ #endif
+
+ for (jj = 0; jj < n_cols; jj++)
+ sii += (m_row[jj]*x[col_id[jj]]);
+
+ y[ii] = sii;
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = A.x with symmetric CSR matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_p_l_csr_sym(const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, n_cols;
+ cs_int_t *restrict col_id;
+ cs_real_t *restrict m_row;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+ const cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+ cs_int_t n_rows = ms->n_rows;
+
+ cs_int_t sym_jj_start = 0;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *m_row, *col_id)
+ #endif
+
+ assert(ms->symmetric == true);
+
+ /* By construction, the matrix has either a full or an empty
+ diagonal structure, so testing this on the first row is enough */
+
+ for (ii = ms->row_index[0]; ii < ms->row_index[1]; ii++) {
+ if (ms->col_id[ii] == 0)
+ sym_jj_start = 1;
+ }
+
+ /* Initialize y */
+
+ for (ii = 0; ii < ms->n_cols; ii++)
+ y[ii] = 0.0;
+
+ /* Upper triangular + diagonal part in case of symmetric structure */
+
+ for (ii = 0; ii < n_rows; ii++) {
+
+ cs_real_t sii = 0.0;
+
+ col_id = ms->col_id + ms->row_index[ii];
+ m_row = mc->val + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++)
+ sii += (m_row[jj]*x[col_id[jj]]);
+
+ y[ii] += sii;
+
+ for (jj = sym_jj_start; jj < n_cols; jj++)
+ y[col_id[jj]] += (m_row[jj]*x[ii]);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = A.x with CSR matrix (prefetch).
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_mat_vec_p_l_csr_pf(const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t start_row, ii, jj, n_cols;
+ cs_int_t *restrict col_id;
+ cs_real_t *restrict m_row;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+ const cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+ cs_int_t n_rows = ms->n_rows;
+
+ /* Outer loop on prefetch lines */
+
+ for (start_row = 0; start_row < n_rows; start_row += mc->n_prefetch_rows) {
+
+ cs_int_t end_row = start_row + mc->n_prefetch_rows;
+
+ cs_real_t *restrict prefetch_p = mc->x_prefetch;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*prefetch_p, *y, *m_row)
+ #pragma disjoint(*prefetch_p, *x, *col_id)
+ #endif
+
+ if (end_row > n_rows)
+ end_row = n_rows;
+
+ /* Prefetch */
+
+ for (ii = start_row; ii < end_row; ii++) {
+
+ col_id = ms->col_id + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++)
+ *prefetch_p++ = x[col_id[jj]];
+
+ }
+
+ /* Compute */
+
+ prefetch_p = mc->x_prefetch;
+
+ for (ii = start_row; ii < end_row; ii++) {
+
+ cs_real_t sii = 0.0;
+
+ m_row = mc->val + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++)
+ sii += *m_row++ * *prefetch_p++;
+
+ y[ii] = sii;
+
+ }
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = alpha.A.x + beta.y with CSR matrix.
+ *
+ * parameters:
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y <-> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_alpha_a_x_p_beta_y_csr(cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, n_cols;
+ cs_int_t *restrict col_id;
+ cs_real_t *restrict m_row;
+ cs_real_t sii;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+ const cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+ cs_int_t n_rows = ms->n_rows;
+
+ assert(ms->symmetric == false);
+
+ /* Full rows for non-symmetric structure */
+
+ #pragma omp parallel for private(ii, col_id, m_row, n_cols, sii)
+ for (ii = 0; ii < n_rows; ii++) {
+
+ col_id = ms->col_id + ms->row_index[ii];
+ m_row = mc->val + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+ sii = 0.0;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *m_row, *col_id)
+ #endif
+
+ for (jj = 0; jj < n_cols; jj++)
+ sii += (m_row[jj]*x[col_id[jj]]);
+
+ y[ii] = (alpha * sii) + (beta * y[ii]);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = alpha.A.x + beta.y
+ * with symmetric CSR matrix.
+ *
+ * parameters:
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y <-> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_alpha_a_x_p_beta_y_csr_sym(cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t ii, jj, n_cols;
+ cs_int_t *restrict col_id;
+ cs_real_t *restrict m_row;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+ const cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+ cs_int_t n_rows = ms->n_rows;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*x, *y, *m_row, *col_id)
+ #endif
+
+ assert(ms->symmetric == true);
+
+ for (ii = 0; ii < ms->n_rows; ii++)
+ y[ii] *= beta;
+
+ for (ii = ms->n_rows; ii < ms->n_cols; ii++)
+ y[ii] = 0.0;
+
+ /* Upper triangular + diagonal part in case of symmetric structure */
+
+ for (ii = 0; ii < n_rows; ii++) {
+
+ cs_real_t sii = 0.0;
+
+ col_id = ms->col_id + ms->row_index[ii];
+ m_row = mc->val + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++)
+ sii += (m_row[jj]*x[col_id[jj]]);
+
+ y[ii] += alpha * sii;
+
+ for (jj = 1; jj < n_cols; jj++)
+ y[col_id[jj]] += alpha * (m_row[jj]*x[ii]);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Local matrix.vector product y = alpha.A.x + beta.y
+ * with CSR matrix (prefetch).
+ *
+ * parameters:
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y <-> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_alpha_a_x_p_beta_y_csr_pf(cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ const cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ cs_int_t start_row, ii, jj, n_cols;
+ cs_int_t *restrict col_id;
+ cs_real_t *restrict m_row;
+
+ const cs_matrix_struct_csr_t *ms = matrix->structure;
+ const cs_matrix_coeff_csr_t *mc = matrix->coeffs;
+ cs_int_t n_rows = ms->n_rows;
+
+ /* Outer loop on prefetch lines */
+
+ for (start_row = 0; start_row < n_rows; start_row += mc->n_prefetch_rows) {
+
+ cs_int_t end_row = start_row + mc->n_prefetch_rows;
+ cs_real_t *restrict prefetch_p = mc->x_prefetch;
+
+ /* Tell IBM compiler not to alias */
+ #if defined(__xlc__)
+ #pragma disjoint(*prefetch_p, *x, *col_id)
+ #pragma disjoint(*prefetch_p, *y, *m_row, *col_id)
+ #endif
+
+ if (end_row > n_rows)
+ end_row = n_rows;
+
+ /* Prefetch */
+
+ for (ii = start_row; ii < end_row; ii++) {
+
+ col_id = ms->col_id + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++)
+ *prefetch_p++ = x[col_id[jj]];
+
+ }
+
+ /* Compute */
+
+ prefetch_p = mc->x_prefetch;
+
+ for (ii = start_row; ii < end_row; ii++) {
+
+ cs_real_t sii = 0.0;
+
+ m_row = mc->val + ms->row_index[ii];
+ n_cols = ms->row_index[ii+1] - ms->row_index[ii];
+
+ for (jj = 0; jj < n_cols; jj++)
+ sii += *m_row++ * *prefetch_p++;
+
+ y[ii] = (alpha * sii) + (beta * y[ii]);
+
+ }
+
+ }
+
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a matrix Structure.
+ *
+ * Note that the structure created maps to the given existing
+ * cell global number, face -> cell connectivity arrays, and cell halo
+ * structure, so it must be destroyed before they are freed
+ * (usually along with the code's main face -> cell structure).
+ *
+ * Note that the resulting matrix structure will contain either a full or
+ * an empty main diagonal, and that the extra-diagonal structure is always
+ * symmetric (though the coefficients my not be, and we may choose a
+ * matrix format that does not exploit ths symmetry). If the face_cell
+ * connectivity argument is NULL, the matrix will be purely diagonal.
+ *
+ * parameters:
+ * type <-- Type of matrix considered
+ * symmetric <-- Indicates if a symmetric variant of the matrix type
+ * should be used
+ * have_diag <-- Indicates if the diagonal structure contains nonzeroes
+ * periodic <-- Indicates if periodicity is present
+ * n_cells <-- Local number of cells
+ * n_cells_ext <-- Local number of cells + ghost cells sharing a face
+ * n_faces <-- Local number of internal faces
+ * cell_num <-- Global cell numbers (1 to n)
+ * face_cell <-- Face -> cells connectivity (1 to n)
+ * halo <-- Halo structure associated with cells, or NULL
+ * numbering <-- vectorization or thread-related numbering info, or NULL
+ *
+ * returns:
+ * pointer to created matrix structure;
+ *----------------------------------------------------------------------------*/
+
+cs_matrix_t *
+cs_matrix_create(cs_matrix_type_t type,
+ cs_bool_t symmetric,
+ cs_bool_t have_diag,
+ cs_bool_t periodic,
+ cs_int_t n_cells,
+ cs_int_t n_cells_ext,
+ cs_int_t n_faces,
+ const fvm_gnum_t *cell_num,
+ const cs_int_t *face_cell,
+ const cs_halo_t *halo,
+ const cs_numbering_t *numbering)
+{
+ cs_matrix_t *m;
+
+ BFT_MALLOC(m, 1, cs_matrix_t);
+
+ m->type = type;
+ m->periodic = periodic;
+ m->have_diag = have_diag;
+
+ m->n_cells = n_cells;
+ m->n_cells_ext = n_cells_ext;
+ m->n_faces = n_faces;
+
+ /* Define Structure */
+
+ switch(m->type) {
+ case CS_MATRIX_NATIVE:
+ m->_structure = _create_struct_native(n_cells,
+ n_cells_ext,
+ n_faces,
+ face_cell);
+ m->coeffs = _create_coeff_native();
+ break;
+ case CS_MATRIX_CSR:
+ m->_structure = _create_struct_csr(symmetric,
+ have_diag,
+ n_cells,
+ n_cells_ext,
+ n_faces,
+ face_cell);
+ m->coeffs = _create_coeff_csr();
+ break;
+ default:
+ bft_error(__FILE__, __LINE__, 0,
+ _("Handling of matrixes in %s format\n"
+ "is not operational yet."),
+ _(cs_matrix_type_name[type]));
+ break;
+ }
+
+ m->structure = m->_structure;
+
+ /* Set pointers to structures shared from mesh here */
+
+ m->face_cell = face_cell;
+ m->cell_num = cell_num;
+ m->halo = halo;
+ m->numbering = numbering;
+
+ /* Set function pointers here */
+
+ switch(m->type) {
+
+ case CS_MATRIX_NATIVE:
+
+ m->set_coefficients = _set_coeffs_native;
+ m->release_coefficients = _release_coeffs_native;
+ m->get_diagonal = _get_diagonal_native;
+ m->vector_multiply = _mat_vec_p_l_native;
+ m->alpha_a_x_p_beta_y = _alpha_a_x_p_beta_y_native;
+
+ /* Optimized variants here */
+
+#if defined(IA64_OPTIM)
+ m->vector_multiply = _mat_vec_p_l_native_ia64;
+#endif
+
+ if (m->numbering != NULL) {
+#if defined(HAVE_OPENMP)
+ if (m->numbering->type == CS_NUMBERING_THREADS) {
+ m->vector_multiply = _mat_vec_p_l_native_omp;
+ m->alpha_a_x_p_beta_y = _alpha_a_x_p_beta_y_native_omp;
+ }
+#endif
+#if defined(SX) && defined(_SX) /* For vector machines */
+ if (m->numbering->type == CS_NUMBERING_VECTORIZE) {
+ m->vector_multiply = _mat_vec_p_l_native_vector;
+ m->alpha_a_x_p_beta_y = _alpha_a_x_p_beta_y_native_vector;
+ }
+#endif
+ }
+
+ break;
+
+ case CS_MATRIX_CSR:
+ m->set_coefficients = _set_coeffs_csr;
+ m->release_coefficients = _release_coeffs_csr;
+ m->get_diagonal = _get_diagonal_csr;
+ if (symmetric == false) {
+ if (_cs_glob_matrix_prefetch_rows > 0 && cs_glob_n_threads == 1) {
+ m->vector_multiply = _mat_vec_p_l_csr_pf;
+ m->alpha_a_x_p_beta_y = _alpha_a_x_p_beta_y_csr_pf;
+ }
+ else {
+ m->vector_multiply = _mat_vec_p_l_csr;
+ m->alpha_a_x_p_beta_y = _alpha_a_x_p_beta_y_csr;
+ }
+ }
+ else { /* if (symmetric == true) */
+ m->vector_multiply = _mat_vec_p_l_csr_sym;
+ m->alpha_a_x_p_beta_y = _alpha_a_x_p_beta_y_csr_sym;
+ }
+ break;
+
+ default:
+ assert(0);
+ m->set_coefficients = NULL;
+ m->vector_multiply = NULL;
+ m->alpha_a_x_p_beta_y = NULL;
+
+ }
+
+ return m;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a matrix structure.
+ *
+ * parameters:
+ * matrix <-> Pointer to matrix structure pointer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_destroy(cs_matrix_t **matrix)
+{
+ if (matrix != NULL && *matrix != NULL) {
+
+ cs_matrix_t *m = *matrix;
+
+ switch(m->type) {
+ case CS_MATRIX_NATIVE:
+ {
+ cs_matrix_struct_native_t *_structure = m->_structure;
+ cs_matrix_coeff_native_t *coeffs = m->coeffs;
+ _destroy_struct_native(&_structure);
+ _destroy_coeff_native(&coeffs);
+ m->structure = NULL; m->coeffs = NULL;
+ }
+ break;
+ case CS_MATRIX_CSR:
+ {
+ cs_matrix_struct_csr_t *_structure = m->_structure;
+ cs_matrix_coeff_csr_t *coeffs = m->coeffs;
+ _destroy_struct_csr(&_structure);
+ _destroy_coeff_csr(&coeffs);
+ m->structure = NULL; m->coeffs = NULL;
+ }
+ break;
+ default:
+ break;
+ }
+
+ /* Now free main structure */
+
+ BFT_FREE(*matrix);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Return number of columns in matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+cs_int_t
+cs_matrix_get_n_columns(const cs_matrix_t *matrix)
+{
+ if (matrix == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The matrix is not defined."));
+
+ return matrix->n_cells_ext;
+}
+
+/*----------------------------------------------------------------------------
+ * Return number of rows in matrix.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+cs_int_t
+cs_matrix_get_n_rows(const cs_matrix_t *matrix)
+{
+ if (matrix == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The matrix is not defined."));
+
+ return matrix->n_cells;
+}
+
+/*----------------------------------------------------------------------------
+ * Set matrix coefficients.
+ *
+ * Depending on current options and initialization, values will be copied
+ * or simply mapped.
+ *
+ * parameters:
+ * matrix <-> Pointer to matrix structure
+ * symmetric <-- Indicates if matrix coefficients are symmetric
+ * da <-- Diagonal values (NULL if zero)
+ * xa <-- Extradiagonal values (NULL if zero)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_set_coefficients(cs_matrix_t *matrix,
+ cs_bool_t symmetric,
+ const cs_real_t *da,
+ const cs_real_t *xa)
+{
+ if (matrix == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The matrix is not defined."));
+
+ if (matrix->set_coefficients != NULL)
+ matrix->set_coefficients(matrix, symmetric, da, xa);
+}
+
+/*----------------------------------------------------------------------------
+ * Release matrix coefficients.
+ *
+ * parameters:
+ * matrix <-> Pointer to matrix structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_release_coefficients(cs_matrix_t *matrix)
+{
+ /* Check API state */
+
+ if (matrix == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The matrix is not defined."));
+
+ if (matrix->release_coefficients != NULL)
+ matrix->release_coefficients(matrix);
+}
+
+/*----------------------------------------------------------------------------
+ * Get matrix diagonal values.
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * da --> Diagonal (pre-allocated, size: n_cells)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_get_diagonal(const cs_matrix_t *matrix,
+ cs_real_t *restrict da)
+{
+ /* Check API state */
+
+ if (matrix == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The matrix is not defined."));
+
+ if (matrix->get_diagonal != NULL)
+ matrix->get_diagonal(matrix, da);
+}
+
+/*----------------------------------------------------------------------------
+ * Matrix.vector product y = A.x
+ *
+ * This function includes a halo update of x prior to multiplication by A.
+ *
+ * parameters:
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * matrix <-- Pointer to matrix structure
+ * x <-> Multipliying vector values (ghost values updated)
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_vector_multiply(cs_perio_rota_t rotation_mode,
+ const cs_matrix_t *matrix,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ size_t ii;
+ size_t n_cells_ext = matrix->n_cells_ext;
+
+ /* Synchronize for parallelism and periodicity first */
+
+ for (ii = matrix->n_cells; ii < n_cells_ext; y[ii++] = 0.);
+
+ /* Update distant ghost cells */
+
+ if (matrix->halo != NULL)
+ cs_halo_sync_var(matrix->halo, CS_HALO_STANDARD, x);
+
+ /* Synchronize periodic values */
+
+ if (matrix->periodic) {
+ if (rotation_mode == CS_PERIO_ROTA_IGNORE)
+ bft_error(__FILE__, __LINE__, 0, _cs_glob_perio_ignore_error_str);
+ cs_perio_sync_var_scal(matrix->halo, CS_HALO_STANDARD, rotation_mode, x);
+ }
+
+ /* Now call local matrix.vector product */
+
+ if (matrix->vector_multiply != NULL)
+ matrix->vector_multiply(matrix, x, y);
+
+ else if (matrix->alpha_a_x_p_beta_y != NULL)
+ matrix->alpha_a_x_p_beta_y(1.0, 0.0, matrix, x, y);
+}
+
+/*----------------------------------------------------------------------------
+ * Matrix.vector product y = A.x with no prior halo update of x.
+ *
+ * This function does not include a halo update of x prior to multiplication
+ * by A, so it should be called only when the halo of x is known to already
+ * be up to date (in which case we avoid the performance penalty of a
+ * redundant update by using this variant of the matrix.vector product).
+ *
+ * parameters:
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_vector_multiply_nosync(const cs_matrix_t *matrix,
+ const cs_real_t *x,
+ cs_real_t *restrict y)
+{
+ if (matrix != NULL) {
+
+ if (matrix->vector_multiply != NULL)
+ matrix->vector_multiply(matrix, x, y);
+
+ else if (matrix->alpha_a_x_p_beta_y != NULL)
+ matrix->alpha_a_x_p_beta_y(1.0, 0.0, matrix, x, y);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Matrix.vector product y = alpha.A.x + beta.y
+ *
+ * This function includes a halo update of x prior to multiplication by A.
+ *
+ * parameters:
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * alpha <-- Scalar, alpha in alpha.A.x + beta.y
+ * beta <-- Scalar, beta in alpha.A.x + beta.y
+ * matrix <-- Pointer to matrix structure
+ * x <-- Multipliying vector values (ghost values updated)
+ * y --> Resulting vector
+ *----------------------------------------------------------------------------*/
+
+void
+cs_matrix_alpha_a_x_p_beta_y(cs_perio_rota_t rotation_mode,
+ cs_real_t alpha,
+ cs_real_t beta,
+ const cs_matrix_t *matrix,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+ /* Update distant ghost cells */
+
+ if (matrix->halo != NULL)
+ cs_halo_sync_var(matrix->halo, CS_HALO_STANDARD, x);
+
+ /* Synchronize periodic values */
+
+ if (matrix->periodic) {
+ if (rotation_mode == CS_PERIO_ROTA_IGNORE)
+ bft_error(__FILE__, __LINE__, 0, _cs_glob_perio_ignore_error_str);
+ cs_perio_sync_var_scal(matrix->halo, CS_HALO_STANDARD, rotation_mode, x);
+ }
+
+ /* Now call local matrix.vector product */
+
+ if (matrix->alpha_a_x_p_beta_y != NULL)
+ matrix->alpha_a_x_p_beta_y(alpha, beta, matrix, x, y);
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh.c b/src/base/cs_mesh.c
new file mode 100644
index 0000000..26f818a
--- /dev/null
+++ b/src/base/cs_mesh.c
@@ -0,0 +1,1462 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Main structure associated to a mesh
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <math.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_order.h>
+#include <fvm_parall.h>
+#include <fvm_interface.h>
+#include <fvm_periodicity.h>
+#include <fvm_selector.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+#include "cs_mesh_halo.h"
+#include "cs_numbering.h"
+#include "cs_perio.h"
+#include "cs_mesh_quantities.h"
+#include "cs_ext_neighborhood.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define CS_MESH_N_SUBS 5
+
+/*============================================================================
+ * Local structure definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Pointer on the main mesh */
+
+cs_mesh_t *cs_glob_mesh = NULL;
+
+/* Pointer on the temporary mesh used for building main mesh */
+
+cs_mesh_builder_t *cs_glob_mesh_builder = NULL;
+
+/*============================================================================
+ * Public FORTRAN function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check necessity of extended mesh from FORTRAN options.
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE HALTYP (IVOSET)
+ * *****************
+ *
+ * INTEGER IVOSET : <-- : Indicator of necessity of extended mesh
+ *----------------------------------------------------------------------------*/
+
+extern void
+CS_PROCF (haltyp, HALTYP)(const cs_int_t *ivoset);
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update cell family array in case of parallelism.
+ *
+ * This function aims at copying main values from cells in halo (id between 1
+ * and n_cells) to ghost cells on distant ranks (id between n_cells + 1 to
+ * n_cells_with_halo).
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_sync_cell_fam(cs_mesh_t *const mesh)
+{
+ cs_halo_t *halo = mesh->halo;
+
+ if (halo == NULL)
+ return;
+
+ bft_printf(_("Synchronizing cell families\n"));
+
+ cs_halo_sync_num(halo, CS_HALO_EXTENDED, mesh->cell_family);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the minimum and the maximum of a vector (locally).
+ *
+ * parameters:
+ * n_vals <-- local number of elements
+ * var <-- pointer to vector
+ * min --> minimum
+ * max --> maximum
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_local_minmax(cs_int_t n_vals,
+ const cs_int_t var[],
+ cs_int_t *min,
+ cs_int_t *max)
+{
+ cs_int_t i;
+ cs_int_t _min = var[0], _max = var[0];
+
+ for (i = 1; i < n_vals; i++) {
+ _min = CS_MIN(_min, var[i]);
+ _max = CS_MAX(_max, var[i]);
+ }
+
+ if (min != NULL) *min = _min;
+ if (max != NULL) *max = _max;
+}
+
+/*----------------------------------------------------------------------------
+ * Display the distribution of values of a integer vector.
+ *
+ * parameters:
+ * n_vals <-- local number of elements
+ * var <-- pointer to vector
+ *----------------------------------------------------------------------------*/
+
+static void
+_display_histograms(cs_int_t n_vals,
+ const cs_int_t var[])
+{
+ cs_int_t i, j, k, val_max, val_min;
+ double step;
+
+ cs_int_t count[CS_MESH_N_SUBS];
+ cs_int_t n_steps = CS_MESH_N_SUBS;
+
+ /* Compute local min and max */
+
+ if (n_vals == 0) {
+ bft_printf(_(" no value\n"));
+ return;
+ }
+
+ val_max = var[0];
+ val_min = var[0];
+ _compute_local_minmax(n_vals, var, &val_min, &val_max);
+
+ bft_printf(_(" minimum value = %10d\n"), (int)val_min);
+ bft_printf(_(" maximum value = %10d\n\n"), (int)val_max);
+
+ /* Define axis subdivisions */
+
+ for (j = 0; j < n_steps; j++)
+ count[j] = 0;
+
+ if (val_max - val_min > 0) {
+
+ if (val_max-val_min < n_steps)
+ n_steps = CS_MAX(1, floor(val_max-val_min));
+
+ step = (double)(val_max - val_min) / n_steps;
+
+ /* Loop on values */
+
+ for (i = 0; i < n_vals; i++) {
+
+ /* Associated subdivision */
+
+ for (j = 0, k = 1; k < n_steps; j++, k++) {
+ if (var[i] < val_min + k*step)
+ break;
+ }
+ count[j] += 1;
+
+ }
+
+ for (i = 0, j = 1; i < n_steps - 1; i++, j++)
+ bft_printf(" %3d : [ %10d ; %10d [ = %10d\n",
+ i+1,
+ (int)(val_min + i*step),
+ (int)(val_min + j*step),
+ (int)(count[i]));
+
+ bft_printf(" %3d : [ %10d ; %10d ] = %10d\n",
+ n_steps,
+ (int)(val_min + (n_steps - 1)*step),
+ (int)val_max,
+ (int)(count[n_steps - 1]));
+
+ }
+
+ else { /* if (val_max == val_min) */
+ bft_printf(" %3d : [ %10d ; %10d ] = %10d\n",
+ 1, (int)(val_min), (int)val_max, (int)n_vals);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Write a sum-up about halo features in listing
+ *
+ * parameters:
+ * mesh <-- pointer to cs_mesh_t structure
+ * interface_time <-- time elapsed in interface build
+ * halo_time <-- time elapsed in halo build
+ * ext_neighborhood_time <-- time elapsed in extended neighborhood
+ * connectivity building
+ *----------------------------------------------------------------------------*/
+
+static void
+_print_halo_info(cs_mesh_t *mesh,
+ double interface_time,
+ double halo_time,
+ double ext_neighborhood_time)
+{
+ cs_halo_t *halo = mesh->halo;
+
+ cs_int_t *rank_buffer = NULL;
+
+ /* Sum-up of the computional times */
+
+ bft_printf(_("\n Halo creation times summary\n\n"));
+
+ if (mesh->n_domains > 1 || mesh->n_init_perio > 0)
+ bft_printf(_(" Creating interface: %.3g s\n"),
+ interface_time);
+
+ if (mesh->halo_type == CS_HALO_EXTENDED)
+ bft_printf(_(" Creating extended connectivity: %.3g s\n"),
+ ext_neighborhood_time);
+
+ bft_printf(_(" Creating halo: %.3g s\n\n"),
+ halo_time);
+
+
+ bft_printf(_(" Total time for halo creation: %.3g s\n\n"),
+ halo_time + interface_time + ext_neighborhood_time);
+ bft_printf(" ----------------------------------------------------------\n\n");
+
+ /* Sum-up ghost cell distribution */
+
+ bft_printf(_(" Number of standard cells: %d\n"),
+ mesh->n_cells);
+
+ if (mesh->n_domains > 1) {
+
+ BFT_MALLOC(rank_buffer, mesh->n_domains, cs_int_t);
+
+#if defined(HAVE_MPI)
+ MPI_Allgather(&(mesh->n_cells), 1, CS_MPI_INT,
+ rank_buffer , 1, CS_MPI_INT, cs_glob_mpi_comm);
+#endif
+
+ bft_printf(_("\n Histogram of the number of cells per rank:\n\n"));
+
+ _display_histograms(mesh->n_domains, rank_buffer);
+
+ } /* End if n_domains > 1 */
+
+ bft_printf("\n ----------------------------------------------------------\n");
+ bft_printf_flush();
+
+ bft_printf(_(" Number of cells + halo cells: %d\n\n"),
+ mesh->n_cells_with_ghosts);
+
+ if (mesh->n_domains > 1) {
+
+#if defined(HAVE_MPI)
+ MPI_Allgather(&(mesh->n_cells_with_ghosts), 1, CS_MPI_INT,
+ rank_buffer, 1, CS_MPI_INT, cs_glob_mpi_comm);
+#endif
+
+ bft_printf(_("\n Histogram of number of standard + halo cells (NCELET) "
+ "per rank:\n\n"));
+
+ _display_histograms(mesh->n_domains, rank_buffer);
+
+ } /* End if n_domains > 1 */
+
+ bft_printf("\n ----------------------------------------------------------\n");
+ bft_printf_flush();
+
+ if (halo != NULL) {
+
+ cs_int_t n_std_ghost_cells = halo->n_elts[CS_HALO_STANDARD];
+
+ bft_printf(_("\n Local number of ghost cells: %10d\n"),
+ mesh->n_ghost_cells);
+ bft_printf(_(" in the standard neighborhood: %10d\n"),
+ n_std_ghost_cells);
+ bft_printf(_(" in the extended neighborhood: %10d\n"),
+ mesh->n_ghost_cells - n_std_ghost_cells);
+
+ if (mesh->n_domains > 1) {
+
+ cs_int_t n_gcells = mesh->n_ghost_cells;
+
+#if defined(HAVE_MPI)
+ MPI_Allgather(&n_gcells , 1, CS_MPI_INT,
+ rank_buffer, 1, CS_MPI_INT, cs_glob_mpi_comm);
+#endif
+
+ bft_printf
+ (_("\n Histogram of the number of ghost cells per rank:\n\n"));
+
+ _display_histograms(mesh->n_domains, rank_buffer);
+
+ } /* If n_ranks > 1 */
+
+ bft_printf("\n"
+ " ----------------------------------------------------------\n");
+ bft_printf_flush();
+
+ /* Sum-up of the number of neighbors */
+
+ bft_printf(_("\n Number of neighboring domains: %d\n"),
+ halo->n_c_domains);
+
+ if (mesh->n_domains > 1) {
+
+ cs_int_t n_c_domains = halo->n_c_domains;
+
+#if defined(HAVE_MPI)
+ MPI_Allgather(&n_c_domains, 1, CS_MPI_INT,
+ rank_buffer , 1, CS_MPI_INT, cs_glob_mpi_comm);
+#endif
+
+ bft_printf(_("\n Histogram of the number of neighboring domains "
+ "per rank:\n\n"));
+
+ _display_histograms(mesh->n_domains, rank_buffer);
+
+ } /* If n_ranks > 1 */
+
+ bft_printf("\n"
+ " ----------------------------------------------------------\n");
+ bft_printf_flush();
+
+ } /* End if halo != NULL */
+
+ if (mesh->n_domains > 1)
+ BFT_FREE(rank_buffer);
+
+}
+
+/*============================================================================
+ * Public functions definition for API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Return the group number corresponding to a given name. If the group exists,
+ * the number corresponds to the group rank (starting from 1) in the list of
+ * the meshe's groups, multiplied by -1. This numbering is that used in
+ * family (group class) description array IPRFML(NFML, NPRFML).
+ *
+ * If the group of the given name is not found, 9999 is returned.
+ *
+ * Fortran interface:
+ *
+ * FUNCTION NUMGRP (NAME, LEN)
+ * ***************
+ *
+ * CHARACTER* NAME : <-- : Name of the group
+ * INTEGER LEN : <-- : Group name length
+ *----------------------------------------------------------------------------*/
+
+cs_int_t CS_PROCF (numgrp, NUMGRP)
+(
+ const char *name, /* <-- Group name */
+ const cs_int_t *len /* <-- Name length */
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+)
+{
+ int i, lngcmp;
+
+ char *nomcmp = NULL;
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ for (i = 0; i < mesh->n_groups; i++) {
+
+ nomcmp = mesh->group_lst + (mesh->group_idx[i] - 1);
+ lngcmp = strlen(nomcmp);
+
+ if (lngcmp == *len && strncmp(nomcmp, name, lngcmp) == 0)
+ return (-(i + 1));
+
+ }
+
+ return -9999;
+}
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create an empty mesh structure
+ *
+ * returns:
+ * pointer to created mesh structure
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_t *
+cs_mesh_create(void)
+{
+ cs_mesh_t *mesh = NULL;
+
+ BFT_MALLOC (mesh, 1, cs_mesh_t);
+
+ /* General features */
+
+ mesh->dim = 3;
+ mesh->domain_num = cs_glob_rank_id + 1;
+ mesh->n_domains = 0;
+
+ /* Local dimensions */
+
+ mesh->n_cells = 0;
+ mesh->n_i_faces = 0;
+ mesh->n_b_faces = 0;
+ mesh->n_vertices = 0;
+ mesh->i_face_vtx_connect_size = 0;
+ mesh->b_face_vtx_connect_size = 0;
+
+ /* Global dimensions */
+
+ mesh->n_g_cells = 0;
+ mesh->n_g_i_faces = 0;
+ mesh->n_g_b_faces = 0;
+ mesh->n_g_vertices = 0;
+
+ /* Local structures */
+
+ mesh->vtx_coord = NULL;
+ mesh->i_face_cells = NULL;
+ mesh->b_face_cells = NULL;
+ mesh->i_face_vtx_idx = NULL;
+ mesh->b_face_vtx_idx = NULL;
+ mesh->i_face_vtx_lst = NULL;
+ mesh->b_face_vtx_lst = NULL;
+
+ /* Global numbering */
+
+ mesh->global_cell_num = NULL;
+ mesh->global_i_face_num = NULL;
+ mesh->global_b_face_num = NULL;
+ mesh->global_vtx_num = NULL;
+
+ /* Periodic features */
+
+ mesh->n_init_perio = 0;
+ mesh->n_transforms = 0;
+ mesh->have_rotation_perio = 0;
+ mesh->periodicity = NULL;
+
+ /* Halo features */
+
+ mesh->halo_type = CS_HALO_N_TYPES;
+ mesh->n_ghost_cells = 0;
+ mesh->n_cells_with_ghosts = 0;
+ mesh->halo = NULL;
+
+ mesh->cell_cells_idx = NULL;
+ mesh->cell_cells_lst = NULL;
+ mesh->gcell_vtx_idx = NULL;
+ mesh->gcell_vtx_lst = NULL;
+
+ /* Numbering info */
+
+ mesh->i_face_numbering = NULL;
+ mesh->b_face_numbering = NULL;
+
+ /* Group and family features */
+
+ mesh->n_groups = 0;
+ mesh->group_idx = NULL;
+ mesh->group_lst = NULL;
+
+ mesh->n_max_family_items = 0;
+ mesh->n_families = 0;
+
+ mesh->family_item = NULL;
+ mesh->cell_family = NULL;
+ mesh->i_face_family = NULL;
+ mesh->b_face_family = NULL;
+
+ /* Selector features */
+
+ mesh->class_defs = NULL;
+
+ mesh->select_cells = NULL;
+ mesh->select_i_faces = NULL;
+ mesh->select_b_faces = NULL;
+
+ return (mesh);
+}
+
+/*----------------------------------------------------------------------------
+ * Create an empty mesh builder structure.
+ *
+ * returns:
+ * A pointer to a mesh builder structure
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_builder_t *
+cs_mesh_builder_create(void)
+{
+ cs_mesh_builder_t *mesh_builder = NULL;
+
+ BFT_MALLOC(mesh_builder, 1, cs_mesh_builder_t);
+
+ mesh_builder->per_face_idx = NULL;
+ mesh_builder->per_face_lst = NULL;
+ mesh_builder->per_rank_lst = NULL;
+
+ return mesh_builder;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a mesh structure.
+ *
+ * mesh <-> pointer to a mesh structure
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_t *
+cs_mesh_destroy(cs_mesh_t *mesh)
+{
+ BFT_FREE(mesh->vtx_coord);
+ BFT_FREE(mesh->i_face_cells);
+ BFT_FREE(mesh->b_face_cells);
+ BFT_FREE(mesh->i_face_vtx_idx);
+ BFT_FREE(mesh->b_face_vtx_idx);
+ BFT_FREE(mesh->i_face_vtx_lst);
+ BFT_FREE(mesh->b_face_vtx_lst);
+
+ BFT_FREE(mesh->global_cell_num);
+ BFT_FREE(mesh->global_i_face_num);
+ BFT_FREE(mesh->global_b_face_num);
+ BFT_FREE(mesh->global_vtx_num);
+
+ BFT_FREE(mesh->group_idx);
+ BFT_FREE(mesh->group_lst);
+
+ BFT_FREE(mesh->family_item);
+ BFT_FREE(mesh->cell_family);
+ BFT_FREE(mesh->i_face_family);
+ BFT_FREE(mesh->b_face_family);
+
+ /* Free periodic structures */
+
+ if (mesh->n_init_perio > 0)
+ mesh->periodicity = fvm_periodicity_destroy(mesh->periodicity);
+
+ if (mesh->cell_cells_idx != NULL) {
+ BFT_FREE(mesh->cell_cells_idx);
+ BFT_FREE(mesh->cell_cells_lst);
+ }
+
+ if (mesh->gcell_vtx_idx != NULL) {
+ BFT_FREE(mesh->gcell_vtx_idx);
+ BFT_FREE(mesh->gcell_vtx_lst);
+ }
+
+ /* Free halo structure */
+
+ if (mesh == cs_glob_mesh)
+ cs_perio_free_buffer();
+
+ mesh->halo = cs_halo_destroy(mesh->halo);
+
+ /* Free numbering info */
+
+ if (mesh->i_face_numbering != NULL)
+ cs_numbering_destroy(&(mesh->i_face_numbering));
+ if (mesh->b_face_numbering != NULL)
+ cs_numbering_destroy(&(mesh->b_face_numbering));
+
+ /* Free selection structures */
+
+ if (mesh->n_groups > 0) {
+ BFT_FREE(mesh->group_idx);
+ BFT_FREE(mesh->group_lst);
+ }
+
+ if (mesh->select_cells != NULL)
+ mesh->select_cells = fvm_selector_destroy(mesh->select_cells);
+ if (mesh->select_i_faces != NULL)
+ mesh->select_i_faces = fvm_selector_destroy(mesh->select_i_faces);
+ if (mesh->select_b_faces != NULL)
+ mesh->select_b_faces = fvm_selector_destroy(mesh->select_b_faces);
+
+ /* Destroy group class set after selectors, who reference it */
+
+ if (cs_glob_mesh->class_defs != NULL)
+ cs_glob_mesh->class_defs
+ = fvm_group_class_set_destroy(cs_glob_mesh->class_defs);
+
+ BFT_FREE(mesh);
+
+ return mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a mesh builder structure
+ *
+ * mesh_builder <-> pointer to a mesh structure
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_builder_t *
+cs_mesh_builder_destroy(cs_mesh_builder_t *mesh_builder)
+{
+
+ BFT_FREE(mesh_builder->per_face_idx);
+ BFT_FREE(mesh_builder->per_face_lst);
+
+ if (cs_glob_n_ranks > 1)
+ BFT_FREE(mesh_builder->per_rank_lst);
+
+ BFT_FREE(mesh_builder);
+
+ return mesh_builder;
+}
+
+/*----------------------------------------------------------------------------
+ * Renumber vertices.
+ *
+ * We ensure:
+ * If i < j then mesh->global_vtx_num[i] < mesh->global_vtx_num[j]
+ * which is not insured by the initial numbering from the pre-processor.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_order_vertices(cs_mesh_t *const mesh)
+{
+ cs_int_t i, j, size, dim, n_vertices;
+
+ cs_int_t *tmp_num = NULL;
+ cs_real_t *tmp_coord = NULL;
+ fvm_lnum_t *vertex_order = NULL;
+ fvm_lnum_t *vertex_renum = NULL;
+ fvm_gnum_t *g_vertex_num = NULL;
+
+ assert(mesh != NULL);
+
+ /* No treatment in serial mode */
+
+ if (mesh->global_vtx_num == NULL)
+ return;
+
+ dim = mesh->dim;
+ n_vertices = mesh->n_vertices;
+
+ /* Compute the new vertex numbering */
+
+ BFT_MALLOC(g_vertex_num, n_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_vertices; i++)
+ g_vertex_num[i] = mesh->global_vtx_num[i];
+
+ vertex_order = fvm_order_local(NULL, g_vertex_num, (size_t)n_vertices);
+ BFT_FREE(g_vertex_num);
+
+ vertex_renum = fvm_order_local_renumbering(vertex_order, (size_t)n_vertices);
+ BFT_FREE(vertex_order);
+
+ /* Re-define face -> vertices connectivity with the new vertex numbering */
+
+ if (mesh->n_i_faces > 0)
+ for (i = 0, size = mesh->i_face_vtx_idx[mesh->n_i_faces] - 1; i < size; i++)
+ mesh->i_face_vtx_lst[i] = vertex_renum[mesh->i_face_vtx_lst[i] - 1] + 1;
+
+ if (mesh->n_b_faces > 0)
+ for (i = 0, size = mesh->b_face_vtx_idx[mesh->n_b_faces] - 1; i < size; i++)
+ mesh->b_face_vtx_lst[i] = vertex_renum[mesh->b_face_vtx_lst[i] - 1] + 1;
+
+ /* Update coordinates */
+
+ BFT_MALLOC(tmp_coord, n_vertices * dim, cs_real_t);
+
+ for (i = 0; i < n_vertices; i++)
+ for (j = 0; j < dim; j++)
+ tmp_coord[vertex_renum[i]*dim + j] = mesh->vtx_coord[i*dim + j];
+
+ memcpy(mesh->vtx_coord, tmp_coord, (n_vertices * dim * sizeof(cs_real_t)));
+ BFT_FREE(tmp_coord);
+
+ /* Update global numbering */
+
+ BFT_MALLOC(tmp_num, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++)
+ tmp_num[vertex_renum[i]] = mesh->global_vtx_num[i];
+
+ memcpy(mesh->global_vtx_num, tmp_num, (n_vertices * sizeof(cs_int_t)));
+
+ /* Free memory */
+
+ BFT_FREE(tmp_num);
+ BFT_FREE(vertex_renum);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Print mesh characteristics.
+ *
+ * parameters:
+ * mesh --> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_info(const cs_mesh_t *mesh)
+{
+ cs_int_t i, vtx_id;
+
+ cs_int_t dim = mesh->dim;
+
+ /* Allocation of the structures if this is not an update */
+
+ if (mesh->n_g_vertices > 0) {
+
+ cs_real_t min_xyz[3] = { 1.e127, 1.e127, 1.e127};
+ cs_real_t max_xyz[3] = {-1.e127, -1.e127, -1.e127};
+
+ for (vtx_id = 0 ; vtx_id < mesh->n_vertices ; vtx_id++) {
+
+ for (i = 0 ; i < dim ; i++) {
+
+ if (mesh->vtx_coord[vtx_id*dim + i] < min_xyz[i])
+ min_xyz[i] = mesh->vtx_coord[vtx_id*dim + i];
+
+ if (mesh->vtx_coord[vtx_id*dim + i] > max_xyz[i])
+ max_xyz[i] = mesh->vtx_coord[vtx_id*dim + i];
+
+ }
+
+ } /* End of loop on vertices */
+
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ cs_real_t g_min_xyz[3];
+ cs_real_t g_max_xyz[3];
+
+ MPI_Allreduce(min_xyz, g_min_xyz, dim, CS_MPI_REAL, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(max_xyz, g_max_xyz, dim, CS_MPI_REAL, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ for (i = 0 ; i < dim ; i++) {
+ min_xyz[i] = g_min_xyz[i];
+ max_xyz[i] = g_max_xyz[i];
+ }
+
+ }
+
+#endif
+
+ bft_printf(_("\n"
+ " Mesh coordinates: minimum and maximum\n"
+ " X : %14.7e %14.7e\n"
+ " Y : %14.7e %14.7e\n"
+ " Z : %14.7e %14.7e\n"),
+ min_xyz[0], max_xyz[0], min_xyz[1], max_xyz[1],
+ min_xyz[2], max_xyz[2]);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute global number of elements (cells, vertices, internal and border
+ * faces) and sync cell family.
+ *
+ * parameters:
+ * mesh <-> pointer to a cs_mesh_t structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_parall(cs_mesh_t *mesh)
+{
+
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ fvm_gnum_t n_g_elts[4], max_elt_num[4];
+
+ if (cs_glob_n_ranks <= 1)
+ return;
+
+ bft_printf(_("\n Global definition of the number of elements "
+ "(cells, vertices, faces...)\n"));
+
+ /* Global dimensions of the mesh */
+
+ max_elt_num[0] = mesh->n_cells;
+ MPI_Allreduce(max_elt_num, n_g_elts, 1, FVM_MPI_GNUM, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ max_elt_num[1] = 0;
+ for (i = 0; i < mesh->n_i_faces; i++) {
+ if (mesh->global_i_face_num[i] > max_elt_num[1])
+ max_elt_num[1] = mesh->global_i_face_num[i];
+ }
+
+ max_elt_num[2] = 0;
+ for (i = 0; i < mesh->n_b_faces; i++) {
+ if (mesh->global_b_face_num[i] > max_elt_num[2])
+ max_elt_num[2] = mesh->global_b_face_num[i];
+ }
+
+ max_elt_num[3] = 0;
+ for (i = 0; i < mesh->n_vertices; i++) {
+ if (mesh->global_vtx_num[i] > max_elt_num[3])
+ max_elt_num[3] = mesh->global_vtx_num[i];
+ }
+
+ MPI_Allreduce(max_elt_num + 1, n_g_elts + 1, 3, FVM_MPI_GNUM, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ mesh->n_g_cells = n_g_elts[0];
+ mesh->n_g_i_faces = n_g_elts[1];
+ mesh->n_g_b_faces = n_g_elts[2];
+ mesh->n_g_vertices = n_g_elts[3];
+
+#endif
+
+ /* Sync cell family array (also in case of periodicity) */
+
+ _sync_cell_fam(mesh);
+}
+
+/*----------------------------------------------------------------------------
+ * Creation and initialization of halo structures.
+ *
+ * Treatment of parallel and/or periodic halos for standard and extended
+ * ghost cells according to halo type requested by global options.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_halo(cs_mesh_t *mesh)
+{
+ int n_periodic_lists, ivoset;
+ fvm_lnum_t i;
+ double t1, t2;
+ double halo_time = 0, interface_time = 0, ext_neighborhood_time = 0;
+
+ int *periodic_num = NULL;
+ cs_int_t *gcell_vtx_idx = NULL, *gcell_vtx_lst = NULL;
+ fvm_lnum_t *n_periodic_couples = NULL;
+ fvm_gnum_t *g_vertex_num = NULL;
+ fvm_gnum_t **periodic_couples = NULL;
+
+ fvm_interface_set_t *vertex_interfaces = NULL;
+
+ const fvm_lnum_t n_vertices = mesh->n_vertices;
+
+ /* Choose the type of halo to build according to Fortran options.
+ IMRGRA == 3 or 2 OR ITURB == 41 => CS_MESH_HALO_EXTENDED */
+
+ CS_PROCF (haltyp, HALTYP) (&ivoset);
+
+ /* Build halo */
+
+ if (mesh->n_domains > 1 || mesh->n_init_perio > 0) {
+
+ t1 = bft_timer_wtime();
+
+ bft_printf("\n"
+ " ----------------------------------------------------------\n");
+
+ if (ivoset == 1) {
+
+ bft_printf(_("\n Halo construction with extended neighborhood\n"
+ " ============================================\n\n"));
+
+ mesh->halo_type = CS_HALO_EXTENDED;
+
+ if (mesh->n_init_perio > 1) {
+
+ bft_printf(_(" Periodicities combination\n"));
+
+ fvm_periodicity_combine(mesh->periodicity, 0);
+
+ }
+
+ }
+ else {
+
+ bft_printf(_("\n Halo construction with standard neighborhood\n"
+ " ============================================\n\n"));
+
+ mesh->halo_type = CS_HALO_STANDARD;
+
+ }
+
+ /* Build purely parallel fvm_interface_set structure */
+
+ if (mesh->n_domains == 1) {
+
+ BFT_MALLOC(g_vertex_num, n_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_vertices; i++)
+ g_vertex_num[i] = (fvm_gnum_t)i+1;
+
+ }
+ else {
+
+ assert(mesh->global_vtx_num != NULL);
+ g_vertex_num = mesh->global_vtx_num;
+
+ }
+
+ if (mesh->n_init_perio > 0) {
+
+ mesh->n_transforms = fvm_periodicity_get_n_transforms(mesh->periodicity);
+
+ bft_printf(_(" Definition of periodic couples\n"));
+ bft_printf_flush();
+
+ cs_perio_define_couples(&n_periodic_lists,
+ &periodic_num,
+ &n_periodic_couples,
+ &periodic_couples);
+
+#if 0 /* For debugging purpose */
+ for (i = 0; i < n_periodic_lists; i++) {
+ cs_int_t j;
+ bft_printf("\n\n Periodicity number: %d\n", periodic_num[i]);
+ bft_printf(" Number of couples : %d\n", n_periodic_couples[i]);
+ for (j = 0; j < n_periodic_couples[i]; j++)
+ bft_printf("%12d --> %12d\n",
+ periodic_couples[i][2*j], periodic_couples[i][2*j + 1]);
+ }
+ fvm_periodicity_dump(mesh->periodicity);
+#endif
+
+ }
+
+ bft_printf(_(" Interface creation\n"));
+ bft_printf_flush();
+
+ vertex_interfaces = fvm_interface_set_create(n_vertices,
+ NULL,
+ g_vertex_num,
+ mesh->periodicity,
+ n_periodic_lists,
+ periodic_num,
+ n_periodic_couples,
+ (const fvm_gnum_t **const)periodic_couples);
+
+ if (mesh->n_domains == 1)
+ BFT_FREE(g_vertex_num);
+ BFT_FREE(periodic_num);
+ BFT_FREE(n_periodic_couples);
+
+ for (i = 0; i < mesh->n_init_perio; i++)
+ BFT_FREE(periodic_couples[i]);
+ BFT_FREE(periodic_couples);
+
+#if 0 /* For debugging purposes */
+ bft_printf("Dump de l'interface complete et finale\n");
+ fvm_interface_set_dump(vertex_interfaces);
+#endif
+
+ t2 = bft_timer_wtime();
+ interface_time = t2-t1;
+
+ t1 = bft_timer_wtime();
+
+ /* Creation of the cs_halo_t structure. */
+
+ bft_printf(_(" Halo creation\n"));
+ bft_printf_flush();
+
+ mesh->halo = cs_halo_create(vertex_interfaces);
+
+ bft_printf(_(" Halo definition\n"));
+ bft_printf_flush();
+
+ cs_mesh_halo_define(mesh,
+ vertex_interfaces,
+ &gcell_vtx_idx,
+ &gcell_vtx_lst);
+
+ if (mesh->n_init_perio > 0)
+ cs_perio_update_buffer(mesh->halo);
+
+ fvm_interface_set_destroy(vertex_interfaces);
+
+ t2 = bft_timer_wtime();
+ halo_time = t2-t1;
+
+ } /* end if (mesh->n_domains > 1 || mesh->n_init_perio > 0) */
+
+ /* Define a cell -> cells connectivity for the extended neighborhood
+ if necessary */
+
+ if (ivoset == 1) {
+
+ t1 = bft_timer_wtime();
+ bft_printf(_(" Extended neighborhood structures definition\n"));
+ bft_printf_flush();
+
+ mesh->gcell_vtx_idx = gcell_vtx_idx;
+ mesh->gcell_vtx_lst = gcell_vtx_lst;
+
+ cs_ext_neighborhood_define(mesh);
+
+ bft_printf_flush();
+ t2 = bft_timer_wtime();
+ ext_neighborhood_time = t2-t1;
+
+ }
+ else {
+ BFT_FREE(gcell_vtx_idx);
+ BFT_FREE(gcell_vtx_lst);
+ }
+
+ /* Output for listing */
+
+ if (mesh->halo_type != CS_HALO_N_TYPES)
+ _print_halo_info(mesh,
+ interface_time,
+ halo_time,
+ ext_neighborhood_time);
+
+ else if (ivoset == 1)
+ bft_printf(_("\n Extended connectivity creation (%.3g s)\n"),
+ ext_neighborhood_time);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the global number of ghost cells.
+ *
+ * parameters:
+ * mesh <-- pointer to a mesh structure
+ *
+ * returns:
+ * global number of ghost cells
+ *---------------------------------------------------------------------------*/
+
+cs_int_t
+cs_mesh_n_g_ghost_cells(cs_mesh_t *mesh)
+{
+ cs_int_t n_g_ghost_cells = 0;
+
+ if (cs_glob_n_ranks == 1)
+ n_g_ghost_cells = mesh->n_ghost_cells;
+
+ else {
+
+ assert(cs_glob_n_ranks > 1);
+
+#if defined(HAVE_MPI)
+ MPI_Allreduce(&(mesh->n_ghost_cells), &n_g_ghost_cells, 1, MPI_INT,
+ MPI_SUM, cs_glob_mpi_comm);
+#endif
+
+ }
+
+ return n_g_ghost_cells;
+}
+
+/*----------------------------------------------------------------------------
+ * Define group classes for a mesh based on its family definitions.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_group_classes(cs_mesh_t *mesh)
+{
+ int i, j;
+ int grp_nbr, grp_num, grp_idx, color_nbr;
+
+ int *color = NULL;
+ char **group = NULL;
+
+ if (mesh->class_defs != NULL)
+ mesh->class_defs = fvm_group_class_set_destroy(mesh->class_defs);
+
+ mesh->class_defs = fvm_group_class_set_create();
+
+ /* Construction of the fvm_group_class structure */
+
+ BFT_MALLOC(group, mesh->n_max_family_items, char*);
+ BFT_MALLOC(color, mesh->n_max_family_items, int);
+
+ for (i = 0; i < mesh->n_families; i++) {
+
+ color_nbr = 0;
+ grp_nbr = 0;
+
+ for (j = 0; j < mesh->n_max_family_items; j++) {
+
+ if (mesh->family_item[j * mesh->n_families + i] > 0){
+ color[color_nbr++]
+ = mesh->family_item[j *mesh->n_families + i];
+ }
+ else if ( mesh->family_item[j * mesh->n_families + i]
+ < 0) {
+ /* Fortran formulation */
+ grp_num = -mesh->family_item[j*mesh->n_families + i] -1;
+ grp_idx = mesh->group_idx[grp_num];
+ group[grp_nbr++] = mesh->group_lst + grp_idx -1;
+ }
+
+ }
+
+ fvm_group_class_set_add(mesh->class_defs,
+ grp_nbr,
+ color_nbr,
+ (const char **)group,
+ color);
+
+ } /* End of loop on families */
+
+ BFT_FREE(group);
+ BFT_FREE(color);
+}
+
+/*----------------------------------------------------------------------------
+ * Assign selectors to global mesh.
+ *
+ * Should be called once the mesh is fully built.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_init_selectors(void)
+{
+ cs_mesh_init_group_classes(cs_glob_mesh);
+
+ /* Construction of the selectors */
+
+ cs_glob_mesh->select_cells
+ = fvm_selector_create(cs_glob_mesh->dim,
+ cs_glob_mesh->n_cells,
+ cs_glob_mesh->class_defs,
+ cs_glob_mesh->cell_family,
+ 1,
+ cs_glob_mesh_quantities->cell_cen,
+ NULL);
+
+ cs_glob_mesh->select_b_faces
+ = fvm_selector_create(cs_glob_mesh->dim,
+ cs_glob_mesh->n_b_faces,
+ cs_glob_mesh->class_defs,
+ cs_glob_mesh->b_face_family,
+ 1,
+ cs_glob_mesh_quantities->b_face_cog,
+ cs_glob_mesh_quantities->b_face_normal);
+
+ cs_glob_mesh->select_i_faces
+ = fvm_selector_create(cs_glob_mesh->dim,
+ cs_glob_mesh->n_i_faces,
+ cs_glob_mesh->class_defs,
+ cs_glob_mesh->i_face_family,
+ 1,
+ cs_glob_mesh_quantities->i_face_cog,
+ cs_glob_mesh_quantities->i_face_normal);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Print information on a mesh structure.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure.
+ * name <-- associated name.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_print_info(const cs_mesh_t *mesh,
+ const char *name)
+{
+ bft_printf(_(" %s\n"
+ " Number of cells: %lu\n"
+ " Number of interior faces: %lu\n"
+ " Number of boundary faces: %lu\n"
+ " Number of vertices: %lu\n"),
+ name,
+ (unsigned long)(mesh->n_g_cells),
+ (unsigned long)(mesh->n_g_i_faces),
+ (unsigned long)(mesh->n_g_b_faces),
+ (unsigned long)(mesh->n_g_vertices));
+}
+
+/*----------------------------------------------------------------------------
+ * Dump of a mesh structure.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_dump(const cs_mesh_t *mesh)
+{
+ cs_int_t i, j;
+
+ bft_printf("\n\nDUMP OF THE MESH STRUCTURE: %p\n\n",mesh);
+
+ bft_printf("space dim : %d\n",mesh->dim);
+ bft_printf("n_domains : %d\n",mesh->n_domains);
+ bft_printf("domain_num: %d\n",mesh->domain_num);
+
+ bft_printf("\nLocal dimensions:\n");
+ bft_printf("n_cells: %d\n",mesh->n_cells);
+ bft_printf("n_cells_with_ghosts: %d\n",mesh->n_cells_with_ghosts);
+ bft_printf("n_vertices: %d\n",mesh->n_vertices);
+ bft_printf("n_i_faces: %d\n",mesh->n_i_faces);
+ bft_printf("n_b_faces: %d\n",mesh->n_b_faces);
+
+ bft_printf("\nGlobal dimensions:\n");
+ bft_printf("n_g_cells: %d\n",mesh->n_g_cells);
+ bft_printf("n_g_vertices: %d\n",mesh->n_g_vertices);
+ bft_printf("n_g_i_faces: %d\n",mesh->n_g_i_faces);
+ bft_printf("n_g_b_faces: %d\n",mesh->n_g_b_faces);
+
+ bft_printf("\n\n --------"
+ " Vertices"
+ " --------\n\n");
+
+ bft_printf("\nVertex coordinates:\n");
+ for (i = 0; i < mesh->n_vertices; i++)
+ bft_printf(" <%3d > %10.3f %10.3f %10.3f\n",
+ i+1, mesh->vtx_coord[3*i], mesh->vtx_coord[3*i+1],
+ mesh->vtx_coord[3*i+2]);
+
+ if (mesh->n_domains > 1) {
+ bft_printf("\nGlobal vertex numbering:\n");
+ for (i = 0; i < mesh->n_vertices; i++)
+ bft_printf(" <%7d > %10u\n",
+ i+1, mesh->global_vtx_num[i]);
+ }
+
+ bft_printf("\n\n ---------------------------"
+ " Internal faces connectivity"
+ " ---------------------------\n\n");
+
+ bft_printf("\nInternal faces -> Cells connectivity:\n");
+ for (i = 0; i < mesh->n_i_faces; i++)
+ bft_printf(" < %7d > %7d <----> %7d\n", i+1,
+ mesh->i_face_cells[2*i], mesh->i_face_cells[2*i+1]);
+
+ bft_printf("\nInternal faces -> vertices connectivity:\n");
+ for (i = 0; i < mesh->n_i_faces; i++) {
+ bft_printf(" < %7d >", i+1);
+ for (j = mesh->i_face_vtx_idx[i]-1; j < mesh->i_face_vtx_idx[i+1]-1; j++)
+ bft_printf(" %7d ",mesh->i_face_vtx_lst[j]);
+ bft_printf("\n");
+ }
+
+ if (mesh->global_i_face_num != NULL) {
+
+ bft_printf("\nInternal faces global numbering:\n");
+ for (i = 0; i < mesh->n_i_faces; i++)
+ bft_printf(" < %7d > %12d",
+ i+1, mesh->global_i_face_num[i]);
+ bft_printf("\n");
+
+ }
+
+ bft_printf("\n\n -------------------------"
+ " Border faces connectivity"
+ " -------------------------\n\n");
+
+ bft_printf("\nBorder faces -> Cells connectivity:\n");
+ for (i = 0; i < mesh->n_b_faces; i++)
+ bft_printf(" < %7d > %7d\n", i+1, mesh->b_face_cells[i]);
+
+ bft_printf("\nBorder faces -> vertices connectivity:\n");
+ for (i = 0; i < mesh->n_b_faces; i++) {
+ bft_printf(" < %7d >", i+1);
+ for (j = mesh->b_face_vtx_idx[i]-1; j < mesh->b_face_vtx_idx[i+1]-1; j++)
+ bft_printf(" %7d ",mesh->b_face_vtx_lst[j]);
+ bft_printf("\n");
+ }
+
+ bft_printf("\n\n -------------------------"
+ " Cells"
+ " -------------------------\n\n");
+
+ if (mesh->global_cell_num != NULL) {
+
+ bft_printf("\nCell global numbering:\n");
+ for (i = 0; i < mesh->n_cells; i++)
+ bft_printf(" < %7d > %12d", i+1, mesh->global_cell_num[i]);
+ bft_printf("\n");
+
+ }
+
+ bft_printf("\nNumber of families: %3d\n",mesh->n_families);
+ bft_printf("Family of each cell:\n");
+ for (i = 0; i < mesh->n_cells_with_ghosts; i++)
+ bft_printf(" < %3d > %5d\n", i+1, mesh->cell_family[i]);
+
+ if (mesh->halo != NULL) {
+
+ cs_halo_t *halo = mesh->halo;
+
+ bft_printf("\nHalo information: %p\n", halo);
+
+ bft_printf("n_c_domains: %d\n", halo->n_c_domains);
+ bft_printf("n_ghost_cells: %d\n", mesh->n_ghost_cells);
+ bft_printf("n_std_ghost_cells: %d\n",
+ halo->n_elts[CS_HALO_STANDARD]);
+ bft_printf("n_ext_ghost_cells: %d\n",
+ halo->n_elts[CS_HALO_EXTENDED] - halo->n_elts[CS_HALO_STANDARD]);
+
+ for (i = 0; i < halo->n_c_domains; i++) {
+
+ bft_printf("\n\nRank id: %d\n"
+ "Halo index start: %d end: %d\n"
+ "Send index start: %d end: %d\n"
+ "Send cell numbers:\n",
+ halo->c_domain_rank[i],
+ halo->index[2*i], halo->index[2*i+2],
+ halo->send_index[2*i], halo->send_index[2*i+2]);
+ for (j = halo->send_index[2*i]; j < halo->send_index[2*i+2]; j++)
+ bft_printf(" %10d : %10d\n", j+1, halo->send_list[j]+1);
+
+ } /* End of loop on the frontiers of halo */
+
+ if (mesh->n_init_perio > 0 && halo->perio_lst != NULL) {
+
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t n_transforms = mesh->n_transforms;
+
+ bft_printf("\n\nHalo's data in case of periodicity:\n");
+ bft_printf("n_transforms: %d\n",mesh->n_transforms);
+
+ bft_printf("\nData in the standard halo\n");
+ for (i = 0; i < n_transforms; i++)
+ for (j = 0; j < n_c_domains; j++)
+ bft_printf("< rank:%3d >< transform:%2d > start_idx: %5d"
+ " n_elts: %5d\n",
+ halo->c_domain_rank[j], i,
+ halo->perio_lst[4*n_c_domains*i + 4*j],
+ halo->perio_lst[4*n_c_domains*i + 4*j+1]);
+
+ bft_printf("\nData in the extended halo\n");
+ for (i = 0; i < n_transforms; i++)
+ for (j = 0; j < n_c_domains; j++)
+ bft_printf("< rank:%3d >< transform:%2d > "
+ "start_idx: %5d, n_elts: %5d\n",
+ halo->c_domain_rank[j], i,
+ halo->perio_lst[4*n_c_domains*i + 4*j+2],
+ halo->perio_lst[4*n_c_domains*i + 4*j+3]);
+
+ } /* End if n_perio > 0 */
+
+ } /* End if mesh->halo != NULL */
+
+ if (mesh->cell_cells_idx != NULL) {
+
+ bft_printf("\n\nCell -> cells connectivity for extended neighborhood\n\n");
+ for (i = 0; i < mesh->n_cells; i++) {
+ bft_printf("< cell num:%3d> ", i+1);
+ for (j = mesh->cell_cells_idx[i]-1; j < mesh->cell_cells_idx[i+1]-1; j++)
+ bft_printf("%d ", mesh->cell_cells_lst[j]);
+ bft_printf("\n");
+ }
+
+ }
+
+ /* Dump numbering info */
+
+ cs_numbering_dump(mesh->i_face_numbering);
+ cs_numbering_dump(mesh->b_face_numbering);
+
+ bft_printf("\n\nEND OF DUMP OF MESH STRUCTURE\n\n");
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh_coherency.c b/src/base/cs_mesh_coherency.c
new file mode 100644
index 0000000..ae99e6c
--- /dev/null
+++ b/src/base/cs_mesh_coherency.c
@@ -0,0 +1,435 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions checking the coherency of the mesh
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <float.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_halo.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh_coherency.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure and type definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+#define CS_MESH_COHERENCY_TOLERANCE 0.05
+
+/*============================================================================
+ * Global static variables
+ *============================================================================*/
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check the coherency of the internal face -> cells connectivity.
+ *----------------------------------------------------------------------------*/
+
+static void
+_check_ifacel(void)
+{
+ cs_int_t i;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+
+ bft_printf(_(" Checking the face -> cells connectivity coherency\n"));
+
+ for (i = 0; i < mesh->n_i_faces; i++) {
+
+ if (mesh->i_face_cells[2*i] == 0 || mesh->i_face_cells[2*i+1] == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Internal face -> cells connectivity value not initialized\n"
+ "for face: %d (cell_num1 = %d and cell_num2 = %d)\n"),
+ i+1, mesh->i_face_cells[2*i], mesh->i_face_cells[2*i+1]);
+
+ }
+
+}
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check the coherency of the global mesh structure.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_coherency_check(void)
+{
+ cs_int_t i, j, coord_id, cell_id, face_id, vtx_id;
+ cs_real_t test, delta_mean, delta_neighbor;
+ cs_real_t _min, _max, coord;
+
+ cs_real_t delta_mean_mult = 1.0;
+
+ cs_real_t *minmax_buffer = NULL, *compute_buffer = NULL;
+ cs_real_t *min = NULL, *max = NULL, *mean = NULL, *delta = NULL;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_mesh_quantities_t *mesh_quantities = cs_glob_mesh_quantities;
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_cells_with_ghosts = mesh->n_cells_with_ghosts;
+
+ const cs_int_t *ifacel = mesh->i_face_cells;
+ const cs_int_t *bfacel = mesh->b_face_cells;
+ const cs_real_t *vtx_coord = mesh->vtx_coord;
+
+ bft_printf(_("\n Checking the mesh structure coherency:\n"));
+
+ /* Check internal face -> cells connectivity coherency */
+
+ _check_ifacel();
+
+ /* allocate and initialize buffers */
+
+ BFT_MALLOC(minmax_buffer, 2*n_cells, cs_real_t);
+ BFT_MALLOC(compute_buffer, 6*n_cells_with_ghosts, cs_real_t);
+
+ min = minmax_buffer;
+ max = minmax_buffer + n_cells;
+ mean = compute_buffer;
+ delta = compute_buffer + 3*n_cells_with_ghosts;
+
+ /* Loop on coordinates */
+
+ bft_printf(_(" Coherency criteria definition\n"));
+
+ for (coord_id = 0; coord_id < 3; coord_id++) {
+
+ for (i = 0; i < n_cells; i++) {
+ min[i] = DBL_MAX;
+ max[i] =-DBL_MAX;
+ }
+
+ for (i = 0; i < n_cells_with_ghosts; i++) {
+ mean[3*i + coord_id] = DBL_MIN;
+ delta[3*i + coord_id] = DBL_MIN;
+ }
+
+ /* Loop on internal faces */
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+
+ const cs_int_t *face_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *face_vtx_lst = mesh->i_face_vtx_lst;
+
+ _min = DBL_MAX;
+ _max =-DBL_MAX;
+
+ for (i = face_vtx_idx[face_id]-1; i < face_vtx_idx[face_id+1]-1; i++) {
+
+ vtx_id = face_vtx_lst[i]-1;
+ coord = vtx_coord[3*vtx_id + coord_id];
+ _min = CS_MIN(_min, coord);
+ _max = CS_MAX(_max, coord);
+
+ }
+
+ for (j = 0; j < 2; j++) {
+
+ cell_id = ifacel[2*face_id + j] - 1;
+
+ if (cell_id < n_cells) {
+ max[cell_id] = CS_MAX(max[cell_id], _max);
+ min[cell_id] = CS_MIN(min[cell_id], _min);
+ }
+
+ }
+
+ } /* End of loop on internal faces */
+
+ /* Loop on border faces */
+
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++) {
+
+ const cs_int_t *face_vtx_idx = mesh->b_face_vtx_idx;
+ const cs_int_t *face_vtx_lst = mesh->b_face_vtx_lst;
+
+ _min = DBL_MAX;
+ _max =-DBL_MAX;
+
+ for (i = face_vtx_idx[face_id]-1; i < face_vtx_idx[face_id+1]-1; i++) {
+
+ vtx_id = face_vtx_lst[i]-1;
+ coord = vtx_coord[3*vtx_id + coord_id];
+ _min = CS_MIN(_min, coord);
+ _max = CS_MAX(_max, coord);
+
+ }
+
+ cell_id = bfacel[face_id] - 1;
+
+ assert(cell_id < n_cells);
+ max[cell_id] = CS_MAX(max[cell_id], _max);
+ min[cell_id] = CS_MIN(min[cell_id], _min);
+
+ } /* End of loop on border faces */
+
+ /* Compute mean and delta for this coordinate */
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ mean[3*cell_id + coord_id] = (max[cell_id] + min[cell_id])/2;
+ delta[3*cell_id + coord_id] = max[cell_id] - min[cell_id];
+
+ assert(delta[3*cell_id + coord_id] > 0);
+
+ }
+
+ } /* End of loop on coordinates */
+
+ /* Synchronize variable */
+
+ if (mesh->halo != NULL) {
+
+ cs_halo_sync_var_strided(mesh->halo, mesh->halo_type, mean, 3);
+ cs_halo_sync_var_strided(mesh->halo, mesh->halo_type, delta, 3);
+
+ }
+
+ /* Synchronization for periodicity */
+
+ if (mesh->n_init_perio > 0) {
+
+ cs_real_t *delta_buffer;
+
+ BFT_MALLOC(delta_buffer, 3*n_cells_with_ghosts, cs_real_t);
+
+ /* De-interlace delta arrays for periodicity exchange;
+ Also add factor of 1.8 (> sqrt(3)) as the longest diagonal
+ of a box of side 1 is sqrt(3), and may find itself aligned
+ with axes after rotation. */
+
+ if (mesh->have_rotation_perio == 1) {
+
+ delta_mean_mult = 1.0/1.8;
+
+ for (cell_id = 0; cell_id < n_cells_with_ghosts; cell_id++) {
+ cs_real_t delta_max = delta[3*cell_id];
+ if (delta[3*cell_id + 1] > delta_max)
+ delta_max = delta[3*cell_id + 1];
+ if (delta[3*cell_id + 2] > delta_max)
+ delta_max = delta[3*cell_id + 2];
+ delta_max *= 1.8;
+ delta_buffer[ cell_id] = delta_max;
+ delta_buffer[ n_cells_with_ghosts + cell_id] = delta_max;
+ delta_buffer[2*n_cells_with_ghosts + cell_id] = delta_max;
+ }
+
+ }
+ else {
+
+ for (coord_id = 0; coord_id < 3; coord_id++) {
+ for (cell_id = 0; cell_id < n_cells_with_ghosts; cell_id++)
+ delta_buffer[coord_id*n_cells_with_ghosts + cell_id]
+ = delta[3*cell_id + coord_id];
+ }
+
+ }
+
+ cs_perio_sync_var_vect(mesh->halo,
+ mesh->halo_type,
+ CS_PERIO_ROTA_COPY,
+ delta_buffer,
+ delta_buffer + n_cells_with_ghosts,
+ delta_buffer + 2*n_cells_with_ghosts);
+
+ for (coord_id = 0; coord_id < 3; coord_id++) {
+ for (cell_id = n_cells; cell_id < n_cells_with_ghosts; cell_id++)
+ delta[3*cell_id + coord_id] =
+ delta_buffer[coord_id*n_cells_with_ghosts + cell_id];
+ }
+
+ BFT_FREE(delta_buffer);
+
+ cs_perio_sync_coords(mesh->halo, mesh->halo_type, mean);
+
+ }
+
+ for (coord_id = 0; coord_id < 3; coord_id++) {
+
+ bft_printf(_(" Coherency verification on coordinates %d\n"),
+ coord_id+1);
+
+ /* Test coherency on the standard neighborhood */
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+
+ cs_int_t cell_id1 = ifacel[2*face_id] - 1;
+ cs_int_t cell_id2 = ifacel[2*face_id + 1] - 1;
+ cs_real_t delta1 = CS_ABS(delta[3*cell_id1 + coord_id]);
+ cs_real_t delta2 = CS_ABS(delta[3*cell_id2 + coord_id]);
+ cs_real_t mean1 = mean[3*cell_id1 + coord_id];
+ cs_real_t mean2 = mean[3*cell_id2 + coord_id];
+
+ delta_mean = CS_ABS(mean2 - mean1)*delta_mean_mult;
+ delta_neighbor = (delta1 + delta2)/2.;
+
+ test = (1 + CS_MESH_COHERENCY_TOLERANCE)*delta_neighbor - delta_mean;
+
+ if (test < 0) {
+
+ cs_real_t *cell_cen = mesh_quantities->cell_cen;
+
+ bft_printf(_("\nInfo on cell 1: %d\n"
+ " cell center: %12.3g %12.3g %12.3g\n"
+ " delta: %12.3g\n"
+ " box center: %12.3g\n"),
+ cell_id1+1, cell_cen[3*cell_id1], cell_cen[3*cell_id1+1],
+ cell_cen[3*cell_id1+2], delta1, mean1);
+
+ bft_printf(_("\nInfo on cell 2: %d\n"
+ " cell center: %12.3g %12.3g %12.3g\n"
+ " delta: %12.3g\n"
+ " box center: %12.3g\n"),
+ cell_id2+1, cell_cen[3*cell_id2], cell_cen[3*cell_id2+1],
+ cell_cen[3*cell_id2+2], delta2, mean2);
+ bft_printf_flush();
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("\nCoherency error in standard halo\n"
+ "between cells %d and %d: test = %g\n"
+ "(delta = %g, delta_mean = %g)\n"),
+ cell_id1+1, cell_id2+1, test, delta_neighbor, delta_mean);
+
+ }
+
+ } /* End of loop on internal faces */
+
+ if (mesh->cell_cells_idx != NULL) {
+
+ cs_int_t *cell_cells_idx = mesh->cell_cells_idx;
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ for (i = cell_cells_idx[cell_id]-1;
+ i < cell_cells_idx[cell_id+1]-1; i++) {
+
+ cs_int_t cell_id2 = mesh->cell_cells_lst[i] - 1;
+ cs_real_t delta1 = CS_ABS(delta[3*cell_id + coord_id]);
+ cs_real_t delta2 = CS_ABS(delta[3*cell_id2 + coord_id]);
+ cs_real_t mean1 = mean[3*cell_id + coord_id];
+ cs_real_t mean2 = mean[3*cell_id2 + coord_id];
+
+ delta_mean = CS_ABS(mean2 - mean1)*delta_mean_mult;
+ delta_neighbor = (delta1 + delta2)/2.;
+
+ test = (1 + CS_MESH_COHERENCY_TOLERANCE)*delta_neighbor - delta_mean;
+
+ if (test < 0) {
+
+ cs_real_t *cell_cen = mesh_quantities->cell_cen;
+
+ bft_printf(_("\nInfo on cell 1: %d\n"
+ " cell center: %12.3g %12.3g %12.3g\n"
+ " delta: %12.3g\n"
+ " box center: %12.3g\n"),
+ cell_id+1, cell_cen[3*cell_id], cell_cen[3*cell_id+1],
+ cell_cen[3*cell_id+2], delta1, mean1);
+
+ bft_printf(_("\nInfo on cell 2: %d\n"
+ " cell center: %12.3g %12.3g %12.3g\n"
+ " delta: %12.3g\n"
+ " box center: %12.3g\n"),
+ cell_id2+1, cell_cen[3*cell_id2], cell_cen[3*cell_id2+1],
+ cell_cen[3*cell_id2+2], delta2, mean2);
+ bft_printf_flush();
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("\nCoherency error in extended halo\n"
+ "between cells %d and %d: test = %g\n"
+ "(delta = %g, delta_mean = %g)\n"),
+ cell_id+1, cell_id2+1, test, delta_neighbor, delta_mean);
+
+ }
+
+ }
+
+ } /* End of loop on cells */
+
+ } /* End of treatment of the exetended neighborhood */
+
+ } /* End of loop on coordinates */
+
+ /* Free memory */
+
+ BFT_FREE(compute_buffer);
+ BFT_FREE(minmax_buffer);
+
+ bft_printf(_(" End of coherency check of the mesh structure.\n"));
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh_connect.c b/src/base/cs_mesh_connect.c
new file mode 100644
index 0000000..c810f64
--- /dev/null
+++ b/src/base/cs_mesh_connect.c
@@ -0,0 +1,611 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Extract nodal connectivity mesh representations from a native mesh.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_mem.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+
+#include <fvm_defs.h>
+#include <fvm_nodal.h>
+#include <fvm_nodal_from_desc.h>
+#include <fvm_nodal_order.h>
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh_connect.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Extract a mesh's "cells -> faces" connectivity.
+ *
+ * We consider a common numbering for internal and boundary faces, in which
+ * boundary faces are defined first. The common id for the i-th boundary
+ * face is thus i, and that of the j-th interior face is n_b_faces + j.
+ *
+ * If ind_cel_extr != NULL, then:
+ * --- ind_cel_extr[cell_id] = id in the list to extract (0 to n-1)
+ * if cell cell_id should be extracted
+ * --- ind_cel_extr[cell_id] = -1 if cells cell_id should be ignored
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * extr_cell_size <-- size of extr_cell_id[] array
+ * extr_cell_id <-- extr_cell_id = ids of extracted cells, or -1
+ * p_cell_faces_idx --> cells -> faces index
+ * p_cell_faces_val --> cells -> faces connectivity
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_connect_get_cell_faces(const cs_mesh_t *mesh,
+ fvm_lnum_t extr_cell_size,
+ const fvm_lnum_t extr_cell_id[],
+ fvm_lnum_t * *const p_cell_faces_idx,
+ fvm_lnum_t * *const p_cell_faces_val)
+{
+ fvm_lnum_t cell_id, c_id1, c_id2, face_id, n_loc_cells;
+
+ fvm_lnum_t *cell_face_count = NULL;
+ fvm_lnum_t *cell_faces_idx = NULL;
+ fvm_lnum_t *cell_faces_val = NULL;
+
+ /* Allocate and initialize cell ->faces index */
+
+ n_loc_cells = mesh->n_cells;
+ if (extr_cell_id != NULL)
+ n_loc_cells = extr_cell_size;
+
+ BFT_MALLOC(cell_faces_idx, n_loc_cells + 1, cs_int_t);
+
+ for (cell_id = 0; cell_id < n_loc_cells + 1; cell_id++)
+ cell_faces_idx[cell_id] = 0;
+
+ /* Count number of faces per cell (we assign the temporary counter
+ corresponding to cell_id to cell_faces_idx[cell_id + 1] rather than
+ cell_faces_idx[cell_id] to simplify the next step) */
+
+ /* Remark: test if cell_id < mesh->n_cells on internal faces so
+ as to ignore ghost cells */
+
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++) {
+ cell_id = mesh->b_face_cells[face_id] - 1;
+ if (extr_cell_id != NULL)
+ cell_id = extr_cell_id[cell_id];
+ if (cell_id > -1)
+ cell_faces_idx[cell_id + 1] += 1;
+ }
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+ c_id1 = mesh->i_face_cells[face_id*2 ] - 1;
+ c_id2 = mesh->i_face_cells[face_id*2 + 1] - 1;
+ if (extr_cell_id != NULL) {
+ if (c_id1 < mesh->n_cells)
+ c_id1 = extr_cell_id[c_id1];
+ else
+ c_id1 = -1;
+ if (c_id2 < mesh->n_cells)
+ c_id2 = extr_cell_id[c_id2];
+ else
+ c_id2 = -1;
+ }
+ if (c_id1 > -1 && c_id1 < mesh->n_cells)
+ cell_faces_idx[c_id1 + 1] += 1;
+ if (c_id2 > -1 && c_id2 < mesh->n_cells)
+ cell_faces_idx[c_id2 + 1] += 1;
+ }
+
+ /* Build cell -> faces index */
+
+ cell_faces_idx[0] = 1;
+ for (cell_id = 0; cell_id < n_loc_cells; cell_id++)
+ cell_faces_idx[cell_id + 1] += cell_faces_idx[cell_id];
+
+ /* Build array of values */
+
+ BFT_MALLOC(cell_faces_val, cell_faces_idx[n_loc_cells] - 1, cs_int_t);
+ BFT_MALLOC(cell_face_count, n_loc_cells, cs_int_t);
+
+ for (cell_id = 0; cell_id < n_loc_cells; cell_id++)
+ cell_face_count[cell_id] = 0;
+
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++) {
+ cell_id = mesh->b_face_cells[face_id] - 1;
+ if (extr_cell_id != NULL)
+ cell_id = extr_cell_id[cell_id];
+ if (cell_id > -1) {
+ cell_faces_val[cell_faces_idx[cell_id] + cell_face_count[cell_id] - 1]
+ = face_id + 1;
+ cell_face_count[cell_id] += 1;
+ }
+ }
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+ c_id1 = mesh->i_face_cells[face_id*2 ] - 1;
+ c_id2 = mesh->i_face_cells[face_id*2 + 1] - 1;
+ if (extr_cell_id != NULL) {
+ if (c_id1 < mesh->n_cells)
+ c_id1 = extr_cell_id[c_id1];
+ else
+ c_id1 = -1;
+ if (c_id2 < mesh->n_cells)
+ c_id2 = extr_cell_id[c_id2];
+ else
+ c_id2 = -1;
+ }
+ if (c_id1 > -1 && c_id1 < mesh->n_cells) {
+ cell_faces_val[cell_faces_idx[c_id1] + cell_face_count[c_id1] - 1]
+ = face_id + mesh->n_b_faces + 1;
+ cell_face_count[c_id1] += 1;
+ }
+ if (c_id2 > -1 && c_id2 < mesh->n_cells) {
+ cell_faces_val[cell_faces_idx[c_id2] + cell_face_count[c_id2] - 1]
+ = -(face_id + mesh->n_b_faces + 1);
+ cell_face_count[c_id2] += 1;
+ }
+ }
+
+ BFT_FREE(cell_face_count);
+
+ /* Return values */
+
+ *p_cell_faces_idx = cell_faces_idx;
+ *p_cell_faces_val = cell_faces_val;
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ {
+ cs_int_t ipos, ival;
+ /* Print arrays */
+ bft_printf("dbg : cs_mesh_ret_cel_fac\n"
+ "nombre de cellules extraites = %d\n", extr_cell_size);
+ for (ipos = 0; ipos < extr_cell_size; ipos++) {
+ bft_printf(" cellule %d\n", ipos);
+ bft_printf(" cell_faces_idx[%d] = %d\n", ipos, cell_faces_idx[ipos]);
+ for (ival = cell_faces_idx[ipos] - 1;
+ ival < cell_faces_idx[ipos + 1] - 1;
+ ival++)
+ bft_printf(" cell_faces_val[%d] = %d\n",
+ ival, cell_faces_val[ival]);
+ }
+ bft_printf(" cell_faces_idx[%d] = %d\n", ipos, cell_faces_idx[ipos]);
+ }
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Build a nodal connectivity structure from a subset of a mesh's cells.
+ *
+ * The list of cells to extract is optional (if none is given, all cells
+ * faces are extracted by default); it does not need to be ordered on input,
+ * but is always ordered on exit (as cells are extracted by increasing number
+ * traversal, the list is reordered to ensure the coherency of the extracted
+ * mesh's link to its parent cells, built using this list).
+ *
+ * parameters:
+ * mesh <-- base mesh
+ * name <-- extracted mesh name
+ * cell_list_size <-- size of cell_list[] array
+ * cell_list <-> list of cells (1 to n), or NULL
+ *
+ * returns:
+ * pointer to extracted nodal mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_nodal_t *
+cs_mesh_connect_cells_to_nodal(const cs_mesh_t *mesh,
+ const char *name,
+ fvm_lnum_t cell_list_size,
+ fvm_lnum_t cell_list[])
+{
+ cs_int_t cell_id;
+
+ cs_int_t extr_cell_count = 0;
+ cs_int_t *extr_cell_idx = NULL;
+
+ cs_int_t *cell_face_idx = NULL;
+ cs_int_t *cell_face_num = NULL;
+
+ fvm_lnum_t face_num_shift[3];
+ fvm_lnum_t *face_vertices_idx[2];
+ fvm_lnum_t *face_vertices_num[2];
+ fvm_lnum_t *polyhedra_faces = NULL;
+
+ fvm_nodal_t *extr_mesh;
+
+ /* Check that the mesh contains face -> vertices connectivity */
+
+ if (mesh->b_face_vtx_idx == NULL || mesh->i_face_vtx_idx == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The main mesh does not contain any face -> vertices\n"
+ "connectivity, necessary for the nodal connectivity\n"
+ "reconstruction (cs_mesh_connect_cells_to_nodal)."));
+
+ /* Count the number of cells to convert */
+
+ if (cell_list != NULL) {
+
+ BFT_MALLOC(extr_cell_idx, mesh->n_cells, cs_int_t);
+
+ /* Initialize index as marker */
+
+ for (cell_id = 0; cell_id < mesh->n_cells; cell_id++)
+ extr_cell_idx[cell_id] = -1;
+ for (cell_id = 0; cell_id < cell_list_size; cell_id++) {
+ if (cell_list[cell_id] <= mesh->n_cells)
+ extr_cell_idx[cell_list[cell_id] - 1] = 1;
+ }
+
+ /* Convert marked ids to indexes (1 to n) and reconstruct values of
+ cell_list[] to ensure that it is ordered. */
+
+ extr_cell_count = 0;
+ for (cell_id = 0; cell_id < mesh->n_cells; cell_id++) {
+ if (extr_cell_idx[cell_id] == 1) {
+ cell_list[extr_cell_count] = cell_id + 1;
+ extr_cell_idx[cell_id] = extr_cell_count++;
+ }
+ }
+
+ assert(extr_cell_count <= cell_list_size);
+
+ }
+ else {
+ extr_cell_count = CS_MIN(mesh->n_cells, cell_list_size);
+ extr_cell_idx = NULL;
+ }
+
+ /* Extract "cells -> faces" connectivity */
+
+ cs_mesh_connect_get_cell_faces(mesh,
+ extr_cell_count,
+ extr_cell_idx,
+ &cell_face_idx,
+ &cell_face_num);
+
+ if (extr_cell_idx != NULL)
+ BFT_FREE(extr_cell_idx);
+
+ /* Build nodal connectivity */
+
+ face_num_shift[0] = 0;
+ face_num_shift[1] = mesh->n_b_faces + face_num_shift[0];
+ face_num_shift[2] = mesh->n_i_faces + face_num_shift[1];
+
+ face_vertices_idx[0] = mesh->b_face_vtx_idx;
+ face_vertices_idx[1] = mesh->i_face_vtx_idx;
+ face_vertices_num[0] = mesh->b_face_vtx_lst;
+ face_vertices_num[1] = mesh->i_face_vtx_lst;
+
+ extr_mesh = fvm_nodal_create(name, 3);
+
+ fvm_nodal_from_desc_add_cells(extr_mesh,
+ extr_cell_count,
+ NULL,
+ 2,
+ face_num_shift,
+ (const fvm_lnum_t **)face_vertices_idx,
+ (const fvm_lnum_t **)face_vertices_num,
+ cell_face_idx,
+ cell_face_num,
+ cell_list,
+ &polyhedra_faces);
+
+ fvm_nodal_set_shared_vertices(extr_mesh,
+ mesh->vtx_coord);
+
+ /* Free memory */
+
+ BFT_FREE(polyhedra_faces);
+
+ BFT_FREE(cell_face_idx);
+ BFT_FREE(cell_face_num);
+
+ /* Sort cells by increasing global number */
+
+ fvm_nodal_order_cells(extr_mesh, mesh->global_cell_num);
+ fvm_nodal_init_io_num(extr_mesh, mesh->global_cell_num, 3);
+
+ /* Sort vertices by increasing global number */
+
+ fvm_nodal_order_vertices(extr_mesh, mesh->global_vtx_num);
+ fvm_nodal_init_io_num(extr_mesh, mesh->global_vtx_num, 0);
+
+ /* We are done */
+
+ return extr_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Build a nodal connectivity structure from a subset of a mesh's faces.
+ *
+ * The lists of faces to extract are optional (if none is given, boundary
+ * faces are extracted by default); they do not need to be ordered on input,
+ * but they are always ordered on exit (as faces are extracted by increasing
+ * number traversal, the lists are reordered to ensure the coherency of
+ * the extracted mesh's link to its parent faces, built using these lists).
+ *
+ * parameters:
+ * mesh <-- base mesh
+ * name <-- extracted mesh name
+ * i_face_list_size <-- size of i_face_list[] array
+ * b_face_list_size <-- size of b_face_list[] array
+ * i_face_list <-> list of interior faces (1 to n), or NULL
+ * b_face_list <-> list of boundary faces (1 to n), or NULL
+ *
+ * returns:
+ * pointer to extracted nodal mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_nodal_t *
+cs_mesh_connect_faces_to_nodal(const cs_mesh_t *mesh,
+ const char *name,
+ fvm_lnum_t i_face_list_size,
+ fvm_lnum_t b_face_list_size,
+ fvm_lnum_t i_face_list[],
+ fvm_lnum_t b_face_list[])
+{
+ fvm_lnum_t face_id, i;
+
+ fvm_lnum_t n_max_faces = 0;
+ fvm_lnum_t b_face_count = 0;
+ fvm_lnum_t i_face_count = 0;
+ fvm_lnum_t extr_face_count = 0;
+ fvm_lnum_t *extr_face_idx = NULL;
+ fvm_lnum_t *extr_face_list = NULL;
+
+ fvm_lnum_t face_num_shift[3];
+ fvm_lnum_t *face_vertices_idx[2];
+ fvm_lnum_t *face_vertices_num[2];
+
+ fvm_gnum_t *num_glob_fac = NULL;
+
+ fvm_nodal_t *extr_mesh;
+
+ /* Check that the mesh contains face -> vertices connectivity */
+
+ if (mesh->b_face_vtx_idx == NULL || mesh->i_face_vtx_idx == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The main mesh does not contain any face -> vertices\n"
+ "connectivity, necessary for the nodal connectivity\n"
+ "reconstruction (cs_mesh_connect_faces_to_nodal)."));
+
+ /* Count the number of faces to convert */
+
+ n_max_faces = mesh->n_i_faces + mesh->n_b_faces;
+ BFT_MALLOC(extr_face_idx, n_max_faces, cs_int_t);
+
+ /* Initialize index as marker */
+
+ for (face_id = 0; face_id < n_max_faces; face_id++)
+ extr_face_idx[face_id] = -1;
+
+ if (b_face_list_size == mesh->n_b_faces) {
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++)
+ extr_face_idx[face_id] = 1;
+ }
+ else if (b_face_list != NULL) {
+ for (face_id = 0; face_id < b_face_list_size; face_id++)
+ extr_face_idx[b_face_list[face_id] - 1] = 1;
+ }
+
+ if (i_face_list_size == mesh->n_i_faces) {
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++)
+ extr_face_idx[face_id + mesh->n_b_faces] = 1;
+ }
+ else if (i_face_list != NULL) {
+ for (face_id = 0; face_id < i_face_list_size; face_id++)
+ extr_face_idx[i_face_list[face_id] - 1 + mesh->n_b_faces] = 1;
+ }
+
+ /* Convert marked ids to indexes (1 to n) and reconstruct values of
+ b_face_list[] and i_face_list[] to ensure that they are ordered. */
+
+ b_face_count = 0;
+ i_face_count = 0;
+
+ if (b_face_list != NULL) {
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++) {
+ if (extr_face_idx[face_id] == 1) {
+ b_face_list[b_face_count] = face_id + 1;
+ b_face_count++;
+ }
+ }
+ }
+ else
+ b_face_count = CS_MIN(b_face_list_size, mesh->n_b_faces);
+
+ if (i_face_list != NULL) {
+ for (face_id = 0, i = mesh->n_b_faces;
+ face_id < mesh->n_i_faces;
+ face_id++, i++) {
+ if (extr_face_idx[i] == 1) {
+ i_face_list[i_face_count] = face_id + 1;
+ i_face_count++;
+ }
+ }
+ }
+ else
+ i_face_count = CS_MIN(i_face_list_size, mesh->n_i_faces);
+
+ BFT_FREE(extr_face_idx);
+
+ /* Build a contiguous list (boundary faces, interior faces) */
+
+ extr_face_count = b_face_count + i_face_count;
+
+ BFT_MALLOC(extr_face_list, extr_face_count, cs_int_t);
+
+ if (b_face_list != NULL) {
+ for (face_id = 0; face_id < b_face_count; face_id++)
+ extr_face_list[face_id] = b_face_list[face_id];
+ }
+ else if (b_face_list == NULL) { /* boundary faces by default if no list */
+ for (face_id = 0; face_id < b_face_count; face_id++)
+ extr_face_list[face_id] = face_id + 1;
+ }
+
+ if (i_face_list != NULL) {
+ for (face_id = 0, i = b_face_count; face_id < i_face_count; face_id++, i++)
+ extr_face_list[i] = i_face_list[face_id] + mesh->n_b_faces;
+ }
+ else if (i_face_list == NULL) {
+ for (face_id = 0, i = b_face_count; face_id < i_face_count; face_id++, i++)
+ extr_face_list[i] = face_id + mesh->n_b_faces + 1;
+ }
+
+ /* Build the nodal connectivity */
+
+ face_num_shift[0] = 0;
+ face_num_shift[1] = mesh->n_b_faces + face_num_shift[0];
+ face_num_shift[2] = mesh->n_i_faces + face_num_shift[1];
+
+ face_vertices_idx[0] = mesh->b_face_vtx_idx;
+ face_vertices_idx[1] = mesh->i_face_vtx_idx;
+ face_vertices_num[0] = mesh->b_face_vtx_lst;
+ face_vertices_num[1] = mesh->i_face_vtx_lst;
+
+ extr_mesh = fvm_nodal_create(name, 3);
+
+ fvm_nodal_from_desc_add_faces(extr_mesh,
+ extr_face_count,
+ extr_face_list,
+ 2,
+ face_num_shift,
+ (const fvm_lnum_t **)face_vertices_idx,
+ (const fvm_lnum_t **)face_vertices_num,
+ NULL);
+
+ fvm_nodal_set_shared_vertices(extr_mesh,
+ mesh->vtx_coord);
+
+ BFT_FREE(extr_face_list);
+
+ /* In case of parallelism or face renumbering, sort faces by
+ increasing global number */
+
+ if (mesh->global_i_face_num != NULL || mesh->global_b_face_num != NULL) {
+
+ BFT_MALLOC(num_glob_fac, n_max_faces, fvm_gnum_t);
+
+ if (mesh->global_b_face_num == NULL) {
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++)
+ num_glob_fac[face_id] = face_id + 1;
+ }
+ else {
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++)
+ num_glob_fac[face_id] = mesh->global_b_face_num[face_id];
+ }
+
+ assert(mesh->n_g_b_faces + mesh->n_g_i_faces > 0);
+
+ if (mesh->global_i_face_num == NULL) {
+ for (face_id = 0, i = mesh->n_b_faces;
+ face_id < mesh->n_i_faces;
+ face_id++, i++)
+ num_glob_fac[i] = face_id + 1 + mesh->n_g_b_faces;
+ }
+ else {
+ for (face_id = 0, i = mesh->n_b_faces;
+ face_id < mesh->n_i_faces;
+ face_id++, i++)
+ num_glob_fac[i] = mesh->global_i_face_num[face_id] + mesh->n_g_b_faces;
+ }
+
+ }
+
+ /* Sort faces by increasing global number */
+
+ fvm_nodal_order_faces(extr_mesh, num_glob_fac);
+ fvm_nodal_init_io_num(extr_mesh, num_glob_fac, 2);
+
+ if (num_glob_fac != NULL)
+ BFT_FREE(num_glob_fac);
+
+ /* Sort vertices by increasing global number */
+
+ fvm_nodal_order_vertices(extr_mesh, mesh->global_vtx_num);
+ fvm_nodal_init_io_num(extr_mesh, mesh->global_vtx_num, 0);
+
+ /* We are done */
+
+ return extr_mesh;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh_halo.c b/src/base/cs_mesh_halo.c
new file mode 100644
index 0000000..2e2ad2b
--- /dev/null
+++ b/src/base/cs_mesh_halo.c
@@ -0,0 +1,3571 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions dealing with ghost cells
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_periodicity.h>
+#include <fvm_interface.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_halo.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh_halo.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure and type definitions
+ *============================================================================*/
+
+typedef struct _vtx_lookup_table {
+
+ cs_int_t n_vertices; /* Number of local vertices in the problem domain */
+ cs_int_t n_transforms; /* Number of transformations */
+ cs_int_t n_interfaces; /* Number of interfaces */
+ cs_int_t n_categories; /* Number of possible categories
+ = n_interfaces * (n_transforms + 1)
+ (1 category for purely parallel elements) */
+
+ cs_int_t *if_ranks; /* List of ranks */
+ cs_int_t *rank_ids; /* list of rank ids */
+
+ cs_int_t *index; /* index on table (size = n_vertices + 1) */
+
+ cs_int_t *rank_list; /* list of ranks on which vertices are linked */
+ cs_int_t *type_list; /* list of type (purelly parallel (=0) or number
+ of the periodicity) featuring a vertex. This
+ list is only allocated when n_perio > 0 */
+
+} vtx_lookup_table_t;
+
+
+typedef struct _table_int {
+
+ cs_int_t n_elts;
+ cs_int_t size_max;
+ cs_int_t *values;
+
+} table_int_t;
+
+
+typedef struct {
+
+ cs_int_t n_elts; /* Number of elements of the index */
+ cs_int_t *index; /* size = n_elts + 1: [ 0 ... n_elts ] */
+
+ cs_int_t size; /* size of the list */
+ cs_int_t n_lists; /* number of lists */
+ cs_int_t **lists; /* list of the corresponding elements */
+
+} lookup_table_t;
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global static variables
+ *============================================================================*/
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*---------------------------------------------------------------------------
+ * Create a table_int_t structure and initialize it with a given value and
+ * a given size.
+ *
+ * parameters:
+ * init_value --> initial values
+ * size --> size of the table
+ *
+ * returns:
+ * pointer to a table_int_t structure
+ *---------------------------------------------------------------------------*/
+
+static table_int_t *
+_create_table_int(cs_int_t init_value,
+ cs_int_t size)
+{
+ cs_int_t i;
+
+ table_int_t *ret_table = NULL;
+
+ BFT_MALLOC(ret_table, 1, table_int_t);
+ BFT_MALLOC(ret_table->values, size, cs_int_t);
+
+ ret_table->size_max = size;
+ ret_table->n_elts = 0;
+
+ for (i = 0; i < size; i++)
+ ret_table->values[i] = init_value;
+
+ return ret_table;
+}
+
+/*---------------------------------------------------------------------------
+ * Delete table_int_t structure.
+ *
+ * parameters:
+ * this_table --> a pointer to a table_int_t structure
+ *
+ * returns:
+ * A NULL pointer
+ *---------------------------------------------------------------------------*/
+
+static table_int_t *
+_delete_table_int(table_int_t *this_table)
+{
+ BFT_FREE(this_table->values);
+ this_table->size_max = 0;
+ this_table->n_elts = 0;
+ BFT_FREE(this_table);
+
+ return NULL;
+}
+
+/*---------------------------------------------------------------------------
+ * Reset a table_int_t structure. Memory is not freed but structure
+ * is reinitialized.
+ *
+ * parameters:
+ * this_table --> a pointer to a table_int_t structure
+ * init_value --> new value given to the elements of the table
+ *---------------------------------------------------------------------------*/
+
+static void
+_reset_table_int(table_int_t *this_table,
+ cs_int_t init_value)
+{
+ cs_int_t i;
+
+ for (i = 0; i < this_table->n_elts; i++)
+ this_table->values[i] = init_value;
+ this_table->n_elts = 0;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Find value in table_int_t structure.
+ *
+ * parameters:
+ * this_table --> a pointer to a table_int_t structure
+ * value --> value to find
+ *
+ * returns:
+ * The associated index or -1 if value was not found
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t
+_find_table_int_value(table_int_t *this_table,
+ cs_int_t value)
+{
+ cs_int_t i;
+
+ cs_int_t ret_index = -1;
+
+ for (i = 0; i < this_table->n_elts; i++) {
+ if (this_table->values[i] == value)
+ break;
+ }
+
+ if (i < this_table->n_elts)
+ ret_index = i;
+
+ return ret_index;
+}
+
+/*---------------------------------------------------------------------------
+ * Add value in a table_int_t structure if this value does not already exist
+ * in the table.
+ *
+ * parameters:
+ * this_table --> a pointer to a table_int_t structure
+ * value --> value to add
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_table_int_value(table_int_t *this_table,
+ cs_int_t value)
+{
+ cs_int_t index;
+
+ index = _find_table_int_value(this_table, value);
+
+ if (index == -1) { /* Value does not already exist in the table */
+
+ if (this_table->n_elts == this_table->size_max) {
+ this_table->size_max = 2*this_table->n_elts;
+ BFT_REALLOC(this_table->values, this_table->size_max, cs_int_t);
+ }
+
+ this_table->values[this_table->n_elts] = value;
+ this_table->n_elts += 1;
+
+ } /* End of value addition */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Add a value in a table_int_t structure. Value can already exist in the
+ * table.
+ *
+ * parameters:
+ * this_table --> a pointer to a table_int_t structure
+ * value --> value to find
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_table_int_value_dup(table_int_t *this_table,
+ cs_int_t value)
+{
+
+ if (this_table->n_elts == this_table->size_max) {
+ this_table->size_max = 2*this_table->n_elts;
+ BFT_REALLOC(this_table->values, this_table->size_max, cs_int_t);
+ }
+
+ this_table->values[this_table->n_elts] = value;
+ this_table->n_elts += 1;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Raise the value of index "idx" by "count".
+ *
+ * parameters:
+ * this_table --> a pointer to a table_int_t structure
+ * idx --> value has the index "idx"
+ * count --> value is raised by count
+ *---------------------------------------------------------------------------*/
+
+static void
+_raise_table_int_value(table_int_t *this_table,
+ cs_int_t idx,
+ cs_int_t count)
+{
+
+ if (idx >= this_table->n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _("_raise_table_int_value:\n"
+ "Invalid index. table_int structure has a lower n_elts.\n"
+ "Index = %d, n_elts = %d and table size max = %d\n"),
+ idx, this_table->n_elts, this_table->size_max);
+
+ else
+ this_table->values[idx] += count;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Get value for element of index "idx" in table_int_t.
+ *
+ * parameters:
+ *
+ * returns:
+ * The value of the element of index "idx"
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t
+_get_table_int_value(table_int_t *this_table,
+ cs_int_t idx)
+{
+ cs_int_t retval = -9999;
+
+ if (idx >= this_table->n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _("get_table_int_value:\n"
+ "Invalid index. table_int structure has a lower n_elts.\n"
+ "Index = %d, n_elts = %d and table size max = %d\n"),
+ idx, this_table->n_elts, this_table->size_max);
+
+ else
+ retval = this_table->values[idx];
+
+ return retval;
+}
+
+/*---------------------------------------------------------------------------
+ * Delete a lookup_table_t structure
+ *
+ * this_table --> pointer to a lookup_table_t structure
+ *
+ * returns:
+ * NULL
+ *---------------------------------------------------------------------------*/
+
+static lookup_table_t *
+_delete_lookup_table(lookup_table_t *this_table)
+{
+ cs_int_t i;
+
+ BFT_FREE(this_table->index);
+
+ for (i = 0; i < this_table->n_lists; i++)
+ BFT_FREE(this_table->lists[i]);
+ BFT_FREE(this_table->lists);
+
+ BFT_FREE(this_table);
+
+ return NULL;
+}
+
+/*---------------------------------------------------------------------------
+ * Fill a look up table structure without periodicity
+ *
+ * The look up list takes the distant rank value with which a local vertex
+ * is linked.
+ *
+ * parameters:
+ * vtx_lookup --> pointer to a vtx_lookup_table_t structure
+ * ifs --> pointer to a fvm_interface_set_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_vtx_lookup(vtx_lookup_table_t *vtx_lookup,
+ fvm_interface_set_t *ifs)
+{
+ cs_int_t i, vtx_id, rank_id, shift;
+
+ cs_int_t *counter = NULL;
+
+ const cs_int_t n_interfaces = fvm_interface_set_size(ifs);
+
+ BFT_MALLOC(counter, vtx_lookup->n_vertices, cs_int_t);
+
+ for (i = 0; i < vtx_lookup->n_vertices; i++)
+ counter[i] = 0;
+
+ for (rank_id = 0; rank_id < n_interfaces; rank_id++) {
+
+ const fvm_interface_t *interface = fvm_interface_set_get(ifs, rank_id);
+ const fvm_lnum_t interface_size = fvm_interface_size(interface);
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num(interface);
+
+ for (i = 0; i < interface_size; i++) { /* Only parallel vertices */
+
+ vtx_id = local_num[i]-1;
+ shift = vtx_lookup->index[vtx_id] + counter[vtx_id];
+
+ vtx_lookup->rank_list[shift] = vtx_lookup->rank_ids[rank_id];
+ counter[vtx_id] += 1;
+
+ }
+
+ } /* End of loop on ranks */
+
+ BFT_FREE(counter);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Fill a look up table structure with periodicity.
+ *
+ * The rank_list takes the distant rank value with which a local vertex
+ * is linked.
+ * The type_list takes the id number associated to the kind of link between
+ * local and distant element. If the link is purely parallel, list gets value
+ * 0 otherwise the list gets the number of the transformation (+ or -)
+ *
+ * parameters:
+ * vtx_look_up --> pointer to a vtx_lookup_table_t structure
+ * ifs --> pointer to a fvm_interface_set_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_vtx_lookup_with_perio(vtx_lookup_table_t *vtx_lookup,
+ fvm_interface_set_t *ifs)
+{
+ cs_int_t i, tr_id, vtx_id, rank_id, shift;
+
+ cs_int_t *counter = NULL;
+
+ const fvm_periodicity_t *periodicity = fvm_interface_set_periodicity(ifs);
+ const cs_int_t n_interfaces = fvm_interface_set_size(ifs);
+ const cs_int_t n_transforms = fvm_periodicity_get_n_transforms(periodicity);
+
+ assert(n_transforms > 0);
+
+ BFT_MALLOC(counter, vtx_lookup->n_vertices, cs_int_t);
+
+ for (i = 0; i < vtx_lookup->n_vertices; i++)
+ counter[i] = 0;
+
+ for (rank_id = 0; rank_id < n_interfaces; rank_id++) {
+
+ const fvm_interface_t *interface
+ = fvm_interface_set_get(ifs, vtx_lookup->rank_ids[rank_id]);
+ const fvm_lnum_t tr_index_size = fvm_interface_get_tr_index_size(interface);
+ const fvm_lnum_t *tr_index = fvm_interface_get_tr_index(interface);
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num(interface);
+
+ assert(n_transforms + 2 == tr_index_size);
+ assert(tr_index != NULL);
+
+ for (i = tr_index[0]; i < tr_index[1]; i++) { /* Only parallel vertices */
+
+ vtx_id = local_num[i]-1;
+ shift = vtx_lookup->index[vtx_id] + counter[vtx_id];
+
+ vtx_lookup->rank_list[shift] = rank_id;
+ vtx_lookup->type_list[shift] = 0;
+ counter[vtx_id] += 1;
+
+ }
+
+ for (tr_id = 0; tr_id < n_transforms; tr_id++) {
+
+ for (i = tr_index[tr_id + 1]; i < tr_index[tr_id + 2]; i++) {
+
+ vtx_id = local_num[i]-1;
+ shift = vtx_lookup->index[vtx_id] + counter[vtx_id];
+ vtx_lookup->rank_list[shift] = rank_id;
+ vtx_lookup->type_list[shift] = tr_id + 1;
+ counter[vtx_id] += 1;
+
+ }
+
+ } /* End of loop on transformations */
+
+ } /* End of loop on ranks */
+
+ BFT_FREE(counter);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Create a vtx_look_up_table_t structure
+ *
+ * parameters:
+ * n_vertices --> number of vertices of the table.
+ * ifs --> pointer to a fvm_interface_set_t structure
+ *
+ * returns:
+ * A pointer to the created vtx_lookup_table_t structure
+ *---------------------------------------------------------------------------*/
+
+static vtx_lookup_table_t *
+_vtx_lookup_create(cs_int_t n_vertices,
+ fvm_interface_set_t *ifs)
+{
+ cs_int_t i, rank_id, tmp_id, interface_size;
+
+ cs_int_t loc_rank_id = -1;
+ vtx_lookup_table_t *vtx_lookup = NULL;
+
+ const fvm_interface_t *interface = NULL;
+ const fvm_lnum_t *local_num = NULL;
+ const fvm_periodicity_t *periodicity = fvm_interface_set_periodicity(ifs);
+ const cs_int_t n_transforms = fvm_periodicity_get_n_transforms(periodicity);
+ const cs_int_t n_interfaces = fvm_interface_set_size(ifs);
+
+ BFT_MALLOC(vtx_lookup, 1, vtx_lookup_table_t);
+
+ vtx_lookup->n_vertices = n_vertices;
+ vtx_lookup->n_interfaces = n_interfaces;
+ vtx_lookup->n_transforms = n_transforms;
+ vtx_lookup->n_categories = (n_transforms + 1)*n_interfaces;
+
+ BFT_MALLOC(vtx_lookup->index, n_vertices + 1, cs_int_t);
+ BFT_MALLOC(vtx_lookup->if_ranks, n_interfaces, cs_int_t);
+ BFT_MALLOC(vtx_lookup->rank_ids, n_interfaces, cs_int_t);
+
+ for (i = 0; i < n_vertices + 1; i++)
+ vtx_lookup->index[i] = 0;
+
+ /* Check if cs_glob_rank_id belongs to the interface set in order to
+ arrange if_ranks with local rank at first place */
+
+ for (rank_id = 0; rank_id < n_interfaces; rank_id++) {
+
+ interface = fvm_interface_set_get(ifs, rank_id);
+ vtx_lookup->if_ranks[rank_id] = fvm_interface_rank(interface);
+ vtx_lookup->rank_ids[rank_id] = rank_id;
+
+ if (cs_glob_rank_id == fvm_interface_rank(interface))
+ loc_rank_id = rank_id;
+
+ } /* End of loop on if_ranks */
+
+ /* Define vtx_lookup->if_ranks in right order */
+
+ if (loc_rank_id > 0) {
+
+ tmp_id = vtx_lookup->if_ranks[loc_rank_id];
+ vtx_lookup->if_ranks[loc_rank_id] = vtx_lookup->if_ranks[0];
+ vtx_lookup->if_ranks[0] = tmp_id;
+
+ vtx_lookup->rank_ids[0] = loc_rank_id;
+ vtx_lookup->rank_ids[loc_rank_id] = 0;
+
+ /* Order by increasing numbers */
+
+ if (n_interfaces > 2) {
+
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *buffer = NULL;
+ cs_int_t *_rank_ids = NULL;
+
+ assert(sizeof(fvm_lnum_t) == sizeof(cs_int_t));
+
+ BFT_MALLOC(order, n_interfaces - 1, fvm_lnum_t);
+ BFT_MALLOC(buffer, n_interfaces - 1, fvm_gnum_t);
+ BFT_MALLOC(_rank_ids, n_interfaces , cs_int_t);
+
+ _rank_ids[0] = vtx_lookup->rank_ids[0];
+ for (i = 1; i < n_interfaces; i++) {
+ buffer[i-1] = (fvm_gnum_t)vtx_lookup->if_ranks[i];
+ _rank_ids[i] = vtx_lookup->rank_ids[i];
+ }
+
+ fvm_order_local_allocated(NULL,
+ buffer,
+ order,
+ n_interfaces-1);
+
+ for (i = 0; i < n_interfaces - 1; i++) {
+ vtx_lookup->if_ranks[i+1] = (cs_int_t)buffer[order[i]];
+ vtx_lookup->rank_ids[i+1] = _rank_ids[order[i] + 1];
+ }
+
+ BFT_FREE(buffer);
+ BFT_FREE(order);
+ BFT_FREE(_rank_ids);
+
+ } /* End of ordering ranks */
+
+ } /* If rank order has to be changed */
+
+ /* First loop to create index */
+
+ for (rank_id = 0; rank_id < n_interfaces; rank_id++) {
+
+ interface = fvm_interface_set_get(ifs, rank_id);
+ interface_size = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ for (i = 0; i < interface_size; i++)
+ vtx_lookup->index[(cs_int_t)local_num[i]] += 1;
+
+ } /* End of loop on if_ranks */
+
+ /* Create index and allocate buffers */
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_lookup->index[i+1] += vtx_lookup->index[i];
+
+ BFT_MALLOC(vtx_lookup->rank_list, vtx_lookup->index[n_vertices], cs_int_t);
+
+ /* Second loop to fill table(s) */
+
+ if (n_transforms > 0) {
+
+ BFT_MALLOC(vtx_lookup->type_list, vtx_lookup->index[n_vertices], cs_int_t);
+ _fill_vtx_lookup_with_perio(vtx_lookup, ifs);
+
+ }
+ else {
+
+ vtx_lookup->type_list = NULL;
+ _fill_vtx_lookup(vtx_lookup, ifs);
+
+ }
+
+ return vtx_lookup;
+}
+
+/*---------------------------------------------------------------------------
+ * Destroy a vtx_lookup structure.
+ *
+ * parameters:
+ * vtx_lookup --> pointer to a vtx_lookup_table_t structure
+ *
+ * returns:
+ * A NULL pointer
+ *---------------------------------------------------------------------------*/
+
+static void
+_vtx_lookup_destroy(vtx_lookup_table_t *vtx_lookup)
+{
+
+ BFT_FREE(vtx_lookup->if_ranks);
+ BFT_FREE(vtx_lookup->rank_ids);
+ BFT_FREE(vtx_lookup->index);
+ BFT_FREE(vtx_lookup->rank_list);
+
+ if (vtx_lookup->type_list != NULL)
+ BFT_FREE(vtx_lookup->type_list);
+
+ BFT_FREE(vtx_lookup);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Set checker for this vertex_id according to vtx_lookup features.
+ *
+ * parameters:
+ * vtx_id --> vertex id to deal with
+ * vtx_checker <-> put a tag in the implied categories
+ * vtx_lookup --> pointer to a vtx_lookup_table_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_vtx_checker(cs_int_t vtx_id,
+ cs_int_t *vtx_checker,
+ vtx_lookup_table_t *vtx_lookup)
+{
+ cs_int_t i, rank_id, type;
+
+ const cs_int_t n_interfaces = vtx_lookup->n_interfaces;
+ const cs_int_t n_transforms = vtx_lookup->n_transforms;
+
+ for (i = vtx_lookup->index[vtx_id];
+ i < vtx_lookup->index[vtx_id + 1]; i++) {
+
+ rank_id = vtx_lookup->rank_list[i];
+
+ if (n_transforms == 0) /* purely parallel */
+
+ vtx_checker[rank_id] += 1;
+
+ else { /* n_perio > 0 */
+
+ type = vtx_lookup->type_list[i];
+ vtx_checker[type*n_interfaces + rank_id] += 1;
+
+ }
+
+ } /* End of loop on vtx_lookup */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Update the halo type of each face checker element according to vtx_checker
+ * values for this face.
+ *
+ * parameters:
+ * n_face_vertices <-- number of vertices defining a face
+ * n_categories <-- size of vtx_checker and face_checker
+ * vtx_checker <-- number of vertices for each categories for the face
+ * face_checker --> halo_type value in each categories
+ *
+ * returns:
+ * maximum halo_type value in face_checker
+ *---------------------------------------------------------------------------*/
+
+static cs_halo_type_t
+_update_face_checker(cs_int_t n_face_vertices,
+ cs_int_t n_categories,
+ cs_int_t *vtx_checker,
+ cs_halo_type_t *face_checker)
+{
+ cs_int_t i;
+
+ cs_halo_type_t ret_type = CS_HALO_N_TYPES;
+
+ for (i = 0; i < n_categories; i++) {
+
+ if (vtx_checker[i] == n_face_vertices) { /* => STANDARD HALO */
+
+ face_checker[i] = CS_HALO_STANDARD;
+ ret_type = CS_HALO_STANDARD;
+
+ }
+ else {
+
+ if (vtx_checker[i] > 0) { /* => EXTENDED HALO */
+
+ if (ret_type == CS_HALO_N_TYPES)
+ ret_type = CS_HALO_EXTENDED;
+
+ if (face_checker[i] == CS_HALO_N_TYPES)
+ face_checker[i] = CS_HALO_EXTENDED;
+
+ }
+
+ }
+
+ } /* End of loop on categories */
+
+ return ret_type;
+}
+
+/*---------------------------------------------------------------------------
+ * Update counter on number of elements in each category of halos
+ * according to face_checker values.
+ *
+ * parameters:
+ * mesh --> pointer to a mesh structure
+ * face_checker --> halo type in each categories for cell's faces
+ *---------------------------------------------------------------------------*/
+
+static void
+_count_halo_elements(cs_mesh_t *mesh,
+ cs_halo_type_t *face_checker)
+{
+ cs_int_t type_id, rank_id;
+
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_halo_t *halo = mesh->halo;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t stride = 4*n_c_domains;
+
+ for (type_id = 0; type_id < n_transforms + 1; type_id++) {
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ if (face_checker[type_id*n_c_domains + rank_id]
+ == CS_HALO_STANDARD) {
+
+ halo->send_index[2*rank_id + 1] += 1;
+
+ if (type_id > 0) /* periodic elements */
+ halo->send_perio_lst[stride*(type_id-1) + 4*rank_id + 1] += 1;
+
+ } /* STANDARD HALO */
+
+ else if (face_checker[type_id*n_c_domains + rank_id]
+ == CS_HALO_EXTENDED) {
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ halo->send_index[2*rank_id + 2] += 1;
+
+ if (type_id > 0) /* periodic elements */
+ halo->send_perio_lst[stride*(type_id-1) + 4*rank_id + 3] += 1;
+
+ }
+
+ } /* EXTENDED HALO */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on categories */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Build halo indexes
+ *
+ * parameters:
+ * mesh <-> pointer to a mesh structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_build_halo_index(cs_mesh_t *mesh)
+{
+ cs_int_t i, rank_id;
+ cs_int_t buffer_size, n_halo_elts, n_per_halo_elts;
+
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t n_init_perio = mesh->n_init_perio;
+ const cs_int_t stride = 4*n_c_domains;
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+
+ buffer_size = 0;
+ for (i = 0; i < 2*n_c_domains; i++)
+ buffer_size += halo->send_index[i+1];
+
+ BFT_MALLOC(halo->send_list, buffer_size, cs_int_t);
+
+ /* Define parallel and periodic index */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ /* Standard halo */
+ /* ------------- */
+
+ /* Count number of periodic elements in standard halo for this rank */
+
+ n_per_halo_elts = 0;
+ for (i = 0; i < n_transforms; i++)
+ n_per_halo_elts += halo->send_perio_lst[stride*i + 4*rank_id + 1];
+
+ /* Define index */
+
+ n_halo_elts = halo->send_index[2*rank_id+1];
+ halo->send_index[2*rank_id+1] += halo->send_index[2*rank_id];
+
+ assert(n_halo_elts >= n_per_halo_elts);
+
+ /* Fill perio_lst buffer */
+
+ if (n_init_perio > 0) {
+
+ if (halo->c_domain_rank[rank_id] == local_rank)
+ halo->send_perio_lst[4*rank_id] = halo->send_index[2*rank_id];
+
+ else
+ halo->send_perio_lst[4*rank_id] =
+ halo->send_index[2*rank_id] + (n_halo_elts - n_per_halo_elts);
+
+ for (i = 0; i < n_transforms - 1; i++)
+ halo->send_perio_lst[stride*(i+1) + 4*rank_id]
+ = halo->send_perio_lst[stride*i + 4*rank_id]
+ + halo->send_perio_lst[stride*i + 4*rank_id + 1];
+
+ } /* Test if n_perio > 0 */
+
+ /* Extended halo */
+ /* ------------- */
+
+ n_per_halo_elts = 0;
+ for (i = 0; i < n_transforms; i++)
+ n_per_halo_elts += halo->send_perio_lst[stride*i + 4*rank_id+3];
+
+ n_halo_elts = halo->send_index[2*rank_id+2];
+ halo->send_index[2*rank_id+2] += halo->send_index[2*rank_id+1];
+
+ assert(n_halo_elts >= n_per_halo_elts);
+
+ if (n_init_perio > 0) {
+
+ if (halo->c_domain_rank[rank_id] == local_rank)
+ halo->send_perio_lst[4*rank_id+2] = halo->send_index[2*rank_id+1];
+
+ else
+ halo->send_perio_lst[4*rank_id+2] =
+ halo->send_index[2*rank_id+1] + (n_halo_elts - n_per_halo_elts);
+
+ for (i = 0; i < n_transforms - 1; i++)
+ halo->send_perio_lst[stride*(i+1) + 4*rank_id + 2]
+ = halo->send_perio_lst[stride*i + 4*rank_id + 2]
+ + halo->send_perio_lst[stride*i + 4*rank_id + 3];
+
+ } /* Test if n_perio > 0 */
+
+ } /* End of loop on c_domain_rank */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Fill ghost cells list (member of cs_halo_t structure)
+ *
+ * parameters:
+ * mesh --> pointer to a mesh structure.
+ * face_checker --> halo type of each face of the cell.
+ * cell_id --> numbering of the treated cell.
+ * counter <-> counter on each categories.
+ *---------------------------------------------------------------------------*/
+
+static void
+_add_halo_elements(cs_mesh_t *mesh,
+ cs_halo_type_t *face_checker,
+ cs_int_t cell_id,
+ cs_int_t *counter)
+{
+ cs_int_t i, type_id, shift, c_shift;
+
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+
+ /* How is organized counter:
+
+ -------------------------------------------------
+ Paral: | | | | | | | | | | | | |
+ -------------------------------------------------
+ std ext std ext std ext std ext std ext std ext
+ _______ _______ _______ _______ _______ _______
+ rank0 rank1 rank2 rank3 rank4 rank5
+
+ -------------------------------------------------
+ P1: | | | | | | | | | | | | |
+ -------------------------------------------------
+ std ext std ext std ext std ext std ext std ext
+ _______ _______ _______ _______ _______ _______
+ rank0 rank1 rank2 rank3 rank4 rank5
+
+ -------------------------------------------------
+ P-1: | | | | | | | | | | | | |
+ -------------------------------------------------
+ std ext std ext std ext std ext std ext std ext
+ _______ _______ _______ _______ _______ _______
+ rank0 rank1 rank2 rank3 rank4 rank5
+
+ etc...
+
+ */
+
+ for (type_id = 0; type_id < n_transforms + 1; type_id++) {
+
+ for (i = 0; i < n_c_domains; i++) {
+
+ if (face_checker[type_id*n_c_domains + i] == CS_HALO_STANDARD) {
+
+ c_shift = 2*n_c_domains*type_id + 2*i;
+
+ if (type_id == 0)
+ shift = halo->send_index[2*i] + counter[c_shift];
+ else
+ shift = halo->send_perio_lst[4*n_c_domains*(type_id-1) + 4*i]
+ + counter[c_shift];
+
+ halo->send_list[shift] = cell_id;
+ counter[c_shift] += 1;
+
+ }
+ else if (face_checker[type_id*n_c_domains + i] == CS_HALO_EXTENDED) {
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ c_shift = 2*n_c_domains*type_id + 2*i + 1;
+
+ if (type_id == 0)
+ shift = halo->send_index[2*i+1] + counter[c_shift];
+ else
+ shift = halo->send_perio_lst[4*n_c_domains*(type_id-1) + 4*i + 2]
+ + counter[c_shift];
+
+ halo->send_list[shift] = cell_id;
+ counter[c_shift] += 1;
+
+ } /* End of extended halo treatment */
+
+ }
+
+ } /* End of loop on interfaces */
+
+ } /* End of loop on categories */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Test if loop has to be continued according halo type and face number.
+ *
+ * parameters:
+ *
+ *---------------------------------------------------------------------------*/
+
+static cs_bool_t
+_test_loop_continues(cs_mesh_t *mesh,
+ cs_int_t face_num)
+{
+ cs_int_t fac_id = face_num - mesh->n_b_faces - 1;
+ cs_bool_t choice = false;
+
+ /* Face has to be an internal face */
+
+ if (face_num > mesh->n_b_faces) {
+
+ if (mesh->halo_type == CS_HALO_STANDARD) {
+
+ if ( mesh->i_face_cells[2*fac_id] < 1
+ || mesh->i_face_cells[2*fac_id+1] < 1 )
+ choice = true;
+ else
+ choice = false;
+
+ }
+ else {
+
+ assert(mesh->halo_type == CS_HALO_EXTENDED);
+ choice = true;
+
+ }
+
+ }
+
+ return choice;
+}
+
+/*---------------------------------------------------------------------------
+ * Define the elements of send_halo structure.
+ *
+ * Two main loops. First one for counting number of elements and create index.
+ * Second one for filling the ghost cells list.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure
+ * cell_faces_idx --> "cell -> faces" connectivity index
+ * cell_faces_lst --> "cell -> faces" connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_send_halo(cs_mesh_t *mesh,
+ fvm_interface_set_t *interface_set,
+ cs_int_t *cell_faces_idx,
+ cs_int_t *cell_faces_lst)
+{
+ cs_int_t i, cell_id, i_fac, i_vtx;
+ cs_int_t fac_id, vtx_id, fac_num;
+ cs_int_t n_face_vertices;
+
+ cs_halo_type_t type_tag = CS_HALO_N_TYPES;
+ cs_halo_type_t face_type = CS_HALO_N_TYPES;
+ cs_halo_type_t cell_type = CS_HALO_N_TYPES;
+ cs_int_t n_categories = 0;
+ cs_halo_t *halo = mesh->halo;
+ vtx_lookup_table_t *vtx_lookup = NULL;
+ cs_halo_type_t *cell_tag = NULL;
+ cs_halo_type_t *face_checker = NULL;
+ cs_int_t *vtx_checker = NULL;
+ cs_int_t *counter = NULL;
+
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t *fac_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *fac_vtx_lst = mesh->i_face_vtx_lst;
+
+ /* We should have the faces -> vertices connectivity to continue */
+
+ if (mesh->i_face_vtx_lst == NULL && mesh->b_face_vtx_lst == NULL)
+ return;
+
+ /* Create a lookup table to accelerate search in
+ fvm_interface_set structure */
+
+ vtx_lookup = _vtx_lookup_create(n_vertices, interface_set);
+
+ n_categories = vtx_lookup->n_categories;
+
+ /* How is organized vtx_checker and face_checker:
+
+ -------------------------
+ Paral: | | | | |
+ -------------------------
+ rank0 rank1 rank2 rank3
+
+ -------------------------
+ P1: | | | | |
+ -------------------------
+ rank0 rank1 rank2 rank3
+
+ -------------------------
+ P-1: | | | | |
+ -------------------------
+ rank0 rank1 rank2 rank3
+
+ */
+
+ if (cell_faces_idx != NULL && cell_faces_lst != NULL) {
+
+ BFT_MALLOC(vtx_checker, n_categories, cs_int_t);
+ BFT_MALLOC(face_checker, n_categories, cs_halo_type_t);
+ BFT_MALLOC(cell_tag, n_cells, cs_halo_type_t);
+
+ /* First loop to create index and allocate cell_list */
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ /* Default initialization */
+
+ cell_type = CS_HALO_N_TYPES;
+
+ for (i = 0; i < n_categories; i++)
+ face_checker[i] = CS_HALO_N_TYPES;
+
+ /* Loop on faces of the cell */
+
+ for (i_fac = cell_faces_idx[cell_id];
+ i_fac < cell_faces_idx[cell_id + 1]; i_fac++) {
+
+ fac_num = CS_ABS(cell_faces_lst[i_fac - 1]);
+
+ if (_test_loop_continues(mesh, fac_num) == true) {
+
+ fac_id = fac_num - mesh->n_b_faces - 1;
+ n_face_vertices = fac_vtx_idx[fac_id + 1] - fac_vtx_idx[fac_id];
+
+ /* Initialize checker */
+
+ for (i = 0; i < n_categories; i++)
+ vtx_checker[i] = 0;
+
+ /* Loop on vertices of the face */
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id + 1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx - 1] - 1;
+
+ _update_vtx_checker(vtx_id, vtx_checker, vtx_lookup);
+
+ } /* End of loop on vertices */
+
+ face_type = _update_face_checker(n_face_vertices,
+ n_categories,
+ vtx_checker,
+ face_checker);
+
+ cell_type = CS_MIN(face_type, cell_type);
+
+ } /* If the face is an internal face */
+
+ } /* End of loop on faces */
+
+ _count_halo_elements(mesh, face_checker);
+
+ cell_tag[cell_id] = cell_type;
+
+ } /* End of loop on cells */
+
+ /* Build halo index */
+
+ _build_halo_index(mesh);
+
+ /* Initialize counter */
+
+ BFT_MALLOC(counter, 2*n_categories, cs_int_t);
+
+ for (i = 0; i < 2*n_categories; i++)
+ counter[i] = 0;
+
+ /* Second loop to build halo->ghost_cells */
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ if (mesh->halo_type == CS_HALO_STANDARD)
+ type_tag = CS_HALO_EXTENDED;
+ else if (mesh->halo_type == CS_HALO_EXTENDED)
+ type_tag = CS_HALO_N_TYPES;
+
+ if (cell_tag[cell_id] < type_tag) {
+
+ for (i = 0; i < n_categories; i++)
+ face_checker[i] = CS_HALO_N_TYPES;
+
+ /* Loop on faces of the cell */
+
+ for (i_fac = cell_faces_idx[cell_id];
+ i_fac < cell_faces_idx[cell_id+1]; i_fac++) {
+
+ /* Initialize checker */
+
+ for (i = 0; i < n_categories; i++)
+ vtx_checker[i] = 0;
+
+ fac_num = CS_ABS(cell_faces_lst[i_fac - 1]);
+
+ if (_test_loop_continues(mesh, fac_num) == true) {
+
+ fac_id = fac_num - mesh->n_b_faces - 1;
+
+ /* Loop on vertices of the face */
+
+ n_face_vertices = fac_vtx_idx[fac_id + 1] - fac_vtx_idx[fac_id];
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id + 1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx - 1] - 1;
+
+ _update_vtx_checker(vtx_id,
+ vtx_checker,
+ vtx_lookup);
+
+ } /* End of loop on vertices */
+
+ face_type = _update_face_checker(n_face_vertices,
+ n_categories,
+ vtx_checker,
+ face_checker);
+
+ } /* If face is an internal face */
+
+ } /* End of loop on faces */
+
+ _add_halo_elements(mesh,
+ face_checker,
+ cell_id,
+ counter);
+
+ } /* End of test on cell_list */
+
+ } /* End of loop on cells */
+
+ /* Free memory */
+
+ BFT_FREE(vtx_checker);
+ BFT_FREE(face_checker);
+ BFT_FREE(counter);
+ BFT_FREE(cell_tag);
+
+ } /* End if cell_face_idx and cell_faces_lst != NULL */
+
+ /* Destroy the lookup table strcuture */
+
+ _vtx_lookup_destroy(vtx_lookup);
+
+ /* Complete halo definition */
+
+ halo->n_send_elts[CS_HALO_STANDARD] = 0;
+ halo->n_send_elts[CS_HALO_EXTENDED] = 0;
+
+ for (i = 0; i < halo->n_c_domains; i++) {
+
+ halo->n_send_elts[CS_HALO_STANDARD] += halo->send_index[2*i+1]
+ - halo->send_index[2*i];
+ halo->n_send_elts[CS_HALO_EXTENDED] += halo->send_index[2*i+2]
+ - halo->send_index[2*i+1];
+
+ }
+
+ halo->n_send_elts[CS_HALO_EXTENDED] += halo->n_send_elts[CS_HALO_STANDARD];
+}
+
+/*---------------------------------------------------------------------------
+ * Define a buffer on vertices where vertex belonging to the interface_set
+ * are tagged with 1 else 0.
+ *
+ * parameters:
+ * n_vertices --> size of the buffer
+ * interface_set --> pointer to a fvm_interface_set_t structure
+ * p_vertex_tag <-> pointer to the tagged buffer
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_vertex_tag(cs_int_t n_vertices,
+ const fvm_interface_set_t *interface_set,
+ cs_int_t *p_vertex_tag[])
+{
+ cs_int_t i, j, rank_id;
+
+ cs_int_t *vertex_tag = NULL;
+
+ const int ifs_size = fvm_interface_set_size(interface_set);
+
+ BFT_MALLOC(vertex_tag, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++)
+ vertex_tag[i] = 0;
+
+ for (rank_id = 0; rank_id < ifs_size; rank_id++) {
+
+ const fvm_interface_t *interface = fvm_interface_set_get(interface_set, rank_id);
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num(interface);
+ const fvm_lnum_t if_size = fvm_interface_size(interface);
+
+ for (j = 0; j < if_size; j++)
+ vertex_tag[local_num[j]-1] = 1;
+
+ } /* End of loop on ranks */
+
+ *p_vertex_tag = vertex_tag;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Compute the number of purely parallel ghost cells for a specific rank.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * rank --> rank on which we want to know the number of purely
+ * parallel elements.
+ * type --> standard or extended
+ * index --> index on halo's elements
+ * perio_lst --> periodic details on halo
+ *
+ * returns:
+ * Number of purely parallel elements in the halo.
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t
+_get_n_par_ghost_cells(cs_mesh_t *mesh,
+ cs_int_t rank,
+ cs_halo_type_t type,
+ cs_int_t *index,
+ cs_int_t *perio_lst)
+{
+ cs_int_t i;
+ cs_int_t n_per_gcells = 0, n_par_gcells = 0;
+
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t n_c_domains = mesh->halo->n_c_domains;
+
+ if (type == CS_HALO_STANDARD) {
+
+ for (i = 0; i < n_transforms; i++)
+ n_per_gcells += perio_lst[4*rank+1 + 4*n_c_domains*i];
+
+ n_par_gcells = index[2*rank+1] - index[2*rank];
+ n_par_gcells -= n_per_gcells;
+
+ }
+ else if (type == CS_HALO_EXTENDED) {
+
+ for (i = 0; i < n_transforms; i++)
+ n_per_gcells += perio_lst[4*rank+3 + 4*n_c_domains*i];
+
+ n_par_gcells = index[2*rank+2] - index[2*rank+1];
+ n_par_gcells -= n_per_gcells;
+
+ }
+
+ return n_par_gcells;
+}
+
+/*---------------------------------------------------------------------------
+ * Exchange number and list of cells constituting send_halo structure for each
+ * frontier ranks. Fill the halo structure from these data.
+ *
+ * parameters:
+ * mesh --> pointer to a cs_mesh_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_halo(cs_mesh_t *mesh)
+{
+ cs_int_t rank_id, i, j;
+ cs_int_t shift;
+
+#if defined(HAVE_MPI)
+ MPI_Request _request[128];
+ MPI_Request *request = _request;
+ MPI_Status _status[128];
+ MPI_Status *status = _status;
+#endif
+
+ int request_count = 0;
+
+ cs_int_t *count = NULL;
+
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+
+#if defined(HAVE_MPI)
+ if (halo->n_c_domains*2 > 128) {
+ BFT_MALLOC(request, halo->n_c_domains*2, MPI_Request);
+ BFT_MALLOC(status, halo->n_c_domains*2, MPI_Status);
+ }
+#endif
+
+ /* Build index */
+ /* ----------- */
+ /* Receive data from distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Irecv(&(halo->index[2*rank_id+1]), 2, CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+#endif
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* We wait for receiving all messages */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ BFT_MALLOC(count, 2*n_c_domains, cs_int_t);
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ shift = 2*rank_id;
+ count[shift] = halo->send_index[2*rank_id+1]
+ - halo->send_index[2*rank_id];
+ count[shift+1] = halo->send_index[2*rank_id+2]
+ - halo->send_index[2*rank_id+1];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Isend(&(count[shift]), 2, CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ local_rank,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+#endif
+
+ }
+ else {
+
+ halo->index[shift+1] = count[shift];
+ halo->index[shift+2] = count[shift+1];
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Wait for all exchanges being done */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Waitall(request_count, request, status);
+#endif
+ request_count = 0;
+
+ BFT_FREE(count);
+
+ /* Build index */
+ /*-------------*/
+
+ for (i = 0; i < 2*n_c_domains; i++)
+ halo->index[i+1] += halo->index[i];
+
+ /* Exchange number of elements for each periodicity and for each rank.
+ Then build halo->perio_lst */
+
+ if (mesh->n_init_perio > 0) {
+
+ cs_int_t n_elts;
+ cs_int_t *exchange_buffer = NULL;
+
+ /* n_transforms periodicities to deal with and for each sub-periodicity
+ 2 data. One for standard halo and the other one for extended halo */
+
+ const cs_int_t n_elts_to_exchange = 2 * n_transforms;
+
+ BFT_MALLOC(exchange_buffer, 4*n_transforms, cs_int_t);
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ /* Fill buffer to send */
+
+ for (i = 0; i < n_transforms; i++) {
+ shift = 4*n_c_domains*i + 4*rank_id;
+ for (j = 0; j < 2; j++)
+ exchange_buffer[2*i+j] = halo->send_perio_lst[shift + 2*j + 1];
+ }
+
+#if defined(HAVE_MPI)
+ MPI_Sendrecv(&(exchange_buffer[0]), n_elts_to_exchange, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ &(exchange_buffer[n_elts_to_exchange]), n_elts_to_exchange,
+ CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, status);
+#endif
+
+ /* Put received elements in the periodic structure */
+
+ for (i = 0; i < n_transforms; i++) {
+ shift = 4*n_c_domains*i + 4*rank_id;
+ for (j = 0; j < 2; j++)
+ halo->perio_lst[shift + 2*j + 1] =
+ exchange_buffer[n_elts_to_exchange + 2*i + j];
+ }
+
+ } /* rank != local_rank */
+
+ else {
+
+ for (i = 0; i < n_transforms; i++) {
+
+ shift = 4*n_c_domains*i + 4*rank_id;
+ for (j = 0; j < 2; j++)
+ halo->perio_lst[shift + 2*j + 1] =
+ halo->send_perio_lst[shift + 2*j + 1];
+
+ } /* End of loop on periodicities */
+
+ } /* local_rank == rank */
+
+ } /* End of loop on communicating ranks */
+
+ BFT_FREE(exchange_buffer);
+
+ /* Build index values for perio_lst */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ /* Build index for standard ghost cells */
+
+ n_elts = _get_n_par_ghost_cells(mesh,
+ rank_id,
+ CS_HALO_STANDARD,
+ halo->index,
+ halo->perio_lst);
+
+ halo->perio_lst[4*rank_id] = halo->index[2*rank_id] + n_elts;
+
+ for (i = 0; i < n_transforms - 1; i++) {
+ shift = 4*n_c_domains*i + 4*rank_id;
+ halo->perio_lst[4*n_c_domains + shift] =
+ halo->perio_lst[shift] + halo->perio_lst[shift + 1];
+ }
+
+ /* Build index for extended ghost cells */
+
+ n_elts = _get_n_par_ghost_cells(mesh,
+ rank_id,
+ CS_HALO_EXTENDED,
+ halo->index,
+ halo->perio_lst);
+
+ halo->perio_lst[4*rank_id+2] = halo->index[2*rank_id+1] + n_elts;
+
+ for (i = 0; i < n_transforms - 1; i++) {
+ shift = 4*n_c_domains*i + 4*rank_id + 2;
+ halo->perio_lst[4*n_c_domains + shift] =
+ halo->perio_lst[shift] + halo->perio_lst[shift + 1];
+ }
+
+ } /* End of loop on communicating ranks */
+
+ } /* End if n_perio > 0 */
+
+#if defined(HAVE_MPI)
+ if (request != _request) {
+ BFT_FREE(request);
+ BFT_FREE(status);
+ }
+#endif
+
+ halo->n_elts[CS_HALO_STANDARD] = 0;
+ halo->n_elts[CS_HALO_EXTENDED] = 0;
+
+ for (i = 0; i < n_c_domains; i++) {
+
+ halo->n_elts[CS_HALO_STANDARD] += halo->index[2*i+1] - halo->index[2*i];
+ halo->n_elts[CS_HALO_EXTENDED] += halo->index[2*i+2] - halo->index[2*i+1];
+
+ }
+
+ halo->n_elts[CS_HALO_EXTENDED] += halo->n_elts[CS_HALO_STANDARD];
+}
+
+/*---------------------------------------------------------------------------
+ * Compute maximum list buffer size.
+ *
+ * This is done to avoid a reallocation for each rank and transformation.
+ *
+ * parameters:
+ * ifs --> pointer to a fvm_interface_set_t structure
+ *
+ * returns:
+ * max buffer size
+ *---------------------------------------------------------------------------*/
+
+static cs_int_t
+_get_list_buffer_size(fvm_interface_set_t *ifs)
+{
+ cs_int_t i, j, tr_index_size;
+
+ cs_int_t max_lst_size = 0;
+
+ const fvm_interface_t *interface = NULL;
+ const fvm_lnum_t *tr_index = NULL;
+ const cs_int_t ifs_size = fvm_interface_set_size(ifs);
+
+ if (ifs == NULL)
+ return max_lst_size;
+
+ for (i = 0; i < ifs_size; i++) {
+
+ interface = fvm_interface_set_get(ifs, i);
+ tr_index = fvm_interface_get_tr_index(interface);
+ tr_index_size = fvm_interface_get_tr_index_size(interface) - 1;
+
+ if (tr_index != NULL)
+ for (j = 0; j < tr_index_size; j++)
+ max_lst_size = CS_MAX(max_lst_size, tr_index[j+1] - tr_index[j]);
+ else
+ max_lst_size = CS_MAX(max_lst_size,
+ (cs_int_t)fvm_interface_size(interface));
+
+ } /* End of loop on interfaces */
+
+ return max_lst_size;
+}
+
+/*---------------------------------------------------------------------------
+ * Define an index on vertices belonging to this interface for this rank
+ * and this transformation.
+ *
+ * parameters:
+ * ifs --> pointer to fvm_interface_set_t structure
+ * rank_id --> rank number to work with
+ * tr_id --> transformation id to work with
+ * vtx_interface_idx <-> index on vertices which match the criterions
+ *---------------------------------------------------------------------------*/
+
+static void
+_define_vtx_interface_idx(fvm_interface_set_t *ifs,
+ cs_int_t rank_id,
+ cs_int_t tr_id,
+ cs_int_t n_vertices,
+ cs_int_t *vtx_interface_idx)
+{
+ cs_int_t i, j, id;
+
+ /* Initialize index */
+
+ for (i = 0; i < n_vertices + 1; i++)
+ vtx_interface_idx[i] = 0;
+
+ for (id = 0; id < fvm_interface_set_size(ifs); id++) {
+
+ const fvm_interface_t *interface = fvm_interface_set_get(ifs, id);
+
+ if (rank_id == fvm_interface_rank(interface)) {
+
+ const fvm_lnum_t *tr_index = fvm_interface_get_tr_index(interface);
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num(interface);
+
+ if (tr_index == NULL) { /* purelly parallel elements */
+
+ for (j = 0; j < (cs_int_t)fvm_interface_size(interface); j++)
+ vtx_interface_idx[local_num[j]] += 1;
+
+ }
+ else {
+
+ for (j = tr_index[tr_id]; j < tr_index[tr_id+1]; j++)
+ vtx_interface_idx[local_num[j]] += 1;
+
+ }
+
+ /* Create index */
+
+ for (j = 0; j < n_vertices; j++)
+ vtx_interface_idx[j+1] += vtx_interface_idx[j];
+
+ break;
+
+ }
+
+ } /* End of loop on interfaces */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Define an index on vertices belonging the interface for this rank
+ * and this perio.
+ * Fill the dist_num_lst which is the list of distant numbering associated
+ * to local vertices (same rank and same transformation).
+ *
+ * parameters:
+ * ifs --> pointer to fvm_interface_set_t structure
+ * rank_id --> rank number to work with
+ * tr_id --> transformation id to work with
+ * n_vertices --> number of vertices
+ * dist_num_lst <-> list of distant vertex numbers matching criteria
+ * vtx_interface_idx <-> index on vertices matching criteria
+ *---------------------------------------------------------------------------*/
+
+static void
+_define_dist_num_lst(fvm_interface_set_t *ifs,
+ cs_int_t rank_id,
+ cs_int_t tr_id,
+ cs_int_t n_vertices,
+ cs_int_t *dist_num_lst,
+ cs_int_t *vtx_interface_idx)
+{
+ cs_int_t i, j, id, shift;
+
+ /* Initialize index */
+
+ for (i = 0; i < n_vertices + 1; i++)
+ vtx_interface_idx[i] = 0;
+
+ for (id = 0; id < fvm_interface_set_size(ifs); id++) {
+
+ const fvm_interface_t *interface = fvm_interface_set_get(ifs, id);
+
+ if (rank_id == fvm_interface_rank(interface)) {
+
+ const fvm_lnum_t *tr_index = fvm_interface_get_tr_index(interface);
+ const fvm_lnum_t *distant_num = fvm_interface_get_distant_num(interface);
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num(interface);
+
+ if (tr_index == NULL)
+ for (j = 0; j < (cs_int_t)fvm_interface_size(interface); j++)
+ vtx_interface_idx[local_num[j]] += 1;
+
+ else
+ for (j = tr_index[tr_id]; j < tr_index[tr_id+1]; j++)
+ vtx_interface_idx[local_num[j]] += 1;
+
+ /* Create index */
+
+ for (j = 0; j < n_vertices; j++)
+ vtx_interface_idx[j+1] += vtx_interface_idx[j];
+
+ /* There must be only one distant_num per local_num when
+ we treat a specific rank and a specific periodicity.
+ So, we don't need a counter to fill dist_num_lst */
+
+ if (tr_index == NULL) {
+
+ for (j = 0; j < (cs_int_t)fvm_interface_size(interface); j++) {
+ shift = vtx_interface_idx[local_num[j]-1];
+ dist_num_lst[shift] = distant_num[j];
+ }
+
+
+ }
+ else {
+
+ for (j = tr_index[tr_id]; j < tr_index[tr_id+1]; j++) {
+ shift = vtx_interface_idx[local_num[j]-1];
+ dist_num_lst[shift] = distant_num[j];
+ }
+
+ }
+
+ break;
+
+ }
+
+ } /* End of loop on interfaces */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Compute the start and end index in ghost cells list for the send_halo
+ * elements according to its rank, its periodicity and its type.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * index --> index on halo's elements
+ * perio_lst --> periodic details on halo
+ * rank_id --> rank number to work with
+ * tr_id --> transformation id to work with
+ * type_id --> standard or extended
+ * p_start_idx <-- pointer on start index
+ * p_end_idx <-- pointer on end index
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_start_end_idx(cs_mesh_t *mesh,
+ cs_int_t *index,
+ cs_int_t *perio_lst,
+ cs_int_t rank_id,
+ cs_int_t tr_id,
+ cs_int_t type_id,
+ cs_int_t *p_start_idx,
+ cs_int_t *p_end_idx)
+{
+ cs_int_t i, n_par_gcells, n_per_gcells;
+ cs_int_t start_idx, end_idx;
+
+ const cs_int_t n_c_domains = mesh->halo->n_c_domains;
+
+ if (tr_id == 0) { /* Purelly parallel elements */
+
+ if (type_id == 0) { /* STANDARD HALO */
+
+ n_par_gcells = _get_n_par_ghost_cells(mesh,
+ rank_id,
+ CS_HALO_STANDARD,
+ index,
+ perio_lst);
+
+ start_idx = index[2*rank_id];
+ end_idx = start_idx + n_par_gcells;
+
+ }
+
+ if (type_id == 1) { /* EXTENDED HALO */
+
+ n_par_gcells = _get_n_par_ghost_cells(mesh,
+ rank_id,
+ CS_HALO_EXTENDED,
+ index,
+ perio_lst);
+
+ start_idx = index[2*rank_id+1];
+ end_idx = start_idx + n_par_gcells;
+
+ }
+
+ }
+ else { /* Periodic elements */
+
+ i = tr_id - 1;
+
+ if (type_id == 0) { /* STANDARD HALO */
+
+ n_per_gcells = perio_lst[4*rank_id + 1 + 4*n_c_domains*i];
+ start_idx = perio_lst[4*rank_id + 4*n_c_domains*i];
+ end_idx = start_idx + n_per_gcells;
+
+ }
+
+ if (type_id == 1) { /* EXTENDED HALO */
+
+ n_per_gcells = perio_lst[4*rank_id + 3 + 4*n_c_domains*i];
+ start_idx = perio_lst[4*rank_id + 2 + 4*n_c_domains*i];
+ end_idx = start_idx + n_per_gcells;
+
+ }
+
+ } /* Parallel or periodic elements */
+
+ *p_start_idx = start_idx;
+ *p_end_idx = end_idx;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Compute the size of the "ghost cell to distant vertices" connectivity for
+ * send_halo elements.
+ * This will be use to define "ghost cell to distant vertices" index.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * ifs --> pointer to fvm_interface_set_t structure
+ * rank_id --> rank number to work with
+ * tr_id --> transformation id to work with
+ * cell_faces_idx --> "cell -> faces" connectivity index
+ * cell_faces_lst --> "cell -> faces" connectivity list
+ * vtx_interface_idx <-> index on vertices which match the criterions
+ * vtx_tag <-> tag array on vertices
+ * gcell_dist_vtx_idx <-> "ghost cell -> distant vertices" connectivity index
+ *---------------------------------------------------------------------------*/
+
+static void
+_count_send_gcell_to_dist_vtx_connect(cs_mesh_t *mesh,
+ fvm_interface_set_t *ifs,
+ cs_int_t rank_id,
+ cs_int_t tr_id,
+ cs_int_t *cell_faces_idx,
+ cs_int_t *cell_faces_lst,
+ cs_int_t *vtx_interface_idx,
+ cs_int_t *vtx_tag,
+ cs_int_t *gcell_dist_vtx_idx)
+{
+ cs_int_t id, cell_id, i_fac, i_vtx, i_loop;
+ cs_int_t start_idx, end_idx, vtx_id, fac_num, fac_id;
+
+ cs_int_t n_loops = 0;
+ cs_int_t n_added_vertices = 0;
+
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t *fac_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *fac_vtx_lst = mesh->i_face_vtx_lst;
+
+ const char err_corresp[]
+ = N_("Repeated inconsistency in the halo construction.\n"
+ "Several local points have the same distant correspondant;\n"
+ "this is probably due to a multiple-periodicity construction\n"
+ "side effect of the Preprocessor.\n"
+ "Coordinates of the first impacted point: [%12.5e, %12.5e %12.5e].");
+
+ _define_vtx_interface_idx(ifs,
+ halo->c_domain_rank[rank_id],
+ tr_id,
+ n_vertices,
+ vtx_interface_idx);
+
+ /* Count size of the connectivity and define index */
+
+ if (mesh->halo_type == CS_HALO_STANDARD)
+ n_loops = 1;
+ else if (mesh->halo_type == CS_HALO_EXTENDED)
+ n_loops = 2;
+
+ for (i_loop = 0; i_loop < n_loops; i_loop++) {
+
+ /* Define start and end idx */
+
+ _get_start_end_idx(mesh,
+ halo->send_index,
+ halo->send_perio_lst,
+ rank_id,
+ tr_id,
+ i_loop,
+ &start_idx,
+ &end_idx);
+
+ for (id = start_idx; id < end_idx; id++) {
+
+ cell_id = halo->send_list[id];
+
+ for (i_fac = cell_faces_idx[cell_id];
+ i_fac < cell_faces_idx[cell_id+1]; i_fac++) {
+
+ fac_num = CS_ABS(cell_faces_lst[i_fac-1]);
+
+ if (_test_loop_continues(mesh, fac_num) == true) {
+
+ fac_id = fac_num - mesh->n_b_faces - 1;
+
+ /* Loop on vertices of the face */
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id+1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx-1] - 1;
+
+ /* If vertex is on the interface for this rank and this
+ transformation */
+
+ n_added_vertices = vtx_interface_idx[vtx_id+1]
+ - vtx_interface_idx[vtx_id];
+
+ if (n_added_vertices > 0) {
+
+ if (n_added_vertices > 1)
+ bft_error(__FILE__, __LINE__, 0, _(err_corresp),
+ mesh->vtx_coord[vtx_id*3],
+ mesh->vtx_coord[vtx_id*3+1],
+ mesh->vtx_coord[vtx_id*3+2]);
+
+ /* Add this vertex if not already checked */
+
+ if (vtx_tag[vtx_id] != id) {
+ vtx_tag[vtx_id] = id;
+ gcell_dist_vtx_idx[id+1] += n_added_vertices;
+ }
+
+ }
+
+ } /* End of loop on vertices */
+
+ } /* Treatment only for implied faces */
+
+ } /* End of loop on faces */
+
+ } /* End of loop on ghost cells */
+
+ } /* Loop on STANDARD and EXTENDED halo */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Fill the "ghost cells to distant vertices" connectivity.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * ifs --> pointer to fvm_interface_set_t structure
+ * rank_id --> rank number to work with
+ * tr_id --> transformation id to work with
+ * cell_faces_idx --> "cell -> faces" connectivity index
+ * cell_faces_lst --> "cell -> faces" connectivity list
+ * vtx_interface_idx <-> index on vertices matching criteria
+ * dist_num_lst <-> list of distant vertex numbers matching criteria
+ * counter <-> counter on vertices
+ * vtx_tag <-> tag array on vertices
+ * gcell_dist_vtx_idx <-> "ghost cell -> distant vertices" connectivity index
+ * gcell_dist_vtx_lst <-> "ghost cell -> distant vertices" connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_send_gcell_to_dist_vtx_connect(cs_mesh_t *mesh,
+ fvm_interface_set_t *ifs,
+ cs_int_t rank_id,
+ cs_int_t tr_id,
+ cs_int_t *cell_faces_idx,
+ cs_int_t *cell_faces_lst,
+ cs_int_t *vtx_interface_idx,
+ cs_int_t *dist_num_lst,
+ cs_int_t *counter,
+ cs_int_t *vtx_tag,
+ cs_int_t *gcell_dist_vtx_idx,
+ cs_int_t *gcell_dist_vtx_lst)
+{
+ cs_int_t i, id, cell_id, i_fac, i_vtx, i_loop;
+ cs_int_t shift, vtx_id, fac_num, fac_id, start_idx, end_idx;
+
+ cs_int_t n_loops = 0;
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t *fac_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *fac_vtx_lst = mesh->i_face_vtx_lst;
+
+ _define_dist_num_lst(ifs,
+ halo->c_domain_rank[rank_id],
+ tr_id,
+ n_vertices,
+ dist_num_lst,
+ vtx_interface_idx);
+
+ /* Fill the "ghost cells to distant vertices" connectivity */
+
+ if (mesh->halo_type == CS_HALO_STANDARD)
+ n_loops = 1;
+ else if (mesh->halo_type == CS_HALO_EXTENDED)
+ n_loops = 2;
+
+ for (i_loop = 0; i_loop < n_loops; i_loop++) {
+
+ /* Define start and end idx */
+
+ _get_start_end_idx(mesh,
+ halo->send_index,
+ halo->send_perio_lst,
+ rank_id,
+ tr_id,
+ i_loop,
+ &start_idx,
+ &end_idx);
+
+ for (id = start_idx; id < end_idx; id++) {
+
+ cell_id = halo->send_list[id];
+
+ for (i_fac = cell_faces_idx[cell_id];
+ i_fac < cell_faces_idx[cell_id+1]; i_fac++) {
+
+ fac_num = CS_ABS(cell_faces_lst[i_fac-1]);
+
+ if (_test_loop_continues(mesh, fac_num) == true) {
+
+ fac_id = fac_num - mesh->n_b_faces - 1;
+
+ /* Loop on vertices of the face */
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id+1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx-1] - 1;
+
+ /* If vertex is on the interface for this rank and periodicity */
+
+ if (vtx_interface_idx[vtx_id+1] - vtx_interface_idx[vtx_id] > 0) {
+
+ /* Add this vertex if nont already checked */
+
+ if (vtx_tag[vtx_id] != id) { /* Add this vertex */
+
+ vtx_tag[vtx_id] = id;
+
+ for (i = vtx_interface_idx[vtx_id];
+ i < vtx_interface_idx[vtx_id+1]; i++) {
+
+ shift = gcell_dist_vtx_idx[id] + counter[id];
+ gcell_dist_vtx_lst[shift] = dist_num_lst[i];
+ counter[id] += 1;
+
+ }
+
+ }
+
+ } /* If there is something to fill */
+
+ } /* End of loop on vertices */
+
+ } /* Treatment only for implied faces */
+
+ } /* End of loop on faces */
+
+ } /* End of loop on ghost cells */
+
+ } /* Loop on STANDARD or EXTENDED halo */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Create a local "ghost cells -> distant vertices" connectivity for
+ * send_halo cells.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure
+ * cell_faces_idx --> "cell -> faces" connectivity index
+ * cell_faces_lst --> "cell -> faces" connectivity list
+ * p_gcell_dist_vtx_idx <-- "ghost cell -> distant vertices" connect. index
+ * p_gcell_dist_vtx_lst <-- "ghost cell -> distant vertices" connect. list
+ *---------------------------------------------------------------------------*/
+
+static void
+_create_send_gcell_vtx_connect(cs_mesh_t *mesh,
+ fvm_interface_set_t *interface_set,
+ cs_int_t *cell_faces_idx,
+ cs_int_t *cell_faces_lst,
+ cs_int_t *p_gcell_dist_vtx_idx[],
+ cs_int_t *p_gcell_dist_vtx_lst[])
+{
+ cs_int_t i, id, rank_id;
+
+ cs_int_t *gcell_dist_vtx_idx = NULL, *gcell_dist_vtx_lst = NULL;
+ cs_int_t *vtx_interface_idx = NULL;
+ cs_int_t *dist_num_lst = NULL;
+ cs_int_t *vtx_tag = NULL;
+ cs_int_t *counter = NULL;
+
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t max_lst_size = _get_list_buffer_size(interface_set);
+ const cs_int_t n_ghost_cells = halo->n_send_elts[CS_HALO_EXTENDED];
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t tr_index_size = mesh->n_transforms + 1;
+
+ if (n_ghost_cells == 0)
+ return;
+
+ /* Allocate and initialize buffers */
+
+ BFT_MALLOC(gcell_dist_vtx_idx, n_ghost_cells + 1, cs_int_t);
+ BFT_MALLOC(counter, n_ghost_cells, cs_int_t);
+
+ gcell_dist_vtx_idx[0] = 0;
+ for (i = 0; i < n_ghost_cells; i++) {
+ gcell_dist_vtx_idx[i+1] = 0;
+ counter[i] = 0;
+ }
+
+ BFT_MALLOC(vtx_tag, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_tag[i] = -1;
+
+ BFT_MALLOC(vtx_interface_idx, n_vertices + 1, cs_int_t);
+ BFT_MALLOC(dist_num_lst, max_lst_size, cs_int_t);
+
+ for (i = 0; i < max_lst_size; i++)
+ dist_num_lst[i] = -1;
+
+ /* Loop on each rank belonging to send_halo.
+ Create a vertex to ghost cells connectivity for each rank */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ /* Define gcell_dist_vtx_idx */
+
+ for (id = 0; id < tr_index_size; id++)
+ _count_send_gcell_to_dist_vtx_connect(mesh,
+ interface_set,
+ rank_id,
+ id,
+ cell_faces_idx,
+ cell_faces_lst,
+ vtx_interface_idx,
+ vtx_tag,
+ gcell_dist_vtx_idx);
+
+ } /* End of loop on ranks */
+
+ /* Create gcell_dist_vtx_idx */
+
+ for (i = 0; i < n_ghost_cells; i++)
+ gcell_dist_vtx_idx[i+1] += gcell_dist_vtx_idx[i];
+
+ BFT_MALLOC(gcell_dist_vtx_lst, gcell_dist_vtx_idx[n_ghost_cells], cs_int_t);
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_tag[i] = -1;
+
+ /* Fill gcell_dist_vtx_lst */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ for (id = 0; id < tr_index_size; id++)
+ _fill_send_gcell_to_dist_vtx_connect(mesh,
+ interface_set,
+ rank_id,
+ id,
+ cell_faces_idx,
+ cell_faces_lst,
+ vtx_interface_idx,
+ dist_num_lst,
+ counter,
+ vtx_tag,
+ gcell_dist_vtx_idx,
+ gcell_dist_vtx_lst);
+
+ } /* End of loop on ranks */
+
+ BFT_FREE(counter);
+ BFT_FREE(vtx_tag);
+ BFT_FREE(vtx_interface_idx);
+ BFT_FREE(dist_num_lst);
+
+ *p_gcell_dist_vtx_idx = gcell_dist_vtx_idx;
+ *p_gcell_dist_vtx_lst = gcell_dist_vtx_lst;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Send "ghost cells to distant_num vertices" connectivity on communicating
+ * ranks and receive the same kind of connectivity from distant ranks.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * send_gcell_dist_vtx_idx <-- "ghost cell -> distant vertices" index
+ * send_gcell_dist_vtx_lst <-- "ghost cell -> distant vertices" list
+ * p_gcell_dist_vtx_idx --> "ghost cell -> distant vertices" index
+ * p_gcell_dist_vtx_lst --> "ghost cell -> distant vertices" list
+ *---------------------------------------------------------------------------*/
+
+static void
+_exchange_gcell_vtx_connect(cs_mesh_t *mesh,
+ cs_int_t *send_gcell_dist_vtx_idx,
+ cs_int_t *send_gcell_dist_vtx_lst,
+ cs_int_t *p_gcell_dist_vtx_idx[],
+ cs_int_t *p_gcell_dist_vtx_lst[])
+{
+ cs_int_t i, j, rank_id;
+ cs_int_t send_start_idx, send_end_idx, start_idx, end_idx;
+ cs_int_t n_send_elts, n_recv_elts;
+
+ cs_int_t send_buffer_size = 0;
+
+ cs_int_t *send_idx_buffer = NULL;
+ cs_int_t *gcell_dist_vtx_idx = NULL, *gcell_dist_vtx_lst = NULL;
+ cs_int_t *send_buffer = NULL, *recv_buffer = NULL;
+
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t n_ghost_cells = halo->n_elts[CS_HALO_EXTENDED];
+
+#if defined(HAVE_MPI)
+ MPI_Status status;
+#endif
+
+ /* Allocate buffers */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+ n_send_elts = halo->send_index[2*rank_id+2]- halo->send_index[2*rank_id];
+ send_buffer_size = CS_MAX(send_buffer_size, n_send_elts);
+ }
+ }
+
+ BFT_MALLOC(send_idx_buffer, send_buffer_size, cs_int_t);
+ BFT_MALLOC(gcell_dist_vtx_idx, n_ghost_cells + 1, cs_int_t);
+
+ for (i = 0; i < n_ghost_cells + 1; i++)
+ gcell_dist_vtx_idx[i] = 0;
+
+ /* Exchange sizes to define gcell_dist_vtx_idx */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ recv_buffer = &(gcell_dist_vtx_idx[1 + halo->index[2*rank_id]]);
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ /* Fill send buffer */
+
+ for (i = halo->send_index[2*rank_id], j = 0;
+ i < halo->send_index[2*rank_id+2]; i++, j++)
+ send_idx_buffer[j] = send_gcell_dist_vtx_idx[i+1] - send_gcell_dist_vtx_idx[i];
+
+ n_send_elts = halo->send_index[2*rank_id+2] - halo->send_index[2*rank_id];
+ n_recv_elts = halo->index[2*rank_id+2] - halo->index[2*rank_id];
+
+#if defined(HAVE_MPI)
+ MPI_Sendrecv(&(send_idx_buffer[0]), n_send_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ &(recv_buffer[0]), n_recv_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, &status);
+#endif
+
+ } /* If rank != local_rank */
+
+ else {
+
+ for (i = halo->send_index[2*rank_id], j = 0;
+ i < halo->send_index[2*rank_id+2]; i++, j++)
+ recv_buffer[j] = send_gcell_dist_vtx_idx[i+1] - send_gcell_dist_vtx_idx[i];
+
+ } /* rank == local_rank */
+
+ } /* End of loop on if_ranks */
+
+ BFT_FREE(send_idx_buffer);
+
+ /* Define index */
+
+ for (i = 0; i < n_ghost_cells; i++)
+ gcell_dist_vtx_idx[i+1] += gcell_dist_vtx_idx[i];
+
+ BFT_MALLOC(gcell_dist_vtx_lst, gcell_dist_vtx_idx[n_ghost_cells], cs_int_t);
+
+ /* Exchange lists to define gcell_dist_vtx_lst */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ /* Exchange conectivity list */
+
+ send_start_idx = send_gcell_dist_vtx_idx[halo->send_index[2*rank_id]];
+ send_end_idx = send_gcell_dist_vtx_idx[halo->send_index[2*rank_id+2]];
+ n_send_elts = send_end_idx - send_start_idx;
+ send_buffer = &(send_gcell_dist_vtx_lst[send_start_idx]);
+
+ start_idx = gcell_dist_vtx_idx[halo->index[2*rank_id]];
+ end_idx = gcell_dist_vtx_idx[halo->index[2*rank_id+2]];
+ n_recv_elts = end_idx - start_idx;
+ recv_buffer = &(gcell_dist_vtx_lst[start_idx]);
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Sendrecv(send_buffer, n_send_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ recv_buffer, n_recv_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, &status);
+#endif
+
+ }
+ else {
+
+ assert(n_recv_elts == n_send_elts);
+
+ for (i = 0; i < n_send_elts; i++)
+ recv_buffer[i] = send_buffer[i];
+
+ }
+
+ } /* End of loop on ranks */
+
+ *p_gcell_dist_vtx_idx = gcell_dist_vtx_idx;
+ *p_gcell_dist_vtx_lst = gcell_dist_vtx_lst;
+
+}
+
+/*---------------------------------------------------------------------------
+ * Reverse "ghost cell -> vertex" connectivity into "vertex -> ghost cells"
+ * connectivity for halo elements.
+ *
+ * Build the connectivity index.
+ *
+ * parameters:
+ * halo --> pointer to a cs_halo_t structure
+ * n_vertices --> number of vertices
+ * rank_id --> rank number to work with
+ * checker <-> temporary array to check vertices
+ * gcell_vtx_idx --> "ghost cell -> vertices" connectivity index
+ * gcell_vtx_lst --> "ghost cell -> vertices" connectivity list
+ * vtx_gcells_idx <-> "vertex -> ghost cells" connectivity index
+ *---------------------------------------------------------------------------*/
+
+static void
+_reverse_connectivity_idx(cs_halo_t *halo,
+ cs_int_t n_vertices,
+ cs_int_t rank_id,
+ cs_int_t *checker,
+ cs_int_t *gcell_vtx_idx,
+ cs_int_t *gcell_vtx_lst,
+ cs_int_t *vtx_gcells_idx)
+{
+ cs_int_t i, j, id, vtx_id, start_idx, end_idx;
+
+ /* Initialize index */
+
+ vtx_gcells_idx[0] = 0;
+ for (i = 0; i < n_vertices; i++) {
+ vtx_gcells_idx[i+1] = 0;
+ checker[i] = -1;
+ }
+
+ if (rank_id == -1) {
+ start_idx = 0;
+ end_idx = halo->n_elts[CS_HALO_EXTENDED];
+ }
+ else { /* Call with rank_id > 1 for standard halo */
+ start_idx = halo->index[2*rank_id];
+ end_idx = halo->index[2*rank_id+1];
+ }
+
+ /* Define index */
+
+ for (id = start_idx; id < end_idx; id++) {
+
+ for (j = gcell_vtx_idx[id]; j < gcell_vtx_idx[id+1]; j++) {
+
+ vtx_id = gcell_vtx_lst[j] - 1;
+
+ if (checker[vtx_id] != id) {
+ checker[vtx_id] = id;
+ vtx_gcells_idx[vtx_id+1] += 1;
+ }
+
+ }
+
+ } /* End of loop of ghost cells */
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_gcells_idx[i+1] += vtx_gcells_idx[i];
+
+}
+
+/*---------------------------------------------------------------------------
+ * Reverse "ghost cells -> vertex" connectivity into "vertex -> ghost cells"
+ * connectivity for halo elements.
+ *
+ * Build the connectivity list.
+ *
+ * parameters:
+ * halo --> pointer to a cs_halo_t structure
+ * n_vertices --> number of vertices
+ * rank_id --> rank number to work with
+ * counter <-> temporary array to count vertices
+ * checker <-> temporary array to check vertices
+ * gcell_vtx_idx --> "ghost cell -> vertices" connectivity index
+ * gcell_vtx_lst --> "ghost cell -> vertices" connectivity list
+ * vtx_gcells_idx --> "vertex -> ghost cells" connectivity index
+ * vtx_gcells_lst <-> "vertex -> ghost cells" connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_reverse_connectivity_lst(cs_halo_t *halo,
+ cs_int_t n_vertices,
+ cs_int_t rank_id,
+ cs_int_t *counter,
+ cs_int_t *checker,
+ cs_int_t *gcell_vtx_idx,
+ cs_int_t *gcell_vtx_lst,
+ cs_int_t *vtx_gcells_idx,
+ cs_int_t *vtx_gcells_lst)
+{
+ cs_int_t i, j, id, shift, vtx_id, start_idx, end_idx;
+
+ /* Initialize buffers */
+
+ for (i = 0; i < n_vertices; i++) {
+ counter[i] = 0;
+ checker[i] = -1;
+ }
+
+ if (rank_id == -1) {
+ start_idx = 0;
+ end_idx = halo->n_elts[CS_HALO_EXTENDED];
+ }
+ else {
+ start_idx = halo->index[2*rank_id];
+ end_idx = halo->index[2*rank_id+1];
+ }
+
+ /* Fill the connectivity list */
+
+ for (id = start_idx; id < end_idx; id++) {
+
+ for (j = gcell_vtx_idx[id]; j < gcell_vtx_idx[id+1]; j++) {
+
+ vtx_id = gcell_vtx_lst[j] - 1;
+
+ if (checker[vtx_id] != id) {
+
+ checker[vtx_id] = id;
+ shift = vtx_gcells_idx[vtx_id] + counter[vtx_id];
+ vtx_gcells_lst[shift] = id;
+ counter[vtx_id] += 1;
+
+ }
+
+ }
+
+ } /* End of loop of ghost cells */
+
+}
+
+/*---------------------------------------------------------------------------
+ * Define a lookup table structure on periodic faces.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * mesh_builder --> pointer to cs_mesh_builder_t structure
+ *
+ * returns:
+ * a pointer to a lookup_table_t structure.
+ *---------------------------------------------------------------------------*/
+
+static lookup_table_t *
+_define_periodic_lookup_table(cs_mesh_t *mesh,
+ cs_mesh_builder_t *mesh_builder)
+{
+ cs_int_t i, fst_face, snd_face, shift;
+
+ lookup_table_t *periodic_table = NULL;
+ cs_int_t *face_list = NULL, *rank_list = NULL;
+
+ const cs_int_t n_init_perio = mesh->n_init_perio;
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t *per_face_idx = mesh_builder->per_face_idx;
+ const cs_int_t *per_face_lst = mesh_builder->per_face_lst;
+ const cs_int_t *per_rank_lst = mesh_builder->per_rank_lst;
+
+ assert(mesh->n_init_perio > 0);
+ assert(per_face_idx != NULL);
+
+ /* Create a lookup table structure */
+
+ BFT_MALLOC(periodic_table, 1, lookup_table_t);
+
+ /* Define the lookup table structure */
+
+ periodic_table->n_elts = n_i_faces;
+
+ BFT_MALLOC(periodic_table->index, n_i_faces + 1, cs_int_t);
+
+ for (i = 0; i < n_i_faces + 1; i++)
+ periodic_table->index[i] = 0;
+
+ for (i = per_face_idx[0]; i < per_face_idx[n_init_perio]; i++)
+ periodic_table->index[CS_ABS(per_face_lst[2*i])] += 1;
+
+ for (i = 0; i < n_i_faces; i++)
+ periodic_table->index[i+1] += periodic_table->index[i];
+
+ periodic_table->size = periodic_table->index[n_i_faces];
+
+ if (per_rank_lst != NULL)
+ periodic_table->n_lists = 2;
+ else
+ periodic_table->n_lists = 1;
+
+ BFT_MALLOC(periodic_table->lists, periodic_table->n_lists, cs_int_t *);
+
+ for (i = 0; i < periodic_table->n_lists; i++)
+ BFT_MALLOC(periodic_table->lists[i], periodic_table->size, cs_int_t);
+
+ face_list = periodic_table->lists[0];
+
+ if (per_rank_lst != NULL)
+ rank_list = periodic_table->lists[1];
+
+ /* Define face_list and rank_list */
+
+ for (i = per_face_idx[0]; i < per_face_idx[n_init_perio]; i++) {
+
+ fst_face = CS_ABS(per_face_lst[2*i]) - 1;
+ snd_face = per_face_lst[2*i+1] - 1;
+
+ /* A face is periodic with only one face */
+
+ assert( periodic_table->index[fst_face + 1]
+ - periodic_table->index[fst_face] == 1);
+
+ shift = periodic_table->index[fst_face];
+ face_list[shift] = snd_face;
+
+ if (per_rank_lst != NULL)
+ rank_list[shift] = per_rank_lst[i];
+
+ }
+
+ return periodic_table;
+}
+
+/*---------------------------------------------------------------------------
+ * Define the number of vertices owned by each face of halo cells.
+ * This will enable to check the right ghost cell in case of multiple
+ * choices.
+ *
+ * parameters:
+ * mesh <-> pointer to cs_mesh_t structure
+ * cell_faces_idx --> "cell -> faces" connectivity index
+ * cell_faces_lst --> "cell -> faces" connectivity list
+ * perio_table --> pointer to the periodic face lookup table
+ * gcell_faces_idx --> pointer to "ghost cell -> faces" conn. index
+ * gcell_glob_faces_lst --> pointer to "ghost cell -> glob face" list
+ *---------------------------------------------------------------------------*/
+
+static void
+_define_gcells_connect(cs_mesh_t *mesh,
+ cs_int_t *cell_faces_idx,
+ cs_int_t *cell_faces_lst,
+ cs_int_t *p_gcell_faces_idx[],
+ cs_int_t *p_gcell_glob_faces_lst[])
+{
+ cs_int_t i, j, cell_id, fac_num, fac_id;
+ cs_int_t rank_id, n_faces, shift, _shift, counter;
+ cs_int_t distant_rank, value;
+
+ cs_int_t n_elts = 0;
+ int request_count = 0;
+ cs_int_t *rank_shift = NULL, *send_buffer = NULL;
+ cs_int_t *gcell_faces_idx = NULL;
+ cs_int_t *gcell_glob_faces_lst = NULL;
+ lookup_table_t *perio_table = NULL;
+
+ cs_halo_t *halo = mesh->halo;
+ cs_mesh_builder_t *mesh_builder = cs_glob_mesh_builder;
+
+#if defined(HAVE_MPI)
+ MPI_Request _request[128];
+ MPI_Request *request = _request;
+ MPI_Status _status[128];
+ MPI_Status *status = _status;
+#endif
+
+ const cs_int_t n_init_perio = mesh->n_init_perio;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+ const cs_int_t n_gcells = halo->n_elts[CS_HALO_EXTENDED];
+ const cs_int_t n_send_gcells = halo->n_send_elts[CS_HALO_EXTENDED];
+
+#if defined(HAVE_MPI)
+ if (halo->n_c_domains*2 > 128) {
+ BFT_MALLOC(request, halo->n_c_domains*2, MPI_Request);
+ BFT_MALLOC(status, halo->n_c_domains*2, MPI_Status);
+ }
+#endif
+
+ BFT_MALLOC(gcell_faces_idx, n_gcells + 1, cs_int_t);
+ BFT_MALLOC(send_buffer, n_send_gcells, cs_int_t);
+
+ /* Exchange number of face for each ghost cells */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ shift = halo->index[2*rank_id] + 1;
+ n_elts = halo->index[2*rank_id+2] - halo->index[2*rank_id];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Irecv(&(gcell_faces_idx[shift]), n_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, &(request[request_count++]));
+#endif
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* We wait for receiving all messages */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ shift = halo->send_index[2*rank_id];
+ n_elts = halo->send_index[2*rank_id+2] - halo->send_index[2*rank_id];
+
+ for (i = halo->send_index[2*rank_id];
+ i < halo->send_index[2*rank_id+2];
+ i++) {
+
+ cell_id = halo->send_list[i];
+ n_faces = cell_faces_idx[cell_id+1] - cell_faces_idx[cell_id];
+ send_buffer[i] = n_faces;
+
+ }
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Isend(&(send_buffer[shift]), n_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ cs_glob_mpi_comm, &(request[request_count++]));
+#endif
+
+ }
+ else {
+
+ for (i = halo->send_index[2*rank_id];
+ i < halo->send_index[2*rank_id+2];
+ i++)
+ gcell_faces_idx[i+1] = send_buffer[i];
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Wait for all exchanges to finish */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Waitall(request_count, request, status);
+#endif
+ request_count = 0;
+
+ /* Build index */
+
+ gcell_faces_idx[0] = 0;
+ for (i = 0; i < n_gcells; i++)
+ gcell_faces_idx[i+1] += gcell_faces_idx[i];
+
+ /* Exchange global face numbering for each face of ghost cells */
+
+ BFT_MALLOC(gcell_glob_faces_lst, gcell_faces_idx[n_gcells], cs_int_t);
+
+ /* Define send_buffer size */
+
+ BFT_MALLOC(rank_shift, n_c_domains + 1, cs_int_t);
+
+ for (i = 0; i < n_c_domains + 1; i++)
+ rank_shift[i] = 0;
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ for (i = halo->send_index[2*rank_id];
+ i < halo->send_index[2*rank_id+2];
+ i++) {
+
+ cell_id = halo->send_list[i];
+
+ for (j = cell_faces_idx[cell_id]; j < cell_faces_idx[cell_id+1]; j++) {
+
+ fac_num = CS_ABS(cell_faces_lst[j-1]);
+
+ if (_test_loop_continues(mesh, fac_num) == true)
+ rank_shift[rank_id+1] += 1;
+
+ } /* End of loop on faces */
+
+ } /* End of loop on cells belonging to "in halo" */
+
+ } /* End of loop on ranks */
+
+ for (i = 0; i < n_c_domains; i++)
+ rank_shift[i+1] += rank_shift[i];
+
+ n_elts = rank_shift[n_c_domains];
+
+ BFT_REALLOC(send_buffer, n_elts, cs_int_t);
+
+ /* Define a look-up table on periodic faces.
+ TODO: a global approach will have to be done to avoid mistakes
+ on face -> cells connectivity in case of periodicity . This case
+ appears only when a periodic face is on a parallel frontier and when
+ several faces (at least two) shared the same n_face_vertices vertices.
+ This extremely rarely occurs. */
+
+ if (n_init_perio > 0)
+ perio_table = _define_periodic_lookup_table(mesh, mesh_builder);
+
+ /* Receive data */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ shift = gcell_faces_idx[halo->index[2*rank_id]];
+ n_elts = gcell_faces_idx[halo->index[2*rank_id+2]]
+ - gcell_faces_idx[halo->index[2*rank_id]];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Irecv(&(gcell_glob_faces_lst[shift]), n_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, &(request[request_count++]));
+#endif
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* We wait for receiving all messages */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ shift = rank_shift[rank_id];
+ n_elts = rank_shift[rank_id+1] - rank_shift[rank_id];
+ counter = 0;
+
+ /* Fill send_buffer */
+
+ for (i = halo->send_index[2*rank_id];
+ i < halo->send_index[2*rank_id+2];
+ i++) {
+
+ cell_id = halo->send_list[i];
+
+ for (j = cell_faces_idx[cell_id]; j < cell_faces_idx[cell_id+1]; j++) {
+
+ fac_num = CS_ABS(cell_faces_lst[j-1]);
+
+ if (_test_loop_continues(mesh, fac_num) == true) {
+
+ fac_id = fac_num - mesh->n_b_faces - 1;
+
+ if (mesh->global_i_face_num != NULL) { /* Parallel treatment */
+
+ if (n_init_perio > 0) { /* Periodic treatment */
+
+ if ( perio_table->index[fac_id+1]
+ - perio_table->index[fac_id] > 0) { /* periodic face */
+
+ distant_rank =
+ perio_table->lists[1][perio_table->index[fac_id]] - 1;
+
+ if (distant_rank == halo->c_domain_rank[rank_id])
+ value = - perio_table->lists[0][perio_table->index[fac_id]];
+ else
+ value = 0;
+
+ }
+ else /* Face is not periodic */
+ value = (cs_int_t)mesh->global_i_face_num[fac_id];
+
+ }
+ else /* Non periodic treatment */
+ value = (cs_int_t)mesh->global_i_face_num[fac_id];
+
+ }
+ else { /* Non parallel treatment */
+
+ if (n_init_perio > 0) { /* Periodic treatment */
+
+ if ( perio_table->index[fac_id+1]
+ - perio_table->index[fac_id] > 0) { /* periodic face */
+
+ value = perio_table->lists[0][perio_table->index[fac_id]] + 1;
+
+ }
+ else /* face is not periodic */
+ value = fac_id + 1;
+
+ }
+ else /* Non periodic treatment */
+ value = fac_id + 1;
+
+ }
+
+ send_buffer[shift + counter++] = value;
+
+ } /* End if face has to be treat */
+
+ } /* End of loop on cell->faces connectivity */
+
+ } /* End of loop on cells belonging to "in halo" */
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Isend(&(send_buffer[shift]), n_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ cs_glob_mpi_comm, &(request[request_count++]));
+#endif
+
+ }
+ else {
+
+ assert(counter == n_elts);
+ _shift = gcell_faces_idx[halo->index[2*rank_id]];
+
+ for (i = 0; i < n_elts; i++)
+ gcell_glob_faces_lst[_shift + i] = send_buffer[shift + i];
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Wait for all exchanges being done */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Waitall(request_count, request, status);
+#endif
+
+ *p_gcell_faces_idx = gcell_faces_idx;
+ *p_gcell_glob_faces_lst = gcell_glob_faces_lst;
+
+ /* Free memory */
+
+ BFT_FREE(rank_shift);
+ BFT_FREE(send_buffer);
+
+#if defined(HAVE_MPI)
+ if (request != _request) {
+ BFT_FREE(request);
+ BFT_FREE(status);
+ }
+#endif
+
+ if (n_init_perio > 0)
+ perio_table = _delete_lookup_table(perio_table);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Update mesh->i_face_cells array for ghost cells in standard halo.
+ *
+ * Define face to ghost cells connectivity for standard halo and
+ * if necessary, for extended halo.
+ *
+ * parameters:
+ * mesh <-> pointer to cs_mesh_t structure
+ * cell_faces_idx --> "cell -> faces" connectivity index
+ * cell_faces_lst --> "cell -> faces" connectivity list
+ * gcell_vtx_idx --> "ghost cell -> vertices" connect. index
+ * gcell_vtx_lst --> "ghost cell -> vertices" connect. list
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_gcells_connect(cs_mesh_t *mesh,
+ cs_int_t *cell_faces_idx,
+ cs_int_t *cell_faces_lst,
+ cs_int_t *gcell_vtx_idx,
+ cs_int_t *gcell_vtx_lst)
+{
+ cs_int_t i, j, k, i_cel, i_fac, i_vtx;
+ cs_int_t rank_id, vtx_id, fac_num, fac_id, cell_id;
+ cs_int_t n_face_vertices, n_shared_vertices, tag, counter;
+ cs_int_t ghost_cell_num, _glob_face_num, glob_face_num;
+ cs_bool_t ok;
+
+ table_int_t *cell_checker = NULL, *cell_list = NULL;
+ cs_int_t *vtx_gcells_idx = NULL, *vtx_gcells_lst = NULL;
+ cs_int_t *gcell_faces_idx = NULL, *gcell_glob_faces_lst = NULL;
+ cs_int_t *vtx_buffer = NULL, *vtx_counter = NULL, *vtx_checker = NULL;
+
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t *fac_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *fac_vtx_lst = mesh->i_face_vtx_lst;
+
+ /* Define cell -> face connectivity for halo to know
+ exactly the right cell to use in face -> cells connectivity. */
+
+ _define_gcells_connect(mesh,
+ cell_faces_idx,
+ cell_faces_lst,
+ &gcell_faces_idx,
+ &gcell_glob_faces_lst);
+
+ /* Allocation and initialization of buffers */
+
+ BFT_MALLOC(vtx_buffer, 3*n_vertices + 1, cs_int_t);
+ vtx_counter = &(vtx_buffer[0]);
+ vtx_checker = &(vtx_buffer[n_vertices]);
+ vtx_gcells_idx = &(vtx_buffer[2*n_vertices]);
+
+ cell_checker = _create_table_int(0, 20);
+ cell_list = _create_table_int(-1, 20);
+
+ /* Loop on each rank to define ghost cell connectivity */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ _reverse_connectivity_idx(halo,
+ n_vertices,
+ rank_id,
+ vtx_checker,
+ gcell_vtx_idx,
+ gcell_vtx_lst,
+ vtx_gcells_idx);
+
+ BFT_REALLOC(vtx_gcells_lst, vtx_gcells_idx[n_vertices], cs_int_t);
+
+ _reverse_connectivity_lst(halo,
+ n_vertices,
+ rank_id,
+ vtx_counter,
+ vtx_checker,
+ gcell_vtx_idx,
+ gcell_vtx_lst,
+ vtx_gcells_idx,
+ vtx_gcells_lst);
+
+ for (i = halo->send_index[2*rank_id];
+ i < halo->send_index[2*rank_id+2]; i++) {
+
+ i_cel = halo->send_list[i];
+
+ _reset_table_int(cell_list, -1);
+ _reset_table_int(cell_checker, 0);
+
+ for (i_fac = cell_faces_idx[i_cel];
+ i_fac < cell_faces_idx[i_cel+1]; i_fac++) {
+
+ fac_num = CS_ABS(cell_faces_lst[i_fac-1]);
+
+ if (_test_loop_continues(mesh, fac_num) == true) {
+
+ fac_id = fac_num - mesh->n_b_faces - 1;
+ n_face_vertices = fac_vtx_idx[fac_id+1] - fac_vtx_idx[fac_id];
+
+ /* Loop on vertices of the face */
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id+1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx-1] - 1;
+
+ /* For each vertex, we store cell in halo */
+
+ for (j = vtx_gcells_idx[vtx_id];
+ j < vtx_gcells_idx[vtx_id+1]; j++) {
+
+ tag = _find_table_int_value(cell_list, vtx_gcells_lst[j]);
+
+ if (tag == -1) /* New cell */
+ _add_table_int_value_dup(cell_checker, 1);
+ else
+ _raise_table_int_value(cell_checker, tag, 1);
+
+ _add_table_int_value(cell_list, vtx_gcells_lst[j]);
+
+ } /* End of loop on out ghost cells connecting to this vertex */
+
+ } /* End of loop on face's vertices */
+
+ counter = 0;
+ for (j = 0; j < cell_checker->n_elts; j++) {
+ n_shared_vertices = _get_table_int_value(cell_checker, j);
+ if (n_shared_vertices == n_face_vertices)
+ counter++;
+ }
+
+ if (counter > 0) {
+
+ for (j = 0; j < cell_checker->n_elts; j++) {
+
+ n_shared_vertices = _get_table_int_value(cell_checker, j);
+
+ if (n_shared_vertices == n_face_vertices) { /* Standard Cell */
+
+ cell_id = _get_table_int_value(cell_list, j);
+
+ if (counter > 1) {
+
+ /* Test if this is the right ghost cell */
+
+ if (mesh->global_i_face_num != NULL)
+ glob_face_num = mesh->global_i_face_num[fac_id];
+ else
+ glob_face_num = fac_id + 1;
+
+ ok = false;
+ for (k = gcell_faces_idx[cell_id];
+ k < gcell_faces_idx[cell_id+1]; k++) {
+
+ _glob_face_num = gcell_glob_faces_lst[k];
+
+ if (_glob_face_num < 0) {
+
+ assert(mesh->global_i_face_num != NULL);
+ _glob_face_num = mesh->global_i_face_num[-_glob_face_num];
+
+ }
+
+ if (_glob_face_num == glob_face_num) {
+ ok = true;
+ break;
+ }
+
+ } /* End of loop on faces of the out ghost cell */
+
+ } /* End if counter > 1 */
+
+ else if (counter == 1)
+ ok = true;
+
+ if (ok == true) { /* Update face -> cells connectivity */
+
+ ghost_cell_num = mesh->n_cells + cell_id + 1;
+
+ if (mesh->i_face_cells[2*fac_id] < 1)
+ mesh->i_face_cells[2*fac_id] = ghost_cell_num;
+
+ if (mesh->i_face_cells[2*fac_id+1] < 1)
+ mesh->i_face_cells[2*fac_id+1] = ghost_cell_num;
+
+ }
+
+ } /* If n_shared_vertices == n_face_vertices */
+
+ } /* End of loop on cell sharing vertex/vertices */
+
+ } /* End if counter > 0 */
+
+ _reset_table_int(cell_checker, 0);
+ _reset_table_int(cell_list, -1);
+
+ } /* If face is concerned */
+
+ } /* End of loop on faces */
+
+ } /* End of loop on ghost cells */
+
+ } /* End of loop on ranks */
+
+ BFT_FREE(vtx_buffer);
+ BFT_FREE(vtx_gcells_lst);
+ BFT_FREE(gcell_faces_idx);
+ BFT_FREE(gcell_glob_faces_lst);
+
+ cell_checker = _delete_table_int(cell_checker);
+ cell_list = _delete_table_int(cell_list);
+
+}
+
+#if 0 /* TODO: check algorithm (deadlock on BG/L on one test case) */
+
+/*---------------------------------------------------------------------------
+ * Clean a halo i.e. delete rank(s) with no ghost cells.
+ *
+ * This case happens when an interface has only extended vertices
+ * and the halo is standard.
+ *
+ * parameters:
+ * mesh --> pointer to a mesh structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_clean_halo(cs_mesh_t *mesh)
+{
+ cs_int_t rank_id, i, j;
+
+ cs_halo_t *halo = mesh->halo;
+
+ cs_int_t n_c_domains = halo->n_c_domains;
+ cs_int_t n_real_c_domains = 0;
+ cs_int_t counter = 0;
+ cs_int_t *new_c_domain_rank = NULL;
+ cs_int_t *new_perio_lst = NULL;
+ cs_int_t *new_index = NULL;
+
+ const cs_int_t n_transforms = mesh->n_transforms;
+
+ /* Is there something to do ? */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++)
+ if (halo->send_index[2*rank_id+2] - halo->send_index[2*rank_id] > 0)
+ n_real_c_domains++;
+
+ if (n_real_c_domains == n_c_domains)
+ return;
+
+
+ /* halo->index, halo->perio_lst and n_c_domains need an update */
+
+ BFT_MALLOC(new_c_domain_rank, n_real_c_domains, cs_int_t);
+ BFT_MALLOC(new_index, 2*n_real_c_domains+1, cs_int_t);
+
+ if (n_transforms > 0)
+ BFT_MALLOC(new_perio_lst, 4*n_transforms*n_real_c_domains, cs_int_t);
+
+ /* Define the new buffers */
+
+ new_index[0] = 0;
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ if (halo->send_index[2*rank_id+2] - halo->send_index[2*rank_id] > 0) {
+
+ new_c_domain_rank[counter] = halo->c_domain_rank[rank_id];
+ new_index[2*counter+1] = halo->send_index[2*rank_id+1];
+ new_index[2*counter+2] = halo->send_index[2*rank_id+2];
+
+ for (i = 0; i < n_transforms; i++)
+ for (j = 0; j < 4; j++)
+ new_perio_lst[4*counter + j + 4*n_real_c_domains*i]
+ = halo->send_perio_lst[4*rank_id + j + 4*n_c_domains*i];
+
+ counter++;
+
+ } /* If there are elements for this rank */
+
+ } /* End of loop on frontier ranks */
+
+ /* Replace halo->send_perio_lst, halo->send_index and
+ halo->c_domain_rank by new ones */
+
+ BFT_FREE(halo->c_domain_rank);
+ BFT_FREE(halo->send_index);
+
+ if (n_transforms > 0)
+ BFT_FREE(halo->send_perio_lst);
+
+ halo->n_c_domains = n_real_c_domains;
+ halo->c_domain_rank = new_c_domain_rank;
+
+ halo->send_index = new_index;
+ if (n_transforms > 0)
+ halo->send_perio_lst = new_perio_lst;
+
+ /* Reallocation of halo's buffers */
+
+ BFT_REALLOC(halo->index, 2*n_real_c_domains+1, cs_int_t);
+ BFT_REALLOC(halo->perio_lst, 4*n_transforms*n_real_c_domains, cs_int_t);
+
+}
+
+#endif /* #if 0 */
+
+/*----------------------------------------------------------------------------
+ * Define cell -> internal faces connectivity for ghost cells.
+ *
+ * Treatment of parallel and/or periodic halos for standard or extended
+ * ghost cells according to halo type building option.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure.
+ * interface_set --> pointer to fvm_interface_set structure.
+ * p_cell_faces_idx <-- pointer to the connectivity index
+ * p_cell_faces_lst <-- pointer to the connectivity list
+ *----------------------------------------------------------------------------*/
+
+static void
+_create_gcell_faces_connect(cs_mesh_t *mesh,
+ fvm_interface_set_t *interface_set,
+ cs_int_t *p_cell_faces_idx[],
+ cs_int_t *p_cell_faces_lst[])
+{
+ cs_int_t i, fac_id, i_vtx, id1, id2, shift, vtx_id;
+
+ cs_int_t *vtx_tag = NULL;
+ cs_int_t *cell_buffer = NULL, *cell_tag = NULL, *counter = NULL;
+ cs_int_t *cell_faces_idx = NULL;
+ cs_int_t *cell_faces_lst = NULL;
+
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t n_b_faces = mesh->n_b_faces;
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t *face_cells = mesh->i_face_cells;
+ const cs_int_t *fac_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *fac_vtx_lst = mesh->i_face_vtx_lst;
+
+ *p_cell_faces_idx = cell_faces_idx;
+ *p_cell_faces_lst = cell_faces_lst;
+
+ if (interface_set == NULL)
+ return;
+
+ BFT_MALLOC(cell_faces_idx, n_cells+1, cs_int_t);
+ BFT_MALLOC(cell_buffer, 2*n_cells, cs_int_t);
+
+ cell_tag = &(cell_buffer[0]);
+ counter = &(cell_buffer[n_cells]);
+
+ cell_faces_idx[0] = 1;
+ for (i = 0; i < n_cells; i++) {
+ cell_faces_idx[i+1] = 0;
+ cell_tag[i] = -1;
+ }
+
+ assert(sizeof(cs_int_t) == sizeof(fvm_lnum_t));
+
+ _get_vertex_tag(mesh->n_vertices, interface_set, &vtx_tag);
+
+ for (fac_id = 0; fac_id < n_i_faces; fac_id++) {
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id + 1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx - 1] - 1;
+
+ if (vtx_tag[vtx_id] == 1) {
+
+ id1 = face_cells[2*fac_id] - 1;
+ id2 = face_cells[2*fac_id + 1] - 1;
+
+ if (id1 < 0) {
+ if (cell_tag[id2] != fac_id) {
+ cell_tag[id2] = fac_id;
+ cell_faces_idx[id2 + 1] += 1;
+ }
+ }
+
+ if (id2 < 0) {
+ if (cell_tag[id1] != fac_id) {
+ cell_tag[id1] = fac_id;
+ cell_faces_idx[id1 + 1] += 1;
+ }
+ }
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+ if (id1 >= 0 && id2 >= 0) {
+
+ if (cell_tag[id1] != fac_id) {
+ cell_tag[id1] = fac_id;
+ cell_faces_idx[id1 + 1] += 1;
+ }
+
+ if (cell_tag[id2] != fac_id) {
+ cell_tag[id2] = fac_id;
+ cell_faces_idx[id2 + 1] += 1;
+ }
+
+ }
+ }
+
+ }
+
+ } /* End of loop on vertices */
+
+ } /* End of loop on internal faces */
+
+ /* Build index */
+
+ for (i = 0; i < n_cells; i++) {
+ cell_faces_idx[i+1] += cell_faces_idx[i];
+ counter[i] = 0;
+ cell_tag[i] = -1;
+ }
+
+ BFT_MALLOC(cell_faces_lst, cell_faces_idx[n_cells]-1, cs_int_t);
+
+ for (fac_id = 0; fac_id < n_i_faces; fac_id++) {
+
+ for (i_vtx = fac_vtx_idx[fac_id];
+ i_vtx < fac_vtx_idx[fac_id + 1]; i_vtx++) {
+
+ vtx_id = fac_vtx_lst[i_vtx - 1] - 1;
+
+ if (vtx_tag[vtx_id] == 1) {
+
+ id1 = face_cells[2*fac_id] - 1;
+ id2 = face_cells[2*fac_id + 1] - 1;
+
+ if (id1 < 0) {
+ if (cell_tag[id2] != fac_id) {
+
+ cell_tag[id2] = fac_id;
+ shift = cell_faces_idx[id2] - 1 + counter[id2];
+ cell_faces_lst[shift] = fac_id + 1 + n_b_faces;
+ counter[id2] += 1;
+
+ }
+ }
+
+ if (id2 < 0) {
+ if (cell_tag[id1] != fac_id) {
+
+ cell_tag[id1] = fac_id;
+ shift = cell_faces_idx[id1] - 1 + counter[id1];
+ cell_faces_lst[shift] = fac_id + 1 + n_b_faces;
+ counter[id1] += 1;
+
+ }
+ }
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+ if (id1 >= 0 && id2 >= 0) {
+
+ if (cell_tag[id1] != fac_id) {
+ cell_tag[id1] = fac_id;
+ shift = cell_faces_idx[id1] - 1 + counter[id1];
+ cell_faces_lst[shift] = fac_id + 1 + n_b_faces;
+ counter[id1] += 1;
+ }
+
+ if (cell_tag[id2] != fac_id) {
+ cell_tag[id2] = fac_id;
+ shift = cell_faces_idx[id2] - 1 + counter[id2];
+ cell_faces_lst[shift] = fac_id + 1 + n_b_faces;
+ counter[id2] += 1;
+ }
+
+ }
+ }
+
+ }
+
+ } /* End of loop on vertices */
+
+ } /* End of loop on internal faces */
+
+ BFT_FREE(vtx_tag);
+ BFT_FREE(cell_buffer);
+
+ *p_cell_faces_idx = cell_faces_idx;
+ *p_cell_faces_lst = cell_faces_lst;
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define halo structures for internal and distant ghost cells.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure.
+ * p_gcell_vtx_idx <-- pointer to the connectivity index
+ * p_gcell_vtx_lst <-- pointer to the connectivity list
+ *---------------------------------------------------------------------------*/
+
+void
+cs_mesh_halo_define(cs_mesh_t *mesh,
+ fvm_interface_set_t *interface_set,
+ cs_int_t *p_gcell_vtx_idx[],
+ cs_int_t *p_gcell_vtx_lst[])
+{
+ cs_int_t *send_gcell_vtx_idx = NULL, *send_gcell_vtx_lst = NULL;
+ cs_int_t *gcell_vtx_idx = NULL, *gcell_vtx_lst = NULL;
+ cs_int_t *gcell_faces_idx = NULL, *gcell_faces_lst = NULL;
+ cs_halo_t *halo = mesh->halo;
+
+ halo->n_local_elts = mesh->n_cells;
+
+ /* Define cell -> internal faces connectivity for ghost cells */
+
+ _create_gcell_faces_connect(mesh,
+ interface_set,
+ &gcell_faces_idx,
+ &gcell_faces_lst);
+
+ /* Fill cs_halo_t structure for send_halo */
+
+ bft_printf(_(" Local halo definition\n"));
+ bft_printf_flush();
+
+ _fill_send_halo(mesh,
+ interface_set,
+ gcell_faces_idx,
+ gcell_faces_lst);
+
+#if 0
+ /* Clean cs_halo_t structure.
+ Remove communicating ranks with no ghost cells */
+
+ bft_printf(_(" Halo cleaning\n"));
+ bft_printf_flush();
+
+
+ _clean_halo(mesh);
+#endif
+
+ /* Fill cs_halo_t structure for halo.
+ We use the data from send_halo structure */
+
+ bft_printf(_(" Distant halo creation\n"));
+ bft_printf_flush();
+
+ _fill_halo(mesh);
+
+ /* Update mesh structure elements bound to halo management */
+
+ mesh->n_ghost_cells = halo->n_elts[CS_HALO_EXTENDED];
+ mesh->n_cells_with_ghosts = mesh->n_cells + mesh->n_ghost_cells;
+
+ /* Update connectivity between internal faces and cells */
+
+ if (cs_mesh_n_g_ghost_cells(mesh) > 0) {
+
+ /* Create local ghost connectivity for send_halo cells and send it.
+ Receive ghost cells connectivity for halo cells. */
+
+ _create_send_gcell_vtx_connect(mesh,
+ interface_set,
+ gcell_faces_idx,
+ gcell_faces_lst,
+ &send_gcell_vtx_idx,
+ &send_gcell_vtx_lst);
+
+ _exchange_gcell_vtx_connect(mesh,
+ send_gcell_vtx_idx,
+ send_gcell_vtx_lst,
+ &gcell_vtx_idx,
+ &gcell_vtx_lst);
+
+ /* Define mesh->i_face_cells array for ghost cells in standard halo and
+ also ghost cells to ghost cells connectivity for standard and extended
+ halo if necessary */
+
+ bft_printf(_(" Updating the faces -> cells connectivity\n"));
+ bft_printf_flush();
+
+ _update_gcells_connect(mesh,
+ gcell_faces_idx,
+ gcell_faces_lst,
+ gcell_vtx_idx,
+ gcell_vtx_lst);
+
+ /* Free memory */
+
+ BFT_FREE(send_gcell_vtx_idx);
+ BFT_FREE(send_gcell_vtx_lst);
+
+ }
+
+ BFT_FREE(gcell_faces_idx);
+ BFT_FREE(gcell_faces_lst);
+
+ *p_gcell_vtx_idx = gcell_vtx_idx;
+ *p_gcell_vtx_lst = gcell_vtx_lst;
+
+ /* Update mesh structure elements bound to halo management */
+
+ if (mesh->n_ghost_cells > 0)
+ BFT_REALLOC(mesh->cell_family, mesh->n_cells_with_ghosts, cs_int_t);
+
+ cs_halo_update_buffers(halo);
+
+#if 0 /* for debugging purposes */
+ cs_halo_dump(halo, 1);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh_quality.c b/src/base/cs_mesh_quality.c
new file mode 100644
index 0000000..6a20c6c
--- /dev/null
+++ b/src/base/cs_mesh_quality.c
@@ -0,0 +1,1230 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Compute several mesh quality criteria.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT and FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+#include <fvm_defs.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh_quality.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define CS_MESH_QUALITY_N_SUBS 10
+
+#undef _CROSS_PRODUCT_3D
+#undef _DOT_PRODUCT_3D
+#undef _MODULE_3D
+#undef _COSINE_3D
+
+#define _CROSS_PRODUCT_3D(cross_v1_v2, v1, v2) ( \
+ cross_v1_v2[0] = v1[1]*v2[2] - v1[2]*v2[1], \
+ cross_v1_v2[1] = v1[2]*v2[0] - v1[0]*v2[2], \
+ cross_v1_v2[2] = v1[0]*v2[1] - v1[1]*v2[0] )
+
+#define _DOT_PRODUCT_3D(v1, v2) ( \
+ v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2])
+
+#define _MODULE_3D(v) \
+ sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2])
+
+#define _COSINE_3D(v1, v2) (\
+ _DOT_PRODUCT_3D(v1, v2) / (_MODULE_3D(v1) * _MODULE_3D(v2)) )
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute the minimum and the maximum of a vector (locally).
+ *
+ * parameters:
+ * n_vals <-- local number of elements
+ * var <-- pointer to vector
+ * min --> minimum
+ * max --> maximum
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_local_minmax(cs_int_t n_vals,
+ const cs_real_t var[],
+ cs_real_t *min,
+ cs_real_t *max)
+{
+ cs_int_t i;
+ cs_real_t _min = var[0], _max = var[0];
+
+ for (i = 1; i < n_vals; i++) {
+ _min = CS_MIN(_min, var[i]);
+ _max = CS_MAX(_max, var[i]);
+ }
+
+ if (min != NULL) *min = _min;
+ if (max != NULL) *max = _max;
+}
+
+/*----------------------------------------------------------------------------
+ * Display the distribution of values of a real vector.
+ *
+ * parameters:
+ * n_steps <-- number of histogram steps
+ * var_min <-- minimum variable value
+ * var_max <-- maximum variable value
+ * count <-> count for each histogram slice (size: n_steps)
+ * local values in, global values out
+ *----------------------------------------------------------------------------*/
+
+static void
+_display_histograms(int n_steps,
+ cs_real_t var_min,
+ cs_real_t var_max,
+ fvm_gnum_t count[])
+{
+ int i, j;
+ double var_step;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ fvm_gnum_t _g_count[CS_MESH_QUALITY_N_SUBS];
+ fvm_gnum_t *g_count = _g_count;
+
+ if (n_steps > CS_MESH_QUALITY_N_SUBS)
+ BFT_MALLOC(g_count, n_steps, fvm_gnum_t);
+
+ MPI_Allreduce(count, g_count, n_steps, FVM_MPI_GNUM, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < n_steps; i++)
+ count[i] = g_count[i];
+
+ if (n_steps > CS_MESH_QUALITY_N_SUBS)
+ BFT_FREE(g_count);
+
+ }
+
+#endif
+
+ /* Print base min, max, and increment */
+
+ bft_printf(_(" minimum value = %10.5e\n"), (double)var_min);
+ bft_printf(_(" maximum value = %10.5e\n\n"), (double)var_max);
+
+ var_step = CS_ABS(var_max - var_min) / n_steps;
+
+ if (CS_ABS(var_max - var_min) > 0.) {
+
+ /* Number of elements in each subdivision */
+
+ for (i = 0, j = 1; i < n_steps - 1; i++, j++)
+ bft_printf(" %3d : [ %10.5e ; %10.5e [ = %10d\n",
+ i+1, var_min + i*var_step, var_min + j*var_step, count[i]);
+
+ bft_printf(" %3d : [ %10.5e ; %10.5e ] = %10d\n",
+ n_steps,
+ var_min + (n_steps - 1)*var_step,
+ var_max,
+ count[n_steps - 1]);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Display the distribution of values of a real vector on cells or
+ * boundary faces.
+ *
+ * parameters:
+ * n_vals <-- number of values
+ * var <-- pointer to vector (size: n_vals)
+ *----------------------------------------------------------------------------*/
+
+static void
+_histogram(cs_int_t n_vals,
+ const cs_real_t var[])
+{
+ cs_int_t i;
+ int j, k;
+
+ cs_real_t step;
+ cs_real_t max, min, _max, _min;
+
+ fvm_gnum_t count[CS_MESH_QUALITY_N_SUBS];
+ const int n_steps = CS_MESH_QUALITY_N_SUBS;
+
+ assert (sizeof(double) == sizeof(cs_real_t));
+
+ /* Compute global min and max */
+
+ _compute_local_minmax(n_vals, var, &_min, &_max);
+
+ /* Default initialization */
+
+ min = _min;
+ max = _max;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+ MPI_Allreduce(&_min, &min, 1, CS_MPI_REAL, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ MPI_Allreduce(&_max, &max, 1, CS_MPI_REAL, MPI_MAX,
+ cs_glob_mpi_comm);
+ }
+
+#endif
+
+ /* Define axis subdivisions */
+
+ for (j = 0; j < n_steps; j++)
+ count[j] = 0;
+
+ if (CS_ABS(max - min) > 0.) {
+
+ step = CS_ABS(max - min) / n_steps;
+
+ /* Loop on values */
+
+ for (i = 0; i < n_vals; i++) {
+
+ /* Associated subdivision */
+
+ for (j = 0, k = 1; k < n_steps; j++, k++) {
+ if (var[i] < min + k*step)
+ break;
+ }
+ count[j] += 1;
+
+ }
+
+ }
+
+ _display_histograms(n_steps, min, max, count);
+}
+
+/*----------------------------------------------------------------------------
+ * Display the distribution of values of a real vector on interior faces.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * var <-- pointer to vector (size: mesh->n_i_faces)
+ *----------------------------------------------------------------------------*/
+
+static void
+_int_face_histogram(const cs_mesh_t *mesh,
+ const cs_real_t var[])
+{
+ cs_int_t i;
+ int j, k;
+
+ cs_real_t step;
+ cs_real_t max, min, _max, _min;
+
+ fvm_gnum_t count[CS_MESH_QUALITY_N_SUBS];
+ const int n_steps = CS_MESH_QUALITY_N_SUBS;
+
+ assert (sizeof (double) == sizeof (cs_real_t));
+
+ /* Compute global min and max */
+
+ _compute_local_minmax(mesh->n_i_faces, var, &_min, &_max);
+
+ /* Default initialization */
+
+ min = _min;
+ max = _max;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+ MPI_Allreduce(&_min, &min, 1, CS_MPI_REAL, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ MPI_Allreduce(&_max, &max, 1, CS_MPI_REAL, MPI_MAX,
+ cs_glob_mpi_comm);
+ }
+
+#endif
+
+ /* Define axis subdivisions */
+
+ for (j = 0; j < n_steps; j++)
+ count[j] = 0;
+
+ if (CS_ABS(max - min) > 0.) {
+
+ step = CS_ABS(max - min) / n_steps;
+
+ /* Loop on faces */
+
+ for (i = 0; i < mesh->n_i_faces; i++) {
+
+ if (mesh->i_face_cells[i*2] > mesh->n_cells)
+ continue;
+
+ /* Associated subdivision */
+
+ for (j = 0, k = 1; k < n_steps; j++, k++) {
+ if (var[i] < min + k*step)
+ break;
+ }
+ count[j] += 1;
+
+ }
+
+ }
+
+ _display_histograms(n_steps, min, max, count);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute weighting coefficient and center offsetting coefficient
+ * for internal faces.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure.
+ * mesh_quantities <-- pointer to mesh quantities structures.
+ * weighting <-> array for weigthing coefficient.
+ * offsetting <-> array for offsetting coefficient.
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_weighting_offsetting(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities,
+ cs_real_t weighting[],
+ cs_real_t offsetting[])
+{
+ cs_int_t i, face_id, cell1, cell2;
+ cs_real_t intersection;
+ cs_real_t cell_center1[3], cell_center2[3];
+ cs_real_t face_center[3], face_normal[3];
+ cs_real_t v0[3], v1[3], v2[3];
+
+ double coef0 = 0, coef1 = 0, coef2 = 0;
+
+ const cs_int_t dim = mesh->dim;
+
+ /* Compute weighting coefficient */
+ /*-------------------------------*/
+
+ /* Loop on internal faces */
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+
+ /* Get local number of the cells in contact with the face */
+
+ cell1 = mesh->i_face_cells[2 * face_id] - 1;
+ cell2 = mesh->i_face_cells[2 * face_id + 1] - 1;
+
+ /* Get information on mesh quantities */
+
+ for (i = 0; i < dim; i++) {
+
+ /* Center of gravity for each cell */
+
+ cell_center1[i] = mesh_quantities->cell_cen[cell1*dim + i];
+ cell_center2[i] = mesh_quantities->cell_cen[cell2*dim + i];
+
+ /* Face center coordinates */
+
+ face_center[i] = mesh_quantities->i_face_cog[face_id*dim + i];
+
+ /* Surface vector (orthogonal to the face) */
+
+ face_normal[i] = mesh_quantities->i_face_normal[face_id*dim + i];
+
+ }
+
+ /* Compute weighting coefficient with two approaches. Keep the max value. */
+
+ for (i = 0; i < dim; i++) {
+
+ v0[i] = cell_center2[i] - cell_center1[i];
+ v1[i] = face_center[i] - cell_center1[i];
+ v2[i] = cell_center2[i] - face_center[i];
+
+ }
+
+ coef0 = _DOT_PRODUCT_3D(v0, face_normal);
+ coef1 = _DOT_PRODUCT_3D(v1, face_normal)/coef0;
+ coef2 = _DOT_PRODUCT_3D(v2, face_normal)/coef0;
+
+ weighting[face_id] = CS_MAX(coef1, coef2);
+
+ /* Compute center offsetting coefficient */
+ /*---------------------------------------*/
+
+ /* Compute intersection between face and segment defined by the two cell
+ centers */
+
+ for (i = 0; i < dim; i++) {
+
+ intersection = (1 - weighting[face_id]) * cell_center1[i]
+ + weighting[face_id] * cell_center2[i];
+
+ v1[i] = intersection - face_center[i];
+ v2[i] = cell_center2[i] - cell_center1[i];
+
+ }
+
+ offsetting[face_id] = _MODULE_3D(v1) / _MODULE_3D(v2);
+
+ } /* End of loop on faces */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute angle between face normal and segment based on centers of the
+ * adjacent cells. Evaluates a level of non-orthogonality.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure.
+ * mesh_quantities <-- pointer to mesh quantities structures.
+ * i_face_ortho <-> array for internal faces.
+ * b_face_ortho <-> array for border faces.
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_orthogonality(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities,
+ cs_real_t i_face_ortho[],
+ cs_real_t b_face_ortho[])
+{
+ cs_int_t i, face_id, cell1, cell2;
+ double cos_alpha;
+ cs_real_t cell_center1[3], cell_center2[3];
+ cs_real_t face_center[3];
+ cs_real_t face_normal[3], vect[3];
+
+ const double rad_to_deg = 180. / acos(-1.);
+ const cs_int_t dim = mesh->dim;
+
+ /* Loop on internal faces */
+ /*------------------------*/
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+
+ /* Get local number of the cells beside the face */
+
+ cell1 = mesh->i_face_cells[2 * face_id] - 1;
+ cell2 = mesh->i_face_cells[2 * face_id + 1] - 1;
+
+ /* Get information on mesh quantities */
+
+ for (i = 0; i < dim; i++) {
+
+ /* Center of gravity for each cell */
+
+ cell_center1[i] = mesh_quantities->cell_cen[cell1*dim + i];
+ cell_center2[i] = mesh_quantities->cell_cen[cell2*dim + i];
+
+ /* Surface vector (orthogonal to the face) */
+
+ face_normal[i] = mesh_quantities->i_face_normal[face_id*dim + i];
+
+ }
+
+ /* Compute angle which evaluates the non-orthogonality. */
+
+ for (i = 0; i < dim; i++)
+ vect[i] = cell_center2[i] - cell_center1[i];
+
+ cos_alpha = _COSINE_3D(vect, face_normal);
+ cos_alpha = CS_ABS(cos_alpha);
+ cos_alpha = CS_MIN(cos_alpha, 1);
+
+ if (cos_alpha < 1.)
+ i_face_ortho[face_id] = acos(cos_alpha) * rad_to_deg;
+ else
+ i_face_ortho[face_id] = 0.;
+
+ } /* End of loop on internal faces */
+
+ /* Loop on border faces */
+ /*----------------------*/
+
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++) {
+
+ /* Get local number of the cell beside the face */
+
+ cell1 = mesh->b_face_cells[face_id] - 1;
+
+ /* Get information on mesh quantities */
+
+ for (i = 0; i < dim; i++) {
+
+ /* Center of gravity of the cell */
+
+ cell_center1[i] = mesh_quantities->cell_cen[cell1*dim + i];
+
+ /* Face center coordinates */
+
+ face_center[i] = mesh_quantities->b_face_cog[face_id*dim + i];
+
+ /* Surface vector (orthogonal to the face) */
+
+ face_normal[i] = mesh_quantities->b_face_normal[face_id*dim + i];
+
+ }
+
+ /* Compute alpha: angle wich evaluate the difference with orthogonality. */
+
+ for (i = 0; i < dim; i++)
+ vect[i] = face_center[i] - cell_center1[i];
+
+ cos_alpha = _COSINE_3D(vect, face_normal);
+ cos_alpha = CS_ABS(cos_alpha);
+ cos_alpha = CS_MIN(cos_alpha, 1);
+
+ if (cos_alpha < 1.)
+ b_face_ortho[face_id] = acos(cos_alpha) * rad_to_deg;
+ else
+ b_face_ortho[face_id] = 0.;
+
+ } /* End of loop on border faces */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Evaluate face warping angle.
+ *
+ * parameters:
+ * idx_start <-- first vertex index
+ * idx_end <-- last vertex index
+ * face_vertex_num <-- face -> vertices connectivity
+ * face_normal <-- face normal
+ * vertex_coords <-- vertices coordinates
+ * face_warping --> face warping angle
+ *----------------------------------------------------------------------------*/
+
+static void
+_get_face_warping(cs_int_t idx_start,
+ cs_int_t idx_end,
+ const cs_real_t face_normal[],
+ const cs_int_t face_vertex_num[],
+ const cs_real_t vertex_coords[],
+ double face_warping[])
+{
+ cs_int_t i, idx, vertex_num1, vertex_num2;
+ double edge_cos_alpha;
+ cs_real_t vect[3];
+
+ double cos_alpha = 0.;
+
+ const int dim = 3;
+ const double rad_to_deg = 180. / acos(-1.);
+
+ /* Loop on edges */
+
+ for (idx = idx_start; idx < idx_end - 1; idx++) {
+
+ vertex_num1 = face_vertex_num[idx] - 1;
+ vertex_num2 = face_vertex_num[idx + 1] - 1;
+
+ /* Get vertex coordinates */
+
+ for (i = 0; i < dim; i++)
+ vect[i] = vertex_coords[vertex_num2*dim + i]
+ - vertex_coords[vertex_num1*dim + i];
+
+ edge_cos_alpha = _COSINE_3D(vect, face_normal);
+ edge_cos_alpha = CS_ABS(edge_cos_alpha);
+ cos_alpha = CS_MAX(cos_alpha, edge_cos_alpha);
+
+ }
+
+ /* Last edge */
+
+ vertex_num1 = face_vertex_num[idx_end - 1] - 1;
+ vertex_num2 = face_vertex_num[idx_start] - 1;
+
+ /* Get vertex coordinates */
+
+ for (i = 0; i < dim; i++)
+ vect[i] = vertex_coords[vertex_num2*dim + i]
+ - vertex_coords[vertex_num1*dim + i];
+
+ edge_cos_alpha = _COSINE_3D(vect, face_normal);
+ edge_cos_alpha = CS_ABS(edge_cos_alpha);
+ cos_alpha = CS_MAX(cos_alpha, edge_cos_alpha);
+ cos_alpha = CS_MIN(cos_alpha, 1.);
+
+ *face_warping = 90. - acos(cos_alpha) * rad_to_deg;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Transform face values to cell values using the maximum value
+ * of a cell's faces.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * default_value <-- default value for initialization
+ * i_face_val <-- interior face values
+ * b_face_val <-- boundary face values
+ * cell_val --> cell values
+ *----------------------------------------------------------------------------*/
+
+static void
+_cell_from_max_face(const cs_mesh_t *mesh,
+ const cs_real_t default_value,
+ const cs_real_t i_face_val[],
+ const cs_real_t b_face_val[],
+ cs_real_t cell_val[])
+{
+ cs_int_t i, j, cell_id;
+
+ /* Default initialization */
+
+ for (i = 0; i < mesh->n_cells_with_ghosts; i++)
+ cell_val[i] = default_value;
+
+ /* Distribution */
+
+ if (i_face_val != NULL) {
+
+ for (i = 0; i < mesh->n_i_faces; i++) {
+
+ for (j = 0; j < 2; j++) {
+ cell_id = mesh->i_face_cells[2*i + j] - 1;
+ if (i_face_val[i] > cell_val[cell_id])
+ cell_val[cell_id] = i_face_val[i];
+ }
+
+ }
+
+ } /* If i_face_val != NULL */
+
+ if (b_face_val != NULL) {
+
+ for (i = 0; i < mesh->n_b_faces; i++) {
+
+ cell_id = mesh->b_face_cells[i] - 1;
+ if (b_face_val[i] > cell_val[cell_id])
+ cell_val[cell_id] = b_face_val[i];
+
+ }
+
+ } /* If b_face_val != NULL */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Transform face values to vertex values using the maximum value
+ * of a vertices's connected faces.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * default_value <-- default value for initialization
+ * i_face_val <-- interior face values
+ * b_face_val <-- boundary face values
+ * vtx_val --> vertex values
+ *----------------------------------------------------------------------------*/
+
+static void
+_vtx_from_max_face(const cs_mesh_t *mesh,
+ const cs_real_t default_value,
+ const cs_real_t i_face_val[],
+ const cs_real_t b_face_val[],
+ cs_real_t vtx_val[])
+{
+ cs_int_t i, j, idx_start, idx_end, vtx_id;
+
+ /* Default initialization */
+
+ for (i = 0; i < mesh->n_vertices; i++)
+ vtx_val[i] = default_value;
+
+ /* Distribution */
+
+ if (i_face_val != NULL && mesh->i_face_vtx_idx != NULL) {
+
+ for (i = 0; i < mesh->n_i_faces; i++) {
+
+ idx_start = mesh->i_face_vtx_idx[i] - 1;
+ idx_end = mesh->i_face_vtx_idx[i + 1] - 1;
+
+ for (j = idx_start; j < idx_end; j++) {
+ vtx_id = mesh->i_face_vtx_lst[j] - 1;
+ if (i_face_val[i] > vtx_val[vtx_id])
+ vtx_val[vtx_id] = i_face_val[i];
+ }
+
+ } /* End of loop on internal faces */
+
+ } /* If there are values to distribute */
+
+ if (b_face_val != NULL && mesh->b_face_vtx_idx != NULL) {
+
+ for (i = 0; i < mesh->n_b_faces; i++) {
+
+ idx_start = mesh->b_face_vtx_idx[i] - 1;
+ idx_end = mesh->b_face_vtx_idx[i + 1] - 1;
+
+ for (j = idx_start; j < idx_end; j++) {
+ vtx_id = mesh->b_face_vtx_lst[j] - 1;
+ if (b_face_val[i] > vtx_val[vtx_id])
+ vtx_val[vtx_id] = b_face_val[i];
+ }
+
+ } /* End of loop on border faces */
+
+ } /* If there are values to distribute */
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Evaluate face warping angle for internal and border faces..
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * i_face_normal <-- internal face normal
+ * b_face_normal <-- border face normal
+ * i_face_warping --> face warping angle for internal faces
+ * b_face_warping --> face warping angle for border faces
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quality_compute_warping(const cs_mesh_t *mesh,
+ const cs_real_t i_face_normal[],
+ const cs_real_t b_face_normal[],
+ cs_real_t i_face_warping[],
+ cs_real_t b_face_warping[])
+{
+ cs_int_t i, face_id, idx_start, idx_end;
+ cs_real_t this_face_normal[3];
+
+ const cs_int_t dim = mesh->dim;
+ const cs_int_t *i_face_vtx_idx = mesh->i_face_vtx_idx;
+ const cs_int_t *b_face_vtx_idx = mesh->b_face_vtx_idx;
+
+ assert(dim == 3);
+
+ /* Compute warping for internal faces */
+ /*------------------------------------*/
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+
+ /* Get normal to the face */
+
+ for (i = 0; i < dim; i++)
+ this_face_normal[i] = i_face_normal[face_id*dim + i];
+
+ /* Evaluate warping for each edge of face. Keep the max. */
+
+ idx_start = i_face_vtx_idx[face_id] - 1;
+ idx_end = i_face_vtx_idx[face_id + 1] - 1;
+
+ _get_face_warping(idx_start,
+ idx_end,
+ this_face_normal,
+ mesh->i_face_vtx_lst,
+ mesh->vtx_coord,
+ &(i_face_warping[face_id]));
+
+ } /* End of loop on internal faces */
+
+ /* Compute warping for border faces */
+ /*----------------------------------*/
+
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++) {
+
+ /* Get face normal */
+
+ for (i = 0; i < dim; i++)
+ this_face_normal[i] = b_face_normal[face_id*dim + i];
+
+ /* Evaluate warping for each edge */
+
+ idx_start = b_face_vtx_idx[face_id] - 1;
+ idx_end = b_face_vtx_idx[face_id + 1] - 1;
+
+ _get_face_warping(idx_start,
+ idx_end,
+ this_face_normal,
+ mesh->b_face_vtx_lst,
+ mesh->vtx_coord,
+ &(b_face_warping[face_id]));
+
+ } /* End of loop on border faces */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute mesh quality indicators
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure.
+ * mesh_quantities <-- pointer to mesh quantities structure.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quality(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities)
+{
+ cs_int_t i;
+
+ cs_bool_t compute_volume = true;
+ cs_bool_t compute_weighting = true;
+ cs_bool_t compute_orthogonality = true;
+ cs_bool_t compute_warping = true;
+ cs_bool_t vol_fields = false;
+ cs_bool_t brd_fields = false;
+
+ cs_real_t *face_to_cell = NULL;
+ cs_real_t *face_to_vtx = NULL;
+
+ double *working_array = NULL;
+
+ const cs_int_t n_vertices = mesh->n_vertices;
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t n_b_faces = mesh->n_b_faces;
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_cells_wghosts = mesh->n_cells_with_ghosts;
+
+ /* Check input data */
+
+ assert(mesh_quantities->i_face_normal != NULL);
+ assert(mesh_quantities->i_face_cog != NULL);
+ assert(mesh_quantities->cell_cen != NULL);
+ assert(mesh_quantities->cell_vol != NULL);
+
+ /* Determine if resulting fields should be exported on the volume
+ and border meshes (depending on their existence); */
+
+ /* Note that n_vertices or n_cells should never be zero on any
+ rank (unlike n_fbr), so if face_to_cell/face_to_vtx is allocated
+ on any rank, it should be allocated on all ranks;
+ We can thus use this pointer for tests safely */
+
+ /* TODO:
+ define an option to distribute face values to cells, vertices, or both */
+
+ if (cs_post_mesh_exists(-1)) {
+ vol_fields = true;
+ BFT_MALLOC(face_to_cell, CS_MAX(n_cells_wghosts, n_vertices), cs_real_t);
+ face_to_vtx = face_to_cell;
+ }
+
+ if (cs_post_mesh_exists(-2))
+ brd_fields = true;
+
+ /* TODO
+ For the moment, we export the mesh at this stage; this should be moved
+ once PSTEMA has been moved from CALTRI to an earlier step. */
+
+ cs_post_write_meshes(1,0);
+
+ cs_post_activate_writer(0, 1);
+
+ /* Evaluate mesh quality criteria */
+ /*--------------------------------*/
+
+ /*--------------*/
+ /* Face warping */
+ /*--------------*/
+
+ if (compute_warping == true) {
+
+ double *i_face_warping = NULL, *b_face_warping = NULL;
+
+ BFT_MALLOC(working_array, n_i_faces + n_b_faces, double);
+
+ for (i = 0; i < n_i_faces + n_b_faces; i++)
+ working_array[i] = 0.;
+
+ i_face_warping = working_array;
+ b_face_warping = working_array + n_i_faces;
+
+ cs_mesh_quality_compute_warping(mesh,
+ mesh_quantities->i_face_normal,
+ mesh_quantities->b_face_normal,
+ i_face_warping,
+ b_face_warping);
+
+ /* Display histograms */
+
+ bft_printf(_("\n Histogram of the interior faces warping:\n\n"));
+ _int_face_histogram(mesh, i_face_warping);
+
+ if (mesh->n_g_b_faces > 0) {
+
+ bft_printf(_("\n Histogram of the boundary faces warping:\n\n"));
+ _histogram(n_b_faces, b_face_warping);
+
+ }
+
+ /* Post processing */
+
+ if (vol_fields == true) {
+
+ if (face_to_cell != NULL) {
+
+ _cell_from_max_face(mesh,
+ 0.,
+ i_face_warping,
+ b_face_warping,
+ face_to_cell);
+
+ cs_post_write_var(-1,
+ "Face_Warp_c_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_cell,
+ NULL,
+ NULL);
+
+ }
+ if (face_to_vtx != NULL) {
+
+ _vtx_from_max_face(mesh,
+ 0.,
+ i_face_warping,
+ b_face_warping,
+ face_to_vtx);
+
+ cs_post_write_vertex_var(-1,
+ "Face_Warp_v_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_vtx);
+ }
+
+ } /* End of post-processing on volume */
+
+ if (brd_fields == true)
+ cs_post_write_var(-2,
+ "Face_Warp",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ NULL,
+ NULL,
+ b_face_warping);
+
+ BFT_FREE(working_array);
+
+ } /* End of face warping treatment */
+
+ /*----------------------------------------------*/
+ /* Weighting and center offsetting coefficients */
+ /*----------------------------------------------*/
+
+ if (compute_weighting == true) {
+
+ double *weighting = NULL, *offsetting = NULL;
+
+ /* Only defined on internal faces */
+
+ BFT_MALLOC(working_array, 2*n_i_faces, double);
+
+ for (i = 0; i < 2*n_i_faces; i++)
+ working_array[i] = 0.;
+
+ weighting = working_array;
+ offsetting = working_array + n_i_faces;
+
+ _compute_weighting_offsetting(mesh,
+ mesh_quantities,
+ weighting,
+ offsetting);
+
+ /* Display histograms */
+
+ bft_printf(_("\n Histogram of the interior faces "
+ "weighting coefficient:\n\n"));
+ _int_face_histogram(mesh, weighting);
+
+ bft_printf(_("\n Histogram of the interior faces "
+ "off-centering coefficient:\n\n"));
+ _int_face_histogram(mesh, offsetting);
+
+ /* Post processing */
+
+ if (vol_fields == true) {
+
+ if (face_to_cell != NULL) {
+
+ _cell_from_max_face(mesh, 0.5, weighting, NULL, face_to_cell);
+ cs_post_write_var(-1,
+ "Weighting_c_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_cell,
+ NULL,
+ NULL);
+
+ }
+ if (face_to_vtx != NULL) {
+
+ _vtx_from_max_face(mesh, 0.5, weighting, NULL, face_to_vtx);
+ cs_post_write_vertex_var(-1,
+ "Weighting_v_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_vtx);
+
+ }
+ if (face_to_cell != NULL) {
+
+ _cell_from_max_face(mesh, 0., offsetting, NULL, face_to_cell);
+ cs_post_write_var(-1,
+ "Offset_c_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_cell,
+ NULL,
+ NULL);
+
+ }
+ if (face_to_vtx != NULL) {
+
+ _vtx_from_max_face(mesh, 0., offsetting, NULL, face_to_vtx);
+ cs_post_write_vertex_var(-1,
+ "Offset_v_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_vtx);
+
+ }
+
+ } /* End of post-processing on volume */
+
+ BFT_FREE(working_array);
+
+ } /* End of off-setting and weighting treatment */
+
+ /*---------------------*/
+ /* Angle orthogonality */
+ /*---------------------*/
+
+ if (compute_orthogonality == true) {
+
+ double *i_face_ortho = NULL, *b_face_ortho = NULL;
+
+ BFT_MALLOC(working_array, n_i_faces + n_b_faces, double);
+
+ for (i = 0; i < n_i_faces + n_b_faces; i++)
+ working_array[i] = 0.;
+
+ i_face_ortho = working_array;
+ b_face_ortho = working_array + n_i_faces;
+
+ _compute_orthogonality(mesh,
+ mesh_quantities,
+ i_face_ortho,
+ b_face_ortho);
+
+ /* Display histograms */
+
+ bft_printf(_("\n Histogram of the interior faces "
+ "non-orthogonality coefficient (in degrees):\n\n"));
+ _int_face_histogram(mesh, i_face_ortho);
+
+ if (mesh->n_g_b_faces > 0) {
+
+ bft_printf(_("\n Histogram of the boundary faces "
+ "non-orthogonality coefficient (in degrees):\n\n"));
+ _histogram(n_b_faces, b_face_ortho);
+
+ }
+
+ /* Post processing */
+
+ if (vol_fields == true) {
+
+ if (face_to_cell != NULL) {
+
+ _cell_from_max_face(mesh, 0., i_face_ortho, b_face_ortho, face_to_cell);
+ cs_post_write_var(-1,
+ "Non_Ortho_c_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_cell,
+ NULL,
+ NULL);
+
+ }
+ if (face_to_vtx != NULL) {
+
+ _vtx_from_max_face(mesh, 0., i_face_ortho, b_face_ortho, face_to_vtx);
+ cs_post_write_vertex_var(-1,
+ "Non_Ortho_v_max",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ face_to_vtx);
+ }
+
+ } /* End of post-processing on volume */
+
+ if (brd_fields == true)
+ cs_post_write_var(-2,
+ "Non_Ortho",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ NULL,
+ NULL,
+ b_face_ortho);
+
+ BFT_FREE(working_array);
+
+ } /* End of non-orthogonality treatment */
+
+ if (face_to_cell != NULL)
+ BFT_FREE(face_to_cell);
+
+ /*-------------*/
+ /* Cell volume */
+ /*-------------*/
+
+ if (compute_volume == true) {
+
+ /* Display histograms */
+
+ bft_printf(_("\n Histogram of cell volumes:\n\n"));
+ _histogram(n_cells, mesh_quantities->cell_vol);
+
+ /* Post processing */
+
+ if (vol_fields == true)
+ cs_post_write_var(-1,
+ "Cell_Volume",
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ mesh_quantities->cell_vol,
+ NULL,
+ NULL);
+
+ } /* End of cell volume treatment */
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+/* Delete local macros */
+
+#undef _CROSS_PRODUCT_3D
+#undef _DOT_PRODUCT_3D
+#undef _MODULE_3D
+#undef _COSINE_3D
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh_quantities.c b/src/base/cs_mesh_quantities.c
new file mode 100644
index 0000000..ee8e758
--- /dev/null
+++ b/src/base/cs_mesh_quantities.c
@@ -0,0 +1,1323 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of mesh quantities
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <math.h>
+#include <float.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_mesh_connect.h"
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh_quantities.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+enum {X, Y, Z};
+
+#define _CS_CROSS_PRODUCT(prod_vect, vect1, vect2) \
+ (prod_vect[X] = vect1[Y] * vect2[Z] - vect2[Y] * vect1[Z], \
+ prod_vect[Y] = vect2[X] * vect1[Z] - vect1[X] * vect2[Z], \
+ prod_vect[Z] = vect1[X] * vect2[Y] - vect2[X] * vect1[Y])
+
+#define _CS_DOT_PRODUCT(vect1, vect2) \
+ (vect1[X] * vect2[X] + vect1[Y] * vect2[Y] + vect1[Z] * vect2[Z])
+
+#define _CS_MODULE(vect) \
+ sqrt(vect[X] * vect[X] + vect[Y] * vect[Y] + vect[Z] * vect[Z])
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Pointer to cs_mesh_quantities_t structure for the main mesh */
+
+cs_mesh_quantities_t *cs_glob_mesh_quantities = NULL;
+
+/* Choice of the algorithm for computing gravity centres of the cells */
+
+static int cs_glob_mesh_quantities_cell_cen = 0;
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute quantities associated to faces (border or internal)
+ *
+ * parameters:
+ * dim <-- dimension
+ * n_faces <-- number of faces
+ * vtx_coord <-- vertex coordinates
+ * face_vtx_idx <-- "face -> vertices" connectivity index
+ * face_vtx_lst <-- "face -> vertices" connectivity list
+ * face_normal --> surface normal of the face
+ *
+ *
+ * Pi+1
+ * *---------* B : barycentre of the polygon
+ * / . . \
+ * / . . \ Pi : vertices of the polygon
+ * / . . \
+ * / . . Ti \ Ti : triangle
+ * *.........B.........* Pi
+ * Pn-1 \ . . /
+ * \ . . /
+ * \ . . /
+ * \ . T0 . /
+ * *---------*
+ * P0
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_face_normal(cs_int_t dim,
+ cs_int_t n_faces,
+ const cs_real_t vtx_coord[],
+ const cs_int_t face_vtx_idx[],
+ const cs_int_t face_vtx_lst[],
+ cs_real_t face_normal[])
+{
+ cs_int_t i, face_id, tri_id, vtx_id, start_id, end_id, shift;
+ cs_int_t n_face_vertices, n_max_face_vertices;
+ cs_point_t this_face_normal, this_face_barycentre;
+ cs_point_t vect1, vect2;
+
+ cs_point_t *face_vtx_coord = NULL;
+ cs_point_t *triangle_normal = NULL;
+
+ /* Return if there is not enough data (SolCom case except radiative
+ module or Pre-processor 1.2.d without "-n" option) */
+
+ if (face_vtx_idx == NULL && face_vtx_lst == NULL)
+ return;
+
+ /* Checking */
+
+ if (dim != 3)
+ bft_error(__FILE__, __LINE__,0,
+ _("Face geometric quantities computation is only\n"
+ "implemented in 3D."));
+
+ assert(face_normal != NULL || n_faces == 0);
+
+ /* Counting and allocation */
+
+ n_max_face_vertices = 0;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ n_face_vertices = face_vtx_idx[face_id + 1] - face_vtx_idx[face_id];
+ if (n_max_face_vertices <= n_face_vertices)
+ n_max_face_vertices = n_face_vertices;
+ }
+
+ BFT_MALLOC(face_vtx_coord, n_max_face_vertices + 1, cs_point_t);
+ BFT_MALLOC(triangle_normal, n_max_face_vertices, cs_point_t);
+
+ /* Loop on each face */
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+
+ /* Initialization */
+
+ n_face_vertices = 0;
+
+ start_id = face_vtx_idx[face_id] - 1;
+ end_id = face_vtx_idx[face_id + 1] - 1;
+
+ for (i = 0; i < 3; i++)
+ this_face_normal[i] = 0.0;
+
+ /* Define the polygon (P) according to the vertices (Pi) of the face */
+
+ for (vtx_id = start_id; vtx_id < end_id; vtx_id++) {
+
+ shift = 3 * (face_vtx_lst[vtx_id] - 1);
+ for (i = 0; i < 3; i++)
+ face_vtx_coord[n_face_vertices][i] = vtx_coord[shift + i];
+ n_face_vertices++;
+
+ }
+
+ for (i = 0; i < 3; i++)
+ face_vtx_coord[n_face_vertices][i] = face_vtx_coord[0][i];
+
+ /* Compute the barycentre of the face */
+
+ for (i = 0; i < 3; i++) {
+
+ this_face_barycentre[i] = 0.0;
+ for (vtx_id = 0; vtx_id < n_face_vertices; vtx_id++)
+ this_face_barycentre[i] += face_vtx_coord[vtx_id][i];
+ this_face_barycentre[i] /= n_face_vertices;
+
+ }
+
+ /* Loop on the triangles of the face (defined by an edge of the face
+ and its barycentre) */
+
+ for (tri_id = 0 ; tri_id < n_face_vertices ; tri_id++) {
+
+ /*----------------------------------------------------------------------*/
+ /* Computation of the normal of each triangle Ti : */
+ /* */
+ /* -> --> --> */
+ /* N(Ti) = 1/2 ( BPi X BPi+1 ) */
+ /*----------------------------------------------------------------------*/
+
+ for (i = 0; i < 3; i++) {
+ vect1[i] = face_vtx_coord[tri_id ][i] - this_face_barycentre[i];
+ vect2[i] = face_vtx_coord[tri_id + 1][i] - this_face_barycentre[i];
+ }
+
+ _CS_CROSS_PRODUCT(triangle_normal[tri_id], vect1, vect2);
+
+ for (i = 0; i < 3; i++)
+ triangle_normal[tri_id][i] *= 0.5;
+
+ /*----------------------------------------------------------------------*/
+ /* Computation of the normal of the polygon */
+ /* => vectorial sum of normals of each triangle */
+ /* */
+ /* -> n-1 -> */
+ /* N(P) = Sum ( N(Ti) ) */
+ /* i=0 */
+ /*----------------------------------------------------------------------*/
+
+ for (i = 0; i < 3; i++)
+ this_face_normal[i] += triangle_normal[tri_id][i];
+
+ } /* End of loop on triangles of the face */
+
+ /* Store result in appropriate structure */
+
+ for (i = 0; i < 3; i++)
+ face_normal[face_id * 3 + i] = this_face_normal[i];
+
+ } /* End of loop on faces */
+
+ BFT_FREE(triangle_normal);
+ BFT_FREE(face_vtx_coord);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute quantities associated to faces (border or internal)
+ *
+ * parameters:
+ * dim <-- dimension
+ * n_faces <-- number of faces
+ * vtx_coord <-- vertex coordinates
+ * face_vtx_idx <-- "face -> vertices" connectivity index
+ * face_vtx_lst <-- "face -> vertices" connectivity list
+ * face_cog --> coordinates of the centre of gravity of the faces
+ * face_norm --> surface normal of the face
+ *
+ *
+ * Pi+1
+ * *---------* B : barycentre of the polygon
+ * / . . \
+ * / . . \ Pi : vertices of the polygon
+ * / . . \
+ * / . . Ti \ Ti : triangle
+ * *.........B.........* Pi
+ * Pn-1 \ . . /
+ * \ . . /
+ * \ . . /
+ * \ . T0 . /
+ * *---------*
+ * P0
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_face_quantities(const cs_int_t dim,
+ const cs_int_t n_faces,
+ const cs_real_t vtx_coord[],
+ const cs_int_t face_vtx_idx[],
+ const cs_int_t face_vtx_lst[],
+ cs_real_t face_cog[],
+ cs_real_t face_norm[])
+{
+ cs_int_t i, fac_id, tri_id;
+ cs_int_t vtx_id, lower_vtx_id, upper_vtx_id;
+ cs_int_t n_face_vertices, n_max_face_vertices;
+ cs_int_t lower_coord_id;
+ cs_real_t face_surface, tri_surface;
+ cs_real_t face_vol_part, tri_vol_part, rectif_cog;
+ cs_point_t face_barycentre, face_normal;
+ cs_point_t face_centre, tri_centre;
+ cs_point_t vect1, vect2;
+
+ cs_point_t *face_vtx_coord = NULL;
+ cs_point_t *triangle_norm = NULL;
+
+ /* Return if there is not enough data (SolCom case except radiative
+ module or Pre-processor 1.2.d without "-n" option) */
+
+ if (face_vtx_idx == NULL && face_vtx_lst == NULL)
+ return;
+
+ /* Checking */
+
+ if (dim != 3)
+ bft_error(__FILE__, __LINE__,0,
+ _("Face geometric quantities computation is only\n"
+ "implemented in 3D."));
+
+ assert(face_cog != NULL || n_faces == 0);
+ assert(face_norm != NULL || n_faces == 0);
+
+ /* Counting and allocation */
+
+ n_max_face_vertices = 0;
+
+ for (fac_id = 0; fac_id < n_faces; fac_id++) {
+ n_face_vertices = face_vtx_idx[fac_id + 1] - face_vtx_idx[fac_id];
+ if (n_max_face_vertices <= n_face_vertices)
+ n_max_face_vertices = n_face_vertices;
+ }
+
+ BFT_MALLOC(face_vtx_coord, n_max_face_vertices + 1, cs_point_t);
+ BFT_MALLOC(triangle_norm, n_max_face_vertices, cs_point_t);
+
+ /*=========================================================================*/
+ /* Loop on faces */
+ /*=========================================================================*/
+
+ for (fac_id = 0; fac_id < n_faces; fac_id++) {
+
+ tri_vol_part = 0.;
+ face_surface = 0.0;
+
+ /* Define the polygon (P) according to the vertices (Pi) of the face */
+
+ lower_vtx_id = face_vtx_idx[fac_id] - 1;
+ upper_vtx_id = face_vtx_idx[fac_id + 1] - 1;
+
+ n_face_vertices = 0;
+
+ for (vtx_id = lower_vtx_id; vtx_id < upper_vtx_id; vtx_id++) {
+
+ lower_coord_id = 3 * (face_vtx_lst[vtx_id] - 1);
+
+ for (i = X; i < 3; i++)
+ face_vtx_coord[n_face_vertices][i] = vtx_coord[lower_coord_id + i];
+
+ n_face_vertices++;
+
+ }
+
+ for (i = X; i < 3; i++)
+ face_vtx_coord[n_face_vertices][i] = face_vtx_coord[0][i];
+
+ /*------------------------------------------------------------------------
+ * Compute barycentre (B) coordinates for the polygon (P)
+ *
+ * --> 1 n-1 -->
+ * OB = - Somme OPi
+ * n i=0
+ *------------------------------------------------------------------------*/
+
+ for (i = X; i < 3; i++) {
+
+ face_barycentre[i] = 0.0;
+
+ for (vtx_id = 0; vtx_id < n_face_vertices; vtx_id++)
+ face_barycentre[i] += face_vtx_coord[vtx_id][i];
+
+ face_barycentre[i] /= n_face_vertices;
+
+ }
+
+ for (i = X; i < 3; i++) {
+ face_normal[i] = 0.0;
+ face_centre[i] = 0.0;
+ }
+
+ /* First loop on triangles of the face (computation of surface normals) */
+ /*========================================================================*/
+
+ for (tri_id = 0 ; tri_id < n_face_vertices ; tri_id++) {
+
+ /*----------------------------------------------------------------------
+ * Computation of the normal of the triangle Ti :
+ *
+ * -> --> -->
+ * N(Ti) = 1/2 ( BPi X BPi+1 )
+ *----------------------------------------------------------------------*/
+
+ for (i = X; i < 3; i++) {
+ vect1[i] = face_vtx_coord[tri_id ][i] - face_barycentre[i];
+ vect2[i] = face_vtx_coord[tri_id + 1][i] - face_barycentre[i];
+ }
+
+ _CS_CROSS_PRODUCT(triangle_norm[tri_id], vect1, vect2);
+
+ for (i = X; i < 3; i++)
+ triangle_norm[tri_id][i] *= 0.5;
+
+ /*----------------------------------------------------------------------
+ * Computation of the normal of the polygon
+ * => vector sum of normals of triangles
+ *
+ * -> n-1 ->
+ * N(P) = Sum ( N(Ti) )
+ * i=0
+ *----------------------------------------------------------------------*/
+
+ for (i = X; i < 3; i++)
+ face_normal[i] += triangle_norm[tri_id][i];
+
+ } /* End of loop on triangles of the face */
+
+ /* Second loop on triangles of the face (for the barycentre) */
+ /*==================================================================*/
+
+ for (tri_id = 0; tri_id < n_face_vertices; tri_id++) {
+
+ /*----------------------------------------------------------------------
+ * Compation of the gravity centre G(Ti) of each triangle (Ti)
+ *
+ * --> --> --> -->
+ * OG(Ti) = 1/3 ( OB + OPi + OPi+1 )
+ *
+ * And their part in the volume of Ti
+ *
+ * --> ->
+ * OG(Ti).N(Ti)
+ *----------------------------------------------------------------------*/
+
+ for (i = X; i < 3; i++) {
+
+ tri_centre[i] = face_barycentre[i]
+ + face_vtx_coord[tri_id ][i]
+ + face_vtx_coord[tri_id + 1][i];
+
+ tri_centre[i] /= 3.0;
+
+ tri_vol_part += (tri_centre[i] * triangle_norm[tri_id][i]);
+
+ }
+
+ /*----------------------------------------------------------------------
+ * Computation of the area of Ti (norm of the surface normal)
+ *
+ * ->
+ * Surf(Ti) = | N(Ti) |
+ *----------------------------------------------------------------------*/
+
+ tri_surface = _CS_MODULE(triangle_norm[tri_id]);
+
+ if (_CS_DOT_PRODUCT(triangle_norm[tri_id], face_normal) < 0.0)
+ tri_surface *= -1.0;
+
+ face_surface += tri_surface;
+
+ /*----------------------------------------------------------------------
+ * n-1
+ * Sum Surf(Ti) G(Ti)
+ * i=0
+ *----------------------------------------------------------------------*/
+
+ for (i = X; i < 3; i++)
+ face_centre[i] += tri_surface * tri_centre[i];
+
+ } /* End of second loop on triangles of the face */
+
+ /*------------------------------------------------------------------------
+ * Compute the centre of gravity G(P) of the polygon P :
+ *
+ * n-1
+ * Sum Surf(Ti) G(Ti)
+ * i=0
+ * G(P) = -----------------------
+ * n-1
+ * Sum Surf(Ti)
+ * i=0
+ *
+ * Computation of the part of volume of the polygon (before rectification)
+ *
+ * --> ->
+ * OG(P).N(P)
+ *------------------------------------------------------------------------*/
+
+ face_vol_part = 0.0;
+
+ for (i = X; i < 3; i++) {
+ face_centre[i] = face_centre[i] / face_surface;
+ face_vol_part += (face_centre[i] * face_normal[i]);
+ }
+
+ rectif_cog = (tri_vol_part - face_vol_part) / (face_surface * face_surface);
+
+ for (i = X; i < 3; i++)
+ face_centre[i] += rectif_cog * face_normal[i];
+
+ /* Store result in appropriate structure */
+
+ for (i = X; i < 3; i++) {
+ face_cog[fac_id * 3 + i] = face_centre[i];
+ face_norm[fac_id * 3 + i] = face_normal[i];
+ }
+
+ } /* End of loop on faces */
+
+ BFT_FREE(triangle_norm);
+ BFT_FREE(face_vtx_coord);
+
+}
+
+/*----------------------------------------------------------------------------*
+ * Compute centre of gravity of cells C from their vertices S(i) where
+ * i=0, n-1
+ *
+ * --> 1 n-1 -->
+ * OB(C) = --- Sum OSi
+ * n i=0
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * cell_cen --> centre of gravity of cells
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_cell_cen_vertex(const cs_mesh_t *const mesh,
+ cs_real_t cell_cen[])
+{
+ cs_int_t i, j, k, cell_id, fac_id, vtx_id;
+ cs_int_t face_num, vtx_counter;
+
+ cs_int_t *vtx_tag = NULL;
+ cs_int_t *_face_vtx_idx = NULL, *_face_vtx_lst = NULL;
+ cs_int_t *cell_faces_idx = NULL, *cell_faces_lst = NULL;
+
+ /* Return if there is not enough data (Solcom case except radiative module) */
+
+ if (mesh->i_face_vtx_lst == NULL && mesh->b_face_vtx_lst == NULL)
+ return;
+
+ /* Checking */
+
+ if (mesh->dim != 3)
+ bft_error(__FILE__, __LINE__,0,
+ _("Cell centre computation is only implemented in 3D."));
+
+ assert(cell_cen != NULL);
+
+ /* Allocation and initialization */
+
+ BFT_MALLOC(vtx_tag, mesh->n_vertices, cs_int_t);
+
+ for (vtx_id = 0 ; vtx_id < mesh->n_vertices ; vtx_id++)
+ vtx_tag[vtx_id] = -1;
+
+ /* Initialization */
+
+ for (j = 0; j < mesh->n_cells_with_ghosts; j++)
+ for (i = 0; i < 3; i++)
+ cell_cen[3*j + i] = 0. ;
+
+ /* Extract "cell -> faces" connectivity */
+
+ cs_mesh_connect_get_cell_faces(mesh,
+ mesh->n_cells,
+ NULL,
+ &cell_faces_idx,
+ &cell_faces_lst);
+
+ /* Loop on cells */
+ /* ------------- */
+
+ for (cell_id = 0; cell_id < mesh->n_cells; cell_id++) {
+
+ vtx_counter = 0;
+
+ /* Loop on faces of the cell */
+
+ for (j = cell_faces_idx[cell_id]; j < cell_faces_idx[cell_id + 1]; j++) {
+
+ face_num = cell_faces_lst[j - 1];
+
+ /* Internal or border face */
+
+ if (face_num > mesh->n_b_faces) {
+ fac_id = face_num - mesh->n_b_faces - 1;
+ _face_vtx_idx = mesh->i_face_vtx_idx;
+ _face_vtx_lst = mesh->i_face_vtx_lst;
+ }
+ else {
+ fac_id = face_num - 1;
+ _face_vtx_idx = mesh->b_face_vtx_idx;
+ _face_vtx_lst = mesh->b_face_vtx_lst;
+ }
+
+ /* Loop on vertices of the face */
+
+ for (k = _face_vtx_idx[fac_id]-1; k < _face_vtx_idx[fac_id + 1]-1; k++) {
+
+ vtx_id = _face_vtx_lst[k] - 1;
+
+ if (vtx_tag[vtx_id] < cell_id) {
+ for (i = 0 ; i < 3 ; i++)
+ cell_cen[cell_id*3 + i] += mesh->vtx_coord[vtx_id*3 + i];
+ vtx_counter += 1;
+ vtx_tag[vtx_id] = cell_id;
+ }
+
+ }
+
+ } /* End of loop on faces of the cell */
+
+ for (i = 0; i < 3; i++)
+ cell_cen[cell_id*3 + i] /= (double)vtx_counter;
+
+ } /* End of loop on cells */
+
+ /* Free memory */
+
+ BFT_FREE(vtx_tag);
+ BFT_FREE(cell_faces_idx);
+ BFT_FREE(cell_faces_lst);
+
+}
+
+/*----------------------------------------------------------------------------*
+ * Compute centre of gravity of cells C from their faces F(i) where i=0, n-1
+ *
+ * n-1
+ * Sum Surf(Fi) G(Fi)
+ * i=0
+ * G(C) = -----------------------
+ * n-1
+ * Sum Surf(Fi)
+ * i=0
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * i_face_norm <-- surface normal of internal faces
+ * i_face_cog <-- centre of gravity of internal faces
+ * b_face_norm <-- surface normal of border faces
+ * b_face_cog <-- centre of gravity of border faces
+ * cell_cen --> centre of gravity of cells
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_cell_cen_face(const cs_mesh_t *const mesh,
+ const cs_real_t i_face_norm[],
+ const cs_real_t i_face_cog[],
+ const cs_real_t b_face_norm[],
+ const cs_real_t b_face_cog[],
+ cs_real_t cell_cen[])
+{
+ cs_int_t i, j, fac_id, cell_id, cell_id1, cell_id2;
+ cs_real_t area;
+ cs_real_t _norm[3];
+
+ cs_real_t *cell_area = NULL;
+
+ /* Mesh connectivity */
+
+ const cs_int_t dim = mesh->dim;
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t n_b_faces = mesh->n_b_faces;
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_cells_with_ghosts = mesh->n_cells_with_ghosts;
+ const cs_int_t *i_face_cells = mesh->i_face_cells;
+ const cs_int_t *b_face_cells = mesh->b_face_cells;
+
+ /* Return if ther is not enough data (Solcom case except rediative module
+ or Pre-processor 1.2.d without option "-n") */
+
+ if (mesh->i_face_vtx_lst == NULL && mesh->b_face_vtx_lst == NULL)
+ return;
+
+ /* Checking */
+
+ if (dim != 3)
+ bft_error(__FILE__, __LINE__,0,
+ _("Cell centre computation is only implemented in 3D."));
+
+ assert(cell_cen != NULL);
+
+ /* Initialization */
+
+ BFT_MALLOC(cell_area, n_cells_with_ghosts, cs_real_t);
+
+ for (j = 0; j < n_cells_with_ghosts; j++) {
+
+ cell_area[j] = 0.;
+
+ for (i = 0; i < dim; i++)
+ cell_cen[dim*j + i] = 0. ;
+
+ }
+
+ /* ---------------------- */
+ /* Loop on internal faces */
+ /* ---------------------- */
+
+ for (fac_id = 0; fac_id < n_i_faces; fac_id++) {
+
+ /* ----------------------------------------------------------
+ * For each cell sharing the internal face, we update
+ * cell_cen and cell_area
+ * ---------------------------------------------------------- */
+
+ cell_id1 = i_face_cells[2*fac_id ] - 1;
+ cell_id2 = i_face_cells[2*fac_id + 1] - 1;
+
+ /* Computation of the area of the face */
+
+ for (i = 0; i < dim; i++)
+ _norm[i] = i_face_norm[dim*fac_id + i];
+
+ area = _CS_MODULE(_norm);
+
+ cell_area[cell_id1] += area;
+ cell_area[cell_id2] += area;
+
+ /* Computation of the numerator */
+
+ for (i = 0; i < dim; i++) {
+ cell_cen[dim*cell_id1 + i] += i_face_cog[dim*fac_id + i]*area;
+ cell_cen[dim*cell_id2 + i] += i_face_cog[dim*fac_id + i]*area;
+ }
+
+ } /* End of loop on internal faces */
+
+ /* -------------------- */
+ /* Loop on border faces */
+ /* -------------------- */
+
+ for (fac_id = 0; fac_id < n_b_faces; fac_id++) {
+
+ /* -------------------------------------------------------------
+ * For each cell sharing a border face, we update the numerator
+ * of cell_cen and cell_area
+ * ------------------------------------------------------------- */
+
+ cell_id1 = b_face_cells[fac_id] - 1;
+
+ /* Computation of the area of the face */
+
+ for (i = 0; i < dim; i++)
+ _norm[i] = b_face_norm[dim*fac_id + i];
+
+ area = _CS_MODULE(_norm);
+ cell_area[cell_id1] += area;
+
+ /* Computation of the numerator */
+
+ for (i = 0; i < dim; i++)
+ cell_cen[dim*cell_id1 + i] += b_face_cog[dim*fac_id + i]*area;
+
+ } /* End of loop on border faces */
+
+ /* ------------------------------------------------------------------
+ * Loop on cells to finalize the computation of centre of gravity
+ * ------------------------------------------------------------------*/
+
+ for (cell_id = 0; cell_id < n_cells; cell_id++) {
+
+ for (i = 0; i < dim; i++)
+ cell_cen[cell_id*dim + i] /= cell_area[cell_id];
+
+ } /* End of loop on cells */
+
+ /* Free memory */
+
+ BFT_FREE(cell_area);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the volume of cells C from their n faces F(i) and their center of
+ * gravity G(Fi) where i=0, n-1
+ *
+ * 1 n-1
+ * G(C) = - . Sum Surf(Fi) G(Fi)
+ * 3 i=0
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * i_face_norm <-- surface normal of internal faces
+ * i_face_cog <-- centre of gravity of internal faces
+ * b_face_norm <-- surface normal of border faces
+ * b_face_cog <-- centre of gravity of border faces
+ * cell_cen --> centre of gravity of cells
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_cell_volume(const cs_mesh_t *const mesh,
+ const cs_real_t i_face_norm[],
+ const cs_real_t i_face_cog[],
+ const cs_real_t b_face_norm[],
+ const cs_real_t b_face_cog[],
+ cs_real_t cell_vol[])
+{
+ cs_int_t id1, id2, i, fac_id, cell_id;
+
+ cs_real_t flux = 0;
+
+ const cs_real_t a_third = 1.0/3.0;
+ const cs_int_t dim = mesh->dim;
+
+ /* Initialization */
+
+ for (cell_id = 0; cell_id < mesh->n_cells_with_ghosts; cell_id++)
+ cell_vol[cell_id] = 0;
+
+ /* Loop on internal faces */
+
+ for (fac_id = 0; fac_id < mesh->n_i_faces; fac_id++) {
+
+ id1 = mesh->i_face_cells[2*fac_id] - 1;
+ id2 = mesh->i_face_cells[2*fac_id + 1] - 1;
+
+ flux = 0;
+ for (i = 0; i < dim; i++)
+ flux += i_face_norm[dim*fac_id + i] * i_face_cog[dim*fac_id + i];
+
+ cell_vol[id1] += flux;
+ cell_vol[id2] -= flux;
+
+ }
+
+ /* Loop on border faces */
+
+ for (fac_id = 0; fac_id < mesh->n_b_faces; fac_id++) {
+
+ id1 = mesh->b_face_cells[fac_id] - 1;
+
+ flux = 0;
+ for (i = 0; i < dim; i++)
+ flux += b_face_norm[dim*fac_id + i] * b_face_cog[dim*fac_id + i];
+
+ cell_vol[id1] += flux;
+
+ }
+
+ /* Computation of the volume */
+
+ for (cell_id = 0; cell_id < mesh->n_cells; cell_id++)
+ cell_vol[cell_id] *= a_third;
+
+}
+
+/*============================================================================
+ * Public functions definition for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Query or modification of the option for computing cell centers.
+ *
+ * This function returns 1 or 2 according to the selected algorithm.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE ALGCEN (IOPT)
+ * *****************
+ *
+ * INTEGER IOPT : <-> : Choice of the algorithm
+ * < 0 : query
+ * 0 : computation based
+ * on faces (default choice)
+ * 1 : computation based
+ * on vertices
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (algcen, ALGCEN) (cs_int_t *const iopt)
+{
+ int iopt_ret = cs_mesh_quantities_cell_cen_choice((int)(*iopt));
+
+ *iopt = iopt_ret;
+}
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Query or modification of the option for computing cell centers.
+ *
+ * < 0 : query
+ * 0 : computation based on faces (default choice)
+ * 1 : computation based on vertices
+ *
+ * algo_choice <-- choice of algorithm to compute cell centers.
+ *
+ * returns:
+ * 1 or 2 according to the selected algorithm.
+ *----------------------------------------------------------------------------*/
+
+int
+cs_mesh_quantities_cell_cen_choice(const int algo_choice)
+{
+ if (algo_choice > 1)
+ bft_error(__FILE__, __LINE__,0,
+ _("The algorithm selection indicator for the cell centre of gravity computation\n"
+ "can take the following values:\n"
+ " 0: computation based on the face centres and surfaces\n"
+ " 1: computation based on the vertices\n"
+ "and not %d."), cs_glob_mesh_quantities_cell_cen);
+
+ else if (algo_choice >= 0)
+ cs_glob_mesh_quantities_cell_cen = algo_choice;
+
+ return cs_glob_mesh_quantities_cell_cen;
+}
+
+/*----------------------------------------------------------------------------
+ * Create a mesh quantities structure.
+ *
+ * returns:
+ * pointer to created cs_mesh_quantities_t structure
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_quantities_t *
+cs_mesh_quantities_create(void)
+{
+ cs_mesh_quantities_t *mesh_quantities = NULL;
+
+ BFT_MALLOC(mesh_quantities, 1, cs_mesh_quantities_t);
+
+ mesh_quantities->cell_cen = NULL;
+ mesh_quantities->cell_vol = NULL;
+ mesh_quantities->i_face_normal = NULL;
+ mesh_quantities->b_face_normal = NULL;
+ mesh_quantities->i_face_cog = NULL;
+ mesh_quantities->b_face_cog = NULL;
+
+ return (mesh_quantities);
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a mesh quantities structure
+ *
+ * mesh_quantities <-- pointer to a cs_mesh_quantities_t structure
+ *
+ * returns:
+ * NULL
+ *----------------------------------------------------------------------------*/
+
+cs_mesh_quantities_t *
+cs_mesh_quantities_destroy(cs_mesh_quantities_t *mesh_quantities)
+{
+
+ BFT_FREE(mesh_quantities->cell_cen);
+ BFT_FREE(mesh_quantities->cell_vol);
+ BFT_FREE(mesh_quantities->i_face_normal);
+ BFT_FREE(mesh_quantities->b_face_normal);
+ BFT_FREE(mesh_quantities->i_face_cog);
+ BFT_FREE(mesh_quantities->b_face_cog);
+
+ BFT_FREE(mesh_quantities);
+
+ return (mesh_quantities);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute mesh quantities
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * mesh_quantities <-> pointer to a cs_mesh_quantities_t structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_compute(const cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities)
+{
+ cs_int_t i, j;
+
+ cs_int_t dim = mesh->dim;
+ cs_int_t n_i_faces = mesh->n_i_faces;
+ cs_int_t n_b_faces = mesh->n_b_faces;
+ cs_int_t n_cells = mesh->n_cells;
+ cs_int_t n_cells_with_ghosts = mesh->n_cells_with_ghosts;
+
+ /* If this is not an update, allocate members of the structure */
+
+ if (mesh_quantities->i_face_normal == NULL)
+ BFT_MALLOC(mesh_quantities->i_face_normal, n_i_faces*dim, cs_real_t);
+
+ if (mesh_quantities->i_face_cog == NULL)
+ BFT_MALLOC(mesh_quantities->i_face_cog, n_i_faces*dim, cs_real_t);
+
+ if (mesh_quantities->b_face_normal == NULL)
+ BFT_MALLOC(mesh_quantities->b_face_normal, n_b_faces*dim, cs_real_t);
+
+ if (mesh_quantities->b_face_cog == NULL)
+ BFT_MALLOC(mesh_quantities->b_face_cog, n_b_faces*dim, cs_real_t);
+
+ if (mesh_quantities->cell_cen == NULL)
+ BFT_MALLOC(mesh_quantities->cell_cen, n_cells_with_ghosts*dim, cs_real_t);
+
+ if (mesh_quantities->cell_vol == NULL)
+ BFT_MALLOC(mesh_quantities->cell_vol, n_cells_with_ghosts, cs_real_t);
+
+ /* Compute centres of gravity and normals of internal faces */
+
+ _compute_face_quantities(dim,
+ n_i_faces,
+ mesh->vtx_coord,
+ mesh->i_face_vtx_idx,
+ mesh->i_face_vtx_lst,
+ mesh_quantities->i_face_cog,
+ mesh_quantities->i_face_normal);
+
+ /* Compute centres of gravity and normals of border faces */
+
+ _compute_face_quantities(dim,
+ n_b_faces,
+ mesh->vtx_coord,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ mesh_quantities->b_face_cog,
+ mesh_quantities->b_face_normal);
+
+ /* Compute cell centers from face barycentres or vertices */
+
+ switch (cs_glob_mesh_quantities_cell_cen) {
+
+ case 0:
+ _compute_cell_cen_face(mesh,
+ mesh_quantities->i_face_normal,
+ mesh_quantities->i_face_cog,
+ mesh_quantities->b_face_normal,
+ mesh_quantities->b_face_cog,
+ mesh_quantities->cell_cen);
+ break;
+
+ case 1:
+ _compute_cell_cen_vertex(mesh,
+ mesh_quantities->cell_cen);
+ break;
+
+ default:
+ assert(0);
+
+ }
+
+ /* Compute the volume of cells */
+
+ _compute_cell_volume(mesh,
+ mesh_quantities->i_face_normal,
+ mesh_quantities->i_face_cog,
+ mesh_quantities->b_face_normal,
+ mesh_quantities->b_face_cog,
+ mesh_quantities->cell_vol);
+
+ /* Initialize values for cells in halo (standard or extended) */
+
+ for (j = n_cells; j < n_cells_with_ghosts; j++) {
+
+ mesh_quantities->cell_vol[j] = 0.;
+
+ for (i = 0; i < dim; i++)
+ mesh_quantities->cell_cen[j*dim + i] = 0.;
+
+ }
+
+ /* Parallel synchronization */
+
+ /* Synchronize geometric quantities */
+
+ if (mesh->halo != NULL) {
+
+ cs_halo_sync_var_strided(mesh->halo, CS_HALO_EXTENDED,
+ mesh_quantities->cell_cen, 3);
+
+ cs_halo_sync_var(mesh->halo, CS_HALO_EXTENDED, mesh_quantities->cell_vol);
+
+ if (mesh->n_init_perio > 0) {
+
+ cs_perio_sync_coords(mesh->halo, mesh->halo_type,
+ mesh_quantities->cell_cen);
+
+ cs_perio_sync_var_scal(mesh->halo,
+ mesh->halo_type,
+ CS_PERIO_ROTA_COPY,
+ mesh_quantities->cell_vol);
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Compute internal and border face normal.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * p_i_face_normal <-> pointer to the internal face normal array
+ * p_b_face_normal <-> pointer to the border face normal array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_face_normal(const cs_mesh_t *mesh,
+ cs_real_t *p_i_face_normal[],
+ cs_real_t *p_b_face_normal[])
+{
+ cs_real_t *i_face_normal = NULL, *b_face_normal = NULL;
+
+ const cs_int_t n_b_faces = mesh->n_b_faces;
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t dim = mesh->dim;
+
+ /* Internal face treatment */
+
+ BFT_MALLOC(i_face_normal, n_i_faces * dim, cs_real_t);
+
+ _compute_face_normal(dim,
+ mesh->n_i_faces,
+ mesh->vtx_coord,
+ mesh->i_face_vtx_idx,
+ mesh->i_face_vtx_lst,
+ i_face_normal);
+
+ *p_i_face_normal = i_face_normal;
+
+ /* Border face treatment */
+
+ BFT_MALLOC(b_face_normal, n_b_faces * dim, cs_real_t);
+
+ _compute_face_normal(dim,
+ mesh->n_b_faces,
+ mesh->vtx_coord,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ b_face_normal);
+
+ *p_b_face_normal = b_face_normal;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute border face centers and normals.
+ *
+ * The corresponding arrays are allocated by this function, and it is the
+ * caller's responsibility to free them when they are no longer needed.
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * p_b_face_cog <-> pointer to the border face center array
+ * p_b_face_normal <-> pointer to the border face normal array
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_b_faces(const cs_mesh_t *mesh,
+ cs_real_t *p_b_face_cog[],
+ cs_real_t *p_b_face_normal[])
+{
+ cs_real_t *b_face_cog = NULL, *b_face_normal = NULL;
+
+ BFT_MALLOC(b_face_cog, mesh->n_b_faces * mesh->dim, cs_real_t);
+ BFT_MALLOC(b_face_normal, mesh->n_b_faces * mesh->dim, cs_real_t);
+
+ _compute_face_quantities(mesh->dim,
+ mesh->n_b_faces,
+ mesh->vtx_coord,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ b_face_cog,
+ b_face_normal);
+
+ *p_b_face_cog = b_face_cog;
+ *p_b_face_normal = b_face_normal;
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_mesh_quantities_t structure
+ *
+ * parameters:
+ * mesh <-- pointer to a cs_mesh_t structure
+ * mesh_quantities <-- pointer to a cs_mesh_quantities_t structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_quantities_dump(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities)
+{
+ cs_int_t i;
+
+ const cs_int_t n_cells = mesh->n_cells_with_ghosts;
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t n_b_faces = mesh->n_b_faces;
+
+ const cs_real_t *cell_cen = mesh_quantities->cell_cen;
+ const cs_real_t *cell_vol = mesh_quantities->cell_vol;
+ const cs_real_t *i_fac_area = mesh_quantities->i_face_normal;
+ const cs_real_t *b_fac_area = mesh_quantities->b_face_normal;
+ const cs_real_t *i_fac_cog = mesh_quantities->i_face_cog;
+ const cs_real_t *b_fac_cog = mesh_quantities->b_face_cog;
+
+ bft_printf("\n\nDUMP OF A MESH QUANTITIES STRUCTURE: %p\n\n",
+ mesh_quantities);
+
+ if (mesh_quantities == NULL)
+ return;
+
+ /* Cell data */
+
+ bft_printf("\n\n"
+ " ---------------"
+ " Cell quantities"
+ " ---------------\n\n");
+
+ bft_printf("Cell center coordinates:\n");
+ for (i = 0; i < n_cells; i++)
+ bft_printf(" < %d > %.3f %.3f %.3f\n", i+1,
+ cell_cen[3*i], cell_cen[3*i+1], cell_cen[3*i+2]);
+
+ bft_printf("\nCell volume:\n");
+ for (i = 0; i < n_cells; i++)
+ bft_printf(" < %d > %.3f\n", i+1, cell_vol[i]);
+
+ /* Internal faces data */
+
+ bft_printf("\n\n"
+ " -------------------------"
+ " Internal faces quantities"
+ " -------------------------\n\n");
+
+ bft_printf("\nInternal faces area\n");
+ for (i = 0; i < n_i_faces; i++)
+ bft_printf(" < %d > %.3f %.3f %.3f\n", i+1,
+ i_fac_area[3*i], i_fac_area[3*i+1], i_fac_area[3*i+2]);
+
+
+ bft_printf("\nInternal faces center\n");
+ for (i = 0; i < n_i_faces; i++)
+ bft_printf(" < %d > %.3f %.3f %.3f\n", i+1,
+ i_fac_cog[3*i], i_fac_cog[3*i+1], i_fac_cog[3*i+2]);
+
+ /* Border faces data */
+
+ bft_printf("\n\n"
+ " -----------------------"
+ " Border faces quantities"
+ " -----------------------\n\n");
+
+ bft_printf("\nBorder faces area\n");
+ for (i = 0; i < n_b_faces; i++)
+ bft_printf(" < %d > %.3f %.3f %.3f\n", i+1,
+ b_fac_area[3*i], b_fac_area[3*i+1], b_fac_area[3*i+2]);
+
+
+ bft_printf("\nBorder faces center\n");
+ for (i = 0; i < n_b_faces; i++)
+ bft_printf(" < %d > %.3f %.3f %.3f\n", i+1,
+ b_fac_cog[3*i], b_fac_cog[3*i+1], b_fac_cog[3*i+2]);
+
+ bft_printf("\n\nEND OF DUMP OF MESH QUANTITIES STRUCTURE\n\n");
+ bft_printf_flush();
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+#if 0 /* Test if face orientation is OK */
+
+ cs_int_t i, fac_id, cell_id;
+ cs_real_t cdgfac[3];
+ cs_real_t cdgcel[3];
+ cs_real_t normale[3];
+ cs_real_t pscal;
+
+ for (fac_id = 0 ; fac_id < mesh->n_b_faces ; fac_id++) {
+
+ cell_id = mesh->b_face_cells[fac_id] - 1;
+ pscal = 0;
+
+ for (i = 0 ; i < 3 ; i++) {
+ cdgcel[i] = cs_glob_mesh_quantities->cell_cen[cell_id*3 + i];
+ cdgfac[i] = cs_glob_mesh_quantities->b_face_cog[fac_id*3 + i];
+ normale[i] = cs_glob_mesh_quantities->b_face_normal[fac_id*3 + i];
+ pscal += normale[i] * (cdgfac[i] - cdgcel[i]);
+ }
+
+ if (pscal < 0.0)
+ printf("num_fac_brd = %d, num_cel = %d, pscal = %f\n",
+ fac_id + 1, cell_id + 1, pscal);
+ }
+
+#endif
+
+
+/*----------------------------------------------------------------------------*/
+
+/* Delete local macro definitions */
+
+#undef _CS_CROSS_PRODUCT
+#undef _CS_DOT_PRODUCT
+#undef _CS_MODULE
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh_solcom.c b/src/base/cs_mesh_solcom.c
new file mode 100644
index 0000000..1efe5f5
--- /dev/null
+++ b/src/base/cs_mesh_solcom.c
@@ -0,0 +1,433 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Read a mesh in "SolCom" format
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdarg.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_config.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_nodal_append.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_post.h"
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh_solcom.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local type definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Number of vertices, tetrahedra, pyramids, prisms, and hexahedra */
+
+static cs_int_t cs_glob_nsom = 0;
+static cs_int_t cs_glob_ntetra = 0;
+static cs_int_t cs_glob_npyram = 0;
+static cs_int_t cs_glob_nprism = 0;
+static cs_int_t cs_glob_nhexae = 0;
+
+/*============================================================================
+ * Private function prototypes
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Allocate memory for a mesh in "SolCom" format.
+ *
+ * parameters:
+ * mesh <-- associated mesh
+ * mesh_quantities <-- associated quantities
+ *----------------------------------------------------------------------------*/
+
+static void
+_mesh_solcom_alloc_mem(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities)
+{
+ cs_int_t n_elts;
+
+ /* Allocation */
+ /*------------*/
+
+ /* Faces / cells connectivity*/
+ BFT_MALLOC(mesh->i_face_cells, mesh->n_i_faces * 2, cs_int_t);
+ BFT_MALLOC(mesh->b_face_cells, mesh->n_b_faces, cs_int_t);
+
+ /* Cell centers (sized for true + ghost cells, but there should be no
+ ghost cells here) */
+ n_elts = mesh->dim * mesh->n_cells_with_ghosts;
+ BFT_MALLOC(mesh_quantities->cell_cen, n_elts, cs_real_t);
+
+ /* Face surfaces */
+ BFT_MALLOC(mesh_quantities->i_face_normal, mesh->dim * mesh->n_i_faces,
+ cs_real_t);
+ BFT_MALLOC(mesh_quantities->b_face_normal, mesh->dim * mesh->n_b_faces,
+ cs_real_t);
+
+ /* Face centers */
+ BFT_MALLOC(mesh_quantities->i_face_cog, mesh->dim * mesh->n_i_faces,
+ cs_real_t);
+ BFT_MALLOC(mesh_quantities->b_face_cog, mesh->dim * mesh->n_b_faces,
+ cs_real_t);
+
+ /* Cell and boundary face families */
+ BFT_MALLOC(mesh->b_face_family, mesh->n_b_faces, cs_int_t);
+ BFT_MALLOC(mesh->cell_family, mesh->n_cells_with_ghosts, cs_int_t);
+
+ /* Family properties */
+ n_elts = mesh->n_families * mesh->n_max_family_items;
+ BFT_MALLOC(mesh->family_item, n_elts, cs_int_t);
+
+
+ if (mesh->n_vertices > 0) {
+
+ /* Vertex coordinates */
+ n_elts = mesh->dim * mesh->n_vertices;
+ BFT_MALLOC(mesh->vtx_coord, n_elts, cs_real_t);
+
+ /* Faces / vertices connectivity */
+ BFT_MALLOC(mesh->i_face_vtx_idx, mesh->n_i_faces + 1, cs_int_t);
+ BFT_MALLOC(mesh->i_face_vtx_lst, mesh->i_face_vtx_connect_size, cs_int_t);
+ BFT_MALLOC(mesh->b_face_vtx_idx, mesh->n_b_faces + 1, cs_int_t);
+ BFT_MALLOC(mesh->b_face_vtx_lst, mesh->b_face_vtx_connect_size, cs_int_t);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Transfer a part of the nodal connectivity to an FVM structure.
+ *
+ * parameters:
+ * ext_mesh <-> mesh to complete
+ * n_elts <-- number of elements to add
+ * type <-- type of section to add
+ * connect <-- connectivity to transfer
+ * tot_elt_count <-> total element counter
+ *----------------------------------------------------------------------------*/
+
+static void
+_mesh_solcom_add(fvm_nodal_t *ext_mesh,
+ cs_int_t n_elts,
+ fvm_element_t type,
+ cs_int_t *connect,
+ cs_int_t *tot_elt_count)
+{
+ cs_int_t ind_elt = 0;
+ cs_int_t cpt_elt = 0;
+
+ fvm_lnum_t *parent_element_num = NULL;
+
+ if (n_elts == 0)
+ return;
+
+ /* Parent element numbers if necessary */
+
+ if (cpt_elt > 0) {
+ BFT_MALLOC(parent_element_num, n_elts, fvm_lnum_t);
+ for (ind_elt = 0 ; ind_elt < n_elts ; ind_elt++)
+ parent_element_num[ind_elt] = ind_elt + (*tot_elt_count + 1);
+ }
+
+ /* Transfer connectivity and parent numbers */
+
+ fvm_nodal_append_by_transfer(ext_mesh,
+ n_elts,
+ type,
+ NULL,
+ NULL,
+ NULL,
+ connect,
+ parent_element_num);
+
+ *tot_elt_count = *tot_elt_count + n_elts;
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update mesh size information after reading a "SolCom" format file header.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DIMGEO (NDIM , NCELET, NCEL , NFAC , NFABOR, NSOM ,
+ * *****************
+ * LNDFAC, LNDFBR, NFML , NPRFML,
+ * NTETRA, NPYRAM, NPRISM, NHEXAE )
+ *
+ * INTEGER NDIM : <-- : spatial dimension (3)
+ * INTEGER NCELET : <-- : number of extended cells
+ * INTEGER NCEL : <-- : number of true cells
+ * INTEGER NFAC : <-- : number of interior faces
+ * INTEGER NFABOR : <-- : number of boundary faces
+ * INTEGER NSOM : <-- : number of vertices (optional)
+ * INTEGER LNDFAC : <-- : length of SOMFAC (optional)
+ * INTEGER LNDFBR : <-- : length of SOMFBR (optional)
+ * INTEGER NFML : <-- : number of families
+ * INTEGER NPRFML : <-- : max. number of properties per family
+ * INTEGER NTETRA : <-- : number of tetrahedra
+ * INTEGER NPYRAM : <-- : number of pyramids
+ * INTEGER NPRISM : <-- : number of prisms
+ * INTEGER NHEXAE : <-- : number of hexahedra
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (dimgeo, DIMGEO)
+(
+ const cs_int_t *ndim,
+ const cs_int_t *ncelet,
+ const cs_int_t *ncel,
+ const cs_int_t *nfac,
+ const cs_int_t *nfabor,
+ const cs_int_t *nsom,
+ const cs_int_t *lndfac,
+ const cs_int_t *lndfbr,
+ const cs_int_t *nfml,
+ const cs_int_t *nprfml,
+ const cs_int_t *ntetra,
+ const cs_int_t *npyram,
+ const cs_int_t *nprism,
+ const cs_int_t *nhexae
+)
+{
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ mesh->dim = *ndim;
+
+ mesh->n_cells = *ncel;
+ mesh->n_i_faces = *nfac;
+ mesh->n_b_faces = *nfabor;
+
+ cs_glob_nsom = *nsom;
+
+ if (*lndfac + *lndfbr > 0)
+ mesh->n_vertices = *nsom;
+ else
+ mesh->n_vertices = 0;
+
+ mesh->i_face_vtx_connect_size = *lndfac;
+ mesh->b_face_vtx_connect_size = *lndfbr;
+
+ mesh->n_cells_with_ghosts = *ncelet;
+
+ assert (*ncelet == *ncel);
+
+ mesh->n_g_cells = (fvm_gnum_t)mesh->n_cells;
+ mesh->n_g_i_faces = (fvm_gnum_t)mesh->n_i_faces;
+ mesh->n_g_b_faces = (fvm_gnum_t)mesh->n_b_faces;
+ mesh->n_g_vertices = (fvm_gnum_t)mesh->n_vertices;
+
+ mesh->n_max_family_items = *nprfml;
+ mesh->n_families = *nfml;
+
+ cs_glob_ntetra = *ntetra;
+ cs_glob_npyram = *npyram;
+ cs_glob_nprism = *nprism;
+ cs_glob_nhexae = *nhexae;
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Read a mesh in "SolCom" format (prior to Code_Saturne 1.0)
+ *
+ * parameters:
+ * mesh <-- associated mesh
+ * mesh_quantities <-- associated quantities
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_solcom_read(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities)
+{
+ cs_int_t indic_nodal = 0;
+ cs_int_t tot_elt_count = 0;
+
+ cs_real_t *vtx_coord = NULL;
+ cs_int_t *connect_tetra = NULL;
+ cs_int_t *connect_pyram = NULL;
+ cs_int_t *connect_prism = NULL;
+ cs_int_t *connect_hexae = NULL;
+
+ fvm_nodal_t *ext_mesh = NULL;
+
+ /* Allocations for main mesh */
+
+ _mesh_solcom_alloc_mem(mesh, mesh_quantities);
+
+ /* Allocations for post-processing mesh when we do not have
+ a faces -> vertices connectivity */
+
+ if (mesh->vtx_coord != NULL)
+ vtx_coord = mesh->vtx_coord;
+
+ else {
+
+ BFT_MALLOC(vtx_coord, cs_glob_nsom * 3, cs_real_t);
+ BFT_MALLOC(connect_tetra, cs_glob_ntetra * 4, cs_int_t);
+ BFT_MALLOC(connect_pyram, cs_glob_npyram * 5, cs_int_t);
+ BFT_MALLOC(connect_prism, cs_glob_nprism * 6, cs_int_t);
+ BFT_MALLOC(connect_hexae, cs_glob_nhexae * 8, cs_int_t);
+
+ }
+
+ /* Read mesh body */
+
+ CS_PROCF (letgeo, LETGEO) (&(mesh->dim),
+ &(mesh->n_cells_with_ghosts),
+ &(mesh->n_cells),
+ &(mesh->n_i_faces),
+ &(mesh->n_b_faces),
+ &(mesh->n_families),
+ &(mesh->n_max_family_items),
+ &(cs_glob_nsom),
+ &(mesh->i_face_vtx_connect_size),
+ &(mesh->b_face_vtx_connect_size),
+ &cs_glob_ntetra,
+ &cs_glob_npyram,
+ &cs_glob_nprism,
+ &cs_glob_nhexae,
+ &indic_nodal,
+ mesh->i_face_cells,
+ mesh->b_face_cells,
+ mesh->b_face_family,
+ mesh->cell_family,
+ mesh->family_item,
+ connect_tetra,
+ connect_pyram,
+ connect_prism,
+ connect_hexae,
+ mesh->i_face_vtx_idx,
+ mesh->i_face_vtx_lst,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ mesh_quantities->cell_cen,
+ mesh_quantities->i_face_normal,
+ mesh_quantities->b_face_normal,
+ mesh_quantities->i_face_cog,
+ mesh_quantities->b_face_cog,
+ vtx_coord);
+
+
+ if (indic_nodal > 0) {
+
+ /* Direct creation of the post-processing mesh when we
+ do not have a faces -> vertices connectivity */
+
+ ext_mesh = fvm_nodal_create(_("Fluid volume"), 3);
+
+ if (cs_glob_ntetra > 0)
+ _mesh_solcom_add(ext_mesh,
+ cs_glob_ntetra,
+ FVM_CELL_TETRA,
+ connect_tetra,
+ &tot_elt_count);
+
+ if (cs_glob_npyram > 0)
+ _mesh_solcom_add(ext_mesh,
+ cs_glob_npyram,
+ FVM_CELL_PYRAM,
+ connect_pyram,
+ &tot_elt_count);
+
+ if (cs_glob_nprism > 0)
+ _mesh_solcom_add(ext_mesh,
+ cs_glob_nprism,
+ FVM_CELL_PRISM,
+ connect_prism,
+ &tot_elt_count);
+
+ if (cs_glob_nhexae > 0)
+ _mesh_solcom_add(ext_mesh,
+ cs_glob_nhexae,
+ FVM_CELL_HEXA,
+ connect_hexae,
+ &tot_elt_count);
+
+ fvm_nodal_transfer_vertices(ext_mesh, vtx_coord);
+
+ /* Transfer structure to post-processing */
+
+ cs_post_add_existing_mesh(-1, ext_mesh, 0, true);
+
+ }
+ else if (mesh->vtx_coord == NULL) {
+
+ BFT_FREE(vtx_coord);
+ BFT_FREE(connect_tetra);
+ BFT_FREE(connect_pyram);
+ BFT_FREE(connect_prism);
+ BFT_FREE(connect_hexae);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_mesh_warping.c b/src/base/cs_mesh_warping.c
new file mode 100644
index 0000000..8ed4a6f
--- /dev/null
+++ b/src/base/cs_mesh_warping.c
@@ -0,0 +1,1409 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Cut warped faces in serial or parallel with/without periodicity.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+#include <fvm_io_num.h>
+#include <fvm_order.h>
+#include <fvm_triangulate.h>
+#include <fvm_nodal.h>
+#include <fvm_writer.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_halo.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_mesh_quality.h"
+#include "cs_mesh_connect.h"
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh_warping.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create the list of faces to cut in order to respect warping criterion.
+ *
+ * parameters:
+ * n_faces --> number of faces
+ * max_warp_angle --> criterion above which face is cut
+ * face_warping --> face warping angle
+ * p_n_warp_faces <-> pointer to the number of warped faces
+ * p_warp_face_lst <-> pointer to the warped face list
+ *----------------------------------------------------------------------------*/
+
+static void
+_select_warped_faces(cs_int_t n_faces,
+ double max_warp_angle,
+ double face_warping[],
+ cs_int_t *p_n_warp_faces,
+ cs_int_t *p_warp_face_lst[])
+{
+ cs_int_t face_id;
+
+ cs_int_t n_warp_faces = 0;
+ cs_int_t *warp_face_lst = NULL;
+
+ if (n_faces > 0) {
+
+ for (face_id = 0; face_id < n_faces; face_id++)
+ if (face_warping[face_id] >= max_warp_angle)
+ n_warp_faces++;
+
+ BFT_MALLOC(warp_face_lst, n_warp_faces, cs_int_t);
+
+ n_warp_faces = 0;
+
+ for (face_id = 0; face_id < n_faces; face_id++)
+ if (face_warping[face_id] >= max_warp_angle)
+ warp_face_lst[n_warp_faces++] = face_id + 1;
+
+ }
+
+ *p_n_warp_faces = n_warp_faces;
+ *p_warp_face_lst = warp_face_lst;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Define periodic index for send/receive operations.
+ *
+ * parameters:
+ * mesh --> pointer to a mesh structure
+ * face_warping --> face warping angle
+ * max_warp_angle --> criterion above which face is cut
+ * p_domain_to_c_ranks <-> pointer to a rank indirection array
+ * p_s_rank_index <-> pointer to the sending index on ranks
+ * p_r_rank_index <-> pointer to the receiving index on ranks
+ *----------------------------------------------------------------------------*/
+
+static void
+_define_periodic_index(const cs_mesh_t *const mesh,
+ double face_warping[],
+ double max_warp_angle,
+ cs_int_t *p_domain_to_c_rank[],
+ cs_int_t *p_s_rank_index[],
+ cs_int_t *p_r_rank_index[])
+{
+ cs_int_t i, face_id, perio_id, rank_id, shift;
+ cs_int_t n_triangles = 0;
+
+ int cpt_request = 0;
+ cs_int_t *domain_to_c_rank = NULL;
+ cs_int_t *s_rank_index = NULL, *r_rank_index = NULL;
+
+#if defined(HAVE_MPI)
+ MPI_Request _request[128];
+ MPI_Request *request = _request;
+ MPI_Status _status[128];
+ MPI_Status *status = _status;
+#endif
+
+ const cs_int_t n_domains = mesh->n_domains;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+ const cs_halo_t *halo = mesh->halo;
+ const cs_int_t n_c_ranks = halo->n_c_domains;
+ const cs_int_t *per_face_idx = cs_glob_mesh_builder->per_face_idx;
+ const cs_int_t *per_face_lst = cs_glob_mesh_builder->per_face_lst;
+ const cs_int_t *per_rank_lst = cs_glob_mesh_builder->per_rank_lst;
+
+#if defined(HAVE_MPI)
+ if (halo->n_c_domains*2 > 128) {
+ BFT_MALLOC(request, halo->n_c_domains*2, MPI_Request);
+ BFT_MALLOC(status, halo->n_c_domains*2, MPI_Status);
+ }
+#endif
+
+ BFT_MALLOC(s_rank_index, n_c_ranks + 1, cs_int_t);
+ BFT_MALLOC(r_rank_index, n_c_ranks + 1, cs_int_t);
+
+ for (i = 0; i < n_c_ranks + 1; i++) {
+ s_rank_index[i] = 0;
+ r_rank_index[i] = 0;
+ }
+
+ BFT_MALLOC(domain_to_c_rank, n_domains, cs_int_t);
+
+ for (i = 0, shift = 0; i < n_domains; i++) {
+
+ if (halo->c_domain_rank[shift] == i) {
+ domain_to_c_rank[i] = shift;
+ shift++;
+ }
+ else
+ domain_to_c_rank[i] = -2;
+
+ } /* End of loop on ranks */
+
+ for (perio_id = 0; perio_id < mesh->n_init_perio; perio_id++) {
+
+ for (i = per_face_idx[perio_id]; i < per_face_idx[perio_id+1]; i++) {
+
+ if (per_face_lst[2*i] > 0) {
+
+ face_id = per_face_lst[2*i] - 1;
+
+ if (face_warping[face_id] > max_warp_angle) {
+
+ if (n_domains > 1)
+ rank_id = domain_to_c_rank[per_rank_lst[i]];
+ else
+ rank_id = 0;
+
+ s_rank_index[rank_id + 1] += n_triangles*3 + 1;
+
+ }
+
+ } /* If this is a direct transformation */
+
+ } /* End of loop on periodic index */
+
+ } /* End of loop on periodicities */
+
+ /* Send/Recv number of elements to exchange */
+
+ for (rank_id = 0; rank_id < n_c_ranks; rank_id++) {
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Irecv(&(r_rank_index[rank_id+1]), 1, MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(request[cpt_request++]));
+#endif
+
+ }
+ else
+ r_rank_index[rank_id+1] = s_rank_index[rank_id+1];
+
+ } /* End of loop on ranks */
+
+ /* We wait for receiving all messages */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ for (rank_id = 0; rank_id < n_c_ranks; rank_id++) {
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Isend(&(s_rank_index[rank_id+1]), 1, MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ cs_glob_mpi_comm,
+ &(request[cpt_request++]));
+#endif
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Sync after each communicating rank had received all the messages */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Waitall(cpt_request, request, status);
+#endif
+
+ /* Define send/receive index */
+
+ for (i = 0; i < n_c_ranks; i++) {
+ s_rank_index[i+1] += s_rank_index[i];
+ r_rank_index[i+1] += r_rank_index[i];
+ }
+
+ *p_domain_to_c_rank = domain_to_c_rank;
+ *p_s_rank_index = s_rank_index;
+ *p_r_rank_index = r_rank_index;
+
+#if defined(HAVE_MPI)
+ if (request != _request) {
+ BFT_FREE(request);
+ BFT_FREE(status);
+ }
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Fill periodic buffer to send
+ *
+ * parameters:
+ * mesh --> pointer to a mesh structure
+ * face_warping --> face warping angle
+ * max_warp_angle --> criterion above which face is cut
+ * p_domain_to_c_ranks <-> pointer to a rank indirection array
+ * s_rank_index <-> sending index on ranks
+ * r_rank_index <-> receiving index on ranks
+ * perio_s_buffer <-> periodic data to send
+ * perio_r_buffer <-> periodic data to receive
+ *----------------------------------------------------------------------------*/
+
+static void
+_fill_perio_buffers(const cs_mesh_t *mesh,
+ double face_warping[],
+ double max_warp_angle,
+ cs_int_t domain_to_c_rank[],
+ cs_int_t old_to_new[],
+ cs_int_t old_face_vtx_idx[],
+ cs_int_t new_face_vtx_idx[],
+ cs_int_t new_face_vtx_lst[],
+ cs_int_t s_rank_index[],
+ cs_int_t r_rank_index[])
+{
+ cs_int_t i, j, k, perio_id, local_face_id, rank_id, new_face_id;
+ cs_int_t perio_shift, shift;
+ cs_int_t n_face_vertices, n_triangles, n_elts;
+
+ int cpt_request = 0;
+ cs_int_t *counter = NULL;
+ cs_int_t *perio_s_buffer = NULL, *perio_r_buffer = NULL;
+
+#if defined(HAVE_MPI)
+ MPI_Request _request[128];
+ MPI_Request *request = _request;
+ MPI_Status _status[128];
+ MPI_Status *status = _status;
+#endif
+
+ const cs_int_t n_domains = mesh->n_domains;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+ const cs_halo_t *halo = mesh->halo;
+ const cs_int_t *per_face_idx = cs_glob_mesh_builder->per_face_idx;
+ const cs_int_t *per_face_lst = cs_glob_mesh_builder->per_face_lst;
+ const cs_int_t *per_rank_lst = cs_glob_mesh_builder->per_rank_lst;
+
+#if defined(HAVE_MPI)
+ if (halo->n_c_domains*2 > 128) {
+ BFT_MALLOC(request, halo->n_c_domains*2, MPI_Request);
+ BFT_MALLOC(status, halo->n_c_domains*2, MPI_Status);
+ }
+#endif
+
+ /* Allocation and intialization */
+
+ BFT_MALLOC(perio_s_buffer, s_rank_index[halo->n_c_domains], cs_int_t);
+ BFT_MALLOC(perio_r_buffer, r_rank_index[halo->n_c_domains], cs_int_t);
+ BFT_MALLOC(counter, halo->n_c_domains, cs_int_t);
+
+ for (i = 0; i < halo->n_c_domains; i++)
+ counter[i] = 0;
+
+ /* Define perio_s_buffer */
+
+ for (perio_id = 0; perio_id < mesh->n_init_perio; perio_id++) {
+
+ for (i = per_face_idx[perio_id]; i < per_face_idx[perio_id+1]; i++) {
+
+ if (per_face_lst[2*i] > 0) {
+
+ local_face_id = per_face_lst[2*i] - 1;
+
+ if (face_warping[local_face_id] > max_warp_angle) {
+
+ if (n_domains > 1)
+ rank_id = domain_to_c_rank[per_rank_lst[i]];
+ else
+ rank_id = 0;
+
+ perio_shift = s_rank_index[rank_id] + counter[rank_id];
+
+ perio_s_buffer[perio_shift++] = per_face_lst[2*i+1];
+
+ n_face_vertices = old_face_vtx_idx[local_face_id+1]
+ - old_face_vtx_idx[local_face_id];
+ n_triangles = n_face_vertices - 2;
+
+ new_face_id = old_to_new[local_face_id];
+
+ for (j = 0; j < n_triangles; j++) {
+
+ for (k = new_face_vtx_idx[new_face_id];
+ k < new_face_vtx_idx[new_face_id+1]; k++)
+ perio_s_buffer[perio_shift++] = new_face_vtx_lst[k];
+
+ new_face_id++;
+
+ } /* End of loop on triangles */
+
+ counter[rank_id] += 1 + 3*n_triangles;
+
+ } /* If this face should have been cut */
+
+ } /* If this is a direct transformation */
+
+ } /* End of loop on periodic index */
+
+ } /* End of loop on periodicities */
+
+ /* Exchange buffers */
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ n_elts = r_rank_index[rank_id+1] - r_rank_index[rank_id];
+ shift = r_rank_index[rank_id];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Irecv(&(perio_r_buffer[shift]), n_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, &(request[cpt_request++]));
+#endif
+
+ }
+ else {
+
+ assert(n_elts == (s_rank_index[rank_id+1] - s_rank_index[rank_id]));
+
+ for (i = 0; i < n_elts; i++)
+ perio_r_buffer[shift + i] = perio_s_buffer[s_rank_index[rank_id] + i];
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* We wait for receiving all messages */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ n_elts = s_rank_index[rank_id+1] - s_rank_index[rank_id];
+ shift = s_rank_index[rank_id];
+
+#if defined(HAVE_MPI)
+ MPI_Isend(&(perio_s_buffer[shift]), n_elts, MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ cs_glob_mpi_comm, &(request[cpt_request++]));
+#endif
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Sync after each communicating rank had received all the messages */
+
+#if defined(HAVE_MPI)
+ if (mesh->n_domains > 1)
+ MPI_Waitall(cpt_request, request, status);
+#endif
+
+ /* Apply perio_r_buffer to the new face->vertices connectivity */
+
+ perio_shift = 0;
+ while (perio_shift < r_rank_index[halo->n_c_domains]) {
+
+ local_face_id = perio_r_buffer[perio_shift++];
+
+ n_face_vertices = old_face_vtx_idx[local_face_id+1]
+ - old_face_vtx_idx[local_face_id];
+ n_triangles = n_face_vertices - 2;
+
+ new_face_id = old_to_new[local_face_id];
+
+ for (i = 0; i < n_triangles; i++) {
+
+ for (j = new_face_vtx_idx[new_face_id];
+ j < new_face_vtx_idx[new_face_id+1]; j++)
+ new_face_vtx_lst[j] = perio_r_buffer[perio_shift++];
+
+ new_face_id++;
+
+ } /* End of loop on triangles */
+
+ } /* End of while */
+
+ /* Free memory */
+
+ BFT_FREE(perio_r_buffer);
+ BFT_FREE(perio_s_buffer);
+ BFT_FREE(counter);
+
+#if defined(HAVE_MPI)
+ if (request != _request) {
+ BFT_FREE(request);
+ BFT_FREE(status);
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Cut faces with periodic treatment and update connectivity.
+ * Only useful for internal faces.
+ *
+ * parameters:
+ * mesh <-> pointer to a mesh structure
+ * face_type --> internal or border faces
+ * max_warp_angle --> criterion above which face is cut
+ * face_warping --> face warping angle
+ * p_n_cut_faces <-> pointer to the number of cut faces
+ * p_cut_face_lst <-> pointer to the cut face list
+ * p_n_sub_elt_lst <-> pointer to the sub-elt count list
+ * p_n_faces <-> pointer to the number of faces
+ * p_face_vtx_connect_size <-> size of the "face -> vertex" connectivity
+ * p_face_cells <-> "face -> cells" connectivity
+ * p_face_vtx_idx <-> pointer on "face -> vertices" connect. index
+ * p_face_vtx_lst <-> pointer on "face -> vertices" connect. list
+ *----------------------------------------------------------------------------*/
+
+static void
+_cut_warped_faces_perio(cs_mesh_t *mesh,
+ double max_warp_angle,
+ double face_warping[],
+ cs_int_t *p_n_cut_faces,
+ cs_int_t *p_cut_face_lst[],
+ fvm_lnum_t *p_n_sub_elt_lst[],
+ cs_int_t *p_n_faces,
+ cs_int_t *p_face_vtx_connect_size,
+ cs_int_t *p_face_cells[],
+ cs_int_t *p_face_family[],
+ cs_int_t *p_face_vtx_idx[],
+ cs_int_t *p_face_vtx_lst[])
+{
+ cs_int_t i, j, face_id, idx_start, idx_end, old_face_idx;
+ cs_int_t n_triangles, num, shift, face_shift;
+
+ cs_int_t n_face_vertices = 0, n_max_face_vertices = 0;
+ cs_int_t n_new_faces = 0, n_cut_faces = 0, connect_size = 0;
+
+ fvm_triangulate_state_t *triangle_state = NULL;
+ cs_int_t *face_connectivity = NULL, *new_face_connectivity = NULL;
+ cs_int_t *new_face_vtx_idx = NULL, *new_face_vtx_lst = NULL;
+ cs_int_t *new_face_cells = NULL, *new_face_family = NULL;
+ cs_int_t *cut_face_lst = NULL;
+ cs_int_t *domain_to_c_rank = NULL, *new_face_shift = NULL;
+ cs_int_t *s_rank_index = NULL, *r_rank_index = NULL;
+ fvm_lnum_t *n_sub_elt_lst = NULL;
+
+ const cs_int_t dim = mesh->dim;
+ const cs_int_t n_init_faces = *p_n_faces;
+
+ assert(dim == 3);
+
+ BFT_MALLOC(n_sub_elt_lst, n_init_faces, fvm_lnum_t);
+ BFT_MALLOC(new_face_shift, n_init_faces, cs_int_t);
+
+ /* First loop: compute sizes */
+
+ for (face_id = 0; face_id < n_init_faces; face_id++) {
+
+ idx_start = (*p_face_vtx_idx)[face_id] - 1;
+ idx_end = (*p_face_vtx_idx)[face_id + 1] - 1;
+
+ n_face_vertices = idx_end - idx_start;
+ n_max_face_vertices = CS_MAX(n_max_face_vertices, n_face_vertices);
+
+ new_face_shift[face_id] = n_new_faces;
+
+ if (face_warping[face_id] >= max_warp_angle) {
+
+ n_triangles = n_face_vertices - 2;
+ connect_size += n_triangles*3;
+ n_new_faces += n_triangles;
+ n_cut_faces += n_triangles;
+ n_sub_elt_lst[face_id] = n_triangles;
+
+ }
+ else {
+
+ connect_size += n_face_vertices;
+ n_new_faces += 1;
+ n_sub_elt_lst[face_id] = 1;
+
+ }
+
+ } /* End of loop on faces */
+
+ *p_n_sub_elt_lst = n_sub_elt_lst;
+
+ if (n_cut_faces == 0) {
+
+ BFT_FREE(new_face_shift);
+ return;
+
+ }
+
+ BFT_MALLOC(new_face_vtx_idx, n_new_faces + 1, cs_int_t);
+ BFT_MALLOC(new_face_vtx_lst, connect_size, cs_int_t);
+ BFT_MALLOC(new_face_cells, 2*n_new_faces, cs_int_t);
+ BFT_MALLOC(new_face_family, n_new_faces, cs_int_t);
+
+ BFT_MALLOC(cut_face_lst, n_cut_faces, cs_int_t);
+
+ triangle_state = fvm_triangulate_state_create(n_max_face_vertices);
+
+ BFT_MALLOC(face_connectivity, n_max_face_vertices, cs_int_t);
+ BFT_MALLOC(new_face_connectivity, (n_max_face_vertices-2)*3, cs_int_t);
+
+ /* Periodic treatment */
+
+ _define_periodic_index(mesh,
+ face_warping,
+ max_warp_angle,
+ &domain_to_c_rank,
+ &s_rank_index,
+ &r_rank_index);
+
+ /* Second loop : define the new connectivity after triangulation */
+
+ new_face_vtx_idx[0] = 1;
+ connect_size = 0;
+ n_new_faces = 0;
+ n_cut_faces = 0;
+
+ for (face_id = 0; face_id < n_init_faces; face_id++) {
+
+ idx_start = (*p_face_vtx_idx)[face_id] - 1;
+ idx_end = (*p_face_vtx_idx)[face_id + 1] - 1;
+ n_face_vertices = idx_end - idx_start;
+
+ if (face_warping[face_id] >= max_warp_angle) {
+
+ for (j = 0, i = idx_start; i < idx_end; i++, j++)
+ face_connectivity[j] = (*p_face_vtx_lst)[i];
+
+ n_triangles = fvm_triangulate_polygon(dim,
+ n_face_vertices,
+ mesh->vtx_coord,
+ NULL,
+ face_connectivity,
+ FVM_TRIANGULATE_ELT_DEF,
+ new_face_connectivity,
+ triangle_state);
+
+ assert(n_triangles == n_face_vertices - 2);
+
+ /* Update face -> vertex connectivity */
+
+ shift = 0;
+
+ for (i = 0; i < n_triangles; i++) {
+
+ cut_face_lst[n_cut_faces++] = n_new_faces + 1;
+
+ /* Update "face -> cells" connectivity */
+
+ for (j = 0; j < 2; j++)
+ new_face_cells[2*n_new_faces + j] = (*p_face_cells)[2*face_id + j];
+
+ /* Update family for each face */
+
+ new_face_family[n_new_faces] = (*p_face_family)[face_id];
+
+ /* Update "face -> vertices" connectivity */
+
+ n_new_faces++;
+ connect_size += 3;
+ new_face_vtx_idx[n_new_faces]
+ = new_face_vtx_idx[n_new_faces-1] + 3;
+
+ } /* End of loop on triangles */
+
+ }
+ else {
+
+ /* Update "face -> cells" connectivity */
+
+ for (j = 0; j < 2; j++)
+ new_face_cells[2*n_new_faces + j] = (*p_face_cells)[2*face_id + j];
+
+ /* Update family for each face */
+
+ new_face_family[n_new_faces] = (*p_face_family)[face_id];
+
+ /* Update "face -> vertices" connectivity */
+
+ for (j = 0, i = idx_start; i < idx_end; i++, j++)
+ new_face_vtx_lst[connect_size + j] = (*p_face_vtx_lst)[i];
+
+ n_new_faces++;
+ connect_size += n_face_vertices;
+ new_face_vtx_idx[n_new_faces]
+ = new_face_vtx_idx[n_new_faces-1] + n_face_vertices;
+
+ }
+
+ } /* End of loop on internal faces */
+
+ triangle_state = fvm_triangulate_state_destroy(triangle_state);
+
+ BFT_FREE(face_connectivity);
+ BFT_FREE(new_face_connectivity);
+ BFT_FREE(*p_face_cells);
+
+ /* Define perio_s_buffer and exchange it with communicating rank to
+ fill perio_r_buffer */
+
+ _fill_perio_buffers(mesh,
+ face_warping,
+ max_warp_angle,
+ domain_to_c_rank,
+ new_face_shift,
+ (*p_face_vtx_idx),
+ new_face_vtx_idx,
+ new_face_vtx_lst,
+ s_rank_index,
+ r_rank_index);
+
+ /* Get mesh numbering from element numbering */
+
+ for (face_id = 0; face_id < n_init_faces; face_id++) {
+
+ if (face_warping[face_id] >= max_warp_angle) {
+
+ idx_start = (*p_face_vtx_idx)[face_id] - 1;
+ idx_end = (*p_face_vtx_idx)[face_id + 1] - 1;
+
+ n_face_vertices = idx_end - idx_start;
+ n_triangles = n_face_vertices - 2;
+
+ face_shift = new_face_shift[face_id];
+
+ old_face_idx = (*p_face_vtx_idx)[face_id] - 1;
+
+ for (i = 0; i < n_triangles; i++) {
+
+ for (j = new_face_vtx_idx[face_shift] - 1;
+ j < new_face_vtx_idx[face_shift+1] - 1; j++) {
+
+ shift = new_face_vtx_lst[j] - 1;
+ num = (*p_face_vtx_lst)[old_face_idx + shift];
+ new_face_vtx_lst[j] = num;
+
+ }
+
+ face_shift++;
+
+ } /* End of loop on triangles */
+
+ } /* If the face is warped */
+
+ } /* End of loop on faces */
+
+ BFT_FREE(new_face_shift);
+ BFT_FREE(domain_to_c_rank);
+ BFT_FREE(s_rank_index);
+ BFT_FREE(r_rank_index);
+ BFT_FREE(*p_face_vtx_idx);
+ BFT_FREE(*p_face_vtx_lst);
+ BFT_FREE(*p_face_family);
+
+ /* Define returned pointers */
+
+ *p_face_vtx_idx = new_face_vtx_idx;
+ *p_face_vtx_lst = new_face_vtx_lst;
+ *p_face_cells = new_face_cells;
+ *p_face_family = new_face_family;
+ *p_face_vtx_connect_size = connect_size;
+ *p_n_faces = n_new_faces;
+ *p_n_cut_faces = n_cut_faces;
+
+ if (p_cut_face_lst != NULL)
+ BFT_FREE(*p_cut_face_lst);
+ *p_cut_face_lst = cut_face_lst;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Cut faces if necessary and update connectivity without periodicity
+ *
+ * parameters:
+ * mesh <-> pointer to a mesh structure
+ * face_type --> internal or border faces
+ * max_warp_angle --> criterion above which face is cut
+ * face_warping --> face warping angle
+ * p_n_cut_faces <-> pointer to the number of cut faces
+ * p_cut_face_lst <-> pointer to the cut face list
+ * p_n_sub_elt_lst <-> pointer to the sub-elt count list
+ * p_n_faces <-> pointer to the number of faces
+ * p_face_num <-> pointer to the global face numbers
+ * p_face_vtx_connect_size <-> size of the "face -> vertex" connectivity
+ * p_face_cells <-> "face -> cells" connectivity
+ * p_face_vtx_idx <-> pointer on "face -> vertices" connect. index
+ * p_face_vtx_lst <-> pointer on "face -> vertices" connect. list
+ *----------------------------------------------------------------------------*/
+
+static void
+_cut_warped_faces(cs_mesh_t *mesh,
+ int stride,
+ double max_warp_angle,
+ double face_warping[],
+ cs_int_t *p_n_cut_faces,
+ cs_int_t *p_cut_face_lst[],
+ fvm_lnum_t *p_n_sub_elt_lst[],
+ cs_int_t *p_n_faces,
+ cs_int_t *p_face_vtx_connect_size,
+ cs_int_t *p_face_cells[],
+ cs_int_t *p_face_family[],
+ cs_int_t *p_face_vtx_idx[],
+ cs_int_t *p_face_vtx_lst[])
+{
+ cs_int_t i, j, face_id, idx_start, idx_end, shift;
+ cs_int_t n_triangles;
+
+ cs_int_t n_face_vertices = 0, n_max_face_vertices = 0;
+ cs_int_t n_new_faces = 0, n_cut_faces = 0, connect_size = 0;
+
+ fvm_triangulate_state_t *triangle_state = NULL;
+ cs_int_t *face_connectivity = NULL, *new_face_connectivity = NULL;
+ cs_int_t *new_face_vtx_idx = NULL, *new_face_vtx_lst = NULL;
+ cs_int_t *new_face_cells = NULL, *new_face_family = NULL;
+ cs_int_t *cut_face_lst = NULL;
+ fvm_lnum_t *n_sub_elt_lst = NULL;
+
+ const cs_int_t dim = mesh->dim;
+ const cs_int_t n_init_faces = *p_n_faces;
+
+ assert(stride == 1 || stride ==2);
+ assert(dim == 3);
+
+ BFT_MALLOC(n_sub_elt_lst, n_init_faces, fvm_lnum_t);
+
+ /* First loop: count */
+
+ for (face_id = 0; face_id < n_init_faces; face_id++) {
+
+ idx_start = (*p_face_vtx_idx)[face_id] - 1;
+ idx_end = (*p_face_vtx_idx)[face_id + 1] - 1;
+
+ n_face_vertices = idx_end - idx_start;
+ n_max_face_vertices = CS_MAX(n_max_face_vertices, n_face_vertices);
+
+ if (face_warping[face_id] >= max_warp_angle) {
+
+ n_triangles = n_face_vertices - 2;
+ connect_size += n_triangles*3;
+ n_new_faces += n_triangles;
+ n_cut_faces += n_triangles;
+ n_sub_elt_lst[face_id] = n_triangles;
+
+ }
+ else {
+
+ connect_size += n_face_vertices;
+ n_new_faces += 1;
+ n_sub_elt_lst[face_id] = 1;
+
+ }
+
+ } /* End of loop on faces */
+
+ *p_n_sub_elt_lst = n_sub_elt_lst;
+
+ if (n_cut_faces == 0)
+ return;
+
+ BFT_MALLOC(new_face_vtx_idx, n_new_faces + 1, cs_int_t);
+ BFT_MALLOC(new_face_vtx_lst, connect_size, cs_int_t);
+ BFT_MALLOC(new_face_cells, n_new_faces*stride, cs_int_t);
+ BFT_MALLOC(new_face_family, n_new_faces, cs_int_t);
+
+ BFT_MALLOC(cut_face_lst, n_cut_faces, cs_int_t);
+
+ triangle_state = fvm_triangulate_state_create(n_max_face_vertices);
+
+ BFT_MALLOC(face_connectivity, n_max_face_vertices, cs_int_t);
+ BFT_MALLOC(new_face_connectivity, (n_max_face_vertices-2)*3, cs_int_t);
+
+ /* Second loop : define the new connectivity after triangulation */
+
+ new_face_vtx_idx[0] = 1;
+ connect_size = 0;
+ n_new_faces = 0;
+ n_cut_faces = 0;
+
+ for (face_id = 0; face_id < n_init_faces; face_id++) {
+
+ idx_start = (*p_face_vtx_idx)[face_id] - 1;
+ idx_end = (*p_face_vtx_idx)[face_id + 1] - 1;
+ n_face_vertices = idx_end - idx_start;
+
+ if (face_warping[face_id] >= max_warp_angle) {
+
+ for (j = 0, i = idx_start; i < idx_end; i++, j++)
+ face_connectivity[j] = (*p_face_vtx_lst)[i];
+
+ n_triangles = fvm_triangulate_polygon(dim,
+ n_face_vertices,
+ mesh->vtx_coord,
+ NULL,
+ face_connectivity,
+ FVM_TRIANGULATE_MESH_DEF,
+ new_face_connectivity,
+ triangle_state);
+
+ assert(n_triangles == n_face_vertices - 2);
+
+ /* Update face -> vertex connectivity */
+
+ shift = 0;
+
+ for (i = 0; i < n_triangles; i++) {
+
+ cut_face_lst[n_cut_faces++] = n_new_faces + 1;
+
+ /* Update "face -> cells" connectivity */
+
+ for (j = 0; j < stride; j++)
+ new_face_cells[stride*n_new_faces + j] =
+ (*p_face_cells)[stride*face_id + j];
+
+ /* Update family for each face */
+
+ new_face_family[n_new_faces] = (*p_face_family)[face_id];
+
+ /* Update "face -> vertices" connectivity */
+
+ for (j = 0; j < 3; j++)
+ new_face_vtx_lst[connect_size + j] = new_face_connectivity[shift++];
+
+ n_new_faces++;
+ connect_size += 3;
+ new_face_vtx_idx[n_new_faces] = new_face_vtx_idx[n_new_faces-1] + 3;
+
+ } /* End of loop on triangles */
+
+ }
+ else {
+
+ /* Update "face -> cells" connectivity */
+
+ for (j = 0; j < stride; j++)
+ new_face_cells[stride*n_new_faces + j] =
+ (*p_face_cells)[stride*face_id + j];
+
+ /* Update family for each faces */
+
+ new_face_family[n_new_faces] = (*p_face_family)[face_id];
+
+ /* Update "face -> vertices" connectivity */
+
+ for (j = 0, i = idx_start; i < idx_end; i++, j++)
+ new_face_vtx_lst[connect_size + j] = (*p_face_vtx_lst)[i];
+
+ n_new_faces++;
+ connect_size += n_face_vertices;
+ new_face_vtx_idx[n_new_faces] =
+ new_face_vtx_idx[n_new_faces-1] + n_face_vertices;
+
+ }
+
+ } /* End of loop on internal faces */
+
+ triangle_state = fvm_triangulate_state_destroy(triangle_state);
+
+ BFT_FREE(face_connectivity);
+ BFT_FREE(new_face_connectivity);
+
+ BFT_FREE(*p_face_vtx_idx);
+ BFT_FREE(*p_face_vtx_lst);
+ BFT_FREE(*p_face_cells);
+ BFT_FREE(*p_face_family);
+
+ /* Define returned pointers */
+
+ *p_face_vtx_idx = new_face_vtx_idx;
+ *p_face_vtx_lst = new_face_vtx_lst;
+ *p_face_cells = new_face_cells;
+ *p_face_family = new_face_family;
+ *p_face_vtx_connect_size = connect_size;
+ *p_n_faces = n_new_faces;
+ *p_n_cut_faces = n_cut_faces;
+
+ if (p_cut_face_lst != NULL)
+ BFT_FREE(*p_cut_face_lst);
+ *p_cut_face_lst = cut_face_lst;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update warped faces global numbers after cutting
+ *
+ * parameters:
+ * mesh <-> pointer to a mesh structure
+ * n_faces --> number of faces
+ * n_init_faces --> initial number of faces
+ * n_cut_faces --> number of cut faces
+ * cut_face_lst --> pointer to the cut face list
+ * n_sub_elt_lst --> sub-elt count list
+ * n_g_faces <-> global number of faces
+ * p_global_face_num <-> pointer to the global face numbers
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_cut_faces_num(cs_mesh_t *mesh,
+ cs_int_t n_faces,
+ cs_int_t n_init_faces,
+ fvm_lnum_t n_sub_elt_lst[],
+ fvm_gnum_t *n_g_faces,
+ fvm_gnum_t **p_global_face_num)
+{
+ size_t size;
+
+ fvm_io_num_t *new_io_num = NULL, *previous_io_num = NULL;
+ const fvm_gnum_t *global_num = NULL;
+
+ /* Simply update global number of faces in trivial case */
+
+ *n_g_faces = n_faces;
+
+ if (*p_global_face_num == NULL)
+ return;
+
+ /* Faces should not have been reordered */
+
+ if (fvm_order_local_test(NULL, *p_global_face_num, n_init_faces) == false)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The faces have been renumbered before cutting.\n"
+ "This case should not arise, because the mesh entities\n"
+ "should be cut before renumbering."));
+
+ /* Update global number of internal faces and its global numbering */
+
+ if (mesh->n_domains > 1) {
+
+ bft_printf(_("\t%12d global faces before cutting\n"),
+ *n_g_faces);
+
+ previous_io_num = fvm_io_num_create(NULL,
+ *p_global_face_num,
+ n_init_faces,
+ 0);
+ new_io_num = fvm_io_num_create_from_sub(previous_io_num,
+ n_sub_elt_lst);
+
+ previous_io_num = fvm_io_num_destroy(previous_io_num);
+
+ *n_g_faces = fvm_io_num_get_global_count(new_io_num);
+
+ global_num = fvm_io_num_get_global_num(new_io_num);
+
+ BFT_REALLOC(*p_global_face_num, n_faces, fvm_gnum_t);
+ size = sizeof(fvm_gnum_t) * n_faces;
+ memcpy(*p_global_face_num, global_num, size);
+
+ bft_printf(_("\t%12d global faces after cutting\n\n"),
+ *n_g_faces);
+
+ new_io_num = fvm_io_num_destroy(new_io_num);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Post-process the warped faces before cutting.
+ *
+ * parameters:
+ * n_i_warp_faces --> number of internal warped faces
+ * n_b_warp_faces --> number of border warped faces
+ * i_warp_face_lst --> internal warped face list
+ * b_warp_face_lst --> border warped face list
+ * i_face_warping --> face warping angle for internal faces
+ * b_face_warping --> face warping angle for internal faces
+ *----------------------------------------------------------------------------*/
+
+static void
+_post_before_cutting(cs_int_t n_i_warp_faces,
+ cs_int_t n_b_warp_faces,
+ cs_int_t i_warp_face_lst[],
+ cs_int_t b_warp_face_lst[],
+ double i_face_warping[],
+ double b_face_warping[])
+{
+ fvm_lnum_t parent_num_shift[2];
+
+ int n_parent_lists = 2;
+ fvm_nodal_t *fvm_mesh = NULL;
+ fvm_writer_t *writer = NULL;
+
+ const cs_int_t writer_id = -1; /* default writer */
+ const void *var_ptr[2] = {NULL, NULL};
+
+ parent_num_shift[0] = 0;
+ parent_num_shift[1] = cs_glob_mesh->n_b_faces;
+
+ if (cs_post_writer_exists(writer_id) == false)
+ return;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ fvm_mesh = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ _("Warped faces to cut"),
+ n_i_warp_faces,
+ n_b_warp_faces,
+ i_warp_face_lst,
+ b_warp_face_lst);
+
+ writer = cs_post_get_writer(writer_id);
+
+ fvm_writer_set_mesh_time(writer, -1, 0.0);
+
+ /* Write a mesh from the selected faces */
+
+ fvm_writer_export_nodal(writer, fvm_mesh);
+
+ /* Write the warping field */
+
+ var_ptr[0] = ((const char *)b_face_warping);
+ var_ptr[1] = ((const char *)i_face_warping);
+
+ fvm_writer_export_field(writer,
+ fvm_mesh,
+ _("Face warping"),
+ FVM_WRITER_PER_ELEMENT,
+ 1,
+ FVM_INTERLACE,
+ n_parent_lists,
+ parent_num_shift,
+ FVM_DOUBLE,
+ (int)-1,
+ (double)0.0,
+ (const void **)var_ptr);
+
+ fvm_mesh = fvm_nodal_destroy(fvm_mesh);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Post-process the warped faces after cutting.
+ *
+ * parameters:
+ * n_i_cut_faces --> number of internal faces generated by cutting
+ * n_b_cut_faces --> number of border faces generated by cutting
+ * i_cut_face_lst --> face warping angle for internal faces
+ * b_cut_face_lst --> face warping angle for internal faces
+ *----------------------------------------------------------------------------*/
+
+static void
+_post_after_cutting(cs_int_t n_i_cut_faces,
+ cs_int_t n_b_cut_faces,
+ cs_int_t i_cut_face_lst[],
+ cs_int_t b_cut_face_lst[])
+{
+ fvm_nodal_t *fvm_mesh = NULL;
+ fvm_writer_t *writer = NULL;
+
+ const cs_int_t writer_id = -1; /* default writer */
+
+ if (cs_post_writer_exists(writer_id) == false)
+ return;
+
+ fvm_mesh = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ _("Warped faces after cutting"),
+ n_i_cut_faces,
+ n_b_cut_faces,
+ i_cut_face_lst,
+ b_cut_face_lst);
+
+ writer = cs_post_get_writer(writer_id);
+
+ fvm_writer_set_mesh_time(writer, -1, 0.0);
+
+ /* Write a mesh from the selected faces */
+
+ fvm_writer_export_nodal(writer, fvm_mesh);
+
+ fvm_mesh = fvm_nodal_destroy(fvm_mesh);
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Cut warped faces.
+ *
+ * Update border face connectivity and associated mesh quantities.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure.
+ * max_warp_angle --> criterion to know which face to cut
+ * post_tag --> tag to know if we have to post-treat cut faces.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_mesh_warping_cut_faces(cs_mesh_t *mesh,
+ double max_warp_angle,
+ cs_bool_t post_tag)
+{
+ cs_int_t i;
+
+ cs_int_t n_i_warp_faces = 0, n_b_warp_faces = 0;
+ cs_int_t n_i_cut_faces = 0, n_b_cut_faces = 0;
+ cs_int_t *i_face_lst = NULL, *b_face_lst = NULL;
+ cs_real_t *i_face_normal = NULL, *b_face_normal = NULL;
+ double *working_array = NULL, *i_face_warping = NULL, *b_face_warping = NULL;
+ fvm_lnum_t *n_i_sub_elt_lst = NULL, *n_b_sub_elt_lst = NULL;
+ fvm_gnum_t n_g_i_warp_faces = 0, n_g_b_warp_faces = 0;
+
+ const cs_int_t n_init_i_faces = mesh->n_i_faces;
+ const cs_int_t n_init_b_faces = mesh->n_b_faces;
+
+#if 0 /* JB DEBUG */
+ cs_mesh_dump(mesh);
+#endif
+
+ bft_printf(_("\n\n Cutting of warped faces requested\n"
+ " ---------------------------------\n\n"
+ " Maximum allowed angle (rad):\t%7.4f\n\n"), max_warp_angle);
+
+ /* Compute face warping */
+
+ BFT_MALLOC(working_array, n_init_i_faces + n_init_b_faces, double);
+
+ for (i = 0; i < n_init_i_faces + n_init_b_faces; i++)
+ working_array[i] = 0.;
+
+ i_face_warping = working_array;
+ b_face_warping = working_array + n_init_i_faces;
+
+ cs_mesh_quantities_face_normal(mesh,
+ &i_face_normal,
+ &b_face_normal);
+
+ cs_mesh_quality_compute_warping(mesh,
+ i_face_normal,
+ b_face_normal,
+ i_face_warping,
+ b_face_warping);
+
+ BFT_FREE(i_face_normal);
+ BFT_FREE(b_face_normal);
+
+ _select_warped_faces(n_init_i_faces,
+ max_warp_angle,
+ i_face_warping,
+ &n_i_warp_faces,
+ &i_face_lst);
+
+ _select_warped_faces(n_init_b_faces,
+ max_warp_angle,
+ b_face_warping,
+ &n_b_warp_faces,
+ &b_face_lst);
+
+ /* Define the global number of faces which need to be cut */
+
+ if (mesh->n_domains > 1) {
+#if defined(HAVE_MPI)
+ MPI_Allreduce(&n_i_warp_faces, &n_g_i_warp_faces, 1, CS_MPI_INT,
+ MPI_SUM, cs_glob_mpi_comm);
+
+ MPI_Allreduce(&n_b_warp_faces, &n_g_b_warp_faces, 1, CS_MPI_INT,
+ MPI_SUM, cs_glob_mpi_comm);
+#endif
+ }
+ else {
+ n_g_i_warp_faces = n_i_warp_faces;
+ n_g_b_warp_faces = n_b_warp_faces;
+ }
+
+ /* Test if there are faces to cut to continue */
+
+ if (n_g_i_warp_faces == 0 && n_g_b_warp_faces == 0) {
+
+ BFT_FREE(i_face_lst);
+ BFT_FREE(b_face_lst);
+ BFT_FREE(working_array);
+
+ bft_printf(_("\n No face to cut. Verify the criterion if necessary.\n"));
+ return;
+
+ }
+
+ /* Post-processing management */
+
+ if (post_tag == true)
+ _post_before_cutting(n_i_warp_faces,
+ n_b_warp_faces,
+ i_face_lst,
+ b_face_lst,
+ i_face_warping,
+ b_face_warping);
+
+ /* Internal face treatment */
+ /* ----------------------- */
+
+ if (mesh->n_init_perio == 0)
+ _cut_warped_faces(mesh,
+ 2,
+ max_warp_angle,
+ i_face_warping,
+ &n_i_cut_faces,
+ &i_face_lst,
+ &n_i_sub_elt_lst,
+ &mesh->n_i_faces,
+ &mesh->i_face_vtx_connect_size,
+ &mesh->i_face_cells,
+ &mesh->i_face_family,
+ &mesh->i_face_vtx_idx,
+ &mesh->i_face_vtx_lst);
+
+ else
+ _cut_warped_faces_perio(mesh,
+ max_warp_angle,
+ i_face_warping,
+ &n_i_cut_faces,
+ &i_face_lst,
+ &n_i_sub_elt_lst,
+ &mesh->n_i_faces,
+ &mesh->i_face_vtx_connect_size,
+ &mesh->i_face_cells,
+ &mesh->i_face_family,
+ &mesh->i_face_vtx_idx,
+ &mesh->i_face_vtx_lst);
+
+ bft_printf(_(" Interior faces:\n"
+ "\t%12d cut faces to respect the criterion\n"
+ "\n"
+ "\t%12d local faces before cutting\n"
+ "\t%12d local faces after cutting\n\n"),
+ n_i_warp_faces, n_init_i_faces, mesh->n_i_faces);
+
+ bft_printf(_(" Size of the new face -> vertices connectivity: %12d\n\n"),
+ mesh->i_face_vtx_connect_size);
+
+ /* Update global number of internal faces and its global numbering */
+
+ _update_cut_faces_num(mesh,
+ mesh->n_i_faces,
+ n_init_i_faces,
+ n_i_sub_elt_lst,
+ &(mesh->n_g_i_faces),
+ &(mesh->global_i_face_num));
+
+ /* Partial memory free */
+
+ BFT_FREE(n_i_sub_elt_lst);
+
+ /* Border face treatment */
+ /* --------------------- */
+
+ _cut_warped_faces(mesh,
+ 1,
+ max_warp_angle,
+ b_face_warping,
+ &n_b_cut_faces,
+ &b_face_lst,
+ &n_b_sub_elt_lst,
+ &mesh->n_b_faces,
+ &mesh->b_face_vtx_connect_size,
+ &mesh->b_face_cells,
+ &mesh->b_face_family,
+ &mesh->b_face_vtx_idx,
+ &mesh->b_face_vtx_lst);
+
+ bft_printf(_(" Boundary faces:\n"
+ "\t%12d cut faces to respect the criterion\n"
+ "\n"
+ "\t%12d local faces before cutting\n"
+ "\t%12d local faces after cutting\n\n"),
+ n_b_warp_faces, n_init_b_faces, mesh->n_b_faces);
+
+ bft_printf(_(" Size of the new face -> vertices connectivity: %12d\n\n"),
+ mesh->b_face_vtx_connect_size);
+
+ /* Update global number of border faces and its global numbering */
+
+ _update_cut_faces_num(mesh,
+ mesh->n_b_faces,
+ n_init_b_faces,
+ n_b_sub_elt_lst,
+ &(mesh->n_g_b_faces),
+ &(mesh->global_b_face_num));
+
+ /* Partial memory free */
+
+ BFT_FREE(n_b_sub_elt_lst);
+
+ /* Post-treatment of the selected faces */
+
+ if (post_tag == true)
+ _post_after_cutting(n_i_cut_faces,
+ n_b_cut_faces,
+ i_face_lst,
+ b_face_lst);
+
+ /* Free memory */
+
+ BFT_FREE(working_array);
+ BFT_FREE(i_face_lst);
+ BFT_FREE(b_face_lst);
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_multigrid.c b/src/base/cs_multigrid.c
new file mode 100644
index 0000000..bc14e49
--- /dev/null
+++ b/src/base/cs_multigrid.c
@@ -0,0 +1,1984 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Multigrid solver.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(__STDC_VERSION__) /* size_t */
+#if (__STDC_VERSION__ == 199901L)
+# include <stddef.h>
+# else
+# include <stdlib.h>
+# endif
+#else
+#include <stdlib.h>
+#endif
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_blas.h"
+#include "cs_grid.h"
+#include "cs_matrix.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_perio.h"
+#include "cs_post.h"
+#include "cs_sles.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_multigrid.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define EPZERO 1.E-12
+#define RINFIN 1.E+30
+
+#if !defined(HUGE_VAL)
+#define HUGE_VAL 1.E+12
+#endif
+
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Local Structure Definitions
+ *----------------------------------------------------------------------------*/
+
+/* Basic per linear system options and logging */
+/*---------------------------------------------*/
+
+typedef struct _cs_multigrid_info_t {
+
+ char *name; /* System name */
+ cs_sles_type_t type[3]; /* Descent/ascent smoother
+ and solver type */
+
+ unsigned n_builds; /* Number of times grids built */
+ unsigned n_solves; /* Number of times system solved */
+
+ unsigned long long n_levels_tot; /* Total accumulated number of
+ grid levels built */
+ unsigned n_levels[3]; /* Number of grid levels:
+ [last, min, max] */
+
+ unsigned n_iterations[3][4]; /* Number of iterations for
+ system resolution:
+ [last, min, max]
+ [finest, coarsest, total,
+ fine grid equivalent] */
+ unsigned long long n_iterations_tot[4]; /* Total accumulated number of
+ iterations:
+ [finest, coarsest, total,
+ fine grid equivalent] */
+
+ double wt_tot[2]; /* Total wall-clock time used:
+ [build, solve] */
+ double cpu_tot[2]; /* Total (local) CPU used:
+ [build, solve] */
+
+} cs_multigrid_info_t;
+
+/* Grid hierarchy */
+/*----------------*/
+
+typedef struct _cs_multigrid_t {
+
+ cs_multigrid_info_t info; /* Multigrid info */
+
+ int n_levels; /* Current number of grid levels */
+ int n_levels_max; /* Maximum number of grid levels */
+
+ int n_levels_post; /* Current number of postprocessed levels */
+ int post_cell_max; /* If > 0, activates postprocessing of
+ coarsening, projecting coarse cell
+ numbers (modulo post_cell_max)
+ on the base grid */
+
+ cs_grid_t **grid_hierarchy; /* Array of grid pointers */
+
+ int **post_cell_num; /* If post_cell_max > 0, array of
+ (n_levels - 1) arrays of projected
+ coarse cell numbers on the base grid */
+
+} cs_multigrid_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+static int cs_glob_multigrid_n_systems = 0; /* Current number of systems */
+static int cs_glob_multigrid_n_max_systems = 0; /* Max. number of sytems for
+ cs_glob_mgrid_systems. */
+
+/* System info array */
+
+static cs_multigrid_t **cs_glob_multigrid_systems = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize multigrid info structure.
+ *
+ * parameters:
+ * name <-- system name
+ * info <-- pointer to multigrid info structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_multigrid_info_init(cs_multigrid_info_t *info,
+ const char *name)
+{
+ int i, j;
+
+ BFT_MALLOC(info->name, strlen(name) + 1, char);
+
+ strcpy(info->name, name);
+
+ for (i = 0; i < 3; i++)
+ info->type[i] = CS_SLES_N_TYPES;
+
+ info->n_builds = 0;
+ info->n_solves = 0;
+
+ info->n_levels_tot = 0;
+
+ for (i = 0; i < 3; i++) {
+ info->n_levels[i] = 0;
+ for (j = 0; j < 4; j++)
+ info->n_iterations[i][j] = 0;
+ }
+
+ for (i = 0; i < 4; i++)
+ info->n_iterations_tot[i] = 0;
+
+ for (i = 0; i < 2; i++) {
+ info->wt_tot[i] = 0.0;
+ info->cpu_tot[i] = 0.0;
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy multigrid info structure.
+ *
+ * parameters:
+ * this_info <-> pointer to linear system info structure pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_multigrid_info_unset(cs_multigrid_info_t *this_info)
+{
+ assert(this_info != NULL);
+
+ BFT_FREE(this_info->name);
+}
+
+/*----------------------------------------------------------------------------
+ * Output information regarding multigrid resolution.
+ *
+ * parameters:
+ * this_info <-> pointer to multigrid info structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_multigrid_info_dump(const cs_multigrid_info_t *this_info)
+{
+ unsigned long long n_builds_denom = CS_MAX(this_info->n_builds, 1);
+ unsigned long long n_solves_denom = CS_MAX(this_info->n_solves, 1);
+ int n_builds = this_info->n_builds;
+ int n_solves = this_info->n_solves;
+ int n_lv_min = this_info->n_levels[1];
+ int n_lv_max = this_info->n_levels[2];
+ int n_lv_mean = (int)(this_info->n_levels_tot / n_builds_denom);
+ int n_it_f_min = this_info->n_iterations[1][0];
+ int n_it_f_max = this_info->n_iterations[2][0];
+ int n_it_c_min = this_info->n_iterations[1][1];
+ int n_it_c_max = this_info->n_iterations[2][1];
+ int n_it_t_min = this_info->n_iterations[1][2];
+ int n_it_t_max = this_info->n_iterations[2][2];
+ int n_it_e_min = this_info->n_iterations[1][3];
+ int n_it_e_max = this_info->n_iterations[2][3];
+ int n_it_f_mean = (int)(this_info->n_iterations_tot[0] / n_solves_denom);
+ int n_it_c_mean = (int)(this_info->n_iterations_tot[1] / n_solves_denom);
+ int n_it_t_mean = (int)(this_info->n_iterations_tot[2] / n_solves_denom);
+ int n_it_e_mean = (int)(this_info->n_iterations_tot[3] / n_solves_denom);
+
+ bft_printf(_("\n"
+ "Summary of multigrid for \"%s\":\n\n"),
+ this_info->name);
+
+ if (this_info->type[0] != CS_SLES_N_TYPES) {
+
+ const char *descent_smoother_name = cs_sles_type_name[this_info->type[0]];
+ const char *ascent_smoother_name = cs_sles_type_name[this_info->type[1]];
+
+ if (this_info->type[0] == this_info->type[1])
+ bft_printf(_(" Smoother: %s\n"), _(descent_smoother_name));
+ else
+ bft_printf(_(" Descent smoother: %s\n"
+ " Ascent smoother: %s\n"),
+ _(descent_smoother_name), _(ascent_smoother_name));
+
+ bft_printf(_(" Coarsest level solver: %s\n"),
+ _(cs_sles_type_name[this_info->type[2]]));
+
+ }
+
+ bft_printf(_(" Number of constructions: %d\n"
+ " Number of resolutions: %d\n"
+ " Number of levels:\n"
+ " minimum: %d\n"
+ " maximum: %d\n"
+ " mean: %d\n"
+ " Number of iterations:\n"
+ " on finest grid:\n"
+ " minimum: %d\n"
+ " maximum: %d\n"
+ " mean: %d\n"
+ " on coarsest grid:\n"
+ " minimum: %d\n"
+ " maximum: %d\n"
+ " mean: %d\n"
+ " total on grids:\n"
+ " minimum: %d\n"
+ " maximum: %d\n"
+ " mean: %d\n"
+ " equivalent (total weighted by number of cells) :\n"
+ " minimum: %d\n"
+ " maximum: %d\n"
+ " mean: %d\n"
+ " Associated times (construction, resolution)\n"
+ " total elapsed: %12.3f %12.3f\n"),
+ n_builds, n_solves, n_lv_min, n_lv_max, n_lv_mean,
+ n_it_f_min, n_it_f_max, n_it_f_mean,
+ n_it_c_min, n_it_c_max, n_it_c_mean,
+ n_it_t_min, n_it_t_max, n_it_t_mean,
+ n_it_e_min, n_it_e_max, n_it_e_mean,
+ this_info->wt_tot[0], this_info->wt_tot[1]);
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ double cpu_min[2], cpu_max[2], cpu_tot[2], cpu_loc[2];
+ cpu_loc[0] = this_info->cpu_tot[0];
+ cpu_loc[1] = this_info->cpu_tot[1];
+
+ MPI_Allreduce(cpu_loc, cpu_min, 2, MPI_DOUBLE, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(cpu_loc, cpu_max, 2, MPI_DOUBLE, MPI_MAX,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(cpu_loc, cpu_tot, 2, MPI_DOUBLE, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ bft_printf(_(" Min local total CPU time: %12.3f %12.3f\n"
+ " Max local total CPU time: %12.3f %12.3f\n"
+ " Total CPU time: %12.3f %12.3f\n"),
+ cpu_min[0], cpu_min[1], cpu_max[0], cpu_max[1],
+ cpu_tot[0], cpu_tot[1]);
+
+ }
+
+#endif
+
+ if (cs_glob_n_ranks == 1)
+ bft_printf(_(" Total CPU time: %12.3f %12.3f\n"),
+ this_info->cpu_tot[0], this_info->cpu_tot[1]);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize multigrid info structure.
+ *
+ * parameters:
+ * name <-- system name
+ *
+ * returns:
+ * pointer to newly created multigrid structure
+ *----------------------------------------------------------------------------*/
+
+static cs_multigrid_t *
+_multigrid_create(const char *name)
+{
+ int ii;
+ cs_multigrid_t *mg;
+
+ BFT_MALLOC(mg, 1, cs_multigrid_t);
+
+ _multigrid_info_init(&(mg->info), name);
+
+ mg->n_levels = 0;
+ mg->n_levels_max = 10;
+
+ mg->n_levels_post = 0;
+ mg->post_cell_max = 0;
+
+ BFT_MALLOC(mg->grid_hierarchy, mg->n_levels_max, cs_grid_t *);
+
+ for (ii = 0; ii < mg->n_levels_max; ii++)
+ mg->grid_hierarchy[ii] = NULL;
+
+ mg->post_cell_num = NULL;
+
+ return mg;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy multigrid structure.
+ *
+ * parameters:
+ * mg <-> pointer multigrid structure pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_multigrid_destroy(cs_multigrid_t **mg)
+{
+ int ii;
+ cs_multigrid_t *_mg = *mg;
+
+ assert(*mg != NULL);
+
+ _multigrid_info_unset(&(_mg->info));
+
+ for (ii = 0; ii < _mg->n_levels_max; ii++)
+ cs_grid_destroy(_mg->grid_hierarchy + ii);
+
+ if (_mg->post_cell_max > 0) {
+ for (ii = 0; ii < _mg->n_levels_max - 1; ii++)
+ if (_mg->post_cell_num[ii] != NULL)
+ BFT_FREE(_mg->post_cell_num[ii]);
+ BFT_FREE(_mg->post_cell_num);
+ }
+
+ BFT_FREE(_mg->grid_hierarchy);
+
+ BFT_FREE(*mg);
+}
+
+/*----------------------------------------------------------------------------
+ * Add grid to multigrid structure hierarchy.
+ *
+ * parameters:
+ * mg <-- multigrid structure
+ * grid <-- grid to add
+ *----------------------------------------------------------------------------*/
+
+static void
+_multigrid_add_level(cs_multigrid_t *mg,
+ cs_grid_t *grid)
+{
+ int ii;
+
+ /* Reallocate arrays if necessary */
+
+ if (mg->n_levels == mg->n_levels_max) {
+
+ if (mg->n_levels_max == 0)
+ mg->n_levels_max = 10;
+ mg->n_levels_max *= 2;
+
+ BFT_REALLOC(mg->grid_hierarchy, mg->n_levels_max, cs_grid_t *);
+ for (ii = mg->n_levels; ii < mg->n_levels_max; ii++)
+ mg->grid_hierarchy[ii] = NULL;
+
+ if (mg->post_cell_num != NULL) {
+ BFT_REALLOC(mg->post_cell_num, mg->n_levels_max, int *);
+ for (ii = mg->n_levels; ii < mg->n_levels_max; ii++)
+ mg->post_cell_num[ii] = NULL;
+ if (mg->n_levels > 0)
+ mg->post_cell_num[mg->n_levels - 1] = NULL;
+ }
+ }
+
+ mg->grid_hierarchy[mg->n_levels] = grid;
+ mg->n_levels += 1;
+}
+
+/*----------------------------------------------------------------------------
+ * Get multigrid structure's id in list of know systems
+ *
+ * parameters:
+ * mg <-- multigrid structure
+ *
+ * returns:
+ * id (0 to n-1) of structure in list of know systems, or -1 otherwise
+ *----------------------------------------------------------------------------*/
+
+static int
+_multigrid_id(const cs_multigrid_t *mg)
+{
+ int id;
+
+ for (id = 0; id < cs_glob_multigrid_n_systems; id++) {
+ if (mg == cs_glob_multigrid_systems[id])
+ break;
+ }
+
+ if (id >= cs_glob_multigrid_n_systems)
+ id = -1;
+
+ return id;
+}
+
+/*----------------------------------------------------------------------------
+ * Return pointer to linear system info.
+ *
+ * If this system did not previously exist, it is added to the list of
+ * "known" systems.
+ *
+ * parameters:
+ * name <-- system name
+ *----------------------------------------------------------------------------*/
+
+static cs_multigrid_t *
+_find_or_add_system(const char *name)
+{
+ int ii, start_id, end_id, mid_id;
+ int cmp_ret = 1;
+
+ /* Use binary search to find system */
+
+ start_id = 0;
+ end_id = cs_glob_multigrid_n_systems - 1;
+ mid_id = start_id + ((end_id -start_id) / 2);
+
+ while (start_id <= end_id) {
+ cmp_ret = strcmp((cs_glob_multigrid_systems[mid_id])->info.name, name);
+ if (cmp_ret < 0)
+ start_id = mid_id + 1;
+ else if (cmp_ret > 0)
+ end_id = mid_id - 1;
+ else
+ break;
+ mid_id = start_id + ((end_id -start_id) / 2);
+ }
+
+ /* If found, return */
+
+ if (cmp_ret == 0)
+ return cs_glob_multigrid_systems[mid_id];
+
+ /* Reallocate global array if necessary */
+
+ if (cs_glob_multigrid_n_systems >= cs_glob_multigrid_n_max_systems) {
+
+ if (cs_glob_multigrid_n_max_systems == 0)
+ cs_glob_multigrid_n_max_systems = 10;
+ else
+ cs_glob_multigrid_n_max_systems *= 2;
+ BFT_REALLOC(cs_glob_multigrid_systems,
+ cs_glob_multigrid_n_max_systems,
+ cs_multigrid_t *);
+
+ for (ii = cs_glob_multigrid_n_systems;
+ ii < cs_glob_multigrid_n_max_systems;
+ ii++)
+ cs_glob_multigrid_systems[ii] = NULL;
+
+ }
+
+ /* Insert in sorted list */
+
+ for (ii = cs_glob_multigrid_n_systems; ii > mid_id; ii--)
+ cs_glob_multigrid_systems[ii] = cs_glob_multigrid_systems[ii - 1];
+
+ cs_glob_multigrid_systems[mid_id] = _multigrid_create(name);
+ cs_glob_multigrid_n_systems += 1;
+
+ return cs_glob_multigrid_systems[mid_id];
+}
+
+/*----------------------------------------------------------------------------
+ * Add postprocessing info to multigrid hierarchy
+ *
+ * parameters:
+ * mg <-> multigrid structure
+ * n_base_cells <-- number of cells in base grid
+ *----------------------------------------------------------------------------*/
+
+static void
+_multigrid_add_post(cs_multigrid_t *mg,
+ fvm_lnum_t n_base_cells)
+{
+ int ii;
+
+ assert(mg != NULL);
+
+ if (mg->post_cell_max < 1)
+ return;
+
+ mg->n_levels_post = mg->n_levels - 1;
+
+ assert(mg->n_levels_post < mg->n_levels_max);
+
+ /* Reallocate arrays if necessary */
+
+ if (mg->post_cell_num == NULL) {
+ BFT_MALLOC(mg->post_cell_num, mg->n_levels_max, int *);
+ for (ii = 0; ii < mg->n_levels_max; ii++)
+ mg->post_cell_num[ii] = NULL;
+ }
+
+ for (ii = 0; ii < mg->n_levels_post; ii++) {
+ BFT_REALLOC(mg->post_cell_num[ii], n_base_cells, int);
+ cs_grid_project_cell_num(mg->grid_hierarchy[ii+1],
+ n_base_cells,
+ mg->post_cell_max,
+ mg->post_cell_num[ii]);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Post process variables associated with Syrthes couplings
+ *
+ * parameters:
+ * hierarchy_id <-- Id of multigrid hierarchy
+ * nt_cur_abs <-- Current time step
+ * t_cur_abs <-- Current time value
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_multigrid_post_function(cs_int_t hierarchy_id,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs)
+{
+ int ii;
+ size_t name_len;
+ char *var_name = NULL;
+ cs_multigrid_t *mg = NULL;
+ const char name_prefix[] = "mg";
+ const char *base_name = NULL;
+
+ /* Return if necessary structures inconsistant or have been destroyed */
+
+ if (hierarchy_id < cs_glob_multigrid_n_systems)
+ mg = cs_glob_multigrid_systems[hierarchy_id];
+
+ if (mg == NULL)
+ return;
+
+ if (mg->post_cell_num == NULL || cs_post_mesh_exists(-1) != true)
+ return;
+
+ /* Allocate name buffer */
+
+ base_name = mg->info.name;
+ name_len = strlen(name_prefix) + 1 + strlen(base_name) + 1 + 3 + 1 + 4 + 1;
+ BFT_MALLOC(var_name, name_len, char);
+
+ /* Loop on grid levels */
+
+ for (ii = 0; ii < mg->n_levels_post; ii++) {
+
+ sprintf(var_name, "%s %s %3d %2d",
+ name_prefix, base_name, (int)(ii+1), (int)nt_cur_abs);
+
+ cs_post_write_var(-1,
+ var_name,
+ 1,
+ false,
+ true,
+ CS_POST_TYPE_int,
+ -1,
+ 0.0,
+ mg->post_cell_num[ii],
+ NULL,
+ NULL);
+
+ BFT_FREE(mg->post_cell_num[ii]);
+
+ }
+ mg->n_levels_post = 0;
+
+ BFT_FREE(var_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute dot product, summing result over all ranks.
+ *
+ * parameters:
+ * n_elts <-- Local number of elements
+ * x <-- first vector in s = x.y
+ * y <-- second vector in s = x.y
+ *
+ * returns:
+ * result of s = x.y
+ *----------------------------------------------------------------------------*/
+
+inline static double
+_dot_product(cs_int_t n_elts,
+ const cs_real_t *x,
+ const cs_real_t *y)
+{
+ double s = cblas_ddot(n_elts, x, 1, y, 1);
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+ double _sum;
+ MPI_Allreduce(&s, &_sum, 1, MPI_DOUBLE, MPI_SUM, cs_glob_mpi_comm);
+ s = _sum;
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ return s;
+}
+
+/*----------------------------------------------------------------------------
+ * Test if convergence is attained.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * n_f_cells <-- Number of cells on fine mesh
+ * n_max_cycles <-- Maximum number of cycles
+ * cycle_id <-- Number of current cycle
+ *
+ * verbosity <-- Verbosity level
+ * n_iters <-- Number of iterations
+ * precision <-- Precision limit
+ * r_norm <-- Residue normalization
+ * residue <-> Residue
+ * rhs --> Right-hand side
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * cycle number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+static int
+_convergence_test(const char *var_name,
+ cs_int_t n_f_cells,
+ int n_max_cycles,
+ int cycle_id,
+ int verbosity,
+ int n_iters,
+ double precision,
+ double r_norm,
+ double *residue,
+ cs_real_t *rhs)
+{
+ const char cycle_h_fmt[]
+ = N_(" ---------------------------------------------------\n"
+ " n. | Cumulative iterations | Norm. residual\n"
+ " cycles | on fine mesh | on fine mesh\n"
+ " ---------------------------------------------------\n");
+ const char cycle_t_fmt[]
+ = N_(" ---------------------------------------------------\n");
+ const char cycle_cv_fmt[]
+ = N_(" %4d | %6d | %12.4e\n");
+
+ const char cycle_fmt[]
+ = N_(" N. cycles: %4d; Fine mesh cumulative iter: %5d; "
+ "Norm. residual %12.4e\n");
+
+ static double initial_residue = 0.;
+
+ /* Compute residue */
+
+ *residue = sqrt(_dot_product(n_f_cells, rhs, rhs));
+
+ if (cycle_id == 1)
+ initial_residue = *residue;
+
+ if (*residue < precision*r_norm) {
+
+ if (verbosity == 2)
+ bft_printf(_(cycle_fmt), cycle_id, n_iters, *residue/r_norm);
+ else if (verbosity > 2) {
+ bft_printf(_(cycle_h_fmt));
+ bft_printf(_(cycle_cv_fmt),
+ cycle_id, n_iters, *residue/r_norm);
+ bft_printf(_(cycle_t_fmt));
+ }
+ return 1;
+ }
+
+ else if (cycle_id >= n_max_cycles) {
+
+ if (verbosity > 0) {
+ if (verbosity == 1)
+ bft_printf(_(cycle_fmt), cycle_id, n_iters, *residue/r_norm);
+ else if (verbosity > 1) {
+ bft_printf(_(cycle_h_fmt));
+ bft_printf(_(cycle_fmt),
+ cycle_id, n_iters, *residue/r_norm);
+ bft_printf(_(cycle_t_fmt));
+ }
+ bft_printf(_(" @@ Warning: algebraic multigrid for [%s]\n"
+ " ********\n"
+ " Maximum number of cycles (%d) reached.\n"),
+ var_name, n_max_cycles);
+
+ }
+ return -1;
+ }
+
+ else {
+
+ if (verbosity > 2)
+ bft_printf(_(cycle_fmt), cycle_id, n_iters, *residue/r_norm);
+
+ if (*residue > initial_residue * 10000.0 && *residue > 100.)
+ return -2;
+
+#if (_CS_STDC_VERSION >= 199901L)
+ if (isnan(*residue) || isinf(*residue))
+ return -2;
+#endif
+ }
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------
+ * Handle error output in case if divergence.
+ *
+ * Depending on the multigrid level at which divergence is detected,
+ * output matrix hierarchy information, RHS, and variable info,
+ * and finally abort on error.
+ *
+ * parameters:
+ * mg <-- Multigrid system
+ * level <-- Multigrid level at which divergence is detected
+ * symmetric <-- Symmetric coefficients indicator
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * cycle_id <-- Id of currect cycle
+ * initial_residue <-- Initial residue
+ * residue <-- Residue
+ * rhs <-- Right hand side
+ * vx <-- System solution
+ * c_rhs <-- Right hand side for levels > 0
+ * c_vx <-- System solution for levels > 0
+ *----------------------------------------------------------------------------*/
+
+static void
+_abort_on_divergence(cs_multigrid_t *mg,
+ int level,
+ cs_bool_t symmetric,
+ cs_perio_rota_t rotation_mode,
+ int cycle_id,
+ double initial_residue,
+ double residue,
+ const cs_real_t rhs[],
+ cs_real_t vx[],
+ cs_real_t **c_rhs,
+ cs_real_t **c_vx)
+{
+ int mesh_id = cs_post_init_error_writer_cells();
+
+ if (mesh_id != 0) {
+
+ char var_name[32];
+
+ int lv_id = 0;
+ cs_real_t *var = NULL;
+
+ const cs_real_t *_da = NULL, *_xa = NULL;
+ const cs_grid_t *g = mg->grid_hierarchy[0];
+ const fvm_lnum_t n_base_cells = cs_grid_get_n_cells(g);
+
+ BFT_MALLOC(var, cs_grid_get_n_cells_ext(g), cs_real_t);
+
+ /* Output info on main level */
+
+ cs_grid_get_matrix(g, &_da, &_xa, NULL);
+
+ cs_sles_post_error_output_def(mg->info.name,
+ mesh_id,
+ symmetric,
+ rotation_mode,
+ _da,
+ _xa,
+ rhs,
+ vx);
+
+ /* Output diagonal and diagonal dominance for all coarse levels */
+
+ for (lv_id = 1; lv_id < mg->n_levels; lv_id++) {
+
+ g = mg->grid_hierarchy[lv_id];
+
+ cs_grid_get_matrix(g, &_da, NULL, NULL);
+
+ cs_grid_project_var(g, n_base_cells, _da, var);
+ sprintf(var_name, "Diag_%04d", lv_id);
+ cs_sles_post_error_output_var(var_name, mesh_id, var);
+
+ cs_grid_project_diag_dom(g, n_base_cells, var);
+ sprintf(var_name, "Diag_Dom_%04d", lv_id);
+ cs_sles_post_error_output_var(var_name, mesh_id, var);
+ }
+
+ /* Output info on current level if > 0 */
+
+ if (level > 0) {
+
+ fvm_lnum_t ii;
+ fvm_lnum_t n_cells = 0;
+ fvm_lnum_t n_cells_ext = 0;
+
+ cs_real_t *c_res = NULL;
+ cs_matrix_t *_matrix = NULL;
+
+ g = mg->grid_hierarchy[level];
+ n_cells = cs_grid_get_n_cells(g);
+ n_cells_ext = cs_grid_get_n_cells_ext(g);
+
+ cs_grid_project_var(g, n_base_cells, c_rhs[level], var);
+ sprintf(var_name, "RHS_%04d", level);
+ cs_sles_post_error_output_var(var_name, mesh_id, var);
+
+ cs_grid_project_var(g, n_base_cells, c_vx[level], var);
+ sprintf(var_name, "X_%04d", level);
+ cs_sles_post_error_output_var(var_name, mesh_id, var);
+
+ /* Compute residual */
+
+ BFT_MALLOC(c_res, n_cells_ext, cs_real_t);
+
+ cs_grid_get_matrix(g, &_da, &_xa, &_matrix);
+ cs_matrix_set_coefficients(_matrix, symmetric, _da, _xa);
+
+ cs_matrix_vector_multiply(rotation_mode, _matrix, c_vx[level], c_res);
+
+ for (ii = 0; ii < n_cells; ii++)
+ c_res[ii] = fabs(c_res[ii] - c_rhs[level][ii]);
+
+ cs_grid_project_var(g, n_base_cells, c_res, var);
+
+ BFT_FREE(c_res);
+
+ sprintf(var_name, "Residual_%04d", level);
+ cs_sles_post_error_output_var(var_name, mesh_id, var);
+ }
+
+ cs_post_finalize();
+ }
+
+ /* Now abort */
+
+ if (level == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("algebraic multigrid [%s]: divergence after %d cycles:\n"
+ " initial residual: %11.4e; current residual: %11.4e"),
+ _(mg->info.name), cycle_id, initial_residue, residue);
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("algebraic multigrid [%s]: divergence after %d cycles\n"
+ " during resolution at level %d:\n"
+ " initial residual: %11.4e; current residual: %11.4e"),
+ _(mg->info.name), cycle_id, level, initial_residue, residue);
+}
+
+/*----------------------------------------------------------------------------
+ * Sparse linear system resolution using multigrid.
+ *
+ * parameters:
+ * mg <-- Multigrid system
+ * descent_smoother_type <-- Type of smoother for descent (PCG, Jacobi, ...)
+ * ascent_smoother_type <-- Type of smoother for ascent (PCG, Jacobi, ...)
+ * coarse_solver_type <-- Type of solver (PCG, Jacobi, ...)
+ * symmetric <-- Symmetric coefficients indicator
+ * poly_degree <-- Preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * verbosity <-- Verbosity level
+ * cycle_id <-- Id of currect cycle
+ * n_max_cycles <-- Maximum number of cycles
+ * n_max_iter <-- Maximum number of iterations per grid level
+ * n_max_iter[level * 2] for descent
+ * n_max_iter[level * 2 + 1] for ascent
+ * precision <-- Precision limit
+ * r_norm <-- Residue normalization
+ * n_level_iter <-> Number of iterations per level
+ * residue <-> Residue
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *
+ * Returns
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * cycle number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+static int
+_multigrid_cycle(cs_multigrid_t *mg,
+ cs_sles_type_t descent_smoother_type,
+ cs_sles_type_t ascent_smoother_type,
+ cs_sles_type_t coarse_solver_type,
+ cs_bool_t symmetric,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ int verbosity,
+ int cycle_id,
+ int n_max_cycles,
+ const int n_max_iter[],
+ double precision,
+ double r_norm,
+ int n_level_iter[],
+ double *residue,
+ const cs_real_t *rhs,
+ cs_real_t *vx,
+ size_t aux_size,
+ void *aux_vectors)
+{
+ int level, coarsest_level;
+ fvm_lnum_t ii;
+
+ int cvg = 0, c_cvg = 0;
+ int n_iter = 0;
+ size_t alloc_size = 0;
+ cs_real_t c_precision = precision;
+ cs_real_t _residue = -1.;
+
+ size_t _aux_size = aux_size;
+ fvm_lnum_t n_cells = 0, n_cells_ext = 0;
+ cs_real_t r_norm_l = r_norm;
+
+ char _var_lv_name[33];
+ char *var_lv_name = _var_lv_name;
+
+ double initial_residue = *residue;
+ double _initial_residue = 0.;
+
+ cs_real_t *_aux_vectors = aux_vectors;
+ cs_real_t *wr = NULL;
+ cs_real_t *_rhs_vx_val = NULL;
+ cs_real_t **_rhs_vx = NULL, **_rhs = NULL, **_vx = NULL;
+ cs_matrix_t *_matrix;
+ cs_multigrid_info_t *mg_info = NULL;
+
+ const char *var_name = NULL;
+ const cs_real_t *_rhs_level = NULL;
+ const cs_real_t *_da = NULL, *_xa = NULL;
+ const cs_grid_t *f = NULL, *c= NULL;
+
+ cs_bool_t end_cycle = false;
+
+ /* Initialization */
+
+ mg_info = &(mg->info);
+ var_name = mg_info->name;
+
+ coarsest_level = mg->n_levels - 1;
+
+ /* In theory, one should increase precision on coarsest mesh,
+ but in practice, it more efficient to have a lower precision */
+ /* c_precision = precision * 0.01; */
+ c_precision = precision;
+
+ f = mg->grid_hierarchy[0];
+
+ cs_grid_get_info(f,
+ NULL,
+ NULL,
+ &n_cells,
+ &n_cells_ext,
+ NULL,
+ NULL);
+
+ if (strlen(var_name) + 5 > 32)
+ BFT_MALLOC(var_lv_name, strlen(var_name) + 5 + 1, char);
+
+ /* Allocate wr or use working area */
+
+ if (aux_size >= (size_t)n_cells_ext) {
+ wr = aux_vectors;
+ _aux_vectors = wr + n_cells_ext;
+ _aux_size = aux_size - n_cells_ext;
+ }
+ else
+ BFT_MALLOC(wr, n_cells_ext, cs_real_t);
+
+ /* reserve memory for rhs and vx;
+ for the finest level, simply point to input and output arrays */
+
+ BFT_MALLOC(_rhs_vx, mg->n_levels*2, cs_real_t *);
+ _rhs = _rhs_vx;
+ _vx = _rhs_vx + mg->n_levels;
+
+ _rhs[0] = NULL; /* Use _rhs_level when necessary to avoid const warning */
+ _vx[0] = vx;
+
+ /* Reserve memory for corrections and residues for coarse levels */
+
+ if (mg->n_levels > 1) {
+
+ alloc_size = 0;
+
+ for (level = 1; level < mg->n_levels; level++)
+ alloc_size += cs_grid_get_n_cells_ext(mg->grid_hierarchy[level]);
+
+ BFT_MALLOC(_rhs_vx_val, alloc_size*2, cs_real_t);
+
+ _rhs[1] = _rhs_vx_val;
+ _vx[1] = _rhs_vx_val + alloc_size;
+
+ for (level = 2; level < mg->n_levels; level++) {
+ fvm_lnum_t _n_cells_ext_prev
+ = cs_grid_get_n_cells_ext(mg->grid_hierarchy[level-1]);
+ _rhs[level] = _rhs[level - 1] + _n_cells_ext_prev;
+ _vx[level] = _vx[level - 1] + _n_cells_ext_prev;
+ }
+ }
+
+ /* Descent */
+ /*---------*/
+
+ if (verbosity > 2)
+ bft_printf(_(" Multigrid cycle: descent\n"));
+
+ for (level = 0; level < coarsest_level; level++) {
+
+ _rhs_level = (level == 0) ? rhs : _rhs[level];
+
+ sprintf(var_lv_name, "%s:%04d", var_name, level);
+
+ c = mg->grid_hierarchy[level+1];
+
+ /* Smoother pass */
+
+ if (verbosity > 2)
+ bft_printf(_(" level %3d: smoother\n"), level);
+
+ cs_grid_get_matrix(f, &_da, &_xa, &_matrix);
+
+ _initial_residue = _residue;
+
+ c_cvg = cs_sles_solve(var_lv_name,
+ descent_smoother_type,
+ false, /* Stats not updated here */
+ symmetric,
+ _da,
+ _xa,
+ _matrix,
+ NULL,
+ poly_degree,
+ rotation_mode,
+ verbosity - 2,
+ n_max_iter[level*2],
+ precision,
+ r_norm_l,
+ &n_iter,
+ &_residue,
+ _rhs_level,
+ _vx[level],
+ _aux_size,
+ _aux_vectors);
+
+ if (c_cvg == -2)
+ _abort_on_divergence(mg, level,
+ symmetric, rotation_mode, cycle_id,
+ _initial_residue, _residue,
+ rhs, vx, _rhs, _vx);
+
+ n_level_iter[level] += n_iter;
+
+ /* Restrict residue
+ TODO: get residue from cs_sles_solve(). This optimisation would
+ require adding an argument and exercising caution to ensure the
+ correct sign and meaning of the residue. */
+
+ cs_matrix_set_coefficients(_matrix, symmetric, _da, _xa);
+
+ cs_matrix_vector_multiply(rotation_mode,
+ _matrix,
+ _vx[level],
+ wr);
+
+ for (ii = 0; ii < n_cells; ii++)
+ wr[ii] = _rhs_level[ii] - wr[ii];
+
+ n_level_iter[level] += 1;
+
+ /* Convergence test in beginning of cycle (fine mesh) */
+
+ if (level == 0) {
+
+ cvg = _convergence_test(var_name,
+ n_cells,
+ n_max_cycles,
+ cycle_id,
+ verbosity,
+ n_level_iter[0],
+ precision,
+ r_norm,
+ residue,
+ wr);
+
+ /* If converged or cycle limit reached, break from descent loop */
+
+ if (cvg != 0) {
+ if (cvg == -2)
+ _abort_on_divergence(mg, level,
+ symmetric, rotation_mode, cycle_id,
+ initial_residue, *residue,
+ rhs, vx, _rhs, _vx);
+ end_cycle = true;
+ break;
+ }
+
+ }
+
+ /* Prepare for next level */
+
+ cs_grid_restrict_cell_var(f, c, wr, _rhs[level+1]);
+
+ cs_grid_get_info(c,
+ NULL,
+ NULL,
+ &n_cells,
+ &n_cells_ext,
+ NULL,
+ NULL);
+
+ f = c;
+
+ for (ii = 0; ii < n_cells; ii++) /* Initialize correction */
+ _vx[level+1][ii] = 0.0;
+
+ } /* End of loop on levels (descent) */
+
+ if (end_cycle == false) {
+
+ /* Resolve coarsest level to convergence */
+ /*---------------------------------------*/
+
+ if (verbosity > 2)
+ bft_printf(_(" Resolution on coarsest level\n"));
+
+ assert(level = coarsest_level);
+ assert(c == mg->grid_hierarchy[coarsest_level]);
+
+ /* coarsest level == 0 should never happen, but we play it safe */
+ _rhs_level = (level == 0) ? rhs : _rhs[coarsest_level];
+
+ sprintf(var_lv_name, "%s:%04d", var_name, coarsest_level);
+
+ cs_grid_get_matrix(c, &_da, &_xa, &_matrix);
+
+ _initial_residue = _residue;
+
+ c_cvg = cs_sles_solve(var_lv_name,
+ coarse_solver_type,
+ false, /* Stats not updated here */
+ symmetric,
+ _da,
+ _xa,
+ _matrix,
+ NULL,
+ poly_degree,
+ rotation_mode,
+ verbosity - 2,
+ n_max_iter[level*2],
+ c_precision,
+ r_norm_l,
+ &n_iter,
+ &_residue,
+ _rhs_level,
+ _vx[level],
+ _aux_size,
+ _aux_vectors);
+
+ if (c_cvg == -2)
+ _abort_on_divergence(mg, level,
+ symmetric, rotation_mode, cycle_id,
+ _initial_residue, _residue,
+ rhs, vx, _rhs, _vx);
+
+ n_level_iter[level] += n_iter;
+
+ /* Ascent */
+ /*--------*/
+
+ if (verbosity > 2)
+ bft_printf(_(" Multigrid cycle: ascent\n"));
+
+ for (level = coarsest_level - 1; level > -1; level--) {
+
+ cs_real_t *_f_vx = _vx[level];
+
+ c = mg->grid_hierarchy[level+1];
+ f = mg->grid_hierarchy[level];
+
+ cs_grid_get_info(f,
+ NULL,
+ NULL,
+ &n_cells,
+ &n_cells_ext,
+ NULL,
+ NULL);
+
+ /* Prolong correction */
+
+ cs_grid_prolong_cell_var(c, f, _vx[level+1], wr);
+
+ for (ii = 0; ii < n_cells; ii++)
+ _f_vx[ii] += wr[ii];
+
+ /* Smoother pass if level > 0
+ (smoother not called for finest mesh, as it will be called in
+ descent phase of the next cycle, before the convergence test). */
+
+ if (level > 0) {
+
+ if (verbosity > 2)
+ bft_printf(_(" level %3d: smoother\n"), level);
+
+ sprintf(var_lv_name, "%s:%04d", var_name, level);
+
+ cs_grid_get_matrix(f, &_da, &_xa, &_matrix);
+
+ _initial_residue = _residue;
+
+ c_cvg = cs_sles_solve(var_lv_name,
+ ascent_smoother_type,
+ false, /* Stats not updated here */
+ symmetric,
+ _da,
+ _xa,
+ _matrix,
+ NULL,
+ poly_degree,
+ rotation_mode,
+ verbosity - 2,
+ n_max_iter[level*2 + 1],
+ precision,
+ r_norm_l,
+ &n_iter,
+ &_residue,
+ _rhs[level],
+ _vx[level],
+ _aux_size,
+ _aux_vectors);
+
+ if (c_cvg == -2)
+ _abort_on_divergence(mg, level,
+ symmetric, rotation_mode, cycle_id,
+ _initial_residue, _residue,
+ rhs, vx, _rhs, _vx);
+
+ n_level_iter[level] += n_iter;
+ }
+
+ } /* End loop on levels (ascent) */
+
+ } /* End of test on end_cycle */
+
+ /* Free memory */
+
+ if (var_lv_name != _var_lv_name)
+ BFT_FREE(var_lv_name);
+
+ if (wr != aux_vectors)
+ BFT_FREE(wr);
+
+ BFT_FREE(_rhs_vx);
+ BFT_FREE(_rhs_vx_val);
+
+ return cvg;
+}
+
+/*----------------------------------------------------------------------------
+ * Sparse linear system resolution using multigrid.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * descent_smoother_type <-- Type of smoother for descent (PCG, Jacobi, ...)
+ * ascent_smoother_type <-- Type of smoother for ascent (PCG, Jacobi, ...)
+ * coarse_solver_type <-- Type of solver (PCG, Jacobi, ...)
+ * symmetric <-- Symmetric coefficients indicator
+ * poly_degree <-- Preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * verbosity <-- Verbosity level
+ * n_max_cycles <-- Maximum number of cycles
+ * n_max_iter_descent <-- Maximum nb. of iterations for descent phases
+ * n_max_iter_ascent <-- Maximum nb. of iterations for ascent phases
+ * n_max_iter_coarse <-- Maximum nb. of iterations for coarsest solution
+ * precision <-- Precision limit
+ * r_norm <-- Residue normalization
+ * n_cycles --> Number of cycles
+ * n_iter --> Number of iterations
+ * residue <-> Residue
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *----------------------------------------------------------------------------*/
+
+static void
+_multigrid_solve(const char *var_name,
+ cs_sles_type_t descent_smoother_type,
+ cs_sles_type_t ascent_smoother_type,
+ cs_sles_type_t coarse_solver_type,
+ cs_bool_t symmetric,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ int verbosity,
+ int n_max_cycles,
+ int n_max_iter_descent,
+ int n_max_iter_ascent,
+ int n_max_iter_coarse,
+ double precision,
+ double r_norm,
+ int *n_cycles,
+ int *n_iter,
+ double *residue,
+ const cs_real_t *rhs,
+ cs_real_t *vx,
+ size_t aux_size,
+ void *aux_vectors)
+{
+ int ii;
+ unsigned _n_iter[4] = {0, 0, 0, 0};
+
+ fvm_lnum_t n_cells = 0;
+
+ cs_multigrid_t *mg = NULL;
+ cs_multigrid_info_t *mg_info = NULL;
+ double wt_start = 0.0, wt_stop = 0.0;
+ double cpu_start = 0.0, cpu_stop = 0.0;
+
+ wt_start =bft_timer_wtime();
+ cpu_start =bft_timer_cpu_time();
+ mg = _find_or_add_system(var_name);
+ mg_info = &(mg->info);
+
+ cs_grid_get_info(mg->grid_hierarchy[0],
+ NULL,
+ NULL,
+ &n_cells,
+ NULL,
+ NULL,
+ NULL);
+
+ /* Initialize number of iterations and residue,
+ check for immediate return,
+ solve sparse linear system using multigrid algorithm. */
+
+ *n_cycles = 0;
+ *n_iter = 0;
+
+ if (cs_sles_needs_solving(var_name,
+ _("Multigrid"),
+ n_cells,
+ verbosity,
+ r_norm,
+ residue,
+ rhs) != 0) {
+
+ int cycle_id = 1, cvg = 0;
+ double it_count_num = 0.0;
+
+ int *n_max_iter = NULL;
+ int *n_level_iter = NULL;
+ size_t _aux_size = n_cells * 6;
+ cs_real_t *_aux_vectors = aux_vectors;
+
+ BFT_MALLOC(n_max_iter, mg->n_levels * 2, int);
+ BFT_MALLOC(n_level_iter, mg->n_levels, int);
+
+ if (_aux_size <= aux_size)
+ BFT_MALLOC(_aux_vectors, _aux_size, cs_real_t);
+ else
+ _aux_size = aux_size;
+
+ for (ii = 0; ii < mg->n_levels; ii++) {
+ n_max_iter[ii*2] = n_max_iter_descent;
+ n_max_iter[ii*2 + 1] = n_max_iter_ascent;
+ n_level_iter[ii] = 0;
+ }
+ n_max_iter[(mg->n_levels-1)*2] = n_max_iter_coarse;
+ n_max_iter[(mg->n_levels-1)*2 + 1] = n_max_iter_coarse;
+
+ if (verbosity == 2) /* More detailed headers later if > 2 */
+ bft_printf(_("Multigrid [%s]:\n"), var_name);
+
+ /* Cycle to solution */
+
+ while (cvg == 0) {
+
+ if (verbosity > 2)
+ bft_printf(_("Multigrid [%s]: cycle %4d\n"),
+ var_name, cycle_id);
+
+ cvg = _multigrid_cycle(mg,
+ descent_smoother_type,
+ ascent_smoother_type,
+ coarse_solver_type,
+ symmetric,
+ poly_degree,
+ rotation_mode,
+ verbosity,
+ cycle_id,
+ n_max_cycles,
+ n_max_iter,
+ precision,
+ r_norm,
+ n_level_iter,
+ residue,
+ rhs,
+ vx,
+ aux_size,
+ _aux_vectors);
+
+ cycle_id++;
+ *n_cycles += 1;
+ }
+
+ _n_iter[0] = n_level_iter[0];
+ _n_iter[1] = n_level_iter[mg->n_levels - 1];
+
+ for (ii = 0; ii < mg->n_levels; ii++)
+ _n_iter[2] += n_level_iter[ii];
+
+ /* Estimate "equivalent" iterations */
+
+ for (ii = 0; ii < mg->n_levels; ii++) {
+ fvm_gnum_t n_g_cells = cs_grid_get_n_g_cells(mg->grid_hierarchy[ii]);
+ it_count_num += n_g_cells * n_level_iter[ii];
+ _n_iter[2] += n_level_iter[ii];
+ }
+
+ _n_iter[3] = (int)( it_count_num
+ / cs_grid_get_n_g_cells(mg->grid_hierarchy[0]));
+ *n_iter = _n_iter[3];
+
+ if (_aux_vectors != aux_vectors)
+ BFT_FREE(_aux_vectors);
+ BFT_FREE(n_level_iter);
+ BFT_FREE(n_max_iter);
+ }
+
+ /* Update statistics */
+
+ wt_stop =bft_timer_wtime();
+ cpu_stop =bft_timer_cpu_time();
+
+ /* Update stats on number of iterations (last, min, max, total) */
+
+ mg_info->type[0] = descent_smoother_type;
+ mg_info->type[1] = ascent_smoother_type;
+ mg_info->type[2] = coarse_solver_type;
+
+ for (ii = 0; ii < 4; ii++)
+ mg_info->n_iterations[0][ii] = _n_iter[ii];
+
+ if (mg_info->n_solves > 0) {
+ for (ii = 0; ii < 4; ii++) {
+ if (mg_info->n_iterations[1][ii] > _n_iter[ii])
+ mg_info->n_iterations[1][ii] = _n_iter[ii];
+ if (mg_info->n_iterations[2][ii] < _n_iter[ii])
+ mg_info->n_iterations[2][ii] = _n_iter[ii];
+ }
+ }
+ else {
+ for (ii = 0; ii < 4; ii++) {
+ mg_info->n_iterations[1][ii] = _n_iter[ii];
+ mg_info->n_iterations[2][ii] = _n_iter[ii];
+ }
+ }
+
+ for (ii = 0; ii < 4; ii++)
+ mg_info->n_iterations_tot[ii] += _n_iter[ii];
+
+ /* Update number of resolutions and timing data */
+
+ mg_info->n_solves += 1;
+
+ mg_info->wt_tot[1] += (wt_stop - wt_start);
+ mg_info->cpu_tot[1] += (cpu_stop - cpu_start);
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build a hierarchy of meshes starting from a fine mesh, for an
+ * ACM (Additive Corrective Multigrid) method, grouping cells at
+ * most 2 by 2.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(clmlga, CLMLGA)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname, /* <-- variable name length */
+ const cs_int_t *ncelet, /* <-- Number of cells, halo included */
+ const cs_int_t *ncel, /* <-- Number of local cells */
+ const cs_int_t *nfac, /* <-- Number of internal faces */
+ const cs_int_t *isym, /* <-- Symmetry indicator:
+ 1: symmetric; 2: not symmetric */
+ cs_int_t *iagmax, /* <-> Maximum agglomeration count */
+ const cs_int_t *nagmax, /* <-- Agglomeration count limit */
+ const cs_int_t *ncpost, /* <-- If > 0, postprocess coarsening, using
+ coarse cell numbers modulo ncpost */
+ const cs_int_t *iwarnp, /* <-- Verbosity level */
+ const cs_int_t *ngrmax, /* <-- Maximum number of grid levels */
+ const cs_int_t *ncegrm, /* <-- Maximum local number of cells on
+ coarsest grid */
+ const cs_real_t *dam, /* <-- Matrix diagonal */
+ const cs_real_t *xam /* <-- Matrix extra-diagonal terms */
+)
+{
+ char *var_name;
+ double wt_start, wt_stop, cpu_start, cpu_stop;
+
+ fvm_lnum_t n_cells = 0;
+ fvm_lnum_t n_faces = 0;
+ fvm_gnum_t n_g_cells = 0;
+ fvm_gnum_t n_g_cells_prev = 0;
+
+ cs_int_t grid_lv = 0;
+ cs_multigrid_t *mg = NULL;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_mesh_quantities_t *mq = cs_glob_mesh_quantities;
+
+ cs_grid_t *g = NULL;
+
+ cs_bool_t symmetric = (*isym == 1) ? true : false;
+
+ assert(*ncelet >= *ncel);
+ assert(*nfac > 0);
+
+ /* Initialization */
+
+ wt_start = bft_timer_wtime();
+ cpu_start = bft_timer_cpu_time();
+
+ var_name = cs_base_string_f_to_c_create(cname, *lname);
+
+ mg = _find_or_add_system(var_name);
+
+ if (*iwarnp > 1)
+ bft_printf(_("\n Construction of grid hierarchy for \"%s\"\n"),
+ var_name);
+
+ /* Destroy previous hierarchy if necessary */
+
+ if (mg->n_levels > 0) {
+ for (grid_lv = mg->n_levels - 1; grid_lv > -1; grid_lv--)
+ cs_grid_destroy(mg->grid_hierarchy + grid_lv);
+ mg->n_levels = 0;
+ }
+
+ /* Build coarse grids hierarchy */
+ /*------------------------------*/
+
+ g = cs_grid_create_from_shared(mesh->n_cells,
+ mesh->n_cells_with_ghosts,
+ mesh->n_i_faces,
+ symmetric,
+ mesh->i_face_cells,
+ mesh->halo,
+ mesh->i_face_numbering,
+ mq->cell_cen,
+ mq->cell_vol,
+ mq->i_face_normal,
+ dam,
+ xam);
+
+ _multigrid_add_level(mg, g); /* Assign to hierarchy */
+
+ n_cells = mesh->n_cells;
+ n_faces = mesh->n_i_faces;
+ n_g_cells = mesh->n_g_cells;
+
+ while (true) {
+
+ n_g_cells_prev = n_g_cells;
+
+ /* Recursion test */
+
+ if (n_g_cells <= (fvm_gnum_t)(*ncegrm))
+ break;
+
+ else if (grid_lv >= *ngrmax) {
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_(" CLMLGA: maximum number of coarse grids (%d)\n"
+ " reached for \"%s\".\n"),
+ (int)(*ngrmax), var_name);
+ break;
+ }
+
+ /* Build coarser grid from previous grid */
+
+ grid_lv += 1;
+
+ if (*iwarnp > 2)
+ bft_printf(_("\n building level %2d grid\n"), grid_lv);
+
+ g = cs_grid_coarsen(g, *iwarnp, *nagmax, iagmax);
+
+ cs_grid_get_info(g,
+ &grid_lv,
+ &symmetric,
+ &n_cells,
+ NULL,
+ &n_faces,
+ &n_g_cells);
+
+ _multigrid_add_level(mg, g); /* Assign to hierarchy */
+
+ /* Print coarse mesh stats */
+
+ if (*iwarnp > 2) {
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ int lcount[2], gcount[2];
+ int n_c_min, n_c_max, n_f_min, n_f_max;
+
+ lcount[0] = n_cells; lcount[1] = n_faces;
+ MPI_Allreduce(lcount, gcount, 2, MPI_INT, MPI_MAX,
+ cs_glob_mpi_comm);
+ n_c_max = gcount[0]; n_f_max = gcount[1];
+
+ lcount[0] = n_cells; lcount[1] = n_faces;
+ MPI_Allreduce(lcount, gcount, 2, MPI_INT, MPI_MIN,
+ cs_glob_mpi_comm);
+ n_c_min = gcount[0]; n_f_min = gcount[1];
+
+ bft_printf
+ (_(" total min max\n"
+ " number of cells: %12lu %10d %10d\n"
+ " number of faces: %10d %10d\n"),
+ (unsigned long)n_g_cells, n_c_min, n_c_max, n_f_min, n_f_max);
+ }
+
+#endif
+
+ if (cs_glob_n_ranks == 1)
+ bft_printf(_(" number of cells: %10d\n"
+ " number of faces: %10d\n"),
+ (int)n_cells, (int)n_faces);
+
+ }
+
+ /* If too few cells were grouped, we stop at this level */
+
+ if ( n_g_cells > (0.8 * n_g_cells_prev)
+ || n_g_cells < (1.5 * cs_glob_n_ranks))
+ break;
+ }
+
+ cs_base_string_f_to_c_free(&var_name);
+
+ /* Print final info */
+
+ if (*iwarnp > 1)
+ bft_printf
+ (_(" number of coarse grids: %d\n"
+ " number of cells in coarsest grid: %lu\n\n"),
+ grid_lv, (unsigned long)n_g_cells);
+
+ /* Prepare preprocessing info if necessary */
+
+ if (*ncpost > 0) {
+
+ if (mg->post_cell_max == 0) {
+ int mg_id = _multigrid_id(mg);
+ if (mg_id > -1)
+ cs_post_add_time_dep_var(_cs_multigrid_post_function, mg_id);
+ mg->post_cell_max = *ncpost;
+ }
+
+ _multigrid_add_post(mg, mesh->n_cells);
+
+ }
+
+ /* Update info */
+
+ mg->info.n_levels_tot += grid_lv;
+
+ mg->info.n_levels[0] = grid_lv;
+
+ if (mg->info.n_builds > 0) {
+ if (mg->info.n_levels[0] < mg->info.n_levels[1])
+ mg->info.n_levels[1] = mg->info.n_levels[0];
+ if (mg->info.n_levels[0] > mg->info.n_levels[2])
+ mg->info.n_levels[2] = mg->info.n_levels[0];
+ }
+ else {
+ mg->info.n_levels[1] = mg->info.n_levels[0];
+ mg->info.n_levels[2] = mg->info.n_levels[0];
+ }
+
+ mg->info.n_builds += 1;
+
+ /* Update timers */
+
+ wt_stop = bft_timer_wtime();
+ cpu_stop = bft_timer_cpu_time();
+
+ mg->info.wt_tot[0] += (wt_stop - wt_start);
+ mg->info.cpu_tot[0] += (cpu_stop - cpu_start);
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a hierarchy of meshes starting from a fine mesh, keeping
+ * the corresponding system and postprocessing information for future calls.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(dsmlga, DSMLGA)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname /* <-- variable name length */
+)
+{
+ char *var_name;
+ int ii;
+ double wt_start, wt_stop, cpu_start, cpu_stop;
+ cs_multigrid_t *mg = NULL;
+
+ /* Initialization */
+
+ wt_start =bft_timer_wtime();
+ cpu_start =bft_timer_cpu_time();
+
+ var_name = cs_base_string_f_to_c_create(cname, *lname);
+
+ mg = _find_or_add_system(var_name);
+
+ cs_base_string_f_to_c_free(&var_name);
+
+ /* Destroy grid hierarchy */
+
+ if (mg->n_levels > 0) {
+ for (ii = mg->n_levels - 1; ii > -1; ii--)
+ cs_grid_destroy(mg->grid_hierarchy + ii);
+ mg->n_levels = 0;
+ }
+
+ /* Update timers */
+
+ wt_stop = bft_timer_wtime();
+ cpu_stop = bft_timer_cpu_time();
+
+ mg->info.wt_tot[0] += (wt_stop - wt_start);
+ mg->info.cpu_tot[0] += (cpu_stop - cpu_start);
+}
+
+/*----------------------------------------------------------------------------
+ * General sparse linear system resolution
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(resmgr, RESMGR)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname, /* <-- variable name length */
+ const cs_int_t *ncelet, /* <-- Number of cells, halo included */
+ const cs_int_t *ncel, /* <-- Number of local cells */
+ const cs_int_t *nfac, /* <-- Number of faces */
+ const cs_int_t *isym, /* <-- Symmetry indicator:
+ 1: symmetric; 2: not symmetric */
+ const cs_int_t *iresds, /* <-- Descent smoother type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *iresas, /* <-- Ascent smoother type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *ireslp, /* <-- Coarse Resolution type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *ipol, /* <-- Preconditioning polynomial degree
+ (0: diagonal) */
+ const cs_int_t *ncymxp, /* <-- Max number of cycles */
+ const cs_int_t *nitmds, /* <-- Max number of iterations for descent */
+ const cs_int_t *nitmas, /* <-- Max number of iterations for ascent */
+ const cs_int_t *nitmap, /* <-- Max number of iterations for
+ coarsest solution */
+ const cs_int_t *iinvpe, /* <-- Indicator to cancel increments
+ in rotational periodicity (2) or
+ to exchange them as scalars (1) */
+ const cs_int_t *iwarnp, /* <-- Verbosity level */
+ cs_int_t *ncyclf, /* --> Number of cycles done */
+ cs_int_t *niterf, /* --> Number of iterations done */
+ const cs_real_t *epsilp, /* <-- Precision for iterative resolution */
+ const cs_real_t *rnorm, /* <-- Residue normalization */
+ cs_real_t *residu, /* --> Final non normalized residue */
+ const cs_int_t *ifacel, /* <-- Face -> cell connectivity */
+ const cs_real_t *rhs, /* <-- System right-hand side */
+ cs_real_t *vx /* <-> System solution */
+)
+{
+ char *var_name;
+ cs_sles_type_t type[4] = {CS_SLES_PCG,
+ CS_SLES_JACOBI,
+ CS_SLES_BICGSTAB,
+ CS_SLES_N_TYPES};
+
+ int _iresds = *iresds;
+ int _iresas = *iresas;
+ int _ireslp = *ireslp;
+
+ cs_bool_t symmetric = (*isym == 1) ? true : false;
+ cs_perio_rota_t rotation_mode = CS_PERIO_ROTA_COPY;
+
+ assert(*ncelet >= *ncel);
+ assert(*nfac > 0);
+ assert(ifacel != NULL);
+
+ if (*iinvpe == 2)
+ rotation_mode = CS_PERIO_ROTA_RESET;
+ else if (*iinvpe == 3)
+ rotation_mode = CS_PERIO_ROTA_IGNORE;
+
+ var_name = cs_base_string_f_to_c_create(cname, *lname);
+
+ assert(*iresds > -1 && *iresds < 3);
+ assert(*iresas > -1 && *iresas < 3);
+ assert(*ireslp > -1 && *ireslp < 3);
+
+ if (_iresds < 0 || _iresds > 2)
+ _iresds = 3;
+ if (_iresas < 0 || _iresas > 2)
+ _iresas = 3;
+ if (_ireslp < 0 || _ireslp > 2)
+ _ireslp = 3;
+
+ _multigrid_solve(var_name,
+ type[_iresds],
+ type[_iresas],
+ type[_ireslp],
+ symmetric,
+ *ipol,
+ rotation_mode,
+ *iwarnp,
+ *ncymxp,
+ *nitmds,
+ *nitmas,
+ *nitmap,
+ *epsilp,
+ *rnorm,
+ ncyclf,
+ niterf,
+ residu,
+ rhs,
+ vx,
+ 0,
+ NULL);
+
+ cs_base_string_f_to_c_free(&var_name);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize multigrid solver API.
+ *
+ * parameters:
+ * post_cell_max <-- If > 0, activates postprocessing of coarseninsg,
+ * projecting coarse cell numbers (modulo post_cell_max)
+ * on the base grid
+ *----------------------------------------------------------------------------*/
+
+void
+cs_multigrid_initialize(void)
+{
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize multigrid solver API.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_multigrid_finalize(void)
+{
+ int ii;
+
+ /* Print system info */
+
+ for (ii = 0; ii < cs_glob_multigrid_n_systems; ii++)
+ _multigrid_info_dump(&((cs_glob_multigrid_systems[ii])->info));
+
+ /* Free multigrid structures */
+
+ for (ii = 0; ii < cs_glob_multigrid_n_systems; ii++)
+ _multigrid_destroy(cs_glob_multigrid_systems + ii);
+
+ BFT_FREE(cs_glob_multigrid_systems);
+
+ cs_glob_multigrid_n_systems = 0;
+ cs_glob_multigrid_n_max_systems = 0;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_numbering.c b/src/base/cs_numbering.c
new file mode 100644
index 0000000..c566228
--- /dev/null
+++ b/src/base/cs_numbering.c
@@ -0,0 +1,228 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Numbering information for vectorization or multithreading
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_numbering.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/* Names for numbering types */
+
+const char *cs_numbering_type_name[] = {N_("vectorization"),
+ N_("threads")};
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a numbering information structure in case of vectorization.
+ *
+ * parameters:
+ * vector_size <-- vector size used for this vectorization
+ *
+ * returns:
+ * pointer to created cs_numbering_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_numbering_t *
+cs_numbering_create_vectorized(int vector_size)
+{
+ cs_numbering_t *numbering = NULL;
+
+ BFT_MALLOC(numbering, 1, cs_numbering_t);
+
+ numbering->type = CS_NUMBERING_VECTORIZE;
+
+ numbering->vector_size = vector_size;
+
+ numbering->n_threads = 1;
+ numbering->n_groups = 1;
+
+ numbering->group_index = NULL;
+
+ return numbering;
+}
+
+/*----------------------------------------------------------------------------
+ * Create a numbering information structure in case of threading.
+ *
+ * parameters:
+ * n_threads <-- number of threads
+ * n_groups <-- number of groups
+ * group_index <-- group_index[thread_id*group_id*2 + group_id*2] and
+ * group_index[thread_id*group_id*2 + group_id*2 +1] define
+ * the start and end ids for entities in a given group and
+ * thread; (size: n_groups *2 * n_threads)
+ *
+ * returns:
+ * pointer to created cs_numbering_t structure
+ *---------------------------------------------------------------------------*/
+
+cs_numbering_t *
+cs_numbering_create_threaded(int n_threads,
+ int n_groups,
+ fvm_lnum_t group_index[])
+{
+ cs_numbering_t *numbering = NULL;
+
+ BFT_MALLOC(numbering, 1, cs_numbering_t);
+
+ numbering->type = CS_NUMBERING_THREADS;
+
+ numbering->vector_size = 1;
+
+ numbering->n_threads = n_threads;
+ numbering->n_groups = n_groups;
+
+ BFT_MALLOC(numbering->group_index, n_threads*2*n_groups, fvm_lnum_t);
+
+ memcpy(numbering->group_index,
+ group_index,
+ (n_threads*2*n_groups) * sizeof(fvm_lnum_t));
+
+ return numbering;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a numbering information structure.
+ *
+ * parameters:
+ * numbering <-> pointer to cs_numbering_t structure pointer (or NULL)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_numbering_destroy(cs_numbering_t **numbering)
+{
+ if (*numbering != NULL) {
+
+ cs_numbering_t *_n = *numbering;
+
+ if (_n->group_index != NULL)
+ BFT_FREE(_n->group_index);
+
+ BFT_FREE(*numbering);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Dump a cs_numbering_t structure.
+ *
+ * parameters:
+ * numbering <-- pointer to cs_numbering_t structure (or NULL)
+ *---------------------------------------------------------------------------*/
+
+void
+cs_numbering_dump(const cs_numbering_t *numbering)
+{
+ int i, j;
+
+ if (numbering == NULL) {
+ bft_printf("\n Numbering: nil (default)\n");
+ return;
+ }
+
+ bft_printf("\n Numbering: %p\n"
+ " type: %s\n"
+ " vector_size: %d\n"
+ " n_threads: %d\n"
+ " n_groups: %d\n",
+ numbering, cs_numbering_type_name[numbering->type],
+ numbering->n_threads, numbering->n_groups);
+
+ if (numbering->group_index != NULL) {
+
+ bft_printf("\n group start index:\n"
+ "\n group_id thread_id (id) start_index\n");
+
+ for (i = 0; i < numbering->n_groups; i++) {
+ for (j = 0; j < numbering->n_threads; j++) {
+ int k = i*numbering->n_groups + j;
+ bft_printf(" %2d %2d %3d %d\n",
+ i, j, k, (int)(numbering->group_index[k]));
+ }
+ bft_printf(" %3d\n",
+ numbering->n_groups*numbering->n_threads);
+
+ }
+ }
+
+ bft_printf("\n\n");
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_opts.c b/src/base/cs_opts.c
new file mode 100644
index 0000000..915635e
--- /dev/null
+++ b/src/base/cs_opts.c
@@ -0,0 +1,727 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Parsing of program arguments and associated initializations
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_config.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_gui_util.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_opts.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Print command line help
+ *
+ * parameters:
+ * name <-- name of executable program
+ *----------------------------------------------------------------------------*/
+
+static void
+_arg_env_help(const char *name)
+{
+ FILE *e = stderr;
+
+ if (cs_glob_rank_id >= 1)
+ return;
+
+ fprintf (e, _("Usage: %s [options]\n"), name);
+
+ fprintf (e, _("\nCommand line options:\n\n"));
+ fprintf
+ (e, _(" --solcom stand-alone kernel with \"geomet\" mesh in\n"
+ " SolCom format (obsolete)\n"));
+#if defined(HAVE_MPI)
+ fprintf
+ (e, _(" --mpi use MPI for parallelism or coupling\n"
+ " [appnum]: number of this application in\n"
+ " case of code coupling (default: 0)\n"));
+
+#endif
+ fprintf
+ (e, _(" -q, --quality mesh quality verification mode\n"));
+ fprintf
+ (e, _(" --cwf <criterion> cut warped faces\n"
+ " -post: activate the post-processing related\n"
+ " to the cutting of warped faces\n"));
+ fprintf
+ (e, _(" --benchmark elementary operations performance\n"
+ " [--mpitrace] operations done only once\n"
+ " for light MPI traces\n"));
+ fprintf
+ (e, _(" --log output redirection for rank -1 or 0:\n"
+ " 0: standard output\n"
+ " 1: output in \"listing\" (default)\n"));
+ fprintf
+ (e, _(" --logp output redirection for rank > 0:\n"
+ " -1: remove output (default)\n"
+ " 0: no redirection (if independant\n"
+ " terminals, debugger type)\n"
+ " 1: output in \"listing_n<rang>\"\n"));
+#if defined(HAVE_LIBXML2)
+ fprintf
+ (e, _(" -p, --param <file_name> parameter file\n"));
+#endif
+
+#if defined(HAVE_SOCKET)
+ fprintf
+ (e, _(" --syr-socket enable sockets for SYRTHES 3 coupling\n"
+ " <port_num> port number on rank 0\n"));
+#endif
+
+ fprintf
+ (e, _(" --version print version number\n"));
+ fprintf
+ (e, _(" -h, --help this help message\n\n"));
+}
+
+/*----------------------------------------------------------------------------
+ * Print version number
+ *----------------------------------------------------------------------------*/
+
+static void
+_print_version(void)
+{
+ if (cs_glob_rank_id >= 1)
+ return;
+
+ printf(_("%s version %s\n"), CS_APP_NAME, CS_APP_VERSION);
+}
+
+/*----------------------------------------------------------------------------
+ * Convert an argument to an integer and check its validity
+ *
+ * parameters:
+ * arg_id <-- index of argument in argv
+ * argc <-- number of command line arguments
+ * argv <-- array of command line arguments
+ * argerr --> error indicator
+ *
+ * returns:
+ * integer value
+ *----------------------------------------------------------------------------*/
+
+static int
+_arg_to_int(int arg_id,
+ int argc,
+ char *argv[],
+ int *argerr)
+{
+ char *start = NULL;
+ char *end = NULL;
+ int retval = 0;
+
+ *argerr = 0;
+
+ if (arg_id < argc) {
+ start = argv[arg_id];
+ end = start + strlen(start);
+ retval = strtol(start, &end, 0);
+ if (end != start + strlen(start)) *argerr = 1;
+ }
+ else {
+ *argerr = 1;
+ }
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Convert an argument to a double and check its validity
+ *
+ * parameters:
+ * arg_id <-- index of argument in argv
+ * argc <-- number of command line arguments
+ * argv <-- array of command line arguments
+ * argerr --> error indicator
+ *
+ * returns:
+ * integer value
+ *----------------------------------------------------------------------------*/
+
+static double
+_arg_to_double(int arg_id,
+ int argc,
+ char *argv[],
+ int *argerr)
+{
+ char *start = NULL;
+ char *end = NULL;
+ double retval = 0.;
+
+ *argerr = 0;
+
+ if (arg_id < argc) {
+ start = argv[arg_id];
+ end = start + strlen(start);
+ retval = strtod(start, &end);
+ if (end != start + strlen(start)) *argerr = 1;
+ }
+ else {
+ *argerr = 1;
+ }
+
+ return retval;
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Print logfile header
+ *
+ * parameters:
+ * argc <-- number of command line arguments
+ * argv <-- array of command line arguments
+ *----------------------------------------------------------------------------*/
+
+void
+cs_opts_logfile_head(int argc,
+ char *argv[])
+{
+ char str[81];
+ int ii;
+ char date_str[] = __DATE__;
+ char time_str[] = __TIME__;
+ const char mon_name[12][4]
+ = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ struct tm time_cnv;
+
+ /* Define MPI Information */
+
+#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
+#if defined(OPEN_MPI)
+ const char mpi_lib[] = "Open MPI";
+#elif defined(MPICH2)
+ const char mpi_lib[] = "MPICH2";
+#elif defined(LAM_MPI)
+ const char mpi_lib[] = "LAM/MPI";
+#elif defined(MPICH_NAME)
+ const char mpi_lib[] = "MPICH";
+#elif defined(HP_MPI)
+ const char mpi_lib[] = "HP-MPI";
+#elif defined(MPI_VERSION) && defined(MPI_SUBVERSION)
+ const char *mpi_lib = NULL;
+#endif
+#endif /* defined(MPI_VERSION) && defined(MPI_SUBVERSION) */
+
+ /* Determine compilation date */
+
+ for (ii = 0; ii < 12; ii++) {
+ if (strncmp(date_str, mon_name[ii], 3) == 0) {
+ time_cnv.tm_mon = ii ;
+ break;
+ }
+ }
+
+ sscanf(date_str + 3, "%d", &(time_cnv.tm_mday)) ;
+ sscanf(date_str + 6, "%d", &(time_cnv.tm_year)) ;
+
+ time_cnv.tm_year -= 1900 ;
+
+ sscanf(time_str , "%d", &(time_cnv.tm_hour)) ;
+ sscanf(time_str + 3, "%d", &(time_cnv.tm_min)) ;
+ sscanf(time_str + 6, "%d", &(time_cnv.tm_sec)) ;
+
+ time_cnv.tm_isdst = -1 ;
+
+ /* Re-compute and internationalize build date */
+
+ mktime(&time_cnv) ;
+ strftime(str, 80, "%c", &time_cnv) ;
+
+ /* Now print info */
+
+ bft_printf(_("command: \n"));
+
+ for (ii = 0 ; ii < argc ; ii++)
+ bft_printf(" %s", argv[ii]);
+
+ bft_printf("\n");
+ bft_printf("\n************************************"
+ "***************************\n\n");
+ bft_printf(" (R)\n"
+ " Code_Saturne\n\n"
+ " Version %s\n\n",
+ CS_APP_VERSION);
+
+ bft_printf("\n Copyright (C) 1998-2009 EDF S.A., France\n\n");
+
+ bft_printf(_(" build %s\n"), str);
+
+#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
+ if (mpi_lib != NULL)
+ bft_printf(_(" MPI version %d.%d (%s)\n\n"),
+ MPI_VERSION, MPI_SUBVERSION, mpi_lib);
+ else
+ bft_printf(_(" MPI version %d.%d\n\n"),
+ MPI_VERSION, MPI_SUBVERSION);
+#endif
+
+ bft_printf("\n");
+ bft_printf(" The Code_Saturne CFD tool is free software;\n"
+ " you can redistribute it and/or modify it under the terms\n"
+ " of the GNU General Public License as published by the\n"
+ " Free Software Foundation; either version 2 of the License,\n"
+ " or (at your option) any later version.\n\n");
+
+ bft_printf(" The Code_Saturne CFD tool is distributed in the hope that\n"
+ " it will be useful, but WITHOUT ANY WARRANTY; without even\n"
+ " the implied warranty of MERCHANTABILITY or FITNESS FOR A\n"
+ " PARTICULAR PURPOSE. See the GNU General Public License\n"
+ " for more details.\n");
+
+ bft_printf("\n************************************"
+ "***************************\n\n");
+}
+
+/*----------------------------------------------------------------------------
+ * First analysis of the command line to determine if we require MPI,
+ * and initialization if necessary
+ *
+ * parameters:
+ * argc <-> number of command line arguments
+ * argv <-> array of command line arguments
+ *
+ * returns:
+ * -1 if MPI is not needed, or application number in MPI_COMM_WORLD of
+ * processes associated with this instance of Code_Saturne
+ *----------------------------------------------------------------------------*/
+
+int
+cs_opts_mpi_init(int *argc,
+ char **argv[])
+{
+#if defined(HAVE_MPI)
+
+ char *s;
+
+ int arg_id = 0, flag = 0;
+ int appnum = -1;
+ int use_mpi = false;
+
+#if defined(MPICH_NAME)
+
+ /*
+ Using standard MPICH1 1.2.x with the p4 (default) mechanism,
+ the information required by MPI_Init() are transferred through
+ the command line, which is then modified by MPI_Init();
+ in this case, only rank 0 knows the "user" command line arguments
+ at program startup, the other processes obtaining them only upon
+ calling MPI_Init(). In this case, it is thus necessary to initialize
+ MPI before parsing the command line.
+ */
+
+ for (arg_id = 0 ; arg_id < *argc ; arg_id++) {
+ if ( !strcmp((*argv)[arg_id], "-p4pg") /* For process 0 */
+ || !strcmp((*argv)[arg_id], "-p4rmrank")) { /* For other processes */
+ use_mpi = true;
+ break;
+ }
+ }
+
+ if (getenv("GMPI_ID") != NULL) /* In case we are using MPICH-GM */
+ use_mpi = true;
+
+ /* Notes: Blue Gene/L also defines the BGLMPI_SIZE environment variable.
+ * Blue Gene/P defines BG_SIZE (plus BG_MAPPING, and BG_RELEASE). */
+#elif defined(__blrts__) || defined(__bgp__) \
+ || defined(__CRAYXT_COMPUTE_LINUX_TARGET)
+ use_mpi = true;
+
+#elif defined(LAM_MPI)
+ if (getenv("LAMRANK") != NULL)
+ use_mpi = true;
+
+#elif defined(OPEN_MPI)
+ if (getenv("OMPI_MCA_ns_nds_vpid") != NULL) /* OpenMPI 1.2 */
+ use_mpi = true;
+ else if (getenv("OMPI_COMM_WORLD_RANK") != NULL) /* OpenMPI 1.3 */
+ use_mpi = true;
+
+#elif defined(MPICH2)
+ if (getenv("PMI_RANK") != NULL)
+ use_mpi = true;
+
+#endif /* Tests for known MPI variants */
+
+ /* If we have determined from known MPI environment variables
+ of command line arguments that we are running under MPI,
+ initialize MPI */
+
+ if (use_mpi == true) {
+ MPI_Initialized(&flag);
+ if (!flag) {
+#if defined(MPI_VERSION) && (MPI_VERSION >= 2) && defined(HAVE_OPENMP)
+ int mpi_threads;
+ MPI_Init_thread(argc, argv, MPI_THREAD_FUNNELED, &mpi_threads);
+#else
+ MPI_Init(argc, argv);
+#endif
+ }
+ }
+
+ /* Loop on command line arguments */
+
+ arg_id = 0;
+
+ while (++arg_id < *argc) {
+
+ s = (*argv)[arg_id];
+
+ /* Parallel run */
+
+ if (strcmp(s, "--mpi") == 0) {
+ int tmperr = 0;
+ int _appnum = 0;
+ use_mpi = true;
+ _appnum = _arg_to_int(arg_id + 1, *argc, *argv, &tmperr);
+ if (tmperr == 0) {
+ arg_id++;
+ appnum = _appnum;
+ }
+ }
+
+ } /* End of loop on command line arguments */
+
+ if (use_mpi == true) {
+
+ MPI_Initialized(&flag);
+ if (!flag) {
+#if defined(MPI_VERSION) && (MPI_VERSION >= 2) && defined(HAVE_OPENMP)
+ int mpi_threads;
+ MPI_Init_thread(argc, argv, MPI_THREAD_FUNNELED, &mpi_threads);
+#else
+ MPI_Init(argc, argv);
+#endif
+ }
+
+ /*
+ If appnum was not given through the command line but we
+ are running under MPI-2, appnum may be available through
+ the MPI_APPNUM attribute.
+ */
+
+#if defined(MPI_VERSION) && (MPI_VERSION >= 2)
+ if (appnum < 0) {
+ void *attp = NULL;
+ MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_APPNUM, &attp, &flag);
+ if (flag != 0)
+ appnum = *(int *)attp;
+ }
+#endif
+
+ if (appnum < 0)
+ appnum = 0;
+ }
+
+ return appnum;
+
+#else /* if defined(HAVE_MPI) */
+
+ return -1;
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Define options and call some associated initializations
+ * based on command line arguments
+ *
+ * parameters:
+ * argc <-- number of command line arguments
+ * argv <-- array of command line arguments
+ * opts --> options structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_opts_define(int argc,
+ char *argv[],
+ cs_opts_t *opts)
+{
+ /* Local variables */
+
+ const char *s;
+ int arg_id = 0, argerr = 0;
+
+ const char moduleoptbase[] = "--yacs-module=";
+ const char socketoptbase[] = "--proxy-socket=";
+ const char keyoptbase[] = "--proxy-key=";
+
+ /* Default initialization */
+
+ opts->ifoenv = 1;
+
+ opts->ilisr0 = 1;
+ opts->ilisrp = 2;
+
+ opts->verif = false;
+ opts->benchmark = 0;
+
+ opts->cwf = false;
+ opts->cwf_post = false;
+ opts->cwf_criterion = 0.01;
+
+ opts->syr_socket = -1;
+
+ opts->yacs_module = NULL;
+
+ opts->proxy_socket = NULL;
+ opts->proxy_key = -1;
+
+ /* Parse command line arguments */
+
+ while (++arg_id < argc && argerr == 0) {
+
+ s = argv[arg_id];
+
+ if (strcmp(s, "--solcom") == 0)
+ opts->ifoenv = 0;
+
+#if defined(HAVE_MPI)
+
+ else if (strcmp(s, "--mpi") == 0) {
+ int tmperr = 0;
+ (void)_arg_to_int(arg_id + 1, argc, argv, &tmperr);
+ if (tmperr == 0) {
+ arg_id++;
+ }
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ else if (strcmp(s, "-q") == 0 || strcmp(s, "--quality") == 0)
+ opts->verif = true;
+
+ else if (strcmp(s, "--log") == 0) {
+ int n1 = 0;
+ n1 = _arg_to_int(++arg_id, argc, argv, &argerr);
+ if (n1 == 0)
+ opts->ilisr0 = 0;
+ else if (n1 == 1)
+ opts->ilisr0 = 1;
+ else
+ argerr = 1;
+ }
+
+ else if (strcmp(s, "--logp") == 0) {
+ int n1 = 0;
+ n1 = _arg_to_int(++arg_id, argc, argv, &argerr);
+ if (n1 == -1)
+ opts->ilisrp = 2;
+ else if (n1 == 0)
+ opts->ilisrp = 0;
+ else if (n1 == 1)
+ opts->ilisrp = 1;
+ else
+ argerr = 1;
+ }
+
+ else if (strcmp(s, "--benchmark") == 0) {
+ opts->benchmark = 1;
+ if (arg_id + 1 < argc) {
+ if (strcmp(argv[arg_id + 1], "--mpitrace") == 0) {
+ opts->benchmark = 2;
+ arg_id++;
+ }
+ }
+ }
+
+#if defined(HAVE_LIBXML2)
+ else if (strcmp(s, "-p") == 0 || strcmp(s, "--param") == 0) {
+ s = argv[++arg_id];
+ argerr = cs_gui_file_loading(s);
+ }
+#endif
+
+ else if (strcmp(s, "--cwf") == 0) {
+ opts->cwf = true;
+ if (arg_id + 1 < argc) {
+ if (*(argv[arg_id+1]) != '-') {
+ opts->cwf_criterion = _arg_to_double(arg_id + 1, argc, argv, &argerr);
+ if (argerr == 0)
+ arg_id++;
+ }
+ }
+ if (arg_id + 1 < argc) {
+ if (strcmp((argv[arg_id+1]), "--post") == 0) {
+ opts->cwf_post = true;
+ arg_id++;
+ }
+ }
+ }
+
+#if defined(HAVE_SOCKET)
+
+ /* SYRTHES 3 coupling socket */
+
+ else if (strcmp(s, "--syr-socket") == 0) {
+ opts->syr_socket = _arg_to_int(arg_id + 1, argc, argv, &argerr);
+ if (argerr == 0)
+ arg_id++;
+ }
+
+ /* Proxy connection options (do not appear in help as they
+ are not destined to be used directly by a user) */
+
+ else if (strncmp(s, socketoptbase, strlen(socketoptbase)) == 0) {
+ const char *_s = s + strlen(socketoptbase);
+ BFT_MALLOC(opts->proxy_socket, strlen(_s) + 1, char);
+ strcpy(opts->proxy_socket, _s);
+ }
+
+ else if (strncmp(s, keyoptbase, strlen(keyoptbase)) == 0) {
+ const char *_start = s + strlen(keyoptbase);
+ char *_end = NULL;
+ opts->proxy_key = strtol(_start, &_end, 0);
+ if (_end != _start + strlen(_start))
+ argerr = 1;
+ }
+
+#endif /* defined(HAVE_SOCKET) */
+
+#if defined(HAVE_DLOPEN)
+
+ /* Library loader options (do not appear in help as they
+ are not destined to be used directly by a user) */
+
+ else if (strncmp(s, moduleoptbase, strlen(moduleoptbase)) == 0) {
+ const char *_s = s + strlen(moduleoptbase);
+ BFT_MALLOC(opts->yacs_module, strlen(_s) + 1, char);
+ strcpy(opts->yacs_module, _s);
+ }
+
+#endif /* defined(HAVE_DLOPEN) */
+
+ /* Version number */
+
+ else if (strcmp(s, "--version") == 0)
+ argerr = 3;
+
+ /* Usage */
+
+ else if (strcmp(s, "-h") == 0 || strcmp(s, "--help") == 0)
+ argerr = 2;
+ else
+ argerr = 1;
+
+ } /* End parsing command line */
+
+ /* Print version/help and exit if required or in case of command line error */
+ if (argerr != 0) {
+ if (cs_glob_rank_id <= 0) {
+ switch (argerr) {
+ case 1:
+ case 2:
+ cs_opts_logfile_head(argc, argv);
+ _arg_env_help(argv[0]);
+ break;
+ case 3:
+ _print_version();
+ break;
+ default:
+ break;
+ }
+ }
+ if (argerr == 1)
+ cs_exit(EXIT_FAILURE);
+ else
+ cs_exit(EXIT_SUCCESS);
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_parall.c b/src/base/cs_parall.c
new file mode 100644
index 0000000..a3a2cc5
--- /dev/null
+++ b/src/base/cs_parall.c
@@ -0,0 +1,1371 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions dealing with parallelism
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdarg.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_perio.h" /* Only needed for PARCOM */
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_halo.h"
+#include "cs_mesh.h"
+#include "cs_parall.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure and type definitions
+ *============================================================================*/
+
+#define CS_PARALL_DEBUG_COUNT 0
+#define CS_PARALL_ARRAY_SIZE 500
+
+typedef struct
+{
+ double val;
+ int rank;
+} _mpi_double_int_t;
+
+
+/*============================================================================
+ * Global static variables
+ *============================================================================*/
+
+/* Counter of the number of call for each function */
+
+#if CS_PARALL_DEBUG_COUNT
+static cs_int_t n_total_par_calls = 0;
+static cs_int_t n_pargve_calls = 0;
+static cs_int_t n_parcom_calls = 0;
+static cs_int_t n_parcve_calls = 0;
+static cs_int_t n_parcmx_calls = 0;
+static cs_int_t n_parcmn_calls = 0;
+static cs_int_t n_parcpt_calls = 0;
+static cs_int_t n_parsom_calls = 0;
+static cs_int_t n_parmax_calls = 0;
+static cs_int_t n_parmin_calls = 0;
+static cs_int_t n_parmxl_calls = 0;
+static cs_int_t n_parmnl_calls = 0;
+static cs_int_t n_parism_calls = 0;
+static cs_int_t n_parimx_calls = 0;
+static cs_int_t n_parimn_calls = 0;
+static cs_int_t n_parrsm_calls = 0;
+static cs_int_t n_parrmx_calls = 0;
+static cs_int_t n_parrmn_calls = 0;
+static cs_int_t n_parbci_calls = 0;
+static cs_int_t n_parbcr_calls = 0;
+static cs_int_t n_paragv_calls = 0;
+static cs_int_t n_parfpt_calls = 0;
+static cs_int_t n_parhis_calls = 0;
+static cs_int_t n_parcel_calls = 0;
+static cs_int_t n_interface_sr_calls = 0;
+#endif
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public functions definition for API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update a buffer on cells in case of parallelism
+ *
+ * This function copies values of the cells in the standard send_halo
+ * (local cells) to ghost cells on distant ranks.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE PARCOM (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR(NCELET) : <-> : variable on cells, output is an update
+ * of VAR(NCEL+1..NCELET)
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcom, PARCOM)(cs_real_t var[])
+{
+
+ if (cs_glob_mesh->have_rotation_perio != 0)
+ cs_perio_save_rotation_halo(cs_glob_mesh->halo, CS_HALO_STANDARD, var);
+
+ cs_halo_sync_var(cs_glob_mesh->halo, CS_HALO_STANDARD, var);
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parcom\n",
+ cs_glob_rank_id, n_parcom_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update a buffer on cells in case of parallelism
+ *
+ * This function copies values of the cells in the entire (i.e. std + ext)
+ * send_halo (local cells) to ghost cells on distant ranks.
+ *
+ * PVAR has to be well allocated => n_cells + n_cells_with_ghosts where
+ * n_cells_with_ghosts = n_std_ghost_cells + n_ext_ghost_cells.
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE PARCVE
+ * *****************
+ *
+ * DOUBLE PRECISION PVAR : <-> : variable buffer to sync
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcve, PARCVE)(cs_real_t pvar[])
+{
+
+ cs_halo_sync_var(cs_glob_mesh->halo, CS_HALO_EXTENDED, pvar);
+
+#if CS_PARALL_DEBUG_COUNT
+ printf ("irang = %d, iappel = %d, tot = %d, parcve\n",
+ cs_glob_rank_id, n_parcve_calls++, n_total_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the maximum value of a counter (int) for the entire domain in
+ * case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARCMX (IND)
+ * *****************
+ *
+ * INTEGER COUNTER <-> : input = local counter
+ * output = global max counter
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcmx, PARCMX)(cs_int_t *counter)
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t global_max;
+
+ assert(sizeof(int) == sizeof(cs_int_t));
+
+ MPI_Allreduce(counter, &global_max, 1, CS_MPI_INT, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ *counter = global_max;
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parcmx\n",
+ cs_glob_rank_id, n_parcmx_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the minimum value of a counter (int) for the entire domain in
+ * case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARCMN (IND)
+ * *****************
+ *
+ * INTEGER COUNTER <-> : input = local counter
+ * output = global min counter
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcmn, PARCMN)(cs_int_t *counter)
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t global_max;
+
+ assert(sizeof(int) == sizeof(cs_int_t));
+
+ MPI_Allreduce(counter, &global_max, 1, CS_MPI_INT, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ *counter = global_max;
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parcmn\n",
+ cs_glob_rank_id, n_parcmn_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum of a counter (int) for the entire domain in case
+ * of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARCPT (CPT)
+ * *****************
+ *
+ * INTEGER COUNTER : <-> : input = counter to sum
+ * output = global sum
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcpt, PARCPT)(cs_int_t *counter)
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t global_sum;
+
+ assert(sizeof(int) == sizeof(cs_int_t));
+
+ MPI_Allreduce(counter, &global_sum, 1, CS_MPI_INT, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ *counter = global_sum;
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parcpt\n",
+ cs_glob_rank_id, n_parcpt_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum of a real for the entire domain in case of parellism
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARSOM (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR : <-> : input = value to sum
+ * output = global sum
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parsom, PARSOM)(cs_real_t *var)
+{
+#if defined(HAVE_MPI)
+
+ cs_real_t global_sum;
+
+ assert (sizeof (double) == sizeof (cs_real_t));
+
+ MPI_Allreduce (var, &global_sum, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ *var = global_sum;
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parsom\n",
+ cs_glob_rank_id, n_parsom_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the maximum value of a real variable for the entire domain in case
+ * of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARMAX (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR : <-> : input = local maximum value
+ * output = global maximum value
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmax, PARMAX)(cs_real_t *var)
+{
+#if defined(HAVE_MPI)
+
+ cs_real_t global_max;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ MPI_Allreduce(var, &global_max, 1, CS_MPI_REAL, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ *var = global_max;
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parmax\n",
+ cs_glob_rank_id, n_parmax_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the minimum value of a real variable for the entire domain in case
+ * of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARMIN (VAR)
+ * *****************
+ *
+ * DOUBLE PRECISION VAR : <-> : input = local minimum value
+ * output = global minimum value
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmin, PARMIN)(cs_real_t *var)
+{
+#if defined(HAVE_MPI)
+
+ cs_real_t global_min;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ MPI_Allreduce(var, &global_min, 1, CS_MPI_REAL, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ *var = global_min;
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parmin\n",
+ cs_glob_rank_id, n_parmin_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Maximum value of a real and the value of the related variable for the entire
+ * domain in case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARMXL (NBR, VAR, XYZVAR)
+ * *****************
+ *
+ * INTEGER NBR : --> : size of the related variable
+ * DOUBLE PRECISION VAR : <-> : input = local max. value
+ * output = global max. value
+ * DOUBLE PRECISION XYZVAR(NBR) : <-> : input = value related to local max.
+ * output = value related to global max.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmxl, PARMXL)(cs_int_t *nbr,
+ cs_real_t *var,
+ cs_real_t xyzvar[])
+{
+#if defined(HAVE_MPI)
+
+ _mpi_double_int_t val_in, val_max;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ val_in.val = *var;
+ val_in.rank = cs_glob_rank_id;
+
+ MPI_Allreduce(&val_in, &val_max, 1, MPI_DOUBLE_INT, MPI_MAXLOC,
+ cs_glob_mpi_comm);
+
+ *var = val_max.val;
+
+ MPI_Bcast(xyzvar, *nbr, CS_MPI_REAL, val_max.rank, cs_glob_mpi_comm);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parmxl\n",
+ cs_glob_rank_id, n_parmxl_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Minimum value of a real and the value of the related variable for the entire
+ * domain in case of parallelism.
+ *
+ * Fortran Interface
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE PARMNL (NBR, VAR, XYZVAR)
+ * *****************
+ *
+ * INTEGER NBR : --> : size of the related variable
+ * DOUBLE PRECISION VAR : <-> : input = local max. value
+ * output = global max. value
+ * DOUBLE PRECISION XYZVAR(NBR) : <-> : input = value related to local max.
+ * output = value related to global max.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parmnl, PARMNL)(cs_int_t *nbr,
+ cs_real_t *var,
+ cs_real_t xyzvar[])
+{
+#if defined(HAVE_MPI)
+
+ _mpi_double_int_t val_in, val_min;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ val_in.val = *var;
+ val_in.rank = cs_glob_rank_id;
+
+ MPI_Allreduce(&val_in, &val_min, 1, MPI_DOUBLE_INT, MPI_MINLOC,
+ cs_glob_mpi_comm);
+
+ *var = val_min.val;
+
+ MPI_Bcast(xyzvar, *nbr, CS_MPI_REAL, val_min.rank, cs_glob_mpi_comm);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parmnl\n",
+ cs_glob_rank_id, n_parmnl_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum for each element of an array of int in case of
+ * parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARISM (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * INTEGER ARRAY(*) : <-> : input = local array
+ * output = array of global sum values.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parism, PARISM)(cs_int_t *n_elts,
+ cs_int_t array[])
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ cs_int_t set_sum_array[CS_PARALL_ARRAY_SIZE];
+
+ cs_int_t *sum_array = NULL;
+
+ assert(sizeof(int) == sizeof(cs_int_t));
+
+ if (CS_PARALL_ARRAY_SIZE < *n_elts) {
+
+ BFT_MALLOC(sum_array, *n_elts, cs_int_t);
+
+ MPI_Allreduce(array, sum_array, *n_elts, CS_MPI_INT, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = sum_array[i];
+
+ BFT_FREE(sum_array);
+
+ }
+ else {
+
+ MPI_Allreduce(array, set_sum_array, *n_elts, CS_MPI_INT, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ for (i = 0 ; i < *n_elts ; i++)
+ array[i] = set_sum_array[i];
+
+ }
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parism\n",
+ cs_glob_rank_id, n_parism_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global maximum value for each element of an array of int in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARIMX (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * INTEGER ARRAY(*) : <-> : input = local array
+ * output = array of global max. values.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parimx, PARIMX)(cs_int_t *n_elts,
+ cs_int_t array[])
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ cs_int_t set_globmax_array[CS_PARALL_ARRAY_SIZE];
+
+ cs_int_t *globmax_array = NULL;
+
+ assert(sizeof(int) == sizeof(cs_int_t));
+
+ if (CS_PARALL_ARRAY_SIZE < *n_elts) {
+
+ BFT_MALLOC(globmax_array, *n_elts, cs_int_t);
+
+ MPI_Allreduce(array, globmax_array, *n_elts, CS_MPI_INT, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ for (i = 0 ; i < *n_elts ; i++)
+ array[i] = globmax_array[i];
+
+ BFT_FREE(globmax_array);
+
+ }
+ else {
+
+ MPI_Allreduce(array, set_globmax_array, *n_elts, CS_MPI_INT, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ for (i = 0 ; i < *n_elts ; i++)
+ array[i] = set_globmax_array[i];
+
+ }
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf ("irang = %d, iappel = %d, tot = %d, parimx\n",
+ cs_glob_rank_id, n_parimx_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global minimum value for each element of an array of int in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARIMN (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * INTEGER ARRAY(*) : <-> : input = local array
+ * output = array of global min. values.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parimn, PARIMN)(cs_int_t *n_elts,
+ cs_int_t array[])
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ cs_int_t set_globmin_array[CS_PARALL_ARRAY_SIZE];
+
+ cs_int_t *globmin_array = NULL;
+
+ assert(sizeof(int) == sizeof(cs_int_t));
+
+ if (CS_PARALL_ARRAY_SIZE < *n_elts) {
+
+ BFT_MALLOC(globmin_array, *n_elts, cs_int_t);
+
+ MPI_Allreduce (array, globmin_array, *n_elts, CS_MPI_INT, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = globmin_array[i];
+
+ BFT_FREE(globmin_array);
+
+ }
+ else {
+
+ MPI_Allreduce(array, set_globmin_array, *n_elts, CS_MPI_INT, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = set_globmin_array[i];
+
+ }
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parimn\n",
+ cs_glob_rank_id, n_parimn_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global sum for each element of an array of real in case of
+ * parallelism.
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PARRSM (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array.
+ * DOUBLE PRECISION ARRAY(*) : <-> : input = local array
+ * output = array of global sum values.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parrsm, PARRSM)(cs_int_t *n_elts,
+ cs_real_t array[])
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ cs_real_t set_sum_array[CS_PARALL_ARRAY_SIZE];
+
+ cs_real_t *sum_array = NULL;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ if (CS_PARALL_ARRAY_SIZE < *n_elts) {
+
+ BFT_MALLOC(sum_array, *n_elts, cs_real_t);
+
+ MPI_Allreduce(array, sum_array, *n_elts, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = sum_array[i];
+
+ BFT_FREE(sum_array);
+
+ }
+ else {
+
+ MPI_Allreduce(array, set_sum_array, *n_elts, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = set_sum_array[i];
+
+ }
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parrsm\n",
+ cs_glob_rank_id, n_parrsm_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global maximum value for each element of an array of real in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARRMX (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array
+ * DOUBLE PRECISION ARRAY(*) : <-> : input = local array
+ * output = array of global max. values.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parrmx, PARRMX)(cs_int_t *n_elts,
+ cs_real_t array[])
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ cs_real_t set_globmax_array[CS_PARALL_ARRAY_SIZE];
+
+ cs_real_t *globmax_array = NULL;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ if (CS_PARALL_ARRAY_SIZE < *n_elts) {
+
+ BFT_MALLOC(globmax_array, *n_elts, cs_real_t);
+
+ MPI_Allreduce(array, globmax_array, *n_elts, CS_MPI_REAL, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = globmax_array[i];
+
+ BFT_FREE(globmax_array);
+
+ }
+ else {
+
+ MPI_Allreduce(array, set_globmax_array, *n_elts, CS_MPI_REAL, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = set_globmax_array[i];
+
+ }
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parrmx\n",
+ cs_glob_rank_id, n_parrmx_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the global minimum value for each element of an array of real in
+ * case of parallelism.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARRMN (N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the array
+ * DOUBLE PRECISION ARRAY(*) : <-> : input = local array
+ * output = array of global min. values.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parrmn, PARRMN)(cs_int_t *n_elts,
+ cs_real_t array[])
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ cs_real_t set_globmin_array[CS_PARALL_ARRAY_SIZE];
+
+ cs_real_t *globmin_array = NULL;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ if (CS_PARALL_ARRAY_SIZE < *n_elts) {
+
+ BFT_MALLOC(globmin_array, *n_elts, cs_real_t);
+
+ MPI_Allreduce(array, globmin_array, *n_elts, CS_MPI_REAL, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = globmin_array[i];
+
+ BFT_FREE(globmin_array);
+
+ }
+ else {
+
+ MPI_Allreduce(array, set_globmin_array, *n_elts, CS_MPI_REAL, MPI_MIN,
+ cs_glob_mpi_comm);
+
+ for (i = 0; i < *n_elts; i++)
+ array[i] = set_globmin_array[i];
+
+ }
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parrmn\n",
+ cs_glob_rank_id, n_parrmn_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Broadcast to all the ranks the value of each element of an array of int.
+ * (encapsulation of MPI_Bcast())
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARBCI (IRANK, N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER IRANK : --> : rank related to the sending process
+ * INTEGER N_ELTS : --> : size of the array
+ * INTEGER ARRAY(*) : <-> : array of int
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parbci, PARBCI)(cs_int_t *irank,
+ cs_int_t *n_elts,
+ cs_int_t array[])
+{
+#if defined(HAVE_MPI)
+
+ MPI_Bcast(array, *n_elts, CS_MPI_INT, *irank, cs_glob_mpi_comm);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parbci\n",
+ cs_glob_rank_id, n_parbci_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Broadcast to all the ranks the value of each element of an array of real.
+ * (encapsulation of MPI_Bcast())
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARBCR (IRANK, N_ELTS, ARRAY)
+ * *****************
+ *
+ * INTEGER IRANK : --> : rank related to the sending process
+ * INTEGER N_ELTS : --> : size of the array
+ * DOUBLE PRECISION ARRAY(*) : <-> : array of real
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parbcr, PARBCR)(cs_int_t *irank,
+ cs_int_t *n_elts,
+ cs_real_t array[])
+{
+#if defined(HAVE_MPI)
+
+ MPI_Bcast(array, *n_elts, CS_MPI_REAL, *irank, cs_glob_mpi_comm);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parbcr\n",
+ cs_glob_rank_id, n_parbcr_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Build a global array from each local array in each domain. The size of
+ * each local array can be different.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARAGV (NVAR, NVARGB, VAR, VARGB)
+ * *****************
+ *
+ * INTEGER N_ELTS : --> : size of the local array
+ * INTEGER N_G_ELTS : --> : size of the global array
+ * DOUBLE PRECISION ARRAY(*) : --> : local array
+ * DOUBLE PRECISION G_ARRAY(*) : <-- : global array
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (paragv, PARAGV)(cs_int_t *n_elts,
+ cs_int_t *n_g_elts,
+ cs_real_t array[],
+ cs_real_t *g_array)
+{
+#if defined(HAVE_MPI)
+
+ cs_int_t i;
+ cs_int_t *count = NULL;
+ cs_int_t *shift = NULL;
+
+ const cs_int_t n_domains = cs_glob_mesh->n_domains;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ BFT_MALLOC(count, n_domains, cs_int_t);
+ BFT_MALLOC(shift, n_domains, cs_int_t);
+
+ MPI_Allgather(n_elts, 1, CS_MPI_INT, count, 1, CS_MPI_INT,
+ cs_glob_mpi_comm);
+
+ shift[0] = 0;
+ for (i = 1; i < n_domains; i++)
+ shift[i] = shift[i-1] + count[i-1];
+
+ assert(*n_g_elts == (shift[n_domains - 1] + count[n_domains - 1]));
+
+ MPI_Allgatherv(array, *n_elts, CS_MPI_REAL,
+ g_array, count, shift, CS_MPI_REAL, cs_glob_mpi_comm);
+
+ BFT_FREE(count);
+ BFT_FREE(shift);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, paragv\n",
+ cs_glob_rank_id, n_paragv_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Find a node which minimizes a given distance and its related rank.
+ * May be used to locate a node among several domains.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARFPT (NODE, NDRANG, DIS2MN)
+ * *****************
+ *
+ * INTEGER NODE : <-> : local number of the closest node
+ * INTEGER NDRANG : <-- : rank id for which the distance is the
+ * smallest
+ * DOUBLE PRECISION DIS2MN : --> : square distance between the closest node
+ * and the wanted node.
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parfpt, PARFPT)(cs_int_t *node,
+ cs_int_t *ndrang,
+ cs_real_t *dis2mn)
+{
+#if defined(HAVE_MPI)
+
+ _mpi_double_int_t val_in, val_min;
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ val_in.val = *dis2mn;
+ val_in.rank = cs_glob_rank_id;
+
+ MPI_Allreduce(&val_in, &val_min, 1, MPI_DOUBLE_INT, MPI_MINLOC,
+ cs_glob_mpi_comm);
+
+ *ndrang = cs_glob_rank_id;
+
+ MPI_Bcast(node, 1, CS_MPI_INT, val_min.rank, cs_glob_mpi_comm);
+ MPI_Bcast(ndrang, 1, CS_MPI_INT, val_min.rank, cs_glob_mpi_comm);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parfpt\n",
+ cs_glob_rank_id, n_parfpt_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Return the value associated to a probe.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARHIS (NODE, NDRANG, VAR, VARCAP)
+ * *****************
+ *
+ * INTEGER NODE : --> : local number of the element related to
+ * a measure node
+ * INTEGER NDRANG : --> : rank of the process owning the closest
+ * node from the measure node
+ * DOUBLE PRECISION VAR(*) : --> : values of the variable on local elements
+ * DOUBLE PRECISION VARCAP : <-- : value of the variable for the element
+ * related to the measure node
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parhis, PARHIS)(cs_int_t *node,
+ cs_int_t *ndrang,
+ cs_real_t var[],
+ cs_real_t *varcap)
+{
+#if defined(HAVE_MPI)
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ if (*ndrang == cs_glob_rank_id)
+ *varcap = var[*node - 1];
+ else
+ *varcap = 0.0;
+
+ MPI_Bcast(varcap, 1, CS_MPI_REAL, *ndrang, cs_glob_mpi_comm);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf ("irang = %d, iappel = %d, tot = %d, parhis\n",
+ cs_glob_rank_id, n_parhis_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Return the global cell number of a local cell.
+ * (send to all the processes)
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARCEL (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local cell number
+ * INTEGER RANKID : --> : rank of the domain (0 to N-1)
+ * INTEGER GNUM : <-- : global cell number
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parcel, PARCEL)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum)
+{
+#if defined(HAVE_MPI)
+
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ if (*rankid == cs_glob_rank_id)
+ *gnum = cs_glob_mesh->global_cell_num[*lnum - 1];
+ else
+ *gnum = 0;
+
+ MPI_Bcast(gnum, 1, CS_MPI_INT, *rankid, cs_glob_mpi_comm);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, parcel\n",
+ cs_glob_rank_id, n_parcel_calls++, n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Return the global cell number knowing its related local cell number. No
+ * communication is useful.
+ * Return the local cell number in serial mode.
+ * Return 0 if the local cell number > mesh->n_cells
+ * Return 0 if the current rank domain != RANKID
+ *
+ * Fortran interface :
+ *
+ * SUBROUTINE PARCLG (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local cell number
+ * INTEGER RANKID : --> : rank of the current domain (0 to N-1)
+ * INTEGER GNUM : <-- : global cell number
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parclg, PARCLG)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum)
+{
+ if (*rankid < 0)
+ *gnum = *lnum;
+
+ else if ( (*rankid == cs_glob_rank_id) && (*lnum <= cs_glob_mesh->n_cells) )
+ *gnum = cs_glob_mesh->global_cell_num[*lnum - 1];
+
+ else
+ *gnum = 0;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Return the global internal face number knowing its related local internal
+ * face number. No communication is useful.
+ * Return the local internal face number in serial mode.
+ * Return 0 if the local internal face number > mesh->n_i_faces
+ * Return 0 if the current rank domain != RANKID
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARFIG (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local internal face number
+ * INTEGER RANKID : --> : rank of the current domain (0 to N-1)
+ * INTEGER GNUM : <-- : global internal face number
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parfig, PARFIG)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum)
+{
+ if (*rankid < 0)
+ *gnum = *lnum;
+
+ else if ( (*rankid == cs_glob_rank_id)
+ && (*lnum <= cs_glob_mesh->n_i_faces) )
+ *gnum = cs_glob_mesh->global_i_face_num[*lnum - 1];
+
+ else
+ *gnum = 0;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Return the global border face number knowing its related local border face
+ * number. No communication is useful.
+ * Return the local border face number in serial mode.
+ * Return 0 if the local border face number > mesh->n_b_faces
+ * Return 0 if the current rank domain != RANKID
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PARFBG (LNUM, RANKID, GNUM)
+ * *****************
+ *
+ * INTEGER LNUM : --> : local border face number
+ * INTEGER RANKID : --> : rank of the current domain (0 to N-1)
+ * INTEGER GNUM : <-- : global border face number
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (parfbg, PARFBG)(cs_int_t *lnum,
+ cs_int_t *rankid,
+ cs_int_t *gnum)
+{
+ if (*rankid < 0)
+ *gnum = *lnum;
+
+ else if ( (*rankid == cs_glob_rank_id)
+ && (*lnum <= cs_glob_mesh->n_b_faces) )
+ *gnum = cs_glob_mesh->global_b_face_num[*lnum - 1];
+
+ else
+ *gnum = 0;
+
+}
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute the sum of real values for entities belonging to a fvm_interface_t
+ * structure.
+ *
+ * Only the values of entities belonging to the interface are summed.
+ *
+ * parameters:
+ * interfaces --> pointer to a fvm_interface_set_t structure
+ * var_size --> number of elements in var buffer
+ * stride --> number of values (no interlaced) by entity
+ * var <-> variable buffer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_parall_interface_sr(fvm_interface_set_t *interfaces,
+ cs_int_t var_size,
+ cs_int_t stride,
+ cs_real_t *var)
+{
+#if defined(HAVE_MPI)
+
+ int request_count;
+ int distant_rank, n_interfaces;
+ cs_int_t id, ii, jj;
+ cs_int_t total_size;
+
+ cs_int_t count_size = 0;
+ fvm_lnum_t n_entities = 0;
+ cs_real_t *buf = NULL, *send_buf = NULL, *recv_buf = NULL;
+
+ MPI_Request *request = NULL;
+ MPI_Status *status = NULL;
+
+ const fvm_lnum_t *local_num = NULL;
+ const fvm_interface_t *interface = NULL;
+
+ /* Initialize and allocate */
+
+ n_interfaces = fvm_interface_set_size(interfaces);
+
+ for (id = 0; id < n_interfaces; id++) {
+ count_size
+ += fvm_interface_size(fvm_interface_set_get(interfaces, id));
+ }
+
+ total_size = count_size;
+
+ BFT_MALLOC(buf, total_size * stride * 2, cs_real_t);
+
+ BFT_MALLOC(request, n_interfaces * 2, MPI_Request);
+ BFT_MALLOC(status, n_interfaces * 2, MPI_Status);
+
+ /* Send and Receive data from distant ranks with
+ non-blocking communications */
+
+ request_count = 0;
+ count_size = 0;
+
+ /* Receive */
+
+ for (id = 0; id < n_interfaces; id++) {
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+
+ recv_buf = buf + (count_size * stride);
+
+ MPI_Irecv(recv_buf,
+ n_entities * stride,
+ CS_MPI_REAL,
+ distant_rank,
+ distant_rank,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+
+ count_size += n_entities;
+
+ }
+
+ assert(count_size == total_size);
+
+ /* Send */
+
+ for (id = 0 ; id < n_interfaces ; id++) {
+
+ /* Preparation of data to send */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ distant_rank = fvm_interface_rank(interface);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ send_buf = buf + (count_size * stride);
+
+ for (ii = 0 ; ii < n_entities ; ii++) {
+ for (jj = 0 ; jj < stride ; jj++)
+ send_buf[ii*stride + jj] = var[jj*var_size + (local_num[ii] - 1)];
+ }
+
+ MPI_Isend(send_buf,
+ n_entities * stride,
+ CS_MPI_REAL,
+ distant_rank,
+ (int)cs_glob_rank_id,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+
+ count_size += n_entities;
+
+ }
+
+ assert(count_size == 2*total_size);
+
+ /* Sync after each rank had received all the messages */
+
+ MPI_Waitall(request_count, request, status);
+
+ BFT_FREE(request);
+ BFT_FREE(status);
+
+ /* Now we had each part to var */
+
+ count_size = 0;
+
+ for (id = 0 ; id < n_interfaces ; id++) {
+
+ /* Retrieve data */
+
+ interface = fvm_interface_set_get(interfaces, id);
+ n_entities = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ recv_buf = buf + (count_size * stride);
+
+ for (ii = 0 ; ii < n_entities ; ii++) {
+ for (jj = 0 ; jj < stride ; jj++) {
+ var[jj*var_size + (local_num[ii] - 1)] += recv_buf[ii*stride + jj];
+ }
+ }
+
+ count_size += n_entities;
+
+ }
+
+ BFT_FREE(buf);
+
+#endif
+
+#if CS_PARALL_DEBUG_COUNT
+ printf("irang = %d, iappel = %d, tot = %d, cs_parallel_interface_sr\n",
+ cs_glob_rank_id,
+ n_interface_sr_calls++,
+ n_total_par_calls++);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_perio.c b/src/base/cs_perio.c
new file mode 100644
index 0000000..9977bec
--- /dev/null
+++ b/src/base/cs_perio.c
@@ -0,0 +1,3002 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions handling with periodicity.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <stdarg.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_periodicity.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_halo.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_perio.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* De-interlace buffer for strided operations */
+
+static size_t _cs_glob_perio_halo_backup_size = 0;
+static size_t _cs_glob_perio_halo_backup_id = 0;
+static cs_real_t *_cs_glob_perio_halo_backup = NULL;
+static const cs_real_t *_cs_glob_perio_last_backup[3] = {NULL, NULL, NULL};
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update array of element variable values for periodicity in serial mode,
+ * prior to geometric transformations.
+ *
+ * This function exits immediately in parallel mode, as values should in
+ * this case have been updated through halo synchronization.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * halo_type --> halo synchronization on standard or extended cells
+ * var <-> pointer to cell variable
+ *----------------------------------------------------------------------------*/
+
+static void
+_sync_loc_var(const cs_halo_t *halo,
+ cs_halo_type_t halo_type,
+ cs_real_t var[])
+{
+ cs_int_t i, start, length;
+
+ if (cs_glob_n_ranks == 1) {
+
+ cs_real_t *recv_var
+ = var + halo->n_local_elts + halo->index[0];
+
+ start = halo->send_index[0];
+
+ if (halo_type == CS_HALO_EXTENDED)
+ length = halo->send_index[2] - halo->send_index[0];
+ else
+ length = halo->send_index[1] - halo->send_index[0];
+
+ for (i = 0; i < length; i++)
+ recv_var[i] = var[halo->send_list[start + i]];
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Update array of strided element variable values for same-rank periodicity,
+ * prior to geometric transformations.
+ *
+ * Periodic values obtained from different ranks should already have been
+ * updated through parallel synchronization.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * halo_type --> halo synchronization on standard or extended cells
+ * var <-> pointer to cell variable
+ * stride --> variable stride
+ *----------------------------------------------------------------------------*/
+
+static void
+_sync_loc_var_strided(const cs_halo_t *halo,
+ cs_halo_type_t halo_type,
+ cs_real_t var[],
+ int stride)
+{
+ cs_int_t i, j, start, length;
+
+ if (cs_glob_n_ranks == 1) {
+
+ cs_real_t *recv_var
+ = var + halo->n_local_elts*stride + halo->index[0];
+
+ start = halo->send_index[0];
+
+ if (halo_type == CS_HALO_EXTENDED)
+ length = halo->send_index[2] - halo->send_index[0];
+ else
+ length = halo->send_index[1] - halo->send_index[0];
+
+ for (i = 0; i < length; i++) {
+ for (j = 0; j < stride; j++)
+ recv_var[i*stride + j] = var[(halo->send_list[start + i])*stride + j];
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Compute a matrix/vector product to apply a transformation to a given
+ * vector.
+ *
+ * parameters:
+ * matrix[3][4] --> matrix of the transformation in homogeneous coord.
+ * last line = [0; 0; 0; 1] (Not used here)
+ * in_cell_id --> cell_id of the parent cell.
+ * out_cell_id --> cell_id of the generated cell.
+ * xyz <-> array of coordinates
+ *----------------------------------------------------------------------------*/
+
+static void
+_apply_vector_transfo(cs_real_t matrix[3][4],
+ cs_int_t in_cell_id,
+ cs_int_t out_cell_id,
+ cs_real_t *xyz)
+{
+ cs_int_t i, j;
+
+ cs_real_t xyz_a[3 + 1];
+ cs_real_t xyz_b[3];
+
+ /* Define the cell center in homogeneous coordinates before
+ transformation */
+
+ for (j = 0; j < 3; j++)
+ xyz_a[j] = xyz[in_cell_id*3 + j];
+ xyz_a[3] = 1;
+
+ /* Initialize output */
+
+ for (i = 0; i < 3; i++)
+ xyz_b[i] = 0.;
+
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 4; j++)
+ xyz_b[i] += matrix[i][j]*xyz_a[j];
+
+ /* Store updated cell center */
+
+ for (j = 0; j < 3; j++)
+ xyz[out_cell_id*3 + j] = xyz_b[j];
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute a matrix/vector product to apply a rotation to a given vector.
+ *
+ * parameters:
+ * matrix[3][4] --> matrix of the transformation in homogeneous coord.
+ * last line = [0; 0; 0; 1] (Not used here)
+ * x_in --> X coord. of the incoming vector
+ * y_in --> Y coord. of the incoming vector
+ * z_in --> Z coord. of the incoming vector
+ * x_out <-- pointer to the X coord. of the output
+ * y_out <-- pointer to the Y coord. of the output
+ * z_out <-- pointer to the Z coord. of the output
+ *----------------------------------------------------------------------------*/
+
+static void
+_apply_vector_rotation(cs_real_t matrix[3][4],
+ cs_real_t x_in,
+ cs_real_t y_in,
+ cs_real_t z_in,
+ cs_real_t *x_out,
+ cs_real_t *y_out,
+ cs_real_t *z_out)
+{
+ *x_out = matrix[0][0] * x_in + matrix[0][1] * y_in + matrix[0][2] * z_in;
+ *y_out = matrix[1][0] * x_in + matrix[1][1] * y_in + matrix[1][2] * z_in;
+ *z_out = matrix[2][0] * x_in + matrix[2][1] * y_in + matrix[2][2] * z_in;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute a matrix * tensor * Tmatrix product to apply a rotation to a
+ * given tensor
+ *
+ * parameters:
+ * matrix[3][4] --> transformation matric in homogeneous coords.
+ * last line = [0; 0; 0; 1] (Not used here)
+ * in11, in12, in13 --> incoming first line of the tensor
+ * in21, in22, in23 --> incoming second line of the tensor
+ * in31, in32, in33 --> incoming third line of the tensor
+ * out11, out12, out13 <-- pointer to the first line of the output
+ * out21, out22, out23 <-- pointer to the second line of the output
+ * out31, out32, out33 <-- pointer to the third line of the output
+ *----------------------------------------------------------------------------*/
+
+static void
+_apply_tensor_rotation(cs_real_t matrix[3][4],
+ cs_real_t in11,
+ cs_real_t in12,
+ cs_real_t in13,
+ cs_real_t in21,
+ cs_real_t in22,
+ cs_real_t in23,
+ cs_real_t in31,
+ cs_real_t in32,
+ cs_real_t in33,
+ cs_real_t *out11,
+ cs_real_t *out12,
+ cs_real_t *out13,
+ cs_real_t *out21,
+ cs_real_t *out22,
+ cs_real_t *out23,
+ cs_real_t *out31,
+ cs_real_t *out32,
+ cs_real_t *out33)
+{
+ cs_int_t i, j, k;
+ cs_real_t tensorA[3][3], tensorB[3][3];
+
+ tensorA[0][0] = matrix[0][0]*in11 + matrix[0][1]*in12 + matrix[0][2]*in13;
+ tensorA[0][1] = matrix[1][0]*in11 + matrix[1][1]*in12 + matrix[1][2]*in13;
+ tensorA[0][2] = matrix[2][0]*in11 + matrix[2][1]*in12 + matrix[2][2]*in13;
+
+ tensorA[1][0] = matrix[0][0]*in21 + matrix[0][1]*in22 + matrix[0][2]*in23;
+ tensorA[1][1] = matrix[1][0]*in21 + matrix[1][1]*in22 + matrix[1][2]*in23;
+ tensorA[1][2] = matrix[2][0]*in21 + matrix[2][1]*in22 + matrix[2][2]*in23;
+
+ tensorA[2][0] = matrix[0][0]*in31 + matrix[0][1]*in32 + matrix[0][2]*in33;
+ tensorA[2][1] = matrix[1][0]*in31 + matrix[1][1]*in32 + matrix[1][2]*in33;
+ tensorA[2][2] = matrix[2][0]*in31 + matrix[2][1]*in32 + matrix[2][2]*in33;
+
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ tensorB[i][j] = 0.;
+ for (k = 0; k < 3; k++)
+ tensorB[i][j] += matrix[i][k] * tensorA[k][j];
+ }
+ }
+
+ *out11 = tensorB[0][0];
+ *out22 = tensorB[1][1];
+ *out33 = tensorB[2][2];
+
+ if (out12 != NULL) {
+ *out12 = tensorB[0][1];
+ *out13 = tensorB[0][2];
+ *out21 = tensorB[1][0];
+ *out23 = tensorB[1][2];
+ *out31 = tensorB[2][0];
+ *out32 = tensorB[2][1];
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Test if a halo seems compatible with the main mesh's periodic
+ * transformations.
+ *
+ * If a halo is not compatible, abort with an error message.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_test_halo_compatibility(const cs_halo_t *halo)
+{
+ assert(halo != NULL);
+
+ if (cs_glob_mesh->n_transforms != halo->n_transforms)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The %d periodic transformations of the halo do not comply\n"
+ "with the main mesh transformations (numbering %d).\n"),
+ halo->n_transforms, (int)(cs_glob_mesh->n_transforms));
+}
+
+/*----------------------------------------------------------------------------
+ * Update dudxyz and wdudxy for periodic ghost cells.
+ *
+ * Called by PERMAS.
+ *
+ * parameters:
+ * h_cell_id --> cell id in halo
+ * cell_id --> cell id
+ * rom --> density array
+ * call_id --> first or second call
+ * phase_id --> phase id
+ * dudxyz <-> gradient on the components of the velocity.
+ * wdudxy <-> associated working array.
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_dudxyz(cs_int_t h_cell_id,
+ cs_int_t cell_id,
+ const cs_real_t *rom,
+ cs_int_t call_id,
+ cs_int_t phase_id,
+ cs_real_t *dudxyz,
+ cs_real_t *wdudxy)
+{
+ cs_int_t i, j, id;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ const cs_int_t n_ghost_cells = mesh->n_ghost_cells;
+ const cs_int_t stride = n_ghost_cells * 3;
+
+ if (call_id == 1) { /* First call */
+
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ id = h_cell_id + n_ghost_cells*i + stride*j + 3*stride*phase_id;
+ wdudxy[id] = dudxyz[id];
+ dudxyz[id] *= rom[cell_id];
+ }
+ }
+
+ }
+ else if (call_id == 2) { /* Second call */
+
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ id = h_cell_id + n_ghost_cells*i + stride*j + 3*stride*phase_id;
+ dudxyz[id] = wdudxy[id];
+ }
+ }
+
+ } /* End if second call */
+}
+
+/*----------------------------------------------------------------------------
+ * Update drdxyz and wdrdxy for periodic ghost cells.
+ *
+ * Called by PERMAS.
+ *
+ * parameters:
+ * h_cell_id --> cell id in halo
+ * cell_id --> cell id
+ * rom --> density array
+ * call_id --> first or second call
+ * phase_id --> phase id
+ * drdxyz <-> Gradient on components of Rij (Reynolds stress tensor)
+ * wdrdxy <-> associated working array.
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_drdxyz(cs_int_t h_cell_id,
+ cs_int_t cell_id,
+ const cs_real_t *rom,
+ cs_int_t call_id,
+ cs_int_t phase_id,
+ cs_real_t *drdxyz,
+ cs_real_t *wdrdxy)
+{
+ cs_int_t i, j, id;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ const cs_int_t n_ghost_cells = mesh->n_ghost_cells;
+ const cs_int_t stride = 2*3*n_ghost_cells;
+
+ if (call_id == 1) { /* First call */
+
+ for (i = 0; i < 2*3; i++) {
+ for (j = 0; j < 3; j++) {
+ id = h_cell_id + n_ghost_cells*i + stride*j +3*stride*phase_id;
+ wdrdxy[id] = drdxyz[id];
+ drdxyz[id] *= rom[cell_id];
+ }
+ }
+
+ }
+ else if (call_id == 2) { /* Second call */
+
+ for (i = 0; i < 2*3; i++) {
+ for (j = 0; j < 3; j++) {
+ id = h_cell_id + n_ghost_cells*i + stride*j +3*stride*phase_id;
+ drdxyz[id] = wdrdxy[id];
+ }
+ }
+
+ } /* End if second call */
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange buffers for PERINR or PERINU
+ *
+ * parameters:
+ * strid_c --> stride on the component
+ * strid_v --> stride on the variable
+ * strid_p --> stride on the phase
+ * dxyz <-> gradient on the variable (dudxy or drdxy)
+ * w1, w2, w3 <-> working buffers
+ *----------------------------------------------------------------------------*/
+
+static void
+_peinur1(cs_int_t strid_c,
+ cs_int_t strid_v,
+ cs_int_t strid_p,
+ cs_real_t *dxyz,
+ cs_real_t *w1,
+ cs_real_t *w2,
+ cs_real_t *w3)
+{
+ cs_int_t i, t_id, rank_id, shift;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_ghost_cells = mesh->n_cells_with_ghosts - mesh->n_cells;
+ const size_t save_block_size = n_ghost_cells*sizeof(cs_real_t);
+ const cs_int_t n_transforms = mesh->n_transforms;
+
+ cs_real_t *w_save = NULL;
+ BFT_MALLOC(w_save, n_ghost_cells*3, cs_real_t);
+
+ memcpy(w_save, w1+n_cells, save_block_size);
+ memcpy(w_save + n_ghost_cells, w2+n_cells, save_block_size);
+ memcpy(w_save+(2*n_ghost_cells), w3+n_cells, save_block_size);
+
+ cs_halo_sync_var(mesh->halo, mesh->halo_type, w1);
+ cs_halo_sync_var(mesh->halo, mesh->halo_type, w2);
+ cs_halo_sync_var(mesh->halo, mesh->halo_type, w3);
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ for (i = start_std; i < end_std; i++) {
+ dxyz[i + strid_c + strid_v*0 + strid_p] = w1[n_cells + i];
+ dxyz[i + strid_c + strid_v*1 + strid_p] = w2[n_cells + i];
+ dxyz[i + strid_c + strid_v*2 + strid_p] = w3[n_cells + i];
+ }
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+ dxyz[i + strid_c + strid_v*0 + strid_p] = w1[n_cells + i];
+ dxyz[i + strid_c + strid_v*1 + strid_p] = w2[n_cells + i];
+ dxyz[i + strid_c + strid_v*2 + strid_p] = w3[n_cells + i];
+ }
+
+ } /* End if extended halo */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on transformations */
+
+ memcpy(w1+n_cells, w_save, save_block_size);
+ memcpy(w2+n_cells, w_save + n_ghost_cells, save_block_size);
+ memcpy(w3+n_cells, w_save+(2*n_ghost_cells), save_block_size);
+
+ BFT_FREE(w_save);
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Update values of periodic cells on standard halos.
+ *
+ * VARIJ stands for the periodic variable to deal with.
+ *
+ * Several cases are possible:
+ *
+ * IDIMTE = 0 : VAR11 is a scalar.
+ * IDIMTE = 1 : VAR11, VAR22, VAR33 is a vector.
+ * IDIMTE = 2 : VARIJ is a 3*3 matrix.
+ * IDIMTE = 21 : VARIJ is a diagonal 3*3 matrix (VAR11, VAR22, VAR33).
+ *
+ * Translation is always treated. Several treatment can be done for rotation:
+ *
+ * ITENSO = 0 : only copy values of elements generated by rotation
+ * ITENSO = 1 : ignore rotation.
+ * ITENSO = 11 : reset values of elements generated by rotation
+ *
+ * - Periodicity for a scalar (IDIMTE = 0, ITENSO = 0). We update VAR11
+ * for translation or rotation periodicity.
+ * - Periodicity for a scalar (IDIMTE = 0, ITENSO = 1). We update VAR11 only
+ * for translation periodicity.
+ * - Periodicity for a scalar (IDIMTE = 0, ITENSO = 11). We update VAR11 only
+ * for translation periodicity. VAR11 is reseted for rotation periodicicty.
+ *
+ * We use this option to cancel the halo for rotational periodicities
+ * in iterative solvers when solving for vectors and tensors by
+ * increment. This is an approximative solution, which does not seem
+ * worse than another.
+ *
+ * - with a vector (IDIMTE = 0, ITENSO = 2), we update
+ * VAR11, VAR22, VAR33, for translation only.
+ * - with a vector (IDIMTE = 1, ITENSO = *), we update
+ * VAR11, VAR22, VAR33, for translation and rotation.
+ * - with a tensor of rank 2 (IDIMTE = 2, ITENSO = *), we update
+ * VAR11, V12, VAR13, VAR21, VAR22, VAR23, VAR31, VAR32, VAR33,
+ * for translation and rotation.
+ * - with a tensor or rank 2 (IDIMTE = 21, ITENSO = *) , we update
+ * VAR11, VAR22, VAR33, for translation and rotation (the tensor
+ * is considered diagonal).
+ *
+ * Fortran API:
+ *
+ * SUBROUTINE PERCOM
+ * *****************
+ *
+ * INTEGER IDIMTE : -> : variable dimension (maximum 3)
+ * 0 : scalar (VAR11), or considered
+ * scalar
+ * 1 : vector (VAR11,VAR22,VAR33)
+ * 2 : tensor of rank 2 (VARIJ)
+ * 21 : tensor of rank 2 supposed
+ * diagonal (VAR11, VAR22, VAR33)
+ * INTEGER ITENSO : -> : to define rotation behavior
+ * 0 : scalar (VAR11)
+ * 1 : tensor or vector component
+ * (VAR11), implicit in
+ * translation case
+ * 11 : same as ITENSO=1 with vector
+ * or tensor component cancelled
+ * for rotation
+ * 2 : vector (VAR11, VAR22, VAR33)
+ * implicit for rotation
+ * DOUBLE PRECISION VAR11(NCELET) : - : component 11 of rank 2 tensor
+ * DOUBLE PRECISION VAR12(NCELET) : - : component 12 of rank 2 tensor
+ * DOUBLE PRECISION VAR13(NCELET) : - : component 13 of rank 2 tensor
+ * DOUBLE PRECISION VAR21(NCELET) : - : component 21 of rank 2 tensor
+ * DOUBLE PRECISION VAR22(NCELET) : - : component 22 of rank 2 tensor
+ * DOUBLE PRECISION VAR23(NCELET) : - : component 23 of rank 2 tensor
+ * DOUBLE PRECISION VAR31(NCELET) : - : component 31 of rank 2 tensor
+ * DOUBLE PRECISION VAR32(NCELET) : - : component 32 of rank 2 tensor
+ * DOUBLE PRECISION VAR33(NCELET) : - : component 33 of rank 2 tensor
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (percom, PERCOM) (const cs_int_t *idimte,
+ const cs_int_t *itenso,
+ cs_real_t var11[],
+ cs_real_t var12[],
+ cs_real_t var13[],
+ cs_real_t var21[],
+ cs_real_t var22[],
+ cs_real_t var23[],
+ cs_real_t var31[],
+ cs_real_t var32[],
+ cs_real_t var33[])
+{
+ cs_bool_t bool_err = false;
+
+ const cs_halo_t *halo = cs_glob_mesh->halo;
+
+ /* 1. Checking */
+ /*----------------*/
+
+ if (*idimte != 0 && *idimte != 1 && *idimte != 2 && *idimte != 21)
+ bool_err = true;
+
+ if (*itenso != 0 && *itenso != 1 && *itenso != 11 && *itenso != 2)
+ bool_err = true;
+
+
+ if (bool_err == true)
+ bft_error(__FILE__, __LINE__, 0,
+ _("IDIMTE and/or ITENSO have incoherent values"));
+
+ /* 2. Synchronization */
+ /*---------------------*/
+
+ if (*idimte == 0) {
+
+ /* Input parameter is a scalar. Sync values on periodic cells for
+ translation and rotation */
+
+ if (*itenso == 0)
+ cs_perio_sync_var_scal(halo,
+ CS_HALO_STANDARD,
+ CS_PERIO_ROTA_COPY,
+ var11);
+
+ /* Input parameter is a scalar. Sync values on periodic cells for
+ translation. We ignore the rotation tranformations. */
+
+ else if (*itenso == 1)
+ cs_perio_sync_var_scal(halo,
+ CS_HALO_STANDARD,
+ CS_PERIO_ROTA_IGNORE,
+ var11);
+
+ /* Reset elements generated by a rotation. (used in Jacobi for Reynolds
+ stresses or to solve velocity )*/
+
+ else if (*itenso == 11)
+ cs_perio_sync_var_scal(halo,
+ CS_HALO_STANDARD,
+ CS_PERIO_ROTA_RESET,
+ var11);
+
+ /* Variable is part of a tensor, so exchange is possible only in
+ translation; 3 components are exchanged (we may guess that for
+ rotations, something has been done before; see PERINR for example). */
+
+ else if (*itenso == 2)
+ cs_perio_sync_var_vect(halo,
+ CS_HALO_STANDARD,
+ CS_PERIO_ROTA_IGNORE,
+ var11, var22, var33);
+
+ } /* End of idimte == 0 case */
+
+ /* --> If we want to handle the variable as a vector, we suppose that
+ it is (at least) a vector. Translation and rotation are exchanged. */
+
+ else if (*idimte == 1)
+ cs_perio_sync_var_vect(halo,
+ CS_HALO_STANDARD,
+ CS_PERIO_ROTA_COPY,
+ var11, var22, var33);
+
+ /* --> If we want to handle the variable as a tensor, we suppose that
+ it is a tensor. Translation and rotation are exchanged. */
+
+ else if (*idimte == 2)
+ cs_perio_sync_var_tens(halo,
+ CS_HALO_STANDARD,
+ var11, var12, var13,
+ var21, var22, var23,
+ var31, var32, var33);
+
+ /* --> If we want to handle the variable as a tensor, but that
+ it is a tensor's diagonal, we suppose that it is a tensor.
+ Translation and rotation are exchanged. */
+
+ else if (*idimte == 21)
+ cs_perio_sync_var_diag(halo,
+ CS_HALO_STANDARD,
+ var11, var22, var33);
+}
+
+/*----------------------------------------------------------------------------
+ * Update values of periodic cells on extended halos.
+ *
+ * Except for the extended halo, this function is the same as PERCOM.
+ *
+ * Fortran API:
+ *
+ * SUBROUTINE PERCVE
+ * *****************
+ *
+ * INTEGER IDIMTE : -> : variable dimension (maximum 3)
+ * 0 : scalar (VAR11), or considered
+ * scalar
+ * 1 : vector (VAR11,VAR22,VAR33)
+ * 2 : tensor of rank 2 (VARIJ)
+ * 21 : tensor of rank 2 supposed
+ * diagonal (VAR11, VAR22, VAR33)
+ * INTEGER ITENSO : -> : to define rotation behavior
+ * 0 : scalar (VAR11)
+ * 1 : tensor or vector component
+ * (VAR11), implicit in
+ * translation case
+ * 11 : same as ITENSO=1 with vector
+ * or tensor component cancelled
+ * for rotation
+ * 2 : vector (VAR11, VAR22, VAR33)
+ * implicit for rotation
+ * DOUBLE PRECISION VAR11(NCELET) : - : component 11 of rank 2 tensor
+ * DOUBLE PRECISION VAR12(NCELET) : - : component 12 of rank 2 tensor
+ * DOUBLE PRECISION VAR13(NCELET) : - : component 13 of rank 2 tensor
+ * DOUBLE PRECISION VAR21(NCELET) : - : component 21 of rank 2 tensor
+ * DOUBLE PRECISION VAR22(NCELET) : - : component 22 of rank 2 tensor
+ * DOUBLE PRECISION VAR23(NCELET) : - : component 23 of rank 2 tensor
+ * DOUBLE PRECISION VAR31(NCELET) : - : component 31 of rank 2 tensor
+ * DOUBLE PRECISION VAR32(NCELET) : - : component 32 of rank 2 tensor
+ * DOUBLE PRECISION VAR33(NCELET) : - : component 33 of rank 2 tensor
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (percve, PERCVE) (const cs_int_t *idimte,
+ const cs_int_t *itenso,
+ cs_real_t var11[],
+ cs_real_t var12[],
+ cs_real_t var13[],
+ cs_real_t var21[],
+ cs_real_t var22[],
+ cs_real_t var23[],
+ cs_real_t var31[],
+ cs_real_t var32[],
+ cs_real_t var33[])
+{
+ cs_bool_t bool_err = false;
+
+ const cs_halo_t *halo = cs_glob_mesh->halo;
+
+ /* 1. Checking */
+ /*----------------*/
+
+ if (*idimte != 0 && *idimte != 1 && *idimte != 2 && *idimte != 21)
+ bool_err = true;
+
+ if (*itenso != 0 && *itenso != 1 && *itenso != 11 && *itenso != 2)
+ bool_err = true;
+
+
+ if (bool_err == true)
+ bft_error(__FILE__, __LINE__, 0,
+ _("IDIMTE and/or ITENSO have incoherent values"));
+
+ /* 2. Synchronization */
+ /*---------------------*/
+
+ if (*idimte == 0) {
+
+ /* Input parameter is a scalar. Sync values on periodic cells for
+ translation and rotation */
+
+ if (*itenso == 0)
+ cs_perio_sync_var_scal(halo,
+ CS_HALO_EXTENDED,
+ CS_PERIO_ROTA_COPY,
+ var11);
+
+ /* Input parameter is a scalar. Sync values on periodic cells for
+ translation. We ignore the rotation tranformations. */
+
+ else if (*itenso == 1)
+ cs_perio_sync_var_scal(halo,
+ CS_HALO_EXTENDED,
+ CS_PERIO_ROTA_IGNORE,
+ var11);
+
+ /* Reset elements generated by a rotation. (used in Jacobi for Reynolds
+ stresses or to solve velocity )*/
+
+ else if (*itenso == 11)
+ cs_perio_sync_var_scal(halo,
+ CS_HALO_EXTENDED,
+ CS_PERIO_ROTA_RESET,
+ var11);
+
+ /* Variable is part of a tensor, so exchange is possible only in
+ translation; 3 components are exchanged (we may guess that for
+ rotations, something has been done before; see PERINR for example). */
+
+ else if (*itenso == 2)
+ cs_perio_sync_var_vect(halo,
+ CS_HALO_EXTENDED,
+ CS_PERIO_ROTA_IGNORE,
+ var11, var22, var33);
+
+ } /* End of idimte == 0 case */
+
+ /* --> If we want to handle the variable as a vector, we suppose that
+ it is (at least) a vector. Translation and rotation are exchanged. */
+
+ else if (*idimte == 1)
+ cs_perio_sync_var_vect(halo,
+ CS_HALO_EXTENDED,
+ CS_PERIO_ROTA_COPY,
+ var11, var22, var33);
+
+ /* --> If we want to handle the variable as a tensor, we suppose that
+ it is a tensor. Translation and rotation are exchanged. */
+
+ else if (*idimte == 2)
+ cs_perio_sync_var_tens(halo,
+ CS_HALO_EXTENDED,
+ var11, var12, var13,
+ var21, var22, var23,
+ var31, var32, var33);
+
+ /* --> If we want to handle the variable as a tensor, but that
+ it is a tensor's diagonal, we suppose that it is a tensor.
+ Translation and rotation are exchanged. */
+
+ else if (*idimte == 21)
+ cs_perio_sync_var_diag(halo,
+ CS_HALO_EXTENDED,
+ var11, var22, var33);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Periodicity management for INIMAS
+ *
+ * If INIMAS is called by NAVSTO :
+ * We assume that gradient on ghost cells given by a rotation is known
+ * and is equal to the velocity one for the previous time step.
+ * If INIMAS is called by DIVRIJ
+ * We assume that (more justifiable than in previous case) gradient on
+ * ghost cells given by rotation is equal to Rij gradient for the previous
+ * time step.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PERMAS
+ * *****************
+ *
+ * INTEGER IMASPE : -> : suivant l'appel de INIMAS
+ * = 1 si appel de RESOLP ou NAVSTO
+ * = 2 si appel de DIVRIJ
+ * INTEGER IPHAS : -> : numero de phase courante
+ * INTEGER IMASPE : -> : indicateur d'appel dans INIMAS
+ * = 1 si appel au debut
+ * = 2 si appel a la fin
+ * DOUBLE PRECISION ROM(NCELET) : -> : masse volumique aux cellules
+ * DOUBLE PRECISION DUDXYZ : -> : gradient de U aux cellules halo pour
+ * l'approche explicite en periodicite
+ * DOUBLE PRECISION DRDXYZ : -> : gradient de R aux cellules halo pour
+ * l'approche explicite en periodicite
+ * DOUBLE PRECISION WDUDXY : - : tableau de travail pour DUDXYZ
+ * DOUBLE PRECISION WDRDXY : - : tableau de travail pour DRDXYZ
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (permas, PERMAS)(const cs_int_t *imaspe,
+ const cs_int_t *iphas,
+ const cs_int_t *iappel,
+ cs_real_t rom[],
+ cs_real_t *dudxyz,
+ cs_real_t *drdxyz,
+ cs_real_t *wdudxy,
+ cs_real_t *wdrdxy)
+{
+ cs_int_t i, cell_id, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_halo_t *halo = mesh->halo;
+ cs_halo_type_t halo_type = mesh->halo_type;
+
+ const cs_int_t phase_id = *iphas - 1;
+
+ if (halo_type == CS_HALO_N_TYPES)
+ return;
+
+ if (*iappel == 1)
+ _sync_loc_var(mesh->halo, mesh->halo_type, rom);
+
+ for (t_id = 0; t_id < mesh->n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (halo_type == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ for (i = start_std; i < end_std; i++) {
+
+ cell_id = mesh->n_cells + i;
+
+ if (*imaspe == 1)
+ _update_dudxyz(i, cell_id, rom, *iappel, phase_id, dudxyz, wdudxy);
+
+ if (*imaspe == 2)
+ _update_drdxyz(i, cell_id, rom, *iappel, phase_id, drdxyz, wdrdxy);
+
+ } /* End of loop on halo elements */
+
+ if (halo_type == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+
+ cell_id = mesh->n_cells + i;
+
+ if (*imaspe == 1)
+ _update_dudxyz(i, cell_id, rom, *iappel, phase_id, dudxyz, wdudxy);
+
+ if (*imaspe == 2)
+ _update_drdxyz(i, cell_id, rom, *iappel, phase_id, drdxyz, wdrdxy);
+
+ } /* End of loop on halo elements */
+
+ } /* End if extended halo */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on transformation */
+}
+
+/*----------------------------------------------------------------------------
+ * Process DPDX, DPDY, DPDZ buffers in case of rotation on velocity vector and
+ * Reynolds stress tensor.
+ *
+ * We retrieve the gradient given by PERINU and PERINR (PHYVAR) for the
+ * velocity and the Reynolds stress tensor in a buffer on ghost cells. Then
+ * we define DPDX, DPDY and DPDZ gradient (1 -> n_cells_with_ghosts).
+ *
+ * We can't implicitly take into account rotation of a gradient of a non-scalar
+ * variable because we have to know the all three components in GRADRC.
+ *
+ * Otherwise, we can implicitly treat values given by translation. There will
+ * be replace further in GRADRC.
+ *
+ * We define IDIMTE to 0 and ITENSO to 2 for the velocity vector and the
+ * Reynolds stress tensor. We will still have to apply translation to these
+ * variables so we define a tag to not forget to do it.
+ *
+ * We assume that is correct to treat periodicities implicitly for the other
+ * variables in GRADRC. We define IDIMTE to 1 and ITENSO to 0.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PERING
+ * *****************
+ *
+ * INTEGER NPHAS : -> : numero de phase courante
+ * INTEGER IVAR : -> : numero de la variable
+ * INTEGER IDIMTE : <- : dimension de la variable (maximum 3)
+ * 0 : scalaire (VAR11), ou assimile
+ * scalaire
+ * 1 : vecteur (VAR11,VAR22,VAR33)
+ * 2 : tenseur d'ordre 2 (VARIJ)
+ * 21 : tenseur d'ordre 2 suppose
+ * diagonal (VAR11, VAR22, VAR33)
+ * INTEGER ITENSO : <- : pour l'explicitation de la rotation
+ * 0 : scalaire (VAR11)
+ * 1 : composante de vecteur ou de
+ * tenseur (VAR11) implicite pour
+ * la translation
+ * 11 : reprend le traitement ITENSO=1
+ * et composante de vecteur ou de
+ * tenseur annulee pour la rotation
+ * 2 : vecteur (VAR11 et VAR22 et VAR33)
+ * implicite pour la rotation
+ * INTEGER IPEROT : -> : indicateur du nombre de periodicte de
+ * rotation
+ * INTEGER IGUPER : -> : 0/1 indique qu'on a /n'a pas calcule
+ * les gradients dans DUDXYZ
+ * INTEGER IGRPER : -> : 0/1 indique qu'on a /n'a pas calcule
+ * les gradients dans DRDXYZ
+ * INTEGER IU : -> : position de la Vitesse(x,y,z)
+ * INTEGER IV : -> : dans RTP, RTPA
+ * INTEGER IW : -> : " "
+ * INTEGER ITYTUR : -> : turbulence (Rij-epsilon ITYTUR = 3)
+ * INTEGER IR11 : -> : position des Tensions de Reynolds
+ * INTEGER IR22 : -> : en Rij dans RTP, RTPA
+ * INTEGER IR33 : -> : " "
+ * INTEGER IR12 : -> : " "
+ * INTEGER IR13 : -> : " "
+ * INTEGER IR23 : -> : " "
+ * DOUBLE PRECISION DPDX(NCELET) : <-> : gradient de IVAR
+ * DOUBLE PRECISION DPDY(NCELET) : <-> : " "
+ * DOUBLE PRECISION DPDZ(NCELET) : <-> : " "
+ * DOUBLE PRECISION DUDXYZ : -> : gradient de U aux cellules halo pour
+ * l'approche explicite en periodicite
+ * DOUBLE PRECISION DRDXYZ : -> : gradient de R aux cellules halo pour
+ * l'approche explicite en periodicite
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (pering, PERING)(const cs_int_t *nphas,
+ const cs_int_t *ivar,
+ cs_int_t *idimte,
+ cs_int_t *itenso,
+ const cs_int_t *iperot,
+ const cs_int_t *iguper,
+ const cs_int_t *igrper,
+ const cs_int_t iu[CS_NPHSMX],
+ const cs_int_t iv[CS_NPHSMX],
+ const cs_int_t iw[CS_NPHSMX],
+ const cs_int_t itytur[CS_NPHSMX],
+ const cs_int_t ir11[CS_NPHSMX],
+ const cs_int_t ir22[CS_NPHSMX],
+ const cs_int_t ir33[CS_NPHSMX],
+ const cs_int_t ir12[CS_NPHSMX],
+ const cs_int_t ir13[CS_NPHSMX],
+ const cs_int_t ir23[CS_NPHSMX],
+ cs_real_t dpdx[],
+ cs_real_t dpdy[],
+ cs_real_t dpdz[],
+ const cs_real_t *dudxyz,
+ const cs_real_t *drdxyz)
+{
+ cs_int_t i, rank_id, phase_id, t_id, shift;
+ cs_int_t start_std, end_std, length, start_ext, end_ext, tag;
+ cs_int_t d_ph, d_var;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_cells = mesh->n_cells;
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t n_ghost_cells = mesh->n_ghost_cells;
+ const cs_int_t stride1 = n_ghost_cells * 3;
+ const cs_int_t stride2 = stride1 * 3;
+
+ /* We treat the gradient like a vector by default ...
+ (i.e. we assume that this is the gradient of a scalar. */
+
+ *idimte = 1;
+ *itenso = 0;
+
+ /*
+ When there is periodicity of rotation :
+ - Test if variable is a vector or a tensor,
+ - Retrieve its gradient values for ghost cells and for the previous
+ time step without reconstruction
+ - Finally, we define IDIMTE and ITENSO for the next call to PERCOM
+ Ghost cells without rotation are reset and other ghost cells keep
+ their value.
+ */
+
+ if (halo->n_rotations > 0) {
+
+ assert(*iperot > 0);
+
+ tag = 0;
+
+ for (phase_id = 0; phase_id < *nphas; phase_id++) {
+
+ if ( *ivar == iu[phase_id]
+ || *ivar == iv[phase_id]
+ || *ivar == iw[phase_id]) {
+
+ d_ph = stride2*phase_id;
+ tag = 1;
+
+ if (*ivar == iu[phase_id]) d_var = 0;
+ if (*ivar == iv[phase_id]) d_var = n_ghost_cells;
+ if (*ivar == iw[phase_id]) d_var = 2*n_ghost_cells;
+
+ if (*iguper == 1) { /* dudxyz not computed */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ for (i = start_std; i < end_std; i++) {
+ dpdx[n_cells + i] = dudxyz[i + d_var + stride1*0 + d_ph];
+ dpdy[n_cells + i] = dudxyz[i + d_var + stride1*1 + d_ph];
+ dpdz[n_cells + i] = dudxyz[i + d_var + stride1*2 + d_ph];
+ }
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+ dpdx[n_cells + i] = dudxyz[i + d_var + stride1*0 + d_ph];
+ dpdy[n_cells + i] = dudxyz[i + d_var + stride1*1 + d_ph];
+ dpdz[n_cells + i] = dudxyz[i + d_var + stride1*2 + d_ph];
+ }
+
+ } /* End if extended halo */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on transformations */
+
+ } /* End if *iguper == 1 */
+
+ } /* If *ivar == iu or iv or iw */
+
+ else if ((itytur[phase_id] == 3) &&
+ (*ivar == ir11[phase_id] || *ivar == ir22[phase_id] ||
+ *ivar == ir33[phase_id] || *ivar == ir12[phase_id] ||
+ *ivar == ir13[phase_id] || *ivar == ir23[phase_id])) {
+
+ d_ph = 2*stride2*phase_id;
+ tag = 1;
+
+ if (*ivar == ir11[phase_id]) d_var = 0;
+ if (*ivar == ir22[phase_id]) d_var = n_ghost_cells;
+ if (*ivar == ir33[phase_id]) d_var = 2*n_ghost_cells;
+ if (*ivar == ir12[phase_id]) d_var = 3*n_ghost_cells;
+ if (*ivar == ir13[phase_id]) d_var = 4*n_ghost_cells;
+ if (*ivar == ir23[phase_id]) d_var = 5*n_ghost_cells;
+
+ if (*igrper == 1) {
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ for (i = start_std; i < end_std; i++) {
+ dpdx[n_cells + i] = drdxyz[i + d_var + 2*stride1*0 + d_ph];
+ dpdy[n_cells + i] = drdxyz[i + d_var + 2*stride1*1 + d_ph];
+ dpdz[n_cells + i] = drdxyz[i + d_var + 2*stride1*2 + d_ph];
+ }
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+ dpdx[n_cells + i] = drdxyz[i + d_var + 2*stride1*0 + d_ph];
+ dpdy[n_cells + i] = drdxyz[i + d_var + 2*stride1*1 + d_ph];
+ dpdz[n_cells + i] = drdxyz[i + d_var + 2*stride1*2 + d_ph];
+ }
+
+ } /* End if extended halo */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on transformations */
+
+ } /* End if *igrper == 1 */
+
+ } /* If itytur[phase_id] == 3 and *ivar == irij */
+
+ } /* End of loop on phases */
+
+ if (tag == 1) {
+ *idimte = 0;
+ *itenso = 2;
+ }
+
+ } /* If there is/are rotation(s) */
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange buffers for PERINU
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PEINU1
+ * *****************
+ *
+ * INTEGER ISOU : -> : component of the velocity vector
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DUDXYZ : <-> : gradient of the velocity vector
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ * DOUBLE PRECISION W1..3(NCELET) : - : working buffers
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinu1, PEINU1)(const cs_int_t *isou,
+ const cs_int_t *iphas,
+ cs_real_t *dudxyz,
+ cs_real_t w1[],
+ cs_real_t w2[],
+ cs_real_t w3[])
+{
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ const cs_int_t n_ghost_cells = mesh->n_ghost_cells;
+ const cs_int_t comp_id = *isou - 1;
+ const cs_int_t phas_id = *iphas - 1;
+ const cs_int_t strid_v = n_ghost_cells * 3;
+ const cs_int_t strid_p = strid_v * 3 * phas_id;
+ const cs_int_t strid_c = n_ghost_cells * comp_id;
+
+ _peinur1(strid_c, strid_v, strid_p, dudxyz, w1, w2, w3);
+}
+
+/*----------------------------------------------------------------------------
+ * Apply rotation on DUDXYZ tensor.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PEINU2 (VAR)
+ * *****************
+ *
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DUDXYZ : <-> : gradient of the velocity vector
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ *
+ * Size of DUDXYZ and WDUDXY = n_ghost_cells*3*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinu2, PEINU2)(const cs_int_t *iphas,
+ cs_real_t *dudxyz)
+{
+ cs_int_t i, t_id, rank_id, shift;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+ fvm_periodicity_type_t perio_type;
+ cs_real_t matrix[3][4];
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t n_ghost_cells = mesh->n_ghost_cells;
+ const cs_int_t phase_id = *iphas - 1;
+ const cs_int_t stride = 3 * n_ghost_cells;
+ const fvm_periodicity_t *periodicity = mesh->periodicity;
+
+ /* Macro pour la position au sein d'un tableau */
+
+#define GET_ID1(i, j, k) ( \
+ i + n_ghost_cells*j + stride*k + 3*stride*phase_id)
+
+ if (mesh->halo_type == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ /* Compute the new cell centers through periodicity */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ fvm_periodicity_get_matrix(periodicity, t_id, matrix);
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++)
+ _apply_tensor_rotation(matrix,
+ dudxyz[GET_ID1(i,0,0)],
+ dudxyz[GET_ID1(i,0,1)],
+ dudxyz[GET_ID1(i,0,2)],
+ dudxyz[GET_ID1(i,1,0)],
+ dudxyz[GET_ID1(i,1,1)],
+ dudxyz[GET_ID1(i,1,2)],
+ dudxyz[GET_ID1(i,2,0)],
+ dudxyz[GET_ID1(i,2,1)],
+ dudxyz[GET_ID1(i,2,2)],
+ &dudxyz[GET_ID1(i,0,0)],
+ &dudxyz[GET_ID1(i,0,1)],
+ &dudxyz[GET_ID1(i,0,2)],
+ &dudxyz[GET_ID1(i,1,0)],
+ &dudxyz[GET_ID1(i,1,1)],
+ &dudxyz[GET_ID1(i,1,2)],
+ &dudxyz[GET_ID1(i,2,0)],
+ &dudxyz[GET_ID1(i,2,1)],
+ &dudxyz[GET_ID1(i,2,2)]);
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++)
+ _apply_tensor_rotation(matrix,
+ dudxyz[GET_ID1(i,0,0)],
+ dudxyz[GET_ID1(i,0,1)],
+ dudxyz[GET_ID1(i,0,2)],
+ dudxyz[GET_ID1(i,1,0)],
+ dudxyz[GET_ID1(i,1,1)],
+ dudxyz[GET_ID1(i,1,2)],
+ dudxyz[GET_ID1(i,2,0)],
+ dudxyz[GET_ID1(i,2,1)],
+ dudxyz[GET_ID1(i,2,2)],
+ &dudxyz[GET_ID1(i,0,0)],
+ &dudxyz[GET_ID1(i,0,1)],
+ &dudxyz[GET_ID1(i,0,2)],
+ &dudxyz[GET_ID1(i,1,0)],
+ &dudxyz[GET_ID1(i,1,1)],
+ &dudxyz[GET_ID1(i,1,2)],
+ &dudxyz[GET_ID1(i,2,0)],
+ &dudxyz[GET_ID1(i,2,1)],
+ &dudxyz[GET_ID1(i,2,2)]);
+
+ } /* End if extended halo exists */
+
+ } /* End of loop on ranks */
+
+ } /* End if periodicity is a rotation */
+
+ } /* End of loop on transformation */
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange buffers for PERINR
+ *
+ * Fortran Interface
+ *
+ * SUBROUTINE PEINR1 (VAR)
+ * *****************
+ *
+ * INTEGER ISOU : -> : component of the Reynolds stress tensor
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DRDXYZ : -> : gradient of the Reynolds stress tensor
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ * DOUBLE PRECISION W1..3(NCELET) : - : working buffers
+ *
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinr1, PEINR1)(const cs_int_t *isou,
+ const cs_int_t *iphas,
+ cs_real_t *drdxyz,
+ cs_real_t w1[],
+ cs_real_t w2[],
+ cs_real_t w3[])
+{
+ cs_mesh_t *mesh = cs_glob_mesh;
+
+ const cs_int_t n_ghost_cells = mesh->n_ghost_cells;
+ const cs_int_t comp_id = *isou - 1;
+ const cs_int_t phase_id = *iphas - 1;
+ const cs_int_t strid_v = 2 * n_ghost_cells * 3;
+ const cs_int_t strid_p = strid_v * 3 * phase_id;
+ const cs_int_t strid_c = n_ghost_cells * comp_id;
+
+ _peinur1(strid_c, strid_v, strid_p, drdxyz, w1, w2, w3);
+}
+
+/*----------------------------------------------------------------------------
+ * Apply rotation on the gradient of Reynolds stress tensor
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PEINR2 (VAR)
+ * *****************
+ *
+ * INTEGER IPHAS : -> : current phase number
+ * DOUBLE PRECISION DRDXYZ : -> : gradient of the Reynolds stress tensor
+ * for ghost cells and for an explicit
+ * treatment of the periodicity.
+ *
+ * Size of DRDXYZ and WDRDXY = n_ghost_cells*6*3*NPHAS
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (peinr2, PEINR2)(const cs_int_t *iphas,
+ cs_real_t *drdxyz)
+{
+ cs_int_t i, i1, i2, j, k, l, m, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+ fvm_periodicity_type_t perio_type;
+
+ cs_real_t matrix[3][4];
+ cs_real_t tensa[3][3][3];
+ cs_real_t tensb[3][3][3];
+ cs_real_t tensc[3][3][3];
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t n_ghost_cells = mesh->n_ghost_cells;
+ const cs_int_t stride = 2 * 3 * n_ghost_cells;
+ const cs_int_t phase_id = *iphas - 1;
+ const cs_halo_type_t halo_type = mesh->halo_type;
+ const fvm_periodicity_t *periodicity = mesh->periodicity;
+
+#define GET_ID2(elt_id, i, j) ( \
+ elt_id + n_ghost_cells*i + stride*j + 3*stride*phase_id)
+
+ if (halo_type == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ fvm_periodicity_get_matrix(periodicity, t_id, matrix);
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++) {
+
+ tensa[0][0][0] = drdxyz[GET_ID2(i,0,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,0,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,0,2)] * matrix[0][2];
+ tensa[0][1][0] = drdxyz[GET_ID2(i,3,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[0][2];
+ tensa[0][2][0] = drdxyz[GET_ID2(i,4,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[0][2];
+
+ tensa[0][0][1] = drdxyz[GET_ID2(i,0,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,0,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,0,2)] * matrix[1][2];
+ tensa[0][1][1] = drdxyz[GET_ID2(i,3,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[1][2];
+ tensa[0][2][1] = drdxyz[GET_ID2(i,4,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[1][2];
+
+ tensa[0][0][2] = drdxyz[GET_ID2(i,0,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,0,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,0,2)] * matrix[2][2];
+ tensa[0][1][2] = drdxyz[GET_ID2(i,3,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[2][2];
+ tensa[0][2][2] = drdxyz[GET_ID2(i,4,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[2][2];
+
+ tensa[1][0][0] = drdxyz[GET_ID2(i,3,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[0][2];
+ tensa[1][1][0] = drdxyz[GET_ID2(i,1,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,1,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,1,2)] * matrix[0][2];
+ tensa[1][2][0] = drdxyz[GET_ID2(i,5,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[0][2];
+
+ tensa[1][0][1] = drdxyz[GET_ID2(i,3,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[1][2];
+ tensa[1][1][1] = drdxyz[GET_ID2(i,1,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,1,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,1,2)] * matrix[1][2];
+ tensa[1][2][1] = drdxyz[GET_ID2(i,5,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[1][2];
+
+ tensa[1][0][2] = drdxyz[GET_ID2(i,3,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[2][2];
+ tensa[1][1][2] = drdxyz[GET_ID2(i,1,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,1,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,1,2)] * matrix[2][2];
+ tensa[1][2][2] = drdxyz[GET_ID2(i,5,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[2][2];
+
+ tensa[2][0][0] = drdxyz[GET_ID2(i,4,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[0][2];
+ tensa[2][1][0] = drdxyz[GET_ID2(i,5,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[0][2];
+ tensa[2][2][0] = drdxyz[GET_ID2(i,2,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,2,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,2,2)] * matrix[0][2];
+
+ tensa[2][0][1] = drdxyz[GET_ID2(i,4,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[1][2];
+ tensa[2][1][1] = drdxyz[GET_ID2(i,5,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[1][2];
+ tensa[2][2][1] = drdxyz[GET_ID2(i,2,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,2,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,2,2)] * matrix[1][2];
+
+ tensa[2][0][2] = drdxyz[GET_ID2(i,4,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[2][2];
+ tensa[2][1][2] = drdxyz[GET_ID2(i,5,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[2][2];
+ tensa[2][2][2] = drdxyz[GET_ID2(i,2,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,2,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,2,2)] * matrix[2][2];
+
+ for (j = 0; j < 3; j++)
+ for (l = 0; l < 3; l++)
+ for (k = 0; k < 3; k++) {
+ tensb[j][l][k] = 0.;
+ for (m = 0; m < 3; m++)
+ tensb[j][l][k] += matrix[j][m] * tensa[l][m][k];
+ }
+
+ for (k = 0; k < 3; k++)
+ for (i1 = 0; i1 < 3; i1++)
+ for (i2 = 0; i2 < 3; i2++) {
+ tensc[k][i1][i2] = 0.;
+ for (l = 0; l < 3; l++)
+ tensc[k][i1][i2] += matrix[k][l] * tensb[i1][l][i2];
+ }
+
+
+ drdxyz[GET_ID2(i,0,0)] = tensc[0][0][0];
+ drdxyz[GET_ID2(i,0,1)] = tensc[0][0][1];
+ drdxyz[GET_ID2(i,0,2)] = tensc[0][0][2];
+
+ drdxyz[GET_ID2(i,3,0)] = tensc[0][1][0];
+ drdxyz[GET_ID2(i,3,1)] = tensc[0][1][1];
+ drdxyz[GET_ID2(i,3,2)] = tensc[0][1][2];
+
+ drdxyz[GET_ID2(i,4,0)] = tensc[0][2][0];
+ drdxyz[GET_ID2(i,4,1)] = tensc[0][2][1];
+ drdxyz[GET_ID2(i,4,2)] = tensc[0][2][2];
+
+ drdxyz[GET_ID2(i,1,0)] = tensc[1][1][0];
+ drdxyz[GET_ID2(i,1,1)] = tensc[1][1][1];
+ drdxyz[GET_ID2(i,1,2)] = tensc[1][1][2];
+
+ drdxyz[GET_ID2(i,5,0)] = tensc[1][2][0];
+ drdxyz[GET_ID2(i,5,1)] = tensc[1][2][1];
+ drdxyz[GET_ID2(i,5,2)] = tensc[1][2][2];
+
+ drdxyz[GET_ID2(i,2,0)] = tensc[2][2][0];
+ drdxyz[GET_ID2(i,2,1)] = tensc[2][2][1];
+ drdxyz[GET_ID2(i,2,2)] = tensc[2][2][2];
+
+ } /* End of loop on standard ghost cells */
+
+ if (halo_type == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++) {
+
+ tensa[0][0][0] = drdxyz[GET_ID2(i,0,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,0,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,0,2)] * matrix[0][2];
+ tensa[0][1][0] = drdxyz[GET_ID2(i,3,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[0][2];
+ tensa[0][2][0] = drdxyz[GET_ID2(i,4,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[0][2];
+
+ tensa[0][0][1] = drdxyz[GET_ID2(i,0,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,0,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,0,2)] * matrix[1][2];
+ tensa[0][1][1] = drdxyz[GET_ID2(i,3,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[1][2];
+ tensa[0][2][1] = drdxyz[GET_ID2(i,4,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[1][2];
+
+ tensa[0][0][2] = drdxyz[GET_ID2(i,0,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,0,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,0,2)] * matrix[2][2];
+ tensa[0][1][2] = drdxyz[GET_ID2(i,3,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[2][2];
+ tensa[0][2][2] = drdxyz[GET_ID2(i,4,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[2][2];
+
+ tensa[1][0][0] = drdxyz[GET_ID2(i,3,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[0][2];
+ tensa[1][1][0] = drdxyz[GET_ID2(i,1,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,1,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,1,2)] * matrix[0][2];
+ tensa[1][2][0] = drdxyz[GET_ID2(i,5,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[0][2];
+
+ tensa[1][0][1] = drdxyz[GET_ID2(i,3,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[1][2];
+ tensa[1][1][1] = drdxyz[GET_ID2(i,1,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,1,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,1,2)] * matrix[1][2];
+ tensa[1][2][1] = drdxyz[GET_ID2(i,5,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[1][2];
+
+ tensa[1][0][2] = drdxyz[GET_ID2(i,3,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,3,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,3,2)] * matrix[2][2];
+ tensa[1][1][2] = drdxyz[GET_ID2(i,1,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,1,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,1,2)] * matrix[2][2];
+ tensa[1][2][2] = drdxyz[GET_ID2(i,5,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[2][2];
+
+ tensa[2][0][0] = drdxyz[GET_ID2(i,4,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[0][2];
+ tensa[2][1][0] = drdxyz[GET_ID2(i,5,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[0][2];
+ tensa[2][2][0] = drdxyz[GET_ID2(i,2,0)] * matrix[0][0] +
+ drdxyz[GET_ID2(i,2,1)] * matrix[0][1] +
+ drdxyz[GET_ID2(i,2,2)] * matrix[0][2];
+
+ tensa[2][0][1] = drdxyz[GET_ID2(i,4,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[1][2];
+ tensa[2][1][1] = drdxyz[GET_ID2(i,5,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[1][2];
+ tensa[2][2][1] = drdxyz[GET_ID2(i,2,0)] * matrix[1][0] +
+ drdxyz[GET_ID2(i,2,1)] * matrix[1][1] +
+ drdxyz[GET_ID2(i,2,2)] * matrix[1][2];
+
+ tensa[2][0][2] = drdxyz[GET_ID2(i,4,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,4,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,4,2)] * matrix[2][2];
+ tensa[2][1][2] = drdxyz[GET_ID2(i,5,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,5,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,5,2)] * matrix[2][2];
+ tensa[2][2][2] = drdxyz[GET_ID2(i,2,0)] * matrix[2][0] +
+ drdxyz[GET_ID2(i,2,1)] * matrix[2][1] +
+ drdxyz[GET_ID2(i,2,2)] * matrix[2][2];
+
+ for (j = 0; j < 3; j++)
+ for (l = 0; l < 3; l++)
+ for (k = 0; k < 3; k++) {
+ tensb[j][l][k] = 0.;
+ for (m = 0; m < 3; m++)
+ tensb[j][l][k] += matrix[j][m] * tensa[l][m][k];
+ }
+
+ for (k = 0; k < 3; k++)
+ for (i1 = 0; i1 < 3; i1++)
+ for (i2 = 0; i2 < 3; i2++) {
+ tensc[k][i1][i2] = 0.;
+ for (l = 0; l < 3; l++)
+ tensc[k][i1][i2] += matrix[k][l] * tensb[i1][l][i2];
+ }
+
+ drdxyz[GET_ID2(i,0,0)] = tensc[0][0][0];
+ drdxyz[GET_ID2(i,0,1)] = tensc[0][0][1];
+ drdxyz[GET_ID2(i,0,2)] = tensc[0][0][2];
+
+ drdxyz[GET_ID2(i,3,0)] = tensc[0][1][0];
+ drdxyz[GET_ID2(i,3,1)] = tensc[0][1][1];
+ drdxyz[GET_ID2(i,3,2)] = tensc[0][1][2];
+
+ drdxyz[GET_ID2(i,4,0)] = tensc[0][2][0];
+ drdxyz[GET_ID2(i,4,1)] = tensc[0][2][1];
+ drdxyz[GET_ID2(i,4,2)] = tensc[0][2][2];
+
+ drdxyz[GET_ID2(i,1,0)] = tensc[1][1][0];
+ drdxyz[GET_ID2(i,1,1)] = tensc[1][1][1];
+ drdxyz[GET_ID2(i,1,2)] = tensc[1][1][2];
+
+ drdxyz[GET_ID2(i,5,0)] = tensc[1][2][0];
+ drdxyz[GET_ID2(i,5,1)] = tensc[1][2][1];
+ drdxyz[GET_ID2(i,5,2)] = tensc[1][2][2];
+
+ drdxyz[GET_ID2(i,2,0)] = tensc[2][2][0];
+ drdxyz[GET_ID2(i,2,1)] = tensc[2][2][1];
+ drdxyz[GET_ID2(i,2,2)] = tensc[2][2][2];
+
+ } /* End of loop on extended ghost cells */
+
+ } /* End if an extended halo exists */
+
+ } /* End of loop on ranks */
+
+ } /* If the transformation is a rotation */
+
+ } /* End of loop on transformations */
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Apply transformation on coordinates.
+ *
+ * parameters:
+ * halo <-> halo associated with coordinates to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * coords --> coordinates on which transformation have to be done.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_coords(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t *coords)
+{
+ cs_int_t i, rank_id, t_id, shift;
+ cs_int_t start_std, start_ext, end_std, end_ext, length;
+
+ cs_real_t matrix[3][4];
+
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ const fvm_periodicity_t *periodicity = cs_glob_mesh->periodicity;
+ const cs_int_t n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ _sync_loc_var_strided(halo, sync_mode, coords, 3);
+
+ /* Compute the new cell centers through periodicity */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+ fvm_periodicity_get_matrix(periodicity, t_id, matrix);
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ /* apply transformation for standard halo */
+
+ for (i = start_std; i < end_std; i++)
+ _apply_vector_transfo(matrix, n_elts+i, n_elts+i, coords);
+
+ /* apply transformation for extended halo */
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++)
+ _apply_vector_transfo(matrix, n_elts+i, n_elts+i, coords);
+
+ } /* End if extended halo */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on transformation */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real scalar between periodic elements.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * rota_mode --> Kind of treatment to do on periodic cells of the halo:
+ * COPY, IGNORE or RESET
+ * var <-> scalar to synchronize
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_scal(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_perio_rota_t rota_mode,
+ cs_real_t var[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ const cs_int_t n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = cs_glob_mesh->periodicity;
+ const cs_int_t have_rotation = cs_glob_mesh->have_rotation_perio;
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ if (rota_mode == CS_PERIO_ROTA_COPY)
+ _sync_loc_var(halo, sync_mode, var);
+
+ else if ( rota_mode == CS_PERIO_ROTA_IGNORE
+ && have_rotation
+ && cs_glob_n_ranks > 1)
+ cs_perio_restore_rotation_halo(halo, sync_mode, var);
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ /* Reset values if mode is CS_PERIO_ROTA_RESET */
+
+ if ( rota_mode == CS_PERIO_ROTA_RESET
+ && perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ for (i = start_std; i < end_std; i++)
+ var[n_elts + i] = 0.;
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+ for (i = start_ext; i < end_ext; i++)
+ var[n_elts + i] = 0.;
+ }
+
+ } /* End of loop on ranks */
+
+ }
+
+ } /* End of loop on transformations */
+}
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real vector between periodic cells.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * rota_mode --> Kind of treatment to do on periodic cells of the halo:
+ * COPY, IGNORE or RESET
+ * var_x <-> component of the vector to update
+ * var_y <-> component of the vector to update
+ * var_z <-> component of the vector to update
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_vect(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_perio_rota_t rota_mode,
+ cs_real_t var_x[],
+ cs_real_t var_y[],
+ cs_real_t var_z[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+ cs_real_t x_in, y_in, z_in;
+
+ cs_real_t matrix[3][4];
+
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ const cs_int_t n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = cs_glob_mesh->periodicity;
+ const cs_int_t have_rotation = cs_glob_mesh->have_rotation_perio;
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ if (rota_mode == CS_PERIO_ROTA_COPY) {
+ _sync_loc_var(halo, sync_mode, var_x);
+ _sync_loc_var(halo, sync_mode, var_y);
+ _sync_loc_var(halo, sync_mode, var_z);
+ }
+ else if ( rota_mode == CS_PERIO_ROTA_IGNORE
+ && have_rotation
+ && cs_glob_n_ranks > 1) {
+ cs_perio_restore_rotation_halo(halo, sync_mode, var_x);
+ cs_perio_restore_rotation_halo(halo, sync_mode, var_y);
+ cs_perio_restore_rotation_halo(halo, sync_mode, var_z);
+ }
+
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ fvm_periodicity_get_matrix(periodicity, t_id, matrix);
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ if (rota_mode == CS_PERIO_ROTA_COPY) {
+
+ for (i = start_std; i < end_std; i++) {
+
+ x_in = var_x[n_elts + i];
+ y_in = var_y[n_elts + i];
+ z_in = var_z[n_elts + i];
+
+ _apply_vector_rotation(matrix,
+ x_in,
+ y_in,
+ z_in,
+ &var_x[n_elts+i],
+ &var_y[n_elts+i],
+ &var_z[n_elts+i]);
+ }
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+
+ x_in = var_x[n_elts + i];
+ y_in = var_y[n_elts + i];
+ z_in = var_z[n_elts + i];
+
+ _apply_vector_rotation(matrix,
+ x_in,
+ y_in,
+ z_in,
+ &var_x[n_elts+i],
+ &var_y[n_elts+i],
+ &var_z[n_elts+i]);
+
+ }
+
+ }
+
+ } /* End if rota_mode == CS_PERIO_ROTA_COPY */
+
+ if (rota_mode == CS_PERIO_ROTA_RESET) {
+
+ for (i = start_std; i < end_std; i++) {
+ var_x[n_elts + i] = 0;
+ var_y[n_elts + i] = 0;
+ var_z[n_elts + i] = 0;
+ }
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+ var_x[n_elts + i] = 0;
+ var_y[n_elts + i] = 0;
+ var_z[n_elts + i] = 0;
+ }
+
+ }
+
+ } /* End if rota_mode == CS_PERIO_ROTA_RESET */
+
+ } /* End of loop on ranks */
+
+ } /* End of the treatment of rotation */
+
+ } /* End of loop on transformations */
+}
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real tensor between periodic cells.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * var11 <-> component of the tensor to update
+ * var12 <-> component of the tensor to update
+ * var13 <-> component of the tensor to update
+ * var21 <-> component of the tensor to update
+ * var22 <-> component of the tensor to update
+ * var23 <-> component of the tensor to update
+ * var31 <-> component of the tensor to update
+ * var32 <-> component of the tensor to update
+ * var33 <-> component of the tensor to update
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_tens(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var11[],
+ cs_real_t var12[],
+ cs_real_t var13[],
+ cs_real_t var21[],
+ cs_real_t var22[],
+ cs_real_t var23[],
+ cs_real_t var31[],
+ cs_real_t var32[],
+ cs_real_t var33[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+ cs_real_t v11, v12, v13, v21, v22, v23, v31, v32, v33;
+
+ cs_real_t matrix[3][4];
+
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ const cs_int_t n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = cs_glob_mesh->periodicity;
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ _sync_loc_var(halo, sync_mode, var11);
+ _sync_loc_var(halo, sync_mode, var12);
+ _sync_loc_var(halo, sync_mode, var13);
+ _sync_loc_var(halo, sync_mode, var21);
+ _sync_loc_var(halo, sync_mode, var22);
+ _sync_loc_var(halo, sync_mode, var23);
+ _sync_loc_var(halo, sync_mode, var31);
+ _sync_loc_var(halo, sync_mode, var32);
+ _sync_loc_var(halo, sync_mode, var33);
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ fvm_periodicity_get_matrix(periodicity, t_id, matrix);
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ for (i = start_std; i < end_std; i++) {
+
+ v11 = var11[n_elts + i];
+ v12 = var12[n_elts + i];
+ v13 = var13[n_elts + i];
+ v21 = var21[n_elts + i];
+ v22 = var22[n_elts + i];
+ v23 = var23[n_elts + i];
+ v31 = var31[n_elts + i];
+ v32 = var32[n_elts + i];
+ v33 = var33[n_elts + i];
+
+ _apply_tensor_rotation(matrix,
+ v11, v12, v13, v21, v22, v23,
+ v31, v32, v33,
+ &var11[n_elts + i], &var12[n_elts + i],
+ &var13[n_elts + i], &var21[n_elts + i],
+ &var22[n_elts + i], &var23[n_elts + i],
+ &var31[n_elts + i], &var32[n_elts + i],
+ &var33[n_elts + i]);
+
+ }
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+
+ v11 = var11[n_elts + i];
+ v12 = var12[n_elts + i];
+ v13 = var13[n_elts + i];
+ v21 = var21[n_elts + i];
+ v22 = var22[n_elts + i];
+ v23 = var23[n_elts + i];
+ v31 = var31[n_elts + i];
+ v32 = var32[n_elts + i];
+ v33 = var33[n_elts + i];
+
+ _apply_tensor_rotation(matrix,
+ v11, v12, v13, v21, v22, v23,
+ v31, v32, v33,
+ &var11[n_elts + i], &var12[n_elts + i],
+ &var13[n_elts + i], &var21[n_elts + i],
+ &var22[n_elts + i], &var23[n_elts + i],
+ &var31[n_elts + i], &var32[n_elts + i],
+ &var33[n_elts + i]);
+
+ }
+
+ } /* End of the treatment of rotation */
+
+ } /* End if halo is extended */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on transformations for the local rank */
+}
+
+/*----------------------------------------------------------------------------
+ * Synchronize values for a real diagonal tensor between periodic cells.
+ *
+ * We only know the diagonal of the tensor.
+ *
+ * parameters:
+ * halo <-> halo associated with variable to synchronize
+ * sync_mode --> kind of halo treatment (standard or extended)
+ * var11 <-> component of the tensor to update
+ * var22 <-> component of the tensor to update
+ * var33 <-> component of the tensor to update
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_sync_var_diag(const cs_halo_t *halo,
+ cs_halo_type_t sync_mode,
+ cs_real_t var11[],
+ cs_real_t var22[],
+ cs_real_t var33[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+ cs_real_t v11, v22, v33;
+ cs_real_t matrix[3][4];
+
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ const cs_int_t n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = cs_glob_mesh->periodicity;
+
+ if (sync_mode == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ _sync_loc_var(halo, sync_mode, var11);
+ _sync_loc_var(halo, sync_mode, var22);
+ _sync_loc_var(halo, sync_mode, var33);
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ fvm_periodicity_get_matrix(periodicity, t_id, matrix);
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ }
+
+ for (i = start_std; i < end_std; i++) {
+
+ v11 = var11[n_elts + i];
+ v22 = var22[n_elts + i];
+ v33 = var33[n_elts + i];
+
+ _apply_tensor_rotation(matrix, v11, 0, 0,
+ 0, v22, 0, 0, 0, v33,
+ &var11[n_elts + i], NULL, NULL,
+ NULL, &var22[n_elts + i], NULL,
+ NULL, NULL, &var33[n_elts + i]);
+
+ }
+
+ if (sync_mode == CS_HALO_EXTENDED) {
+
+ for (i = start_ext; i < end_ext; i++) {
+
+ v11 = var11[n_elts + i];
+ v22 = var22[n_elts + i];
+ v33 = var33[n_elts + i];
+
+ _apply_tensor_rotation(matrix, v11, 0, 0,
+ 0, v22, 0, 0, 0, v33,
+ &var11[n_elts + i], NULL, NULL,
+ NULL, &var22[n_elts + i], NULL,
+ NULL, NULL, &var33[n_elts + i]);
+
+ }
+
+ } /* End if halo is extended */
+
+ } /* End of loop on ranks */
+
+ } /* End of the treatment of rotation */
+
+ } /* End of loop on transformations */
+}
+
+/*----------------------------------------------------------------------------
+ * Update global halo backup buffer size so as to be usable with a given halo.
+ *
+ * This function should be called at the end of any halo creation,
+ * so that buffer sizes are increased if necessary.
+ *
+ * parameters:
+ * halo --> pointer to cs_mesh_halo_t structure.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_perio_update_buffer(const cs_halo_t *halo)
+{
+ cs_int_t rank_id, shift, t_id;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ size_t save_count = 0;
+
+ const int n_transforms = halo->n_transforms;
+ const fvm_periodicity_t *periodicity = mesh->periodicity;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ /* Loop on transforms */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+ save_count += halo->perio_lst[shift + 4*rank_id + 1];
+ save_count += halo->perio_lst[shift + 4*rank_id + 3];
+ }
+
+ }
+
+ }
+
+ if (save_count > _cs_glob_perio_halo_backup_size) {
+ _cs_glob_perio_halo_backup_size = save_count;
+ BFT_REALLOC(_cs_glob_perio_halo_backup,
+ _cs_glob_perio_halo_backup_size * 3,
+ cs_real_t);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Update free global halo backup buffer.
+ *---------------------------------------------------------------------------*/
+
+void
+cs_perio_free_buffer(void)
+{
+ if (_cs_glob_perio_halo_backup != NULL)
+ BFT_FREE(_cs_glob_perio_halo_backup);
+}
+
+/*----------------------------------------------------------------------------
+ * Save rotation terms of a halo to an internal buffer.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * op_type --> kind of halo treatment (standard or extended)
+ * var --> variable whose halo rotation terms are to be saved
+ * (size: halo->n_local_elts + halo->n_elts[opt_type])
+ *
+ * returns:
+ * local number of values saved or restored.
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_perio_save_rotation_halo(const cs_halo_t *halo,
+ cs_halo_type_t op_type,
+ const cs_real_t var[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ size_t save_count = 0;
+ cs_real_t *save_buffer = _cs_glob_perio_halo_backup
+ + ( _cs_glob_perio_halo_backup_id
+ * _cs_glob_perio_halo_backup_size);
+
+ const int n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = mesh->periodicity;
+
+ if (op_type == CS_HALO_N_TYPES)
+ return 0;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ _cs_glob_perio_last_backup[_cs_glob_perio_halo_backup_id] = var;
+ _cs_glob_perio_halo_backup_id = (_cs_glob_perio_halo_backup_id + 1) % 3;
+
+ /* Loop on transforms */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = n_elts + halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++)
+ save_buffer[save_count++] = var[i];
+
+ if (op_type == CS_HALO_EXTENDED) {
+
+ start_ext = n_elts + halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++)
+ save_buffer[save_count++] = var[i];
+
+ }
+
+ }
+
+ } /* End if perio_type >= FVM_PERIODICITY_ROTATION) */
+
+ }
+
+ return save_count;
+}
+
+/*----------------------------------------------------------------------------
+ * Restore rotation terms of a halo from an internal buffer.
+ *
+ * parameters:
+ * halo --> pointer to halo structure
+ * op_type --> kind of halo treatment (standard or extended)
+ * var <-> variable whose halo rotation terms are to be restored
+ *
+ * returns:
+ * local number of values saved or restored.
+ *----------------------------------------------------------------------------*/
+
+size_t
+cs_perio_restore_rotation_halo(const cs_halo_t *halo,
+ cs_halo_type_t op_type,
+ cs_real_t var[])
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ fvm_periodicity_type_t perio_type = FVM_PERIODICITY_NULL;
+
+ size_t restore_count = 0;
+
+ const cs_real_t *save_buffer = NULL;
+ const int n_transforms = halo->n_transforms;
+ const cs_int_t n_elts = halo->n_local_elts;
+ const fvm_periodicity_t *periodicity = mesh->periodicity;
+
+ if (op_type == CS_HALO_N_TYPES)
+ return 0;
+
+ assert(halo != NULL);
+
+ _test_halo_compatibility(halo);
+
+ for (i = 0; i < 3; i++) {
+ if (_cs_glob_perio_last_backup[i] == var) {
+ save_buffer = _cs_glob_perio_halo_backup
+ + i*_cs_glob_perio_halo_backup_size;
+ break;
+ }
+ }
+
+ if (i >= 3)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Attempt to restore halo rotation elements on the\n"
+ "variable defined with the adress %p, whereas the last\n"
+ "variables of which the halo has been backed up are defined\n"
+ "with [%p, %p, %p]."),
+ var, _cs_glob_perio_last_backup[0],
+ _cs_glob_perio_last_backup[1], _cs_glob_perio_last_backup[2]);
+
+ /* Loop on transforms */
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ perio_type = fvm_periodicity_get_type(periodicity, t_id);
+
+ if (perio_type >= FVM_PERIODICITY_ROTATION) {
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ start_std = n_elts + halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++)
+ var[i] = save_buffer[restore_count++];
+
+ if (op_type == CS_HALO_EXTENDED) {
+
+ start_ext = n_elts + halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++)
+ var[i] = save_buffer[restore_count++];
+
+ }
+
+ }
+
+ } /* End if perio_type >= FVM_PERIODICITY_ROTATION) */
+
+ }
+
+ return restore_count;
+}
+
+/*----------------------------------------------------------------------------
+ * Define parameters for building an interface set structure on the main mesh.
+ *
+ * parameters:
+ * p_n_periodic_lists <-> pointer to the number of periodic lists (may
+ * be local)
+ * p_periodic_num <-> pointer to the periodicity number (1 to n)
+ * associated with each periodic list (primary
+ * periodicities only)
+ * p_n_periodic_couples <-> pointer to the number of periodic couples
+ * p_periodic_couples <-> pointer to the periodic couple list
+ *----------------------------------------------------------------------------*/
+
+void
+cs_perio_define_couples(int *p_n_periodic_lists,
+ int *p_periodic_num[],
+ fvm_lnum_t *p_n_periodic_couples[],
+ fvm_gnum_t **p_periodic_couples[])
+{
+ cs_int_t i, j, k, n_elts;
+ cs_int_t face_rank, perio_id, rank_id, fac_id, fac_num;
+ cs_int_t shift_key, shift_key_couple, rshift, sshift;
+
+ cs_int_t n_max_face_vertices = 0, n_face_vertices = 0;
+ cs_int_t *send_count = NULL, *recv_count = NULL;
+ cs_int_t *send_shift = NULL, *recv_shift = NULL;
+ cs_int_t *send_rank_count = NULL, *recv_rank_count = NULL;
+ cs_int_t *send_rank_shift = NULL, *recv_rank_shift = NULL;
+ cs_int_t *perio_couple_count = NULL, *perio_couple_shift = NULL;
+ fvm_gnum_t *send_buffer = NULL, *recv_buffer = NULL;
+ fvm_gnum_t *f1_vertices = NULL, *f2_vertices = NULL;
+
+ int *periodic_num = NULL;
+ fvm_lnum_t *n_periodic_couples = NULL;
+ fvm_gnum_t **periodic_couples = NULL;
+
+ const cs_int_t n_ranks = cs_glob_mesh->n_domains;
+ const cs_int_t n_perio = cs_glob_mesh->n_init_perio;
+ const cs_int_t n_keys = n_ranks * n_perio;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+ const cs_int_t *per_face_idx = cs_glob_mesh_builder->per_face_idx;
+ const cs_int_t *per_face_lst = cs_glob_mesh_builder->per_face_lst;
+ const cs_int_t *per_rank_lst = cs_glob_mesh_builder->per_rank_lst;
+ const cs_int_t *face_vtx_idx = cs_glob_mesh->i_face_vtx_idx;
+ const cs_int_t *face_vtx_lst = cs_glob_mesh->i_face_vtx_lst;
+ const fvm_gnum_t *g_vtx_num = cs_glob_mesh->global_vtx_num;
+
+ /* Allocate and initialize buffers */
+
+ BFT_MALLOC(send_count, n_keys, cs_int_t);
+ BFT_MALLOC(recv_count, n_keys, cs_int_t);
+ BFT_MALLOC(perio_couple_count, n_keys, cs_int_t);
+ BFT_MALLOC(send_shift, n_keys + 1, cs_int_t);
+ BFT_MALLOC(recv_shift, n_keys + 1, cs_int_t);
+ BFT_MALLOC(perio_couple_shift, n_keys + 1, cs_int_t);
+
+ for (i = 0; i < n_keys; i++) {
+ send_count[i] = 0;
+ recv_count[i] = 0;
+ send_shift[i] = 0;
+ recv_shift[i] = 0;
+ perio_couple_count[i] = 0;
+ perio_couple_shift[i] = 0;
+ }
+
+ send_shift[n_keys] = 0;
+ recv_shift[n_keys] = 0;
+ perio_couple_shift[n_keys] = 0;
+
+ /* First step: count number of elements to send */
+
+ for (perio_id = 0; perio_id < n_perio; perio_id++) {
+
+ /*
+ The buffer per_face_lst is composed by pairs of face.
+ The first element is the local number of the local face. The sign of the
+ face indicates the sign of the periodicty.
+ The second element is the local number of the distant face.
+ The buffer per_rank_lst owns for each distant face the rank id of the
+ distant rank associated to the face.
+ */
+
+ for (i = per_face_idx[perio_id]; i < per_face_idx[perio_id + 1]; i++) {
+
+ fac_num = per_face_lst[2*i];
+ fac_id = CS_ABS(fac_num) - 1;
+ n_face_vertices = face_vtx_idx[fac_id+1] - face_vtx_idx[fac_id];
+ n_max_face_vertices = CS_MAX(n_max_face_vertices, n_face_vertices);
+
+ assert(fac_num != 0);
+
+ if (n_ranks > 1)
+ face_rank = per_rank_lst[i] - 1;
+ else
+ face_rank = 0;
+
+ shift_key = n_perio*face_rank + perio_id;
+
+ if (local_rank == face_rank)
+ send_count[shift_key] += n_face_vertices;
+
+ else
+ if (fac_num < 0)
+ send_count[shift_key] += n_face_vertices;
+
+ } /* End of loop on couples */
+
+ } /* End of loop on periodicities */
+
+ /* Exchange number of elements to exchange */
+
+#if defined(HAVE_MPI)
+ if (n_ranks > 1)
+ MPI_Alltoall(send_count, n_perio, CS_MPI_INT,
+ recv_count, n_perio, CS_MPI_INT, cs_glob_mpi_comm);
+#endif
+
+ if (n_ranks == 1)
+ for (i = 0; i < n_keys; i++)
+ recv_count[i] = send_count[i];
+
+ /* Build perio_couple_count from recv_count */
+
+ for (rank_id = 0; rank_id < n_ranks; rank_id++)
+ for (perio_id = 0; perio_id < n_perio; perio_id++)
+ perio_couple_count[n_ranks*perio_id+rank_id]
+ = recv_count[n_perio*rank_id+perio_id];
+
+ /* Define index */
+
+ for (i = 0; i < n_keys; i++) {
+
+ recv_shift[i+1] = recv_shift[i] + recv_count[i];
+ send_shift[i+1] = send_shift[i] + send_count[i];
+ perio_couple_shift[i+1] = perio_couple_shift[i] + perio_couple_count[i];
+
+ }
+
+ assert(perio_couple_shift[n_keys] == recv_shift[n_keys]);
+
+ /* Allocate and initialize buffers for building periodic interface set */
+
+ BFT_MALLOC(periodic_num, n_perio, int);
+ BFT_MALLOC(n_periodic_couples, n_perio, fvm_lnum_t);
+ BFT_MALLOC(periodic_couples, n_perio, fvm_gnum_t *);
+
+ for (perio_id = 0; perio_id < n_perio; perio_id++) {
+
+ periodic_num[perio_id] = perio_id+1;
+ n_periodic_couples[perio_id] = 0;
+ periodic_couples[perio_id] = NULL;
+
+ for (rank_id = 0; rank_id < n_ranks; rank_id++)
+ n_periodic_couples[perio_id] +=
+ perio_couple_count[n_ranks*perio_id + rank_id];
+
+ BFT_MALLOC(periodic_couples[perio_id],
+ 2*n_periodic_couples[perio_id],
+ fvm_gnum_t);
+
+ } /* End of loop on periodicities */
+
+ /* Build send buffer and the first part of the periodic couples
+ in global numbering */
+
+ BFT_MALLOC(send_buffer, send_shift[n_keys], fvm_gnum_t);
+ BFT_MALLOC(recv_buffer, recv_shift[n_keys], fvm_gnum_t);
+ BFT_MALLOC(f1_vertices, n_max_face_vertices, fvm_gnum_t);
+ BFT_MALLOC(f2_vertices, n_max_face_vertices, fvm_gnum_t);
+
+ for (i = 0; i < n_keys; i++) {
+ send_count[i] = 0;
+ perio_couple_count[i] = 0;
+ }
+
+ /* Second step: Fill send_buffer and first part of periodic_couples */
+
+ for (perio_id = 0; perio_id < n_perio; perio_id++) {
+
+ fvm_gnum_t *_periodic_couples = periodic_couples[perio_id];
+
+ for (i = per_face_idx[perio_id]; i < per_face_idx[perio_id+1]; i++) {
+
+ fac_num = per_face_lst[2*i];
+ fac_id = CS_ABS(fac_num) - 1;
+ n_face_vertices = face_vtx_idx[fac_id+1] - face_vtx_idx[fac_id];
+
+ if (n_ranks > 1)
+ face_rank = per_rank_lst[i] - 1;
+ else
+ face_rank = 0;
+
+ shift_key = n_perio*face_rank + perio_id;
+ shift_key_couple = n_ranks*perio_id + face_rank;
+
+ sshift = send_count[shift_key] + send_shift[shift_key];
+ rshift = perio_couple_count[shift_key_couple]
+ + perio_couple_shift[shift_key_couple]
+ - perio_couple_shift[n_ranks*perio_id];
+
+ /* Define f1 */
+
+ for (k= 0, j = face_vtx_idx[fac_id]-1;
+ j < face_vtx_idx[fac_id+1]-1; j++, k++) {
+ if (g_vtx_num != NULL)
+ f1_vertices[k] = (fvm_gnum_t)g_vtx_num[face_vtx_lst[j]-1];
+ else
+ f1_vertices[k] = (fvm_gnum_t)face_vtx_lst[j];
+ }
+
+ if (local_rank == face_rank) {
+
+ /* Define f2 */
+
+ fac_id = CS_ABS(per_face_lst[2*i+1]) - 1;
+
+ for (k= 0, j = face_vtx_idx[fac_id]-1;
+ j < face_vtx_idx[fac_id+1]-1; j++, k++) {
+ if (g_vtx_num != NULL)
+ f2_vertices[k] = (fvm_gnum_t)g_vtx_num[face_vtx_lst[j]-1];
+ else
+ f2_vertices[k] = (fvm_gnum_t)face_vtx_lst[j];
+ }
+
+ /* Fill buffers */
+
+ if (fac_num < 0) { /* Send f1 and copy f2 in periodic_couples */
+
+ for (k = 0; k < n_face_vertices; k++)
+ send_buffer[sshift + k] = f1_vertices[k];
+
+ for (k = 0; k < n_face_vertices; k++)
+ _periodic_couples[2*(rshift + k)] = f2_vertices[k];
+
+ }
+ else { /* Send f2 and copy f1 in periodic couples */
+
+ for (k = 0; k < n_face_vertices; k++)
+ send_buffer[sshift + k] = f2_vertices[k];
+
+ for (k = 0; k < n_face_vertices; k++)
+ _periodic_couples[2*(rshift + k)] = f1_vertices[k];
+
+ }
+
+ send_count[shift_key] += n_face_vertices;
+ perio_couple_count[shift_key_couple] += n_face_vertices;
+
+ }
+ else { /* local_rank != face_rank */
+
+ if (fac_num < 0) { /* Fill send_buffer with f1 */
+
+ for (k = 0; k < n_face_vertices; k++)
+ send_buffer[sshift + k] = f1_vertices[k];
+
+ send_count[shift_key] += n_face_vertices;
+
+ }
+ else { /* Fill _periodic_couples with f1 */
+
+ for (k = 0; k < n_face_vertices; k++)
+ _periodic_couples[2*(rshift + k)] = f1_vertices[k];
+
+ perio_couple_count[shift_key_couple] += n_face_vertices;
+
+ }
+
+ } /* Face_rank != local_rank */
+
+ } /* End of loop on couples */
+
+ } /* End of loop on periodicity */
+
+ /* Exchange buffers */
+
+ if (n_ranks > 1) {
+
+ /* count and shift on ranks for MPI_Alltoallv */
+
+ BFT_MALLOC(send_rank_count, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_rank_count, n_ranks, cs_int_t);
+ BFT_MALLOC(send_rank_shift, n_ranks, cs_int_t);
+ BFT_MALLOC(recv_rank_shift, n_ranks, cs_int_t);
+
+ for (i = 0; i < n_ranks; i++) {
+
+ send_rank_count[i] = 0;
+ recv_rank_count[i] = 0;
+
+ for (perio_id = 0; perio_id < n_perio; perio_id++) {
+
+ send_rank_count[i] += send_count[n_perio*i + perio_id];
+ recv_rank_count[i] += recv_count[n_perio*i + perio_id];
+
+ } /* End of loop on periodicities */
+
+ } /* End of loop on ranks */
+
+ send_rank_shift[0] = 0;
+ recv_rank_shift[0] = 0;
+
+ for (i = 0; i < n_ranks - 1; i++) {
+
+ send_rank_shift[i+1] = send_rank_shift[i] + send_rank_count[i];
+ recv_rank_shift[i+1] = recv_rank_shift[i] + recv_rank_count[i];
+
+ } /* End of loop on ranks */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* DEBUG */
+ for (rank_id = 0; rank_id < n_ranks; rank_id++) {
+ bft_printf("RANK_ID: %d - send_count: %d - send_shift: %d\n",
+ rank_id, send_rank_count[rank_id],
+ send_rank_shift[rank_id]);
+ for (i = 0; i < send_rank_count[rank_id]; i++)
+ bft_printf("\t%5d | %8d | %12u\n",
+ i, i + send_rank_shift[rank_id],
+ send_buffer[i + send_rank_shift[rank_id]]);
+ bft_printf_flush();
+ }
+#endif
+
+#if defined(HAVE_MPI)
+ MPI_Alltoallv(send_buffer, send_rank_count, send_rank_shift, FVM_MPI_GNUM,
+ recv_buffer, recv_rank_count, recv_rank_shift, FVM_MPI_GNUM,
+ cs_glob_mpi_comm);
+#endif
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG) /* DEBUG */
+ for (rank_id = 0; rank_id < n_ranks; rank_id++) {
+
+ bft_printf("RANK_ID: %d - recv_count: %d - recv_shift: %d\n",
+ rank_id, recv_rank_count[rank_id],
+ recv_rank_shift[rank_id]);
+ for (i = 0; i < recv_rank_count[rank_id]; i++)
+ bft_printf("\t%5d | %8d | %12u\n",
+ i, i + recv_rank_shift[rank_id],
+ recv_buffer[i + recv_rank_shift[rank_id]]);
+ bft_printf_flush();
+ }
+#endif
+
+ BFT_FREE(send_rank_count);
+ BFT_FREE(recv_rank_count);
+ BFT_FREE(send_rank_shift);
+ BFT_FREE(recv_rank_shift);
+
+ } /* End if n_ranks > 1 */
+
+ else {
+
+ assert(n_ranks == 1);
+ assert(send_shift[n_keys] == recv_shift[n_keys]);
+
+ for (i = 0; i < send_shift[n_keys]; i++)
+ recv_buffer[i] = send_buffer[i];
+
+ }
+
+ /* Memory management */
+
+ BFT_FREE(send_count);
+ BFT_FREE(send_shift);
+ BFT_FREE(send_buffer);
+ BFT_FREE(f1_vertices);
+ BFT_FREE(f2_vertices);
+
+ /* Finalize periodic couples definition in the global numbering */
+
+ for (perio_id = 0; perio_id < n_perio; perio_id++) {
+
+ fvm_gnum_t *_periodic_couples = periodic_couples[perio_id];
+
+ for (rank_id = 0; rank_id < n_ranks; rank_id++) {
+
+ shift_key = n_perio*rank_id + perio_id;
+ shift_key_couple = n_ranks*perio_id + rank_id;
+
+ assert(recv_count[shift_key] == perio_couple_count[shift_key_couple]);
+ n_elts = recv_count[shift_key];
+
+ sshift = perio_couple_shift[shift_key_couple]
+ - perio_couple_shift[n_ranks*perio_id];
+ rshift = recv_shift[shift_key];
+
+#if 0
+ bft_printf("\nPERIO: %d - RANK: %d - N_ELTS: %d\n",
+ perio_id, rank_id, n_elts);
+ bft_printf("shift_key: %d, shift_key_couple: %d\n",
+ shift_key, shift_key_couple);
+ bft_printf("SSHIFT: %d - RSHIFT: %d\n", sshift, rshift);
+ bft_printf_flush();
+#endif
+
+ for (j = 0; j < n_elts; j++)
+ _periodic_couples[2*sshift + 2*j+1] = recv_buffer[rshift + j];
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on periodicities */
+
+ BFT_FREE(recv_count);
+ BFT_FREE(recv_shift);
+ BFT_FREE(recv_buffer);
+ BFT_FREE(perio_couple_count);
+ BFT_FREE(perio_couple_shift);
+
+ /* Values to return. Assign pointers */
+
+ *p_n_periodic_lists = n_perio;
+ *p_periodic_num = periodic_num;
+ *p_n_periodic_couples = n_periodic_couples;
+ *p_periodic_couples = periodic_couples;
+
+#if 0
+ for (i = 0; i < n_perio; i++) {
+ cs_int_t j;
+ bft_printf("\n\n Periodicity number: %d\n", periodic_num[i]);
+ bft_printf(" Number of couples : %d\n", n_periodic_couples[i]);
+ for (j = 0; j < n_periodic_couples[i]; j++)
+ bft_printf("%12d --> %12d\n",
+ periodic_couples[i][2*j], periodic_couples[i][2*j + 1]);
+ }
+#endif
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_post.c b/src/base/cs_post.c
new file mode 100644
index 0000000..bf64170
--- /dev/null
+++ b/src/base/cs_post.c
@@ -0,0 +1,3577 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the post-processing
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_config.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_writer.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_mesh_connect.h"
+#include "cs_prototypes.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local types and structures
+ *============================================================================*/
+
+/* Mesh location type */
+/*--------------------*/
+
+typedef enum {
+
+ CS_POST_LOCATION_CELL, /* Values located at cells */
+ CS_POST_LOCATION_I_FACE, /* Values located at interior faces */
+ CS_POST_LOCATION_B_FACE, /* Values located at boundary faces */
+ CS_POST_LOCATION_VERTEX /* Values located at vertices */
+
+} cs_post_location_t;
+
+/* Writer structure */
+/*------------------*/
+
+/* This object is based on a choice of a case, directory, and format,
+ as well as a flag for associated meshe's time dependency, and the default
+ output frequency for associated variables. */
+
+typedef struct {
+
+ int id; /* Identifier (< 0 for "reservable" writer,
+ * > 0 for user writer */
+ int frequency; /* Default output frequency */
+ cs_bool_t write_displ; /* Write displacement field if true */
+
+ int active; /* 0 if no output at current time step,
+ 1 in case of output */
+
+ fvm_writer_t *writer; /* Associated FVM writer */
+
+} cs_post_writer_t;
+
+/* Post-processing mesh structure */
+/*--------------------------------*/
+
+/* This object manages the link between an exportable mesh and
+ associated writers. */
+
+typedef struct {
+
+ int id; /* Identifier (< 0 for "reservable"
+ mesh, > 0 for user mesh */
+
+ int ent_flag[3]; /* Presence of cells (ent_flag[0],
+ interior faces (ent_flag[1]),
+ or boundary faces (ent_flag[2])
+ on one processor at least */
+
+ int cat_id; /* Optional category id for
+ as regards variables output
+ (-1 as base volume mesh, -2 as
+ base boundary mesh, identical
+ to id by default) */
+
+ int alias; /* If > -1, index in array of
+ post-processing meshes of the
+ first mesh sharing the same
+ exportable mesh */
+
+ int n_writers; /* Number of associated writers */
+ int *writer_id; /* Array of associated writer ids */
+ int nt_last; /* Time step number for the last
+ output (-1 before first output) */
+
+ cs_int_t n_i_faces; /* N. associated interior faces */
+ cs_int_t n_b_faces; /* N. associated boundary faces */
+
+ const fvm_nodal_t *exp_mesh; /* Associated exportable mesh */
+ fvm_nodal_t *_exp_mesh; /* Associated exportble mesh,
+ if owner */
+
+ fvm_writer_time_dep_t mod_flag_min; /* Minimum mesh time dependency */
+ fvm_writer_time_dep_t mod_flag_max; /* Maximum mesh time dependency */
+
+} cs_post_mesh_t;
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Backup of initial vertex coordinates */
+
+static cs_bool_t _cs_post_deformable = false;
+static cs_real_t *_cs_post_ini_vtx_coo = NULL;
+
+/* Flag to indicate output of domain number in parallel mode */
+
+static cs_bool_t _cs_post_domain = true;
+
+/* Array of exportable meshes associated with post-processing */
+/* (meshes -1 and -2 reserved, so free ids start at -2)*/
+
+static int _cs_post_min_mesh_id = -2;
+static int _cs_post_n_meshes = 0;
+static int _cs_post_n_meshes_max = 0;
+static cs_post_mesh_t *_cs_post_meshes = NULL;
+
+/* Array of writers for post-processing; */
+/* writers -1 (default) and -2 (show errors) are reserved */
+
+static int _cs_post_min_writer_id = -2;
+static int _cs_post_n_writers = 0;
+static int _cs_post_n_writers_max = 0;
+static cs_post_writer_t *_cs_post_writers = NULL;
+
+/* Array of registered variable output functions and instances */
+
+static int _cs_post_nbr_var_tp = 0;
+static int _cs_post_nbr_var_tp_max = 0;
+
+static cs_post_time_dep_var_t **_cs_post_f_var_tp = NULL;
+static int *_cs_post_i_var_tp = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Convert cs_post_type_t datatype to fvm_datatype_t.
+ *
+ * parameters:
+ * type_cs <-- Code_Saturne data type
+ *
+ * returns
+ * corresponding FVM datatype
+ *----------------------------------------------------------------------------*/
+
+static fvm_datatype_t
+_cs_post_cnv_datatype(cs_post_type_t type_cs)
+{
+ fvm_datatype_t type_fvm = FVM_DATATYPE_NULL;
+
+ switch(type_cs) {
+
+ case CS_POST_TYPE_cs_int_t:
+ if (sizeof(cs_int_t) == 4)
+ type_fvm = FVM_INT32;
+ else if (sizeof(cs_int_t) == 8)
+ type_fvm = FVM_INT64;
+ break;
+
+ case CS_POST_TYPE_cs_real_t:
+ if (sizeof(cs_real_t) == sizeof(double))
+ type_fvm = FVM_DOUBLE;
+ else if (sizeof(cs_real_t) == sizeof(float))
+ type_fvm = FVM_FLOAT;
+ break;
+
+ case CS_POST_TYPE_int:
+ if (sizeof(int) == 4)
+ type_fvm = FVM_INT32;
+ else if (sizeof(int) == 8)
+ type_fvm = FVM_INT64;
+ break;
+
+ case CS_POST_TYPE_float:
+ type_fvm = FVM_FLOAT;
+ break;
+
+ case CS_POST_TYPE_double:
+ type_fvm = FVM_DOUBLE;
+ break;
+
+ default:
+ assert(0);
+ }
+
+ return type_fvm;
+}
+
+/*----------------------------------------------------------------------------
+ * Search for position in the array of writers of a writer with a given id.
+ *
+ * parameters:
+ * writer_id <-- id of writer
+ *
+ * returns:
+ * position in the array of writers
+ *----------------------------------------------------------------------------*/
+
+static int
+_cs_post_writer_id(const int writer_id)
+{
+ cs_int_t id;
+
+ cs_post_writer_t *writer = NULL;
+
+ /* Search for requested writer */
+
+ for (id = 0; id < _cs_post_n_writers; id++) {
+ writer = _cs_post_writers + id;
+ if (writer->id == writer_id)
+ break;
+ }
+ if (id >= _cs_post_n_writers)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The requested post-processing writer number\n"
+ "%d is not defined.\n"), (int)(writer_id));
+
+ return id;
+}
+
+/*----------------------------------------------------------------------------
+ * Search for position in the array of meshes of a mesh with a given id.
+ *
+ * parameters:
+ * mesh_id <-- id of mesh
+ *
+ * returns:
+ * position in the array of meshes
+ *----------------------------------------------------------------------------*/
+
+static int
+_cs_post_mesh_id(int mesh_id)
+{
+ int id;
+ cs_post_mesh_t *post_mesh = NULL;
+
+ /* Search for requested mesh */
+
+ for (id = 0; id < _cs_post_n_meshes; id++) {
+ post_mesh = _cs_post_meshes + id;
+ if (post_mesh->id == mesh_id)
+ break;
+ }
+ if (id >= _cs_post_n_meshes)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The requested post-processing mesh number\n"
+ "%d is not defined.\n"), (int)mesh_id);
+
+ return id;
+}
+
+/*----------------------------------------------------------------------------
+ * Add a post-processing mesh, do basic initialization, and return a pointer
+ * to the associated structure
+ *
+ * parameters:
+ * mesh_id <-- requested mesh id
+ *
+ * returns:
+ * pointer to associated structure
+ *----------------------------------------------------------------------------*/
+
+static cs_post_mesh_t *
+_cs_post_add_mesh(int mesh_id)
+{
+ /* local variables */
+
+ int i, j;
+
+ cs_post_mesh_t *post_mesh = NULL;
+
+ /* Check that the requested mesh is available */
+
+ if (mesh_id == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The requested post-processing mesh number\n"
+ "must be < 0 (reserved) or > 0 (user).\n"));
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+ if ((_cs_post_meshes + i)->id == mesh_id)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The requested post-processing mesh number\n"
+ "(%d) has already been assigned.\n"), (int)mesh_id);
+ }
+
+ /* Resize global array of exportable meshes */
+
+ if (_cs_post_n_meshes == _cs_post_n_meshes_max) {
+
+ if (_cs_post_n_meshes_max == 0)
+ _cs_post_n_meshes_max = 8;
+ else
+ _cs_post_n_meshes_max *= 2;
+
+ BFT_REALLOC(_cs_post_meshes,
+ _cs_post_n_meshes_max,
+ cs_post_mesh_t);
+
+ }
+
+ _cs_post_n_meshes += 1;
+
+ if (mesh_id < _cs_post_min_mesh_id)
+ _cs_post_min_mesh_id = mesh_id;
+
+ /* Assign newly created mesh to the structure */
+
+ post_mesh = _cs_post_meshes + _cs_post_n_meshes - 1;
+
+ post_mesh->id = mesh_id;
+ post_mesh->cat_id = mesh_id;
+ post_mesh->alias = -1;
+
+ post_mesh->n_writers = 0;
+ post_mesh->writer_id = NULL;
+
+ post_mesh->nt_last = -1;
+
+ for (j = 0; j < 3; j++)
+ post_mesh->ent_flag[j] = 0;
+
+ post_mesh->n_i_faces = 0;
+ post_mesh->n_b_faces = 0;
+
+ post_mesh->exp_mesh = NULL;
+ post_mesh->_exp_mesh = NULL;
+
+ /* Minimum and maximum time dependency flags initially inverted,
+ will be recalculated after mesh - writer associations */
+
+ post_mesh->mod_flag_min = FVM_WRITER_TRANSIENT_CONNECT;
+ post_mesh->mod_flag_max = FVM_WRITER_FIXED_MESH;
+
+ return post_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Create a post-processing mesh; lists of cells or faces to extract are
+ * sorted upon exit, whether they were sorted upon calling or not.
+ *
+ * The list of associated cells is only necessary if the number of cells
+ * to extract is strictly greater than 0 and less than the number of cells
+ * of the computational mesh.
+ *
+ * Lists of faces are ignored if the number of extracted cells is nonzero;
+ * otherwise, if the number of boundary faces to extract is equal to the
+ * number of boundary faces in the computational mesh, and the number of
+ * interior faces to extract is zero, than we extrac by default the boundary
+ * mesh, and the list of associated boundary faces is thus not necessary.
+ *
+ * parameters:
+ * post_mesh <-> pointer to partially initialized post-processing mesh
+ * mesh_name <-- associated mesh name
+ * n_cells <-- number of associated cells
+ * n_i_faces <-- number of associated interior faces
+ * n_b_faces <-- number of associated boundary faces
+ * cell_list <-> list of associated cells
+ * i_face_list <-> list of associated interior faces
+ * b_face_list <-> list of associated boundary faces
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_post_define_mesh(cs_post_mesh_t *post_mesh,
+ const char *mesh_name,
+ cs_int_t n_cells,
+ cs_int_t n_i_faces,
+ cs_int_t n_b_faces,
+ cs_int_t cell_list[],
+ cs_int_t i_face_list[],
+ cs_int_t b_face_list[])
+{
+ /* local variables */
+
+ int i;
+ int glob_flag[5];
+
+ int loc_flag[5] = {1, 1, 1, 0, 0}; /* Flags 0 to 2 "inverted" compared
+ to others so as to use a single
+ call to
+ MPI_Allreduce(..., MPI_MIN, ...) */
+
+ fvm_nodal_t *exp_mesh = NULL;
+ cs_bool_t maj_ent_flag = false;
+
+ /* Flags:
+ 0: 0 if cells present, 1 if none,
+ 1: 0 if interior faces present, 1 if none,
+ 2: 0 if boundary faces present, 1 if none,
+ 3: 1 if all cells were selected,
+ 4: 1 if all boundary faces and no interior faces selected */
+
+ if (n_cells > 0)
+ loc_flag[0] = 0;
+ else {
+ if (n_i_faces > 0)
+ loc_flag[1] = 0;
+ if (n_b_faces > 0)
+ loc_flag[2] = 0;
+ }
+
+ if (n_cells >= cs_glob_mesh->n_cells)
+ loc_flag[3] = 1;
+ else
+ loc_flag[3] = 0;
+
+ if ( n_b_faces >= cs_glob_mesh->n_b_faces
+ && n_i_faces == 0)
+ loc_flag[4] = 1;
+ else
+ loc_flag[4] = 0;
+
+ for (i = 0; i < 5; i++)
+ glob_flag[i] = loc_flag[i];
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Allreduce (loc_flag, glob_flag, 5, MPI_INT, MPI_MIN,
+ cs_glob_mpi_comm);
+#endif
+
+ /* Create associated structure */
+
+ if (glob_flag[0] == 0) {
+
+ if (glob_flag[3] == 1)
+ exp_mesh = cs_mesh_connect_cells_to_nodal(cs_glob_mesh,
+ mesh_name,
+ cs_glob_mesh->n_cells,
+ NULL);
+ else
+ exp_mesh = cs_mesh_connect_cells_to_nodal(cs_glob_mesh,
+ mesh_name,
+ n_cells,
+ cell_list);
+
+ }
+ else {
+
+ if (glob_flag[4] == 1)
+ exp_mesh = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ mesh_name,
+ 0,
+ cs_glob_mesh->n_b_faces,
+ NULL,
+ NULL);
+ else
+ exp_mesh = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ mesh_name,
+ n_i_faces,
+ n_b_faces,
+ i_face_list,
+ b_face_list);
+
+ }
+
+ /* Global indicators of mesh entity type presence;
+ updated only if the mesh is not totally empty (for time-depending
+ meshes, empty at certain times, we want to know the last type
+ of entity used in USMPST) */
+
+ for (i = 0; i < 3; i++) {
+ if (glob_flag[i] == 0)
+ maj_ent_flag = true;
+ }
+
+ if (maj_ent_flag == true) {
+ for (i = 0; i < 3; i++) {
+ if (glob_flag[i] == 0) /* Inverted glob_flag 0 to 2 logic */
+ post_mesh->ent_flag[i] = 1; /* (c.f. remark above) */
+ else
+ post_mesh->ent_flag[i] = 0;
+ }
+ }
+
+ /* Local dimensions */
+
+ post_mesh->n_i_faces = n_i_faces;
+ post_mesh->n_b_faces = n_b_faces;
+
+ /* Link to newly created mesh */
+
+ post_mesh->exp_mesh = exp_mesh;
+ post_mesh->_exp_mesh = exp_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Update mesh time dependency flags in case of an alias based on the
+ * associated writer properties:
+ *
+ * A mesh's definition may not be modified if the minimum time dependency
+ * flag is too low (i.e. if one of the associated writers does not allow
+ * changing a mesh's topology).
+ *
+ * Vertex coordinates and connectivity can be freed from memory if the
+ * maximum time dependency flag is low enough (i.e. if none of the associated
+ * writers allows modification of the mesh, and thus its future output).
+ *
+ * parameters:
+ * mesh_id <-- associated mesh (alias) id
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_post_mod_flag_alias(int mesh_id)
+{
+ int i;
+
+ cs_post_mesh_t *post_mesh = NULL;
+ cs_post_mesh_t *ref_mesh = NULL;
+
+ /* Update reference */
+
+ post_mesh = _cs_post_meshes + mesh_id;
+
+ if (post_mesh->alias > -1) {
+
+ ref_mesh = _cs_post_meshes + post_mesh->alias;
+
+ if (post_mesh->mod_flag_min < ref_mesh->mod_flag_min)
+ ref_mesh->mod_flag_min = post_mesh->mod_flag_min;
+
+ if (post_mesh->mod_flag_max < ref_mesh->mod_flag_max)
+ ref_mesh->mod_flag_max = post_mesh->mod_flag_max;
+
+ }
+
+ /* Update alias */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ if (post_mesh->alias > -1) {
+
+ ref_mesh = _cs_post_meshes + post_mesh->alias;
+
+ if (post_mesh->mod_flag_min > ref_mesh->mod_flag_min)
+ post_mesh->mod_flag_min = ref_mesh->mod_flag_min;
+
+ if (post_mesh->mod_flag_max > ref_mesh->mod_flag_max)
+ post_mesh->mod_flag_max = ref_mesh->mod_flag_max;
+ }
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Divide polygons or polyhedra in simpler elements if necessary.
+ *
+ * parameters:
+ * post_mesh <-> pointer to post-processing mesh
+ * writer <-- pointer to associated writer
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_post_divide_poly(cs_post_mesh_t *post_mesh,
+ const cs_post_writer_t *writer)
+{
+ /* Divide polygons or polyhedra into simple elements */
+
+ if (fvm_writer_needs_tesselation(writer->writer,
+ post_mesh->exp_mesh,
+ FVM_CELL_POLY) > 0)
+ fvm_nodal_tesselate(post_mesh->_exp_mesh,
+ FVM_CELL_POLY,
+ NULL);
+
+ if (fvm_writer_needs_tesselation(writer->writer,
+ post_mesh->exp_mesh,
+ FVM_FACE_POLY) > 0)
+ fvm_nodal_tesselate(post_mesh->_exp_mesh,
+ FVM_FACE_POLY,
+ NULL);
+}
+
+/*----------------------------------------------------------------------------
+ * Assemble variable values defined on a mix of interior and boundary
+ * faces (with no indirection) into an array defined on a single faces set.
+ *
+ * The resulting variable is not interlaced.
+ *
+ * parameters:
+ * exp_mesh <-- exportable mesh
+ * n_i_faces <-- number of interior faces
+ * n_b_faces <-- number of boundary faces
+ * var_dim <-- varible dimension
+ * interlace <-- for vector, interlace if 1, no interlace if 0
+ * i_face_vals <-- values at interior faces
+ * b_face_vals <-- values at boundary faces
+ * var_tmp[] --> assembled values
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_post_assmb_var_faces(const fvm_nodal_t *exp_mesh,
+ cs_int_t n_i_faces,
+ cs_int_t n_b_faces,
+ int var_dim,
+ fvm_interlace_t interlace,
+ const cs_real_t i_face_vals[],
+ const cs_real_t b_face_vals[],
+ cs_real_t var_tmp[])
+{
+ cs_int_t i, j, stride_1, stride_2;
+
+ cs_int_t n_elts = n_i_faces + n_b_faces;
+
+ assert(exp_mesh != NULL);
+
+ /* The variable is defined on interior and boundary faces of the
+ post-processing mesh, and has been built using values
+ at the corresponding interior and boundary faces */
+
+ /* Boundary faces contribution */
+
+ if (interlace == FVM_INTERLACE) {
+ stride_1 = var_dim;
+ stride_2 = 1;
+ }
+ else {
+ stride_1 = 1;
+ stride_2 = n_b_faces;
+ }
+
+ for (i = 0; i < n_b_faces; i++) {
+ for (j = 0; j < var_dim; j++)
+ var_tmp[i + j*n_elts] = b_face_vals[i*stride_1 + j*stride_2];
+ }
+
+ /* Interior faces contribution */
+
+ if (interlace == FVM_INTERLACE) {
+ stride_1 = var_dim;
+ stride_2 = 1;
+ }
+ else {
+ stride_1 = 1;
+ stride_2 = n_i_faces;
+ }
+
+ for (i = 0; i < n_i_faces; i++) {
+ for (j = 0; j < var_dim; j++)
+ var_tmp[i + n_b_faces + j*n_elts] = i_face_vals[i*stride_1 + j*stride_2];
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Write parallel domain (rank) number to post-processing mesh
+ *
+ * parameters:
+ * writer <-- FVM writer
+ * exp_mesh <-- exportable mesh
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ *---------------------------------------------------------------------------*/
+
+static void
+_cs_post_write_domain(fvm_writer_t *writer,
+ const fvm_nodal_t *exp_mesh,
+ int nt_cur_abs,
+ double t_cur_abs)
+{
+ int dim_ent;
+ fvm_lnum_t i, n_elts;
+ fvm_datatype_t datatype;
+
+ fvm_lnum_t dec_num_parent[1] = {0};
+ cs_int_t *domain = NULL;
+
+ int _nt_cur_abs = -1;
+ double _t_cur_abs = 0.;
+
+ const cs_int_t *var_ptr[1] = {NULL};
+
+ if (cs_glob_n_ranks < 2 || _cs_post_domain == false)
+ return;
+
+ dim_ent = fvm_nodal_get_max_entity_dim(exp_mesh);
+ n_elts = fvm_nodal_get_n_entities(exp_mesh, dim_ent);
+
+ /* Prepare domain number */
+
+ BFT_MALLOC(domain, n_elts, cs_int_t);
+
+ for (i = 0; i < n_elts; i++)
+ domain[i] = cs_glob_mesh->domain_num;
+
+ /* Prepare post-processing output */
+
+ if (sizeof(cs_int_t) == 4)
+ datatype = FVM_INT32;
+ else if (sizeof(cs_real_t) == 8)
+ datatype = FVM_INT64;
+
+ var_ptr[0] = domain;
+
+ if (fvm_writer_get_time_dep(writer) != FVM_WRITER_FIXED_MESH) {
+ _nt_cur_abs = nt_cur_abs;
+ _t_cur_abs = t_cur_abs;
+ }
+
+ fvm_writer_export_field(writer,
+ exp_mesh,
+ _("parallel domain"),
+ FVM_WRITER_PER_ELEMENT,
+ 1,
+ FVM_INTERLACE,
+ 1,
+ dec_num_parent,
+ datatype,
+ _nt_cur_abs,
+ _t_cur_abs,
+ (const void * *)var_ptr);
+
+ /* Free memory */
+
+ BFT_FREE(domain);
+}
+
+/*----------------------------------------------------------------------------
+ * Output a post-processing mesh using associated writers.
+ *
+ * parameters:
+ * post_mesh <-> pointer to post-processing mesh
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_post_write_mesh(cs_post_mesh_t *post_mesh,
+ int nt_cur_abs,
+ double t_cur_abs)
+{
+ int j;
+ cs_bool_t write_mesh;
+ fvm_writer_time_dep_t dep_temps;
+
+ cs_post_writer_t *writer = NULL;
+
+ /* Loop on writers */
+
+ for (j = 0; j < post_mesh->n_writers; j++) {
+
+ writer = _cs_post_writers + post_mesh->writer_id[j];
+
+ dep_temps = fvm_writer_get_time_dep(writer->writer);
+
+ write_mesh = false;
+
+ if (dep_temps == FVM_WRITER_FIXED_MESH) {
+ if (post_mesh->nt_last < 0)
+ write_mesh = true;
+ }
+ else {
+ if (post_mesh->nt_last < nt_cur_abs && writer->active == 1)
+ write_mesh = true;
+ }
+
+ if (write_mesh == true) {
+ fvm_writer_set_mesh_time(writer->writer, nt_cur_abs, t_cur_abs);
+ fvm_writer_export_nodal(writer->writer, post_mesh->exp_mesh);
+ }
+
+ if (write_mesh == true && post_mesh->id == -1)
+ _cs_post_write_domain(writer->writer,
+ post_mesh->exp_mesh,
+ nt_cur_abs,
+ t_cur_abs);
+
+ }
+
+ if (write_mesh == true)
+ post_mesh->nt_last = nt_cur_abs;
+
+ if ( post_mesh->mod_flag_max == FVM_WRITER_FIXED_MESH
+ && post_mesh->_exp_mesh != NULL)
+ fvm_nodal_reduce(post_mesh->_exp_mesh, 0);
+}
+
+/*----------------------------------------------------------------------------
+ * Transform an array of flags (markers) to a list
+ *
+ * parameters:
+ * list_size <-> size of array, then list
+ * list <-> array of flags, then list
+ *
+ * returns:
+ * size of list
+ *----------------------------------------------------------------------------*/
+
+static cs_int_t
+_cs_post_marker_to_list(cs_int_t list_size,
+ cs_int_t list[])
+{
+ cs_int_t cpt, ind;
+
+ for (cpt = 0, ind = 0; ind < list_size; ind++) {
+ if (list[ind] != 0) {
+ list[ind] = 0;
+ list[cpt++] = ind + 1;
+ }
+ }
+
+ return cpt;
+}
+
+/*----------------------------------------------------------------------------
+ * Loop on post-processing meshes to output variables
+ *
+ * parameters:
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_post_write_displacements(int nt_cur_abs,
+ double t_cur_abs)
+{
+ int i, j;
+ cs_int_t k, nbr_val;
+ fvm_datatype_t datatype;
+
+ fvm_lnum_t dec_num_parent[1] = {0};
+ cs_post_mesh_t *post_mesh = NULL;
+ cs_post_writer_t *writer = NULL;
+ cs_real_t *deplacements = NULL;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+ const cs_real_t *var_ptr[1] = {NULL};
+
+ /* Loop on writers to check if something must be done */
+ /*----------------------------------------------------*/
+
+ if (_cs_post_deformable == false)
+ return;
+
+ for (j = 0; j < _cs_post_n_writers; j++) {
+ writer = _cs_post_writers + j;
+ if (writer->active == 1 && writer->write_displ == true)
+ break;
+ }
+ if (j == _cs_post_n_writers)
+ return;
+
+ /* Compute main deformation field */
+ /*--------------------------------*/
+
+ nbr_val = mesh->n_vertices * 3;
+
+ BFT_MALLOC(deplacements, nbr_val, cs_real_t);
+
+ assert(mesh->n_vertices == 0 || _cs_post_ini_vtx_coo != NULL);
+
+ for (k = 0; k < nbr_val; k++)
+ deplacements[k] = mesh->vtx_coord[k] - _cs_post_ini_vtx_coo[k];
+
+ /* Prepare post-processing */
+ /*-------------------------*/
+
+ if (sizeof(cs_real_t) == sizeof(double))
+ datatype = FVM_DOUBLE;
+ else if (sizeof(cs_real_t) == sizeof(float))
+ datatype = FVM_FLOAT;
+
+ var_ptr[0] = deplacements;
+
+ /* Loop on meshes to output displacements */
+ /*----------------------------------------*/
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ for (j = 0; j < post_mesh->n_writers; j++) {
+
+ writer = _cs_post_writers + post_mesh->writer_id[j];
+
+ if (writer->active == 1 && writer->write_displ == true) {
+
+ fvm_writer_export_field(writer->writer,
+ post_mesh->exp_mesh,
+ _("displacement"),
+ FVM_WRITER_PER_NODE,
+ 3,
+ FVM_INTERLACE,
+ 1,
+ dec_num_parent,
+ datatype,
+ (int)nt_cur_abs,
+ (double)t_cur_abs,
+ (const void * *)var_ptr);
+
+ }
+
+ }
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(deplacements);
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a writer based on Fortran data; this object is based on a choice
+ * of a case, directory, and format, as well as indicator for associated
+ * meshe's time dependency, and the default output frequency for associated
+ * variables.
+ *
+ * Fortran Interface: use PSTCWR (see cs_post_util.F)
+ *
+ * SUBROUTINE PSTCW1 (NUMGEP, NOMCAS, NOMREP, NOMFMT, OPTFMT,
+ * *****************
+ * LNMCAS, LNMFMT, LNMREP, LOPFMT,
+ * INDMOD, NTCHR)
+ *
+ * INTEGER NUMWRI : --> : Number of writer to create (< 0 for
+ * : : standard writer, > 0 for user writer)
+ * CHARACTER NOMCAS : --> : Name of associated case
+ * CHARACTER NOMREP : --> : Name of associated directory
+ * INTEGER NOMFMT : --> : Name of associated format
+ * INTEGER OPTFMT : --> : Additional format options
+ * INTEGER LNMCAS : --> : Case name length
+ * INTEGER LNMREP : --> : Directory name length
+ * INTEGER LNMFMT : --> : Format name length
+ * INTEGER LOPFMT : --> : Format options string length
+ * INTEGER INDMOD : --> : 0 if fixed, 1 if deformable,
+ * : : 2 if topology changes
+ * INTEGER NTCHR : --> : Default output frequency
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstcw1, PSTCW1)
+(
+ const cs_int_t *numwri,
+ const char *nomcas,
+ const char *nomrep,
+ const char *nomfmt,
+ const char *optfmt,
+ const cs_int_t *lnmcas,
+ const cs_int_t *lnmrep,
+ const cs_int_t *lnmfmt,
+ const cs_int_t *lopfmt,
+ const cs_int_t *indmod,
+ const cs_int_t *ntchr
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+)
+{
+ /* local variables */
+
+ char *case_name;
+ char *dir_name;
+ char *nom_format;
+ char *opt_format;
+
+ /* Copy Fortran strings to C strings */
+
+ case_name = cs_base_string_f_to_c_create(nomcas, *lnmcas);
+ dir_name = cs_base_string_f_to_c_create(nomrep, *lnmrep);
+ nom_format = cs_base_string_f_to_c_create(nomfmt, *lnmfmt);
+ opt_format = cs_base_string_f_to_c_create(optfmt, *lopfmt);
+
+ /* Main processing */
+
+ cs_post_add_writer(*numwri,
+ case_name,
+ dir_name,
+ nom_format,
+ opt_format,
+ *indmod,
+ *ntchr);
+
+ /* Free temporary C strings */
+
+ cs_base_string_f_to_c_free(&case_name);
+ cs_base_string_f_to_c_free(&dir_name);
+ cs_base_string_f_to_c_free(&nom_format);
+ cs_base_string_f_to_c_free(&opt_format);
+}
+
+
+/*----------------------------------------------------------------------------
+ * Create a post-processing mesh; lists of cells or faces to extract are
+ * sorted upon exit, whether they were sorted upon calling or not.
+ *
+ * The list of associated cells is only necessary if the number of cells
+ * to extract is strictly greater than 0 and less than the number of cells
+ * of the computational mesh.
+ *
+ * Lists of faces are ignored if the number of extracted cells is nonzero;
+ * otherwise, if the number of boundary faces to extract is equal to the
+ * number of boundary faces in the computational mesh, and the number of
+ * interior faces to extract is zero, than we extrac by default the boundary
+ * mesh, and the list of associated boundary faces is thus not necessary.
+ *
+ * Fortran interface: use PSTCMA (see cs_post_util.F)
+ *
+ * SUBROUTINE PSTCM1 (NUMMAI, NOMMAI, LNMMAI,
+ * *****************
+ * NBRCEL, NBRFAC, NBRFBR, LSTCEL, LSTFAC, LSTFBR)
+ *
+ * INTEGER NUMMAI : <-- : Number of output mesh to create
+ * : : (< 0 for standard mesh,
+ * : : > 0 for user mesh)
+ * CHARACTER NOMMAI : <-- : Name of associated output mesh
+ * INTEGER LNMMAI : <-- : Mesh name length
+ * INTEGER NBRCEL : <-- : Number of associated cells
+ * INTEGER NBRFAC : <-- : Number of associated interior faces
+ * INTEGER NBRFBR : <-- : Nulber of associated boundary faces
+ * INTEGER LSTCEL : <-- : List of associated cells
+ * INTEGER LSTFAC : <-- : List of associated interior faces
+ * INTEGER LSTFBR : <-- : List of associated boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstcm1, PSTCM1)
+(
+ const cs_int_t *nummai,
+ const char *nommai,
+ const cs_int_t *lnmmai,
+ const cs_int_t *nbrcel,
+ const cs_int_t *nbrfac,
+ const cs_int_t *nbrfbr,
+ cs_int_t lstcel[],
+ cs_int_t lstfac[],
+ cs_int_t lstfbr[]
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+)
+{
+ /* local variables */
+
+ char *mesh_name = NULL;
+
+ /* Copy Fortran strings to C strings */
+
+ mesh_name = cs_base_string_f_to_c_create(nommai, *lnmmai);
+
+ /* Main processing */
+
+ cs_post_add_mesh(*nummai,
+ mesh_name,
+ *nbrcel,
+ *nbrfac,
+ *nbrfbr,
+ lstcel,
+ lstfac,
+ lstfbr);
+
+ /* Free temporary C strings */
+
+ cs_base_string_f_to_c_free(&mesh_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Create a mesh based upon the extraction of edges from an existing mesh.
+ *
+ * The newly created edges have no link to their parent elements, so
+ * no variable referencing parent elements may be output to this mesh,
+ * whose main use is to visualize "true" face edges when polygonal faces
+ * are subdivided by the writer. In this way, even highly non-convex
+ * faces may be visualized correctly if their edges are overlaid on
+ * the surface mesh with subdivided polygons.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTEDG (NUMMAI, NUMREF)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the edges mesh to create
+ * INTEGER NUMREF : <-- : Number of the existing mesh
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstedg, PSTEDG)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numref
+)
+{
+ cs_post_add_mesh_edges(*nummai, *numref);
+}
+
+/*----------------------------------------------------------------------------
+ * Assign a category to a post-processing mesh.
+ *
+ * By default, each mesh is assigned a category id identical to its id.
+ * The automatic variables output associated with the main volume and
+ * boundary meshes will also be applied to meshes of the same categories
+ * (i.e. -1 and -2 respectively, whether meshes -1 and -2 are actually
+ * defined or not), so setting a user meshe's category to one of these
+ * values will automatically provide the same automatic variable output to
+ * the user mesh.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTCAT (NUMMAI, NUMWRI)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the alias to create
+ * INTEGER NUMCAT : <-- : Number of the assigned category
+ * (-1: as volume, -2: as boundary)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstcat, PSTCAT)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numcat
+)
+{
+ cs_post_set_mesh_category(*nummai, *numcat);
+}
+
+/*----------------------------------------------------------------------------
+ * Create an alias to a post-processing mesh.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTALM (NUMMAI, NUMREF)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the alias to create
+ * INTEGER NUMREF : <-- : Number of the associated output mesh
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstalm, PSTALM)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numref
+)
+{
+ cs_post_alias_mesh(*nummai, *numref);
+}
+
+/*----------------------------------------------------------------------------
+ * Associate a writer to a post-processing mesh.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTASS (NUMMAI, NUMWRI)
+ * *****************
+ *
+ * INTEGER NUMMAI : <-- : Number of the associated output mesh
+ * INTEGER NUMWRI : <-- : Number of the writer to associate
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstass, PSTASS)
+(
+ const cs_int_t *nummai,
+ const cs_int_t *numwri
+)
+{
+ cs_post_associate(*nummai, *numwri);
+}
+
+/*----------------------------------------------------------------------------
+ * Update the "active" or "inactive" flag for writers based on the current
+ * time step and their default output frequency.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTNTC (NTCABS)
+ * *****************
+ *
+ * INTEGER NTCABS : <-- : Current time step number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstntc, PSTNTC)
+(
+ const cs_int_t *ntcabs
+)
+{
+ cs_post_activate_if_default(*ntcabs);
+}
+
+/*----------------------------------------------------------------------------
+ * Force the "active" or "inactive" flag for a specific writer or for all
+ * writers for the current time step.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTNTC (NUMWRI, INDACT)
+ * *****************
+ *
+ * INTEGER NUMWRI : <-- : Writer number, or 0 for all writers
+ * INTEGER INDACT : <-- : 0 to deactivate, 1 to activate
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstact, PSTACT)
+(
+ const cs_int_t *numwri,
+ const cs_int_t *indact
+)
+{
+ cs_post_activate_writer(*numwri, *indact);
+}
+
+/*----------------------------------------------------------------------------
+ * Output post-processing meshes using associated writers.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTEMA (NTCABS, TTCABS)
+ * *****************
+ *
+ * INTEGER NTCABS : <-- : Current time step number
+ * DOUBLE PRECISION TTCABS : <-- : Current physical time
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstema, PSTEMA)
+(
+ const cs_int_t *ntcabs,
+ const cs_real_t *ttcabs
+)
+{
+ cs_post_write_meshes(*ntcabs, *ttcabs);
+}
+
+/*----------------------------------------------------------------------------
+ * Loop on post-processing meshes to output variables
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PSTVAR (IDBIA0, IDBRA0,
+ * *****************
+ * NDIM, NTCABS, NCELET, NCEL, NFAC, NFABOR,
+ * NFML, NPRFML, NNOD, LNDFAC, LNDFBR, NCELBR,
+ * NVAR, NSCAL, NPHAS, NVLSTA, NVISBR,
+ * NIDEVE, NRDEVE, NITUSE, NRTUSE,
+ * IFACEL, IFABOR, IFMFBR, IFMCEL, IPRFML,
+ * IPNFAC, NODFAC, IPNFBR, NODFBR,
+ * IDEVEL, ITUSER, IA,
+ * TTCABS, XYZCEN, SURFAC, SURFBO, CDGFAC, CDGFBO,
+ * XYZNOD, VOLUME,
+ * DT, RTPA, RTP, PROPCE, PROPFA, PROPFB,
+ * COEFA, COEFB,
+ * STATCE, STATIV, STATFB,
+ * RDEVEL, RTUSER, RA)
+ *
+ * INTEGER IDBIA0 : <-- : Number of first free position in IA
+ * INTEGER IDBRA0 : <-- : Number of first free position in RA
+ * INTEGER NDIM : <-- : Spatial dimension
+ * INTEGER NTCABS : --> : Current time step number
+ * INTEGER NCELET : <-- : Number of extended (real + ghost) cells
+ * INTEGER NFAC : <-- : Number of interior faces
+ * INTEGER NFABOR : <-- : Number of boundary faces
+ * INTEGER NFML : <-- : Number of families (group classes)
+ * INTEGER NPRFML : <-- : Number of family properties
+ * INTEGER NNOD : <-- : Number of vertices
+ * INTEGER LNDFAC : <-- : Size of nodfac
+ * INTEGER LNDFBR : <-- : Size of nodfbr
+ * INTEGER NCELBR : <-- : Number of cells on boundary
+ * INTEGER NVAR : <-- : Number of variables
+ * INTEGER NSCAL : <-- : Number of scalars
+ * INTEGER NPHAS : <-- : Number of phases
+ * INTEGER NVLSTA : <-- : Number of statistical variables (lagr)
+ * INTEGER NVISBR : <-- : Number of boundary stat. variables (lagr)
+ * INTEGER NIDEVE : <-- : Size of IDEVEL integer array
+ * INTEGER NRDEVE : <-- : Size of RDEVEL floating-point array
+ * INTEGER NITUSE : <-- : Size of ITUSER integer array
+ * INTEGER NRTUSE : <-- : Size of RTUSER floating-point array
+ * INTEGER IFACEL : <-- : Interior faces -> cells connectivity
+ * INTEGER IFABOR : <-- : Boundary faces -> cell connectivity
+ * INTEGER IFMFBR : <-- : Boundary face families
+ * INTEGER IFMCEL : <-- : Cell families
+ * INTEGER IPRFML : <-- : List of family properties
+ * INTEGER IPNFAC : <-- : Interior faces -> vertices connect. idx.
+ * INTEGER NODFAC : <-- : Interior faces -> vertices connectivity
+ * INTEGER IPNFBR : <-- : Boundary faces -> vertices connect. idx.
+ * INTEGER NODFBR : <-- : Boundary faces -> vertices connectivity
+ * INTEGER IDEVEL : <-- : IDEVEL integer array
+ * INTEGER ITUSER : <-- : ITUSER integer array
+ * INTEGER IA : <-- : IA integer array
+ * DOUBLE PRECISION TTCABS : <-- : Current physical time
+ * DOUBLE PRECISION XYZCEN : <-- : Points associated with cell centers
+ * DOUBLE PRECISION SURFAC : <-- : Interior face surface vectors
+ * DOUBLE PRECISION SURFBO : <-- : Boundary face surface vectors
+ * DOUBLE PRECISION CDGFAC : <-- : Interior face centers
+ * DOUBLE PRECISION CDGFBO : <-- : Boundary face vectors
+ * DOUBLE PRECISION XYZNOD : <-- : Vertex coordinates (optional)
+ * DOUBLE PRECISION VOLUME : <-- : Cell volumes
+ * DOUBLE PRECISION DT : <-- : Local time step
+ * DOUBLE PRECISION RTPA : <-- : Cell variables at previous time step
+ * DOUBLE PRECISION RTP : <-- : Cell variables
+ * DOUBLE PRECISION PROPCE : <-- : Cell physical properties
+ * DOUBLE PRECISION PROPFA : <-- : Interior face physical properties
+ * DOUBLE PRECISION PROPFB : <-- : Boundary face physical properties
+ * DOUBLE PRECISION COEFA : <-- : Boundary conditions array
+ * DOUBLE PRECISION COEFB : <-- : Boundary conditions array
+ * DOUBLE PRECISION STATCE : <-- : Cell statistics (Lagrangian)
+ * DOUBLE PRECISION STATIV : <-- : Cell variance statistics (Lagrangian)
+ * DOUBLE PRECISION STATFB : <-- : Boundary face statistics (Lagrangian)
+ * DOUBLE PRECISION RDEVEL : <-- : RDEVEL floating-point array
+ * DOUBLE PRECISION RTUSER : <-- : RTUSER floating-point array
+ * DOUBLE PRECISION RA : <-- : RA floating-point array
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstvar, PSTVAR)
+(
+ const cs_int_t *idbia0,
+ const cs_int_t *idbra0,
+ const cs_int_t *ndim,
+ const cs_int_t *ntcabs,
+ const cs_int_t *ncelet,
+ const cs_int_t *ncel,
+ const cs_int_t *nfac,
+ const cs_int_t *nfabor,
+ const cs_int_t *nfml,
+ const cs_int_t *nprfml,
+ const cs_int_t *nnod,
+ const cs_int_t *lndfac,
+ const cs_int_t *lndfbr,
+ const cs_int_t *ncelbr,
+ const cs_int_t *nvar,
+ const cs_int_t *nscal,
+ const cs_int_t *nphas,
+ const cs_int_t *nvlsta,
+ const cs_int_t *nvisbr,
+ const cs_int_t *nideve,
+ const cs_int_t *nrdeve,
+ const cs_int_t *nituse,
+ const cs_int_t *nrtuse,
+ const cs_int_t ifacel[],
+ const cs_int_t ifabor[],
+ const cs_int_t ifmfbr[],
+ const cs_int_t ifmcel[],
+ const cs_int_t iprfml[],
+ const cs_int_t ipnfac[],
+ const cs_int_t nodfac[],
+ const cs_int_t ipnfbr[],
+ const cs_int_t nodfbr[],
+ const cs_int_t idevel[],
+ cs_int_t ituser[],
+ cs_int_t ia[],
+ const cs_real_t *ttcabs,
+ const cs_real_t xyzcen[],
+ const cs_real_t surfac[],
+ const cs_real_t surfbo[],
+ const cs_real_t cdgfac[],
+ const cs_real_t cdgfbo[],
+ const cs_real_t xyznod[],
+ const cs_real_t volume[],
+ const cs_real_t dt[],
+ const cs_real_t rtpa[],
+ const cs_real_t rtp[],
+ const cs_real_t propce[],
+ const cs_real_t propfa[],
+ const cs_real_t propfb[],
+ const cs_real_t coefa[],
+ const cs_real_t coefb[],
+ const cs_real_t statce[],
+ const cs_real_t stativ[],
+ const cs_real_t statfb[],
+ const cs_real_t rdevel[],
+ cs_real_t rtuser[],
+ cs_real_t ra[]
+)
+{
+ /* local variables */
+
+ int i, j, k;
+ int dim_ent;
+ cs_int_t itypps[3];
+ cs_int_t ind_cel, ind_fac, dec_num_fbr;
+ cs_int_t n_elts, n_elts_max;
+ cs_int_t nummai, numtyp, imodif;
+
+ cs_bool_t active;
+
+ cs_post_mesh_t *post_mesh;
+ cs_post_writer_t *writer;
+
+ cs_int_t n_cells, n_i_faces, n_b_faces;
+ cs_int_t *cell_list, *i_face_list, *b_face_list;
+
+ cs_int_t *num_ent_parent = NULL;
+ cs_real_t *var_trav = NULL;
+ cs_real_t *cel_vals = NULL;
+ cs_real_t *i_face_vals = NULL;
+ cs_real_t *b_face_vals = NULL;
+
+ /* Loop on writers to check if something must be done */
+ /*----------------------------------------------------*/
+
+ for (j = 0; j < _cs_post_n_writers; j++) {
+ writer = _cs_post_writers + j;
+ if (writer->active == 1)
+ break;
+ }
+ if (j == _cs_post_n_writers)
+ return;
+
+ /* Possible modification of post-processing meshes */
+ /*-------------------------------------------------*/
+
+ n_elts_max = 0;
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ active = false;
+
+ for (j = 0; j < post_mesh->n_writers; j++) {
+ writer = _cs_post_writers + post_mesh->writer_id[j];
+ if (writer->active == 1)
+ active = true;
+ }
+
+ /* Modifiable user mesh, not an alias, active at this time step */
+
+ if ( active == true
+ && post_mesh->alias < 0
+ && post_mesh->id > 0
+ && post_mesh->mod_flag_min == FVM_WRITER_TRANSIENT_CONNECT) {
+
+ const fvm_nodal_t * exp_mesh = post_mesh->exp_mesh;
+
+ dim_ent = fvm_nodal_get_max_entity_dim(exp_mesh);
+ n_elts = fvm_nodal_get_n_entities(exp_mesh, dim_ent);
+
+ if (n_elts > n_elts_max) {
+ n_elts_max = n_elts;
+ BFT_REALLOC(num_ent_parent, n_elts_max, cs_int_t);
+ }
+
+ nummai = post_mesh->id;
+ numtyp = post_mesh->cat_id;
+
+ /* Get corresponding entity lists */
+
+ fvm_nodal_get_parent_num(exp_mesh, dim_ent, num_ent_parent);
+
+ for (k = 0; k < 3; k++)
+ itypps[k] = post_mesh->ent_flag[k];
+
+ /* Oversize lists, as the user may fill an arbitrary part of those */
+
+ BFT_MALLOC(cell_list, cs_glob_mesh->n_cells, cs_int_t);
+ BFT_MALLOC(i_face_list, cs_glob_mesh->n_i_faces, cs_int_t);
+ BFT_MALLOC(b_face_list, cs_glob_mesh->n_b_faces, cs_int_t);
+
+ n_cells = 0;
+ n_i_faces = 0;
+ n_b_faces = 0;
+
+ /* Set lists to zero */
+
+ if (dim_ent == 3)
+ for (ind_cel = 0; ind_cel < cs_glob_mesh->n_cells; ind_cel++)
+ cell_list[ind_cel] = 0;
+ else if (dim_ent == 2) {
+ for (ind_fac = 0; ind_fac < cs_glob_mesh->n_b_faces; ind_fac++)
+ b_face_list[ind_fac] = 0;
+ for (ind_fac = 0; ind_fac < cs_glob_mesh->n_i_faces; ind_fac++)
+ i_face_list[ind_fac] = 0;
+ }
+
+ /* If the elements of the FVM mesh are divided, a same parent number
+ may appear several times; we thus use a marker logic. */
+
+ if (dim_ent == 3) {
+ for (ind_cel = 0; ind_cel < n_elts; ind_cel++)
+ cell_list[num_ent_parent[ind_cel] - 1] = 1;
+ }
+
+ /* For faces, the number of interior "parent" faces known by FVM
+ are shifted by the total number of boundary faces
+ (c.f. construction in cs_mesh_connect...()) */
+
+ else if (dim_ent == 2) {
+ dec_num_fbr = cs_glob_mesh->n_b_faces;
+ for (ind_fac = 0; ind_fac < n_elts; ind_fac++) {
+ if (num_ent_parent[ind_fac] > dec_num_fbr)
+ i_face_list[num_ent_parent[ind_fac] - dec_num_fbr - 1] = 1;
+ else
+ b_face_list[num_ent_parent[ind_fac] - 1] = 1;
+ }
+ }
+
+ /* Transform markers to lists */
+
+ if (dim_ent == 3) {
+ n_cells = _cs_post_marker_to_list(cs_glob_mesh->n_cells,
+ cell_list);
+ }
+ else if (dim_ent == 2) {
+ n_i_faces = _cs_post_marker_to_list(cs_glob_mesh->n_i_faces,
+ i_face_list);
+ n_b_faces = _cs_post_marker_to_list(cs_glob_mesh->n_b_faces,
+ b_face_list);
+ }
+
+ /* User modification of the mesh definition */
+
+ imodif = 0;
+
+ CS_PROCF(usmpst, USMPST) (idbia0, idbra0, &nummai,
+ ndim, ncelet, ncel, nfac, nfabor, nfml, nprfml,
+ nnod, lndfac, lndfbr, ncelbr,
+ nvar, nscal, nphas, nvlsta,
+ &n_cells, &n_i_faces, &n_b_faces,
+ nideve, nrdeve, nituse, nrtuse, &imodif,
+ itypps, ifacel, ifabor, ifmfbr, ifmcel, iprfml,
+ ipnfac, nodfac, ipnfbr, nodfbr,
+ cell_list, i_face_list, b_face_list,
+ idevel, ituser, ia,
+ xyzcen, surfac, surfbo, cdgfac, cdgfbo, xyznod,
+ volume, dt, rtpa, rtp, propce, propfa, propfb,
+ coefa, coefb, statce,
+ cel_vals, i_face_vals, b_face_vals,
+ rdevel, rtuser, ra);
+
+ if (imodif > 0)
+ cs_post_modify_mesh(post_mesh->id,
+ n_cells,
+ n_i_faces,
+ n_b_faces,
+ cell_list,
+ i_face_list,
+ b_face_list);
+
+ BFT_FREE(cell_list);
+ BFT_FREE(i_face_list);
+ BFT_FREE(b_face_list);
+
+ }
+
+ }
+
+ /* We now make sure aliases are synchronized */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ if (post_mesh->alias > -1) {
+
+ const cs_post_mesh_t *ref_mesh;
+
+ ref_mesh = _cs_post_meshes + post_mesh->alias;
+
+ for (j = 0; j < 3; j++)
+ post_mesh->ent_flag[j] = ref_mesh->ent_flag[j];
+
+ post_mesh->n_i_faces = ref_mesh->n_i_faces;
+ post_mesh->n_b_faces = ref_mesh->n_b_faces;
+
+ }
+
+ }
+
+ /* Output of meshes or vertex displacement field if necessary */
+ /*------------------------------------------------------------*/
+
+ cs_post_write_meshes(*ntcabs, *ttcabs);
+
+ if (_cs_post_deformable == true)
+ _cs_post_write_displacements(*ntcabs, *ttcabs);
+
+ /* Output of variables by registered function instances */
+ /*------------------------------------------------------*/
+
+ for (i = 0; i < _cs_post_nbr_var_tp; i++) {
+ _cs_post_f_var_tp[i](_cs_post_i_var_tp[i],
+ *ntcabs,
+ *ttcabs);
+ }
+
+ /* Output of variables associated with post-processing meshes */
+ /*------------------------------------------------------------*/
+
+ /* n_elts_max already initialized before and during the
+ eventual modification of post-processing mesh definitions,
+ and num_ent_parent allocated if n_elts_max > 0 */
+
+ BFT_MALLOC(var_trav, n_elts_max * 3, cs_real_t);
+
+ /* Main loop on post-processing meshes */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ active = false;
+
+ for (j = 0; j < post_mesh->n_writers; j++) {
+ writer = _cs_post_writers + post_mesh->writer_id[j];
+ if (writer->active == 1)
+ active = true;
+ }
+
+ /* If the mesh is active at this time step */
+ /*-----------------------------------------*/
+
+ if (active == true) {
+
+ const fvm_nodal_t * exp_mesh = post_mesh->exp_mesh;
+
+ dim_ent = fvm_nodal_get_max_entity_dim(exp_mesh);
+ n_elts = fvm_nodal_get_n_entities(exp_mesh, dim_ent);
+
+ if (n_elts > n_elts_max) {
+ n_elts_max = n_elts;
+ BFT_REALLOC(var_trav, n_elts_max * 3, cs_real_t);
+ BFT_REALLOC(num_ent_parent, n_elts_max, cs_int_t);
+ }
+
+ nummai = post_mesh->id;
+ numtyp = post_mesh->cat_id;
+
+ /* Get corresponding element lists */
+
+ fvm_nodal_get_parent_num(exp_mesh, dim_ent, num_ent_parent);
+
+ for (k = 0; k < 3; k++)
+ itypps[k] = post_mesh->ent_flag[k];
+
+ /* We can output variables for this time step */
+ /*--------------------------------------------*/
+
+ n_cells = 0;
+ n_i_faces = 0;
+ n_b_faces = 0;
+ cell_list = NULL;
+ i_face_list = NULL;
+ b_face_list = NULL;
+
+ /* Here list sizes are adjusted, and we point to the array filled
+ by fvm_nodal_get_parent_num() if possible. */
+
+ if (dim_ent == 3) {
+ n_cells = n_elts;
+ cell_list = num_ent_parent;
+ }
+
+ /* The numbers of "parent" interior faces known by FVM
+ are shifted by the total number of boundary faces */
+
+ else if (dim_ent == 2 && n_elts > 0) {
+
+ dec_num_fbr = cs_glob_mesh->n_b_faces;
+
+ for (ind_fac = 0; ind_fac < n_elts; ind_fac++) {
+ if (num_ent_parent[ind_fac] > dec_num_fbr)
+ n_i_faces++;
+ else
+ n_b_faces++;
+ }
+
+ /* boundary faces only: parent FVM face numbers unchanged */
+ if (n_i_faces == 0) {
+ b_face_list = num_ent_parent;
+ }
+
+ /* interior faces only: parents FVM face numbers shifted */
+ else if (n_b_faces == 0) {
+ for (ind_fac = 0; ind_fac < n_elts; ind_fac++)
+ num_ent_parent[ind_fac] -= dec_num_fbr;
+ i_face_list = num_ent_parent;
+ }
+
+ /* interior and boundary faces: numbers must be separated */
+
+ else {
+
+ BFT_MALLOC(i_face_list, n_i_faces, cs_int_t);
+ BFT_MALLOC(b_face_list, n_b_faces, cs_int_t);
+
+ n_i_faces = 0, n_b_faces = 0;
+
+ for (ind_fac = 0; ind_fac < n_elts; ind_fac++) {
+ if (num_ent_parent[ind_fac] > dec_num_fbr)
+ i_face_list[n_i_faces++] = num_ent_parent[ind_fac] - dec_num_fbr;
+ else
+ b_face_list[n_b_faces++] = num_ent_parent[ind_fac];
+ }
+
+ }
+
+ /* In all cases, update the number of interior and boundary faces
+ (useful in case of splitting of FVM mesh elements) for functions
+ called by this one */
+
+ post_mesh->n_i_faces = n_i_faces;
+ post_mesh->n_b_faces = n_b_faces;
+
+ }
+
+ /* Pointers to variable assembly arrays, set to NULL if unused
+ (so as to provoke an immediate error in case of incorrect use) */
+
+ cel_vals = var_trav;
+ i_face_vals = cel_vals + (n_cells * 3);
+ b_face_vals = i_face_vals + (n_i_faces * 3);
+
+ if (n_cells == 0)
+ cel_vals = NULL;
+ if (n_i_faces == 0)
+ i_face_vals = NULL;
+ if (n_b_faces == 0)
+ b_face_vals = NULL;
+
+ /* Standard post-processing */
+
+ if (numtyp < 0)
+ CS_PROCF(dvvpst, DVVPST) (idbia0, idbra0, &nummai, &numtyp,
+ ndim, ncelet, ncel, nfac, nfabor, nfml, nprfml,
+ nnod, lndfac, lndfbr, ncelbr,
+ nvar, nscal, nphas, nvlsta, nvisbr,
+ &n_cells, &n_i_faces, &n_b_faces,
+ nideve, nrdeve, nituse, nrtuse,
+ itypps, ifacel, ifabor, ifmfbr, ifmcel, iprfml,
+ ipnfac, nodfac, ipnfbr, nodfbr,
+ cell_list, i_face_list, b_face_list,
+ idevel, ituser, ia,
+ xyzcen, surfac, surfbo, cdgfac, cdgfbo, xyznod,
+ volume, dt, rtpa, rtp, propce, propfa, propfb,
+ coefa, coefb, statce, stativ , statfb ,
+ cel_vals, i_face_vals, b_face_vals,
+ rdevel, rtuser, ra);
+
+ /* Call to user subroutine for additional post-processing */
+
+ CS_PROCF(usvpst, USVPST) (idbia0, idbra0, &nummai,
+ ndim, ncelet, ncel, nfac, nfabor, nfml, nprfml,
+ nnod, lndfac, lndfbr, ncelbr,
+ nvar, nscal, nphas, nvlsta,
+ &n_cells, &n_i_faces, &n_b_faces,
+ nideve, nrdeve, nituse, nrtuse,
+ itypps, ifacel, ifabor, ifmfbr, ifmcel, iprfml,
+ ipnfac, nodfac, ipnfbr, nodfbr,
+ cell_list, i_face_list, b_face_list,
+ idevel, ituser, ia,
+ xyzcen, surfac, surfbo, cdgfac, cdgfbo, xyznod,
+ volume, dt, rtpa, rtp, propce, propfa, propfb,
+ coefa, coefb, statce,
+ cel_vals, i_face_vals, b_face_vals,
+ rdevel, rtuser, ra);
+
+ /* In case of mixed interior and boundary faces, free
+ additional arrays */
+
+ if (i_face_list != NULL && b_face_list != NULL) {
+ BFT_FREE(i_face_list);
+ BFT_FREE(b_face_list);
+ }
+
+ }
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(num_ent_parent);
+ BFT_FREE(var_trav);
+}
+
+/*----------------------------------------------------------------------------
+ * Post-processing output of a variable defined on cells or faces of a mesh
+ * using associated writers.
+ *
+ * Fortran interface; use PSTEVA (see cs_post_util.F)
+ *
+ * SUBROUTINE PSTEV1 (NUMMAI, NOMVAR, LNMVAR, IDIMT, IENTLA, IVARPR,
+ * *****************
+ * NTCABS, TTCABS, VARCEL, VARFAC, VARFBR)
+ *
+ * INTEGER NUMMAI : <-- : Number of associated output mesh
+ * CHARACTER NOMVAR : <-- : Name of associated variable
+ * INTEGER LNMVAR : <-- : Variable name length
+ * INTEGER IDIMT : <-- : 1 for scalar, 3 for vector
+ * INTEGER IENTLA : <-- : If a vector, 1 for interlaced values
+ * : : (x1, y1, z1, x2, y2, ..., yn, zn),
+ * : : 0 otherwise (x1, x2, ...xn, y1, y2, ...)
+ * INTEGER IVARPR : <-- : 1 if variable is defined on "parent"
+ * : : mesh, 2 if defined on output mesh
+ * INTEGER NTCABS : <-- : Current time step number
+ * DOUBLE PRECISION TTCABS : <-- : Current physical time
+ * DOUBLE PRECISION VARCEL(*) : <-- : Cell values
+ * DOUBLE PRECISION VARFAC(*) : <-- : Interior face values
+ * DOUBLE PRECISION VARFBO(*) : <-- : Boundary face values
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pstev1, PSTEV1)
+(
+ const cs_int_t *nummai,
+ const char *nomvar,
+ const cs_int_t *lnmvar,
+ const cs_int_t *idimt,
+ const cs_int_t *ientla,
+ const cs_int_t *ivarpr,
+ const cs_int_t *ntcabs,
+ const cs_real_t *ttcabs,
+ const cs_real_t varcel[],
+ const cs_real_t varfac[],
+ const cs_real_t varfbr[]
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+)
+{
+ cs_bool_t use_parent;
+ cs_bool_t interlace;
+
+ char *var_name = NULL;
+
+ if (*ivarpr == 1)
+ use_parent = true;
+ else if (*ivarpr == 0)
+ use_parent = false;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("The PSTEVA sub-routine argument IVARPR must be\n"
+ "equal to 0 or 1, and not %d.\n"), (int)(*ivarpr));
+
+ if (*ientla == 0)
+ interlace = false;
+ else if (*ientla == 1)
+ interlace = true;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("The PSTEVA sub-routine argument IENTLA must be\n"
+ "equal to 0 or 1, and not %d.\n"), (int)(*ientla));
+
+
+ /* Copy Fortran strings to C strings */
+
+ var_name = cs_base_string_f_to_c_create(nomvar, *lnmvar);
+
+ /* Main processing */
+
+ cs_post_write_var(*nummai,
+ var_name,
+ *idimt,
+ interlace,
+ use_parent,
+ CS_POST_TYPE_cs_real_t,
+ *ntcabs,
+ *ttcabs,
+ varcel,
+ varfac,
+ varfbr);
+
+ /* Free temporary C strings */
+
+ cs_base_string_f_to_c_free(&var_name);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a writer; this objects manages a case's name, directory, and format,
+ * as well as associated meshe's time dependency, and the default output
+ * frequency for associated variables.
+ *
+ * parameters:
+ * writer_id <-- number of writer to create (< 0 reserved, > 0 for user)
+ * case_name <-- associated case name
+ * dir_name <-- associated directory name
+ * fmt_name <-- associated format name
+ * fmt_opts <-- associated format options
+ * mod_flag <-- 0 if fixed, 1 if deformable, 2 if topolygy changes,
+ * +10 add a displacement field
+ * frequency <-- default output frequency
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_writer(int writer_id,
+ const char *case_name,
+ const char *dir_name,
+ const char *fmt_name,
+ const char *fmt_opts,
+ cs_int_t mod_flag,
+ cs_int_t frequency)
+{
+ /* local variables */
+
+ int i;
+
+ cs_post_writer_t *writer = NULL;
+ fvm_writer_time_dep_t dep_temps = FVM_WRITER_FIXED_MESH;
+
+ /* Check that the required mesh is available */
+
+ if (writer_id == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The requested post-processing writer number\n"
+ "must be < 0 (reserved) or > 0 (user).\n"));
+
+ for (i = 0; i < _cs_post_n_writers; i++) {
+ if ((_cs_post_writers + i)->id == writer_id)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The requested post-processing writer number\n"
+ "(%d) has already been assigned.\n"), (int)writer_id);
+ }
+
+ /* Resize global writers array */
+
+ if (_cs_post_n_writers == _cs_post_n_writers_max) {
+
+ if (_cs_post_n_writers_max == 0)
+ _cs_post_n_writers_max = 4;
+ else
+ _cs_post_n_writers_max *= 2;
+
+ BFT_REALLOC(_cs_post_writers,
+ _cs_post_n_writers_max,
+ cs_post_writer_t);
+
+ }
+
+ if (writer_id < _cs_post_min_writer_id)
+ _cs_post_min_writer_id = writer_id;
+
+ _cs_post_n_writers += 1;
+
+ /* Assign newly created writer to the structure */
+
+ writer = _cs_post_writers + _cs_post_n_writers - 1;
+
+ writer->id = writer_id;
+ writer->frequency = frequency;
+ writer->write_displ = false;
+ writer->active = 0;
+
+ if (mod_flag >= 10) {
+ writer->write_displ = true;
+ mod_flag -= 10;
+ }
+
+ if (mod_flag == 1)
+ dep_temps = FVM_WRITER_TRANSIENT_COORDS;
+ else if (mod_flag >= 2)
+ dep_temps = FVM_WRITER_TRANSIENT_CONNECT;
+
+ writer->writer = fvm_writer_init(case_name,
+ dir_name,
+ fmt_name,
+ fmt_opts,
+ dep_temps);
+}
+
+/*----------------------------------------------------------------------------
+ * Create a post-processing mesh; lists of cells or faces to extract are
+ * sorted upon exit, whether they were sorted upon calling or not.
+ *
+ * The list of associated cells is only necessary if the number of cells
+ * to extract is strictly greater than 0 and less than the number of cells
+ * of the computational mesh.
+ *
+ * Lists of faces are ignored if the number of extracted cells is nonzero;
+ * otherwise, if the number of boundary faces to extract is equal to the
+ * number of boundary faces in the computational mesh, and the number of
+ * interior faces to extract is zero, than we extrac by default the boundary
+ * mesh, and the list of associated boundary faces is thus not necessary.
+ *
+ * parameters:
+ * mesh_id <-- number of mesh to create (< 0 reserved, > 0 for user)
+ * mesh_name <-- associated mesh name
+ * n_cells <-- number of associated cells
+ * n_i_faces <-- number of associated interior faces
+ * n_b_faces <-- number of associated boundary faces
+ * cell_list <-- list of associated cells
+ * i_face_list <-- list of associated interior faces
+ * b_face_list <-- list of associated boundary faces
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_mesh(int mesh_id,
+ const char *mesh_name,
+ cs_int_t n_cells,
+ cs_int_t n_i_faces,
+ cs_int_t n_b_faces,
+ cs_int_t cell_list[],
+ cs_int_t i_face_list[],
+ cs_int_t b_face_list[])
+{
+ /* local variables */
+
+ cs_post_mesh_t *post_mesh = NULL;
+
+ /* Add and initialize base structure */
+
+ post_mesh = _cs_post_add_mesh(mesh_id);
+
+ /* Create mesh and assign to structure */
+
+ _cs_post_define_mesh(post_mesh,
+ mesh_name,
+ n_cells,
+ n_i_faces,
+ n_b_faces,
+ cell_list,
+ i_face_list,
+ b_face_list);
+}
+
+/*----------------------------------------------------------------------------
+ * Create a post-processing mesh associated with an existing exportable mesh
+ * representation.
+ *
+ * If the exportable mesh is not intended to be used elsewhere, one can choose
+ * to transfer its property to the post-processing mesh, which will then
+ * manage its lifecycle based on its own requirements.
+ *
+ * If the exportable mesh must still be shared, one must be careful to
+ * maintain consistency between this mesh and the post-processing output.
+ *
+ * The mesh in exportable dimension may be of a lower dimension than
+ * its parent mesh, if it has been projected. In this case, a
+ * dim_shift value of 1 indicates that parent cells are mapped to
+ * exportable faces, and faces to edges, while a dim_shift value of 2
+ * would indicate that parent cells are mapped to edges.
+ * This is important when variables values are exported.
+ *
+ * parameters:
+ * mesh_id <-- number of mesh to create (< 0 reserved, > 0 for user)
+ * exp_mesh <-- mesh in exportable representation (i.e. fvm_nodal_t)
+ * dim_shift <-- nonzero if exp_mesh has been projected
+ * transfer <-- if true, ownership of exp_mesh is transferred to the
+ * post-processing mesh
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_existing_mesh(int mesh_id,
+ fvm_nodal_t *exp_mesh,
+ int dim_shift,
+ cs_bool_t transfer)
+{
+ /* local variables */
+
+ int i;
+ int glob_flag[3];
+ cs_int_t dec_num_fbr, ind_fac;
+
+ int loc_flag[3] = {1, 1, 1}; /* Flags 0 to 2 "inverted" compared
+ to others so as to use a single
+ call to
+ MPI_Allreduce(..., MPI_MIN, ...) */
+
+ int dim_ent = 0;
+ cs_bool_t maj_ent_flag = false;
+ fvm_lnum_t n_elts = 0;
+
+ fvm_lnum_t *num_ent_parent = NULL;
+ cs_post_mesh_t *post_mesh = NULL;
+
+ /* Initialization of base structure */
+
+ post_mesh = _cs_post_add_mesh(mesh_id);
+
+ /* Assign mesh to structure */
+
+ post_mesh->exp_mesh = exp_mesh;
+
+ if (transfer == true)
+ post_mesh->_exp_mesh = exp_mesh;
+
+ /* Compute number of cells and/or faces */
+
+ dim_ent = fvm_nodal_get_max_entity_dim(exp_mesh) + dim_shift;
+ n_elts = fvm_nodal_get_n_entities(exp_mesh, dim_ent);
+
+ if (dim_ent == 3 && n_elts > 0)
+ loc_flag[0] = 0;
+
+ else if (dim_ent == 2 && n_elts > 0) {
+
+ BFT_MALLOC(num_ent_parent, n_elts, cs_int_t);
+
+ fvm_nodal_get_parent_num(exp_mesh, dim_ent, num_ent_parent);
+
+ dec_num_fbr = cs_glob_mesh->n_b_faces;
+ for (ind_fac = 0; ind_fac < n_elts; ind_fac++) {
+ if (num_ent_parent[ind_fac] > dec_num_fbr)
+ post_mesh->n_i_faces += 1;
+ else
+ post_mesh->n_b_faces += 1;
+ }
+
+ BFT_FREE(num_ent_parent);
+
+ if (post_mesh->n_i_faces > 0)
+ loc_flag[1] = 0;
+ else if (post_mesh->n_b_faces > 0)
+ loc_flag[2] = 0;
+
+ }
+
+ for (i = 0; i < 3; i++)
+ glob_flag[i] = loc_flag[i];
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Allreduce (loc_flag, glob_flag, 3, MPI_INT, MPI_MIN,
+ cs_glob_mpi_comm);
+#endif
+
+ /* Global indicators of mesh entity type presence;
+ updated only if the mesh is not totally empty (for time-depending
+ meshes, empty at certain times, we want to know the last type
+ of entity used in USMPST) */
+
+ for (i = 0; i < 3; i++) {
+ if (glob_flag[i] == 0)
+ maj_ent_flag = true;
+ }
+
+ if (maj_ent_flag == true) {
+ for (i = 0; i < 3; i++) {
+ if (glob_flag[i] == 0) /* Inverted glob_flag 0 to 2 logic */
+ post_mesh->ent_flag[i] = 1; /* (c.f. remark above) */
+ else
+ post_mesh->ent_flag[i] = 0;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Assign a category to a post-processing mesh.
+ *
+ * By default, each mesh is assigned a category id identical to its id.
+ * The automatic variables output associated with the main volume and
+ * boundary meshes will also be applied to meshes of the same categories
+ * (i.e. -1 and -2 respectively, whether meshes -1 and -2 are actually
+ * defined or not), so setting a user meshe's category to one of these
+ * values will automatically provide the same automatic variable output to
+ * the user mesh.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * category_id <-- id of mesh category (-1: as volume, -2: as boundary)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_set_mesh_category(int mesh_id,
+ int category_id)
+{
+ /* local variables */
+
+ int _mesh_id;
+ cs_post_mesh_t *post_mesh = NULL;
+
+ /* Get base structure (return if we do not own the mesh) */
+
+ _mesh_id = _cs_post_mesh_id(mesh_id);
+ post_mesh = _cs_post_meshes + _mesh_id;
+
+ /* Set category */
+
+ post_mesh->cat_id = category_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Create an alias to a post-processing mesh.
+ *
+ * An alias allows association of an extra identifier (number) to an
+ * existing post-processing mesh, and thus to associate different writers
+ * than those associated with the existing mesh. For example, this allows
+ * outputting a set of main variables every n1 time steps with one writer,
+ * and outputting a specific set of variables every n2 time time steps to
+ * another post-processing set using another writer, without the overhead
+ * that would be incurred by duplication of the post-processing mesh.
+ *
+ * An alias is thus treated in all points like its associated mesh;
+ * if the definition of either one is modified, that of the other is
+ * modified also.
+ *
+ * It is forbidden to associate an alias to another alias (as there is no
+ * identified use for this, and it would make consistency checking more
+ * difficult), but multiple aliases may be associated with a given mesh.
+ *
+ * parameters:
+ * alias_id <-- number of alias to create (< 0 reserved, > 0 for user)
+ * mesh_id <-- id of associated mesh
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_alias_mesh(int alias_id,
+ int mesh_id)
+{
+ /* local variables */
+
+ int indref, j;
+
+ cs_post_mesh_t *post_mesh = NULL;
+ cs_post_mesh_t *ref_mesh = NULL;
+
+ /* Initial checks */
+
+ indref = _cs_post_mesh_id(mesh_id);
+ ref_mesh = _cs_post_meshes + indref;
+
+ if (ref_mesh->alias > -1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The mesh %d cannot be an alias of mesh %d,\n"
+ "which is itself an alias of mesh %d.\n"),
+ (int)alias_id, (int)mesh_id,
+ (int)((_cs_post_meshes + ref_mesh->alias)->id));
+
+ /* Initialize base structure */
+
+ post_mesh = _cs_post_add_mesh(alias_id);
+
+ /* Update ref_mesh, as the adress of _cs_post_meshes may
+ have been changed by reallocation */
+
+ ref_mesh = _cs_post_meshes + indref;
+
+ /* Links to the reference mesh */
+
+ post_mesh->alias = indref;
+
+ post_mesh->exp_mesh = ref_mesh->exp_mesh;
+
+ post_mesh->mod_flag_min = ref_mesh->mod_flag_min;
+ post_mesh->mod_flag_max = ref_mesh->mod_flag_max;
+
+ for (j = 0; j < 3; j++)
+ post_mesh->ent_flag[j] = ref_mesh->ent_flag[j];
+
+ post_mesh->n_i_faces = ref_mesh->n_i_faces;
+ post_mesh->n_b_faces = ref_mesh->n_b_faces;
+}
+
+/*----------------------------------------------------------------------------
+ * Create a mesh based upon the extraction of edges from an existing mesh.
+ *
+ * The newly created edges have no link to their parent elements, so
+ * no variable referencing parent elements may be output to this mesh,
+ * whose main use is to visualize "true" face edges when polygonal faces
+ * are subdivided by the writer. In this way, even highly non-convex
+ * faces may be visualized correctly if their edges are overlaid on
+ * the surface mesh with subdivided polygons.
+ *
+ * parameters:
+ * edges_id <-- id of edges mesh to create (< 0 reserved, > 0 for user)
+ * base_id <-- id of existing mesh (< 0 reserved, > 0 for user)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_mesh_edges(int edges_id,
+ int base_id)
+{
+ /* local variables */
+
+ char *edges_name = NULL;
+ cs_post_mesh_t *post_edges = NULL;
+ fvm_nodal_t *exp_edges = NULL;
+
+ const cs_post_mesh_t *post_base = _cs_post_meshes +_cs_post_mesh_id(base_id);
+ const fvm_nodal_t *exp_mesh = post_base->exp_mesh;
+ const char *exp_name = fvm_nodal_get_name(exp_mesh);
+
+ /* Add and initialize base structure */
+
+ post_edges = _cs_post_add_mesh(edges_id);
+
+ /* Copy mesh edges to new mesh structure */
+
+ BFT_MALLOC(edges_name, strlen(exp_name) + strlen(_(" edges")) + 1, char);
+
+ strcpy(edges_name, exp_name);
+ strcat(edges_name, _(" edges"));
+
+ exp_edges = fvm_nodal_copy_edges(edges_name, exp_mesh);
+
+ BFT_FREE(edges_name);
+
+ /* Create mesh and assign to structure */
+
+ post_edges->exp_mesh = exp_edges;
+ post_edges->_exp_mesh = exp_edges;
+}
+
+/*----------------------------------------------------------------------------
+ * Check for the existence of a writer of the given id.
+ *
+ * parameters:
+ * writer_id <-- writer id to check
+ *
+ * returns:
+ * true if writer with this id exists, false otherwise
+ *----------------------------------------------------------------------------*/
+
+cs_bool_t
+cs_post_writer_exists(int writer_id)
+{
+ /* local variables */
+
+ int id;
+ cs_post_writer_t *writer = NULL;
+
+ /* Search for requested mesh */
+
+ for (id = 0; id < _cs_post_n_writers; id++) {
+ writer = _cs_post_writers + id;
+ if (writer->id == writer_id)
+ return true;
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------
+ * Check for the existence of a post-processing mesh of the given id.
+ *
+ * parameters:
+ * mesh_id <-- mesh id to check
+ *
+ * returns:
+ * true if mesh with this id exists, false otherwise
+ *----------------------------------------------------------------------------*/
+
+cs_bool_t
+cs_post_mesh_exists(int mesh_id)
+{
+ int id;
+ cs_post_mesh_t *post_mesh = NULL;
+
+ /* Search for requested mesh */
+
+ for (id = 0; id < _cs_post_n_meshes; id++) {
+ post_mesh = _cs_post_meshes + id;
+ if (post_mesh->id == mesh_id)
+ return true;
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------
+ * Modify an existing post-processing mesh.
+ *
+ * The lists of cells or faces are redefined, for example to update an
+ * extracted mesh based in "interesting" zones.
+ *
+ * It is not necessary to use this function if a mesh is simply deformed.
+ *
+ * parameters:
+ * mesh_id <-- id of mesh to modify (< 0 reserved, > 0 for user)
+ * n_cells <-- number of associated cells
+ * n_i_faces <-- number of associated interior faces
+ * n_b_faces <-- number of associated boundary faces
+ * cell_list <-- list of associated cells
+ * i_face_list <-- list of associated interior faces
+ * b_face_list <-- list of associated boundary faces
+ *
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_modify_mesh(int mesh_id,
+ cs_int_t n_cells,
+ cs_int_t n_i_faces,
+ cs_int_t n_b_faces,
+ cs_int_t cell_list[],
+ cs_int_t i_face_list[],
+ cs_int_t b_face_list[])
+{
+ /* local variables */
+
+ int i, _mesh_id;
+ char *mesh_name = NULL;
+ cs_post_mesh_t *post_mesh = NULL;
+ cs_post_writer_t *writer = NULL;
+
+ /* Get base structure (return if we do not own the mesh) */
+
+ _mesh_id = _cs_post_mesh_id(mesh_id);
+ post_mesh = _cs_post_meshes + _mesh_id;
+
+ if (post_mesh->_exp_mesh == NULL)
+ return;
+
+ /* Remplace base structure */
+
+ BFT_MALLOC(mesh_name,
+ strlen(fvm_nodal_get_name(post_mesh->exp_mesh)) + 1,
+ char);
+ strcpy(mesh_name, fvm_nodal_get_name(post_mesh->exp_mesh));
+
+ fvm_nodal_destroy(post_mesh->_exp_mesh);
+ post_mesh->exp_mesh = NULL;
+
+ _cs_post_define_mesh(post_mesh,
+ mesh_name,
+ n_cells,
+ n_i_faces,
+ n_b_faces,
+ cell_list,
+ i_face_list,
+ b_face_list);
+
+ BFT_FREE(mesh_name);
+
+ /* Update possible aliases */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+ if ((_cs_post_meshes + i)->alias == _mesh_id)
+ (_cs_post_meshes + i)->exp_mesh
+ = post_mesh->exp_mesh;
+ }
+
+ /* Divide polygons or polyhedra into simple elements */
+
+ for (i = 0; i < post_mesh->n_writers; i++) {
+
+ writer = _cs_post_writers + post_mesh->writer_id[i];
+ _cs_post_divide_poly(post_mesh, writer);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Return the next "reservable" (i.e. non-user) writer id available.
+ *
+ * Returns:
+ * the smallest negative integer present, -1
+ *----------------------------------------------------------------------------*/
+
+int
+cs_post_get_free_writer_id(void)
+{
+ return (_cs_post_min_writer_id - 1);
+}
+
+/*----------------------------------------------------------------------------
+ * Return the next "reservable" (i.e. non-user) mesh id available.
+ *
+ * Returns:
+ * the smallest negative integer present, -1
+ *----------------------------------------------------------------------------*/
+
+int
+cs_post_get_free_mesh_id(void)
+{
+ return (_cs_post_min_mesh_id - 1);
+}
+
+/*----------------------------------------------------------------------------
+ * Associate a writer with a post-processing mesh.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * writer_id <-- id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_associate(int mesh_id,
+ int writer_id)
+{
+ int i;
+ int _mesh_id, _writer_id;
+ fvm_writer_time_dep_t mod_flag;
+
+ cs_post_mesh_t *post_mesh = NULL;
+ cs_post_writer_t *writer = NULL;
+
+ /* Search for requested mesh and writer */
+
+ _mesh_id = _cs_post_mesh_id(mesh_id);
+ _writer_id = _cs_post_writer_id(writer_id);
+
+ post_mesh = _cs_post_meshes + _mesh_id;
+
+ /* Check that the writer is not already associated */
+
+ for (i = 0; i < post_mesh->n_writers; i++) {
+ if (post_mesh->writer_id[i] == _writer_id)
+ break;
+ }
+
+ /* If the writer is not already associated, associate it */
+
+ if (i >= post_mesh->n_writers) {
+
+ post_mesh->n_writers += 1;
+ BFT_REALLOC(post_mesh->writer_id,
+ post_mesh->n_writers,
+ cs_int_t);
+
+ post_mesh->writer_id[post_mesh->n_writers - 1] = _writer_id;
+ post_mesh->nt_last = - 1;
+
+ /* Update structure */
+
+ writer = _cs_post_writers + _writer_id;
+ mod_flag = fvm_writer_get_time_dep(writer->writer);
+
+ if (mod_flag < post_mesh->mod_flag_min)
+ post_mesh->mod_flag_min = mod_flag;
+ if (mod_flag > post_mesh->mod_flag_max)
+ post_mesh->mod_flag_max = mod_flag;
+
+ _cs_post_mod_flag_alias(_mesh_id);
+
+ /* If we must compute the vertices displacement field, we need
+ to save the initial vertex coordinates */
+
+ if ( _cs_post_deformable == false
+ && _cs_post_ini_vtx_coo == NULL
+ && writer->write_displ == true) {
+
+ cs_mesh_t *maillage = cs_glob_mesh;
+
+ if (maillage->n_vertices > 0) {
+ BFT_MALLOC(_cs_post_ini_vtx_coo,
+ maillage->n_vertices * 3,
+ cs_real_t);
+ memcpy(_cs_post_ini_vtx_coo,
+ maillage->vtx_coord,
+ maillage->n_vertices * 3 * sizeof(cs_real_t));
+ }
+
+ _cs_post_deformable = true;
+
+ }
+
+ /* Divide polygons or polyhedra into simple elements */
+
+ _cs_post_divide_poly(post_mesh, writer);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update "active" or "inactive" flag of writers whose output frequency
+ * is a divisor of the current time step number.
+ *
+ * parameters:
+ * nt_cur_abs <-- current time step number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_activate_if_default(int nt_cur_abs)
+{
+ int i;
+ cs_post_writer_t *writer;
+
+ for (i = 0; i < _cs_post_n_writers; i++) {
+
+ writer = _cs_post_writers + i;
+
+ if (writer->frequency > 0) {
+ if (nt_cur_abs % (writer->frequency) == 0)
+ writer->active = 1;
+ else
+ writer->active = 0;
+ }
+ else
+ writer->active = 0;
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Force the "active" or "inactive" flag for a specific writer or for all
+ * writers for the current time step.
+ *
+ * parameters:
+ * writer_id <-- writer id, or 0 for all writers
+ * activate <-- 0 to deactivate, 1 to activate
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_activate_writer(int writer_id,
+ int activate)
+{
+ int i;
+ cs_post_writer_t *writer;
+
+ if (writer_id != 0) {
+ i = _cs_post_writer_id(writer_id);
+ writer = _cs_post_writers + i;
+ writer->active = (activate > 0) ? 1 : 0;
+ }
+ else {
+ for (i = 0; i < _cs_post_n_writers; i++) {
+ writer = _cs_post_writers + i;
+ writer->active = (activate > 0) ? 1 : 0;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Return a pointer to the FVM library writer associated to a writer_id.
+ *
+ * parameters:
+ * writer_id <-- associated writer id
+ *
+ * Returns:
+ * a pointer to a fvm_writer_t structure
+ *----------------------------------------------------------------------------*/
+
+fvm_writer_t *
+cs_post_get_writer(cs_int_t writer_id)
+{
+ int id;
+ const cs_post_writer_t *writer = NULL;
+
+ id = _cs_post_writer_id(writer_id);
+ writer = _cs_post_writers + id;
+
+ return writer->writer;
+}
+
+/*----------------------------------------------------------------------------
+ * Output post-processing meshes using associated writers.
+ *
+ * parameters:
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_write_meshes(int nt_cur_abs,
+ double t_cur_abs)
+{
+ int i;
+ cs_post_mesh_t *post_mesh;
+
+ /* Loops on meshes and writers */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ _cs_post_write_mesh(post_mesh,
+ nt_cur_abs,
+ t_cur_abs);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Output a variable defined at cells or faces of a post-processing mesh
+ * using associated writers.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * var_name <-- name of variable to output
+ * var_dim <-- 1 for scalar, 3 for vector
+ * interlace <-- if a vector, true for interlaced values, false otherwise
+ * use_parent <-- true if values are defined on "parent" mesh,
+ * false if values are defined on post-processing mesh
+ * var_type <-- variable's data type
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ * cel_vals <-- cell values
+ * i_face_vals <-- interior face values
+ * b_face_vals <-- boundary face values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_write_var(int mesh_id,
+ const char *var_name,
+ cs_int_t var_dim,
+ cs_bool_t interlace,
+ cs_bool_t use_parent,
+ cs_post_type_t var_type,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs,
+ const void *cel_vals,
+ const void *i_face_vals,
+ const void *b_face_vals)
+{
+ cs_int_t i;
+ int _mesh_id;
+
+
+ fvm_interlace_t _interlace;
+ fvm_datatype_t datatype;
+
+ size_t dec_ptr = 0;
+ int nbr_listes_parents = 0;
+ fvm_lnum_t dec_num_parent[2] = {0, 0};
+ cs_real_t *var_tmp = NULL;
+ cs_post_mesh_t *post_mesh = NULL;
+ cs_post_writer_t *writer = NULL;
+
+ const void *var_ptr[2*9] = {NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL};
+
+ /* Initializations */
+
+ _mesh_id = _cs_post_mesh_id(mesh_id);
+ post_mesh = _cs_post_meshes + _mesh_id;
+
+ if (interlace == true)
+ _interlace = FVM_INTERLACE;
+ else
+ _interlace = FVM_NO_INTERLACE;
+
+ datatype = _cs_post_cnv_datatype(var_type);
+
+ /* Assign appropriate array to FVM for output */
+
+ /* Case of cells */
+ /*---------------*/
+
+ if (post_mesh->ent_flag[CS_POST_LOCATION_CELL] == 1) {
+
+ if (use_parent == true) {
+ nbr_listes_parents = 1;
+ dec_num_parent[0] = 0;
+ }
+ else
+ nbr_listes_parents = 0;
+
+ var_ptr[0] = cel_vals;
+ if (interlace == false) {
+ if (use_parent == true)
+ dec_ptr = cs_glob_mesh->n_cells_with_ghosts;
+ else
+ dec_ptr = fvm_nodal_get_n_entities(post_mesh->exp_mesh, 3);
+ dec_ptr *= fvm_datatype_size[datatype];
+ for (i = 1; i < var_dim; i++)
+ var_ptr[i] = ((const char *)cel_vals) + i*dec_ptr;
+ }
+ }
+
+ /* Case of faces */
+ /*---------------*/
+
+ else if ( post_mesh->ent_flag[CS_POST_LOCATION_I_FACE] == 1
+ || post_mesh->ent_flag[CS_POST_LOCATION_B_FACE] == 1) {
+
+ /* In case of indirection, all that is necessary is to set pointers */
+
+ if (use_parent == true) {
+
+ nbr_listes_parents = 2;
+ dec_num_parent[0] = 0;
+ dec_num_parent[1] = cs_glob_mesh->n_b_faces;
+
+ if (post_mesh->ent_flag[CS_POST_LOCATION_B_FACE] == 1) {
+ if (interlace == false) {
+ dec_ptr = cs_glob_mesh->n_b_faces * fvm_datatype_size[datatype];
+ for (i = 0; i < var_dim; i++)
+ var_ptr[i] = ((const char *)b_face_vals) + i*dec_ptr;
+ }
+ else
+ var_ptr[0] = b_face_vals;
+ }
+
+ if (post_mesh->ent_flag[CS_POST_LOCATION_I_FACE] == 1) {
+ if (interlace == false) {
+ dec_ptr = cs_glob_mesh->n_i_faces * fvm_datatype_size[datatype];
+ for (i = 0; i < var_dim; i++)
+ var_ptr[var_dim + i] = ((const char *)i_face_vals) + i*dec_ptr;
+ }
+ else
+ var_ptr[1] = i_face_vals;
+ }
+
+ }
+
+ /* With no indirection, we must switch to a variable defined on two
+ lists of faces to a variable defined on one list */
+
+ else {
+
+ nbr_listes_parents = 0;
+
+ if (post_mesh->ent_flag[CS_POST_LOCATION_B_FACE] == 1) {
+
+ /* Case where a variable is defined both on boundary and
+ interior faces: we must switch to a single list, as
+ indirection is not used */
+
+ if (post_mesh->ent_flag[CS_POST_LOCATION_I_FACE] == 1) {
+
+ BFT_MALLOC(var_tmp,
+ ( post_mesh->n_i_faces
+ + post_mesh->n_b_faces) * var_dim,
+ cs_real_t);
+
+ _cs_post_assmb_var_faces(post_mesh->exp_mesh,
+ post_mesh->n_i_faces,
+ post_mesh->n_b_faces,
+ var_dim,
+ _interlace,
+ i_face_vals,
+ b_face_vals,
+ var_tmp);
+
+ _interlace = FVM_NO_INTERLACE;
+
+ dec_ptr = fvm_datatype_size[datatype] * ( post_mesh->n_i_faces
+ + post_mesh->n_b_faces);
+
+ for (i = 0; i < var_dim; i++)
+ var_ptr[i] = ((char *)var_tmp) + i*dec_ptr;
+
+ }
+
+ /* Case where we only have boundary faces */
+
+ else {
+
+ if (interlace == false) {
+ dec_ptr = fvm_datatype_size[datatype] * post_mesh->n_b_faces;
+ for (i = 0; i < var_dim; i++)
+ var_ptr[i] = ((const char *)b_face_vals) + i*dec_ptr;
+ }
+ else
+ var_ptr[0] = b_face_vals;
+ }
+
+ }
+
+ /* Case where we only have interior faces */
+
+ else if (post_mesh->ent_flag[CS_POST_LOCATION_I_FACE] == 1) {
+
+ if (interlace == false) {
+ dec_ptr = fvm_datatype_size[datatype] * post_mesh->n_i_faces;
+ for (i = 0; i < var_dim; i++)
+ var_ptr[i] = ((const char *)i_face_vals) + i*dec_ptr;
+ }
+ else
+ var_ptr[0] = i_face_vals;
+ }
+
+ }
+
+ }
+
+ /* Effective output: loop on writers */
+ /*-----------------------------------*/
+
+ for (i = 0; i < post_mesh->n_writers; i++) {
+
+ writer = _cs_post_writers + post_mesh->writer_id[i];
+
+ if (writer->active == 1)
+ fvm_writer_export_field(writer->writer,
+ post_mesh->exp_mesh,
+ var_name,
+ FVM_WRITER_PER_ELEMENT,
+ var_dim,
+ _interlace,
+ nbr_listes_parents,
+ dec_num_parent,
+ datatype,
+ (int)nt_cur_abs,
+ (double)t_cur_abs,
+ (const void * *)var_ptr);
+
+ }
+
+ /* Free memory (if both interior and boundary faces present) */
+
+ if (var_tmp != NULL)
+ BFT_FREE(var_tmp);
+}
+
+/*----------------------------------------------------------------------------
+ * Output a variable defined at vertices of a post-processing mesh using
+ * associated writers.
+ *
+ * parameters:
+ * mesh_id <-- id of associated mesh
+ * var_name <-- name of variable to output
+ * var_dim <-- 1 for scalar, 3 for vector
+ * interlace <-- if a vector, true for interlaced values, false otherwise
+ * use_parent <-- true if values are defined on "parent" mesh,
+ * false if values are defined on post-processing mesh
+ * var_type <-- variable's data type
+ * nt_cur_abs <-- current time step number
+ * t_cur_abs <-- current physical time
+ * vtx_vals <-- vertex values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_write_vertex_var(int mesh_id,
+ const char *var_name,
+ cs_int_t var_dim,
+ cs_bool_t interlace,
+ cs_bool_t use_parent,
+ cs_post_type_t var_type,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs,
+ const void *vtx_vals)
+{
+ cs_int_t i;
+ int _mesh_id;
+
+
+ cs_post_mesh_t *post_mesh;
+ cs_post_writer_t *writer;
+ fvm_interlace_t _interlace;
+ fvm_datatype_t datatype;
+
+ size_t dec_ptr = 0;
+ int nbr_listes_parents = 0;
+ fvm_lnum_t dec_num_parent[1] = {0};
+
+ const void *var_ptr[9] = {NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL};
+
+ /* Initializations */
+
+ _mesh_id = _cs_post_mesh_id(mesh_id);
+ post_mesh = _cs_post_meshes + _mesh_id;
+
+ if (interlace == true)
+ _interlace = FVM_INTERLACE;
+ else
+ _interlace = FVM_NO_INTERLACE;
+
+ assert( sizeof(cs_real_t) == sizeof(double)
+ || sizeof(cs_real_t) == sizeof(float));
+
+ datatype = _cs_post_cnv_datatype(var_type);
+
+ /* Assign appropriate array to FVM for output */
+
+ if (use_parent == true)
+ nbr_listes_parents = 1;
+ else
+ nbr_listes_parents = 0;
+
+ var_ptr[0] = vtx_vals;
+ if (interlace == false) {
+ if (use_parent == true)
+ dec_ptr = cs_glob_mesh->n_vertices;
+ else
+ dec_ptr = fvm_nodal_get_n_entities(post_mesh->exp_mesh, 0)
+ * fvm_datatype_size[datatype];
+ for (i = 1; i < var_dim; i++)
+ var_ptr[i] = ((const char *)vtx_vals) + i*dec_ptr;
+ }
+
+ /* Effective output: loop on writers */
+ /*-----------------------------------*/
+
+ for (i = 0; i < post_mesh->n_writers; i++) {
+
+ writer = _cs_post_writers + post_mesh->writer_id[i];
+
+ if (writer->active == 1)
+ fvm_writer_export_field(writer->writer,
+ post_mesh->exp_mesh,
+ var_name,
+ FVM_WRITER_PER_NODE,
+ var_dim,
+ _interlace,
+ nbr_listes_parents,
+ dec_num_parent,
+ datatype,
+ (int)nt_cur_abs,
+ (double)t_cur_abs,
+ (const void * *)var_ptr);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update references to parent mesh of post-processing meshes in case of
+ * computational mesh cell renumbering.
+ *
+ * This function may be called only once, after possible renumbering of cells,
+ * to update existing post-processing meshes. Post-processing meshes defined
+ * after renumbering will automatically be based upon the new numbering,
+ * so this function will not need to be called again.
+ *
+ * parameters:
+ * init_cell_num <-- initial cell numbering (1 to n, new -> old)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_renum_cells(const cs_int_t init_cell_num[])
+{
+ int i;
+ cs_int_t icel;
+ cs_int_t n_elts;
+
+ cs_int_t *renum_ent_parent = NULL;
+
+ cs_bool_t a_traiter = false;
+
+ cs_post_mesh_t *post_mesh;
+ const cs_mesh_t *maillage = cs_glob_mesh;
+
+ if (init_cell_num == NULL)
+ return;
+
+ /* Loop on meshes */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ if (post_mesh->ent_flag[CS_POST_LOCATION_CELL] > 0)
+ a_traiter = true;
+ }
+
+ if (a_traiter == true) {
+
+ /* Prepare renumbering */
+
+ n_elts = maillage->n_cells;
+
+ BFT_MALLOC(renum_ent_parent, n_elts, cs_int_t);
+
+ for (icel = 0; icel < maillage->n_cells; icel++)
+ renum_ent_parent[init_cell_num[icel] - 1] = icel + 1;
+
+ /* Effective modification */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ if ( post_mesh->_exp_mesh != NULL
+ && post_mesh->ent_flag[CS_POST_LOCATION_CELL] > 0) {
+
+ fvm_nodal_change_parent_num(post_mesh->_exp_mesh,
+ renum_ent_parent,
+ 3);
+
+ }
+
+ }
+
+ BFT_FREE(renum_ent_parent);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Update references to parent mesh of post-processing meshes in case of
+ * computational mesh interior and/or boundary faces renumbering.
+ *
+ * This function may be called only once, after possible renumbering of faces,
+ * to update existing post-processing meshes. Post-processing meshes defined
+ * after renumbering will automatically be based upon the new numbering,
+ * so this function will not need to be called again.
+ *
+ * parameters:
+ * init_i_face_num <-- initial interior numbering (1 to n, new -> old)
+ * init_b_face_num <-- initial boundary numbering (1 to n, new -> old)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_renum_faces(const cs_int_t init_i_face_num[],
+ const cs_int_t init_b_face_num[])
+{
+ int i;
+ cs_int_t ifac;
+ cs_int_t n_elts;
+
+ cs_int_t *renum_ent_parent = NULL;
+
+ cs_bool_t a_traiter = false;
+
+ cs_post_mesh_t *post_mesh;
+ const cs_mesh_t *maillage = cs_glob_mesh;
+
+ /* Loop on meshes */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ if ( post_mesh->ent_flag[CS_POST_LOCATION_I_FACE] > 0
+ || post_mesh->ent_flag[CS_POST_LOCATION_B_FACE] > 0) {
+ a_traiter = true;
+ }
+
+ }
+
+ if (a_traiter == true) {
+
+ /* Prepare renumbering */
+
+ n_elts = maillage->n_i_faces + maillage->n_b_faces;
+
+ BFT_MALLOC(renum_ent_parent, n_elts, cs_int_t);
+
+ if (init_b_face_num == NULL) {
+ for (ifac = 0; ifac < maillage->n_b_faces; ifac++)
+ renum_ent_parent[ifac] = ifac + 1;
+ }
+ else {
+ for (ifac = 0; ifac < maillage->n_b_faces; ifac++)
+ renum_ent_parent[init_b_face_num[ifac] - 1] = ifac + 1;
+ }
+
+ if (init_i_face_num == NULL) {
+ for (ifac = 0, i = maillage->n_b_faces;
+ ifac < maillage->n_i_faces;
+ ifac++, i++)
+ renum_ent_parent[maillage->n_b_faces + ifac]
+ = maillage->n_b_faces + ifac + 1;
+ }
+ else {
+ for (ifac = 0, i = maillage->n_b_faces;
+ ifac < maillage->n_i_faces;
+ ifac++, i++)
+ renum_ent_parent[maillage->n_b_faces + init_i_face_num[ifac] - 1]
+ = maillage->n_b_faces + ifac + 1;
+ }
+
+ /* Effective modification */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+
+ post_mesh = _cs_post_meshes + i;
+
+ if ( post_mesh->_exp_mesh != NULL
+ && ( post_mesh->ent_flag[CS_POST_LOCATION_I_FACE] > 0
+ || post_mesh->ent_flag[CS_POST_LOCATION_B_FACE] > 0)) {
+
+ fvm_nodal_change_parent_num(post_mesh->_exp_mesh,
+ renum_ent_parent,
+ 2);
+
+ }
+
+ }
+
+ BFT_FREE(renum_ent_parent);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy all structures associated with post-processing
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_finalize(void)
+{
+ int i;
+ cs_post_mesh_t *post_mesh = NULL;
+
+ /* Timings */
+
+ for (i = 0; i < _cs_post_n_writers; i++) {
+ double m_wtime = 0.0, m_cpu_time = 0.0, c_wtime = 0.0, c_cpu_time = 0.;
+ fvm_writer_get_times((_cs_post_writers + i)->writer,
+ &m_wtime, &m_cpu_time, &c_wtime, &c_cpu_time);
+ bft_printf(_("\n"
+ "Writing of \"%s\" (%s) summary:\n"
+ "\n"
+ " CPU time for meshes: %12.3f\n"
+ " CPU time for variables: %12.3f\n"
+ "\n"
+ " Elapsed time for meshes: %12.3f\n"
+ " Elapsed time for variables: %12.3f\n"),
+ fvm_writer_get_name((_cs_post_writers + i)->writer),
+ fvm_writer_get_format((_cs_post_writers + i)->writer),
+ m_cpu_time, c_cpu_time, m_wtime, c_wtime);
+ }
+
+ /* Initial coordinates (if mesh is deformable) */
+
+ if (_cs_post_ini_vtx_coo != NULL)
+ BFT_FREE(_cs_post_ini_vtx_coo);
+
+ /* Exportable meshes */
+
+ for (i = 0; i < _cs_post_n_meshes; i++) {
+ post_mesh = _cs_post_meshes + i;
+ if (post_mesh->_exp_mesh != NULL)
+ fvm_nodal_destroy(post_mesh->_exp_mesh);
+ BFT_FREE(post_mesh->writer_id);
+ }
+
+ BFT_FREE(_cs_post_meshes);
+
+ _cs_post_min_mesh_id = -2;
+ _cs_post_n_meshes = 0;
+ _cs_post_n_meshes_max = 0;
+
+ /* Writers */
+
+ for (i = 0; i < _cs_post_n_writers; i++)
+ fvm_writer_finalize((_cs_post_writers + i)->writer);
+
+ BFT_FREE(_cs_post_writers);
+
+ _cs_post_n_writers = 0;
+ _cs_post_n_writers_max = 0;
+
+ /* Registered processings if necessary */
+
+ if (_cs_post_nbr_var_tp_max > 0) {
+ BFT_FREE(_cs_post_f_var_tp);
+ BFT_FREE(_cs_post_i_var_tp);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize main post-processing writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_init_main_writer(void)
+{
+ /* Default values */
+
+ cs_int_t indic_vol = -1, indic_brd = -1, indic_syr = -1, indic_ze = -1;
+ cs_int_t indic_mod = -1;
+ char fmtchr[32 + 1] = "";
+ char optchr[96 + 1] = "";
+ cs_int_t ntchr = -1;
+
+ const char nomcas[] = "chr";
+ const char nomrep_ens[] = "chr.ensight";
+ const char nomrep_def[] = ".";
+ const char *nomrep = NULL;
+
+ const cs_int_t writer_id = -1; /* Default (main) writer id */
+
+ /* Get parameters from Fortran COMMON blocks */
+
+ CS_PROCF(inipst, INIPST)(&indic_vol,
+ &indic_brd,
+ &indic_syr,
+ &indic_ze,
+ &indic_mod,
+ &ntchr,
+ fmtchr,
+ optchr);
+
+ fmtchr[32] = '\0';
+ optchr[96] = '\0';
+
+ if (indic_vol == 0 && indic_brd == 0 && indic_syr == 0)
+ return;
+
+ /* Create default writer */
+
+ if (fmtchr[0] == 'e' || fmtchr[0] == 'E')
+ nomrep = nomrep_ens;
+ else
+ nomrep = nomrep_def;
+
+ cs_post_add_writer(writer_id,
+ nomcas,
+ nomrep,
+ fmtchr,
+ optchr,
+ indic_mod,
+ ntchr);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize main post-processing meshes
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_init_main_meshes(void)
+{
+ /* Default values */
+
+ cs_int_t indic_vol = -1, indic_brd = -1, indic_syr = -1, indic_ze = -1;
+ cs_int_t indic_mod = -1;
+ char fmtchr[32 + 1] = "";
+ char optchr[96 + 1] = "";
+ cs_int_t ntchr = -1;
+
+ cs_int_t mesh_id = -1;
+
+ const cs_int_t writer_id = -1; /* Default (main) writer id */
+
+ /* Get parameters from Fortran COMMON blocks */
+
+ CS_PROCF(inipst, INIPST)(&indic_vol,
+ &indic_brd,
+ &indic_syr,
+ &indic_ze,
+ &indic_mod,
+ &ntchr,
+ fmtchr,
+ optchr);
+
+ fmtchr[32] = '\0';
+ optchr[96] = '\0';
+
+ /* Definition of post-processing meshes */
+
+ if (cs_glob_mesh->n_i_faces > 0 || cs_glob_mesh->n_b_faces > 0) {
+
+ /*
+ If the faces -> vertices connectivity is available, we
+ may rebuild the nodal connectivity for post-processing
+ (usual mechanism).
+ */
+
+ if (indic_vol > 0) { /* Volume mesh */
+
+ mesh_id = -1; /* Reserved mesh id */
+
+ cs_post_add_mesh(mesh_id,
+ _("Fluid volume"),
+ cs_glob_mesh->n_cells,
+ 0,
+ 0,
+ NULL,
+ NULL,
+ NULL);
+
+ cs_post_associate(mesh_id, writer_id);
+
+ }
+
+ if (indic_brd > 0) { /* Boundary mesh */
+
+ mesh_id = -2; /* Reserved mesh id */
+
+ cs_post_add_mesh(mesh_id,
+ _("Boundary"),
+ 0,
+ 0,
+ cs_glob_mesh->n_b_faces,
+ NULL,
+ NULL,
+ NULL);
+
+ cs_post_associate(mesh_id, writer_id);
+
+ }
+
+ } /* End if cs_glob_mesh->n_i_faces > 0 || cs_glob_mesh->n_b_faces > 0 */
+
+ /*
+ If we do not have the faces -> vertices connectivity, we may not
+ rebuild the nodal connectivity, so we must obtain it through
+ another means.
+
+ This only happens when we have directly read a mesh in the solcom
+ format, in which the nodal connectivity has already been read and
+ assigned to a post-processing mesh
+ (see LETGEO and cs_maillage_solcom_lit).
+ */
+
+ else if (indic_vol > 0) {
+
+ mesh_id = -1;
+
+ if (cs_post_mesh_exists(mesh_id))
+ cs_post_associate(mesh_id, writer_id);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing writer with same format and associated
+ * options as default writer, but no time dependency, intended to
+ * troubleshoot errors.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_init_error_writer(void)
+{
+ /* Default values */
+
+ cs_int_t indic_vol = -1, indic_brd = -1, indic_syr = -1, indic_ze = -1;
+ cs_int_t indic_mod = -1;
+ char fmtchr[32 + 1] = "";
+ char optchr[96 + 1] = "";
+ cs_int_t ntchr = -1;
+
+ const char nomcas[] = "error";
+ const char nomrep_ens[] = "error.ensight";
+ const char nomrep_def[] = ".";
+ const char *nomrep = NULL;
+
+ const int writer_id = -2;
+
+ if (cs_post_writer_exists(writer_id))
+ return;
+
+ /* Get parameters from Fortran COMMON blocks */
+
+ CS_PROCF(inipst, INIPST)(&indic_vol,
+ &indic_brd,
+ &indic_syr,
+ &indic_ze,
+ &indic_mod,
+ &ntchr,
+ fmtchr,
+ optchr);
+
+ fmtchr[32] = '\0';
+ optchr[96] = '\0';
+
+ /* Create default writer */
+
+ if (fmtchr[0] == 'e' || fmtchr[0] == 'E')
+ nomrep = nomrep_ens;
+ else
+ nomrep = nomrep_def;
+
+ cs_post_add_writer(writer_id,
+ nomcas,
+ nomrep,
+ fmtchr,
+ optchr,
+ -1, /* No time dependency here */
+ ntchr);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing writer with same format and associated
+ * options as default writer, but no time dependency, and associate
+ * and output global volume mesh.
+ *
+ * This is intended to help troubleshoot errors using fields based
+ * on cells.
+ *
+ * returns:
+ * id of error output mesh (< 0), or 0 if all writers are deactivated
+ *----------------------------------------------------------------------------*/
+
+int
+cs_post_init_error_writer_cells(void)
+{
+ int mesh_id = 0;
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+
+ /* If post-processing is active, output info */
+ /*-------------------------------------------*/
+
+ if (mesh->i_face_vtx_idx != NULL || mesh->b_face_vtx_idx != NULL) {
+
+ const int writer_id = -2;
+ const cs_int_t n_cells = mesh->n_cells;
+
+ cs_post_init_error_writer();
+
+ mesh_id = cs_post_get_free_mesh_id();
+
+ cs_post_add_mesh(mesh_id,
+ _("Calculation domain"),
+ n_cells,
+ 0,
+ 0,
+ NULL,
+ NULL,
+ NULL);
+
+ cs_post_associate(mesh_id, writer_id);
+
+ cs_post_activate_writer(writer_id, 1);
+
+ cs_post_write_meshes(-1, 0.0);
+ }
+
+ return mesh_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Register a processing of a time-dependent variable to the call to PSTVAR.
+ *
+ * The instance identifier associated with the function allows registering
+ * the same function several times, with a diferent identifier allowing the
+ * function to select a specific operation or data.
+ *
+ * parameters:
+ * function <-- function to register
+ * instance_id <-- instance id associated with this registration
+ *----------------------------------------------------------------------------*/
+
+void
+cs_post_add_time_dep_var(cs_post_time_dep_var_t *function,
+ int instance_id)
+{
+ /* Resize array of registered post-processings if necessary */
+
+ if (_cs_post_nbr_var_tp <= _cs_post_nbr_var_tp_max) {
+ if (_cs_post_nbr_var_tp_max == 0)
+ _cs_post_nbr_var_tp_max = 8;
+ else
+ _cs_post_nbr_var_tp_max *= 2;
+ BFT_REALLOC(_cs_post_f_var_tp,
+ _cs_post_nbr_var_tp_max,
+ cs_post_time_dep_var_t *);
+ BFT_REALLOC(_cs_post_i_var_tp, _cs_post_nbr_var_tp_max, cs_int_t);
+ }
+
+ /* Add a post-processing */
+
+ _cs_post_f_var_tp[_cs_post_nbr_var_tp] = function;
+ _cs_post_i_var_tp[_cs_post_nbr_var_tp] = instance_id;
+
+ _cs_post_nbr_var_tp += 1;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_post_f2c.f90 b/src/base/cs_post_f2c.f90
new file mode 100644
index 0000000..b0a64c6
--- /dev/null
+++ b/src/base/cs_post_f2c.f90
@@ -0,0 +1,378 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine pstcwr &
+!=================
+
+ ( numgep , nomcas , nomrep , nomfmt , optfmt , &
+ indmod , ntchr )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CREATION D'UN "WRITER" A PARTIR DES DONNEES FOURNIES PAR LA
+! COUCHE FORTRAN : ENCAPSULATION COUCHE C POUR LA TRANSMISSION
+! DES LONGUEURS DES CHAINES DE CARACTERES
+
+! UN WRITER CORRESPOND AU CHOIX D'UN NOM DE CAS, DE REPERTOIRE,
+! ET DE FORMAT, AINSI QU'UN INDICATEUR PRECISANT SI LES MAILLAGES
+! ASSOCIES DOIVENT DEPENDRE OU NON DU TEMPS, ET LA FREQUENCE
+! DE SORTIE PAR DEFAUT POUR LES VARIABLES ASSOCIEES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! numgep ! e ! <-- ! identificateur du gestionnaire !
+! ! ! ! (< 0 pour gestionnaire reserve, !
+! ! ! ! > 0 pour gestionnaire utilisateur) !
+! nomcas ! a ! <-- ! nom du cas associe !
+! nomrep ! a ! <-- ! nom du repertoire associe !
+! nomfmt ! a ! <-- ! nom de format associe !
+! optfmt ! e ! <-- ! options associees au format !
+! indmod ! e ! <-- ! 0 : maillages figes !
+! ! ! ! 1 : maillages deformables !
+! ! ! ! 2 : maillages modifiables !
+! ntchr ! e ! <-- ! frequence de sortie par defaut !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*32 nomcas , nomfmt
+character*96 nomrep , optfmt
+integer numgep , indmod , ntchr
+
+! VARIABLES LOCALES
+
+integer lnmcas , lnmrep , lnmfmt , lopfmt
+
+!===============================================================================
+
+lnmcas = len(nomcas)
+lnmrep = len(nomrep)
+lnmfmt = len(nomfmt)
+lopfmt = len(optfmt)
+
+call pstcw1 (numgep, nomcas, nomrep, nomfmt, optfmt, &
+!==========
+ lnmcas, lnmrep, lnmfmt, lopfmt, &
+ indmod, ntchr)
+
+return
+
+end
+subroutine pstcma &
+!=================
+
+ ( nummai , nommai , &
+ nbrcel , nbrfac , nbrfbr , lstcel , lstfac , lstfbr )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CREATION D'UN MAILLAGE DE POST TRAITEMENT A PARTIR DES DONNEES
+! FOURNIES PAR LA COUCHE FORTRAN : ENCAPSULATION COUCHE C
+! POUR LA TRANSMISSION DES LONGUEURS DES CHAINES DE CARACTERES
+
+! LES LISTES DE CELLULES OU FACES A EXTRAIRE SONT TRIEES EN SORTIE,
+! QU'ELLES LE SOIENT DEJA EN ENTREE OU NON.
+
+! LA LISTE DES CELLULES ASSOCIEES N'EST NECESSAIRE QUE SI LE NOMBRE
+! DE CELLULES A EXTRAIRE EST STRICTEMENT SUPERIEUR A 0 ET INFERIEUR
+! AU NOMBRE DE CELLULES DU MAILLAGE.
+
+! LES LISTES DE FACES NE SONT PRISES EN COMPTE QUE SI LE NOMBRE DE
+! CELLULES A EXTRAIRE EST NUL ; SI LE NOMBRE DE FACES DE BORD A
+! EXTRAIRE EST EGAL AU NOMBRE DE FACES DE BORD DU MAILLAGE GLOBAL,
+! ET LE NOMBRE DE FACES INTERNES A EXTRAIRE EST NUL, ALORS ON
+! EXTRAIT PAR DEFAUT LE MAILLAGE DE BORD, ET LA LISTE DES FACES DE
+! BORD ASSOCIEES N'EST DONC PAS NECESSAIRE.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nummai ! e ! <-- ! identificateur du maillage !
+! ! ! ! (< 0 pour maillage reserve, , !
+! ! ! ! > 0 pour maillage utilisateur) !
+! nommai ! a ! <-- ! nom du maillage associe !
+! nbrcel ! e ! <-- ! nombre de cellules associees !
+! nbrfac ! e ! <-- ! nombre de faces internes associees !
+! nbrfbr ! e ! <-- ! nombre de faces de bord associees !
+! lstcel ! e ! <-- ! liste des cellules associees !
+! ! e ! ! (inutile si nbrcel >= ncel) !
+! lstfac ! e ! <-- ! liste des faces internes associees !
+! lstfbr ! e ! <-- ! liste des faces de bord associees !
+! ! e ! ! (inutile si nbrfbr = nfabor !
+! ! e ! ! et nbrfac = 0 ) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*32 nommai
+integer nummai, nbrcel, nbrfac, nbrfbr
+
+integer lstcel(nbrcel), lstfac(nbrfac), lstfbr(nbrfbr)
+
+! VARIABLES LOCALES
+
+integer lnmmai
+
+!===============================================================================
+
+lnmmai = len(nommai)
+
+call pstcm1 (nummai, nommai, lnmmai, &
+!==========
+ nbrcel, nbrfac, nbrfbr, lstcel, lstfac, lstfbr)
+
+return
+
+end
+subroutine psteva &
+!================
+
+ ( nummai , nomvar , dimvar , ientla , ivarpr , ntcabs , ttcabs , &
+ varcel , varfac , varfbo )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ECRITURE D'UN CHAMP DE POST TRAITEMENT ASSOCIE AUX CELLULES
+! OU FACES D'UN MAILLAGE A PARTIR DES DONNEES FOURNIES PAR LA
+! COUCHE FORTRAN :
+! ENCAPSULATION COUCHE C POUR LA TRANSMISSION DES LONGUEURS DES
+! CHAINES DE CARACTERES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nummai ! a ! <-- ! numero du maillage associe !
+! nomvar ! e ! <-- ! nom de la variable associee !
+! dimvar ! e ! <-- ! 1 pour scalaire, 3 pour vecteur !
+! ientla ! e ! <-- ! si vecteur, 1 si valeurs entrelacees !
+! ! ! ! (x1, y1, z1, x2, y2, ..., yn, zn), !
+! ! ! ! 0 sinon (x1, x2, ...xn, y1, y2, ...) !
+! ivarpr ! e ! <-- ! 1 si variable definie sur maillage !
+! ! ! ! "parent", 0 si variable restreinte !
+! ! ! ! au maillage nummai !
+! ntcabs ! e ! <-- ! numero de pas de temps (-1 pour une !
+! ! ! ! variable independante du temps) !
+! ttcabs ! r ! <-- ! temps physique associe !
+! varcel(*) ! r ! <-- ! valeurs aux cellules associees !
+! varfac(*) ! r ! <-- ! valeurs aux faces internes associees !
+! varfbo(*) ! r ! <-- ! valeurs aux faces de bord associees !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*32 nomvar
+integer nummai, dimvar, ientla, ivarpr, ntcabs
+double precision ttcabs, varcel(*), varfac(*), varfbo(*)
+
+! VARIABLES LOCALES
+
+integer lnmvar
+
+!===============================================================================
+
+lnmvar = len(nomvar)
+
+call pstev1 (nummai, nomvar, lnmvar, dimvar, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, varcel, varfac, varfbo)
+
+return
+
+end
+subroutine pstsnv &
+!================
+
+ ( nomvar , nomva2 , nomva3 )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SUPPRESSION DU CARACTERE X, x, OU 1 D'UNE CHAINE DE CARACTERES
+! FORTRAN SI LES CHAINES COMPAREES SONT IDENTIQUES AU DERNIER
+! CARACTERE PRES, RESPECTIVEMENT Y, y, OU 2 ET Z, z, OU 3
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nomvar ! e ! <-- ! nom de la variable associee !
+! nomva2 ! e ! <-- ! nom de la variable 2 associee !
+! nomva3 ! e ! <-- ! nom de la variable 3 associee !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*32 nomvar, nomva2, nomva3
+
+! VARIABLES LOCALES
+
+integer ii, jj
+integer lnmvar, lnmva2, lnmva3
+
+!===============================================================================
+
+lnmvar = len(nomvar)
+lnmva2 = len(nomva2)
+lnmva3 = len(nomva3)
+
+if ((lnmvar .eq. lnmva2) .and. (lnmvar .eq. lnmva3)) then
+
+ do 10 ii = lnmvar, 1, -1
+ IF ( NOMVAR(II:II) .NE. ' ' &
+ .OR. NOMVA2(II:II) .NE. ' ' &
+ .OR. NOMVA3(II:II) .NE. ' ') THEN
+ goto 20
+ endif
+ 10 continue
+
+ 20 continue
+
+ if (ii .gt. 1) then
+
+ jj = ii
+
+! On prevoit le cas ou c'est l'avant-dernier caractere
+! qui change, comme avec VitesX1, VitesX2, ... en
+! cas de calcul avec plusieurs phases
+
+ if ( (ii .gt. 2) &
+ .and. (nomvar(ii:ii) .eq. nomva2(ii:ii)) &
+ .and. (nomvar(ii:ii) .eq. nomva3(ii:ii))) then
+ ii = jj-1
+ endif
+
+! On supprime le caractere lie a la dimension
+
+ IF ( NOMVAR(II:II) .EQ. 'X' &
+ .AND. NOMVA2(II:II) .EQ. 'Y' &
+ .AND. NOMVA3(II:II) .EQ. 'Z') THEN
+ NOMVAR(II:II) = ' '
+ ELSE IF ( NOMVAR(II:II) .EQ. 'x' &
+ .AND. NOMVA2(II:II) .EQ. 'y' &
+ .AND. NOMVA3(II:II) .EQ. 'z') THEN
+ NOMVAR(II:II) = ' '
+ ELSE IF ( NOMVAR(II:II) .EQ. '1' &
+ .AND. NOMVA2(II:II) .EQ. '2' &
+ .AND. NOMVA3(II:II) .EQ. '3') THEN
+ NOMVAR(II:II) = ' '
+ endif
+
+! Si l'on a supprime l'avant-dernier caractere, on
+! decale le dernier caractere
+
+ if (ii .eq. jj+1) then
+ nomvar(ii:ii) = nomvar(jj:jj)
+ NOMVAR(JJ:JJ) = ' '
+ endif
+
+ endif
+
+endif
+
+return
+
+end
+
diff --git a/src/base/cs_preprocessor_data.c b/src/base/cs_preprocessor_data.c
new file mode 100644
index 0000000..e2e9d0f
--- /dev/null
+++ b/src/base/cs_preprocessor_data.c
@@ -0,0 +1,2716 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Manage the exchange of data between Code_Saturne and the pre-processor
+ *============================================================================*/
+
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/* To use Space-filling curve (Morton) for decomposition, define USE_SFC */
+#undef USE_SFC
+/* #define USE_SFC 1 */
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <math.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_file.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_periodicity.h>
+
+#include <fvm_block_to_part.h>
+#include <fvm_io_num.h>
+#include <fvm_interface.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_io.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_preprocessor_data.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/* Structure used for building mesh structure */
+/* ------------------------------------------ */
+
+typedef struct {
+
+ /* Face-related dimensions */
+
+ fvm_gnum_t n_g_faces;
+ fvm_gnum_t n_g_face_connect_size;
+
+ /* Temporary mesh data */
+
+ int read_cell_rank;
+ int *cell_rank;
+
+ fvm_gnum_t *face_cells;
+ fvm_lnum_t *face_vertices_idx;
+ fvm_gnum_t *face_vertices;
+ cs_int_t *cell_gc_id;
+ cs_int_t *face_gc_id;
+ cs_real_t *vertex_coords;
+
+ /* Periodic features */
+
+ int n_perio; /* Number of periodicities */
+ int *periodicity_num; /* Periodicity numbers */
+ fvm_lnum_t *n_per_face_couples; /* Nb. face couples per periodicity */
+ fvm_gnum_t *n_g_per_face_couples; /* Global nb. couples per periodicity */
+
+ fvm_gnum_t **per_face_couples; /* Periodic face couples list. */
+
+ /* Block ranges for parallel distribution */
+
+ fvm_block_to_part_info_t cell_bi; /* Block info for cell data */
+ fvm_block_to_part_info_t face_bi; /* Block info for face data */
+ fvm_block_to_part_info_t vertex_bi; /* Block info for vertex data */
+ fvm_block_to_part_info_t *per_face_bi; /* Block info for parallel face
+ couples */
+
+} _mesh_reader_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+static _mesh_reader_t *_cs_glob_mesh_reader = NULL;
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create an empty mesh reader helper structure.
+ *
+ * returns:
+ * A pointer to a mesh reader helper structure
+ *----------------------------------------------------------------------------*/
+
+static _mesh_reader_t *
+_mesh_reader_create(void)
+{
+ _mesh_reader_t *mr = NULL;
+
+ BFT_MALLOC(mr, 1, _mesh_reader_t);
+
+ memset(mr, 0, sizeof(_mesh_reader_t));
+
+ mr->n_g_faces = 0;
+ mr->n_g_face_connect_size = 0;
+
+ mr->read_cell_rank = 0;
+
+ mr->cell_rank = NULL;
+ mr->face_cells = NULL;
+ mr->face_vertices_idx = NULL;
+ mr->face_vertices = NULL;
+ mr->cell_gc_id = NULL;
+ mr->face_gc_id = NULL;
+ mr->vertex_coords = NULL;
+
+ mr->n_perio = 0;
+ mr->periodicity_num = NULL;
+ mr->n_per_face_couples = NULL;
+ mr->n_g_per_face_couples = NULL;
+ mr->per_face_couples = NULL;
+
+ mr->per_face_bi = NULL;
+
+ return mr;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a mesh reader helper structure
+ *
+ * mr <-> pointer to a mesh reader helper
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_mesh_reader_destroy(_mesh_reader_t **mr)
+{
+ _mesh_reader_t *_mr = *mr;
+
+ BFT_FREE(_mr->face_cells);
+ BFT_FREE(_mr->face_vertices_idx);
+ BFT_FREE(_mr->face_vertices);
+ BFT_FREE(_mr->cell_gc_id);
+ BFT_FREE(_mr->face_gc_id);
+ BFT_FREE(_mr->vertex_coords);
+
+ if (_mr->n_perio > 0) {
+ int i;
+ for (i = 0; i < _mr->n_perio; i++)
+ BFT_FREE(_mr->per_face_couples[i]);
+ BFT_FREE(_mr->per_face_couples);
+ BFT_FREE(_mr->n_g_per_face_couples);
+ BFT_FREE(_mr->n_per_face_couples);
+ BFT_FREE(_mr->periodicity_num);
+ BFT_FREE(_mr->per_face_bi);
+ }
+
+ BFT_FREE(*mr);
+}
+
+/*----------------------------------------------------------------------------
+ * Add a periodicity to mesh->periodicities (fvm_periodicity_t *) structure.
+ *
+ * Parameters:
+ * mesh <-> mesh
+ * perio_type <-- periodicity type
+ * perio_num <-- periodicity number (identifier)
+ * matrix <-- transformation matrix using homogeneous coordinates
+ *----------------------------------------------------------------------------*/
+
+static void
+_add_periodicity(cs_mesh_t *mesh,
+ cs_int_t perio_type,
+ cs_int_t perio_num,
+ cs_real_t matrix[3][4])
+{
+ cs_int_t i, j, tr_id;
+ double _matrix[3][4];
+
+ fvm_periodicity_type_t _perio_type = perio_type;
+
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 4; j++)
+ _matrix[i][j] = matrix[i][j];
+ }
+
+ if (_perio_type == FVM_PERIODICITY_TRANSLATION)
+ bft_printf(_(" Adding periodicity %d "
+ "(translation [%10.4e, %10.4e, %10.4e]).\n"),
+ (int)perio_num, _matrix[0][3], _matrix[1][3], _matrix[2][3]);
+
+ else if (_perio_type == FVM_PERIODICITY_ROTATION)
+ bft_printf(_(" Adding periodicity %d (rotation).\n"),
+ (int)perio_num);
+
+ tr_id = fvm_periodicity_add_by_matrix(mesh->periodicity,
+ perio_num,
+ _perio_type,
+ matrix);
+}
+
+/*----------------------------------------------------------------------------
+ * Set block ranges for parallel reads
+ *
+ * mesh <-- pointer to mesh structure
+ * mr <-> mesh reader helper
+ *----------------------------------------------------------------------------*/
+
+static void
+_set_block_ranges(cs_mesh_t *mesh,
+ _mesh_reader_t *mr)
+{
+ int i;
+
+ int rank_id = cs_glob_rank_id;
+ int n_ranks = cs_glob_n_ranks;
+
+ /* Always build per_face_range in case of periodicity */
+
+ if (mr->n_perio > 0) {
+ BFT_MALLOC(mr->per_face_bi, mr->n_perio, fvm_block_to_part_info_t);
+ memset(mr->per_face_bi, 0, sizeof(fvm_block_to_part_info_t)*mr->n_perio);
+ }
+
+ /* Set block sizes and ranges (useful for parallel mode) */
+
+ mr->cell_bi = fvm_block_to_part_compute_sizes(rank_id,
+ n_ranks,
+ 0,
+ mesh->n_g_cells);
+
+ mr->face_bi = fvm_block_to_part_compute_sizes(rank_id,
+ n_ranks,
+ 0,
+ mr->n_g_faces);
+
+ mr->vertex_bi = fvm_block_to_part_compute_sizes(rank_id,
+ n_ranks,
+ 0,
+ mesh->n_g_vertices);
+ for (i = 0; i < mr->n_perio; i++)
+ mr->per_face_bi[i]
+ = fvm_block_to_part_compute_sizes(rank_id,
+ n_ranks,
+ 0,
+ mr->n_g_per_face_couples[i]);
+}
+
+/*----------------------------------------------------------------------------
+ * Read cell rank if available
+ *
+ * mesh <-- pointer to mesh structure
+ * mr <-> mesh reader helper
+ * echo <-- echo (verbosity) level
+ *----------------------------------------------------------------------------*/
+
+static void
+_read_cell_rank(cs_mesh_t *mesh,
+ _mesh_reader_t *mr,
+ long echo)
+{
+ char file_name[32]; /* more than enough for "domain_number_<n_ranks>" */
+ size_t i;
+ cs_io_sec_header_t header;
+
+ cs_io_t *rank_pp_in = NULL;
+ fvm_lnum_t n_ranks = 0;
+ fvm_gnum_t n_elts = 0;
+ fvm_gnum_t n_g_cells = 0;
+
+ const char *unexpected_msg = N_("Message of type <%s> on <%s>\n"
+ "unexpected or of incorrect size");
+
+ if (n_ranks == 1)
+ return;
+
+#if (_CS_STDC_VERSION < 199901L)
+ sprintf(file_name, "domain_number_%d", cs_glob_n_ranks);
+#else
+ snprintf(file_name, 32, "domain_number_%d", cs_glob_n_ranks);
+#endif
+ file_name[31] = '\0'; /* Just in case; processor counts would need to be
+ in the exa-range for this to be necessary. */
+
+ /* Test if file exists */
+
+ if (! bft_file_isreg(file_name)) {
+ bft_printf(_(" No \"%s\" file available;\n"
+ " an unoptimized domain partitioning will be used.\n"),
+ file_name);
+ return;
+ }
+
+ /* Open file */
+
+#if defined(FVM_HAVE_MPI)
+ rank_pp_in = cs_io_initialize(file_name,
+ "Domain partitioning, R0",
+ CS_IO_MODE_READ,
+ cs_glob_io_hints,
+ echo,
+ cs_glob_mpi_comm);
+#else
+ rank_pp_in = cs_io_initialize(file_name,
+ "Domain partitioning, R0",
+ CS_IO_MODE_READ,
+ cs_glob_io_hints,
+ echo);
+#endif
+
+ if (echo > 0)
+ bft_printf("\n");
+
+ /* Loop on read sections */
+
+ while (rank_pp_in != NULL) {
+
+ /* Receive headers */
+
+ cs_io_read_header(rank_pp_in, &header);
+
+ /* Treatment according to the header name */
+
+ if (strncmp(header.sec_name, "n_cells",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name,
+ cs_io_get_name(rank_pp_in));
+ else {
+ cs_io_set_fvm_gnum(&header, rank_pp_in);
+ cs_io_read_global(&header, &n_g_cells, rank_pp_in);
+ if (n_g_cells != mesh->n_g_cells)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The number of cells reported by file\n"
+ "\"%s\" (%lu)\n"
+ "does not correspond the those of the mesh (%lu)."),
+ cs_io_get_name(rank_pp_in),
+ (unsigned long)(n_g_cells),
+ (unsigned long)(mesh->n_g_cells));
+ }
+
+ }
+ else if (strncmp(header.sec_name, "n_ranks",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name,
+ cs_io_get_name(rank_pp_in));
+ else {
+ cs_io_set_fvm_lnum(&header, rank_pp_in);
+ cs_io_read_global(&header, &n_ranks, rank_pp_in);
+ if (n_ranks != cs_glob_n_ranks)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Le number of ranks reported by file\n"
+ "\"%s\" (%d) does not\n"
+ "correspond to the current number of ranks (%d)."),
+ cs_io_get_name(rank_pp_in), (int)n_ranks,
+ (int)cs_glob_n_ranks);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "cell:domain number",
+ CS_IO_NAME_LEN) == 0) {
+
+ n_elts = mesh->n_g_cells;
+ if (header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name,
+ cs_io_get_name(rank_pp_in));
+ else {
+ mr->read_cell_rank = 1;
+ cs_io_set_fvm_lnum(&header, rank_pp_in);
+ if (mr->cell_bi.gnum_range[0] > 0)
+ n_elts = mr->cell_bi.gnum_range[1] - mr->cell_bi.gnum_range[0];
+ BFT_MALLOC(mr->cell_rank, n_elts, fvm_lnum_t);
+ cs_io_read_block(&header,
+ mr->cell_bi.gnum_range[0],
+ mr->cell_bi.gnum_range[1],
+ mr->cell_rank, rank_pp_in);
+ for (i = 0; i < n_elts; i++) /* Convert 1 to n to 0 to n-1 */
+ mr->cell_rank[i] -= 1;
+ }
+ cs_io_finalize(&rank_pp_in);
+ rank_pp_in = NULL;
+ }
+ }
+
+ if (rank_pp_in != NULL)
+ cs_io_finalize(&rank_pp_in);
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Mark faces by type (0 for interior, 1 for exterior faces with outwards
+ * pointing normal, 2 for exterior faces with inwards pointing normal,
+ * 3 for isolated faces) in parallel mode.
+ *
+ * The mesh structure is also updated with face counts and connectivity sizes.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ * n_faces <-- number of local faces
+ * face_ifs <-- parallel and periodic faces interfaces set
+ * face_cell <-- local face -> cell connectivity
+ * face_vertices_idx <-- local face -> vertices index
+ * face_type --> face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_face_type_g(cs_mesh_t *mesh,
+ fvm_lnum_t n_faces,
+ const fvm_interface_set_t *face_ifs,
+ const fvm_lnum_t face_cell[],
+ const fvm_lnum_t face_vertices_idx[],
+ char face_type[])
+{
+ fvm_lnum_t i;
+ int j;
+
+ const int n_interfaces = fvm_interface_set_size(face_ifs);
+
+ /* Mark base interior faces */
+
+ for (i = 0; i < n_faces; i++) {
+ if (face_cell[i*2] > 0 && face_cell[i*2+1] > 0)
+ face_type[i] = '\0';
+ else if (face_cell[i*2] > 0)
+ face_type[i] = '\1';
+ else if (face_cell[i*2 + 1] > 0)
+ face_type[i] = '\2';
+ else
+ face_type[i] = '\3';
+ }
+
+ /* Also mark parallel and periodic faces as interior */
+
+ for (j = 0; j < n_interfaces; j++) {
+
+ const fvm_interface_t *face_if = fvm_interface_set_get(face_ifs, j);
+ fvm_lnum_t face_if_size = fvm_interface_size(face_if);
+ const fvm_lnum_t *loc_num = fvm_interface_get_local_num(face_if);
+
+ for (i = 0; i < face_if_size; i++)
+ face_type[loc_num[i] - 1] = '\0';
+
+ }
+
+ /* Now count faces of each type */
+
+ mesh->n_i_faces = 0;
+ mesh->n_b_faces = 0;
+ mesh->i_face_vtx_connect_size = 0;
+ mesh->b_face_vtx_connect_size = 0;
+
+ for (i = 0; i < n_faces; i++) {
+ fvm_lnum_t n_f_vertices = face_vertices_idx[i+1] - face_vertices_idx[i];
+ if (face_type[i] == '\0') {
+ mesh->n_i_faces += 1;
+ mesh->i_face_vtx_connect_size += n_f_vertices;
+ }
+ else if (face_type[i] == '\1' || face_type[i] == '\2') {
+ mesh->n_b_faces += 1;
+ mesh->b_face_vtx_connect_size += n_f_vertices;
+ }
+ }
+}
+
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Mark faces by type (0 for interior, 1 for exterior faces with outwards
+ * pointing normal, 2 for exterior faces with inwards pointing normal,
+ * 3 for isolated faces) in serial mode.
+ *
+ * The mesh structure is also updated with face counts and connectivity sizes.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ * n_faces <-- number of local faces
+ * n_periodic_couples <-- number of periodic couples associated with
+ * each periodic list
+ * periodic_couples <-- array indicating periodic couples (using
+ * global numberings) for each list
+ * face_cell <-- local face -> cell connectivity
+ * face_vertices_idx <-- local face -> vertices index
+ * face_type --> face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_face_type_l(cs_mesh_t *mesh,
+ fvm_lnum_t n_faces,
+ const fvm_lnum_t n_periodic_couples[],
+ const fvm_gnum_t *const periodic_couples[],
+ const fvm_lnum_t face_cell[],
+ const fvm_lnum_t face_vertices_idx[],
+ char face_type[])
+{
+ fvm_lnum_t i;
+ int j;
+
+ /* Mark base interior faces */
+
+ for (i = 0; i < n_faces; i++) {
+ if (face_cell[i*2] > 0 && face_cell[i*2+1] > 0)
+ face_type[i] = '\0';
+ else if (face_cell[i*2] > 0)
+ face_type[i] = '\1';
+ else if (face_cell[i*2 + 1] > 0)
+ face_type[i] = '\2';
+ else
+ face_type[i] = '\3';
+ }
+
+ /* Also mark parallel and periodic faces as interior */
+
+ for (i = 0; i < mesh->n_init_perio; i++) {
+
+ const fvm_gnum_t *p_couples = periodic_couples[i];
+
+ for (j = 0; j < n_periodic_couples[i]; j++) {
+ face_type[p_couples[j*2] - 1] = '\0';
+ face_type[p_couples[j*2 + 1] - 1] = '\0';
+ }
+
+ }
+
+ /* Now count faces of each type */
+
+ mesh->n_i_faces = 0;
+ mesh->n_b_faces = 0;
+ mesh->i_face_vtx_connect_size = 0;
+ mesh->b_face_vtx_connect_size = 0;
+
+ for (i = 0; i < n_faces; i++) {
+ fvm_lnum_t n_f_vertices = face_vertices_idx[i+1] - face_vertices_idx[i];
+ if (face_type[i] == '\0') {
+ mesh->n_i_faces += 1;
+ mesh->i_face_vtx_connect_size += n_f_vertices;
+ }
+ else if (face_type[i] == '\1' || face_type[i] == '\2') {
+ mesh->n_b_faces += 1;
+ mesh->b_face_vtx_connect_size += n_f_vertices;
+ }
+ }
+
+ mesh->n_g_i_faces = mesh->n_i_faces;
+ mesh->n_g_b_faces = mesh->n_b_faces;
+}
+
+/*----------------------------------------------------------------------------
+ * Build internal and boundary face -> cell connectivity using a common
+ * face -> cell connectivity and a face type marker.
+ *
+ * The corresponding arrays in the mesh structure are allocated and
+ * defined by this function, and should have been previously empty.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ * n_faces <-- number of local faces
+ * face_cell <-- local face -> cell connectivity
+ * face_type <-- face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_extract_face_cell(cs_mesh_t *mesh,
+ fvm_lnum_t n_faces,
+ const fvm_lnum_t face_cell[],
+ const char face_type[])
+{
+ fvm_lnum_t i;
+
+ size_t n_i_faces = 0;
+ size_t n_b_faces = 0;
+
+ /* Allocate arrays */
+
+ BFT_MALLOC(mesh->i_face_cells, mesh->n_i_faces * 2, cs_int_t);
+ BFT_MALLOC(mesh->b_face_cells, mesh->n_b_faces, cs_int_t);
+
+ /* Now copy face -> cell connectivity */
+
+ for (i = 0; i < n_faces; i++) {
+
+ if (face_type[i] == '\0') {
+ mesh->i_face_cells[n_i_faces*2] = face_cell[i*2];
+ mesh->i_face_cells[n_i_faces*2 + 1] = face_cell[i*2 + 1];
+ n_i_faces++;
+ }
+
+ else if (face_type[i] == '\1') {
+ mesh->b_face_cells[n_b_faces] = face_cell[i*2];
+ n_b_faces++;
+ }
+
+ else if (face_type[i] == '\2') {
+ mesh->b_face_cells[n_b_faces] = face_cell[i*2 + 1];
+ n_b_faces++;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Build internal and boundary face -> vertices connectivity using a common
+ * face -> vertices connectivity and a face type marker.
+ *
+ * The corresponding arrays in the mesh structure are allocated and
+ * defined by this function, and should have been previously empty.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ * n_faces <-- number of local faces
+ * face_vertices_idx <-- local face -> vertices index
+ * face_vertices <-- local face -> vertices connectivity
+ * face_type <-- face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_extract_face_vertices(cs_mesh_t *mesh,
+ fvm_lnum_t n_faces,
+ const fvm_lnum_t face_vertices_idx[],
+ const fvm_lnum_t face_vertices[],
+ const char face_type[])
+{
+ fvm_lnum_t i;
+ size_t j;
+
+ size_t n_i_faces = 0;
+ size_t n_b_faces = 0;
+
+ /* Allocate and initialize */
+
+ BFT_MALLOC(mesh->i_face_vtx_idx, mesh->n_i_faces+1, cs_int_t);
+ BFT_MALLOC(mesh->i_face_vtx_lst, mesh->i_face_vtx_connect_size, cs_int_t);
+
+ mesh->i_face_vtx_idx[0] = 1;
+
+ BFT_MALLOC(mesh->b_face_vtx_idx, mesh->n_b_faces+1, cs_int_t);
+ mesh->b_face_vtx_idx[0] = 1;
+
+ if (mesh->n_b_faces > 0)
+ BFT_MALLOC(mesh->b_face_vtx_lst, mesh->b_face_vtx_connect_size, cs_int_t);
+
+ /* Now copy face -> vertices connectivity */
+
+ for (i = 0; i < n_faces; i++) {
+
+ size_t n_f_vertices = face_vertices_idx[i+1] - face_vertices_idx[i];
+ const fvm_lnum_t *_face_vtx = face_vertices + face_vertices_idx[i];
+
+ if (face_type[i] == '\0') {
+ fvm_lnum_t *_i_face_vtx = mesh->i_face_vtx_lst
+ + mesh->i_face_vtx_idx[n_i_faces] - 1;
+ for (j = 0; j < n_f_vertices; j++)
+ _i_face_vtx[j] = _face_vtx[j];
+ mesh->i_face_vtx_idx[n_i_faces + 1] = mesh->i_face_vtx_idx[n_i_faces]
+ + n_f_vertices;
+ n_i_faces++;
+ }
+
+ else if (face_type[i] == '\1') {
+ fvm_lnum_t *_b_face_vtx = mesh->b_face_vtx_lst
+ + mesh->b_face_vtx_idx[n_b_faces] - 1;
+ for (j = 0; j < n_f_vertices; j++)
+ _b_face_vtx[j] = _face_vtx[j];
+ mesh->b_face_vtx_idx[n_b_faces + 1] = mesh->b_face_vtx_idx[n_b_faces]
+ + n_f_vertices;
+ n_b_faces++;
+ }
+
+ else if (face_type[i] == '\2') {
+ fvm_lnum_t *_b_face_vtx = mesh->b_face_vtx_lst
+ + mesh->b_face_vtx_idx[n_b_faces] - 1;
+ for (j = 0; j < n_f_vertices; j++)
+ _b_face_vtx[j] = _face_vtx[n_f_vertices - j - 1];
+ mesh->b_face_vtx_idx[n_b_faces + 1] = mesh->b_face_vtx_idx[n_b_faces]
+ + n_f_vertices;
+ n_b_faces++;
+ }
+
+ }
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Build internal and boundary face -> global numberings using a common
+ * face group class id and a face type marker.
+ *
+ * The corresponding arrays in the mesh structure are allocated and
+ * defined by this function, and should have been previously empty.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ * n_faces <-- number of local faces
+ * global_face_num <-- global face numbers
+ * face_type <-- face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_extract_face_gnum(cs_mesh_t *mesh,
+ fvm_lnum_t n_faces,
+ const fvm_gnum_t global_face_num[],
+ const char face_type[])
+{
+ fvm_lnum_t i;
+
+ size_t n_i_faces = 0;
+ size_t n_b_faces = 0;
+
+ fvm_lnum_t *global_i_face = NULL;
+ fvm_lnum_t *global_b_face = NULL;
+
+ fvm_io_num_t *tmp_face_num = NULL;
+
+ /* Allocate arrays (including temporary arrays) */
+
+ BFT_MALLOC(mesh->global_i_face_num, mesh->n_i_faces, fvm_gnum_t);
+ BFT_MALLOC(mesh->global_b_face_num, mesh->n_b_faces, fvm_gnum_t);
+
+ BFT_MALLOC(global_i_face, mesh->n_i_faces, fvm_lnum_t);
+ BFT_MALLOC(global_b_face, mesh->n_b_faces, fvm_lnum_t);
+
+ /* Now build internal and boundary face lists */
+
+ for (i = 0; i < n_faces; i++) {
+
+ if (face_type[i] == '\0')
+ global_i_face[n_i_faces++] = i+1;
+
+ else if (face_type[i] == '\1' || face_type[i] == '\2')
+ global_b_face[n_b_faces++] = i+1;
+
+ }
+
+ /* Build an I/O numbering on internal faces to compact the global numbering */
+
+ tmp_face_num = fvm_io_num_create(global_i_face,
+ global_face_num,
+ n_i_faces,
+ 0);
+
+ memcpy(mesh->global_i_face_num,
+ fvm_io_num_get_global_num(tmp_face_num),
+ n_i_faces*sizeof(fvm_gnum_t));
+
+ mesh->n_g_i_faces = fvm_io_num_get_global_count(tmp_face_num);
+
+ assert(fvm_io_num_get_local_count(tmp_face_num) == (fvm_lnum_t)n_i_faces);
+
+ tmp_face_num = fvm_io_num_destroy(tmp_face_num);
+
+ /* Build an I/O numbering on boundary faces to compact the global numbering */
+
+ tmp_face_num = fvm_io_num_create(global_b_face,
+ global_face_num,
+ n_b_faces,
+ 0);
+
+ if (n_b_faces > 0)
+ memcpy(mesh->global_b_face_num,
+ fvm_io_num_get_global_num(tmp_face_num),
+ n_b_faces*sizeof(fvm_gnum_t));
+
+ mesh->n_g_b_faces = fvm_io_num_get_global_count(tmp_face_num);
+
+ assert(fvm_io_num_get_local_count(tmp_face_num) == (fvm_lnum_t)n_b_faces);
+
+ tmp_face_num = fvm_io_num_destroy(tmp_face_num);
+
+ /* Free remaining temporary arrays */
+
+ BFT_FREE(global_i_face);
+ BFT_FREE(global_b_face);
+}
+
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Build internal and boundary face -> group class id using a common
+ * face group class id and a face type marker.
+ *
+ * The corresponding arrays in the mesh structure are allocated and
+ * defined by this function, and should have been previously empty.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ * n_faces <-- number of local faces
+ * face_gc_id <-- local face group class id
+ * face_type <-- face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_extract_face_gc_id(cs_mesh_t *mesh,
+ fvm_lnum_t n_faces,
+ const fvm_lnum_t face_gc_id[],
+ const char face_type[])
+{
+ fvm_lnum_t i;
+
+ size_t n_i_faces = 0;
+ size_t n_b_faces = 0;
+
+ /* Allocate arrays */
+
+ BFT_MALLOC(mesh->i_face_family, mesh->n_i_faces, cs_int_t);
+ BFT_MALLOC(mesh->b_face_family, mesh->n_b_faces, cs_int_t);
+
+ /* Now copy face group class (family) id */
+
+ for (i = 0; i < n_faces; i++) {
+
+ if (face_type[i] == '\0')
+ mesh->i_face_family[n_i_faces++] = face_gc_id[i];
+
+ else if (face_type[i] == '\1' || face_type[i] == '\2')
+ mesh->b_face_family[n_b_faces++] = face_gc_id[i];
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Re-orient local periodic couples in mesh builder structure.
+ * This is probably not necessary, but allows us to build arrays
+ * identical to those produced by the preprocessor in version 1.3,
+ * so this step may be removed after sufficient testing.
+ *
+ * parameters:
+ * mesh_builder <-> pointer to mesh builder structure
+ * n_init_perio <-- number of initial periodicities
+ * i_face_cell <-- interior face->cell connectivity
+ *----------------------------------------------------------------------------*/
+
+static void
+_orient_perio_couples(cs_mesh_builder_t *mb,
+ int n_init_perio,
+ const fvm_lnum_t i_face_cell[])
+{
+ fvm_lnum_t i;
+
+ const fvm_lnum_t n_couples = mb->per_face_idx[n_init_perio];
+
+ /* In parallel mode */
+
+ if (mb->per_rank_lst != NULL) {
+
+ const int local_rank = cs_glob_rank_id + 1;
+
+ for (i = 0; i < n_couples; i++) {
+
+ if (mb->per_rank_lst[i] == local_rank) {
+
+ fvm_lnum_t inv_sgn = -1;
+ fvm_lnum_t face_num_1 = mb->per_face_lst[i*2];
+ fvm_lnum_t face_num_2 = mb->per_face_lst[i*2 + 1];
+ if (face_num_1 < 0) {
+ inv_sgn = 1;
+ face_num_1 = -face_num_1;
+ }
+
+ if (i_face_cell[(face_num_1-1)*2] == 0) {
+ assert( i_face_cell[(face_num_1-1)*2 + 1] != 0
+ && i_face_cell[(face_num_2-1)*2] != 0
+ && i_face_cell[(face_num_2-1)*2 + 1] == 0);
+ mb->per_face_lst[i*2] = face_num_2 * inv_sgn;
+ mb->per_face_lst[i*2 + 1] = face_num_1;
+ }
+ }
+ }
+ }
+
+ /* In serial mode */
+
+ else { /* if (mb->per_rank_lst == NULL) */
+
+ for (i = 0; i < n_couples; i++) {
+
+ fvm_lnum_t inv_sgn = -1;
+ fvm_lnum_t face_num_1 = mb->per_face_lst[i*2];
+ fvm_lnum_t face_num_2 = mb->per_face_lst[i*2 + 1];
+ if (face_num_1 < 0) {
+ inv_sgn = 1;
+ face_num_1 = -face_num_1;
+ }
+
+ if (i_face_cell[(face_num_1-1)*2] == 0) {
+ mb->per_face_lst[i*2] = face_num_2 * inv_sgn;
+ mb->per_face_lst[i*2 + 1] = face_num_1;
+ }
+ }
+ }
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Extract periodic face connectivity information for mesh builder when
+ * running in parallel mode.
+ *
+ * parameters:
+ * mesh_builder <-> pointer to mesh builder structure
+ * n_init_perio <-- number of initial periodicities
+ * n_faces <-- number of local faces
+ * face_ifs <-- parallel and periodic faces interfaces set
+ * face_type <-- face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_extract_periodic_faces_g(cs_mesh_builder_t *mb,
+ int n_init_perio,
+ fvm_lnum_t n_faces,
+ const fvm_interface_set_t *face_ifs,
+ const char face_type[])
+{
+ fvm_lnum_t i;
+ int j;
+
+ fvm_lnum_t i_face_count = 0;
+ fvm_lnum_t *i_face_id = NULL;
+ fvm_lnum_t *per_face_count = NULL;
+ fvm_lnum_t *if_index = NULL;
+ fvm_lnum_t *send_num = NULL, *recv_num = NULL;
+
+ const int n_interfaces = fvm_interface_set_size(face_ifs);
+ const fvm_lnum_t tr_index_size = n_init_perio*2 + 2;
+
+ /* Allocate arrays in mesh builder (initializing per_face_idx) */
+
+ BFT_MALLOC(mb->per_face_idx, n_init_perio + 1, cs_int_t);
+
+ for (i = 0; i < n_init_perio + 1; i++)
+ mb->per_face_idx[i] = 0;
+
+ for (j = 0; j < n_interfaces; j++) {
+
+ const fvm_interface_t *face_if = fvm_interface_set_get(face_ifs, j);
+ const fvm_lnum_t *tr_index = fvm_interface_get_tr_index(face_if);
+ const int distant_rank = fvm_interface_rank(face_if);
+
+ assert(fvm_interface_get_tr_index_size(face_if) == tr_index_size);
+
+ /* Only count 1 transformation direction when corresponding
+ faces are on the same rank (in which case they appear
+ once per opposing direction transforms) */
+
+ for (i = 1; i < tr_index_size-1; i++) {
+ if ((distant_rank != cs_glob_rank_id) || (i%2 == 1))
+ mb->per_face_idx[(i-1)/2 + 1] += tr_index[i+1] - tr_index[i];
+ }
+ }
+
+ mb->per_face_idx[0] = 0;
+ for (i = 1; i < n_init_perio+1; i++)
+ mb->per_face_idx[i] += mb->per_face_idx[i-1];
+
+ BFT_MALLOC(mb->per_face_lst, mb->per_face_idx[n_init_perio] * 2, cs_int_t);
+ BFT_MALLOC(mb->per_rank_lst, mb->per_face_idx[n_init_perio], cs_int_t);
+
+ /* Build face renumbering */
+
+ BFT_MALLOC(i_face_id, n_faces, fvm_lnum_t);
+
+ for (i = 0; i < n_faces; i++) {
+ if (face_type[i] == '\0')
+ i_face_id[i] = i_face_count++;
+ else
+ i_face_id[i] = -1;
+ }
+
+ /* Copy periodic interface arrays and renumber them */
+
+ BFT_MALLOC(if_index, n_interfaces + 1, fvm_lnum_t);
+ if_index[0] = 0;
+
+ for (j = 0; j < n_interfaces; j++) {
+ const fvm_interface_t *face_if = fvm_interface_set_get(face_ifs, j);
+ const fvm_lnum_t *tr_index = fvm_interface_get_tr_index(face_if);
+ if_index[j+1] = if_index[j] + tr_index[tr_index_size - 1] - tr_index[1];
+ }
+
+ BFT_MALLOC(send_num, if_index[n_interfaces], fvm_lnum_t);
+ BFT_MALLOC(recv_num, if_index[n_interfaces], fvm_lnum_t);
+
+ for (j = 0; j < n_interfaces; j++) {
+
+ fvm_lnum_t k, l;
+
+ const fvm_lnum_t start_id = if_index[j];
+ const fvm_lnum_t end_id = if_index[j+1];
+ const fvm_interface_t *face_if = fvm_interface_set_get(face_ifs, j);
+ const fvm_lnum_t *tr_index = fvm_interface_get_tr_index(face_if);
+ const fvm_lnum_t *loc_num = fvm_interface_get_local_num(face_if);
+ const int distant_rank = fvm_interface_rank(face_if);
+
+ for (k = start_id, l = tr_index[1]; k < end_id; k++, l++)
+ send_num[k] = i_face_id[loc_num[l] - 1] + 1;
+
+ if (distant_rank == cs_glob_rank_id) {
+ const fvm_lnum_t *dist_num = fvm_interface_get_distant_num(face_if);
+ for (k = start_id, l = tr_index[1]; k < end_id; k++, l++)
+ recv_num[k] = i_face_id[dist_num[l] - 1] + 1;
+ }
+ }
+
+ BFT_FREE(i_face_id);
+
+ /* Exchange local face numbers */
+
+ {
+ MPI_Request *request = NULL;
+ MPI_Status *status = NULL;
+
+ int request_count = 0;
+
+ BFT_MALLOC(request, n_interfaces*2, MPI_Request);
+ BFT_MALLOC(status, n_interfaces*2, MPI_Status);
+
+ for (j = 0; j < n_interfaces; j++) {
+ const fvm_interface_t *face_if = fvm_interface_set_get(face_ifs, j);
+ int distant_rank = fvm_interface_rank(face_if);
+ if (distant_rank != cs_glob_rank_id)
+ MPI_Irecv(recv_num + if_index[j],
+ if_index[j+1] - if_index[j],
+ FVM_MPI_LNUM,
+ distant_rank,
+ distant_rank,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+ }
+
+ for (j = 0; j < n_interfaces; j++) {
+ const fvm_interface_t *face_if = fvm_interface_set_get(face_ifs, j);
+ int distant_rank = fvm_interface_rank(face_if);
+ if (distant_rank != cs_glob_rank_id)
+ MPI_Isend(send_num + if_index[j],
+ if_index[j+1] - if_index[j],
+ FVM_MPI_LNUM,
+ distant_rank,
+ (int)cs_glob_rank_id,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+ }
+
+ MPI_Waitall(request_count, request, status);
+
+ BFT_FREE(request);
+ BFT_FREE(status);
+ }
+
+ /* Copy new interface information to mesh builder */
+
+ BFT_MALLOC(per_face_count, n_init_perio, fvm_lnum_t);
+ for (i = 0; i < n_init_perio; i++)
+ per_face_count[i] = 0;
+
+ for (j = 0; j < n_interfaces; j++) {
+
+ fvm_lnum_t tr_shift = 0;
+ const fvm_interface_t *face_if = fvm_interface_set_get(face_ifs, j);
+ const int distant_rank = fvm_interface_rank(face_if);
+ const fvm_lnum_t *tr_index = fvm_interface_get_tr_index(face_if);
+
+ for (i = 1; i < tr_index_size - 1; i++) {
+
+ fvm_lnum_t n_elts = tr_index[i+1] - tr_index[i];
+
+ if ((distant_rank != cs_glob_rank_id) || (i%2 == 1)) {
+
+ fvm_lnum_t k, l, send_shift, recv_shift;
+
+ int perio_id = (i-1)/2;
+ int perio_sgn = (i%2)*2 - 1; /* 1 for odd, -1 for even */
+ fvm_lnum_t n_dir_elts = tr_index[2*perio_id+2] - tr_index[2*perio_id+1];
+ fvm_lnum_t n_rev_elts = tr_index[2*perio_id+3] - tr_index[2*perio_id+2];
+
+ send_shift = if_index[j] + tr_shift;
+ if (distant_rank != cs_glob_rank_id) {
+ if (perio_sgn > 0)
+ recv_shift = if_index[j] + n_rev_elts + tr_shift;
+ else
+ recv_shift = if_index[j] - n_dir_elts + tr_shift;
+ }
+ else /* if (i%2 == 1) */
+ recv_shift = send_shift;
+
+ for (k = 0; k < n_elts; k++) {
+ l = mb->per_face_idx[perio_id] + per_face_count[perio_id];
+ mb->per_face_lst[l*2] = send_num[send_shift + k]*perio_sgn;
+ mb->per_face_lst[l*2 + 1] = recv_num[recv_shift + k];
+ mb->per_rank_lst[l] = distant_rank + 1;
+ per_face_count[perio_id] += 1;
+ }
+ }
+
+ tr_shift += n_elts;
+
+ } /* End of loop on tr_index */
+
+ } /* End of loop on interfaces */
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ {
+ cs_int_t perio_id;
+
+ bft_printf("\n Dump periodic data received from preprocessor\n");
+
+ for (perio_id = 0; perio_id < n_init_perio; perio_id++) {
+
+ cs_int_t start_id = mb->per_face_idx[perio_id];
+ cs_int_t end_id = mb->per_face_idx[perio_id+1];
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+
+ bft_printf("\n Perio id: %4d - Number of elements: %7d "
+ "(start: %7d - end: %7d)\n",
+ perio_id, end_id-start_id, start_id, end_id);
+ bft_printf(" id | 1st face | 2nd face | associated rank\n");
+
+ for (i = start_id; i < end_id; i++) {
+ if (cs_glob_n_ranks > 1)
+ bft_printf("%10d | %10d | %10d | %6d\n", i, mb->per_face_lst[2*i],
+ mb->per_face_lst[2*i+1], mb->per_rank_lst[i]-1);
+ else
+ bft_printf("%10d | %10d | %10d | %6d\n",
+ i, mb->per_face_lst[2*i], mb->per_face_lst[2*i+1],
+ local_rank);
+ }
+ bft_printf_flush();
+
+ }
+
+ }
+#endif
+
+ BFT_FREE(per_face_count);
+ BFT_FREE(recv_num);
+ BFT_FREE(send_num);
+ BFT_FREE(if_index);
+}
+
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Extract periodic face connectivity information for mesh builder when
+ * running in serial mode.
+ *
+ * parameters:
+ * mesh_builder <-> pointer to mesh builder structure
+ * n_init_perio <-- number of initial periodicities
+ * n_faces <-- number of local faces
+ * n_periodic_couples <-- number of periodic couples associated with
+ * each periodic list
+ * periodic_couples <-- array indicating periodic couples (using
+ * global numberings) for each list
+ * face_type <-- face type marker
+ *----------------------------------------------------------------------------*/
+
+static void
+_extract_periodic_faces_l(cs_mesh_builder_t *mb,
+ int n_init_perio,
+ fvm_lnum_t n_faces,
+ const fvm_lnum_t n_periodic_couples[],
+ const fvm_gnum_t *const periodic_couples[],
+ const char face_type[])
+{
+ int i;
+ fvm_lnum_t j;
+
+ fvm_lnum_t i_face_count = 0;
+ fvm_lnum_t *i_face_id = NULL;
+
+ /* Allocate arrays in mesh builder (initializing per_face_idx) */
+
+ BFT_MALLOC(mb->per_face_idx, n_init_perio + 1, cs_int_t);
+
+ mb->per_face_idx[0] = 0;
+ for (i = 0; i < n_init_perio; i++)
+ mb->per_face_idx[i+1] = mb->per_face_idx[i] + n_periodic_couples[i];
+
+ BFT_MALLOC(mb->per_face_lst, mb->per_face_idx[n_init_perio] * 2, cs_int_t);
+
+ /* Build face renumbering */
+
+ BFT_MALLOC(i_face_id, n_faces, fvm_lnum_t);
+
+ for (i = 0; i < n_faces; i++) {
+ if (face_type[i] == '\0')
+ i_face_id[i] = i_face_count++;
+ else
+ i_face_id[i] = -1;
+ }
+
+ /* Copy new interface information to mesh builder */
+
+ for (i = 0; i < n_init_perio; i++) {
+
+ const fvm_gnum_t *p_couples = periodic_couples[i];
+
+ for (j = 0; j < n_periodic_couples[i]; j++) {
+
+ fvm_lnum_t k = mb->per_face_idx[i] + j;
+
+ mb->per_face_lst[k*2] = i_face_id[p_couples[j*2] - 1] + 1;
+ mb->per_face_lst[k*2+1] = i_face_id[p_couples[j*2+1] - 1] + 1;
+
+ }
+
+ }
+
+ BFT_FREE(i_face_id);
+}
+
+#if defined(HAVE_MPI)
+
+#if defined(USE_SFC)
+
+/*----------------------------------------------------------------------------
+ * Compute cell centers using minimal local data.
+ *
+ * parameters:
+ * n_cells <-- number of cells
+ * n_faces <-- number of faces
+ * face_cells <-- face -> cells connectivity
+ * face_vtx_idx <-- face -> vertices connectivity index
+ * face_vtx <-- face -> vertices connectivity
+ * vtx_coord <-- vertex coordinates
+ * cell_center --> cell centers
+ *----------------------------------------------------------------------------*/
+
+static void
+_cell_center(fvm_lnum_t n_cells,
+ fvm_lnum_t n_faces,
+ const fvm_lnum_t face_cells[],
+ const fvm_lnum_t face_vtx_idx[],
+ const fvm_lnum_t face_vtx[],
+ const cs_real_t vtx_coord[],
+ fvm_coord_t cell_center[])
+{
+ fvm_lnum_t i, j;
+ fvm_lnum_t vtx_id, face_id, start_id, end_id;
+ fvm_lnum_t n_face_vertices;
+ fvm_coord_t ref_normal[3], vtx_cog[3], face_center[3];
+
+ fvm_lnum_t n_max_face_vertices = 0;
+
+ cs_point_t *face_vtx_coord = NULL;
+ fvm_coord_t *weight = NULL;
+
+ assert(face_vtx_idx[0] == 0);
+
+ BFT_MALLOC(weight, n_cells, fvm_coord_t);
+
+ for (i = 0; i < n_cells; i++) {
+ weight[i] = 0.0;
+ for (j = 0; j < 3; j++)
+ cell_center[i*3 + j] = 0.0;
+ }
+
+ /* Counting and allocation */
+
+ n_max_face_vertices = 0;
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ n_face_vertices = face_vtx_idx[face_id + 1] - face_vtx_idx[face_id];
+ if (n_max_face_vertices <= n_face_vertices)
+ n_max_face_vertices = n_face_vertices;
+ }
+
+ BFT_MALLOC(face_vtx_coord, n_max_face_vertices, cs_point_t);
+
+ /* Loop on each face */
+
+ for (face_id = 0; face_id < n_faces; face_id++) {
+
+ /* Initialization */
+
+ fvm_lnum_t tri_id;
+
+ fvm_lnum_t cell_id_0 = face_cells[face_id*2] -1;
+ fvm_lnum_t cell_id_1 = face_cells[face_id*2 + 1] -1;
+ fvm_coord_t face_surface = 0.0;
+
+ n_face_vertices = 0;
+
+ start_id = face_vtx_idx[face_id];
+ end_id = face_vtx_idx[face_id + 1];
+
+ /* Define the polygon (P) according to the vertices (Pi) of the face */
+
+ for (vtx_id = start_id; vtx_id < end_id; vtx_id++) {
+
+ fvm_lnum_t shift = 3 * (face_vtx[vtx_id] - 1);
+ for (i = 0; i < 3; i++)
+ face_vtx_coord[n_face_vertices][i] = vtx_coord[shift + i];
+ n_face_vertices++;
+
+ }
+
+ /* Compute the barycentre of the face vertices */
+
+ for (i = 0; i < 3; i++) {
+ vtx_cog[i] = 0.0;
+ for (vtx_id = 0; vtx_id < n_face_vertices; vtx_id++)
+ vtx_cog[i] += face_vtx_coord[vtx_id][i];
+ vtx_cog[i] /= n_face_vertices;
+ }
+
+ /* Loop on the triangles of the face (defined by an edge of the face
+ and its barycentre) */
+
+ for (i = 0; i < 3; i++) {
+ ref_normal[i] = 0.;
+ face_center[i] = 0.0;
+ }
+
+ for (tri_id = 0 ; tri_id < n_face_vertices ; tri_id++) {
+
+ fvm_coord_t tri_surface;
+ fvm_coord_t vect1[3], vect2[3], tri_normal[3], tri_center[3];
+
+ fvm_lnum_t id0 = tri_id;
+ fvm_lnum_t id1 = (tri_id + 1)%n_face_vertices;
+
+ /* Normal for each triangle */
+
+ for (i = 0; i < 3; i++) {
+ vect1[i] = face_vtx_coord[id0][i] - vtx_cog[i];
+ vect2[i] = face_vtx_coord[id1][i] - vtx_cog[i];
+ }
+
+ tri_normal[0] = vect1[1] * vect2[2] - vect2[1] * vect1[2];
+ tri_normal[1] = vect2[0] * vect1[2] - vect1[0] * vect2[2];
+ tri_normal[2] = vect1[0] * vect2[1] - vect2[0] * vect1[1];
+
+ if (tri_id == 0) {
+ for (i = 0; i < 3; i++)
+ ref_normal[i] = tri_normal[i];
+ }
+
+ /* Center of gravity for a triangle */
+
+ for (i = 0; i < 3; i++) {
+ tri_center[i] = ( vtx_cog[i]
+ + face_vtx_coord[id0][i]
+ + face_vtx_coord[id1][i]) / 3.0;
+ }
+
+ tri_surface = sqrt( tri_normal[0]*tri_normal[0]
+ + tri_normal[1]*tri_normal[1]
+ + tri_normal[2]*tri_normal[2]) * 0.5;
+
+ if (( tri_normal[0]*ref_normal[0]
+ + tri_normal[1]*ref_normal[1]
+ + tri_normal[2]*ref_normal[2]) < 0.0)
+ tri_surface *= -1.0;
+
+ /* Now compute contribution to face center and surface */
+
+ face_surface += tri_surface;
+
+ for (i = 0; i < 3; i++)
+ face_center[i] += tri_surface * tri_center[i];
+
+ } /* End of loop on triangles of the face */
+
+ for (i = 0; i < 3; i++)
+ face_center[i] /= face_surface;
+
+ /* Now contribute to cell centers */
+
+ assert(cell_id_0 > -2 && cell_id_1 > -2);
+
+ if (cell_id_0 > -1) {
+ for (i = 0; i < 3; i++)
+ cell_center[cell_id_0*3 + i] += face_center[i]*face_surface;
+ weight[cell_id_0] += face_surface;
+ }
+
+ if (cell_id_1 > -1) {
+ for (i = 0; i < 3; i++)
+ cell_center[cell_id_1*3 + i] += face_center[i]*face_surface;
+ weight[cell_id_1] += face_surface;
+ }
+
+ } /* End of loop on faces */
+
+ BFT_FREE(face_vtx_coord);
+
+ for (i = 0; i < n_cells; i++) {
+ for (j = 0; j < 3; j++)
+ cell_center[i*3 + j] /= weight[i];
+ }
+
+ BFT_FREE(weight);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute cell centers using block data read from file.
+ *
+ * parameters:
+ * mr <-- pointer to mesh reader helper structure
+ * cell_center --> cell centers array
+ * comm <-- associated MPI communicator
+ *----------------------------------------------------------------------------*/
+
+static void
+_precompute_cell_center(const _mesh_reader_t *mr,
+ fvm_coord_t cell_center[],
+ MPI_Comm comm)
+{
+ fvm_lnum_t i;
+ int n_ranks = 0;
+
+ fvm_datatype_t gnum_type = (sizeof(fvm_gnum_t) == 8) ? FVM_UINT64 : FVM_UINT32;
+ fvm_datatype_t real_type = (sizeof(cs_real_t) == 8) ? FVM_DOUBLE : FVM_FLOAT;
+
+ fvm_lnum_t _n_cells = 0;
+ fvm_lnum_t _n_faces = 0;
+ fvm_lnum_t _n_vertices = 0;
+
+ fvm_gnum_t *_cell_num = NULL;
+ fvm_gnum_t *_face_num = NULL;
+ fvm_gnum_t *_vtx_num = NULL;
+ fvm_gnum_t *_face_gcells = NULL;
+ fvm_gnum_t *_face_gvertices = NULL;
+
+ fvm_lnum_t *_face_cells = NULL;
+ fvm_lnum_t *_face_vertices_idx = NULL;
+ fvm_lnum_t *_face_vertices = NULL;
+
+ cs_real_t *_vtx_coord = NULL;
+
+ fvm_block_to_part_t *d = NULL;
+
+ /* Initialization */
+
+ MPI_Comm_size(comm, &n_ranks);
+
+ assert((sizeof(fvm_lnum_t) == 4) || (sizeof(fvm_lnum_t) == 8));
+
+ _n_cells = mr->cell_bi.gnum_range[1] - mr->cell_bi.gnum_range[0];
+
+ BFT_MALLOC(_cell_num, _n_cells, fvm_gnum_t);
+
+ for (i = 0; i < _n_cells; i++)
+ _cell_num[i] = mr->cell_bi.gnum_range[0] + i;
+
+ if (_n_cells == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Number of cells on rank %d is zero.\n"
+ "(number of cells / number of processes ratio too low)."),
+ (int)cs_glob_rank_id);
+
+ /* Distribute faces */
+ /*------------------*/
+
+ d = fvm_block_to_part_create_by_adj_s(comm,
+ mr->face_bi,
+ mr->cell_bi,
+ 2,
+ mr->face_cells,
+ NULL);
+
+ _n_faces = fvm_block_to_part_get_n_part_ents(d);
+
+ BFT_MALLOC(_face_gcells, _n_faces*2, fvm_gnum_t);
+
+ /* Face -> cell connectivity */
+
+ fvm_block_to_part_copy_array(d,
+ gnum_type,
+ 2,
+ mr->face_cells,
+ _face_gcells);
+
+ /* Now convert face -> cell connectivity to local cell numbers */
+
+ BFT_MALLOC(_face_cells, _n_faces*2, fvm_lnum_t);
+
+ fvm_block_to_part_global_to_local(_n_faces*2,
+ 1,
+ _n_cells,
+ _cell_num,
+ _face_gcells,
+ _face_cells);
+
+ BFT_FREE(_cell_num);
+ BFT_FREE(_face_gcells);
+
+ /* Face connectivity */
+
+ BFT_MALLOC(_face_vertices_idx, _n_faces + 1, fvm_lnum_t);
+
+ fvm_block_to_part_copy_index(d,
+ mr->face_vertices_idx,
+ _face_vertices_idx);
+
+ BFT_MALLOC(_face_gvertices, _face_vertices_idx[_n_faces], fvm_gnum_t);
+
+ fvm_block_to_part_copy_indexed(d,
+ gnum_type,
+ mr->face_vertices_idx,
+ mr->face_vertices,
+ _face_vertices_idx,
+ _face_gvertices);
+
+ _face_num = fvm_block_to_part_transfer_gnum(d);
+
+ fvm_block_to_part_destroy(&d);
+
+ /* Vertices */
+
+ d = fvm_block_to_part_create_adj(comm,
+ mr->vertex_bi,
+ _face_vertices_idx[_n_faces],
+ _face_gvertices);
+
+ _n_vertices = fvm_block_to_part_get_n_part_ents(d);
+
+ BFT_MALLOC(_vtx_coord, _n_vertices*3, cs_real_t);
+
+ fvm_block_to_part_copy_array(d,
+ real_type,
+ 3,
+ mr->vertex_coords,
+ _vtx_coord);
+
+ _vtx_num = fvm_block_to_part_transfer_gnum(d);
+
+ fvm_block_to_part_destroy(&d);
+
+ /* Now convert face -> vertex connectivity to local vertex numbers */
+
+ BFT_MALLOC(_face_vertices, _face_vertices_idx[_n_faces], fvm_lnum_t);
+
+ fvm_block_to_part_global_to_local(_face_vertices_idx[_n_faces],
+ 1,
+ _n_vertices,
+ _vtx_num,
+ _face_gvertices,
+ _face_vertices);
+
+ BFT_FREE(_face_gvertices);
+
+ _cell_center(_n_cells,
+ _n_faces,
+ _face_cells,
+ _face_vertices_idx,
+ _face_vertices,
+ _vtx_coord,
+ cell_center);
+
+ BFT_FREE(_vtx_coord);
+ BFT_FREE(_vtx_num);
+
+ BFT_FREE(_face_cells);
+
+ BFT_FREE(_face_vertices_idx);
+ BFT_FREE(_face_vertices);
+
+ BFT_FREE(_face_num);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute cell centers using block data read from file.
+ *
+ * parameters:
+ * mr <-_ pointer to mesh reader helper structure
+ * cell_rank --> cell rank
+ * comm <-- associated MPI communicator
+ *----------------------------------------------------------------------------*/
+
+static void
+_cell_rank_by_sfc(const _mesh_reader_t *mr,
+ int cell_rank[],
+ MPI_Comm comm)
+{
+ fvm_lnum_t i;
+ fvm_lnum_t n_cells = 0, block_size = 0, rank_step = 0;
+ fvm_coord_t *cell_center = NULL;
+ fvm_io_num_t *cell_io_num = NULL;
+ const fvm_gnum_t *cell_num = NULL;
+
+ n_cells = mr->cell_bi.gnum_range[1] - mr->cell_bi.gnum_range[0];
+ block_size = mr->cell_bi.block_size;
+ rank_step = mr->cell_bi.rank_step;
+
+ BFT_MALLOC(cell_center, n_cells*3, fvm_coord_t);
+
+ _precompute_cell_center(mr, cell_center, comm);
+
+ cell_io_num = fvm_io_num_create_from_coords(cell_center, 3, n_cells);
+
+ BFT_FREE(cell_center);
+
+ cell_num = fvm_io_num_get_global_num(cell_io_num);
+
+ /* Determine rank based on global numbering with SFC ordering */
+ for (i = 0; i < n_cells; i++)
+ cell_rank[i] = ((cell_num[i] - 1) / block_size) * rank_step;
+
+ cell_io_num = fvm_io_num_destroy(cell_io_num);
+}
+
+#endif /* defined(USE_SFC) */
+
+/*----------------------------------------------------------------------------
+ * Organize data read by blocks in parallel and build most mesh structures.
+ *
+ * parameters:
+ * mesh <-> pointer to mesh structure
+ * mesh_builder <-> pointer to mesh builder structure
+ * mr <-> pointer to mesh reader helper structure
+ * comm <-- associated MPI communicator
+ *----------------------------------------------------------------------------*/
+
+static void
+_decompose_data_g(cs_mesh_t *mesh,
+ cs_mesh_builder_t *mesh_builder,
+ _mesh_reader_t *mr,
+ MPI_Comm comm)
+{
+ fvm_lnum_t i;
+ int n_ranks = 0;
+
+ fvm_datatype_t lnum_type = (sizeof(fvm_lnum_t) == 8) ? FVM_INT64 : FVM_INT32;
+ fvm_datatype_t gnum_type = (sizeof(fvm_gnum_t) == 8) ? FVM_UINT64 : FVM_UINT32;
+ fvm_datatype_t real_type = (sizeof(cs_real_t) == 8) ? FVM_DOUBLE : FVM_FLOAT;
+
+ int use_cell_rank = 0;
+
+ fvm_lnum_t _n_faces = 0;
+ fvm_gnum_t *_face_num = NULL;
+ fvm_gnum_t *_face_gcells = NULL;
+ fvm_gnum_t *_face_gvertices = NULL;
+
+ fvm_lnum_t *_face_cells = NULL;
+ fvm_lnum_t *_face_gc_id = NULL;
+ fvm_lnum_t *_face_vertices_idx = NULL;
+ fvm_lnum_t *_face_vertices = NULL;
+
+ char *face_type = NULL;
+ fvm_interface_set_t *face_ifs = NULL;
+
+ fvm_block_to_part_t *d = NULL;
+
+ /* Initialization */
+
+ MPI_Comm_size(comm, &n_ranks);
+
+ assert((sizeof(fvm_lnum_t) == 4) || (sizeof(fvm_lnum_t) == 8));
+
+ /* Different handling of cells depending on whether decomposition
+ data is available or not. */
+
+ if (mr->read_cell_rank != 0)
+ use_cell_rank = 1;
+
+#if defined(USE_SFC)
+ else if (mr->read_cell_rank == 0) {
+
+ fvm_lnum_t _n_cells = mr->cell_bi.gnum_range[1] - mr->cell_bi.gnum_range[0];
+
+ BFT_MALLOC(mr->cell_rank, _n_cells, fvm_lnum_t);
+
+ _cell_rank_by_sfc(mr, mr->cell_rank, comm);
+
+ use_cell_rank = 1;
+ }
+#endif
+
+ if (use_cell_rank != 0) {
+
+ d = fvm_block_to_part_create_by_rank(comm,
+ mr->cell_bi,
+ mr->cell_rank);
+
+ mesh->n_cells = fvm_block_to_part_get_n_part_ents(d);
+
+ BFT_MALLOC(mesh->cell_family, mesh->n_cells, fvm_lnum_t);
+
+ fvm_block_to_part_copy_array(d,
+ lnum_type,
+ 1,
+ mr->cell_gc_id,
+ mesh->cell_family);
+
+ BFT_FREE(mr->cell_gc_id);
+
+ mesh->global_cell_num = fvm_block_to_part_transfer_gnum(d);
+
+ fvm_block_to_part_destroy(&d);
+
+ }
+ else {
+
+ mesh->n_cells = mr->cell_bi.gnum_range[1] - mr->cell_bi.gnum_range[0];
+
+ BFT_MALLOC(mesh->global_cell_num, mesh->n_cells, fvm_gnum_t);
+
+ for (i = 0; i < mesh->n_cells; i++)
+ mesh->global_cell_num[i] = mr->cell_bi.gnum_range[0] + i;
+
+ mesh->cell_family = mr->cell_gc_id;
+ mr->cell_gc_id = NULL;
+ }
+
+ if (mesh->n_cells == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Number of cells on rank %d is zero.\n"
+ "(number of cells / number of processes ratio too low)."),
+ (int)cs_glob_rank_id);
+
+ /* Distribute faces */
+ /*------------------*/
+
+ d = fvm_block_to_part_create_by_adj_s(comm,
+ mr->face_bi,
+ mr->cell_bi,
+ 2,
+ mr->face_cells,
+ mr->cell_rank);
+
+ BFT_FREE(mr->cell_rank); /* Not needed anymore */
+
+ _n_faces = fvm_block_to_part_get_n_part_ents(d);
+
+ BFT_MALLOC(_face_gcells, _n_faces*2, fvm_gnum_t);
+
+ /* Face -> cell connectivity */
+
+ fvm_block_to_part_copy_array(d,
+ gnum_type,
+ 2,
+ mr->face_cells,
+ _face_gcells);
+
+ BFT_FREE(mr->face_cells);
+
+ /* Now convert face -> cell connectivity to local cell numbers */
+
+ BFT_MALLOC(_face_cells, _n_faces*2, fvm_lnum_t);
+
+ fvm_block_to_part_global_to_local(_n_faces*2,
+ 1,
+ mesh->n_cells,
+ mesh->global_cell_num,
+ _face_gcells,
+ _face_cells);
+
+ BFT_FREE(_face_gcells);
+
+ /* Face family */
+
+ BFT_MALLOC(_face_gc_id, _n_faces, fvm_lnum_t);
+
+ fvm_block_to_part_copy_array(d,
+ lnum_type,
+ 1,
+ mr->face_gc_id,
+ _face_gc_id);
+
+ BFT_FREE(mr->face_gc_id);
+
+ /* Face connectivity */
+
+ BFT_MALLOC(_face_vertices_idx, _n_faces + 1, fvm_lnum_t);
+
+ fvm_block_to_part_copy_index(d,
+ mr->face_vertices_idx,
+ _face_vertices_idx);
+
+ BFT_MALLOC(_face_gvertices, _face_vertices_idx[_n_faces], fvm_gnum_t);
+
+ fvm_block_to_part_copy_indexed(d,
+ gnum_type,
+ mr->face_vertices_idx,
+ mr->face_vertices,
+ _face_vertices_idx,
+ _face_gvertices);
+
+ BFT_FREE(mr->face_vertices_idx);
+ BFT_FREE(mr->face_vertices);
+
+ _face_num = fvm_block_to_part_transfer_gnum(d);
+
+ fvm_block_to_part_destroy(&d);
+
+ /* Vertices */
+
+ d = fvm_block_to_part_create_adj(comm,
+ mr->vertex_bi,
+ _face_vertices_idx[_n_faces],
+ _face_gvertices);
+
+ mesh->n_vertices = fvm_block_to_part_get_n_part_ents(d);
+
+ BFT_MALLOC(mesh->vtx_coord, mesh->n_vertices*3, cs_real_t);
+
+ fvm_block_to_part_copy_array(d,
+ real_type,
+ 3,
+ mr->vertex_coords,
+ mesh->vtx_coord);
+
+ BFT_FREE(mr->vertex_coords);
+
+ mesh->global_vtx_num = fvm_block_to_part_transfer_gnum(d);
+
+ fvm_block_to_part_destroy(&d);
+
+ /* Now convert face -> vertex connectivity to local vertex numbers */
+
+ BFT_MALLOC(_face_vertices, _face_vertices_idx[_n_faces], fvm_lnum_t);
+
+ fvm_block_to_part_global_to_local(_face_vertices_idx[_n_faces],
+ 1,
+ mesh->n_vertices,
+ mesh->global_vtx_num,
+ _face_gvertices,
+ _face_vertices);
+
+ BFT_FREE(_face_gvertices);
+
+ /* In case of periodicity, build an fvm_interface so as to obtain
+ periodic face correspondants in local numbering (periodic couples
+ need not be defined by the ranks owning one of the 2 members
+ for the interface to be built correctly). */
+
+ face_ifs
+ = fvm_interface_set_create(_n_faces,
+ NULL,
+ _face_num,
+ mesh->periodicity,
+ mr->n_perio,
+ mr->periodicity_num,
+ mr->n_per_face_couples,
+ (const fvm_gnum_t **const)mr->per_face_couples);
+
+ /* We may now separate interior from boundary faces */
+
+ BFT_MALLOC(face_type, _n_faces, char);
+
+ _face_type_g(mesh,
+ _n_faces,
+ face_ifs,
+ _face_cells,
+ _face_vertices_idx,
+ face_type);
+
+ _extract_face_cell(mesh, _n_faces, _face_cells, face_type);
+
+ BFT_FREE(_face_cells);
+
+ if (mr->n_perio > 0) {
+
+ _extract_periodic_faces_g(mesh_builder,
+ mesh->n_init_perio,
+ _n_faces,
+ face_ifs,
+ face_type);
+
+ _orient_perio_couples(mesh_builder,
+ mesh->n_init_perio,
+ mesh->i_face_cells);
+
+ }
+
+ face_ifs = fvm_interface_set_destroy(face_ifs);
+
+ _extract_face_vertices(mesh,
+ _n_faces,
+ _face_vertices_idx,
+ _face_vertices,
+ face_type);
+
+ BFT_FREE(_face_vertices_idx);
+ BFT_FREE(_face_vertices);
+
+ _extract_face_gnum(mesh,
+ _n_faces,
+ _face_num,
+ face_type);
+
+ BFT_FREE(_face_num);
+
+ _extract_face_gc_id(mesh,
+ _n_faces,
+ _face_gc_id,
+ face_type);
+
+ BFT_FREE(_face_gc_id);
+
+ BFT_FREE(face_type);
+}
+
+#endif /* defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Organize data read locally and build most mesh structures
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * mesh_builder <-- pointer to mesh builder structure
+ * mr <-> pointer to mesh reader helper structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_decompose_data_l(cs_mesh_t *mesh,
+ cs_mesh_builder_t *mesh_builder,
+ _mesh_reader_t *mr)
+{
+ fvm_lnum_t i;
+
+ fvm_lnum_t _n_faces = 0;
+
+ fvm_lnum_t *_face_cells = NULL;
+ fvm_lnum_t *_face_vertices_idx = NULL;
+ fvm_lnum_t *_face_vertices = NULL;
+
+ char *face_type = NULL;
+
+ /* Initialization */
+
+ assert((sizeof(fvm_lnum_t) == 4) || (sizeof(fvm_lnum_t) == 8));
+
+ mesh->n_cells = mr->cell_bi.gnum_range[1] - 1;
+
+ /* Cell families are already of the correct type,
+ so they can simply be moved */
+
+ mesh->cell_family = mr->cell_gc_id;
+ mr->cell_gc_id = NULL;
+
+ /* Build faces */
+ /*-------------*/
+
+ _n_faces = mr->face_bi.gnum_range[1] - 1;
+
+ /* Now copy face -> cell connectivity to local cell numbers */
+
+ BFT_MALLOC(_face_cells, _n_faces*2, fvm_lnum_t);
+
+ for (i = 0; i < _n_faces; i++) {
+ _face_cells[i*2] = mr->face_cells[i*2];
+ _face_cells[i*2 + 1] = mr->face_cells[i*2 + 1];
+ }
+
+ BFT_FREE(mr->face_cells);
+
+ /* Face connectivity */
+
+ BFT_MALLOC(_face_vertices_idx, _n_faces + 1, fvm_lnum_t);
+
+ for (i = 0; i < _n_faces+1; i++)
+ _face_vertices_idx[i] = mr->face_vertices_idx[i];
+
+ BFT_FREE(mr->face_vertices_idx);
+
+ BFT_MALLOC(_face_vertices, _face_vertices_idx[_n_faces], fvm_lnum_t);
+
+ for (i = 0; i < _face_vertices_idx[_n_faces]; i++)
+ _face_vertices[i] = mr->face_vertices[i];
+
+ BFT_FREE(mr->face_vertices);
+
+ /* Vertices */
+
+ mesh->n_vertices = mr->vertex_bi.gnum_range[1] - 1;
+
+ mesh->vtx_coord = mr->vertex_coords;
+ mr->vertex_coords = NULL;
+
+ /* We may now separate interior from boundary faces */
+
+ BFT_MALLOC(face_type, _n_faces, char);
+
+ _face_type_l(mesh,
+ _n_faces,
+ mr->n_per_face_couples,
+ (const fvm_gnum_t **const)mr->per_face_couples,
+ _face_cells,
+ _face_vertices_idx,
+ face_type);
+
+ _extract_face_cell(mesh, _n_faces, _face_cells, face_type);
+
+ BFT_FREE(_face_cells);
+
+ if (mr->n_perio > 0) {
+
+ _extract_periodic_faces_l(mesh_builder,
+ mesh->n_init_perio,
+ _n_faces,
+ mr->n_per_face_couples,
+ (const fvm_gnum_t **const)mr->per_face_couples,
+ face_type);
+
+ _orient_perio_couples(mesh_builder,
+ mesh->n_init_perio,
+ mesh->i_face_cells);
+
+ }
+
+ _extract_face_vertices(mesh,
+ _n_faces,
+ _face_vertices_idx,
+ _face_vertices,
+ face_type);
+
+ BFT_FREE(_face_vertices_idx);
+ BFT_FREE(_face_vertices);
+
+ _extract_face_gc_id(mesh,
+ _n_faces,
+ mr->face_gc_id,
+ face_type);
+
+ BFT_FREE(mr->face_gc_id);
+
+ BFT_FREE(face_type);
+}
+
+/*============================================================================
+ * Public functions definition for API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Receive messages from the pre-processor about the dimensions of mesh
+ * parameters
+ *
+ * FORTRAN Interface:
+ *
+ * SUBROUTINE LEDEVI(NOMRUB, TYPENT, NBRENT, TABENT)
+ * *****************
+ *
+ * INTEGER NDIM : <-- : Spacial dimension (3)
+ * INTEGER NFML : <-- : Number of families (group classes)
+ * INTEGER NPRFML : <-- : Number of peroperties per family
+ * INTEGER IPERIO : <-- : Periodicity inidcator
+ * INTEGER IPEROT : <-- : Number of rotation periodicities
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(ledevi, LEDEVI)
+(
+ cs_int_t *ndim,
+ cs_int_t *nfml,
+ cs_int_t *nprfml,
+ cs_int_t *iperio,
+ cs_int_t *iperot
+)
+{
+ cs_int_t i;
+ cs_io_sec_header_t header;
+
+ fvm_gnum_t n_elts = 0;
+ cs_bool_t dim_read = false;
+ cs_bool_t end_read = false;
+ cs_io_t *pp_in = cs_glob_pp_io;
+ cs_mesh_t *mesh = cs_glob_mesh;
+ _mesh_reader_t *mr = NULL;
+
+ const char *unexpected_msg = N_("Message of type <%s> on <%s>\n"
+ "unexpected or of incorrect size");
+
+ /* Initialize parameter values */
+
+ *ndim = 3;
+ *nfml = 0;
+ *nprfml = 0;
+
+ mr = _mesh_reader_create();
+
+ _cs_glob_mesh_reader = mr;
+
+ /* Loop on read sections */
+
+ while (end_read == false) {
+
+ /* Receive headers and clen header names */
+
+ cs_io_read_header(pp_in, &header);
+
+ /* Treatment according to the header name */
+
+ if (strncmp(header.sec_name, "EOF", CS_IO_NAME_LEN)
+ == 0) {
+ cs_io_finalize(&pp_in);
+ pp_in = NULL;
+ }
+
+ if (strncmp(header.sec_name, "start_block:dimensions",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read == false)
+ dim_read = true;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+
+ }
+ else if (strncmp(header.sec_name, "end_block:dimensions",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read == true) {
+ dim_read = false;
+ end_read = true;
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+
+ }
+
+ /* Receive dimensions from the pre-processor */
+
+ else if (strncmp(header.sec_name, "ndim",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else
+ cs_io_read_global(&header, (void *) &(mesh->dim), pp_in);
+
+ }
+ else if (strncmp(header.sec_name, "n_cells",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_gnum(&header, pp_in);
+ cs_io_read_global(&header, &(mesh->n_g_cells), pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "n_faces",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_gnum(&header, pp_in);
+ cs_io_read_global(&header, &(mr->n_g_faces), pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "n_vertices",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_gnum(&header, pp_in);
+ cs_io_read_global(&header, &(mesh->n_g_vertices), pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "face_vertices_size",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_gnum(&header, pp_in);
+ cs_io_read_global(&header, &(mr->n_g_face_connect_size), pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "n_group_classes",
+ CS_IO_NAME_LEN) == 0) {
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else
+ cs_io_read_global(&header, (void *) &(mesh->n_families), pp_in);
+
+ }
+ else if (strncmp(header.sec_name, "n_group_class_props_max",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else
+ cs_io_read_global(&header,
+ (void *) &(mesh->n_max_family_items), pp_in);
+
+ }
+ else if (strncmp(header.sec_name, "n_groups",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else
+ cs_io_read_global(&header, (void *) &(mesh->n_groups), pp_in);
+
+ }
+ else if (strncmp(header.sec_name, "group_name_index",
+ CS_IO_NAME_LEN) == 0) {
+
+ if ((cs_int_t)header.n_vals != mesh->n_groups + 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ BFT_MALLOC(mesh->group_idx, mesh->n_groups + 1, cs_int_t);
+ cs_io_read_global(&header, (void *) mesh->group_idx, pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "group_name",
+ CS_IO_NAME_LEN) == 0) {
+
+ if ( mesh->group_idx == NULL
+ || (cs_int_t)header.n_vals != mesh->group_idx[mesh->n_groups] - 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ BFT_MALLOC(mesh->group_lst, header.n_vals + 1, char);
+ cs_io_read_global(&header, (void *) mesh->group_lst, pp_in);
+ }
+
+ }
+ else if ( strncmp(header.sec_name, "group_class_properties",
+ CS_IO_NAME_LEN) == 0
+ || strncmp(header.sec_name, "iprfml",
+ CS_IO_NAME_LEN) == 0) {
+
+ n_elts = mesh->n_families * mesh->n_max_family_items;
+ if (dim_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ BFT_MALLOC(mesh->family_item, n_elts, cs_int_t);
+ cs_io_read_global(&header, (void *) mesh->family_item, pp_in);
+ }
+
+ }
+
+ /* Additional messages for periodicity. Dimensions for periodic ghost
+ cells have been received before. Here we allocate parameter list
+ for periodicities and coupled face list for halo builder. */
+
+ else if (strncmp(header.sec_name, "n_periodic_directions",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_read_global(&header, (void *) &(mesh->n_init_perio), pp_in);
+
+ assert(mesh->n_init_perio > 0);
+
+ *iperio = 1;
+ mesh->periodicity = fvm_periodicity_create(0.001);
+
+ BFT_MALLOC(mr->periodicity_num, mesh->n_init_perio, int);
+ BFT_MALLOC(mr->n_per_face_couples, mesh->n_init_perio, fvm_lnum_t);
+ BFT_MALLOC(mr->n_g_per_face_couples, mesh->n_init_perio, fvm_gnum_t);
+ BFT_MALLOC(mr->per_face_couples, mesh->n_init_perio, fvm_gnum_t *);
+
+ mr->n_perio = mesh->n_init_perio;
+
+ for (i = 0; i < mesh->n_init_perio; i++) {
+ mr->periodicity_num[i] = i+1;
+ mr->n_per_face_couples[i] = 0;
+ mr->n_g_per_face_couples[i] = 0;
+ mr->per_face_couples[i] = NULL;
+ }
+ }
+
+ }
+ else if (strncmp(header.sec_name, "n_periodic_rotations",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (dim_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_read_global(&header, (void *) iperot, pp_in);
+ if (*iperot > 0)
+ mesh->have_rotation_perio = 1;
+ }
+
+ }
+ else if (strncmp(header.sec_name, "n_periodic_faces",
+ CS_IO_NAME_LEN) == 0) {
+
+ if ((cs_int_t)header.n_vals != mesh->n_init_perio)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_gnum(&header, pp_in);
+ cs_io_read_global(&header, mr->n_g_per_face_couples, pp_in);
+ for (i = 0; i < mesh->n_init_perio; i++)
+ mr->n_g_per_face_couples[i] /= 2;
+ }
+
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+
+ } /* End of test on headers */
+
+ /* Return values */
+
+ *ndim = mesh->dim;
+ *nfml = mesh->n_families;
+ *nprfml = mesh->n_max_family_items;
+
+ mesh->n_domains = cs_glob_n_ranks;
+ mesh->domain_num = cs_glob_rank_id + 1;
+
+ /* Update data in cs_mesh_t structure in serial mode */
+
+ if (cs_glob_n_ranks == 1) {
+ mesh->n_cells = mesh->n_g_cells;
+ mesh->n_cells_with_ghosts = mesh->n_cells;
+ mesh->domain_num = 1;
+ }
+ else
+ mesh->domain_num = cs_glob_rank_id + 1;
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Read pre-processor mesh data and finalize input.
+ *
+ * parameters:
+ * mesh <-- pointer to mesh structure
+ * mesh_builder <-- pointer to mesh builder structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_preprocessor_data_read_mesh(cs_mesh_t *mesh,
+ cs_mesh_builder_t *mesh_builder)
+{
+ cs_int_t perio_id, perio_type;
+ cs_io_sec_header_t header;
+
+ cs_real_t perio_matrix[3][4];
+
+ cs_int_t perio_num = -1;
+ fvm_gnum_t n_elts = 0;
+ fvm_gnum_t face_vertices_idx_shift = 0;
+ cs_bool_t end_read = false;
+ cs_bool_t data_read = false;
+ long echo = CS_IO_ECHO_OPEN_CLOSE;
+ cs_io_t *pp_in = cs_glob_pp_io;
+ _mesh_reader_t *mr = _cs_glob_mesh_reader;
+
+ const char *unexpected_msg = N_("Section of type <%s> on <%s>\n"
+ "inexpected or of incorrect size.");
+
+ echo = cs_io_get_echo(pp_in);
+
+ _set_block_ranges(mesh, mr);
+
+ /* Loop on sections read */
+
+ while (end_read == false) {
+
+ /* Receive header and clean header name */
+
+ cs_io_read_header(pp_in, &header);
+
+ /* Process according to the header name */
+
+ if (strncmp(header.sec_name, "EOF", CS_IO_NAME_LEN)
+ == 0) {
+ cs_io_finalize(&pp_in);
+ pp_in = NULL;
+ }
+
+ if (strncmp(header.sec_name, "start_block:data",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (data_read == false)
+ data_read = true;
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+
+ }
+ else if (strncmp(header.sec_name, "end_block:data",
+ CS_IO_NAME_LEN) == 0) {
+
+ if (data_read == true) {
+ data_read = false;
+ end_read = true;
+ }
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+
+ }
+
+ /* Read data from the pre-processor output file */
+
+ else if (strncmp(header.sec_name, "face_cells",
+ CS_IO_NAME_LEN) == 0) {
+
+ n_elts = mr->n_g_faces * 2;
+ if (data_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_gnum(&header, pp_in);
+ if (mr->face_bi.gnum_range[0] > 0)
+ n_elts = (mr->face_bi.gnum_range[1] - mr->face_bi.gnum_range[0])*2;
+ BFT_MALLOC(mr->face_cells, n_elts, fvm_gnum_t);
+ assert(header.n_location_vals == 2);
+ cs_io_read_block(&header,
+ mr->face_bi.gnum_range[0],
+ mr->face_bi.gnum_range[1],
+ mr->face_cells, pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "cell_group_class_id",
+ CS_IO_NAME_LEN) == 0) {
+
+ n_elts = mesh->n_g_cells;
+ if (data_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_lnum(&header, pp_in);
+ if (mr->cell_bi.gnum_range[0] > 0)
+ n_elts = mr->cell_bi.gnum_range[1] - mr->cell_bi.gnum_range[0];
+ BFT_MALLOC(mr->cell_gc_id, n_elts, cs_int_t);
+ cs_io_read_block(&header,
+ mr->cell_bi.gnum_range[0],
+ mr->cell_bi.gnum_range[1],
+ mr->cell_gc_id, pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "face_group_class_id",
+ CS_IO_NAME_LEN) == 0) {
+
+ n_elts = mr->n_g_faces;
+ if (data_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ cs_io_set_fvm_lnum(&header, pp_in);
+ if (mr->face_bi.gnum_range[0] > 0)
+ n_elts = mr->face_bi.gnum_range[1] - mr->face_bi.gnum_range[0];
+ BFT_MALLOC(mr->face_gc_id, n_elts, cs_int_t);
+ cs_io_read_block(&header,
+ mr->face_bi.gnum_range[0],
+ mr->face_bi.gnum_range[1],
+ mr->face_gc_id, pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "face_vertices_index",
+ CS_IO_NAME_LEN) == 0) {
+
+ n_elts = mr->n_g_faces + 1;
+ if (data_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ fvm_gnum_t *_g_face_vertices_idx;
+ cs_io_set_fvm_gnum(&header, pp_in);
+ if (mr->face_bi.gnum_range[0] > 0)
+ n_elts = mr->face_bi.gnum_range[1] - mr->face_bi.gnum_range[0] + 1;
+ BFT_MALLOC(mr->face_vertices_idx, n_elts, fvm_lnum_t);
+ BFT_MALLOC(_g_face_vertices_idx, n_elts, fvm_gnum_t);
+ cs_io_read_index_block(&header,
+ mr->face_bi.gnum_range[0],
+ mr->face_bi.gnum_range[1],
+ _g_face_vertices_idx, pp_in);
+ if (n_elts > 0) {
+ fvm_gnum_t elt_id;
+ face_vertices_idx_shift = _g_face_vertices_idx[0];
+ for (elt_id = 0; elt_id < n_elts; elt_id++)
+ mr->face_vertices_idx[elt_id]
+ = _g_face_vertices_idx[elt_id] - face_vertices_idx_shift;
+ }
+ BFT_FREE(_g_face_vertices_idx);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "face_vertices",
+ CS_IO_NAME_LEN) == 0) {
+
+ if ( data_read != true
+ || header.n_vals != mr->n_g_face_connect_size)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ size_t n_faces = mr->face_bi.gnum_range[1] - mr->face_bi.gnum_range[0];
+ cs_io_set_fvm_gnum(&header, pp_in);
+ n_elts = mr->face_vertices_idx[n_faces]
+ - mr->face_vertices_idx[0];
+ BFT_MALLOC(mr->face_vertices, n_elts, fvm_gnum_t);
+ cs_io_read_block
+ (&header,
+ mr->face_vertices_idx[0] + face_vertices_idx_shift,
+ mr->face_vertices_idx[n_faces] + face_vertices_idx_shift,
+ mr->face_vertices, pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "vertex_coords",
+ CS_IO_NAME_LEN) == 0) {
+
+ n_elts = mesh->n_g_vertices * 3;
+ if (data_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ if (mr->vertex_bi.gnum_range[0] > 0)
+ cs_io_assert_cs_real(&header, pp_in);
+ n_elts = ( mr->vertex_bi.gnum_range[1]
+ - mr->vertex_bi.gnum_range[0])*3;
+ BFT_MALLOC(mr->vertex_coords, n_elts, cs_real_t);
+ assert(header.n_location_vals == 3);
+ cs_io_read_block(&header,
+ mr->vertex_bi.gnum_range[0],
+ mr->vertex_bi.gnum_range[1],
+ mr->vertex_coords, pp_in);
+ }
+
+ }
+
+ /* Additional buffers for periodicity */
+
+ else if (strncmp(header.sec_name, "periodicity_type_",
+ strlen("periodicity_type_")) == 0) {
+
+ if (data_read != true || header.n_vals != 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ perio_num = atoi(header.sec_name + strlen("periodicity_type_"));
+ cs_io_read_global(&header, &perio_type, pp_in);
+ }
+
+ }
+ else if (strncmp(header.sec_name, "periodicity_matrix_",
+ strlen("periodicity_matrix_")) == 0) {
+
+ n_elts = 12; /* 3x4 */
+ if (data_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+ assert( perio_num
+ == atoi(header.sec_name + strlen("periodicity_matrix_")));
+ cs_io_assert_cs_real(&header, pp_in);
+ cs_io_read_global(&header, perio_matrix, pp_in);
+
+ /* Add a periodicity to mesh->periodicities */
+
+ _add_periodicity(mesh,
+ perio_type,
+ perio_num,
+ perio_matrix);
+
+ }
+
+ }
+ else if (strncmp(header.sec_name, "periodicity_faces_",
+ strlen("periodicity_faces_")) == 0) {
+
+ perio_id = atoi(header.sec_name
+ + strlen("periodicity_faces_")) - 1;
+ n_elts = mr->n_g_per_face_couples[perio_id] * 2;
+
+ if (data_read != true || header.n_vals != n_elts)
+ bft_error(__FILE__, __LINE__, 0,
+ _(unexpected_msg), header.sec_name, cs_io_get_name(pp_in));
+ else {
+
+ if ((mr->per_face_bi[perio_id]).gnum_range[0] > 0)
+ mr->n_per_face_couples[perio_id]
+ = ( (mr->per_face_bi[perio_id]).gnum_range[1]
+ - (mr->per_face_bi[perio_id]).gnum_range[0]);
+ else
+ mr->n_per_face_couples[perio_id] = 0;
+
+ cs_io_set_fvm_gnum(&header, pp_in);
+ n_elts = mr->n_per_face_couples[perio_id]*2;
+ BFT_MALLOC(mr->per_face_couples[perio_id], n_elts, fvm_gnum_t);
+ assert(header.n_location_vals == 2);
+ cs_io_read_block(&header,
+ (mr->per_face_bi[perio_id]).gnum_range[0],
+ (mr->per_face_bi[perio_id]).gnum_range[1],
+ mr->per_face_couples[perio_id],
+ pp_in);
+
+ }
+
+ }
+
+ } /* End of loop on messages */
+
+ /* Finalize pre-processor input */
+ /*------------------------------*/
+
+ if (cs_glob_pp_io != NULL) {
+ cs_io_finalize(&cs_glob_pp_io);
+ cs_glob_pp_io = NULL;
+ }
+
+ /* Read cell rank data if available */
+
+ if (cs_glob_n_ranks > 1)
+ _read_cell_rank(mesh, mr, echo);
+
+ /* Now send data to the correct rank */
+ /*-----------------------------------*/
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1)
+ _decompose_data_g(mesh,
+ mesh_builder,
+ mr,
+ cs_glob_mpi_comm);
+
+#endif
+
+ if (cs_glob_n_ranks == 1)
+ _decompose_data_l(mesh, mesh_builder, mr);
+
+ /* Free temporary memory */
+
+ _mesh_reader_destroy(&_cs_glob_mesh_reader);
+ mr = _cs_glob_mesh_reader;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_proxy_comm.c b/src/base/cs_proxy_comm.c
new file mode 100644
index 0000000..96b57ed
--- /dev/null
+++ b/src/base/cs_proxy_comm.c
@@ -0,0 +1,909 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Base communication functions for use with proxy
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+/* System and BFT headers */
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_SOCKET)
+#include <netdb.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+#include <bft_file.h>
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/* Local headers */
+
+#include "cs_base.h"
+
+#include "cs_proxy_comm.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define CS_PROXY_COMM_MAGIC_STRING "CFD_Proxy_comm_socket"
+
+#define CS_PROXY_COMM_FILE_NUM_LEN 4
+
+#define CS_PROXY_COMM_HOSTNAME_L 256
+#define CS_PROXY_COMM_NAME_L 256
+
+#define CS_PROXY_COMM_L_TYPE_NAME 2
+#define CS_PROXY_COMM_L_SEC_NUM 4
+
+/* If SSIZE_MAX is not defined by the sytem headers, we take the minimum value
+ required by POSIX (for low level reads/writes with sockets). */
+
+#if !defined(SSIZE_MAX)
+# define SSIZE_MAX 32767
+#endif
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+struct _cs_proxy_comm_t {
+
+ char *port_name; /* Port name (hostname:socket
+ for IP sockets) */
+
+#if defined(HAVE_SOCKET)
+ int socket; /* Socket number */
+#endif
+
+ cs_bool_t swap_endian; /* Force big-endian communications */
+
+ cs_proxy_comm_type_t type; /* Communicator type */
+
+ int n_sec_elts; /* Number of elements in a section
+ (for read mode) */
+};
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+cs_proxy_comm_t *_cs_glob_proxy_comm = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+#if defined(HAVE_SOCKET)
+
+/*----------------------------------------------------------------------------
+ * Read a record from an interface socket
+ *----------------------------------------------------------------------------*/
+
+static void _comm_read_sock(const cs_proxy_comm_t *comm,
+ void *rec,
+ size_t size,
+ size_t count)
+{
+ size_t start_id;
+ size_t end_id;
+ size_t n_loc;
+ size_t n_bytes;
+ ssize_t ret;
+ char *_rec = rec;
+
+ assert(rec != NULL);
+ assert(comm != NULL);
+ assert(comm->socket > -1);
+
+ n_bytes = size * count;
+
+ /* Read record from socket */
+
+ start_id = 0;
+
+ while (start_id < n_bytes) {
+
+ end_id = CS_MIN(start_id + SSIZE_MAX, n_bytes);
+ n_loc = end_id - start_id;
+
+ ret = read(comm->socket, _rec + start_id, n_loc);
+
+ if (ret < 1)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Communication %s:\n"
+ "Error receiving data through socket."),
+ comm->port_name);
+
+ start_id += ret;
+
+ }
+
+ if (comm->swap_endian == true && size > 1)
+ bft_file_swap_endian(rec, rec, size, count);
+}
+
+/*----------------------------------------------------------------------------
+ * Write a record to an interface socket
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_write_sock(const cs_proxy_comm_t *comm,
+ const void *rec,
+ size_t size,
+ size_t count)
+{
+ size_t start_id;
+ size_t end_id;
+ size_t n_loc;
+ size_t n_bytes;
+ ssize_t ret;
+
+ char *_rec_swap = NULL;
+ const char *_rec = rec;
+
+ assert(rec != NULL);
+ assert(comm != NULL);
+ assert(comm->socket > -1);
+
+ /* Determine associated size */
+
+ n_bytes = size * count;
+
+ /* Convert if "little-endian" */
+
+ if (comm->swap_endian == true && size != 1) {
+ BFT_MALLOC(_rec_swap, n_bytes, char);
+ bft_file_swap_endian(_rec_swap, rec, size, count);
+ }
+
+ /* Write record to socket */
+
+ start_id = 0;
+
+ while (start_id < n_bytes) {
+
+ end_id = CS_MIN(start_id + SSIZE_MAX, n_bytes);
+ n_loc = end_id - start_id;
+
+ if (_rec_swap == NULL)
+ ret = write(comm->socket, _rec + start_id, n_loc);
+ else
+ ret = write(comm->socket, _rec_swap + start_id, n_loc);
+
+ if (ret < 1)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Communication %s:\n"
+ "Error sending data through socket."),
+ comm->port_name);
+
+ start_id += ret;
+ }
+
+ if (_rec_swap != NULL)
+ BFT_FREE(_rec_swap);
+}
+
+/*----------------------------------------------------------------------------
+ * Close an interface socket
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_sock_disconnect(cs_proxy_comm_t *comm)
+{
+ if (close(comm->socket) != 0)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Communication %s:\n"
+ "Error closing socket."),
+ comm->port_name);
+
+ comm->socket = -1;
+}
+
+/*----------------------------------------------------------------------------
+ * Connection for socket initialization
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_sock_connect(cs_proxy_comm_t *comm)
+{
+ int port_num, id;
+
+ char *host_name = NULL;
+
+#if defined(_CS_ARCH_Linux)
+ socklen_t sock_len;
+#else
+ size_t sock_len;
+#endif
+
+ struct sockaddr_in sock_addr;
+ struct hostent *host_ent;
+
+ /* Decode comm->port_name string */
+
+ for (id = strlen(comm->port_name) - 1;
+ id > 0 && comm->port_name[id] != ':'; id--);
+
+ port_num = atoi(comm->port_name + id + 1);
+
+ BFT_MALLOC(host_name, id + 1, char);
+ strncpy(host_name, comm->port_name, id);
+ host_name[id] = '\0';
+
+ /* Establish communication with CFD_Proxy */
+ /*----------------------------------------*/
+
+ /* Create socket interface descriptor */
+
+ comm->socket = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (comm->socket == -1)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Error initializing socket communication."));
+
+ /* Prepare connection */
+
+ sock_len = sizeof(sock_addr);
+
+ memset((char *) &sock_addr, 0, sock_len);
+
+ sock_addr.sin_family = AF_INET;
+ sock_addr.sin_addr.s_addr = inet_addr(host_name);
+
+ if (sock_addr.sin_addr.s_addr == INADDR_NONE) {
+ host_ent = gethostbyname(host_name);
+
+ if (host_ent == NULL)
+ host_ent = gethostbyname("localhost");
+
+ if (host_ent == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Socket communication: host \"%s\" unknown."),
+ host_name);
+
+ memcpy(&sock_addr.sin_addr, host_ent->h_addr_list[0], host_ent->h_length);
+ }
+
+ sock_addr.sin_port = port_num;
+
+ if (comm->swap_endian == true)
+ bft_file_swap_endian((char *)&(sock_addr.sin_port),
+ (char *)&(sock_addr.sin_port),
+ sizeof(sock_addr.sin_port),
+ 1);
+
+ if (connect(comm->socket,
+ (struct sockaddr *)&sock_addr, sock_len) < 0)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Socket communication: error connecting to\n"
+ "%s (port %d)."), host_name, port_num);
+
+ /* Free temporary string */
+
+ BFT_FREE(host_name);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize a socket for communication
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_sock_handshake(cs_proxy_comm_t *comm,
+ const char *magic_string,
+ int key)
+{
+ int len = strlen(magic_string);
+ char keybuf[4] = {'\0', '\0', '\0', '\0'};
+ char *str_cmp = NULL;
+
+ /* Send key */
+
+ assert(sizeof(int) == 4 || sizeof(short) == 4);
+
+ if (sizeof(int) == 4)
+ *((int *)&keybuf) = key;
+ else if (sizeof(short) == 4)
+ *((short *)&keybuf) = key;
+
+ _comm_write_sock(comm, keybuf, 4, 1);
+
+ /* Write "magic string" */
+
+ _comm_write_sock(comm, magic_string, 1, len);
+
+ /* Read same magic string */
+
+ BFT_MALLOC(str_cmp, len + 1, char);
+
+ _comm_read_sock(comm, str_cmp, 1, len);
+ bft_printf("compare : %s\n", strcmp);
+
+ if (strncmp(str_cmp, magic_string, len))
+ bft_error(__FILE__, __LINE__, 0, _("Handshake with proxy failed."));
+
+ BFT_FREE(str_cmp);
+}
+
+#endif /* defined(HAVE_SOCKET) */
+
+/*----------------------------------------------------------------------------
+ * Establish a communicator connection
+ *
+ * parameters:
+ * port_name <-- name of server port (host:port for IP sockets)
+ * key <-- key for authentification
+ * type <-- communication type
+ *
+ * returns:
+ * pointer to initialized communicator;
+ *----------------------------------------------------------------------------*/
+
+static cs_proxy_comm_t *
+_comm_initialize(const char *port_name,
+ int key,
+ cs_proxy_comm_type_t type)
+{
+ unsigned int_endian;
+
+ int retval = 0;
+
+ cs_proxy_comm_t *comm = NULL;
+
+ BFT_MALLOC(comm, 1, cs_proxy_comm_t);
+
+ /* Initialize fields */
+
+ BFT_MALLOC(comm->port_name, strlen(port_name) + 1, char);
+ strcpy(comm->port_name, port_name);
+
+ comm->type = type;
+
+ comm->n_sec_elts = 0;
+
+ /* Test if system is big-endian */
+
+ comm->swap_endian = false; /* Use "big-endian" mode to communicate */
+
+ int_endian = 0;
+ *((char *) (&int_endian)) = '\1';
+
+ if (int_endian == 1)
+ comm->swap_endian = true;
+
+#if defined(DEBUG) && !defined(NDEBUG)
+ else {
+ int_endian = 0;
+ *((char *) (&int_endian) + sizeof(unsigned) - 1) = '\1';
+ assert (int_endian == 1);
+ }
+#endif
+
+ /* Info on interface creation */
+
+ if (comm->port_name != NULL)
+ bft_printf(_("Connecting to proxy: %s ..."), comm->port_name);
+ else
+ bft_printf(_("Connecting to proxy ..."));
+ bft_printf_flush();
+
+ /* Initialize interface */
+
+ if (type == CS_PROXY_COMM_TYPE_SOCKET) {
+
+#if defined(HAVE_SOCKET)
+
+ _comm_sock_connect(comm);
+ _comm_sock_handshake(comm, CS_PROXY_COMM_MAGIC_STRING, key);
+
+#else
+
+ bft_printf("\n");
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _("Library compiled without sockets support, so the communicator\n"
+ "type argument to cs_proxy_comm_initialize() must be different\n"
+ "from CS_PROXY_COMM_TYPE_SOCKET (%d)."),
+ (int)CS_PROXY_COMM_TYPE_SOCKET);
+
+#endif
+
+ }
+
+ if (retval == 0)
+ bft_printf("[ok]\n");
+ else {
+ BFT_FREE(comm);
+ }
+
+ bft_printf_flush();
+
+ /* End */
+
+ return comm;
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize a communicator
+ *----------------------------------------------------------------------------*/
+
+static cs_proxy_comm_t *
+_comm_finalize(cs_proxy_comm_t *comm)
+{
+ if (comm != NULL) {
+
+ bft_printf("\n");
+
+ /* Info on closing interface files */
+
+ bft_printf(_("Closing communication: %s\n"),
+ comm->port_name);
+
+#if defined(HAVE_SOCKET)
+ if (comm->socket > -1)
+ _comm_sock_disconnect(comm);
+#endif
+
+ BFT_FREE(comm->port_name);
+
+ BFT_FREE(comm);
+ }
+
+ return NULL;
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Establish a connection to a proxy.
+ *
+ * parameters:
+ * port_name <-- name of server port (host:port for IP sockets)
+ * key <-- key for authentification
+ * type <-- communication type
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_initialize(const char *port_name,
+ int key,
+ cs_proxy_comm_type_t type)
+{
+ if (cs_glob_rank_id <= 0)
+ _cs_glob_proxy_comm = _comm_initialize(port_name,
+ key,
+ type);
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize a connection to a proxy.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_finalize(void)
+{
+ if (cs_glob_rank_id <= 0)
+ _cs_glob_proxy_comm = _comm_finalize(_cs_glob_proxy_comm);
+}
+
+/*----------------------------------------------------------------------------
+ * Write a record to a proxy.
+ *
+ * parameters:
+ * rec <-- pointer to data to write
+ * size <-- size of each data element, in bytes
+ * count <-- number of data elements
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_write(const void *rec,
+ size_t size,
+ size_t count)
+{
+ cs_proxy_comm_t *comm = _cs_glob_proxy_comm;
+
+ assert(comm != NULL);
+
+#if defined(HAVE_SOCKET)
+ if (comm->socket > -1)
+ _comm_write_sock(comm, rec, size, count);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Read a record from a proxy.
+ *
+ * parameters:
+ * rec --> pointer to data to write
+ * size <-- size of each data element, in bytes
+ * count <-- number of data elements
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_read(void *rec,
+ size_t size,
+ size_t count)
+{
+ cs_proxy_comm_t *comm = _cs_glob_proxy_comm;
+
+ assert(comm != NULL);
+
+#if defined(HAVE_SOCKET)
+ if (comm->socket > -1)
+ _comm_read_sock(comm, rec, size, count);
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Send a function-relay request to a proxy.
+ *
+ * parameters:
+ * func_name <-- name of function associated with request
+ * comp_id <-- associated component id
+ * n_ints <-- number of integer arguments
+ * n_doubles <-- number of floating-point arguments
+ * n_strings <-- number of string arguments
+ * int_vals <-- integer argument values
+ * double_vals <-- floating-point argument values
+ * string_vals <-- string argument values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_proxy_comm_write_request(const char *func_name,
+ int comp_id,
+ int n_ints,
+ int n_doubles,
+ int n_strings,
+ const int int_vals[],
+ const double double_vals[],
+ const char *string_vals[])
+{
+ int i;
+ char _base_header[256];
+ char *_header = _base_header;
+
+ size_t header_size = 0;
+ size_t block_size = 256;
+
+ cs_proxy_comm_t *comm = _cs_glob_proxy_comm;
+
+ /* Compute request length, allocate if necessary */
+
+ header_size = 32 + 4 + 4*n_ints + 8*n_doubles;
+
+ for (i = 0; i < n_strings; i++)
+ header_size += strlen(string_vals[i]) + 1;
+
+ if (header_size > 256) {
+ block_size = 256*((header_size/256) + 1);
+ BFT_MALLOC(_header, block_size, char);
+ }
+
+ /* Form request header */
+
+ memset(_header, 0, block_size);
+
+ strncpy(_header, func_name, 32);
+
+ /* Pack integer values */
+
+#if (_CS_STDC_VERSION < 199901L)
+
+ assert(sizeof(int) == 4);
+
+ {
+ int *_val_p;
+
+ _val_p = (int *)(_header + 32);
+ *_val_p = comp_id;
+ _val_p = (int *)(_header + 36);
+ *_val_p = header_size;
+ _val_p = (int *)(_header + 40);
+ *_val_p = n_ints;
+ _val_p = (int *)(_header + 44);
+ *_val_p = n_doubles;
+ _val_p = (int *)(_header + 48);
+ *_val_p = n_strings;
+
+ header_size = 52; /* 32 + 5*4 */
+
+ for (i = 0; i < n_ints; i++) {
+ _val_p = (int *)(_header + header_size);
+ *_val_p = int_vals[i];
+ header_size += 4;
+ }
+ }
+
+#else
+
+ {
+ int32_t *_val_p;
+
+ _val_p = (int32_t *)(_header + 32);
+ *_val_p = comp_id;
+ _val_p = (int32_t *)(_header + 36);
+ *_val_p = header_size;
+ _val_p = (int32_t *)(_header + 40);
+ *_val_p = n_ints;
+ _val_p = (int32_t *)(_header + 44);
+ *_val_p = n_doubles;
+ _val_p = (int32_t *)(_header + 48);
+ *_val_p = n_strings;
+
+ header_size = 52; /* 32 + 5*4 */
+
+ for (i = 0; i < n_ints; i++) {
+ _val_p = (int32_t *)(_header + header_size);
+ *_val_p = int_vals[i];
+ header_size += 4;
+ }
+ }
+
+#endif
+
+ if (comm->swap_endian == true)
+ bft_file_swap_endian(_header+32, _header+32, 4, (header_size - 32)/4);
+
+ /* Pack double values (in C99, int32_t could avoid the sizeof() condition) */
+
+ assert(sizeof(double) == 8);
+
+ {
+ int header_size_start = header_size;
+ double *_val_p;
+
+ for (i = 0; i < n_doubles; i++) {
+ _val_p = (double *)(_header + header_size);
+ *_val_p = double_vals[i];
+ header_size += 8;
+ }
+
+ if (comm->swap_endian == true)
+ bft_file_swap_endian(_header + header_size_start,
+ _header + header_size_start,
+ 8,
+ (header_size - header_size_start)/8);
+
+ }
+
+ /* Pack strings */
+
+ for (i = 0; i < n_strings; i++) {
+
+ strcpy(_header + header_size, string_vals[i]);
+ header_size += strlen(string_vals[i]);
+ _header[header_size] = '\0';
+
+ }
+
+ /* Write message */
+
+ cs_proxy_comm_write(_header, 1, block_size);
+
+ /* Free allocated memory */
+
+ if (_header != _base_header)
+ BFT_FREE(_header);
+}
+
+/*----------------------------------------------------------------------------
+ * Read a function-relay response from a proxy.
+ *
+ * Return value arrays must be large enough to receive all values.
+ *
+ * parameters:
+ * n_ints <-- number of integer arguments
+ * n_doubles <-- number of floating-point arguments
+ * n_strings <-- number of string arguments
+ * int_vals --> integer argument values
+ * double_vals --> floating-point argument values
+ * string_vals --> string argument values
+ *
+ * returns:
+ * the relayed function's return value
+ *----------------------------------------------------------------------------*/
+
+int
+cs_proxy_comm_read_response(int n_ints,
+ int n_doubles,
+ int n_strings,
+ int int_vals[],
+ double double_vals[],
+ char *string_vals[])
+{
+ int i;
+ char _base_header[256];
+ char *_header = _base_header;
+
+ size_t header_size = 0;
+ size_t header_pos = 0;
+ size_t block_size = 256;
+
+ int retval = 0;
+
+ cs_proxy_comm_t *comm = _cs_glob_proxy_comm;
+
+ /* Read initial part of message */
+
+ cs_proxy_comm_read(_header, 1, block_size);
+
+ /* Unpack base info (return code, header_size, n_args/type) */
+
+ if (comm->swap_endian == true)
+ bft_file_swap_endian(_header, _header, 4, 5);
+
+#if (_CS_STDC_VERSION < 199901L)
+
+ assert(sizeof(int) == 4);
+
+ {
+ int *_val_p;
+
+ _val_p = (int *)(_header);
+ retval = *_val_p;
+ _val_p = (int *)(_header + 4);
+ header_size = *_val_p;
+ _val_p = (int *)(_header + 8);
+ n_ints = *_val_p;
+ _val_p = (int *)(_header + 12);
+ n_doubles = *_val_p;
+ _val_p = (int *)(_header + 16);
+ n_strings = *_val_p;
+ }
+
+#else
+
+ {
+ int32_t *_val_p;
+
+ _val_p = (int32_t *)(_header);
+ retval = *_val_p;
+ _val_p = (int32_t *)(_header + 4);
+ header_size = *_val_p;
+ _val_p = (int32_t *)(_header + 8);
+ n_ints = *_val_p;
+ _val_p = (int32_t *)(_header + 12);
+ n_doubles = *_val_p;
+ _val_p = (int32_t *)(_header + 16);
+ n_strings = *_val_p;
+ }
+
+#endif
+
+ if (header_size > 256) {
+ block_size = 256*((header_size/256) + 1);
+ BFT_MALLOC(_header, block_size, char);
+ memcpy(_header, _base_header, 256);
+ cs_proxy_comm_read(_header+256, 1, block_size-256);
+ }
+
+ if (retval != 0) {
+ if (_header != _base_header)
+ BFT_FREE(_header);
+ return retval;
+ }
+
+ header_pos = 20; /* 5*4 */
+
+ /* Unpack integer values */
+
+ if (comm->swap_endian == true)
+ bft_file_swap_endian(_header + header_pos,
+ _header + header_pos,
+ 4,
+ n_ints);
+
+#if (_CS_STDC_VERSION < 199901L)
+
+ assert(sizeof(int) == 4);
+
+ {
+ int *_val_p;
+
+ for (i = 0; i < n_ints; i++) {
+ _val_p = (int *)(_header + header_pos);
+ int_vals[i] = *_val_p;
+ header_pos += 4;
+ }
+ }
+
+#else
+
+ {
+ int32_t *_val_p;
+
+ for (i = 0; i < n_ints; i++) {
+ _val_p = (int32_t *)(_header + header_pos);
+ int_vals[i] = *_val_p;
+ header_pos += 4;
+ }
+ }
+
+#endif
+
+ /* Unpack double values (in C99, int32_t could avoid the sizeof() condition) */
+
+ assert(sizeof(double) == 8);
+
+ if (comm->swap_endian == true)
+ bft_file_swap_endian(_header + header_pos,
+ _header + header_pos,
+ 8,
+ n_doubles);
+
+ {
+ double *_val_p;
+
+ for (i = 0; i < n_doubles; i++) {
+ _val_p = (double *)(_header + header_pos);
+ double_vals[i] = *_val_p;
+ header_pos += 8;
+ }
+ }
+
+ /* Unpack strings */
+
+ for (i = 0; i < n_strings; i++) {
+ strcpy(string_vals[i], _header + header_pos);
+ header_pos += strlen(string_vals[i]) + 1;
+ }
+
+ /* Free allocated memory */
+
+ if (_header != _base_header)
+ BFT_FREE(_header);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_renumber.c b/src/base/cs_renumber.c
new file mode 100644
index 0000000..55e2893
--- /dev/null
+++ b/src/base/cs_renumber.c
@@ -0,0 +1,929 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Optional mesh renumbering
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_defs.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_prototypes.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_renumber.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Redistribute scalar values in case of renubering
+ *
+ * This is the case when the mesh is read in the obsolete 'slc' format.
+ *
+ * parameters:
+ * n_elts <-- Number of elements
+ * renum <-- Pointer to renumbering array (new -> old, 1 to n)
+ * val <-> Pointer to array of vector values
+ * tmp_val <-> Working array (size n_elts)
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_elt_scalar(cs_int_t n_elts,
+ const cs_int_t *renum,
+ cs_real_t *val,
+ cs_real_t *tmp_val)
+{
+ cs_int_t elt_id, tmp_elt_id;
+
+ for (elt_id = 0; elt_id < n_elts; elt_id++) {
+ tmp_elt_id = renum[elt_id] - 1;
+ tmp_val[elt_id] = val[tmp_elt_id];
+ }
+
+ memcpy(val, tmp_val, n_elts*sizeof(cs_real_t));
+}
+
+/*----------------------------------------------------------------------------
+ * Redistribute vector values in case of renubering
+ *
+ * This is the case when the mesh is read in the obsolete 'slc' format.
+ *
+ * parameters:
+ * n_elts <-- Number of elements
+ * renum <-- Pointer to renumbering array (new -> old, 1 to n)
+ * val <-> Pointer to array of vector values
+ * tmp_val <-> Working array (size n_elts)
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_elt_vector(cs_int_t n_elts,
+ const cs_int_t *renum,
+ cs_real_t *val,
+ cs_real_t *tmp_val)
+{
+ int dim_id;
+ cs_int_t elt_id, tmp_elt_id;
+
+ for (elt_id = 0; elt_id < n_elts; elt_id++) {
+ for (dim_id = 0; dim_id < 3; dim_id++) {
+ tmp_elt_id = renum[elt_id] - 1;
+ tmp_val[elt_id*3 + dim_id] = val[tmp_elt_id*3 + dim_id];
+ }
+ }
+
+ memcpy(val, tmp_val, n_elts*3*sizeof(cs_real_t));
+}
+
+/*----------------------------------------------------------------------------
+ * Update cell quantities in case they were built before renumbering.
+ *
+ * This is the case when the mesh is read in the obsolete 'slc' format.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ * renum <-- Cells renumbering array (new -> old)
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_cell_quantities(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities,
+ const cs_int_t *renum)
+{
+ cs_real_t *tmp_val = NULL;
+
+ if (mesh == NULL && mesh_quantities == NULL)
+ return;
+
+ /* Allocate Work arrays */
+
+ BFT_MALLOC(tmp_val, mesh->n_cells*3, cs_real_t);
+
+ /* Cells */
+
+ if (renum != NULL) {
+
+ if (mesh_quantities->cell_cen != NULL)
+ _update_elt_vector(mesh->n_cells,
+ renum,
+ mesh_quantities->cell_cen,
+ tmp_val);
+
+ if (mesh_quantities->cell_vol != NULL)
+ _update_elt_scalar(mesh->n_cells,
+ renum,
+ mesh_quantities->cell_vol,
+ tmp_val);
+
+ }
+
+ /* Free Work array */
+
+ BFT_FREE(tmp_val);
+}
+
+/*----------------------------------------------------------------------------
+ * Update face quantities in case they were build before renumbering.
+ *
+ * This is the case when the mesh is read in the obsolete 'slc' format.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ * renum_i <-- Interior faces renumbering array (new -> old)
+ * renum_b <-- Boundary faces renumbering array (new -> old)
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_face_quantities(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities,
+ const cs_int_t *renum_i,
+ const cs_int_t *renum_b)
+{
+ cs_real_t *tmp_val = NULL;
+ cs_int_t n_val_max = CS_MAX(mesh->n_i_faces, mesh->n_b_faces) * 3;
+
+ if (mesh == NULL && mesh_quantities == NULL)
+ return;
+
+ /* Allocate Work arrays */
+
+ BFT_MALLOC(tmp_val, n_val_max, cs_real_t);
+
+ /* Interior faces */
+
+ if (renum_i != NULL) {
+
+ if (mesh_quantities->i_face_normal != NULL)
+ _update_elt_vector(mesh->n_i_faces,
+ renum_i,
+ mesh_quantities->i_face_normal,
+ tmp_val);
+
+ if (mesh_quantities->i_face_cog != NULL)
+ _update_elt_vector(mesh->n_i_faces,
+ renum_i,
+ mesh_quantities->i_face_cog,
+ tmp_val);
+
+ }
+
+ /* Boundary Faces */
+
+ if (renum_b != NULL) {
+
+ if (mesh_quantities->b_face_normal != NULL)
+ _update_elt_vector(mesh->n_b_faces,
+ renum_b,
+ mesh_quantities->b_face_normal,
+ tmp_val);
+
+ if (mesh_quantities->b_face_cog != NULL)
+ _update_elt_vector(mesh->n_b_faces,
+ renum_b,
+ mesh_quantities->b_face_cog,
+ tmp_val);
+
+ }
+
+ /* Free Work arrays */
+
+ BFT_FREE(tmp_val);
+}
+
+/*----------------------------------------------------------------------------
+ * Redistribute family (group class) ids in case of renubering
+ *
+ * This is the case when the mesh is read in the obsolete 'slc' format.
+ *
+ * parameters:
+ * n_elts <-- Number of elements
+ * renum <-- Pointer to renumbering array (new -> old, 1 to n)
+ * family <-> Pointer to array of family ids (or NULL)
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_family(cs_int_t n_elts,
+ const cs_int_t *renum,
+ cs_int_t *family)
+{
+ cs_int_t ii;
+ cs_int_t *old_family;
+
+ if (family == NULL)
+ return;
+
+ BFT_MALLOC(old_family, n_elts, cs_int_t);
+
+ memcpy(old_family, family, n_elts*sizeof(cs_int_t));
+
+ for (ii = 0; ii < n_elts; ii++)
+ family[ii] = old_family[renum[ii] - 1];
+
+ BFT_FREE(old_family);
+}
+
+/*----------------------------------------------------------------------------
+ * Update a global numbering array in case of entity renumbering
+ *
+ * parameters:
+ * n_elts --> number of elements in array
+ * init_num --> initial local number of renumbered elements (1 to n)
+ * global_num <-> global numbering (allocated if initially NULL)
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_global_num(size_t n_elts,
+ const fvm_lnum_t init_num[],
+ fvm_gnum_t **global_num)
+{
+ size_t i;
+ fvm_gnum_t *_global_num = *global_num;
+
+ if (_global_num == NULL) {
+
+ BFT_MALLOC(_global_num, n_elts, fvm_gnum_t);
+
+ for (i = 0; i < n_elts; i++)
+ _global_num[i] = init_num[i];
+
+ *global_num = _global_num;
+ }
+
+ else {
+
+ fvm_gnum_t *tmp_global;
+
+ BFT_MALLOC(tmp_global, n_elts, fvm_gnum_t);
+ memcpy(tmp_global, _global_num, n_elts*sizeof(fvm_gnum_t));
+
+ for (i = 0; i < n_elts; i++)
+ _global_num[i] = tmp_global[init_num[i] - 1];
+
+ BFT_FREE(tmp_global);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Apply renumbering of cells.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ * renum <-- Cells renumbering array (new -> old)
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_renumber_update_cells(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities,
+ const cs_int_t *renum)
+{
+ cs_int_t ii, jj, kk, face_id, n_vis, start_id, start_id_old;
+
+ cs_int_t *face_cells_tmp = NULL;
+ cs_int_t *new_cell_id = NULL;
+
+ cs_int_t face_cells_max_size = CS_MAX(mesh->n_i_faces*2, mesh->n_b_faces);
+ const cs_int_t n_cells = mesh->n_cells;
+
+ /* If no renumbering is present, return */
+
+ if (renum == NULL)
+ return;
+
+ /* Allocate Work arrays */
+
+ BFT_MALLOC(face_cells_tmp, face_cells_max_size, cs_int_t);
+ BFT_MALLOC(new_cell_id, mesh->n_cells_with_ghosts, cs_int_t);
+
+ /* Build old -> new renumbering (1 to n) */
+
+ for (ii = 0; ii < n_cells; ii++)
+ new_cell_id[renum[ii] - 1] = ii;
+
+ for (ii = n_cells; ii < mesh->n_cells_with_ghosts; ii++)
+ new_cell_id[ii] = ii;
+
+ /* Update halo connectivity */
+
+ if (mesh->halo != NULL)
+ cs_halo_renumber_cells(mesh->halo, new_cell_id);
+
+ /* Update faces -> cells connectivity */
+
+ memcpy(face_cells_tmp,
+ mesh->i_face_cells,
+ mesh->n_i_faces * 2 * sizeof(cs_int_t));
+
+ for (face_id = 0; face_id < mesh->n_i_faces; face_id++) {
+ ii = face_cells_tmp[face_id*2] - 1;
+ jj = face_cells_tmp[face_id*2 + 1] - 1;
+ mesh->i_face_cells[face_id*2] = new_cell_id[ii] + 1;
+ mesh->i_face_cells[face_id*2 + 1] = new_cell_id[jj] + 1;
+ }
+
+ if (mesh->n_b_faces > 0) {
+
+ memcpy(face_cells_tmp,
+ mesh->b_face_cells,
+ mesh->n_b_faces * sizeof(cs_int_t));
+
+ for (face_id = 0; face_id < mesh->n_b_faces; face_id++) {
+ ii = face_cells_tmp[face_id] - 1;
+ mesh->b_face_cells[face_id] = new_cell_id[ii] + 1;
+ }
+ }
+
+ /* Update cell -> cells connectivity for extended neighborhood */
+
+ if (mesh->cell_cells_lst != NULL) {
+
+ cs_int_t *cell_cells_idx_old, *cell_cells_lst_old;
+ const cs_int_t cell_cells_lst_size = mesh->cell_cells_idx[n_cells] - 1;
+
+ BFT_MALLOC(cell_cells_idx_old, n_cells + 1, cs_int_t);
+ BFT_MALLOC(cell_cells_lst_old, cell_cells_lst_size, cs_int_t);
+
+ memcpy(cell_cells_idx_old,
+ mesh->cell_cells_idx,
+ (n_cells + 1)*sizeof(cs_int_t));
+ memcpy(cell_cells_lst_old,
+ mesh->cell_cells_lst,
+ cell_cells_lst_size*sizeof(cs_int_t));
+
+ mesh->cell_cells_idx[0] = 1;
+ start_id = 0;
+
+ for (ii = 0; ii < n_cells; ii++) {
+
+ jj = renum[ii] - 1;
+ n_vis = cell_cells_idx_old[jj+1] - cell_cells_idx_old[jj];
+ start_id_old = cell_cells_idx_old[jj] - 1;
+
+ for (kk = 0; kk < n_vis; kk++)
+ mesh->cell_cells_lst[start_id + kk]
+ = new_cell_id[cell_cells_lst_old[start_id_old + kk] - 1] + 1;
+
+ start_id += n_vis;
+ mesh->cell_cells_idx[ii + 1] = start_id + 1;
+ }
+ }
+
+ /* Free work arrays */
+
+ BFT_FREE(new_cell_id);
+ BFT_FREE(face_cells_tmp);
+
+ /* Update cell families and global numbering */
+
+ _update_family(n_cells, renum, mesh->cell_family);
+
+ _update_global_num(n_cells, renum, &(mesh->global_cell_num));
+
+ /* Update cell quantities if present */
+
+ _update_cell_quantities(mesh, mesh_quantities, renum);
+
+ /* Update parent cell numbers for post-processing meshes
+ that may already have been built; Post-processing meshes
+ built after renumbering will have correct parent numbers */
+
+ cs_post_renum_cells(renum);
+}
+
+/*----------------------------------------------------------------------------
+ * Apply renumbering to a face -> vertices connectivity.
+ *
+ * parameters:
+ * n_faces <-- Number of faces
+ * face_vtx_idx <-> Face -> vertices index (1 to n)
+ * face_vtx <-- Face vertices
+ * renum <-- Faces renumbering array (new -> old)
+ *----------------------------------------------------------------------------*/
+
+static void
+_update_face_vertices(cs_int_t n_faces,
+ cs_int_t *face_vtx_idx,
+ cs_int_t *face_vtx,
+ const cs_int_t *renum)
+{
+ if (renum != NULL && face_vtx != NULL) {
+
+ cs_int_t ii, jj, kk, n_vtx, start_id, start_id_old;
+ cs_int_t *face_vtx_idx_old, *face_vtx_old;
+
+ const cs_int_t connect_size = face_vtx_idx[n_faces] - 1;
+
+ BFT_MALLOC(face_vtx_idx_old, n_faces + 1, cs_int_t);
+ BFT_MALLOC(face_vtx_old, connect_size, cs_int_t);
+
+ memcpy(face_vtx_idx_old, face_vtx_idx, (n_faces+1)*sizeof(int));
+ memcpy(face_vtx_old, face_vtx, connect_size*sizeof(int));
+
+ face_vtx_idx[0] = 1;
+ start_id = 0;
+
+ for (ii = 0; ii < n_faces; ii++) {
+
+ jj = renum[ii] - 1;
+ n_vtx = face_vtx_idx_old[jj+1] - face_vtx_idx_old[jj];
+ start_id_old = face_vtx_idx_old[jj] - 1;
+
+ for (kk = 0; kk < n_vtx; kk++)
+ face_vtx[start_id + kk] = face_vtx_old[start_id_old + kk];
+
+ start_id += n_vtx;
+ face_vtx_idx[ii + 1] = start_id + 1;
+ }
+
+ BFT_FREE(face_vtx_idx_old);
+ BFT_FREE(face_vtx_old);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Apply renumbering of faces.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ * renum_i <-- Interior faces renumbering array (new -> old)
+ * renum_b <-- Boundary faces renumbering array (new -> old)
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_renumber_update_faces(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities,
+ const cs_int_t *renum_i,
+ const cs_int_t *renum_b)
+{
+ cs_int_t face_id, face_id_old;
+
+ cs_int_t *face_cells_old = NULL;
+
+ const cs_int_t n_i_faces = mesh->n_i_faces;
+ const cs_int_t n_b_faces = mesh->n_b_faces;
+
+ /* Interior faces */
+
+ if (renum_i != NULL) {
+
+ /* Allocate Work array */
+
+ BFT_MALLOC(face_cells_old, n_i_faces*2, cs_int_t);
+
+ /* Update faces -> cells connectivity */
+
+ memcpy(face_cells_old, mesh->i_face_cells, n_i_faces*2*sizeof(cs_int_t));
+
+ for (face_id = 0; face_id < n_i_faces; face_id++) {
+ face_id_old = renum_i[face_id] - 1;
+ mesh->i_face_cells[face_id*2] = face_cells_old[face_id_old*2];
+ mesh->i_face_cells[face_id*2 + 1] = face_cells_old[face_id_old*2 + 1];
+ }
+
+ BFT_FREE(face_cells_old);
+
+ /* Update faces -> vertices connectivity */
+
+ _update_face_vertices(n_i_faces,
+ mesh->i_face_vtx_idx,
+ mesh->i_face_vtx_lst,
+ renum_i);
+
+ /* Update face families and global numbering */
+
+ _update_family(n_i_faces, renum_i, mesh->i_face_family);
+
+ _update_global_num(n_i_faces, renum_i, &(mesh->global_i_face_num));
+ }
+
+ /* Boundary faces */
+
+ if (renum_b != NULL) {
+
+ /* Allocate Work array */
+
+ BFT_MALLOC(face_cells_old, n_b_faces, cs_int_t);
+
+ /* Update faces -> cells connectivity */
+
+ memcpy(face_cells_old, mesh->b_face_cells, n_b_faces*sizeof(cs_int_t));
+
+ for (face_id = 0; face_id < n_b_faces; face_id++) {
+ face_id_old = renum_b[face_id] - 1;
+ mesh->b_face_cells[face_id] = face_cells_old[face_id_old];
+ }
+
+ BFT_FREE(face_cells_old);
+
+ /* Update faces -> vertices connectivity */
+
+ _update_face_vertices(n_b_faces,
+ mesh->b_face_vtx_idx,
+ mesh->b_face_vtx_lst,
+ renum_b);
+
+ /* Update face families and global numbering */
+
+ _update_family(n_b_faces, renum_b, mesh->b_face_family);
+
+ _update_global_num(n_b_faces, renum_b, &(mesh->global_b_face_num));
+ }
+
+ /* Update associated face quantities if present */
+
+ _update_face_quantities(mesh,
+ mesh_quantities,
+ renum_i,
+ renum_b);
+
+ /* Update parent face numbers for post-processing meshes
+ that may already have been built; Post-processing meshes
+ built after renumbering will have correct parent numbers */
+
+ cs_post_renum_faces(renum_i, renum_b);
+}
+
+/*----------------------------------------------------------------------------
+ * Try to apply renumbering of faces and cells for multiple threads.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_renumber_for_threads(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities)
+{
+ int update_c = 0, update_fi = 0, update_fb = 0;
+ int n_i_groups = 1, n_b_groups = 1;
+ int n_i_threads = 1, n_b_threads = 1;
+ cs_int_t *inumc = NULL, *inumfi = NULL, *inumfb = NULL;
+ fvm_lnum_t *i_group_index = NULL, *b_group_index = NULL;
+
+ /* Allocate Work arrays */
+
+ BFT_MALLOC(inumc, mesh->n_cells, cs_int_t);
+ BFT_MALLOC(inumfi, mesh->n_i_faces, cs_int_t);
+ BFT_MALLOC(inumfb, mesh->n_b_faces, cs_int_t);
+
+ /* Try renumbering */
+
+ {
+ cs_int_t ii;
+
+ for (ii = 0; ii < mesh->n_cells; ii++)
+ inumc[ii] = ii+1;
+
+ for (ii = 0; ii < mesh->n_i_faces; ii++)
+ inumfi[ii] = ii+1;
+
+ for (ii = 0; ii < mesh->n_b_faces; ii++)
+ inumfb[ii] = ii+1;
+ }
+
+ /* Only keep non-trivial renumbering arrays */
+
+ if (update_c == 0)
+ BFT_FREE(inumc);
+
+ if (update_fi == 0)
+ BFT_FREE(inumfi);
+
+ if (update_fb == 0)
+ BFT_FREE(inumfb);
+
+ /* Now update mesh */
+ /*-----------------*/
+
+ if (inumfi != NULL || inumfb != NULL)
+ _cs_renumber_update_faces(mesh,
+ mesh_quantities,
+ inumfi,
+ inumfb);
+
+ if (inumc != NULL)
+ _cs_renumber_update_cells(mesh,
+ mesh_quantities,
+ inumc);
+
+ /* Add numbering info to mesh */
+ /*----------------------------*/
+
+ /*
+ * n_threads <-- number of threads
+ * n_groups <-- number of groups
+ * group_index <-- group_index[thread_id*group_id*2 + 2*group_id] and
+ * group_index[thread_id*group_id*2 + 2*group_id +1]
+ * define the tart and end ids (+1) for entities in a
+ * given group and thread (size: n_groups *2 * n_threads)
+ */
+
+ if (n_i_groups >= 1) {
+ mesh->i_face_numbering = cs_numbering_create_threaded(n_i_threads,
+ n_i_groups,
+ i_group_index);
+ BFT_FREE(i_group_index);
+ }
+
+ if (n_b_groups >= 1) {
+ mesh->b_face_numbering = cs_numbering_create_threaded(n_b_threads,
+ n_b_groups,
+ b_group_index);
+ BFT_FREE(b_group_index);
+ }
+
+ /* Now free remaining arrays */
+
+ BFT_FREE(inumfi);
+ BFT_FREE(inumfb);
+ BFT_FREE(inumc);
+}
+
+/*----------------------------------------------------------------------------
+ * Try to apply renumbering of faces for vector machines.
+ *
+ * Renumbering can be cancelled using the IVECTI and IVECTB values in
+ * Fortan common IVECTO: -1 indicates we should try to renumber,
+ * 0 means we should not renumber. On exit, 0 means we have not found an
+ * adequate renumbering, 1 means we have (and it was applied).
+ *
+ * If the target architecture does not enable vectorization, do as if no
+ * adequate renumbering was found.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_renumber_for_vectorizing(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities)
+{
+ int _ivect[2] = {0, 0};
+ cs_int_t ivecti = 0, ivectb = 0;
+ cs_int_t *inumfi = NULL, *inumfb = NULL;
+ cs_int_t *iworkf = NULL, *ismbs = NULL;
+
+ cs_int_t n_faces_max = CS_MAX(mesh->n_i_faces, mesh->n_b_faces);
+ cs_int_t n_cells_wghosts = mesh->n_cells_with_ghosts;
+
+
+#if defined(__uxpvp__) /* For Fujitsu VPP5000 (or possibly successors) */
+
+ /* Vector register numbers and lengths:
+ * 4 4096 ;
+ * 16 1024
+ * 32 512
+ * 64 256
+ * 128 128
+ * 256 64 */
+
+ const cs_int_t vector_size = 1024; /* Use register 16 */
+
+#elif defined(SX) && defined(_SX) /* For NEC SX series */
+
+ const cs_int_t vector_size = 256; /* At least for NEC SX-9 */
+
+#else
+
+ const cs_int_t vector_size = 1; /* Non-vector machines */
+
+#endif
+
+ /* Nothing to do if vector size = 1 */
+
+ if (vector_size == 1)
+ return;
+
+ /* Allocate Work arrays */
+
+ BFT_MALLOC(inumfi, mesh->n_i_faces, cs_int_t);
+ BFT_MALLOC(inumfb, mesh->n_b_faces, cs_int_t);
+ BFT_MALLOC(iworkf, n_faces_max, cs_int_t);
+ BFT_MALLOC(ismbs, n_cells_wghosts, cs_int_t);
+
+ /* Try renumbering */
+
+ CS_PROCF(numvec, NUMVEC)(&(mesh->n_cells_with_ghosts),
+ &(mesh->n_cells),
+ &(mesh->n_i_faces),
+ &(mesh->n_b_faces),
+ &vector_size,
+ &ivecti,
+ &ivectb,
+ mesh->i_face_cells,
+ mesh->b_face_cells,
+ inumfi,
+ inumfb,
+ iworkf,
+ ismbs);
+
+ /* Free Work arrays */
+
+ BFT_FREE(ismbs);
+ BFT_FREE(iworkf);
+
+ /* Update mesh */
+
+ if (ivecti > 0 || ivectb > 0) {
+
+ cs_int_t *_inumfi = NULL;
+ cs_int_t *_inumfb = NULL;
+
+ if (ivecti > 0)
+ _inumfi = inumfi;
+ if (ivectb > 0)
+ _inumfb = inumfb;
+
+ _cs_renumber_update_faces(mesh,
+ mesh_quantities,
+ _inumfi,
+ _inumfb);
+
+ }
+
+ /* Free final work arrays */
+
+ BFT_FREE(inumfb);
+ BFT_FREE(inumfi);
+
+ /* Check renumbering (sanity check) */
+
+ if (ivecti > 0 || ivectb > 0) {
+
+ cs_int_t *ismbv = NULL;
+ cs_real_t *rworkf = NULL, *rsmbs = NULL, *rsmbv = NULL;
+
+ BFT_MALLOC(iworkf, n_faces_max, cs_int_t);
+ BFT_MALLOC(ismbs, n_cells_wghosts, cs_int_t);
+ BFT_MALLOC(ismbv, n_cells_wghosts, cs_int_t);
+ BFT_MALLOC(rworkf, n_faces_max, cs_real_t);
+ BFT_MALLOC(rsmbs, n_cells_wghosts, cs_real_t);
+ BFT_MALLOC(rsmbv, n_cells_wghosts, cs_real_t);
+
+ CS_PROCF(tstvec, TSTVEC)(&(mesh->n_cells_with_ghosts),
+ &(mesh->n_cells),
+ &(mesh->n_i_faces),
+ &(mesh->n_b_faces),
+ mesh->i_face_cells,
+ mesh->b_face_cells,
+ iworkf,
+ ismbs,
+ ismbv,
+ rworkf,
+ rsmbs,
+ rsmbv);
+
+ BFT_FREE(rsmbv);
+ BFT_FREE(rsmbs);
+ BFT_FREE(rworkf);
+ BFT_FREE(ismbv);
+ BFT_FREE(ismbs);
+ BFT_FREE(iworkf);
+ }
+
+ /* Update mesh */
+
+ if (ivecti > 0)
+ mesh->i_face_numbering = cs_numbering_create_vectorized(vector_size);
+ if (ivectb > 0)
+ mesh->b_face_numbering = cs_numbering_create_vectorized(vector_size);
+
+ /* Output info */
+
+ _ivect[0] = ivecti; _ivect[1] = ivectb;
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+ int ivect_tot[2];
+ MPI_Allreduce(_ivect, ivect_tot, 2, MPI_INT, MPI_SUM,
+ cs_glob_mpi_comm);
+ _ivect[0] = ivect_tot[0]; _ivect[1] = ivect_tot[1];
+ }
+#endif
+
+ bft_printf(_("\n"
+ " Vectorization:\n"
+ " --------------\n"
+ " interior faces: %d ranks (of %d)\n"
+ " boundary faces: %d ranks\n\n"),
+ _ivect[0], cs_glob_n_ranks, _ivect[1]);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Renumber mesh elements for vectorization or OpenMP depending on code
+ * options and target machine.
+ *
+ * Currently, only the legacy vectorizing renumbering is handled.
+ *
+ * parameters:
+ * mesh <-> Pointer to global mesh structure
+ * mesh_quantities <-> Pointer to global mesh quantities structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_renumber_mesh(cs_mesh_t *mesh,
+ cs_mesh_quantities_t *mesh_quantities)
+{
+ /* Try vectorizing first */
+
+ _renumber_for_vectorizing(mesh, mesh_quantities);
+
+ /* Then try OpenMP if available */
+
+ if (cs_glob_n_threads > 1)
+ _renumber_for_threads(mesh, mesh_quantities);
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_restart.c b/src/base/cs_restart.c
new file mode 100644
index 0000000..cdbca41
--- /dev/null
+++ b/src/base/cs_restart.c
@@ -0,0 +1,1823 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Manage checkpoint / restart files
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_file.h>
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_block_to_part.h>
+#include <fvm_part_to_block.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_io.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_restart.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local macro definitions
+ *============================================================================*/
+
+/* Fortran API */
+/* ----------- */
+
+/*
+ * "Usual" max name length (a longer name is possible but will
+ * incur dynamic memory allocation.
+ */
+
+#define CS_RESTART_NAME_LEN 64
+
+/*============================================================================
+ * Local type definitions
+ *============================================================================*/
+
+typedef struct _location_t {
+
+ char *name; /* Location name */
+ size_t id; /* Associated id in file */
+ fvm_lnum_t n_ents; /* Local number of entities */
+ fvm_gnum_t n_glob_ents_f; /* Global number of entities by file */
+ fvm_gnum_t n_glob_ents; /* Global number of entities */
+ const fvm_gnum_t *ent_global_num; /* Global entity numbers, or NULL */
+
+} _location_t;
+
+struct _cs_restart_t {
+
+ char *name; /* Name of restart file */
+
+ cs_io_t *fh; /* Pointer to associated file handle */
+
+ size_t n_locations; /* Number of locations */
+ _location_t *location; /* Location definition array */
+
+ cs_restart_mode_t mode; /* Read or write */
+};
+
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Minimum buffer size on rank 0 (to limit number of blocks
+ when there is a large number of processors) */
+
+static int cs_restart_def_buf_size = 1024*1024*8;
+
+/* Monitoring info */
+
+static int _restart_n_opens[2] = {0, 0};
+static double _restart_wtime[2] = {0.0, 0.0};
+
+/* Array for Fortran API */
+
+static size_t _restart_pointer_size = 2;
+static cs_restart_t *_restart_pointer_base[2] = {NULL, NULL};
+static cs_restart_t **_restart_pointer = _restart_pointer_base;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Return an available id in the array of restart file pointers.
+ *
+ * The array may be allocated or reallocated if necessary.
+ *
+ * returns:
+ * available id in the array of restart file pointers
+ *----------------------------------------------------------------------------*/
+
+static int
+_new_restart_id(void)
+{
+ size_t i, j;
+
+ for (i = 0;
+ i < _restart_pointer_size && _restart_pointer[i] != NULL;
+ i++);
+
+ /* If no slot is available, we allow for more restart files */
+
+ if (i == _restart_pointer_size) {
+
+ if (_restart_pointer == _restart_pointer_base) {
+ BFT_MALLOC(_restart_pointer, _restart_pointer_size*2, cs_restart_t *);
+ for (j = 0; j < _restart_pointer_size; j++) {
+ _restart_pointer[j] = _restart_pointer_base[j];
+ _restart_pointer_base[j] = NULL;
+ }
+ }
+ else
+ BFT_REALLOC(_restart_pointer, _restart_pointer_size*2, cs_restart_t *);
+
+ for (j = _restart_pointer_size; j < _restart_pointer_size * 2; j++)
+ _restart_pointer[j] = NULL;
+
+ _restart_pointer_size *= 2;
+
+ }
+
+ return i;
+}
+
+/*----------------------------------------------------------------------------
+ * Free a slot from the array of restart file pointers.
+ *
+ * The array may be freed or reallocated if possible.
+ *
+ * parameters:
+ * id <-- id to free in the array of restart file pointers
+ *----------------------------------------------------------------------------*/
+
+static void
+_free_restart_id(int id)
+{
+ size_t i, j;
+
+ const size_t restart_pointer_base_size = 2;
+
+ _restart_pointer[id] = NULL;
+
+ /* Revert from dynamic to static array if applicable and possible */
+
+ if ((size_t)id >= restart_pointer_base_size) {
+
+ for (i = restart_pointer_base_size;
+ i < _restart_pointer_size && _restart_pointer[i] == NULL;
+ i++);
+
+ /* If no slot above static array size is used, revert to static array */
+
+ if (i == _restart_pointer_size) {
+
+ for (j = 0; j < restart_pointer_base_size; j++)
+ _restart_pointer_base[j] = _restart_pointer[j];
+
+ _restart_pointer_size = restart_pointer_base_size;
+
+ BFT_FREE(_restart_pointer[j]);
+
+ _restart_pointer = _restart_pointer_base;
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Compute number of values in a record
+ *
+ * parameters:
+ * r <-- associated restart file pointer
+ * location_id <-- location id
+ * n_location_vals <-- number of values per location
+ *----------------------------------------------------------------------------*/
+
+static size_t
+_compute_n_ents(const cs_restart_t *r,
+ size_t location_id,
+ size_t n_location_vals)
+{
+ size_t retval = 0;
+
+ if (location_id == 0)
+ retval = n_location_vals;
+
+ else if (location_id > 0 && location_id <= r->n_locations)
+ retval = r->location[location_id-1].n_glob_ents_f * n_location_vals;
+
+ else
+ bft_error(__FILE__, __LINE__, 0,
+ _("Location number %d given for restart file\n"
+ "\"%s\" is not valid."),
+ location_id, r->name);
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Analyze the content of a restart file to build locations
+ *
+ * parameters:
+ * r <-> associated restart file pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_locations_from_index(cs_restart_t *r)
+{
+ cs_io_sec_header_t h;
+
+ size_t rec_id = 0;
+ size_t index_size = 0;
+
+ /* Initialization */
+
+ index_size = cs_io_get_index_size(r->fh);
+
+ /* Analyze records to determine locations */
+
+ for (rec_id = 0; rec_id < index_size; rec_id++) {
+
+ h = cs_io_get_indexed_sec_header(r->fh, rec_id);
+
+ if (h.location_id > r->n_locations) {
+
+ _location_t *loc = NULL;
+
+ if (h.location_id != r->n_locations + 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Restart file \"%s\" declares a location number %d\n"
+ "but no location %d has been declared."),
+ r->name, (int)(h.location_id),
+ (int)(r->n_locations + 1));
+
+ BFT_REALLOC(r->location, r->n_locations + 1, _location_t);
+
+ loc = r->location + r->n_locations;
+ BFT_MALLOC(loc->name, strlen(h.sec_name) + 1, char);
+ strcpy(loc->name, h.sec_name);
+
+ loc->id = h.location_id;
+ loc->n_ents = 0;
+ loc->n_glob_ents = 0;
+
+ cs_io_set_indexed_position(r->fh, &h, rec_id);
+ cs_io_set_fvm_gnum(&h, r->fh);
+ cs_io_read_global(&h, &(loc->n_glob_ents_f), r->fh);
+
+ loc->ent_global_num = NULL;
+
+ r->n_locations += 1;
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize a checkpoint / restart file management structure;
+ *
+ * parameters:
+ * r <-> associated restart file pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_add_file(cs_restart_t *r)
+{
+ double timing[2];
+
+ const char magic_string[] = "Checkpoint / restart, R0";
+ const long echo = CS_IO_ECHO_NONE;
+
+ timing[0] = bft_timer_wtime();
+
+ /* In read mode, open file to detect header first */
+
+ if (r->mode == CS_RESTART_MODE_READ) {
+
+#if defined(FVM_HAVE_MPI)
+ r->fh = cs_io_initialize_with_index(r->name,
+ magic_string,
+ cs_glob_io_hints,
+ echo,
+ cs_glob_mpi_comm);
+#else
+ r->fh = cs_io_initialize_with_index(r->name, magic_string, 0, echo);
+#endif
+
+ _locations_from_index(r);
+ }
+
+ else {
+
+#if defined(FVM_HAVE_MPI)
+ r->fh = cs_io_initialize(r->name,
+ magic_string,
+ CS_IO_MODE_WRITE,
+ cs_glob_io_hints,
+ echo,
+ cs_glob_mpi_comm);
+#else
+ r->fh = cs_io_initialize(r->name,
+ magic_string,
+ CS_IO_MODE_WRITE,
+ 0,
+ echo);
+#endif
+ }
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[r->mode] += timing[1] - timing[0];
+
+ _restart_n_opens[r->mode] += 1;
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Read variable values defined on a mesh location.
+ *
+ * parameters:
+ * r <-> associated restart file pointer
+ * header <-- header associated with current position in file
+ * n_glob_ents <-- global number of entities
+ * n_ents <-- local number of entities
+ * ent_global_num <-- global entity numbers (1 to n numbering)
+ * n_location_vals <-- number of values par location
+ * val_type <-- data type
+ * vals --> array of values
+ *----------------------------------------------------------------------------*/
+
+static void
+_read_ent_values(cs_restart_t *r,
+ cs_io_sec_header_t *header,
+ fvm_gnum_t n_glob_ents,
+ fvm_lnum_t n_ents,
+ const fvm_gnum_t ent_global_num[],
+ int n_location_vals,
+ cs_type_t val_type,
+ cs_byte_t vals[])
+{
+ cs_byte_t *buffer = NULL;
+
+ fvm_lnum_t block_buf_size = 0;
+
+ size_t nbr_byte_ent, nbr_byte_val;
+
+ fvm_block_to_part_info_t bi;
+
+ fvm_block_to_part_t *d = NULL;
+
+ /* Initialization */
+
+ switch (val_type) {
+ case CS_TYPE_cs_int_t:
+ nbr_byte_ent = n_location_vals * sizeof(cs_int_t);
+ nbr_byte_val = sizeof(cs_int_t);
+ cs_io_set_fvm_lnum(header, r->fh);
+ break;
+ case CS_TYPE_cs_real_t:
+ nbr_byte_ent = n_location_vals * sizeof(cs_real_t);
+ nbr_byte_val = sizeof(cs_real_t);
+ break;
+ default:
+ assert(val_type == CS_TYPE_cs_int_t || val_type == CS_TYPE_cs_real_t);
+ }
+
+ bi = fvm_block_to_part_compute_sizes(cs_glob_rank_id,
+ cs_glob_n_ranks,
+ cs_restart_def_buf_size / nbr_byte_ent,
+ n_glob_ents);
+
+ d = fvm_block_to_part_create_by_gnum(cs_glob_mpi_comm,
+ bi,
+ n_ents,
+ ent_global_num);
+
+ /* Read blocks */
+
+ block_buf_size = (bi.gnum_range[1] - bi.gnum_range[0]) * nbr_byte_ent;
+
+ if (block_buf_size > 0)
+ BFT_MALLOC(buffer, block_buf_size, cs_byte_t);
+
+ cs_io_read_block(header,
+ bi.gnum_range[0],
+ bi.gnum_range[1],
+ buffer,
+ r->fh);
+
+ /* Distribute blocks on ranks */
+
+ fvm_block_to_part_copy_array(d,
+ header->elt_type,
+ n_location_vals,
+ buffer,
+ vals);
+
+ /* Free buffer */
+
+ BFT_FREE(buffer);
+
+ fvm_block_to_part_destroy(&d);
+}
+
+/*----------------------------------------------------------------------------
+ * Write variable values defined on a mesh location.
+ *
+ * parameters:
+ * r <-> associated restart file pointer
+ * sec_name <-- section name
+ * n_glob_ents <-- global number of entities
+ * n_ents <-- local number of entities
+ * ent_global_num <-- global entity numbers (1 to n numbering)
+ * location_id <-- id of corresponding location
+ * n_location_vals <-- number of values par location
+ * val_type <-- data type
+ * vals --> array of values
+ *----------------------------------------------------------------------------*/
+
+static void
+_write_ent_values(const cs_restart_t *r,
+ const char *sec_name,
+ fvm_gnum_t n_glob_ents,
+ fvm_lnum_t n_ents,
+ const fvm_gnum_t *ent_global_num,
+ int location_id,
+ int n_location_vals,
+ cs_type_t val_type,
+ const cs_byte_t *vals)
+{
+ fvm_lnum_t block_buf_size = 0;
+
+ fvm_datatype_t elt_type = FVM_DATATYPE_NULL;
+ size_t nbr_byte_ent;
+ cs_byte_t *buffer = NULL;
+
+ fvm_part_to_block_info_t bi;
+
+ fvm_part_to_block_t *d = NULL;
+
+ /* Initialization */
+
+ switch (val_type) {
+ case CS_TYPE_cs_int_t:
+ nbr_byte_ent = n_location_vals * sizeof(cs_int_t);
+ elt_type = (sizeof(cs_int_t) == 8) ? FVM_INT64 : FVM_INT32;
+ break;
+ case CS_TYPE_cs_real_t:
+ nbr_byte_ent = n_location_vals * sizeof(cs_real_t);
+ elt_type = (sizeof(cs_real_t) == fvm_datatype_size[FVM_DOUBLE])
+ ? FVM_DOUBLE : FVM_FLOAT;
+ break;
+ default:
+ assert(val_type == CS_TYPE_cs_int_t || val_type == CS_TYPE_cs_real_t);
+ }
+
+ bi = fvm_part_to_block_compute_sizes(cs_glob_rank_id,
+ cs_glob_n_ranks,
+ cs_restart_def_buf_size / nbr_byte_ent,
+ n_glob_ents);
+
+ d = fvm_part_to_block_create_by_gnum(cs_glob_mpi_comm,
+ bi,
+ n_ents,
+ ent_global_num);
+
+ /* Distribute to blocks */
+
+ block_buf_size = (bi.gnum_range[1] - bi.gnum_range[0]) * nbr_byte_ent;
+
+ if (block_buf_size > 0)
+ BFT_MALLOC(buffer, block_buf_size, cs_byte_t);
+
+ /* Distribute blocks on ranks */
+
+ fvm_part_to_block_copy_array(d,
+ elt_type,
+ n_location_vals,
+ vals,
+ buffer);
+
+ /* Write blocks */
+
+ cs_io_write_block_buffer(sec_name,
+ n_glob_ents,
+ bi.gnum_range[0],
+ bi.gnum_range[1],
+ location_id,
+ 0,
+ n_location_vals,
+ elt_type,
+ buffer,
+ r->fh);
+
+ /* Free buffer */
+
+ BFT_FREE(buffer);
+
+ fvm_part_to_block_destroy(&d);
+}
+
+#endif /* #if defined(HAVE_MPI) */
+
+/*----------------------------------------------------------------------------
+ * Convert read/write arguments from the Fortran API to the C API.
+ *
+ * parameters:
+ * numsui <-- restart file id
+ * itysup <-- location type code
+ * irtype <-- integer or real
+ * r <-- pointer to restart file handle
+ * location <-- location id
+ * val_type <-- integer of real
+ * ierror <-- 0 = success, < 0 = error
+ *----------------------------------------------------------------------------*/
+
+static void
+_section_f77_to_c(const cs_int_t *numsui,
+ const cs_int_t *itysup,
+ const cs_int_t *irtype,
+ cs_restart_t **r,
+ int *location,
+ cs_type_t *val_type,
+ cs_int_t *ierror)
+{
+ cs_int_t r_id = *numsui - 1;
+
+ *ierror = CS_RESTART_SUCCES;
+
+ /* Pointer to associated restart file handle */
+
+ if ( r_id < 0
+ || r_id > (cs_int_t)_restart_pointer_size
+ || _restart_pointer[r_id] == NULL) {
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("Restart file number <%d> can not be closed\n"
+ "(file already closed or invalid number)."), (int)(*numsui));
+
+ *ierror = CS_RESTART_ERR_FILE_NUM;
+ return;
+ }
+
+ else
+ *r = _restart_pointer[r_id];
+
+ /* Location associated with section */
+
+ switch (*itysup) {
+
+ case 0:
+ *location = CS_RESTART_LOCATION_NONE;
+ break;
+
+ case 1:
+ *location = CS_RESTART_LOCATION_CELL;
+ break;
+
+ case 2:
+ *location = CS_RESTART_LOCATION_I_FACE;
+ break;
+
+ case 3:
+ *location = CS_RESTART_LOCATION_B_FACE;
+ break;
+
+ case 4:
+ *location = CS_RESTART_LOCATION_VERTEX;
+ break;
+
+ default:
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("Location type <%d> given for a restart file section\n"
+ "is invalid using the Fortran API."), (int)(*itysup));
+ *ierror = CS_RESTART_ERR_LOCATION;
+ return;
+
+ }
+
+ /* Val_Type associated with section */
+
+ switch (*irtype) {
+
+ case 1:
+ *val_type = CS_TYPE_cs_int_t;
+ break;
+
+ case 2:
+ *val_type = CS_TYPE_cs_real_t;
+ break;
+
+ default:
+ bft_error(__FILE__, __LINE__, 0,
+ _("Value type <%d> given for a restart file section\n"
+ "is invalid using the Fortran API."), (int)(*irtype));
+ *ierror = CS_RESTART_ERR_VAL_TYPE;
+ return;
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Swap values of a renumbered array when reading
+ *
+ * parameters:
+ * n_ents --> number of local entities
+ * ini_ent_num --> initial entity numbers
+ * n_location_vals --> number of values per entity
+ * val_type --> data type
+ * vals --> array of values
+ *----------------------------------------------------------------------------*/
+
+static void
+_restart_permute_read(cs_int_t n_ents,
+ const fvm_gnum_t *ini_ent_num,
+ cs_int_t n_location_vals,
+ cs_type_t val_type,
+ cs_byte_t *vals)
+{
+ cs_int_t ent_id, jj;
+
+ cs_int_t ii = 0;
+
+ /* Instructions */
+
+ if (ini_ent_num == NULL)
+ return;
+
+ switch (val_type) {
+
+ case CS_TYPE_cs_int_t:
+ {
+ cs_int_t *val_ord;
+ cs_int_t *val_cur = (cs_int_t *)vals;
+
+ BFT_MALLOC(val_ord, n_ents * n_location_vals, cs_int_t);
+
+ for (ent_id = 0; ent_id < n_ents; ent_id++) {
+ for (jj = 0; jj < n_location_vals; jj++)
+ val_ord[ii++]
+ = val_cur[(ini_ent_num[ent_id] - 1) * n_location_vals + jj];
+ }
+
+ for (ii = 0; ii < n_ents * n_location_vals; ii++)
+ val_cur[ii] = val_ord[ii];
+
+ BFT_FREE(val_ord);
+ }
+ break;
+
+ case CS_TYPE_cs_real_t:
+ {
+ cs_real_t *val_ord;
+ cs_real_t *val_cur = (cs_real_t *)vals;
+
+ BFT_MALLOC (val_ord, n_ents * n_location_vals, cs_real_t);
+
+ for (ent_id = 0; ent_id < n_ents; ent_id++) {
+ for (jj = 0; jj < n_location_vals; jj++)
+ val_ord[ii++]
+ = val_cur[(ini_ent_num[ent_id] - 1) * n_location_vals + jj];
+ }
+
+ for (ii = 0; ii < n_ents * n_location_vals; ii++)
+ val_cur[ii] = val_ord[ii];
+
+ BFT_FREE(val_ord);
+ }
+ break;
+
+ default:
+ assert(val_type == CS_TYPE_cs_int_t || val_type == CS_TYPE_cs_real_t);
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Swap values of a renumbered array when writing
+ *
+ * parameters:
+ * n_ents --> number of local entities
+ * ini_ent_num --> initial entity numbers
+ * n_location_vals --> number of values per entity
+ * val_type --> data type
+ * vals --> array of values
+ *
+ * returns:
+ * pointer to array of values in initial entity order
+ *----------------------------------------------------------------------------*/
+
+static cs_byte_t *
+_restart_permute_write(cs_int_t n_ents,
+ const fvm_gnum_t *ini_ent_num,
+ cs_int_t n_location_vals,
+ cs_type_t val_type,
+ const cs_byte_t *vals)
+{
+ cs_int_t ent_id, jj;
+
+ cs_int_t ii = 0;
+
+ /* Instructions */
+
+ if (ini_ent_num == NULL)
+ return NULL;
+
+ switch (val_type) {
+
+ case CS_TYPE_cs_int_t:
+ {
+ cs_int_t *val_ord;
+ const cs_int_t *val_cur = (const cs_int_t *)vals;
+
+ BFT_MALLOC(val_ord, n_ents * n_location_vals, cs_int_t);
+
+ for (ent_id = 0; ent_id < n_ents; ent_id++) {
+ for (jj = 0; jj < n_location_vals; jj++)
+ val_ord[(ini_ent_num[ent_id] - 1) * n_location_vals + jj]
+ = val_cur[ii++];
+ }
+
+ return (cs_byte_t *)val_ord;
+ }
+ break;
+
+ case CS_TYPE_cs_real_t:
+ {
+ cs_real_t *val_ord;
+ const cs_real_t *val_cur = (const cs_real_t *)vals;
+
+ BFT_MALLOC(val_ord, n_ents * n_location_vals, cs_real_t);
+
+ for (ent_id = 0; ent_id < n_ents; ent_id++) {
+ for (jj = 0; jj < n_location_vals; jj++)
+ val_ord[(ini_ent_num[ent_id] - 1) * n_location_vals + jj]
+ = val_cur[ii++];
+ }
+
+ return (cs_byte_t *)val_ord;
+ }
+ break;
+
+ default:
+ assert(val_type == CS_TYPE_cs_int_t || val_type == CS_TYPE_cs_real_t);
+ return NULL;
+
+ }
+}
+
+/*============================================================================
+ * Public Fortran function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Open a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE OPNSUI (NOMSUI, LNGNOM, IREAWR, NUMSUI, IERROR)
+ * *****************
+ *
+ * CHARACTER* NOMSUI : --> : Restart file name
+ * INTEGER LNGNOM : --> : Restart file name length
+ * INTEGER IREAWR : --> : 1: read; 2: write
+ * INTEGER NUMSUI : <-- : Number of opened restart file
+ * INTEGER IERROR : <-- : 0: success; < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (opnsui, OPNSUI)
+(
+ const char *nomsui,
+ const cs_int_t *lngnom,
+ const cs_int_t *ireawr,
+ cs_int_t *numsui,
+ cs_int_t *ierror
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+)
+{
+ char *bufname;
+
+ size_t id;
+
+ cs_restart_mode_t restart_mode;
+
+
+ /* Initialization */
+
+ *numsui = 0;
+ *ierror = CS_RESTART_SUCCES;
+
+ /* Handle name for C API */
+
+ bufname = cs_base_string_f_to_c_create(nomsui, *lngnom);
+
+ /* File creation options */
+
+ {
+ switch(*ireawr) {
+ case 1:
+ restart_mode = CS_RESTART_MODE_READ;
+ break;
+ case 2:
+ restart_mode = CS_RESTART_MODE_WRITE;
+ break;
+ default:
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("The access mode of the restart file <%s>\n"
+ "must be equal to 1 (read) or 2 (write) and not <%d>."),
+ bufname, (int)(*ireawr));
+
+ *ierror = CS_RESTART_ERR_MODE;
+ }
+
+ }
+
+ /* Search for an available slot and create file */
+
+ if (*ierror == CS_RESTART_SUCCES) {
+
+ id = _new_restart_id();
+
+ _restart_pointer[id] = cs_restart_create(bufname, restart_mode);
+ }
+
+ /* Free memory if necessary */
+
+ cs_base_string_f_to_c_free(&bufname);
+
+ /*
+ * Return the position of the handle in the array
+ * (id + 1 to have a 1 to n numbering, more conventional in F77)
+ */
+
+ if (*ierror == CS_RESTART_SUCCES)
+ *numsui = id + 1;
+ else
+ *numsui = -1;
+}
+
+/*----------------------------------------------------------------------------
+ * Close a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE CLSSUI (NUMSUI)
+ * *****************
+ *
+ * INTEGER NUMSUI : <-> : number of restart file to close
+ * INTEGER IERROR : <-- : 0: success; < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (clssui, CLSSUI)
+(
+ const cs_int_t *numsui,
+ cs_int_t *ierror
+)
+{
+ cs_int_t r_id = *numsui - 1;
+
+ *ierror = CS_RESTART_SUCCES;
+
+ /* Check that the file is valid */
+
+ if ( r_id < 0
+ || r_id > (cs_int_t)_restart_pointer_size
+ || _restart_pointer[r_id] == NULL) {
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("Restart file number <%d> can not be closed\n"
+ "(file already closed or invalid number)."), (int)(*numsui));
+
+ *ierror = CS_RESTART_ERR_FILE_NUM;
+ return;
+ }
+
+ /* Close file */
+
+ cs_restart_destroy(_restart_pointer[r_id]);
+
+ _free_restart_id(r_id);
+}
+
+
+/*----------------------------------------------------------------------------
+ * Check the locations associated with a restart file.
+ *
+ * For each type of entity, return 1 if the associated number of entities
+ * matches the current value (and so that we consider the mesh locations are
+ * the same), 0 otherwise.
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE TSTSUI (NUMSUI, INDCEL, INDFAC, INDFBR, INDSOM)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ * INTEGER INDCEL : <-- : Matching cells flag
+ * INTEGER INDFAC : <-- : Matching interior faces flag
+ * INTEGER INDFBR : <-- : Matching boundary faces flag
+ * INTEGER INDSOM : <-- : Matching vertices flag
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tstsui, TSTSUI)
+(
+ const cs_int_t *numsui,
+ cs_int_t *indcel,
+ cs_int_t *indfac,
+ cs_int_t *indfbr,
+ cs_int_t *indsom
+)
+{
+ cs_bool_t match_cell, match_i_face, match_b_face, match_vertex;
+
+ cs_int_t r_id = *numsui - 1;
+
+ /* Associated structure pointer */
+
+ if ( r_id < 0
+ || r_id > (cs_int_t)_restart_pointer_size
+ || _restart_pointer[r_id] == NULL) {
+
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("Information on the restart file number <%d> unavailable\n"
+ "(file already closed or invalid number)."), (int)(*numsui));
+
+ *indcel = 0;
+ *indfac = 0;
+ *indfbr = 0;
+ *indsom = 0;
+ return;
+ }
+
+ else {
+
+ cs_restart_check_base_location(_restart_pointer[r_id],
+ &match_cell, &match_i_face,
+ &match_b_face, &match_vertex);
+
+ *indcel = (match_cell == true ? 1 : 0);
+ *indfac = (match_i_face == true ? 1 : 0);
+ *indfbr = (match_b_face == true ? 1 : 0);
+ *indsom = (match_vertex == true ? 1 : 0);
+
+ }
+
+}
+
+
+/*----------------------------------------------------------------------------
+ * Print index associated with a restart file in read mode
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE INFSUI (NUMSUI)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (infsui, INFSUI)
+(
+ const cs_int_t *numsui
+)
+{
+ cs_int_t r_id = *numsui - 1;
+
+ /* Associated structure pointer */
+
+ if ( r_id < 0
+ || r_id > (cs_int_t)_restart_pointer_size
+ || _restart_pointer[r_id] == NULL) {
+
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("Information on the restart file number <%d> unavailable\n"
+ "(file already closed or invalid number)."), (int)(*numsui));
+ }
+ else {
+
+ cs_restart_dump_index(_restart_pointer[r_id]);
+
+ }
+}
+
+
+/*----------------------------------------------------------------------------
+ * Read a section from a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE LECSUI (NUMSUI, NOMRUB, LNGNOM, ITYSUP, NBVENT, IRTYPE, TABVAR)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ * CHARACTER* NOMRUB : --> : Section name
+ * INTEGER LNGNOM : --> : Section name length
+ * INTEGER ITYSUP : --> : Location type:
+ * : : 0: scalar (no location)
+ * : : 1: cells
+ * : : 2: interior faces
+ * : : 3: boundary faces
+ * : : 4: vertices (if available)
+ * INTEGER NBVENT : --> : N. values per location entity
+ * INTEGER IRTYPE : --> : 1 for integers, 2 for double precision
+ * (?) TABVAR : <-> : Array of values to read
+ * INTEGER IERROR : <-- : 0: success, < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lecsui, LECSUI)
+(
+ const cs_int_t *numsui,
+ const char *nomrub,
+ const cs_int_t *lngnom,
+ const cs_int_t *itysup,
+ const cs_int_t *nbvent,
+ const cs_int_t *irtype,
+ void *tabvar,
+ cs_int_t *ierror
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+)
+{
+ char *bufname;
+
+ cs_type_t val_type;
+
+ cs_restart_t *restart;
+ int location_id;
+
+
+ *ierror = CS_RESTART_SUCCES;
+
+ /* Handle name for C API */
+
+ bufname = cs_base_string_f_to_c_create(nomrub, *lngnom);
+
+ /* Handle other arguments for C API */
+
+ _section_f77_to_c(numsui,
+ itysup,
+ irtype,
+ &restart,
+ &location_id,
+ &val_type,
+ ierror);
+
+ if (*ierror < CS_RESTART_SUCCES)
+ return;
+
+ /* Read section */
+
+ *ierror = cs_restart_read_section(restart,
+ bufname,
+ location_id,
+ *nbvent,
+ val_type,
+ tabvar);
+
+ /* Free memory if necessary */
+
+ cs_base_string_f_to_c_free(&bufname);
+}
+
+
+/*----------------------------------------------------------------------------
+ * Write a section to a restart file
+ *
+ * Fortran interface
+ *
+ * SUBROUTINE ECRSUI (NUMSUI, NOMRUB, LNGNOM, ITYSUP, NBVENT, IRTYPE, TABVAR)
+ * *****************
+ *
+ * INTEGER NUMSUI : --> : Restart file number
+ * CHARACTER* NOMRUB : --> : Section name
+ * INTEGER LNGNOM : --> : Section name length
+ * INTEGER ITYSUP : --> : Location type:
+ * : : 0: scalar (no location)
+ * : : 1: cells
+ * : : 2: interior faces
+ * : : 3: boundary faces
+ * : : 4: vertices (if available)
+ * INTEGER NBVENT : --> : N. values per location entity
+ * INTEGER IRTYPE : --> : 1 for integers, 2 for double precision
+ * (?) TABVAR : --> : Array of values to write
+ * INTEGER IERROR : <-- : 0: success, < 0: error code
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ecrsui, ECRSUI)
+(
+ const cs_int_t *numsui,
+ const char *nomrub,
+ const cs_int_t *lngnom,
+ const cs_int_t *itysup,
+ const cs_int_t *nbvent,
+ const cs_int_t *irtype,
+ const void *tabvar,
+ cs_int_t *ierror
+ CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
+ by many Fortran compilers) */
+)
+{
+ char *bufname;
+
+ cs_type_t val_type;
+
+ cs_restart_t *restart;
+ int location_id;
+
+
+ *ierror = CS_RESTART_SUCCES;
+
+ /* Handle name for C API */
+
+ bufname = cs_base_string_f_to_c_create(nomrub, *lngnom);
+
+ /* Handle other arguments for C API */
+
+ _section_f77_to_c(numsui,
+ itysup,
+ irtype,
+ &restart,
+ &location_id,
+ &val_type,
+ ierror);
+
+ if (*ierror < CS_RESTART_SUCCES)
+ return;
+
+ /* Write section */
+
+ cs_restart_write_section(restart,
+ bufname,
+ location_id,
+ *nbvent,
+ val_type,
+ tabvar);
+
+ /* Free memory if necessary */
+
+ cs_base_string_f_to_c_free(&bufname);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a restart file
+ *
+ * parameters:
+ * name <-- file name
+ * mode <-- read or write
+ *
+ * returns:
+ * pointer to initialized restart file structure
+ *----------------------------------------------------------------------------*/
+
+cs_restart_t *
+cs_restart_create(const char *name,
+ cs_restart_mode_t mode)
+{
+ cs_restart_t * restart;
+
+ double timing[2];
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+
+ timing[0] = bft_timer_wtime();
+
+ /* Allocate and initialize base structure */
+
+ BFT_MALLOC(restart, 1, cs_restart_t);
+
+ BFT_MALLOC(restart->name, strlen(name) + 1, char);
+
+ strcpy(restart->name, name);
+
+ /* Initialize other fields */
+
+ restart->mode = mode;
+
+ restart->fh = NULL;
+
+ /* Initialize location data */
+
+ restart->n_locations = 0;
+ restart->location = NULL;
+
+ /* Open associated file, and build an index of sections in read mode */
+
+ _add_file(restart);
+
+ /* Add basic location definitions */
+
+ cs_restart_add_location(restart, "cells",
+ mesh->n_g_cells, mesh->n_cells,
+ mesh->global_cell_num);
+ cs_restart_add_location(restart, "interior_faces",
+ mesh->n_g_i_faces, mesh->n_i_faces,
+ mesh->global_i_face_num);
+ cs_restart_add_location(restart, "boundary_faces",
+ mesh->n_g_b_faces, mesh->n_b_faces,
+ mesh->global_b_face_num);
+ cs_restart_add_location(restart, "vertices",
+ mesh->n_g_vertices, mesh->n_vertices,
+ mesh->global_vtx_num);
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[mode] += timing[1] - timing[0];
+
+ return restart;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy structure associated with a restart file (and close the file).
+ *
+ * parameters:
+ * restart <-- pointer to restart file structure
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+cs_restart_t *
+cs_restart_destroy(cs_restart_t *restart)
+{
+ cs_restart_mode_t mode;
+
+ double timing[2];
+
+ timing[0] = bft_timer_wtime();
+
+ assert(restart != NULL);
+
+ mode = restart->mode;
+
+ if (restart->fh != NULL)
+ cs_io_finalize(&(restart->fh));
+
+ /* Free locations array */
+
+ if (restart->n_locations > 0) {
+ size_t loc_id;
+ for (loc_id = 0; loc_id < restart->n_locations; loc_id++)
+ BFT_FREE((restart->location[loc_id]).name);
+ }
+ if (restart->location != NULL)
+ BFT_FREE(restart->location);
+
+ /* Free remaining memory */
+
+ BFT_FREE(restart->name);
+ BFT_FREE(restart);
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[mode] += timing[1] - timing[0];
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Check the locations associated with a restart file.
+ *
+ * For each type of entity, the correspondinf flag is set to true if the
+ * associated number of entities matches the current value (and so that we
+ * consider the mesh locations are the same), false otherwise.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * match_cell <-- matching cells flag
+ * match_i_face <-- matching interior faces flag
+ * match_b_face <-- matching boundary faces flag
+ * match_vertex <-- matching vertices flag
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_check_base_location(const cs_restart_t *restart,
+ cs_bool_t *match_cell,
+ cs_bool_t *match_i_face,
+ cs_bool_t *match_b_face,
+ cs_bool_t *match_vertex)
+{
+ size_t location_id;
+
+ *match_cell = false;
+ *match_i_face = false;
+ *match_b_face = false;
+ *match_vertex = false;
+
+ assert(restart != NULL);
+
+ for (location_id = 0; location_id < 4; location_id++) {
+
+ const _location_t *loc = restart->location + location_id;
+
+ if (loc->n_glob_ents_f == loc->n_glob_ents) {
+ if (location_id == 0)
+ *match_cell = true;
+ else if (location_id == 1)
+ *match_i_face = true;
+ else if (location_id == 2)
+ *match_b_face = true;
+ else if (location_id == 3)
+ *match_vertex = true;
+ }
+
+ else if (cs_glob_rank_id <= 0) {
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("The size of location \"%s\" associated with\n"
+ "the restart file \"%s\" is %lu and does not\n"
+ "correspond to that of the current mesh (%lu).\n"),
+ loc->name, restart->name,
+ (unsigned long)loc->n_glob_ents_f,
+ (unsigned long)loc->n_glob_ents);
+ }
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Add a location definition.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * location_name <-- name associated with the location
+ * n_glob_ents <-- global number of entities
+ * n_ents <-- local number of entities
+ * ent_global_num <-- global entity numbers, or NULL
+ *
+ * returns:
+ * the location id assigned, or -1 in case of error
+ *----------------------------------------------------------------------------*/
+
+int
+cs_restart_add_location(cs_restart_t *restart,
+ const char *location_name,
+ fvm_gnum_t n_glob_ents,
+ fvm_lnum_t n_ents,
+ const fvm_gnum_t *ent_global_num)
+{
+ double timing[2];
+
+ int loc_id;
+
+ timing[0] = bft_timer_wtime();
+
+ if (restart->mode == CS_RESTART_MODE_READ) {
+
+ /* Search for a location with the same name */
+
+ for (loc_id = 0; loc_id < (int)(restart->n_locations); loc_id++) {
+
+ if ((strcmp((restart->location[loc_id]).name, location_name) == 0)) {
+
+ (restart->location[loc_id]).n_glob_ents = n_glob_ents;
+
+ (restart->location[loc_id]).n_ents = n_ents;
+ (restart->location[loc_id]).ent_global_num = ent_global_num;
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[restart->mode] += timing[1] - timing[0];
+
+ return loc_id + 1;
+
+ }
+ }
+
+ if (loc_id >= ((int)(restart->n_locations)))
+ bft_error(__FILE__, __LINE__, 0,
+ _("The restart file \"%s\" references no\n"
+ "location named \"%s\"."),
+ restart->name, location_name);
+
+ }
+
+ else {
+
+ fvm_datatype_t gnum_type
+ = (sizeof(fvm_gnum_t) == 8) ? FVM_UINT64 : FVM_UINT32;
+
+ /* Create a new location */
+
+ restart->n_locations += 1;
+
+ BFT_REALLOC(restart->location, restart->n_locations, _location_t);
+ BFT_MALLOC((restart->location[restart->n_locations-1]).name,
+ strlen(location_name)+1,
+ char);
+
+ strcpy((restart->location[restart->n_locations-1]).name, location_name);
+
+ (restart->location[restart->n_locations-1]).id = restart->n_locations;
+ (restart->location[restart->n_locations-1]).n_glob_ents = n_glob_ents;
+ (restart->location[restart->n_locations-1]).n_glob_ents_f = n_glob_ents;
+ (restart->location[restart->n_locations-1]).n_ents = n_ents;
+ (restart->location[restart->n_locations-1]).ent_global_num = ent_global_num;
+
+ cs_io_write_global(location_name, 1, restart->n_locations, 0, 0,
+ gnum_type, &n_glob_ents,
+ restart->fh);
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[restart->mode] += timing[1] - timing[0];
+
+ return restart->n_locations;
+ }
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[restart->mode] += timing[1] - timing[0];
+
+ return -1;
+}
+
+/*----------------------------------------------------------------------------
+ * Print the index associated with a restart file in read mode
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_dump_index(const cs_restart_t *restart)
+{
+ size_t loc_id;
+
+ assert(restart != NULL);
+
+ for (loc_id = 0; loc_id < restart->n_locations; loc_id++) {
+ const _location_t *loc = &(restart->location[loc_id]);
+ bft_printf(_(" Location: %s\n"
+ " (number: %03d, n_glob_ents: %lu)\n"),
+ loc->name, (int)(loc->id), (unsigned long)(loc->n_glob_ents));
+ }
+ if (restart->n_locations > 0)
+ bft_printf("\n");
+
+ /* Dump general file info, including index */
+
+ bft_printf(_(" General information associated with the restart file:\n"));
+
+ cs_io_dump(restart->fh);
+}
+
+
+/*----------------------------------------------------------------------------
+ * Read a section from a restart file.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * sec_name <-- section name
+ * location_id <-- id of corresponding location
+ * n_location_vals <-- number of values per location (interlaced)
+ * val_type <-- value type
+ * val --> array of values
+ *
+ * returns: 0 (CS_RESTART_SUCCES) in case of success,
+ * or error code (CS_RESTART_ERR_xxx) in case of error
+ *----------------------------------------------------------------------------*/
+
+int
+cs_restart_read_section(cs_restart_t *restart,
+ const char *sec_name,
+ int location_id,
+ cs_int_t n_location_vals,
+ cs_type_t val_type,
+ void *val)
+{
+ double timing[2];
+
+ cs_int_t n_glob_ents, n_ents;
+ const fvm_gnum_t *ent_global_num;
+
+ size_t rec_id;
+ cs_io_sec_header_t header;
+
+ cs_int_t _n_location_vals = n_location_vals;
+ size_t index_size = 0;
+
+ timing[0] = bft_timer_wtime();
+
+ index_size = cs_io_get_index_size(restart->fh);
+
+ assert(restart != NULL);
+
+ /* Check associated location */
+
+ if (location_id == 0) {
+ n_glob_ents = n_location_vals;
+ n_ents = n_location_vals;
+ _n_location_vals = 1;
+ ent_global_num = NULL;
+ }
+
+ else {
+ if (location_id < 0 || location_id > (int)(restart->n_locations))
+ return CS_RESTART_ERR_LOCATION;
+ if ( (restart->location[location_id-1]).n_glob_ents_f
+ != (restart->location[location_id-1]).n_glob_ents)
+ return CS_RESTART_ERR_LOCATION;
+ n_glob_ents = (restart->location[location_id-1]).n_glob_ents;
+ n_ents = (restart->location[location_id-1]).n_ents;
+ ent_global_num = (restart->location[location_id-1]).ent_global_num;
+ }
+
+ /* Search for the corresponding record in the index */
+
+ for (rec_id = 0; rec_id < index_size; rec_id++) {
+ const char * cmp_name = cs_io_get_indexed_sec_name(restart->fh, rec_id);
+ if (strcmp(cmp_name, sec_name) == 0)
+ break;
+ }
+
+ /* If the record was not found */
+
+ if (rec_id >= index_size)
+ return CS_RESTART_ERR_EXISTS;
+
+ /*
+ If the location does not fit: we search for a location of same
+ name with the correct location.
+ */
+
+ header = cs_io_get_indexed_sec_header(restart->fh, rec_id);
+
+ if (header.location_id != (size_t)location_id) {
+
+ rec_id++;
+
+ while (rec_id < index_size) {
+ header = cs_io_get_indexed_sec_header(restart->fh, rec_id);
+ if ( (strcmp(header.sec_name, sec_name) == 0)
+ && (header.location_id == (size_t)location_id))
+ break;
+ rec_id++;
+ }
+
+ if (rec_id >= index_size)
+ return CS_RESTART_ERR_LOCATION;
+ }
+
+ /* If the number of values per location does not match */
+
+ if ( ( header.location_id > 0
+ && header.n_location_vals != (size_t)n_location_vals)
+ || ( header.location_id == 0 && header.n_vals != n_ents))
+ return CS_RESTART_ERR_N_VALS;
+
+ /* If the type of value does not match */
+
+ if (header.elt_type == FVM_INT32 || header.elt_type == FVM_INT64) {
+ cs_io_set_fvm_lnum(&header, restart->fh);
+ if (val_type != CS_TYPE_cs_int_t)
+ return CS_RESTART_ERR_VAL_TYPE;
+ }
+ else if (header.elt_type == FVM_FLOAT || header.elt_type == FVM_DOUBLE) {
+ if (sizeof(cs_real_t) != fvm_datatype_size[header.elt_type]) {
+ if (sizeof(cs_real_t) == fvm_datatype_size[FVM_FLOAT])
+ header.elt_type = FVM_FLOAT;
+ else
+ header.elt_type = FVM_DOUBLE;
+ }
+ if (val_type != CS_TYPE_cs_real_t)
+ return CS_RESTART_ERR_VAL_TYPE;
+ }
+
+ /* Now set position in file to read data */
+
+ cs_io_set_indexed_position(restart->fh, &header, rec_id);
+
+ /* Section contents */
+ /*------------------*/
+
+ /* In single processor mode or for global values */
+
+ if (cs_glob_n_ranks == 1 || location_id == 0) {
+
+ cs_io_read_global(&header, val, restart->fh);
+
+ if (ent_global_num != NULL)
+ _restart_permute_read(n_ents,
+ ent_global_num,
+ _n_location_vals,
+ val_type,
+ val);
+ }
+
+#if defined(HAVE_MPI)
+
+ /* In parallel mode for a distributed mesh location */
+
+ else
+ _read_ent_values(restart,
+ &header,
+ n_glob_ents,
+ n_ents,
+ ent_global_num,
+ _n_location_vals,
+ val_type,
+ (cs_byte_t *)val);
+
+#endif /* #if defined(HAVE_MPI) */
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[restart->mode] += timing[1] - timing[0];
+
+ /* Return */
+
+ return CS_RESTART_SUCCES;
+}
+
+/*----------------------------------------------------------------------------
+ * Write a section to a restart file.
+ *
+ * parameters:
+ * restart <-- associated restart file pointer
+ * sec_name <-- section name
+ * location_id <-- id of corresponding location
+ * n_location_vals <-- number of values per location (interlaced)
+ * val_type <-- value type
+ * val <-- array of values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_write_section(cs_restart_t *restart,
+ const char *sec_name,
+ int location_id,
+ cs_int_t n_location_vals,
+ cs_type_t val_type,
+ const void *val)
+{
+ double timing[2];
+
+ cs_int_t n_tot_vals, n_glob_ents, n_ents;
+ fvm_datatype_t elt_type;
+
+ const fvm_gnum_t *ent_global_num;
+
+ cs_int_t _n_location_vals = n_location_vals;
+
+ timing[0] = bft_timer_wtime();
+
+ assert(restart != NULL);
+
+ n_tot_vals = _compute_n_ents(restart, location_id, n_location_vals);
+
+ /* Check associated location */
+
+ if (location_id == 0) {
+ n_glob_ents = n_location_vals;
+ n_ents = n_location_vals;
+ _n_location_vals = 1;
+ ent_global_num = NULL;
+ }
+
+ else {
+ assert(location_id >= 0 && location_id <= (int)(restart->n_locations));
+ n_glob_ents = (restart->location[location_id-1]).n_glob_ents;
+ n_ents = (restart->location[location_id-1]).n_ents;
+ ent_global_num = (restart->location[location_id-1]).ent_global_num;
+ }
+
+ /* Set val_type */
+
+ switch (val_type) {
+ case CS_TYPE_cs_int_t:
+ elt_type = (sizeof(cs_int_t) == 8) ? FVM_INT64 : FVM_INT32;
+ break;
+ case CS_TYPE_cs_real_t:
+ elt_type = (sizeof(cs_real_t) == fvm_datatype_size[FVM_DOUBLE])
+ ? FVM_DOUBLE : FVM_FLOAT;
+ break;
+ default:
+ assert(val_type == CS_TYPE_cs_int_t || val_type == CS_TYPE_cs_real_t);
+ }
+
+ /* Section contents */
+ /*------------------*/
+
+ /* In single processor mode of for global values */
+
+ if (location_id == 0)
+ cs_io_write_global(sec_name,
+ n_tot_vals,
+ location_id,
+ 0,
+ 1,
+ elt_type,
+ val,
+ restart->fh);
+
+
+ else if (cs_glob_n_ranks == 1) {
+
+ cs_byte_t *val_tmp = NULL;
+
+ if (ent_global_num != NULL)
+ val_tmp = _restart_permute_write(n_ents,
+ ent_global_num,
+ _n_location_vals,
+ val_type,
+ val);
+
+ cs_io_write_global(sec_name,
+ n_tot_vals,
+ location_id,
+ 0,
+ _n_location_vals,
+ elt_type,
+ (val_tmp != NULL) ? val_tmp : val,
+ restart->fh);
+
+ if (val_tmp != NULL)
+ BFT_FREE (val_tmp);
+ }
+
+#if defined(HAVE_MPI)
+
+ /* In parallel mode for a distributed mesh location */
+
+ else
+ _write_ent_values(restart,
+ sec_name,
+ n_glob_ents,
+ n_ents,
+ ent_global_num,
+ location_id,
+ _n_location_vals,
+ val_type,
+ (const cs_byte_t *)val);
+
+ timing[1] = bft_timer_wtime();
+ _restart_wtime[restart->mode] += timing[1] - timing[0];
+
+#endif /* #if defined(HAVE_MPI) */
+}
+
+/*----------------------------------------------------------------------------
+ * Print statistics associated with restart files
+ *----------------------------------------------------------------------------*/
+
+void
+cs_restart_print_stats(void)
+{
+ bft_printf(_("\n"
+ "Checkpoint / restart files summary:\n"
+ "\n"
+ " Number of files read: %3d\n"
+ " Number of files written: %3d\n"
+ "\n"
+ " Elapsed time for reading: %12.3f\n"
+ " Elapsed time for writing: %12.3f\n"),
+ _restart_n_opens[0], _restart_n_opens[1],
+ _restart_wtime[0], _restart_wtime[1]);
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_sat_coupling.c b/src/base/cs_sat_coupling.c
new file mode 100644
index 0000000..226e94f
--- /dev/null
+++ b/src/base/cs_sat_coupling.c
@@ -0,0 +1,1583 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions associated with code coupling.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <math.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_config.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_coupling.h>
+#include <fvm_locator.h>
+#include <fvm_nodal.h>
+#include <fvm_writer.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_mesh.h"
+#include "cs_mesh_quantities.h"
+#include "cs_mesh_connect.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_sat_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+struct _cs_sat_coupling_t {
+
+ fvm_locator_t *localis_cel; /* Locator associated with cells */
+ fvm_locator_t *localis_fbr; /* Locator associated with boundary faces */
+
+ cs_int_t nbr_cel_sup; /* Number of associated cell locations */
+ cs_int_t nbr_fbr_sup; /* Number of associated face locations */
+ fvm_nodal_t *cells_sup; /* Local cells at which distant values are
+ interpolated*/
+ fvm_nodal_t *faces_sup; /* Local faces at which distant values are
+ interpolated*/
+
+ cs_real_t *distant_dist_fbr; /* Distant vectors (distance JJ') */
+ cs_real_t *distant_of;
+ cs_real_t *local_of;
+ cs_real_t *distant_pond_fbr; /* Distant weighting coefficient */
+ cs_real_t *local_pond_fbr; /* Local weighting coefficient */
+
+#if defined(HAVE_MPI)
+
+ MPI_Comm comm; /* Associated MPI communicator */
+
+ cs_int_t n_dist_ranks; /* Number of associated distant ranks */
+ cs_int_t dist_root_rank; /* First associated distant rank */
+
+#endif
+
+};
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* Array of couplings */
+
+static int cs_glob_nbr_couplages = 0;
+static int cs_glob_nbr_couplages_max = 0;
+static cs_sat_coupling_t **cs_glob_couplages = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create a coupling.
+ *
+ * Couplings are allowed either with process totally distinct from the
+ * application communicator (cs_glob_mpi_comm), or within this same
+ * communicator.
+ *
+ * parameters:
+ * root_rank <-- root rank of distant process leader in MPI_COMM_WORLD
+ *
+ * returns:
+ * pointer to new coupling structure
+ *----------------------------------------------------------------------------*/
+
+static cs_sat_coupling_t *
+_sat_coupling_create(cs_int_t root_rank)
+{
+ int mpi_flag = 0;
+ int n_dist_ranks = 0;
+ int dist_root_rank = 0;
+ cs_sat_coupling_t *couplage = NULL;
+
+ const double tolerance = 0.1;
+
+ /* Create associated structure and MPI communicator */
+
+ BFT_MALLOC(couplage, 1, cs_sat_coupling_t);
+
+#if defined(HAVE_MPI)
+
+ MPI_Initialized(&mpi_flag);
+
+ if (mpi_flag == 0)
+ couplage->comm = MPI_COMM_NULL;
+
+ else {
+
+ int n_loc_ranks, n_glob_ranks, r_glob, r_loc_min, r_loc_max;
+
+ /* Check that coupled processes overlap exactly or not at all */
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &r_glob);
+ MPI_Comm_size(MPI_COMM_WORLD, &n_glob_ranks);
+ MPI_Comm_size(cs_glob_mpi_comm, &n_loc_ranks);
+
+ MPI_Allreduce(&r_glob, &r_loc_min, 1, MPI_INT, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(&r_glob, &r_loc_max, 1, MPI_INT, MPI_MAX,
+ cs_glob_mpi_comm);
+
+ if (root_rank > r_loc_min && root_rank <= r_loc_max)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling definition is impossible: a distant root rank equal to\n"
+ "%d is required, whereas the local group corresponds to\n"
+ "rank %d to %d\n"),
+ (int)root_rank, r_loc_min, r_loc_max);
+
+ else if (root_rank < 0 || root_rank >= n_glob_ranks)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling definition is impossible: a distant root rank equal to\n"
+ "%d is required, whereas the global ranks (MPI_COMM_WORLD)\n"
+ "range from to 0 to %d\n"),
+ (int)root_rank, n_glob_ranks - 1);
+
+ /* Case for a coupling internal to the process group */
+
+ if (root_rank == r_loc_min) {
+ if (n_loc_ranks == 1)
+ couplage->comm = MPI_COMM_NULL;
+ else
+ couplage->comm = cs_glob_mpi_comm;
+ n_dist_ranks = n_loc_ranks;
+ }
+
+ /* Case for a coupling external to the process group */
+
+ else {
+
+ int local_range[2] = {-1, -1};
+ int distant_range[2] = {-1, -1};
+
+ fvm_coupling_mpi_intracomm_create(cs_glob_mpi_comm,
+ root_rank,
+ &(couplage->comm),
+ local_range,
+ distant_range);
+
+ bft_printf(_("coupling: local_ranks = [%d..%d], distant ranks = [%d..%d]\n"),
+ local_range[0], local_range[1] - 1,
+ distant_range[0], distant_range[1] - 1);
+
+ n_dist_ranks = distant_range[1] - distant_range[0];
+ dist_root_rank = distant_range[0];
+ }
+
+ }
+
+ couplage->n_dist_ranks = n_dist_ranks;
+ couplage->dist_root_rank = dist_root_rank;
+
+#endif
+
+ /* Creation of the localization structures */
+
+#if defined(FVM_HAVE_MPI)
+
+ couplage->localis_cel = fvm_locator_create(tolerance,
+ couplage->comm,
+ n_dist_ranks,
+ dist_root_rank);
+
+ couplage->localis_fbr = fvm_locator_create(tolerance,
+ couplage->comm,
+ n_dist_ranks,
+ dist_root_rank);
+
+#else
+
+ couplage->localis_cel = fvm_locator_create(tolerance);
+ couplage->localis_fbr = fvm_locator_create(tolerance);
+
+#endif
+
+ couplage->nbr_cel_sup = 0;
+ couplage->nbr_fbr_sup = 0;
+ couplage->cells_sup = NULL;
+ couplage->faces_sup = NULL;
+
+ couplage->distant_dist_fbr = NULL;
+ couplage->distant_of = NULL;
+ couplage->local_of = NULL;
+ couplage->distant_pond_fbr = NULL;
+ couplage->local_pond_fbr = NULL;
+
+ return couplage;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy a coupling structure
+ *
+ * parameters:
+ * couplage <-> pointer to coupling structure to destroy
+ *
+ * returns:
+ * NULL pointer
+ *----------------------------------------------------------------------------*/
+
+static cs_sat_coupling_t *
+_sat_coupling_destroy(cs_sat_coupling_t *couplage)
+{
+ fvm_locator_destroy(couplage->localis_cel);
+ fvm_locator_destroy(couplage->localis_fbr);
+
+ if (couplage->cells_sup != NULL)
+ fvm_nodal_destroy(couplage->cells_sup);
+ if (couplage->faces_sup != NULL)
+ fvm_nodal_destroy(couplage->faces_sup);
+
+ BFT_FREE(couplage->distant_dist_fbr);
+ BFT_FREE(couplage->distant_of);
+ BFT_FREE(couplage->local_of);
+ BFT_FREE(couplage->distant_pond_fbr);
+ BFT_FREE(couplage->local_pond_fbr);
+
+#if defined(HAVE_MPI)
+ if ( couplage->comm != MPI_COMM_WORLD
+ && couplage->comm != cs_glob_mpi_comm)
+ MPI_Comm_free(&(couplage->comm));
+#endif
+
+ BFT_FREE(couplage);
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Computed some quantities needed for a centred-like interpolation
+ * - distance JJ' for distant boundary faces
+ * - local weighting coefficients
+ *----------------------------------------------------------------------------*/
+
+static void
+_sat_coupling_interpolate(cs_sat_coupling_t *couplage)
+{
+ int icoo;
+ int reverse;
+
+ cs_int_t ind;
+ cs_int_t iel;
+ cs_int_t ifac;
+
+ cs_int_t n_fbr_loc = 0;
+ cs_int_t n_fbr_dist = 0;
+
+ cs_real_t pdt_scal;
+ cs_real_t surface;
+
+ cs_real_t distance_fbr_cel;
+ cs_real_t distance_cel_cel;
+
+ cs_real_t dist_cel_fbr[3];
+ cs_real_t vect_surf_norm[3];
+
+ cs_real_t *local_surf = NULL;
+ cs_real_t *local_xyzcen = NULL;
+ cs_real_t *distant_surf = NULL;
+ cs_real_t *distant_xyzcen = NULL;
+
+ const fvm_lnum_t *lstfbr = NULL;
+ const fvm_lnum_t *element = NULL;
+ const fvm_coord_t *distant_coord = NULL;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_mesh_quantities_t *mesh_quantities = cs_glob_mesh_quantities;
+
+
+ /* Removing the connectivity and localization informations in case of
+ coupling update */
+
+ if (couplage->distant_dist_fbr != NULL)
+ BFT_FREE(couplage->distant_dist_fbr);
+ if (couplage->distant_of != NULL)
+ BFT_FREE(couplage->distant_of);
+ if (couplage->local_of != NULL)
+ BFT_FREE(couplage->local_of);
+ if (couplage->distant_pond_fbr != NULL)
+ BFT_FREE(couplage->local_pond_fbr);
+ if (couplage->local_pond_fbr != NULL)
+ BFT_FREE(couplage->local_pond_fbr);
+
+
+ /* Interpolation structure */
+
+ n_fbr_loc = fvm_locator_get_n_interior(couplage->localis_fbr);
+ lstfbr = fvm_locator_get_interior_list(couplage->localis_fbr);
+
+ n_fbr_dist = fvm_locator_get_n_dist_points(couplage->localis_fbr);
+ element = fvm_locator_get_dist_locations(couplage->localis_fbr);
+ distant_coord = fvm_locator_get_dist_coords(couplage->localis_fbr);
+
+
+ /* Calculation of the distance DJJPB defining the distance from */
+ /* the local cell centre to the distant boundary face norm */
+ /*--------------------------------------------------------------*/
+
+ BFT_MALLOC(couplage->distant_dist_fbr, 3*n_fbr_dist, cs_real_t);
+
+ /* Store the local surface vector of the coupled boundary faces */
+
+ BFT_MALLOC(local_surf, 3*n_fbr_loc, cs_real_t);
+
+ for (ind = 0 ; ind < n_fbr_loc ; ind++) {
+
+ ifac = lstfbr[ind] - 1;
+
+ for (icoo = 0 ; icoo < 3 ; icoo++)
+ local_surf[ind*3 + icoo] = mesh_quantities->b_face_normal[ifac*3 + icoo];
+
+ }
+
+ /* Get the distant faces surface vector (reverse = 1) */
+
+ reverse = 1;
+
+ BFT_MALLOC(distant_surf, 3*n_fbr_dist, cs_real_t);
+
+ fvm_locator_exchange_point_var(couplage->localis_fbr,
+ distant_surf,
+ local_surf,
+ NULL,
+ sizeof(cs_real_t),
+ 3,
+ reverse);
+
+ BFT_FREE(local_surf);
+
+ /* Calculation of the JJ' vectors */
+
+ BFT_MALLOC(distant_xyzcen, 3*n_fbr_dist, cs_real_t);
+
+ for (ind = 0; ind < n_fbr_dist; ind++) {
+
+ iel = element[ind] - 1;
+
+ surface = 0.;
+ for (icoo = 0; icoo < 3; icoo++)
+ surface += distant_surf[ind*3 + icoo]*distant_surf[ind*3 + icoo];
+ surface = sqrt(surface);
+
+ pdt_scal = 0.;
+ for (icoo = 0; icoo < 3; icoo++) {
+
+ dist_cel_fbr[icoo] =
+ distant_coord[ind*3 + icoo] - mesh_quantities->cell_cen[iel*3 + icoo];
+
+ /* Store the distant coordinates to compute the weighting coefficients */
+ distant_xyzcen[ind*3 + icoo] = mesh_quantities->cell_cen[iel*3 + icoo];
+
+ vect_surf_norm[icoo] =
+ distant_surf[ind*3 + icoo] / surface;
+
+ pdt_scal += dist_cel_fbr[icoo]*vect_surf_norm[icoo];
+
+ }
+
+ for (icoo = 0; icoo < 3; icoo++)
+ couplage->distant_dist_fbr[ind*3 + icoo] =
+ dist_cel_fbr[icoo] - pdt_scal*vect_surf_norm[icoo];
+
+ }
+
+ BFT_FREE(distant_surf);
+
+
+ /* Calculation of the local weighting coefficient */
+ /*------------------------------------------------*/
+
+ BFT_MALLOC(couplage->distant_pond_fbr, n_fbr_dist, cs_real_t);
+ BFT_MALLOC(couplage->local_pond_fbr, n_fbr_loc, cs_real_t);
+
+ /* Get the cell centres coordinates (reverse = 0) */
+
+ reverse = 0;
+
+ BFT_MALLOC(local_xyzcen, 3*n_fbr_loc, cs_real_t);
+
+ fvm_locator_exchange_point_var(couplage->localis_fbr,
+ distant_xyzcen,
+ local_xyzcen,
+ NULL,
+ sizeof(cs_real_t),
+ 3,
+ reverse);
+
+ BFT_FREE(distant_xyzcen);
+
+ /* Calculation of the local weighting coefficients */
+
+ for (ind = 0 ; ind < n_fbr_loc ; ind++) {
+
+ ifac = lstfbr[ind] - 1;
+ iel = mesh->b_face_cells[ifac] - 1;
+
+ surface = 0.;
+
+ distance_fbr_cel = 0.;
+ distance_cel_cel = 0.;
+
+ for (icoo = 0 ; icoo < 3 ; icoo++) {
+
+ surface += mesh_quantities->b_face_normal[ifac*3 + icoo]
+ * mesh_quantities->b_face_normal[ifac*3 + icoo];
+
+ distance_fbr_cel += mesh_quantities->b_face_normal[ifac*3 + icoo] *
+ (local_xyzcen[ind*3 + icoo] - mesh_quantities->b_face_cog[ifac*3 + icoo]);
+
+ distance_cel_cel += mesh_quantities->b_face_normal[ifac*3 + icoo] *
+ (local_xyzcen[ind*3 + icoo] - mesh_quantities->cell_cen[iel*3 + icoo]);
+
+ }
+
+ surface = sqrt(surface);
+
+ distance_fbr_cel /= surface;
+ distance_cel_cel /= surface;
+
+ if (fabs(distance_cel_cel) > 1.e-12)
+ couplage->local_pond_fbr[ind] = distance_fbr_cel / distance_cel_cel;
+ else
+ couplage->local_pond_fbr[ind] = 0.5;
+
+ }
+
+
+ /* Get the distant weighting coefficients (reverse = 1) */
+
+ reverse = 1;
+
+ fvm_locator_exchange_point_var(couplage->localis_fbr,
+ couplage->distant_pond_fbr,
+ couplage->local_pond_fbr,
+ NULL,
+ sizeof(cs_real_t),
+ 1,
+ reverse);
+
+
+
+ /* Calculation of the OF distance */
+ /*--------------------------------*/
+
+ BFT_MALLOC(couplage->distant_of, 3*n_fbr_dist, cs_real_t);
+ BFT_MALLOC(couplage->local_of, 3*n_fbr_loc, cs_real_t);
+
+ for (ind = 0 ; ind < n_fbr_loc ; ind++) {
+
+ cs_real_t pond = couplage->local_pond_fbr[ind];
+
+ ifac = lstfbr[ind] - 1;
+ iel = mesh->b_face_cells[ifac] - 1;
+
+ surface = 0.;
+
+ distance_fbr_cel = 0.;
+ distance_cel_cel = 0.;
+
+ for (icoo = 0 ; icoo < 3 ; icoo++) {
+
+ surface += mesh_quantities->b_face_normal[ifac*3 + icoo]
+ * mesh_quantities->b_face_normal[ifac*3 + icoo];
+
+ distance_fbr_cel += mesh_quantities->b_face_normal[ifac*3 + icoo] *
+ (local_xyzcen[ind*3+icoo] - mesh_quantities->b_face_cog[ifac*3+icoo]);
+
+ distance_cel_cel += mesh_quantities->b_face_normal[ifac*3 + icoo] *
+ (local_xyzcen[ind*3+icoo] - mesh_quantities->cell_cen[iel*3+icoo]);
+
+ }
+
+ surface = sqrt(surface);
+
+ distance_fbr_cel /= surface;
+ distance_cel_cel /= surface;
+
+ for (icoo = 0 ; icoo < 3 ; icoo++)
+
+ couplage->local_of[ind*3 + icoo] =
+ mesh_quantities->b_face_cog[ifac*3 + icoo]
+ - (mesh_quantities->b_face_cog[ifac*3 + icoo] /* O' */
+ + mesh_quantities->b_face_normal[ifac*3 + icoo] *distance_fbr_cel/surface /*J'=F+n*FJ'*/
+ - 0.5*mesh_quantities->b_face_normal[ifac*3 + icoo] *distance_cel_cel/surface ); /*-n*I'J'/2*/
+
+ }
+
+ reverse = 1;
+
+ fvm_locator_exchange_point_var(couplage->localis_fbr,
+ couplage->distant_of,
+ couplage->local_of,
+ NULL,
+ sizeof(cs_real_t),
+ 3,
+ reverse);
+
+ BFT_FREE(local_xyzcen);
+
+
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get number of code coupling
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NBCCPL
+ * *****************
+ *
+ * INTEGER NBRCPL : <-- : number of code couplings
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (nbccpl, NBCCPL)
+(
+ cs_int_t *nbrcpl
+)
+{
+ *nbrcpl = cs_glob_nbr_couplages;
+}
+
+
+/*----------------------------------------------------------------------------
+ * Set the list of cells and boundary faces associated to a coupling
+ * and a cloud of point.
+ *
+ * The local "support" cells and boundary faces are used to localize
+ * the values in the distant "coupled" cells and faces.
+ * Depending on the role of sender and/or receiver of the current process
+ * in the coupling, some of these sets can be empty or not.
+ *
+ * The cell values are always localized and interpolated on the distant
+ * "cells" support. The face values are localized and interpolated on
+ * the distant "face" support if present, or on the distant "cell" support
+ * if not.
+ *
+ * If the input arrays LCESUP and LFBSUP are not ordered, they will be
+ * orderd in output.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DEFCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCESUP : --> : number of "support" cells
+ * INTEGER NFBSUP : --> : number of "support" boundary faces
+ * INTEGER NCECPL : --> : number of coupled cells
+ * INTEGER NFBCPL : --> : number of coupled boundary faces
+ * INTEGER LCESUP(NCESUP) : <-> : list of "support" cells
+ * INTEGER LFBSUP(NFBSUP) : <-> : list of "support" boundary faces
+ * INTEGER LCECPL(NCECPL) : --> : list of coupled cells
+ * INTEGER LFBCPL(NFBCPL) : --> : list of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (defcpl, DEFCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *ncesup,
+ const cs_int_t *nfbsup,
+ const cs_int_t *ncecpl,
+ const cs_int_t *nfbcpl,
+ cs_int_t lcesup[],
+ cs_int_t lfbsup[],
+ const cs_int_t lcecpl[],
+ const cs_int_t lfbcpl[]
+)
+{
+ cs_int_t ind;
+
+ int indic_glob[2] = {0, 0};
+ int indic_loc[2] = {0, 0};
+
+ cs_sat_coupling_t *coupl = NULL;
+ fvm_nodal_t *support_fbr = NULL;
+ cs_mesh_quantities_t *mesh_quantities = cs_glob_mesh_quantities;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ /* Removing the connectivity and localization informations in case of
+ coupling update */
+
+ if (coupl->cells_sup != NULL)
+ fvm_nodal_destroy(coupl->cells_sup);
+ if (coupl->faces_sup != NULL)
+ fvm_nodal_destroy(coupl->faces_sup);
+
+ /* Create the local lists */
+
+ coupl->nbr_cel_sup = *ncesup;
+ coupl->nbr_fbr_sup = *nfbsup;
+
+ /* Create the corresponding FVM structures */
+
+ if (*ncesup > 0)
+ indic_loc[0] = 1;
+ if (*nfbsup > 0)
+ indic_loc[1] = 1;
+
+ for (ind = 0 ; ind < 2 ; ind++)
+ indic_glob[ind] = indic_loc[ind];
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Allreduce (indic_loc, indic_glob, 2, MPI_INT, MPI_MAX,
+ cs_glob_mpi_comm);
+#endif
+
+ if (indic_glob[0] > 0)
+ coupl->cells_sup = cs_mesh_connect_cells_to_nodal(cs_glob_mesh,
+ "coupled_cells",
+ *ncesup,
+ lcesup);
+ if (indic_glob[1] > 0)
+ coupl->faces_sup = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ "coupled_boundary_faces",
+ 0,
+ *nfbsup,
+ NULL,
+ lfbsup);
+
+ /* Initialization of the distant point localization */
+
+ fvm_locator_set_nodal(coupl->localis_cel,
+ coupl->cells_sup,
+ 1,
+ 3,
+ *ncecpl,
+ lcecpl,
+ mesh_quantities->cell_cen);
+
+ if (indic_glob[1] > 0)
+ support_fbr = coupl->faces_sup;
+ else
+ support_fbr = coupl->cells_sup;
+
+ fvm_locator_set_nodal(coupl->localis_fbr,
+ support_fbr,
+ 1,
+ 3,
+ *nfbcpl,
+ lfbcpl,
+ mesh_quantities->b_face_cog);
+
+
+ /* Computed some quantities needed for a centred-like interpolation */
+
+ if (coupl->localis_fbr != NULL)
+ _sat_coupling_interpolate(coupl);
+
+
+#if 0
+ /* TODO: associate the FVM meshes to the post-processing,
+ with a fonction giving a pointer to the associated FVM structures,
+ and another enabling its compacting or removing */
+ {
+ fvm_writer_t *w = fvm_writer_init("coupled_mesh",
+ NULL,
+ "EnSight Gold",
+ "binary",
+ FVM_WRITER_FIXED_MESH);
+
+ fvm_writer_export_nodal(w, coupl->cells_sup);
+ fvm_writer_finalize(w);
+
+ }
+#endif
+
+ /* Compacting the interpolation support (could be removed) */
+
+ if (coupl->cells_sup != NULL)
+ fvm_nodal_reduce(coupl->cells_sup, 1);
+ if (coupl->faces_sup != NULL)
+ fvm_nodal_reduce(coupl->faces_sup, 1);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ fvm_locator_dump(coupl->localis_cel);
+ fvm_locator_dump(coupl->localis_fbr);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the number of cells and boundary faces, "support", coupled and not
+ * localized associated to a given coupling
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NBECPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCESUP : <-- : number of "support" cells
+ * INTEGER NFBSUP : <-- : number of "support" boundary faces
+ * INTEGER NCECPL : <-- : number of coupled cells
+ * INTEGER NFBCPL : <-- : number of coupled boundary faces
+ * INTEGER NCENCP : <-- : number of not coupled cells
+ * : : (since not localized)
+ * INTEGER NFBNCP : <-- : number of not coupled boundary faces
+ * : : (since not localized)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (nbecpl, NBECPL)
+(
+ const cs_int_t *numcpl,
+ cs_int_t *ncesup,
+ cs_int_t *nfbsup,
+ cs_int_t *ncecpl,
+ cs_int_t *nfbcpl,
+ cs_int_t *ncencp,
+ cs_int_t *nfbncp
+)
+{
+ cs_sat_coupling_t *coupl = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ *ncesup = coupl->nbr_cel_sup;
+ *nfbsup = coupl->nbr_fbr_sup;
+
+ *ncecpl = 0;
+ *nfbcpl = 0;
+
+ *ncencp = 0;
+ *nfbncp = 0;
+
+ if (coupl->localis_cel != NULL) {
+ *ncecpl = fvm_locator_get_n_interior(coupl->localis_cel);
+ *ncencp = fvm_locator_get_n_exterior(coupl->localis_cel);
+ }
+
+ if (coupl->localis_fbr != NULL) {
+ *nfbcpl = fvm_locator_get_n_interior(coupl->localis_fbr);
+ *nfbncp = fvm_locator_get_n_exterior(coupl->localis_fbr);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the lists of coupled cells and boundary faces (i.e. receiving)
+ * associated to a given coupling
+ *
+ * The number of cells and boundary faces, got with NBECPL(), are used
+ * for arguments coherency checks.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LELCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCECPL : --> : number of coupled cells
+ * INTEGER NFBCPL : --> : number of coupled boundary faces
+ * INTEGER LCECPL(*) : <-- : list of coupled cells
+ * INTEGER LFBCPL(*) : <-- : list of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lelcpl, LELCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *ncecpl,
+ const cs_int_t *nfbcpl,
+ cs_int_t *lcecpl,
+ cs_int_t *lfbcpl
+)
+{
+ cs_int_t ind;
+
+ cs_int_t _ncecpl = 0;
+ cs_int_t _nfbcpl = 0;
+
+ cs_sat_coupling_t *coupl = NULL;
+
+ const cs_int_t *lst = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ if (coupl->localis_cel != NULL)
+ _ncecpl = fvm_locator_get_n_interior(coupl->localis_cel);
+
+ if (coupl->localis_fbr != NULL)
+ _nfbcpl = fvm_locator_get_n_interior(coupl->localis_fbr);
+
+ if (*ncecpl != _ncecpl || *nfbcpl != _nfbcpl)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling %d: inconsistent arguments for LELCPL()\n"
+ "NCECPL = %d and NFBCPL = %d are indicated.\n"
+ "The values for this coupling should be %d and %d."),
+ *numcpl, (int)(*ncecpl), (int)(*nfbcpl),
+ (int)_ncecpl, (int)_nfbcpl);
+
+ /* Copy lists (would be useless with a pure C API) */
+
+ if (_ncecpl > 0) {
+ lst = fvm_locator_get_interior_list(coupl->localis_cel);
+ for (ind = 0 ; ind < _ncecpl ; ind++)
+ lcecpl[ind] = lst[ind];
+ }
+
+ if (_nfbcpl > 0) {
+ lst = fvm_locator_get_interior_list(coupl->localis_fbr);
+ for (ind = 0 ; ind < _nfbcpl ; ind++)
+ lfbcpl[ind] = lst[ind];
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Get the lists of not coupled cells and boundary faces (i.e. receiving but
+ * not localized) associated to a given coupling
+ *
+ * The number of cells and boundary faces, got with NBECPL(), are used
+ * for arguments coherency checks.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LENCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCENCP : --> : number of not coupled cells
+ * INTEGER NFBNCP : --> : number of not coupled boundary faces
+ * INTEGER LCENCP(*) : <-- : list of not coupled cells
+ * INTEGER LFBNCP(*) : <-- : list of not coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lencpl, LENCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *ncencp,
+ const cs_int_t *nfbncp,
+ cs_int_t *lcencp,
+ cs_int_t *lfbncp
+)
+{
+ cs_int_t ind;
+
+ cs_int_t _ncencp = 0;
+ cs_int_t _nfbncp = 0;
+ cs_sat_coupling_t *coupl = NULL;
+
+ const cs_int_t *lst = NULL;
+
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ if (coupl->localis_cel != NULL)
+ _ncencp = fvm_locator_get_n_exterior(coupl->localis_cel);
+
+ if (coupl->localis_fbr != NULL)
+ _nfbncp = fvm_locator_get_n_exterior(coupl->localis_fbr);
+
+ if (*ncencp != _ncencp || *nfbncp != _nfbncp)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling %d: inconsistent arguments for LELNCP()\n"
+ "NCENCP = %d and NFBNCP = %d are indicated.\n"
+ "The values for this coupling should be %d and %d."),
+ *numcpl, (int)(*ncencp), (int)(*nfbncp),
+ (int)_ncencp, (int)_nfbncp);
+
+ /* Copy lists (would be useless with a pure C API) */
+
+ if (_ncencp > 0) {
+ lst = fvm_locator_get_exterior_list(coupl->localis_cel);
+ for (ind = 0 ; ind < _ncencp ; ind++)
+ lcencp[ind] = lst[ind];
+ }
+
+ if (_nfbncp > 0) {
+ lst = fvm_locator_get_exterior_list(coupl->localis_fbr);
+ for (ind = 0 ; ind < _nfbncp ; ind++)
+ lfbncp[ind] = lst[ind];
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Get the number of distant point associated to a given coupling
+ * and localized on the local domain
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NPDCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NCEDIS : <-- : number of distant cells
+ * INTEGER NFBDIS : <-- : numbre de distant boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (npdcpl, NPDCPL)
+(
+ const cs_int_t *numcpl,
+ cs_int_t *ncedis,
+ cs_int_t *nfbdis
+)
+{
+ cs_sat_coupling_t *coupl = NULL;
+
+ /* Verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ /* Get the number of points */
+
+ *ncedis = 0;
+ *nfbdis = 0;
+
+ if (coupl->localis_cel != NULL)
+ *ncedis = fvm_locator_get_n_dist_points(coupl->localis_cel);
+
+ if (coupl->localis_fbr != NULL)
+ *nfbdis = fvm_locator_get_n_dist_points(coupl->localis_fbr);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the distant points coordinates associated to a given coupling
+ * and a list of points, and the elements number and type (cell or face)
+ * "containing" this points.
+ *
+ * The number of distant points NBRPTS must be equal to one the arguments
+ * NCEDIS or NFBDIS given by NPDCPL(), and is given here for coherency checks
+ * between the arguments NUMCPL and ITYSUP.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE COOCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRPTS : --> : number of distant points
+ * INTEGER ITYDIS : --> : 1 : access to the points associated
+ * : : to the distant cells
+ * : : 2 : access to the points associated
+ * : : to the distant boundary faces
+ * INTEGER ITYLOC : <-- : 1 : localization on the local cells
+ * : : 2 : localization on the local faces
+ * INTEGER LOCPTS(*) : <-- : "containing" number associated to
+ * : : each point
+ * DOUBLE PRECISION COOPTS(3,*) : <-- : distant point coordinates
+ * DOUBLE PRECISION DJPPTS(3,*) : <-- : distant vectors to the coupled face
+ * DOUBLE PRECISION PNDPTS(*) : <-- : distant weighting coefficients
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (coocpl, COOCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrpts,
+ const cs_int_t *itydis,
+ cs_int_t *ityloc,
+ cs_int_t *locpts,
+ cs_real_t *coopts,
+ cs_real_t *djppts,
+ cs_real_t *dofpts,
+ cs_real_t *pndpts
+)
+{
+ cs_int_t ind, icoo;
+
+ cs_int_t n_pts_dist = 0;
+ cs_sat_coupling_t *coupl = NULL;
+ fvm_locator_t *localis = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ *ityloc = 0;
+
+ if (*itydis == 1) {
+ localis = coupl->localis_cel;
+ *ityloc = 1;
+ }
+ else if (*itydis == 2) {
+ localis = coupl->localis_fbr;
+ if (coupl->nbr_fbr_sup > 0)
+ *ityloc = 2;
+ else
+ *ityloc = 1;
+ }
+
+ if (localis != NULL)
+ n_pts_dist = fvm_locator_get_n_dist_points(localis);
+
+ if (*nbrpts != n_pts_dist)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling %d: inconsistent arguments for COOCPL()\n"
+ "ITYDIS = %d and NBRPTS = %d are indicated.\n"
+ "The value for NBRPTS should be %d."),
+ *numcpl, (int)(*itydis), (int)(*nbrpts), (int)n_pts_dist);
+
+ /* Creation the local lists */
+
+ if (localis != NULL) {
+
+ n_pts_dist = fvm_locator_get_n_dist_points(localis);
+
+ if (n_pts_dist > 0) {
+
+ const fvm_lnum_t *element;
+ const fvm_coord_t *coord;
+
+ element = fvm_locator_get_dist_locations(localis);
+ coord = fvm_locator_get_dist_coords(localis);
+
+ for (ind = 0 ; ind < n_pts_dist ; ind++) {
+ locpts[ind] = element[ind];
+ for (icoo = 0 ; icoo < 3 ; icoo++)
+ coopts[ind*3 + icoo] = coord[ind*3 + icoo];
+ }
+
+ if (*itydis == 2)
+ for (ind = 0 ; ind < n_pts_dist ; ind++)
+ for (icoo = 0 ; icoo < 3 ; icoo++) {
+ djppts[ind*3 + icoo] = coupl->distant_dist_fbr[ind*3 + icoo];
+ dofpts[ind*3 + icoo] = coupl->distant_of[ind*3 + icoo];
+ pndpts[ind] = coupl->distant_pond_fbr[ind];
+ }
+
+ }
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the weighting coefficient needed for a centred-like interpolation
+ * in the case of a coupling on boundary faces.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE PNDCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRCPL : --> : number of distant points
+ * INTEGER ITYLOC : <-- : 1 : localization on the local cells
+ * : : 2 : localization on the local faces
+ * DOUBLE PRECISION PONDCP(*) : <-- : weighting coefficients
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (pndcpl, PNDCPL)
+(
+ const cs_int_t *const numcpl,
+ const cs_int_t *const nbrpts,
+ cs_int_t *const ityloc,
+ cs_real_t *const pondcp,
+ cs_real_t *const distof
+)
+{
+ int icoo;
+ cs_int_t ind;
+ cs_int_t nfbcpl = 0;
+ cs_sat_coupling_t *coupl = NULL;
+ fvm_locator_t *localis = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ if (*ityloc == 1)
+ bft_error(__FILE__, __LINE__, 0,
+ _("The centred interpolation scheme is not available\n"
+ "when coupling cells"));
+ else if (*ityloc == 2)
+ localis = coupl->localis_fbr;
+
+
+ if (localis != NULL)
+ nfbcpl = fvm_locator_get_n_interior(localis);
+
+ if (*nbrpts != nfbcpl)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling %d: inconsistent arguments for PNDCPL().\n"
+ "ITYLOC = %d and NBRPTS = %d are indicated.\n"
+ "NBRPTS should be %d."),
+ *numcpl, (int)(*ityloc), (int)(*nbrpts), (int)nfbcpl);
+
+ /* Creation of the local lists */
+
+ if (localis != NULL) {
+
+ if (nfbcpl > 0) {
+
+ for (ind = 0 ; ind < nfbcpl ; ind++) {
+ pondcp[ind] = coupl->local_pond_fbr[ind];
+ for (icoo = 0 ; icoo < 3 ; icoo++)
+ distof[ind*3 + icoo] = coupl->local_of[ind*3 + icoo];
+ }
+
+ }
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange a variable associated to a set of point and a coupling.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE VARCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRDIS : --> : number of values to send
+ * INTEGER NBRLOC : --> : number of values to receive
+ * INTEGER ITYVAR : --> : 1 : variables defined at cells
+ * : : 2 : variables defined at faces
+ * DOUBLE PRECISION VARDIS(*) : --> : distant variable(to send)
+ * DOUBLE PRECISION VARLOC(*) : <-- : local variable (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (varcpl, VARCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrdis,
+ const cs_int_t *nbrloc,
+ const cs_int_t *ityvar,
+ cs_real_t *vardis,
+ cs_real_t *varloc
+)
+{
+ cs_int_t n_val_dist_ref = 0;
+ cs_int_t n_val_loc_ref = 0;
+ cs_real_t *val_dist = NULL;
+ cs_real_t *val_loc = NULL;
+ cs_sat_coupling_t *coupl = NULL;
+ fvm_locator_t *localis = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ if (*ityvar == 1)
+ localis = coupl->localis_cel;
+ else if (*ityvar == 2)
+ localis = coupl->localis_fbr;
+
+ if (localis != NULL) {
+ n_val_dist_ref = fvm_locator_get_n_dist_points(localis);
+ n_val_loc_ref = fvm_locator_get_n_interior(localis);
+ }
+
+ if (*nbrdis > 0 && *nbrdis != n_val_dist_ref)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling %d: inconsistent arguments for VARCPL()\n"
+ "ITYVAR = %d and NBRDIS = %d are indicated.\n"
+ "NBRDIS should be 0 or %d."),
+ *numcpl, (int)(*ityvar), (int)(*nbrdis), (int)n_val_dist_ref);
+
+ if (*nbrloc > 0 && *nbrloc != n_val_loc_ref)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling %d: inconsistent arguments for VARCPL()\n"
+ "ITYVAR = %d and NBRLOC = %d are indicated.\n"
+ "NBRLOC should be 0 or %d."),
+ *numcpl, (int)(*ityvar), (int)(*nbrloc), (int)n_val_loc_ref);
+
+ /* Create the local lists */
+
+ if (localis != NULL) {
+
+ if (*nbrdis > 0)
+ val_dist = vardis;
+ if (*nbrloc > 0)
+ val_loc = varloc;
+
+ fvm_locator_exchange_point_var(localis,
+ val_dist,
+ val_loc,
+ NULL,
+ sizeof(cs_real_t),
+ 1,
+ 0);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Array of integers exchange, associated to a given coupling.
+ *
+ * It is assumed that the arrays have the same size and the same values on
+ * each group of processus (local and distant).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TBICPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRDIS : --> : number of values to send
+ * INTEGER NBRLOC : --> : number of values to receive
+ * INTEGER TABDIS(*) : --> : distant values (to send)
+ * INTEGER TABLOC(*) : <-- : local values (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tbicpl, TBICPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrdis,
+ const cs_int_t *nbrloc,
+ cs_int_t *vardis,
+ cs_int_t *varloc
+)
+{
+ cs_int_t ind;
+ cs_int_t nbr = 0;
+ cs_bool_t distant = false;
+
+#if defined(HAVE_MPI)
+
+ MPI_Status status;
+
+ cs_sat_coupling_t *coupl = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ if (coupl->comm != MPI_COMM_NULL) {
+
+ distant = true;
+
+ /* Exchange between the groups master node */
+
+ if (cs_glob_rank_id < 1)
+ MPI_Sendrecv(vardis, *nbrdis, CS_MPI_INT, coupl->dist_root_rank, 0,
+ varloc, *nbrloc, CS_MPI_INT, coupl->dist_root_rank, 0,
+ coupl->comm, &status);
+
+ /* Synchronization inside a group */
+
+ if (cs_glob_n_ranks > 1)
+ MPI_Bcast (varloc, *nbrloc, CS_MPI_INT, 0, cs_glob_mpi_comm);
+
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ if (distant == false) {
+
+ nbr = CS_MIN(*nbrdis, *nbrloc);
+
+ for (ind = 0; ind < nbr; ind++)
+ varloc[ind] = vardis[ind];
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Array of reals exchange, associated to a given coupling.
+ *
+ * It is assumed that the arrays have the same size and the same values on
+ * each group of processus (local and distant).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TBRCPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER NBRDIS : --> : number of values to send
+ * INTEGER NBRLOC : --> : number of values to receive
+ * DOUBLE PRECISION TABDIS(*) : --> : distant values (to send)
+ * DOUBLE PRECISION TABLOC(*) : <-- : local values (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tbrcpl, TBRCPL)
+(
+ const cs_int_t *numcpl,
+ const cs_int_t *nbrdis,
+ const cs_int_t *nbrloc,
+ cs_real_t *vardis,
+ cs_real_t *varloc
+)
+{
+ cs_int_t ind;
+ cs_int_t nbr = 0;
+ cs_bool_t distant = false;
+
+#if defined(HAVE_MPI)
+
+ MPI_Status status;
+
+ cs_sat_coupling_t *coupl = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ if (coupl->comm != MPI_COMM_NULL) {
+
+ distant = true;
+
+ /* Exchange between the groups master node */
+
+ if (cs_glob_rank_id < 1)
+ MPI_Sendrecv(vardis, *nbrdis, CS_MPI_REAL, coupl->dist_root_rank, 0,
+ varloc, *nbrloc, CS_MPI_REAL, coupl->dist_root_rank, 0,
+ coupl->comm, &status);
+
+ /* Synchronization inside a group */
+
+ if (cs_glob_n_ranks > 1)
+ MPI_Bcast(varloc, *nbrloc, CS_MPI_REAL, 0, cs_glob_mpi_comm);
+
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ if (distant == false) {
+
+ nbr = CS_MIN(*nbrdis, *nbrloc);
+
+ for (ind = 0; ind < nbr; ind++)
+ varloc[ind] = vardis[ind];
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the maximum value of an integer variable associated to a coupling.
+ *
+ * It is assumed that the integer value is the same for each group of
+ * processus (local and distant).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE MXICPL
+ * *****************
+ *
+ * INTEGER NUMCPL : --> : coupling number
+ * INTEGER VALDIS : --> : distant value (to send)
+ * INTEGER VALMAX : <-- : local maximum (to receive)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (mxicpl, MXICPL)
+(
+ const cs_int_t *numcpl,
+ cs_int_t *vardis,
+ cs_int_t *varmax
+)
+{
+ cs_bool_t distant = false;
+
+#if defined(_CS_HAVE_MPI)
+
+ cs_sat_coupling_t *coupl = NULL;
+
+ /* Initializations and verifications */
+
+ if (*numcpl < 1 || *numcpl > cs_glob_nbr_couplages)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible coupling number %d; there are %d couplings"),
+ *numcpl, cs_glob_nbr_couplages);
+ else
+ coupl = cs_glob_couplages[*numcpl - 1];
+
+ if (coupl->comm != MPI_COMM_NULL) {
+
+ distant = true;
+
+ MPI_Allreduce(vardis, varmax, 1, CS_MPI_INT, MPI_MAX, coupl->comm);
+
+ }
+
+#endif /* defined(_CS_HAVE_MPI) */
+
+ if (distant == false) {
+
+ *varmax = *vardis;
+
+ }
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Add a coupling.
+ *
+ * Couplings are allowed either with process totally distinct from the
+ * application communicator (cs_glob_mpi_comm), or within this same
+ * communicator.
+ *
+ * parameters:
+ * rang_deb <-- root rank of distant process leader in MPI_COMM_WORLD
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sat_coupling_add(cs_int_t rang_deb)
+{
+ cs_sat_coupling_t *couplage = NULL;
+
+ /* Create the associated structure */
+
+ couplage = _sat_coupling_create(rang_deb);
+
+ /* Increase the couplings global array if necessary */
+
+ if (cs_glob_nbr_couplages == cs_glob_nbr_couplages_max) {
+
+ if (cs_glob_nbr_couplages_max == 0)
+ cs_glob_nbr_couplages_max = 2;
+ else
+ cs_glob_nbr_couplages_max *= 2;
+
+ BFT_REALLOC(cs_glob_couplages,
+ cs_glob_nbr_couplages_max,
+ cs_sat_coupling_t *);
+
+ }
+
+ /* Associate the new coupling to the structure */
+
+ cs_glob_couplages[cs_glob_nbr_couplages] = couplage;
+
+ cs_glob_nbr_couplages += 1;
+
+ return;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy all couplings
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sat_coupling_all_finalize(void)
+{
+ int i;
+
+ for (i = 0 ; i < cs_glob_nbr_couplages ; i++)
+ _sat_coupling_destroy(cs_glob_couplages[i]);
+
+ BFT_FREE(cs_glob_couplages);
+
+ cs_glob_nbr_couplages = 0;
+ cs_glob_nbr_couplages_max = 0;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_search.c b/src/base/cs_search.c
new file mode 100644
index 0000000..7534846
--- /dev/null
+++ b/src/base/cs_search.c
@@ -0,0 +1,256 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Subroutines to search elements in arrays
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *---------------------------------------------------------------------------*/
+
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *---------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *---------------------------------------------------------------------------*/
+
+#include "cs_search.h"
+
+/*---------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Macro and type definitions
+ *===========================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search (binary search). Array or list must be ordered.
+ *
+ * parameters:
+ * start <-- start search from this index
+ * end <-- end search to this index
+ * num <-- find index for this number
+ * lst <-- list of ordered numbers to scan
+ *
+ * returns:
+ * id associated to the current number. If not found, returned -1.
+ *---------------------------------------------------------------------------*/
+
+inline static int
+_binary_search(int start,
+ int end,
+ cs_int_t num,
+ const cs_int_t lst[])
+{
+ if (lst[start] == num)
+ return start;
+
+ else if (lst[end] == num)
+ return end;
+
+ else {
+
+ int range = (end - start)/2;
+ int middle = start + range;
+
+ assert(middle <= end);
+
+ if (range == 0)
+ return -1;
+
+ if ( lst[middle] > num )
+ return _binary_search(start, middle, num, lst);
+ else
+ return _binary_search(middle, end, num, lst);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search (binary search). Array or list must be ordered.
+ *
+ * parameters:
+ * start <-- start search from this index
+ * end <-- end search to this index
+ * gnum <-- find index for this number
+ * lst <-- list of ordered global numbers to scan
+ *
+ * returns:
+ * id associated to the current number. If not found, returned -1.
+ *---------------------------------------------------------------------------*/
+
+inline static int
+_binary_gsearch(int start,
+ int end,
+ fvm_gnum_t gnum,
+ const fvm_gnum_t lst[])
+{
+ if (lst[start] == gnum)
+ return start;
+
+ else if (lst[end] == gnum)
+ return end;
+
+ else {
+
+ int range = (end - start)/2;
+ int middle = start + range;
+
+ if (range == 0)
+ return -1;
+
+ if ( lst[middle] > gnum )
+ return _binary_gsearch(start, middle, gnum, lst);
+ else
+ return _binary_gsearch(middle, end, gnum, lst);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search (binary search). Index must be ordered.
+ *
+ * parameters:
+ * start <-- start search from this index
+ * end <-- end search to this index
+ * gnum <-- number for which we want the position in index
+ * index <-- index array
+ *
+ * returns:
+ * id in index of gnum. If not found, returned -1.
+ *----------------------------------------------------------------------------*/
+
+inline static int
+_binary_index_gsearch(int start,
+ int end,
+ fvm_gnum_t gnum,
+ const fvm_gnum_t index[])
+{
+ if (end - start < 2)
+ return start;
+
+ else {
+
+ int middle_id = (end - start)/2 + start;
+
+ if (gnum < index[middle_id])
+ return _binary_index_gsearch(start, middle_id, gnum,index);
+ else
+ return _binary_index_gsearch(middle_id, end, gnum, index);
+
+ }
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *===========================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search. Array or list must be ordered.
+ *
+ * parameters:
+ * size <-- size of list
+ * gnum <-- find index for this number
+ * lst <-- list of ordered global numbers to scan
+ *
+ * returns:
+ * id associated to the current number. If not found, returned -1.
+ *---------------------------------------------------------------------------*/
+
+int
+cs_search_g_binary(size_t size,
+ fvm_gnum_t gnum,
+ const fvm_gnum_t lst[])
+{
+ return _binary_gsearch(0, size - 1, gnum, lst);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search (binary search). Array or list must be ordered.
+ *
+ * parameters:
+ * size <-- size of list
+ * num <-- find index for this number
+ * lst <-- list of ordered numbers to scan
+ *
+ * returns:
+ * id associated to the current number. If not found, return -1.
+ *---------------------------------------------------------------------------*/
+
+int
+cs_search_binary(size_t size,
+ cs_int_t num,
+ const cs_int_t lst[])
+{
+ return _binary_search(0, size - 1, num, lst);
+}
+
+/*----------------------------------------------------------------------------
+ * Get the position inside an array related to a value thanks to a binary
+ * search (binary search). Index must be ordered and without null range.
+ *
+ * parameters:
+ * size <-- size of index -1
+ * gnum <-- number for which we want the position in index
+ * index <-- index array
+ *
+ * returns:
+ * id in index of gnum. If not found, returned -1.
+ *---------------------------------------------------------------------------*/
+
+int
+cs_search_gindex_binary(size_t size,
+ fvm_gnum_t gnum,
+ const fvm_gnum_t index[])
+{
+ return _binary_index_gsearch(0, size, gnum, index);
+}
+
+/*---------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_selector.c b/src/base/cs_selector.c
new file mode 100644
index 0000000..d6563fe
--- /dev/null
+++ b/src/base/cs_selector.c
@@ -0,0 +1,325 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#include <bft_mem_usage.h>
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_sys_info.h>
+#include <bft_timer.h>
+
+#include "cs_mesh.h"
+#include "cs_selector.h"
+
+#include "fvm_selector.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define CS_SELECTOR_STR_LEN 127
+
+/*=============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build a list of boundary faces verifying a given selection criteria.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csgfbr, CSGFBR)
+(
+ const char *const fstr, /* <-- Fortran string */
+ cs_int_t *const len, /* <-- String Length */
+ cs_int_t *const n_faces, /* --> number of faces */
+ cs_int_t *const face_list /* --> face list */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ char _c_string[CS_SELECTOR_STR_LEN + 1];
+ char *c_string = _c_string;
+ int i;
+ int c_len = *len -1;
+
+ /* Initialization */
+
+ *n_faces = 0;
+
+ /* Copy fstr without last blanks */
+ while(fstr[c_len--] == ' ' && c_len >= 0);
+
+ if (c_len < -1)
+ return;
+
+ c_len += 2;
+
+ if (c_len > CS_SELECTOR_STR_LEN)
+ BFT_MALLOC(c_string, c_len + 1, char);
+
+ for(i = 0; i < c_len; i++)
+ c_string[i] = fstr[i];
+ c_string[c_len] = '\0';
+
+ /* Get faces with C string */
+
+ cs_selector_get_b_face_list(c_string, n_faces, face_list);
+
+ if (c_string != _c_string)
+ BFT_FREE(c_string);
+}
+
+/*----------------------------------------------------------------------------
+ * Build a list of interior faces verifying a given selection criteria.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csgfac, CSGFAC)
+(
+ const char *const fstr, /* <-- Fortran string */
+ cs_int_t *const len, /* <-- String Length */
+ cs_int_t *const n_faces, /* --> number of faces */
+ cs_int_t *const face_list /* --> face list */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ char _c_string[CS_SELECTOR_STR_LEN + 1];
+ char *c_string = _c_string;
+ int i;
+ int c_len = *len -1;
+
+ /* Initialization */
+
+ *n_faces = 0;
+
+ /* Copy fstr without last blanks */
+ while(fstr[c_len--] == ' ' && c_len >= 0);
+
+ if (c_len < -1)
+ return;
+
+ c_len += 2;
+
+ if (c_len > CS_SELECTOR_STR_LEN)
+ BFT_MALLOC(c_string, c_len + 1, char);
+
+ for(i = 0; i < c_len; i++)
+ c_string[i] = fstr[i];
+ c_string[c_len] = '\0';
+
+ /* Get faces with C string */
+
+ cs_selector_get_i_face_list(c_string, n_faces, face_list);
+
+ if (c_string != _c_string)
+ BFT_FREE(c_string);
+}
+
+/*----------------------------------------------------------------------------
+ * Build a list of cells verifying a given selection criteria.
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(csgcel, CSGCEL)
+(
+ const char *const fstr, /* <-- Fortran string */
+ cs_int_t *const len, /* <-- String Length */
+ cs_int_t *const n_cells, /* --> number of cells */
+ cs_int_t *const cell_list /* --> cell list */
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ char _c_string[CS_SELECTOR_STR_LEN + 1];
+ char *c_string = _c_string;
+ int i;
+ int c_len = *len -1;
+
+ /* Initialization */
+
+ *n_cells = 0;
+
+ /* Copy fstr without last blanks */
+ while(fstr[c_len--] == ' ' && c_len >= 0);
+
+ if (c_len < -1)
+ return;
+
+ c_len += 2;
+
+ if (c_len > CS_SELECTOR_STR_LEN)
+ BFT_MALLOC(c_string, c_len + 1, char);
+
+ for(i = 0; i < c_len; i++)
+ c_string[i] = fstr[i];
+ c_string[c_len] = '\0';
+
+ /* Get cells with C string */
+
+ cs_selector_get_cell_list(c_string, n_cells, cell_list);
+
+ if (c_string != _c_string)
+ BFT_FREE(c_string);
+}
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Fill a list of boundary faces verifying a given selection criteria.
+ *
+ * parameters:
+ * criteria <-- selection criteria string
+ * n_b_faces --> number of selected interior faces
+ * b_face_list --> list of selected boundary faces
+ * (1 to n, preallocated to cs_glob_mesh->n_b_faces)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_selector_get_b_face_list(const char *criteria,
+ fvm_lnum_t *n_b_faces,
+ fvm_lnum_t b_face_list[])
+{
+ int c_id;
+
+ *n_b_faces = 0;
+
+ c_id = fvm_selector_get_list(cs_glob_mesh->select_b_faces,
+ criteria,
+ n_b_faces,
+ b_face_list);
+
+ if (fvm_selector_n_missing(cs_glob_mesh->select_b_faces, c_id) > 0) {
+ const char *missing
+ = fvm_selector_get_missing(cs_glob_mesh->select_b_faces, c_id, 0);
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("The group or attribute \"%s\" in the selection\n"
+ "criteria:\n"
+ "\"%s\"\n"
+ " does not correspond to any boundary face.\n"),
+ missing, criteria);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Fill a list of interior faces verifying a given selection criteria.
+ *
+ * parameters:
+ * criteria <-- selection criteria string
+ * n_i_faces --> number of selected interior faces
+ * i_face_list --> list of selected interior faces
+ * (1 to n, preallocated to cs_glob_mesh->n_i_faces)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_selector_get_i_face_list(const char *criteria,
+ fvm_lnum_t *n_i_faces,
+ fvm_lnum_t i_face_list[])
+{
+ int c_id;
+
+ *n_i_faces = 0;
+
+ c_id = fvm_selector_get_list(cs_glob_mesh->select_i_faces,
+ criteria,
+ n_i_faces,
+ i_face_list);
+
+ if (fvm_selector_n_missing(cs_glob_mesh->select_i_faces, c_id) > 0) {
+ const char *missing
+ = fvm_selector_get_missing(cs_glob_mesh->select_i_faces, c_id, 0);
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("The group or attribute \"%s\" in the selection\n"
+ "criteria:\n"
+ "\"%s\"\n"
+ " does not correspond to any interior face.\n"),
+ missing, criteria);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Fill a list of cells verifying a given selection criteria.
+ *
+ * parameters:
+ * criteria <-- selection criteria string
+ * n_cells --> number of selected cells
+ * cell_list --> list of selected cells
+ * (1 to n, preallocated to cs_glob_mesh->n_cells)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_selector_get_cell_list(const char *criteria,
+ fvm_lnum_t *n_cells,
+ fvm_lnum_t cell_list[])
+{
+ int c_id;
+
+ *n_cells = 0;
+
+ c_id = fvm_selector_get_list(cs_glob_mesh->select_cells,
+ criteria,
+ n_cells,
+ cell_list);
+
+ if (fvm_selector_n_missing(cs_glob_mesh->select_cells, c_id) > 0) {
+ const char *missing
+ = fvm_selector_get_missing(cs_glob_mesh->select_cells, c_id, 0);
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf(_("The group or attribute \"%s\" in the selection\n"
+ "criteria:\n"
+ "\"%s\"\n"
+ " does not correspond to any cell.\n"),
+ missing, criteria);
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_selector_f2c.f90 b/src/base/cs_selector_f2c.f90
new file mode 100644
index 0000000..071b150
--- /dev/null
+++ b/src/base/cs_selector_f2c.f90
@@ -0,0 +1,195 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine getfbr &
+!=================
+
+ ( fstr , facnb, faces)
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONSTRUCTION DE LA LISTE DES FACES DE BORD CORRESPONDANT A
+! A L'INTERPRETATION DE LA CHAINE DE CARACTERE FSTR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! fstr ! a ! <-- ! chaine a interpreter !
+! faces ! e ! <- ! faces selectionnees !
+! facnb ! e ! <- ! nombre de faces selectionnees !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*(*) fstr
+integer faces(*), facnb
+
+! VARIABLES LOCALES
+
+integer lenstr
+
+!===============================================================================
+
+lenstr=len(fstr)
+call csgfbr(fstr, lenstr, facnb, faces)
+
+return
+
+end
+subroutine getcel &
+!=================
+
+ ( fstr , cellnb, cells)
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONSTRUCTION DE LA LISTE DES CELLULES CORRESPONDANT A
+! A L'INTERPRETATION DE LA CHAINE DE CARACTERE FSTR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! fstr ! a ! <-- ! chaine a interpreter !
+! cells ! e ! <- ! faces selectionnees !
+! cellnb ! e ! <- ! nombre de faces selectionnees !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*(*) fstr
+integer cells(*), cellnb
+
+! VARIABLES LOCALES
+
+integer lenstr
+
+!===============================================================================
+
+lenstr=len(fstr)
+call csgcel(fstr, lenstr, cellnb, cells)
+
+return
+
+end
+subroutine getfac &
+!=================
+
+ ( fstr , facnb, faces)
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONSTRUCTION DE LA LISTE DES FACES INTERNES CORRESPONDANT A
+! A L'INTERPRETATION DE LA CHAINE DE CARACTERE FSTR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! fstr ! a ! <-- ! chaine a interpreter !
+! cells ! e ! <- ! faces selectionnees !
+! cellnb ! e ! <- ! nombre de faces selectionnees !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*(*) fstr
+integer faces(*), facnb
+
+! VARIABLES LOCALES
+
+integer lenstr
+
+!===============================================================================
+
+lenstr=len(fstr)
+call csgfac(fstr, lenstr, facnb, faces)
+
+return
+
+end
diff --git a/src/base/cs_sles.c b/src/base/cs_sles.c
new file mode 100644
index 0000000..205e362
--- /dev/null
+++ b/src/base/cs_sles.c
@@ -0,0 +1,2258 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Sparse Linear Equation Solvers
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_blas.h"
+#include "cs_mesh.h"
+#include "cs_matrix.h"
+#include "cs_perio.h"
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_sles.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define EPZERO 1.E-12
+#define RINFIN 1.E+30
+
+#if !defined(HUGE_VAL)
+#define HUGE_VAL 1.E+12
+#endif
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/* Basic per linear system options and logging */
+/*---------------------------------------------*/
+
+typedef struct _cs_sles_info_t {
+
+ char *name; /* System name */
+ cs_sles_type_t type; /* Solver type */
+
+ unsigned n_calls; /* Number of times system solved */
+
+ unsigned n_iterations_last; /* Number of iterations for last
+ system resolution */
+ unsigned n_iterations_min; /* Minimum number ot iterations
+ in system resolution history */
+ unsigned n_iterations_max; /* Maximum number ot iterations
+ in system resolution history */
+ unsigned long long n_iterations_tot; /* Total accumulated number of
+ iterations */
+
+ double wt_tot; /* Total wall-clock time used */
+ double cpu_tot; /* Total (local) CPU used */
+
+} cs_sles_info_t;
+
+/* Convergence testing and tracking */
+/*----------------------------------*/
+
+typedef struct _cs_sles_convergence_t {
+
+ int verbosity; /* Verbosity level */
+
+ unsigned n_iterations; /* Current number of iterations */
+ unsigned n_iterations_max; /* Maximum number of iterations */
+
+ double precision; /* Precision limit */
+ double r_norm; /* Residue normalization */
+ double residue; /* Current residue */
+ double initial_residue; /* Initial residue */
+
+} cs_sles_convergence_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+static int cs_glob_sles_n_systems = 0; /* Current number of systems */
+static int cs_glob_sles_n_max_systems = 0; /* Max. number of sytems for
+ cs_glob_sles_systems. */
+
+static cs_sles_info_t **cs_glob_sles_systems = NULL; /* System info array */
+
+/*
+ Matrix structures re-used for various resolutions.
+
+ These structures are kept throughout the whole run, to avoid paying the
+ CPU overhead for their construction at each system resolution
+ (at the cost of extra memory use, depending on the chosen structure).
+
+ Two simultaneous matrixes may be needed for some solvers: one for the
+ linear system, one for the preconditionner.
+ We always have at least one structure of "native" matrix type, as
+ this type incurs negligible memory and assignment cpu overhead;
+ we use it for Jacobi (where the number of iterations done is often
+ small, and an assignment cost equivalent to a few matrix.vector
+ products may not be amortized).
+*/
+
+cs_matrix_t *cs_glob_sles_base_matrix = NULL;
+cs_matrix_t *cs_glob_sles_native_matrix = NULL;
+
+/* Sparse linear equation solver type names */
+
+/* Short names for solver types */
+
+const char *cs_sles_type_name[] = {N_("Conjugate gradient"),
+ N_("Jacobi"),
+ N_("Bi-CGstab")};
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Return pointer to new linear system info structure.
+ *
+ * parameters:
+ * name <-- system name
+ * type <-- resolution method
+ *
+ * returns:
+ * pointer to newly created linear system info structure
+ *----------------------------------------------------------------------------*/
+
+static cs_sles_info_t *
+_sles_info_create(const char *name,
+ cs_sles_type_t type)
+{
+ cs_sles_info_t *new_info = NULL;
+
+ BFT_MALLOC(new_info, 1, cs_sles_info_t);
+ BFT_MALLOC(new_info->name, strlen(name) + 1, char);
+
+ strcpy(new_info->name, name);
+ new_info->type = type;
+
+ new_info->n_calls = 0;
+ new_info->n_iterations_min = 0;
+ new_info->n_iterations_max = 0;
+ new_info->n_iterations_last = 0;
+ new_info->n_iterations_tot = 0;
+
+ new_info->wt_tot = 0.0;
+ new_info->cpu_tot = 0.0;
+
+ return new_info;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy linear system info structure.
+ *
+ * parameters:
+ * this_info <-> pointer to linear system info structure pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_sles_info_destroy(cs_sles_info_t **this_info)
+{
+ if (*this_info != NULL) {
+ BFT_FREE((*this_info)->name);
+ BFT_FREE(*this_info);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Output information regarding linear system resolution.
+ *
+ * parameters:
+ * this_info <-> pointer to linear system info structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_sles_info_dump(cs_sles_info_t *this_info)
+{
+ int n_calls = this_info->n_calls;
+ int n_it_min = this_info->n_iterations_min;
+ int n_it_max = this_info->n_iterations_max;
+ int n_it_mean = (int)( this_info->n_iterations_tot
+ / ((unsigned long long)n_calls));
+
+ bft_printf(_("\n"
+ "Summary of resolutions for %s (%s):\n"
+ "\n"
+ " Number of calls: %d\n"
+ " Minimum number of iterations: %d\n"
+ " Maximum number of iterations: %d\n"
+ " Mean number of iterations: %d\n"
+ " Total elapsed time: %12.3f\n"),
+ this_info->name, cs_sles_type_name[this_info->type],
+ n_calls, n_it_min, n_it_max, n_it_mean,
+ this_info->wt_tot);
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ double cpu_min, cpu_max, cpu_tot;
+ double cpu_loc = this_info->cpu_tot;
+
+ MPI_Allreduce(&cpu_loc, &cpu_min, 1, MPI_DOUBLE, MPI_MIN,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(&cpu_loc, &cpu_max, 1, MPI_DOUBLE, MPI_MAX,
+ cs_glob_mpi_comm);
+ MPI_Allreduce(&cpu_loc, &cpu_tot, 1, MPI_DOUBLE, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ bft_printf(_(" Min local total CPU time: %12.3f\n"
+ " Max local total CPU time: %12.3f\n"
+ " Total CPU time: %12.3f\n"),
+ cpu_min, cpu_max, cpu_tot);
+
+ }
+
+#endif
+
+ if (cs_glob_n_ranks == 1)
+ bft_printf(_(" Total CPU time: %12.3f\n"),
+ this_info->cpu_tot);
+}
+
+/*----------------------------------------------------------------------------
+ * Return pointer to linear system info.
+ *
+ * If this system did not previously exist, it is added to the list of
+ * "known" systems.
+ *
+ * parameters:
+ * name <-- system name
+ * type <-- resolution method
+ *----------------------------------------------------------------------------*/
+
+static cs_sles_info_t *
+_find_or_add_system(const char *name,
+ cs_sles_type_t type)
+{
+ int ii, start_id, end_id, mid_id;
+ int cmp_ret = 1;
+
+ /* Use binary search to find system */
+
+ start_id = 0;
+ end_id = cs_glob_sles_n_systems - 1;
+ mid_id = start_id + ((end_id -start_id) / 2);
+
+ while (start_id <= end_id) {
+ cmp_ret = strcmp((cs_glob_sles_systems[mid_id])->name, name);
+ if (cmp_ret == 0)
+ cmp_ret = (cs_glob_sles_systems[mid_id])->type - type;
+ if (cmp_ret < 0)
+ start_id = mid_id + 1;
+ else if (cmp_ret > 0)
+ end_id = mid_id - 1;
+ else
+ break;
+ mid_id = start_id + ((end_id -start_id) / 2);
+ }
+
+ /* If found, return */
+
+ if (cmp_ret == 0)
+ return cs_glob_sles_systems[mid_id];
+
+ /* Reallocate global array if necessary */
+
+ if (cs_glob_sles_n_systems >= cs_glob_sles_n_max_systems) {
+
+ if (cs_glob_sles_n_max_systems == 0)
+ cs_glob_sles_n_max_systems = 10;
+ else
+ cs_glob_sles_n_max_systems *= 2;
+ BFT_REALLOC(cs_glob_sles_systems,
+ cs_glob_sles_n_max_systems,
+ cs_sles_info_t*);
+
+ }
+
+ /* Insert in sorted list */
+
+ for (ii = cs_glob_sles_n_systems; ii > mid_id; ii--)
+ cs_glob_sles_systems[ii] = cs_glob_sles_systems[ii - 1];
+
+ cs_glob_sles_systems[mid_id] = _sles_info_create(name,
+ type);
+ cs_glob_sles_n_systems += 1;
+
+ return cs_glob_sles_systems[mid_id];
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize or reset convergence info structure.
+ *
+ * parameters:
+ * solver_name <-- solver name
+ * var_name <-- variable name
+ * convergence <-> Convergence info structure
+ * verbosity <-- Verbosity level
+ * n_iter_max <-- Maximum number of iterations
+ * precision <-- Precision limit
+ * r_norm <-- Residue normalization
+ * residue <-- Initial residue
+ *----------------------------------------------------------------------------*/
+
+static void
+_convergence_init(cs_sles_convergence_t *convergence,
+ const char *solver_name,
+ const char *var_name,
+ int verbosity,
+ unsigned n_iter_max,
+ double precision,
+ double r_norm,
+ double residue)
+{
+ convergence->verbosity = verbosity;
+
+ convergence->n_iterations = 0;
+ convergence->n_iterations_max = n_iter_max;
+
+ convergence->precision = precision;
+ convergence->r_norm = r_norm;
+ convergence->residue = residue;
+ convergence->initial_residue = residue;
+
+ if (verbosity > 1) {
+ bft_printf("%s [%s]:\n", solver_name, var_name);
+ if (verbosity > 2)
+ bft_printf(_(" n_iter res_abs res_nor\n"));
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Convergence test.
+ *
+ * parameters:
+ * solver_name <-- solver name
+ * var_name <-- variable name
+ * n_iter <-- Number of iterations done
+ * residue <-- Non normalized residue
+ * convergence <-> Convergence information structure
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * iteration number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+static int
+_convergence_test(const char *solver_name,
+ const char *var_name,
+ unsigned n_iter,
+ double residue,
+ cs_sles_convergence_t *convergence)
+{
+ const int verbosity = convergence->verbosity;
+
+ const char final_fmt[]
+ = N_(" n_iter : %5d, res_abs : %11.4e, res_nor : %11.4e\n");
+
+ /* Update conversion info structure */
+
+ convergence->n_iterations = n_iter;
+ convergence->residue = residue;
+
+ /* Print convergence values if high verbosity */
+
+ if (verbosity > 2)
+ bft_printf(" %5d %11.4e %11.4e\n",
+ n_iter, residue, residue/convergence->r_norm);
+
+ /* If not converged */
+
+ if (residue > convergence->precision * convergence->r_norm) {
+
+ if (n_iter < convergence->n_iterations_max) {
+ int diverges = 0;
+ if (residue > convergence->initial_residue * 10000.0 && residue > 100.)
+ diverges = 1;
+#if (_CS_STDC_VERSION >= 199901L)
+ else if (isnan(residue) || isinf(residue))
+ diverges = 1;
+#endif
+ if (diverges) {
+ bft_printf(_("\n\n"
+ "%s [%s]: divergence after %u iterations:\n"
+ " initial residual: %11.4e; current residual: %11.4e\n"),
+ solver_name, var_name,
+ convergence->n_iterations,
+ convergence->initial_residue, convergence->residue);
+ return -2;
+ }
+ else
+ return 0;
+ }
+ else {
+ if (verbosity > 0) {
+ if (verbosity == 1) /* Already output if verbosity > 1 */
+ bft_printf("%s [%s]:\n", solver_name, var_name);
+ if (verbosity <= 2) /* Already output if verbosity > 2 */
+ bft_printf(_(final_fmt),
+ n_iter, residue, residue/convergence->r_norm);
+ bft_printf(_(" @@ Warning: non convergence\n"));
+ }
+ return -1;
+ }
+
+ }
+
+ /* If converged */
+
+ else {
+ if (verbosity == 2) /* Already output if verbosity > 2 */
+ bft_printf(final_fmt, n_iter, residue, residue/convergence->r_norm);
+ return 1;
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute dot product, summing result over all ranks.
+ *
+ * parameters:
+ * n_elts <-- Local number of elements
+ * x <-- first vector in s = x.y
+ * y <-- second vector in s = x.y
+ *
+ * returns:
+ * result of s = x.y
+ *----------------------------------------------------------------------------*/
+
+inline static double
+_dot_product(cs_int_t n_elts,
+ const cs_real_t *x,
+ const cs_real_t *y)
+{
+ double s = cblas_ddot(n_elts, x, 1, y, 1);
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+ double _sum;
+ MPI_Allreduce(&s, &_sum, 1, MPI_DOUBLE, MPI_SUM, cs_glob_mpi_comm);
+ s = _sum;
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ return s;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute 2 dot products, summing result over all ranks.
+ *
+ * parameters:
+ * n_elts <-- Local number of elements
+ * x1 <-- first vector in s1 = x1.y1
+ * y1 <-- second vector in s1 = x1.y1
+ * x2 <-- first vector in s2 = x2.y2
+ * y2 <-- second vector in s2 = x2.y2
+ * s1 --> result of s1 = x1.y1
+ * s2 --> result of s2 = x2.y2
+ *----------------------------------------------------------------------------*/
+
+inline static void
+_dot_products_2(cs_int_t n_elts,
+ const cs_real_t *x1,
+ const cs_real_t *y1,
+ const cs_real_t *x2,
+ const cs_real_t *y2,
+ double *s1,
+ double *s2)
+{
+ cs_int_t ii;
+ double s[2];
+
+ /* If a term appears in both dot products, we do not use the BLAS,
+ as grouping both dot products in a same loop allows for better
+ cache use and often better performance than separate dot products
+ with even optimized BLAS */
+
+ if (x1 == x2 || x1 == y2 || y1 == x2 || y1 == y2) {
+
+#if ((defined(__INTEL_COMPILER) && defined(__ia64__)) || defined(__uxpvp__))
+
+ /* Use temporary variables to help compiler optimize */
+ double _s0 = 0.0, _s1 = 0.0;
+ for (ii = 0; ii < n_elts; ii++) {
+ _s0 += x1[ii] * y1[ii];
+ _s1 += x2[ii] * y2[ii];
+ }
+ s[0] = _s0; s[1] = _s1;
+
+#else
+
+ s[0] = 0.0; s[1] = 0.0;
+ for (ii = 0; ii < n_elts; ii++) {
+ s[0] += x1[ii] * y1[ii];
+ s[1] += x2[ii] * y2[ii];
+ }
+
+#endif
+
+ }
+ else {
+
+ s[0] = cblas_ddot(n_elts, x1, 1, y1, 1);
+ s[1] = cblas_ddot(n_elts, x2, 1, y2, 1);
+
+ }
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+ double _sum[2];
+ MPI_Allreduce(s, _sum, 2, MPI_DOUBLE, MPI_SUM, cs_glob_mpi_comm);
+ s[0] = _sum[0];
+ s[1] = _sum[1];
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ *s1 = s[0];
+ *s2 = s[1];
+}
+
+/*----------------------------------------------------------------------------
+ * Compute y <- x + alpha.y
+ *
+ * parameters:
+ * n <-- Number of elements in vectors x, y, z
+ * alpha <-- Scalar alpha
+ * x <-- Vector x (size: n)
+ * y <-> Vector y (size: n)
+ *----------------------------------------------------------------------------*/
+
+inline static void
+_y_aypx(cs_int_t n,
+ cs_real_t alpha,
+ cs_real_t *restrict x,
+ cs_real_t *restrict y)
+{
+#if defined(HAVE_ESSL)
+
+ dzaxpy(n, alpha, y, 1, x, 1, y, 1);
+
+#else
+
+ {
+ cs_int_t ii;
+
+#if defined(__xlc__)
+#pragma disjoint(alpha, *x, *y)
+#endif
+
+ for (ii = 0; ii < n; ii++)
+ y[ii] = x[ii] + (alpha * y[ii]);
+ }
+
+#endif
+
+}
+
+/*----------------------------------------------------------------------------
+ * Residue preconditioning Gk = C.Rk
+ *
+ * To increase the polynomial order with no major overhead, we may
+ * "implicit" the resolution using a red-black mesh coloring.
+ *
+ * poly_degree:
+ * 0: Gk = (1/ad).Rk
+ * 1: Gk = (1/ad - (1/ad).ax.(1/ad)).Rk
+ * 2: Gk = (1/ad - (1/ad).ax.(1/ad) + (1/ad).ax.(1/ad).ax.(1/ad)).Rk
+ *
+ * parameters:
+ * n_cells <-- Local number of cells
+ * poly_degree <-- preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * ad_inv <-- Inverse of matrix diagonal
+ * ax <-- Non-diagonal part of linear equation matrix
+ * rk <-- Residue vector
+ * gk --> Result vector
+ * wk --- Working array
+ *----------------------------------------------------------------------------*/
+
+static void
+_polynomial_preconditionning(cs_int_t n_cells,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ const cs_real_t *ad_inv,
+ const cs_matrix_t *ax,
+ const cs_real_t *rk,
+ cs_real_t *restrict gk,
+ cs_real_t *restrict wk)
+{
+ int deg_id;
+ cs_int_t ii;
+
+#if defined(__xlc__)
+#pragma disjoint(*ad_inv, *rk, *gk, *wk)
+#endif
+
+ /* Polynomial of degree 0 (diagonal)
+ *-----------------------------------*/
+
+ for (ii = 0; ii < n_cells; ii++)
+ gk[ii] = rk[ii] * ad_inv[ii];
+
+ /* Polynomial of degree n
+ *-----------------------
+ *
+ * n=1 n=2
+ * gk = ((1/ad) - (1/ad).ax.(1/ad) + (1/ad).ax.(1/ad).ax.(1/ad) + ... ).rk
+ */
+
+ for (deg_id = 1; deg_id <= poly_degree; deg_id++) {
+
+ /* Compute Wk = (A-diag).Gk */
+
+ cs_matrix_vector_multiply(rotation_mode, ax, gk, wk);
+
+ for (ii = 0; ii < n_cells; ii++)
+ gk[ii] = (rk[ii] - wk[ii]) * ad_inv[ii];
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Solution of (ad+ax).vx = Rhs using preconditioned conjugate gradient.
+ *
+ * Single-processor-optimized version.
+ *
+ * On entry, vx is considered initialized.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * a <-- Matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * (only necessary if poly_degree > 0)
+ * poly_degree <-- Preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * convergence <-- Convergence information structure
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * iteration number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+static int
+_conjugate_gradient_sp(const char *var_name,
+ const cs_matrix_t *a,
+ const cs_matrix_t *ax,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ cs_sles_convergence_t *convergence,
+ const cs_real_t *rhs,
+ cs_real_t *restrict vx,
+ size_t aux_size,
+ void *aux_vectors)
+{
+ const char *sles_name;
+ int cvg;
+ cs_int_t n_cols, n_rows, ii;
+ double ro_0, ro_1, alpha, rk_gkm1, rk_gk, beta, residue;
+ cs_real_t *_aux_vectors;
+ cs_real_t *restrict rk, *restrict dk, *restrict gk;
+ cs_real_t *restrict zk, *restrict wk, *restrict ad_inv;
+
+ unsigned n_iter = 1;
+
+ /* Tell IBM compiler not to alias */
+#if defined(__xlc__)
+#pragma disjoint(*rhs, *vx, *rk, *dk, *gk, *zk, *wk, *ad_inv)
+#endif
+
+ /* Preliminary calculations */
+ /*--------------------------*/
+
+ sles_name = _(cs_sles_type_name[CS_SLES_PCG]);
+
+ n_cols = cs_matrix_get_n_columns(a);
+ n_rows = cs_matrix_get_n_rows(a);
+
+ /* Allocate work arrays */
+
+ {
+ size_t n_wa = 5;
+ size_t wa_size = n_cols;
+
+ if (poly_degree > 0)
+ n_wa += 1;
+
+ if (aux_vectors == NULL || aux_size < (wa_size * n_wa))
+ BFT_MALLOC(_aux_vectors, wa_size * n_wa, cs_real_t);
+ else
+ _aux_vectors = aux_vectors;
+
+ ad_inv = _aux_vectors;
+
+ rk = _aux_vectors + wa_size;
+ dk = _aux_vectors + wa_size*2;
+ gk = _aux_vectors + wa_size*3;
+ zk = _aux_vectors + wa_size*4;
+
+ if (poly_degree > 0)
+ wk = _aux_vectors + wa_size*5;
+ else
+ wk = NULL;
+ }
+
+ cs_matrix_get_diagonal(a, ad_inv);
+ for (ii = 0; ii < n_rows; ii++)
+ ad_inv[ii] = 1.0 / ad_inv[ii];
+
+ /* Initialize work arrays (not necessary, just for debugging) */
+
+ for (ii = 0; ii < n_rows; ii++) {
+ rk[ii] = 0.0;
+ dk[ii] = 0.0;
+ gk[ii] = 0.0;
+ zk[ii] = 0.0;
+ }
+
+ /* Initialize iterative calculation */
+ /*----------------------------------*/
+
+ /* Residue and descent direction */
+
+ cs_matrix_vector_multiply(rotation_mode, a, vx, rk);
+
+ for (ii = 0; ii < n_rows; ii++) {
+ rk[ii] = rk[ii] - rhs[ii];
+ dk[ii] = rk[ii];
+ }
+
+ /* Polynomial preconditionning of order poly_degre */
+
+ _polynomial_preconditionning(n_rows,
+ poly_degree,
+ rotation_mode,
+ ad_inv,
+ ax,
+ rk,
+ gk,
+ wk);
+
+ /* Descent direction */
+ /*-------------------*/
+
+ memcpy(dk, gk, n_rows * sizeof(cs_real_t));
+
+ rk_gkm1 = _dot_product(n_rows, rk, gk);
+
+ cs_matrix_vector_multiply(rotation_mode, a, dk, zk);
+
+ /* Descent parameter */
+
+ _dot_products_2(n_rows, rk, dk, dk, zk, &ro_0, &ro_1);
+
+ alpha = - ro_0 / ro_1;
+
+ cblas_daxpy(n_rows, alpha, dk, 1, vx, 1);
+ cblas_daxpy(n_rows, alpha, zk, 1, rk, 1);
+
+ /* Convergence test */
+
+ residue = sqrt(_dot_product(n_rows, rk, rk));
+
+ cvg = _convergence_test(sles_name, var_name,
+ n_iter, residue, convergence);
+
+ /* Current Iteration */
+ /*-------------------*/
+
+ while (cvg == 0) {
+
+ n_iter += 1;
+
+ _polynomial_preconditionning(n_rows,
+ poly_degree,
+ rotation_mode,
+ ad_inv,
+ ax,
+ rk,
+ gk,
+ wk);
+
+ /* Descent parameter */
+
+ rk_gk = _dot_product(n_rows, rk, gk);
+
+ /* Complete descent parameter computation and matrix.vector product */
+
+ beta = rk_gk / rk_gkm1;
+ rk_gkm1 = rk_gk;
+
+ _y_aypx(n_rows, beta, gk, dk); /* dk <- gk + (beta.dk) */
+
+ cs_matrix_vector_multiply(rotation_mode, a, dk, zk);
+
+ _dot_products_2(n_rows, rk, dk, dk, zk, &ro_0, &ro_1);
+
+ alpha = - ro_0 / ro_1;
+
+ cblas_daxpy(n_rows, alpha, dk, 1, vx, 1);
+ cblas_daxpy(n_rows, alpha, zk, 1, rk, 1);
+
+ /* Convergence test */
+
+ residue = sqrt(_dot_product(n_rows, rk, rk));
+
+ cvg = _convergence_test(sles_name, var_name,
+ n_iter, residue, convergence);
+
+ }
+
+ if (_aux_vectors != aux_vectors)
+ BFT_FREE(_aux_vectors);
+
+ return cvg;
+}
+
+/*----------------------------------------------------------------------------
+ * Solution of (ad+ax).vx = Rhs using preconditioned conjugate gradient.
+ *
+ * Parallel-optimized version, groups dot products, at the cost of
+ * computation of the preconditionning for n+1 iterations instead of n.
+ *
+ * On entry, vx is considered initialized.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * a <-- Matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * (only necessary if poly_degree > 0)
+ * poly_degree <-- Preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * convergence <-- Convergence information structure
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * iteration number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+static int
+_conjugate_gradient_mp(const char *var_name,
+ const cs_matrix_t *a,
+ const cs_matrix_t *ax,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ cs_sles_convergence_t *convergence,
+ const cs_real_t *rhs,
+ cs_real_t *restrict vx,
+ size_t aux_size,
+ void *aux_vectors)
+{
+ const char *sles_name;
+ int cvg;
+ cs_int_t n_cols, n_rows, ii;
+ double ro_0, ro_1, alpha, rk_gkm1, rk_gk, beta, residue;
+ cs_real_t *_aux_vectors;
+ cs_real_t *restrict rk, *restrict dk, *restrict gk;
+ cs_real_t *restrict zk, *restrict wk, *restrict ad_inv;
+
+ unsigned n_iter = 1;
+
+ /* Tell IBM compiler not to alias */
+#if defined(__xlc__)
+#pragma disjoint(*rhs, *vx, *rk, *dk, *gk, *zk, *wk, *ad_inv)
+#endif
+
+ /* Preliminary calculations */
+ /*--------------------------*/
+
+ sles_name = _(cs_sles_type_name[CS_SLES_PCG]);
+
+ n_cols = cs_matrix_get_n_columns(a);
+ n_rows = cs_matrix_get_n_rows(a);
+
+ /* Allocate work arrays */
+
+ {
+ size_t n_wa = 5;
+ size_t wa_size = n_cols;
+
+ if (poly_degree > 0)
+ n_wa += 1;
+
+ if (aux_vectors == NULL || aux_size < (wa_size * n_wa))
+ BFT_MALLOC(_aux_vectors, wa_size * n_wa, cs_real_t);
+ else
+ _aux_vectors = aux_vectors;
+
+ ad_inv = _aux_vectors;
+
+ rk = _aux_vectors + wa_size;
+ dk = _aux_vectors + wa_size*2;
+ gk = _aux_vectors + wa_size*3;
+ zk = _aux_vectors + wa_size*4;
+
+ if (poly_degree > 0)
+ wk = _aux_vectors + wa_size*5;
+ else
+ wk = NULL;
+ }
+
+ cs_matrix_get_diagonal(a, ad_inv);
+ for (ii = 0; ii < n_rows; ii++)
+ ad_inv[ii] = 1.0 / ad_inv[ii];
+
+ /* Initialize work arrays (not necessary, just for debugging) */
+
+ for (ii = 0; ii < n_rows; ii++) {
+ rk[ii] = 0.0;
+ dk[ii] = 0.0;
+ gk[ii] = 0.0;
+ zk[ii] = 0.0;
+ }
+
+ /* Initialize iterative calculation */
+ /*----------------------------------*/
+
+ /* Residue and descent direction */
+
+ cs_matrix_vector_multiply(rotation_mode, a, vx, rk);
+
+ for (ii = 0; ii < n_rows; ii++) {
+ rk[ii] = rk[ii] - rhs[ii];
+ dk[ii] = rk[ii];
+ }
+
+ /* Polynomial preconditionning of order poly_degre */
+
+ _polynomial_preconditionning(n_rows,
+ poly_degree,
+ rotation_mode,
+ ad_inv,
+ ax,
+ rk,
+ gk,
+ wk);
+
+ /* Descent direction */
+ /*-------------------*/
+
+ memcpy(dk, gk, n_rows * sizeof(cs_real_t));
+
+ rk_gkm1 = _dot_product(n_rows, rk, gk);
+
+ cs_matrix_vector_multiply(rotation_mode, a, dk, zk);
+
+ /* Descent parameter */
+
+ _dot_products_2(n_rows, rk, dk, dk, zk, &ro_0, &ro_1);
+
+ alpha = - ro_0 / ro_1;
+
+ cblas_daxpy(n_rows, alpha, dk, 1, vx, 1);
+ cblas_daxpy(n_rows, alpha, zk, 1, rk, 1);
+
+ /* Convergence test */
+
+ residue = sqrt(_dot_product(n_rows, rk, rk));
+
+ cvg = _convergence_test(sles_name, var_name,
+ n_iter, residue, convergence);
+
+ /* Current Iteration */
+ /*-------------------*/
+
+ while (cvg == 0) {
+
+ _polynomial_preconditionning(n_rows,
+ poly_degree,
+ rotation_mode,
+ ad_inv,
+ ax,
+ rk,
+ gk,
+ wk);
+
+ /* compute residue and prepare descent parameter */
+
+ _dot_products_2(n_rows, rk, rk, rk, gk, &residue, &rk_gk);
+
+ residue = sqrt(residue);
+
+ /* Convergence test for end of previous iteration */
+
+ if (n_iter > 1)
+ cvg = _convergence_test(sles_name, var_name,
+ n_iter, residue, convergence);
+
+ if (cvg != 0)
+ break;
+
+ n_iter += 1;
+
+ /* Complete descent parameter computation and matrix.vector product */
+
+ beta = rk_gk / rk_gkm1;
+ rk_gkm1 = rk_gk;
+
+ _y_aypx(n_rows, beta, gk, dk); /* dk <- gk + (beta.dk) */
+
+ cs_matrix_vector_multiply(rotation_mode, a, dk, zk);
+
+ _dot_products_2(n_rows, rk, dk, dk, zk, &ro_0, &ro_1);
+
+ alpha = - ro_0 / ro_1;
+
+ cblas_daxpy(n_rows, alpha, dk, 1, vx, 1);
+ cblas_daxpy(n_rows, alpha, zk, 1, rk, 1);
+
+ }
+
+ if (_aux_vectors != aux_vectors)
+ BFT_FREE(_aux_vectors);
+
+ return cvg;
+}
+
+/*----------------------------------------------------------------------------
+ * Solution of (ad+ax).vx = Rhs using Jacobi.
+ *
+ * On entry, vx is considered initialized.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * ad <-- Diagonal part of linear equation matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * convergence <-- Convergence information structure
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * iteration number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+static int
+_jacobi(const char *var_name,
+ const cs_real_t *restrict ad,
+ const cs_matrix_t *ax,
+ cs_perio_rota_t rotation_mode,
+ cs_sles_convergence_t *convergence,
+ const cs_real_t *rhs,
+ cs_real_t *restrict vx,
+ size_t aux_size,
+ void *aux_vectors)
+{
+ const char *sles_name;
+ int cvg;
+ cs_int_t n_cols, n_rows, ii;
+ double res2, residue;
+ cs_real_t *_aux_vectors;
+ cs_real_t *restrict ad_inv, *restrict rk;
+
+ unsigned n_iter = 0;
+
+ /* Tell IBM compiler not to alias */
+#if defined(__xlc__)
+#pragma disjoint(*rhs, *vx, *ad, *ad_inv)
+#endif
+
+ /* Preliminary calculations */
+ /*--------------------------*/
+
+ sles_name = _(cs_sles_type_name[CS_SLES_JACOBI]);
+
+ n_cols = cs_matrix_get_n_columns(ax);
+ n_rows = cs_matrix_get_n_rows(ax);
+
+ /* Allocate work arrays */
+
+ {
+ size_t wa_size = n_cols;
+
+ if (aux_vectors == NULL || aux_size < (wa_size * 2))
+ BFT_MALLOC(_aux_vectors, wa_size * 2, cs_real_t);
+ else
+ _aux_vectors = aux_vectors;
+
+ ad_inv = _aux_vectors;
+ rk = _aux_vectors + wa_size;
+ }
+
+ for (ii = 0; ii < n_rows; ii++)
+ ad_inv[ii] = 1.0 / ad[ii];
+
+ cvg = 0;
+
+ /* Current iteration */
+ /*-------------------*/
+
+ while (cvg == 0) {
+
+ n_iter += 1;
+
+ memcpy(rk, vx, n_rows * sizeof(cs_real_t)); /* rk <- vx */
+
+ memcpy(vx, rhs, n_rows * sizeof(cs_real_t)); /* vx <- rhs */
+ for (ii = n_rows; ii < n_cols; ii++)
+ vx[ii] = 0.0;
+
+ /* Compute Vx <- Vx - (A-diag).Rk */
+
+ cs_matrix_alpha_a_x_p_beta_y(rotation_mode, -1.0, 1.0, ax, rk, vx);
+
+ for (ii = 0; ii < n_rows; ii++)
+ vx[ii] = vx[ii] * ad_inv[ii];
+
+ /* Compute residue */
+
+ res2 = 0.0;
+
+ for (ii = 0; ii < n_rows; ii++) {
+ register double r = ad[ii] * (vx[ii]-rk[ii]);
+ res2 += (r*r);
+ }
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+ double _sum;
+ MPI_Allreduce(&res2, &_sum, 1, MPI_DOUBLE, MPI_SUM,
+ cs_glob_mpi_comm);
+ res2 = _sum;
+ }
+
+#endif /* defined(HAVE_MPI) */
+
+ residue = sqrt(res2);
+
+ /* Convergence test */
+
+ cvg = _convergence_test(sles_name, var_name,
+ n_iter, residue, convergence);
+
+ }
+
+ if (_aux_vectors != aux_vectors)
+ BFT_FREE(_aux_vectors);
+
+ return cvg;
+}
+
+/*----------------------------------------------------------------------------
+ * Solution of (ad+ax).vx = Rhs using preconditioned Bi-CGSTAB.
+ *
+ * Parallel-optimized version, groups dot products, at the cost of
+ * computation of the preconditionning for n+1 iterations instead of n.
+ *
+ * On entry, vx is considered initialized.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * a <-- Matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * (only necessary if poly_degree > 0)
+ * poly_degree <-- Preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * convergence <-- Convergence information structure
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * iteration number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+static int
+_bi_cgstab(const char *var_name,
+ const cs_matrix_t *a,
+ const cs_matrix_t *ax,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ cs_sles_convergence_t *convergence,
+ const cs_real_t *rhs,
+ cs_real_t *restrict vx,
+ size_t aux_size,
+ void *aux_vectors)
+{
+ const char *sles_name;
+ int cvg;
+ cs_int_t n_cols, n_rows, ii;
+ double _epzero = EPZERO*EPZERO; /* smaller than epzero */
+ double ro_0, ro_1, alpha, beta, betam1, gamma, omega, ukres0;
+ double residue;
+ cs_real_t *_aux_vectors;
+ cs_real_t *restrict res0, *restrict rk, *restrict pk, *restrict zk;
+ cs_real_t *restrict uk, *restrict vk, *restrict ad_inv;
+
+ unsigned n_iter = 0;
+
+ /* Tell IBM compiler not to alias */
+#if defined(__xlc__)
+#pragma disjoint(*rhs, *vx, *res0, *rk, *pk, *zk, *uk, *vk, *ad_inv)
+#endif
+
+ /* Preliminary calculations */
+ /*--------------------------*/
+
+ sles_name = _(cs_sles_type_name[CS_SLES_BICGSTAB]);
+
+ n_cols = cs_matrix_get_n_columns(a);
+ n_rows = cs_matrix_get_n_rows(a);
+
+ /* Allocate work arrays */
+
+ {
+ size_t n_wa = 7;
+ size_t wa_size = n_cols;
+
+ if (aux_vectors == NULL || aux_size < (wa_size * n_wa))
+ BFT_MALLOC(_aux_vectors, wa_size * n_wa, cs_real_t);
+ else
+ _aux_vectors = aux_vectors;
+
+ ad_inv = _aux_vectors;
+
+ res0 = _aux_vectors + wa_size;
+ rk = _aux_vectors + wa_size*2;
+ pk = _aux_vectors + wa_size*3;
+ zk = _aux_vectors + wa_size*4;
+ uk = _aux_vectors + wa_size*5;
+ vk = _aux_vectors + wa_size*6;
+
+ }
+
+ cs_matrix_get_diagonal(a, ad_inv);
+ for (ii = 0; ii < n_rows; ii++)
+ ad_inv[ii] = 1.0 / ad_inv[ii];
+
+ /* Initialize work arrays (not necessary, just for debugging) */
+
+ for (ii = 0; ii < n_rows; ii++) {
+ res0[ii] = 0.0;
+ rk[ii] = 0.0;
+ pk[ii] = 0.0;
+ zk[ii] = 0.0;
+ uk[ii] = 0.0;
+ vk[ii] = 0.0;
+ }
+
+ /* Initialize iterative calculation */
+ /*----------------------------------*/
+
+ cs_matrix_vector_multiply(rotation_mode, a, vx, res0);
+
+ for (ii = 0; ii < n_rows; ii++) {
+ res0[ii] = -res0[ii] + rhs[ii];
+ rk[ii] = res0[ii];
+ }
+
+ alpha = 1.0;
+ betam1 = 1.0;
+ gamma = 1.0;
+
+ cvg = 0;
+
+ /* Current Iteration */
+ /*-------------------*/
+
+ while (cvg == 0) {
+
+ /* Compute beta and omega;
+ group dot products for new iteration's beta
+ and previous iteration's residue to reduce total latency */
+
+ if (n_iter == 0)
+ beta = _dot_product(n_rows, res0, rk);
+
+ else {
+
+ _dot_products_2(n_rows, res0, rk, rk, rk, &beta, &residue);
+ residue = sqrt(residue);
+
+ /* Convergence test */
+ cvg = _convergence_test(sles_name, var_name,
+ n_iter, residue, convergence);
+ if (cvg != 0)
+ break;
+ }
+
+ n_iter += 1;
+
+ if (CS_ABS(beta) < _epzero) {
+
+ if (convergence->verbosity == 2)
+ bft_printf(_(" n_iter : %5d, res_abs : %11.4e, res_nor : %11.4e\n"),
+ n_iter, residue, residue/convergence->r_norm);
+ else if (convergence->verbosity > 2)
+ bft_printf(" %5d %11.4e %11.4e\n",
+ n_iter, residue, residue/convergence->r_norm);
+
+ cvg = 0;
+ break;
+ }
+
+ if (CS_ABS(alpha) < _epzero) {
+ bft_printf
+ (_("\n\n"
+ "%s [%s]:\n"
+ " @@ Warning: non convergence and abort\n"
+ "\n"
+ " Alpha coefficient is lower than %12.4e\n"
+ "\n"
+ " The matrix cannot be considered as invertible anymore."),
+ sles_name, var_name, alpha);
+ cvg = -2;
+ break;
+ }
+
+ omega = beta*gamma / (alpha*betam1);
+ betam1 = beta;
+
+ /* Compute pk */
+
+ for (ii = 0; ii < n_rows; ii++) {
+ pk[ii] = rk[ii] + omega*(pk[ii] - alpha*uk[ii]);
+ }
+
+ /* Compute zk = c.pk */
+
+ _polynomial_preconditionning(n_rows,
+ poly_degree,
+ rotation_mode,
+ ad_inv,
+ ax,
+ pk,
+ zk,
+ uk);
+
+ /* Compute uk = A.zk */
+
+ cs_matrix_vector_multiply(rotation_mode, a, zk, uk);
+
+ /* Compute uk.res0 and gamma */
+
+ ukres0 = _dot_product(n_rows, uk, res0);
+
+ gamma = beta / ukres0;
+
+ /* First update of vx and rk */
+
+ cblas_daxpy(n_rows, gamma, zk, 1, vx, 1);
+ cblas_daxpy(n_rows, -gamma, uk, 1, rk, 1);
+
+ /* Compute zk = C.rk (zk is overwritten, vk is a working array */
+
+ _polynomial_preconditionning(n_rows,
+ poly_degree,
+ rotation_mode,
+ ad_inv,
+ ax,
+ rk,
+ zk,
+ vk);
+
+ /* Compute vk = A.zk and alpha */
+
+ cs_matrix_vector_multiply(rotation_mode, a, zk, vk);
+
+ _dot_products_2(n_rows, vk, rk, vk, vk, &ro_0, &ro_1);
+
+ if (ro_1 < _epzero) {
+ bft_printf
+ (_("\n\n"
+ "%s [%s]:\n"
+ " @@ Warning: non convergence and abort\n"
+ "\n"
+ " The square of the norm of the descent vector\n"
+ " is lower than %12.4e\n"
+ "\n"
+ " The resolution does not progress anymore."),
+ sles_name, var_name, _epzero);
+ cvg = -2;
+ break;
+ }
+
+ alpha = ro_0 / ro_1;
+
+ /* Final update of vx and rk */
+
+ cblas_daxpy(n_rows, alpha, zk, 1, vx, 1);
+ cblas_daxpy(n_rows, -alpha, vk, 1, rk, 1);
+
+ /* Convergence test at beginning of next iteration so
+ as to group dot products for better parallel performance */
+ }
+
+ if (_aux_vectors != aux_vectors)
+ BFT_FREE(_aux_vectors);
+
+ return cvg;
+}
+
+/*----------------------------------------------------------------------------
+ * Output post-processing data for failed system convergence.
+ *
+ * parameters:
+ * n_vals <-- Size of val and val_type array
+ * val <-> Values to post-process (set to 0 on output if not
+ * normal floating-point values)
+ * val_type --> 0: normal values, 1: infinite, 2: Nan
+ *
+ * returns:
+ * number of non-normal values
+ *----------------------------------------------------------------------------*/
+
+static size_t
+_value_type(size_t n_vals,
+ cs_real_t val[],
+ int val_type[])
+{
+ size_t ii;
+ size_t retval = 0;
+
+#if (_CS_STDC_VERSION >= 199901L)
+
+ for (ii = 0; ii < n_vals; ii++) {
+
+ int v_type = fpclassify(val[ii]);
+
+ if (v_type == FP_INFINITE) {
+ val[ii] = 0.;
+ val_type[ii] = 1;
+ retval += 1;
+ }
+
+ else if (v_type == FP_NAN) {
+ val[ii] = 0.;
+ val_type[ii] = 2;
+ retval += 1;
+ }
+
+ else if (val[ii] > 1.e38 || val[ii] < -1.e38) {
+ val[ii] = 0.;
+ val_type[ii] = 1;
+ retval += 1;
+ }
+
+ else
+ val_type[ii] = 0;
+ }
+
+#else
+
+ for (ii = 0; ii < n_vals; ii++) {
+
+ if (val[ii] != val[ii]) { /* Test for NaN with IEEE 754 arithmetic */
+ val[ii] = 0.;
+ val_type[ii] = 2;
+ retval += 1;
+ }
+
+ else if (val[ii] > 1.e38 || val[ii] < -1.e38) {
+ val[ii] = 0.;
+ val_type[ii] = 1;
+ retval += 1;
+ }
+
+ else
+ val_type[ii] = 0;
+ }
+
+#endif
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute per-cell residual for Ax = b.
+ *
+ * parameters:
+ * symmetric <-- indicates if matrix values are symmetric
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * ad <-- Diagonal part of linear equation matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * rhs <-- Right hand side
+ * vx <-> Current system solution
+ * res --> Residual
+ *----------------------------------------------------------------------------*/
+
+static void
+_cell_residual(cs_bool_t symmetric,
+ cs_perio_rota_t rotation_mode,
+ const cs_real_t ad[],
+ const cs_real_t ax[],
+ const cs_real_t rhs[],
+ cs_real_t vx[],
+ cs_real_t res[])
+{
+ cs_int_t ii;
+
+ const cs_int_t n_cells = cs_glob_mesh->n_cells;
+
+ cs_matrix_t *a = cs_glob_sles_base_matrix;
+
+ cs_matrix_set_coefficients(a, symmetric, ad, ax);
+
+ cs_matrix_vector_multiply(rotation_mode, a, vx, res);
+
+ for (ii = 0; ii < n_cells; ii++)
+ res[ii] = fabs(res[ii] - rhs[ii]);
+}
+
+/*----------------------------------------------------------------------------
+ * Compute diagonal dominance metric.
+ *
+ * parameters:
+ * symmetric <-- indicates if matrix values are symmetric
+ * ad <-- Diagonal part of linear equation matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * dd <-- Diagonal dominance (normalized)
+ *----------------------------------------------------------------------------*/
+
+static void
+_diag_dominance(cs_bool_t symmetric,
+ const cs_real_t ad[],
+ const cs_real_t ax[],
+ cs_real_t dd[])
+{
+ cs_int_t ii, jj, face_id;
+
+ const cs_int_t n_cells = cs_glob_mesh->n_cells;
+ const cs_int_t n_faces = cs_glob_mesh->n_i_faces;
+ const cs_int_t *face_cel = cs_glob_mesh->i_face_cells;
+ const cs_halo_t *halo = cs_glob_mesh->halo;
+
+ /* Diagonal part of matrix.vector product */
+
+ for (ii = 0; ii < n_cells; ii++)
+ dd[ii] = fabs(ad[ii]);
+
+ if (halo != NULL)
+ cs_halo_sync_var(halo, CS_HALO_STANDARD, dd);
+
+ /* non-diagonal terms */
+
+ if (symmetric) {
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = face_cel[2*face_id] -1;
+ jj = face_cel[2*face_id + 1] -1;
+ dd[ii] -= fabs(ax[face_id]);
+ dd[jj] -= fabs(ax[face_id]);
+ }
+ }
+ else {
+ for (face_id = 0; face_id < n_faces; face_id++) {
+ ii = face_cel[2*face_id] -1;
+ jj = face_cel[2*face_id + 1] -1;
+ dd[ii] -= fabs(ax[face_id]);
+ dd[jj] -= fabs(ax[face_id + n_faces]);
+ }
+ }
+
+ for (ii = 0; ii < n_cells; ii++) {
+ if (fabs(ad[ii]) > 1.e-18)
+ dd[ii] /= fabs(ad[ii]);
+ }
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * General sparse linear system resolution
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(reslin, RESLIN)
+(
+ const char *cname, /* <-- variable name */
+ const cs_int_t *lname, /* <-- variable name length */
+ const cs_int_t *ncelet, /* <-- Number of cells, halo included */
+ const cs_int_t *ncel, /* <-- Number of local cells */
+ const cs_int_t *nfac, /* <-- Number of faces */
+ const cs_int_t *isym, /* <-- Symmetry indicator:
+ 1: symmetric; 2: not symmetric */
+ const cs_int_t *ireslp, /* <-- Resolution type:
+ 0: pcg; 1: Jacobi; 2: cg-stab */
+ const cs_int_t *ipol, /* <-- Preconditioning polynomial degree
+ (0: diagonal) */
+ const cs_int_t *nitmap, /* <-- Number of max iterations */
+ const cs_int_t *iinvpe, /* <-- Indicator to cancel increments
+ in rotational periodicty (2) or
+ to exchange them as scalars (1) */
+ const cs_int_t *iwarnp, /* <-- Verbosity level */
+ cs_int_t *niterf, /* --> Number of iterations done */
+ const cs_real_t *epsilp, /* <-- Precision for iterative resolution */
+ const cs_real_t *rnorm, /* <-- Residue normalization */
+ cs_real_t *residu, /* --> Final non normalized residue */
+ const cs_int_t *ifacel, /* <-- Face -> cell connectivity */
+ const cs_real_t *dam, /* <-- Matrix diagonal */
+ const cs_real_t *xam, /* <-- Matrix extra-diagonal terms */
+ const cs_real_t *rhs, /* <-- System right-hand side */
+ cs_real_t *vx /* <-> System solution */
+)
+{
+ char *var_name;
+ cs_sles_type_t type;
+
+ int cvg = 0;
+ int n_iter = *niterf;
+ cs_bool_t symmetric = (*isym == 1) ? true : false;
+ cs_perio_rota_t rotation_mode = CS_PERIO_ROTA_COPY;
+
+ assert(*ncelet >= *ncel);
+ assert(*nfac > 0);
+ assert(ifacel != NULL);
+
+ if (*iinvpe == 2)
+ rotation_mode = CS_PERIO_ROTA_RESET;
+ else if (*iinvpe == 3)
+ rotation_mode = CS_PERIO_ROTA_IGNORE;
+
+ var_name = cs_base_string_f_to_c_create(cname, *lname);
+
+ switch ((int)(*ireslp)) {
+ case 0:
+ type = CS_SLES_PCG;
+ break;
+ case 1:
+ type = CS_SLES_JACOBI;
+ break;
+ case 2:
+ type = CS_SLES_BICGSTAB;
+ break;
+ default:
+ type = CS_SLES_N_TYPES;
+ assert(0);
+ }
+
+ cvg = cs_sles_solve(var_name,
+ type,
+ true,
+ symmetric,
+ dam,
+ xam,
+ cs_glob_sles_base_matrix,
+ cs_glob_sles_native_matrix,
+ *ipol,
+ rotation_mode,
+ *iwarnp,
+ *nitmap,
+ *epsilp,
+ *rnorm,
+ &n_iter,
+ residu,
+ rhs,
+ vx,
+ 0,
+ NULL);
+
+ *niterf = n_iter;
+
+ /* If divergence is detected, try diagnostics and abort */
+
+ if (cvg == -2) {
+
+ int mesh_id = cs_post_init_error_writer_cells();
+
+ cs_sles_post_error_output_def(var_name,
+ mesh_id,
+ symmetric,
+ rotation_mode,
+ dam,
+ xam,
+ rhs,
+ vx);
+
+ cs_post_finalize();
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("%s: error (divergence) solving for %s"),
+ _(cs_sles_type_name[type]), var_name);
+ }
+
+ cs_base_string_f_to_c_free(&var_name);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize sparse linear equation solver API.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_initialize(void)
+{
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_bool_t periodic = false;
+
+ assert(mesh != NULL);
+
+ if (mesh->n_init_perio > 0)
+ periodic = true;
+
+ cs_glob_sles_base_matrix = cs_matrix_create(CS_MATRIX_NATIVE,
+ false,
+ true,
+ periodic,
+ mesh->n_cells,
+ mesh->n_cells_with_ghosts,
+ mesh->n_i_faces,
+ mesh->global_cell_num,
+ mesh->i_face_cells,
+ mesh->halo,
+ mesh->i_face_numbering);
+
+ cs_glob_sles_native_matrix = cs_matrix_create(CS_MATRIX_NATIVE,
+ false,
+ true,
+ periodic,
+ mesh->n_cells,
+ mesh->n_cells_with_ghosts,
+ mesh->n_i_faces,
+ mesh->global_cell_num,
+ mesh->i_face_cells,
+ mesh->halo,
+ mesh->i_face_numbering);
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize sparse linear equation solver API.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_finalize(void)
+{
+ int ii;
+
+ /* Free system info */
+
+ for (ii = 0; ii < cs_glob_sles_n_systems; ii++) {
+ _sles_info_dump(cs_glob_sles_systems[ii]);
+ _sles_info_destroy(&(cs_glob_sles_systems[ii]));
+ }
+
+ BFT_FREE(cs_glob_sles_systems);
+
+ cs_glob_sles_n_systems = 0;
+ cs_glob_sles_n_max_systems = 0;
+
+ /* Free matrix structures */
+
+ cs_matrix_destroy(&cs_glob_sles_native_matrix);
+ cs_matrix_destroy(&cs_glob_sles_base_matrix);
+}
+
+/*----------------------------------------------------------------------------
+ * Test if a general sparse linear system needs solving or if the right-hand
+ * side is already zero within convergence criteria.
+ *
+ * The computed residue is also updated;
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * solver_name <-- Name of solver
+ * n_rows <-- Number of (non ghost) rows in rhs
+ * verbosity <-- Verbosity level
+ * r_norm <-- Residue normalization
+ * residue <-> Residue
+ * rhs <-- Right hand side
+ *
+ * returns:
+ * 1 if solving is required, 0 if the rhs is already zero within tolerance
+ * criteria (precision of residue normalization)
+ *----------------------------------------------------------------------------*/
+
+int
+cs_sles_needs_solving(const char *var_name,
+ const char *solver_name,
+ cs_int_t n_rows,
+ int verbosity,
+ double r_norm,
+ double *residue,
+ const cs_real_t *rhs)
+{
+ int retval = 1;
+
+ /* Initialize residue, check for immediate return */
+
+ *residue = sqrt(_dot_product(n_rows, rhs, rhs));
+
+ if (r_norm <= EPZERO || *residue <= EPZERO) {
+ if (verbosity > 1)
+ bft_printf(_("%s [%s]:\n"
+ " immediate exit; r_norm = %11.4e, residual = %11.4e\n"),
+ solver_name, var_name, r_norm, *residue);
+ retval = 0;
+ }
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * General sparse linear system resolution.
+ *
+ * Note that in most cases (if the right-hand side is not already zero
+ * within convergence criteria), coefficients are assigned to matrixes
+ * then released by this function, so coefficients need not be assigned
+ * prior to this call, and will have been released upon returning.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * solver_type <-- Type of solver (PCG, Jacobi, ...)
+ * update_stats <-- Automatic solver statistics indicator
+ * symmetric <-- Symmetric coefficients indicator
+ * ad_coeffs <-- Diagonal coefficients of linear equation matrix
+ * ax_coeffs <-- Non-diagonal coefficients of linear equation matrix
+ * a <-> Matrix
+ * ax <-> Non-diagonal part of linear equation matrix
+ * (only necessary if poly_degree > 0)
+ * poly_degree <-- Preconditioning polynomial degree (0: diagonal)
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * verbosity <-- Verbosity level
+ * n_max_iter <-- Maximum number of iterations
+ * precision <-- Precision limit
+ * r_norm <-- Residue normalization
+ * n_iter --> Number of iterations
+ * residue <-> Residue
+ * rhs <-- Right hand side
+ * vx --> System solution
+ * aux_size <-- Number of elements in aux_vectors
+ * aux_vectors --- Optional working area (allocation otherwise)
+ *
+ * returns:
+ * 1 if converged, 0 if not converged, -1 if not converged and maximum
+ * iteration number reached, -2 if divergence is detected.
+ *----------------------------------------------------------------------------*/
+
+int
+cs_sles_solve(const char *var_name,
+ cs_sles_type_t solver_type,
+ cs_bool_t update_stats,
+ cs_bool_t symmetric,
+ const cs_real_t *ad_coeffs,
+ const cs_real_t *ax_coeffs,
+ cs_matrix_t *a,
+ cs_matrix_t *ax,
+ int poly_degree,
+ cs_perio_rota_t rotation_mode,
+ int verbosity,
+ int n_max_iter,
+ double precision,
+ double r_norm,
+ int *n_iter,
+ double *residue,
+ const cs_real_t *rhs,
+ cs_real_t *vx,
+ size_t aux_size,
+ void *aux_vectors)
+{
+ cs_int_t n_rows;
+ unsigned _n_iter = 0;
+ int cvg = 0;
+ cs_sles_convergence_t convergence;
+
+ cs_sles_info_t *sles_info = NULL;
+ double wt_start = 0.0, wt_stop = 0.0;
+ double cpu_start = 0.0, cpu_stop = 0.0;
+
+ cs_matrix_t *_a = a;
+ cs_matrix_t *_ax = ax;
+
+ n_rows = cs_matrix_get_n_rows(a);
+
+ if (update_stats == true) {
+ wt_start =bft_timer_wtime();
+ cpu_start =bft_timer_cpu_time();
+ sles_info = _find_or_add_system(var_name, solver_type);
+ }
+
+ /* Initialize number of iterations and residue,
+ check for immediate return,
+ and solve sparse linear system */
+
+ *n_iter = 0;
+
+ if (cs_sles_needs_solving(var_name,
+ _(cs_sles_type_name[solver_type]),
+ n_rows,
+ verbosity,
+ r_norm,
+ residue,
+ rhs) != 0) {
+
+ /* Set matrix coefficients */
+
+ if (solver_type == CS_SLES_JACOBI) {
+
+ if (ax == NULL) {
+ _a = NULL;
+ _ax = a;
+ }
+
+ cs_matrix_set_coefficients(_ax, symmetric, NULL, ax_coeffs);
+ }
+
+ else { /* if (solver_type != CS_SLES_JACOBI) */
+
+ cs_matrix_set_coefficients(_a, symmetric, ad_coeffs, ax_coeffs);
+
+ if (poly_degree > 0) {
+ cs_matrix_set_coefficients(_ax, symmetric, NULL, ax_coeffs);
+ }
+ }
+
+ /* Solve sparse linear system */
+
+ _convergence_init(&convergence,
+ _(cs_sles_type_name[solver_type]),
+ var_name,
+ verbosity,
+ n_max_iter,
+ precision,
+ r_norm,
+ *residue);
+
+ switch (solver_type) {
+ case CS_SLES_PCG:
+ if (cs_glob_n_ranks == 1)
+ cvg = _conjugate_gradient_sp(var_name,
+ _a,
+ _ax,
+ poly_degree,
+ rotation_mode,
+ &convergence,
+ rhs,
+ vx,
+ aux_size,
+ aux_vectors);
+ else
+ cvg = _conjugate_gradient_mp(var_name,
+ _a,
+ _ax,
+ poly_degree,
+ rotation_mode,
+ &convergence,
+ rhs,
+ vx,
+ aux_size,
+ aux_vectors);
+ break;
+ case CS_SLES_JACOBI:
+ cvg = _jacobi(var_name,
+ ad_coeffs,
+ _ax,
+ rotation_mode,
+ &convergence,
+ rhs,
+ vx,
+ aux_size,
+ aux_vectors);
+ break;
+ case CS_SLES_BICGSTAB:
+ cvg = _bi_cgstab(var_name,
+ _a,
+ _ax,
+ poly_degree,
+ rotation_mode,
+ &convergence,
+ rhs,
+ vx,
+ aux_size,
+ aux_vectors);
+ break;
+ default:
+ break;
+ }
+
+ /* Release matrix coefficients */
+
+ if (_a != NULL)
+ cs_matrix_release_coefficients(_a);
+ if (_ax != NULL)
+ cs_matrix_release_coefficients(_ax);
+
+ /* Update return values */
+
+ _n_iter = convergence.n_iterations;
+
+ *n_iter = convergence.n_iterations;
+ *residue = convergence.residue;
+ }
+
+ if (update_stats == true) {
+
+ wt_stop =bft_timer_wtime();
+ cpu_stop =bft_timer_cpu_time();
+
+ if (sles_info->n_calls == 0)
+ sles_info->n_iterations_min = _n_iter;
+
+ sles_info->n_calls += 1;
+
+ if (sles_info->n_iterations_min > _n_iter)
+ sles_info->n_iterations_min = _n_iter;
+ if (sles_info->n_iterations_max < _n_iter)
+ sles_info->n_iterations_max = _n_iter;
+
+ sles_info->n_iterations_last = _n_iter;
+ sles_info->n_iterations_tot += _n_iter;
+
+ sles_info->wt_tot += (wt_stop - wt_start);
+ sles_info->cpu_tot += (cpu_stop - cpu_start);
+ }
+
+ return cvg;
+}
+
+/*----------------------------------------------------------------------------
+ * Output default post-processing data for failed system convergence.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * mesh_id <-- id of error output mesh, or 0 if none
+ * symmetric <-- indicates if matrix values are symmetric
+ * rotation_mode <-- Halo update option for rotational periodicity
+ * ad <-- Diagonal part of linear equation matrix
+ * ax <-- Non-diagonal part of linear equation matrix
+ * rhs <-- Right hand side
+ * vx <-> Current system solution
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_post_error_output_def(const char *var_name,
+ int mesh_id,
+ cs_bool_t symmetric,
+ cs_perio_rota_t rotation_mode,
+ const cs_real_t *ad,
+ const cs_real_t *ax,
+ const cs_real_t *rhs,
+ cs_real_t *vx)
+{
+ if (mesh_id != 0) {
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+
+ char base_name[32], val_name[32];
+
+ int val_id;
+ const cs_int_t n_cells = mesh->n_cells;
+
+ cs_real_t *val;
+
+ BFT_MALLOC(val, mesh->n_cells_with_ghosts, cs_real_t);
+
+ for (val_id = 0; val_id < 5; val_id++) {
+
+ switch(val_id) {
+
+ case 0:
+ strcpy(base_name, "Diag");
+ memcpy(val, ad, n_cells*sizeof(cs_real_t));
+ break;
+
+ case 1:
+ strcpy(base_name, "RHS");
+ memcpy(val, rhs, n_cells*sizeof(cs_real_t));
+ break;
+
+ case 2:
+ strcpy(base_name, "X");
+ memcpy(val, vx, n_cells*sizeof(cs_real_t));
+ break;
+
+ case 3:
+ strcpy(base_name, "Residual");
+ _cell_residual(symmetric, rotation_mode, ad, ax, rhs, vx, val);
+ break;
+
+ case 4:
+ strcpy(base_name, "Diag_Dom");
+ _diag_dominance(symmetric, ad, ax, val);
+ break;
+
+ }
+
+ if (strlen(var_name) + strlen(base_name) < 31) {
+ strcpy(val_name, base_name);
+ strcat(val_name, "_");
+ strcat(val_name, var_name);
+ }
+ else {
+ strncpy(val_name, base_name, 31);
+ val_name[31] = '\0';
+ }
+
+ cs_sles_post_error_output_var(val_name,
+ mesh_id,
+ val);
+ }
+
+ BFT_FREE(val);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Output post-processing variable for failed system convergence.
+ *
+ * parameters:
+ * var_name <-- Variable name
+ * mesh_id <-- id of error output mesh, or 0 if none
+ * var <-- Variable values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_sles_post_error_output_var(const char *var_name,
+ int mesh_id,
+ cs_real_t *var)
+{
+ if (mesh_id != 0) {
+
+ const cs_mesh_t *mesh = cs_glob_mesh;
+
+ size_t n_non_norm;
+ const cs_int_t n_cells = mesh->n_cells;
+
+ int *val_type;
+
+ BFT_MALLOC(val_type, n_cells, int);
+
+ n_non_norm = _value_type(n_cells, var, val_type);
+
+ cs_post_write_var(mesh_id,
+ var_name,
+ 1,
+ false, /* no interlace */
+ true, /* use parents */
+ CS_POST_TYPE_cs_real_t,
+ -1,
+ 0.0,
+ var,
+ NULL,
+ NULL);
+
+ if (n_non_norm > 0) {
+
+ char type_name[32];
+ size_t l = strlen(var_name);
+
+ if (l > 31)
+ l = 31;
+
+ l -= strlen("_fp_type");
+
+ strncpy(type_name, var_name, l);
+ type_name[l] = '\0';
+
+ strcat(type_name, "_fp_type");
+
+ cs_post_write_var(mesh_id,
+ type_name,
+ 1,
+ false, /* no interlace */
+ true, /* use parents */
+ CS_POST_TYPE_int,
+ -1,
+ 0.0,
+ val_type,
+ NULL,
+ NULL);
+
+ }
+
+ BFT_FREE(val_type);
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_sort.c b/src/base/cs_sort.c
new file mode 100644
index 0000000..6aea75e
--- /dev/null
+++ b/src/base/cs_sort.c
@@ -0,0 +1,259 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 2008-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *===========================================================================*/
+
+/*============================================================================
+ * Functions related to in-place sorting of arrays.
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <stdio.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_sort.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" between its left bound "l" and its right bound "r"
+ * thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l <-- left bound
+ * r <-- right bound
+ * a <-> array to sort
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_shell(cs_int_t l,
+ cs_int_t r,
+ cs_int_t a[])
+{
+ int i, j, h;
+
+ /* Compute stride */
+ for (h = 1; h <= (r-l)/9; h = 3*h+1) ;
+
+ /* Sort array */
+ for (; h > 0; h /= 3) {
+
+ for (i = l+h; i < r; i++) {
+
+ cs_int_t v = a[i];
+
+ j = i;
+ while ((j >= l+h) && (v < a[j-h])) {
+ a[j] = a[j-h];
+ j -= h;
+ }
+ a[j] = v;
+
+ } /* Loop on array elements */
+
+ } /* End of loop on stride */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Sort a global array "a" between its left bound "l" and its right bound "r"
+ * thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l <-- left bound
+ * r <-- right bound
+ * a <-> array to sort
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_gnum_shell(cs_int_t l,
+ cs_int_t r,
+ fvm_gnum_t a[])
+{
+ int i, j, h;
+
+ /* Compute stride */
+ for (h = 1; h <= (r-l)/9; h = 3*h+1) ;
+
+ /* Sort array */
+ for (; h > 0; h /= 3) {
+
+ for (i = l+h; i < r; i++) {
+
+ fvm_gnum_t v = a[i];
+
+ j = i;
+ while ((j >= l+h) && (v < a[j-h])) {
+ a[j] = a[j-h];
+ j -= h;
+ }
+ a[j] = v;
+
+ } /* Loop on array elements */
+
+ } /* End of loop on stride */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" and apply the sort to its associated array "b" (local
+ * numbering)
+ * Sort is realized thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l --> left bound
+ * r --> right bound
+ * a <-> array to sort
+ * b <-> associated array
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_coupled_shell(cs_int_t l,
+ cs_int_t r,
+ cs_int_t a[],
+ cs_int_t b[])
+{
+ int i, j, h;
+ cs_int_t size = r - l;
+
+ if (size == 0)
+ return;
+
+ /* Compute stride */
+ for (h = 1; h <= size/9; h = 3*h+1) ;
+
+ /* Sort array */
+ for ( ; h > 0; h /= 3) {
+
+ for (i = l+h; i < r; i++) {
+
+ cs_int_t va = a[i];
+ cs_int_t vb = b[i];
+
+ j = i;
+ while ( (j >= l+h) && (va < a[j-h]) ) {
+ a[j] = a[j-h];
+ b[j] = b[j-h];
+ j -= h;
+ }
+ a[j] = va;
+ b[j] = vb;
+
+ } /* Loop on array elements */
+
+ } /* End of loop on stride */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Sort an array "a" and apply the sort to its associated array "b" (local
+ * numbering)
+ * Sort is realized thanks to a shell sort (Knuth algorithm).
+ *
+ * parameters:
+ * l --> left bound
+ * r --> right bound
+ * a <-> array to sort
+ * b <-> associated array
+ *---------------------------------------------------------------------------*/
+
+void
+cs_sort_coupled_gnum_shell(cs_int_t l,
+ cs_int_t r,
+ fvm_gnum_t a[],
+ fvm_gnum_t b[])
+{
+ int i, j, h;
+ cs_int_t size = r - l;
+
+ if (size == 0)
+ return;
+
+ /* Compute stride */
+ for (h = 1; h <= size/9; h = 3*h+1) ;
+
+ /* Sort array */
+ for ( ; h > 0; h /= 3) {
+
+ for (i = l+h; i < r; i++) {
+
+ fvm_gnum_t va = a[i];
+ fvm_gnum_t vb = b[i];
+
+ j = i;
+ while ( (j >= l+h) && (va < a[j-h]) ) {
+ a[j] = a[j-h];
+ b[j] = b[j-h];
+ j -= h;
+ }
+ a[j] = va;
+ b[j] = vb;
+
+ } /* Loop on array elements */
+
+ } /* End of loop on stride */
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
+
diff --git a/src/base/cs_syr3_comm.c b/src/base/cs_syr3_comm.c
new file mode 100644
index 0000000..984a78c
--- /dev/null
+++ b/src/base/cs_syr3_comm.c
@@ -0,0 +1,1641 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Communication with SYRTHES 3
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+#if defined(HAVE_SOCKET)
+#include <netdb.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_file.h>
+#include <bft_mem.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_syr3_comm.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#define CS_SYR3_COMM_ELT_TYPE_NAME_LEN 2 /* Length of type name */
+
+#define CS_SYR3_COMM_SOCKET_HEADER "CS_comm_socket"
+
+#define CS_SYR3_COMM_SOCKET_N_MAX 8
+#define CS_LOC_SYR3_COMM_LNG_HOSTNAME 256
+
+/*
+ If SSIZE_MAX has not been defined through system headers, we take the
+ minimal value required by POSIX (for low level read/write used with sockets).
+*/
+
+#if !defined(SSIZE_MAX)
+#define SSIZE_MAX 32767
+#endif
+
+/*----------------------------------------------------------------------------
+ * Send or receive a message
+ *----------------------------------------------------------------------------*/
+
+typedef enum {
+
+ CS_SYR3_COMM_MODE_RECEIVE, /* Receive */
+ CS_SYR3_COMM_MODE_SEND /* Send */
+
+} _cs_syr3_comm_mode_t;
+
+/*============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+struct _cs_syr3_comm_t {
+
+ char *nom; /* Communicator name */
+
+ cs_int_t proc_rank; /* Communication process name */
+ int sock; /* Socket number */
+
+ cs_syr3_comm_type_t type; /* Type of data encoding */
+ cs_bool_t swap_endian; /* Swap bytes ? */
+ cs_int_t echo; /* Data transfer verbosity level */
+
+};
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+static char cs_syr3_comm_elt_type_name_char[] = "c "; /* String */
+static char cs_syr3_comm_elt_type_name_int[] = "i "; /* Integer */
+static char cs_syr3_comm_elt_type_name_real[] = "r8"; /* Real */
+
+#if defined(HAVE_SOCKET)
+
+static cs_bool_t cs_glob_comm_little_endian = false;
+
+static char cs_glob_comm_sock_hostname[CS_LOC_SYR3_COMM_LNG_HOSTNAME + 1];
+static int cs_glob_comm_sock_port_num = -1;
+
+static int cs_glob_comm_socket = 0;
+struct sockaddr_in cs_glob_comm_sock_addr;
+
+static char cs_glob_comm_socket_err[]
+= N_("Error in socket communication: %s (node %4d)\n");
+
+#endif /* HAVE_SOCKET */
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Print an error message in case of MPI communication problem
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_error_msg(const cs_syr3_comm_t *comm,
+ int error)
+{
+ char buffer[MPI_MAX_ERROR_STRING];
+ int buffer_len;
+
+ MPI_Error_string(error, buffer, &buffer_len);
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("MPI error for communication: %s\n"
+ "Error type: %s"), comm->nom, buffer);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize an MPI communication by receiving then sending a "magic string"
+ * to check the correct data format.
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_open(cs_syr3_comm_t *comm,
+ const char *magic_string)
+{
+ int ierror, comm_size;
+
+ MPI_Status status;
+
+ char * comm_magic_string;
+
+ cs_int_t magic_string_len = strlen(magic_string);
+
+ /* Initialize communication */
+ /*--------------------------*/
+
+ MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
+
+ if (comm->proc_rank >= comm_size)
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("Impossible to establish the communication: %s\n"
+ "because the requested process rank (%d)\n"
+ "is greater than or equal to the number of MPI processes (%d)"),
+ comm->nom, comm->proc_rank, comm_size);
+
+ BFT_MALLOC(comm_magic_string, magic_string_len + 1, char);
+
+ /* Receive magic string */
+ /*----------------------*/
+
+ ierror = MPI_Recv(comm_magic_string, magic_string_len, MPI_CHAR,
+ comm->proc_rank,
+ MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_error_msg(comm, ierror);
+
+ comm_magic_string[magic_string_len] = '\0';
+
+ /* If the magic string does not match, we have an error */
+
+ if (strcmp(comm_magic_string, magic_string) != 0)
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _("Error for communication: \"%s\".\n"
+ "The interface version is not correct.\n"
+ "The magic string indicates an incorrect interface format version.\n"
+ "magic string read: \"%s\"\n"
+ "magic string expected: \"%s\"\n"),
+ comm->nom, comm_magic_string, magic_string);
+
+ /* Send magic string */
+ /*-------------------*/
+
+ strncpy(comm_magic_string, magic_string, magic_string_len);
+
+ ierror = MPI_Send(comm_magic_string, magic_string_len, MPI_CHAR,
+ comm->proc_rank,
+ 0, MPI_COMM_WORLD);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_error_msg(comm, ierror);
+
+ BFT_FREE(comm_magic_string);
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange a section header through MPI
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_header(char *sec_name,
+ cs_int_t *n_sec_elts,
+ char *elt_type_name,
+ _cs_syr3_comm_mode_t mode,
+ const cs_syr3_comm_t *comm)
+{
+#undef CS_SYR3_COMM_MPI_PACK_SIZE
+#define CS_SYR3_COMM_MPI_PACK_SIZE CS_SYR3_COMM_H_LEN \
+ + CS_SYR3_COMM_ELT_TYPE_NAME_LEN \
+ + (sizeof(int) * 2)
+
+ char buffer[CS_SYR3_COMM_MPI_PACK_SIZE];
+
+ int position, ierror;
+
+ MPI_Status status;
+
+ /* Instructions */
+
+ assert(comm != NULL);
+ assert(*n_sec_elts >= 0);
+ assert(sizeof(int) == sizeof(cs_int_t));
+
+ /* Receive mode */
+ /*--------------*/
+
+ if (mode == CS_SYR3_COMM_MODE_RECEIVE) {
+
+ /* Receive message */
+
+ ierror = MPI_Recv(buffer, CS_SYR3_COMM_MPI_PACK_SIZE, MPI_PACKED,
+ comm->proc_rank,
+ MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_error_msg(comm, ierror);
+
+ /* Extract buffer elements */
+
+ position = 0;
+
+ MPI_Unpack(buffer, CS_SYR3_COMM_MPI_PACK_SIZE, &position, sec_name,
+ CS_SYR3_COMM_H_LEN, MPI_CHAR, MPI_COMM_WORLD);
+
+ MPI_Unpack(buffer, CS_SYR3_COMM_MPI_PACK_SIZE, &position, n_sec_elts,
+ 1, CS_MPI_INT, MPI_COMM_WORLD);
+
+ if (*n_sec_elts > 0)
+ MPI_Unpack(buffer, CS_SYR3_COMM_MPI_PACK_SIZE, &position, elt_type_name,
+ CS_SYR3_COMM_ELT_TYPE_NAME_LEN, MPI_CHAR, MPI_COMM_WORLD);
+
+ }
+
+ /* Send mode */
+ /*-----------*/
+
+ else { /* if (mode == CS_SYR3_COMM_MODE_SEND) */
+
+ /* Pack buffer */
+
+ position = 0;
+
+ MPI_Pack(sec_name, CS_SYR3_COMM_H_LEN, MPI_CHAR, buffer,
+ CS_SYR3_COMM_MPI_PACK_SIZE, &position, MPI_COMM_WORLD);
+
+ MPI_Pack(n_sec_elts, 1, CS_MPI_INT, buffer, CS_SYR3_COMM_MPI_PACK_SIZE,
+ &position, MPI_COMM_WORLD);
+
+ if (*n_sec_elts > 0)
+ MPI_Pack(elt_type_name, CS_SYR3_COMM_ELT_TYPE_NAME_LEN, MPI_CHAR, buffer,
+ CS_SYR3_COMM_MPI_PACK_SIZE, &position, MPI_COMM_WORLD);
+
+ /* Send message */
+
+ ierror = MPI_Send(buffer, position, MPI_PACKED, comm->proc_rank,
+ 0, MPI_COMM_WORLD);
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_error_msg(comm, ierror);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange a section body through MPI
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_mpi_body(void *sec_elts,
+ cs_int_t n_sec_elts,
+ cs_type_t elt_type,
+ _cs_syr3_comm_mode_t mode,
+ const cs_syr3_comm_t *comm)
+{
+ int ierror;
+ int n_elts = n_sec_elts;
+
+ MPI_Status status;
+
+ /* Instructions */
+
+ assert(comm != NULL);
+ assert(n_sec_elts >= 0);
+
+ /* Receive mode */
+ /*--------------*/
+
+ if (mode == CS_SYR3_COMM_MODE_RECEIVE) {
+
+ switch (elt_type) {
+
+ case CS_TYPE_cs_int_t:
+
+ ierror = MPI_Recv(sec_elts, n_elts, CS_MPI_INT,
+ comm->proc_rank,
+ MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+ break;
+
+ case CS_TYPE_cs_real_t:
+ ierror = MPI_Recv(sec_elts, n_elts, CS_MPI_REAL,
+ comm->proc_rank,
+ MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+ break;
+
+ case CS_TYPE_char:
+ ierror = MPI_Recv(sec_elts, n_elts, MPI_CHAR,
+ comm->proc_rank,
+ MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+ break;
+
+ default:
+ assert ( elt_type == CS_TYPE_char
+ || elt_type == CS_TYPE_cs_int_t
+ || elt_type == CS_TYPE_cs_real_t);
+ }
+
+ }
+
+ /* Send mode */
+ /*-----------*/
+
+ else { /* if (mode == CS_SYR3_COMM_MODE_SEND) */
+
+ switch (elt_type) {
+
+ case CS_TYPE_cs_int_t:
+ ierror = MPI_Send(sec_elts, n_elts, CS_MPI_INT,
+ comm->proc_rank,
+ 0, MPI_COMM_WORLD);
+ break;
+
+ case CS_TYPE_cs_real_t:
+ ierror = MPI_Send(sec_elts, n_elts, CS_MPI_REAL,
+ comm->proc_rank,
+ 0, MPI_COMM_WORLD);
+ break;
+
+ case CS_TYPE_char:
+ ierror = MPI_Send(sec_elts, n_elts, MPI_CHAR,
+ comm->proc_rank,
+ 0, MPI_COMM_WORLD);
+ break;
+
+ default:
+ assert( elt_type == CS_TYPE_char
+ || elt_type == CS_TYPE_cs_int_t
+ || elt_type == CS_TYPE_cs_real_t);
+ }
+
+ }
+
+ if (ierror != MPI_SUCCESS)
+ _comm_mpi_error_msg(comm, ierror);
+}
+
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+/*----------------------------------------------------------------------------
+ * Read a record from the interface socket
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_read_sock(const cs_syr3_comm_t *comm,
+ cs_byte_t *rec,
+ const size_t nbr,
+ cs_type_t type)
+{
+ size_t start_id;
+ size_t end_id;
+ size_t n_loc;
+ size_t n_bytes;
+ size_t count;
+ ssize_t ret;
+
+ assert(rec != NULL);
+ assert(comm != NULL);
+
+ /* Determine the number of bytes to receive */
+
+ switch(type) {
+ case CS_TYPE_cs_int_t:
+ count = sizeof(cs_int_t);
+ break;
+ case CS_TYPE_cs_real_t:
+ count = sizeof(cs_real_t);
+ break;
+ case CS_TYPE_char:
+ count = sizeof(char);
+ break;
+ default:
+ assert(type == CS_TYPE_cs_int_t ||
+ type == CS_TYPE_cs_real_t ||
+ type == CS_TYPE_char);
+ }
+
+ n_bytes = count * nbr;
+
+ /* Read data from socket */
+ /*-----------------------*/
+
+ start_id = 0;
+
+ while (start_id < n_bytes) {
+
+ end_id = CS_MIN(start_id + SSIZE_MAX, n_bytes);
+
+ n_loc = end_id - start_id;
+
+ ret = read(comm->sock, (void *)(rec + start_id), n_loc);
+
+ if (ret < 1)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Communication %s:\n"
+ "Error while receiving data by socket.\n"),
+ comm->nom);
+
+ start_id += ret;
+
+ }
+
+ if (comm->swap_endian == true)
+ bft_file_swap_endian(rec, rec, count, nbr);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Write a record to the interface socket
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_write_sock(const cs_syr3_comm_t *comm,
+ const cs_byte_t *rec,
+ size_t nbr,
+ cs_type_t type)
+{
+ size_t start_id;
+ size_t end_id;
+ size_t n_loc;
+ size_t n_bytes;
+ size_t count;
+ ssize_t ret;
+
+ cs_byte_t * rec_tmp;
+
+ assert(rec != NULL);
+ assert(comm != NULL);
+
+ /* Determine the number of bytes to send */
+
+ switch(type) {
+ case CS_TYPE_cs_int_t:
+ count = sizeof(cs_int_t);
+ break;
+ case CS_TYPE_cs_real_t:
+ count = sizeof(cs_real_t);
+ break;
+ case CS_TYPE_char:
+ count = sizeof(char);
+ break;
+ default:
+ assert(type == CS_TYPE_cs_int_t ||
+ type == CS_TYPE_cs_real_t ||
+ type == CS_TYPE_char);
+ }
+
+ n_bytes = count * nbr;
+
+ /* Convert to "big-endian" */
+
+ if (comm->swap_endian == true && count != 1) {
+ BFT_MALLOC(rec_tmp, n_bytes, cs_byte_t);
+ bft_file_swap_endian(rec_tmp, rec, count, nbr);
+ }
+ else
+ rec_tmp = NULL;
+
+ /* write data to socket */
+ /*----------------------*/
+
+ start_id = 0;
+
+ while (start_id < n_bytes) {
+
+ end_id = CS_MIN(start_id + SSIZE_MAX, n_bytes);
+
+ n_loc = end_id - start_id;
+
+ if (rec_tmp == NULL)
+ ret = write(comm->sock, (const void *)(rec + start_id), n_loc);
+ else
+ ret = write(comm->sock, (const void *)(rec_tmp + start_id), n_loc);
+
+ if (ret < 1)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Communication %s:\n"
+ "Error sending data by socket.\n"),
+ comm->nom);
+
+ start_id += ret;
+
+ }
+
+ if (rec_tmp != NULL)
+ BFT_FREE(rec_tmp);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize socket communication
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_sock_connect(cs_syr3_comm_t *comm)
+{
+ int ii;
+
+#if defined(_CS_ARCH_Linux)
+ socklen_t sock_len;
+#else
+ int sock_len; /* size_t according to SUS-v2 standard, but acording
+ to "man gethostbyname" under Linux, the standard
+ is bad, and we should have an int (or socklen_t) */
+#endif
+
+ char size_str[6] = " ";
+ char *host_names = NULL;
+ int *port_num_array = NULL;
+
+#if defined(HAVE_MPI)
+ int ierror = MPI_SUCCESS;
+#endif
+ int rank = (cs_glob_rank_id == -1 ? 0 : cs_glob_rank_id);
+
+ const int lng_hostname = CS_LOC_SYR3_COMM_LNG_HOSTNAME + 1;
+
+ /* Connect to server socket */
+
+ sock_len = sizeof(cs_glob_comm_sock_addr);
+
+ if (rank == 0) {
+
+ comm->sock = accept(cs_glob_comm_socket,
+ (struct sockaddr *)&cs_glob_comm_sock_addr,
+ &sock_len);
+
+ /* Send number of ranks */
+
+ sprintf(size_str, "%5d", (int)cs_glob_n_ranks);
+
+ if (write(comm->sock, size_str, 6) < 6)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Error in socket communication\n"));
+ }
+
+ /* Obtains the name of the host machine and its port number on rank 0 */
+
+ if (cs_glob_n_ranks > 1) {
+
+ BFT_MALLOC(host_names,
+ lng_hostname * cs_glob_n_ranks,
+ char);
+
+ BFT_MALLOC(port_num_array, cs_glob_n_ranks, int);
+
+#if defined(HAVE_MPI)
+ ierror = MPI_Gather(cs_glob_comm_sock_hostname, lng_hostname, MPI_CHAR,
+ host_names, lng_hostname, MPI_CHAR, 0,
+ cs_glob_mpi_comm);
+
+ if (ierror < 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error while sending the host name through MPI in sockets "
+ "initialization.\n"));
+
+ /* Send the port number */
+
+ ierror = MPI_Gather(&cs_glob_comm_sock_port_num, 1, MPI_INT,
+ port_num_array, 1, MPI_INT, 0, cs_glob_mpi_comm);
+
+ if (ierror < 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error while sending the port number through MPI in sockets "
+ "initialization.\n"));
+
+ if (rank != 0)
+ comm->sock = accept(cs_glob_comm_socket,
+ (struct sockaddr *)&cs_glob_comm_sock_addr,
+ &sock_len);
+
+#else
+ bft_error(__FILE__, __LINE__, 0,
+ _("MPI is needed for socket initialization.\n"));
+#endif
+
+ /* rank 0 sends the number of ranks, hostnames, and port numbers */
+
+ if (rank == 0) {
+
+ /* Send max hostname size */
+
+ sprintf(size_str, "%3d", lng_hostname);
+
+ if (write(comm->sock, size_str, 4) < 4)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Error in socket communication\n"));
+
+ for (ii = 1; ii < cs_glob_n_ranks; ii++) {
+
+ /* Send host machine name */
+
+ if (write(comm->sock, &(host_names[lng_hostname*ii]), lng_hostname)
+ < lng_hostname)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Error in socket communication\n"));
+
+ /* Send port number */
+
+ sprintf(size_str, "%5d", port_num_array[ii]);
+
+ if (write(comm->sock, size_str, 6) < 6)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Error in socket communication\n"));
+
+ }
+
+ } /* End of rank-0 specific operations */
+
+ BFT_FREE(host_names);
+ BFT_FREE(port_num_array);
+
+ } /* End for cs_glob_n_ranks > 1 */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Ensure exchange of magic string through sockets
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_sock_open(cs_syr3_comm_t *comm,
+ const char *magic_string)
+{
+ char nom_tmp[32 + 1];
+
+ char *magic_string_read = NULL;
+
+ int rank = (cs_glob_rank_id == -1 ? 0 : cs_glob_rank_id);
+ int len = strlen(CS_SYR3_COMM_SOCKET_HEADER);
+ int magic_string_len = strlen(magic_string);
+
+ if (read(comm->sock, nom_tmp, len) < len)
+ bft_error(__FILE__, __LINE__, errno,
+ _(cs_glob_comm_socket_err), comm->nom,
+ rank + 1);
+
+ /* Check that the connection is from the correct application type */
+
+ if (strncmp(nom_tmp, CS_SYR3_COMM_SOCKET_HEADER, len != 0))
+ bft_error(__FILE__, __LINE__, 0,
+ _("Attempt to connect to the communication port with\n"
+ "an unknown message format\n"));
+
+ /* Read magic string */
+ /*-------------------*/
+
+ BFT_MALLOC(magic_string_read, magic_string_len + 1, char);
+
+ _comm_read_sock(comm,
+ (void *)(magic_string_read),
+ strlen(magic_string),
+ CS_TYPE_char);
+
+ magic_string_read[magic_string_len] = '\0';
+
+ /* If the magic string does not match, we have an error */
+
+ if (strcmp(magic_string_read, magic_string) != 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error while initializating communication: \"%s\".\n"
+ "The interface version is not correct.\n"
+ "The magic string indicates the interface format version:\n"
+ "magic string read: \"%s\"\n"
+ "magic string expected: \"%s\"\n"),
+ comm->nom, magic_string_read, magic_string);
+
+ BFT_FREE(magic_string_read);
+
+ /* Write magic string */
+ /*--------------------*/
+
+ _comm_write_sock(comm,
+ (const void *)(magic_string),
+ strlen(magic_string),
+ CS_TYPE_char);
+}
+
+/*----------------------------------------------------------------------------
+ * Close the connection with the interface socket
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_sock_close(cs_syr3_comm_t *comm)
+{
+ if (close(comm->sock) != 0)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Communication %s):\n"
+ "Error closing the socket.\n"),
+ comm->nom);
+
+ comm->sock = -1;
+}
+
+#endif /* (HAVE_SOCKET) */
+
+/*----------------------------------------------------------------------------
+ * Print information on waiting for a message
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_echo_pre(const cs_syr3_comm_t *comm,
+ _cs_syr3_comm_mode_t mode)
+{
+ assert(comm != NULL);
+
+ if (mode == CS_SYR3_COMM_MODE_RECEIVE)
+ bft_printf(_("\nMessage received on \"%s\":\n"), comm->nom);
+
+ else /* if (mode == CS_SYR3_COMM_MODE_SEND) */
+ bft_printf(_("\nMessage sent on \"%s\":\n"), comm->nom);
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Print a message header
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_echo_header(const char *sec_name,
+ cs_int_t n_elts,
+ cs_type_t elt_type
+)
+{
+ char sec_name_write[CS_SYR3_COMM_H_LEN + 1];
+
+ /* instructions */
+
+ strncpy(sec_name_write, sec_name, CS_SYR3_COMM_H_LEN);
+ sec_name_write[CS_SYR3_COMM_H_LEN] = '\0';
+
+ bft_printf(_(" section name: \"%s\"\n"
+ " number of elements: %d\n"),
+ sec_name_write, n_elts);
+
+ if (n_elts > 0) {
+
+ char *nom_typ;
+
+ switch(elt_type) {
+ case CS_TYPE_char:
+ nom_typ = cs_syr3_comm_elt_type_name_char;
+ break;
+ case CS_TYPE_cs_int_t:
+ nom_typ = cs_syr3_comm_elt_type_name_int;
+ break;
+ case CS_TYPE_cs_real_t:
+ nom_typ = cs_syr3_comm_elt_type_name_real;
+ break;
+ default:
+ assert( elt_type == CS_TYPE_char
+ || elt_type == CS_TYPE_cs_int_t
+ || elt_type == CS_TYPE_cs_real_t);
+ }
+
+ bft_printf(_(" element type name: \"%s\"\n"), nom_typ);
+
+ }
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Print (partial) message content
+ *----------------------------------------------------------------------------*/
+
+static void
+_comm_echo_body(cs_int_t echo,
+ cs_int_t n_elts,
+ cs_type_t elt_type,
+ const void *sec_elts
+)
+{
+ cs_int_t echo_start = 0;
+ cs_int_t echo_end;
+ cs_int_t ii;
+
+ /* Instructions */
+
+ if (n_elts == 0) return;
+
+ if (echo * 2 < n_elts) {
+ echo_end = echo;
+ bft_printf(_(" %d first and last elements:\n"), echo);
+ }
+ else {
+ echo_end = n_elts;
+ bft_printf(_(" elements:\n"));
+ }
+
+ do {
+
+ switch (elt_type) {
+
+ case CS_TYPE_cs_int_t:
+ {
+ const cs_int_t *sec_elts_int = (const cs_int_t *) sec_elts;
+
+ for (ii = echo_start ; ii < echo_end ; ii++)
+ bft_printf(" %10d : %12d\n", ii + 1, *(sec_elts_int + ii));
+ }
+ break;
+
+ case CS_TYPE_cs_real_t:
+ {
+ const cs_real_t *sec_elts_real = (const cs_real_t *) sec_elts;
+
+ for (ii = echo_start ; ii < echo_end ; ii++)
+ bft_printf(" %10d : %12.5e\n", ii + 1, *(sec_elts_real + ii));
+ }
+ break;
+
+ case CS_TYPE_char:
+ {
+ const char *sec_elts_char = (const char *) sec_elts;
+
+ for (ii = echo_start ; ii < echo_end ; ii++) {
+ if (*(sec_elts_char + ii) != '\0')
+ bft_printf(" %10d : '%c'\n", ii + 1, *(sec_elts_char + ii));
+ else
+ bft_printf(" %10d : '\\0'\n", ii + 1);
+ }
+ }
+ break;
+
+ default:
+
+ assert( elt_type == CS_TYPE_cs_int_t
+ || elt_type == CS_TYPE_cs_real_t
+ || elt_type == CS_TYPE_char);
+
+ }
+
+ if (echo_end < n_elts) {
+ bft_printf(" .......... ............\n");
+ echo_start = n_elts - echo;
+ echo_end = n_elts;
+ }
+ else {
+ assert(echo_end == n_elts);
+ echo_end = n_elts + 1;
+ }
+
+ } while (echo_end <= n_elts);
+
+ bft_printf_flush();
+
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize a communication
+ *
+ * parameters:
+ * number, <-- coupling number
+ * proc_rank, <-- communicating process rank (< 0 if using sockets)
+ * mode, <-- send or receive
+ * type, <-- communication type
+ * echo <-- echo on main output (< 0 if none, header if 0,
+ * n first and last elements if n)
+ *
+ * returns:
+ * pointer to communication structure
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_t *
+cs_syr3_comm_initialize(int number,
+#if defined(HAVE_MPI)
+ int proc_rank,
+#endif
+ cs_syr3_comm_type_t type,
+ cs_int_t echo)
+{
+ unsigned int_endian;
+
+ const char base_name[] = "SYRTHES_";
+ const char magic_string[] = "CFD_SYRTHES_COUPLING_2.2";
+ cs_syr3_comm_t *comm = NULL;
+
+ BFT_MALLOC(comm, 1, cs_syr3_comm_t);
+
+ /* Build communicator name */
+
+ BFT_MALLOC(comm->nom, strlen(base_name) + 4 + 1, char);
+
+ sprintf(comm->nom, "%s%04d", base_name, number);
+
+ /* Initialize other fields */
+
+ comm->type = type;
+ comm->echo = echo;
+
+#if defined(HAVE_MPI)
+ comm->proc_rank = proc_rank;
+#else
+ comm->proc_rank = -1;
+#endif
+
+ /* Test if system is "big-endian" or "little-endian" */
+
+ comm->swap_endian = false;
+
+ int_endian = 0;
+ *((char *)(&int_endian)) = '\1';
+
+ if (int_endian == 1)
+ comm->swap_endian = true;
+
+#if defined(DEBUG) && !defined(NDEBUG)
+
+ else {
+ int_endian = 0;
+ *((char *)(&int_endian) + sizeof(unsigned) - 1) = '\1';
+ assert(int_endian == 1);
+ }
+
+#endif
+
+ /* Information on interface creation */
+
+ bft_printf(_("\n Opening communication: %s ..."), comm->nom);
+ bft_printf_flush();
+
+#if defined(HAVE_SOCKET)
+ if (comm->type == CS_SYR3_COMM_TYPE_SOCKET)
+ _comm_sock_connect(comm);
+#endif /* (HAVE_SOCKET) */
+
+ /* Create interface file descriptor */
+ /*----------------------------------*/
+
+ if (comm->type == CS_SYR3_COMM_TYPE_MPI) {
+
+#if defined(HAVE_MPI)
+ _comm_mpi_open(comm, magic_string);
+#else
+ assert(comm->proc_rank < 0);
+#endif
+
+ }
+ else {
+
+#if defined(HAVE_SOCKET)
+ if (comm->type == CS_SYR3_COMM_TYPE_SOCKET)
+ _comm_sock_open(comm, magic_string);
+#endif
+
+ }
+
+ /* Info on interface creation success */
+
+ bft_printf(" [ok]\n");
+ bft_printf_flush();
+
+ return comm;
+}
+
+/*----------------------------------------------------------------------------
+ * Function finalizing a communication
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_t *
+cs_syr3_comm_finalize(cs_syr3_comm_t *comm)
+{
+ /* Info on interface finalization */
+
+ bft_printf(_("\n Closing communication: %s\n"), comm->nom);
+ bft_printf_flush();
+
+#if defined(HAVE_SOCKET)
+
+ if (comm->type == CS_SYR3_COMM_TYPE_SOCKET)
+ _comm_sock_close(comm);
+
+#endif /* (HAVE_SOCKET) */
+
+ BFT_FREE(comm->nom);
+ BFT_FREE(comm);
+
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Return a pointer to a communicator name
+ *
+ * parameters:
+ * comm <-- communicator
+ *
+ * returns:
+ * pointer to communicator name
+ *----------------------------------------------------------------------------*/
+
+const char *
+cs_syr3_comm_get_name(const cs_syr3_comm_t *comm)
+{
+ assert(comm != NULL);
+
+ return(comm->nom);
+}
+
+/*----------------------------------------------------------------------------
+ * Send message
+ *
+ * parameters:
+ * sec_name <-- section name
+ * n_elts <-- number of elements
+ * elt_type <-- element type if n_elts > 0
+ * elts <-- elements if n_elts > 0
+ * comm <-- communicator
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_send_message(const char sec_name[CS_SYR3_COMM_H_LEN],
+ cs_int_t n_elts,
+ cs_type_t elt_type,
+ void *elts,
+ const cs_syr3_comm_t *comm)
+{
+ char sec_name_write[CS_SYR3_COMM_H_LEN + 1];
+
+ char *elt_type_name;
+ char elt_type_name_write[CS_SYR3_COMM_ELT_TYPE_NAME_LEN + 1];
+
+
+ assert(comm != NULL);
+ assert(n_elts >= 0);
+
+ /* section name */
+
+ sprintf(sec_name_write,
+ "%-*.*s",
+ CS_SYR3_COMM_H_LEN,
+ CS_SYR3_COMM_H_LEN,
+ sec_name);
+
+ /* element type name */
+
+ if (n_elts != 0) {
+
+ switch(elt_type) {
+
+ case CS_TYPE_cs_int_t:
+ elt_type_name = cs_syr3_comm_elt_type_name_int;
+ break;
+
+ case CS_TYPE_cs_real_t:
+ elt_type_name = cs_syr3_comm_elt_type_name_real;
+ break;
+
+ case CS_TYPE_char:
+ elt_type_name = cs_syr3_comm_elt_type_name_char;
+ break;
+
+ default:
+ assert( elt_type == CS_TYPE_cs_int_t
+ || elt_type == CS_TYPE_cs_real_t
+ || elt_type == CS_TYPE_char);
+
+ }
+
+ sprintf(elt_type_name_write,
+ "%-*.*s",
+ CS_SYR3_COMM_ELT_TYPE_NAME_LEN,
+ CS_SYR3_COMM_ELT_TYPE_NAME_LEN,
+ elt_type_name);
+
+ }
+
+ if (comm->echo >= 0)
+ _comm_echo_pre(comm, CS_SYR3_COMM_MODE_SEND);
+
+
+#if defined(HAVE_MPI)
+
+ /* MPI communication */
+ /*-------------------*/
+
+ if (comm->type == CS_SYR3_COMM_TYPE_MPI) {
+
+ cs_int_t n_sec_elts_ecr = n_elts;
+
+ _comm_mpi_header(sec_name_write,
+ &n_sec_elts_ecr,
+ elt_type_name_write,
+ CS_SYR3_COMM_MODE_SEND,
+ comm);
+
+ if (n_elts > 0)
+ _comm_mpi_body((void *) elts,
+ n_elts,
+ elt_type,
+ CS_SYR3_COMM_MODE_SEND,
+ comm);
+
+ }
+
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+ /* socket communication */
+ /*----------------------*/
+
+ if (comm->type == CS_SYR3_COMM_TYPE_SOCKET) {
+
+ /* section name */
+
+ _comm_write_sock(comm,
+ (const void *) sec_name_write,
+ CS_SYR3_COMM_H_LEN,
+ CS_TYPE_char);
+
+ /* number of elements */
+
+ _comm_write_sock(comm,
+ (const void *)(&n_elts),
+ 1,
+ CS_TYPE_cs_int_t);
+
+ if (n_elts != 0) {
+
+ /* element type name */
+
+ _comm_write_sock(comm,
+ (const void *) elt_type_name_write,
+ CS_SYR3_COMM_ELT_TYPE_NAME_LEN,
+ CS_TYPE_char);
+
+ /* element values */
+
+ _comm_write_sock(comm,
+ (const void *) elts,
+ (size_t) n_elts,
+ elt_type);
+
+ }
+
+ }
+
+#endif /* (HAVE_SOCKET) */
+
+ /* Possibly print to log file */
+
+ if (comm->echo >= 0)
+ _comm_echo_header(sec_name,
+ n_elts,
+ elt_type);
+
+ if (comm->echo > 0)
+ _comm_echo_body(comm->echo,
+ n_elts,
+ elt_type,
+ elts);
+}
+
+/*----------------------------------------------------------------------------
+ * Receive message header
+ *
+ * parameters:
+ * header --> message header
+ * comm <-- communicator
+ *
+ * returns
+ * number of elements in message body
+ *----------------------------------------------------------------------------*/
+
+cs_int_t
+cs_syr3_comm_receive_header(cs_syr3_comm_msg_header_t *header,
+ const cs_syr3_comm_t *comm)
+{
+ char elt_type_name[CS_SYR3_COMM_ELT_TYPE_NAME_LEN + 1];
+
+ assert(comm != NULL);
+
+ header->n_elts = 0;
+
+ if (comm->echo >= 0)
+ _comm_echo_pre(comm, CS_SYR3_COMM_MODE_RECEIVE);
+
+
+#if defined(HAVE_MPI)
+
+ /* MPI communication */
+ /*-------------------*/
+
+ if (comm->type == CS_SYR3_COMM_TYPE_MPI) {
+
+ _comm_mpi_header(header->sec_name,
+ &(header->n_elts),
+ elt_type_name,
+ CS_SYR3_COMM_MODE_RECEIVE,
+ comm);
+
+ }
+
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+ /* socket communication */
+ /*----------------------*/
+
+ if (comm->type == CS_SYR3_COMM_TYPE_SOCKET) {
+
+ /* section type name */
+
+ _comm_read_sock(comm,
+ (void *) &(header->sec_name),
+ CS_SYR3_COMM_H_LEN,
+ CS_TYPE_char);
+
+ /* number of elements */
+
+ _comm_read_sock(comm,
+ (void *) &(header->n_elts),
+ 1,
+ CS_TYPE_cs_int_t);
+
+
+ if (header->n_elts != 0) {
+
+ /* element type name */
+
+ _comm_read_sock(comm,
+ (void *) elt_type_name,
+ CS_SYR3_COMM_ELT_TYPE_NAME_LEN,
+ CS_TYPE_char);
+
+ }
+
+ }
+
+#endif /* (HAVE_SOCKET) */
+
+ header->sec_name[CS_SYR3_COMM_H_LEN] = '\0';
+
+ if (header->n_elts != 0) {
+
+ elt_type_name[CS_SYR3_COMM_ELT_TYPE_NAME_LEN] = '\0';
+
+ if (strcmp(elt_type_name, cs_syr3_comm_elt_type_name_int) == 0)
+ header->elt_type = CS_TYPE_cs_int_t;
+
+ else if (strcmp(elt_type_name, cs_syr3_comm_elt_type_name_real) == 0)
+ header->elt_type = CS_TYPE_cs_real_t;
+
+ else if (strcmp(elt_type_name, cs_syr3_comm_elt_type_name_char) == 0)
+ header->elt_type = CS_TYPE_char;
+
+ else {
+ assert(0);
+ }
+ }
+
+ /* Possibly print to log file */
+
+ if (comm->echo >= 0)
+ _comm_echo_header(header->sec_name,
+ header->n_elts,
+ header->elt_type);
+
+ /* Return number of elements to read */
+
+ return header->n_elts;
+}
+
+/*----------------------------------------------------------------------------
+ * Receive a message body
+ *
+ * parameters:
+ * header <-- message header
+ * elt --> received body values
+ * comm <-- communicator
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_receive_body(const cs_syr3_comm_msg_header_t *header,
+ void *elt,
+ const cs_syr3_comm_t *comm)
+{
+ cs_int_t ii;
+ void *_sec_elts;
+
+ assert(comm != NULL);
+ assert(header->n_elts >= 0);
+
+ _sec_elts = elt;
+
+ if (_sec_elts == NULL && header->n_elts != 0) {
+
+ switch(header->elt_type) {
+
+ case CS_TYPE_cs_int_t:
+ {
+ cs_int_t *sec_elts_int;
+
+ BFT_MALLOC(sec_elts_int, header->n_elts, cs_int_t);
+ _sec_elts = (void *) sec_elts_int;
+ }
+ break;
+
+ case CS_TYPE_cs_real_t:
+ {
+ cs_real_t *sec_elts_rea;
+
+ BFT_MALLOC(sec_elts_rea, header->n_elts, cs_real_t);
+ _sec_elts = (void *)sec_elts_rea;
+ }
+ break;
+
+ case CS_TYPE_char:
+ {
+ char *sec_elts_cha;
+
+ BFT_MALLOC(sec_elts_cha, header->n_elts + 1, char);
+ _sec_elts = (void *)sec_elts_cha;
+ }
+ break;
+
+ default:
+ assert( header->elt_type == CS_TYPE_cs_int_t
+ || header->elt_type == CS_TYPE_cs_real_t
+ || header->elt_type == CS_TYPE_char);
+ }
+
+ }
+
+ /* element values */
+
+ if (header->n_elts != 0) {
+
+#if defined(HAVE_MPI)
+
+ if (comm->type == CS_SYR3_COMM_TYPE_MPI)
+ _comm_mpi_body((void *)_sec_elts,
+ header->n_elts,
+ header->elt_type,
+ CS_SYR3_COMM_MODE_RECEIVE,
+ comm);
+
+#endif /* (HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+ if (comm->type == CS_SYR3_COMM_TYPE_SOCKET)
+ _comm_read_sock(comm,
+ (void *)_sec_elts,
+ (size_t) header->n_elts,
+ header->elt_type);
+
+#endif /* (HAVE_SOCKET) */
+
+ /* Verification */
+
+ if (header->elt_type == CS_TYPE_char) {
+ for (ii = 0 ;
+ ii < header->n_elts && ((char *)_sec_elts)[ii] != '\0' ;
+ ii++);
+ ((char *)_sec_elts)[ii] = '\0';
+ }
+
+ /* Possibly print to log file */
+
+ if (comm->echo > 0)
+ _comm_echo_body(comm->echo,
+ header->n_elts,
+ header->elt_type,
+ _sec_elts);
+
+ }
+
+}
+
+#if defined(HAVE_SOCKET)
+
+/*----------------------------------------------------------------------------
+ * Open an IP socket to prepare for this communication mode
+ *
+ * parameters:
+ * port_num <-- port number (only used for rank 0; automatic on others)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_init_socket(int port_num)
+{
+ char s[CS_LOC_SYR3_COMM_LNG_HOSTNAME + 1];
+
+ int n_connect_max;
+
+#if defined(_CS_ARCH_Linux)
+ socklen_t sock_len;
+#else
+ int sock_len; /* size_t according to SUS-v2 standard, but acording
+ to "man gethostbyname" under Linux, the standard
+ is bad, and we should have an int (or socklen_t) */
+#endif
+
+ unsigned int_endian;
+
+ struct sockaddr_in sock_addr;
+ struct hostent *host_ent;
+
+ int _port_num = port_num;
+ int rank = (cs_glob_rank_id == -1 ? 0 : cs_glob_rank_id);
+
+ /* Initialization */
+
+ n_connect_max = 0;
+
+ if (getenv("CS_SYR3_COMM_SOCKET_N_MAX") != NULL)
+ n_connect_max = atoi(getenv("CS_SYR3_COMM_SOCKET_N_MAX"));
+
+ if (n_connect_max == 0)
+ n_connect_max = CS_SYR3_COMM_SOCKET_N_MAX;
+
+ /* Test if system is "big-endian" (network reference) or "little-endian" */
+
+ cs_glob_comm_little_endian = false;
+
+ int_endian = 0;
+ *((char *) (&int_endian)) = '\1';
+
+ if (int_endian == 1)
+ cs_glob_comm_little_endian = true;
+
+#if defined(DEBUG) && !defined(NDEBUG)
+ else {
+ int_endian = 0;
+ *((char *) (&int_endian) + sizeof(unsigned) - 1) = '\1';
+ assert (int_endian == 1);
+ }
+#endif
+
+ /* Create server socket */
+
+ cs_glob_comm_socket = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (cs_glob_comm_socket == -1)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Initialization error for socket communication support.\n"));
+
+ /* Prepare for use */
+
+ sock_len = sizeof(sock_addr);
+
+ memset((char *) &sock_addr, 0, sock_len);
+
+ sock_addr.sin_family = AF_INET;
+ if (rank > 0) /* port number automatic on ranks > 0) */
+ sock_addr.sin_addr.s_addr = INADDR_ANY;
+ else
+ sock_addr.sin_addr.s_addr = _port_num;
+ sock_addr.sin_port = 0;
+
+ if (cs_glob_comm_little_endian == true) {
+ bft_file_swap_endian(&(sock_addr.sin_addr.s_addr),
+ &(sock_addr.sin_addr.s_addr),
+ sizeof(sock_addr.sin_addr.s_addr),
+ 1);
+ bft_file_swap_endian(&(sock_addr.sin_port),
+ &(sock_addr.sin_port),
+ sizeof(sock_addr.sin_port),
+ 1);
+ }
+
+ if (gethostname(s, CS_LOC_SYR3_COMM_LNG_HOSTNAME) < 0)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Error obtaining computer's name"));
+ s[CS_LOC_SYR3_COMM_LNG_HOSTNAME] = '\0';
+
+ host_ent = gethostbyname(s);
+ memcpy(host_ent->h_addr_list[0], &sock_addr.sin_addr, host_ent->h_length);
+
+ if (bind(cs_glob_comm_socket,
+ (struct sockaddr *)&sock_addr,
+ sock_len) != 0)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Initialization error for socket communication support.\n"));
+
+ if (listen(cs_glob_comm_socket, n_connect_max) < 0)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Initialization error for socket communication support.\n"));
+
+ /* Obtain assigned service number */
+
+ if (getsockname(cs_glob_comm_socket,
+ (struct sockaddr *)&sock_addr,
+ &sock_len) != 0)
+ bft_error(__FILE__, __LINE__, errno,
+ _("Initialization error for socket communication support.\n"));
+
+ _port_num = sock_addr.sin_port;
+ if (cs_glob_comm_little_endian == true) {
+ bft_file_swap_endian(&(sock_addr.sin_port),
+ &(sock_addr.sin_port),
+ sizeof(sock_addr.sin_port), 1);
+ _port_num = sock_addr.sin_port;
+ bft_file_swap_endian(&(sock_addr.sin_port),
+ &(sock_addr.sin_port),
+ sizeof(sock_addr.sin_port), 1);
+ }
+
+ /* Save the structure in the associated global variable */
+
+ cs_glob_comm_sock_addr = sock_addr;
+
+ /* Write host and port names in process order */
+
+ if (rank == 0) {
+
+ /* Print available socket information to log for rank 0
+ (do not internationalize this string so that scripts
+ my use it more easily). */
+
+ bft_printf("\n SYRTHES server port initialized\n\n");
+ bft_printf_flush();
+
+ }
+
+ memcpy(cs_glob_comm_sock_hostname, s, CS_LOC_SYR3_COMM_LNG_HOSTNAME);
+ cs_glob_comm_sock_hostname[CS_LOC_SYR3_COMM_LNG_HOSTNAME] = '\0';
+ cs_glob_comm_sock_port_num = _port_num;
+}
+
+/*----------------------------------------------------------------------------
+ * Close an IP socket associated with this communication mode
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_comm_finalize_socket(void)
+{
+ if (cs_glob_comm_socket == 0)
+ return;
+
+ close(cs_glob_comm_socket);
+
+ bft_printf(_("\nClosing socket...\t [ok]\n"));
+ bft_printf_flush();
+}
+
+#endif /* HAVE_SOCKET */
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_syr3_coupling.c b/src/base/cs_syr3_coupling.c
new file mode 100644
index 0000000..204551d
--- /dev/null
+++ b/src/base/cs_syr3_coupling.c
@@ -0,0 +1,1748 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * SYRTHES 3 coupling
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+#include <fvm_interface.h>
+#include <fvm_nodal_extract.h>
+#include <fvm_nodal_project.h>
+#include <fvm_nodal_triangulate.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh.h"
+#include "cs_mesh_connect.h"
+#include "cs_parall.h"
+#include "cs_post.h"
+#include "cs_selector.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_syr3_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+#undef _CROSS_PRODUCT_3D
+#undef _MODULE_3D
+
+enum {X, Y, Z} ;
+
+#define _CROSS_PRODUCT_3D(cross_prod, vect1, vect2) \
+ (cross_prod[X] = vect1[Y]*vect2[Z] - vect2[Y]*vect1[Z], \
+ cross_prod[Y] = vect2[X]*vect1[Z] - vect1[X]*vect2[Z], \
+ cross_prod[Z] = vect1[X]*vect2[Y] - vect2[X]*vect1[Y])
+
+#define _MODULE_3D(vect) \
+ sqrt(vect[X]*vect[X] + vect[Y]*vect[Y] + vect[Z]*vect[Z])
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/* Structure associated with SYRTHES coupling */
+
+struct _cs_syr3_coupling_t {
+
+ int dim; /* Coupled mesh dimension */
+ int ref_axis; /* Selected axis for edge extraction */
+
+ int syr_num; /* SYRTHES number */
+
+ /* Boundary faces parameters of coupled mesh */
+
+ char *face_sel; /* Face selection criteria */
+
+ fvm_lnum_t n_faces; /* Number of coupled faces */
+ fvm_lnum_t *face_list; /* List of coupled faces */
+ cs_real_t *weighting; /* Triangle area or edge lengths */
+ fvm_nodal_t *coupled_mesh; /* Nodal mesh extracted */
+
+ fvm_interface_set_t *if_set; /* Interfaces between equivalent vertices */
+
+ /* Saved arrays for post processing (float for reduced memory use) */
+
+ int post_mesh_id; /* 0 if post-processing is not active,
+ mesh_id if post-processing is active */
+ float *wall_temp; /* Wall temperature (received) */
+ float *flux; /* Flux (calculated) */
+ float *tfluid_tmp; /* Fluid temperature (points to flux in
+ transient stage where wall_temp and
+ fluid_temp are known, NULL once
+ flux is calculated) */
+
+ /* Communication structure */
+
+ cs_syr3_comm_t *comm; /* Communicator */
+ cs_syr3_comm_type_t comm_type; /* Communicator type */
+ int comm_echo; /* Optional echo to standard output */
+
+#if defined(HAVE_MPI)
+ cs_int_t syr_proc_rank; /* SYRTHES rank */
+#endif
+};
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+static int cs_glob_syr_n_couplings = 0;
+static cs_syr3_coupling_t **cs_glob_syr_coupling_array = NULL;
+
+/* Start and end (negative) numbers associated with
+ dedicated post processing meshes */
+
+static int cs_glob_syr_post_maillage_ext[2] = {0, 1};
+
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Conversion from fvm_gnum_t to cs_int_t .
+ * Arrays can use the same memory.
+ *
+ * parameters:
+ * fvm_data <-- input data
+ * cs_data --> output data
+ * n_elts <-- numbers of elements to compute
+ *----------------------------------------------------------------------------*/
+
+static void
+_convert_fvm_gnum(fvm_gnum_t fvm_data[],
+ cs_int_t cs_data[],
+ fvm_gnum_t n_elts)
+{
+ size_t i;
+
+ if (sizeof(cs_int_t) > sizeof(fvm_gnum_t)) {
+ for (i = 0; i < n_elts; i++)
+ cs_data[n_elts - 1 - i] = fvm_data[n_elts - 1 -i];
+ }
+ else {
+ for (i = 0; i < n_elts; i++)
+ cs_data[i] = fvm_data[i];
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Define nodal mesh for SYRTHES coupling from selection criteria on border
+ * faces.
+ *
+ * parameters:
+ * coupled_mesh_name <-- name of the coupled mesh
+ * syr_coupling <-- SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+static fvm_nodal_t *
+_define_coupled_mesh(char *coupled_mesh_name,
+ cs_syr3_coupling_t *syr_coupling)
+{
+ fvm_nodal_t *coupled_mesh = NULL;
+
+ const cs_int_t comm_echo = syr_coupling->comm_echo;
+
+ /* Creation of a new nodal mesh from selected boundary faces */
+
+ BFT_MALLOC(syr_coupling->face_list,
+ cs_glob_mesh->n_b_faces,
+ fvm_lnum_t);
+
+ cs_selector_get_b_face_list(syr_coupling->face_sel,
+ &(syr_coupling->n_faces),
+ syr_coupling->face_list);
+
+ BFT_REALLOC(syr_coupling->face_list,
+ syr_coupling->n_faces,
+ fvm_lnum_t);
+
+ if (comm_echo >= 0)
+ bft_printf(_("\nExtracting \"%s\" mesh\n"), coupled_mesh_name);
+
+ coupled_mesh
+ = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ coupled_mesh_name,
+ 0,
+ syr_coupling->n_faces,
+ NULL,
+ syr_coupling->face_list);
+
+ return coupled_mesh;
+}
+
+/*----------------------------------------------------------------------------
+ * Renumbering of selected border faces in order to be consistent with
+ * parent_num from triangulation.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_renum_faces_list(cs_syr3_coupling_t *syr_coupling)
+{
+ cs_int_t i, fac_id;
+ cs_int_t elt_num, elt_num_prev, n_elts;
+
+ cs_int_t *parent_num = NULL;
+ cs_int_t *face_list = syr_coupling->face_list;
+ fvm_nodal_t *coupled_mesh = syr_coupling->coupled_mesh;
+
+ const int elt_dim = syr_coupling->dim - 1;
+ const cs_int_t comm_echo = syr_coupling->comm_echo;
+
+ if (comm_echo >= 0) {
+ bft_printf(_("\n *** Renumbering of the boundary faces list ..."));
+ bft_printf_flush();
+ }
+
+ /* Retrieve parent_num from coupled mesh */
+
+ n_elts = fvm_nodal_get_n_entities(coupled_mesh, elt_dim);
+
+ BFT_MALLOC(parent_num, n_elts, cs_int_t);
+
+ fvm_nodal_get_parent_num(coupled_mesh, elt_dim, parent_num);
+
+ assert(sizeof(fvm_lnum_t) == sizeof(cs_int_t));
+
+ /* Rebuild coupled faces list in same order as fvm_nodal_structure */
+
+ elt_num_prev = -1;
+ fac_id = 0;
+
+ for (i = 0; i < n_elts; i++) {
+
+ elt_num = parent_num[i];
+
+ if (elt_num != elt_num_prev) {
+ face_list[fac_id++] = elt_num;
+ elt_num_prev = elt_num;
+ }
+
+ }
+
+ assert(fac_id == syr_coupling->n_faces);
+
+ BFT_FREE(parent_num);
+
+ if (comm_echo >= 0) {
+ bft_printf(" [ok]\n");
+ bft_printf_flush();
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Send information about coupled vertices to SYRTHES:
+ * - number of coupled vertices and their global numbering,
+ * - vertex coordinates.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * n_vertices <-- number of coupled vertices
+ * coords <-> vertices's coordinates
+ *----------------------------------------------------------------------------*/
+
+static void
+_send_coords(cs_syr3_coupling_t *syr_coupling,
+ cs_int_t n_vertices,
+ cs_real_t *coords)
+{
+ cs_int_t elt_size;
+
+ fvm_gnum_t n_g_vertices = 0;
+ cs_int_t _n_g_vertices = 0;
+ char *global_vtx_num_buffer = NULL;
+ cs_int_t *global_vtx_num_int = NULL;
+ fvm_gnum_t *global_vtx_num = NULL;
+ fvm_nodal_t *coupled_mesh = syr_coupling->coupled_mesh;
+
+ const cs_int_t dim = syr_coupling->dim;
+ const cs_int_t n_faces = syr_coupling->n_faces;
+
+ /* Send number of vertices */
+
+ cs_syr3_comm_send_message("coupl:b:npoinf",
+ 1,
+ CS_TYPE_cs_int_t,
+ &n_vertices,
+ syr_coupling->comm);
+
+ n_g_vertices = fvm_nodal_get_n_g_vertices(coupled_mesh);
+ _n_g_vertices = n_g_vertices;
+
+ /* Send global number of vertices */
+
+ cs_syr3_comm_send_message("coupl:b:g:npoinf",
+ 1,
+ CS_TYPE_cs_int_t,
+ &_n_g_vertices,
+ syr_coupling->comm);
+
+ if (n_faces > 0) {
+
+ elt_size = CS_MAX(sizeof(fvm_gnum_t), sizeof(cs_int_t));
+ BFT_MALLOC(global_vtx_num_buffer, n_vertices * elt_size, char);
+
+ global_vtx_num = (fvm_gnum_t *)global_vtx_num_buffer;
+
+ fvm_nodal_get_global_vertex_num(coupled_mesh, global_vtx_num);
+
+ /* Convert fvm_gnum_t to cs_int_t if necessary */
+
+ global_vtx_num_int = (cs_int_t *)global_vtx_num_buffer;
+ _convert_fvm_gnum(global_vtx_num,
+ global_vtx_num_int,
+ (fvm_gnum_t)n_vertices);
+
+ }
+
+ /* Send global vertex numbering */
+
+ cs_syr3_comm_send_message("coupl:b:g:vtxnum",
+ n_vertices,
+ CS_TYPE_cs_int_t,
+ global_vtx_num_int,
+ syr_coupling->comm);
+
+ if (global_vtx_num_buffer != NULL) {
+
+ BFT_FREE(global_vtx_num_buffer);
+ global_vtx_num_int = NULL;
+ global_vtx_num = NULL;
+
+ }
+
+ /* Get vertices's coordinates */
+
+ if (n_faces > 0) {
+
+ /* Checkings */
+
+ assert(sizeof(fvm_coord_t) == sizeof(cs_real_t));
+ assert(sizeof(double) == sizeof(cs_real_t));
+
+ fvm_nodal_get_vertex_coords(coupled_mesh,
+ FVM_NO_INTERLACE,
+ coords);
+
+ }
+
+ /* Send vertices's coordinates */
+
+ cs_syr3_comm_send_message("coupl:b:xyzf",
+ dim * n_vertices,
+ CS_TYPE_cs_real_t,
+ coords,
+ syr_coupling->comm);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Send to SYRTHES elements connectivity.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * n_elts <-- number of elements
+ *----------------------------------------------------------------------------*/
+
+static void
+_send_connectivity(cs_syr3_coupling_t *syr_coupling,
+ cs_int_t n_elts)
+{
+ cs_int_t i_elt, i_dim;
+ cs_int_t stride, elt_size;
+
+ cs_int_t n_connect = 0;
+ char *glob_elt_num = NULL;
+ cs_int_t *ni_connect = NULL;
+ fvm_lnum_t *connect = NULL;
+ fvm_nodal_t *coupled_mesh = syr_coupling->coupled_mesh;
+
+ const cs_int_t dim = syr_coupling->dim;
+ const cs_int_t elt_dim = syr_coupling->dim - 1;
+ const cs_int_t n_faces = syr_coupling->n_faces;
+
+ /* Send number of elements */
+
+ cs_syr3_comm_send_message("coupl:b:nelebf",
+ 1,
+ CS_TYPE_cs_int_t,
+ &n_elts,
+ syr_coupling->comm);
+
+ /* Get global element num */
+
+ if (n_faces > 0) {
+
+ elt_size = CS_MAX(sizeof(fvm_gnum_t), sizeof(cs_int_t));
+ BFT_MALLOC(glob_elt_num, n_elts * elt_size, char);
+
+ if (elt_dim == 2)
+ fvm_nodal_get_global_element_num(coupled_mesh,
+ FVM_FACE_TRIA,
+ (fvm_gnum_t *)glob_elt_num);
+
+ else if (elt_dim == 1)
+ fvm_nodal_get_global_element_num(coupled_mesh,
+ FVM_EDGE,
+ (fvm_gnum_t *)glob_elt_num);
+
+ else
+ assert(elt_dim == 1 || elt_dim == 2);
+
+ /* Convert fvm_gnum_t to cs_int_t if necessary */
+
+ _convert_fvm_gnum((fvm_gnum_t *)glob_elt_num,
+ (cs_int_t *)glob_elt_num,
+ (fvm_gnum_t)n_elts);
+
+ } /* n_faces > 0 */
+
+ /* Send global element numbering */
+
+ cs_syr3_comm_send_message("coupl:b:g:eltnum",
+ n_elts,
+ CS_TYPE_cs_int_t,
+ (cs_int_t *)glob_elt_num,
+ syr_coupling->comm);
+
+ if (glob_elt_num != NULL)
+ BFT_FREE(glob_elt_num);
+
+ /* Connectivity */
+
+ if (n_faces > 0) {
+
+ if (elt_dim == 2) { /*If elements are triangles */
+
+ stride = 3;
+ n_connect = n_elts * stride;
+ BFT_MALLOC(connect, n_connect, fvm_lnum_t);
+
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_FACE_TRIA,
+ connect);
+
+ }
+ else if (elt_dim == 1) { /* If elements are edges */
+
+ stride = 2;
+ n_connect = n_elts * stride;
+ BFT_MALLOC(connect, n_connect, fvm_lnum_t);
+
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_EDGE,
+ connect);
+
+ }
+ else
+ assert(elt_dim == 2 || elt_dim == 1);
+
+ /* Convert an interlaced connectivty to a non interlaced one */
+
+ BFT_MALLOC(ni_connect, n_connect, cs_int_t);
+
+ for (i_dim = 0; i_dim < dim; i_dim++) {
+ for (i_elt = 0; i_elt < n_elts; i_elt++)
+ ni_connect[i_elt + n_elts * i_dim] = connect[i_elt * dim + i_dim];
+ }
+
+ BFT_FREE(connect);
+
+ } /* n_faces > 0 */
+
+ /* Send connectivity */
+
+ cs_syr3_comm_send_message("coupl:b:nodebf",
+ n_connect,
+ CS_TYPE_cs_int_t,
+ ni_connect,
+ syr_coupling->comm);
+
+ if (n_faces > 0)
+ BFT_FREE(ni_connect);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Compute weighting (area for triangles and lengths for edges) used in
+ * interpolation.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * coords <-- vertices's coordinates
+ * n_elts <-- number of elements
+ *----------------------------------------------------------------------------*/
+
+static void
+_compute_weighting(cs_syr3_coupling_t *syr_coupling,
+ cs_real_t *coords,
+ cs_int_t n_elts)
+{
+ cs_int_t i_elt, i_stride, i_dim;
+ cs_int_t stride;
+
+ cs_int_t n_vertices = 0;
+ cs_int_t *connect = NULL;
+ fvm_nodal_t *coupled_mesh = syr_coupling->coupled_mesh;
+
+ const cs_int_t elt_dim = syr_coupling->dim - 1;
+ const cs_int_t dim = cs_glob_mesh->dim;
+
+ if (elt_dim == 2) { /* Triangle case */
+
+ cs_int_t vtx_idx[3];
+ cs_real_t vect1[3] = {0, 0, 0}, vect2[3] = {0, 0, 0};
+ cs_real_t cross_prod[3] = {0, 0, 0};
+
+ /* Get local connectivity */
+
+ stride = 3;
+ BFT_MALLOC(connect, stride * n_elts, cs_int_t);
+
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_FACE_TRIA,
+ connect);
+
+ n_vertices = (cs_int_t)fvm_nodal_get_n_entities(coupled_mesh, 0);
+
+ /* Compute area for each triangle */
+
+ for (i_elt = 0; i_elt < n_elts; i_elt++) {
+
+ for (i_stride = 0; i_stride < stride; i_stride++)
+ vtx_idx[i_stride] = connect[i_elt * stride + i_stride] - 1;
+
+ /* WARNING: SYRTHES coordinates are non interlaced */
+
+ for (i_dim = 0; i_dim < dim; i_dim++) {
+
+ vect1[i_dim] = (cs_real_t)coords[vtx_idx[1] + n_vertices * i_dim]
+ - (cs_real_t)coords[vtx_idx[0] + n_vertices * i_dim];
+
+ vect2[i_dim] = (cs_real_t)coords[vtx_idx[2] + n_vertices * i_dim]
+ - (cs_real_t)coords[vtx_idx[0] + n_vertices * i_dim];
+
+ }
+
+ _CROSS_PRODUCT_3D(cross_prod, vect1, vect2);
+
+ for (i_dim = 0; i_dim < dim; i_dim++)
+ cross_prod[i_dim] *= 0.5;
+
+ syr_coupling->weighting[i_elt] = _MODULE_3D(cross_prod);
+
+ assert(syr_coupling->weighting[i_elt] > 1.e-16);
+
+ } /* End of loop on elements */
+
+ }
+ else if (elt_dim == 1) { /* Edges case */
+
+ cs_int_t vtx_idx[2];
+ cs_real_t vect[3] = {0, 0, 0};
+
+ /* Get local connectivity */
+
+ stride = 2;
+ BFT_MALLOC(connect, stride * n_elts, cs_int_t);
+
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_EDGE,
+ connect);
+
+ n_vertices = (cs_int_t)fvm_nodal_get_n_entities(coupled_mesh, 0);
+
+ /* Compute length for each edge */
+
+ for (i_elt = 0; i_elt < n_elts; i_elt++) {
+
+ for (i_stride = 0; i_stride < stride; i_stride++)
+ vtx_idx[i_stride] = connect[i_elt * stride + i_stride] - 1;
+
+ /* WARNING: SYRTHES coordinates are non interlaced */
+
+ for (i_dim = 0; i_dim < dim; i_dim++)
+ vect[i_dim] = (cs_real_t)coords[vtx_idx[1] + n_vertices * i_dim]
+ - (cs_real_t)coords[vtx_idx[0] + n_vertices * i_dim];
+
+ syr_coupling->weighting[i_elt] = _MODULE_3D(vect);
+
+ assert(syr_coupling->weighting[i_elt] > 1.e-16);
+
+ } /* End of loop on elements */
+
+ }
+ else
+ assert(elt_dim == 2 || elt_dim == 1);
+
+ if (connect != NULL)
+ BFT_FREE(connect);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Interpolate a nodal field to an element-centered field for real numbers.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * elt_values --> array of values defined on elements
+ * vtx_values <-> array of values defined on vertices
+ * n_elts <-- number of elements
+ * stride <-- element's stride
+ * parent_num <-- parent element numbering
+ * connect <-- local connectivity
+ *----------------------------------------------------------------------------*/
+
+static void
+_interpolate_vtx_to_elt(const cs_syr3_coupling_t *syr_coupling,
+ cs_real_t *elt_values,
+ const cs_real_t *vtx_values,
+ fvm_lnum_t n_elts,
+ int stride,
+ const fvm_lnum_t *parent_num,
+ const fvm_lnum_t *connect)
+{
+ cs_int_t i, j, vtx_id, fac_id;
+ cs_int_t elt_num, elt_num_prev;
+
+ cs_real_t *down = NULL;
+ cs_real_t up = 0;
+ cs_real_t stride_inverse = 1./stride;
+
+ const cs_int_t n_faces = syr_coupling->n_faces;
+ const cs_real_t *weighting = syr_coupling->weighting;
+
+ BFT_MALLOC(down, n_faces, cs_real_t);
+
+ /* Initialize arrays */
+
+ for (i = 0; i < n_faces; i++) {
+ elt_values[i] = 0;
+ down[i] = 0;
+ }
+
+ /* Interpolate field */
+
+ elt_num_prev = -1;
+ fac_id = -1;
+
+ for (i = 0; i < n_elts; i++) {
+
+ elt_num = parent_num[i];
+
+ if (elt_num != elt_num_prev) {
+ fac_id += 1;
+ elt_num_prev = elt_num;
+ }
+
+ up = 0.;
+
+ for (j = 0; j < stride; j++) {
+ vtx_id = connect[i*stride + j] - 1;
+ up += vtx_values[vtx_id];
+ }
+
+ elt_values[fac_id] += up * stride_inverse * weighting[i];
+ down[fac_id] += weighting[i];
+
+ }
+
+ assert(fac_id+1 == n_faces);
+
+ for (i = 0; i < n_faces; i++)
+ elt_values[i] /= down[i];
+
+ BFT_FREE(down);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Interpolate an element-centered field to a nodal field for real numbers.
+ *
+ * The size of vtx_values array must be twice the number of vertices.
+ * The first half gets values and the second half is used as a working array.
+ * The two parts must be contiguous in parallel mode for MPI transfers.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * elt_values <-> array of values defined on elements
+ * n_vtx_values <-- number of values defined on vertices
+ * vtx_values <-> array of values defined on vertices
+ * n_elts <-- number of elements
+ * stride <-- element's stride
+ * parent_num <-- parent element numbering
+ * connect <-- local connectivity
+ *----------------------------------------------------------------------------*/
+
+static void
+_interpolate_elt_to_vtx(const cs_syr3_coupling_t *syr_coupling,
+ const cs_real_t *elt_values,
+ fvm_lnum_t n_vertices,
+ cs_real_t *vtx_values,
+ fvm_lnum_t n_elts,
+ int stride,
+ const fvm_lnum_t *parent_num,
+ const fvm_lnum_t *connect)
+{
+ cs_int_t i, j, fac_id, vtx_id;
+ cs_int_t elt_num, elt_num_prev;
+
+ cs_real_t *weighting = syr_coupling->weighting;
+ cs_real_t *down = vtx_values + n_vertices;
+
+ const cs_int_t n_faces = syr_coupling->n_faces;
+
+ /* Initialization of vtx_values and down => 2*n_vertices */
+
+ for (i = 0; i < 2*n_vertices; i++)
+ vtx_values[i] = 0;
+
+ /* Compute contribution from each vertex */
+
+ elt_num_prev = -1;
+ fac_id = -1;
+
+ for (i = 0; i < n_elts; i++) {
+
+ elt_num = parent_num[i];
+
+ if (elt_num != elt_num_prev) {
+ fac_id += 1;
+ elt_num_prev = elt_num;
+ }
+
+ for (j = 0; j < stride; j++) {
+
+ vtx_id = connect[i*stride + j] - 1;
+ vtx_values[vtx_id] += elt_values[fac_id] * weighting[i];
+ down[vtx_id] += weighting[i];
+
+ }
+
+ }
+
+ assert(fac_id+1 == n_faces);
+
+ /* Sum on parallel domain boundaries ;
+ Reminder: we need to have down = vtx_values + n_vtx_values */
+
+ if (syr_coupling->if_set != NULL)
+ cs_parall_interface_sr(syr_coupling->if_set, n_vertices, 2, vtx_values);
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_values[i] /= down[i];
+
+}
+
+/*----------------------------------------------------------------------------
+ * Post process variables associated with SYRTHES couplings
+ *
+ * parameters:
+ * coupling_id <-- Id of SYRTHES coupling
+ * nt_cur_abs <-- Current time step
+ * t_cur_abs <-- Current time value
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_syr3_coupling_post_function(int coupling_id,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs)
+{
+ cs_syr3_coupling_t * syr_coupling = cs_syr3_coupling_by_id(coupling_id);
+
+ if (syr_coupling->post_mesh_id != 0) {
+
+ cs_post_write_vertex_var(syr_coupling->post_mesh_id,
+ _("Wall T"),
+ 1,
+ false,
+ false,
+ CS_POST_TYPE_float,
+ nt_cur_abs,
+ t_cur_abs,
+ syr_coupling->wall_temp);
+
+ cs_post_write_vertex_var(syr_coupling->post_mesh_id,
+ _("Flux"),
+ 1,
+ false,
+ false,
+ CS_POST_TYPE_float,
+ nt_cur_abs,
+ t_cur_abs,
+ syr_coupling->flux);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Dump of SYRTHES coupling structure
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_dump_syr_coupling(cs_syr3_coupling_t *syr_coupling)
+{
+ int i;
+
+ const int comm_echo = syr_coupling->comm_echo;
+
+ assert(syr_coupling != NULL);
+
+ bft_printf("\n"
+ "SYRTHES 3 coupling structure dump\n"
+ "---------------------------------\n\n");
+
+ bft_printf("\nSYRTHES coupling number: %d\n",
+ syr_coupling->syr_num);
+
+ /* Print selection criteria */
+
+ bft_printf("\nFaces selection criteria: \"%s\"\n",
+ syr_coupling->face_sel);
+
+ bft_printf("\nDimension of SYRTHES mesh: %i\n",
+ syr_coupling->dim);
+
+ bft_printf("Number of coupled boundary faces: %i\n\n",
+ syr_coupling->n_faces);
+
+ if (syr_coupling->n_faces > comm_echo) {
+ bft_printf("First and last boundary face numbers:\n");
+ for (i = 0; i < (comm_echo + 1)/2; i++)
+ bft_printf(" %i\n", syr_coupling->face_list[i]);
+ for (i = syr_coupling->n_faces - comm_echo/2;
+ i < syr_coupling->n_faces ; i++)
+ bft_printf(" %i\n", syr_coupling->face_list[i]);
+ }
+ else {
+ bft_printf("Boundary face numbers:\n");
+ for (i = 0; i < syr_coupling->n_faces ; i++)
+ bft_printf(" %i\n", syr_coupling->face_list[i]);
+ }
+
+ /* Print communicator names */
+
+ if (syr_coupling->comm != NULL)
+ bft_printf("Coupling ommunicator: %s\n",
+ cs_syr3_comm_get_name(syr_coupling->comm));
+
+ bft_printf("\nCommunication type: %i\n",
+ syr_coupling->comm_type);
+
+#if defined(HAVE_MPI)
+ bft_printf("(MPI) rank of SYRTHES process: %i\n",
+ syr_coupling->syr_proc_rank);
+#endif
+
+ bft_printf("End of SYRTHES 3 coupling structure dump\n"
+ "-----------------------------------------\n");
+ bft_printf_flush();
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get number of SYRTHES couplings.
+ *
+ * returns:
+ * number of SYRTHES couplings
+ *----------------------------------------------------------------------------*/
+
+int
+cs_syr3_coupling_n_couplings(void)
+{
+ return cs_glob_syr_n_couplings;
+}
+
+/*----------------------------------------------------------------------------
+ * Get pointer to SYRTHES coupling.
+ *
+ * parameters:
+ * coupling_id <-- Id (0 to n-1) of SYRTHES coupling
+ *
+ * returns:
+ * pointer to SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_coupling_t *
+cs_syr3_coupling_by_id(int coupling_id)
+{
+ cs_syr3_coupling_t *retval = NULL;
+
+ if ( coupling_id > -1
+ && coupling_id < cs_glob_syr_n_couplings)
+ retval = cs_glob_syr_coupling_array[coupling_id];
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Get communicator type associated with SYRTHES coupling
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * communicator type
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_type_t
+cs_syr3_coupling_get_comm_type(const cs_syr3_coupling_t *syr_coupling)
+{
+ return syr_coupling->comm_type;
+}
+
+/*----------------------------------------------------------------------------
+ * Get communicator associated with SYRTHES coupling
+ *
+ * parameters:
+ * syr_coupling <-- coupling structure associated with SYRTHES
+ *
+ * returns:
+ * pointer to send communicator
+ *----------------------------------------------------------------------------*/
+
+cs_syr3_comm_t *
+cs_syr3_coupling_get_comm(const cs_syr3_coupling_t *syr_coupling)
+{
+ assert(syr_coupling != NULL);
+
+ return(syr_coupling->comm);
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of vertices in coupled mesh
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * number of vertices in coupled mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_syr3_coupling_get_n_vertices(const cs_syr3_coupling_t *syr_coupling)
+{
+ fvm_lnum_t n_vertices = 0;
+
+ assert(syr_coupling != NULL);
+
+ n_vertices = fvm_nodal_get_n_entities(syr_coupling->coupled_mesh, 0);
+
+ return n_vertices;
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of associated coupled faces in main mesh
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * number of vertices in coupled mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_syr3_coupling_get_n_faces(const cs_syr3_coupling_t *syr_coupling)
+{
+ fvm_lnum_t n_faces = 0;
+
+ assert(syr_coupling != NULL);
+
+ n_faces = syr_coupling->n_faces;
+
+ return n_faces;
+}
+
+/*----------------------------------------------------------------------------
+ * Get local list of coupled faces
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * coupl_face_list --> List of coupled faces (1 to n)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_get_face_list(const cs_syr3_coupling_t *syr_coupling,
+ fvm_lnum_t face_list[])
+{
+ fvm_lnum_t i;
+
+ assert(syr_coupling != NULL);
+
+ for (i = 0; i < syr_coupling->n_faces; i++)
+ face_list[i] = syr_coupling->face_list[i];
+}
+
+/*----------------------------------------------------------------------------
+ * Create a syr3_coupling_t structure.
+ *
+ * parameters:
+ * dim <-- spatial mesh dimension
+ * ref_axis <-- reference axis
+ * face_sel_criterion <-- criterion for selection of boundary faces
+ * syr_num <-- SYRTHES number
+ * syr_proc_rank <-- SYRTHES process rank for MPI
+ * comm_type <-- communicator type
+ * verbosity <-- verbosity level
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_add(int dim,
+ int ref_axis,
+ const char *face_sel_criterion,
+ int syr_num,
+ int syr_proc_rank,
+ cs_syr3_comm_type_t comm_type,
+ int verbosity)
+{
+ cs_syr3_coupling_t *syr_coupling = NULL;
+
+ /* Allocate _cs_syr3_coupling_t structure */
+
+ BFT_REALLOC(cs_glob_syr_coupling_array,
+ cs_glob_syr_n_couplings + 1, cs_syr3_coupling_t*);
+ BFT_MALLOC(syr_coupling, 1, cs_syr3_coupling_t);
+
+ syr_coupling->syr_num = syr_num;
+
+ syr_coupling->dim = dim;
+ syr_coupling->ref_axis = ref_axis;
+
+ syr_coupling->n_faces = 0;
+ syr_coupling->face_list = NULL;
+
+ /* Selection criteria for faces */
+
+ if (face_sel_criterion == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling with SYRTHES impossible.\n"
+ "No selection criteria for faces to couple."));
+
+ BFT_MALLOC(syr_coupling->face_sel, strlen(face_sel_criterion) + 1, char);
+ strcpy(syr_coupling->face_sel, face_sel_criterion);
+
+ /* Mesh and interpolation data */
+
+ syr_coupling->weighting = NULL;
+ syr_coupling->coupled_mesh = NULL;
+ syr_coupling->if_set = NULL;
+
+ /* Post processing */
+
+ syr_coupling->post_mesh_id = 0;
+ syr_coupling->wall_temp = NULL;
+ syr_coupling->flux = NULL;
+
+ /* Communicators */
+
+ syr_coupling->comm_echo = verbosity;
+ syr_coupling->comm_type = comm_type;
+ syr_coupling->comm = NULL;
+
+#if defined(HAVE_MPI)
+ syr_coupling->syr_proc_rank = syr_proc_rank;
+#endif
+
+ cs_glob_syr_coupling_array[cs_glob_syr_n_couplings] = syr_coupling;
+ cs_glob_syr_n_couplings++;
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize communicator for Syrthes coupling
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * syr_id <-- SYRTHRS coupling id
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_init_comm(cs_syr3_coupling_t *syr_coupling,
+ int syr_id)
+{
+ cs_int_t i_coupl;
+
+ /* Initialize communicator */
+
+ syr_coupling->comm
+ = cs_syr3_comm_initialize(syr_id + 1,
+#if defined(HAVE_MPI)
+ syr_coupling->syr_proc_rank,
+#endif
+ syr_coupling->comm_type,
+ syr_coupling->comm_echo);
+
+ if (syr_coupling->comm_echo >= 0) {
+ for (i_coupl = 0 ; i_coupl < cs_glob_syr_n_couplings; i_coupl++)
+ _dump_syr_coupling(cs_glob_syr_coupling_array[i_coupl]);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy cs_syr3_coupling_t structures
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_all_destroy(void)
+{
+ cs_int_t i_coupl;
+ cs_syr3_coupling_t *syr_coupling = NULL;
+
+ if (cs_glob_syr_n_couplings == 0)
+ return;
+
+ for (i_coupl = 0; i_coupl < cs_glob_syr_n_couplings; i_coupl++) {
+
+ syr_coupling = cs_glob_syr_coupling_array[i_coupl];
+
+ /* Sending "End Of File" message */
+
+ cs_syr3_comm_send_message(CS_SYR3_COMM_FIN_FICHIER,
+ 0,
+ CS_TYPE_void,
+ NULL,
+ syr_coupling->comm);
+
+ /* Free _cs_syr3_coupling structure */
+
+ BFT_FREE(syr_coupling->face_list);
+
+ /* Free post processing arrays */
+
+ if (syr_coupling->wall_temp != NULL)
+ BFT_FREE(syr_coupling->wall_temp);
+
+ if (syr_coupling->flux != NULL)
+ BFT_FREE(syr_coupling->flux);
+
+ /* Close communicator */
+
+ syr_coupling->comm = cs_syr3_comm_finalize(syr_coupling->comm);
+
+ BFT_FREE(syr_coupling->face_sel);
+
+ if (syr_coupling->weighting != NULL)
+ BFT_FREE(syr_coupling->weighting);
+
+ if (syr_coupling->coupled_mesh != NULL)
+ syr_coupling->coupled_mesh
+ = fvm_nodal_destroy(syr_coupling->coupled_mesh);
+
+ if (syr_coupling->if_set != NULL)
+ syr_coupling->if_set = fvm_interface_set_destroy(syr_coupling->if_set);
+
+#if defined(HAVE_SOCKET)
+ if (syr_coupling->comm_type == CS_SYR3_COMM_TYPE_SOCKET)
+ cs_syr3_comm_finalize_socket();
+#endif
+
+ BFT_FREE(syr_coupling);
+
+ } /* End of loop on cs_glob_syr_coupling_array */
+
+ cs_glob_syr_n_couplings = 0;
+ BFT_FREE(cs_glob_syr_coupling_array);
+
+ bft_printf(_("\nStructures associated with SYRTHES 3 coupling freed.\n"));
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Define coupled mesh and send it to SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_init_mesh(cs_syr3_coupling_t *syr_coupling)
+{
+ cs_int_t length;
+ cs_int_t dim;
+
+ fvm_gnum_t n_g_vertices = 0;
+ cs_int_t n_vertices = 0;
+ cs_int_t n_elts = 0;
+ cs_int_t n_errors = 0;
+
+ char *coupled_mesh_name = NULL;
+ cs_real_t *coords = NULL;
+ fvm_nodal_t *coupled_mesh = NULL;
+
+ const cs_int_t elt_dim = syr_coupling->dim - 1;
+ const cs_int_t comm_echo = syr_coupling->comm_echo;
+
+ if (comm_echo > 0) {
+ bft_printf(_("\n ** Processing the mesh for SYRTHES coupling "
+ "\"%d\"\n\n"),
+ syr_coupling->syr_num);
+ bft_printf_flush();
+ }
+
+ /* Define coupled mesh name */
+
+ length = strlen("SYRTHES_faces_") + 1 + 1;
+ BFT_MALLOC(coupled_mesh_name, length + 1, char);
+ sprintf(coupled_mesh_name, "SYRTHES_faces_%d", syr_coupling->syr_num);
+
+ /* Define coupled mesh */
+
+ coupled_mesh = _define_coupled_mesh(coupled_mesh_name,
+ syr_coupling);
+
+
+ n_g_vertices = fvm_nodal_get_n_g_vertices(coupled_mesh);
+
+ if (n_g_vertices == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling with SYRTHES impossible.\n"
+ "No face to couple.\n"));
+
+ if (elt_dim == 2) {
+
+ /* Triangulation of coupled faces */
+
+ if (comm_echo >= 0) {
+ bft_printf(_("Triangulation of the extracted mesh (%d faces) ..."),
+ syr_coupling->n_faces);
+ bft_printf_flush();
+ }
+
+ fvm_nodal_triangulate(coupled_mesh, &n_errors);
+
+ }
+ else if (elt_dim == 1) {
+
+ /* Projection of coupled faces to edges */
+
+ if (comm_echo >= 0) {
+ bft_printf(_("Splitting the extracted mesh in edges (%d faces) ..."),
+ syr_coupling->n_faces);
+ bft_printf_flush();
+ }
+
+ fvm_nodal_project(coupled_mesh,
+ syr_coupling->ref_axis,
+ &n_errors);
+
+ }
+ else
+ assert(elt_dim == 2 || elt_dim == 1);
+
+ if (n_errors > 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error triangulating the extracted mesh before "
+ "sending to SYRTHES.\n"));
+
+ if (comm_echo >= 0) {
+ bft_printf(" [ok]\n");
+ bft_printf_flush();
+ }
+
+ syr_coupling->coupled_mesh = coupled_mesh;
+
+ /* Get number of coupled vertices */
+
+ n_vertices = (cs_int_t)fvm_nodal_get_n_entities(coupled_mesh, 0);
+
+ if (syr_coupling->n_faces > 0) {
+
+ /* Renumbering of selected border faces in order to be consistent with
+ parent_num from triangulation. */
+
+ _renum_faces_list(syr_coupling);
+
+ } /* If n_faces > 0 */
+
+ if (cs_glob_n_ranks > 1) {
+
+ fvm_gnum_t *global_vertex_num = NULL;
+
+ BFT_MALLOC(global_vertex_num, n_vertices, fvm_gnum_t);
+
+ fvm_nodal_get_global_vertex_num(coupled_mesh, global_vertex_num);
+
+ /* Define interface between vertices on parallel boundaries */
+
+ syr_coupling->if_set = fvm_interface_set_create(n_vertices,
+ NULL,
+ global_vertex_num,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ NULL);
+
+ BFT_FREE(global_vertex_num);
+
+ }
+
+ /* Communication with SYRTHES */
+ /*----------------------------*/
+
+ /* Spatial dimension */
+
+ if (cs_glob_rank_id < 1)
+ cs_syr3_comm_send_message("coupl:b:ndim_",
+ 1,
+ CS_TYPE_cs_int_t,
+ &(syr_coupling->dim),
+ syr_coupling->comm);
+
+ /* Vertices information */
+
+ dim = (cs_int_t)fvm_nodal_get_dim(coupled_mesh);
+
+ BFT_MALLOC(coords, n_vertices * dim, cs_real_t);
+
+ _send_coords(syr_coupling,
+ n_vertices,
+ coords);
+
+ /* Element information */
+
+ assert(elt_dim == fvm_nodal_get_max_entity_dim(coupled_mesh));
+ n_elts = fvm_nodal_get_n_entities(coupled_mesh, elt_dim);
+
+ _send_connectivity(syr_coupling,
+ n_elts);
+
+ if (syr_coupling->n_faces > 0) {
+
+ /*
+ Compute weighting in order to interpolate element-centered values
+ to vertex values (area for triangles and lengths for edges).
+ */
+
+ BFT_MALLOC(syr_coupling->weighting, n_elts, cs_real_t);
+
+ _compute_weighting(syr_coupling,
+ coords,
+ n_elts);
+
+ } /* n_faces > 0 */
+
+ if (comm_echo >= 0) {
+
+ if (elt_dim == 2)
+ bft_printf(_("\nExtracted mesh built of %d triangles"),n_elts);
+ else if (elt_dim == 1)
+ bft_printf(_("\nExtracted mesh built of %d edges"),n_elts);
+ else
+ assert(elt_dim == 2 || elt_dim == 1);
+
+ bft_printf(_(" and %d vertices (locally)\n"),n_vertices);
+ bft_printf_flush();
+
+ }
+
+ /* Ready to start time iterations */
+
+ if (cs_glob_rank_id < 1)
+ cs_syr3_comm_send_message("coupl:b:start",
+ 0,
+ CS_TYPE_void,
+ NULL,
+ syr_coupling->comm);
+
+ /* Free memory */
+
+ BFT_FREE(coupled_mesh_name);
+
+ if (coords != NULL)
+ BFT_FREE(coords);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Interpolate a vertex field to an element-centered field
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * vtx_values <-- values defined on vertices
+ * elt_values <-> values defined on elements
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_vtx_to_elt(const cs_syr3_coupling_t *syr_coupling,
+ const cs_real_t *vtx_values,
+ cs_real_t *elt_values)
+{
+ cs_int_t n_elts, stride;
+
+ cs_int_t *parent_num = NULL;
+ cs_int_t *connect = NULL;
+
+ const cs_int_t comm_echo = syr_coupling->comm_echo;
+ const cs_int_t elt_dim = syr_coupling->dim - 1;
+ const fvm_nodal_t *coupled_mesh = syr_coupling->coupled_mesh;
+
+ n_elts = fvm_nodal_get_n_entities(coupled_mesh, elt_dim);
+
+ if (n_elts == 0) return;
+
+ /* Get parent element numbering */
+
+ BFT_MALLOC(parent_num, n_elts, cs_int_t);
+ fvm_nodal_get_parent_num(coupled_mesh, elt_dim, parent_num);
+
+ /* Sanity test */
+ assert(sizeof(fvm_lnum_t) == sizeof(cs_int_t));
+
+ /* Get local connectivity */
+
+ if (elt_dim == 2) { /* If elements are triangles */
+
+ stride = 3;
+ BFT_MALLOC(connect, stride * n_elts, cs_int_t);
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_FACE_TRIA,
+ connect);
+
+ }
+ else if (elt_dim == 1) { /* If elements are edges */
+
+ stride = 2;
+ BFT_MALLOC(connect, stride * n_elts, cs_int_t);
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_EDGE,
+ connect);
+
+ }
+
+ if (comm_echo >= 0) {
+ bft_printf(_("\tInterpolation from vertices to elements ..."));
+ bft_printf_flush();
+ }
+
+ _interpolate_vtx_to_elt(syr_coupling,
+ elt_values,
+ vtx_values,
+ n_elts,
+ stride,
+ parent_num,
+ connect);
+
+ if (comm_echo >= 0) {
+ bft_printf(" [ok]\n");
+ bft_printf_flush();
+ }
+
+ /* Free memory */
+
+ BFT_FREE(connect);
+ BFT_FREE(parent_num);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Interpolate an element-centered field to a vertex field.
+ *
+ * The size of vtx_values array must be twice the number of vertices.
+ * The first half gets values and the second half is used as a working array.
+ * The two parts must be contiguous in parallel mode for MPI transfers.
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * elt_values <-> array of values defined on elements
+ * n_vtx_values <-- number of values defined on vertices
+ * vtx_values <-> array of values defined on vertices
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_elt_to_vtx(const cs_syr3_coupling_t *syr_coupling,
+ const cs_real_t *elt_values,
+ fvm_lnum_t n_vertices,
+ cs_real_t *vtx_values)
+{
+ cs_int_t n_elts, stride;
+
+ cs_int_t *parent_num = NULL;
+ cs_int_t *connect = NULL;
+
+ const cs_int_t elt_dim = syr_coupling->dim - 1;
+ const int comm_echo = syr_coupling->comm_echo;
+ const fvm_nodal_t *coupled_mesh = syr_coupling->coupled_mesh;
+
+ /* Get number of elements */
+
+ n_elts = fvm_nodal_get_n_entities(coupled_mesh, elt_dim);
+
+ if (n_elts == 0) return;
+
+ /* Get parent element numbering */
+
+ BFT_MALLOC(parent_num, n_elts, cs_int_t);
+ fvm_nodal_get_parent_num(coupled_mesh, elt_dim, parent_num);
+
+ /* Sanity test */
+ assert(sizeof(fvm_lnum_t) == sizeof(cs_int_t));
+
+ /* Get connectivity */
+
+ if (elt_dim == 2) { /* If elements are triangles */
+
+ stride = 3;
+ BFT_MALLOC(connect, stride * n_elts, cs_int_t);
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_FACE_TRIA,
+ connect);
+
+ }
+ else if (elt_dim == 1) { /* If elements are edges */
+
+ stride = 2;
+ BFT_MALLOC(connect, stride * n_elts, cs_int_t);
+ fvm_nodal_get_strided_connect(coupled_mesh,
+ FVM_EDGE,
+ connect);
+
+ }
+
+ if (comm_echo >= 0) {
+ bft_printf(_("\tInterpolation from elements to vertices ..."));
+ bft_printf_flush();
+ }
+
+ _interpolate_elt_to_vtx(syr_coupling,
+ elt_values,
+ n_vertices,
+ vtx_values,
+ n_elts,
+ stride,
+ parent_num,
+ connect);
+
+ if (comm_echo >= 0) {
+ bft_printf(" [ok]\n");
+ bft_printf_flush();
+ }
+
+ /* Free memory */
+
+ BFT_FREE(connect);
+ BFT_FREE(parent_num);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing of a Syrthes coupling
+ *
+ * parameters:
+ * coupling_id <-- Id of SYRTHES coupling
+ * writer_id <-- Id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_post_init(int coupling_id,
+ cs_int_t writer_id)
+{
+ int dim_shift = 0;
+ cs_int_t n_vertices = 0;
+ cs_int_t mesh_id = cs_post_get_free_mesh_id();
+
+ cs_syr3_coupling_t *syr_coupling = cs_syr3_coupling_by_id(coupling_id);
+
+ assert(syr_coupling != NULL);
+
+ /* Exit silently if associated writer is not available */
+
+ if (cs_post_writer_exists(writer_id) != true)
+ return;
+
+ /* Initialize post processing flag, and free previous arrays in
+ case this function is called more than once */
+
+ syr_coupling->post_mesh_id = mesh_id;
+
+ if (syr_coupling->wall_temp != NULL)
+ BFT_FREE(syr_coupling->wall_temp);
+
+ if (syr_coupling->flux != NULL)
+ BFT_FREE(syr_coupling->flux);
+
+ /* Get number of coupled vertices */
+
+ n_vertices = fvm_nodal_get_n_entities(syr_coupling->coupled_mesh, 0);
+
+ /* Allocate arrays */
+
+ if (n_vertices > 0) {
+ BFT_MALLOC(syr_coupling->wall_temp, n_vertices, float);
+ BFT_MALLOC(syr_coupling->flux, n_vertices, float);
+ }
+ syr_coupling->tfluid_tmp = NULL;
+
+ /* Associate external mesh description with post processing subsystem */
+
+ if (syr_coupling->dim == 2)
+ dim_shift = 1;
+
+ cs_post_add_existing_mesh(mesh_id,
+ syr_coupling->coupled_mesh,
+ dim_shift,
+ false);
+
+ cs_post_associate(mesh_id, writer_id);
+
+ /* Register post processing function */
+
+ cs_post_add_time_dep_var(_cs_syr3_coupling_post_function,
+ coupling_id);
+
+ /* Update start and end (negative) numbers associated with
+ dedicated post processing meshes */
+
+ if (cs_glob_syr_post_maillage_ext[0] == 0)
+ cs_glob_syr_post_maillage_ext[0] = mesh_id;
+
+ cs_glob_syr_post_maillage_ext[1] = mesh_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Update post-processing variables of a SYRTHES coupling
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * step <-- 0: var = wall temperature
+ * 1: var = fluid temperature
+ * 2: var = exchange coefficient
+ * var <-- Pointer to variable values
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_coupling_post_var_update(cs_syr3_coupling_t *syr_coupling,
+ int step,
+ const cs_real_t *var)
+{
+ cs_int_t ii;
+ cs_int_t n_vertices = 0;
+
+ assert(syr_coupling != NULL);
+
+ if (syr_coupling->post_mesh_id == 0)
+ return;
+
+ assert(syr_coupling->wall_temp != NULL);
+ assert(syr_coupling->flux != NULL);
+
+ /* Get number of coupled vertices */
+
+ n_vertices = fvm_nodal_get_n_entities(syr_coupling->coupled_mesh, 0);
+
+ /* Allocate arrays */
+
+ switch(step) {
+
+ case 0:
+ for (ii = 0; ii < n_vertices; ii++)
+ syr_coupling->wall_temp[ii] = var[ii];
+ break;
+
+ case 1:
+ syr_coupling->tfluid_tmp = syr_coupling->flux;
+ for (ii = 0; ii < n_vertices; ii++)
+ syr_coupling->tfluid_tmp[ii] = var[ii];
+ break;
+
+ case 2:
+ assert(syr_coupling->tfluid_tmp == syr_coupling->flux);
+ for (ii = 0; ii < n_vertices; ii++)
+ syr_coupling->flux[ii] = var[ii] * ( syr_coupling->wall_temp[ii]
+ - syr_coupling->flux[ii]);
+ syr_coupling->tfluid_tmp = NULL;
+ break;
+
+ default:
+ assert(0);
+ }
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+/* Delete local macros */
+
+#undef _CROSS_PRODUCT_3D
+#undef _MODULE_3D
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_syr3_messages.c b/src/base/cs_syr3_messages.c
new file mode 100644
index 0000000..ca7b4be
--- /dev/null
+++ b/src/base/cs_syr3_messages.c
@@ -0,0 +1,418 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Manage messages for SYRTHES coupling: sending, receiving and interpolation
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_nodal.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_syr3_comm.h"
+#include "cs_syr3_coupling.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_syr3_messages.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check if SYRTHES coupling continues or if we must finalize communications.
+ *
+ * parameters:
+ * nt_cur_abs <-- current iteration number
+ * nt_max_abs <-> maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_test_iter(int nt_cur_abs,
+ int *nt_max_abs)
+{
+ cs_int_t ii, i_coupl;
+ cs_syr3_comm_msg_header_t header;
+ char section_name[32 + 1];
+
+ cs_int_t n_coupl = cs_syr3_coupling_n_couplings();
+ cs_syr3_coupling_t *syr_coupling = NULL;
+ cs_syr3_comm_t *comm = NULL;
+
+ if (n_coupl > 0) {
+
+ section_name[32] = '\0';
+
+ for (i_coupl = 0; i_coupl < n_coupl; i_coupl++) {
+
+ syr_coupling = cs_syr3_coupling_by_id(i_coupl);
+ comm = cs_syr3_coupling_get_comm(syr_coupling);
+
+ if (cs_glob_rank_id < 1) {
+
+ cs_syr3_comm_receive_header(&header, comm);
+ assert(header.n_elts == 0);
+
+ for (ii = 0 ; ii < 32 ; ii++)
+ section_name[ii] = header.sec_name[ii];
+ }
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Bcast(section_name, 32, MPI_CHAR, 0, cs_glob_mpi_comm);
+#endif
+
+ /* Treatment according to the received header */
+
+ if ( (!strncmp("cmd:stop", section_name,
+ strlen("cmd:stop")))
+ || (!strncmp(CS_SYR3_COMM_FIN_FICHIER, section_name,
+ strlen(CS_SYR3_COMM_FIN_FICHIER)))) {
+
+ if (*nt_max_abs != nt_cur_abs) {
+
+ *nt_max_abs = nt_cur_abs;
+
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf
+ (_("========================================================\n"
+ " ** Stop on SYRTHES request\n"
+ " -----------------------\n"
+ " received message: \"%s\"\n"
+ "========================================================\n"),
+ section_name);
+
+ }
+
+ }
+ else if (strncmp("cmd:iter:start", section_name,
+ strlen("cmd:iter:start"))) {
+
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _("========================================================\n"
+ " ** Unexpected message in cs_syr3_messages_test_iter\n"
+ " ------------------------------------------------\n"
+ " received message: \"%s\"\n"
+ " expected message: cmd:iter:start \n"
+ "========================================================\n"),
+ section_name);
+ }
+
+ } /* End of loop on SYRTHES couplings */
+
+ } /* If there is at least one SYRTHES coupling */
+
+ else
+ return;
+}
+
+/*----------------------------------------------------------------------------
+ * Synchronize new time step
+ *
+ * parameters:
+ * nt_cur_abs <-- current iteration number
+ * nt_max_abs --> maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_new_time_step(int nt_cur_abs,
+ int nt_max_abs)
+{
+ cs_int_t i_coupl;
+
+ cs_int_t n_coupl = cs_syr3_coupling_n_couplings();
+ cs_syr3_comm_t *comm = NULL;
+
+ /* If there is at least one SYRTHES coupling */
+
+ if (n_coupl > 0 && cs_glob_rank_id < 1) {
+
+ /*
+ Code_Saturne tells SYRTHES when we are ready to begin a new
+ time step, also specifying if it is the last time step.
+ */
+
+ for (i_coupl = 0; i_coupl < n_coupl; i_coupl++) {
+
+ cs_syr3_coupling_t *coupl = cs_syr3_coupling_by_id(i_coupl);
+
+ comm = cs_syr3_coupling_get_comm(coupl);
+
+ if (nt_cur_abs == nt_max_abs)
+ cs_syr3_comm_send_message("cmd:iter:start:last",
+ 0,
+ CS_TYPE_char,
+ NULL,
+ comm);
+
+ else if (nt_cur_abs < nt_max_abs)
+ cs_syr3_comm_send_message("cmd:iter:start",
+ 0,
+ CS_TYPE_char,
+ NULL,
+ comm);
+
+ else { /* We should not go through this path */
+ cs_syr3_comm_send_message("cmd:stop",
+ 0,
+ CS_TYPE_char,
+ NULL,
+ comm);
+ assert(nt_cur_abs <= nt_max_abs);
+ }
+
+ }
+
+ } /* n_coupl > 0 */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Receive coupling variables from SYRTHES
+ *
+ * parameters:
+ * syr_num <-- SYRTHES 3 coupling number
+ * twall --> wall temperature
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_recv_twall(cs_int_t syr_num,
+ cs_real_t twall[])
+{
+ size_t ii;
+ cs_syr3_comm_msg_header_t header;
+
+ char section_name[CS_SYR3_COMM_H_LEN + 1];
+
+ cs_real_t *syr_data = NULL;
+
+ cs_int_t n_vertices = 0;
+ cs_int_t n_coupl = cs_syr3_coupling_n_couplings();
+ cs_syr3_coupling_t *syr_coupling = NULL;
+ cs_syr3_comm_t *comm = NULL;
+
+ if (syr_num < 1 || syr_num > n_coupl)
+ bft_error(__FILE__, __LINE__, 0,
+ _("SYRTHES coupling number %d impossible; "
+ "there are %d couplings"),
+ syr_num, n_coupl);
+ else {
+
+ syr_coupling = cs_syr3_coupling_by_id(syr_num - 1);
+ comm = cs_syr3_coupling_get_comm(syr_coupling);
+
+ n_vertices = cs_syr3_coupling_get_n_vertices(syr_coupling);
+
+ }
+
+ if (n_vertices == 0)
+ return;
+
+ /* Expected section name definition */
+
+ sprintf(section_name, "coupl:b:tparoi");
+
+ for (ii = strlen(section_name); ii < CS_SYR3_COMM_H_LEN; ii++)
+ section_name[ii] = ' ';
+ section_name[CS_SYR3_COMM_H_LEN] = '\0';
+
+ /* Receive header and check consistency */
+
+ cs_syr3_comm_receive_header(&header, comm);
+
+ if ( strncmp(header.sec_name, section_name, CS_SYR3_COMM_H_LEN) != 0
+ || (header.n_elts > 0 && header.elt_type != CS_TYPE_cs_real_t)
+ || header.n_elts != n_vertices)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Unexpected message in the SYRTHES coupling %d:\n"
+ " expected \"%s\" (%d elements, type %d)\n"
+ " received \"%s\" (%d elements, type %d)\n"),
+ syr_num, section_name, n_vertices, (int)CS_TYPE_cs_real_t,
+ header.sec_name, header.n_elts, (int)(header.elt_type));
+
+ /* Receive data */
+
+ BFT_MALLOC(syr_data, header.n_elts, cs_real_t);
+
+ cs_syr3_comm_receive_body(&header,
+ syr_data,
+ comm);
+
+ /* Transfer received fields from vertices to faces */
+
+ cs_syr3_coupling_post_var_update(syr_coupling, 0, syr_data);
+
+ cs_syr3_coupling_vtx_to_elt(syr_coupling,
+ syr_data,
+ twall);
+
+ if (syr_data != NULL)
+ BFT_FREE(syr_data);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Send coupling variables to SYRTHES
+ *
+ * parameters:
+ * syr_num <-- SYRTHES 3 coupling number
+ * tfluid <-- wall exchange coefficient
+ * hwall <-- wall exchange coefficient
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr3_messages_send_tf_hwall(cs_int_t syr_num,
+ cs_real_t tfluid[],
+ cs_real_t hwall[])
+{
+ size_t ii, var_id;
+ char section_name[CS_SYR3_COMM_H_LEN + 1];
+
+ cs_int_t n_coupl = cs_syr3_coupling_n_couplings();
+ cs_int_t n_syr_values = 0;
+ cs_real_t *src_data = NULL, *syr_data = NULL;
+ cs_syr3_coupling_t *syr_coupling = NULL;
+ cs_syr3_comm_t *comm = NULL;
+
+ if (syr_num < 1 || syr_num > n_coupl)
+ bft_error(__FILE__, __LINE__, 0,
+ _("SYRTHES coupling number %d impossible; "
+ "there are %d couplings"),
+ syr_num, n_coupl);
+ else {
+
+ syr_coupling = cs_syr3_coupling_by_id(syr_num - 1);
+ comm = cs_syr3_coupling_get_comm(syr_coupling);
+
+ n_syr_values = cs_syr3_coupling_get_n_vertices(syr_coupling);
+
+ }
+
+ if (n_syr_values == 0)
+ return;
+
+ /* loop on fluid temperature then exchange coefficient */
+
+ for (var_id = 0; var_id < 2; var_id++) {
+
+ if (var_id == 0) {
+ sprintf(section_name, "coupl:b:tfluid");
+ src_data = tfluid;
+ }
+ else { /* if (var_id == 1) */
+ sprintf(section_name, "coupl:b:hparoi");
+ src_data = hwall;
+ }
+
+ for (ii = strlen(section_name); ii < CS_SYR3_COMM_H_LEN; ii++)
+ section_name[ii] = ' ';
+ section_name[CS_SYR3_COMM_H_LEN] = '\0';
+
+ /* Transfer Code_Saturne fields to vertices */
+
+ BFT_MALLOC(syr_data, n_syr_values * 2, cs_real_t);
+
+ cs_syr3_coupling_elt_to_vtx(syr_coupling,
+ src_data,
+ n_syr_values,
+ syr_data);
+
+ cs_syr3_coupling_post_var_update(syr_coupling, 1 + var_id, syr_data);
+
+ /* Send data to SYRTHES */
+
+ cs_syr3_comm_send_message(section_name,
+ n_syr_values,
+ CS_TYPE_cs_real_t,
+ syr_data,
+ comm);
+
+ BFT_FREE(syr_data);
+
+ } /* End of loop on var_id (fluid temperature then exchange coefficient) */
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_syr4_coupling.c b/src/base/cs_syr4_coupling.c
new file mode 100644
index 0000000..2b9699b
--- /dev/null
+++ b/src/base/cs_syr4_coupling.c
@@ -0,0 +1,1242 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Syrthes 4 coupling
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_coupling.h>
+#include <fvm_nodal.h>
+#include <fvm_interface.h>
+#include <fvm_nodal_extract.h>
+#include <fvm_nodal_project.h>
+#include <fvm_locator.h>
+#include <fvm_parall.h>
+#include <fvm_selector.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_mesh.h"
+#include "cs_mesh_connect.h"
+#include "cs_selector.h"
+#include "cs_parall.h"
+#include "cs_post.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_syr4_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+const int cs_syr4_coupling_tag = 'C'+'S'+'_'+'C'+'O'+'U'+'P'+'L'+'A'+'G'+'E';
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/* Structure associated with Syrthes coupling */
+
+typedef struct _cs_syr4_coupling_ent_t {
+
+ /* Mesh-related members */
+
+ fvm_locator_t *locator; /* Associated locator */
+
+ int elt_dim; /* Element dimension */
+ fvm_lnum_t n_elts; /* Number of coupled elements */
+
+ fvm_nodal_t *elts; /* Coupled elements */
+
+ /* Saved arrays for post processing (float for reduced memory use) */
+
+ int post_mesh_id; /* 0 if post-processing is not active,
+ or post-processing mesh_id (< 0) */
+ float *wall_temp; /* Wall temperature (received) */
+ float *flux; /* Flux (calculated) */
+ float *tfluid_tmp; /* Fluid temperature (points to flux in
+ transient stage where wall_temp and
+ fluid_temp are known, NULL once
+ flux is calculated) */
+} cs_syr4_coupling_ent_t;
+
+/* Structure associated with Syrthes coupling */
+
+struct _cs_syr4_coupling_t {
+
+ /* Mesh-related members */
+
+ int dim; /* Coupled mesh dimension */
+ int ref_axis; /* Selected axis for edge extraction */
+
+ int syr_num; /* Application number, or -1 */
+ char *syr_name; /* Application name, or -1 */
+
+ char *face_sel; /* Face selection criteria */
+ char *cell_sel; /* Face selection criteria */
+
+ cs_syr4_coupling_ent_t *faces; /* Wall coupling structure */
+ cs_syr4_coupling_ent_t *cells; /* Volume coupling structure */
+
+ int verbosity; /* Verbosity level */
+
+ /* Communication-related members */
+
+#if defined(HAVE_MPI)
+
+ MPI_Comm comm; /* Associated MPI communicator */
+
+ int n_syr_ranks; /* Number of associated SYRTHES ranks */
+ int syr_root_rank; /* First associated SYRTHES rank */
+
+#endif
+
+};
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+static int cs_glob_syr4_n_couplings = 0;
+static cs_syr4_coupling_t **cs_glob_syr4_couplings = NULL;
+
+/* Start and end (negative) numbers associated with
+ dedicated post processing meshes */
+
+static int cs_glob_syr4_post_mesh_ext[2] = {0, 1};
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Initialize communicator for Syrthes coupling
+ *
+ * parameters:
+ * syr_coupling <-> Syrthes coupling structure
+ * coupling_id <-- id of this coupling (for log file message)
+ *----------------------------------------------------------------------------*/
+
+static void
+_init_comm(cs_syr4_coupling_t *syr_coupling,
+ int coupling_id)
+
+{
+#if defined(HAVE_MPI)
+
+ int mpi_flag = 0;
+ int local_range[2] = {-1, -1};
+ int distant_range[2] = {-1, -1};
+
+ MPI_Initialized(&mpi_flag);
+
+ if (mpi_flag == 0)
+ return;
+
+ bft_printf(_(" SYRTHES coupling %d: initializing MPI communication ... "),
+ coupling_id);
+ bft_printf_flush();
+
+ fvm_coupling_mpi_intracomm_create(cs_glob_mpi_comm,
+ syr_coupling->syr_root_rank,
+ &(syr_coupling->comm),
+ local_range,
+ distant_range);
+
+ bft_printf(_("[ok]\n"));
+ bft_printf(_(" Local ranks = [%d..%d], distant ranks = [%d..%d].\n\n"),
+ local_range[0], local_range[1] - 1,
+ distant_range[0], distant_range[1] - 1);
+ bft_printf_flush();
+
+ syr_coupling->n_syr_ranks = distant_range[1] - distant_range[0];
+ syr_coupling->syr_root_rank = distant_range[0];
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Free communicator for Syrthes coupling
+ *
+ * parameters:
+ * syr_coupling <-> Syrthes coupling structure
+ *----------------------------------------------------------------------------*/
+
+static void
+_finalize_comm(cs_syr4_coupling_t *syr_coupling)
+{
+#if defined(HAVE_MPI)
+
+ if (syr_coupling == NULL)
+ return;
+
+ if (syr_coupling->comm != MPI_COMM_NULL) {
+ MPI_Comm_free(&(syr_coupling->comm));
+ syr_coupling->comm = MPI_COMM_NULL;
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange synchronization messages between Code_Saturne and SYRTHES.
+ *
+ * parameters:
+ * syr_coupling <-- Syrthes coupling structure
+ * op_name_send <-- operation name to send, or NULL. Only the 32
+ * first characters are sent if the nae is longer.
+ * op_name_recv <-- operation name to receive, or NULL (size: 33)
+ *----------------------------------------------------------------------------*/
+
+static void
+_exchange_sync(cs_syr4_coupling_t *syr_coupling,
+ const char *op_name_send,
+ char *op_name_recv)
+{
+#if defined(HAVE_MPI)
+
+ if (cs_glob_rank_id < 1) {
+
+ MPI_Status status;
+
+ if (op_name_send != NULL) {
+
+ char _op_name_send[33];
+ strncpy(_op_name_send, op_name_send, 32);
+ _op_name_send[32] = '\0';
+
+
+ /* Exchange command messages */
+ if (op_name_recv != NULL) {
+ MPI_Sendrecv(_op_name_send, 32, MPI_CHAR,
+ syr_coupling->syr_root_rank, cs_syr4_coupling_tag,
+ op_name_recv, 32, MPI_CHAR,
+ syr_coupling->syr_root_rank, cs_syr4_coupling_tag,
+ syr_coupling->comm, &status);
+ }
+
+ else
+ MPI_Send(_op_name_send, 32, MPI_CHAR,
+ syr_coupling->syr_root_rank, cs_syr4_coupling_tag,
+ syr_coupling->comm);
+
+ }
+ else if (op_name_recv != NULL) {
+ MPI_Recv(op_name_recv, 32, MPI_CHAR,
+ syr_coupling->syr_root_rank, cs_syr4_coupling_tag,
+ syr_coupling->comm, &status);
+ }
+
+ }
+
+ if (op_name_recv != NULL && cs_glob_rank_id > -1) {
+ MPI_Bcast(op_name_recv, 32, MPI_CHAR, 0, cs_glob_mpi_comm);
+ op_name_recv[32] = '\0';
+ }
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Define nodal mesh for Syrthes coupling from selection criteria.
+ *
+ * parameters:
+ * syr_coupling <-- partially initialized SYRTHES coupling structure
+ * select_criteria <-- selection criteria
+ * coupling_number <-- number of the corresponding SYRTHES coupling
+ * elt_dim <-- element dimension
+ *
+ * returns:
+ * pointer to created Syrthes coupling entity helper structure
+ *----------------------------------------------------------------------------*/
+
+static cs_syr4_coupling_ent_t *
+_create_coupled_ent(cs_syr4_coupling_t *syr_coupling,
+ const char *select_criteria,
+ int coupling_number,
+ int elt_dim)
+{
+ char coupled_mesh_name[64];
+ fvm_gnum_t n_exterior = 0;
+ fvm_lnum_t *elt_list = NULL;
+ fvm_coord_t *elt_centers = NULL;
+ const double tolerance = 0.1;
+ fvm_nodal_t *location_elts = NULL;
+
+ cs_syr4_coupling_ent_t *coupling_ent = NULL;
+
+ assert(syr_coupling != NULL);
+ assert(coupling_number > 0);
+
+ /* Initialization */
+
+ BFT_MALLOC(coupling_ent, 1, cs_syr4_coupling_ent_t);
+
+ coupling_ent->locator = NULL;
+ coupling_ent->elt_dim = elt_dim;
+
+ coupling_ent->n_elts = 0;
+ coupling_ent->elts = NULL;
+
+ coupling_ent->post_mesh_id = 0;
+ coupling_ent->wall_temp = NULL;
+ coupling_ent->flux = NULL;
+ coupling_ent->tfluid_tmp = NULL;
+
+ if (syr_coupling->verbosity > 0) {
+ bft_printf(_("\nExtracting coupled mesh ..."));
+ bft_printf_flush();
+ }
+
+ /* Creation of a new nodal mesh from selected cells */
+
+ if (elt_dim == syr_coupling->dim) {
+
+ sprintf(coupled_mesh_name, _("SYRTHES_cells_%d"), coupling_number);
+
+ BFT_MALLOC(elt_list, cs_glob_mesh->n_cells, fvm_lnum_t);
+
+ cs_selector_get_cell_list(select_criteria,
+ &(coupling_ent->n_elts),
+ elt_list);
+
+ coupling_ent->elts
+ = cs_mesh_connect_cells_to_nodal(cs_glob_mesh,
+ coupled_mesh_name,
+ coupling_ent->n_elts,
+ elt_list);
+
+ BFT_FREE(elt_list);
+ }
+
+ /* Creation of a new nodal mesh from selected border faces */
+
+ else if (elt_dim == syr_coupling->dim - 1) {
+
+ sprintf(coupled_mesh_name, _("SYRTHES_faces_%d"), coupling_number);
+
+ BFT_MALLOC(elt_list, cs_glob_mesh->n_b_faces, fvm_lnum_t);
+
+ cs_selector_get_b_face_list(select_criteria,
+ &(coupling_ent->n_elts),
+ elt_list);
+
+ coupling_ent->elts
+ = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
+ coupled_mesh_name,
+ 0,
+ coupling_ent->n_elts,
+ NULL,
+ elt_list);
+
+ BFT_FREE(elt_list);
+
+ }
+
+ if (syr_coupling->verbosity > 0) {
+ bft_printf(" [ok]\n");
+ bft_printf_flush();
+ }
+
+ if (fvm_nodal_get_n_g_vertices(coupling_ent->elts) == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Selection criteria:\n"
+ " \"%s\"\n"
+ " leads to an empty mesh for SYRTHES coupling.\n"),
+ select_criteria);
+
+ /* In case of 2D coupling, project coupled elements to 2D */
+
+ location_elts = coupling_ent->elts;
+
+ if (syr_coupling->dim == 2) {
+
+ double a[6];
+ fvm_lnum_t n_errors = 0;
+
+ if (syr_coupling->verbosity > 0) {
+ bft_printf(_("Projecting the extracted mesh to 2D ..."));
+ bft_printf_flush();
+ }
+
+ fvm_nodal_project(coupling_ent->elts, syr_coupling->ref_axis, &n_errors);
+
+ if (n_errors > 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Error projecting the extracted mesh."));
+
+ if (syr_coupling->verbosity > 0) {
+ bft_printf(" [ok]\n");
+ bft_printf_flush();
+ }
+
+ location_elts = fvm_nodal_copy(coupling_ent->elts);
+
+ if (syr_coupling->ref_axis == 0) {
+ a[0] = 0.; a[1] = 1.; a[2] = 0.; a[3] = 0.; a[4] = 0.; a[5] = 1.;
+ }
+ else if (syr_coupling->ref_axis == 1) {
+ a[0] = 1.; a[1] = 0.; a[2] = 0.; a[3] = 0.; a[4] = 0.; a[5] = 1.;
+ }
+ else if (syr_coupling->ref_axis == 2) {
+ a[0] = 1.; a[1] = 0.; a[2] = 0.; a[3] = 0.; a[4] = 1.; a[5] = 0.;
+ }
+
+ fvm_nodal_project_coords(location_elts, a);
+ }
+
+ /* Element information */
+
+ if (syr_coupling->verbosity > 0) {
+ fvm_gnum_t n_g_elts = coupling_ent->n_elts;
+ fvm_parall_counter(&n_g_elts, 1);
+ bft_printf(_("\nExtracted mesh built of %lu elements.\n"),
+ (unsigned long)n_g_elts);
+ }
+
+ /* Build and initialize associated locator */
+
+#if defined(FVM_HAVE_MPI)
+ coupling_ent->locator = fvm_locator_create(tolerance,
+ syr_coupling->comm,
+ syr_coupling->n_syr_ranks,
+ syr_coupling->syr_root_rank);
+#else
+ coupling_ent->locator = fvm_locator_create(tolerance);
+#endif
+
+ /* Retrieve coordinates using FVM functions rather than previous list and
+ coordinates, in case the extracted nodal mesh contains elements in a
+ different order (multiple element types) or coordinates are projected
+ in 2D. */
+
+ if (coupling_ent->n_elts > 0) {
+ BFT_MALLOC(elt_centers,
+ coupling_ent->n_elts*syr_coupling->dim,
+ fvm_coord_t);
+ fvm_nodal_get_element_centers(location_elts,
+ FVM_INTERLACE,
+ coupling_ent->elt_dim,
+ elt_centers);
+ }
+
+ /* Locate entities */
+
+ fvm_locator_set_nodal(coupling_ent->locator,
+ location_elts,
+ 0, /* do not locate on parents */
+ syr_coupling->dim,
+ coupling_ent->n_elts,
+ elt_list,
+ elt_centers);
+
+ if (elt_centers != NULL)
+ BFT_FREE(elt_centers);
+
+ /* Check that all points are effectively located */
+
+ n_exterior = fvm_locator_get_n_exterior(coupling_ent->locator);
+
+ fvm_parall_counter(&n_exterior, 1);
+
+ if (n_exterior)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling with SYRTHES impossible:\n"
+ "%lu element centers from mesh \"%s\"\n"
+ "not located on SYRTHES mesh."),
+ (unsigned long)n_exterior, coupled_mesh_name);
+
+ if (location_elts != coupling_ent->elts)
+ fvm_nodal_destroy(location_elts);
+
+ return coupling_ent;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy coupled entity helper structure.
+ *
+ * parameters:
+ * coupling ent <-> pointer to structure pointer
+ *----------------------------------------------------------------------------*/
+
+static void
+_destroy_coupled_ent(cs_syr4_coupling_ent_t **coupling_ent)
+{
+ cs_syr4_coupling_ent_t *ce = *coupling_ent;
+
+ if (ce == NULL)
+ return;
+
+ if (ce->locator != NULL)
+ ce->locator = fvm_locator_destroy(ce->locator);
+
+ if (ce->wall_temp != NULL)
+ BFT_FREE(ce->wall_temp);
+ if (ce->flux != NULL)
+ BFT_FREE(ce->flux);
+ if (ce->tfluid_tmp != NULL)
+ BFT_FREE(ce->tfluid_tmp);
+
+ if (ce->elts != NULL)
+ ce->elts = fvm_nodal_destroy(ce->elts);
+
+ BFT_FREE(*coupling_ent);
+}
+
+/*----------------------------------------------------------------------------
+ * Update post-processing variables of a Syrthes coupling
+ *
+ * parameters:
+ * coupling_ent <-- Syrthes coupling structure
+ * step <-- 0: var = wall temperature
+ * 1: var = fluid temperature
+ * 2: var = exchange coefficient
+ * var <-- Pointer to variable values
+ *----------------------------------------------------------------------------*/
+
+static void
+_post_var_update(cs_syr4_coupling_ent_t *coupling_ent,
+ int step,
+ const cs_real_t *var)
+{
+ fvm_lnum_t n_elts, ii;
+
+ assert(coupling_ent != NULL);
+
+ if (coupling_ent->post_mesh_id == 0)
+ return;
+
+ assert(coupling_ent->wall_temp != NULL);
+ assert(coupling_ent->flux != NULL);
+
+ n_elts = coupling_ent->n_elts;
+
+ /* Allocate arrays */
+
+ switch(step) {
+
+ case 0:
+ for (ii = 0; ii < n_elts; ii++)
+ coupling_ent->wall_temp[ii] = var[ii];
+ break;
+
+ case 1:
+ coupling_ent->tfluid_tmp = coupling_ent->flux;
+ for (ii = 0; ii < n_elts; ii++)
+ coupling_ent->tfluid_tmp[ii] = var[ii];
+ break;
+
+ case 2:
+ assert(coupling_ent->tfluid_tmp == coupling_ent->flux);
+ for (ii = 0; ii < n_elts; ii++)
+ coupling_ent->flux[ii] = var[ii] * ( coupling_ent->wall_temp[ii]
+ - coupling_ent->flux[ii]);
+ coupling_ent->tfluid_tmp = NULL;
+ break;
+
+ default:
+ assert(0);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Post process variables associated with Syrthes couplings
+ *
+ * parameters:
+ * coupling_id <-- Id of Syrthes coupling
+ * nt_cur_abs <-- Current time step
+ * t_cur_abs <-- Current time value
+ *----------------------------------------------------------------------------*/
+
+static void
+_cs_syr4_coupling_post_function(int coupling_id,
+ int nt_cur_abs,
+ cs_real_t t_cur_abs)
+{
+ int type_id, var_id;
+
+ cs_syr4_coupling_t *syr_coupling = cs_syr4_coupling_by_id(coupling_id);
+ cs_syr4_coupling_ent_t *coupling_ent = NULL;
+ const char *var_name[2] = {N_("Wall T"), N_("Flux")};
+
+ for (type_id = 0; type_id < 2; type_id++) {
+
+ if (type_id == 0)
+ coupling_ent = syr_coupling->faces;
+ else
+ coupling_ent = syr_coupling->cells;
+
+ if (coupling_ent != NULL) {
+
+ if (coupling_ent->post_mesh_id != 0) {
+
+ const float *cell_var[2] = {NULL, NULL};
+ const float *face_var[2] = {NULL, NULL};
+
+ if (type_id == 0) {
+ face_var[0] = coupling_ent->wall_temp;
+ face_var[1] = coupling_ent->flux;
+ }
+ else {
+ cell_var[0] = coupling_ent->wall_temp;
+ cell_var[1] = coupling_ent->flux;
+ }
+
+ for (var_id = 0; var_id < 2; var_id++)
+ cs_post_write_var(coupling_ent->post_mesh_id,
+ _(var_name[var_id]),
+ 1,
+ false,
+ false,
+ CS_POST_TYPE_float,
+ nt_cur_abs,
+ t_cur_abs,
+ cell_var[var_id],
+ NULL,
+ face_var[var_id]);
+
+ }
+ }
+ }
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get number of SYRTHES couplings.
+ *
+ * returns:
+ * number of SYRTHES couplings
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_syr4_coupling_n_couplings(void)
+{
+ return cs_glob_syr4_n_couplings;
+}
+
+/*----------------------------------------------------------------------------
+ * Get pointer to SYRTHES coupling.
+ *
+ * parameters:
+ * coupling_id <-- Id (0 to n-1) of SYRTHES coupling
+ *
+ * returns:
+ * pointer to SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+cs_syr4_coupling_t *
+cs_syr4_coupling_by_id(fvm_lnum_t coupling_id)
+{
+ cs_syr4_coupling_t *retval = NULL;
+
+ if ( coupling_id > -1
+ && coupling_id < cs_glob_syr4_n_couplings)
+ retval = cs_glob_syr4_couplings[coupling_id];
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Create a syr4_coupling_t structure.
+ *
+ * parameters:
+ * dim <-- spatial mesh dimension
+ * ref_axis <-- reference axis
+ * face_sel_criterion <-- criterion for selection of boundary faces
+ * cell_sel_criterion <-- criterion for selection of cells
+ * syr_num <-- SYRTHES application number, or -1
+ * syr_name <-- SYRTHES application name, or NULL
+ * verbosity <-- verbosity level
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_add(fvm_lnum_t dim,
+ fvm_lnum_t ref_axis,
+ const char *face_sel_criterion,
+ const char *cell_sel_criterion,
+ int syr_num,
+ const char *syr_name,
+ int verbosity)
+{
+ cs_syr4_coupling_t *syr_coupling = NULL;
+
+ /* Allocate _cs_syr4_coupling_t structure */
+
+ BFT_REALLOC(cs_glob_syr4_couplings,
+ cs_glob_syr4_n_couplings + 1, cs_syr4_coupling_t*);
+ BFT_MALLOC(syr_coupling, 1, cs_syr4_coupling_t);
+
+ syr_coupling->dim = dim;
+ syr_coupling->ref_axis = ref_axis;
+
+ syr_coupling->syr_num = syr_num;
+ syr_coupling->syr_name = NULL;
+
+ if (syr_name != NULL) {
+ BFT_MALLOC(syr_coupling->syr_name, strlen(syr_name) + 1, char);
+ strcpy(syr_coupling->syr_name, syr_name);
+ }
+
+ /* Selection criteria */
+
+ syr_coupling->face_sel = NULL;
+ syr_coupling->cell_sel = NULL;
+
+ if (face_sel_criterion != NULL) {
+ BFT_MALLOC(syr_coupling->face_sel, strlen(face_sel_criterion) + 1, char);
+ strcpy(syr_coupling->face_sel, face_sel_criterion);
+ }
+ if (cell_sel_criterion != NULL) {
+ BFT_MALLOC(syr_coupling->cell_sel, strlen(cell_sel_criterion) + 1, char);
+ strcpy(syr_coupling->cell_sel, cell_sel_criterion);
+ }
+
+ if (face_sel_criterion == NULL && cell_sel_criterion == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Coupling with SYRTHES impossible.\n"
+ "No selection criteria for faces or cells to couple."));
+
+
+ syr_coupling->faces = NULL;
+ syr_coupling->cells = NULL;
+
+ syr_coupling->verbosity = verbosity;
+
+ /* Initialize communicators */
+
+#if defined(HAVE_MPI)
+
+ syr_coupling->comm = MPI_COMM_NULL;
+ syr_coupling->n_syr_ranks = 0;
+ syr_coupling->syr_root_rank = -1;
+
+#endif
+
+ /* Update coupling array and return */
+
+ cs_glob_syr4_couplings[cs_glob_syr4_n_couplings] = syr_coupling;
+ cs_glob_syr4_n_couplings++;
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy cs_syr4_coupling_t structures
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_all_destroy(void)
+{
+ fvm_lnum_t i_coupl;
+ cs_syr4_coupling_t *syr_coupling = NULL;
+
+ if (cs_glob_syr4_n_couplings == 0)
+ return;
+
+ for (i_coupl = 0; i_coupl < cs_glob_syr4_n_couplings; i_coupl++) {
+
+ syr_coupling = cs_glob_syr4_couplings[i_coupl];
+
+ /* Free _cs_syr4_coupling structure */
+
+ if (syr_coupling->syr_name != NULL)
+ BFT_FREE(syr_coupling->syr_name);
+
+ if (syr_coupling->face_sel != NULL)
+ BFT_FREE(syr_coupling->face_sel);
+ if (syr_coupling->cell_sel != NULL)
+ BFT_FREE(syr_coupling->cell_sel);
+
+ if (syr_coupling->faces != NULL)
+ _destroy_coupled_ent(&(syr_coupling->faces));
+ if (syr_coupling->cells != NULL)
+ _destroy_coupled_ent(&(syr_coupling->cells));
+
+ /* Close communication */
+
+ _finalize_comm(syr_coupling);
+
+ BFT_FREE(syr_coupling);
+
+ } /* End of loop on cs_glob_syr4_couplings */
+
+ cs_glob_syr4_n_couplings = 0;
+ BFT_FREE(cs_glob_syr4_couplings);
+
+ bft_printf(_("\nStructures associated with SYRTHES 4 coupling freed.\n"));
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize communicator for SYRTHES coupling
+ *
+ * parameters:
+ * syr_coupling <-> SYRTHES coupling structure
+ * coupling_id <-- id of this coupling (for log file message)
+ * syr_root_rank <-- SYRTHES root rank
+ * n_syr_ranks <-- Number of ranks associated with SYRTHES
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_init_comm(cs_syr4_coupling_t *syr_coupling,
+ int coupling_id,
+ int syr_root_rank,
+ int n_syr_ranks)
+{
+#if defined(HAVE_MPI)
+
+ char volume_flag = ' ';
+ char boundary_flag = ' ';
+ char op_name_send[32 + 1];
+ char op_name_recv[32 + 1];
+
+ syr_coupling->n_syr_ranks = n_syr_ranks;
+ syr_coupling->syr_root_rank = syr_root_rank;
+
+ _init_comm(syr_coupling, coupling_id);
+
+ /* Exchange coupling options */
+
+ if (syr_coupling->face_sel != NULL)
+ boundary_flag = 'b';
+ if (syr_coupling->cell_sel != NULL)
+ volume_flag = 'v';
+
+ sprintf(op_name_send, "coupling:type:%c%c",
+ boundary_flag, volume_flag);
+
+ _exchange_sync(syr_coupling, op_name_send, op_name_recv);
+
+ if (strcmp(op_name_recv, op_name_send))
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _("========================================================\n"
+ " ** Incompatible SYRTHES coupling options:\n"
+ " ------------------------------------------------\n"
+ " Code_Saturne options: \"%s\"\n"
+ " SYRTHES options: \"%s\"\n"
+ "========================================================\n"),
+ op_name_send, op_name_recv);
+
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * Exchange new iteration or stop message with SYRTHES.
+ *
+ * If nt_cur_abs < nt_max_abs, a new iteration message is sent;
+ * otherwise, a stop message is sent. A corresponding message
+ * is received, and if it is a stop message, nt_max_abs is
+ * set to nt_cur_abs.
+ *
+ * parameters:
+ * nt_cur_abs <-- current iteration number
+ * nt_max_abs <-> maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_sync_iter(int nt_cur_abs,
+ int *nt_max_abs)
+{
+ cs_int_t coupl_id;
+ char op_name_send[32 + 1];
+ char op_name_recv[32 + 1];
+
+ cs_int_t n_coupl = cs_syr4_coupling_n_couplings();
+ cs_syr4_coupling_t *syr_coupling = NULL;
+
+ if (nt_cur_abs < *nt_max_abs)
+ strcpy(op_name_send, "cmd:iter:start");
+ else
+ strcpy(op_name_send, "cmd:stop");
+
+ for (coupl_id = 0; coupl_id < n_coupl; coupl_id++) {
+
+ syr_coupling = cs_syr4_coupling_by_id(coupl_id);
+
+ _exchange_sync(syr_coupling, op_name_send, op_name_recv);
+
+ /* Treatment according to the received header */
+
+ if (!strcmp(op_name_recv, "cmd:stop")) {
+
+ if (*nt_max_abs != nt_cur_abs) {
+
+ *nt_max_abs = nt_cur_abs;
+
+ cs_base_warn(__FILE__, __LINE__);
+ bft_printf
+ (_("========================================================\n"
+ " ** Stop on SYRTHES request\n"
+ " -----------------------\n"
+ " received message: \"%s\"\n"
+ "========================================================\n"),
+ op_name_recv);
+
+ }
+
+ }
+
+ else if (strcmp(op_name_recv, "cmd:iter:start")) {
+
+ bft_error
+ (__FILE__, __LINE__, 0,
+ _("========================================================\n"
+ " ** Unexpected message in cs_syr4_messages_test_iter\n"
+ " ------------------------------------------------\n"
+ " received message: \"%s\"\n"
+ " expected message: cmd:iter:start \n"
+ "========================================================\n"),
+ op_name_recv);
+ }
+
+ } /* End of loop on Syrthes couplings */
+}
+
+/*----------------------------------------------------------------------------
+ * Define coupled mesh and send it to SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_init_mesh(cs_syr4_coupling_t *syr_coupling)
+{
+ char op_name_send[32 + 1];
+ char op_name_recv[32 + 1];
+
+ const fvm_lnum_t verbosity = syr_coupling->verbosity;
+
+ if (verbosity > 0)
+ bft_printf(_("\n ** Processing the mesh for SYRTHES coupling "
+ "\"%d\"\n\n"),
+ syr_coupling->syr_num);
+
+ /* Define coupled mesh */
+
+ assert(syr_coupling->dim == 3 || syr_coupling->dim == 2);
+
+ if (syr_coupling->face_sel != NULL)
+ syr_coupling->faces = _create_coupled_ent(syr_coupling,
+ syr_coupling->face_sel,
+ syr_coupling->syr_num,
+ syr_coupling->dim - 1);
+
+ if (syr_coupling->cell_sel != NULL)
+ syr_coupling->cells = _create_coupled_ent(syr_coupling,
+ syr_coupling->cell_sel,
+ syr_coupling->syr_num,
+ syr_coupling->dim);
+
+ /* Communication with SYRTHES */
+ /*----------------------------*/
+
+ /* Ready to start time iterations */
+
+ strcpy(op_name_send, "coupling:start");
+
+ _exchange_sync(syr_coupling, op_name_send, op_name_recv);
+
+ if (strcmp(op_name_recv, "coupling:start"))
+ bft_error(__FILE__, __LINE__, 0,
+ _(" Message received from SYRTHES: \"%s\"\n"
+ " indicates an error or is unexpected."),
+ op_name_recv);
+
+ else if (verbosity > 0) {
+ bft_printf(_("\n ** Mesh located for SYRTHES coupling \"%d\".\n\n"),
+ syr_coupling->syr_num);
+ bft_printf_flush();
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of associated coupled faces in main mesh
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ *
+ * returns:
+ * number of vertices in coupled mesh
+ *----------------------------------------------------------------------------*/
+
+fvm_lnum_t
+cs_syr4_coupling_get_n_faces(const cs_syr4_coupling_t *syr_coupling)
+{
+ cs_syr4_coupling_ent_t *coupling_ent = NULL;
+ fvm_lnum_t retval = 0;
+
+ assert(syr_coupling != NULL);
+ coupling_ent = syr_coupling->faces;
+
+ if (coupling_ent != NULL)
+ retval = coupling_ent->n_elts;
+
+ return retval;
+}
+
+/*----------------------------------------------------------------------------
+ * Get local numbering of coupled faces
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * coupl_face_list --> List of coupled faces (1 to n)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_get_face_list(const cs_syr4_coupling_t *syr_coupling,
+ cs_int_t coupl_face_list[])
+{
+ cs_syr4_coupling_ent_t *coupling_ent = NULL;
+
+ assert(sizeof(fvm_lnum_t) == sizeof(cs_int_t));
+ assert(syr_coupling != NULL);
+
+ coupling_ent = syr_coupling->faces;
+
+ if (coupling_ent != NULL)
+ fvm_nodal_get_parent_num(coupling_ent->elts,
+ coupling_ent->elt_dim,
+ coupl_face_list);
+}
+
+/*----------------------------------------------------------------------------
+ * Receive coupling variables from SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * twall --> wall temperature
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_recv_twall(cs_syr4_coupling_t *syr_coupling,
+ cs_real_t twall[])
+{
+ cs_syr4_coupling_ent_t *coupling_ent = NULL;
+
+ coupling_ent = syr_coupling->faces;
+
+ if (coupling_ent == NULL)
+ return;
+
+ /* Receive data */
+
+ fvm_locator_exchange_point_var(coupling_ent->locator,
+ NULL,
+ twall,
+ NULL,
+ sizeof(cs_real_t),
+ 1,
+ 0);
+
+ if (coupling_ent->n_elts > 0)
+ _post_var_update(coupling_ent, 0, twall);
+}
+
+/*----------------------------------------------------------------------------
+ * Send coupling variables to SYRTHES
+ *
+ * parameters:
+ * syr_coupling <-- SYRTHES coupling structure
+ * tf <-- fluid temperature
+ * hwall <-- wall heat exchange coefficient (numerical, not physical)
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_send_tf_hwall(cs_syr4_coupling_t *syr_coupling,
+ cs_real_t tf[],
+ cs_real_t hwall[])
+{
+ fvm_lnum_t ii;
+ fvm_lnum_t n_dist = 0;
+ const fvm_lnum_t *dist_loc = NULL;
+
+ cs_syr4_coupling_ent_t *coupling_ent = NULL;
+
+ double *send_var = NULL;
+
+ coupling_ent = syr_coupling->faces;
+
+ if (coupling_ent == NULL)
+ return;
+
+ n_dist = fvm_locator_get_n_dist_points(coupling_ent->locator);
+ dist_loc = fvm_locator_get_dist_locations(coupling_ent->locator);
+
+ /* Prepare and send data */
+
+ BFT_MALLOC(send_var, coupling_ent->n_elts*2, double);
+
+ for (ii = 0; ii < n_dist; ii++) {
+ send_var[ii*2] = tf[dist_loc[ii] - 1];
+ send_var[ii*2 + 1] = hwall[dist_loc[ii] - 1];
+ }
+
+ fvm_locator_exchange_point_var(coupling_ent->locator,
+ send_var,
+ NULL,
+ NULL,
+ sizeof(double),
+ 2,
+ 0);
+
+ BFT_FREE(send_var);
+
+ if (coupling_ent->n_elts > 0) {
+ _post_var_update(coupling_ent, 1, tf);
+ _post_var_update(coupling_ent, 1, hwall);
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize post-processing of a SYRTHES coupling
+ *
+ * parameters:
+ * coupling_id <-- Id of SYRTHES coupling
+ * writer_id <-- Id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr4_coupling_post_init(fvm_lnum_t coupling_id,
+ fvm_lnum_t writer_id)
+{
+ int type_id;
+ int dim_shift = 0;
+
+ cs_syr4_coupling_t *syr_coupling = cs_syr4_coupling_by_id(coupling_id);
+ cs_syr4_coupling_ent_t *coupling_ent = NULL;
+
+ assert(syr_coupling != NULL);
+
+ /* Exit silently if associated writer is not available */
+
+ if (cs_post_writer_exists(writer_id) != true)
+ return;
+
+ /* Initialize post processing flag, and free previous arrays in
+ case this function is called more than once */
+
+ for (type_id = 0; type_id < 2; type_id++) {
+
+ if (type_id == 0)
+ coupling_ent = syr_coupling->faces;
+ else
+ coupling_ent = syr_coupling->cells;
+
+ if (coupling_ent != NULL) {
+
+ coupling_ent->post_mesh_id = cs_post_get_free_mesh_id();
+
+ if (coupling_ent->wall_temp != NULL)
+ BFT_FREE(coupling_ent->wall_temp);
+ if (coupling_ent->flux != NULL)
+ BFT_FREE(coupling_ent->flux);
+ if (coupling_ent->tfluid_tmp != NULL)
+ BFT_FREE(coupling_ent->tfluid_tmp);
+
+ /* Allocate arrays */
+
+ if (coupling_ent->n_elts > 0) {
+ BFT_MALLOC(coupling_ent->wall_temp, coupling_ent->n_elts, float);
+ BFT_MALLOC(coupling_ent->flux, coupling_ent->n_elts, float);
+ }
+ coupling_ent->tfluid_tmp = NULL;
+
+ /* Associate external mesh description with post processing subsystem */
+
+ if (syr_coupling->dim == 2)
+ dim_shift = 1;
+
+ cs_post_add_existing_mesh(coupling_ent->post_mesh_id,
+ coupling_ent->elts,
+ dim_shift,
+ false);
+
+ cs_post_associate(coupling_ent->post_mesh_id, writer_id);
+
+ /* Register post processing function */
+
+ cs_post_add_time_dep_var(_cs_syr4_coupling_post_function,
+ coupling_id);
+
+ /* Update start and end (negative) numbers associated with
+ dedicated post processing meshes */
+
+ if (cs_glob_syr4_post_mesh_ext[0] == 0)
+ cs_glob_syr4_post_mesh_ext[0] = coupling_ent->post_mesh_id;
+
+ cs_glob_syr4_post_mesh_ext[1] = coupling_ent->post_mesh_id;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_syr_coupling.c b/src/base/cs_syr_coupling.c
new file mode 100644
index 0000000..9fb1aa2
--- /dev/null
+++ b/src/base/cs_syr_coupling.c
@@ -0,0 +1,1098 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * SYRTHES coupling
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#if defined(HAVE_MPI)
+#include "cs_coupling.h"
+#endif
+
+#include "cs_parall.h"
+
+#include "cs_syr3_coupling.h"
+#include "cs_syr3_messages.h"
+#include "cs_syr4_coupling.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_syr_coupling.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Structure Definitions
+ *============================================================================*/
+
+/* Structure associated with Syrthes coupling */
+
+typedef struct {
+
+ int match_id; /* Id of matched application, -1 initially */
+ int dim; /* Coupled mesh dimension */
+ int ref_axis; /* Selected axis for edge extraction */
+ int app_num; /* Application number, or -1 */
+ char *app_name; /* Application name, or -1 */
+ char *face_sel_c; /* Face selection criteria */
+ char *cell_sel_c; /* Face selection criteria */
+ int verbosity; /* Verbosity level */
+
+} _cs_syr_coupling_builder_t;
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+static int _cs_glob_n_syr_cp = -1;
+static int _cs_glob_n_syr3_cp = -1;
+static int _cs_glob_n_syr4_cp = -1;
+
+static int _syr_coupling_builder_size = 0;
+static _cs_syr_coupling_builder_t *_syr_coupling_builder = NULL;
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Remove matched builder entries from the coupling builder.
+ *----------------------------------------------------------------------------*/
+
+static void
+_remove_matched_builder_entries(void)
+{
+ int i;
+ int n_unmatched_entries = 0;
+
+ /* First, free arrays associated with marked entries */
+
+ for (i = 0; i < _syr_coupling_builder_size; i++) {
+
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + i;
+
+ if (scb->match_id > -1) {
+ if (scb->face_sel_c != NULL)
+ BFT_FREE(scb->face_sel_c);
+ if (scb->cell_sel_c != NULL)
+ BFT_FREE(scb->cell_sel_c);
+ if (scb->app_name != NULL)
+ BFT_FREE(scb->app_name);
+ }
+ }
+
+ /* Now, remove marked entries and resize */
+
+ for (i = 0; i < _syr_coupling_builder_size; i++) {
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + i;
+ if (scb->match_id < 0) {
+ *(_syr_coupling_builder + n_unmatched_entries) = *scb;
+ n_unmatched_entries += 1;
+ }
+ }
+
+ _syr_coupling_builder_size = n_unmatched_entries;
+
+ BFT_REALLOC(_syr_coupling_builder,
+ _syr_coupling_builder_size,
+ _cs_syr_coupling_builder_t);
+}
+
+/*----------------------------------------------------------------------------
+ * Print information on yet unmatched SYRTHES couplings.
+ *----------------------------------------------------------------------------*/
+
+static void
+_print_all_unmatched_syr(void)
+{
+ int i;
+
+ const char empty_string[] = "";
+
+ /* Loop on defined SYRTHES instances */
+
+ for (i = 0; i < _syr_coupling_builder_size; i++) {
+
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + i;
+
+ if (scb->match_id < 0) {
+
+ const char *local_name = empty_string;
+
+ if (scb->app_name != NULL)
+ local_name = scb->app_name;
+
+ bft_printf(_(" SYRTHES coupling:\n"
+ " coupling id: %d\n"
+ " local name: \"%s\"\n"
+ " local number: %d\n\n"),
+ i, local_name, scb->app_num);
+ }
+ }
+
+ bft_printf_flush();
+}
+
+#if defined(HAVE_MPI)
+
+/*----------------------------------------------------------------------------
+ * Add a SYRTHES 4 coupling using MPI.
+ *
+ * parameters:
+ * builder_id <-- SYRTHES application id in coupling builder
+ * syr_root_rank <-- root rank associated with SYRTHES
+ * n_syr_ranks <-- number of ranks associated with SYRTHES
+ *----------------------------------------------------------------------------*/
+
+static void
+_syr4_add_mpi(int builder_id,
+ int syr_root_rank,
+ int n_syr_ranks)
+{
+ cs_syr4_coupling_t *syr_coupling = NULL;
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + builder_id;
+
+ /* Addition of coupling and association of communicator could
+ be grouped together, but we prefer to keep the steps separate
+ so that when SYRTHES 3 support is removed, we will simply be
+ able to add SYRTHES 4 couplings directly (without resorting
+ to a temporary builder), then match communications */
+
+ cs_syr4_coupling_add(scb->dim,
+ scb->ref_axis,
+ scb->face_sel_c,
+ scb->cell_sel_c,
+ scb->app_num,
+ scb->app_name,
+ scb->verbosity);
+
+ syr_coupling = cs_syr4_coupling_by_id(cs_syr4_coupling_n_couplings() - 1);
+
+ cs_syr4_coupling_init_comm(syr_coupling,
+ builder_id,
+ syr_root_rank,
+ n_syr_ranks);
+}
+
+/*----------------------------------------------------------------------------
+ * Add a SYRTHES 3 coupling using MPI.
+ *
+ * parameters:
+ * builder_id <-- SYRTHES application id in coupling builder
+ * syr_rank <-- rank associated with SYRTHES
+ *----------------------------------------------------------------------------*/
+
+static void
+_syr3_add_mpi(int builder_id,
+ int syr_rank)
+{
+ cs_syr3_coupling_t *syr_coupling = NULL;
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + builder_id;
+
+ cs_syr3_coupling_add(scb->dim,
+ scb->ref_axis,
+ scb->face_sel_c,
+ scb->app_num,
+ syr_rank,
+ CS_SYR3_COMM_TYPE_MPI,
+ scb->verbosity);
+
+ syr_coupling = cs_syr3_coupling_by_id(cs_syr3_coupling_n_couplings() - 1);
+
+ cs_syr3_coupling_init_comm(syr_coupling, builder_id);
+}
+
+/*----------------------------------------------------------------------------
+ * Print information on identified SYRTHES couplings using MPI.
+ *
+ * This function requires coupling_builder information, and must thus
+ * be called before removing matched builder entries.
+ *----------------------------------------------------------------------------*/
+
+static void
+_print_all_mpi_syr(void)
+{
+ int i;
+
+ const fvm_coupling_mpi_world_t *mpi_apps = cs_coupling_get_mpi_apps();
+ const char empty_string[] = "";
+
+ /* Loop on defined SYRTHES instances */
+
+ for (i = 0; i < _syr_coupling_builder_size; i++) {
+
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + i;
+
+ if (scb->match_id > -1) {
+
+ const char *syr_version = empty_string;
+ const char *local_name = empty_string;
+ const char *distant_name = empty_string;
+
+ const fvm_coupling_mpi_world_info_t
+ ai = fvm_coupling_mpi_world_get_info(mpi_apps, scb->match_id);
+
+ if (scb->app_name != NULL)
+ local_name = scb->app_name;
+ if (ai.app_type != NULL)
+ syr_version = ai.app_type;
+ if (ai.app_name != NULL)
+ distant_name = ai.app_name;
+
+ bft_printf(_(" SYRTHES coupling:\n"
+ " coupling id: %d\n"
+ " version: \"%s\"\n"
+ " local name: \"%s\"\n"
+ " distant application name: \"%s\"\n"
+ " local number: %d\n"
+ " MPI application number: %d\n"
+ " MPI root rank: %d\n"
+ " number of MPI ranks: %d\n\n"),
+ i, syr_version, local_name, distant_name,
+ scb->app_num, ai.app_num, ai.root_rank, ai.n_ranks);
+ }
+ }
+
+ bft_printf_flush();
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize MPI SYRTHES couplings using MPI.
+ *
+ * This function may be called once all couplings have been defined,
+ * and it will match defined couplings with available applications.
+ *----------------------------------------------------------------------------*/
+
+static void
+_init_all_mpi_syr(void)
+{
+ int i;
+
+ int n_apps = 0;
+ int n_matched_apps = 0;
+ int n_syr3_apps = 0, n_syr4_apps = 0;
+ int syr_app_id = -1, syr_app_type = 0;
+
+ const fvm_coupling_mpi_world_t *mpi_apps = cs_coupling_get_mpi_apps();
+
+ if (mpi_apps == NULL)
+ return;
+
+ n_apps = fvm_coupling_mpi_world_n_apps(mpi_apps);
+
+ /* First pass to count available SYRTHES couplings */
+
+ for (i = 0; i < n_apps; i++) {
+ const fvm_coupling_mpi_world_info_t
+ ai = fvm_coupling_mpi_world_get_info(mpi_apps, i);
+ if (strncmp(ai.app_type, "SYRTHES 4", 9) == 0) {
+ n_syr4_apps += 1;
+ syr_app_id = i;
+ syr_app_type = 4;
+ }
+ else if (strncmp(ai.app_type, "SYRTHES 3", 9) == 0) {
+ n_syr3_apps += 1;
+ syr_app_id = i;
+ syr_app_type = 3;
+ }
+ }
+
+ /* In single-coupling mode, no identification necessary */
+
+ if ((n_syr3_apps + n_syr4_apps == 1) && _syr_coupling_builder_size == 1) {
+ _syr_coupling_builder->match_id = syr_app_id;
+ n_matched_apps += 1;
+ }
+
+ /* In multiple-coupling mode, identification is necessary */
+
+ else {
+
+ int j;
+ fvm_coupling_mpi_world_info_t ai;
+
+ int n_syr_apps = 0;
+ int *syr_appinfo = NULL;
+
+ /* First, build an array of matched/unmatched SYRTHES applications, with
+ 2 entries per instance: matched indicator, app_id */
+
+ BFT_MALLOC(syr_appinfo, (n_syr3_apps + n_syr4_apps)*2, int);
+
+ for (i = 0; i < n_apps; i++) {
+ ai = fvm_coupling_mpi_world_get_info(mpi_apps, i);
+ if ( (strncmp(ai.app_type, "SYRTHES 4", 9) == 0)
+ || (strncmp(ai.app_type, "SYRTHES 3", 9) == 0)) {
+ syr_appinfo[n_syr_apps*2] = 0;
+ syr_appinfo[n_syr_apps*2 + 1] = i;
+ n_syr_apps += 1;
+ }
+ }
+
+ assert(n_syr_apps == (n_syr3_apps + n_syr4_apps));
+
+ /* Loop on defined SYRTHES instances */
+
+ for (i = 0; i < _syr_coupling_builder_size; i++) {
+
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + i;
+
+ /* First loop on available SYRTHES instances to match app_names */
+
+ if (scb->app_name != NULL) {
+
+ for (j = 0; j < n_syr_apps; j++) {
+
+ if (syr_appinfo[j*2] != 0) /* Consider only unmatched applications */
+ continue;
+
+ ai = fvm_coupling_mpi_world_get_info(mpi_apps, syr_appinfo[j*2 + 1]);
+ if (ai.app_name != NULL) {
+ if (strcmp(ai.app_name, scb->app_name) == 0) {
+ scb->match_id = syr_appinfo[j*2 + 1];
+ syr_appinfo[j*2] = i;
+ n_matched_apps += 1;
+ break;
+ }
+ }
+ }
+
+ }
+
+ /* Second loop on available SYRTHES instances to match app_nums */
+
+ if (scb->match_id < 0 && scb->app_num > -1) {
+
+ for (j = 0; j < n_syr_apps; j++) {
+
+ if (syr_appinfo[j*2] != 0) /* Consider only unmatched applications */
+ continue;
+
+ ai = fvm_coupling_mpi_world_get_info(mpi_apps, syr_appinfo[j*2 + 1]);
+ if (ai.app_num == scb->app_num) {
+ scb->match_id = syr_appinfo[j*2 + 1];
+ syr_appinfo[j*2] = i;
+ n_matched_apps += 1;
+ break;
+ }
+ }
+ }
+
+ } /* End of loop on defined SYRTHES instances */
+
+ BFT_FREE(syr_appinfo);
+
+ } /* End of test on single or multiple SYRTHES matching algorithm */
+
+ /* Print matching info */
+
+ _print_all_mpi_syr();
+
+ /* Now initialize matched couplings */
+ /*----------------------------------*/
+
+ for (i = 0; i < _syr_coupling_builder_size; i++) {
+
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + i;
+
+ if (scb->match_id > -1) {
+ const fvm_coupling_mpi_world_info_t
+ ai = fvm_coupling_mpi_world_get_info(mpi_apps, scb->match_id);
+
+ if (strncmp(ai.app_type, "SYRTHES 4", 9) == 0)
+ _syr4_add_mpi(i, ai.root_rank, ai.n_ranks);
+
+ else if (strncmp(ai.app_type, "SYRTHES 3", 9) == 0)
+ _syr3_add_mpi(i, ai.root_rank);
+ }
+ }
+
+ /* Cleanup */
+
+ _remove_matched_builder_entries();
+}
+
+#endif /* defined(HAVE_MPI) */
+
+#if defined(HAVE_SOCKET)
+
+/*----------------------------------------------------------------------------
+ * Add a SYRTHES 3 coupling using sockets.
+ *
+ * parameters:
+ * builder_id <-- SYRTHES application id in coupling builder
+ *----------------------------------------------------------------------------*/
+
+static void
+_syr3_add_socket(int builder_id)
+{
+ cs_syr3_coupling_t *syr_coupling = NULL;
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + builder_id;
+
+ cs_syr3_coupling_add(scb->dim,
+ scb->ref_axis,
+ scb->face_sel_c,
+ scb->app_num,
+ -1,
+ CS_SYR3_COMM_TYPE_SOCKET,
+ scb->verbosity);
+
+ syr_coupling = cs_syr3_coupling_by_id(cs_syr3_coupling_n_couplings() - 1);
+
+ cs_syr3_coupling_init_comm(syr_coupling, builder_id);
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize SYRTHES couplings using sockets.
+ *
+ * Currently, only SYRTHES 3.4 may be coupled using sockets
+ *
+ * This function may be called once all couplings have been defined,
+ * and it will match defined couplings with available applications.
+ *
+ * parameters:
+ * port_num <-- port number (only used for rank 0; automatic on others)
+ *----------------------------------------------------------------------------*/
+
+static void
+_init_all_socket_syr(int port_num)
+{
+ int i;
+
+ /* Initialize socket server */
+
+ if (_syr_coupling_builder_size > 0)
+ cs_syr3_comm_init_socket(port_num);
+
+ bft_printf
+ ("SYRTHES couplings for which the socket interface will be used:\n"
+ "--------------------------------------------------------------\n\n");
+
+ _print_all_unmatched_syr();
+
+ /* Loop on unmatched SYRTHES instances */
+
+ for (i = 0; i < _syr_coupling_builder_size; i++) {
+
+ _cs_syr_coupling_builder_t *scb = _syr_coupling_builder + i;
+
+ _syr3_add_socket(i);
+
+ scb->match_id = 0;
+ }
+
+ /* Cleanup (if we have not deadlocked before) */
+
+ _remove_matched_builder_entries();
+}
+
+#endif /* defined(HAVE_SOCKETS) */
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define new SYRTHES coupling.
+ *
+ * In the case of a single Code_Saturne and single SYRTHES instance, the
+ * syrthes_app_num and syrthes_name arguments are ignored.
+ *
+ * In case of multiple couplings, a coupling will be matched with available
+ * SYRTHES instances prioritarily based on the syrthes_name argument, then
+ * on the syrthes_app_num argument. If syrthes_name is empty, matching will
+ * be based on syrthes_app_num only.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE DEFSY1
+ * *****************
+ *
+ * INTEGER syrthes_app_num : <-- : application number of coupled
+ * : : SYRTHES instance, or -1
+ * CHARACTER* syrthes_name : <-- : name of coupled SYRTHES instance
+ * CHARACTER projection_axis : <-- : ' ' for 3D, 'x', 'y', or 'z'
+ * : : for 2D projection
+ * CHARACTER* boundary_criteria : <-- : boundary face selection criteria,
+ * : : empty if no boundary coupling
+ * CHARACTER* volume_criteria : <-- : volume cell selection criteria,
+ * : : empty if no volume coupling
+ * INTEGER verbosity : <-- : verbosity level
+ * INTEGER syrthes_n_len : <-- : length of syrthes_name
+ * INTEGER boundary_c_len : <-- : length of boundary_criteria
+ * INTEGER volume_c_len : <-- : length of volume_criteria
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(defsy1, DEFSY1)
+(
+ cs_int_t *syrthes_app_num,
+ const char *syrthes_name,
+ char *projection_axis,
+ const char *boundary_criteria,
+ const char *volume_criteria,
+ cs_int_t *verbosity,
+ cs_int_t *syrthes_n_len,
+ cs_int_t *boundary_c_len,
+ cs_int_t *volume_c_len
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ char *_syrthes_name = NULL;
+ char *_boundary_criteria = NULL, *_volume_criteria = NULL;
+
+ if (syrthes_name != NULL && *syrthes_n_len > 0)
+ _syrthes_name = cs_base_string_f_to_c_create(syrthes_name, *syrthes_n_len);
+
+ if (boundary_criteria != NULL && *boundary_c_len > 0)
+ _boundary_criteria = cs_base_string_f_to_c_create(boundary_criteria,
+ *boundary_c_len);
+ if (_boundary_criteria != NULL && strlen(_boundary_criteria) == 0)
+ cs_base_string_f_to_c_free(&_boundary_criteria);
+
+ if (volume_criteria != NULL && *volume_c_len > 0)
+ _volume_criteria = cs_base_string_f_to_c_create(volume_criteria,
+ *volume_c_len);
+ if (_volume_criteria != NULL && strlen(_volume_criteria) == 0)
+ cs_base_string_f_to_c_free(&_volume_criteria);
+
+ cs_syr_coupling_define(*syrthes_app_num,
+ _syrthes_name,
+ _boundary_criteria,
+ _volume_criteria,
+ *projection_axis,
+ *verbosity);
+
+ if (_syrthes_name != NULL)
+ cs_base_string_f_to_c_free(&_syrthes_name);
+ if (_boundary_criteria != NULL)
+ cs_base_string_f_to_c_free(&_boundary_criteria);
+ if (_volume_criteria != NULL)
+ cs_base_string_f_to_c_free(&_volume_criteria);
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of SYRTHES couplings.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE NBCSYR
+ * *****************
+ *
+ * INTEGER n_couplings : <-- : number of SYRTHES couplings
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(nbcsyr, NBCSYR)
+(
+ fvm_lnum_t *n_couplings
+)
+{
+ if (_cs_glob_n_syr_cp < 0) {
+ if (_syr_coupling_builder_size > 0)
+ _cs_glob_n_syr_cp = _syr_coupling_builder_size;
+ else
+ _cs_glob_n_syr_cp = cs_syr3_coupling_n_couplings()
+ + cs_syr4_coupling_n_couplings();
+ }
+
+ *n_couplings = _cs_glob_n_syr_cp;
+}
+
+/*----------------------------------------------------------------------------
+ * Create nodal coupled mesh.
+ *
+ * Send vertices's coordinates and connectivity of coupled mesh for SYRTHES 3,
+ * setup FVM locator for SYRTHES 4.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE GEOSYR
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(geosyr, GEOSYR)
+(
+ void
+)
+{
+ int coupl_id;
+
+ _cs_glob_n_syr3_cp = cs_syr3_coupling_n_couplings();
+ _cs_glob_n_syr4_cp = cs_syr4_coupling_n_couplings();
+
+ for (coupl_id = 0; coupl_id < _cs_glob_n_syr3_cp; coupl_id++) {
+ cs_syr3_coupling_t *syr_coupling = cs_syr3_coupling_by_id(coupl_id);
+ cs_syr3_coupling_init_mesh(syr_coupling);
+ }
+
+ for (coupl_id = 0; coupl_id < _cs_glob_n_syr4_cp; coupl_id++) {
+ cs_syr4_coupling_t *syr_coupling = cs_syr4_coupling_by_id(coupl_id);
+ cs_syr4_coupling_init_mesh(syr_coupling);
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Check if SYRTHES coupling continues or if we must stop.
+ *
+ * For SYRTHES 4 couplings, if nt_cur_abs < nt_max_abs, a new iteration
+ * message is sent; otherwise, a stop message is sent. A corresponding
+ * message is received, and if it is a stop message, nt_max_abs is
+ * set to nt_cur_abs.
+ *
+ * For SYRTHES 3 couplings, A message (stop or new iteration) is
+ * received. No iteration start message is sent, as this is done
+ * by ITDSYR.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE TSTSYR (IMSFIN)
+ * *****************
+ *
+ * INTEGER NTMABS : <-> : Maximum iteration number
+ * INTEGER NTCABS : --> : Current iteration number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(tstsyr, TSTSYR)
+(
+ cs_int_t *ntmabs,
+ cs_int_t *ntcabs
+)
+{
+ int nt_max_abs = *ntmabs;
+
+ if ((*ntcabs < *ntmabs) && cs_syr3_coupling_n_couplings() > 0)
+ cs_syr3_messages_test_iter(*ntcabs, &nt_max_abs);
+
+ if (cs_syr4_coupling_n_couplings() > 0)
+ cs_syr4_coupling_sync_iter(*ntcabs, &nt_max_abs);
+
+ *ntmabs = nt_max_abs;
+}
+
+/*----------------------------------------------------------------------------
+ * Synchronize new time step message for SYRTHES 3 couplings.
+ *
+ * This function is not necessary for SYRTHES 4, as all synchronization
+ * is done by TSTSYR. For SYRTHES 3, it is necessary to distinguish
+ * the last iteration from other iterations (to allow for SYRTHES 3 to
+ * determine in advance that it will need to output postprocessing/restart
+ * data), so using this separate function allows it to be placed after
+ * MODPAR in the main time loop, in case NTMABS is changed by that function.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE ITDSYR (NTCABS, NTMABS)
+ * *****************
+ *
+ * INTEGER NTCABS : --> : Current iteration number
+ * INTEGER NTMABS : --> : Maximum iteration number
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(itdsyr, ITDSYR)
+(
+ cs_int_t *ntcabs,
+ cs_int_t *ntmabs
+)
+{
+ /* No call is necessary for SYRTHES 4, as all is done in
+ cs_syr4_coupling_sync_iter(), call by TSTSYR in this case. */
+
+ if (cs_syr3_coupling_n_couplings() > 0)
+ cs_syr3_messages_new_time_step(*ntcabs, *ntmabs);
+}
+
+/*----------------------------------------------------------------------------
+ * Get number of boundary faces coupled with SYRTHES.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE NBFSYR
+ * *****************
+ *
+ * INTEGER coupl_num : --> : coupling number
+ * INTEGER n_coupl_faces : <-- : number of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(nbfsyr, NBFSYR)
+(
+ const cs_int_t *coupl_num,
+ cs_int_t *n_coupl_faces
+)
+{
+ int n_couplings = _cs_glob_n_syr3_cp + _cs_glob_n_syr4_cp;
+
+ if (*coupl_num < 1 || *coupl_num > n_couplings)
+ bft_error(__FILE__, __LINE__, 0,
+ _("SYRTHES coupling number %d impossible; "
+ "there are %d couplings"),
+ *coupl_num, n_couplings);
+
+ else {
+ if (*coupl_num <= _cs_glob_n_syr3_cp) {
+ cs_syr3_coupling_t *syr_coupling
+ = cs_syr3_coupling_by_id(*coupl_num - 1);
+ *n_coupl_faces = cs_syr3_coupling_get_n_faces(syr_coupling);
+ }
+ else {
+ cs_syr4_coupling_t *syr_coupling
+ = cs_syr4_coupling_by_id(*coupl_num - _cs_glob_n_syr3_cp - 1);
+ *n_coupl_faces = cs_syr4_coupling_get_n_faces(syr_coupling);
+ }
+ }
+}
+
+
+/*----------------------------------------------------------------------------
+ * Get local numbering of coupled faces
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LFASYR
+ * *****************
+ *
+ * INTEGER coupl_num : --> : coupling number
+ * INTEGER coupl_face_list : <-- : list of coupled boundary faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(lfasyr, LFASYR)
+(
+ const cs_int_t *coupl_num,
+ fvm_lnum_t *coupl_face_list
+)
+{
+ int n_couplings = _cs_glob_n_syr3_cp + _cs_glob_n_syr4_cp;
+
+ if (*coupl_num < 1 || *coupl_num > n_couplings)
+ bft_error(__FILE__, __LINE__, 0,
+ _("SYRTHES coupling number %d impossible; "
+ "there are %d couplings"),
+ *coupl_num, n_couplings);
+ else {
+ if (*coupl_num <= _cs_glob_n_syr3_cp) {
+ cs_syr3_coupling_t *syr_coupling
+ = cs_syr3_coupling_by_id(*coupl_num - 1);
+ cs_syr3_coupling_get_face_list(syr_coupling, coupl_face_list);
+ }
+ else {
+ cs_syr4_coupling_t *syr_coupling
+ = cs_syr4_coupling_by_id(*coupl_num - _cs_glob_n_syr3_cp - 1);
+ cs_syr4_coupling_get_face_list(syr_coupling, coupl_face_list);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Receive coupling variables from SYRTHES
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE VARSYI (NUMSYR, TWALL)
+ * *****************
+ *
+ * INTEGER NUMSYR : --> : Number of SYRTHES coupling
+ * DOUBLE PRECISION TWALL : <-- : Wall temerature
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (varsyi, VARSYI)
+(
+ cs_int_t *numsyr,
+ cs_real_t *twall
+)
+{
+ int n_couplings = _cs_glob_n_syr3_cp + _cs_glob_n_syr4_cp;
+
+ if (*numsyr < 1 || *numsyr > n_couplings)
+ bft_error(__FILE__, __LINE__, 0,
+ _("SYRTHES coupling number %d impossible; "
+ "there are %d couplings"),
+ *numsyr, n_couplings);
+ else {
+ if (*numsyr <= _cs_glob_n_syr3_cp) {
+ cs_syr3_messages_recv_twall(*numsyr, twall);
+ }
+ else {
+ cs_syr4_coupling_t *syr_coupling
+ = cs_syr4_coupling_by_id(*numsyr - _cs_glob_n_syr3_cp -1);
+ cs_syr4_coupling_recv_twall(syr_coupling, twall);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Send coupling variables to SYRTHES
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE VARSYO (NUMSYR, TFLUID, HWALL)
+ * *****************
+ *
+ * INTEGER NUMSYR : --> : Number of SYRTHES coupling
+ * DOUBLE PRECISION TFLUID : --> : Fluid temperature
+ * DOUBLE PRECISION HWALL : --> : Exchange coefficient
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (varsyo, VARSYO)
+(
+ cs_int_t *numsyr,
+ cs_real_t *tfluid,
+ cs_real_t *hwall
+)
+{
+ int n_couplings = _cs_glob_n_syr3_cp + _cs_glob_n_syr4_cp;
+
+ if (*numsyr < 1 || *numsyr > n_couplings)
+ bft_error(__FILE__, __LINE__, 0,
+ _("SYRTHES coupling number %d impossible; "
+ "there are %d couplings"),
+ *numsyr, n_couplings);
+ else {
+ if (*numsyr <= _cs_glob_n_syr3_cp)
+ cs_syr3_messages_send_tf_hwall(*numsyr, tfluid, hwall);
+ else {
+ cs_syr4_coupling_t *syr_coupling
+ = cs_syr4_coupling_by_id(*numsyr - _cs_glob_n_syr3_cp - 1);
+ cs_syr4_coupling_send_tf_hwall(syr_coupling, tfluid, hwall);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize post processing of SYRTHES couplings.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PSTISY
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(pstisy, PSTISY)
+(
+ void
+)
+{
+ int coupl_id;
+
+ for (coupl_id = 0; coupl_id < _cs_glob_n_syr3_cp; coupl_id++)
+ cs_syr3_coupling_post_init(coupl_id, -1);
+
+ for (coupl_id = 0; coupl_id < _cs_glob_n_syr4_cp; coupl_id++)
+ cs_syr4_coupling_post_init(coupl_id, -1);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Define new SYRTHES coupling.
+ *
+ * In the case of a single Code_Saturne and single SYRTHES instance, the
+ * syrthes_app_num and syrthes_name arguments are ignored.
+ *
+ * In case of multiple couplings, a coupling will be matched with available
+ * SYRTHES instances prioritarily based on the syrthes_name argument, then
+ * on the syrthes_app_num argument. If syrthes_name is empty, matching will
+ * be based on syrthes_app_num only.
+ *
+ * arguments:
+ * syrthes_app_num <-- number of SYRTHES application, or -1
+ * syrthes_name <-- name of SYRTHES instance, or NULL
+ * boundary_criteria <-- boundary face selection criteria, or NULL
+ * volume_criteria <-- volume cell selection criteria, or NULL
+ * projection_axis <-- 'x', 'y', or 'y' for 2D projection axis (case
+ * independent), or ' ' for standard 3D coupling
+ * verbosity <-- verbosity level
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr_coupling_define(int syrthes_app_num,
+ const char *syrthes_name,
+ const char *boundary_criteria,
+ const char *volume_criteria,
+ char projection_axis,
+ int verbosity)
+{
+ _cs_syr_coupling_builder_t *scb = NULL;
+
+ /* Add corresponding coupling to temporary SYRTHES couplings array */
+
+ BFT_REALLOC(_syr_coupling_builder,
+ _syr_coupling_builder_size + 1,
+ _cs_syr_coupling_builder_t);
+
+ scb = &(_syr_coupling_builder[_syr_coupling_builder_size]);
+
+ scb->match_id = -1;
+
+ switch (projection_axis) {
+ case 'x':
+ case 'X':
+ scb->dim = 2;
+ scb->ref_axis = 0;
+ break;
+ case 'y':
+ case 'Y':
+ scb->dim = 2;
+ scb->ref_axis = 1;
+ break;
+ case 'z':
+ case 'Z':
+ scb->dim = 2;
+ scb->ref_axis = 2;
+ break;
+ default:
+ scb->dim = 3;
+ scb->ref_axis = -1;
+ }
+
+ scb->app_num = syrthes_app_num;
+
+ scb->app_name = NULL;
+ if (syrthes_name != NULL) {
+ BFT_MALLOC(scb->app_name, strlen(syrthes_name) + 1, char);
+ strcpy(scb->app_name, syrthes_name);
+ }
+
+ scb->face_sel_c = NULL;
+ if (boundary_criteria != NULL) {
+ BFT_MALLOC(scb->face_sel_c, strlen(boundary_criteria) + 1, char);
+ strcpy(scb->face_sel_c, boundary_criteria);
+ }
+
+ scb->cell_sel_c = NULL;
+ if (volume_criteria != NULL) {
+ BFT_MALLOC(scb->cell_sel_c, strlen(volume_criteria) + 1, char);
+ strcpy(scb->cell_sel_c, volume_criteria);
+ }
+
+ scb->verbosity = verbosity;
+
+ _syr_coupling_builder_size += 1;
+}
+
+/*----------------------------------------------------------------------------
+ * Initialize SYRTHES couplings.
+ *
+ * This function may be called once all couplings have been defined,
+ * and it will match defined couplings with available applications.
+ *
+ * parameters:
+ * port_num <-- port number for rank 0 to enable sockets,
+ * < 0 to disable sockets
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr_coupling_all_init(int port_num)
+{
+ /* First try using MPI */
+
+#if defined(HAVE_MPI)
+
+ if (_syr_coupling_builder_size > 0)
+ _init_all_mpi_syr();
+
+#endif
+
+ /* If not all SYRTHES instances have been found, try using sockets */
+
+#if defined(HAVE_SOCKET)
+
+ if (_syr_coupling_builder_size > 0 && port_num > -1)
+ _init_all_socket_syr(port_num);
+
+#endif
+
+ if (_syr_coupling_builder_size > 0) {
+
+ bft_printf("Unmatched SYRTHES couplings:\n"
+ "----------------------------\n\n");
+
+ _print_all_unmatched_syr();
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("At least 1 SYRTHES coupling was defined for which\n"
+ "no communication with a SYRTHES instance is possible."));
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Finalize all SYRTHES couplings.
+ *----------------------------------------------------------------------------*/
+
+void
+cs_syr_coupling_all_finalize(void)
+{
+ cs_syr3_coupling_all_destroy();
+ cs_syr4_coupling_all_destroy();
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_syr_f2c.f90 b/src/base/cs_syr_f2c.f90
new file mode 100644
index 0000000..3aa634b
--- /dev/null
+++ b/src/base/cs_syr_f2c.f90
@@ -0,0 +1,94 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine defsyr &
+!================
+
+ ( numsyr, nomsyr , cproj, critbo, critvl, iwarni )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! DEFINITION DE COUPLAGE(S) AVEC LE CODE SYRTHES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! numsyr ! a ! <-- ! numero du cas syrthes associe !
+! nomsyr ! a ! <-- ! nom du cas syrthes associe !
+! cproj ! c ! <-- ! direction de projection (' ' pour !
+! ! ! ! 3d, 'x', 'y', ou 'z' pour 2d) !
+! critbo ! a ! <-- ! critere de selection des faces de !
+! ! ! ! bord couplees (ou vide) !
+! critvl ! a ! <-- ! critere de selection des cellules !
+! ! ! ! volumiques couplees (ou vide) !
+! iwarni ! e ! <-- ! niveau d'impression !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*(*) nomsyr, critbo, critvl
+character cproj
+integer numsyr, iwarni
+
+! Variables locales
+
+integer lnomsy, lcritb, lcritv
+
+!===============================================================================
+
+lnomsy = len(nomsyr)
+lcritb = len(critbo)
+lcritv = len(critvl)
+
+call defsy1(numsyr, nomsyr, cproj, critbo, critvl, iwarni, &
+!==========
+ lnomsy, lcritb, lcritv)
+
+
+return
+
+end
+
diff --git a/src/base/cs_tpar1d.c b/src/base/cs_tpar1d.c
new file mode 100644
index 0000000..fd6d51f
--- /dev/null
+++ b/src/base/cs_tpar1d.c
@@ -0,0 +1,1047 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Modelling the thermal wall with 1D approach
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_restart.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_tpar1d.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure definitions
+ *============================================================================*/
+
+struct par1d
+{
+ cs_int_t n; /* Number of discretization points on the coupled face */
+ cs_real_t *z; /* Discretization points coordinates */
+ cs_real_t e; /* Thickness associated to the coupled face */
+ cs_real_t *t; /* Temperature at each point of discretization */
+};
+
+
+/*============================================================================
+ * Static global variable
+ *============================================================================*/
+
+static struct par1d *cs_glob_par1d = NULL;
+static cs_restart_t *cs_glob_tpar1d_suite = NULL;
+
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Allocate the cs_glob_par1d structure
+ *
+ * parameters:
+ * nfpt1d <- number of coupled boundary faces
+ * nppt1d <- number of discretization points on each coupled faces
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_loc_tpar1d_cree(cs_int_t nfpt1d,
+ const cs_int_t *nppt1d)
+{
+ cs_int_t nb_pts_tot;
+ cs_int_t i;
+
+ if (nfpt1d == 0)
+ return;
+
+ /* Allocate the cs_glob_par1d structure */
+ BFT_MALLOC(cs_glob_par1d, nfpt1d, struct par1d);
+
+ /* Initialization of the number of discretization points in each structure
+ Computation of the toatl number of discretization points */
+ nb_pts_tot = 0;
+
+ for (i = 0; i < nfpt1d; i++) {
+ cs_glob_par1d[i].n = nppt1d[i];
+ nb_pts_tot += nppt1d[i];
+ }
+
+ /* Allocate the "t" arrays: Temperature in each point of discretization
+ and the "z" arrays: Coordonnates of each point of discretization */
+
+ BFT_MALLOC(cs_glob_par1d->z, 2 * nb_pts_tot, cs_real_t);
+ cs_glob_par1d->t = cs_glob_par1d->z + nb_pts_tot;
+
+ for (i = 1; i < nfpt1d; i++) {
+ cs_glob_par1d[i].z = cs_glob_par1d[i-1].z + nppt1d[i-1];
+ cs_glob_par1d[i].t = cs_glob_par1d[i-1].t + nppt1d[i-1];
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Open the restart file associated to cs_tpar1d
+ * Allocate cs_glob_tpar1d_suite
+ *
+ * parameters:
+ * nomsui <- name of the restart file
+ * lngnom <- name length
+ * ireawr <- 1 for reading, 2 for writing
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_loc_tpar1d_opnsuite(const char *nomsui,
+ const cs_int_t *lngnom,
+ const cs_restart_mode_t ireawr)
+{
+ char *nombuf;
+
+ /* Name treatment for the C API */
+ nombuf = cs_base_string_f_to_c_create(nomsui, *lngnom);
+
+ cs_glob_tpar1d_suite = cs_restart_create(nombuf, ireawr);
+
+ /* Free the memory if necessary */
+ cs_base_string_f_to_c_free(&nombuf);
+}
+
+/*============================================================================
+ * Public functions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create the 1D mesh for each face and initialize the temperature
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE MAIT1D
+ * ******************
+ *
+ * INTEGER NFPT1D : <- : number of coupled faces
+ * INTEGER NPPT1D(NFPT1D) : <- : number of mesh points for each face
+ * DOUBLE PRECISION EPPT1D(NFPT1D) : <- : wall thickness for each face
+ * DOUBLE PRECISION RGPT1D(NFPT1D) : <- : mesh geometric ratio for each face
+ * DOUBLE PRECISION TPPT1D(NFPT1D) : <- : temperature initizalition value
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (mait1d,MAIT1D)
+(
+ cs_int_t *nf,
+ cs_int_t n[],
+ cs_real_t e[],
+ cs_real_t r[],
+ cs_real_t tp[]
+)
+{
+ cs_int_t i, k;
+ cs_real_t m, rr;
+ cs_real_t *zz;
+
+ /* Allocate the global structure: cs_glob_par1d and the number of
+ discretization points on each face */
+ cs_loc_tpar1d_cree(*nf, n);
+
+ /* Initialization of each coupled face thickness */
+ for (i = 0; i < *nf; i++) {
+ cs_glob_par1d[i].e = e[i];
+ }
+
+ for (i = 0; i < *nf; i++) {
+
+ /* Initialization of the Temperature */
+ for (k = 0; k<n[i]; k++) {
+ (cs_glob_par1d[i].t)[k] = tp[i];
+ }
+
+ /* Mesh */
+ zz = cs_glob_par1d[i].z;
+ rr = r[i];
+
+ /* Regular */
+ if (fabs(rr-1.0) <= 1.0e-6) {
+ zz[0] = e[i]/n[i]/2.;
+ for (k = 1; k < n[i]; k++) {
+ zz[k]=zz[k-1]+e[i]/n[i];
+ }
+ }
+
+ /* Geometric */
+ else {
+ m = e[i]*(1.0-rr)/(1.0-pow(rr,n[i]));
+ *zz = m/2.;
+ for (k = 1; k< n[i]; k++) {
+ zz[k] = zz[k-1]+m/2.;
+ m = m*rr;
+ zz[k] = zz[k]+m/2.;
+ }
+ }
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Solve the 1D equation for a given face
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TPAR1D
+ * ******************
+ *
+ * INTEGER II : <- : face number
+ * INTEGER ICLT1D : <- : type of exterior boundary condition
+ * DOUBLE PRECISION TBORD : <- : fluid temperature at the boundary
+ * DOUBLE PRECISION HBORD : <- : exchange coefficient for the fluid
+ * : : at the boundary
+ * DOUBLE PRECISION TET1D : <- : temperature on the exterior boundary
+ * : : (Dirichlet boundary condition)
+ * DOUBLE PRECISION HET1D : <- : exchange coefficient on the exterior wall
+ * DOUBLE PRECISION FET1D : <- : flux on the exterior wall
+ * : : (Neumann boundary condition)
+ * DOUBLE PRECISION LAMT1D : <- : conductivity (lambda)
+ * DOUBLE PRECISION RCPT1D : <- : rho*Cp product
+ * DOUBLE PRECISION DTPT1D : <-> : time-step for the solid resolution
+ * DOUBLE PRECISION TPPT1D : <-> : physical temperature at the fluid/solid
+ * : : interface
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tpar1d,TPAR1D)
+(
+ cs_int_t *ii,
+ cs_int_t *icdcle,
+ cs_real_t *tf,
+ cs_real_t *hf,
+ cs_real_t *te,
+ cs_real_t *he,
+ cs_real_t *fe,
+ cs_real_t *lb,
+ cs_real_t *rocp,
+ cs_real_t *dtf,
+ cs_real_t *tp
+)
+{
+ cs_int_t k;
+
+ cs_real_t a1; /* extrapolation coefficient for temperature1 */
+ cs_real_t h2; /* thermal exchange coefficient on T(1) */
+ cs_real_t f3; /* thermal flux on Tfluide */
+ cs_real_t a4; /* extrapolation coefficient for temperature4 */
+ cs_real_t h5; /* thermal exchange coefficient on T(n) */
+ cs_real_t f6; /* thermal flux on Text */
+
+ cs_real_t m;
+
+ cs_real_t *al, *bl, *cl, *dl;
+ cs_real_t *zz;
+ cs_int_t n;
+
+ n = cs_glob_par1d[*ii].n;
+
+ BFT_MALLOC(al, 4*n, cs_real_t);
+ bl = al+n;
+ cl = bl+n;
+ dl = cl+n;
+
+ zz = cs_glob_par1d[*ii].z;
+
+ /* Build the tri-diagonal matrix */
+
+ /* Boundary conditions on the fluid side: flux conservation */
+ /* flux in the fluid = flux in the solid = f3 + h2*T1 */
+ a1 = 1./(*hf)+zz[0]/(*lb);
+ h2 = -1./a1;
+ f3 = -h2*(*tf);
+
+ /* Boundary conditions on the exterior */
+ /* flux in the fluid = flux in the solid = f6 + h5*T(n-1) */
+
+ /* Dirichlet condition */
+ if (*icdcle == 1) {
+ a4 = 1./(*he)+(cs_glob_par1d[*ii].e - zz[n-1])/(*lb);
+ h5 = -1./a4;
+ f6 = -h5*(*te);
+ }
+ /* Forced flux condition */
+ else if (*icdcle == 3) {
+ h5 = 0.;
+ f6 = *fe;
+ }
+
+ /* Mesh interior points */
+ for (k=1; k <= n-1; k++) {
+ al[k] = -(*lb)/(zz[k]-zz[k-1]);
+ }
+
+ m = 2*zz[0];
+ for (k=1; k <= n-2; k++) {
+ m = 2*(zz[k]-zz[k-1])-m;
+ bl[k] = (*rocp)/(*dtf)*m +(*lb)/(zz[k+1]-zz[k]) +(*lb)/(zz[k]-zz[k-1]);
+ }
+
+ for (k=0; k <= n-2; k++) {
+ cl[k] = -(*lb)/(zz[k+1]-zz[k]);
+ }
+
+ m = 2*zz[0];
+ dl[0] = (*rocp)/(*dtf)*m*(cs_glob_par1d[*ii].t)[0];
+
+ for (k=1; k <= n-1; k++) {
+ m = 2*(zz[k]-zz[k-1])-m;
+ dl[k] = (*rocp)/(*dtf)*m*(cs_glob_par1d[*ii].t)[k];
+ }
+
+ /* Boundary points */
+ /* bl[0] and bl[n-1] are initialized here and set later,
+ in the case where 0 = n-1 */
+ bl[0] = 0.;
+ bl[n-1] = 0.;
+ al[0] = 0.;
+ bl[0] = bl[0] + (*rocp)/(*dtf)*2*zz[0] + (*lb)/(zz[1]-zz[0]) - h2;
+ cl[0] = cl[0];
+ dl[0] = dl[0] +f3;
+ al[n-1] = al[n-1];
+ bl[n-1] = bl[n-1] + (*rocp)/(*dtf)*2*(cs_glob_par1d[*ii].e-zz[n-1])
+ + (*lb)/(zz[n-1]-zz[n-2]) -h5;
+ cl[n-1] = 0.;
+ dl[n-1] = dl[n-1] +f6;
+
+ /* System resolution by a Cholesky method ("dual-scan") */
+ for (k=1; k<=n-1; k++) {
+ bl[k] = bl[k] -al[k]*cl[k-1]/bl[k-1];
+ dl[k] = dl[k] -al[k]*dl[k-1]/bl[k-1];
+ }
+
+ cs_glob_par1d[*ii].t[n-1] = dl[n-1]/bl[n-1];
+
+ for (k=n-2; k>=0; k--) {
+ cs_glob_par1d[*ii].t[k] = (dl[k] -cl[k]*cs_glob_par1d[*ii].t[k+1])/bl[k];
+ }
+
+
+ /* Compute the new value of tp */
+ *tp = (*hf)+(*lb)/zz[0];
+ *tp = 1/(*tp)*((*lb)*cs_glob_par1d[*ii].t[0]/zz[0]+(*hf)*(*tf));
+
+ BFT_FREE(al);
+}
+
+/*----------------------------------------------------------------------------
+ * Read the restart file of the 1D-wall thermal module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECT1D
+ * *****************
+ *
+ * CHARACTER NOMSUI : <-- : Name of the restart file
+ * INTEGER LNGNOM : <-- : Name length
+ * INTEGER NFPT1D : <-- : Number of coupled faces
+ * INTEGER NFPT1T : <-- : Total number of coupled faces
+ * INTEGER NMXT1D : <-- : Max number of points on the 1D meshes
+ * INTEGER NFABOR : <-- : Number of boundary faces
+ * INTEGER NPPT1D : <-- : Number of points of each face 1D-mesh
+ * INTEGER IFPT1D : <-- : Indirection array for 1D-module faces
+ * DOUBLE PRECISION EPPT1D : <-- : Wall thickness of each face
+ * DOUBLE PRECISION RGPT1D : <-- : Geometric reason associated to faces
+ * DOUBLE PRECISION TPPT1D : --> : Wall temperature
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lect1d,LECT1D)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom,
+ const cs_int_t *const nfpt1d,
+ const cs_int_t *const nfpt1t,
+ const cs_int_t *const nmxt1d,
+ const cs_int_t *const nfabor,
+ const cs_int_t *const nppt1d,
+ const cs_int_t *const ifpt1d,
+ const cs_real_t *const eppt1d,
+ const cs_real_t *const rgpt1d,
+ cs_real_t *const tppt1d
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ cs_bool_t corresp_cel, corresp_fac, corresp_fbr, corresp_som;
+ cs_int_t nbvent;
+ cs_int_t i, j, ifac, indfac, ierror;
+ cs_int_t version; /* Not used at the moment */
+
+ cs_restart_t *suite;
+ cs_restart_location_t support;
+ cs_type_t typ_val;
+
+
+ ierror = CS_RESTART_SUCCES;
+
+ /* Open the restart file */
+ cs_loc_tpar1d_opnsuite(nomsui,
+ lngnom,
+ CS_RESTART_MODE_READ);
+
+ if (cs_glob_tpar1d_suite == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Abort while opening the 1D-wall thermal module restart file "
+ "in read mode.\n"
+ "Verify the existence and the name of the restart file: %s\n"),
+ *nomsui);
+
+
+ /* Pointer to the global restart structure */
+ suite = cs_glob_tpar1d_suite;
+
+ /* Verification of the associated "support" to the restart file */
+ cs_restart_check_base_location(suite, &corresp_cel, &corresp_fac,
+ &corresp_fbr, &corresp_som);
+
+ /* Only boundary faces are of interest */
+ indfac = (corresp_fbr == true ? 1 : 0);
+ if (indfac == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Abort while reading the 1D-wall thermal module restart file.\n"
+ "The number of boundary faces has been modified\n"
+ "Verify that the restart file corresponds to "
+ "the present study.\n"));
+
+
+ { /* Read the header */
+ char nomrub[] = "version_fichier_suite_module_1d";
+ cs_int_t *tabvar;
+
+ BFT_MALLOC(tabvar, 1, cs_int_t);
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_NONE;
+ typ_val = CS_TYPE_cs_int_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** 1D-WALL THERMAL MODULE\n"
+ " INCORRECT FILE TYPE\n"
+ "\n"
+ "The file %s does not seem to be a restart file\n"
+ "for the 1D-wall thermal module.\n"
+ "The calculation will not be run.\n"
+ "\n"
+ "Verify that the restart file corresponds to a\n"
+ "restart file for the 1D-wall thermal module.\n"),
+ *nomsui);
+
+ version = *tabvar;
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Read the number of discretiaztion points and coherency checks
+ with the input data of USPT1D */
+ char nomrub[] = "nb_pts_discretis";
+ cs_int_t *tabvar;
+ cs_int_t mfpt1d, mfpt1t;
+ cs_int_t iok;
+
+ BFT_MALLOC(tabvar, *nfabor, cs_int_t);
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_int_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for the 1D-wall thermal module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ /* Coherency checks between the read NFPT1T and the one from USPT1D */
+ mfpt1d = 0;
+ for (ifac = 0; ifac < *nfabor; ifac++) {
+ if (tabvar[ifac] > 0) mfpt1d++;
+ }
+ mfpt1t = mfpt1d;
+ /* if necessary, sum over all the processors */
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Allreduce (&mfpt1d, &mfpt1t, 1, CS_MPI_INT, MPI_SUM,
+ cs_glob_mpi_comm);
+#endif
+ if (mfpt1t != *nfpt1t)
+ bft_error(__FILE__, __LINE__, 0,
+ _("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** 1D-WALL THERMAL MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The number of faces with 1D thermal module has\n"
+ "been modified.\n"
+ "PREVIOUS: %d boundary faces (total)\n"
+ "CURRENT: %d boundary faces (total)\n"
+ "\n"
+ "The calculation will not be run.\n"
+ "\n"
+ "Verify that the restart file corresponds to a\n"
+ "restart file for the 1D-wall thermal module.\n"
+ "Verify uspt1d.\n"), mfpt1t, *nfpt1t);
+
+ /* Coherency check between read NFPT1D/IFPT1D and the ones from USPT1D
+ One already knows that the number of faces are equal, it is then
+ enough to check that all selected faces in USPT1D were also
+ selected in the previous calculation */
+ iok = 0;
+ for (i = 0; i < *nfpt1d; i++){
+ ifac = ifpt1d[i]-1;
+ if (tabvar[ifac] != nppt1d[i]) iok++;
+ }
+ if (iok > 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** 1D-WALL THERMAL MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "IFPT1D or NPPT1D has been modified with respect\n"
+ "to the restart file on at least on face with\n"
+ "1D thermal module\n"
+ "\n"
+ "The calculation will not be run.\n"
+ "\n"
+ "Verify that the restart file correspond to\n"
+ "the present study.\n"
+ "Verify uspt1d\n"
+ "(refer to the user manual for the specificities\n"
+ "of the test on IFPT1D)"));
+
+ /* Allocate the cs_glob_par1d structure */
+
+ cs_loc_tpar1d_cree(*nfpt1d, nppt1d);
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Read the wall thickness and check the coherency with USPT1D*/
+ char nomrub[] = "epaisseur_paroi";
+ cs_real_t *tabvar;
+ cs_int_t iok;
+
+ BFT_MALLOC(tabvar, *nfabor, cs_real_t);
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for the 1D-wall thermal module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ /* Coherence check between the read EPPT1D and the one from USPT1D */
+ iok = 0;
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i]-1;
+ if (fabs(tabvar[ifac]-eppt1d[i])/eppt1d[i] > 1.e-10) iok++;
+ }
+ if (iok > 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** 1D-WALL THERMAL MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The parameter EPPT1D has been modified with respect\n"
+ "to the restart file on at least on face with\n"
+ "1D thermal module\n"
+ "\n"
+ "The calculation will not be run.\n"
+ "\n"
+ "Verify that the restart file corresponds to\n"
+ "the present study.\n"
+ "Verify uspt1d\n"));
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+ cs_glob_par1d[i].e = tabvar[ifac];
+ }
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Read the interior boundary temperature */
+ char nomrub[] = "temperature_bord_int";
+ cs_real_t *tabvar;
+
+ BFT_MALLOC(tabvar, *nfabor, cs_real_t);
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for the 1D-wall thermal module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+ tppt1d[i] = tabvar[ifac];
+ }
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Read the 1D-mesh coordinates */
+ char nomrub[] = "coords_maillages_1d";
+ cs_int_t nptmx;
+ cs_int_t iok;
+ cs_real_t *tabvar;
+ cs_real_t zz1, zz2, rrgpt1;
+
+ nptmx = (*nfabor) * (*nmxt1d);
+ BFT_MALLOC(tabvar, nptmx, cs_real_t);
+
+ nbvent = *nmxt1d;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for the 1D-wall thermal module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ /* Now one have the cell centers, RGPT1D can be tested */
+ iok = 0;
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i]-1;
+ if (nppt1d[i] > 1) {
+ zz1 = tabvar[0 + (*nmxt1d)*ifac];
+ zz2 = tabvar[1 + (*nmxt1d)*ifac];
+ rrgpt1 = (zz2-2.*zz1)/zz1;
+ if (fabs(rrgpt1-rgpt1d[i])/rgpt1d[i] > 1.e-10) iok++;
+ }
+ }
+
+ if (iok > 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** 1D-WALL THERMAL MODULE\n"
+ " CURRENT AND OLD DATA ARE DIFFERENT\n"
+ "\n"
+ "The parameter RGPT1D has been modified with respect\n"
+ "to the restart file on at least on face with\n"
+ "1D thermal module\n"
+ "\n"
+ "The calculation will not be run.\n"
+ "\n"
+ "Verify that the restart file correspond to\n"
+ "the present study\n"
+ "Verify uspt1d\n"));
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i]-1;
+ /* The array is filled until the number of discretization points of
+ the given face is reached */
+ for (j = 0; j < cs_glob_par1d[i].n; j++)
+ cs_glob_par1d[i].z[j] = tabvar[j + (*nmxt1d)*ifac];
+ }
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Read the wall temperature */
+ char nomrub[] = "temperature_interne";
+ cs_int_t nptmx;
+ cs_real_t *tabvar;
+
+ nptmx = (*nfabor) * (*nmxt1d);
+ BFT_MALLOC(tabvar, nptmx, cs_real_t);
+
+ nbvent = *nmxt1d;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES) {
+ cs_base_warn(__FILE__,__LINE__);
+ bft_printf(_("Problem while reading the section in the restart file\n"
+ "for the 1D-wall thermal module:\n"
+ "<%s>\n"), nomrub);
+ }
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+
+ /* The array is filled until the number of discretization points of
+ the given face is reached */
+ for (j = 0; j < cs_glob_par1d[i].n; j++)
+ cs_glob_par1d[i].t[j] = tabvar[j + (*nmxt1d)*ifac];
+
+ }
+
+ BFT_FREE(tabvar);
+ }
+
+ /* Close the restart file and free structures */
+ cs_restart_destroy(cs_glob_tpar1d_suite);
+ cs_glob_tpar1d_suite = NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Write the restart file of the 1D-wall thermal module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECT1D
+ * *****************
+ *
+ * CHARACTER NOMSUI : <-- : Name of the restart file
+ * INTEGER LNGNOM : <-- : Name length
+ * INTEGER NFPT1D : <-- : Number of coupled faces
+ * INTEGER NMXT1D : <-- : Max number of points on the 1D meshes
+ * INTEGER NFABOR : <-- : Number of boundary faces
+ * DOUBLE PRECISION TPPT1D : --> : Wall temperature
+ * INTEGER IFPT1D : <-- : Indirection array for 1D-module faces
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ecrt1d,ECRT1D)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom,
+ const cs_int_t *const nfpt1d,
+ const cs_int_t *const nmxt1d,
+ const cs_int_t *const nfabor,
+ const cs_real_t *const tppt1d,
+ const cs_int_t *const ifpt1d
+ CS_ARGF_SUPP_CHAINE
+)
+{
+ cs_int_t nbvent, ierror;
+ cs_int_t i, j, ifac;
+
+ cs_restart_t *suite;
+ cs_restart_location_t support;
+ cs_type_t typ_val;
+
+
+ ierror = CS_RESTART_SUCCES;
+
+ /* Open the restart file */
+ cs_loc_tpar1d_opnsuite(nomsui,
+ lngnom,
+ CS_RESTART_MODE_WRITE);
+
+ if (cs_glob_tpar1d_suite == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Abort while opening the 1D-wall thermal module restart "
+ "file in write mode.\n"
+ "Verify the existence and the name of the restart file: %s\n"),
+ *nomsui);
+
+
+ /* Pointer to the global restart structure */
+ suite = cs_glob_tpar1d_suite;
+
+ { /* Write the header */
+ char nomrub[] = "version_fichier_suite_module_1d";
+ cs_int_t *tabvar;
+
+ BFT_MALLOC(tabvar, 1, cs_int_t);
+
+ *tabvar = 120;
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_NONE;
+ typ_val = CS_TYPE_cs_int_t;
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Write the number of discretization points */
+ char nomrub[] = "nb_pts_discretis";
+ cs_int_t *tabvar;
+
+ BFT_MALLOC(tabvar, *nfabor, cs_int_t);
+
+ for (i = 0; i < *nfabor; i++)
+ tabvar[i] = 0;
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_int_t;
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+ tabvar[ifac] = cs_glob_par1d[i].n;
+ }
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Write the wall thickness */
+ char nomrub[] = "epaisseur_paroi";
+ cs_real_t *tabvar;
+
+ BFT_MALLOC(tabvar, *nfabor, cs_real_t);
+
+ for (i = 0; i < *nfabor; i++)
+ tabvar[i] = 0.0;
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+ tabvar[ifac] = cs_glob_par1d[i].e;
+ }
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Write the internal wall-boundary temperature */
+ char nomrub[] = "temperature_bord_int";
+ cs_real_t *tabvar;
+
+ BFT_MALLOC(tabvar, *nfabor, cs_real_t);
+
+ for (i = 0; i < *nfabor; i++)
+ tabvar[i] = 0.0;
+
+ nbvent = 1;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+ tabvar[ifac] = tppt1d[i];
+ }
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Write the 1D-mesh coordinates */
+ char nomrub[] = "coords_maillages_1d";
+ cs_int_t nptmx;
+ cs_real_t *tabvar;
+
+ nptmx = (*nfabor) * (*nmxt1d);
+ BFT_MALLOC(tabvar, nptmx, cs_real_t);
+
+ for (i = 0; i < nptmx; i++)
+ tabvar[i] = 0.0;
+
+ nbvent = *nmxt1d;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+
+ /* The array is filled until the number of discretization points of
+ the given face is reached (the following cases, up to nmxt1d, are
+ already set to 0 during the initalization of tabvar */
+ for (j = 0; j < cs_glob_par1d[i].n; j++)
+ tabvar[j + (*nmxt1d)*ifac] = cs_glob_par1d[i].z[j];
+ }
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Write the wall-interior temperature */
+ char nomrub[] = "temperature_interne";
+ cs_int_t nptmx;
+ cs_real_t *tabvar;
+
+ nptmx = (*nfabor) * (*nmxt1d);
+ BFT_MALLOC(tabvar, nptmx, cs_real_t);
+
+ for (i = 0; i < nptmx; i++)
+ tabvar[i] = 0.0;
+
+ nbvent = *nmxt1d;
+ support = CS_RESTART_LOCATION_B_FACE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ for (i = 0; i < *nfpt1d; i++) {
+ ifac = ifpt1d[i] - 1;
+
+ /* The array is filled until the number of discretization points of
+ the given face is reached (the following cases, up to nmxt1d, are
+ already set to 0 during the initalization of tabvar */
+ for (j = 0; j < cs_glob_par1d[i].n; j++)
+ tabvar[j + (*nmxt1d)*ifac] = cs_glob_par1d[i].t[j];
+
+ }
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+ /* Close the restart file and free structures */
+ cs_restart_destroy(cs_glob_tpar1d_suite);
+ cs_glob_tpar1d_suite = NULL;
+
+}
+
+
+/*----------------------------------------------------------------------------
+ * Free memory
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE LBRT1D ()
+ * ******************
+ *
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lbrt1d,LBRT1D)(void)
+{
+ BFT_FREE(cs_glob_par1d->z);
+ BFT_FREE(cs_glob_par1d);
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/cs_ventil.c b/src/base/cs_ventil.c
new file mode 100644
index 0000000..1764052
--- /dev/null
+++ b/src/base/cs_ventil.c
@@ -0,0 +1,1048 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of fans
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ventil.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local Type Definitions
+ *============================================================================*/
+
+/* Structure associated to a fan */
+
+struct _cs_ventil_t {
+
+ int num; /* Fan number */
+ int dim_modele; /* 1D, 2D, or 3D modelling */
+ int dim_ventil; /* 2D or 3D geometry */
+
+ cs_real_t coo_axe_amont[3]; /* Axis point coordinates of the
+ upstream face */
+ cs_real_t coo_axe_aval[3]; /* Axis point coordinates of the
+ downstrem face */
+ cs_real_t dir_axe[3]; /* Unit vector of the axis
+ (upstream to downstream) */
+ cs_real_t epaisseur; /* Fan thickness */
+ cs_real_t surface; /* Fan total surface */
+
+ cs_real_t ray_ventil; /* Fan radius */
+ cs_real_t ray_pales; /* Blades radius */
+ cs_real_t ray_moyeu; /* Hub radius */
+ cs_real_t coeff_carac[3]; /* Coefficients of the terms of
+ degree 0, 1 and 2 of the
+ characteristic curve */
+ cs_real_t couple_axial; /* Fan axial couple */
+
+ cs_int_t nbr_cel; /* Number of cells */
+
+ cs_int_t *lst_cel; /* List of the cells belonging
+ to the fan */
+
+ cs_real_t debit_entrant; /* Current inlet flow */
+ cs_real_t debit_sortant; /* Current outlet flow */
+
+} ;
+
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+/* Fans array */
+
+cs_int_t cs_glob_ventil_nbr_max = 0;
+
+cs_int_t cs_glob_ventil_nbr = 0;
+cs_ventil_t * * cs_glob_ventil_tab = NULL;
+
+
+/*============================================================================
+ * Macro definitions
+ *============================================================================*/
+
+enum {X, Y, Z} ;
+
+#define CS_LOC_PRODUIT_VECTORIEL(prod_vect, vect1, vect2) \
+ (prod_vect[X] = vect1[Y] * vect2[Z] - vect2[Y] * vect1[Z], \
+ prod_vect[Y] = vect2[X] * vect1[Z] - vect1[X] * vect2[Z], \
+ prod_vect[Z] = vect1[X] * vect2[Y] - vect2[X] * vect1[Y])
+
+#define CS_LOC_PRODUIT_SCALAIRE(vect1, vect2) \
+ (vect1[X] * vect2[X] + vect1[Y] * vect2[Y] + vect1[Z] * vect2[Z])
+
+#define CS_LOC_MODULE(vect) \
+ sqrt(vect[X] * vect[X] + vect[Y] * vect[Y] + vect[Z] * vect[Z])
+
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Mark the cells belonging to the different fans
+ * (by the fan number, 0 otherwise)
+ *
+ * parameters:
+ * mesh <-- associated mesh structure
+ * num_vtl_cel --> indicator by cell
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_loc_ventil_marque_cellules(const cs_mesh_t *const mesh,
+ cs_int_t num_vtl_cel[])
+{
+ cs_int_t icel;
+ cs_int_t ivtl;
+ cs_int_t iloc;
+
+ cs_ventil_t *ventil;
+
+ const cs_int_t nbr_cel_et = mesh->n_cells_with_ghosts;
+
+ /* Mark the cells */
+
+ for (icel = 0 ; icel < nbr_cel_et ; icel++)
+ num_vtl_cel[icel] = 0;
+
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+
+ ventil = cs_glob_ventil_tab[ivtl];
+
+ for (iloc = 0 ; iloc < ventil->nbr_cel ; iloc++) {
+ icel = ventil->lst_cel[iloc] - 1;
+ num_vtl_cel[icel] = ivtl + 1;
+ }
+
+ }
+
+}
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Get the number of fans.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TSTVTL
+ * *****************
+ *
+ * INTEGER NBRVTL : --> : number of fans
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tstvtl, TSTVTL)
+(
+ cs_int_t *const nbrvtl
+)
+{
+ *nbrvtl = cs_glob_ventil_nbr;
+}
+
+/*----------------------------------------------------------------------------
+ * Adds a fan.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DEFVTL
+ * *****************
+ *
+ * INTEGER DIMMOD : <-- : Fan model dimension:
+ * : : 1: constant_f; 2: force_profile;
+ * : : 3: force_profile + tangential couple
+ * DIMVTL : <-- : Fan dimension:
+ * : : 2: pseudo-2D (extruded mesh)
+ * : : 3: 3D (standard)
+ * DOUBLE PRECISION XYZVT1(3) : <-- : Coo. of the axis point in upstream face
+ * DOUBLE PRECISION XYZVT2(3) : <-- : Coo. of the axis point in downstream face
+ * DOUBLE PRECISION RVVT : <-- : Fan radius
+ * DOUBLE PRECISION RPVT : <-- : Blades radius
+ * DOUBLE PRECISION RMVT : <-- : Hub radius
+ * DOUBLE PRECISION CCARAC(3) : <-- : Coefficients of degre 0, 1 and 2
+ * : : of the characteristic curve
+ * DOUBLE PRECISION TAUVT : <-- : Fan axial couple
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (defvtl, DEFVTL)
+(
+ const cs_int_t *const dimmod,
+ const cs_int_t *const dimvtl,
+ const cs_real_t xyzvt1[3],
+ const cs_real_t xyzvt2[3],
+ const cs_real_t *const rvvt,
+ const cs_real_t *const rpvt,
+ const cs_real_t *const rmvt,
+ const cs_real_t ccarac[3],
+ const cs_real_t *const tauvt
+)
+{
+ cs_ventil_definit(*dimmod,
+ *dimvtl,
+ xyzvt1,
+ xyzvt2,
+ *rvvt,
+ *rpvt,
+ *rmvt,
+ ccarac,
+ *tauvt);
+}
+
+/*----------------------------------------------------------------------------
+ * Build the list of cells associated to the fans
+ *
+ * Fotrtran interface:
+ *
+ * SUBROUTINE INIVTL
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (inivtl, INIVTL)
+(
+ void
+)
+{
+ cs_ventil_cree_listes(cs_glob_mesh,
+ cs_glob_mesh_quantities);
+}
+
+/*----------------------------------------------------------------------------
+ * Mark the fans and associate the fan number to the cells belonging to
+ * thus fan, 0 otherwise.
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE NUMVTL (INDIC)
+ * *****************
+ *
+ * INTEGER INDIC(NCELET) : --> : Fan number (0 if outside the fan)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (numvtl, NUMVTL)
+(
+ cs_int_t indic[]
+)
+{
+ cs_loc_ventil_marque_cellules(cs_glob_mesh,
+ indic);
+}
+
+/*----------------------------------------------------------------------------
+ * Calculate the flows through the fans
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DEBVTL
+ * *****************
+ *
+ * DOUBLE PRECISION FLUMAS(*) : <-- : Interior faces mass flux
+ * DOUBLE PRECISION FLUMAB(*) : <-- : Boundary faces mass flux
+ * DOUBLE PRECISION RHO (*) : <-- : Density at cells
+ * DOUBLE PRECISION RHOFAB(*) : <-- : Density at boundary faces
+ * DOUBLE PRECISION DEBENT(NBRVTL) : --> : Inlet flow through the fan
+ * DOUBLE PRECISION DEBSOR(NBRVTL) : --> : Outlet flow through the fan
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (debvtl, DEBVTL)
+(
+ cs_real_t flumas[],
+ cs_real_t flumab[],
+ cs_real_t rho[],
+ cs_real_t rhofab[],
+ cs_real_t debent[],
+ cs_real_t debsor[]
+)
+{
+ int i;
+
+ cs_ventil_calcul_debits(cs_glob_mesh,
+ cs_glob_mesh_quantities,
+ flumas,
+ flumab,
+ rho,
+ rhofab);
+
+ for (i = 0 ; i < cs_glob_ventil_nbr ; i++) {
+ debent[i] = cs_glob_ventil_tab[i]->debit_entrant;
+ debsor[i] = cs_glob_ventil_tab[i]->debit_sortant;
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Calculate the force induced by the fans (needs a previous calculation
+ * of the flows through each fan).
+ *
+ * The induced force is added to the array CRVXEP (which can have other
+ * other contributions).
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TSVVTL (DEBENT, DEBSOR)
+ * *****************
+ *
+ * INTEGER IDIMTS : <-- : Dimension associated to the source
+ * : : term of velocity (1: X; 2: Y; 3: Z)
+ * DOUBLE PRECISION CRVEXP(NCELET) : <-> : Explicit source term (velocity)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tsvvtl, TSVVTL)
+(
+ cs_int_t *idimts,
+ cs_real_t crvexp[]
+)
+{
+ cs_ventil_calcul_force(cs_glob_mesh_quantities,
+ (*idimts) - 1,
+ crvexp);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Fan definition (added to the ones previously defined)
+ *
+ * parameters:
+ * dim_modele <-- Fan model dimension:
+ * 1: constant_f
+ * 2: force_profile
+ * 3: force_profile + tangential couple
+ * dim_ventil <-- Fan dimension:
+ * 2: pseudo-2D (extruded mesh)
+ * 3: 3D (standard)
+ * coo_axe_amont <-- Coo. of the axis point in upstream face
+ * coo_axe_aval <-- Coo. of the axis point in downstream face
+ * ray_ventil <-- Fan radius
+ * ray_pales <-- Blades radius
+ * ray_moyeu <-- Hub radius
+ * coeff_carac <-- Coefficients of degre 0, 1 and 2 of
+ the characteristic curve
+ * couple_axial <-- Fan axial couple
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_definit(const cs_int_t dim_modele,
+ const cs_int_t dim_ventil,
+ const cs_real_t coo_axe_amont[3],
+ const cs_real_t coo_axe_aval[3],
+ const cs_real_t ray_ventil,
+ const cs_real_t ray_pales,
+ const cs_real_t ray_moyeu,
+ const cs_real_t coeff_carac[3],
+ const cs_real_t couple_axial)
+{
+ int i;
+
+ cs_ventil_t *ventil = NULL;
+
+ /* Define a new fan */
+
+ BFT_MALLOC(ventil, 1, cs_ventil_t);
+
+ ventil->num = cs_glob_ventil_nbr + 1;
+
+ ventil->dim_modele = dim_modele;
+ ventil->dim_ventil = dim_ventil;
+
+ for (i = 0 ; i < 3 ; i++) {
+ ventil->coo_axe_amont[i] = coo_axe_amont[i];
+ ventil->coo_axe_aval[i] = coo_axe_aval[i];
+ }
+
+ ventil->ray_ventil = ray_ventil;
+ ventil->ray_pales = ray_pales;
+ ventil->ray_moyeu = ray_moyeu;
+
+ for (i = 0 ; i < 3 ; i++)
+ ventil->coeff_carac[i] = coeff_carac[i];
+ ventil->couple_axial = couple_axial;
+
+ ventil->nbr_cel = 0;
+ ventil->lst_cel = NULL;
+
+ /* Compute the axis vector */
+
+ ventil->epaisseur = 0.0;
+
+ for (i = 0 ; i < 3 ; i++) {
+ ventil->dir_axe[i] = coo_axe_aval[i] - coo_axe_amont[i];
+ ventil->epaisseur += (ventil->dir_axe[i] * ventil->dir_axe[i]);
+ }
+ ventil->epaisseur = sqrt(ventil->epaisseur);
+
+ for (i = 0 ; i < 3 ; i++)
+ ventil->dir_axe[i] /= ventil->epaisseur;
+
+ /* Surface initialized to 0, will be set by cs_ventil_cree_listes */
+
+ ventil->surface = 0.0;
+
+ /* Flows initialized to 0 */
+
+ ventil->debit_entrant = 0.0;
+ ventil->debit_sortant = 0.0;
+
+ /* Increase the fans array if necessary */
+
+ if (cs_glob_ventil_nbr == cs_glob_ventil_nbr_max) {
+ cs_glob_ventil_nbr_max = (cs_glob_ventil_nbr_max + 1) * 2;
+ BFT_REALLOC(cs_glob_ventil_tab, cs_glob_ventil_nbr_max, cs_ventil_t *);
+ }
+
+ /* Adds in the fans array */
+
+ cs_glob_ventil_tab[cs_glob_ventil_nbr] = ventil;
+ cs_glob_ventil_nbr += 1;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy the structures associated to fans
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_detruit_tous(void)
+{
+ int i;
+
+ cs_ventil_t *ventil = NULL;
+
+ for (i = 0 ; i < cs_glob_ventil_nbr ; i++) {
+
+ ventil = cs_glob_ventil_tab[i];
+
+ BFT_FREE(ventil->lst_cel);
+
+ BFT_FREE(ventil);
+
+ }
+
+ cs_glob_ventil_nbr_max = 0;
+ cs_glob_ventil_nbr = 0;
+ BFT_FREE(cs_glob_ventil_tab);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Looks for the cells belonging to the different fans.
+ *
+ * parameters:
+ * mesh <-- associated mesh structure
+ * mesh_quantities <-- mesh quantities
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_cree_listes(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities)
+{
+ cs_int_t icel, icel_1, icel_2;
+ cs_int_t ifac;
+ cs_int_t ivtl;
+ cs_int_t idim;
+
+ cs_real_t coo_axe;
+ cs_real_t d_2_axe;
+ cs_real_t d_cel_axe[3];
+ cs_real_t surf_loc;
+
+ cs_ventil_t *ventil = NULL;
+ cs_int_t *cpt_cel_vtl = NULL;
+ cs_int_t *num_vtl_cel = NULL;
+
+ const cs_int_t nbr_cel_et = mesh->n_cells_with_ghosts;
+ const cs_int_t *fac_cel = mesh->i_face_cells;
+ const cs_int_t *fbr_cel = mesh->b_face_cells;
+ const cs_real_t *coo_cen = mesh_quantities->cell_cen;
+ const cs_real_t *surf_fac = mesh_quantities->i_face_normal;
+ const cs_real_t *surf_fbr = mesh_quantities->b_face_normal;
+
+ /* Create an array for cells marking */
+ /*-----------------------------------*/
+
+ BFT_MALLOC(num_vtl_cel, nbr_cel_et, cs_int_t);
+
+ for (icel = 0 ; icel < nbr_cel_et ; icel++)
+ num_vtl_cel[icel] = 0;
+
+ /* Main loop on cells */
+
+ for (icel = 0 ; icel < nbr_cel_et ; icel++) {
+
+ /* Loop on fans */
+
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+
+ ventil = cs_glob_ventil_tab[ivtl];
+
+ /* Vector from the downstream face axis point to the cell centre */
+
+ for (idim = 0 ; idim < 3 ; idim++) {
+ d_cel_axe[idim] = (coo_cen[icel*3 + idim])
+ - ventil->coo_axe_amont[idim];
+ }
+
+ /* Dot product with the axis vector */
+
+ coo_axe = ( d_cel_axe[0] * ventil->dir_axe[0]
+ + d_cel_axe[1] * ventil->dir_axe[1]
+ + d_cel_axe[2] * ventil->dir_axe[2]);
+
+ /* Cell potentially in the fan if its centre projection on the axis
+ is within the thickness */
+
+ if (coo_axe >= 0.0 && coo_axe <= ventil->epaisseur) {
+
+ /* Projection of the vector from the downstream face axis point
+ to the cell centre in the fan plane */
+
+ for (idim = 0 ; idim < 3 ; idim++)
+ d_cel_axe[idim] -= coo_axe * ventil->dir_axe[idim];
+
+ /* Square distance to the axis */
+
+ d_2_axe = ( d_cel_axe[0] * d_cel_axe[0]
+ + d_cel_axe[1] * d_cel_axe[1]
+ + d_cel_axe[2] * d_cel_axe[2]);
+
+ /* If the cell is in the fan */
+
+ if (d_2_axe <= ventil->ray_ventil * ventil->ray_ventil) {
+
+ num_vtl_cel[icel] = ivtl + 1;
+ ventil->nbr_cel += 1;
+ break;
+
+ }
+
+ }
+
+ } /* End of loop on fans */
+
+ } /* End of main loop on cells */
+
+ /* Create the lists of cells belonging to each fan */
+ /*-------------------------------------------------*/
+
+ BFT_MALLOC(cpt_cel_vtl, cs_glob_ventil_nbr, cs_int_t);
+
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+
+ ventil = cs_glob_ventil_tab[ivtl];
+ BFT_MALLOC(ventil->lst_cel, ventil->nbr_cel, cs_int_t);
+
+ cpt_cel_vtl[ivtl] = 0;
+ }
+
+ for (icel = 0 ; icel < nbr_cel_et ; icel++) {
+
+ if (num_vtl_cel[icel] > 0) {
+ ivtl = num_vtl_cel[icel] - 1;
+ ventil = cs_glob_ventil_tab[ivtl];
+ ventil->lst_cel[cpt_cel_vtl[ivtl]] = icel + 1;
+ cpt_cel_vtl[ivtl] += 1;
+ }
+
+ }
+
+#if defined(DEBUG) && !defined(NDEBUG)
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+ ventil = cs_glob_ventil_tab[ivtl];
+ assert(cpt_cel_vtl[ivtl] == ventil->nbr_cel);
+ }
+#endif
+
+ /* Compute each fan surface */
+ /*--------------------------*/
+
+ /* Contribution to the domain interior */
+
+ for (ifac = 0 ; ifac < mesh->n_i_faces ; ifac++) {
+
+ icel_1 = fac_cel[ifac * 2] - 1;
+ icel_2 = fac_cel[ifac * 2 + 1] - 1;
+
+ if ( icel_1 < mesh->n_cells /* Make sure the contrib is from one domain */
+ && num_vtl_cel[icel_1] != num_vtl_cel[icel_2]) {
+
+ surf_loc = CS_LOC_MODULE((surf_fac + 3*ifac));
+ if (num_vtl_cel[icel_1] > 0) {
+ ivtl = num_vtl_cel[icel_1] - 1;
+ ventil = cs_glob_ventil_tab[ivtl];
+ ventil->surface += surf_loc;
+ }
+ if (num_vtl_cel[icel_2] > 0) {
+ ivtl = num_vtl_cel[icel_2] - 1;
+ ventil = cs_glob_ventil_tab[ivtl];
+ ventil->surface += surf_loc;
+ }
+ }
+
+ }
+
+ /* Contribution to the domain boundary */
+
+ for (ifac = 0 ; ifac < mesh->n_b_faces ; ifac++) {
+
+ if (num_vtl_cel[fbr_cel[ifac] - 1] > 0) {
+ surf_loc = CS_LOC_MODULE((surf_fbr + 3*ifac));
+ ivtl = num_vtl_cel[fbr_cel[ifac] - 1] - 1;
+ ventil = cs_glob_ventil_tab[ivtl];
+ ventil->surface += surf_loc;
+ }
+
+ }
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+ cs_real_t surf_glob;
+
+ surf_loc = (cs_glob_ventil_tab[ivtl])->surface;
+ MPI_Allreduce (&surf_loc, &surf_glob, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ (cs_glob_ventil_tab[ivtl])->surface = surf_glob;
+ }
+
+ }
+#endif
+
+ /* Free memory */
+
+ BFT_FREE(cpt_cel_vtl);
+ BFT_FREE(num_vtl_cel);
+}
+
+
+#if 0
+/*----------------------------------------------------------------------------
+ * Creates a post-processing mesh corresponding to the fans boundary faces
+ *
+ * parameters:
+ * mesh <-- mesh structure
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_cree_coupe(const cs_mesh_t *mesh)
+{
+ cs_int_t icel_1, icel_2;
+ cs_int_t ifac;
+
+ cs_int_t cpt_fac = 0;
+ cs_int_t cpt_fbr = 0;
+
+ cs_int_t *num_vtl_cel = NULL;
+ cs_int_t *liste_fac = NULL;
+ cs_int_t *liste_fbr = NULL;
+
+ const cs_int_t nbr_cel_et = mesh->n_cells_with_ghosts;
+ const cs_int_t nbr_fac = mesh->n_i_faces;
+ const cs_int_t nbr_fbr = mesh->n_b_faces;
+ const cs_int_t *fac_cel = mesh->i_face_cells;
+ const cs_int_t *fbr_cel = mesh->b_face_cells;
+
+ /* Mark cells and faces */
+
+ BFT_MALLOC(num_vtl_cel, nbr_cel_et, cs_int_t);
+ BFT_MALLOC(liste_fac, nbr_fac, cs_int_t);
+ BFT_MALLOC(liste_fbr, nbr_fbr, cs_int_t);
+
+ cs_loc_ventil_marque_cellules(mesh,
+ num_vtl_cel);
+
+ /* Contribution to the domain interior */
+
+ for (ifac = 0 ; ifac < nbr_fac ; ifac++) {
+
+ icel_1 = fac_cel[ifac * 2] - 1;
+ icel_2 = fac_cel[ifac * 2 + 1] - 1;
+
+ if (num_vtl_cel[icel_1] != num_vtl_cel[icel_2])
+ liste_fac[cpt_fac++] = ifac;
+
+ }
+
+ /* Contribution to the domain boundary */
+
+ for (ifac = 0 ; ifac < nbr_fbr ; ifac++) {
+
+ if (num_vtl_cel[fbr_cel[ifac] - 1] > 0)
+ liste_fbr[cpt_fbr++] = ifac;
+
+ }
+
+ /* Free memory */
+
+ BFT_FREE(num_vtl_cel);
+ BFT_FREE(liste_fac);
+ BFT_FREE(liste_fbr);
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ * Calculate the flows through the fans
+ *
+ * parameters:
+ * mesh <-- mesh structure
+ * mesh_qantities <-- mesh quantities
+ * flux_masse_fac <-- interior faces mass flux
+ * flux_masse_fbr <-- boundary faces mass flux
+ * densite_cel <-- density at cells
+ * densite_fbr <-- density at boundary faces
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_calcul_debits(const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities,
+ const cs_real_t flux_masse_fac[],
+ const cs_real_t flux_masse_fbr[],
+ const cs_real_t densite_cel[],
+ const cs_real_t densite_fbr[])
+{
+ cs_int_t icel, icel_1, icel_2;
+ cs_int_t ifac;
+ cs_int_t ivtl;
+ cs_int_t idim;
+ cs_int_t i, sens;
+
+ cs_real_t debit;
+ cs_real_t orient[3];
+
+ cs_ventil_t *ventil = NULL;
+ cs_int_t *num_vtl_cel = NULL;
+
+ const cs_int_t nbr_cel_et = mesh->n_cells_with_ghosts;
+ const cs_int_t nbr_fac = mesh->n_i_faces;
+ const cs_int_t nbr_fbr = mesh->n_b_faces;
+ const cs_real_t *coo_cen = mesh_quantities->cell_cen;
+ const cs_int_t *fac_cel = mesh->i_face_cells;
+ const cs_int_t *fbr_cel = mesh->b_face_cells;
+
+ /* Mark the cells */
+
+ BFT_MALLOC(num_vtl_cel, nbr_cel_et, cs_int_t);
+
+ cs_loc_ventil_marque_cellules(mesh,
+ num_vtl_cel);
+
+ /* Set the fans flows to zero */
+
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+ ventil = cs_glob_ventil_tab[ivtl];
+ ventil->debit_entrant = 0.0;
+ ventil->debit_sortant = 0.0;
+ }
+
+ /* Contribution to the domain interior */
+
+ for (ifac = 0 ; ifac < nbr_fac ; ifac++) {
+
+ icel_1 = fac_cel[ifac * 2] - 1;
+ icel_2 = fac_cel[ifac * 2 + 1] - 1;
+
+ if ( icel_1 < mesh->n_cells /* Make sure the contrib is from one domain */
+ && num_vtl_cel[icel_1] != num_vtl_cel[icel_2]) {
+
+ for (idim = 0 ; idim < 3 ; idim++)
+ orient[idim] = coo_cen[icel_2*3 + idim] - coo_cen[icel_1*3 + idim];
+
+ for (i = 0 ; i < 2 ; i++) {
+
+ icel = fac_cel[ifac * 2 + i] - 1;
+ ivtl = num_vtl_cel[icel] - 1;
+
+ if (ivtl > -1) {
+ ventil = cs_glob_ventil_tab[ivtl];
+ debit = flux_masse_fac[ifac]/densite_cel[icel];
+ sens = (i == 0 ? 1 : - 1);
+ if (CS_LOC_PRODUIT_SCALAIRE(ventil->dir_axe, orient) * sens > 0.0)
+ ventil->debit_sortant += debit;
+ else
+ ventil->debit_entrant += debit;
+ }
+
+ }
+
+ }
+
+ }
+
+ /* Contribution to the domain boundary */
+
+ for (ifac = 0 ; ifac < nbr_fbr ; ifac++) {
+
+ ivtl = num_vtl_cel[fbr_cel[ifac] - 1] - 1;
+
+ if (ivtl > -1) {
+
+ ventil = cs_glob_ventil_tab[ivtl];
+
+ for (idim = 0 ; idim < 3 ; idim++)
+ orient[idim] = mesh_quantities->b_face_normal[ifac * 3 + idim];
+
+ debit = flux_masse_fbr[ifac]/densite_fbr[ifac];
+ if (CS_LOC_PRODUIT_SCALAIRE(ventil->dir_axe, orient) > 0.0)
+ ventil->debit_sortant += debit;
+ else
+ ventil->debit_entrant += debit;
+
+ }
+
+ }
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+
+ cs_real_t debit_glob[2];
+ cs_real_t debit_loc[2];
+
+ ventil = cs_glob_ventil_tab[ivtl];
+
+ debit_loc[0] = ventil->debit_sortant;
+ debit_loc[1] = ventil->debit_entrant;
+
+ MPI_Allreduce (debit_loc, debit_glob, 2, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+
+ ventil->debit_sortant = debit_glob[0];
+ ventil->debit_entrant = debit_glob[1];
+
+ }
+
+ }
+#endif
+
+ /* In 2D, the flow is normalized by the surface */
+
+ if (ventil->dim_ventil == 2) {
+ cs_real_t surf_2d;
+ surf_2d = (0.5*ventil->surface - 2*ventil->ray_ventil*ventil->epaisseur)
+ / (2*ventil->ray_ventil+ventil->epaisseur);
+ ventil->debit_sortant = ventil->debit_sortant / surf_2d;
+ ventil->debit_entrant = ventil->debit_entrant / surf_2d;
+ }
+
+ /* Free memory */
+
+ BFT_FREE(num_vtl_cel);
+}
+
+/*----------------------------------------------------------------------------
+ * Calculate the force induced by the fans (needs a previous calculation
+ * of the flows through each fan).
+ *
+ * The induced force is added to the array CRVXEP (which can have other
+ * other contributions).
+ *
+ * parameters:
+ * mesh_quantities <-- mesh quantities
+ * idim_source <-- Dimension associated to the source term of velocity
+ * (1: X; 2: Y; 3: Z)
+ * t_source <-> Explicit source term for the velocity
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ventil_calcul_force(const cs_mesh_quantities_t *mesh_quantities,
+ const cs_int_t idim_source,
+ cs_real_t t_source[])
+{
+ cs_int_t icel, iloc;
+ cs_int_t ivtl;
+ cs_int_t idim;
+
+ cs_real_t f_z, f_theta;
+ cs_real_t f_rot[3];
+
+ const cs_real_t *coo_cen = mesh_quantities->cell_cen;
+ const cs_real_t pi = 3.14159265358979323846;
+
+ /* Compute the force induced by fans */
+
+ /* Loop on fans */
+ /*--------------*/
+
+ for (ivtl = 0 ; ivtl < cs_glob_ventil_nbr ; ivtl++) {
+
+ const cs_ventil_t *ventil = cs_glob_ventil_tab[ivtl];
+
+ const cs_real_t ray_moyeu = ventil->ray_moyeu;
+ const cs_real_t ray_pales = ventil->ray_pales;
+ const cs_real_t ray_ventil = ventil->ray_ventil;
+
+ const cs_real_t debit_moy = 0.5 * ( ventil->debit_sortant
+ - ventil->debit_entrant);
+
+ const cs_real_t delta_p = - (ventil->coeff_carac[2] * debit_moy*debit_moy)
+ + (ventil->coeff_carac[1] * debit_moy)
+ + (ventil->coeff_carac[0]);
+
+ /* Loop on fan cells */
+ /*-------------------*/
+
+ for (iloc = 0 ; iloc < ventil->nbr_cel ; iloc++) {
+
+ icel = ventil->lst_cel[iloc] - 1;
+
+ f_z = 0.0;
+ f_theta = 0.0;
+ f_rot[0] = 0.0, f_rot[1] = 0.0, f_rot[2] = 0.0;
+
+ if (ray_pales < 1.0e-12 && ray_moyeu < 1.0e-12) {
+
+ f_z = delta_p / ventil->epaisseur;
+ f_theta = 0.0;
+
+ }
+ else if (ray_moyeu < ray_pales) {
+
+ cs_real_t r_1, r_2, aux, aux_1, aux_2, coo_axe, d_axe, d_cel_axe[3];
+
+ r_1 = 0.7 * ventil->ray_pales;
+ r_2 = 0.85 * ventil->ray_pales;
+
+ if (ventil->dim_ventil == 2) {
+ aux_1 = (delta_p * 2.0 * ray_ventil)
+ / (ventil->epaisseur * (1.15*ray_pales - ray_moyeu));
+ aux_2 = 0.0;
+ }
+ else {
+ cs_real_t f_base;
+ const cs_real_t ray_moyeu3 = ray_moyeu * ray_moyeu * ray_moyeu;
+ const cs_real_t ray_pales3 = ray_pales * ray_pales * ray_pales;
+ const cs_real_t ray_pales2 = ray_pales * ray_pales;
+ const cs_real_t ray_ventil2 = ray_ventil * ray_ventil;
+ f_base = (0.7*ray_pales - ray_moyeu)
+ / (1.0470*ventil->epaisseur * ( ray_moyeu3
+ + 1.4560*ray_pales3
+ - 2.570*ray_pales2*ray_moyeu));
+ aux_1 = f_base * delta_p * pi * ray_ventil2;
+ aux_2 = f_base * ventil->couple_axial;
+ }
+
+ /* Vector from the downstream face axis point to the cell centre */
+
+ for (idim = 0 ; idim < 3 ; idim++) {
+ d_cel_axe[idim] = (coo_cen[icel*3 + idim])
+ - ventil->coo_axe_amont[idim];
+ }
+
+ /* Projection of the cell centre on the fan axis */
+
+ coo_axe = ( d_cel_axe[0] * ventil->dir_axe[0]
+ + d_cel_axe[1] * ventil->dir_axe[1]
+ + d_cel_axe[2] * ventil->dir_axe[2]);
+
+ /* Projection of the vector from the downstream face axis point
+ to the cell centre in the fan plane */
+
+ for (idim = 0 ; idim < 3 ; idim++)
+ d_cel_axe[idim] -= coo_axe * ventil->dir_axe[idim];
+
+ d_axe = CS_LOC_MODULE(d_cel_axe); /* Distance to the axis */
+
+ CS_LOC_PRODUIT_VECTORIEL(f_rot, ventil->dir_axe, d_cel_axe);
+
+ aux = CS_LOC_MODULE(f_rot);
+ for (idim = 0 ; idim < 3 ; idim++)
+ f_rot[idim] /= aux;
+
+ if (d_axe < ray_moyeu) {
+ f_z = 0.0;
+ f_theta = 0.0;
+ }
+ else if (d_axe < r_1) {
+ f_z = aux_1 * (d_axe - ray_moyeu) / (r_1 - ray_moyeu);
+ f_theta = aux_2 * (d_axe - ray_moyeu) / (r_1 - ray_moyeu);
+ }
+ else if (d_axe < r_2) {
+ f_z = aux_1;
+ f_theta = aux_2;
+ }
+ else if (d_axe < ray_pales) {
+ f_z = aux_1 * (ray_pales - d_axe) / (ray_pales - r_2);
+ f_theta = aux_2 * (ray_pales - d_axe) / (ray_pales - r_2);
+ }
+ else {
+ f_z = 0.0;
+ f_theta = 0.0;
+ }
+
+ }
+
+ t_source[icel] += (f_z * ventil->dir_axe[idim_source])
+ + (f_theta * f_rot[idim_source]);
+
+ } /* End of loop on fan cells */
+
+ } /* End of loop on fans */
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/csc2cl.f90 b/src/base/csc2cl.f90
new file mode 100644
index 0000000..66fb379
--- /dev/null
+++ b/src/base/csc2cl.f90
@@ -0,0 +1,385 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine csc2cl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nvcp , nvcpto , nfbcpl , nfbncp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ lfbcpl , lfbncp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rvcpfb , pndcpl , dofcpl , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! TRADUCTION DE LA CONDITION ITYPFB(*,*) = ICSCPL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! ! ! ! = 10 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle non bloquee : !
+! ! ! ! prescrire une valeur de dirichlet en !
+! ! ! ! prevision pour les scalaires k, eps, !
+! ! ! ! scal en plus du neumann usuel !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer nvcp , nvcpto
+integer nfbcpl , nfbncp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer lfbcpl(nfbcpl) , lfbncp(nfbncp)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rvcpfb(nfbcpl,nvcpto), pndcpl(nfbcpl)
+double precision dofcpl(3,nfbcpl)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+
+integer idebia, idebra
+integer ifac, iel,isou, iphas
+integer inc, iccocg, iphydp, iclvar, nswrgp, imligp
+integer iwarnp, ivar
+integer ipt
+integer iii
+
+double precision epsrgp, climgp, extrap
+double precision xp
+double precision xip , xiip , yiip , ziip
+double precision xjp
+double precision xipf, yipf, zipf, ipf
+
+double precision xif, yif, zif, xopf, yopf, zopf
+double precision gradi
+
+!===============================================================================
+
+
+idebia = idbia0
+idebra = idbra0
+
+
+!================================================================================
+! 1. TRADUCTION DU COUPLAGE EN TERMES DE CONDITIONS AUX LIMITES
+!================================================================================
+
+! On rappelle que les variables sont re�ues dans l'ordre de VARPOS ;
+! il suffit dont de boucler sur les variables.
+
+do ivar = 1, nvcp
+
+! --- Calcul du gradient de la variable si celle-ci est interpol�e
+! Les �changes pour le parall�lisme et la p�diocit� (PARCOM
+! et PERCOM) ont d�j� �t� fait dans CSCPFB.
+! Inutile de les refaire.
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+
+ iclvar = iclrtp(ivar,icoef)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! --- Traduction en termes de condition limite pour les faces de bord localis�es
+! --> CL type Dirichlet
+
+ do ipt = 1, nfbcpl
+
+ ifac = lfbcpl(ipt)
+ iel = ifabor(ifac)
+
+! Information de l'instance en cours interpol�e en I'
+ iii = idiipb-1+3*(ifac-1)
+ xiip = ra(iii+1)
+ yiip = ra(iii+2)
+ ziip = ra(iii+3)
+
+ xif = cdgfbo(1,ifac) -xyzcen(1,iel)
+ yif = cdgfbo(2,ifac) -xyzcen(2,iel)
+ zif = cdgfbo(3,ifac) -xyzcen(3,iel)
+
+ xipf = cdgfbo(1,ifac)-xiip - xyzcen(1,iel)
+ yipf = cdgfbo(2,ifac)-yiip - xyzcen(2,iel)
+ zipf = cdgfbo(3,ifac)-ziip - xyzcen(3,iel)
+
+ ipf = sqrt(xipf**2+yipf**2+zipf**2)
+
+
+ iii = idiipb-1+3*(ifac-1)
+ xiip = ra(iii+1)
+ yiip = ra(iii+2)
+ ziip = ra(iii+3)
+
+ xopf = dofcpl(1,ipt)
+ yopf = dofcpl(2,ipt)
+ zopf = dofcpl(3,ipt)
+
+! Informations locales interpolees en I'/O'
+
+ xip = rtp(iel,ivar) &
+ + (w1(iel)*(xiip+xopf) + w2(iel)*(yiip+yopf) + &
+ w3(iel)*(ziip+zopf))
+
+! Informations recues de l'instance distante en J'/O'
+ xjp = rvcpfb(ipt,ivar)
+
+
+ gradi = (w1(iel)*xipf+w2(iel)*yipf+w3(iel)*zipf)/ipf
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = icscpl
+ enddo
+
+ if(ivar.ne.ipr(1)) then
+ icodcl(ifac,ivar ) = 1
+ rcodcl(ifac,ivar,1) = 0.5d0*(xip+xjp)
+ else
+ icodcl(ifac,ivar ) = 3
+ rcodcl(ifac,ivar,3) = -0.5d0*dt(iel)*(gradi+xjp)
+ endif
+
+
+ enddo
+
+! --- Faces de bord non localis�es
+! --> CL type Neumann homog�ne
+
+ do ipt = 1, nfbncp
+
+ ifac = lfbncp(ipt)
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = icscpl
+ enddo
+
+ icodcl(ifac,ivar ) = 3
+ rcodcl(ifac,ivar,3) = 0.d0
+
+ enddo
+
+enddo
+
+
+!----
+! FORMAT
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/csc2ts.f90 b/src/base/csc2ts.f90
new file mode 100644
index 0000000..781dcd6
--- /dev/null
+++ b/src/base/csc2ts.f90
@@ -0,0 +1,232 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine csc2ts &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncecpl, &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lcecpl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ crvexp , crvimp , &
+ dam , xam , &
+ rvcpce , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de variable !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
+! crvimp(ncelet ! tr ! --> ! tableau de travail pour part implicit !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , iphas
+integer ncecpl
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lcecpl(ncecpl)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision dam(ncelet ),xam(nfac ,2)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+double precision rvcpce(ncecpl)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifinia , ifinra
+integer iel
+integer ipt , ielloc
+double precision xdis , xloc , xtau
+
+!----------------------------------------------------------------------------------
+
+idebia = idbia0
+idebra = idbra0
+
+xtau = 100.d0*dtref
+
+do ipt = 1, ncecpl
+
+ ielloc = lcecpl(ipt)
+
+ xdis = rvcpce(ipt)
+ xloc = rtpa(ielloc,ivar)
+
+ crvexp(ielloc) = crvexp(ielloc) &
+ + volume(ielloc)*(xdis-xloc)/xtau
+
+enddo
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/csccel.f90 b/src/base/csccel.f90
new file mode 100644
index 0000000..80be7f2
--- /dev/null
+++ b/src/base/csccel.f90
@@ -0,0 +1,379 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine csccel &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ crvexp , crvimp , &
+ dam , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ECHANGE DES VARIABLES POUR UN COUPLAGE
+! ENTRE DEUX INSTANCES DE CODE_SATURNE VIA LES FACES DE BORD
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de variable !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
+! crvimp(ncelet ! tr ! --> ! tableau de travail pour part implicit !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision dam(ncelet ),xam(nfac ,2)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifinia , ifinra
+integer numcpl , iun
+integer ncesup , nfbsup
+integer ncecpl , nfbcpl , ncencp , nfbncp
+integer ncedis , nfbdis
+integer ncecpg , ncedig
+integer ilfbsu , ilcesu
+integer ilcecp , ilfbcp , ilcenc , ilfbnc
+integer ilocpt , icoopt , idjppt , idofpt , ipndpt
+integer irvdis , irvcel , ipndcp , idofcp
+integer ityloc , ityvar
+
+!====================================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+do numcpl = 1, nbrcpl
+
+!======================================================================================
+! 1. DEFINITION DE CHAQUE COUPLAGE
+!======================================================================================
+
+ call nbecpl &
+ !==========
+ ( numcpl , &
+ ncesup , nfbsup , &
+ ncecpl , nfbcpl , ncencp , nfbncp )
+
+ call memcs1 &
+ !==========
+ ( idebia , idebra , &
+ ncesup , nfbsup , ncecpl , nfbcpl , ncencp , nfbncp , &
+ ilcesu , ilfbsu , ilcecp , ilfbcp , ilcenc , ilfbnc , &
+ ifinia , ifinra )
+
+ call lelcpl &
+ !==========
+ ( numcpl , &
+ ncecpl , nfbcpl , &
+ ia(ilcecp) , ia(ilfbcp) )
+
+
+!====================================================================================
+! 2. PREPARATION DES VARIABLES A ENVOYER SUR LES CELLULES
+!====================================================================================
+
+ ityvar = 1
+
+! --- Informations g�om�triques de localisation
+
+ call npdcpl(numcpl, ncedis, nfbdis)
+ !==========
+
+! On n'�changera qu'une composante de la vitesse � la fois
+ iun = 1
+
+ call memcs2 &
+ !==========
+ ( ifinia , ifinra , &
+ ncecpl , ncedis , iun , &
+ irvcel , ipndcp , idofcp , &
+ irvdis , ilocpt , icoopt , idjppt , idofpt , ipndpt , &
+ ifinia , ifinra )
+
+ call coocpl(numcpl, ncedis, ityvar, &
+ !==========
+ ityloc, ia(ilocpt), ra(icoopt), &
+ ra(idjppt), ra(idofpt), ra(ipndpt) )
+
+ if (ityloc.eq.2) then
+ write(nfecra,1000)
+ call csexit(1)
+ !==========
+ endif
+
+! On v�rifie qu'il faut bien �changer quelque chose
+! de mani�re globale (� cause des appels � GRDCEL notamment)
+ ncecpg = ncecpl
+ ncedig = ncedis
+ if (irangp.ge.0) then
+ call parcpt(ncecpg)
+ !==========
+ call parcpt(ncedig)
+ !==========
+ endif
+
+
+! --- Transfert des variables proprement dit.
+
+ if (ncedig.gt.0) then
+
+ call cscpce &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncedis , ityloc , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(ilocpt) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ ra(icoopt) , ra(irvdis) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! Cet appel est sym�trique, donc on teste sur NCEDIG et NCECPG
+! (rien a envoyer, rien a recevoir)
+ if (ncedig.gt.0.or.ncecpg.gt.0) then
+
+ call varcpl &
+ !==========
+ ( numcpl , ncedis , ncecpl , ityvar , &
+ ra(irvdis) , &
+ ra(irvcel) )
+
+ endif
+
+
+!====================================================================================
+! 3. TRADUCTION DU COUPLAGE EN TERME DE TERMES SOURCES
+!====================================================================================
+
+ if (ncecpg.gt.0) then
+
+ call csc2ts &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncecpl , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(ilcecp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ crvexp , crvimp , &
+! ------ ------
+ dam , xam , &
+ ra(irvcel) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+enddo
+! Fin de la boucle sur les couplages
+
+
+!--------
+! FORMATS
+!--------
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ',/,&
+'@ ========= ',/,&
+'@ LE COUPLAGE VIA LES FACES EN TANT QU''ELEMENTS ',/,&
+'@ SUPPORTS N''EST PAS ENCORE GERE PAR LE NOYAU. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/cscfbr.f90 b/src/base/cscfbr.f90
new file mode 100644
index 0000000..9017d69
--- /dev/null
+++ b/src/base/cscfbr.f90
@@ -0,0 +1,388 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cscfbr &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ECHANGE DES VARIABLES POUR UN COUPLAGE
+! ENTRE DEUX INSTANCES DE CODE_SATURNE VIA LES FACES DE BORD
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de variable !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
+! crvimp(ncelet ! tr ! --> ! tableau de travail pour part implicit !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifinia , ifinra
+integer numcpl , ivarcp
+integer ncesup , nfbsup
+integer ncecpl , nfbcpl , ncencp , nfbncp
+integer ncedis , nfbdis
+integer nfbcpg , nfbdig
+integer ilcesu , ilfbsu
+integer ilcecp , ilfbcp , ilcenc , ilfbnc
+integer ilocpt , icoopt , idjppt , ipndpt , idofpt
+integer irvdis , irvfbr , ipndcp , idofcp
+integer ityloc , ityvar
+
+!====================================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+do numcpl = 1, nbrcpl
+
+!======================================================================================
+! 1. DEFINITION DE CHAQUE COUPLAGE
+!======================================================================================
+
+ call nbecpl &
+ !==========
+ ( numcpl , &
+ ncesup , nfbsup , &
+ ncecpl , nfbcpl , ncencp , nfbncp )
+
+ call memcs1 &
+ !==========
+ ( idebia , idebra , &
+ ncesup , nfbsup , ncecpl , nfbcpl , ncencp , nfbncp , &
+ ilcesu , ilfbsu , ilcecp , ilfbcp , ilcenc , ilfbnc , &
+ ifinia , ifinra )
+
+! Liste des cellules et faces de bord localis�es
+ call lelcpl &
+ !==========
+ ( numcpl , &
+ ncecpl , nfbcpl , &
+ ia(ilcecp) , ia(ilfbcp) )
+
+! Liste des cellules et faces de bord non localis�es
+ call lencpl &
+ !==========
+ ( numcpl , &
+ ncencp , nfbncp , &
+ ia(ilcenc) , ia(ilfbnc) )
+
+
+!====================================================================================
+! 2. PREPARATION DES VARIABLES A ENVOYER SUR LES FACES DE BORD
+!====================================================================================
+
+ ityvar = 2
+
+! --- Informations g�om�triques de localisation
+
+ call npdcpl(numcpl, ncedis, nfbdis)
+ !==========
+
+ call memcs2 &
+ !==========
+ ( ifinia , ifinra , &
+ nfbcpl , nfbdis , nvarto(numcpl) , &
+ irvfbr , ipndcp , idofcp , &
+ irvdis , ilocpt , icoopt , idjppt , idofpt , ipndpt , &
+ ifinia , ifinra )
+
+ call coocpl(numcpl, nfbdis, ityvar, &
+ !==========
+ ityloc, ia(ilocpt), ra(icoopt), &
+ ra(idjppt), ra(idofpt), ra(ipndpt))
+
+ if (ityloc.eq.2) then
+ write(nfecra,1000)
+ call csexit(1)
+ !==========
+ endif
+
+! On v�rifie qu'il faut bien �changer quelque chose
+! de mani�re globale (� cause des appels � GRDCEL notamment)
+ nfbcpg = nfbcpl
+ nfbdig = nfbdis
+ if (irangp.ge.0) then
+ call parcpt(nfbcpg)
+ !==========
+ call parcpt(nfbdig)
+ !==========
+ endif
+
+
+! --- Transfert des variables proprement dit.
+
+ if (nfbdig.gt.0) then
+
+ call cscpfb &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nfbdis , ityloc , nvarcp(numcpl) , numcpl , &
+ nvarto(numcpl) , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(ilocpt) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ ra(icoopt) , ra(idjppt) , ra(ipndpt) , &
+ ra(irvdis) , ra(idofpt) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! Cet appel est sym�trique, donc on teste sur NFBDIG et NFBCPG
+! (rien a envoyer, rien a recevoir)
+ if (nfbdig.gt.0.or.nfbcpg.gt.0) then
+
+ do ivarcp = 1, nvarto(numcpl)
+
+ call varcpl &
+ !==========
+ ( numcpl , nfbdis , nfbcpl , ityvar , &
+ ra(irvdis + (ivarcp-1)*nfbdis) , &
+ ra(irvfbr + (ivarcp-1)*nfbcpl) )
+
+ enddo
+
+ endif
+
+
+!====================================================================================
+! 3. TRADUCTION DU COUPLAGE EN TERME DE CONDITIONS AUX LIMITES
+!====================================================================================
+
+ if (nfbcpg.gt.0) then
+
+ call pndcpl &
+ !==========
+ ( numcpl , nfbcpl , ityvar , ra(ipndcp) , ra(idofcp) )
+
+ call csc2cl &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nvarcp(numcpl), nvarto(numcpl) , nfbcpl , nfbncp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ ia(ilfbcp) , ia(ilfbnc) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu ,&
+ ra(irvfbr) , ra(ipndcp) , ra(idofcp) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+enddo
+! Fin de la boucle sur les couplages
+
+
+!--------
+! FORMATS
+!--------
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ',/,&
+'@ ========= ',/,&
+'@ LE COUPLAGE VIA LES FACES EN TANT QU''ELEMENTS ',/,&
+'@ SUPPORTS N''EST PAS ENCORE GERE PAR LE NOYAU. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/cscini.f90 b/src/base/cscini.f90
new file mode 100644
index 0000000..81f90cb
--- /dev/null
+++ b/src/base/cscini.f90
@@ -0,0 +1,219 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cscini &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES PRINCIPALES POUR UN COUPLAGE
+! CODE_SATURNE / CODE_SATURNE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "albase.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifinia , ifinra
+integer iphas
+integer numcpl
+integer imobmx , ialemx , nvcpmx
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! R�cup�ration du nombre de couplage
+
+call nbccpl(nbrcpl)
+!==========
+
+do numcpl = 1, nbrcpl
+
+! De la m�me mani�re, si l'on a une approche ALE sur l'un des
+! maillages, on doit mettre � jour la localisation.
+
+ call mxicpl(numcpl, iale , ialemx)
+ !==========
+
+ if (ialemx.eq.1) then
+ imajcp(numcpl) = 1
+ else
+ imajcp(numcpl) = 0
+ endif
+
+! D�termination du nombre de variables coupl�es entre les deux
+! instances du couplage NUMCPL. Toutes les variables d'une instance
+! sont coupl�es, SAUF dans le cas de l'ALE o� la vitesse de maillage
+! ne sera pas coupl�e.
+! Il faudrait faire quelque en revanche pour les physiques particuli�res.
+
+ if (iale.eq.0) then
+ nvarcp(numcpl) = nvar
+ else
+ nvarcp(numcpl) = nvar - 3
+ endif
+
+! Nombre total de variable envoy�es: max des variables de chaque
+! ex�cutable
+
+ call mxicpl(numcpl, nvarcp(numcpl), nvcpmx)
+ !==========
+
+ nvarto(numcpl) = nvcpmx
+
+! Coh�rence des mod�les de turbulence entre chaque instance de CS ;
+! pour l'instant, on ne traite que les cas de couplage entre
+! modeles RANS et laminaires, sauf pour le modele v2f (dans ce cas
+! il n'y a que du couplage mono-modele)
+
+ do iphas = 1, nphas
+
+ call tbicpl(numcpl, 1, 1, iturb(iphas), iturcp(numcpl,iphas))
+ !==========
+
+ if (iturb(iphas).eq.50.and.iturcp(numcpl,iphas).ne.50) then
+ write(nfecra,1000) numcpl
+ call csexit(1)
+ !==========
+ elseif (itytur(iphas).eq.4.and. &
+ iturcp(numcpl,iphas)/10.ne.4) then
+ write(nfecra,1001) numcpl
+ call csexit(1)
+ !==========
+ endif
+
+ enddo
+
+enddo
+
+!--------
+! FORMAT
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES MODELES DE TURBULENCE POUR LE COUPLAGE ' ,I10 ,/,&
+'@ SONT DIFFERENTS ALORS QUE L UN DES MODELES EST LE ',/,&
+'@ V2F. CE CAS DE FIGURE N''EST PAS PRIS ',/,&
+'@ EN COMPTE POUR LE MOMENT. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE COUPLAGE ', I10, ' EST UN COUPLAGE RANS/LES. ',/,&
+'@ CE CAS DE FIGURE N''EST PAS PRIS EN COMPTE POUR ',/,&
+'@ LE MOMENT. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/base/csclli.f90 b/src/base/csclli.f90
new file mode 100644
index 0000000..628dbf3
--- /dev/null
+++ b/src/base/csclli.f90
@@ -0,0 +1,73 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine csclli
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! FERME LES LISTING DES PROCESSSEURS DE RANG > 0
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+!-------------------------------------------
+! --- stdout :
+! NFECRA = 6 par d�faut (processeur 0)
+! Les autres fichiers listing sont fermes ici
+!-------------------------------------------
+
+if (nfecra.ne.6) then
+ close(nfecra)
+endif
+
+return
+end
diff --git a/src/base/cscloc.f90 b/src/base/cscloc.f90
new file mode 100644
index 0000000..19ad063
--- /dev/null
+++ b/src/base/cscloc.f90
@@ -0,0 +1,203 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cscloc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! LOCALISATION DES INTERFACES DE COUPLAGE (VIA FVM)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifinia , ifinra
+integer maxelt , ils , ifnia1
+integer numcpl
+integer ncesup , nfbsup
+integer ncecpl , nfbcpl , ncencp , nfbncp
+integer ilfbsu , ilcesu
+integer ilcecp , ilfbcp , ilcenc , ilfbnc
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+! On surdimensionne les tableaux � NCEL et NFABOR
+ncesup = ncel
+nfbsup = nfabor
+ncecpl = ncel
+nfbcpl = nfabor
+ncencp = 0
+nfbncp = 0
+
+call memcs1 &
+!==========
+ ( idebia , idebra , &
+ ncesup , nfbsup , ncecpl , nfbcpl , ncencp , nfbncp , &
+ ilcesu , ilfbsu , ilcecp , ilfbcp , ilcenc , ilfbnc , &
+ ifinia , ifinra )
+
+do numcpl = 1, nbrcpl
+
+! On localise au premier passage ou si l'un des maillages
+! du couplage est mobile ou avec ALE (cf CSCINI).
+ if (ipass.eq.1.or.imajcp(numcpl).eq.1) then
+
+ maxelt = max(ncelet, nfac, nfabor)
+
+ ils = ifinia
+ ifnia1 = ils + maxelt
+ CALL IASIZE('CSCLOC',IFNIA1)
+
+ call ussatc &
+ !==========
+ ( ifnia1 , ifinra , numcpl , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , &
+ nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils),&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(ilcesu) , ia(ilfbsu) , &
+ ia(ilcecp) , ia(ilfbcp) , &
+ ncesup , nfbsup , ncecpl , nfbcpl , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod )
+
+ if (nfbsup.gt.0) then
+ write(nfecra,1000)
+ call csexit(1)
+ !==========
+ endif
+
+! Localisation proprement dite
+ call defcpl &
+! ============
+ ( numcpl , &
+ ncesup , nfbsup , ncecpl , nfbcpl , &
+ ia(ilcesu) , ia(ilfbsu) , &
+ ia(ilcecp) , ia(ilfbcp) )
+
+ endif
+
+enddo
+
+
+!--------
+! FORMAT
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ',/,&
+'@ ========= ',/,&
+'@ LE COUPLAGE VIA LES FACES EN TANT QU''ELEMENTS ',/,&
+'@ SUPPORTS N''EST PAS ENCORE GERE PAR LE NOYAU. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/cscpce.f90 b/src/base/cscpce.f90
new file mode 100644
index 0000000..d608fe2
--- /dev/null
+++ b/src/base/cscpce.f90
@@ -0,0 +1,217 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cscpce &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nptdis , ityloc , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ locpts , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ coopts , rvdis , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! PREPARATION DE L'ENVOI DES VARIABLES POUR UN COUPLAGE
+! ENTRE DEUX INSTANCES DE CODE_SATURNE VIA LES FACES DE BORD
+
+! L'INFORMATION RECUE SERA TRANSFORMEE EN CONDITION LIMITE DANS
+! LA SUBROUTINE CSC2CL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ivar , iphas
+integer nptdis , ityloc
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer locpts(nptdis)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision coopts(3,nptdis), rvdis(nptdis)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifinia , ifinra
+integer ipt , iel
+integer inc , iccocg , iphydp , iclvar, nswrgp
+integer iwarnp , imligp , idimte , itenso
+integer iuiph , iviph , iwiph
+
+double precision epsrgp , climgp , extrap
+double precision dx , dy , dz
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+if(irangp.ge.0) then
+ call parcom(rtpa(1,ivar))
+ !==========
+endif
+
+if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte, itenso , &
+ rtpa(1,iuiph), rtpa(1,iuiph), rtpa(1,iuiph) , &
+ rtpa(1,iviph), rtpa(1,iviph), rtpa(1,iviph) , &
+ rtpa(1,iwiph), rtpa(1,iwiph), rtpa(1,iwiph) )
+endif
+
+inc = 1
+iccocg = 1
+iphydp = 0
+iclvar = iclrtp(ivar,icoef)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+iwarnp = iwarni(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+
+call grdcel &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtpa(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! --- Interpolation
+
+do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ dx = coopts(1,ipt) - xyzcen(1,iel)
+ dy = coopts(2,ipt) - xyzcen(2,iel)
+ dz = coopts(3,ipt) - xyzcen(3,iel)
+
+ rvdis(ipt) = rtpa(iel,ivar) + w1(iel)*dx+w2(iel)*dy+w3(iel)*dz
+
+enddo
+
+
+!--------
+! FORMATS
+!--------
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/cscpfb.f90 b/src/base/cscpfb.f90
new file mode 100644
index 0000000..6b6be3e
--- /dev/null
+++ b/src/base/cscpfb.f90
@@ -0,0 +1,1670 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cscpfb &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nptdis , ityloc , nvcp , numcpl , nvcpto, &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ locpts , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ coopts , djppts , pndpts , &
+ rvdis , dofpts , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! PREPARATION DE L'ENVOI DES VARIABLES POUR UN COUPLAGE
+! ENTRE DEUX INSTANCES DE CODE_SATURNE VIA LES FACES DE BORD
+
+! L'INFORMATION RECUE SERA TRANSFORMEE EN CONDITION LIMITE DANS
+! LA SUBROUTINE CSC2CL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nptdis , nvcp , numcpl , nvcpto , ityloc
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer locpts(nptdis)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision coopts(3,nptdis), djppts(3,nptdis)
+double precision pndpts(nptdis), dofpts(3,nptdis)
+double precision rvdis(nptdis,nvcpto)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifinia , ifinra
+
+integer itrav1 , itrav2 , itrav3 , itrav4 , itrav5
+integer itrav6 , itrav7 , itrav8 , itrav
+
+integer ipt , ifac , iel , isou
+integer ivar , iscal , iphas
+integer ipriph , iuiph , iviph , iwiph
+integer ikiph , iepiph , ifbiph , iomiph , iphiph
+integer itravx , itravy , itravz
+integer igradx , igrady , igradz
+integer inc , iccocg , iphydp , iclvar, nswrgp
+integer iwarnp , imligp , idimte , itenso
+integer ipos
+integer itytu0
+
+double precision epsrgp , climgp , extrap
+double precision xjjp , yjjp , zjjp
+double precision d2s3
+double precision xjpf,yjpf,zjpf,jpf
+
+!===============================================================================
+
+!=========================================================================
+! 1. INITIALISATIONS
+!=========================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+itrav1 = idebra
+itrav2 = itrav1 + nptdis
+itrav3 = itrav2 + nptdis
+itrav4 = itrav3 + nptdis
+itrav5 = itrav4 + nptdis
+itrav6 = itrav5 + nptdis
+itrav7 = itrav6 + nptdis
+itrav8 = itrav7 + nptdis
+ifinra = itrav8 + nptdis
+
+CALL RASIZE('CSCPFB',IFINRA)
+
+
+d2s3 = 2.d0/3.d0
+
+
+! On part du principe que l'on envoie les bonnes variables �
+! l'instance distante et uniquement celles-l�.
+
+! De plus, les variables sont envoy�es dans l'ordre de VARPOS :
+
+! Pour chaque phase IPHAS :
+! - pression (unique pour toute les phases)
+! - vitesse
+! - grandeurs turbulentes (selon le mod�le)
+! Et ensuite :
+! - scalaires physique particuli�re (pas encore trait�s)
+! - scalaires utilisateur
+! - vitesse de maillage (non coupl�e, donc non envoy�e)
+
+
+ipos = 1
+
+do iphas = 1, nphas
+
+!=========================================================================
+! 1. PREPARATION DE LA PRESSION
+!=========================================================================
+
+! La pression est unique pour chaque phase, inutile donc de
+! le faire pour toutes les phases.
+
+ if (iphas.eq.1) then
+
+ ipriph = ipr(iphas)
+
+! --- Calcul du gradient de la pression pour interpolation
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,ipriph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ipriph) , rtp(1,ipriph) , rtp(1,ipriph) , &
+ rtp(1,ipriph) , rtp(1,ipriph) , rtp(1,ipriph) , &
+ rtp(1,ipriph) , rtp(1,ipriph) , rtp(1,ipriph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ipriph,icoef)
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+ extrap = extrag(ipriph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipriph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ipriph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjpf = coopts(1,ipt) - xyzcen(1,iel)- djppts(1,ipt)
+ yjpf = coopts(2,ipt) - xyzcen(2,iel)- djppts(2,ipt)
+ zjpf = coopts(3,ipt) - xyzcen(3,iel)- djppts(3,ipt)
+
+ if(pndpts(ipt).ge.0.d0.and.pndpts(ipt).le.1.d0) then
+ jpf = -1.d0*sqrt(xjpf**2+yjpf**2+zjpf**2)
+ else
+ jpf = sqrt(xjpf**2+yjpf**2+zjpf**2)
+ endif
+
+ rvdis(ipt,ipos) = (xjpf*w1(iel)+yjpf*w2(iel)+zjpf*w3(iel)) &
+ /jpf
+
+ enddo
+
+ endif
+! FIn pour la pression de la phase 1
+
+
+!=========================================================================
+! 2. PREPARATION DE LA VITESSE
+!=========================================================================
+
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+
+! --- Calcul du gradient de la vitesse pour interpolation
+
+ if (irangp.ge.0) then
+ do isou = 1, 3
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+ call parcom ( rtp(1,ivar) )
+ !==========
+ enddo
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iuiph), rtp(1,iviph), rtp(1,iwiph), &
+ rtp(1,iuiph), rtp(1,iviph), rtp(1,iwiph), &
+ rtp(1,iuiph), rtp(1,iviph), rtp(1,iwiph))
+ endif
+
+ do isou = 1, 3
+
+ ipos = ipos + 1
+
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ivar,icoef)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = dofpts(1,ipt) + djppts(1,ipt)
+ yjjp = dofpts(2,ipt) + djppts(2,ipt)
+ zjjp = dofpts(3,ipt) + djppts(3,ipt)
+
+
+ rvdis(ipt,ipos) = rtp(iel,ivar) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+ enddo
+! Fin de la boucle sur les composantes de la vitesse
+
+
+!=========================================================================
+! 3. PREPARATION DES GRANDEURS TURBULENTES
+!=========================================================================
+
+ itytu0 = iturcp(numcpl,iphas)/10
+
+
+!=========================================================================
+! 3.1 Turbulence dans l'instance locale : mod�les k-epsilon
+!=========================================================================
+
+ if (itytur(iphas).eq.2) then
+
+!=======================================================================
+! 3.1.1. INTERPOLATION EN J'
+!=======================================================================
+
+! Pr�paration des donn�es: interpolation de k en J'
+
+ ikiph = ik(iphas)
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,ikiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ikiph,icoef)
+ nswrgp = nswrgr(ikiph)
+ imligp = imligr(ikiph)
+ iwarnp = iwarni(ikiph)
+ epsrgp = epsrgr(ikiph)
+ climgp = climgr(ikiph)
+ extrap = extrag(ikiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ikiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ikiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav1 + ipt-1) = rtp(iel,ikiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+! Pr�paration des donn�es: interpolation de epsilon en J'
+
+ iepiph = iep(iphas)
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,iepiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(iepiph,icoef)
+ nswrgp = nswrgr(iepiph)
+ imligp = imligr(iepiph)
+ iwarnp = iwarni(iepiph)
+ epsrgp = epsrgr(iepiph)
+ climgp = climgr(iepiph)
+ extrap = extrag(iepiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iepiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,iepiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav2 + ipt-1) = rtp(iel,iepiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+
+!=======================================================================
+! 3.1.2. Transfert de variable � "iso-mod�le"
+!=======================================================================
+
+ if (itytu0.eq.2) then
+
+! Energie turbulente
+! ------------------
+ ipos = ipos + 1
+ ikiph = ik(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav1 + ipt-1)
+ enddo
+
+! Dissipation turbulente
+! ----------------------
+ ipos = ipos + 1
+ iepiph = iep(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav2 + ipt-1)
+ enddo
+
+!=======================================================================
+! 3.1.3. Transfert de k-eps vers Rij-eps
+!=======================================================================
+
+ elseif (itytu0.eq.3) then
+
+! Tenseur Rij
+! ------------
+! Termes de la diagonal R11,R22,R33
+
+ do isou =1, 3
+
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = d2s3*ra(itrav1 + ipt-1)
+ enddo
+
+ enddo
+
+! Termes R12,R13,R23
+
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+
+! Les appels a PARCOM et PERCOM ont deja ete fait plus haut
+
+ do isou = 1, 3
+
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ivar,icoef)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ if(isou.eq.1) then
+ ra(itrav3 + ipt-1) = w2(iel)
+ ra(itrav4 + ipt-1) = w3(iel)
+ elseif(isou.eq.2) then
+ ra(itrav5 + ipt-1) = w1(iel)
+ ra(itrav6 + ipt-1) = w3(iel)
+ elseif(isou.eq.3) then
+ ra(itrav7 + ipt-1) = w1(iel)
+ ra(itrav8 + ipt-1) = w2(iel)
+ endif
+
+ enddo
+
+ enddo
+! Fin de la boucle sur les composantes de la vitesse
+
+! R12
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = -2.0d0*ra(itrav1 + ipt-1)**2*cmu &
+ /max(1.0d-10, ra(itrav2 + ipt-1)) &
+ *0.5d0*(ra(itrav3 + ipt-1) + ra(itrav5 + ipt-1))
+ enddo
+
+! R13
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = -2.0d0*ra(itrav1 + ipt-1)**2*cmu &
+ /max(1.0d-10, ra(itrav2 + ipt-1)) &
+ *0.5d0*(ra(itrav4 + ipt-1) + ra(itrav7 + ipt-1))
+ enddo
+
+! R23
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = -2.0d0*ra(itrav1 + ipt-1)**2*cmu &
+ /max(1.0d-10,ra(itrav2 + ipt-1)) &
+ *0.5d0*(ra(itrav6 + ipt-1) + ra(itrav8 + ipt-1))
+ enddo
+
+! Dissipation turbulente
+! ----------------------
+ ipos = ipos + 1
+ iepiph = iep(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav2 + ipt -1)
+ enddo
+
+!=======================================================================
+! 3.1.4. Transfert de k-eps vers v2f
+!=======================================================================
+
+ elseif (iturcp(numcpl,iphas).eq.50) then
+
+! ATTENTION: CAS NON PRIS EN COMPTE (ARRET DU CALCUL DANS CSCINI.F)
+
+!=======================================================================
+! 3.1.5. Transfert de k-eps vers k-omega
+!=======================================================================
+
+ elseif (iturcp(numcpl,iphas).eq.60) then
+
+! Energie turbulente
+! -----------------
+ ipos = ipos + 1
+ ikiph = ik(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav1 + ipt -1)
+ enddo
+
+! Omega
+! -----
+ ipos = ipos + 1
+ iomiph = iomg(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav2 + ipt-1)/cmu &
+ /max(1.0d-10, ra(itrav1 + ipt-1))
+ enddo
+
+
+ endif
+
+!=========================================================================
+! 3.2 Turbulence dans l'instance locale : mod�le Rij-epsilon
+!=========================================================================
+
+ elseif (itytur(iphas).eq.3) then
+
+!=======================================================================
+! 3.2.1. INTERPOLATION EN J'
+!=======================================================================
+
+! Pr�paration des donn�es: interpolation des Rij en J'
+
+ do isou = 1, 6
+
+ if (isou.eq.1) ivar = ir11(iphas)
+ if (isou.eq.2) ivar = ir22(iphas)
+ if (isou.eq.3) ivar = ir33(iphas)
+ if (isou.eq.4) ivar = ir12(iphas)
+ if (isou.eq.5) ivar = ir13(iphas)
+ if (isou.eq.6) ivar = ir23(iphas)
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,ivar) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ivar,icoef)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ if (isou.eq.1) itrav = itrav1
+ if (isou.eq.2) itrav = itrav2
+ if (isou.eq.3) itrav = itrav3
+ if (isou.eq.4) itrav = itrav4
+ if (isou.eq.5) itrav = itrav5
+ if (isou.eq.6) itrav = itrav6
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav + ipt-1) = rtp(iel,ivar) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+ enddo
+
+! Pr�paration des donn�es: interpolation de epsilon en J'
+
+ iepiph = iep(iphas)
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,iepiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(iepiph,icoef)
+ nswrgp = nswrgr(iepiph)
+ imligp = imligr(iepiph)
+ iwarnp = iwarni(iepiph)
+ epsrgp = epsrgr(iepiph)
+ climgp = climgr(iepiph)
+ extrap = extrag(iepiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iepiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,iepiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav7 + ipt-1) = rtp(iel,iepiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+!=======================================================================
+! 3.2.2. Transfert de variable � "iso-mod�le"
+!=======================================================================
+
+ if (itytu0.eq.3) then
+
+! Tensions de Reynolds
+! --------------------
+ do isou = 1, 6
+
+ ipos = ipos + 1
+
+ if (isou.eq.1) itrav = itrav1
+ if (isou.eq.2) itrav = itrav2
+ if (isou.eq.3) itrav = itrav3
+ if (isou.eq.4) itrav = itrav4
+ if (isou.eq.5) itrav = itrav5
+ if (isou.eq.6) itrav = itrav6
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav + ipt-1)
+ enddo
+
+ enddo
+
+! Dissipation turbulente
+! ----------------------
+ ipos = ipos + 1
+ iepiph = iep(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav7 + ipt-1)
+ enddo
+
+!=======================================================================
+! 3.2.3. Transfert de Rij-epsilon vers k-epsilon
+!=======================================================================
+
+ elseif (itytu0.eq.2) then
+
+! Energie turbulente
+! ------------------
+ ipos = ipos + 1
+ ikiph = ik(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = 0.5d0*(ra(itrav1 + ipt-1) &
+ + ra(itrav2 + ipt-1) + ra(itrav3 + ipt-1))
+ enddo
+
+! Dissipation turbulente
+! ----------------------
+ ipos = ipos + 1
+ iepiph = iep(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav7 + ipt-1)
+ enddo
+
+!=======================================================================
+! 3.2.4. Transfert de Rij-epsilon vers v2f
+!=======================================================================
+
+ elseif (iturcp(numcpl,iphas).eq.50) then
+
+! ATTENTION: CAS NON PRIS EN COMPTE (ARRET DU CALCUL DANS CSCINI.F)
+
+!=======================================================================
+! 3.2.5. Transfert de Rij-epsilon vers k-omega
+!=======================================================================
+
+ elseif (iturcp(numcpl,iphas).eq.60) then
+
+! Energie turbulente
+! ------------------
+ ipos = ipos + 1
+ ikiph = ik(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = 0.5d0*(ra(itrav1 + ipt-1) &
+ + ra(itrav2 + ipt-1) + ra(itrav3 + ipt-1))
+ enddo
+
+! Omega
+! -----
+ ipos = ipos + 1
+ iomiph = iomg(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav7 + ipt-1)/cmu &
+ /max(1.0d-10, rvdis(ipt,ipos-1))
+ enddo
+
+ endif
+
+!==============================================================================
+! 3.3 Turbulence dans l'instance locale : mod�le v2f (phi-model)
+!==============================================================================
+
+ elseif (iturb(iphas).eq.50) then
+
+!=======================================================================
+! 3.3.1. INTERPOLATION EN J'
+!=======================================================================
+
+! Pr�paration des donn�es: interpolation de k en J'
+
+ ikiph = ik(iphas)
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,ikiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ikiph,icoef)
+ nswrgp = nswrgr(ikiph)
+ imligp = imligr(ikiph)
+ iwarnp = iwarni(ikiph)
+ epsrgp = epsrgr(ikiph)
+ climgp = climgr(ikiph)
+ extrap = extrag(ikiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ikiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ikiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav1 + ipt-1) = rtp(iel,ikiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+
+ enddo
+
+! Pr�paration des donn�es: interpolation de epsilon en J'
+
+ iepiph = iep(iphas)
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,iepiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) , &
+ rtp(1,iepiph) , rtp(1,iepiph) , rtp(1,iepiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(iepiph,icoef)
+ nswrgp = nswrgr(iepiph)
+ imligp = imligr(iepiph)
+ iwarnp = iwarni(iepiph)
+ epsrgp = epsrgr(iepiph)
+ climgp = climgr(iepiph)
+ extrap = extrag(iepiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iepiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,iepiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav2 + ipt-1) = rtp(iel,iepiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+! Pr�paration des donn�es: interpolation de Phi en J'
+
+ iphiph = iphi(iphas)
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,iphiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iphiph) , rtp(1,iphiph) , rtp(1,iphiph) , &
+ rtp(1,iphiph) , rtp(1,iphiph) , rtp(1,iphiph) , &
+ rtp(1,iphiph) , rtp(1,iphiph) , rtp(1,iphiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(iphiph,icoef)
+ nswrgp = nswrgr(iphiph)
+ imligp = imligr(iphiph)
+ iwarnp = iwarni(iphiph)
+ epsrgp = epsrgr(iphiph)
+ climgp = climgr(iphiph)
+ extrap = extrag(iphiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,iphiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav3 + ipt-1) = rtp(iel,iphiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+! Pr�paration des donn�es: interpolation de F-barre en J'
+
+ ifbiph = ifb(iphas)
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,ifbiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ifbiph) , rtp(1,ifbiph) , rtp(1,ifbiph) , &
+ rtp(1,ifbiph) , rtp(1,ifbiph) , rtp(1,ifbiph) , &
+ rtp(1,ifbiph) , rtp(1,ifbiph) , rtp(1,ifbiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ifbiph,icoef)
+ nswrgp = nswrgr(ifbiph)
+ imligp = imligr(ifbiph)
+ iwarnp = iwarni(ifbiph)
+ epsrgp = epsrgr(ifbiph)
+ climgp = climgr(ifbiph)
+ extrap = extrag(ifbiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifbiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ifbiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav4 + ipt-1) = rtp(iel,ifbiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+!=======================================================================
+! 3.3.2. Transfert de variable � "iso-mod�le"
+!=======================================================================
+
+ if (iturcp(numcpl,iphas).eq.50) then
+
+! Energie turbulente
+! ------------------
+ ipos = ipos + 1
+ ikiph = ik(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav1 + ipt-1)
+ enddo
+
+! Dissipation turbulente
+! ----------------------
+ ipos = ipos + 1
+ iepiph = iep(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav2 + ipt-1)
+ enddo
+
+! Phi
+! ---
+ ipos = ipos + 1
+ iphiph = iphi(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav3 + ipt-1)
+ enddo
+
+! F-barre
+! -------
+ ipos = ipos + 1
+ ifbiph = ifb(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav4 + ipt-1)
+ enddo
+
+
+! ATTENTION: LE COUPLAGE ENTRE UN MODELE V2F ET UN MODELE DE
+! TURBULENCE DIFFERENT N'EST PAS PRIS EN COMPTE
+
+ elseif (itytu0.eq.2) then
+ elseif (itytu0.eq.3) then
+ elseif (iturcp(numcpl,iphas).eq.60) then
+ endif
+
+!==============================================================================
+! 3.4 Turbulence dans l'instance locale : mod�le omega SST
+!==============================================================================
+
+ elseif (iturb(iphas).eq.60) then
+
+!=======================================================================
+! 3.4.1. INTERPOLATION EN J'
+!=======================================================================
+
+! Pr�paration des donn�es: interpolation de k en J'
+
+ ikiph = ik(iphas)
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,ikiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) , &
+ rtp(1,ikiph) , rtp(1,ikiph) , rtp(1,ikiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ikiph,icoef)
+ nswrgp = nswrgr(ikiph)
+ imligp = imligr(ikiph)
+ iwarnp = iwarni(ikiph)
+ epsrgp = epsrgr(ikiph)
+ climgp = climgr(ikiph)
+ extrap = extrag(ikiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ikiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ikiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav1 + ipt-1) = rtp(iel,ikiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+! Pr�paration des donn�es: interpolation de omega en J'
+
+ iomiph = iomg(iphas)
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,iomiph) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iomiph) , rtp(1,iomiph) , rtp(1,iomiph) , &
+ rtp(1,iomiph) , rtp(1,iomiph) , rtp(1,iomiph) , &
+ rtp(1,iomiph) , rtp(1,iomiph) , rtp(1,iomiph) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(iomiph,icoef)
+ nswrgp = nswrgr(iomiph)
+ imligp = imligr(iomiph)
+ iwarnp = iwarni(iomiph)
+ epsrgp = epsrgr(iomiph)
+ climgp = climgr(iomiph)
+ extrap = extrag(iomiph)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iomiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,iomiph) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ ra(itrav2 + ipt-1) = rtp(iel,iomiph) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+!=======================================================================
+! 3.4.2. Transfert de variable � "iso-mod�le"
+!=======================================================================
+
+ if (iturcp(numcpl,iphas).eq.60) then
+
+! Energie turbulente
+! ------------------
+ ipos = ipos + 1
+ ikiph = ik(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav1 + ipt-1)
+ enddo
+
+! Omega
+! -----
+ ipos = ipos + 1
+ iomiph = iomg(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav2 + ipt-1)
+ enddo
+
+ elseif (itytu0.eq.2) then
+
+!========================================================================
+! 3.4.3. Transfert de k-omega vers k-epsilon
+!========================================================================
+! Energie turbulente
+! ------------------
+ ipos = ipos + 1
+ ikiph = ik(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav1 + ipt-1)
+ enddo
+
+! Omega
+! -----
+ ipos = ipos + 1
+ iomiph = iomg(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav2 + ipt-1)*cmu &
+ *ra(itrav1 + ipt-1)
+ enddo
+
+!========================================================================
+! 3.4.3. Transfert de k-omega vers Rij-epsilon
+!========================================================================
+
+ elseif (itytu0.eq.3) then
+
+! Tenseur Rij
+! ----------
+! Termes de la diagonal R11,R22,R33
+
+ do isou =1, 3
+
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = d2s3*ra(itrav1 + ipt-1)
+ enddo
+
+ enddo
+
+! Termes R12,R13,R23
+
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+
+ do isou = 1, 3
+
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ivar,icoef)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ if (isou.eq.1) then
+ ra(itrav3 + ipt-1) = w2(iel)
+ ra(itrav4 + ipt-1) = w3(iel)
+ elseif (isou.eq.2) then
+ ra(itrav5 + ipt-1) = w1(iel)
+ ra(itrav6 + ipt-1) = w3(iel)
+ elseif (isou.eq.3) then
+ ra(itrav7 + ipt-1) = w1(iel)
+ ra(itrav8 + ipt-1) = w2(iel)
+ endif
+
+ enddo
+
+ enddo
+! Fin de la boucle sur les composantes de la vitesse
+
+! R12
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = -2.0d0*ra(itrav1 + ipt-1) &
+ /max(1.0d-10, ra(itrav2 + ipt-1)) &
+ *0.5d0*(ra(itrav3 + ipt-1) + ra(itrav5 + ipt-1))
+ enddo
+
+! R13
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = -2.0d0*ra(itrav1 + ipt-1) &
+ /max(1.0d-10, ra(itrav2 + ipt-1)) &
+ *0.5d0*(ra(itrav4 + ipt-1) + ra(itrav7 + ipt-1))
+ enddo
+
+! R23
+ ipos = ipos + 1
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = -2.0d0*ra(itrav1 + ipt-1) &
+ /max(1.0d-10, ra(itrav2 + ipt-1)) &
+ *0.5d0*(ra(itrav6 + ipt-1) + ra(itrav8 + ipt-1))
+ enddo
+
+! Dissipation turbulente
+! ----------------------
+ ipos = ipos + 1
+ iepiph = iep(iphas)
+
+ do ipt = 1, nptdis
+ rvdis(ipt,ipos) = ra(itrav2 + ipt-1)*cmu &
+ *ra(itrav1 + ipt-1)
+ enddo
+
+
+!=======================================================================
+! 3.3.4. Transfert de k-omega vers v2f
+!=======================================================================
+
+ elseif (iturcp(numcpl,iphas).eq.50) then
+
+! ATTENTION: CAS NON PRIS EN COMPTE. ARRET DU CALCUL DANS CSCINI.F
+
+ endif
+
+ endif
+
+enddo
+! Fin de la boucle sur les phases
+! Ce qui suit est ind�pendant de la phase
+
+!=========================================================================
+! 4. PREPARATION DES SCALAIRES
+!=========================================================================
+
+if (nscal.gt.0) then
+
+ do iscal = 1, nscal
+
+ ipos = ipos + 1
+
+ ivar = isca(iscal)
+
+! --- Calcul du gradient du scalaire pour interpolation
+
+ if (irangp.ge.0) then
+ call parcom ( rtp(1,ivar) )
+ !==========
+ endif
+
+ if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) )
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ iclvar = iclrtp(ivar,icoef)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml, &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp, &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume, &
+ w4 , w4 , w4 , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do ipt = 1, nptdis
+
+ iel = locpts(ipt)
+
+ xjjp = djppts(1,ipt)
+ yjjp = djppts(2,ipt)
+ zjjp = djppts(3,ipt)
+
+ rvdis(ipt,ipos) = rtp(iel,ivar) &
+ + xjjp*w1(iel) + yjjp*w2(iel) + zjjp*w3(iel)
+
+ enddo
+
+ enddo
+
+endif
+
+
+return
+end
diff --git a/src/base/csflsh.f90 b/src/base/csflsh.f90
new file mode 100644
index 0000000..079ebbb
--- /dev/null
+++ b/src/base/csflsh.f90
@@ -0,0 +1,64 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine csflsh
+!================
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VIDAGE DU TAMPON DU FICHIER D'IMPRESSION
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+call flush (nfecra)
+
+return
+
+end
diff --git a/src/base/csinit.f90 b/src/base/csinit.f90
new file mode 100644
index 0000000..abff9f2
--- /dev/null
+++ b/src/base/csinit.f90
@@ -0,0 +1,157 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine csinit &
+!================
+
+ ( argifo , irgpar , nrgpar , nthpar , ilisr0 , ilisrp )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DU LISTING ET DE PARAMETRES ASSOCIES AU PREPROCESSEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! argifo ! e ! <-- ! valeur de ifoenv ; !
+! ! ! ! format de communication avec !
+! ! ! ! le preprocesseur !
+! ! ! ! 0 : pas de communications !
+! ! ! ! 1 : communication par fichiers !
+! irgpar ! e ! <-- ! rang si parallele ; -1 si sequentiel !
+! nrgpar ! e ! <-- ! nombre de processus ; 1 si sequentiel !
+! nthpar ! e ! <-- ! nombre de threads !
+! ilisr0 ! e ! <-- ! option de sortie du listing : !
+! ! ! ! 0 : rang 0 non redirige !
+! ! ! ! 1 : rang 0 dans fichier listing, !
+! ilisrp ! e ! <-- ! option de sortie du listing : !
+! ! ! ! 0 : rangs > 0 non rediriges !
+! ! ! ! (pour debugger par exemple) !
+! ! ! ! 1 : rangs > 0 rediriges dans !
+! ! ! ! fichiers listing_n* !
+! ! ! ! 2 : rangs > 0 rediriges dans !
+! ! ! ! /dev/null (suppression) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+integer argifo, irgpar, nrgpar, nthpar, ilisr0, ilisrp
+
+character name*300
+
+!===============================================================================
+
+!===============================================================================
+! Initialisation du common IPARAL
+!===============================================================================
+
+irangp = irgpar
+nrangp = nrgpar
+
+nthrdi = 1
+nthrdb = 1
+ngrpi = 1
+ngrpb = 1
+
+!===============================================================================
+! Initialisation des param�tres de lecture des donn�es Pr�processeur
+!===============================================================================
+
+ifoenv = argifo
+
+!-------------------------------------------
+! --- stdout :
+! NFECRA = 6 par d�faut
+! Les autres fichiers listing sont fermes dans csclli a la fin de cs_main.
+!-------------------------------------------
+
+nfecra = 6
+
+if (irangp.le.0) then
+ if (ilisr0.eq.1) then
+ nfecra = 9
+ NAME = 'listing'
+ endif
+else
+ if (ilisrp.eq.1) then
+ nfecra = 9
+ WRITE (NAME,'(A9,I4.4)') 'listing_n', IRANGP + 1
+ else if (ilisrp.eq.2) then
+ nfecra = 9
+ NAME = '/dev/null'
+ endif
+endif
+
+if (nfecra.eq.9) then
+ open (file=name, unit=nfecra, &
+ FORM='FORMATTED', STATUS='UNKNOWN', ERR=900)
+endif
+
+goto 950
+
+ 900 write (0, 999) name
+call csexit (1)
+
+ 950 continue
+
+#if defined(_CS_LANG_FR)
+
+ 999 format(/, &
+'Code_Saturne : Erreur d''initialisation :',/, &
+'Impossible d''ouvrir le fichier : ',A,/)
+
+#else
+
+ 999 format(/, &
+'Code_Saturne: Initialization error:',/, &
+'Impossible to open the file: ',A,/)
+
+#endif
+
+return
+end
diff --git a/src/base/csprnt.f90 b/src/base/csprnt.f90
new file mode 100644
index 0000000..3c86f97
--- /dev/null
+++ b/src/base/csprnt.f90
@@ -0,0 +1,85 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine csprnt &
+!================
+
+ ( chaine , taille )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! IMPRESSION D'UNE CHAINE DE CARACTERES (ISSUE D'UNE FONCTION C)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! chaine ! c ! <-- ! chaine a imprimer (tableau) !
+! taille ! e ! <-- ! nombre de caracteres !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+character chaine(*)
+integer taille
+
+character chloc*16384
+integer ii
+
+!===============================================================================
+! 1. IMPRESSION
+!===============================================================================
+
+taille = min(taille, 16384 - 1)
+
+do ii = 1, taille
+ chloc(ii:ii) = chaine(ii)
+enddo
+
+write(nfecra, '(a)', advance='no') chloc(1:taille)
+
+return
+
+end
diff --git a/src/base/distpr.f90 b/src/base/distpr.f90
new file mode 100644
index 0000000..266f2fa
--- /dev/null
+++ b/src/base/distpr.f90
@@ -0,0 +1,556 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine distpr &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itypfb , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ distpa , &
+ viscf , viscb , dam , xam , smbdp , rovsdp , &
+ rtpdp , coefad , coefbd , &
+ w1 , w2 , w3 , w4 , w5 , w6 , w7 , &
+ w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DE LA DISTANCE A LA PAROI PAR INVERSION DE LA SOLUTION 3D
+! DE L'EQUATION DE DIFFUSION D'UN SCALAIRE
+
+! On resout
+! div[grad(T)] = -1
+! avec :
+! T(bord) = 1 en paroi
+! grad(T).n = 0 ailleurs
+
+! La distance a la paroi vaut alors :
+
+! d ~ -|grad(T)|+[grad(T).grad(T)+2.T]^(1/2)
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! distpa(ncelet ! tr ! --> ! tab des distances a la paroi !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! smbrp(ncelet) ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdp(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! rtpdp(ncelet) ! tr ! --- ! var de travail du sclaire diffuse !
+! drtp(ncelet) ! tr ! --- ! tableau de travail pour increment !
+! coefad,coefbd ! tr ! --- ! conditions aux limites aux !
+! (nfabor) ! ! ! faces de bord du scalaire diffuse !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "ppppar.h"
+include "coincl.h"
+include "period.h"
+include "mltgrd.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itypfb(nfabor,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision distpa(ncelet), viscf (nfac) , viscb (nfabor)
+double precision dam (ncelet), xam (nfac,2)
+double precision smbdp (ncelet), rovsdp(ncelet)
+double precision rtpdp (ncelet)
+double precision coefad(nfabor), coefbd(nfabor)
+double precision w1 (ncelet), w2 (ncelet), w3 (ncelet)
+double precision w4 (ncelet), w5 (ncelet), w6 (ncelet)
+double precision w7 (ncelet), w8 (ncelet), w9 (ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+
+integer idebia, idebra
+integer ndircp, iconvp, idiffp, isym
+integer ipol , ireslp, ipp
+integer niterf, icycle, ncymxp, nitmfp
+integer iinvpe, idimte, itenso
+integer isqrt , iel , ifac , iphas
+integer inc , iccocg, iphydp, ivar
+integer isweep, nittot, idtva0
+
+double precision relaxp, thetap, rnorm, residu, rnoini
+double precision dismax, dismin
+!===============================================================================
+
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+! Memoire
+idebia = idbia0
+idebra = idbra0
+
+! On travaille sur la phase 1
+iphas = 1
+! Nombre d'iteration totale pour l'inversion
+nittot = 0
+
+! La distance a la paroi est initialisee a 0 pour la reconstruction
+
+do iel = 1, ncelet
+ distpa(iel) = 0.d0
+ rtpdp(iel) = 0.d0
+enddo
+
+!===============================================================================
+! 2.CONDITIONS LIMITES
+!===============================================================================
+
+! Conditions aux limites pour le scalaire resolu T
+! Dirichlet a 0 en paroi
+! Neumann nul ailleurs
+! On test aussi la pressence d'un Dirichlet
+
+ndircp = 0
+
+do ifac = 1, nfabor
+ if(itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug) then
+ coefad(ifac) = 0.0d0
+ coefbd(ifac) = 0.0d0
+ ndircp = 1
+ else
+ coefad(ifac) = 0.0d0
+ coefbd(ifac) = 1.0d0
+ endif
+enddo
+
+!===============================================================================
+! 3. PREPARATION DU SYSTEME A RESOUDRE
+!===============================================================================
+
+! -- Diagonale
+
+do iel = 1, ncel
+ rovsdp(iel) = 0.d0
+enddo
+
+! -- Diffusion aux faces
+
+do iel = 1, ncel
+ w1(iel) = 1.d0
+enddo
+
+call viscfa &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+iconvp = 0
+idiffp = 1
+isym = 1
+thetap = 1.d0
+
+call matrix &
+!==========
+ ( ncelet , ncel , nfac , nfabor , &
+ iconvp , idiffp , ndircp , &
+ isym , nfecra , &
+ thetap , &
+ ifacel , ifabor , &
+ coefbd , rovsdp , &
+ viscf , viscb , viscf , viscb , &
+ dam , xam )
+
+! -- Second membre
+
+do iel = 1, ncel
+ smbdp(iel) = volume(iel)
+enddo
+!===============================================================================
+! 4. RESOLUTION DU SYSTEME
+!===============================================================================
+ipp = 1
+NOMVAR(IPP) = 'DisParoi'
+ipol = 0
+ireslp = 0
+! Pas de multigrille (NCYMXP,NITMFP sont arbitraies)
+ncymxp = 100
+nitmfp = 10
+! Periodicite
+iinvpe = 0
+if(iperio.eq.1) iinvpe = 1
+isqrt = 1
+
+! -- Boucle de reconstruction
+
+! Si NSWRSY = 1, on doit faire 2 inversions
+do isweep = 0, nswrsy
+
+ call prodsc(ncelet,ncel,isqrt,smbdp,smbdp,rnorm)
+ if (iwarny.ge.2) then
+ write(nfecra,5000) nomvar(ipp),isweep,rnorm
+ endif
+ if (isweep.le.1) rnoini = rnorm
+! Test de convergence
+ if(rnorm.le.10.d0*epsily*rnoini) goto 100
+
+ do iel = 1, ncelet
+ rtpdp(iel) = 0.d0
+ enddo
+
+ call invers &
+ !==========
+ ( nomvar(ipp) , idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isym , ipol , ireslp , nitmay , imgrpy , &
+ ncymxp , nitmfp , &
+ iwarny , nfecra , niterf , icycle , iinvpe , &
+ epsily , rnorm , residu , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dam , xam , smbdp , rtpdp , &
+ w3 , w4 , w5 , w6 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ nittot = nittot + niterf
+ do iel = 1, ncel
+ distpa(iel) = distpa(iel) + rtpdp(iel)
+ enddo
+
+! - Echange pour le parallelisme
+
+ if(irangp.ge.0) then
+ call parcom (rtpdp)
+ !==========
+ endif
+
+! - Echange pour la periodicite
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtpdp , rtpdp , rtpdp , &
+ rtpdp , rtpdp , rtpdp , &
+ rtpdp , rtpdp , rtpdp )
+ endif
+
+ if(isweep.lt.nswrsy) then
+ inc = 0
+ iccocg = 1
+ ivar = 0
+ idtva0 = 0
+ relaxp = 1.d0
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtva0 , ivar , iconvp , idiffp , nswrgy , imligy , ircfly , &
+ ischcy , isstpy , inc , imrgra , iccocg , &
+ ipp , iwarny , &
+ blency , epsrgy , climgy , extray , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpdp , rtpdp , coefad , coefbd , coefad , coefbd , &
+ viscf , viscb , viscf , viscb , &
+ smbdp , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+enddo
+
+ 100 continue
+
+! On travail ensuite sur RTPDP pour calculer DISTPA
+do iel=1,ncel
+ rtpdp(iel) = distpa(iel)
+enddo
+
+!===============================================================================
+! 5. CALCUL DE LA DISTANCE A LA PAROI
+!===============================================================================v
+
+! - Echange pour le parallelisme
+
+if(irangp.ge.0) then
+ call parcom (rtpdp)
+ !==========
+endif
+
+! - Echange pour la periodicite
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtpdp , rtpdp , rtpdp , &
+ rtpdp , rtpdp , rtpdp , &
+ rtpdp , rtpdp , rtpdp )
+
+endif
+
+! - Calcul du gradient
+
+inc = 1
+iccocg = 1
+iphydp = 0
+ivar = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgy , imligy , iphydp , &
+ iwarny , nfecra , epsrgy , climgy , extray , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w2 , w3 , &
+ rtpdp , coefad , coefbd , &
+ w4 , w5 , w6 , &
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ w1(iel) = w4(iel)**2.d0+w5(iel)**2.d0+w6(iel)**2.d0
+ if(w1(iel)+2.d0*rtpdp(iel).gt.0.d0) then
+ distpa(iel) = - sqrt(w1(iel)) &
+ + sqrt(w1(iel)+2.d0*rtpdp(iel))
+ else
+ write(nfecra,8000)iel, xyzcen(1,iel) &
+ ,xyzcen(2,iel),xyzcen(3,iel)
+ endif
+enddo
+
+!===============================================================================
+! 6. CALCUL DES BORNES ET IMPRESSIONS
+!===============================================================================
+ dismax = -grand
+ dismin = grand
+
+ do iel = 1, ncel
+ dismin = min(distpa(iel),dismin)
+ dismax = max(distpa(iel),dismax)
+ enddo
+
+ if (irangp.ge.0) then
+ call parmin(dismin)
+ call parmax(dismax)
+ endif
+
+! Impressions
+
+ write(nfecra,1000)dismin, dismax, nittot
+
+
+!===============================================================================
+! 7. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' ',/,&
+' ** DISTANCE A LA PAROI ',/,&
+' ------------------- ',/,&
+' ',/,&
+' Distance min = ',E14.5 ,' Distance max = ',E14.5 ,/,&
+' ',/,&
+' (Calcul de la distance realise en ',I10 ,' iterations)',/)
+
+ 5000 format(1X,A8,' : SWEEP = ',I5,' NORME SECOND MEMBRE = ',E14.6)
+
+ 8000 format( &
+'@ ',/,&
+'@ @@ ATTENTION : Calcul de la distance a la paroi ',/,&
+'@ ========= ',/,&
+'@ La variable associee ne converge pas a la cellule ',I10 ,/,&
+'@ Coord X Coord Y Coord Z ',/,&
+'@ ',3E13.5 ,/)
+
+#else
+
+ 1000 format( &
+' ',/,&
+' ** WALL DISTANCE ',/,&
+' ------------- ',/,&
+' ',/,&
+' Min distance = ',E14.5 ,' Max distance = ',E14.5 ,/,&
+' ',/,&
+' (Distance calculation done in ',I10 ,' iterations)' ,/)
+
+ 5000 format(1X,A8,' : SWEEP = ',I5,' RIGHT HAND SIDE NORM = ',E14.6)
+
+ 8000 format( &
+'@ ',/,&
+'@ @@ WARNING: Wall distance calculation ',/,&
+'@ ======== ',/,&
+'@ The associated variable does not converge in cell ',I10 ,/,&
+'@ Coord X Coord Y Coord Z ',/,&
+'@ ',3E13.5 ,/)
+
+#endif
+
+return
+end
diff --git a/src/base/distyp.f90 b/src/base/distyp.f90
new file mode 100644
index 0000000..f8a1126
--- /dev/null
+++ b/src/base/distyp.f90
@@ -0,0 +1,910 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine distyp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , isympa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ distpa , propce , uetbor , disty , &
+ dam , xam , smbdp , rovsdp , &
+ rtpdp , drtp , &
+ qx , qy , qz , coefq , rom , romb , &
+ flumas , flumab , &
+ coefax , coefbx , coefay , coefby , coefaz , coefbz , &
+ w1 , w2 , w3 , w4 , w5 , w6 , w7 , &
+ w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DE LA DISTANCE A LA PAROI PAR UTILISATION D'UNE EQUATION
+! DE TRANSPORT
+
+! On resout dT/dt + grad (T U) = Gamma Ti
+
+! avec U = grad(distance a la paroi)/||grad(distance a la paroi)||
+! Gamma = div U
+! Ti = T (puits ou injection a la valeur locale)
+! et aux parois
+! T = u*/nu
+! et ailleurs
+! grad(T).n = 0
+
+! on cherche un etat stationnaire
+
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! isympa ! te ! <-- ! zero pour annuler le flux de masse !
+! (nfabor ) ! ! ! (transmis mais non utilise) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! distpa(ncelet ! tr ! <-- ! tab des distances a la paroi !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! uetbor ! tr ! <-- ! vitesse de frottement au bord !
+! (nfabor,nphas ! ! ! pour van driest en les !
+! disty(ncelet) ! tr ! --> ! distance y+ !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! smbdp ! tr ! --- ! tableau de travail pour sec mem !
+! (ncelet) ! ! ! !
+! rovsdp ! tr ! --- ! tableau de travail pour terme instat !
+! (ncelet) ! ! ! !
+! rtpdp(ncelet) ! tr ! --- ! var de travail du sclaire diffuse !
+! drtp(ncelet) ! tr ! --- ! tableau de travail pour increment !
+! qx,y,z(ncelet ! tr ! --- ! normale aux iso-distance a la paroi !
+! coefq ! tr ! --- ! tableau de travail cl inimas !
+! (nfabor,ndim) ! ! ! !
+! rom(ncelet ! tr ! --- ! masse volumique aux cellules !
+! romb(nfabor) ! tr ! --- ! masse volumique aux bords !
+! flumas(nfac) ! tr ! --- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! --- ! flux de masse aux faces de bord !
+! coefax,y,z, b ! tr ! --- ! tableaux des cond lim pour qx, qy, qz !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "ppppar.h"
+include "coincl.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itypfb(nfabor,nphas),isympa(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision distpa(ncelet),propce(ncelet,*)
+double precision uetbor(nfabor,nphas)
+double precision disty(ncelet)
+double precision dam(ncelet) , xam(nfac,2)
+double precision smbdp(ncelet), rovsdp(ncelet)
+double precision rtpdp(ncelet), drtp(ncelet)
+double precision qx(ncelet) , qy(ncelet) , qz(ncelet)
+double precision coefq(nfabor,3)
+double precision rom(ncelet) ,romb(nfabor)
+double precision flumas(nfac) ,flumab(nfabor)
+double precision coefax(nfabor),coefbx(nfabor)
+double precision coefay(nfabor),coefby(nfabor)
+double precision coefaz(nfabor),coefbz(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer idimte, itenso
+integer idtva0, ivar , iconvp, idiffp
+integer ndircp, ireslp
+integer iescap, iflmb0, imaspe, iphydp
+integer ncymxp, nitmfp, ipp
+integer ifac , iel , ipcvis, init , ipcrom
+integer inc , iccocg, isym , ntcont, infpar
+
+double precision xnorme, dtminy, dtmaxy, relaxp, thetap, timey
+double precision xusnmx, xusnmn, xnorm0
+double precision dismax, dismin, usna
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+!===============================================================================
+! 2. AU PREMIER PAS DE TEMPS
+!===============================================================================
+
+! Au premier pas de temps, on a en general u* = 0 (ou faux)
+! on ne calcule pas y+
+
+! En effet ca prend du temps, d'autant plus que u* est petit, car il
+! alors calculer y+ jusqu'a une grande distance des parois
+
+if(ntcabs.eq.1) then
+
+ do iel = 1, ncel
+ disty(iel) = grand
+ enddo
+
+ if(iwarny.ge.1) then
+ write(nfecra,7000)
+ endif
+
+ return
+
+endif
+
+!===============================================================================
+! 3. CALCUL DE Q=Grad(DISTPA)/|Grad(DISTPA)|
+!===============================================================================
+
+! La distance a la paroi vaut 0 en paroi
+! par definition et obeit a un flux nul ailleurs
+
+do ifac = 1, nfabor
+ if(itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug ) then
+ coefax(ifac) = 0.0d0
+ coefbx(ifac) = 0.0d0
+ else
+ coefax(ifac) = 0.0d0
+ coefbx(ifac) = 1.0d0
+ endif
+enddo
+
+! Calcul du gradient
+
+if(irangp.ge.0) call parcom (distpa)
+ !==========
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+( idimte , itenso , &
+ distpa , distpa , distpa , &
+ distpa , distpa , distpa , &
+ distpa , distpa , distpa )
+endif
+
+inc = 1
+iccocg = 1
+iphydp = 0
+ivar = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgy , imligy , iphydp , &
+ iwarny , nfecra , epsrgy , climgy , extray , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ distpa , coefax , coefbx , &
+ qx , qy , qz , &
+! ------ ------ ------
+ w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+
+! Normalisation (attention, le gradient peut etre nul, parfois)
+
+do iel = 1, ncel
+ xnorme = max(sqrt(qx(iel)**2+qy(iel)**2+qz(iel)**2),epzero)
+ qx(iel) = qx(iel)/xnorme
+ qy(iel) = qy(iel)/xnorme
+ qz(iel) = qz(iel)/xnorme
+enddo
+
+!===============================================================================
+! 4. CALCUL DU FLUX DE Q ET DE GAMMA = div(Q)
+!===============================================================================
+
+
+do ifac = 1, nfabor
+ romb(ifac) = 1.d0
+enddo
+do iel = 1, ncelet
+ rom(iel) = 1.d0
+enddo
+
+
+! Le gradient normal de la distance a la paroi vaut -1 en paroi
+! par definition et obeit a un flux nul ailleurs
+
+do ifac = 1, nfabor
+ if(itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug) then
+ xnorme = max(ra(isrfbn+ifac-1),epzero**2)
+ coefax(ifac) = -surfbo(1,ifac)/xnorme
+ coefbx(ifac) = 0.d0
+ coefay(ifac) = -surfbo(2,ifac)/xnorme
+ coefby(ifac) = 0.d0
+ coefaz(ifac) = -surfbo(3,ifac)/xnorme
+ coefbz(ifac) = 0.d0
+ else
+ coefax(ifac) = 0.d0
+ coefbx(ifac) = 1.d0
+ coefay(ifac) = 0.d0
+ coefby(ifac) = 1.d0
+ coefaz(ifac) = 0.d0
+ coefbz(ifac) = 1.d0
+ endif
+enddo
+
+
+! Parallelisme en preparation du calcul du flux
+
+if(irangp.ge.0) then
+ call parcom (qx)
+ !==========
+ call parcom (qy)
+ !==========
+ call parcom (qz)
+ !==========
+endif
+
+if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+( idimte , itenso , &
+ qx , qx , qx , &
+ qy , qy , qy , &
+ qz , qz , qz )
+endif
+
+
+! Calcul du flux de masse
+
+! On ne le met pas a zero en paroi (justement)
+iflmb0 = 0
+! On l'initialise a 0
+init = 1
+! On prend en compte les Dirichlet
+inc = 1
+! On recalcule les gradients complets
+iccocg = 1
+! Calcul de flux std (pas de divrij)
+imaspe = 1
+! Il ne s'agit ni de U ni de R
+ivar = 0
+
+call inimas &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ivar , ivar , ivar , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgy , imligy , &
+ iwarny , nfecra , &
+ epsrgy , climgy , extray , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isympa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rom , romb , &
+ qx , qy , qz , &
+ coefax , coefay , coefaz , coefbx , coefby , coefbz , &
+ flumas , flumab , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefq , &
+ rdevel , rtuser , ra )
+
+
+
+! A partir d'ici, QX, QY et QZ sont des tableaux de travail.
+
+
+
+! Calcul de la divergence du flux de masse
+
+init = 1
+
+call divmas &
+!==========
+ ( ncelet , ncel , nfac , nfabor , init , nfecra , &
+ ifacel , ifabor , flumas , flumab , qx)
+
+!===============================================================================
+! 5.CONDITIONS LIMITES
+!===============================================================================
+
+! Dirichlet en u*/nu aux parois, et flux nul ailleurs
+
+do ifac = 1, nfabor
+ if(itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug) then
+ iel = ifabor(ifac)
+ coefax(ifac) = uetbor(ifac,iphas) &
+ *propce(iel,ipcrom)/propce(iel,ipcvis)
+ coefbx(ifac) = 0.0d0
+ else
+ coefax(ifac) = 0.0d0
+ coefbx(ifac) = 1.0d0
+ endif
+enddo
+
+!===============================================================================
+! 6.CALCUL DU PAS DE TEMPS
+!===============================================================================
+
+! On vise un Courant infini (de l'ordre de 1000).
+
+! On calcule avec MATRDT DAM = Sigma a S/d
+iconvp = 1
+idiffp = 0
+! La matrice est non symetrique
+isym = 2
+
+call matrdt &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconvp , idiffp , isym , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ coefbx , flumas , flumab , flumas , flumab , w2 , &
+ rdevel , rtuser , ra )
+
+! Le Courant est COUMXY = DT W2 / VOLUME
+! d'ou DTMINY = MIN(COUMXY * VOLUME/W2)
+! Au cas ou une cellule serait a W2(IEL)=0,
+! on ne la prend pas en compte
+
+! On prend dans QZ un pas de temps variable,
+! si on ne trouve pas de pas de temps, on prend le minimum
+! (cellules sources)
+dtminy = grand
+dtmaxy = -grand
+do iel = 1, ncel
+ qz(iel) = -grand
+ if(w2(iel).gt.epzero) then
+ qz(iel) = coumxy*volume(iel)/w2(iel)
+ dtminy = min(qz(iel),dtminy)
+ dtmaxy = max(qz(iel),dtmaxy)
+ endif
+enddo
+if(irangp.ge.0) then
+ call parmin (dtminy)
+ call parmax (dtmaxy)
+endif
+dtminy = max(dtminy,epzero)
+
+do iel = 1, ncel
+ if(qz(iel).le.0.d0) then
+ qz(iel) = dtminy
+ endif
+enddo
+
+if(iwarny.ge.2) then
+ write(nfecra,2000)dtminy,dtmaxy
+endif
+
+!===============================================================================
+! 7. DIAGONALE DE LA MATRICE
+!===============================================================================
+
+do iel = 1, ncel
+ rovsdp(iel) = volume(iel)*rom(iel)/qz(iel)-qx(iel)
+enddo
+
+!===============================================================================
+! 8. BOUCLE EN TEMPS
+!===============================================================================
+
+! Initialisations
+! =================
+
+! Iterations
+ntcont = 0
+
+! Temps
+timey = 0.d0
+
+
+
+! Inconnue
+! Au cas ou on n'atteint pas tout a fait l'etat stationnaire,
+! il faut que le yplus ne soit pas nul dans la zone ou les
+! conditions aux limites n'ont pas ete convectees. On voudrait
+! plutot que yplus y soit maximum.
+! Si on utilise zero ou une valeur negative comme initialisation,
+! on risque de se retrouver avec des valeurs proches de
+! zero issues de la diffusion due au schema upwind au voisinage
+! du front convecte et donc avec des yplus proches de zero
+! n'importe ou.
+! On va donc utiliser la valeur max de u*/nu.
+
+! A partir du second pas de temps, on a egalement le yplus du pas
+! de temps precedent
+
+! On calcule le min et le max
+xusnmx = -grand
+xusnmn = grand
+do ifac = 1, nfabor
+ if(itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug) then
+ xusnmx = max(xusnmx,coefax(ifac))
+ xusnmn = min(xusnmn,coefax(ifac))
+ endif
+enddo
+if(irangp.ge.0) then
+ call parmax (xusnmx)
+ call parmin (xusnmn)
+endif
+
+if(ipass.eq.1) then
+ do iel = 1, ncelet
+ rtpdp(iel) = xusnmx
+ enddo
+else
+ do iel = 1, ncel
+ usna = disty(iel)/max(distpa(iel),epzero)
+ usna = max(usna,xusnmn)
+ usna = min(usna,xusnmx)
+ rtpdp(iel) = usna
+ enddo
+endif
+
+! Norme de reference (moyenne des u*/nu)
+! (on divise par le nombre de faces)
+xnorm0 = 0.d0
+infpar = 0
+do ifac = 1, nfabor
+ if(itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug) then
+ infpar = infpar+1
+ xnorm0 = xnorm0 + coefax(ifac)**2
+ endif
+enddo
+if(irangp.ge.0) then
+ call parcpt (infpar)
+ call parsom (xnorm0)
+endif
+xnorm0 = xnorm0/dble(infpar)
+
+! Pour ne pas diviser par zero
+if(xnorm0.le.epzero**2) goto 100
+
+
+! Debut des iterations
+! ======================
+
+do ntcont = 1, ntcmxy
+
+! Instant (arbitrairement +DTMINY)
+ timey = timey + dtminy
+
+! -- Echange pour les cas paralleles
+! a la premiere iteration, c'est inutile (on a fait l'init sur NCELET)
+
+ if(ntcont.gt.1.or.ipass.gt.1) then
+
+ if(irangp.ge.0) call parcom (rtpdp)
+ !==========
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtpdp, rtpdp, rtpdp, &
+ rtpdp, rtpdp, rtpdp, &
+ rtpdp, rtpdp, rtpdp)
+ endif
+
+ endif
+
+
+! Sauvegarde de la solution pour test de convergence
+! ====================================================
+
+ do iel = 1, ncel
+ qy(iel) = rtpdp(iel)
+ enddo
+
+! Second membre
+! ===============
+! Obligatoirement a tous les pas de temps
+
+ do iel = 1, ncel
+ smbdp(iel) = qx(iel)*rtpdp(iel)
+ enddo
+
+! Resolution
+! ============
+
+! La variable n'est pas la vitesse ou une composante de Rij
+ ivar = 0
+! Le cas est convectif, non diffusif
+ iconvp = 1
+ idiffp = 0
+! Il y a des Dirichlet (car il y a des parois)
+ ndircp = 1
+! On resout par la methode automatique
+ ireslp = -1
+! Pas d'estimateurs, ni de multigrille (100 et 10 sont arbitraires)
+ iescap = 0
+ ncymxp = 100
+ nitmfp = 10
+! La case 1 est une poubelle
+ ipp = 1
+ NOMVAR(IPP) = 'YplusPar'
+! Ordre 1 en temps (etat stationnaire cherche)
+ thetap = 1.d0
+! Pas de stationnaire ni de relaxation -> a modifier eventuellement
+ idtva0 = 0
+ relaxp = 1.d0
+
+ call codits &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtva0 , ivar , iconvp , idiffp , ireslp , ndircp , nitmay , &
+ imrgra , nswrsy , nswrgy , imligy , ircfly , &
+ ischcy , isstpy , iescap , &
+ imgrpy , ncymxp , nitmfp , ipp , iwarny , &
+ blency , epsily , epsrsy , epsrgy , climgy , extray , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpdp , rtpdp , &
+ coefax , coefbx , coefax , coefbx , flumas , flumab , &
+ flumas , flumab , flumas , flumab , &
+ rovsdp , smbdp , rtpdp , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! Clipping (indispensable si on initialise par u*/nu du pas de
+! ========== temps precedent)
+
+ do iel = 1, ncel
+ rtpdp(iel) = max(rtpdp(iel),xusnmn)
+ rtpdp(iel) = min(rtpdp(iel),xusnmx)
+ enddo
+
+! Test d'arret
+! ==============
+
+! on utilise QY dans lequel la solution precedente a ete sauvee
+! on souhaite que la variation de l'inconnue sur chaque cellule
+! soit inferieure a un pourcentage de la valeur moyenne de
+! u*/nu calculee sur les faces de bord
+! on limite le test aux cellules qui pourront avoir un interet pour
+! VanDriest, c'est a dire qu'on ignore celles a y+ > YPLMXY
+! comme on ne connait pas encore y+, on se base sur min(u*/nu) :
+! on ignore les cellules a y min(u*/nu) > YPLMXY
+
+! XNORME = 0.D0
+! DO IEL = 1, NCEL
+! XNORME = XNORME + (RTPDP(IEL)-QY(IEL))**2
+! ENDDO
+! IF(IRANGP.GE.0) THEN
+! CALL PARSOM (XNORME)
+! ENDIF
+! XNORME = XNORME/DBLE(NCELGB)
+
+ xnorme = -grand
+ do iel = 1, ncel
+ if(distpa(iel)*xusnmn.le.yplmxy) then
+ xnorme = max(xnorme,(rtpdp(iel)-qy(iel))**2)
+ endif
+ enddo
+ if(irangp.ge.0) then
+ call parmax (xnorme)
+ endif
+
+ if(iwarny.ge.2) then
+ write(nfecra,3000)ntcont,xnorme,xnorm0,xnorme/xnorm0
+ endif
+
+ if(xnorme.le.epscvy*xnorm0) goto 100
+
+enddo
+
+write(nfecra,8000)xnorme,xnorm0,xnorme/xnorm0,ntcmxy
+
+ 100 continue
+
+!===============================================================================
+! 9. CALCUL DE YPLUS ET IMPRESSIONS
+!===============================================================================
+
+
+do iel = 1, ncel
+ disty(iel) = rtpdp(iel)*distpa(iel)
+enddo
+
+dismax = -grand
+dismin = grand
+
+do iel = 1, ncel
+ dismin = min(disty(iel),dismin)
+ dismax = max(disty(iel),dismax)
+enddo
+
+if (irangp.ge.0) then
+ call parmin(dismin)
+ call parmax(dismax)
+endif
+
+if(iwarny.ge.1) then
+ write(nfecra,1000)dismin, dismax, min(ntcont,ntcmxy)
+endif
+
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' ',/,&
+' ** DISTANCE A LA PAROI ADIMENSIONNELLE ',/,&
+' ------------------------------------ ',/,&
+' ',/,&
+' Distance+ min = ',E14.5 ,' Distance+ max = ',E14.5 ,/,&
+' ',/,&
+' (Calcul de la distance realise en ',I10 ,' iterations)',/)
+ 2000 format( &
+' ',/,&
+' ** DISTANCE A LA PAROI ADIMENSIONNELLE ',/,&
+' ------------------------------------ ',/,&
+' ',/,&
+' Yplus: Dt min = ',E14.5 ,' Dt max = ',E14.5 ,/)
+ 3000 format( &
+' ',/,&
+' ** DISTANCE A LA PAROI ADIMENSIONNELLE ',/,&
+' ------------------------------------ ',/,&
+' ',/,&
+' Yplus: iteration residu abs. reference residu rel. ',/,&
+' Yplus: ',I10 ,E14.5 ,E14.5 ,E14.5 ,/)
+ 7000 format( &
+' ',/,&
+' ** DISTANCE A LA PAROI ADIMENSIONNELLE ',/,&
+' ------------------------------------ ',/,&
+' ',/,&
+' Elle n''est pas calculee au premier pas de temps ',/)
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : Calcul de la distance a la paroi ',/,&
+'@ ========= ',/,&
+'@ Le systeme iteratif pour le calcul de la distance a la ',/,&
+'@ paroi adimensionnelle est imparfaitement converge. ',/,&
+'@ ',/,&
+'@ Residu Reference Residu relatif ',/,&
+'@ ',2E14.5,12X,E14.5 ,/,&
+'@ ',/,&
+'@ Augmenter la valeur de NTCMXY dans usini1 peut resoudre',/,&
+'@ le probleme. ',/,&
+'@ La valeur actuelle de cet entier est ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+' ',/,&
+' ** DIMENSIONLESS WALL DISTANCE ',/,&
+' --------------------------- ',/,&
+' ',/,&
+' Min distance+ = ',E14.5 ,' Max distance+ = ',E14.5 ,/,&
+' ',/,&
+' (Distance calculation done in ',I10 ,' iterations)' ,/)
+ 2000 format( &
+' ',/,&
+' ** DIMENSIONLESS WALL DISTANCE ',/,&
+' --------------------------- ',/,&
+' ',/,&
+' Yplus: Min dt = ',E14.5 ,' Max dt = ',E14.5 ,/)
+ 3000 format( &
+' ',/,&
+' ** DIMENSIONLESS WALL DISTANCE ',/,&
+' --------------------------- ',/,&
+' ',/,&
+' Yplus: iteration abs. residu reference rel. residu ',/,&
+' Yplus: ',I10 ,E14.5 ,E14.5 ,E14.5 ,/)
+ 7000 format( &
+' ',/,&
+' ** DIMENSIONLESS WALL DISTANCE ',/,&
+' --------------------------- ',/,&
+' ',/,&
+' It is not computed at the first time step ',/)
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: Dimensionless distance to the wall computation ',/,&
+'@ ======== ',/,&
+'@ The iterative system for the dimensionless distance to ',/,&
+'@ the wall calculation has not properly converged. ',/,&
+'@ ',/,&
+'@ Residual Reference Relative residual ',/,&
+'@ ',2E14.5,12X,E14.5 ,/,&
+'@ ',/,&
+'@ Increase the value of NTCMXY in usini1 may solve ',/,&
+'@ the problem. ',/,&
+'@ The current value of this integer is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+
+
+return
+end
diff --git a/src/base/divmas.f90 b/src/base/divmas.f90
new file mode 100644
index 0000000..76b4c16
--- /dev/null
+++ b/src/base/divmas.f90
@@ -0,0 +1,177 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine divmas &
+!================
+
+ ( ncelet , ncel , nfac , nfabor , &
+ init , nfecra , &
+ ifacel , ifabor , &
+ flumas , flumab , &
+ diverg )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! INTEGRATION DU FLUX DE MASSE SUR LES CELLULES
+
+! . . -- .
+! m = m + \ m
+! i i /__ ij
+! j
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! init ! e ! <-- ! indicateur > 0 remise a 0 de diverg !
+! ifacel(2,nfac ! te ! <-- ! no des elts voisins d'une face intern !
+! ifabor(nfabor ! te ! <-- ! no de l'elt voisin d'une face de bord !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! diverg(ncelet ! tr ! <-- ! divergence de flumas flumab !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "vector.h"
+
+!===============================================================================
+
+
+integer ncelet , ncel , nfac , nfabor
+integer init , nfecra
+
+integer ifacel(2,nfac), ifabor(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision diverg(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel, ifac, ii, jj
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+if( init.ge.1 ) then
+ do iel = 1, ncelet
+ diverg(iel) = 0.d0
+ enddo
+elseif( init.eq.0.and.ncelet.gt.ncel ) then
+ do iel = ncel+1, ncelet
+ diverg(iel) = 0.d0
+ enddo
+elseif(init.ne.0) then
+ write(nfecra,1000) init
+ call csexit (1)
+endif
+
+
+!===============================================================================
+! 2. INTEGRATION SUR LES FACETTES INTERNES
+!===============================================================================
+
+if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ diverg(ii) = diverg(ii) +flumas(ifac)
+ diverg(jj) = diverg(jj) -flumas(ifac)
+ enddo
+
+else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ diverg(ii) = diverg(ii) +flumas(ifac)
+ diverg(jj) = diverg(jj) -flumas(ifac)
+ enddo
+
+endif
+
+
+!===============================================================================
+! 3. INTEGRATION SUR LES FACETTES DE BORD
+!===============================================================================
+
+if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ diverg(ii) = diverg(ii) +flumab(ifac)
+ enddo
+
+else
+
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ diverg(ii) = diverg(ii) +flumab(ifac)
+ enddo
+
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format('DIVMAS APPELE AVEC INIT = ',I10)
+
+#else
+
+ 1000 format('DIVMAS CALLED WITH INIT = ',I10)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/divrij.f90 b/src/base/divrij.f90
new file mode 100644
index 0000000..95498e4
--- /dev/null
+++ b/src/base/divrij.f90
@@ -0,0 +1,310 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine divrij &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , idim , ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! DISPOSANT DU TENSEUR Rij
+! ON CALCULE LE TERME EN DIV INTERVENANT DANS L'EQUATION
+! DE LA VITESSE
+! ON PRODUIT DONC SOMME (Rij)kl Skl nkl
+! (Rij)kl EST LA VALEUR A LA FACE kl
+! Skl EST LA SURFACE DE LA FACE kl
+! nkl EST LE VECTEUR NORMAL A kl NORME
+! ON SOMME SUR TROIS COMPOSANTES DU TENSEUR
+! ON OBTIENT DONC UNE VALEUR PAR FACE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idim ! e ! <-- ! composante traitee !
+! ivar ! e ! <-- ! numero de variable courante !
+! iphas ! e ! <-- ! numero de phase courante !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! viscf(nfac) ! tr ! --> ! resultat du calcul !
+! viscb(nfabor) ! tr ! --> ! resultat du calcul !
+! w1-w9(ncelet) ! tr ! --- ! tableau de travail !
+! coefu(nfab,4) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstphy.h"
+include "optcal.h"
+include "pointe.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer idim , ivar , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision coefu(nfabor,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ivar1, ivar2, ivar3, init, inc
+integer iccocg,iflmb0
+integer iuiph , iviph , iwiph
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ipcrom, ipbrom
+integer iclva1, iclva2, iclva3
+integer nswrgp, imligp, iwarnp
+integer iismph, imaspe
+double precision epsrgp, climgp, extrap
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Variables
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+
+! --- Masse volumique
+ipcrom = ipproc(irom (iphas))
+ipbrom = ipprob(irom (iphas))
+
+! --- Variables locales (Rij)
+if(ivar.eq.iuiph) then
+ ivar1 = ir11ip
+ ivar2 = ir12ip
+ ivar3 = ir13ip
+elseif(ivar.eq.iviph) then
+ ivar1 = ir12ip
+ ivar2 = ir22ip
+ ivar3 = ir23ip
+elseif(ivar.eq.iwiph) then
+ ivar1 = ir13ip
+ ivar2 = ir23ip
+ ivar3 = ir33ip
+endif
+
+! --- Conditions aux limites des variables locales (Rij)
+iclva1 = iclrtp(ivar1,icoef)
+iclva2 = iclrtp(ivar2,icoef)
+iclva3 = iclrtp(ivar3,icoef)
+
+!===============================================================================
+! 2. CALCUL DE LA DIVERGENCE
+!===============================================================================
+
+! --- Options de calcul
+init = 1
+inc = 1
+iccocg = 1
+iflmb0 = 0
+nswrgp = nswrgr(ir11ip)
+imligp = imligr(ir11ip)
+iwarnp = iwarni(ir11ip)
+epsrgp = epsrgr(ir11ip)
+climgp = climgr(ir11ip)
+extrap = extrag(ir11ip)
+
+iismph = iisymp +nfabor*(iphas-1)
+
+imaspe = 2
+
+call inimas &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ivar1 , ivar2 , ivar3 , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ rtpa(1,ivar1) , rtpa(1,ivar2) , rtpa(1,ivar3) , &
+ coefa(1,iclva1) , coefa(1,iclva2) , coefa(1,iclva3) , &
+ coefb(1,iclva1) , coefb(1,iclva2) , coefb(1,iclva3) , &
+ viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+
+! Calcul des efforts aux bords (partie 5/5), si necessaire
+
+if (ineedf.eq.1) then
+ do ifac = 1, nfabor
+ ra(iforbr+(ifac-1)*ndim+idim-1) = &
+ ra(iforbr+(ifac-1)*ndim+idim-1) + viscb(ifac)
+ enddo
+endif
+
+return
+end
diff --git a/src/base/dttvar.f90 b/src/base/dttvar.f90
new file mode 100644
index 0000000..7b2be75
--- /dev/null
+++ b/src/base/dttvar.f90
@@ -0,0 +1,1143 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine dttvar &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iwarnp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ viscf , viscb , dam , cofbdt , w1 , w2 , w3 , &
+ coefbr , grarox , graroy , graroz , wcf , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DU PAS DE TEMPS LOCAL
+! AFFICHAGE DES NOMBRES DE COURANT + FOURIER MINIMUM, MAXIMUM
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! Sous programme utilise dans le cas une seule phase (ou
+! si seule la phase 1 pilote le pas de temps)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules avec tsm !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,nvar) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! cofbdt(nfabor ! tr ! --- ! condition limite pas de temps !
+! w1,2,3(ncelet ! tr ! --- ! tableaux de travail !
+! graro.(ncelet ! tr ! --- ! tableaux de travail (iptlro=1) !
+! coefbr(nfabor ! tr ! --- ! tableau de travail (iptlro=1) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iwarnp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet ), cofbdt(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+! Attention, COEFBR n'est defini que pour IPTLRO = 1
+double precision coefbr(nfabor)
+! Attention, GRAROX, GRAROY, GRAROZ ne sont
+! definis que pour IPTLRO = 1 ou en compressible
+double precision grarox(ncelet),graroy(ncelet),graroz(ncelet)
+! Attention, WCF n'est defini qu'en compressible
+double precision wcf(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*8 cnom
+integer idebia, idebra
+integer ifac, iel, icfmax, icfmin, idiff0, iconv0, isym
+integer modntl
+integer iphas, iuiph, ipcvis, ipcvst
+integer iflmas, iflmab
+integer icou, ifou , icoucf
+integer inc, iccocg
+integer nswrgp, imligp , iphydp
+integer ipcrom, ipbrom, iivar
+integer nbrval
+integer ipccou, ipcfou
+double precision epsrgp, climgp, extrap
+double precision cfmax,cfmin, coufou, w1min, w2min, w3min
+double precision unpvdt, rom
+double precision xyzmax(3), xyzmin(3)
+double precision dtsdtm,dtsdt0
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+iuiph = iu(iphas)
+iflmas = ipprof(ifluma(iuiph))
+iflmab = ipprob(ifluma(iuiph))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+ipcrom = ipproc(irom (iphas))
+ipbrom = ipprob(irom (iphas))
+ipccou = ipproc(icour (iphas))
+ipcfou = ipproc(ifour (iphas))
+
+if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+else
+ modntl = 1
+endif
+
+if ( &
+ .not. ( iconv(iuiph).ge.1.and. &
+ (iwarnp.ge.2.or.modntl.eq.0) ) .and. &
+ .not. ( idiff(iuiph).ge.1.and. &
+ (iwarnp.ge.2.or.modntl.eq.0) ) .and. &
+ .not. ( ippmod(icompf).ge.0.and. &
+ (iwarnp.ge.2.or.modntl.eq.0) ) .and. &
+ .not. ( idtvar.eq.1.or.idtvar.eq.2.or. &
+ ( (iwarnp.ge.2.or.modntl.eq.0).and. &
+ (idiff(iuiph).ge.1.or.iconv(iuiph).ge.1 &
+ .or.ippmod(icompf).ge.0) ) ) &
+ ) then
+
+ return
+
+endif
+
+!===============================================================================
+! 1. CONDITION LIMITE POUR MATRDT
+!===============================================================================
+
+
+do ifac = 1, nfabor
+ if(propfb(ifac,iflmab).lt.0.d0) then
+ cofbdt(ifac) = 0.d0
+ else
+ cofbdt(ifac) = 1.d0
+ endif
+enddo
+
+!===============================================================================
+! 2. CALCUL DE LA LIMITATION EN COMPRESSIBLE
+!===============================================================================
+
+! On commence par cela afin de disposer de VISCF VISCB comme
+! tableaux de travail.
+
+ if(ippmod(icompf).ge.0) then
+
+ call cfdttv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iwarnp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ wcf , &
+! ---
+ viscf , viscb , cofbdt , w1 , w2 , dam , &
+ grarox , graroy , graroz , &
+ rdevel , rtuser , ra )
+
+ endif
+
+
+!===============================================================================
+! 3. CALCUL DE LA VISCOSITE FACETTES
+!===============================================================================
+
+
+! On s'en sert dans les divers matrdt suivants
+
+! "VITESSE" DE DIFFUSION FACETTE
+
+if( idiff(iuiph).ge. 1 ) then
+ do iel = 1, ncel
+ w1 (iel) = propce(iel,ipcvis) &
+ +idifft(iuiph)*propce(iel,ipcvst)
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+endif
+
+!===============================================================================
+! 4. ALGORITHME INSTATIONNAIRE
+!===============================================================================
+
+if (idtvar.ge.0) then
+
+!===============================================================================
+! 4.1 PAS DE TEMPS VARIABLE A PARTIR DE COURANT ET FOURIER IMPOSES
+!===============================================================================
+
+! On calcule le pas de temps thermique max (meme en IDTVAR=0, pour affichage)
+! DTTMAX = 1/SQRT(MAX(0+,gradRO.g/RO) -> W3
+
+ if (iptlro.eq.1) then
+
+ do ifac = 1, nfabor
+ coefbr(ifac) = 0.d0
+ enddo
+
+ nswrgp = nswrgr(ipr(iphas))
+ imligp = imligr(ipr(iphas))
+ iwarnp = iwarni(ipr(iphas))
+ epsrgp = epsrgr(ipr(iphas))
+ climgp = climgr(ipr(iphas))
+ extrap = 0.d0
+ iphydp = 0
+
+ iivar = 0
+ inc = 1
+ iccocg = 1
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ propce(1,ipcrom), propfb(1,ipbrom), coefbr , &
+ grarox , graroy , graroz , &
+! ------ ------ ------
+ w1 , w2 , dam , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ w3(iel) = (grarox(iel)*gx + graroy(iel)*gy + graroz(iel)*gz)&
+ /propce(iel,ipcrom)
+ w3(iel) = 1.d0/sqrt(max(epzero,w3(iel)))
+
+ enddo
+
+! On met le nombre de clippings a 0 (il le restera pour IDTVAR=0)
+ nclptr = 0
+
+ endif
+
+
+ if (idtvar.eq.1.or.idtvar.eq.2) then
+
+ icou = 0
+ ifou = 0
+
+! 4.1.1 LIMITATION PAR LE COURANT
+! =============================
+
+ if ( coumax.gt.0.d0.and.iconv(iuiph).ge.1 ) then
+
+! ICOU = 1 marque l'existence d'une limitation par le COURANT
+ icou = 1
+
+! ---> CONSTRUCTION DE U/DX (COURANT ) =W1
+
+ idiff0 = 0
+
+! Matrice a priori non symetrique
+ isym = 2
+
+ call matrdt &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconv(iuiph) , idiff0 , isym , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ cofbdt , propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ dam , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ rom = propce(iel,ipcrom)
+ w1 (iel) = dam(iel)/(rom*volume(iel))
+ enddo
+
+! ---> CALCUL DE W1 = PAS DE TEMPS VARIABLE VERIFIANT
+! LE NOMBRE DE COURANT MAXIMUM PRESCRIT PAR L'UTILISATEUR
+
+ do iel = 1, ncel
+ w1 (iel) = coumax/max( w1 (iel), epzero)
+ enddo
+
+! ---> PAS DE TEMPS UNIFORME : ON PREND LE MINIMUM DE LA CONTRAINTE
+
+ if (idtvar.eq.1) then
+ w1min = grand
+ do iel = 1, ncel
+ w1min = min(w1min,w1(iel))
+ enddo
+ if (irangp.ge.0) then
+ call parmin (w1min)
+ !==========
+ endif
+ do iel = 1, ncel
+ w1(iel) = w1min
+ enddo
+ endif
+
+ endif
+
+! 4.1.2 LIMITATION PAR LE FOURIER
+! =============================
+
+ if ( foumax.gt.0.d0.and.idiff(iuiph).ge.1 ) then
+
+! IFOU = 1 marque l'existence d'une limitation par le FOURIER
+ ifou = 1
+
+ iconv0 = 0
+! 2
+! ---> CONSTRUCTION DE +2.NU/DX ( FOURIER) =W2
+
+! Matrice a priori symetrique
+ isym = 1
+
+ call matrdt &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconv0 , idiff(iuiph) , isym , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ cofbdt , propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ dam , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ rom = propce(iel,ipcrom)
+ w2 (iel) = dam(iel)/(rom*volume(iel))
+ enddo
+
+! ---> CALCUL DE W2 = PAS DE TEMPS VARIABLE VERIFIANT
+! LE NOMBRE DE FOURIER MAXIMUM PRESCRIT PAR L'UTILISATEUR
+
+ do iel = 1, ncel
+ w2 (iel) = foumax/max( w2 (iel), epzero)
+ enddo
+
+! ---> PAS DE TEMPS UNIFORME : ON PREND LE MINIMUM DE LA CONTRAINTE
+
+ if (idtvar.eq.1) then
+ w2min = grand
+ do iel = 1, ncel
+ w2min = min(w2min,w2(iel))
+ enddo
+ if (irangp.ge.0) then
+ call parmin (w2min)
+ !==========
+ endif
+ do iel = 1, ncel
+ w2(iel) = w2min
+ enddo
+ endif
+
+ endif
+
+! 4.1.3 LIMITATION POUR L'ALGORITHME COMPRESSIBLE
+! =============================================
+! Il est important de conserver WCF intact : on le reutilise
+! plus bas pour l'affichage
+
+ icoucf = 0
+ if ( coumax.gt.0.d0.and.ippmod(icompf).ge.0 ) then
+
+ icoucf = 1
+
+! ---> CALCUL DE DAM = PAS DE TEMPS VARIABLE VERIFIANT
+! LA CONTRAINTE CFL MAXIMUM PRESCRITE PAR L'UTILISATEUR
+
+ do iel = 1, ncel
+ dam(iel) = coumax/max( wcf(iel), epzero)
+ enddo
+
+! ---> PAS DE TEMPS UNIFORME : ON PREND LE MINIMUM DE LA CONTRAINTE
+
+ if (idtvar.eq.1) then
+ w3min = grand
+ do iel = 1, ncel
+ w3min = min(w3min,dam(iel))
+ enddo
+ if (irangp.ge.0) then
+ call parmin (w3min)
+ !==========
+ endif
+ do iel = 1, ncel
+ dam(iel) = w3min
+ enddo
+ endif
+
+ endif
+
+! 4.1.4 ON PREND LA PLUS CONTRAIGNANTE DES LIMITATIONS
+! ==================================================
+! (le minimum des deux si elles existent et
+! celle qui existe s'il n'en existe qu'une)
+
+ if(icou.eq.1.and.ifou.eq.1) then
+ do iel = 1, ncel
+ w1(iel) = min(w1(iel),w2(iel))
+ enddo
+ elseif(icou.eq.0.and.ifou.eq.1) then
+ do iel = 1, ncel
+ w1(iel) = w2(iel)
+ enddo
+ endif
+
+
+! En compressible, on prend obligatoirement
+! en compte la limitation associee � la masse volumique.
+
+ if(icoucf.eq.1) then
+ do iel = 1, ncel
+ w1(iel) = min(w1(iel),dam(iel))
+ enddo
+ endif
+
+! 4.1.5 ON CALCULE EFFECTIVEMENT LE PAS DE TEMPS
+! ============================================
+
+! ---> MONTEE PROGRESSIVE DU PAS DE TEMPS
+! DESCENTE IMMEDIATE DU PAS DE TEMPS
+
+ do iel = 1, ncel
+ if( w1 (iel).ge.dt(iel) ) then
+ unpvdt = 1.d0+varrdt
+ dt(iel) = min( unpvdt*dt(iel), w1 (iel) )
+ else
+ dt(iel) = w1 (iel)
+ endif
+ enddo
+
+
+! 4.1.6 ON LIMITE PAR LE PAS DE TEMPS "THERMIQUE" MAX
+! =================================================
+! DTTMAX = W3 = 1/SQRT(MAX(0+,gradRO.g/RO)
+! on limite le pas de temps a DTTMAX
+
+ if (iptlro.eq.1) then
+
+
+! On clippe le pas de temps a DTTMAX
+! (affiche dans ecrlis)
+
+ nclptr = 0
+
+ do iel = 1, ncel
+ if ( dt(iel).gt.w3(iel) ) then
+ nclptr = nclptr +1
+ dt(iel) = w3(iel)
+ endif
+ enddo
+
+ if (irangp.ge.0) then
+ call parcpt (nclptr)
+ !==========
+ endif
+
+! ---> PAS DE TEMPS UNIFORME : on reuniformise le pas de temps
+
+ if (idtvar.eq.1) then
+ w3min = grand
+ do iel = 1, ncel
+ w3min = min(w3min,dt(iel))
+ enddo
+ if (irangp.ge.0) then
+ call parmin (w3min)
+ !==========
+ endif
+ do iel = 1, ncel
+ dt(iel) = w3min
+ enddo
+ endif
+
+ endif
+
+! 4.1.7 ON CLIPPE LE PAS DE TEMPS PAR RAPPORT A DTMIN ET DTMAX
+! ==========================================================
+
+ icfmin = 0
+ icfmax = 0
+
+ do iel = 1, ncel
+
+ if( dt(iel).gt.dtmax ) then
+ icfmax = icfmax +1
+ dt(iel) = dtmax
+ endif
+ if( dt(iel).lt.dtmin ) then
+ icfmin = icfmin +1
+ dt(iel) = dtmin
+ endif
+
+ enddo
+
+ if (irangp.ge.0) then
+ call parcpt (icfmin)
+ !==========
+ call parcpt (icfmax)
+ !==========
+ endif
+
+ iclpmx(ippdt) = icfmax
+ iclpmn(ippdt) = icfmin
+
+ if( iwarnp.ge.2) then
+ write (nfecra,1003) icfmin,dtmin,icfmax,dtmax
+ endif
+
+ endif
+
+! Rapport DT sur DTmax lie aux effets de densite
+! (affichage dans ecrlis)
+ if (iptlro.eq.1) then
+
+ dtsdtm = 0.d0
+ do iel = 1, ncel
+ dtsdt0 = dt(iel)/w3(iel)
+ if ( dtsdt0 .gt. dtsdtm ) then
+ dtsdtm = dtsdt0
+ icfmax = iel
+ endif
+ enddo
+ xyzmax(1) = xyzcen(1,icfmax)
+ xyzmax(2) = xyzcen(2,icfmax)
+ xyzmax(3) = xyzcen(3,icfmax)
+
+ if (irangp.ge.0) then
+ nbrval = 3
+ call parmxl (nbrval, dtsdtm, xyzmax)
+ !==========
+ endif
+ rpdtro(1) = dtsdtm
+ rpdtro(2) = xyzmax(1)
+ rpdtro(3) = xyzmax(2)
+ rpdtro(4) = xyzmax(3)
+
+ endif
+
+!===============================================================================
+! 4.2 CALCUL DU NOMBRE DE COURANT POUR AFFICHAGE
+!===============================================================================
+
+ if ( iconv(iuiph).ge.1.and. &
+ (iwarnp.ge.2.or.modntl.eq.0) ) then
+
+ idiff0 = 0
+ CNOM =' COURANT'
+
+! CONSTRUCTION DE U/DX (COURANT ) =W1
+
+! MATRICE A PRIORI NON SYMETRIQUE
+
+ isym = 2
+
+ call matrdt &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconv(iuiph) , idiff0 , isym , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ cofbdt , propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ dam , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ rom = propce(iel,ipcrom)
+ w1 (iel) = dam(iel)/(rom*volume(iel))
+ enddo
+
+! CALCUL DU NOMBRE DE COURANT/FOURIER MAXIMUM ET MINIMUM
+
+ cfmax = -grand
+ cfmin = grand
+ icfmax= 0
+ icfmin= 0
+
+ do iel = 1, ncel
+
+ coufou = w1(iel)*dt(iel)
+ propce(iel,ipccou) = coufou
+
+ if( coufou.le.cfmin ) then
+ cfmin = coufou
+ icfmin = iel
+ endif
+
+ if( coufou.ge.cfmax ) then
+ cfmax = coufou
+ icfmax = iel
+ endif
+
+ enddo
+
+ xyzmin(1) = xyzcen(1,icfmin)
+ xyzmin(2) = xyzcen(2,icfmin)
+ xyzmin(3) = xyzcen(3,icfmin)
+ xyzmax(1) = xyzcen(1,icfmax)
+ xyzmax(2) = xyzcen(2,icfmax)
+ xyzmax(3) = xyzcen(3,icfmax)
+
+ if (irangp.ge.0) then
+ nbrval = 3
+ call parmnl (nbrval, cfmin, xyzmin)
+ !==========
+ call parmxl (nbrval, cfmax, xyzmax)
+ !==========
+ endif
+
+ if(iwarnp.ge.2) then
+ write(nfecra,1001) cnom,cfmax,xyzmax(1),xyzmax(2),xyzmax(3)
+ write(nfecra,1002) cnom,cfmin,xyzmin(1),xyzmin(2),xyzmin(3)
+ endif
+
+! -> pour listing
+ ptploc(1,1) = cfmin
+ ptploc(1,2) = xyzmin(1)
+ ptploc(1,3) = xyzmin(2)
+ ptploc(1,4) = xyzmin(3)
+ ptploc(2,1) = cfmax
+ ptploc(2,2) = xyzmax(1)
+ ptploc(2,3) = xyzmax(2)
+ ptploc(2,4) = xyzmax(3)
+
+ endif
+
+!===============================================================================
+! 4.3 CALCUL DU NOMBRE DE FOURIER POUR AFFICHAGE
+!===============================================================================
+
+ if ( idiff(iuiph).ge.1.and. &
+ (iwarnp.ge.2.or.modntl.eq.0) ) then
+
+ iconv0 = 0
+ CNOM =' FOURIER'
+! 2
+! CONSTRUCTION DE +2.NU/DX ( FOURIER) =W1
+
+! MATRICE A PRIORI SYMETRIQUE
+
+ isym = 1
+
+ call matrdt &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconv0 , idiff(iuiph) , isym , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ cofbdt , propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ dam , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ rom = propce(iel,ipcrom)
+ w1 (iel) = dam(iel)/(rom*volume(iel))
+ enddo
+
+! CALCUL DU NOMBRE DE COURANT/FOURIER MAXIMUM ET MINIMUM
+
+ cfmax = -grand
+ cfmin = grand
+ icfmax = 0
+ icfmin = 0
+
+ do iel = 1, ncel
+
+ coufou = w1(iel)*dt(iel)
+ propce(iel,ipcfou) = coufou
+
+ if( coufou.le.cfmin ) then
+ cfmin = coufou
+ icfmin = iel
+ endif
+
+ if( coufou.ge.cfmax ) then
+ cfmax = coufou
+ icfmax = iel
+ endif
+
+ enddo
+
+ xyzmin(1) = xyzcen(1,icfmin)
+ xyzmin(2) = xyzcen(2,icfmin)
+ xyzmin(3) = xyzcen(3,icfmin)
+ xyzmax(1) = xyzcen(1,icfmax)
+ xyzmax(2) = xyzcen(2,icfmax)
+ xyzmax(3) = xyzcen(3,icfmax)
+
+ if (irangp.ge.0) then
+ nbrval = 3
+ call parmnl (nbrval, cfmin, xyzmin)
+ !==========
+ call parmxl (nbrval, cfmax, xyzmax)
+ !==========
+ endif
+
+ if(iwarnp.ge.2) then
+ write(nfecra,1001) cnom,cfmax,xyzmax(1),xyzmax(2),xyzmax(3)
+ write(nfecra,1002) cnom,cfmin,xyzmin(1),xyzmin(2),xyzmin(3)
+ endif
+
+! -> pour listing
+ ptploc(3,1) = cfmin
+ ptploc(3,2) = xyzmin(1)
+ ptploc(3,3) = xyzmin(2)
+ ptploc(3,4) = xyzmin(3)
+ ptploc(4,1) = cfmax
+ ptploc(4,2) = xyzmax(1)
+ ptploc(4,3) = xyzmax(2)
+ ptploc(4,4) = xyzmax(3)
+
+ endif
+
+!===============================================================================
+! 4.4 CALCUL DU NOMBRE DE COURANT/FOURIER POUR AFFICHAGE
+!===============================================================================
+
+! En incompressible uniquement (en compressible, on preferera
+! afficher la contrainte liee a la masse volumique)
+
+ if ( (iwarnp.ge.2.or.modntl.eq.0).and. &
+ (idiff(iuiph).ge.1.or.iconv(iuiph).ge.1) &
+ .and.(ippmod(icompf).lt.0) ) then
+
+ CNOM =' COU/FOU'
+! 2
+! CONSTRUCTION DE U/DX +2.NU/DX (COURANT +FOURIER) =W1
+
+! MATRICE A PRIORI NON SYMETRIQUE
+
+ isym = 1
+ if (iconv(iuiph).gt.0) isym = 2
+
+ call matrdt &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconv(iuiph) , idiff(iuiph) , isym , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ cofbdt , propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ dam , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ rom = propce(iel,ipcrom)
+ w1 (iel) = dam(iel)/(rom*volume(iel))
+ enddo
+
+! CALCUL DU NOMBRE DE COURANT/FOURIER MAXIMUM ET MINIMUM
+
+ cfmax = -grand
+ cfmin = grand
+ icfmax = 0
+ icfmin = 0
+
+ do iel = 1, ncel
+
+ coufou = w1(iel)*dt(iel)
+
+ if( coufou.le.cfmin ) then
+ cfmin = coufou
+ icfmin = iel
+ endif
+
+ if( coufou.ge.cfmax ) then
+ cfmax = coufou
+ icfmax = iel
+ endif
+
+ enddo
+
+ xyzmin(1) = xyzcen(1,icfmin)
+ xyzmin(2) = xyzcen(2,icfmin)
+ xyzmin(3) = xyzcen(3,icfmin)
+ xyzmax(1) = xyzcen(1,icfmax)
+ xyzmax(2) = xyzcen(2,icfmax)
+ xyzmax(3) = xyzcen(3,icfmax)
+
+ if (irangp.ge.0) then
+ nbrval = 3
+ call parmnl (nbrval, cfmin, xyzmin)
+ !==========
+ call parmxl (nbrval, cfmax, xyzmax)
+ !==========
+ endif
+
+ if(iwarnp.ge.2) then
+ write(nfecra,1001) cnom,cfmax,xyzmax(1),xyzmax(2),xyzmax(3)
+ write(nfecra,1002) cnom,cfmin,xyzmin(1),xyzmin(2),xyzmin(3)
+ endif
+
+! -> pour listing
+ ptploc(5,1) = cfmin
+ ptploc(5,2) = xyzmin(1)
+ ptploc(5,3) = xyzmin(2)
+ ptploc(5,4) = xyzmin(3)
+ ptploc(6,1) = cfmax
+ ptploc(6,2) = xyzmax(1)
+ ptploc(6,3) = xyzmax(2)
+ ptploc(6,4) = xyzmax(3)
+
+ endif
+
+!===============================================================================
+! 4.5 CALCUL DE LA CONTRAINTE CFL DE LA MASSE VOL. POUR AFFICHAGE
+!===============================================================================
+
+! En Compressible uniquement
+
+ if ( (iwarnp.ge.2.or.modntl.eq.0).and. &
+ (ippmod(icompf).ge.0) ) then
+
+ CNOM =' CFL/MAS'
+
+
+! CALCUL DU NOMBRE DE COURANT/FOURIER MAXIMUM ET MINIMUM
+
+ cfmax = -grand
+ cfmin = grand
+ icfmax = 0
+ icfmin = 0
+
+ do iel = 1, ncel
+
+ coufou = wcf(iel)*dt(iel)
+
+ if( coufou.le.cfmin ) then
+ cfmin = coufou
+ icfmin = iel
+ endif
+
+ if( coufou.ge.cfmax ) then
+ cfmax = coufou
+ icfmax = iel
+ endif
+
+ enddo
+
+ xyzmin(1) = xyzcen(1,icfmin)
+ xyzmin(2) = xyzcen(2,icfmin)
+ xyzmin(3) = xyzcen(3,icfmin)
+ xyzmax(1) = xyzcen(1,icfmax)
+ xyzmax(2) = xyzcen(2,icfmax)
+ xyzmax(3) = xyzcen(3,icfmax)
+
+ if (irangp.ge.0) then
+ nbrval = 3
+ call parmnl (nbrval, cfmin, xyzmin)
+ !==========
+ call parmxl (nbrval, cfmax, xyzmax)
+ !==========
+ endif
+
+ if(iwarnp.ge.2) then
+ write(nfecra,1001) cnom,cfmax,xyzmax(1),xyzmax(2),xyzmax(3)
+ write(nfecra,1002) cnom,cfmin,xyzmin(1),xyzmin(2),xyzmin(3)
+ endif
+
+! -> pour listing
+ ptploc(5,1) = cfmin
+ ptploc(5,2) = xyzmin(1)
+ ptploc(5,3) = xyzmin(2)
+ ptploc(5,4) = xyzmin(3)
+ ptploc(6,1) = cfmax
+ ptploc(6,2) = xyzmax(1)
+ ptploc(6,3) = xyzmax(2)
+ ptploc(6,4) = xyzmax(3)
+
+ endif
+
+!===============================================================================
+! 5. ALGORITHME STATIONNAIRE
+!===============================================================================
+else
+
+ isym = 1
+ if (iconv(iuiph).gt.0) isym = 2
+
+ call matrdt &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconv(iuiph) , idiff(iuiph) , isym, &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ coefb(1,iuiph) , propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , &
+ dt , rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ dt(iel) = relaxv(iuiph)*propce(iel,ipcrom) &
+ *volume(iel)/max(dt(iel),epzero)
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1001 FORMAT ( /,A8,' MAX= ',E11.4, &
+ ' EN ',E11.4,' ',E11.4,' ',E11.4)
+ 1002 FORMAT ( A8,' MIN= ',E11.4, &
+ ' EN ',E11.4,' ',E11.4,' ',E11.4)
+ 1003 FORMAT ( /,'CLIPPINGS DE DT : ', &
+ I10,' A ',E11.4,', ',I10,' A ',E11.4)
+
+#else
+
+ 1001 FORMAT ( /,A8,' MAX= ',E11.4, &
+ ' IN ',E11.4,' ',E11.4,' ',E11.4)
+ 1002 FORMAT ( A8,' MIN= ',E11.4, &
+ ' IN ',E11.4,' ',E11.4,' ',E11.4)
+ 1003 FORMAT ( /,'DT CLIPPING : ', &
+ I10,' A ',E11.4,', ',I10,' A ',E11.4)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/dvvpst.f90 b/src/base/dvvpst.f90
new file mode 100644
index 0000000..0ac6d52
--- /dev/null
+++ b/src/base/dvvpst.f90
@@ -0,0 +1,1119 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine dvvpst &
+!================
+
+ ( idbia0 , idbra0 , nummai , numtyp , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , nvisbr , &
+ ncelps , nfacps , nfbrps , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itypps , ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statce , stativ , statfb , &
+ tracel , trafac , trafbr , rdevel , rtuser , ra )
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE DEVELOPPEUR POUR LA SORTIE STANDARD
+! DES VALEURS SUR LES MAILLAGES DE POST TRAITEMENT
+! (appelee apres usproj)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nummai ! ec ! <-- ! numero du maillage post !
+! numtyp ! ec ! <-- ! numero de type de post-traitement !
+! ! ! ! (-1: volume, -2: bord, nummai par defaut) !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! ncelps ! e ! <-- ! nombre de cellules du maillage post !
+! nfacps ! e ! <-- ! nombre de faces interieur post !
+! nfbrps ! e ! <-- ! nombre de faces de bord post !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itypps(3) ! te ! <-- ! indicateur de presence (0 ou 1) de !
+! ! ! ! cellules (1), faces (2), ou faces de !
+! ! ! ! de bord (3) dans le maillage post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
+! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
+! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! statce ! tr ! <-- ! statistiques cellules (lagrangien) !
+!(ncelet,nvlsta ! ! ! !
+! stativ ! tr ! <-- ! statistiques variance cellules !
+!(ncelet,nvlsta ! ! ! (lagrangien) !
+! statfb ! tr ! <-- ! statistiques faces bord (lagrangien) !
+!(nfabor,nvisbr ! ! ! !
+! tracel(*) ! tr ! <-- ! tab reel valeurs cellules post !
+! trafac(*) ! tr ! <-- ! tab reel valeurs faces int. post !
+! trafbr(*) ! tr ! <-- ! tab reel valeurs faces bord post !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "numvar.h"
+include "parall.h"
+include "period.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer nummai , numtyp
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nvlsta , nvisbr
+integer ncelps , nfacps , nfbrps
+integer nideve , nrdeve , nituse , nrtuse
+
+integer itypps(3)
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision statce(ncelet,nvlsta), statfb(nfabor,nvisbr)
+double precision stativ(ncelet,nvlsta)
+double precision tracel(ncelps*3)
+double precision trafac(nfacps*3), trafbr(nfbrps*3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character*32 namevr, namev1, namev2
+character*80 name80
+
+integer idebia, idebra, ifinia, ifinra
+integer igradx, igrady, igradz
+integer itravx, itravy, itravz, itreco
+integer iw1 , iw2
+integer inc , iccocg, nswrgp, imligp, iwarnp, iphydp
+integer isorva, isaut
+integer ifac , iloc , iphas , ivar , iclvar
+integer ira , idivdt, ineeyp
+integer ipp , idimt , ii , kk , iel
+integer ivarl , iip , iph
+integer iii, ivarl1 , ivarlm , iflu , ilpd1 , icla
+integer iscal , ipcvsl, ipcvst, iflmab
+integer idimte, itenso, ientla, ivarpr
+integer iyplbp
+integer ipccp
+double precision cp0iph, xcp , xvsl , surfbn, distbr
+double precision visct , flumab, diipbx, diipby, diipbz
+double precision epsrgp, climgp, extrap
+double precision rbid(1)
+
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1.1. TRAITEMENT POUR LE MAILLAGE FLUIDE
+!===============================================================================
+
+if (numtyp .eq. -1) then
+
+
+! 1.1.1 TRAITEMENT DES VARIABLES POST TRAITABLES
+! ----------------------------------------------
+
+ do ipp = 2, nvppmx
+
+! -> si chrono demande sur la variable
+ if(ichrvr(ipp).eq.1) then
+
+! -> pointeur de la variable dans RA (en absolu)
+! (si negatif, c'est un vecteur)
+ ira = ipp2ra(ipp)
+! -> si c'est un moment cumule, il faut diviser par le temps
+! (si 0 ce n'est pas un moment,
+! si > 0 c'est le pointeur dans RA,
+! si < 0 c'est le rang dans DTCMOM)
+ idivdt = ippmom(ipp)
+! -> dimension de la variable a ecrire
+ idimt = 1
+ if(ira.lt.0) then
+ idimt = 3
+ ira = -ira
+ endif
+
+! -> nom de la variable
+ name80 = nomvar(ipp)
+ namevr = name80(1:32)
+
+! -> si l'on a une variable vectorielle, on supprime
+! la partie X, Y, ou Z en derniere ou avant-derniere
+! position dans le nom
+
+ if (idimt.eq.3) then
+ name80 = nomvar(ipp+1)
+ namev1 = name80(1:32)
+ name80 = nomvar(ipp+2)
+ namev2 = name80(1:32)
+ call pstsnv ( namevr , namev1 , namev2 )
+ !==========
+ endif
+
+! -> si c'est un moment cumule, il faut diviser par le temps
+ if(idivdt.gt.0) then
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = ra(ira+iel-1)/ &
+ max(ra(idivdt+iel-1),epzero)
+ enddo
+ elseif(idivdt.lt.0) then
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = ra(ira+iel-1)/ &
+ max(dtcmom(-idivdt),epzero)
+ enddo
+ endif
+
+! Ecriture effective des valeurs calculees
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+ if(idivdt.eq.0) then
+ ivarpr = 1
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, ra(ira), rbid, rbid)
+
+ else
+ ivarpr = 0
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, rbid, rbid)
+
+ endif
+
+ endif
+! Fin du traitement en cas de sortie de la variable
+
+ enddo
+! Fin de la boucle sur les variables
+
+! 1.1.2 VARIABLES SUPPLEMENTAIRES AUTOMATIQUES
+! --------------------------------------------
+
+! Distance a la paroi (si LES+VanDriest ou Rij+Echo ou K-w SST)
+
+ if (ineedy.eq.1 .and. abs(icdpar).eq.1) then
+
+ NAMEVR = 'DistParoi'
+ idimt = 1
+ ientla = 0
+ ivarpr = 1
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, ra(idipar), rbid, rbid)
+
+ endif
+
+! Yplus (si LES+VanDriest)
+
+ if (ineedy.eq.1 .and. abs(icdpar).eq.1) then
+
+ ineeyp = 0
+ do iphas = 1, nphas
+ if(itytur(iphas).eq.4.and.idries(iphas).eq.1) then
+ ineeyp = 1
+ endif
+ enddo
+
+ if (ineeyp.eq.1) then
+
+ NAMEVR = 'Yplus'
+ idimt = 1
+ ientla = 0
+ ivarpr = 1
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, ra(iyppar), rbid, rbid)
+
+ endif
+
+ endif
+
+
+!===============================================================================
+! 1.2. TRAITEMENT POUR LE MAILLAGE DE BORD
+!===============================================================================
+
+else if (numtyp .eq. -2) then
+
+
+! -- 1.2.1 TRAITEMENT DE YPLUS AU BORD
+! ----------------------------------
+
+ if(mod(ipstdv,ipstyp).eq.0) then
+
+! Phase
+ do iphas = 1, nphas
+
+! Initialisation
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+ if(nphas.gt.1) then
+ write(namevr,1000)iphas
+ 1000 format('YplusPhase',I2.2)
+ else
+ NAMEVR = 'Yplus'
+ endif
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+ idimt = 1
+
+! Calcul des valeurs de la variable sur les faces de bord
+
+ iyplbp = iyplbr+(iphas-1)*nfabor
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ trafbr(1 + (iloc-1)*idimt) = ra(iyplbp+ifac-1)
+ enddo
+
+! Valeurs non entrelac�es, d�finies sur tableau de travail
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ enddo
+! fin du test sur les phases
+
+ endif
+! fin du test sur sortie de yplus
+
+
+! -- 1.2.2 TRAITEMENT DES VARIABLES AU BORD SANS RECONSTRUCTION
+! -----------------------------------------------------------
+
+ if(mod(ipstdv,ipstcl).eq.0) then
+
+! Le codage ci-dessous est relativement avance :
+! il accede aux variables directement au travers du macro tableau RA
+! il comprend un artifice "ISAUT" permettant de reperer les vecteurs
+! a posttraiter
+
+
+! Boucle sur les variables usuelles
+! ---------------------------------
+
+ isaut = 0
+
+ do ivar = 1, nvar
+
+
+! Variables post-traitables
+! (ISAUT est utilise pour ne pas postraiter plusieurs fois les
+! composantes 2 et 3 d'un vecteur, initialise a 0 avant la boucle
+! sur IVAR)
+
+ ipp = ipprtp(ivar)
+
+ isorva = 0
+ if (isaut .gt. 0) then
+ isaut = isaut - 1
+ isorva = 0
+ else if (ichrvr(ipp).eq.1) then
+ isorva = 1
+ name80 = nomvar(ipp)
+ namevr = name80(1:32)
+ endif
+
+! Traitement des variables definies aux centres cellules � sortir
+! ---------------------------------------------------------------
+ if (isorva .eq. 1) then
+
+
+! -> on verifie le signe du pointeur de la variable dans RA
+! (si negatif, c'est un vecteur)
+
+! -> dimension de la variable a ecrire
+ idimt = 1
+ if(ipp2ra(ipp).lt.0) then
+ idimt = 3
+ isaut = 2
+ endif
+
+! -> si l'on a une variable vectorielle, on supprime
+! la partie X, Y, ou Z en derniere ou avant-derniere
+! position dans le nom
+
+ if (idimt.eq.3) then
+ name80 = nomvar(ipp+1)
+ namev1 = name80(1:32)
+ name80 = nomvar(ipp+2)
+ namev2 = name80(1:32)
+ call pstsnv ( namevr , namev1 , namev2 )
+ !==========
+ endif
+
+! Calcul des valeurs (non-reconstruites) de la variable
+! sur les faces de bord
+
+ do kk = 0, idimt-1
+
+ iclvar = iclrtp(ivar+kk,icoef)
+ do iloc = 1, nfbrps
+
+ ifac = lstfbr(iloc)
+ iel = ifabor(ifac)
+
+ trafbr(kk + (iloc-1)*idimt + 1) &
+ = coefa(ifac,iclvar) &
+ + coefb(ifac,iclvar)*rtp(iel,ivar+kk)
+
+ enddo
+
+ enddo
+
+! Valeurs entrelac�es, d�finies sur tableau de travail
+ ientla = 1
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ endif
+! Fin du traitement en cas de sortie de la variable
+
+ enddo
+! Fin de la boucle sur les variables
+
+ endif
+! Fin du test sur sortie des variables
+
+
+
+! 1.2.3 TRAITEMENT FLUX THERMIQUE AU BORD
+! ----------------------------------------
+! Si on travaille en enthalpie, on calcule un flux d'enthalpie
+
+ if(mod(ipstdv,ipstft).eq.0) then
+
+! Phase
+ do iphas = 1, nphas
+
+ if(iscalt(iphas).gt.0 .and. nscal.gt.0 .and. &
+ iscalt(iphas).le.nscal) then
+
+! Initialisation
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+ if(nphas.gt.1) then
+ write(namevr,2000)iphas
+ 2000 format('Flux th. entrant W.m-2 Phase',I2.2)
+ else
+ NAMEVR = 'Flux thermique entrant W.m-2'
+ endif
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+ idimt = 1
+
+! Numero de la variable
+
+ iscal = iscalt(iphas)
+ ivar = isca(iscal)
+ iclvar = iclrtp(ivar,icoef)
+
+! Calcul des valeurs de la variable sur les faces de bord
+
+! Reservation de la memoire pour reconstruction
+
+ ifinia = idebia
+
+ igradx = idebra
+ igrady = igradx+ncelet
+ igradz = igrady+ncelet
+ itravx = igradz+ncelet
+ itravy = itravx+ncelet
+ itravz = itravy+ncelet
+ itreco = itravz+ncelet
+ ifinra = itreco+nfabor
+
+! Verification de la disponibilite de la memoire
+
+ CALL IASIZE('DVVPST',IFINIA)
+ CALL RASIZE('DVVPST',IFINRA)
+
+
+! Calcul du gradient de la temperature / enthalpie
+
+
+! Pour calculer le gradient de Temperature
+! - dans les calculs paralleles, il est necessaire que
+! les cellules situees sur un bord de sous-domaine connaissent
+! la valeur de temperature dans les cellules situees en
+! vis-a-vis sur le sous-domaine voisin.
+! - dans les calculs periodiques, il est necessaire que
+! les cellules periodiques aient acces a la valeur de la
+! temperature des cellules periodiques correspondantes
+
+! Pour cela, il est necessaire d'appeler les routines de
+! communication PARCOM (parallelisme) et PERCOM (periodicite)
+! pour echanger les valeurs de temperature avant de calculer le
+! gradient. L'appel a ces routines doit etre fait dans cet ordre
+! PARCOM puis PERCOM (pour les cas ou parallelisme et periodicite
+! coexistent).
+! En effet, on se situe ici a la fin du pas de temps n. Or,
+! les variables RTP ne seront echangees qu'en debut du pas de
+! temps n+1. Ici, seules les variables RTPA (obtenues a la fin
+! du pas de temps n-1) ont deja ete echangees.
+
+! Si le calcul n'est ni periodique, ni parallele, on peut conserver
+! appels (les tests sur IPERIO et IRANGP assurent la generalite)
+
+
+! Echange pour le parallelisme
+
+ if(irangp.ge.0) then
+
+ call parcom (rtp(1,ivar))
+ !==========
+
+ endif
+
+! Echange pour la periodicite
+
+ if(iperio.eq.1) then
+
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+
+ endif
+
+
+! Calcul du gradient
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(itravx) , ra(itravx) , ra(itravx) , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ ra(igradx) , ra(igrady) , ra(igradz) , &
+! ---------- ---------- ----------
+ ra(itravx) , ra(itravy) , ra(itravz) , &
+ rdevel , rtuser , ra )
+
+
+! Calcul de la valeur reconstruite dans les cellules de bord
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+ ra(itreco+ifac-1) = rtp(iel,ivar) &
+ + diipbx*ra(igradx+iel-1) &
+ + diipby*ra(igrady+iel-1) &
+ + diipbz*ra(igradz+iel-1)
+ enddo
+
+! Calcul du flux (ouf !) convectif et diffusif
+
+ if(ivisls(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+ else
+ ipcvsl = 0
+ endif
+ ipcvst = ipproc(ivisct(iphas))
+ iflmab = ipprob(ifluma(ivar))
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ iel = ifabor(ifac)
+
+ if(ipcvsl.gt.0) then
+ xvsl = propce(iel,ipcvsl)
+ else
+ xvsl = visls0(iscal)
+ endif
+ surfbn = ra(isrfbn-1+ifac)
+ distbr = ra(idistb-1+ifac)
+ visct = propce(iel,ipcvst)
+ flumab = propfb(ifac,iflmab)
+
+ trafbr(1 + (iloc-1)*idimt) = &
+ (xvsl+visct/sigmas(iscal))/max(distbr,epzero)* &
+ (coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0)* &
+ rtp(iel,ivar)) &
+ - flumab/max(surfbn,epzero**2)* &
+ (coefa(ifac,iclvar)+ coefb(ifac,iclvar)* &
+ rtp(iel,ivar))
+
+ enddo
+
+! Pour la temperature, on multiplie par CP
+ if(abs(iscsth(iscal)).eq.1) then
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+ else
+ ipccp = 0
+ cp0iph = cp0(iphas)
+ endif
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ iel = ifabor(ifac)
+ if(ipccp.gt.0) then
+ xcp = propce(iel,ipccp)
+ else
+ xcp = cp0iph
+ endif
+ trafbr(1 + (iloc-1)*idimt) &
+ = xcp*trafbr(1 + (iloc-1)*idimt)
+ enddo
+ endif
+
+! Valeurs entrelac�es, d�finies sur tableau de travail
+ ientla = 1
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ endif
+! Fin du test sur variable thermique
+
+ enddo
+! Fin de boucle sur les phases
+
+ endif
+! Fin du test sur sortie des flux thermiques
+
+! -- 1.2.4 TRAITEMENT DES EFFORTS AUX BORDS
+! --------------------------------------
+
+ if(mod(ipstdv,ipstfo).eq.0) then
+
+! Initialisation
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+ NAMEVR = 'Efforts'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+ idimt = 3
+
+! Calcul des valeurs de la variable sur les faces de bord
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ surfbn = ra(isrfbn-1+ifac)
+ trafbr(1 + (iloc-1)*idimt ) = &
+ ra(iforbr+(ifac-1)*idimt )/surfbn
+ trafbr(2 + (iloc-1)*idimt ) = &
+ ra(iforbr+(ifac-1)*idimt+1)/surfbn
+ trafbr(3 + (iloc-1)*idimt ) = &
+ ra(iforbr+(ifac-1)*idimt+2)/surfbn
+ enddo
+
+! Valeurs entrelac�es, d�finies sur tableau de travail
+ ientla = 1
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ endif
+! fin du test sur sortie des efforts
+
+endif
+! Fin du test sur le numero de maillage post.
+
+!===============================================================================
+! 2.1. VARIABLES LAGRANGIENNES
+!===============================================================================
+
+if (nummai .eq. -1) then
+
+ if (iilagr.gt.0 .and. istala.ge.1) then
+
+! Toutes les statistiques standard sont de dimension 1,
+! et sont definies ou calculees sur tableau de travail
+! de maniere non entrelacee (sans importance de toutes
+! manieres pour une variable scalaire)
+
+ idimt = 1
+ ientla = 0
+
+ iii = nvlsta-nvlsts
+
+ do icla = 0, nbclst
+
+! -> si IPAS = 0 : statistiques globales
+! si 0 < IPAS =< NBCLST : statistiques par groupe
+
+ do ivarl = 1, nvlsta
+
+ ivarl1 = icla*nvlsta +ivarl
+ ivarlm = ivarl1
+ ilpd1 = icla*nvlsta +ilpd
+ iflu = 0
+
+ if (ivarl.le.iii) then
+ if (ivarl.eq.ivarl1) then
+ name80 = nomlag(ivarl)
+ else
+ WRITE(NAME80,'(A8,A4,I3)') NOMLAG(IVARL),'_grp',ICLA
+ endif
+ else if (nvlsts.gt.0) then
+ if (ivarl.eq.ivarl1) then
+ name80 = nomlag(ilvu(ivarl-iii))
+ else
+ WRITE(NAME80,'(A8,A4,I3)') &
+ NOMLAG(ILVU(IVARL-III)),'_grp',ICLA
+ endif
+ endif
+
+ namevr = name80(1:32)
+
+ call uslaen &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivarl , ivarl1 , ivarlm , iflu , ilpd1 , icla , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statce , stativ , tracel , &
+ rdevel , rtuser , ra )
+
+! La variable est deja definie sur le maillage volumique
+! global ; on utilise donc l'indirection (donc IVARPR = 1)
+ ivarpr = 1
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ ntcabs, ttcabs, tracel, rbid, rbid)
+ enddo
+
+ do ivarl = 1, nvlsta-1
+
+ ivarl1 = icla*(nvlsta-1)+ivarl
+ ivarlm = icla*nvlsta+ivarl
+ ilpd1 = icla*nvlsta +ilpd
+ iflu = 1
+
+ if (ivarl.le.iii) then
+ if (ivarl.eq.ivarl1) then
+ name80 = nomlav(ivarl)
+ else
+ WRITE(NAME80,'(A8,A4,I3)') NOMLAV(IVARL),'_grp',ICLA
+ endif
+ else if (nvlsts.gt.0) then
+ if (ivarl.eq.ivarl1) then
+ name80 = nomlav(ilvu(ivarl-iii))
+ else
+ WRITE(NAME80,'(A8,A4,I3)') &
+ NOMLAV(ILVU(IVARL-III)),'_grp',ICLA
+ endif
+ endif
+
+ namevr = name80(1:32)
+
+ call uslaen &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivarl , ivarl1 , ivarlm , iflu , ilpd1 , icla , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statce , stativ , tracel , &
+ rdevel , rtuser , ra )
+
+! La variable est deja definie sur le maillage volumique
+! global ; on utilise donc l'indirection (donc IVARPR = 1)
+ ivarpr = 1
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ ntcabs, ttcabs, tracel, rbid, rbid)
+ enddo
+
+ enddo
+
+ endif
+
+endif
+
+if (nummai.eq.-2) then
+
+ if (iilagr.gt.0 .and. iensi3.eq.1) then
+
+ iii = nvisbr-nusbor
+
+ do ivarl = 1,nvisbr
+
+ if (ivarl.le.iii) then
+ name80 = nombrd(ivarl)
+ else if (nusbor.gt.0) then
+ name80 = nombrd(iusb(ivarl-iii))
+ endif
+ namevr = name80(1:32)
+
+ if (imoybr(ivarl).eq.2) then
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ if (statfb(ifac,inbr).gt.seuilf) then
+ trafbr(iloc) = statfb(ifac,ivarl)/statfb(ifac,inbr)
+ else
+ trafbr(iloc) = 0.d0
+ endif
+ enddo
+
+ else if (imoybr(ivarl).eq.1) then
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ if (statfb(ifac,inbr).gt.seuilf) then
+ trafbr(iloc) = statfb(ifac,ivarl) / tstatp
+ else
+ trafbr(iloc) = 0.d0
+ endif
+ enddo
+
+ else
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ if (statfb(ifac,inbr).gt.seuilf) then
+ trafbr(iloc) = statfb(ifac,ivarl)
+ else
+ trafbr(iloc) = 0.d0
+ endif
+ enddo
+
+ endif
+
+ idimt = 1
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ enddo
+
+ NAME80 = 'lagrangian_boundary_zones'
+ namevr = name80(1:32)
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ trafbr(iloc) = ia(iifrla+ifac-1)
+ enddo
+
+ idimt = 1
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ endif
+endif
+! Fin du test sur le numero de maillage post.
+
+!===============================================================================
+! 2.2. VARIABLES RADIATIVES AUX FRONTIERES
+!===============================================================================
+
+
+if (nummai.eq.-2) then
+
+ if (iirayo.gt.0) then
+
+ do ivarl = 1,nbrayf
+
+ if (irayvf(ivarl).eq.1) then
+
+ name80 = nbrvaf(ivarl)
+ namevr = name80(1:32)
+
+ if (ivarl .eq. itparp) then
+ ipp = ipprob(itparo)
+ else if (ivarl .eq. iqincp) then
+ ipp = ipprob(iqinci)
+ else if (ivarl .eq. ixlamp) then
+ ipp = ipprob(ixlam)
+ else if (ivarl .eq. iepap) then
+ ipp = ipprob(iepa)
+ else if (ivarl .eq. iepsp) then
+ ipp = ipprob(ieps)
+ else if (ivarl .eq. ifnetp) then
+ ipp = ipprob(ifnet)
+ else if (ivarl .eq. ifconp) then
+ ipp = ipprob(ifconv)
+ else if (ivarl .eq. ihconp) then
+ ipp = ipprob(ihconv)
+ endif
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ trafbr(iloc) = propfb(ifac,ipp)
+ enddo
+
+ idimt = 1
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ endif
+ enddo
+
+ name80 = 'radiative_boundary_zones'
+ namevr = name80(1:32)
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ trafbr(iloc) = ia(iizfrd+ifac-1)
+ enddo
+
+ idimt = 1
+ ientla = 0
+ ivarpr = 0
+!
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ ntcabs, ttcabs, rbid, rbid, trafbr)
+
+ endif
+endif
+
+!===============================================================================
+! 2.3. VARIABLES ELECTRIQUES
+!===============================================================================
+
+if ( ippmod(ieljou).ge.1 &
+ .or. ippmod(ielarc).ge.1 &
+ .or. ippmod(ielion).ge.1) then
+
+ ifinia = idebia
+
+ iw1 = idebra
+ iw2 = iw1 + ncelet*3
+ ifinra = iw2 + ncelet*3
+
+ CALL RASIZE ('DVVPST', IFINRA)
+ !==========
+
+ call uselen &
+ !==========
+ ( ifinia , ifinra , nummai , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncelps , nfacps , nfbrps , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iw1) , ra(iw2) , &
+ tracel , trafac , trafbr , rdevel , rtuser , ra )
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/ecrava.f90 b/src/base/ecrava.f90
new file mode 100644
index 0000000..8b9b18d
--- /dev/null
+++ b/src/base/ecrava.f90
@@ -0,0 +1,2767 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ecrava &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nnod , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , frcxt , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+
+! FONCTION :
+! ----------
+! ECRITURE D'UN FICHIER SUITE
+
+! PAS DE STOP (RETURN SI ON ECHOUE)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nnod ! e ! <-- ! nombre de noeuds !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+include "optcal.h"
+include "albase.h"
+include "alstru.h"
+include "alaste.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor, nnod
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision dt(ncelet), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision frcxt(ncelet,3,nphas)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+
+integer nbmom2
+parameter (nbmom2=nbmomx*2)
+
+character rubriq*64,car2*2,car4*4,car54*54
+character cindfp*2,cindfs*4,cindff*4,cindfm*4
+character cindfc*2,cindfl*4
+character cphase(nphsmx)*2 , cscal(nscamx)*4
+character cflu (nvarmx)*4 , cmom (nbmomx)*4
+character nomflu(nvarmx)*18, nomrtp(nvarmx)*20
+character nomcli(nvarmx)*18
+character cstruc(nstrmx)*2, cindst*2
+integer idebia, idebra
+integer ivar , iphas , iscal , imom
+integer idecal, iclapc, icha , icla
+integer ii , ivers , idtm , idtcm
+integer iclvar, iclvaf, iptsna, iptsta, iptsca
+integer ierror, nberro, irtyp , itysup, nbval
+integer nbctm , ipcefj, ipcla1, ipcla2, ipcla3
+integer nfmtph, nfmtsc, nfmtfl, nfmtmo, nfmtch, nfmtcl
+integer nfmtst
+integer nbflu , ilecec, iecr
+integer ifait (nvarmx)
+integer icdtvu(nbmom2)
+integer ngbstr(2)
+integer iw1, ifinra, ifac, iel, istr
+integer impava, impavx
+double precision tmpstr(27)
+
+!===============================================================================
+! A noter :
+! Lorsque qu'il est necessaire d'utiliser un ordre implicite
+! de rangement des variables, on a choisi :
+! P,
+! (U, V, W, turbulence, scalaires)_phase1,
+! (...)_phase2,
+! (...)_...
+! scalaires
+
+! avec turbulence = k, epsilon
+! ou R11, R22, R33, R12, R13, R23, epsilon
+! ou k, epsilon, phi, f_barre
+! ou k, omega
+
+! Ceci est par exemple utilise pour relier les flux de masse aux
+! variables
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. VERIFICATIONS DE BASE ET CODAGE DES CHAINES DE CARACTERES
+!===============================================================================
+
+! ---> On code en chaine le numero des phases et scalaires
+! ----------------------------------------------------
+
+! Nombre de phases, de scalaires, de flux, de moments et de charbons
+! max pour les formats choisis
+nfmtph = 99
+nfmtsc = 9999
+nfmtfl = 9999
+nfmtmo = 9999
+nfmtch = 99
+nfmtcl = 9999
+
+! Indefini (on met qqch de different de lecamo (pour generer une
+! erreur a la lecture)
+CINDFP = 'XX'
+CINDFS = 'XXXX'
+CINDFF = 'XXXX'
+CINDFM = 'XXXX'
+CINDFC = 'XX'
+CINDFL = 'XXXX'
+
+
+! Codage en chaine de caracteres du numero de la phase
+do iphas = 1, min(nphas ,nfmtph)
+ WRITE(CPHASE(IPHAS),'(I2.2)') IPHAS
+enddo
+do iphas = min(nphas ,nfmtph)+1,nphas
+ cphase(iphas) = cindfp
+enddo
+
+! Codage en chaine de caracteres du numero du scalaire
+do iscal = 1, min(nscal ,nfmtsc)
+ WRITE(CSCAL(ISCAL),'(I4.4)')ISCAL
+enddo
+do iscal = min(nscal ,nfmtsc)+1,nscal
+ cscal(iscal) = cindfs
+enddo
+
+! Codage en chaine de caracteres du numero du flux de masse
+do ivar = 1, min(nvar ,nfmtfl)
+ WRITE(CFLU(IVAR),'(I4.4)')IVAR
+enddo
+do ivar = min(nvar ,nfmtfl)+1,nvar
+ cflu(ivar) = cindff
+enddo
+
+! Codage en chaine de caracteres du numero du moment
+do imom = 1, min(nbmomt,nfmtmo)
+ WRITE(CMOM(IMOM),'(I4.4)')IMOM
+enddo
+do imom = min(nbmomt,nfmtmo)+1,nbmomt
+ cmom(imom) = cindfm
+enddo
+
+! Verifications pour les formats et les numero de phase
+! et de scalaire en chaine.
+! Avertissement (certaines infos passent a la trappe)
+if(nphsmx.gt.nfmtph) then
+ write(nfecra,7000)nfmtph,nphsmx
+endif
+if(nscamx.gt.nfmtsc) then
+ write(nfecra,7001)nfmtsc,nscamx
+endif
+if(nvarmx.gt.nfmtfl) then
+ write(nfecra,7002)nfmtfl,nvarmx
+endif
+if(nbmomx.gt.nfmtmo) then
+ write(nfecra,7003)nfmtmo,nbmomx
+endif
+if(ncharm.gt.nfmtch) then
+ write(nfecra,7004)nfmtch,ncharm
+endif
+if(ncpcmx.gt.nfmtcl) then
+ write(nfecra,7005)nfmtcl,ncpcmx
+endif
+
+
+!===============================================================================
+! 2. OUVERTURE FICHIER SUITE DE BASE
+!===============================================================================
+! ILECEC = 2 : ecriture
+
+write(nfecra,1000)
+
+ilecec = 2
+
+call opnsui(ficava, len(ficava), ilecec, impava, ierror)
+!==========
+if (ierror.ne.0) then
+ write(nfecra,8000) ficava
+ return
+endif
+
+
+!===============================================================================
+! 3. ECRITURE FICHIER SUITE DE BASE
+!===============================================================================
+
+write(nfecra,1100)
+
+
+! 3.0 VERSION : Rubrique "fichier suite ppal"
+!============= Pourrait porter le numero de version si besoin.
+! On ne se sert pas de IVERS (=1.2.0) pour le moment.
+
+ivers = 120
+itysup = 0
+nbval = 1
+irtyp = 1
+RUBRIQ = 'version_fichier_suite_principal'
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,ivers, &
+ ierror)
+if (ierror.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DE L''ENTETE '
+#else
+ CAR54='ERROR WHILE WRITING THE HEADER '
+#endif
+ write(nfecra,8100)car54
+endif
+
+
+! 3.1 DIMENSIONS : les dimensions geometriques sont ecrites
+!=============== automatiquement lors de l'ouverture du fichier
+! on ecrit ici les nombres de variables
+
+nberro = 0
+
+itysup = 0
+nbval = 1
+irtyp = 1
+
+RUBRIQ = 'nombre_variables'
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,nvar, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_scalaires'
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,nscal, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_scalaires_us'
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,nscaus, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_scalaires_pp'
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,nscapp, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_phases'
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,nphas, &
+ ierror)
+nberro=nberro+ierror
+
+if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES DIMENSIONS '
+#else
+ CAR54='ERROR WHILE WRITING THE DIMENSIONS '
+#endif
+ write(nfecra,8100)car54
+endif
+
+#if defined(_CS_LANG_FR)
+CAR54 =' Fin de l''ecriture des dimensions '
+#else
+CAR54 =' End writing the dimensions '
+#endif
+write(nfecra,1110)car54
+
+! 3.2 OPTIONS (Celles servant a donner le nombre de tableaux a lire)
+!============================================================================
+! Remarque : ces variables ne sont pas toutes utilies pour la relecture
+! en revanche, elles peuvent completer les infos au sein
+! du fichier suite
+
+nberro = 0
+
+! ---> Nombre de pas de temps, instant precedent
+RUBRIQ = 'nbre_pas_de_temps'
+itysup = 0
+nbval = 1
+irtyp = 1
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,ntcabs, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'instant_precedent'
+itysup = 0
+nbval = 1
+irtyp = 2
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,ttcabs, &
+ ierror)
+nberro=nberro+ierror
+
+! ---> Modeles de turbulence
+do iphas = 1, nphas
+ RUBRIQ = 'modele_turbulence_phase'//CPHASE(IPHAS)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ iturb(iphas),ierror)
+ nberro=nberro+ierror
+enddo
+
+
+! ---> Methode ALE
+RUBRIQ = 'methode_ALE'
+itysup = 0
+nbval = 1
+irtyp = 1
+call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp,iale, &
+ ierror)
+nberro=nberro+ierror
+
+
+if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES OPTIONS '
+#else
+ CAR54='ERROR WHILE WRITING THE OPTIONS '
+#endif
+ write(nfecra,8100)car54
+endif
+
+#if defined(_CS_LANG_FR)
+CAR54 =' Fin de l''ecriture des options '
+#else
+CAR54 =' End writing the options '
+#endif
+write(nfecra,1110)car54
+
+! 3.3 VARIABLES "PRINCIPALES"
+!====================================
+
+nberro = 0
+
+NOMRTP(IPR(1))='pression_ce_phase'//CPHASE(1)
+do iphas = 1, nphas
+ NOMRTP(IU(IPHAS))='vitesse_u_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IV(IPHAS))='vitesse_v_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IW(IPHAS))='vitesse_w_ce_phase'//CPHASE(IPHAS)
+ if (itytur(iphas).eq.2) then
+ NOMRTP(IK(IPHAS))='k_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IEP(IPHAS))='eps_ce_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3) then
+ NOMRTP(IR11(IPHAS))='R11_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IR22(IPHAS))='R22_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IR33(IPHAS))='R33_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IR12(IPHAS))='R12_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IR13(IPHAS))='R13_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IR23(IPHAS))='R23_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IEP(IPHAS))='eps_ce_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50) then
+ NOMRTP(IK(IPHAS))='k_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IEP(IPHAS))='eps_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IPHI(IPHAS))='phi_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IFB(IPHAS))='fb_ce_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60) then
+ NOMRTP(IK(IPHAS))='k_ce_phase'//CPHASE(IPHAS)
+ NOMRTP(IOMG(IPHAS))='omega_ce_phase'//CPHASE(IPHAS)
+ endif
+enddo
+if(nscal.gt.0) then
+ do iscal = 1, nscal
+ NOMRTP(ISCA(ISCAL))='scalaire_ce_'//CSCAL(ISCAL)
+ enddo
+endif
+if (iale.eq.1) then
+ NOMRTP(IUMA)='vit_maillage_u_ce'
+ NOMRTP(IVMA)='vit_maillage_v_ce'
+ NOMRTP(IWMA)='vit_maillage_w_ce'
+endif
+
+! Dans le cas ou il y a plusieurs phases,
+! on ne veut ecrire la pression qu'une seule fois
+! mais ca tombe bien, car on ne la verra qu'une seule fois
+! dans la liste des variables
+
+do ivar = 1, nvar
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ rubriq = nomrtp(ivar)
+ call ecrsui(impava,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ivar),ierror)
+ nberro=nberro+ierror
+
+enddo
+
+if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES VARIABLES PRINCIPALES '
+#else
+ CAR54='ERROR WHILE WRITING THE MAIN VARIABLES '
+#endif
+ write(nfecra,8100)car54
+endif
+
+#if defined(_CS_LANG_FR)
+CAR54 =' Fin de l''ecriture des variables principales '
+#else
+CAR54 =' End writing the main variables '
+#endif
+write(nfecra,1110)car54
+
+
+! 3.4 INFORMATIONS COMPLEMENTAIRES LEGERES (IE UN ENTIER, UN REEL...)
+!==================================================
+
+nberro = 0
+
+iecr = 0
+
+
+
+if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES INFORMATIONS COMPLEMENTAIRES '
+#else
+ CAR54='ERROR WHILE WRITING THE COMPLEMENTARY INFORMATION '
+#endif
+ write(nfecra,8100)car54
+endif
+
+if(iecr.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54 =' Fin de l''ecriture des informations complementaires '
+#else
+ CAR54 =' End writing the complementary information '
+#endif
+ write(nfecra,1110)car54
+endif
+
+
+!===============================================================================
+! 4. FERMETURE FICHIER SUITE DE BASE
+!===============================================================================
+
+! Fermeture du fichier suite principal
+call clssui(impava,ierror)
+
+if (ierror.ne.0) then
+ write(nfecra,8010) ficava
+endif
+
+write(nfecra,1200)
+
+!===============================================================================
+! 5. ECRITURE FICHIER SUITE AUXILIAIRE
+!===============================================================================
+
+! Si l'ecriture du fichier suite auxiliaire est demandee
+if (iecaux.eq.1) then
+
+! 5.0. OUVERTURE FICHIER SUITE AUXILIAIRE
+!================================================
+
+ write(nfecra,2000)
+
+ ilecec = 2
+ call opnsui(ficavx, len(ficavx), ilecec, impavx, ierror)
+ !==========
+ if (ierror.ne.0) then
+ write(nfecra,8001) ficavx
+ return
+ endif
+
+ write(nfecra,1100)
+
+! 5.1 VERSION : Rubrique "fichier suite auxiliaire"
+!============= Pourrait porter le numero de version si besoin.
+! On ne se sert pas de IVERS (=1.2.0) pour le moment.
+
+ ivers = 120
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'version_fichier_suite_auxiliaire'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ivers,ierror)
+ if (ierror.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DE L''ENTETE '
+#else
+ CAR54='ERROR WHILE WRITING THE HEADER '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+! 5.2 DIMENSIONS : les dimensions geometriques sont ecrites
+!=============== automatiquement lors de l'ouverture du fichier
+
+
+ nberro=0
+
+! ---> Nombre de phases
+! On les reecrit ici car on en aura besoin a la relecture
+ RUBRIQ = 'nombre_phases'
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp,nphas, &
+ ierror)
+ nberro=nberro+ierror
+
+! ---> Nombre de pas de temps, instant precedent
+! On les reecrit ici car on en aura besoin a la relecture
+ RUBRIQ = 'nbre_pas_de_temps'
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp,ntcabs,&
+ ierror)
+ nberro=nberro+ierror
+
+! ---> Indicateur de pas de temps variable
+ RUBRIQ = 'indic_dt_variable'
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp,idtvar,&
+ ierror)
+ nberro=nberro+ierror
+
+! ---> Modeles de turbulence
+! On les reecrit ici car on en aura besoin a la relecture
+ do iphas = 1, nphas
+ RUBRIQ = 'modele_turbulence_phase'//CPHASE(IPHAS)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ iturb(iphas),ierror)
+ nberro=nberro+ierror
+ enddo
+
+RUBRIQ = 'methode_ALE'
+itysup = 0
+nbval = 1
+irtyp = 1
+call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp,iale, &
+ ierror)
+nberro=nberro+ierror
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES DIMENSIONS ET DES OPTIONS '
+#else
+ CAR54='ERROR WHILE WRITING THE DIMENSIONS AND OPTIONS '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54 =' Fin de l''ecriture des dimensions et des options '
+#else
+ CAR54 =' End writing the dimensions and options '
+#endif
+ write(nfecra,1110)car54
+
+! 5.3 ECRITURE DES VARIABLES
+!===================================
+
+! ---> Proprietes physiques
+
+ nberro=0
+
+ do iphas = 1, nphas
+
+! Point de reference pour la pression totale
+! On n'ecrit que si XYZP0 a ete specifie par l'utilisateur ou
+! calcule a partir de faces de sorties ou de Dirichlet
+ if (ixyzp0(iphas).eq.1) then
+ RUBRIQ = 'ref_presstot'//CPHASE(IPHAS)
+ itysup = 0
+ nbval = 3
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ xyzp0(1,iphas),ierror)
+ nberro=nberro+ierror
+ endif
+
+! Masse volumique si elle est variable uniquement
+ if(irovar(iphas).eq.1) then
+! Masse volumique - cellules
+ RUBRIQ = 'rho_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(irom(iphas))),ierror)
+ nberro=nberro+ierror
+
+! Masse volumique - faces de bord
+ RUBRIQ = 'rho_fb_phase'//CPHASE(IPHAS)
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(irom(iphas))),ierror)
+ nberro=nberro+ierror
+ endif
+
+! On n'ecrit les proprietes physiques que si on les extrapole.
+! On pourrait les ecrire a tous les coups en prevision d'une
+! suite avec extrapolation, mais
+! - c'est rare
+! - si on demarre un calcul a l'ordre deux a partir d'un calcul
+! a l'ordre 1, on peut estimer que les premiers pas de temps
+! sont a jeter de toute facon.
+! Une exception : on ecrit egalement Cp en effet joule pour
+! pouvoir calculer la temperature H/Cp en debut de calcul
+
+ if(iviext(iphas).gt.0) then
+! Viscosite moleculaire - cellules (si variable)
+ if(ivivar(iphas).eq.1) then
+ RUBRIQ = 'viscl_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(iviscl(iphas))),ierror)
+ nberro = nberro+ierror
+ endif
+
+! Viscosite turbulente ou de sous-maille - cellules
+ RUBRIQ = 'visct_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisct(iphas))),ierror)
+ nberro = nberro+ierror
+ endif
+
+ if((icpext(iphas ).gt.0.and.icp(iphas).gt.0).or. &
+ (ippmod(ieljou).ge.1.and.icp(iphas).gt.0)) then
+! Chaleur massique - cellules
+ RUBRIQ = 'cp_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(icp(iphas))),ierror)
+ nberro = nberro+ierror
+ endif
+
+ enddo
+
+! Si on a des scalaires, on ecrit leur diffusivite
+! (on ne l'ecrit pas pour les variances)
+ if(nscal.gt.0) then
+ do iscal = 1, nscal
+ if(ivsext(iscal).gt.0.and.ivisls(iscal).gt.0.and. &
+ (iscavr(iscal).le.0.or.iscavr(iscal).gt.nscal) ) then
+! Diffusivite - cellules
+ RUBRIQ = 'visls_ce_scalaire'//CSCAL(ISCAL)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisls(iscal))),ierror)
+ nberro = nberro+ierror
+ endif
+ enddo
+ endif
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES PROPRIETES PHYSIQUES '
+#else
+ CAR54='ERROR WHILE WRITING THE PHYSICAL PROPERTIES '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54 =' Fin de l''ecriture des proprietes physiques '
+#else
+ CAR54 =' End writing the physical properties '
+#endif
+ write(nfecra,1110)car54
+
+! ---> Pas de temps
+
+ nberro = 0
+
+ if(idtvar.eq.2) then
+ RUBRIQ = 'dt_variable_espace_ce'
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp,dt, &
+ ierror)
+ nberro=nberro+ierror
+ elseif(idtvar.eq.1) then
+ RUBRIQ = 'dt_variable_temps'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp,dt, &
+ ierror)
+ nberro=nberro+ierror
+ endif
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DU PAS DE TEMPS '
+#else
+ CAR54='ERROR WHILE WRITING THE TIME STEP '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54 =' Fin de l''ecriture du pas de temps '
+#else
+ CAR54 =' End writing the time step '
+#endif
+ write(nfecra,1110)car54
+
+! ---> Flux de masse
+
+! Pour garder la memoire de la correspondance entre les variables
+! et les flux de masse, on memorise le nom de chaque variable
+! (NOMFLU(I)= nom de la ieme variable)
+! Ensuite, pour chaque variable, on ecrit son nom et le numero
+! local du flux de masse correspondant (en pratique 1 ou 2)
+
+ nberro=0
+
+! Initialisation des tableaux de travail
+ nbflu = 0
+ do ii = 1, nvarmx
+ ifait(ii) = 0
+ enddo
+
+ iphas = 1
+ NOMFLU(IPR(IPHAS))='fm_p_phase'//CPHASE(IPHAS)
+ do iphas=1,nphas
+ NOMFLU(IU(IPHAS))='fm_u_phase'//CPHASE(IPHAS)
+ NOMFLU(IV(IPHAS))='fm_v_phase'//CPHASE(IPHAS)
+ NOMFLU(IW(IPHAS))='fm_w_phase'//CPHASE(IPHAS)
+ if (itytur(iphas).eq.2) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3) then
+ NOMFLU(IR11(IPHAS))='fm_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_R22_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_R33_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_R12_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_R13_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_R23_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_phi_phase'//CPHASE(IPHAS)
+! On n'utilise pas le flux de masse pour fb en fait mais on le laisse ici, car ca
+! ne change rien (le flux n'est ecrit qu'une seule fois)
+ NOMFLU(IFB(IPHAS))='fm_fb_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_omega_phase'//CPHASE(IPHAS)
+ endif
+ enddo
+ if(nscal.gt.0) then
+ do iscal = 1, nscal
+ NOMFLU(ISCA(ISCAL))='fm_scalaire'//CSCAL(ISCAL)
+ enddo
+ endif
+ if (iale.eq.1) then
+ NOMFLU(IUMA)='fm_vit_maill_u'
+ NOMFLU(IVMA)='fm_vit_maill_v'
+ NOMFLU(IWMA)='fm_vit_maill_w'
+ endif
+
+
+ do ivar = 1, nvar
+
+! Si la variable n'est pas associee a un flux de masse
+! on ne fait rien
+ if (ifluma(ivar).gt.0) then
+! Si le flux de masse n'a pas encore ete ecrit
+ if (ifait(ifluma(ivar)).eq.0) then
+! C'est un nouveau flux a ecrire
+ nbflu=nbflu+1
+! On note que ce flux est alors traite (c'est le NBFLUieme)
+ ifait(ifluma(ivar))=nbflu
+
+! Ecriture du flux de masse sur les faces internes
+ RUBRIQ = 'flux_masse_fi_'//CFLU(NBFLU)
+ itysup = 2
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfa(1,ipprof(ifluma(ivar))),ierror)
+ nberro=nberro+ierror
+
+! Ecriture du flux de masse sur les faces de bord
+ RUBRIQ = 'flux_masse_fb_'//CFLU(NBFLU)
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(ifluma(ivar))),ierror)
+ nberro=nberro+ierror
+ endif
+! Que le flux de masse ait deja ete ecrit ou pas,
+! on ecrit le lien variable/numero de flux
+ rubriq = nomflu(ivar)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ifait(ifluma(ivar)),ierror)
+ nberro=nberro+ierror
+ endif
+ enddo
+
+
+! On fait de meme pour les flux de masse au temps precedent.
+! Initialisation des tableaux de travail
+
+ nbflu = 0
+ do ii = 1, nvarmx
+ ifait(ii) = 0
+ enddo
+
+ iphas = 1
+ NOMFLU(IPR(IPHAS))='fm_a_p_phase'//CPHASE(IPHAS)
+ do iphas=1,nphas
+ NOMFLU(IU(IPHAS))='fm_a_u_phase'//CPHASE(IPHAS)
+ NOMFLU(IV(IPHAS))='fm_a_v_phase'//CPHASE(IPHAS)
+ NOMFLU(IW(IPHAS))='fm_a_w_phase'//CPHASE(IPHAS)
+ if (itytur(iphas).eq.2) then
+ NOMFLU(IK(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3) then
+ NOMFLU(IR11(IPHAS))='fm_a_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_a_R22_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_a_R33_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_a_R12_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_a_R13_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_a_R23_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50) then
+ NOMFLU(IK(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_a_phi_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_a_fb_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60) then
+ NOMFLU(IK(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_a_omega_phase'//CPHASE(IPHAS)
+ endif
+ enddo
+ if(nscal.gt.0) then
+ do iscal = 1, nscal
+ NOMFLU(ISCA(ISCAL))='fm_a_scalaire'//CSCAL(ISCAL)
+ enddo
+ endif
+ if (iale.eq.1) then
+ NOMFLU(IUMA)='fm_a_vit_maill_u'
+ NOMFLU(IVMA)='fm_a_vit_maill_v'
+ NOMFLU(IWMA)='fm_a_vit_maill_w'
+ endif
+
+
+ do ivar = 1, nvar
+
+! Si la variable n'est pas associee a un flux de masse
+! on ne fait rien
+ if (ifluaa(ivar).gt.0) then
+! Si le flux de masse n'a pas encore ete ecrit
+ if (ifait(ifluaa(ivar)).eq.0) then
+! C'est un nouveau flux a ecrire
+ nbflu=nbflu+1
+! On note que ce flux est alors traite (c'est le NBFLUieme)
+ ifait(ifluaa(ivar))=nbflu
+
+! Ecriture du flux de masse sur les faces internes
+ RUBRIQ = 'flux_masse_a_fi_'//CFLU(NBFLU)
+ itysup = 2
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfa(1,ipprof(ifluaa(ivar))),ierror)
+ nberro=nberro+ierror
+
+! Ecriture du flux de masse sur les faces de bord
+ RUBRIQ = 'flux_masse_a_fb_'//CFLU(NBFLU)
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(ifluaa(ivar))),ierror)
+ nberro=nberro+ierror
+ endif
+! Que le flux de masse ait deja ete ecrit ou pas,
+! on ecrit le lien variable/numero de flux
+ rubriq = nomflu(ivar)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ifait(ifluaa(ivar)),ierror)
+ nberro=nberro+ierror
+ endif
+ enddo
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES FLUX DE MASSE '
+#else
+ CAR54='ERROR WHILE WRITING THE MASS FLUXES '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54 =' Fin de l''ecriture des flux de masse '
+#else
+ CAR54 =' End writing the mass fluxes '
+#endif
+ write(nfecra,1110)car54
+
+! ---> Conditions aux limites
+
+ nberro=0
+
+ NOMCLI(IPR(1))='_p_phase'//CPHASE(1)
+ do iphas = 1, nphas
+ NOMCLI(IU(IPHAS))='_u_phase'//CPHASE(IPHAS)
+ NOMCLI(IV(IPHAS))='_v_phase'//CPHASE(IPHAS)
+ NOMCLI(IW(IPHAS))='_w_phase'//CPHASE(IPHAS)
+ if (itytur(iphas).eq.2) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ NOMCLI(IEP(IPHAS))='_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3) then
+ NOMCLI(IR11(IPHAS))='_R11_phase'//CPHASE(IPHAS)
+ NOMCLI(IR22(IPHAS))='_R22_phase'//CPHASE(IPHAS)
+ NOMCLI(IR33(IPHAS))='_R33_phase'//CPHASE(IPHAS)
+ NOMCLI(IR12(IPHAS))='_R12_phase'//CPHASE(IPHAS)
+ NOMCLI(IR13(IPHAS))='_R13_phase'//CPHASE(IPHAS)
+ NOMCLI(IR23(IPHAS))='_R23_phase'//CPHASE(IPHAS)
+ NOMCLI(IEP(IPHAS))='_eps_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ NOMCLI(IEP(IPHAS))='_eps_phase'//CPHASE(IPHAS)
+ NOMCLI(IPHI(IPHAS))='_phi_phase'//CPHASE(IPHAS)
+ NOMCLI(IFB(IPHAS))='_fb_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ NOMCLI(IOMG(IPHAS))='_omega_phase'//CPHASE(IPHAS)
+ endif
+ enddo
+ if(nscal.gt.0) then
+ do iscal = 1, nscal
+ NOMCLI(ISCA(ISCAL))='_scalaire'//CSCAL(ISCAL)
+ enddo
+ endif
+ if (iale.eq.1) then
+ NOMCLI(IUMA)='_vit_maillage_u'
+ NOMCLI(IVMA)='_vit_maillage_v'
+ NOMCLI(IWMA)='_vit_maillage_w'
+ endif
+
+! Dans le cas ou il y a plusieurs phases,
+! on ne veut ecrire la pression qu'une seule fois
+! mais ca tombe bien, car on ne la verra qu'une seule fois
+! dans la liste des variables
+
+ do ivar = 1, nvar
+
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+
+! Coefficients numeros 1
+ iclvar = iclrtp(ivar,icoef)
+ RUBRIQ = 'cla1'//NOMCLI(IVAR)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coefa(1,iclvar),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'clb1'//NOMCLI(IVAR)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coefb(1,iclvar),ierror)
+ nberro=nberro+ierror
+
+! Coefficients numeros 2
+ iclvaf = iclrtp(ivar,icoeff)
+ if (iclvar.ne.iclvaf) then
+
+ RUBRIQ = 'cla2'//NOMCLI(IVAR)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coefa(1,iclvaf),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'clb2'//NOMCLI(IVAR)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coefb(1,iclvaf),ierror)
+ nberro=nberro+ierror
+ endif
+
+ enddo
+
+
+! Type sym�trie (utilis� pour les gradients par moindres carr�s
+! sur support �tendu, avec extrapolation du gradient au bord).
+
+ do iphas = 1, nphas
+
+ RUBRIQ = 'isympa_fb_phase'//CPHASE(IPHAS)
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iisymp+nfabor*(iphas-1)),ierror)
+ nberro=nberro+ierror
+
+ enddo
+
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES CONDITIONS AUX LIMITES '
+#else
+ CAR54='ERROR WHILE WRITING THE BOUNDARY CONDITIONS '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54 =' Fin de l''ecriture des conditions aux limites '
+#else
+ CAR54 =' End writing the boundary conditions '
+#endif
+ write(nfecra,1110)car54
+
+! ---> Termes sources
+! Lorsqu'ils sont extrapoles (pour les versions elec, voir plus bas)
+
+ nberro=0
+
+ iecr = 0
+
+! ---> Termes sources Navier-Stokes
+ do iphas = 1, nphas
+
+! Si les termes sont a l'ordre 2
+ if(isno2t(iphas).gt.0) then
+
+ iecr = 1
+
+ iptsna = ipproc(itsnsa(iphas))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tsource_ns_ce_x_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsna ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_ns_ce_y_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsna+1),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_ns_ce_z_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsna+2),ierror)
+ nberro=nberro+ierror
+
+ endif
+
+ enddo
+
+! ---> Termes sources turbulence
+ do iphas = 1, nphas
+
+! Si les termes sont a l'ordre 2
+ if(isto2t(iphas).gt.0) then
+
+ iecr = 1
+
+ iptsta = ipproc(itstua(iphas))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+! En k-eps
+ if(itytur(iphas).eq.2) then
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+
+! En Rij
+ elseif(itytur(iphas).eq.3) then
+
+ RUBRIQ = 'tsource_tu_ce_R11_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R22_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R33_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+2),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R12_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+3),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R13_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+4),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R23_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+5),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+6),ierror)
+ nberro=nberro+ierror
+
+! En v2f
+ elseif(iturb(iphas).eq.50) then
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_phi_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+2),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_fb_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+3),ierror)
+ nberro=nberro+ierror
+
+! En k-omega
+ elseif(iturb(iphas).eq.60) then
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_omega_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+
+ endif
+ endif
+ enddo
+
+
+! ---> Termes sources scalaires
+
+! Boucle sur les scalaires
+ do iscal = 1, nscal
+! Si le terme est a l'ordre 2
+ if(isso2t(iscal).gt.0) then
+
+ iecr = 1
+
+ iptsca = ipproc(itssca(iscal))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'tsource_sc_ce_scalaire'//CSCAL(ISCAL)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsca ),ierror)
+ nberro=nberro+ierror
+
+ endif
+ enddo
+
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES TERMES SOURCES '
+#else
+ CAR54='ERROR WHILE WRITING THE SOURCES TERMS '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+ if (iecr.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des termes sources '
+#else
+ CAR54=' End writing the source terms '
+#endif
+ write(nfecra,1110)car54
+ endif
+
+
+! ---> Moyennes (cumuls)
+
+ nberro = 0
+
+! ---> Nombre de moyennes
+ RUBRIQ = 'nombre_moyennes_temps'
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp,nbmomt,&
+ ierror)
+ nberro=nberro+ierror
+
+! Cumuls des moyennes
+ do imom = 1, nbmomt
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'cumul_ce_moment'//CMOM(IMOM)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(icmome(imom))),ierror)
+ nberro=nberro+ierror
+ enddo
+
+! Cumuls des durees
+
+! On determine un numero unique de duree, local au fichier suite.
+! les durees variable ou non sont considerees sans distinction
+! Le tableau ICDTVU(2*NBMOMX) renvoie aux cumuls temporels variables
+! en espace pour les indices 1->NBMOMX et aux cumuls temporels
+! uniformes pour les indices NBMOMX+1->2*NBMOMX
+
+! Initialisation des elements de travail
+ nbctm = 0
+ do ii = 1, nbmom2
+ icdtvu(ii) = 0
+ enddo
+
+
+ do imom = 1, nbmomt
+ idtm = idtmom(imom)
+! Si cumul variable en espace
+ if(idtm.gt.0) then
+! Si cumul pas encore vu
+ if(icdtvu(idtm).eq.0) then
+! C'est un nouveau, le NBCTM ieme
+ nbctm = nbctm+1
+! On le marque
+ icdtvu(idtm) = nbctm
+! On ecrit ses valeurs
+ if(nbctm.le.nfmtmo) then
+ WRITE(CAR4,'(I4.4)')NBCTM
+ else
+ car4 = cindfm
+ endif
+ idtcm = ipproc(icdtmo(idtm))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'cumul_temps_ce_'//CAR4
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,idtcm),ierror)
+ nberro=nberro+ierror
+ endif
+! Cumul vu ou pas, on ecrit son numero, >0 pour dire qu'il est
+! variable en espace
+ RUBRIQ = 'numero_cumul_temps_moment'//CMOM(IMOM)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ icdtvu(idtm),ierror)
+ nberro=nberro+ierror
+
+! Sinon, si cumul uniforme en espace
+ elseif(idtm.lt.0) then
+! Si cumul pas encore vu
+ if(icdtvu(nbmomx-idtm).eq.0) then
+! C'est un nouveau, le NBCTM ieme
+ nbctm = nbctm+1
+! On le marque
+ icdtvu(nbmomx-idtm) = -nbctm
+! On ecrit ses valeurs
+ if(nbctm.le.nfmtmo) then
+ WRITE(CAR4,'(I4.4)')NBCTM
+ else
+ car4 = cindfm
+ endif
+ idtcm = -idtm
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'cumul_temps_'//CAR4
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ dtcmom(idtcm),ierror)
+ nberro=nberro+ierror
+ endif
+! Cumul vu ou pas, on ecrit son numero, <0 pour dire qu'il est
+! uniforme en espace
+ RUBRIQ = 'numero_cumul_temps_moment'//CMOM(IMOM)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ icdtvu(nbmomx-idtm),ierror)
+ nberro=nberro+ierror
+ endif
+ enddo
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES MOYENNES TEMPORELLES '
+#else
+ CAR54='ERROR WHILE WRITING THE TIME AVERAGES '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+ if(nbmomt.gt.0) then
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des moyennes temporelles '
+#else
+ CAR54=' End writing the time averages '
+#endif
+ write(nfecra,1110)car54
+ endif
+
+! ---> Distance a la paroi
+! On pourra ecrire ici la distance a la paroi
+
+ nberro = 0
+
+ iecr = 0
+
+ if(ineedy.eq.1) then
+! Ancien mode de calcul. On ecrit aussi la distance a la paroi,
+! au cas ou on fait une suite en ICDPAR=1.
+ if(abs(icdpar).eq.2) then
+ do iphas = 1, nphas
+ if(iifapa(iphas).gt.0) then
+ iecr = 1
+ itysup = 1
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_fac_par_ce_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,ia(iifapa(iphas)),ierror)
+ nberro=nberro+ierror
+ endif
+ enddo
+! Pour la distance reelle, on a besoin d'un tableau provisoire
+! on ne prend que la phase 1
+ iphas = 1
+ if(iifapa(iphas).gt.0) then
+ iw1 = idebra
+ ifinra = iw1 + ncelet
+ CALL RASIZE('ECRAVA',IFINRA)
+ do iel = 1, ncel
+ ifac = ia(iifapa(iphas)+iel-1)
+ ra(iw1+iel-1) = &
+ sqrt((cdgfbo(1,ifac)-xyzcen(1,iel))**2 &
+ + (cdgfbo(2,ifac)-xyzcen(2,iel))**2 &
+ + (cdgfbo(3,ifac)-xyzcen(3,iel))**2)
+ enddo
+ iecr = 1
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'dist_fac_par_ce_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(iw1),ierror)
+ nberro=nberro+ierror
+ endif
+
+! Nouveau mode de calcul
+ elseif(abs(icdpar).eq.1) then
+ iphas = 1
+ iecr = 1
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'dist_fac_par_ce_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idipar),ierror)
+ nberro=nberro+ierror
+ endif
+ endif
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DE LA DISTANCE A LA PAROI '
+#else
+ CAR54='ERROR WHILE WRITING THE WALL DISTANCE '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+ if(iecr.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture de la distance a la paroi '
+#else
+ CAR54=' End writing the wall distance '
+#endif
+ write(nfecra,1110)car54
+ endif
+
+! ---> Force exterieure
+
+ if(iphydr.eq.1) then
+ nberro=0
+
+ do iphas = 1, nphas
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'force_ext_ce_x_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ frcxt(1,1,iphas),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'force_ext_ce_y_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ frcxt(1,2,iphas),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'force_ext_ce_z_phase'//CPHASE(IPHAS)
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ frcxt(1,3,iphas),ierror)
+ nberro=nberro+ierror
+ enddo
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DES FORCES EXTERIEURES '
+#else
+ car54= &
+ 'ERROR WHILE WRITING THE EXTERNAL FORCES '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des forces exterieures '
+#else
+ CAR54=' End writing the external forces '
+#endif
+ write(nfecra,1110)car54
+
+ endif
+
+! ---> Methode ALE
+
+ if(iale.eq.1) then
+ nberro=0
+
+ itysup = 4
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'deplact_x_no'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idepal),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'deplact_y_no'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idepal+nnod),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'deplact_z_no'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idepal+2*nnod),ierror)
+ nberro=nberro+ierror
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DU DEPLACEMENT AUX NOEUDS (ALE) '
+#else
+ car54= &
+ 'ERROR WHILE WRITING THE VERTICES DISPLACEMENTS (ALE) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+! Viscosite de maillage (elle est souvent definie geometriquement sur le
+! maillage initial ... il est donc plus facile de la relire ensuite)
+
+ nberro = 0
+ RUBRIQ = 'type_visc_mail'
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ iortvm,ierror)
+ nberro = nberro+ierror
+
+ nberro = 0
+ RUBRIQ = 'visc_maillage_x'
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisma(1))),ierror)
+ nberro = nberro+ierror
+
+ if (iortvm.eq.1) then
+ RUBRIQ = 'visc_maillage_y'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisma(2))),ierror)
+ RUBRIQ = 'visc_maillage_z'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisma(3))),ierror)
+ endif
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DE LA VISCOSITE DE MAILLAGE (ALE)'
+#else
+ car54= &
+ 'ERROR WHILE WRITING THE MESH VISCOSITY (ALE) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des donnees ALE '
+#else
+ CAR54=' End writing the ALE data '
+#endif
+ write(nfecra,1110)car54
+
+ ngbstr(1) = nbstru
+ ngbstr(2) = nbaste
+
+ nberro=0
+ RUBRIQ = 'nombre_structures'
+ itysup = 0
+ nbval = 2
+ irtyp = 1
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ngbstr,ierror)
+ nberro=nberro+ierror
+
+ if (nbstru.gt.0) then
+
+ nfmtst = 99
+ CINDST = 'XX'
+! Codage en chaine de caracteres du numero de la structure
+ do istr = 1, min(nbstru ,nfmtst)
+ WRITE(CSTRUC(ISTR),'(I2.2)') ISTR
+ enddo
+ do istr = min(nbstru ,nfmtst)+1,nbstru
+ cstruc(istr) = cindst
+ enddo
+
+ do istr = 1, nbstru
+ RUBRIQ = 'donnees_structure_'//CSTRUC(ISTR)
+ itysup = 0
+ nbval = 27
+ irtyp = 2
+
+ do ii = 1, 3
+ tmpstr( ii) = xstr (ii,istr)
+ tmpstr(3 +ii) = xpstr (ii,istr)
+ tmpstr(6 +ii) = xppstr(ii,istr)
+ tmpstr(9 +ii) = xsta (ii,istr)
+ tmpstr(12+ii) = xpsta (ii,istr)
+ tmpstr(15+ii) = xppsta(ii,istr)
+ tmpstr(18+ii) = xstp (ii,istr)
+ tmpstr(21+ii) = forstr(ii,istr)
+ tmpstr(24+ii) = forsta(ii,istr)
+ enddo
+
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tmpstr,ierror)
+ nberro=nberro+ierror
+ enddo
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DES DONNEES DES STRUCTURES (ALE) '
+#else
+ car54= &
+ 'ERROR WHILE WRITING THE STRUCTURES DATE (ALE) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des donnees des structures (ALE)'
+#else
+ CAR54=' End writing the structures data (ALE) '
+#endif
+ write(nfecra,1110)car54
+
+ endif
+ endif
+
+
+! ---> Grandeurs complementaires pour la combustion gaz
+
+! Modele COD3P :
+! ============
+
+ if ( ippmod(icod3p).ge.0 ) then
+
+ nberro=0
+
+ RUBRIQ = 'hinfue_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ hinfue,ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'hinoxy_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ hinoxy,ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tinfue_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tinfue,ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tinoxy_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tinoxy,ierror)
+ nberro=nberro+ierror
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_cod3p'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Entree Fuel (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientfu_zone_bord_cod3p'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientfu, ierror)
+ nberro=nberro+ierror
+
+! Entree oxydant (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientox_zone_bord_cod3p'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientox, ierror)
+ nberro=nberro+ierror
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DES INFORMATIONS COMBUSTION COD3P'
+#else
+ car54= &
+ 'ERROR WHILE WRITING COMBUSTION INFORMATION (COD3P) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des informations combustion COD3P'
+#else
+ CAR54=' End writing combustion information (COD3P) '
+#endif
+ write(nfecra,1110)car54
+
+ endif
+
+! Modele EBU :
+! ==========
+
+ if ( ippmod(icoebu).ge.0 ) then
+
+ nberro=0
+
+ RUBRIQ = 'temperature_gaz_frais_ebu'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tgf,ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'frmel_ebu'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ frmel,ierror)
+ nberro=nberro+ierror
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_ebu'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Entree Gaz brule(si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgb_zone_bord_ebu'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgb, ierror)
+ nberro=nberro+ierror
+
+! Entree gaz frais (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgf_zone_bord_ebu'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgf, ierror)
+ nberro=nberro+ierror
+
+! FMENT (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'fment_zone_bord_ebu'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ fment, ierror)
+ nberro=nberro+ierror
+
+! TKENT (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'tkent_zone_bord_ebu'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tkent, ierror)
+ nberro=nberro+ierror
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DES INFORMATIONS COMBUSTION EBU'
+#else
+ car54= &
+ 'ERROR WHILE WRITING COMBUSTION INFORMATION (EBU) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des informations combustion EBU '
+#else
+ CAR54=' End writing the combustion information (EBU) '
+#endif
+ write(nfecra,1110)car54
+
+ endif
+
+! Modele LWC :
+! ==========
+
+ if ( ippmod(icolwc).ge.0 ) then
+
+ nberro=0
+
+ RUBRIQ = 'fmin_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ fmin,ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'fmax_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ fmax,ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'hmin_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ hmin,ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'hmax_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ hmax,ierror)
+ nberro=nberro+ierror
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_lwc'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Entree Gaz brule(si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgb_zone_bord_lwc'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgb, ierror)
+ nberro=nberro+ierror
+
+! Entree gaz frais (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgf_zone_bord_lwc'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgf, ierror)
+ nberro=nberro+ierror
+
+! FMENT (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'fment_zone_bord_lwc'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ fment, ierror)
+ nberro=nberro+ierror
+
+! TKENT (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'tkent_zone_bord_lwc'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tkent, ierror)
+ nberro=nberro+ierror
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DES INFORMATIONS COMBUSTION LWC'
+#else
+ car54= &
+ 'ERROR WHILE WRITING COMBUSTION INFORMATION (LWC) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des informations combustion LWC '
+#else
+ CAR54=' End writing combustion information (LWC) '
+#endif
+ write(nfecra,1110)car54
+
+ endif
+
+! ---> Grandeurs complementaires pour la combustion CP
+
+ if ( ippmod(icp3pl).ge.0 .or. ippmod(icpl3c).ge.0 ) then
+ nberro=0
+
+
+! Charbon PuLVerise : masse vol des charbons
+
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ do icha = 1, ncharb
+ if(icha.le.nfmtch) then
+ WRITE(CAR2,'(I2.2)')ICHA
+ else
+ car2 = cindfc
+ endif
+ RUBRIQ = 'masse_volumique_charbon'//CAR2
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rhock(icha), ierror)
+ nberro=nberro+ierror
+ enddo
+
+
+! Charbon PuLVerise : type de zones de bord, ientat, ientcp, timpat
+! x20, pour le calcul de rho au bord en entree
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_charbon_pulverise'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+
+! Type entree air ou cp (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientat_zone_bord_charbon_pulverise'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientat, ierror)
+ nberro=nberro+ierror
+
+! ientat et x20 ne servent pas pour le CP couple Lagrangien (cplphy)
+ if ( ippmod(icp3pl).ge.0 ) then
+
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientcp_zone_bord_charbon_pulverise'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientcp, ierror)
+ nberro=nberro+ierror
+
+
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+
+ idecal = 0
+ do icha = 1, ncharb
+ do iclapc = 1, nclpch(icha)
+ icla = iclapc + idecal
+ if(icha.le.nfmtch.and.iclapc.le.nfmtcl) then
+ WRITE(CAR2,'(I2.2)')ICHA
+ WRITE(CAR4,'(I4.4)')ICLAPC
+ else
+ car2 = cindfc
+ car4 = cindfl
+ endif
+ RUBRIQ = 'x20_zone_bord_charbon'//CAR2//'_classe'//CAR4
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,x20(1,icla), ierror)
+ nberro=nberro+ierror
+
+ enddo
+ enddo
+
+ endif
+
+! Temperature
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'timpat_zone_bord_charbon_pulverise'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ timpat, ierror)
+ nberro=nberro+ierror
+
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DES INFORMATIONS COMBUSTION CP '
+#else
+ car54= &
+ 'ERROR WHILE WRITING COMBUSTION INFORMATION (CP) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des informations combustion CP '
+#else
+ CAR54=' End writing combustion information (CP) '
+#endif
+ write(nfecra,1110)car54
+
+ endif
+
+! ---> Grandeurs complementaires pour la FUEL
+
+ if ( ippmod(icfuel).ge.0 ) then
+ nberro=0
+
+
+! Charbon PuLVerise : type de zones de bord, ientat, ientfl, timpat
+! qimpat et qimpfl pour le calcul de rho au bord en entree
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_fuel'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+
+! Type entree air ou fuel (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientat_zone_bord_fuel'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientat, ierror)
+ nberro=nberro+ierror
+
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientfl_zone_bord_fuel'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientfl, ierror)
+ nberro=nberro+ierror
+
+! Timpat
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'timpat_zone_bord_fuel'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ timpat, ierror)
+ nberro=nberro+ierror
+
+! Qimpat
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'qimpat_zone_bord_fuel'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ qimpat, ierror)
+ nberro=nberro+ierror
+
+! Qimpfl
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'qimpfl_zone_bord_fuel'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ qimpfl, ierror)
+ nberro=nberro+ierror
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ car54= &
+ 'ERREUR A L''ECRITURE DES INFORMATIONS COMBUSTION FUEL '
+#else
+ car54= &
+ 'ERROR WHILE WRITING COMBUSTION INFORMATION (FUEL) '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des informations combustion FUEL '
+#else
+ CAR54=' End writing combustion information (FUEL) '
+#endif
+ write(nfecra,1110)car54
+
+ endif
+
+! ---> Grandeurs complementaires pour les versions electriques
+
+ nberro=0
+ iecr = 0
+
+! Recalage des CL pot des versions electriques
+
+ if ( ippmod(ieljou).ge.1 ) then
+ if(ielcor.eq.1) then
+
+ iecr = 1
+ RUBRIQ = 'coeff_recalage_joule'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coejou,ierror)
+ nberro=nberro+ierror
+
+ endif
+ endif
+
+ if ( ippmod(ielarc).ge.1 .or. ippmod(ieljou).ge.1 ) then
+ if(ielcor.eq.1) then
+
+ iecr = 1
+ RUBRIQ = 'ddpot_recalage_arc_elec'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ dpot ,ierror)
+ nberro=nberro+ierror
+
+ endif
+ endif
+
+! Termes sources des versions electriques
+
+ if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+ iecr = 1
+ ipcefj = ipproc(iefjou)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tsource_sc_ce_joule'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcefj ),ierror)
+ nberro=nberro+ierror
+
+ endif
+
+ if( ippmod(ielarc).ge.1 ) then
+
+ iecr = 1
+ ipcla1 = ipproc(ilapla(1))
+ ipcla2 = ipproc(ilapla(2))
+ ipcla3 = ipproc(ilapla(3))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tsource_ns_ce_x_laplace'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcla1 ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_ns_ce_y_laplace'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcla2 ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_ns_ce_z_laplace'
+ call ecrsui(impavx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcla3 ),ierror)
+ nberro=nberro+ierror
+
+ endif
+
+ if (nberro.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54='ERREUR A L''ECRITURE DES INFORMATIONS ELECTRIQUES '
+#else
+ CAR54='ERROR WHILE WRITING ELECTRIC INFORMATION '
+#endif
+ write(nfecra,8101)car54
+ endif
+
+ if (iecr.ne.0) then
+#if defined(_CS_LANG_FR)
+ CAR54=' Fin de l''ecriture des informations electriques '
+#else
+ CAR54=' End writing the electric information '
+#endif
+ write(nfecra,1110)car54
+ endif
+
+
+! Fermeture du fichiers suite auxiliaire
+ call clssui(impavx,ierror)
+
+ if (ierror.ne.0) then
+ write(nfecra,8011) ficavx
+ endif
+
+ write(nfecra,1200)
+
+endif
+! Fin de l'ecriture du fichier suite auxiliaire
+
+
+return
+
+!===============================================================================
+! 6. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(3X,'** ECRITURE DU FICHIER SUITE PRINCIPAL',/, &
+ 3X,' ----------------------------------- ',/)
+ 1100 format(' Debut de l''ecriture ')
+ 1110 format(' ',A54 )
+ 1200 format(' Fin de l''ecriture ')
+ 2000 format(/,3X,'** ECRITURE DU FICHIER SUITE AUXILIAIRE',/, &
+ 3X,' ------------------------------------ ',/)
+
+ 7000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le nombre de phases maximal NPHSMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTPH = ',I10 ,/,&
+'@ On a ici un nombre de phases maximal superieur ',/,&
+'@ NPHSMX = ',I10 ,/,&
+'@ Si le nombre de phases effectif est superieur, elles ',/,&
+'@ ne seront pas relues. ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le nombre de scalaires maximal NSCAMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTSC = ',I10 ,/,&
+'@ On a ici un nombre de scalaires maximal superieur ',/,&
+'@ NSCAMX = ',I10 ,/,&
+'@ On ne pourra pas relire les scalaires dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le nombre de flux de masse max NVARMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTFL = ',I10 ,/,&
+'@ On a ici un nombre de flux maximal superieur ',/,&
+'@ NVARMX = ',I10 ,/,&
+'@ On ne pourra pas relire les flux dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le nombre de moments max NBMOMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTMO = ',I10 ,/,&
+'@ On a ici un nombre de moments maximal superieur ',/,&
+'@ NBMOMX = ',I10 ,/,&
+'@ On ne pourra pas relire les moments dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7004 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le nombre de charbons max NCHARM supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTCH = ',I10 ,/,&
+'@ On a ici un nombre de charbons maximal superieur ',/,&
+'@ NCHARM = ',I10 ,/,&
+'@ On ne pourra pas relire certaines informations ',/,&
+'@ relatives aux charbons dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le nombre de classes par charbon max NCPCMX supporte ',/,&
+'@ par le format d''ecriture du fichier suite est ',/,&
+'@ NFMTCL = ',I10 ,/,&
+'@ On a ici un nombre de classes par charbon superieur ',/,&
+'@ NCPCMX = ',I10 ,/,&
+'@ On ne pourra pas relire certaines informations ',/,&
+'@ relatives aux classes dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A L''OUVERTURE DU FICHIER SUITE ',/,&
+'@ ========= AVAL PRINCIPAL',/,&
+'@ ',/,&
+'@ Verifier que le fichier ',A13,'peut etre ',/,&
+'@ cree dans le repertoire de travail. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A L''OUVERTURE DU FICHIER SUITE ',/,&
+'@ ========= AVAL AUXILIAIRE',/,&
+'@ ',/,&
+'@ Verifier que le fichier ',A13,'peut etre ',/,&
+'@ cree dans le repertoire de travail. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 8010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= AVAL PRINCIPAL',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= AVAL AUXILIAIRE',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 8100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= AVAL PRINCIPAL',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ECRITURE DU FICHIER SUITE ',/,&
+'@ ========= AVAL AUXILIAIRE',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format(3X,'** WRITING THE MAIN RESTART FILE',/, &
+ 3X,' -----------------------------',/)
+ 1010 format(3X,' Opening a binary file',/)
+ 1020 format(3X,' Opening an ASCII file',/)
+ 1100 format(' Start writing' )
+ 1110 format(' ',A54 )
+ 1200 format(' End writing' )
+ 2000 format(/,3X,'** WRITING THE AUXILLIARY RESTART FILE',/, &
+ 3X,' -----------------------------------',/)
+
+ 7000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The maximum number of phases NPHSMX handled by the ',/,&
+'@ restart file writing format is ',/,&
+'@ NFMTPH = ',I10 ,/,&
+'@ The current maximum number of phases is greater. ',/,&
+'@ NPHSMX = ',I10 ,/,&
+'@ If the effective number of phases is greater, they ',/,&
+'@ will not be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Refer to the subroutine ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The maximum number of scalars NSCAMX handled by the ',/,&
+'@ restart file writing format is ',/,&
+'@ NFMTSC = ',I10 ,/,&
+'@ The current maximum number of scalars is greater. ',/,&
+'@ NSCAMX = ',I10 ,/,&
+'@ The scalars with a larger number will not be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Refer to the subroutine ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The maximum number of mass flux NVARMX handled by the ',/,&
+'@ restart file writing format is ',/,&
+'@ NFMTFL = ',I10 ,/,&
+'@ The current maximum number of mass fluxes is greater. ',/,&
+'@ NVARMX = ',I10 ,/,&
+'@ The fluxes with a larger number will not be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Refer to the subroutine ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The maximum number of moments NBMOMX handled by the ',/,&
+'@ restart file writing format is ',/,&
+'@ NFMTMO = ',I10 ,/,&
+'@ The current maximum number of moments is greater. ',/,&
+'@ NBMOMX = ',I10 ,/,&
+'@ The moments with a larger number will not be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Refer to the subroutine ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7004 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The maximum number of coals NCHARM handled by the ',/,&
+'@ restart file writing format is ',/,&
+'@ NFMTCH = ',I10 ,/,&
+'@ The current maximum number of coals is greater. ',/,&
+'@ NCHARM = ',I10 ,/,&
+'@ Some information relative to coals with a greater ',/,&
+'@ number will not be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Refer to the subroutine ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The number of coal classes NCPCMX handled by the ',/,&
+'@ restart file writing format is ',/,&
+'@ NFMTCL = ',I10 ,/,&
+'@ The current number of coal classes is greater. ',/,&
+'@ NCPCMX = ',I10 ,/,&
+'@ Some information relative to classes with a greater ',/,&
+'@ number will not be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Refer to the subroutine ecrava. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ERROR WHILE OPENING THE MAIN RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ Verify that the file ',A13,'can be created ',/,&
+'@ in the working directory. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ERROR WHILE OPENING THE AUXILIARY RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ Verify that the file ',A13,'can be created ',/,&
+'@ in the working directory. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 8010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ERROR WHILE CLOSING THE MAIN RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ Problem with the file of name (',A13,') ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ERROR WHILE CLOSING THE AUXILIARY RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ Problem with the file of name (',A13,') ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 8100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE MAIN RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHILE WRITING THE AUXILIARY RESTART FILE ',/,&
+'@ ======== ',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+
+end
diff --git a/src/base/ecrhis.f90 b/src/base/ecrhis.f90
new file mode 100644
index 0000000..dec5d8c
--- /dev/null
+++ b/src/base/ecrhis.f90
@@ -0,0 +1,414 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ecrhis &
+!================
+
+ ( idbia0 , idbra0 , ndim , ncelet , ncel , &
+ nideve , nrdeve , nituse , nrtuse , modhis , &
+ idevel , ituser , ia , &
+ xyzcen , rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE D'ECRITURE DES HISTORIQUES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! modhis ! e ! <-- ! indicateur valant 0,1 ou 2 !
+! ! ! ! 1,2 = ecriture intermediaire, finale !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra ! tr ! -- ! tableau des reels !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstnum.h"
+include "optcal.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0
+integer ndim, ncelet, ncel
+integer nideve , nrdeve , nituse , nrtuse
+integer modhis
+integer idevel(nideve), ituser(nituse), ia(*)
+double precision xyzcen(ndim,ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character nomfic*300, nenvar*300
+integer ii, ii1, ii2, lpos, inam1, inam2, lng
+integer icap,ncap,ipp,ira,ipp2,nbpdte, jtcabs
+integer idivdt, ixmsdt, idebia, idebra, ifinra, iel
+integer nbcap(nvppmx)
+double precision xtcabs,xyztmp(3)
+double precision varcap(ncaptm)
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+! 0. INITIALISATIONS LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+!--> Il n'y a pas eu d'historiques ou s'il n'y a pas de capteur
+if((ipass.eq.1.and.modhis.eq.2) .or. ncapt.eq.0) return
+
+!===============================================================================
+! 1. RECHERCHE DES NOEUDS PROCHES -> NODCAP
+!===============================================================================
+
+if (ipass.eq.1) then
+
+ do ii = 1, ncapt
+ call findpt &
+ !==========
+ ( ncelet, ncel, xyzcen , &
+ xyzcap(1,ii), xyzcap(2,ii), xyzcap(3,ii), &
+ nodcap(ii), ndrcap(ii))
+ enddo
+
+endif
+
+!===============================================================================
+! 2. OUVERTURE DU FICHIER DE STOCKAGE hist.tmp
+!===============================================================================
+
+if(ipass.eq.1 .and. irangp.le.0) then
+ nomfic = ' '
+ nomfic = emphis
+ call verlon (nomfic,ii1,ii2,lpos)
+ !==========
+
+ nomfic(ii2+1:ii2+8) = 'hist.tmp'
+ ii2 = ii2+8
+ open (unit=imphis(1), file=nomfic(ii1:ii2), &
+ status='UNKNOWN', form='UNFORMATTED', &
+ access='SEQUENTIAL')
+endif
+
+!===============================================================================
+! 3. ECRITURE DES RESULTATS dans le FICHIER DE STOCKAGE
+!===============================================================================
+
+if(modhis.eq.0.or.modhis.eq.1) then
+
+ do ipp = 2, nvppmx
+ if(ihisvr(ipp,1).ne.0) then
+ ira = abs(ipp2ra(ipp))
+
+! Pour les moments, il faut eventuellement diviser par le temps cumule
+ idivdt = ippmom(ipp)
+ if(idivdt.eq.0) then
+ ixmsdt = ira
+ else
+ ixmsdt = idebra
+ ifinra = ixmsdt + ncel
+ call rasize ('ecrhis', ifinra)
+ !==========
+ endif
+ if(idivdt.gt.0) then
+ do iel = 1, ncel
+ ra(ixmsdt+iel-1) = ra(ira+iel-1)/ max(ra(idivdt+iel-1),epzero)
+ enddo
+ elseif(idivdt.lt.0) then
+ do iel = 1, ncel
+ ra(ixmsdt+iel-1) = ra(ira+iel-1)/ max(dtcmom(-idivdt),epzero)
+ enddo
+! else
+! ra(ixmsdt+iel-1) = ra(ira+iel-1)
+! inutile car on a pose ixmsdt = ira
+ endif
+
+ if(ihisvr(ipp,1).lt.0) then
+ do icap = 1, ncapt
+ if (irangp.lt.0) then
+ varcap(icap) = ra(ixmsdt+nodcap(icap)-1)
+ else
+ call parhis(nodcap(icap), ndrcap(icap), ra(ixmsdt), varcap(icap))
+ !==========
+ endif
+ enddo
+ ncap = ncapt
+ else
+ do icap = 1, ihisvr(ipp,1)
+ if (irangp.lt.0) then
+ varcap(icap) = ra(ixmsdt+nodcap(ihisvr(ipp,icap+1))-1)
+ else
+ call parhis(nodcap(ihisvr(ipp,icap+1)), &
+ !==========
+ ndrcap(ihisvr(ipp,icap+1)), &
+ ra(ixmsdt), varcap(icap))
+ endif
+ enddo
+ ncap = ihisvr(ipp,1)
+ endif
+ if (irangp.le.0) then
+ write(imphis(1)) ntcabs, ttcabs, (varcap(icap), icap=1,ncap)
+ endif
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 4. EN CAS DE SAUVEGARDE INTERMEDIAIRE OU FINALE,
+! TRANSMISSION DES INFORMATIONS DANS LES DIFFERENTS FICHIERS
+!===============================================================================
+
+! On sauve aussi au premier passage pour permettre une
+! verification des le debut du calcul
+
+if(modhis.eq.1 .or. modhis.eq.2 .or. ipass.eq.1) then
+
+ ! --> nombre de pas de temps enregistres
+
+ if(modhis.eq.2) then
+ nbpdte = ipass - 1
+ else
+ nbpdte = ipass
+ endif
+
+ ! --> nombre de capteur par variable
+ do ipp = 2, nvppmx
+ nbcap(ipp) = ihisvr(ipp,1)
+ if(nbcap(ipp).lt.0) nbcap(ipp) = ncapt
+ enddo
+
+ ! --> ecriture un fichier par variable
+
+ do ipp = 2, nvppmx
+ if (ihisvr(ipp,1).ne.0) then
+
+ if (irangp.le.0) then
+ ! --> nom du fichier
+ nomfic = ' '
+ nomfic = emphis
+ call verlon ( nomfic,ii1,ii2,lpos)
+ !==========
+ nenvar = prehis
+ call verlon(nenvar,inam1,inam2,lpos)
+ !==========
+ call undscr(inam1,inam2,nenvar)
+ !==========
+ nomfic(ii2+1:ii2+lpos) = nenvar(inam1:inam2)
+ call verlon ( nomfic,ii1,ii2,lpos)
+ !==========
+ nenvar = nomvar(ipp)
+ call verlon(nenvar,inam1,inam2,lpos)
+ !==========
+ call undscr(inam1,inam2,nenvar)
+ !==========
+ nomfic(ii2+1:ii2+lpos) = nenvar(inam1:inam2)
+ ii2 = ii2+lpos
+ nomfic(ii2+1:ii2+1) = '.'
+ ii2 = ii2+1
+ nenvar = exthis
+ call verlon(nenvar,inam1,inam2,lpos)
+ !==========
+ call undscr(inam1,inam2,nenvar)
+ !==========
+ nomfic(ii2+1:ii2+lpos) = nenvar(inam1:inam2)
+ ii2 = ii2+lpos
+ ! --> ouverture
+ open (unit=imphis(2), file=nomfic (ii1:ii2), &
+ status='UNKNOWN', form='FORMATTED', &
+ access='SEQUENTIAL')
+ ! --> entete
+ write(imphis(2),100)
+ write(imphis(2),101)
+ write(imphis(2),102) nomvar(ipp)
+ write(imphis(2),100)
+ write(imphis(2),103)
+ write(imphis(2),104)
+ write(imphis(2),103)
+ endif
+
+ if(ihisvr(ipp,1).gt.0) then
+ do ii=1,ihisvr(ipp,1)
+ if (irangp.lt.0 .or. irangp.eq.ndrcap(ihisvr(ipp,ii+1))) then
+ xyztmp(1) = xyzcen(1,nodcap(ihisvr(ipp,ii+1)))
+ xyztmp(2) = xyzcen(2,nodcap(ihisvr(ipp,ii+1)))
+ xyztmp(3) = xyzcen(3,nodcap(ihisvr(ipp,ii+1)))
+ endif
+ if (irangp.ge.0) then
+ lng = 3
+ call parbcr(ndrcap(ihisvr(ipp,ii+1)), lng , xyztmp)
+ !==========
+ endif
+ if(irangp.le.0) then
+ write(imphis(2),105) ihisvr(ipp,ii+1), &
+ xyztmp(1), xyztmp(2), xyztmp(3)
+ endif
+ enddo
+ elseif(ihisvr(ipp,1).lt.0) then
+ do ii=1,ncapt
+ if (irangp.lt.0 .or. irangp.eq.ndrcap(ii)) then
+ xyztmp(1) = xyzcen(1,nodcap(ii))
+ xyztmp(2) = xyzcen(2,nodcap(ii))
+ xyztmp(3) = xyzcen(3,nodcap(ii))
+ endif
+ if (irangp.ge.0) then
+ lng = 3
+ call parbcr(ndrcap(ii), lng , xyztmp)
+ !==========
+ endif
+ if(irangp.le.0) then
+ write(imphis(2),105) ii, xyztmp(1), xyztmp(2), xyztmp(3)
+ endif
+ enddo
+ endif
+
+ if(irangp.le.0) then
+
+ write(imphis(2),103)
+ write(imphis(2),106) nbpdte
+ write(imphis(2),103)
+
+ write(imphis(2),103)
+ write(imphis(2),107)
+ write(imphis(2),103)
+
+ write(imphis(2),100)
+ write(imphis(2),103)
+
+ write(imphis(2),110) nomvar(ipp)
+ write(imphis(2),111) (icap, icap=1,nbcap(ipp))
+ write(imphis(2),112) ('-', icap=1,nbcap(ipp))
+ write(imphis(2),103)
+
+ ! --> boucle sur les differents enregistrements et les variables
+ rewind(imphis(1))
+ do ii = 1, nbpdte
+ do ipp2 = 2, nvppmx
+ if(ihisvr(ipp2,1).ne.0) then
+ read(imphis(1)) &
+ jtcabs, xtcabs, (varcap(icap),icap=1,nbcap(ipp2))
+ if(ipp2.eq.ipp) &
+ write(imphis(2),1000) &
+ jtcabs, xtcabs, (varcap(icap),icap=1,nbcap(ipp))
+ endif
+ enddo
+ enddo
+
+ ! --> fermeture fichier
+ close(imphis(2))
+
+ endif
+
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 5. AFFICHAGES
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 100 format ('# ---------------------------------------------------')
+ 101 format ('# Fichier historique en temps')
+ 102 format ('# Variable ',A16)
+ 103 format ('# ')
+ 104 format ('# Position des capteurs (colonne)')
+ 105 format ('# ',I6,')',3(1X,E14.7))
+ 106 format ('# Nombre d''enregistrements :',I7)
+ 107 format ( &
+'# Colonne 1 : Numero du pas de temps ',/, &
+'# 2 : Temps physique (ou No pas de temps*dtref ',/, &
+'# en pas de temps non uniforme)',/, &
+'# 3 a 100 : Valeur aux capteurs')
+
+#else
+
+ 100 format ('# ---------------------------------------------------')
+ 101 format ('# Time monitoring file')
+ 102 format ('# Variable ',A16)
+ 103 format ('# ')
+ 104 format ('# Monitoring point coordinates (column)')
+ 105 format ('# ',I6,')',3(1X,E14.7))
+ 106 format ('# Number of records:',I7)
+ 107 format ( &
+'# Column 1 : Time step number ',/, &
+'# 2 : Physical time (or Nb of time steps*dtref ',/, &
+'# with non uniform time step)',/, &
+'# 3 to 100 : Value at monitoring points')
+
+#endif
+
+ 110 format ('#TITLE: ', A16)
+ 111 format ('#COLUMN_TITLES: nt | t ', 100(' | ',I3))
+ 112 format ('#COLUMN_UNITS: iter s', 100(1x, A))
+ 1000 format ( 1(1x,i7,1x),101(1x,e14.7))
+
+return
+end
diff --git a/src/base/ecrlis.f90 b/src/base/ecrlis.f90
new file mode 100644
index 0000000..2f66bc6
--- /dev/null
+++ b/src/base/ecrlis.f90
@@ -0,0 +1,619 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ecrlis &
+!================
+
+ ( idbia0 , idbra0 , &
+ nvar , nphas , ndim , ncelet , ncel , &
+ nideve , nrdeve , nituse , nrtuse , irtp , &
+ idevel , ituser , ia , &
+ rtp , rtpa , dt , volume , xyzcen , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE D'ECRITURE DES INFOS LISTING
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nvar ! e ! <-- ! nombre de variables !
+! nphas ! e ! <-- ! nombre de phases !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! irtp ! e ! <-- ! indice de rtp dans ra !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rtp ! tr ! <-- ! tableaux des variables au pdt courant !
+! (ncelet,nvar) ! ! ! !
+! rtpa ! tr ! <-- ! tableaux des variables au pdt prec !
+! (ncelet,nvar) ! ! ! !
+! dt (ncelet) ! tr ! <-- ! valeur du pas de temps !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstnum.h"
+include "parall.h"
+include "cstphy.h"
+include "albase.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0, idbra0, nvar, nphas, ndim, ncelet, ncel
+integer nideve , nrdeve , nituse , nrtuse
+integer irtp
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+double precision rtpa(ncelet,nvar), rtp(ncelet,nvar)
+double precision dt(ncelet), volume(ncelet)
+double precision xyzcen(ndim,ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ii, jj, ic, icel, ipp, ira, ivrtp, iok
+integer iphas, kphas, iprnew, ipuvw
+integer icmin, icmax
+integer nbrval
+integer idivdt, ixmsdt, idebia, idebra, ifinra, iel
+double precision petit,xyzmin(3),xyzmax(3)
+character*200 chain, chainc
+
+
+!===============================================================================
+! 0. INITIALISATIONS LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+petit =-grand
+
+!================================================
+! 1. CALCUL DES MIN ET MAX DES VARIABLES
+!================================================
+
+do ipp = 2, nvppmx
+ if(ilisvr(ipp).eq.1) then
+ varmin(ipp) = grand
+ varmax(ipp) = petit
+ ira = abs(ipp2ra(ipp))
+
+! Pour les moments, il faut eventuellement diviser par le temps cumule
+ idivdt = ippmom(ipp)
+ if(idivdt.eq.0) then
+ ixmsdt = ira
+ else
+ ixmsdt = idebra
+ ifinra = ixmsdt + ncel
+ call rasize ('ecrlis', ifinra)
+ !==========
+ endif
+ if(idivdt.gt.0) then
+ do iel = 1, ncel
+ ra(ixmsdt+iel-1) = ra(ira+iel-1)/ max(ra(idivdt+iel-1),epzero)
+ enddo
+ elseif(idivdt.lt.0) then
+ do iel = 1, ncel
+ ra(ixmsdt+iel-1) = ra(ira+iel-1)/ max(dtcmom(-idivdt),epzero)
+ enddo
+! else
+! ra(ixmsdt+iel-1) = ra(ira+iel-1)
+! inutile car on a pose ixmsdt = ira
+ endif
+
+ do icel = 1, ncel
+ if(ra(ixmsdt+icel-1).lt.varmin(ipp)) &
+ varmin(ipp) = ra(ixmsdt+icel-1)
+ if(ra(ixmsdt+icel-1).gt.varmax(ipp)) &
+ varmax(ipp) = ra(ixmsdt+icel-1)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (varmin(ipp))
+ !==========
+ call parmax (varmax(ipp))
+ !==========
+ endif
+ endif
+enddo
+
+!==================================================================
+! 2. DERIVE POUR LES VARIABLES TRANSPORTEES (sauf pression)
+!==================================================================
+
+do ipp = 2, nvppmx
+ iok = 1
+ do iphas = 1, nphas
+ if(ipp.eq.ipprtp(ipr(iphas))) then
+ iok = 0
+ endif
+ enddo
+ if(ilisvr(ipp).eq.1.and.itrsvr(ipp).ge.1) then
+ if(iok.eq.1) then
+ ira = abs(ipp2ra(ipp))
+ ivrtp = (ira-irtp)/ncelet+1
+ dervar(ipp) = 0.d0
+ do icel = 1, ncel
+ dervar(ipp) = dervar(ipp) &
+ + (rtp(icel,ivrtp)-rtpa(icel,ivrtp))**2 &
+ * volume(icel)/dt(icel)
+ enddo
+ if(irangp.ge.0) call parsom (dervar(ipp))
+ !==========
+ dervar(ipp) = dervar(ipp) / voltot
+ endif
+ endif
+enddo
+
+do iphas = 1, nphas
+ iprnew = 1
+ if(iphas.gt.1) then
+ do kphas = 1, iphas-1
+ if(ipr(iphas).eq.ipr(kphas)) then
+ iprnew = 0
+ endif
+ enddo
+ endif
+ if(iprnew.eq.1) then
+ ipp = ipprtp(ipr(iphas))
+ if(dervar(ipp).lt.epzero) then
+ dervar(ipp) = -1.d0
+ endif
+ dervar(ipp) = rnsmbr(ipp) / dervar(ipp)
+ endif
+enddo
+
+
+!==================================================================
+! 3. MIN MAX DT + LOCALISATION
+!==================================================================
+
+if (idtvar.ge.0) then
+
+! -> min max dt
+ ptploc(7,1) = grand
+ ptploc(8,1) = petit
+ icmin = 1
+ icmax = 1
+ do icel = 1, ncel
+ if(dt(icel).lt.ptploc(7,1)) then
+ ptploc(7,1) = dt(icel)
+ icmin = icel
+ endif
+ if(dt(icel).gt.ptploc(8,1)) then
+ ptploc(8,1) = dt(icel)
+ icmax = icel
+ endif
+ enddo
+
+ xyzmin(1) = xyzcen(1,icmin)
+ xyzmin(2) = xyzcen(2,icmin)
+ xyzmin(3) = xyzcen(3,icmin)
+ xyzmax(1) = xyzcen(1,icmax)
+ xyzmax(2) = xyzcen(2,icmax)
+ xyzmax(3) = xyzcen(3,icmax)
+
+ if (irangp.ge.0) then
+ nbrval = 3
+ call parmnl (nbrval, ptploc(7,1), xyzmin)
+ !==========
+ call parmxl (nbrval, ptploc(8,1), xyzmax)
+ !==========
+ endif
+
+ ptploc(7,2) = xyzmin(1)
+ ptploc(7,3) = xyzmin(2)
+ ptploc(7,4) = xyzmin(3)
+ ptploc(8,2) = xyzmax(1)
+ ptploc(8,3) = xyzmax(2)
+ ptploc(8,4) = xyzmax(3)
+
+endif
+
+
+!===============================================================================
+! 4. ECRITURE DES CRITERES DE CONVERGENCE
+!===============================================================================
+
+
+write(nfecra,1000)
+write(nfecra,1010)
+write(nfecra,1011)
+write(nfecra,1010)
+
+do ipp = 2, nvppmx
+ if(ilisvr(ipp).eq.1.and.itrsvr(ipp).ge.1) then
+
+ chainc = 'c'
+ chain = ' '
+ ic = 4
+ chain = nomvar(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+12
+ chain = ' '
+ write(chain,3000) rnsmbr(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+13
+ chain = ' '
+ write(chain,4000) nbivar(ipp)
+ chainc(ic:ic+7) = chain(1:7)
+ ic=ic+9
+ chain = ' '
+ write(chain,3000) resvar(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+14
+ chain = ' '
+ write(chain,3000) dervar(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+12
+
+ write(nfecra,'(A)') chainc(1:ic)
+
+ endif
+enddo
+
+write(nfecra,1010)
+write(nfecra,*) ' '
+write(nfecra,*) ' '
+
+
+!===============================================================================
+! 5. SUIVI DES VARIABLES , MIN - MAX - CLIPPING
+!===============================================================================
+
+
+write(nfecra,1100)
+write(nfecra,1110)
+write(nfecra,1111)
+write(nfecra,1110)
+
+do ipp = 2, nvppmx
+ if(ilisvr(ipp).eq.1) then
+
+ chainc = 'v'
+ chain = ' '
+ ic = 4
+ chain = nomvar(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+12
+ chain = ' '
+ write(chain,3000) varmin(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+14
+ chain = ' '
+ write(chain,3000) varmax(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+16
+ ipuvw = 0
+ do iphas = 1, nphas
+ if(ipp.eq.ipprtp(ipr(iphas)) .or. &
+ ipp.eq.ipprtp(iu (iphas)) .or. &
+ ipp.eq.ipprtp(iv (iphas)) .or. &
+ ipp.eq.ipprtp(iw (iphas)) ) then
+ ipuvw = 1
+ endif
+! En v2f on ne clippe jamais f_barrre, on ne l'affiche donc pas
+ if (iturb(iphas).eq.50) then
+ if (ipp.eq.ipprtp(ifb(iphas))) ipuvw = 1
+ endif
+ enddo
+! En ALE on ne clippe pas la vitesse de maillage
+ if (iale.eq.1) then
+ if (ipp.eq.ipprtp(iuma) .or. &
+ ipp.eq.ipprtp(ivma) .or. &
+ ipp.eq.ipprtp(iwma)) ipuvw = 1
+ endif
+ if(ipuvw.eq.1) then
+ chain = ' -- --'
+ chainc(ic:ic+18) = chain(1:18)
+ ic = ic+18
+ else
+ chain = ' '
+ write(chain,4000) iclpmn(ipp)
+ chainc(ic:ic+7) = chain(1:7)
+ ic=ic+11
+ chain = ' '
+ write(chain,4000) iclpmx(ipp)
+ chainc(ic:ic+7) = chain(1:7)
+ ic=ic+7
+ endif
+
+ write(nfecra,'(A)') chainc(1:ic)
+!MO ICLPMN(IPP) = 0
+!MO ICLPMX(IPP) = 0
+ endif
+enddo
+
+write(nfecra,1110)
+write(nfecra,*) ' '
+write(nfecra,*) ' '
+
+
+
+
+write(nfecra,1150)
+write(nfecra,1160)
+write(nfecra,1161)
+write(nfecra,1160)
+
+do ipp = 2, nvppmx
+ ipuvw = 0
+ do iphas = 1, nphas
+ if(ipp.eq.ipprtp(ipr(iphas)) .or. &
+ ipp.eq.ipprtp(iu (iphas)) .or. &
+ ipp.eq.ipprtp(iv (iphas)) .or. &
+ ipp.eq.ipprtp(iw (iphas)) ) then
+ ipuvw = 1
+ endif
+! En v2f on ne clippe jamais f_barrre, on ne l'affiche donc pas
+ if (iturb(iphas).eq.50) then
+ if (ipp.eq.ipprtp(ifb(iphas))) ipuvw = 1
+ endif
+! En ALE on ne clippe pas la vitesse de maillage
+ if (iale.eq.1) then
+ if (ipp.eq.ipprtp(iuma) .or. &
+ ipp.eq.ipprtp(ivma) .or. &
+ ipp.eq.ipprtp(iwma)) ipuvw = 1
+ endif
+! Compressible
+ if(ippmod(icompf).ge.0) then
+ if(ipp.eq.ipprtp(isca(itempk(iphas)))) then
+ ipuvw = 1
+ endif
+ endif
+ enddo
+ if(ilisvr(ipp).eq.1.and.itrsvr(ipp).gt.0.and.ipuvw.eq.0) then
+ chainc = 'a'
+ chain = ' '
+ ic = 4
+ chain = nomvar(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+12
+ chain = ' '
+ write(chain,3000) varmna(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+14
+ chain = ' '
+ write(chain,3000) varmxa(ipp)
+ chainc(ic:ic+12) = chain(1:12)
+ ic=ic+16
+
+ chain = ' '
+ write(chain,4000) iclpmn(ipp)
+ chainc(ic:ic+7) = chain(1:7)
+ ic=ic+11
+ chain = ' '
+ write(chain,4000) iclpmx(ipp)
+ chainc(ic:ic+7) = chain(1:7)
+ ic=ic+7
+
+ write(nfecra,'(A)') chainc(1:ic)
+ iclpmn(ipp) = 0
+ iclpmx(ipp) = 0
+ endif
+enddo
+
+write(nfecra,1160)
+write(nfecra,*) ' '
+write(nfecra,*) ' '
+
+
+!===============================================================================
+! 6. PAS DE TEMPS LOCAL
+!===============================================================================
+
+if (idtvar.ge.0) then
+
+ write(nfecra,1200)
+ write(nfecra,1210)
+ write(nfecra,1211)
+ write(nfecra,1210)
+ do ii = 1, 6
+ chainc = ' '
+ if(ii.eq.1) chainc = 'Courant min'
+ if(ii.eq.2) chainc = 'Courant max'
+ if(ii.eq.3) chainc = 'Fourier min'
+ if(ii.eq.4) chainc = 'Fourier max'
+ if(ii.eq.5) chainc = 'Cou_Fou min'
+ if(ii.eq.6) chainc = 'Cou_Fou max'
+! Compressible
+ if(ippmod(icompf).ge.0) then
+ if(ii.eq.5) chainc = 'CFL/Mas min'
+ if(ii.eq.6) chainc = 'CFL/Mas max'
+ endif
+
+ ic = 13
+ do jj = 1, 4
+ chain = ' '
+ write(chain,3000) ptploc(ii,jj)
+ chainc(ic:ic+13) = chain(1:13)
+ ic = ic+13
+ enddo
+ write(nfecra,'(A)') chainc(1:ic)
+ enddo
+ write(nfecra,1210)
+
+ if(idtvar.gt.0) then
+ do ii = 7, 8
+ chainc = ' '
+ if(ii.eq.7) chainc = 'Dt min'
+ if(ii.eq.8) chainc = 'Dt max'
+ ic = 13
+ do jj = 1, 4
+ chain = ' '
+ write(chain,3000) ptploc(ii,jj)
+ chainc(ic:ic+13) = chain(1:13)
+ ic = ic+13
+ enddo
+ write(nfecra,'(A)') chainc(1:ic)
+ enddo
+ write(nfecra,1210)
+ endif
+
+ if (iptlro.eq.1) then
+ chainc = ' '
+ chainc = 'Dt/Dtrho max'
+ ic = 13
+ do jj = 1, 4
+ chain = ' '
+ write(chain,3000) rpdtro(jj)
+ chainc(ic:ic+13) = chain(1:13)
+ ic = ic+13
+ enddo
+ write(nfecra,'(A)') chainc(1:ic)
+ chainc = ' '
+ chainc = 'Clips a Dtrho'
+ ic = 57
+ chain = ' '
+ write(chain,4000) nclptr
+ chainc(ic:ic+7) = chain(1:7)
+ ic = ic+7
+ write(nfecra,'(A)') chainc(1:ic)
+ write(nfecra,1210)
+ endif
+
+ write(nfecra,*) ' '
+ write(nfecra,*) ' '
+
+endif
+
+!===============================================================================
+! 3.
+!===============================================================================
+!--------
+! Formats
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format (/,3X,'** INFORMATIONS SUR LA CONVERGENCE',/, &
+ 3X,' -------------------------------')
+ 1011 format (' Variable Norm 2nd mb.', &
+ ' Nbiter Residu norme derive')
+ 1010 format ('---------------------------', &
+ '------------------------------------')
+
+
+ 1100 format (/,3X,'** INFORMATIONS SUR LES VARIABLES',/, &
+ 3X,' ------------------------------')
+ 1111 format (' Variable Valeur min Valeur max', &
+ ' Clip min Clip max')
+ 1110 format ('-----------------------------------------', &
+ '----------------------')
+
+ 1150 format (/,3X,'** INFORMATIONS SUR LES CLIPPINGS',/, &
+ 3X,' ------------------------------')
+ 1161 format (' Variable Min ss clips Max ss clips', &
+ ' Clip min Clip max')
+ 1160 format ('-----------------------------------------', &
+ '----------------------')
+
+
+ 1200 format (/,3X,'** INFORMATIONS SUR LE PAS DE TEMPS',/, &
+ 3X,' --------------------------------')
+ 1210 format ('---------------------------', &
+ '------------------------------------')
+ 1211 format ('Critere Valeur en xc', &
+ ' yc zc')
+
+ 3000 format (e12.5)
+ 4000 format (i7)
+
+#else
+
+ 1000 format (/,3X,'** INFORMATION ON CONVERGENCE',/, &
+ 3X,' --------------------------')
+ 1011 format (' Variable Rhs norm ', &
+ ' N_iter Norm. residual derive')
+ 1010 format ('---------------------------', &
+ '------------------------------------')
+
+
+ 1100 format (/,3X,'** INFORMATION ON VARIABLES',/, &
+ 3X,' ------------------------')
+ 1111 format (' Variable Min. value Max. value', &
+ ' Min clip Max clip')
+ 1110 format ('-----------------------------------------', &
+ '----------------------')
+
+ 1150 format (/,3X,'** INFORMATION ON CLIPPINGS',/, &
+ 3X,' ------------------------')
+ 1161 format (' Variable Min wo clips Max wo clips', &
+ ' Min clip Max clip')
+ 1160 format ('-----------------------------------------', &
+ '----------------------')
+
+
+ 1200 format (/,3X,'** INFORMATION ON THE TIME STEP',/, &
+ 3X,' -----------------------------')
+ 1210 format ('---------------------------', &
+ '------------------------------------')
+ 1211 format ('Criterion Value at xc', &
+ ' yc zc')
+
+ 3000 format (e12.5)
+ 4000 format (i7)
+
+#endif
+return
+end
diff --git a/src/base/findpt.f90 b/src/base/findpt.f90
new file mode 100644
index 0000000..d8d5b0f
--- /dev/null
+++ b/src/base/findpt.f90
@@ -0,0 +1,110 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine findpt &
+!================
+
+ ( ncelet , ncel , xyzcen , &
+ xx , yy , zz , node , ndrang)
+
+!===============================================================================
+
+! FONCTION
+! --------
+! RECHERCHE DU NOEUD LE PLUS PROCHE DU POINT XX,YY,ZZ
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! xyzcen(ndim ! tr ! -->! table des coordonnees du !
+! ncelet ! ! ! centre des volumes !
+! xx,yy,zz ! tr ! -->! coordonnees du noeud cherche !
+! node ! e ! --> ! noeud cherche (numerotation globale) !
+! ! ! ! zero si plantage !
+! ndrang ! e ! --> ! rang du processus associe !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "parall.h"
+
+!===============================================================================
+
+integer ncelet, ncel, node, ndrang
+double precision xyzcen(3,ncelet)
+double precision xx, yy, zz
+
+integer ii
+double precision xx1, yy1, zz1, dis2, dis2mn
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+node = int((ncel+1)/2)
+
+xx1 = xyzcen(1,node)
+yy1 = xyzcen(2,node)
+zz1 = xyzcen(3,node)
+dis2mn = (xx-xx1)**2+(yy-yy1)**2+(zz-zz1)**2
+
+do ii = 1, ncel
+ xx1 = xyzcen(1,ii)
+ yy1 = xyzcen(2,ii)
+ zz1 = xyzcen(3,ii)
+ dis2 = (xx-xx1)**2+(yy-yy1)**2+(zz-zz1)**2
+ if (dis2.lt.dis2mn) then
+ node = ii
+ dis2mn = dis2
+ endif
+enddo
+
+if (irangp.ge.0) then
+ call parfpt (node, ndrang, dis2mn)
+ !==========
+else
+ ndrang = -1
+endif
+
+return
+end
diff --git a/src/base/gradmc.f90 b/src/base/gradmc.f90
new file mode 100644
index 0000000..ea3ec64
--- /dev/null
+++ b/src/base/gradmc.f90
@@ -0,0 +1,1399 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine gradmc &
+!================
+
+ ( ncelet , ncel , nfac , nfabor , ncelbr , &
+ inc , iccocg , nswrgp , idimte , itenso , iphydp , imrgra , &
+ iwarnp , nfecra , epsrgp , extrap , &
+ ifacel , ifabor , icelbr , ipcvse , ielvse , isympa , &
+ volume , surfac , surfbo , surfbn , pond , &
+ dist , distbr , dijpf , diipb , &
+ fextx , fexty , fextz , &
+ xyzcen , cdgfac , cdgfbo , coefap , coefbp , pvar , &
+ cocgb , cocg , &
+ dpdx , dpdy , dpdz , &
+ bx , by , bz )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DU GRADIENT CELLULE PAR RECONSTRUCTION MOINDRES CARRES 99
+! SUR UN SUPPORT ETENDU
+! AVEC PRISE EN COMPTE EVENTUELLE D'UN TERME DE FORCE VOLUMIQUE
+! GENERANT UNE COMPOSANTE DE PRESSION HYDROSTATIQUE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins !
+! ! ! ! face de bord !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! idimte ! e ! <-- ! dimension de la varible (maximum 3) !
+! ! ! ! 0 : scalaire (var11) ou assimile !
+! ! ! ! scalaire !
+! ! ! ! 1 : vecteur (var11,var22,var33) !
+! ! ! ! 2 : tenseur d'ordre 2 (varij) !
+! itenso ! e ! <-- ! pour l'explicitation de la rotation !
+! ! ! ! 0 : scalaire (var11) !
+! ! ! ! 1 : composante de vecteur ou de !
+! ! ! ! tenseur (var11) implcite pour la !
+! ! ! ! translation !
+! ! ! !11 : reprend le traitement itenso=1 et !
+! ! ! ! composante de vecteur ou de !
+! ! ! ! tenseur (var11) annulee pour la !
+! ! ! ! rotation !
+! ! ! ! 2 : vecteur (var11 et var22 et var33) !
+! ! ! ! implicite pour la translation !
+! iphydp ! e ! <-- ! indicateur de prise en compte de la !
+! ! ! ! pression hydrostatique !
+! imrgra ! e ! <-- ! methode de reconstruction du gradient !
+! ! ! ! 0 reconstruction 97 !
+! ! ! ! 1 moindre carre !
+! ! ! ! 2 moindre carre support etendu !
+! ! ! ! 3 moindre carre support etendu redui !
+! ! ! ! 4 reconstr avec init moindres carres !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! extrap ! r ! <-- ! coef extrap gradient !
+! ifacel(2,nfac ! te ! <-- ! no des elts voisins d'une face intern !
+! ifabor(nfabor ! te ! <-- ! no de l'elt voisin d'une face de bord !
+! icelbr ! te ! <-- ! numero global des elements ayant au !
+! (ncelbr) ! ! ! moins une face de bord !
+! ! ! ! ranges par numero croissant !
+! ipcvse ! te ! <-- ! position dans ielvse des voisins !
+! (ncel ) ! ! ! etendus des cellules !
+! ielvse (*) ! te ! <-- ! numero des voisins etendus des cellul !
+! isympa(nfabor ! te ! <-- ! nul sur les symetries !
+! volume(ncelet ! tr ! <-- ! volume des elements !
+! surfac(3,nfac ! tr ! <-- ! surf vectorielle des surfaces interne !
+! surfbo ! tr ! <-- ! surf vectorielle des surfaces de bord !
+! (3,nfabor) ! ! ! !
+! surfbn ! tr ! <-- ! norme de la surface des faces de bord !
+! (nfabor) ! ! ! !
+! pond(nfac) ! tr ! <-- ! ponderation geometrique (entre 0 et 1 !
+! dist(nfac) ! tr ! <-- ! dist entre les projections orthogonal !
+! ! ! ! sur la normale a une face des centre !
+! ! ! ! volumes voisins !
+! distbr(nfabor ! tr ! <-- ! dist du centre a la face de bord !
+! dijpf(3,nfac) ! tr ! <-- ! vect i'j', i' (resp. j') projection !
+! ! ! ! du centre i (resp. j) sur la normale !
+! ! ! ! a la face interne !
+! diipb ! tr ! <-- ! vect ii', ii projection du centre i !
+! (3,nfabor) ! ! ! sur la normale a la face de bord !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (3,ncelet ! ! ! !
+! cdgfac ! tr ! <-- ! point associes aux facettes fluides !
+! (3,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! points associes aux facettes de bord !
+! (3,nfabor) ! ! ! !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour pvar !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! pvar (ncelet ! tr ! <-- ! variable (ncelet + v. etendu eventuel !
+! fextx,y,z ! tr ! <-- ! force exterieure generant la pression !
+! (ncelet) ! ! ! hydrostatique !
+! cocgb ! tr ! <-- ! contribution des faces internes a !
+! (ncelbr,3,3) ! ! ! cocg (cellules de bord) !
+! cocg ! tr ! <-- ! couplage des composantes du gradient !
+! ncelet,3,3 ! ! ! modifie eventuellement aux bords !
+! dpdx dpdy ! tr ! --> ! gradient de pvar !
+! dpdz (ncelet ! tr ! ! !
+! bx,y,z(ncelet ! tr ! --- ! tableau de travail pour le grad de p !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "vector.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel , nfac , nfabor , ncelbr
+integer inc , iccocg , nswrgp
+integer idimte , itenso , iphydp , imrgra
+integer iwarnp , nfecra
+double precision epsrgp , extrap
+
+integer ifacel(2,nfac),ifabor(nfabor),icelbr(ncelbr)
+integer ipcvse(*), ielvse(*), isympa(nfabor)
+double precision volume(ncelet), surfac(3,nfac)
+double precision surfbo(3,nfabor), surfbn(nfabor)
+double precision pond(nfac), dist(nfac), distbr(nfabor)
+double precision dijpf(3,nfac), diipb(3,nfabor)
+double precision xyzcen(3,*),cdgfac(3,nfac),cdgfbo(3,nfabor)
+double precision coefap(nfabor), coefbp(nfabor), pvar(*)
+double precision fextx(*),fexty(*),fextz(*)
+double precision cocgb(ncelbr,3,3), cocg(ncelet,3,3)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision bx(ncelet),by(ncelet),bz(ncelet)
+
+! VARIABLES LOCALES
+
+integer lbloc
+parameter (lbloc = 1024)
+
+integer ii , jj , iel , ielb , ifac , ipos
+integer ibloc , nbloc , irel , iiii , invemx
+double precision pfac , rkij , dsij(3), aa(lbloc,3,3)
+double precision a11 , a22 , a33 , a12 , a13 , a23
+double precision cocg11, cocg12, cocg13, cocg21, cocg22, cocg23
+double precision cocg31, cocg32, cocg33
+double precision usdij2, pfsx , pfsy , pfsz
+double precision unsdij, unssbn, umcbsd, unsdet
+double precision pfac1 , pfac2 , pfac3 , vecfac, unsvol, extrab
+double precision ptmidx, ptmidy, ptmidz
+
+! INDICATEUR DE PREMIER PASSAGE
+integer inicoc
+data inicoc /1/
+save inicoc
+
+! VERIFICATION QUE NCEL > NBRE DE VOISINS ETENDUS D'UNE CELLULE
+integer icesve
+data icesve /-1/
+save icesve
+
+!===============================================================================
+
+!===============================================================================
+! 0. TRAITEMENT DE EXTRAG POUR LES SYMETRIES
+!===============================================================================
+
+! POUR LES CALCULS 2D EN PARTICULIER, SI ON EXTRAPOLE LE GRADIENT DE
+! PRESSION, ON SE TROUVE AVEC UNE MATRICE COCG NON INVERSIBLE, A
+! CAUSE DE LA TROISIEME DIRECTION.
+
+! COMME L'ON N'A EN PRATIQUE QU'UNE SEULE PHASE,
+! ET QUE EXTRAG = 0 ou 1 (1 POUR LA PRESSION UNIQUEMENT)
+! ON SE PLACE IMPLICITEMENT DANS CETTE SITUATION, AVEC UN STOP
+! DANS VERINI AU CAS OU CE NE SERAIT PAS LE CAS.
+
+! LA MODIFICATION CONSISTE A MULTIPLIER EXTRAP PAR ISYMPA QUI EST
+! NUL SUR LES SYMETRIES : ON N'EXTRAPOLE DONC PAS LE GRADIENT SUR CES
+! FACES.
+
+!===============================================================================
+! 1. INITIALISATION DU GRADIENT
+!===============================================================================
+
+if( nswrgp.le.1 ) then
+
+ do iel = 1, ncelet
+ bx (iel) = 0.d0
+ by (iel) = 0.d0
+ bz (iel) = 0.d0
+ enddo
+
+! CAS STANDARD, SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! ===============================================================
+ if (iphydp.eq.0) then
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*pvar(ii) +(1.d0-pond(ifac))*pvar(jj)
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*pvar(ii) +(1.d0-pond(ifac))*pvar(jj)
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ endif
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pvar(ii)
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pvar(ii)
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ endif
+
+! CAS AVEC PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! =====================================================
+ else
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfac(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfac(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfac(3,ifac))*fextz(ii)) &
+ +(1.d0-pond(ifac))*(pvar(jj) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*fextx(jj) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*fexty(jj) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*fextz(jj))
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfac(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfac(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfac(3,ifac))*fextz(ii)) &
+ +(1.d0-pond(ifac))*(pvar(jj) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*fextx(jj) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*fexty(jj) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*fextz(jj))
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ endif
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfbo(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfbo(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfbo(3,ifac))*fextz(ii) )
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfbo(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfbo(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfbo(3,ifac))*fextz(ii) )
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ endif
+
+ endif
+
+! DPDX,DPDY,DPDZ = GRADIENT
+
+ do iel = 1, ncel
+ unsvol = 1.d0/volume(iel)
+ dpdx(iel) = bx(iel)*unsvol
+ dpdy(iel) = by(iel)*unsvol
+ dpdz(iel) = bz(iel)*unsvol
+ enddo
+
+! TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (dpdx)
+ !==========
+ call parcom (dpdy)
+ !==========
+ call parcom (dpdz)
+ !==========
+ endif
+
+! TRAITEMENT DE LA PERIODICITE
+
+ if(iperio.eq.1) then
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dpdx , dpdx , dpdx , &
+ dpdy , dpdy , dpdy , &
+ dpdz , dpdz , dpdz )
+ endif
+
+ return
+
+endif
+
+
+!===============================================================================
+! 2. CONSTRUCTION DES GRADIENTS PAR UNE METHODE DE MOINDRE
+! CARRE POUR LES MAILLAGES TORDUS
+!===============================================================================
+
+
+if( (inicoc.eq.1.or.iale.eq.1) .and.iccocg.eq.1) then
+
+
+! ---> 2.1 CALCUL COMPLET DE COCG ET
+! SAUVEGARDE DE LA CONTRIBUTION AUX CELLULES DE BORD
+
+! INITIALISATION
+
+ do ii = 1, 3
+ do jj = 1, 3
+ do iel = 1, ncelet
+ cocg(iel,ii,jj) = 0.d0
+ enddo
+ enddo
+ enddo
+
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ unsdij = 1.d0/sqrt( (xyzcen(1,ii)-xyzcen(1,jj))**2 &
+ +(xyzcen(2,ii)-xyzcen(2,jj))**2 &
+ +(xyzcen(3,ii)-xyzcen(3,jj))**2 )
+ dsij(1) = (xyzcen(1,jj)-xyzcen(1,ii))*unsdij
+ dsij(2) = (xyzcen(2,jj)-xyzcen(2,ii))*unsdij
+ dsij(3) = (xyzcen(3,jj)-xyzcen(3,ii))*unsdij
+
+ cocg(ii,1,1) = cocg(ii,1,1) +dsij(1)*dsij(1)
+ cocg(ii,2,2) = cocg(ii,2,2) +dsij(2)*dsij(2)
+ cocg(ii,3,3) = cocg(ii,3,3) +dsij(3)*dsij(3)
+ cocg(ii,1,2) = cocg(ii,1,2) +dsij(1)*dsij(2)
+ cocg(ii,1,3) = cocg(ii,1,3) +dsij(1)*dsij(3)
+ cocg(ii,2,3) = cocg(ii,2,3) +dsij(2)*dsij(3)
+
+ cocg(jj,1,1) = cocg(jj,1,1) +dsij(1)*dsij(1)
+ cocg(jj,2,2) = cocg(jj,2,2) +dsij(2)*dsij(2)
+ cocg(jj,3,3) = cocg(jj,3,3) +dsij(3)*dsij(3)
+ cocg(jj,1,2) = cocg(jj,1,2) +dsij(1)*dsij(2)
+ cocg(jj,1,3) = cocg(jj,1,3) +dsij(1)*dsij(3)
+ cocg(jj,2,3) = cocg(jj,2,3) +dsij(2)*dsij(3)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ unsdij = 1.d0/sqrt( (xyzcen(1,ii)-xyzcen(1,jj))**2 &
+ +(xyzcen(2,ii)-xyzcen(2,jj))**2 &
+ +(xyzcen(3,ii)-xyzcen(3,jj))**2 )
+ dsij(1) = (xyzcen(1,jj)-xyzcen(1,ii))*unsdij
+ dsij(2) = (xyzcen(2,jj)-xyzcen(2,ii))*unsdij
+ dsij(3) = (xyzcen(3,jj)-xyzcen(3,ii))*unsdij
+
+ cocg(ii,1,1) = cocg(ii,1,1) +dsij(1)*dsij(1)
+ cocg(ii,2,2) = cocg(ii,2,2) +dsij(2)*dsij(2)
+ cocg(ii,3,3) = cocg(ii,3,3) +dsij(3)*dsij(3)
+ cocg(ii,1,2) = cocg(ii,1,2) +dsij(1)*dsij(2)
+ cocg(ii,1,3) = cocg(ii,1,3) +dsij(1)*dsij(3)
+ cocg(ii,2,3) = cocg(ii,2,3) +dsij(2)*dsij(3)
+
+ cocg(jj,1,1) = cocg(jj,1,1) +dsij(1)*dsij(1)
+ cocg(jj,2,2) = cocg(jj,2,2) +dsij(2)*dsij(2)
+ cocg(jj,3,3) = cocg(jj,3,3) +dsij(3)*dsij(3)
+ cocg(jj,1,2) = cocg(jj,1,2) +dsij(1)*dsij(2)
+ cocg(jj,1,3) = cocg(jj,1,3) +dsij(1)*dsij(3)
+ cocg(jj,2,3) = cocg(jj,2,3) +dsij(2)*dsij(3)
+ enddo
+
+ endif
+
+! ET COMPLEMENT POUR LE VOISINAGE ETENDU
+! PAS DE VECTORISATION PARTICULIERE A IMPOSER A PRIORI
+
+ if (imrgra.eq.2.or.imrgra.eq.3) then
+
+ do ii = 1, ncel
+ do ipos = ipcvse(ii), ipcvse(ii+1)-1
+ jj = ielvse(ipos)
+
+ unsdij = 1.d0/sqrt( (xyzcen(1,ii)-xyzcen(1,jj))**2 &
+ +(xyzcen(2,ii)-xyzcen(2,jj))**2 &
+ +(xyzcen(3,ii)-xyzcen(3,jj))**2 )
+ dsij(1) = (xyzcen(1,jj)-xyzcen(1,ii))*unsdij
+ dsij(2) = (xyzcen(2,jj)-xyzcen(2,ii))*unsdij
+ dsij(3) = (xyzcen(3,jj)-xyzcen(3,ii))*unsdij
+
+ cocg(ii,1,1) = cocg(ii,1,1) +dsij(1)*dsij(1)
+ cocg(ii,2,2) = cocg(ii,2,2) +dsij(2)*dsij(2)
+ cocg(ii,3,3) = cocg(ii,3,3) +dsij(3)*dsij(3)
+ cocg(ii,1,2) = cocg(ii,1,2) +dsij(1)*dsij(2)
+ cocg(ii,1,3) = cocg(ii,1,3) +dsij(1)*dsij(3)
+ cocg(ii,2,3) = cocg(ii,2,3) +dsij(2)*dsij(3)
+
+ enddo
+ enddo
+
+ endif
+
+! SAUVEGARDE DE LA CONTRIBUTION DES FACES INTERNES AUX ELEMENTS DE BORD
+
+!CDIR NODEP
+ do ii = 1, ncelbr
+ iel = icelbr(ii)
+ cocgb(ii,1,1) = cocg(iel,1,1)
+ cocgb(ii,1,2) = cocg(iel,1,2)
+ cocgb(ii,1,3) = cocg(iel,1,3)
+ cocgb(ii,2,1) = cocg(iel,1,2)
+ cocgb(ii,2,2) = cocg(iel,2,2)
+ cocgb(ii,2,3) = cocg(iel,2,3)
+ cocgb(ii,3,1) = cocg(iel,1,3)
+ cocgb(ii,3,2) = cocg(iel,2,3)
+ cocgb(ii,3,3) = cocg(iel,3,3)
+ enddo
+
+ inicoc = 0
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = 1.d0-isympa(ifac)*extrap*coefbp(ifac)
+ umcbsd = extrab*(1.d0-coefbp(ifac))/distbr(ifac)
+ unssbn = extrab/surfbn(ifac)
+
+ dsij(1) = surfbo(1,ifac)*unssbn +umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn +umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn +umcbsd*diipb(3,ifac)
+
+ cocg(ii,1,1) = cocg(ii,1,1) +dsij(1)*dsij(1)
+ cocg(ii,2,2) = cocg(ii,2,2) +dsij(2)*dsij(2)
+ cocg(ii,3,3) = cocg(ii,3,3) +dsij(3)*dsij(3)
+ cocg(ii,1,2) = cocg(ii,1,2) +dsij(1)*dsij(2)
+ cocg(ii,1,3) = cocg(ii,1,3) +dsij(1)*dsij(3)
+ cocg(ii,2,3) = cocg(ii,2,3) +dsij(2)*dsij(3)
+
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = 1.d0-isympa(ifac)*extrap*coefbp(ifac)
+ umcbsd = extrab*(1.d0-coefbp(ifac))/distbr(ifac)
+ unssbn = extrab/surfbn(ifac)
+
+ dsij(1) = surfbo(1,ifac)*unssbn +umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn +umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn +umcbsd*diipb(3,ifac)
+
+ cocg(ii,1,1) = cocg(ii,1,1) +dsij(1)*dsij(1)
+ cocg(ii,2,2) = cocg(ii,2,2) +dsij(2)*dsij(2)
+ cocg(ii,3,3) = cocg(ii,3,3) +dsij(3)*dsij(3)
+ cocg(ii,1,2) = cocg(ii,1,2) +dsij(1)*dsij(2)
+ cocg(ii,1,3) = cocg(ii,1,3) +dsij(1)*dsij(3)
+ cocg(ii,2,3) = cocg(ii,2,3) +dsij(2)*dsij(3)
+
+ enddo
+
+ endif
+
+! SYMETRISATION
+
+ do iel = 1, ncel
+ cocg(iel,2,1) = cocg(iel,1,2)
+ cocg(iel,3,1) = cocg(iel,1,3)
+ cocg(iel,3,2) = cocg(iel,2,3)
+ enddo
+
+! INVERSION
+
+ nbloc = ncel/lbloc
+ if (nbloc.gt.0) then
+ do ibloc = 1, nbloc
+ do ii = 1, lbloc
+ iel = (ibloc-1)*lbloc+ii
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11+cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11 *unsdet
+ aa(ii,1,2) = a12 *unsdet
+ aa(ii,1,3) = a13 *unsdet
+ aa(ii,2,2) = a22 *unsdet
+ aa(ii,2,3) = a23 *unsdet
+ aa(ii,3,3) = a33 *unsdet
+
+ enddo
+
+ do ii = 1, lbloc
+ iel = (ibloc-1)*lbloc+ii
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+
+ enddo
+
+ endif
+
+ irel = mod(ncel,lbloc)
+ if (irel.gt.0) then
+ ibloc = nbloc + 1
+ do ii = 1, irel
+ iel = (ibloc-1)*lbloc+ii
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11+cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11 *unsdet
+ aa(ii,1,2) = a12 *unsdet
+ aa(ii,1,3) = a13 *unsdet
+ aa(ii,2,2) = a22 *unsdet
+ aa(ii,2,3) = a23 *unsdet
+ aa(ii,3,3) = a33 *unsdet
+
+ enddo
+
+ do ii = 1, irel
+ iel = (ibloc-1)*lbloc+ii
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+ endif
+
+
+! MATRICE SYMETRIQUE
+
+ do iel = 1, ncel
+ cocg(iel,2,1) = cocg(iel,1,2)
+ cocg(iel,3,1) = cocg(iel,1,3)
+ cocg(iel,3,2) = cocg(iel,2,3)
+ enddo
+
+elseif(iccocg.eq.1) then
+
+! ---> 2.2 CALCUL AUX BORDS DE COCG
+
+ do ii = 1, 3
+ do jj = 1, 3
+!CDIR NODEP
+ do ielb = 1, ncelbr
+ iel = icelbr(ielb)
+ cocg(iel,ii,jj) = cocgb(ielb,ii,jj)
+ enddo
+ enddo
+ enddo
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = 1.d0-isympa(ifac)*extrap*coefbp(ifac)
+ umcbsd = extrab*(1.d0-coefbp(ifac))/distbr(ifac)
+ unssbn = extrab/surfbn(ifac)
+
+ dsij(1) = surfbo(1,ifac)*unssbn+umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn+umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn+umcbsd*diipb(3,ifac)
+
+ cocg(ii,1,1) = cocg(ii,1,1) +dsij(1)*dsij(1)
+ cocg(ii,2,2) = cocg(ii,2,2) +dsij(2)*dsij(2)
+ cocg(ii,3,3) = cocg(ii,3,3) +dsij(3)*dsij(3)
+ cocg(ii,1,2) = cocg(ii,1,2) +dsij(1)*dsij(2)
+ cocg(ii,1,3) = cocg(ii,1,3) +dsij(1)*dsij(3)
+ cocg(ii,2,3) = cocg(ii,2,3) +dsij(2)*dsij(3)
+
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = 1.d0-isympa(ifac)*extrap*coefbp(ifac)
+ umcbsd = extrab*(1.d0-coefbp(ifac))/distbr(ifac)
+ unssbn = extrab/surfbn(ifac)
+
+ dsij(1) = surfbo(1,ifac)*unssbn+umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn+umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn+umcbsd*diipb(3,ifac)
+
+ cocg(ii,1,1) = cocg(ii,1,1) +dsij(1)*dsij(1)
+ cocg(ii,2,2) = cocg(ii,2,2) +dsij(2)*dsij(2)
+ cocg(ii,3,3) = cocg(ii,3,3) +dsij(3)*dsij(3)
+ cocg(ii,1,2) = cocg(ii,1,2) +dsij(1)*dsij(2)
+ cocg(ii,1,3) = cocg(ii,1,3) +dsij(1)*dsij(3)
+ cocg(ii,2,3) = cocg(ii,2,3) +dsij(2)*dsij(3)
+
+ enddo
+ endif
+
+! SYMETRISATION
+
+!CDIR NODEP
+ do ielb = 1, ncelbr
+ iel = icelbr(ielb)
+ cocg(iel,2,1) = cocg(iel,1,2)
+ cocg(iel,3,1) = cocg(iel,1,3)
+ cocg(iel,3,2) = cocg(iel,2,3)
+ enddo
+
+
+ nbloc = ncelbr/lbloc
+ if (nbloc.gt.0) then
+ do ibloc = 1, nbloc
+ do ii = 1, lbloc
+ ielb = (ibloc-1)*lbloc+ii
+ iel = icelbr(ielb)
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11+cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11*unsdet
+ aa(ii,1,2) = a12*unsdet
+ aa(ii,1,3) = a13*unsdet
+ aa(ii,2,2) = a22*unsdet
+ aa(ii,2,3) = a23*unsdet
+ aa(ii,3,3) = a33*unsdet
+
+ enddo
+
+!CDIR NODEP
+ do ii = 1, lbloc
+ ielb = (ibloc-1)*lbloc + ii
+ iel = icelbr(ielb)
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+
+ enddo
+
+ endif
+
+ irel = mod(ncelbr,lbloc)
+ if (irel .gt.0) then
+ ibloc = nbloc + 1
+ do ii = 1, irel
+ ielb = (ibloc-1)*lbloc+ii
+ iel = icelbr(ielb)
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11+cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11*unsdet
+ aa(ii,1,2) = a12*unsdet
+ aa(ii,1,3) = a13*unsdet
+ aa(ii,2,2) = a22*unsdet
+ aa(ii,2,3) = a23*unsdet
+ aa(ii,3,3) = a33*unsdet
+
+ enddo
+
+!CDIR NODEP
+ do ii = 1, irel
+ ielb = (ibloc-1)*lbloc + ii
+ iel = icelbr(ielb)
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+
+ endif
+
+
+! SYMETRISATION DE LA MATRICE INVERSEE
+
+!CDIR NODEP
+ do ielb = 1, ncelbr
+ iel = icelbr(ielb)
+ cocg(iel,2,1) = cocg(iel,1,2)
+ cocg(iel,3,1) = cocg(iel,1,3)
+ cocg(iel,3,2) = cocg(iel,2,3)
+ enddo
+
+endif
+
+!===============================================================================
+! 3. CALCUL DU SECOND MEMBRE
+!===============================================================================
+
+do iel = 1, ncelet
+ bx(iel) = 0.d0
+ by(iel) = 0.d0
+ bz(iel) = 0.d0
+enddo
+
+! CAS STANDARD, SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! ===============================================================
+if (iphydp.eq.0) then
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ vecfac = ( pvar(jj)-pvar(ii) )*usdij2
+
+ pfsx = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ pfsy = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ pfsz = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) +pfsx
+ by(jj) = by(jj) +pfsy
+ bz(jj) = bz(jj) +pfsz
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ vecfac = ( pvar(jj)-pvar(ii) )*usdij2
+
+ pfsx = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ pfsy = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ pfsz = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) +pfsx
+ by(jj) = by(jj) +pfsy
+ bz(jj) = bz(jj) +pfsz
+ enddo
+
+ endif
+
+! ET COMPLEMENT POUR LE VOISINAGE ETENDU
+! LA REECRITURE COMPLEXE DE LA BOUCLE EST DESTINEE A DIVISER LE CPU
+! TOTAL SUR VPP PAR 5. POUR CELA, ON UTILISE DPDX DPDY DPDZ COMME
+! TABLEAUX DE TRAVAIL LOCAUX
+! SI ON TOMBAIT SUR UN CAS PATHOLOGIQUES DANS LEQUEL NCEL < NOMBRE
+! DE CELLULES DU VOISINAGE ETENDU D'UNE CELLULE (AVEC PERIODICITE
+! MULTIPLE ET PEU DE MAILLES ???) ON FAIT UN TEST ET ON CONSERVE
+! LA BOUCLE INITIALE. ON AJOUTE CEPENDANT UN IF QUI PERMET SUR VPP
+! DE REDUIRE LE TEMPS CALCUL D'UN FACTEUR 4 SI LA BOUCLE N'EST PAS
+! SCINDEE EN DEUX.
+
+ if (imrgra.eq.2.or.imrgra.eq.3) then
+
+! ON REGARDE SI NCEL >= NBRE DE VOISINS ETENDUS D'UNE CELLULE
+ if (icesve.lt.0) then
+ invemx = 0
+ do ii = 1, ncel
+ invemx = max(invemx,ipcvse(ii+1)-ipcvse(ii))
+ enddo
+ if (ncel.ge.invemx) then
+ icesve = 1
+ else
+ icesve = 0
+ endif
+ endif
+
+ if (icesve.gt.0) then
+
+ do ii = 1, ncel
+ do ipos = ipcvse(ii), ipcvse(ii+1)-1
+ jj = ielvse(ipos)
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ vecfac = ( pvar(jj)-pvar(ii) )*usdij2
+
+ iiii = ipos-ipcvse(ii)+1
+ dpdx(iiii) = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ dpdy(iiii) = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ dpdz(iiii) = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ enddo
+ do ipos = ipcvse(ii), ipcvse(ii+1)-1
+ iiii = ipos-ipcvse(ii)+1
+ bx(ii) = bx(ii) +dpdx(iiii)
+ by(ii) = by(ii) +dpdy(iiii)
+ bz(ii) = bz(ii) +dpdz(iiii)
+ enddo
+ enddo
+
+ else
+
+ do ii = 1, ncel
+ if(ipcvse(ii+1).gt.ipcvse(ii)) then
+ do ipos = ipcvse(ii), ipcvse(ii+1)-1
+ jj = ielvse(ipos)
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ vecfac = ( pvar(jj)-pvar(ii) )*usdij2
+
+ pfsx = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ pfsy = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ pfsz = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ enddo
+ endif
+ enddo
+
+ endif
+
+ endif
+
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = (1.d0-isympa(ifac)*extrap*coefbp(ifac))**2
+ unsdij = 1.d0/distbr(ifac)
+ unssbn = 1.d0/surfbn(ifac)
+ umcbsd = (1.d0-coefbp(ifac))*unsdij
+
+ dsij(1) = surfbo(1,ifac)*unssbn + umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn + umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn + umcbsd*diipb(3,ifac)
+ rkij = ( inc*coefap(ifac) &
+ +(coefbp(ifac)-1.d0)*pvar(ii) )*unsdij*extrab
+
+ bx(ii) = bx(ii) +dsij(1)*rkij
+ by(ii) = by(ii) +dsij(2)*rkij
+ bz(ii) = bz(ii) +dsij(3)*rkij
+
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = (1.d0-isympa(ifac)*extrap*coefbp(ifac))**2
+ unsdij = 1.d0/distbr(ifac)
+ unssbn = 1.d0/surfbn(ifac)
+ umcbsd = (1.d0-coefbp(ifac))*unsdij
+
+ dsij(1) = surfbo(1,ifac)*unssbn + umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn + umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn + umcbsd*diipb(3,ifac)
+ rkij = ( inc*coefap(ifac) &
+ +(coefbp(ifac)-1.d0)*pvar(ii) )*unsdij*extrab
+
+ bx(ii) = bx(ii) +dsij(1)*rkij
+ by(ii) = by(ii) +dsij(2)*rkij
+ bz(ii) = bz(ii) +dsij(3)*rkij
+
+ enddo
+
+ endif
+
+! CAS AVEC PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! =====================================================
+elseif(iphydp.ne.0) then
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ vecfac = ( pvar(jj)-pvar(ii) &
+ +(xyzcen(1,ii)-cdgfac(1,ifac))*fextx(ii) &
+ +(xyzcen(2,ii)-cdgfac(2,ifac))*fexty(ii) &
+ +(xyzcen(3,ii)-cdgfac(3,ifac))*fextz(ii) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*fextx(jj) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*fexty(jj) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*fextz(jj) )*usdij2
+
+ pfsx = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ pfsy = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ pfsz = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) +pfsx
+ by(jj) = by(jj) +pfsy
+ bz(jj) = bz(jj) +pfsz
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ vecfac = ( pvar(jj)-pvar(ii) &
+ +(xyzcen(1,ii)-cdgfac(1,ifac))*fextx(ii) &
+ +(xyzcen(2,ii)-cdgfac(2,ifac))*fexty(ii) &
+ +(xyzcen(3,ii)-cdgfac(3,ifac))*fextz(ii) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*fextx(jj) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*fexty(jj) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*fextz(jj) )*usdij2
+
+ pfsx = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ pfsy = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ pfsz = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) +pfsx
+ by(jj) = by(jj) +pfsy
+ bz(jj) = bz(jj) +pfsz
+ enddo
+
+ endif
+
+
+! ET COMPLEMENT POUR LE VOISINAGE ETENDU
+! ON SUPPOSE QUE LE MILIEU DU SEGMENT JOIGNANT LES CENTRES
+! PEUT REMPLACER LE CENTRE DE GRAVITE DE LA FACE FICTIVE
+
+! LA REECRITURE COMPLEXE DE LA BOUCLE EST DESTINEE A DIVISER LE CPU
+! TOTAL SUR VPP PAR 5. POUR CELA, ON UTILISE DPDX DPDY DPDZ COMME
+! TABLEAUX DE TRAVAIL LOCAUX
+! SI ON TOMBAIT SUR UN CAS PATHOLOGIQUES DANS LEQUEL NCEL < NOMBRE
+! DE CELLULES DU VOISINAGE ETENDU D'UNE CELLULE (AVEC PERIODICITE
+! MULTIPLE ET PEU DE MAILLES ???) ON FAIT UN TEST ET ON CONSERVE
+! LA BOUCLE INITIALE. ON AJOUTE CEPENDAT UN IF QUI PERMET SUR VPP
+! DE REDUIRE LE TEMPS CALCUL D'UN FACTEUR 4 SI LA BOUCLE N'EST PAS
+! SCINDEE EN DEUX.
+
+ if (imrgra.eq.2.or.imrgra.eq.3) then
+
+! ON REGARDE SI NCEL >= NBRE DE VOISINS ETENDUS D'UNE CELLULE
+ if (icesve.lt.0) then
+ invemx = 0
+ do ii = 1, ncel
+ invemx = max(invemx,ipcvse(ii+1)-ipcvse(ii))
+ enddo
+ if (ncel.ge.invemx) then
+ icesve = 1
+ else
+ icesve = 0
+ endif
+ endif
+
+ if (icesve.gt.0) then
+
+ do ii = 1, ncel
+ do ipos = ipcvse(ii), ipcvse(ii+1)-1
+ jj = ielvse(ipos)
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ ptmidx = 0.5d0*(xyzcen(1,jj)+xyzcen(1,ii))
+ ptmidy = 0.5d0*(xyzcen(2,jj)+xyzcen(2,ii))
+ ptmidz = 0.5d0*(xyzcen(3,jj)+xyzcen(3,ii))
+ vecfac = ( pvar(jj)-pvar(ii) &
+ +(xyzcen(1,ii)-ptmidx)*fextx(ii) &
+ +(xyzcen(2,ii)-ptmidy)*fexty(ii) &
+ +(xyzcen(3,ii)-ptmidz)*fextz(ii) &
+ -(xyzcen(1,jj)-ptmidx)*fextx(jj) &
+ -(xyzcen(2,jj)-ptmidy)*fexty(jj) &
+ -(xyzcen(3,jj)-ptmidz)*fextz(jj) )*usdij2
+
+ iiii = ipos-ipcvse(ii)+1
+ dpdx(iiii) = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ dpdy(iiii) = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ dpdz(iiii) = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ enddo
+ do ipos = ipcvse(ii), ipcvse(ii+1)-1
+ iiii = ipos-ipcvse(ii)+1
+ bx(ii) = bx(ii) +dpdx(iiii)
+ by(ii) = by(ii) +dpdy(iiii)
+ bz(ii) = bz(ii) +dpdz(iiii)
+ enddo
+ enddo
+
+ else
+
+ do ii = 1, ncel
+ if(ipcvse(ii+1).gt.ipcvse(ii)) then
+ do ipos = ipcvse(ii), ipcvse(ii+1)-1
+ jj = ielvse(ipos)
+ usdij2 = 1.d0/( ( xyzcen(1,jj)-xyzcen(1,ii) )**2 &
+ +( xyzcen(2,jj)-xyzcen(2,ii) )**2 &
+ +( xyzcen(3,jj)-xyzcen(3,ii) )**2 )
+ ptmidx = 0.5d0*(xyzcen(1,jj)+xyzcen(1,ii))
+ ptmidy = 0.5d0*(xyzcen(2,jj)+xyzcen(2,ii))
+ ptmidz = 0.5d0*(xyzcen(3,jj)+xyzcen(3,ii))
+ vecfac = ( pvar(jj)-pvar(ii) &
+ +(xyzcen(1,ii)-ptmidx)*fextx(ii) &
+ +(xyzcen(2,ii)-ptmidy)*fexty(ii) &
+ +(xyzcen(3,ii)-ptmidz)*fextz(ii) &
+ -(xyzcen(1,jj)-ptmidx)*fextx(jj) &
+ -(xyzcen(2,jj)-ptmidy)*fexty(jj) &
+ -(xyzcen(3,jj)-ptmidz)*fextz(jj) )*usdij2
+
+ pfsx = ( xyzcen(1,jj)-xyzcen(1,ii) )*vecfac
+ pfsy = ( xyzcen(2,jj)-xyzcen(2,ii) )*vecfac
+ pfsz = ( xyzcen(3,jj)-xyzcen(3,ii) )*vecfac
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ enddo
+ endif
+ enddo
+
+ endif
+
+ endif
+
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+! NOTER QUE EXTRAB NE DOIT PRENDRE QUE LES VALEURS 0 OU 1
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = (1.d0-isympa(ifac)*extrap*coefbp(ifac))**2
+ unsdij = 1.d0/distbr(ifac)
+ unssbn = 1.d0/surfbn(ifac)
+ umcbsd = (1.d0-coefbp(ifac))*unsdij
+
+ dsij(1) = surfbo(1,ifac)*unssbn + umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn + umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn + umcbsd*diipb(3,ifac)
+ rkij = ( inc*coefap(ifac) &
+ +(coefbp(ifac)-1.d0)*pvar(ii) )*unsdij &
+ +(coefbp(ifac)-1.d0)*unsdij*( &
+ (cdgfbo(1,ifac)-xyzcen(1,ii))*fextx(ii) &
+ +(cdgfbo(2,ifac)-xyzcen(2,ii))*fexty(ii) &
+ +(cdgfbo(3,ifac)-xyzcen(3,ii))*fextz(ii) )
+ rkij = rkij*extrab
+
+ bx(ii) = bx(ii) +dsij(1)*rkij
+ by(ii) = by(ii) +dsij(2)*rkij
+ bz(ii) = bz(ii) +dsij(3)*rkij
+
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+
+ ii = ifabor(ifac)
+
+ extrab = (1.d0-isympa(ifac)*extrap*coefbp(ifac))**2
+ unsdij = 1.d0/distbr(ifac)
+ unssbn = 1.d0/surfbn(ifac)
+ umcbsd = (1.d0-coefbp(ifac))*unsdij
+
+ dsij(1) = surfbo(1,ifac)*unssbn + umcbsd*diipb(1,ifac)
+ dsij(2) = surfbo(2,ifac)*unssbn + umcbsd*diipb(2,ifac)
+ dsij(3) = surfbo(3,ifac)*unssbn + umcbsd*diipb(3,ifac)
+ rkij = ( inc*coefap(ifac) &
+ +(coefbp(ifac)-1.d0)*pvar(ii) )*unsdij &
+ +(coefbp(ifac)-1.d0)*unsdij*( &
+ (cdgfbo(1,ifac)-xyzcen(1,ii))*fextx(ii) &
+ +(cdgfbo(2,ifac)-xyzcen(2,ii))*fexty(ii) &
+ +(cdgfbo(3,ifac)-xyzcen(3,ii))*fextz(ii) )
+ rkij = rkij*extrab
+
+ bx(ii) = bx(ii) +dsij(1)*rkij
+ by(ii) = by(ii) +dsij(2)*rkij
+ bz(ii) = bz(ii) +dsij(3)*rkij
+
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 4. RESOLUTION
+!===============================================================================
+
+
+do iel = 1, ncel
+ dpdx(iel) = cocg(iel,1,1)*bx(iel)+cocg(iel,1,2)*by(iel) &
+ +cocg(iel,1,3)*bz(iel)
+ dpdy(iel) = cocg(iel,2,1)*bx(iel)+cocg(iel,2,2)*by(iel) &
+ +cocg(iel,2,3)*bz(iel)
+ dpdz(iel) = cocg(iel,3,1)*bx(iel)+cocg(iel,3,2)*by(iel) &
+ +cocg(iel,3,3)*bz(iel)
+enddo
+
+! AJOUT DE LA COMPOSANTE HYDROSTATIQUE
+if (iphydp.eq.1) then
+ do iel = 1, ncel
+ dpdx(iel) = dpdx(iel) + fextx(iel)
+ dpdy(iel) = dpdy(iel) + fexty(iel)
+ dpdz(iel) = dpdz(iel) + fextz(iel)
+ enddo
+endif
+
+! TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (dpdx)
+ !==========
+ call parcom (dpdy)
+ !==========
+ call parcom (dpdz)
+ !==========
+ endif
+
+! TRAITEMENT DE LA PERIODICITE
+
+ if(iperio.eq.1) then
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dpdx , dpdx , dpdx , &
+ dpdy , dpdy , dpdy , &
+ dpdz , dpdz , dpdz )
+ endif
+
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/gradrc.f90 b/src/base/gradrc.f90
new file mode 100644
index 0000000..55a7ccc
--- /dev/null
+++ b/src/base/gradrc.f90
@@ -0,0 +1,1068 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine gradrc &
+!================
+
+ ( ncelet , ncel , nfac , nfabor , ncelbr , &
+ imrgra , inc , iccocg , nswrgp , idimte , itenso , iphydp , &
+ iwarnp , nfecra , epsrgp , extrap , &
+ ifacel , ifabor , icelbr , ivar , &
+ volume , surfac , surfbo , pond , xyzcen , cdgfac , cdgfbo , &
+ dijpf , diipb , dofij , fextx , fexty , fextz , &
+ coefap , coefbp , pvar , &
+ cocgb , cocg , &
+ dpdx , dpdy , dpdz , &
+ bx , by , bz )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DU GRADIENT D'UNE VARIABLE AVEC UNE TECHNIQUE IERATIVE
+! DE RECONSTRUCTION POUR LES MAILLAGES NON ORTHOGONAUX (NSWRGP>1)
+! AVEC PRISE EN COMPTE EVENTUELLE D'UN TERME DE FORCE VOLUMIQUE
+! GENERANT UNE COMPOSANTE DE PRESSION HYDROSTATIQUE
+
+! CALCUL DE COCG POUR PRENDRE EN COMPTE LES C.L VARIABLES (FLUX)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins !
+! ! ! ! face de bord !
+! imrgra ! e ! <-- ! methode de calcul du gradient !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! idimte ! e ! <-- ! dimension de la varible (maximum 3) !
+! ! ! ! 0 : scalaire (var11) ou assimile !
+! ! ! ! scalaire !
+! ! ! ! 1 : vecteur (var11,var22,var33) !
+! ! ! ! 2 : tenseur d'ordre 2 (varij) !
+! itenso ! e ! <-- ! pour l'explicitation de la rotation !
+! ! ! ! 0 : scalaire (var11) !
+! ! ! ! 1 : composante de vecteur ou de !
+! ! ! ! tenseur (var11) implcite pour la !
+! ! ! ! translation !
+! ! ! !11 : reprend le traitement itenso=1 et !
+! ! ! ! composante de vecteur ou de !
+! ! ! ! tenseur (var11) annulee pour la !
+! ! ! ! rotation !
+! ! ! ! 2 : vecteur (var11 et var22 et var33) !
+! ! ! ! implicite pour la translation !
+! ivar ! e ! <-- ! indicateur du numero de la variable !
+! ! ! ! (ou 0 si variable non resolue) !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! iphydp ! e ! <-- ! indicateur de prise en compte de la !
+! ! ! ! pression hydrostatique !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! extrap ! r ! <-- ! coef extrap gradient !
+! ifacel(2,nfac ! te ! <-- ! no des elts voisins d'une face intern !
+! ifabor(nfabor ! te ! <-- ! no de l'elt voisin d'une face de bord !
+! icelbr ! te ! <-- ! numero global des elements ayant au !
+! (ncelbr) ! ! ! moins une face de bord !
+! volume(ncelet ! tr ! <-- ! volume des elements !
+! surfac(3,nfac ! tr ! <-- ! surf vectorielle des surfaces interne !
+! surfbo ! tr ! <-- ! surf vectorielle des surfaces de bord !
+! (3,nfabor) ! ! ! !
+! pond(nfac) ! tr ! <-- ! ponderation geometrique (entre 0 et 1 !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (3,ncelet ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (3,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (3,nfabor) ! ! ! !
+! dijpf(3,nfac) ! tr ! <-- ! vect i'j', i' (resp. j') projection !
+! ! ! ! du centre i (resp. j) sur la normale !
+! ! ! ! a la face interne !
+! diipb ! tr ! <-- ! vect ii', ii projection du centre i !
+! (3,nfabor) ! ! ! sur la normale a la face de bord !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour pvar !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! pvar (ncelet ! tr ! <-- ! variable !
+! fextx,y,z ! tr ! <-- ! force exterieure generant la pression !
+! (ncelet) ! ! ! hydrostatique !
+! cocgb ! tr ! <-- ! contribution des faces internes a !
+! (ncelbr,3,3) ! ! ! cocg pour les cellules de bord !
+! cocg(ncelet,3 ! tr ! <-- ! couplage des composantes du gradient !
+! ,3) ! ! ! lors de la reconstruction !
+! dpdx dpdy ! tr ! <-- ! gradient de pvar !
+! dpdz (ncelet ! tr ! ! (halo rempli pour la periodicite) !
+! bx,y,z(ncelet ! tr ! --- ! tableau de travail pour le grad de p !
+! dofij ! tr ! --> ! vecteur of pour les faces internes !
+! (ndim,nfac ) ! ! ! o : intersection de ij et la face !
+! ! ! ! f : centre de la face !
+! ra(*) ! tr ! --- ! tableau de travail pour les reels !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstphy.h"
+include "cstnum.h"
+include "vector.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel , nfac , nfabor , ncelbr
+integer imrgra , inc , iccocg , nswrgp
+integer ivar , idimte , itenso , iphydp
+integer iwarnp , nfecra
+double precision epsrgp , extrap
+
+integer ifacel(2,nfac),ifabor(nfabor)
+integer icelbr(ncelbr)
+double precision volume(ncelet), surfac(3,nfac)
+double precision surfbo(3,nfabor)
+double precision pond(nfac)
+double precision xyzcen(3,ncelet)
+double precision cdgfac(3,nfac),cdgfbo(3,nfabor)
+double precision dijpf(3,nfac), diipb(3,nfabor)
+double precision coefap(nfabor), coefbp(nfabor), pvar(ncelet)
+double precision cocgb(ncelbr,3,3), cocg(ncelet,3,3)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision bx (ncelet),by (ncelet),bz (ncelet)
+double precision fextx(ncelet),fexty(ncelet),fextz(ncelet)
+double precision dofij(3,nfac)
+
+! VARIABLES LOCALES
+
+integer lbloc
+parameter (lbloc = 1024)
+integer iel, ifac, ii, jj, kk, ll, mm
+integer isqrt, isweep, nswmax
+integer ibloc,nbloc,irel
+double precision pfac,pip,deltpx,deltpy,deltpz
+double precision rnorx,rnory,rnorz,rnorm,residu
+double precision pfaci
+double precision dof,fmoyx,fmoyy,fmoyz
+double precision aa(lbloc,3,3),unsdet,pfsx,pfsy,pfsz
+double precision a11,a12,a13,a21,a22,a23,a31,a32,a33
+double precision cocg11,cocg12,cocg13,cocg21,cocg22,cocg23
+double precision cocg31,cocg32,cocg33
+double precision pfac1, pfac2, pfac3, unsvol, vecfac
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+isqrt = 1
+nswmax = nswrgp
+isweep = 1
+
+
+!===============================================================================
+! 2. CALCUL SANS RECONSTRUCTION
+!===============================================================================
+
+! SI INITIALISATION PAR MOINDRES CARRES (IMRGRA=4), B EST DEJA REMPLI
+! SINON (IMRGRA=0) ON CALCULE UN GRADIENT SANS RECONSTRUCTION
+
+if (imrgra.eq.0) then
+
+ do iel = 1, ncelet
+ bx (iel) = 0.d0
+ by (iel) = 0.d0
+ bz (iel) = 0.d0
+ enddo
+
+! CAS STANDARD, SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! ===============================================================
+ if (iphydp.eq.0) then
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*pvar(ii) +(1.d0-pond(ifac))*pvar(jj)
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*pvar(ii) +(1.d0-pond(ifac))*pvar(jj)
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ endif
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pvar(ii)
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pvar(ii)
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ endif
+
+! CAS AVEC PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! =====================================================
+ else
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfac(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfac(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfac(3,ifac))*fextz(ii)) &
+ +(1.d0-pond(ifac))*(pvar(jj) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*fextx(jj) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*fexty(jj) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*fextz(jj))
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfac = pond(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfac(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfac(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfac(3,ifac))*fextz(ii)) &
+ +(1.d0-pond(ifac))*(pvar(jj) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*fextx(jj) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*fexty(jj) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*fextz(jj))
+ pfac1 = pfac*surfac(1,ifac)
+ pfac2 = pfac*surfac(2,ifac)
+ pfac3 = pfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfac1
+ by(ii) = by(ii) +pfac2
+ bz(ii) = bz(ii) +pfac3
+ bx(jj) = bx(jj) -pfac1
+ by(jj) = by(jj) -pfac2
+ bz(jj) = bz(jj) -pfac3
+ enddo
+
+ endif
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfbo(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfbo(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfbo(3,ifac))*fextz(ii) )
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfbo(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfbo(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfbo(3,ifac))*fextz(ii) )
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ endif
+
+ endif
+
+! DPDX,DPDY,DPDZ = GRADIENT
+
+ do iel = 1, ncel
+ unsvol = 1.d0/volume(iel)
+ dpdx(iel) = bx(iel)*unsvol
+ dpdy(iel) = by(iel)*unsvol
+ dpdz(iel) = bz(iel)*unsvol
+ enddo
+
+! TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (dpdx)
+ !==========
+ call parcom (dpdy)
+ !==========
+ call parcom (dpdz)
+ !==========
+ endif
+
+! TRAITEMENT DE LA PERIODICITE
+
+ if(iperio.eq.1) then
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dpdx , dpdx , dpdx , &
+ dpdy , dpdy , dpdy , &
+ dpdz , dpdz , dpdz )
+ endif
+
+endif
+
+if( nswrgp.le.1 ) return
+
+
+! On incremente IPASS quand on calcule COCG pour la premiere fois
+ipass = ipass + 1
+
+!===============================================================================
+! 3. RECONSTRUCTION DES GRADIENTS POUR LES MAILLAGES TORDUS
+!===============================================================================
+
+! RESOLUTION SEMI-IMPLICITE SUR TOUT LE MAILLAGE
+! DPDX,DY,DZ = GRADIENT
+
+if(ipass.eq.1 .or. iale.eq.1) then
+
+! ---> CALCUL DE COCG
+
+ do ii = 1, 3
+ do jj = 1, 3
+ do iel =1,ncelet
+ cocg(iel,ii,jj) = 0.d0
+ enddo
+ enddo
+ enddo
+ do iel=1,ncel
+ cocg(iel,1,1) = volume(iel)
+ cocg(iel,2,2) = volume(iel)
+ cocg(iel,3,3) = volume(iel)
+ enddo
+
+! ---> AJOUT DES CONTRIBUTIONS DES FACES INTERNES
+ do ll =1,3
+ do mm =1,3
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac=1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+!---> DOF = OF
+ dof = dofij(mm,ifac)
+
+ pfaci = -dof*0.5d0
+ vecfac = pfaci*surfac(ll,ifac)
+ cocg(ii,ll,mm) = cocg(ii,ll,mm) + vecfac
+ cocg(jj,ll,mm) = cocg(jj,ll,mm) - vecfac
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac=1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+!---> DOF = OF
+ dof = dofij(mm,ifac)
+
+ pfaci = -dof*0.5d0
+ vecfac = pfaci*surfac(ll,ifac)
+ cocg(ii,ll,mm) = cocg(ii,ll,mm) + vecfac
+ cocg(jj,ll,mm) = cocg(jj,ll,mm) - vecfac
+ enddo
+
+ endif
+
+ enddo
+ enddo
+
+! ---> SAUVEGADE DU COCG PARTIEL AUX FACES INTERNES DES CELLULES DE BORD
+ do ii = 1, ncelbr
+ iel = icelbr(ii)
+ do ll = 1, 3
+ do mm = 1, 3
+ cocgb(ii,ll,mm) = cocg(iel,ll,mm)
+ enddo
+ enddo
+ enddo
+
+! ---> AJOUT DES CONTRIBUTIONS DES FACES DE BORD
+ do ll =1,3
+ do mm =1,3
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac=1,nfabor
+ ii = ifabor(ifac)
+ cocg(ii,ll,mm) = cocg(ii,ll,mm) &
+ - coefbp(ifac)*diipb(mm,ifac)*surfbo(ll,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac=1,nfabor
+ ii = ifabor(ifac)
+ cocg(ii,ll,mm) = cocg(ii,ll,mm) &
+ - coefbp(ifac)*diipb(mm,ifac)*surfbo(ll,ifac)
+ enddo
+
+ endif
+
+ enddo
+ enddo
+
+! ---> ON INVERSE POUR TOUTE LES CELLULES : LE COCG POUR LES CELLULES INTERNES
+! RESTE ENSUITE LE MEME TANT QUE LE MAILLAGE NE CHANGE PAS
+ nbloc = ncel/lbloc
+ if (nbloc.gt.0) then
+ do ibloc = 1, nbloc
+ do ii =1, lbloc
+ iel = (ibloc-1)*lbloc+ii
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a21=cocg31*cocg23-cocg21*cocg33
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a31=cocg21*cocg32-cocg31*cocg22
+ a32=cocg31*cocg12-cocg11*cocg32
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11 +cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11*unsdet
+ aa(ii,1,2) = a12*unsdet
+ aa(ii,1,3) = a13*unsdet
+ aa(ii,2,1) = a21*unsdet
+ aa(ii,2,2) = a22*unsdet
+ aa(ii,2,3) = a23*unsdet
+ aa(ii,3,1) = a31*unsdet
+ aa(ii,3,2) = a32*unsdet
+ aa(ii,3,3) = a33*unsdet
+
+ enddo
+
+ do ii = 1, lbloc
+ iel = (ibloc-1)*lbloc+ii
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,1) = aa(ii,2,1)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,1) = aa(ii,3,1)
+ cocg(iel,3,2) = aa(ii,3,2)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+
+ enddo
+
+ endif
+
+ irel = mod(ncel,lbloc)
+ if (irel.gt.0) then
+ ibloc = nbloc + 1
+ do ii = 1, irel
+ iel = (ibloc-1)*lbloc+ii
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a21=cocg31*cocg23-cocg21*cocg33
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a31=cocg21*cocg32-cocg31*cocg22
+ a32=cocg31*cocg12-cocg11*cocg32
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11 +cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11*unsdet
+ aa(ii,1,2) = a12*unsdet
+ aa(ii,1,3) = a13*unsdet
+ aa(ii,2,1) = a21*unsdet
+ aa(ii,2,2) = a22*unsdet
+ aa(ii,2,3) = a23*unsdet
+ aa(ii,3,1) = a31*unsdet
+ aa(ii,3,2) = a32*unsdet
+ aa(ii,3,3) = a33*unsdet
+
+ enddo
+
+ do ii = 1, irel
+ iel = (ibloc-1)*lbloc+ii
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,1) = aa(ii,2,1)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,1) = aa(ii,3,1)
+ cocg(iel,3,2) = aa(ii,3,2)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+
+ endif
+
+endif
+
+! ---> SI ON DOIT RECALCULER COCG ENSUITE, ON NE LE FAIT PLUS
+! QUE POUR LES CELLULES DE BORD, AVEC LE COCGB STOCKE
+
+if(iccocg.eq.1 .and. ipass.gt.1 .and. iale.eq.0) then
+
+ do ll =1,3
+ do mm =1,3
+
+ do kk = 1, ncelbr
+ iel = icelbr(kk)
+ cocg(iel,ll,mm) = cocgb(kk,ll,mm)
+ enddo
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac=1,nfabor
+ ii = ifabor(ifac)
+ cocg(ii,ll,mm) = cocg(ii,ll,mm) &
+ - coefbp(ifac)*diipb(mm,ifac)*surfbo(ll,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac=1,nfabor
+ ii = ifabor(ifac)
+ cocg(ii,ll,mm) = cocg(ii,ll,mm) &
+ - coefbp(ifac)*diipb(mm,ifac)*surfbo(ll,ifac)
+ enddo
+
+ endif
+
+ enddo
+ enddo
+
+ do ii = 1, ncelbr
+
+ iel = icelbr(ii)
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a21=cocg31*cocg23-cocg21*cocg33
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a31=cocg21*cocg32-cocg31*cocg22
+ a32=cocg31*cocg12-cocg11*cocg32
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11 +cocg21*a12+cocg31*a13)
+
+ a11 = a11*unsdet
+ a12 = a12*unsdet
+ a13 = a13*unsdet
+ a21 = a21*unsdet
+ a22 = a22*unsdet
+ a23 = a23*unsdet
+ a31 = a31*unsdet
+ a32 = a32*unsdet
+ a33 = a33*unsdet
+
+ cocg(iel,1,1) = a11
+ cocg(iel,1,2) = a12
+ cocg(iel,1,3) = a13
+ cocg(iel,2,1) = a21
+ cocg(iel,2,2) = a22
+ cocg(iel,2,3) = a23
+ cocg(iel,3,1) = a31
+ cocg(iel,3,2) = a32
+ cocg(iel,3,3) = a33
+ enddo
+
+endif
+
+! ---> CALCUL DU RESIDU DE NORMALISATION
+
+call prods3(ncelet,ncel,isqrt,bx,bx,by,by,bz,bz, &
+ rnorx,rnory,rnorz)
+rnorm = rnorx +rnory +rnorz
+if (volmax.gt.1.d0) rnorm = rnorm / volmax
+if( rnorm.le.epzero ) return
+
+! LE VECTEUR OijFij EST CALCULE DANS CLDIJP
+
+! ---> DEBUT DES ITERATIONS
+
+ 100 continue
+
+isweep = isweep +1
+
+
+! CALCUL DU SECOND MEMBRE
+
+do iel = 1, ncel
+ bx(iel) = -dpdx(iel)*volume(iel)
+ by(iel) = -dpdy(iel)*volume(iel)
+ bz(iel) = -dpdz(iel)*volume(iel)
+enddo
+
+! CAS STANDARD, SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! ===============================================================
+if (iphydp.eq.0) then
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vecfac = pond(ifac)*pvar(ii) +(1.d0-pond(ifac))*pvar(jj) &
+ +(dofij(1,ifac)*(dpdx(ii)+dpdx(jj)) &
+ + dofij(2,ifac)*(dpdy(ii)+dpdy(jj)) &
+ + dofij(3,ifac)*(dpdz(ii)+dpdz(jj)))*0.5d0
+ pfsx = vecfac*surfac(1,ifac)
+ pfsy = vecfac*surfac(2,ifac)
+ pfsz = vecfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) -pfsx
+ by(jj) = by(jj) -pfsy
+ bz(jj) = bz(jj) -pfsz
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vecfac = pond(ifac)*pvar(ii) +(1.d0-pond(ifac))*pvar(jj) &
+ +(dofij(1,ifac)*(dpdx(ii)+dpdx(jj)) &
+ + dofij(2,ifac)*(dpdy(ii)+dpdy(jj)) &
+ + dofij(3,ifac)*(dpdz(ii)+dpdz(jj)))*0.5d0
+ pfsx = vecfac*surfac(1,ifac)
+ pfsy = vecfac*surfac(2,ifac)
+ pfsz = vecfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) -pfsx
+ by(jj) = by(jj) -pfsy
+ bz(jj) = bz(jj) -pfsz
+ enddo
+
+ endif
+
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pip = pvar(ii) &
+ +diipb(1,ifac)*dpdx(ii) +diipb(2,ifac)*dpdy(ii) &
+ +diipb(3,ifac)*dpdz(ii)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfac1= pvar(ii) +(cdgfbo(1,ifac)-xyzcen(1,ii))*dpdx(ii) &
+ +(cdgfbo(2,ifac)-xyzcen(2,ii))*dpdy(ii) &
+ +(cdgfbo(3,ifac)-xyzcen(3,ii))*dpdz(ii)
+ pfac = coefbp(ifac)*(extrap*pfac1 +(1.d0-extrap)*pfac) &
+ +(1.d0-coefbp(ifac))*pfac
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pip = pvar(ii) &
+ +diipb(1,ifac)*dpdx(ii) +diipb(2,ifac)*dpdy(ii) &
+ +diipb(3,ifac)*dpdz(ii)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfac1= pvar(ii) +(cdgfbo(1,ifac)-xyzcen(1,ii))*dpdx(ii) &
+ +(cdgfbo(2,ifac)-xyzcen(2,ii))*dpdy(ii) &
+ +(cdgfbo(3,ifac)-xyzcen(3,ii))*dpdz(ii)
+ pfac = coefbp(ifac)*(extrap*pfac1 +(1.d0-extrap)*pfac) &
+ +(1.d0-coefbp(ifac))*pfac
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ endif
+
+! CAS AVEC PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+! =====================================================
+else
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ fmoyx=0.5d0*(fextx(ii)+fextx(jj))
+ fmoyy=0.5d0*(fexty(ii)+fexty(jj))
+ fmoyz=0.5d0*(fextz(ii)+fextz(jj))
+ vecfac = pond(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfac(1,ifac))*(fextx(ii)-fmoyx) &
+ -(xyzcen(2,ii)-cdgfac(2,ifac))*(fexty(ii)-fmoyy) &
+ -(xyzcen(3,ii)-cdgfac(3,ifac))*(fextz(ii)-fmoyz)) &
+ +(1.d0-pond(ifac))*(pvar(jj) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*(fextx(jj)-fmoyx) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*(fexty(jj)-fmoyy) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*(fextz(jj)-fmoyz)) &
+ +(dofij(1,ifac)*(dpdx(ii)+dpdx(jj)) &
+ + dofij(2,ifac)*(dpdy(ii)+dpdy(jj)) &
+ + dofij(3,ifac)*(dpdz(ii)+dpdz(jj)))*0.5d0
+ pfsx = vecfac*surfac(1,ifac)
+ pfsy = vecfac*surfac(2,ifac)
+ pfsz = vecfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) -pfsx
+ by(jj) = by(jj) -pfsy
+ bz(jj) = bz(jj) -pfsz
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ fmoyx=0.5d0*(fextx(ii)+fextx(jj))
+ fmoyy=0.5d0*(fexty(ii)+fexty(jj))
+ fmoyz=0.5d0*(fextz(ii)+fextz(jj))
+ vecfac = pond(ifac)*(pvar(ii) &
+ -(xyzcen(1,ii)-cdgfac(1,ifac))*(fextx(ii)-fmoyx) &
+ -(xyzcen(2,ii)-cdgfac(2,ifac))*(fexty(ii)-fmoyy) &
+ -(xyzcen(3,ii)-cdgfac(3,ifac))*(fextz(ii)-fmoyz)) &
+ +(1.d0-pond(ifac))*(pvar(jj) &
+ -(xyzcen(1,jj)-cdgfac(1,ifac))*(fextx(jj)-fmoyx) &
+ -(xyzcen(2,jj)-cdgfac(2,ifac))*(fexty(jj)-fmoyy) &
+ -(xyzcen(3,jj)-cdgfac(3,ifac))*(fextz(jj)-fmoyz)) &
+ +(dofij(1,ifac)*(dpdx(ii)+dpdx(jj)) &
+ + dofij(2,ifac)*(dpdy(ii)+dpdy(jj)) &
+ + dofij(3,ifac)*(dpdz(ii)+dpdz(jj)))*0.5d0
+ pfsx = vecfac*surfac(1,ifac)
+ pfsy = vecfac*surfac(2,ifac)
+ pfsz = vecfac*surfac(3,ifac)
+ bx(ii) = bx(ii) +pfsx
+ by(ii) = by(ii) +pfsy
+ bz(ii) = bz(ii) +pfsz
+ bx(jj) = bx(jj) -pfsx
+ by(jj) = by(jj) -pfsy
+ bz(jj) = bz(jj) -pfsz
+ enddo
+
+ endif
+
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pip = pvar(ii) &
+ +diipb(1,ifac)*dpdx(ii) +diipb(2,ifac)*dpdy(ii) &
+ +diipb(3,ifac)*dpdz(ii)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*(pip &
+ -(xyzcen(1,ii)-cdgfbo(1,ifac)+diipb(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfbo(2,ifac)+diipb(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfbo(3,ifac)+diipb(3,ifac))*fextz(ii))
+ pfac1= pvar(ii) +(cdgfbo(1,ifac)-xyzcen(1,ii))*dpdx(ii) &
+ +(cdgfbo(2,ifac)-xyzcen(2,ii))*dpdy(ii) &
+ +(cdgfbo(3,ifac)-xyzcen(3,ii))*dpdz(ii)
+ pfac = coefbp(ifac)*(extrap*pfac1 +(1.d0-extrap)*pfac) &
+ +(1.d0-coefbp(ifac))*pfac
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ pip = pvar(ii) &
+ +diipb(1,ifac)*dpdx(ii) +diipb(2,ifac)*dpdy(ii) &
+ +diipb(3,ifac)*dpdz(ii)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*(pip &
+ -(xyzcen(1,ii)-cdgfbo(1,ifac)+diipb(1,ifac))*fextx(ii) &
+ -(xyzcen(2,ii)-cdgfbo(2,ifac)+diipb(2,ifac))*fexty(ii) &
+ -(xyzcen(3,ii)-cdgfbo(3,ifac)+diipb(3,ifac))*fextz(ii))
+ pfac1= pvar(ii) +(cdgfbo(1,ifac)-xyzcen(1,ii))*dpdx(ii) &
+ +(cdgfbo(2,ifac)-xyzcen(2,ii))*dpdy(ii) &
+ +(cdgfbo(3,ifac)-xyzcen(3,ii))*dpdz(ii)
+ pfac = coefbp(ifac)*(extrap*pfac1 +(1.d0-extrap)*pfac) &
+ +(1.d0-coefbp(ifac))*pfac
+ bx(ii) = bx(ii) +pfac*surfbo(1,ifac)
+ by(ii) = by(ii) +pfac*surfbo(2,ifac)
+ bz(ii) = bz(ii) +pfac*surfbo(3,ifac)
+ enddo
+
+ endif
+
+endif
+
+! INCREMENTATION DU GRADIENT
+
+do iel =1,ncel
+
+ deltpx = &
+ cocg(iel,1,1)*bx(iel)+cocg(iel,1,2)*by(iel)+cocg(iel,1,3)*bz(iel)
+ deltpy = &
+ cocg(iel,2,1)*bx(iel)+cocg(iel,2,2)*by(iel)+cocg(iel,2,3)*bz(iel)
+ deltpz = &
+ cocg(iel,3,1)*bx(iel)+cocg(iel,3,2)*by(iel)+cocg(iel,3,3)*bz(iel)
+
+ dpdx(iel) = dpdx(iel) +deltpx
+ dpdy(iel) = dpdy(iel) +deltpy
+ dpdz(iel) = dpdz(iel) +deltpz
+
+enddo
+
+
+! TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (dpdx)
+ !==========
+ call parcom (dpdy)
+ !==========
+ call parcom (dpdz)
+ !==========
+endif
+
+! TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dpdx , dpdx , dpdx , &
+ dpdy , dpdy , dpdy , &
+ dpdz , dpdz , dpdz )
+endif
+
+
+! ---> TEST DE CONVERGENCE
+
+call prods3(ncelet,ncel,isqrt,bx,bx,by,by,bz,bz, &
+ rnorx,rnory,rnorz)
+residu = rnorx +rnory +rnorz
+if (volmax.gt.1.d0) residu = residu / volmax
+
+if( residu.le.epsrgp*rnorm) then
+ if( iwarnp.ge.2 ) then
+ write (nfecra,1000) isweep,residu/rnorm,rnorm,ivar
+ endif
+ goto 101
+elseif( isweep.ge.nswmax ) then
+ if( iwarnp.ge.0) then
+ write (nfecra,1000)isweep,residu/rnorm,rnorm,ivar
+ write (nfecra,1100)
+ endif
+ goto 101
+else
+ goto 100
+endif
+
+ 101 continue
+
+
+
+!--------
+! FORMATS
+!--------
+#if defined(_CS_LANG_FR)
+
+ 1000 format(1X,'GRADRC ISWEEP = ',I4,' RESIDU NORME: ',E11.4, &
+ ' NORME: ',E11.4,/,1X,'PARAMETRE IVAR = ',I4 )
+ 1100 format( &
+'@ ',/,&
+'@ @@ ATTENTION : NON CONVERGENCE DE GRADRC ',/,&
+'@ ========= ',/,&
+'@ ' )
+
+#else
+
+ 1000 format(1X,'GRADRC ISWEEP = ',I4,' NORMED RESIDUAL: ',E11.4, &
+ ' NORM: ',E11.4,/,1X,'PARAMETER IVAR = ',I4 )
+ 1100 format( &
+'@' ,/,&
+'@ @@ WARNING: NON CONVERGENCE OF GRADRC' ,/,&
+'@ ========' ,/,&
+'@' )
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/grdcel.f90 b/src/base/grdcel.f90
new file mode 100644
index 0000000..e674131
--- /dev/null
+++ b/src/base/grdcel.f90
@@ -0,0 +1,366 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine grdcel &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ fextx , fexty , fextz , &
+ pvar , coefap , coefbp , &
+ dpdx , dpdy , dpdz , &
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! APPEL DES DIFFERENTES ROUTINES DE CALCUL DE GRADIENT CELLULE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de la variable !
+! ! ! ! destine a etre utilise pour la !
+! ! ! ! periodicite uniquement (pering) !
+! ! ! ! on pourra donner ivar=0 si la !
+! ! ! ! variable n'est ni une composante de !
+! ! ! ! la vitesse, ni une composante du !
+! ! ! ! tenseur des contraintes rij !
+! imrgra ! e ! <-- ! methode de reconstruction du gradient !
+! ! ! ! 0 reconstruction 97 !
+! ! ! ! 1 moindres carres !
+! ! ! ! 2 moindres carres support etendu !
+! ! ! ! complet !
+! ! ! ! 3 moindres carres avec selection du !
+! ! ! ! support etendu !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! iphydp ! e ! <-- ! indicateur de prise en compte de la !
+! ! ! ! pression hydrostatique !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! pvar (ncelet ! tr ! <-- ! variable (pression) !
+! coefap,coefbp ! tr ! <-- ! tableaux des cond lim pour pvar !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! fextx,y,z ! tr ! <-- ! force exterieure generant la pression !
+! (ncelet) ! ! ! hydrostatique !
+! dpdx,dpdy ! tr ! --> ! gradient de pvar !
+! dpdz (ncelet ! ! ! !
+! dpdxa (ncelet ! tr ! --- ! tableau de travail pour le grad de p !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , imrgra , inc , iccocg , nswrgp
+integer imligp ,iwarnp , iphydp , nfecra
+double precision epsrgp , climgp , extrap
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision fextx(ncelet),fexty(ncelet),fextz(ncelet)
+double precision pvar(ncelet), coefap(nfabor), coefbp(nfabor)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer idimte , itenso
+integer iiu(nphsmx),iiv(nphsmx),iiw(nphsmx)
+integer iitytu(nphsmx)
+integer iir11(nphsmx),iir22(nphsmx),iir33(nphsmx)
+integer iir12(nphsmx),iir13(nphsmx),iir23(nphsmx)
+integer imlini
+
+double precision climin
+
+!===============================================================================
+
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 0. PREPARATION POUR PERIODICITE DE ROTATION
+!===============================================================================
+
+! Par defaut, on traitera le gradient comme un vecteur ...
+! (i.e. on suppose que c'est le gradient d'une grandeurs scalaire)
+
+! S'il n'y a pas de rotation, les echanges d'informations seront
+! faits par percom (implicite)
+
+! S'il y a une ou des periodicites de rotation,
+! on determine si la variables est un vecteur (vitesse)
+! ou un tenseur (de Reynolds)
+! pour lui appliquer dans percom le traitement adequat.
+! On positionne IDIMTE et ITENSO
+! et on recupere le gradient qui convient.
+! Notons que si on n'a pas, auparavant, calcule et stocke les gradients
+! du halo on ne peut pas les recuperer ici (...).
+! Aussi ce sous programme est-il appele dans phyvar (dans perinu perinr)
+! pour calculer les gradients au debut du pas de temps et les stocker
+! dans DUDXYZ et DRDXYZ
+
+! Il est necessaire que ITENSO soit toujours initialise, meme hors
+! periodicite, donc on l'initialise au prealable a sa valeur par defaut.
+
+idimte = 1
+itenso = 0
+
+if(iperio.eq.1) then
+
+! On recupere d'abord certains pointeurs necessaires a PERING
+
+ call pergra &
+ !==========
+ ( nphsmx , nphas , &
+ iiu , iiv , iiw , &
+ iitytu , &
+ iir11 , iir22 , iir33 , iir12 , iir13 , iir23 )
+
+ call pering &
+ !==========
+ ( nphas , ivar , &
+ idimte , itenso , iperot , iguper , igrper , &
+ iiu , iiv , iiw , iitytu , &
+ iir11 , iir22 , iir33 , iir12 , iir13 , iir23 , &
+ dpdx , dpdy , dpdz , &
+ ra(idudxy) , ra(idrdxy) )
+endif
+
+!===============================================================================
+! 1. CALCUL DU GRADIENT
+!===============================================================================
+
+! CALCUL VOLUME FINIS PUIS ITERATIONS DE RECONSTRUCTION
+if (imrgra.eq.0) then
+
+ call gradrc &
+ !==========
+ ( ncelet , ncel , nfac , nfabor , ncelbr , &
+ imrgra , inc , iccocg , nswrgp , idimte , itenso , iphydp , &
+ iwarnp , nfecra , epsrgp , extrap , &
+ ifacel , ifabor , ia(iicelb) , ivar , &
+ volume , surfac , surfbo , ra(ipond), xyzcen , cdgfac , cdgfbo,&
+ ra(idijpf) , ra(idiipb) , ra(idofij) , fextx , fexty , fextz ,&
+ coefap , coefbp , pvar , &
+ ra(icocgb) , ra(icocg) , &
+ dpdx , dpdy , dpdz , &
+ dpdxa , dpdya , dpdza )
+
+! MOINDRES CARRES
+elseif(imrgra.eq.1.or.imrgra.eq.2.or.imrgra.eq.3) then
+
+ call cgrdmc &
+ !==========
+ ( ncelet , ncel , nfac , nfabor , ncelbr , &
+ inc , iccocg , nswrgp , idimte , itenso , iphydp , imrgra , &
+ iwarnp , nfecra , epsrgp , extrap , &
+ ifacel , ifabor , ia(iicelb) , ia(iisymp) , &
+ volume , surfac , surfbo , ra(isrfbn) , ra(ipond) , &
+ ra(idist) , ra(idistb) , &
+ ra(idijpf) , ra(idiipb) , &
+ fextx , fexty , fextz , &
+ xyzcen , cdgfac , cdgfbo , coefap , coefbp , pvar , &
+ ra(icocgb) , ra(icocg) , &
+ dpdx , dpdy , dpdz , &
+ dpdxa , dpdya , dpdza )
+
+! MOINDRES CARRES PUIS ITERATIONS DE RECONSTRUCTION
+elseif(imrgra.eq.4) then
+
+ call cgrdmc &
+ !==========
+ ( ncelet , ncel , nfac , nfabor , ncelbr , &
+ inc , iccocg , nswrgp , idimte , itenso , iphydp , imrgra , &
+ iwarnp , nfecra , epsrgp , extrap , &
+ ifacel , ifabor , ia(iicelb) , ia(iisymp) , &
+ volume , surfac , surfbo , ra(isrfbn) , ra(ipond) , &
+ ra(idist) , ra(idistb) , &
+ ra(idijpf) , ra(idiipb) , &
+ fextx , fexty , fextz , &
+ xyzcen , cdgfac , cdgfbo , coefap , coefbp , pvar , &
+ ra(icocgb) , ra(icocg) , &
+ dpdx , dpdy , dpdz , &
+ dpdxa , dpdya , dpdza )
+
+! on force la limitation de la solution initiale avec les options par defaut
+! pour toutes les variables, quel que soit le choix de l'utilisateur sur la
+! limitation du gradient final
+
+ imlini = 1
+ climin = 1.5d0
+
+ call clmgrd &
+ !==========
+ ( imrgra , imlini , iwarnp , itenso , climin , &
+ pvar , dpdx , dpdy , dpdz )
+
+ call gradrc &
+ !==========
+ ( ncelet , ncel , nfac , nfabor , ncelbr , &
+ imrgra , inc , iccocg , nswrgp , idimte , itenso , iphydp , &
+ iwarnp , nfecra , epsrgp , extrap , &
+ ifacel , ifabor , ia(iicelb) , ivar , &
+ volume , surfac , surfbo , ra(ipond), xyzcen , cdgfac , cdgfbo,&
+ ra(idijpf) , ra(idiipb) , ra(idofij) , fextx , fexty , fextz ,&
+ coefap , coefbp , pvar , &
+ ra(icocib) , ra(icoci) , &
+ dpdx , dpdy , dpdz , &
+ dpdxa , dpdya , dpdza )
+
+endif
+
+
+!===============================================================================
+! 2. LIMITATION DU GRADIENT (EVENTUELLE)
+!===============================================================================
+
+call clmgrd &
+!==========
+ ( imrgra , imligp , iwarnp , itenso , climgp , &
+ pvar , dpdx , dpdy , dpdz )
+
+
+return
+end
diff --git a/src/base/haltyp.f90 b/src/base/haltyp.f90
new file mode 100644
index 0000000..76ef68b
--- /dev/null
+++ b/src/base/haltyp.f90
@@ -0,0 +1,84 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine haltyp &
+!================
+
+ ( ivoset )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! TEST DE LA NECESSITE DU VOISINAGE ETENDU, POUR ENVOI AU C
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ivoset ! e ! <-- ! indicateur d'activation du vois. et. !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimens.h"
+include "paramx.h"
+include "cstphy.h"
+include "optcal.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+! Arguments
+
+integer ii, ivoset
+
+
+!===============================================================================
+
+ivoset = 0
+
+if (imrgra.eq.2 .or. imrgra.eq.3) ivoset = 1
+
+do ii = 1, nphsmx
+ if (iturb(ii).eq.41) ivoset = 1
+enddo
+
+if (ippmod(iaeros).ge.0) ivoset = 1
+
+return
+end
diff --git a/src/base/hturbp.f90 b/src/base/hturbp.f90
new file mode 100644
index 0000000..ebb4c7d
--- /dev/null
+++ b/src/base/hturbp.f90
@@ -0,0 +1,144 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine hturbp &
+!================
+
+ ( prl , prt , ckarm , yplus , htur )
+
+!===============================================================================
+
+! FONCTION :
+! --------
+! 1) CALCUL DU COEFFICIENT CORRECTEUR DU COEFFICIENT D'ECHANGE
+! ENTRE LE FLUIDE ET LA PAROI POUR UN ECOULEMENT TURBULENT
+! EN FONCTION DE LA DISTANCE ADIMENSIONELLE YPLUS = USTAR*DP/RNU
+! HTUR = PR*YPLUS/TPLUS
+
+
+! CE COEFFICIENT EST CALCULE A L'AIDE D'UN MODELE DE SIMILITUDE
+! ENTRE COUCHE LIMITE DYNAMIQUE ET COUCHE LIMITE THERMIQUE
+
+! LE TPLUS EST CALCULE :
+
+! - POUR UN NOMBRE DE PRANDTL << 0.1 (METAUX LIQUIDES) :
+! PAR LE MODELE STANDARD A DEUX COUCHES (PRANDTL-TAYLOR)
+
+! - POUR UN NOMBRE DE PRANDTL >> 0.1 (LIQUIDES et GAZ):
+! PAR UN MODELE A TROIS COUCHES (ARPACI-LARSEN)
+
+! -->> LE COEFFICIENT D'ECHANGE FINAL : H = (K/dp)*htur
+
+!-------------------------------------------------------------------------------
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! yplus ! r ! <-- ! distance a la paroi adimensionnelle !
+! ckarm ! r ! <-- ! constante de karman !
+! prt ! r ! <-- ! nombre de prandtl turbulent !
+! prl ! r ! <-- ! nombre de prandtl moleculaire !
+! htur ! r ! --> ! coefficient correcteur d'echange(adim !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+! Arguments
+
+double precision htur
+double precision prl,ckarm,prt,yplus
+
+! VARIABLES LOCALES
+
+double precision tplus
+double precision beta2,a2
+double precision yp0,yp1,yp2
+double precision prlm1
+
+!============================================================================
+
+! 1)INITIALISATIONS
+! -----------------
+
+htur = 1.d0
+
+prlm1 = 0.1d0
+
+yp0 = prt/(prl*ckarm)
+yp2 = ckarm*1000.d0/prt
+yp2 = sqrt(yp2)
+yp1 = (1000.d0/prl)**(1.d0/3.d0)
+
+! ====================================================
+! 2) CALCUL DU COEFFICIENT CORRECTEUR
+! POUR LES NOMBRES DE PRANDTL TRES PETITS
+! ====================================================
+if( prl .le. prlm1) then
+ if(yplus .gt. yp0) then
+ tplus = prl*yp0 + prt/ckarm * log(yplus/yp0)
+ htur = prl*yplus/tplus
+ endif
+
+endif
+
+
+! ====================================================
+! 3) CALCUL DU COEFFICIENT CORRECTEUR
+! POUR UN MODELE A TROIS COUCHES
+! ====================================================
+if( prl .gt. prlm1) then
+
+ a2 = 15.d0*(prl**(2.d0/3.d0))
+ beta2 = a2 - 500.d0/ (yp2**2)
+
+ if( (yplus .ge. yp1) .and. (yplus.lt.yp2) )then
+ tplus = a2 - 500.d0/(yplus*yplus)
+ htur = prl*yplus/tplus
+ endif
+
+ if( (yplus .ge. yp2) )then
+ tplus = beta2 + prt/ckarm*log(yplus/yp2)
+ htur = prl*yplus/tplus
+ endif
+
+endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/idrbla.f90 b/src/base/idrbla.f90
new file mode 100644
index 0000000..fb7922b
--- /dev/null
+++ b/src/base/idrbla.f90
@@ -0,0 +1,88 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ integer function idrbla &
+!================
+
+ ( chaine, lch )
+
+!==============================================================================
+
+! FONCTION :
+! --------
+
+! DETERMINER LA POSITION DU DERNIER CARACTERE NON BLANC DANS
+! CHAINE DE LONGUEUR LCH AVEC LA CONVENTION DE ZERO SI
+! LA CHAINE EST BLANCHE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! chaine ! e ! <-- ! chaine a verifier !
+! lch ! e ! <-- ! longueur de la chaine !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+! Arguments
+
+character chaine*(*)
+integer lch
+
+! VARIABLES LOCALES
+
+integer ii
+
+!===============================================================================
+
+!---------------
+! POSITIONNEMENT
+!---------------
+
+do 10 ii = lch, 1, -1
+ IF ( CHAINE (II:II) .NE. ' ' ) THEN
+ idrbla = ii
+ goto 20
+ endif
+ 10 continue
+idrbla = 0
+
+ 20 continue
+
+!-----
+! FIN
+!-----
+
+end
diff --git a/src/base/impini.f90 b/src/base/impini.f90
new file mode 100644
index 0000000..f969436
--- /dev/null
+++ b/src/base/impini.f90
@@ -0,0 +1,2975 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine impini
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! IMPRESSION DES PARAMETRES DE CALCUL APRES INTERVENTION
+! UTILISATEUR DANS usini1
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "albase.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+include "lagpar.h"
+include "lagdim.h"
+include "lagran.h"
+include "parall.h"
+include "mltgrd.h"
+
+!===============================================================================
+
+! Arguments
+
+
+! VARIABLES LOCALES
+
+character name*300, chaine*80
+integer iok20 , iok21 , iok30 , iok31 , iok50 , iok60
+integer ii , jj , ivar , iphas , iiesca, iest
+integer ipp , iwar , imom
+integer nbccou
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. INTRODUCTION
+!===============================================================================
+
+write(nfecra,1000)
+
+if (ippmod(icod3p).ne.-1) then
+ write(nfecra,1010)
+ write(nfecra,1020) ippmod(icod3p)
+ write(nfecra,1060) indjon
+else if (ippmod(icoebu).ne.-1) then
+ write(nfecra,1010)
+ write(nfecra,1030) ippmod(icoebu), cebu
+ write(nfecra,1060) indjon
+else if (ippmod(icp3pl).ne.-1) then
+ write(nfecra,1010)
+ write(nfecra,1040) ippmod(icp3pl)
+else if (ippmod(icfuel).ne.-1) then
+ write(nfecra,1010)
+ write(nfecra,1050) ippmod(icfuel)
+endif
+
+
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+ /,&
+' ===========================================================' ,/,&
+ /,&
+' RESUME DES PARAMETRES DE CALCUL' ,/,&
+' ===============================' ,/,&
+ /,&
+' -----------------------------------------------------------' ,/)
+
+ 9900 format( &
+ /,&
+' -----------------------------------------------------------' ,/)
+ 1010 format( &
+ /,&
+' ** PHYSIQUE PARTICULIERE :' ,/,&
+' ---------------------' ,/)
+ 1020 format( &
+' --- Flamme de diffusion : Chimie 3 points' ,/,&
+' OPTION = ',4X,I10 /)
+ 1030 format( &
+' --- Flamme premelangee : Modele EBU' ,/,&
+' OPTION = ',4X,I10 ,/,&
+' CEBU = ',E14.5 /)
+ 1040 format( &
+' --- Charbon pulverise : Modele Combustible moyen local' ,/,&
+' OPTION = ',4X,I10 /)
+ 1050 format( &
+' --- Fuel : Modele Combustible moyen local' ,/&
+' OPTION = ',4X,I10 /)
+ 1060 format( &
+' --- Janaf ou non (dans ce cas tabulation utilisateur)' ,/,&
+' INDJON = ',4X,I10, ' (1: Janaf, 0: utilisateur)' ,/)
+
+#else
+
+ 1000 format( &
+ /,&
+' ===========================================================' ,/,&
+ /,&
+' CALCULATION PARAMETERS SUMMARY' ,/,&
+' ==============================' ,/,&
+ /,&
+' -----------------------------------------------------------' ,/)
+
+ 9900 format( &
+ /,&
+' -----------------------------------------------------------' ,/)
+ 1010 format( &
+ /,&
+' ** SPECIFIC PHYSICS:' ,/,&
+' ----------------' ,/)
+ 1020 format( &
+' --- Diffusion Flame: 3 Point Chemistry' ,/,&
+' OPTION = ',4X,I10 /)
+ 1030 format( &
+' --- Premixed Flame: EBU Model' ,/,&
+' OPTION = ',4X,I10 ,/,&
+' CEBU = ',E14.5 /)
+ 1040 format( &
+' --- Pulverized Coal: Local Mean Combustible Model' ,/,&
+' OPTION = ',4X,I10 /)
+ 1050 format( &
+' --- Fuel: Local Mean Combustible Model' ,/,&
+' OPTION = ',4X,I10 /)
+ 1060 format( &
+' --- Janaf or not (user tabulation required in this case)' ,/,&
+' INDJON = ',4X,I10, ' (1: Janaf, 0: user)' ,/)
+
+#endif
+
+!===============================================================================
+! 2. DEFINITION GENERALE DU CAS
+!===============================================================================
+
+! --- Dimensions
+
+write(nfecra,1500)
+write(nfecra,1510) nprfml,nfml
+write(nfecra,1520) nphas,nvar,nscal,nscaus,nscapp, &
+ nproce,nprofa,nprofb
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 1500 format( &
+ /,&
+' ** DIMENSIONS' ,/,&
+' ----------' ,/)
+ 1510 format( &
+' --- Geometrie' ,/,&
+' NPRFML = ',4X,I10, ' (Nb de proprietes de famille )',/,&
+' NFML = ',4X,I10, ' (Nb de familles )',/)
+ 1520 format( &
+' --- Physique' ,/,&
+' NPHAS = ',4X,I10, ' (Nb de phases )',/,&
+' NVAR = ',4X,I10, ' (Nb de variables )',/,&
+' NSCAL = ',4X,I10, ' (Nb de scalaires )',/,&
+' NSCAUS = ',4X,I10, ' (Nb de scalaires utilisateur )',/,&
+' NSCAPP = ',4X,I10, ' (Nb de scalaires phys. part. )',/,&
+' NPROCE = ',4X,I10, ' (Nb de proprietes (cellules) )',/,&
+' NPROFA = ',4X,I10, ' (Nb de proprietes (faces int))',/,&
+' NPROFB = ',4X,I10, ' (Nb de proprietes (faces brd))',/)
+
+#else
+
+ 1500 format( &
+ /,&
+' ** DIMENSIONS' ,/,&
+' ----------' ,/)
+ 1510 format( &
+' --- Geometry' ,/,&
+' NPRFML = ',4X,I10, ' (Nb max. family properties )',/,&
+' NFML = ',4X,I10, ' (Nb families )',/)
+ 1520 format( &
+' --- Physics' ,/,&
+' NPHAS = ',4X,I10, ' (Nb phases )',/,&
+' NVAR = ',4X,I10, ' (Nb variables )',/,&
+' NSCAL = ',4X,I10, ' (Nb scalars )',/,&
+' NSCAUS = ',4X,I10, ' (Nb user scalars )',/,&
+' NSCAPP = ',4X,I10, ' (Nb specific physics scalars )',/,&
+' NPROCE = ',4X,I10, ' (Nb cell properties )',/,&
+' NPROFA = ',4X,I10, ' (Nb internal face properties )',/,&
+' NPROFB = ',4X,I10, ' (Nb boundary face properties )',/)
+
+#endif
+
+!===============================================================================
+! 3. MODELISATION PHYSIQUE
+!===============================================================================
+
+! --- Proprietes physiques
+
+write(nfecra,2000)
+write(nfecra,2010) gx,gy,gz
+write(nfecra,2011) omegax, omegay, omegaz, icorio
+
+do iphas = 1, nphas
+ write(nfecra,2020) iphas, &
+ ro0 (iphas),viscl0(iphas), &
+ cp0 (iphas),icp (iphas), &
+ p0 (iphas),pred0 (iphas), &
+ t0 (iphas), &
+ irovar(iphas),ivivar(iphas), &
+ (xyzp0(ii,iphas),ii=1,3)
+enddo
+
+if (ippmod(iphpar).ge.1) write(nfecra,2030) diftl0
+
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 2000 format( &
+ /,&
+' ** PROPRIETES PHYSIQUES' ,/,&
+' --------------------' ,/)
+ 2010 format( &
+' GX = ', E14.5, ' (Composante x de la gravite )',/,&
+' GY = ', E14.5, ' (Composante y de la gravite )',/,&
+' GZ = ', E14.5, ' (Composante z de la gravite )',/)
+ 2011 format( &
+' OMEGAX = ', E14.5, ' (Composante x du vecteur rot.)',/,&
+' OMEGAY = ', E14.5, ' (Composante y du vecteur rot.)',/,&
+' OMEGAZ = ', E14.5, ' (Composante z du vecteur rot.)',/,&
+' ICORIO = ', I10, ' (Termes source de Coriolis )',/)
+ 2020 format( &
+' -- Phase : ',I10 ,/,&
+ /,&
+' RO0 = ', E14.5, ' (Masse volumique de ref. )',/,&
+' VISCL0 = ', E14.5, ' (Visc. molec. dynam. de ref. )',/,&
+' CP0 = ', E14.5, ' (Chal. Spec. de reference)',/,&
+' ICP = ',4X,I10, ' (> 0 : CP variable (usphyv))',/,&
+' P0 = ', E14.5, ' (Pression totale de reference)',/,&
+' PRED0 = ', E14.5, ' (Press. reduite de reference)',/,&
+' T0 = ', E14.5, ' (Temperature de reference)',/,&
+ /,&
+' IROVAR = ',4X,I10, ' (Masse vol. cst (0) ou non(1)',/,&
+' IVIVAR = ',4X,I10, ' (Visc molec. cst (0) ou non(1)',/,&
+/, &
+' Point de reference initial pour la pression ',/,&
+' XYZP0 = ', E14.5, E14.5, E14.5 )
+ 2030 format( &
+' DIFTL0 = ', E14.5, ' (Diff. dynam. de reference)',/)
+
+#else
+
+ 2000 format( &
+ /,&
+' ** PHYSICAL PROPERTIES' ,/,&
+' -------------------' ,/)
+ 2010 format( &
+' GX = ', E14.5, ' (Gravity x component )',/,&
+' GY = ', E14.5, ' (Gravity y component )',/,&
+' GZ = ', E14.5, ' (Gravity z component )',/)
+ 2011 format( &
+' OMEGAX = ', E14.5, ' (Rotation vector x component )',/,&
+' OMEGAY = ', E14.5, ' (Rotation vector y component )',/,&
+' OMEGAZ = ', E14.5, ' (Rotation vector z component )',/,&
+' ICORIO = ', I10, ' (Coriolis source terms )',/)
+ 2020 format( &
+' -- Phase: ',I10 ,/,&
+ /,&
+' RO0 = ', E14.5, ' (Reference density )',/,&
+' VISCL0 = ', E14.5, ' (Ref. molecular dyn. visc. )',/,&
+' CP0 = ', E14.5, ' (Ref. specific heat )',/,&
+' ICP = ',4X,I10, ' (> 0: variable CP (usphyv) )',/,&
+' P0 = ', E14.5, ' (Ref. total pressure )',/,&
+' PRED0 = ', E14.5, ' (Ref. reduced pressure )',/,&
+' T0 = ', E14.5, ' (Ref. temperature )',/,&
+ /,&
+' IROVAR = ',4X,I10, ' (Density constant(0) or not(1)',/,&
+' IVIVAR = ',4X,I10, ' (Molec. visc cst.(0) or not(1)',/,&
+/, &
+' Initial reference point for pressure' ,/,&
+' XYZP0 = ', E14.5, E14.5, E14.5 )
+ 2030 format( &
+' DIFTL0 = ', E14.5, ' (Ref. dynamic diffusivity )',/)
+
+#endif
+
+! --- Turbulence
+
+write(nfecra,2510)
+
+! - Modeles
+
+do iphas = 1, nphas
+ write(nfecra,2515)iphas, &
+ iturb(iphas),ideuch(iphas),ypluli(iphas),ilogpo(iphas), &
+ igrhok(iphas),iscalt(iphas)
+ if(iturb(iphas).eq.10) then
+ write(nfecra,2516) &
+ xlomlg(iphas)
+ elseif(iturb(iphas).eq.20) then
+ write(nfecra,2517) &
+ almax(iphas) ,uref(iphas) , &
+ iclkep(iphas),ikecou(iphas),igrake(iphas)
+ if (ikecou(iphas).eq.0 .and. idtvar.ge.0) then
+ write(nfecra,2527) relaxv(ik(iphas)),relaxv(iep(iphas))
+ else
+ write(nfecra,2529)
+ endif
+ elseif(iturb(iphas).eq.21) then
+ write(nfecra,2518) &
+ almax(iphas) ,uref(iphas) , &
+ iclkep(iphas),ikecou(iphas),igrake(iphas)
+ if (ikecou(iphas).eq.0.and. idtvar.ge.0) then
+ write(nfecra,2527) relaxv(ik(iphas)),relaxv(iep(iphas))
+ else
+ write(nfecra,2529)
+ endif
+ elseif(iturb(iphas).eq.30) then
+ write(nfecra,2519) &
+ almax(iphas) ,uref(iphas) , &
+ irijnu(iphas),irijrb(iphas),irijec(iphas), &
+ idifre(iphas),igrari(iphas),iclsyr(iphas),iclptr(iphas)
+ elseif(iturb(iphas).eq.31) then
+ write(nfecra,2520) &
+ almax(iphas) ,uref(iphas) , &
+ irijnu(iphas),irijrb(iphas), &
+ igrari(iphas),iclsyr(iphas),iclptr(iphas)
+ elseif(itytur(iphas).eq.4) then
+ write(nfecra,2521) &
+ csmago(iphas),cwale(iphas), xlesfl(iphas),ales(iphas), &
+ bles(iphas),idries(iphas),cdries(iphas), xlesfd(iphas), &
+ smagmx(iphas), ivrtex
+ elseif(iturb(iphas).eq.50) then
+ write(nfecra,2522) &
+ almax(iphas) ,uref(iphas) , &
+ iclkep(iphas),ikecou(iphas),igrake(iphas)
+ if (ikecou(iphas).eq.0 .and. idtvar.ge.0) then
+ write(nfecra,2527) relaxv(ik(iphas)),relaxv(iep(iphas))
+ else
+ write(nfecra,2529)
+ endif
+ elseif(iturb(iphas).eq.60) then
+ write(nfecra,2523) &
+ almax(iphas) ,uref(iphas) , &
+ ikecou(iphas),igrake(iphas)
+ if (ikecou(iphas).eq.0 .and. idtvar.ge.0) then
+ write(nfecra,2528) relaxv(ik(iphas)),relaxv(iomg(iphas))
+ else
+ write(nfecra,2529)
+ endif
+ endif
+enddo
+
+! - Constantes
+
+write(nfecra,2530)xkappa,cstlog,apow,bpow
+
+iok20 = 0
+iok21 = 0
+iok30 = 0
+iok31 = 0
+iok50 = 0
+iok60 = 0
+do iphas = 1, nphas
+ if(iturb(iphas).eq.20) then
+ iok20 = 20
+ endif
+ if(iturb(iphas).eq.21) then
+ iok21 = 21
+ endif
+ if(iturb(iphas).eq.30) then
+ iok30 = 30
+ endif
+ if(iturb(iphas).eq.31) then
+ iok31 = 31
+ endif
+ if(iturb(iphas).eq.50) then
+ iok50 = 50
+ endif
+ if(iturb(iphas).eq.60) then
+ iok60 = 60
+ endif
+enddo
+if(iok20.gt.0) then
+ write(nfecra,2531)ce1,ce2,sigmak,sigmae,cmu
+endif
+if(iok21.gt.0) then
+ write(nfecra,2532)ce1,ce2,sigmak,sigmae,cmu
+endif
+if(iok30.gt.0) then
+ write(nfecra,2533)ce1,ce2,crij1,crij2,crij3,crijep,csrij, &
+ crijp1,crijp2,cmu
+endif
+if(iok31.gt.0) then
+ write(nfecra,2534)cssgs1,cssgs2,cssgr1,cssgr2,cssgr3,cssgr4, &
+ cssgr5,csrij,crij3,ce1,cssge2,sigmae,cmu
+endif
+if(iok50.gt.0) then
+ write(nfecra,2535) cv2fa1,cv2fe2,sigmak,sigmae,cv2fmu,cv2fct, &
+ cv2fcl,cv2fet,cv2fc1,cv2fc2
+endif
+if(iok60.gt.0) then
+ write(nfecra,2536) ckwsk1,ckwsk2,ckwsw1,ckwsw2,ckwbt1,ckwbt2, &
+ ckwgm1,ckwgm2,ckwa1,ckwc1
+endif
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 2510 format( &
+ /,&
+' ** TURBULENCE ',/,&
+' ---------- ',/)
+ 2515 format( &
+' --- Phase : ',I10 ,/,&
+ /,&
+' - Communs ',/,&
+' ITURB = ',4X,I10, ' (Modele de turbulence )',/,&
+' IDEUCH = ',4X,I10, ' (0: modele a une echelle )',/,&
+' (1: modele a deux echelles )',/,&
+' (2: loi de paroi invariante )',/,&
+' YPLULI = ', E14.5, ' (Y plus limite )',/,&
+' ILOGPO = ',4X,I10, ' (0: loi puissance (interdite ',/,&
+' en k-epsilon) )',/,&
+' (1: loi log une echelle )',/,&
+' IGRHOK = ',4X,I10, ' (1: Grad (rho k ) calcule )',/,&
+' ISCALT = ',4X,I10, ' (Numero du scalaire temp )',/)
+ 2516 format( &
+' - Longueur de melange (ITURB = 10) ',/,&
+' XLOMLG = ', E14.5, ' (Longueur caracteristique )',/)
+ 2517 format( &
+' - k-epsilon (ITURB = 20) ',/,&
+' ALMAX = ', E14.5, ' (Longueur caracteristique )',/,&
+' UREF = ', E14.5, ' (Vitesse caracteristique )',/,&
+' ICLKEP = ',4X,I10, ' (Mode de clipping k-epsilon )',/,&
+' IKECOU = ',4X,I10, ' (Mode de couplage k-epsilon )',/,&
+' IGRAKE = ',4X,I10, ' (Prise en compte de gravite )')
+ 2518 format( &
+' - k-epsilon production lineaire (ITURB = 21) ',/,&
+' ALMAX = ', E14.5, ' (Longueur caracteristique )',/,&
+' UREF = ', E14.5, ' (Vitesse caracteristique )',/,&
+' ICLKEP = ',4X,I10, ' (Mode de clipping k-epsilon )',/,&
+' IKECOU = ',4X,I10, ' (Mode de couplage k-epsilon )',/,&
+' IGRAKE = ',4X,I10, ' (Prise en compte de gravite )')
+ 2519 format( &
+' - Rij-epsilon (ITURB = 30) ',/,&
+' ALMAX = ', E14.5, ' (Longueur caracteristique )',/,&
+' UREF = ', E14.5, ' (Vitesse caracteristique )',/,&
+' IRIJNU = ',4X,I10, ' (Stabilisation matricielle )',/,&
+' IRIJRB = ',4X,I10, ' (Reconstruction aux bords )',/,&
+' IRIJEC = ',4X,I10, ' (Termes d echo de paroi )',/,&
+' IDIFRE = ',4X,I10, ' (Traitmnt du tenseur de diff.)',/,&
+' IGRARI = ',4X,I10, ' (Prise en compte de gravite )',/,&
+' ICLSYR = ',4X,I10, ' (Implicitation en symetrie )',/,&
+' ICLPTR = ',4X,I10, ' (Implicitation en paroi )',/)
+ 2520 format( &
+' - Rij-epsilon SSG (ITURB = 31) ',/,&
+' ALMAX = ', E14.5, ' (Longueur caracteristique )',/,&
+' UREF = ', E14.5, ' (Vitesse caracteristique )',/,&
+' IRIJNU = ',4X,I10, ' (Stabilisation matricielle )',/,&
+' IRIJRB = ',4X,I10, ' (Reconstruction aux bords )',/,&
+' IGRARI = ',4X,I10, ' (Prise en compte de gravite )',/,&
+' ICLSYR = ',4X,I10, ' (Implicitation en symetrie )',/,&
+' ICLPTR = ',4X,I10, ' (Implicitation en paroi )',/)
+ 2521 format( &
+' - LES (ITURB = 40, 41, 42) ',/,&
+' (Modele de sous-maille )',/,&
+' (40 Modele de Smagorinsky )',/,&
+' (41 Modele dynamique )',/,&
+' (42 Modele WALE )',/,&
+' CSMAGO = ', E14.5, ' (Constante de Smagorinski )',/,&
+' CWALE = ', E14.5, ' (Constante du modele WALE )',/,&
+' XLESFL = ', E14.5, ' (La largeur du filtre en une )',/,&
+' ALES = ', E14.5, ' (cellule s''ecrit )',/,&
+' BLES = ', E14.5, ' (XLESFL*(ALES*VOLUME)**(BLES))',/,&
+' IDRIES = ',4X,I10, ' (=1 Amortissement Van Driest )',/,&
+' CDRIES = ', E14.5, ' (Constante de Van Driest )',/,&
+' XLESFD = ', E14.5, ' (Rapport entre le filtre )',/,&
+' (explicite et le filtre LES )',/,&
+' (valeur conseillee 1.5 )',/,&
+' SMAGMX = ', E14.5, ' (Smagorinsky max dans le cas )',/,&
+' (du modele dynamique )',/,&
+' IVRTEX = ',4X,I10, ' (Utilisation de la methode )',/,&
+' (des vortex )')
+ 2522 format( &
+' - v2f phi-model (ITURB = 50) ',/,&
+' ALMAX = ', E14.5, ' (Longueur caracteristique )',/,&
+' UREF = ', E14.5, ' (Vitesse caracteristique )',/,&
+' ICLKEP = ',4X,I10, ' (Mode de clipping k-epsilon )',/,&
+' IKECOU = ',4X,I10, ' (Mode de couplage k-epsilon )',/,&
+' IGRAKE = ',4X,I10, ' (Prise en compte de gravite )')
+ 2523 format( &
+' - k-omega SST (ITURB = 60) ',/,&
+' ALMAX = ', E14.5, ' (Longueur caracteristique )',/,&
+' UREF = ', E14.5, ' (Vitesse caracteristique )',/,&
+' IKECOU = ',4X,I10, ' (Mode de couplage k-omega )',/,&
+' IGRAKE = ',4X,I10, ' (Prise en compte de gravite )')
+ 2527 format( &
+' RELAXV = ', E14.5, ' pour k (Relaxation) ',/,&
+' RELAXV = ', E14.5, ' pour epsilon (Relaxation) ',/)
+ 2528 format( &
+' RELAXV = ', E14.5, ' pour k (Relaxation) ',/,&
+' RELAXV = ', E14.5, ' pour omega (Relaxation) ',/)
+ 2529 format(/)
+
+ 2530 format( &
+' --- Constantes ',/,&
+ /,&
+' - Communs ',/,&
+' XKAPPA = ', E14.5, ' (Constante de Von Karman )',/,&
+' CSTLOG = ', E14.5, ' (U+=Log(y+)/kappa +CSTLOG )',/,&
+' APOW = ', E14.5, ' (U+=APOW (y+)**BPOW (W&W law))',/,&
+' BPOW = ', E14.5, ' (U+=APOW (y+)**BPOW (W&W law))',/)
+ 2531 format( &
+' - k-epsilon (ITURB = 20)' ,/,&
+' CE1 = ', E14.5, ' (Cepsilon 1 : coef de Prod. )',/,&
+' CE2 = ', E14.5, ' (Cepsilon 2 : coef de Diss. )',/,&
+' SIGMAK = ', E14.5, ' (Prandtl relatif a k )',/,&
+' SIGMAE = ', E14.5, ' (Prandtl relatif a epsilon )',/,&
+' CMU = ', E14.5, ' (Constante Cmu )',/)
+ 2532 format( &
+' - k-epsilon production lineaire (ITURB = 21)' ,/,&
+' CE1 = ', E14.5, ' (Cepsilon 1 : coef de Prod. )',/,&
+' CE2 = ', E14.5, ' (Cepsilon 2 : coef de Diss. )',/,&
+' SIGMAK = ', E14.5, ' (Prandtl relatif a k )',/,&
+' SIGMAE = ', E14.5, ' (Prandtl relatif a epsilon )',/,&
+' CMU = ', E14.5, ' (Constante Cmu )',/)
+ 2533 format( &
+' - Rij-epsilon std (ITURB = 30)' ,/,&
+' CE1 = ', E14.5, ' (Cepsilon 1 : coef de Prod. )',/,&
+' CE2 = ', E14.5, ' (Cepsilon 2 : coef de Diss. )',/,&
+' CRIJ1 = ', E14.5, ' (Coef terme lent )',/,&
+' CRIJ2 = ', E14.5, ' (Coef terme rapide )',/,&
+' CRIJ3 = ', E14.5, ' (Coef terme de gravite )',/,&
+' CRIJEP = ', E14.5, ' (Coef diffusion epsilon )',/,&
+' CSRIJ = ', E14.5, ' (Coef diffusion Rij )',/,&
+' CRIJP1 = ', E14.5, ' (Coef lent pour echo de paroi)',/,&
+' CRIJP2 = ', E14.5, ' (Coef rapide echo de paroi)',/,&
+' CMU = ', E14.5, ' (Constante Cmu )',/)
+ 2534 format( &
+' - Rij-epsilon SSG (ITURB = 31)' ,/,&
+' CSSGS1 = ', E14.5, ' (Coef Cs1 )',/,&
+' CSSGS2 = ', E14.5, ' (Coef Cs2 )',/,&
+' CSSGR1 = ', E14.5, ' (Coef Cr1 )',/,&
+' CSSGR2 = ', E14.5, ' (Coef Cr2 )',/,&
+' CSSGR3 = ', E14.5, ' (Coef Cr3 )',/,&
+' CSSGR4 = ', E14.5, ' (Coef Cr4 )',/,&
+' CSSGR5 = ', E14.5, ' (Coef Cr5 )',/,&
+' CRIJS = ', E14.5, ' (Coef Cs diffusion de Rij )',/,&
+' CRIJ3 = ', E14.5, ' (Coef terme de gravite )',/,&
+' CE1 = ', E14.5, ' (Coef Ceps1 )',/,&
+' CSSGE2 = ', E14.5, ' (Coef Ceps2 )',/,&
+' SIGMAE = ', E14.5, ' (Coef sigma_eps )',/,&
+' CMU = ', E14.5, ' (Constante Cmu )',/)
+ 2535 format( &
+' - v2f phi-model (ITURB = 50)' ,/,&
+' CV2FA1 = ', E14.5, ' (a1 pour calculer Cepsilon1 )',/,&
+' CV2FE2 = ', E14.5, ' (Cepsilon 2 : coef de Diss. )',/,&
+' SIGMAK = ', E14.5, ' (Prandtl relatif a k )',/,&
+' SIGMAE = ', E14.5, ' (Prandtl relatif a epsilon )',/,&
+' CV2FMU = ', E14.5, ' (Constante Cmu )',/,&
+' CV2FCT = ', E14.5, ' (Constante CT )',/,&
+' CV2FCL = ', E14.5, ' (Constante CL )',/,&
+' CV2FET = ', E14.5, ' (Constante C_eta )',/,&
+' CV2FC1 = ', E14.5, ' (Constante C1 )',/,&
+' CV2FC2 = ', E14.5, ' (Constante C2 )',/)
+ 2536 format( &
+' - k-omega SST (ITURB = 60)' ,/,&
+' CKWSK1 = ', E14.5, ' (Constante sigma_k1 )',/,&
+' CKWSK2 = ', E14.5, ' (Constante sigma_k2 )',/,&
+' CKWSW1 = ', E14.5, ' (Constante sigma_omega1 )',/,&
+' CKWSW2 = ', E14.5, ' (Constante sigma_omega2 )',/,&
+' CKWBT1 = ', E14.5, ' (Constante beta1 )',/,&
+' CKWBT2 = ', E14.5, ' (Constante beta2 )',/,&
+' CKWGM1 = ', E14.5, ' (Constante gamma1 )',/,&
+' CKWGM2 = ', E14.5, ' (Constante gamma2 )',/,&
+' CKWA1 = ', E14.5, ' (Cste a1 pour calculer mu_t )',/,&
+' CKWC1 = ', E14.5, ' (Cste c1 pour limiteur prod )',/,&
+' CMU = ', E14.5, ' (Cste Cmu (ou Beta*) pour )',/,&
+' conversion omega/epsilon)',/)
+
+#else
+
+ 2510 format( &
+ /,&
+' ** TURBULENCE' ,/,&
+' ----------' ,/)
+ 2515 format( &
+' --- Phase: ',I10 ,/,&
+ /,&
+' - Commons ',/,&
+' ITURB = ',4X,I10, ' (Turbulence model )',/,&
+' IDEUCH = ',4X,I10, ' (0: one-scale model )',/,&
+' (1: two-scale model )',/,&
+' (2: invariant wall function )',/,&
+' YPLULI = ', E14.5, ' (Limit Y+ )',/,&
+' ILOGPO = ',4X,I10, ' (0: power law (forbidden for' ,/,&
+' k-epsilon) )',/,&
+' (1: one-scale log law )',/,&
+' IGRHOK = ',4X,I10, ' (1: computed Grad(rho k) )',/,&
+' ISCALT = ',4X,I10, ' (Temperature salar number )',/)
+ 2516 format( &
+' - Mixing length (ITURB = 10)' ,/,&
+' XLOMLG = ', E14.5, ' (Characteristic length )',/)
+ 2517 format( &
+' - k-epsilon (ITURB = 20)' ,/,&
+' ALMAX = ', E14.5, ' (Characteristic length )',/,&
+' UREF = ', E14.5, ' (Characteristic velocity )',/,&
+' ICLKEP = ',4X,I10, ' (k-epsilon clipping model )',/,&
+' IKECOU = ',4X,I10, ' (k-epsilon coupling mode )',/,&
+' IGRAKE = ',4X,I10, ' (Account for gravity )')
+ 2518 format( &
+' - Linear production k-epsilon (ITURB = 21)' ,/,&
+' ALMAX = ', E14.5, ' (Characteristic length )',/,&
+' UREF = ', E14.5, ' (Characteristic velocity )',/,&
+' ICLKEP = ',4X,I10, ' (k-epsilon clipping model )',/,&
+' IKECOU = ',4X,I10, ' (k-epsilon coupling mode )',/,&
+' IGRAKE = ',4X,I10, ' (Account for gravity )')
+ 2519 format( &
+' - Rij-epsilon (ITURB = 30)' ,/,&
+' ALMAX = ', E14.5, ' (Characteristic length )',/,&
+' UREF = ', E14.5, ' (Characteristic velocity )',/,&
+' IRIJNU = ',4X,I10, ' (Matrix stabilization )',/,&
+' IRIJRB = ',4X,I10, ' (Reconstruct at boundaries )',/,&
+' IRIJEC = ',4X,I10, ' (Wall echo terms )',/,&
+' IDIFRE = ',4X,I10, ' (Handle diffusion tensor )',/,&
+' IGRARI = ',4X,I10, ' (Prise en compte de gravite )',/,&
+' ICLSYR = ',4X,I10, ' (Symmetry implicitation )',/,&
+' ICLPTR = ',4X,I10, ' (Wall implicitation )',/)
+ 2520 format( &
+' - SSG Rij-epsilon (ITURB = 31)' ,/,&
+' ALMAX = ', E14.5, ' (Characteristic length )',/,&
+' UREF = ', E14.5, ' (Characteristic velocity )',/,&
+' IRIJNU = ',4X,I10, ' (Matrix stabilization )',/,&
+' IRIJRB = ',4X,I10, ' (Reconstruct at boundaries )',/,&
+' IGRARI = ',4X,I10, ' (Account for gravity )',/,&
+' ICLSYR = ',4X,I10, ' (Symmetry implicitation )',/,&
+' ICLPTR = ',4X,I10, ' (Wall implicitation )',/)
+ 2521 format( &
+' - LES (ITURB = 40, 41, 42)' ,/,&
+' (Sub-grid scale model )',/,&
+' (40 Smagorinsky model )',/,&
+' (41 Dynamic model )',/,&
+' (42 WALE model )',/,&
+' CSMAGO = ', E14.5, ' (Smagorinsky constant )',/,&
+' CWALE = ', E14.5, ' (WALE model constant )',/,&
+' XLESFL = ', E14.5, ' (Filter with in a cell is )',/,&
+' ALES = ', E14.5, ' (written as )',/,&
+' BLES = ', E14.5, ' (XLESFL*(ALES*VOLUME)**(BLES))',/,&
+' IDRIES = ',4X,I10, ' (=1 Van Driest damping )',/,&
+' CDRIES = ', E14.5, ' (Van Driest constant )',/,&
+' XLESFD = ', E14.5, ' (Ratio between the explicit )',/,&
+' (filter and LES filter )',/,&
+' (recommended value: 1.5 )',/,&
+' SMAGMX = ', E14.5, ' (Max Smagonsky in the )',/,&
+' (dynamic model case )',/,&
+' IVRTEX = ',4X,I10, ' (Use the vortex method )')
+ 2522 format( &
+' - v2f phi-model (ITURB = 50) ',/,&
+' ALMAX = ', E14.5, ' (Characteristic length )',/,&
+' UREF = ', E14.5, ' (Characteristic velocity )',/,&
+' ICLKEP = ',4X,I10, ' (k-epsilon clipping model )',/,&
+' IKECOU = ',4X,I10, ' (k-epsilon coupling mode )',/,&
+' IGRAKE = ',4X,I10, ' (Account for gravity )')
+ 2523 format( &
+' - k-omega SST (ITURB = 60) ',/,&
+' ALMAX = ', E14.5, ' (Characteristic length )',/,&
+' UREF = ', E14.5, ' (Characteristic velocity )',/,&
+' IKECOU = ',4X,I10, ' (k-epsilon coupling mode )',/,&
+' IGRAKE = ',4X,I10, ' (Account for gravity )')
+ 2527 format( &
+' RELAXV = ', E14.5, ' for k (Relaxation) ',/,&
+' RELAXV = ', E14.5, ' for epsilon (Relaxation) ',/)
+ 2528 format( &
+' RELAXV = ', E14.5, ' for k (Relaxation) ',/,&
+' RELAXV = ', E14.5, ' for omega (Relaxation) ',/)
+ 2529 format(/)
+
+ 2530 format( &
+' --- Constants' ,/,&
+ /,&
+' - Commons ',/,&
+' XKAPPA = ', E14.5, ' (Von Karman constant )',/,&
+' CSTLOG = ', E14.5, ' (U+=Log(y+)/kappa +CSTLOG )',/,&
+' APOW = ', E14.5, ' (U+=APOW (y+)**BPOW (W&W law))',/,&
+' BPOW = ', E14.5, ' (U+=APOW (y+)**BPOW (W&W law))',/)
+ 2531 format( &
+' - k-epsilon (ITURB = 20)' ,/,&
+' CE1 = ', E14.5, ' (Cepsilon 1: production coef.)',/,&
+' CE2 = ', E14.5, ' (Cepsilon 2: dissipat. coef.)',/,&
+' SIGMAK = ', E14.5, ' (Prandtl relative to k )',/,&
+' SIGMAE = ', E14.5, ' (Prandtl relative to epsilon )',/,&
+' CMU = ', E14.5, ' (Cmu constant )',/)
+ 2532 format( &
+' - Linear production k-epsilon (ITURB = 21)' ,/,&
+' CE1 = ', E14.5, ' (Cepsilon 1: production coef.)',/,&
+' CE2 = ', E14.5, ' (Cepsilon 2: dissipat. coef.)',/,&
+' SIGMAK = ', E14.5, ' (Prandtl relative to k )',/,&
+' SIGMAE = ', E14.5, ' (Prandtl relative to epsilon )',/,&
+' CMU = ', E14.5, ' (Cmu constant )',/)
+ 2533 format( &
+' - Rij-epsilon (ITURB = 30)' ,/,&
+' CE1 = ', E14.5, ' (Cepsilon 1: production coef.)',/,&
+' CE2 = ', E14.5, ' (Cepsilon 2: dissipat. coef.)',/,&
+' CRIJ1 = ', E14.5, ' (Slow term coefficient )',/,&
+' CRIJ2 = ', E14.5, ' (Fast term coefficient )',/,&
+' CRIJ3 = ', E14.5, ' (Gravity term coefficient )',/,&
+' CRIJEP = ', E14.5, ' (Epsilon diffusion coeff. )',/,&
+' CSRIJ = ', E14.5, ' (Rij diffusion coeff. )',/,&
+' CRIJP1 = ', E14.5, ' (Slow coeff. for wall echo )',/,&
+' CRIJP2 = ', E14.5, ' (Fast coeff. for wall echo )',/,&
+' CMU = ', E14.5, ' (Cmu constant )',/)
+ 2534 format( &
+' - SSG Rij-epsilon (ITURB = 31)' ,/,&
+' CSSGS1 = ', E14.5, ' (Cs1 coeff. )',/,&
+' CSSGS2 = ', E14.5, ' (Cs2 coeff. )',/,&
+' CSSGR1 = ', E14.5, ' (Cr1 coeff. )',/,&
+' CSSGR2 = ', E14.5, ' (Cr2 coeff. )',/,&
+' CSSGR3 = ', E14.5, ' (Cr3 coeff. )',/,&
+' CSSGR4 = ', E14.5, ' (Cr4 coeff. )',/,&
+' CSSGR5 = ', E14.5, ' (Cr5 coeff. )',/,&
+' CRIJS = ', E14.5, ' (Rij Cs diffusion coeff. )',/,&
+' CRIJ3 = ', E14.5, ' (Gravity term coeff. )',/,&
+' CE1 = ', E14.5, ' (Ceps1 coeff. )',/,&
+' CSSGE2 = ', E14.5, ' (Ceps2 coeff. )',/,&
+' SIGMAE = ', E14.5, ' (sigma_eps coeff. )',/,&
+' CMU = ', E14.5, ' (Cmu constant )',/)
+ 2535 format( &
+' - v2f phi-model (ITURB = 50) ',/,&
+' CV2FA1 = ', E14.5, ' (a1 to calculate Cepsilon1 )',/,&
+' CV2FE2 = ', E14.5, ' (Cepsilon 2: dissip. coeff. )'/, &
+' SIGMAK = ', E14.5, ' (Prandtl relative to k )',/,&
+' SIGMAE = ', E14.5, ' (Prandtl relative to epsilon )',/,&
+' CV2FMU = ', E14.5, ' (Cmu constant )',/,&
+' CV2FCT = ', E14.5, ' (CT constant )',/,&
+' CV2FCL = ', E14.5, ' (CL constant )',/,&
+' CV2FET = ', E14.5, ' (C_eta constant )',/,&
+' CV2FC1 = ', E14.5, ' (C1 constant )',/,&
+' CV2FC2 = ', E14.5, ' (C2 constant )',/)
+ 2536 format( &
+' - k-omega SST (ITURB = 60) ',/,&
+' CKWSK1 = ', E14.5, ' (sigma_k1 constant )',/,&
+' CKWSK2 = ', E14.5, ' (sigma_k2 constant )',/,&
+' CKWSW1 = ', E14.5, ' (sigma_omega1 constant )',/,&
+' CKWSW2 = ', E14.5, ' (sigma_omega2 constant )',/,&
+' CKWBT1 = ', E14.5, ' (beta1 constant )',/,&
+' CKWBT2 = ', E14.5, ' (beta2 constant )',/,&
+' CKWGM1 = ', E14.5, ' (gamma1 constant )',/,&
+' CKWGM2 = ', E14.5, ' (gamma2 constant )',/,&
+' CKWA1 = ', E14.5, ' (a1 constant to compute mu_t )',/,&
+' CKWC1 = ', E14.5, ' (c1 const. for prod. limiter )',/,&
+' CMU = ', E14.5, ' (Cmu (or Beta*) constant for )',/,&
+' omega/epsilon conversion)',/)
+
+#endif
+
+! --- Viscosite secondaire
+
+write(nfecra,2610)
+do iphas = 1, nphas
+ write(nfecra,2620) iphas, ivisse(iphas)
+enddo
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 2610 format( &
+ /,&
+' ** VISCOSITE SECONDAIRE ',/,&
+' -------------------- ',/)
+ 2620 format( &
+' --- Phase : ',I10 ,/,&
+' IVISSE = ',4X,I10, ' (1 : pris en compte )',/)
+
+#else
+
+ 2610 format( &
+ /,&
+' ** SECONDARY VISCOSITY' ,/,&
+' -------------------' ,/)
+ 2620 format( &
+' --- Phase: ',I10 ,/,&
+' IVISSE = ',4X,I10, ' (1: accounted for )',/)
+
+#endif
+
+! --- Rayonnement thermique
+
+if (iirayo.gt.0) then
+ write(nfecra,2630)
+
+ write(nfecra,2640) irapha, iirayo, iscalt(irapha), &
+ iscsth(iscalt(irapha))
+
+ write(nfecra,2650) isuird, nfreqr, ndirec, &
+ idiver, imodak, iimpar, iimlum
+ write(nfecra,2660)
+
+ do ii = 1,nbrayf
+ if(irayvf(ii).eq.1) write(nfecra,2662)nbrvaf(ii)
+ enddo
+
+ write(nfecra,9900)
+
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 2630 format( &
+ /,&
+' ** TRANSFERTS THERMIQUES RADIATIFS ',/,&
+' ------------------------------- ',/)
+ 2640 format( &
+' --- Phase : ',I10 ,/,&
+' IIRAYO = ',4X,I10, ' (0 : non ; 1 : DOM ; 2 : P-1 )',/,&
+' ICSALT = ',4X,I10, ' (Num du sca thermique associe)',/,&
+' ISCSTH = ',4X,I10, ' (-1 : T(C) ; 1 : T(K) ; 2 : H)',/)
+ 2650 format( &
+' --- Options : ',/,&
+' ISUIRD = ',4X,I10, ' (0 : pas de suite ; 1 : suite)',/,&
+' NFREQR = ',4X,I10, ' (Frequence pass. rayonnement )',/,&
+' NDIREC = ',4X,I10, ' (32 ou 128 directions(si DOM))',/,&
+' IDIVER = ',4X,I10, ' (0 1 ou 2: calcul TS radiatif)',/,&
+' IMODAK = ',4X,I10, ' (1: modak coef absor; 0 sinon)',/,&
+' IIMPAR = ',4X,I10, ' (0 1 ou 2: impr Tempera paroi)',/,&
+' IIMLUM = ',4X,I10, ' (0 1 ou 2: impr infos solveur)',/)
+ 2660 format( &
+' --- Sorties graphiques : ' )
+ 2662 format( &
+' NBRVAF = ',4X,A40 )
+
+#else
+
+ 2630 format( &
+ /,&
+' ** RADIATIVE THERMAL TRANSFER' ,/,&
+' --------------------------' ,/)
+ 2640 format( &
+' --- Phase: ',I10 ,/,&
+' IIRAYO = ',4X,I10, ' (0: no; 1: DOM; 2: P-1 )',/,&
+' ICSALT = ',4X,I10, ' (Assoc. thermal scalar num. )',/,&
+' ISCSTH = ',4X,I10, ' (-1: T(C); 1: T(K); 2: H )',/)
+ 2650 format( &
+' --- Options:' ,/,&
+' ISUIRD = ',4X,I10, ' (0: no restart; 1: restart )',/,&
+' NFREQR = ',4X,I10, ' (Radiation pass frequency )',/,&
+' NDIREC = ',4X,I10, ' (32 or 128 directions(if DOM))',/,&
+' IDIVER = ',4X,I10, ' (0 1 or 2: compute radiat. ST)',/,&
+' IMODAK = ',4X,I10, ' (1: modak absor coef; 0 else )',/,&
+' IIMPAR = ',4X,I10, ' (0 1 or 2: print wall temp. )',/,&
+' IIMLUM = ',4X,I10, ' (0 1 or 2: print solver info )',/)
+ 2660 format( &
+' --- Graphical output:' )
+ 2662 format( &
+' NBRVAF = ',4X,A40 )
+
+#endif
+
+! --- Compressible
+
+if (ippmod(icompf).ge.0) then
+ write(nfecra,2700)
+ do iphas = 1, nphas
+ write(nfecra,2710) iphas, &
+ icv(iphas), &
+ iviscv(iphas),viscv0(iphas), &
+ icfgrp(iphas)
+ enddo
+
+ write(nfecra,9900)
+
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 2700 format( &
+ /,&
+' ** COMPRESSIBLE : donnees complementaires ',/,&
+' ------------ ',/)
+ 2710 format( &
+' --- Phase : ',I10 ,/,&
+' ICV = ',4X,I10, ' (0 : Cv cst ; 1 : variable )',/,&
+' IVISCV = ',4X,I10, ' (0 : kappa cst ; 1 : variable ',/,&
+' kappa : viscosite en volume ',/,&
+' en kg/(m s) )',/,&
+' VISCV0 = ',E14.5 , ' (Valeur de kappa si cst )',/,&
+' ICFGRP = ',4X,I10, ' (1 : C.L. pression avec effet ',/,&
+' hydrostatique dominant )',/)
+
+#else
+
+ 2700 format( &
+ /,&
+' ** COMPRESSIBLE: additional data' ,/,&
+' ------------ ',/)
+ 2710 format( &
+' --- Phase : ',I10 ,/,&
+' ICV = ',4X,I10, ' (0: Cv cst; 1: variable )',/,&
+' IVISCV = ',4X,I10, ' (0: kappa cst; 1: variable' ,/,&
+' kappa: volume viscosity' ,/,&
+' in kg/(m.s) )',/,&
+' VISCV0 = ',E14.5 , ' (kappa value if constant )',/,&
+' ICFGRP = ',4X,I10, ' (1: pressure BC with dominant' ,/,&
+' hydrostatic effect )',/)
+
+#endif
+
+!===============================================================================
+! 4. DISCRETISATION DES EQUATIONS
+!===============================================================================
+
+! --- Marche en temps
+
+write(nfecra,3000)
+
+! Stationnaire
+if (idtvar.lt.0) then
+
+! - Parametres du pas de temps
+
+ write(nfecra,3010) idtvar, relxst
+
+! - Champ de vitesse fige
+
+ write(nfecra,3030) iccvfg
+
+! - Coefficient de relaxation
+
+ write(nfecra,3011)
+ do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,3012) chaine(1:8),relaxv(ii)
+ endif
+ enddo
+ write(nfecra,3013)
+
+! Instationnaire
+else
+
+! - Parametres du pas de temps
+
+ write(nfecra,3020) idtvar,iptlro,coumax,foumax, &
+ varrdt,dtmin,dtmax,dtref
+
+! - Champ de vitesse fige
+
+ write(nfecra,3030) iccvfg
+
+! - Coef multiplicatif du pas de temps
+
+ write(nfecra,3040)
+ do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,3041) chaine(1:8),istat(ii),cdtvar(ii)
+ endif
+ enddo
+ write(nfecra,3042)
+
+
+! - Coefficient de relaxation de la masse volumique
+
+ if (ippmod(iphpar).ge.2) write(nfecra,3050) srrom
+
+! - Ordre du schema en temps
+
+ write(nfecra,3060)
+ do iphas = 1, nphas
+ write(nfecra,3061) iphas, ischtp(iphas)
+ enddo
+ write(nfecra,3062)
+
+endif
+
+write(nfecra,9900)
+
+#if defined(_CS_LANG_FR)
+
+ 3000 format( &
+ /,&
+' ** MARCHE EN TEMPS' ,/,&
+' ---------------' ,/)
+ 3010 format( &
+' ALGORITHME STATIONNAIRE' ,/,&
+ /,&
+' --- Parametres globaux' ,/,&
+ /,&
+' IDTVAR = ',4X,I10, ' (-1: algorithme stationnaire )',/,&
+' RELXST = ', E14.5, ' (Coef relaxation de reference)',/,&
+' ',/)
+ 3011 format( &
+' --- Coefficient de relaxation par variable' ,/,&
+ /,&
+'---------------------' ,/,&
+' Variable RELAXV' ,/,&
+'---------------------' )
+ 3012 format( &
+ 1x, a8, e12.4 )
+ 3013 format( &
+'----------------------------' ,/,&
+ /,&
+' RELAXV = [0.,1.] (coeff de relaxation )',/)
+ 3020 format( &
+' ALGORITHME INSTATIONNAIRE' ,/,&
+ /,&
+' --- Parametres du pas de temps' ,/,&
+ /,&
+' IDTVAR = ',4X,I10, ' (0 cst;1,2 var(tps,tps-espace)',/,&
+' IPTLRO = ',4X,I10, ' (1 : clipping de DT lie a rho)',/,&
+' COUMAX = ', E14.5, ' (Courant maximum cible )',/,&
+' FOUMAX = ', E14.5, ' (Fourier maximum cible )',/,&
+' VARRDT = ', E14.5, ' (En DT var, accroissement max)',/,&
+' DTMIN = ', E14.5, ' (Pas de temps min )',/,&
+' DTMAX = ', E14.5, ' (Pas de temps max )',/,&
+' DTREF = ', E14.5, ' (Pas de temps de reference )',/,&
+ /,&
+' En pas de temps non constant (IDTVAR = 1 ou 2),' ,/,&
+' lorsque la valeur de COUMAX ou FOUMAX est negative' ,/,&
+' ou nulle, la limitation du pas de temps associee (au',/,&
+' nombre de Courant et de Fourier, respectivement) ',/,&
+' n ''est pas prise en compte.' ,/)
+ 3030 format( &
+' --- Champ de vitesse fige' ,/,&
+ /,&
+' ICCVFG = ',4X,I10, ' (1 : champ de vitesse fige )',/)
+ 3040 format( &
+' --- Proprietes par variable' ,/,&
+ /,&
+'----------------------------' ,/,&
+' Variable ISTAT CDTVAR' ,/,&
+'----------------------------' )
+ 3041 format( &
+ 1x, a8, i7, e12.4 )
+ 3042 format( &
+'----------------------------' ,/,&
+ /,&
+' ISTAT = 0 ou 1 (1 pour instationnaire )',/,&
+' CDTVAR > 0 (coeff mult. du pas de temps )',/)
+
+ 3050 format( &
+'--- Coefficient de relaxation' ,/,&
+' RHO(n+1)=SRROM*RHO(n)+(1-SRROM)*RHO(n+1)' ,/,&
+' SRROM = ',E14.5 ,/)
+
+ 3060 format( &
+' --- Ordre du schema en temps de base' )
+ 3061 format( &
+' Phase : ',I10 ,/,&
+' ISCHTP = ',4X,I10, ' (1 : ordre 1 ; 2 : ordre 2 )' )
+ 3062 format( &
+' ' )
+
+#else
+
+ 3000 format( &
+ /,&
+' ** TIME STEPPING' ,/,&
+' -------------' ,/)
+ 3010 format( &
+' STEADY ALGORITHM' ,/,&
+ /,&
+' --- Global parameters' ,/,&
+ /,&
+' IDTVAR = ',4X,I10, ' (-1: steady algorithm )',/,&
+' RELXST = ', E14.5, ' (Reference relaxation coeff. )',/,&
+' ',/)
+ 3011 format( &
+' --- Per variable relaxation coefficient' ,/,&
+ /,&
+'---------------------' ,/,&
+' RELAXV variable' ,/,&
+'---------------------' )
+ 3012 format( &
+ 1x, a8, e12.4 )
+ 3013 format( &
+'----------------------------' ,/,&
+ /,&
+' RELAXV = [0.,1.] (relaxation coefficient )',/)
+ 3020 format( &
+' UNSTEADY ALGORITHM' ,/,&
+ /,&
+' --- Time step parameters' ,/,&
+ /,&
+' IDTVAR = ',4X,I10, ' (0 cst; 1,2 var (t, t-space )',/,&
+' IPTLRO = ',4X,I10, ' (1: rho-related DT clipping )',/,&
+' COUMAX = ', E14.5, ' (Maximum target CFL )',/,&
+' FOUMAX = ', E14.5, ' (Maximum target Fourier )',/,&
+' VARRDT = ', E14.5, ' (For var. DT, max. increase )',/,&
+' DTMIN = ', E14.5, ' (Minimum time step )',/,&
+' DTMAX = ', E14.5, ' (Maximum time step )',/,&
+' DTREF = ', E14.5, ' (Reference time step )',/,&
+ /,&
+' With a non-constant time step (IDTVAR = 1 or 2),' ,/,&
+' when the value of COUMAX or FOUMAX is negative' ,/,&
+' or zero, the associated time step limitation (for' ,/,&
+' CFL and Fourier respectively) is ignored.' ,/)
+ 3030 format( &
+' --- Frozen velocity field' ,/,&
+ /,&
+' ICCVFG = ',4X,I10, ' (1: frozen velocity field )',/)
+ 3040 format( &
+' --- Per-variable properties' ,/,&
+ /,&
+'----------------------------' ,/,&
+' Variable ISTAT CDTVAR' ,/,&
+'----------------------------' )
+ 3041 format( &
+ 1x, a8, i7, e12.4 )
+ 3042 format( &
+'----------------------------' ,/,&
+ /,&
+' ISTAT = 0 ou 1 (1 for unsteady )',/,&
+' CDTVAR > 0 (time step multiplier )',/)
+
+ 3050 format( &
+'--- Relaxation coefficient' ,/,&
+' RHO(n+1)=SRROM*RHO(n)+(1-SRROM)*RHO(n+1)' ,/,&
+' SRROM = ',E14.5 ,/)
+
+ 3060 format( &
+' --- Order of base time stepping scheme' )
+ 3061 format( &
+' Phase: ',I10 ,/,&
+' ISCHTP = ',4X,I10, ' (1: order 1; 2: order 2 )' )
+ 3062 format( &
+' ' )
+
+#endif
+
+! --- Convection Diffusion
+
+write(nfecra,4000)
+
+write(nfecra,4010)
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,4020) chaine(1:8), &
+ iconv(ii),idiff(ii),idifft(ii), &
+ ischcv(ii),isstpc(ii), &
+ blencv(ii),thetav(ii)
+ endif
+enddo
+write(nfecra,4030)
+
+write(nfecra,9900)
+
+! --- Stokes
+
+write(nfecra,4110) iphydr,icalhy,iprco,ipucou,nterup
+do iphas = 1, nphas
+ write(nfecra,4111)iphas, &
+ irevmc(iphas)
+ if (idtvar.ge.0) then
+ write(nfecra,4112) relaxv(ipr(iphas)),arak(iphas)
+ else
+ write(nfecra,4113) arak(iphas)*relaxv(iu(iphas))
+ endif
+ write(nfecra,4114)istmpf(iphas),thetfl(iphas), &
+ iroext(iphas),thetro(iphas), &
+ iviext(iphas),thetvi(iphas), &
+ icpext(iphas),thetcp(iphas), &
+ thetsn(iphas),thetst(iphas),epsup(iphas)
+enddo
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 4000 format( &
+ /,&
+' ** CONVECTION - DIFFUSION' ,/,&
+' ----------------------' ,/)
+ 4010 format( &
+'-------------------------------------------------------------',/,&
+' Variable ICONV IDIFF IDIFFT ISCHCV ISSTPC BLENCV THETAV',/,&
+'-------------------------------------------------------------' )
+ 4020 format( &
+ 1x, a8, i7, i7, i7, i7, i7, e9.2, e9.2 )
+ 4030 format( &
+'-------------------------------------------------------------',/,&
+ /,&
+' ICONV = 0 ou 1 (1 pour convection branchee )',/,&
+' IDIFF = 0 ou 1 (1 pour diff. tot branchee )',/,&
+' IDIFFT = 0 ou 1 (1 pour diff. turb. branchee )',/,&
+' ISCHCV = 0 ou 1 (SOLU ou CD )',/,&
+' ISSTPC = 0 ou 1 (1 : sans test de pente )',/,&
+' BLENCV = [0.;1.] (1-proportion d upwind )',/,&
+' THETAV = [0.;1.] (0.5 Crank-Nicolson/AB )',/,&
+' (theta pour les termes de )',/,&
+' (convection diffusion utilise)',/,&
+' ((1-theta)ancien+theta nouveau',/)
+
+ 4110 format( &
+ /,&
+' ** STOKES' ,/,&
+' ------' ,/,&
+' IPHYDR = ',4X,I10, ' (1 : prise en compte explicite ',/,&
+' ',14X, ' de l''equilibre entre grad ',/,&
+' ',14X, ' de pression et termes ',/,&
+' ',14X, ' sources de gravite et de ',/,&
+' ',14X, ' pertes de charge )',/,&
+' ICALHY = ',4X,I10, ' (1 : calcul de la pression ',/,&
+' ',14X, ' hydrostatique pour les ',/,&
+' ',14X, ' conditions de Dirichlet en ',/,&
+' ',14X, ' sortie sur la pression )',/,&
+' IPRCO = ',4X,I10, ' (1 : avec pression-continuite )',/,&
+' IPUCOU = ',4X,I10, ' (1 : avec couplage U-P renforce)',/,&
+' NTERUP = ',4X,I10, ' (n : avec n sweep sur navsto ',/,&
+' ',14X, ' pour couplage vites/pressio',/)
+ 4111 format( &
+' -- Phase : ',I10 ,/,&
+ /,&
+' IREVMC = ',4X,I10, ' (Mode de reconstruction vites)',/)
+ 4112 format( &
+' RELAXV = ', E14.5, ' pour la pression (relaxation) ',/,&
+' ARAK = ', E14.5, ' (Facteur d Arakawa )',/)
+ 4113 format( &
+' ARAK = ', E14.5, ' (Facteur d Arakawa )',/)
+ 4114 format( &
+' ISTMPF = ',4X,I10, ' (schema en temps pour le flux ',/,&
+' ',14X, ' (0 : explicite (THETFL = 0 )',/,&
+' ',14X, ' (1 : schema std (Saturne 1.0 )',/,&
+' ',14X, ' (2 : ordre 2 (THETFL = 0.5 )',/,&
+' THETFL = ', E14.5, ' (theta pour flux de masse )',/,&
+' IROEXT = ',4X,I10, ' (extrap. masse volumique ',/,&
+' ',14X, ' (0 : explicite ',/,&
+' ',14X, ' (1 : n+thetro avec thetro=1/2 ',/,&
+' ',14X, ' (2 : n+thetro avec thetro=1 ',/,&
+' THETRO = ', E14.5, ' (theta pour masse volumique ',/,&
+' ((1+theta)nouveau-theta ancien',/,&
+' IVIEXT = ',4X,I10, ' (extrap. viscosite totale ',/,&
+' ',14X, ' (0 : explicite ',/,&
+' ',14X, ' (1 : n+thetvi avec thetro=1/2 ',/,&
+' ',14X, ' (2 : n+thetvi avec thetro=1 ',/,&
+' THETVI = ', E14.5, ' (theta pour viscosite totale ',/,&
+' ((1+theta)nouveau-theta ancien',/,&
+' ICPEXT = ',4X,I10, ' (extrap. chaleur specifique ',/,&
+' ',14X, ' (0 : explicite ',/,&
+' ',14X, ' (1 : n+thetcp avec thetro=1/2 ',/,&
+' ',14X, ' (2 : n+thetcp avec thetro=1 ',/,&
+' THETCP = ', E14.5, ' (theta schema chaleur spec ',/,&
+' ((1+theta)nouveau-theta ancien',/,&
+' THETSN = ', E14.5, ' (theta schema T.S. Nav-Stokes)',/,&
+' ((1+theta)nouveau-theta ancien',/,&
+' THETST = ', E14.5, ' (theta schema T.S. Turbulence)',/,&
+' ((1+theta)nouveau-theta ancien',/,&
+' EPSUP = ', E14.5, ' (Test d''arret du couplage ',/,&
+' ',14X, ' vitesse/pression )',/)
+
+
+#else
+
+ 4000 format( &
+ /,&
+' ** CONVECTION - DIFFUSION' ,/,&
+' ----------------------' ,/)
+ 4010 format( &
+'-------------------------------------------------------------',/,&
+' Variable ICONV IDIFF IDIFFT ISCHCV ISSTPC BLENCV THETAV',/,&
+'-------------------------------------------------------------' )
+ 4020 format( &
+ 1x, a8, i7, i7, i7, i7, i7, e9.2, e9.2 )
+ 4030 format( &
+'-------------------------------------------------------------',/,&
+ /,&
+' ICONV = 0 ou 1 (1 for convection active )',/,&
+' IDIFF = 0 ou 1 (1 for total diffusion active)',/,&
+' IDIFFT = 0 ou 1 (1 for turbulent diff. active)',/,&
+' ISCHCV = 0 ou 1 (SOLU or CD )',/,&
+' ISSTPC = 0 ou 1 (1: no slope test )',/,&
+' BLENCV = [0.;1.] (1-upwind proportion )',/,&
+' THETAV = [0.;1.] (0.5 Crank-Nicolson/AB )',/,&
+' (theta for convection- )',/,&
+' (diffusion terms uses )',/,&
+' ((1-theta).old+theta.new )',/)
+
+ 4110 format( &
+ /,&
+' ** STOKES' ,/,&
+' ------' ,/,&
+' IPHYDR = ',4X,I10, ' (1: account for explicit' ,/,&
+' ',14X, ' balance between pressure' ,/,&
+' ',14X, ' gradient, gravity source' ,/,&
+' ',14X, ' terms, and head losses )',/,&
+' ICALHY = ',4X,I10, ' (1: compute hydrastatic' ,/, &
+' ',14X, ' pressure for Dirichlet' ,/,&
+' ',14X, ' conditions for pressure' ,/,&
+' ',14X, ' on outlet )',/,&
+' IPRCO = ',4X,I10, ' (1: pressure-continuity )',/,&
+' IPUCOU = ',4X,I10, ' (1: reinforced U-P coupling )',/,&
+' NTERUP = ',4X,I10, ' (n: n sweeps on navsto for' ,/,&
+' ',14X, ' velocity/pressure coupling )',/)
+ 4111 format( &
+' -- Phase: ',I10 ,/,&
+ /,&
+' IREVMC = ',4X,I10, ' (Velocity reconstruction mode)',/)
+ 4112 format( &
+' RELAXV = ', E14.5, ' for pressure (relaxation)' ,/,&
+' ARAK = ', E14.5, ' (Arakawa factor )',/)
+ 4113 format( &
+' ARAK = ', E14.5, ' (Arakawa factor )',/)
+ 4114 format( &
+' ISTMPF = ',4X,I10, ' (time scheme for flow' ,/,&
+' ',14X, ' (0: explicit (THETFL = 0 )',/,&
+' ',14X, ' (1: std scheme (Saturne 1.0 )',/,&
+' ',14X, ' (2: 2nd-order (THETFL = 0.5 )',/,&
+' THETFL = ', E14.5, ' (theta for mass flow )',/,&
+' IROEXT = ',4X,I10, ' (density extrapolation' ,/,&
+' ',14X, ' (0: explicit' ,/,&
+' ',14X, ' (1: n+thetro with thetro=1/2' ,/,&
+' ',14X, ' (2: n+thetro with thetro=1' ,/,&
+' THETRO = ', E14.5, ' (theta for density' ,/,&
+' ((1+theta).new-theta.old' ,/,&
+' IVIEXT = ',4X,I10, ' (total viscosity extrapolation',/,&
+' ',14X, ' (0: explicit' ,/,&
+' ',14X, ' (1: n+thetvi with thetro=1/2' ,/,&
+' ',14X, ' (2: n+thetvi with thetro=1' ,/,&
+' THETVI = ', E14.5, ' (theta for total viscosity' ,/,&
+' ((1+theta).new-theta.old' ,/,&
+' ICPEXT = ',4X,I10, ' (specific heat extrapolation' ,/,&
+' ',14X, ' (0: explicit' ,/,&
+' ',14X, ' (1: n+thetcp with thetro=1/2' ,/,&
+' ',14X, ' (2: n+thetcp with thetro=1' ,/,&
+' THETCP = ', E14.5, ' (specific heat theta-scheme' ,/,&
+' ((1+theta).new-theta.old' ,/,&
+' THETSN = ', E14.5, ' (Nav-Stokes S.T. theta scheme)',/,&
+' ((1+theta).new-theta.old' ,/,&
+' THETST = ', E14.5, ' (Turbulence S.T. theta-scheme)',/,&
+' ((1+theta).new-theta.old' ,/,&
+' EPSUP = ', E14.5, ' (Velocity/pressure coupling' ,/,&
+' ',14X, ' stop test )',/)
+
+#endif
+
+! --- Calcul des gradients
+
+write(nfecra,4500)
+
+write(nfecra,4510) imrgra, anomax
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,4520) chaine(1:8), &
+ nswrgr(ii),nswrsm(ii),epsrgr(ii),epsrsm(ii),extrag(ii)
+ endif
+enddo
+write(nfecra,4511)
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,4521) chaine(1:8), &
+ ircflu(ii),imligr(ii),climgr(ii)
+ endif
+enddo
+write(nfecra,4530)
+
+write(nfecra,9900)
+
+! --- Interpolation face des viscosites
+
+write(nfecra,4810) imvisf
+
+write(nfecra,9900)
+
+! --- Estimateurs d'erreurs pour Navier-Stokes
+
+iiesca = 0
+do iphas = 1, nphas
+ do iest = 1, nestmx
+ if(iescal(iest,iphas).gt.0) then
+ iiesca = 1
+ endif
+ enddo
+enddo
+
+if(iiesca.gt.0) then
+ write(nfecra,4820)
+ do iphas = 1, nphas
+ write(nfecra,4821)iphas
+ do iest = 1, nestmx
+ write(nfecra,4822)iest, iescal(iest,iphas)
+ enddo
+ write(nfecra,4823)
+ enddo
+ write(nfecra,4824)iespre,iesder,iescor,iestot
+ write(nfecra,9900)
+endif
+
+! --- Calcul de moyennes temporelles
+
+write(nfecra,4900) nbmomt
+if(nbmomt.gt.0) then
+ write(nfecra,4901)
+ do imom = 1, nbmomt
+ write(nfecra,4920)imom,imoold(imom), &
+ ntdmom(imom),(idfmom(jj,imom),jj=1,ndgmox)
+ enddo
+ write(nfecra,4930)
+endif
+write(nfecra,9900)
+
+
+! --- Calcul de la distance a la paroi
+
+if(ineedy.eq.1) then
+
+ write(nfecra,4950) icdpar
+ if(abs(icdpar).eq.1) then
+ write(nfecra,4951) &
+ nitmay, nswrsy, nswrgy, imligy, ircfly, ischcy, &
+ isstpy, imgrpy, iwarny, ntcmxy, &
+ blency, epsily, epsrsy, epsrgy, climgy, extray, coumxy, &
+ epscvy, yplmxy
+ endif
+ write(nfecra,9900)
+
+endif
+
+
+#if defined(_CS_LANG_FR)
+
+ 4500 format( &
+ /,&
+' ** CALCUL DES GRADIENTS' ,/,&
+' --------------------' ,/)
+ 4510 format( &
+' IMRGRA = ',4X,I10, ' (Mode de reconstruction )',/,&
+' ANOMAX = ',E14.5 , ' (Angle de non ortho. limite )',/,&
+' (pour moindres carres etendu )',/,&
+ /,&
+'-----------------------------------------------------------' ,/,&
+' Variable NSWRGR NSWRSM EPSRGR EPSRSM EXTRAG' ,/,&
+'-----------------------------------------------------------' )
+ 4520 format( &
+ 1x, a8, i7, i7, e12.4, e12.4, e12.4 )
+ 4511 format( &
+'----------------------------------------------------------- ',/,&
+ /,&
+'-----------------------------------' ,/,&
+' Variable IRCFLU IMLIGR CLIMGR' ,/,&
+'-----------------------------------' )
+ 4521 format( &
+ 1x, a8, i7, i7, e12.4 )
+ 4530 format( &
+'-----------------------------------' ,/,&
+ /,&
+' NSWRGR = (nb sweep reconstruction grad)',/,&
+' NSWRSM = (nb sweep reconstruction smb )',/,&
+' EPSRGR = (precision reconstruction gra)',/,&
+' EPSRSM = (precision reconstruction smb)',/,&
+' EXTRAG = [0.;1.] (extrapolation des gradients )',/,&
+' IRCFLU = 0 ou 1 (reconstruction des flux )',/,&
+' IMLIGR = < 0, 0 ou 1 (methode de limit. des grad )',/,&
+' CLIMGR = > 1 ou 1 (coef de limitation des grad )',/)
+
+ 4810 format( &
+ /,&
+' ** INTERPOLATION FACE' ,/,&
+' ------------------' ,/,&
+' IMVISF = ',4X,I10, ' (0 arithmetique )',/)
+
+ 4820 format( &
+ /,&
+' ** ESTIMATEURS D''ERREUR POUR NAVIER-STOKES' ,/,&
+' ----------------------------------------' ,/)
+ 4821 format( &
+' --- Phase : ',I10 ,/,&
+ /,&
+'----------------------------------------' ,/,&
+' Estimateur IESCAL (mode de calcul)' ,/,&
+'----------------------------------------' )
+ 4822 format( &
+ 1x, i10,2x, i10 )
+ 4823 format( &
+'----------------------------------------' )
+ 4824 format( &
+ /,&
+' Estimateurs possibles :' ,/,&
+' ',I2,' =IESPRE : prediction' ,/,&
+' L''estimateur est base sur la grandeur' ,/,&
+' I = rho_n (u*-u_n)/dt + rho_n u_n grad u*' ,/,&
+' - rho_n div (mu+mu_t)_n grad u* + grad P_n' ,/,&
+' - reste du smb(u_n, P_n, autres variables_n)' ,/,&
+! &' Idealement nul quand les methodes de reconstruction
+! &' sont parfaites et le systeme est resolu exactement
+' ',I2,' =IESDER : derive' ,/,&
+' L''estimateur est base sur la grandeur' ,/,&
+' I = div (flux de masse corrige apres etape' ,/,&
+' de pression)' ,/,&
+' Idealement nul quand l''equation de Poisson est' ,/,&
+' resolue exactement' ,/,&
+' ',I2,' =IESCOR : correction' ,/,&
+' L''estimateur est base sur la grandeur' ,/,&
+' I = div (rho_n u_(n+1))' ,/,&
+' Idealement nul quand l''equation de Poisson est' ,/,&
+' resolue exactement et que le passage des flux' ,/,&
+' de masse aux faces vers les vitesses au centre' ,/,&
+' se fait dans un espace de fonctions' ,/,&
+' a divergence nulle' ,/,&
+' ',I2,' =IESTOT : total' ,/,&
+' L''estimateur est base sur la grandeur' ,/,&
+' I = rho_n (u_(n+1)-u_n)/dt' ,/,&
+' + rho_n u_(n+1) grad u_(n+1)',/,&
+' - rho_n div (mu+mu_t)_n grad u_(n+1)' ,/,&
+' + gradP_(n+1)' ,/,&
+' - reste du smb(u_(n+1), P_(n+1),' ,/,&
+' autres variables_n)',/,&
+' Le flux du terme convectif est calcule a partir' ,/,&
+' de u_(n+1) pris au centre des cellules (et' ,/,&
+' non pas a partir du flux de masse aux faces' ,/,&
+' actualise)' ,/,&
+ /,&
+' On evalue l''estimateur selon les valeurs de IESCAL :' ,/,&
+' IESCAL = 0 : l''estimateur n''est pas calcule' ,/,&
+' IESCAL = 1 : l''estimateur est calcule,' ,/,&
+' sans contribution du volume (on prend abs(I))',/,&
+' IESCAL = 2 : l''estimateur est calcule,' ,/,&
+' avec contribution du volume ("norme L2")' ,/,&
+' soit abs(I)*SQRT(Volume_cellule),' ,/,&
+' sauf pour IESCOR : on calcule' ,/,&
+' abs(I)*Volume_cellule pour mesurer' ,/,&
+' un ecart en kg/s' ,/)
+
+ 4900 format( &
+ /,&
+' ** CALCUL DES MOYENNES TEMPORELLES (MOMENTS)' ,/,&
+' -----------------------------------------' ,/,&
+ /,&
+' NBMOMT = ',4X,I10, ' (Nombre de moments )' )
+ 4901 format( &
+ /,&
+'------------------------------------------------------' ,/,&
+' IMOM IMOOLD NDTMOM IDFMOM' ,/,&
+'------------------------------------------------------' )
+ 4920 format( &
+ 1x,i4, i7, i7,5(i7) )
+ 4930 format( &
+'------------------------------------------------------' ,/,&
+ /,&
+' IMOM = 0 ou > 0 (numero du moment )',/,&
+' IMOOLD =-1 ou > 0 (ancien moment correspondant )',/,&
+' ( en suite de calcul ou )',/,&
+' (-1 si le moment est )',/,&
+' ( reinitialise )',/,&
+' NDTMOM = 0 ou > 0 (numero du pas de temps de )',/,&
+' (debut de calcul du moment )',/,&
+' IDFMOM = 0 ou > 0 (numero des variables )',/,&
+' (composant le moment )',/)
+
+ 4950 format( &
+ /,&
+' ** CALCUL DE LA DISTANCE A LA PAROI' ,/,&
+' --------------------------------' ,/,&
+ /,&
+' ICDPAR = ',4X,I10, ' ( 1: std et relu si suite',/,&
+' (-1: std et recalcule si suite',/,&
+' ( 2: old et relu si suite',/,&
+' (-2: old et recalcule si suite',/)
+4951 format( &
+ /,&
+' NITMAY = ',4X,I10, ' (Nb iter pour resolution iter.',/,&
+' NSWRSY = ',4X,I10, ' (Nb iter pour reconstr. smb. )',/,&
+' NSWRGY = ',4X,I10, ' (Nb iter pour reconstr. grd. )',/,&
+' IMLIGY = ',4X,I10, ' (Methode de limitation grd. )',/,&
+' IRCFLY = ',4X,I10, ' (Reconst. flux conv. diff. )',/,&
+' ISCHCY = ',4X,I10, ' (Schema convectif )',/,&
+' ISSTPY = ',4X,I10, ' (Utilisation test de pente )',/,&
+' IMGRPY = ',4X,I10, ' (Algorithme multigrille )',/,&
+' IWARNY = ',4X,I10, ' (Niveau d''impression )',/,&
+' NTCMXY = ',4X,I10, ' (Nb iter pour convection stat.',/,&
+ /,&
+' BLENCY = ',E14.5 , ' (Prop. ordre 2 schema convect.',/,&
+' EPSILY = ',E14.5 , ' (Precision solveur iteratif )',/,&
+' EPSRSY = ',E14.5 , ' (Precision reconst. smb. )',/,&
+' EPSRGY = ',E14.5 , ' (Precision reconst. grd. )',/,&
+' CLIMGY = ',E14.5 , ' (Coeff. pour limitation grd. )',/,&
+' EXTRAY = ',E14.5 , ' (Coeff. pour extrapolation grd',/,&
+' COUMXY = ',E14.5 , ' (Courant max pour convection )',/,&
+' EPSCVY = ',E14.5 , ' (Precision pour convect. stat.',/,&
+' YPLMXY = ',E14.5 , ' (y+ max avec influence amort.)',/)
+
+#else
+
+ 4500 format( &
+ /,&
+' ** GRADIENTS CALCULATION' ,/,&
+' ---------------------' ,/)
+ 4510 format( &
+' IMRGRA = ',4X,I10, ' (Reconstruction mode )',/,&
+' ANOMAX = ',E14.5 , ' (Non-ortho angle: limit for )',/,&
+' (least squares ext. neighbors)',/,&
+ /,&
+'-----------------------------------------------------------' ,/,&
+' Variable NSWRGR NSWRSM EPSRGR EPSRSM EXTRAG' ,/,&
+'-----------------------------------------------------------' )
+ 4520 format( &
+ 1x, a8, i7, i7, e12.4, e12.4, e12.4 )
+ 4511 format( &
+'----------------------------------------------------------- ',/,&
+ /,&
+'-----------------------------------' ,/,&
+' Variable IRCFLU IMLIGR CLIMGR' ,/,&
+'-----------------------------------' )
+ 4521 format( &
+ 1x, a8, i7, i7, e12.4 )
+ 4530 format( &
+'-----------------------------------' ,/,&
+ /,&
+' NSWRGR = (nb sweep gradient reconstr. )',/,&
+' NSWRSM = (nb sweep rhs reconstrcution )',/,&
+' EPSRGR = (grad. reconstruction prec. )',/,&
+' EPSRSM = (rhs reconstruction prec. )',/,&
+' EXTRAG = [0.;1.] (gradients extrapolation )',/,&
+' IRCFLU = 0 ou 1 (flow reconstruction )',/,&
+' IMLIGR = < 0, 0 ou 1 (gradient limitation method )',/,&
+' CLIMGR = > 1 ou 1 (gradient limitation coeff. )',/)
+
+ 4810 format( &
+ /,&
+' ** FACE INTERPOLATION' ,/,&
+' ------------------' ,/,&
+' IMVISF = ',4X,I10, ' (0 arithmetic )',/)
+
+ 4820 format( &
+ /,&
+' ** ERROR ESTIMATORS FOR NAVIER-STOKES' ,/,&
+' ----------------------------------' ,/)
+ 4821 format( &
+' --- Phase: ',I10 ,/,&
+ /,&
+'------------------------------------------' ,/,&
+' Estimateur IESCAL (calculation mode)' ,/,&
+'------------------------------------------' )
+ 4822 format( &
+ 1x, i10,2x, i10 )
+ 4823 format( &
+'----------------------------------------' )
+ 4824 format( &
+ /,&
+' Possible estimators:' ,/,&
+' ',I2,' =IESPRE: prediction' ,/,&
+' The estimatore is based on the quantity' ,/,&
+' I = rho_n (u*-u_n)/dt + rho_n u_n grad u*' ,/,&
+' - rho_n div (mu+mu_t)_n grad u* + grad P_n' ,/,&
+' - remainder of rhs(u_n, P_n, other variables_n)' ,&
+' ',I2,' =IESDER: drift' ,/,&
+' The estimator is based on quantity' ,/,&
+' I = div (mass flow corrected after pressure step)',/,&
+' Ideally zero when Poisson''s equation is' ,/,&
+' resolved exactly' ,/,&
+' ',I2,' =IESCOR: correction' ,/,&
+' The estimator is based on quantity' ,/,&
+' I = div (rho_n u_(n+1))' ,/,&
+' Ideally zero when Poisson''s equation is' ,/,&
+' resolved exactly and the passage from mass flow',/,&
+' at faces to velocity at cell centers is done' ,/,&
+' in a function space with zero divergence' ,/,&
+' ',I2,' =IESTOT: total' ,/,&
+' Estimator is based on the quantity' ,/,&
+' I = rho_n (u_(n+1)-u_n)/dt' ,/,&
+' + rho_n u_(n+1) grad u_(n+1)',/,&
+' - rho_n div (mu+mu_t)_n grad u_(n+1)' ,/,&
+' + gradP_(n+1)' ,/,&
+' - rmainder of rhs(u_(n+1), P_(n+1),' ,/,&
+' other variables_n)',/, &
+' The convective term flow is calculated from' ,/,&
+' u_(n+1) taken at the cell centers (and not' ,/,&
+' from the updated mass flow at faces)' ,/,&
+ /,&
+' We evaluate the estimator based on values of IESCAL:' ,/,&
+' IESCAL = 0: the estimator is not calculated' ,/,&
+' IESCAL = 1: the estimator is calculated, with no' ,/,&
+' contribution from the volume (we take abs(I))' ,/,&
+' IESCAL = 2: the estimator is calculated,' ,/,&
+' with contribution from the volume ("L2 norm")' ,/,&
+' that is abs(I)*SQRT(Cell_volume),' ,/,&
+' except for IESCOR: we calculate' ,/,&
+' abs(I)*Cell_volume to measure' ,/,&
+' a difference in kg/s' ,/)
+
+ 4900 format( &
+ /,&
+' ** CALCULATION OF TEMPORAL MEANS (MOMENTS)' ,/,&
+' ---------------------------------------' ,/,&
+ /,&
+' NBMOMT = ',4X,I10, ' (Number of moments )' )
+ 4901 format( &
+ /,&
+'------------------------------------------------------' ,/,&
+' IMOM IMOOLD NDTMOM IDFMOM' ,/,&
+'------------------------------------------------------' )
+ 4920 format( &
+ 1x,i4, i7, i7,5(i7) )
+ 4930 format( &
+'------------------------------------------------------' ,/,&
+ /,&
+' IMOM = 0 ou > 0 (moment number )',/,&
+' IMOOLD =-1 ou > 0 (old moment corresponding )',/,&
+' ( to calculation restart or )',/,&
+' (-1 if the moment is )',/,&
+' ( reinitialized )',/,&
+' NDTMOM = 0 ou > 0 (moment calculation starting )',/,&
+' (time step number )',/,&
+' IDFMOM = 0 ou > 0 (number of variables of )',/,&
+' (which the moment is composed)',/)
+
+ 4950 format( &
+ /,&
+' ** WALL DISTANCE COMPUTATION' ,/,&
+' -------------------------' ,/,&
+ /,&
+' ICDPAR = ',4X,I10, ' ( 1: std, reread if restart' ,/,&
+' (-1: std, recomputed if restrt',/,&
+' ( 2: old, reread if restart' ,/,&
+' (-2: old, recomputed if restrt',/)
+4951 format( &
+ /,&
+' NITMAY = ',4X,I10, ' (Nb iter for iter resolution )',/,&
+' NSWRSY = ',4X,I10, ' (Nb iter for rhs reconstr. )',/,&
+' NSWRGY = ',4X,I10, ' (Nb iter for grad. reconstr. )',/,&
+' IMLIGY = ',4X,I10, ' (Gradient limitation method )',/,&
+' IRCFLY = ',4X,I10, ' (Conv. Diff. flow reconstr. )',/,&
+' ISCHCY = ',4X,I10, ' (Convective scheme )',/,&
+' ISSTPY = ',4X,I10, ' (Slope tet use )',/,&
+' IMGRPY = ',4X,I10, ' (Multigrid algorithm )',/,&
+' IWARNY = ',4X,I10, ' (Verbosity level )',/,&
+' NTCMXY = ',4X,I10, ' (Nb iter for steady convect. )',/,&
+ /,&
+' BLENCY = ',E14.5 , ' (2nd order conv. scheme prop.)',/,&
+' EPSILY = ',E14.5 , ' (Iterative solver precision )',/,&
+' EPSRSY = ',E14.5 , ' (rhs reconstruction precision)',/,&
+' EPSRGY = ',E14.5 , ' (Gradient reconstr. precision)',/,&
+' CLIMGY = ',E14.5 , ' (Coeff. for grad. limitation )',/,&
+' EXTRAY = ',E14.5 , ' (Coeff. for grad. extrapolat.)',/,&
+' COUMXY = ',E14.5 , ' (Max CFL for convection )',/,&
+' EPSCVY = ',E14.5 , ' (Precision for steady conv. )',/,&
+' YPLMXY = ',E14.5 , ' (y+ max w. damping influence )',/)
+
+#endif
+
+
+!===============================================================================
+! 5. SOLVEURS
+!===============================================================================
+
+! --- Solveurs iteratifs de base
+
+write(nfecra,5010)
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,5020) chaine(1:8),iresol(ii), &
+ nitmax(ii),epsilo(ii),idircl(ii)
+ endif
+enddo
+write(nfecra,5030)
+
+write(nfecra,9900)
+
+
+! --- Multigrille
+
+write(nfecra,5510)ncegrm, ngrmax
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,5520) chaine(1:8), &
+ imgr(ii),ncymax(ii),nitmgf(ii)
+ endif
+enddo
+write(nfecra,5530)
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 5010 format( &
+ /,&
+' ** SOLVEURS ITERATIFS DE BASE' ,/,&
+' --------------------------' ,/,&
+ /,&
+'------------------------------------------' ,/,&
+' Variable IRESOL NITMAX EPSILO IDIRCL' ,/,&
+'------------------------------------------' )
+ 5020 format( &
+ 1x, a8, i7, i7, e12.4, i7 )
+ 5030 format( &
+'-----------------------------------' ,/,&
+ /,&
+' IRESOL = -1 (choix automatique du solveur)',/,&
+' IPOL*1000 + 0 (gradient conjugue )',/,&
+' 1 (jacobi )',/,&
+' IPOL*1000 + 2 (bigradient conjugue )',/,&
+' avec IPOL (degre du preconditionnement )',/,&
+' NITMAX = (nb d iterations max )',/,&
+' EPSILO = (precision resolution )',/,&
+' IDIRCL = 0 ou 1 (decalage de la diagonale si' ,/,&
+' ISTAT=0 et pas de Dirichlet )',/)
+
+ 5510 format( &
+ /,&
+' ** MULTIGRILLE' ,/,&
+' -----------' ,/,&
+ /,&
+' NCEGRM = ',4X,I10, ' (Nb cell max mail grossier )',/,&
+' NGRMAX = ',4X,I10, ' (Nb max de niveaux de mail )',/,&
+'------------------------------ ',/,&
+' Variable IMGR NCYMAX NITMGF ',/,&
+'------------------------------ ' )
+ 5520 format( &
+ 1x, a8, i7, i7, i7 )
+ 5530 format( &
+'------------------------------' ,/,&
+ /,&
+' IMGR = 0 ou 1 (1 : activation du mltgrd )',/,&
+' NCYMAX = (Nb max de cycles )',/,&
+' NITMGF = (Nb max d iter sur mail fin )',/)
+
+#else
+
+ 5010 format( &
+ /,&
+' ** BASE ITERATIVE SOLVERS' ,/,&
+' ----------------------' ,/,&
+ /,&
+'------------------------------------------' ,/,&
+' Variable IRESOL NITMAX EPSILO IDIRCL' ,/,&
+'------------------------------------------' )
+ 5020 format( &
+ 1x, a8, i7, i7, e12.4, i7 )
+ 5030 format( &
+'-----------------------------------' ,/,&
+ /,&
+' IRESOL = -1 (automatic solver choice )',/,&
+' IPOL*1000 + 0 (p conjuguate gradient )',/,&
+' 1 (Jacobi )',/,&
+' IPOL*1000 + 2 (bicgstab )',/,&
+' avec IPOL (preconditioning degree )',/,&
+' NITMAX = (max number of iterations )',/,&
+' EPSILO = (resolution precision )',/,&
+' IDIRCL = 0 ou 1 (shift diagonal if ' ,/,&
+' ISTAT=0 and no Dirichlet )',/)
+
+ 5510 format( &
+ /,&
+' ** MULTIGRID' ,/,&
+' ---------' ,/,&
+ /,&
+' NCEGRM = ',4X,I10, ' (Max nb cells coarsest grid )',/,&
+' NGRMAX = ',4X,I10, ' (Max numeber of levels )',/,&
+'------------------------------ ',/,&
+' Variable IMGR NCYMAX NITMGF ',/,&
+'------------------------------ ' )
+ 5520 format( &
+ 1x, a8, i7, i7, i7 )
+ 5530 format( &
+'------------------------------' ,/,&
+ /,&
+' IMGR = 0 ou 1 (1: multigrid activated )',/,&
+' NCYMAX = (Max number of cycles )',/,&
+' NITMGF = (Max nb iter on coarsest grid)',/)
+
+#endif
+
+!===============================================================================
+! 6. SCALAIRES
+!===============================================================================
+
+! --- Scalaires
+
+if(nscal.ge.1) then
+ write(nfecra,6000)
+ write(nfecra,6010)itbrrb
+ write(nfecra,6011)
+ do ii = 1, nscal
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,6021) chaine(1:8),ii,iphsca(ii),iscsth(ii), &
+ ivisls(ii),visls0(ii),sigmas(ii)
+ enddo
+ write(nfecra,6031)
+ write(nfecra,6012)
+ do ii = 1, nscal
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,6022) chaine(1:8),ii,iphsca(ii),iscavr(ii), &
+ rvarfl(ii)
+ enddo
+ write(nfecra,6032)
+ write(nfecra,6013)
+ do ii = 1, nscal
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,6023) chaine(1:8),ii,iphsca(ii),iclvfl(ii), &
+ scamin(ii),scamax(ii)
+ enddo
+ write(nfecra,6033)
+ write(nfecra,6030)
+ write(nfecra,6040)
+ do ii = 1, nscal
+ write(nfecra,6041) ii,thetss(ii),ivsext(ii),thetvs(ii)
+ enddo
+ write(nfecra,6042)
+
+ write(nfecra,9900)
+
+endif
+
+
+#if defined(_CS_LANG_FR)
+
+ 6000 format( &
+ /,&
+' ** SCALAIRES' ,/,&
+' ---------' ,/)
+ 6010 format( &
+' ITBRRB = ',4X,I10, ' (Reconstruction T ou H au brd)',/)
+ 6011 format( &
+'-------------------------------------------------------------',/,&
+' Variable Numero IPHSCA ISCSTH IVISLS VISLS0 SIGMAS',/,&
+'-------------------------------------------------------------' )
+ 6021 format( &
+ 1x, a8, i7, i7, i7, i7, e12.4, e12.4 )
+ 6031 format( &
+'-------------------------------------------------------------',/)
+ 6012 format( &
+'------------------------------------------' ,/,&
+' Variable Numero IPHSCA ISCAVR RVARFL' ,/,&
+'------------------------------------------' )
+ 6022 format( &
+ 1x, a8, i7, i7, i7, e12.4 )
+ 6032 format( &
+'------------------------------------------' ,/)
+ 6013 format( &
+'------------------------------------------------------' ,/,&
+' Variable Numero IPHSCA ICLVFL SCAMIN SCAMAX' ,/,&
+'------------------------------------------------------' )
+ 6023 format( &
+ 1x, a8, i7, i7, i7, e12.4, e12.4 )
+ 6033 format( &
+'------------------------------------------------------' ,/)
+ 6030 format( &
+'-------------------------------------------------------------',/,&
+ /,&
+' Le numero indique pour chaque scalaire le rang' ,/,&
+' dans la liste de tous les scalaires. Les scalaires' ,/,&
+' utilisateurs sont places en tete, de 1 a NSCAUS. Les',/,&
+' scalaires physique particuliere sont a la fin, de' ,/,&
+' NSCAUS+1 a NSCAPP+NSCAUS=NSCAL.' ,/,&
+ /,&
+' IPHSCA = (Phase porteuse )',/,&
+' ISCSTH = -1,0, 1 ou 2 (T (C), Passif, T (K) ou H )',/,&
+' IVISLS = 0 ou >0 (Viscosite constante ou non )',/,&
+' VISLS0 = >0 (Viscosite de reference )',/,&
+' SIGMAS = >0 (Schmidt )',/,&
+' ISCAVR = 0 ou >0 (Scalaire associe si variance)',/,&
+' RVARFL = >0 (Rf, cf dissipation variance )',/,&
+' ICLVFL = 0, 1 ou 2 (Mode de clipping variance )',/,&
+' SCAMIN = (Valeur min autorisee )',/,&
+' SCAMAX = (Valeur max autorisee )',/,&
+' Pour les variances, SCAMIN est ignore et SCAMAX n est',/,&
+' pris en compte que si ICLVFL = 2' ,/)
+ 6040 format( &
+'------------------------------------------------------' ,/,&
+' Scalaire THETSS IVSEXT THETVS' ,/,&
+'------------------------------------------------------' )
+ 6041 format( &
+ 1x, i10, e12.4, i10, e12.4 )
+ 6042 format( &
+'------------------------------------------------------' ,/,&
+ /,&
+' THETSS = (theta pour termes sources )',/,&
+' ((1+theta)nouveau-theta ancien',/,&
+' IVSEXT = (extrap. viscosite totale )',/,&
+' (0 : explicite )',/,&
+' (1 : n+thetvs avec thetvs=1/2' ,/,&
+' (2 : n+thetvs avec thetvs=1 )',/,&
+' THETVS = (theta pour diffusiv. scalaire',/,&
+' ((1+theta)nouveau-theta ancien',/)
+
+#else
+
+ 6000 format( &
+ /,&
+' ** SCALARS' ,/,&
+' -------' ,/)
+ 6010 format( &
+' ITBRRB = ',4X,I10, ' (T or H reconstruction at bdy)',/)
+ 6011 format( &
+'-------------------------------------------------------------',/,&
+' Variable Number IPHSCA ISCSTH IVISLS VISLS0 SIGMAS',/,&
+'-------------------------------------------------------------' )
+ 6021 format( &
+ 1x, a8, i7, i7, i7, i7, e12.4, e12.4 )
+ 6031 format( &
+'-------------------------------------------------------------',/)
+ 6012 format( &
+'------------------------------------------' ,/,&
+' Variable Number IPHSCA ISCAVR RVARFL' ,/,&
+'------------------------------------------' )
+ 6022 format( &
+ 1x, a8, i7, i7, i7, e12.4 )
+ 6032 format( &
+'------------------------------------------' ,/)
+ 6013 format( &
+'------------------------------------------------------' ,/,&
+' Variable Number IPHSCA ICLVFL SCAMIN SCAMAX' ,/,&
+'------------------------------------------------------' )
+ 6023 format( &
+ 1x, a8, i7, i7, i7, e12.4, e12.4 )
+ 6033 format( &
+'------------------------------------------------------' ,/)
+ 6030 format( &
+'-------------------------------------------------------------',/,&
+ /,&
+' For each scalar, the number indicates it''s rank' ,/,&
+' in the list of all scalars. User scalars are placed' ,/,&
+' first, from 1 to NSCAUS. Specific physics scalars' ,/,&
+' are placed at the end, from' ,/,&
+' NSCAUS+1 to NSCAPP+NSCAUS=NSCAL.' ,/,&
+ /,&
+' IPHSCA = (Carrier phase )',/,&
+' ISCSTH = -1,0, 1 ou 2 (T (C), Passive, T (K) or H )',/,&
+' IVISLS = 0 ou >0 (Viscosity: constant or not )',/,&
+' VISLS0 = >0 (Reference viscosity )',/,&
+' SIGMAS = >0 (Schmidt )',/,&
+' ISCAVR = 0 ou >0 (Associat. scalar if variance)',/,&
+' RVARFL = >0 (Rf, cf variance dissipation )',/,&
+' ICLVFL = 0, 1 ou 2 (Variance clipping mode )',/,&
+' SCAMIN = (Min authorized value )',/,&
+' SCAMAX = (Max authorized value )',/,&
+' For variances, SCAMIN is ignored and SCAMAX is used' ,/,&
+' only if ICLVFL = 2' ,/)
+ 6040 format( &
+'------------------------------------------------------' ,/,&
+' Scalar THETSS IVSEXT THETVS' ,/,&
+'------------------------------------------------------' )
+ 6041 format( &
+ 1x, i10, e12.4, i10, e12.4 )
+ 6042 format( &
+'------------------------------------------------------' ,/,&
+ /,&
+' THETSS = (theta for source terms )',/,&
+' ((1+theta).new-theta.old )',/,&
+' IVSEXT = (extrap. total viscosity )',/,&
+' (0: explicit )',/,&
+' (1: n+thetvs with thetvs=1/2 )',/,&
+' (2: n+thetvs with thetvs=1 )',/,&
+' THETVS = (theta for scalar diffusivity' ,/,&
+' ((1+theta).new-theta.old )',/)
+
+#endif
+
+!===============================================================================
+! 7. GESTION DU CALCUL
+!===============================================================================
+
+! --- Gestion du calcul
+
+write(nfecra,7000)
+
+! - Suite de calcul
+
+write(nfecra,7010) isuite, ileaux, iecaux
+if(isuite.eq.1.and.nscal.ge.1) then
+ write(nfecra,7020)
+ do ii = 1, nscal
+ ivar = isca(ii)
+ chaine=nomvar(ipprtp(ivar))
+ write(nfecra,7030) chaine(1:8),ii,iscold(ii)
+ enddo
+ write(nfecra,7040)
+endif
+
+! - Duree du calcul
+
+write(nfecra,7110) inpdt0,ntmabs
+
+! - Marge en temps CPU
+
+write(nfecra,7210) tmarus
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 7000 format( &
+' ',/,&
+' ** GESTION DU CALCUL ',/,&
+' ----------------- ',/)
+ 7010 format( &
+' --- Suite de calcul ',/,&
+' ISUITE = ',4X,I10, ' (1 : suite de calcul )',/,&
+' ILEAUX = ',4X,I10, ' (1 : lecture de suiamx aussi)',/,&
+' IECAUX = ',4X,I10, ' (1 : ecriture de suiavx aussi)',/,&
+' ',/,&
+' suiamx et suiavx sont les fichiers suite auxiliaires.)',/)
+ 7020 format( &
+' ISCOLD(I) : Dans le calcul precedent, numero du ',/,&
+' scalaire correspondant au scalaire I du ',/,&
+' calcul courant : ',/,&
+' ',/,&
+'--------------------------------------------------- ',/,&
+' Scalaire Numero <- Numero de l''ancien scalaire ',/,&
+'--------------------------------------------------- ' )
+ 7030 format( &
+ 1x, a8, i7, 7x, i7 )
+ 7040 format( &
+'--------------------------------------------------- ',/,&
+' ',/,&
+' La table precedente (ISCOLD) donne la correspondance des ',/,&
+' scalaires du calcul courant avec ceux du calcul ',/,&
+' precedent apres intervention eventuelle de l utilisateur',/,&
+' Il s''agit de numeros de 1 a NSCAL qui reperent le ',/,&
+' scalaire dans la liste de tous les scalaires ',/,&
+' utilisateur+physique particuliere. ',/,&
+' .-999 est la valeur par defaut si l utilisateur n est ',/,&
+' intervenu. Le numero des correspondant sera ',/,&
+' complete a la lecture du fichier suite, selon ',/,&
+' le nombre de scalaires disponibles, en utilisant ',/,&
+' la loi (nouveau scalaire ii <- ancien scalaire ii)',/,&
+' . 0 si l utilisateur souhaite que le scalaire du ',/,&
+' calcul courant n ait pas de correspondant (i.e. ',/,&
+' soit un nouveau scalaire). ',/,&
+' . n > 0 si l utilisateur souhaite que le scalaire du ',/,&
+' calcul courant ait pour correspondant le scalaire ',/,&
+' n du calcul precedent. ',/)
+ 7110 format( &
+' --- Duree du calcul ',/,&
+' La numerotation des pas de temps et la mesure du temps ',/,&
+' physique simule sont des valeurs absolues ',/,&
+' et non pas des valeurs relatives au calcul en cours. ',/,&
+' ',/,&
+' INPDT0 = ',4X,I10, ' (1 : calcul a zero pas de tps)',/,&
+' NTMABS = ',4X,I10, ' (Pas de tps final demande )',/)
+ 7210 format( &
+' --- Marge en temps CPU ',/,&
+' TMARUS = ', E14.5, ' (Marge CPU avant arret )',/)
+#else
+
+ 7000 format( &
+ /,&
+' ** CALCULATION MANAGEMENT' ,/,&
+' ----------------------' ,/)
+ 7010 format( &
+' --- Restarted calculation' ,/,&
+' ISUITE = ',4X,I10, ' (1: restarted calculuation )',/,&
+' ILEAUX = ',4X,I10, ' (1: also read suiamx )',/,&
+' IECAUX = ',4X,I10, ' (1: also write suiavx )',/,&
+ /,&
+' suiamx and suiavx are the auxiliary restart files.' ,/)
+ 7020 format( &
+' ISCOLD(I): In the previous calculation, number of' ,/,&
+' the scalar corresponding to scalar I in' ,/,&
+' the current calculation:' ,/,&
+ /,&
+'---------------------------------------------------' ,/,&
+' Scalar Number <- Old scalar number' ,/,&
+'---------------------------------------------------' )
+ 7030 format( &
+ 1x, a8, i7, 7x, i7 )
+ 7040 format( &
+'---------------------------------------------------' ,/,&
+ /,&
+' The preceding array (ISCOLD) defines the correspondance' ,/,&
+' of scalars in the current calculation with those of the' ,/,&
+' previous calculation after possible user intervention.' ,/,&
+' It consists of numbers 1 to NSCAL which locate the scalar' ,/,&
+' in the list of all user+specific physics scalars.' ,/,&
+' .-999 is the default value if the user has not' ,/,&
+' intervened. The correspondant''s numbers will' ,/,&
+' be completed when reading the restart file, based' ,/,&
+' on the number of available scalars, using the' ,/,&
+' rule (new scalar ii <- old scalar ii)' ,/,&
+' . 0 if the user does not want the scalar of the' ,/,&
+' current calculation to have a correspondant (i.e.' ,/,&
+' it is a new scalar).' ,/,&
+' . n > 0 if the user wants the scalar of the current' ,/,&
+' calculation to correspond to scalar n in the' ,/,&
+' previous calculation.' ,/)
+ 7110 format( &
+' --- Calculation time' ,/,&
+' The numbering of time steps and the measure of simulated',/,&
+' physical time are absolute values, and not values' ,/,&
+' relative to the current calculation.' ,/,&
+ /,&
+' INPDT0 = ',4X,I10, ' (1: 0 time step calcuation )',/,&
+' NTMABS = ',4X,I10, ' (Final time step required )',/)
+ 7210 format( &
+' --- CPU time margin' ,/,&
+' TMARUS = ', E14.5, ' (CPU time margin before stop )',/)
+
+#endif
+
+!===============================================================================
+! 8. ENTREES SORTIES
+!===============================================================================
+
+write(nfecra,7500)
+
+! - Fichier suite
+
+write(nfecra,7510) ntsuit
+
+! - Fichiers Ensight
+
+write(nfecra,7520) ntchr
+do ii = 2, nvppmx
+ if(ichrvr(ii).eq.1) then
+ name = nomvar(ii)
+ write(nfecra,7521) ii,name (1:16)
+ endif
+enddo
+write(nfecra,7522)
+
+! - Fichiers historiques
+
+write(nfecra,7530) nthist,ncapt,nthsav
+do ii = 2, nvppmx
+ if(ihisvr(ii,1).ne.0) then
+ name = nomvar(ii)
+ write(nfecra,7531) ii,name (1:16),ihisvr(ii,1)
+ endif
+enddo
+write(nfecra,7532)
+
+! - Fichiers listing
+
+write(nfecra,7540) ntlist
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ iwar = iwarni(ii)
+ else
+ iwar = -999
+ endif
+ if(ilisvr(ipp).eq.1) then
+ name = nomvar(ipp)
+ write(nfecra,7531) ipp,name (1:16),iwar
+ endif
+enddo
+write(nfecra,7532)
+
+! - Post-traitement automatique (bord)
+
+WRITE(NFECRA,7550) 'IPSTDV',IPSTDV, &
+ 'IPSTYP',IPSTYP, &
+ 'IPSTCL',IPSTCL, &
+ 'IPSTFT',IPSTFT, &
+ 'IPSTFO',IPSTFO, &
+ 'IPSTDV'
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 7500 format( &
+ /,&
+' ** ENTREES SORTIES' ,/,&
+' ---------------' ,/)
+ 7510 format( &
+' --- Fichier suite' ,/,&
+' NTSUIT = ',4X,I10, ' (Periode de sauvegarde)' ,/)
+ 7520 format( &
+' --- Fichiers EnSight, MED, ou CGNS' ,/,&
+' NTCHR = ',4X,I10, ' (Periode de sortie )' ,/,&
+ /,&
+' Numero Nom' )
+ 7521 format( &
+' ', I10,1X, A16 )
+ 7522 format( &
+' -- --' ,/)
+ 7530 format( &
+' --- Fichiers historiques' ,/,&
+' NTHIST = ',4X,I10, ' (Periode de sortie )' ,/,&
+' NCAPT = ',4X,I10, ' (Nombre de capteurs )' ,/,&
+' NTHSAV = ',4X,I10, ' (Periode de sauvegarde)' ,/,&
+ /,&
+' Numero Nom Nb. sondes (-1 : toutes)' )
+ 7531 format( &
+' ', I10,1X, A16,6X, I10 )
+ 7532 format( &
+' -- -- --' ,/)
+ 7540 format( &
+' --- Fichiers listing' ,/,&
+' NTLIST = ',4X,I10, ' (Periode de sortie )' ,/,&
+ /,&
+' Numero Nom Niveau d''impression IWARNI',/,&
+' (-999 : non applicable)',/)
+ 7550 format( &
+' --- Variables supplementaires en post-traitement' ,/,&
+' ',A6,' = ',4X,I10, ' (Produit des valeurs suivantes',/,&
+' selon activation ou non' ,/,&
+' ',A6,' = ',4X,I10, ' (Yplus au bord' ,/,&
+' ',A6,' = ',4X,I10, ' (Variables au bord' ,/,&
+' ',A6,' = ',4X,I10, ' (Flux thermique au bord' ,/,&
+' ',A6,' = ',4X,I10, ' (Force exercee au bord' ,/,&
+' et ',A6,' = 1 (Pas de sortie supplementaire' ,/)
+
+#else
+
+ 7500 format( &
+ /,&
+' ** INPUT-OUTPUT' ,/,&
+' ------------' ,/)
+ 7510 format( &
+' --- Restart file' ,/,&
+' NTSUIT = ',4X,I10, ' (Checkpoint frequency )' ,/)
+ 7520 format( &
+' --- EnSight, MED, or CGNS output' ,/,&
+' NTCHR = ',4X,I10, ' (Output frequency )' ,/,&
+ /,&
+' Number Name' )
+ 7521 format( &
+' ', I10,1X, A16 )
+ 7522 format( &
+' -- --' ,/)
+ 7530 format( &
+' --- Probe history files' ,/,&
+' NTHIST = ',4X,I10, ' (Output frequency )' ,/,&
+' NCAPT = ',4X,I10, ' (Number of probes )' ,/,&
+' NTHSAV = ',4X,I10, ' (Checkpoint frequency )' ,/,&
+ /,&
+' Number Name Nb. probes (-1: all)' )
+ 7531 format( &
+' ', I10,1X, A16,6X, I10 )
+ 7532 format( &
+' -- -- --' ,/)
+ 7540 format( &
+' --- Log files' ,/,&
+' NTLIST = ',4X,I10, ' (Output frequency )' ,/,&
+ /,&
+' Number Name IWARNI verbosity level' ,/,&
+' (-999: not applicable)' ,/)
+ 7550 format( &
+' --- Additional post-processing variables' ,/,&
+' ',A6,' = ',4X,I10, ' (Product of the following ',/,&
+' values based on activation )',/,&
+' ',A6,' = ',4X,I10, ' (Yplus on boundary )',/,&
+' ',A6,' = ',4X,I10, ' (Variables on boundary )',/,&
+' ',A6,' = ',4X,I10, ' (Thermal flow on boundary )',/,&
+' ',A6,' = ',4X,I10, ' (Force exerted on boundary )',/,&
+' and ',A6,' = 1 (No additional output )',/)
+
+#endif
+
+!===============================================================================
+! 9. FICHIERS
+!===============================================================================
+
+! --- Fichiers
+
+write(nfecra,7600)
+write(nfecra,7610)ficgeo,ficamo,ficamx,ficstp, &
+ impgeo,impstp
+write(nfecra,7611)ficava,ficavx
+write(nfecra,7612)ficfpp,ficamr,ficjnf,ficavr, &
+ impfpp, impjnf
+write(nfecra,7613)ficaml, ficmls, ficavl, ficvls, ficlal, &
+ implal, impli1, impli2
+
+! Autres fichiers lagrangien
+write(nfecra,7615) impla1,impla2,impla3,impla4,impla5(1), &
+ impla5(2),impla5(3),impla5(4), &
+ impla5(5),impla5(6),impla5(7), &
+ impla5(8),impla5(9),impla5(10), &
+ impla5(11),impla5(12),impla5(13), &
+ impla5(14),impla5(15)
+
+! Fichiers hist
+write(nfecra,7620)(imphis(ii),ii=1,2 )
+
+write(nfecra,7630) nushmx
+write(nfecra,7631)(ficush(ii),ii=1,nushmx)
+write(nfecra,7632)(impush(ii),ii=1,nushmx)
+
+
+! Fichiers utilisateurs
+write(nfecra,7640) nusrmx
+write(nfecra,7631)(ficusr(ii),ii=1,nusrmx)
+write(nfecra,7632)(impusr(ii),ii=1,nusrmx)
+
+write(nfecra,7650) ifoenv
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 7600 format( &
+ /,&
+' ** FICHIERS' ,/,&
+' --------' ,/)
+ 7610 format( &
+' --- Fichiers standard' ,/,&
+ /,&
+' GEOMETRIE AMONT PPAL AMONT AUX STOP' ,/,&
+'Nom ', 4(5X,A6) ,/,&
+'Unite ', I11, 11X, 11X, I11 ,/)
+ 7611 format( &
+' AVAL PPAL AVAL AUX' ,/,&
+'Nom ', 2(5X,A6) ,/)
+ 7612 format( &
+' --- Fichiers rayonnement' ,/,&
+ /,&
+' DONNEES AMONT JANAF AVAL' ,/,&
+'Nom ', 4(3X,A6) ,/,&
+'Unite ', I9, 9X, I9 ,/)
+ 7613 format( &
+' --- Fichiers Lagrangiens' ,/,&
+ /,&
+' ---- AMONT ---- ---- AVAL ----- ---- POST ----',/,&
+' CALCUL STAT. CALCUL STAT. LISTING HISTO',/,&
+'Nom ', 2(3X,A6), 1X, 2(3X,A6), 4X, A6 ,/,&
+'Unite ', 18X , 1X, 18X, 6X, 3 I4 ,/)
+ 7615 format( &
+' --- Autres fichiers pour le module Lagrangien' ,/,&
+ /,&
+'Unite ', 5I9 ,/,&
+' ', 5I9 ,/,&
+' ', 5I9 ,/,&
+' ', 4I9 ,/)
+
+ 7620 format( &
+' --- Fichiers developpeurs pour historiques' ,/,&
+' IMPHIS(1) IMPHIS(2)' ,/,&
+'Unite ', 2(9X,I9) ,/)
+ 7630 format( &
+' --- Fichiers utilisateurs pour historiques' ,/,&
+' ',I10 ,' fichiers' ,/,&
+' Nom et unite' )
+ 7631 format( &
+ 6(3x,a6) )
+ 7632 format( &
+ 6i9 )
+ 7640 format( &
+ /,&
+' --- Fichiers utilisateurs libres' ,/,&
+' ',I10 ,' fichiers' ,/,&
+' Nom et unite' )
+ 7650 format( &
+ /,&
+' --- Fichiers preprocesseur' ,/,&
+' Format : 1=Lecture du fichier preprocessor_output' ,/,&
+' 0=Solveur autonome' ,/,&
+ /,&
+' Format ',I10 ,/)
+
+#else
+
+ 7600 format( &
+ /,&
+' ** FILES' ,/,&
+' -----' ,/)
+ 7610 format( &
+' --- Standard files' ,/,&
+ /,&
+' GEOMETRY MAIN RESTART AUX RESTART STOP' ,/,&
+'Name ', 4(5X,A6) ,/,&
+'Unit ', I11, 11X, 11X, I11 ,/)
+ 7611 format( &
+' MAIN CHECKPOINT AUX CHECKPOINT' ,/,&
+'Name ', 2(5X,A6) ,/)
+ 7612 format( &
+' --- Radiative files' ,/,&
+ /,&
+' DATA RESTART JANAF CHECKPOINT' ,/,&
+'Name ', 4(3X,A6) ,/,&
+'Unit ', I9, 9X, I9 ,/)
+ 7613 format( &
+' --- Lagrangian files' ,/,&
+ /,&
+' --- RESTART --- -- CHECKPOINT - ---- POST ----',/,&
+' CALCUL. STAT. CALCUL. STAT. LOG HIST.',/,&
+'Name ', 2(3X,A6), 1X, 2(3X,A6), 4X, A6 ,/,&
+'Unit ', 18X , 1X, 18X, 6X, 3 I4 ,/)
+ 7615 format( &
+' --- Other files for Lagrangian module' ,/,&
+ /,&
+'Unit ', 5I9 ,/,&
+' ', 5I9 ,/,&
+' ', 5I9 ,/,&
+' ', 4I9 ,/)
+
+ 7620 format( &
+' --- Developper files for probe history' ,/,&
+' IMPHIS(1) IMPHIS(2)' ,/,&
+'Unit ', 2(9X,I9) ,/)
+ 7630 format( &
+' --- User files for probe history' ,/,&
+' ',I10 ,' files' ,/,&
+' Name and unit' )
+ 7631 format( &
+ 6(3x,a6) )
+ 7632 format( &
+ 6i9 )
+ 7640 format( &
+ /,&
+' --- Free user files' ,/,&
+' ',I10 ,' files' ,/,&
+' Name and unit' )
+ 7650 format( &
+ /,&
+' --- Preprocessor files' ,/,&
+' Format: 1=Read preprocessor_output file' ,/,&
+' 0=Standalone solver' ,/,&
+ /,&
+' Format ',I10 ,/)
+
+#endif
+
+
+!===============================================================================
+! 10. COUPLAGES
+!===============================================================================
+
+
+! --- Couplage SYRTHES
+
+! RECUPERATION DU NOMBRE DE CAS DE COUPLAGE
+
+call nbcsyr (nbccou)
+!==========
+
+if (nbccou .ge. 1) then
+
+ write (nfecra, 8000)
+ write (nfecra, 8010) nbccou
+
+ write(nfecra,8030)
+ do ii = 1, nscal
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,8031) chaine(1:8),ii,icpsyr(ii)
+ enddo
+ write(nfecra,8032)
+
+ write(nfecra,9900)
+
+endif
+
+
+#if defined(_CS_LANG_FR)
+
+ 8000 format( &
+ /,&
+' ** COUPLAGE SYRTHES' ,/,&
+' ----------------' ,/)
+ 8010 format( &
+' NBCCOU = ',4X,I10, ' (Nombre de couplages )',/)
+ 8030 format( &
+ /,&
+' -- Scalaires couples' ,/,&
+'-----------------------' ,/,&
+' Scalaire Numero ICPSYR' ,/,&
+'-----------------------' )
+ 8031 format( &
+ 1x, a8, i7, i7 )
+ 8032 format( &
+'-----------------------' ,/,&
+ /,&
+' ICPSYR = 0 ou 1 (1 : scalaire couple SYRTHES )',/)
+
+#else
+
+ 8000 format( &
+ /,&
+' ** SYRTHES COUPLING' ,/,&
+' ----------------' ,/)
+ 8010 format( &
+' NBCCOU = ',4X,I10, ' (Number of couplings )',/)
+ 8030 format( &
+ /,&
+' -- Coupled scalars' ,/,&
+'-----------------------' ,/,&
+' Scalar Number ICPSYR' ,/,&
+'-----------------------' )
+ 8031 format( &
+ 1x, a8, i7, i7 )
+ 8032 format( &
+'-----------------------' ,/,&
+ /,&
+' ICPSYR = 0 or 1 (1: scalar coupled to SYRTHES)',/)
+
+#endif
+
+!===============================================================================
+! 11. Lagrangien
+!===============================================================================
+
+! --- Lagrangien
+
+if (iilagr.ne.0) then
+ write(nfecra,8100) ilphas, iilagr, isuila, isuist, iphyla
+
+ if (iphyla.eq.1) then
+ write(nfecra,8105) idpvar, itpvar, impvar
+ endif
+
+ write(nfecra,8106) nbpmax, nvls, isttio, injcon, iroule
+
+ if (iphyla.eq.2) then
+ write(nfecra,8111) iencra
+ do ii = 1 , ncharb
+ write(nfecra,8112) ii, tprenc(ii), ii
+ enddo
+ do ii = 1 , ncharb
+ write(nfecra,8113) ii, visref(ii), ii
+ enddo
+ endif
+
+ if (iilagr.eq.2) then
+ write(nfecra,8120) nstits, ltsdyn, ltsmas, ltsthe
+ endif
+
+ write(nfecra,8130) istala
+ if (istala.eq.1) then
+ write(nfecra,8135) seuil, idstnt, nstist, nvlsts
+ endif
+
+ write(nfecra,8140) idistu, idiffl, modcpl
+
+ if (modcpl.gt.0) write(nfecra,8141) idirla
+
+ write(nfecra,8142) nordre, ilapoi
+
+ write(nfecra,8150) iensi1, iensi2
+ if (iensi1.eq.1 .or. iensi2.eq.1) then
+ write(nfecra,8155) nbvis, nvisla, ivisv1, ivisv2, &
+ ivistp, ivisdm, iviste, ivismp
+ if (iphyla.eq.2) then
+ write(nfecra,8156) ivishp, ivisdk, ivisch, ivisck
+ endif
+ endif
+
+ write(nfecra,8160) iensi3
+ if (iensi3.eq.1) then
+ write(nfecra,8165) seuilf, nstbor, &
+ inbrbd, iflmbd, iangbd, ivitbd, iencbd, nusbor
+ endif
+
+ write(nfecra,9900)
+
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 8100 format( &
+ /,&
+' ** ECOULEMENT DIPHASIQUE LAGRANGIEN' ,/,&
+' --------------------------------' ,/,&
+' --- Numero de la phase continue : ',I10 ,/,&
+' IILAGR = ',4X,I10, ' (0 : Lagrangien desactive ',/,&
+' ',14X, ' 1 : one way coupling ',/,&
+' ',14X, ' 2 : two way coupling ',/,&
+' ',14X, ' 3 : sur champs figes )',/,&
+' ISUILA = ',4X,I10, ' (0 : pas de suite ; 1 : suite)',/,&
+' ISUIST = ',4X,I10, ' (1 : suite de calcul stats et' ,/,&
+' ',14X, ' TS de couplage retour )',/,&
+' --- Physique particuliere associee aux particules :' ,/,&
+' IPHYLA = ',4X,I10, ' (0 : pas d eqn supplementaires',/,&
+' ',14X, ' 1 : eqns sur Dp Tp Mp ',/,&
+' ',14X, ' 2 : particules de charbon )' )
+ 8105 format( &
+' IDPVAR = ',4X,I10, ' (1 eqn diametre Dp, 0 sinon)',/,&
+' ITPVAR = ',4X,I10, ' (1 eqn temperature Tp,0 sinon)',/,&
+' IMPVAR = ',4X,I10, ' (1 eqn masse Mp, 0 sinon)' )
+ 8106 format( &
+' --- Parametres Globaux : ',/,&
+' NBPMAX = ',4X,I10, ' (nb max de part par iteration)',/,&
+' NVLS = ',4X,I10, ' (nb var particulaires suppl. )',/,&
+' ISTTIO = ',4X,I10, ' (1 phase porteuse stationnair)',/,&
+' INJCON = ',4X,I10, ' (1 injection continue,0 sinon)',/,&
+' IROULE = ',4X,I10, ' (2 clonage/fusion avec calc Y+',/,&
+' 1 clonage/fusion sans calc Y+',/,&
+' 0 sinon )' )
+
+ 8111 format( &
+' --- Options Charbon :' ,/,&
+' IENCRA = ',4X,I10, ' (1 : encrassement si charbon )' )
+
+ 8112 format( &
+' TPRENC(',I1,') = ', E11.5, &
+ ' (temp seuil pour encrassement' ,/,&
+' ',14X, ' charbon ',I1,8X,' )' )
+
+ 8113 format( &
+' VISREF(',I1,') = ', E11.5, &
+ ' (viscosite critique charbon ',I1,')' )
+
+ 8120 format( &
+' --- Options Couplage Retour :' ,/,&
+' NSTITS = ',4X,I10, ' (iter de debut moy. en temps )',/,&
+' LTSDYN = ',4X,I10, ' (1 couplage retour dynamique )',/,&
+' LTSMAS = ',4X,I10, ' (1 couplage retour massique )',/,&
+' LTSTHE = ',4X,I10, ' (1 couplage retour thermique )' )
+
+ 8130 format( &
+' --- Options Statistiques :' ,/,&
+' ISTALA = ',4X,I10, ' (1 : calcul de statistiques )' )
+
+ 8135 format( &
+' SEUIL = ', E14.5, ' (val min de prise en compte )',/,&
+' IDSTNT = ',4X,I10, ' (iter de debut de calcul stat)',/,&
+' NSTIST = ',4X,I10, ' (iter de debut moy. en temps )',/,&
+' NVLSTS = ',4X,I10, ' (nb var statistiques suppl. )' )
+
+ 8140 format( &
+' --- Options Dispersion Turbulente : ',/,&
+' IDISTU = ',4X,I10, ' (1 : prise en compte; 0 sinon)',/,&
+' IDIFFL = ',4X,I10, ' (1 dispersion =diffusion turb)',/,&
+' MODCPL = ',4X,I10, ' (iter lag debut model complet)' )
+ 8141 format( &
+' IDIRLA = ',4X,I10, ' (1 2 ou 3 : dir principal ect)' )
+ 8142 format( &
+' --- Options Numeriques : ',/,&
+' NORDRE = ',4X,I10, ' (1 ou 2 ordre schema en temps)',/,&
+' ILAPOI = ',4X,I10, ' (1 corr. vit instantannees )' )
+
+ 8150 format( &
+' --- Options Postprocessing Trajectoires/Deplacement :' ,/,&
+' IENSI1 = ',4X,I10, ' (1 : post mode trajectoires )',/,&
+' IENSI2 = ',4X,I10, ' (1 : post mode deplacements )' )
+
+ 8155 format( &
+' NBVIS = ',4X,I10, ' (nb part max visualisables )',/,&
+' NVISLA = ',4X,I10, ' (periode d acquisition, 0 non)',/,&
+' IVISV1 = ',4X,I10, ' (1 : vitesse fluide vu, 0 non)',/,&
+' IVISV2 = ',4X,I10, ' (1 : vitesse particule, 0 non)',/,&
+' IVISTP = ',4X,I10, ' (1 : temps de sejour , 0 non)',/,&
+' IVISDM = ',4X,I10, ' (1 : diametre part. , 0 non)',/,&
+' IVISTE = ',4X,I10, ' (1 : temperature part., 0 non)',/,&
+' IVISMP = ',4X,I10, ' (1 : masse particule , 0 non)' )
+
+ 8156 format( &
+' IVISHP = ',4X,I10, ' (1 : temp/enthal pour charbon)',/,&
+' IVISDK = ',4X,I10, ' (1 : diam coeur retrecissant )',/,&
+' IVISCH = ',4X,I10, ' (1 : masse de charbon actif )',/,&
+' IVISCK = ',4X,I10, ' (1 : masse de coke )' )
+
+ 8160 format( &
+' --- Options Stat des Interactions Particules/Frontieres :' ,/,&
+' IENSI3 = ',4X,I10, ' (1 calcul stat parietales )' )
+
+ 8165 format( &
+' SEUILF = ', E14.5, ' (val min de prise en compte )',/,&
+' NSTBOR = ',4X,I10, ' (iter de debut moy. en temps )',/,&
+' INBRBD = ',4X,I10, ' (1 : enr. nb d interactions )',/,&
+' IFLMBD = ',4X,I10, ' (1 : enr. flux de masse part.)',/,&
+' IANGBD = ',4X,I10, ' (1 : enr. angle d interaction)',/,&
+' IVITBD = ',4X,I10, ' (1 : enr. vitesse interaction)',/,&
+' IENCBD = ',4X,I10, ' (1 : masse de charbon encrass)',/,&
+' NUSBOR = ',4X,I10, ' (1 : enr. infos user suppl. )' )
+
+#else
+
+ 8100 format( &
+ /,&
+' ** TWO-PHASE LANGRANGIEN FLOW' ,/,&
+' --------------------------' ,/,&
+' --- Number of the continuous phase: ',I10 ,/,&
+' IILAGR = ',4X,I10, ' (0: Lagrangian deactivated ',/,&
+' ',14X, ' 1: one way coupling ',/,&
+' ',14X, ' 2: two way coupling ',/,&
+' ',14X, ' 3: on frozen fields )',/,&
+' ISUILA = ',4X,I10, ' (0: no restart; 1: restart )',/,&
+' ISUIST = ',4X,I10, ' (1: restart stats and return' ,/,&
+' ',14X, ' coupling ST )',/,&
+' --- Specific physics associated with particles:' ,/,&
+' IPHYLA = ',4X,I10, ' (0: no additional equations' ,/,&
+' ',14X, ' 1: equations on Dp Tp Mp' ,/,&
+' ',14X, ' 2: coal particles )' )
+ 8105 format( &
+' IDPVAR = ',4X,I10, ' (1 eqn diameter Dp, or 0)',/,&
+' ITPVAR = ',4X,I10, ' (1 eqn temperature Tp, or 0)',/,&
+' IMPVAR = ',4X,I10, ' (1 eqn mass Mp, or 0)' )
+ 8106 format( &
+' --- Global parameters: ',/,&
+' NBPMAX = ',4X,I10, ' (nb max parts per iteration )',/,&
+' NVLS = ',4X,I10, ' (nb add. suppl. variables )',/,&
+' ISTTIO = ',4X,I10, ' (1 steady carrier phase )',/,&
+' INJCON = ',4X,I10, ' (1 continuous injection, or 0)',/,&
+' IROULE = ',4X,I10, ' (2 clone/merge with Y+ calc' ,/,&
+' 1 clone/merge without Y+ calc',/,&
+' 0 otherwise )' )
+
+ 8111 format( &
+' --- Coal options:''''''''' ,/,&
+' IENCRA = ',4X,I10, ' (1: fouling if coal )' )
+
+ 8112 format( &
+' TPRENC(',I1,') = ', E11.5, &
+ ' (threshold temp. for coal' ,/,&
+' ',14X, ' fouling ',I1,8X,' )' )
+
+ 8113 format( &
+' VISREF(',I1,') = ', E11.5, &
+ ' (critical coal viscosity ',I1,')' )
+
+ 8120 format( &
+' --- Return coupling options:' ,/,&
+' NSTITS = ',4X,I10, ' (start iter for time average )',/,&
+' LTSDYN = ',4X,I10, ' (1 dynamic return coupling )',/,&
+' LTSMAS = ',4X,I10, ' (1 mass return coupling )',/,&
+' LTSTHE = ',4X,I10, ' (1 thermal return coupling )' )
+
+ 8130 format( &
+' --- Statistics options:' ,/,&
+' ISTALA = ',4X,I10, ' (1: compute statistics )' )
+
+ 8135 format( &
+' SEUIL = ', E14.5, ' (minimum value for handling )',/,&
+' IDSTNT = ',4X,I10, ' (start iter for stat calc )',/,&
+' NSTIST = ',4X,I10, ' (start iter for time avergage)',/,&
+' NVLSTS = ',4X,I10, ' (nb add statistics variables )' )
+
+ 8140 format( &
+' --- Turbulent dispersion options: ',/,&
+' IDISTU = ',4X,I10, ' (1: accounted for; 0 otherws.)',/,&
+' IDIFFL = ',4X,I10, ' (1 dispersion = turb diffus. )',/,&
+' MODCPL = ',4X,I10, ' (complete model lag start it.)' )
+ 8141 format( &
+' IDIRLA = ',4X,I10, ' (1 2 ou 3: main ect dir)' )
+ 8142 format( &
+' --- Numerical options: ',/,&
+' NORDRE = ',4X,I10, ' (1 or 2 time scheme order )',/,&
+' ILAPOI = ',4X,I10, ' (1 inst. velcity corr. )' )
+
+ 8150 format( &
+' --- Trajectory/displacement postprocessing options:' ,/,&
+' IENSI1 = ',4X,I10, ' (1: post trajectories mode )',/,&
+' IENSI2 = ',4X,I10, ' (1: post displcaments mode )' )
+
+ 8155 format( &
+' NBVIS = ',4X,I10, ' (max nb visualizatlbe parts )',/,&
+' NVISLA = ',4X,I10, ' (acquisition period, 0 none )',/,&
+' IVISV1 = ',4X,I10, ' (1: fluid velocity vu, 0 none)' ,/&
+' IVISV2 = ',4X,I10, ' (1: particle velocity, 0 none)',/,&
+' IVISTP = ',4X,I10, ' (1: resident time, 0 none)',/,&
+' IVISDM = ',4X,I10, ' (1: particle diameter, 0 none)',/,&
+' IVISTE = ',4X,I10, ' (1: part. temperature, 0 none)',/,&
+' IVISMP = ',4X,I10, ' (1: particle mass, 0 none)' )
+
+ 8156 format( &
+' IVISHP = ',4X,I10, ' (1: temp/enthalpy for coal )',/,&
+' IVISDK = ',4X,I10, ' (1: shrinking core diameter )',/,&
+' IVISCH = ',4X,I10, ' (1: active coal mass )',/,&
+' IVISCK = ',4X,I10, ' (1: coke mass )' )
+
+ 8160 format( &
+' --- Statistics options for particles/boundary interaction:' ,/,&
+' IENSI3 = ',4X,I10, ' (1 calculate wall stats )' )
+
+ 8165 format( &
+' SEUILF = ', E14.5, ' (minimul value for handlin )',/,&
+' NSTBOR = ',4X,I10, ' (start iter for time average )',/,&
+' INBRBD = ',4X,I10, ' (1: nb interactions rec. )',/,&
+' IFLMBD = ',4X,I10, ' (1: particle mass flow rec. )',/,&
+' IANGBD = ',4X,I10, ' (1: interaction angle rec. )',/,&
+' IVITBD = ',4X,I10, ' (1: interaction velocity rec.)',/,&
+' IENCBD = ',4X,I10, ' (1: fouling coal mass )',/,&
+' NUSBOR = ',4X,I10, ' (1: additional user info rec.)' )
+
+#endif
+
+!===============================================================================
+! 12. METHODE ALE
+!===============================================================================
+! --- Activation de la methode ALE
+
+write(nfecra,8210)
+write(nfecra,8220) iale, nalinf
+
+write(nfecra,9900)
+
+
+#if defined(_CS_LANG_FR)
+
+ 8210 format( &
+ /,&
+' ** METHODE ALE (MAILLAGE MOBILE)' ,/,&
+' ----------- ',/)
+ 8220 format( &
+' IALE = ',4X,I10, ' (1 : activee )',/ &
+' NALINF = ',4X,I10, ' (Iterations d''initialisation ',/ &
+' du fluide)',/)
+
+#else
+
+ 8210 format( &
+ /,&
+' ** ALE METHOD (MOVING MESH)' ,/,&
+' ----------- ',/)
+ 8220 format( &
+' IALE = ',4X,I10, ' (1: activated )',/ &
+' NALINF = ',4X,I10, ' (Fluid initialization' ,/ &
+' iterations)',/)
+
+#endif
+
+!===============================================================================
+! 13. FIN
+!===============================================================================
+
+return
+end
diff --git a/src/base/iniini.f90 b/src/base/iniini.f90
new file mode 100644
index 0000000..6f51e91
--- /dev/null
+++ b/src/base/iniini.f90
@@ -0,0 +1,1526 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine iniini
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INITIALISATION PAR DEFAUT DES COMMONS
+! AVANT DE PASSER LA MAIN A L'UTILISATEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+include "vector.h"
+include "albase.h"
+include "alstru.h"
+include "alaste.h"
+include "period.h"
+include "parall.h"
+include "mltgrd.h"
+include "ihmpre.h"
+include "matiss.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer ii, jj, ivar, iscal, iphas, iprop, iest, imom
+integer istr
+
+!===============================================================================
+
+!===============================================================================
+! 1. STOCKAGE DES ARGUMENTS ET IMPRESSIONS INITIALES
+!===============================================================================
+
+write(nfecra, 900)
+
+#if defined(_CS_LANG_FR)
+
+ 900 format(/, &
+'===============================================================',&
+/,/, &
+' PREPARATION DU CALCUL ',/,&
+' ===================== ',/,&
+ /,&
+ /,&
+' =========================================================== ',/,&
+ /,&
+ /)
+
+#else
+
+ 900 format(/, &
+'===============================================================',&
+/,/, &
+' CALCULATION PREPARATION' ,/,&
+' =======================' ,/,&
+ /,&
+ /,&
+' ===========================================================' ,/,&
+ /,&
+ /)
+
+#endif
+
+!===============================================================================
+! 2. ENTREES SORTIES entsor.h
+!===============================================================================
+
+! ---> Impressions standard
+! -10000 : non initialise : voir modini
+do ii = 1, nvarmx
+ iwarni(ii) = -10000
+enddo
+
+! ---> NFECRA vaut 6 par defaut ou 9 en parallele (CSINIT)
+
+! ---> Geometrie
+
+impgeo = 10
+FICGEO = 'geomet'
+
+! ---> Fichier amont
+
+FICAMO = 'suiamo'
+FICAMX = 'suiamx'
+
+! Module thermique 1D en paroi
+FICMT1 = 't1damo'
+
+! Module aerorefrigerants
+FICMCT = 'ctwamo'
+
+! Methode des vortex : on utilise la meme unite
+! Pour le fichier de donnees, on specifie l'unite ici, mais le
+! nom est laisse dans usvort. On utilise 20 et pas 11
+! car en cas d'entree multiple, les deux fichiers doivent etre
+! ouverts en meme temps dans VORINI
+impmvo = 11
+FICMVO = 'voramo'
+impdvo = 20
+
+! Rayonnement
+FICAMR = 'rayamo'
+
+! Lagrangien
+! Fichier suite calcul
+FICAML = 'lagamo'
+! Fichier suite statistique
+FICMLS = 'lasamo'
+
+! ---> Fichier stop
+
+impstp = 12
+FICSTP = 'ficstp'
+
+! ---> Fichier aval
+
+! NTSUIT : Periode de sauvegarde du fichier suite
+! (il est de toutes facons ecrit en fin de calcul)
+! -1 : a la fin seulement
+! 0 : par defaut (4 fois par calcul)
+! > 0 : periode
+
+
+FICAVA = 'suiava'
+FICAVX = 'suiavx'
+
+ntsuit = 0
+
+! Module thermique 1D en paroi
+FICVT1 = 't1dava'
+
+! Module aerorefrigerants
+FICVCT = 'ctwava'
+
+! Methode des vortex : on utilise la meme unite
+! et le format ascii obligatoirement
+! (pas de detection automatique, fichiers de taille faible)
+impvvo = 20
+FICVVO = 'vorava'
+
+! Rayonnement : on utilise la meme unite (pour le moment)
+! et le meme format (voir modini)
+FICAVR = 'rayava'
+
+! Lagrangien
+! Fichier suite calcul
+FICAVL = 'lagava'
+! Fichier suite statistique
+FICVLS = 'lasava'
+
+! Fichier listing Lagrangien
+
+implal = 80
+FICLAL = 'listla'
+ntlal = 1
+
+! Fichier historique Lagrangien
+
+impli1 = 81
+impli2 = 82
+
+
+! Post traitement
+
+! ICHRVL : Post traitement du domaine fluide
+! (1 oui, 0 non)
+! ICHRBO : Post traitement du bord du domaine
+! (1 oui, 0 non)
+! ICHRSY : Post traitement des zones couplees avec SYRTHES
+! (1 oui, 0 non)
+! ICHRZE: Post traitement des zones d'�change aerorefrigerants
+! (1 oui, 0 non)
+
+! ICHRMD : indique si les maillages ecrits seront :
+! 0 : fixes,
+! 1 : deformables a topologie constante,
+! 2 : modifiables (pourront etre completement redefinis en
+! cours de calcul via le sous-programme USMPST).
+! 10 : comme INDMOD = 0, avec champ de d�placement
+! 11 : comme INDMOD = 1, avec champ de d�placement
+! 12 : comme INDMOD = 2, avec champ de d�placement
+
+! NTCHR : Periode de sortie Post
+! -1 : une seule sortie a la fin
+! >0 : periode
+! ICHRVR : Variables a sortir
+! (1 oui, 0 non, sinon : non initialise)
+
+ichrvl = 1
+ichrbo = 0
+ichrsy = 0
+ichrze = 0
+
+ichrmd = 0
+ntchr = -1
+
+do ii = 1, nvppmx
+ ichrvr(ii ) = -999
+enddo
+
+! FMTCHR : format ('EnSight Gold', 'MED_fichier', ou 'CGNS')
+! OPTCHR : options associees au format de sortie
+
+FMTCHR = 'EnSight Gold'
+OPTCHR = 'binary'
+
+! ---> Fichier thermochinie
+! FPP : utilisateur
+! JNF : Janaf
+! Les deux fichiers peuvent partager la meme unite
+! puisqu'ils sont lus l'un a pres l'autre.
+! En prime, INDJON (janaf=1 ou non=0)
+
+impfpp = 25
+FICFPP = 'dp_tch'
+
+impjnf = impfpp
+FICJNF = 'JANAF'
+
+indjon = 1
+
+! ---> Fichiers module atmospherique
+impmet = 26
+FICMET = 'meteo'
+
+! ---> Fichier resuMatisse
+impmat = 28
+
+
+! ---> Fichiers historiques
+
+! IMPHIS : fichier stock + unite d'ecriture des variables
+! EMPHIS : EMPlacement
+! PREHIS : PREfixe
+! EXTHIS : EXTension
+! IMPUSH : Unite fichiers specifiques ushist
+! FICUSH : Nom fichiers specifiques ushist
+! IMPSTH : fichier stock + unite d'ecriture des variables
+! des structures mobiles
+
+imphis(1) = 30
+imphis(2) = 31
+impsth(1) = 32
+! Les fichiers d'ecriture ne sont pas ouverts en meme temps
+impsth(2) = imphis(2)
+
+emphis = './'
+prehis = 'probes_'
+exthis = 'dat'
+
+do ii = 1, nushmx
+ impush(ii) = 32+ii
+ if (irangp .le. 0) then
+ WRITE(FICUSH(II),'(1A3,I3.3)')'ush',II
+ else
+ WRITE(FICUSH(II),'(1A3,I3.3,1A3,I4.4)')'ush',II, &
+ '.n_',IRANGP+1
+ endif
+enddo
+
+! NCAPT : nombre de sondes total (limite a NCAPTM)
+! NTHIST : Periode de sortie
+! ( > 0 ou -1 (jamais))
+! NTHSAV : Periode de sauvegarde
+! ( > 0 ou -1 (a la fin) ou 0 (NTMABS/4))
+! IHISVR : nb de sonde et numero par variable
+! (-999 non initialise)
+! IHISTR : indicateur d'ecriture des historiques des structures
+! mobiles internes (=0 ou 1)
+! NCAPT : nombre de sondes total (limite a NCAPTM)
+! NODCAP : element correspondant aux sondes
+! NDRCAP : rang du processus contenant NODCAP (parallelisme)
+! XYZCAP : position demandee des sondes
+
+ncapt = 0
+
+nthist = 1
+nthsav = 0
+
+do ii = 1, nvppmx
+ do jj = 1, ncaptm+1
+ ihisvr(ii ,jj) = -999
+ enddo
+enddo
+
+ihistr = 0
+
+do ii = 1, ncaptm
+ nodcap(ii) = 1
+ ndrcap(ii) = -1
+enddo
+
+do ii = 1, ncaptm
+ xyzcap(1,ii) = 0.d0
+ xyzcap(2,ii) = 0.d0
+ xyzcap(3,ii) = 0.d0
+enddo
+
+
+
+! ---> Fichiers Lagrangiens
+
+! IMPLA1 : Unite fichier specifique Lagrangien
+! IMPLA2 : Unite fichier specifique Lagrangien
+! IMPLA3 : Unite fichier SCRATCH pour stockage temporaire
+! IMPLA4 : Unite fichier SCRATCH pour stockage temporaire
+! IMPLA5 : Unite d'ecriture des variables associees
+
+impla1 = 50
+impla2 = 51
+impla3 = 52
+impla4 = 53
+
+impla5(1) = 54
+impla5(2) = 55
+impla5(3) = 56
+impla5(4) = 57
+impla5(5) = 58
+impla5(6) = 59
+impla5(7) = 60
+impla5(8) = 61
+impla5(9) = 62
+impla5(10) = 63
+impla5(11) = 64
+impla5(12) = 65
+impla5(13) = 66
+impla5(14) = 67
+impla5(15) = 68
+
+! ---> Fichiers utilisateurs
+
+do ii = 1, nusrmx
+ impusr(ii) = 69+ii
+ if (irangp .le. 0) then
+ WRITE(FICUSR(II),'(1A4,I2.2)')'usrf',II
+ else
+ WRITE(FICUSR(II),'(1A4,I2.2,1A3,I4.4)')'usrf',II, &
+ '.n_',IRANGP+1
+ endif
+enddo
+
+! ---> Sorties listing
+
+! COMMUNES
+! IPP* : Pointeurs de reperage des variables pour les sorties
+! 1 pointe sur une case poubelle et constitue donc une
+! bonne initialisation
+! NOMVAR : Nom des variables
+! ILISVR : on suit la variable (1) ou non (0) ou non initialise
+! ITRSVR : numero de variable si IPP correspond a une variable resolue (p,u,k...)
+! 0 si IPP correspond a une variable annexe (cp, mut...)ou a rien
+! NTLIST : periode d'ecriture
+! ( -1 : dernier pas de temps : > 0 : periode)
+
+do ii = 1, nvarmx
+ ipprtp(ii) = 1
+enddo
+do ii = 1, npromx
+ ipppro(ii) = 1
+enddo
+ippdt = 1
+ipptx = 1
+ippty = 1
+ipptz = 1
+do ii = 1, nvppmx
+ ipp2ra(ii) = 0
+enddo
+
+do ii = 1, nvppmx
+ NOMVAR(II) = ' '
+ ilisvr(ii) = -999
+ itrsvr(ii) = 0
+enddo
+
+ntlist = 1
+
+! PARAMETRES DE SUIVI DE CALCUL, MIN-MAX, CLIPMIN, CLIPMAX
+
+do ii = 1, nvppmx
+ iclpmn(ii) = 0
+ iclpmx(ii) = 0
+enddo
+
+do ii = 1, nvppmx
+ varmin(ii) = 0.d0
+ varmax(ii) = 0.d0
+ varmna(ii) = 0.d0
+ varmxa(ii) = 0.d0
+enddo
+
+! PARAMETRES DE CONVERGENCE, NORME DU SECOND MEMBRE, NOMBRE ITERATIONS
+! RESIDU NORME, DERIVE
+do ii = 1, nvppmx
+ nbivar(ii) = 0
+enddo
+do ii = 1, nvppmx
+ rnsmbr(ii) = 0.d0
+ resvar(ii) = 0.d0
+ dervar(ii) = 0.d0
+enddo
+
+! PARAMETRES DU PAS DE TEMPS LOCAL
+
+do ii = 1, 8
+ do jj = 1, 4
+ ptploc(ii,jj) = 0.d0
+ enddo
+enddo
+
+
+! ---> Post traitement automatique (bord)
+
+if (ifoenv .eq. 0) then
+ ipstdv = 0
+else
+ ipstdv = ipstyp*ipstcl*ipstft*ipstfo
+endif
+
+
+! ---> CPU
+! TMARUS : marge (Arret du calcul avant limite CPU)
+! Si TMARUS negatif, le code calcule une marge seul
+! Sinon, il utilise TMARUS (donnee en secondes)
+
+tmarus = -1.d0
+
+
+! Ici entsor.h est completement initialise
+
+!===============================================================================
+! 3. DIMENSIONS DE dimens.h (GEOMETRIE, sauf NCELBR)
+!===============================================================================
+
+!---> GEOMETRIE
+
+!---> LECTURE SELON UTILISATION PREPROCESSEUR OU ANCIEN FICHIER
+
+ ndim = 0
+ ncel = 0
+ ncelet = 0
+ nfac = 0
+ nfabor = 0
+ nfml = 0
+ nprfml = 0
+ nnod = 0
+ lndfac = 0
+ lndfbr = 0
+ ncelbr = 0
+
+ ncelgb = 0
+ nfacgb = 0
+ nfbrgb = 0
+ nsomgb = 0
+
+! Par defaut, on suppose qu'il n'y a pas de periodicite
+ iperio = 0
+ iperot = 0
+
+if (ifoenv .eq. 0) then
+
+! NECESSITE FICGEO
+
+ call ledgeo &
+ !==========
+ ( ndim , ncelet , ncel , nfac , nfabor , &
+ nprfml , nfml , nnod , lndfac , lndfbr )
+
+
+! --- Pas de decoupage en parallele prevu sans preprocesseur.
+! NCELET=NCEL est fait dans ledgeo
+
+else if (ifoenv .eq. 1) then
+
+! --- PASSAGE DANS LEDEVI :
+! On ne lit ici que les dimensions.
+! Les tableaux seront lus apres allocation.
+! On initialise les dimensions a 0 avant la lecture, certaines
+! rubriques etant optionnelles.
+
+ call ledevi &
+ !==========
+ ( ndim , nfml , nprfml , iperio , iperot )
+
+endif
+
+
+!===============================================================================
+! 4. DIMENSIONS de dimens.h (PHYSIQUE)
+!===============================================================================
+
+! --- Nombre de phases, de scalaires, de scalaires a diffusivite
+! variable, de variables
+
+nphas = 0
+nscal = 0
+nscaus = 0
+nscapp = 0
+nvar = 0
+
+! --- Nombre de proprietes physiques (utile ?)
+
+nproce = 0
+nprofa = 0
+nprofb = 0
+nfluma = 0
+
+! --- Nombre de tableaux NFABOR de type COEFA (ou COEFB)
+
+ncofab = 0
+
+
+!===============================================================================
+! 5. POSITION DES VARIABLES DE numvar.h
+!===============================================================================
+
+! --- Variables de calcul resolues (RTP, RTPA)
+
+do iphas = 1, nphsmx
+ ipr (iphas) = 0
+ iu (iphas) = 0
+ iv (iphas) = 0
+ iw (iphas) = 0
+ ik (iphas) = 0
+ iep (iphas) = 0
+ ir11 (iphas) = 0
+ ir22 (iphas) = 0
+ ir33 (iphas) = 0
+ ir12 (iphas) = 0
+ ir13 (iphas) = 0
+ ir23 (iphas) = 0
+ iphi (iphas) = 0
+ ifb (iphas) = 0
+enddo
+
+do iscal = 1, nscamx
+ isca (iscal) = 0
+ iscapp(iscal) = 0
+enddo
+
+! --- Initialisation par defaut des commons pour la physique particuliere
+
+call ppinii
+!==========
+
+! --- Proprietes physiques au sens large (PROPCE, PROFA, PROPFB)
+
+do iprop = 1, npromx
+ ipproc(iprop) = 0
+ ipprof(iprop) = 0
+ ipprob(iprop) = 0
+enddo
+
+do iphas = 1, nphsmx
+ irom (iphas) = 0
+ iviscl(iphas) = 0
+ ivisct(iphas) = 0
+ icour (iphas) = 0
+ ifour (iphas) = 0
+ icp (iphas) = 0
+ iprtot(iphas) = 0
+enddo
+
+do iscal = 1, nscamx
+ ivisls(iscal) = -1
+enddo
+
+do ivar = 1, nvarmx
+ ifluma(ivar) = 0
+ ifluaa(ivar) = 0
+enddo
+
+! --- Conditions aux limites (COEFA, COEFB)
+
+icoef = 1
+icoeff = 2
+
+do ivar = 1, nvarmx
+ iclrtp(ivar,icoef ) = 0
+ iclrtp(ivar,icoeff) = 0
+enddo
+
+! --- Ici tout numvar est initialise.
+
+!===============================================================================
+! 6. POSITION DES VARIABLES DE pointe.h
+!===============================================================================
+
+! --- Geometrie
+
+iicelb = 0
+isrfan = 0
+isrfbn = 0
+idist = 0
+idistb = 0
+ipond = 0
+idijpf = 0
+idiipb = 0
+idofij = 0
+
+! --- Auxiliaires independants du nb phases
+
+icocg = 0
+icocgb = 0
+itpuco = 0
+idipar = 0
+iyppar = 0
+nfpt1d = 0
+nmxt1d = 0
+inppt1 = 0
+iifpt1 = 0
+iiclt1 = 0
+ieppt1 = 0
+irgpt1 = 0
+itppt1 = 0
+itept1 = 0
+ihept1 = 0
+ifept1 = 0
+ixlmt1 = 0
+ircpt1 = 0
+idtpt1 = 0
+
+! --- Autres auxiliaires dependant du nb de phases
+
+iitypf = 0
+iitrif = 0
+iisymp = 0
+
+do iphas = 1, nphsmx
+ iifapa(iphas) = 0
+ ncepdc(iphas) = 0
+ iicepd(iphas) = 0
+ ickupd(iphas) = 0
+ ncetsm(iphas) = 0
+ iicesm(iphas) = 0
+ iitpsm(iphas) = 0
+ ismace(iphas) = 0
+ is2kw (iphas) = 0
+ idvukw(iphas) = 0
+enddo
+
+! --- Auxiliaires pour la periodicite
+
+idudxy =0
+idrdxy =0
+iwdudx =0
+iwdrdx =0
+
+! --- Ici tout pointe.h est initialise
+
+!===============================================================================
+! 7. OPTIONS DU CALCUL : TABLEAUX DE optcal.h
+!===============================================================================
+
+! --- Definition des equations
+! (convection-diffusion instationnaire, avec dirichlet
+! sauf pour la pression, diffusion instationnaire)
+! IDIFFT en particulier multiplie la diffusion turbulente
+! (quand elle est activee par le modele)
+
+do ii = 1, nvarmx
+ iconv (ii) = 1
+ istat (ii) = 1
+ idiff (ii) = 1
+ idifft(ii) = 1
+enddo
+
+! --- Schema en temps
+
+! NOTER BIEN que les valeurs de THETA pour
+! rho, visc, cp, flux de masse, termes sources
+! sont renseignees a partir des indicateurs I..EXT et ISTMPF
+! Elles ne sont pas completees directement par l'utilisateur
+! Les tests dans l'algo portent sur ces indicateurs
+
+
+! -- Schema en temps (regroupera les options suivantes)
+! = 1 Standard ordre 1
+! = 2 Standard ordre 2
+! si on veut, on peut en rajouter.
+! Cette variable conditionne toutes les autres de maniere automatique,
+! pour definir des schemas coherents dans modini.
+do iphas = 1, nphsmx
+ ischtp(iphas) = -999
+enddo
+
+! -- Variables
+! Pour un schema centre (en n+1/2) il faut prendre theta = 0.5
+! On devrait pouvoir faire de l'explicite pur avec theta = 0 mais
+! ce point reste a voir
+! Ce theta sert aux termes de convection diffusion (partie implicitee
+! d'ordinaire)
+! Il est applique sous la forme (1-theta) ancien + theta nouveau
+! (ce n'est pas une extrapolation, contrairement aux termes sources)
+do ii = 1, nvarmx
+ thetav(ii) =-999.d0
+enddo
+
+do iphas = 1, nphsmx
+
+! -- Flux de masse (-999 = non initialise)
+! = 1 Standard d'ordre 1 (THETFL = -999 inutile)
+! = 0 Explicite (THETFL = 0)
+! = 2 Ordre deux (THETFL = 0.5)
+ istmpf(iphas) = -999
+ thetfl(iphas) =-999.d0
+
+! -- Termes sources Navier Stokes
+! Pour les termes sources explicites en std, I..EXT definit
+! l'extrapolation -theta ancien + (1+theta) nouveau
+! = 0 explicite
+! = 1 extrapolation avec theta = 1/2
+! = 2 extrapolation avec theta = 1
+! 0 implique pas de reservation de tableaux
+! 1 et 2 sont deux options equivalentes, la difference etant faite
+! uniquement au moment de fixer theta
+! Pour les termes sources implicites en std, I..EXT definit
+! la mise a l'ordre 2 ou non avec le thetav de la variable associee
+! = 0 implicite (std)
+! > 0 utilisation du thetav
+! Noter cpdt que le TS d'acc. masse n'est pas regi par I..EXT
+! (il suit bilsc2)
+ isno2t(iphas) = -999
+ thetsn(iphas) =-999.d0
+! -- Termes sources Grandeurs turbulentes
+! Pour les termes sources explicites en std, I..EXT definit
+! l'extrapolation -theta ancien + (1+theta) nouveau
+! = 0 explicite
+! = 1 extrapolation avec theta = 1/2
+! = 2 extrapolation avec theta = 1
+! 0 implique pas de reservation de tableaux
+! 1 et 2 sont deux options equivalentes, la difference etant faite
+! uniquement au moment de fixer theta
+! Pour les termes sources implicites en std, I..EXT definit
+! la mise a l'ordre 2 ou non avec le thetav de la variable associee
+! = 0 implicite (std)
+! > 0 utilisation du thetav
+! Noter cpdt que le TS d'acc. masse n'est pas regi par I..EXT
+! (il suit bilsc2)
+ isto2t(iphas) = -999
+ thetst(iphas) =-999.d0
+
+! -- Proprietes physiques
+! I..EXT definit l'extrapolation -theta ancien + (1+theta) nouveau
+! = 0 explicite
+! = 1 extrapolation avec theta = 1/2
+! = 2 extrapolation avec theta = 1
+! 0 implique pas de reservation de tableaux
+! 1 et 2 sont deux options equivalentes, la difference etant faite
+! uniquement au moment de fixer theta
+! INIT.. =1 indique que la variable a ete proprement initialisee (dans un
+! fichier suite portant les valeurs adaptees)
+
+! Masse volumique
+ iroext(iphas) = -999
+ thetro(iphas) = -999.d0
+ initro(iphas) = 0
+! Viscosite totale
+ iviext(iphas) = -999
+ thetvi(iphas) = -999.d0
+ initvi(iphas) = 0
+! Chaleur specifique
+ icpext(iphas) = -999
+ thetcp(iphas) = -999.d0
+ initcp(iphas) = 0
+
+! -- Convergence point fixe vitesse pression
+ epsup (iphas) = 1.d-5
+
+! -- Tab de travail pour normes de navsto
+ xnrmu0(iphas) = 0.d0
+ xnrmu (iphas) = 0.d0
+
+enddo
+
+! -- Nb d'iter point fixe vitesse pression
+nterup = 1
+
+do iscal = 1, nscamx
+
+! -- Termes sources des scalaires
+! Pour les termes sources explicites en std, I..EXT definit
+! l'extrapolation -theta ancien + (1+theta) nouveau
+! = 0 explicite
+! = 1 extrapolation avec theta = 1/2
+! = 2 extrapolation avec theta = 1
+! 0 implique pas de reservation de tableaux
+! 1 et 2 sont deux options equivalentes, la difference etant faite
+! uniquement au moment de fixer theta
+! Pour les termes sources implicites en std, I..EXT definit
+! la mise a l'ordre 2 ou non avec le thetav de la variable associee
+! = 0 implicite (std)
+! > 0 utilisation du thetav
+! Noter cpdt que le TS d'acc. masse n'est pas regi par I..EXT
+! (il suit bilsc2)
+ isso2t(iscal) = -999
+ thetss(iscal) =-999.d0
+
+! -- Proprietes physiques
+! I..EXT definit l'extrapolation -theta ancien + (1+theta) nouveau
+! = 0 explicite
+! = 1 extrapolation avec theta = 1/2
+! = 2 extrapolation avec theta = 1
+! 0 implique pas de reservation de tableaux
+! 1 et 2 sont deux options equivalentes, la difference etant faite
+! uniquement au moment de fixer theta
+! INIT.. =1 indique que la variable a ete proprement initialisee (dans un
+! fichier suite portant les valeurs adaptees)
+
+ ivsext(iscal) = -999
+ thetvs(iscal) = -999.d0
+ initvs(iscal) = 0
+
+enddo
+
+
+
+! --- Schema convectif
+! (a decider, centre-upwind si ordre 2, test de pente a decider)
+
+do ii = 1, nvarmx
+ blencv(ii) = -999.d0
+enddo
+do ii = 1, nvarmx
+ ischcv(ii) = 1
+ isstpc(ii) = -999
+enddo
+
+! --- Reconstruction des gradients
+! On donne les valeurs par defaut
+! Pour la methode de limitation, on decidera plus tard
+! selon les choix de l'utilisateur
+! On n'active pas l'extrapolation des gradients par defaut
+! meme pour la pression (par securite : moins stable sur certains cas)
+
+imrgra = 0
+anomax = -grand*10.d0
+
+do ii = 1, nvarmx
+ nswrgr(ii) = 100
+ nswrsm(ii) = -999
+ imligr(ii) = -999
+ ircflu(ii) = 1
+enddo
+
+do ii = 1, nvarmx
+ epsrgr(ii) = 1.d-5
+ climgr(ii) = 1.5d0
+ extrag(ii) = 0.d0
+enddo
+
+! --- Solveurs iteratifs
+! La methode de resolution sera choisie selon les equations
+! La valeur de epsilon relatif est tres faible
+! (1.D-5 pourrait suffire)
+! On met IDIRCL a 1 pour toutes les variables. Pour toutes les
+! variables sauf pression et fb (en v2f) on a ISTAT=1, le
+! decalage de diagonale ne sera pas active. Pour la pression
+! on decalera la diagonale si necessaire. Pour fb, on sait qu'il
+! y a un autre terme diagonal (meme si ISTAT=0), donc IDIRCL
+! sera mis a 0 dans varpos.
+
+do ii = 1, nvarmx
+ nitmax(ii) = 10000
+ iresol(ii) = -1
+ idircl(ii) = 1
+ ndircl(ii) = 0
+enddo
+do ii = 1, nvarmx
+ epsilo(ii) = -999.d0
+ epsrsm(ii) = -999.d0
+enddo
+
+! --- Multigrille
+! On donne ici les valeurs par defaut des options de base.
+
+do ii = 1, nvarmx
+ imgr(ii) = 0
+enddo
+
+do ii = 1, nvarmx
+ ncymax(ii) = 100
+ nitmgf(ii) = 10
+ nagmx0(ii)= 8
+ iagmx0(ii)= 1
+ ncpmgr(ii)= 0
+enddo
+
+! --- Nombre max de cellules et de niveaux
+
+ncegrm = 30
+ngrmax = 25
+
+rlxp1 = 1.d0
+
+! --- Suite de calcul
+! Calcul non suite par defaut
+! Ecriture du fichier suite auxiliaire par defaut
+! Lecture du fichier suite auxiliaire par defaut (si suite de calcul)
+! La correspondance nouveaux scalaires -> anciens scalaires
+! sera etablie plus tard (usini1 et lecamo)
+! L'indicateur de suite du module thermique 1D de paroi est initialise
+! par defaut a -1, pour obliger l'utilisateur a le remplir dans
+! uspt1d.
+! Idem pour l'indicateur de suite de la methode des vortex.
+
+isuite = 0
+iecaux = 1
+ileaux = 1
+do ii = 1, nscamx
+ iscold(ii) = -999
+enddo
+isuit1 = -1
+isuivo = -1
+
+! --- Reperage du temps
+
+ntpabs = 0
+ntcabs = ntpabs
+ntmabs = 10
+
+inpdt0 = 0
+
+ttpabs = 0.d0
+ttcabs = ttpabs
+
+! --- Marche en temps
+! Par defaut pas de temps uniforme et constant,
+! sans coef multiplicatif
+! Dans les cas a pas de temps variable, par defaut
+! COUMAX = FOUMAX = 0.5 et variation max 10%
+! Les autres grandeurs sont a renseigner par l'utilisateur
+! Pour DTMIN et DTMAX, si on impose DTMIN > DTMAX,
+! les bornes sont prises egales a +/-1D12
+
+idtvar = 0
+
+coumax = 1.d0
+foumax = 10.d0
+dtmin = -grand*10.d0
+dtmax = -grand*10.d0
+varrdt = 0.1d0
+
+dtref = -grand*10.d0
+
+do ii = 1, nvarmx
+ cdtvar(ii) = 1.d0
+ relaxv(ii) =-999.d0
+enddo
+relxst = 0.9d0
+
+
+! Par defaut, pas de limitation du pas de temps liee aux
+! effets de densite
+
+iptlro = 0
+
+! --- Turbulence
+! Le modele de turbulence devra etre choisi par l'utilisateur
+! En fait on n'a pas besoin d'initialiser ITYTUR (cf. varpos)
+! On suppose qu'il n'y a pas de temperature
+
+do iphas = 1, nphsmx
+ iturb (iphas) =-999
+ itytur(iphas) =-999
+ iscalt(iphas) =-1
+! Parfois, IGRHOK=1 donne des vecteurs non physiques en paroi
+! IGRHOK(IPHAS) = 1
+ igrhok(iphas) = 0
+ igrake(iphas) = 1
+ ideuch(iphas) =-999
+ ilogpo(iphas) = 1
+ iclkep(iphas) = 0
+ ikecou(iphas) =-999
+ irijnu(iphas) = 0
+ irijrb(iphas) = 0
+ irijec(iphas) = 0
+ igrari(iphas) = 1
+ idifre(iphas) = 1
+ iclsyr(iphas) = 0
+ iclptr(iphas) = 0
+ idries(iphas) =-1
+enddo
+
+
+! --- Viscosite secondaire
+
+do iphas = 1, nphsmx
+ ivisse(iphas) = 1
+enddo
+
+! --- Stokes
+! On suppose que l'on traite l'etape de Stokes
+
+iprco = 1
+do iphas = 1, nphsmx
+ irevmc(iphas) = 0
+ arak (iphas) = 1.d0
+enddo
+! indicateur developpeur temporaire sur le test de conv resolp
+irnpnw = 1
+
+! --- Couplage U-P
+! Non active par defaut
+
+ipucou = 0
+
+! --- Prise en compte de l'equilibre gradient de pression
+! termes sources de gravite et de pertes de charge
+! Non active par defaut
+! ICALHY=1 permet de calculer la pression
+! hydrostatique pour les Dirichlet de pression en sortie
+! Sera modifie dans modini
+
+iphydr = 0
+icalhy = -1
+
+! --- Champ de vitesse fige (non fige par defaut)
+
+iccvfg = 0
+
+! --- Interpolation face des viscosites
+! = 0 ARITHMETIQUE
+! = 1 HARMONIQUE
+
+imvisf = 0
+
+! --- Type des CL, tables de tri
+! Sera calcule apres usclim.
+
+do ii = 1, ntypmx
+ do iphas = 1, nphsmx
+ idebty(ii,iphas) = 0
+ ifinty(ii,iphas) = 0
+ enddo
+enddo
+
+! --- Traitement de la temperature pour couplage SYRTHES
+
+! TRAITEMENT PRECIS DE LA TEMPERATURE AU BORD, VOIR CONDLI
+! (UTILISE POUR COUPLAGE SYRTHES et le RAYONNEMENT)
+! Disons 0 pour eviter que des temperatures issues du traitement
+! des flux aux parois ne viennent polluer le champ de T.
+
+itbrrb = 0
+do iscal = 1, nscamx
+ icpsyr(iscal) = -999
+enddo
+
+
+! --- Estimateurs d'erreur pour Navier-Stokes
+! En attendant un retour d'experience et pour l'avoir,
+! on active les estimateurs par defaut.
+
+! Le numero d'estimateur IEST prend les valeurs suivantes
+! IESPRE : prediction
+! L'estimateur est base sur la grandeur
+! I = rho_n (u*-u_n)/dt + rho_n u_n grad u*
+! - rho_n div (mu+mu_t)_n grad u* + grad P_n
+! - reste du smb(u_n, P_n, autres variables_n)
+! Idealement nul quand les methodes de reconstruction
+! sont parfaites et le systeme est resolu exactement
+! IESDER : derive
+! L'estimateur est base sur la grandeur
+! I = div (flux de masse corrige apres etape pression)
+! Idealement nul quand l'equation de Poisson est resolue
+! exactement
+! IESCOR : correction
+! L'estimateur est base sur la grandeur
+! I = div (rho_n u_(n+1))
+! Idealement nul quand IESDER est nul et que le passage
+! des flux de masse aux faces vers les vitesses au centre
+! se fait dans un espace de fonctions a divergence nulle.
+! IESTOT : total
+! L'estimateur est base sur la grandeur
+! I = rho_n (u_(n+1)-u_n)/dt + rho_n u_(n+1) grad u_(n+1)
+! - rho_n div (mu+mu_t)_n grad u_(n+1) + gradP_(n_+1)
+! - reste du smb(u_(n+1), P_(n+1), autres variables_n)
+! Le flux du terme convectif est calcule a partir de u_(n+1)
+! pris au centre des cellules (et non pas a partir du flux
+! de masse aux faces actualise)
+
+! On evalue l'estimateur IEST selon les valeurs de IESCAL
+
+! IESCAL(IEST,IPHAS) = 0 : l'estimateur IEST n'est pas calcule
+! IESCAL(IEST,IPHAS) = 1 : l'estimateur IEST est calcule,
+! sans contribution du volume (on prend abs(I))
+! IESCAL(IEST,IPHAS) = 2 : l'estimateur IEST est calcule,
+! avec contribution du volume ("norme L2")
+! soit abs(I)*SQRT(Volume_cellule),
+! sauf pour IESCOR : on calcule abs(I)*Volume_cellule
+! pour mesurer l'ecart en kg/s
+
+
+do iphas = 1, nphsmx
+ do iest = 1, nestmx
+ iescal(iest,iphas) = 0
+ enddo
+enddo
+
+! --- Somme de NCEPDC (pour les calculs paralleles)
+
+do iphas = 1, nphsmx
+ ncpdct(iphas) = 0
+enddo
+
+! --- Somme de NCETSM (pour les calculs paralleles)
+
+do iphas = 1, nphsmx
+ nctsmt(iphas) = 0
+enddo
+
+! --- Somme de NFPT1D (pour les calculs paralleles)
+
+nfpt1t = 0
+
+! --- Calcul des moyennes temporelles
+
+
+do imom = 1, nbmomx
+! Pas de temps de depart (-1 : jamais)
+ ntdmom(imom) = -1
+! Ancien moment a relire ou -1 pour (re)initialisation
+ imoold(imom) = -2
+enddo
+
+! Variables composant les moments
+do ii = 1, ndgmox
+ do imom = 1, nbmomx
+ idfmom(ii,imom) = 0
+ enddo
+enddo
+
+! Non utilisateur
+
+! Nombre de moments
+nbmomt = 0
+! Nombre de tableaux ncel pourle temps cumule
+nbdtcm = 0
+
+do imom = 1, nbmomx
+! Pointeur sur les moments
+ icmome(imom) = 0
+! Pointeur sur le pas de temps cumule
+ idtmom(imom) = 0
+! Degre
+ idgmom(imom) = 0
+enddo
+
+! Repere pour diviser la variable par le temps cumule au post.
+do ii = 1, nvppmx
+ ippmom(ii) = 0
+enddo
+
+
+! --- Calcul de la distance a la paroi
+! Seules variables utilisateur : ICDPAR, IWARNY
+
+ineedy = 0
+imajdy = 0
+icdpar = -999
+nitmay = 10000
+nswrsy = 1
+nswrgy = 100
+imligy = -999
+ircfly = 1
+ischcy = 1
+isstpy = 0
+imgrpy = 0
+iwarny = -999
+ntcmxy = 1000
+
+
+blency = 0.0d0
+epsily = 1.0d-8
+epsrgy = 1.0d-5
+climgy = 1.5d0
+extray = 0.0d0
+coumxy = 5000.d0
+epscvy = 1.0d-8
+yplmxy = 200.d0
+
+! --- Methode des vortex
+ivrtex = 0
+
+! --- Calcul des efforts aux parois
+ineedf = 0
+
+! --- Ici tout optcal.h est initialise
+
+!===============================================================================
+! 8. TABLEAUX DE cstphy.h
+!===============================================================================
+
+! --- Gravite
+
+gx = 0.d0
+gy = 0.d0
+gz = 0.d0
+
+! --- Vecteur rotation
+
+icorio = 0
+
+omegax = 0.d0
+omegay = 0.d0
+omegaz = 0.d0
+
+! --- Constantes physiques de chaque phase
+! RO0,VISCL0 et CP0 devront etre initialises par l'utilisateur
+! P0 est donne par phase, mais seul P0(1) est utilise, idem
+! pour PRED0 et XYZREF
+! T0 ne sert a rien, sauf a etre dispo pour l'utilisateur
+
+! IROVAR : en attendant mieux, IROVAR indique si rho est constant
+! (et c'est donc RO0) : utilise uniquement pour les suites de
+! calcul, il indique qu'il ne faut pas relire la valeur de rho
+! qui a ete stockee dans le fichier suite. Ceci permet de ne pas
+! ecraser la valeur de rho0 (eventuellement modifiee par
+! l'utilisateur) par la valeur de l'ancien calcul.
+! Le pb ne se pose pas pour la viscosite car elle n'est relue
+! que si elle est extrapolee et elle est alors forcement variable
+! (du moins, on l'espere...) : on adopte la meme methode pour la
+! symetrie.
+
+do iphas = 1, nphsmx
+ irovar(iphas) = -1
+ ivivar(iphas) = -1
+ ro0 (iphas) = -grand*10.d0
+ viscl0(iphas) = -grand*10.d0
+ p0 (iphas) = 1.013d5
+ pred0 (iphas) = 0.d0
+ xyzp0(1,iphas)= -rinfin
+ xyzp0(2,iphas)= -rinfin
+ xyzp0(3,iphas)= -rinfin
+ ixyzp0(iphas) = -1
+ t0 (iphas) = 0.d0
+ cp0 (iphas) = -grand*10.d0
+enddo
+
+! --- Turbulence
+! YPLULI est mis a -GRAND*10. Si l'utilisateur ne l'a pas specifie dans usini1, on
+! modifie sa valeur dans modini (10.88 avec les lois de paroi invariantes,
+! 1/kappa sinon)
+do iphas = 1, nphsmx
+ ypluli(iphas) = -grand*10.d0
+enddo
+xkappa = 0.42d0
+cstlog = 5.2d0
+
+apow = 8.3d0
+bpow = 1.d0/7.d0
+cpow = apow**(2.d0/(1.d0-bpow))
+dpow = 1.d0/(1.d0+bpow)
+
+cmu = 0.09d0
+cmu025 = cmu**0.25d0
+
+! pour le k-epsilon
+ce1 = 1.44d0
+ce2 = 1.92d0
+ce4 = 1.20d0
+sigmak = 1.00d0
+sigmae = 1.30d0
+
+! pour le Rij-epsilon standard (et SSG pour CRIJ3)
+crij1 = 1.80d0
+crij2 = 0.60d0
+crij3 = 0.55d0
+crijep = 0.18d0
+csrij = 0.22d0
+crijp1 = 0.50d0
+crijp2 = 0.30d0
+
+! pour le Rij-epsilon SSG
+cssgs1 = 1.70d0
+cssgs2 =-1.05d0
+cssgr1 = 0.90d0
+cssgr2 = 0.80d0
+cssgr3 = 0.65d0
+cssgr4 = 0.625d0
+cssgr5 = 0.20d0
+cssge2 = 1.83d0
+
+! pour la LES
+do iphas = 1, nphsmx
+ xlesfl(iphas) = 2.d0
+ ales(iphas) = 1.d0
+ bles(iphas) = 1.d0/3.d0
+ csmago(iphas) = 0.065d0
+ cwale(iphas) = 0.25d0
+ xlesfd(iphas) = 1.5d0
+ smagmx(iphas) = 10.d0*csmago(iphas)
+ cdries(iphas) = 26.d0
+enddo
+
+! pour le v2f phi-model
+cv2fa1 = 0.05d0
+cv2fe2 = 1.85d0
+cv2fmu = 0.22d0
+cv2fc1 = 1.4d0
+cv2fc2 = 0.3d0
+cv2fct = 6.d0
+cv2fcl = 0.25d0
+cv2fet = 110.d0
+
+! pour le modele k-omega sst
+ckwsk1 = 1.d0/0.85d0
+ckwsk2 = 2.d0
+ckwsw1 = 2.d0
+ckwsw2 = 1.d0/0.856d0
+ckwbt1 = 0.075d0
+ckwbt2 = 0.0828d0
+ckwgm1 = ckwbt1/cmu - xkappa**2/(ckwsw1*sqrt(cmu))
+ckwgm2 = ckwbt2/cmu - xkappa**2/(ckwsw2*sqrt(cmu))
+ckwa1 = 0.31d0
+ckwc1 = 10.d0
+
+! echelle de longueur negative, recalculee par la suite
+! ou entree par l'utilisateur
+do iphas = 1, nphsmx
+ almax(iphas) = -grand*10.d0
+enddo
+
+! vitesse de reference pour l'initialisation de la turbulence
+! doit etre entree par l'utilisateur, sauf s'il initialise lui-meme
+! la turbulence.
+do iphas = 1, nphsmx
+ uref(iphas) = -grand*10.d0
+enddo
+
+! longueur caracteristique pour le modele de longueur de melange
+! doit etre entree par l'utilisateur
+do iphas = 1, nphsmx
+ xlomlg(iphas) = -grand*10.d0
+enddo
+
+! --- Scalaires
+! L'utilisateur devra remplir VISLS0
+! On remplira plus tard, selon les modifs utilisateur,
+! ISCSTH, IPHSCA
+! On modifiera eventuellement plus tard, selon modifs utilisateur,
+! IVISLS, ce dernier a ete initialise plus haut
+! On donne la valeur par defaut pour les autres
+! En particulier, on suppose qu'on n'a pas de variance (ISCAVR=0)
+! qu'on clippe les variances a zero seulement,
+! qu'on ne clippe pas les scalaires (sauf a +/-GRAND)
+
+do iscal = 1, nscamx
+ iscsth(iscal) =-10
+ iclvfl(iscal) = -1
+ iscavr(iscal) = 0
+ iphsca(iscal) = 0
+ scamin(iscal) =-grand
+ scamax(iscal) =+grand
+ visls0(iscal) =-grand*10.d0
+ sigmas(iscal) = 1.0d0
+ rvarfl(iscal) = 0.8d0
+enddo
+
+! --- Ici tout cstphy a ete initialise
+
+!===============================================================================
+! 9. INDICATEURS DE VECTORISATION
+!===============================================================================
+
+! On les prend ici egaux a -1 ; si l'utilisateur ne les positionne pas
+! a zero, ils seront ensuite renseignes dans numvec, apres des tests
+! de vectorisation.
+
+! Sur machine vectorielle, on effectue les tests de vectorisation
+! (exemple ici pour le VPP 5000, obsolete, mais on pourrait porter
+! le code sur NEC SX8 ou Cray X1 de maniere analogue).
+! Sur machine non vectorielle, inutile de chercher a vectoriser.
+
+ivecti = -1
+ivectb = -1
+
+!===============================================================================
+! 10. INITIALISATION DES PARAMETRES DE PERIODICITE de period.h
+!===============================================================================
+
+iguper = 0
+igrper = 0
+
+!===============================================================================
+! 11. INITIALISATION DES PARAMETRES DE IHM de ihmpre.h
+!===============================================================================
+
+! Par defaut, pas de fichier IHM consulte (on regarde ensuite si on
+! en trouve un a partir de la ligne de commande)
+
+iihmpr = 0
+
+!===============================================================================
+! 12. INITIALISATION DES PARAMETRES ALE de albase.h et alstru.h
+!===============================================================================
+
+! --- Methode ALE
+iale = 0
+
+! --- Iterations d'initialisation fluide seul
+nalinf = -999
+
+! --- Type de viscosite de maillage (isotrope par defaut)
+iortvm = 0
+
+! --- Nombre de structures internes
+! (sera relu ou recalcule)
+nbstru = -999
+
+! --- Nombre de structures externes
+! (sera relu ou recalcule)
+nbaste = -999
+
+! --- Numero d'iteration de couplage externe
+ntcast = 0
+
+! --- Parametres du couplage implicite
+nalimx = -999
+epalim = 1.d-5
+
+! --- Iteration d'initialisation de l'ALE
+italin = -999
+
+! --- Tableaux des structures
+do istr = 1, nstrmx
+ dtstr(istr) = dtref
+ do ii = 1, 3
+ xstr(ii,istr) = 0.d0
+ xpstr(ii,istr) = 0.d0
+ xppstr(ii,istr) = 0.d0
+ xsta(ii,istr) = 0.d0
+ xpsta(ii,istr) = 0.d0
+ xppsta(ii,istr) = 0.d0
+ xstp(ii,istr) = 0.d0
+ forstr(ii,istr) = 0.d0
+ forsta(ii,istr) = 0.d0
+ forstp(ii,istr) = 0.d0
+ xstreq(ii,istr) = 0.d0
+ do jj = 1, 3
+ xmstru(ii,jj,istr) = 0.d0
+ xcstru(ii,jj,istr) = 0.d0
+ xkstru(ii,jj,istr) = 0.d0
+ enddo
+ enddo
+enddo
+
+! --- Schema de couplage des structures
+aexxst = -grand
+bexxst = -grand
+cfopre = -grand
+
+! --- Methode de Newmark HHT
+alpnmk = 0.d0
+betnmk = -grand
+gamnmk = -grand
+
+!===============================================================================
+! 14. INITIALISATION DES PARAMETRES DE COUPLAGE CS/CS
+!===============================================================================
+
+! --- Nombre de couplage
+nbrcpl = 0
+
+!===============================================================================
+! 15. SORTIE
+!===============================================================================
+
+return
+end subroutine
diff --git a/src/base/inimas.f90 b/src/base/inimas.f90
new file mode 100644
index 0000000..6524996
--- /dev/null
+++ b/src/base/inimas.f90
@@ -0,0 +1,637 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine inimas &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ivar1 , ivar2 , ivar3 , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgu , imligu , &
+ iwarnu , nfecra , &
+ epsrgu , climgu , extrau , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isympa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rom , romb , &
+ ux , uy , uz , &
+ coefax , coefay , coefaz , coefbx , coefby , coefbz , &
+ flumas , flumab , &
+ dpdx , dpdy , dpdz , dpdxa , dpdya , dpdza , &
+ qdmx , qdmy , qdmz , coefqa , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+! -->
+! INCREMENTATION DU FLUX DE MASSE A PARTIR DU CHAMP VECTORIEL ROM.U
+! . . --> -->
+! m = m +(rom* U ) . n
+! ij ij ij ij
+
+
+! Pour la reconstruction, grad(rho u) est calcule avec des
+! conditions aux limites approchees :
+! COEFA(rho u) = ROMB * COEFA(u)
+! COEFB(rho u) = COEFB (u)
+
+! et pour le flux de masse au bord on ecrit
+! FLUMAB = [ROMB*COEFA(u) + ROMB*COEFB(u)*Ui
+! + COEFB(u)*II'.grad(rho u) ].Sij
+! ce qui utilise de petites approximations sur les
+! non-orthogonalites (cf. notice)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ivar1 ! e ! <-- ! variable de la direction 1 !
+! ivar2 ! e ! <-- ! variable de la direction 2 !
+! ivar3 ! e ! <-- ! variable de la direction 3 !
+! imaspe ! e ! <-- ! suivant l'appel de inimas !
+! ! ! ! = 1 si appel de navsto resolp !
+! ! ! ! = 2 si appel de divrij !
+! iphas ! e ! <-- ! numero de phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iflmb0 ! e ! <-- ! =1 : flux de masse annule sym-paroi !
+! init ! e ! <-- ! > 0 : initialisation du flux de masse !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! nswrgu ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligu ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! iwarnu ! e ! <-- ! niveau d'impression !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! epsrgu ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgu ! r ! <-- ! coef gradient*distance/ecart !
+! extrau ! r ! <-- ! coef extrap gradient !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! isympa ! te ! <-- ! zero pour annuler le flux de masse !
+! (nfabor ) ! ! !(symetries et parois avec cl couplees) !
+! ! ! ! un sinon !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rom(ncelet ! tr ! <-- ! masse volumique aux cellules !
+! romb(nfabor) ! tr ! <-- ! masse volumique aux bords !
+! ux,y,z(ncelet ! tr ! <-- ! vitesse !
+! coefax, b ! tr ! <-- ! tableaux des cond lim pour ux, uy, uz !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! dpd. (ncelet ! tr ! --- ! tableau de travail pour le grad de p !
+! dpd.a(ncelet ! tr ! --- ! tableau de travail pour le grad de p !
+! ! ! ! avec decentrement amont !
+! qdm.(ncelet) ! tr ! --- ! tableau de travail pour la qdm !
+! coefqa(nfab,3 ! tr ! --- ! tableau de travail cl de la qdm !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar1 , ivar2 , ivar3 , imaspe , iphas
+integer iflmb0 , init , inc , imrgra , iccocg
+integer nswrgu , imligu
+integer iwarnu , nfecra
+double precision epsrgu , climgu , extrau
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), isympa(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rom(ncelet), romb(nfabor)
+double precision ux(ncelet), uy(ncelet), uz(ncelet)
+double precision coefax(nfabor), coefay(nfabor), coefaz(nfabor)
+double precision coefbx(nfabor), coefby(nfabor), coefbz(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
+double precision qdmx(ncelet),qdmy(ncelet),qdmz(ncelet)
+double precision coefqa(ndimfb,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ii, jj, iel, iof, iii
+integer idimte, itenso, iappel, iphydp
+double precision pfac,pip,uxfac,uyfac,uzfac
+double precision dofx,dofy,dofz,pond
+double precision diipbx, diipby, diipbz
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! ---> CALCUL DE LA QTE DE MOUVEMENT
+
+
+if( init.eq.1 ) then
+ do ifac = 1, nfac
+ flumas(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ flumab(ifac) = 0.d0
+ enddo
+
+elseif(init.ne.0) then
+ write(nfecra,1000) init
+ call csexit (1)
+endif
+
+do iel = 1, ncel
+ qdmx(iel) = rom(iel)*ux(iel)
+ qdmy(iel) = rom(iel)*uy(iel)
+ qdmz(iel) = rom(iel)*uz(iel)
+enddo
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (qdmx)
+ !==========
+ call parcom (qdmy)
+ !==========
+ call parcom (qdmz)
+ !==========
+endif
+
+! ---> PERIODICITE SUR QDM
+
+if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ qdmx , qdmx , qdmx , &
+ qdmy , qdmy , qdmy , &
+ qdmz , qdmz , qdmz )
+endif
+
+do ifac =1, nfabor
+ coefqa(ifac,1) = romb(ifac)*coefax(ifac)
+ coefqa(ifac,2) = romb(ifac)*coefay(ifac)
+ coefqa(ifac,3) = romb(ifac)*coefaz(ifac)
+enddo
+
+!===============================================================================
+! 2. CALCUL DU FLUX DE MASSE SANS TECHNIQUE DE RECONSTRUCTION
+!===============================================================================
+
+if( nswrgu.le.1 ) then
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ pond = ra(ipond-1+ifac)
+
+ flumas(ifac) = flumas(ifac) &
+ +(pond*qdmx(ii)+(1.d0-pond)*qdmx(jj) )*surfac(1,ifac) &
+ +(pond*qdmy(ii)+(1.d0-pond)*qdmy(jj) )*surfac(2,ifac) &
+ +(pond*qdmz(ii)+(1.d0-pond)*qdmz(jj) )*surfac(3,ifac)
+
+ enddo
+
+
+! FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ uxfac = inc*coefqa(ifac,1) +coefbx(ifac)*romb(ifac)*ux(ii)
+ uyfac = inc*coefqa(ifac,2) +coefby(ifac)*romb(ifac)*uy(ii)
+ uzfac = inc*coefqa(ifac,3) +coefbz(ifac)*romb(ifac)*uz(ii)
+
+ flumab(ifac) = flumab(ifac) &
+ +( uxfac*surfbo(1,ifac) &
+ +uyfac*surfbo(2,ifac) +uzfac*surfbo(3,ifac) )
+
+ enddo
+
+endif
+
+
+!===============================================================================
+! 4. CALCUL DU FLUX DE MASSE AVEC TECHNIQUE DE RECONSTRUCTION
+! SI LE MAILLAGE EST NON ORTHOGONAL
+!===============================================================================
+
+if( nswrgu.gt.1 ) then
+
+
+
+
+! TRAITEMENT DE LA PERIODICITE SPEFICIQUE A INIMAS AU DEBUT
+! =========================================================
+
+ if(iperot.gt.0) then
+ iappel = 1
+
+ call permas &
+ !==========
+ ( imaspe , iphas , iappel , &
+ rom , &
+ ra(idudxy) , ra(idrdxy) , ra(iwdudx) , ra(iwdrdx) )
+
+ endif
+
+! FLUX DE MASSE SUIVANT X
+! =======================
+
+! ---> CALCUL DU GRADIENT
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar1 , imrgra , inc , iccocg , nswrgu , imligu , iphydp , &
+ iwarnu , nfecra , epsrgu , climgu , extrau , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dpdxa , dpdxa , dpdxa , &
+ qdmx , coefqa(1,1) , coefbx , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+
+! ---> FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ pond = ra(ipond-1+ifac)
+
+ iof = idofij-1+3*(ifac-1)
+!---> DOF = OF
+ dofx = ra(iof+1)
+ dofy = ra(iof+2)
+ dofz = ra(iof+3)
+
+ flumas(ifac) = flumas(ifac) &
+ +( pond*qdmx(ii) +(1.d0-pond)*qdmx(jj) &
+ +0.5d0*( dpdx(ii) +dpdx(jj) )*dofx &
+ +0.5d0*( dpdy(ii) +dpdy(jj) )*dofy &
+ +0.5d0*( dpdz(ii) +dpdz(jj) )*dofz )*surfac(1,ifac)
+
+ enddo
+
+! ---> FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ pip = romb(ifac) * ux(ii) &
+ +dpdx(ii)*diipbx &
+ +dpdy(ii)*diipby +dpdz(ii)*diipbz
+ pfac = inc*coefqa(ifac,1) +coefbx(ifac)*pip
+
+ flumab(ifac) = flumab(ifac) +pfac*surfbo(1,ifac)
+
+ enddo
+
+
+! FLUX DE MASSE SUIVANT Y
+! =======================
+
+! ---> CALCUL DU GRADIENT
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar2 , imrgra , inc , iccocg , nswrgu , imligu , iphydp , &
+ iwarnu , nfecra , epsrgu , climgu , extrau , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dpdxa , dpdxa , dpdxa , &
+ qdmy , coefqa(1,2) , coefby , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+
+! ---> FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ pond = ra(ipond-1+ifac)
+
+ iof = idofij-1+3*(ifac-1)
+
+!---> DOF = OF
+
+ dofx = ra(iof+1)
+ dofy = ra(iof+2)
+ dofz = ra(iof+3)
+
+ flumas(ifac) = flumas(ifac) &
+ +( pond*qdmy(ii) +(1.d0-pond)*qdmy(jj) &
+ +0.5d0*( dpdx(ii) +dpdx(jj) )*dofx &
+ +0.5d0*( dpdy(ii) +dpdy(jj) )*dofy &
+ +0.5d0*( dpdz(ii) +dpdz(jj) )*dofz )*surfac(2,ifac)
+
+ enddo
+
+! ---> FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ pip = romb(ifac) * uy(ii) &
+ +dpdx(ii)*diipbx &
+ +dpdy(ii)*diipby +dpdz(ii)*diipbz
+ pfac = inc*coefqa(ifac,2) +coefby(ifac)*pip
+
+ flumab(ifac) = flumab(ifac) +pfac*surfbo(2,ifac)
+
+ enddo
+
+! FLUX DE MASSE SUIVANT Z
+! =======================
+
+! ---> CALCUL DU GRADIENT
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar3 , imrgra , inc , iccocg , nswrgu , imligu , iphydp , &
+ iwarnu , nfecra , epsrgu , climgu , extrau , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dpdxa , dpdxa , dpdxa , &
+ qdmz , coefqa(1,3) , coefbz , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ pond = ra(ipond-1+ifac)
+
+ iof = idofij-1+3*(ifac-1)
+
+!---> DOF = OF
+
+ dofx = ra(iof+1)
+ dofy = ra(iof+2)
+ dofz = ra(iof+3)
+
+ flumas(ifac) = flumas(ifac) &
+ +( pond*qdmz(ii) +(1.d0-pond)*qdmz(jj) &
+ +0.5d0*( dpdx(ii) +dpdx(jj) )*dofx &
+ +0.5d0*( dpdy(ii) +dpdy(jj) )*dofy &
+ +0.5d0*( dpdz(ii) +dpdz(jj) )*dofz )*surfac(3,ifac)
+
+ enddo
+
+! ---> FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ pip = romb(ifac) * uz(ii) &
+ +dpdx(ii)*diipbx &
+ +dpdy(ii)*diipby +dpdz(ii)*diipbz
+ pfac = inc*coefqa(ifac,3) +coefbz(ifac)*pip
+
+ flumab(ifac) = flumab(ifac) +pfac*surfbo(3,ifac)
+
+ enddo
+
+
+
+! TRAITEMENT DE LA PERIODICITE SPEFICIQUE A INIMAS A LA FIN
+! =========================================================
+
+ if(iperot.gt.0) then
+ iappel = 2
+
+ call permas &
+ !==========
+ ( imaspe , iphas , iappel , &
+ rom , &
+ ra(idudxy) , ra(idrdxy) , ra(iwdudx) , ra(iwdrdx) )
+
+ endif
+
+
+
+
+endif
+
+
+!===============================================================================
+! 6. POUR S'ASSURER DE LA NULLITE DU FLUX DE MASSE AUX LIMITES
+! SYMETRIES PAROIS COUPLEES
+!===============================================================================
+
+if(iflmb0.eq.1) then
+! FORCAGE DE FLUMAB a 0 pour la vitesse'
+ do ifac = 1, nfabor
+ if(isympa(ifac).eq.0) then
+ flumab(ifac) = 0.d0
+ endif
+ enddo
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format('INIMAS APPELE AVEC INIT =',I10)
+
+#else
+
+ 1000 format('INIMAS CALLED WITH INIT =',I10)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/inipst.f90 b/src/base/inipst.f90
new file mode 100644
index 0000000..5e79de0
--- /dev/null
+++ b/src/base/inipst.f90
@@ -0,0 +1,121 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine inipst &
+!=================
+
+ ( ipstvl , ipstbo , ipstsy , ipstze, &
+ ipstmd , ntpst , fmtpst , optpst )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! RENVOIE LES PARAMETRES CONTENUS DANS LES COMMONS ET UTILES
+! A L'INITIALISATION DU POST-TRAITEMENT
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipstvl ! e ! --> ! indicateur pour le maillage volumique !
+! ipstbo ! e ! --> ! indicateur pour le maillage de peau !
+! ipstsy ! e ! --> ! indicateur pour les maillages de !
+! ! ! ! peau couples avec syrthes !
+! ipstze ! e ! --> ! indicateur pour les maillages de !
+! ! ! ! zone d'echange aero !
+! ipstmd ! e ! --> ! indicateur de maillage deformable : !
+! ! ! ! 0 : pas de deformation ; !
+! ! ! ! 1 : deformation a topologie cste !
+! ! ! ! 2 : topologie variable !
+! ! ! ! 10 : idem que 0 avec ecriture d'un !
+! ! ! ! champ de deplact !
+! ! ! ! 11 : idem que 1 avec ecriture d'un !
+! ! ! ! champ de deplact !
+! ! ! ! 12 : idem que 2 avec ecriture d'un !
+! ! ! ! champ de deplact !
+! ntpst ! e ! --> ! frequence des sorties post-traitement !
+! fmtpst ! a ! --> ! nom du format de post-traitement !
+! fmtpst ! a ! --> ! options du format de post-traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipstvl , ipstbo , ipstsy , ipstze
+integer ipstmd , ntpst
+
+character fmtpst(32)
+character optpst(96)
+
+! VARIABLES LOCALES
+
+integer ii
+
+!===============================================================================
+
+! Transmission des param�tres du common Fortran � la partie C.
+
+ipstvl = ichrvl
+ipstbo = ichrbo
+ipstsy = ichrsy
+ipstze = ichrze
+
+ipstmd = ichrmd
+ntpst = ntchr
+
+do ii = 1, len(fmtchr)
+ fmtpst(ii) = fmtchr(ii:ii)
+enddo
+do ii = 1, len(optchr)
+ optpst(ii) = optchr(ii:ii)
+enddo
+
+!===============================================================================
+
+return
+
+end
diff --git a/src/base/initi1.f90 b/src/base/initi1.f90
new file mode 100644
index 0000000..eb79267
--- /dev/null
+++ b/src/base/initi1.f90
@@ -0,0 +1,221 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine initi1 &
+!================
+
+ ( iverif )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES COMMONS
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iverif ! e ! <-- ! indicateur des tests elementaires !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+include "matiss.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iverif
+
+! VARIABLES LOCALES
+
+integer iok
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION DES VARIABLES EN COMMON
+! AVANT INTERVENTION UTILISATEUR.
+! . mots-cles dynamiques
+! . entsor .h
+! . dimens .h
+! . numvar .h
+! . pointe .h
+! . optcal .h
+! . mltgrd .h
+! . cstphy .h
+!===============================================================================
+
+call iniini
+!==========
+
+!===============================================================================
+! 2. ENTREE DES DONNEES PAR L'UTILISATEUR
+! ET POSITIONNEMENT DES VARIABLES (VARPOS)
+!===============================================================================
+
+call iniusi(iverif)
+!==========
+
+call ppini1
+!==========
+
+call rayopt
+!==========
+
+call lagopt
+!==========
+
+call mtini1
+!==========
+
+! En mode verification, on positionne IMRGRA a 2 de maniere a creer
+! le voisinage etendu (complet) necessaire a certains modes de calcul
+! de gradient
+if (iverif.eq.1) imrgra = 2
+
+
+!===============================================================================
+! 3. DEFINITION DES COUPLAGES AVEC SYRTHES
+!===============================================================================
+
+! Le nombre de couplage SYRTHES doit etre connu avant MODINI a des fins
+! de verification de coherence avec la definition des scalaires
+
+call ussyrc
+!==========
+
+!===============================================================================
+! 4. MODIFS APRES USINI1
+!===============================================================================
+
+call modini
+!==========
+
+!===============================================================================
+! 5. VERIFS APRES USINI1
+!===============================================================================
+
+iok = 0
+
+call verini (iok)
+!==========
+
+if(iok.gt.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+else
+ write(nfecra,9998)
+endif
+
+
+#if defined(_CS_LANG_FR)
+
+ 9998 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (interface, usini1 et autres).',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier les donnees entrees dans l''interface, usini1 ou ',/,&
+'@ les autres sous-programmes d''initialisation. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 9998 format( &
+'' ,/,&
+' No error detected during the data verification' ,/,&
+' (interface, usini1 and others).',/)
+ 9999 format( &
+'@' ,/,&
+'@' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION' ,/,&
+'@ ========' ,/,&
+'@ THE CALCULATION PARAMETERS ARE INCOHERENT OR INCOMPLET' ,/,&
+'@' ,/,&
+'@ The calculation will not be run (',I10,' errors).' ,/,&
+'@' ,/,&
+'@ See previous impressions for more informations.' ,/,&
+'@ Verify the provided data in the interface, usini1 or' ,/,&
+'@ the other initialization subroutines.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/)
+
+#endif
+
+!===============================================================================
+! 6. IMPRESSIONS
+!===============================================================================
+
+if (iverif.eq.1) return
+
+call impini
+!==========
+
+if (imatis.eq.1) then
+ call mtimpi
+ !==========
+endif
+
+
+return
+end
diff --git a/src/base/initi2.f90 b/src/base/initi2.f90
new file mode 100644
index 0000000..eb37ef1
--- /dev/null
+++ b/src/base/initi2.f90
@@ -0,0 +1,162 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine initi2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ jcelbr , &
+ ia , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! FIN INITIALISATION DES COMMONS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! jcelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! ia(*) ! tr ! --- ! tableau de travail pour les entiers !
+! ra(*) ! tr ! --- ! tableau de travail pour les reels !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer jcelbr
+integer ia(*)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iphas
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. DIMENSIONS DE dimens.h : MLG ET NON ORTH
+!===============================================================================
+
+!---> COMMON GEOMET
+
+! --- DEDUCTION DES AUTRES DIMENSIONS MLG ET NON ORTH
+
+ncelbr = jcelbr
+
+!===============================================================================
+! 3. TABLEAUX DE cstphy.h
+!===============================================================================
+
+!---> COMMON TURBUL
+
+! --- SI ALMAX < 0 , IL EST RECALCULE
+
+write(nfecra,1000)
+
+do iphas = 1, nphas
+ if(almax(iphas).le.0.d0) then
+ almax(iphas) = voltot**.333d0
+ write(nfecra,1100) iphas,almax(iphas)
+ write(nfecra,1102)
+ if(itytur(iphas).eq.2.or.itytur(iphas).eq.3 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60) then
+ write(nfecra,1101)
+ endif
+ endif
+enddo
+
+
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' ' )
+ 1100 format( &
+' --- Phase : ',I10 ,/,&
+' ALMAX = ', E14.5, ' (Longueur caracteristique )' )
+ 1101 format( &
+' ALMAX est la longueur utilisee pour initialiser ',/,&
+' la turbulence.' )
+ 1102 format( &
+' ALMAX est la racine cubique du volume du domaine. ',/)
+
+#else
+
+ 1000 format( &
+' ' )
+ 1100 format( &
+' --- Phase: ',I10 ,/,&
+' ALMAX = ', E14.5, ' (Characteristic length )' )
+ 1101 format( &
+' ALMAX is the length used to initialize the turbulence.' )
+ 1102 format( &
+' ALMAX is the cubic root of the domain volume.' ,/)
+
+#endif
+
+!===============================================================================
+! 4. FIN
+!===============================================================================
+
+return
+end
diff --git a/src/base/iniusi.f90 b/src/base/iniusi.f90
new file mode 100644
index 0000000..f67b5d6
--- /dev/null
+++ b/src/base/iniusi.f90
@@ -0,0 +1,570 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine iniusi(iverif)
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE APPELANT LES ROUTINES UTILISATEUR POUR L'ENTREE DES
+! PARAMETRES DE CALCUL : ON PASSE ICI POUR TOUT CALCUL
+
+! CETTE ROUTINE PERMET DE CACHER A L'UTILISATEUR LES APPELS
+! A VARPOS ET AU LECTEUR XML DE L'IHM
+
+! LE DECOUPAGE DE L'ANCIEN USINI1 PERMET EGALEMENT DE MIEUX
+! CONTROLER LES ZONES OU SONT INITIALISES LES VARIABLES (PAR
+! LE BIAIS DE PARAMETRES PASSES EN ARGUMENT)
+
+! ON INITIALISE EGALEMENT ICI NPHAS ET ISCAPH QUI VALENT 1 EN
+! PRATIQUE DANS TOUS LES CALCULS (C'EST UN PARAMETRE UTILISATEUR,
+! MAIS SA VALEUR EST QUELQUE PEU CONTRAINTE ENCORE...)
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iverif ! e ! <-- ! indicateur des tests elementaires !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "vector.h"
+include "albase.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iverif
+
+! VARIABLES LOCALES
+
+integer ii, iphas , iscal , nmodpp
+integer nphmax, nscmax, nesmax, nphusi, nscusi
+integer ieepre, ieeder, ieecor, ieetot, iihmpu
+integer ialgce, imgrpr
+integer iappel
+double precision relaxp, extrap
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION DE L'INFORMATION "FICHIER XML (IHM) REQUIS & EXISTE"
+!===============================================================================
+
+
+! - Interface Code_Saturne
+! ======================
+
+! Avec Xml, on regarde si le fichier a ete ouvert (requis et existe,
+! selon les tests realises dans cs_main)
+! IIHMPR a ete initialise a 0 juste avant (INIINI)
+
+call csihmp(iihmpr)
+!==========
+
+if(iihmpr.eq.1) then
+
+ call uiinit
+ !==========
+
+endif
+
+!===============================================================================
+! 1. INITIALISATION DE PARAMETRES DEPENDANT DU NOMBRE DE PHASES
+!===============================================================================
+
+! --- Nombre de phases
+
+! Egal a 1 en version 1.2
+! =======================
+
+! Le nombre de phases maximal est donne par NPHSMX dans paramx.h
+! On teste la valeur donnee par l'utilisateur avant de completer
+! les tableaux dimensionnes a NPHSMX (ex. ITURB(NPHSMX)).
+
+nphas = 1
+
+
+! --- Varpos
+! Verification du nombre de phases
+! 1er passage
+call varpos(nmodpp)
+!==========
+
+! --- Parametres dependant du nombre de phases
+
+! Turbulence
+! Chaleur massique variable ou non
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call csturb(iturb, ideuch, igrake, igrari, xlomlg)
+ !==========
+
+ call cscpva(icp)
+ !==========
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+nphmax = nphsmx
+nphusi = nphas
+iihmpu = iihmpr
+call usipph &
+!==========
+ (nphmax , nphusi , iihmpu , nfecra , iturb , icp , iverif)
+
+!===============================================================================
+! 2. INITIALISATION DE PARAMETRES DEPENDANT DU NOMBRE DE SCALAIRES
+!===============================================================================
+
+! --- Nombre de scalaires utilisateurs
+
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call csnsca(nscaus)
+ !==========
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+iihmpu = iihmpr
+call usinsc(iihmpu , nfecra , nscaus , iverif)
+!==========
+
+
+! --- Dans le cas de physiques particulieres definies par des modules
+! specifiques du code tels que charbon, combustion, electrique
+! le sous-programme USPPMO doit etre complete imperativement
+! par l'utilisateur
+
+! - Interface Code_Saturne
+! ======================
+
+if (iihmpr.eq.1) then
+
+ call uippmo &
+ !==========
+ ( ippmod, icod3p, icodeq, icoebu, icobml, &
+ icolwc, icp3pl, icpl3c, icfuel, &
+ ieljou, ielarc, ielion, icompf, iatmos, &
+ iaeros, indjon, ieqco2)
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+call usppmo
+!==========
+
+! --- Varpos
+! Verification et construction de ISCAPP
+! 2ieme passage
+call varpos(nmodpp)
+!==========
+
+
+! --- Activation du module transferts radiatifs
+
+! Il est necessaire de connaitre l'activation du module transferts
+! radiatifs tres tot de maniere a pouvoir reserver less variables
+! necessaires dans certaines physiques particuliere
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call uiray1(iirayo, isuird, ndirec, nfreqr, idiver, iimpar, iimlum)
+ !==========
+
+endif
+
+! --- Parametres dependant du nombre de scalaires utilisateurs
+
+! Moyenne du carre des fluctuations d'un scalaire UTILISATEUR
+! Diffusivite variable ou non
+
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call csisca(iscavr)
+! ============
+
+ call csivis(iscavr, ivisls, iscalt, iscsth)
+! ============
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+nscmax = nscamx
+nscusi = nscaus
+iihmpu = iihmpr
+call usipsc &
+!==========
+ ( nscmax , nscusi , iihmpu , nfecra , iscavr , ivisls , iverif )
+
+
+! --- Parametres dependant du nombre de scalaires : exception
+! IPHSCA indique le numero de la phase porteuse pour chaque
+! scalaire UTILISATEUR
+
+! Dans le cas d'une seule phase, IPHSCA(ISCAL) = 1 : ne rien changer.
+! ==================================================================
+
+! Sinon noter bien que :
+
+! La phase porteuse des scalaires UTILISATEUR ISCAL qui
+! representent la moyenne du carre des fluctuations d'un
+! scalaire utilisateur K sera la meme que celle de ce scalaire
+! utilisateur K.
+! Donc, pour de tels scalaires ISCAL (reperes par ISCAVR(ISCAL)>0),
+! on ne doit pas renseigner IPHSCA(ISCAL) ici.
+! C'est l'objet du test inclus dans l'exemple ci-dessous.
+
+! Pour les scalaires non utilisateur relatifs a des physiques
+! particulieres, (charbon, combustion, electrique : voir usppmo)
+! implicitement definis selon le modele,
+! les informations sont donnees automatiquement par ailleurs :
+! on ne modifie pas IPHSCA ici.
+
+do iscal = 1, nscaus
+ if(iscavr(iscal).le.0) then
+ iphsca(iscal) = 1
+ endif
+enddo
+
+
+!===============================================================================
+! 3. INITIALISATION DE PARAMETRES "GLOBAUX"
+!===============================================================================
+
+
+! --- Parametres globaux
+
+! Pas de temps
+! Couplage vitesse/pression
+! Prise en compte de la pression hydrostatique
+! Estimateurs (pas encore dans l'IHM)
+
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call csidtv(idtvar)
+ !==========
+
+ call csiphy(iphydr)
+ !==========
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+nphmax = nphsmx
+nesmax = nestmx
+ieepre = iespre
+ieeder = iesder
+ieecor = iescor
+ieetot = iestot
+nphusi = nphas
+iihmpu = iihmpr
+! IALGCE permet de remplir la variable cs_glob_maillage_grd_cdg_cel dans
+! cs_maillage_grd.c, a travers la routine ALGCEN.
+! cs_glob_maillage_grd_cdg_cel est initialise a 0 dans cs_maillage_grd.c,
+! et on ne change sa valeur ici que si elle a vraiment ete touchee par
+! l'utilisateur (pour garder l'initialisation en un seul endroit).
+! Le blindage en erreur est dans cs_maillage_grd.c (erreur si IALGCE>1,
+! cs_glob_maillage_grd_cdg_cel inchange si IALGCE<0)
+ialgce = -999
+
+call usipgl &
+!==========
+ ( nphmax , nesmax , &
+ ieepre , ieeder , ieecor , ieetot , &
+ nphusi , iihmpu , nfecra , &
+ idtvar , ipucou , iphydr , ialgce , iescal , iverif )
+
+if (ialgce.ne.-999) call algcen(ialgce)
+
+! --- Parametres de la methode ALE
+
+! - Interface Code_Saturne
+! ======================
+
+if (iihmpr.eq.1) then
+
+ call uialin (iale, nalinf, nalimx, epalim, iortvm)
+ !==========
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+call usalin
+!==========
+
+! --- Varpos
+! Positionnement de pointeurs
+! Verifications
+! Determination de IPR, IU ... ISCA, NVAR
+! Determination de IPP...
+
+! 3ieme passage
+call varpos(nmodpp)
+!==========
+
+
+!===============================================================================
+! 4. INITIALISATION DE PARAMETRES UTILISATEUR SUPPLEMENTAIRES
+!===============================================================================
+
+! --- Format des fichiers aval (entsor.h)
+! --- Options du calcul (optcal.h)
+! --- Constantes physiques (cstphy.h)
+
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call csvnum &
+ !==========
+ (nvar, &
+ iu, iv, iw, ipr, &
+ iturb, ik, iep, &
+ ir11, ir22, ir33, &
+ ir12, ir13, ir23, &
+ iomg, iphi, ifb, &
+ iale, iuma, ivma, iwma, &
+ isca, iscapp)
+
+! Suite de calcul, relecture fichier auxiliaire, champ de vitesse figé
+ call csisui(isuite, ileaux, iccvfg)
+ !==========
+
+! Pas de temps (seulement NTMABS, DTREF, INPDT0)
+ call cstime &
+ !==========
+ (inpdt0, iptlro, ntmabs, idtvar, dtref, dtmin, &
+ dtmax, coumax, foumax, varrdt, relxst)
+
+! Temperature ou enthalpie (hors physiques particulieres)
+ if(nmodpp.eq.0) then
+ call cssca1(iscalt, iscsth)
+ !==========
+
+ endif
+
+! Options numériques locales
+
+ call uinum1 &
+ !==========
+ (isca, iscapp, blencv, ischcv, isstpc, ircflu, &
+ cdtvar, nitmax, epsilo)
+
+! Options numériques globales
+ relaxp = -999.d0
+ extrap = 0.d0
+ imgrpr = 0
+ call csnum2 (ivisse, relaxp, ipucou, extrap, imrgra, imgrpr)
+ !==========
+ iphas = 1
+ extrag(ipr(iphas)) = extrap
+ if (idtvar.ge.0) relaxv(ipr(iphas)) = relaxp
+ imgr(ipr(iphas)) = imgrpr
+
+! Gravite, prop. phys
+ call csphys &
+ !==========
+ (nmodpp, &
+ irovar, ivivar, icorio, &
+ gx, gy, gz, omegax, omegay, omegaz , &
+ ro0, viscl0, cp0, t0, p0)
+
+! Scamin, scamax
+ call cssca2(iscavr, scamin, scamax)
+ !==========
+
+! Diffusivites
+ call cssca3(iscalt, iscavr, visls0, t0, p0)
+ !==========
+
+! Init turb (uref, almax) si necessaire (modele RANS)
+ iphas = 1
+ if (itytur(iphas).eq.2 .or. itytur(iphas).eq.3 .or. &
+ itytur(iphas).eq.5 .or. itytur(iphas).eq.6 ) then
+ call cstini(uref, almax)
+ !==========
+ endif
+
+ iappel = 0
+
+ call uiprop &
+ !==========
+ (irom, iviscl, ivisct, ivisls, icour, ifour, &
+ ismago, iale, icp, iscalt, iscavr, &
+ iprtot, ipppro, ipproc, icmome, &
+ ipptx, ippty, ipptz, ippdt, &
+ ivisma, iappel)
+
+ call uimoyt (ndgmox, ntdmom, imoold, idfmom)
+ !==========
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+call usipsu(nmodpp , iverif)
+!==========
+
+
+! --- Varpos
+! 4ieme passage
+call varpos(nmodpp)
+!==========
+
+
+!===============================================================================
+! 5. INITIALISATION DE PARAMETRES UTILISATEUR (entree sorties)
+!===============================================================================
+
+! --- Entree-sorties
+
+
+! - Interface Code_Saturne
+! ======================
+
+
+if(iihmpr.eq.1) then
+
+ if(nbmomt.gt.0 .or. ipucou.eq.1) then
+ iappel = 1
+
+ call uiprop &
+ !==========
+ (irom, iviscl, ivisct, ivisls, icour, ifour, &
+ ismago, iale, icp, iscalt, iscavr, &
+ iprtot, ipppro, ipproc, icmome, &
+ ipptx, ippty, ipptz, ippdt, &
+ ivisma, iappel)
+
+ endif
+
+ do ii = 1,nvppmx
+ call fcnmva (nomvar(ii), len(nomvar(ii)), ii)
+ !==========
+ enddo
+
+ call csenso &
+ !==========
+ ( nvppmx, ncapt, nthist, ntlist, &
+ ichrvl, ichrbo, ichrsy, ichrmd, &
+ fmtchr, len(fmtchr), optchr, len(optchr), &
+ ntchr, iecaux, &
+ ipstdv, ipstyp, ipstcl, ipstft, ipstfo, &
+ ichrvr, ilisvr, ihisvr, isca, iscapp, &
+ ipprtp, xyzcap )
+
+ do ii = 1,nvppmx
+ call cfnmva(nomvar(ii), len(nomvar(ii)), ii)
+ !==========
+ enddo
+
+ call nvamem
+ !==========
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+call usipes(nmodpp, iverif)
+!==========
+
+!----
+! FORMATS
+!----
+
+
+return
+end
diff --git a/src/base/iniva0.f90 b/src/base/iniva0.f90
new file mode 100644
index 0000000..680bbd7
--- /dev/null
+++ b/src/base/iniva0.f90
@@ -0,0 +1,723 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine iniva0 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncofab , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , frcxt , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL, DU PAS DE TEMPS
+! ET DU TABLEAU INDICATEUR DU CALCUL DE LA DISTANCE A LA PAROI
+! AUX VALEURS PAR DEFAUT
+! AVANT LECTURE EVENTUELLE DU FICHIER SUITE ET
+! AVANT DE PASSER LA MAIN A L'UTILISATEUR
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncofab ! e ! <-- ! nombre de couples coefa/b pour les cl !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! ! ! ! a la face interne !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , ncofab
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,ncofab), coefb(nfabor,ncofab)
+double precision frcxt(ncelet,3,nphas)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iis , ivar , iphas , iphass, iscal , imom
+integer iel , ifac
+integer iclip , ii , jj , idim
+integer iiflum, iiflua
+integer iirom , iiromb, iiroma
+integer iivisl, iivist, iivisa, iivism
+integer iicp , iicpa
+integer iiviss, iiptot
+integer iptsna, iptsta, iptsca
+integer ikiph , ieiph , iphiph, ifbiph, iomgip
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer nn
+double precision ro0iph, visiph
+double precision xxk, xcmu, trii
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! En compressible, ISYMPA initialise (= 1) car utile dans le calcul
+! du pas de temps variable avant passage dans les C.L.
+
+if ( ippmod(icompf).ge.0 ) then
+ do ifac = 1, nfabor*nphas
+ ia(iisymp+ifac-1) = 1
+ enddo
+endif
+
+!===============================================================================
+! 2. PAS DE TEMPS
+!===============================================================================
+
+do iel = 1, ncel
+ dt (iel) = dtref
+enddo
+
+!===============================================================================
+! 3. INITIALISATION DES PROPRIETES PHYSIQUES
+!===============================================================================
+
+do iphas = 1, nphas
+
+! Masse volumique
+ iirom = ipproc(irom (iphas))
+ iiromb = ipprob(irom (iphas))
+ ro0iph = ro0 (iphas)
+
+! Masse volumique aux cellules (et au pdt precedent si ordre2 ou icalhy)
+ do iel = 1, ncel
+ propce(iel,iirom) = ro0iph
+ enddo
+ if(iroext(iphas).gt.0.or.icalhy.eq.1) then
+ iiroma = ipproc(iroma (iphas))
+ do iel = 1, ncel
+ propce(iel,iiroma) = propce(iel,iirom)
+ enddo
+ endif
+! Masse volumique aux faces de bord (et au pdt precedent si ordre2)
+ do ifac = 1, nfabor
+ propfb(ifac,iiromb) = ro0iph
+ enddo
+ if(iroext(iphas).gt.0) then
+ iiroma = ipprob(iroma (iphas))
+ do ifac = 1, nfabor
+ propfb(ifac,iiroma) = propfb(ifac,iiromb)
+ enddo
+ endif
+
+! Viscosite moleculaire
+ iivisl = ipproc(iviscl(iphas))
+ iivist = ipproc(ivisct(iphas))
+ visiph = viscl0(iphas)
+
+! Viscosite moleculaire aux cellules (et au pdt precedent si ordre2)
+ do iel = 1, ncel
+ propce(iel,iivisl) = visiph
+ enddo
+ if(iviext(iphas).gt.0) then
+ iivisa = ipproc(ivisla(iphas))
+ do iel = 1, ncel
+ propce(iel,iivisa) = propce(iel,iivisl)
+ enddo
+ endif
+! Viscosite turbulente aux cellules (et au pdt precedent si ordre2)
+ do iel = 1, ncel
+ propce(iel,iivist) = 0.d0
+ enddo
+ if(iviext(iphas).gt.0) then
+ iivisa = ipproc(ivista(iphas))
+ do iel = 1, ncel
+ propce(iel,iivisa) = propce(iel,iivist)
+ enddo
+ endif
+
+! Chaleur massique aux cellules (et au pdt precedent si ordre2)
+ if(icp(iphas).gt.0) then
+ iicp = ipproc(icp(iphas))
+ do iel = 1, ncel
+ propce(iel,iicp) = cp0(iphas)
+ enddo
+ if(icpext(iphas).gt.0) then
+ iicpa = ipproc(icpa(iphas))
+ do iel = 1, ncel
+ propce(iel,iicpa ) = propce(iel,iicp)
+ enddo
+ endif
+ endif
+
+! La pression totale sera initialisee a P0 + rho.g.r dans INIVAR
+! si l'utilisateur n'a pas fait d'initialisation personnelle
+! Non valable en compressible
+ if (ippmod(icompf).lt.0) then
+ iiptot = ipproc(iprtot(iphas))
+ do iel = 1, ncel
+ propce(iel,iiptot) = - rinfin
+ enddo
+ endif
+
+enddo
+
+
+! Diffusivite des scalaires
+do iscal = 1, nscal
+ if(ivisls(iscal).gt.0) then
+ iiviss = ipproc(ivisls(iscal))
+! Diffusivite aux cellules (et au pdt precedent si ordre2)
+ do iel = 1, ncel
+ propce(iel,iiviss) = visls0(iscal)
+ enddo
+ if(ivsext(iphsca(iscal)).gt.0) then
+ iivisa = ipproc(ivissa(iscal))
+ do iel = 1, ncel
+ propce(iel,iivisa) = propce(iel,iiviss)
+ enddo
+ endif
+ endif
+enddo
+
+
+! Viscosite de maillage en ALE
+if (iale.eq.1) then
+ nn = 1
+ if (iortvm.eq.1) nn = 3
+ do ii = 1, nn
+ iivism = ipproc(ivisma(ii))
+ do iel = 1, ncel
+ propce(iel,iivism) = 1.d0
+ enddo
+ enddo
+endif
+
+!===============================================================================
+! 4. INITIALISATION STANDARD DES VARIABLES DE CALCUL
+! On complete ensuite pour les variables turbulentes et les scalaires
+!===============================================================================
+
+! Toutes les variables a 0
+do ivar = 1, nvar
+ do iel = 1, ncel
+ rtp(iel,ivar) = 0.d0
+ enddo
+enddo
+
+! On met la pression P* a PRED0
+do iphas = 1, nphas
+ do iel = 1, ncel
+ rtp(iel,ipr(iphas)) = pred0(iphas)
+ enddo
+enddo
+
+! Couplage U-P
+if(ipucou.eq.1) then
+ do iel = 1, ncel
+ ra(itpuco+iel-1 ) = 0.d0
+ ra(itpuco+iel-1+ ncelet) = 0.d0
+ ra(itpuco+iel-1+2*ncelet) = 0.d0
+ enddo
+endif
+
+!===============================================================================
+! 5. INITIALISATION DE K, RIJ ET EPS
+!===============================================================================
+
+! Si UREF n'a pas ete donnee par l'utilisateur ou a ete mal initialisee
+! (valeur negative), on met les valeurs de k, Rij, eps et omega a
+! -10*GRAND. On testera ensuite si l'utilisateur les a modifiees dans
+! usiniv ou en lisant un fichier suite.
+
+do iphas = 1, nphas
+
+ if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50) then
+
+ ikiph = ik (iphas)
+ ieiph = iep(iphas)
+
+ xcmu = cmu
+ if (iturb(iphas).eq.50) xcmu = cv2fmu
+
+
+ if (uref(iphas).ge.0.d0) then
+ do iel = 1, ncel
+ rtp(iel,ikiph) = 1.5d0*(0.02d0*uref(iphas))**2
+ rtp(iel,ieiph) = rtp(iel,ikiph)**1.5d0*xcmu/almax(iphas)
+ enddo
+
+ iclip = 1
+ iphass = iphas
+ call clipke(ncelet , ncel , nvar , nphas , &
+ iphass , iclip , iwarni(ikiph), &
+ propce , rtp )
+
+ else
+ do iel = 1, ncel
+ rtp(iel,ikiph) = -grand
+ rtp(iel,ieiph) = -grand
+ enddo
+ endif
+
+ if (iturb(iphas).eq.50) then
+ iphiph = iphi(iphas)
+ ifbiph = ifb (iphas)
+ do iel = 1, ncel
+ rtp(iel,iphiph) = 2.d0/3.d0
+ rtp(iel,ifbiph) = 0.d0
+ enddo
+ endif
+
+ elseif(itytur(iphas).eq.3) then
+
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ ieiph = iep (iphas)
+
+ if (uref(iphas).ge.0.d0) then
+
+ trii = (0.02d0*uref(iphas))**2
+
+ do iel = 1, ncel
+ rtp(iel,ir11ip) = trii
+ rtp(iel,ir22ip) = trii
+ rtp(iel,ir33ip) = trii
+ rtp(iel,ir12ip) = 0.d0
+ rtp(iel,ir13ip) = 0.d0
+ rtp(iel,ir23ip) = 0.d0
+ xxk = 0.5d0*(rtp(iel,ir11ip)+ &
+ rtp(iel,ir22ip)+rtp(iel,ir33ip))
+ rtp(iel,ieiph) = xxk**1.5d0*cmu/almax(iphas)
+ enddo
+ iclip = 1
+ iphass = iphas
+ call clprij(ncelet , ncel , nvar , nphas , &
+ iphass , iclip , &
+ propce , rtp , rtp )
+
+ else
+
+ do iel = 1, ncel
+ rtp(iel,ir11ip) = -grand
+ rtp(iel,ir22ip) = -grand
+ rtp(iel,ir33ip) = -grand
+ rtp(iel,ir12ip) = -grand
+ rtp(iel,ir13ip) = -grand
+ rtp(iel,ir23ip) = -grand
+ rtp(iel,ieiph) = -grand
+ enddo
+
+ endif
+
+ elseif(iturb(iphas).eq.60) then
+
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+
+ if (uref(iphas).ge.0.d0) then
+
+ do iel = 1, ncel
+ rtp(iel,ikiph ) = 1.5d0*(0.02d0*uref(iphas))**2
+! on utilise la formule classique eps=k**1.5/Cmu/ALMAX et omega=eps/Cmu/k
+ rtp(iel,iomgip) = rtp(iel,ikiph)**0.5d0/almax(iphas)
+ enddo
+! pas la peine de clipper, les valeurs sont forcement positives
+
+ else
+
+ do iel = 1, ncel
+ rtp(iel,ikiph ) = -grand
+ rtp(iel,iomgip) = -grand
+ enddo
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 6. CLIPPING DES GRANDEURS SCALAIRES (SF K-EPS VOIR CI DESSUS)
+!===============================================================================
+
+if (nscal.gt.0) then
+
+! Clipping des scalaires non variance
+ do iis = 1, nscal
+ if(iscavr(iis).eq.0) then
+ iscal = iis
+ call clpsca &
+ !==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , ra , rtp )
+ endif
+ enddo
+
+! Clipping des variances qui sont clippees sans recours au scalaire
+! associe
+ do iis = 1, nscal
+ if(iscavr(iis).ne.0.and.iclvfl(iis).ne.1) then
+ iscal = iis
+ call clpsca &
+ !==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , ra , rtp )
+ endif
+ enddo
+
+! Clipping des variances qui sont clippees avec recours au scalaire
+! associe s'il est connu
+ do iis = 1, nscal
+ if( iscavr(iis).le.nscal.and.iscavr(iis).ge.1.and. &
+ iclvfl(iis).eq.1 ) then
+ iscal = iis
+ call clpsca &
+ !==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , rtp(1,isca(iscavr(iis))) , rtp )
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 7. INITIALISATION DE CONDITIONS AUX LIMITES ET FLUX DE MASSE
+! NOTER QUE LES CONDITIONS AUX LIMITES PEUVENT ETRE UTILISEES DANS
+! PHYVAR, PRECLI
+!===============================================================================
+
+! Conditions aux limites
+do ii = 1, ncofab
+ do ifac = 1, nfabor
+ coefa(ifac,ii) = 0.d0
+ coefb(ifac,ii) = 1.d0
+ enddo
+enddo
+
+do iphas = 1, nphas
+ do ifac = 1, nfabor
+ ia(iitypf-1+ifac+nfabor*(iphas-1)) = 0
+ ia(iitrif-1+ifac+nfabor*(iphas-1)) = 0
+ enddo
+enddo
+
+! Type sym�trie : on en a besoin dans le cas du calcul des gradients
+! par moindres carr�s �tendu avec extrapolation du gradient au bord
+! La valeur 0 permet de ne pas extrapoler le gradient sur les faces.
+! Habituellement, on �vite l'extrapolation sur les faces de sym�tries
+! pour ne pas tomber sur une ind�termination et une matrice 3*3 non
+! inversible dans les configurations 2D).
+do iphas = 1, nphas
+ do ifac = 1, nfabor
+ ia(iisymp-1+ifac+nfabor*(iphas-1)) = 0
+ enddo
+enddo
+
+! Flux de masse (on essaye de ne pas trop faire les choses 2 fois,
+! sans toutefois faire des tests trop compliques)
+iiflum = 0
+do ivar = 1, nvar
+ if(ifluma(ivar).gt.0.and.ifluma(ivar).ne.iiflum) then
+ iiflum = ifluma(ivar)
+ do ifac = 1, nfac
+ propfa(ifac,ipprof(iiflum)) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ propfb(ifac,ipprob(iiflum)) = 0.d0
+ enddo
+ endif
+enddo
+
+! Flux de masse "ancien" : on utilise le fait que IFLUMAA = -1 si
+! le flux ancien n'est pas defini (voir le test dans varpos).
+
+iiflua = 0
+do ivar = 1, nvar
+ if(ifluaa(ivar).gt.0.and.ifluaa(ivar).ne.iiflua) then
+ iiflua = ifluaa(ivar)
+ iiflum = ifluma(ivar)
+ do ifac = 1, nfac
+ propfa(ifac,ipprof(iiflua)) = propfa(ifac,ipprof(iiflum))
+ enddo
+ do ifac = 1, nfabor
+ propfb(ifac,ipprob(iiflua)) = propfb(ifac,ipprob(iiflum))
+ enddo
+ endif
+enddo
+
+
+!===============================================================================
+! 8. INITIALISATION DES TERMES SOURCES SI EXTRAPOLES
+!===============================================================================
+
+do iphas = 1, nphas
+
+! les termes sources de Navier Stokes
+ if(isno2t(iphas).gt.0) then
+ iptsna = ipproc(itsnsa(iphas))
+ do ii = 1, ndim
+ do iel = 1, ncel
+ propce(iel,iptsna+ii-1) = 0.d0
+ enddo
+ enddo
+ endif
+
+! les termes sources turbulents
+ if(isto2t(iphas).gt.0) then
+ if(itytur(iphas).eq.2) jj = 2
+ if(itytur(iphas).eq.3) jj = 7
+ if(iturb(iphas).eq.50) jj = 4
+ if(iturb(iphas).eq.60) jj = 2
+ iptsta = ipproc(itstua(iphas))
+ do ii = 1, jj
+ do iel = 1, ncel
+ propce(iel,iptsta+ii-1) = 0.d0
+ enddo
+ enddo
+ endif
+
+enddo
+
+! les termes sources des scalaires
+do iis = 1, nscal
+ if(isso2t(iis).gt.0) then
+ iptsca = ipproc(itssca(iis))
+ do iel = 1, ncel
+ propce(iel,iptsca) = 0.d0
+ enddo
+ endif
+enddo
+
+!===============================================================================
+! 9. INITIALISATION DES MOYENNES
+!===============================================================================
+
+do imom = 1, nbmomt
+ do iel = 1, ncel
+ propce(iel,ipproc(icmome(imom))) = 0.d0
+ enddo
+enddo
+do ii = 1, nbdtcm
+ do iel = 1, ncel
+ propce(iel,ipproc(icdtmo(ii))) = 0.d0
+ enddo
+enddo
+do ii = 1, nbmomx
+ dtcmom(ii) = 0.d0
+enddo
+
+!===============================================================================
+! 10. INITIALISATION CONSTANTE DE SMAGORINSKY EN MODELE DYNAMIQUE
+!===============================================================================
+
+do iphas = 1, nphas
+ if(iturb(iphas).eq.41) then
+ do iel = 1, ncel
+ propce(iel,ipproc(ismago(iphas))) = 0.d0
+ enddo
+ endif
+enddo
+
+!===============================================================================
+! 11. INITIALISATION DU NUMERO DE LA FACE DE PAROI 5 LA PLUS PROCHE
+!===============================================================================
+
+! Si IFAPA existe,
+! on suppose qu'il faut le (re)calculer : on init le tab a -1.
+
+do iphas = 1, nphas
+ if(iifapa(iphas).gt.0) then
+ do iel = 1, ncel
+ ia(iifapa(iphas)-1+ iel) = -1
+ enddo
+ endif
+enddo
+
+!===============================================================================
+! 12. INITIALISATION DE LA FORCE EXTERIEURE QUAND IPHYDR=1
+!===============================================================================
+
+if(iphydr.eq.1) then
+ do iphas = 1, nphas
+ do iel = 1, ncel
+ frcxt(iel,1,iphas) = 0.d0
+ frcxt(iel,2,iphas) = 0.d0
+ frcxt(iel,3,iphas) = 0.d0
+ enddo
+ enddo
+endif
+
+!===============================================================================
+! 12. INITIALISATIONS EN ALE
+!===============================================================================
+
+if (iale.eq.1) then
+ do ii = 1, nnod
+ ia(iimpal+ii-1) = 0
+ do idim = 1, 3
+ ra(idepal+(idim-1)*nnod+ii-1) = 0.d0
+ ra(ixyzn0+(ii-1)*ndim+idim-1) = xyznod(idim,ii)
+ enddo
+ enddo
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/inivar.f90 b/src/base/inivar.f90
new file mode 100644
index 0000000..37b14df
--- /dev/null
+++ b/src/base/inivar.f90
@@ -0,0 +1,1401 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine inivar &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncofab , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , frcxt , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL, DU PAS DE TEMPS
+! ET DU TABLEAU INDICATEUR DU CALCUL DE LA DISTANCE A LA PAROI
+! PAR L'UTILISATEUR (apres relecture eventuelle d'un fichier suite)
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncofab ! e ! <-- ! nombre de couples coefa/b pour les cl !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , ncofab
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, ils
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,ncofab), coefb(nfabor,ncofab)
+double precision frcxt(ncelet,3,nphas)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra, ifinia
+integer ivar , iphas , iscal , iphass, imom
+integer iel
+integer iclip , ipp , iok , ii
+integer ikiph , ieiph , ir11ip, ir22ip, ir33ip, iphiph
+integer iomgip, idtcm , ipcmom, iiptot, ipriph
+integer ibormo(nbmomx)
+double precision valmax, valmin, vfmin , vfmax
+double precision vdtmax, vdtmin
+double precision xekmin, xepmin, xomgmn, xphmin, xphmax
+double precision x11min, x22min, x33min, valmom
+double precision vmomax(nbmomx), vmomin(nbmomx)
+double precision ro0iph, p0iph, pr0iph, xxp0, xyp0, xzp0
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iok = 0
+
+!===============================================================================
+! 2. ON REPASSE LA MAIN A L'UTILISATEUR POUR LA PROGRAMMATION DES
+! INITIALISATIONS QUI LUI SONT PROPRES
+!===============================================================================
+
+! Indicateur d'initialisation des scalaires par l'utilisateur
+! (mis a 1 si passage dans USINIV ou PPINIV ou dans l'IHM ; a 0 sinon)
+
+iusini = 1
+
+! - Interface Code_Saturne
+! ======================
+
+if (isuite.eq.0 .and. iihmpr.eq.1) then
+
+ call uiiniv (ncelet, isca, rtp)
+ !==========
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('INIVAR',IFINIA)
+
+call usiniv &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+! Avec l'interface, il peut y avoir eu initialisation,
+! meme si usiniv n'est pas utilise.
+ if (isuite.eq.0 .and. iihmpr.eq.1) then
+ iusini = 1
+ endif
+
+
+! ON FAIT DE LA PHYSIQUE PARTICULIERE
+! On pourrait remonter la partie init non utilisateur de ppiniv avant lecamo
+! dans iniva0, mais il faudrait quand meme conserver ici l'appel a
+! ppiniv car il encapsule les appels aux ss pgm utilisateur similaires a
+! usiniv.
+if (ippmod(iphpar).ge.1) then
+
+ iusini = 1
+
+ call ppiniv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! Si l'utilisateur a change Ptot, on change P* en consequence,
+! sinon on met Ptot a P0 + rho.g.r
+! A priori l'utilisateur remplira les NCEL valeurs ou rien du
+! tout, mais on ne sait jamais ...
+! En compressible, Ptot n'est pas defini (correspond directement a RTP(.,IPR)
+
+if (ippmod(icompf).lt.0) then
+ do iphas = 1, nphas
+ ipriph = ipr(iphas)
+ iiptot = ipproc(iprtot(iphas))
+ ro0iph = ro0 (iphas)
+ p0iph = p0 (iphas)
+ pr0iph = pred0(iphas)
+ xxp0 = xyzp0(1,iphas)
+ xyp0 = xyzp0(2,iphas)
+ xzp0 = xyzp0(3,iphas)
+ do iel = 1, ncel
+ if (propce(iel,iiptot).gt.-0.5d0*rinfin) then
+ rtp(iel,ipriph) = propce(iel,iiptot) &
+ - ro0iph*( gx*(xyzcen(1,iel)-xxp0) &
+ + gy*(xyzcen(2,iel)-xyp0) &
+ + gz*(xyzcen(3,iel)-xzp0) ) &
+ + pr0iph - p0iph
+ else
+ propce(iel,iiptot) = rtp(iel,ipriph) &
+ + ro0iph*( gx*(xyzcen(1,iel)-xxp0) &
+ + gy*(xyzcen(2,iel)-xyp0) &
+ + gz*(xyzcen(3,iel)-xzp0) ) &
+ + p0iph - pr0iph
+ endif
+ enddo
+ enddo
+endif
+
+
+
+!===============================================================================
+! 3. CLIPPING DES GRANDEURS TURBULENTES (UTILISATEUR OU SUITE)
+! (pour ITYTUR=2, 3, 5 ou 6)
+! Si l'utilisateur est intervenu dans USINIV, PPINIV ou via l'interface
+! et a impose des valeurs "correctes" (au sens k, eps, Rii > 0)
+! on considere qu'il s'agit d'une initialisation admissible,
+! on la clippe pour la rendre coherente avec le clipping du code
+! et on continue le calcul
+! Si l'utilisateur est intervenu dans USINIV, PPINIV ou via l'interface
+! et a impose des valeurs visiblement erronees
+! (k, eps ou Rii < 0), on s'arrete (il s'est sans doute trompe).
+! On adopte le meme traitement en suite de calcul
+! pour assurer un comportement identique en suite entre un calcul
+! ou l'utilisateur modifie une variable avec usiniv (mais pas la
+! turbulence) et un calcul ou l'utilisateur ne modifie pas usiniv.
+! S'il n'y a ni suite ni intervention dans USINIV ou PPINIV ou via l'interface,
+! les grandeurs ont deja ete clippees par defaut, sauf si UREF n'a pas
+! (ou a mal) ete initialise. Dans ce cas on avertit aussi l'utilisateur et on
+! stoppe le calcul.
+
+! Pour resumer :
+! -en suite avec des valeurs positives pour k, eps, Rii : on clippe
+! -avec usiniv ou ppiniv ou interface
+! avec des valeurs positives pour k, eps, Rii : on clippe
+! -non suite sans usiniv ni ppiniv ni interface avec UREF positif :
+! grandeurs par defaut (deja clippees)
+! -non suite sans usiniv ni ppiniv ni interface avec UREF negatif : stop
+! -suite ou usiniv ou ppiniv ou interface
+! avec une valeur negative de k, eps ou Rii : stop
+! avec une valeur hors de [0;2] pour phi : stop
+! (on souhaite indiquer a l'utilisateur que son fichier suite est
+! bizarre ou que son initialisation est fausse et qu'il a donc
+! fait au moins une erreur qui peut en cacher d'autres)
+!===============================================================================
+
+if(iusini.eq.1.or.isuite.eq.1) then
+
+ do iphas = 1, nphas
+ if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50) then
+
+ ikiph = ik (iphas)
+ ieiph = iep(iphas)
+
+ xekmin = rtp(1,ikiph)
+ xepmin = rtp(1,ieiph)
+ do iel = 1, ncel
+ xekmin = min(xekmin,rtp(iel,ikiph) )
+ xepmin = min(xepmin,rtp(iel,ieiph))
+ enddo
+ if (irangp.ge.0) then
+ call parmin (xekmin)
+ !==========
+ call parmin (xepmin)
+ !==========
+ endif
+
+ if(xekmin.ge.0.d0.and.xepmin.ge.0.d0) then
+ iclip = 1
+ iphass = iphas
+ call clipke( ncelet , ncel , nvar , nphas , &
+ !==========
+ iphass , iclip , iwarni(ikiph) , &
+ propce , rtp )
+ else
+ write(nfecra,3020) iphas,xekmin,xepmin
+ iok = iok + 1
+ endif
+
+! En v2-f, on verifie aussi que phi est compris entre 0 et 2
+ if (iturb(iphas).eq.50) then
+ iphiph = iphi(iphas)
+
+ xphmin = rtp(1,iphiph)
+ xphmax = rtp(1,iphiph)
+ do iel = 1, ncel
+ xphmin = min(xphmin,rtp(iel,iphiph) )
+ xphmax = max(xphmax,rtp(iel,iphiph) )
+ enddo
+ if (irangp.ge.0) then
+ call parmin (xphmin)
+ !==========
+ call parmax (xphmax)
+ !==========
+ endif
+
+! Par coherence avec clpv2f, on ne clippe qu'a zero et pas a 2
+! IF(XPHMIN.LT.0.D0 .OR. XPHMAX.GT.2.D0) THEN
+ if(xphmin.lt.0.d0) then
+ write(nfecra,3021) iphas,xphmin,xphmax
+ iok = iok + 1
+ endif
+
+ endif
+
+ elseif(itytur(iphas).eq.3) then
+
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ieiph = iep (iphas)
+
+ x11min = rtp(1,ir11ip)
+ x22min = rtp(1,ir22ip)
+ x33min = rtp(1,ir33ip)
+ xepmin = rtp(1,ieiph)
+ do iel = 1, ncel
+ x11min = min(x11min,rtp(iel,ir11ip))
+ x22min = min(x22min,rtp(iel,ir22ip))
+ x33min = min(x33min,rtp(iel,ir33ip))
+ xepmin = min(xepmin,rtp(iel,ieiph) )
+ enddo
+ if (irangp.ge.0) then
+ call parmin (x11min)
+ !==========
+ call parmin (x22min)
+ !==========
+ call parmin (x33min)
+ !==========
+ call parmin (xepmin)
+ !==========
+ endif
+ if (x11min.ge.0.d0.and.x22min.ge.0.d0.and. &
+ x33min.ge.0.d0.and.xepmin.ge.0.d0 ) then
+ iclip = 1
+ iphass = iphas
+ call clprij( ncelet , ncel , nvar , nphas , &
+ !==========
+ iphass , iclip , &
+ propce , rtp , rtp )
+ else
+ write(nfecra,3030) iphas,x11min,x22min,x33min,xepmin
+ iok = iok + 1
+ endif
+
+ elseif(iturb(iphas).eq.60) then
+
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+
+ xekmin = rtp(1,ikiph )
+ xomgmn = rtp(1,iomgip)
+ do iel = 1, ncel
+ xekmin = min(xekmin,rtp(iel,ikiph ))
+ xomgmn = min(xomgmn,rtp(iel,iomgip))
+ enddo
+ if (irangp.ge.0) then
+ call parmin (xekmin)
+ !==========
+ call parmin (xomgmn)
+ !==========
+ endif
+
+! En k-omega on clippe seulement a 0
+ if(xekmin.lt.0.d0 .or. xomgmn.lt.0.d0) then
+ write(nfecra,3031) iphas,xekmin,xomgmn
+ iok = iok + 1
+ endif
+
+ endif
+ enddo
+
+else
+
+ do iphas = 1, nphas
+ if (iturb(iphas).ne.0 .and. iturb(iphas).ne.10 &
+ .and. itytur(iphas).ne.4) then
+ if (uref(iphas).lt.0.d0) then
+ write(nfecra,3032) iphas,uref(iphas)
+ iok = iok + 1
+ endif
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 4. CLIPPING DES SCALAIRES (UTILISATEUR OU SUITE)
+! Si l'utilisateur est intervenu dans USINIV ou PPINIV et
+! a impose des valeurs "correctes" (au sens comprises dans des bornes
+! simplifiees a base de 0, scamin, scamax)
+! on considere qu'il s'agit d'une initialisation admissible,
+! on la clippe pour la rendre coherente avec le clipping du code
+! et on continue le calcul
+! si l'utilisateur a impose des valeurs visiblement erronees
+! (au sens comprises dans des bornes simplifiees a base de 0, scamin,
+! scamax), on s'arrete (il s'est sans doute trompe).
+! On adopte le meme traitement en suite de calcul
+! pour assurer un comportement identique en suite entre un calcul
+! ou l'utilisateur modifie une variable avec usiniv (mais pas un
+! scalaire) et un calcul ou l'utilisateur ne modifie pas usiniv.
+! Sinon, les grandeurs ont deja ete clippees apres les init par defaut
+
+! Pour resumer :
+! -en suite avec des valeurs grossierement admissibles : on clippe
+! -avec usiniv ou ppiniv
+! avec des valeurs grossierement admissibles : on clippe
+! -non suite sans usiniv ni ppiniv :
+! grandeurs par defaut (deja clippees)
+! -suite ou usiniv ou ppiniv
+! avec une valeur grossierement non admissible : stop
+! (on souhaite indiquer a l'utilisateur que son fichier suite est
+! bizarre ou que son initialisation est fausse et qu'il a donc
+! fait au moins une erreur qui peut en cacher d'autres)
+!===============================================================================
+
+! On traite tous les scalaires d'abord, car ils peuvent etre necessaires
+! pour clipper les variances
+
+if(nscal.gt.0.and.(iusini.eq.1.or.isuite.eq.1)) then
+
+! Scalaires non variance
+
+ do ii = 1, nscal
+ if(iscavr(ii).le.0.or.iscavr(ii).gt.nscal) then
+
+ if(scamin(ii).le.scamax(ii)) then
+ ivar = isca(ii)
+ valmax = rtp(1 ,ivar)
+ valmin = rtp(1 ,ivar)
+ do iel = 1, ncel
+ valmax = max(valmax,rtp(iel,ivar))
+ valmin = min(valmin,rtp(iel,ivar))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (valmax)
+ !==========
+ call parmin (valmin)
+ !==========
+ endif
+
+! Verification de la coherence pour les clippings
+! des scalaires non variance.
+ if(valmin.ge.scamin(ii).and.valmax.le.scamax(ii)) then
+ iscal = ii
+ call clpsca &
+ !==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , ra , rtp )
+ else
+ chaine = nomvar(ipprtp(isca(ii)))
+ write(nfecra,3040) ii,chaine(1:8), &
+ valmin,scamin(ii),valmax,scamax(ii)
+ iok = iok + 1
+ endif
+ endif
+
+ endif
+ enddo
+
+
+! Variances
+
+ do ii = 1, nscal
+ if(iscavr(ii).gt.0.and.iscavr(ii).le.nscal) then
+
+ if(scamin(ii).le.scamax(ii)) then
+ ivar = isca(ii)
+ valmax = rtp(1 ,ivar)
+ valmin = rtp(1 ,ivar)
+ do iel = 1, ncel
+ valmax = max(valmax,rtp(iel,ivar))
+ valmin = min(valmin,rtp(iel,ivar))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (valmax)
+ !==========
+ call parmin (valmin)
+ !==========
+ endif
+
+! Verification de la coherence pour les clippings de variance.
+! Pour iclvfl = 1 on ne verifie que > 0 sinon ca va devenir difficile
+! de faire une initialisation correcte.
+
+ if(iclvfl(ii).eq.0) then
+! On pourrait clipper dans le cas ou VALMIN.GE.0, mais ca
+! n'apporterait rien, par definition
+ if(valmin.lt.0.d0) then
+ chaine = nomvar(ipprtp(isca(ii)))
+ write(nfecra,3050)ii,chaine(1:8), &
+ valmin,scamin(ii),valmax,scamax(ii)
+ iok = iok + 1
+ endif
+ elseif(iclvfl(ii).eq.1) then
+! Ici on clippe pour etre coherent avec la valeur du scalaire
+ if(valmin.ge.0.d0) then
+ iscal = ii
+ call clpsca &
+ !==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , rtp(1,isca(iscavr(ii))) , rtp )
+ else
+ chaine = nomvar(ipprtp(isca(ii)))
+ write(nfecra,3050)ii,chaine(1:8), &
+ valmin,scamin(ii),valmax,scamax(ii)
+ iok = iok + 1
+ endif
+ elseif(iclvfl(ii).eq.2) then
+ vfmin = 0.d0
+ vfmin = max(scamin(iscal),vfmin)
+ vfmax = scamax(iscal)
+! On pourrait clipper dans le cas ou VALMIN.GE.VFMIN.AND.VALMAX.LE.VFMAX
+! mais ca n'apporterait rien, par definition
+ if(valmin.lt.vfmin.or.valmax.gt.vfmax) then
+ chaine = nomvar(ipprtp(isca(ii)))
+ write(nfecra,3051)ii,chaine(1:8), &
+ valmin,scamin(ii),valmax,scamax(ii),&
+ ii,iclvfl(ii)
+ iok = iok + 1
+ endif
+ endif
+ endif
+
+ endif
+ enddo
+
+endif
+
+
+!===============================================================================
+! 6. IMPRESSIONS DE CONTROLE POUR LES INCONNUES, LE PAS DE TEMPS
+! LE CUMUL DES DUREE POUR LES MOYENNES
+!===============================================================================
+
+write(nfecra,2000)
+
+! Inconnues de calcul : on affiche les bornes
+do ipp = 2, nvppmx
+ if(itrsvr(ipp ).ge.1) then
+ ivar = itrsvr(ipp )
+ valmax = -grand
+ valmin = grand
+ do iel = 1, ncel
+ valmax = max(valmax,rtp(iel,ivar))
+ valmin = min(valmin,rtp(iel,ivar))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (valmax)
+ !==========
+ call parmin (valmin)
+ !==========
+ endif
+ chaine = nomvar(ipp )
+ write(nfecra,2010)chaine(1:8),valmin,valmax
+ endif
+enddo
+write(nfecra,2020)
+
+! Moyennes : on affiche les bornes
+if(nbmomt.gt.0) then
+ do imom = 1, nbmomt
+ ipcmom = ipproc(icmome(imom))
+
+! Si on ne (re)initialise pas
+ if(imoold(imom).ne.-1) then
+ valmax = -grand
+ valmin = grand
+! Si le cumul en temps est variable en espace
+ if(idtmom(imom).gt.0) then
+ idtcm = ipproc(icdtmo(idtmom(imom)))
+ do iel = 1, ncel
+ valmom = propce(iel,ipcmom)/ &
+ max(propce(iel,idtcm),epzero)
+ valmax = max(valmax,valmom)
+ valmin = min(valmin,valmom)
+ enddo
+! Si le cumul en temps est uniforme
+ else
+ idtcm =-idtmom(imom)
+ do iel = 1, ncel
+ valmom = propce(iel,ipcmom)/ &
+ max(dtcmom(idtcm),epzero)
+ valmax = max(valmax,valmom)
+ valmin = min(valmin,valmom)
+ enddo
+ endif
+ if (irangp.ge.0) then
+ call parmax (valmax)
+ !==========
+ call parmin (valmin)
+ !==========
+ endif
+! Si on (re)initialise
+ else
+ valmax = 0.d0
+ valmin = 0.d0
+ endif
+
+ chaine = nomvar(ipppro(ipcmom))
+ write(nfecra,2010)chaine(1:8),valmin,valmax
+
+ enddo
+ write(nfecra,2020)
+endif
+
+if (idtvar.ge.0) then
+! Pas de temps : on affiche les bornes
+! si < 0 on s'arrete
+ vdtmax = -grand
+ vdtmin = grand
+ do iel = 1, ncel
+ vdtmax = max(vdtmax,dt (iel))
+ vdtmin = min(vdtmin,dt (iel))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (vdtmax)
+ !==========
+ call parmin (vdtmin)
+ !==========
+ endif
+ WRITE(NFECRA,2010)'PasDeTmp',VDTMIN,VDTMAX
+ write(nfecra,2020)
+
+ if (vdtmin.le.zero) then
+ write(nfecra,3010) vdtmin
+ iok = iok + 1
+ endif
+
+endif
+
+! Cumul du temps associe aux moments : on affiche les bornes
+! si < 0 on s'arrete
+
+if(nbmomt.gt.0) then
+
+! Indicateur de calcul des bornes pour les cumuls non uniformes
+ do imom = 1, nbmomt
+ if(idtmom(imom).gt.0) then
+ ibormo(icdtmo(idtmom(imom))) = 0
+ vmomax(icdtmo(idtmom(imom))) = -grand
+ vmomin(icdtmo(idtmom(imom))) = grand
+ endif
+ enddo
+
+! Calcul des bornes des cumuls non uniformes
+ do imom = 1, nbmomt
+ if(idtmom(imom).gt.0) then
+ if(ibormo(icdtmo(idtmom(imom))).eq.0) then
+ idtcm = ipproc(icdtmo(idtmom(imom)))
+ vdtmax = -grand
+ vdtmin = grand
+ do iel = 1, ncel
+ vdtmax = max(vdtmax,propce(iel,idtcm))
+ vdtmin = min(vdtmin,propce(iel,idtcm))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (vdtmax)
+ !==========
+ call parmin (vdtmin)
+ !==========
+ endif
+ vmomax(icdtmo(idtmom(imom))) = vdtmax
+ vmomin(icdtmo(idtmom(imom))) = vdtmin
+ ibormo(icdtmo(idtmom(imom))) = 1
+ endif
+ endif
+ enddo
+
+! Impression des bornes
+ write(nfecra,2030)
+ do imom = 1, nbmomt
+ if(idtmom(imom).gt.0) then
+ write(nfecra,2040) imom,vmomin(icdtmo(idtmom(imom))), &
+ vmomax(icdtmo(idtmom(imom))), &
+ 'Variable'
+ elseif(idtmom(imom).lt.0) then
+ write(nfecra,2040) imom,dtcmom(-idtmom(imom)) , &
+ dtcmom(-idtmom(imom)) , &
+ 'Uniforme'
+ endif
+ enddo
+ write(nfecra,2050)
+
+! On s'arrete si des cumuls sont negatifs
+ do imom = 1, nbmomt
+ if(idtmom(imom).gt.0) then
+ if(vmomin(icdtmo(idtmom(imom))).lt.zero) then
+ write(nfecra,3011) imom,vmomin(icdtmo(idtmom(imom)))
+ iok = iok + 1
+ endif
+ elseif(idtmom(imom).lt.0) then
+ if(dtcmom(-idtmom(imom)).lt.zero) then
+ write(nfecra,3011) imom,dtcmom(-idtmom(imom))
+ iok = iok + 1
+ endif
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 7. ARRET GENERAL SI PB
+!===============================================================================
+
+if (iok.gt.0) then
+ write(nfecra,3090) iok
+ call csexit (1)
+endif
+
+write(nfecra,3000)
+
+!----
+! FORMATS
+!----
+
+
+#if defined(_CS_LANG_FR)
+
+ 2000 format( &
+' ',/,&
+' ----------------------------------------------------------- ',/,&
+' ',/,&
+' ',/,&
+' ** INITIALISATION DES VARIABLES ',/,&
+' ---------------------------- ',/,&
+' ',/,&
+' --------------------------------- ',/,&
+' Variable Valeur min Valeur max ',/,&
+' --------------------------------- ' )
+ 2010 format( &
+ 2x, a8, e12.4, e12.4 )
+ 2020 format( &
+' --------------------------------- ',/)
+ 2030 format( &
+' Duree cumulee : ',/,&
+' ------------------------------------------------------------',/,&
+' Moyenne Valeur min Valeur max Uniforme/Variable en espac',/,&
+' ------------------------------------------------------------' )
+ 2040 format( &
+ i10, e12.4, e12.4,1x, a8 )
+ 2050 format( &
+' ------------------------------------------------------------',/)
+
+ 3000 format(/,/, &
+'-------------------------------------------------------------',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ PAS DE TEMPS NEGATIF OU NUL ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ La valeur minimale du pas de temps DT est ',E14.5 ,/,&
+'@ Verifier l''initialisation dans usiniv ou le fichier suite',/,&
+'@ dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ CUMUL DE DUREE POUR LES MOYENNES NEGATIVE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ La valeur minimale de la duree cumulee pour la moyenne ',/,&
+'@ IMOM = ',I10 ,' est ',E14.5 ,/,&
+'@ ',/,&
+'@ Verifier l''initialisation dans usiniv ou le fichier suite',/,&
+'@ dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut reinitialiser la moyenne et le',/,&
+'@ cumul temporel associe en imposant IMOOLD(IMOM) = -1 ',/,&
+'@ dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ TURBULENCE NEGATIVE OU NULLE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Valeur minimale de k = ',E14.5 ,/,&
+'@ Valeur minimale de epsilon = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verifier l''initialisation (usiniv et/ou interface), ',/,&
+'@ le fichier suite ou bien la valeur de UREF (usini1 ',/,&
+'@ et/ou interface). ',/,&
+'@ Dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ou ',/,&
+'@ par l''interface). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE PHI DU V2F HORS DES BORNES [0;2] ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Valeur minimale de phi = ',E14.5 ,/,&
+'@ Valeur maximale de phi = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verifier l''initialisation (usiniv et/ou interface), ',/,&
+'@ ou le fichier suite. ',/,&
+'@ Dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ou ',/,&
+'@ par l''interface. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ TURBULENCE NEGATIVE OU NULLE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Valeur minimale de R11 = ',E14.5 ,/,&
+'@ Valeur minimale de R22 = ',E14.5 ,/,&
+'@ Valeur minimale de R33 = ',E14.5 ,/,&
+'@ Valeur minimale de epsilon = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verifier l''initialisation (usiniv et/ou interface), ',/,&
+'@ le fichier suite ou bien la valeur de UREF (usini1 ',/,&
+'@ et/ou interface). ',/,&
+'@ Dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ou ',/,&
+'@ par l''interface). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ TURBULENCE NEGATIVE OU NULLE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Valeur minimale de k = ',E14.5 ,/,&
+'@ Valeur minimale de omega = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verifier l''initialisation (usiniv et/ou interface), ',/,&
+'@ le fichier suite ou bien la valeur de UREF (usini1 ',/,&
+'@ et/ou interface). ',/,&
+'@ Dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ou ',/,&
+'@ par l''interface. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3032 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ LA VITESSE DE REFERENCE UREF N''A PAS ETE INITIALISEE ',/,&
+'@ OU A ETE MAL INITIALISEE (VALEUR NEGATIVE). ',/,&
+'@ ELLE VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ La turbulence n''a pas pu etre initialisee ',/,&
+'@ Corriger la valeur de UREF (usini1 ou interface)ou bien ',/,&
+'@ initialiser directement la turbulence dans la routine ',/,&
+'@ (usiniv ou interface). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ GRANDEUR SCALAIRE HORS BORNES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Scalaire numero ',I10,' : ',A8 ,/,&
+'@ Valeur minimale = ',E14.5 ,/,&
+'@ Clipping demande a SCAMIN = ',E14.5 ,/,&
+'@ Valeur maximale = ',E14.5 ,/,&
+'@ Clipping demande a SCAMAX = ',E14.5 ,/,&
+'@ Les valeurs extremes ne sont pas coherentes avec les ',/,&
+'@ limites SCAMIN et SCAMAX imposees dans usini1. ',/,&
+'@ ',/,&
+'@ Verifier l''initialisation dans usiniv ou le fichier suite',/,&
+'@ dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ',/,&
+'@ Verifier les valeurs de clipping dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ VARIANCE NEGATIVE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Scalaire numero ',I10,' : ',A8 ,/,&
+'@ Valeur minimale = ',E14.5 ,/,&
+'@ Le scalaire indique ci-dessus est une variance (ISCAVR est',/,&
+'@ postif dans usini1) mais l initialisation imposee ',/,&
+'@ dans usiniv comporte des valeurs negatives. ',/,&
+'@ ',/,&
+'@ Verifier l''initialisation dans usiniv ou le fichier suite',/,&
+'@ dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ',/,&
+'@ Verifier la definition des variances dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3051 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ VARIANCE HORS BORNES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Scalaire numero ',I10,' : ',A8 ,/,&
+'@ Valeur minimale = ',E14.5 ,/,&
+'@ Clipping demande a SCAMIN = ',E14.5 ,/,&
+'@ Valeur maximale = ',E14.5 ,/,&
+'@ Clipping demande a SCAMAX = ',E14.5 ,/,&
+'@ Le scalaire indique ci-dessus est une variance (ISCAVR est',/,&
+'@ postif dans usini1) mais l initialisation imposee ',/,&
+'@ dans usiniv comporte des valeurs situees hors des bornes',/,&
+'@ SCAMIN, SCAMAX ou inferieures a 0 et le mode de clipping',/,&
+'@ demande est ICLVFL(',I10,') = ',I10 ,/,&
+'@ ',/,&
+'@ Verifier l''initialisation dans usiniv ou le fichier suite',/,&
+'@ dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ',/,&
+'@ Verifier la definition des variances et le mode de ',/,&
+'@ clipping demande dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3090 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''INITIALISATION DES VARIABLES ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ L INITIALISATION DES VARIABLES EST INCOMPLETE OU ',/,&
+'@ INCOHERENTE AVEC LES VALEURS DES PARAMETRES DE CALCUL ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Attention a l''initialisation du pas de temps ',/,&
+'@ de la turbulence ',/,&
+'@ des scalaires et variances ',/,&
+'@ des moyennes temporelles ',/,&
+'@ ',/,&
+'@ Verifier usiniv ou le fichier suite. ',/,&
+'@ dans le cas ou les valeurs lues dans le fichier suite ',/,&
+'@ sont incorrectes, on peut les modifier par usiniv ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 2000 format( &
+' ',/,&
+' ----------------------------------------------------------- ',/,&
+' ',/,&
+' ',/,&
+' ** VARIABLES INITIALIZATION ',/,&
+' ------------------------ ',/,&
+' ',/,&
+' --------------------------------- ',/,&
+' Variable Min. value Max. value ',/,&
+' --------------------------------- ' )
+ 2010 format( &
+ 2x, a8, e12.4, e12.4 )
+ 2020 format( &
+' --------------------------------- ',/)
+ 2030 format( &
+' Time averages (sum over the time-steps) ',/,&
+' ------------------------------------------------------------',/,&
+' Average Min. value Max. value Uniform/Variable in space ',/,&
+' ------------------------------------------------------------' )
+ 2040 format( &
+ i10, e12.4, e12.4,1x, a8 )
+ 2050 format( &
+' ------------------------------------------------------------',/)
+
+ 3000 format(/,/, &
+'-------------------------------------------------------------',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ NEGATIVE OR NULL TIME STEP ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ The minimum value of the time-step dt is ',E14.5 ,/,&
+'@ Verify the initialization in usiniv or the restart file ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ NEGATIVE CUMULATIVE TIME FOR THE MOMENTS ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ The minimum value of the cumulative time for the moment ',/,&
+'@ IMOM = ',I10 ,' est ',E14.5 ,/,&
+'@ ',/,&
+'@ Verify the initialization in usiniv or the restart file ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, the moment and the associated cumulative ',/,&
+'@ time may be re-initialized by setting IMOOLD(IMOM) = -1 ',/,&
+'@ in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ NEGATIVE OR NULL TURBULENCE ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Minimum value of k = ',E14.5 ,/,&
+'@ Minimum value of epsilon = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verify the initialization (usiniv and/or interface), ',/,&
+'@ the restart file or the value of UREF (usini1 and/or ',/,&
+'@ interface). ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv or ',/,&
+'@ with the interface. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ PHI VARIABLE OF V2F OUT OF BOUNDS [0;2] ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Minimum value of phi = ',E14.5 ,/,&
+'@ Maximum value of phi = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verify the initialization (usiniv and/or interface), ',/,&
+'@ the restart file. ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv or ',/,&
+'@ with the interface. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ NEGATIVE OR NULL TURBULENCE ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Minimum value of R11 = ',E14.5 ,/,&
+'@ Minimum value of R22 = ',E14.5 ,/,&
+'@ Minimum value of R33 = ',E14.5 ,/,&
+'@ Minimum value of epsilon = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verify the initialization (usiniv and/or interface), ',/,&
+'@ the restart file or the value of UREF (usini1 and/or ',/,&
+'@ interface). ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv or ',/,&
+'@ with the interface. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ NEGATIVE OR NULL TURBULENCE ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Phase = ',I4 ,/,&
+'@ Minimum value of k = ',E14.5 ,/,&
+'@ Minimum value of omega = ',E14.5 ,/,&
+'@ ',/,&
+'@ Verify the initialization (usiniv and/or interface), ',/,&
+'@ the restart file or the value of UREF (usini1 and/or ',/,&
+'@ interface). ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv or ',/,&
+'@ with the interface. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3032 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ PHASE ',I10 ,/,&
+'@ THE REFERENCE VELOCITY UREF HAS NOT BEEN INITIALIZED ',/,&
+'@ OR HAS NOT BEEN CORRECTLY INITIALIZED (NEGATIVE VALUE) ',/,&
+'@ ITS VALUE IS ',E14.5 ,/,&
+'@ ',/,&
+'@ The turbulence cannot be initialized ',/,&
+'@ Correct the value of UREF (usini1 or interface) or ',/,&
+'@ initialize directly the turbulence with usiniv or ',/,&
+'@ with the interface. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ SCALAR QUANTITIES OUT OF BOUNDS ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Scalar number ',I10,': ',A8 ,/,&
+'@ Minimum value = ',E14.5 ,/,&
+'@ Desired clipping at SCAMIN = ',E14.5 ,/,&
+'@ Maximum value = ',E14.5 ,/,&
+'@ Desired clipping at SCAMAX = ',E14.5 ,/,&
+'@ The bounds are not coherent with the limits SCAMIN and ',/,&
+'@ SCAMAX set in usini1. ',/,&
+'@ ',/,&
+'@ Verify the initialization in usiniv or the restart file ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv ',/,&
+'@ Verify the clipping values in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ NEGATIVE VARIANCE ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Scalar number ',I10,': ',A8 ,/,&
+'@ Minimum value = ',E14.5 ,/,&
+'@ This scalar is a variance (ISCAVR is positive in usini1) ',/,&
+'@ but the initialization in usiniv has some negative ',/,&
+'@ values. ',/,&
+'@ ',/,&
+'@ Verify the initialization in usiniv or the restart file ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv ',/,&
+'@ Verify the variance definition in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3051 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ VARIANCE OUT OF BOUNDS ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Scalar number ',I10,': ',A8 ,/,&
+'@ Minimum value = ',E14.5 ,/,&
+'@ Desired clipping at SCAMIN = ',E14.5 ,/,&
+'@ Maximum value = ',E14.5 ,/,&
+'@ Desired clipping at SCAMAX = ',E14.5 ,/,&
+'@ This scalar is a variance (ISCAVR is positive in usini1) ',/,&
+'@ but the initialization in usiniv has some values out ',/,&
+'@ of the bounds SCAMIN, SCAMAX or lower than 0 and the ',/,&
+'@ desired clipping mode is ICLVFL(',I10,') = ',I10 ,/,&
+'@ ',/,&
+'@ Verify the initialization in usiniv or the restart file ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv ',/,&
+'@ Verify the variance definition and the clipping mode in ',/,&
+'@ usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3090 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE VARIABLES INITIALIZATION ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ THE VARIABLES INITIALIZATION IS INCOMPLETE OR ',/,&
+'@ INCOHERENT WITH THE PARAMETERS VALUE OF THE CALCULATION ',/,&
+'@ ',/,&
+'@ The calculation will not be run (',I10,' errors). ',/,&
+'@ ',/,&
+'@ Refer to the previous warnings for further information. ',/,&
+'@ Pay attention to the initialization of ',/,&
+'@ the time-step ',/,&
+'@ the turbulence ',/,&
+'@ the scalars and variances ',/,&
+'@ the time averages ',/,&
+'@ ',/,&
+'@ Verify usiniv or the restart file. ',/,&
+'@ In the case where the values read in the restart file ',/,&
+'@ are incorrect, they may be modified with usiniv ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/invers.f90 b/src/base/invers.f90
new file mode 100644
index 0000000..947166d
--- /dev/null
+++ b/src/base/invers.f90
@@ -0,0 +1,273 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine invers &
+!================
+
+ ( cnom , idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isym , ipol , ireslp , nitmap , imgrp , &
+ ncymxp , nitmfp , &
+ iwarnp , nfecra , niterf , icycle , iinvpe , &
+ epsilp , rnorm , residu , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dam , xam , smbrp , vx , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! APPEL AUX ROUTINE D'INVERSION DE SYSTEMES LINEAIRE
+! MULTIGRILLE + GRADCO OU JACOBI OU BI-CGSTAB
+! GRADCO
+! JACOBI
+! BI-CGSTAB
+! ON SUPPOSE VX INITIALISE EN ENTREE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! cnom ! a ! <-- ! nom de la variable !
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! isym ! e ! <-- ! indicateur = 1 matrice sym !
+! ! ! ! = 2 matrice non sym !
+! ipol ! e ! <-- ! degre du polynome pour precond !
+! ! ! ! (0 -> diagonal) !
+! ireslp ! e ! <-- ! indicateur = 0 gradco !
+! ! ! ! = 1 jacobi !
+! ! ! ! = 2 cgstab !
+! nitmap ! e ! <-- ! nombre max d'iter pour resol iterativ !
+! imgrp ! e ! <-- ! indicateur = 0 pas de multigrille !
+! ncymxp ! e ! <-- ! nombre de cycles max pour multigrille !
+! nitmfp ! e ! <-- ! nombre d iter sur maillage fin !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! niterf ! e ! --> ! nombre d'iterations effectuees !
+! ! ! ! (non multigrille) !
+! icycle ! e ! --> ! nombre de cycles mgm effectues !
+! iinvpe ! e ! <-- ! indicateur pour annuler les increment !
+! ! ! ! en periodicite de rotation (=2) ou !
+! ! ! ! pour les echanger normalement de !
+! ! ! ! maniere scalaire (=1) !
+! epsilp ! r ! <-- ! precision pour resol iter !
+! rnorm ! r ! <-- ! normalisation du residu !
+! residu ! r ! --> ! residu final non norme !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dam(ncelet ! tr ! <-- ! diagonale (maillage fin si mgm) !
+! xam(nfac,isym ! tr ! <-- ! extradiagonale (maillage fin si mgm) !
+! smbrp(ncelet ! tr ! <-- ! second membre (maillage fin si mgm) !
+! vx (ncelet ! tr ! <-- ! solution du systeme !
+! w1,2,3,4,5,6 ! tr ! --- ! auxiliaires de travail !
+! (ncelet ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+character*8 cnom
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+integer isym , ipol , ireslp , nitmap
+integer imgrp , ncymxp , nitmfp
+integer iwarnp , nfecra
+integer niterf , icycle , iinvpe
+double precision epsilp , rnorm , residu
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dam(ncelet), xam(nfac ,2)
+double precision smbrp(ncelet)
+double precision vx(ncelet)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer lnom
+integer iresds, iresas, nitmds, nitmas
+
+!===============================================================================
+
+! INITIALISATIONS
+
+lnom = len(cnom)
+
+icycle = 0
+niterf = 0
+
+idebia = idbia0
+idebra = idbra0
+
+! RESOLUTION
+
+if( imgrp.eq.1 ) then
+
+ iresds = ireslp
+ iresas = ireslp
+
+ nitmds = nitmfp
+ nitmas = nitmfp
+
+ call resmgr &
+ !==========
+ ( cnom , lnom , ncelet , ncel , nfac , &
+ isym , iresds , iresas , ireslp , ipol , &
+ ncymxp , nitmds , nitmas , nitmap , iinvpe , &
+ iwarnp , icycle , niterf , epsilp , rnorm , residu , &
+ ifacel , smbrp , vx )
+
+elseif(imgrp.eq.0) then
+
+ if (ireslp.ge.0 .and. ireslp.le. 2) then
+
+ call reslin &
+ !==========
+ ( cnom , lnom , ncelet , ncel , nfac , &
+ isym , ireslp , ipol , nitmap , iinvpe , &
+ iwarnp , niterf , epsilp , rnorm , residu , &
+! ------ ------
+ ifacel , dam , xam , smbrp , vx )
+! -----
+
+ else
+ write(nfecra,1000) cnom, ireslp
+ call csexit (1)
+ endif
+
+endif
+
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format('INVERS APPELE POUR ',A8,' AVEC IRESOL = ', I10)
+
+#else
+
+ 1000 format('INVERS CALLED FOR ',A8,' WITH IRESOL = ', I10)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/iprbla.f90 b/src/base/iprbla.f90
new file mode 100644
index 0000000..2657346
--- /dev/null
+++ b/src/base/iprbla.f90
@@ -0,0 +1,88 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ integer function iprbla &
+!================
+
+ ( chaine, lch )
+
+!==============================================================================
+
+! FONCTION :
+! --------
+
+! DETERMINER LA POSITION DU PREMIER CARACTERE NON BLANC DANS
+! CHAINE DE LONGUEUR LCH AVEC LA CONVENTION DE ZERO SI
+! LA CHAINE EST BLANCHE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! chaine ! e ! <-- ! chaine a verifier !
+! lch ! e ! <-- ! longueur de la chaine !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+! Arguments
+
+character chaine*(*)
+integer lch
+
+! VARIABLES LOCALES
+
+integer ii
+
+!===============================================================================
+
+!---------------
+! POSITIONNEMENT
+!---------------
+
+do 10 ii = 1, lch
+ IF ( CHAINE (II:II) .NE. ' ' ) THEN
+ iprbla = ii
+ goto 20
+ endif
+ 10 continue
+iprbla = 0
+
+ 20 continue
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/itrgrp.f90 b/src/base/itrgrp.f90
new file mode 100644
index 0000000..21bb795
--- /dev/null
+++ b/src/base/itrgrp.f90
@@ -0,0 +1,401 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine itrgrp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iphydp , iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ fextx , fexty , fextz , &
+ pvar , coefap , coefbp , viscf , viscb , &
+ viselx , visely , viselz , &
+ diverg , &
+ dpdx , dpdy , dpdz , dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! INCREMENTATION DE LA DIVERGENCE DU FLUX DE MASSE
+! A PARTIR DE GRAD(P)
+! grad(P) = GRADIENT FACETTE
+
+! . . -- ---> -->
+! m = m - \ Visc grad(P) . n
+! ij ij /__ ij ij ij
+! j
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! init ! e ! <-- ! > 0 : initialisation du flux de masse !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! iphydp ! e ! <-- ! indicateur de prise en compte de la !
+! ! ! ! pression hydrostatique !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! pvar (ncelet ! tr ! <-- ! variable (pression) !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour pvar !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! viscf (nfac) ! tr ! <-- ! "viscosite" face interne(dt*surf/dist !
+! viscb (nfabor ! tr ! <-- ! "viscosite" face de bord(dt*surf/dist !
+! viselx(ncelet ! tr ! <-- ! "viscosite" par cellule dir x !
+! visely(ncelet ! tr ! <-- ! "viscosite" par cellule dir y !
+! viselz(ncelet ! tr ! <-- ! "viscosite" par cellule dir z !
+! diverg(ncelet ! tr ! <-- ! divergence du flux de masse !
+! fextx,y,z ! tr ! <-- ! force exterieure generant la pression !
+! (ncelet) ! ! ! hydrostatique !
+! dpd.(ncelet ! tr ! --- ! tableau de travail pour le grad de p !
+! dpdxa,y,z ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet ! ! ! avec decentrement amont !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer init , inc , imrgra , iccocg
+integer nswrgp , imligp
+integer iwarnp , iphydp , nfecra
+double precision epsrgp , climgp , extrap
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pvar(ncelet), coefap(nfabor), coefbp(nfabor)
+double precision viscf(nfac), viscb(nfabor)
+double precision viselx(ncelet), visely(ncelet), viselz(ncelet)
+double precision diverg(ncelet)
+double precision fextx(ncelet),fexty(ncelet),fextz(ncelet)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ii, jj, iij, iii, ivar
+integer idimte, itenso
+double precision pfac,pip
+double precision dpxf , dpyf , dpzf , flumas, flumab
+double precision dijpfx, dijpfy, dijpfz
+double precision diipbx, diipby, diipbz
+double precision dist , surfan
+double precision dijx , dijy , dijz
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if( init.ge.1 ) then
+ do ii = 1, ncelet
+ diverg(ii) = 0.d0
+ enddo
+elseif(init.eq.0.and.ncelet.gt.ncel) then
+ do ii = ncel+1, ncelet
+ diverg(ii) = 0.d0
+ enddo
+elseif(init.ne.0) then
+ write(nfecra,1000) init
+ call csexit (1)
+endif
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (pvar)
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar )
+endif
+
+!===============================================================================
+! 2. INCREMENT DU FLUX DE MASSE SS TECHNIQUE DE RECONSTRUCTION
+!===============================================================================
+
+if( nswrgp.le.1 ) then
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ flumas = viscf(ifac)*(pvar(ii) -pvar(jj))
+ diverg(ii) = diverg(ii) + flumas
+ diverg(jj) = diverg(jj) - flumas
+
+ enddo
+
+! FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pvar(ii)
+
+ flumab = viscb(ifac)*( pvar(ii) -pfac )
+ diverg(ii) = diverg(ii) + flumab
+
+ enddo
+
+endif
+
+
+!===============================================================================
+! 3. INCREMENTATION DU FLUX DE MASSE AVEC TECHNIQUE DE
+! RECONSTRUCTION SI LE MAILLAGE EST NON ORTHOGONAL
+!===============================================================================
+
+if( nswrgp.gt.1 ) then
+
+! CALCUL DU GRADIENT
+
+! IVAR ne sert a GRDCEL que si la variable est une composante de la vitesse
+! ou de Rij pour la periodicite. Ici la variable est soit la pression
+! soit phi, donc on peut mettre IVAR=0
+ ivar = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ fextx , fexty , fextz , &
+ pvar , coefap , coefbp , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (viselx)
+ !==========
+ call parcom (visely)
+ !==========
+ call parcom (viselz)
+ !==========
+endif
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ viselx , viselx , viselx , &
+ visely , visely , visely , &
+ viselz , viselz , viselz )
+endif
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+ dist = ra(idist-1+ifac)
+ surfan = ra(isrfan-1+ifac)
+
+!---> DIJ = IJ - (IJ.N) N
+ dijx = (xyzcen(1,jj)-xyzcen(1,ii))-dijpfx
+ dijy = (xyzcen(2,jj)-xyzcen(2,ii))-dijpfy
+ dijz = (xyzcen(3,jj)-xyzcen(3,ii))-dijpfz
+
+ dpxf = 0.5d0*(viselx(ii)*dpdx(ii) + viselx(jj)*dpdx(jj))
+ dpyf = 0.5d0*(visely(ii)*dpdy(ii) + visely(jj)*dpdy(jj))
+ dpzf = 0.5d0*(viselz(ii)*dpdz(ii) + viselz(jj)*dpdz(jj))
+
+ flumas = viscf(ifac)*( pvar(ii) -pvar(jj) ) &
+ + ( dpxf * dijx &
+ + dpyf * dijy &
+ + dpzf * dijz )*surfan/dist
+ diverg(ii) = diverg(ii) + flumas
+ diverg(jj) = diverg(jj) - flumas
+
+ enddo
+
+! FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ pip = pvar(ii) + &
+ dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+
+ flumab = viscb(ifac)*( pip -pfac )
+ diverg(ii) = diverg(ii) + flumab
+
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format('ITRGRP APPELE AVEC INIT = ',I10)
+
+#else
+
+ 1000 format('ITRGRP CALLED WITH INIT = ',I10)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/itrmas.f90 b/src/base/itrmas.f90
new file mode 100644
index 0000000..99c4cf3
--- /dev/null
+++ b/src/base/itrmas.f90
@@ -0,0 +1,395 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine itrmas &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iphydp , iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ fextx , fexty , fextz , &
+ pvar , coefap , coefbp , viscf , viscb , &
+ viselx , visely , viselz , &
+ flumas , flumab , &
+ dpdx , dpdy , dpdz , dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! INCREMENTATION DU FLUX DE MASSE A PARTIR DE GRAD(P)
+! P = PRESSION, INCREMENT DE PRESSION, DOUBLE INCREMENT DE PRESSION
+! grad(P) = GRADIENT FACETTE POUR L'INSTANT
+
+! . . ---> -->
+! m = m - Visc grad(P) . n
+! ij ij ij ij ij
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! init ! e ! <-- ! > 0 : initialisation du flux de masse !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! iphydp ! e ! <-- ! indicateur de prise en compte de la !
+! ! ! ! pression hydrostatique !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! pvar (ncelet ! tr ! <-- ! variable (pression) !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour pvar !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! viscf (nfac) ! tr ! <-- ! "viscosite" face interne(dt*surf/dist !
+! viscb (nfabor ! tr ! <-- ! "viscosite" face de bord(dt*surf/dist !
+! viselx(ncelet ! tr ! <-- ! "viscosite" par cellule dir x !
+! visely(ncelet ! tr ! <-- ! "viscosite" par cellule dir y !
+! viselz(ncelet ! tr ! <-- ! "viscosite" par cellule dir z !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! fextx,y,z ! tr ! <-- ! force exterieure generant la pression !
+! (ncelet) ! ! ! hydrostatique !
+! dpd.(ncelet ! tr ! --- ! tableau de travail pour le grad de p !
+! dpdxa,y,z ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet ! ! ! avec decentrement amont !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer init , inc , imrgra , iccocg
+integer nswrgp , imligp
+integer iwarnp , iphydp , nfecra
+double precision epsrgp , climgp , extrap
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pvar(ncelet), coefap(nfabor), coefbp(nfabor)
+double precision viscf(nfac), viscb(nfabor)
+double precision viselx(ncelet), visely(ncelet), viselz(ncelet)
+double precision flumas(nfac), flumab(nfabor)
+double precision fextx(ncelet),fexty(ncelet),fextz(ncelet)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ii, jj, iij, iii
+integer idimte, itenso
+double precision pfac,pip
+double precision dpxf , dpyf , dpzf ,surfan, dist
+double precision dijpfx, dijpfy, dijpfz
+double precision diipbx, diipby, diipbz
+double precision dijx , dijy , dijz
+
+!===============================================================================
+
+
+! C'est penible de passer viscf et viscel qui portent une info
+! similaire
+
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if( init.ge.1 ) then
+ do ifac = 1, nfac
+ flumas(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ flumab(ifac) = 0.d0
+ enddo
+elseif(init.ne.0) then
+ write(nfecra,1000) init
+ call csexit (1)
+endif
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (pvar)
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar )
+endif
+
+!===============================================================================
+! 2. INCREMENT DU FLUX DE MASSE SS TECHNIQUE DE RECONSTRUCTION
+!===============================================================================
+
+if( nswrgp.le.1 ) then
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ flumas(ifac) = flumas(ifac) + viscf(ifac)*(pvar(ii) -pvar(jj))
+
+ enddo
+
+! FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pvar(ii)
+
+ flumab(ifac) = flumab(ifac) +viscb(ifac)*( pvar(ii) -pfac )
+
+ enddo
+
+endif
+
+
+!===============================================================================
+! 3. INCREMENTATION DU FLUX DE MASSE AVEC TECHNIQUE DE
+! RECONSTRUCTION SI LE MAILLAGE EST NON ORTHOGONAL
+!===============================================================================
+
+if( nswrgp.gt.1 ) then
+
+! CALCUL DU GRADIENT
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipr(1) , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ fextx , fexty , fextz , &
+ pvar , coefap , coefbp , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (viselx)
+ !==========
+ call parcom (visely)
+ !==========
+ call parcom (viselz)
+ !==========
+endif
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ viselx , viselx , viselx , &
+ visely , visely , visely , &
+ viselz , viselz , viselz )
+endif
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ dpxf = 0.5d0*(viselx(ii)*dpdx(ii) + viselx(jj)*dpdx(jj))
+ dpyf = 0.5d0*(visely(ii)*dpdy(ii) + visely(jj)*dpdy(jj))
+ dpzf = 0.5d0*(viselz(ii)*dpdz(ii) + viselz(jj)*dpdz(jj))
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+!---> DIJ = IJ - (IJ.N) N
+ dijx = (xyzcen(1,jj)-xyzcen(1,ii))-dijpfx
+ dijy = (xyzcen(2,jj)-xyzcen(2,ii))-dijpfy
+ dijz = (xyzcen(3,jj)-xyzcen(3,ii))-dijpfz
+
+ dist = ra(idist-1+ifac)
+ surfan = ra(isrfan-1+ifac)
+
+ flumas(ifac) = flumas(ifac) &
+ + viscf(ifac)*( pvar(ii) -pvar(jj) ) &
+ + ( dpxf * dijx &
+ + dpyf * dijy &
+ + dpzf * dijz )*surfan/dist
+
+ enddo
+
+! FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ pip = pvar(ii) &
+ + dpdx(ii)*diipbx &
+ + dpdy(ii)*diipby + dpdz(ii)*diipbz
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+
+ flumab(ifac) = flumab(ifac) +viscb(ifac)*( pip -pfac )
+
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format('ITRMAS APPELE AVEC INIT = ',I10)
+
+#else
+
+ 1000 format('ITRMAS CALLED WITH INIT = ',I10)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/lecamo.f90 b/src/base/lecamo.f90
new file mode 100644
index 0000000..ec597a8
--- /dev/null
+++ b/src/base/lecamo.f90
@@ -0,0 +1,210 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lecamo &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nnod , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , frcxt , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+
+! FONCTION :
+! ----------
+! LECTURE DES FICHIERS SUITE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension du calcul !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nnod ! e ! <-- ! nombre de noeuds !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! dt(ncelet) ! tr ! --> ! pas de temps !
+! rtp ! tr ! --> ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ) !
+! propce ! tr ! --> ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! --> ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! --> ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! --> ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! frcxt(ncelet, ! tr ! --> ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "optcal.h"
+include "pointe.h"
+include "numvar.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor, nnod
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision dt(ncelet), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision frcxt(ncelet,3,nphas)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+
+!===============================================================================
+
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+write(nfecra,1000)
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. LECTURE DU FICHIER SUITE PRINCIPAL
+!===============================================================================
+
+call lecamp (idebia , idebra , &
+! ==========
+ ncelet , ncel , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ rtp , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 3. LECTURE DU FICHIER SUITE AUXILIAIRE
+!===============================================================================
+
+if (ileaux.eq.1) then
+
+ call lecamx (idebia , idebra , &
+! ==========
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nnod , nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , frcxt , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+!===============================================================================
+! 4. SORTIE
+!===============================================================================
+
+write(nfecra,2000)
+
+!===============================================================================
+! 5. FORMATS
+!===============================================================================
+
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ----------------------------------------------------------- ',/,&
+ /,&
+ 3X,'** LECTURE DES FICHIERS SUITE PRINCIPAL ET AUXILIAIRE',/,&
+ 3X,' ------------------------------------------------- ',/)
+ 2000 format(/, &
+' ----------------------------------------------------------- ',/)
+
+#else
+
+ 1000 format(/, &
+' ----------------------------------------------------------- ',/,&
+ /,&
+ 3X,'** READING MAIN AND AUXILIARY RESTART FILES' ,/,&
+ 3X,' ----------------------------------------' ,/)
+ 2000 format(/, &
+' ----------------------------------------------------------- ',/)
+
+#endif
+
+
+return
+end
diff --git a/src/base/lecamp.f90 b/src/base/lecamp.f90
new file mode 100644
index 0000000..d2b4b5e
--- /dev/null
+++ b/src/base/lecamp.f90
@@ -0,0 +1,1887 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lecamp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ rtp , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+
+! FONCTION :
+! ----------
+! LECTURE DU FICHIER SUITE PRINCIPAL
+
+! ON S'ARRETE SI ERREUR DE LECTURE OU
+! OU NCEL DIFFERENT
+! OU NTPABS.GE.NTMABS
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! jphas ! e ! <-- ! nombre de phases du calcul precedent !
+! ljtu ! e ! <-- ! longueur de jturb !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! jturb ! te ! <-- ! modeles de turb calcul precedent !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rtp ! tr ! --> ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "optcal.h"
+include "pointe.h"
+include "numvar.h"
+include "albase.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision rtp(ncelet,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character rubriq*64,rubrik*64,car4*4
+character cindfp*2
+character cphase(nphsmx)*2
+
+integer idebia, idebra
+integer iel
+integer iphas , ivar , iscal , ii , ivers
+integer jphas , jvar , jscal , jscaus, jscapp
+integer ikiph , ieiph , iomgip
+integer ir11ip, ir22ip, ir33ip
+integer ir12ip, ir13ip, ir23ip
+integer iok , ncelok, nfaiok, nfabok, nsomok
+integer ierror, irtyp, itysup, nbval
+integer nberro, ilecec
+integer iturph, jturph, itytph, jtytph
+integer nfmtph, nfmtsc, nfmtru
+integer jturb(nphsmx), jtytur(nphsmx), jale
+integer impamo
+double precision d2s3, d2s3xk
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! ---> Banniere
+write(nfecra,1000)
+
+! Longueur pour format de print
+nfmtru = 36
+
+! ---> On code en chaine le numero des phases et scalaires
+
+! Nombre de phases, de scalaires max pour les formats choisis
+nfmtph = 99
+nfmtsc = 9999
+
+! Indefini a 2 caracteres
+CINDFP='YY'
+
+! Codage en chaine de caracteres du numero de la phase
+! Aller jusqu'a NPHAS suffirait
+! On suppose que les phases ont le meme numero en suite de calcul
+do iphas = 1, min(nphas,nfmtph)
+ WRITE(CPHASE(IPHAS),'(I2.2)') IPHAS
+enddo
+do iphas = min(nphas,nfmtph)+1,nphas
+ cphase(iphas) = cindfp
+enddo
+
+! Avertissement
+if(nphsmx.gt.nfmtph) then
+ write(nfecra,8000)nfmtph,nphsmx
+endif
+if(nscamx.gt.nfmtsc) then
+ write(nfecra,8001)nfmtsc,nscamx
+endif
+
+!===============================================================================
+! 1. OUVERTURE DU FICHIER OU STOP
+!===============================================================================
+
+! ---> Ouverture du fichier (ILECEC = 1 : lecture)
+ilecec = 1
+call opnsui(ficamo,len(ficamo),ilecec,impamo,ierror)
+!==========
+if (ierror.ne.0) then
+ write(nfecra,9100) ficamo
+ call csexit (1)
+endif
+
+! ---> Debut de la lecture
+write(nfecra,1100)
+
+!===============================================================================
+! 2. ENTETES DU FICHIER SUITE OU STOP
+!===============================================================================
+
+! ---> Rubrique "fichier suite ppal"
+! Pourrait porter le numero de version si besoin.
+! On ne se sert pas de IVERS pour le moment.
+
+itysup = 0
+nbval = 1
+irtyp = 1
+RUBRIQ = 'version_fichier_suite_principal'
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,ivers, &
+ ierror)
+
+if (ierror.ne.0) then
+ write(nfecra,9200)ficamo
+ call csexit (1)
+endif
+
+! ---> Tests sur les supports
+
+call tstsui(impamo,ncelok,nfaiok,nfabok,nsomok)
+!==========
+
+if (ncelok.eq.0) then
+ write(nfecra,9201)
+ call csexit (1)
+endif
+
+! Inutile de tester les supports "faces internes" et "faces de bord"
+! ils ne sont pas utilises ici
+! IF (NFAIOK.EQ.0) WRITE(NFECRA,8200)
+! IF (NFABOK.EQ.0) WRITE(NFECRA,8205)
+
+
+! ---> Tests sur les nombres de variables
+
+nberro = 0
+
+itysup = 0
+nbval = 1
+irtyp = 1
+
+RUBRIQ = 'nombre_variables'
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,jvar, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_scalaires'
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,jscal, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_scalaires_us'
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,jscaus, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_scalaires_pp'
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,jscapp, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'nombre_phases'
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,jphas, &
+ ierror)
+nberro=nberro+ierror
+
+
+! ---> On s'arrete si erreur
+
+if (nberro.ne.0) then
+ write(nfecra,9210)
+ call csexit (1)
+endif
+
+! ---> On previent si des parametres sont differents
+
+if ( jvar .ne.nvar .or. jscal .ne.nscal .or. &
+ jscaus.ne.nscaus .or. jscapp.ne.nscapp .or. &
+ jphas .ne.nphas ) then
+ write(nfecra,8210) &
+ jvar, jscal, jscaus, jscapp, jphas, &
+ nvar, nscal, nscaus, nscapp, nphas
+endif
+
+! ---> Fin de la lecture des dimensions
+write(nfecra,1299)
+
+!===============================================================================
+! 3. CORRESPONDANCE DES SCALAIRES OU STOP
+!===============================================================================
+
+! ---> Correspondance avec les scalaires du calcul precedent.
+! Le tableau ISCOLD manipule des numero de scalaire "globaux"
+! i.e. de 1 a NSCAL (et non pas de 1 a NSCAUS ou 1 a NSCAPP)
+
+! On complete si besoin le tableau ISCOLD. Si ses valeurs sont
+! egales a -999, c'est que l'utilisateur ne les a pas modifiees,
+! et qu'il ne souhaite donc rien de particulier quant a la
+! correspondance des nouveaux et des anciens scalaires.
+! On etablit alors la correspondance
+! avec l'ancien scalaire (qui est peut etre une variance) de meme
+! numero s'il existe ou a rien du tout sinon.
+
+! Pour bien faire la difference entre scalaires utilisateurs et
+! physiques particulieres, on part du principe suivant :
+! par defaut
+! pour le nouveau scalaire utilisateur j
+! l'ancien scalaire correspondant est
+! l'ancien scalaire utilisateur j s'il existe
+! et rien sinon
+! pour le nouveau scalaire physique particuliere j
+! l'ancien scalaire correspondant est pour le moment
+! l'ancien scalaire physique particuliere j s'il existe
+! et rien sinon
+! a terme, on pourra preciser les correspondances plus
+! finement, en particulier si on souhaite faire des suites
+! entre deux modeles differents.
+
+! Attention, on suppose ici que les scalaires sont numerotes dans
+! l'ordre scalaires utilisateurs (NSCAUS) puis scalaires
+! physiques particulieres (NSCAPP)
+
+if(nscaus.gt.0) then
+ do ii = 1, nscaus
+ iscal = ii
+ if(iscold(iscal).eq.-999) then
+ if(ii.le.jscaus) then
+ iscold(iscal) = ii
+ else
+ iscold(iscal) = 0
+ endif
+ endif
+ enddo
+endif
+
+if(nscapp.gt.0) then
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ if(iscold(iscal).eq.-999) then
+ if(ii.le.jscapp) then
+ iscold(iscal) = ii+jscaus
+ else
+ iscold(iscal) = 0
+ endif
+ endif
+ enddo
+endif
+
+! On verifie les valeurs du tableau ISCOLD. Elles doivent toutes
+! etre inferieures a JSCAL et positives ou nulles.
+if(nscal.gt.0) then
+ iok = 0
+ do iscal = 1, nscal
+ if(iscold(iscal).gt.jscal) then
+ write(nfecra,9320)iscal, iscold(iscal), jscal
+ iok = iok+1
+ endif
+ if(iscold(iscal).lt.0) then
+ write(nfecra,9321)iscal, iscold(iscal), jscal
+ iok = iok+1
+ endif
+ enddo
+ if(iok.ne.0) then
+ write(nfecra,9330) iok
+ call csexit (1)
+ endif
+endif
+
+!===============================================================================
+! 4. OPTIONS OU STOP
+!===============================================================================
+
+! ---> Lecture des options
+
+nberro = 0
+
+! Nombre de pas de temps, instant precedent
+
+RUBRIQ = 'nbre_pas_de_temps'
+itysup = 0
+nbval = 1
+irtyp = 1
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,ntpabs, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'instant_precedent'
+itysup = 0
+nbval = 1
+irtyp = 2
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,ttpabs, &
+ ierror)
+nberro=nberro+ierror
+
+
+! Modeles de turbulence
+
+do iphas = 1, min(nphas,jphas)
+ RUBRIQ = 'modele_turbulence_phase'//CPHASE(IPHAS)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jturb(iphas),ierror)
+ nberro=nberro+ierror
+ jtytur(iphas)=jturb(iphas)/10
+enddo
+
+! ---> Stop si erreur
+if (nberro.ne.0) then
+ write(nfecra,9400)
+ call csexit (1)
+endif
+
+! Methode ALE
+
+nberro = 0
+
+RUBRIQ = 'methode_ALE'
+itysup = 0
+nbval = 1
+irtyp = 1
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp,jale, &
+ ierror)
+nberro=nberro+ierror
+
+! ---> Message si erreur (pas de stop pour compatibilite avec les fichiers anterieurs)
+! -> on n'affiche le message que si IALE=1 (sinon RAS)
+if (nberro.ne.0) then
+ if (iale.eq.1) write(nfecra,9401)
+ jale = 0
+endif
+
+! ---> Stop si pas de temps incoherent
+if(ntpabs.ge.ntmabs.and.inpdt0.eq.0) then
+ write(nfecra,9410)ntpabs,ntmabs
+ call csexit (1)
+endif
+
+! ---> Informations
+write(nfecra,2410) ntpabs
+write(nfecra,2411) ttpabs
+
+! ---> Donnees modifiees
+do iphas = 1, min(nphas,jphas)
+ if (iturb(iphas) .ne. jturb(iphas)) &
+ write(nfecra,8410) iphas,iturb(iphas), &
+ iphas,jturb(iphas), &
+ iphas
+enddo
+
+! ---> Si le calcul precedent etait en ALE, on DOIT relire les
+! coordonnees des noeuds dans le fichier auxiliaire
+if (iale.eq.1 .and. jale.eq.1) then
+ if (ileaux.ne.1) then
+ write(nfecra,9402)jale,iale,ileaux
+ call csexit(1)
+ endif
+endif
+
+! ---> Fin de la lecture des options
+write(nfecra,1499)
+
+!================================================================
+! 5. LECTURE DES VARIABLES
+!================================================================
+
+nberro = 0
+
+! ---> Pression
+! (a priori une seule (non fonction du nombre de phases))
+
+RUBRIQ = 'pression_ce_phase'//CPHASE(1)
+itysup = 1
+nbval = 1
+irtyp = 2
+call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ipr(1)),ierror)
+nberro=nberro+ierror
+
+
+! ---> Vitesse et turbulence
+! On boucle sur les phases communes afin de recuperer
+! les infos existantes dans le fichier suite.
+! Pour les nouvelles phases : deja fait par defaut dans INIVA0
+
+do iphas = 1, min(jphas,nphas)
+
+ iturph = iturb(iphas)
+ jturph = jturb(iphas)
+ itytph = itytur(iphas)
+ jtytph = jtytur(iphas)
+
+! Vitesse
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'vitesse_u_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iu(iphas)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'vitesse_v_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iv(iphas)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'vitesse_w_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iw(iphas)),ierror)
+ nberro=nberro+ierror
+
+
+
+! Turbulence (ke -> ke, ke -> rij, rij -> ke, rij -> rij ...)
+! Quand on ne sait pas deduire les grandeurs turbulence des infos
+! disponibles dans le fichier suite, on ne fait rien :
+! les variables gardent alors les initialisations par defaut
+! faites dans INIVA0
+
+
+! -- Le nouveau calcul est en k-epsilon
+
+
+ if (itytph.eq.2) then
+
+! * k-e ou v2f -> k-e
+
+ if(jtytph.eq.2 .or. jturph.eq.50) then
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ik(iphas)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iep(iphas)),ierror)
+ nberro=nberro+ierror
+
+! * rij -> k-e
+
+ elseif(jtytph.eq.3) then
+
+ ikiph = ik (iphas)
+ ieiph = iep(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'R11_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ikiph),ierror)
+ nberro=nberro+ierror
+
+! La variable epsilon sert de tableau de travail
+ RUBRIQ = 'R22_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+
+ do iel = 1, ncel
+ rtp(iel,ikiph) = rtp(iel,ikiph) + rtp(iel,ieiph)
+ enddo
+
+ RUBRIQ = 'R33_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+
+ do iel = 1, ncel
+ rtp(iel,ikiph) = 0.5d0*(rtp(iel,ikiph)+rtp(iel,ieiph))
+ enddo
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+
+! * k-omega -> k-e
+
+ else if(jturph.eq.60) then
+
+ ikiph = ik (iphas)
+ ieiph = iep(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ikiph),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'omega_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+! On transforme ensuite omega en epsilon
+ do iel = 1, ncel
+ rtp(iel,ieiph) = cmu*rtp(iel,ieiph)*rtp(iel,ikiph)
+ enddo
+
+ endif
+! Rq : laminaire -> k-e (On ne fait rien, deja fait dans iniva0)
+
+
+! -- Le nouveau calcul est en Rij-epsilon
+
+ elseif(itytph.eq.3) then
+
+! * k-e ou v2f -> rij
+
+ if (jtytph.eq.2 .or. jturph.eq.50) then
+
+ ir11ip=ir11(iphas)
+ ir22ip=ir22(iphas)
+ ir33ip=ir33(iphas)
+ ir12ip=ir12(iphas)
+ ir13ip=ir13(iphas)
+ ir23ip=ir23(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ir11ip),ierror)
+ nberro=nberro+ierror
+
+ d2s3 = 2.d0/3.d0
+ do iel = 1, ncel
+ d2s3xk = rtp(iel,ir11ip)*d2s3
+ rtp(iel,ir11ip) = d2s3xk
+ rtp(iel,ir22ip) = d2s3xk
+ rtp(iel,ir33ip) = d2s3xk
+ rtp(iel,ir12ip) = 0.d0
+ rtp(iel,ir13ip) = 0.d0
+ rtp(iel,ir23ip) = 0.d0
+ enddo
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iep(iphas)),ierror)
+ nberro=nberro+ierror
+
+! * rij -> rij
+
+ elseif(jtytph.eq.3) then
+
+ do ii = 1, 7
+ if (ii .eq.1) then
+ RUBRIQ = 'R11_ce_phase'//CPHASE(IPHAS)
+ ivar = ir11(iphas)
+ elseif (ii .eq.2) then
+ RUBRIQ = 'R22_ce_phase'//CPHASE(IPHAS)
+ ivar = ir22(iphas)
+ elseif (ii .eq.3) then
+ RUBRIQ = 'R33_ce_phase'//CPHASE(IPHAS)
+ ivar = ir33(iphas)
+ elseif (ii .eq.4) then
+ RUBRIQ = 'R12_ce_phase'//CPHASE(IPHAS)
+ ivar = ir12(iphas)
+ elseif (ii .eq.5) then
+ RUBRIQ = 'R13_ce_phase'//CPHASE(IPHAS)
+ ivar = ir13(iphas)
+ elseif (ii .eq.6) then
+ RUBRIQ = 'R23_ce_phase'//CPHASE(IPHAS)
+ ivar = ir23(iphas)
+ elseif (ii .eq.7) then
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ ivar = iep(iphas)
+ endif
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ivar),ierror)
+ nberro=nberro+ierror
+ enddo
+
+! * k-omega -> rij
+
+ else if (jturph.eq.60) then
+
+ ir11ip=ir11(iphas)
+ ir22ip=ir22(iphas)
+ ir33ip=ir33(iphas)
+ ir12ip=ir12(iphas)
+ ir13ip=ir13(iphas)
+ ir23ip=ir23(iphas)
+ ieiph =iep (iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ir11ip),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'omega_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+! On transforme ensuite omega en epsilon
+ do iel = 1, ncel
+ rtp(iel,ieiph) = cmu*rtp(iel,ieiph)*rtp(iel,ir11ip)
+ enddo
+
+ d2s3 = 2.d0/3.d0
+ do iel = 1, ncel
+ d2s3xk = rtp(iel,ir11ip)*d2s3
+ rtp(iel,ir11ip) = d2s3xk
+ rtp(iel,ir22ip) = d2s3xk
+ rtp(iel,ir33ip) = d2s3xk
+ rtp(iel,ir12ip) = 0.d0
+ rtp(iel,ir13ip) = 0.d0
+ rtp(iel,ir23ip) = 0.d0
+ enddo
+
+ endif
+! Rq : laminaire -> rij (On ne fait rien, deja fait dans iniva0)
+
+! -- Le nouveau calcul est en v2f
+
+ elseif(iturph.eq.50) then
+
+! * k-e -> v2f
+
+ if(jtytph.eq.2) then
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ik(iphas)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iep(iphas)),ierror)
+ nberro=nberro+ierror
+! On laisse pour phi et fb les initialisations de iniva0
+
+! * rij -> v2f
+
+ elseif(jtytph.eq.3) then
+
+ ikiph = ik (iphas)
+ ieiph = iep(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'R11_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ikiph),ierror)
+ nberro=nberro+ierror
+
+! La variable epsilon sert de tableau de travail
+ RUBRIQ = 'R22_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+
+ do iel = 1, ncel
+ rtp(iel,ikiph) = rtp(iel,ikiph) + rtp(iel,ieiph)
+ enddo
+
+ RUBRIQ = 'R33_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+
+ do iel = 1, ncel
+ rtp(iel,ikiph) = 0.5d0*(rtp(iel,ikiph)+rtp(iel,ieiph))
+ enddo
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+! On laisse pour phi et fb l'initialisations de iniva0
+! (le v2 qui intervient dans phi n'est pas vraiment une composante de Rij
+! et qui plus est, on ne saurait pas quelle composante prendre ...)
+
+! * v2f -> v2f
+
+ elseif(jturph.eq.50) then
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ik(iphas)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iep(iphas)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'phi_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iphi(iphas)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'fb_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ifb(iphas)),ierror)
+ nberro=nberro+ierror
+! * k-omega -> v2f
+
+ else if(jturph.eq.60) then
+
+ ikiph = ik (iphas)
+ ieiph = iep(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ikiph),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'omega_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ieiph),ierror)
+ nberro=nberro+ierror
+! On transforme ensuite omega en epsilon
+ do iel = 1, ncel
+ rtp(iel,ieiph) = cmu*rtp(iel,ieiph)*rtp(iel,ikiph)
+ enddo
+! On laisse pour phi et fb l'initialisations de iniva0
+
+
+ endif
+! Rq : laminaire -> v2f (On ne fait rien, deja fait dans iniva0)
+
+
+! -- Le nouveau calcul est en k-omega
+
+ else if (iturph.eq.60) then
+
+! * k-e ou v2f -> k-omega
+
+ if(jtytph.eq.2 .or. jturph.eq.50) then
+
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ikiph),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iomgip),ierror)
+ nberro=nberro+ierror
+! On transforme ensuite epsilon en omega
+ do iel = 1, ncel
+ rtp(iel,iomgip) = rtp(iel,iomgip)/cmu/rtp(iel,ikiph)
+ enddo
+
+! * rij -> k-omega
+
+ elseif(jtytph.eq.3) then
+
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'R11_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ikiph),ierror)
+ nberro=nberro+ierror
+
+! La variable omega sert de tableau de travail
+ RUBRIQ = 'R22_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iomgip),ierror)
+ nberro=nberro+ierror
+
+ do iel = 1, ncel
+ rtp(iel,ikiph) = rtp(iel,ikiph) + rtp(iel,iomgip)
+ enddo
+
+ RUBRIQ = 'R33_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iomgip),ierror)
+ nberro=nberro+ierror
+
+ do iel = 1, ncel
+ rtp(iel,ikiph) = 0.5d0*(rtp(iel,ikiph)+rtp(iel,iomgip))
+ enddo
+
+ RUBRIQ = 'eps_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iomgip),ierror)
+ nberro=nberro+ierror
+! On transforme ensuite epsilon en omega
+ do iel = 1, ncel
+ rtp(iel,iomgip) = rtp(iel,iomgip)/cmu/rtp(iel,ikiph)
+ enddo
+
+! * k-omega -> k-omega
+
+ else if(jturph.eq.60) then
+
+ ikiph = ik (iphas)
+ iomgip= iomg(iphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'k_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ikiph),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'omega_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iomgip),ierror)
+ nberro=nberro+ierror
+
+ endif
+! Rq : laminaire -> k-omega (On ne fait rien, deja fait dans iniva0)
+
+
+! -- Le nouveau calcul est en laminaire, longueur de melange ou LES
+! --> rien a lire
+
+ endif
+
+enddo
+! Fin de la boucle sur les phases communes
+
+if (nberro.ne.0) then
+ write(nfecra,9510)
+ call csexit (1)
+endif
+
+! ---> Fin de la lecture des variables pression, vitesse, turbulence
+write(nfecra,1598)
+
+
+! ---> Scalaires
+
+nberro = 0
+
+if(nscal.gt.0) then
+ do iscal = 1, nscal
+ ivar = isca(iscal)
+! Si le scalaire existait precedemment on le lit
+! sinon on ne fait rien (init par defaut dans INIVA0)
+ if (iscold(iscal).gt.0) then
+ if(iscold(iscal).le.nfmtsc) then
+ WRITE(CAR4,'(I4.4)')ISCOLD(ISCAL)
+ RUBRIQ = 'scalaire_ce_'//CAR4
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ivar),ierror)
+ nberro=nberro+ierror
+ else
+ ierror= -1
+ nberro=nberro+ierror
+ endif
+ if(ierror.ne.0) then
+ rubrik = rubriq(1:1)
+ do ii = 2, min(len(rubriq),nfmtru)
+ rubrik = rubrik(1:ii-1)//rubriq(ii:ii)
+ enddo
+ do ii = min(len(rubriq),nfmtru)+1,nfmtru
+ RUBRIK = RUBRIK(1:II-1)//' '
+ enddo
+ write(nfecra,9511)rubrik
+ endif
+ endif
+ enddo
+endif
+
+if (nberro.ne.0) then
+ write(nfecra,9512)
+ call csexit (1)
+endif
+
+write(nfecra,1599)
+
+
+! ---> Vitesse de maillage en ALE
+
+if (iale.eq.1 .and. jale.eq.1) then
+
+ nberro = 0
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'vit_maillage_u_ce'
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iuma),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'vit_maillage_v_ce'
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,ivma),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'vit_maillage_w_ce'
+ call lecsui(impamo,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rtp(1,iwma),ierror)
+ nberro=nberro+ierror
+
+ if (nberro.ne.0) then
+ write(nfecra,9513)
+ do iel = 1, ncel
+ rtp(iel,iuma) = 0.d0
+ rtp(iel,ivma) = 0.d0
+ rtp(iel,iwma) = 0.d0
+ enddo
+ endif
+
+ write(nfecra,1599)
+
+endif
+
+!================================================================
+! 6. LECTURE D'INFORMATIONS COMPLEMENTAIRES LEGERES
+!================================================================
+
+! Pour le moment, il n'y en a pas.
+
+!================================================================
+! 7. FERMETURE DU FICHIER SUITE PRINCIPAL
+!================================================================
+
+call clssui(impamo,ierror)
+!==========
+
+if (ierror.ne.0) then
+ write(nfecra,8711) ficamo
+endif
+
+write(nfecra,1799)
+
+!===============================================================================
+! 8. SORTIE
+!===============================================================================
+
+return
+
+!===============================================================================
+! 9. FORMATS
+!===============================================================================
+
+! --- ETAPES
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+ 3X,' LECTURE DU FICHIER SUITE PRINCIPAL ',/)
+ 1100 format(' Debut de la lecture ' )
+ 1299 format(' Fin de la lecture des dimensions ' )
+ 1499 format(' Fin de la lecture des options ' )
+ 1598 format(' Fin de la lecture des variables ',/,&
+ ' pression, vitesse, turbulence ' )
+ 1599 format(' Fin de la lecture des scalaires ' )
+ 1600 format(' Fin de la lecture de la vitesse de maillage ',/,&
+ ' (methode ALE) ' )
+ 1799 format(' Fin de la lecture ' )
+
+#else
+
+ 1000 format(/, &
+ 3X,' READING THE MAIN RESTART FILE ',/)
+ 1100 format(' Start reading ' )
+ 1299 format(' Reading dimensions complete ' )
+ 1499 format(' Reading options complete ' )
+ 1598 format(' Reading the pressure, velocity, turbulent ',/,&
+ ' variables complete ' )
+ 1599 format(' Reading scalars complete ' )
+ 1600 format(' Reading the mesh velocity (ALE method) complete ' )
+ 1799 format(' Reading complete ' )
+
+#endif
+
+! --- INFORMATIONS
+
+#if defined(_CS_LANG_FR)
+
+ 2410 format &
+ (' Lecture du pas de temps precedent (suite) ', &
+ 'NTPABS = ',I10)
+ 2411 format &
+ (' Lecture du pas de temps precedent (suite) ', &
+ 'TTPABS = ',E12.4)
+
+#else
+
+ 2410 format &
+ (' Reading the previous time step number ', &
+ '(restarting computation) NTPABS = ',I10)
+ 2411 format &
+ (' Reading the previous time step number ', &
+ '(restarting computation) TTPABS = ',E12.4)
+
+#endif
+
+
+! --- MISES EN GARDE
+
+#if defined(_CS_LANG_FR)
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ Le nombre de phases maximal NPHSMX supporte pas le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTPH = ',I10 ,/,&
+'@ On a ici un nombre de phases maximal superieur ',/,&
+'@ NPHSMX = ',I10 ,/,&
+'@ Si le nombre de phases effectif est superieur, elles ',/,&
+'@ ne seront pas relues. ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme lecamp. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ Le nombre de scalaires maximal NSCAMX supporte pas le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTSC = ',I10 ,/,&
+'@ On a ici un nombre de scalaires maximal superieur ',/,&
+'@ NSCAMX = ',I10 ,/,&
+'@ On ne pourra pas relire les scalaires dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme lecamp. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE PRINCIPAL ',/,&
+'@ ========= ',/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de variables, de scalaires ou de phases a ete ',/,&
+'@ modifie. ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ ',/,&
+'@ Il est cependant conseille de verifier ',/,&
+'@ les dimensions suivantes dans usini1 : ',/,&
+'@ ',/,&
+'@ NVAR NSCAL NSCAUS NSCAPP NPHAS',/,&
+'@ AMONT : ',5I10 ,/,&
+'@ ACTUEL: ',5I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE PRINCIPAL ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ REPRISE DE CALCUL AVEC ITURB(',I3,') = ',I4 ,/,&
+'@ A PARTIR D''UN CALCUL REALISE AVEC ITURB(',I3,') = ',I4,/,&
+'@ ',/,&
+'@ Le modele de turbulence en temps a ete modifie. ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ ',/,&
+'@ Il est conseille cependant de ',/,&
+'@ verifier la valeur de ITURB(',I2,') dans usini1 ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8711 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING THE MAIN RESTART FILE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ The maximum number of phases NPHSMX supported ',/,&
+'@ by the restart file writing format is ',/,&
+'@ NFMTPH = ',I10 ,/,&
+'@ Here is the maximum number of phases larger ',/,&
+'@ NPHSMX = ',I10 ,/,&
+'@ If the actual number of phases is more than NFMTPH, ',/,&
+'@ some of them might not be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ See the sub-routine lecamp. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING THE MAIN RESTART FILE ',/, &
+'@ ========= ',/,&
+'@ ',/,&
+'@ The maximum number of scalars NSCAMX supported ',/,&
+'@ by the restart file writing format is ',/,&
+'@ NFMTSC = ',I10 ,/,&
+'@ Here is the maximum number of scalars larger ',/,&
+'@ NSCAMX = ',I10 ,/,&
+'@ Scalars whose number is larger wont be read. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ See the sub-routine lecamp ',/, &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING THE MAIN RESTARTING FILE ',/, &
+'@ ========= ',/,&
+'@ THE RESTART AND CHECKPOINT DATA ARE DIFFERENT ',/,&
+'@ ',/,&
+'@ The number of variables, scalars or phases has changed. ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ However, it is strongly advised to check ',/,&
+'@ the following dimensions in usini1 : ',/,&
+'@ ',/,&
+'@ NVAR NSCAL NSCAUS NSCAPP NPHAS',/,&
+'@ PREVIOUS:',5I10 ,/,&
+'@ CURRENT :',5I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING THE MAIN RESTART FILE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ THE CURRENT CALCULATION USES ITURB(',I3,') = ',I4 ,/,&
+'@ BUT RESTARTS FROM ANOTHER ONE USING ITURB(',I3,') = ',I4 ,/,&
+'@ ',/,&
+'@ The turbulence model has changed. ',/,&
+'@ The computation can be executed. ',/,&
+'@ ',/,&
+'@ However, it is strongly advised to check ',/,&
+'@ the value of the variable ITURB(',I2,') in usini1 ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8711 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : ERROR AT CLOSING THE MAIN RESTART FILE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Problem on file called (',A13,') ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+! --- ERREURS
+
+#if defined(_CS_LANG_FR)
+
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= ',/,&
+'@ ERREUR A L''OUVERTURE DU FICHIER SUITE PRINCIPAL ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier l''existence et le nom (',A13,') du ',/,&
+'@ fichier suite dans le repertoire de travail. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ TYPE DE FICHIER INCORRECT ',/,&
+'@ ',/,&
+'@ Le fichier ',A13 ,' ne semble pas etre un fichier ',/,&
+'@ suite principal. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ a un fichier suite principal. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9201 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de cellules a ete modifie ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ au cas traite. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ERREUR A LA LECTURE DES DIMENSIONS ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ On souhaite faire correspondre le scalaire ',I10 ,/,&
+'@ du present calcul avec le scalaire ',I10 ,/,&
+'@ du calcul precedent, or, le nombre maximal de ',/,&
+'@ scalaires dans le fichier suite est ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs de ISCOLD dans usini1. ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ au cas traite. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9321 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ On souhaite faire correspondre le scalaire ',I10 ,/,&
+'@ du present calcul avec le scalaire ',I10 ,/,&
+'@ du calcul precedent, or, le numero des anciens ',/,&
+'@ scalaires doit etre strictement positif et ',/,&
+'@ inferieur ou egal a ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs de ISCOLD dans usini1. ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ au cas traite. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9330 format ( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ CORRESPONDANCE AVEC LES ANCIENS SCALAIRES IMPOSSIBLE ',/,&
+'@ ',I10, ' ERREURS REPORTEES CI-DESSUS ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Les lignes precedentes identifient les scalaires ',/,&
+'@ definis dans le present calcul pour lesquels la ',/,&
+'@ la correspondance fournie dans usini1 par ISCOLD ',/,&
+'@ est incorrecte. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite UTILISE correspond bien ',/,&
+'@ au cas traite. ',/,&
+'@ Verifier ISCOLD dans usini1. ',/,&
+'@ ISCOLD(ISCAL) = 0 indique que le scalaire ISCAL ',/,&
+'@ du present calcul ne correspond a aucun scalaire ',/,&
+'@ du calcul precedent ',/,&
+'@ ISCOLD(ISCAL) > 0 indique le numero du scalaire ',/,&
+'@ du calcul precedent auquel correspond ISCAL ',/,&
+'@ Si les correspondances avec les anciens scalaires ',/,&
+'@ ne sont pas necessaires, eliminer ISCOLD de usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DES INFORMATIONS TEMPORELLES OU ',/,&
+'@ DES MODELES DE TURBULENCE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9401 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DE L''INDICATEUR DE METHODE ALE ',/,&
+'@ ',/,&
+'@ Il se peut que le fichier suite relu corresponde a une ',/,&
+'@ version anterieure de Code_Saturne, sans methode ALE. ',/,&
+'@ Le calcul sera execute en reinitialisant toutes les ',/,&
+'@ donnees ALE. ',/,&
+'@ Verifier neanmoins que le fichier suite utilise n''a ',/,&
+'@ pas ete endommage. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9402 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ INDICATEUR IALE DU CALCUL PRECEDENT = ',I10 ,/,&
+'@ INDICATEUR IALE DU CALCUL ACTUEL = ',I10 ,/,&
+'@ ',/,&
+'@ Les coordonnees des noeuds du maillage doivent etre ',/,&
+'@ relues. Elles sont stockees dans le fichier suite ',/,&
+'@ auxiliaire. ',/,&
+'@ L''indicateur ILEAUX doit donc etre positionne a 1. ',/,&
+'@ Il vaut ici ILEAUX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Verifier ILEAUX dans usini1 ou dans l''Interface ',/,&
+'@ Graphique.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ NUMERO DU PAS DE TEMPS PRECEDENT NTPABS = ',I10 ,/,&
+'@ NUMERO DU PAS DE TEMPS VISE NTMABS = ',I10 ,/,&
+'@ ',/,&
+'@ Le nombre de pas de temps (absolu) vise, NTMABS, ',/,&
+'@ doit etre superieur au nombre de pas de temps ',/,&
+'@ (absolu) deja effectues, NTPABS. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier (augmenter) NTMABS dans usini1. ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ au cas traite. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9510 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ ERREUR LORS DE LA LECTURE DES VARIABLES PRINCIPALES ',/,&
+'@ PRESSION, VITESSE, TURBULENCE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! NFMTRU = 36 pour A36
+ 9511 format( &
+'@ Erreur a la lecture de ',A36 )
+ 9512 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ ERREUR LORS DE LA LECTURE DES VARIABLES PRINCIPALES ',/,&
+'@ SCALAIRES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9513 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= PRINCIPAL',/,&
+'@ ',/,&
+'@ ERREUR LORS DE LA LECTURE DE LA VITESSE DE MAILLAGE ',/,&
+'@ (METHODE ALE) ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ ',/,&
+'@ Le calcul peut neanmoins etre execute (vitesse de ',/,&
+'@ maillage reinitialisee)',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ERROR AT OPENING THE MAIN RESTART FILE ',/,&
+'@ ',/,&
+'@ The computation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please check the existence and the name (',A13,') ',/,&
+'@ of the restart file in the working directory. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ WRONG FILE TYPE ',/,&
+'@ ',/,&
+'@ The file ',A13 ,' does not look like a proper ',/,&
+'@ main restart file. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please make sure the file used as a restart file ',/,&
+'@ actually is a correct main restart file. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9201 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ INCONSISTANT RESTART AND CHECKPOINT DATA ',/,&
+'@ ',/,&
+'@ The number of cells has changed ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please make sure the file used as restart file does ',/,&
+'@ correspond to your case ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ERROR AT READING DIMENSIONS ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please check the integrity of the file used as ',/,&
+'@ restart file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,' of the current calculation ',/,&
+'@ is attempted to match the scalar ',I10 ,/,&
+'@ of the previous one. But the maximum number ',/,&
+'@ of scalar read in the restart file is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be excuted. ',/,&
+'@ ',/,&
+'@ Please check the value of ISCOLD in usini1. ',/,&
+'@ Please make sure the file used as restart file does ',/,&
+'@ correspond to your case ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9321 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,' of the current calculation ',/,&
+'@ is attempted to match the scalar ',I10 ,/,&
+'@ of the previous one. But the number ',/,&
+'@ of the previous scalar must be stricly larger ',/,&
+'@ than zero and smaller than or equal to ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please check the value of ISCOLD in usini1. ',/,&
+'@ Please make sure the file used as restart file does ',/,&
+'@ correspond to your case ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9330 format ( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ IMPOSSIBLE MATCHING WITH PREVIOUS SCALAR ',/,&
+'@ ',I10, ' ERRORS REPORTED IN THE ABOVE MESSAGES ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ The previous lines identify the scalars defined ',/, &
+'@ in the current computation for which the matching ',/,&
+'@ defined in usini1 by ISCOLD is not correct ',/,&
+'@ ',/,&
+'@ The computation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please make sure the file used as restart file does ',/,&
+'@ correspond to your case ',/,&
+'@ Please check the value of ISCOLD in usini1. ',/,&
+'@ ISCOLD(ISCAL) = 0 means that the scalar ISCAL ',/,&
+'@ of the current calculation does not correspond to ',/,&
+'@ any of the scalars of the previous calculation ',/,&
+'@ ISCOLD(ISCAL) > 0 defines the scalar number in the ',/,&
+'@ previous calculation ISCAL corresponds to ',/,&
+'@ If matching with the previous scalar is unnecessary ',/,&
+'@ please delete ISCOLD from usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERROR AT READING THE TEMPORAL INFORMATION OR ',/,&
+'@ TURBULENCE MODELS ',/,&
+'@ ',/,&
+'@ The computation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please check the integrity of the file used as ',/,&
+'@ restart file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9401 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : ERROR AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERROR AT READING THE INDICATOR OF ALE METHOD ',/,&
+'@ ',/,&
+'@ The read restart file might come from a previous ',/,&
+'@ version of Code Saturne, without ALE. ',/,&
+'@ The calculation will be executed but ',/,&
+'@ ALE data will be reset. ',/,&
+'@ Please check the integrity of the file used as ',/,&
+'@ restart file, however. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9402 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ IALE INDICATOR OF THE PREVIOUS CALCULATION = ',I10 ,/,&
+'@ IALE INDICATOR OF THE CURRECT CALCULATION = ',I10 ,/,&
+'@ ',/,&
+'@ The coordinates of the mesh nodes need to be read again.',/,&
+'@ They are stored in the auxiliary restart file. ',/,&
+'@ Therefore the ILEAUX indicator needs to be equal to 1. ',/,&
+'@ Its current value is ILEAUX = ',I10 ,/, &
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Please check the value of ILEAUX in usini1 or in the ',/,&
+'@ Graphical User Interface ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ NUMBER OF THE PREVIOUS TIME STEP NTPABS = ',I10 ,/,&
+'@ NUMBER OF TIME STEPS WANTED NTMABS = ',I10 ,/,&
+'@ ',/,&
+'@ The number of time steps (absolute) wanted, NTMABS, ',/,&
+'@ has to be larger than the number of time steps ',/,&
+'@ (absolute) already done, NTPABS. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please check (increase) NTMABS in usini1. ',/,&
+'@ Please make sure the file used as restart file does ',/,&
+'@ correspond to your case ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9510 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERROR AT THE READING OF MAIN VARIABLES ',/,&
+'@ PRESSURE, VELOCITY, TURBULENCE ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please check the integrity of the file used as ',/,&
+'@ restart file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9511 format( &
+'@ Error at the reading of ',A36 )
+ 9512 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERROR AT THE READING OF MAIN SCALAR VARIABLES ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed. ',/,&
+'@ ',/,&
+'@ Please check the integrity of the file used as ',/,&
+'@ restart file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9513 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE MAIN RESTART FILE READING ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERROR AT THE READING OF MESH VELOCITY ',/,&
+'@ (ALE METHOD) ',/, &
+'@ ',/,&
+'@ Please check the integrity of the file used as ',/,&
+'@ restart file ',/,&
+'@ ',/,&
+'@ The calculation can be executed however (mesh ',/,&
+'@ velocity reset) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+end
diff --git a/src/base/lecamx.f90 b/src/base/lecamx.f90
new file mode 100644
index 0000000..1883dba
--- /dev/null
+++ b/src/base/lecamx.f90
@@ -0,0 +1,3595 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lecamx &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nnod , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , frcxt , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+
+! FONCTION :
+! ----------
+! LECTURE DU FICHIER SUITE AUXILIAIRE
+
+! ON PASSE ICI SI ILEAUX = 1
+! ON S'ARRETE SI ON NE PEUT PAS OUVRIR LE FICHIER
+! OU SI CE N'EST PAS UN FICHIER AUXILIAIRE
+! OU SI NCEL N'EST PAS CORRECT
+! OU SI ON NE PEUT PAS LIRE JPHAS, JTURB, JDTVAR
+! OU SI ON NE PEUT PAS LIRE UNE MOYENNE QU'ON VEUT POURSUIVRE
+
+
+
+
+
+
+
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension du calcul !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nnod ! e ! <-- ! nombre de noeuds !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! jturb ! te ! <-- ! modeles de turb calcul precedent !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! dt(ncelet) ! tr ! --> ! pas de temps !
+! rtp ! tr ! --> ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ) !
+! propce ! tr ! --> ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! --> ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! --> ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! --> ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! frcxt(ncelet, ! tr ! --> ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! racell(ncelet ! tr ! --- ! tableau de travail !
+! rafacl(nfac ! tr ! --- ! tableau de travail !
+! rafabl(nfabor ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "optcal.h"
+include "pointe.h"
+include "numvar.h"
+include "albase.h"
+include "alstru.h"
+include "alaste.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor, nnod
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision dt(ncelet), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision frcxt(ncelet,3,nphas)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+
+character rubriq*64,car4*4,car2*2
+character cnum4*4, car54*54
+character cindfp*2,cindfs*4,cindff*4,cindfm*4
+character cindfc*2,cindfl*4
+character cphase(nphsmx)*2
+character nomflu(nvarmx)*18,nomcli(nvarmx)*18
+character cstruc(nstrmx)*2, cindst*2
+integer iel , ifac, ii, istr
+integer iphas , ivar , iscal , jphas , isco
+integer idecal, iclapc, icha , icla
+integer imom , imold
+integer jdtvar
+integer jortvm, ipcvmx, ipcvmy, ipcvmz
+integer iclvar, iclvaf
+integer idtcm
+integer iptsna, iptsta, iptsca
+integer numero, ipcefj, ipcla1, ipcla2, ipcla3
+integer iok , inifok, iokdt
+integer ncelok, nfaiok, nfabok, nsomok
+integer ierror, irtyp, itysup, nbval
+integer nberro, inierr, ivers
+integer ilu , ilecec, ideblu, iannul, ierrch
+integer impamx
+integer nfmtph, nfmtsc, nfmtfl, nfmtmo, nfmtch, nfmtcl
+integer nfmtst
+integer numflu(nvarmx)
+integer jturb (nphsmx), jtytur(nphsmx), jale
+integer ngbstr(2)
+double precision d2s3 , tsrii , cdtcm
+double precision tmpstr(27)
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+! ---> Banniere
+write(nfecra,1000)
+
+! ---> On code en chaine le numero des phases et scalaires
+
+! Nombre max pour les formats choisis
+nfmtph = 99
+nfmtsc = 9999
+nfmtfl = 9999
+nfmtmo = 9999
+nfmtch = 99
+nfmtcl = 9999
+
+! Indefini a 2 et 4 caracteres
+CINDFP='YY'
+CINDFS='YYYY'
+CINDFF='YYYY'
+CINDFM='YYYY'
+CINDFC='YY'
+CINDFL='YYYY'
+
+! Codage en chaine de caracteres du numero de la phase
+! Aller jusqu'a NPHAS suffirait
+do iphas = 1, min(nphas,nfmtph)
+ WRITE(CPHASE(IPHAS),'(I2.2)') IPHAS
+enddo
+do iphas = min(nphas,nfmtph)+1,nphas
+ cphase(iphas) = cindfp
+enddo
+
+
+! Avertissement
+if(nphsmx.gt.nfmtph) then
+ write(nfecra,8000)nfmtph,nphsmx
+endif
+if(nscamx.gt.nfmtsc) then
+ write(nfecra,8001)nfmtsc,nscamx
+endif
+if(nvarmx.gt.nfmtfl) then
+ write(nfecra,8002)nfmtfl,nvarmx
+endif
+if(nbmomx.gt.nfmtmo) then
+ write(nfecra,8003)nfmtmo,nbmomx
+endif
+
+!===============================================================================
+! 1. OUVERTURE DU FICHIER SUITE AUXILIAIRE
+!===============================================================================
+
+! ---> Ouverture du fichier (ILECEC = 1 : lecture)
+ilecec = 1
+call opnsui(ficamx,len(ficamx),ilecec,impamx,ierror)
+!==========
+if (ierror.ne.0) then
+ write(nfecra,9000) ficamx
+ call csexit (1)
+endif
+
+! ---> Debut de la lecture
+write(nfecra,1100)
+
+!===============================================================================
+! 2. ENTETES DU FICHIER SUITE OU STOP
+!===============================================================================
+
+! Rubrique "fichier suite aux"
+! Pourrait porter le numero de version si besoin.
+! On ne se sert pas de IVERS pour le moment.
+
+itysup = 0
+nbval = 1
+irtyp = 1
+RUBRIQ = 'version_fichier_suite_auxiliaire'
+call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,ivers, &
+ ierror)
+
+if (ierror.ne.0) then
+ write(nfecra,9100)ficamx
+ call csexit (1)
+endif
+
+! Supports
+
+call tstsui(impamx,ncelok,nfaiok,nfabok,nsomok)
+!==========
+
+if (ncelok.eq.0) then
+ write(nfecra,9101)
+ call csexit (1)
+endif
+
+IF (NFAIOK.EQ.0) WRITE(NFECRA,8200)'internes','internes'
+
+IF (NFABOK.EQ.0) WRITE(NFECRA,8200)'de bord ','de bord '
+
+
+! On n'a besoin que
+! du nombre de phases et du modele de turbulence
+
+nberro = 0
+
+itysup = 0
+nbval = 1
+irtyp = 1
+
+RUBRIQ = 'nombre_phases'
+call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,jphas, &
+ ierror)
+nberro=nberro+ierror
+
+! ---> On s'arrete si erreur
+! Si on ne peut pas relire un entier, c'est que le fichier n'est pas bon
+if (nberro.ne.0) then
+ CAR54 ='ERREUR A lA LECTURE DES DIMENSIONS (NPHAS) '
+ write(nfecra,9200)car54
+ call csexit (1)
+endif
+
+! ---> On previent si des parametres sont differents
+if ( jphas .ne.nphas ) then
+ write(nfecra,8210) jphas, nphas
+endif
+
+! Modele de turbulence
+
+nberro = 0
+
+do iphas = 1, min(nphas,jphas)
+ RUBRIQ = 'modele_turbulence_phase'//CPHASE(IPHAS)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jturb(iphas),ierror)
+ nberro=nberro+ierror
+ jtytur(iphas)=jturb(iphas)/10
+enddo
+
+! ---> Stop si erreur
+! Si on ne peut pas relire un entier, c'est que le fichier n'est pas bon
+if (nberro.ne.0) then
+ CAR54 ='ERREUR A lA LECTURE DES MODELES DE TURBULENCE '
+ write(nfecra,9200)car54
+ call csexit (1)
+endif
+
+! Methode ALE
+
+nberro = 0
+
+RUBRIQ = 'methode_ALE'
+itysup = 0
+nbval = 1
+irtyp = 1
+call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,jale, &
+ ierror)
+nberro=nberro+ierror
+
+! ---> Message si erreur (pas de stop pour compatibilite avec les fichiers anterieurs)
+! -> on n'affiche le message que si IALE=1 (sinon RAS)
+if (nberro.ne.0) then
+ if (iale.eq.1) write(nfecra,9210)
+ jale = 0
+endif
+
+! ---> Pas d'iteration d'initialisation si suite de calcul ALE
+if (italin.eq.-999) then
+ if (iale.eq.1 .and. jale.eq.1) then
+ italin = 0
+ else if (iale.eq.1) then
+ italin = 1
+ else
+ italin = 0
+ endif
+endif
+
+! ---> Donnees modifiees
+do iphas = 1, min(nphas,jphas)
+ if (iturb(iphas) .ne. jturb(iphas)) &
+ write(nfecra,8220) iphas,iturb(iphas), &
+ iphas,jturb(iphas), &
+ iphas
+enddo
+
+CAR54 =' Fin de la lecture des options '
+write(nfecra,1110)car54
+
+!===============================================================================
+! 3. PROPRIETES PHYSIQUES
+!===============================================================================
+
+nberro = 0
+
+! On lit les infos des phases communes
+! Pour les phases supplementaires, les initialisations par defaut
+! ont ete faites dans INIVA0
+
+do iphas = 1, min(nphas,jphas)
+
+! ---> Point de reference de pression
+! On lit les coordonnees si l'utilisateur n'a rien specifie, i.e.
+! si IXYZP0=-1, et on met IXYZP0 a 1 pour eviter de le changer ensuite.
+ if (ixyzp0(iphas).eq.-1) then
+ RUBRIQ = 'ref_presstot'//CPHASE(IPHAS)
+ itysup = 0
+ nbval = 3
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ xyzp0(1,iphas),ierror)
+ nberro = nberro+ierror
+ if (ierror.eq.0) then
+ write(nfecra,7000) iphas,(xyzp0(ii,iphas),ii=1,3)
+ ixyzp0(iphas) = 1
+ endif
+ endif
+
+! ---> Masse volumique
+! On la lit, qu'elle soit extrapolee ou pas,
+! pour permettre les sous-relaxations
+! Pour les suites a rho constant, cependant, on ne la lit pas,
+! afin de ne pas ecraser la valeur RO0 fixee par l'utilisateur
+! et eventuellement modifiee.
+
+ inierr = 0
+
+ if(irovar(iphas).eq.1) then
+! Masse volumique - cellules
+ RUBRIQ = 'rho_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(irom(iphas))),ierror)
+ nberro = nberro+ierror
+ inierr = inierr+ierror
+
+! Masse volumique - faces de bord
+ if (nfabok.eq.1) then
+ RUBRIQ = 'rho_fb_phase'//CPHASE(IPHAS)
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(irom(iphas))),ierror)
+ nberro = nberro+ierror
+ inierr = inierr+ierror
+ endif
+
+! Si on a reussi a initialiser la masse volumique aux cellules ET
+! aux faces de bord, on l'indique (pour schtmp)
+ if (nfabok.eq.1.and.inierr.eq.0) then
+ initro(iphas) = 1
+ endif
+
+ else
+! Si la masse volumique est constante, elle est initialisee
+! correctement
+ initro(iphas) = 1
+ endif
+
+! ---> Viscosite moleculaire et "turbulente" ou de "sous-maille"
+! Si elle est extrapolee en temps, on la lit
+! Si on reussit, on l'indique
+
+! On cherche a lire uniquement si on doit extrapoler en temps
+ if(iviext(iphas).gt.0) then
+
+ inierr = 0
+
+! Viscosite moleculaire - cellules
+! Uniquement si elle est variable
+ if(ivivar(iphas).eq.1) then
+ RUBRIQ = 'viscl_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(iviscl(iphas))),ierror)
+ nberro = nberro+ierror
+ inierr = inierr+ierror
+ endif
+
+! Viscosite turbulente ou de sous-maille - cellules
+ RUBRIQ = 'visct_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisct(iphas))),ierror)
+ nberro = nberro+ierror
+ inierr = inierr+ierror
+
+! Si on a initialise les viscosites, on l'indique (pour schtmp)
+ if (inierr.eq.0) then
+ initvi(iphas) = 1
+ endif
+
+ endif
+
+
+! ---> Chaleur massique
+! On cherche a la lire si elle est variable
+! et qu'on l'extrapole ou qu'on est en Joule
+! Si on reussit, on l'indique
+! (Ca sert quand elle est extrapolee en temps
+! et quand l'utilisateur peut s'en servir pour passer
+! de H a T, comme en effet Joule par exemple).
+
+ if((icpext(iphas ).gt.0.and.icp(iphas).gt.0).or. &
+ (ippmod(ieljou).ge.1.and.icp(iphas).gt.0)) then
+
+ inierr = 0
+
+! Chaleur massique - cellules
+ RUBRIQ = 'cp_ce_phase'//CPHASE(IPHAS)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(icp(iphas))),ierror)
+ nberro = nberro+ierror
+ inierr = inierr+ierror
+
+! Si on a initialise Cp, on l'indique (pour schtmp)
+ if (inierr.eq.0) then
+ initcp(iphas) = 1
+ endif
+
+ endif
+
+enddo
+
+
+! Si on a des scalaires, on lit a diffusivite
+! si le scalaire a un correspondant et
+! si on doit extrapoler la diffusivite
+! (et qu'elle est variable, et que le scalaire n'est pas une variance)
+
+if(nscal.gt.0) then
+
+ do iscal = 1, nscal
+ isco = iscold(iscal)
+ if ( isco .gt.0.and. &
+ ivsext(iscal).gt.0.and. &
+ ivisls(iscal).gt.0.and. &
+ (iscavr(iscal).le.0.or.iscavr(iscal).gt.nscal) ) then
+
+ inierr = 0
+
+! Diffusivite - cellules
+ if(isco.le.nfmtsc) then
+ WRITE(CAR4,'(I4.4)')ISCO
+ RUBRIQ = 'visls_ce_scalaire'//CAR4
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisls(iscal))),ierror)
+ nberro = nberro+ierror
+ inierr = inierr+ierror
+ else
+ nberro = nberro-1
+ inierr = inierr-1
+ endif
+
+! Si on a initialise visls, on l'indique (pour schtmp)
+ if (inierr.eq.0) then
+ initvs(iscal) = 1
+ endif
+ endif
+ enddo
+
+! Pour les variances, il suffit de dire qu'on a initialise ou non
+! selon ce qu'on a fait au scalaire correspondant
+ do iscal = 1, nscal
+ if(iscavr(iscal).gt.0.and.iscavr(iscal).le.nscal) then
+ initvs(iscal) = initvs(iscavr(iscal))
+ endif
+ enddo
+
+endif
+
+! Si erreur, on previent mais pas stop :
+! auparavant on n'avait pas stocke les prop phy
+! si on n'etait pas a l'ordre 2
+! c'est discutable pour rho
+
+if (nberro.ne.0) then
+ CAR54 = 'LECTURE DES PROPRIETES PHYSIQUES '
+ write(nfecra,8300)car54
+endif
+
+CAR54 = ' Fin de la lecture des proprietes physiques '
+write(nfecra,1110)car54
+
+
+!===============================================================================
+! 4. PAS DE TEMPS
+!===============================================================================
+
+
+! ---> Indicateur de pas de temps variable
+RUBRIQ = 'indic_dt_variable'
+itysup = 0
+nbval = 1
+irtyp = 1
+call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,jdtvar, &
+ ierror)
+
+! ---> On s'arrete si erreur
+! Si on ne peut pas relire un entier, c'est que le fichier n'est pas bon
+if (ierror.ne.0) then
+ CAR54 ='ERREUR A LA LECTURE DU MODE DE MARCHE EN TEMPS '
+ write(nfecra,9200)car54
+ call csexit(1)
+endif
+
+! ---> Pas de temps
+! Rq : si marche en temps differente, on conserve la valeur par defaut
+! DTREF imposee dans INIVA0
+
+nberro = 0
+
+if (idtvar.ne.jdtvar) then
+ write(nfecra,8400)idtvar,jdtvar,dtref
+
+elseif (idtvar.eq.1) then
+ RUBRIQ = 'dt_variable_temps'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,dt(1), &
+ ierror)
+ nberro=nberro+ierror
+ do iel = 1, ncel
+ dt(iel) = dt(1)
+ enddo
+
+elseif (idtvar.eq.2) then
+ RUBRIQ = 'dt_variable_espace_ce'
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,dt, &
+ ierror)
+ nberro=nberro+ierror
+endif
+
+! Si erreur, on previent mais pas stop :
+! le pas de temps n'est pas une donnee majeure
+! c'est discutable
+
+if (nberro.ne.0) then
+ CAR54 = 'LECTURE DU PAS DE TEMPS '
+ write(nfecra,8300)car54
+endif
+
+CAR54 = ' Fin de la lecture du pas de temps '
+write(nfecra,1110)car54
+
+!===============================================================================
+! 5. FLUX DE MASSE
+!===============================================================================
+! Pour retrouver la correspondance entre les variables
+! et les flux de masse, on utilise le nom de chaque variable
+! (NOMFLU(I)= nom de la ieme variable)
+! Ensuite, pour chaque variable, si on a deja le flux, on ne fait
+! rien, sinon on lit quel est le numero local du
+! flux qui lui est associe (en pratique 1 ou 2) et le flux lui meme.
+
+! Les flux de masse ne sont a lire que si les supports des faces
+! de bord ou des faces internes coincident
+
+! On lit d'abord le flux de masse (a l'instant n) et
+! ensuite a l'instant precedent si on est en schema en temps
+! particulier (ISTMPF NE 1)
+
+if (nfaiok.eq.1 .or. nfabok.eq.1) then
+
+ nberro=0
+
+! Initialisation des tableaux de travail
+ do ivar = 1, nvarmx
+ numflu(ivar) = 0
+ enddo
+
+! Nom du flux associe a la variable dans le calcul precedent
+ NOMFLU(IPR(1))='fm_p_phase'//CPHASE(1)
+ do iphas = 1, min(nphas,jphas)
+ NOMFLU(IU(IPHAS))='fm_u_phase'//CPHASE(IPHAS)
+ NOMFLU(IV(IPHAS))='fm_v_phase'//CPHASE(IPHAS)
+ NOMFLU(IW(IPHAS))='fm_w_phase'//CPHASE(IPHAS)
+ if (itytur(iphas).eq.2.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50) ) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif(itytur(iphas).eq.2.and.jtytur(iphas).eq.3) then
+ NOMFLU(IK(IPHAS))='fm_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif(itytur(iphas).eq.2.and.jturb(iphas).eq.60) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_omega_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50) ) then
+ NOMFLU(IR11(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3.and.jtytur(iphas).eq.3) then
+ NOMFLU(IR11(IPHAS))='fm_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_R22_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_R33_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_R12_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_R13_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_R23_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3.and.jturb(iphas).eq.60) then
+ NOMFLU(IR11(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_omega_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jtytur(iphas).eq.2) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jtytur(iphas).eq.3) then
+ NOMFLU(IK(IPHAS))='fm_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_R11_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jturb(iphas).eq.50) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_phi_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_fb_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jturb(iphas).eq.60) then
+ NOMFLU(IK(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_omega_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+
+ elseif (iturb(iphas).eq.60.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50) ) then
+ NOMFLU(IK (IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60.and.jtytur(iphas).eq.3) then
+ NOMFLU(IK (IPHAS))='fm_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_eps_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60.and.jturb(iphas).eq.60) then
+ NOMFLU(IK (IPHAS))='fm_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_omega_phase'//CPHASE(IPHAS)
+ endif
+ enddo
+ if(nscal.gt.0) then
+ do iscal = 1, nscal
+ if(iscold(iscal).gt.0) then
+ if(iscold(iscal).le.nfmtsc) then
+ WRITE(CAR4,'(I4.4)')ISCOLD(ISCAL)
+ else
+ car4 = cindfs
+ endif
+ NOMFLU(ISCA(ISCAL))='fm_scalaire'//CAR4
+ endif
+ enddo
+ endif
+ if (iale.eq.1) then
+ NOMFLU(IUMA)='fm_vit_maill_u'
+ NOMFLU(IVMA)='fm_vit_maill_v'
+ NOMFLU(IWMA)='fm_vit_maill_w'
+ endif
+
+! --Pour les variables
+ do ivar = 1, nvar
+! S'il y a un flux
+ if(ifluma(ivar).gt.0) then
+! Si le flux n'a pas deja ete rempli, on le fait
+ if (numflu(ifluma(ivar)).eq.0) then
+! Lecture du numero local du flux correspondant
+ rubriq = nomflu(ivar)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ numero,ierror)
+ nberro = nberro+ierror
+! S'il existe, on le lit
+ if (ierror.eq.0) then
+ inifok = 0
+ if(numero.gt.0) then
+ if(numero.le.nfmtfl) then
+ WRITE(CAR4,'(I4.4)')NUMERO
+ else
+ car4 = cindff
+ endif
+ if (nfaiok.eq.1) then
+ RUBRIQ = 'flux_masse_fi_'//CAR4
+ itysup = 2
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,propfa(1,ipprof(ifluma(ivar))), &
+ ierror)
+ nberro = nberro+ierror
+ if(ierror.eq.0) inifok = inifok+1
+ endif
+ if (nfabok.eq.1) then
+ RUBRIQ = 'flux_masse_fb_'//CAR4
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,propfb(1,ipprob(ifluma(ivar))), &
+ ierror)
+ nberro = nberro+ierror
+ if(ierror.eq.0) inifok = inifok+1
+ endif
+ endif
+! Si ca a marche, on indique que ce flux a ete rempli
+ if(inifok.eq.2) then
+ numflu(ifluma(ivar))=1
+ endif
+ endif
+ endif
+ endif
+ enddo
+
+
+! ET MAINTENANT : pareil, mais FLUMAS au pas de temps precedent
+
+! Initialisation des tableaux de travail
+ do ivar = 1, nvarmx
+ numflu(ivar) = 0
+ enddo
+
+! Nom du flux associe a la variable dans le calcul precedent
+ NOMFLU(IPR(1))='fm_a_p_phase'//CPHASE(1)
+ do iphas = 1, min(nphas,jphas)
+ NOMFLU(IU(IPHAS))='fm_a_u_phase'//CPHASE(IPHAS)
+ NOMFLU(IV(IPHAS))='fm_a_v_phase'//CPHASE(IPHAS)
+ NOMFLU(IW(IPHAS))='fm_a_w_phase'//CPHASE(IPHAS)
+ if (itytur(iphas).eq.2.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50) ) then
+ NOMFLU(IK(IPHAS))='fm_a_k_a_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif(itytur(iphas).eq.2.and.jtytur(iphas).eq.3) then
+ NOMFLU(IK(IPHAS))='fm_a_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif(itytur(iphas).eq.2.and.jturb(iphas).eq.60) then
+ NOMFLU(IK(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_omega_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50) ) then
+ NOMFLU(IR11(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3.and.jtytur(iphas).eq.3) then
+ NOMFLU(IR11(IPHAS))='fm_a_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_a_R22_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_a_R33_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_a_R12_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_a_R13_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_a_R23_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3.and.jturb(iphas).eq.60) then
+ NOMFLU(IR11(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR22(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR33(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR12(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR13(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IR23(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_omega_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jtytur(iphas).eq.2) then
+ NOMFLU(IK(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jtytur(iphas).eq.3) then
+ NOMFLU(IK(IPHAS))='fm_a_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_a_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_a_R11_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jturb(iphas).eq.50) then
+ NOMFLU(IK(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_a_phi_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_a_fb_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jturb(iphas).eq.60) then
+ NOMFLU(IK(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IEP(IPHAS))='fm_a_omega_phase'//CPHASE(IPHAS)
+ NOMFLU(IPHI(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IFB(IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50) ) then
+ NOMFLU(IK (IPHAS))='fm_a_k_a_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif(iturb(iphas).eq.60.and.jtytur(iphas).eq.3) then
+ NOMFLU(IK (IPHAS))='fm_a_R11_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_a_eps_phase'//CPHASE(IPHAS)
+ elseif(iturb(iphas).eq.60.and.jturb(iphas).eq.60) then
+ NOMFLU(IK (IPHAS))='fm_a_k_phase'//CPHASE(IPHAS)
+ NOMFLU(IOMG(IPHAS))='fm_a_omega_phase'//CPHASE(IPHAS)
+ endif
+ enddo
+ if(nscal.gt.0) then
+ do iscal = 1, nscal
+ if(iscold(iscal).gt.0) then
+ if(iscold(iscal).le.nfmtsc) then
+ WRITE(CAR4,'(I4.4)')ISCOLD(ISCAL)
+ else
+ car4 = cindfs
+ endif
+ NOMFLU(ISCA(ISCAL))='fm_a_scalaire'//CAR4
+ endif
+ enddo
+ endif
+ if (iale.eq.1) then
+ NOMFLU(IUMA)='fm_a_vit_maill_u'
+ NOMFLU(IVMA)='fm_a_vit_maill_v'
+ NOMFLU(IWMA)='fm_a_vit_maill_w'
+ endif
+
+! --Pour les variables
+ do ivar = 1, nvar
+! S'il y a un flux
+ if(ifluaa(ivar).gt.0) then
+! Si le flux n'a pas deja ete rempli, on le fait
+ if (numflu(ifluaa(ivar)).eq.0) then
+! Lecture du numero local du flux correspondant
+ rubriq = nomflu(ivar)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ numero,ierror)
+ nberro = nberro+ierror
+! S'il existe, on le lit
+ if (ierror.eq.0) then
+ inifok = 0
+ if(numero.gt.0) then
+ if(numero.le.nfmtfl) then
+ WRITE(CAR4,'(I4.4)')NUMERO
+ else
+ car4 = cindff
+ endif
+ if (nfaiok.eq.1) then
+ RUBRIQ = 'flux_masse_a_fi_'//CAR4
+ itysup = 2
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,propfa(1,ipprof(ifluaa(ivar))), &
+ ierror)
+ nberro = nberro+ierror
+ if(ierror.eq.0) inifok = inifok+1
+ endif
+ if (nfabok.eq.1) then
+ RUBRIQ = 'flux_masse_a_fb_'//CAR4
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,propfb(1,ipprob(ifluaa(ivar))), &
+ ierror)
+ nberro = nberro+ierror
+ if(ierror.eq.0) inifok = inifok+1
+ endif
+ endif
+! Si ca a marche, on indique que ce flux a ete rempli
+ if(inifok.eq.2) then
+ numflu(ifluaa(ivar))=1
+ endif
+ endif
+ endif
+ endif
+ enddo
+
+
+! Si erreur, on previent mais pas stop :
+ if (nberro.ne.0) then
+ car54 = &
+ 'LECTURE DES FLUX DE MASSE '
+ write(nfecra,8300)car54
+ endif
+
+CAR54 = ' Fin de la lecture des flux de masse '
+write(nfecra,1110)car54
+
+endif
+! fin de "s'il faut lire les flux de masse (ie. supports coincidents)"
+
+!===============================================================================
+! 6. CONDITIONS AUX LIMITES
+!===============================================================================
+
+! A ne relire que si les supports sont identiques (faces de bord)
+
+ilu = 0
+
+if (nfabok.eq.1) then
+
+ ilu = 1
+
+ nberro=0
+
+! Nom de variable associe a la variable dans le calcul precedent
+ NOMCLI(IPR(1))='_p_phase'//CPHASE(1)
+ do iphas = 1, min(nphas,jphas)
+ NOMCLI(IU(IPHAS))='_u_phase'//CPHASE(IPHAS)
+ NOMCLI(IV(IPHAS))='_v_phase'//CPHASE(IPHAS)
+ NOMCLI(IW(IPHAS))='_w_phase'//CPHASE(IPHAS)
+! Pour un calcul k-eps, on peut recuperer les CL d'un calcul k-eps
+! ou d'un calcul v2f
+ if (itytur(iphas).eq.2.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50)) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ NOMCLI(IEP(IPHAS))='_eps_phase'//CPHASE(IPHAS)
+ elseif (itytur(iphas).eq.3.and.jtytur(iphas).eq.3) then
+ NOMCLI(IR11(IPHAS))='_R11_phase'//CPHASE(IPHAS)
+ NOMCLI(IR22(IPHAS))='_R22_phase'//CPHASE(IPHAS)
+ NOMCLI(IR33(IPHAS))='_R33_phase'//CPHASE(IPHAS)
+ NOMCLI(IR12(IPHAS))='_R12_phase'//CPHASE(IPHAS)
+ NOMCLI(IR13(IPHAS))='_R13_phase'//CPHASE(IPHAS)
+ NOMCLI(IR23(IPHAS))='_R23_phase'//CPHASE(IPHAS)
+ NOMCLI(IEP(IPHAS))='_eps_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.50.and.jturb(iphas).eq.50) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ NOMCLI(IEP(IPHAS))='_eps_phase'//CPHASE(IPHAS)
+ NOMCLI(IPHI(IPHAS))='_phi_phase'//CPHASE(IPHAS)
+ NOMCLI(IFB(IPHAS))='_fb_phase'//CPHASE(IPHAS)
+ elseif (iturb(iphas).eq.60.and.jturb(iphas).eq.60) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ NOMCLI(IOMG(IPHAS))='_omega_phase'//CPHASE(IPHAS)
+! On peut aussi recuperer les CL de k et eps pour un calcul v2f suite
+! d'un calcul k-eps
+ elseif (iturb(iphas).eq.50.and.jtytur(iphas).eq.2) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ NOMCLI(IEP(IPHAS))='_eps_phase'//CPHASE(IPHAS)
+! On peut aussi recuperer les CL de k pour un calcul k-eps, v2f ou k-omega suite
+! d'un calcul k-eps, v2f ou k-omega et qui n'est pas deja un des cas ci-dessus.
+ elseif ( (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) .and. (jtytur(iphas).eq.2 &
+ .or. jturb(iphas).eq.50 .or. jturb(iphas).eq.60) ) then
+ NOMCLI(IK(IPHAS))='_k_phase'//CPHASE(IPHAS)
+ endif
+ enddo
+ if(nscal.gt.0) then
+ do iscal = 1, nscal
+ if(iscold(iscal).gt.0) then
+ if(iscold(iscal).le.nfmtsc) then
+ WRITE(CAR4,'(I4.4)')ISCOLD(ISCAL)
+ else
+ car4 = cindfs
+ endif
+ NOMCLI(ISCA(ISCAL))='_scalaire'//CAR4
+ endif
+ enddo
+ endif
+ if (iale.eq.1) then
+ NOMCLI(IUMA)='_vit_maillage_u'
+ NOMCLI(IVMA)='_vit_maillage_v'
+ NOMCLI(IWMA)='_vit_maillage_w'
+ endif
+
+! --Pour les variables
+ do ivar = 1, nvar
+
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+
+! Coefficients numeros 1
+ iclvar = iclrtp(ivar,icoef)
+ RUBRIQ = 'cla1'//NOMCLI(IVAR)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coefa(1,iclvar),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'clb1'//NOMCLI(IVAR)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coefb(1,iclvar),ierror)
+ nberro=nberro+ierror
+
+! Coefficients numeros 2
+ iclvaf = iclrtp(ivar,icoeff)
+ if (iclvar.ne.iclvaf) then
+
+ RUBRIQ = 'cla2'//NOMCLI(IVAR)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,coefa(1,iclvaf),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'clb2'//NOMCLI(IVAR)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,coefb(1,iclvaf),ierror)
+ nberro=nberro+ierror
+ endif
+
+ enddo
+
+! Type sym�trie (utilis� pour les gradients par moindres carr�s
+! sur support �tendu, avec extrapolation du gradient au bord).
+
+ do iphas = 1, min(nphas,jphas)
+
+ RUBRIQ = 'isympa_fb_phase'//CPHASE(IPHAS)
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iisymp+nfabor*(iphas-1)),ierror)
+ nberro = nberro+ierror
+
+ enddo
+
+
+endif
+! fin du test "si les supports des faces de bord sont identiques"
+
+if (ilu.eq.1) then
+
+! Si erreur, on previent mais pas stop :
+! (on n'a pas forcement les coefs 2, on n'a pas forc�ment isympa
+! si on prend les fichiers d'une version ant�rieure)
+ if (nberro.ne.0) then
+ car54 = &
+ 'LECTURE DES CONDITIONS AUX LIMITES '
+ write(nfecra,8300)car54
+ endif
+
+ CAR54 = ' Fin de la lecture des conditions aux limites '
+ write(nfecra,1110)car54
+
+endif
+
+
+!===============================================================================
+! 7. TERMES SOURCES EXTRAPOLES
+!===============================================================================
+
+
+nberro=0
+ilu = 0
+
+! ---> Termes sources Navier-Stokes
+
+! Boucle sur les phases communes
+do iphas = 1, min(jphas,nphas)
+! Si le terme est a l'ordre 2
+ if(isno2t(iphas).gt.0) then
+
+ iptsna = ipproc(itsnsa(iphas))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tsource_ns_ce_x_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsna ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_ns_ce_y_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsna+1),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_ns_ce_z_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsna+2),ierror)
+ nberro=nberro+ierror
+
+ ilu = ilu + 1
+
+ endif
+enddo
+
+! ---> Termes sources turbulence
+
+! Boucle sur les phases communes
+do iphas = 1, min(jphas,nphas)
+! Si le terme est a l'ordre 2
+ if(isto2t(iphas).gt.0) then
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+! Keps suite de keps ou v2f
+ if(itytur(iphas).eq.2.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50)) then
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+
+ ilu = ilu + 1
+
+! Keps suite de Rij, on on utilise 1/2 de tsr11+tsr22+ts33
+ elseif(itytur(iphas).eq.2.and.jtytur(iphas).eq.3) then
+
+! Ici on veut lire tout ou rien, comme on fait des operations
+! pour reconstruire le terme source sur k (discutable...)
+! IDEBLU = 1 indique qu'on a commence a lire.
+! Si erreur quand on a commence a lire, on remet tout a zero
+ ideblu = 0
+ iannul = 0
+
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_R11_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+ if(ierror.eq.0) ideblu = 1
+
+ if(ideblu.eq.1) then
+ RUBRIQ = 'tsource_tu_ce_R22_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) iannul = 1
+ endif
+
+ if(ideblu.eq.1.and.iannul.eq.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = &
+ propce(iel,iptsta )+propce(iel,iptsta+1)
+ enddo
+ RUBRIQ = 'tsource_tu_ce_R33_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) iannul = 1
+ endif
+
+ if(ideblu.eq.1.and.iannul.eq.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = 0.5d0*( &
+ propce(iel,iptsta )+propce(iel,iptsta+1))
+ enddo
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) iannul = 1
+ endif
+
+ if(iannul.eq.1) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = 0.d0
+ propce(iel,iptsta+1) = 0.d0
+ enddo
+ endif
+
+ ilu = ilu + 1
+
+! Rij suite de keps ou de v2f, on utilise 2/3 de tsk
+ elseif(itytur(iphas).eq.3.and. &
+ (jtytur(iphas).eq.2.or.jturb(iphas).eq.50)) then
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ d2s3 = 2.d0/3.d0
+ do iel = 1, ncel
+ tsrii = d2s3*propce(iel,iptsta )
+ propce(iel,iptsta ) = tsrii
+ propce(iel,iptsta+1) = tsrii
+ propce(iel,iptsta+2) = tsrii
+ propce(iel,iptsta+3) = 0.d0
+ propce(iel,iptsta+4) = 0.d0
+ propce(iel,iptsta+5) = 0.d0
+ enddo
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+6),ierror)
+ nberro=nberro+ierror
+
+ ilu = ilu + 1
+
+! Rij suite de Rij
+ elseif(itytur(iphas).eq.3.and.jtytur(iphas).eq.3) then
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_R11_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R22_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R33_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+2),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R12_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+3),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R13_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+4),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'tsource_tu_ce_R23_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+5),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+6),ierror)
+ nberro=nberro+ierror
+
+ ilu = ilu + 1
+
+! v2f suite de keps : On ne relit que les TS de k et eps
+! on laisse 0 pour phi et f_barre (valeur mise dans iniva0)
+ elseif(iturb(iphas).eq.50.and.jtytur(iphas).eq.2) then
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+
+ ilu = ilu + 1
+
+! v2f suite de Rij : On ne relit que les TS de k et eps
+! on laisse 0 pour phi et f_barre (valeur mise dans iniva0)
+! on utilise 1/2 de tsr11+tsr22+ts33 pour le ts de k
+ elseif(iturb(iphas).eq.50.and.jtytur(iphas).eq.3) then
+
+! Ici on veut lire tout ou rien, comme on fait des operations
+! pour reconstruire le terme source sur k (discutable...)
+! IDEBLU = 1 indique qu'on a commence a lire.
+! Si erreur quand on a commence a lire, on remet tout a zero
+ ideblu = 0
+ iannul = 0
+
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_R11_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+ if(ierror.eq.0) ideblu = 1
+
+ if(ideblu.eq.1) then
+ RUBRIQ = 'tsource_tu_ce_R22_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) iannul = 1
+ endif
+
+ if(ideblu.eq.1.and.iannul.eq.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = &
+ propce(iel,iptsta )+propce(iel,iptsta+1)
+ enddo
+ RUBRIQ = 'tsource_tu_ce_R33_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) iannul = 1
+ endif
+
+ if(ideblu.eq.1.and.iannul.eq.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = 0.5d0*( &
+ propce(iel,iptsta )+propce(iel,iptsta+1))
+ enddo
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) iannul = 1
+ endif
+
+ if(iannul.eq.1) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = 0.d0
+ propce(iel,iptsta+1) = 0.d0
+ enddo
+ endif
+
+ ilu = ilu + 1
+
+! v2f suite de v2f
+ elseif(iturb(iphas).eq.50.and.jturb(iphas).eq.50) then
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_eps_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_phi_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+2),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_fb_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+3),ierror)
+ nberro=nberro+ierror
+
+ ilu = ilu + 1
+
+! k-omega suite de k-omega
+! Pour le k-omega, on ne relit les termes sources que
+! si on est deja en k-omega.
+! Il n'est en effet pas forcement tres judicieux de relire
+! le TS de k et de mettre 0 pour le TS de eps.
+! Quant a essayer de transformer le TS de omega en TS de eps... no comment !
+ elseif(iturb(iphas).eq.60.and.jturb(iphas).eq.60) then
+ iptsta = ipproc(itstua(iphas))
+
+ RUBRIQ = 'tsource_tu_ce_k_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta ),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'tsource_tu_ce_omega_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsta+1),ierror)
+ nberro=nberro+ierror
+
+ ilu = ilu + 1
+
+ endif
+
+ endif
+enddo
+
+! ---> Termes sources scalaires
+
+! Boucle sur les scalaires
+do iscal = 1, nscal
+ isco = iscold(iscal)
+! Si il y a un correspondant
+ if(isco.gt.0) then
+! Si ce correspondant est ok pour le format
+ if(isco.le.nfmtsc) then
+! Si le terme est a l'ordre 2
+ if(isso2t(iscal).gt.0) then
+ iptsca = ipproc(itssca(iscal))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ WRITE(CAR4,'(I4.4)')ISCO
+ RUBRIQ = 'tsource_sc_ce_scalaire'//CAR4
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,iptsca ),ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+ endif
+ else
+ nberro=nberro-1
+ ilu = ilu + 1
+ endif
+ endif
+enddo
+
+! Si erreur, on previent mais pas stop :
+! (on n'a pas forcement les ts a l'ordre 2 avant)
+if (nberro.ne.0) then
+ car54 = &
+ 'LECTURE DES TERMES SOURCES '
+ write(nfecra,8300)car54
+endif
+
+if(ilu.ne.0) then
+ CAR54 =' Fin de la lecture des termes sources '
+ write(nfecra,1110)car54
+endif
+
+!===============================================================================
+! 8. MOYENNES
+!===============================================================================
+
+! Indicateur ok (=0) ou non (>0)
+iok = 0
+
+ilu = 0
+
+do imom = 1, nbmomt
+
+ imold = imoold(imom)
+! Si on doit lire la moyenne
+ if(imold.gt.0) then
+ ilu = 1
+! Si ce correspondant est ok pour le format
+ if(imold.le.nfmtmo) then
+ WRITE(CAR4,'(I4.4)')IMOLD
+ else
+ car4 = cindfm
+ endif
+
+! On la lit
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'cumul_ce_moment'//CAR4
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(icmome(imom))),ierror)
+ nberro=nberro+ierror
+
+! Si ca ne marche pas, on s'arrete
+! (on pourrait tenter de prendre des mesures correctives,
+! mais le cumul de la duree associee sert peut etre a d'autres
+! moyennes
+! en outre, si l'utilisateur a indique qu'il voulait relire
+! une moyenne, c'est qu'il veut faire un calcul propre
+ if(ierror.ne.0) then
+ write(nfecra,9300)imold,imom,imom
+ iok = iok + 1
+ endif
+
+
+
+! Si on a reussi a lire la moyenne, il faut obligatoirement disposer
+! du cumul de duree associe, sinon, on devra s'arreter.
+! IOKDT different de 0 indiquera qu'on n'a pas pu l'obtenir.
+ iokdt = 0
+
+! On cherche le numero (local au fichier suite)
+! du cumul de temps de la moyenne du calcul precedent
+! correspondant a la moyenne IMOM du calcul courant (ouf !)
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'numero_cumul_temps_moment'//CAR4
+ numero = 0
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ numero,ierror)
+ nberro=nberro+ierror
+
+! Si on n'a pas trouve, on a echoue
+ if(numero.eq.0.or.ierror.ne.0) then
+ iokdt = 1
+
+! Sinon, on a trouve un cumul en temps correspondant
+ else
+
+! Si NUMERO > 0, il s'agissait d'un cumul variable en espace
+! et le cumul courant est forcement variable en espace
+ if(numero.gt.0) then
+
+ if(numero.le.nfmtmo) then
+ WRITE(CNUM4,'(I4.4)')NUMERO
+ else
+ cnum4 = cindfm
+ endif
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'cumul_temps_ce_'//CNUM4
+ idtcm = ipproc(icdtmo(idtmom(imom)))
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,idtcm),ierror)
+ nberro=nberro+ierror
+
+! Si on n'a pas lu, on a echoue
+ if(ierror.ne.0) then
+ iokdt = 1
+ endif
+
+! Si NUMERO < 0, il s'agissait d'un cumul uniforme
+! et le cumul courant est variable en espace ou non
+ elseif(numero.lt.0) then
+
+ numero = -numero
+ if(numero.le.nfmtmo) then
+ WRITE(CNUM4,'(I4.4)')NUMERO
+ else
+ cnum4 = cindfm
+ endif
+
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'cumul_temps_'//CNUM4
+ cdtcm = 0.d0
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ cdtcm,ierror)
+ nberro=nberro+ierror
+
+! Si on n'a pas lu, on a echoue
+ if(ierror.ne.0) then
+ iokdt = 1
+
+! Sinon, selon la nature du cumul actuel, on l'affecte
+ else
+ if(idtmom(imom).gt.0) then
+ idtcm = ipproc(icdtmo(idtmom(imom)))
+ do iel = 1, ncel
+ propce(iel,idtcm) = cdtcm
+ enddo
+ elseif(idtmom(imom).lt.0) then
+ idtcm = -idtmom(imom)
+ dtcmom(idtcm) = cdtcm
+ endif
+ endif
+
+ endif
+
+ endif
+
+ if(iokdt.ne.0) then
+ write(nfecra,9310)imold,imom,imom
+ iok = iok + 1
+ endif
+
+ endif
+enddo
+
+! Si pb on s'arrete car si on cherche a faire des moyennes
+! c'est qu'on veut vraiement les relire
+if(iok.ne.0) then
+ call csexit(1)
+endif
+
+if(ilu.gt.0) then
+ CAR54 = ' Fin de la lecture des moyennes temporelles '
+ write(nfecra,1110)car54
+endif
+
+!===============================================================================
+! 9. DISTANCE A LA PAROI
+!===============================================================================
+
+ilu = 0
+nberro = 0
+
+! MODE DE CALCUL DIRECT (NON COMPATIBLE PARALLELISME ET PERIODICITE)
+
+if(abs(icdpar).eq.2) then
+
+! On la lit si on en a besoin uniquement.
+
+! Si l'utilisateur a force le recalcul, on ne la lit pas
+! il faudra la mettre a jour (sauf si zero pas de temps).
+
+! Sinon, on cherche a la lire.
+
+! On ne relit les numeros des faces de bord que si on a toujours
+! le meme nombre de faces de bord (sinon, la numerotation a change)
+ if(ineedy.eq.1) then
+ if(icdpar.eq.2.or.inpdt0.eq.1) then
+ if(nfabok.eq.1) then
+
+ do iphas = 1, min(nphas,jphas)
+ if(iifapa(iphas).gt.0) then
+ itysup = 1
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_fac_par_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,ia(iifapa(iphas)),ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+ endif
+ enddo
+
+ endif
+ endif
+ endif
+
+
+! MODE DE CALCUL PAR EQUATION DE DIFFUSION
+
+elseif(abs(icdpar).eq.1) then
+
+! On la lit si on en a besoin uniquement.
+
+! Si l'utilisateur a force le recalcul, on ne la lit pas
+! il faudra la mettre a jour (sauf si zero pas de temps).
+
+! Sinon, on cherche a la lire.
+! On pourrait la relire aussi quand le nombre de faces a
+! change, mais il vaut mieux la recalculer au cas ou des faces de
+! paroi auraient disparu
+! Si on arrive a la lire, on note qu'elle est a jour (sauf si ALE).
+
+ if(ineedy.eq.1) then
+ if(icdpar.eq.1.or.inpdt0.eq.1) then
+ if(nfabok.eq.1) then
+ iphas = 1
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ RUBRIQ = 'dist_fac_par_ce_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idipar),ierror)
+ nberro=nberro+ierror
+ if(ierror.eq.0 .and. iale.eq.0 ) then
+ imajdy = 1
+ endif
+ ilu = ilu + 1
+ endif
+ endif
+ endif
+
+endif
+
+if (nberro.ne.0) then
+ car54 = &
+ 'LECTURE DE LA DISTANCE A LA PAROI '
+ write(nfecra,8300)car54
+endif
+
+if(ilu.ne.0) then
+ CAR54=' Fin de la lecture de la distance a la paroi '
+ write(nfecra,1110)car54
+endif
+
+
+!===============================================================================
+! 10. FORCE EXTERIEURE
+!===============================================================================
+
+if(iphydr.eq.1) then
+ nberro=0
+ do iphas = 1, min(nphas,jphas)
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'force_ext_ce_x_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ frcxt(1,1,iphas),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'force_ext_ce_y_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ frcxt(1,2,iphas),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'force_ext_ce_z_phase'//CPHASE(IPHAS)
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ frcxt(1,3,iphas),ierror)
+ nberro=nberro+ierror
+ enddo
+
+ if (nberro.ne.0) then
+ car54 = &
+ 'LECTURE DES FORCES EXTERIEURES '
+ write(nfecra,8300)car54
+ endif
+
+ CAR54 =' Fin de la lecture des forces exterieures '
+ write(nfecra,1110)car54
+
+endif
+
+
+!===============================================================================
+! 11. DEPLACEMENT AUX NOEUDS EN ALE
+!===============================================================================
+
+if (iale.eq.1 .and. jale.eq.1) then
+ nberro = 0
+
+ itysup = 4
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'deplact_x_no'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idepal),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'deplact_y_no'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idepal+nnod),ierror)
+ nberro=nberro+ierror
+ RUBRIQ = 'deplact_z_no'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ra(idepal+2*nnod),ierror)
+ nberro=nberro+ierror
+
+! Si JALE=1, on doit avoir le deplacement dans le fichier suite, sinon
+! les resultats relus n'ont pas de sens -> on s'arrete si pb
+ if (nberro.ne.0) then
+ write(nfecra,9320)
+ call csexit(1)
+ endif
+
+ nberro = 0
+ RUBRIQ = 'type_visc_mail'
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jortvm,ierror)
+
+ RUBRIQ = 'visc_maillage_x'
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisma(1))),ierror)
+
+ if (iortvm.eq.1) then
+ if (jortvm.eq.1) then
+ RUBRIQ = 'visc_maillage_y'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisma(2))),ierror)
+ RUBRIQ = 'visc_maillage_z'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(ivisma(3))),ierror)
+ else
+ do iel = 1, ncel
+ ipcvmx = ipproc(ivisma(1))
+ ipcvmy = ipproc(ivisma(2))
+ ipcvmz = ipproc(ivisma(3))
+ propce(iel,ipcvmy) = propce(iel,ipcvmx)
+ propce(iel,ipcvmz) = propce(iel,ipcvmx)
+ enddo
+ endif
+ endif
+
+ CAR54 =' Fin de la lecture des donnees ALE '
+ write(nfecra,1110)car54
+
+ nberro=0
+ RUBRIQ = 'nombre_structures'
+ itysup = 0
+ nbval = 2
+ irtyp = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ngbstr,ierror)
+ nberro=nberro+ierror
+
+ nbstru = ngbstr(1)
+ nbaste = ngbstr(2)
+
+ if (nbstru.gt.0) then
+
+ nfmtst = 99
+ CINDST='YY'
+ do istr = 1, min(nbstru,nstrmx)
+ WRITE(CSTRUC(ISTR),'(I2.2)') ISTR
+ enddo
+ do istr = min(nbstru,nfmtst)+1,nbstru
+ cstruc(istr) = cindst
+ enddo
+ if(nstrmx.gt.nfmtst) then
+ write(nfecra,8004)nfmtst,nstrmx
+ endif
+
+ do istr = 1, nbstru
+
+ RUBRIQ = 'donnees_structure_'//CSTRUC(ISTR)
+ itysup = 0
+ nbval = 27
+ irtyp = 2
+
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tmpstr,ierror)
+ nberro=nberro+ierror
+
+ do ii = 1, 3
+ xstr (ii,istr) = tmpstr( ii)
+ xpstr (ii,istr) = tmpstr(3 +ii)
+ xppstr(ii,istr) = tmpstr(6 +ii)
+ xsta (ii,istr) = tmpstr(9 +ii)
+ xpsta (ii,istr) = tmpstr(12+ii)
+ xppsta(ii,istr) = tmpstr(15+ii)
+ xstp (ii,istr) = tmpstr(18+ii)
+ forstr(ii,istr) = tmpstr(21+ii)
+ forsta(ii,istr) = tmpstr(24+ii)
+ enddo
+
+ enddo
+
+ CAR54 =' Fin de la lecture des donnees des structures ALE '
+ write(nfecra,1110)car54
+
+ endif
+
+ if (nberro.ne.0) then
+ write(nfecra,9321)
+ call csexit(1)
+ endif
+
+endif
+
+!===============================================================================
+! 12. LECTURE DES INFORMATIONS COMPLEMENTAIRES COMBUSTION GAZ, CP ET
+! FUEL
+!===============================================================================
+
+nberro = 0
+ilu = 0
+
+! Modele COD3P :
+! ============
+
+if ( ippmod(icod3p).ge.0 ) then
+
+ RUBRIQ = 'hinfue_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,hinfue,&
+ ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+ if (ierror.ne.0) then
+ write(nfecra,9400)
+ endif
+
+ RUBRIQ = 'hinoxy_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = ilu + 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,hinoxy,&
+ ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+ if (ierror.ne.0) then
+ write(nfecra,9400)
+ endif
+
+ RUBRIQ = 'tinfue_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = ilu + 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,tinfue,&
+ ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+ if (ierror.ne.0) then
+ write(nfecra,9400)
+ endif
+
+ RUBRIQ = 'tinoxy_cod3p'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = ilu + 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,tinoxy,&
+ ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+ if (ierror.ne.0) then
+ write(nfecra,9400)
+ endif
+
+! Il faut le meme nbr de faces de bord, sinon on ne lit pas
+ if(nfabok.eq.1) then
+
+ ilu = ilu + 1
+
+ ierrch = 0
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_cod3p'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Type entree Fuel
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientfu_zone_bord_cod3p'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientfu, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Type entree Oxydant
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientox_zone_bord_cod3p'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientox, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Par securite, si on ne parvient pas a lire la
+! IENTCPFU ou IENTOX, on remet a zero le numero des zones IZFPPP
+! car il a peut etre ete lu.
+! Ceci permettra d'eviter de se servir des valeurs par defaut
+
+ if(ierrch.ne.0) then
+ do ifac = 1, nfabor
+ ia(iizfpp+ifac-1) = 0
+ enddo
+ endif
+
+ endif
+
+endif
+
+! Modele EBU :
+! ==========
+
+if ( ippmod(icoebu).ge.0 ) then
+
+ RUBRIQ = 'temperature_gaz_frais_ebu'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,tgf, &
+ ierror)
+ nberro=nberro+ierror
+ if (ierror.ne.0) then
+ write(nfecra,9500)
+ endif
+
+ RUBRIQ = 'frmel_ebu'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,frmel, &
+ ierror)
+ nberro=nberro+ierror
+ if (ierror.ne.0) then
+ write(nfecra,9500)
+ endif
+
+! Il faut le meme nbr de faces de bord, sinon on ne lit pas
+ if(nfabok.eq.1) then
+
+ ilu = ilu + 1
+
+ ierrch = 0
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_ebu'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Type entree Gaz brulee
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgb_zone_bord_ebu'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgb, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Type entree gaz frais
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgf_zone_bord_ebu'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgf, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! FMENT
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'fment_zone_bord_ebu'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ fment , ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! TKENT
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'tkent_zone_bord_ebu'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tkent, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Par securite, si on ne parvient pas a lire la
+! IENTCPFU ou IENTOX, on remet a zero le numero des zones IZFPPP
+! car il a peut etre ete lu.
+! Ceci permettra d'eviter de se servir des valeurs par defaut
+
+ if(ierrch.ne.0) then
+ do ifac = 1, nfabor
+ ia(iizfpp+ifac-1) = 0
+ enddo
+ endif
+
+ endif
+
+endif
+
+! Modele LWC :
+! ==========
+
+if ( ippmod(icolwc).ge.0 ) then
+
+ RUBRIQ = 'fmin_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,fmin, &
+ ierror)
+ nberro=nberro+ierror
+ if (ierror.ne.0) then
+ write(nfecra,9600)
+ endif
+
+ RUBRIQ = 'fmax_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,fmax, &
+ ierror)
+ nberro=nberro+ierror
+ if (ierror.ne.0) then
+ write(nfecra,9600)
+ endif
+
+ RUBRIQ = 'hmin_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,hmin, &
+ ierror)
+ nberro=nberro+ierror
+ if (ierror.ne.0) then
+ write(nfecra,9600)
+ endif
+
+ RUBRIQ = 'hmax_lwc'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ilu = 1
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp,hmax, &
+ ierror)
+ nberro=nberro+ierror
+ if (ierror.ne.0) then
+ write(nfecra,9600)
+ endif
+
+! Il faut le meme nbr de faces de bord, sinon on ne lit pas
+ if(nfabok.eq.1) then
+
+ ilu = ilu + 1
+
+ ierrch = 0
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_lwc'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Type entree Gaz brulee
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgb_zone_bord_lwc'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgb, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Type entree gaz frais
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientgf_zone_bord_lwc'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientgf, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! FMENT
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'fment_zone_bord_lwc'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ fment , ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! TKENT
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'tkent_zone_bord_lwc'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tkent, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Par securite, si on ne parvient pas a lire la
+! IENTCPFU ou IENTOX, on remet a zero le numero des zones IZFPPP
+! car il a peut etre ete lu.
+! Ceci permettra d'eviter de se servir des valeurs par defaut
+
+ if(ierrch.ne.0) then
+ do ifac = 1, nfabor
+ ia(iizfpp+ifac-1) = 0
+ enddo
+ endif
+
+ endif
+
+endif
+
+! Charbon PuLVerise : masse vol des charbons
+if ( ippmod(icp3pl).ge.0.or. ippmod(icpl3c).ge.0 ) then
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ ierrch = 0
+ do icha = 1, ncharb
+ if(icha.le.nfmtch) then
+ WRITE(CAR2,'(I2.2)')ICHA
+ else
+ car2 = cindfc
+ endif
+ RUBRIQ = 'masse_volumique_charbon'//CAR2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ rhock(icha), ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+ ilu = ilu + 1
+ enddo
+ if (ierrch.ne.0) then
+ write(nfecra,8611)
+ do icha = 1, ncharb
+ write(nfecra,8612)icha,rhock(icha)
+ enddo
+ write(nfecra,8613)
+ endif
+endif
+
+
+! Charbon PuLVerise : type de zones de bord, ientat, ientcp, timpat
+! et x20 pour le calcul de rho au bord en entree
+if ( ippmod(icp3pl).ge.0.or. ippmod(icpl3c).ge.0 ) then
+
+! Il faut le meme nbr de faces de bord, sinon on ne lit pas
+ if(nfabok.eq.1) then
+
+ ilu = ilu + 1
+
+ ierrch = 0
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_charbon_pulverise'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Type entree air ou cp (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientat_zone_bord_charbon_pulverise'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientat, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! ientcp et x20 ne servent pas pour le CP couple Lagrangien (cplphy)
+ if ( ippmod(icp3pl).ge.0 ) then
+
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientcp_zone_bord_charbon_pulverise'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientcp, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+
+ idecal = 0
+ do icha = 1, ncharb
+ do iclapc = 1, nclpch(icha)
+ icla = iclapc + idecal
+ if(icha.le.nfmtch.and.iclapc.le.nfmtcl) then
+ WRITE(CAR2,'(I2.2)')ICHA
+ WRITE(CAR4,'(I4.4)')ICLAPC
+ else
+ car2 = cindfc
+ car4 = cindfl
+ endif
+ RUBRIQ = 'x20_zone_bord_charbon'//CAR2//'_classe'//CAR4
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,x20(1,icla), ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+ enddo
+ enddo
+
+ endif
+
+! Temperature
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'timpat_zone_bord_charbon_pulverise'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ timpat, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Par securite, si on ne parvient pas a lire la temperature TIMPAT,
+! IENTCP ou IENTAT, on remet a zero le numero des zones IZFPPP
+! car il a peut etre ete lu.
+! Ceci permettra d'eviter de se servir des valeurs par defaut (=0)
+! de TIMPAT dans cpphyv et cplphy.
+ if(ierrch.ne.0) then
+ do ifac = 1, nfabor
+ ia(iizfpp+ifac-1) = 0
+ enddo
+ endif
+
+ endif
+
+endif
+
+
+! FUEL : type de zones de bord, ientat, ientfl, timpat
+! qimpat et qimpfl pour le calcul de rho au bord en entree
+if ( ippmod(icfuel).ge.0 ) then
+
+! Il faut le meme nbr de faces de bord, sinon on ne lit pas
+ if(nfabok.eq.1) then
+
+ ilu = ilu + 1
+
+ ierrch = 0
+
+! Numero des zones
+ itysup = 3
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'num_zone_fb_fuel'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ia(iizfpp), ierror)
+ nberro=nberro+ierror
+
+! Type entree air ou fuel (si ce n'est pas NOZPPM, erreur)
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientat_zone_bord_fuel'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientat, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+ itysup = 0
+ nbval = nozppm
+ irtyp = 1
+ RUBRIQ = 'ientfl_zone_bord_fuel'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ientfl, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! TIMPAT
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'timpat_zone_bord_fuel'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ timpat, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! QIMPAT
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'qimpat_zone_bord_fuel'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ qimpat, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! QIMPFL
+ itysup = 0
+ nbval = nozppm
+ irtyp = 2
+ RUBRIQ = 'qimpfl_zone_bord_fuel'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ qimpfl, ierror)
+ ierrch=ierrch+ierror
+ nberro=nberro+ierror
+
+! Par securite, si on ne parvient pas a lire la temperature TIMPAT,
+! IENTCP ou IENTAT, on remet a zero le numero des zones IZFPPP
+! car il a peut etre ete lu.
+! Ceci permettra d'eviter de se servir des valeurs par defaut (=0)
+! de TIMPAT dans cpphyv et cplphy.
+ if(ierrch.ne.0) then
+ do ifac = 1, nfabor
+ ia(iizfpp+ifac-1) = 0
+ enddo
+ endif
+
+ endif
+
+endif
+
+if (nberro.ne.0) then
+ car54 = &
+ 'LECTURE DES INFORMATIONS COMBUSTION '
+ write(nfecra,8300)car54
+endif
+
+if(ilu.ne.0) then
+ CAR54=' Fin de la lecture des informations combustion '
+ write(nfecra,1110)car54
+endif
+
+!===============================================================================
+! 13. LECTURE DES INFORMATIONS COMPLEMENTAIRES ELECTRIQUES
+!===============================================================================
+
+nberro=0
+ilu = 0
+
+! Recalage des CL pot des versions electriques
+
+if ( ippmod(ieljou).ge.1 ) then
+ if(ielcor.eq.1) then
+ ilu = ilu + 1
+ RUBRIQ = 'coeff_recalage_joule'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ coejou,ierror)
+ nberro=nberro+ierror
+ endif
+endif
+if ( ippmod(ielarc).ge.1 .or. ippmod(ieljou).ge.1 ) then
+ if(ielcor.eq.1) then
+ ilu = 1
+ RUBRIQ = 'ddpot_recalage_arc_elec'
+ itysup = 0
+ nbval = 1
+ irtyp = 2
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ dpot ,ierror)
+ nberro=nberro+ierror
+ endif
+endif
+
+! ---> Termes sources des versions electriques
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+ ipcefj = ipproc(iefjou)
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tsource_sc_ce_joule'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcefj ),ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+
+endif
+
+if( ippmod(ielarc).ge.1 ) then
+
+ ipcla1 = ipproc(ilapla(1))
+ ipcla2 = ipproc(ilapla(2))
+ ipcla3 = ipproc(ilapla(3))
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tsource_ns_ce_x_laplace'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcla1 ),ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+
+ RUBRIQ = 'tsource_ns_ce_y_laplace'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcla2 ),ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+
+ RUBRIQ = 'tsource_ns_ce_z_laplace'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipcla3 ),ierror)
+ nberro=nberro+ierror
+ ilu = ilu + 1
+
+endif
+
+if (nberro.ne.0) then
+ car54 = &
+ 'LECTURE DES INFORMATIONS ELECTRIQUES '
+ write(nfecra,8300)car54
+endif
+
+if(ilu.ne.0) then
+ CAR54=' Fin de la lecture des informations electriques '
+ write(nfecra,1110)car54
+endif
+
+!===============================================================================
+! 14. FERMETURE DU FICHIER SUITE AUXILAIRE
+!===============================================================================
+
+
+! Fermeture du fichier suite auxilaire
+call clssui(impamx,ierror)
+
+if (ierror.ne.0) then
+ write(nfecra,8900) ficamx
+endif
+
+write(nfecra,1200)
+
+!===============================================================================
+! 15. SORTIE
+!===============================================================================
+
+return
+
+!===============================================================================
+! 16. FORMATS
+!===============================================================================
+
+! --- ETAPES
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+ 3X,' LECTURE DU FICHIER SUITE AUXILIAIRE ',/)
+ 1100 format(' Debut de la lecture ')
+ 1110 format(' ',A54 )
+ 1200 format(' Fin de la lecture ')
+
+#else
+
+ 1000 format(/, &
+ 3X,' READING THE AUXILIARY RESTART FILE ',/)
+ 1100 format(' Start reading ')
+ 1110 format(' ',A54 )
+ 1200 format(' End reading ')
+
+#endif
+
+! --- INFORMATIONS
+
+#if defined(_CS_LANG_FR)
+
+ 7000 format(/, &
+' PHASE ',I4,' : ',/,&
+' Mise a jour du point de reference pour la pression totale ',/,&
+' par relecture du fichier suite ',/,&
+' XYZP0 = ', E14.5, E14.5, E14.5 ,/)
+
+#else
+
+ 7000 format(/, &
+' PHASE ',I4,' : ',/,&
+' Apdatation of the reference point for the total pressure ',/,&
+' by reading the restart file ',/,&
+' XYZP0 = ', E14.5, E14.5, E14.5 ,/)
+
+#endif
+
+! --- MISES EN GARDE
+
+#if defined(_CS_LANG_FR)
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ Le nombre de phases maximal NPHSMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTPH = ',I10 ,/,&
+'@ On a ici un nombre de phases maximal superieur ',/,&
+'@ NPHSMX = ',I10 ,/,&
+'@ Si le nombre de phases effectif est superieur, elles ',/,&
+'@ ne seront pas relues. ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ Le nombre de scalaires maximal NSCAMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTSC = ',I10 ,/,&
+'@ On a ici un nombre de scalaires maximal superieur ',/,&
+'@ NSCAMX = ',I10 ,/,&
+'@ On ne pourra pas relire les scalaires dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ Le nombre de flux de masse max NVARMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTFL = ',I10 ,/,&
+'@ On a ici un nombre de flux maximal superieur ',/,&
+'@ NVARMX = ',I10 ,/,&
+'@ On ne pourra pas relire les flux dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ Le nombre de moments mx NBMOMX supporte par le ',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTMO = ',I10 ,/,&
+'@ On a ici un nombre de moments maximal superieur ',/,&
+'@ NBMOMX = ',I10 ,/,&
+'@ On ne pourra pas relire les moments dont le numero ',/,&
+'@ est superieur ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8004 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ Le nombre de structures maximal NSTRMX supporte par le',/,&
+'@ format d''ecriture du fichier suite est ',/,&
+'@ NFMTST = ',I10 ,/,&
+'@ On a ici un nombre de structures maximal superieur ',/,&
+'@ NSTRMX = ',I10 ,/,&
+'@ Si le nombre de structures effectif est superieur, ',/,&
+'@ elles ne seront pas relues. ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE AUXILIAIRE ',/,&
+'@ ========= ',/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de faces ',A8 ,' a ete modifie. ',/,&
+'@ ',/,&
+'@ Le calcul peut etre execute mais les donnees ',/,&
+'@ sur les faces ',A8 ,' ne seront pas relues ',/,&
+'@ dans le fichier suite. ',/,&
+'@ Elles seront initialisees par des valeurs par defaut. ',/,&
+'@ ',/,&
+'@ Cette situation peut se produire lorsque le fichier ',/,&
+'@ suite est issu d''un calcul realise avec des options ',/,&
+'@ de recollement differentes ou lorsque l''on modifie ',/,&
+'@ la prise en compte de periodicite. ',/,&
+'@ Cette situation peut egalement se produire lorsque l''on',/,&
+'@ realise une suite sur une machine de calcul differente',/,&
+'@ et que le jeu de la precision machine modifie le ',/,&
+'@ nombre de faces issues des recollements. ',/,&
+'@ ',/,&
+'@ Cette situation peut enfin se produire lorsque le ',/,&
+'@ fichier suite auxiliaire ne correspond pas au cas ',/,&
+'@ traite. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite auxiliaire utilise ',/,&
+'@ correspond bien au cas traite ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE AUXILIAIRE ',/,&
+'@ ========= ',/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de phases a ete modifie. ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ ',/,&
+'@ Il est cependant conseille de verifier ',/,&
+'@ les dimensions suivantes dans usini1 : ',/,&
+'@ ',/,&
+'@ NPHAS ',/,&
+'@ AMONT : ',I10 ,/,&
+'@ ACTUEL: ',I10 ,/,&
+'@ ',/,&
+'@ Verifier que le fichier suite auxiliaire utilise ',/,&
+'@ correspond bien au cas traite ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8220 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE AUXILIAIRE ',/,&
+'@ ========= ',/,&
+'@ REPRISE DE CALCUL AVEC ITURB(',I3,') = ',I4 ,/,&
+'@ A PARTIR D''UN CALCUL REALISE AVEC ITURB(',I3,') = ',I4,/,&
+'@ ',/,&
+'@ Le modele de turbulence a ete modifie. ',/,&
+'@ ',/,&
+'@ Il est conseille cependant de ',/,&
+'@ verifier la valeur de ITURB(',I2,') dans usini1 ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite auxiliaire utilise ',/,&
+'@ correspond bien au cas traite ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE AUXILIAIRE ',/,&
+'@ ========= ',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ Certaines grandeurs n''ont pas pu etre lues dans le ',/,&
+'@ fichier suite auxiliaire. ',/,&
+'@ Elles seront initialisees par des valeurs par defaut. ',/,&
+'@ ',/,&
+'@ Cette situation peut se produire lorsque le fichier ',/,&
+'@ suite est issu d''un calcul realise avec des options ',/,&
+'@ differentes ou lorsqu''il a ete endommage. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE AUXILIAIRE ',/,&
+'@ ========= ',/,&
+'@ REPRISE DE CALCUL AVEC IDTVAR = ',I10 ,/,&
+'@ A PARTIR D''UN CALCUL REALISE AVEC IDTVAR = ',I10 ,/,&
+'@ ',/,&
+'@ Le mode de marche en temps a ete modifie. ',/,&
+'@ La valeur (uniforme) du pas de temps est ',/,&
+'@ DTREF = ',E12.4 ,' fournie dans usini1. ',/,&
+'@ ',/,&
+'@ Il est conseille cependant de ',/,&
+'@ verifier la valeur de IDTVAR dans usini1. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite auxiliaire utilise ',/,&
+'@ correspond bien au cas traite ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8611 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE AUXILIAIRE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Modele de combustion charbon pulverise. ',/,&
+'@ On ne trouve pas la masse volumique des charbons dans ',/,&
+'@ le fichier suite. C''est naturel si le calcul ',/,&
+'@ precedent n''etait pas un calcul charbon pulverise. ',/,&
+'@ La valeur par defaut est utilisee comme valeur ',/,&
+'@ initiale : ',/,&
+'@ Charbon rho ' )
+ 8612 format( &
+'@ ',I10 ,' ',E14.5 )
+ 8613 format( &
+'@ ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8900 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ The maximum number of phases NPHSMX supported by ',/,&
+'@ the writing format of the restart file is ',/,&
+'@ NFMTPH = ',I10 ,/,&
+'@ There is here a greater number of phases ',/,&
+'@ NPHSMX = ',I10 ,/,&
+'@ If the effectif number of phases is greater, these ',/,&
+'@ will not be reread. ',/,&
+'@ ',/,&
+'@ The run will continue. ',/,&
+'@ ',/,&
+'@ Check the subroutine lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ The maximum number of scalars NSCAMX supported by ',/,&
+'@ the writing format of the restart file is ',/,&
+'@ NFMTSC = ',I10 ,/,&
+'@ There is here a greater number of scalars ',/, &
+'@ NSCAMX = ',I10 ,/,&
+'@ It is possible not to read the scalars which have ',/,&
+'@ a greater number. ',/,&
+'@ ',/,&
+'@ The run will continue. ',/,&
+'@ ',/,&
+'@ Check the subroutine lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ The number of the max mass flux NVARMX supported by ',/,&
+'@ the writing format of the suite file is ',/,&
+'@ NFMTFL = ',I10 ,/,&
+'@ There is here a greater number of flux max ',/,&
+'@ NVARMX = ',I10 ,/,&
+'@ It is not possible to read the fluxes which have ',/,&
+'@ a greater number. ',/,&
+'@ ',/,&
+'@ The run will continue. ',/,&
+'@ ',/,&
+'@ Check the subroutine lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ The max number of moments NBMOMX supported by ',/,&
+'@ the writing format of the suite file is ',/,&
+'@ NFMTMO = ',I10 ,/,&
+'@ There is here a greater number of moments ',/,&
+'@ NVARMX = ',I10 ,/,&
+'@ It is not possible to read the moments which have ',/,&
+'@ a greater number. ',/,&
+'@ ',/,&
+'@ The run will continue. ',/,&
+'@ ',/,&
+'@ Check the subroutine lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8004 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ The max number of structures NBMOMX supported by ',/,&
+'@ the writing format of the suite file is ',/,&
+'@ NFMTST = ',I10 ,/,&
+'@ There is here a greater number of structures ',/,&
+'@ NSTRMX = ',I10 ,/,&
+'@ If the effective number of structures is greater, ',/,&
+'@ these will not be reread. ',/,&
+'@ ',/,&
+'@ The run will continue. ',/,&
+'@ ',/,&
+'@ Check the subroutine lecamx. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ PREVIOUS and PRESENT INPUT DATA ARE DIFFERENT ',/,&
+'@ ',/,&
+'@ The number of the faces ',A8 ,' has been modified ',/,&
+'@ ',/,&
+'@ The run can continue but the data on the ',/,&
+'@ faces ',A8 ,' will not be reread ',/,&
+'@ in the suite file. ',/,&
+'@ They will be initialised by the default values. ',/,&
+'@ ',/,&
+'@ This situation can occur when the restart file ',/,&
+'@ originates from a run using different options ',/,&
+'@ to join the grids or when the periodicity boundary ',/,&
+'@ conditions have been modified. ',/,&
+'@ This situation can also be generated when the ',/,&
+'@ run is conducted on a different machine ',/,&
+'@ in which case the precision of the machine modifies ',/,&
+'@ the number of faces generated when joinning the grids.',/,&
+'@ ',/,&
+'@ Finally, this situation can be due to the fact that ',/,&
+'@ the auxiliary restart file does not correspond to ',/,&
+'@ the present case. ',/,&
+'@ ',/,&
+'@ Verify that the auxiliary restart file being used ',/,&
+'@ corresponds to the present case. ',/,&
+'@ ',/,&
+'@ The run will continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ PREVIOUS and PRESENT DATA ARE INCOHERENT ',/,&
+'@ ',/,&
+'@ The number of phases has been modified. ',/,&
+'@ The run can be executed. ',/,&
+'@ ',/,&
+'@ However, it is advised to verify ',/,&
+'@ the following dimensions in usini1 : ',/,&
+'@ ',/,&
+'@ NPHAS ',/,&
+'@ PREVIOUS : ',I10 ,/,&
+'@ PRESENT : ',I10 ,/,&
+'@ ',/,&
+'@ Verify that the auxiliary restart file being used ',/,&
+'@ corresponds to the present case. ',/,&
+'@ ',/,&
+'@ The run will continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8220 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ THE RUN RESTARTED WITH ITURB(',I3,') = ',I4 ,/,&
+'@ FROM RUN CONDUCTED WITH ITURB(',I3,') = ',I4 ,/,&
+'@ ',/,&
+'@ The Turbulence model has been modified. ',/,&
+'@ ',/,&
+'@ It is advised however in this case to ',/,&
+'@ verify the value of ITURB(',I2,') in usini1 ',/,&
+'@ ',/,&
+'@ Verify that the auxiliary restart file being used ',/,&
+'@ corresponds to the present case. ',/,&
+'@ ',/,&
+'@ The run will continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ It was not possible to read some values from the ',/,&
+'@ auxiliary restart file. ',/,&
+'@ They will be initialised by the default values. ',/,&
+'@ ',/,&
+'@ This situation can occur when the restart file ',/,&
+'@ originates from a run realised with different ',/,&
+'@ options or when the file is damaged. ',/,&
+'@ ',/,&
+'@ The run will continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ THE RUN RESTARTED WITH IDTVAR = ',I10 ,/,&
+'@ FROM RUN CONDUCTED WITH IDTVAR = ',I10 ,/,&
+'@ ',/,&
+'@ The variable time step method has been modified. ',/,&
+'@ The (uniform) value of the time step is ',/,&
+'@ DTREF = ',E12.4 ,' given in usini1. ',/,&
+'@ ',/,&
+'@ It is advised however in this case to ',/,&
+'@ verify the value of IDTVAR in usini1. ',/,&
+'@ ',/,&
+'@ Verify that the auxiliary restart file being used ',/,&
+'@ corresponds to the present case. ',/,&
+'@ ',/,&
+'@ The run will continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8611 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: WHEN READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ Combustion model for pulverised coal ',/,&
+'@ The densities of the coals can not be found ',/,&
+'@ in the restart file. This is normal if the ',/,&
+'@ previous run did not include pulverised coal. ',/,&
+'@ The default value is used as an initial ',/,&
+'@ value : ',/,&
+'@ Coal rho ' )
+ 8612 format( &
+'@ ',I10 ,' ',E14.5 )
+ 8613 format( &
+'@ ',/,&
+'@ The run will continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8900 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ERROR CLOSING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ Problem in the file named (',A13,') ',/,&
+'@ ',/,&
+'@ The run will continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+
+! --- ERREURS
+
+#if defined(_CS_LANG_FR)
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ERREUR A L''OUVERTURE DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier l''existence et le nom (',A13,') du ',/,&
+'@ fichier suite dans le repertoire de travail. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ TYPE DE FICHIER INCORRECT ',/,&
+'@ ',/,&
+'@ Le fichier ',A13 ,' ne semble pas etre un fichier ',/,&
+'@ suite auxiliaire. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ a un fichier suite auxiliaire. ',/,&
+'@ Si necessaire, il est possible de desactiver la lecture ',/,&
+'@ du fichier suite auxiliaire par ILEAUX = 0 (usini1). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de cellules a ete modifie ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ au cas traite. ',/,&
+'@ Si necessaire, il est possible de desactiver la lecture ',/,&
+'@ du fichier suite auxiliaire par ILEAUX = 0 (usini1). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ Si necessaire, il est possible de desactiver la lecture ',/,&
+'@ du fichier suite auxiliaire par ILEAUX = 0 (usini1). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DE L''INDICATEUR DE METHODE ALE ',/,&
+'@ ',/,&
+'@ Il se peut que le fichier suite relu corresponde a une ',/,&
+'@ version anterieure de Code_Saturne, sans methode ALE. ',/,&
+'@ Le calcul sera execute en reinitialisant toutes les ',/,&
+'@ donnees ALE. ',/,&
+'@ Verifier neanmoins que le fichier suite utilise n''a ',/,&
+'@ pas ete endommage. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ La relecture de l''ancienne moyenne ',I10 ,' qui doit ',/,&
+'@ permettre d''initialiser la nouvelle moyenne ',I10 ,/,&
+'@ a echoue ',/ &
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire ou ',/,&
+'@ specifier dans usini1 que la moyenne doit etre ',/,&
+'@ reinitialisee, en indiquant : IMOOLD(',I10 ,') = -1 ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ La relecture du cumul de la duree associee a ',/,&
+'@ l''ancienne moyenne ',I10 ,' qui doit ',/,&
+'@ permettre d''initialiser la nouvelle moyenne ',I10 ,/,&
+'@ a echoue ',/ &
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire ou ',/,&
+'@ specifier dans usini1 que la moyenne doit etre ',/,&
+'@ reinitialisee, en indiquant : IMOOLD(',I10 ,') = -1 ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ ERREUR LORS DE LA LECTURE DU DEPLACEMENT AUX NOEUDS ',/,&
+'@ DU MAILLAGE (METHODE ALE) ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9321 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ ERREUR LORS DE LA LECTURE DES DONNEES DES STRUCTURES ',/,&
+'@ MOBILES (METHODE ALE) ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise n''a pas ete ',/,&
+'@ endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ La relecture des variable CO3DP ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ La relecture des variable EBU ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9600 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ',/,&
+'@ La relecture des variable LWC ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ERROR WHEN OPENING THE RESTART FILE ',/,&
+'@ ',/,&
+'@ The run can not be executed. ',/,&
+'@ ',/,&
+'@ Verify the existence and the name (',A13,') of the ',/,&
+'@ restart file in the work directory. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ FILE TYPE IS INCORRECT ',/,&
+'@ ',/,&
+'@ The file ',A13 ,' does not appear to be an ',/,&
+'@ auxiliary file. ',/,&
+'@ ',/,&
+'@ The run can not be executed. ',/,&
+'@ ',/,&
+'@ Verify that the restart file used corresponds to ',/,&
+'@ an auxiliary restart file. ',/,&
+'@ If necessary, it is possible to deactivate the reading ',/,&
+'@ of the auxiliary restart file by ILEAUX = 0 (usini1). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ INCOHERENT PREVIOUS NAD ACTUAL DATA ',/,&
+'@ ',/,&
+'@ The number of cells was modified ',/,&
+'@ ',/,&
+'@ The run can not be executed. ',/,&
+'@ ',/,&
+'@ Verify that the restart file used corresponds to ',/,&
+'@ the present case. ',/,&
+'@ If necessary, it is possible to deactivate the reading ',/,&
+'@ of the auxiliary restart file by ILEAUX = 0 (usini1). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ ', A54 ,/,&
+'@ ',/,&
+'@ The run can not be executed. ',/,&
+'@ ',/,&
+'@ Verify that the restart file used has not been damaged. ',/,&
+'@ ',/,&
+'@ If necessary, it is possible to deactivate the reading ',/,&
+'@ of the auxiliary restart file by ILEAUX = 0 (usini1). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ERROR WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ ERROR WHEN READING THE INDICATOR OF THE ALE METHOD ',/,&
+'@ ',/,&
+'@ It is possible that the file read corresponds to an old ',/,&
+'@ version of Code_Saturne, without the ALE method. ',/,&
+'@ The run will be executed with reinitialising all ',/,&
+'@ ALE data. ',/,&
+'@ ',/,&
+'@ Verify that the restart file used has not been damaged. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ The reading of the previous average ',I10 ,' that will ',/,&
+'@ allow the initialisation of the new average ',I10 ,/,&
+'@ has failed ',/ &
+'@ ',/,&
+'@ The run will not be executed. ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restart file or specify ',/,&
+'@ in usini1 that the average has to be reinitialised, ',/,&
+'@ by indicating: IMOOLD(',I10 ,') = -1 ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ The reading of the accumulated period associated with ',/,&
+'@ the previous average ',I10 ,' that will ',/,&
+'@ allow to initialise the new average ',I10 ,/,&
+'@ has failed ',/ &
+'@ ',/,&
+'@ The run will not be executed. ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restart file or specify ',/,&
+'@ in usini1 that the average has to be reinitialised, ',/,&
+'@ by indicating: IMOOLD(',I10 ,') = -1 ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ ERROR WHILE READING MESH VERTICES MOVEMENT DATA ',/,&
+'@ (ALE METHOD) ',/,&
+'@ ',/,&
+'@ The run can not be executed. ',/,&
+'@ ',/,&
+'@ Verify that the restart file used has not been damaged ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9321 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ ERROR WHILE READING MOVING STRUCTURES DATA ',/,&
+'@ (ALE METHOD) ',/,&
+'@ ',/,&
+'@ The run can not be executed. ',/,&
+'@ ',/,&
+'@ Verify that the restart file used has not been damaged ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ Error reading the CO3DP variables ',/,&
+'@ ',/,&
+'@ The run can not be executed. ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restart file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ Error reading the EBU variables ',/,&
+'@ ',/,&
+'@ The run will not be executed. ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restart file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9600 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING THE AUXILIARY RESTART FILE ',/,&
+'@ ======= ',/,&
+'@ ',/,&
+'@ Error reading the LWC variables ',/,&
+'@ ',/,&
+'@ The run will not be executed. ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restart file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+end
diff --git a/src/base/ledgeo.f90 b/src/base/ledgeo.f90
new file mode 100644
index 0000000..de3c6f0
--- /dev/null
+++ b/src/base/ledgeo.f90
@@ -0,0 +1,408 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ledgeo &
+!================
+
+ ( ndim , ncelet , ncel , nfac , nfabor , &
+ nprfml , nfml , nsom , lndfac , lndfbr )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! LECTURE DES DIMENSIONS DES TABLEAUX ENTITES GEOMETRIQUES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ndim ! e ! --> ! dimension de l'espace (=3) !
+! ncelet ! e ! --> ! nombre d'elements halo compris !
+! ncel ! e ! --> ! nombre d'elements actifs !
+! nfac ! e ! --> ! nombre de faces internes !
+! nfabor ! e ! --> ! nombre de faces de bord !
+! nprfml ! e ! --> ! nombre de propietes des familles !
+! ! ! ! de faces de bord !
+! nfml ! e ! --> ! nombre de familles de faces de bord !
+! nsom ! e ! --> ! nombre de sommets du maillage !
+! lndfac ! e ! --> ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! --> ! longueur du tableau nodfbr (optionnel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nprfml , nfml , nsom , lndfac , lndfbr
+
+! VARIABLES LOCALES
+
+integer iel , ifac , ifml , nn , n1 , ip
+integer ntetra , npyram , nprism , nhexae
+
+!===============================================================================
+
+ndim = 0
+ncel = 0
+nfac = 0
+nfabor = 0
+nprfml = 0
+nfml = 0
+nsom = 0
+
+lndfac = 0
+lndfbr = 0
+
+!===============================================================================
+! 1. Ouverture de FICGEO et lecture des entetes principales
+!===============================================================================
+
+!---> Ouverture
+
+OPEN (FILE=FICGEO,UNIT=IMPGEO,FORM='formatted',ERR=9000)
+
+!---> Ecriture avec rubrique ... avant
+
+ndim = 3
+
+read (impgeo, *,err=9002,end=9003)
+read (impgeo, *,err=9002,end=9003)
+read (impgeo,1100,err=9002,end=9003) ncel, nfac, nfabor, nsom
+
+read (impgeo, *,err=9002,end=9003)
+read (impgeo, *,err=9002,end=9003)
+read (impgeo,1100,err=9002,end=9003) ntetra,npyram,nprism,nhexae
+
+read (impgeo, *,err=9002,end=9003)
+read (impgeo, *,err=9002,end=9003)
+read (impgeo,1100,err=9002,end=9003) nprfml, nfml
+
+!===============================================================================
+! 2. Positionnement dans FICGEO pour la lecture des tableaux optionnels
+! de connectivites faces sommets (IPNFAC, IPNFBR, NODFAC, NODFBR)
+!===============================================================================
+
+!--> Positionnement dans le fichier avant lecture
+
+! Connectivite faces internes - cellules
+read(impgeo,*)
+read(impgeo,*)
+do ifac = 1,nfac
+ read(impgeo,*)
+enddo
+
+! Connectivite faces de bord - cellule
+read(impgeo,*)
+read(impgeo,*)
+do ifac = 1, nfabor
+ read(impgeo,*)
+enddo
+
+! Coordonnees du centre des cellules
+read(impgeo,*)
+read(impgeo,*)
+do iel = 1,ncel
+ read(impgeo,*)
+enddo
+
+! Surfaces des faces internes
+read(impgeo,*)
+read(impgeo,*)
+do ifac = 1,nfac
+ read(impgeo,*)
+enddo
+
+! Surfaces des faces de bord
+read(impgeo,*)
+read(impgeo,*)
+do ifac = 1,nfabor
+ read(impgeo,*)
+enddo
+
+! Coordonnees du centre des faces
+read(impgeo,*)
+read(impgeo,*)
+do ifac = 1,nfac
+ read(impgeo,*)
+enddo
+
+! Coordonnees du centre des faces de bord
+read(impgeo,*)
+read(impgeo,*)
+do ifac = 1,nfabor
+ read(impgeo,*)
+enddo
+
+! Familles des faces de bord
+read(impgeo,*)
+read(impgeo,*)
+do ifac = 1,nfabor
+ read(impgeo,*)
+enddo
+
+! Proprietes des familles
+read(impgeo,*)
+read(impgeo,*)
+do ifml = 1,nfml
+ read(impgeo,*)
+enddo
+
+! Coordonnees des noeuds
+read(impgeo,*)
+read(impgeo,*)
+do n1 = 1,nsom
+ read(impgeo,*)
+enddo
+
+! Connectivite cellules points
+read(impgeo,*)
+read(impgeo,*)
+do n1 = 1,ncel
+ read(impgeo,*)
+enddo
+
+!===============================================================================
+! 3. Calcul des dimensions LNDFAC et LNDFBR si possible
+!===============================================================================
+
+! Remarque : si les tableaux ne sont pas disponibles,
+! on aura une erreur de fin de fichier.
+! Dans ce cas, on sort en fermant normalement
+! le fichier, en mettant LNDFAC et LNDFBR � 0.
+
+!--> Dimension du tableau de connectivite faces de bord -> points
+
+read(impgeo,*,err=9000,end=100)
+read(impgeo,*,err=9000,end=100)
+lndfbr = 0
+do n1 = 1,nfabor
+ read(impgeo,1200,err=9000,end=100) nn , ip
+ lndfbr = lndfbr + ip
+enddo
+
+!--> Dimension du tableau de connectivite faces internes -> points
+
+read(impgeo,*,err=9000,end=100)
+read(impgeo,*,err=9000,end=100)
+lndfac = 0
+do n1 = 1,nfac
+ read(impgeo,1200,err=9000,end=100) nn , ip
+ lndfac = lndfac + ip
+enddo
+
+!--> Si l'on a pu lire les tableaux de connectivite faces -> points,
+! on conserve les dimensions LNDFBR et LNDFAC calculees ;
+! sinon, on les remet a zero
+
+goto 200
+
+ 100 lndfbr = 0
+lndfac = 0
+
+ 200 continue
+
+!===============================================================================
+! 3. Fermeture du fichier et mise a jour des structures C
+!===============================================================================
+
+close(impgeo)
+
+!---> MISE A JOUR STRUCTURES C
+
+ncelet = ncel
+
+call dimgeo &
+!==========
+ (ndim , ncelet, ncel , nfac , nfabor , nsom , &
+ lndfac, lndfbr, nfml , nprfml, &
+ ntetra, npyram, nprism, nhexae)
+
+!---> FORMATS
+
+ 1100 format(20i10)
+ 1200 format(i10,i10)
+
+return
+
+! ERREURS
+
+ 9000 continue
+write(nfecra,8000)ficgeo
+call csexit (1)
+ 9002 continue
+write(nfecra,8002) &
+ ficgeo,ndim,ncel,nfac,nfabor,nprfml,nfml ,nsom
+call csexit (1)
+ 9003 continue
+write(nfecra,8003) &
+ ficgeo,ndim,ncel,nfac,nfabor,nprfml,nfml ,nsom
+call csexit (1)
+
+! FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''OUVERTURE DU FICHIER GEOMETRIE ',/,&
+'@ ========= ',/,&
+'@ ERREUR DANS ledgeo POUR LE FICHIER ',A6 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier geometrie (existence, droits ',/,&
+'@ d''acces, recopie correcte dans le repertoire de ',/,&
+'@ travail). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER GEOMETRIE ',/,&
+'@ ========= ',/,&
+'@ ERREUR DANS ledgeo POUR LE FICHIER ',A6 ,/,&
+'@ ',/,&
+'@ L''etat des dimensions lues est le suivant : ',/,&
+'@ NDIM NCEL NFAC NFABOR ',/,&
+'@ ',4I10 ,/,&
+'@ NPRFML NFML NSOM ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier geometrie (existence, droits ',/,&
+'@ d''acces, format...). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER GEOMETRIE ',/,&
+'@ ========= ',/,&
+'@ FIN PREMATUREE DANS ledgeo POUR LE FICHIER ',A6 ,/,&
+'@ ',/,&
+'@ L''etat des dimensions lues est le suivant : ',/,&
+'@ NDIM NCEL NFAC NFABOR ',/,&
+'@ ',4I10 ,/,&
+'@ NPRFML NFML NSOM ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier geometrie (existence, droits ',/,&
+'@ d''acces, format...). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE OPENING THE GEOMETRY FILE ',/,&
+'@ ======== ',/,&
+'@ ERROR IN ledgeo FOR FILE ',A6 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the geometry file (existence, access ',/,&
+'@ permission, correct copy in the working directory) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE READING THE GEOMETRY FILE ',/,&
+'@ ======== ',/,&
+'@ ERROR IN ledgeo FOR FILE ',A6 ,/,&
+'@ ',/,&
+'@ The state of the read dimensions is: ',/,&
+'@ NDIM NCEL NFAC NFABOR ',/,&
+'@ ',4I10 ,/,&
+'@ NPRFML NFML NSOM ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the geometry file (existence, access ',/,&
+'@ permission, format...) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE READING THE GEOMETRY FILE ',/,&
+'@ ======== ',/,&
+'@ UNEXPECTED END OF FILE in ledgeo FOR FILE ',A6 ,/,&
+'@ ',/,&
+'@ The state of the read dimensions is: ',/,&
+'@ NDIM NCEL NFAC NFABOR ',/,&
+'@ ',4I10 ,/,&
+'@ NPRFML NFML NSOM ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the geometry file (existence, access ',/,&
+'@ permission, format...) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+end
diff --git a/src/base/letgeo.f90 b/src/base/letgeo.f90
new file mode 100644
index 0000000..6a9eb08
--- /dev/null
+++ b/src/base/letgeo.f90
@@ -0,0 +1,872 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine letgeo &
+!================
+
+ ( ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ ntetra , npyram , nprism , nhexae , inodal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ icotet , icopyr , icopri , icohex , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! LECTURE DES TABLEAUX ENTITES GEOMETRIQUES
+!ARGU
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ntetra ! e ! <-- ! nombre de tetraedres du maillage !
+! npyram ! e ! <-- ! nombre de pyramides du maillage !
+! nprism ! e ! <-- ! nombre de prismes du maillage !
+! nhexae ! e ! <-- ! nombre de hexaedres du maillage !
+! inodal ! e ! --> ! indique si l'on doit lire la !
+! ! ! ! connectivite nodale pour le !
+! ! ! ! post traitement !
+! ifacel ! te ! --> ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! --> ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! --> ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! --> ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! --> ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! icotet ! te ! --> ! connectivite tetraedres-noeuds !
+! icopyr ! te ! --> ! connectivite pyramides-noeuds !
+! icopri ! te ! --> ! connectivite prismes-noeuds !
+! icohex ! te ! --> ! connectivite hexaedres-noeuds !
+! ipnfac ! te ! --- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! --- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! --- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! --- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! xyzcen ! tr ! --> ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! --> ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! --> ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! --> ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! --> ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! --- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer ntetra , npyram , nprism , nhexae , inodal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer icotet(4,ntetra), icopyr(5,npyram)
+integer icopri(6,nprism), icohex(8,nhexae)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac)
+double precision surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac)
+double precision cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod)
+
+! VARIABLES LOCALES
+
+integer kel, iel, idim, kface, iface, kfafbr, kprffb
+integer iok, iok1, iok2, ind
+integer jdim,jcel ,jfac ,jfabor
+integer jprffb, jfafbr
+integer jpoint, jtetra, jpyram, jprism, jhexae
+integer ifac, nn, n1, n2, ip, ii1, ii2
+integer nbfac1, nbfac2
+
+!===============================================================================
+
+iok = 0
+
+inodal = 0
+
+!===============================================================================
+! 1. OUVERTURE
+!===============================================================================
+
+OPEN (FILE=FICGEO,UNIT=IMPGEO,FORM='formatted')
+
+
+!===============================================================================
+! 2. LECTURE DES DIMENSIONS ET VERIFICATIONS
+!===============================================================================
+
+read (impgeo, *)
+read (impgeo, *)
+jdim = 3
+read (impgeo,1100) jcel, jfac, jfabor, jpoint
+
+if (jdim.ne.ndim.or.jcel .ne.ncel ) then
+ WRITE(NFECRA,2010) ' JDIM',JDIM,' JCEL',JCEL , &
+ ' NDIM',NDIM,' NCEL',NCEL
+ iok = iok + 1
+endif
+if (jfac .ne.nfac .or.jfabor.ne.nfabor) then
+ WRITE(NFECRA,2010) ' JFAC',JFAC ,'JFABOR',JFABOR, &
+ ' NFAC',NFAC ,'NFABOR',NFABOR
+ iok = iok + 1
+endif
+if (jpoint.ne.nnod ) then
+ WRITE(NFECRA,2011) 'JPOINT',JPOINT, &
+ 'NNOD ',NNOD
+ iok = iok + 1
+endif
+
+read (impgeo, *)
+read (impgeo, *)
+read (impgeo,1100) jtetra,jpyram,jprism,jhexae
+
+if (jtetra.ne.ntetra.or.jpyram.ne.npyram) then
+ WRITE(NFECRA,2010) 'JTETRA',JTETRA,'JPYRAM',JPYRAM, &
+ 'NTETRA',NTETRA,'NPYRAM',NPYRAM
+ iok = iok + 1
+endif
+if (jprism.ne.nprism.or.jhexae.ne.nhexae) then
+ WRITE(NFECRA,2010) 'JPRISM',JPRISM,'JHEXAE',JHEXAE, &
+ 'NPRISM',NPRISM,'NHEXAE',NHEXAE
+ iok = iok + 1
+endif
+
+read (impgeo, *)
+read (impgeo, *)
+read (impgeo,1100) jprffb, jfafbr
+
+if (jprffb.ne.nprfml.or.jfafbr.ne.nfml ) then
+ WRITE(NFECRA,2010) 'JPRFFB',JPRFFB,'JFAFBR',JFAFBR, &
+ 'NPRFML',NPRFML,'NFML ',NFML
+ iok = iok + 1
+endif
+
+if (iok.ne.0) then
+ write(nfecra,9999)
+ call csexit (1)
+endif
+
+
+!===============================================================================
+! 3. LECTURE DES TABLEAUX PRINCIPAUX
+!===============================================================================
+
+read (impgeo, *)
+read (impgeo, *)
+do kface = 1, nfac
+ read (impgeo,1100) iface,(ifacel(iel,kface),iel=1,2)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kface = 1, nfabor
+ read (impgeo,1100) iface,ifabor(kface)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kel = 1, ncel
+ read (impgeo,1120) iel,xyzcen(1,kel),xyzcen(2,kel),xyzcen(3,kel)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kface = 1, nfac
+ read (impgeo,1120) iface,(surfac(idim,kface),idim=1,ndim)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kface = 1, nfabor
+ read (impgeo,1120) iface,(surfbo(idim,kface),idim=1,ndim)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kface = 1, nfac
+ read (impgeo,1120) iface,(cdgfac(idim,kface),idim=1,ndim)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kface = 1, nfabor
+ read (impgeo,1120) iface,(cdgfbo(idim,kface),idim=1,ndim)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kface = 1, nfabor
+ read (impgeo,1100) iface,ifmfbr(kface)
+enddo
+
+read (impgeo, *)
+read (impgeo, *)
+do kfafbr = 1, nfml
+ read (impgeo,1100) &
+ jfafbr,(iprfml(jfafbr,kprffb),kprffb=1,nprfml)
+enddo
+
+! IFMCEL NON LU ICI, ON INITIALISE A LA PLACE
+
+do kel = 1, ncel
+ ifmcel(kel) = 0
+enddo
+
+!===============================================================================
+! 4. LECTURE DES POINTS SUPPORT ET DE LA CONNECTIVITE NODALE
+!===============================================================================
+
+! Selon si l'on dispose des connectivites faces->sommets ou non,
+! on pourra reconstruire une connectivite nodale pour le post
+! traitement. Si celui-ci est demande et que cette connectivite
+! n'est pas disponible, on utilise la connectivite nodale
+! fournie dans le fichier solcom.
+
+if (lndfac.eq.0 .and. lndfbr.eq.0 .and. ichrvl.gt.0) then
+ inodal = 1
+else
+ inodal = 0
+endif
+
+! Coordonnees des sommets
+! -----------------------
+
+! Selon si l'on dispose des connectivites faces->sommets ou non,
+! le tableau XYZNOD passe en argument appartient a la connectivite
+! complete ou au maillage nodal destine au post traitement.
+
+read(impgeo,*)
+read(impgeo,*)
+
+if ((lndfac.gt.0 .or. lndfbr.gt.0) .or. inodal.eq.1) then
+
+ do n1 = 1,nnod
+ read(impgeo,1120) nn,(xyznod(ip,nn),ip=1,3)
+ enddo
+
+else
+
+ do n1 = 1,nnod
+ read(impgeo,*)
+ enddo
+
+endif
+
+! Connectivites cellules - sommets
+! --------------------------------
+
+! On n'utilise ces connectivites que lorsque l'on ne dispose pas
+! des connectivites faces -> sommets, et que l'on ne pourra donc
+! pas reconstruire une connectivite nodale pour le post traitement.
+
+read (impgeo,*)
+read (impgeo,*)
+
+if (inodal .eq. 1) then
+
+ do n1 = 1, ntetra
+ read(impgeo,1100) nn,(icotet(ip,n1),ip=1,4)
+ enddo
+ do n1 = 1, npyram
+ read(impgeo,1100) nn,(icopyr(ip,n1),ip=1,5)
+ enddo
+ do n1 = 1, nprism
+ read(impgeo,1100) nn,(icopri(ip,n1),ip=1,6)
+ enddo
+ do n1 = 1, nhexae
+ read(impgeo,1100) nn,(icohex(ip,n1),ip=1,8)
+ enddo
+
+else
+
+ do n1 = 1, ntetra
+ read(impgeo,*)
+ enddo
+ do n1 = 1, npyram
+ read(impgeo,*)
+ enddo
+ do n1 = 1, nprism
+ read(impgeo,*)
+ enddo
+ do n1 = 1, nhexae
+ read(impgeo,*)
+ enddo
+
+endif
+
+!===============================================================================
+! 5. LECTURE DES CONNECTIVITES FACE-SOMMET
+!===============================================================================
+
+! On peut avoir besoin de la connectivite faces -> sommets pour
+! les modules rayonnement et Lagrangien. Les tableaux
+! correspondants se trouvent en fin de fichier, apr�s
+! les coordonnees des sommets.
+
+! Si l'on n'a pas detecte la presence de ces tableaux
+! supplementaires, on sort immediatement.
+
+if (lndfac.eq.0 .and. lndfbr.eq.0) return
+
+! Remarque : ces rubriques ont deja ete lues dans LEDGEO, pour
+! determiner les dimensions. On ne prend donc pas de
+! precaution quant a leur existence.
+
+! Connectivite faces de bord - sommets
+ii2 = 0
+read(impgeo,*,err=9000)
+read(impgeo,*,err=9000)
+do n1 = 1,nfabor
+ READ(IMPGEO,'(20I10)',ERR=9000) &
+ nn, ipnfbr(nn), (nodfbr(ii1),ii1=ii2+1,ii2+ipnfbr(nn))
+ ii2 = ii2 + ipnfbr(nn)
+enddo
+
+! Connectivite faces internes - sommets
+ii2 = 0
+read(impgeo,*,err=9000)
+read(impgeo,*,err=9000)
+do n1 = 1,nfac
+ READ(IMPGEO,'(20I10)',ERR=9000) &
+ nn, ipnfac(nn), (nodfac(ii1),ii1=ii2+1,ii2+ipnfac(nn))
+ ii2 = ii2 + ipnfac(nn)
+enddo
+
+!===============================================================================
+! 6. CREATION DES TABLEAUX IPNFAC et IPNFBR
+!===============================================================================
+
+! --> On calcule les pointeurs des tableaux NODFAC et NODFBR
+
+nbfac2 = ipnfac(1)
+ipnfac(1) = 1
+do ifac = 2,nfac
+ nbfac1 = nbfac2
+ nbfac2 = ipnfac(ifac)
+ ipnfac(ifac) = ipnfac(ifac-1) + nbfac1
+enddo
+ipnfac(nfac+1) = ipnfac(nfac) + nbfac2
+
+nbfac2 = ipnfbr(1)
+ipnfbr(1) = 1
+do ifac = 2, nfabor
+ nbfac1 = nbfac2
+ nbfac2 = ipnfbr(ifac)
+ ipnfbr(ifac) = ipnfbr(ifac-1) + nbfac1
+enddo
+ipnfbr(nfabor+1) = ipnfbr(nfabor) + nbfac2
+
+!===============================================================================
+! 7. CONTROLES SIMPLES
+!===============================================================================
+
+! --> Verifications de IPNFAC, IPNFBR
+
+iok = 0
+if (ipnfac(nfac+1).ne.lndfac+1) then
+ write(nfecra,2001)nfac ,lndfac+1,ipnfac(nfac+1)
+ iok = iok + 1
+endif
+if (ipnfbr(nfabor+1).ne.lndfbr+1) then
+ write(nfecra,2002)nfabor,lndfbr+1,ipnfbr(nfabor+1)
+ iok = iok + 1
+endif
+if(iok.ne.0) then
+ call csexit (1)
+endif
+
+
+! --> connectivite faces internes - sommets
+iok1=0
+do ifac = 1,nfac
+ ind = 0
+ do n1 = ipnfac(ifac),ipnfac(ifac+1)-1
+ do n2 = ipnfac(ifac),ipnfac(ifac+1)-1
+ if (n1.ne.n2 .and. &
+ ((xyznod(1,nodfac(n1)).eq.xyznod(1,nodfac(n2))) .and. &
+ (xyznod(2,nodfac(n1)).eq.xyznod(2,nodfac(n2))) .and. &
+ (xyznod(3,nodfac(n1)).eq.xyznod(3,nodfac(n2))) )) then
+ ind=1
+ endif
+ enddo
+ enddo
+ if (ind.ne.0) then
+ do n1 = ipnfac(ifac),ipnfac(ifac+1)-1
+ write(nfecra,3011)nodfac(n1), &
+ n1,xyznod(1,nodfac(n1)), &
+ n1,xyznod(2,nodfac(n1)), &
+ n1,xyznod(3,nodfac(n1))
+ enddo
+ iok1=iok1+1
+ endif
+enddo
+
+! --> connectivite faces de bord - sommets
+iok2=0
+do ifac = 1,nfabor
+ ind = 0
+ do n1 = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ do n2 = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ if (n1.ne.n2 .and. &
+ ((xyznod(1,nodfbr(n1)).eq.xyznod(1,nodfbr(n2))) .and. &
+ (xyznod(2,nodfbr(n1)).eq.xyznod(2,nodfbr(n2))) .and. &
+ (xyznod(3,nodfbr(n1)).eq.xyznod(3,nodfbr(n2))) )) then
+ ind=1
+ endif
+ enddo
+ enddo
+ if (ind.ne.0) then
+ do n1 = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ write(nfecra,3012)nodfbr(n1), &
+ n1,xyznod(1,nodfbr(n1)), &
+ n1,xyznod(2,nodfbr(n1)), &
+ n1,xyznod(3,nodfbr(n1))
+ enddo
+ iok2=iok2+1
+ endif
+enddo
+
+! --> stop si erreur connectivites
+
+if(iok1.ne.0) then
+ write(nfecra,3001)
+endif
+if(iok2.ne.0) then
+ write(nfecra,3002)
+endif
+if(iok1.ne.0.or.iok2.ne.0) then
+ call csexit (1)
+endif
+
+!===============================================================================
+! 8. FERMETURE
+!===============================================================================
+
+close(impgeo)
+
+return
+
+!===============================================================================
+! 9. SORTIES SUR ERREUR DE LECTURE
+!===============================================================================
+
+! ---> Stop si le maillage lu est incomplet ou erreur a la lecture.
+
+ 9000 write(nfecra,9100)
+call csexit (1)
+
+!---> FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 1100 format(20i10)
+ 1120 format(i10, 5e23.15)
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA CREATION DES CONNECTIVITES ',/,&
+'@ ========= (LETGEO). ',/,&
+'@ ',/,&
+'@ Le nombre de faces internes est NFAC = ',I10 ,/,&
+'@ IPNFAC(NFAC +1)devrait valoir ',I10 ,/,&
+'@ il vaut ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Verifier LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA CREATION DES CONNECTIVITES ',/,&
+'@ ========= (LETGEO). ',/,&
+'@ ',/,&
+'@ Le nombre de faces de bord est NFABOR = ',I10 ,/,&
+'@ IPNFBR(NFABOR+1)devrait valoir ',I10 ,/,&
+'@ il vaut ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Verifier LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER GEOMETRIE ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCES RENCONTREES ',/,&
+'@ ',/,&
+'@ Les dimensions lues dans letgeo ne sont pas en accord ',/,&
+'@ avec les dimensions lues dans ledgeo. ',/,&
+'@ Lecture de ',A6,' = ',I10 ,', ',A6,' = ',I10 ,/,&
+'@ alors que ',A6,' = ',I10 ,', ',A6,' = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER GEOMETRIE ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCES RENCONTREES ',/,&
+'@ ',/,&
+'@ Les dimensions lues dans letgeo ne sont pas en accord ',/,&
+'@ avec les dimensions lues dans ledgeo. ',/,&
+'@ Lecture de ',A6,' = ',I10 ,/,&
+'@ alors que ',A6,' = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA CREATION DES CONNECTIVITES ',/,&
+'@ ========= (LETGEO) ',/,&
+'@ ',/,&
+'@ Le test a echoue sur la connectivite ',/,&
+'@ faces internes -> points supports ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Verifier LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA CREATION DES CONNECTIVITES ',/,&
+'@ ========= (LETGEO) ',/,&
+'@ ',/,&
+'@ Le test a echoue sur la connectivite ',/,&
+'@ faces de bord -> points supports ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Verifier LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3011 format( &
+'@ ',/,&
+'@ @@ ATTENTION : LETGEO - CONNECTIVITE : NODFAC = ',I10 ,/,&
+'@ X(',I10,') = ',E23.15 ,/,&
+'@ Y(',I10,') = ',E23.15 ,/,&
+'@ Z(',I10,') = ',E23.15 )
+ 3012 format( &
+'@ ',/,&
+'@ @@ ATTENTION : LETGEO - CONNECTIVITE : NODFBR = ',I10 ,/,&
+'@ X(',I10,') = ',E23.15 ,/,&
+'@ Y(',I10,') = ',E23.15 ,/,&
+'@ Z(',I10,') = ',E23.15 )
+
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU MAILLAGE ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ LE MAILLAGE LU (.slc ou .tlc) EST INCOMPLET ',/,&
+'@ ',/,&
+'@ Le fichier de maillage ne contient pas les informations ',/,&
+'@ relatives a la connectivite faces-noeuds, ou contient ',/,&
+'@ des informations incompletes. ',/,&
+'@ Ces informations sont necessaires pour effectuer un calcul',/,&
+'@ en utilisant le module Lagrangien ou Rayonnement ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier de maillage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER GEOMETRIE ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCES RENCONTREES ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1100 format(20i10)
+ 1120 format(i10, 5e23.15)
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE CONNECTIVITY CREATION (LETGEO) ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The number of interior faces is NFAC = ',I10 ,/,&
+'@ IPNFAC(NFAC +1) should be ',I10 ,/,&
+'@ it is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Verify LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE CONNECTIVITY CREATION (LETGEO) ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The number of interior faces is NFABOR = ',I10 ,/,&
+'@ IPNFAC(NFABOR+1) should be ',I10 ,/,&
+'@ it is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Verify LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE READING THE GEOMETRY FILE ',/,&
+'@ ======== ',/,&
+'@ THERE ARE SOME INCOHERENCIES ',/,&
+'@ ',/,&
+'@ The dimensions read in letgeo do not comply with ',/,&
+'@ the dimensions read in ledgeo. ',/,&
+'@ Reading ',A6,' = ',I10 ,', ',A6,' = ',I10 ,/,&
+'@ whereas ',A6,' = ',I10 ,', ',A6,' = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE READING THE GEOMETRY FILE ',/,&
+'@ ======== ',/,&
+'@ THERE ARE SOME INCOHERENCIES ',/,&
+'@ ',/,&
+'@ The dimensions read in letgeo do not comply with ',/,&
+'@ the dimensions read in ledgeo. ',/,&
+'@ Reading ',A6,' = ',I10 ,/,&
+'@ whereas ',A6,' = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE CONNECTIVITY CREATION (LETGEO) ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The test failed on the interior faces -> vertices ',/,&
+'@ connectivity. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Verify LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE CONNECTIVITY CREATION (LETGEO) ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The test failed on the boundary faces -> vertices ',/,&
+'@ connectivity. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Verify LETGEO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3011 format( &
+'@ ',/,&
+'@ @@ WARNING: LETGEO - CONNECTIVITY : NODFAC = ',I10 ,/,&
+'@ X(',I10,') = ',E23.15 ,/,&
+'@ Y(',I10,') = ',E23.15 ,/,&
+'@ Z(',I10,') = ',E23.15 )
+ 3012 format( &
+'@ ',/,&
+'@ @@ WARNING: LETGEO - CONNECTIVITY : NODFBR = ',I10 ,/,&
+'@ X(',I10,') = ',E23.15 ,/,&
+'@ Y(',I10,') = ',E23.15 ,/,&
+'@ Z(',I10,') = ',E23.15 )
+
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE READING THE MESH ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ THE MESH (.slc or .tlc) IS INCOMPLETE ',/,&
+'@ ',/,&
+'@ The mesh file does not contain the information relative ',/,&
+'@ to the face-vertices connectivity, or contains ',/,&
+'@ incomplete informations. ',/,&
+'@ These informations are mandatory to run a simulation ',/,&
+'@ using the Lagrangian or radiative transfer module. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh file. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE READING THE GEOMETRY FILE ',/,&
+'@ ======== ',/,&
+'@ THERE ARE SOME INCOHERENCIES ',/,&
+'@ ',/,&
+'@ The calculation will not be run (',I10,' errors). ',/,&
+'@ ',/,&
+'@ Refer to the previous warnings for further informations. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/majgeo.f90 b/src/base/majgeo.f90
new file mode 100644
index 0000000..fda7636
--- /dev/null
+++ b/src/base/majgeo.f90
@@ -0,0 +1,196 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine majgeo &
+!================
+
+ ( ncel2 , ncele2 , nfac2 , nfabo2 , nsom2 , &
+ lndfa2 , lndfb2 , ncelg2 , nfacg2 , nfbrg2 , nsomg2 , &
+ nthdi2 , nthdb2 , ngrpi2 , ngrpb2 , idxfi , idxfb )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! PASSAGE DES DIMENSIONS DU MAILLAGE DU C AU FORTRAN.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncel2 ! e ! <-- ! nombre de cellules !
+! ncele2 ! e ! <-- ! nombre d'elements halo compris !
+! nfac2 ! e ! <-- ! nombre de faces internes !
+! nfabo2 ! e ! <-- ! nombre de faces de bord !
+! nsom2 ! e ! <-- ! nombre de sommets !
+! lndfa2 ! e ! <-- ! taille de lndfac !
+! lndfb2 ! e ! <-- ! taille de lndfbr !
+! ncelg2 ! e ! <-- ! nombre global de cellules !
+! nfacg2 ! e ! <-- ! nombre global de faces internes !
+! nfbrg2 ! e ! <-- ! nombre global de faces de bord !
+! nsomg2 ! e ! <-- ! nombre global de sommets !
+! nthdi2 ! e ! <-- ! nb. max de threads par groupe de faces inter !
+! nthdb2 ! e ! <-- ! nb. max de threads par groupe de faces de bord !
+! ngrpi2 ! e ! <-- ! nb. groupes de faces interieures !
+! ngrpb2 ! e ! <-- ! nb. groupes de faces de bord !
+! idxfi ! e ! <-- ! index pour faces internes !
+! idxfb ! e ! <-- ! index pour faces de bord !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimens.h"
+include "dimfbr.h"
+include "paramx.h"
+include "entsor.h"
+include "parall.h"
+
+! Arguments
+
+integer ncel2, ncele2, nfac2, nfabo2, nsom2
+integer lndfa2, lndfb2
+integer ncelg2, nfacg2 , nfbrg2, nsomg2
+integer nthdi2, nthdb2
+integer ngrpi2, ngrpb2
+integer idxfi(*), idxfb(*)
+
+! VARIABLES LOCALES
+
+integer ii, jj
+
+!===============================================================================
+
+!===============================================================================
+! 1. MISE A JOUR DU NOMBRE DE CELLULES
+!===============================================================================
+
+ncel = ncel2
+ncelet = ncele2
+
+!===============================================================================
+! 2. MISE A JOUR DU NOMBRE DES FACES
+!===============================================================================
+
+nfac = nfac2
+nfabor = nfabo2
+
+lndfac = lndfa2
+lndfbr = lndfb2
+
+! On remplit maintenant NDIMFB
+if (nfabor.eq.0) then
+ ndimfb = 1
+else
+ ndimfb = nfabor
+endif
+
+!===============================================================================
+! 3. MISE A JOUR DU NOMBRE DES SOMMETS
+!===============================================================================
+
+nnod = nsom2
+
+!===============================================================================
+! 4. MISE A JOUR DES TAILLES GLOBALES
+!===============================================================================
+
+ncelgb = ncelg2
+nfacgb = nfacg2
+nfbrgb = nfbrg2
+nsomgb = nsomg2
+
+!===============================================================================
+! 5. INITIALISATION DES INFORMATIONS SUR LES THREADS
+!===============================================================================
+
+do ii = 1, nthrd1
+ do jj = 1, nthrd2
+ iompli(1, ii, jj) = 0
+ iompli(2, ii, jj) = 0
+ iomplb(1, ii, jj) = 0
+ iomplb(2, ii, jj) = 0
+ enddo
+enddo
+
+! Pour le groupe j et le thread i, boucles sur les faces
+! de iompl.(1, j, i) à iompl.(2, j, i).
+
+! Par defaut (i.e. sans Open MP), 1 thread et un groupe
+
+iompli(1, 1, 1) = 1
+iompli(2, 1, 1) = nfac
+iomplb(1, 1, 1) = 1
+iomplb(2, 1, 1) = nfabor
+
+! Numerotations pour boucles OpenMP sur les faces interieures
+
+ngrpi = ngrpi2
+nthrdi = nthdi2
+
+if (nthrdi.gt.1 .and. ngrpi.gt.1) then
+
+ do ii = 1, nthrdi
+ do jj = 1, ngrpi
+
+ iompli(1, jj, ii) = idxfi((ii-1)*ngrpi*2 + 2*jj-1) + 1
+ iompli(2, jj, ii) = idxfi((ii-1)*ngrpi*2 + 2*jj)
+
+ enddo
+ enddo
+
+endif
+
+! Numerotations pour boucles OpenMP sur les faces de bord
+
+ngrpb = ngrpb2
+nthrdb = nthdb2
+
+if (nthrdb.gt.1 .and. ngrpb.gt.1) then
+
+ do ii = 1, nthrdb
+ do jj = 1, ngrpb
+
+ iomplb(1, jj, ii) = idxfb((ii-1)*ngrpb*2 + 2*jj-1) + 1
+ iomplb(2, jj, ii) = idxfb((ii-1)*ngrpb*2 + 2*jj)
+
+ enddo
+ enddo
+
+endif
+return
+end
diff --git a/src/base/matrdt.f90 b/src/base/matrdt.f90
new file mode 100644
index 0000000..097ee9d
--- /dev/null
+++ b/src/base/matrdt.f90
@@ -0,0 +1,336 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine matrdt &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iconvp , idiffp , isym , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ coefbp , flumas , flumab , viscf , viscb , &
+ da , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CONSTRUCTION DE LA DIAGONALE DE LA
+! MATRICE DE CONVECTION UPWIND/DIFFUSION/TS
+! POUR DETERMINATION DU PAS DE TEMPS VARIABLE, COURANT, FOURIER
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
+! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
+! isym ! e ! <-- ! indicateur = 1 matrice symetrique !
+! ! ! ! 2 matrice non symetrique !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! coefbp(nfabor ! tr ! <-- ! tab b des cl pour le pdt considere !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! viscf(nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
+! da (ncelet ! tr ! --> ! partie diagonale de la matrice !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "vector.h"
+include "entsor.h"
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+integer iconvp , idiffp , isym
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision coefbp(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision viscf(nfac), viscb(nfabor)
+double precision da(ncelet )
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ifac,ii,jj,iel
+double precision flui,fluj,xaifa1,xaifa2
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+if(isym.ne.1.and.isym.ne.2) then
+ write(nfecra,1000) isym
+ call csexit (1)
+endif
+
+do iel = 1, ncel
+ da(iel) = 0.d0
+enddo
+if(ncelet.gt.ncel) then
+ do iel = ncel+1, ncelet
+ da(iel) = 0.d0
+ enddo
+endif
+
+!===============================================================================
+! 2. CALCUL DES TERMES EXTRADIAGONAUX INUTILE
+!===============================================================================
+
+!===============================================================================
+! 3. CONTRIBUTION DES TERMES X-TRADIAGONAUX A LA DIAGONALE
+!===============================================================================
+
+if(isym.eq.2) then
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ fluj =-0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ xaifa2 = iconvp*fluj -idiffp*viscf(ifac)
+ xaifa1 = iconvp*flui -idiffp*viscf(ifac)
+ da(ii) = da(ii) -xaifa2
+ da(jj) = da(jj) -xaifa1
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ fluj =-0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ xaifa2 = iconvp*fluj -idiffp*viscf(ifac)
+ xaifa1 = iconvp*flui -idiffp*viscf(ifac)
+ da(ii) = da(ii) -xaifa2
+ da(jj) = da(jj) -xaifa1
+ enddo
+
+ endif
+
+else
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ xaifa1 = iconvp*flui -idiffp*viscf(ifac)
+ da(ii) = da(ii) -xaifa1
+ da(jj) = da(jj) -xaifa1
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ xaifa1 = iconvp*flui -idiffp*viscf(ifac)
+ da(ii) = da(ii) -xaifa1
+ da(jj) = da(jj) -xaifa1
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 4. CONTRIBUTION DES FACETTES DE BORDS A LA DIAGONALE
+!===============================================================================
+
+if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ flui = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+ fluj =-0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ da(ii) = da(ii) +iconvp*(-fluj + flui*coefbp(ifac) ) &
+ +idiffp*viscb(ifac)*(1.d0-coefbp(ifac))
+ enddo
+
+else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ flui = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+ fluj =-0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ da(ii) = da(ii) +iconvp*(-fluj + flui*coefbp(ifac) ) &
+ +idiffp*viscb(ifac)*(1.d0-coefbp(ifac))
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS matrdt ',/,&
+'@ ========= ',/,&
+'@ APPEL DE matrdt AVEC ISYM = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT IN matrdt' ,/,&
+'@ ========' ,/,&
+'@ matrdt CALLED WITH ISYM = ',I10 ,/,&
+'@' ,/,&
+'@ The calculation will not be run.' ,/,&
+'@' ,/,&
+'@ Contact support.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/matrix.f90 b/src/base/matrix.f90
new file mode 100644
index 0000000..553d578
--- /dev/null
+++ b/src/base/matrix.f90
@@ -0,0 +1,314 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine matrix &
+!================
+
+ ( ncelet , ncel , nfac , nfabor , &
+ iconvp , idiffp , ndircp , isym , nfecra , &
+ thetap , &
+ ifacel , ifabor , &
+ coefbp , rovsdt , flumas , flumab , viscf , viscb , &
+ da , xa )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CONSTRUCTION DE LA MATRICE DE CONVECTION UPWIND/DIFFUSION/TS
+
+! IL EST INTERDIT DE MODIFIER ROVSDT ICI
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
+! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
+! ndircp ! e ! <-- ! indicateur = 0 si decalage diagonale !
+! isym ! e ! <-- ! indicateur = 1 matrice symetrique !
+! ! ! ! 2 matrice non symetrique !
+! thetap ! r ! <-- ! coefficient de ponderation pour le !
+! ! ! ! theta-schema (on ne l'utilise pour le !
+! ! ! ! moment que pour u,v,w et les scalaire !
+! ! ! ! - thetap = 0.5 correspond a un schema !
+! ! ! ! totalement centre en temps (mixage !
+! ! ! ! entre crank-nicolson et adams- !
+! ! ! ! bashforth) !
+! ifacel(2,nfac ! te ! <-- ! no des elts voisins d'une face intern !
+! ifabor(nfabor ! te ! <-- ! no de l'elt voisin d'une face de bord !
+! coefbp(nfabor ! tr ! <-- ! tab b des cl pour la var consideree !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! viscf(nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
+! da (ncelet ! tr ! --> ! partie diagonale de la matrice !
+! xa (nfac,*) ! tr ! --> ! extra diagonale de la matrice !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "vector.h"
+
+!===============================================================================
+
+
+! Arguments
+
+integer ncelet , ncel , nfac , nfabor
+integer iconvp , idiffp , ndircp , isym
+integer nfecra
+double precision thetap
+
+integer ifacel(2,nfac), ifabor(nfabor)
+double precision coefbp(nfabor), rovsdt(ncelet)
+double precision flumas(nfac), flumab(nfabor)
+double precision viscf(nfac), viscb(nfabor)
+double precision da(ncelet ),xa(nfac ,isym)
+
+! VARIABLES LOCALES
+
+integer ifac,ii,jj,iel
+double precision flui,fluj,epsi
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+if(isym.ne.1.and.isym.ne.2) then
+ write(nfecra,1000) isym
+ call csexit (1)
+endif
+
+epsi = 1.d-7
+
+do iel = 1, ncel
+ da(iel) = rovsdt(iel)
+enddo
+if(ncelet.gt.ncel) then
+ do iel = ncel+1, ncelet
+ da(iel) = 0.d0
+ enddo
+endif
+
+if(isym.eq.2) then
+ do ifac = 1, nfac
+ xa(ifac,1) = 0.d0
+ xa(ifac,2) = 0.d0
+ enddo
+else
+ do ifac = 1, nfac
+ xa(ifac,1) = 0.d0
+ enddo
+endif
+
+!===============================================================================
+! 2. CALCUL DES TERMES EXTRADIAGONAUX
+!===============================================================================
+
+if(isym.eq.2) then
+
+ do ifac = 1,nfac
+ flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ fluj =-0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ xa(ifac,1) = thetap*(iconvp*flui -idiffp*viscf(ifac))
+ xa(ifac,2) = thetap*(iconvp*fluj -idiffp*viscf(ifac))
+ enddo
+
+else
+
+ do ifac = 1,nfac
+ flui = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ xa(ifac,1) = thetap*(iconvp*flui -idiffp*viscf(ifac))
+ enddo
+
+endif
+
+!===============================================================================
+! 3. CONTRIBUTION DES TERMES X-TRADIAGONAUX A LA DIAGONALE
+!===============================================================================
+
+if(isym.eq.2) then
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ da(ii) = da(ii) -xa(ifac,2)
+ da(jj) = da(jj) -xa(ifac,1)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ da(ii) = da(ii) -xa(ifac,2)
+ da(jj) = da(jj) -xa(ifac,1)
+ enddo
+
+ endif
+
+else
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ da(ii) = da(ii) -xa(ifac,1)
+ da(jj) = da(jj) -xa(ifac,1)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ da(ii) = da(ii) -xa(ifac,1)
+ da(jj) = da(jj) -xa(ifac,1)
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 4. CONTRIBUTION DES FACETTES DE BORDS A LA DIAGONALE
+!===============================================================================
+
+if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac=1,nfabor
+ ii = ifabor(ifac)
+ flui = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+ fluj =-0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ da(ii) = da(ii) + thetap*( &
+ iconvp*(-fluj + flui*coefbp(ifac) ) &
+ +idiffp*viscb(ifac)*(1.d0-coefbp(ifac)) &
+ )
+ enddo
+
+else
+
+! VECTORISATION NON FORCEE
+ do ifac=1,nfabor
+ ii = ifabor(ifac)
+ flui = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+ fluj =-0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ da(ii) = da(ii) + thetap*( &
+ iconvp*(-fluj + flui*coefbp(ifac) ) &
+ +idiffp*viscb(ifac)*(1.d0-coefbp(ifac)) &
+ )
+ enddo
+
+endif
+
+!===============================================================================
+! 5. NON PRESENCE DE PTS DIRICHLET --> LEGER RENFORCEMENT DE LA
+! DIAGONALE POUR DECALER LE SPECTRE DES VALEURS PROPRES
+!===============================================================================
+! (si IDIRCL=0, on a force NDIRCP a valoir au moins 1 pour ne pas
+! decaler la diagonale)
+
+if ( ndircp.le.0 ) then
+ do iel=1,ncel
+ da(iel) = (1.d0+epsi)*da(iel)
+ enddo
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS matrix ',/,&
+'@ ========= ',/,&
+'@ APPEL DE matrix AVEC ISYM = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT IN matrix' ,/,&
+'@ ========' ,/,&
+'@ matrix CALLED WITH ISYM = ',I10 ,/,&
+'@' ,/,&
+'@ The calculation will not be run.' ,/,&
+'@' ,/,&
+'@ Contact support.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/memale.f90 b/src/base/memale.f90
new file mode 100644
index 0000000..dab389e
--- /dev/null
+++ b/src/base/memale.f90
@@ -0,0 +1,157 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memale &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviscf , iviscb , &
+ idam , ixam , idrtp , &
+ ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR LA RESOLUTION DE LA VITESSE DE MAILLAGE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! iw1,2,...,9 ! e ! --> ! "pointeur" sur w1 a w10 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer iviscf , iviscb
+integer idam , ixam
+integer idrtp , ismbr , irovsd
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+iviscf = idebra + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+iw1 = irovsd + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMALE',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memcbr.f90 b/src/base/memcbr.f90
new file mode 100644
index 0000000..e8bcb57
--- /dev/null
+++ b/src/base/memcbr.f90
@@ -0,0 +1,150 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memcbr &
+!================
+
+ ( iicelb , ncelet , ncel , nfabor , &
+ ncelbr , ifinia , &
+ ifabor , &
+ ia )
+
+!===============================================================================
+
+! FONCTION :
+! --------
+! REPERAGE DES ELEMENTS AYANT AU MOINS UNE FACE DE BORD
+! POUR LA RECONSTRUCTION DES GRADIENTS (RECALCUL DE
+! COCG UNIQUEMENT AUX BORDS)
+
+! ON CALCULE NCELBR ET ON REMPLIT IA(IICELB)
+
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iicelb ! e ! <-- ! pointeur de la premiere cas libre du !
+! ! ! ! tableau ia (et pointeur sur icelbr) !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ncelbr ! e ! --> ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! ifinia ! e ! --> ! iicelb+ncelbr debut de zone libre !
+! ! ! ! dans ia en sortie !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ia ! te ! --- ! tableau de travail entier !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer iicelb , ncelet , ncel , nfabor
+integer ncelbr , ifinia
+integer ifabor(nfabor)
+integer ia(*)
+
+! VARIABLES LOCALES
+
+integer ifac, ii, iel , iiasse
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. MEMOIRE
+!===============================================================================
+
+! On surdimensionne ICELBR (NFABOR)
+! et un tableau d'assemblage NCELET
+
+iiasse = iicelb + nfabor
+ifinia = iiasse + ncelet
+
+CALL IASIZE('MEMCBR',IFINIA)
+!==========
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+do iel = 1, ncelet
+ ia(iiasse+iel-1) = 0
+enddo
+
+!===============================================================================
+! 2. REPERAGE DES ELEMENTS DE BORD
+!===============================================================================
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ia(iiasse+iel-1) = ia(iiasse+iel-1) + 1
+enddo
+
+!===============================================================================
+! 3. REMPLISSAGE DE ICELBR
+!===============================================================================
+
+ii = 0
+do iel = 1, ncel
+ if (ia(iiasse+iel-1).gt.0) then
+ ii = ii + 1
+ ia(iicelb+ii-1) = iel
+ endif
+enddo
+
+ncelbr = ii
+
+!===============================================================================
+! 4. DESALLOCATION DE LA MEMOIRE EN TROP ET DU TABLEAU DE TRAVAIL IASSE
+!===============================================================================
+
+ifinia = iicelb + ncelbr
+
+!===============================================================================
+! 5. FIN
+!===============================================================================
+
+return
+end
diff --git a/src/base/memclg.f90 b/src/base/memclg.f90
new file mode 100644
index 0000000..efdf323
--- /dev/null
+++ b/src/base/memclg.f90
@@ -0,0 +1,129 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memclg &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR LE CALCUL DES DONNEES GEO
+! COMPLEMENTAIRES
+! MEMOIRE NON VOLATILE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia ,idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+
+isrfan = idebra
+isrfbn = isrfan + nfac
+idist = isrfbn + nfabor
+idistb = idist + nfac
+ipond = idistb + nfabor
+idijpf = ipond + nfac
+idiipb = idijpf + nfac *ndim
+idofij = idiipb + nfabor*ndim
+ifinra = idofij + nfac *ndim
+
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMCLG',IFINIA)
+! ==========
+
+CALL RASIZE('MEMCLG',IFINRA)
+! ==========
+
+return
+end
diff --git a/src/base/memcli.f90 b/src/base/memcli.f90
new file mode 100644
index 0000000..2da5b43
--- /dev/null
+++ b/src/base/memcli.f90
@@ -0,0 +1,176 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memcli &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ isvhb , isvtb , &
+ iicodc , ircodc , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , &
+ icoefu , irijip , iuetbo , ivsvdr , ihbord , itbord , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE CONDITIONS LIMITES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! isvhb ! e ! <-- ! indicateur de stockage de hbord !
+! isvtb ! e ! <-- ! indicateur de stockage de tbord !
+! iicodc,ircodc ! e ! --> ! "pointeur" sur icodlc rcodcl !
+! iw1,2,3,4,5,6 ! e ! --> ! "pointeur" sur w1,2,3,4,5,6 !
+! iuetbo ! e ! --> ! "pointeur" sur uetbor !
+! ihbord ! e ! --> ! "pointeur" sur hbord !
+! itbord ! e ! --> ! "pointeur" sur hbord !
+! irijip ! e ! --> ! "pointeur" sur rijipb !
+! ivsvdr ! e ! --> ! "pointeur" sur visvdr !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! e ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! e ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "ppppar.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer isvhb , isvtb
+integer iicodc , ircodc
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer icoefu , irijip , iuetbo , ivsvdr
+integer ihbord , itbord
+integer ifinia , ifinra
+
+integer idebia , idebra, irij, iphas, iiuetb
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+irij = 0
+do iphas = 1, nphas
+ if(itytur(iphas).eq.3) then
+ irij = 1
+ endif
+enddo
+
+iiuetb = 0
+do iphas = 1, nphas
+ if(itytur(iphas).eq.4.and.idries(iphas).eq.1)then
+ iiuetb = 1
+ endif
+enddo
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+iicodc = idebia
+ifinia = iicodc + nfabor*nvar
+
+ircodc = idebra
+iw1 = ircodc + nfabor*nvar*3
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+icoefu = iw6 + ncelet
+irijip = icoefu + nfabor*ndim
+iuetbo = irijip + nfabor*6*irij
+ivsvdr = iuetbo + nfabor*nphas*iiuetb
+ifinra = ivsvdr + ncelet*nphas*iiuetb
+
+ihbord = ifinra
+if(isvhb.gt.0) then
+ ifinra = ihbord + nfabor
+endif
+itbord = ifinra
+if(isvtb.gt.0.or.iirayo.gt.0) then
+ ifinra = itbord + nfabor
+endif
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMCLI',IFINIA)
+!==========
+
+CALL RASIZE('MEMCLI',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memcs1.f90 b/src/base/memcs1.f90
new file mode 100644
index 0000000..6d5f61b
--- /dev/null
+++ b/src/base/memcs1.f90
@@ -0,0 +1,109 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memcs1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncesup , nfbsup , ncecpl , nfbcpl , ncencp , nfbncp , &
+ ilcesu , ilfbsu , ilcecp , ilfbcp , ilcenc , ilfbnc , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR LE COUPLAGE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+!__________________.____._______________.________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncesup , nfbsup
+integer ncecpl , nfbcpl , ncencp , nfbncp
+integer ilcesu , ilfbsu
+integer ilcecp , ilfbcp , ilcenc , ilfbnc
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+
+!===============================================================================
+
+!===================================================================
+! 1) INITIALISATIONS
+!===================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===================================================================
+! 2) DIVERS APPELS
+!===================================================================
+
+! Informations g�om�triques
+! - on r�cup�re les infos de la structure "couplage" en C
+
+ilcesu = idebia
+ilfbsu = ilcesu + ncesup
+ilcecp = ilfbsu + nfbsup
+ilfbcp = ilcecp + ncecpl
+ilcenc = ilfbcp + nfbcpl
+ilfbnc = ilcenc + ncencp
+ifinia = ilfbnc + nfbncp
+
+CALL IASIZE('MEMCS1',IFINIA)
+!==========
+
+ifinra = idebra
+
+return
+end
diff --git a/src/base/memcs2.f90 b/src/base/memcs2.f90
new file mode 100644
index 0000000..7f59a8e
--- /dev/null
+++ b/src/base/memcs2.f90
@@ -0,0 +1,125 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memcs2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ nptcpl , nptdis , nvcpto , &
+ irvcpl , ipndcp , idofcp , &
+ irvdis , ilocpt , icoopt , idjppt , idofpt, ipndpt , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR LE COUPLAGE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+!__________________.____._______________.________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer nptcpl , nptdis , nvcpto , ipndcp
+integer irvcpl , irvdis , ilocpt , icoopt
+integer idjppt , ipndpt , idofcp , idofpt
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+
+!===============================================================================
+
+!===================================================================
+! 1) INITIALISATIONS
+!===================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===================================================================
+! 2) DIVERS APPELS
+!===================================================================
+
+! Informations g�om�triques
+! On r�cup�re les infos de la structure "couplage" en C
+
+ilocpt = idebia
+ifinia = ilocpt + nptdis
+
+icoopt = idebra
+idjppt = icoopt + 3*nptdis
+idofpt = idjppt + 3*nptdis
+ipndpt = idofpt + 3*nptdis
+ifinra = ipndpt + nptdis
+
+idofcp = ifinra
+ipndcp = idofcp + 3*nptcpl
+ifinra = ipndcp + nptcpl
+
+! Informations relatives aux variables � envoyer et/ou recevoir
+
+irvdis = ifinra
+irvcpl = irvdis + nvcpto*nptdis
+ifinra = irvcpl + nvcpto*nptcpl
+
+CALL IASIZE('MEMCS2',IFINIA)
+!==========
+
+CALL RASIZE('MEMCS2',IFINRA)
+!==========
+
+
+return
+end
diff --git a/src/base/memdis.f90 b/src/base/memdis.f90
new file mode 100644
index 0000000..c0c4f31
--- /dev/null
+++ b/src/base/memdis.f90
@@ -0,0 +1,156 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memdis &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviscf , iviscb , idam , ixam , ismbr , irovsd , &
+ irtdp , icoefa , icoefb , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE DISTANCE A LA PAROI
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! iw1,2,...,9 ! e ! --> ! "pointeur" sur w1 a w9 !
+! itimep ! e ! --> ! "pointeur" sur timepa !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer iviscf , iviscb , idam , ixam
+integer ismbr , irovsd
+integer irtdp , icoefa , icoefb
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9
+integer ifinia , ifinra
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+iviscf = idebra
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+ismbr = ixam + nfac*2
+irovsd = ismbr + ncelet
+irtdp = irovsd + ncelet
+icoefa = irtdp + ncelet
+icoefb = icoefa + nfabor
+iw1 = icoefb + nfabor
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMDIS',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memdtv.f90 b/src/base/memdtv.f90
new file mode 100644
index 0000000..1e9227c
--- /dev/null
+++ b/src/base/memdtv.f90
@@ -0,0 +1,160 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memdtv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iviscf , iviscb , idam , icofbd , iw1 , iw2 , iw3 , &
+ icofbr , igrarx , igrary , igrarz , iwcf , &
+ iptlro , ippmcf , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE DTTVAR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam ! e ! --> ! "pointeur" sur dam !
+! icofbd ! e ! --> ! "pointeur" sur cofbdt !
+! iw1 ! e ! --> ! "pointeur" sur w1 !
+! iw2 ! e ! --> ! "pointeur" sur w2 !
+! iw3 ! e ! --> ! "pointeur" sur w3 !
+! igrarx,y,z ! e ! --> ! "pointeurs" sur grarox,y,z (iptlro=1) !
+! iwcf ! e ! --> ! "pointeur" sur wcf !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! e ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! e ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr, ncelbr
+integer nvar , nscal , nphas
+integer iviscf , iviscb , idam , icofbd, icofbr
+integer iw1 , iw2 , iw3
+integer igrarx, igrary, igrarz, iwcf
+integer ifinia , ifinra
+integer iptlro , ippmcf
+
+integer idebia, idebra
+integer iipmcf, iirocf
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+
+! Ceci, pour le compressible, n'est pas tres satisfaisant,
+! mais on se calque sur IPTLRO (certains tableaux n'existent
+! pas toujours)
+
+iipmcf = 0
+if(ippmcf.ge.0) then
+ iipmcf = 1
+endif
+
+iirocf = 0
+if(iptlro.eq.1.or.ippmcf.ge.0) then
+ iirocf = 1
+endif
+
+iviscf = idebra
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+icofbd = idam + ncelet
+iw1 = icofbd + nfabor
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+icofbr = iw3 + ncelet
+igrarx = icofbr + nfabor*iirocf
+igrary = igrarx + ncelet*iirocf
+igrarz = igrary + ncelet*iirocf
+iwcf = igrarz + nfabor*iirocf
+ifinra = igrarz + ncelet*iipmcf
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMDTV',IFINIA)
+!==========
+
+CALL RASIZE('MEMDTV',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memdyp.f90 b/src/base/memdyp.f90
new file mode 100644
index 0000000..5418840
--- /dev/null
+++ b/src/base/memdyp.f90
@@ -0,0 +1,179 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memdyp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idam , ixam , ismbr , irovsd , &
+ irtdp , idrtdp , &
+ iqfx , iqfy , iqfz , icoefq , irho , irhob , &
+ iflua , iflub , &
+ icoax , icobx , icoay , icoby , icoaz , icobz , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE DISTANCE ADIMENSIONNELLE A LA PAROI
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! idrtdp ! e ! --> ! "pointeur" sur drtdp !
+! iqx, y, z ! e ! --> ! "pointeur" sur qx, qy, qz !
+! icoefq ! e ! --> ! "pointeur" sur coefq !
+! irho, irhob ! e ! --> ! "pointeur" sur rho, rho bord !
+! iflua, iflub ! e ! --> ! "pointeur" sur flumas, flumab !
+! icoax,y,z, b ! e ! --> ! "pointeur" sur coefax,y,z, coefbx,y,z !
+! iw1,2,...,9 ! e ! --> ! "pointeur" sur w1 a w9 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idam , ixam , ismbr , irovsd
+integer irtdp , idrtdp
+integer iqfx , iqfy , iqfz , icoefq
+integer irho , irhob
+integer iflua , iflub
+integer icoax , icobx
+integer icoay , icoby
+integer icoaz , icobz
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9
+integer ifinia , ifinra
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+idam = idebra
+ixam = idam + ncelet
+ismbr = ixam + nfac*2
+irovsd = ismbr + ncelet
+irtdp = irovsd + ncelet
+idrtdp = irtdp + ncelet
+iqfx = idrtdp + ncelet
+iqfy = iqfx + ncelet
+iqfz = iqfy + ncelet
+icoefq = iqfz + ncelet
+irho = icoefq + nfabor*ndim
+irhob = irho + ncelet
+iflua = irhob + nfabor
+iflub = iflua + nfac
+icoax = iflub + nfabor
+icobx = icoax + nfabor
+icoay = icobx + nfabor
+icoby = icoay + nfabor
+icoaz = icoby + nfabor
+icobz = icoaz + nfabor
+iw1 = icobz + nfabor
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMDYP',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memini.f90 b/src/base/memini.f90
new file mode 100644
index 0000000..31e69be
--- /dev/null
+++ b/src/base/memini.f90
@@ -0,0 +1,207 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memini &
+!================
+
+ ( longia , longra , &
+ nideve , nrdeve , nituse , nrtuse )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE INITIALE
+! MACROS TABLEAUX, DEVELOPPEUR, UTILISATEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! longia longra ! e ! <-- ! longueur de ia ra !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "entsor.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer longia , longra
+integer nideve , nrdeve , nituse , nrtuse
+
+! VARIABLES LOCALES
+
+integer ii, iok
+integer icoftu(16)
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+! --- Dimension des macros tableaux entier IA et reel RA
+
+longia = 0
+longra = 0
+
+! --- Dimension des tableaux utilisateurs et developpeurs
+! supplementaires (entiers et reels) generalement un multiple
+! de NCEL, NFABOR ...
+
+nideve = 0
+nrdeve = 0
+
+nituse = 0
+nrtuse = 0
+
+do ii = 1, 16
+ icoftu(ii) = 0
+enddo
+
+!===============================================================================
+! 1. MEMOIRE INITIALE POUR UTILISATEUR, DEVELOPPEUR
+!===============================================================================
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call uiusar(icoftu)
+ !==========
+
+ nituse = icoftu(1)*ncelet + icoftu(2)*nfac + icoftu(3)*nfabor &
+ + icoftu(4)
+ nrtuse = icoftu(5)*ncelet + icoftu(6)*nfac + icoftu(7)*nfabor &
+ + icoftu(8)
+ longia = icoftu( 9)*ncelet + icoftu(10)*nfac + icoftu(11)*nfabor&
+ + icoftu(12)
+ longra = icoftu(13)*ncelet + icoftu(14)*nfac + icoftu(15)*nfabor&
+ + icoftu(16)
+
+endif
+
+! - Sous-programme utilisateur
+! ==========================
+
+call ustbtr &
+!==========
+ ( ncel , ncelet , nfac , nfabor , nnod , &
+ longia , longra , &
+ nideve , nituse , nrdeve , nrtuse )
+
+
+!===============================================================================
+! 2. VERIFICATIONS
+!===============================================================================
+
+iok = 0
+
+if (longia.lt.0) then
+ WRITE(NFECRA,1000)'LONGIA',LONGIA
+ iok = iok + 1
+endif
+if (longra.lt.0) then
+ WRITE(NFECRA,1000)'LONGRA',LONGIA
+ iok = iok + 1
+endif
+
+if (nideve.lt.0) then
+ WRITE(NFECRA,1000)'NIDEVE',NIDEVE
+ iok = iok + 1
+endif
+if (nrdeve.lt.0) then
+ WRITE(NFECRA,1000)'NRDEVE',NRDEVE
+ iok = iok + 1
+endif
+if (nituse.lt.0) then
+ WRITE(NFECRA,1000)'NITUSE',NITUSE
+ iok = iok + 1
+endif
+if (nrtuse.lt.0) then
+ WRITE(NFECRA,1000)'NRTUSE',NRTUSE
+ iok = iok + 1
+endif
+
+if (iok.gt.0) call csexit(1)
+ !==========
+
+!===============================================================================
+! 3. DIMENSIONNEMENT MEMOIRE PAR DEFAUT
+!===============================================================================
+
+if (longia.eq.0) then
+ longia = 30 * max(ncelet, nfabor)
+endif
+
+if (longra.eq.0) then
+ longra = 120 * max(ncelet, nfabor)
+endif
+
+!----
+! FORMATS
+!----
+
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER POSITIF OU NUL ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou ustbtr.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/base/memkep.f90 b/src/base/memkep.f90
new file mode 100644
index 0000000..14a8e6e
--- /dev/null
+++ b/src/base/memkep.f90
@@ -0,0 +1,159 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memkep &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , itinsk , itinse , idivu , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE K-EPSILON
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtr ! e ! --> ! "pointeur" sur dtr !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! itinsk, e ! e ! --> ! "pointeur" sur tinstk, tinste !
+! iw1,2,...,9 ! e ! --> ! "pointeur" sur w1 a w9 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idtr
+integer iviscf , iviscb , idam , ixam
+integer idrtp , ismbr , irovsd , itinsk , itinse
+integer idivu
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9
+integer ifinia , ifinra
+
+integer idebia , idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+itinsk = irovsd + ncelet
+itinse = itinsk + ncelet
+idivu = itinse + ncelet
+iw1 = idivu + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMKEP',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memkom.f90 b/src/base/memkom.f90
new file mode 100644
index 0000000..6bac87e
--- /dev/null
+++ b/src/base/memkom.f90
@@ -0,0 +1,159 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memkom &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbrk , ismbrw , itinsk , itinsw , if1 , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE K-OMEGA
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtr ! e ! --> ! "pointeur" sur dtr !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbrk, w ! e ! --> ! "pointeur" sur smbrk, smbrw !
+! itinsk, w ! e ! --> ! "pointeur" sur tinstk, tinstw !
+! if1 ! e ! --> ! "pointeur" sur xf1 !
+! iw1,2,...,9 ! e ! --> ! "pointeur" sur w1 a w9 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idtr
+integer iviscf , iviscb , idam , ixam
+integer idrtp , ismbrk , ismbrw , itinsk , itinsw
+integer if1
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9
+integer ifinia , ifinra
+
+integer idebia , idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbrk = idrtp + ncelet
+ismbrw = ismbrk + ncelet
+itinsk = ismbrw + ncelet
+itinsw = itinsk + ncelet
+if1 = itinsw + ncelet
+iw1 = if1 + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMKW2',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memnav.f90 b/src/base/memnav.f90
new file mode 100644
index 0000000..c1b0ed6
--- /dev/null
+++ b/src/base/memnav.f90
@@ -0,0 +1,204 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memnav &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviscf , iviscb , ivisfi , ivisbi , &
+ idam , ixam , &
+ idrtp , igrdp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , iw10 , idfrcx , ifrchy , idfrhy , &
+ icoefu , iesflm , iesflb , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE NAVIER-STOKES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! ivisfi, bi ! e ! --> ! "pointeur" sur viscfi, viscbi !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! igrdp ! e ! --> ! "pointeur" sur grdp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! iw1,2,...,10 ! e ! --> ! "pointeur" sur w1 a w9 !
+! idfrcx ! e ! --> ! "pointeur" sur dfrcxt !
+! ifrchy ! e ! --> ! "pointeur" sur frchy !
+! idfrhy ! e ! --> ! "pointeur" sur dfrchy !
+!iesflm, iesflb ! e ! --> ! "pointeur" sur esflum et esflub !
+! ifinia ! e ! --> ! pointeur de la premiere case libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere case libre !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer iviscf , iviscb , ivisfi , ivisbi
+integer idam , ixam
+integer idrtp , igrdp , ismbr , irovsd
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9 , iw10
+integer idfrcx , ifrchy , idfrhy
+integer icoefu , iesflm , iesflb
+integer ifinia , ifinra
+
+integer idebia , idebra , iphas, irij
+
+integer iescat
+integer iirnpn
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+irij = 0
+do iphas = 1, nphas
+ if(itytur(iphas).eq.3.and.irijnu(iphas).eq.1) then
+ irij = 1
+ endif
+enddo
+
+iescat = 0
+do iphas = 1, nphas
+ if(iescal(iestot,iphas).gt.0) then
+ iescat = 1
+ endif
+enddo
+
+! Attention :
+! ci-dessous, on fait pointer VISCFI et VISCBI
+! sur VISCF et VISCB respectivement
+! dans les cas ou ils sont identiques.
+
+! Pour la norme de resolp
+iirnpn = 0
+if(irnpnw.eq.1) iirnpn = 1
+
+ivisfi = idebra
+iviscf = ivisfi + nfac *irij
+ivisbi = iviscf + nfac
+iviscb = ivisbi + nfabor*irij
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+igrdp = idrtp + ncelet
+ismbr = igrdp + ncelet*3
+irovsd = ismbr + ncelet
+iw1 = irovsd + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+iw10 = iw9 + ncelet
+idfrcx = iw10 + ncelet*iirnpn
+ifrchy = idfrcx + ncelet*3*nphas*iphydr
+idfrhy = ifrchy + ncelet*ndim*icalhy
+icoefu = idfrhy + ncelet*ndim*icalhy
+iesflm = icoefu + nfabor*ndim
+iesflb = iesflm + nfac*iescat
+ifinra = iesflb + nfabor*iescat
+
+! Dans une phase d'optimisation memoire, on pourra faire pointer
+! esflum et esflub sur fluint et flubrd dans le cas (rare)
+! avec estimateur total et reconstruction par moindres carres
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMNAV',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/mempdc.f90 b/src/base/mempdc.f90
new file mode 100644
index 0000000..9fa1cb6
--- /dev/null
+++ b/src/base/mempdc.f90
@@ -0,0 +1,213 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mempdc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , nphas , ndim , ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE TABLEAU PDC : CKUPDC
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nphas ! e ! <-- ! nombre de phases !
+! ndim ! e ! <-- ! dimension de l'espace (3) !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "numvar.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+!===============================================================================
+
+
+integer idbia0 ,idbra0
+integer ncelet , ncel , nphas, ndim
+integer ifinia , ifinra
+
+integer idebia, idebra, iok, iok1, iphas
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> VERIFICATION DES DIMENSIONS
+
+iok1 = 0
+do iphas = 1, nphas
+
+ iok = 0
+ if(ncepdc(iphas).gt.ncelet .or. ncepdc(iphas).lt.0) then
+ iok = 1
+ endif
+ if(iok.ne.0) then
+ write(nfecra,1000) iphas, ncepdc(iphas)
+ iok1 = 1
+ endif
+enddo
+
+if(iok1.ne.0) then
+ call csexit (1)
+endif
+
+!---> CALCUL DU NOMBRE DE CELLULES AVEC PDC TOTAL
+
+do iphas = 1, nphas
+ ncpdct(iphas) = ncepdc(iphas)
+enddo
+if (irangp.ge.0) then
+ call parism(nphas,ncpdct)
+endif
+
+!---> QUELQUES MESSAGES
+
+do iphas = 1, nphas
+ if(ncpdct(iphas).eq.0) then
+ write(nfecra,2000) iphas, ncpdct(iphas)
+ write(nfecra,3000)
+ else
+ write(nfecra,2001) iphas, ncpdct(iphas)
+ write(nfecra,3000)
+ endif
+enddo
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+ifinra = idebra
+
+do iphas = 1, nphas
+
+ iicepd(iphas) = ifinia
+ ifinia = iicepd(iphas) + ncepdc(iphas)
+
+ ickupd(iphas) = ifinra
+ ifinra = ickupd(iphas) + ncepdc(iphas)*6
+
+enddo
+
+! Si pour une des phases on a des pertes de charge
+! sur un des processeurs
+! et que les tableaux TPUCOU n'ont pas encore ete definis (IPUCOU=0)
+! il faut les dimensionner
+if (ipucou.eq.0) then
+ iok=0
+ do iphas = 1, nphas
+ if (ncpdct(iphas).gt.0) iok = 1
+ enddo
+ if (iok.eq.1) then
+ itpuco = ifinra
+ ifinra = itpuco + ncelet *ndim
+ endif
+endif
+
+
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMPDC',IFINIA)
+! ==========
+
+CALL RASIZE('MEMPDC',IFINRA)
+! ==========
+
+!---> FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' SORTIE DANS MEMPDC CAR LES DIMENSIONS DES TABLEAUX ',/,&
+ ' RELATIFS AUX PERTES DE CHARGES SONT INCORRECTES ',/, &
+ ' PHASE ',I10,/, &
+ ' NCEPDC = ',I10)
+
+ 2000 format(/, &
+ 'PHASE ',I6,' : TRAITEMENT DES PERTES DE CHARGES NON ACTIVE ',/, &
+ ' NCEPDC = ',I10,/)
+ 2001 format( &
+ /,/, &
+ 'PHASE ',I6,' : TRAITEMENT DES PERTES DE CHARGES ACTIVE ',/, &
+ ' SUR UN TOTAL DE NCEPDC = ',I10,' CELLULES',/)
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+
+#else
+
+ 1000 format(/,' ABORT IN MEMPDC BECAUSE THE DIMENSION OF THE ARRAYS',/,&
+ ' RELATIVE TO THE HEAD LOSS IS INCORRECT ',/, &
+ ' PHASE ',I10,/, &
+ ' NCEPDC = ',I10)
+
+ 2000 format( &
+ /,'PHASE ',I6,' : HEAD LOSS TREATMENT NOT ACTIVATED ',/, &
+ ' NCEPDC = ',I10,/)
+ 2001 format( &
+ /,'PHASE ',I6,' : HEAD LOSS TERMS TREATMENT ACTIVATED ',/, &
+ ' ON A TOTAL OF NCEPDC = ',I10,' CELLS',/)
+
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+
+#endif
+
+return
+end
diff --git a/src/base/memphy.f90 b/src/base/memphy.f90
new file mode 100644
index 0000000..5d61d7e
--- /dev/null
+++ b/src/base/memphy.f90
@@ -0,0 +1,154 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memphy &
+!================
+
+ ( idbia0 , idbra0 , &
+ nvar , ncelet , ncel , nfac , nfabor , nphas , &
+ iw1 , iw2 , iw3 , iw4 , &
+ iw5 , iw6 , iw7 , iw8 , &
+ iw9 , iw10 , iw11 , iw12 , ixmij , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE CALCUL DES PROPRIETES PHYSIQUES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nphas ! e ! <-- ! nombre de phases !
+! nvar ! e ! <-- ! nombre de variables !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! iw1,2,3,4,5,6 ! e ! --> ! "pointeur" sur w1,2,3,4,5,6,7,8,9,10,11,12 !
+! ixmij ! e ! --> ! "pointeur" sur xmij !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+
+!===============================================================================
+
+
+integer idbia0 ,idbra0
+integer nvar
+integer ncelet , ncel , nfac , nfabor, nphas
+integer iw1 , iw2 , iw3 , iw4
+integer iw5 , iw6 , iw7 , iw8
+integer iw9 , iw10 , iw11 , iw12 , ixmij
+integer ifinia , ifinra
+
+integer idebia , idebra
+integer imemph , iphas
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+
+iw1 = idebra
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+
+imemph = 0
+do iphas =1, nphas
+ if(iturb(iphas).eq.41) imemph = 1
+enddo
+do iphas =1, nphas
+ if(iturb(iphas).eq.42) imemph = 2
+enddo
+
+if(imemph.eq.1) then
+ iw10 = iw9 + ncelet
+ iw11 = iw10 ! w11 is not used
+ iw12 = iw11 ! w12 is not used
+ ixmij = iw12 + ncelet
+ ifinra = ixmij+ 6*ncelet
+else if(imemph.eq.2) then
+ iw10 = iw9 + ncelet
+ iw11 = iw10 + ncelet
+ iw12 = iw11 + ncelet
+ ixmij = iw12 + ncelet
+ ifinra = ixmij ! xmij is not used
+else
+ iw10 = iw9
+ iw11 = iw10
+ iw12 = iw11
+ ixmij = iw12
+ ifinra = ixmij
+endif
+
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMPHY',IFINIA)
+!==========
+
+CALL RASIZE('MEMPHY',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memrij.f90 b/src/base/memrij.f90
new file mode 100644
index 0000000..7d174b2
--- /dev/null
+++ b/src/base/memrij.f90
@@ -0,0 +1,196 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memrij &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iturbp , &
+ idtr , iviscf , iviscb , icoefx , &
+ idam , ixam , idrtp , &
+ ismbr , irovsd , igrdvt , iprodu , igrarx , igrary , igrarz , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE RIJ-EPSILON
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtr ! e ! --> ! "pointeur" sur dtr !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! icoefx ! e ! --> ! "pointeur" sur coefax !
+! ! tr ! --- ! attention : uniquement avec echo !
+! ! tr ! --- ! de paroi et abs(icdpar) = 1 !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! igrdvt ! e ! --> ! "pointeur" sur grdvit !
+! iprodu ! e ! --> ! "pointeur" sur produc !
+! igrarx,y,z ! e ! --> ! "pointeur" sur grarox, y, z !
+! iw1,2,...,9 ! e ! --> ! "pointeur" sur w1 a w9 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iturbp
+
+integer idtr
+integer iviscf , iviscb , icoefx
+integer idam , ixam
+integer idrtp , ismbr , irovsd , igrdvt , iprodu
+integer igrarx , igrary , igrarz
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9
+integer ifinia , ifinra
+
+integer idebia, idebra, jgrari, icobx
+integer iphas
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+jgrari = 0
+do iphas = 1, nphas
+ if(igrari(iphas).eq.1) then
+ jgrari = 1
+ endif
+enddo
+
+
+icobx = 0
+if(abs(icdpar).eq.1) then
+ do iphas = 1, nphas
+ if(irijec(iphas).eq.1) then
+ icobx = 1
+ endif
+ enddo
+endif
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+icoefx = iviscb + nfabor
+idam = icoefx + nfabor*icobx
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+! suivant qu'on est en ITURB=30 ou 31 on
+! reserve PRODUC ou GRDVIT
+igrdvt = irovsd + ncelet
+iprodu = igrdvt
+if (iturbp.eq.30) then
+ igrarx = iprodu + ncelet*6
+else
+ igrarx = igrdvt + ncelet*9
+endif
+igrary = igrarx + ncelet*jgrari
+igrarz = igrary + ncelet*jgrari
+iw1 = igrarz + ncelet*jgrari
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMRIJ',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memsca.f90 b/src/base/memsca.f90
new file mode 100644
index 0000000..9763a3f
--- /dev/null
+++ b/src/base/memsca.f90
@@ -0,0 +1,155 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memsca &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE SCALAIRES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtr ! e ! --> ! "pointeur" sur dtr !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! iw1,2,...,9 ! e ! --> ! "pointeur" sur w1 a w9 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idtr
+integer iviscf , iviscb , idam , ixam
+integer idrtp , ismbr , irovsd
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9
+integer ifinia , ifinra
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+iw1 = irovsd + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMSCA',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memt1d.f90 b/src/base/memt1d.f90
new file mode 100644
index 0000000..d5d077f
--- /dev/null
+++ b/src/base/memt1d.f90
@@ -0,0 +1,231 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memt1d &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfabor , ifnia1 , ifnra1 , ifnia2 , ifnra2 , &
+ ifinia , ifinra , ia , ra )
+
+!===============================================================================
+
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR LE MODULE THERMIQUE 1D EN PAROI
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ifnia1 ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia apres liberation tout sauf !
+! ! ! ! ifpt1d !
+! ifnra1 e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ra apres liberation tout sauf !
+! ! ! ! tppt1d !
+! ifnia2 ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia apres liberation de nppt1d !
+! ifnra2 e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ra apres liberation de rgpt1d !
+! ! ! ! et eppt1d !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "optcal.h"
+include "numvar.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+!===============================================================================
+
+! Arguments
+integer idbia0 ,idbra0
+integer nfabor
+integer ifinia, ifinra, ifnia1, ifnra1, ifnia2, ifnra2
+integer ia(*)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iok1, ifac
+
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> VERIFICATION DES DIMENSIONS
+
+iok1 = 0
+if(nfpt1d.gt.nfabor .or. nfpt1d.lt.0) then
+ write(nfecra,1000) nfpt1d
+ iok1 = 1
+endif
+if(iok1.ne.0) then
+ call csexit (1)
+endif
+
+!---> CALCUL DU NOMBRE DE FACES DE PAROI AVEC MODULE 1D TOTAL
+
+nfpt1t = nfpt1d
+
+if (irangp.ge.0) then
+ call parcpt(nfpt1t)
+endif
+
+!---> QUELQUES MESSAGES
+
+if(nfpt1t.eq.0) then
+ write(nfecra,2000) nfpt1t
+else
+ write(nfecra,2001) nfpt1t, nfpt1d
+endif
+write(nfecra,3000)
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+ifinra = idebra
+
+
+iifpt1 = ifinia
+ifnia1 = iifpt1 + nfpt1d
+iiclt1 = ifnia1
+ifnia2 = iiclt1 + nfpt1d
+inppt1 = ifnia2
+ifinia = inppt1 + nfpt1d
+
+itppt1 = ifinra
+ifnra1 = itppt1 + nfpt1d
+itept1 = ifnra1
+ihept1 = itept1 + nfpt1d
+ifept1 = ihept1 + nfpt1d
+ixlmt1 = ifept1 + nfpt1d
+ircpt1 = ixlmt1 + nfpt1d
+idtpt1 = ircpt1 + nfpt1d
+ifnra2 = idtpt1 + nfpt1d
+ieppt1 = ifnra2
+irgpt1 = ieppt1 + nfpt1d
+ifinra = irgpt1 + nfpt1d
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMT1D',IFINIA)
+! ==========
+
+CALL RASIZE('MEMT1D',IFINRA)
+! ==========
+
+!---> INITIALISATION DES TABLEAUX
+! a des valeurs sortant en erreur dans vert1d
+! sauf pour les variables de conditions aux limites
+! qui sont initialisees a des valeurs standard
+! (flux nul, Timpose=0, coef d'echange infini)
+do ifac = 1, nfpt1d
+ ia(iifpt1+ifac-1) = -999
+ ia(inppt1+ifac-1) = -999
+ ia(iiclt1+ifac-1) = 3
+ ra(ieppt1+ifac-1) = -999.d0
+ ra(irgpt1+ifac-1) = -999.d0
+ ra(itppt1+ifac-1) = 0.d0
+ ra(itept1+ifac-1) = 0.d0
+ ra(ihept1+ifac-1) = rinfin
+ ra(ifept1+ifac-1) = 0.d0
+ ra(ixlmt1+ifac-1) = -999.d0
+ ra(ircpt1+ifac-1) = -999.d0
+ ra(idtpt1+ifac-1) = -999.d0
+enddo
+
+!---> FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' SORTIE DANS MEMT1D CAR LA DIMENSIONS DU TABLEAU ',/, &
+ ' RELATIF AUX FACES DE BORD COUPLEES AU MODULE ',/, &
+ ' THERMIQUE 1D DE PAROI EST INCORRECTE ',/, &
+ ' NFPT1D = ',I10)
+
+ 2000 format( &
+ /,'TTES PHASES : MODULE THERMIQUE 1D DE PAROI NON ACTIVE ',/,&
+ ' NFPT1D = ',I10,/)
+ 2001 format( &
+ /,'TTES PHASES : MODULE THERMIQUE 1D EN PAROI ACTIVE ',/,&
+ ' SUR UN TOTAL DE ',I10,' FACES DE BORD',/, &
+ ' (',I10,' FACES DE BORD EN LOCAL)',/)
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+
+#else
+
+ 1000 format(/,' ABORT IN MEMT1D BECAUSE THE DIMENSION OF THE ARRAY ',/,&
+ ' RELATIVE TO THE COUPLED FACES OF THE 1D-WALL ',/, &
+ ' THERMAL MODULE IS INCORRECT ',/, &
+ ' NFPT1D = ',I10)
+
+ 2000 format( &
+ /,'ALL PHASES : 1D-WALL THERMAL MODULE NOT ACTIVATED ',/, &
+ ' NFPT1D = ',I10,/)
+ 2001 format( &
+ /,'ALL PHASES : 1D-WALL THERMAL MODULE ACTIVATED ',/, &
+ ' ON A TOTAL OF ',I10,' BOUNDARY FACES',/, &
+ ' (',I10,' LOCAL BOUNDARY FACES)',/)
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+
+#endif
+
+return
+end
diff --git a/src/base/memtri.f90 b/src/base/memtri.f90
new file mode 100644
index 0000000..4b4a318
--- /dev/null
+++ b/src/base/memtri.f90
@@ -0,0 +1,530 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memtri &
+!================
+
+ ( idbia0 , idbra0 , iverif , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncofab , nproce , nprofa , nprofb , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iisstd , ifrcx , &
+ idt , irtp , irtpa , ipropc , ipropf , ipropb , &
+ icoefa , icoefb , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE VARIABLES NON GEOMETRIQUES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! iverif ! e ! <-- ! indicateur des tests elementaires !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncofab ! e ! <-- ! nombre de couple de cl a prevoir !
+! nproce ! e ! <-- ! nombre de prop phy aux centres !
+! nprofa ! e ! <-- ! nombre de prop phy aux faces internes !
+! nprofb ! e ! <-- ! nombre de prop phy aux faces de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iisstd ! e ! --> ! "pointeur" sur isostd(reperage sortie !
+! idt ! e ! --> ! "pointeur" sur dt !
+! irtp, irtpa ! e ! --> ! "pointeur" sur rtp, rtpa !
+! ipropc ! e ! --> ! "pointeur" sur propce !
+! ipropf ! e ! --> ! "pointeur" sur propfa !
+! ipropb ! e ! --> ! "pointeur" sur propfb !
+! icoefa, b ! e ! --> ! "pointeur" sur coefa, coefb !
+! ifrcx ! e ! --> ! "pointeur" sur frcxt !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "optcal.h"
+include "cstphy.h"
+include "numvar.h"
+include "entsor.h"
+include "pointe.h"
+include "albase.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cfpoin.h"
+include "lagpar.h"
+include "lagdim.h"
+include "lagran.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer iverif
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncofab , nproce , nprofa , nprofb
+integer nideve , nrdeve , nituse , nrtuse
+integer iisstd , ifrcx
+integer idt
+integer irtp , irtpa
+integer ipropc , ipropf , ipropb
+integer icoefa , icoefb
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iis, iphas, ippu, ippv, ippw, ivar, iprop
+integer iipero , iiirij , imom, idtnm
+integer idpar1 , idpar2 , iypar1, iiyplb, iiforb, iicoci
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+
+idebia = idbia0
+idebra = idbra0
+
+
+
+
+
+!===============================================================================
+! 2. PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+!===============================================================================
+
+! --> Remarques :
+
+! IPUCOU = 1 ne depend pas de la phase
+
+! NCOFAB, NPROCE, NPROFA et NPROFB ont ete determines dans VARPOS
+! et ne servent en tant que dimensions que dans le present
+! sous programme. On pourrait les passer en common dans numvar.h
+
+! ITYPFB, ITRIFB et ISYMPA peuvent passer en entier dans certains
+! sous-pgm, il convient donc qu'ils soient en un seul bloc.
+! Le meilleur moyen de s'en assurer est de referencer ce bloc par un
+! pointeur unique independant de iphas.
+
+! Le tableau des zones frontieres des faces de bord pour les
+! physiques particulieres est de declare ci-dessous (voir PPCLIM)
+
+
+! --> Preparations :
+
+! On regarde s'il existe au moins une periodicite de rotation
+! une phase avec Rij
+
+iipero = 0
+if (iperot.gt.0) then
+ iipero = 1
+endif
+iiirij = 0
+do iphas = 1, nphas
+ if(itytur(iphas).eq.3) then
+ iiirij = 1
+ endif
+enddo
+
+
+! Distance a la paroi
+
+! On reserve ici idipar (distance a la paroi) : c'est oblige
+! On reserve aussi iyppar (yplus) : on pourrait s'en passer
+! et en faire un tableau local a reserver dans memdyp
+! mais ca facilite la visualisation et l'initialisation
+! de yplus pour son calcul a tous les pas de temps
+
+! Distance a la paroi, tableau selon le mode de calcul
+idpar1 = 0
+idpar2 = 0
+! Calcul par eq de diffusion
+if(ineedy.eq.1.and.abs(icdpar).eq.1) then
+ idpar1 = 1
+endif
+! Calcul direct
+if(ineedy.eq.1.and.abs(icdpar).eq.2) then
+ idpar2 = 1
+endif
+! Yplus associe (calcul par mode de diffusion et LES+VanDriest
+! ou lagrangien+IROULE=2)
+iypar1 = 0
+if(ineedy.eq.1.and.abs(icdpar).eq.1) then
+ do iphas = 1, nphas
+ if(itytur(iphas).eq.4) then
+ if(idries(iphas).eq.1) then
+ iypar1 = 1
+ endif
+ endif
+ enddo
+ if (iilagr.ge.1 .and. iroule.eq.2) iypar1 = 1
+endif
+
+! Stockage suppl�mentaire si on initialise le gradient
+! par moindre carre
+
+iicoci = 0
+if(imrgra.eq.4 .or. iverif.eq.1) then
+ iicoci = 1
+endif
+
+
+! Post-traitements particuliers (faces de bord)
+
+
+iiyplb = 0
+! Yplus au bord
+if(mod(ipstdv,ipstyp).eq.0) then
+ iiyplb = 1
+endif
+! Efforts aux bords
+iiforb = 0
+if(ineedf.eq.1) then
+ iiforb = 1
+endif
+
+
+! --> Reservation de memoire entiere
+
+
+iitypf = idebia
+iitrif = iitypf + nfabor *nphas
+iisymp = iitrif + nfabor *nphas
+ifinia = iisymp + nfabor *nphas
+do iphas = 1, nphas
+ if(idpar2.eq.1) then
+ iifapa(iphas) = ifinia
+ ifinia = iifapa(iphas) + ncelet
+ else
+! cette valeur nulle est utilisee dans les tests
+ iifapa(iphas) = 0
+ endif
+enddo
+
+! Zones de face de bord : on utilise provisoirement les zones des physiques
+! particulieres, meme sans physique particuliere
+! -> sera modifie lors de la restructuration des zones de bord
+iizfpp = ifinia
+if(ippmod(iphpar).ge.1 .or. iihmpr.eq.1) then
+ ifinia = iizfpp + nfabor
+else
+ ifinia = iizfpp
+endif
+
+iisstd = ifinia
+ifinia = iisstd + (nfabor+1)*nphas*iphydr
+
+if(ippmod(icompf).ge.0) then
+ iifbet = ifinia
+ iifbru = iifbet + nfabor*nphas
+ ifinia = iifbru + nfabor*nphas
+else
+ iifbet = 0
+ iifbru = 0
+endif
+
+! --> Reservation de memoire reelle
+
+icoefa = idebra
+icoefb = icoefa + ndimfb *ncofab
+irtp = icoefb + ndimfb *ncofab
+irtpa = irtp + ncelet *nvar
+ipropc = irtpa + ncelet *nvar
+ipropf = ipropc + ncelet *nproce
+ipropb = ipropf + nfac *nprofa
+idt = ipropb + ndimfb *nprofb
+icocg = idt + ncelet
+icocgb = icocg + ncelet *9
+icoci = icocgb + ncelbr *9
+icocib = icoci + ncelet *9 * iicoci
+itpuco = icocib + ncelbr *9 * iicoci
+idipar = itpuco + ncelet *ndim*ipucou
+iyppar = idipar + ncelet *idpar1
+idudxy = iyppar + ncelet *iypar1
+iwdudx = idudxy + (ncelet-ncel) * 3 * 3 * nphas * iipero
+idrdxy = iwdudx + (ncelet-ncel) * 3 * 3 * nphas * iipero
+iwdrdx = idrdxy + (ncelet-ncel) * 6 * 3 * nphas * iipero*iiirij
+ifrcx = iwdrdx + (ncelet-ncel) * 6 * 3 * nphas * iipero*iiirij
+iyplbr = ifrcx + ncelet*ndim*nphas*iphydr
+iforbr = iyplbr + nfabor*nphas*iiyplb
+ifinra = iforbr + nfabor*ndim*iiforb
+
+! On rajoute des tableaux pour le k-omega SST si necessaire
+! En k-omega, on a besoin de calculer 2 Sij.Sij pour etre utilise
+! dans PHYVAR et dans TURBKW. On reserve un tableau pour divU en meme temps.
+! Les pointeurs IS2KW et IDVUKW sont fonction de IPHAS
+
+do iphas = 1, nphas
+ is2kw(iphas) = ifinra
+ idvukw(iphas) = ifinra
+ if (iturb(iphas).eq.60) then
+ idvukw(iphas) = is2kw(iphas) + ncelet
+ ifinra = idvukw(iphas) + ncelet
+ endif
+enddo
+
+! En ALE, on reserve des tableaux supplementaires de position initiale
+! et de deplacement et le type de faces de bord
+if (iale.eq.1) then
+ iimpal = ifinia
+ iialty = iimpal + nnod
+ ifinia = iialty + nfabor
+
+ ixyzn0 = ifinra
+ idepal = ixyzn0 + ndim*nnod
+ ifinra = idepal + ndim*nnod
+else
+ iimpal = 0
+ iialty = 0
+ ixyzn0 = 0
+ idepal = 0
+endif
+
+! --> Verification
+
+CALL IASIZE('MEMTRI',IFINIA)
+! ==========
+
+CALL RASIZE('MEMTRI',IFINRA)
+! ==========
+
+
+!===============================================================================
+! 3. CORRESPONDANCE POUR POST-TRAITEMENT
+!===============================================================================
+
+! --> Correspondance IPP2RA pour post-process
+! Variables de calcul et proprietes physiques
+
+do iis = 1 , nvppmx
+ ipp2ra(iis) = 1
+enddo
+
+! IPPROC a ete complete au prealable dans VARPOS
+
+do iphas = 1, nphas
+
+ ivar = ipr (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iu (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iv (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iw (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+
+ if (itytur(iphas).eq.2) then
+ ivar = ik (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iep (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ elseif(itytur(iphas).eq.3) then
+ ivar = ir11 (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = ir22 (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = ir33 (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = ir12 (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = ir13 (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = ir23 (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iep (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ elseif(iturb(iphas).eq.50) then
+ ivar = ik (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iep (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iphi (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = ifb (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ elseif(iturb(iphas).eq.60) then
+ ivar = ik (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iomg (iphas)
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ endif
+
+enddo
+
+if (iale.eq.1) then
+ ivar = iuma
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = ivma
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+ ivar = iwma
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+endif
+
+! Le choix fait dans VARPOS indique qu'on ne s'interessera
+! qu'aux proprietes au centre des cellules (pas au flux
+! de masse en particulier, ni a la masse volumique au bord)
+
+do iprop = 1, nproce
+ ipp2ra(ipppro(iprop)) = ipropc+(iprop-1)*ncelet
+enddo
+
+! Pour les moments, on repere dans IPPMOM le mode de division par le temps
+! = 0 : pas de division
+! > 0 : IPPMOM donne le pointeur dans RA sur le DT cumule
+! (tableau NCEL dans PROPCE)
+! < 0 : IPPMOM donne le rang dans DTCMOM du DT cumule (uniforme)
+do iprop = 1, nvppmx
+ ippmom(iprop) = 0
+enddo
+do imom = 1, nbmomt
+! Pointeur iprop des moments pour IPP2RA(IPPPRO(IPROP)) et IPPMOM(IPPPRO(IPROP))
+ iprop = ipproc(icmome(imom))
+! Type de DT cumule et numero
+ idtnm = idtmom(imom)
+ if(idtnm.gt.0) then
+ ippmom(ipppro(iprop)) = &
+ ipropc+(ipproc(icdtmo(idtnm))-1)*ncelet
+ elseif(idtnm.lt.0) then
+ ippmom(ipppro(iprop)) = idtnm
+ endif
+enddo
+
+do iis = 1 , nscal
+ ivar = isca (iis )
+ ipp2ra(ipprtp(ivar)) = irtp +(ivar-1)*ncelet
+enddo
+
+ipp2ra(ippdt ) = idt
+
+! Couplage instationnaire vitesse/pression
+if (ipucou.eq.0) then
+ ipp2ra(ipptx)= 1
+ ipp2ra(ippty)= 1
+ ipp2ra(ipptz)= 1
+else
+ ipp2ra(ipptx)= itpuco
+ ipp2ra(ippty)= itpuco+ncelet
+ ipp2ra(ipptz)= itpuco+2*ncelet
+endif
+
+! Vecteur vitesse chrono
+do iphas = 1, nphas
+ ippu = ipprtp(iu(iphas))
+ ippv = ipprtp(iv(iphas))
+ ippw = ipprtp(iw(iphas))
+ if(ichrvr(ippu).eq.1.and.ichrvr(ippv).eq.1.and. &
+ ichrvr(ippw).eq.1) then
+ ichrvr(ippv) = 0
+ ichrvr(ippw) = 0
+ ipp2ra(ippu) = - ipp2ra(ippu)
+ endif
+enddo
+! Vecteur vitesse de maillage chrono
+if (iale.eq.1) then
+ ippu = ipprtp(iuma)
+ ippv = ipprtp(ivma)
+ ippw = ipprtp(iwma)
+ if(ichrvr(ippu).eq.1.and.ichrvr(ippv).eq.1.and. &
+ ichrvr(ippw).eq.1) then
+ ichrvr(ippv) = 0
+ ichrvr(ippw) = 0
+ ipp2ra(ippu) = - ipp2ra(ippu)
+ endif
+endif
+! Potentiel vecteur chrono
+if(ippmod(ielarc).ge.2) then
+ ippu = ipprtp(isca(ipotva(1)))
+ ippv = ipprtp(isca(ipotva(2)))
+ ippw = ipprtp(isca(ipotva(3)))
+ if(ichrvr(ippu).eq.1.and.ichrvr(ippv).eq.1.and. &
+ ichrvr(ippw).eq.1) then
+ ichrvr(ippv) = 0
+ ichrvr(ippw) = 0
+ ipp2ra(ippu) = - ipp2ra(ippu)
+ endif
+endif
+! Laplace vecteur chrono
+if(ippmod(ielarc).ge.1) then
+ ippu = ipppro(ipproc(ilapla(1)))
+ ippv = ipppro(ipproc(ilapla(2)))
+ ippw = ipppro(ipproc(ilapla(3)))
+ if(ichrvr(ippu).eq.1.and.ichrvr(ippv).eq.1.and. &
+ ichrvr(ippw).eq.1) then
+ ichrvr(ippv) = 0
+ ichrvr(ippw) = 0
+ ipp2ra(ippu) = - ipp2ra(ippu)
+ endif
+endif
+
+return
+end
diff --git a/src/base/memtsm.f90 b/src/base/memtsm.f90
new file mode 100644
index 0000000..4dd4fc0
--- /dev/null
+++ b/src/base/memtsm.f90
@@ -0,0 +1,195 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memtsm &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , nvar , nphas , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR LES TERMES SOURCES DE MASSE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nvar ! e ! <-- ! nombre de variables !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nphas ! e ! <-- ! nombre de phases !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "numvar.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+
+!===============================================================================
+
+
+integer idbia0 ,idbra0
+integer ncelet , ncel ,nvar , nphas
+integer ifinia , ifinra
+
+integer idebia, idebra, iok1, iphas
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+
+!---> VERIFICATION DES DIMENSIONS
+
+iok1 = 0
+do iphas = 1, nphas
+ if(ncetsm(iphas).gt.ncelet .or. ncetsm(iphas).lt.0) then
+ write(nfecra,1000) iphas, ncetsm(iphas)
+ iok1 = 1
+ endif
+enddo
+if(iok1.ne.0) then
+ call csexit (1)
+endif
+
+!---> CALCUL DU NOMBRE DE CELLULES AVEC TSM TOTAL
+
+do iphas = 1, nphas
+ nctsmt(iphas) = ncetsm(iphas)
+enddo
+if (irangp.ge.0) then
+ call parism(nphas,nctsmt)
+endif
+
+!---> QUELQUES MESSAGES
+
+do iphas = 1, nphas
+ if(nctsmt(iphas).eq.0) then
+ write(nfecra,2000) iphas, nctsmt(iphas)
+ write(nfecra,3000)
+ else
+ write(nfecra,2001) iphas, nctsmt(iphas)
+ write(nfecra,3000)
+ endif
+enddo
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+ifinra = idebra
+
+do iphas = 1, nphas
+
+ iicesm(iphas) = ifinia
+ iitpsm(iphas) = iicesm(iphas) + ncetsm(iphas)
+ ifinia = iitpsm(iphas) + ncetsm(iphas)*nvar
+
+ ismace(iphas) = ifinra
+ ifinra = ismace(iphas) + ncetsm(iphas)*nvar
+
+enddo
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMTSM',IFINIA)
+! ==========
+
+CALL RASIZE('MEMTSM',IFINRA)
+! ==========
+
+!---> FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' SORTIE DANS MEMTSM CAR LA DIMENSIONS DU TABLEAU ',/, &
+ ' RELATIF AUX SOURCES DE MASSE EST INCORRECTE ',/, &
+ ' PHASE ',I10,/, &
+ ' NCETSM = ',I10)
+
+ 2000 format( &
+ /,'PHASE ',I6,' : TRAITEMENT DES SOURCES DE MASSE NON ACTIVE ',/,&
+ ' NCETSM = ',I10,/)
+ 2001 format( &
+ /,'PHASE ',I6,' : TRAITEMENT DES SOURCES DE MASSE ACTIVE ',/, &
+ ' SUR UN TOTAL DE ',I10,' CELLULES')
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+
+#else
+
+ 1000 format(/,' ABORT IN MEMTSM BECAUSE THE DIMENSION OF THE ARRAY ',/,&
+ ' RELATIVE TO THE MASS SOURCE TERMS IS INCORRECT ',/, &
+ ' PHASE ',I10,/, &
+ ' NCETSM = ',I10)
+
+ 2000 format( &
+ /,'PHASE ',I6,' : MASS SOURCE TERMS TREATMENT NOT ACTIVATED ',/, &
+ ' NCETSM = ',I10,/)
+ 2001 format( &
+ /,'PHASE ',I6,' : MASS SOURCE TERMS TREATMENT ACTIVATED ',/, &
+ ' ON A TOTAL OF ',I10,' CELLS')
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+
+#endif
+
+return
+end
diff --git a/src/base/memv2f.f90 b/src/base/memv2f.f90
new file mode 100644
index 0000000..fe51b62
--- /dev/null
+++ b/src/base/memv2f.f90
@@ -0,0 +1,159 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memv2f &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , &
+ idam , ixam , idrtp , &
+ ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , iw10 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE V2F PHI-MODEL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtr ! e ! --> ! "pointeur" sur dtr !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! iw1,2,...,10 ! e ! --> ! "pointeur" sur w1 a w10 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idtr
+integer iviscf , iviscb
+integer idam , ixam
+integer idrtp , ismbr , irovsd
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9 , iw10
+integer ifinia , ifinra
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+iw1 = irovsd + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+iw10 = iw9 + ncelet
+ifinra = iw10 + ncelet
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMV2F',IFINRA)
+!==========
+
+return
+end
diff --git a/src/base/memvor.f90 b/src/base/memvor.f90
new file mode 100644
index 0000000..7d3d7f8
--- /dev/null
+++ b/src/base/memvor.f90
@@ -0,0 +1,136 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memvor &
+!================
+
+ ( idbia0 , idbra0 , iappel , nfabor , ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR LA METHODE DES VORTEX
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._______________.________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0, ifinia, ifinra
+integer iappel, nfabor
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+idebia = idbia0
+idebra = idbra0
+
+if(iappel.eq.1) then
+
+ iirepv = idebia
+ ifinia = iirepv + nfabor
+
+ ifinra = idebra
+
+ CALL IASIZE('MEMVOR',IFINIA)
+
+elseif(iappel.eq.2) then
+
+ iifagl = idebia
+ ifinia = iifagl + nnent*icvmax
+
+ ixyzv = idebra
+ ivisv = ixyzv + nnent*icvmax*3
+ iw1x = ivisv + nnent*icvmax
+ iw1y = iw1x + nnent*icvmax
+ iw1z = iw1y + nnent*icvmax
+ iw1v = iw1z + nnent*icvmax
+ iw2x = iw1v + nnent*icvmax
+ iw2y = iw2x + nnent*icvmax
+ iw2z = iw2y + nnent*icvmax
+ iw2v = iw2z + nnent*icvmax
+ ifinra = iw2v + nnent*icvmax
+
+ CALL IASIZE('MEMVOR',IFINIA)
+ CALL RASIZE('MEMVOR',IFINRA)
+
+elseif(iappel.eq.3) then
+
+ iivrce = idebia
+ ifinia = iivrce + nnent*nvomax
+
+ iyzcel = idebra
+ iuvort = iyzcel + nnent*icvmax*2
+ ivvort = iuvort + nnent*icvmax
+ iwvort = ivvort + nnent*icvmax
+ iyzvor = iwvort + nnent*icvmax
+ iyzvoa = iyzvor + nnent*nvomax*2
+ isignv = iyzvoa + nnent*nvomax*2
+ ixsigm = isignv + nnent*nvomax
+ ixgamm = ixsigm + nnent*nvomax
+ ixtmp = ixgamm + nnent*nvomax*2
+ ixtmpl = ixtmp + nnent*nvomax
+ ifinra = ixtmpl + nnent*nvomax
+
+ CALL IASIZE('MEMVOR',IFINIA)
+ CALL RASIZE('MEMVOR',IFINRA)
+endif
+
+return
+end
diff --git a/src/base/modini.f90 b/src/base/modini.f90
new file mode 100644
index 0000000..424f8a6
--- /dev/null
+++ b/src/base/modini.f90
@@ -0,0 +1,1629 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine modini
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! MODIFICATION DES PARAMETRES DE CALCUL
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "albase.h"
+include "alstru.h"
+
+!===============================================================================
+
+! Arguments
+
+
+! VARIABLES LOCALES
+
+integer ii, jj, ivar, iphas, iok, iest, imom, ikw
+integer icompt, ipp, nbccou, nn
+integer nscacp, iscal
+double precision relxsp
+
+!===============================================================================
+
+! Indicateur erreur (0 : pas d'erreur)
+iok = 0
+
+!===============================================================================
+! 1. ENTREES SORTIES entsor.h
+!===============================================================================
+
+! ---> Niveau d'impression listing
+! Non initialise -> standard
+do ii = 1, nvarmx
+ if(iwarni(ii).eq.-10000) then
+ iwarni(ii) = 0
+ endif
+enddo
+
+!---> Variables de calcul ITRSVR = ivar. Sinon 0 (valeur d'initialisation).
+
+do ivar = 1, nvar
+ itrsvr(ipprtp(ivar)) = ivar
+enddo
+
+!---> sorties chrono?
+! Sauf mention contraire de l'utilisateur, on sort a la fin les
+! variables de calcul, la viscosite, rho, le pas de temps s'il
+! est variable, les estimateurs s'ils sont actives, les moments
+! s'il y en a et la viscosite de maillage en ALE.
+
+do ii = 2, nvppmx
+ if(itrsvr(ii).ge.1.and.ichrvr(ii).eq.-999) then
+ ichrvr(ii) = 1
+ endif
+enddo
+do iphas = 1, nphas
+ ipp = ipppro(ipproc(irom(iphas)))
+ if( ichrvr(ipp).eq.-999) ichrvr(ipp) = 1
+ ipp = ipppro(ipproc(ivisct(iphas)))
+ if( (iturb(iphas).eq.10 .or. itytur(iphas).eq.2 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60) &
+ .and.ichrvr(ipp).eq.-999) ichrvr(ipp) = 1
+ if (idtvar.lt.0) then
+ ichrvr(ipppro(ipproc(icour(iphas)))) = 0
+ ichrvr(ipppro(ipproc(ifour(iphas)))) = 0
+ endif
+ do iest = 1, nestmx
+ if(iescal(iest,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iest,iphas)))
+ if( ichrvr(ipp).eq.-999) ichrvr(ipp) = 1
+ endif
+ enddo
+enddo
+ipp = ippdt
+if (idtvar.lt.0) ichrvr(ipp) = 0
+if(idtvar.eq.2.and.ichrvr(ipp).eq.-999) ichrvr(ipp) = 1
+if(ipucou.ne.1) then
+ ichrvr(ipptx) = 0
+ ichrvr(ippty) = 0
+ ichrvr(ipptz) = 0
+endif
+
+if(nbmomt.gt.0) then
+ do imom = 1, nbmomt
+ ipp = ipppro(ipproc(icmome(imom)))
+ if(ichrvr(ipp).eq.-999) ichrvr(ipp) = 1
+ enddo
+endif
+if (iale.eq.1) then
+ nn = 1
+ if (iortvm.eq.1) nn = 3
+ do ii = 1, nn
+ ipp = ipppro(ipproc(ivisma(ii)))
+ if(ichrvr(ipp).eq.-999) ichrvr(ipp) = 1
+ enddo
+endif
+
+do ii = 1, nvppmx
+ if(ichrvr(ii).eq.-999) then
+ ichrvr(ii) = 0
+ endif
+enddo
+
+icompt = 0
+do ii = 2, nvppmx
+ if(ichrvr(ii).eq.1) icompt = icompt+1
+enddo
+if(icompt.eq.0) ntchr = -1
+
+
+!---> sorties historiques ?
+! Si une valeur non modifiee par l'utilisateur (=-999)
+! on la met a sa valeur par defaut
+! On sort toutes les variables a tous les pas de temps par defaut
+! IHISVR nb de sonde et numero par variable (-999 non initialise)
+! -1 : toutes les sondes
+! NTHIST = -1 : on ne sort pas d'historiques
+! NTHIST = n : on sort des historiques tous les n pas de temps
+! NTHSAV = -1 : on sauvegarde a la fin uniquement
+! NTHSAV = 0 : periode par defaut (voir caltri)
+! > 0 : periode
+
+do ii = 2, nvppmx
+ if(itrsvr(ii).ge.1.and.ihisvr(ii,1).eq.-999) then
+ ihisvr(ii,1) = -1
+ endif
+enddo
+if (idtvar.lt.0) ihisvr(ippdt ,1) = 0
+if(idtvar.eq.2.and.ihisvr(ippdt ,1).eq.-999) ihisvr(ippdt ,1) = -1
+if(ipucou.ne.1) then
+ ihisvr(ipptx,1) = 0
+ ihisvr(ippty,1) = 0
+ ihisvr(ipptz,1) = 0
+endif
+do iphas = 1, nphas
+ ipp = ipppro(ipproc(ivisct(iphas)))
+ if( (iturb(iphas).eq.10 .or. itytur(iphas).eq.2 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60) &
+ .and.ihisvr(ipp,1).eq.-999) ihisvr(ipp,1) = -1
+ if (idtvar.lt.0) then
+ ihisvr(ipppro(ipproc(icour(iphas))),1) = 0
+ ihisvr(ipppro(ipproc(ifour(iphas))),1) = 0
+ endif
+enddo
+if(nbmomt.gt.0) then
+ do imom = 1, nbmomt
+ ipp = ipppro(ipproc(icmome(imom)))
+ if(ihisvr(ipp,1).eq.-999) ihisvr(ipp,1) = -1
+ enddo
+endif
+
+do ii = 1, nvppmx
+ if(ihisvr(ii,1).eq.-999) then
+ ihisvr(ii,1) = 0
+ endif
+enddo
+
+! Si on est en ALE, on a un test equivalent dans strini.F
+if (iale.eq.0) then
+ icompt = 0
+ do ii = 2, nvppmx
+ if(ihisvr(ii,1).ne.0) icompt = icompt+1
+ enddo
+
+ if(icompt.eq.0.or.ncapt.eq.0) then
+ nthist = -1
+ endif
+endif
+
+! ---> Nom des variables
+
+do iphas = 1, nphas
+
+ IF(NOMVAR(IPPRTP(IPR (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IPR (IPHAS))),'(A6,I2.2)')'PresPh',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IU (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IU (IPHAS))),'(A6,I2.2)')'VitesX',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IV (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IV (IPHAS))),'(A6,I2.2)')'VitesY',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IW (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IW (IPHAS))),'(A6,I2.2)')'VitesZ',IPHAS
+ endif
+ if(itytur(iphas).eq.2) then
+ IF(NOMVAR(IPPRTP(IK (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IK (IPHAS))),'(A6,I2.2)') &
+ 'EnTurb',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IEP (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IEP (IPHAS))),'(A6,I2.2)') &
+ 'Dissip',IPHAS
+ endif
+ elseif(itytur(iphas).eq.3) then
+ IF(NOMVAR(IPPRTP(IR11 (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IR11 (IPHAS))),'(A6,I2.2)') &
+ 'R11pha',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IR22 (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IR22 (IPHAS))),'(A6,I2.2)') &
+ 'R22pha',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IR33 (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IR33 (IPHAS))),'(A6,I2.2)') &
+ 'R33pha',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IR12 (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IR12 (IPHAS))),'(A6,I2.2)') &
+ 'R12pha',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IR13 (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IR13 (IPHAS))),'(A6,I2.2)') &
+ 'R13pha',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IR23 (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IR23 (IPHAS))),'(A6,I2.2)') &
+ 'R23pha',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IEP (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IEP (IPHAS))),'(A6,I2.2)') &
+ 'Dissip',IPHAS
+ endif
+ elseif(iturb(iphas).eq.50) then
+ IF(NOMVAR(IPPRTP(IK (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IK (IPHAS))),'(A6,I2.2)') &
+ 'EnTurb',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IEP (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IEP (IPHAS))),'(A6,I2.2)') &
+ 'Dissip',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IPHI (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IPHI (IPHAS))),'(A6,I2.2)') &
+ 'phipha',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IFB (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IFB (IPHAS))),'(A6,I2.2)') &
+ 'fbarre',IPHAS
+ endif
+ elseif(iturb(iphas).eq.60) then
+ IF(NOMVAR(IPPRTP(IK (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IK (IPHAS))),'(A6,I2.2)') &
+ 'EnTurb',IPHAS
+ endif
+ IF(NOMVAR(IPPRTP(IOMG (IPHAS))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IOMG (IPHAS))),'(A5,I2.2)') &
+ 'Omega',IPHAS
+ endif
+ endif
+
+ IF(NOMVAR(IPPPRO(IPPROC(IROM (IPHAS)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(IROM (IPHAS)))),'(A6,I2.2)') &
+ 'MasVol',IPHAS
+ endif
+ IF(NOMVAR(IPPPRO(IPPROC(IVISCT(IPHAS)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(IVISCT(IPHAS)))),'(A6,I2.2)') &
+ 'VisTur',IPHAS
+ endif
+ IF(NOMVAR(IPPPRO(IPPROC(IVISCL(IPHAS)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(IVISCL(IPHAS)))),'(A6,I2.2)') &
+ 'VisMol',IPHAS
+ endif
+ if (ismago(iphas).gt.0) then
+ IF(NOMVAR(IPPPRO(IPPROC(ISMAGO(IPHAS)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(ISMAGO(IPHAS)))),'(A6,I2.2)') &
+ 'Csdyn2',IPHAS
+ endif
+ endif
+ if(icp (iphas).gt.0) then
+ IF(NOMVAR(IPPPRO(IPPROC(ICP (IPHAS)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(ICP (IPHAS)))),'(A6,I2.2)') &
+ 'ChalSp',IPHAS
+ endif
+ endif
+ if(iescal(iespre,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iespre,iphas)))
+ IF(NOMVAR(IPP) .EQ.' ') THEN
+ WRITE(NOMVAR(IPP),'(A5,I1,I2.2)') &
+ 'EsPre',IESCAL(IESPRE,IPHAS),IPHAS
+ endif
+ endif
+ if(iescal(iesder,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iesder,iphas)))
+ IF(NOMVAR(IPP) .EQ.' ') THEN
+ WRITE(NOMVAR(IPP),'(A5,I1,I2.2)') &
+ 'EsDer',IESCAL(IESDER,IPHAS),IPHAS
+ endif
+ endif
+ if(iescal(iescor,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iescor,iphas)))
+ IF(NOMVAR(IPP) .EQ.' ') THEN
+ WRITE(NOMVAR(IPP),'(A5,I1,I2.2)') &
+ 'EsCor',IESCAL(IESCOR,IPHAS),IPHAS
+ endif
+ endif
+ if(iescal(iestot,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iestot,iphas)))
+ IF(NOMVAR(IPP) .EQ.' ') THEN
+ WRITE(NOMVAR(IPP),'(A5,I1,I2.2)') &
+ 'EsTot',IESCAL(IESTOT,IPHAS),IPHAS
+ endif
+ endif
+
+enddo
+
+do jj = 1, nscaus
+ ii = jj
+ IF(NOMVAR(IPPRTP(ISCA (II ))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(ISCA (II ))),'(A5,I3.3)')'Scaus' ,II
+ endif
+enddo
+do jj = 1, nscapp
+ ii = iscapp(jj)
+ IF(NOMVAR(IPPRTP(ISCA (II ))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(ISCA (II ))),'(A5,I3.3)')'Scapp' ,II
+ endif
+enddo
+
+if(nbmomt.gt.0) then
+ do imom = 1, nbmomt
+ ipp = ipppro(ipproc(icmome(imom)))
+ IF(NOMVAR(IPP) .EQ.' ') THEN
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'MoyTps',IMOM
+ endif
+ enddo
+endif
+
+IF(NOMVAR(IPPDT ) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPDT ),'(A8 )')'PasDeTmp'
+endif
+
+IF(NOMVAR(IPPTX ) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPTX ),'(A8 )')'Tx '
+endif
+IF(NOMVAR(IPPTY ) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPTY ),'(A8 )')'Ty '
+endif
+IF(NOMVAR(IPPTZ ) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPTZ ),'(A8 )')'Tz '
+endif
+
+if (iale.eq.1) then
+ IF(NOMVAR(IPPRTP(IUMA)) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IUMA)),'(A8)')'VitmailX'
+ endif
+ IF(NOMVAR(IPPRTP(IVMA)) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IVMA)),'(A8)')'VitmailY'
+ endif
+ IF(NOMVAR(IPPRTP(IWMA)) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPRTP(IWMA)),'(A8)')'VitmailZ'
+ endif
+ if (iortvm.eq.0) then
+ IF(NOMVAR(IPPPRO(IPPROC(IVISMA(1)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(IVISMA(1)))),'(A8)')'ViscMail'
+ endif
+ else
+ IF(NOMVAR(IPPPRO(IPPROC(IVISMA(1)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(IVISMA(1)))),'(A8)')'ViscMaiX'
+ endif
+ IF(NOMVAR(IPPPRO(IPPROC(IVISMA(2)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(IVISMA(2)))),'(A8)')'ViscMaiY'
+ endif
+ IF(NOMVAR(IPPPRO(IPPROC(IVISMA(3)))) .EQ.' ') THEN
+ WRITE(NOMVAR(IPPPRO(IPPROC(IVISMA(3)))),'(A8)')'ViscMaiZ'
+ endif
+ endif
+endif
+
+! ---> Sorties listing
+
+do iphas = 1, nphas
+ ipp = ipppro(ipproc(irom (iphas)))
+ if(irovar(iphas).eq.1.and.ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+ ipp = ipppro(ipproc(ivisct(iphas)))
+ if( (iturb(iphas).eq.10 .or. itytur(iphas).eq.2 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60) &
+ .and.ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+ ipp = ipppro(ipproc(icour(iphas)))
+ if (ilisvr(ipp).eq.-999 .or. idtvar.lt.0) ilisvr(ipp) = 0
+ ipp = ipppro(ipproc(ifour(iphas)))
+ if (ilisvr(ipp).eq.-999 .or. idtvar.lt.0) ilisvr(ipp) = 0
+ if(iescal(iespre,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iespre,iphas)))
+ if( ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+ endif
+ if(iescal(iesder,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iesder,iphas)))
+ if( ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+ endif
+ if(iescal(iescor,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iescor,iphas)))
+ if( ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+ endif
+ if(iescal(iestot,iphas).gt.0) then
+ ipp = ipppro(ipproc(iestim(iestot,iphas)))
+ if( ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+ endif
+enddo
+
+if(nbmomt.gt.0) then
+ do imom = 1, nbmomt
+ ipp = ipppro(ipproc(icmome(imom)))
+ if(ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+ enddo
+endif
+
+ipp = ippdt
+if (idtvar.lt.0) ilisvr(ipp) = 0
+if(ilisvr(ipp).eq.-999) ilisvr(ipp) = 1
+if(ipucou.ne.1 .or. idtvar.lt.0) then
+ ilisvr(ipptx) = 0
+ ilisvr(ippty) = 0
+ ilisvr(ipptz) = 0
+endif
+
+do ii = 2, nvppmx
+ if(itrsvr(ii).ge.1.and.ilisvr(ii).eq.-999) then
+ ilisvr(ii) = 1
+ endif
+enddo
+do ii = 1, nvppmx
+ if(ilisvr(ii).eq.-999) then
+ ilisvr(ii) = 0
+ endif
+enddo
+
+
+
+!===============================================================================
+! 2. POSITION DES VARIABLES DE numvar.h
+!===============================================================================
+
+! ---> Reperage des variables qui disposeront de deux types de CL
+
+! Fait dans varpos.
+! Si l'utilisateur y a touche ensuite, on risque l'incident.
+
+!===============================================================================
+! 3. OPTIONS DU CALCUL : TABLEAUX DE optcal.h
+!===============================================================================
+
+! ---> Schema en temps
+
+
+do iphas = 1, nphas
+
+! -- Flux de masse
+ if(abs(thetfl(iphas)+999.d0).gt.epzero) then
+ write(nfecra,1001) iphas,istmpf(iphas)
+ iok = iok + 1
+ elseif(istmpf(iphas).eq.0) then
+ thetfl(iphas) = 0.d0
+ elseif(istmpf(iphas).eq.2) then
+ thetfl(iphas) = 0.5d0
+ endif
+
+! -- Proprietes physiques
+ if(abs(thetro(iphas)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1011) IPHAS,'IROEXT',IROEXT(IPHAS),'THETRO'
+ iok = iok + 1
+ elseif(iroext(iphas).eq.0) then
+ thetro(iphas) = 0.0d0
+ elseif(iroext(iphas).eq.1) then
+ thetro(iphas) = 0.5d0
+ elseif(iroext(iphas).eq.2) then
+ thetro(iphas) = 1.d0
+ endif
+ if(abs(thetvi(iphas)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1011) IPHAS,'IVIEXT',IVIEXT(IPHAS),'THETVI'
+ iok = iok + 1
+ elseif(iviext(iphas).eq.0) then
+ thetvi(iphas) = 0.0d0
+ elseif(iviext(iphas).eq.1) then
+ thetvi(iphas) = 0.5d0
+ elseif(iviext(iphas).eq.2) then
+ thetvi(iphas) = 1.d0
+ endif
+ if(abs(thetcp(iphas)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1011) IPHAS,'ICPEXT',ICPEXT(IPHAS),'THETCP'
+ iok = iok + 1
+ elseif(icpext(iphas).eq.0) then
+ thetcp(iphas) = 0.0d0
+ elseif(icpext(iphas).eq.1) then
+ thetcp(iphas) = 0.5d0
+ elseif(icpext(iphas).eq.2) then
+ thetcp(iphas) = 1.d0
+ endif
+
+! -- Termes sources NS
+ if(abs(thetsn(iphas)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1011) IPHAS,'ISNO2T',ISNO2T(IPHAS),'THETSN'
+ iok = iok + 1
+ elseif(isno2t(iphas).eq.1) then
+ thetsn(iphas) = 0.5d0
+ elseif(isno2t(iphas).eq.2) then
+ thetsn(iphas) = 1.d0
+ elseif(isno2t(iphas).eq.0) then
+ thetsn(iphas) = 0.d0
+ endif
+
+! -- Termes sources grandeurs turbulentes
+ if(abs(thetst(iphas)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1011) IPHAS,'ISTO2T',ISTO2T(IPHAS),'THETST'
+ iok = iok + 1
+ elseif(isto2t(iphas).eq.1) then
+ thetst(iphas) = 0.5d0
+ elseif(isto2t(iphas).eq.2) then
+ thetst(iphas) = 1.d0
+ elseif(isto2t(iphas).eq.0) then
+ thetst(iphas) = 0.d0
+ endif
+
+enddo
+
+do iscal = 1, nscal
+! -- Termes sources des scalaires
+ if(abs(thetss(iscal)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1021) ISCAL,'ISSO2T',ISSO2T(ISCAL),'THETSS'
+ iok = iok + 1
+ elseif(isso2t(iscal).eq.1) then
+ thetss(iscal) = 0.5d0
+ elseif(isso2t(iscal).eq.2) then
+ thetss(iscal) = 1.d0
+ elseif(isso2t(iscal).eq.0) then
+ thetss(iscal) = 0.d0
+ endif
+! -- Diffusivite des scalaires
+ if(abs(thetvs(iscal)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1021) ISCAL,'IVSEXT',IVSEXT(ISCAL),'THETVS'
+ iok = iok + 1
+ elseif(ivsext(iscal).eq.0) then
+ thetvs(iscal) = 0.d0
+ elseif(ivsext(iscal).eq.1) then
+ thetvs(iscal) = 0.5d0
+ elseif(ivsext(iscal).eq.2) then
+ thetvs(iscal) = 1.d0
+ endif
+enddo
+
+! Ici on interdit que l'utilisateur fixe lui meme THETAV, par securite
+! mais on pourrait le laisser faire
+! (enlever le IOK, modifier le message et les tests dans verini)
+do iphas = 1, nphas
+
+! Vitesse pression (la pression est prise sans interp)
+ if(abs(thetav(iu (iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(iv (iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(iw (iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(ipr(iphas))+999.d0).gt.epzero) then
+ WRITE(NFECRA,1031) IPHAS,'VITESSE-PRESSION ','THETAV'
+ iok = iok + 1
+ elseif(ischtp(iphas).eq.1) then
+ thetav(iu (iphas)) = 1.d0
+ thetav(iv (iphas)) = 1.d0
+ thetav(iw (iphas)) = 1.d0
+ thetav(ipr(iphas)) = 1.d0
+ elseif(ischtp(iphas).eq.2) then
+ thetav(iu (iphas)) = 0.5d0
+ thetav(iv (iphas)) = 0.5d0
+ thetav(iw (iphas)) = 0.5d0
+ thetav(ipr(iphas)) = 1.d0
+ endif
+
+! Turbulence (en k-eps : ordre 1)
+ if(itytur(iphas).eq.2) then
+ if(abs(thetav(ik (iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(iep(iphas))+999.d0).gt.epzero) then
+ WRITE(NFECRA,1031) IPHAS,'VARIABLES K-EPS','THETAV'
+ iok = iok + 1
+ elseif(ischtp(iphas).eq.1) then
+ thetav(ik (iphas)) = 1.d0
+ thetav(iep(iphas)) = 1.d0
+ elseif(ischtp(iphas).eq.2) then
+! pour le moment, on ne peut pas passer par ici (cf varpos)
+ thetav(ik (iphas)) = 0.5d0
+ thetav(iep(iphas)) = 0.5d0
+ endif
+ elseif(itytur(iphas).eq.3) then
+ if(abs(thetav(ir11(iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(ir22(iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(ir33(iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(ir12(iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(ir13(iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(ir23(iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(iep (iphas))+999.d0).gt.epzero) then
+ WRITE(NFECRA,1031) IPHAS,'VARIABLES RIJ-EP','THETAV'
+ iok = iok + 1
+ elseif(ischtp(iphas).eq.1) then
+ thetav(ir11(iphas)) = 1.d0
+ thetav(ir22(iphas)) = 1.d0
+ thetav(ir33(iphas)) = 1.d0
+ thetav(ir12(iphas)) = 1.d0
+ thetav(ir13(iphas)) = 1.d0
+ thetav(ir23(iphas)) = 1.d0
+ thetav(iep (iphas)) = 1.d0
+ elseif(ischtp(iphas).eq.2) then
+ thetav(ir11(iphas)) = 0.5d0
+ thetav(ir22(iphas)) = 0.5d0
+ thetav(ir33(iphas)) = 0.5d0
+ thetav(ir12(iphas)) = 0.5d0
+ thetav(ir13(iphas)) = 0.5d0
+ thetav(ir23(iphas)) = 0.5d0
+ thetav(iep (iphas)) = 0.5d0
+ endif
+ elseif(iturb(iphas).eq.50) then
+ if(abs(thetav(ik (iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(iep (iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(iphi(iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(ifb (iphas))+999.d0).gt.epzero) then
+ WRITE(NFECRA,1031) IPHAS,'VARIABLES V2F','THETAV'
+ iok = iok + 1
+ elseif(ischtp(iphas).eq.1) then
+ thetav(ik (iphas)) = 1.d0
+ thetav(iep (iphas)) = 1.d0
+ thetav(iphi(iphas)) = 1.d0
+ thetav(ifb (iphas)) = 1.d0
+ elseif(ischtp(iphas).eq.2) then
+! pour le moment, on ne peut pas passer par ici (cf varpos)
+ thetav(ik (iphas)) = 0.5d0
+ thetav(iep (iphas)) = 0.5d0
+ thetav(iphi(iphas)) = 0.5d0
+ thetav(ifb (iphas)) = 0.5d0
+ endif
+ elseif(iturb(iphas).eq.60) then
+ if(abs(thetav(ik (iphas))+999.d0).gt.epzero.or. &
+ abs(thetav(iomg(iphas))+999.d0).gt.epzero ) then
+ WRITE(NFECRA,1031) IPHAS,'VARIABLES K-OMEGA','THETAV'
+ iok = iok + 1
+ elseif(ischtp(iphas).eq.1) then
+ thetav(ik (iphas)) = 1.d0
+ thetav(iomg(iphas)) = 1.d0
+ elseif(ischtp(iphas).eq.2) then
+! pour le moment, on ne peut pas passer par ici (cf varpos)
+ thetav(ik (iphas)) = 0.5d0
+ thetav(iomg(iphas)) = 0.5d0
+ endif
+ endif
+
+enddo
+
+! Scalaires
+do iscal = 1, nscal
+ iphas = iphsca(iscal)
+ ivar = isca(iscal)
+ if(abs(thetav(ivar)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1041) IPHAS,'SCALAIRE',ISCAL,'THETAV'
+ iok = iok + 1
+ elseif(ischtp(iphas).eq.1) then
+ thetav(ivar) = 1.d0
+ elseif(ischtp(iphas).eq.2) then
+ thetav(ivar) = 0.5d0
+ endif
+enddo
+
+! Vitesse de maillage en ALE
+if (iale.eq.1) then
+ iphas = 1
+ if(abs(thetav(iuma)+999.d0).gt.epzero.or. &
+ abs(thetav(ivma)+999.d0).gt.epzero.or. &
+ abs(thetav(iwma)+999.d0).gt.epzero) then
+ WRITE(NFECRA,1032) 'THETAV'
+ iok = iok + 1
+ elseif(ischtp(iphas).eq.1) then
+ thetav(iuma) = 1.d0
+ thetav(ivma) = 1.d0
+ thetav(iwma) = 1.d0
+ elseif(ischtp(iphas).eq.2) then
+! pour le moment, on ne peut pas passer par ici (cf varpos)
+ thetav(iuma) = 0.5d0
+ thetav(ivma) = 0.5d0
+ thetav(iwma) = 0.5d0
+ endif
+endif
+
+! ---> ISSTPC
+! Si l'utilisateur n'a rien specifie pour le test de pente (=-999),
+! On impose 1 (ie sans) pour la vitesse en LES
+! 0 (ie avec) sinon
+
+do iphas = 1, nphas
+ if(itytur(iphas).eq.4) then
+ ii = iu(iphas)
+ if(isstpc(ii).eq.-999) isstpc(ii) = 1
+ ii = iv(iphas)
+ if(isstpc(ii).eq.-999) isstpc(ii) = 1
+ ii = iw(iphas)
+ if(isstpc(ii).eq.-999) isstpc(ii) = 1
+ do jj = 1, nscal
+ ii = isca(jj)
+ if(isstpc(ii).eq.-999) isstpc(ii) = 0
+ enddo
+ endif
+enddo
+
+do ii = 1, nvarmx
+ if (isstpc(ii).eq.-999) then
+ isstpc(ii) = 0
+ endif
+enddo
+
+! ---> BLENCV
+! Si l'utilisateur n'a rien specifie pour le schema convectif
+! 1 (ie centre) pour les vitesses et
+! les scalaires utilisateurs
+! 0 (ie upwind pur) pour le reste
+! (en particulier, en L.E.S. toutes les variables sont donc en centre)
+
+do iphas = 1, nphas
+ ii = iu(iphas)
+ if(abs(blencv(ii)+999.d0).lt.epzero) blencv(ii) = 1.d0
+ ii = iv(iphas)
+ if(abs(blencv(ii)+999.d0).lt.epzero) blencv(ii) = 1.d0
+ ii = iw(iphas)
+ if(abs(blencv(ii)+999.d0).lt.epzero) blencv(ii) = 1.d0
+enddo
+do jj = 1, nscaus
+ ii = isca(jj)
+ if(abs(blencv(ii)+999.d0).lt.epzero) blencv(ii) = 1.d0
+enddo
+
+do ii = 1, nvarmx
+ if (abs(blencv(ii)+999.d0).lt.epzero) then
+ blencv(ii) = 0.d0
+ endif
+enddo
+
+
+! ---> NSWRSM, EPSRSM ET EPSILO
+! Si l'utilisateur n'a rien specifie (NSWRSM=-999),
+! On impose
+! a l'ordre 1 :
+! 2 pour la pression
+! 1 pour les autres variables
+! on initialise EPSRSM a 1.D-8
+! on initialise EPSILO a 1.D-8
+! a l'ordre 2 :
+! 5 pour la pression
+! 10 pour les autres variables
+! on initialise EPSRSM a 1.D-5
+! on initialise EPSILO a 1.D-5
+! Attention aux tests dans verini
+
+do iphas = 1, nphas
+ if(ischtp(iphas).eq.2) then
+ ii = ipr(iphas)
+ if(nswrsm(ii).eq.-999) nswrsm(ii) = 5
+ if(abs(epsrsm(ii)+999.d0).lt.epzero) epsrsm(ii) = 1.d-5
+ if(abs(epsilo(ii)+999.d0).lt.epzero) epsilo(ii) = 1.d-5
+ ii = iu(iphas)
+ if(nswrsm(ii).eq.-999) nswrsm(ii) = 10
+ if(abs(epsrsm(ii)+999.d0).lt.epzero) epsrsm(ii) = 1.d-5
+ if(abs(epsilo(ii)+999.d0).lt.epzero) epsilo(ii) = 1.d-5
+ ii = iv(iphas)
+ if(nswrsm(ii).eq.-999) nswrsm(ii) = 10
+ if(abs(epsrsm(ii)+999.d0).lt.epzero) epsrsm(ii) = 1.d-5
+ if(abs(epsilo(ii)+999.d0).lt.epzero) epsilo(ii) = 1.d-5
+ ii = iw(iphas)
+ if(nswrsm(ii).eq.-999) nswrsm(ii) = 10
+ if(abs(epsrsm(ii)+999.d0).lt.epzero) epsrsm(ii) = 1.d-5
+ if(abs(epsilo(ii)+999.d0).lt.epzero) epsilo(ii) = 1.d-5
+ do jj = 1, nscal
+ ii = isca(jj)
+ if(nswrsm(ii).eq.-999) nswrsm(ii) = 10
+ if(abs(epsrsm(ii)+999.d0).lt.epzero) epsrsm(ii) = 1.d-5
+ if(abs(epsilo(ii)+999.d0).lt.epzero) epsilo(ii) = 1.d-5
+ enddo
+ endif
+ ii = ipr(iphas)
+ if(nswrsm(ii).eq.-999) nswrsm(ii) = 2
+enddo
+
+do ii = 1, nvarmx
+ if (nswrsm(ii).eq.-999) nswrsm(ii) = 1
+ if(abs(epsrsm(ii)+999.d0).lt.epzero) epsrsm(ii) = 1.d-8
+ if(abs(epsilo(ii)+999.d0).lt.epzero) epsilo(ii) = 1.d-8
+enddo
+
+! ---> ANOMAX
+! Si l'utilisateur n'a rien specifie pour l'angle de non
+! orthogonalite pour la selection du voisinage etendu,
+! on impose pi/4 (utile aussi en mode verifications)
+
+if (anomax.le.-grand) then
+ anomax = pi*0.25d0
+endif
+
+! ---> IMLIGR
+! Si l'utilisateur n'a rien specifie pour la limitation des
+! gradients (=-999),
+! On impose -1 avec gradrc (pas de limitation)
+! et 1 avec gradmc (limitation)
+
+if (imrgra.eq.0.or.imrgra.eq.4) then
+ do ii = 1, nvarmx
+ if (imligr(ii).eq.-999) then
+ imligr(ii) = -1
+ endif
+ enddo
+elseif (imrgra.eq.1.or.imrgra.eq.2.or.imrgra.eq.3) then
+ do ii = 1, nvarmx
+ if (imligr(ii).eq.-999) then
+ imligr(ii) = 1
+ endif
+ enddo
+endif
+
+! ---> DTMIN DTMAX CDTVAR
+
+
+if(dtmin.le.-grand) then
+ dtmin = 0.1d0*dtref
+endif
+if(dtmax.le.-grand) then
+ dtmax = 1.0d3*dtref
+endif
+
+do iphas = 1, nphas
+
+! Ici, ce n'est pas grave pour le moment,
+! etant entendu que ces coefs ne servent pas
+! s'ils servaient, attention dans le cas a plusieurs phases avec
+! une seule pression : celle ci prend le coef de la derniere phase
+ cdtvar(iv (iphas)) = cdtvar(iu(iphas))
+ cdtvar(iw (iphas)) = cdtvar(iu(iphas))
+ cdtvar(ipr(iphas)) = cdtvar(iu(iphas))
+
+ if(itytur(iphas).eq.2) then
+ cdtvar(iep (iphas)) = cdtvar(ik (iphas))
+ elseif(itytur(iphas).eq.3) then
+ cdtvar(ir22(iphas)) = cdtvar(ir11(iphas))
+ cdtvar(ir33(iphas)) = cdtvar(ir11(iphas))
+ cdtvar(ir12(iphas)) = cdtvar(ir11(iphas))
+ cdtvar(ir13(iphas)) = cdtvar(ir11(iphas))
+ cdtvar(ir23(iphas)) = cdtvar(ir11(iphas))
+ cdtvar(iep (iphas)) = cdtvar(ir11(iphas))
+ elseif(iturb(iphas).eq.50) then
+ cdtvar(iep (iphas)) = cdtvar(ik (iphas))
+
+ cdtvar(iphi(iphas)) = cdtvar(ik (iphas))
+! CDTVAR(IFB) est en fait inutile car pas de temps dans l'eq de f_barre
+ cdtvar(ifb (iphas)) = cdtvar(ik (iphas))
+ elseif(iturb(iphas).eq.60) then
+ cdtvar(iomg(iphas)) = cdtvar(ik (iphas))
+ endif
+
+enddo
+
+! ---> IDEUCH, YPLULI
+! En laminaire, longueur de melange et LES, une echelle de vitesse
+! Sinon, 2 echelles, sauf si l'utilisateur choisit 1 echelle.
+! On a initialise IDEUCH a -999 pour voir si l'utilisateur essaye
+! de choisir deux echelles quand ce n'est pas possible et le
+! prevenir dans la section verification.
+
+do iphas = 1, nphas
+ if(ideuch(iphas).eq.-999) then
+ if(iturb(iphas).eq. 0.or. &
+ iturb(iphas).eq.10.or. &
+ itytur(iphas).eq.4 ) then
+ ideuch(iphas) = 0
+ else
+ ideuch(iphas) = 1
+ endif
+ endif
+! Pour YPLULI, 1/XKAPPA est la valeur qui assure la continuite de la derivee entre
+! la zone lineaire et la zone logarithmique. Dans le cas des lois de paroi invariantes,
+! on utilise la valeur de continuite du profil de vitesse, 10,88.
+! Pour la L .E.S., on remet 10,88, afin d'eviter des clic/clac quand on est a la limite
+! (en modele a une echelle en effet, YPLULI=1/XKAPPA ne permet pas forcement de calculer
+! u* de maniere totalement satisfaisante)
+ if (ypluli(iphas).lt.-grand) then
+ if (ideuch(iphas).eq.2 .or. itytur(iphas).eq.4 ) then
+ ypluli(iphas) = 10.88d0
+ else
+ ypluli(iphas) = 1.d0/xkappa
+ endif
+ endif
+enddo
+
+
+! ---> Van Driest
+do iphas = 1, nphas
+ if(idries(iphas).eq.-1) then
+! On met 1 en supposant qu'en periodicite ou parallele on utilise le
+! mode de calcul de la distance a la paroi qui les prend en charge
+! (ICDPAR=+/-1, valeur par defaut)
+ if(iturb(iphas).eq.40) then
+ idries(iphas) = 1
+ elseif(iturb(iphas).eq.41) then
+ idries(iphas) = 0
+ elseif(iturb(iphas).eq.42) then
+ idries(iphas) = 0
+ endif
+ endif
+enddo
+
+
+! ---> ICPSYR
+! Si l'utilisateur n'a pas modifie ICPSYR, on prend par defaut :
+! s'il n y a pas de couplage
+! 0 pour tous les scalaires
+! sinon
+! 1 pour le scalaire ISCALT s'il existe
+! 0 pour les autres
+! Les modifs adequates devront etre ajoutees pour les physiques
+! particulieres
+! Les tests de coherence seront faits dans verini.
+
+if(nscal.gt.0) then
+
+! On regarde s'il y a du couplage
+
+ call nbcsyr (nbccou)
+ !==========
+
+! S'il y a du couplage
+ if (nbccou .ne. 0) then
+
+! On compte le nombre de scalaires couples
+ nscacp = 0
+ do iscal = 1, nscal
+ if(icpsyr(iscal).eq.1) then
+ nscacp = nscacp + 1
+ endif
+ enddo
+
+! Si l'utilisateur n'a pas couple de scalaire,
+ if(nscacp.eq.0) then
+
+! On couple le scalaire temperature de la premiere phase
+ do iphas = 1, nphas
+ if(iscalt(iphas).gt.0.and.iscalt(iphas).le.nscal) then
+ icpsyr(iscalt(iphas)) = 1
+ goto 100
+ endif
+ enddo
+ 100 continue
+
+ endif
+
+ endif
+
+! Pour tous les autres scalaires, non renseignes pas l'utilisateur
+! on ne couple pas
+ do iscal = 1, nscamx
+ if(icpsyr(iscal).eq.-999) then
+ icpsyr(iscal) = 0
+ endif
+ enddo
+
+endif
+
+
+! ---> ISCSTH
+! Si l'utilisateur n'a pas modifie ISCSTH, on prend par defaut :
+! scalaire passif pour les scalaires autres que ISCALT
+! Les modifs adequates devront etre ajoutees pour les physiques
+! particulieres
+! Noter en outre que, par defaut, si on choisit temperature
+! elle est en K (ceci n'est utile que pour le rayonnement et les pp)
+
+! =-10: non renseigne
+! =-1 : temperature en C
+! = 0 : passif
+! = 1 : temperature en K
+! = 2 : enthalpie
+
+
+
+if(nscal.gt.0) then
+ do ii = 1, nscal
+ if(iscsth(ii).eq.-10)then
+ iphas = iphsca(ii)
+ if(ii.ne.iscalt(iphas)) then
+ iscsth(ii) = 0
+ endif
+ endif
+ enddo
+endif
+
+! ---> ICALHY
+! Calcul de la pression hydrostatique en sortie pour les conditions de
+! Dirichlet sur la pression. Se deduit de IPHYDR et de la valeur de
+! la gravite (test assez arbitraire sur la norme).
+! ICALHY est initialise a -1 (l'utilisateur peut avoir force
+! 0 ou 1 et dans ce cas, on ne retouche pas)
+
+if(icalhy.ne.-1.and.icalhy.ne.0.and.icalhy.ne.1) then
+ write(nfecra,1061)icalhy
+ iok = iok + 1
+endif
+
+
+! ---> IDGMOM
+! Calcul du degre des moments
+
+do imom = 1, nbmomx
+ idgmom(imom) = 0
+enddo
+do imom = 1, nbmomt
+ do ii = 1, ndgmox
+ if(idfmom(ii,imom).ne.0) idgmom(imom) = idgmom(imom) + 1
+ enddo
+enddo
+
+! ---> ICDPAR
+! Calcul de la distance a la paroi. En standard, on met ICDPAR a -1, au cas
+! ou les faces de bord auraient change de type d'un calcul a l'autre. En k-omega,
+! il faut la distance a la paroi pour une suite propre, donc on initialise a 1 et
+! on avertit (dans verini).
+ikw = 0
+do iphas = 1, nphas
+ if (iturb(iphas).eq.60) ikw = 1
+enddo
+if (icdpar.eq.-999) then
+ icdpar = -1
+ if (ikw.eq.1) icdpar = 1
+ if (isuite.eq.1 .and. ikw.eq.1) write(nfecra,2000)
+endif
+if (icdpar.eq.-1 .and. ikw.eq.1 .and. isuite.eq.1) &
+ write(nfecra,2001)
+
+! ---> INEEDY, IMLIGY
+! Calcul de la distance a la paroi
+! (une seule phase ...)
+
+ineedy = 0
+do iphas = 1, nphas
+ if((iturb(iphas).eq.30.and.irijec(iphas).eq.1).or. &
+ (itytur(iphas).eq.4.and.idries(iphas).eq.1).or. &
+ iturb(iphas).eq.60 ) then
+ ineedy = 1
+ endif
+enddo
+
+if (imrgra.eq.0 .or. imrgra.eq.4) then
+ if (imligy.eq.-999) then
+ imligy = -1
+ endif
+elseif (imrgra.eq.1.or.imrgra.eq.2.or.imrgra.eq.3) then
+ if (imligy.eq.-999) then
+ imligy = 1
+ endif
+endif
+
+! Warning : non initialise => comme la vitesse
+if(iwarny.eq.-999) then
+ iwarny = iwarni(iu(1))
+endif
+
+
+! ---> IKECOU
+! En k-eps prod lin, v2f ou k-omega, on met IKECOU a 0 par defaut,
+! sinon on le laisse a 1
+! Dans verini on bloquera le v2f et le k-eps prod lin si IKECOU.NE.0
+! On bloquera aussi le stationnaire si IKECOU.NE.0
+do iphas = 1, nphas
+ if (ikecou(iphas).eq.-999) then
+ if (idtvar.lt.0) then
+ ikecou(iphas) = 0
+ else if (iturb(iphas).eq.21 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60 ) then
+ ikecou(iphas) = 0
+ else
+ ikecou(iphas) = 1
+ endif
+ endif
+enddo
+
+! ---> RELAXV
+if (idtvar.lt.0) then
+ relxsp = 1.d0-relxst
+ if (relxsp.le.epzero) relxsp = relxst
+ do iphas = 1, nphas
+ if (abs(relaxv(ipr(iphas))+999.d0).le.epzero) &
+ relaxv(ipr(iphas)) = relxsp
+ enddo
+ do ii = 1, nvarmx
+ if (abs(relaxv(ii)+999.d0).le.epzero) relaxv(ii) = relxst
+ enddo
+else
+ do iphas = 1, nphas
+ if ( ikecou(iphas).eq.0) then
+ if (itytur(iphas).eq.2 .or. itytur(iphas).eq.5) then
+ if (abs(relaxv(ik(iphas))+999.d0).lt.epzero) &
+ relaxv(ik(iphas)) = 1.d0
+ if (abs(relaxv(iep(iphas))+999.d0).lt.epzero) &
+ relaxv(iep(iphas)) = 1.d0
+ else if (itytur(iphas).eq.6) then
+ if (abs(relaxv(ik(iphas))+999.d0).lt.epzero) &
+ relaxv(ik(iphas)) = 1.d0
+ if (abs(relaxv(iomg(iphas))+999.d0).lt.epzero) &
+ relaxv(iomg(iphas)) = 1.d0
+ endif
+ endif
+ if (abs(relaxv(ipr(iphas))+999.d0).lt.epzero) &
+ relaxv(ipr(iphas)) = 1.d0
+ enddo
+endif
+
+! ---> SPECIFIQUE STATIONNAIRE
+if (idtvar.lt.0) then
+ dtref = 1.d0
+ dtmin = 1.d0
+ dtmax = 1.d0
+ do ii = 1, nvarmx
+ istat(ii) = 0
+ enddo
+ do iphas = 1, nphas
+ arak(iphas) = arak(iphas)/max(relaxv(iu(iphas)),epzero)
+ enddo
+endif
+
+! ---> INEEDF
+! Si on a demande un posttraitement des efforts aux bords, on
+! les calcule !
+if (mod(ipstdv,ipstfo).eq.0) then
+ ineedf = 1
+endif
+! Si on est en ALE, par defaut on calcule les efforts aux bords
+! (un test eventuel sur la presence de structures viendrait trop
+! tard)
+if (iale.eq.1) ineedf = 1
+
+!===============================================================================
+! 4. TABLEAUX DE cstphy.h
+!===============================================================================
+
+! ---> Constantes
+! Ca fait un calcul en double, mais si qqn a bouge cmu, apow, bpow,
+! ca servira.
+
+cpow = apow**(2.d0/(1.d0-bpow))
+dpow = 1.d0/(1.d0+bpow)
+cmu025 = cmu**0.25d0
+
+! ---> ICLVFL
+! Si l'utilisateur n'a pas modifie ICLVFL, on prend par defaut :
+! 0 pour les variances
+! Les modifs adequates devront etre ajoutees pour les physiques
+! particulieres
+
+do iscal = 1, nscal
+ if(iscavr(iscal).gt.0) then
+ if(iclvfl(iscal).eq.-1) then
+ iclvfl(iscal) = 0
+ endif
+ endif
+enddo
+
+
+! ---> VISLS0 (IPHSCA, IVISLS ont ete verifies dans varpos)
+! Pour les variances de fluctuations, les valeurs du tableau
+! precedent ne doivent pas avoir ete modifiees par l'utilisateur
+! Elles sont prises egales aux valeurs correspondantes pour le
+! scalaire associe.
+
+if(nscal.gt.0) then
+ do ii = 1, nscal
+ iscal = iscavr(ii)
+ if(iscal.gt.0.and.iscal.le.nscal)then
+ if(visls0(ii).lt.-grand) then
+ visls0(ii) = visls0(iscal)
+ else
+ write(nfecra,1071)ii, &
+ ii,iscal,ii,iscal, &
+ ii,ii,iscal,visls0(iscal)
+ iok = iok + 1
+ endif
+ endif
+ enddo
+endif
+
+! ---> XYZP0 : reference pour la pression hydrostatique
+! On considere que l'utilisateur a specifie la reference
+! a partir du moment ou il a specifie une coordonnee.
+! Pour les coordonnees non specifiees, on met 0.
+
+do iphas = 1, nphas
+ do ii = 1, 3
+ if (xyzp0(ii,iphas).gt.-0.5d0*rinfin) then
+ ixyzp0(iphas) = 1
+ else
+ xyzp0(ii,iphas) = 0.d0
+ endif
+ enddo
+enddo
+
+!===============================================================================
+! 5. ELEMENTS DE albase.h
+!===============================================================================
+
+if (iale.eq.1) then
+ if (isuite.eq.0 .and. italin.eq.-999 ) italin = 1
+else
+ italin = 0
+endif
+
+!===============================================================================
+! 6. COEFFICIENTS DE alstru.h
+!===============================================================================
+
+if (betnmk.lt.-0.5d0*grand) &
+ betnmk = (1.d0-alpnmk)**2/4.d0
+if (gamnmk.lt.-0.5d0*grand) &
+ gamnmk = (1.d0-2.d0*alpnmk)/2.d0
+if (aexxst.lt.-0.5d0*grand) aexxst = 0.5d0
+if (bexxst.lt.-0.5d0*grand) bexxst = 0.0d0
+if (cfopre.lt.-0.5d0*grand) cfopre = 2.0d0
+
+!===============================================================================
+! 6. STOP SI PB
+!===============================================================================
+
+if(iok.ne.0) then
+ call csexit (1)
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ', I10,' ISTMPF = ', I10 ,/,&
+'@ THETFL SERA INITIALISE AUTOMATIQUEMENT. ',/,&
+'@ NE PAS LE MODIFIER DANS usini1. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ', I10,' ',A6,' = ', I10 ,/,&
+'@ ',A6,' SERA INITIALISE AUTOMATIQUEMENT. ',/,&
+'@ NE PAS LE MODIFIER DANS usini1. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ', I10,' ',A6,' = ', I10 ,/,&
+'@ ',A6,' SERA INITIALISE AUTOMATIQUEMENT. ',/,&
+'@ NE PAS LE MODIFIER DANS usini1. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ', I10,' ',A17 ,/,&
+'@ ',A6,' SERA INITIALISE AUTOMATIQUEMENT. ',/,&
+'@ NE PAS LE MODIFIER DANS usini1. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1032 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VITESSE DE MAILLAGE EN ALE ',/,&
+'@ ',A6,' SERA INITIALISE AUTOMATIQUEMENT. ',/,&
+'@ NE PAS LE MODIFIER DANS usini1. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ', I10,' ',A8,' ',I10 ,/,&
+'@ ',A6,' SERA INITIALISE AUTOMATIQUEMENT. ',/,&
+'@ NE PAS LE MODIFIER DANS usini1. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1061 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ICALHY doit etre un entier egal a 0 ou 1 ',/,&
+'@ ',/,&
+'@ Il vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1071 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,' NE PAS MODIFIER LA DIFFUSIVITE ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,' represente la variance des ',/,&
+'@ fluctuations du scalaire ',I10 ,/,&
+'@ (ISCAVR(',I10 ,') = ',I10 ,/,&
+'@ La diffusivite VISLS0(',I10 ,') du scalaire ',I10 ,/,&
+'@ ne doit pas etre renseignee : ',/,&
+'@ elle sera automatiquement prise egale a la diffusivite ',/,&
+'@ du scalaire ',I10 ,' soit ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le modele de turbulence k-omega a ete choisi. Pour gerer ',/,&
+'@ correctement la suite de calcul, l''indicateur ICDPAR a ',/,&
+'@ ete mis a 1 (relecture de la distance a la paroi dans le',/,&
+'@ fichier suite). ',/,&
+'@ Si cette initialisation pose probleme (modification du ',/,&
+'@ nombre et de la position des faces de paroi depuis le ',/,&
+'@ calcul precedent), forcer ICDPAR=-1 dans usini1 (il peut',/,&
+'@ alors y avoir un leger decalage dans la viscosite ',/,&
+'@ turbulente au premier pas de temps). ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Le modele de turbulence k-omega a ete choisi, avec ',/,&
+'@ l''option de recalcul de la distance a la paroi ',/,&
+'@ (ICDPAR=-1). Il se peut qu''il y ait un leger decalage ',/,&
+'@ dans la viscosite turbulente au premier pas de temps. ',/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ PHASE ', I10,' ISTMPF = ', I10 ,/,&
+'@ THETFL WILL BE AUTOMATICALLY INITIALIZED. ',/,&
+'@ DO NOT MODIFY IT IN usini1. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ PHASE ', I10,' ',A6,' = ', I10 ,/,&
+'@ ',A6,' WILL BE INITIALIZED AUTOMATICALLY ',/,&
+'@ DO NOT MODIFY IT IN usini1. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ SCALAR ', I10,' ',A6,' = ', I10 ,/,&
+'@ ',A6,' WILL BE INITIALIZED AUTOMATICALLY ',/,&
+'@ DO NOT MODIFY IT IN usini1. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ PHASE ', I10,' ',A17 ,/,&
+'@ ',A6,' WILL BE INITIALIZED AUTOMATICALLY ',/,&
+'@ DO NOT MODIFY IT IN usini1. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1032 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ MESH VELOCITY IN ALE ',/,&
+'@ ',A6,' WILL BE INITIALIZED AUTOMATICALLY ',/,&
+'@ DO NOT MODIFY IT IN usini1. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ PHASE ', I10,' ',A8,' ',I10 ,/,&
+'@ ',A6,' WILL BE INITIALIZED AUTOMATICALLY ',/,&
+'@ DO NOT MODIFY IT IN usini1. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1061 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ICALHY must be an integer equal to 0 or 1 ',/,&
+'@ ',/,&
+'@ Its value is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1071 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ SCALAR ',I10 ,' DO NOT MODIFY THE DIFFUSIVITY ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,' is the fluctuations variance ',/,&
+'@ of the scalar ',I10 ,/,&
+'@ (ISCAVR(',I10 ,') = ',I10 ,/,&
+'@ The diffusivity VISLS0(',I10 ,') of the scalar ',I10 ,/,&
+'@ must not be set: ',/,&
+'@ it will be automatically set equal to the scalar ',/,&
+'@ diffusivity ',I10 ,' i.e. ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The k-omega turbulence model has been chosen. In order to ',/,&
+'@ have a correct calculation restart, the ICDPAR indicator',/,&
+'@ has been set to 1 (read the wall distance in the restart',/,&
+'@ file). ',/,&
+'@ If this initialization raises any issue (modification of ',/,&
+'@ the number and position of the wall faces since the ',/,&
+'@ previous calcuation), force ICDPAR=1 in usini1 (there ',/,&
+'@ maight be a small shift in the turbulent viscosity at ',/,&
+'@ the first time-step). ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ The k-omega turbulence model has been chosen, with the ',/,&
+'@ option for a re-calculation of the wall distance ',/,&
+'@ (ICDPAR=-1). There might be a small shift in the ',/,&
+'@ turbulent viscosity at the first time-step. ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+return
+end
diff --git a/src/base/modpar.f90 b/src/base/modpar.f90
new file mode 100644
index 0000000..104d074
--- /dev/null
+++ b/src/base/modpar.f90
@@ -0,0 +1,143 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine modpar &
+!================
+
+ ( ntcabs , ntmabs )
+
+!===============================================================================
+
+! FONCTION :
+! --------
+! MODIFICATION DE NTMABS AU COURS DU CALCUL
+! POUR ARRET INTERACTIF
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ntcabs ! e ! <-- ! numero absolu du pas de temps courant !
+! ntmabs ! e ! <-- ! numero absolu du pas de temps final !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ntcabs , ntmabs
+
+! VARIABLES LOCALES
+
+integer irangs, lng, itmp(1)
+logical exstp
+
+!===============================================================================
+
+! On passe ici en sequentiel, ou en parallele avec le proc 0.
+if (irangp.le.0) then
+!---> ARRET D'URGENCE
+
+ inquire (file=ficstp,exist=exstp)
+
+! SI UN FICHIER FICSTP EXISTE
+
+ if (exstp) then
+
+! LIRE LE NOMBRE MAX D'ITERATIONS (ABSOLU)
+
+ open (file=ficstp,unit=impstp)
+ read (impstp,*,err=5200,end=5200)
+ 5200 read (impstp,*,err=5100,end=5100)ntmabs
+ 5100 continue
+ CLOSE (IMPSTP,STATUS='DELETE')
+
+! COMPARER LE TEMPS ECOULE ET LE TEMPS MAX
+! MODIFIER FICSTP SI BESOIN
+
+ if(ntcabs.gt.ntmabs)then
+ ntmabs = ntcabs
+ endif
+
+! SORTIES
+
+ write (nfecra,1000) ntcabs,ntmabs
+
+ OPEN (FILE=FICSTP//'.mod',UNIT=IMPSTP)
+ write (impstp,1000) ntcabs,ntmabs
+ close (impstp)
+ endif
+
+endif
+
+! En parallele, bcast.
+if(irangp.ge.0) then
+ irangs = 0
+ lng = 1
+ itmp(1) = ntmabs
+ call parbci(irangs,lng,itmp)
+ ntmabs = itmp(1)
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+'=============================================================',/,&
+' NTCABS COURANT = ',I10 ,/,&
+' NTMABS RESET TO = ',I10 ,/,&
+'=============================================================',/,&
+ /)
+
+#else
+
+ 1000 format(/, &
+'=============================================================',/,&
+' NTCABS CURRENT = ',I10 ,/,&
+' NTMABS RESET TO = ',I10 ,/,&
+'=============================================================',/,&
+ /)
+
+#endif
+
+end
diff --git a/src/base/navsto.f90 b/src/base/navsto.f90
new file mode 100644
index 0000000..68a7049
--- /dev/null
+++ b/src/base/navsto.f90
@@ -0,0 +1,1601 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine navsto &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iterns , icvrge , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , coefa , coefb , frcxt , &
+ trava , ximpa , uvwk , &
+ viscf , viscb , viscfi , viscbi , &
+ dam , xam , &
+ drtp , trav , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , dfrcxt , frchy , dfrchy , &
+ coefu , esflum , esflub , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS N-S 1 PHASE INCOMPRESSIBLE OU RO VARIABLE
+! SUR UN PAS DE TEMPS (CONVECTION/DIFFUSION - PRESSION /CONTINUITE)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietes des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iterns ! e ! <-- ! numero d'iteration sur navsto !
+! icvrge ! e ! <-- ! indicateur de convergence du pnt fix !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! isostd ! te ! <-- ! indicateur de sortie standard !
+! (nfabor+1) ! ! ! +numero de la face de reference !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! trava,ximpa ! tr ! <-- ! tableau de travail pour couplage !
+!ncelet,3,nphas ! ! ! vitesse pression par point fixe !
+! uvwk ! tr ! <-- ! tableau de travail pour couplage u/p !
+!ncelet,3,nphas ! ! ! sert a stocker la vitesse de !
+! ! ! ! l'iteration precedente !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! viscfi(nfac) ! tr ! --- ! idem viscf pour increments !
+! viscbi(nfabor ! tr ! --- ! idem viscb pour increments !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! trav(ncelet,3 ! tr ! --- ! tableau de travail pour gradient !
+! smbr (ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1..10(ncelet ! tr ! --- ! tableau de travail !
+! dfrcxt(ncelet ! tr ! --- ! variation de force exterieure !
+! 3,nphas) ! ! ! generant la pression hydrostatique !
+! frchy(ncelet ! tr ! --- ! tableau de travail !
+! ndim ) ! ! ! pression hydrostatique !
+! dfrchy(ncelet ! tr ! --- ! tableau de travail variation de !
+! ndim ) ! ! ! pression hydrostatique !
+! coefu(nfab,3) ! tr ! --- ! tableau de travail !
+! esflum(nfac) ! tr ! --- ! tableau de travail (iestot ) !
+! esflub(nfabor ! tr ! --- ! tableau de travail (iestot ) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "pointe.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iterns , icvrge
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer isostd(nfabor+1,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision tslagr(ncelet,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision frcxt(ncelet,3,nphas)
+double precision trava(ncelet,ndim,nphas),ximpa(ncelet,ndim,nphas)
+double precision uvwk(ncelet,ndim,nphas)
+double precision viscf(nfac), viscb(nfabor)
+double precision viscfi(nfac), viscbi(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), trav(ncelet,3)
+double precision smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet), w10(ncelet)
+double precision dfrcxt(ncelet,3,nphas)
+double precision frchy(ncelet,ndim), dfrchy(ncelet,ndim)
+double precision coefu(nfabor,3)
+double precision esflum(nfac), esflub(nfabor)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iccocg, inc, iel, iel1, iel2, ifac, imax, iii
+integer ii , inod
+integer iphas , iph, isou, ivar, iitsm, igamm1
+integer ipriph, iuiph , iviph , iwiph , iclipr, iclipf
+integer icliup, iclivp, icliwp, init
+integer icluma, iclvma, iclwma
+integer iflmas, iflmab, ipcrom, ipbrom
+integer iflms1, iflmb1, iflmb0, iismph
+integer nswrgp, imligp, iwarnp, imaspe
+integer idimte, itenso
+integer nbrval, iappel, iescop, idtsca
+integer iflint, iflbrd, icocgv, ifinra
+integer ndircp, icpt , iecrw
+integer numcpl
+double precision rnorm , rnorma, rnormi, vitnor
+double precision dtsrom, unsrom, surf , rhom
+double precision epsrgp, climgp, extrap, xyzmax(3)
+double precision thetap, xdu, xdv, xdw
+double precision ro0iph, p0iph, pr0iph, xxp0 , xyp0 , xzp0
+double precision rhofac, dtfac, ddepx , ddepy, ddepz
+double precision xnrdis
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1000)
+endif
+
+idebia = idbia0
+idebra = idbra0
+
+if(nterup.gt.1) then
+
+ do iphas = 1, nphas
+
+ iuiph = iu (iphas)
+ iviph = iv (iphas)
+ iwiph = iw (iphas)
+ ipriph = ipr(iphas)
+ do isou = 1, 3
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+! La boucle sur NCELET est une securite au cas
+! ou on utiliserait UVWK par erreur a ITERNS = 1
+ do iel = 1,ncelet
+ uvwk(iel,isou,iphas) = rtp(iel,ivar)
+ enddo
+ enddo
+
+! Calcul de la norme L2 de la vitesse
+ if(iterns.eq.1) then
+ xnrmu0(iphas) = 0.d0
+ iuiph = iu (iphas)
+ iviph = iv (iphas)
+ iwiph = iw (iphas)
+ do iel = 1, ncel
+ xnrmu0(iphas) = xnrmu0(iphas) +(rtpa(iel,iuiph)**2 &
+ + rtpa(iel,iviph)**2 &
+ + rtpa(iel,iwiph)**2) &
+ * volume(iel)
+ enddo
+ if(irangp.ge.0) then
+ call parsom (xnrmu0(iphas))
+ !==========
+ endif
+! En cas de couplage entre deux instances de Code_Saturne, on calcule
+! la norme totale de la vitesse
+! Necessaire pour que l'une des instances ne stoppe pas plus tot que les autres
+! (il faudrait quand meme verifier les options numeriques, ...)
+ do numcpl = 1, nbrcpl
+ call tbrcpl ( numcpl, 1, 1, xnrmu0(iphas), xnrdis )
+ !==========
+ xnrmu0(iphas) = xnrmu0(iphas) + xnrdis
+ enddo
+ xnrmu0(iphas) = sqrt(xnrmu0(iphas))
+ endif
+
+! On assure la periodicite ou le parallelisme de UVWK et la pression
+! (cette derniere vaut la pression a l'iteration precedente)
+ if(iterns.gt.1) then
+ if(irangp.ge.0) then
+ call parcom (uvwk(1,1,iphas))
+ !==========
+ call parcom (uvwk(1,2,iphas))
+ !==========
+ call parcom (uvwk(1,3,iphas))
+ !==========
+ call parcom (rtpa(1,ipriph))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ uvwk(1,1,iphas),uvwk(1,1,iphas),uvwk(1,1,iphas), &
+ uvwk(1,2,iphas),uvwk(1,2,iphas),uvwk(1,2,iphas), &
+ uvwk(1,3,iphas),uvwk(1,3,iphas),uvwk(1,3,iphas))
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtpa(1,ipriph),rtpa(1,ipriph),rtpa(1,ipriph), &
+ rtpa(1,ipriph),rtpa(1,ipriph),rtpa(1,ipriph), &
+ rtpa(1,ipriph),rtpa(1,ipriph),rtpa(1,ipriph))
+ endif
+ endif
+
+ enddo
+
+endif
+
+
+!===============================================================================
+! 2. ETAPE DE PREDICTION DES VITESSES
+!===============================================================================
+
+do iphas = 1, nphas
+
+ iappel = 1
+ iuiph = iu(iphas)
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ iph = iphas
+
+ call preduv &
+ !==========
+ ( idebia , idebra , iappel , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iterns , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , &
+ ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ tslagr , coefa , coefb , &
+ ra(ickupd(iphas)) , ra(ismace(iphas)) , frcxt , &
+ trava , ximpa , uvwk , dfrcxt , ra(itpuco) , trav , &
+ viscf , viscb , viscfi , viscbi , &
+ dam , xam , &
+ drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , coefu , &
+ rdevel , rtuser , ra )
+
+enddo
+
+
+! --- Sortie si pas de pression continuite (on suppose que
+! la pression est unique, donc pas de iphas dans le test),
+! on met a jour les flux de masse, et on sort
+
+if( iprco.le.0 ) then
+
+ do iphas = 1, nphas
+
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+
+ icliup = iclrtp(iuiph ,icoef)
+ iclivp = iclrtp(iviph ,icoef)
+ icliwp = iclrtp(iwiph ,icoef)
+
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ ipcrom = ipproc(irom (iphas))
+ ipbrom = ipprob(irom (iphas))
+
+ init = 1
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ if (iale.eq.1) iflmb0 = 0
+ iismph = iisymp+nfabor*(iphas-1)
+ nswrgp = nswrgr(iuiph)
+ imligp = imligr(iuiph)
+ iwarnp = iwarni(iuiph)
+ epsrgp = epsrgr(iuiph)
+ climgp = climgr(iuiph)
+ extrap = extrag(iuiph)
+
+ iph = iphas
+
+ imaspe = 1
+
+ call inimas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iph , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ coefa(1,icliup), coefa(1,iclivp), coefa(1,icliwp), &
+ coefb(1,icliup), coefb(1,iclivp), coefb(1,icliwp), &
+ propfa(1,iflmas), propfb(1,iflmab) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+ enddo
+
+! En ALE on doit rajouter la composante en vitesse de maillage
+ if (iale.eq.1) then
+
+ icluma = iclrtp(iuma ,icoef)
+ iclvma = iclrtp(ivma ,icoef)
+ iclwma = iclrtp(iwma ,icoef)
+
+! On change de signe car on veut l'oppose de la vitesse de maillage
+! aux faces
+ do iel = 1, ncelet
+ rtp(iel,iuma) = -rtp(iel,iuma)
+ rtp(iel,ivma) = -rtp(iel,ivma)
+ rtp(iel,iwma) = -rtp(iel,iwma)
+ enddo
+ do ifac = 1, nfabor
+ coefa(ifac,icluma) = -coefa(ifac,icluma)
+ coefa(ifac,iclvma) = -coefa(ifac,iclvma)
+ coefa(ifac,iclwma) = -coefa(ifac,iclwma)
+ enddo
+
+! One temporary array needed for internal faces, in case some internal vertices
+! are moved directly by the user
+ iflint = idebra
+ ifinra = iflint + nfac
+
+ CALL RASIZE('NAVSTO',IFINRA)
+ !==========
+
+ do iphas = 1, nphas
+
+ iflmas = ipprof(ifluma(iu(iphas)))
+ iflmab = ipprob(ifluma(iu(iphas)))
+ ipcrom = ipproc(irom (iphas))
+ ipbrom = ipprob(irom (iphas))
+
+ init = 0
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ nswrgp = nswrgr(iuma )
+ imligp = imligr(iuma )
+ iwarnp = iwarni(iuma )
+ epsrgp = epsrgr(iuma )
+ climgp = climgr(iuma )
+ extrap = extrag(iuma )
+
+ iph = iphas
+
+ imaspe = 1
+
+ do ifac = 1, nfac
+ ra(iflint+ifac-1) = 0.d0
+ enddo
+
+ call inimas &
+ !==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iph , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ rtp(1,iuma ) , rtp(1,ivma ) , rtp(1,iwma) , &
+ coefa(1,icluma), coefa(1,iclvma), coefa(1,iclwma), &
+ coefb(1,icluma), coefb(1,iclvma), coefb(1,iclwma), &
+ ra(iflint) , propfb(1,iflmab) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+ enddo
+
+ do iel = 1, ncelet
+ rtp(iel,iuma) = -rtp(iel,iuma)
+ rtp(iel,ivma) = -rtp(iel,ivma)
+ rtp(iel,iwma) = -rtp(iel,iwma)
+ enddo
+ do ifac = 1, nfabor
+ coefa(ifac,icluma) = -coefa(ifac,icluma)
+ coefa(ifac,iclvma) = -coefa(ifac,iclvma)
+ coefa(ifac,iclwma) = -coefa(ifac,iclwma)
+ enddo
+
+ do ifac = 1, nfac
+ iecrw = 0
+ ddepx = 0.d0
+ ddepy = 0.d0
+ ddepz = 0.d0
+ icpt = 0
+ do ii = ipnfac(ifac),ipnfac(ifac+1)-1
+ inod = nodfac(ii)
+ if (ia(iimpal+inod-1).eq.0) iecrw = iecrw + 1
+ icpt = icpt + 1
+ ddepx = ddepx + ra(idepal +inod-1) &
+ +ra(ixyzn0+(inod-1)*ndim )-xyznod(1,inod)
+ ddepy = ddepy + ra(idepal+nnod +inod-1) &
+ +ra(ixyzn0+(inod-1)*ndim+1)-xyznod(2,inod)
+ ddepz = ddepz + ra(idepal+2*nnod+inod-1) &
+ +ra(ixyzn0+(inod-1)*ndim+2)-xyznod(3,inod)
+ enddo
+! If all the face vertices have imposed displacement, w is evaluated from
+! this displacement
+ if (iecrw.eq.0) then
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+ dtfac = 0.5d0*(dt(iel1) + dt(iel2))
+ rhofac = 0.5d0*(propce(iel1,ipcrom) + propce(iel2,ipcrom))
+ propfa(ifac,iflmas) = propfa(ifac,iflmas) - rhofac*( &
+ ddepx*surfac(1,ifac) &
+ +ddepy*surfac(2,ifac) &
+ +ddepz*surfac(3,ifac) )/dtfac/icpt
+! Else w is calculated from the cell-centre mesh velocity
+ else
+ propfa(ifac,iflmas) = propfa(ifac,iflmas) &
+ + ra(iflint+ifac-1)
+ endif
+ enddo
+ endif
+
+ return
+
+endif
+
+
+!===============================================================================
+! 3. ETAPE DE PRESSION/CONTINUITE ( VITESSE/PRESSION )
+!===============================================================================
+
+if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1200)
+endif
+
+! On n'appelle resolp qu'une seule fois, pour LA phase qu'il faut
+
+iphas = 1
+iph = iphas
+
+! --- Pas de temps scalaire ou pas
+idtsca = 0
+if ((ipucou.eq.1).or.(ncpdct(iphas).gt.0)) idtsca = 1
+
+call resolp &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , &
+ ia(iitpsm(iphas)) , isostd , idtsca , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ frcxt , dfrcxt , ra(itpuco) , trav , &
+ viscf , viscb , viscfi , viscbi , &
+ dam , xam , &
+ drtp , smbr , rovsdt , tslagr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , frchy , dfrchy , coefu , trava , &
+ rdevel , rtuser , ra )
+
+
+! Si on est en polyphasique, il faudra de toutes maniere modifier
+! tout ceci. Pour le moment, on se contente de mettre a jour les
+! flux de masse des phases 2 a N en postulant qu'ils sont tous egaux
+! au flux de masse de la phase 1 ...
+! Ca ne sert qu'aux tests bien sur
+
+if(nphas.gt.1) then
+ iflms1 = ipprof(ifluma(iu(1 )))
+ iflmb1 = ipprob(ifluma(iu(1 )))
+ do iphas = 2, nphas
+ iflmas = ipprof(ifluma(iu(iphas)))
+ iflmab = ipprob(ifluma(iu(iphas)))
+ do ifac = 1, nfac
+ propfa(ifac,iflmas) = propfa(ifac,iflms1)
+ enddo
+ do ifac = 1, nfabor
+ propfb(ifac,iflmab) = propfb(ifac,iflmb1)
+ enddo
+ enddo
+endif
+
+!===============================================================================
+! 4. REACTUALISATION DU CHAMP DE VITESSE
+!===============================================================================
+
+
+do iphas = 1, nphas
+
+ ipriph = ipr(iphas)
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+
+ iclipr = iclrtp(ipriph,icoef)
+ iclipf = iclrtp(ipriph,icoeff)
+ icliup = iclrtp(iuiph ,icoef)
+ iclivp = iclrtp(iviph ,icoef)
+ icliwp = iclrtp(iwiph ,icoef)
+
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ ipcrom = ipproc(irom (iphas))
+ ipbrom = ipprob(irom (iphas))
+ iismph = iisymp+nfabor*(iphas-1)
+
+
+
+! IREVMC = 0 : Methode standard (pas par moindres carres) : on
+! ajoute un gradient d'increment de pression standard
+! a la vitesse predite opur obtenir la vitesse corrigee
+
+! IREVMC = 1 : On applique la methode par moindres carres a
+! l'ecart entre le flux de masse predit et le flux
+! de masse actualise,
+! c'est-a-dire au gradient d'increment de pression
+! On ajoute la grandeur obtenue aux cellules a la vitesse
+! predite pour obtenir la vitesse actualisee
+! Cette methode correspond a IREVMC = 0 avec
+! gradient par moindres carres IMRGRA=1 dans la
+! reactualisation des vitesses.
+
+! IREVMC = 2 : On applique la methode par moindres carres au
+! flux de masse actualise
+! pour obtenir la vitesse actualisee
+! Cette methode correspond a la methode RT0.
+
+! La methode IREVMC = 2 semble plus "diffusive", mais semble aussi la
+! seule issue pour certains ecoulements atmospheriques de mercure.
+! La methode IREVMC = 1 semble ne pas trop "diffuser", avec un
+! gain du a l'utilisation du gradient moindres carres. Elle
+! se rapproche beaucoup de IREVMC=0.
+
+
+ if( irevmc(iphas).eq.1 ) then
+
+! On a besoin de trois tableaux de travail
+ iflint = idebra
+ iflbrd = iflint + nfac
+ icocgv = iflbrd + nfabor
+ ifinra = icocgv + ncelet*9
+
+ CALL RASIZE('NAVSTO',IFINRA)
+ !==========
+
+! on ote la partie en u-predit dans le flux de masse final,
+! on projete des faces vers le centre, puis on rajoute u-predit.
+ init = 1
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ if (iale.eq.1) iflmb0 = 0
+ nswrgp = nswrgr(iuiph )
+ imligp = imligr(iuiph )
+ iwarnp = iwarni(iuiph )
+ epsrgp = epsrgr(iuiph )
+ climgp = climgr(iuiph )
+ extrap = extrag(iuiph )
+
+ iph = iphas
+
+ imaspe = 1
+
+ call inimas &
+ !==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iph , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ coefa(1,icliup), coefa(1,iclivp), coefa(1,icliwp), &
+ coefb(1,icliup), coefb(1,iclivp), coefb(1,icliwp), &
+ ra(iflint), ra(iflbrd), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+ do ifac = 1, nfac
+ ra(iflint+ifac-1) = propfa(ifac,iflmas) - ra(iflint+ifac-1)
+ enddo
+ do ifac = 1, nfabor
+ ra(iflbrd+ifac-1) = propfb(ifac,iflmab) - ra(iflbrd+ifac-1)
+ enddo
+
+ call recvmc &
+ !==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), ra(iflint) , ra(iflbrd) , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , ra(icocgv) , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ rtp(iel,iuiph) = rtp(iel,iuiph) + w1(iel)
+ rtp(iel,iviph) = rtp(iel,iviph) + w2(iel)
+ rtp(iel,iwiph) = rtp(iel,iwiph) + w3(iel)
+ enddo
+
+ elseif( irevmc(iphas).eq.2 ) then
+
+! On calcule la vitesse corrigee directement a partir du flux de masse
+! corrige .
+! On a besoin de trois tableaux de travail
+ icocgv = idebra
+ ifinra = icocgv + ncelet*9
+
+ CALL RASIZE('NAVSTO',IFINRA)
+ !==========
+
+ call recvmc &
+ !==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfa(1,iflmas), propfb(1,iflmab), &
+ rtp(1,iuiph), rtp(1,iviph), rtp(1,iwiph), &
+ w4 , w5 , w6 , ra(icocgv) , &
+ rdevel , rtuser , ra )
+
+
+ else
+
+! On corrige la vitesse predite par le gradient cellule de
+! l'increment de pression
+
+! GRADIENT DE L'INCREMENT TOTAL DE PRESSION
+
+ if (idtvar.lt.0) then
+ do iel = 1, ncel
+ drtp(iel) = (rtp(iel,ipriph) -rtpa(iel,ipriph)) &
+ /relaxv(ipriph)
+ enddo
+ else
+ do iel = 1, ncel
+ drtp(iel) = rtp(iel,ipriph) -rtpa(iel,ipriph)
+ enddo
+ endif
+
+! ---> TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) call parcom (drtp)
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ drtp , drtp , drtp , &
+ drtp , drtp , drtp , &
+ drtp , drtp , drtp )
+ endif
+
+
+ iccocg = 1
+ inc = 0
+ if (iphydr.eq.1) inc = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+ extrap = extrag(ipriph)
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipriph , imrgra , inc , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ drtp , coefa(1,iclipf) , coefb(1,iclipr) , &
+ trav(1,1) , trav(1,2) , trav(1,3) , &
+! --------- --------- ---------
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+! REACTUALISATION DU CHAMP DE VITESSES
+
+ thetap = thetav(ipriph)
+ if (iphydr.eq.0) then
+ if (idtsca.eq.0) then
+ do iel = 1, ncel
+ dtsrom = -thetap*dt(iel)/propce(iel,ipcrom)
+ rtp(iel,iuiph) = rtp(iel,iuiph)+dtsrom*trav(iel,1)
+ rtp(iel,iviph) = rtp(iel,iviph)+dtsrom*trav(iel,2)
+ rtp(iel,iwiph) = rtp(iel,iwiph)+dtsrom*trav(iel,3)
+ enddo
+ else
+ do iel = 1, ncel
+ unsrom = -thetap/propce(iel,ipcrom)
+ iii = itpuco-1+iel
+ rtp(iel,iuiph) = rtp(iel,iuiph) &
+ +unsrom*ra(iii )*trav(iel,1)
+ rtp(iel,iviph) = rtp(iel,iviph) &
+ +unsrom*ra(iii+ncelet )*trav(iel,2)
+ rtp(iel,iwiph) = rtp(iel,iwiph) &
+ +unsrom*ra(iii+2*ncelet)*trav(iel,3)
+ enddo
+ endif
+ else
+ if (idtsca.eq.0) then
+ do iel = 1, ncel
+ dtsrom = thetap*dt(iel)/propce(iel,ipcrom)
+ rtp(iel,iuiph) = rtp(iel,iuiph) &
+ +dtsrom*(dfrcxt(iel,1,iphas)-trav(iel,1) )
+ rtp(iel,iviph) = rtp(iel,iviph) &
+ +dtsrom*(dfrcxt(iel,2,iphas)-trav(iel,2) )
+ rtp(iel,iwiph) = rtp(iel,iwiph) &
+ +dtsrom*(dfrcxt(iel,3,iphas)-trav(iel,3) )
+ enddo
+ else
+ do iel = 1, ncel
+ unsrom = thetap/propce(iel,ipcrom)
+ iii = itpuco-1+iel
+ rtp(iel,iuiph) = rtp(iel,iuiph) &
+ +unsrom*ra(iii ) &
+ *(dfrcxt(iel,1,iphas)-trav(iel,1) )
+ rtp(iel,iviph) = rtp(iel,iviph) &
+ +unsrom*ra(iii+ncelet ) &
+ *(dfrcxt(iel,2,iphas)-trav(iel,2) )
+ rtp(iel,iwiph) = rtp(iel,iwiph) &
+ +unsrom*ra(iii+2*ncelet) &
+ *(dfrcxt(iel,3,iphas)-trav(iel,3) )
+ enddo
+ endif
+! mise a jour des forces exterieures pour le calcul des gradients
+ do iel=1,ncel
+ frcxt(iel,1,iphas) = frcxt(iel,1,iphas) &
+ + dfrcxt(iel,1,iphas)
+ frcxt(iel,2,iphas) = frcxt(iel,2,iphas) &
+ + dfrcxt(iel,2,iphas)
+ frcxt(iel,3,iphas) = frcxt(iel,3,iphas) &
+ + dfrcxt(iel,3,iphas)
+ enddo
+ if(irangp.ge.0) then
+ call parcom (frcxt(1,1,iphas))
+ !==========
+ call parcom (frcxt(1,2,iphas))
+ !==========
+ call parcom (frcxt(1,3,iphas))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ frcxt(1,1,iphas),frcxt(1,1,iphas),frcxt(1,1,iphas), &
+ frcxt(1,2,iphas),frcxt(1,2,iphas),frcxt(1,2,iphas), &
+ frcxt(1,3,iphas),frcxt(1,3,iphas),frcxt(1,3,iphas) )
+ endif
+! mise a jour des Dirichlets de pression en sortie dans COEFA
+ iclipr = iclrtp(ipriph,icoef)
+ iclipf = iclrtp(ipriph,icoeff)
+ do ifac = 1,nfabor
+ if (isostd(ifac,iphas).eq.1) &
+ coefa(ifac,iclipr) = coefa(ifac,iclipr) &
+ + coefa(ifac,iclipf)
+ enddo
+ endif
+
+ endif
+
+enddo
+
+
+! Ajout de la vitesse de maillage dans le flux convectif en ALE
+if (iale.eq.1) then
+
+ icluma = iclrtp(iuma ,icoef)
+ iclvma = iclrtp(ivma ,icoef)
+ iclwma = iclrtp(iwma ,icoef)
+
+! On change de signe car on veut l'oppose de la vitesse de maillage
+! aux faces
+ do iel = 1, ncelet
+ rtp(iel,iuma) = -rtp(iel,iuma)
+ rtp(iel,ivma) = -rtp(iel,ivma)
+ rtp(iel,iwma) = -rtp(iel,iwma)
+ enddo
+ do ifac = 1, nfabor
+ coefa(ifac,icluma) = -coefa(ifac,icluma)
+ coefa(ifac,iclvma) = -coefa(ifac,iclvma)
+ coefa(ifac,iclwma) = -coefa(ifac,iclwma)
+ enddo
+
+! One temporary array needed for internal faces, in case some internal vertices
+! are moved directly by the user
+ iflint = idebra
+ ifinra = iflint + nfac
+
+ CALL RASIZE('NAVSTO',IFINRA)
+ !==========
+
+ do iphas = 1, nphas
+
+ iflmas = ipprof(ifluma(iu(iphas)))
+ iflmab = ipprob(ifluma(iu(iphas)))
+ ipcrom = ipproc(irom (iphas))
+ ipbrom = ipprob(irom (iphas))
+
+ init = 0
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ nswrgp = nswrgr(iuma )
+ imligp = imligr(iuma )
+ iwarnp = iwarni(iuma )
+ epsrgp = epsrgr(iuma )
+ climgp = climgr(iuma )
+ extrap = extrag(iuma )
+
+ iph = iphas
+
+ imaspe = 1
+
+ do ifac = 1, nfac
+ ra(iflint+ifac-1) = 0.d0
+ enddo
+
+ call inimas &
+ !==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iph , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ rtp(1,iuma ) , rtp(1,ivma ) , rtp(1,iwma) , &
+ coefa(1,icluma), coefa(1,iclvma), coefa(1,iclwma), &
+ coefb(1,icluma), coefb(1,iclvma), coefb(1,iclwma), &
+ ra(iflint) , propfb(1,iflmab) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+ enddo
+
+ do iel = 1, ncelet
+ rtp(iel,iuma) = -rtp(iel,iuma)
+ rtp(iel,ivma) = -rtp(iel,ivma)
+ rtp(iel,iwma) = -rtp(iel,iwma)
+ enddo
+ do ifac = 1, nfabor
+ coefa(ifac,icluma) = -coefa(ifac,icluma)
+ coefa(ifac,iclvma) = -coefa(ifac,iclvma)
+ coefa(ifac,iclwma) = -coefa(ifac,iclwma)
+ enddo
+
+ do ifac = 1, nfac
+ iecrw = 0
+ ddepx = 0.d0
+ ddepy = 0.d0
+ ddepz = 0.d0
+ icpt = 0
+ do ii = ipnfac(ifac),ipnfac(ifac+1)-1
+ inod = nodfac(ii)
+ if (ia(iimpal+inod-1).eq.0) iecrw = iecrw + 1
+ icpt = icpt + 1
+ ddepx = ddepx + ra(idepal +inod-1) &
+ +ra(ixyzn0+(inod-1)*ndim )-xyznod(1,inod)
+ ddepy = ddepy + ra(idepal+nnod +inod-1) &
+ +ra(ixyzn0+(inod-1)*ndim+1)-xyznod(2,inod)
+ ddepz = ddepz + ra(idepal+2*nnod+inod-1) &
+ +ra(ixyzn0+(inod-1)*ndim+2)-xyznod(3,inod)
+ enddo
+! If all the face vertices have imposed displacement, w is evaluated from
+! this displacement
+ if (iecrw.eq.0) then
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+ dtfac = 0.5d0*(dt(iel1) + dt(iel2))
+ rhofac = 0.5d0*(propce(iel1,ipcrom) + propce(iel2,ipcrom))
+ propfa(ifac,iflmas) = propfa(ifac,iflmas) - rhofac*( &
+ ddepx*surfac(1,ifac) &
+ +ddepy*surfac(2,ifac) &
+ +ddepz*surfac(3,ifac) )/dtfac/icpt
+! Else w is calculated from the cell-centre mesh velocity
+ else
+ propfa(ifac,iflmas) = propfa(ifac,iflmas) &
+ + ra(iflint+ifac-1)
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 5. CALCUL D'UN ESTIMATEUR D'ERREUR DE L'ETAPE DE CORRECTION ET TOTAL
+!===============================================================================
+
+
+do iphas = 1, nphas
+
+ if(iescal(iescor,iphas).gt.0.or.iescal(iestot,iphas).gt.0) then
+
+! ---> REPERAGE DES VARIABLES
+
+ ipriph = ipr(iphas)
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+
+ icliup = iclrtp(iuiph ,icoef)
+ iclivp = iclrtp(iviph ,icoef)
+ icliwp = iclrtp(iwiph ,icoef)
+
+ ipcrom = ipproc(irom (iphas))
+ ipbrom = ipprob(irom (iphas))
+ iismph = iisymp+nfabor*(iphas-1)
+
+
+
+! ---> ECHANGE DES VITESSES ET PRESSION EN PERIODICITE ET PARALLELISME
+
+! Pour les estimateurs IESCOR et IESTOT, la vitesse doit etre echangee.
+
+! Pour l'estimateur IESTOT, la pression doit etre echangee aussi.
+
+! Cela ne remplace pas l'echange du debut de pas de temps
+! a cause de usproj qui vient plus tard et des calculs suite)
+
+
+! --- Vitesse
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,iuiph ))
+ !==========
+ call parcom (rtp(1,iviph ))
+ !==========
+ call parcom (rtp(1,iwiph ))
+ !==========
+ endif
+
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iuiph), rtp(1,iuiph), rtp(1,iuiph), &
+ rtp(1,iviph), rtp(1,iviph), rtp(1,iviph), &
+ rtp(1,iwiph), rtp(1,iwiph), rtp(1,iwiph))
+ endif
+
+
+! -- Pression
+
+ if(iescal(iestot,iphas).gt.0) then
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,ipriph))
+ !==========
+ endif
+
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ipriph), rtp(1,ipriph), rtp(1,ipriph), &
+ rtp(1,ipriph), rtp(1,ipriph), rtp(1,ipriph), &
+ rtp(1,ipriph), rtp(1,ipriph), rtp(1,ipriph))
+ endif
+
+ endif
+
+
+! ---> CALCUL DU FLUX DE MASSE DEDUIT DE LA VITESSE REACTUALISEE
+
+ init = 1
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ if (iale.eq.1) iflmb0 = 0
+ nswrgp = nswrgr(iuiph )
+ imligp = imligr(iuiph )
+ iwarnp = iwarni(iuiph )
+ epsrgp = epsrgr(iuiph )
+ climgp = climgr(iuiph )
+ extrap = extrag(iuiph )
+
+ iph = iphas
+
+ imaspe = 1
+
+ call inimas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iph , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ coefa(1,icliup), coefa(1,iclivp), coefa(1,icliwp), &
+ coefb(1,icliup), coefb(1,iclivp), coefb(1,icliwp), &
+ esflum , esflub , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+
+! ---> CALCUL DE L'ESTIMATEUR CORRECTION : DIVERGENCE DE ROM * U (N + 1)
+! - GAMMA
+
+ if(iescal(iescor,iphas).gt.0) then
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,esflum,esflub,w1)
+
+ if (ncetsm(iphas).gt.0) then
+ igamm1 = ismace(iphas)+(ipriph-1)*ncetsm(iphas)-1
+ do iitsm = 1, ncetsm(iphas)
+ iel = ia(iicesm(iphas)+iitsm-1)
+ w1(iel) = w1(iel)-volume(iel)*ra(igamm1+iitsm)
+ enddo
+ endif
+
+ if(iescal(iescor,iphas).eq.2) then
+ iescop = ipproc(iestim(iescor,iphas))
+ do iel = 1, ncel
+ propce(iel,iescop) = abs(w1(iel))
+ enddo
+ elseif(iescal(iescor,iphas).eq.1) then
+ iescop = ipproc(iestim(iescor,iphas))
+ do iel = 1, ncel
+ propce(iel,iescop) = abs(w1(iel)) / volume(iel)
+ enddo
+ endif
+ endif
+
+
+! ---> CALCUL DE L'ESTIMATEUR TOTAL
+
+ if(iescal(iestot,iphas).gt.0) then
+
+! INITIALISATION DE TRAV AVEC LE TERME INSTATIONNAIRE
+
+ do iel = 1, ncel
+ trav(iel,1) = propce(iel,ipcrom) * volume(iel) * &
+ ( rtpa(iel,iuiph)- rtp(iel,iuiph) )/dt(iel)
+ trav(iel,2) = propce(iel,ipcrom) * volume(iel) * &
+ ( rtpa(iel,iviph)- rtp(iel,iviph) )/dt(iel)
+ trav(iel,3) = propce(iel,ipcrom) * volume(iel) * &
+ ( rtpa(iel,iwiph)- rtp(iel,iwiph) )/dt(iel)
+ enddo
+
+! APPEL A PREDUV AVEC RTP ET RTP AU LIEU DE RTP ET RTPA
+! AVEC LE FLUX DE MASSE RECALCULE
+ iappel = 2
+ iph = iphas
+ call preduv &
+ !==========
+ ( idebia , idebra , iappel , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iterns , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , &
+ ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtp , propce , propfa , propfb , &
+ esflum , esflub , &
+ tslagr , coefa , coefb , &
+ ra(ickupd(iphas)) , ra(ismace(iphas)) , frcxt , &
+ trava , ximpa , uvwk , dfrcxt , ra(itpuco) , trav , &
+ viscf , viscb , viscfi , viscbi , &
+ dam , xam , &
+ drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , coefu , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 6. TRAITEMENT DU POINT FIXE SUR LE SYSTEME VITESSE/PRESSION
+!===============================================================================
+
+if(nterup.gt.1) then
+! TEST DE CONVERGENCE DE L'ALGORITHME ITERATIF
+! On initialise ICVRGE a 1 et on le met a 0 si une des phases n'est
+! pas convergee
+
+ icvrge = 1
+
+ do iphas = 1,nphas
+ xnrmu(iphas) = 0.d0
+ do iel = 1,ncel
+ xdu = rtp(iel,iuiph) - uvwk(iel,1,iphas)
+ xdv = rtp(iel,iviph) - uvwk(iel,2,iphas)
+ xdw = rtp(iel,iwiph) - uvwk(iel,3,iphas)
+ xnrmu(iphas) = xnrmu(iphas) +(xdu**2 + xdv**2 + xdw**2) &
+ * volume(iel)
+ enddo
+! ---> TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) call parsom (xnrmu(iphas))
+ !==========
+! -- > TRAITEMENT DU COUPLAGE ENTRE DEUX INSTANCES DE CODE_SATURNE
+ do numcpl = 1, nbrcpl
+ call tbrcpl ( numcpl, 1, 1, xnrmu(iphas), xnrdis )
+ !==========
+ xnrmu(iphas) = xnrmu(iphas) + xnrdis
+ enddo
+ xnrmu(iphas) = sqrt(xnrmu(iphas))
+
+! Indicateur de convergence du point fixe
+ if(xnrmu(iphas).ge.epsup(iphas)*xnrmu0(iphas)) icvrge = 0
+
+ enddo
+
+
+endif
+
+! ---> RECALAGE DE LA PRESSION SUR UNE PRESSION A MOYENNE NULLE
+! On recale si on n'a pas de Dirichlet. Or le nombre de Dirichlets
+! calcule dans typecl.F est NDIRCL si IDIRCL=1 et NDIRCL-1 si IDIRCL=0
+! (ISTAT vaut toujours 0 pour la pression)
+
+do iphas = 1, nphas
+ ipriph = ipr(iphas)
+ if (idircl(ipr(iphas)).eq.1) then
+ ndircp = ndircl(ipr(iphas))
+ else
+ ndircp = ndircl(ipr(iphas))-1
+ endif
+ if(ndircp.le.0) then
+ call prmoy0 &
+ !==========
+ ( idebia , idebra , &
+ ncelet , ncel , nfac , nfabor , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , idevel , ituser , ia , &
+ volume , rtp(1,ipriph) , &
+ rdevel , rtuser , ra )
+ endif
+
+! Calcul de la pression totale IPRTOT : (definie comme propriete )
+! En compressible, la pression resolue est deja la pression totale
+
+ if (ippmod(icompf).lt.0) then
+ ro0iph = ro0 (iphas)
+ p0iph = p0 (iphas)
+ pr0iph = pred0(iphas)
+ xxp0 = xyzp0(1,iphas)
+ xyp0 = xyzp0(2,iphas)
+ xzp0 = xyzp0(3,iphas)
+ do iel=1,ncel
+ propce(iel,ipproc(iprtot(iphas)))= rtp(iel,ipr(iphas)) &
+ + ro0iph*( gx*(xyzcen(1,iel)-xxp0) &
+ + gy*(xyzcen(2,iel)-xyp0) &
+ + gz*(xyzcen(3,iel)-xzp0) ) &
+ + p0iph - pr0iph
+ enddo
+ endif
+
+
+enddo
+
+!===============================================================================
+! 7. IMPRESSIONS
+!===============================================================================
+
+do iphas = 1, nphas
+
+ ipriph = ipr(iphas)
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ ipcrom = ipproc(irom (iphas))
+ ipbrom = ipprob(irom (iphas))
+
+ if (iwarni(iuiph).ge.1) then
+
+ write(nfecra,2000)iphas
+
+ rnorm = -1.d0
+ do iel = 1, ncel
+ rnorm = max(rnorm,abs(rtp(iel,ipriph)))
+ enddo
+ if (irangp.ge.0) call parmax (rnorm)
+ !==========
+ write(nfecra,2100)rnorm
+
+ rnorm = -1.d0
+ do iel = 1, ncel
+ vitnor = &
+ sqrt(rtp(iel,iuiph)**2+rtp(iel,iviph)**2+rtp(iel,iwiph)**2)
+ if(vitnor.ge.rnorm) then
+ rnorm = vitnor
+ imax = iel
+ endif
+ enddo
+
+ xyzmax(1) = xyzcen(1,imax)
+ xyzmax(2) = xyzcen(2,imax)
+ xyzmax(3) = xyzcen(3,imax)
+
+ if (irangp.ge.0) then
+ nbrval = 3
+ call parmxl (nbrval, rnorm, xyzmax)
+ !==========
+ endif
+ !==========
+
+ write(nfecra,2200) rnorm,xyzmax(1),xyzmax(2),xyzmax(3)
+
+
+! Pour la periodicite et le parallelisme, rom est echange dans phyvar
+
+
+ rnorma = -grand
+ rnormi = grand
+ do ifac = 1, nfac
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+ surf = ra(isrfan-1+ifac)
+ rhom = (propce(iel1,ipcrom)+propce(iel2,ipcrom))*0.5d0
+ rnorm = propfa(ifac,iflmas)/(surf*rhom)
+ rnorma = max(rnorma,rnorm)
+ rnormi = min(rnormi,rnorm)
+ enddo
+ if (irangp.ge.0) then
+ call parmax (rnorma)
+ !==========
+ call parmin (rnormi)
+ !==========
+ endif
+ write(nfecra,2300)rnorma, rnormi
+
+ rnorma = -grand
+ rnormi = grand
+ do ifac = 1, nfabor
+ rnorm = propfb(ifac,iflmab)/ &
+ (ra(isrfbn-1+ifac)*propfb(ifac,ipbrom))
+ rnorma = max(rnorma,rnorm)
+ rnormi = min(rnormi,rnorm)
+ enddo
+ if (irangp.ge.0) then
+ call parmax (rnorma)
+ !==========
+ call parmin (rnormi)
+ !==========
+ endif
+ write(nfecra,2400)rnorma, rnormi
+
+ rnorm = 0.d0
+ do ifac = 1, nfabor
+ rnorm = rnorm + propfb(ifac,iflmab)
+ enddo
+
+ if (irangp.ge.0) call parsom (rnorm)
+ !==========
+
+ write(nfecra,2500)rnorm
+
+ write(nfecra,2001)
+
+ if(nterup.gt.1) then
+ if(icvrge.eq.0) then
+ write(nfecra,2600) iterns
+ write(nfecra,2601) xnrmu(iphas), &
+ xnrmu0(iphas), epsup(iphas)
+ write(nfecra,2001)
+ if(iterns.eq.nterup) then
+ write(nfecra,2603)
+ write(nfecra,2001)
+ endif
+ else
+ write(nfecra,2602) iterns
+ write(nfecra,2601) xnrmu(iphas), &
+ xnrmu0(iphas), epsup(iphas)
+ write(nfecra,2001)
+ endif
+ endif
+
+ endif
+
+enddo
+
+!--------
+! FORMATS
+!--------
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ** RESOLUTION POUR LA VITESSE ',/,&
+' -------------------------- ',/)
+ 1200 format(/, &
+' ** RESOLUTION POUR LA PRESSION CONTINUITE ',/,&
+' -------------------------------------- ',/)
+ 2000 format(/,' APRES PRESSION CONTINUITE',/, &
+' -- Phase : ',I10 ,/,&
+'-------------------------------------------------------------' )
+ 2100 format( &
+' Pression max.',E12.4 ,' (max. de la valeur absolue) ',/)
+ 2200 format( &
+' Vitesse max.',E12.4 ,' en',3E11.3 ,/)
+ 2300 format( &
+' Vitesse en face interne max.',E12.4 ,' ; min.',E12.4 )
+ 2400 format( &
+' Vitesse en face de bord max.',E12.4 ,' ; min.',E12.4 )
+ 2500 format( &
+' Bilan de masse au bord ',E14.6 )
+ 2600 format( &
+' Informations Point fixe a l''iteration :',I10 ,/)
+ 2601 format('norme = ',E12.4,' norme 0 = ',E12.4,' toler = ',E12.4 ,/)
+ 2602 format( &
+' Convergence du point fixe a l''iteration ',I10 ,/)
+ 2603 format( &
+' Non convergence du couplage vitesse pression par point fixe ' )
+ 2001 format( &
+'-------------------------------------------------------------',/)
+
+#else
+
+ 1000 format(/, &
+' ** SOLVING VELOCITY' ,/,&
+' ----------------' ,/)
+ 1200 format(/, &
+' ** SOLVING CONTINUITY PRESSURE' ,/,&
+' ---------------------------' ,/)
+ 2000 format(/,' AFTER CONTINUITY PRESSURE',/, &
+' -- Phase : ',I10 ,/,&
+'-------------------------------------------------------------' )
+ 2100 format( &
+' Max. pressure',E12.4 ,' (max. absolute value)' ,/)
+ 2200 format( &
+' Max. velocity',E12.4 ,' en',3E11.3 ,/)
+ 2300 format( &
+' Max. velocity at interior face',E12.4 ,' ; min.',E12.4 )
+ 2400 format( &
+' Max. velocity at boundary face',E12.4 ,' ; min.',E12.4 )
+ 2500 format( &
+' Mass balance at boundary ',E14.6 )
+ 2600 format( &
+' Fixed point informations at iteration:',I10 ,/)
+ 2601 format('norm = ',E12.4,' norm 0 = ',E12.4,' toler = ',E12.4 ,/)
+ 2602 format( &
+' Fixed point convergence at iteration ',I10 ,/)
+ 2603 format( &
+' Non convergence of fixed point for velocity pressure coupling' )
+ 2001 format( &
+'-------------------------------------------------------------',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/newmrk.f90 b/src/base/newmrk.f90
new file mode 100644
index 0000000..16d2c6d
--- /dev/null
+++ b/src/base/newmrk.f90
@@ -0,0 +1,223 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine newmrk &
+!================
+
+ (istr , alpnmk, betnmk, gamnmk, &
+ xm , xc , xk , xn0 , xn , xpn , xppn , xnm1 , &
+ xpnm1 , xppnm1, xfn , xfnm1 , dt )
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION PAR LA METHODE DE NEWMARK HHT D'UNE EQUATION
+! DIFFERENTIELLE LINEAIRE DE SECOND ORDRE DU TYPE
+
+! M.X'' + C.X' + K.(X+X0) = F
+
+! X EST UN CHAMP DE VECTEUR TRIDIMENSIONNEL ET M, C ET K
+! SONT DES MATRICES 3x3 QUELCONQUES
+
+! LA RESOLUTION EST FAITE EN DEPLACEMENT
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! istr ! e ! <-- ! numero de structure !
+! xm(3,3) ! tr ! <-- ! matrice de masse du systeme !
+! xc(3,3) ! tr ! <-- ! matrice de friction du systeme !
+! xk(3,3) ! tr ! <-- ! matrice de raideur du systeme !
+! xn0(3) ! tr ! <-- ! champ de deplacement initial !
+! xn(3) ! tr ! --> ! champ de deplacement au temps n !
+! xnm1(3) ! tr ! <-- ! champ de deplacement au temps n-1 !
+! xpn(3) ! tr ! --> ! champ de vitesse au temps n !
+! xpnm1(3) ! tr ! <-- ! champ de vitesse au temps n-1 !
+! xppn(3) ! tr ! --> ! champ d'acceleration au temps n !
+! xppnm1(3) ! tr ! <-- ! champ d'acceleration au temps n-1 !
+! xftld(3) ! tr ! <-- ! champ de force au temps intermediaire !
+! dt ! r ! <-- ! pas de temps !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer istr
+
+double precision alpnmk, betnmk, gamnmk
+double precision xm(3,3),xc(3,3),xk(3,3)
+double precision xn0(3),xn(3),xpn(3),xppn(3)
+double precision xnm1(3),xpnm1(3),xppnm1(3)
+double precision xfn(3),xfnm1(3)
+double precision dt
+
+! VARIABLES LOCALES
+
+integer ii, jj
+
+double precision a(3,3), b1(3), b2(3), b(3)
+double precision a0, a1, a2, a3, a4, a5, a6, a7
+double precision det, det1, det2, det3, epsdet
+
+!===============================================================================
+
+! Critere de nullite du determinant
+epsdet = 1.d-12
+
+! Ceofficients des equations
+a0 = 1.d0/betnmk/dt**2
+a1 = (1.d0+alpnmk)*gamnmk/betnmk/dt
+a2 = 1.d0/betnmk/dt
+a3 = 1.d0/2.d0/betnmk - 1.d0
+a4 = (1.d0+alpnmk)*gamnmk/betnmk - 1.d0
+a5 = (1.d0+alpnmk)*dt*(gamnmk/2.d0/betnmk - 1.d0)
+a6 = dt*(1.d0 - gamnmk)
+a7 = gamnmk*dt
+
+do ii = 1, 3
+ do jj = 1, 3
+ a(ii,jj) = (1.d0+alpnmk)*xk(ii,jj) &
+ + a1*xc(ii,jj) + a0*xm(ii,jj)
+ enddo
+ b(ii) = (1.d0+alpnmk)*xfn(ii) - alpnmk*xfnm1(ii)
+ b1(ii) = a0*xnm1(ii) + a2*xpnm1(ii) + a3*xppnm1(ii)
+ b2(ii) = a1*xnm1(ii) + a4*xpnm1(ii) + a5*xppnm1(ii)
+enddo
+
+do ii = 1, 3
+ do jj = 1, 3
+ b(ii) = b(ii) &
+ + xm(ii,jj)*b1(jj) + xc(ii,jj)*b2(jj) &
+ + xk(ii,jj)*( alpnmk*xnm1(jj) + xn0(jj) )
+ enddo
+enddo
+
+det = a(1,1)*a(2,2)*a(3,3) &
+ + a(2,1)*a(3,2)*a(1,3) &
+ + a(3,1)*a(1,2)*a(2,3) &
+ - a(3,1)*a(2,2)*a(1,3) &
+ - a(2,1)*a(1,2)*a(3,3) &
+ - a(1,1)*a(3,2)*a(2,3)
+
+if (dabs(det).lt.epsdet) then
+ write(nfecra,1000) istr,dabs(det),epsdet
+ ntmabs = ntcabs
+endif
+
+det1 = b(1)*a(2,2)*a(3,3) &
+ + b(2)*a(3,2)*a(1,3) &
+ + b(3)*a(1,2)*a(2,3) &
+ - b(3)*a(2,2)*a(1,3) &
+ - b(2)*a(1,2)*a(3,3) &
+ - b(1)*a(3,2)*a(2,3)
+
+det2 = a(1,1)*b(2)*a(3,3) &
+ + a(2,1)*b(3)*a(1,3) &
+ + a(3,1)*b(1)*a(2,3) &
+ - a(3,1)*b(2)*a(1,3) &
+ - a(2,1)*b(1)*a(3,3) &
+ - a(1,1)*b(3)*a(2,3)
+
+det3 = a(1,1)*a(2,2)*b(3) &
+ + a(2,1)*a(3,2)*b(1) &
+ + a(3,1)*a(1,2)*b(2) &
+ - a(3,1)*a(2,2)*b(1) &
+ - a(2,1)*a(1,2)*b(3) &
+ - a(1,1)*a(3,2)*b(2)
+
+xn(1) = det1/det
+xn(2) = det2/det
+xn(3) = det3/det
+
+do ii = 1, 3
+ xppn(ii) = a0*(xn(ii)-xnm1(ii)) - a2*xpnm1(ii) - a3*xppnm1(ii)
+ xpn(ii) = xpnm1(ii) + a6*xppnm1(ii) + a7*xppn(ii)
+enddo
+
+!----
+! FORMATS
+!----
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format ( &
+'@ ',/,&
+'@ @@ ATTENTION : DEPLACEMENT DE STRUCTURES INTERNES ALE ',/,&
+'@ ========= ',/,&
+'@ Structure : ',I10 ,/,&
+'@ La valeur absolue du determinant de la matrice de ',/,&
+'@ deplacement vaut : ',E14.5 ,/,&
+'@ La matrice est consideree comme non inversible ',/,&
+'@ (valeur limite fixee a ',E14.5 ,') ',/,&
+'@ ',/,&
+'@ Arret du calcul ',/,&
+'@ ' )
+
+#else
+
+ 1000 format ( &
+'@ ',/,&
+'@ @@ WARNING: ALE DISPLACEMENT OF INTERNAL STRUCTURES ',/,&
+'@ ======== ',/,&
+'@ Structure: ',I10 ,/,&
+'@ The absolute value of the discriminant of the ',/,&
+'@ displacement matrix is: ',E14.5 ,/,&
+'@ The matrix is considered to be not inversible ',/,&
+'@ (limit value fixed to ',E14.5 ,') ',/,&
+'@ ',/,&
+'@ Calculation abort ',/,&
+'@ ' )
+
+#endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/numvec.f90 b/src/base/numvec.f90
new file mode 100644
index 0000000..56c651b
--- /dev/null
+++ b/src/base/numvec.f90
@@ -0,0 +1,562 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine numvec &
+!================
+
+ ( ncelet , ncel , nfac , nfabor , &
+ lregis , irveci , irvecb , &
+ ifacel , ifabor , &
+ inumfi , inumfb , iworkf , ismbs )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! CALCUL D UNE TABLE DE RENUMEROTATION DES FACES INTERNES ET DE BORD
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac /nfabor ! e ! <-- ! nombre total de faces internes/de brd !
+! lregis ! e ! --> ! longueur de registre vectoriel !
+! irveci ! e ! --> ! indicateur vectorisation face intern !
+! irvecb ! e ! --> ! indicateur vectorisation face bord !
+! ifacel ! te ! <-- ! no des elts voisins d'une face intern !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! no de l'elt voisin d'une face de bord !
+! nfabor ) ! ! ! !
+! inumfi(nfac) ! te ! --- ! table de renum des faces internes !
+! inumfb(nfabor ! te ! --- ! table de renum des faces de bord !
+! iworkf(* ! te ! --- ! tab de trav de dim max(nfac,nfabor) !
+! ismbs (ncelet ! te ! --- ! tab de trav pour assemblage scalaire !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "vector.h"
+include "entsor.h"
+
+! Arguments
+
+integer ncelet, ncel, nfac, nfabor
+integer lregis, irveci, irvecb
+integer ifacel(2,nfac),ifabor(nfabor)
+integer inumfi(nfac), inumfb(nfabor)
+integer iworkf(*), ismbs(ncelet)
+
+! VARIABLES LOCALES
+
+integer irelii, nregii, irelib, nregib
+integer iloop, imodav, iregip, iregic, jregic
+integer ilast, inext
+integer iiech
+integer ii, jj, iok, ifac, ifac1, nfanp1
+integer ibloc, iel, ireg, ilig, nfamax, itmp
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. SORTIE IMMEDIATE SI L'ON N'A PAS UN CALCULATEUR VECTORIEL
+!===============================================================================
+
+if (lregis .eq. 1) then
+ ivecti = 0
+ ivectb = 0
+ irveci = 0
+ irvecb = 0
+ return
+endif
+
+!===============================================================================
+! 2. INITIALISATIONS COMMUNES
+!===============================================================================
+
+! --- Numerotation
+do ifac = 1, nfac
+ inumfi(ifac) = ifac
+enddo
+do ifac = 1, nfabor
+ inumfb(ifac) = ifac
+enddo
+
+
+!===============================================================================
+! 3. RANGEMENT DES FACES INTERNES
+! (pour le raisonnement, on place le reliquat a la fin)
+!===============================================================================
+
+! --- Si l'utilisateur a indique IVECTI = 0, il ne souhaite pas
+! vectoriser, sinon, IVECTI a ete initialise a -1
+
+if(ivecti.eq.0) goto 400
+
+! --- Indicateur de vectorisation possible = 1
+ivecti = 0
+
+! --- Determination du reliquat et du nbre de registres complets
+irelii = mod(nfac,lregis)
+nregii = nfac/lregis
+
+! --- Compteur de boucles
+iloop = 0
+
+! --- Debut de la boucle externe
+ 100 continue
+iloop = iloop + 1
+
+! --- IMODAV = 1 si on a echange un element et un element precedent
+! dans la table INUMFI
+imodav = 0
+
+! --- Registre precedent
+
+iregic = 0
+
+! --- On parcourt les elements de INUMFI
+
+do jj = 1, nfac
+
+! --- Registre courant et position dans le registre
+ iregip = iregic
+ iregic = (jj-1)/lregis+1
+ jregic = mod(jj-1,lregis)+1
+
+! --- On teste entre ILAST, debut du registre,
+! et la position courante
+
+! En prenant le cas le plus penalisant entre
+! reliquat au debut et reliquat a la fin : reliquat au debut :
+
+ if(iregic.eq.1) then
+ ilast = 1
+ elseif (jregic.le.irelii) then
+ ilast = (iregic-2)*lregis+irelii+1
+ else
+ ilast = (iregic-1)*lregis+1
+ endif
+
+! Avec reliquat a la fin :
+
+! ILAST = (IREGIC-1)*LREGIS+1
+
+! --- On echange a partir de INEXT, debut du registre suivant
+
+! En prenant le cas le plus penalisant entre reliquat au debut et
+! reliquat a la fin : reliquat au debut :
+
+ if ((iregic.eq.nregii.and.jregic.gt.irelii).or. &
+ (iregic.eq.nregii+1) ) then
+ inext = 1
+ elseif (jregic.gt.irelii) then
+ inext = iregic*lregis+irelii+1
+ else
+ inext = iregic*lregis+1
+ endif
+
+! Sinon, reliquat a la fin :
+
+! IF ((IREGIC.EQ.NREGII.AND.IRELII.EQ.0) .OR.
+! & IREGIC.EQ.NREGII+1 ) THEN
+! INEXT = 1
+! ELSE
+! INEXT = IREGIC*LREGIS+1
+! ENDIF
+
+ if(iregic.ne.iregip) iiech = inext-1
+
+! --- Compteur pour ne pas echanger avec tous les elements de INUMFI
+! plus de n fois
+ ibloc = 0
+
+
+! --- Test avec tous les elements precedents depuis ILAST
+! IIECH indique avec quel element de INUMFI on echange
+! IMODAV indique qu'on modifie un element deja vu
+! IBLOC indique qu'on a vu tous les elements et qu'il faut
+! melanger (il n'y a pas de solution)
+
+ 200 continue
+
+ ifac = inumfi(jj)
+ do ii = ilast, jj-1
+
+ if ( (ifacel(1,inumfi(ii)).eq.ifacel(1,ifac)).or. &
+ (ifacel(2,inumfi(ii)).eq.ifacel(2,ifac)) ) then
+
+ iiech = iiech+1
+
+ if(iiech.gt.nfac) then
+ iiech = 1
+ ibloc = ibloc + 1
+ endif
+ if (iiech.lt.jj) imodav = 1
+ if (ibloc.ge.2) then
+ ibloc = -1
+ goto 450
+ endif
+
+ itmp = inumfi(iiech )
+ inumfi(iiech ) = inumfi(jj )
+ inumfi(jj ) = itmp
+
+ goto 200
+ endif
+ enddo
+enddo
+
+! --- Si on n'a pas touche aux elements precedant le courant,
+! ca a marche
+if(imodav.eq.0) then
+ ivecti = 1
+ goto 400
+endif
+
+! --- On melange s'il n'y a pas de solution ou si on a boucle 10 fois
+ 450 continue
+if (iloop.le.100.and.(mod(iloop,10).eq.0.or.ibloc.eq.-1)) then
+ do ii = 1, (nfac-4)/2, 2
+ jj = nfac-ii+1
+ itmp = inumfi(ii )
+ inumfi(ii ) = inumfi(jj )
+ inumfi(jj ) = itmp
+ enddo
+endif
+
+
+! --- Et on recommence
+if(iloop.le.100) goto 100
+
+ 400 continue
+
+!===============================================================================
+! 4. RANGEMENT DES FACES DE BORD
+!===============================================================================
+
+! --- Si l'utilisateur a indique IVECTB = 0, il ne souhaite pas
+! vectoriser, sinon, IVECTB a ete initialise a -1
+
+if(ivectb.eq.0) goto 900
+
+! --- Indicateur de vectorisation possible = 1
+ivectb = 0
+
+! --- Determination du reliquat et du nbre de registres complets
+irelib = mod(nfabor,lregis)
+nregib = nfabor/lregis
+
+! --- Nombre max de faces de bord
+! Si > NREGIB : il n'y a pas de solution
+do iel = 1, ncel
+ ismbs(iel) = 0
+enddo
+do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ ismbs(ii) = ismbs(ii) + 1
+enddo
+nfamax = 0
+nfanp1 = 0
+do iel = 1, ncel
+ nfamax = max(nfamax,ismbs(iel))
+ if(ismbs(iel).eq.nregib+1) nfanp1 = nfanp1 + 1
+enddo
+if ( nfamax.gt.nregib+1.or. &
+ (nfamax.eq.nregib+1.and.nfanp1.gt.irelib)) then
+ goto 900
+endif
+
+! --- On classe par nombre de faces de bord du voisin decroissant
+! et numero de voisin decroissant
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ifabor(ifac) = iel + ncel*ismbs(iel)
+enddo
+call ordita(nfabor,ifabor,iworkf)
+!==========
+do ifac = 1, nfabor
+ iel = mod(ifabor(ifac)-1,ncel)+1
+ ifabor(ifac) = ifabor(ifac) - ncel*ismbs(iel)
+enddo
+
+! --- On distribue les faces dans les registres
+do ifac = 1, nfabor
+ if(ifac.le.irelib*(nregib+1)) then
+ ireg=mod(ifac-1,nregib+1)+1
+ ilig=(ifac-1)/(nregib+1)+1
+ ii = (ireg-1)*lregis+ilig
+ else
+ ifac1 = ifac-irelib*(nregib+1)
+ ireg=mod(ifac1-1,nregib)+1
+ ilig=(ifac1-1)/nregib+1+irelib
+ ii = (ireg-1)*lregis+ilig
+ endif
+ inumfb(ii)=iworkf(ifac)
+enddo
+ivectb=1
+
+ 900 continue
+
+!===============================================================================
+! 5. VERIFICATIONS
+!===============================================================================
+
+! -----> Verif que toutes les faces se retrouvent une et une seule fois
+! dans INUMFB et INUMFI
+
+if(ivecti.eq.1) then
+
+ call ordita(nfac ,inumfi,iworkf)
+ !==========
+
+ iok = 0
+ do ii = 1, nfac
+ if(inumfi(iworkf(ii)).ne.nfac-ii+1) iok = iok - 1
+ enddo
+ if (iok.ne.0) then
+ write(nfecra,1100)iok,1101
+ ivecti = 0
+ endif
+
+endif
+
+if(ivectb.eq.1) then
+
+ call ordita(nfabor,inumfb,iworkf)
+ !==========
+
+ iok = 0
+ do ii = 1, nfabor
+ if(inumfb(iworkf(ii)).ne.nfabor-ii+1) iok = iok - 1
+ enddo
+ if (iok.ne.0) then
+ write(nfecra,1200)iok,1201
+ ivectb = 0
+ endif
+
+endif
+
+
+! -----> Test classique en balayant les faces precedentes
+
+! --- Faces internes
+
+if(ivecti.eq.1) then
+
+ iok = 0
+ do jj = 1, nfac
+
+! --- Registre courant et position dans le registre
+ iregic = (jj-1)/lregis+1
+ jregic = mod(jj-1,lregis)+1
+
+! --- On teste entre ILAST, debut du registre,
+! et la position courante
+
+! En prenant le cas le plus penalisant entre
+! reliquat au debut et reliquat a la fin : reliquat au debut :
+
+ if(iregic.eq.1) then
+ ilast = 1
+ elseif (jregic.le.irelii) then
+ ilast = (iregic-2)*lregis+irelii+1
+ else
+ ilast = (iregic-1)*lregis+1
+ endif
+
+! Avec reliquat a la fin :
+
+! ILAST = (IREGIC-1)*LREGIS+1
+
+
+! --- Test avec tous les elements precedents depuis ILAST
+
+ do ii = ilast, jj-1
+ ifac = inumfi(jj)
+ if((ifacel(1,inumfi(ii)).eq.ifacel(1,ifac)).or. &
+ (ifacel(2,inumfi(ii)).eq.ifacel(2,ifac)) )then
+ iok = iok - 1
+ endif
+ enddo
+ enddo
+
+ if(iok.ne.0) then
+ write(nfecra,1100)iok,1102
+ ivecti = 0
+ endif
+
+endif
+
+
+! --- Faces de bord
+
+if(ivectb.eq.1) then
+
+ iok = 0
+ do jj = 1, nfabor
+
+! --- Registre courant et position dans le registre
+ iregic = (jj-1)/lregis+1
+ jregic = mod(jj-1,lregis)+1
+
+! --- On teste entre ILAST, debut du registre,
+! et la position courante
+
+! En prenant le cas le plus penalisant entre
+! reliquat au debut et reliquat a la fin : reliquat au debut :
+
+ if(iregic.eq.1) then
+ ilast = 1
+ elseif (jregic.le.irelib) then
+ ilast = (iregic-2)*lregis+irelib+1
+ else
+ ilast = (iregic-1)*lregis+1
+ endif
+
+! Avec reliquat a la fin :
+
+! ILAST = (IREGIC-1)*LREGIS+1
+
+
+! --- Test avec tous les elements precedents depuis ILAST
+
+ do ii = ilast, jj-1
+ ifac = inumfb(jj)
+ if (ifabor(inumfb(ii)).eq.ifabor(ifac))then
+ iok = iok - 1
+ endif
+ enddo
+ enddo
+
+ if(iok.ne.0) then
+ write(nfecra,1200)iok,1202
+ ivectb = 0
+ endif
+
+endif
+
+!===============================================================================
+! 6. INDICATEURS
+!===============================================================================
+
+irveci = ivecti
+irvecb = ivectb
+
+!===============================================================================
+! 7. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RENUMEROTATION DES FACES ',/,&
+'@ ========= ',/,&
+'@ PROBLEME DE RENUMEROTATION DES FACES INTERNES ',/,&
+'@ ',I10 ,' OCCURRENCES DE L''EVENEMENT ',I5 ,/,&
+'@ ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ La vectorisation restera non forcee ',/,&
+'@ ',/,&
+'@ Signaler ce message a l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RENUMEROTATION DES FACES ',/,&
+'@ ========= ',/,&
+'@ PROBLEME DE RENUMEROTATION DES FACES DE BORD ',/,&
+'@ ',I10 ,' OCCURRENCES DE L''EVENEMENT ',I5 ,/,&
+'@ ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ La vectorisation restera non forcee ',/,&
+'@ ',/,&
+'@ Signaler ce message a l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: FACES RENUMBERING ',/,&
+'@ ======== ',/,&
+'@ PROBLEM IN THE INTERIOR FACES RENUMBERING ',/,&
+'@ ',I10 ,' OCCURRENCES OF THE EVENT ',I5 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ The vectorization will not be forced. ',/,&
+'@ ',/,&
+'@ Please contact the support about this message. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: FACES RENUMBERING ',/,&
+'@ ======== ',/,&
+'@ PROBLEM IN THE BOUNDARY FACES RENUMBERING ',/,&
+'@ ',I10 ,' OCCURRENCES OF THE EVENT ',I5 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ The vectorization will not be forced. ',/,&
+'@ ',/,&
+'@ Please contact the support about this message. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+return
+end
diff --git a/src/base/ordita.f90 b/src/base/ordita.f90
new file mode 100644
index 0000000..7660866
--- /dev/null
+++ b/src/base/ordita.f90
@@ -0,0 +1,89 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ordita &
+!================
+
+ ( nfabor , ifabor, iclass)
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ORDONNE LES NFABOR PAR IFABOR DECROISSANT
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nfabor ! e ! <-- ! nb d'el a ordonner !
+! ifabor(nfabor ! te ! <-- ! critere d'ordonnancement !
+! iclass(nfabor ! te ! --> ! table de renum !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+integer nfabor
+integer ifabor(nfabor)
+integer iclass(nfabor)
+
+integer jj, itmp, ii
+
+!===============================================================================
+
+if (nfabor.eq.0) return
+
+do jj = 1, nfabor
+ iclass(jj) = jj
+enddo
+do jj = nfabor/2, 1, -1
+ call tdesi1(jj,nfabor,nfabor,ifabor,iclass)
+enddo
+do ii = nfabor, 3, -1
+ itmp = iclass(1)
+ iclass(1) = iclass(ii)
+ iclass(ii) = itmp
+ call tdesi1(1,nfabor,ii-1,ifabor,iclass)
+enddo
+itmp = iclass(1)
+iclass(1) = iclass(2)
+iclass(2) = itmp
+
+return
+end
diff --git a/src/base/pergra.f90 b/src/base/pergra.f90
new file mode 100644
index 0000000..1afc962
--- /dev/null
+++ b/src/base/pergra.f90
@@ -0,0 +1,122 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine pergra &
+!================
+
+ ( nphjmx , nphas , &
+ ju , jv , jw , &
+ jtytur , &
+ jr11 , jr22 , jr33 , jr12 , jr13 , jr23 )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! Recuperation de certains COMMON necessaires a PERING
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nphjmx ! e ! <-- ! nombre de phases max !
+! nphas ! e ! <-- ! nombre de phases !
+! ju, jv, jw ! te ! --> ! numero de variable pour u, v, w !
+! jtytur ! te ! --> ! indicateur modele de turbulence !
+! jr11...jr23 ! te ! --> ! numero de variable pour rij !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nphjmx, nphas
+integer ju(nphjmx),jv(nphjmx),jw(nphjmx)
+integer jtytur(nphjmx)
+integer jr11(nphjmx),jr22(nphjmx),jr33(nphjmx)
+integer jr12(nphjmx),jr13(nphjmx),jr23(nphjmx)
+
+! VARIABLES LOCALES
+
+integer iphas
+
+!===============================================================================
+
+
+! Recuperation des COMMON de "optcal"
+
+do iphas = 1, nphas
+ jtytur(iphas) = itytur(iphas)
+enddo
+
+! Recuperation des COMMON de "numvar.h"
+
+do iphas = 1, nphas
+ ju (iphas) = iu (iphas)
+ jv (iphas) = iv (iphas)
+ jw (iphas) = iw (iphas)
+ if(itytur(iphas).eq.3) then
+ jr11(iphas) = ir11(iphas)
+ jr22(iphas) = ir22(iphas)
+ jr33(iphas) = ir33(iphas)
+ jr12(iphas) = ir12(iphas)
+ jr13(iphas) = ir13(iphas)
+ jr23(iphas) = ir23(iphas)
+ else
+ jr11(iphas) = 0
+ jr22(iphas) = 0
+ jr33(iphas) = 0
+ jr12(iphas) = 0
+ jr13(iphas) = 0
+ jr23(iphas) = 0
+ endif
+enddo
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/perinr.f90 b/src/base/perinr.f90
new file mode 100644
index 0000000..6d3899a
--- /dev/null
+++ b/src/base/perinr.f90
@@ -0,0 +1,296 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine perinr &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , &
+ drdxyz , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! PREPARATION DE LA PERIODICITE DE ROTATION POUR LES TENSIONS DE
+! REYNOLDS
+
+! ON CALCULE ICI UNE ESTIMATION DU GRADIENT DE RIJ, QUI
+! N'EST PAS UNE VARIABLE SCALAIRE, MAIS TENSORIELLE.
+! LE GRADIENT EST PRIS SANS RECONSTRUCTION (SINON, ON A BESOIN
+! DU GRADIENT, ET DONC DE LA PERIODICITE). IL SEMBLE POSSIBLE
+! D'UTILISER GRADMC.
+! LE GRADIENT EST ENSUITE STOCKE OU IL FAUT DANS UN TABLEAU
+! REPRESENTANT LE HALO PUIS
+! SOUMIS A ROTATION LA OU C'EST NECESSAIRE POUR ETRE PRET
+! A L'EMPLOI (CF PERING).
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! drdxyz ! tr ! <-- ! gradient de r aux cellules halo pour !
+! ! ! ! l'approche explicite en periodicite !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision drdxyz(ncelet-ncel,6,3,nphas)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer inc, iccocg,ipiph,nswrgp,imligp,iwarnp
+integer isou, isou1, iphydp
+
+double precision epsrgp, climgp,extrap
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+inc = 0
+iccocg = 1
+
+do isou = 1,6
+ if(isou.eq.1) ipiph = ir11(iphas)
+ if(isou.eq.2) ipiph = ir22(iphas)
+ if(isou.eq.3) ipiph = ir33(iphas)
+ if(isou.eq.4) ipiph = ir12(iphas)
+ if(isou.eq.5) ipiph = ir13(iphas)
+ if(isou.eq.6) ipiph = ir23(iphas)
+
+
+! On ne reconstruit pas et on ne limite pas car
+! on ne connait pas a priori le gradient des voisins (justement,
+! on le calcule ici). En fait, a partir du second pas de temps relatif
+! on dispose des valeurs calculees precedemment, et on pourrait donc les
+! utiliser pour reconstruire : a tester. (le pas de temps relatif est compte
+! a partir du premier pas de temps du "run" courant, donc a partir de la
+! lecture du fichier suite eventuellement)
+
+! Attention, on precise bien qu'a la sortie de grdcel ci dessous, le halo
+! des rotations contient :
+! - rien du tout au premier pas de temps relatif
+! - sinon, le gradient calcule au pas de temps precedent
+! On fera donc attention a ne pas utiliser le halo ici dans le cas general.
+
+! NSWRGP = NSWRGR(IPIPH)
+ nswrgp = 1
+! IMLIGP = IMLIGR(IPIPH)
+ imligp = -1
+ iwarnp = iwarni(ipiph)
+ epsrgp = epsrgr(ipiph)
+ climgp = climgr(ipiph)
+ extrap = extrag(ipiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtp(1,ipiph) , coefa(1,ipiph) , coefb(1,ipiph) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ isou1 = isou
+ call peinr1 &
+ !==========
+ ( isou1 , iphas , &
+ drdxyz , &
+ w1 , w2 , w3 )
+
+enddo
+
+! --> ON FAIT TOURNER LE TENSEUR DRDXYZ PAR MANQUE DE TABLEAUX DE
+! TRAVAIL (ON A LE MEME PROBLEME POUR U)
+
+call peinr2 &
+!==========
+ ( iphas , drdxyz )
+
+! On a calcule les gradients dans DRDXYZ
+igrper = 1
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/perinu.f90 b/src/base/perinu.f90
new file mode 100644
index 0000000..9047972
--- /dev/null
+++ b/src/base/perinu.f90
@@ -0,0 +1,291 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine perinu &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , &
+ dudxyz , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! PREPARATION DE LA PERIODICITE DE ROTATION POUR LA VITESSE
+
+! ON CALCULE ICI UNE ESTIMATION DU GRADIENT DE LA VITESSE, QUI
+! N'EST PAS UNE VARIABLE SCALAIRE, MAIS VECTORIELLE.
+! LE GRADIENT EST PRIS SANS RECONSTRUCTION (SINON, ON A BESOIN
+! DU GRADIENT, ET DONC DE LA PERIODICITE). IL SEMBLE POSSIBLE
+! D'UTILISER GRADMC.
+! LE GRADIENT EST ENSUITE STOCKE OU IL FAUT DANS UN TABLEAU
+! REPRESENTANT LE HALO PUIS
+! SOUMIS A ROTATION LA OU C'EST NECESSAIRE POUR ETRE PRET
+! A L'EMPLOI (CF PERING).
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iphas ! e ! <-- ! numero de phase !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! dudxyz ! tr ! <-- ! gradient de u aux cellules halo pour !
+! ! ! ! l'approche explicite en periodicite !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision dudxyz(ncelet-ncel,3,3,nphas)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer inc, iccocg, ipiph, nswrgp, imligp, iwarnp
+integer isou, isou1, iphydp
+
+double precision epsrgp, climgp,extrap
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+inc = 0
+iccocg = 1
+
+do isou = 1,3
+ if(isou.eq.1) ipiph = iu(iphas)
+ if(isou.eq.2) ipiph = iv(iphas)
+ if(isou.eq.3) ipiph = iw(iphas)
+
+
+! On ne reconstruit pas et on ne limite pas car
+! on ne connait pas a priori le gradient des voisins (justement,
+! on le calcule ici). En fait, a partir du second pas de temps relatif
+! on dispose des valeurs calculees precedemment, et on pourrait donc les
+! utiliser pour reconstruire : a tester. (le pas de temps relatif est compte
+! a partir du premier pas de temps du "run" courant, donc a partir de la
+! lecture du fichier suite eventuellement)
+
+! Attention, on precise bien qu'a la sortie de grdcel ci dessous, le halo
+! des rotations contient :
+! - rien du tout au premier pas de temps relatif
+! - sinon, le gradient calcule au pas de temps precedent
+! On fera donc attention a ne pas utiliser le halo ici dans le cas general.
+
+! NSWRGP = NSWRGR(IPIPH)
+ nswrgp = 1
+! IMLIGP = IMLIGR(IPIPH)
+ imligp = -1
+ iwarnp = iwarni(ipiph)
+ epsrgp = epsrgr(ipiph)
+ climgp = climgr(ipiph)
+ extrap = extrag(ipiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtp(1,ipiph) , coefa(1,ipiph) , coefb(1,ipiph) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ isou1 = isou
+ call peinu1 &
+ !==========
+ ( isou1 , iphas , &
+ dudxyz , &
+ w1 , w2 , w3 )
+
+enddo
+
+! --> ON FAIT TOURNER LE TENSEUR DUDXYZ PAR MANQUE DE TABLEAUX DE
+! TRAVAIL (ON A LE MEME PROBLEME POUR RIJ)
+
+call peinu2 &
+!==========
+ ( iphas , dudxyz )
+
+! On a calcule les gradients dans DUDXYZ
+iguper = 1
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/phyvar.f90 b/src/base/phyvar.f90
new file mode 100644
index 0000000..6707fa6
--- /dev/null
+++ b/src/base/phyvar.f90
@@ -0,0 +1,1379 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine phyvar &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , w11 , w12 , &
+ xmij , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! REMPLISSAGE DES GRANDEURS PHYSIQUES VARIABLES EN TEMPS
+! ESSENTIELLEMENT LA VISCOSITE TURBULENTE.
+! ON APPELLE UN SOUS PROGRAMME UTILISATEUR QUI PERMET DE
+! SPECIFIER ROM, ROMB, VISCL, VISCLS ...
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1..12(ncelet ! tr ! --- ! tableau de travail !
+! xmij(ncelet,6 ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "matiss.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision w9(ncelet),w10(ncelet),w11(ncelet),w12(ncelet)
+double precision xmij(ncelet,6)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , iel , ifac , iscal , iphas , iph
+integer ii , iok , iok1 , iok2 , iisct
+integer nphmx , nn
+integer ibrom(nphsmx) , ipcrom, ipbrom, ipcvst
+integer ikiph , ieiph , ir11ip, ir22ip, ir33ip
+integer ipccp , ipcvis, iphiph, ipcvma
+integer idimte, itenso, iclipc
+double precision xk, xe, xnu, xrom, vismax(nscamx), vismin(nscamx)
+double precision varmn(4), varmx(4), tt, ttmin, ttke, vistot
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+
+!===============================================================================
+! 2. PREPARATION DE LA PERIODICITE DE ROTATION
+! CALCUL DE DUDXYZ ET DRDXYZ (gradients sur les halos avec prise
+! en compte des periodicites pour exploitation dans pering, inimas)
+!===============================================================================
+
+if(iperot.gt.0) then
+
+ do iphas = 1,nphas
+
+ iph = iphas
+ call perinu &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iph , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , &
+ ra(idudxy) , &
+ ra )
+
+ enddo
+
+
+ do iphas = 1, nphas
+
+ if(itytur(iphas).eq.3) then
+
+ iph = iphas
+ call perinr &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iph , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , &
+ ra(idrdxy) , &
+ ra )
+
+ endif
+
+ enddo
+
+endif
+
+!===============================================================================
+! 4. ON REND LA MAIN A L'UTILISATEUR POUR LA PROGRAMMATION DES
+! GRANDEURS PHYSIQUES VARIABLES QUI LUI SONT PROPRES
+!===============================================================================
+
+nphmx = nphsmx
+do iphas = 1, nphsmx
+ ibrom(iphas) = 0
+enddo
+
+
+if (ippmod(iphpar).ge.1) then
+ call ppphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+if (imatis.eq.1) then
+
+! Matisse
+ call mtphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+else
+
+ ! - Interface Code_Saturne
+ ! ======================
+
+ if (iihmpr.eq.1) then
+ call uiphyv &
+ !===========
+ ( ncel, ncelet, nscaus, &
+ irom, iviscl, icp, ivisls, irovar, ivivar, &
+ isca, iscalt, iscavr, ipproc, &
+ ro0, cp0, rtp, propce)
+ endif
+
+! Utilisateur standard
+ call usphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+! ROMB SUR LES BORDS : VALEUR PAR DEFAUT (CELLE DE LA CELLULE VOISINE)
+
+do iphas = 1, nphas
+ if (ibrom(iphas).eq.0) then
+ ipcrom = ipproc(irom(iphas))
+ ipbrom = ipprob(irom(iphas))
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbrom) = propce(iel ,ipcrom)
+ enddo
+ endif
+enddo
+
+! Au premier pas de temps du calcul
+! Si on a indique que rho (visc) etait constant
+! et qu'on l'a modifie dans usphyv, ca ne va pas
+! On se sert de irovar (ivivar) pour ecrire et lire
+! rho (visc) dans le fichier suite
+
+if(ntcabs.eq.ntpabs+1) then
+
+! Masse volumique aux cellules et aux faces de bord
+ iok1 = 0
+ do iphas = 1, nphas
+ if(irovar(iphas).eq.0) then
+ ipcrom = ipproc(irom(iphas))
+ ipbrom = ipprob(irom(iphas))
+ do iel = 1, ncel
+ if( abs(propce(iel ,ipcrom)-ro0 (iphas)).gt.epzero) then
+ iok1 = 1
+ endif
+ enddo
+ do ifac = 1, nfabor
+ if( abs(propfb(ifac,ipbrom)-ro0 (iphas)).gt.epzero) then
+ iok1 = 1
+ endif
+ enddo
+ endif
+ enddo
+ if(iok1.ne.0) then
+ write(nfecra,9001)
+ endif
+
+! Viscosite moleculaire aux cellules
+ iok2 = 0
+ do iphas = 1, nphas
+ if(ivivar(iphas).eq.0) then
+ ipcvis = ipproc(iviscl(iphas))
+ do iel = 1, ncel
+ if( abs(propce(iel ,ipcvis)-viscl0(iphas)).gt.epzero) then
+ iok2 = 1
+ endif
+ enddo
+ endif
+ enddo
+ if(iok2.ne.0) then
+ if ( ippmod(icompf) .ge. 0 ) then
+ write(nfecra,9003)
+ else
+ write(nfecra,9002)
+ endif
+ endif
+
+ if(iok1.ne.0.or.iok2.ne.0) then
+ call csexit(1)
+ endif
+
+endif
+
+!===============================================================================
+! 3. CALCUL DE LA VISCOSITE TURBULENTE
+!===============================================================================
+
+! --- Boucle sur les phases : Debut
+do iphas = 1, nphas
+
+ if (iturb(iphas).eq. 0) then
+
+! 3.1 LAMINAIRE
+! ==============
+
+ ipcvst = ipproc(ivisct(iphas))
+
+ do iel = 1, ncel
+ propce(iel,ipcvst) = 0.d0
+ enddo
+
+ elseif (iturb(iphas).eq.10) then
+
+! 3.2 LONGUEUR DE MELANGE
+! ========================
+
+ iph = iphas
+ call vislmg &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)), ra(ismace(iphas)), &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+ elseif (itytur(iphas).eq.2) then
+
+! 3.3 K-EPSILON
+! ==============
+
+ ikiph = ik(iphas)
+ ieiph = iep(iphas)
+ ipcvst = ipproc(ivisct(iphas))
+ ipcrom = ipproc(irom (iphas))
+
+ do iel = 1, ncel
+ xk = rtp(iel,ikiph)
+ xe = rtp(iel,ieiph)
+ propce(iel,ipcvst) = propce(iel,ipcrom)*cmu*xk**2/xe
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+! 3.4 Rij-EPSILON
+! ================
+
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ieiph = iep(iphas)
+ ipcvst = ipproc(ivisct(iphas))
+ ipcrom = ipproc(irom (iphas))
+
+ do iel = 1, ncel
+ xk = 0.5d0*(rtp(iel,ir11ip)+rtp(iel,ir22ip)+rtp(iel,ir33ip))
+ xe = rtp(iel,ieiph)
+ propce(iel,ipcvst) = propce(iel,ipcrom)*cmu*xk**2/xe
+ enddo
+
+ elseif (iturb(iphas).eq.40) then
+
+! 3.5 LES Smagorinsky
+! ===================
+
+ iph = iphas
+
+ call vissma &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , &
+ ia(iicesm(iphas)) , ia(iitpsm(iphas)), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)), ra(ismace(iphas)), &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+ elseif(iturb(iphas).eq.41) then
+
+! 3.6 LES dynamique
+! =================
+
+ iph = iphas
+
+ call visdyn &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , &
+ ia(iicesm(iphas)) , ia(iitpsm(iphas)), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)), ra(ismace(iphas)), &
+ propce(1,ipproc(ismago(iphas))) , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , w10 , xmij , &
+ rdevel , rtuser , ra )
+
+ elseif (iturb(iphas).eq.42) then
+
+! 3.7 LES WALE
+! ============
+
+ iph = iphas
+
+ call viswal &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , &
+ ia(iicesm(iphas)) , ia(iitpsm(iphas)), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)), ra(ismace(iphas)), &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ w9 , w10 , w11 , w12 , &
+ rdevel , rtuser , ra )
+
+ elseif (iturb(iphas).eq.50) then
+
+! 3.8 v2f phi-model
+! =================
+ ikiph = ik(iphas)
+ ieiph = iep(iphas)
+ iphiph = iphi(iphas)
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ ipcrom = ipproc(irom (iphas))
+
+ do iel = 1, ncel
+ xk = rtp(iel,ikiph)
+ xe = rtp(iel,ieiph)
+ xrom = propce(iel,ipcrom)
+ xnu = propce(iel,ipcvis)/xrom
+ ttke = xk / xe
+ ttmin = cv2fct*sqrt(xnu/xe)
+ tt = max(ttke,ttmin)
+ propce(iel,ipcvst) = cv2fmu*xrom*tt*rtp(iel,iphiph) &
+ *rtp(iel,ikiph)
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+! 3.9 K-OMEGA SST
+! ===============
+
+ iph = iphas
+ call vissst &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)), ra(ismace(iphas)), &
+ ra(is2kw(iphas)), ra(idvukw(iphas)), &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+enddo
+! --- Boucle sur les phases : fin
+
+!===============================================================================
+! 4. MODIFICATION UTILISATEUR DE LA VISCOSITE TURBULENTE
+!===============================================================================
+
+do iphas = 1, nphas
+
+ iph = iphas
+ call usvist &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)), ra(ismace(iphas)), &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+enddo
+
+!===============================================================================
+! 5. CLIPPING DE LA VISCOSITE TURBULENTE EN LES DYNAMIQUE
+!===============================================================================
+
+do iphas = 1, nphas
+! Pour la LES en modele dynamique on clippe la viscosite turbulente de maniere
+! a ce que mu+mu_t soit positif, .e. on autorise mu_t legerement negatif
+! La diffusivite turbulente des scalaires (mu_t/sigma), elle, sera clippee a 0
+! dans covofi
+
+ if (iturb(iphas).eq.41) then
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ iclipc = 0
+ do iel = 1, ncel
+ vistot = propce(iel,ipcvis) + propce(iel,ipcvst)
+ if(vistot.lt.0.d0) then
+ propce(iel,ipcvst) = 0.d0
+ iclipc = iclipc + 1
+ endif
+ enddo
+ if(iwarni(iu(iphas)).ge.1) then
+ if(irangp.ge.0) then
+ call parcpt(iclipc)
+ !==========
+ endif
+ write(nfecra,1000) iclipc
+ endif
+ endif
+
+enddo
+
+!===============================================================================
+! 6. MODIFICATION UTILISATEUR DE LA VISCOSITE DE MAILLAGE EN ALE
+!===============================================================================
+
+if (iale.eq.1) then
+
+ ! - Interface Code_Saturne
+ ! ======================
+
+ if (iihmpr.eq.1) then
+
+ call uivima &
+ !==========
+ ( ncel, &
+ propce(1,ipproc(ivisma(1))), &
+ propce(1,ipproc(ivisma(2))), &
+ propce(1,ipproc(ivisma(3))), &
+ xyzcen, dtref, ttcabs, ntcabs )
+
+ endif
+
+ call usvima &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , propce(1,ipproc(ivisma(1))) , &
+ propce(1,ipproc(ivisma(2))) , propce(1,ipproc(ivisma(3))) , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 7. IMPRESSIONS DE CONTROLE DES VALEURS ENTREES PAR L'UTILISATEUR
+!===============================================================================
+
+
+! ---> Calcul des bornes des variables par phase et impressions
+
+! Indicateur d'erreur
+iok = 0
+
+do iphas = 1, nphas
+
+! Rang des variables dans PROPCE
+ ipcrom = ipproc(irom(iphas))
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+ nn = 4
+ else
+ ipccp = 0
+ nn = 3
+ endif
+
+! Rang des variables dans PROPFB
+ ipbrom = ipprob(irom(iphas))
+
+! Min et max sur les cellules
+ do ii = 1, nn
+ ivar = 0
+ if(ii.eq.1) ivar = ipcrom
+ if(ii.eq.2) ivar = ipcvis
+ if(ii.eq.3) ivar = ipcvst
+ if(ii.eq.4) ivar = ipccp
+ if(ivar.gt.0) then
+ varmx(ii) = propce(1,ivar)
+ varmn(ii) = propce(1,ivar)
+ do iel = 2, ncel
+ varmx(ii) = max(varmx(ii),propce(iel,ivar))
+ varmn(ii) = min(varmn(ii),propce(iel,ivar))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (varmx(ii))
+ !==========
+ call parmin (varmn(ii))
+ !==========
+ endif
+ endif
+ enddo
+
+! Min et max sur les faces de bord (masse volumique uniquement)
+ ii = 1
+ ivar = ipbrom
+ do ifac = 1, nfabor
+ varmx(ii) = max(varmx(ii),propfb(ifac,ivar))
+ varmn(ii) = min(varmn(ii),propfb(ifac,ivar))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (varmx(ii))
+ !==========
+ call parmin (varmn(ii))
+ !==========
+ endif
+
+! Impressions
+ iok1 = 0
+ do ii = 1, nn
+ if(ii.eq.1) chaine = nomvar(ipppro(ipproc(irom (iphas))))
+ if(ii.eq.2) chaine = nomvar(ipppro(ipproc(iviscl(iphas))))
+ if(ii.eq.3) chaine = nomvar(ipppro(ipproc(ivisct(iphas))))
+ if(ii.eq.4) chaine = nomvar(ipppro(ipproc(icp (iphas))))
+ if(iwarni(iu(iphas)).ge.1.or.ipass.eq.1.or. &
+ varmn(ii).lt.0.d0)then
+ if(iok1.eq.0) then
+ write(nfecra,3010)iphas
+ iok1 = 1
+ endif
+ if ((ii.ne.3).or.(iturb(iphas).ne.0)) &
+ write(nfecra,3011)chaine(1:8),varmn(ii),varmx(ii)
+ endif
+ enddo
+ if(iok1.eq.1) write(nfecra,3012)
+
+! Verifications de valeur physique
+
+! Masse volumique definie
+ ii = 1
+ chaine = nomvar(ipppro(ipproc(irom (iphas))))
+ if (varmn(ii).lt.0.d0) then
+ write(nfecra,9011)chaine(1:8),varmn(ii)
+ iok = iok + 1
+ endif
+
+! Viscosite moleculaire definie
+ ii = 2
+ chaine = nomvar(ipppro(ipproc(iviscl(iphas))))
+ if (varmn(ii).lt.0.d0) then
+ write(nfecra,9011)chaine(1:8),varmn(ii)
+ iok = iok + 1
+ endif
+
+! Viscosite turbulente definie
+! on ne clippe pas mu_t en modele LES dynamique, car on a fait
+! un clipping sur la viscosite totale
+ ii = 3
+ chaine = nomvar(ipppro(ipproc(ivisct(iphas))))
+ if (varmn(ii).lt.0.d0.and.iturb(iphas).ne.41) then
+ write(nfecra,9012)iphas,varmn(ii)
+ iok = iok + 1
+ endif
+
+! Chaleur specifique definie
+ if(icp(iphas).gt.0) then
+ ii = 4
+ chaine = nomvar(ipppro(ipproc(icp (iphas))))
+ if (varmn(ii).lt.0.d0) then
+ iisct = 0
+ do iscal = 1, nscal
+ if (iscsth(iscal).ne.0) then
+ iisct = 1
+ endif
+ enddo
+ if (iisct.eq.1) then
+ write(nfecra,9011)chaine(1:8),varmn(ii)
+ iok = iok + 1
+ endif
+ endif
+ endif
+
+enddo
+
+
+
+! ---> Calcul des bornes des scalaires et impressions
+
+if(nscal.ge.1) then
+
+ iok1 = 0
+ do iscal = 1, nscal
+
+ if(ivisls(iscal).gt.0) then
+ ipcvis = ipproc(ivisls(iscal))
+ else
+ ipcvis = 0
+ endif
+
+ vismax(iscal) = -grand
+ vismin(iscal) = grand
+ if(ipcvis.gt.0) then
+ do iel = 1, ncel
+ vismax(iscal) = max(vismax(iscal),propce(iel,ipcvis))
+ vismin(iscal) = min(vismin(iscal),propce(iel,ipcvis))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (vismax(iscal))
+ !==========
+ call parmin (vismin(iscal))
+ !==========
+ endif
+ else
+ vismax(iscal) = visls0(iscal)
+ vismin(iscal) = visls0(iscal)
+ endif
+
+ ivar = isca(iscal)
+ if(iwarni(ivar).ge.1.or.ipass.eq.1.or. &
+ vismin(iscal).le.0.d0)then
+ chaine = nomvar(ipprtp(ivar))
+ if(iok1.eq.0) then
+ write(nfecra,3110)
+ iok1 = 1
+ endif
+ write(nfecra,3111)chaine(1:8),iscal, &
+ vismin(iscal),vismax(iscal)
+ endif
+
+ enddo
+ if(iok1.eq.1) write(nfecra,3112)
+
+! Verifications de valeur physique
+
+! IOK a deja ete initialise pour les valeurs liees aux phases
+
+ do iscal = 1, nscal
+
+ ivar = isca(iscal)
+
+ if (vismin(iscal).lt.0.d0) then
+ chaine = nomvar(ipprtp(ivar))
+ write(nfecra,9111)chaine(1:8),iscal,vismin(iscal)
+ iok = iok + 1
+ endif
+
+ enddo
+
+endif
+
+! ---> Calcul des bornes de viscosite de maillage en ALE
+
+if(iale.eq.1) then
+
+ iok1 = 0
+ nn = 1
+ if (iortvm.eq.1) nn = 3
+ do ii = 1, nn
+ ipcvma = ipproc(ivisma(ii))
+
+! Min et max sur les cellules
+ varmx(1) = propce(1,ipcvma)
+ varmn(1) = propce(1,ipcvma)
+ do iel = 2, ncel
+ varmx(1) = max(varmx(1),propce(iel,ipcvma))
+ varmn(1) = min(varmn(1),propce(iel,ipcvma))
+ enddo
+ if (irangp.ge.0) then
+ call parmax (varmx(1))
+ !==========
+ call parmin (varmn(1))
+ !==========
+ endif
+
+! Impressions
+ chaine = nomvar(ipppro(ipcvma))
+ if(iwarni(iuma).ge.1.or.ipass.eq.1.or. &
+ varmn(1).lt.0.d0)then
+ if (iok1.eq.0) then
+ write(nfecra,3210)
+ iok1 = 1
+ endif
+ write(nfecra,3211)chaine(1:8),varmn(1),varmx(1)
+ endif
+
+! Verifications de valeur physique
+
+! Viscosite de maillage definie
+ chaine = nomvar(ipppro(ipcvma))
+ if (varmn(1).le.0.d0) then
+ write(nfecra,9011)chaine(1:8),varmn(1)
+ iok = iok + 1
+ endif
+
+ enddo
+
+ if (iok1.eq.1) write(nfecra,3212)
+
+endif
+
+! ---> arret eventuel
+
+if(iok.ne.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+endif
+
+!===============================================================================
+! 8. ECHANGES
+!===============================================================================
+
+! Pour navsto et vissec on a besoin de ROM dans le halo
+
+
+do iphas = 1, nphas
+
+ ipcrom = ipproc(irom(iphas))
+
+ if(irangp.ge.0) then
+ call parcom (propce(1,ipcrom))
+ !==========
+ endif
+
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ propce(1,ipcrom),propce(1,ipcrom),propce(1,ipcrom), &
+ propce(1,ipcrom),propce(1,ipcrom),propce(1,ipcrom), &
+ propce(1,ipcrom),propce(1,ipcrom),propce(1,ipcrom) )
+ endif
+
+enddo
+
+!----
+! FORMATS
+!----
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' Nb de clippings de la viscosite totale (mu+mu_t>0) :',I10,/)
+ 3010 format( &
+' --- Phase : ',I10 ,/,&
+' --------------------------------- ',/,&
+' Propriete Valeur min Valeur max ',/,&
+' --------------------------------- ' )
+ 3011 format( &
+ 2x, a8, e12.4, e12.4 )
+ 3012 format( &
+' --------------------------------- ',/)
+ 3110 format( &
+' --- Diffusivite : ',/,&
+' --------------------------------------- ',/,&
+' Scalaire Numero Valeur min Valeur max ',/,&
+' --------------------------------------- ' )
+ 3111 format( &
+ 1x, a8, i7, e12.4, e12.4 )
+ 3112 format( &
+' --------------------------------------- ',/)
+ 3210 format( &
+' --- Viscosite de maillage (methode ALE) ',/,&
+' --------------------------------- ',/,&
+' Propriete Valeur min Valeur max ',/,&
+' --------------------------------- ' )
+ 3211 format( &
+ 2x, a8, e12.4, e12.4 )
+ 3212 format( &
+' --------------------------------- ',/)
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE ENTRE USPHYV ET USINI1 POUR ',/,&
+'@ LA MASSE VOLUMIQUE',/,&
+'@ ',/,&
+'@ On a indique dans usini1 que la masse volumique etait ',/,&
+'@ constante (IROVAR(IPHAS)=0) mais on a modifie ses ',/,&
+'@ valeurs aux cellules ou aux faces de bord dans usphyv. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1 et usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE ENTRE USPHYV ET USINI1 POUR ',/,&
+'@ LA VISCOSITE MOLECULAIRE',/,&
+'@ ',/,&
+'@ On a indique dans usini1 que la viscosite moleculaire ',/,&
+'@ etait constante (IVIVAR(IPHAS)=0) mais on a modifie ses',/,&
+'@ valeurs aux cellules dans usphyv. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1 et usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ MODULE COMPRESSIBLE ',/,&
+'@ INCOHERENCE ENTRE USCFPV ET USCFX1 POUR ',/,&
+'@ LA VISCOSITE MOLECULAIRE',/,&
+'@ ',/,&
+'@ En compressible la viscosite moleculaire est constante par',/,&
+'@ defaut (IVIVAR(IPHAS)=0) et la valeur de IVIVAR n''a ',/,&
+'@ pas ete modifiee dans uscfx1. Pourtant, on a modifie ',/,&
+'@ les valeurs de la viscosite moleculaire dans uscfpv. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier uscfx1 et uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ LA PROPRIETE PHYSIQUE ',A8 ,' N A PAS ETE ',/,&
+'@ CORRECTEMENT DEFINIE.',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ La propriete physique identifiee ci-dessus est variable et',/,&
+'@ le minimum atteint est ',E12.4 ,/,&
+'@ Verifier que cette propriete a ete definie dans usphyv et ',/,&
+'@ que la loi adoptee conduit a des valeurs correctes. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ LA VISCOSITE TURBULENTE DE LA PHASE ',I10 ,/,&
+'@ N A PAS ETE CORRECTEMENT DEFINIE.',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Le minimum atteint est ',E12.4 ,/,&
+'@ Verifier le cas echeant la definition de la masse ',/,&
+'@ volumique dans usphyv et la modification de la viscosite',/,&
+'@ turbulente dans usvist. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9111 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ LA DIFFUSIVITE DU SCALAIRE ',A8 ,/,&
+'@ (SCALAIRE NUMERO ',I10 ,') N A PAS ETE ',/,&
+'@ CORRECTEMENT DEFINIE.',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ La propriete physique identifiee ci-dessus est variable et',/,&
+'@ le minimum atteint est ',E12.4 ,/,&
+'@ Verifier que cette propriete a ete definie dans usphyv et ',/,&
+'@ que la loi adoptee conduit a des valeurs correctes. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DES GRANDEURS PHYSIQUES ONT DES VALEURS INCORRECTES ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+' Nb of clippings for the effective viscosity (mu+mu_t>0):',I10,/)
+ 3010 format( &
+' --- Phase: ',I10 ,/,&
+' --------------------------------- ',/,&
+' Property Min. value Max. value ',/,&
+' --------------------------------- ' )
+ 3011 format( &
+ 2x, a8, e12.4, e12.4 )
+ 3012 format( &
+' --------------------------------- ',/)
+ 3110 format( &
+' --- Diffusivity: ',/,&
+' --------------------------------------- ',/,&
+' Scalar Number Min. value Max. value ',/,&
+' --------------------------------------- ' )
+ 3111 format( &
+ 1x, a8, i7, e12.4, e12.4 )
+ 3112 format( &
+' --------------------------------------- ',/)
+ 3210 format( &
+' --- Mesh viscosity (ALE method) ',/,&
+' --------------------------------- ',/,&
+' Property Min. value Max. value ',/,&
+' --------------------------------- ' )
+ 3211 format( &
+ 2x, a8, e12.4, e12.4 )
+ 3212 format( &
+' --------------------------------- ',/)
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE PHYSICAL QUANTITIES COMPUTATION ',/,&
+'@ ======== ',/,&
+'@ INCOHERENCY BETWEEN USPHYV AND USINI1 FOR THE DENSITY ',/,&
+'@ ',/,&
+'@ The density has been declared constant in usini1 ',/,&
+'@ (IROVAR(IPHAS)=0) but its value has been modified ',/,&
+'@ in cells of at boundary faces in usphyv. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1 and usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE PHYSICAL QUANTITIES COMPUTATION ',/,&
+'@ ======== ',/,&
+'@ INCOHERENCY BETWEEN USPHYV AND USINI1 FOR ',/,&
+'@ THE MOLECULAR VISCOSITY',/,&
+'@ ',/,&
+'@ The molecular viscosity has been declared constant in ',/,&
+'@ usini1 (IVIVAR(IPHAS)=0) but its value has been ',/,&
+'@ modified in cells or at boundary faces in usphyv. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1 and usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE PHYSICAL QUANTITIES COMPUTATION ',/,&
+'@ ======== ',/,&
+'@ INCOHERENCY BETWEEN USCFPV AND USCFX1 FOR ',/,&
+'@ THE MOLECULAR VISCOSITY',/,&
+'@ ',/,&
+'@ In the compressible module, the molecular viscosity is ',/,&
+'@ constant by default (IVIVAR(IPHAS)=0) and the value ',/,&
+'@ of IVIVAR has not been modified in uscfx1. Yet, its ',/,&
+'@ value has been modified in uscfpv. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify uscfx1 and uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE PHYSICAL QUANTITIES COMPUTATION ',/,&
+'@ ======== ',/,&
+'@ THE PHYSICAL PROPERTY ',A8 ,' HAS NOT BEEN ',/,&
+'@ CORRECTLY DEFINED.',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ The physical property identified is variable and the ',/,&
+'@ minimum reached is ',E12.4 ,/,&
+'@ Verify that this property has been defined in usphyv and ',/,&
+'@ that the chosen law leads to correct values. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE PHYSICAL QUANTITIES COMPUTATION ',/,&
+'@ ======== ',/,&
+'@ THE TURBULENT VISCOSITY OF PHASE ',I10 ,' HAS NOT BEEN ',/,&
+'@ CORRECTLY DEFINED.',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ The minimum reached is ',E12.4 ,/,&
+'@ Verify the density definition in usphyv and a turbulent ',/,&
+'@ viscosity modification in usvist (if any). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9111 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE PHYSICAL QUANTITIES COMPUTATION ',/,&
+'@ ======== ',/,&
+'@ THE DIFFUSIVITY OF THE SCALAR ',A8 ,/,&
+'@ (SCALAR NUMBER ',I10 ,') HAS NOT BEEN ',/,&
+'@ CORRECTLY DEFINED.',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ The physical property identified is variable and the ',/,&
+'@ minimum reached is ',E12.4 ,/,&
+'@ Verify that this property has been defined in usphyv and ',/,&
+'@ that the chosen law leads to correct values. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE PHYSICAL QUANTITIES COMPUTATION ',/,&
+'@ ======== ',/,&
+'@ SOME PHYSICAL QUANTITIES HAVE INCORRECT VALUES ',/,&
+'@ ',/,&
+'@ The calculation will not be run (',I10,' errors). ',/,&
+'@ ',/,&
+'@ Refer to previous warnings for further information. ',/,&
+'@ Verify usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/precli.f90 b/src/base/precli.f90
new file mode 100644
index 0000000..57f47e8
--- /dev/null
+++ b/src/base/precli.f90
@@ -0,0 +1,296 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine precli &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ rcodcl , coefu , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! PREPARATION DU REMPLISSAGE DES CONDITIONS AUX LIMITES
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefu ! tr ! --- ! tab de trav !
+! nfabor,3 ! ! ! (vitesse en i' ) !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "albase.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefu(nfabor,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ivar, iphas
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. INITIALISATION DES CONDITIONS LIMITES ET TYPE DE FACES DE BORD
+!===============================================================================
+
+! ICODCL = 0 INDIQUE QUE LA CL N'A PAS ETE RENSEIGNEE
+! ITYPFB = 0 INDIQUE QUE LA CL N'A PAS ETE RENSEIGNEE
+
+! RINFIN : VALEUR INFINIE
+
+do iphas = 1, nphas
+ do ifac = 1, nfabor
+ ia(iitypf-1+ifac+nfabor*(iphas-1)) = 0
+ enddo
+enddo
+
+! Pour toutes les variables, on initialise RCODCL(1)a RINFIN
+! Cette valeur sera reinitialisee a zero dans typecl.F
+
+do ivar = 1, nvar
+ do ifac = 1, nfabor
+ icodcl(ifac,ivar) = 0
+ rcodcl(ifac,ivar,1) = rinfin
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ enddo
+enddo
+
+! En ALE, on initialise aussi le tableau IALTYB
+if (iale.eq.1) then
+ do ifac = 1, nfabor
+ ia(iialty-1+ifac) = 0
+ enddo
+endif
+
+! POUR LES PHYSIQUES PARTICULIERES
+
+if (ippmod(iphpar).ge.1) then
+ call ppprcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ rcodcl , coefu , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+endif
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/preduv.f90 b/src/base/preduv.f90
new file mode 100644
index 0000000..213fe6b
--- /dev/null
+++ b/src/base/preduv.f90
@@ -0,0 +1,2033 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine preduv &
+!================
+
+ ( idbia0 , idbra0 , iappel , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iterns , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ flumas , flumab , &
+ tslagr , coefa , coefb , &
+ ckupdc , smacel , frcxt , &
+ trava , ximpa , uvwk , dfrcxt , tpucou , trav , &
+ viscf , viscb , viscfi , viscbi , &
+ dam , xam , &
+ drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , xnormp , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS N-S 1 PHASE INCOMPRESSIBLE OU RO VARIABLE
+! SUR UN PAS DE TEMPS (CONVECTION/DIFFUSION - PRESSION /CONTINUITE)
+
+! AU PREMIER APPEL, ON EFFECTUE LA PREDICITION DES VITESSES
+! ET ON CALCULE UN ESTIMATEUR SUR LA VITESSE PREDITE
+
+! AU DEUXIEME APPEL, ON CALCULE UN ESTIMATEUR GLOBAL
+! POUR NAVIER-STOKES :
+! ON UTILISE TRAV, SMBR ET LES TABLEAUX DE TRAVAIL
+! ON APPELLE BILSC2 AU LIEU DE CODITS
+! ON REMPLIT LE PROPCE ESTIMATEUR IESTOT
+! CE DEUXIEME APPEL INTERVIENT DANS NAVSTO APRES RESOLP
+! LORS DE CE DEUXIEME APPEL
+! RTPA ET RTP SONT UN UNIQUE TABLEAU (= RTP)
+! LE FLUX DE MASSE EST LE FLUX DE MASSE DEDUIT DE LA VITESSE
+! AU CENTRE CONTENUE DANS RTP
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! iappel ! e ! <-- ! numero d'appel du sous programme !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iterns ! e ! <-- ! numero d'iteration sur navsto !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! flumas ! tr ! <-- ! flux de masse aux faces internes !
+! (nfac ) ! ! ! (distinction iappel=1 ou 2) !
+! flumab ! tr ! <-- ! flux de masse aux faces de bord !
+! (nfabor ) ! ! ! (distinction iappel=1 ou 2) !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! trava,ximpa ! tr ! <-- ! tableau de travail pour couplage !
+! uvwk ! tr ! <-- ! tableau de travail pour couplage u/p !
+! ! ! ! sert a stocker la vitesse de !
+! ! ! ! l'iteration precedente !
+!dfrcxt(ncelet, ! tr ! --> ! variation de force exterieure !
+! 3,nphas) ! ! ! generant la pression hydrostatique !
+! tpucou ! tr ! --> ! couplage vitesse pression !
+! (ncelel,ndim) ! ! ! !
+! trav(ncelet,3 ! tr ! --> ! smb qui servira pour normalisation !
+! ! ! ! dans resolp !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! viscfi(nfac) ! tr ! --- ! idem viscf pour increments !
+! viscbi(nfabor ! tr ! --- ! idem viscb pour increments !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr (ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! xnormp(ncelet ! tr ! <-- ! tableau reel pour norme resolp !
+! coefu(nfab,3) ! tr ! --- ! tableau de travail !
+! tslagr(ncelet ! tr ! <-- ! terme de couplage retour du !
+! ntersl) ! ! ! lagrangien !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "pointe.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "matiss.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , iappel
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iterns
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision flumas(nfac), flumab(nfabor)
+double precision tslagr(ncelet,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision frcxt(ncelet,3,nphas), dfrcxt(ncelet,3,nphas)
+double precision trava(ncelet,ndim,nphas)
+double precision ximpa(ncelet,ndim,nphas),uvwk(ncelet,ndim,nphas)
+double precision tpucou(ncelet,ndim), trav(ncelet,3)
+double precision viscf(nfac), viscb(nfabor)
+double precision viscfi(nfac), viscbi(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet)
+double precision smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision xnormp(ncelet)
+double precision coefu(nfabor,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer iel , ielpdc, ifac , ivar , isou
+integer iccocg, inc , init , iphydp, ii , isqrt
+integer ireslp, nswrgp, imligp, iwarnp, ippt , ipp
+integer ipriph, ikiph , iuiph , iviph , iwiph
+integer iclipr, icliup, iclivp, icliwp
+integer iclik , iclvar, iclvaf
+integer ipcrom, ipcroa, ipcroo , ipcvis, ipcvst
+integer iconvp, idiffp, ndircp, nitmap, nswrsp
+integer ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer idimte, itenso
+integer iesprp, iestop
+integer iptsna
+integer iflmb0, nswrp , imaspe, iismph, ipbrom
+integer idiaex, idtva0
+integer maxelt, ils
+double precision rnorm , vitnor
+double precision romvom, ro0iph, drom
+double precision epsrgp, climgp, extrap, relaxp, blencp, epsilp
+double precision epsrsp
+double precision vit1 , vit2 , vit3, xkb, pip, pfac, pfac1
+double precision cpdc11, cpdc22, cpdc33, cpdc12, cpdc13, cpdc23
+double precision d2s3 , thetap, thetp1, thets , dtsrom
+double precision diipbx, diipby, diipbz
+double precision cx , cy , cz
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipriph = ipr(iphas)
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ ikiph = ik(iphas)
+endif
+
+iclipr = iclrtp(ipriph,icoef)
+icliup = iclrtp(iuiph ,icoef)
+iclivp = iclrtp(iviph ,icoef)
+icliwp = iclrtp(iwiph ,icoef)
+
+if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ iclik = iclrtp(ikiph ,icoef)
+endif
+
+ro0iph = ro0(iphas)
+
+! Reperage de rho au bord
+ipbrom = ipprob(irom (iphas))
+! Reperage de rho courant (ie en cas d'extrapolation rho^n+1/2)
+ipcrom = ipproc(irom (iphas))
+! Reperage de rho^n en cas d'extrapolation
+if(iroext(iphas).gt.0) then
+ ipcroa = ipproc(iroma(iphas))
+else
+ ipcroa = 0
+endif
+
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+! Theta relatif aux termes sources explicites
+thets = thetsn(iphas)
+if(isno2t(iphas).gt.0) then
+ iptsna = ipproc(itsnsa(iphas))
+else
+ iptsna = 0
+endif
+
+
+!===============================================================================
+! 2. GRADIENT DE PRESSION ET GRAVITE
+!===============================================================================
+
+! ---> PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE :
+! UNIQUEMENT AU PREMIER APPEL (I.E. POUR LE CALCUL NORMAL,
+! LE DEUXIEME APPEL EST DESTINE A UN CALCUL D'ESTIMATEUR)
+
+if (iappel.eq.1.and.iphydr.eq.1) then
+
+! force ext au pas de temps precedent :
+! FRCXT a ete initialise a zero
+! (est deja utilise dans typecl, et est mis a jour a la fin
+! de navsto)
+
+ do iel = 1, ncel
+
+! variation de force (utilise dans resolp)
+ drom = (propce(iel,ipcrom)-ro0iph)
+ dfrcxt(iel,1,iphas) = drom*gx - frcxt(iel,1,iphas)
+ dfrcxt(iel,2,iphas) = drom*gy - frcxt(iel,2,iphas)
+ dfrcxt(iel,3,iphas) = drom*gz - frcxt(iel,3,iphas)
+ enddo
+! Ajout eventuel des pertes de charges
+ if (ncepdp.gt.0) then
+ do ielpdc = 1, ncepdp
+ iel=icepdc(ielpdc)
+ vit1 = rtpa(iel,iuiph)
+ vit2 = rtpa(iel,iviph)
+ vit3 = rtpa(iel,iwiph)
+ cpdc11 = ckupdc(ielpdc,1)
+ cpdc22 = ckupdc(ielpdc,2)
+ cpdc33 = ckupdc(ielpdc,3)
+ cpdc12 = ckupdc(ielpdc,4)
+ cpdc13 = ckupdc(ielpdc,5)
+ cpdc23 = ckupdc(ielpdc,6)
+ dfrcxt(iel,1,iphas) = dfrcxt(iel,1,iphas) &
+ -propce(iel,ipcrom)*( &
+ cpdc11*vit1+cpdc12*vit2+cpdc13*vit3)
+ dfrcxt(iel,2,iphas) = dfrcxt(iel,2,iphas) &
+ -propce(iel,ipcrom)*( &
+ cpdc12*vit1+cpdc22*vit2+cpdc23*vit3)
+ dfrcxt(iel,3,iphas) = dfrcxt(iel,3,iphas) &
+ -propce(iel,ipcrom)*( &
+ cpdc13*vit1+cpdc23*vit2+cpdc33*vit3)
+ enddo
+ endif
+! Ajout eventuel de la force de Coriolis
+ if (icorio.eq.1) then
+ do iel = 1, ncel
+ cx = omegay*rtpa(iel,iwiph) - omegaz*rtpa(iel,iviph)
+ cy = omegaz*rtpa(iel,iuiph) - omegax*rtpa(iel,iwiph)
+ cz = omegax*rtpa(iel,iviph) - omegay*rtpa(iel,iuiph)
+ dfrcxt(iel,1,iphas) = dfrcxt(iel,1,iphas) - 2.d0*propce(iel,ipcrom)*cx
+ dfrcxt(iel,2,iphas) = dfrcxt(iel,2,iphas) - 2.d0*propce(iel,ipcrom)*cy
+ dfrcxt(iel,3,iphas) = dfrcxt(iel,3,iphas) - 2.d0*propce(iel,ipcrom)*cz
+ enddo
+ endif
+
+ if(irangp.ge.0) then
+ call parcom (dfrcxt(1,1,iphas))
+ !==========
+ call parcom (dfrcxt(1,2,iphas))
+ !==========
+ call parcom (dfrcxt(1,3,iphas))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dfrcxt(1,1,iphas),dfrcxt(1,1,iphas),dfrcxt(1,1,iphas), &
+ dfrcxt(1,2,iphas),dfrcxt(1,2,iphas),dfrcxt(1,2,iphas), &
+ dfrcxt(1,3,iphas),dfrcxt(1,3,iphas),dfrcxt(1,3,iphas))
+ endif
+
+endif
+
+
+
+! ---> PRISE EN COMPTE DU GRADIENT DE PRESSION
+
+iccocg = 1
+inc = 1
+nswrgp = nswrgr(ipriph)
+imligp = imligr(ipriph)
+iwarnp = iwarni(ipriph)
+epsrgp = epsrgr(ipriph)
+climgp = climgr(ipriph)
+extrap = extrag(ipriph)
+
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipriph , imrgra , inc , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ rtpa(1,ipriph) , coefa(1,iclipr) , coefb(1,iclipr) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! Calcul des efforts aux parois (partie 2/5), si demande
+! La pression a la face est calculee comme dans gradrc/gradmc
+! et on la transforme en pression totale
+! On se limite a la premiere iteration (pour faire simple par
+! rapport a la partie issue de condli, hors boucle)
+if (ineedf.eq.1 .and. iterns.eq.1) then
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ii = idiipb-1+3*(ifac-1)
+ diipbx = ra(ii+1)
+ diipby = ra(ii+2)
+ diipbz = ra(ii+3)
+ pip = rtpa(iel,ipriph) &
+ +diipbx*w1(iel) +diipby*w2(iel) &
+ +diipbz*w3(iel)
+ pfac = coefa(ifac,iclipr) +coefb(ifac,iclipr)*pip
+ pfac1= rtpa(iel,ipriph) &
+ +(cdgfbo(1,ifac)-xyzcen(1,iel))*w1(iel) &
+ +(cdgfbo(2,ifac)-xyzcen(2,iel))*w2(iel) &
+ +(cdgfbo(3,ifac)-xyzcen(3,iel))*w3(iel)
+ pfac = coefb(ifac,iclipr)*(extrag(ipriph)*pfac1 &
+ +(1.d0-extrag(ipriph))*pfac) &
+ +(1.d0-coefb(ifac,iclipr))*pfac &
+ + ro0(iphas)*(gx*(cdgfbo(1,ifac)-xyzp0(1,iphas)) &
+ + gy*(cdgfbo(2,ifac)-xyzp0(2,iphas)) &
+ + gz*(cdgfbo(3,ifac)-xyzp0(3,iphas)) ) &
+ - pred0(iphas)
+! on ne rajoute pas P0, pour garder un maximum de precision
+! & + P0(IPHAS)
+ do isou = 1, 3
+ ra(iforbr+(ifac-1)*ndim + isou-1) = &
+ ra(iforbr+(ifac-1)*ndim + isou-1) &
+ + pfac*surfbo(isou,ifac)
+ enddo
+ enddo
+endif
+
+! ---> RESIDU DE NORMALISATION POUR RESOLP
+! Test d'un residu de normalisation de l'etape de pression
+! plus comprehensible = div(rho u* + dt gradP^(n))-Gamma
+! i.e. second membre du systeme en pression hormis la partie
+! pression (sinon a convergence, on tend vers 0)
+! Represente les termes que la pression doit equilibrer
+! On calcule ici div(rho dt/rho gradP^(n)) et on complete a la fin
+! avec div(rho u*)
+! Pour grad P^(n) on suppose que des CL de Neumann homogenes
+! s'appliquent partout : on peut donc utiliser les CL de la
+! vitesse pour u*+dt/rho gradP^(n). Comme on calcule en deux fois,
+! on utilise les CL de vitesse homogenes pour dt/rho gradP^(n)
+! ci-dessous et les CL de vitesse completes pour u* a la fin.
+
+if(iappel.eq.1.and.irnpnw.eq.1) then
+
+! Calcul de dt/rho*grad P
+ do iel = 1, ncel
+ dtsrom = dt(iel)/propce(iel,ipcrom)
+ trav(iel,1) = w1(iel)*dtsrom
+ trav(iel,2) = w2(iel)*dtsrom
+ trav(iel,3) = w3(iel)*dtsrom
+ enddo
+
+ if(irangp.ge.0) then
+ call parcom (trav(1,1))
+ !==========
+ call parcom (trav(1,2))
+ !==========
+ call parcom (trav(1,3))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ trav(1,1),trav(1,1),trav(1,1), &
+ trav(1,2),trav(1,2),trav(1,2), &
+ trav(1,3),trav(1,3),trav(1,3))
+ endif
+
+! Calcul de rho dt/rho*grad P.n aux faces
+! Pour gagner du temps, on ne reconstruit pas.
+ init = 1
+ inc = 0
+ iccocg = 1
+ iflmb0 = 1
+ nswrp = 1
+ imligp = imligr(iuiph )
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(iuiph )
+ climgp = climgr(iuiph )
+ extrap = extrag(iuiph )
+
+ imaspe = 1
+
+ iismph = iisymp+nfabor*(iphas-1)
+
+ call inimas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ trav(1,1) , trav(1,2) , trav(1,3) , &
+ coefa(1,icliup), coefa(1,iclivp), coefa(1,icliwp), &
+ coefb(1,icliup), coefb(1,iclivp), coefb(1,icliwp), &
+ viscf , viscb , &
+ w4 , w5 , w6 , w7 , w8 , w9 , &
+ smbr , drtp , rovsdt , coefu , &
+ rdevel , rtuser , ra )
+
+! Calcul de div(rho dt/rho*grad P)
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,xnormp)
+
+! Ajout de -Gamma
+ if (ncesmp.gt.0) then
+ do ii = 1, ncesmp
+ iel = icetsm(ii)
+ xnormp(iel) = xnormp(iel)-volume(iel)*smacel(ii,ipriph)
+ enddo
+ endif
+
+! On conserve XNORMP, on complete avec u* a la fin et
+! on le transfere a resolp
+
+endif
+
+
+! Au premier appel, TRAV est construit directement ici.
+! Au second appel (estimateurs), TRAV contient deja
+! l'increment temporel.
+! On pourrait fusionner en initialisant TRAV a zero
+! avant le premier appel, mais ca fait des operations en plus.
+
+! Remarques :
+! rho g sera a l'ordre 2 s'il est extrapole.
+! si on itere sur navsto, ca ne sert a rien de recalculer rho g a
+! chaque fois (ie on pourrait le passer dans trava) mais ce n'est
+! pas cher.
+if(iappel.eq.1) then
+
+ if (iphydr.eq.1) then
+ do iel = 1, ncel
+ trav(iel,1) = (frcxt(iel,1,iphas) - w1(iel)) * volume(iel)
+ trav(iel,2) = (frcxt(iel,2,iphas) - w2(iel)) * volume(iel)
+ trav(iel,3) = (frcxt(iel,3,iphas) - w3(iel)) * volume(iel)
+ enddo
+ else
+ do iel = 1, ncel
+ drom = (propce(iel,ipcrom)-ro0iph)
+ trav(iel,1) = ( drom*gx - w1(iel) ) * volume(iel)
+ trav(iel,2) = ( drom*gy - w2(iel) ) * volume(iel)
+ trav(iel,3) = ( drom*gz - w3(iel) ) * volume(iel)
+ enddo
+ endif
+
+elseif(iappel.eq.2) then
+
+ if (iphydr.eq.1) then
+ do iel = 1, ncel
+ trav(iel,1) = &
+ trav(iel,1) + ( frcxt(iel,1,iphas) - &
+ w1(iel) )*volume(iel)
+ trav(iel,2) = &
+ trav(iel,2) + ( frcxt(iel,2,iphas) - &
+ w2(iel) )*volume(iel)
+ trav(iel,3) = &
+ trav(iel,3) + ( frcxt(iel,3,iphas) - &
+ w3(iel) )*volume(iel)
+ enddo
+ else
+ do iel = 1, ncel
+ drom = (propce(iel,ipcrom)-ro0iph)
+ trav(iel,1) = &
+ trav(iel,1) + ( drom*gx - w1(iel) )*volume(iel)
+ trav(iel,2) = &
+ trav(iel,2) + ( drom*gy - w2(iel) )*volume(iel)
+ trav(iel,3) = &
+ trav(iel,3) + ( drom*gz - w3(iel) )*volume(iel)
+ enddo
+ endif
+
+endif
+
+! Pour IAPPEL = 1 (ie appel standard sans les estimateurs)
+! TRAV rassemble les termes sources qui seront recalcules
+! a toutes les iterations sur navsto
+! Si on n'itere pas sur navsto et qu'on n'extrapole pas les
+! termes sources, TRAV contient tous les termes sources
+! jusqu'au basculement dans SMBR
+! A ce niveau, TRAV contient -grad P et rho g
+! P est suppose pris a n+1/2
+! rho est eventuellement interpole a n+1/2
+
+
+! ---> INITIALISATION DU TABLEAU TRAVA et PROPCE AU PREMIER PASSAGE
+! (A LA PREMIERE ITER SUR NAVSTO)
+
+! TRAVA rassemble les termes sources qu'il suffit de calculer
+! a la premiere iteration sur navsto quand il y a plusieurs iter.
+! Quand il n'y a qu'une iter, on cumule directement dans TRAV
+! ce qui serait autrement alle dans TRAVA
+! PROPCE rassemble les termes sources explicites qui serviront
+! pour le pas de temps suivant en cas d'extrapolation (plusieurs
+! iter sur navsto ou pas)
+
+! A la premiere iter sur navsto
+if(iterns.eq.1) then
+
+! Si on extrapole les T.S. : -theta*valeur precedente
+ if(isno2t(iphas).gt.0) then
+! S'il n'y a qu'une iter : TRAV incremente
+ if(nterup.eq.1) then
+ do ii = 1, ndim
+ do iel = 1, ncel
+ trav (iel,ii) = trav (iel,ii) &
+ - thets*propce(iel,iptsna+ii-1)
+ enddo
+ enddo
+! S'il y a plusieurs iter : TRAVA initialise
+ else
+ do ii = 1, ndim
+ do iel = 1, ncel
+ trava(iel,ii,iphas) = &
+ - thets*propce(iel,iptsna+ii-1)
+ enddo
+ enddo
+ endif
+! Et on initialise PROPCE pour le remplir ensuite
+ do ii = 1, ndim
+ do iel = 1, ncel
+ propce(iel,iptsna+ii-1) = 0.d0
+ enddo
+ enddo
+
+! Si on n'extrapole pas les T.S. : pas de PROPCE
+ else
+! S'il y a plusieurs iter : TRAVA initialise
+! sinon TRAVA n'existe pas
+ if(nterup.gt.1) then
+ do ii = 1, ndim
+ do iel = 1, ncel
+ trava(iel,ii,iphas) = 0.d0
+ enddo
+ enddo
+ endif
+ endif
+
+ endif
+
+! ---> 2/3 RHO * GRADIENT DE K SI k-epsilon ou k-omega
+! NB : ON NE PREND PAS LE GRADIENT DE (RHO K), MAIS
+! CA COMPLIQUERAIT LA GESTION DES CL ...
+! On peut se demander si l'extrapolation en temps sert a
+! quelquechose
+
+! Ce terme explicite est calcule une seule fois,
+! a la premiere iter sur navsto : il va dans PROPCE si on
+! doit l'extrapoler en temps ; il va dans TRAVA si on n'extrapole
+! pas mais qu'on itere sur navsto. Il va dans TRAV si on
+! n'extrapole pas et qu'on n'itere pas sur navsto.
+if( (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) &
+ .and.igrhok(iphas).eq.1.and.iterns.eq.1)then
+ iccocg = 1
+ inc = 1
+ nswrgp = nswrgr(ikiph)
+ imligp = imligr(ikiph)
+ epsrgp = epsrgr(ikiph)
+ climgp = climgr(ikiph)
+ extrap = extrag(ikiph)
+
+ iwarnp = iwarni(iuiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ikiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,ikiph) , coefa(1,iclik) , coefb(1,iclik) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ d2s3 = 2.d0/3.d0
+
+! Si on extrapole les termes source en temps : PROPCE
+ if(isno2t(iphas).gt.0) then
+! Calcul de rho^n grad k^n si rho non extrapole
+! rho^n grad k^n si rho extrapole
+ ipcroo = ipcrom
+ if(iroext(iphas).gt.0) ipcroo = ipcroa
+ do iel = 1, ncel
+ romvom = -propce(iel,ipcroo)*volume(iel)*d2s3
+ propce(iel,iptsna )=propce(iel,iptsna )+w1(iel)*romvom
+ propce(iel,iptsna+1)=propce(iel,iptsna+1)+w2(iel)*romvom
+ propce(iel,iptsna+2)=propce(iel,iptsna+2)+w3(iel)*romvom
+ enddo
+! Si on n'extrapole pas les termes sources en temps : TRAV ou TRAVA
+ else
+ if(nterup.eq.1) then
+ do iel = 1, ncel
+ romvom = -propce(iel,ipcrom)*volume(iel)*d2s3
+ trav (iel,1) = &
+ trav (iel,1) + w1(iel) * romvom
+ trav (iel,2) = &
+ trav (iel,2) + w2(iel) * romvom
+ trav (iel,3) = &
+ trav (iel,3) + w3(iel) * romvom
+ enddo
+ else
+ do iel = 1, ncel
+ romvom = -propce(iel,ipcrom)*volume(iel)*d2s3
+ trava(iel,1,iphas) = &
+ trava(iel,1,iphas) + w1(iel) * romvom
+ trava(iel,2,iphas) = &
+ trava(iel,2,iphas) + w2(iel) * romvom
+ trava(iel,3,iphas) = &
+ trava(iel,3,iphas) + w3(iel) * romvom
+ enddo
+ endif
+ endif
+
+! Calcul des efforts aux parois (partie 3/5), si demande
+ if (ineedf.eq.1) then
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ii = idiipb-1+3*(ifac-1)
+ diipbx = ra(ii+1)
+ diipby = ra(ii+2)
+ diipbz = ra(ii+3)
+ xkb = rtpa(iel,ikiph) + diipbx*w1(iel) &
+ + diipby*w2(iel) + diipbz*w3(iel)
+ xkb = coefa(ifac,iclik)+coefb(ifac,iclik)*xkb
+ xkb = d2s3*propce(iel,ipcrom)*xkb
+ do isou = 1, 3
+ ra(iforbr+(ifac-1)*ndim + isou-1) = &
+ ra(iforbr+(ifac-1)*ndim + isou-1) &
+ + xkb*surfbo(isou,ifac)
+ enddo
+ enddo
+ endif
+endif
+
+
+! ---> TERMES DE GRADIENT TRANSPOSE
+
+! Ce terme explicite est calcule une seule fois,
+! a la premiere iter sur navsto :
+! si on extrapole il va dans PROPCE,
+! sinon si on itere sur navsto dans TRAVA
+! sinon dans TRAV
+if (ivisse(iphas).eq.1.and.iterns.eq.1) then
+
+! On utilise temporairement TRAV comme tableau de travail.
+! Son contenu est stocke dans W7, W8 et W9 jusqu'apres vissec
+ do iel = 1,ncel
+ w7(iel) = trav(iel,1)
+ w8(iel) = trav(iel,2)
+ w9(iel) = trav(iel,3)
+ trav(iel,1) = 0.d0
+ trav(iel,2) = 0.d0
+ trav(iel,3) = 0.d0
+ enddo
+
+ call vissec &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ trav , &
+! ------
+ viscf , viscb , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les termes source en temps :
+! PROPCE recoit les termes de gradient transpose et
+! TRAV retrouve sa valeur
+ if(isno2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsna ) = propce(iel,iptsna ) + trav(iel,1)
+ propce(iel,iptsna+1) = propce(iel,iptsna+1) + trav(iel,2)
+ propce(iel,iptsna+2) = propce(iel,iptsna+2) + trav(iel,3)
+ trav(iel,1) = w7(iel)
+ trav(iel,2) = w8(iel)
+ trav(iel,3) = w9(iel)
+ enddo
+
+! Si on n'extrapole pas les termes source en temps :
+! Si on itere sur navsto
+! TRAVA recoit les termes de gradient transpose et
+! TRAV retrouve sa valeur
+ else
+ if(nterup.gt.1) then
+ do iel = 1, ncel
+ trava(iel,1,iphas) = trava(iel,1,iphas) + trav(iel,1)
+ trava(iel,2,iphas) = trava(iel,2,iphas) + trav(iel,2)
+ trava(iel,3,iphas) = trava(iel,3,iphas) + trav(iel,3)
+ trav(iel,1) = w7(iel)
+ trav(iel,2) = w8(iel)
+ trav(iel,3) = w9(iel)
+ enddo
+! Si on n'itere pas sur navsto
+! TRAV retrouve sa valeur augmentee des termes de gradient transpose
+ else
+ do iel = 1, ncel
+ trav(iel,1) = w7(iel) + trav(iel,1)
+ trav(iel,2) = w8(iel) + trav(iel,2)
+ trav(iel,3) = w9(iel) + trav(iel,3)
+ enddo
+ endif
+ endif
+
+endif
+
+
+! ---> TERMES DE PERTES DE CHARGE
+! SI IPHYDR=1 LE TERME A DEJA ETE PRIS EN COMPTE AVANT
+
+if((ncepdp.gt.0).and.(iphydr.eq.0)) then
+
+! Les termes diagonaux sont places dans TRAV ou TRAVA,
+! La prise en compte de UVWK a partir de la seconde iteration
+! est faite directement dans codits.
+ if(iterns.eq.1) then
+
+! On utilise temporairement TRAV comme tableau de travail.
+! Son contenu est stocke dans W7, W8 et W9 jusqu'apres tsepdc
+ do iel = 1,ncel
+ w7(iel) = trav(iel,1)
+ w8(iel) = trav(iel,2)
+ w9(iel) = trav(iel,3)
+ trav(iel,1) = 0.d0
+ trav(iel,2) = 0.d0
+ trav(iel,3) = 0.d0
+ enddo
+
+ idiaex = 1
+ call tsepdc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , idiaex , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , trav , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Si on itere sur navsto, on utilise TRAVA ; sinon TRAV
+ if(nterup.gt.1) then
+ do iel = 1, ncel
+ trava(iel,1,iphas) = trava(iel,1,iphas) + trav(iel,1)
+ trava(iel,2,iphas) = trava(iel,2,iphas) + trav(iel,2)
+ trava(iel,3,iphas) = trava(iel,3,iphas) + trav(iel,3)
+ trav(iel,1) = w7(iel)
+ trav(iel,2) = w8(iel)
+ trav(iel,3) = w9(iel)
+ enddo
+ else
+ do iel = 1, ncel
+ trav(iel,1) = w7(iel) + trav(iel,1)
+ trav(iel,2) = w8(iel) + trav(iel,2)
+ trav(iel,3) = w9(iel) + trav(iel,3)
+ enddo
+ endif
+ endif
+
+! Les termes extradiagonaux ne sont calcules qu'au premier passage
+! si on extrapole il va dans PROPCE,
+! sinon si on itere sur navsto dans TRAVA
+! sinon dans TRAV
+
+ if(iterns.eq.1) then
+
+! On utilise temporairement TRAV comme tableau de travail.
+! Son contenu est stocke dans W7, W8 et W9 jusqu'apres tsepdc
+ do iel = 1,ncel
+ w7(iel) = trav(iel,1)
+ w8(iel) = trav(iel,2)
+ w9(iel) = trav(iel,3)
+ trav(iel,1) = 0.d0
+ trav(iel,2) = 0.d0
+ trav(iel,3) = 0.d0
+ enddo
+
+ idiaex = 2
+ call tsepdc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , idiaex , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , trav , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! Si on extrapole les termes source en temps :
+! PROPCE recoit les termes extradiagonaux et
+! TRAV retrouve sa valeur
+ if(isno2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsna ) = propce(iel,iptsna ) + trav(iel,1)
+ propce(iel,iptsna+1) = propce(iel,iptsna+1) + trav(iel,2)
+ propce(iel,iptsna+2) = propce(iel,iptsna+2) + trav(iel,3)
+ trav(iel,1) = w7(iel)
+ trav(iel,2) = w8(iel)
+ trav(iel,3) = w9(iel)
+ enddo
+
+! Si on n'extrapole pas les termes source en temps :
+! Si on itere sur navsto
+! TRAVA recoit les termes extradiagonaux et
+! TRAV retrouve sa valeur
+ else
+ if(nterup.gt.1) then
+ do iel = 1, ncel
+ trava(iel,1,iphas) = trava(iel,1,iphas) + trav(iel,1)
+ trava(iel,2,iphas) = trava(iel,2,iphas) + trav(iel,2)
+ trava(iel,3,iphas) = trava(iel,3,iphas) + trav(iel,3)
+ trav(iel,1) = w7(iel)
+ trav(iel,2) = w8(iel)
+ trav(iel,3) = w9(iel)
+ enddo
+! Si on n'itere pas sur navsto
+! TRAV retrouve sa valeur augmentee des termes extradiagonaux
+ else
+ do iel = 1, ncel
+ trav(iel,1) = w7(iel) + trav(iel,1)
+ trav(iel,2) = w8(iel) + trav(iel,2)
+ trav(iel,3) = w9(iel) + trav(iel,3)
+ enddo
+ endif
+ endif
+
+ endif
+
+endif
+
+
+! ---> TERMES DE CORIOLIS
+! SI IPHYDR=1 LE TERME A DEJA ETE PRIS EN COMPTE AVANT
+
+if (icorio.eq.1.and.iphydr.eq.0) then
+
+ ! A la premiere iter sur navsto, on ajoute la partie issue des
+ ! termes explicites
+ if (iterns.eq.1) then
+
+ ! Si on extrapole les termes source en temps :
+ if(isno2t(iphas).gt.0) then
+
+ do iel = 1, ncel
+ cx = omegay*rtpa(iel,iwiph) - omegaz*rtpa(iel,iviph)
+ cy = omegaz*rtpa(iel,iuiph) - omegax*rtpa(iel,iwiph)
+ cz = omegax*rtpa(iel,iviph) - omegay*rtpa(iel,iuiph)
+ romvom = -2.d0*propce(iel,ipcrom)*volume(iel)
+ propce(iel,iptsna ) = propce(iel,iptsna ) + romvom*cx
+ propce(iel,iptsna+1) = propce(iel,iptsna+1) + romvom*cy
+ propce(iel,iptsna+2) = propce(iel,iptsna+2) + romvom*cz
+ enddo
+
+ ! Si on n'extrapole pas les termes source en temps :
+ else
+
+ ! Si on n'itere pas sur navsto : TRAV
+ if (nterup.eq.1) then
+
+ do iel = 1, ncel
+ cx = omegay*rtpa(iel,iwiph) - omegaz*rtpa(iel,iviph)
+ cy = omegaz*rtpa(iel,iuiph) - omegax*rtpa(iel,iwiph)
+ cz = omegax*rtpa(iel,iviph) - omegay*rtpa(iel,iuiph)
+ romvom = -2.d0*propce(iel,ipcrom)*volume(iel)
+ trav(iel,1) = trav(iel,1) + romvom*cx
+ trav(iel,2) = trav(iel,2) + romvom*cy
+ trav(iel,3) = trav(iel,3) + romvom*cz
+ enddo
+
+ ! Si on itere sur navsto : TRAVA
+ else
+
+ do iel = 1, ncel
+ cx = omegay*rtpa(iel,iwiph) - omegaz*rtpa(iel,iviph)
+ cy = omegaz*rtpa(iel,iuiph) - omegax*rtpa(iel,iwiph)
+ cz = omegax*rtpa(iel,iviph) - omegay*rtpa(iel,iuiph)
+ romvom = -2.d0*propce(iel,ipcrom)*volume(iel)
+ trava(iel,1,iphas) = trava(iel,1,iphas) + romvom*cx
+ trava(iel,2,iphas) = trava(iel,2,iphas) + romvom*cy
+ trava(iel,3,iphas) = trava(iel,3,iphas) + romvom*cz
+ enddo
+
+ endif
+
+ endif
+ endif
+endif
+
+
+! ---> - DIVERGENCE DE RIJ
+
+if(itytur(iphas).eq.3.and.iterns.eq.1) then
+
+ do isou = 1, 3
+
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+
+ call divrij &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , isou , ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,w1)
+
+! Si on extrapole les termes source en temps :
+! PROPCE recoit les termes de divergence
+ if(isno2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsna+isou-1 ) = &
+ propce(iel,iptsna+isou-1 ) - w1(iel)
+ enddo
+! Si on n'extrapole pas les termes source en temps :
+ else
+! si on n'itere pas sur navsto : TRAV
+ if(nterup.eq.1) then
+ do iel = 1, ncel
+ trav(iel,isou) = trav(iel,isou) - w1(iel)
+ enddo
+! si on itere sur navsto : TRAVA
+ else
+ do iel = 1, ncel
+ trava(iel,isou,iphas) = trava(iel,isou,iphas) - w1(iel)
+ enddo
+ endif
+ endif
+
+ enddo
+
+endif
+
+
+! ---> "VITESSE" DE DIFFUSION FACETTE
+! SI ON FAIT AUTRE CHOSE QUE DU K EPS, IL FAUDRA LA METTRE
+! DANS LA BOUCLE
+
+if( idiff(iuiph).ge. 1 ) then
+
+! --- Si la vitesse doit etre diffusee, on calcule la viscosite
+! pour le second membre (selon Rij ou non)
+
+ if (itytur(iphas).eq.3) then
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis)
+ enddo
+ else
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(iuiph)*propce(iel,ipcvst)
+ enddo
+ endif
+
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+! Quand on n'est pas en Rij ou que irijnu = 0, les tableaux
+! VISCFI, VISCBI se trouvent remplis par la meme occasion
+! (ils sont confondus avec VISCF, VISCB)
+! En Rij avec irijnu = 1, on calcule la viscosite increment
+! de la matrice dans VISCFI, VISCBI
+
+ if(itytur(iphas).eq.3.and.irijnu(iphas).eq.1) then
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(iuiph)*propce(iel,ipcvst)
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscfi , viscbi , &
+ rdevel , rtuser , ra )
+ endif
+
+else
+
+! --- Si la vitesse n'a pas de diffusion, on annule la viscosite
+! (matrice et second membre sont dans le meme tableau,
+! sauf en Rij avec IRIJNU = 1)
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ if(itytur(iphas).eq.3.and.irijnu(iphas).eq.1) then
+ do ifac = 1, nfac
+ viscfi(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscbi(ifac) = 0.d0
+ enddo
+ endif
+
+endif
+
+
+! 2.2 RESOLUTION IMPLICITE NON COUPLEE DES 3 COMPO. DE VITESSES
+! ==============================================================
+
+
+! ---> AU PREMIER APPEL,
+! MISE A ZERO DE L'ESTIMATEUR POUR LA VITESSE PREDITE
+! S'IL DOIT ETRE CALCULE
+
+if (iappel.eq.1) then
+ if(iescal(iespre,iphas).gt.0) then
+ iesprp = ipproc(iestim(iespre,iphas))
+ do iel = 1, ncel
+ propce(iel,iesprp) = 0.d0
+ enddo
+ endif
+endif
+
+! ---> AU DEUXIEME APPEL,
+! MISE A ZERO DE L'ESTIMATEUR TOTAL POUR NAVIER-STOKES
+! (SI ON FAIT UN DEUXIEME APPEL, ALORS IL DOIT ETRE CALCULE)
+
+if(iappel.eq.2) then
+ iestop = ipproc(iestim(iestot,iphas))
+ do iel = 1, ncel
+ propce(iel,iestop) = 0.d0
+ enddo
+endif
+
+
+! ---> BOUCLE SUR LES DIRECTIONS DE L'ESPACE (U, V, W)
+
+
+! Remarque : On suppose que le couplage vitesse pression
+! n'est valable que pour une seule phase.
+
+do isou = 1, 3
+
+ if(isou.eq.1) then
+ ivar = iuiph
+ ippt = ipptx
+ endif
+ if(isou.eq.2) then
+ ivar = iviph
+ ippt = ippty
+ endif
+ if(isou.eq.3) then
+ ivar = iwiph
+ ippt = ipptz
+ endif
+ ipp = ipprtp(ivar)
+
+ iclvar = iclrtp(ivar,icoef)
+ iclvaf = iclrtp(ivar,icoeff)
+
+
+! ---> TERMES SOURCES UTILISATEURS
+
+ do iel = 1, ncel
+ w7 (iel) = 0.d0
+ drtp (iel) = 0.d0
+ enddo
+
+! Le calcul des parties implicite et explicite des termes sources
+! utilisateurs est faite uniquement a la premiere iter sur navsto.
+ if(iterns.eq.1) then
+
+ if (imatis.eq.1) then
+
+ call mttsns &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w7 , drtp , &
+! ------ ------
+ dam , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ else
+
+ maxelt = max(ncelet, nfac, nfabor)
+ ils = idebia
+ ifinia = ils + maxelt
+ CALL IASIZE('PREDUV',IFINIA)
+
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w7 , drtp , &
+! ------ ------
+ dam , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ if (nbrcpl.gt.0) then
+ call csccel &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w7 , drtp , &
+! ------ ------
+ dam , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+ endif
+
+ endif
+
+! On conserve la partie implicite pour les autres iter sur navsto
+ if(iterns.eq.1.and.nterup.gt.1) then
+ do iel = 1, ncel
+ ximpa(iel,isou,iphas) = drtp(iel)
+ enddo
+ endif
+
+! On ajoute a TRAV ou TRAVA la partie issue des termes implicites
+! en utilisant DRTP
+! La prise en compte de UVWK a partir de la seconde iteration
+! est faite directement dans codits.
+! En schema std en temps, on continue a mettre MAX(-DRTP,0) dans la matrice
+! Avec termes sources a l'ordre 2, on implicite DRTP quel que soit son signe
+! (si on le met dans la matrice ou non selon son signe, on risque de ne pas
+! avoir le meme traitement d'un pas de temps au suivant)
+ if(iterns.eq.1) then
+ if(nterup.gt.1) then
+ do iel = 1, ncel
+ trava(iel,isou,iphas) = trava(iel,isou,iphas) &
+ + drtp(iel)*rtpa(iel,ivar)
+ enddo
+ else
+ do iel = 1, ncel
+ trav(iel,isou) = trav(iel,isou) &
+ + drtp(iel)*rtpa(iel,ivar)
+ enddo
+ endif
+ endif
+
+! A la premiere iter sur navsto, on ajoute la partie issue des
+! termes explicites
+ if(iterns.eq.1) then
+! Si on extrapole les termes source en temps :
+! PROPCE recoit les termes explicites
+ if(isno2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsna+isou-1 ) = &
+ propce(iel,iptsna+isou-1 ) + w7(iel)
+ enddo
+! Si on n'extrapole pas les termes source en temps :
+ else
+! si on n'itere pas sur navsto : TRAV
+ if(nterup.eq.1) then
+ do iel = 1, ncel
+ trav(iel,isou) = trav(iel,isou) + w7(iel)
+ enddo
+! si on itere sur navsto : TRAVA
+ else
+ do iel = 1, ncel
+ trava(iel,isou,iphas) = &
+ trava(iel,isou,iphas) + w7(iel)
+ enddo
+ endif
+ endif
+ endif
+
+
+! ---> TERME D'ACCUMULATION DE MASSE -(dRO/dt)*Volume
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,flumas,flumab,w1)
+
+
+! On ajoute a TRAV ou TRAVA la partie issue des termes implicites
+ if(iterns.eq.1) then
+ if(nterup.gt.1) then
+ do iel = 1, ncel
+ trava(iel,isou,iphas) = trava(iel,isou,iphas) &
+ +iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+ enddo
+ else
+ do iel = 1, ncel
+ trav(iel,isou) = trav(iel,isou) &
+ +iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+ enddo
+ endif
+ endif
+
+ if(iappel.eq.1) then
+! Extrapolation ou non, meme forme par coherence avec bilsc2
+ do iel = 1, ncel
+ rovsdt(iel) = &
+ istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel) &
+ -iconv(ivar)*w1(iel)*thetav(ivar)
+ enddo
+
+! Le remplissage de ROVSDT est toujours indispensable,
+! meme si on peut se contenter de n'importe quoi pour IAPPEL=2.
+ else
+ do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+ enddo
+ endif
+
+! ---> TERMES SOURCES UTILISATEUR
+
+ if(iappel.eq.1) then
+ if(isno2t(iphas).gt.0) then
+ thetap = thetav(ivar)
+ if(iterns.gt.1) then
+ do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) -ximpa(iel,isou,iphas)*thetap
+ enddo
+ else
+ do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) -drtp(iel)*thetap
+ enddo
+ endif
+ else
+ if(iterns.gt.1) then
+ do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + max(-ximpa(iel,isou,iphas),zero)
+ enddo
+ else
+ do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + max(-drtp(iel),zero)
+ enddo
+ endif
+ endif
+ endif
+
+
+! ---> PERTES DE CHARGE
+
+! Au second appel, on n'a pas besoin de rovsdt
+ if(iappel.eq.1) then
+ if (ncepdp.gt.0) then
+ if(isno2t(iphas).gt.0) then
+ thetap = thetav(ivar)
+ else
+ thetap = 1.d0
+ endif
+ do ielpdc = 1, ncepdp
+ iel = icepdc(ielpdc)
+ rovsdt(iel) = rovsdt(iel) + &
+ propce(iel,ipcrom)*volume(iel)*ckupdc(ielpdc,isou)*thetap
+ enddo
+ endif
+ endif
+
+
+! ---> TERMES DE SOURCE DE MASSE
+
+ if (ncesmp.gt.0) then
+
+! On calcule les termes Gamma (uinj - u)
+! -Gamma u a la premiere iteration est mis dans
+! TRAV ou TRAVA selon qu'on itere ou non sur navsto
+! Gamma uinj a la premiere iteration est placee dans W1
+! ROVSDT a chaque iteration recoit Gamma
+ if(nterup.eq.1) then
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iterns , isno2t(iphas), thetav(ivar),&
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) ,smacel(1,ipr(iphas)) ,&
+ trav(1,isou) , rovsdt , w1 )
+ else
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iterns , isno2t(iphas), thetav(ivar),&
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) ,smacel(1,ipr(iphas)) ,&
+ trava(1,isou,iphas) , rovsdt , w1 )
+ endif
+
+! A la premiere iter sur navsto, on ajoute la partie Gamma uinj
+ if(iterns.eq.1) then
+! Si on extrapole les termes source en temps :
+! PROPCE recoit les termes explicites
+ if(isno2t(iphas).gt.0) then
+ do iel = 1,ncel
+ propce(iel,iptsna+isou-1 ) = &
+ propce(iel,iptsna+isou-1 ) + w1(iel)
+ enddo
+! Si on n'extrapole pas les termes source en temps :
+ else
+! si on n'itere pas sur navsto : TRAV
+ if(nterup.eq.1) then
+ do iel = 1,ncel
+ trav(iel,isou) = trav(iel,isou) + w1(iel)
+ enddo
+! si on itere sur navsto : TRAVA
+ else
+ do iel = 1,ncel
+ trava(iel,isou,iphas) = &
+ trava(iel,isou,iphas) + w1(iel)
+ enddo
+ endif
+ endif
+ endif
+
+ endif
+
+
+! ---> INITIALISATION DU SECOND MEMBRE
+
+! Si on extrapole les TS
+ if(isno2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+! Si on n'itere pas sur navsto : TRAVA n'existe pas
+ if(nterup.eq.1) then
+ do iel = 1, ncel
+ smbr(iel) = trav(iel,isou) &
+ + thetp1*propce(iel,iptsna+isou-1)
+ enddo
+! Si on itere sur navsto : tout existe
+ else
+ do iel = 1, ncel
+ smbr(iel) = trav(iel,isou) + trava(iel,isou,iphas) &
+ + thetp1*propce(iel,iptsna+isou-1)
+ enddo
+ endif
+! Si on n'extrapole pas les TS : PROPCE n'existe pas
+ else
+! Si on n'itere pas sur navsto : TRAVA n'existe pas
+ if(nterup.eq.1) then
+ do iel = 1, ncel
+ smbr(iel) = trav(iel,isou)
+ enddo
+! Si on itere sur navsto : TRAVA existe
+ else
+ do iel = 1, ncel
+ smbr(iel) = trav(iel,isou) + trava(iel,isou,iphas)
+ enddo
+ endif
+ endif
+
+
+! ---> LAGRANGIEN : COUPLAGE RETOUR
+
+! L'ordre 2 sur les termes issus du lagrangien necessiterait de
+! decomposer TSLAGR(IEL,ISOU) en partie implicite et
+! explicite, comme c'est fait dans ustsns.
+! Pour le moment, on n'y touche pas.
+ if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.ilphas) then
+
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + tslagr(iel,itsvx+isou-1)
+ enddo
+! Au second appel, on n'a pas besoin de rovsdt
+ if(iappel.eq.1) then
+ do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) + max(-tslagr(iel,itsli),zero)
+ enddo
+ endif
+
+ endif
+
+! ---> VERSIONS ELECTRIQUES : Arc Electrique (Force de Laplace)
+! Pour le moment, pas d'ordre 2 en temps.
+
+ if ( ippmod(ielarc) .ge. 1 ) then
+ do iel = 1,ncel
+ smbr(iel) = smbr(iel) &
+ + volume(iel)*propce(iel,ipproc(ilapla(isou)))
+ enddo
+ endif
+
+
+! ---> PARAMETRES POUR LA RESOLUTION DU SYSTEME OU LE CALCUL DE l'ESTIMATEUR
+
+ iconvp = iconv (ivar)
+ idiffp = idiff (ivar)
+ ireslp = iresol(ivar)
+ ndircp = ndircl(ivar)
+ nitmap = nitmax(ivar)
+!MO IMRGRA
+ nswrsp = nswrsm(ivar)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ ircflp = ircflu(ivar)
+ ischcp = ischcv(ivar)
+ isstpp = isstpc(ivar)
+ imgrp = imgr (ivar)
+ ncymxp = ncymax(ivar)
+ nitmfp = nitmgf(ivar)
+!MO IPP
+ iwarnp = iwarni(ivar)
+ blencp = blencv(ivar)
+ epsilp = epsilo(ivar)
+ epsrsp = epsrsm(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ relaxp = relaxv(ivar)
+ thetap = thetav(ivar)
+
+ if(iappel.eq.1) then
+
+ iescap = iescal(iespre,iphas)
+
+! ---> FIN DE LA CONSTRUCTION ET DE LA RESOLUTION DU SYSTEME
+
+ if(iterns.eq.1) then
+
+! Attention, dans le cas des estimateurs, DAM fournit l'estimateur
+! des vitesses predites
+ call codits &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ flumas , flumab , &
+ viscfi , viscbi , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ elseif(iterns.gt.1) then
+
+ call codits &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , uvwk(1,isou,iphas) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ flumas , flumab , &
+ viscfi , viscbi , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! DANS LE CAS DE PERTES DE CHARGE, ON UTILISE LES TABLEAUX
+! TPUCOU POUR LA PHASE D'IMPLICITATION
+! Attention, il faut regarder s'il y a des pdc sur un proc quelconque,
+! pas uniquement en local.
+ if((ncpdct(iphas).gt.0).and.(ipucou.eq.0)) then
+ do iel = 1,ncel
+ tpucou(iel,isou) = dt(iel)
+ enddo
+ do ielpdc = 1, ncepdp
+ iel=icepdc(ielpdc)
+ tpucou(iel,isou) = 1.d0/( &
+ 1.d0/dt(iel)+ckupdc(ielpdc,isou))
+ enddo
+ endif
+
+! COUPLAGE P/U RENFORCE : CALCUL DU VECTEUR T, STOCKE DANS TPUCOU
+! ON PASSE DANS CODITS, EN NE FAISANT QU'UN SEUL SWEEP, ET EN
+! INITIALISANT TPUCOU A 0 POUR QUE LA PARTIE CV/DIFF AJOUTEE
+! PAR BILSC2 SOIT NULLE
+! NSWRSP = -1 INDIQUERA A CODITS QU'IL NE FAUT FAIRE QU'UN SWEEP
+! ET QU'IL FAUT METTRE INC A 0 (POUR OTER LES DIRICHLETS DANS LES
+! CL DES MATRICES POIDS)
+
+ if (ipucou.eq.1) then
+ nswrsp = -1
+ do iel = 1, ncel
+ smbr(iel) = volume(iel)
+ enddo
+ do iel = 1, ncelet
+ tpucou(iel,isou) = 0.d0
+ enddo
+ iescap = 0
+
+ call codits &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ippt , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ tpucou(1,isou) , tpucou(1,isou) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ flumas , flumab , &
+ viscfi , viscbi , viscf , viscb , &
+ rovsdt , smbr , tpucou(1,isou) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncelet
+ tpucou(iel,isou) = propce(iel,ipcrom)*tpucou(iel,isou)
+ enddo
+
+ endif
+
+
+! ---> ESTIMATEUR SUR LA VITESSE PREDITE : ON SOMME SUR LES COMPOSANTES
+
+ if(iescal(iespre,iphas).gt.0) then
+ iesprp = ipproc(iestim(iespre,iphas))
+ do iel = 1, ncel
+ propce(iel,iesprp) = propce(iel,iesprp) + dam(iel)
+ enddo
+ endif
+
+ elseif(iappel.eq.2) then
+
+! ---> FIN DE LA CONSTRUCTION DE L'ESTIMATEUR
+! RESIDU SECOND MEMBRE(Un+1,Pn+1) + RHO*VOLUME*( Un+1 - Un )/DT
+
+ inc = 1
+ iccocg = 1
+! Pas de relaxation en stationnaire
+ idtva0 = 0
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtva0 , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp(1,ivar) , rtp(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ flumas , flumab , viscf , viscb , &
+ smbr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ iestop = ipproc(iestim(iestot,iphas))
+ do iel = 1, ncel
+ propce(iel,iestop) = &
+ propce(iel,iestop)+ (smbr(iel)/volume(iel))**2
+ enddo
+
+ endif
+
+enddo
+
+
+! ---> APRES LA BOUCLE SUR U, V, W,
+! FIN DU CALCUL DE LA NORME POUR RESOLP
+
+if(iappel.eq.1.and.irnpnw.eq.1) then
+
+! Calcul de div(rho u*)
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,iuiph))
+ !==========
+ call parcom (rtp(1,iviph))
+ !==========
+ call parcom (rtp(1,iwiph))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iuiph),rtp(1,iuiph),rtp(1,iuiph), &
+ rtp(1,iviph),rtp(1,iviph),rtp(1,iviph), &
+ rtp(1,iwiph),rtp(1,iwiph),rtp(1,iwiph))
+ endif
+
+! Pour gagner du temps, on ne reconstruit pas.
+ init = 1
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ nswrp = 1
+ imligp = imligr(iuiph )
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(iuiph )
+ climgp = climgr(iuiph )
+ extrap = extrag(iuiph )
+
+ imaspe = 1
+
+ iismph = iisymp+nfabor*(iphas-1)
+
+ call inimas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ coefa(1,icliup), coefa(1,iclivp), coefa(1,icliwp), &
+ coefb(1,icliup), coefb(1,iclivp), coefb(1,icliwp), &
+ viscf , viscb , &
+ w4 , w5 , w6 , w7 , w8 , w9 , &
+ smbr , drtp , rovsdt , coefu , &
+ rdevel , rtuser , ra )
+
+ init = 0
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,xnormp)
+
+! Calcul de la norme
+! RNORMP qui servira dans resolp
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,xnormp,xnormp,rnormp(iphas))
+
+endif
+
+! ---> APRES LA BOUCLE SUR U, V, W,
+! FIN DU CALCUL DES ESTIMATEURS ET IMPRESSION
+
+if(iappel.eq.1) then
+
+! ---> ESTIMATEUR SUR LA VITESSE PREDITE : ON PREND LA RACINE (NORME)
+! SANS OU AVEC VOLUME (ET DANS CE CAS C'EST LA NORME L2)
+
+ if(iescal(iespre,iphas).gt.0) then
+ iesprp = ipproc(iestim(iespre,iphas))
+ if(iescal(iespre,iphas).eq.1) then
+ do iel = 1, ncel
+ propce(iel,iesprp) = sqrt(propce(iel,iesprp) )
+ enddo
+ elseif(iescal(iespre,iphas).eq.2) then
+ do iel = 1, ncel
+ propce(iel,iesprp) = sqrt(propce(iel,iesprp)*volume(iel))
+ enddo
+ endif
+ endif
+
+! ---> IMPRESSION DE NORME
+
+ if (iwarni(iuiph).ge.2) then
+ rnorm = -1.d0
+ do iel = 1, ncel
+ vitnor = &
+ sqrt(rtp(iel,iuiph)**2+rtp(iel,iviph)**2+rtp(iel,iwiph)**2)
+ rnorm = max(rnorm,vitnor)
+ enddo
+ if (irangp.ge.0) call parmax (rnorm)
+ !==========
+ write(nfecra,1100) iphas, rnorm
+ endif
+
+elseif (iappel.eq.2) then
+
+! ---> ESTIMATEUR SUR NAVIER-STOKES TOTAL : ON PREND LA RACINE (NORME)
+! SANS OU AVEC VOLUME (ET DANS CE CAS C'EST LA NORME L2)
+
+ iestop = ipproc(iestim(iestot,iphas))
+ if(iescal(iestot,iphas).eq.1) then
+ do iel = 1, ncel
+ propce(iel,iestop) = sqrt(propce(iel,iestop) )
+ enddo
+ elseif(iescal(iestot,iphas).eq.2) then
+ do iel = 1, ncel
+ propce(iel,iestop) = sqrt(propce(iel,iestop)*volume(iel))
+ enddo
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+#if defined(_CS_LANG_FR)
+
+ 1100 format(/, &
+ 1X,'Phase ',I4,' : Vitesse maximale apres prediction ',E12.4)
+
+#else
+
+ 1100 format(/, &
+ 1X,'Phase ',I4,' : Maximum velocity after prediction ',E12.4)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/prmoy0.f90 b/src/base/prmoy0.f90
new file mode 100644
index 0000000..e8bbdb7
--- /dev/null
+++ b/src/base/prmoy0.f90
@@ -0,0 +1,128 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine prmoy0 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , nfac , nfabor , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , idevel , ituser , ia , &
+ volume , pvar , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RECALAGE DE LA VARIABLE PVAR (PRESSION)POUR OBTENIR
+! QU'ELLE SOIT A MOYENNE NULLE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de la phase traitee !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! volume(ncelet ! tr ! <-- ! volume des elements !
+! pvar ! tr ! <-- ! tableau de valeurs au cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "parall.h"
+include "cstphy.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel , nfac , nfabor
+integer nideve , nrdeve , nituse , nrtuse
+
+integer iphas, idevel(nideve), ituser(nituse)
+integer ia(*)
+double precision volume(ncelet), pvar(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer iel
+double precision pmoy, pr0iph
+
+!===============================================================================
+
+pmoy = 0.0d0
+do iel = 1, ncel
+ pmoy = pmoy + volume(iel) * pvar(iel)
+enddo
+if (irangp.ge.0) then
+ call parsom (pmoy)
+ !==========
+endif
+
+pmoy = pmoy / voltot
+pr0iph = pred0(iphas)
+do iel = 1, ncel
+ pvar(iel) = pvar(iel) - pmoy + pr0iph
+enddo
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/prods2.f90 b/src/base/prods2.f90
new file mode 100644
index 0000000..5cbbc0a
--- /dev/null
+++ b/src/base/prods2.f90
@@ -0,0 +1,119 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine prods2 &
+!================
+
+ ( ncelet , ncel , isqrt , &
+ va1 , vb1 , va2 , vb2 , &
+ vavb1 , vavb2 )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL SIMULTANE DE 2 PRODUITS SCALAIRES
+! ______
+! VAPVB = VA.VB OU \/ VA.VB SI ISQRT=1
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! isqrt ! e ! <-- ! indicateur = 1 pour prendre la racine !
+! va1(), vb1() ! tr ! <-- ! premiers vecteurs a multiplier !
+! va2(), vb2() ! tr ! <-- ! seconds vecteurs a multiplier !
+! vavb1 ! r ! --> ! premier produit scalaire !
+! vavb2 ! r ! --> ! second produit scalaire !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet,ncel,isqrt
+double precision vavb1, vavb2
+double precision va1(ncelet),vb1(ncelet)
+double precision va2(ncelet),vb2(ncelet)
+
+! VARIABLES LOCALES
+
+integer nvavb
+double precision vavb(2)
+
+integer incx, incy
+double precision ddot
+external ddot
+
+!===============================================================================
+
+
+incx = 1
+incy = 1
+vavb(1) = ddot(ncel, va1, incx, vb1, incy)
+vavb(2) = ddot(ncel, va2, incx, vb2, incy)
+
+if (irangp.ge.0) then
+ nvavb = 2
+ call parrsm (nvavb, vavb)
+ !==========
+endif
+
+vavb1 = vavb(1)
+vavb2 = vavb(2)
+
+if (isqrt.eq.1) then
+ vavb1 = sqrt(vavb1)
+ vavb2 = sqrt(vavb2)
+endif
+
+!----
+! FIN
+!----
+
+return
+
+end
+
diff --git a/src/base/prods3.f90 b/src/base/prods3.f90
new file mode 100644
index 0000000..72a51ab
--- /dev/null
+++ b/src/base/prods3.f90
@@ -0,0 +1,124 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine prods3 &
+!================
+
+ ( ncelet , ncel , isqrt , &
+ va1 , vb1 , va2 , vb2 , va3 , vb3 , &
+ vavb1 , vavb2 , vavb3 )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL SIMULTANE DE 3 PRODUITS SCALAIRES
+! ______
+! VAPVB = VA.VB OU \/ VA.VB SI ISQRT=1
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! isqrt ! e ! <-- ! indicateur = 1 pour prendre la racine !
+! va1(), vb1() ! tr ! <-- ! premiers vecteurs a multiplier !
+! va2(), vb2() ! tr ! <-- ! seconds vecteurs a multiplier !
+! va3(), vb3() ! tr ! <-- ! troisiemes vecteurs a multiplier !
+! vavb1 ! r ! --> ! premier produit scalaire !
+! vavb2 ! r ! --> ! second produit scalaire !
+! vavb3 ! r ! --> ! troisieme produit scalaire !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet,ncel,isqrt
+double precision vavb1, vavb2, vavb3
+double precision va1(ncelet),vb1(ncelet)
+double precision va2(ncelet),vb2(ncelet)
+double precision va3(ncelet),vb3(ncelet)
+
+! VARIABLES LOCALES
+
+integer nvavb
+double precision vavb(3)
+
+integer incx, incy
+double precision ddot
+external ddot
+
+!===============================================================================
+
+incx = 1
+incy = 1
+vavb(1) = ddot(ncel, va1, incx, vb1, incy)
+vavb(2) = ddot(ncel, va2, incx, vb2, incy)
+vavb(3) = ddot(ncel, va3, incx, vb3, incy)
+
+if (irangp.ge.0) then
+ nvavb = 3
+ call parrsm (nvavb, vavb)
+ !==========
+endif
+
+vavb1 = vavb(1)
+vavb2 = vavb(2)
+vavb3 = vavb(3)
+
+if (isqrt.eq.1) then
+ vavb1 = sqrt(vavb1)
+ vavb2 = sqrt(vavb2)
+ vavb3 = sqrt(vavb3)
+endif
+
+!----
+! FIN
+!----
+
+return
+
+end
+
diff --git a/src/base/prodsc.f90 b/src/base/prodsc.f90
new file mode 100644
index 0000000..c80ad78
--- /dev/null
+++ b/src/base/prodsc.f90
@@ -0,0 +1,96 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine prodsc &
+!================
+
+ ( ncelet , ncel , isqrt , va , vb , vavb )
+
+!===============================================================================
+! FONCTION :
+! ----------
+! ______
+! PRODUIT SCALAIRE VAPVB = VA.VB OU \/ VA.VB SI ISQRT=1
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! isqrt ! e ! <-- ! indicateur = 1 pour prendre la racine !
+! va, vb(ncelet ! tr ! <-- ! vecteurs a multiplier !
+! vavb ! r ! --> ! produit scalaire !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet,ncel,isqrt
+double precision vavb
+double precision va(ncelet),vb(ncelet)
+
+! VARIABLES LOCALES
+
+integer incx, incy
+double precision ddot
+external ddot
+
+!===============================================================================
+
+incx = 1
+incy = 1
+vavb = ddot(ncel, va, incx, vb, incy)
+
+if (irangp.ge.0) call parsom (vavb)
+ !==========
+if( isqrt.eq.1 ) vavb= sqrt(vavb)
+!----
+! FIN
+!----
+
+return
+
+end
+
diff --git a/src/base/projts.f90 b/src/base/projts.f90
new file mode 100644
index 0000000..0f8fa85
--- /dev/null
+++ b/src/base/projts.f90
@@ -0,0 +1,351 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine projts &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgu , imligu , &
+ iwarnu , nfecra , &
+ epsrgu , climgu , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ fextx , fexty , fextz , &
+ coefbp , &
+ flumas , flumab , viscf , viscb , &
+ viselx , visely , viselz , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! PROJECTION SUR LES FACES DES TERMES DE FORCE EXTERIEURE
+! GENERANT UNE PRESSION HYDROSTATIQUE
+! EN FAIT, LE TERME CALCULE EST : DTij FEXTij.Sij
+! ---- -
+! ET IL EST AJOUTE AU FLUX DE MASSE.
+! LE CALCUL EST FAIT DE MANIERE COMPATIBLE AVEC ITRMAS (POUR LES
+! FACES INTERNES) ET DE MANIERE A CORRIGER L'ERREUR SUR LA CL
+! DE PRESSION EN PAROI (dP/dn=0 n'est pas adapte en fait)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! init ! e ! <-- ! > 0 : initialisation du flux de masse !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! nswrgu ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligu ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! iwarnu ! e ! <-- ! niveau d'impression !
+! nfecra ! e ! <-- ! unite du fichier sortie std !
+! epsrgu ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgu ! r ! <-- ! coef gradient*distance/ecart !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! coefbp(nfabor ! tr ! <-- ! tableaux des cond lim de pression !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer init , inc , imrgra , iccocg
+integer nswrgu , imligu
+integer iwarnu , nfecra
+double precision epsrgu , climgu
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pond
+double precision fextx(ncelet),fexty(ncelet),fextz(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision viselx(ncelet), visely(ncelet), viselz(ncelet)
+double precision coefbp(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ii, jj, iii
+double precision dijpfx,dijpfy,dijpfz
+double precision diipx,diipy,diipz
+double precision djjpx,djjpy,djjpz
+double precision dist,surfn
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+
+if( init.eq.1 ) then
+ do ifac = 1, nfac
+ flumas(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ flumab(ifac) = 0.d0
+ enddo
+
+elseif(init.ne.0) then
+ write(nfecra,1000) init
+ call csexit(1)
+endif
+
+!===============================================================================
+! 2. CALCUL DU FLUX DE MASSE SANS TECHNIQUE DE RECONSTRUCTION
+!===============================================================================
+
+if( nswrgu.le.1 ) then
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ flumas(ifac) = flumas(ifac) &
+ + viscf(ifac)*( &
+ (cdgfac(1,ifac)-xyzcen(1,ii))*fextx(ii) &
+ +(cdgfac(2,ifac)-xyzcen(2,ii))*fexty(ii) &
+ +(cdgfac(3,ifac)-xyzcen(3,ii))*fextz(ii) &
+ -(cdgfac(1,ifac)-xyzcen(1,jj))*fextx(jj) &
+ -(cdgfac(2,ifac)-xyzcen(2,jj))*fexty(jj) &
+ -(cdgfac(3,ifac)-xyzcen(3,jj))*fextz(jj) )
+
+ enddo
+
+
+! FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ surfn = ra(isrfbn-1+ifac)
+ dist = ra(idistb-1+ifac)
+
+ flumab(ifac) = flumab(ifac)+viscb(ifac)*dist/surfn &
+ *(1.d0-coefbp(ifac))*(fextx(ii)*surfbo(1,ifac) &
+ +fexty(ii)*surfbo(2,ifac)+fextz(ii)*surfbo(3,ifac) )
+
+ enddo
+
+
+else
+
+
+! FLUX DE MASSE SUR LES FACETTES FLUIDES
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ pond = ra(ipond-1+ifac)
+
+! recuperation de I'J'
+ iii = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iii+1)
+ dijpfy = ra(iii+2)
+ dijpfz = ra(iii+3)
+ surfn = ra(isrfan-1+ifac)
+ dist = ra(idist-1+ifac)
+
+! calcul de II' et JJ'
+ diipx = cdgfac(1,ifac)-xyzcen(1,ii)-(1.d0-pond)*dijpfx
+ diipy = cdgfac(2,ifac)-xyzcen(2,ii)-(1.d0-pond)*dijpfy
+ diipz = cdgfac(3,ifac)-xyzcen(3,ii)-(1.d0-pond)*dijpfz
+ djjpx = cdgfac(1,ifac)-xyzcen(1,jj)+pond*dijpfx
+ djjpy = cdgfac(2,ifac)-xyzcen(2,jj)+pond*dijpfy
+ djjpz = cdgfac(3,ifac)-xyzcen(3,jj)+pond*dijpfz
+
+ flumas(ifac) = flumas(ifac) &
+ + viscf(ifac)*( &
+ (cdgfac(1,ifac)-xyzcen(1,ii))*fextx(ii) &
+ +(cdgfac(2,ifac)-xyzcen(2,ii))*fexty(ii) &
+ +(cdgfac(3,ifac)-xyzcen(3,ii))*fextz(ii) &
+ -(cdgfac(1,ifac)-xyzcen(1,jj))*fextx(jj) &
+ -(cdgfac(2,ifac)-xyzcen(2,jj))*fexty(jj) &
+ -(cdgfac(3,ifac)-xyzcen(3,jj))*fextz(jj) ) &
+ +surfn/dist*0.5d0*( &
+ (djjpx-diipx)*(viselx(ii)*fextx(ii)+viselx(jj)*fextx(jj)) &
+ +(djjpy-diipy)*(visely(ii)*fexty(ii)+visely(jj)*fexty(jj)) &
+ +(djjpz-diipz)*(viselz(ii)*fextz(ii)+viselz(jj)*fextz(jj)))
+
+ enddo
+
+
+! FLUX DE MASSE SUR LES FACETTES DE BORD
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ surfn = ra(isrfbn-1+ifac)
+ dist = ra(idistb-1+ifac)
+
+ flumab(ifac) = flumab(ifac)+viscb(ifac)*dist/surfn &
+ *(1.d0-coefbp(ifac))*(fextx(ii)*surfbo(1,ifac) &
+ +fexty(ii)*surfbo(2,ifac)+fextz(ii)*surfbo(3,ifac) )
+
+ enddo
+endif
+
+
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format('PROJTS APPELE AVEC INIT =',I10)
+
+#else
+
+ 1000 format('PROJTS CALLED WITH INIT =',I10)
+
+#endif
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/promav.f90 b/src/base/promav.f90
new file mode 100644
index 0000000..22ed0cf
--- /dev/null
+++ b/src/base/promav.f90
@@ -0,0 +1,213 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine promav &
+!================
+
+ ( ncelet , ncel , nfac , isym , iinvpe , &
+ ifacel , da , xa , vx , vy )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! PRODUIT MATRICE VECTEUR Y = (DA+ XA).X
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! isym ! e ! <-- ! indicateur = 1 matrice symetrique !
+! ! ! ! = 2 matrice non symetrique !
+! iinvpe ! e ! <-- ! indicateur pour annuler les increment !
+! ! ! ! en periodicite de rotation (=2) ou !
+! ! ! ! pour les echanger normalement de !
+! ! ! ! maniere scalaire (=1) !
+! ifacel(2,nfac ! te ! <-- ! no des elts voisins d'une face intern !
+! da(ncelet ! tr ! <-- ! diagonale de la matrice !
+! xa(nfac,isym) ! tr ! <-- ! extra diagonale de la matrice !
+! vx(ncelet ! tr ! <-- ! vecteur a multiplier !
+! vy(ncelet ! tr ! --> ! vecteur resultat !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "vector.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+
+! Arguments
+
+integer ncelet , ncel , nfac , isym , iinvpe
+integer ifacel(2,nfac)
+double precision da(ncelet),xa(nfac,isym),vx(ncelet),vy(ncelet)
+
+! VARIABLES LOCALES
+
+integer ifac,ii,jj,iel,idimte,itenso
+
+!===============================================================================
+
+! 1 - PRODUIT MATRICE/VECTEUR PAR LA DIAGONALE
+! --------------------------------------------
+
+! ESSAYER AUSSI AVEC LES BLAS :
+! CALL DNDOT(NCEL,1,VY,1,1,DA,1,1,VX,1,1)
+
+do iel = 1, ncel
+ vy(iel) = da(iel)*vx(iel)
+enddo
+if(ncelet.gt.ncel) then
+ do iel = ncel+1, ncelet
+ vy(iel) = 0.d0
+ enddo
+endif
+
+
+! 2 - PRODUIT MATRICE/VECTEUR TERMES X-TRADIAGONAUX
+! -------------------------------------------------
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (vx)
+ !==========
+
+! --> TRAITEMENT DE LA PERIODICITE
+if(iperio.eq.1) then
+ if(iinvpe.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vx , vx , vx , &
+ vx , vx , vx , &
+ vx , vx , vx )
+ elseif(iinvpe.eq.2) then
+ idimte = 0
+ itenso = 11
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vx , vx , vx , &
+ vx , vx , vx , &
+ vx , vx , vx )
+
+! Utile a Codits (produit avec une variable non en increment)
+ elseif(iinvpe.eq.3) then
+ idimte = 0
+ itenso = 1
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vx , vx , vx , &
+ vx , vx , vx , &
+ vx , vx , vx )
+ endif
+endif
+
+
+if( isym.eq.1 ) then
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,1)*vx(ii)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,1)*vx(ii)
+ enddo
+
+ endif
+
+else
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,2)*vx(ii)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,2)*vx(ii)
+ enddo
+
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/proxav.f90 b/src/base/proxav.f90
new file mode 100644
index 0000000..397ac7a
--- /dev/null
+++ b/src/base/proxav.f90
@@ -0,0 +1,204 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine proxav &
+!================
+
+ ( ncelet , ncel , nfac , isym , iinvpe , &
+ ifacel , xa , vx , vy )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! PRODUIT MATRICE VECTEUR Y = (XA).X
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! isym ! e ! <-- ! indicateur = 1 matrice symetrique !
+! ! ! ! = 2 matrice non symetrique !
+! iinvpe ! e ! <-- ! indicateur pour annuler les increment !
+! ! ! ! en periodicite de rotation (=2) ou !
+! ! ! ! pour les echanger normalement de !
+! ! ! ! maniere scalaire (=1) !
+! ifacel(2,nfac ! te ! <-- ! no des elts voisins d'une face intern !
+! xa(nfac,isym) ! tr ! <-- ! extra diagonale de la matrice !
+! vx(ncelet ! tr ! <-- ! vecteur a multiplier !
+! vy(ncelet ! tr ! --> ! vecteur resultat !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "vector.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+
+! Arguments
+
+integer ncelet , ncel , nfac , isym , iinvpe
+integer ifacel(2,nfac)
+double precision xa(nfac,isym),vx(ncelet),vy(ncelet)
+
+! VARAIBLES LOCALES
+
+integer ifac,ii,jj,iel,idimte,itenso
+
+!===============================================================================
+
+! 1 - PRODUIT MATRICE/VECTEUR PAR LA DIAGONALE
+! --------------------------------------------
+
+do iel = 1, ncelet
+ vy(iel) = 0.d0
+enddo
+
+
+! 2 - PRODUIT MATRICE/VECTEUR TERMES X-TRADIAGONAUX
+! -------------------------------------------------
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (vx)
+ !==========
+
+! --> TRAITEMENT DE LA PERIODICITE
+if(iperio.eq.1) then
+ if(iinvpe.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vx , vx , vx , &
+ vx , vx , vx , &
+ vx , vx , vx )
+ elseif(iinvpe.eq.2) then
+ idimte = 0
+ itenso = 11
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vx , vx , vx , &
+ vx , vx , vx , &
+ vx , vx , vx )
+
+! Utile a Codits (produit avec une variable non en increment)
+ elseif(iinvpe.eq.3) then
+ idimte = 0
+ itenso = 1
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vx , vx , vx , &
+ vx , vx , vx , &
+ vx , vx , vx )
+ endif
+endif
+
+
+if( isym.eq.1 ) then
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,1)*vx(ii)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,1)*vx(ii)
+ enddo
+
+ endif
+
+else
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,2)*vx(ii)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vy(ii) = vy(ii) +xa(ifac,1)*vx(jj)
+ vy(jj) = vy(jj) +xa(ifac,2)*vx(ii)
+ enddo
+
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/recvmc.f90 b/src/base/recvmc.f90
new file mode 100644
index 0000000..0c29545
--- /dev/null
+++ b/src/base/recvmc.f90
@@ -0,0 +1,468 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine recvmc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rom , flumas , flumab , &
+ ux , uy , uz , &
+ bx , by , bz , cocg , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RECONSTRUCTION DE LA VITESSE A PARTIR DU FLUX DE MASSE
+! PAR MOINDRES CARRES (VITESSE CONSTANTE PAR ELEMENT)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rom(ncelet ! tr ! <-- ! masse volumique aux cellules !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! ux uy ! tr ! --> ! vitesse reconstruite !
+! uz (ncelet ! tr ! ! !
+! bx,y,z(ncelet ! tr ! --- ! tableau de travail !
+! cocg ! tr ! --- ! tableau de travail !
+! (ncelet,3,3 ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "vector.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rom(ncelet)
+double precision flumas(nfac), flumab(nfabor)
+double precision ux (ncelet), uy (ncelet), uz (ncelet)
+double precision bx(ncelet), by(ncelet), bz(ncelet)
+double precision cocg(ncelet,3,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer lbloc
+parameter (lbloc = 1024)
+
+integer idebia, idebra, ii, jj, iel, ifac
+integer ibloc, nbloc, irel, idim1, idim2
+double precision aa(lbloc,3,3)
+double precision a11, a22, a33, a12, a13, a23, unsdet
+double precision cocg11, cocg12, cocg13, cocg21, cocg22, cocg23
+double precision cocg31, cocg32, cocg33
+double precision smbx, smby, smbz, unsrho
+double precision vecfac, pfacx, pfacy, pfacz
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. CALCUL DE LA MATRICE
+!===============================================================================
+
+! INITIALISATION
+
+do ii = 1, 3
+ do jj = 1, 3
+ do iel = 1, ncelet
+ cocg(iel,ii,jj) = 0.d0
+ enddo
+ enddo
+enddo
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+do idim1 = 1, 3
+ do idim2 = idim1, 3
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vecfac = surfac(idim1,ifac)*surfac(idim2,ifac)
+ cocg(ii,idim1,idim2) = cocg(ii,idim1,idim2) + vecfac
+ cocg(jj,idim1,idim2) = cocg(jj,idim1,idim2) + vecfac
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vecfac = surfac(idim1,ifac)*surfac(idim2,ifac)
+ cocg(ii,idim1,idim2) = cocg(ii,idim1,idim2) + vecfac
+ cocg(jj,idim1,idim2) = cocg(jj,idim1,idim2) + vecfac
+ enddo
+
+ endif
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ cocg(ii,idim1,idim2) = cocg(ii,idim1,idim2) &
+ + surfbo(idim1,ifac)*surfbo(idim2,ifac)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ cocg(ii,idim1,idim2) = cocg(ii,idim1,idim2) &
+ + surfbo(idim1,ifac)*surfbo(idim2,ifac)
+ enddo
+
+ endif
+
+ enddo
+enddo
+
+
+! SYMETRISATION
+
+do iel = 1, ncel
+ cocg(iel,2,1) = cocg(iel,1,2)
+ cocg(iel,3,1) = cocg(iel,1,3)
+ cocg(iel,3,2) = cocg(iel,2,3)
+enddo
+
+!===============================================================================
+! 2. INVERSION DE LA MATRICE
+!===============================================================================
+
+
+nbloc = ncel/lbloc
+if (nbloc.gt.0) then
+ do ibloc = 1, nbloc
+ do ii = 1, lbloc
+ iel = (ibloc-1)*lbloc+ii
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11+cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11 *unsdet
+ aa(ii,1,2) = a12 *unsdet
+ aa(ii,1,3) = a13 *unsdet
+ aa(ii,2,2) = a22 *unsdet
+ aa(ii,2,3) = a23 *unsdet
+ aa(ii,3,3) = a33 *unsdet
+
+ enddo
+
+ do ii = 1, lbloc
+ iel = (ibloc-1)*lbloc+ii
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+
+ enddo
+
+endif
+
+irel = mod(ncel,lbloc)
+if (irel.gt.0) then
+ ibloc = nbloc + 1
+ do ii = 1, irel
+ iel = (ibloc-1)*lbloc+ii
+
+ cocg11 = cocg(iel,1,1)
+ cocg12 = cocg(iel,1,2)
+ cocg13 = cocg(iel,1,3)
+ cocg21 = cocg(iel,2,1)
+ cocg22 = cocg(iel,2,2)
+ cocg23 = cocg(iel,2,3)
+ cocg31 = cocg(iel,3,1)
+ cocg32 = cocg(iel,3,2)
+ cocg33 = cocg(iel,3,3)
+
+ a11=cocg22*cocg33-cocg32*cocg23
+ a12=cocg32*cocg13-cocg12*cocg33
+ a13=cocg12*cocg23-cocg22*cocg13
+ a22=cocg11*cocg33-cocg31*cocg13
+ a23=cocg21*cocg13-cocg11*cocg23
+ a33=cocg11*cocg22-cocg21*cocg12
+
+ unsdet = 1.d0/(cocg11*a11+cocg21*a12+cocg31*a13)
+
+ aa(ii,1,1) = a11 *unsdet
+ aa(ii,1,2) = a12 *unsdet
+ aa(ii,1,3) = a13 *unsdet
+ aa(ii,2,2) = a22 *unsdet
+ aa(ii,2,3) = a23 *unsdet
+ aa(ii,3,3) = a33 *unsdet
+
+ enddo
+
+ do ii = 1, irel
+ iel = (ibloc-1)*lbloc+ii
+ cocg(iel,1,1) = aa(ii,1,1)
+ cocg(iel,1,2) = aa(ii,1,2)
+ cocg(iel,1,3) = aa(ii,1,3)
+ cocg(iel,2,2) = aa(ii,2,2)
+ cocg(iel,2,3) = aa(ii,2,3)
+ cocg(iel,3,3) = aa(ii,3,3)
+ enddo
+endif
+
+
+! MATRICE SYMETRIQUE
+
+do iel = 1, ncel
+ cocg(iel,2,1) = cocg(iel,1,2)
+ cocg(iel,3,1) = cocg(iel,1,3)
+ cocg(iel,3,2) = cocg(iel,2,3)
+enddo
+
+
+!===============================================================================
+! 3. CALCUL DU SECOND MEMBRE
+!===============================================================================
+
+do iel = 1, ncelet
+ bx(iel) = 0.d0
+ by(iel) = 0.d0
+ bz(iel) = 0.d0
+enddo
+
+
+! ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+
+if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfacx = flumas(ifac)*surfac(1,ifac)
+ pfacy = flumas(ifac)*surfac(2,ifac)
+ pfacz = flumas(ifac)*surfac(3,ifac)
+ bx(ii) = bx(ii) + pfacx
+ by(ii) = by(ii) + pfacy
+ bz(ii) = bz(ii) + pfacz
+ bx(jj) = bx(jj) + pfacx
+ by(jj) = by(jj) + pfacy
+ bz(jj) = bz(jj) + pfacz
+ enddo
+
+else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ pfacx = flumas(ifac)*surfac(1,ifac)
+ pfacy = flumas(ifac)*surfac(2,ifac)
+ pfacz = flumas(ifac)*surfac(3,ifac)
+ bx(ii) = bx(ii) + pfacx
+ by(ii) = by(ii) + pfacy
+ bz(ii) = bz(ii) + pfacz
+ bx(jj) = bx(jj) + pfacx
+ by(jj) = by(jj) + pfacy
+ bz(jj) = bz(jj) + pfacz
+ enddo
+
+endif
+
+
+! ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+
+if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ bx(ii) = bx(ii) + flumab(ifac)*surfbo(1,ifac)
+ by(ii) = by(ii) + flumab(ifac)*surfbo(2,ifac)
+ bz(ii) = bz(ii) + flumab(ifac)*surfbo(3,ifac)
+ enddo
+
+else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1,nfabor
+ ii = ifabor(ifac)
+ bx(ii) = bx(ii) + flumab(ifac)*surfbo(1,ifac)
+ by(ii) = by(ii) + flumab(ifac)*surfbo(2,ifac)
+ bz(ii) = bz(ii) + flumab(ifac)*surfbo(3,ifac)
+ enddo
+
+endif
+
+!===============================================================================
+! 4. RESOLUTION
+!===============================================================================
+
+
+do iel = 1, ncel
+ unsrho = 1.d0/rom(iel)
+ smbx = bx(iel)
+ smby = by(iel)
+ smbz = bz(iel)
+ ux (iel) = (cocg(iel,1,1)*smbx+cocg(iel,1,2)*smby &
+ +cocg(iel,1,3)*smbz)*unsrho
+ uy (iel) = (cocg(iel,2,1)*smbx+cocg(iel,2,2)*smby &
+ +cocg(iel,2,3)*smbz)*unsrho
+ uz (iel) = (cocg(iel,3,1)*smbx+cocg(iel,3,2)*smby &
+ +cocg(iel,3,3)*smbz)*unsrho
+enddo
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/reseps.f90 b/src/base/reseps.f90
new file mode 100644
index 0000000..5daf762
--- /dev/null
+++ b/src/base/reseps.f90
@@ -0,0 +1,923 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine reseps &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itpsmp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grdvit , produc , grarox , graroy , graroz , &
+ ckupdc , smcelp , gamma , &
+ viscf , viscb , &
+ tslagr , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR EPSILON DANS LE CAS DU MODELE Rij-epsilon
+
+! On a ici ISOU = 7 (7 ieme variable du Rij-epsilon)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itpsmp ! te ! <-- ! type de source de masse pour la !
+! (ncesmp) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! grdvit ! tr ! --- ! tableau de travail pour terme grad !
+! (ncelet,3,3) ! ! ! de vitesse uniqt pour iturb=31 !
+! produc ! tr ! <-- ! tableau de travail pour production !
+! (6,ncelet) ! ! ! (sans rho volume) uniqt pour iturb=30 !
+! grarox,y,z ! tr ! <-- ! tableau de travail pour grad rom !
+! (ncelet) ! ! ! !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smcelp(ncesmp ! tr ! <-- ! valeur de la variable associee a la !
+! ! ! ! source de masse !
+! gamma(ncesmp) ! tr ! <-- ! valeur du flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+! (ncelet,*) ! ! ! lagrangien !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itpsmp(ncesmp)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision produc(6,ncelet), grdvit(ncelet,3,3)
+double precision grarox(ncelet), graroy(ncelet), graroz(ncelet)
+double precision ckupdc(ncepdp,6)
+double precision smcelp(ncesmp), gamma(ncesmp)
+double precision viscf(nfac), viscb(nfabor)
+double precision tslagr(ncelet,*)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer init , ifac , iel , inc , iccocg
+integer ii ,jj , iiun
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ieiph , iuiph
+integer iclvar, iclvaf
+integer ipcrom, ipcroo, ipcvis, ipcvst, iflmas, iflmab
+integer nswrgp, imligp, iwarnp, iphydp
+integer iconvp, idiffp, ndircp, ireslp
+integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer idimte, itenso
+integer iptsta
+integer maxelt, ils
+double precision blencp, epsilp, epsrgp, climgp, extrap, relaxp
+double precision epsrsp
+double precision trprod , trrij ,csteps, rctse
+double precision grdpx,grdpy,grdpz,grdsn
+double precision surfn2
+double precision tseps , kseps , ceps2
+double precision tuexpe, thets , thetv , thetap, thetp1
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) nomvar(ipp)
+endif
+
+iuiph = iu(iphas)
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+ieiph = iep (iphas)
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+iflmas = ipprof(ifluma(iuiph))
+iflmab = ipprob(ifluma(iuiph))
+
+iclvar = iclrtp(ivar,icoef)
+iclvaf = iclrtp(ivar,icoeff)
+
+! Constante Ce2, qui vaut CE2 pour ITURB=30 et CSSGE2 pour ITRUB=31
+if (iturb(iphas).eq.30) then
+ ceps2 = ce2
+else
+ ceps2 = cssge2
+endif
+
+! S pour Source, V pour Variable
+thets = thetst(iphas)
+thetv = thetav(ivar )
+
+ipcroo = ipcrom
+if(isto2t(iphas).gt.0.and.iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+endif
+if(isto2t(iphas).gt.0) then
+ iptsta = ipproc(itstua(iphas))
+else
+ iptsta = 0
+endif
+
+do iel = 1, ncel
+ smbr(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+!===============================================================================
+! 2. TERMES SOURCES UTILISATEURS
+!===============================================================================
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('RESEPS',IFINIA)
+
+call ustsri &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itpsmp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smcelp , gamma , grdvit , produc , &
+ smbr , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , dam , drtp , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S.
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+! Sauvegarde pour echange
+ tuexpe = propce(iel,iptsta+isou-1)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta+isou-1) = smbr(iel)
+! Second membre du pas de temps precedent
+! On suppose -ROVSDT > 0 : on implicite
+! le terme source utilisateur (le reste)
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) - thets*tuexpe
+! Diagonale
+ rovsdt(iel) = - thetv*rovsdt(iel)
+ enddo
+else
+ do iel = 1, ncel
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) + smbr(iel)
+ rovsdt(iel) = max(-rovsdt(iel),zero)
+ enddo
+endif
+
+!===============================================================================
+! 3. TERMES SOURCES LAGRANGIEN : COUPLAGE RETOUR
+!===============================================================================
+
+! Ordre 2 non pris en compte
+ if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.ilphas) then
+
+ do iel = 1,ncel
+! Ts sur eps
+ tseps = -0.5d0 * ( tslagr(iel,itsr11) &
+ + tslagr(iel,itsr22) &
+ + tslagr(iel,itsr33) )
+! rapport k/eps
+ kseps = 0.5d0 * ( rtpa(iel,ir11ip) &
+ + rtpa(iel,ir22ip) &
+ + rtpa(iel,ir33ip) ) &
+ / rtpa(iel,ieiph)
+
+ smbr(iel) = smbr(iel) + ce4 *tseps *rtpa(iel,ieiph) /kseps
+ rovsdt(iel) = rovsdt(iel) + max( (-ce4*tseps/kseps) , zero)
+ enddo
+
+ endif
+
+!===============================================================================
+! 4. TERME SOURCE DE MASSE
+!===============================================================================
+
+
+if (ncesmp.gt.0) then
+
+! Entier egal a 1 (pour navsto : nb de sur-iter)
+ iiun = 1
+
+! On incremente SMBR par -Gamma RTPA et ROVSDT par Gamma (*theta)
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , isto2t(iphas) , thetv , &
+ icetsm , itpsmp , &
+ volume , rtpa(1,ivar) , smcelp , gamma , &
+ smbr , rovsdt , w1 )
+
+! Si on extrapole les TS on met Gamma Pinj dans PROPCE
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w1(iel)
+ enddo
+! Sinon on le met directement dans SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w1(iel)
+ enddo
+ endif
+
+endif
+
+!===============================================================================
+! 5. TERME D'ACCUMULATION DE MASSE -(dRO/dt)*VOLUME
+! ET TERME INSTATIONNAIRE
+!===============================================================================
+
+! ---> Calcul de mij
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w1)
+
+! ---> Ajout au second membre
+
+do iel = 1, ncel
+ smbr(iel) = smbr(iel) &
+ + iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+enddo
+
+! ---> Ajout dans la diagonale de la matrice
+! Extrapolation ou non, meme forme par coherence avec bilsc2
+
+do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel) &
+ - iconv(ivar)*w1(iel)*thetv
+enddo
+
+
+!===============================================================================
+! 6. PRODUCTION RHO * Ce1 * epsilon / k * P
+! DISSIPATION RHO*Ce2.epsilon/k*epsilon
+!===============================================================================
+
+
+! ---> Calcul de k pour la suite du sous-programme
+! on utilise un tableau de travail puisqu'il y en a...
+do iel = 1, ncel
+ w8(iel) = 0.5d0 * (rtpa(iel,ir11ip) + rtpa(iel,ir22ip) + &
+ rtpa(iel,ir33ip))
+enddo
+! ---> Calcul de la trace de la production, suivant qu'on est en
+! Rij standard ou en SSG (utilisation de PRODUC ou GRDVIT)
+if (iturb(iphas).eq.30) then
+ do iel = 1, ncel
+ w9(iel) = 0.5d0*(produc(1,iel)+produc(2,iel)+produc(3,iel))
+ enddo
+else
+ do iel = 1, ncel
+ w9(iel) = -( rtpa(iel,ir11ip)*grdvit(iel,1,1) + &
+ rtpa(iel,ir12ip)*grdvit(iel,1,2) + &
+ rtpa(iel,ir13ip)*grdvit(iel,1,3) + &
+ rtpa(iel,ir12ip)*grdvit(iel,2,1) + &
+ rtpa(iel,ir22ip)*grdvit(iel,2,2) + &
+ rtpa(iel,ir23ip)*grdvit(iel,2,3) + &
+ rtpa(iel,ir13ip)*grdvit(iel,3,1) + &
+ rtpa(iel,ir23ip)*grdvit(iel,3,2) + &
+ rtpa(iel,ir33ip)*grdvit(iel,3,3) )
+ enddo
+endif
+
+
+! Terme explicite (Production)
+
+do iel = 1, ncel
+! Demi-traces
+ trprod = w9(iel)
+ trrij = w8(iel)
+ w1(iel) = propce(iel,ipcroo)*volume(iel)* &
+ ce1*rtpa(iel,ieiph)/trrij*trprod
+enddo
+
+! Si on extrapole les T.S : PROPCE
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w1(iel)
+ enddo
+! Sinon : SMBR
+else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w1(iel)
+ enddo
+endif
+
+! Terme implicite (Dissipation)
+do iel = 1, ncel
+ trrij = w8(iel)
+ smbr(iel) = smbr(iel) - propce(iel,ipcrom)*volume(iel)* &
+ ceps2*rtpa(iel,ieiph)**2/trrij
+enddo
+
+! ---> Matrice
+
+if(isto2t(iphas).gt.0) then
+ thetap = thetv
+else
+ thetap = 1.d0
+endif
+do iel = 1, ncel
+ trrij = w8(iel)
+ rovsdt(iel) = rovsdt(iel) + ceps2*propce(iel,ipcrom)*volume(iel)&
+ *rtpa(iel,ieiph)/trrij*thetap
+enddo
+
+!===============================================================================
+! 7. TERMES DE GRAVITE
+!===============================================================================
+
+if(igrari(iphas).eq.1) then
+
+ do iel = 1, ncel
+ w7(iel) = 0.d0
+ enddo
+
+ call rijthe &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grarox , graroy , graroz , w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S. : PROPCE
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w7(iel)
+ enddo
+! Sinon SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w7(iel)
+ enddo
+ endif
+
+endif
+
+
+!===============================================================================
+! 8.a TERMES DE DIFFUSION A.grad(Eps) : PARTIE EXTRADIAGONALE EXPLICITE
+! RIJ STANDARD
+!===============================================================================
+
+if (iturb(iphas).eq.30) then
+
+! ---> Calcul du grad(Eps)
+
+
+ iccocg = 1
+ inc = 1
+
+ nswrgp = nswrgr(ivar )
+ imligp = imligr(ivar )
+ iwarnp = iwarni(ivar )
+ epsrgp = epsrgr(ivar )
+ climgp = climgr(ivar )
+ extrap = extrag(ivar )
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,ivar ) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! ---> Calcul des termes extradiagonaux de A.grad(Eps)
+
+ do iel = 1 , ncel
+ trrij = w8(iel)
+ csteps = propce(iel,ipcroo) * crijep *trrij / rtpa(iel,ieiph)
+ w4(iel) = csteps * ( rtpa(iel,ir12ip) * w2(iel) + &
+ rtpa(iel,ir13ip) * w3(iel) )
+ w5(iel) = csteps * ( rtpa(iel,ir12ip) * w1(iel) + &
+ rtpa(iel,ir23ip) * w3(iel) )
+ w6(iel) = csteps * ( rtpa(iel,ir13ip) * w1(iel) + &
+ rtpa(iel,ir23ip) * w2(iel) )
+ enddo
+
+! ---> Assemblage de { A.grad(Eps) } .S aux faces
+
+ call vectds &
+ !==========
+ (ndim , ncelet , ncel , nfac , nfabor , &
+ ifacel , ifabor , ia , &
+ surfac , surfbo , ra(ipond) , &
+ w4 , w5 , w6 , &
+ viscf , viscb , ra )
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,w4)
+
+! Si on extrapole les termes sources
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w4(iel)
+ enddo
+! Sinon
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w4(iel)
+ enddo
+ endif
+
+
+!===============================================================================
+! 8.b TERMES DE DIFFUSION A.grad(Eps) : PARTIE DIAGONALE
+! RIJ STANDARD
+!===============================================================================
+! Implicitation de (grad(eps).n)n en gradient facette
+! Si IDIFRE=1, terme correctif explicite
+! grad(eps)-(grad(eps).n)n calcule en gradient cellule
+! Les termes de bord sont uniquement pris en compte dans la partie
+! en (grad(eps).n)n
+! (W1,W2,W3) contient toujours le gradient de la variable traitee
+
+! La parcom/percom-isation du gradient de epsilon a ete faite dans
+! grdcel. Pas utile de recommencer.
+
+ if (idifre(iphas).eq.1) then
+
+ do iel = 1, ncel
+ trrij = w8(iel)
+ csteps = propce(iel,ipcroo) * crijep *trrij/rtpa(iel,ieiph)
+ w4(iel)=csteps*rtpa(iel,ir11ip)
+ w5(iel)=csteps*rtpa(iel,ir22ip)
+ w6(iel)=csteps*rtpa(iel,ir33ip)
+ enddo
+
+! ---> TRAITEMENT DU PARALLELISME (MEMES DOUTES QUE PERIODICITE ?)
+
+ if(irangp.ge.0) then
+ call parcom (w4)
+ !==========
+ call parcom (w5)
+ !==========
+ call parcom (w6)
+ !==========
+ endif
+
+! --> TRAITEMENT DE LA PERIODICITE
+ if(iperio.eq.1) then
+
+ idimte = 21
+ itenso = 0
+
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w4 , w4 , w4 , &
+ w5 , w5 , w5 , &
+ w6 , w6 , w6 )
+
+ endif
+
+ do ifac = 1, nfac
+
+ ii=ifacel(1,ifac)
+ jj=ifacel(2,ifac)
+
+ surfn2 = ra(isrfan-1+ifac)**2
+
+ grdpx=0.5d0*(w1(ii)+w1(jj))
+ grdpy=0.5d0*(w2(ii)+w2(jj))
+ grdpz=0.5d0*(w3(ii)+w3(jj))
+ grdsn=grdpx*surfac(1,ifac)+grdpy*surfac(2,ifac) &
+ +grdpz*surfac(3,ifac)
+ grdpx=grdpx-grdsn*surfac(1,ifac)/surfn2
+ grdpy=grdpy-grdsn*surfac(2,ifac)/surfn2
+ grdpz=grdpz-grdsn*surfac(3,ifac)/surfn2
+
+ viscf(ifac)= 0.5d0*( &
+ (w4(ii)+w4(jj))*grdpx*surfac(1,ifac) &
+ +(w5(ii)+w5(jj))*grdpy*surfac(2,ifac) &
+ +(w6(ii)+w6(jj))*grdpz*surfac(3,ifac))
+
+ enddo
+
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,w1)
+
+! Si on extrapole les termes sources
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w1(iel)
+ enddo
+! Sinon
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w1(iel)
+ enddo
+ endif
+
+ endif
+
+! ---> Viscosite orthotrope pour partie implicite
+
+ if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ trrij = w8(iel)
+ rctse = propce(iel,ipcrom) * crijep * trrij/rtpa(iel,ieiph)
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*rctse*rtpa(iel,ir11ip)
+ w2(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*rctse*rtpa(iel,ir22ip)
+ w3(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*rctse*rtpa(iel,ir33ip)
+ enddo
+
+ call visort &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w2 , w3 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+ else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ endif
+
+else
+!===============================================================================
+! 8.c TERMES DE DIFFUSION
+! RIJ SSG
+!===============================================================================
+! ---> Viscosite
+
+ if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigmae
+ enddo
+
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+ else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ endif
+
+endif
+
+
+!===============================================================================
+! 9. RESOLUTION
+!===============================================================================
+
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + thetp1*propce(iel,iptsta+isou-1)
+ enddo
+endif
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ndircp = ndircl(ivar)
+ireslp = iresol(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+!MO IPP =
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 10. IMPRESSIONS
+!===============================================================================
+
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' RESOLUTION POUR LA VARIABLE ',A8,/)
+
+#else
+
+ 1000 format(/,' SOLVING VARIABLE ',A8 ,/)
+
+#endif
+
+!12345678 : MAX: 12345678901234 MIN: 12345678901234 NORM: 12345678901234
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/resolp.f90 b/src/base/resolp.f90
new file mode 100644
index 0000000..cdcc176
--- /dev/null
+++ b/src/base/resolp.f90
@@ -0,0 +1,1557 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine resolp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , isostd , idtsca , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ frcxt , dfrcxt , tpucou , trav , &
+ viscf , viscb , viscfi , viscbi , &
+ dam , xam , &
+ drtp , smbr , rovsdt , tslagr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , frchy , dfrchy , coefu , trava , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS N-S 1 PHASE INCOMPRESSIBLE OU RO VARIABLE
+! SUR UN PAS DE TEMPS (CONVECTION/DIFFUSION - PRESSION /CONTINUITE)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! isostd ! te ! <-- ! indicateur de sortie standard !
+! (nfabor+1) ! ! ! +numero de la face de reference !
+! idtsca ! e ! <-- ! indicateur de pas de temps non scalai !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+!dfrcxt(ncelet, ! tr ! <-- ! variation de force exterieure !
+! 3,nphas) ! ! ! generant lapression hydrostatique !
+! tpucou ! tr ! <-- ! couplage vitesse pression !
+! (ncelel,ndim) ! ! ! !
+! trav(ncelet,3 ! tr ! <-- ! smb pour normalisation de residu !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! viscfi(nfac) ! tr ! --- ! idem viscf pour increments !
+! viscbi(nfabor ! tr ! --- ! idem viscb pour increments !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr (ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+! (ncelet,*) ! ! ! lagrangien !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! frchy(ncelet ! tr ! --- ! tableau de travail !
+! ndim ) ! ! ! !
+! dfrchy(ncelet ! tr ! --- ! tableau de travail !
+! ndim ) ! ! ! !
+! coefu(nfab,3) ! tr ! --- ! tableau de travail !
+! trava ! tr ! <-- ! tableau de travail pour couplage !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "pointe.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+include "mltgrd.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer isostd(nfabor+1,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision frcxt(ncelet,3,nphas), dfrcxt(ncelet,3,nphas)
+double precision tpucou(ncelet,ndim), trav(ncelet,3)
+double precision viscf(nfac), viscb(nfabor)
+double precision viscfi(nfac), viscbi(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet)
+double precision smbr(ncelet), rovsdt(ncelet)
+double precision tslagr(ncelet,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision frchy(ncelet,ndim), dfrchy(ncelet,ndim)
+double precision coefu(nfabor,3), trava(ncelet,ndim,nphas)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer lchain
+integer idebia, idebra
+integer iccocg, inc , init , isym , ipol , isqrt
+integer ii, iel , ifac , ifac0 , iel0
+integer ireslp, nswrp , nswmpr
+integer isweep, niterf, icycle
+integer iflmb0, ifcsor
+integer nswrgp, imligp, iwarnp
+integer ipriph, iuiph , iviph , iwiph ,iclipf
+integer iclipr, icliup, iclivp, icliwp
+integer ipcrom, ipcroa, ipbrom, iflmas, iflmab
+integer ipp
+integer iismph
+integer idiffp, iconvp, ndircp
+integer nitmap, imgrp , ncymap, nitmgp
+integer iinvpe, imaspe, indhyd
+integer idimte, itenso, iesdep
+integer idtsca
+integer iagmax, nagmax, npstmg
+double precision residu, phydr0
+double precision ardtsr, arsr , arakph, unsara, thetap
+double precision dtsrom, unsvom, romro0, ro0iph
+double precision epsrgp, climgp, extrap, epsilp
+double precision drom , dronm1
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Impressions
+ipp = ipprtp(ipr(iphas))
+
+! --- Variables
+ipriph = ipr(iphas)
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+
+! --- Conditions aux limites
+! (ICLRTP(IPRIPH,ICOEFF) pointe vers ICLRTP(IPRIPH,ICOEF) si IPHYDR=0)
+iclipr = iclrtp(ipriph,icoef)
+iclipf = iclrtp(ipriph,icoeff)
+icliup = iclrtp(iuiph ,icoef)
+iclivp = iclrtp(iviph ,icoef)
+icliwp = iclrtp(iwiph ,icoef)
+
+iismph = iisymp+nfabor*(iphas-1)
+
+! --- Grandeurs physiques
+ipcrom = ipproc(irom (iphas ))
+if(icalhy.eq.1) then
+ ipcroa = ipproc(iroma(iphas))
+else
+ ipcroa = 0
+endif
+ipbrom = ipprob(irom (iphas ))
+iflmas = ipprof(ifluma(ipriph))
+iflmab = ipprob(ifluma(ipriph))
+
+ro0iph = ro0(iphas)
+
+! --- Options de resolution
+isym = 1
+if( iconv (ipriph).gt.0 ) then
+ isym = 2
+endif
+
+if (iresol(ipriph).eq.-1) then
+ ireslp = 0
+ ipol = 0
+ if( iconv(ipriph).gt.0 ) then
+ ireslp = 1
+ ipol = 0
+ endif
+else
+ ireslp = mod(iresol(ipriph),1000)
+ ipol = (iresol(ipriph)-ireslp)/1000
+endif
+
+arakph = arak(iphas)
+
+isqrt = 1
+
+!===============================================================================
+! 2. RESIDU DE NORMALISATION
+!===============================================================================
+
+if(irnpnw.ne.1) then
+
+ if (iphydr.eq.1) then
+ do iel = 1, ncel
+ unsvom = -1.d0/volume(iel)
+ trav(iel,1) = trav(iel,1)*unsvom &
+ + frcxt(iel,1,iphas) &
+ + dfrcxt(iel,1,iphas)
+ trav(iel,2) = trav(iel,2)*unsvom &
+ + frcxt(iel,2,iphas) &
+ + dfrcxt(iel,2,iphas)
+ trav(iel,3) = trav(iel,3)*unsvom &
+ + frcxt(iel,3,iphas) &
+ + dfrcxt(iel,3,iphas)
+ enddo
+ else
+ if(isno2t(iphas).gt.0) then
+ do iel = 1, ncel
+ unsvom = -1.d0/volume(iel)
+ romro0 = propce(iel,ipcrom)-ro0iph
+ trav(iel,1) = (trav(iel,1)+trava(iel,1,iphas))*unsvom &
+ + romro0*gx
+ trav(iel,2) = (trav(iel,2)+trava(iel,2,iphas))*unsvom &
+ + romro0*gy
+ trav(iel,3) = (trav(iel,3)+trava(iel,3,iphas))*unsvom &
+ + romro0*gz
+ enddo
+ else
+ do iel = 1, ncel
+ unsvom = -1.d0/volume(iel)
+ romro0 = propce(iel,ipcrom)-ro0iph
+ trav(iel,1) = trav(iel,1)*unsvom &
+ + romro0*gx
+ trav(iel,2) = trav(iel,2)*unsvom &
+ + romro0*gy
+ trav(iel,3) = trav(iel,3)*unsvom &
+ + romro0*gz
+ enddo
+ endif
+ endif
+ do iel = 1, ncel
+ dtsrom = dt(iel)/propce(iel,ipcrom)
+ trav(iel,1) = rtp(iel,iuiph) +dtsrom*trav(iel,1)
+ trav(iel,2) = rtp(iel,iviph) +dtsrom*trav(iel,2)
+ trav(iel,3) = rtp(iel,iwiph) +dtsrom*trav(iel,3)
+ enddo
+
+! ---> TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (trav(1,1))
+ !==========
+ call parcom (trav(1,2))
+ !==========
+ call parcom (trav(1,3))
+ !==========
+ endif
+
+! ON IMPOSE LA PERIODICITE SUR TRAV
+
+ if(iperio.eq.1) then
+
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ trav(1,1) , trav(1,1) , trav(1,1) , &
+ trav(1,2) , trav(1,2) , trav(1,2) , &
+ trav(1,3) , trav(1,3) , trav(1,3) )
+
+ endif
+
+! ON NE RECONSTRUIT PAS POUR GAGNER DU TEMPS
+! EPSRGR N'EST DONC PAS UTILISE
+
+ init = 1
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ if (iale.eq.1) iflmb0 = 0
+ nswrp = 1
+ imligp = imligr(iuiph )
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(iuiph )
+ climgp = climgr(iuiph )
+ extrap = extrag(iuiph )
+
+ imaspe = 1
+
+ call inimas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ trav(1,1) , trav(1,2) , trav(1,3) , &
+ coefa(1,icliup), coefa(1,iclivp), coefa(1,icliwp), &
+ coefb(1,icliup), coefb(1,iclivp), coefb(1,icliwp), &
+ propfa(1,iflmas), propfb(1,iflmab) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w1)
+
+ if (ncesmp.gt.0) then
+ do ii = 1, ncesmp
+ iel = icetsm(ii)
+ w1(iel) = w1(iel) -volume(iel)*smacel(ii,ipriph)
+ enddo
+ endif
+
+! ---> LAGRANGIEN : COUPLAGE RETOUR
+
+ if (iilagr.eq.2 .and. ltsmas.eq.1 .and. iphas.eq.ilphas) then
+
+ do iel = 1, ncel
+ w1(iel) = w1(iel) -tslagr(iel,itsmas)
+ enddo
+
+ endif
+
+ call prodsc(ncelet,ncel,isqrt,w1,w1,rnormp(iphas))
+
+ if(iwarni(ipriph).ge.2) then
+ chaine = nomvar(ipp)
+ write(nfecra,1300)chaine(1:8) ,rnormp(iphas)
+ endif
+ dervar(ipp) = rnormp(iphas)
+ nbivar(ipp) = 0
+
+else
+
+ if(iwarni(ipriph).ge.2) then
+ chaine = nomvar(ipp)
+ write(nfecra,1300)chaine(1:8) ,rnormp(iphas)
+ endif
+ dervar(ipp) = rnormp(iphas)
+ nbivar(ipp) = 0
+
+endif
+
+!===============================================================================
+! 3. CALCUL DE L'INCREMENT DE PRESSION HYDROSTATIQUE (SI NECESSAIRE)
+!===============================================================================
+
+if (iphydr.eq.1) then
+! L'INCREMENT EST STOCKE PROVISOIREMENT DANS RTP(.,IPRIPH)
+! on resout une equation de Poisson avec des conditions de
+! flux nul partout
+! Ce n'est utile que si on a des faces de sortie
+ ifcsor = isostd(nfabor+1,iphas)
+ if (irangp.ge.0) then
+ call parcmx (ifcsor)
+ endif
+
+ if (ifcsor.le.0) then
+ indhyd = 0
+ else
+ do ifac=1,nfabor
+ coefa(ifac,iclipf) = 0.d0
+ coefb(ifac,iclipf) = 1.d0
+ enddo
+
+ if (icalhy.eq.1) then
+
+
+! Il serait necessaire de communiquer pour periodicite et parallelisme
+! avec PARCOM et PERCOM sur le vecteur
+! DFRCHY(IEL,1) DFRCHY(IEL,2) DFRCHY(IEL,3)
+! On peut economiser la communication tant que DFRCHY ne depend que de
+! RHO et RHO n-1 qui ont ete communiques auparavant.
+! Exceptionnellement, on fait donc le calcul sur NCELET.
+ do iel = 1, ncelet
+ dronm1 = (propce(iel,ipcroa)-ro0iph)
+ drom = (propce(iel,ipcrom)-ro0iph)
+ frchy(iel,1) = dronm1*gx
+ frchy(iel,2) = dronm1*gy
+ frchy(iel,3) = dronm1*gz
+ dfrchy(iel,1) = drom *gx - frchy(iel,1)
+ dfrchy(iel,2) = drom *gy - frchy(iel,2)
+ dfrchy(iel,3) = drom *gz - frchy(iel,3)
+ enddo
+
+ call calhyd &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ indhyd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frchy (1,1) , frchy (1,2) , frchy (1,3) , &
+ dfrchy(1,1) , dfrchy(1,2) , dfrchy(1,3) , &
+ rtp(1,ipriph) , propfa(1,iflmas), propfb(1,iflmab), &
+ coefa(1,iclipf) , coefb(1,iclipf) , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , rovsdt , &
+ rdevel , rtuser , ra )
+ else
+ indhyd = 0
+ endif
+
+ endif
+endif
+
+
+!===============================================================================
+! 4. PREPARATION DE LA MATRICE DU SYSTEME A RESOUDRE
+!===============================================================================
+
+! ---> TERME INSTATIONNAIRE
+
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+! ---> "VITESSE" DE DIFFUSION FACETTE
+
+if( idiff(ipriph).ge. 1 ) then
+ if (idtsca.eq.0) then
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+ else
+ call visort &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+ endif
+else
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+endif
+
+iconvp = iconv (ipriph)
+idiffp = idiff (ipriph)
+ndircp = ndircl(ipriph)
+
+thetap = 1.d0
+call matrix &
+!==========
+ ( ncelet , ncel , nfac , nfabor , &
+ iconvp , idiffp , ndircp , &
+ isym , nfecra , &
+ thetap , &
+ ifacel , ifabor , &
+ coefb(1,iclipr) , rovsdt , &
+ propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ dam , xam )
+
+!===============================================================================
+! 5. INITIALISATION DU FLUX DE MASSE
+!===============================================================================
+
+! --- Flux de masse predit et premiere composante Rhie et Chow
+
+iccocg = 1
+inc = 1
+nswrgp = nswrgr(ipriph)
+imligp = imligr(ipriph)
+iwarnp = iwarni(ipriph)
+epsrgp = epsrgr(ipriph)
+climgp = climgr(ipriph)
+extrap = extrag(ipriph)
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipriph , imrgra , inc , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ rtpa(1,ipriph) , coefa(1,iclipr) , coefb(1,iclipr) , &
+ trav(1,1) , trav(1,2) , trav(1,3) , &
+! --------- --------- ---------
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+
+if (iphydr.eq.1) then
+ do iel = 1, ncel
+ trav(iel,1) = trav(iel,1) - frcxt(iel,1,iphas)
+ trav(iel,2) = trav(iel,2) - frcxt(iel,2,iphas)
+ trav(iel,3) = trav(iel,3) - frcxt(iel,3,iphas)
+ enddo
+endif
+
+if (idtsca.eq.0) then
+ do iel = 1, ncel
+ ardtsr = arakph*(dt(iel)/propce(iel,ipcrom))
+ trav(iel,1) = rtp(iel,iuiph) + ardtsr*trav(iel,1)
+ trav(iel,2) = rtp(iel,iviph) + ardtsr*trav(iel,2)
+ trav(iel,3) = rtp(iel,iwiph) + ardtsr*trav(iel,3)
+ enddo
+else
+ do iel=1,ncel
+ arsr = arakph/propce(iel,ipcrom)
+ trav(iel,1) = rtp(iel,iuiph)+arsr*tpucou(iel,1)*trav(iel,1)
+ trav(iel,2) = rtp(iel,iviph)+arsr*tpucou(iel,2)*trav(iel,2)
+ trav(iel,3) = rtp(iel,iwiph)+arsr*tpucou(iel,3)*trav(iel,3)
+ enddo
+endif
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (trav(1,1))
+ !==========
+ call parcom (trav(1,2))
+ !==========
+ call parcom (trav(1,3))
+ !==========
+endif
+
+! ON IMPOSE LA PERIODICITE SUR TRAV
+
+if(iperio.eq.1) then
+
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ trav(1,1) , trav(1,1) , trav(1,1) , &
+ trav(1,2) , trav(1,2) , trav(1,2) , &
+ trav(1,3) , trav(1,3) , trav(1,3) )
+
+endif
+
+init = 1
+inc = 1
+iccocg = 1
+iflmb0 = 1
+if (iale.eq.1) iflmb0 = 0
+nswrgp = nswrgr(iuiph )
+imligp = imligr(iuiph )
+iwarnp = iwarni(ipriph)
+epsrgp = epsrgr(iuiph )
+climgp = climgr(iuiph )
+extrap = extrag(iuiph )
+
+imaspe = 1
+
+call inimas &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,ipcrom), propfb(1,ipbrom), &
+ trav(1,1) , trav(1,2) , trav(1,3) , &
+ coefa(1,icliup), coefa(1,iclivp), coefa(1,icliwp), &
+ coefb(1,icliup), coefb(1,iclivp), coefb(1,icliwp), &
+ propfa(1,iflmas), propfb(1,iflmab) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+
+! --- Projection aux faces des forces exterieures
+
+if (iphydr.eq.1) then
+ init = 0
+ inc = 0
+ iccocg = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+
+ if (idtsca.eq.0) then
+ call projts &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ coefb(1,iclipr) , &
+ propfa(1,iflmas), propfb(1,iflmab) , &
+ viscf , viscb , &
+ dt , dt , dt , &
+ rdevel , rtuser , ra )
+ else
+ call projts &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ coefb(1,iclipr) , &
+ propfa(1,iflmas), propfb(1,iflmab) , &
+ viscf , viscb , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ rdevel , rtuser , ra )
+ endif
+endif
+
+init = 0
+inc = 1
+iccocg = 1
+
+if(arakph.gt.0.d0) then
+
+! --- Prise en compte de Arak : la viscosite face est multipliee
+! Le pas de temps aussi. On retablit plus bas.
+ do ifac = 1, nfac
+ viscf(ifac) = arakph*viscf(ifac)
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = arakph*viscb(ifac)
+ enddo
+
+ if (idtsca.eq.0) then
+ do iel = 1, ncel
+ dt(iel) = arakph*dt(iel)
+ enddo
+
+ nswrgp = nswrgr(ipriph )
+ imligp = imligr(ipriph )
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph )
+ climgp = climgr(ipriph )
+ extrap = extrag(ipriph )
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ rtpa(1,ipriph) , coefa(1,iclipr) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ dt , dt , dt , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Projection du terme source pour oter la partie hydrostat de la pression
+ if (iphydr.eq.1) then
+ init = 0
+ inc = 0
+ iccocg = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+! on passe avec un pseudo coefB=1, pour avoir 0 aux faces de bord
+ do ifac = 1,nfabor
+ coefb(ifac,iclipf) = 1.d0
+ enddo
+
+ call projts &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ coefb(1,iclipf) , &
+ propfa(1,iflmas), propfb(1,iflmab) , &
+ viscf , viscb , &
+ dt , dt , dt , &
+ rdevel , rtuser , ra )
+
+ endif
+! --- Correction du pas de temps
+ unsara = 1.d0/arakph
+ do iel = 1, ncel
+ dt(iel) = dt(iel)*unsara
+ enddo
+
+ else
+
+ do iel = 1, ncel
+ tpucou(iel,1) = arakph*tpucou(iel,1)
+ tpucou(iel,2) = arakph*tpucou(iel,2)
+ tpucou(iel,3) = arakph*tpucou(iel,3)
+ enddo
+
+ nswrgp = nswrgr(ipriph )
+ imligp = imligr(ipriph )
+ iwarnp = iwarni(ipriph )
+ epsrgp = epsrgr(ipriph )
+ climgp = climgr(ipriph )
+ extrap = extrag(ipriph )
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ rtpa(1,ipriph) , coefa(1,iclipr) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Projection du terme source pour oter la partie hydrostat de la pression
+ if (iphydr.eq.1) then
+ init = 0
+ inc = 0
+ iccocg = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+! on passe avec un pseudo coefB=1, pour avoir 0 aux faces de bord
+ do ifac = 1,nfabor
+ coefb(ifac,iclipf) = 1.d0
+ enddo
+
+ call projts &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ coefb(1,iclipf) , &
+ propfa(1,iflmas), propfb(1,iflmab) , &
+ viscf , viscb , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! --- Correction du pas de temps
+ unsara = 1.d0/arakph
+ do iel = 1, ncel
+ tpucou(iel,1) = unsara*tpucou(iel,1)
+ tpucou(iel,2) = unsara*tpucou(iel,2)
+ tpucou(iel,3) = unsara*tpucou(iel,3)
+ enddo
+
+ endif
+
+! --- Correction de la viscosite aux faces
+ do ifac = 1, nfac
+ viscf(ifac) = viscf(ifac)*unsara
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = viscb(ifac)*unsara
+ enddo
+
+endif
+
+! Calcul des CL pour l'increment de pression
+! On commence par affecter les CL classiques
+! (COEFA=0 et COEFB=COEFB(P), puis on change
+! les CL de sortie en mettant COEFA a l'increment
+! de pression hydrostatique, decale pour valoir 0
+! sur la face de reference
+if (iphydr.eq.1) then
+ do ifac=1,nfabor
+ coefa(ifac,iclipf) = 0.d0
+ enddo
+ if (indhyd.eq.1) then
+ ifac0 = isostd(nfabor+1,iphas)
+ if (ifac0.le.0) then
+ phydr0 = 0.d0
+ else
+ iel0 = ifabor(ifac0)
+ phydr0 = rtp(iel0,ipriph) &
+ +(cdgfbo(1,ifac0)-xyzcen(1,iel0))*dfrcxt(iel0,1,iphas) &
+ +(cdgfbo(2,ifac0)-xyzcen(2,iel0))*dfrcxt(iel0,2,iphas) &
+ +(cdgfbo(3,ifac0)-xyzcen(3,iel0))*dfrcxt(iel0,3,iphas)
+ endif
+ if (irangp.ge.0) then
+ call parsom (phydr0)
+ endif
+ do ifac=1,nfabor
+ if (isostd(ifac,iphas).eq.1) then
+ iel=ifabor(ifac)
+ coefa(ifac,iclipf) = rtp(iel,ipriph) &
+ +(cdgfbo(1,ifac)-xyzcen(1,iel))*dfrcxt(iel,1,iphas) &
+ +(cdgfbo(2,ifac)-xyzcen(2,iel))*dfrcxt(iel,2,iphas) &
+ +(cdgfbo(3,ifac)-xyzcen(3,iel))*dfrcxt(iel,3,iphas) &
+ - phydr0
+ endif
+ enddo
+ endif
+endif
+
+
+!===============================================================================
+! 6. PREPARATION DU MULTIGRILLE ALGEBRIQUE
+!===============================================================================
+
+if (imgr(ipriph).gt.0) then
+
+! --- Creation de la hierarchie de maillages
+
+ chaine = nomvar(ipp)
+ iwarnp = iwarni(ipriph)
+ iagmax = iagmx0(ipriph)
+ nagmax = nagmx0(ipriph)
+ npstmg = ncpmgr(ipriph)
+ lchain = 8
+
+ call clmlga &
+ !==========
+ ( chaine(1:8) , lchain , &
+ ncelet , ncel , nfac , &
+ isym , iagmax , nagmax , npstmg , iwarnp , &
+ ngrmax , ncegrm , &
+ dam , xam )
+
+endif
+
+!===============================================================================
+! 7. BOUCLES SUR LES NON ORTHOGONALITES (RESOLUTION)
+!===============================================================================
+
+! --- Nombre de sweeps
+nswmpr = nswrsm(ipriph)
+
+! --- Mise a zero des variables
+! RTP(.,IPR) sera l'increment de pression cumule
+! DRTP sera l'increment d'increment a chaque sweep
+! W7 sera la divergence du flux de masse predit
+do iel = 1,ncel
+ rtp(iel,ipriph) = 0.d0
+ drtp(iel) = 0.d0
+ smbr(iel) = 0.d0
+enddo
+
+! --- Divergence initiale
+init = 1
+call divmas &
+ (ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w7)
+
+! --- Termes sources de masse
+if (ncesmp.gt.0) then
+ do ii = 1, ncesmp
+ iel = icetsm(ii)
+ w7(iel) = w7(iel) -volume(iel)*smacel(ii,ipriph)
+ enddo
+endif
+
+! ---> Terme sources de masse
+if (iilagr.eq.2 .and. ltsmas.eq.1 .and. iphas.eq.ilphas) then
+ do iel = 1, ncel
+ w7(iel) = w7(iel) -tslagr(iel,itsmas)
+ enddo
+endif
+
+! --- Boucle de reconstruction : debut
+do 100 isweep = 1, nswmpr
+
+! --- Mise a jour du second membre
+! (signe "-" a cause de celui qui est implicitement dans la matrice)
+ do iel = 1, ncel
+ smbr(iel) = - w7(iel) - smbr(iel)
+ enddo
+
+! --- Test de convergence du calcul
+
+ call prodsc(ncelet,ncel,isqrt,smbr,smbr,residu)
+ if (iwarni(ipriph).ge.2) then
+ chaine = nomvar(ipp)
+ write(nfecra,1400)chaine(1:8),isweep,residu
+ endif
+ if (isweep.eq.1) rnsmbr(ipp) = residu
+
+! Test a modifier eventuellement
+! (il faut qu'il soit plus strict que celui de gradco)
+ if( residu .le. 10.d0*epsrsm(ipriph)*rnormp(iphas) ) then
+! --- Si convergence, calcul de l'indicateur
+! mise a jour du flux de masse et sortie
+
+
+! --- Calcul d'indicateur, avec prise en compte
+! du volume (norme L2) ou non
+
+ if(iescal(iesder,iphas).gt.0) then
+ iesdep = ipproc(iestim(iesder,iphas))
+ do iel = 1, ncel
+ propce(iel,iesdep) = abs(smbr(iel))/volume(iel)
+ enddo
+ if(iescal(iesder,iphas).eq.2) then
+ do iel = 1, ncel
+ propce(iel,iesdep) = &
+ propce(iel,iesdep)*sqrt(volume(iel))
+ enddo
+ endif
+ endif
+
+
+
+ iccocg = 1
+ init = 0
+ inc = 0
+ if (iphydr.eq.1) inc = 1
+! --- en cas de prise en compte de Phydro, on met INC=1 pour prendre en
+! compte les CL de COEFA(.,ICLIPF)
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+ extrap = extrag(ipriph)
+ if (idtsca.eq.0) then
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ rtp(1,ipriph) , coefa(1,iclipf) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ dt , dt , dt , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ else
+
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ rtp(1,ipriph) , coefa(1,iclipf) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ goto 101
+
+ endif
+
+! --- Resolution implicite sur l'increment d'increment DRTP
+ do iel = 1, ncel
+ drtp(iel) = 0.d0
+ enddo
+
+ chaine = nomvar(ipp)
+ nitmap = nitmax(ipriph)
+ imgrp = imgr (ipriph)
+ ncymap = ncymax(ipriph)
+ nitmgp = nitmgf(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsilp = epsilo(ipriph)
+
+! ---> TRAITEMENT PERIODICITE
+! (La pression est un scalaire,
+! pas de pb pour la rotation: IINVPE=1)
+ iinvpe = 1
+
+ call invers &
+ !==========
+ ( chaine(1:8) , idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isym , ipol , ireslp , nitmap , imgrp , &
+ ncymap , nitmgp , &
+ iwarnp , nfecra , niterf , icycle , iinvpe , &
+ epsilp , rnormp(iphas) , residu , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dam , xam , smbr , drtp , &
+ w3 , w4 , w5 , w6 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ nbivar(ipp) = nbivar(ipp) + niterf
+ if(abs(rnormp(iphas)).gt.0.d0) then
+ resvar(ipp) = residu/rnormp(iphas)
+ else
+ resvar(ipp) = 0.d0
+ endif
+
+ if( isweep.eq.nswmpr ) then
+
+! --- Si dernier sweep :
+! Calcul d'estimateur
+! Incrementation du flux de masse
+! avec reconstruction a partir de (dP)^(NSWMPR-1)
+! Puis on rajoute la correction en (d(dP))^(NSWMPR)
+! sans reconstruction pour assurer la divergence nulle
+
+
+! --- Calcul d'indicateur, avec prise en compte
+! du volume (norme L2) ou non
+
+ if(iescal(iesder,iphas).gt.0) then
+ iesdep = ipproc(iestim(iesder,iphas))
+ do iel = 1, ncel
+ propce(iel,iesdep) = abs(smbr(iel))/volume(iel)
+ enddo
+ if(iescal(iesder,iphas).eq.2) then
+ do iel = 1, ncel
+ propce(iel,iesdep) = &
+ propce(iel,iesdep)*sqrt(volume(iel))
+ enddo
+ endif
+ endif
+
+! --- Incrementation du flux de masse et correction
+
+ iccocg = 1
+ init = 0
+ inc = 0
+ if (iphydr.eq.1) inc = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+ extrap = extrag(ipriph)
+
+ if (idtsca.eq.0) then
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ rtp(1,ipriph) , coefa(1,iclipf) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ dt , dt , dt , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! pour le dernier increment, on ne reconstruit pas, on n'appelle donc
+! pas GRDCEL. La valeur des DFRCXT (qui doit normalement etre nul)
+! est donc sans importance
+ iccocg = 0
+ nswrp = 0
+ inc = 0
+
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ drtp , coefa(1,iclipr) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ dt , dt , dt , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ else
+
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ rtp(1,ipriph) , coefa(1,iclipf) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! pour le dernier increment, on ne reconstruit pas, on n'appelle donc
+! pas GRDCEL. La valeur des DFRCXT (qui doit normalement etre nul)
+! est donc sans importance
+ iccocg = 0
+ nswrp = 0
+ inc = 0
+
+ call itrmas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ drtp , coefa(1,iclipr) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! Mise a jour de l'increment de pression
+ do iel = 1, ncel
+ rtp(iel,ipriph) = rtp(iel,ipriph) + drtp(iel)
+ enddo
+
+ else
+
+! --- Si ce n'est pas le dernier sweep
+! Mise a jour de l'increment de pression et calcul direct de la
+! partie en gradient d'increment de pression du second membre
+! (avec reconstruction)
+
+ if (idtvar.ge.0) then
+ do iel = 1, ncel
+ rtp(iel,ipriph) = rtp(iel,ipriph) &
+ + relaxv(ipriph)*drtp(iel)
+ enddo
+ else
+ do iel = 1, ncel
+ rtp(iel,ipriph) = rtp(iel,ipriph) &
+ + drtp(iel)
+ enddo
+ endif
+
+ iccocg = 1
+ init = 1
+ inc = 0
+ if (iphydr.eq.1) inc = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+ extrap = extrag(ipriph)
+
+ if (idtsca.eq.0) then
+
+ call itrgrp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ rtp(1,ipriph) , coefa(1,iclipf) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ dt , dt , dt , &
+ smbr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ else
+
+ call itrgrp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dfrcxt(1,1,iphas),dfrcxt(1,2,iphas),dfrcxt(1,3,iphas), &
+ rtp(1,ipriph) , coefa(1,iclipf) , coefb(1,iclipr) , &
+ viscf , viscb , &
+ tpucou(1,1) , tpucou(1,2) , tpucou(1,3) , &
+ smbr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+ 100 continue
+! --- Boucle de reconstruction : fin
+
+if(iwarni(ipriph).ge.2) then
+ chaine = nomvar(ipp)
+ write( nfecra,1600)chaine(1:8),nswmpr
+endif
+
+ 101 continue
+
+! REACTUALISATION DE LA PRESSION
+
+if (idtvar.lt.0) then
+ do iel = 1, ncel
+ rtp(iel,ipriph) = rtpa(iel,ipriph) &
+ + relaxv(ipriph)*rtp(iel,ipriph)
+ enddo
+else
+ do iel = 1, ncel
+ rtp(iel,ipriph) = rtpa(iel,ipriph) + rtp(iel,ipriph)
+ enddo
+endif
+
+!===============================================================================
+! 7. SUPPRESSION DE LA HIERARCHIE DE MAILLAGES
+!===============================================================================
+
+if (imgr(ipriph).gt.0) then
+ chaine = nomvar(ipp)
+ lchain = 8
+ call dsmlga(chaine(1:8), lchain)
+ !==========
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1300 format(1X,A8,' : RESIDU DE NORMALISATION =', E14.6)
+ 1400 format(1X,A8,' : SWEEP = ',I5,' NORME SECOND MEMBRE = ',E14.6)
+ 1600 format( &
+'@ ',/,&
+'@ @@ ATTENTION : ',A8 ,' ETAPE DE PRESSION ',/,&
+'@ ========= ',/,&
+'@ Nombre d''iterations maximal ',I10 ,' atteint ',/,&
+'@ ' )
+
+#else
+
+ 1300 format(1X,A8,' : NORMED RESIDUALS = ', E14.6)
+ 1400 format(1X,A8,' : SWEEP = ',I5,' RIGHT HAND SIDE NORM = ',E14.6)
+ 1600 format( &
+'@' ,/,&
+'@ @@ WARNING: ',A8 ,' PRESSURE STEP ' ,/,&
+'@ ========' ,/,&
+'@ Maximum number of iterations ',I10 ,' reached' ,/,&
+'@' )
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/resrij.f90 b/src/base/resrij.f90
new file mode 100644
index 0000000..eb51b91
--- /dev/null
+++ b/src/base/resrij.f90
@@ -0,0 +1,978 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine resrij &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itpsmp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , produc , grarox , graroy , graroz , &
+ ckupdc , smcelp , gamma , &
+ viscf , viscb , coefax , &
+ tslage , tslagi , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR Rij (modele standard LRR)
+! VAR = R11 R22 R33 R12 R13 R23
+! ISOU = 1 2 3 4 5 6
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itpsmp ! te ! <-- ! type de source de masse pour la !
+! (ncesmp) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! produc ! tr ! <-- ! tableau de travail pour production !
+! (6,ncelet) ! ! ! (sans rho volume) !
+! grarox,y,z ! tr ! <-- ! tableau de travail pour grad rom !
+! (ncelet) ! ! ! !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smcelp(ncesmp ! tr ! <-- ! valeur de la variable associee a la !
+! ! ! ! source de masse !
+! gamma(ncesmp) ! tr ! <-- ! valeur du flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! coefax(nfabor ! tr ! --- ! tab de trav pour cond.lim. paroi !
+! ! tr ! --- ! attention : uniquement avec echo !
+! ! tr ! --- ! de paroi et abs(icdpar) = 1 !
+! tslage(ncelet ! tr ! <-- ! ts explicite couplage retour lagr. !
+! tslagi(ncelet ! tr ! <-- ! ts implicite couplage retour lagr. !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itpsmp(ncesmp)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision produc(6,ncelet)
+double precision grarox(ncelet), graroy(ncelet), graroz(ncelet)
+double precision ckupdc(ncepdp,6)
+double precision smcelp(ncesmp), gamma(ncesmp)
+double precision viscf(nfac), viscb(nfabor), coefax(nfabor)
+double precision tslage(ncelet),tslagi(ncelet)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer init , ifac , iel , inc , iccocg
+integer ii , jj , iiun
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ieiph , iuiph
+integer ipcrom, ipcvis, iflmas, iflmab, ipcroo
+integer iclvar, iclvaf
+integer nswrgp, imligp, iwarnp, iphydp
+integer iconvp, idiffp, ndircp, ireslp
+integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer idimte, itenso
+integer iptsta
+integer isoluc
+integer maxelt, ils
+double precision blencp, epsilp, epsrgp, climgp, extrap, relaxp
+double precision epsrsp
+double precision trprod, trrij , cstrij, rctse , deltij
+double precision grdpx , grdpy , grdpz , grdsn
+double precision surfn2
+double precision tuexpr, thets , thetv , thetp1
+double precision d1s3 , d2s3
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) nomvar(ipp)
+endif
+
+iuiph = iu (iphas)
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+ieiph = iep (iphas)
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+iflmas = ipprof(ifluma(iuiph))
+iflmab = ipprob(ifluma(iuiph))
+
+iclvar = iclrtp(ivar,icoef)
+iclvaf = iclrtp(ivar,icoeff)
+
+deltij = 1.0d0
+if(isou.gt.3) then
+ deltij = 0.0d0
+endif
+d1s3 = 1.d0/3.d0
+d2s3 = 2.d0/3.d0
+
+! S pour Source, V pour Variable
+thets = thetst(iphas)
+thetv = thetav(ivar )
+
+ipcroo = ipcrom
+if(isto2t(iphas).gt.0.and.iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+endif
+iptsta = 0
+if(isto2t(iphas).gt.0) then
+ iptsta = ipproc(itstua(iphas))
+endif
+
+do iel = 1, ncel
+ smbr(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+!===============================================================================
+! 2. TERMES SOURCES UTILISATEURS
+!===============================================================================
+!(le premier argument PRODUC est lu en GRDVIT dans ustsri, mais ce
+! tableau n'est dimensionne et utilise qu'en modele Rij SSG)
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('RESRIJ',IFINIA)
+
+call ustsri &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itpsmp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smcelp , gamma , produc , produc , &
+ smbr , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , dam , drtp , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S.
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+! Sauvegarde pour echange
+ tuexpr = propce(iel,iptsta+isou-1)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta+isou-1) = smbr(iel)
+! Second membre du pas de temps precedent
+! On suppose -ROVSDT > 0 : on implicite
+! le terme source utilisateur (le reste)
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) - thets*tuexpr
+! Diagonale
+ rovsdt(iel) = - thetv*rovsdt(iel)
+ enddo
+else
+ do iel = 1, ncel
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) + smbr(iel)
+ rovsdt(iel) = max(-rovsdt(iel),zero)
+ enddo
+endif
+
+!===============================================================================
+! 2. TERMES SOURCES LAGRANGIEN : COUPLAGE RETOUR
+!===============================================================================
+
+! Ordre 2 non pris en compte
+ if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.ilphas) then
+ do iel = 1,ncel
+ smbr(iel) = smbr(iel) + tslage(iel)
+ rovsdt(iel) = rovsdt(iel) + max(-tslagi(iel),zero)
+ enddo
+ endif
+
+!===============================================================================
+! 3. TERME SOURCE DE MASSE
+!===============================================================================
+
+
+if (ncesmp.gt.0) then
+
+! Entier egal a 1 (pour navsto : nb de sur-iter)
+ iiun = 1
+
+! On incremente SMBR par -Gamma RTPA et ROVSDT par Gamma (*theta)
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , isto2t(iphas) , thetv , &
+ icetsm , itpsmp , &
+ volume , rtpa(1,ivar) , smcelp , gamma , &
+ smbr , rovsdt , w1 )
+
+! Si on extrapole les TS on met Gamma Pinj dans PROPCE
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w1(iel)
+ enddo
+! Sinon on le met directement dans SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w1(iel)
+ enddo
+ endif
+
+endif
+
+!===============================================================================
+! 4. TERME D'ACCUMULATION DE MASSE -(dRO/dt)*VOLUME
+! ET TERME INSTATIONNAIRE
+!===============================================================================
+
+! ---> Calcul de mij
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w1)
+
+! ---> Ajout au second membre
+
+do iel = 1, ncel
+ smbr(iel) = smbr(iel) &
+ + iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+enddo
+
+! ---> Ajout dans la diagonale de la matrice
+! Extrapolation ou non, meme forme par coherence avec bilsc2
+
+do iel=1,ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel)&
+ - iconv(ivar)*w1(iel)*thetv
+enddo
+
+
+!===============================================================================
+! 5. PRODUCTION, PHI1, PHI2, ET DISSIPATION
+!===============================================================================
+
+
+! ---> Calcul de k pour la suite du sous-programme
+! on utilise un tableau de travail puisqu'il y en a...
+do iel = 1, ncel
+ w8(iel) = 0.5d0 * (rtpa(iel,ir11ip) + rtpa(iel,ir22ip) + &
+ rtpa(iel,ir33ip))
+enddo
+
+! ---> Terme source
+
+! (1-CRIJ2) Pij (pour toutes les composantes de Rij)
+
+! DELTAIJ*(2/3.CRIJ2.P+2/3.CRIJ1.EPSILON)
+! (termes diagonaux pour R11, R22 et R33)
+
+! -DELTAIJ*2/3*EPSILON
+
+! Si on extrapole les TS
+! On modifie la partie implicite :
+! Dans PHI1, on ne prendra que RHO CRIJ1 EPSILON/K et non pas
+! RHO CRIJ1 EPSILON/K (1-2/3 DELTAIJ)
+! Cela permet de conserver k^n au lieu de (R11^(n+1)+R22^n+R33^n)
+! Ce choix est discutable. C'est la solution ISOLUC = 1
+! Si on veut tout prendre en implicite (comme c'est fait
+! en ordre 1 std), c'est la solution ISOLUC = 2
+! -> a tester plus precisement si necessaire
+
+
+! Si on extrapole les TS
+if(isto2t(iphas).gt.0) then
+
+ isoluc = 1
+
+ do iel = 1, ncel
+
+! Demi-traces de Prod et R
+ trprod = 0.5d0*(produc(1,iel)+produc(2,iel)+produc(3,iel))
+ trrij = w8(iel)
+
+! Calcul de Prod+Phi1+Phi2-Eps
+! = rhoPij-C1rho eps/k(Rij-2/3k dij)-C2rho(Pij-1/3Pkk dij)-2/3rho eps dij
+! Dans PROPCE :
+! = rhoPij-C1rho eps/k( -2/3k dij)-C2rho(Pij-1/3Pkk dij)-2/3rho eps dij
+! = rho{2/3dij[C2 Pkk/2+(C1-1)eps)]+(1-C2)Pij }
+ propce(iel,iptsta+isou-1) = propce(iel,iptsta+isou-1) &
+ + propce(iel,ipcroo) * volume(iel) &
+ *( deltij*d2s3* &
+ ( crij2*trprod &
+ +(crij1-1.d0)* rtpa(iel,ieiph) ) &
+ +(1.0d0-crij2)*produc(isou,iel) )
+! Dans SMBR
+! = -C1rho eps/k(Rij )
+! = rho{ -C1eps/kRij}
+ smbr(iel) = smbr(iel) + propce(iel,ipcrom) * volume(iel) &
+ *( -crij1*rtpa(iel,ieiph)/trrij * rtpa(iel,ivar) )
+
+! Calcul de la partie implicite issue de Phi1
+! = C1rho eps/k(1 )
+ rovsdt(iel) = rovsdt(iel) + propce(iel,ipcrom) * volume(iel) &
+ *crij1*rtpa(iel,ieiph)/trrij*thetv
+
+ enddo
+
+! Si on veut impliciter un bout de -C1rho eps/k( -2/3k dij)
+ if(isoluc.eq.2) then
+
+ do iel = 1, ncel
+
+ trrij = w8(iel)
+
+! On enleve a PROPCE (avec IPCROO)
+! = -C1rho eps/k( -1/3Rij dij)
+ propce(iel,iptsta+isou-1) = propce(iel,iptsta+isou-1) &
+ - propce(iel,ipcroo) * volume(iel) &
+ *(deltij*d1s3*crij1*rtpa(iel,ieiph)/trrij * rtpa(iel,ivar))
+! On ajoute a SMBR (avec IPCROM)
+! = -C1rho eps/k( -1/3Rij dij)
+ smbr(iel) = smbr(iel) &
+ + propce(iel,ipcrom) * volume(iel) &
+ *(deltij*d1s3*crij1*rtpa(iel,ieiph)/trrij * rtpa(iel,ivar))
+! On ajoute a ROVSDT (avec IPCROM)
+! = C1rho eps/k( -1/3 dij)
+ rovsdt(iel) = rovsdt(iel) + propce(iel,ipcrom) * volume(iel)&
+ *(deltij*d1s3*crij1*rtpa(iel,ieiph)/trrij )
+ enddo
+
+ endif
+
+! Si on n'extrapole pas les termes sources
+else
+
+ do iel = 1, ncel
+
+! Demi-traces de Prod et R
+ trprod = 0.5d0*(produc(1,iel)+produc(2,iel)+produc(3,iel))
+ trrij = w8(iel)
+
+! Calcul de Prod+Phi1+Phi2-Eps
+! = rhoPij-C1rho eps/k(Rij-2/3k dij)-C2rho(Pij-1/3Pkk dij)-2/3rho eps dij
+! = rho{2/3dij[C2 Pkk/2+(C1-1)eps)]+(1-C2)Pij-C1eps/kRij}
+ smbr(iel) = smbr(iel) + propce(iel,ipcrom) * volume(iel) &
+ *( deltij*d2s3* &
+ ( crij2*trprod &
+ +(crij1-1.d0)* rtpa(iel,ieiph) ) &
+ +(1.0d0-crij2)*produc(isou,iel) &
+ -crij1*rtpa(iel,ieiph)/trrij * rtpa(iel,ivar) )
+
+! Calcul de la partie implicite issue de Phi1
+! = C1rho eps/k(1-1/3 dij)
+ rovsdt(iel) = rovsdt(iel) + propce(iel,ipcrom) * volume(iel) &
+ *(1.d0-d1s3*deltij)*crij1*rtpa(iel,ieiph)/trrij
+ enddo
+
+endif
+
+!===============================================================================
+! 6. TERMES D'ECHO DE PAROI
+!===============================================================================
+
+if(irijec(iphas).eq.1) then
+
+ do iel = 1, ncel
+ w7(iel) = 0.d0
+ enddo
+
+ call rijech &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , produc , w7 , &
+ coefax , viscb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S. : PROPCE
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w7(iel)
+ enddo
+! Sinon SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w7(iel)
+ enddo
+ endif
+
+endif
+
+
+!===============================================================================
+! 7. TERMES DE GRAVITE
+!===============================================================================
+
+if(igrari(iphas).eq.1) then
+
+ do iel = 1, ncel
+ w7(iel) = 0.d0
+ enddo
+
+ call rijthe &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grarox , graroy , graroz , w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S. : PROPCE
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w7(iel)
+ enddo
+! Sinon SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w7(iel)
+ enddo
+ endif
+
+endif
+
+
+!===============================================================================
+! 8. TERMES DE DIFFUSION A.grad(Rij) : PARTIE EXTRADIAGONALE EXPLICITE
+!===============================================================================
+
+! ---> Calcul du grad(Rij)
+
+
+iccocg = 1
+inc = 1
+
+nswrgp = nswrgr(ivar )
+imligp = imligr(ivar )
+iwarnp = iwarni(ivar )
+epsrgp = epsrgr(ivar )
+climgp = climgr(ivar )
+extrap = extrag(ivar )
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,ivar ) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! ---> Calcul des termes extradiagonaux de A.grad(Rij)
+
+ do iel = 1, ncel
+ trrij = w8(iel)
+ cstrij = propce(iel,ipcroo) * csrij *trrij / rtpa(iel,ieiph)
+ w4(iel) = cstrij * ( rtpa(iel,ir12ip) * w2(iel) &
+ +rtpa(iel,ir13ip) * w3(iel) )
+ w5(iel) = cstrij * ( rtpa(iel,ir12ip) * w1(iel) &
+ +rtpa(iel,ir23ip) * w3(iel) )
+ w6(iel) = cstrij * ( rtpa(iel,ir13ip) * w1(iel) &
+ +rtpa(iel,ir23ip) * w2(iel) )
+ enddo
+
+
+! ---> Assemblage de { A.grad(Rij) } .S aux faces
+
+ call vectds &
+!!==========
+ (ndim , ncelet , ncel , nfac , nfabor , &
+ ifacel , ifabor , ia , &
+ surfac , surfbo , ra(ipond) , &
+ w4 , w5 , w6 , &
+ viscf , viscb , ra )
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,w4)
+
+! Si on extrapole les termes sources
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w4(iel)
+ enddo
+! Sinon
+else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w4(iel)
+ enddo
+endif
+
+
+!===============================================================================
+! 9. TERMES DE DIFFUSION A.grad(Rij) : PARTIE DIAGONALE
+!===============================================================================
+! Implicitation de (grad(Rij).n)n en gradient facette
+! Si IDIFRE=1, terme correctif explicite
+! grad(Rij)-(grad(Rij).n)n calcule en gradient cellule
+! Les termes de bord sont uniquement pris en compte dans la partie
+! en (grad(Rij).n)n
+! (W1,W2,W3) contient toujours le gradient de la variable traitee
+
+! Attention en periodicite on percom-ise le gradient comme si c'etait
+! un vecteur (alors que dans grdcel on l'a fait comme si c'etait
+! un tenseur ...).
+! A modifier eventuellement. Pour le moment on conserve donc
+! PERCOM et PARCOM.
+
+if (idifre(iphas).eq.1) then
+
+ do iel = 1, ncel
+ trrij = w8(iel)
+ cstrij = propce(iel,ipcroo) * csrij *trrij / rtpa(iel,ieiph)
+ w4(iel) = cstrij*rtpa(iel,ir11ip)
+ w5(iel) = cstrij*rtpa(iel,ir22ip)
+ w6(iel) = cstrij*rtpa(iel,ir33ip)
+ enddo
+
+! ---> TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (w1)
+ !==========
+ call parcom (w2)
+ !==========
+ call parcom (w3)
+ !==========
+ call parcom (w4)
+ !==========
+ call parcom (w5)
+ !==========
+ call parcom (w6)
+ !==========
+ endif
+
+! --> TRAITEMENT DE LA PERIODICITE
+! -> IL RESTE DES DOUTES LA-DESSUS
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w1 , w1 , w1 , &
+ w2 , w2 , w2 , &
+ w3 , w3 , w3 )
+
+ idimte = 21
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w4 , w4 , w4 , &
+ w5 , w5 , w5 , &
+ w6 , w6 , w6 )
+
+ endif
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ surfn2 = ra(isrfan-1+ifac)**2
+
+ grdpx = 0.5d0*(w1(ii)+w1(jj))
+ grdpy = 0.5d0*(w2(ii)+w2(jj))
+ grdpz = 0.5d0*(w3(ii)+w3(jj))
+ grdsn = grdpx*surfac(1,ifac)+grdpy*surfac(2,ifac) &
+ +grdpz*surfac(3,ifac)
+ grdpx = grdpx-grdsn*surfac(1,ifac)/surfn2
+ grdpy = grdpy-grdsn*surfac(2,ifac)/surfn2
+ grdpz = grdpz-grdsn*surfac(3,ifac)/surfn2
+
+ viscf(ifac)= 0.5d0*( &
+ (w4(ii)+w4(jj))*grdpx*surfac(1,ifac) &
+ +(w5(ii)+w5(jj))*grdpy*surfac(2,ifac) &
+ +(w6(ii)+w6(jj))*grdpz*surfac(3,ifac))
+
+ enddo
+
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,w1)
+
+! Si on extrapole les termes sources
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w1(iel)
+ enddo
+! Sinon
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w1(iel)
+ enddo
+ endif
+
+endif
+
+
+! ---> Viscosite orthotrope pour partie implicite
+
+if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ trrij = w8(iel)
+ rctse = propce(iel,ipcrom) * csrij * trrij / rtpa(iel,ieiph)
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*rctse*rtpa(iel,ir11ip)
+ w2(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*rctse*rtpa(iel,ir22ip)
+ w3(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*rctse*rtpa(iel,ir33ip)
+ enddo
+
+ call visort &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w2 , w3 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+
+!===============================================================================
+! 10. RESOLUTION
+!===============================================================================
+
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + thetp1*propce(iel,iptsta+isou-1)
+ enddo
+endif
+
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ndircp = ndircl(ivar)
+ireslp = iresol(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+!MO IPP =
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 11. IMPRESSIONS
+!===============================================================================
+
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' RESOLUTION POUR LA VARIABLE ',A8,/)
+
+#else
+
+ 1000 format(/,' SOLVING VARIABLE ',A8 ,/)
+
+#endif
+
+!12345678 : MAX: 12345678901234 MIN: 12345678901234 NORM: 12345678901234
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/resssg.f90 b/src/base/resssg.f90
new file mode 100644
index 0000000..2111a1a
--- /dev/null
+++ b/src/base/resssg.f90
@@ -0,0 +1,780 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine resssg &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itpsmp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grdvit , grarox , graroy , graroz , &
+ ckupdc , smcelp , gamma , &
+ viscf , viscb , coefax , &
+ tslage , tslagi , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR Rij modele SSG
+! VAR = R11 R22 R33 R12 R13 R23
+! ISOU = 1 2 3 4 5 6
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itpsmp ! te ! <-- ! type de source de masse pour la !
+! (ncesmp) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! grdvit ! tr ! --- ! tableau de travail pour terme grad !
+! (ncelet,3,3) ! ! ! de vitesse !
+! grarox,y,z ! tr ! <-- ! tableau de travail pour grad rom !
+! (ncelet) ! ! ! !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smcelp(ncesmp ! tr ! <-- ! valeur de la variable associee a la !
+! ! ! ! source de masse !
+! gamma(ncesmp) ! tr ! <-- ! valeur du flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! coefax(nfabor ! tr ! --- ! tab de trav pour cond.lim. paroi !
+! ! tr ! --- ! attention : uniquement avec echo !
+! ! tr ! --- ! de paroi et abs(icdpar) = 1 !
+! tslage(ncelet ! tr ! <-- ! ts explicite couplage retour lagr. !
+! tslagi(ncelet ! tr ! <-- ! ts implicite couplage retour lagr. !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itpsmp(ncesmp)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision grdvit(ncelet,3,3)
+double precision grarox(ncelet), graroy(ncelet), graroz(ncelet)
+double precision ckupdc(ncepdp,6)
+double precision smcelp(ncesmp), gamma(ncesmp)
+double precision viscf(nfac), viscb(nfabor), coefax(nfabor)
+double precision tslage(ncelet),tslagi(ncelet)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer init , ifac , iel
+integer ii , jj , kk , iiun , iii , jjj
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ieiph , iuiph
+integer ipcrom, ipcvis, iflmas, iflmab, ipcroo
+integer iclvar, iclvaf
+integer nswrgp, imligp, iwarnp
+integer iconvp, idiffp, ndircp, ireslp
+integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer iptsta
+integer maxelt, ils
+double precision blencp, epsilp, epsrgp, climgp, extrap, relaxp
+double precision epsrsp
+double precision trprod, trrij , rctse , deltij
+double precision tuexpr, thets , thetv , thetp1
+double precision aiksjk, aikrjk, aii ,aklskl, aikakj
+double precision xaniso(3,3), xstrai(3,3), xrotac(3,3), xprod(3,3)
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) nomvar(ipp)
+endif
+
+iuiph = iu (iphas)
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+ieiph = iep (iphas)
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+iflmas = ipprof(ifluma(iuiph))
+iflmab = ipprob(ifluma(iuiph))
+
+iclvar = iclrtp(ivar,icoef)
+iclvaf = iclrtp(ivar,icoeff)
+
+deltij = 1.0d0
+if(isou.gt.3) then
+ deltij = 0.0d0
+endif
+
+! S pour Source, V pour Variable
+thets = thetst(iphas)
+thetv = thetav(ivar )
+
+ipcroo = ipcrom
+if(isto2t(iphas).gt.0.and.iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+endif
+iptsta = 0
+if(isto2t(iphas).gt.0) then
+ iptsta = ipproc(itstua(iphas))
+endif
+
+do iel = 1, ncel
+ smbr(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+!===============================================================================
+! 2. TERMES SOURCES UTILISATEURS
+!===============================================================================
+!(le deuxieme argument GRDVIT est lu en PRODUC dans ustsri, mais ce
+! tableau n'est dimensionne et utilise qu'en modele Rij standard)
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('RESSSG',IFINIA)
+
+call ustsri &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itpsmp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smcelp , gamma , grdvit , grdvit , &
+ smbr , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , dam , drtp , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S.
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+! Sauvegarde pour echange
+ tuexpr = propce(iel,iptsta+isou-1)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta+isou-1) = smbr(iel)
+! Second membre du pas de temps precedent
+! On suppose -ROVSDT > 0 : on implicite
+! le terme source utilisateur (le reste)
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) - thets*tuexpr
+! Diagonale
+ rovsdt(iel) = - thetv*rovsdt(iel)
+ enddo
+else
+ do iel = 1, ncel
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) + smbr(iel)
+ rovsdt(iel) = max(-rovsdt(iel),zero)
+ enddo
+endif
+
+!===============================================================================
+! 2. TERMES SOURCES LAGRANGIEN : COUPLAGE RETOUR
+!===============================================================================
+
+! Ordre 2 non pris en compte
+ if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.ilphas) then
+ do iel = 1,ncel
+ smbr(iel) = smbr(iel) + tslage(iel)
+ rovsdt(iel) = rovsdt(iel) + max(-tslagi(iel),zero)
+ enddo
+ endif
+
+!===============================================================================
+! 3. TERME SOURCE DE MASSE
+!===============================================================================
+
+
+if (ncesmp.gt.0) then
+
+! Entier egal a 1 (pour navsto : nb de sur-iter)
+ iiun = 1
+
+! On incremente SMBR par -Gamma RTPA et ROVSDT par Gamma (*theta)
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , isto2t(iphas) , thetv , &
+ icetsm , itpsmp , &
+ volume , rtpa(1,ivar) , smcelp , gamma , &
+ smbr , rovsdt , w1 )
+
+! Si on extrapole les TS on met Gamma Pinj dans PROPCE
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w1(iel)
+ enddo
+! Sinon on le met directement dans SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w1(iel)
+ enddo
+ endif
+
+endif
+
+!===============================================================================
+! 4. TERME D'ACCUMULATION DE MASSE -(dRO/dt)*VOLUME
+! ET TERME INSTATIONNAIRE
+!===============================================================================
+
+! ---> Calcul de mij
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w1)
+
+! ---> Ajout au second membre
+
+do iel = 1, ncel
+ smbr(iel) = smbr(iel) &
+ + iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+enddo
+
+! ---> Ajout dans la diagonale de la matrice
+! Extrapolation ou non, meme forme par coherence avec bilsc2
+
+do iel=1,ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel)&
+ - iconv(ivar)*w1(iel)*thetv
+enddo
+
+
+!===============================================================================
+! 5. PRODUCTION, PHI1, PHI2, ET DISSIPATION
+!===============================================================================
+
+! ---> Terme source
+! -rho*epsilon*( Cs1*aij + Cs2*(aikajk -1/3*aijaij*deltaij))
+! -Cr1*P*aij + Cr2*rho*k*sij - Cr3*rho*k*sij*sqrt(aijaij)
+! +Cr4*rho*k(aik*sjk+ajk*sik-2/3*akl*skl*deltaij)
+! +Cr5*rho*k*(aik*rjk + ajk*rik)
+! -2/3*epsilon*deltaij
+
+if(isou.eq.1)then
+ iii = 1
+ jjj = 1
+elseif(isou.eq.2)then
+ iii = 2
+ jjj = 2
+elseif(isou.eq.3)then
+ iii = 3
+ jjj = 3
+elseif(isou.eq.4)then
+ iii = 1
+ jjj = 2
+elseif(isou.eq.5)then
+ iii = 1
+ jjj = 3
+elseif(isou.eq.6)then
+ iii = 2
+ jjj = 3
+endif
+
+do iel=1,ncel
+
+ xprod(1,1) = -2.0d0*(rtpa(iel,ir11ip)*grdvit(iel,1,1) + &
+ rtpa(iel,ir12ip)*grdvit(iel,1,2) + &
+ rtpa(iel,ir13ip)*grdvit(iel,1,3) )
+ xprod(1,2) = -( rtpa(iel,ir11ip)*grdvit(iel,2,1) + &
+ rtpa(iel,ir12ip)*grdvit(iel,2,2) + &
+ rtpa(iel,ir13ip)*grdvit(iel,2,3) ) &
+ -( rtpa(iel,ir12ip)*grdvit(iel,1,1) + &
+ rtpa(iel,ir22ip)*grdvit(iel,1,2) + &
+ rtpa(iel,ir23ip)*grdvit(iel,1,3) )
+ xprod(1,3) = -( rtpa(iel,ir11ip)*grdvit(iel,3,1) + &
+ rtpa(iel,ir12ip)*grdvit(iel,3,2) + &
+ rtpa(iel,ir13ip)*grdvit(iel,3,3) ) &
+ -( rtpa(iel,ir13ip)*grdvit(iel,1,1) + &
+ rtpa(iel,ir23ip)*grdvit(iel,1,2) + &
+ rtpa(iel,ir33ip)*grdvit(iel,1,3) )
+ xprod(2,2) = -2.0d0*(rtpa(iel,ir12ip)*grdvit(iel,2,1) + &
+ rtpa(iel,ir22ip)*grdvit(iel,2,2) + &
+ rtpa(iel,ir23ip)*grdvit(iel,2,3) )
+ xprod(2,3) = -( rtpa(iel,ir12ip)*grdvit(iel,3,1) + &
+ rtpa(iel,ir22ip)*grdvit(iel,3,2) + &
+ rtpa(iel,ir23ip)*grdvit(iel,3,3) ) &
+ -( rtpa(iel,ir13ip)*grdvit(iel,2,1) + &
+ rtpa(iel,ir23ip)*grdvit(iel,2,2) + &
+ rtpa(iel,ir33ip)*grdvit(iel,2,3) )
+ xprod(3,3) = -2.0d0*(rtpa(iel,ir13ip)*grdvit(iel,3,1) + &
+ rtpa(iel,ir23ip)*grdvit(iel,3,2) + &
+ rtpa(iel,ir33ip)*grdvit(iel,3,3) )
+ xprod(2,1) = xprod(1,2)
+ xprod(3,1) = xprod(1,3)
+ xprod(3,2) = xprod(2,3)
+
+ trprod = 0.5d0 * (xprod(1,1) + xprod(2,2) + xprod(3,3) )
+ trrij = 0.5d0 * (rtpa(iel,ir11ip) + rtpa(iel,ir22ip) + &
+ rtpa(iel,ir33ip))
+!-----> aII = aijaij
+ aii = 0.d0
+ aklskl = 0.d0
+ aiksjk = 0.d0
+ aikrjk = 0.d0
+ aikakj = 0.d0
+ xaniso(1,1) = rtpa(iel,ir11ip)/trrij-2.d0/3.d0
+ xaniso(2,2) = rtpa(iel,ir22ip)/trrij-2.d0/3.d0
+ xaniso(3,3) = rtpa(iel,ir33ip)/trrij-2.d0/3.d0
+ xaniso(1,2) = rtpa(iel,ir12ip)/trrij
+ xaniso(1,3) = rtpa(iel,ir13ip)/trrij
+ xaniso(2,3) = rtpa(iel,ir23ip)/trrij
+ xaniso(2,1) = xaniso(1,2)
+ xaniso(3,1) = xaniso(1,3)
+ xaniso(3,2) = xaniso(2,3)
+
+ xstrai(1,1) = grdvit(iel,1,1)
+ xstrai(1,2) = 0.5d0*(grdvit(iel,1,2)+grdvit(iel,2,1))
+ xstrai(1,3) = 0.5d0*(grdvit(iel,1,3)+grdvit(iel,3,1))
+ xstrai(2,1) = xstrai(1,2)
+ xstrai(2,2) = grdvit(iel,2,2)
+ xstrai(2,3) = 0.5d0*(grdvit(iel,2,3)+grdvit(iel,3,2))
+ xstrai(3,1) = xstrai(1,3)
+ xstrai(3,2) = xstrai(2,3)
+ xstrai(3,3) = grdvit(iel,3,3)
+
+ xrotac(1,1) = 0.d0
+ xrotac(1,2) = 0.5d0*(grdvit(iel,1,2)-grdvit(iel,2,1))
+ xrotac(1,3) = 0.5d0*(grdvit(iel,1,3)-grdvit(iel,3,1))
+ xrotac(2,1) = -xrotac(1,2)
+ xrotac(2,2) = 0.d0
+ xrotac(2,3) = 0.5d0*(grdvit(iel,2,3)-grdvit(iel,3,2))
+ xrotac(3,1) = -xrotac(1,3)
+ xrotac(3,2) = -xrotac(2,3)
+ xrotac(3,3) = 0.d0
+
+ do ii=1,3
+ do jj = 1,3
+ aii = aii+xaniso(ii,jj)*xaniso(ii,jj)
+ aklskl = aklskl + xaniso(ii,jj)*xstrai(ii,jj)
+ enddo
+ enddo
+
+ do kk = 1,3
+ aiksjk = aiksjk + xaniso(iii,kk)*xstrai(jjj,kk) &
+ +xaniso(jjj,kk)*xstrai(iii,kk)
+ aikrjk = aikrjk + xaniso(iii,kk)*xrotac(jjj,kk) &
+ +xaniso(jjj,kk)*xrotac(iii,kk)
+ aikakj = aikakj + xaniso(iii,kk)*xaniso(kk,jjj)
+ enddo
+
+! Si on extrapole les TS (rarissime), on met tout dans PROPCE.
+! On n'implicite pas le terme en Cs1*aij ni le terme en Cr1*P*aij.
+! Sinon, on met tout dans SMBR et on peut impliciter Cs1*aij
+! et Cr1*P*aij. Ici on stocke le second membre et le terme implicite
+! dans W1 et W2, pour eviter d'avoir un test IF(ISTO2T(IPHAS).GT.0)
+! dans la boucle NCEL
+! Dans le terme en W1, qui a vocation a etre extrapole, on utilise
+! naturellement IPCROO.
+! L'implicitation des deux termes pourrait se faire aussi en cas
+! d'extrapolation, en isolant ces deux termes et les mettant dans
+! SMBR et pas PROPCE et en utilisant IPCROM ... a modifier si le
+! besoin s'en fait vraiment sentir !
+ w1(iel) = propce(iel,ipcroo) * volume(iel) *( &
+ xprod(iii,jjj) -rtpa(iel,ieiph) &
+ *(cssgs1*xaniso(iii,jjj)+cssgs2*( &
+ aikakj -1.d0/3.d0*deltij*aii)) &
+ -cssgr1*trprod*xaniso(iii,jjj) &
+ +trrij*xstrai(iii,jjj)*(cssgr2-cssgr3*sqrt(aii)) &
+ +cssgr4*trrij*(aiksjk-2.d0/3.d0*deltij*aklskl) &
+ +cssgr5*trrij*(aikrjk)-2.d0/3.d0*rtpa(iel,ieiph)*deltij)
+
+ w2(iel) = volume(iel)/trrij*propce(iel,ipcrom)*( &
+ cssgs1*rtpa(iel,ieiph) + cssgr1*max(trprod,0.d0) )
+
+enddo
+
+if(isto2t(iphas).gt.0) then
+
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = propce(iel,iptsta+isou-1) &
+ + w1(iel)
+ enddo
+
+else
+
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w1(iel)
+ rovsdt(iel) = rovsdt(iel) + w2(iel)
+ enddo
+
+endif
+
+
+!===============================================================================
+! 7. TERMES DE GRAVITE
+!===============================================================================
+
+if(igrari(iphas).eq.1) then
+
+ do iel = 1, ncel
+ w7(iel) = 0.d0
+ enddo
+
+ call rijthe &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grarox , graroy , graroz , w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S. : PROPCE
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w7(iel)
+ enddo
+! Sinon SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w7(iel)
+ enddo
+ endif
+
+endif
+
+
+!===============================================================================
+! 9. TERMES DE DIFFUSION
+!===============================================================================
+! ---> Viscosite
+
+if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ trrij = 0.5d0 * (rtpa(iel,ir11ip) + rtpa(iel,ir22ip) + &
+ rtpa(iel,ir33ip))
+ rctse = 2.d0/3.d0 * propce(iel,ipcrom) * csrij * trrij**2 &
+ / rtpa(iel,ieiph)
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*rctse
+ enddo
+
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+
+!===============================================================================
+! 10. RESOLUTION
+!===============================================================================
+
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + thetp1*propce(iel,iptsta+isou-1)
+ enddo
+endif
+
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+!MO IPP =
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 11. IMPRESSIONS
+!===============================================================================
+
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/,' RESOLUTION POUR LA VARIABLE ',A8,/)
+
+#else
+
+ 1000 format(/,' SOLVING VARIABLE ',A8 ,/)
+
+#endif
+
+!12345678 : MAX: 12345678901234 MIN: 12345678901234 NORM: 12345678901234
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/resv2f.f90 b/src/base/resv2f.f90
new file mode 100644
index 0000000..47ca5f6
--- /dev/null
+++ b/src/base/resv2f.f90
@@ -0,0 +1,981 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine resv2f &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ viscf , viscb , prdv2f , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR PHI ET DE DIFFUSION POUR F_BARRE DANS LE CADRE DU
+! MODELE V2F PHI-MODEL
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! prdv2f(ncelet ! tr ! <-- ! tableau de stockage du terme de !
+! ! ! ! prod de turbulence pour le v2f !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1..10(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision viscf(nfac), viscb(nfabor)
+double precision prdv2f(ncelet)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer init , ifac , iel , inc , iccocg
+integer iiun
+integer ipriph,iuiph
+integer ikiph, ieiph, iphiph, ifbiph
+integer iclvar, iclvaf
+integer iclikp, iclphi, iclfbp
+integer ipcrom, ipcroo, ipcvis, ipcvlo, ipcvst, ipcvso
+integer iflmas, iflmab
+integer nswrgp, imligp, iwarnp, iphydp
+integer iconvp, idiffp, ndircp, ireslp
+integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer iptsta
+integer maxelt, ils
+double precision blencp, epsilp, epsrgp, climgp, extrap, relaxp
+double precision epsrsp
+double precision tuexpe, thets , thetv , thetap, thetp1
+double precision d2s3, d1s4, d3s2
+double precision xk, xe, xnu, xrom, ttke, ttmin, llke, llmin
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipriph = ipr (iphas)
+iuiph = iu (iphas)
+ikiph = ik(iphas)
+ieiph = iep(iphas)
+iphiph = iphi(iphas)
+ifbiph = ifb(iphas)
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+iflmas = ipprof(ifluma(iuiph))
+iflmab = ipprob(ifluma(iuiph))
+
+iclikp = iclrtp(ikiph,icoef)
+iclphi = iclrtp(iphiph,icoef)
+iclfbp = iclrtp(ifbiph,icoef)
+
+if(isto2t(iphas).gt.0) then
+ iptsta = ipproc(itstua(iphas))
+else
+ iptsta = 0
+endif
+
+d2s3 = 2.0d0/3.0d0
+d1s4 = 1.0d0/4.0d0
+d3s2 = 3.0d0/2.0d0
+
+if(iwarni(iphiph).ge.1) then
+ write(nfecra,1000)iphas
+endif
+
+!===============================================================================
+! 2. CALCUL DU TERME EN GRAD PHI.GRAD K
+!===============================================================================
+
+ iccocg = 1
+ inc = 1
+ ivar = iphiph
+
+ nswrgp = nswrgr(ivar )
+ imligp = imligr(ivar )
+ iwarnp = iwarni(ivar )
+ epsrgp = epsrgr(ivar )
+ climgp = climgr(ivar )
+ extrap = extrag(ivar )
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iphiph ) , coefa(1,iclphi) , coefb(1,iclphi) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ iccocg = 1
+ inc = 1
+ ivar = ikiph
+
+ nswrgp = nswrgr(ivar )
+ imligp = imligr(ivar )
+ iwarnp = iwarni(ivar )
+ epsrgp = epsrgr(ivar )
+ climgp = climgr(ivar )
+ extrap = extrag(ivar )
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ikiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w4 , w4 , w4 , &
+ rtpa(1,ikiph ) , coefa(1,iclikp) , coefb(1,iclikp) , &
+ w4 , w5 , w6 , &
+! ------ ------ ------
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ w1(iel) = w1(iel)*w4(iel) + w2(iel)*w5(iel) + w3(iel)*w6(iel)
+ enddo
+
+!===============================================================================
+! 3. RESOLUTION DE L'EQUATION DE F_BARRE
+!===============================================================================
+
+ivar = ifbiph
+isou = 3
+iclvar = iclfbp
+iclvaf = iclfbp
+ipp = ipprtp(ivar)
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1100) nomvar(ipp)
+endif
+
+! S pour Source, V pour Variable
+thets = thetst(iphas)
+thetv = thetav(ivar )
+
+ipcroo = ipcrom
+ipcvlo = ipcvis
+if(isto2t(iphas).gt.0) then
+ if (iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+ endif
+ if(iviext(iphas).gt.0) then
+ ipcvlo = ipproc(ivisla(iphas))
+ endif
+endif
+
+do iel = 1, ncel
+ smbr(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+!===============================================================================
+! 3.1 TERMES SOURCES UTILISATEURS
+!===============================================================================
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('RESV2F',IFINIA)
+
+call ustsv2 &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , prdv2f , w1 , &
+ smbr , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w2 , w3 , w4 , w5 , w6 , w7 , &
+ w8 , w9 , w10 , dam , drtp , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S.
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+! Sauvegarde pour echange
+ tuexpe = propce(iel,iptsta+isou-1)
+! Pour la suite et le pas de temps suivant
+! On met un signe "-" car on r�sout en fait "-div(grad fb) = ..."
+ propce(iel,iptsta+isou-1) = - smbr(iel)
+! Second membre du pas de temps precedent
+! on implicite le terme source utilisateur (le reste)
+ smbr(iel) = - rovsdt(iel)*rtpa(iel,ivar) - thets*tuexpe
+! Diagonale
+ rovsdt(iel) = thetv*rovsdt(iel)
+ enddo
+else
+ do iel = 1, ncel
+! On met un signe "-" car on r�sout en fait "-div(grad fb) = ..."
+! On resout par gradient conjugue, donc on n'impose pas le signe
+! de ROVSDT
+ smbr(iel) = -rovsdt(iel)*rtpa(iel,ivar) - smbr(iel)
+! ROVSDT(IEL) = ROVSDT(IEL)
+ enddo
+endif
+
+
+!===============================================================================
+! 3.2 TERME SOURCE DE F_BARRE
+! SMBR=1/L^2*(f_b + 1/T(C1-1)(phi-2/3) - C2*Pk/k/rho
+! -2*nu/k*grad_phi*grad_k -nu*div(grad(phi)) )
+! En fait on met un signe "-" car l'eq resolue est
+! -div(grad f_b) = SMBR
+!===============================================================================
+
+! On calcule le terme en -VOLUME*div(grad(phi)) par itrgrp,
+! et on le stocke dans W2
+! Attention, les VISCF et VISCB calcules ici servent a ITRGRP mais
+! aussi a CODITS qui suit
+
+do iel = 1, ncel
+ w3(iel) = 1.d0
+enddo
+call viscfa &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w3 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+
+iccocg = 1
+inc = 1
+init = 1
+
+nswrgp = nswrgr(iphiph)
+imligp = imligr(iphiph)
+iwarnp = iwarni(iphiph)
+epsrgp = epsrgr(iphiph)
+climgp = climgr(iphiph)
+extrap = extrag(iphiph)
+iphydp = 0
+
+call itrgrp &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ init , inc , imrgra , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w2 , w2 , w2 , &
+ rtpa(1,iphiph) , coefa(1,iclphi) , coefb(1,iclphi) , &
+ viscf , viscb , &
+ w3 , w3 , w3 , &
+ w2 , &
+! --
+ w4 , w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+! On stocke T dans W3 et L^2 dans W4
+! Dans le cas de l'ordre 2 en temps, T est calcule en n
+! (il sera extrapole) et L^2 en n+theta (meme si k et eps restent en n)
+do iel=1,ncel
+ xk = rtpa(iel,ikiph)
+ xe = rtpa(iel,ieiph)
+ xnu = propce(iel,ipcvlo)/propce(iel,ipcroo)
+ ttke = xk / xe
+ ttmin = cv2fct*sqrt(xnu/xe)
+ w3(iel) = max(ttke,ttmin)
+
+ xnu = propce(iel,ipcvis)/propce(iel,ipcrom)
+ llke = xk**d3s2/xe
+ llmin = cv2fet*(xnu**3/xe)**d1s4
+ w4(iel) = ( cv2fcl*max(llke,llmin) )**2
+enddo
+
+! Terme explicite, stocke temporairement dans W5
+! W2 est deja multiplie par le volume et contient deja
+! un signe "-" (issu de ITRGRP)
+do iel = 1, ncel
+ xrom = propce(iel,ipcroo)
+ xnu = propce(iel,ipcvlo)/xrom
+ xk = rtpa(iel,ikiph)
+ xe = rtpa(iel,ieiph)
+ w5(iel) = - volume(iel)* &
+ ( (cv2fc1-1.d0)*(rtpa(iel,iphiph)-d2s3)/w3(iel) &
+ -cv2fc2*prdv2f(iel)/xrom/xk &
+ -2.0d0*xnu/xe/w3(iel)*w1(iel) ) - xnu*w2(iel)
+enddo
+! Si on extrapole les T.S : PROPCE
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w5(iel)
+ smbr(iel) = smbr(iel) + thetp1*propce(iel,iptsta+isou-1)
+ enddo
+! Sinon : SMBR
+else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w5(iel)
+ enddo
+endif
+
+! Terme implicite
+do iel = 1, ncel
+ smbr(iel) = ( - volume(iel)*rtpa(iel,ifbiph) + smbr(iel) ) &
+ /w4(iel)
+enddo
+
+! ---> Matrice
+
+if(isto2t(iphas).gt.0) then
+ thetap = thetv
+else
+ thetap = 1.d0
+endif
+do iel = 1, ncel
+ rovsdt(iel) = (rovsdt(iel) + volume(iel)*thetap)/w4(iel)
+enddo
+
+
+
+!===============================================================================
+! 3.3 RESOLUTION EFFECTIVE DE L'EQUATION DE F_BARRE
+!===============================================================================
+
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 4. RESOLUTION DE L'EQUATION DE PHI
+!===============================================================================
+
+ivar = iphiph
+isou = 4
+iclvar = iclphi
+iclvaf = iclphi
+ipp = ipprtp(ivar)
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1100) nomvar(ipp)
+endif
+
+! S pour Source, V pour Variable
+thets = thetst(iphas)
+thetv = thetav(ivar )
+
+ipcroo = ipcrom
+ipcvso = ipcvst
+if(isto2t(iphas).gt.0) then
+ if (iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+ endif
+ if(iviext(iphas).gt.0) then
+ ipcvso = ipproc(ivista(iphas))
+ endif
+endif
+
+do iel = 1, ncel
+ smbr(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+!===============================================================================
+! 4.1 TERMES SOURCES UTILISATEURS
+!===============================================================================
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('RESV2F',IFINIA)
+
+call ustsv2 &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , prdv2f , w1 , &
+ smbr , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w2 , w3 , w4 , w5 , w6 , w7 , &
+ w8 , w9 , w10 , dam , drtp , &
+ rdevel , rtuser , ra )
+
+! Si on extrapole les T.S.
+if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+! Sauvegarde pour echange
+ tuexpe = propce(iel,iptsta+isou-1)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta+isou-1) = smbr(iel)
+! Second membre du pas de temps precedent
+! On suppose -ROVSDT > 0 : on implicite
+! le terme source utilisateur (le reste)
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) - thets*tuexpe
+! Diagonale
+ rovsdt(iel) = - thetv*rovsdt(iel)
+ enddo
+else
+ do iel = 1, ncel
+ smbr(iel) = rovsdt(iel)*rtpa(iel,ivar) + smbr(iel)
+ rovsdt(iel) = max(-rovsdt(iel),zero)
+ enddo
+endif
+
+!===============================================================================
+! 4.2 TERME SOURCE DE MASSE
+!===============================================================================
+
+
+if (ncesmp.gt.0) then
+
+! Entier egal a 1 (pour navsto : nb de sur-iter)
+ iiun = 1
+
+! On incremente SMBR par -Gamma RTPA et ROVSDT par Gamma (*theta)
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , isto2t(iphas) , thetv , &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipriph) , &
+ smbr , rovsdt , w2 )
+
+! Si on extrapole les TS on met Gamma Pinj dans PROPCE
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w2(iel)
+ enddo
+! Sinon on le met directement dans SMBR
+ else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w2(iel)
+ enddo
+ endif
+
+endif
+
+
+!===============================================================================
+! 4.3 TERME D'ACCUMULATION DE MASSE -(dRO/dt)*VOLUME
+! ET TERME INSTATIONNAIRE
+!===============================================================================
+
+! ---> Calcul de mij
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w2)
+
+! ---> Ajout au second membre
+
+do iel = 1, ncel
+ smbr(iel) = smbr(iel) &
+ + iconv(ivar)*w2(iel)*rtpa(iel,ivar)
+enddo
+
+! ---> Ajout dans la diagonale de la matrice
+! Extrapolation ou non, meme forme par coherence avec bilsc2
+
+do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel) &
+ - iconv(ivar)*w2(iel)*thetv
+enddo
+
+!===============================================================================
+! 4.4 TERME SOURCE DE PHI
+! SMBR=rho*f_barre - phi/k*Pk +2/k*mu_t/sigmak*grad_phi*grad_k
+!===============================================================================
+
+! Terme explicite, stocke temporairement dans W2
+
+do iel = 1, ncel
+! Le terme en f_barre est pris en RTP et pas en RTPA ... a priori meilleur
+! Rq : si on reste en RTP, il faut modifier le cas de l'ordre 2 (qui
+! necessite RTPA pour l'extrapolation).
+ w2(iel) = volume(iel)* &
+ ( propce(iel,ipcroo)*rtp(iel,ifbiph) &
+ +2.d0/rtpa(iel,ikiph)*propce(iel,ipcvso)/sigmak*w1(iel) )
+enddo
+
+! Si on extrapole les T.S : PROPCE
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ propce(iel,iptsta+isou-1) = &
+ propce(iel,iptsta+isou-1) + w2(iel)
+ smbr(iel) = smbr(iel) + thetp1*propce(iel,iptsta+isou-1)
+ enddo
+! Sinon : SMBR
+else
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + w2(iel)
+ enddo
+endif
+
+! Terme implicite
+do iel = 1, ncel
+ smbr(iel) = smbr(iel) &
+ - volume(iel)*prdv2f(iel)*rtpa(iel,iphiph)/rtpa(iel,ikiph)
+enddo
+
+! ---> Matrice
+
+if(isto2t(iphas).gt.0) then
+ thetap = thetv
+else
+ thetap = 1.d0
+endif
+do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + volume(iel)*prdv2f(iel)/rtpa(iel,ikiph)*thetap
+enddo
+
+
+
+!===============================================================================
+! 4.5 TERMES DE DIFFUSION
+!===============================================================================
+! ---> Viscosite
+! Normalement, dans les equations du phi-model, seul la viscosite
+! turbulente intervient dans la diffusion de phi (le terme en mu
+! a disparu passant de f a f_barre). Mais tel
+! quel, cela rend le calcul instable (car mu_t tend vers 0 a la paroi
+! ce qui decouple phi de sa condition a la limite et le terme de diffusion
+! moleculaire etant integre dans f_barre, c'est comme s'il etait traite
+! en explicite).
+! -> on rajoute artificiellement de la diffusion (sachant que comme k=0 a
+! la paroi, on se moque de la valeur de phi).
+
+ if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ w2(iel) = propce(iel,ipcvis) + propce(iel,ipcvst)/sigmak
+ enddo
+
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w2 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+ else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ endif
+
+
+
+!===============================================================================
+! 4.6 RESOLUTION EFFECTIVE DE L'EQUATION DE PHI
+!===============================================================================
+
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ smbr(iel) = smbr(iel) + thetp1*propce(iel,iptsta+isou-1)
+ enddo
+endif
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 10. CLIPPING
+!===============================================================================
+
+ call clpv2f &
+ !==========
+ ( ncelet , ncel , nvar , nphas , &
+ iphas , iwarni(iphi(iphas)) , &
+ propce , rtp )
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ** PHASE ',I4,' RESOLUTION DU V2F (PHI ET F_BARRE) ',/,&
+' ----------------------------------------------- ',/)
+ 1100 format(/,' RESOLUTION POUR LA VARIABLE ',A8,/)
+
+#else
+
+ 1000 format(/, &
+' ** PHASE ',I4,' SOLVING V2F (PHI AND F_BAR)' ,/,&
+' ----------------------------------------' ,/)
+ 1100 format(/,' SOLVING VARIABLE ',A8 ,/)
+
+#endif
+
+!12345678 : MAX: 12345678901234 MIN: 12345678901234 NORM: 12345678901234
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/rijech.f90 b/src/base/rijech.f90
new file mode 100644
index 0000000..bdff258
--- /dev/null
+++ b/src/base/rijech.f90
@@ -0,0 +1,583 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine rijech &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , produc , smbr , &
+ coefax , coefbx , &
+ produk , w2 , w3 , w4 , epsk , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! TERMES D'ECHO DE PAROI
+! POUR Rij
+! VAR = R11 R22 R33 R12 R13 R23
+! ISOU = 1 2 3 4 5 6
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! produc ! tr ! <-- ! production !
+! (6,ncelet) ! ! ! !
+! smbr(ncelet ! tr ! <-- ! tableau de travail pour sec mem !
+! coefax,coefbx ! tr ! --- ! tableau de travail pour les cond. !
+! (nfabor) ! ! ! aux limites de la dist. paroi !
+! produk(ncelet ! tr ! --- ! tableau de travail production !
+! epsk (ncelet ! tr ! --- ! tableau de travail epsilon/k !
+! w2...6(ncelet ! tr ! --- ! tableau de travail production !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision produc(6,ncelet)
+double precision smbr(ncelet)
+double precision coefax(nfabor), coefbx(nfabor)
+double precision produk(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),epsk(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifacpt, iel , ii , jj , kk , mm
+integer irkm , irki , irkj , iskm , iski , iskj
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ieiph , ipcrom, ipcroo
+integer ifac , idimte, itenso
+integer inc , iccocg, iphydp, ivar0 , iityph
+
+double precision cmu075, distxn, d2s3 , trrij , xk
+double precision unssur, vnk , vnm , vni , vnj
+double precision deltki, deltkj, deltkm, deltij
+double precision aa , bb , surfbn, xnorme
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+ieiph = iep (iphas)
+
+ipcrom = ipproc(irom (iphas))
+ipcroo = ipcrom
+if(isto2t(iphas).gt.0.and.iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+endif
+
+deltij = 1.0d0
+if(isou.gt.3) then
+ deltij = 0.0d0
+endif
+
+cmu075 = cmu**0.75d0
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. CALCUL AUX CELLULES DES NORMALES EN PAROI CORRESPONDANTES
+!===============================================================================
+
+! On stocke les composantes dans les tableaux de travail W2, W3 et W4
+
+if(abs(icdpar).eq.2) then
+
+! On connait la face de paroi correspondante
+
+ do iel = 1, ncel
+ ifacpt = ia(iifapa(iphas)-1+iel)
+ surfbn = ra(isrfbn-1+ifacpt)
+ unssur = 1.d0/surfbn
+ w2(iel)= surfbo(1,ifacpt)*unssur
+ w3(iel)= surfbo(2,ifacpt)*unssur
+ w4(iel)= surfbo(3,ifacpt)*unssur
+ enddo
+
+elseif(abs(icdpar).eq.1) then
+
+! La normale est definie comme - gradient de la distance
+! a la paroi
+
+! La distance a la paroi vaut 0 en paroi
+! par definition et obeit a un flux nul ailleurs
+
+ iityph = iitypf+(iphas-1)*nfabor
+ do ifac = 1, nfabor
+ if(ia(iityph+ifac-1).eq.iparoi .or. &
+ ia(iityph+ifac-1).eq.iparug) then
+ coefax(ifac) = 0.0d0
+ coefbx(ifac) = 0.0d0
+ else
+ coefax(ifac) = 0.0d0
+ coefbx(ifac) = 1.0d0
+ endif
+ enddo
+
+! Calcul du gradient
+
+ if(irangp.ge.0) call parcom (ra(idipar))
+ !==========
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ ra(idipar), ra(idipar), ra(idipar), &
+ ra(idipar), ra(idipar), ra(idipar), &
+ ra(idipar), ra(idipar), ra(idipar))
+ endif
+
+ inc = 1
+ iccocg = 1
+ iphydp = 0
+ ivar0 = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgy , imligy , iphydp , &
+ iwarny , nfecra , &
+ epsrgy , climgy , extray , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra , ra , ra , &
+ ra(idipar) , coefax , coefbx , &
+ w2 , w3 , w4 , &
+! ------ ------ ------
+ produk , epsk , w6 , &
+ rdevel , rtuser , ra )
+
+
+! Normalisation (attention, le gradient peut etre nul, parfois)
+
+ do iel = 1 ,ncel
+ xnorme = max(sqrt(w2(iel)**2+w3(iel)**2+w4(iel)**2),epzero)
+ w2(iel) = -w2(iel)/xnorme
+ w3(iel) = -w3(iel)/xnorme
+ w4(iel) = -w4(iel)/xnorme
+ enddo
+
+endif
+
+!===============================================================================
+! 2. CALCUL DE VARIABLES DE TRAVAIL
+!===============================================================================
+
+
+
+! ---> Production et k
+
+do iel = 1 , ncel
+ produk(iel) = 0.5d0 * (produc(1,iel) + produc(2,iel) + &
+ produc(3,iel))
+ xk = 0.5d0 * (rtpa(iel,ir11ip) + rtpa(iel,ir22ip) + &
+ rtpa(iel,ir33ip))
+ epsk(iel) = rtpa(iel,ieiph)/xk
+enddo
+
+
+
+! ---> Indices des tensions
+
+if ((isou.eq.1).or.(isou.eq.4).or.(isou.eq.5)) then
+ ii = 1
+elseif ((isou.eq.2).or.(isou.eq.6)) then
+ ii = 2
+elseif (isou.eq.3) then
+ ii = 3
+endif
+
+if ((isou.eq.3).or.(isou.eq.5).or.(isou.eq.6)) then
+ jj = 3
+elseif ((isou.eq.2).or.(isou.eq.4)) then
+ jj = 2
+elseif (isou.eq.1) then
+ jj = 1
+endif
+
+! ---> Boucle pour construction des termes sources
+
+do iel = 1, ncel
+ w6(iel) = 0.d0
+enddo
+
+do kk = 1, 3
+
+! ---> Sommes sur m
+
+ do mm = 1, 3
+
+! --> Delta km
+
+ if(kk.eq.mm) then
+ deltkm = 1.0d0
+ else
+ deltkm = 0.0d0
+ endif
+
+! --> R km
+
+ if ((kk*mm).eq.1) then
+ irkm = ir11ip
+ iskm = 1
+ elseif ((kk*mm).eq.4) then
+ irkm = ir22ip
+ iskm = 2
+ elseif ((kk*mm).eq.9) then
+ irkm = ir33ip
+ iskm = 3
+ elseif ((kk*mm).eq.2) then
+ irkm = ir12ip
+ iskm = 4
+ elseif ((kk*mm).eq.3) then
+ irkm = ir13ip
+ iskm = 5
+ elseif ((kk*mm).eq.6) then
+ irkm = ir23ip
+ iskm = 6
+ endif
+
+! --> Termes en R km et Phi km
+
+ do iel = 1, ncel
+
+ if (kk.eq.1) then
+ vnk = w2(iel)
+ elseif(kk.eq.2) then
+ vnk = w3(iel)
+ elseif(kk.eq.3) then
+ vnk = w4(iel)
+ endif
+
+ if (mm.eq.1) then
+ vnm = w2(iel)
+ elseif(mm.eq.2) then
+ vnm = w3(iel)
+ elseif(mm.eq.3) then
+ vnm = w4(iel)
+ endif
+
+ w6(iel) = w6(iel) + vnk*vnm*deltij*( &
+ crijp1*rtpa(iel,irkm)*epsk(iel) &
+ -crijp2 &
+ *crij2*(produc(iskm,iel)-d2s3*produk(iel)*deltkm) )
+ enddo
+
+ enddo
+
+! ---> Fin des sommes sur m
+
+
+! --> R ki
+
+ if ((kk*ii).eq.1) then
+ irki = ir11ip
+ iski = 1
+ elseif ((kk*ii).eq.4) then
+ irki = ir22ip
+ iski = 2
+ elseif ((kk*ii).eq.9) then
+ irki = ir33ip
+ iski = 3
+ elseif ((kk*ii).eq.2) then
+ irki = ir12ip
+ iski = 4
+ elseif ((kk*ii).eq.3) then
+ irki = ir13ip
+ iski = 5
+ elseif ((kk*ii).eq.6) then
+ irki = ir23ip
+ iski = 6
+ endif
+
+! --> R kj
+
+ if ((kk*jj).eq.1) then
+ irkj = ir11ip
+ iskj = 1
+ elseif ((kk*jj).eq.4) then
+ irkj = ir22ip
+ iskj = 2
+ elseif ((kk*jj).eq.9) then
+ irkj = ir33ip
+ iskj = 3
+ elseif ((kk*jj).eq.2) then
+ irkj = ir12ip
+ iskj = 4
+ elseif ((kk*jj).eq.3) then
+ irkj = ir13ip
+ iskj = 5
+ elseif ((kk*jj).eq.6) then
+ irkj = ir23ip
+ iskj = 6
+ endif
+
+! --> Delta ki
+
+ if (kk.eq.ii) then
+ deltki = 1.d0
+ else
+ deltki = 0.d0
+ endif
+
+! --> Delta kj
+
+ if (kk.eq.jj) then
+ deltkj = 1.d0
+ else
+ deltkj = 0.d0
+ endif
+
+ do iel = 1, ncel
+
+ if (kk.eq.1) then
+ vnk = w2(iel)
+ elseif(kk.eq.2) then
+ vnk = w3(iel)
+ elseif(kk.eq.3) then
+ vnk = w4(iel)
+ endif
+
+ if (ii.eq.1) then
+ vni = w2(iel)
+ elseif(ii.eq.2) then
+ vni = w3(iel)
+ elseif(ii.eq.3) then
+ vni = w4(iel)
+ endif
+
+ if (jj.eq.1) then
+ vnj = w2(iel)
+ elseif(jj.eq.2) then
+ vnj = w3(iel)
+ elseif(jj.eq.3) then
+ vnj = w4(iel)
+ endif
+
+ w6(iel) = w6(iel) + 1.5d0*vnk*( &
+ -crijp1*(rtpa(iel,irki)*vnj+rtpa(iel,irkj)*vni)*epsk(iel) &
+ +crijp2 &
+ *crij2*((produc(iski,iel)-d2s3*produk(iel)*deltki)*vnj &
+ +(produc(iskj,iel)-d2s3*produk(iel)*deltkj)*vni) )
+
+ enddo
+
+enddo
+
+
+! ---> Distance a la paroi et fonction d'amortissement : W3
+! Pour chaque mode de calcul : meme code, test
+! en dehors de la boucle
+
+if(abs(icdpar).eq.2) then
+ do iel = 1 , ncel
+ ifacpt = ia(iifapa(iphas)-1+iel)
+ distxn = &
+ (cdgfbo(1,ifacpt)-xyzcen(1,iel))**2 &
+ +(cdgfbo(2,ifacpt)-xyzcen(2,iel))**2 &
+ +(cdgfbo(3,ifacpt)-xyzcen(3,iel))**2
+ distxn = sqrt(distxn)
+ trrij = 0.5d0 * (rtpa(iel,ir11ip) + rtpa(iel,ir22ip) + &
+ rtpa(iel,ir33ip))
+ aa = 1.d0
+ bb = cmu075*trrij**1.5d0/(xkappa*rtpa(iel,ieiph)*distxn)
+ w3(iel) = min(aa, bb)
+ enddo
+else
+ do iel = 1 , ncel
+ distxn = max(ra(idipar+iel-1),epzero)
+ trrij = 0.5d0 * (rtpa(iel,ir11ip) + rtpa(iel,ir22ip) + &
+ rtpa(iel,ir33ip))
+ aa = 1.d0
+ bb = cmu075*trrij**1.5d0/(xkappa*rtpa(iel,ieiph)*distxn)
+ w3(iel) = min(aa, bb)
+ enddo
+endif
+
+
+! ---> Increment du terme source
+
+do iel = 1, ncel
+ smbr(iel) = smbr(iel) &
+ + propce(iel,ipcroo)*volume(iel)*w6(iel)*w3(iel)
+enddo
+
+
+return
+
+end
diff --git a/src/base/rijthe.f90 b/src/base/rijthe.f90
new file mode 100644
index 0000000..d192c12
--- /dev/null
+++ b/src/base/rijthe.f90
@@ -0,0 +1,429 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine rijthe &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grarox , graroy , graroz , smbr , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! TERMES DE GRAVITE
+! POUR Rij et EPSILON
+! VAR = R11 R22 R33 R12 R13 R23 EP
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! grarox,y,z ! tr ! <-- ! tableau de travail pour grad rom !
+! (ncelet) ! ! ! !
+! smbr(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision grarox(ncelet), graroy(ncelet), graroz(ncelet)
+double precision smbr(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ieiph
+
+double precision uns3, const, kseps
+double precision prdtur, r1t, r2t, r3t
+double precision g11, g22, g33, g12, g13, g23, gkks3
+double precision g11p, g22p, g33p
+double precision phit11, phit22, phit33, phit12, phit13, phit23
+double precision aa, bb
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+ieiph = iep (iphas)
+
+if(iscalt(iphas).gt.0.and.nscal.ge.iscalt(iphas)) then
+ prdtur = sigmas(iscalt(iphas))
+else
+ prdtur = 1.d0
+endif
+
+const = -1.5d0*cmu/prdtur
+uns3 = 1.d0/3.d0
+
+!===============================================================================
+! 2. TERMES POUR RIJ :
+! ROM*VOLUME*dRij/dt =
+! ... + (Gij - CRIJ3*(Gij-Delta ij Gkk/3))*VOLUME
+! Avec Gij = -(1.5 CMU/PRDTUR) (K/EPS) (Rit Gj + Rjt Gi)
+! Rit = Rik dROM/dxk (somme sur k)
+!===============================================================================
+
+
+if (ivar.eq.ir11ip) then
+
+ do iel = 1, ncel
+
+ r1t = rtpa(iel,ir11ip)*grarox(iel) &
+ + rtpa(iel,ir12ip)*graroy(iel) &
+ + rtpa(iel,ir13ip)*graroz(iel)
+ r2t = rtpa(iel,ir12ip)*grarox(iel) &
+ + rtpa(iel,ir22ip)*graroy(iel) &
+ + rtpa(iel,ir23ip)*graroz(iel)
+ r3t = rtpa(iel,ir13ip)*grarox(iel) &
+ + rtpa(iel,ir23ip)*graroy(iel) &
+ + rtpa(iel,ir33ip)*graroz(iel)
+
+ kseps = (rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip)) &
+ /(2.d0*rtpa(iel,ieiph))
+
+ g11 = const*kseps*2.d0*(r1t*gx )
+ g22 = const*kseps*2.d0*(r2t*gy )
+ g33 = const*kseps*2.d0*(r3t*gz )
+ gkks3 = uns3*(g11+g22+g33)
+
+ phit11 = -crij3*(g11-gkks3)
+
+ smbr(iel) = smbr(iel) + (g11+phit11)*volume(iel)
+
+ enddo
+
+elseif (ivar.eq.ir22ip) then
+
+ do iel = 1, ncel
+
+ r1t = rtpa(iel,ir11ip)*grarox(iel) &
+ + rtpa(iel,ir12ip)*graroy(iel) &
+ + rtpa(iel,ir13ip)*graroz(iel)
+ r2t = rtpa(iel,ir12ip)*grarox(iel) &
+ + rtpa(iel,ir22ip)*graroy(iel) &
+ + rtpa(iel,ir23ip)*graroz(iel)
+ r3t = rtpa(iel,ir13ip)*grarox(iel) &
+ + rtpa(iel,ir23ip)*graroy(iel) &
+ + rtpa(iel,ir33ip)*graroz(iel)
+
+ kseps = (rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip)) &
+ /(2.d0*rtpa(iel,ieiph))
+
+ g11 = const*kseps*2.d0*(r1t*gx )
+ g22 = const*kseps*2.d0*(r2t*gy )
+ g33 = const*kseps*2.d0*(r3t*gz )
+ gkks3 = uns3*(g11+g22+g33)
+
+ phit22 = -crij3*(g22-gkks3)
+
+ smbr(iel) = smbr(iel) + (g22+phit22)*volume(iel)
+
+ enddo
+
+elseif (ivar.eq.ir33ip) then
+
+ do iel = 1, ncel
+
+ r1t = rtpa(iel,ir11ip)*grarox(iel) &
+ + rtpa(iel,ir12ip)*graroy(iel) &
+ + rtpa(iel,ir13ip)*graroz(iel)
+ r2t = rtpa(iel,ir12ip)*grarox(iel) &
+ + rtpa(iel,ir22ip)*graroy(iel) &
+ + rtpa(iel,ir23ip)*graroz(iel)
+ r3t = rtpa(iel,ir13ip)*grarox(iel) &
+ + rtpa(iel,ir23ip)*graroy(iel) &
+ + rtpa(iel,ir33ip)*graroz(iel)
+
+ kseps = (rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip)) &
+ /(2.d0*rtpa(iel,ieiph))
+
+ g11 = const*kseps*2.d0*(r1t*gx )
+ g22 = const*kseps*2.d0*(r2t*gy )
+ g33 = const*kseps*2.d0*(r3t*gz )
+ gkks3 = uns3*(g11+g22+g33)
+
+ phit33 = -crij3*(g33-gkks3)
+
+ smbr(iel) = smbr(iel) + (g33+phit33)*volume(iel)
+
+ enddo
+
+elseif (ivar.eq.ir12ip) then
+
+ do iel = 1, ncel
+
+ r1t = rtpa(iel,ir11ip)*grarox(iel) &
+ + rtpa(iel,ir12ip)*graroy(iel) &
+ + rtpa(iel,ir13ip)*graroz(iel)
+ r2t = rtpa(iel,ir12ip)*grarox(iel) &
+ + rtpa(iel,ir22ip)*graroy(iel) &
+ + rtpa(iel,ir23ip)*graroz(iel)
+
+ kseps = (rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip)) &
+ /(2.d0*rtpa(iel,ieiph))
+
+ g12 = const*kseps* (r1t*gy+r2t*gx)
+
+ phit12 = -crij3* g12
+
+ smbr(iel) = smbr(iel) + (g12+phit12)*volume(iel)
+
+ enddo
+
+elseif (ivar.eq.ir13ip) then
+
+ do iel = 1, ncel
+
+ r1t = rtpa(iel,ir11ip)*grarox(iel) &
+ + rtpa(iel,ir12ip)*graroy(iel) &
+ + rtpa(iel,ir13ip)*graroz(iel)
+ r3t = rtpa(iel,ir13ip)*grarox(iel) &
+ + rtpa(iel,ir23ip)*graroy(iel) &
+ + rtpa(iel,ir33ip)*graroz(iel)
+
+ kseps = (rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip)) &
+ /(2.d0*rtpa(iel,ieiph))
+
+ g13 = const*kseps* (r1t*gz+r3t*gx)
+
+ phit13 = -crij3* g13
+
+ smbr(iel) = smbr(iel) + (g13+phit13)*volume(iel)
+
+ enddo
+
+elseif (ivar.eq.ir23ip) then
+
+ do iel = 1, ncel
+
+ r2t = rtpa(iel,ir12ip)*grarox(iel) &
+ + rtpa(iel,ir22ip)*graroy(iel) &
+ + rtpa(iel,ir23ip)*graroz(iel)
+ r3t = rtpa(iel,ir13ip)*grarox(iel) &
+ + rtpa(iel,ir23ip)*graroy(iel) &
+ + rtpa(iel,ir33ip)*graroz(iel)
+
+ kseps = (rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip)) &
+ /(2.d0*rtpa(iel,ieiph))
+
+ g23 = const*kseps* (r2t*gz+r3t*gy)
+
+ phit23 = -crij3* g23
+
+ smbr(iel) = smbr(iel) + (g23+phit23)*volume(iel)
+
+ enddo
+
+!===============================================================================
+! 3. TERMES POUR EPSILON :
+! ROM*VOLUME*dEps/dt =
+! ... + CEPS1*(EPS/K)*MAX(0,(Gkk/2))*VOLUME
+! Avec Gij = -(1.5 CMU/PRDTUR) (K/EPS) (Rit Gj + Rjt Gi)
+! Rit = Rik dROM/dxk (somme sur k)
+! On simplifie (EPS/K) en notant
+! GijP = -(1.5 CMU/PRDTUR) (Rit Gj + Rjt Gi)
+! ROM*VOLUME*dEps/dt =
+! ... + CEPS1* MAX(0,(GkkP/2))*VOLUME
+!===============================================================================
+
+
+elseif (ivar.eq.ieiph ) then
+
+ do iel = 1, ncel
+
+ r1t = rtpa(iel,ir11ip)*grarox(iel) &
+ + rtpa(iel,ir12ip)*graroy(iel) &
+ + rtpa(iel,ir13ip)*graroz(iel)
+ r2t = rtpa(iel,ir12ip)*grarox(iel) &
+ + rtpa(iel,ir22ip)*graroy(iel) &
+ + rtpa(iel,ir23ip)*graroz(iel)
+ r3t = rtpa(iel,ir13ip)*grarox(iel) &
+ + rtpa(iel,ir23ip)*graroy(iel) &
+ + rtpa(iel,ir33ip)*graroz(iel)
+
+ g11p = const* 2.d0*(r1t*gx )
+ g22p = const* 2.d0*(r2t*gy )
+ g33p = const* 2.d0*(r3t*gz )
+
+ aa = 0.d0
+ bb = 0.5d0*(g11p+g22p+g33p)
+ smbr(iel) = smbr(iel) + ce1*max(aa,bb)*volume(iel)
+
+ enddo
+
+endif
+
+return
+
+end
diff --git a/src/base/scalai.f90 b/src/base/scalai.f90
new file mode 100644
index 0000000..81975b9
--- /dev/null
+++ b/src/base/scalai.f90
@@ -0,0 +1,743 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine scalai &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , coefa , coefb , &
+ dtr , viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR LES SCALAIRES SUR UN PAS DE TEMPS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! dtr(ncelet) ! tr ! --- ! dt*cdtvar !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision tslagr(ncelet,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision dtr(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer iscal, ivar, iphas, iel
+integer ii, iisc, itspdv, icalc, iappel
+integer ispecf
+integer maxelt, ils
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+
+!===============================================================================
+! 2. TRAITEMENT DES SCALAIRES A PHYSIQUE PARTICULIERE
+! Cette section sera dediee aux traitement particuliers.
+! On donne un exemple qui n'est que la recopie (a ISCAPP pres) de
+! la section 3 sur les scalaires utilisateurs.
+!===============================================================================
+
+if (ippmod(iphpar).ge.1) then
+
+! ---> Initialisation des RTP a partir des CL
+
+! On initialise RTP (et pas RTPA) car RTPA ne sert pas
+! dans codits.
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('SCALAI',IFINIA)
+
+ call ppinv2 &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+! On pourra eviter les bugs en initialisant aussi RTPA (sur NCELET)
+! (d'ailleurs, on s'en sert ensuite dans le cpflux etc)
+ if(ipass.eq.1.and.isuite.eq.0) then
+ if(nscapp.gt.0) then
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ ivar = isca(iscal)
+ do iel = 1, ncelet
+ rtpa (iel,ivar) = rtp (iel,ivar)
+ enddo
+ enddo
+ endif
+ endif
+
+! ---> Calculs TS relatifs a la physique du charbon
+! GMDEV1, GMDEV2, GMHET, GMDCH
+
+ if ( ippmod(icp3pl).ne.-1 ) then
+
+ call cpflux &
+ !==========
+ ( idebia , idebra , ncelet , ncel , &
+ rtpa , propce , volume , &
+ w1 , w2 , w3 , &
+ ra )
+
+ endif
+
+! ---> Calculs TS relatifs a la physique du fuel
+! GAMEVA, GAMHTF
+
+ if ( ippmod(icfuel).ne.-1 ) then
+
+ call fuflux &
+ !==========
+ ( idebia , idebra , ncelet , ncel , &
+ rtpa , propce , volume , &
+ w1 , w2 , w3 , &
+ ra )
+
+ endif
+
+! ATTENTION : POUR LE CLIPPING AVEC ICLP = 1, IL FAUT
+
+! QUE LES SCALAIRES SOIENT RESOLUS AVANT
+! LEUR VARIANCE ASSOCIEE
+
+
+
+
+
+
+! ---> Boucle sur les scalaires physiques particulieres.
+! On peut imaginer a la place des resolutions couplees.
+! Ici, on ne donne qu'un exemple.
+
+ do ii = 1, nscapp
+
+ iscal = iscapp(ii)
+ ivar = isca(iscal)
+
+! ---> Pas de temps (avec facteur multiplicatif eventuel)
+
+ if(cdtvar(ivar).ne.1.d0) then
+ do iel = 1, ncel
+ dtr(iel) = dt(iel)*cdtvar(ivar)
+ enddo
+ else
+ do iel = 1, ncel
+ dtr(iel) = dt(iel)
+ enddo
+ endif
+
+! Schema compressible sans choc :
+! ---> Traitement special pour la masse volumique,
+! la temperature et l'energie
+! L'indicateur ISPECF sera non nul si l'on ne doit pas resoudre
+! le scalaire plus bas avec covofi.
+
+ ispecf = 0
+
+ if ( ippmod(icompf).ge.0 ) then
+
+ do iphas = 1, nphas
+ if ( iscal.eq.irho(iphas) .or. &
+ iscal.eq.itempk(iphas) ) then
+ ispecf = 1
+ elseif ( iscal.eq.ienerg(iphas) ) then
+ ispecf = 2
+ endif
+ enddo
+
+! ---> Masse volumique : deja resolue
+! ---> Temperature : n'est pas une variable transportee
+! ---> Enthalpie : a resoudre
+
+ if(ispecf.eq.2) then
+
+ iphas = iphsca(iscal)
+
+ call cfener &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+! Pour le compressible, on ne resout pas celles deja resolues ou
+! qui ne doivent pas l'etre
+! Pour les autres physiques, on resout les scalaires dans l'ordre
+! (pas de tests a faire)
+
+ if(ispecf.eq.0) then
+
+! ---> Variances et scalaires
+
+! iscavr dira scalaire/variance
+! itspdv dira si calcul des termes de prod et dissip supplementaires
+! ou non (1 : oui, 0 : non)
+
+! si iscavr = 0
+! scalaire
+! itspdv = 0
+! sinon
+! variance
+! si iscavr > 0 et iscavr < nscal+1
+! itspdv = 1
+! sinon
+! pour le moment, on s'arrete
+! a terme, les combustionnistes pourront donner leur propre
+! grandeur scalaire associee a la variance et
+! eventuellement reconstruite en dehors de covofi.
+! il faudra alors peut etre declarer des tableaux
+! de travail suppl
+! fin si
+! fin si
+
+ iisc = iscal
+ if(iscavr(iisc).eq.0) then
+ itspdv = 0
+ elseif(iscavr(iisc).gt.0.and.iscavr(iisc).le.nscal) then
+ itspdv = 1
+ else
+ write(nfecra,9000)iisc,iisc,nscal,iscavr(iisc)
+ call csexit (1)
+ endif
+
+
+! ---> Appel a covofi pour la resolution
+
+ iphas = iphsca(iisc)
+
+ call covofi &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iisc , itspdv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dtr , rtp , rtpa , propce , propfa , propfb , tslagr , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! ---> Versions Electriques
+! Effet Joule
+! Arc Electrique
+! Conduction ionique
+
+! On calcule ici j, E, j.E reels et imagimaires
+
+ if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+
+! On utilise le fait que les scalaires sont dans l'ordre
+! H, PotR, [PotI], [A] pour faire le calcul de j, E et j.E
+! apres la determination de PotR [et PotI].
+
+ icalc = 0
+! On peut y aller apres PotR si on est en arc
+! ou en Joule sans PotI
+
+ if(ippmod(ielarc).ge.1.or.ippmod(ieljou).eq.1 &
+ .or.ippmod(ieljou).eq.3) then
+ if(iscal.eq.ipotr) then
+ icalc = 1
+ endif
+ endif
+! On y va apres PotI si on est en Joule avec PotI
+ if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+ if(iscal.eq.ipoti) then
+ icalc = 1
+ endif
+ endif
+
+ if(icalc.eq.1) then
+
+! Calcul de j, E et j.E
+ iappel = 1
+
+ call elflux &
+ !==========
+ ( idebia , idebra , iappel , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! Recalage des variables electriques j, j.E (et Pot, E)
+
+ if ( ielcor .eq.1 .and. ntcabs .gt. 1 ) then
+
+ call uselrc &
+ !==========
+ (idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+ endif
+
+ endif
+
+
+! ---> Fin de la Boucle sur les scalaires physiques particulieres.
+ enddo
+endif
+
+
+! On calcule ici A, B, jxB
+
+if ( ippmod(ielarc).ge.1 ) then
+
+! On utilise le fait que les scalaires sont dans l'ordre
+! H, PotR, [PotI], [A] pour faire le calcul de A, B, jxB
+! apres la determination et le recalage de j
+ iappel = 2
+
+ call elflux &
+ !==========
+ ( idebia , idebra , iappel , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 3. TRAITEMENT DES SCALAIRES UTILISATEURS STANDARD
+! On voit que meme s'ils sont numerotes en premier, on peut les
+! traiter en dernier si on veut.
+! On peut imaginer aussi de by-passer cette phase si le modele a
+! physique particuliere le demande.
+!===============================================================================
+
+if(nscaus.gt.0) then
+
+! ---> Boucle sur les scalaires utilisateur.
+
+ do ii = 1, nscaus
+
+ iscal = ii
+ ivar = isca(iscal)
+
+! ---> Pas de temps (avec facteur multiplicatif eventuel)
+
+ if(cdtvar(ivar).ne.1.d0) then
+ do iel = 1, ncel
+ dtr(iel) = dt(iel)*cdtvar(ivar)
+ enddo
+ else
+ do iel = 1, ncel
+ dtr(iel) = dt(iel)
+ enddo
+ endif
+
+
+! ---> Variances et scalaires
+
+! iscavr dira scalaire/variance
+! itspdv dira si calcul des termes de prod et dissip supplementaires
+! ou non (1 : oui, 0 : non)
+
+! si iscavr = 0
+! scalaire
+! itspdv = 0
+! sinon
+! variance
+! si iscavr > 0 et iscavr < nscal+1
+! itspdv = 1
+! sinon
+! pour le moment, on s'arrete
+! a terme, les combustionnistes pourront donner leur propre
+! grandeur scalaire associee a la variance et
+! eventuellement reconstruite en dehors de covofi.
+! il faudra alors peut etre declarer des tableaux
+! de travail suppl
+! fin si
+! fin si
+
+ iisc = iscal
+ if(iscavr(iisc).eq.0) then
+ itspdv = 0
+ elseif(iscavr(iisc).gt.0.and.iscavr(iisc).le.nscal) then
+ itspdv = 1
+ else
+ write(nfecra,9000)iisc,iisc,nscal,iscavr(iisc)
+ call csexit (1)
+ endif
+
+
+! ---> Appel a covofi pour la resolution
+
+ iphas = iphsca(iisc)
+
+ call covofi &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iisc , itspdv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dtr , rtp , rtpa , propce , propfa , propfb , tslagr , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+
+
+
+
+! ---> Fin de la Boucle sur les scalaires utilisateurs.
+ enddo
+
+endif
+
+!===============================================================================
+! 4. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA RESOLUTION DES SCALAIRES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE NUMERO ',I10 ,/,&
+'@ ISCAVR(',I10 ,') DOIT ETRE UN ENTIER ',/,&
+'@ POSITIF OU NUL ET ',/,&
+'@ INFERIEUR OU EGAL A NSCAL = ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Si ISCAVR(I) est nul, le scalaire I n est pas une variance',/,&
+'@ Si ISCAVR(I) est positif, le scalaire I est une variance :',/,&
+'@ il s agit de la variance des fluctuations du scalaire J ',/,&
+'@ dont le numero est ISCAVR(I) ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT WHILE SOLVING SCALARS EQUATIONS ',/,&
+'@ ======== ',/,&
+'@ SCALAR NUMBER ',I10 ,/,&
+'@ ISCAVR(',I10 ,') MUST BE A POSITIVE OR NULL INTEGER ',/,&
+'@ AND LOWER OR EQUAL THAN NSCAL = ', I10 ,/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculaton will not be run. ',/,&
+'@ ',/,&
+'@ If ISCAVR(I) is null, the scalar I is not a variance ',/,&
+'@ If ISCAVR(I) is positive, the scalar I is a variance: ',/,&
+'@ it is the variance of the fluctuations of the scalar J ',/,&
+'@ whose number is ISCAVR(I) ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ Contact support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+return
+
+end
diff --git a/src/base/schtmp.f90 b/src/base/schtmp.f90
new file mode 100644
index 0000000..01835a9
--- /dev/null
+++ b/src/base/schtmp.f90
@@ -0,0 +1,711 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine schtmp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! TRAITEMENT DU FLUX DE MASSE, DE LA VISCOSITE, DE LA MASSE
+! VOLUMIQUE, DE LA CHALEUR SPECIFIQUE ET DU TABLEAU TSNSA
+! DANS LE CAS D'UN THETA SCHEMA
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iappel ! e ! <-- ! numero de l'appel (avant ou apres !
+! ! ! ! phyvar !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! isostd ! te ! <-- ! indicateur de sortie standard !
+! (nfabor+1) ! ! ! +numero de la face de reference !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iappel
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer isostd(nfabor+1,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , ifac , iscal
+integer iphas , iuiph
+integer ipcrom , ipcroa
+integer ipbrom , ipbroa
+integer iflmas , iflmab , iflmba, iflmsa
+integer ipcvis , ipcvst
+integer ipcvsa , ipcvta , ipcvsl
+integer iicp , iicpa
+double precision flux , theta , aa, bb, viscos, xmasvo, varcp
+
+!===============================================================================
+
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. AU TOUT DEBUT DE LA BOUCLE EN TEMPS
+!===============================================================================
+
+if(iappel.eq.1) then
+
+! --- Application du schema en temps sur le flux de masse
+! Soit F le flux de masse
+! - si ISTMPF = 2 (schema non standard, theta>0 en fait = 0.5)
+! PROPFA(1,IFLMAS) contient F_(n-2+theta) et on y met F(n-1+theta)
+! PROPFA(1,IFLMSA) contient F_(n-1+theta) et
+! on y met une extrapolation en n+theta
+! - si ISTMPF = 1 (schema non standard, theta=0)
+! PROPFA(1,IFLMAS) contient deja F_n et
+! PROPFA(1,IFLMSA) n'est pas utilise : on ne fait rien
+! - sinon : ISTMPF = 0 (schema standard, theta= -999)
+! PROPFA(1,IFLMAS) et PROPFA(1,IFLMSA) contiennent tous les deux F(n)
+! : on ne fait rien
+
+
+! Ordre 2 en temps pour le flux (theta = 0.5) a entrer dans navsto
+! Flux convectif = 2F(n-1+theta)-F(n-2+theta)
+! Flux conserve = F(n-1+theta)
+! Au premier pas de temps, l'ancien a ete initialise dans inivar (a 0)
+! en suite de calcul, les deux ont ete relus.
+
+ do iphas = 1, nphas
+ if(istmpf(iphas).eq.2) then
+ iuiph = iu(iphas)
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ iflmsa = ipprof(ifluaa(iuiph))
+ iflmba = ipprob(ifluaa(iuiph))
+ do ifac = 1 , nfac
+ flux = propfa(ifac,iflmas)
+ propfa(ifac,iflmas) = 2.d0*propfa(ifac,iflmas) &
+ - propfa(ifac,iflmsa)
+ propfa(ifac,iflmsa) = flux
+ enddo
+ do ifac = 1 , nfabor
+ flux = propfb(ifac,iflmab)
+ propfb(ifac,iflmab) = 2.d0*propfb(ifac,iflmab) &
+ - propfb(ifac,iflmba)
+ propfb(ifac,iflmba) = flux
+ enddo
+ endif
+ enddo
+
+! Les valeurs courantes ecrasent les valeurs anterieures
+! en cas d'extrapolation en temps (theta > 0)
+! Pour RHO, on le fait en double si ICALHY = 1 (et sur NCELET)
+! Au debut du calcul les flux nouveau et ancien ont ete initialises inivar
+ do iphas = 1, nphas
+ if(iroext(iphas).gt.0) then
+ ipcrom = ipproc(irom (iphas))
+ ipcroa = ipproc(iroma (iphas))
+ do iel = 1, ncelet
+ propce(iel,ipcroa) = propce(iel,ipcrom)
+ enddo
+ ipbrom = ipprob(irom (iphas))
+ ipbroa = ipprob(iroma (iphas))
+ do ifac = 1, nfabor
+ propfb(ifac,ipbroa) = propfb(ifac,ipbrom)
+ enddo
+ endif
+ enddo
+ do iphas = 1, nphas
+ if(iviext(iphas).gt.0) then
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ ipcvsa = ipproc(ivisla(iphas))
+ ipcvta = ipproc(ivista(iphas))
+ do iel = 1, ncel
+ propce(iel,ipcvsa) = propce(iel,ipcvis)
+ propce(iel,ipcvta) = propce(iel,ipcvst)
+ enddo
+ endif
+ enddo
+ do iphas = 1, nphas
+ if(icpext(iphas).gt.0) then
+ if(icp (iphas).gt.0) then
+ iicp = ipproc(icp (iphas))
+ iicpa = ipproc(icpa (iphas))
+ do iel = 1, ncel
+ propce(iel,iicpa ) = propce(iel,iicp )
+ enddo
+ endif
+ endif
+ enddo
+
+! Remarque : si on faisant cette operation pour tous les
+! scalaires, on la ferait plusieurs fois pour les scalaires
+! ayant une variance
+ if (nscal.ge.1) then
+ do iscal = 1, nscal
+ if(ivisls(iscal).gt.0.and.iscavr(iscal).le.0) then
+ if(ivsext(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+ ipcvsa = ipproc(ivissa(iscal))
+ do iel = 1, ncel
+ propce(iel,ipcvsa) = propce(iel,ipcvsl)
+ enddo
+ endif
+ endif
+ enddo
+ endif
+
+ return
+
+
+!===============================================================================
+! 2. JUSTE APRES PHYVAR (ET DONC AVANT NAVSTO)
+!===============================================================================
+
+
+elseif(iappel.eq.2) then
+
+! 2.1 MISE A JOUR DES VALEURS ANCIENNES
+! =====================================
+
+! On passe ici dans le cas ou l'on suspecte que la valeur portee
+! par les variables "anciennes" n'est pas satisfaisante pour
+! extrapoler.
+! On passe ici au premier pas de temps et lorsque le fichier suite
+! ne comportait pas grandeur requise.
+
+ do iphas = 1, nphas
+ if(initro(iphas).ne.1) then
+ initro(iphas) = 1
+ if(iroext(iphas).gt.0) then
+ ipcrom = ipproc(irom (iphas))
+ ipcroa = ipproc(iroma (iphas))
+ do iel = 1, ncelet
+ propce(iel,ipcroa) = propce(iel,ipcrom)
+ enddo
+ ipbrom = ipprob(irom (iphas))
+ ipbroa = ipprob(iroma (iphas))
+ do ifac = 1, nfabor
+ propfb(ifac,ipbroa) = propfb(ifac,ipbrom)
+ enddo
+ endif
+ endif
+ enddo
+ do iphas = 1, nphas
+ if(initvi(iphas).ne.1) then
+ initvi(iphas) = 1
+ if(iviext(iphas).gt.0) then
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ ipcvsa = ipproc(ivisla(iphas))
+ ipcvta = ipproc(ivista(iphas))
+ do iel = 1, ncel
+ propce(iel,ipcvsa) = propce(iel,ipcvis)
+ propce(iel,ipcvta) = propce(iel,ipcvst)
+ enddo
+ endif
+ endif
+ enddo
+ do iphas = 1, nphas
+ if(initcp(iphas).ne.1) then
+ initcp(iphas) = 1
+ if(icpext(iphas).gt.0) then
+ if(icp (iphas).gt.0) then
+ iicp = ipproc(icp (iphas))
+ iicpa = ipproc(icpa (iphas))
+ do iel = 1, ncel
+ propce(iel,iicpa ) = propce(iel,iicp )
+ enddo
+ endif
+ endif
+ endif
+ enddo
+
+! Remarque : si on faisant cette operation pour tous les
+! scalaires, on la ferait plusieurs fois pour les scalaires
+! ayant une variance
+ if (nscal.ge.1) then
+ do iscal = 1, nscal
+ if(initvs(iscal).ne.1) then
+ initvs(iscal) = 1
+ if(ivisls(iscal).gt.0.and.iscavr(iscal).le.0) then
+ if(ivsext(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+ ipcvsa = ipproc(ivissa(iscal))
+ do iel = 1, ncel
+ propce(iel,ipcvsa) = propce(iel,ipcvsl)
+ enddo
+ endif
+ endif
+ endif
+ enddo
+ endif
+
+
+! 2.2 EXTRAPOLATION DES NOUVELLES VALEURS
+! =======================================
+
+! --- Extrapolation de la viscosite et de la masse volumique dans le cas d'un
+! theta schema
+! A partir de Fn-1 et Fn on calcule Fn+theta
+! On conserve les nouvelles valeurs dans l'ancien tableau pour
+! retablir en fin de pas de temps
+
+! Le calcul pour Rho est fait sur NCELET afin d'economiser un echange.
+
+ do iphas = 1, nphas
+ if(iroext(iphas).gt.0) then
+ ipcrom = ipproc(irom (iphas))
+ ipcroa = ipproc(iroma (iphas))
+ theta = thetro(iphas)
+ do iel = 1, ncelet
+ xmasvo = propce(iel,ipcrom)
+ propce(iel,ipcrom) = (1.d0+theta) * propce(iel,ipcrom) &
+ - theta * propce(iel,ipcroa)
+ propce(iel,ipcroa) = xmasvo
+ enddo
+ ipbrom = ipprob(irom (iphas))
+ ipbroa = ipprob(iroma (iphas))
+ do ifac = 1, nfabor
+ xmasvo = propfb(ifac,ipbrom)
+ propfb(ifac,ipbrom) = (1.d0+theta) * propfb(ifac,ipbrom) &
+ - theta * propfb(ifac,ipbroa)
+ propfb(ifac,ipbroa) = xmasvo
+ enddo
+ endif
+ if(iviext(iphas).gt.0) then
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ ipcvsa = ipproc(ivisla(iphas))
+ ipcvta = ipproc(ivista(iphas))
+ theta = thetvi(iphas)
+ do iel = 1, ncel
+ viscos = propce(iel,ipcvis)
+ propce(iel,ipcvis) = (1.d0+theta) * propce(iel,ipcvis) &
+ - theta * propce(iel,ipcvsa)
+ propce(iel,ipcvsa) = viscos
+ viscos = propce(iel,ipcvst)
+ propce(iel,ipcvst) = (1.d0+theta) * propce(iel,ipcvst) &
+ - theta * propce(iel,ipcvta)
+ propce(iel,ipcvta) = viscos
+ enddo
+ endif
+ if(icpext(iphas).gt.0) then
+ if(icp(iphas).gt.0) then
+ iicp = ipproc(icp (iphas))
+ iicpa = ipproc(icpa (iphas))
+ theta = thetcp(iphas)
+ do iel = 1, ncel
+ varcp = propce(iel,iicp )
+ propce(iel,iicp ) = (1.d0+theta) * propce(iel,iicp ) &
+ - theta * propce(iel,iicpa )
+ propce(iel,ipcvsa) = varcp
+ enddo
+ endif
+ endif
+ enddo
+
+! Remarque : si on faisant cette operation pour tous les
+! scalaires, on la ferait plusieurs fois pour les scalaires
+! ayant une variance ET CE SERAIT FAUX
+ if (nscal.ge.1) then
+ do iscal = 1, nscal
+ if(ivisls(iscal).gt.0.and.iscavr(iscal).le.0) then
+ if(ivsext(iscal).gt.0) then
+ theta = thetvs(iscal)
+ ipcvsl = ipproc(ivisls(iscal))
+ ipcvsa = ipproc(ivissa(iscal))
+ if(ipcvsl.gt.0) then
+ do iel = 1, ncel
+ viscos = propce(iel,ipcvsa)
+ propce(iel,ipcvsl) = (1.d0+theta)*propce(iel,ipcvsl)&
+ - theta *propce(iel,ipcvsa)
+ propce(iel,ipcvsa) = viscos
+ enddo
+ endif
+ endif
+ endif
+ enddo
+ endif
+
+ return
+
+
+
+!===============================================================================
+! 3. JUSTE APRES NAVSTO, DANS LES BOUCLES U/P ET ALE
+!===============================================================================
+
+elseif(iappel.eq.3) then
+
+! On traite ici le flux de masse uniquement
+! On suppose qu'il n'y en a qu'un seul.
+
+! Si ISTMPF = 1 : standard : on ne fait rien
+! Si ISTMPF = 2 : ordre 2 (THETFL > 0 : = 0.5)
+! on calcule F(n+theta) par interpolation a partir
+! de F_(n-1+theta) et F(n+1) et on le met dans PROPFA(1,IFLMAS)
+! Si ISTMPF = 0 : explicite (THETFL = 0) : on remet F(n) dans
+! PROPFA(1,IFLMAS) sauf a la derniere iteration (un traitement
+! complementaire sera fait en IAPPEL=4)
+
+! Dans le cas ou on itere sur navsto, on passe ici
+! - a toutes les iterations si ISTMPF.NE.0
+! - a toutes les iterations sauf la derniere si ISTMPF.EQ.0
+
+ do iphas = 1, nphas
+ iuiph = iu(iphas)
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ if(istmpf(iphas).eq.2) then
+ iflmsa = ipprof(ifluaa(iuiph))
+ iflmba = ipprob(ifluaa(iuiph))
+ theta = thetfl(iphas)
+ aa = 1.d0/(2.d0-theta)
+ bb = (1.d0-theta)/(2.d0-theta)
+ do ifac = 1 , nfac
+ propfa(ifac,iflmas) = aa * propfa(ifac,iflmas) &
+ + bb * propfa(ifac,iflmsa)
+ enddo
+ do ifac = 1 , nfabor
+ propfb(ifac,iflmab) = aa * propfb(ifac,iflmab) &
+ + bb * propfb(ifac,iflmba)
+ enddo
+ elseif(istmpf(iphas).eq.0) then
+ iflmsa = ipprof(ifluaa(iuiph))
+ iflmba = ipprob(ifluaa(iuiph))
+ do ifac = 1 , nfac
+ propfa(ifac,iflmas) = propfa(ifac,iflmsa)
+ enddo
+ do ifac = 1 , nfabor
+ propfb(ifac,iflmab) = propfb(ifac,iflmba)
+ enddo
+ endif
+ enddo
+
+ return
+
+!===============================================================================
+! 3. JUSTE APRES NAVSTO (ET STRDEP), HORS LES BOUCLES U/P ET ALE
+!===============================================================================
+
+elseif(iappel.eq.4) then
+
+! On traite ici le flux de masse uniquement
+! On suppose qu'il n'y en a qu'un seul.
+
+! Si ISTMPF = 1 : standard : on ne fait rien
+! Si ISTMPF = 2 : ordre 2 (THETFL > 0 : = 0.5)
+! on calcule F(n+theta) par interpolation a partir
+! de F_(n-1+theta) et F(n+1) et on le met dans PROPFA(1,IFLMAS)
+! Si ISTMPF = 0 : explicite (THETFL = 0)
+! On sauvegarde F_(n+1) dans PROPFA(1,IFLMSA),mais on continue
+! les calculs avec F_(n) mis dans PROPFA(1,IFLMAS)
+
+! On retablira au dernier appel de schtmp pour ISTMPF = 0
+
+! Dans le cas ou on itere sur navsto, on passe ici
+! - a toutes les iterations si ISTMPF.NE.0
+! - uniquement a la derniere iteration si ISTMPF.EQ.0
+! (ce faisant, a partir de la deuxieme sous-iteration,
+! le calcul sera fait avec F(n+1) et plus F(n), mais on
+! suppose que l'utilisateur a choisi de faire des sous-iter
+! aussi pour impliciter le flux de masse)
+
+ do iphas = 1, nphas
+ iuiph = iu(iphas)
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ if(istmpf(iphas).eq.2) then
+ iflmsa = ipprof(ifluaa(iuiph))
+ iflmba = ipprob(ifluaa(iuiph))
+ theta = thetfl(iphas)
+ aa = 1.d0/(2.d0-theta)
+ bb = (1.d0-theta)/(2.d0-theta)
+ do ifac = 1 , nfac
+ propfa(ifac,iflmas) = aa * propfa(ifac,iflmas) &
+ + bb * propfa(ifac,iflmsa)
+ enddo
+ do ifac = 1 , nfabor
+ propfb(ifac,iflmab) = aa * propfb(ifac,iflmab) &
+ + bb * propfb(ifac,iflmba)
+ enddo
+ elseif(istmpf(iphas).eq.0) then
+ iflmsa = ipprof(ifluaa(iuiph))
+ iflmba = ipprob(ifluaa(iuiph))
+ do ifac = 1 , nfac
+ flux = propfa(ifac,iflmas)
+ propfa(ifac,iflmas) = propfa(ifac,iflmsa)
+ propfa(ifac,iflmsa) = flux
+ enddo
+ do ifac = 1 , nfabor
+ flux = propfb(ifac,iflmab)
+ propfb(ifac,iflmab) = propfb(ifac,iflmba)
+ propfb(ifac,iflmba) = flux
+ enddo
+ endif
+ enddo
+
+ return
+
+!===============================================================================
+! 3. JUSTE APRES SCALAI
+!===============================================================================
+
+elseif(iappel.eq.5) then
+
+! 3.1 RETABLISSEMENT POUR LE FLUX DE MASSE
+! ========================================
+
+! On corrige les manipulations sur le flux de masse faites dans
+! l'appel precedent afin d'etre pret pour le pas de temps suivant.
+
+! Si ISTMPF = 1 : standard : on ne fait rien
+! Si ISTMPF = 2 : ordre 2 (THETFL > 0 : = 0.5) : on ne fait rien
+! Si ISTMPF = 0 : explicite (THETFL = 0)
+! on remet F_(n+1) (stocke dans PROPFA(1,IFLMSA)) dans PROPFA(1,IFLMAS)
+! de sorte que les deux flux contiennent la meme chose
+
+ do iphas = 1, nphas
+ if(istmpf(iphas).eq.0) then
+ iuiph = iu(iphas)
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ iflmsa = ipprof(ifluaa(iuiph))
+ iflmba = ipprob(ifluaa(iuiph))
+ do ifac = 1 , nfac
+ propfa(ifac,iflmas) = propfa(ifac,iflmsa)
+ enddo
+ do ifac = 1 , nfabor
+ propfb(ifac,iflmab) = propfb(ifac,iflmba)
+ enddo
+ endif
+ enddo
+
+! 3.1 RETABLISSEMENT POUR LES PROPRIETES PHYSIQUES
+! ================================================
+
+! Le calcul pour Rho est fait sur NCELET afin d'economiser un echange.
+
+ do iphas = 1, nphas
+ if(iroext(iphas).gt.0) then
+ ipcrom = ipproc(irom (iphas))
+ ipcroa = ipproc(iroma (iphas))
+ do iel = 1, ncelet
+ propce(iel,ipcrom) = propce(iel,ipcroa)
+ enddo
+ ipbrom = ipprob(irom (iphas))
+ ipbroa = ipprob(iroma (iphas))
+ do ifac = 1, nfabor
+ propfb(ifac,ipbrom) = propfb(ifac,ipbroa)
+ enddo
+ endif
+ if(iviext(iphas).gt.0) then
+ ipcvis = ipproc(iviscl(iphas))
+ ipcvst = ipproc(ivisct(iphas))
+ ipcvsa = ipproc(ivisla(iphas))
+ ipcvta = ipproc(ivista(iphas))
+ do iel = 1, ncel
+ propce(iel,ipcvis) = propce(iel,ipcvsa)
+ propce(iel,ipcvst) = propce(iel,ipcvta)
+ enddo
+ endif
+ if(icpext(iphas).gt.0) then
+ if(icp(iphas).gt.0) then
+ iicp = ipproc(icp (iphas))
+ iicpa = ipproc(icpa (iphas))
+ do iel = 1, ncel
+ propce(iel,iicp ) = propce(iel,iicpa )
+ enddo
+ endif
+ endif
+ enddo
+
+! Remarque : si on faisant cette operation pour tous les
+! scalaires, on la ferait plusieurs fois pour les scalaires
+! ayant une variance
+ if (nscal.ge.1) then
+ do iscal = 1, nscal
+ if(ivisls(iscal).gt.0.and.iscavr(iscal).le.0) then
+ if(ivsext(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+ ipcvsa = ipproc(ivissa(iscal))
+ do iel = 1, ncel
+ propce(iel,ipcvsl) = propce(iel,ipcvsa)
+ enddo
+ endif
+ endif
+ enddo
+ endif
+
+ return
+
+endif
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/stdtcl.f90 b/src/base/stdtcl.f90
new file mode 100644
index 0000000..91c9bb7
--- /dev/null
+++ b/src/base/stdtcl.f90
@@ -0,0 +1,632 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine stdtcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nbzfmx , nozfmx , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ iqimp , icalke , qimp , dh , xintur , &
+ icodcl , itrifb , itypfb , iznfbr , ilzfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ coefu , qcalc , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! EN STANDARD
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbzfmx ! e ! <-- ! nb max de zones de faces de bord !
+! nozfmx ! e ! <-- ! numero max de zones de faces de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! iznfbr ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! !
+! ilzfbr(nbzfmx ! te ! <-- ! tableau de travail !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! qcalc(nozfmx) ! tr ! --- ! tab de travail (debit par zone) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml , nozfmx
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nbzfmx
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer iqimp(nozfmx), icalke(nozfmx)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer iznfbr(nfabor), ilzfbr(nbzfmx)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision qimp(nozfmx), dh(nozfmx), xintur(nozfmx)
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision qcalc(nozfmx)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iphas, ifac, izone, ifvu, izonem
+integer nozapm, nzfppp
+integer ipbrom, icke, ipcvis, ii, iel, iok
+double precision qisqc, viscla, d2s3, uref2, rhomoy, dhy, xiturb
+double precision ustar2, xkent, xeent
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+ipbrom = ipprob(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+d2s3 = 2.d0/3.d0
+
+! --> On construit une liste des numeros des zones frontieres.
+! (liste locale au processeur, en parallele)
+nzfppp = 0
+do ifac = 1, nfabor
+ ifvu = 0
+ do ii = 1, nzfppp
+ if (ilzfbr(ii).eq.iznfbr(ifac)) then
+ ifvu = 1
+ endif
+ enddo
+ if(ifvu.eq.0) then
+ nzfppp = nzfppp + 1
+ if(nzfppp.le.nbzfmx) then
+ ilzfbr(nzfppp) = iznfbr(ifac)
+ else
+ write(nfecra,1001) nbzfmx
+ write(nfecra,1002)(ilzfbr(ii),ii=1,nbzfmx)
+ call csexit (1)
+ !==========
+ endif
+ endif
+enddo
+
+! ---> Plus grand numero de zone
+
+izonem = 0
+do ii = 1, nzfppp
+ izone = ilzfbr(ii)
+ izonem = max(izonem,izone)
+enddo
+if(irangp.ge.0) then
+ call parcmx(izonem)
+ !==========
+endif
+nozapm = izonem
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LES CONDITIONS AUX LIMITES DONNEES PAR ',/,&
+'@ ========= ',/,&
+'@ L''INTERFACE SONT INCOMPLETES OU INEXISTANTES ',/,&
+'@ ',/,&
+'@ Il y a ',I10,' faces pour lesquelles aucune zone ',/,&
+'@ n''est d�finie. ',/,&
+'@ ',/,&
+'@ Le calcul continue. ',/,&
+'@ ',/,&
+'@ Compl�ter les conditions aux limites dans le ',/,&
+'@ sous-programme usclim.F. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ========= ',/,&
+'@ ARRET DANS LE SOUS-PROGRAMME STDTCL ',/,&
+'@ ',/,&
+'@ Le nombre maximal de zones frontieres qui peuvent etre ',/,&
+'@ definies par l''utilisateur est NBZPPM = ',I10 ,/,&
+'@ Il a ete depasse. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites. ',/,&
+'@ ',/,&
+'@ Les NBZPPM premieres zones frontieres ',/,&
+'@ portent ici les numeros suivants : ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1002 format(i10)
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: THE BOUNDARY CONDITIONS GIVEN BY THE ',/,&
+'@ ======== ',/,&
+'@ INTERFACE ARE INCOMPLETE OR NON-EXISTANT ',/,&
+'@ ',/,&
+'@ There are ',I10,' faces for which no zone is defined. ',/,&
+'@ ',/,&
+'@ The calulation will run. ',/,&
+'@ ',/,&
+'@ Complete the boundary conditions in the subroutine usclim.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ========= ',/,&
+'@ ARRET DANS LE SOUS-PROGRAMME STDTCL ',/,&
+'@ ',/,&
+'@ The maximum number of boundary zones which can be defined ',/,&
+'@ by the user is NBZPPM = ',I10 ,/,&
+'@ It has been exceeded. ',/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify the boundary conditions. ',/,&
+'@ ',/,&
+'@ The first NBZPPM boundary zones have the following number:',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1002 format(i10)
+
+#endif
+
+!===============================================================================
+! 2. ECHANGES EN PARALLELE POUR LES DONNEES UTILISATEUR
+!===============================================================================
+
+! En realite on pourrait eviter cet echange en modifiant usebuc et en
+! demandant a l'utilisateur de donner les grandeurs dependant de la
+! zone hors de la boucle sur les faces de bord : les grandeurs
+! seraient ainsi disponibles sur tous les processeurs. Cependant,
+! ca rend le sous programme utilisateur un peu plus complique et
+! surtout, si l'utilisateur le modifie de travers, ca ne marche pas.
+! On suppose que toutes les gandeurs fournies sont positives, ce qui
+! permet d'utiliser un max pour que tous les procs les connaissent.
+! Si ce n'est pas le cas, c'est plus complique mais on peut s'en tirer
+! avec un max quand meme.
+
+if (irangp.ge.0) then
+ call parrmx(nozapm, qimp)
+ !==========
+ call parimx(nozapm, iqimp)
+ !==========
+endif
+
+!===============================================================================
+! 3. SI IQIMP = 1 : CORRECTION DES VITESSES (EN NORME) POUR CONTROLER
+! LES DEBITS IMPOSES
+! SI IQIMP = 0 : CALCUL DE QIMP
+
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+
+! --- Debit calcule
+
+do izone = 1,nozfmx
+ qcalc(izone) = 0.d0
+enddo
+do ifac = 1,nfabor
+ izone = iznfbr(ifac)
+ if (izone .gt. 0) then
+ if (iqimp(izone).eq.2) then
+ qcalc(izone) = qcalc(izone) - &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+ else
+ qcalc(izone) = qcalc(izone) - propfb(ifac,ipbrom) * &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+ endif
+ endif
+enddo
+if(irangp.ge.0) then
+ call parrsm(nozapm,qcalc)
+endif
+do izone = 1, nozapm
+ if ( iqimp(izone).eq.0 ) then
+ qimp(izone) = qcalc(izone)
+ endif
+enddo
+
+! --- Correction des vitesses en norme
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzfbr(ii)
+ if (izone .gt. 0) then
+ if ( iqimp(izone).eq.1 .or. iqimp(izone).eq.2) then
+ if(qcalc(izone).lt.epzero) then
+ write(nfecra,2001)izone,iqimp(izone),qcalc(izone)
+ iok = iok + 1
+ endif
+ endif
+ endif
+enddo
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+do ifac = 1, nfabor
+ izone = iznfbr(ifac)
+ if (izone .gt. 0) then
+ if ( iqimp(izone).eq.1 .or. iqimp(izone).eq.2) then
+ qisqc = qimp(izone)/qcalc(izone)
+ rcodcl(ifac,iu(iphas),1) = rcodcl(ifac,iu(iphas),1)*qisqc
+ rcodcl(ifac,iv(iphas),1) = rcodcl(ifac,iv(iphas),1)*qisqc
+ rcodcl(ifac,iw(iphas),1) = rcodcl(ifac,iw(iphas),1)*qisqc
+ endif
+ endif
+enddo
+
+#if defined(_CS_LANG_FR)
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ========= ',/,&
+'@ ARRET DANS LE SOUS-PROGRAMME STDTCL ',/,&
+'@ ',/,&
+'@ Le debit est impose sur la zone IZONE = ', I10 ,/,&
+'@ puisque IQIMP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, le produit RHO D S integre est nul : ',/,&
+'@ il vaut = ',E14.5 ,/,&
+'@ (D est la direction selon laquelle est impose le debit).',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les donnees dans l''interface et en particulier ',/,&
+'@ - que le vecteur RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) qui determine',/,&
+'@ la direction de la vitesse est non nul et n''est pas ',/,&
+'@ uniformement perpendiculaire aux face d''entree ',/,&
+'@ - que la surface de l''entree n''est pas nulle (ou que ',/,&
+'@ le nombre de faces de bord dans la zone est non nul) ',/,&
+'@ - que la masse volumique n''est pas nulle ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: PROBLEM IN THE BOUNDARY CONDITIONS ',/,&
+'@ ======== ',/,&
+'@ ABORT IN THE SUBROUTINE STDTCL ',/,&
+'@ ',/,&
+'@ The flow is imposed on the zone IZONE = ', I10 ,/,&
+'@ since IQIMP(IZONE) = ', I10 ,/,&
+'@ But, on this zone, the integrated product RHO D S is zero:',/,&
+'@ its value is = ',E14.5 ,/,&
+'@ (D is the direction along which is imposed the flow). ',/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify the data in the interface and particularly ',/,&
+'@ - that the vector RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) which gives ',/,&
+'@ the velocity direction is non null and not uniformly ',/,&
+'@ perpendicular to the inlet faces ',/,&
+'@ - that the inlet surface is not zero (or that the number',/,&
+'@ of boundary faces within the zone is not zero) ',/,&
+'@ - that the density is not zero ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!===============================================================================
+! 4. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LA TURBULENCE
+!===============================================================================
+
+
+do ifac = 1, nfabor
+
+ izone = iznfbr(ifac)
+
+ if (izone .gt. 0) then
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique de la turbulence
+
+ if ( icalke(izone).ne.0 ) then
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ + rcodcl(ifac,iv(iphas),1)**2 &
+ + rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,epzero)
+ rhomoy = propfb(ifac,ipbrom)
+ iel = ifabor(ifac)
+ viscla = propce(iel,ipcvis)
+ icke = icalke(izone)
+ dhy = dh(izone)
+ xiturb = xintur(izone)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+ if (icke.eq.1) then
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscla, cmu, xkappa, &
+ ustar2, xkent, xeent )
+ else if (icke.eq.2) then
+ call keenin &
+ !==========
+ ( uref2, xiturb, dhy, cmu, xkappa, xkent, xeent )
+ endif
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/strdep.f90 b/src/base/strdep.f90
new file mode 100644
index 0000000..06f16e1
--- /dev/null
+++ b/src/base/strdep.f90
@@ -0,0 +1,466 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine strdep &
+!================
+
+ ( idbia0 , idbra0 , itrale , italim , itrfin , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nvar , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ flmalf , flmalb , cofale , xprale , depale , rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! DEPLACEMENT DES STRUCTURES MOBILES EN ALE EN COUPLAGE INTERNE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! itrale ! e ! <-- ! numero d'iteration pour l'ale !
+! italim ! e ! <-- ! numero d'iteration couplage implicite !
+! itrfin ! e ! <-- ! indicateur de derniere iteration de !
+! ! ! ! couplage implicite !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! flmalf(nfac) ! tr ! --> ! sauvegarde du flux de masse faces int !
+! flmalb(nfabor ! tr ! --> ! sauvegarde du flux de masse faces brd !
+! cofale ! tr ! --> ! sauvegarde des cl de p et u !
+! (nfabor,8) ! ! ! !
+! xprale(ncelet ! tr ! --> ! sauvegarde de la pression, si nterup !
+! ! ! ! est >1 !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "ihmpre.h"
+include "cstphy.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "pointe.h"
+include "albase.h"
+include "alstru.h"
+include "alaste.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer itrale , italim , itrfin
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr , nvar
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision depale(nnod,3)
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision flmalf(nfac), flmalb(nfabor), xprale(ncelet)
+double precision cofale(nfabor,8)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinra
+integer istr, ii, iel, ifac, iphas, ntab
+integer iflmas, iflmab, iclp, iclu, iclv, iclw
+integer indast
+integer icvext, icvint, icv
+
+double precision delta
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iflmas = ipprof(ifluma(iu(1)))
+iflmab = ipprob(ifluma(iu(1)))
+iclp = iclrtp(ipr(1),icoef)
+iclu = iclrtp(iu(1),icoef)
+iclv = iclrtp(iv(1),icoef)
+iclw = iclrtp(iw(1),icoef)
+
+!===============================================================================
+! 2. CALCUL DES EFFORTS SUR LES STRUCTURES
+!===============================================================================
+
+do istr = 1, nbstru
+ do ii = 1, ndim
+ forsta(ii,istr) = forstr(ii,istr)
+!-a tester FORSTA(II,ISTR) = FORSTP(II,ISTR)
+ forstr(ii,istr) = 0.d0
+ enddo
+enddo
+
+iforas = idebra
+ifinra = iforas + 3*nbfast
+CALL RASIZE('STRDEP',IFINRA)
+!==========
+
+indast = 0
+do ifac = 1, nfabor
+ istr = ia(iidfst+ifac-1)
+ if (istr.gt.0) then
+ do ii = 1, 3
+ forstr(ii,istr) = forstr(ii,istr) &
+ + ra(iforbr+(ifac-1)*ndim+ii-1)
+ enddo
+ else if (istr.lt.0) then
+ indast = indast + 1
+ do ii = 1, 3
+ ra(iforas+(indast-1)*ndim+ii-1) = asddlf(ii,-istr) &
+ * ra(iforbr+(ifac-1)*ndim+ii-1)
+ enddo
+ endif
+enddo
+
+if (irangp.ge.0) then
+ ntab = ndim*nbstru
+ call parrsm(ntab,forstr)
+endif
+
+! Calcul de l'effort envoye au structures internes
+do istr = 1, nbstru
+ do ii = 1, ndim
+ forstp(ii,istr) = cfopre*forstr(ii,istr)+ &
+ (1.d0-cfopre)*forsta(ii,istr)
+ enddo
+enddo
+
+! Envoi de l'effort applique aux structures externes
+if (nbaste.gt.0) then
+ call astfor(ntcast, nbfast, ra(iforas))
+ !==========
+endif
+
+! Si on est en phase d'initialisation du fluide
+if (itrale.le.nalinf) then
+ itrfin = -1
+ return
+endif
+
+!===============================================================================
+! 3. DEFINITION UTILISATEUR DES CARACTERISTIQUES DE LA STRUCTURE
+!===============================================================================
+
+
+if (nbstru.gt.0) then
+
+ ! - Interface Code_Saturne
+ ! ======================
+
+ if (iihmpr.eq.1) then
+
+ call uistr2 &
+ !==========
+ ( xmstru, xcstru, xkstru, &
+ forstr, &
+ dtref, ttcabs, ntcabs )
+
+ endif
+
+ call usstr2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nbstru , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ra(iidfst), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , &
+ xmstru , xcstru , xkstru , xstreq , xstr , xpstr , forstp , &
+ dtstr , &
+ rdevel , rtuser , &
+ ra )
+
+endif
+
+!===============================================================================
+! 4. DEPLACEMENT DES STRUCTURES INTERNES
+!===============================================================================
+
+
+do istr = 1, nbstru
+
+ call newmrk &
+ !==========
+ ( istr , alpnmk , betnmk , gamnmk , &
+ xmstru(1,1,istr), xcstru(1,1,istr), xkstru(1,1,istr), &
+ xstreq(1,istr) , &
+ xstr(1,istr) , xpstr(1,istr) , xppstr(1,istr) , &
+ xsta(1,istr) , xpsta(1,istr) , xppsta(1,istr) , &
+ forstp(1,istr) , forsta(1,istr) , dtstr(istr) )
+
+enddo
+
+!===============================================================================
+! 5. TEST DE CONVERGENCE
+!===============================================================================
+
+icvext = 0
+icvint = 0
+icv = 0
+
+iphas = 1
+
+delta = 0.d0
+do istr = 1, nbstru
+ do ii = 1, 3
+ delta = delta + (xstr(ii,istr)-xstp(ii,istr))**2
+ enddo
+enddo
+if (nbstru.gt.0) then
+ delta = sqrt(delta)/almax(iphas)/nbstru
+ if (delta.lt.epalim) icvint = 1
+endif
+
+if (nbaste.gt.0) call astcv1(ntcast, icvext)
+ !==========
+
+
+if (nbstru.gt.0.and.nbaste.gt.0) then
+ icv = icvext*icvint
+elseif (nbstru.gt.0.and.nbaste.eq.0) then
+ icv = icvint
+elseif (nbaste.gt.0.and.nbstru.eq.0) then
+ icv = icvext
+endif
+
+if (iwarni(iuma).ge.2) write(nfecra,1000) italim, delta
+
+! si convergence
+if (icv.eq.1) then
+ if (itrfin.eq.1) then
+! si ITRFIN=1 on sort
+ if (iwarni(iuma).ge.1) write(nfecra,1001) italim, delta
+ itrfin = -1
+ else
+! sinon on refait une derniere iteration pour SYRTHES/T1D/rayonnement
+! et on remet ICV a 0 pour que Code_Aster refasse une iteration aussi
+ itrfin = 1
+ icv = 0
+ endif
+elseif (itrfin.eq.0 .and. italim.eq.nalimx-1) then
+! ce sera la derniere iteration
+ itrfin = 1
+elseif (italim.eq.nalimx) then
+! on a forcement ITRFIN=1 et on sort
+ if (nalimx.gt.1) write(nfecra,1100) italim, delta
+ itrfin = -1
+! On met ICV a 1 pour que Code_Aster s'arrete lui aussi
+ icv = 1
+endif
+
+! On renvoie l'indicateur de convergence final a Code_Aster
+call astcv2(ntcast, icv)
+!==========
+
+!===============================================================================
+! 6. RETOUR AUX VALEURS ANTERIEURES SI NECESSAIRE
+!===============================================================================
+
+! Si NTERUP .GT.1, RTPA a ete touche apres NAVSTO, on doit donc
+! revenir a une valeur anterieure
+if (itrfin.ne.-1) then
+ do ii = 1, nvar
+ if (ii.eq.ipr(1) .and. nterup.gt.1) then
+ do iel = 1, ncelet
+ rtpa(iel,ii) = xprale(iel)
+ enddo
+ endif
+ do iel = 1, ncelet
+ rtp(iel,ii) = rtpa(iel,ii)
+ enddo
+ enddo
+ do ifac = 1, nfac
+ propfa(ifac,iflmas) = flmalf(ifac)
+ enddo
+ do ifac = 1, nfabor
+ propfb(ifac,iflmab) = flmalb(ifac)
+ coefa(ifac,iclp) = cofale(ifac,1)
+ coefa(ifac,iclu) = cofale(ifac,2)
+ coefa(ifac,iclv) = cofale(ifac,3)
+ coefa(ifac,iclw) = cofale(ifac,4)
+ coefb(ifac,iclp) = cofale(ifac,5)
+ coefb(ifac,iclu) = cofale(ifac,6)
+ coefb(ifac,iclv) = cofale(ifac,7)
+ coefb(ifac,iclw) = cofale(ifac,8)
+ enddo
+endif
+
+!----
+! FORMATS
+!----
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format ( &
+ ' ALE IMPLICITE : ITER=',I5,' DERIVE=',E12.5 )
+ 1001 format ( &
+ 'CONVERGENCE ALE IMPLICITE : ITER=',I5,' DERIVE=',E12.5 )
+ 1100 format ( &
+'@ ',/,&
+'@ @@ ATTENTION : COUPLAGE IMPLICITE ALE ',/,&
+'@ ========= ',/,&
+'@ Nombre d''iterations maximal ',I10 ,' atteint ',/,&
+'@ Derive normee :',E12.5 ,/,&
+'@ ' )
+
+#else
+
+ 1000 format ( &
+ ' IMPLICIT ALE: ITER=',I5,' DERIVE=',E12.5 )
+ 1001 format ( &
+ 'CONVERGENCE IMPLICIT ALE: ITER=',I5,' DERIVE=',E12.5 )
+ 1100 format ( &
+'@ ',/,&
+'@ @@ WARNING: IMPLICIT ALE ',/,&
+'@ ======== ',/,&
+'@ Maximum number of iterations ',I10 ,' reached ',/,&
+'@ Normed derive :',E12.5 ,/,&
+'@ ' )
+
+#endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/strhis.f90 b/src/base/strhis.f90
new file mode 100644
index 0000000..f10fb8d
--- /dev/null
+++ b/src/base/strhis.f90
@@ -0,0 +1,354 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine strhis &
+!================
+
+ ( idbia0 , idbra0 , ncelet , ncel , &
+ nideve , nrdeve , nituse , nrtuse , modhis , &
+ idevel , ituser , ia , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE D'ECRITURE DES HISTORIQUES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! modhis ! e ! <-- ! indicateur valant 0,1 ou 2 !
+! ! ! ! 1,2 = ecriture intermediaire, finale |
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra ! tr ! -- ! tableau des reels !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "optcal.h"
+include "parall.h"
+include "alstru.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0
+integer ncelet, ncel
+integer nideve , nrdeve , nituse , nrtuse
+integer modhis
+integer idevel(nideve), ituser(nituse), ia(*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer nbname
+parameter (nbname=12)
+character nomfic*300, nenvar*300
+character*80 namevr(nbname)
+integer ii, jj, istr, ii1, ii2, lpos, inam1, inam2
+integer nbpdte, jtcabs
+integer idebia, idebra
+double precision xtcabs
+double precision vartmp(nstrmx)
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+! 0. INITIALISATIONS LOCALES
+!===============================================================================
+
+! Seul le processeur 0 ecrit, on n'ecrit rien si pas de structure
+if (irangp.gt.0 .or. nbstru.le.0) return
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+namevr(1 ) = "deplacement x"
+namevr(2 ) = "deplacement y"
+namevr(3 ) = "deplacement z"
+namevr(4 ) = "vitesse x"
+namevr(5 ) = "vitesse y"
+namevr(6 ) = "vitesse z"
+namevr(7 ) = "acceleration x"
+namevr(8 ) = "acceleration y"
+namevr(9 ) = "acceleration z"
+namevr(10) = "force x"
+namevr(11) = "force y"
+namevr(12) = "force z"
+
+!--> Il n'y a pas eu d'historiques
+if(ipass.eq.1.and.modhis.eq.2) return
+
+!===============================================================================
+! 2. OUVERTURE DU FICHIER DE STOCKAGE hist.tmp
+!===============================================================================
+
+if(ipass.eq.1) then
+ NOMFIC = ' '
+ nomfic = emphis
+ call verlon ( nomfic,ii1,ii2,lpos)
+ !==========
+
+ NOMFIC(II2+1:II2+11) = 'histstr.tmp'
+ ii2 = ii2+11
+ open ( unit=impsth(1), file=nomfic (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='UNFORMATTED', &
+ ACCESS='SEQUENTIAL')
+endif
+
+!===============================================================================
+! 3. ECRITURE DES RESULTATS dans le FICHIER DE STOCKAGE
+!===============================================================================
+
+if(modhis.eq.0.or.modhis.eq.1) then
+
+ write(impsth(1)) ntcabs, ttcabs, (xstr (1,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xstr (2,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xstr (3,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xpstr (1,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xpstr (2,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xpstr (3,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xppstr(1,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xppstr(2,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (xppstr(3,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (forstr(1,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (forstr(2,ii),ii=1,nbstru)
+ write(impsth(1)) ntcabs, ttcabs, (forstr(3,ii),ii=1,nbstru)
+
+endif
+
+
+!===============================================================================
+! 4. EN CAS DE SAUVEGARDE INTERMEDIAIRE OU FINALE,
+! TRANSMISSION DES INFORMATIONS DANS LES DIFFERENTS FICHIERS
+!===============================================================================
+
+! On sauve aussi au premier passage pour permettre une
+! verification des le debut du calcul
+
+if(modhis.eq.1.or.modhis.eq.2.or.ipass.eq.1) then
+
+! --> nombre de pas de temps enregistres
+
+ if(modhis.eq.2) then
+ nbpdte = ipass - 1
+ else
+ nbpdte = ipass
+ endif
+
+! --> ecriture un fichier par variable
+ do ii = 1, nbname
+
+! --> nom du fichier
+ NOMFIC = ' '
+ nomfic = emphis
+ call verlon ( nomfic,ii1,ii2,lpos)
+ !==========
+ NENVAR = 'str_'//NAMEVR(II)
+ call verlon(nenvar,inam1,inam2,lpos)
+ !==========
+ call undscr(inam1,inam2,nenvar)
+ !==========
+ nomfic(ii2+1:ii2+lpos) = nenvar(inam1:inam2)
+ ii2 = ii2+lpos
+ NOMFIC(II2+1:II2+1) = '.'
+ ii2 = ii2+1
+ nenvar = exthis
+ call verlon(nenvar,inam1,inam2,lpos)
+ !==========
+ call undscr(inam1,inam2,nenvar)
+ !==========
+ nomfic(ii2+1:ii2+lpos) = nenvar(inam1:inam2)
+ ii2 = ii2+lpos
+! --> ouverture
+ open ( unit=impsth(2), file=nomfic (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL')
+! --> entete
+ write(impsth(2),1000)namevr(ii),nbstru,nbpdte,nbstru+2
+ write(impsth(2),2000) (istr,istr=1,nbstru)
+ write(impsth(2),2005)
+! --> impression des matrices de masse
+ write(impsth(2),2001) ((xmstru(1,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2004) ((xmstru(2,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2004) ((xmstru(3,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2005)
+! --> impression des matrices d'amortissement
+ write(impsth(2),2002) ((xcstru(1,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2004) ((xcstru(2,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2004) ((xcstru(3,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2005)
+! --> impression des matrices de raideur
+ write(impsth(2),2003) ((xkstru(1,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2004) ((xkstru(2,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2004) ((xkstru(3,jj,istr),jj=1,3), &
+ istr=1,nbstru)
+ write(impsth(2),2005)
+! --> impression de fin de section
+ write(impsth(2),2006)
+
+
+! --> boucle sur les differents enregistrements
+! et les variables
+ rewind(impsth(1))
+ do jj = 1, nbpdte
+ do ii1 = 1, nbname
+ read(impsth(1)) &
+ jtcabs, xtcabs, (vartmp(istr),istr=1,nbstru)
+ if(ii1.eq.ii) &
+ write(impsth(2),3000) &
+ jtcabs, xtcabs, (vartmp(istr),istr=1,nbstru)
+ enddo
+ enddo
+
+! --> fermeture fichier
+ close(impsth(2))
+
+ enddo
+
+endif
+
+
+!----
+! FORMATS
+!----
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'# ---------------------------------------------------',/, &
+'# FICHIER HISTORIQUE EN TEMPS ',/, &
+'# VARIABLE ',A30 ,/, &
+'# ---------------------------------------------------',/, &
+'# ',/, &
+'# NOMBRE DE STRUCTURES : ',I8,/, &
+'# ',/, &
+'# NOMBRE D''ENREGISTREMENTS : ',I8,/, &
+'# ',/, &
+'# ',/, &
+'# COLONNE 1 : NUMERO DU PAS DE TEMPS',/, &
+'# 2 : TEMPS PHYSIQUE (ou No pas de temps*DTREF',/,&
+'# en pas de temps non uniforme)',/,&
+'# 3 A ',I4,' : VALEUR POUR CHAQUE STRUCTURE ',/,&
+'# ',/, &
+'# ---------------------------------------------------',/, &
+'# ')
+ 2000 format('# STRUCTURE |',20(21X,I3,22X,'|'))
+ 2001 format('# MASSE |',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2002 format('# AMORTISSEMENT|',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2003 format('# RAIDEUR |',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2004 format('# |',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2005 format('#')
+ 2006 format( &
+'# (dans le cas ou les caracteristiques des structures sont ',/,&
+'# variables, les valeurs ci-dessus correspondent au dernier ',/,&
+'# pas de temps d''ecriture dans le fichier',/, &
+'#',/, &
+'# ---------------------------------------------------',/, &
+'# ')
+ 3000 format ( 1x,i7,1x,21(1x,e14.7))
+
+#else
+
+ 1000 format ( &
+'# ---------------------------------------------------',/, &
+'# TIME MONITORING FILE ',/, &
+'# VARIABLE ',A30 ,/, &
+'# ---------------------------------------------------',/, &
+'# ',/, &
+'# NUMBER OF STRUCTURES : ',I8,/, &
+'# ',/, &
+'# NUMBER OF RECORDS : ',I8,/, &
+'# ',/, &
+'# ',/, &
+'# COLUMN 1 : TIME STEP NUMBER ',/, &
+'# 2 : PHYSICAL TIME (or Nb of time steps*DTREF ',/,&
+'# with non uniform time step)',/, &
+'# 3 TO ',I4,' : VALUE FOR EACH STRUCTURE ',/,&
+'# ',/, &
+'# ---------------------------------------------------',/, &
+'# ')
+ 2000 format('# STRUCTURE |',20(21X,I3,22X,'|'))
+ 2001 format('# MASS |',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2002 format('# DAMPING |',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2003 format('# STIFNESS |',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2004 format('# |',20(1X,G14.7,1X,G14.7,1X,G14.7,' |'))
+ 2005 format('#')
+ 2006 format( &
+'# (in the case where the structures characteristics are ',/,&
+'# variables, these values correspond to the latest time step',/,&
+'# written in the file',/, &
+'#',/, &
+'# ---------------------------------------------------',/, &
+'# ')
+ 3000 format ( 1x,i7,1x,21(1x,e14.7))
+
+#endif
+
+return
+end
+
+
diff --git a/src/base/strini.f90 b/src/base/strini.f90
new file mode 100644
index 0000000..a84c9d6
--- /dev/null
+++ b/src/base/strini.f90
@@ -0,0 +1,771 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine strini &
+!================
+
+ ( idbia0 , idbra0 , ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! INITILISATION DES DONNEES DES STRUCTURES MOBILES EN ALE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+include "albase.h"
+include "alstru.h"
+include "alaste.h"
+include "ihmpre.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , ifinia , ifinra
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, itrav
+integer ifac , istr, icompt, ii
+integer mbstru, mbaste
+integer maxelt, ifnia2, ils
+
+integer jj, inod
+integer ilstfa, indast, iidflo, iidnlo
+integer nbpdt, nbssit, ihi, chro
+
+double precision delta, pdt, tt
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+do istr = 1, nstrmx
+ dtstr(istr) = dt(1)
+enddo
+
+do istr = 1, nastmx
+ do ii = 1, 3
+ asddlf(ii,istr) = 1
+ asddlc(ii,istr) = 1
+ enddo
+enddo
+
+! NBSTRU et NBASTE valent -999 si le calcul n'est pas un calcul
+! suite ou s'il est une suite d'un calcul sans ALE
+mbstru = nbstru
+mbaste = nbaste
+
+! En ALE on met IHISTR et ISYNCP a 1 par defaut
+! (remis a zero sans structure)
+ihistr = 1
+isyncp = 1
+
+!===============================================================================
+! 2. RESERVATION DU TABLEAU IDFSTR
+!===============================================================================
+
+iidfst = idebia
+ifinia = iidfst + nfabor
+
+maxelt = max(ncelet,nfac,nfabor)
+ils = ifinia
+ifnia2 = ils + maxelt
+
+CALL IASIZE('STRINI',IFNIA2)
+!==========
+
+do ifac = 1, nfabor
+ ia(iidfst+ifac-1) = 0
+enddo
+
+
+!===============================================================================
+! 2. REMPLISSAGE DE IDFSTR PAR L'UTILISATEUR
+!===============================================================================
+
+! 2.1 STRUCTURES INTERNES :
+! -----------------------
+
+if (iihmpr.eq.1) then
+
+ call uistr1 &
+ !==========
+( nfabor, &
+ ia(iidfst), &
+ aexxst, bexxst, cfopre, &
+ ihistr, &
+ xstp, xstreq, xpstr )
+
+endif
+
+call usstr1 &
+!==========
+ ( ifnia2 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iidfst), &
+ idevel , ituser , ia , &
+ aexxst , bexxst , cfopre , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ xstp , xpstr , xstreq , &
+ rdevel , rtuser , ra )
+
+! 2.2 STRUCTURES EXTERNES : COUPLAGE CODE_SATURNE / CODE_ASTER
+! -----------------------
+
+call usaste &
+!==========
+ ( ifnia2 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iidfst), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 3. CALCUL DE NBSTRU ET NBASTE
+!===============================================================================
+
+! 3.1 STRUCTURES INTERNES :
+! -----------------------
+
+nbstru = 0
+do ifac = 1, nfabor
+ if (ia(iidfst+ifac-1).gt.nbstru) nbstru = ia(iidfst+ifac-1)
+enddo
+
+if (irangp.ge.0) call parcmx(nbstru)
+ !==========
+
+if (nbstru.gt.nstrmx) then
+ write(nfecra,4000)
+ call csexit(1)
+endif
+
+! On compare NBSTRU a la valeur eventuelle anterieure
+
+if (mbstru.gt.-999) then
+ if (nbstru.ne.mbstru) then
+ write(nfecra,4001)mbstru,nbstru
+ call csexit(1)
+ endif
+endif
+
+! 3.2 STRUCTURES EXTERNES : COUPLAGE CODE_SATURNE / CODE_ASTER
+! -----------------------
+
+nbaste = 0
+do ifac = 1, nfabor
+ if (-ia(iidfst+ifac-1).gt.nbaste) nbaste = -ia(iidfst+ifac-1)
+enddo
+
+if (irangp.ge.0) call parcmx(nbaste)
+ !==========
+
+if (nbaste.gt.nastmx) then
+ write(nfecra,4002)
+ call csexit(1)
+endif
+
+! On compare NBASTE a la valeur eventuelle anterieure
+
+if (mbaste.gt.-999) then
+ if (nbaste.ne.mbaste) then
+ write(nfecra,4003)mbaste,nbaste
+ call csexit(1)
+ endif
+endif
+
+
+!===============================================================================
+! 5. CALCUL ET ENVOI A CODE_ASTER DES PARAMETRES GEOMETRIQUES
+!===============================================================================
+
+if (nbaste.gt.0) then
+
+ itrav = ifinia
+ ifnia2 = itrav + nnod
+ CALL IASIZE('STRINI',IFNIA2)
+
+ do inod = 1, nnod
+ ia(itrav + inod-1) = 0
+ enddo
+
+ nbfast = 0
+ nbnast = 0
+
+! Calcul du nombre de faces et noeuds couples avec Code_Aster
+ do ifac = 1, nfabor
+ istr = ia(iidfst+ifac-1)
+ if (istr.lt.0) then
+ nbfast = nbfast + 1
+ do ii = ipnfbr(ifac), ipnfbr(ifac+1)-1
+ inod = nodfbr(ii)
+ ia(itrav + inod-1) = istr
+ enddo
+ endif
+ enddo
+ do inod = 1, nnod
+ if (ia(itrav+inod-1).gt.0) nbnast = nbnast + 1
+ enddo
+
+ ilstfa = ifinia
+ iidflo = ilstfa + nbfast
+ iidnlo = iidflo + nbfast
+ ifnia2 = iidnlo + nbnast
+ CALL IASIZE('STRINI',IFNIA2)
+
+ indast = 0
+ do ifac = 1, nfabor
+ istr = ia(iidfst+ifac-1)
+ if (istr.lt.0) then
+ indast = indast + 1
+ ia(ilstfa + indast-1) = ifac
+ ia(iidflo + indast-1) = -istr
+ endif
+ enddo
+ nbfast = indast
+
+ indast = 0
+ do inod = 1, nnod
+ istr = ia(itrav+inod-1)
+ if (istr.lt.0) then
+ indast = indast + 1
+ ia(iidnlo + indast-1) = -istr
+ endif
+ enddo
+ nbnast = indast
+
+! Recuperation des parametres commun du couplage
+ call astpar &
+ !==========
+ ( ntmabs, nalimx, epalim, isyncp, ntchr, ttpabs, dtref )
+
+! Envoi des donnees geometriques a Code_Aster
+ call astgeo &
+ !==========
+ ( nbfast, nbnast, ia(ilstfa), ia(iidflo), ia(iidnlo), almax )
+
+endif
+
+
+!===============================================================================
+! 6. MESSAGES D'INFORMATION SUR LE COUPLAGE
+!===============================================================================
+
+! Valeur par defaut et verifiction de IHISTR
+if (nbstru.eq.0) ihistr = 0
+if (nbaste.eq.0) isyncp = 0
+
+icompt = 0
+do ii = 2, nvppmx
+ if(ihisvr(ii,1).ne.0) icompt = icompt+1
+enddo
+if( (icompt.eq.0.or.ncapt.eq.0) .and. ihistr.eq.0 ) then
+ nthist = -1
+endif
+
+if (ihistr.ne.0 .and. ihistr.ne.1) then
+ write(nfecra,1000)ihistr
+ call csexit(1)
+endif
+if (isyncp.ne.0 .and. isyncp.ne.1) then
+ write(nfecra,1002)isyncp
+ call csexit(1)
+endif
+
+! Si NBSTRU=0 et NBASTE=0, on desalloue IDFSTR et on passe NALIMX a 1
+! si necessaire
+if (nbstru.gt.0) then
+ write(nfecra,2010) nbstru,alpnmk,betnmk,gamnmk,ihistr
+else
+ write(nfecra,2000) nbstru
+endif
+if (nbaste.gt.0) then
+ write(nfecra,2012) nbaste,isyncp
+else
+ write(nfecra,2002) nbaste
+endif
+if (nbstru.eq.0.and.nbaste.eq.0) then
+ ifinia = idebia
+ ifinra = idebra
+ if (nalimx.gt.1) then
+ write(nfecra,2001)
+ nalimx = 1
+ endif
+else if (nbstru.gt.0) then
+ if (nalimx.eq.1) then
+ write(nfecra,2020) aexxst, bexxst, cfopre
+ else
+ cfopre = 1.d0
+ write(nfecra,2030) nalimx, epalim
+ endif
+endif
+write(nfecra,3000)
+
+!----
+! FORMATS
+!----
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR D''ECRITURE DES FICHIERS HISTORIQUES DES ',/,&
+'@ STRUCTURES MOBILES NE PEUT VALOIR QUE 0 OU 1. ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes dans usstru. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR D''ECRITURE AU MEME INSTANT DES SORTIES ',/,&
+'@ CODE_SATURNE ET CODE_ASTER NE PEUT VALOIR QUE 0 OU 1. ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ LA PERIODE D''IMPRESSION EST DEFINIE PAR LA VARIABLE : ',/,&
+'@ NTCHR ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes dans usstru. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+ /,'TTES PHASES : MODE COUPLAGE DE STRUCTURES NON ACTIVE ',/,&
+ ' NBSTRU = ',I10 ,/)
+ 2001 format( &
+ ' NALIMX INUTILE ET POSITIONNE A 1 ',/)
+ 2002 format( &
+ /,'TTES PHASES : MODE COUPLAGE CODE_ASTER NON ACTIVE ',/,&
+ ' NBASTE = ',I10 ,/)
+ 2010 format( &
+ /,'TTES PHASES : MODE COUPLAGE DE STRUCTURES ACTIVE ',/,&
+ ' AVEC NBSTRU = ',I10 ,' STRUCTURE(S) ',/,&
+ ' ',/,&
+ ' COEFFICIENTS DE NEWMARK : ',/,&
+ ' ALPNMK = ',E12.4 ,/,&
+ ' BETNMK = ',E12.4 ,/,&
+ ' GAMNMK = ',E12.4 ,/,&
+ ' ',/,&
+ ' FICHIERS HISTORIQUES DES STRUCTURES : ',/,&
+ ' IHISTR = ',I4,' ( 1 : active) ',/)
+ 2012 format( &
+ /,'TTES PHASES : MODE COUPLAGE CODE_ASTER ACTIVE ',/,&
+ ' AVEC NBASTE = ',I10 ,' STRUCTURE(S) ',/,&
+ ' ',/,&
+ ' IMPRESSIONS DES SORTIES AUX MEMES ',/,&
+ ' INSTANTS DES DEUX CODES : ',/,&
+ ' ISYNCP = ',I4,' ( 1 : active) ',/)
+ 2020 format( &
+ /,'TTES PHASES : SCHEMA DE COUPLAGE EXPLICITE ACTIVE ',/,&
+ ' ',/,&
+ ' COEFFICIENTS DU SCHEMA : ',/,&
+ ' AEXXST = ',E12.4 ,/,&
+ ' BEXXST = ',E12.4 ,/,&
+ ' CFOPRE = ',E12.4 ,/)
+ 2030 format( &
+ /,'TTES PHASES : SCHEMA DE COUPLAGE IMPLICITE ACTIVE ',/,&
+ ' ',/,&
+ ' NB DE SOUS-ITERATIONS MAX. : ',I10 ,/,&
+ ' SEUIL DE CONVERGENCE : ',E12.4 ,/)
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA DEFINITION DES STRUCTURES ',/,&
+'@ INTERNES ',/,&
+'@ ',/,&
+'@ Le nombre de structures definies est superieur au nombre',/,&
+'@ maximum autorise NSTRMX : ',/,&
+'@ Nombre de structures definies : ',I10 ,/,&
+'@ Nombre de structures autorisees : ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Reduire le nombre de structure ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA DEFINITION DES STRUCTURES MOBILES',/,&
+'@ INTERNES ',/,&
+'@ ',/,&
+'@ Le nombre de structures internes definies est ',/,&
+'@ different de celui du calcul precedent : ',/,&
+'@ Nombre de structures calcul precedent : ',I10 ,/,&
+'@ Nombre de structures calcul actuel : ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire ou la specification',/,&
+'@ des structures dans usstru. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA DEFINITION DES STRUCTURES ',/,&
+'@ EXTERNES (COUPLAGE CODE_ASTER)',/,&
+'@ ',/,&
+'@ Le nombre de structures definies est superieur au nombre',/,&
+'@ maximum autorise NASTMX : ',/,&
+'@ Nombre de structures definies : ',I10 ,/,&
+'@ Nombre de structures autorisees : ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Reduire le nombre de structure ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA DEFINITION DES STRUCTURES MOBILES',/,&
+'@ EXTERNES (COUPLAGE CODE_ASTER)',/,&
+'@ ',/,&
+'@ Le nombre de structures externes definies est ',/,&
+'@ different de celui du calcul precedent : ',/,&
+'@ Nombre de structures calcul precedent : ',I10 ,/,&
+'@ Nombre de structures calcul actuel : ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire ou la specification',/,&
+'@ des structures dans usaste. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE TIME MONITORING FILES INDICATOR FOR THE MOBILE ',/,&
+'@ STRUCTURES CAN ONLY TAKE THE VALUES 0 OR 1. ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given in usstru. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE INDICATOR OF SYNCHRONIZED OUTPUTS FOR CODE_SATURNE ',/,&
+'@ AND CODE_ASTER CAN ONLY TAKE THE VALUES 0 OR 1. ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given in usstru. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+ /,'ALL PHASES: COUPLING MODE FOR STRUCTURES NOT ACTIVATED ',/,&
+ ' NBSTRU = ',I10 ,/)
+ 2001 format( &
+ ' NALIMX USELESS AND SET TO 1 ',/)
+ 2002 format( &
+ /,'ALL PHASES: CODE_ASTER COUPLING MODE NOT ACTIVATED ',/,&
+ ' NBASTE = ',I10 ,/)
+ 2010 format( &
+ /,'ALL PHASES: COUPLING MODE FOR STRUCTURES ACTIVATED ',/,&
+ ' WITH NBSTRU = ',I10 ,' STRUCTURE(S) ',/,&
+ ' ',/,&
+ ' NEWMARK COEFFICIENTS: ',/,&
+ ' ALPNMK = ',E12.4 ,/,&
+ ' BETNMK = ',E12.4 ,/,&
+ ' GAMNMK = ',E12.4 ,/,&
+ ' ',/,&
+ ' MONITORING FILES FOR STRUCTURES: ',/,&
+ ' IHISTR = ',I4,' ( 1 : activated) ',/)
+ 2012 format( &
+ /,'ALL PHASES: CPDE_ASTER COUPLING MODE ACTIVATED ',/,&
+ ' WITH NBASTE = ',I10 ,' STRUCTURE(S) ',/,&
+ ' ',/,&
+ ' SYNCHRONIZED OUTPUTS FOR BOTH CODES: ',/,&
+ ' ISYNCP = ',I4,' ( 1 : activated) ',/)
+ 2020 format( &
+ /,'ALL PHASES: EXPLICIT SCHEME FOR COUPLING ACTIVATED ',/,&
+ ' ',/,&
+ ' SCHEME COEFFICIENTS: ',/,&
+ ' AEXXST = ',E12.4 ,/,&
+ ' BEXXST = ',E12.4 ,/,&
+ ' CFOPRE = ',E12.4 ,/)
+ 2030 format( &
+ /,'ALL PHASES: IMPLICIT SCHEME FOR COUPING ACTIVATED ',/,&
+ ' ',/,&
+ ' NB OF MAX INNER ITERATIONS : ',I10 ,/,&
+ ' CONVERGENCE THRESHOLD : ',E12.4 ,/)
+
+ 3000 format( &
+'-------------------------------------------------------------',/)
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE INTERNAL STRUCTURES SPECIFICATION ',/,&
+'@ ',/,&
+'@ The number of defined structures is greater than the ',/,&
+'@ allowed maximum NSTRMX: ',/,&
+'@ Number of defined structures: ',I10 ,/,&
+'@ Number of allowed structures: ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Decrease the number of structures ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE INTERNAL MOBILE STRUCTURES ',/,&
+'@ SPECIFICATION ',/,&
+'@ ',/,&
+'@ The number of defined structures is different from the ',/,&
+'@ previous calculation: ',/,&
+'@ Number of structures previous calculation: ',I10 ,/,&
+'@ Number of structures current calculation: ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the auxilliary restart file or the structures ',/,&
+'@ specifications in usstru. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE EXTERNAL MOBILE STRUCTURES ',/,&
+'@ SPECIFICATION (CODE_ASTER COUPLING) ',/,&
+'@ ',/,&
+'@ The number of defined structures is greater than the ',/,&
+'@ allowed maximum NASTMX: ',/,&
+'@ Number of defined structures: ',I10 ,/,&
+'@ Number of allowed structures: ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Decrease the number of structures ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE EXTERNAL MOBILE STRUCTURES ',/,&
+'@ SPECIFICATION (CODE_ASTER COUPLING) ',/,&
+'@ ',/,&
+'@ The number of defined structures is different from the ',/,&
+'@ previous calculation: ',/,&
+'@ Number of structures previous calculation: ',I10 ,/,&
+'@ Number of structures current calculation: ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the auxilliary restart file or the structures ',/,&
+'@ specifications in usstru. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/strpre.f90 b/src/base/strpre.f90
new file mode 100644
index 0000000..5bb1b79
--- /dev/null
+++ b/src/base/strpre.f90
@@ -0,0 +1,374 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine strpre &
+!================
+
+ ( idbia0 , idbra0 , itrale , italim , ineefl , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ impale , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ flmalf , flmalb , xprale , cofale , depale , rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! PREDICTION DU DEPLACEMENT DES STRUCTURES EN ALE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! itrale ! e ! <-- ! numero d'iteration pour l'ale !
+! italim ! e ! <-- ! numero d'iteration couplage implicite !
+! ineedf ! e ! <-- ! indicateur de sauvegarde des flux !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! flmalf(nfac) ! tr ! --> ! sauvegarde du flux de masse faces int !
+! flmalb(nfabor ! tr ! --> ! sauvegarde du flux de masse faces brd !
+! cofale ! tr ! --> ! sauvegarde des cl de p et u !
+! (nfabor,8) ! ! ! !
+! xprale(ncelet ! tr ! --> ! sauvegarde de la pression, si nterup !
+! ! ! ! est >1 !
+! depale(nnod,3 ! tr ! <-- ! deplacement aux noeuds !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "optcal.h"
+include "numvar.h"
+include "pointe.h"
+include "albase.h"
+include "alstru.h"
+include "alaste.h"
+include "period.h"
+include "parall.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , itrale , italim , ineefl
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer impale(nnod)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision flmalf(nfac), flmalb(nfabor), xprale(ncelet)
+double precision cofale(nfabor,8)
+double precision depale(nnod,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer istr, ii, ifac, inod, iel, indast
+integer iflmas, iflmab,iclp,iclu,iclv,iclw
+integer ilstfa
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iflmas = ipprof(ifluma(iu(1)))
+iflmab = ipprob(ifluma(iu(1)))
+iclp = iclrtp(ipr(1),icoef)
+iclu = iclrtp(iu(1),icoef)
+iclv = iclrtp(iv(1),icoef)
+iclw = iclrtp(iw(1),icoef)
+
+!===============================================================================
+! 2. PREDICTION DU DEPLACEMENT DES STRUCTURES
+!===============================================================================
+
+! 2.1 STRUCTURES INTERNES :
+! -----------------------
+
+! Lors de la phase d'initialisation de l'ALE (ITRALE=0), XSTP contient
+! - la valeur du deplacement initial des structures si l'utilisateur
+! les a touchees (suite ou pas)
+! - 0 si debut de calcul avec les structures
+! - le deplacement utilise pour le calcul precedent si suite sans
+! modification utilisateur
+! Il faut cependant transferer sa valeur dans XSTR (qui est utilise
+! par Newmark)
+! Lors des iterations suivantes (ITRALE>0) on utilise les schemas standard
+! de calcul de XSTP
+
+if (nbstru.gt.0) then
+
+ if (itrale.eq.0) then
+
+ do istr = 1, nbstru
+ do ii = 1, ndim
+ xstr(ii,istr) = xstp(ii,istr)
+ enddo
+ enddo
+
+ else
+
+! 2.1.1 : SCHEMA DE COUPLAGE EXPLICITE
+!---------------------------------------------
+ if (nalimx.eq.1) then
+ do istr = 1, nbstru
+ do ii = 1, 3
+ xstp(ii,istr) = xstr(ii,istr) &
+ + aexxst*dtstr(istr)*xpstr(ii,istr) &
+ + bexxst*dtstr(istr)*(xpstr(ii,istr)-xpsta(ii,istr))
+ enddo
+ enddo
+
+! 2.1.2 : SCHEMA DE COUPLAGE IMPLICITE
+!---------------------------------------------
+ else
+ do istr = 1, nbstru
+ do ii = 1, 3
+ xstp(ii,istr) = xstr(ii,istr)
+ enddo
+ enddo
+ endif
+
+ endif
+
+ do ifac = 1, nfabor
+ istr = ia(iidfst+ifac-1)
+ if (istr.gt.0) then
+ do ii = ipnfbr(ifac), ipnfbr(ifac+1)-1
+ inod = nodfbr(ii)
+ impale(inod) = 1
+ depale(inod,1) = xstp(1,istr)
+ depale(inod,2) = xstp(2,istr)
+ depale(inod,3) = xstp(3,istr)
+ enddo
+ endif
+ enddo
+
+endif
+
+
+! 2.2 STRUCTURES EXTERNES (COUPLAGE CODE_ASTER) :
+! -----------------------
+
+
+if (nbaste.gt.0) then
+
+ do ifac = 1, nfabor
+ istr = ia(iidfst+ifac-1)
+ if (istr.lt.0) then
+ do ii = ipnfbr(ifac), ipnfbr(ifac+1)-1
+ inod = nodfbr(ii)
+ impale(inod) = 1
+ enddo
+ endif
+ enddo
+
+! Si ITRALE = 0, on ne fait rien pour l'instant, mais il faudrait
+! prevoir la reception de deplacement initiaux venant de Code_Aster
+ if (itrale.gt.0) then
+
+ ntcast = ntcast + 1
+
+! Reception des deplacements predits et remplissage de depale
+
+ ilstfa = idebia
+ ifinia = ilstfa + nbfast
+ CALL IASIZE('STRPRE',IFINIA)
+
+ indast = 0
+ do ifac = 1, nfabor
+ istr = ia(iidfst+ifac-1)
+ if (istr.lt.0) then
+ indast = indast + 1
+ ia(ilstfa + indast-1) = ifac
+ endif
+ enddo
+
+ call astcin(ntcast, nbfast, ia(ilstfa), depale)
+ !==========
+
+ endif
+
+endif
+
+!===============================================================================
+! 3. DEPLACEMENT AU PAS DE TEMPS PRECEDENT ET SAUVEGARDE FLUX ET DE P
+!===============================================================================
+
+if (italim.eq.1) then
+ do istr = 1, nbstru
+ do ii = 1, 3
+ xsta(ii,istr) = xstr(ii,istr)
+ xpsta(ii,istr) = xpstr(ii,istr)
+ xppsta(ii,istr) = xppstr(ii,istr)
+ enddo
+ enddo
+ if (ineefl.eq.1) then
+ do ifac = 1, nfac
+ flmalf(ifac) = propfa(ifac,iflmas)
+ enddo
+ do ifac = 1, nfabor
+ flmalb(ifac) = propfb(ifac,iflmab)
+ cofale(ifac,1) = coefa(ifac,iclp)
+ cofale(ifac,2) = coefa(ifac,iclu)
+ cofale(ifac,3) = coefa(ifac,iclv)
+ cofale(ifac,4) = coefa(ifac,iclw)
+ cofale(ifac,5) = coefb(ifac,iclp)
+ cofale(ifac,6) = coefb(ifac,iclu)
+ cofale(ifac,7) = coefb(ifac,iclv)
+ cofale(ifac,8) = coefb(ifac,iclw)
+ enddo
+ if (nterup.gt.1) then
+ do iel = 1, ncelet
+ xprale(iel) = rtpa(iel,ipr(1))
+ enddo
+ endif
+ endif
+endif
+
+!----
+! FORMATS
+!----
+
+
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/base/tcpumx.c b/src/base/tcpumx.c
new file mode 100644
index 0000000..400e812
--- /dev/null
+++ b/src/base/tcpumx.c
@@ -0,0 +1,118 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Query time allocated to this process (useful mainly under PBS)
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+#undef _POSIX_SOURCE /* Otherwise compilation problem on VPP 5000 */
+#undef _XOPEN_SOURCE /* Otherwise, compilation problem on SunOS */
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "tcpumx.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Query CPU time allocated to this process
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TCPUMX (TPS , RET)
+ * *****************
+ *
+ * DOUBLE PRECISION TPS : <-- : remaining time (default: 7 days)
+ * INTEGER RET : <-- : return code:
+ * : : -1: error
+ * : : 0: no limit using this method
+ * : : 1: CPU limit determined
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tcpumx, TCPUMX) (double *tps,
+ int *ret)
+
+{
+ char * cs_maxtime;
+ int hrs, min, sec;
+ int nchamps = 0;
+
+ *tps = 3600.0 * 24.0 * 7; /* "unlimited" values by default */
+ *ret = 0;
+
+ /* Get environment variable; for example, 100:10:10 */
+
+ if ((cs_maxtime = getenv("CS_MAXTIME")) != NULL) {;
+
+ nchamps = sscanf (cs_maxtime,"%d:%d:%d",&hrs,&min,&sec);
+
+ /* If we only have 2 fields, they are hours and minutes (under PBS);
+ * otherwise, if we do not have 3 fields, the information is unusable */
+
+ if (nchamps == 2) {
+ sec = 0;
+ nchamps = 3;
+ }
+
+ /* Compute allocated CPU time in seconds */
+ if (nchamps == 3) {
+ *tps = ((double)hrs)*3600. + ((double)min)*60. + ((double)sec);
+ *ret = 1;
+#if 0
+ printf("tcpumx nchamps = %d,hrs = %d, min = %d, sec = %d\n tps = %f\n",
+ ret, hrs, min, sec, *tps);
+#endif
+ }
+ else
+ *ret = -1;
+
+ }
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/tdesi1.f90 b/src/base/tdesi1.f90
new file mode 100644
index 0000000..7b9204c
--- /dev/null
+++ b/src/base/tdesi1.f90
@@ -0,0 +1,131 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine tdesi1 &
+!================
+
+ ( jj , nfabor , nn , ifabor , iclass )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! SOUS-PROGRAMME DE DESCENTE D'UN ARBRE BINAIRE POUR
+! L'ALGORITHME DE TRI PAR ARBRE (HEAPSORT)
+
+! VERSION 2D
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! jj ! e ! <-- ! niveau de l'arbre binaire traite !
+! nn ! e ! <-- ! nombre de faces actives !
+! nfabor ! e ! <-- ! taille du tableau a descendre !
+! iclass ! e ! <-- ! pointeurs sur les numeros d'elements !
+! ! ! ! dans l'arbre binaire !
+! ifabor ! tr ! <-- ! voisins des faces !
+! ( nfabor) ! ! ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer jj, nn, nfabor
+
+integer iclass(nfabor)
+integer ifabor(nfabor)
+
+! VARAIBLES LOCALES
+
+integer ii, ll, isvnum
+logical desc, isup
+
+!===============================================================================
+
+ii = jj
+ll = 2*jj
+
+desc = .true.
+
+if ((ll.gt.nn).or.(.not. desc)) goto 20
+
+ 10 continue
+
+ if (ll .lt. nn) then
+
+!---> ISUP = .TRUE. SI ICLASS (LL) > ICLASS (LL+1)
+
+ isup = .true.
+ if ( ifabor (iclass (ll+1)) .gt. &
+ ifabor (iclass (ll)) ) then
+ isup = .false.
+ endif
+
+ if (isup) ll = ll + 1
+
+ endif
+
+!---> ISUP = .TRUE. SI ICLASS (II) > ICLASS (LL)
+
+ isup = .true.
+ if ( ifabor (iclass (ll)) .gt. &
+ ifabor (iclass (ii)) ) then
+ isup = .false.
+ endif
+
+ if (isup) then
+ isvnum = iclass (ii)
+ iclass (ii) = iclass (ll)
+ iclass (ll) = isvnum
+ ii = ll
+ ll = 2*ll
+ desc = .true.
+ else
+ desc = .false.
+ endif
+
+ if ((ll .le. nn) .and. desc) goto 10
+
+ 20 continue
+
+return
+end
diff --git a/src/base/testel.f90 b/src/base/testel.f90
new file mode 100644
index 0000000..d8e891b
--- /dev/null
+++ b/src/base/testel.f90
@@ -0,0 +1,533 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine testel &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , nvar , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , &
+ coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "albase.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr , nphas , nvar
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtp(ncelet,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia, ifinra
+integer ifac , iel , ivar , iphas
+integer inc , iccocg, iphydp
+integer iuiph , iviph , iwiph
+integer nswrgp, imligp, iwarnp
+integer ipclip
+integer iw1 , iw2 , iw3
+integer indwri, indact, ipart, idimt, ientla, ivarpr
+
+double precision epsrgp, climgp, extrap
+double precision xx, yy, zz
+double precision rbid(1)
+
+character*32 namevr
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+ifinia = idbia0
+
+! On positionne l'indicateur ALE a 1 de maniere a forcer le recalcul
+! de la contribution des cellules de bord a chaque appel de GRDCEL
+iale = 1
+
+iw1 = idbra0
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+ifinra = iw3 + ncelet
+
+CALL RASIZE('TESTEL',IFINRA)
+!==========
+
+!===============================================================================
+! 1. FONCTION ANALYTIQUE SIN(X+2Y+3Z)
+!===============================================================================
+
+iphas = 1
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+ivar = ipr(iphas)
+ipclip = iclrtp(ivar,icoef)
+
+do iel = 1, ncelet
+ xx = xyzcen(1,iel)
+ yy = xyzcen(2,iel)
+ zz = xyzcen(3,iel)
+ rtp(iel,ivar) = sin(xx+2.d0*yy+3.d0*zz)
+enddo
+
+do ifac = 1, nfabor
+ xx = cdgfbo(1,ifac)
+ yy = cdgfbo(2,ifac)
+ zz = cdgfbo(3,ifac)
+ coefa(ifac,ipclip) = sin(xx+2.d0*yy+3.d0*zz)
+enddo
+
+do ifac = 1, nfabor
+ coefb(ifac,ipclip) = 0.d0
+enddo
+
+! On active le writer standard
+
+indwri = -1
+indact = 1
+call pstact(indwri, indact)
+!==========
+
+! Options de sorties des variables (gradient non entrelaces)
+
+ipart = -1
+idimt = 3
+ientla = 0
+ivarpr = 1
+
+!===============================================================================
+! 2. CALCUL DU GRADIENT DE LA FONCTION ANALYTIQUE
+
+! NE PAS CHANGER L'ORDRE DE CALCUL DES GRADIENTS:
+! * IMRGRA = 0
+! * IMRGRA = 1 (voisinage standard)
+! * IMRGRA = 2 (voisinage etendu)
+! * IMRGRA = 4 (voisinage etendu)
+! * IMRGRA = 3 (reduction du voisinage etendu)
+!===============================================================================
+
+inc = 1
+iccocg = 1
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+iwarnp = iwarni(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+iphydp = 0
+
+! 2.1 APPEL A GRDCEL AVEC IMRGRA = 0
+! ==================================
+
+imrgra = 0
+imligp = -1
+
+call grdcel &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(iw1), ra(iw1), ra(iw1), &
+ rtp(1,ivar) , coefa(1,ipclip) , coefb(1,ipclip) , &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ ra(iw1), ra(iw2), ra(iw3), &
+ rdevel , rtuser , ra )
+
+! On sort le gradient
+
+NAMEVR = 'Grad_RC'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+! Calcul de l'erreur absolue
+
+do iel = 1, ncelet
+ xx = xyzcen(1,iel)
+ yy = xyzcen(2,iel)
+ zz = xyzcen(3,iel)
+ rtp(iel,iuiph) = rtp(iel,iuiph)- cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iviph) = rtp(iel,iviph)-2.d0*cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iwiph) = rtp(iel,iwiph)-3.d0*cos(xx+2.d0*yy+3.d0*zz)
+enddo
+
+! On sort l'erreur
+
+NAMEVR = 'Err_Grad_RC'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+
+! 2.2 APPEL A GRDCEL AVEC IMRGRA = 1
+! ==================================
+
+imrgra = 1
+imligp = 1
+
+call grdcel &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(iw1), ra(iw1), ra(iw1), &
+ rtp(1,ivar) , coefa(1,ipclip) , coefb(1,ipclip) , &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ ra(iw1), ra(iw2), ra(iw3), &
+ rdevel , rtuser , ra )
+
+
+! On sort le gradient
+
+NAMEVR = 'Grad_LSQ'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+! Calcul de l'erreur absolue
+
+do iel = 1, ncelet
+ xx = xyzcen(1,iel)
+ yy = xyzcen(2,iel)
+ zz = xyzcen(3,iel)
+ rtp(iel,iuiph) = rtp(iel,iuiph)- cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iviph) = rtp(iel,iviph)-2.d0*cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iwiph) = rtp(iel,iwiph)-3.d0*cos(xx+2.d0*yy+3.d0*zz)
+enddo
+
+! On sort l'erreur
+
+NAMEVR = 'Err_Grad_LSQ'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+
+! 2.3 APPEL A GRDCEL AVEC IMRGRA = 2
+! ==================================
+
+imrgra = 2
+imligp = 1
+
+call grdcel &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(iw1), ra(iw1), ra(iw1), &
+ rtp(1,ivar) , coefa(1,ipclip) , coefb(1,ipclip) , &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ ra(iw1), ra(iw2), ra(iw3), &
+ rdevel , rtuser , ra )
+
+! On sort le gradient
+
+NAMEVR = 'Grad_LSQ_Ext'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+! Calcul de l'erreur absolue
+
+do iel = 1, ncelet
+ xx = xyzcen(1,iel)
+ yy = xyzcen(2,iel)
+ zz = xyzcen(3,iel)
+ rtp(iel,iuiph) = rtp(iel,iuiph)- cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iviph) = rtp(iel,iviph)-2.d0*cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iwiph) = rtp(iel,iwiph)-3.d0*cos(xx+2.d0*yy+3.d0*zz)
+enddo
+
+! On sort l'erreur
+
+NAMEVR = 'Err_Grad_LSQ_Ext'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+
+! 2.4 APPEL A GRDCEL AVEC IMRGRA = 4
+! ==================================
+
+imrgra = 4
+imligp = -1
+
+call grdcel &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(iw1), ra(iw1), ra(iw1), &
+ rtp(1,ivar) , coefa(1,ipclip) , coefb(1,ipclip) , &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ ra(iw1), ra(iw2), ra(iw3), &
+ rdevel , rtuser , ra )
+
+! On sort le gradient
+
+NAMEVR = 'Grad_LSQ_RC'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+! Calcul de l'erreur absolue
+
+do iel = 1, ncelet
+ xx = xyzcen(1,iel)
+ yy = xyzcen(2,iel)
+ zz = xyzcen(3,iel)
+ rtp(iel,iuiph) = rtp(iel,iuiph)- cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iviph) = rtp(iel,iviph)-2.d0*cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iwiph) = rtp(iel,iwiph)-3.d0*cos(xx+2.d0*yy+3.d0*zz)
+enddo
+
+! On sort l'erreur
+
+NAMEVR = 'Err_Grad_LSQ_RC'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+
+! 2.5 APPEL A GRDCEL AVEC IMRGRA = 3
+! ==================================
+
+! Reduction du voisinage etendu
+
+call redvse(anomax)
+!==========
+
+imrgra = 3
+imligp = 1
+
+call grdcel &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(iw1), ra(iw1), ra(iw1), &
+ rtp(1,ivar) , coefa(1,ipclip) , coefb(1,ipclip) , &
+ rtp(1,iuiph) , rtp(1,iviph) , rtp(1,iwiph) , &
+ ra(iw1), ra(iw2), ra(iw3), &
+ rdevel , rtuser , ra )
+
+! On sort le gradient
+
+NAMEVR = 'Grad_LSQ_ExtRed'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+! Calcul de l'erreur absolue
+
+do iel = 1, ncelet
+ xx = xyzcen(1,iel)
+ yy = xyzcen(2,iel)
+ zz = xyzcen(3,iel)
+ rtp(iel,iuiph) = rtp(iel,iuiph)- cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iviph) = rtp(iel,iviph)-2.d0*cos(xx+2.d0*yy+3.d0*zz)
+ rtp(iel,iwiph) = rtp(iel,iwiph)-3.d0*cos(xx+2.d0*yy+3.d0*zz)
+enddo
+
+! On sort l'erreur
+
+NAMEVR = 'Err_Grad_LSQ_ExtRed'
+call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+!==========
+ ntcabs, ttcabs, rtp(1,iuiph), rbid, rbid)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/tremai.c b/src/base/tremai.c
new file mode 100644
index 0000000..066bf2f
--- /dev/null
+++ b/src/base/tremai.c
@@ -0,0 +1,122 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Compute remaining time allocated to this process
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+#undef _POSIX_SOURCE /* Otherwise compilation problem on VPP 5000 */
+#undef _XOPEN_SOURCE /* Otherwise, compilation problem on SunOS */
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "tremai.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public function definitions for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Compute remaining time allocated to this process
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE TREMAI (TPS , RET)
+ * *****************
+ *
+ * DOUBLE PRECISION TPS : <-- : remaining time (default: 7 days)
+ * INTEGER RET : <-- : return code:
+ * : : -1: error
+ * : : 0: no limit using this method
+ * : : 1: CPU limit determined
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (tremai, TREMAI) (double *tps,
+ int *ret)
+{
+ struct rlimit ressources;
+ struct rusage buf_time;
+ struct rusage buf_time1;
+
+ *tps = 3600.0 * 24.0 * 7; /* "unlimited" values by default */
+
+/* Architectures other than IBM Blue Gene or Cray XT */
+#if !defined(__blrts__) && !defined(__bgp__) \
+ && !defined(__CRAYXT_COMPUTE_LINUX_TARGET)
+
+ if ((*ret = getrusage(RUSAGE_SELF, &buf_time)) < 0)
+ fprintf(stderr, "getrusage(RUSAGE_SELF) error:\n%s\n", strerror(errno));
+ else if ((*ret = getrusage(RUSAGE_CHILDREN, &buf_time1)) < 0)
+ fprintf(stderr, "getrusage(RUSAGE_CHILDREN) error:\n%s\n", strerror(errno));
+ else if ((*ret = getrlimit(RLIMIT_CPU, &ressources)) < 0)
+ fprintf(stderr, "getrlimit(RLIMIT_CPU) error:\n%s\n", strerror(errno));
+
+ /* If no error encountered (most probable case), use CPU limit returned by
+ getrlimit (works at least with LSF batch systems under OSF1 or Linux),
+ compute true remaining time, and put return code to 1 to indicate
+ thet the remaining time is indeed limited. */
+
+ if (*ret == 0 && ressources.rlim_cur != RLIM_INFINITY) {
+ *tps = (double)((int)ressources.rlim_cur
+ - ( buf_time.ru_utime.tv_sec + buf_time.ru_stime.tv_sec
+ + buf_time1.ru_utime.tv_sec + buf_time1.ru_stime.tv_sec));
+ *ret = 1;
+ }
+
+#else /* IBM Blue Gene or Cray XT */
+
+ *ret = -1; /* getrusage(RUSAGE_SELF, ...) and getrlimit(RLIMIT_CPU, ...)
+ not available on this architecture */
+
+#endif
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/base/tridim.f90 b/src/base/tridim.f90
new file mode 100644
index 0000000..a9510d5
--- /dev/null
+++ b/src/base/tridim.f90
@@ -0,0 +1,2517 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine tridim &
+!================
+
+ ( idbia0 , idbra0 , itrale , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ tslagr , coefa , coefb , frcxt , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS N-S MONOPHASIQUES INCOMPRESSIBLE ET DES
+! EQUATIONS SCALAIRES POUR UN PAS DE TEMPS
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! itrale ! e ! <-- ! numero d'iteration pour l'ale !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! isostd ! te ! <-- ! indicateur de sortie standard !
+! (nfabor+1) ! ! ! +numero de la face de reference !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "albase.h"
+include "alstru.h"
+include "alaste.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+include "coincl.h"
+include "atincl.h"
+include "lagpar.h"
+include "lagdim.h"
+include "lagran.h"
+include "vortex.h"
+include "ihmpre.h"
+include "matiss.h"
+include "radiat.h"
+include "cplsat.h"
+
+! les includes pp* ne servent que pour recuperer le pointeur IIZFPP
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , itrale
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer isostd(nfabor+1,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision tslagr(ncelet,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision frcxt(ncelet,3,nphas)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer idbia1, idbra1
+integer ifinia, ifinra, ifnia1, ifnra1
+integer iel , ifac , ivar , iscal , iappel
+integer ncp , ncv , iok
+integer iicodc, ircodc
+integer icoefu, irijip, ihbord, itbord
+integer idtr , iviscf, iviscb, ivisfi, ivisbi, iiptot
+integer idam , ixam
+integer icofbd
+integer idrtp , igrdp , ismbr , irovsd
+integer itinsk, itinse, idivu , iprv2f
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9 , iw10 , iw11 , iw12
+integer ixmij
+integer ifrchy, idfrhy, idfrcx
+integer igrdvt, iprodu, igrarx, igrary, igrarz
+integer iesflm, iesflb
+integer itrava, iximpa, iuvwk
+integer nbccou
+integer icofbr
+integer ntrela
+
+integer isvhb , isvtb
+integer iphas , kphas , ii , ippcp , ientha, ippcv
+integer ikiph , ieiph , iomiph
+integer iuiph , iviph , iwiph , ipriph, iphiph, iphass
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ipcrom, ipcroa
+integer iprnew, idimte, itenso
+integer ifinib, ifinrb, iiifap
+integer iflua , iflub
+integer icoax , icobx , icoay , icoby , icoaz , icobz
+integer iqfx , iqfy , iqfz , icoefq
+integer iirho , iirhob, icoefx
+integer irtdp , idrtdp, icofay, icofby, iismph
+integer iisoth, itext , itint , itek
+integer icorua, icorub, iflxma, iflxmb
+integer iterns, inslst, icvrge, iuetbo, ivsvdr
+integer iwflms, iwflmb
+integer iwcf , iph , iflmas, iflmab
+integer italim, itrfin, itrfup, ineefl
+integer iflalf, iflalb, iprale, icoale
+integer maxelt, ils, iilzfb, nbzfmx, nozfmx, iqcalc
+
+double precision cpcst , tditot, tdist2, tdist1, cvcst
+double precision ro0iph, p0iph, pr0iph, xxp0, xyp0, xzp0
+double precision relaxk, relaxe, relaxw
+
+integer ipass
+data ipass /0/
+save ipass
+
+integer infpar
+save infpar
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1000)
+endif
+
+idebia = idbia0
+idebra = idbra0
+
+maxelt = max(ncelet, nfac, nfabor)
+
+ipass = ipass + 1
+
+! --- Indicateur de stockage d'un scalaire et de son coef
+! d'echange associe.
+! Pour le moment, on stocke uniquement dans le cas couplage SYRTHES.
+! ISVTB donne le numero du scalaire (on suppose qu'il n'y en a
+! qu'un).
+! Dans le cas ou on a un couplage avec le module thermique 1D en paroi,
+! on utilise le meme scalaire que celui qui sert a Syrthes (s'il y a
+! couplage Syrthes), sinon on stocke le scalaire thermique de la phase 1.
+
+call nbcsyr (nbccou)
+!==========
+isvhb = 0
+isvtb = 0
+if (nbccou .ge. 1) then
+ do iscal = 1, nscal
+ if(icpsyr(iscal).eq.1) then
+ isvhb = iscal
+ isvtb = iscal
+ endif
+ enddo
+endif
+
+if ((nfpt1t.gt.0).and.(nbccou.le.0)) then
+ iphas = 1
+ isvhb = iscalt(iphas)
+ isvtb = iscalt(iphas)
+endif
+
+! Si la distance a la paroi doit etre mise a jour, on l'initialise a GRAND
+! des maintenant (pour le premier passage dans phyvar en k-omega)
+if(ipass.eq.1.and.ineedy.eq.1.and.abs(icdpar).eq.1.and. &
+ imajdy.eq.0) then
+ do iel = 1, ncel
+ ra(idipar+iel-1) = grand
+ enddo
+endif
+
+!===============================================================================
+! 2. AU DEBUT DU CALCUL ON REINITIALISE LA PRESSION
+!===============================================================================
+
+! On le fait sur 2 pas de temps, car souvent, le champ de flux de masse
+! initial n'est pas a divergence nulle (CL incluses) et l'obtention
+! d'un flux a divergence nulle coherent avec la contrainte stationnaire
+! peut prendre quelques pas de temps.
+! Remarquer que la pression est rattrapee dans l'etape de stokes.
+! On ne le fait pas dans le cas de la prise en compte de la pression
+! hydrostatique, ni dans le cas du compressible
+
+if( ntcabs.le.2 .and. isuite.eq.0 .and. iphydr.eq.0 &
+ .and. ippmod(icompf).lt.0 ) then
+
+ if(iwarni(ipr(1)).ge.2) then
+ write(nfecra,2000) ntcabs
+ endif
+ do iphas = 1, nphas
+ iprnew = 1
+ if(iphas.gt.1) then
+ do kphas = 1, iphas-1
+ if(ipr(iphas).eq.ipr(kphas)) then
+ iprnew = 0
+ endif
+ enddo
+ endif
+ if(iprnew.eq.1) then
+ iiptot = ipproc(iprtot(iphas))
+ ro0iph = ro0 (iphas)
+ p0iph = p0 (iphas)
+ pr0iph = pred0(iphas)
+ xxp0 = xyzp0(1,iphas)
+ xyp0 = xyzp0(2,iphas)
+ xzp0 = xyzp0(3,iphas)
+ do iel = 1, ncel
+ rtp(iel,ipr(iphas)) = pr0iph
+ propce(iel,iiptot) = p0iph &
+ + ro0iph*( gx*(xyzcen(1,iel)-xxp0) &
+ + gy*(xyzcen(2,iel)-xyp0) &
+ + gz*(xyzcen(3,iel)-xzp0) )
+ enddo
+ endif
+ enddo
+endif
+
+ 2000 format( &
+ ' REINITIALISATION DE LA PRESSION A L''ITERATION ',I10)
+
+!===============================================================================
+! 3. COMMUNICATIONS
+!===============================================================================
+
+! ---> On echange ici les variables RTP en debut de pas de temps.
+! Ce n'est pas fait dans caltri pour faciliter la lecture
+! (manipulation des tableaux)
+! Ceci a l'avantage d'echanger egalement ce qui provient de
+! inivar et lecamo (et par rapport a une solution d'echange
+! en fin de pas de temps, on evite une communication)
+! L'inconvenient est que l'on ne dispose pas des halos sitot les
+! RTP calcules (fin de navsto, turbke, turrij, boucle dans scalai)
+! On pourrait penser a echanger aussi les PROPCE et le DT
+! Pour le moment ca ne s'impose pas : on a besoin d'avoir
+! echange RHO dans navsto pour un affichage et les viscosites
+! dans vissec. On fera les transferts localement quand necessaire.
+! Par principe, on suppose que
+! c'est a la charge de celui qui utilise des valeurs voisines de
+! s'assurer qu'elles existent (ss pgm utilisateurs en
+! particulier)
+! seules les RTPA sont echangees de maniere systematique
+! (eviter donc d'utiliser RTP)
+! le calcul du gradient fournit aussi les valeurs sur le halo
+! (utile pour les reconstructions)
+! les seules boucles sur NCELET sont des boucles d'initialisation
+! (on n'a pas a faire de calcul sur les cellules halo, elles
+! elles sont remplies par les routines de communication et
+! on y preleve seulement de l'information)
+
+
+
+! ---> Parallelisme
+
+if(irangp.ge.0) then
+
+ do ivar = 1, nvar
+ call parcve (rtp(1,ivar))
+ !==========
+ enddo
+
+endif
+
+! ---> Periodicite
+
+if(iperio.eq.1) then
+
+! -- Vitesse
+
+ do iphas = 1, nphas
+
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+ idimte = 1
+ itenso = 0
+ call percve &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iuiph), rtp(1,iuiph), rtp(1,iuiph), &
+ rtp(1,iviph), rtp(1,iviph), rtp(1,iviph), &
+ rtp(1,iwiph), rtp(1,iwiph), rtp(1,iwiph))
+
+ enddo
+
+! -- Tenseur de Reynolds
+
+ do iphas = 1, nphas
+
+ if(itytur(iphas).eq.3) then
+ idimte = 2
+ itenso = 0
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ call percve &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ir11ip), rtp(1,ir12ip), rtp(1,ir13ip), &
+ rtp(1,ir12ip), rtp(1,ir22ip), rtp(1,ir23ip), &
+ rtp(1,ir13ip), rtp(1,ir23ip), rtp(1,ir33ip) )
+ endif
+
+! -- Remarque pour le v2f
+! v2 (donc phi) est lie a une orientation locale, on peut donc le traiter
+! comme un scalaire dans la periodicite de rotation
+
+
+ enddo
+
+! -- Variables scalaires
+
+ do ivar = 1, nvar
+ do iphas = 1, nphas
+ if(ivar.ne.iu(iphas).and.ivar.ne.iv(iphas).and. &
+ ivar.ne.iw(iphas).and. &
+ (itytur(iphas).ne.3.or. &
+ (ivar.ne.ir11(iphas).and.ivar.ne.ir22(iphas).and. &
+ ivar.ne.ir33(iphas).and.ivar.ne.ir12(iphas).and. &
+ ivar.ne.ir13(iphas).and.ivar.ne.ir23(iphas)))) then
+
+ idimte = 0
+ itenso = 0
+ call percve &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar) )
+
+ endif
+ enddo
+ enddo
+
+endif
+
+!===============================================================================
+! 4. POUR IPHYDR ON DOIT COMMUNIQUER FRCXT AU PREMIER PASSAGE
+! (FRCXT SERT DANS TYPECL)
+! SI ICALHY=1, ON COMMUNIQUE AUSSI RHO POUR REMPLIR
+! PROPCE(1,IPPROC(IROMA(IPHAS)))
+!===============================================================================
+
+if(ipass.eq.1) then
+
+! --- Communication de FRCXT
+ if (iphydr.eq.1) then
+
+ do iphas = 1, nphas
+ if(irangp.ge.0) then
+ call parcve (frcxt(1,1,iphas))
+ !==========
+ call parcve (frcxt(1,2,iphas))
+ !==========
+ call parcve (frcxt(1,3,iphas))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percve &
+ !==========
+ ( idimte , itenso , &
+ frcxt(1,1,iphas),frcxt(1,1,iphas),frcxt(1,1,iphas), &
+ frcxt(1,2,iphas),frcxt(1,2,iphas),frcxt(1,2,iphas), &
+ frcxt(1,3,iphas),frcxt(1,3,iphas),frcxt(1,3,iphas) )
+ endif
+
+ enddo
+
+ endif
+
+! --- Communication de RHO
+ if (icalhy.eq.1) then
+
+ do iphas = 1, nphas
+ ipcrom = ipproc(irom (iphas))
+ if(irangp.ge.0) then
+ call parcve (propce(1,ipcrom))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percve &
+ !==========
+ ( idimte , itenso , &
+ propce(1,ipcrom),propce(1,ipcrom),propce(1,ipcrom), &
+ propce(1,ipcrom),propce(1,ipcrom),propce(1,ipcrom), &
+ propce(1,ipcrom),propce(1,ipcrom),propce(1,ipcrom) )
+ endif
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 5. LES VALEURS COURANTES ECRASENT LES VALEURS ANTERIEURES
+!===============================================================================
+
+! --- Noter que exceptionnellement, on fait un calcul avec NCELET,
+! pour eviter une nouvelle communication sur RTPA et les autres
+! tableaux du pas de temps precedent
+
+do ivar = 1, nvar
+ do iel = 1, ncelet
+ rtpa (iel,ivar) = rtp (iel,ivar)
+ enddo
+enddo
+
+if (icalhy.eq.1) then
+ do iphas = 1, nphas
+ ipcrom = ipproc(irom (iphas))
+ ipcroa = ipproc(iroma (iphas))
+ do iel = 1, ncelet
+ propce(iel,ipcroa) = propce(iel,ipcrom)
+ enddo
+ enddo
+endif
+
+!===============================================================================
+! 6. DANS LE CAS "zero pas de temps" EN "SUITE" DE CALCUL
+! ON SORT ICI
+!===============================================================================
+! on sort avant SCHTMP car sinon a l'ordre 2 en temps la valeur du
+! flux de masse au pas de temps precedent est ecrasee par la valeur
+! au pas de temps actuel et la valeur au pas de temps actuel est
+! remplacee par une extrapolation qui n'a pas lieu d'etre puisque
+! NTCABS n'est pas incremente. Dans le cas INPDT0=1 sans suite, il
+! n'y a pas de probleme puisque tous les flux de masse sont a 0 !
+! Si ITRALE=0, on est a l'iteration d'initialisation de l'ALE,
+! on ne touche pas au flux de masse non plus
+
+
+if(inpdt0.eq.1.and.isuite.eq.1) goto 200
+
+if (itrale.gt.0) then
+ iappel = 1
+ call schtmp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+ ra )
+endif
+
+
+!===============================================================================
+! 6. MISE A JOUR DE LA LOCALISATION DES INTERFACES DE COUPLAGE CS/CS
+!===============================================================================
+
+! Localisation des interfaces de couplage via la librairie FVM
+
+! On fait cette mise a jour des interfaces de localisation juste apres
+! les changements de geometries dus :
+! - soit a la methode ALE (en fin de pas de temps precedent)
+! - soit a un deplacement impose (cf ci-dessus)
+
+if (nbrcpl.gt.0) then
+
+ call cscloc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 7. CALCUL DES PROPRIETES PHYSIQUES VARIABLES
+! SOIT VARIABLES AU COURS DU TEMPS
+! SOIT VARIABLES LORS D'UNE REPRISE DE CALCUL
+! (VISCOSITES ET MASSE VOLUMIQUE)
+!===============================================================================
+
+if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1010)
+endif
+
+call memphy &
+!==========
+ ( idebia , idebra , &
+ nvar , ncelet , ncel , nfac , nfabor , nphas , &
+ iw1 , iw2 , iw3 , iw4 , &
+ iw5 , iw6 , iw7 , iw8 , &
+ iw9 , iw10 , iw11 , iw12 , ixmij , &
+ ifinia , ifinra )
+
+call phyvar &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+ ra(iw7), ra(iw8), ra(iw9), ra(iw10), ra(iw11), ra(iw12), &
+ ra(ixmij) , &
+ rdevel , rtuser , ra )
+
+if (itrale.gt.0) then
+ iappel = 2
+ call schtmp &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+ ra )
+endif
+
+
+! REMPLISSAGE DES COEFS DE PDC
+! ON Y PASSE MEME S'IL N'Y A PAS DE PDC SUR LE PROC COURANT AU CAS OU
+! UN UTILISATEUR DECIDERAIT D'AVOIR UN COEFF DE PDC DEPENDANT DE
+! LA VITESSE MOYENNE OU MAX.
+
+
+do iphas = 1, nphas
+
+ if (ncpdct(iphas).gt.0) then
+
+ iappel = 3
+ if (imatis.eq.1) then
+
+ call mtkpdc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdc(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iicepd(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)) , &
+ rdevel , rtuser , ra )
+
+ else
+
+ ils = idebia
+ idbia1 = ils + maxelt
+ CALL IASIZE('TRIDIM',IDBIA1)
+
+ call uskpdc &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdc(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iicepd(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+enddo
+
+
+! REMPLISSAGE DES COEFS DE TERME SOURCE DE MASSE
+
+do iphas = 1, nphas
+
+! ON Y PASSE MEME S'IL N'Y A PAS DE TSM SUR LE PROC COURANT AU CAS OU
+! UN UTILISATEUR DECIDERAIT D'AVOIR UN TSM DEPENDANT DE
+! VALEURS GLOBALES OU MAX.
+ if(nctsmt(iphas).gt.0) then
+
+ ils = idebia
+ idbia1 = ils + maxelt
+ CALL IASIZE('TRIDIM',IDBIA1)
+
+! Mise a zero du tableau de type de TS masse et source
+ do ii = 1, ncetsm(iphas)*nvar
+ ia(iitpsm(iphas)+ii-1) = 0
+ ra(ismace(iphas)+ii-1) = 0.d0
+ enddo
+
+ iappel = 3
+ call ustsma &
+! ============
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdc(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncetsm(iphas) , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , &
+ ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)), ra(ismace(iphas)), &
+ rdevel , rtuser , ra )
+
+ endif
+
+enddo
+
+!===============================================================================
+! 8. CALCUL DU NOMBRE DE COURANT ET DE FOURIER
+! CALCUL DU PAS DE TEMPS SI VARIABLE
+!===============================================================================
+
+if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1020)
+endif
+
+call memdtv &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iviscf , iviscb , idam , icofbd , iw1 , iw2 , iw3 , &
+ icofbr , igrarx , igrary , igrarz , iwcf , &
+ iptlro , ippmod(icompf) , &
+ ifinia , ifinra )
+
+iphas = 1
+
+call dttvar &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iwarni(iu(1)) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)), ia(iicesm(iphas)), ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)), &
+ ra(iviscf) , ra(iviscb) , ra(idam) , &
+ ra(icofbd) , ra(iw1) , ra(iw2) , ra(iw3) ,&
+ ra(icofbr) , ra(igrarx) , ra(igrary) , ra(igrarz),&
+ ra(iwcf), &
+ rdevel , rtuser , ra )
+
+if (nbaste.gt.0.and.itrale.gt.nalinf) then
+ ntrela = ntcabs - ntpabs
+ call astpdt(dt, ncelet, ntrela)
+ !==========
+endif
+!===============================================================================
+! 9. CHARGEMENT ET TRADUCTION DES CONDITIONS AUX LIMITES
+!===============================================================================
+
+if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1030)
+endif
+
+! -- Methode des vortex en LES :
+! Definition ou modification eventuelle des parametres
+! Mise a jour des vortex
+
+if (ivrtex.eq.1) then
+
+ ils = ifinia
+ ifnia1 = ils + maxelt
+ CALL IASIZE('TRIDIM',IFNIA1)
+
+ iphas = 1
+ iappel = 2
+ call usvort &
+ !==========
+ ( ifnia1 , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iirepv) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ dt , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , ra )
+
+! Verification des donnees entrees par l'utilisateur
+! (au premier passage seulement)
+ if (ipass.eq.1) then
+ call vorver ( nfabor , ia(iirepv) , iappel )
+ !==========
+ endif
+
+ if(irangp.le.0) then
+ call vortex &
+ !==========
+ ( ia(iivrce) , ra(ivisv) , ra(ixyzv) , &
+ ra(iyzcel) , ra(iuvort) , ra(ivvort), &
+ ra(iwvort) , &
+ ra(iyzvor) , ra(iyzvoa) , ra(isignv), &
+ ra(ixsigm) , ra(ixgamm) , ra(ixtmp) , &
+ ra(ixtmpl) )
+ endif
+
+! -- Fin de zone Methode des vortex
+
+endif
+
+
+! --- Methode ALE : debut de boucle d'implicitation du deplacement des
+! structures. ITRFIN=0 indique qu'on a besoin de refaire une iteration
+! pour Syrthes, T1D ou rayonnement.
+italim = 1
+itrfin = 1
+idbia1 = idebia
+idbra1 = idebra
+iflalf = 1
+iflalb = 1
+iprale = 1
+ineefl = 0
+if (iale.eq.1 .and. nalimx.gt.1 .and. itrale.gt.nalinf) then
+! On reserve certains tableaux pour permettre le retour a l'etat
+! initial en fin d'iteration ALE
+! - flux de masse
+! - conditions aux limites de gradient de P et U (car on a un appel
+! a GDRCEL pour les non orthogonalites pour calculer les CL reelles)
+! -> n'est peut-etre pas reellement necessaire
+! - la pression initiale (car RTPA est aussi ecrase dans le cas
+! ou NTERUP>1) -> on pourrait optimiser en ne reservant que si
+! necessaire ...
+! Pas la peine de tester les depassements car on passe dans
+! memcli juste apres.
+ iflalf = idebra
+ iflalb = iflalf + nfac
+ icoale = iflalb + nfabor
+ iprale = icoale + 8*nfabor
+ idbra1 = iprale + ncelet
+ ineefl = 1
+
+ if (nbccou.gt.0 .or. nfpt1t.gt.0 .or. iirayo.gt.0) itrfin = 0
+
+endif
+
+300 continue
+
+
+! --- Boucle sur navsto pour couplage vitesse/pression
+! on s'arrete a NTERUP ou quand TOUTES les phases on converge
+! ITRFUP=0 indique qu'on a besoin de refaire une iteration
+! pour Syrthes, T1D ou rayonnement.
+itrfup = 1
+
+iximpa = 1
+iuvwk = 1
+itrava = 1
+if (nterup.gt.1) then
+ iximpa = idbra1
+ iuvwk = iximpa + ncelet*ndim*nphas
+ itrava = iuvwk + ncelet*ndim*nphas
+ idbra1 = itrava + ncelet*ndim*nphas
+
+ if (nbccou.gt.0 .or. nfpt1t.gt.0 .or. iirayo.gt.0) itrfup = 0
+
+endif
+
+
+icvrge = 0
+inslst = 0
+iterns = 1
+do while (iterns.le.nterup)
+
+
+ call memcli &
+ !==========
+( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ isvhb , isvtb , &
+ iicodc , ircodc , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , &
+ icoefu , irijip , iuetbo , ivsvdr , ihbord , itbord , &
+ ifinia , ifinra )
+
+ call precli &
+ !==========
+( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(ircodc) , ra(icoefu) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , &
+ ra(iw4 ) , ra(iw5 ) , ra(iw6 ) , &
+ rdevel , rtuser , ra )
+
+
+ if (imatis.eq.0) then
+
+ ! ON NE FAIT PAS DE MATISSE
+
+ ! - Interface Code_Saturne
+ ! ======================
+
+ if (iihmpr.eq.1) then
+
+ ! N.B. Zones de face de bord : on utilise provisoirement les zones des
+ ! physiques particulieres, meme sans physique particuliere
+ ! -> sera modifie lors de la restructuration des zones de bord
+
+ call uiclim &
+ !==========
+ ( ntcabs, nfabor, &
+ nozppm, ncharm, ncharb, nclpch, &
+ iindef, ientre, iparoi, iparug, isymet, isolib, &
+ iqimp, icalke, ientat, ientcp, inmoxy, iprofm, &
+ ia(iitypf), ia(iizfpp), ia(iicodc), &
+ dtref, ttcabs, surfbo, cdgfbo, &
+ qimp, qimpat, qimpcp, dh, xintur, &
+ timpat, timpcp, distch, ra(ircodc) )
+
+ if (ippmod(iphpar).eq.0) then
+
+ ! ON NE FAIT PAS DE LA PHYSIQUE PARTICULIERE NI DE MATISSE
+
+ nbzfmx = nbzppm
+ nozfmx = nozppm
+ iilzfb = ifinia
+ ifnia1 = iilzfb + nbzfmx
+ iqcalc = ifinra
+ ifnra1 = iqcalc + nozfmx
+ CALL IASIZE('TRIDIM',IFNIA1)
+ CALL RASIZE('TRIDIM',IFNRA1)
+
+ call stdtcl &
+ !==========
+ ( ifnia1 , ifnra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nbzfmx , nozfmx , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ iqimp , icalke , qimp , dh , xintur, &
+ ia(iicodc) , ia(iitrif) , ia(iitypf) , ia(iizfpp) , &
+ ia(iilzfb) , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ircodc) , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+ ra(icoefu) , ra(iqcalc) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+ ! - Sous-programme utilisateur
+ ! ==========================
+
+ if (ippmod(iphpar).eq.0) then
+
+ ils = ifinia
+ ifnia1 = ils + maxelt
+ CALL IASIZE('TRIDIM',IFNIA1)
+
+ call usclim &
+ !==========
+ ( ifnia1 , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , ia(iitrif) , ia(iitypf) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ircodc) , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+ ra(icoefu) , &
+ rdevel , rtuser , ra )
+
+ else
+
+ ! ON FAIT DE LA PHYSIQUE PARTICULIERE (MAIS PAS DE MATISSE)
+
+ call ppclim &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , ia(iitrif) , ia(iitypf) , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ircodc) , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+ ra(icoefu) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ ! - Interface Code_Saturne
+ ! ======================
+
+ if(iihmpr.eq.1) then
+
+ call uiclve &
+ !==========
+ ( nfabor, nozppm, &
+ iindef, ientre, iparoi, iparug, isymet, isolib, &
+ ia(iitypf), ia(iizfpp) )
+
+ endif
+
+ endif
+
+ ! -- Methode des vortex en L.E.S. :
+ ! (Transfert des vortex dans les tableaux RCODCL)
+
+ if(ivrtex.eq.1) then
+
+ call vor2cl &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , ia(iitrif) , ia(iitypf) , &
+ idevel , ia(iirepv) , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ircodc) , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+ ra(icoefu) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ ! --- Couplage code/code entre deux instances (ou plus) de Code_Saturne
+ ! On s'occupe ici du couplage via les faces de bord, et de la
+ ! transformation de l'information reçue en condition limite.
+
+ if (nbrcpl.gt.0) then
+
+ call cscfbr &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , ia(iitrif) , ia(iitypf) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ircodc) , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+ ra(icoefu) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ ! -- Methode ALE (CL de vitesse de maillage et deplacement aux noeuds)
+
+ if (iale.eq.1) then
+
+ do ii = 1, nnod
+ ia(iimpal+ii-1) = 0
+ enddo
+
+ ! - Interface Code_Saturne
+ ! ======================
+
+ if (iihmpr.eq.1) then
+
+ call uialcl &
+ !==========
+ ( nfabor, nozppm, &
+ ibfixe, igliss, ivimpo, &
+ ia(iialty), ipnfbr, nnod, nodfbr, &
+ ia(iimpal), &
+ ra(idepal), &
+ dtref, ttcabs, ntcabs, &
+ iuma, ivma, iwma, &
+ ra(ircodc) )
+
+ endif
+
+ ils = ifinia
+ ifnia1 = ils + maxelt
+ CALL IASIZE('TRIDIM',IFNIA1)
+
+ call usalcl &
+ !==========
+ ( ifnia1 , ifinra , itrale , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , ia(iitypf) , ia(iialty) , &
+ ia(iimpal) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ircodc) , &
+ ra(ixyzn0) , ra(idepal) , &
+ rdevel , rtuser , ra )
+
+ ! Au cas ou l'utilisateur aurait touche DEPALE sans mettre IMPALE=1, on
+ ! remet le deplacement initial
+ do ii = 1, nnod
+ if (ia(iimpal+ii-1).eq.0) then
+ ra(idepal+ii-1 ) = xyznod(1,ii)-ra(ixyzn0+(ii-1)*ndim )
+ ra(idepal+ii-1+ nnod) = xyznod(2,ii)-ra(ixyzn0+(ii-1)*ndim+1)
+ ra(idepal+ii-1+2*nnod) = xyznod(3,ii)-ra(ixyzn0+(ii-1)*ndim+2)
+ endif
+ enddo
+
+ ! En cas de couplage de structures, on calcule un deplacement predit
+ if (nbstru.gt.0.or.nbaste.gt.0) then
+
+ call strpre &
+ !==========
+ ( ifinia , ifinra , itrale , italim , ineefl , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iimpal) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iflalf), ra(iflalb), ra(iprale), ra(icoale), ra(idepal), &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+ ! UNE FOIS CERTAINS CODES DE CONDITIONS LIMITES INITIALISES PAR
+ ! L'UTILISATEUR, ON PEUT COMPLETER CES CODES PAR LES COUPLAGES
+ ! AUX BORDS (TYPE SYRTHES), SAUF SI ON DOIT Y REPASSER ENSUITE
+
+ if (itrfin.eq.1 .and. itrfup.eq.1) then
+
+ call coupbi &
+ !==========
+ ( ifinia , ifinra , &
+ nfabor , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ia(iicodc) , &
+ idevel , ituser , ia , &
+ ra(ircodc) , &
+ rdevel , rtuser , ra )
+
+ if (nfpt1t.gt.0) then
+ call cou1di &
+ !==========
+ ( ifinia , ifinra , &
+ nfabor , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isvtb , ia(iicodc) , &
+ idevel , ituser , ia , &
+ ra(ircodc) , &
+ rdevel , rtuser , ra )
+ endif
+
+ endif
+
+
+ if(iirayo.gt.0 .and. itrfin.eq.1 .and. itrfup.eq.1) then
+
+ call memra3 &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iisoth , itek , itext , itint , &
+ ifinib , ifinrb )
+
+ call raycli &
+ !==========
+ ( ifinib , ifinrb , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , isvhb , isvtb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , ia(iitrif) , ia(iitypf) , &
+
+ ia(iizfrd) , ia(iisoth) , &
+
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ ra(ircodc) , &
+ coefa , coefb , ra(ihbord) , ra(itbord) , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+
+ ra(itext) , ra(itint) , ra(itek) , &
+
+ rdevel , rtuser , ra )
+
+ endif
+
+ ! ON CALCULE LES COEFFICIENTS ASSOCIES AUX CONDITIONS LIMITES
+
+ call condli &
+ !==========
+( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , isvhb , isvtb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicodc) , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ ra(ircodc) , &
+ coefa , coefb , ra(iuetbo) , ra(ivsvdr) , &
+ ra(ihbord) , ra(itbord) , &
+ frcxt , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), &
+ ra(icoefu) , ra(irijip) , &
+ rdevel , rtuser , ra )
+
+
+ ! UNE FOIS LES COEFFICIENTS CALCULES, ON PEUT EN DEDUIRE PLUS
+ ! FACILEMENT (I.E. SANS RECALCULS INUTILES) LES TERMES A
+ ! ENVOYER POUR LES COUPLAGES AUX BORDS (TYPE SYRTHES)
+
+
+ ! On indique si la variable couplee est l'enthalpie
+ ientha = 0
+ if(isvtb.gt.0) then
+ if(iscsth(isvtb).eq.2) then
+ ientha = 1
+ endif
+ endif
+
+ ! Compressible : on indique si la variable couple est l'energie
+
+ if ( ippmod(icompf).ge.0 ) then
+ if(isvtb.gt.0) then
+ if(iscsth(isvtb).eq.3) then
+ ientha = 2
+ endif
+ endif
+ endif
+
+ ! On recupere le Cp de la phase couplee
+ ! (ou de la phase 1, si pas de couplage)
+ iphas = 1
+ if(isvtb.gt.0) then
+ iphas = iphsca(isvtb)
+ endif
+ if(icp(iphas).gt.0) then
+ ippcp = ipproc(icp(iphas))
+ ncp = ncelet
+ cpcst = 0.d0
+ else
+ ippcp = ifinra
+ ncp = 1
+ cpcst = cp0(iphas)
+ endif
+
+ ! En compressible et si on couple ave l'energie
+ ! on recupere de Cv de la phase couplee
+
+ if ( ippmod(icompf).ge.0 .and. ientha .eq. 2 ) then
+
+ iphas = iphsca(isvtb)
+ if(icv(iphas).gt.0) then
+ ippcv = ipproc(icv(iphas))
+ ncv = ncelet
+ cvcst = 0.d0
+ else
+ ippcv = ifinra
+ ncv = 1
+ cvcst = cv0(iphas)
+ endif
+ else
+ ippcv = ifinra
+ ncv = 1
+ cvcst = 0.d0
+ endif
+
+ ! On envoie le tout vers SYRTHES, en distinguant CP
+ ! constant ou variable
+ if (itrfin.eq.1 .and. itrfup.eq.1) then
+
+ call coupbo &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , isvtb , &
+ nideve , nrdeve , nituse , nrtuse , ncp , ncv , ientha , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cpcst , propce(1,ippcp) , cvcst , propce(1,ippcv), &
+ ra(ihbord) , ra(itbord) , &
+ rdevel , rtuser , ra )
+
+
+ if (nfpt1t.gt.0) then
+ call cou1do &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncp , nfpt1d , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ientha , ia(iifpt1), ia(iiclt1), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ ra(itppt1), ra(itept1), ra(ihept1), &
+ ra(ifept1), ra(ixlmt1), ra(ircpt1), ra(idtpt1), &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cpcst , propce(1,ippcp) , ra(ihbord) , ra(itbord) , &
+ rdevel , rtuser , ra )
+ endif
+ endif
+
+ ! ON N'A PLUS BESOIN DE ISVHB OU ISVHT (POUR HBORD ET TBORD)
+ ! A PARTIR D'ICI
+
+
+
+ ! CALCUL DE LA DISTANCE A LA PAROI
+ ! (Nouvel algorithme. L'ancien est dans condli)
+ ! En ALE on ne fait ce calcul qu'a la premiere des
+ ! sous-iterations d'implicitation ITALIM, car le maillage
+ ! n'est pas modifie dans les sous-iterations suivantes
+
+ if (italim.eq.1) then
+
+ if(ineedy.eq.1.and.iwarny.ge.1) then
+ call dmtmps(tdist1)
+ endif
+
+
+ ! On ne fait le calcul que s'il y a des parois (RA(IDIPAR) est reserve
+ ! et initialise a GRAND avant. S'il n'y a pas de paroi, il restera = GRAND)
+
+ ! Pour le moment, on suppose que l'on peut se contenter de faire
+ ! cela au premier passage, sauf avec les maillages mobiles. Attention donc
+ ! aux conditions aux limites variables (faces qui deviennent des parois ou
+ ! parois qui deviennent autre chose)
+
+ ! Nombre de faces de paroi
+ if(ipass.eq.1) then
+ if(ineedy.eq.1) then
+ infpar = 0
+ do ifac = 1, nfabor
+ if(ia(iitypf-1+ifac).eq.iparoi .or. &
+ ia(iitypf-1+ifac).eq.iparug) then
+ infpar = infpar+1
+ endif
+ enddo
+ if(irangp.ge.0) then
+ call parcpt(infpar)
+ endif
+ endif
+ endif
+
+
+ ! On calcule la distance a la paroi
+ ! si elle doit etre mise a jour
+ ! et si on en a besoin,
+ ! et si on a choisi ce mode de calcul,
+ if( imajdy.eq.0.and.ineedy.eq.1.and.abs(icdpar).eq.1) then
+
+ ! S'il n'y a pas de paroi, on garde l'initialisation a GRAND
+ if(infpar.eq.0) then
+ imajdy = 1
+
+ ! S'il y a des parois, il faut calculer
+ else
+
+
+ ! On doit conserver la memoire de memcli a cause de RA(IUETBO)
+ ! dans DISTYP (uniquement en LES avec van Driest mais tant pis)
+
+ call memdis &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviscf , iviscb , idam , ixam , ismbr , irovsd , &
+ irtdp , icofay , icofby , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinib , ifinrb )
+
+ call distpr &
+ !==========
+ ( ifinib , ifinrb , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iitypf) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(idipar) , &
+ ra(iviscf) , ra(iviscb) , &
+ ra(idam) , ra(ixam) , &
+ ra(ismbr ) , ra(irovsd) , &
+ ra(irtdp) , ra(icofay) , ra(icofby) , &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), ra(iw7), &
+ ra(iw8), ra(iw9), &
+ rdevel , rtuser , ra )
+
+ ! La distance n'a plus a etre mise a jour sauf en ALE
+ if (iale.eq.0) imajdy = 1
+
+ endif
+ endif
+
+ endif
+
+
+ ! CALCUL DE L'AMORTISSEMENT DE VAN DRIEST
+ ! OU CALCUL DE Y+ POUR LE LAGRANGIEN
+
+
+ do iphas = 1, nphas
+
+ ! Pour passer en argument
+ iphass = iphas
+
+ ! On calcule y+ si on en a besoin
+
+ if( (itytur(iphas).eq.4.and.idries(iphas).eq.1) &
+ .or. (iilagr.ge.1 .and. iroule.eq.2) ) then
+
+ ! On calcule si on a demande ce mode de calcul
+ ! et s'il y a des parois (si pas de paroi, pas de y+)
+ if(abs(icdpar).eq.1.and.infpar.gt.0) then
+
+ iismph = iisymp+nfabor*(iphas-1)
+
+ ! On doit conserver la memoire de memcli a cause de RA(IUETBO)
+ ! dans DISTYP
+
+ call memdyp &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idam , ixam , ismbr , irovsd , &
+ irtdp , idrtdp , &
+ iqfx , iqfy , iqfz , icoefq , iirho , iirhob , &
+ iflua , iflub , &
+ icoax , icobx , icoay , icoby , icoaz , icobz , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinib , ifinrb )
+
+ call distyp &
+ !==========
+ ( ifinib , ifinrb , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iphass , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iitypf) , ia(iismph), &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(idipar), propce , ra(iuetbo), ra(iyppar), &
+ ra(idam ), ra(ixam ), ra(ismbr ), ra(irovsd), &
+ ra(irtdp ), ra(idrtdp), &
+ ra(iqfx ), ra(iqfy ), ra(iqfz ), ra(icoefq), &
+ ra(iirho ), ra(iirhob), &
+ ra(iflua ), ra(iflub ), &
+ ra(icoax ), ra(icobx ), ra(icoay ), ra(icoby ), &
+ ra(icoaz ), ra(icobz ), &
+ ra(iw1), ra(iw2), ra(iw3), ra(iw4), ra(iw5), ra(iw6), ra(iw7), &
+ ra(iw8), ra(iw9), &
+ rdevel , rtuser , ra )
+
+ endif
+
+ endif
+
+ if (itytur(iphas).eq.4 .and. idries(iphas).eq.1) then
+
+ ! Pas d'amortissement si pas de paroi
+ if(infpar.gt.0) then
+ if(iifapa(iphas).gt.0) then
+ iiifap = iifapa(iphas)
+ else
+ iiifap = ifinib
+ endif
+ call vandri &
+ !==========
+ ( ndim , ncelet , ncel , nfac , nfabor , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphass , &
+ ia(iitypf) , ifabor, ia(iiifap), &
+ idevel , ituser , ia , &
+ xyzcen , cdgfbo , ra(iuetbo) , ra(ivsvdr) , ra(iyppar) , &
+ propce , rdevel , rtuser , ra )
+ endif
+
+ endif
+
+ enddo
+
+ if(ineedy.eq.1.and.iwarny.ge.1) then
+ call dmtmps(tdist2)
+ tditot = tdist2-tdist1
+ if (irangp.ge.0) call parsom (tditot)
+ !==========
+ write(nfecra,4010)tditot
+ endif
+
+
+!===============================================================================
+! 10. DANS LE CAS "zero pas de temps" EN "NON SUITE" DE CALCUL
+! ON SORT ICI
+!===============================================================================
+
+ if (inpdt0.eq.1.and.isuite.eq.0) goto 200
+
+ if (iilagr.eq.3) goto 200
+
+!===============================================================================
+! 11. RESOLUTION DE LA VITESSE DE MAILLAGE EN ALE
+!===============================================================================
+
+ if (iale.eq.1) then
+
+ if (itrale.eq.0 .or. itrale.gt.nalinf) then
+
+ call memale &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+ call alelap &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iviscf) , ra(iviscb) , &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iw4 ), &
+ ra(iw5 ) , ra(iw6 ) , ra(iw7 ) , ra(iw8 ) , ra(iw9 ),&
+ rdevel , rtuser , ra )
+
+ endif
+
+ if (itrale.eq.0) goto 200
+
+ endif
+
+!===============================================================================
+! 11. CALCUL A CHAMP DE VITESSE NON FIGE :
+! ON RESOUT VITESSE ET TURBULENCE
+! ON SUPPOSE QUE TOUTES LES PHASES SONT FIGEES OU AUCUNE
+!===============================================================================
+
+ ! En cas de champ de vitesse fige, on ne boucle pas sur U/P
+ if (iccvfg.eq.0) then
+ !===============
+
+!===============================================================================
+! 12. RESOLUTION MASSE (MODULE COMPRESSIBLE UNIQUEMENT)
+!===============================================================================
+
+ ! Le module compressible n'est pas compatible avec la boucle U/P
+ if ( ippmod(icompf).ge.0 ) then
+
+ if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1080)
+ endif
+
+ call memcfm &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , &
+ iw7 , iw8 , iw9 , iw10 , iw11 , iw12 , &
+ iwflms , iwflmb , &
+ icoefu , &
+ ifinia , ifinra )
+
+ do iphas = 1, nphas
+
+ iscal = irho(iphas)
+
+ call cfmsvl &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , &
+ ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ ra(iviscf) , ra(iviscb) , &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , &
+ ra(iw4 ) , ra(iw5 ) , ra(iw6 ) , &
+ ra(iw7 ) , ra(iw8 ) , ra(iw9 ) , &
+ ra(iw10 ) , ra(iw11 ) , ra(iw12 ) , &
+ ra(iwflms) , ra(iwflmb) , &
+ ra(icoefu) , &
+ rdevel , rtuser , ra )
+
+ enddo
+
+ endif
+
+!===============================================================================
+! 13. RESOLUTION QUANTITE DE MOUVEMENT ET MASSE (INCOMPRESSIBLE)
+!===============================================================================
+
+ if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1040)
+ endif
+
+ call memnav &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviscf , iviscb , ivisfi , ivisbi , &
+ idam , ixam , &
+ idrtp , igrdp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , iw10 , idfrcx , ifrchy , idfrhy , &
+ icoefu , iesflm , iesflb , &
+ ifinia , ifinra )
+
+ ! SI LE COMPRESSIBLE SANS CHOC EST ACTIF, ON RESOUT AVEC CFQDMV
+ if ( ippmod(icompf).ge.0 ) then
+
+ do iphas = 1, nphas
+
+ iuiph = iu(iphas)
+ iflmas = ipprof(ifluma(iuiph))
+ iflmab = ipprob(ifluma(iuiph))
+ iph = iphas
+
+ call cfqdmv &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iph , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , &
+ ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ coefa , coefb , &
+ ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ frcxt , ra(idfrcx) , ra(itpuco) , ra(igrdp) , &
+ ra(iviscf) , ra(iviscb) , ra(ivisfi) , ra(ivisbi) , &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , &
+ ra(iw4 ) , ra(iw5 ) , ra(iw6 ) , &
+ ra(iw7 ) , ra(iw8 ) , ra(iw9 ) , &
+ ra(icoefu) , &
+ rdevel , rtuser , ra )
+
+ enddo
+
+ else
+
+ call navsto &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iterns , icvrge , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , coefa , coefb , frcxt , &
+ ra(itrava) , ra(iximpa) , ra(iuvwk ) , &
+ ra(iviscf) , ra(iviscb) , ra(ivisfi) , ra(ivisbi) , &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(igrdp ) , ra(ismbr ) , ra(irovsd) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , &
+ ra(iw4 ) , ra(iw5 ) , ra(iw6 ) , &
+ ra(iw7 ) , ra(iw8 ) , ra(iw9 ) , ra(iw10 ) , &
+ ra(idfrcx) , ra(ifrchy) , ra(idfrhy) , &
+ ra(icoefu) , ra(iesflm) , ra(iesflb), &
+ rdevel , rtuser , ra )
+
+ ! Mise a jour de la pression si on utilise un couplage vitesse/pression
+ ! par point fixe
+ ! En parallele, l'echange est fait au debut de navsto.
+ if(nterup.gt.1) then
+ do iphas = 1, nphas
+ ipriph = ipr(iphas)
+ do iel = 1, ncel
+ rtpa(iel,ipriph) = rtp(iel,ipriph)
+ enddo
+ enddo
+ endif
+
+ ! Si c'est la derniere iteration : INSLST = 1
+ if((icvrge.eq.1).or.(iterns.eq.nterup)) then
+
+ ! Si on a besoin de refaire une nouvelle iteration pour SYRTHES,
+ ! rayonnement, paroi thermique 1D...
+ ! ET que l'on est a la derniere iteration en ALE !
+
+ ! ...alors, on remet a zero les indicateurs de convergence
+ if (itrfup.eq.0.and.itrfin.eq.1) then
+ itrfup = 1
+ icvrge = 0
+ iterns = iterns - 1
+
+ ! ...sinon, on termine
+ else
+ inslst = 1
+ endif
+
+ endif
+
+ ! Si ISTMPF(IPHAS).EQ.0 (explicite) on ne traite pas le flux de
+ ! masse a la derniere iteration
+ ! Sinon on traite le flux de masse a toutes les iterations
+
+ ! On teste le flux de masse de la phase 1 (toutes les phases sont
+ ! necessairement traitees de la meme facon, cf. VERINI)
+ if( (istmpf(1).eq.0.and.inslst.eq.0) .or. istmpf(1).ne.0) then
+ iappel = 3
+ call schtmp &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+ ra )
+ endif
+
+ if (inslst.eq.1) goto 100
+
+ endif
+
+ endif ! Fin si calcul sur champ de vitesse figee
+
+ iterns = iterns + 1
+
+enddo
+
+100 continue
+
+! Calcul sur champ de vitesse fige SUITE (a cause de la boule U/P)
+if (iccvfg.eq.0) then
+!===============
+
+!===============================================================================
+! 14. DEPLACEMENT DES STRUCTURES EN ALE ET TEST DE BOUCLAGE IMPLICITE
+!===============================================================================
+
+ if (nbstru.gt.0.or.nbaste.gt.0) then
+
+ call strdep &
+ !==========
+ ( idbia1 , idbra1 , itrale , italim , itrfin , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nvar , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iflalf), ra(iflalb), ra(icoale), ra(iprale), ra(idepal), &
+ rdevel , rtuser , &
+ ra )
+
+ ! On boucle eventuellement sur de deplacement des structures
+ if (itrfin.ne.-1) then
+ italim = italim + 1
+ goto 300
+ endif
+
+ endif
+
+ ! --- On libere les tableaux IFLALF, IFLALB ICOALE et IPRALE
+
+ ! On ne passe dans SCHTMP que si ISTMPF(IPHAS).EQ.0 (explicite)
+ ! On teste le flux de masse de la phase 1 (toutes les phases sont
+ ! necessairement traitees de la meme facon, cf. VERINI)
+ ! pour conserver
+ if( istmpf(1).eq.0 ) then
+ iappel = 4
+ call schtmp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+ ra )
+ endif
+
+!===============================================================================
+! 15. RESOLUTION TURBULENCE
+!===============================================================================
+
+ iok = 0
+ if(iwarni(iu(1)).ge.1) then
+ do iphas = 1, nphas
+ if( itytur(iphas).eq.2 .or. itytur(iphas).eq.3 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60 ) then
+ iok = 1
+ endif
+ enddo
+ if(iok.eq.1) then
+ write(nfecra,1050)
+ endif
+ endif
+
+ do iphas = 1, nphas
+
+! Si on est en v2f, on reserve un tableau de taille NCELET pour
+! eviter de recalculer la production dans RESV2F (trois appels
+! a GRDCEL)
+ idbia1 = idebia
+ idbra1 = idebra
+ iprv2f = idebra
+ if (iturb(iphas).eq.50) then
+ idbra1 = iprv2f + ncelet
+! Pas la peine de tester les depassements de tableaux puisqu'on
+! passe juste apres dans MEMKEP
+ endif
+
+ if( (itytur(iphas).eq.2) .or. (iturb(iphas).eq.50) ) then
+
+ ikiph = ik (iphas)
+
+ call memkep &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , itinsk , itinse , idivu , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+ if(cdtvar(ikiph).ne.1.d0) then
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)*cdtvar(ikiph)
+ enddo
+ else
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)
+ enddo
+ endif
+
+ call turbke &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(idtr) , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ ra(iviscf) , ra(iviscb) , ra(iprv2f), &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , ra(itinsk) , ra(itinse),&
+ ra(idivu ) , ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iw4 ),&
+ ra(iw5 ) , ra(iw6 ) , ra(iw7 ) , ra(iw8 ) , ra(iw9 ),&
+ rdevel , rtuser , ra )
+
+ if( iturb(iphas).eq.50 ) then
+
+ iphiph = iphi(iphas)
+
+ call memv2f &
+ !==========
+ ( idbia1 , idbra1 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , iw10 , &
+ ifinia , ifinra )
+
+ if(cdtvar(iphiph).ne.1.d0) then
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)*cdtvar(iphiph)
+ enddo
+ else
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)
+ enddo
+ endif
+
+ call resv2f &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(idtr) , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ ra(iviscf) , ra(iviscb) , ra(iprv2f), &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iw4 ), &
+ ra(iw5 ) , ra(iw6 ) , ra(iw7 ) , ra(iw8 ) , ra(iw9 ),&
+ ra(iw10 ) , rdevel , rtuser , ra )
+
+ endif
+
+ ! RELAXATION DE K ET EPSILON SI IKECOU=0 EN INSTATIONNAIRE
+ if (ikecou(iphas).eq.0 .and. idtvar.ge.0) then
+ ikiph = ik (iphas)
+ ieiph = iep(iphas)
+ relaxk = relaxv(ikiph)
+ relaxe = relaxv(ieiph)
+ do iel = 1,ncel
+ rtp(iel,ikiph) = relaxk*rtp(iel,ikiph) + (1.d0-relaxk)*rtpa(iel,ikiph)
+ rtp(iel,ieiph) = relaxe*rtp(iel,ieiph) + (1.d0-relaxe)*rtpa(iel,ieiph)
+ enddo
+ endif
+
+ else if(itytur(iphas).eq.3) then
+
+ ir11ip = ir11(iphas)
+
+ call memrij &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iturb(iphas) , &
+ idtr , iviscf , iviscb , icoefx , &
+ idam , ixam , idrtp , &
+ ismbr , irovsd , igrdvt , iprodu , igrarx , igrary , igrarz , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+ if(cdtvar(ir11ip).ne.1.d0) then
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)*cdtvar(ir11ip)
+ enddo
+ else
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)
+ enddo
+ endif
+
+ call turrij &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(idtr) , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ ra(iviscf) , ra(iviscb) , ra(icoefx), &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , ra(igrdvt) , &
+ ra(iprodu) , ra(igrarx) , ra(igrary) , ra(igrarz) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iw4 ) , &
+ ra(iw5 ) , ra(iw6 ) , ra(iw7 ) , ra(iw8 ) , ra(iw9 ),&
+ rdevel , rtuser , ra )
+
+ else if( iturb(iphas).eq.60 ) then
+
+ ikiph = ik (iphas)
+
+ call memkom &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , itinsk , itinse , idivu , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+ if(cdtvar(ikiph).ne.1.d0) then
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)*cdtvar(ikiph)
+ enddo
+ else
+ do iel = 1, ncel
+ ra(idtr-1+iel) = dt(iel)
+ enddo
+ endif
+
+ call turbkw &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdc(iphas) , ncetsm(iphas) , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iicepd(iphas)) , ia(iicesm(iphas)) , ia(iitpsm(iphas)) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(idtr) , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , &
+ coefa , coefb , ra(ickupd(iphas)) , ra(ismace(iphas)) , &
+ ra(is2kw(iphas)), ra(idvukw(iphas)), &
+ ra(iviscf) , ra(iviscb) , &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , ra(itinsk) , ra(itinse),&
+ ra(idivu ) , ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iw4 ),&
+ ra(iw5 ) , ra(iw6 ) , ra(iw7 ) , ra(iw8 ) , ra(iw9 ),&
+ rdevel , rtuser , ra )
+
+ ! RELAXATION DE K ET OMEGA SI IKECOU=0
+ if (ikecou(iphas).eq.0 .and. idtvar.ge.0) then
+ ikiph = ik (iphas)
+ iomiph = iomg(iphas)
+ relaxk = relaxv(ikiph )
+ relaxw = relaxv(iomiph)
+ do iel = 1,ncel
+ rtp(iel,ikiph) = relaxk*rtp(iel,ikiph) +(1.d0-relaxk)*rtpa(iel,ikiph)
+ rtp(iel,iomiph) = relaxw*rtp(iel,iomiph)+(1.d0-relaxw)*rtpa(iel,iomiph)
+ enddo
+ endif
+
+ endif
+
+ enddo
+
+endif ! Fin si calcul sur champ de vitesse fige SUITE
+
+
+! Ici on peut liberer les eventuels tableaux SKW et DIVUKW
+
+!===============================================================================
+! 16. RESOLUTION DES SCALAIRES
+!===============================================================================
+
+
+if (nscal.ge.1 .and. iirayo.gt.0) then
+
+ if(iwarni(iu(1)).ge.1 .and. mod(ntcabs,nfreqr).eq.0) then
+ write(nfecra,1070)
+ endif
+
+ call memra2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+
+ icorua , icorub , iflxma , iflxmb , itek , &
+
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , iw10 , &
+ ifinia , ifinra )
+
+
+ call raydom &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iitypf) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iizfrd) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(icorua) , ra(icorub) , &
+ ra(iflxma) , ra(iflxmb) , &
+ ra(idtr) , ra(iviscf) , ra(iviscb) , &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , ra(itek) ,&
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iw4 ) , ra(iw5 ),&
+ ra(iw6 ) , ra(iw7 ) , ra(iw8 ) , ra(iw9 ) , &
+ ra(iw10 ) , &
+ rdevel , rtuser , &
+ ra )
+
+endif
+
+
+if (nscal.ge.1) then
+
+ if(iwarni(iu(1)).ge.1) then
+ write(nfecra,1060)
+ endif
+
+ call memsca &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , &
+ ifinia , ifinra )
+
+ call scalai &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , coefa , coefb , &
+ ra(idtr) , ra(iviscf) , ra(iviscb) , &
+ ra(idam ) , ra(ixam ) , &
+ ra(idrtp ) , ra(ismbr ) , ra(irovsd) , &
+ ra(iw1 ) , ra(iw2 ) , ra(iw3 ) , ra(iw4 ) , ra(iw5 ),&
+ ra(iw6 ) , ra(iw7 ) , ra(iw8 ) , ra(iw9 ) , &
+ rdevel , rtuser , &
+ ra )
+
+endif
+
+!===============================================================================
+! 17. TRAITEMENT DU FLUX DE MASSE, DE LA VISCOSITE,
+! DE LA MASSE VOLUMIQUE ET DE LA CHALEUR SPECIFIQUE POUR
+! UN THETA SCHEMA
+!===============================================================================
+
+
+iappel = 5
+call schtmp &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! 18. SORTIE DANS LE CAS DE "zero pas de temps" ET INIT ALE
+!===============================================================================
+
+ 200 continue
+
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' INITIALISATIONS ',/,&
+' =============== ',/)
+ 1010 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' CALCUL DES GRANDEURS PHYSIQUES ',/,&
+' ============================== ',/)
+ 1020 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' CALCUL DU CFL, DU FOURIER ET DU DT VARIABLE ',/,&
+' =========================================== ',/)
+ 1030 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' MISE EN PLACE DES CONDITIONS AUX LIMITES ',/,&
+' ======================================== ',/)
+ 1040 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' RESOLUTION DES EQUATIONS DE NAVIER-STOKES ',/,&
+' ========================================= ',/)
+ 1050 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' RESOLUTION DES EQUATIONS DES VARIABLES TURBULENTES ',/,&
+' ================================================== ',/)
+ 1060 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' RESOLUTION DES EQUATIONS SUR L''ENERGIE ET LES SCALAIRES ',/,&
+' ======================================================== ',/)
+ 1070 format(/, &
+ '------------------------------------------------------------',/,&
+ /,/,&
+ ' RESOLUTION DES TRANSFERTS THERMIQUES RADIATIFS ',/,&
+' ============================================== ',/)
+ 1080 format(/, &
+ '------------------------------------------------------------',/,&
+ /,/,&
+ ' RESOLUTION DE L''EQUATION DE MASSE ',/,&
+' ================================== ',/)
+
+ 4010 format(/, &
+' ** TEMPS CPU TOTAL POUR LA DISTANCE A LA PAROI : ',E14.5 ,/,&
+' ------------------------------------------- ',/)
+
+#else
+
+ 1000 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' INITIALISATIONS ',/,&
+' =============== ',/)
+ 1010 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' COMPUTATION OF PHYSICAL QUANTITIES ',/,&
+' ================================== ',/)
+ 1020 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' COMPUTATION OF CFL, FOURIER AND VARIABLE DT ',/,&
+' =========================================== ',/)
+ 1030 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' SETTING UP THE BOUNDARY CONDITIONS ',/,&
+' ================================== ',/)
+ 1040 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' SOLVING NAVIER-STOKES EQUATIONS ',/,&
+' =============================== ',/)
+ 1050 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' SOLVING TURBULENT VARIABLES EQUATIONS ',/,&
+' ===================================== ',/)
+ 1060 format(/, &
+' ------------------------------------------------------------',/,&
+ /,/,&
+' SOLVING ENERGY AND SCALARS EQUATIONS ',/,&
+' ==================================== ',/)
+ 1070 format(/, &
+ '------------------------------------------------------------',/,&
+ /,/,&
+ ' SOLVING THERMAL RADIATIVE TRANSFER ',/,&
+' ================================== ',/)
+ 1080 format(/, &
+ '------------------------------------------------------------',/,&
+ /,/,&
+ ' SOLVING MASS EQUATION ',/,&
+' ===================== ',/)
+
+ 4010 format(/, &
+' ** TOTAL CPU TIME FOR THE WALL DISTANCE: ',E14.5 ,/,&
+' ------------------------------------- ',/)
+
+#endif
+
+!----
+! FIN
+!----
+
+end subroutine
diff --git a/src/base/tsepdc.f90 b/src/base/tsepdc.f90
new file mode 100644
index 0000000..f9a4b4e
--- /dev/null
+++ b/src/base/tsepdc.f90
@@ -0,0 +1,265 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine tsepdc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , idiaex , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , trav , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES TERMES DE PERTE DE CHARGE
+! POUR LE BILAN EXPLICITE
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase courante !
+! idiaex ! e ! <-- ! indicateur de traitement de la !
+! ! ! ! diagonale (=1) ou extradiagonale (=2) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! trav(ncelet,3 ! tr ! <-- ! tableau des second membres !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+integer idiaex
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision trav(ncelet,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel , ielpdc
+integer iuiph , iviph , iwiph , ipcrom, ipcroo
+double precision romvom, vit1 , vit2 , vit3
+double precision cpdc11, cpdc22, cpdc33, cpdc12, cpdc13, cpdc23
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+ipcrom = ipproc(irom (iphas))
+
+ipcroo = ipcrom
+if(iroext(iphas).gt.0.and.isno2t(iphas).gt.0) then
+ ipcroo = ipproc(iroma (iphas))
+endif
+
+! La diagonale est toujours "implicite"
+
+if(idiaex.eq.1) then
+
+ do ielpdc = 1, ncepdp
+
+ iel = icepdc(ielpdc)
+ romvom =-propce(iel,ipcrom)*volume(iel)
+ cpdc11 = ckupdc(ielpdc,1)
+ cpdc22 = ckupdc(ielpdc,2)
+ cpdc33 = ckupdc(ielpdc,3)
+ vit1 = rtpa(iel,iuiph)
+ vit2 = rtpa(iel,iviph)
+ vit3 = rtpa(iel,iwiph)
+
+ trav(iel,1) = trav(iel,1) + &
+ romvom * ( cpdc11*vit1 )
+ trav(iel,2) = trav(iel,2) + &
+ romvom * ( cpdc22*vit2 )
+ trav(iel,3) = trav(iel,3) + &
+ romvom * ( cpdc33*vit3 )
+
+ enddo
+
+endif
+
+! L'extradiagonale est explicite mais peut etre extrapolee
+
+if(idiaex.eq.2) then
+
+ do ielpdc = 1, ncepdp
+
+ iel = icepdc(ielpdc)
+ romvom =-propce(iel,ipcroo)*volume(iel)
+ cpdc12 = ckupdc(ielpdc,4)
+ cpdc13 = ckupdc(ielpdc,5)
+ cpdc23 = ckupdc(ielpdc,6)
+ vit1 = rtpa(iel,iuiph)
+ vit2 = rtpa(iel,iviph)
+ vit3 = rtpa(iel,iwiph)
+
+ trav(iel,1) = trav(iel,1) + &
+ romvom * ( cpdc12*vit2 + cpdc13*vit3 )
+ trav(iel,2) = trav(iel,2) + &
+ romvom * ( cpdc12*vit1 + cpdc23*vit3 )
+ trav(iel,3) = trav(iel,3) + &
+ romvom * ( cpdc13*vit1 + cpdc23*vit2 )
+
+ enddo
+
+endif
+
+
+return
+
+end
diff --git a/src/base/tstvec.f90 b/src/base/tstvec.f90
new file mode 100644
index 0000000..af21d72
--- /dev/null
+++ b/src/base/tstvec.f90
@@ -0,0 +1,451 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine tstvec &
+!================
+
+ ( ncelet , ncel , nfac , nfabor , &
+ ifacel , ifabor , &
+ iworkf , ismbs , ismbv , &
+ rworkf , rsmbs , rsmbv )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DE LA VECTORISATION APRES RENUMEROTATION
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac /nfabor ! e ! <-- ! nombre total de faces internes/de brd !
+! ifacel ! te ! <-- ! no des elts voisins d'une face intern !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! no de l'elt voisin d'une face de bord !
+! nfabor ) ! ! ! !
+! iworkf(* ! te ! --- ! tab de trav de dim max(nfac,nfabor) !
+! ismbs (ncelet ! te ! --- ! tab de trav pour assemblage scalaire !
+! ismbv (ncelet ! te ! --- ! tab de trav pour assemblage vectoriel !
+! ipnfaw ! te ! --- ! tab de trav pour ipnfac !
+! (nfac+1) ! ! ! !
+! nodfaw ! te ! --- ! tab de trav pour nodfac !
+! (lndfac) ! ! ! !
+! ipnfbw ! te ! --- ! tab de trav pour ipnfbr !
+! (nfabor+1) ! ! ! !
+! nodfbw ! te ! --- ! tab de trav pour nodfbr !
+! (lndfbr) ! ! ! !
+! rworkf(* ! tr ! --- ! tab de trav de dim max(nfac,nfabor) !
+! rsmbs (ncelet ! tr ! --- ! tab de trav pour assemblage scalaire !
+! rsmbv (ncelet ! tr ! --- ! tab de trav pour assemblage vectoriel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "vector.h"
+include "entsor.h"
+
+! Arguments
+
+integer ncelet, ncel, nfac, nfabor
+integer irveci, irvecb
+integer ifacel(2,nfac),ifabor(nfabor)
+integer iworkf(*), ismbs(ncelet), ismbv(ncelet)
+double precision rworkf(*), rsmbs(ncelet), rsmbv(ncelet)
+
+! VARIABLES LOCALES
+
+integer ii, jj, iok, ifac
+integer iel, istop
+
+
+!===============================================================================
+
+! -----> Test d'assemblage sur des entiers
+
+istop = 0
+
+! --- Faces internes
+
+if(ivecti.eq.1) then
+
+ do ifac = 1, nfac
+ iworkf(ifac) = 1
+ enddo
+ do iel = 1, ncelet
+ ismbv(iel) = 0
+ ismbs(iel) = 0
+ enddo
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ ismbv(ii) = ismbv(ii) + iworkf(ifac)
+ ismbv(jj) = ismbv(jj) + iworkf(ifac)
+ enddo
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ ismbs(ii) = ismbs(ii) + iworkf(ifac)
+ ismbs(jj) = ismbs(jj) + iworkf(ifac)
+ enddo
+
+ iok = 0
+ do iel = 1, ncel
+ if(ismbs(iel).ne.ismbv(iel)) then
+ iok = iok - 1
+ endif
+ enddo
+
+ if(iok.ne.0) then
+ write(nfecra,3101)iok
+ istop = 1
+ endif
+
+endif
+
+! --- Faces de bord
+
+if(ivectb.eq.1) then
+
+ do ifac = 1, nfabor
+ iworkf(ifac) = 1
+ enddo
+ do iel = 1, ncel
+ ismbv(iel) = 0
+ ismbs(iel) = 0
+ enddo
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ ismbv(ii) = ismbv(ii) + iworkf(ifac)
+ enddo
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ ismbs(ii) = ismbs(ii) + iworkf(ifac)
+ enddo
+
+ iok = 0
+ do iel = 1, ncel
+ if(ismbs(iel).ne.ismbv(iel)) then
+ iok = iok - 1
+ endif
+ enddo
+
+ if(iok.ne.0) then
+ write(nfecra,3201)iok
+ istop = 1
+ endif
+
+endif
+
+
+! -----> Test d'assemblage sur des reels
+
+! --- Faces internes
+
+if(ivecti.eq.1) then
+
+ do ifac = 1, nfac
+ rworkf(ifac) = 1.d0
+ enddo
+ do iel = 1, ncelet
+ rsmbv(iel) = 0.d0
+ rsmbs(iel) = 0.d0
+ enddo
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ rsmbv(ii) = rsmbv(ii) + rworkf(ifac)
+ rsmbv(jj) = rsmbv(jj) + rworkf(ifac)
+ enddo
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ rsmbs(ii) = rsmbs(ii) + rworkf(ifac)
+ rsmbs(jj) = rsmbs(jj) + rworkf(ifac)
+ enddo
+
+ iok = 0
+ do iel = 1, ncel
+ if(abs(rsmbs(iel)-rsmbv(iel)).gt.1.d-20) then
+ iok = iok - 1
+ endif
+ enddo
+
+ if(iok.ne.0) then
+ write(nfecra,3102)iok
+ istop = 1
+ endif
+
+endif
+
+! --- Faces de bord
+
+if(ivectb.eq.1) then
+
+ do ifac = 1, nfabor
+ rworkf(ifac) = 1.d0
+ enddo
+ do iel = 1, ncel
+ rsmbv(iel) = 0.d0
+ rsmbs(iel) = 0.d0
+ enddo
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ rsmbv(ii) = rsmbv(ii) + rworkf(ifac)
+ enddo
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ rsmbs(ii) = rsmbs(ii) + rworkf(ifac)
+ enddo
+
+ iok = 0
+ do iel = 1, ncel
+ if(abs(rsmbs(iel)-rsmbv(iel)).gt.1.d-20) then
+ iok = iok - 1
+ endif
+ enddo
+
+ if(iok.ne.0) then
+ write(nfecra,3202)iok
+ istop = 1
+ endif
+
+endif
+
+if(istop.ne.0) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+!===============================================================================
+! 6. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 3101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS tstvec ',/,&
+'@ ========= ',/,&
+'@ PROBLEME D''ASSEMBLAGE D''ENTIERS AUX FACES INTERNES ',/,&
+'@ ',I10 ,' OCCURRENCES DU PROBLEME ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3201 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS tstvec ',/,&
+'@ ========= ',/,&
+'@ PROBLEME D''ASSEMBLAGE D''ENTIERS AUX FACES DE BORD ',/,&
+'@ ',I10 ,' OCCURRENCES DU PROBLEME ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3102 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS tstvec ',/,&
+'@ ========= ',/,&
+'@ PROBLEME D''ASSEMBLAGE DE REELS AUX FACES INTERNES ',/,&
+'@ ',I10 ,' OCCURRENCES DU PROBLEME ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3202 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS tstvec ',/,&
+'@ ========= ',/,&
+'@ PROBLEME D''ASSEMBLAGE DE REELS AUX FACES DE BORD ',/,&
+'@ ',I10 ,' OCCURRENCES DU PROBLEME ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9000 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS tstvec ',/,&
+'@ ========= ',/,&
+'@ CONFIGURATION IMPREVUE A LA RENUMEROTATION DES FACES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 3101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN tstvec ',/,&
+'@ ======== ',/,&
+'@ PROBLEM IN ASSEMBLING INTEGERS AT THE INTERIOR FACES ',/,&
+'@ ',I10 ,' OCCURRENCES OF THE PROBLEM ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3201 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN tstvec ',/,&
+'@ ======== ',/,&
+'@ PROBLEM IN ASSEMBLING INTEGERS AT THE BOUNDARY FACES ',/,&
+'@ ',I10 ,' OCCURRENCES OF THE PROBLEM ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3102 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN tstvec ',/,&
+'@ ======== ',/,&
+'@ PROBLEM IN ASSEMBLING REALS AT THE INTERIOR FACES ',/,&
+'@ ',I10 ,' OCCURRENCES OF THE PROBLEM ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3202 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN tstvec ',/,&
+'@ ======== ',/,&
+'@ PROBLEM IN ASSEMBLING REALS AT THE BOUNDARY FACES ',/,&
+'@ ',I10 ,' OCCURRENCES OF THE PROBLEM ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9000 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN tstvec ',/,&
+'@ ======== ',/,&
+'@ UNEXPECTED CONFIGURATION DURING THE FACES RENUMBERING ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the mesh. ',/,&
+'@ Contact the support. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+return
+end
diff --git a/src/base/turbke.f90 b/src/base/turbke.f90
new file mode 100644
index 0000000..2ebaee5
--- /dev/null
+++ b/src/base/turbke.f90
@@ -0,0 +1,1612 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine turbke &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , coefa , coefb , ckupdc , smacel , &
+ viscf , viscb , prdv2f , &
+ dam , xam , &
+ drtp , smbrk , smbre , tinstk , tinste , &
+ divu , w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS K-EPS 1 PHASE INCOMPRESSIBLE OU
+! RHO VARIABLE SUR UN PAS DE TEMPS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! prdv2f(ncelet ! tr ! <-- ! tableau de stockage du terme de !
+! ! ! ! prod de turbulence pour le v2f !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr.(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! tinst.(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! divu(ncelet ! tr ! --- ! tableau de travail !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision tslagr(ncelet,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision viscf(nfac), viscb(nfabor)
+double precision prdv2f(ncelet)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrk(ncelet), smbre(ncelet)
+double precision tinstk(ncelet), tinste(ncelet), divu(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra, ifinia
+integer iel , ifac , init , inc , iccocg, ivar
+integer iivar , iiun
+integer iclip , isqrt
+integer nswrgp, imligp, iphydp
+integer ipriph, iuiph , iviph , iwiph
+integer ikiph , ieiph , iphiph
+integer icliup, iclivp, icliwp
+integer iclvar, iclvaf
+integer iconvp, idiffp, ndircp, ireslp
+integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer ipcrom, ipbrom, ipcvst, ipcvis, iflmas, iflmab
+integer iwarnp, ipp
+integer iptsta
+integer ipcroo, ipbroo, ipcvto, ipcvlo
+integer maxelt, ils
+double precision rnorm , d2s3, divp23
+double precision deltk , delte, a11, a12, a22, a21
+double precision gravke, epssuk, unsdet, romvsd
+double precision prdtur, xk, xeps, xphi, xnu, ttke, ttmin, tt
+double precision visct , rom , ceps1 , ctsqnu
+double precision blencp, epsilp, epsrgp, climgp, extrap, relaxp
+double precision epsrsp
+double precision thetp1, thetak, thetae, thets, thetap
+double precision tuexpk, tuexpe
+double precision cmueta, sqrcmu, xs
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipriph = ipr (iphas)
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+ikiph = ik (iphas)
+ieiph = iep (iphas)
+iphiph = iphi(iphas)
+
+icliup = iclrtp(iuiph,icoef)
+iclivp = iclrtp(iviph,icoef)
+icliwp = iclrtp(iwiph,icoef)
+
+ipcrom = ipproc(irom (iphas))
+ipcvst = ipproc(ivisct(iphas))
+ipcvis = ipproc(iviscl(iphas))
+iflmas = ipprof(ifluma(iuiph))
+iflmab = ipprob(ifluma(iuiph))
+ipbrom = ipprob(irom (iphas))
+
+thets = thetst(iphas)
+
+ipcroo = ipcrom
+ipbroo = ipbrom
+ipcvto = ipcvst
+ipcvlo = ipcvis
+if(isto2t(iphas).gt.0) then
+ if (iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+ ipbroo = ipprob(iroma(iphas))
+ endif
+ if(iviext(iphas).gt.0) then
+ ipcvto = ipproc(ivista(iphas))
+ ipcvlo = ipproc(ivisla(iphas))
+ endif
+endif
+
+if(isto2t(iphas).gt.0) then
+ iptsta = ipproc(itstua(iphas))
+else
+ iptsta = 0
+endif
+
+if(iwarni(ikiph).ge.1) then
+ if (iturb(iphas).eq.20) then
+ write(nfecra,1000)iphas
+ else if (iturb(iphas).eq.21) then
+ write(nfecra,1001)iphas
+ else
+ write(nfecra,1002)iphas
+ endif
+endif
+
+! Pour la prod lineaire on a besoin de SQRT(Cmu)
+sqrcmu = sqrt(cmu)
+
+!===============================================================================
+! 2. CALCUL DE SIJ SIJ ET DE DIVU
+
+! Tableaux de travail SMBRK,TINSTE,W1,W2,W3,W4,W5,W6
+! SijSij est stocke dans TINSTK
+! DivU est stocke dans DIVU
+! En sortie de l'etape on conserve TINSTK, DIVU
+!===============================================================================
+
+iccocg = 1
+inc = 1
+
+! ON S'APPUIE SUR LES TABLEAUX DE TRAVAIL W4,W5,W6
+! ON UTILISE EGALEMENT SMBRK ET TINSTE COMME
+! TABLEAUX DE TRAVAIL TEMPORAIRES
+! W1,W2,W3 SONT UTILISES DANS GRDCEL
+! TINSTK RECOIT LA PRODUCTION
+! TINSTK = {(2 (S11)**2 + 2 (S22)**2 +2 (S33)**2 )
+! + ((2 S12)**2 + (2 S13)**2 +(2 S23)**2 )}
+! = 2 Sij.Sij
+
+
+! SMBRK = DUDX ,W4 = DUDY ,W5 = DUDZ
+
+nswrgp = nswrgr(iuiph)
+imligp = imligr(iuiph)
+iwarnp = iwarni(ikiph)
+epsrgp = epsrgr(iuiph)
+climgp = climgr(iuiph)
+extrap = extrag(iuiph)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iuiph) , coefa(1,icliup) , coefb(1,icliup) , &
+ smbrk , w4 , w5 , &
+! ------ ------ ------
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+
+! TINSTK = (S11)**2
+! DIVU = DUDX
+
+do iel = 1, ncel
+ tinstk(iel) = smbrk(iel)**2
+ divu (iel) = smbrk(iel)
+enddo
+
+! ,W4 = DUDY ,W5 = DUDZ
+! TINSTE = DVDX ,SMBRK = DVDY ,W6 = DVDZ
+
+nswrgp = nswrgr(iviph)
+imligp = imligr(iviph)
+iwarnp = iwarni(ikiph)
+epsrgp = epsrgr(iviph)
+climgp = climgr(iviph)
+extrap = extrag(iviph)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iviph) , coefa(1,iclivp) , coefb(1,iclivp) , &
+ tinste , smbrk , w6 , &
+! ------ ------ ------
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+
+! TINSTK = 2 (S11)**2 + 2 (S22)**2
+! + (2 S12)**2
+! DIVU = DUDX + DVDY
+
+do iel = 1, ncel
+ tinstk (iel) = 2.d0*(tinstk(iel) + smbrk(iel)**2 ) &
+ + (tinste(iel)+w4(iel))**2
+ divu (iel) = divu(iel) + smbrk(iel)
+enddo
+
+! , ,W5 = DUDZ
+! , ,W6 = DVDZ
+! W4 = DWDX ,TINSTE = DWDY ,SMBRK = DWDZ
+
+nswrgp = nswrgr(iwiph)
+imligp = imligr(iwiph)
+iwarnp = iwarni(ikiph)
+epsrgp = epsrgr(iwiph)
+climgp = climgr(iwiph)
+extrap = extrag(iwiph)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iwiph) , coefa(1,icliwp) , coefb(1,icliwp) , &
+ w4 , tinste , smbrk , &
+! ------ ------ ------
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+! TINSTK = PRODUCTION = (
+! 2 (S11)**2 + 2 (S22)**2 + 2 (S33)**2
+! + (2 S12)**2 + (2 S13)**2 + (2 S23)**2 )
+! DIVU = DUDX + DVDY + DWDZ
+
+do iel = 1, ncel
+ tinstk (iel) = tinstk(iel) + 2.d0*smbrk(iel)**2 &
+ + (w4(iel)+w5(iel))**2 &
+ + (tinste(iel)+w6(iel))**2
+ divu (iel) = divu(iel) + smbrk(iel)
+enddo
+
+! On libere SMBRK,TINSTE,W1,W2,W3,W4,W5,W6
+
+!===============================================================================
+! 3. PRISE EN COMPTE DES TERMES SOURCES UTILISATEURS
+
+! On passe 2 Sij.Sij = TINSTK et la divergence DIVU
+! Tableaux de travail W1, W2, W3, W4, W5, W6
+! VISCF VISCB XAM DRTP SMBRK SMBRE TINSTE
+! La partie a expliciter est stockee dans W7, W8
+! La partie a impliciter est stockee dans DAM, W9
+! En sortie de l'etape on conserve TINSTK, DIVU,
+! W7 , W8, DAM, W9
+!===============================================================================
+! viscf viscb xam drtp smbrk smbre tinste
+do iel = 1, ncel
+ dam(iel) = 0.d0
+ w9 (iel) = 0.d0
+ w7 (iel) = 0.d0
+ w8 (iel) = 0.d0
+enddo
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('TURBKE',IFINIA)
+
+call ustske &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , tinstk , divu , &
+ w7 , w8 , dam , w9 , &
+! ------ ------ ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ drtp , smbrk , smbre , tinste , &
+ rdevel , rtuser , ra )
+
+! On libere W1, W2, W3, W4, W5, W6
+! VISCF, VISCB, XAM, DRTP, SMBRK, SMBRE, TINSTE
+!===============================================================================
+! 4. AJOUT DE - 2/3 DIV(U) * DIV(U)
+
+! En sortie de l'etape on conserve TINSTK, DIVU,
+! W7 , W8, DAM, W9
+!===============================================================================
+
+! Dans le cas de la production lineaire, seul le terme en divu est
+! multiplie par VISCT. Pour les autres modeles, la multiplication par
+! VISCT sera faite ulterieurement.
+! A ce stade, TINSTK contient S**2
+d2s3 = 2.d0/3.d0
+if (iturb(iphas).eq.21) then
+ do iel = 1, ncel
+ rom = propce(iel,ipcroo)
+ visct = propce(iel,ipcvto)
+ xs = sqrt(tinstk(iel))
+ cmueta = cmu*rtpa(iel,ikiph)/rtpa(iel,ieiph)*xs
+ cmueta = min(cmueta,sqrcmu)
+ tinstk(iel) = rom*cmueta*xs*rtpa(iel,ikiph) &
+ - d2s3*visct*divu(iel)*divu(iel)
+ enddo
+else
+ do iel = 1, ncel
+ tinstk(iel) = tinstk(iel) - d2s3*divu(iel)*divu(iel)
+ enddo
+endif
+
+!===============================================================================
+! 5. CALCUL DU TERME DE GRAVITE
+
+! Les s.m. recoivent production et termes de gravite
+! Tableaux de travail W1,W2,W3,W4,W5,W6,VISCB
+! Les s.m. sont stockes dans TINSTK TINSTE
+! En sortie de l'etape on conserve TINSTK, TINSTE,
+! DIVU,
+! W7 , W8, DAM, W9
+!===============================================================================
+
+if (igrake(iphas).eq.1 .and. ippmod(iatmos).ge.1) then
+
+ ! Calcul du terme de gravite pour la version atmospherique
+
+ call atprke &
+ !==========
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , ipcvto, &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ tinstk , tinste , &
+ rdevel , rtuser , ra )
+
+else if (igrake(iphas).eq.1) then
+
+! --- Terme de gravite G = BETA*G*GRAD(SCA)/PRDTUR/RHO
+! Ici on calcule G =-G*GRAD(RHO)/PRDTUR/RHO
+
+ iccocg = 1
+ inc = 1
+
+! Le choix ci dessous a l'avantage d'etre simple
+
+ nswrgp = nswrgr(ikiph)
+ epsrgp = epsrgr(ikiph)
+ imligp = imligr(ikiph)
+ iwarnp = iwarni(ikiph)
+ climgp = climgr(ikiph)
+ extrap = extrag(ikiph)
+
+! Conditions aux limites sur ROM : Dirichlet ROMB
+! On utilise VISCB pour stocker le COEFB relatif a ROM
+! On impose en Dirichlet (COEFA) la valeur ROMB
+
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ iivar = 0
+
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ propce(1,ipcroo), propfb(1,ipbroo), viscb , &
+ w4 , w5 , w6 , &
+! ------ ------ ------
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+
+! Production et terme de gravite
+! TINSTK=P+G et TINSTE=P+(1-CE3)*G
+
+ if(iscalt(iphas).gt.0.and.nscal.ge.iscalt(iphas)) then
+ prdtur = sigmas(iscalt(iphas))
+ else
+ prdtur = 1.d0
+ endif
+
+! En production lineaire, on multiplie tout de suite le terme
+! de gravite par VISCT, car le reste est deja multiplie.
+! Dans les autres cas, la multiplication est faite plus tard.
+ if (iturb(iphas).eq.21) then
+ do iel = 1, ncel
+ gravke = -(w4(iel)*gx+w5(iel)*gy+w6(iel)*gz)/ &
+ (propce(iel,ipcroo)*prdtur)
+ tinste(iel)=tinstk(iel)+propce(iel,ipcvto)*max(gravke,zero)
+ tinstk(iel)=tinstk(iel)+propce(iel,ipcvto)*gravke
+ enddo
+ else
+ do iel = 1, ncel
+ gravke = -(w4(iel)*gx+w5(iel)*gy+w6(iel)*gz)/ &
+ (propce(iel,ipcroo)*prdtur)
+ tinste(iel) = tinstk(iel) + max( gravke,zero )
+ tinstk(iel) = tinstk(iel) + gravke
+ enddo
+ endif
+
+else
+
+
+! --- Production sans termes de gravite
+! TINSTK=TINSTE=P
+
+ do iel = 1, ncel
+ tinste(iel) = tinstk(iel)
+ enddo
+
+endif
+
+! En V2F, on stocke TINSTK dans PRDV2F qui sera complete plus loin pour
+! contenir le terme de production complet
+if (iturb(iphas).eq.50) then
+ do iel = 1, ncel
+ prdv2f(iel) = tinstk(iel)
+ enddo
+endif
+
+! On libere W1,W2,W3,W4,W5,W6,VISCB
+
+!===============================================================================
+! 6. TERME D'ACCUMULATION DE MASSE -(dRO/dt)*Volume
+
+! Le terme est stocke dans W1
+! En sortie de l'etape on conserve W1, TINSTK, TINSTE, DIVU,
+! W7 , W8, DAM, W9
+!===============================================================================
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w1)
+
+!===============================================================================
+! 7. ON FINALISE LE CALCUL DES TERMES SOURCES
+
+! Les termes sont stockes dans SMBRK, SMBRE
+! En sortie de l'etape on conserve W1, TINSTK, TINSTE, DIVU,
+! SMBRK, SMBRE
+! W7 , W8, DAM, W9
+!===============================================================================
+
+! SMBRE = CEPS1 EPSILON/K (PROD + G ) - RO0 VOLUME EPSILON EPSILON/K
+! SMBRK = PROD + G - RO0 VOLUME EPSILON
+
+! Si on extrapole les termes sources et rho , il faut ici rho^n
+! et visct, il faut ici visct^n
+
+if (iturb(iphas).eq.20) then
+
+ do iel = 1, ncel
+
+ visct = propce(iel,ipcvto)
+ rom = propce(iel,ipcroo)
+
+ smbrk(iel) = volume(iel)*( &
+ visct*tinstk(iel) &
+ -d2s3*rom*rtpa(iel,ikiph)*divu(iel) &
+ -rom*rtpa(iel,ieiph) )
+
+ smbre(iel) = volume(iel)*rtpa(iel,ieiph)/rtpa(iel,ikiph)*( &
+ ce1*( visct*tinste(iel) &
+ -d2s3*rom*rtpa(iel,ikiph)*divu(iel) ) &
+ -ce2*rom*rtpa(iel,ieiph) )
+
+ enddo
+
+else if (iturb(iphas).eq.21) then
+
+ do iel = 1, ncel
+
+ rom = propce(iel,ipcroo)
+
+ smbrk(iel) = volume(iel)*( &
+ tinstk(iel) &
+ -d2s3*rom*rtpa(iel,ikiph)*divu(iel) &
+ -rom*rtpa(iel,ieiph) )
+
+ smbre(iel) = volume(iel)*rtpa(iel,ieiph)/rtpa(iel,ikiph)*( &
+ ce1*(tinste(iel) &
+ -d2s3*rom*rtpa(iel,ikiph)*divu(iel) ) &
+ -ce2*rom*rtpa(iel,ieiph) )
+
+ enddo
+
+else if (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+
+ visct = propce(iel,ipcvto)
+ rom = propce(iel,ipcroo)
+ xeps = rtpa(iel,ieiph )
+ xk = rtpa(iel,ikiph )
+ xphi = rtpa(iel,iphiph)
+ xphi = max(xphi,epzero)
+ xnu = propce(iel,ipcvlo)/rom
+ ceps1= 1.4d0*(1.d0+cv2fa1*sqrt(1.d0/xphi))
+ ttke = xk / xeps
+ ttmin = cv2fct*sqrt(xnu/xeps)
+ tt = max(ttke,ttmin)
+
+ smbrk(iel) = volume(iel)*( &
+ visct*tinstk(iel) &
+ -d2s3*rom*rtpa(iel,ikiph)*divu(iel) &
+ -rom*rtpa(iel,ieiph) )
+
+ smbre(iel) = volume(iel)/tt*( &
+ ceps1*( visct*tinste(iel) &
+ -d2s3*rom*rtpa(iel,ikiph)*divu(iel) ) &
+ -cv2fe2*rom*rtpa(iel,ieiph) )
+
+! On stocke la partie en Pk dans PRDV2F pour etre reutilise dans RESV2F
+ prdv2f(iel) = visct*prdv2f(iel) &
+ -d2s3*rom*rtpa(iel,ikiph)*divu(iel)
+
+ enddo
+
+endif
+
+
+!===============================================================================
+! 8. PRISE EN COMPTE DES TERMES SOURCES UTILISATEURS
+! ET ACCUMULATION DE MASSE : PARTIE EXPLICITE
+! On utilise W1, W7, W8, DAM, W9
+! Les termes sont stockes dans SMBRK, SMBRE
+! En sortie de l'etape on conserve W1, TINSTK, TINSTE, DIVU,
+! SMBRK, SMBRE
+! DAM, W9
+
+! Remarque : l'extrapolation telle qu'elle est ecrite n'a pas grand
+! sens si IKECOU=1
+!===============================================================================
+
+! Si on extrapole les T.S.
+if(isto2t(iphas).gt.0) then
+
+ do iel = 1, ncel
+
+! Sauvegarde pour echange
+ tuexpk = propce(iel,iptsta)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta) = smbrk(iel) + w7(iel)
+! Termes dependant de la variable resolue et theta PROPCE
+ smbrk(iel) = iconv(ikiph)*w1(iel)*rtpa(iel,ikiph) &
+ - thets*tuexpk
+! On suppose -DAM > 0 : on implicite
+! le terme utilisateur dependant de la variable resolue
+ smbrk(iel) = dam(iel)*rtpa(iel,ikiph) + smbrk(iel)
+
+! Sauvegarde pour echange
+ tuexpe = propce(iel,iptsta+1)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta+1) = smbre(iel) + w8(iel)
+! Termes dependant de la variable resolue et theta PROPCE
+ smbre(iel) = iconv(ieiph)*w1(iel)*rtpa(iel,ieiph) &
+ - thets*tuexpe
+! On suppose -W9 > 0 : on implicite
+! le terme utilisateur dependant de la variable resolue
+ smbre(iel) = w9(iel)*rtpa(iel,ieiph) + smbre(iel)
+
+ enddo
+
+! Si on n'extrapole pas les T.S.
+else
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) + dam(iel)*rtpa(iel,ikiph) + w7(iel) &
+ +iconv(ikiph)*w1(iel)*rtpa(iel,ikiph)
+ smbre(iel) = smbre(iel) + w9 (iel)*rtpa(iel,ieiph) + w8(iel) &
+ +iconv(ieiph)*w1(iel)*rtpa(iel,ieiph)
+ enddo
+endif
+
+!===============================================================================
+! 8.1 PRISE EN COMPTE DES TERMES SOURCES LAGRANGIEN : PARTIE EXPLICITE
+! COUPLAGE RETOUR
+!===============================================================================
+
+! Ordre 2 non pris en compte
+if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.ilphas) then
+
+ do iel = 1,ncel
+
+! Termes sources explicte et implicte sur k
+
+ smbrk(iel) = smbrk(iel) + tslagr(iel,itske)
+
+! Termes sources explicte sur Eps
+
+ smbre(iel) = smbre(iel) &
+ + ce4 *tslagr(iel,itske) *rtpa(iel,ieiph) &
+ /rtpa(iel,ikiph)
+
+ enddo
+
+endif
+
+! ON LIBERE W7, W8
+
+!===============================================================================
+! 9. PRISE EN COMPTE DES TERMES DE CONV/DIFF DANS LE SECOND MEMBRE
+
+! Tableaux de travail W2, W3, W4, W5, W6, DRTP
+! Les termes sont stockes dans W7 et W8, puis ajoutes a SMBRK, SMBRE
+! En sortie de l'etape on conserve W1, TINSTK, TINSTE, DIVU,
+! SMBRK, SMBRE
+! DAM, W7, W8, W9
+!===============================================================================
+
+! Ceci ne sert a rien si IKECOU n'est pas egal a 1
+
+if (ikecou(iphas).eq.1) then
+
+ do iel = 1, ncel
+ w7 (iel) = 0.d0
+ w8 (iel) = 0.d0
+ enddo
+
+! ---> Traitement de k
+
+ ivar = ikiph
+
+ ipp = ipprtp(ivar)
+
+ iclvar = iclrtp(ivar,icoef )
+ iclvaf = iclrtp(ivar,icoeff)
+ chaine = nomvar(ipp)
+
+ if( idiff(ivar).ge. 1 ) then
+
+ do iel = 1, ncel
+ w4(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigmak
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w4 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+ else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ endif
+
+ iccocg = 1
+ inc = 1
+ iconvp = iconv (ivar)
+ idiffp = idiff (ivar)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ ircflp = ircflu(ivar)
+ ischcp = ischcv(ivar)
+ isstpp = isstpc(ivar)
+ iwarnp = iwarni(ivar)
+ blencp = blencv(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ relaxp = relaxv(ivar)
+ thetap = thetav(ivar)
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ w7 , &
+! --
+ w2 , w3 , w4 , w5 , w6 , drtp , &
+ rdevel , rtuser , ra )
+
+ if (iwarni(ivar).ge.2) then
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,smbrk,smbrk,rnorm)
+ write(nfecra,1100) chaine(1:8) ,rnorm
+ endif
+
+
+! ---> Traitement de epsilon
+
+ ivar = ieiph
+
+ ipp = ipprtp(ivar)
+
+ iclvar = iclrtp(ivar,icoef )
+ iclvaf = iclrtp(ivar,icoeff)
+ chaine = nomvar(ipp)
+
+ if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ w4(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigmae
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w4 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+ else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ endif
+
+ iccocg = 1
+ inc = 1
+ iconvp = iconv (ivar)
+ idiffp = idiff (ivar)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ ircflp = ircflu(ivar)
+ ischcp = ischcv(ivar)
+ isstpp = isstpc(ivar)
+ iwarnp = iwarni(ivar)
+ blencp = blencv(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ relaxp = relaxv(ivar)
+ thetap = thetav(ivar)
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ w8 , &
+! --
+ w2 , w3 , w4 , w5 , w6 , drtp , &
+ rdevel , rtuser , ra )
+
+ if (iwarni(ivar).ge.2) then
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,smbre,smbre,rnorm)
+ write(nfecra,1100) chaine(1:8) ,rnorm
+ endif
+
+ do iel = 1,ncel
+ smbrk(iel) = smbrk(iel) + w7(iel)
+ smbre(iel) = smbre(iel) + w8(iel)
+ enddo
+
+endif
+
+!===============================================================================
+! 10. AJOUT DES TERMES SOURCES DE MASSE EXPLICITES
+
+! Les parties implicites eventuelles sont conservees dans W2 et W3
+! et utilisees dans la phase d'implicitation cv/diff
+
+! Les termes sont stockes dans SMBRK, SMBRE, W2, W3
+! En sortie de l'etape on conserve W1, TINSTK, TINSTE, DIVU,
+! SMBRK, SMBRE
+! DAM, W9, W2, W3
+!===============================================================================
+
+if (ncesmp.gt.0) then
+
+ do iel = 1, ncel
+ w2(iel) = 0.d0
+ w3(iel) = 0.d0
+ enddo
+
+! Entier egal a 1 (pour navsto : nb de sur-iter)
+ iiun = 1
+
+! On incremente SMBRS par -Gamma RTPA et ROVSDT par Gamma (*theta)
+ ivar = ikiph
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , &
+ isto2t(iphas) , thetav(ivar) , &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipriph) , &
+ smbrk , w2 , w4 )
+ ivar = ieiph
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , &
+ isto2t(iphas) , thetav(ivar) , &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipriph) , &
+ smbre , w3 , w5 )
+
+! Si on extrapole les TS on met Gamma Pinj dans PROPCE
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = propce(iel,iptsta ) + w4(iel)
+ propce(iel,iptsta+1) = propce(iel,iptsta+1) + w5(iel)
+ enddo
+! Sinon on le met directement dans SMBR
+ else
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) + w4(iel)
+ smbre(iel) = smbre(iel) + w5(iel)
+ enddo
+ endif
+
+endif
+
+! ON LIBERE W4, W5, W6, TINSTE
+
+! Finalisation des termes sources
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) + thetp1 * propce(iel,iptsta)
+ smbre(iel) = smbre(iel) + thetp1 * propce(iel,iptsta+1)
+ enddo
+endif
+
+!===============================================================================
+! 11. INCREMENTS DES TERMES SOURCES DANS LE SECOND MEMBRE
+
+! On utilise TINSTK, TINSTE, DIVU
+! Les termes sont stockes dans SMBRK, SMBRE
+! En sortie de l'etape on conserve W1, SMBRK, SMBRE,
+! DAM, W9, W2, W3, W7, W8
+!===============================================================================
+
+! Ordre 2 non pris en compte
+if(ikecou(iphas).eq.1) then
+
+ if (iturb(iphas).eq.20) then
+
+ do iel = 1, ncel
+
+ rom = propce(iel,ipcrom)
+
+! RESOLUTION COUPLEE
+
+ romvsd=1.d0/(rom*volume(iel))
+ smbrk(iel)=smbrk(iel)*romvsd
+ smbre(iel)=smbre(iel)*romvsd
+ divp23= d2s3*max(divu(iel),zero)
+
+ epssuk = rtpa(iel,ieiph)/rtpa(iel,ikiph)
+
+ a11 = 1.d0/dt(iel) &
+ -2.d0*rtpa(iel,ikiph)/rtpa(iel,ieiph) &
+ *cmu*min(tinstk(iel),zero)+divp23
+ a12 = 1.d0
+ a21 = -ce1*cmu*tinste(iel)-ce2*epssuk*epssuk
+ a22 = 1.d0/dt(iel)+ce1*divp23 &
+ +2.d0*ce2*epssuk
+
+ unsdet = 1.d0/(a11*a22 -a12*a21)
+
+ deltk = ( a22*smbrk(iel) -a12*smbre(iel) )*unsdet
+ delte = (-a21*smbrk(iel) +a11*smbre(iel) )*unsdet
+
+! NOUVEAU TERME SOURCE POUR CODITS
+
+ romvsd = rom*volume(iel)/dt(iel)
+
+ smbrk(iel) = romvsd*deltk
+ smbre(iel) = romvsd*delte
+
+ enddo
+
+! Dans verini on bloque la combinaison ITURB=21/IKECOU=1
+ else if (iturb(iphas).eq.21) then
+
+ WRITE(NFECRA,*)'IKECOU=1 NON VALIDE EN K-EPS PROD LIN'
+ call csexit (1)
+! Section non totalement validee (a priori ca marche, mais pas trop stable) :
+! en fait le v2f est meilleur avec IKECOU=0, on bloque donc la combinaison
+! ITURB=50/IKECOU=1 au niveau de verini. Ces lignes sont donc inaccessibles.
+! On les laisse au cas ou .....
+ else if (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+
+ rom = propce(iel,ipcrom)
+
+! RESOLUTION COUPLEE
+
+ romvsd=1.d0/(rom*volume(iel))
+ smbrk(iel)=smbrk(iel)*romvsd
+ smbre(iel)=smbre(iel)*romvsd
+ divp23= d2s3*max(divu(iel),zero)
+
+ xeps = rtpa(iel,ieiph )
+ xk = rtpa(iel,ikiph )
+ xphi = rtpa(iel,iphiph)
+ xphi = max(xphi,epzero)
+ xnu = propce(iel,ipcvis)/propce(iel,ipcrom)
+ ctsqnu= cv2fct*sqrt(xnu)
+ ceps1= 1.4d0*(1.d0+cv2fa1*sqrt(1.d0/xphi))
+ epssuk = xeps/xk
+ ttke = xk / xeps
+ ttmin = cv2fct*sqrt(xnu/xeps)
+
+ if(ttke.gt.ttmin) then
+ a11 = 1.d0/dt(iel) &
+ -2.d0*xk/xeps*xphi &
+ *cv2fmu*min(tinstk(iel),zero)+divp23
+! Pour A12 on fait comme en k-eps standard pour l'instant,
+! on ne prend pas le terme en P+G ... est-ce judicieux ?
+ a12 = 1.d0
+ a21 = -ceps1*cv2fmu*xphi*tinste(iel)-cv2fe2*epssuk*epssuk
+ a22 = 1.d0/dt(iel)+ceps1*divp23 &
+ +2.d0*cv2fe2*epssuk
+ else
+ a11 = 1.d0/dt(iel) &
+ -cv2fmu*xphi*ctsqnu*min(tinstk(iel),zero)/sqrt(xeps) &
+ +divp23
+! Pour A12 on fait comme en k-eps standard pour l'instant,
+! on ne prend pas le terme en P+G ... est-ce judicieux ?
+ a12 = 1.d0
+! Le terme en DIVP23 dans A21 n'est pas forcement judicieux
+! (a-t-on besoin du MAX ?)
+ a21 = -ceps1*cv2fmu*xphi*tinste(iel) &
+ +ceps1*sqrt(xeps)/ctsqnu*divp23
+ a22 = 1.d0/dt(iel)+1.d0/2.d0*ceps1*divp23*xk &
+ /ctsqnu/sqrt(xeps) &
+ +3.d0/2.d0*cv2fe2/ctsqnu*sqrt(xeps)
+ endif
+
+ unsdet = 1.d0/(a11*a22 -a12*a21)
+
+ deltk = ( a22*smbrk(iel) -a12*smbre(iel) )*unsdet
+ delte = (-a21*smbrk(iel) +a11*smbre(iel) )*unsdet
+
+! NOUVEAU TERME SOURCE POUR CODITS
+
+ romvsd = rom*volume(iel)/dt(iel)
+
+ smbrk(iel) = romvsd*deltk
+ smbre(iel) = romvsd*delte
+
+ enddo
+
+ endif
+
+endif
+
+! ON LIBERE TINSTK, TINSTE, DIVU
+
+!===============================================================================
+! 12. TERMES INSTATIONNAIRES
+
+! On utilise W1, W2, W3, W7, W8
+! DAM, W9
+! Les termes sont stockes dans TINSTK, TINSTE
+! En sortie de l'etape on conserve SMBRK, SMBRE, TINSTK, TINSTE
+!===============================================================================
+
+! --- PARTIE EXPLICITE
+
+! on enleve la convection/diffusion au temps n a SMBRK et SMBRE
+! si on les avait calcules
+if (ikecou(iphas).eq.1) then
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) - w7(iel)
+ smbre(iel) = smbre(iel) - w8(iel)
+ enddo
+endif
+
+! --- RHO/DT et DIV
+! Extrapolation ou non, meme forme par coherence avec bilsc2
+
+do iel = 1, ncel
+ rom = propce(iel,ipcrom)
+ romvsd = rom*volume(iel)/dt(iel)
+ tinstk(iel) = istat(ikiph)*romvsd &
+ -iconv(ikiph)*w1(iel)*thetav(ikiph)
+ tinste(iel) = istat(ieiph)*romvsd &
+ -iconv(ieiph)*w1(iel)*thetav(ieiph)
+enddo
+
+! --- Source de masse (le theta est deja inclus par catsma)
+if (ncesmp.gt.0) then
+ do iel = 1, ncel
+ tinstk(iel) = tinstk(iel) + w2(iel)
+ tinste(iel) = tinste(iel) + w3(iel)
+ enddo
+endif
+
+! --- Termes sources utilisateurs
+if(isto2t(iphas).gt.0) then
+ thetak = thetav(ikiph)
+ thetae = thetav(ieiph)
+ do iel = 1, ncel
+ tinstk(iel) = tinstk(iel) -dam(iel)*thetak
+ tinste(iel) = tinste(iel) -w9 (iel)*thetae
+ enddo
+else
+ do iel = 1, ncel
+ tinstk(iel) = tinstk(iel) + max(-dam(iel),zero)
+ tinste(iel) = tinste(iel) + max(-w9 (iel),zero)
+ enddo
+endif
+
+! --- PRISE EN COMPTE DES TERMES LAGRANGIEN : COUPLAGE RETOUR
+
+! Ordre 2 non pris en compte
+if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.1) then
+
+ do iel = 1,ncel
+
+! Termes sources implicite sur k
+
+ tinstk(iel) = tinstk(iel) + max(-tslagr(iel,itsli),zero)
+
+! Termes sources implicte sur Eps
+
+ tinste(iel) = tinste(iel) &
+ + max( (-ce4*tslagr(iel,itske)/rtpa(iel,ikiph)) , zero)
+
+ enddo
+
+endif
+
+! Si IKECOU=0, on implicite plus fortement k et eps
+
+if(ikecou(iphas).eq.0)then
+ if(itytur(iphas).eq.2)then
+ do iel=1,ncel
+ xeps = rtpa(iel,ieiph )
+ xk = rtpa(iel,ikiph )
+ rom = propce(iel,ipcrom)
+ ttke = xk / xeps
+ if(xk.gt.1.d-12) then
+ tinstk(iel) = tinstk(iel) + &
+ rom*volume(iel)/ttke
+ endif
+ tinste(iel) = tinste(iel) + &
+ ce2*rom*volume(iel)/ttke
+ enddo
+ else if(iturb(iphas).eq.50)then
+ do iel=1,ncel
+ xeps = rtpa(iel,ieiph )
+ xk = rtpa(iel,ikiph )
+ rom = propce(iel,ipcrom)
+ xnu = propce(iel,ipcvis)/rom
+ ttke = xk / xeps
+ ttmin = cv2fct*sqrt(xnu/xeps)
+ tt = max(ttke,ttmin)
+ if(xk.gt.1.d-12) then
+ tinstk(iel) = tinstk(iel) + &
+ rom*volume(iel)/ttke
+ endif
+ tinste(iel) = tinste(iel) + &
+ cv2fe2*rom*volume(iel)/tt
+ enddo
+
+ endif
+endif
+
+! ON LIBERE W1, W2, W3, DAM, W9
+
+!===============================================================================
+! 13. RESOLUTION
+
+! On utilise SMBRK, SMBRE, TINSTK, TINSTE
+! Tableaux de travail W1, W2, W3, W4, W5, W6
+!===============================================================================
+
+! ---> Traitement de k
+
+ivar = ikiph
+iclvar = iclrtp(ivar,icoef )
+iclvaf = iclrtp(ivar,icoeff)
+
+ipp = ipprtp(ivar)
+
+! "VITESSE" DE DIFFUSION FACETTE
+
+if( idiff(ivar).ge. 1 ) then
+
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigmak
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+! RESOLUTION POUR K
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+!MO IPP =
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+thetap = thetav(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ tinstk , smbrk , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! ---> Traitement de epsilon
+
+ivar = ieiph
+iclvar = iclrtp(ivar,icoef )
+iclvaf = iclrtp(ivar,icoeff)
+
+ipp = ipprtp(ivar)
+
+
+! "VITESSE" DE DIFFUSION FACETTE
+
+if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigmae
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+! RESOLUTION POUR EPSILON
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+!MO IPP =
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+thetap = thetav(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ tinste , smbre , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 14. CLIPPING
+!===============================================================================
+
+iclip = 1
+iwarnp = iwarni(ikiph)
+call clipke &
+!==========
+ ( ncelet , ncel , nvar , nphas , &
+ iphas , iclip , iwarnp , &
+ propce , rtp )
+
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ** PHASE ',I4,' RESOLUTION DU K-EPSILON ',/,&
+' ------------------------------------ ',/)
+ 1001 format(/, &
+' ** PHASE ',I4,' RESOLUTION DU K-EPSILON A PROD LINEAIRE ',/,&
+' ---------------------------------------------------- ',/)
+ 1002 format(/, &
+' ** PHASE ',I4,' RESOLUTION DU V2F (K ET EPSILON) ',/,&
+' --------------------------------------------- ',/)
+ 1100 format(1X,A8,' : BILAN EXPLICITE = ',E14.5)
+
+#else
+
+ 1000 format(/, &
+' ** PHASE ',I4,' SOLVING K-EPSILON' ,/,&
+' ------------------------------' ,/)
+ 1001 format(/, &
+' ** PHASE ',I4,' SOLVING K-EPSILON WITH LINEAR PROD' ,/,&
+' -----------------------------------------------' ,/)
+ 1002 format(/, &
+' ** PHASE ',I4,' SOLVING V2F (K AND EPSILON)' ,/,&
+' ----------------------------------------' ,/)
+ 1100 format(1X,A8,' : EXPLICIT BALANCE = ',E14.5)
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/turbkw.f90 b/src/base/turbkw.f90
new file mode 100644
index 0000000..61424c8
--- /dev/null
+++ b/src/base/turbkw.f90
@@ -0,0 +1,1363 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine turbkw &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , coefa , coefb , ckupdc , smacel , &
+ s2kw , divukw , viscf , viscb , &
+ dam , xam , &
+ drtp , smbrk , smbrw , tinstk , tinstw , &
+ xf1 , w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS K-OMEGA SST 1 PHASE INCOMPRESSIBLE OU
+! RHO VARIABLE SUR UN PAS DE TEMPS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! s2kw(ncelet) ! tr ! <-- ! tableau contenant s2=2.sijsij !
+! divukw(ncelet ! tr ! <-- ! divergence de u (calculee par grdcel) !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr.(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! tinst.(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! xf1(ncelet) ! tr ! --- ! tableau de travail pour coef f1 !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "lagpar.h"
+include "lagran.h"
+include "pointe.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision tslagr(ncelet,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision s2kw(ncelet), divukw(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrk(ncelet), smbrw(ncelet)
+double precision tinstk(ncelet), tinstw(ncelet), xf1(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra, ifinia
+integer iel , ifac , init , inc , iccocg, ivar
+integer ii, iivar , iiun , ifacpt
+integer iclipk, iclipw, isqrt
+integer nswrgp, imligp, iphydp
+integer ipriph, ikiph , iomgip
+integer iclikp, iclomg
+integer iclvar, iclvaf
+integer iconvp, idiffp, ndircp, ireslp
+integer nitmap, nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer ipcrom, ipbrom, ipcvst, ipcvis, iflmas, iflmab
+integer iwarnp, ipp
+integer iptsta
+integer ipcroo, ipbroo, ipcvto, ipcvlo
+integer maxelt, ils
+double precision rnorm , d2s3, divp23, epz2
+double precision deltk , deltw, a11, a12, a22, a21
+double precision unsdet, romvsd
+double precision prdtur, xk, xw, xeps, xnu
+double precision visct , rom
+double precision blencp, epsilp, epsrgp, climgp, extrap, relaxp
+double precision thetp1, thetak, thetaw, thets, thetap, epsrsp
+double precision tuexpk, tuexpw
+double precision cdkw, xarg1, xxf1, xgamma, xbeta, sigma, produc
+double precision var, vrmin, vrmax
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+epz2 = epzero**2
+
+ipriph = ipr (iphas)
+ikiph = ik (iphas)
+iomgip = iomg(iphas)
+
+iclikp = iclrtp(ikiph ,icoef)
+iclomg = iclrtp(iomgip,icoef)
+
+ipcrom = ipproc(irom (iphas))
+ipcvst = ipproc(ivisct(iphas))
+ipcvis = ipproc(iviscl(iphas))
+iflmas = ipprof(ifluma(ikiph))
+iflmab = ipprob(ifluma(ikiph))
+ipbrom = ipprob(irom (iphas))
+
+thets = thetst(iphas)
+
+ipcroo = ipcrom
+ipbroo = ipbrom
+ipcvto = ipcvst
+ipcvlo = ipcvis
+if(isto2t(iphas).gt.0) then
+ if (iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+ ipbroo = ipprob(iroma(iphas))
+ endif
+ if(iviext(iphas).gt.0) then
+ ipcvto = ipproc(ivista(iphas))
+ ipcvlo = ipproc(ivisla(iphas))
+ endif
+endif
+
+if(isto2t(iphas).gt.0) then
+ iptsta = ipproc(itstua(iphas))
+else
+ iptsta = 0
+endif
+
+if(iwarni(ikiph).ge.1) then
+ write(nfecra,1000)iphas
+endif
+
+
+!===============================================================================
+! 2. CALCUL DE dk/dxj.dw/dxj
+! Le terme est stocke dans W1
+! En sortie de l'etape on conserve W1
+!===============================================================================
+
+iccocg = 1
+inc = 1
+
+
+nswrgp = nswrgr(ikiph)
+imligp = imligr(ikiph)
+iwarnp = iwarni(ikiph)
+epsrgp = epsrgr(ikiph)
+climgp = climgr(ikiph)
+extrap = extrag(ikiph)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ikiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , w7 , w7 , &
+ rtpa(1,ikiph) , coefa(1,iclikp) , coefb(1,iclikp) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w7 , w8 , xf1 , &
+ rdevel , rtuser , ra )
+
+
+nswrgp = nswrgr(iomgip)
+imligp = imligr(iomgip)
+iwarnp = iwarni(iomgip)
+epsrgp = epsrgr(iomgip)
+climgp = climgr(iomgip)
+extrap = extrag(iomgip)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iomgip , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , w7 , w7 , &
+ rtpa(1,iomgip) , coefa(1,iclomg) , coefb(1,iclomg) , &
+ w4 , w5 , w6 , &
+! ------ ------ ------
+ w7 , w8 , xf1 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ w1(iel) = w1(iel)*w4(iel)+w2(iel)*w5(iel)+w3(iel)*w6(iel)
+enddo
+
+!====================================================
+! 3. CALCUL DU COEFFICIENT DE PONDERATION F1
+! Le terme est stocke dans XF1
+! En sortie de l'etape on conserve W1,XF1
+!====================================================
+
+
+if(abs(icdpar).eq.2) then
+ do iel = 1, ncel
+ ifacpt = ia(iifapa(iphas)-1+iel)
+ w2(iel) = &
+ (cdgfbo(1,ifacpt)-xyzcen(1,iel))**2 &
+ +(cdgfbo(2,ifacpt)-xyzcen(2,iel))**2 &
+ +(cdgfbo(3,ifacpt)-xyzcen(3,iel))**2
+ w2(iel) = sqrt(w2(iel))
+ enddo
+else
+ do iel = 1, ncel
+ w2(iel) = max(ra(idipar+iel-1),epzero)
+ enddo
+endif
+
+! En cas d'ordre 2 on utilise les valeurs en n car le terme en (1-F1)*W1
+! sera dans PROPCE. Du coup, on aura quand meme certaines "constantes"
+! intervenant dans des termes en n+1/2 (ex sigma_k pour la diffusion) calcules
+! a partir de F1 en n -> mais l'effet sur les "constantes" est faible
+! -> a garder en tete si on fait vraiment de l'ordre 2 en temps en k-omega
+do iel = 1, ncel
+ rom = propce(iel,ipcroo)
+ xnu = propce(iel,ipcvlo)/rom
+ xk = rtpa(iel,ikiph)
+ xw = rtpa(iel,iomgip)
+ cdkw = 2*rom/ckwsw2/xw*w1(iel)
+ cdkw = max(cdkw,1.d-20)
+ xarg1 = max( sqrt(xk)/cmu/xw/w2(iel), &
+ 500.d0*xnu/xw/w2(iel)**2 )
+ xarg1 = min(xarg1, &
+ 4.d0*rom*xk/ckwsw2/cdkw/w2(iel)**2)
+ xf1(iel) = tanh(xarg1**4)
+enddo
+
+!===============================================================================
+! 4. CALCUL DU TERME DE PRODUCTION
+! Les termes sont stockes dans TINSTK,TINSTW
+! En sortie de l'etape on conserve W1,XF1,TINSTK,TINSTW
+!===============================================================================
+
+d2s3 = 2.d0/3.d0
+do iel = 1, ncel
+ xk = rtpa(iel,ikiph)
+ xeps = cmu*rtpa(iel,iomgip)*xk
+ tinstk(iel) = s2kw(iel) - d2s3*divukw(iel)*divukw(iel)
+ tinstw(iel) = propce(iel,ipcvto)*tinstk(iel) &
+ -d2s3*propce(iel,ipcroo)*xk*divukw(iel)
+ tinstk(iel) = min(tinstw(iel),ckwc1*propce(iel,ipcroo)*xeps)
+enddo
+
+!===============================================================================
+! 4. CALCUL DU TERME DE GRAVITE
+! Les termes sont stockes dans TINSTK,TINSTW,W2
+! En sortie de l'etape on conserve W1,W2,XF1,TINSTK,TINSTW
+!===============================================================================
+
+if(igrake(iphas).eq.1) then
+
+! --- Terme de gravite G = BETA*G*GRAD(SCA)/PRDTUR/RHO
+! Ici on calcule G =-G*GRAD(RHO)/PRDTUR/RHO
+
+ iccocg = 1
+ inc = 1
+
+! Le choix ci dessous a l'avantage d'etre simple
+
+ nswrgp = nswrgr(ikiph)
+ epsrgp = epsrgr(ikiph)
+ imligp = imligr(ikiph)
+ iwarnp = iwarni(ikiph)
+ climgp = climgr(ikiph)
+ extrap = extrag(ikiph)
+
+! Conditions aux limites sur ROM : Dirichlet ROMB
+! On utilise VISCB pour stocker le COEFB relatif a ROM
+! On impose en Dirichlet (COEFA) la valeur ROMB
+
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ iivar = 0
+
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w5 , w5 , w5 , &
+ propce(1,ipcroo), propfb(1,ipbroo), viscb , &
+ w2 , w3 , w4 , &
+! ------ ------ ------
+ w5 , w6 , w7 , &
+ rdevel , rtuser , ra )
+
+
+! Production et terme de gravite
+! TINSTK=MIN(P,C1*EPS)+G et TINSTW=P+(1-CE3)*G
+! On conserve G dans W2 pour la phase de couplage des termes sources
+
+ if(iscalt(iphas).gt.0.and.nscal.ge.iscalt(iphas)) then
+ prdtur = sigmas(iscalt(iphas))
+ else
+ prdtur = 1.d0
+ endif
+
+ do iel = 1, ncel
+ w2(iel) = -(w2(iel)*gx+w3(iel)*gy+w4(iel)*gz)/ &
+ (propce(iel,ipcroo)*prdtur)
+ tinstw(iel)=tinstw(iel)+propce(iel,ipcvto)*max(w2(iel),zero)
+ tinstk(iel)=tinstk(iel)+propce(iel,ipcvto)*w2(iel)
+ enddo
+
+endif
+
+
+!===============================================================================
+! 5. PRISE EN COMPTE DES TERMES SOURCES UTILISATEURS
+! Les termes sont stockes dans SMBRK,SMBRW,DAM,W3
+! En sortie de l'etape on conserve W1-3,XF1,TINSTK,TINSTW,SMBRK,SMBRW,DAM
+!===============================================================================
+
+do iel = 1, ncel
+ smbrk(iel) = 0.d0
+ smbrw(iel) = 0.d0
+ dam (iel) = 0.d0
+ w3 (iel) = 0.d0
+enddo
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('TURBKW',IFINIA)
+
+call ustskw &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , s2kw , divukw , &
+ w1 , w2 , xf1 , &
+ smbrk , smbrw , dam , w3 , &
+! ------ ------ ------ ------
+ viscf , viscb , xam , w4 , w5 , &
+ w6 , w7 , w8 , w9 , drtp , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 6. TERME D'ACCUMULATION DE MASSE -(dRO/dt)*Volume
+
+! Le terme est stocke dans W4
+! En sortie de l'etape on conserve W1-4,XF1,TINSTK,TINSTW,SMBRK,SMBRW,DAM
+!===============================================================================
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w4)
+
+!===============================================================================
+! 7. ON FINALISE LE CALCUL DES TERMES SOURCES
+
+! Les termes sont stockes dans SMBRK, SMBRW
+! En sortie de l'etape on conserve SMBRK,SMBRW,DAM,W1-4
+!===============================================================================
+
+do iel = 1, ncel
+
+ visct = propce(iel,ipcvto)
+ rom = propce(iel,ipcroo)
+ xk = rtpa(iel,ikiph)
+ xw = rtpa(iel,iomgip)
+ xxf1 = xf1(iel)
+ xgamma = xxf1*ckwgm1 + (1.d0-xxf1)*ckwgm2
+ xbeta = xxf1*ckwbt1 + (1.d0-xxf1)*ckwbt2
+
+ smbrk(iel) = smbrk(iel) + volume(iel)*( &
+ tinstk(iel) &
+ -cmu*rom*xw*xk )
+
+ smbrw(iel) = smbrw(iel) + volume(iel)*( &
+ rom*xgamma/visct*tinstw(iel) &
+ -xbeta*rom*xw**2 &
+ +2.d0*rom/xw*(1.d0-xxf1)/ckwsw2*w1(iel) )
+
+enddo
+
+!===============================================================================
+! 8. PRISE EN COMPTE DES TERMES D'ACCUMULATION DE MASSE ET
+! DE LA DEUXIEME PARTIE DES TS UTILISATEURS (PARTIE EXPLICITE)
+! STOCKAGE POUR EXTRAPOLATION EN TEMPS
+! On utilise SMBRK,SMBRW
+! En sortie de l'etape on conserve SMBRK,SMBRW,DAM,W2-4
+
+! Remarque : l'extrapolation telle qu'elle est ecrite n'a pas grand
+! sens si IKECOU=1
+!===============================================================================
+
+! Si on extrapole les T.S.
+if(isto2t(iphas).gt.0) then
+
+ do iel = 1, ncel
+
+! Sauvegarde pour echange
+ tuexpk = propce(iel,iptsta)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta) = smbrk(iel)
+! Termes dependant de la variable resolue et theta PROPCE
+ smbrk(iel) = iconv(ikiph)*w4(iel)*rtpa(iel,ikiph) &
+ - thets*tuexpk
+! On suppose -DAM > 0 : on implicite
+! le terme utilisateur dependant de la variable resolue
+ smbrk(iel) = dam(iel)*rtpa(iel,ikiph) + smbrk(iel)
+
+! Sauvegarde pour echange
+ tuexpw = propce(iel,iptsta+1)
+! Pour la suite et le pas de temps suivant
+ propce(iel,iptsta+1) = smbrw(iel)
+! Termes dependant de la variable resolue et theta PROPCE
+ smbrw(iel) = iconv(iomgip)*w4(iel)*rtpa(iel,iomgip) &
+ - thets*tuexpw
+! On suppose -W3 > 0 : on implicite
+! le terme utilisateur dependant de la variable resolue
+ smbrw(iel) = w3(iel)*rtpa(iel,iomgip) + smbrw(iel)
+
+ enddo
+
+! Si on n'extrapole pas les T.S.
+else
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) + dam(iel)*rtpa(iel,ikiph) &
+ +iconv(ikiph)*w4(iel)*rtpa(iel,ikiph)
+ smbrw(iel) = smbrw(iel) + w3 (iel)*rtpa(iel,iomgip) &
+ +iconv(iomgip)*w4(iel)*rtpa(iel,iomgip)
+ enddo
+endif
+
+!===============================================================================
+! 8.1 PRISE EN COMPTE DES TERMES SOURCES LAGRANGIEN : PARTIE EXPLICITE
+! COUPLAGE RETOUR
+!===============================================================================
+
+! Ordre 2 non pris en compte
+if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.ilphas) then
+
+ do iel = 1,ncel
+
+! Termes sources explicte et implicte sur k
+
+ smbrk(iel) = smbrk(iel) + tslagr(iel,itske)
+
+! Termes sources explicte sur omega : on reprend la constante CE4 directement
+! du k-eps sans justification ... a creuser si necessaire !
+
+ smbrw(iel) = smbrw(iel) &
+ + ce4 *tslagr(iel,itske) * propce(iel,ipcroo) &
+ /propce(iel,ipcvto)
+ enddo
+
+endif
+
+
+!===============================================================================
+! 9. PRISE EN COMPTE DES TERMES DE CONV/DIFF DANS LE SECOND MEMBRE
+
+! Tableaux de travail W7, W8, W1, TINSTK, TINSTW, DRTP
+! Les termes sont stockes dans W5 et W6, puis ajoutes a SMBRK, SMBRW
+! En sortie de l'etape on conserve W2-6,SMBRK,SMBRW,DAM
+!===============================================================================
+
+! Ceci ne sert a rien si IKECOU n'est pas egal a 1
+
+if (ikecou(iphas).eq.1) then
+
+ do iel = 1, ncel
+ w5 (iel) = 0.d0
+ w6 (iel) = 0.d0
+ enddo
+
+! ---> Traitement de k
+
+ ivar = ikiph
+
+ ipp = ipprtp(ivar)
+
+ iclvar = iclrtp(ivar,icoef )
+ iclvaf = iclrtp(ivar,icoeff)
+ chaine = nomvar(ipp)
+
+ if( idiff(ivar).ge. 1 ) then
+
+ do iel = 1, ncel
+ xxf1 = xf1(iel)
+ sigma = xxf1*ckwsk1 + (1.d0-xxf1)*ckwsk2
+ w7(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigma
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+ else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ endif
+
+ iccocg = 1
+ inc = 1
+ iconvp = iconv (ivar)
+ idiffp = idiff (ivar)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ ircflp = ircflu(ivar)
+ ischcp = ischcv(ivar)
+ isstpp = isstpc(ivar)
+ iwarnp = iwarni(ivar)
+ blencp = blencv(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ relaxp = relaxv(ivar)
+ thetap = thetav(ivar)
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ w5 , &
+! --
+ w7 , w8 , w1 , tinstk , tinstw , drtp , &
+ rdevel , rtuser , ra )
+
+ if (iwarni(ivar).ge.2) then
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,smbrk,smbrk,rnorm)
+ write(nfecra,1100) chaine(1:8) ,rnorm
+ endif
+
+
+! ---> Traitement de omega
+
+ ivar = iomgip
+
+ ipp = ipprtp(ivar)
+
+ iclvar = iclrtp(ivar,icoef )
+ iclvaf = iclrtp(ivar,icoeff)
+ chaine = nomvar(ipp)
+
+ if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ xxf1 = xf1(iel)
+ sigma = xxf1*ckwsw1 + (1.d0-xxf1)*ckwsw2
+ w7(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigma
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+ else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ endif
+
+ iccocg = 1
+ inc = 1
+ iconvp = iconv (ivar)
+ idiffp = idiff (ivar)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ ircflp = ircflu(ivar)
+ ischcp = ischcv(ivar)
+ isstpp = isstpc(ivar)
+ iwarnp = iwarni(ivar)
+ blencp = blencv(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ relaxp = relaxv(ivar)
+ thetap = thetav(ivar)
+
+ call bilsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), viscf , viscb , &
+ w6 , &
+! --
+ w7 , w8 , w1 , tinstk , tinstw , drtp , &
+ rdevel , rtuser , ra )
+
+ if (iwarni(ivar).ge.2) then
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,smbrw,smbrw,rnorm)
+ write(nfecra,1100) chaine(1:8) ,rnorm
+ endif
+
+ do iel = 1,ncel
+ smbrk(iel) = smbrk(iel) + w5(iel)
+ smbrw(iel) = smbrw(iel) + w6(iel)
+ enddo
+
+endif
+
+!===============================================================================
+! 10. AJOUT DES TERMES SOURCES DE MASSE EXPLICITES
+
+! Les parties implicites eventuelles sont conservees dans W7 et W8
+! et utilisees dans la phase d'implicitation cv/diff
+
+! Les termes sont stockes dans SMBRK, SMBRW, W7, W8
+! En sortie de l'etape on conserve W2-8,SMBRK,SMBRW,DAM
+!===============================================================================
+
+if (ncesmp.gt.0) then
+
+ do iel = 1, ncel
+ w7(iel) = 0.d0
+ w8(iel) = 0.d0
+ enddo
+
+! Entier egal a 1 (pour navsto : nb de sur-iter)
+ iiun = 1
+
+! On incremente SMBRS par -Gamma RTPA et ROVSDT par Gamma (*theta)
+ ivar = ikiph
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , &
+ isto2t(iphas) , thetav(ivar) , &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipriph) , &
+ smbrk , w7 , tinstk )
+ ivar = iomgip
+ call catsma &
+ !==========
+ ( ncelet , ncel , ncesmp , iiun , &
+ isto2t(iphas) , thetav(ivar) , &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) , smacel(1,ipriph) , &
+ smbrw , w8 , tinstw )
+
+! Si on extrapole les TS on met Gamma Pinj dans PROPCE
+ if(isto2t(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,iptsta ) = propce(iel,iptsta ) + tinstk(iel)
+ propce(iel,iptsta+1) = propce(iel,iptsta+1) + tinstw(iel)
+ enddo
+! Sinon on le met directement dans SMBR
+ else
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) + tinstk(iel)
+ smbrw(iel) = smbrw(iel) + tinstw(iel)
+ enddo
+ endif
+
+endif
+
+! Finalisation des termes sources
+if(isto2t(iphas).gt.0) then
+ thetp1 = 1.d0 + thets
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) + thetp1 * propce(iel,iptsta)
+ smbrw(iel) = smbrw(iel) + thetp1 * propce(iel,iptsta+1)
+ enddo
+endif
+
+!===============================================================================
+! 11. INCREMENTS DES TERMES SOURCES DANS LE SECOND MEMBRE
+
+! Les termes sont stockes dans SMBRK, SMBRW
+! En sortie de l'etape on conserve W3-8,SMBRK,SMBRW
+!===============================================================================
+
+! Ordre 2 non pris en compte
+if(ikecou(iphas).eq.1) then
+
+ do iel = 1, ncel
+
+ rom = propce(iel,ipcrom)
+
+! RESOLUTION COUPLEE
+
+ romvsd = 1.d0/(rom*volume(iel))
+ smbrk(iel) = smbrk(iel)*romvsd
+ smbrw(iel) = smbrw(iel)*romvsd
+ divp23 = d2s3*max(divukw(iel),zero)
+ produc = s2kw(iel)-d2s3*divukw(iel)**2+w2(iel)
+ xk = rtpa(iel,ikiph)
+ xw = rtpa(iel,iomgip)
+ xxf1 = xf1(iel)
+ xgamma = xxf1*ckwgm1 + (1.d0-xxf1)*ckwgm2
+ xbeta = xxf1*ckwbt1 + (1.d0-xxf1)*ckwbt2
+
+ a11 = 1.d0/dt(iel) &
+ - 1.d0/xw*min(produc,zero)+divp23+cmu*xw
+ a12 = cmu*xk
+ a21 = 0.d0
+ a22 = 1.d0/dt(iel)+xgamma*divp23+2.d0*xbeta*xw
+
+ unsdet = 1.d0/(a11*a22 -a12*a21)
+
+ deltk = ( a22*smbrk(iel) -a12*smbrw(iel) )*unsdet
+ deltw = (-a21*smbrk(iel) +a11*smbrw(iel) )*unsdet
+
+! NOUVEAU TERME SOURCE POUR CODITS
+
+ romvsd = rom*volume(iel)/dt(iel)
+
+ smbrk(iel) = romvsd*deltk
+ smbrw(iel) = romvsd*deltw
+
+ enddo
+
+endif
+
+!===============================================================================
+! 12. TERMES INSTATIONNAIRES
+
+! Les termes sont stockes dans TINSTK, TINSTW
+! En sortie de l'etape on conserve SMBRK, SMBRW, TINSTK, TINSTW
+!===============================================================================
+
+! --- PARTIE EXPLICITE
+
+! on enleve la convection/diffusion au temps n a SMBRK et SMBRW
+! s'ils ont ete calcules
+if (ikecou(iphas).eq.1) then
+ do iel = 1, ncel
+ smbrk(iel) = smbrk(iel) - w5(iel)
+ smbrw(iel) = smbrw(iel) - w6(iel)
+ enddo
+endif
+
+! --- RHO/DT et DIV
+! Extrapolation ou non, meme forme par coherence avec bilsc2
+
+do iel = 1, ncel
+ rom = propce(iel,ipcrom)
+ romvsd = rom*volume(iel)/dt(iel)
+ tinstk(iel) = istat(ikiph)*romvsd &
+ -iconv(ikiph)*w4(iel)*thetav(ikiph)
+ tinstw(iel) = istat(iomgip)*romvsd &
+ -iconv(iomgip)*w4(iel)*thetav(iomgip)
+enddo
+
+! --- Source de masse (le theta est deja inclus par catsma)
+if (ncesmp.gt.0) then
+ do iel = 1, ncel
+ tinstk(iel) = tinstk(iel) + w7(iel)
+ tinstw(iel) = tinstw(iel) + w8(iel)
+ enddo
+endif
+
+! --- Termes sources utilisateurs
+if(isto2t(iphas).gt.0) then
+ thetak = thetav(ikiph)
+ thetaw = thetav(iomgip)
+ do iel = 1, ncel
+ tinstk(iel) = tinstk(iel) -dam(iel)*thetak
+ tinstw(iel) = tinstw(iel) -w3 (iel)*thetaw
+ enddo
+else
+ do iel = 1, ncel
+ tinstk(iel) = tinstk(iel) + max(-dam(iel),zero)
+ tinstw(iel) = tinstw(iel) + max(-w3 (iel),zero)
+ enddo
+endif
+
+! --- PRISE EN COMPTE DES TERMES LAGRANGIEN : COUPLAGE RETOUR
+
+! Ordre 2 non pris en compte
+if (iilagr.eq.2 .and. ltsdyn.eq.1 .and. iphas.eq.1) then
+
+ do iel = 1,ncel
+
+! Termes sources implicite sur k
+
+ tinstk(iel) = tinstk(iel) + max(-tslagr(iel,itsli),zero)
+
+! Termes sources implicte sur omega
+
+ tinstw(iel) = tinstw(iel) &
+ + max( (-ce4*tslagr(iel,itske)/rtpa(iel,ikiph)) , zero)
+
+ enddo
+
+endif
+
+! Si IKECOU=0, on implicite plus fortement k et omega
+
+if(ikecou(iphas).eq.0)then
+ do iel=1,ncel
+ xw = rtpa(iel,iomgip)
+ xxf1 = xf1(iel)
+ xbeta = xxf1*ckwbt1 + (1.d0-xxf1)*ckwbt2
+ rom = propce(iel,ipcrom)
+ tinstk(iel) = tinstk(iel) + &
+ volume(iel)*cmu*rom*xw
+ tinstw(iel) = tinstw(iel) + &
+ volume(iel)*xbeta*rom*xw
+ enddo
+endif
+
+
+!===============================================================================
+! 13. RESOLUTION
+
+! On utilise SMBRK, SMBRW, TINSTK, TINSTW
+!===============================================================================
+
+! ---> Traitement de k
+
+ivar = ikiph
+iclvar = iclrtp(ivar,icoef )
+iclvaf = iclrtp(ivar,icoeff)
+
+ipp = ipprtp(ivar)
+
+! "VITESSE" DE DIFFUSION FACETTE
+
+if( idiff(ivar).ge. 1 ) then
+
+ do iel = 1, ncel
+ xxf1 = xf1(iel)
+ sigma = xxf1*ckwsk1 + (1.d0-xxf1)*ckwsk2
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigma
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+! RESOLUTION POUR K
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+!MO IPP =
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+thetap = thetav(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ tinstk , smbrk , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! ---> Traitement de omega
+
+ivar = iomgip
+iclvar = iclrtp(ivar,icoef )
+iclvaf = iclrtp(ivar,icoeff)
+
+ipp = ipprtp(ivar)
+
+
+! "VITESSE" DE DIFFUSION FACETTE
+
+if( idiff(ivar).ge. 1 ) then
+ do iel = 1, ncel
+ xxf1 = xf1(iel)
+ sigma = xxf1*ckwsw1 + (1.d0-xxf1)*ckwsw2
+ w1(iel) = propce(iel,ipcvis) &
+ + idifft(ivar)*propce(iel,ipcvst)/sigma
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+! RESOLUTION POUR OMEGA
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+!MO IPP =
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+thetap = thetav(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ tinstw , smbrw , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! 14. CLIPPING
+!===============================================================================
+
+! Calcul des Min/Max avant clipping, pour affichage
+do ii = 1, 2
+ if(ii.eq.1) then
+ ivar = ikiph
+ elseif(ii.eq.2) then
+ ivar = iomgip
+ endif
+ ipp = ipprtp(ivar)
+
+ vrmin = grand
+ vrmax = -grand
+ do iel = 1, ncel
+ var = rtp(iel,ivar)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmax (vrmax)
+ !==========
+ call parmin (vrmin)
+ !==========
+ endif
+ varmna(ipp) = vrmin
+ varmxa(ipp) = vrmax
+
+enddo
+
+! On clippe simplement k et omega par valeur absolue
+iclipk = 0
+iclipw = 0
+do iel = 1, ncel
+ xk = rtp(iel,ikiph )
+ xw = rtp(iel,iomgip)
+ if (abs(xk).le.epz2) then
+ iclipk = iclipk + 1
+ rtp(iel,ikiph) = max(rtp(iel,ikiph),epz2)
+ elseif(xk.le.0.d0) then
+ iclipk = iclipk + 1
+ rtp(iel,ikiph) = -xk
+ endif
+ if (abs(xw).le.epz2) then
+ iclipw = iclipw + 1
+ rtp(iel,iomgip) = max(rtp(iel,iomgip),epz2)
+ elseif(xw.le.0.d0) then
+ iclipw = iclipw + 1
+ rtp(iel,iomgip) = -xw
+ endif
+enddo
+
+if (irangp.ge.0) then
+ call parcpt (iclipk)
+ !==========
+ call parcpt (iclipw)
+ !==========
+endif
+
+! --- Stockage nb de clippings pour listing
+
+iclpmn(ipprtp(ikiph )) = iclipk
+iclpmn(ipprtp(iomgip)) = iclipw
+
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ** PHASE ',I4,' RESOLUTION DU K-OMEGA ',/,&
+' ---------------------------------- ',/)
+ 1100 format(1X,A8,' : BILAN EXPLICITE = ',E14.5)
+
+#else
+
+ 1000 format(/, &
+' ** PHASE ',I4,' SOLVING K-OMEGA' ,/,&
+' ----------------------------' ,/)
+ 1100 format(1X,A8,' : EXPLICIT BALANCE = ',E14.5)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/turent.f90 b/src/base/turent.f90
new file mode 100644
index 0000000..86f6512
--- /dev/null
+++ b/src/base/turent.f90
@@ -0,0 +1,207 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine keendb &
+!================
+
+ ( uref2, dh, xrho, xmu , cmu, xkappa, ustar2, xk, xeps )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE U*, K ET EPSILON A PARTIR D'UN DIAMETRE ET D'UNE
+! VITESSE DEBITANTE POUR DES ECOULEMENTS EN CONDUITE
+! CIRCULAIRE A PAROI LISSE
+! -> UTILISE POUR LES CONDITIONS AUX LIMITES D'ENTREE
+
+! ON SORT A LA FOIS U* ET (XK,XEPS) POUR PERMETTRE
+! A L'UTILISATEUR DE CALCULER DES XK ET XEPS DIFFERENTS
+! AVEC LE U*, S'IL LE SOUHAITE
+
+
+! ON UTILISE DES LOIS TIREES DE IDEL'CIK
+! LE COEFFICIENT DE PERTE DE CHARGE XLMBDA EST DEFINI PAR
+! |dP/dx| = XLMBDA/DH * 1/2*XRHO*UREF**2
+
+! PUIS U*=UREF*SQRT(XLMBDA/8)
+
+! POUR Re < 2000
+! XLMBDA = 64/Re
+
+! POUR Re > 4000
+! XLMBDA = 1/( 1.8*LOG10(Re)-1.64 )**2
+
+! POUR 2000 < Re < 4000, ON COMPLETE PAR UNE DROITE
+! XLMBDA = 0.021377 + 5.3115D-6*Re
+
+
+! A PARTIR DE U*, ON ESTIME XK ET XEPS A PARTIR DE FORMULES
+! CLASSIQUES DE TURBULENCE DEVELOPPEE
+
+! XK = USTAR2/SQRT(CMU)
+! XEPS = USTAR2**1.5D0/(XKAPPA*DH*0.1D0)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! uref2 ! r ! <-- ! carre de la vitesse debitante de !
+! ! ! ! reference !
+! dh ! r ! <-- ! diametre hydraulique !
+! xrho ! r ! <-- ! masse volumique !
+! xmu ! r ! <-- ! viscosite dynamique !
+! cmu ! r ! <-- ! constante cmu !
+! xkappa ! r ! <-- ! constante kappa !
+! ustar2 ! r ! --> ! carre de la vitesse de frottement !
+! xk ! r ! --> ! intensite turbulente calculee !
+! xeps ! r ! --> ! dissipation turbulente calculee !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision uref2, dh, xrho, xmu , ustar2, xk, xeps
+double precision cmu, xkappa
+
+! VARIABLES LOCALES
+
+double precision re, xlmbda
+
+!===============================================================================
+
+re = sqrt(uref2)*dh*xrho/xmu
+
+if (re.lt.2000) then
+! dans ce cas on calcule directement u*^2 pour eviter un probleme
+! sur xlmbda=64/Re quand Re->0
+
+ ustar2 = 8.d0*xmu*sqrt(uref2)/xrho/dh
+
+else if (re.lt.4000) then
+
+ xlmbda = 0.021377d0 + 5.3115d-6*re
+ ustar2 = uref2*xlmbda/8.d0
+
+else
+
+ xlmbda = 1/( 1.8d0*log(re)/log(10.d0)-1.64d0)**2
+ ustar2 = uref2*xlmbda/8.d0
+
+endif
+
+xk = ustar2/sqrt(cmu)
+xeps = ustar2**1.5d0/(xkappa*dh*0.1d0)
+
+!----
+! FIN
+!----
+
+return
+end
+subroutine keenin &
+!================
+
+ ( uref2, xintur, dh, cmu, xkappa, xk, xeps )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE U*, K ET EPSILON A PARTIR D'UN DIAMETRE ET D'UNE
+! INTENSITE TURBULENTE
+! -> UTILISE POUR LES CONDITIONS AUX LIMITES D'ENTREE
+
+
+! ON ESTIME XK ET XEPS A PARTIR DE FORMULES
+! CLASSIQUES DE TURBULENCE DEVELOPPEE
+
+! XK = USTAR2/SQRT(CMU)
+! XEPS = USTAR2**1.5D0/(XKAPPA*DH*0.1D0)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! uref2 ! r ! <-- ! carre de la vitesse debitante de !
+! ! ! ! reference !
+! xintur ! r ! <-- ! intensite turbulente !
+! dh ! r ! <-- ! diametre hydraulique !
+! cmu ! r ! <-- ! constante cmu !
+! xkappa ! r ! <-- ! constante kappa !
+! xk ! r ! --> ! intensite turbulente calculee !
+! xeps ! r ! --> ! dissipation turbulente calculee !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision uref2, xintur, dh, cmu, xkappa, xk, xeps
+
+! VARIABLES LOCALES
+
+!===============================================================================
+
+
+xk = 1.5d0*uref2*xintur**2
+xeps = &
+ 10.d0*cmu**(0.75d0)*xk**1.5d0/(xkappa*dh)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/turrij.f90 b/src/base/turrij.f90
new file mode 100644
index 0000000..9e4467c
--- /dev/null
+++ b/src/base/turrij.f90
@@ -0,0 +1,769 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine turrij &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ tslagr , &
+ coefa , coefb , ckupdc , smacel , &
+ viscf , viscb , coefax , &
+ dam , xam , drtp , &
+ smbr , rovsdt , grdvit , produc , grarox , graroy , graroz , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS Rij-EPS 1 PHASE INCOMPRESSIBLE OU
+! RHO VARIABLE SUR UN PAS DE TEMPS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! coefax(nfabor ! tr ! --- ! tab de trav pour cond.lim. paroi !
+! ! tr ! --- ! attention : uniquement avec echo !
+! ! tr ! --- ! de paroi et abs(icdpar) = 1 !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr (ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! drtp(ncelet) ! tr ! --- ! tableau de travail pour increment !
+! smbr?(ncelet) ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! grdvit ! tr ! --- ! tableau de travail pour terme grad !
+! (ncelet,3,3) ! ! ! de vitesse uniqt pour iturb=31 !
+! produc ! tr ! <-- ! tableau de travail pour production !
+! (6,ncelet) ! ! ! (sans rho volume) uniqt pour iturb=30 !
+! grarox,y,z ! tr ! --- ! tableau de travail pour grad rom !
+! (ncelet) ! ! ! !
+! w?(ncelet) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstphy.h"
+include "optcal.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision tslagr(ncelet,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision viscf(nfac), viscb(nfabor), coefax(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbr(ncelet), rovsdt(ncelet)
+double precision grdvit(ncelet,3,3), produc(6,ncelet)
+double precision grarox(ncelet), graroy(ncelet), graroz(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac , iel , ivar , isou , ii
+integer inc , iccocg
+integer ipp , iwarnp, iclip
+integer ipriph, iuiph , iviph , iwiph
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ieiph
+integer icliup, iclivp, icliwp
+integer nswrgp, imligp, iphydp
+integer ipcrom, ipbrom, ipcroo, ipbroo, iivar
+integer iitsla
+double precision epsrgp, climgp, extrap
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipriph = ipr (iphas)
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+ir11ip = ir11(iphas)
+ir22ip = ir22(iphas)
+ir33ip = ir33(iphas)
+ir12ip = ir12(iphas)
+ir13ip = ir13(iphas)
+ir23ip = ir23(iphas)
+ieiph = iep (iphas)
+
+icliup = iclrtp(iuiph,icoef)
+iclivp = iclrtp(iviph,icoef)
+icliwp = iclrtp(iwiph,icoef)
+
+ipcrom = ipproc(irom (iphas))
+ipbrom = ipprob(irom (iphas))
+
+if(iwarni(ieiph).ge.1) then
+ if (iturb(iphas).eq.30) then
+ write(nfecra,1000) iphas
+ else
+ write(nfecra,1001) iphas
+ endif
+endif
+
+
+! SI ITURB=30 (RIJ STD) ON STOCKE DIRECTEMENT LA PRODUCTION DANS
+! LE TABLEAU PRODUC
+! SI ITURB=31 (SSG) ON STOCKE LE GRADIENT DE VITESSE DANS GRDVIT
+
+!===============================================================================
+! 2.a CALCUL DU TENSEUR DE PRODUCTION POUR LE RIJ STANDARD
+! W7 = P11 , W8 = P22 , W9 = P33
+! W10 = P12 , W11 = P13 , W9 = P23
+!===============================================================================
+
+if (iturb(iphas).eq.30) then
+! INITIALISATIONS DE W7 ... W12
+
+ do ii = 1 , 6
+ do iel = 1, ncel
+ produc(ii,iel) = 0.0d0
+ enddo
+ enddo
+
+! CALCUL DU GRADIENT DES 3 COMPOSANTES DE LA VITESSE
+
+ iccocg = 1
+ inc = 1
+
+! GRADIENT SUIVANT X
+
+ nswrgp = nswrgr(iuiph)
+ imligp = imligr(iuiph)
+ iwarnp = iwarni(iuiph)
+ epsrgp = epsrgr(iuiph)
+ climgp = climgr(iuiph)
+ extrap = extrag(iuiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iuiph) , coefa(1,icliup) , coefb(1,icliup) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do iel = 1 , ncel
+
+ produc(1,iel) = produc(1,iel) &
+ - 2.0d0*(rtpa(iel,ir11ip)*w1(iel) + &
+ rtpa(iel,ir12ip)*w2(iel) + &
+ rtpa(iel,ir13ip)*w3(iel) )
+
+ produc(4,iel) = produc(4,iel) &
+ - (rtpa(iel,ir12ip)*w1(iel) + &
+ rtpa(iel,ir22ip)*w2(iel) + &
+ rtpa(iel,ir23ip)*w3(iel) )
+
+ produc(5,iel) = produc(5,iel) &
+ - (rtpa(iel,ir13ip)*w1(iel) + &
+ rtpa(iel,ir23ip)*w2(iel) + &
+ rtpa(iel,ir33ip)*w3(iel) )
+
+ enddo
+
+! Gradient suivant Y
+
+ nswrgp = nswrgr(iviph)
+ imligp = imligr(iviph)
+ iwarnp = iwarni(iviph)
+ epsrgp = epsrgr(iviph)
+ climgp = climgr(iviph)
+ extrap = extrag(iviph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iviph) , coefa(1,iclivp) , coefb(1,iclivp) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1 , ncel
+
+ produc(2,iel) = produc(2,iel) &
+ - 2.0d0*(rtpa(iel,ir12ip)*w1(iel) + &
+ rtpa(iel,ir22ip)*w2(iel) + &
+ rtpa(iel,ir23ip)*w3(iel) )
+
+ produc(4,iel) = produc(4,iel) &
+ - (rtpa(iel,ir11ip)*w1(iel) + &
+ rtpa(iel,ir12ip)*w2(iel) + &
+ rtpa(iel,ir13ip)*w3(iel) )
+
+ produc(6,iel) = produc(6,iel) &
+ - (rtpa(iel,ir13ip)*w1(iel) + &
+ rtpa(iel,ir23ip)*w2(iel) + &
+ rtpa(iel,ir33ip)*w3(iel) )
+
+ enddo
+
+! Gradient suivant Z
+
+ nswrgp = nswrgr(iwiph)
+ imligp = imligr(iwiph)
+ iwarnp = iwarni(iwiph)
+ epsrgp = epsrgr(iwiph)
+ climgp = climgr(iwiph)
+ extrap = extrag(iwiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iwiph) , coefa(1,icliwp) , coefb(1,icliwp) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1 , ncel
+
+ produc(3,iel) = produc(3,iel) &
+ - 2.0d0*(rtpa(iel,ir13ip)*w1(iel) + &
+ rtpa(iel,ir23ip)*w2(iel) + &
+ rtpa(iel,ir33ip)*w3(iel) )
+
+ produc(5,iel) = produc(5,iel) &
+ - (rtpa(iel,ir11ip)*w1(iel) + &
+ rtpa(iel,ir12ip)*w2(iel) + &
+ rtpa(iel,ir13ip)*w3(iel) )
+
+ produc(6,iel) = produc(6,iel) &
+ - (rtpa(iel,ir12ip)*w1(iel) + &
+ rtpa(iel,ir22ip)*w2(iel) + &
+ rtpa(iel,ir23ip)*w3(iel) )
+
+ enddo
+
+else
+
+!===============================================================================
+! 2.b CALCUL DU GRADIENT DE VITESSE POUR LE RIJ SSG
+! GRDVIT(IEL,I,J) = dUi/dxj(IEL)
+!===============================================================================
+
+! CALCUL DU GRADIENT DES 3 COMPOSANTES DE LA VITESSE
+
+ iccocg = 1
+ inc = 1
+
+! GRADIENT SUIVANT X
+
+ nswrgp = nswrgr(iuiph)
+ imligp = imligr(iuiph)
+ iwarnp = iwarni(iuiph)
+ epsrgp = epsrgr(iuiph)
+ climgp = climgr(iuiph)
+ extrap = extrag(iuiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iuiph) , coefa(1,icliup) , coefb(1,icliup) , &
+ grdvit(1,1,1) , grdvit(1,1,2) , grdvit(1,1,3) , &
+! ------------- ------------- -------------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! Gradient suivant Y
+
+ nswrgp = nswrgr(iviph)
+ imligp = imligr(iviph)
+ iwarnp = iwarni(iviph)
+ epsrgp = epsrgr(iviph)
+ climgp = climgr(iviph)
+ extrap = extrag(iviph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iviph) , coefa(1,iclivp) , coefb(1,iclivp) , &
+ grdvit(1,2,1) , grdvit(1,2,2) , grdvit(1,2,3) , &
+! ------------- ------------- -------------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! Gradient suivant Z
+
+ nswrgp = nswrgr(iwiph)
+ imligp = imligr(iwiph)
+ iwarnp = iwarni(iwiph)
+ epsrgp = epsrgr(iwiph)
+ climgp = climgr(iwiph)
+ extrap = extrag(iwiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,iwiph) , coefa(1,icliwp) , coefb(1,icliwp) , &
+ grdvit(1,3,1) , grdvit(1,3,2) , grdvit(1,3,3) , &
+! ------------- ------------- -------------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+!===============================================================================
+! 3. CALCUL DU GRADIENT DE ROM POUR LES TERMES DE GRAVITE
+!===============================================================================
+
+if(igrari(iphas).eq.1) then
+
+! Conditions aux limites : Dirichlet ROMB
+! On utilise VISCB pour stocker le coefb relatif a ROM
+! On impose en Dirichlet (COEFA) la valeur ROMB
+
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+! Le choix ci dessous a l'avantage d'etre simple
+
+ nswrgp = nswrgr(ir11ip)
+ imligp = imligr(ir11ip)
+ iwarnp = iwarni(ir11ip)
+ epsrgp = epsrgr(ir11ip)
+ climgp = climgr(ir11ip)
+ extrap = extrag(ir11ip)
+ iphydp = 0
+
+ iivar = 0
+
+! Si on extrapole les termes sources et rho, on utilise cpdt rho^n
+ ipcroo = ipcrom
+ ipbroo = ipbrom
+ if(isto2t(iphas).gt.0.and.iroext(iphas).gt.0) then
+ ipcroo = ipproc(iroma(iphas))
+ ipbroo = ipprob(iroma(iphas))
+ endif
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ propce(1,ipcroo), propfb(1,ipbroo), viscb , &
+ grarox , graroy , graroz , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+!===============================================================================
+! 4. Boucle sur les variables Rij (6 variables)
+! L'ordre est R11 R22 R33 R12 R13 R23 (La place de ces variables
+! est IR11. ..
+! On resout les equation dans une routine semblable a covofi.F
+!===============================================================================
+
+
+
+do isou = 1, 6
+ if (isou.eq.1) then
+ ivar = ir11ip
+ elseif(isou.eq.2) then
+ ivar = ir22ip
+ elseif(isou.eq.3) then
+ ivar = ir33ip
+ elseif(isou.eq.4) then
+ ivar = ir12ip
+ elseif(isou.eq.5) then
+ ivar = ir13ip
+ elseif(isou.eq.6) then
+ ivar = ir23ip
+ endif
+ ipp = ipprtp(ivar)
+
+ if (iilagr.eq.2 .and. iphas.eq.1) then
+ iitsla = itsr11 + (isou-1)
+ endif
+
+
+! Rij-epsilon standard (LRR)
+ if (iturb(iphas).eq.30) then
+ call resrij &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm(1,ivar) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , produc , grarox , graroy , graroz , &
+ ckupdc , smacel(1,ivar) , smacel(1,ipriph), &
+ viscf , viscb , coefax , &
+ tslagr(1,iitsla) , tslagr(1,itsli) , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+ else
+! Rij-epsilon SSG
+ call resssg &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm(1,ivar) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grdvit , grarox , graroy , graroz , &
+ ckupdc , smacel(1,ivar) , smacel(1,ipriph), &
+ viscf , viscb , coefax , &
+ tslagr(1,iitsla) , tslagr(1,itsli) , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+ endif
+
+enddo
+
+!===============================================================================
+! 5. RESOLUTION DE EPSILON
+!===============================================================================
+
+ ivar = ieiph
+ ipp = ipprtp(ivar)
+ isou = 7
+
+ call reseps &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm(1,ivar) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , grdvit , produc ,grarox , graroy , graroz , &
+ ckupdc , smacel(1,ivar) , smacel(1,ipriph), &
+ viscf , viscb , &
+ tslagr , &
+ dam , xam , drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 6. CLIPPING
+!===============================================================================
+
+ iclip = 2
+ call clprij &
+ !==========
+ ( ncelet , ncel , nvar , nphas , &
+ iphas , iclip , &
+ propce , rtpa , rtp )
+
+
+!--------
+! FORMATS
+!--------
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format(/, &
+' ** PHASE ',I4,' RESOLUTION DU Rij-EPSILON LRR ',/,&
+' ------------------------------------------ ',/)
+ 1001 format(/, &
+' ** PHASE ',I4,' RESOLUTION DU Rij-EPSILON SSG ',/,&
+' ------------------------------------------ ',/)
+
+#else
+
+ 1000 format(/, &
+' ** PHASE ',I4,' SOLVING Rij-EPSILON LRR' ,/,&
+' ------------------------------------' ,/)
+ 1001 format(/, &
+' ** PHASE ',I4,' SOLVING Rij-EPSILON SSG' ,/,&
+' ------------------------------------' ,/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/typecl.f90 b/src/base/typecl.f90
new file mode 100644
index 0000000..098621a
--- /dev/null
+++ b/src/base/typecl.f90
@@ -0,0 +1,1866 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine typecl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , icodcl , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , frcxt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! Function :
+! --------
+
+! Handle boundary condition type code (itypfb)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! itrifb(nfabor ! te ! --> ! tab d'indirection pour tri des faces !
+! nphas) ! ! ! !
+! icodcl ! te ! <-- ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! isostd ! te ! --> ! indicateur de sortie standard !
+! (nfabor+1) ! ! ! +numero de la face de reference !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rijipb ! tr ! --- ! tab de trav pour valeurs en iprime !
+! (nfabor,6 ) ! ! ! des rij au bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Fortran common blocks
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer isostd(nfabor+1,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision frcxt(ncelet,3,nphas)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! Local variables
+
+character chaine*80
+integer idebia, idebra
+integer ifac, ivar, iel
+integer iok, inc, iccocg, ideb, ifin, inb, isum, iwrnp
+integer ifrslb(nphsmx), itbslb(nphsmx)
+integer ityp, ii, jj, iphas, iwaru, iflmab
+integer nswrgp, imligp, iwarnp
+integer ipriph, iuiph, iviph, iwiph
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip,ir23ip
+integer ikiph , iepiph, iphiph, ifbiph, iomgip
+integer iprnew, kphas, iii
+integer irangd, iclipr, iiptot
+integer itrois, ifadir, nfadir
+double precision pref, epsrgp, climgp, extrap, coefup
+double precision diipbx, diipby, diipbz
+double precision flumbf, flumty(ntypmx)
+double precision ro0iph, p0iph, pr0iph, xxp0, xyp0, xzp0
+double precision xyzref(3)
+
+integer ipass
+data ipass /0/
+save ipass
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. Initialization
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. Check consistency of types given in usclim
+!===============================================================================
+
+iok = 0
+
+do iphas = 1, nphas
+ do ifac = 1, nfabor
+ ityp = itypfb(ifac,iphas)
+ if(ityp.le.0.or.ityp.gt.ntypmx) then
+ itypfb(ifac,iphas) = 0
+ iok = iok + 1
+ endif
+ enddo
+enddo
+
+if (irangp.ge.0) call parcmx(iok)
+if(iok.ne.0) then
+ call bcderr(nphas, itypfb)
+endif
+
+!===============================================================================
+! 3. Sort boundary faces
+!===============================================================================
+
+
+! Count faces of each type (temporarily in ifinty)
+
+do iphas = 1, nphas
+ do ii = 1, ntypmx
+ ifinty(ii,iphas) = 0
+ enddo
+enddo
+
+do iphas = 1, nphas
+ do ifac = 1, nfabor
+ ityp = itypfb(ifac,iphas)
+ ifinty(ityp,iphas) = ifinty(ityp,iphas) + 1
+ enddo
+enddo
+
+
+! Set start of each group of faces in itrifb (sorted by type): idebty
+
+do iphas = 1, nphas
+ do ii = 1, ntypmx
+ idebty(ii,iphas) = 1
+ enddo
+enddo
+
+do iphas = 1, nphas
+ do ii = 1, ntypmx-1
+ do jj = ii+1, ntypmx
+ idebty(jj,iphas) = idebty(jj,iphas) + ifinty(ii,iphas)
+ enddo
+ enddo
+enddo
+
+! Sort faces in itrifb and use the opportunity to correctly set ifinty
+
+do iphas = 1, nphas
+ do ii = 1, ntypmx
+ ifinty(ii,iphas) = idebty(ii,iphas)-1
+ enddo
+enddo
+
+do iphas = 1, nphas
+ do ifac = 1, nfabor
+ ityp = itypfb(ifac,iphas)
+ ifin = ifinty(ityp,iphas)+1
+ itrifb(ifin,iphas) = ifac
+ ifinty(ityp,iphas) = ifin
+ enddo
+enddo
+
+! Basic check
+
+iok = 0
+do iphas = 1, nphas
+ do ii = 1, ntypmx-1
+ if(ifinty(ii,iphas).ge.idebty(ii+1,iphas)) then
+ if (iok.eq.0) iok = ii
+ endif
+ enddo
+ if (irangp.ge.0) call parcmx(iok)
+ if (iok.gt.0) then
+ ii = iok
+ write(nfecra,2010) iphas
+ if(ifinty(ii,iphas).ge.idebty(ii+1,iphas)) then
+ write(nfecra,2020) (ifinty(jj,iphas),jj=1,ntypmx)
+ write(nfecra,2030) (idebty(jj,iphas),jj=1,ntypmx)
+ write(nfecra,2040) (itypfb(jj,iphas),jj=1,nfabor)
+ write(nfecra,2098) ii,ifinty(ii,iphas),ii+1,idebty(ii+1,iphas)
+ else
+ write(nfecra,2099) ii,ii+1
+ endif
+ call csexit (1)
+ endif
+enddo
+
+iok = 0
+do iphas = 1, nphas
+ isum = 0
+ do ii = 1, ntypmx
+ isum = isum + ifinty(ii,iphas) - idebty(ii,iphas) + 1
+ enddo
+ if (irangp.ge.0) call parcpt (isum)
+ if(isum.ne.nfbrgb) then
+ write(nfecra,3099) iphas, isum, nfbrgb
+ iok = iok + 1
+ endif
+enddo
+if (iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+
+! ---> On ecrit les types de faces avec la borne inf et sup et le nb
+! pour chaque type de face trouve (tjrs pour les types par defaut)
+
+if(ipass.eq.0.or.iwarni(iu(1)).ge.2) then
+
+ ipass = 1
+
+ write(nfecra,6010)
+
+ do iphas = 1, nphas
+
+ write(nfecra,6011)iphas
+
+ if ( ippmod(icompf).lt.0 ) then
+
+ ii = ientre
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Entree ', ii, inb
+ ii = iparoi
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Paroi lisse ', ii, inb
+ ii = iparug
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Paroi rugueuse ', ii, inb
+ ii = isymet
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Symetrie ', ii, inb
+ ii = isolib
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Sortie libre ', ii, inb
+
+ if (nbrcpl.ge.1) then
+ ii = icscpl
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Couplage sat/sat ', ii, inb
+ endif
+
+ ii = iindef
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Indefini ', ii, inb
+
+ do ii = 1, ntypmx
+ if (ii.ne.ientre .and. &
+ ii.ne.iparoi .and. &
+ ii.ne.iparug .and. &
+ ii.ne.isymet .and. &
+ ii.ne.isolib .and. &
+ ii.ne.icscpl .and. &
+ ii.ne.iindef ) then
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ if(inb.gt.0) then
+ write(nfecra,6020) 'Type utilisateur ', ii, inb
+ endif
+ endif
+ enddo
+
+ else
+
+ ii = ieqhcf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Entree sub. enth.', ii, inb
+
+ ii = ierucf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Entree subsonique', ii, inb
+
+ ii = iesicf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Entree/Sortie imp', ii, inb
+
+ ii = isopcf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Sortie subsonique', ii, inb
+
+ ii = isspcf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Sortie supersoniq', ii, inb
+
+ ii = iparoi
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Paroi lisse ', ii, inb
+
+ ii = iparug
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Paroi rugueuse ', ii, inb
+
+ ii = isymet
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Symetrie ', ii, inb
+
+ ii = iindef
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ write(nfecra,6020) 'Indefini ', ii, inb
+
+ do ii = 1, ntypmx
+ if (ii.ne.iesicf .and. &
+ ii.ne.isspcf .and. &
+ ii.ne.ieqhcf .and. &
+ ii.ne.ierucf .and. &
+ ii.ne.isopcf .and. &
+ ii.ne.iparoi .and. &
+ ii.ne.iparug .and. &
+ ii.ne.isymet .and. &
+ ii.ne.iindef ) then
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) call parcpt (inb)
+ if(inb.gt.0) then
+ write(nfecra,6020) 'Type utilisateur ',ii, inb
+ endif
+ endif
+ enddo
+
+ endif
+
+ write(nfecra,6030)
+
+ enddo
+
+endif
+
+!================================================================================
+! 4. rcodcl(., .,1) has been initialized as rinfin so as to check what
+! the user has modified. Those not modified are reset to zero here.
+! isolib and ientre are handled later.
+!================================================================================
+
+do iphas = 1, nphas
+ do ivar=1, nvar
+ do ifac = 1, nfabor
+ if((itypfb(ifac,iphas) .ne. isolib) .and. &
+ (itypfb(ifac,iphas) .ne. ientre) .and. &
+ (rcodcl(ifac,ivar,1) .gt. rinfin*0.5d0)) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+ enddo
+enddo
+
+
+!===============================================================================
+! 5. Compute pressure at boundary (in coefu(*,1))
+! (if we need it, that is if there are outlet boudary faces).
+
+! The loop on phases starts here and ends at the end of the next block.
+!===============================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+ ro0iph = ro0 (iphas)
+ p0iph = p0 (iphas)
+ pr0iph = pred0(iphas)
+ xxp0 = xyzp0(1,iphas)
+ xyp0 = xyzp0(2,iphas)
+ xzp0 = xyzp0(3,iphas)
+ ipriph = ipr (iphas)
+ iuiph = iu (iphas)
+ iviph = iv (iphas)
+ iwiph = iw (iphas)
+ if(itytur(iphas).eq.2) then
+ ikiph = ik(iphas)
+ iepiph = iep(iphas)
+ elseif(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ iepiph = iep(iphas)
+ elseif(iturb(iphas).eq.50) then
+ ikiph = ik(iphas)
+ iepiph = iep(iphas)
+ iphiph = iphi(iphas)
+ ifbiph = ifb(iphas)
+ elseif(iturb(iphas).eq.60) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+ endif
+
+! Check if the pressure (unique) has not been handled already
+
+ iprnew = 1
+ if(iphas.gt.1) then
+ do kphas = 1, iphas-1
+ if(ipr(iphas).eq.ipr(kphas)) then
+ iprnew = 0
+ endif
+ enddo
+ endif
+
+! ifrslb = first free standard outlet face (ICODCL not modified)
+! itbslb = max of ifrslb on all ranks, standard outlet face presence inidcator
+
+ ifrslb(iphas) = 0
+ do ii = ifinty(isolib,iphas), idebty(isolib,iphas), -1
+ ifac = itrifb(ii,iphas)
+ if (icodcl(ifac,ipriph).eq.0) &
+ ifrslb(iphas) = ifac
+ enddo
+ itbslb(iphas) = ifrslb(iphas)
+ if (irangp.ge.0) then
+ call parcmx (itbslb(iphas))
+ endif
+
+ if ((itbslb(iphas).gt.0) .and. (iprnew.eq.1)) then
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ipriph)
+ imligp = imligr(ipriph)
+ iwarnp = iwarni(ipriph)
+ epsrgp = epsrgr(ipriph)
+ climgp = climgr(ipriph)
+ extrap = extrag(ipriph)
+ iclipr = iclrtp(ipriph,icoef)
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipriph , imrgra , inc , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ rtpa(1,ipriph) , coefa(1,iclipr) , coefb(1,iclipr) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! Put in coefu the value at I' or F (depending on iphydr) of the
+! total pressure, computed from P*
+
+ if (iphydr.eq.0) then
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+ coefu(ifac,1) = rtpa(ii,ipriph) &
+ + diipbx*w1(ii)+ diipby*w2(ii) + diipbz*w3(ii) &
+ + ro0iph*( gx*(cdgfbo(1,ifac)-xxp0) &
+ + gy*(cdgfbo(2,ifac)-xyp0) &
+ + gz*(cdgfbo(3,ifac)-xzp0)) &
+ + p0iph - pr0iph
+ enddo
+ else
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ coefu(ifac,1) = rtpa(ii,ipriph) &
+ + (cdgfbo(1,ifac)-xyzcen(1,ii))*w1(ii) &
+ + (cdgfbo(2,ifac)-xyzcen(2,ii))*w2(ii) &
+ + (cdgfbo(3,ifac)-xyzcen(3,ii))*w3(ii) &
+ + ro0iph*( gx*(cdgfbo(1,ifac)-xxp0) &
+ + gy*(cdgfbo(2,ifac)-xyp0) &
+ + gz*(cdgfbo(3,ifac)-xzp0)) &
+ + p0iph - pr0iph
+ enddo
+ endif
+
+ endif
+
+
+!===============================================================================
+! 6. Convert to rcodcl and icodcl
+! (if this has not already been set by the user)
+
+! First, process variables for which a specific treatement is done
+! (pressure, velocity, ...)
+!===============================================================================
+
+! 6.1 ENTREE
+! ===========
+
+! ---> La pression a un traitement Neumann, le reste Dirichlet
+! sera traite plus tard.
+
+ ideb = idebty(ientre,iphas)
+ ifin = ifinty(ientre,iphas)
+
+ do ivar = 1, nvar
+ if (ivar.eq.ipriph) then
+ if(iprnew.eq.1) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ endif
+ endif
+ enddo
+
+
+! 6.2 SORTIE (entr�e-sortie libre) (ISOLIB)
+! ===================
+
+! ---> La pression a un traitement Dirichlet, les vitesses 9
+! (le reste Neumann, ou Dirichlet si donn�e utilisateur,
+! sera traite plus tard)
+
+ if (iphydr.eq.1) then
+
+! En cas de prise en compte de la pression hydrostatique,
+! on remplit le tableau ISOSTD
+! 0 -> pas une face de sortie standard (i.e. pas sortie ou sortie avec CL
+! de pression modifiee)
+! 1 -> face de sortie libre avec CL de pression automatique.
+! le numero de la face de reference est stocke dans ISOSTD(NFABOR+1,IPHAS)
+! qui est d'abord initialise a -1 (i.e. pas de face de sortie std)
+ isostd(nfabor+1,iphas) = -1
+ do ifac = 1,nfabor
+ isostd(ifac,iphas) = 0
+ if ((itypfb(ifac,iphas).eq.isolib).and. &
+ (icodcl(ifac,ipriph).eq.0)) then
+ isostd(ifac,iphas) = 1
+ endif
+ enddo
+ endif
+
+! ---> Pression de recalage (unique, meme s'il y a plusieurs sorties)
+! En cas de prise en compte de la pression hydrostatique, on cherche
+! la face de reference
+
+! Determination de la pression P I' unique en parallele
+! S'il y a des faces de sortie libre, on cherche le premier
+! proc sur lequel il y en a.
+
+! On recupere aussi les coordonnees du point de reference pour les
+! sorties, pour calculer PREF ensuite
+
+ if (itbslb(iphas).gt.0) then
+
+ if (irangp.ge.0) then
+
+! Indicateur de sorties locales et pointeur sur la premiere face
+! S'il y a des sorties libres standards quelque part
+! et s'il n'y en a pas en local, on affecte a IRANGD la valeur -1
+ if(ifrslb(iphas).le.0) then
+ irangd = -1
+! et s'il y en a en local, on affecte a IRANGD la valeur IRANGP
+ else
+ irangd = irangp
+ endif
+
+! Valeur de P I'
+! on prend le numero du dernier proc sur lequel il y en a
+ call parcmx(irangd)
+! si c'est le proc courant, on affecte P I' a COEFUP
+ if (irangp.eq.irangd) then
+ coefup = coefu(ifrslb(iphas),1)
+ if (iphydr.eq.1) isostd(nfabor+1,iphas) = ifrslb(iphas)
+! sinon on affecte 0 a COEFUP
+ else
+ coefup = 0.d0
+ endif
+! la somme sur les procs de COEFUP donne donc P I', disponible
+! pour tous les procs (c'est plus simple qu'un bcast pour
+! lequel il faudrait au prealable que tous les proc sachent
+! quel proc envoie).
+ call parsom(coefup)
+
+! Reference de pression pour les sorties
+ if (irangp.eq.irangd) then
+ xyzref(1) = cdgfbo(1,ifrslb(iphas))
+ xyzref(2) = cdgfbo(2,ifrslb(iphas))
+ xyzref(3) = cdgfbo(3,ifrslb(iphas))
+ else
+ xyzref(1) = 0.d0
+ xyzref(2) = 0.d0
+ xyzref(3) = 0.d0
+ endif
+ itrois = 3
+ call parrsm(itrois,xyzref)
+
+! Determination de la pression P I' unique en sequentiel
+! on repere la premiere face de sortie libre standard
+! et on affecte PI' a COEFUP
+
+ else
+
+ coefup = coefu(ifrslb(iphas),1)
+ if (iphydr.eq.1) isostd(nfabor+1,iphas) = ifrslb(iphas)
+ xyzref(1) = cdgfbo(1,ifrslb(iphas))
+ xyzref(2) = cdgfbo(2,ifrslb(iphas))
+ xyzref(3) = cdgfbo(3,ifrslb(iphas))
+ endif
+
+! Si l'utilisateur n'a rien specifie, on met IXYZP0 a 2 pour mettre
+! a jour le point de reference
+ if (ixyzp0(iphas).eq.-1) ixyzp0(iphas) = 2
+
+ elseif (ixyzp0(iphas).lt.0) then
+! S'il n'y a pas de faces de sortie, on cherche des Dirichlets
+! eventuels specifies par l'utilisateur pour y localiser
+! le point de reference.
+ ifadir = -1
+ irangd = -1
+ do ifac = 1, nfabor
+ if (icodcl(ifac,ipriph).eq.1) then
+ ifadir = ifac
+ irangd = irangp
+ endif
+ enddo
+ nfadir = ifadir
+ if (irangp.ge.0) call parcmx(nfadir)
+ if (nfadir.gt.0) then
+! on met IXYZP0 a 2 pour mettre a jour le point de reference
+ ixyzp0(iphas) = 2
+! en parallele on prend le numero du dernier proc sur lequel il y en a
+ if (irangp.ge.0) then
+ call parcmx(irangd)
+ if (irangp.eq.irangd) then
+ xyzref(1) = cdgfbo(1,ifadir)
+ xyzref(2) = cdgfbo(2,ifadir)
+ xyzref(3) = cdgfbo(3,ifadir)
+ else
+ xyzref(1) = 0.d0
+ xyzref(2) = 0.d0
+ xyzref(3) = 0.d0
+ endif
+ itrois = 3
+ call parrsm(itrois,xyzref)
+ else
+ xyzref(1) = cdgfbo(1,ifadir)
+ xyzref(2) = cdgfbo(2,ifadir)
+ xyzref(3) = cdgfbo(3,ifadir)
+ endif
+ endif
+
+ endif
+
+
+! Si le point de reference n'a pas ete specifie par l'utilisateur
+! on le change et on decale alors COEFU s'il y a des sorties.
+! La pression totale dans PROPCE est aussi decalee (c'est a priori
+! inutile sauf si l'utilisateur l'utilise dans ustsns par exemple)
+
+ if (ixyzp0(iphas).eq.2) then
+ ixyzp0(iphas) = 1
+ iiptot = ipproc(iprtot(iphas))
+ xxp0 = xyzref(1) - xyzp0(1,iphas)
+ xyp0 = xyzref(2) - xyzp0(2,iphas)
+ xzp0 = xyzref(3) - xyzp0(3,iphas)
+ xyzp0(1,iphas) = xyzref(1)
+ xyzp0(2,iphas) = xyzref(2)
+ xyzp0(3,iphas) = xyzref(3)
+ do iel = 1, ncelet
+ propce(iel,iiptot) = propce(iel,iiptot) &
+ - ro0iph*( gx*xxp0 + gy*xyp0 + gz*xzp0 )
+ enddo
+ if (itbslb(iphas).gt.0) then
+ write(nfecra,8000)iphas,xxp0,xyp0,xzp0
+ do ifac = 1, nfabor
+ coefu(ifac,1) = coefu(ifac,1) &
+ - ro0iph*( gx*xxp0 + gy*xyp0 + gz*xzp0 )
+ enddo
+ coefup = coefup - ro0iph*( gx*xxp0 + gy*xyp0 + gz*xzp0 )
+ else
+ write(nfecra,8001)iphas,xxp0,xyp0,xzp0
+ endif
+ elseif (ixyzp0(iphas).eq.-1) then
+! Il n'y a pas de sorties ni de Dirichlet et l'utilisateur n'a
+! rien specifie -> on met IXYZP0 a 0 pour ne plus y toucher, tout
+! en differenciant du cas =1 qui necessitera une ecriture en suite
+ ixyzp0(iphas) = 0
+ endif
+
+! La pression totale doit etre recalee en Xref a la valeur
+! Po + rho_0*g.(Xref-X0)
+ if (itbslb(iphas).gt.0) then
+ xxp0 = xyzp0(1,iphas)
+ xyp0 = xyzp0(2,iphas)
+ xzp0 = xyzp0(3,iphas)
+ pref = p0(iphas) &
+ + ro0iph*( gx*(xyzref(1)-xxp0) &
+ + gy*(xyzref(2)-xyp0) &
+ + gz*(xyzref(3)-xzp0) ) &
+ - coefup
+ endif
+
+
+! ---> Entree/Sortie libre
+
+ ideb = idebty(isolib,iphas)
+ ifin = ifinty(isolib,iphas)
+
+ do ivar = 1, nvar
+ if (ivar.eq.ipriph) then
+ if(iprnew.eq.1) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 1
+ rcodcl(ifac,ivar,1) = coefu(ifac,1) + pref
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ endif
+ elseif(ivar.eq.iuiph.or.ivar.eq.iviph.or.ivar.eq.iwiph) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 9
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ endif
+ enddo
+
+
+! 6.3 SYMETRIE
+! =============
+
+! ---> Les vecteurs et tenseurs ont un traitement particulier
+! le reste Neumann sera traite plus tard
+
+ ideb = idebty(isymet,iphas)
+ ifin = ifinty(isymet,iphas)
+
+ do ivar = 1, nvar
+ if ( ivar.eq.iuiph.or.ivar.eq.iviph.or.ivar.eq.iwiph.or. &
+ ( itytur(iphas).eq.3.and. &
+ (ivar.eq.ir11ip.or.ivar.eq.ir22ip.or.ivar.eq.ir33ip.or. &
+ ivar.eq.ir12ip.or.ivar.eq.ir13ip.or.ivar.eq.ir23ip) &
+ ) ) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 4
+! RCODCL(IFAC,IVAR,1) = Modifie eventuellement par l'ALE
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ elseif(ivar.eq.ipriph) then
+ if(iprnew.eq.1) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ endif
+ endif
+ enddo
+
+! 6.4 PAROI LISSE
+! ===============
+
+! ---> La vitesse et les grandeurs turbulentes ont le code 5
+! le reste Neumann sera traite plus tard
+
+ ideb = idebty(iparoi,iphas)
+ ifin = ifinty(iparoi,iphas)
+
+ do ivar = 1, nvar
+ if ( ivar.eq.iuiph.or.ivar.eq.iviph.or.ivar.eq.iwiph) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 5
+! RCODCL(IFAC,IVAR,1) = Utilisateur
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ elseif ( &
+ ( itytur(iphas).eq.2.and. &
+ (ivar.eq.ikiph .or.ivar.eq.iepiph) ).or. &
+ ( itytur(iphas).eq.3.and. &
+ (ivar.eq.ir11ip.or.ivar.eq.ir22ip.or.ivar.eq.ir33ip.or. &
+ ivar.eq.ir12ip.or.ivar.eq.ir13ip.or.ivar.eq.ir23ip.or. &
+ ivar.eq.iepiph) ).or. &
+ ( iturb(iphas).eq.50.and. &
+ (ivar.eq.ikiph.or.ivar.eq.iepiph.or.ivar.eq.iphiph.or. &
+ ivar.eq.ifbiph) ).or. &
+ ( iturb(iphas).eq.60.and. &
+ (ivar.eq.ikiph.or.ivar.eq.iomgip) ) ) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 5
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ elseif(ivar.eq.ipriph) then
+ if(iprnew.eq.1) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ endif
+ endif
+ enddo
+
+! 6.5 PAROI RUGUEUSE
+! ==================
+
+! ---> La vitesse et les grandeurs turbulentes ont le code 6
+! la rugosite est stockee dans rcodcl(..,..,3)
+! le reste Neumann sera traite plus tard (idem paroi lisse)
+
+ ideb = idebty(iparug,iphas)
+ ifin = ifinty(iparug,iphas)
+
+ do ivar = 1, nvar
+ if ( ivar.eq.iuiph.or.ivar.eq.iviph.or.ivar.eq.iwiph) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 6
+! RCODCL(IFAC,IVAR,1) = Utilisateur
+ rcodcl(ifac,ivar,2) = rinfin
+! RCODCL(IFAC,IVAR,3) = Utilisateur
+ endif
+ enddo
+ elseif ( &
+ ( itytur(iphas).eq.2.and. &
+ (ivar.eq.ikiph .or.ivar.eq.iepiph) ).or. &
+ ( itytur(iphas).eq.3.and. &
+ (ivar.eq.ir11ip.or.ivar.eq.ir22ip.or.ivar.eq.ir33ip.or. &
+ ivar.eq.ir12ip.or.ivar.eq.ir13ip.or.ivar.eq.ir23ip.or. &
+ ivar.eq.iepiph) ).or. &
+ ( iturb(iphas).eq.50.and. &
+ (ivar.eq.ikiph.or.ivar.eq.iepiph.or.ivar.eq.iphiph.or. &
+ ivar.eq.ifbiph) ).or. &
+ ( iturb(iphas).eq.60.and. &
+ (ivar.eq.ikiph.or.ivar.eq.iomgip) ) ) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 6
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ elseif(ivar.eq.ipriph) then
+ if(iprnew.eq.1) then
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ endif
+ endif
+ enddo
+
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+!===============================================================================
+! 6.bis CONVERSION EN RCODCL ICODCL
+! (SI CE DERNIER N'A PAS DEJA ETE RENSEIGNE PAR L'UTILISATEUR)
+
+! MAINTENANT LES VARIABLES POUR LESQUELLES IL N'EXISTE PAS DE
+! TRAITEMENT PARTICULIER (HORS PRESSION, VITESSE ...)
+!===============================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! 6.1 ENTREE bis
+! ===========
+
+! ---> La pression a un traitement Neumann (deja traitee plus haut),
+! La vitesse Dirichlet. Les scalaires ont un traitement
+! Dirichlet si l'utilisateur fournit une valeur, sinon on utilise
+! Neumann homogene si le flux de masse est sortant (erreur sinon).
+
+ ideb = idebty(ientre,iphas)
+ ifin = ifinty(ientre,iphas)
+
+ iok = 0
+ do ivar = 1, nvar
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+
+ if (ivar.eq.iuiph.or.ivar.eq.iviph.or.ivar.eq.iwiph) &
+ then
+ if (rcodcl(ifac,ivar,1).gt.rinfin*0.5d0) then
+ itypfb(ifac,iphas) = - abs(itypfb(ifac,iphas))
+ if (iok.eq.0.or.iok.eq.2) iok = iok + 1
+ else
+ icodcl(ifac,ivar) = 1
+! RCODCL(IFAC,IVAR,1) = Utilisateur
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+
+ elseif (rcodcl(ifac,ivar,1).gt.rinfin*0.5d0) then
+
+ flumbf = propfb(ifac,ipprob(ifluma(iuiph)))
+ if( flumbf.ge.-epzero) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ else
+ itypfb(ifac,iphas) = - abs(itypfb(ifac,iphas))
+ if (iok.lt.2) iok = iok + 2
+ endif
+ else
+ icodcl(ifac,ivar) = 1
+! RCODCL(IFAC,IVAR,1) = Utilisateur
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+
+ endif
+ enddo
+ enddo
+
+ if (irangp.ge.0) call parcmx(iok)
+ if (iok.gt.0) then
+ if (iok.eq.1 .or. iok.eq.3) write(nfecra,6060)
+ if (iok.eq.2 .or. iok.eq.3) write(nfecra,6070)
+ call bcderr(nphas, itypfb)
+ endif
+
+
+
+! 6.2 SORTIE (entree sortie libre)
+! ===================
+
+! ---> La pression a un traitement Dirichlet, les vitesses 9 ont ete
+! traites plus haut.
+! Le reste Dirichlet si l'utilisateur fournit une donnee
+! (flux de masse entrant ou sortant).
+! S'il n'y a pas de donnee utilisateur, on utilise un Neumann homogene
+! (flux entrant et sortant)
+
+
+! ---> Sortie ISOLIB
+
+ ideb = idebty(isolib,iphas)
+ ifin = ifinty(isolib,iphas)
+
+ do ivar = 1, nvar
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+
+ if (rcodcl(ifac,ivar,1).gt.rinfin*0.5d0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ else
+ icodcl(ifac,ivar) = 1
+! RCODCL(IFAC,IVAR,1) = Utilisateur
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ endif
+ enddo
+ enddo
+
+
+
+! 6.3 SYMETRIE bis
+! =============
+
+! ---> Les vecteurs et tenseurs ont un traitement particulier
+! traite plus haut
+! le reste Neumann
+
+ ideb = idebty(isymet,iphas)
+ ifin = ifinty(isymet,iphas)
+
+ do ivar = 1, nvar
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ enddo
+
+! 6.4 PAROI LISSE bis
+! ===============
+
+! ---> La vitesse et les grandeurs turbulentes ont le code 5
+! traite plus haut
+! le reste Neumann
+
+ ideb = idebty(iparoi,iphas)
+ ifin = ifinty(iparoi,iphas)
+
+ do ivar = 1, nvar
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ enddo
+
+! 6.5 PAROI RUGUEUSE bis
+! ==================
+
+! ---> La vitesse et les grandeurs turbulentes ont le code 6
+! traite plus haut
+! le reste Neumann
+
+ ideb = idebty(iparug,iphas)
+ ifin = ifinty(iparug,iphas)
+
+ do ivar = 1, nvar
+ do ii = ideb, ifin
+ ifac = itrifb(ii,iphas)
+ if(icodcl(ifac,ivar).eq.0) then
+ icodcl(ifac,ivar) = 3
+ rcodcl(ifac,ivar,1) = 0.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+ endif
+ enddo
+ enddo
+
+enddo
+! --- Boucle sur les phases : fin
+!===============================================================================
+! 7. RENFORCEMENT DIAGONALE DE LA MATRICE SI AUCUN POINTS DIRICHLET
+!===============================================================================
+! On renforce si ISTAT=0 et si l'option est activee (IDIRCL=1)
+! Si une de ces conditions est fausse, on force NDIRCL a valoir
+! au moins 1 pour ne pas declaer la diagonale.
+
+do ivar = 1, nvar
+ ndircl(ivar) = 0
+ if ( istat(ivar).gt.0 .or. idircl(ivar).eq.0 ) ndircl(ivar) = 1
+enddo
+
+do ivar = 1, nvar
+ do ifac = 1, nfabor
+ if( icodcl(ifac,ivar).eq.1 .or. icodcl(ifac,ivar).eq.5 ) then
+ ndircl(ivar) = ndircl(ivar) +1
+ endif
+ enddo
+ if (irangp.ge.0) call parcpt (ndircl(ivar))
+enddo
+
+!===============================================================================
+! 8. ON CALCULE LE FLUX DE MASSE AUX DIFFERENTS TYPES DE FACES
+! ET ON IMPRIME.
+
+! Ca serait utile de faire l'impression dans ECRLIS, mais attention,
+! on imprime le flux de masse du pas de temps precedent
+! or dans ECRLIS, on imprime a la fin du pas de temps
+! d'ou une petite incoherence possible.
+! D'autre part, ca serait utile de sortir d'autres grandeurs
+! (flux de chaleur par exemple, bilan de scalaires ...)
+
+!===============================================================================
+
+iwaru = -1
+do iphas = 1, nphas
+ iuiph = iu(iphas)
+ iwaru = max(iwarni(iuiph),iwaru)
+enddo
+if (irangp.ge.0) call parcmx(iwaru)
+
+if(iwaru.ge.1 .or. mod(ntcabs,ntlist).eq.0 &
+ .or.(ntcabs.le.ntpabs+2).or.(ntcabs.ge.ntmabs-1)) then
+ write(nfecra,7010)
+endif
+
+do iphas = 1, nphas
+
+ iuiph = iu(iphas)
+ iflmab = ipprob(ifluma(iuiph))
+
+ iwrnp = iwarni(iu(iphas))
+ if (irangp.ge.0) call parcmx (iwrnp)
+ !==========
+
+! On ecrit le flux de masse si IWARNI>0, a la periodicite NTLIST
+! et au deux premiers et deux derniers pas de temps.
+ if(iwrnp.ge.1 .or. mod(ntcabs,ntlist).eq.0 &
+ .or.(ntcabs.le.ntpabs+2).or.(ntcabs.ge.ntmabs-1)) then
+
+ do ii = 1, ntypmx
+ flumty(ii) = 0.d0
+ enddo
+
+ do ii = 1, ntypmx
+ ideb = idebty(ii,iphas)
+ ifin = ifinty(ii,iphas)
+ do jj = ideb, ifin
+ ifac = itrifb(jj,iphas)
+ flumty(ii) = flumty(ii) + propfb(ifac,iflmab)
+ enddo
+ enddo
+
+
+ write(nfecra,7011) iphas
+
+ if (ippmod(icompf).lt.0 ) then
+
+ ii = ientre
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Entree ',ii,inb,flumty(ii)
+ ii = iparoi
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Paroi lisse ',ii,inb,flumty(ii)
+ ii = iparug
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Paroi rugueuse ',ii,inb,flumty(ii)
+ ii = isymet
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Symetrie ',ii,inb,flumty(ii)
+
+ ii = isolib
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Sortie libre ',ii,inb,flumty(ii)
+
+ if (nbrcpl.ge.1) then
+ ii = icscpl
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Couplage sat/sat ',ii,inb,flumty(ii)
+ endif
+
+ ii = iindef
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Indefini ',ii,inb,flumty(ii)
+
+ do ii = 1, ntypmx
+ if( ii.ne.ientre .and. &
+ ii.ne.iparoi .and. &
+ ii.ne.iparug .and. &
+ ii.ne.isymet .and. &
+ ii.ne.isolib .and. &
+ ii.ne.icscpl .and. &
+ ii.ne.iindef ) then
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ if(inb.gt.0) then
+ write(nfecra,7020) &
+ 'Type utilisateur ',ii,inb,flumty(ii)
+ endif
+ endif
+ enddo
+
+ else
+
+ ii = ieqhcf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Entree sub. enth.',ii,inb,flumty(ii)
+
+ ii = ierucf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Entree subsonique',ii,inb,flumty(ii)
+
+ ii = iesicf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Entree/Sortie imp',ii,inb,flumty(ii)
+
+ ii = isopcf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Sortie subsonique',ii,inb,flumty(ii)
+
+ ii = isspcf
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Sortie supersoniq',ii,inb,flumty(ii)
+
+ ii = iparoi
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Paroi ',ii,inb,flumty(ii)
+
+ ii = isymet
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Symetrie ',ii,inb,flumty(ii)
+
+ ii = iindef
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ write(nfecra,7020) 'Indefini ',ii,inb,flumty(ii)
+
+ do ii = 1, ntypmx
+ if (ii.ne.iesicf .and. &
+ ii.ne.isspcf .and. &
+ ii.ne.ieqhcf .and. &
+ ii.ne.ierucf .and. &
+ ii.ne.isopcf .and. &
+ ii.ne.iparoi .and. &
+ ii.ne.isymet .and. &
+ ii.ne.iindef) then
+ inb = ifinty(ii,iphas)-idebty(ii,iphas)+1
+ if (irangp.ge.0) then
+ call parcpt (inb)
+ call parsom (flumty(ii))
+ endif
+ if(inb.gt.0) then
+ write(nfecra,7020) &
+ 'Type utilisateur ',ii,inb,flumty(ii)
+ endif
+ endif
+ enddo
+
+ endif
+
+ write(nfecra,7030)
+
+ endif
+
+enddo
+
+
+!===============================================================================
+! FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1099 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ CONDITIONS AUX LIMITES INCORRECTES OU INCOMPLETES ',/,&
+'@ ',/,&
+'@ La valeur du type ITYPFB des conditions aux limites doit',/,&
+'@ etre superieure ou egale a 1 ',/,&
+'@ et inferieure ou egale a ',I10 ,/,&
+'@ Une ou plusieurs erreurs sont listees ci-dessus. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage du sous-programme de definition des ',/,&
+'@ aux limites. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2010 format(/,' PHASE : ',I10)
+ 2020 format(/,' IFINTY : ',I10)
+ 2030 format(/,' IDEBTY : ',I10)
+ 2040 format(/,' ITYPFB : ',I10)
+ 2098 format(/, &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ PROBLEME DE TRI DES FACES DE BORD ',/,&
+'@ ',/,&
+'@ IFINTY(',I10 ,') = ',I10 ,/,&
+'@ est superieur a ',/,&
+'@ IDEBTY(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2099 format(/, &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ PROBLEME DE TRI DES FACES DE BORD SUR UN RANG DISTANT ',/,&
+'@ ',/,&
+'@ IFINTY(',I10 ,') ',/,&
+'@ est superieur a ',/,&
+'@ IDEBTY(',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3099 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ PROBLEME DE TRI DES FACES DE BORD ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ nombre de faces classees par type = ',I10 ,/,&
+'@ nombre de faces de bord NFABOR = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+ 6010 format ( /,/, &
+ ' ** INFORMATIONS SUR LE TYPE DE FACES DE BORD',/, &
+ ' -----------------------------------------',/)
+ 6011 format ( &
+' Phase : ',I4, /,&
+'---------------------------------------------------------------',&
+'----------', &
+ /,&
+'Type de bord Code Nb faces', &
+ /,&
+'---------------------------------------------------------------',&
+'----------')
+ 6020 format ( &
+ a17,i10,i12)
+ 6030 format( &
+'---------------------------------------------------------------',&
+'----------'/)
+
+ 6060 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ CONDITIONS AUX LIMITES INCORRECTES OU INCOMPLETES ',/,&
+'@ ',/,&
+'@ Au moins une face de bord declaree en entree ',/,&
+'@ (ou sortie) a vitesse imposee pour laquelle la valeur ',/,&
+'@ de la vitesse n''a pas ete fournie pour toutes les ',/,&
+'@ composantes. ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans l''Interface ',/,&
+'@ ou dans le sous-programme utilisateur correspondant. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 6070 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ CONDITIONS AUX LIMITES INCORRECTES OU INCOMPLETES ',/,&
+'@ ',/,&
+'@ Au moins une face de bord declaree en entree ',/,&
+'@ (ou sortie) a vitesse imposee avec un flux rentrant ',/,&
+'@ pour laquelle la valeur d''une variable n''a pas ete ',/,&
+'@ specifiee (condition de Dirichlet). ',/,&
+'@ Le calcul ne sera pas execute ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans l''Interface ',/,&
+'@ ou dans le sous-programme utilisateur correspondant. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+ 7010 format ( /,/, &
+ ' ** INFORMATIONS SUR LE FLUX DE MASSE AU BORD',/, &
+ ' -----------------------------------------',/)
+ 7011 format ( &
+' Phase : ',I4, /,&
+'---------------------------------------------------------------',&
+ /,&
+'Type de bord Code Nb faces Flux de masse',&
+ /,&
+'---------------------------------------------------------------')
+ 7020 format ( &
+ a17,i10,i12,6x,e18.9)
+ 7030 format( &
+'---------------------------------------------------------------',&
+ /)
+
+ 8000 format(/, &
+'PHASE ',I4,' : ',/,&
+'Faces de bord d''entree/sortie libre detectees ',/,&
+'Mise a jour du point de reference pour la pression totale ',/,&
+' XYZP0 = ',E14.5,E14.5,E14.5 ,/)
+ 8001 format(/, &
+'PHASE ',I4,' : ',/,&
+'Faces de bord a Dirichlet de pression impose detectees ',/,&
+'Mise a jour du point de reference pour la pression totale ',/,&
+' XYZP0 = ',E14.5,E14.5,E14.5 ,/)
+
+!-------------------------------------------------------------------------------
+
+#else
+
+ 1099 format( &
+'@' ,/,&
+'@' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT BY BOUNDARY CONDITION CHECK' ,/,&
+'@ ========' ,/,&
+'@ INCORRECT OR INCOMPLETE BOUNDARY CONDITIONS' ,/,&
+'@' ,/,&
+'@ Value of type ITYPFB for boundary conditions must be' ,/,&
+'@ greater or equal to 1' ,/,&
+'@ and less than or equal to ', I10 ,/,&
+'@ One or more errors are listed above.' ,/,&
+'@' ,/,&
+'@ The calculation will not be run.' ,/,&
+'@' ,/,&
+'@ Verify the boundary condition definitions in the' ,/,&
+'@ appropriate user subroutine.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/)
+
+ 2010 format(/,' PHASE : ',I10)
+ 2020 format(/,' IFINTY : ',I10)
+ 2030 format(/,' IDEBTY : ',I10)
+ 2040 format(/,' ITYPFB : ',I10)
+ 2098 format(/, &
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT BY BOUNDARY CONDITION CHECK' ,/,&
+'@ ========' ,/,&
+'@ PROBLEM WITH ORDERING OF BOUNDARY FACES' ,/,&
+'@' ,/,&
+'@ IFINTY(',I10 ,') = ',I10 ,/,&
+'@ is greater than' ,/,&
+'@ IDEBTY(',I10 ,') = ',I10 ,/,&
+'@' ,/,&
+'@ The calculation will not be run.' ,/,&
+'@' ,/,&
+'@ Contact support.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2099 format(/, &
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT BY BOUNDARY CONDITION CHECK' ,/,&
+'@ ========' ,/,&
+'@ PROBLEM WITH ORDERING OF BOUNDARY FACES' ,/,&
+'@ ON A DISTANT RANK.' ,/,&
+'@' ,/,&
+'@ IFINTY(',I10 ,') ',/,&
+'@ is greater than' ,/,&
+'@ IDEBTY(',I10 ,') ',/,&
+'@' ,/,&
+'@ The calculation will not be run.' ,/,&
+'@' ,/,&
+'@ Contact support.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3099 format( &
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT BY BOUNDARY CONDITION CHECK' ,/,&
+'@ ========' ,/,&
+'@ PROBLEM WITH ORDERING OF BOUNDARY FACES' ,/,&
+'@' ,/,&
+'@ Phase ',I10 ,/,&
+'@ number of faces classified by type = ',I10 ,/,&
+'@ number of boundary faces (NFABOR) = ',I10 ,/,&
+'@' ,/,&
+'@ The calculation will not be run.' ,/,&
+'@' ,/,&
+'@ Contact support.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+ 6010 format ( /,/, &
+ ' ** INFORMATION ON BOUNDARY FACES TYPE',/, &
+ ' ----------------------------------',/)
+ 6011 format ( &
+' Phase : ',I4, /,&
+'---------------------------------------------------------------',&
+'----------', &
+ /,&
+'Boundary type Code Nb faces', &
+ /,&
+'---------------------------------------------------------------',&
+'----------')
+ 6020 format ( &
+ a17,i10,i12)
+ 6030 format( &
+'---------------------------------------------------------------',&
+'----------'/)
+
+ 6060 format( &
+'@' ,/,&
+'@' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT BY BOUNDARY CONDITION CHECK' ,/,&
+'@ ========' ,/,&
+'@ INCORRECT OR INCOMPLETE BOUNDARY CONDITIONS' ,/,&
+'@' ,/,&
+'@ At least one boundary face declared as inlet (or' ,/,&
+'@ outlet) with prescribed velocity for which the' ,/,&
+'@ velocity value has not been assigned for all' ,/,&
+'@ components.' ,/,&
+'@ The calculation will not be run. ',/,&
+'@' ,/,&
+'@ Verify the boundary condition definitions in the GUI' ,/,&
+'@ or in the appropriate user subroutine.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 6070 format( &
+'@' ,/,&
+'@' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: ABORT BY BOUNDARY CONDITION CHECK' ,/,&
+'@ ========' ,/,&
+'@ INCORRECT OR INCOMPLETE BOUNDARY CONDITIONS' ,/,&
+'@' ,/,&
+'@ At least one boundary face declared as inlet (or' ,/,&
+'@ outlet) with prescribed velocity with an entering' ,/,&
+'@ flow for which the value of a variable has not been' ,/,&
+'@ specified (Dirichlet condition).' ,/,&
+'@ The calculation will not be run. ',/,&
+'@' ,/,&
+'@ Verify the boundary condition definitions in the GUI' ,/,&
+'@ or in the appropriate user subroutine.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+ 7010 format ( /,/, &
+ ' ** BOUNDARY MASS FLOW INFORMATION',/, &
+ ' ------------------------------',/)
+ 7011 format ( &
+' Phase : ',I4, /,&
+'---------------------------------------------------------------',&
+ /,&
+'Boundary type Code Nb faces Mass flow' , &
+ /,&
+'---------------------------------------------------------------')
+ 7020 format ( &
+ a17,i10,i12,6x,e18.9)
+ 7030 format( &
+'---------------------------------------------------------------',&
+ /)
+
+ 8000 format(/, &
+'PHASE ',I4,' :' ,/,&
+'Boundary faces with free inlet/outlet detected' ,/,&
+'Update of reference point for total pressure' ,/,&
+' XYZP0 = ',E14.5,E14.5,E14.5 ,/)
+ 8001 format(/, &
+'PHASE ',I4,' :' ,/,&
+'Boundary faces with pressure Dirichlet condition detected' ,/,&
+'Update of reference point for total pressure' ,/,&
+' XYZP0 = ',E14.5,E14.5,E14.5 ,/)
+
+#endif
+
+
+return
+end
diff --git a/src/base/undscr.f90 b/src/base/undscr.f90
new file mode 100644
index 0000000..ab9156a
--- /dev/null
+++ b/src/base/undscr.f90
@@ -0,0 +1,90 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine undscr &
+!================
+
+ ( ideb , ifin , chaine )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ON REMPLACE LES CARACTERES GENANTS PAR DES UNDERSCORES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ideb ! i ! <-- ! debut de la chaine !
+! ifin ! i ! <-- ! fin de la chaine !
+! chaine ! c ! <-- ! chaine de caracteres !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+! Arguments
+
+character chaine*(*)
+integer ideb, ifin
+
+! VARIABLES LOCALES
+
+integer nn
+
+!===============================================================================
+
+! Si chaine vide, on ne fait rien et en particulier
+! on ne modifie pas CHAINE(0:0)
+
+if(ideb.le.0.and.ifin.le.0) return
+
+do nn = ideb,ifin
+ IF(CHAINE(NN:NN).eq.' ') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'(') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.')') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'[') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.']') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'+') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'-') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'@') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'!') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'#') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'*') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'^') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'$') CHAINE(NN:NN) = '_'
+ IF(CHAINE(NN:NN).eq.'/') CHAINE(NN:NN) = '_'
+enddo
+
+end
diff --git a/src/base/vandri.f90 b/src/base/vandri.f90
new file mode 100644
index 0000000..673c243
--- /dev/null
+++ b/src/base/vandri.f90
@@ -0,0 +1,227 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vandri &
+!================
+
+ ( ndim , ncelet , ncel , nfac , nfabor , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ itypfb , ifabor , ifapat , idevel , ituser , ia , &
+ xyzcen , cdgfbo , uetbor , visvdr , yplusc , propce , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! IMPOSITION D'UN AMORTISSEMENT DE TYPE VAN DRIEST POUR LA LES
+! nut est amortie par (1-exp(-y+/d+))**2 ou d+ est mis par defaut a 26
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de la phase traitee !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifapat ! te ! <-- ! no de face de brd code 5 la + proche !
+! (ncelet) ! ! ! (rij et echo de paroi ) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! uetbor ! tr ! <-- ! vitesse de frottement au bord !
+! (nfabor,nphas ! ! ! pour van driest en les !
+! visvdr(nphas) ! tr ! <-- ! viscosite dynamique ds les cellules !
+! (ncelet,nphas ! ! ! de bord apres amortisst de v driest !
+! yplusc ! tr ! <-- ! valeur de yplus aux cellules !
+! (ncelet ) ! ! ! dans le cas abs(icdpar).eq.1 !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ndim, ncelet , ncel , nfac , nfabor, nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas
+integer itypfb(nfabor,nphas),ifabor(nfabor)
+integer ifapat(ncelet)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet),cdgfbo(ndim,nfabor)
+double precision uetbor(nfabor,nphas), visvdr(ncelet,nphas)
+double precision yplusc(ncelet)
+double precision propce(ncelet,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer iel , ifac , ipcvis, ipcvst, ipcrom
+double precision yplus , yminpa, viscos
+
+!===============================================================================
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+! Calcul direct de la distance a la paroi (non compatible parall/perio)
+if(abs(icdpar).eq.2) then
+
+! En sequentiel, RAS
+ if(irangp.lt.0) then
+ do iel = 1, ncel
+ ifac = ifapat(iel)
+ viscos = propce(iel,ipcvis)/propce(iel,ipcrom)
+ yminpa = sqrt((cdgfbo(1,ifac)-xyzcen(1,iel))**2 &
+ + (cdgfbo(2,ifac)-xyzcen(2,iel))**2 &
+ + (cdgfbo(3,ifac)-xyzcen(3,iel))**2)
+ yplus = uetbor(ifac,iphas) * yminpa/ viscos
+ propce(iel,ipcvst) = propce(iel,ipcvst)* &
+ (1.0d0-exp(-yplus/cdries(iphas)))**2
+ enddo
+! En parallele, on n'amortit que la premiere maille de paroi :
+! dangereux mais a priori inutile (car l'utilisation de
+! ICDPAR=+/-2 en parallele est bloque dans verini)
+ else
+ write(nfecra,1000)
+ do ifac = 1, nfabor
+ if(itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug ) then
+ iel = ifabor(ifac)
+ viscos = propce(iel,ipcvis)/propce(iel,ipcrom)
+ yminpa = sqrt((cdgfbo(1,ifac)-xyzcen(1,iel))**2 &
+ + (cdgfbo(2,ifac)-xyzcen(2,iel))**2 &
+ + (cdgfbo(3,ifac)-xyzcen(3,iel))**2)
+ yplus = uetbor(ifac,iphas) * yminpa/ viscos
+ propce(iel,ipcvst) = propce(iel,ipcvst)* &
+ (1.0d0-exp(-yplus/cdries(iphas)))**2
+ endif
+ enddo
+endif
+
+! Nouveau mode de calcul : c'est plus simple
+elseif(abs(icdpar).eq.1) then
+ do iel = 1, ncel
+ yplus = yplusc(iel)
+ propce(iel,ipcvst) = propce(iel,ipcvst)* &
+ (1.0d0-exp(-yplus/cdries(iphas)))**2
+ enddo
+endif
+
+! Pour les cellules de paroi on remet la viscosite turbulente
+! qui avait ete amortie dans clptur et qui a servi a calculer
+! les conditions aux limites
+do iel = 1, ncel
+ if (visvdr(iel,iphas).gt.-900.d0) &
+ propce(iel,ipcvst) = visvdr(iel,iphas)
+enddo
+
+!--------
+! FORMATS
+!--------
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : DANS LE CAS DE LA LES AVEC AMORTISSEMENT ',/,&
+'@ ========= ',/,&
+'@ L''AMORTISSEMENT DE VAN DRIEST N''EST FAIT QUE SUR LA ',/,&
+'@ PREMIERE CELLULE A LA PAROI EN CAS DE PARALLELISME ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/,&
+'@ @@ WARNING: IN CASE OF LES WITH DAMPING' ,/,&
+'@ ========' ,/,&
+'@ VAN DRIEST DAMPING IS ONLY EFFECTIVE ON THE FIRST CELL' ,/,&
+'@ OFF-WALL IN CASE OF PARALLELISM' ,/,&
+'@' ,/,&
+'@ The calculation will be run.' ,/,&
+'@' ,/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@' ,/)
+
+#endif
+!----
+! FIN
+!----
+
+
+return
+end
diff --git a/src/base/varpos.f90 b/src/base/varpos.f90
new file mode 100644
index 0000000..9c8bbb4
--- /dev/null
+++ b/src/base/varpos.f90
@@ -0,0 +1,4523 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine varpos &
+!================
+
+(nmodpp )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES SELON
+! LE TYPE DE CALCUL INDIQUE PAR L'UTILISATEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nmodpp ! e ! --> ! nombre de modeles phys.part. actives !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "albase.h"
+include "parall.h"
+include "lagpar.h"
+include "lagdim.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nmodpp
+
+! VARIABLES LOCALES
+
+
+character rubriq*64, cmoy4*4, cindfm*4
+integer ivar , ipp , iscal , iphas , iprop , iprofl
+integer ii , jj , kk , ll
+integer iok , ippok , ipppst
+integer iflum , icondl
+integer iest , iiflaa, ivisph, iprofa, ipropp
+integer imom , jmom , imold , jmold , jbmomt, jtcabs
+integer iiplus, iimoin, jmomok, idto , jdto
+integer ierror, irtyp , itysup, nbval
+integer idffin, idfmji, imomr , ilecec
+integer ilsmom, ivers , inmfin
+integer impamx
+integer nfmtmo, nberro
+integer idtold(nbmomx)
+integer nprayc, nprayb
+
+double precision gravn2
+
+integer ipass
+data ipass /0/
+save ipass
+
+integer nprmax
+data nprmax /0/
+save nprmax
+
+integer nppmax
+data nppmax /0/
+save nppmax
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+ipass = ipass + 1
+
+! Nombre max pour les formats choisis
+nfmtmo = 9999
+! Indefini a 4 caracteres
+CINDFM = 'YYYY'
+
+!===============================================================================
+! 1. PREMIER APPEL : VERIFICATION DU NOMBRE DE PHASES
+! RETURN
+!===============================================================================
+
+if(ipass.eq.1) then
+
+ iok = 0
+
+ if(nphas.le.0) then
+ write(nfecra,5000) nphas
+ iok = iok + 1
+ endif
+ if(nphas.gt.nphsmx) then
+ write(nfecra,5001) nphas, nphsmx, nphas
+ iok = iok + 1
+ endif
+
+ if(iok.ne.0) then
+ call csexit (1)
+ !==========
+ endif
+
+ return
+
+endif
+
+!===============================================================================
+! 2. SECOND APPEL : CALCUL DE NSCAPP
+! VERIFICATION DU NOMBRE DE SCALAIRES
+! CONSTRUCTION DE ISCAPP
+! CALCUL DE NSCAL
+! RETURN
+
+! C'est juste avant ce second appel que les modeles de combustion
+! auront ete renseignes. C'est dans la section ci-dessous qu'on en
+! en deduira NSCAPP (avant meme les verifications).
+! A la sortie de cette section, NSCAL, NSCAUS et NSCAPP sont connus.
+! On renseignera egalement ici les valeurs de IPHSCA, ISCAVR, IVISLS
+! pour les scalaires physiques particulieres en question.
+! On en profite aussi pour remplir ITYTUR puisque ITURB vient d'etre
+! defini.
+!===============================================================================
+
+if(ipass.eq.2) then
+
+! ---> Remplissage de ITYTUR
+ do iphas = 1, nphas
+ itytur(iphas) = iturb(iphas)/10
+ enddo
+
+! ---> Coherence modele
+! Rq : ATTENTION il faudrait renforcer le blindage
+
+ iok = 0
+ nmodpp = 0
+ do ipp = 2, nmodmx
+ if ( ippmod(ipp).ne.-1 ) then
+ nmodpp = nmodpp+1
+ ippok = ipp
+ endif
+ enddo
+ if ( nmodpp.gt.1 ) then
+ write(nfecra,6000)
+ iok = iok + 1
+ endif
+
+ if ( nmodpp.eq.1 ) then
+ if ( ippmod(ippok).lt.0 .or. ippmod(ippok).gt.5 ) then
+ write(nfecra,6001)
+ iok = iok + 1
+ endif
+ endif
+
+ if(iok.ne.0) then
+ call csexit (1)
+ !==========
+ endif
+
+! ---> On positionne l'indicateur global IPPMOD(IPHPAR)
+! 0 : pas de physique particuliere
+! 1 : physique particuliere enclenchee
+! 2 : physique particuliere avec definition du coefficient
+! d'absorption par fichier parametrique pour le rayonnement
+ ippmod(iphpar) = 0
+ if (nmodpp.gt.0) then
+ ippmod(iphpar) = 1
+ if (ippmod(icompf).eq.-1 .and. ippmod(iatmos).eq.-1 &
+ .and. ippmod(iaeros).eq.-1) &
+ ippmod(iphpar) = 2
+ endif
+
+! ---> Lecture donnees thermochimie
+
+ call pplecd
+ !==========
+
+! ---> Calcul de NSCAPP
+
+ call ppcsca
+ !==========
+
+
+! ---> Verifications
+
+ iok = 0
+
+ if(nscaus.lt.0) then
+ write(nfecra,6010) nscaus
+ iok = iok + 1
+ endif
+
+ if(nscaus.gt.0 .or. nscapp.gt.0) then
+ if((nscaus+nscapp).gt.nscamx) then
+
+ if(nscapp.le.0) then
+ write(nfecra,6011) &
+ nscaus, nscamx,nscamx ,nscaus
+ else
+ write(nfecra,6012) &
+ nscaus,nscapp,nscamx,nscamx-nscapp,nscaus+nscapp
+ endif
+ iok = iok + 1
+ endif
+ endif
+
+ if(iok.ne.0) then
+ call csexit (1)
+ !==========
+ endif
+
+! ---> Calcul de ISCAPP et NSCAL
+! On prefere que l'identite porte sur les scalaires utilisateurs,
+! ca minimisera peut etre des erreurs utilisateur
+
+ iscal = max(0,nscaus)
+ if (nscapp.gt.0) then
+ do ii = 1, nscapp
+ iscal = iscal + 1
+ iscapp(ii) = iscal
+ enddo
+
+ call ppvarp
+ !==========
+
+ endif
+
+ nscal = iscal
+
+ return
+
+endif
+
+
+!===============================================================================
+! 3. TROISIEME APPEL : VERIFICATIONS ET
+! POSITIONNEMENT DES VARIABLES : IPR, IU ... ISCA, NVAR
+! ET DES PROPRIETES PPALES
+!===============================================================================
+
+if(ipass.eq.3) then
+
+
+! ---> 3.1 VERIFICATIONS
+! -----------------
+
+ iok = 0
+
+! --- NPHAS et NSCAL ont deja ete verifies, mais on ne sait jamais.
+
+ if(nphas.le.0) then
+ write(nfecra,5000) nphas
+ iok = iok + 1
+ endif
+ if(nphas.gt.nphsmx) then
+ write(nfecra,5001) nphas, nphsmx, nphas
+ iok = iok + 1
+ endif
+
+ if(nscal.lt.0) then
+ write(nfecra,7010) nscal, nscaus, nscapp
+ iok = iok + 1
+ endif
+ if(nscal.gt.nscamx) then
+ write(nfecra,7011) nscal, nscamx, nscaus, nscapp, nscal
+ iok = iok + 1
+ endif
+
+! --- IPHSCA(ISCAL) doit etre compris entre 0 et NPHAS.
+
+ if(nscaus.gt.0) then
+ do ii = 1, nscaus
+ iscal = ii
+ if(iphsca(iscal).gt.nphas.or.iphsca(iscal).lt.0) then
+ write(nfecra,7020) iscal, iscal, ii,ii, &
+ iphsca(iscal), nphas
+ iok = iok + 1
+ endif
+ enddo
+ endif
+ if(nscapp.gt.0) then
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ if(iphsca(iscal).gt.nphas.or.iphsca(iscal).lt.0) then
+ write(nfecra,7021) iscal, iscal, ii,ii, &
+ iphsca(iscal), nphas
+ iok = iok + 1
+ endif
+ enddo
+ endif
+
+! --- ISCAVR(ISCAL) doit etre compris entre 0 et NSCAL.
+
+ if(nscaus.gt.0) then
+ do ii = 1, nscaus
+ iscal = ii
+ if(iscavr(iscal).gt.nscal.or.iscavr(iscal).lt.0) then
+ write(nfecra,7030) iscal,ii,ii,iscavr(iscal),nscal
+ iok = iok + 1
+ endif
+ enddo
+ endif
+ if(nscapp.gt.0) then
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ if(iscavr(iscal).gt.nscal.or.iscavr(iscal).lt.0) then
+ write(nfecra,7031) iscal,ii,ii,iscavr(iscal),nscal
+ iok = iok + 1
+ endif
+ enddo
+ endif
+
+
+! --- IVISLS(ISCAL) doit etre non initialise pour les variances
+! Il prend la valeur du scalaire associe
+! Tous les tests qui suivent sont utilises pour le message
+! d'erreur eventuel.
+
+ if(nscaus.gt.0) then
+ do jj = 1, nscaus
+ ii = jj
+ iscal = iscavr(ii)
+! Si on a une variance avec ivisls initialise : erreur
+ if ( (iscal.gt.0.and.iscal.le.nscal).and. &
+ ivisls(ii).ne.-1 ) then
+ ll = 0
+ do kk = 1, nscaus
+ if( kk .eq.iscal) ll = kk
+ enddo
+ do kk = 1, nscapp
+ if(iscapp(kk).eq.iscal) ll = -kk
+ enddo
+ if(ll.gt.0) then
+ write(nfecra,7040) &
+ ii,ii,jj,iscal,ll,jj,iscal,jj,ivisls(iscal)
+ else
+ write(nfecra,7041) &
+ ii,ii,jj,iscal,-ll,jj,iscal,jj,ivisls(iscal)
+ endif
+ iok = iok + 1
+! Si on n'a pas une variance std mais que ivisls est incorrect : erreur
+ elseif( (iscal.le.0 .or.iscal.gt.nscal).and. &
+ (ivisls(ii).ne.0.and.ivisls(ii).ne.1) ) then
+ write(nfecra,7050) ii,jj,jj,ivisls(ii)
+ iok = iok + 1
+ endif
+ enddo
+ endif
+
+ if(nscapp.gt.0) then
+ do jj = 1, nscapp
+ ii = iscapp(jj)
+ iscal = iscavr(ii)
+! Si on a une variance avec ivisls initialise : erreur
+ if ( (iscal.gt.0.and.iscal.le.nscal).and. &
+ ivisls(ii).ne.-1 ) then
+ ll = 0
+ do kk = 1, nscaus
+ if( kk .eq.iscal) ll = kk
+ enddo
+ do kk = 1, nscapp
+ if(iscapp(kk).eq.iscal) ll = -kk
+ enddo
+ if(ll.gt.0) then
+ write(nfecra,7042) &
+ ii,ii,jj,iscal,ll,jj,iscal,jj,ivisls(iscal)
+ else
+ write(nfecra,7043) &
+ ii,ii,jj,iscal,-ll,jj,iscal,jj,ivisls(iscal)
+ endif
+ iok = iok + 1
+! Si on n'a pas une variance std mais que ivisls est incorrect : erreur
+ elseif( (iscal.le.0 .or.iscal.gt.nscal).and. &
+ (ivisls(ii).ne.0.and.ivisls(ii).ne.1) ) then
+ write(nfecra,7051)ii,jj,jj,ivisls(ii)
+ iok = iok + 1
+ endif
+ enddo
+ endif
+
+! On initialise les ivisls des variances
+ if(nscal.gt.0) then
+ do ii = 1, nscal
+ iscal = iscavr(ii)
+ if(iscal.gt.0.and.iscal.le.nscal) then
+ ivisls(ii) = ivisls(iscal)
+ endif
+ enddo
+ endif
+
+! ---> IPHSCA
+! Pour les variances de fluctuations, les valeurs de IPHSCA
+! ne doivent pas avoir ete modifiees par l'utilisateur
+! Elles sont prises egales aux valeurs correspondantes
+! pour le scalaire associe.
+
+ if(nscaus.gt.0) then
+ do jj = 1, nscaus
+ ii = jj
+ iscal = iscavr(ii)
+ if(iscal.gt.0.and.iscal.le.nscal)then
+ if(iphsca(ii).eq.0) then
+ iphsca(ii) = iphsca(iscal)
+ else
+ ll = 0
+ do kk = 1, nscaus
+ if( kk .eq.iscal) ll = kk
+ enddo
+ do kk = 1, nscapp
+ if(iscapp(kk).eq.iscal) ll = -kk
+ enddo
+ if(ll.gt.0) then
+ write(nfecra,7060)ii, &
+ ii,jj,iscal,ll,jj,iscal, &
+ jj,iphsca(iscal)
+ else
+ write(nfecra,7061)ii, &
+ ii,jj,iscal,-ll,jj,iscal, &
+ jj,iphsca(iscal)
+ endif
+ iok = iok + 1
+ endif
+ endif
+ enddo
+ endif
+
+ if(nscapp.gt.0) then
+ do jj = 1, nscapp
+ ii = iscapp(jj)
+ iscal = iscavr(ii)
+ if(iscal.gt.0.and.iscal.le.nscal)then
+ if(iphsca(ii).eq.0) then
+ iphsca(ii) = iphsca(iscal)
+ else
+ ll = 0
+ do kk = 1, nscaus
+ if( kk .eq.iscal) ll = kk
+ enddo
+ do kk = 1, nscapp
+ if(iscapp(kk).eq.iscal) ll = -kk
+ enddo
+ if(ll.gt.0) then
+ write(nfecra,7062)ii, &
+ ii,jj,iscal,ll,jj,iscal, &
+ jj,iphsca(iscal)
+ else
+ write(nfecra,7063)ii, &
+ ii,jj,iscal,-ll,jj,iscal, &
+ jj,iphsca(iscal)
+ endif
+ iok = iok + 1
+ endif
+ endif
+ enddo
+ endif
+
+! ---> VISCOSITE ALE
+ if (iale.eq.1) then
+ if (iortvm.ne.0 .and. iortvm.ne.1) then
+ write(nfecra,7070) iortvm
+ iok = iok + 1
+ endif
+ endif
+! --- On s'arrete si quelque chose s'est mal passe
+
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+
+! ---> 3.2 POSITIONNEMENT DES VARIABLES : IPR, IU ... ISCA, NVAR
+! --------------------------------
+
+ ivar = 0
+
+ do iphas = 1, nphas
+
+! --- Pression : supposons ici qu'il n'y a qu'une pression
+! quelque soit le nombre de phases.
+! Le reste du code devrait se preter a l'extension, du fait
+! qu'il n'y a qu'ici qu'on fait cette hypothese (evidemment, il
+! faudrait ecrire un schema a deux pressions et remplacer navsto,
+! mais c'est un "detail"...relativement a ce qui nous occupe dans
+! le present sous-programme)
+
+ if(iphas.eq.1) then
+ ivar = ivar + 1
+ ipr (iphas) = ivar
+ else
+ ipr (iphas) = ipr(1)
+ endif
+
+! --- Vitesse
+ ivar = ivar + 1
+ iu (iphas) = ivar
+ ivar = ivar + 1
+ iv (iphas) = ivar
+ ivar = ivar + 1
+ iw (iphas) = ivar
+
+! --- Turbulence
+ if (itytur(iphas).eq.2) then
+ ivar = ivar + 1
+ ik (iphas) = ivar
+ ivar = ivar + 1
+ iep (iphas) = ivar
+ elseif(itytur(iphas).eq.3) then
+ ivar = ivar + 1
+ ir11 (iphas) = ivar
+ ivar = ivar + 1
+ ir22 (iphas) = ivar
+ ivar = ivar + 1
+ ir33 (iphas) = ivar
+ ivar = ivar + 1
+ ir12 (iphas) = ivar
+ ivar = ivar + 1
+ ir13 (iphas) = ivar
+ ivar = ivar + 1
+ ir23 (iphas) = ivar
+ ivar = ivar + 1
+ iep (iphas) = ivar
+ elseif(iturb(iphas).eq.50) then
+ ivar = ivar + 1
+ ik (iphas) = ivar
+ ivar = ivar + 1
+ iep (iphas) = ivar
+ ivar = ivar + 1
+ iphi (iphas) = ivar
+ ivar = ivar + 1
+ ifb (iphas) = ivar
+ elseif(iturb(iphas).eq.60) then
+ ivar = ivar + 1
+ ik (iphas) = ivar
+ ivar = ivar + 1
+ iomg (iphas) = ivar
+ endif
+
+ enddo
+
+! --- Scalaires
+ if(nscapp.ge.1) then
+ do jj = 1, nscapp
+ ii = iscapp(jj)
+ ivar = ivar + 1
+ isca(ii) = ivar
+ enddo
+ endif
+ if(nscaus.ge.1) then
+ do jj = 1, nscaus
+ ii = jj
+ ivar = ivar + 1
+ isca(ii) = ivar
+ enddo
+ endif
+
+! --- Vitesse de maillage en ALE
+ if (iale.eq.1) then
+ ivar = ivar + 1
+ iuma = ivar
+ ivar = ivar + 1
+ ivma = ivar
+ ivar = ivar + 1
+ iwma = ivar
+ endif
+
+! --- Nombre total de variables
+ nvar = ivar
+
+! --- Verification de NVAR
+
+ if(nvar.gt.nvarmx) then
+ write(nfecra,7100)nvar,nvarmx,nvar
+ call csexit (1)
+ endif
+
+
+! --- Maintenant on peut faire ceci :
+
+ do iphas = 1, nphas
+ istat (ipr(iphas)) = 0
+ iconv (ipr(iphas)) = 0
+ if (iturb(iphas).eq.50) then
+ istat(ifb(iphas)) = 0
+ iconv(ifb(iphas)) = 0
+! Pour fb, on sait qu'on a un terme diagonal, meme si ISTAT=0,
+! donc on ne decalera pas la diagonale
+ idircl(ifb(iphas)) = 0
+ endif
+ enddo
+ if (iale.eq.1) then
+ istat(iuma) = 0
+ iconv(iuma) = 0
+ imgr (iuma) = 1
+ istat(ivma) = 0
+ iconv(ivma) = 0
+ imgr (ivma) = 1
+ istat(iwma) = 0
+ iconv(iwma) = 0
+ imgr (iwma) = 1
+ endif
+
+
+! ---> 3.3 POSITIONNEMENT DES PROPRIETES PRINCIPALES
+! --------------------------------
+
+! --- Numerotation des proprietes presentes ici
+! Ceci depend du type de solveur branche derriere
+! (CP, Poly, Mono...)
+! Dans l'ideal, il y aurait donc plusieurs varpos.
+
+! Pour le moment, on fait les hypotheses suivantes :
+! Il y a toujours, pour toutes les phases, rho, viscl, visct
+! Il y a toujours la pression totale (sauf en compressible)
+! Lorsqu'elles sont variables, on a les proprietes suivantes :
+! . cp (par phase)
+! . visls (par scalaire)
+! . csmago (par phase) en LES dynamique
+! En ALE on a la viscosite de maillage
+! On a aussi les flux de masse porteurs :
+! . les variables u,v,w,p,turbulence sont portees par leur
+! phase (1 flux)
+! . les scalaires sont portes par leur phase (1 flux)
+! On suppose donc qu'il n'y a pas de scalaire en
+! taux de vide a convecter avec un flux particulier (ce
+! serait possible : ca rajoute un test, par exemple
+! if alpro...
+
+! ATTENTION : on s'arrange pour numeroter a la queue-leu-leu sans
+! trous les proprietes qui sont definies au centre des cellules
+! ceci permet ensuite de ne pas se fatiguer lors de la
+! construction de IPPPRO plus bas.
+! Cependant, pour les physiques particulieres, ce n'est pas le cas.
+
+
+ iprop = 0
+
+! Proprietes des phases : proprietes toujours presentes
+ do iphas = 1, nphas
+ iprop = iprop + 1
+ irom (iphas) = iprop
+ iprop = iprop + 1
+ iviscl(iphas) = iprop
+ iprop = iprop + 1
+ ivisct(iphas) = iprop
+ iprop = iprop + 1
+ icour (iphas) = iprop
+ iprop = iprop + 1
+ ifour (iphas) = iprop
+ enddo
+
+! Pression totale stockee dans IPRTOT, si on n'est pas en compressible
+! (sinon Ptot=P* !)
+ if (ippmod(icompf).lt.0) then
+ do iphas = 1, nphas
+ if (iphas.eq.1) then
+ iprop = iprop + 1
+ iprtot(1) = iprop
+ else
+ iprtot(iphas) = iprtot(1)
+ endif
+ enddo
+ endif
+
+! Proprietes des phases : CP s'il est variable
+ do iphas = 1, nphas
+ if(icp(iphas).ne.0) then
+ iprop = iprop + 1
+ icp (iphas) = iprop
+ endif
+ enddo
+
+! Proprietes des phases : Cs^2 si on est en LES dynamique
+ do iphas = 1, nphas
+ if(iturb(iphas).eq.41) then
+ iprop = iprop + 1
+ ismago(iphas) = iprop
+ else
+ ismago(iphas) = -1
+ endif
+ enddo
+
+! Viscosite de maillage en ALE
+ if (iale.eq.1) then
+ iprop = iprop + 1
+ ivisma(1) = iprop
+! si la viscosite est isotrope, les trois composantes pointent
+! au meme endroit
+ if (iortvm.eq.0) then
+ ivisma(2) = iprop
+ ivisma(3) = iprop
+ else
+ iprop = iprop + 1
+ ivisma(2) = iprop
+ iprop = iprop + 1
+ ivisma(3) = iprop
+ endif
+ endif
+
+! Proprietes des phases : estimateurs d'erreur
+ do iphas = 1, nphas
+ do iest = 1, nestmx
+ iprop = iprop + 1
+ iestim(iest,iphas) = iprop
+ enddo
+ enddo
+
+
+! Proprietes des scalaires : VISCLS si elle est variable
+! On utilisera IVISLS comme suit :
+! Pour le scalaire II
+! si IVISLS(II) = 0 : visc = VISLS0(II)
+! si IVISLS(II) .GT. 0 : visc = PROPCE(IEL ,IPPROC(IVISLS(II)))
+! Ceci permet de ne pas reserver des tableaux vides pour les
+! scalaires a viscosite constante
+ if(nscal.ge.1) then
+ do ii = 1, nscal
+ if(ivisls(ii).ne.0) then
+ iprop = iprop + 1
+ ivisls(ii) = iprop
+ endif
+ enddo
+ endif
+
+
+! Proprietes des variables : flux de masse porteur
+
+ iprofl = iprop
+ do iphas = 1, nphas
+ iprop = iprop + 1
+ if(iphas.eq.1) then
+ ifluma(ipr (iphas)) = iprop
+ endif
+ ifluma(iu (iphas)) = iprop
+ ifluma(iv (iphas)) = iprop
+ ifluma(iw (iphas)) = iprop
+ if(itytur(iphas).eq.2) then
+ ifluma(ik (iphas)) = iprop
+ ifluma(iep (iphas)) = iprop
+ elseif(itytur(iphas).eq.3) then
+ ifluma(ir11(iphas)) = iprop
+ ifluma(ir22(iphas)) = iprop
+ ifluma(ir33(iphas)) = iprop
+ ifluma(ir12(iphas)) = iprop
+ ifluma(ir13(iphas)) = iprop
+ ifluma(ir23(iphas)) = iprop
+ ifluma(iep (iphas)) = iprop
+ elseif(iturb(iphas).eq.50) then
+ ifluma(ik (iphas)) = iprop
+ ifluma(iep (iphas)) = iprop
+ ifluma(iphi(iphas)) = iprop
+ ifluma(ifb (iphas)) = iprop
+ elseif(iturb(iphas).eq.60) then
+ ifluma(ik (iphas)) = iprop
+ ifluma(iomg(iphas)) = iprop
+ endif
+ enddo
+ do iscal = 1, nscal
+ ifluma(isca(iscal)) = ifluma(iu(iphsca(iscal)))
+ enddo
+ if (iale.eq.1) then
+ ifluma(iuma) = ifluma(ipr(1))
+ ifluma(ivma) = ifluma(ipr(1))
+ ifluma(iwma) = ifluma(ipr(1))
+ endif
+! Nombre total de flux de masse
+! IPROFL ressert plus bas.
+ nfluma = iprop - iprofl
+
+! Numero max des proprietes ; ressert plus bas pour
+! ajouter celles relatives a la physique particuliere
+ nprmax = iprop
+
+
+! --- Positionnement dans les tableaux PROPCE, PROFA, PROFB
+
+! Au centre des cellules (tout sauf les flux de masse)
+! Pour les fluctuations, le pointeur de la diffusivite
+! envoie directement sur la diffusivite du scalaire associe.
+
+! On positionne en meme temps les pointeurs IPPPRO pour
+! le post traitement des proprietes physiques definies
+! aux cellules afin de ne pas en oublier.
+! Les pointeurs ont ete initialises a 1 (poubelle).
+! dans iniini (avant usini1).
+! IPPPST commence a 2 car 1 est une poubelle.
+! Attention, IPPPST ressert plus bas.
+
+
+! - Repere pour la position des grandeurs posttraitees.
+
+ ipppst = 1
+
+! - Pointeurs post pour les variables.
+
+ do ivar = 1, nvar
+ ipppst = ipppst + 1
+ ipprtp(ivar) = ipppst
+ enddo
+
+
+! - Numero des proprietes physiques definies au centre de cellules.
+! Et pointeur pour le post.
+! (attention, la viscosite turbulente n'est pas post traitable
+! pour les calculs laminaires, car elle n'existe pas)
+! (attention, en module electrique, on utilise la meme
+! conductivite electrique pour le potentiel reel et le potentiel
+! imaginaire
+
+ iprop = 0
+ do iphas = 1, nphas
+
+ iprop = iprop + 1
+ ipproc(irom (iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ iprop = iprop + 1
+ ipproc(iviscl(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ iprop = iprop + 1
+ ipproc(ivisct(iphas)) = iprop
+ if (iturb(iphas).eq.0) then
+ ipppro(iprop) = 1
+ else
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+ iprop = iprop + 1
+ ipproc(icour (iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ iprop = iprop + 1
+ ipproc(ifour (iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ iprop = iprop + 1
+ ipproc(iprtot(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ if(icp(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(icp (iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+
+ if(ismago(iphas).ne.-1) then
+ iprop = iprop + 1
+ ipproc(ismago(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+
+ if (iale.eq.1) then
+ iprop = iprop + 1
+ ipproc(ivisma(1)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ if (iortvm.eq.1) then
+ iprop = iprop + 1
+ ipproc(ivisma(2)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ iprop = iprop + 1
+ ipproc(ivisma(3)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+ endif
+
+ do iest = 1, nestmx
+ if(iescal(iest,iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(iestim(iest,iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+ enddo
+
+ enddo
+
+! Conductivite electrique imaginaire :
+! La conductivite reelle et imaginaire sont dans le meme tableau.
+! En Joule, on ne reserve donc pas de propriete "viscosite"
+! pour le potentiel imaginaire.
+! Intervention 1/2
+
+ if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+ do ii = 1, nscal
+ if(ivisls(ii).gt.0.and.ii.ne.ipoti) then
+ if(iscavr(ii).le.0) then
+ iprop = iprop + 1
+ ipproc(ivisls(ii) ) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+ endif
+ enddo
+ else
+
+ do ii = 1, nscal
+ if(ivisls(ii).gt.0) then
+ if(iscavr(ii).le.0) then
+ iprop = iprop + 1
+ ipproc(ivisls(ii) ) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+ endif
+ enddo
+
+ endif
+
+ do ii = 1, nscal
+ if(ivisls(ii).gt.0) then
+ if(iscavr(ii).gt.0.and.iscavr(ii).le.nscal) then
+ ipproc(ivisls(ii) ) = ipproc(ivisls(iscavr(ii)) )
+ endif
+ endif
+ enddo
+
+! Conductivite electrique imaginaire :
+! La conductivite reelle et imaginaire sont dans le meme tableau.
+! En Joule, le pointeur sur la "viscosite" du potentiel imaginaire
+! renvoie sur celle du potentiel reel.
+! Intervention 2/2
+
+ if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+ ipproc(ivisls(ipoti) ) = ipproc(ivisls(ipotr) )
+ endif
+
+ nproce = iprop
+
+! Au centre des faces de bord (rho et flux de masse)
+
+ iprop = 0
+ do iphas = 1, nphas
+ iprop = iprop + 1
+ ipprob(irom (iphas)) = iprop
+ enddo
+ do iflum = 1, nfluma
+ iprop = iprop + 1
+ ipprob(iprofl+iflum) = iprop
+ enddo
+ nprofb = iprop
+
+! Au centre des faces internes (flux de masse)
+
+ iprop = 0
+ do iflum = 1, nfluma
+ iprop = iprop + 1
+ ipprof(iprofl+iflum) = iprop
+ enddo
+ nprofa = iprop
+
+
+! --- Modifications pour la physique particuliere
+! des entiers NPROCE, NPROFA, NPROFB
+
+! Sauvegarde pour la physique particuliere de IPROP
+! afin d'initialiser les positions des variables d'etat
+! Attention IPROPP est le dernier numero affecte pour les proprietes.
+! IPPPST est le rang de la derniere grandeur definie aux
+! cellules pour le post traitement
+ ipropp = nprmax
+ call ppprop (ipropp,ipppst)
+ !==========
+
+! On sauve IPROPP modifie pour les passages ulterieurs dans varpos
+ nprmax = ipropp
+! On sauve IPPPST modifie pour les passages ulterieurs dans varpos
+ nppmax = ipppst
+
+
+! --- Verification de NPROCE, NPROFA, NPROFB
+
+ if(nproce.gt.npromx.or. &
+ nprofa.gt.npromx.or.nprofb.gt.npromx) then
+ write(nfecra,7200)nproce, nprofa, nprofb, npromx, &
+ max(max(nproce,nprofa),nprofb)
+ call csexit (1)
+ !==========
+ endif
+
+ return
+
+endif
+
+!===============================================================================
+! 4. QUATRIEME APPEL :
+! POSITIONNEMENT DES PROPRIETES POUR LE SCHEMA EN TEMPS,
+! LES MOMENTS ET FIN
+!===============================================================================
+
+! Dans le cas ou on a un schema en temps d'ordre 2, il faut aussi
+! prevoir les proprietes au temps n-1. Ce sera fait au dernier appel
+
+! Dans le cas ou on calcule des moments, il faut en prevoir le nombre
+! et prevoir le nombre de tableaux necessaires pour stocker le
+! temps cumule de moyenne. On suppose que l'on peut s'aider
+! d'infos situees en tete de fichier suite (si on fait une
+! suite avec des moments non reinitialises).
+
+if(ipass.eq.4) then
+
+
+! ---> 4.1 PROPRIETES ADDITIONNELLES POUR LES ET SCHEMA EN TEMPS
+! ---------------------------------------------------------
+
+! --- Initialisations par defaut eventuelles et verifications
+! des options utilisees ci-dessous pour decider si l'on
+! reserve des tableaux supplementaires pour des grandeurs
+! au pas de temps precedent
+
+ iok = 0
+
+! Pression hydrostatique
+ if(iphydr.eq.0) then
+ icalhy = 0
+ elseif(iphydr.eq.1) then
+ gravn2 = gx**2+gy**2+gz**2
+ if (gravn2.lt.epzero**2) then
+ icalhy = 0
+ else
+ icalhy = 1
+ endif
+ endif
+
+! Schemas en temps
+! en LES : Ordre 2 ; sinon Ordre 1
+! (en particulier, ordre 2 impossible en k-eps couple)
+ do iphas = 1, nphas
+ if(ischtp(iphas).eq.-999) then
+ if(itytur(iphas).eq.4) then
+ ischtp(iphas) = 2
+ else
+ ischtp(iphas) = 1
+ endif
+ endif
+ enddo
+
+! Schemas en temps : variables deduites
+ do iphas = 1, nphas
+! Schema pour le Flux de masse
+ if(istmpf(iphas).eq.-999) then
+ if(ischtp(iphas).eq.1) then
+ istmpf(iphas) = 1
+ elseif(ischtp(iphas).eq.2) then
+ istmpf(iphas) = 2
+ endif
+ endif
+! Masse volumique
+ if(iroext(iphas).eq.-999) then
+ if(ischtp(iphas).eq.1) then
+ iroext(iphas) = 0
+ elseif(ischtp(iphas).eq.2) then
+! Pour le moment par defaut on ne prend pas l'ordre 2
+! IROEXT(IPHAS) = 1
+ iroext(iphas) = 0
+ endif
+ endif
+! Viscosite
+ if(iviext(iphas).eq.-999) then
+ if(ischtp(iphas).eq.1) then
+ iviext(iphas) = 0
+ elseif(ischtp(iphas).eq.2) then
+! Pour le moment par defaut on ne prend pas l'ordre 2
+! IVIEXT(IPHAS) = 1
+ iviext(iphas) = 0
+ endif
+ endif
+! Chaleur massique
+ if(icpext(iphas).eq.-999) then
+ if(ischtp(iphas).eq.1) then
+ icpext(iphas) = 0
+ elseif(ischtp(iphas).eq.2) then
+! Pour le moment par defaut on ne prend pas l'ordre 2
+! ICPEXT(IPHAS) = 1
+ icpext(iphas) = 0
+ endif
+ endif
+! Termes sources NS,
+ if(isno2t(iphas).eq.-999) then
+ if(ischtp(iphas).eq.1) then
+ isno2t(iphas) = 0
+! ELSEIF(ISCHTP(IPHAS).EQ.2.AND.IVISSE(IPHAS).EQ.1) THEN
+ elseif(ischtp(iphas).eq.2) then
+! Pour le moment par defaut on prend l'ordre 2
+ isno2t(iphas) = 1
+! ISNO2T(IPHAS) = 0
+ endif
+ endif
+! Termes sources turbulence (k-eps, Rij, v2f ou k-omega)
+! On n'autorise de changer ISTO2T qu'en Rij (sinon avec
+! le couplage k-eps/omega il y a pb)
+ if(isto2t(iphas).eq.-999) then
+ if(ischtp(iphas).eq.1) then
+ isto2t(iphas) = 0
+ elseif(ischtp(iphas).eq.2) then
+! Pour le moment par defaut on ne prend pas l'ordre 2
+! ISTO2T(IPHAS) = 1
+ isto2t(iphas) = 0
+ endif
+ else if( itytur(iphas).eq.2.or.iturb(iphas).eq.50 &
+ .or.iturb(iphas).ne.60) then
+ write(nfecra,8132) iphas,iturb(iphas),isto2t(iphas)
+ iok = iok + 1
+ endif
+ enddo
+
+ do iscal = 1, nscal
+! Termes sources Scalaires,
+ iphas = iphsca(iscal)
+ if(isso2t(iscal).eq.-999) then
+ if(ischtp(iphas).eq.1) then
+ isso2t(iscal) = 0
+ elseif(ischtp(iphas).eq.2) then
+! Pour coherence avec Navier Stokes on prend l'ordre 2
+! mais de toute facon qui dit ordre 2 dit LES et donc
+! generalement pas de TS scalaire a interpoler.
+ isso2t(iscal) = 1
+! ISSO2T(ISCAL) = 0
+ endif
+ endif
+! Diffusivite scalaires
+ if(ivsext(iscal).eq.-999) then
+ iphas = iphsca(iscal)
+ if(ischtp(iphas).eq.1) then
+ ivsext(iscal) = 0
+ elseif(ischtp(iphas).eq.2) then
+! Pour le moment par defaut on ne prend pas l'ordre 2
+! IVSEXT(ISCAL) = 1
+ ivsext(iscal) = 0
+ endif
+ endif
+ enddo
+
+
+! Pression hydrostatique
+ if (iphydr.ne.0.and.iphydr.ne.1) then
+ WRITE(NFECRA,8021) 'IPHYDR ',IPHYDR
+ iok = iok + 1
+ endif
+
+! Viscosite secondaire
+ do iphas = 1, nphas
+ ivisph = ivisse(iphas)
+ if (ivisph.ne.0.and.ivisph.ne.1) then
+ WRITE(NFECRA,8022) IPHAS,'IVISSE ',IVISPH
+ iok = iok + 1
+ endif
+ enddo
+
+! Schemas en temps
+ do iphas = 1, nphas
+
+! Schema en temps global.
+ if(ischtp(iphas).ne. 1.and.ischtp(iphas).ne.2) then
+ WRITE(NFECRA,8101) IPHAS,'ISCHTP',ISCHTP(IPHAS)
+ iok = iok + 1
+ endif
+ if(ischtp(iphas).eq. 2.and.idtvar.ne.0) then
+ write(nfecra,8111) iphas,ischtp(iphas),idtvar
+ iok = iok + 1
+ endif
+ if(ischtp(iphas).eq. 2.and.itytur(iphas).eq.2) then
+ write(nfecra,8112) iphas,ischtp(iphas),iturb(iphas)
+ iok = iok + 1
+ endif
+ if(ischtp(iphas).eq.1.and.itytur(iphas).eq.4) then
+ write(nfecra,8113) iphas,ischtp(iphas),iturb(iphas)
+ endif
+ if(ischtp(iphas).eq. 2.and.iturb(iphas).eq.50) then
+ write(nfecra,8114) iphas,ischtp(iphas),iturb(iphas)
+ iok = iok + 1
+ endif
+ if(ischtp(iphas).eq. 2.and.iturb(iphas).eq.60) then
+ write(nfecra,8115) iphas,ischtp(iphas),iturb(iphas)
+ iok = iok + 1
+ endif
+
+! Schema en temps pour le flux de masse
+ if(istmpf(iphas).ne. 2.and.istmpf(iphas).ne.0.and. &
+ istmpf(iphas).ne. 1) then
+ WRITE(NFECRA,8121) IPHAS,'ISTMPF',ISTMPF(IPHAS)
+ iok = iok + 1
+ endif
+
+! Schema en temps pour les termes sources de NS
+ if(isno2t(iphas).ne.0.and. &
+ isno2t(iphas).ne. 1.and.isno2t(iphas).ne.2) then
+ WRITE(NFECRA,8131) IPHAS,'ISNO2T',ISNO2T(IPHAS)
+ iok = iok + 1
+ endif
+! Schema en temps pour les termes sources des grandeurs
+! turbulentes
+ if(isto2t(iphas).ne.0.and. &
+ isto2t(iphas).ne. 1.and.isto2t(iphas).ne.2) then
+ WRITE(NFECRA,8131) IPHAS,'ISTO2T',ISTO2T(IPHAS)
+ iok = iok + 1
+ endif
+
+! Schema en temps pour la masse volumique
+ if(iroext(iphas).ne.0.and. &
+ iroext(iphas).ne. 1.and.iroext(iphas).ne.2) then
+ WRITE(NFECRA,8131) IPHAS,'IROEXT',IROEXT(IPHAS)
+ iok = iok + 1
+ endif
+
+! Schema en temps pour la viscosite
+ if(iviext(iphas).ne.0.and. &
+ iviext(iphas).ne. 1.and.iviext(iphas).ne.2) then
+ WRITE(NFECRA,8131) IPHAS,'IVIEXT',IVIEXT(IPHAS)
+ iok = iok + 1
+ endif
+
+! Schema en temps pour la chaleur specifique
+ if(icpext(iphas).ne.0.and. &
+ icpext(iphas).ne. 1.and.icpext(iphas).ne.2) then
+ WRITE(NFECRA,8131) IPHAS,'ICPEXT',ICPEXT(IPHAS)
+ iok = iok + 1
+ endif
+
+ enddo
+
+ do iscal = 1, nscal
+! Schema en temps pour les termes sources des scalaires
+ if(isso2t(iscal).ne.0.and. &
+ isso2t(iscal).ne. 1.and.isso2t(iscal).ne.2) then
+ WRITE(NFECRA,8141) ISCAL,'ISSO2T',ISSO2T(ISCAL)
+ iok = iok + 1
+ endif
+! Schema en temps pour la viscosite
+ if(ivsext(iscal).ne.0.and. &
+ ivsext(iscal).ne. 1.and.ivsext(iscal).ne.2) then
+ WRITE(NFECRA,8141) ISCAL,'IVSEXT',IVSEXT(ISCAL)
+ iok = iok + 1
+ endif
+ enddo
+
+! Stop si probleme
+ if(iok.gt.0) then
+ call csexit(1)
+ endif
+
+
+! --- Reprise du dernier numero de propriete
+ iprop = nprmax
+
+! --- Numeros de propriete
+ do iphas = 1, nphas
+! On a besoin de la masse volumique si on l'extrapole ou si ICALHY
+ if(iroext(iphas).gt.0.or.icalhy.eq.1) then
+ iprop = iprop + 1
+ iroma (iphas) = iprop
+ endif
+! Dans le cas d'une extrapolation de la viscosite totale
+ if(iviext(iphas).gt.0) then
+ iprop = iprop + 1
+ ivisla(iphas) = iprop
+ iprop = iprop + 1
+ ivista(iphas) = iprop
+ endif
+ enddo
+! Proprietes des phases : CP s'il est variable
+ do iphas = 1, nphas
+ if(icp(iphas).ne.0) then
+ if(icpext(iphas).gt.0) then
+ iprop = iprop + 1
+ icpa (iphas) = iprop
+ endif
+ endif
+ enddo
+! On a besoin d'un tableau pour les termes sources de Navier Stokes
+! a extrapoler. Ce tableau est NDIM
+ do iphas = 1, nphas
+ if(isno2t(iphas).gt.0) then
+ iprop = iprop + 1
+ itsnsa(iphas) = iprop
+ endif
+ if(isto2t(iphas).gt.0) then
+ iprop = iprop + 1
+ itstua(iphas) = iprop
+ endif
+ enddo
+! Proprietes des scalaires : termes sources pour theta schema
+! et VISCLS si elle est variable
+ if(nscal.ge.1) then
+ do iscal = 1, nscal
+ if(isso2t(iscal).gt.0) then
+ iprop = iprop + 1
+ itssca(iscal) = iprop
+ endif
+ if(ivisls(iscal).ne.0) then
+ if(ivsext(iscal).gt.0) then
+ iprop = iprop + 1
+ ivissa(iscal) = iprop
+ endif
+ endif
+ enddo
+ endif
+! Proprietes des variables : flux de masse porteur
+! On en ajoute un (et un seul) par phase s'il existe une phase
+! qui en a besoin.
+! On est donc dans l'hypothese implicite qu'il n'y a qu'un seul
+! flux de masse pour toutes les variables
+! et ceci n'est pas optimal si il y a plusieurs phases traitees
+! differemment.
+! On suppose que si une phase en a besoin, on en ajoute donc
+! autant qu'il y a de flux de masse, cad NFLUMA
+
+! On les initialise a -1 pour iniva0
+ do ivar = 1, nvarmx
+ ifluaa(ivar) = -1
+ enddo
+! On regarde s'il y en a besoin
+ iiflaa = 0
+ do iphas = 1, nphas
+ if(istmpf(iphas).ne.1) iiflaa = 1
+ enddo
+! On les affecte
+ iprofa = iprop
+ if(iiflaa.eq.1) then
+ do iphas = 1, nphas
+ if(iphas.eq.1) then
+ iprop = iprop + 1
+ ifluaa(ipr (iphas)) = iprop
+ endif
+ ifluaa(iu (iphas)) = iprop
+ ifluaa(iv (iphas)) = iprop
+ ifluaa(iw (iphas)) = iprop
+ if(itytur(iphas).eq.2) then
+ ifluaa(ik (iphas)) = iprop
+ ifluaa(iep (iphas)) = iprop
+ elseif(itytur(iphas).eq.3) then
+ ifluaa(ir11(iphas)) = iprop
+ ifluaa(ir22(iphas)) = iprop
+ ifluaa(ir33(iphas)) = iprop
+ ifluaa(ir12(iphas)) = iprop
+ ifluaa(ir13(iphas)) = iprop
+ ifluaa(ir23(iphas)) = iprop
+ ifluaa(iep (iphas)) = iprop
+ elseif(iturb(iphas).eq.50) then
+ ifluaa(ik (iphas)) = iprop
+ ifluaa(iep (iphas)) = iprop
+ ifluaa(iphi(iphas)) = iprop
+ ifluaa(ifb (iphas)) = iprop
+ elseif(iturb(iphas).eq.60) then
+ ifluaa(ik (iphas)) = iprop
+ ifluaa(iomg(iphas)) = iprop
+ endif
+ enddo
+ do iscal = 1, nscal
+ ifluaa(isca(iscal)) = ifluaa(iu(iphsca(iscal)))
+ enddo
+ endif
+
+! --- Sauvegarde du dernier numero de propriete
+ nprmax = iprop
+
+
+! --- Reprise du dernier NPROCE et du dernier NPPMAX
+ iprop = nproce
+ ipppst = nppmax
+
+! --- Positionnement des PROPCE
+ do iphas = 1, nphas
+
+! Variables schema en temps
+ if(iroext(iphas).gt.0.or.icalhy.eq.1) then
+ iprop = iprop + 1
+ ipproc(iroma (iphas)) = iprop
+ endif
+ if(iviext(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(ivisla(iphas)) = iprop
+ endif
+ if(iviext(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(ivista(iphas)) = iprop
+ endif
+ if(icpext(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(icpa (iphas)) = iprop
+ endif
+ if(isno2t(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(itsnsa(iphas)) = iprop
+! Ce tableau est NDIM :
+ iprop = iprop + ndim-1
+ endif
+ if(isto2t(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(itstua(iphas)) = iprop
+! Ce tableau est 2, 7 ou 4 selon le modele de turbulence :
+ if (itytur(iphas).eq.2) then
+ iprop = iprop + 2-1
+ elseif(itytur(iphas).eq.3) then
+ iprop = iprop + 7-1
+ elseif(iturb(iphas).eq.50) then
+ iprop = iprop + 4-1
+ endif
+ endif
+ enddo
+
+ do ii = 1, nscal
+! Termes source des scalaires pour theta schema
+ if(isso2t(ii).gt.0) then
+ iprop = iprop + 1
+ ipproc(itssca(ii)) = iprop
+ endif
+
+ if(ivisls(ii).gt.0) then
+ if(iscavr(ii).le.0) then
+ if(ivsext(ii).gt.0) then
+ iprop = iprop + 1
+ ipproc(ivissa(ii) ) = iprop
+ endif
+ endif
+ endif
+ enddo
+ do ii = 1, nscal
+ if(ivisls(ii).gt.0) then
+ if(iscavr(ii).gt.0.and.iscavr(ii).le.nscal) then
+ if(ivsext(ii).gt.0) then
+ ipproc(ivissa(ii) ) = ipproc(ivissa(iscavr(ii)) )
+ endif
+ endif
+ endif
+ enddo
+
+! --- Sauvegarde du dernier NPROCE et du dernier NPPMAX
+ nproce = iprop
+ nppmax = ipppst
+
+
+! --- Reprise du dernier NPROFB
+ iprop = nprofb
+
+! --- Positionnement des PROPFB
+ do iphas = 1, nphas
+! Variables schema en temps : rhoa (pas pour icalhy)
+ if(iroext(iphas).gt.0) then
+ iprop = iprop + 1
+ ipprob(iroma (iphas)) = iprop
+ endif
+ enddo
+! Variables schema en temps : flux de masse A
+ if(iiflaa.eq.1) then
+ do iflum = 1, nfluma
+ iprop = iprop + 1
+ ipprob(iprofa+iflum) = iprop
+ enddo
+ endif
+
+! --- Sauvegarde du dernier NPROFB
+ nprofb = iprop
+
+
+! --- Reprise du dernier NPROFA
+ iprop = nprofa
+
+! --- Positionnement des PROPFA
+ if(iiflaa.eq.1) then
+ do iflum = 1, nfluma
+ iprop = iprop + 1
+ ipprof(iprofa+iflum) = iprop
+ enddo
+ endif
+
+! --- Sauvegarde du dernier NPROFA
+ nprofa = iprop
+
+
+! ---> 4.2 CALCUL DE LA TAILLE DU TABLEAU DES TEMPS CUMULES POUR LES MOMENTS
+! ---------------------------------------------------------------------
+
+! Pour verification des definitions de moments
+ iok = 0
+
+! --- Calcul du nombre de moments definis (et verif qu'il n y a pas de trous)
+ nbmomt = 0
+ inmfin = 0
+ do imom = 1, nbmomx
+! Si on n'est pas a la fin de la liste
+ if(inmfin.eq.0) then
+! Si il y en a, ca en fait en plus
+ if(idfmom(1,imom).ne.0) then
+ nbmomt = nbmomt + 1
+! Si il n'y en a pas, c'est la fin de la liste
+ else
+ inmfin = 1
+ endif
+! Si on est a la fin de la liste, il n'en faut plus
+ else
+ if(idfmom(1,imom).ne.0) then
+ iok = iok + 1
+ endif
+ endif
+ enddo
+
+ if(iok.ne.0) then
+ write(nfecra,8200)nbmomt+1,idfmom(1,nbmomt+1),nbmomt,nbmomt
+ do imom = 1, nbmomx
+ write(nfecra,8201)imom,idfmom(1,imom)
+ enddo
+ write(nfecra,8202)
+ endif
+
+! --- Verification de IDFMOM
+ iok = 0
+ do imom = 1, nbmomx
+ idffin = 0
+ do jj = 1, ndgmox
+ idfmji = idfmom(jj,imom)
+ if(idffin.eq.0) then
+ if(idfmji.lt.-nprmax) then
+ iok = iok + 1
+ write(nfecra,8210)jj,imom,idfmji,nprmax
+ elseif(idfmji.gt.nvar) then
+ iok = iok + 1
+ write(nfecra,8211)jj,imom,idfmji,nvar
+ elseif(idfmji.lt.0) then
+ if (ipproc(-idfmji).le.0) then
+ iok = iok + 1
+ write(nfecra,8212)jj,imom,idfmji,-idfmji, &
+ ipproc(-idfmji)
+ endif
+ elseif(idfmji.eq.0) then
+ idffin = 1
+ endif
+ else
+ if(idfmji.ne.0) then
+ iok = iok + 1
+ write(nfecra,8213)imom,jj,idfmji
+ endif
+ endif
+ enddo
+ enddo
+
+! --- Verification de NTDMOM (>0)
+ do imom = 1, nbmomt
+ if(ntdmom(imom).lt.0) then
+ iok = iok + 1
+ write(nfecra,8214)imom,ntdmom(imom)
+ endif
+ enddo
+
+ if(iok.ne.0) then
+ call csexit(1)
+ endif
+
+
+! --- Indicateur pour juger de l'utilite de consulter le fichier suite
+! Il n'est pas indispensable de consulter avec succes le fichier suite
+! lorsqu'il n'y a aucun moment a relire ou qu'on ne fait pas de suite
+! (si ILSMOM=0)
+! ie ILSMOM = 0 == (ISUITE=0 OR IMOOLD(IMOM)=-1 pour tout IMOM)
+! ie ILSMOM = 1 == (ISUITE=1 AND IMOOLD(IMOM) different de -1 pour un IMOM)
+ ilsmom = 0
+ if(isuite.eq.1.and.nbmomt.gt.0) then
+ do imom = 1, nbmomt
+ if(imoold(imom).ne.-1) then
+ ilsmom = 1
+ endif
+ enddo
+ endif
+
+! --- Lecture du fichier suite (debut : info sur les moments et sur le ntpabs)
+ if(ilsmom.eq.1) then
+
+! Ouverture
+! (ILECEC=1:lecture)
+ ilecec = 1
+ call opnsui(ficamx,len(ficamx),ilecec,impamx,ierror)
+ !==========
+ if (ierror.ne.0) then
+ write(nfecra,8300) ficamx
+ call csexit (1)
+ endif
+
+! Tests : type de fichier et dimension des supports (puisqu'on y
+! relira des infos, autant s'arreter au plus vite
+! s'il n'est pas correct)
+
+! Type (fichier auxiliaire)
+
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'version_fichier_suite_auxiliaire'
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ivers,ierror)
+
+ if (ierror.ne.0) then
+ write(nfecra,8301)ficamx
+ call csexit (1)
+ endif
+
+ nberro=0
+
+! Nb de moments
+! Si le nombre de moments n'a pas pu etre relu, on devra s'arreter
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'nombre_moyennes_temps'
+ jbmomt = 0
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jbmomt,ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) then
+ write(nfecra,8311)
+ endif
+
+! Nombre de pas de temps final du calcul precedent
+ RUBRIQ = 'nbre_pas_de_temps'
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ jtcabs = 0
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jtcabs,ierror)
+ nberro=nberro+ierror
+ if(ierror.ne.0) then
+ write(nfecra,8312)
+ endif
+
+ if(nberro.ne.0) then
+ call csexit (1)
+ endif
+
+ endif
+
+
+! --- Avec JTCABS et JBMOMT
+! on complete et on verifie la correspondance nouveaux -> anciens moments
+
+! Si suite et il existe un IMOOLD different de -1 :
+! si IMOOLD mal renseigne erreur
+! (valeur non admissible ou demande de relecture
+! avec NTDBMO pas coherent)
+! si IMOOLD pas renseigne pour NTDMOM > JTCABS : initialise
+! pour IMOM < JBMOMT+1 : on relit
+! pour IMOM > JBMOMT : initialise
+! si on pointe deux fois sur le meme : erreur
+! (simplifie la lecture lecamo)
+ iok = 0
+
+ if(ilsmom.eq.1) then
+ do imom = 1, nbmomt
+ if(imoold(imom).gt.jbmomt.or.imoold(imom).eq.0 &
+ .or.imoold(imom).lt.-2) then
+ write(nfecra,8400) imom,imoold(imom),jbmomt
+ iok = iok + 1
+ elseif(imoold(imom).le.jbmomt.and.imoold(imom).gt.0 &
+ .and.ntdmom(imom).gt.jtcabs) then
+ write(nfecra,8401) imom,imoold(imom),ntdmom(imom),jtcabs
+ iok = iok + 1
+ elseif(imoold(imom).eq.-2.and.ntdmom(imom).gt.jtcabs) then
+ imoold(imom)=-1
+ elseif(imoold(imom).eq.-2.and.imom.le.jbmomt) then
+ imoold(imom)=imom
+ elseif(imoold(imom).eq.-2.and.imom.gt.jbmomt) then
+ imoold(imom)=-1
+ endif
+ enddo
+ do imom = 1, nbmomt
+ if(imoold(imom).gt.0) then
+ do jmom = 1, imom-1
+ if(imoold(imom).eq.imoold(jmom)) then
+ write(nfecra,8402) imom,jmom,imoold(imom)
+ iok = iok + 1
+ endif
+ enddo
+ endif
+ enddo
+
+! Si pas suite : si IMOOLD pas renseigne, on initialise
+! sinon erreur
+ elseif(isuite.eq.0) then
+ do imom = 1, nbmomt
+ if(imoold(imom).ne.-2) then
+ write(nfecra,8403) isuite,imom,imoold(imom)
+ iok = iok + 1
+ else
+ imoold(imom)=-1
+ endif
+ enddo
+ endif
+
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+! --- D'autres informations sont lues dans le fichier suite pour
+! l'initialisation du numero dans le fichier suite du cumul temporel
+! associe a chaque moyenne (IDTOLD)
+! IDTOLD(IMOM) donne pour la moyenne (du calcul courant) IMOM
+! le numero dans le fichier suite du cumul temporel associe
+! a la moyenne du calcul precedent a laquelle correspond IMOM (ouf !)
+
+! Initialisation
+ do imom = 1, nbmomx
+ idtold(imom) = 0
+ enddo
+
+! Si on ne lit rien dans le fichier suite, IDTOLD restera nul
+ if(ilsmom.eq.1) then
+
+ nberro = 0
+
+! On ne lit des choses que s'il y a des moments stockes
+ if ( jbmomt.gt.0 ) then
+
+! On lit les infos pour tous les moments courants
+ do imom = 1, nbmomt
+! On s'interesse uniquement aux moments qui suivnt d'anciens moments
+ if(imoold(imom).gt.0) then
+! Si le numero de l'ancien moment est incompatible avec le format
+! on cherche numero_cumul_temps_momentYYYY qui n existe pas
+! ca genere une erreur
+ if(imom.le.nfmtmo) then
+ WRITE(CMOY4,'(I4.4)')IMOOLD(IMOM)
+ else
+ cmoy4 = cindfm
+ endif
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'numero_cumul_temps_moment'//CMOY4
+ call lecsui(impamx,rubriq,len(rubriq),itysup,nbval, &
+ irtyp,idtold(imom),ierror)
+ nberro=nberro+ierror
+ if(idtold(imom).eq.0.or.ierror.ne.0) then
+ write(nfecra,8313)imom,imoold(imom)
+ iok = iok + 1
+ endif
+ endif
+ enddo
+ endif
+
+ if(nberro.ne.0) then
+ call csexit (1)
+ endif
+
+! Fermeture du fichier suite auxiliaire
+ call clssui(impamx,ierror)
+
+ if (ierror.ne.0) then
+ write(nfecra,8390) ficamx
+ endif
+
+ endif
+
+
+! --- Remplissage de IDTMOM (pointeur dans DTCMOM pour chaque moment)
+! > 0 : pointe sur un tableau NCEL dans PROPCE (DT cumule non uniforme)
+! remplissage sans trous de 1 a n
+! < 0 : pointe sur une case d'un tableau NPROMX (DT cumule uniforme)
+! remplissage sans trous de -1 a -p
+
+ iiplus = 0
+ iimoin = 0
+
+ do imom = 1, nbmomx
+ idtmom(imom) = 0
+ enddo
+
+! Pour les moments reinitialises (suite) ou initialises (non suite)
+! un nouveau tableau, sauf si leur calcul commence au meme instant
+ do imom = 1, nbmomt
+ imold = imoold(imom)
+! Si on (re)initialise IMOM
+ if(imold.eq.-1) then
+! On cherche si on en a deja vu (re)initialisees au meme moment
+ imomr = 0
+ do jmom = 1, imom-1
+ jmold = imoold(jmom)
+ if(jmold.eq.-1.and.ntdmom(jmom).eq.ntdmom(imom)) then
+ imomr = jmom
+ endif
+ enddo
+! Si oui : on utilise le meme tableau
+ if(imomr.gt.0) then
+ idtmom(imom) = idtmom(imomr)
+! Si non : on a besoin d'un nouveau tableau ou reel
+ else
+ if(idtvar.eq.2) then
+ iiplus = iiplus + 1
+ idtmom(imom) = iiplus
+ else
+ iimoin = iimoin - 1
+ idtmom(imom) = iimoin
+ endif
+ endif
+ endif
+ enddo
+
+! Pour les moments IMOM relus dans IMOLD
+! (ie suite + IMOOLD non egal a -1)
+ if(isuite.eq.1) then
+ do imom = 1, nbmomt
+ imold = imoold(imom)
+ if(imold.gt.0) then
+! On regarde si le DTcumule du IMOLD a deja ete vu
+! (indicateur JMOMOK)
+ idto = idtold(imom)
+ jmomok = 0
+ do jmom = 1, imom-1
+ jmold = imoold(jmom)
+ if(jmold.gt.0) then
+ jdto = idtold(jmom)
+ if(jdto.eq.idto) then
+ jmomok = jmom
+ endif
+ endif
+ enddo
+! Si on le voit pour la premiere fois, ca en fait un de plus
+ if(jmomok.eq.0) then
+! Si DT non uniforme dans le present calcul ou que
+! DT cumule etait non uniforme dans l'ancien, on a un
+! DT cumule non uniforme (sinon, il est uniforme)
+ if(idtvar.eq.2.or.idto.gt.0) then
+ iiplus = iiplus + 1
+ idtmom(imom) = iiplus
+ else
+ iimoin = iimoin - 1
+ idtmom(imom) = iimoin
+ endif
+! Si on l'a deja rencontre, on pointe au meme endroit
+ else
+ idtmom(imom) = idtmom(jmomok)
+ endif
+ endif
+ enddo
+ endif
+
+! Verification de IDTMOM : normalement, jamais ca plante ici.
+ iok = 0
+ do imom = 1, nbmomt
+ if(idtmom(imom).eq.0) then
+ iok = iok + 1
+ write(nfecra,8410)imom, idtmom(imom)
+ endif
+ enddo
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+! --- Calcul du nombre de tableaux NCEL "temps cumule"
+ nbdtcm = 0
+ do imom = 1, nbmomt
+ nbdtcm=max(idtmom(imom),nbdtcm)
+ enddo
+
+! ---> 4.3 POSITIONNEMENT DANS PROPCE DES MOMENTS ET DU TEMPS CUMULE
+! -------------------------------------------------------------
+
+! --- Reprise du dernier numero de propriete
+ iprop = nprmax
+
+! --- Numeros de propriete
+ do imom = 1, nbmomt
+ iprop = iprop + 1
+ icmome(imom) = iprop
+ enddo
+ do ii = 1, nbdtcm
+ iprop = iprop + 1
+ icdtmo(ii) = iprop
+ enddo
+
+! --- Sauvegarde du dernier numero de propriete
+ nprmax = iprop
+
+! --- Reprise des derniers NPROCE et NPPMAX (PROPCE et POST-TRAITEMENT)
+ iprop = nproce
+ ipppst = nppmax
+
+! --- Positionnement
+ do imom = 1, nbmomt
+ iprop = iprop + 1
+ ipproc(icmome(imom)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ enddo
+ do ii = 1, nbdtcm
+ iprop = iprop + 1
+ ipproc(icdtmo(ii)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ enddo
+
+! --- Sauvegarde du dernier NPROCE et NPPMAX
+ nproce = iprop
+ nppmax = ipppst
+
+
+
+! ---> 4.4 POSITIONNEMENT DES CONDITIONS AUX LIMITES
+! ---------------------------------------------------------------------
+
+! --- Numerotation des tableaux NFABOR de type COEFA/COEFB presents ici
+! On suppose pour le moment que seules les variables de calcul
+! disposent de conditions aux limites. Ceci pourra ensuite etre
+! etendu aux variables pysiques en declarant un pointeur du type
+! de ICLRTP (par exemple ICLPRO)
+! On suppose que les seules variables qui ont 2 types de cl sont
+! les variables vitesse en k-epsilon, k-omega et en LES, et la
+! pression si IPHYDR=1
+
+ icondl = 0
+ do ivar = 1, nvar
+ icondl = icondl + 1
+ iclrtp(ivar,icoef ) = icondl
+ iclrtp(ivar,icoeff) = icondl
+ enddo
+ do iphas = 1, nphas
+ if( itytur(iphas).eq.2 .or. itytur(iphas).eq.4 &
+ .or. iturb(iphas).eq.60 ) then
+ ivar = iu(iphas)
+ icondl = icondl + 1
+ iclrtp(ivar,icoeff) = icondl
+ ivar = iv(iphas)
+ icondl = icondl + 1
+ iclrtp(ivar,icoeff) = icondl
+ ivar = iw(iphas)
+ icondl = icondl + 1
+ iclrtp(ivar,icoeff) = icondl
+ endif
+ enddo
+ if (iphydr.eq.1) then
+ do iphas = 1, nphas
+ icondl = icondl + 1
+ iclrtp(ipr(iphas),icoeff) = icondl
+ enddo
+ endif
+
+! Compressible
+ if (ippmod(icompf).ge.0) then
+ do iphas = 1, nphas
+ icondl = icondl + 1
+ iclrtp(isca(ienerg(iphas)),icoeff) = icondl
+ enddo
+ endif
+
+ ncofab = icondl
+
+
+! ---> 4.5 POINTEURS POST-PROCESSING / LISTING / HISTORIQUES / CHRONOS
+! ---------------------------------------------------------------------
+
+! --- Les pointeurs ont ete initialises a 1 (poubelle).
+! dans iniini (avant usini1).
+
+! On posttraitera les variables localisees au centre des cellules.
+
+! IPPRTP(IVAR) pour RTP a ete complete plus haut.
+
+! IPPPRO(IPPROC(II)) pour PROPCE a ete complete plus haut
+! au fur et a mesure (voir ppprop en particulier)
+
+! Le rang de la derniere propriete pour le post est IPPPST.
+
+
+ if(idtvar.ne.0) then
+ ipppst = ipppst + 1
+ ippdt = ipppst
+ endif
+
+ if(ipucou.eq.1) then
+ ipppst = ipppst + 1
+ ipptx = ipppst
+ ipppst = ipppst + 1
+ ippty = ipppst
+ ipppst = ipppst + 1
+ ipptz = ipppst
+ endif
+
+
+! Verification de la limite sur IPPPST
+
+ if(ipppst.gt.nvppmx) then
+ write(nfecra,8900)ipppst,nvppmx
+ call csexit (1)
+ !==========
+ endif
+
+ return
+
+endif
+
+!===============================================================================
+! 5. CINQUIEME APPEL :
+! RESERVATION D'UNE PLACE DANS PROPCE SI RAYONNEMENT
+! ET LAGRANGIEN AVEC THERMIQUE DES PARTICULES
+!===============================================================================
+
+if (ipass.eq.5) then
+
+ if ( iirayo.gt.0 ) then
+
+! --- Reprise du dernier numero de propriete
+ iprop = nprmax
+
+! --- Numeros de propriete
+ iprop = iprop + 1
+ ilumin = iprop
+ iprop = iprop + 1
+ iqx = iprop
+ iprop = iprop + 1
+ iqy = iprop
+ iprop = iprop + 1
+ iqz = iprop
+
+
+ do iphas = 1, nphasc
+
+ iprop = iprop + 1
+ itsre(iphas) = iprop
+ iprop = iprop + 1
+ itsri(iphas) = iprop
+ iprop = iprop + 1
+ iabs(iphas) = iprop
+ iprop = iprop + 1
+ iemi(iphas) = iprop
+ iprop = iprop + 1
+ icak(iphas) = iprop
+
+ enddo
+
+ nprayc = iprop - nprmax
+
+! --- Sauvegarde du dernier numero de propriete
+ nprmax = iprop
+
+
+! --- Reprise des derniers NPROCE et NPPMAX (PROPCE et POST-TRAITEMENT)
+ iprop = nproce
+ ipppst = nppmax
+
+! --- Positionnement
+ iprop = iprop + 1
+ ipproc(ilumin) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(iqx) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(iqy) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(iqz) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+! Positionnement de ITSRE, ITSRI, ICAK, IABS et IEME
+! Leur dimensionnement n'est pas le meme si on est en charbon ou non
+
+
+ do iphas = 1, nphasc
+!
+ iprop = iprop + 1
+ ipproc(itsre(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(itsri(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+!
+ iprop = iprop + 1
+ ipproc(iabs(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(iemi(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(icak(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ enddo
+
+
+! --- Sauvegarde du dernier NPROCE et NPPMAX
+ nproce = iprop
+ nppmax = ipppst
+
+
+! --- Reprise du dernier numero de propriete
+ iprop = nprmax
+
+
+! --- Numeros de propriete
+ iprop = iprop + 1
+ itparo = iprop
+ iprop = iprop + 1
+ iqinci = iprop
+ iprop = iprop + 1
+ ixlam = iprop
+ iprop = iprop + 1
+ iepa = iprop
+ iprop = iprop + 1
+ ieps = iprop
+ iprop = iprop + 1
+ ifnet = iprop
+ iprop = iprop + 1
+ ifconv = iprop
+ iprop = iprop + 1
+ ihconv = iprop
+
+! --- Sauvegarde du dernier numero de propriete
+ nprmax = iprop
+
+! --- Reprise du dernier NPROFB (PROPFB)
+ iprop = nprofb
+
+! --- Positionnement
+ iprop = iprop + 1
+ ipprob(itparo) = iprop
+
+ iprop = iprop + 1
+ ipprob(iqinci) = iprop
+
+ iprop = iprop + 1
+ ipprob(ixlam) = iprop
+
+ iprop = iprop + 1
+ ipprob(iepa) = iprop
+
+ iprop = iprop + 1
+ ipprob(ieps) = iprop
+
+ iprop = iprop + 1
+ ipprob(ifnet) = iprop
+
+ iprop = iprop + 1
+ ipprob(ifconv) = iprop
+
+ iprop = iprop + 1
+ ipprob(ihconv) = iprop
+
+ nprayb = iprop - nprofb
+
+ if (iihmpr.eq.1) then
+
+ call uirapr &
+ !==========
+ ( nprayc, nprayb, nphasc, ipppro, ipproc, &
+ ilumin, iqx, iqy, iqz, &
+ itsre, itsri, iabs, iemi, icak)
+
+ endif
+
+!
+! --- Sauvegarde du dernier NPROFB
+ nprofb = iprop
+
+! --- Verification de NPROCE, NPROFA, NPROFB
+
+ if(nproce.gt.npromx.or. &
+ nprofa.gt.npromx.or.nprofb.gt.npromx) then
+ write(nfecra,7200)nproce, nprofa, nprofb, npromx, &
+ max(max(nproce,nprofa),nprofb)
+ call csexit (1)
+ !==========
+ endif
+
+ endif
+
+ return
+
+endif
+
+
+!===============================================================================
+! 6. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+ 5000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE PHASES ERRONE ',/,&
+'@ ',/,&
+'@ Le nombre de phases doit etre un entier strictement ',/,&
+'@ positif. Il vaut ici NPHAS = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE PHASES TROP GRAND ',/,&
+'@ ',/,&
+'@ Le nombre de phases ',/,&
+'@ - demande dans usini1 est NPHAS = ',I10 ,/,&
+'@ - maximal autorise dans paramx.h est NPHSMX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@ NPHSMX doit valoir au moins ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PLUSIEURS MODELES PHYSIQUES PARTICULIERES ACTIVES ',/,&
+'@ ',/,&
+'@ Un seul modele physique particuliere peut etre active a la',/,&
+'@ fois. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier les indicateurs de IPPMOD dans usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SELECTION INCORRECTE DU MODELE PHYSIQUE PARTICULIERE ',/,&
+'@ ',/,&
+'@ Les valeurs des indicateurs du tableau IPPMOD ne sont pas ',/,&
+'@ admissibles ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier les indicateurs de IPPMOD dans usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE SCALAIRES ERRONE ',/,&
+'@ ',/,&
+'@ Le nombre de scalaires utilisateur doit etre un entier ',/,&
+'@ positif ou nul. Il vaut ici NSCAUS = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE SCALAIRES TROP GRAND ',/,&
+'@ ',/,&
+'@ Le nombre de scalaires utilisateurs ',/,&
+'@ demande dans usini1 est NSCAUS = ',I10 ,/,&
+'@ Le nombre de scalaires total ',/,&
+'@ autorise dans paramx.h est NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ La valeur maximale autorisee de NSCAUS ',/,&
+'@ est donc NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier NSCAUS dans usini1. ',/,&
+'@ ',/,&
+'@ NSCAMX doit valoir au moins ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE SCALAIRES TROP GRAND ',/,&
+'@ ',/,&
+'@ Le nombre de scalaires utilisateurs ',/,&
+'@ demande dans usini1 est NSCAUS = ',I10 ,/,&
+'@ Le nombre de scalaires pour les physiques particulieres ',/,&
+'@ necessaire avec le modele choisi est NSCAPP = ',I10 ,/,&
+'@ Le nombre de scalaires total ',/,&
+'@ autorise dans paramx.h est NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ La valeur maximale autorisee de NSCAUS ',/,&
+'@ avec le modele choisi est donc NSCAMX-NSCAPP = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier NSCAUS dans usini1. ',/,&
+'@ ',/,&
+'@ NSCAMX doit valoir au moins ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE SCALAIRES ERRONE ',/,&
+'@ ',/,&
+'@ Le nombre de scalaires doit etre un entier ',/,&
+'@ positif ou nul. Il vaut ici NSCAL = ',I10 ,/,&
+'@ Remarque : NSCAUS = ',I10 ,/,&
+'@ NSCAPP = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE SCALAIRES TROP GRAND ',/,&
+'@ ',/,&
+'@ Le nombre de scalaires necessaire est NSCAL = ',I10 ,/,&
+'@ Le nombre de scalaires total ',/,&
+'@ autorise dans paramx.h est NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ Remarque : NSCAUS = ',I10 ,/,&
+'@ NSCAPP = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@ NSCAMX doit valoir au moins ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE PORTEUSE INCORRECTE POUR LE SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ La phase porteuse du scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') indiquee dans ',/,&
+'@ usini1 est IPHSCA(',I10 ,') = ',I10 ,/,&
+'@ Elle devrait etre comprise entre 0 et NPHAS = ',I10 ,/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHSCA dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE PORTEUSE INCORRECTE POUR LE SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ La phase porteuse du scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') ',/,&
+'@ est IPHSCA(ISCAPP(',I10 ,')) = ',I10 ,/,&
+'@ Elle devrait etre comprise entre 0 et NPHAS = ',I10 ,/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHSCA. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ASSOCIE A UNE VARIANCE INCORRECT ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') represente ',/,&
+'@ une variance puisque ',/,&
+'@ ISCAVR(',I10 ,') vaut ',I10 ,' (non nul) ',/,&
+'@ Les valeurs de ISCAVR doivent cependant etre ',/,&
+'@ superieures ou egales a 0 ',/,&
+'@ inferieures ou egales a NSCAL = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier ISCAVR dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ASSOCIE A UNE VARIANCE INCORRECT ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') represente ',/,&
+'@ une variance puisque ',/, &
+'@ ISCAVR(ISCAPP(',I10 ,')) vaut ',I10 ,' (non nul) ',/,&
+'@ Les valeurs de ISCAVR doivent cependant etre ',/,&
+'@ superieures ou egales a 0 ',/,&
+'@ inferieures ou egales a NSCAL = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier ISCAVR dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') puisque ',/,&
+'@ ISCAVR(',I10 ,') vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ L''indicateur de diffusivite IVISLS(',I10 ,') ',/,&
+'@ ne doit pas etre renseigne. ',/,&
+'@ Il sera pris automatiquement egal a celui du scalaire ',/,&
+'@ associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IVISLS dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') puisque ',/,&
+'@ ISCAVR(',I10 ,') vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ L''indicateur de diffusivite IVISLS(',I10 ,') ',/,&
+'@ ne doit pas etre renseigne. ',/,&
+'@ Il sera pris automatiquement egal a celui du scalaire ',/,&
+'@ associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IVISLS dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7042 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') puisque ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,')) vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ L''indicateur de diffusivite IVISLS(ISCAPP(',I10 ,')) ',/,&
+'@ ne doit pas etre renseigne. ',/,&
+'@ Il sera pris automatiquement egal a celui du scalaire ',/,&
+'@ associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IVISLS. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7043 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') puisque ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,')) vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ L''indicateur de diffusivite IVISLS(ISCAPP(',I10 ,')) ',/,&
+'@ ne doit pas etre renseigne. ',/,&
+'@ Il sera pris automatiquement egal a celui du scalaire ',/,&
+'@ associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IVISLS. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ L''indicateur de diffusivite variable ',/,&
+'@ du scalaire utilisateur ',I10 ,/,&
+'@ IVISLS(',I10 ,') ',/,&
+'@ doit etre un entier egal a 0 ou 1. ',/,&
+'@ Il vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IVISLS dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7051 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,/,&
+'@ ',/,&
+'@ L''indicateur de diffusivite variable ',/,&
+'@ du scalaire physique particuliere ',I10 ,/,&
+'@ IVISLS(ISCAPP(',I10 ,')) ',/,&
+'@ doit etre un entier egal a 0 ou 1. ',/,&
+'@ Il vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IVISLS. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,' NE PAS MODIFIER LA PHASE PORTEUSE ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') puisque ',/,&
+'@ ISCAVR(',I10 ,') vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ La phase porteuse IPHSCA(',I10 ,') du scalaire ',/,&
+'@ ne doit pas etre renseignee. ',/,&
+'@ Elle sera automatiquement prise identique a la phase ',/,&
+'@ porteuse du scalaire associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHSCA dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7061 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,' NE PAS MODIFIER LA PHASE PORTEUSE ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') puisque ',/,&
+'@ ISCAVR(',I10 ,') vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ La phase porteuse IPHSCA(',I10 ,') du scalaire ',/,&
+'@ ne doit pas etre renseignee. ',/,&
+'@ Elle sera automatiquement prise identique a la phase ',/,&
+'@ porteuse du scalaire associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHSCA dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7062 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,' NE PAS MODIFIER LA PHASE PORTEUSE ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire utilisateur ',I10 ,') puisque ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,')) vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ La phase porteuse IPHSCA(ISCAPP(',I10 ,')) du scalaire ',/,&
+'@ ne doit pas etre renseignee. ',/,&
+'@ Elle sera automatiquement prise identique a la phase ',/,&
+'@ porteuse du scalaire associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHSCA. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7063 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',I10 ,' NE PAS MODIFIER LA PHASE PORTEUSE ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') represente ',/,&
+'@ la variance des fluctuations du scalaire ',I10 ,/,&
+'@ (scalaire physique particuliere ',I10 ,') puisque ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,')) vaut ',I10 ,' (non nul) ',/,&
+'@ ',/,&
+'@ La phase porteuse IPHSCA(ISCAPP(',I10 ,')) du scalaire ',/,&
+'@ ne doit pas etre renseignee. ',/,&
+'@ Elle sera automatiquement prise identique a la phase ',/,&
+'@ porteuse du scalaire associe, soit ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHSCA. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7070 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR IORTVM NE PEUT PRENDRE QUE LES VALEURS ',/,&
+'@ 0 OU 1. ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE VARIABLES TROP GRAND ',/,&
+'@ ',/,&
+'@ Le type de calcul defini dans usini1 ',/,&
+'@ correspond a un nombre de variables NVAR = ',I10 ,/,&
+'@ Le nombre de variables maximal prevu ',/,&
+'@ dans paramx.h est NVARMX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@ NVARMX doit valoir au moins ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE PROPRIETES TROP GRAND ',/,&
+'@ ',/,&
+'@ Le type de calcul defini dans usini1 ',/,&
+'@ correspond aux nombres de proprietes suivants ',/,&
+'@ au centre des cellules : NPROCE = ',I10 ,/,&
+'@ au centre des faces internes : NPROFA = ',I10 ,/,&
+'@ au centre des faces de bord : NPROFB = ',I10 ,/,&
+'@ Le nombre de proprietes maximal prevu ',/,&
+'@ dans paramx.h est NPROMX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@ NPROMX doit valoir au moins ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8022 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 1 ou 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8111 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ AVEC UN SCHEMA EN TEMPS D ORDRE 2 : ISCHTP = ', I10 ,/,&
+'@ IL FAUT UTILISER UN PAS DE TEMPS CONSTANT ET UNIFORME ',/,&
+'@ OR IDTVAR = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8112 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ON IMPOSE UN SCHEMA EN TEMPS D ORDRE 2 (ISCHTP = ',I10 ,/,&
+'@ EN K-EPSILON (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ La version courante ne supporte pas l ordre 2 avec le ',/,&
+'@ couplage des termes sources du k-epsilon. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8113 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ON IMPOSE UN SCHEMA EN TEMPS D ORDRE 1 (ISCHTP = ',I10 ,/,&
+'@ EN LES (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8114 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ON IMPOSE UN SCHEMA EN TEMPS D ORDRE 2 (ISCHTP = ',I10 ,/,&
+'@ EN V2F (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ La version courante ne supporte pas l''ordre 2 avec le ',/,&
+'@ couplage des termes sources du k-epsilon. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8115 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ON IMPOSE UN SCHEMA EN TEMPS D ORDRE 2 (ISCHTP = ',I10 ,/,&
+'@ EN K-OMEGA (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ La version courante ne supporte pas l''ordre 2 avec le ',/,&
+'@ couplage des termes sources du k-omega. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8121 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0, 1 OU 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8131 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0, 1 OU 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8132 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Avec le modele de turbulence choisi, ITURB = ',I10 ,/,&
+'@ la valeur de ISTO2T (extrapolation des termes sources ',/,&
+'@ pour les variables turbulentes) ne doit pas etre modifie',/,&
+'@ or ISTO2T a ete force a ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8141 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES SCALAIRE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0, 1 OU 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LA LISTE DES MOYENNES TEMPORELLES ',/,&
+'@ ',/,&
+'@ La valeur de IDFMOM(1,',I10 ,' est ',I10 ,/,&
+'@ ceci indique que l''on a defini ',I10 ,' moyennes ',/,&
+'@ temporelles en renseignant les IMOM = ',I10 ,/,&
+'@ premieres cases du tableau IDFMOM(.,IMOM). ',/,&
+'@ Les cases suivantes devraient etre nulles. ',/,&
+'@ ',/,&
+'@ Ce n''est cependant pas le cas : ',/,&
+'@ ',/,&
+'@ IMOM IDFMOM(1,IMOM) ',/,&
+'@ ---------------------------- ' )
+ 8201 format( &
+'@ ',I10 ,' ', I10 )
+ 8202 format( &
+'@ ---------------------------- ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LES VARIABLES COMPOSANT LES MOYENNES TEMPORELLES ',/,&
+'@ ',/,&
+'@ IDFMOM(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ Les valeurs negatives renvoient a des proprietes ',/,&
+'@ physiques, or il n y en a que NPRMAX = ', I10 ,/,&
+'@ La valeur de IDFMOM est donc erronee. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8211 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LES VARIABLES COMPOSANT LES MOYENNES TEMPORELLES ',/,&
+'@ ',/,&
+'@ IDFMOM(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ Les valeurs positives renvoient a des variables de ',/,&
+'@ calcul, or il n y en a que NVAR = ', I10 ,/,&
+'@ La valeur de IDFMOM est donc erronee. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8212 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LES VARIABLES COMPOSANT LES MOYENNES TEMPORELLES ',/,&
+'@ ',/,&
+'@ La valeur ',/,&
+'@ IDFMOM(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ n''est pas une propriete associee aux cellules ',/,&
+'@ (IPPROC(',I10 ,') = ',I10 ,') ',/,&
+'@ La valeur de IDFMOM est donc erronee. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8213 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LES VARIABLES COMPOSANT LES MOYENNES TEMPORELLES ',/,&
+'@ ',/,&
+'@ Le tableau IDFMOM(JJ,IMOM) pour IMOM = ',I10 ,/,&
+'@ doit etre renseigne continuement. Or ici, ',/,&
+'@ IDFMOM(',I10,',IMOM) est non nul (=',I10 ,') ',/,&
+'@ alors qu il existe II < JJ pour lequel ',/,&
+'@ IDFMOM(II,IMOM) est nul. ',/,&
+'@ La valeur de IDFMOM est donc erronee. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8214 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR L''INSTANT DE DEBUT DE CALCUL DES MOYENNES TEMPORELLES',/,&
+'@ ',/,&
+'@ La variable NTDMOM(IMOM) pour IMOM = ',I10 ,/,&
+'@ doit etre renseignee dans usini1 pour indiquer ',/,&
+'@ a partir de quel pas de temps (absolu) doit etre ',/,&
+'@ calculee la moyenne temporelle IMOM correspondante. ',/,&
+'@ NTDMOM(IMOM) vaur ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ERREUR A L''OUVERTURE DU FICHIER SUITE AUXILIAIRE ',/,&
+'@ ',/,&
+'@ Pour permettre de realiser une suite de calcul en ',/,&
+'@ prenant en compte les moyennes temporelles, ',/,&
+'@ on cherche a relire le fichier suite auxiliaire. ',/,&
+'@ Une erreur se produit a son ouverture. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier l''existence et le nom (',A13,') du ',/,&
+'@ fichier suite dans le repertoire de travail. ',/,&
+'@ Il est possible de s''affranchir du fichier suite ',/,&
+'@ auxiliaire en reinitialisant les moyennes (IMOOLD) ',/,&
+'@ ou en ne calculant pas de moyennes. ',/,&
+'@ Voir alors usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8301 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ TYPE DE FICHIER INCORRECT ',/,&
+'@ ',/,&
+'@ Le fichier ',A13 ,' ne semble pas etre un fichier ',/,&
+'@ suite auxiliaire. ',/,&
+'@ ',/,&
+'@ Pour permettre de realiser une suite de calcul en ',/,&
+'@ prenant en compte les moyennes temporelles, ',/,&
+'@ on cherche a relire le fichier suite auxiliaire. ',/,&
+'@ Une erreur se produit a sa lecture. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ a un fichier suite auxiliaire. ',/,&
+'@ Il est possible de s''affranchir du fichier suite ',/,&
+'@ auxiliaire en reinitialisant les moyennes (IMOOLD) ',/,&
+'@ ou en ne calculant pas de moyennes. ',/,&
+'@ Voir alors usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8311 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE (varpos) ',/,&
+'@ ',/,&
+'@ Pour permettre de realiser une suite de calcul en ',/,&
+'@ prenant en compte les moyennes temporelles, ',/,&
+'@ on cherche a relire le fichier suite auxiliaire. ',/,&
+'@ Erreur a la lecture du nombre de moyennes ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire. ',/,&
+'@ Il est possible de s''affranchir du fichier suite ',/,&
+'@ auxiliaire en reinitialisant les moyennes (IMOOLD) ',/,&
+'@ ou en ne calculant pas de moyennes. ',/,&
+'@ Voir alors usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8312 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE (varpos) ',/,&
+'@ ',/,&
+'@ Pour permettre de realiser une suite de calcul en ',/,&
+'@ prenant en compte les moyennes temporelles, ',/,&
+'@ on cherche a relire le fichier suite auxiliaire. ',/,&
+'@ Erreur a la lecture du numero du pas de temps precedent ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire. ',/,&
+'@ Il est possible de s''affranchir du fichier suite ',/,&
+'@ auxiliaire en reinitialisant les moyennes (IMOOLD) ',/,&
+'@ ou en ne calculant pas de moyennes. ',/,&
+'@ Voir alors usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8313 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE (varpos) ',/,&
+'@ ',/,&
+'@ Pour permettre de realiser une suite de calcul en ',/,&
+'@ prenant en compte les moyennes temporelles, ',/,&
+'@ on cherche a relire le fichier suite auxiliaire. ',/,&
+'@ Erreur a la lecture du numero du cumul temporel ',/,&
+'@ de la moyenne ', I10 ,/,&
+'@ associee a l''ancienne moyenne ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite auxiliaire. ',/,&
+'@ Il est possible de s''affranchir du fichier suite ',/,&
+'@ auxiliaire en reinitialisant les moyennes (IMOOLD) ',/,&
+'@ ou en ne calculant pas de moyennes. ',/,&
+'@ Voir alors usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8390 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= AUXILIAIRE (varpos) ',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE (VARPOS)',/,&
+'@ ========= AUXILIAIRE',/,&
+'@ ERREUR A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ On souhaite faire correspondre la moyenne ',I10 ,/,&
+'@ du present calcul avec la moyenne ',I10 ,/,&
+'@ du calcul precedent, or, le numero des anciennes',/,&
+'@ moyennes doit etre strictement positif et ',/,&
+'@ inferieur ou egal a ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs de IMOOLD dans usini1. ',/,&
+'@ Verifier que le fichier suite est le bon. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8401 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LA CORRESPONDANCE AVEC LES ANCIENNES MOYENNES ',/,&
+'@ ',/,&
+'@ On souhaite initialiser la nouvelle moyenne IMOM = ',I10 ,/,&
+'@ en relisant la moyenne IMOOLD(IMOM) = ',I10 ,/,&
+'@ dans le fichier suite. ',/,&
+'@ Or on a specifie que le pas de temps initial pour le ',/,&
+'@ calcul de la moyenne IMOM etait NTDMOM(IMOM) = ',I10 ,/,&
+'@ et le calcul stocke dans le fichier suite correspond ',/,&
+'@ au pas de temps = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier la valeur de NTDMOM dans usini1 ',/,&
+'@ verifier que le fichier suite est le bon. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8402 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LA CORRESPONDANCE AVEC LES ANCIENNES MOYENNES ',/,&
+'@ ',/,&
+'@ Deux moyennes distinctes ',I10,' et ', I10 ,/,&
+'@ sont initialises avec la meme ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IMOOLD dans usini1 . ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8403 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA VERIFICATION DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SUR LA CORRESPONDANCE AVEC LES ANCIENNES MOYENNES ',/,&
+'@ ',/,&
+'@ On ne souhaite pas faire un calcul suite puisque ',/,&
+'@ ISUITE = ',I10 ,/,&
+'@ mais on a renseigne le tableau IMOOLD de ',/,&
+'@ correspondance nouvelles -> anciennes moyennes : ',/,&
+'@ IMOOLD(',I10,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Ne pas modifier IMOOLD dans usini1. ',/,&
+'@ ou realiser un calcul suite. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA CONSTRUCTION DE IDTMOM (varpos) ',/,&
+'@ ========= ',/,&
+'@ CALCUL DES MOYENNES TEMPORELLES ',/,&
+'@ ',/,&
+'@ IDTMOM(',I10,') = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8900 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE VARIABLES A SUIVRE TROP GRAND ',/,&
+'@ ',/,&
+'@ Le type de calcul defini dans usini1 ',/,&
+'@ correspond a un nombre de variables a suivre dans ',/,&
+'@ le listing et le post-processing egal a ',I10 ,/,&
+'@ Le nombre de variables a suivre maximal prevu ',/,&
+'@ dans paramx.h est NVPPMX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ Contacter l assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 5000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA ',/,&
+'@ ========= ',/,&
+'@ WRTONG NUMBER OF PHASES ',/,&
+'@ ',/,&
+'@ The number of phases must be an integer strictly ',/,&
+'@ positive. Here it has a value of NPHAS = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ NUMBER OF PHASES TOO LARGE ',/,&
+'@ ',/,&
+'@ The number of phases ',/,&
+'@ - requested in usini1 is NPHAS = ',I10 ,/,&
+'@ - maximmum authorised in paramx.h is NPHSMX = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@ NPHSMX must be at least ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ TOO MANY SPECIFIC PHYSICS MODULES ACTIVATED ',/,&
+'@ ',/,&
+'@ Only one specific physics module can be active for one ',/,&
+'@ given calculation. ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Modify the indices of IPPMOD in usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ WRONG SELLECTION OF THE MODEL FOR SPECIFIC PHYSICS ',/,&
+'@ ',/,&
+'@ The values of the indices of the array IPPMOD are not ',/,&
+'@ admissible ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Modify the indices of IPPMOD in usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ ERRONEOUS NUMBER OF SCALARS ',/,&
+'@ ',/,&
+'@ The number of users scalars must be an integer either ',/,&
+'@ positive or zero. Here is NSCAUS = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ NUMBER OF SCALARS TOO LARGE ',/,&
+'@ ',/,&
+'@ The number of users scalars ',/,&
+'@ requested in usini1 is NSCAUS = ',I10 ,/,&
+'@ The total number of scalars ',/,&
+'@ allowed in paramx.h is NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ The maximmum value allowed of NSCAUS ',/,&
+'@ is in NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify NSCAUS in usini1. ',/,&
+'@ ',/,&
+'@ NSCAMX must be at least ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ NUMBER OF SCALARS TOO LARGE ',/,&
+'@ ',/,&
+'@ The number of users scalars ',/,&
+'@ requested in usini1 is NSCAUS = ',I10 ,/,&
+'@ The number of scalars necessary for the specific physics' ,/,&
+'@ with the chosen model is NSCAPP = ',I10 ,/,&
+'@ The total number of scalars ',/,&
+'@ allowed in paramx.h est NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ The maximum value allowed for NSCAUS ',/,&
+'@ with the chosen model is NSCAMX-NSCAPP = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify NSCAUS in usini1. ',/,&
+'@ ',/,&
+'@ NSCAMX must be at least ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ WRONG NUMBER OF SCALARS ',/,&
+'@ ',/,&
+'@ The number of scalars must be an integer either ',/,&
+'@ positive or zero. Here it is NSCAL = ',I10 ,/,&
+'@ Note : NSCAUS = ',I10 ,/,&
+'@ NSCAPP = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ NUMBER OF SCALARS TOO LARGE ',/,&
+'@ ',/,&
+'@ The necessary number of scalars is NSCAL = ',I10 ,/,&
+'@ The number of scalars available in ',/,&
+'@ paramx.h is NSCAMX = ',I10 ,/,&
+'@ ',/,&
+'@ Note : NSCAUS = ',I10 ,/,&
+'@ NSCAPP = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@ NSCAMX must be at least ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ CARRIER PHASE IS INCORRECT FOR THE SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The carrier phase of the scalar ' ,I10 ,/,&
+'@ (user scalar ',I10 ,') indicated in ',/,&
+'@ usini1 is IPHSCA(',I10 ,') = ',I10 ,/,&
+'@ It should be between zero and NPHAS = ',I10 ,/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IPHSCA in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ CARRIER PHASE IS INCORRECT FOR THE SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The carrier phase of the scalar ' ,I10 ,/,&
+'@ (scalar in paricular phisics ',I10 ,') ',/,&
+'@ is IPHSCA(ISCAPP(',I10 ,')) = ',I10 ,/,&
+'@ It should be between zero and NPHAS = ',I10 ,/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IPHSCA. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ INCORRECT SCALAR ASSOCIATED TO A VARIANCE ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (user scalar ',I10 ,') represents ',/,&
+'@ one variance as ',/,&
+'@ ISCAVR(',I10 ,') has a value',I10 ,' (non-zero ) ',/,&
+'@ However, the values of ISCAVR must be ',/,&
+'@ larger or equal to 0 ',/,&
+'@ lower or equal to NSCAL = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify ISCAVR in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ INCORRECT SCALAR ASSOCIATED TO A VARIANCE ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (scalar of a particualr physics',I10 ,') represents ',/,&
+'@ one variance as ',/, &
+'@ ISCAVR(ISCAPP(',I10 ,')) has a value',I10 ,'(non-zero)',/,&
+'@ However, the values of ISCAVR must be ',/,&
+'@ larger or equal to 0 ',/,&
+'@ lower or equal to NSCAL = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify ISCAVR in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (user scalar ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of a scalar ',I10 ,/,&
+'@ (user scalar ',I10 ,') since ',/,&
+'@ ISCAVR(',I10 ,') has a value',I10 ,'(non-zero) ',/,&
+'@ ',/,&
+'@ The diffusivity index IVISLS(',I10 ,') ',/,&
+'@ has not been set. ',/,&
+'@ It will be automatically set equal to that of the ',/,&
+'@ associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IVISLS in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (user scalar ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of a scalar ',I10 ,/,&
+'@ (scalar of a specific physics ',I10 ,') since ',/,&
+'@ ISCAVR(',I10 ,') has a value ',I10 ,' (non-zero) ',/,&
+'@ ',/,&
+'@ The diffusivity index IVISLS(',I10 ,') ',/,&
+'@ has not been set. ',/,&
+'@ It will be automatically set equal to that of the ',/,&
+'@ associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IVISLS in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7042 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (scalar of a specific physics ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of a scalar ',I10 ,/,&
+'@ (user scalar ',I10 ,') since ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,')) has a value ',I10 ,'(non-zero)',/,&
+'@ ',/,&
+'@ The diffusivity index IVISLS(ISCAPP(',I10 ,')) ',/,&
+'@ has not been set. ',/,&
+'@ It will be automatically set equal to that of the ',/,&
+'@ associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IVISLS. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7043 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (scalar of a specific physics ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of a scalar ',I10 ,/,&
+'@ (scalar of a specific physics ',I10 ,') since ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,')) has a value',I10 ,' (non-zero)',/,&
+'@ ',/,&
+'@ The diffusivity index IVISLS(ISCAPP(',I10 ,')) ',/,&
+'@ has not been set. ',/,&
+'@ It will be automatically set equal to that of the ',/,&
+'@ associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IVISLS. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The variable diffusivity index of the ',/,&
+'@ user scalar ',I10 ,/,&
+'@ IVISLS(',I10 ,') ',/,&
+'@ must be set equal to 0 or 1. ',/,&
+'@ Here it is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IVISLS in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7051 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,/,&
+'@ ',/,&
+'@ The variable diffusivity index of the ',/,&
+'@ scalar of a specific physics ',I10 ,/,&
+'@ IVISLS(ISCAPP(',I10 ,')) ',/,&
+'@ must be set equal to 0 or 1. ',/,&
+'@ Here it is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IVISLS. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,' DO NOT MODIFY THE CARRIER PHASE ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (user scalar ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of the scalar',I10 ,/,&
+'@ (user scalar ',I10 ,') since ',/,&
+'@ ISCAVR(',I10 ,') has a value ',I10 ,' (non-zero) ',/,&
+'@ ',/,&
+'@ The carrier phase IPHSCA(',I10 ,') of the scalar ',/,&
+'@ must not be set. ',/,&
+'@ It will automatically be set equal to the carrier phase ',/,&
+'@ of the associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IPHSCA in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7061 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,' DO NOT MODIFY THE CARRIER PHASE ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (user scalar ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of the scalar',I10 ,/,&
+'@ (scalar of specific physics ',I10 ,') since ',/,&
+'@ ISCAVR(',I10 ,')has a value ',I10 ,' (non-zero) ',/,&
+'@ ',/,&
+'@ The carrier phase IPHSCA(',I10 ,') of the scalar ',/,&
+'@ must not be set. ',/,&
+'@ It will automatically be set equal to the carrier phase ',/,&
+'@ of the associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IPHSCA in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7062 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,' DO NOT MODIFY THE CARRIER PHASE ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (scalar of specific physics ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of the scalar',I10 ,/,&
+'@ (user scalar ',I10 ,') since ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,'))has a value ',I10 ,' (non-zero)',/,&
+'@ ',/,&
+'@ The carrier phase IPHSCA(ISCAPP(',I10 ,')) of the scalar',/,&
+'@ must not be set. ',/,&
+'@ It will automatically be set equal to the carrier phase ',/,&
+'@ of the associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IPHSCA. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7063 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',I10 ,' DO NOT MODIFY THE CARRIER PHASE ',/,&
+'@ ',/,&
+'@ The scalar ',I10 ,/,&
+'@ (scalar of specific physics ',I10 ,') represents ',/,&
+'@ the variance of fluctuations of the scalar',I10 ,/,&
+'@ (scalar of specific physics ',I10 ,') since ',/,&
+'@ ISCAVR(ISCAPP(',I10 ,'))has a value ',I10 ,' (non-zero)',/,&
+'@ ',/,&
+'@ The carrier phase IPHSCA(ISCAPP(',I10 ,')) of the scalar',/,&
+'@ must not be set. ',/,&
+'@ It will automatically be set equal to the carrier phase ',/,&
+'@ of the associated scalar ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IPHSCA. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7070 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ THE INDEX IORTVM CANNOT HAVE VALUES OTHER THAN ',/,&
+'@ 0 OR 1. ',/,&
+'@ HERE IT IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ NUMBER OF VARIABLES TOO LARGE ',/,&
+'@ ',/,&
+'@ The type of calculation defined in usini1 ',/,&
+'@ corresponds to a number of variables NVAR = ',I10 ,/,&
+'@ The maximum number of variables allowed ',/,&
+'@ in paramx.h is NVARMX = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@ NVARMX must be at least ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ NUMBER OF VARIABLES TOO LARGE ',/,&
+'@ ',/,&
+'@ The type of calculation defined in usini1 ',/,&
+'@ corresponds to the following number of properties ',/,&
+'@ at the cell centres : NPROCE = ',I10 ,/,&
+'@ at the internal face centres : NPROFA = ',I10 ,/,&
+'@ at the boundary face centres : NPROFB = ',I10 ,/,&
+'@ The maxumum number of properties allowed ',/,&
+'@ in paramx.h is NPROMX = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@ NPROMX must be at least ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL TO 0 OR 1 ',/,&
+'@ HERE IT IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8022 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL TO 0 OR 1 ',/,&
+'@ HERE IT IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL TO 1 OR 2 ',/,&
+'@ HERE IT IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8111 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA FOR PHASE' ,I10 ,/,&
+'@ ========= ',/,&
+'@ WITH A SECOND ORDER SCHEME IN TIME: ISCHTP = ', I10 ,/,&
+'@ IT IS NECESSARY TO USE A CONSTANT AND UNIFORM TIME STEP ',/,&
+'@ BUT IDTVAR = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8112 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA FOR PHASE' ,I10 ,/,&
+'@ ========= ',/,&
+'@ A 2ND ORDER SCHEME HAS BEEN IMPOSED (ISCHTP = ',I10 ,/,&
+'@ WITH K-EPSILON (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ The current version does not support the 2nd order with ',/,&
+'@ coupling of the source terms of k-epsilon. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Modify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8113 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : AT THE INITIAL DATA FOR PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ A 1st ORDER SCHEME HAS BEEN IMPOSSED (ISCHTP = ',I10 ,/,&
+'@ FOR LES (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ The calculation will be executed ',/,&
+'@ ',/,&
+'@ It is recommended to verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8114 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA FOR PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ A 2nd ORDER SCHEME HAS BEEN IMPOSED (ISCHTP = ',I10 ,/,&
+'@ FOR V2F (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ The current version does not support the 2nd order with ',/,&
+'@ coupling of the source terms of k-epsilon. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Modify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8115 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA FOR PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ A 2nd ORDER SCHEME HAS BEEN IMPOSED (ISCHTP = ',I10 ,/,&
+'@ FOR K-OMEGA (ITURB = ',I10,' )' ,/,&
+'@ ',/,&
+'@ The current version does not support the 2nd order with ',/,&
+'@ coupling of the source terms of k-omega. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Modify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8121 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA FOR PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL TO 0, 1 OR 2 ',/,&
+'@ HERE IT IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8131 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA FOR PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL TO 0, 1 OR 2 ',/,&
+'@ HERE IT IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8132 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA FOR PHASE ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ With the chosen turbulence model , ITURB = ',I10 ,/,&
+'@ the value of ISTO2T (extrapolation of the source terms ',/,&
+'@ for the turbulent variables) cannot be modified ',/,&
+'@ yet ISTO2T has been forced to ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8141 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITAL DATA FOR SCALARS ',I10 ,/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL TO 0, 1 OR 2 ',/,&
+'@ HERE IT IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE LIST OF TEMPORAL AVERAGES ',/,&
+'@ ',/,&
+'@ The value of IDFMOM(1,',I10 ,' is ',I10 ,/,&
+'@ this indicates that ',I10 ,' temporal averages have ',/,&
+'@ been defined to find out the IMOM = ',I10 ,/,&
+'@ first locations of the array IDFMOM(.,IMOM). ',/,&
+'@ The follwing locations should be zero. ',/,&
+'@ ',/,&
+'@ This however, is not the case : ',/,&
+'@ ',/,&
+'@ IMOM IDFMOM(1,IMOM) ',/,&
+'@ ---------------------------- ' )
+ 8201 format( &
+'@ ',I10 ,' ', I10 )
+ 8202 format( &
+'@ ---------------------------- ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE VARIABLES THAT CONSTITUTE THE TEMPORAL AVERAGES ',/,&
+'@ ',/,&
+'@ IDFMOM(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ The negative value reflect physical properties ',/,&
+'@ but there is none in NPRMAX = ', I10 ,/,&
+'@ The value of IDFMOM is wrongly set. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8211 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE VARIABLES THAT CONSTITUTE THE TEMPORAL AVERAGES ',/,&
+'@ ',/,&
+'@ IDFMOM(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ The positive values reflect variables of the ',/,&
+'@ calculation, yet there none in NVAR = ', I10 ,/,&
+'@ The value of IDFMOM is wrongly set. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8212 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE VARIABLES THAT CONSTITUTE THE TEMPORAL AVERAGES ',/,&
+'@ ',/,&
+'@ The value ',/,&
+'@ IDFMOM(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ is not a property associated with the cells ',/,&
+'@ (IPPROC(',I10 ,') = ',I10 ,') ',/,&
+'@ The value of IDFMOM is wrongly set. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8213 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE VARIABLES THAT CONSTITUTE THE TEMPORAL AVERAGES ',/,&
+'@ ',/,&
+'@ The array IDFMOM(JJ,IMOM) for IMOM = ',I10 ,/,&
+'@ must be assigned continuously. . Yet here, ',/,&
+'@ IDFMOM(',I10,',IMOM) is not zero (=',I10 ,') ',/,&
+'@ while it exists II < JJ for which ',/,&
+'@ IDFMOM(II,IMOM) is zero. ',/,&
+'@ The value of IDFMOM is wrongly set. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8214 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE INSTANT OF THE START OF THE CALCULATION OF THE ',/,&
+'@ TEMPORAL AVERAGES ',/,&
+'@ ',/,&
+'@ The variable NTDMOM(IMOM) for IMOM = ',I10 ,/,&
+'@ must be assigned in usini1 to indicate from which ',/,&
+'@ time step (absolute) the calculation ot the ',/,&
+'@ corresponding average IMOM must start. ',/,&
+'@ NTDMOM(IMOM) here is ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP WHILE READING THE AUXILIARY RESTARTING ',/,&
+'@ ========= FILE',/,&
+'@ ERROR OPENING THE RESTARTING AUXILIARY FILE ',/,&
+'@ ',/,&
+'@ In order to restart a calculation taking into account ',/,&
+'@ the temporal averages, it is necessary to ',/,&
+'@ read the auxiliary restarting file. ',/,&
+'@ An error has occur during while opening it. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify the existence and the name (',A13,') of ',/,&
+'@ the restarting file on the working directory. ',/,&
+'@ It is possible to liberate the auxiliary restarting ',/,&
+'@ file and reinitialise the averages (IMOOLD) ',/,&
+'@ or not to compute the averages. ',/,&
+'@ Look at usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8301 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP WHILE READING THE AUXILIARY RESTARTING ',/,&
+'@ ========= FILE',/,&
+'@ INCORRECT FILE TYPE ',/,&
+'@ ',/,&
+'@ The file ',A13 ,' does not look like a auxiliary ',/,&
+'@ restarting file. ',/,&
+'@ ',/,&
+'@ In order to restart a calculation taking into account ',/,&
+'@ the temporal averages, it is necessary to ',/,&
+'@ read the auxiliary restarting file. ',/,&
+'@ An error has occur during while reading it. ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify that the restarting file corresponds to an ',/,&
+'@ auxiliary restarting file. ',/,&
+'@ It is possible to liberate the auxiliary restarting ',/,&
+'@ file and reinitialise teh averages (IMOOLD) ',/,&
+'@ or not to compute the averages. ',/,&
+'@ Look at usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8311 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP WHILE READING THE AUXILIARY RESTARTING ',/,&
+'@ ========= FILE (varpos) ',/,&
+'@ ',/,&
+'@ In order to restart a calculation taking into account ',/,&
+'@ the temporal averages, it is necessary to ',/,&
+'@ read the auxiliary restarting file. ',/,&
+'@ Error while reading the number of averages ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restarting file. ',/,&
+'@ It is possible to liberate the auxiliary restarting ',/,&
+'@ file and reinitialise teh averages (IMOOLD) ',/,&
+'@ or not to compute the averages. ',/,&
+'@ Look at usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8312 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP WHILE READING THE AUXILIARY RESTARTING ',/,&
+'@ ========= FILE (varpos) ',/,&
+'@ ',/,&
+'@ In order to restart a calculation taking into account ',/,&
+'@ the temporal averages, it is necessary to ',/,&
+'@ read the auxiliary restarting file. ',/,&
+'@ Error while reading the number of averages ',/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restarting file. ',/,&
+'@ It is possible to liberate the auxiliary restarting ',/,&
+'@ file and reinitialise teh averages (IMOOLD) ',/,&
+'@ or not to compute the averages. ',/,&
+'@ Look at usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8313 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP WHILE READING THE AUXILIARY RESTARTING ',/,&
+'@ ========= FILE (varpos) ',/,&
+'@ ',/,&
+'@ In order to restart a calculation taking into account ',/,&
+'@ the temporal averages, it is necessary to ',/,&
+'@ read the auxiliary restarting file. ',/,&
+'@ Error while reading the number of temporal cumulative ',/,&
+'@ of the average ', I10 ,/,&
+'@ associated with the previous ', I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify the auxiliary restarting file. ',/,&
+'@ Verify the auxiliary restarting file. ',/,&
+'@ It is possible to liberate the auxiliary restarting ',/,&
+'@ file and reinitialise teh averages (IMOOLD) ',/,&
+'@ or not to compute the averages. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8390 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : ERROR WHILE CLOSING THE AUXILIARY RESTARTING',/,&
+'@ ========= FILE (varpos) ',/,&
+'@ ',/,&
+'@ Problem with the file named (',A13,') ',/,&
+'@ ',/,&
+'@ The calculation continues ... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP WHILE READING THE RESTARTING AUXILIARY ',/,&
+'@ ========= FILE (VARPOS) ',/,&
+'@ ERROR WHILE READING THE RESTARTING FILE ',/,&
+'@ ',/,&
+'@ Trying to match the temporal average ',I10 ,/,&
+'@ of the present calculation with the average ',I10 ,/,&
+'@ of the previous calculation, yet the number of previous ',/,&
+'@ averages must be strictly positive and lower or ',/,&
+'@ equal to ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify the values of IMOOLD in usini1. ',/,&
+'@ Verify that the restarting file is correct. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8401 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE CORRESPONDANCE WITH PREVIOUS AVERAGES ',/,&
+'@ ',/,&
+'@ Trying to initialise the new average IMOM = ',I10 ,/,&
+'@ while reading the average IMOOLD(IMOM) = ',I10 ,/,&
+'@ in the restarting file ',/,&
+'@ Yet it has been specified that initial time step for the',/,&
+'@ calculation of the average IMOM is NTDMOM(IMOM) = ',I10 ,/,&
+'@ and the calculation stored in the restarting file ',/,&
+'@ corresponds to a time step = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Modify the value of NTDMOM in usini1 ',/,&
+'@ Verify that the restarting file is correct. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8402 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE CORRESPONDANCE WITH PREVIOUS AVERAGES ',/,&
+'@ ',/,&
+'@ Two diferent averages ',I10,' and ', I10 ,/,&
+'@ are initialised with the same ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify IMOOLD in usini1 . ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8403 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE VERIFICATION OF DATA ',/,&
+'@ ========= ',/,&
+'@ ON THE CORRESPONDANCE WITH PREVIOUS AVERAGES ',/,&
+'@ ',/,&
+'@ A restarting calculation cannot be executed since ',/,&
+'@ ISUITE = ',I10 ,/,&
+'@ but the array IMOOLD matching the old -> new ',/, &
+'@ averages has been filled ',/,&
+'@ IMOOLD(',I10,') = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Do not modify IMOOLD in usini1. ',/,&
+'@ or run a restart calculation. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE CONSTRUCTION OF IDTMOM (varpos)',/,&
+'@ ========= ',/,&
+'@ COMPUTATION OF THE TEMPORAL AVERAGES ',/,&
+'@ ',/,&
+'@ IDTMOM(',I10,') = ', I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8900 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : STOP AT THE INITIAL DATA VERIFICATION ',/,&
+'@ ========= ',/,&
+'@ NAME OF THE VARIABLE TO BE CONTINUED TOO LARGE ',/,&
+'@ ',/,&
+'@ The type of calcultion defined in usini1 ',/,&
+'@ corresponds to a number of variables to continue in ',/,&
+'@ the listing and post-processing equal to ',I10 ,/,&
+'@ The maximum number of variables to continue in ',/,&
+'@ paramx.h is NVPPMX = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation cannot be executed ',/,&
+'@ ',/,&
+'@ Verify usini1. ',/,&
+'@ Contact help. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+
+
+!===============================================================================
+! 5. FIN
+!===============================================================================
+
+return
+end
diff --git a/src/base/vectds.f90 b/src/base/vectds.f90
new file mode 100644
index 0000000..0f99ef9
--- /dev/null
+++ b/src/base/vectds.f90
@@ -0,0 +1,166 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vectds &
+!================
+
+ ( ndim , ncelet , ncel , nfac , nfabor , &
+ ifacel , ifabor , ia , &
+ surfac , surfbo , pond , &
+ vectx , vecty , vectz , &
+ valf , valb , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL A LA FACE DE (VECT)ij . S
+! A PARTIR DU VECTEUR VECTX, VECTY, VECTZ
+! UTILISE POUR LE CALCUL DU TERME DE DIFFUSION DE Rij ET Epsilon
+! EN Rij-Epsilon LRR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre de cellules !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ifacel(2,nfac ! te ! <-- ! no des elts voisins d'une face intern !
+! ifabor(nfabor ! te ! <-- ! no de l'elt voisin d'une face de bord !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! surfac(3,nfac ! tr ! <-- ! surf vectorielle des surfaces interne !
+! surfbo( ! tr ! <-- ! surf vectorielle des surfaces !
+! (3,nfabor ! ! ! de bord !
+! pond(nfac ! tr ! <-- ! ponderation pour interpolation faces !
+! vectx (ncelet ! tr ! <-- ! composante x du vecteur entre !
+! vecty (ncelet ! tr ! <-- ! composante y du vecteur entre !
+! vectz (ncelet ! tr ! <-- ! composante z du vecteur entre !
+! valf (nfac) ! tr ! --> ! vect*surface aux faces internes !
+! valb (nfabor ! tr ! --> ! vect*surface aux faces de bord !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+
+include "paramx.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ndim, ncelet, ncel, nfac, nfabor
+integer ifacel(2,nfac), ifabor(nfabor)
+integer ia(*)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision pond(nfac)
+double precision vectx(ncelet), vecty(ncelet), vectz(ncelet)
+double precision valf(nfac), valb(nfabor)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer ifac, iel1, iel2
+integer idimte, itenso
+double precision valfx, valfy, valfz
+
+!===============================================================================
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (vectx)
+ !==========
+ call parcom (vecty)
+ !==========
+ call parcom (vectz)
+ !==========
+endif
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vectx , vectx , vectx , &
+ vecty , vecty , vecty , &
+ vectz , vectz , vectz )
+endif
+
+
+do ifac = 1 , nfac
+
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+
+ valfx = pond(ifac) * vectx(iel1) + &
+ (1.d0-pond(ifac)) * vectx(iel2)
+ valfy = pond(ifac) * vecty(iel1) + &
+ (1.d0-pond(ifac)) * vecty(iel2)
+ valfz = pond(ifac) * vectz(iel1) + &
+ (1.d0-pond(ifac)) * vectz(iel2)
+
+ valf(ifac) = valfx*surfac(1,ifac) + &
+ valfy*surfac(2,ifac) + &
+ valfz*surfac(3,ifac)
+ enddo
+
+ do ifac = 1 , nfabor
+
+! On met VALB a zero, ce qui revient a negliger la partie
+! extradiagonale du tenseur de diffusion au bord.
+!MO IEL1 = IFABOR(IFAC)
+!MOC
+!MO VALB(IFAC) = VECTX(IEL1)*SURFBO(1,IFAC) +
+!MO & VECTY(IEL1)*SURFBO(2,IFAC) +
+!MO & VECTZ(IEL1)*SURFBO(3,IFAC)
+ valb(ifac) = 0.d0
+
+ enddo
+
+ return
+ end
diff --git a/src/base/vericl.f90 b/src/base/vericl.f90
new file mode 100644
index 0000000..c3a09fc
--- /dev/null
+++ b/src/base/vericl.f90
@@ -0,0 +1,1241 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vericl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! VERIFICATION DE ICODCL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ifac, ivar, icode
+integer nstoni , nstvit(nphsmx), nstopp(nphsmx)
+integer nstoke(nphsmx), nstosc, nstovf
+integer nstuvw(nphsmx), nstoup(nphsmx), nstuke(nphsmx)
+integer nstrij(nphsmx), nsurij(nphsmx), nstov2(nphsmx)
+integer nstuv2(nphsmx), nstokw(nphsmx), nstukw(nphsmx)
+integer nstusc
+integer iis, icodcu, icodcv, icodcw, icodck, icodce
+integer icodcp, icodcf, icodom
+integer icor11, icor22, icor33, icor12, icor13, icor23
+integer ipp, iokcod, iok, iphas
+integer ipriph, iuiph , iviph , iwiph , ikiph , iepiph
+integer iphiph, ifbiph, iomgip
+integer ir11ip, ir22ip, ir33ip, ir12ip, ir13ip, ir23ip
+integer ippprp, ippuip, ippvip, ippwip, ippepp, ippkip
+integer ipp11p, ipp22p, ipp33p, ipp12p, ipp13p, ipp23p
+integer ippphp, ippfbp, ippomg
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. VERIFICATION DE LA CONSISTANCE DES CL
+!===============================================================================
+
+! 2.1 INITIALISATION
+! ====================
+
+! Dans USCLIM, on se donne une grande liberte pour la specif. des c.l
+! sur les variables. neanmoins pour limiter la plage des tests, on se
+! donne, pour l'instant, les contraintes suivantes :
+
+! - meme type de c.l pour les 3 composantes de vitesse
+! - pas de conditions de frottemt sur la pression
+! - coherence entre les c.l vitesses et pression
+! - coherence entre les c.l vitesses et turbulence
+
+nstoni = 0
+nstosc = 0
+nstovf = 0
+nstusc = 0
+do iphas = 1, nphas
+ nstvit(iphas) = 0
+ nstopp(iphas) = 0
+ nstoke(iphas) = 0
+ nstrij(iphas) = 0
+ nstov2(iphas) = 0
+ nstokw(iphas) = 0
+ nstuvw(iphas) = 0
+ nstoup(iphas) = 0
+ nstuke(iphas) = 0
+ nsurij(iphas) = 0
+ nstuv2(iphas) = 0
+ nstukw(iphas) = 0
+enddo
+
+
+! 2.2 VERIFICATIONS QUE TOUTES LES CL SONT INITIALISEES
+! ======================================================
+
+! --- Premiere boucle rapide
+iokcod = 0
+do ivar = 1, nvar
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.eq. 0) then
+ iokcod = 1
+ endif
+ enddo
+enddo
+
+! --- Seconde boucle lente si pb plus haut
+if(iokcod.ne.0) then
+ do ipp = 2, nvppmx
+ if (itrsvr(ipp).ge.1) then
+ ivar = itrsvr(ipp)
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.eq. 0) then
+ chaine=nomvar(ipp)
+ write(nfecra,1000)ifac,iprfml(ifmfbr(ifac),1), &
+ chaine(1:8),icodcl(ifac,ivar)
+ nstoni = nstoni + 1
+ endif
+ enddo
+ endif
+ enddo
+endif
+
+
+! 2.3 VERIFICATIONS DE L'ADMISSIBILITE DES CONDITIONS
+! ====================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+! --- Reperage des variables dans RTP
+ ipriph = ipr(iphas)
+ iuiph = iu (iphas)
+ iviph = iv (iphas)
+ iwiph = iw (iphas)
+ if(itytur(iphas).eq.2) then
+ ikiph = ik (iphas)
+ iepiph = iep(iphas)
+ elseif(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ iepiph = iep(iphas)
+ elseif(iturb(iphas).eq.50) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+ iphiph = iphi(iphas)
+ ifbiph = ifb(iphas)
+ elseif(iturb(iphas).eq.60) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+ endif
+
+ ippprp = ipprtp(ipriph)
+ ippuip = ipprtp(iuiph )
+ ippvip = ipprtp(iviph )
+ ippwip = ipprtp(iwiph )
+ if(itytur(iphas).eq.2) then
+ ippkip = ipprtp(ikiph )
+ ippepp = ipprtp(iepiph)
+ elseif(itytur(iphas).eq.3) then
+ ipp11p = ipprtp(ir11ip)
+ ipp22p = ipprtp(ir22ip)
+ ipp33p = ipprtp(ir33ip)
+ ipp12p = ipprtp(ir12ip)
+ ipp13p = ipprtp(ir13ip)
+ ipp23p = ipprtp(ir23ip)
+ ippepp = ipprtp(iepiph)
+ elseif(iturb(iphas).eq.50) then
+ ippkip = ipprtp(ikiph )
+ ippepp = ipprtp(iepiph)
+ ippphp = ipprtp(iphiph)
+ ippfbp = ipprtp(ifbiph)
+ elseif(iturb(iphas).eq.60) then
+ ippkip = ipprtp(ikiph )
+ ippomg = ipprtp(iomgip)
+ endif
+
+! --- Conditions admissibles pour les composantes de vitesse
+ do ifac = 1, nfabor
+
+ icodcu = icodcl(ifac,iuiph)
+ icodcv = icodcl(ifac,iviph)
+ icodcw = icodcl(ifac,iwiph)
+
+ if(icodcu.ne. 1.and. icodcu.ne. 3.and. &
+ icodcu.ne. 4.and.icodcu.ne. 5.and.icodcu.ne. 6.and. &
+ icodcu.ne. 9) then
+ chaine=nomvar(ippuip)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iuiph)
+ nstvit(iphas) = nstvit(iphas) + 1
+ endif
+ if(icodcv.ne. 1.and. icodcv.ne. 3.and. &
+ icodcv.ne. 4.and.icodcv.ne. 5.and.icodcv.ne. 6.and. &
+ icodcv.ne. 9) then
+ chaine=nomvar(ippvip )
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iviph)
+ nstvit(iphas) = nstvit(iphas) + 1
+ endif
+ if(icodcw.ne. 1.and. icodcw.ne. 3.and. &
+ icodcw.ne. 4.and.icodcw.ne. 5.and.icodcv.ne. 6.and. &
+ icodcw.ne. 9) then
+ chaine=nomvar(ippwip)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iwiph)
+ nstvit(iphas) = nstvit(iphas) + 1
+ endif
+
+! --- verification que la rugosite est initialisee si icodl=6
+ if(icodcu.eq.6 .and. rcodcl(ifac,iuiph,3).lt.epzero)then
+ CHAINE='RUGOSITV'
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iuiph)
+ nstvit(iphas) = nstvit(iphas) + 1
+ endif
+
+! --- on interdit les parois rugueuses en compressible
+ if (icodcu.eq.6 .and. ippmod(icompf).gt.0) then
+ chaine=nomvar(ippuip)
+ write(nfecra,1015)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8), &
+ icodcl(ifac,iuiph),ippmod(icompf)
+ nstvit(iphas) = nstvit(iphas) + 1
+ endif
+
+ enddo
+
+! --- Conditions admissibles pour la pression
+ do ifac = 1, nfabor
+
+ if(icodcl(ifac,ipriph).ne. 1.and. &
+ icodcl(ifac,ipriph).ne. 3) then
+ chaine=nomvar(ippprp)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8), &
+ icodcl(ifac,ipriph)
+ nstopp(iphas) = nstopp(iphas) + 1
+ endif
+
+ enddo
+
+! --- Conditions admissibles pour k et epsilon
+ if (itytur(iphas).eq.2) then
+
+ do ifac = 1, nfabor
+
+ if((icodcl(ifac,ikiph ).ne. 1.and. &
+ icodcl(ifac,ikiph ).ne. 3.and. &
+ icodcl(ifac,ikiph ).ne. 5.and. &
+ icodcl(ifac,ikiph ).ne. 6 ).or. &
+ (icodcl(ifac,iepiph).ne. 1.and. &
+ icodcl(ifac,iepiph).ne. 3.and. &
+ icodcl(ifac,iepiph).ne. 5.and. &
+ icodcl(ifac,iepiph).ne. 6 ) )then
+ chaine=nomvar(ippkip)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,ikiph )
+ chaine=nomvar(ippepp)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iepiph)
+ nstoke(iphas) = nstoke(iphas) + 1
+ endif
+
+ enddo
+
+! --- Conditions admissibles pour Rij et epsilon
+ elseif(itytur(iphas).eq.3) then
+
+ ivar = ir11ip
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.ne. 1.and. icode.ne. 3.and. &
+ icode.ne. 4.and.icode.ne. 5.and.icode.ne. 6 ) then
+ chaine=nomvar(ipp11p)
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),icode
+ nstrij(iphas) = nstrij(iphas) + 1
+ endif
+ enddo
+
+ ivar = ir22ip
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.ne. 1.and. icode.ne. 3.and. &
+ icode.ne. 4.and.icode.ne. 5.and.icode.ne. 6 ) then
+ chaine=nomvar(ipp22p)
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),icode
+ nstrij(iphas) = nstrij(iphas) + 1
+ endif
+ enddo
+
+ ivar = ir33ip
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.ne. 1.and. icode.ne. 3.and. &
+ icode.ne. 4.and.icode.ne. 5.and.icode.ne. 6 ) then
+ chaine=nomvar(ipp33p)
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),icode
+ nstrij(iphas) = nstrij(iphas) + 1
+ endif
+ enddo
+
+ ivar = ir12ip
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.ne. 1.and. icode.ne. 3.and. &
+ icode.ne. 4.and.icode.ne. 5.and.icode.ne. 6 ) then
+ chaine=nomvar(ipp12p)
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),icode
+ nstrij(iphas) = nstrij(iphas) + 1
+ endif
+ enddo
+
+ ivar = ir13ip
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.ne. 1.and. icode.ne. 3.and. &
+ icode.ne. 4.and.icode.ne. 5.and.icode.ne. 6 ) then
+ chaine=nomvar(ipp13p)
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),icode
+ nstrij(iphas) = nstrij(iphas) + 1
+ endif
+ enddo
+
+ ivar = ir23ip
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,ivar)
+ if(icode.ne. 1.and. icode.ne. 3.and. &
+ icode.ne. 4.and.icode.ne. 5.and.icode.ne. 6 ) then
+ chaine=nomvar(ipp23p)
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),icode
+ nstrij(iphas) = nstrij(iphas) + 1
+ endif
+ enddo
+
+ do ifac = 1, nfabor
+ icode = icodcl(ifac,iepiph)
+ if(icode.ne. 1.and. icode.ne. 3.and. &
+ icode.ne. 5.and.icode.ne. 6 ) then
+ chaine=nomvar(ippepp)
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),icode
+ nstrij(iphas) = nstrij(iphas) + 1
+ endif
+ enddo
+
+! --- Conditions admissibles pour k, epsilon, phi et f_barre
+ elseif (iturb(iphas).eq.50) then
+
+ do ifac = 1, nfabor
+
+ if((icodcl(ifac,ikiph ).ne. 1.and. &
+ icodcl(ifac,ikiph ).ne. 3.and. &
+ icodcl(ifac,ikiph ).ne. 5.and. &
+ icodcl(ifac,ikiph ).ne. 6 ).or. &
+ (icodcl(ifac,iepiph).ne. 1.and. &
+ icodcl(ifac,iepiph).ne. 3.and. &
+ icodcl(ifac,iepiph).ne. 5.and. &
+ icodcl(ifac,iepiph).ne. 6 ).or. &
+ (icodcl(ifac,iphiph).ne. 1.and. &
+ icodcl(ifac,iphiph).ne. 3.and. &
+ icodcl(ifac,iphiph).ne. 5.and. &
+ icodcl(ifac,iphiph).ne. 6 ).or. &
+ (icodcl(ifac,ifbiph).ne. 1.and. &
+ icodcl(ifac,ifbiph).ne. 3.and. &
+ icodcl(ifac,ifbiph).ne. 5.and. &
+ icodcl(ifac,ifbiph).ne. 6 ) )then
+ chaine=nomvar(ippkip)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,ikiph )
+ chaine=nomvar(ippepp)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iepiph)
+ chaine=nomvar(ippphp)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iphiph )
+ chaine=nomvar(ippfbp)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,ifbiph)
+ nstov2(iphas) = nstov2(iphas) + 1
+
+ endif
+
+ enddo
+
+! --- Conditions admissibles pour k et omega
+ elseif (iturb(iphas).eq.60) then
+
+ do ifac = 1, nfabor
+
+ if((icodcl(ifac,ikiph ).ne. 1.and. &
+ icodcl(ifac,ikiph ).ne. 3.and. &
+ icodcl(ifac,ikiph ).ne. 5.and. &
+ icodcl(ifac,ikiph ).ne. 6 ).or. &
+ (icodcl(ifac,iomgip).ne. 1.and. &
+ icodcl(ifac,iomgip).ne. 3.and. &
+ icodcl(ifac,iomgip).ne. 5.and. &
+ icodcl(ifac,iomgip).ne. 6 ) )then
+ chaine=nomvar(ippkip)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,ikiph )
+ chaine=nomvar(ippomg)
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,iomgip)
+ nstokw(iphas) = nstokw(iphas) + 1
+ endif
+
+ enddo
+
+ endif
+
+enddo
+! --- Boucle sur les phases : fin
+
+! --- Conditions admissibles pour les scalaires
+if(nscal.ge.1) then
+ do iis = 1,nscal
+ ivar = isca(iis)
+ do ifac = 1, nfabor
+ if(icodcl(ifac,ivar).ne. 1.and. &
+ icodcl(ifac,ivar).ne. 3.and. &
+ icodcl(ifac,ivar).ne. 5.and. &
+ icodcl(ifac,ivar).ne. 6 ) then
+ chaine=nomvar(ipprtp(ivar))
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8), &
+ icodcl(ifac,ivar)
+ nstosc = nstosc + 1
+ endif
+ if(icodcl(ifac,ivar).eq. 5.and. &
+ iscavr(iis).gt.0 ) then
+ chaine=nomvar(ipprtp(ivar))
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8), &
+ icodcl(ifac,ivar)
+ nstovf = nstovf + 1
+ endif
+ if(icodcl(ifac,ivar).eq. 6.and. &
+ iscavr(iis).gt.0 ) then
+ chaine=nomvar(ipprtp(ivar))
+ write(nfecra,1010) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8), &
+ icodcl(ifac,ivar)
+ nstovf = nstovf + 1
+ endif
+! --- verification que la rugosite scalaire est initialisee si icodl=6
+ if(icodcl(ifac,ivar).eq.6.and. &
+ rcodcl(ifac,ivar,3).lt.epzero)then
+ CHAINE='RUGOSITS'
+ write(nfecra,1010)ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),&
+ icodcl(ifac,ivar)
+ nstosc = nstosc + 1
+ endif
+ enddo
+ enddo
+endif
+
+! 2.4 VERIFICATIONS DES COHERENCES INTER VARIABLES INTRA PHASE
+! =============================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+! --- Reperage des variables dans RTP
+ ipriph = ipr(iphas)
+ iuiph = iu (iphas)
+ iviph = iv (iphas)
+ iwiph = iw (iphas)
+ if(itytur(iphas).eq.2) then
+ ikiph = ik (iphas)
+ iepiph = iep(iphas)
+ elseif(itytur(iphas).eq.3) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ir12ip = ir12(iphas)
+ ir13ip = ir13(iphas)
+ ir23ip = ir23(iphas)
+ iepiph = iep(iphas)
+ elseif(iturb(iphas).eq.50) then
+ ikiph = ik (iphas)
+ iepiph = iep (iphas)
+ iphiph = iphi(iphas)
+ ifbiph = ifb(iphas)
+ elseif(iturb(iphas).eq.60) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+ endif
+
+ ippprp = ipprtp(ipriph)
+ ippuip = ipprtp(iuiph )
+ ippvip = ipprtp(iviph )
+ ippwip = ipprtp(iwiph )
+ if(itytur(iphas).eq.2) then
+ ippkip = ipprtp(ikiph )
+ ippepp = ipprtp(iepiph)
+ elseif(itytur(iphas).eq.3) then
+ ipp11p = ipprtp(ir11ip)
+ ipp22p = ipprtp(ir22ip)
+ ipp33p = ipprtp(ir33ip)
+ ipp12p = ipprtp(ir12ip)
+ ipp13p = ipprtp(ir13ip)
+ ipp23p = ipprtp(ir23ip)
+ ippepp = ipprtp(iepiph)
+ elseif(iturb(iphas).eq.50) then
+ ippkip = ipprtp(ikiph )
+ ippepp = ipprtp(iepiph)
+ ippphp = ipprtp(iphiph)
+ ippfbp = ipprtp(ifbiph)
+ elseif(iturb(iphas).eq.60) then
+ ippkip = ipprtp(ikiph )
+ ippomg = ipprtp(iomgip)
+ endif
+
+! --- Coherence pour les composantes de vitesse
+ do ifac = 1, nfabor
+
+ icodcu = icodcl(ifac,iuiph)
+ icodcv = icodcl(ifac,iviph)
+ icodcw = icodcl(ifac,iwiph)
+
+ if(icodcu.eq.4.or.icodcu.eq.5.or.icodcu.eq.6.or. &
+ icodcu.eq.9.or. &
+ icodcv.eq.4.or.icodcv.eq.5.or.icodcv.eq.6.or. &
+ icodcv.eq.9.or. &
+ icodcw.eq.4.or.icodcw.eq.5.or.icodcw.eq.6.or. &
+ icodcw.eq.9 )then
+
+ if( icodcu.ne.icodcv .or. icodcu.ne.icodcw .or. &
+ icodcv.ne.icodcw ) then
+ write(nfecra,1020)ifac,iprfml(ifmfbr(ifac),1),iphas, &
+ icodcu,icodcv,icodcw
+ nstuvw(iphas) = nstuvw(iphas) + 1
+ endif
+ endif
+
+! --- Coherence vitesse pression
+
+! Remarques :
+! Pas de regle stricte de coherence vitesse/pression.
+! Avant on imposait un Dirichlet sur la pression pour en
+! entree/sortie, mais cela ne semble pas imperatif. Le test
+! est laisse en commentaire pour etre recupere si necessaire.
+
+! IF( ICODCU.EQ.9 .OR. ICODCV.EQ.9 .OR. ICODCW.EQ.9 ) THEN
+! IF( ICODCL(IFAC,IPRIPH).NE.1 ) THEN
+! CHAINE=NOMVAR(IPPPRP)
+! WRITE(NFECRA,1030)
+! & IFAC,IPRFML(IFMFBR(IFAC),1),CHAINE(1:8),IPHAS,
+! & ICODCL(IFAC,IPRIPH),ICODCU,ICODCV,ICODCW
+! NSTOUP(IPHAS) = NSTOUP(IPHAS) + 1
+! ENDIF
+! ENDIF
+
+ enddo
+
+! --- Coherence vitesse turbulence
+
+ if(itytur(iphas).eq.2) then
+
+ do ifac = 1, nfabor
+
+ icodcu = icodcl(ifac,iuiph)
+ icodcv = icodcl(ifac,iviph)
+ icodcw = icodcl(ifac,iwiph)
+ icodck = icodcl(ifac,ikiph)
+ icodce = icodcl(ifac,iepiph)
+
+ if( (icodcu.eq.5 .or. icodcv.eq.5 .or. icodcw.eq.5 .or. &
+ icodck.eq.5 .or. icodce.eq.5) .and. &
+ (icodcu.ne.5 .or. icodcv.ne.5 .or. icodcw.ne.5 .or. &
+ icodck.ne.5 .or. icodce.ne.5) ) then
+ chaine=nomvar(ippkip)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ikiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippepp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iepiph),icodcu,icodcv,icodcw
+ nstuke(iphas) = nstuke(iphas) + 1
+ endif
+
+ if( (icodcu.eq.6 .or. icodcv.eq.6 .or. icodcw.eq.6 .or. &
+ icodck.eq.6 .or. icodce.eq.6) .and. &
+ (icodcu.ne.6 .or. icodcv.ne.6 .or. icodcw.ne.6 .or. &
+ icodck.ne.6 .or. icodce.ne.6) ) then
+ chaine=nomvar(ippkip)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ikiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippepp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iepiph),icodcu,icodcv,icodcw
+ nstuke(iphas) = nstuke(iphas) + 1
+ endif
+
+ enddo
+
+ elseif(itytur(iphas).eq.3) then
+
+ do ifac = 1, nfabor
+
+ icodcu = icodcl(ifac,iuiph)
+ icodcv = icodcl(ifac,iviph)
+ icodcw = icodcl(ifac,iwiph)
+ icor11 = icodcl(ifac,ir11ip)
+ icor22 = icodcl(ifac,ir22ip)
+ icor33 = icodcl(ifac,ir33ip)
+ icor12 = icodcl(ifac,ir12ip)
+ icor13 = icodcl(ifac,ir13ip)
+ icor23 = icodcl(ifac,ir23ip)
+ icodce = icodcl(ifac,iepiph)
+
+ if( (icodcu.eq.5 .or. icodcv.eq.5 .or. icodcw.eq.5 .or. &
+ icor11.eq.5 .or. icor22.eq.5 .or. &
+ icor33.eq.5 .or. icor12.eq.5 .or. &
+ icor13.eq.5 .or. icor23.eq.5 .or. &
+ icodce.eq.5 ) .and. &
+ (icodcu.ne.5 .or. icodcv.ne.5 .or. icodcw.ne.5 .or. &
+ icor11.ne.5 .or. icor22.ne.5 .or. &
+ icor33.ne.5 .or. icor12.ne.5 .or. &
+ icor13.ne.5 .or. icor23.ne.5 .or. &
+ icodce.ne.5 ) ) then
+ write(nfecra,1040) &
+ ifac,iprfml(ifmfbr(ifac),1),iphas, &
+ icor11,icor22,icor33, &
+ icor12,icor13,icor23, &
+ icodce,icodcu,icodcv,icodcw
+ nsurij(iphas) = nsurij(iphas) + 1
+ endif
+
+ if( (icodcu.eq.6 .or. icodcv.eq.6 .or. icodcw.eq.6 .or. &
+ icor11.eq.6 .or. icor22.eq.6 .or. &
+ icor33.eq.6 .or. icor12.eq.6 .or. &
+ icor13.eq.6 .or. icor23.eq.6 .or. &
+ icodce.eq.6 ) .and. &
+ (icodcu.ne.6 .or. icodcv.ne.6 .or. icodcw.ne.6 .or. &
+ icor11.ne.6 .or. icor22.ne.6 .or. &
+ icor33.ne.6 .or. icor12.ne.6 .or. &
+ icor13.ne.6 .or. icor23.ne.6 .or. &
+ icodce.ne.6 ) ) then
+ write(nfecra,1040) &
+ ifac,iprfml(ifmfbr(ifac),1),iphas, &
+ icor11,icor22,icor33, &
+ icor12,icor13,icor23, &
+ icodce,icodcu,icodcv,icodcw
+ nsurij(iphas) = nsurij(iphas) + 1
+ endif
+
+ if( (icodcu.eq.4 .or. icodcv.eq.4 .or. icodcw.eq.4 .or. &
+ icor11.eq.4 .or. icor22.eq.4 .or. &
+ icor33.eq.4 .or. icor12.eq.4 .or. &
+ icor13.eq.4 .or. icor23.eq.4 &
+ ) .and. &
+ (icodcu.ne.4 .or. icodcv.ne.4 .or. icodcw.ne.4 .or. &
+ icor11.ne.4 .or. icor22.ne.4 .or. &
+ icor33.ne.4 .or. icor12.ne.4 .or. &
+ icor13.ne.4 .or. icor23.ne.4 .or. &
+ icodce.ne.3) ) then
+ write(nfecra,1040) &
+ ifac,iprfml(ifmfbr(ifac),1),iphas, &
+ icor11,icor22,icor33, &
+ icor12,icor13,icor23, &
+ icodce,icodcu,icodcv,icodcw
+ nsurij(iphas) = nsurij(iphas) + 1
+ endif
+
+ enddo
+
+ elseif(iturb(iphas).eq.50 ) then
+
+ do ifac = 1, nfabor
+
+ icodcu = icodcl(ifac,iuiph)
+ icodcv = icodcl(ifac,iviph)
+ icodcw = icodcl(ifac,iwiph)
+ icodck = icodcl(ifac,ikiph)
+ icodce = icodcl(ifac,iepiph)
+ icodcp = icodcl(ifac,iphiph)
+ icodcf = icodcl(ifac,ifbiph)
+
+ if( (icodcu.eq.5 .or. icodcv.eq.5 .or. icodcw.eq.5 .or. &
+ icodck.eq.5 .or. icodce.eq.5 .or. icodcp.eq.5 .or. &
+ icodcf.eq.5 ) .and. &
+ (icodcu.ne.5 .or. icodcv.ne.5 .or. icodcw.ne.5 .or. &
+ icodck.ne.5 .or. icodce.ne.5 .or. icodcp.ne.5 .or. &
+ icodcf.ne.5 ) ) then
+ chaine=nomvar(ippkip)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ikiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippepp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iepiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippphp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iphiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippfbp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ifbiph),icodcu,icodcv,icodcw
+ nstuv2(iphas) = nstuv2(iphas) + 1
+
+ if( (icodcu.eq.6 .or. icodcv.eq.6 .or. icodcw.eq.6 .or. &
+ icodck.eq.6 .or. icodce.eq.6 .or. icodcp.eq.6 .or. &
+ icodcf.eq.6 ) .and. &
+ (icodcu.ne.6 .or. icodcv.ne.6 .or. icodcw.ne.6 .or. &
+ icodck.ne.6 .or. icodce.ne.6 .or. icodcp.ne.6 .or. &
+ icodcf.ne.6 ) ) then
+ chaine=nomvar(ippkip)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ikiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippepp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iepiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippphp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iphiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippfbp)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ifbiph),icodcu,icodcv,icodcw
+ nstuv2(iphas) = nstuv2(iphas) + 1
+
+ endif
+
+ endif
+
+ enddo
+
+ elseif(iturb(iphas).eq.60 ) then
+
+ do ifac = 1, nfabor
+
+ icodcu = icodcl(ifac,iuiph)
+ icodcv = icodcl(ifac,iviph)
+ icodcw = icodcl(ifac,iwiph)
+ icodck = icodcl(ifac,ikiph)
+ icodom = icodcl(ifac,iomgip)
+
+ if( (icodcu.eq.5 .or. icodcv.eq.5 .or. icodcw.eq.5 .or. &
+ icodck.eq.5 .or. icodom.eq.5 ) .and. &
+ (icodcu.ne.5 .or. icodcv.ne.5 .or. icodcw.ne.5 .or. &
+ icodck.ne.5 .or. icodom.ne.5 ) ) then
+ chaine=nomvar(ippkip)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ikiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippomg)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iomgip),icodcu,icodcv,icodcw
+ nstukw(iphas) = nstukw(iphas) + 1
+ endif
+
+ if( (icodcu.eq.6 .or. icodcv.eq.6 .or. icodcw.eq.6 .or. &
+ icodck.eq.6 .or. icodom.eq.6 ) .and. &
+ (icodcu.ne.6 .or. icodcv.ne.6 .or. icodcw.ne.6 .or. &
+ icodck.ne.6 .or. icodom.ne.6 ) ) then
+ chaine=nomvar(ippkip)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,ikiph),icodcu,icodcv,icodcw
+ chaine=nomvar(ippomg)
+ write(nfecra,1030) &
+ ifac,iprfml(ifmfbr(ifac),1),chaine(1:8),iphas, &
+ icodcl(ifac,iomgip),icodcu,icodcv,icodcw
+ nstukw(iphas) = nstukw(iphas) + 1
+ endif
+
+ enddo
+
+ endif
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+! 2.5 VERIFICATIONS DES COHERENCES INTER VARIABLES INTRA PHASE
+! =============================================================
+
+! --- Coherence vitesse scalaires
+
+if( nscal.ge.1 ) then
+ do iis = 1, nscal
+ iphas = iphsca(iis)
+ if(itytur(iphas).eq.2.or.itytur(iphas).eq.3) then
+ ivar = isca(iis)
+ do ifac = 1, nfabor
+ icodcu = icodcl(ifac,iu(iphas))
+ if(icodcl(ifac,ivar).eq.5.and.icodcu.ne.5) then
+ chaine=nomvar(ipprtp(ivar))
+ write(nfecra,1050) ifac,iprfml(ifmfbr(ifac),1), &
+ chaine(1:8), iis, iphas, &
+ icodcl(ifac,ivar), icodcu
+ nstusc = nstusc + 1
+ endif
+ enddo
+ endif
+ enddo
+endif
+
+!===============================================================================
+! 3. IMPRESSIONS RECAPITULATIVES
+!===============================================================================
+
+iok = 0
+
+if( nstoni.gt.0 .or. nstosc.gt.0 .or. nstovf.gt.0 .or. &
+ nstusc.gt.0 ) then
+ write (nfecra,1901) nstoni, nstosc, nstovf, nstusc
+ iok = 1
+endif
+
+do iphas = 1, nphas
+ if( nstvit(iphas).gt.0 .or. nstopp(iphas).gt.0 .or. &
+ nstoke(iphas).gt.0 .or. nstrij(iphas).gt.0 .or. &
+ nstov2(iphas).gt.0 .or. &
+ nstuvw(iphas).gt.0 .or. nstoup(iphas).gt.0 .or. &
+ nstuke(iphas).gt.0 .or. nsurij(iphas).gt.0 .or. &
+ nstuv2(iphas).gt.0 ) then
+ write (nfecra,1902) iphas, nstvit(iphas),nstopp(iphas), &
+ nstoke(iphas),nstrij(iphas), &
+ nstov2(iphas), &
+ nstuvw(iphas),nstoup(iphas), &
+ nstuke(iphas),nsurij(iphas), &
+ nstuv2(iphas)
+ iok = 1
+ endif
+enddo
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+!===============================================================================
+! 3. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@ COND. LIM. NON INITIALISEES ',/,&
+'@ FACE ',I10 ,'; PROPRIETE 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ ICODCL VARIABLE ', I10 ,/,&
+'@ ' )
+ 1010 format( &
+'@ ',/,&
+'@ COND. LIM. NON PREVUES ',/,&
+'@ FACE ',I10 ,'; PROPRIETE 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ ICODCL VARIABLE ', I10 ,/,&
+'@ ' )
+ 1015 format( &
+'@ ',/,&
+'@ CONDITIONS AUX LIMITES DE PAROI RUGUEUSE INCOMPATIBLES ',/,&
+'@ AVEC LE MODULE COMPRESSIBLE ',/,&
+'@ FACE ',I10 ,'; PROPRIETE 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ ICODCL VARIABLE =',I10 ,/,&
+'@ IPPMOD(ICOMPF) =',I10 ,/,&
+'@ ' )
+ 1020 format( &
+'@ ',/,&
+'@ INCOHERENCE COND. LIM. COMPOSANTES DE LA VITESSE ',/,&
+'@ FACE ',I10 ,'; PROPRIETE 1:',I10 ,'; PHASE ',I10 ,/,&
+'@ ICODCL VITESSE ',3I10 ,/,&
+'@ ' )
+ 1030 format( &
+'@ ',/,&
+'@ INCOHERENCE COND. LIM. VITESSE-VARIABLE ',/,&
+'@ FACE ',I10 ,'; PROPRIETE 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ PHASE ',I10 ,/,&
+'@ ICODCL VARIABLE ', I10 ,/,&
+'@ ICODCL VITESSE ',3I10 ,/,&
+'@ ' )
+ 1040 format( &
+'@ ',/,&
+'@ INCOHERENCE COND. LIM. VITESSE-RIJ-EPSILON ',/,&
+'@ FACE ',I10 ,'; PROPRIETE 1:',I10 ,'; RIJ-EPSILON ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ICODCL RIJ-EPS ',7I5 ,/,&
+'@ ICODCL VITESSE ',3I5 ,/,&
+'@ ' )
+ 1050 format( &
+'@ ',/,&
+'@ INCOHERENCE COND. LIM. VITESSE-SCALAIRE ',/,&
+'@ FACE ',I10 ,'; PROPRIETE 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ SCALAIRE NUMERO ',I10 ,'; PHASE ',I10 ,/,&
+'@ ICODCL SCALAIRE ',I10 ,'; ICODCL VITESSE ',I10 ,/,&
+'@ ' )
+ 1901 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Conditions aux limites non initialisees : ',I10 ,/,&
+'@ Conditions aux limites non prevues : ',/,&
+'@ sur les scalaires : ',I10 ,/,&
+'@ sur les scalaires representant ',/,&
+'@ une variance : ',I10 ,/,&
+'@ Incoherences : ',/,&
+'@ entre vitesse et scalaires : ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ',/,&
+'@ ou usclim. ',/,&
+'@ ',/)
+ 1902 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE LA VERIFICATION DES COND. LIM.',/,&
+'@ ========= ',/,&
+'@ POUR LA PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Conditions aux limites non prevues : ',/,&
+'@ sur la vitesse : ',I10 ,/,&
+'@ sur la pression : ',I10 ,/,&
+'@ sur k et epsilon : ',I10 ,/,&
+'@ sur Rij et epsilon : ',I10 ,/,&
+'@ sur k, epsilon, phi et f_barre : ',I10 ,/,&
+'@ Incoherences : ',/,&
+'@ entre les composantes de la vitesse : ',I10 ,/,&
+'@ entre vitesse et pression : ',I10 ,/,&
+'@ entre vitesse et k-epsilon : ',I10 ,/,&
+'@ entre vitesse et Rij-epsilon : ',I10 ,/,&
+'@ entre vitesse et v2f : ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ',/,&
+'@ ou usclim. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@ UNINITIALIZED BOUNDARY CONDITIONS ',/,&
+'@ FACE ',I10 ,'; PROPERTY 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ ICODCL VARIABLE ', I10 ,/,&
+'@ ' )
+ 1010 format( &
+'@ ',/,&
+'@ UNEXPECTED BOUNDARY CONDITIONS ',/,&
+'@ FACE ',I10 ,'; PROPERTY 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ ICODCL VARIABLE ', I10 ,/,&
+'@ ' )
+ 1015 format( &
+'@ ',/,&
+'@ ROUGH WALL BOUNDARY CONDITIONS INCOMPATIBLE WITH THE ',/,&
+'@ COMPRESSIBLE MODULE ',/,&
+'@ FACE ',I10 ,'; PROPERTY 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ ICODCL VARIABLE =',I10 ,/,&
+'@ IPPMOD(ICOMPF) =',I10 ,/,&
+'@ ' )
+ 1020 format( &
+'@ ',/,&
+'@ INCOHERENCY BOUNDARY CONDITIONS VELOCITY COMPONENT ',/,&
+'@ FACE ',I10 ,'; PROPERTY 1:',I10 ,'; PHASE ',I10 ,/,&
+'@ ICODCL VELOCITY ',3I10 ,/,&
+'@ ' )
+ 1030 format( &
+'@ ',/,&
+'@ INCOHERENCY BOUNDARY CONDITIONS VELOCITY-VARIABLE ',/,&
+'@ FACE ',I10 ,'; PROPERTY 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ PHASE ',I10 ,/,&
+'@ ICODCL VARIABLE ', I10 ,/,&
+'@ ICODCL VELOCITY ',3I10 ,/,&
+'@ ' )
+ 1040 format( &
+'@ ',/,&
+'@ INCOHERENCY BOUNDARY CONDITIONS VELOCITY-RIJ-EPSILON ',/,&
+'@ FACE ',I10 ,'; PROPERTY 1:',I10 ,'; RIJ-EPSILON ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ICODCL RIJ-EPS ',7I5 ,/,&
+'@ ICODCL VELOCITY ',3I5 ,/,&
+'@ ' )
+ 1050 format( &
+'@ ',/,&
+'@ INCOHERENCY BOUNDARY CONDITIONS VELOCITY-SCALAR ',/,&
+'@ FACE ',I10 ,'; PROPERTY 1:',I10 ,'; VARIABLE ',A8 ,/,&
+'@ SCALAR NUMBER ',I10 ,'; PHASE ',I10 ,/,&
+'@ ICODCL SCALAR ',I10 ,'; ICODCL VELOCITY ',I10 ,/,&
+'@ ' )
+ 1901 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE BOUNDARY CONDITIONS VERIF. ',/,&
+'@ ======== ',/,&
+'@ ',/,&
+'@ Uninitialized boundary conditions : ',I10 ,/,&
+'@ Unexpected boundary conditions: ',/,&
+'@ on the scalars : ',I10 ,/,&
+'@ on the scalars representing ',/,&
+'@ a variance : ',I10 ,/,&
+'@ Incoherencies: ',/,&
+'@ between velocity and scalars : ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given via the interface or ',/,&
+'@ usclim. ',/,&
+'@ ',/)
+ 1902 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE BOUNDARY CONDITIONS VERIF. ',/,&
+'@ ======== ',/,&
+'@ FOR PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Unexpeted boundary conditions: ',/,&
+'@ on the velocity : ',I10 ,/,&
+'@ on the pressure : ',I10 ,/,&
+'@ on k and epsilon : ',I10 ,/,&
+'@ on Rij and epsilon : ',I10 ,/,&
+'@ on k, epsilon, phi and f_barre : ',I10 ,/,&
+'@ Incoherencies: ',/,&
+'@ between the velocity components : ',I10 ,/,&
+'@ between velocity and pressure : ',I10 ,/,&
+'@ between velocity and k-epsilon : ',I10 ,/,&
+'@ between velocity and Rij-epsilon : ',I10 ,/,&
+'@ between velocity and v2f : ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given via the interface or ',/,&
+'@ usclim. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+return
+end
diff --git a/src/base/verini.f90 b/src/base/verini.f90
new file mode 100644
index 0000000..e52c90f
--- /dev/null
+++ b/src/base/verini.f90
@@ -0,0 +1,6821 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine verini &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "mltgrd.h"
+include "cstphy.h"
+include "entsor.h"
+include "albase.h"
+include "alstru.h"
+include "period.h"
+include "parall.h"
+include "ppthch.h"
+include "ppppar.h"
+include "ppincl.h"
+include "lagpar.h"
+include "lagran.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+character chaine*80, chain2*80
+integer ii , iis , jj , iisct , iphas
+integer iscal , iest , iiesca, ivar
+integer iuiph , iviph , iwiph, ikiph, ieiph
+integer itrbph, nbsccp
+integer ipp , imgrok, nbccou
+integer iokpre, indest, itests, iiidef, istop
+integer iresop, ipolop
+double precision testth
+double precision arakfr
+
+!===============================================================================
+
+!===============================================================================
+! 1. ENTREES SORTIES entsor.h : formats 1000
+!===============================================================================
+
+! --- Dimension
+
+if (ndim.ne.3) then
+ write(nfecra,1100)ndim
+ iok = iok + 1
+endif
+
+! --- Suite, Chrono, Historiques, Listing
+
+if(ntsuit.lt.-1) then
+ WRITE(NFECRA,1200) 'NTSUIT (Periode Sortie Suite )',NTSUIT
+ iok = iok + 1
+endif
+
+if(ntchr.ne.-1.and.ntchr.le.0) then
+ WRITE(NFECRA,1210) 'NTCHR (Periode Sortie Chrono.)',NTCHR
+ iok = iok + 1
+endif
+
+do ipp = 2, nvppmx
+ if(ichrvr(ipp).ne.1.and.ichrvr(ipp).ne.0) then
+ chaine=nomvar(ipp)
+ write(nfecra,1220)chaine(1:8),ipp,ichrvr(ipp)
+ iok = iok + 1
+ endif
+enddo
+
+if(ncapt.lt.0.or.ncapt.gt.ncaptm) then
+ write(nfecra,1230)ncaptm,ncapt
+ iok = iok + 1
+endif
+
+if(nthist.le.0.and.nthist.ne.-1) then
+ WRITE(NFECRA,1210) 'NTHIST (Periode Sortie Histo. )',NTHIST
+ iok = iok + 1
+endif
+
+if(nthsav.lt.-1) then
+ WRITE(NFECRA,1200) 'NTHSAV (Periode Save Histo. )',NTHSAV
+ iok = iok + 1
+endif
+
+do ipp = 2, nvppmx
+ if( ihisvr(ipp,1).gt.ncapt.or. &
+ (ihisvr(ipp,1).lt.0.and.ihisvr(ipp,1).ne.-1) ) then
+ chaine=nomvar(ipp)
+ write(nfecra,1240)chaine(1:8),ipp,ncapt,ihisvr(ipp,1)
+ iok = iok + 1
+ endif
+enddo
+
+do ipp = 2, nvppmx
+ if( (ihisvr(ipp,1).gt.0.and.ihisvr(ipp,1).lt.ncapt)) then
+ do jj = 1, ihisvr(ipp,1)
+ if(ihisvr(ipp,jj+1).le.0.or.ihisvr(ipp,jj+1).gt.ncapt) then
+ chaine=nomvar(ipp)
+ write(nfecra,1250) &
+ chaine(1:8),ipp,jj+1,ncapt,ihisvr(ipp,jj+1)
+ iok = iok + 1
+ endif
+ enddo
+ endif
+enddo
+
+do ipp = 2, nvppmx
+ if( ilisvr(ipp).ne.0.and.ilisvr(ipp).ne.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,1260)chaine(1:8),ipp,ilisvr(ipp)
+ iok = iok + 1
+ endif
+enddo
+
+do ipp = 2, nvppmx
+ if(itrsvr(ipp).ne.0) then
+ if(itrsvr(ipp).le.0.or.itrsvr(ipp).gt.nvar) then
+ chaine=nomvar(ipp)
+ write(nfecra,1270)chaine(1:8),ipp,nvar,itrsvr(ipp)
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+if(ntlist.ne.-1.and.ntlist.le.0) then
+ WRITE(NFECRA,1210) 'NTLIST (Periode Sortie Listing)',NTLIST
+ iok = iok + 1
+endif
+
+! --- Post traitement automatique (bord)
+
+if(ipstdv.ne.1.and. &
+ mod(ipstdv,ipstyp).ne.0.and. &
+ mod(ipstdv,ipstcl).ne.0.and. &
+ mod(ipstdv,ipstft).ne.0) then
+ WRITE(NFECRA,1300) 'IPSTDV', &
+ 'IPSTYP',IPSTYP, &
+ 'IPSTCL',IPSTCL, &
+ 'IPSTFT',IPSTFT, &
+ 'IPSTFO',IPSTFO, &
+ 'IPSTDV',IPSTDV
+ iok = iok + 1
+endif
+
+
+!===============================================================================
+! 2. OPTIONS DU CALCUL : TABLEAUX DE optcal.h : formats 2000
+!===============================================================================
+
+! --- Dimensions
+
+if(nphas.lt.0.or.nphas.gt.nphsmx) then
+ WRITE(NFECRA,2000)'NPHAS ',NPHSMX,NPHAS
+ iok = iok + 1
+endif
+if(nscal.lt.0.or.nscal.gt.nscamx) then
+ WRITE(NFECRA,2000)'NSCAL ',NSCAMX,NSCAL
+ iok = iok + 1
+endif
+if(nscaus.lt.0.or.nscaus.gt.nscamx) then
+ WRITE(NFECRA,2000)'NSCAUS',NSCAMX,NSCAUS
+ iok = iok + 1
+endif
+if(nscapp.lt.0.or.nscapp.gt.nscamx) then
+ WRITE(NFECRA,2000)'NSCAPP',NSCAMX,NSCAPP
+ iok = iok + 1
+endif
+if(nvar.lt.0.or.nvar.gt.nvarmx) then
+ WRITE(NFECRA,2000)'NVAR ',NVARMX,NVAR
+ iok = iok + 1
+endif
+
+! --- Rho et visc constants ou variables
+
+do iphas = 1, nphas
+ if(irovar(iphas).ne.0.and.irovar(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IROVAR',IROVAR(IPHAS)
+ iok = iok + 1
+ endif
+ if(ivivar(iphas).ne.0.and.ivivar(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IVIVAR',IVIVAR(IPHAS)
+ iok = iok + 1
+ endif
+enddo
+
+! --- Definition des equations, schema en temps, schema convectif
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if( (iconv (ii).ne.0.and.iconv (ii).ne.1).or. &
+ (istat (ii).ne.0.and.istat (ii).ne.1).or. &
+ (idiff (ii).ne.0.and.idiff (ii).ne.1).or. &
+ (idifft(ii).ne.0.and.idifft(ii).ne.1).or. &
+ (thetav(ii).gt.1.d0.or.thetav(ii).lt.0.d0).or. &
+ (blencv(ii).gt.1.d0.or.blencv(ii).lt.0.d0).or. &
+ (ischcv(ii).ne.0.and.ischcv(ii).ne.1).or. &
+ (isstpc(ii).ne.0.and.isstpc(ii).ne.1) ) then
+ chaine=nomvar(ipp)
+ write(nfecra,2100) chaine(1:8), &
+ istat(ii),iconv(ii), &
+ idiff(ii),idifft(ii), &
+ thetav(ii),blencv(ii),ischcv(ii), &
+ isstpc(ii)
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+
+! Extrap de rho : necessairement rho variable
+do iphas = 1, nphas
+ if(irovar(iphas).eq.0.and.iroext(iphas).gt.0) then
+ write(nfecra,2005)iphas,iroext(iphas),irovar(iphas)
+ iok = iok + 1
+ endif
+enddo
+
+! Coherence des vitesses
+! Pour le moment, theta est fixe automatiquement dans modini
+! On conserve quand meme le test pour plus tard puisqu'il est ecrit.
+do iphas = 1, nphas
+ if(abs(thetav(iv(iphas))-thetav(iu(iphas))).gt.epzero.or. &
+ abs(thetav(iw(iphas))-thetav(iu(iphas))).gt.epzero) then
+ write(nfecra,2111) iphas,thetav(iu(iphas)),thetav(iv(iphas)), &
+ thetav(iw(iphas))
+ iok = iok + 1
+ endif
+enddo
+
+
+! Theta pression : vaut 1
+! Pour le moment, theta est fixe automatiquement dans modini
+! (on ne devrait donc jamais voir cet affichage)
+! On conserve quand meme le test pour plus tard puisqu'il est ecrit.
+do iphas = 1, nphas
+ jj = ipr(iphas)
+ if(abs(thetav(jj)-1.0d0).gt.epzero) then
+ ipp = ipprtp(jj)
+ chaine=nomvar(ipp)
+ write(nfecra,2112) iphas,thetav(jj)
+ iok = iok + 1
+ endif
+enddo
+
+! Flux de masse et proprietes
+! Pour le moment, theta est fixe automatiquement dans modini
+! Donc pas de test sur sa valeur ici
+
+! On verifie que toutes les phases sont traitees pareil
+testth = thetfl(1)
+itests = istmpf(1)
+do iphas = 1, nphas
+
+ if(abs(testth-thetfl(iphas)).gt.epzero) then
+ write(nfecra,2113) iphas,testth,thetfl(iphas)
+ iok = iok + 1
+ endif
+ if(itests.ne.istmpf(iphas)) then
+ write(nfecra,2114) iphas,itests,istmpf(iphas)
+ iok = iok + 1
+ endif
+enddo
+
+! En LES il y a des verification de coherence supplementaires.
+! (simple avertissement si on s'ecarte des choix std)
+! mais stop si on fait plus de 5% d'upwind
+! Schema centre sans/avec test de pente, nwsrsm
+do iphas = 1, nphas
+ if(itytur(iphas).eq.4) then
+ do ii = 1,3
+ if(ii.eq.1) jj = iu(iphas)
+ if(ii.eq.2) jj = iv(iphas)
+ if(ii.eq.3) jj = iw(iphas)
+ ipp = ipprtp(jj)
+ chaine=nomvar(ipp)
+ if(abs(thetav(jj)-0.5d0).gt.epzero) then
+ write(nfecra,2121) iphas,chaine(1:8),thetav(jj)
+ endif
+ if (blencv(jj).lt.0.95d0) then
+ write(nfecra,2127) iphas,chaine(1:8),blencv(jj)
+ iok = iok + 1
+ elseif(abs(blencv(jj)-1.d0).gt.epzero) then
+ write(nfecra,2122) iphas,chaine(1:8),blencv(jj)
+ endif
+ if(isstpc(jj).eq.0) then
+ write(nfecra,2123) iphas,chaine(1:8),isstpc(jj)
+ endif
+ enddo
+ endif
+ if(itytur(iphas).eq.4.or.ischtp(iphas).eq.2) then
+ do ii = 1,3
+ if(ii.eq.1) jj = iu(iphas)
+ if(ii.eq.2) jj = iv(iphas)
+ if(ii.eq.3) jj = iw(iphas)
+ ipp = ipprtp(jj)
+ chaine=nomvar(ipp)
+ iiidef = 10
+ if(nswrsm(jj).ne.iiidef) then
+ write(nfecra,2125) iphas,chaine(1:8),iiidef,nswrsm(jj)
+ endif
+ enddo
+ jj = ipr(iphas)
+ ipp = ipprtp(jj)
+ chaine=nomvar(ipp)
+ iiidef = 5
+ if(nswrsm(jj).ne.iiidef) then
+ write(nfecra,2125) iphas,chaine(1:8),iiidef,nswrsm(jj)
+ endif
+ endif
+enddo
+do ii = 1, nscal
+ iphas = iphsca(ii)
+ if(itytur(iphas).eq.4) then
+ jj = isca(ii)
+ ipp = ipprtp(jj)
+ chaine=nomvar(ipp)
+ if(abs(thetav(jj)-0.5d0).gt.epzero) then
+ write(nfecra,2121) iphas,chaine(1:8),thetav(jj)
+ endif
+ if (blencv(jj).lt.0.95d0) then
+ write(nfecra,2127) iphas,chaine(1:8),blencv(jj)
+ iok = iok + 1
+ elseif(abs(blencv(jj)-1.d0).gt.epzero) then
+ write(nfecra,2122) iphas,chaine(1:8),blencv(jj)
+ endif
+ if(isstpc(jj).eq.1) then
+ write(nfecra,2124) iphas,chaine(1:8),isstpc(jj)
+ endif
+ endif
+ if(itytur(iphas).eq.4.or.ischtp(iphas).eq.2) then
+ iiidef = 10
+ if(nswrsm(jj).ne.iiidef) then
+ write(nfecra,2125) iphas,chaine(1:8),iiidef,nswrsm(jj)
+ endif
+ endif
+enddo
+
+! Test du theta de la viscosite secondaire, du flux de masse et
+! de la viscosite par rapport a celui de la vitesse
+do iphas = 1, nphas
+ jj = iu(iphas)
+ if( abs(thetav(jj)-1.d0).lt.epzero.and. &
+ (istmpf(iphas).eq.2.or. &
+ isno2t(iphas).ne.0.or. &
+ isto2t(iphas).ne.0.or. &
+ iroext(iphas).ne.0.or. &
+ iviext(iphas).ne.0.or. &
+ icpext(iphas).ne.0 ) ) then
+ write(nfecra,2131) iphas,thetav(jj), &
+ istmpf(iphas),isno2t(iphas),isto2t(iphas), &
+ iroext(iphas),iviext(iphas),icpext(iphas)
+ endif
+ if( abs(thetav(jj)-0.5d0).lt.epzero.and. &
+ (istmpf(iphas).ne.2.or. &
+ isno2t(iphas).ne.1.or. &
+ isto2t(iphas).ne.1.or. &
+ iroext(iphas).ne.1.or. &
+ iviext(iphas).ne.1.or. &
+ icpext(iphas).ne.1 ) ) then
+ write(nfecra,2132) iphas,thetav(jj), &
+ istmpf(iphas),isno2t(iphas),isto2t(iphas), &
+ iroext(iphas),iviext(iphas),icpext(iphas)
+ endif
+enddo
+do iscal = 1, nscal
+ iphas = iphsca(iscal)
+ if(isso2t(iscal).ne.isno2t(iphas))then
+ write(nfecra,2133) iscal,isso2t(iscal),iphas,isno2t(iphas)
+ endif
+ if(ivsext(iscal).ne.iviext(iphas))then
+ write(nfecra,2134) iscal,ivsext(iscal),iphas,iviext(iphas)
+ endif
+enddo
+
+! Test du theta de la diffusivite des scalaires et de Cp : ils doivent etre
+! variables en (en espace) si on les extrapole (en temps) (...)
+do iphas = 1, nphas
+ if( icpext(iphas).gt.0 .and. icp(iphas).le.0 ) then
+ write(nfecra,2135) iphas, icpext(iphas), icp(iphas)
+ iok = iok + 1
+ endif
+enddo
+do iscal = 1, nscal
+ if( ivsext(iscal).gt.0 .and. ivisls(iscal).le.0 ) then
+ write(nfecra,2136) iscal, ivsext(iscal), ivisls(iscal)
+ iok = iok + 1
+ endif
+enddo
+
+
+
+! Pour les tests suivants : Utilise-t-on un estimateur d'erreur ?
+indest = 0
+do iphas = 1, nphas
+ do iest = 1, nestmx
+ iiesca = iescal(iest,iphas)
+ if(iiesca.gt.0) then
+ indest = 1
+ endif
+ enddo
+enddo
+
+! Estimateurs incompatibles avec calcul a champ de vitesse
+! fige (on ne fait rien, sauf ecrire des betises dans le listing)
+ if(indest.eq.1.and.iccvfg.eq.1) then
+ write(nfecra,2137)
+ iok = iok + 1
+ endif
+
+! A priori, pour le moment, l'ordre 2 en temps
+! (rho, visc, termes sources N.S, theta vitesse)
+! est incompatible avec
+! - estimateurs
+! - ipucou
+! - iphydr et icalhy
+! - dt variable en espace ou en temps et stationnaire
+! Ici on s'arrete si on n'est pas dans le cas du schema std
+do iphas = 1, nphas
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+ if( (abs(thetav(iuiph)-1.0d0).gt.1.d-3).or. &
+ (abs(thetav(iviph)-1.0d0).gt.1.d-3).or. &
+ (abs(thetav(iwiph)-1.0d0).gt.1.d-3).or. &
+ ( thetsn(iphas) .gt.0.d0 ).or. &
+ ( isno2t(iphas) .gt.0 ).or. &
+ ( thetro(iphas) .gt.0.d0 ).or. &
+ ( iroext(iphas) .gt.0 ).or. &
+ ( thetvi(iphas) .gt.0.d0 ).or. &
+ ( iviext(iphas) .gt.0 ) ) then
+ if(indest.eq.1.or.ipucou.eq.1.or. &
+ iphydr.eq.1.or.icalhy.eq.1.or. &
+ idtvar.eq.1.or.idtvar.eq.2.or.idtvar.lt.0) then
+ write(nfecra,2140) iphas, &
+ thetav(iuiph),thetav(iviph),thetav(iwiph), &
+ isno2t(iphas),thetsn(iphas), &
+ iroext(iphas),thetro(iphas), &
+ iviext(iphas),thetvi(iphas)
+ iok = iok + 1
+ endif
+ endif
+ enddo
+
+
+! Iterations sur navsto
+! Doit etre un entier superieur ou egal a 1
+! Pour le moment, on interdit NTERUP > 1 et
+! estimateurs, matrices poids, pression hydrostatique
+! et algo stationnaire
+
+if(nterup.le.0) then
+ WRITE(NFECRA,3100) 'NTERUP', NTERUP
+ iok = iok + 1
+endif
+
+if(nterup.gt.1) then
+
+ if(ipucou.eq.1.or.indest.eq.1.or. &
+ ippmod(icompf).ge.0.or.iccvfg.eq.1.or. &
+ iphydr.eq.1.or.icalhy.eq.1.or.idtvar.eq.-1) then
+ write(nfecra,2141) nterup
+ iok = iok + 1
+ endif
+
+endif
+
+! A priori, pour le moment, l'ordre 2 en temps
+! n'est pas pris en compte en k-eps, v2f ou k-omega couple : on s'arrete
+do iphas = 1, nphas
+ if (itytur(iphas).eq.2 .and.ikecou(iphas).eq.1) then
+ if(( thetst(iphas) .gt.0.d0 ).or. &
+ ( isto2t(iphas) .gt.0 ).or. &
+ (abs(thetav(ik (iphas))-1.0d0).gt.epzero).or. &
+ (abs(thetav(iep(iphas))-1.0d0).gt.epzero) ) then
+ write(nfecra,2142)iphas,iturb(iphas),ikecou(iphas), &
+ thetst(iphas),isto2t(iphas), &
+ thetav(ik (iphas)),thetav(iep(iphas))
+ iok = iok + 1
+ endif
+ endif
+ if (iturb(iphas).eq.50.and.ikecou(iphas).eq.1) then
+ if(( thetst(iphas) .gt.0.d0 ).or. &
+ ( isto2t(iphas) .gt.0 ).or. &
+ (abs(thetav(ik (iphas))-1.0d0).gt.epzero).or. &
+ (abs(thetav(iep (iphas))-1.0d0).gt.epzero).or. &
+ (abs(thetav(iphi(iphas))-1.0d0).gt.epzero).or. &
+ (abs(thetav(ifb (iphas))-1.0d0).gt.epzero) ) then
+ write(nfecra,2143)iphas,iturb(iphas),ikecou(iphas), &
+ thetst(iphas),isto2t(iphas), &
+ thetav(ik (iphas)),thetav(iep (iphas)), &
+ thetav(iphi(iphas)),thetav(ifb (iphas))
+ iok = iok + 1
+ endif
+ endif
+ if (iturb(iphas).eq.60.and.ikecou(iphas).eq.1) then
+ if(( thetst(iphas) .gt.0.d0 ).or. &
+ ( isto2t(iphas) .gt.0 ).or. &
+ (abs(thetav(ik (iphas))-1.0d0).gt.epzero).or. &
+ (abs(thetav(iomg(iphas))-1.0d0).gt.epzero) ) then
+ write(nfecra,2144)iphas,iturb(iphas),ikecou(iphas), &
+ thetst(iphas),isto2t(iphas), &
+ thetav(ik (iphas)),thetav(iomg(iphas))
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+! A priori, pour le moment, l'ordre 2 en temps
+! (rho, visc, cp, termes sources N.S., Turb., Scal., theta)
+! est incompatible avec les physiques particulieres
+! Ici on s'arrete si on n'est pas dans le cas du schema std
+
+if(ippmod(iphpar).ge.1) then
+ istop = 0
+ do ivar = 1, nvar
+ if( (abs(thetav(ivar)-1.0d0).gt.1.d-3) ) istop = 1
+ enddo
+ do iphas = 1, nphas
+ if(( thetsn(iphas) .gt.0.d0 ).or. &
+ ( isno2t(iphas) .gt.0 ).or. &
+ ( thetro(iphas) .gt.0.d0 ).or. &
+ ( iroext(iphas) .gt.0 ).or. &
+ ( thetvi(iphas) .gt.0.d0 ).or. &
+ ( iviext(iphas) .gt.0 ).or. &
+ ( thetcp(iphas) .gt.0.d0 ).or. &
+ ( icpext(iphas) .gt.0 ) ) istop = 1
+ enddo
+ do iscal = 1, nscal
+ if(( thetss(iscal) .gt.0.d0 ).or. &
+ ( isso2t(iscal) .gt.0 ).or. &
+ ( thetvs(iphas) .gt.0.d0 ).or. &
+ ( ivsext(iphas) .gt.0 ) ) istop = 1
+ enddo
+
+ if(istop.ne.0) then
+ write(nfecra,2145)
+ iok = iok + 1
+ endif
+endif
+
+! A priori, pour le moment, l'ordre 2 en temps
+! n'est pas pris en compte pour les termes issus du Lagrangien.
+! On pourrait le signaler et continuer : on s'arrete.
+if(iilagr .eq. 2) then
+ do iphas = 1, nphas
+ if(( thetsn(iphas) .gt.0.d0 ).or. &
+ ( isno2t(iphas) .gt.0 ).or. &
+ ( thetst(iphas) .gt.0.d0 ).or. &
+ ( isto2t(iphas) .gt.0 ) ) then
+ write(nfecra,2146)iphas,thetsn(iphas),isno2t(iphas), &
+ thetst(iphas),isto2t(iphas)
+ iok = iok + 1
+ endif
+ enddo
+ do iscal = 1, nscal
+ if (iscsth(iscal).eq.1.or.iscsth(iscal).eq.2) then
+ if(( thetss(iscal) .gt.0.d0 ).or. &
+ ( isso2t(iscal) .gt.0 )) then
+ write(nfecra,2147) &
+ 'lagrangien ',ISCAL,THETSS(ISCAL),ISSO2T(ISCAL),'uslag1'
+ iok = iok + 1
+ endif
+ endif
+ enddo
+endif
+
+! A priori, pour le moment, l'ordre 2 en temps
+! n'est pas pris en compte pour les termes issus du rayonnement.
+! On pourrait le signaler et continuer : on s'arrete.
+if (iirayo.gt.0) then
+ do iphas = 1, nphas
+ do iscal = 1, nscal
+ if (iscal.eq.iscalt(iphas)) then
+ if(( thetss(iscal) .gt.0.d0 ).or. &
+ ( isso2t(iscal) .gt.0 )) then
+ write(nfecra,2147) &
+ 'rayonnement',ISCAL,THETSS(ISCAL),ISSO2T(ISCAL),'usray1'
+ iok = iok + 1
+ endif
+ endif
+ enddo
+ enddo
+endif
+
+! --- Algorithme stationnaire
+if (idtvar.lt.0) then
+ do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if (ii.ge.1) then
+ if (relaxv(ii).gt.1d0.or.relaxv(ii).lt.0d0) then
+ chaine=nomvar(ipp)
+ write(nfecra,2148) chaine(1:8),relaxv(ii)
+ iok = iok + 1
+ endif
+ endif
+ enddo
+ do iphas = 1, nphas
+ if((relaxv(iv(iphas)).ne.relaxv(iu(iphas))) &
+ .or.(relaxv(iw(iphas)).ne.relaxv(iu(iphas))) ) then
+ write(nfecra,2149) relaxv(iu(iphas)),relaxv(iv(iphas)), &
+ relaxv(iw(iphas))
+ iok = iok + 1
+ endif
+ enddo
+! L'algorithme stationnaire n'est pas compatible avec le module Lagrangien
+ if (iilagr.ne.0) then
+ write(nfecra,2150) iilagr
+ iok = iok + 1
+ endif
+! L'algorithme stationnaire n'est pas compatible avec la LES
+ do iphas = 1, nphas
+ if (itytur(iphas).eq.4) then
+ write(nfecra,2151) iturb(iphas)
+ iok = iok + 1
+ endif
+ enddo
+endif
+
+! --- Reconstruction des gradients
+if(imrgra.ne.0.and.imrgra.ne.1.and. &
+ imrgra.ne.2.and.imrgra.ne.3.and. &
+ imrgra.ne.4 ) then
+ WRITE(NFECRA,2205) 'IMRGRA',IMRGRA
+ iok = iok + 1
+endif
+
+! On verifie l'angle de non orthogonalite de selection du
+! voisinage etendu dans le cas du moindre carre qui l'utilise
+
+if(imrgra.eq.3) then
+ if(anomax.gt.pi*0.5d0.or.anomax.lt.0.d0) then
+ write(nfecra,2206) anomax, imrgra
+ endif
+endif
+
+! Extrapolation : indetermination possible par mc,
+! necessitant un traitement particulier dans gradmc,
+! pour lequel on fait certaines hypotheses
+if(imrgra.eq.1.or.imrgra.eq.2.or.imrgra.eq.3) then
+ if((nphas.gt.1).or. &
+ ((abs(extrag(ipr(1))-1.d0).gt.epzero).and. &
+ (abs(extrag(ipr(1)) ).gt.epzero) )) then
+ write(nfecra,2207) imrgra, nphas, extrag(ipr(1))
+ iok = iok + 1
+ endif
+endif
+
+! Les nombres de sweeps n'ont pas a etre verifies :
+! ce sont simplement des entiers (negatifs si on veut etre sur de ne
+! *jamais* entrer dans les boucles)
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(imligr(ii).gt.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,2300) chaine(1:8),ii,imligr(ii)
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(ircflu(ii).ne.1.and.ircflu(ii).ne.0) then
+ chaine=nomvar(ipp)
+ write(nfecra,2310) chaine(1:8),ii,ircflu(ii)
+ iok = iok + 1
+ endif
+ endif
+enddo
+! Non reconstruction des flux en SOLU n'a pas de sens pour la convection
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(ircflu(ii).eq.0.and.ischcv(ii).eq.0.and. &
+ blencv(ii).ne.0.d0) then
+ chaine=nomvar(ipp)
+ write(nfecra,2311) chaine(1:8),ii,ircflu(ii),ii,ischcv(ii)
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+! Il n'y a pas besoin de test sur les epsilons
+! Ce sont simplement des reels
+! Une valeur negative indique qu'on veut atteindre
+! le nombre d'iterations maximal
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(climgr(ii).lt.1.d0) then
+ chaine=nomvar(ipp)
+ write(nfecra,2320) chaine(1:8),ii,climgr(ii)
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+
+! EXTRAG non nul permis uniquement pour la pression.
+! et dans ce cas egal a 1
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(abs(extrag(ii) ).ge.epzero) then
+ iokpre = 0
+ do iphas = 1, nphas
+ if (ii.eq.ipr(iphas)) then
+ iokpre = 1
+ if(abs(extrag(ii)-1.d0).ge.epzero) then
+ chaine=nomvar(ipp)
+ write(nfecra,2330) chaine(1:8),ii,extrag(ii)
+ iok = iok + 1
+ endif
+ endif
+ enddo
+ if(iokpre.eq.0) then
+ chaine=nomvar(ipp)
+ write(nfecra,2331) chaine(1:8),ii,extrag(ii)
+ iok = iok + 1
+ endif
+ endif
+ endif
+enddo
+
+
+! --- Solveurs iteratifs
+
+! Il n'y a pas besoin de test sur les epsilons
+! Ce sont simplement des reels
+! Une valeur negative indique qu'on veut atteindre
+! le nombre d'iterations maximal
+! Il n'y a pas besoin de test sur le nombre d'iterations
+! Ce sont simplement des entiers
+! Une valeur negative indique au'on veut sortir de suite
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(iresol(ii).ne.-1) then
+ iresop = mod(iresol(ii),1000)
+ ipolop = (iresol(ii)-iresop)/1000
+ if ((iresop.ne.0.and. &
+ iresop.ne.1.and.iresop.ne.2).or. &
+ (iresop.eq.1.and.ipolop.ne.0)) then
+ chaine=nomvar(ipp)
+ write(nfecra,2400) chaine(1:8),ii,iresol(ii)
+ iok = iok + 1
+ endif
+ endif
+ if (idircl(ii).ne.0.and.idircl(ii).ne.1) then
+ chaine=nomvar(ipp)
+ write(nfecra,2401) chaine(1:8),ii,idircl(ii)
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if ((iresol(ii).eq.0.and.iconv(ii).eq.1).or. &
+ (iresol(ii).eq.1.and.iconv(ii).eq.0)) then
+ chaine=nomvar(ipp)
+ write(nfecra,2410) chaine(1:8),ii,iresol(ii),iconv(ii)
+ endif
+ endif
+enddo
+
+! --- Le multigrille sera verifie d'un seul bloc plus bas.
+
+
+! --- Suite de calcul
+
+if(isuite.ne.0.and.isuite.ne.1) then
+ WRITE(NFECRA,2200) 'ISUITE',ISUITE
+ iok = iok + 1
+endif
+if(ileaux.ne.0.and.ileaux.ne.1) then
+ WRITE(NFECRA,2200) 'ILEAUX',ILEAUX
+ iok = iok + 1
+endif
+if(iecaux.ne.0.and.iecaux.ne.1) then
+ WRITE(NFECRA,2200) 'IECAUX',IECAUX
+ iok = iok + 1
+endif
+! En LES, on previent que ce n'est pas malin de ne pas relire le fichier
+! auxiliaire
+if(iecaux.eq.0.or.ileaux.eq.0) then
+ do iphas = 1, nphas
+ if(itytur(iphas).eq.4) then
+ write(nfecra,2420) iphas,iturb(iphas),ileaux,iecaux
+ endif
+ enddo
+endif
+
+! --- Reperage du temps et marche en temps
+
+! Le nombre de pas de temps pourrait bien etre negatif : pas de test.
+
+if(inpdt0.ne.0.and.inpdt0.ne.1) then
+ WRITE(NFECRA,2200) 'INPDT0',INPDT0
+ iok = iok + 1
+endif
+
+if(idtvar.lt.-1.or.idtvar.gt.2) then
+ WRITE(NFECRA,2500) 'IDTVAR',IDTVAR
+ iok = iok + 1
+endif
+
+if(idtvar.gt.0.and.varrdt.lt.0.d0) then
+ WRITE(NFECRA,2510)'VARRDT', VARRDT
+ iok = iok + 1
+endif
+
+if(dtref .lt.0.d0) then
+ WRITE(NFECRA,2510)'DTREF ', DTREF
+ iok = iok + 1
+endif
+
+if(dtmin.le.0.d0 .or. dtmax.le.0.d0 .or. &
+ dtmin.gt.dtmax ) then
+ write(nfecra,2520) dtmin, dtmax
+ if(idtvar.gt.0) then
+ iok = iok + 1
+ endif
+endif
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(cdtvar(ii).le.0.d0) then
+ chaine=nomvar(ipp)
+ write(nfecra,2530) chaine(1:8),ii,cdtvar(ii)
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+if(iptlro.ne.0.and.iptlro.ne.1) then
+ WRITE(NFECRA,2200) 'IPTLRO',IPTLRO
+ iok = iok + 1
+endif
+
+! Si on est en pas de temps constant, on ne touche pas le pas de temps,
+! mais on indique juste les depassements de critere local.
+if(idtvar.eq.0.and.iptlro.eq.1) then
+ write(nfecra,2540) iptlro,idtvar
+endif
+if(idtvar.eq.-1.and.iptlro.eq.1) then
+ write(nfecra,2541) iptlro,idtvar
+endif
+
+! --- Turbulence
+
+! Modele
+
+do iphas = 1, nphas
+ itrbph = iturb(iphas)
+ if ( itrbph.ne. 0.and.itrbph.ne.10.and.itrbph.ne.20.and. &
+ itrbph.ne.21.and.itrbph.ne.30.and.itrbph.ne.31.and. &
+ itrbph.ne.40.and.itrbph.ne.41.and.itrbph.ne.42.and. &
+ itrbph.ne.50.and.itrbph.ne.60) then
+ WRITE(NFECRA,2600) IPHAS,'ITURB ',ITRBPH
+ iok = iok + 1
+ endif
+enddo
+
+! Methode des vortex pour la LES
+
+if (ivrtex.ne.0 .and.ivrtex.ne.1) then
+ WRITE(NFECRA,2200) 'IVRTEX ',IVRTEX
+ iok = iok + 1
+endif
+! On impose qu'il n'y ait qu'une seule phase
+if (ivrtex.eq.1 .and. nphas.gt.1) then
+ write(nfecra,2605)nphas,ivrtex
+ iok = iok + 1
+endif
+iphas = 1
+if(ivrtex.eq.1.and.itytur(iphas).ne.4) then
+ write(nfecra,2606)itytur(iphas),ivrtex
+ ivrtex = 0
+endif
+
+! Nb de variables
+
+if(nscal.ge.1) then
+ do iphas = 1, nphas
+ if(iscalt(iphas).gt.nscal) then
+ write(nfecra,2610)iphas, &
+ 'NUMERO DU SCALAIRE TEMPERATURE ',ISCALT(IPHAS), &
+ 'NOMBRE DE SCALAIRES ',NSCAL
+ iok = iok + 1
+ endif
+ if( (nvar.lt. 4+nscal ) .or. &
+ (nvar.lt. 6+nscal.and.itytur(iphas).eq.2).or. &
+ (nvar.lt.11+nscal.and.itytur(iphas).eq.3).or. &
+ (nvar.lt. 8+nscal.and.iturb(iphas).eq.50).or. &
+ (nvar.lt. 6+nscal.and.iturb(iphas).eq.60) ) then
+ write(nfecra,2610)iphas, &
+ 'NOMBRE DE VARIABLES ',NVAR, &
+ 'NOMBRE DE SCALAIRES ',NSCAL
+ iok = iok + 1
+ endif
+ enddo
+endif
+
+do iphas = 1, nphas
+
+ if(ideuch(iphas).lt.0.or.ideuch(iphas).gt.2) then
+ WRITE(NFECRA,2211)IPHAS, 'IDEUCH',IDEUCH(IPHAS)
+ iok = iok + 1
+ endif
+ if (ideuch(iphas).ne.0 .and. &
+ (iturb(iphas).eq.0 .or. iturb(iphas).eq.10 .or. &
+ itytur(iphas).eq.4) ) then
+ write(nfecra,2209)iphas,iturb(iphas),ideuch(iphas)
+ iok = iok + 1
+ endif
+ if(ilogpo(iphas).ne.0.and.ilogpo(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'ILOGPO',ILOGPO(IPHAS)
+ iok = iok + 1
+ endif
+
+! Specifique k-epsilon, v2f et k-omega
+
+ if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ if( (nvar.le.5.and.itytur(iphas).eq.2) .or. &
+ (nvar.le.7.and.iturb(iphas).eq.50) .or. &
+ (nvar.le.5.and.iturb(iphas).eq.60) ) then
+ write(nfecra,2610)iphas, &
+ 'NOMBRE DE VARIABLES ',NVAR, &
+ 'OPTION POUR LA TURBULENCE ',ITURB(IPHAS)
+ iok = iok + 1
+ endif
+! Le choix de ICLKEP n'est possible qu'en k-eps ou v2f
+ if (iturb(iphas).ne.60) then
+ if(iclkep(iphas).ne.0.and.iclkep(iphas).ne.1) then
+ WRITE(NFECRA,2201) IPHAS,'ICLKEP',ICLKEP(IPHAS)
+ iok = iok + 1
+ endif
+ endif
+ if(ikecou(iphas).ne.0.and.ikecou(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IKECOU',IKECOU(IPHAS)
+ iok = iok + 1
+ endif
+! En k-eps a prod lin et en v2f on force IKECOU a 0
+ if (ikecou(iphas).eq.1 .and. &
+ (iturb(iphas).eq.21 .or. iturb(iphas).eq.50)) then
+ write(nfecra,2208)iphas,iturb(iphas),ikecou(iphas)
+ iok = iok + 1
+ endif
+! En stationnaire on force IKECOU a 0
+ if (ikecou(iphas).ne.0.and.idtvar.lt.0) then
+ write(nfecra,2210)iphas,ikecou(iphas)
+ iok = iok + 1
+ endif
+
+ if(igrhok(iphas).ne.0.and.igrhok(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IGRHOK',IGRHOK(IPHAS)
+ iok = iok + 1
+ endif
+ if(igrake(iphas).ne.0.and.igrake(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IGRAKE',IGRAKE(IPHAS)
+ iok = iok + 1
+ endif
+! IF( IGRAKE.EQ.1.AND.(GX**2+GY**2+GZ**2).LE.EPZERO**2 ) THEN
+! WRITE(NFECRA,2620)'IGRAKE',IGRAKE,GX,GY,GZ
+! IOK = IOK + 1
+! ENDIF
+ if(nscal.gt.0) then
+ if(iscalt(iphas).le.0.and. &
+ (gx**2+gy**2+gz**2).ge.epzero**2) then
+ write(nfecra,2621) iphas,gx,gy,gz,iscalt(iphas)
+ if(igrake(iphas).eq.1) then
+ WRITE(NFECRA,2622)IPHAS, 'IGRAKE',IGRAKE(IPHAS)
+ endif
+!MO IOK = IOK + 1
+ endif
+ endif
+
+! Si RELAXV(IK) a ete modifie par l'utilisateur mais que IKECOU n'est
+! pas egal a 0, on previent que ce sera sans effet
+! Sinon on verifie que RELAXV(IK) est bien compris entre 0 et 1
+! (en stationnaire cela a deja ete fait plus haut)
+ ikiph = ik(iphas)
+ if (itytur(iphas).eq.6) then
+ ieiph = iomg(iphas)
+ else
+ ieiph = iep(iphas)
+ endif
+ if ( (abs(relaxv(ikiph)+999.d0).gt.epzero .or. &
+ abs(relaxv(ieiph)+999.d0).gt.epzero ) .and. &
+ ikecou(iphas).ne.0) write(nfecra,2623) iphas, &
+ relaxv(ikiph),relaxv(ieiph)
+ if (ikecou(iphas).eq.0 .and. idtvar.ge.0) then
+ if(relaxv(ikiph).gt.1.d0.or.relaxv(ikiph).lt.0.d0 .or. &
+ relaxv(ieiph).gt.1.d0.or.relaxv(ieiph).lt.0.d0) then
+ write(nfecra,2624) iphas,relaxv(ikiph),relaxv(ieiph)
+ iok = iok + 1
+ endif
+ endif
+
+ endif
+
+! Specifique Rij-epsilon
+
+ if(itytur(iphas).eq.3) then
+ if(nvar.le.10) then
+ write(nfecra,2610)iphas, &
+ 'NOMBRE DE VARIABLES ',NVAR, &
+ 'OPTION POUR LA TURBULENCE ',ITURB(IPHAS)
+ iok = iok + 1
+ endif
+ if(irijnu(iphas).ne.0.and.irijnu(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS,'IRIJNU',IRIJNU(IPHAS)
+ iok = iok + 1
+ endif
+ if(irijrb(iphas).ne.0.and.irijrb(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IRIJRB',IRIJRB(IPHAS)
+ iok = iok + 1
+ endif
+ if (iturb(iphas).eq.30) then
+! echo de paroi et implicitation speciale de la diffusion de epsilon
+! seulement en Rij standard
+ if(irijec(iphas).ne.0.and.irijec(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IRIJEC',IRIJEC(IPHAS)
+ iok = iok + 1
+ endif
+ if(idifre(iphas).ne.0.and.idifre(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IDIFRE',IDIFRE(IPHAS)
+ iok = iok + 1
+ endif
+ endif
+ if(igrari(iphas).ne.0.and.igrari(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'IGRARI',IGRARI(IPHAS)
+ iok = iok + 1
+ endif
+! IF( IGRARI.EQ.1.AND.(GX**2+GY**2+GZ**2).LE.EPZERO**2 ) THEN
+! WRITE(NFECRA,2620)'IGRARI',IGRARI,GX,GY,GZ
+! IOK = IOK + 1
+! ENDIF
+ if(iclsyr(iphas).ne.0.and.iclsyr(iphas).ne.1) then
+ WRITE(NFECRA,2201) IPHAS,'ICLSYR',ICLSYR(IPHAS)
+ iok = iok + 1
+ endif
+ if(iclptr(iphas).ne.0.and.iclptr(iphas).ne.1) then
+ WRITE(NFECRA,2201)IPHAS, 'ICLPTR',ICLPTR(IPHAS)
+ iok = iok + 1
+ endif
+ if(nscal.gt.0) then
+ if(iscalt(iphas).le.0.and. &
+ (gx**2+gy**2+gz**2).ge.epzero**2) then
+ write(nfecra,2621)iphas,gx,gy,gz,iscalt(iphas)
+ if(igrari(iphas).eq.1) then
+ WRITE(NFECRA,2622)IPHAS, 'IGRARI',IGRARI(IPHAS)
+ endif
+!MO IOK = IOK + 1
+ endif
+ endif
+ endif
+
+! Specifique LES
+
+ if(itytur(iphas).eq.4) then
+ if(idries(iphas).ne.1.and.idries(iphas).ne.0) then
+ WRITE(NFECRA,2201) IPHAS,'IDRIES',IDRIES(IPHAS)
+ iok = iok + 1
+ endif
+ if(idries(iphas).ne.0.and.(iturb(iphas).eq.41.or.iturb(iphas).eq.42)) then
+ write(nfecra,2630) iphas,idries(iphas),iturb(iphas)
+ iok = iok + 1
+ endif
+! La reduction du voisinage etendu peut degrader
+! les resultats du modele dynamique en LES
+ if(iturb(iphas).eq.41.and.imrgra.eq.3) then
+ write(nfecra,2607) iphas, iturb(iphas), imrgra
+ endif
+ endif
+
+enddo
+
+! --- Stokes
+
+
+if(iprco .ne.0.and.iprco .ne.1) then
+ WRITE(NFECRA,2200) 'IPRCO ',IPRCO
+ iok = iok + 1
+endif
+if(iprco.eq.1) then
+ do iphas = 1, nphas
+ if(irevmc(iphas).ne.0.and.irevmc(iphas).ne.1.and. &
+ irevmc(iphas).ne.2) then
+ WRITE(NFECRA,2211) IPHAS,'IREVMC',IREVMC(IPHAS)
+ iok = iok + 1
+ endif
+ arakfr = arak(iphas)
+ if (idtvar.lt.0) arakfr=arakfr*relaxv(iu(iphas))
+ if(arakfr.gt.1.d0 .or. arakfr.lt.0.d0) then
+ WRITE(NFECRA,2640) IPHAS,'ARAK ',ARAKFR
+ iok = iok + 1
+ endif
+ if( relaxv(ipr(iphas)).gt.1d0 .or. &
+ relaxv(ipr(iphas)).lt.0d0 ) then
+ write(nfecra,2625) iphas,relaxv(ipr(iphas))
+ iok = iok + 1
+ endif
+ enddo
+endif
+
+! --- Couplage U-P
+
+if (ipucou.ne.0.and.ipucou.ne.1) then
+ WRITE(NFECRA,2200) 'IPUCOU ',IPUCOU
+ iok = iok + 1
+endif
+
+! Incompatibilite pour le moment des matrices poids avec un theta schema
+! Si theta n'est pas egal a 1 pour la vitesse (incompatibilite du
+! pas de temps variable aussi)
+
+do iphas = 1, nphas
+ jj = iu(iphas)
+ if((abs(thetav(jj)-1.0d0).gt.epzero).and. &
+ ((idtvar.ne.0).or.(ipucou.eq.1))) then
+ write(nfecra,2204) thetav(jj),idtvar,ipucou
+ endif
+enddo
+
+! --- Prise en compte de la pression hydrostatique
+
+! IPHYDR et ICALHY sont testes dans varpos
+! (valeur 0 ou 1)
+
+if (iphydr.eq.1.and.nphas.gt.1) then
+ write(nfecra,2202) iphydr,nphas
+ iok = iok +1
+endif
+
+! --- Champ de vitesse fige
+
+if (iccvfg.ne.0.and.iccvfg.ne.1) then
+ WRITE(NFECRA,2200) 'ICCVFG ',ICCVFG
+ iok = iok + 1
+endif
+
+! --- Interpolation face des viscosites
+
+if(imvisf.ne.0.and.imvisf.ne.1) then
+ WRITE(NFECRA,2200) 'IMVISF',IMVISF
+ iok = iok + 1
+endif
+
+! --- Traitement de la temperature pour couplage SYRTHES
+! Verification du nombre de couplages
+
+if(itbrrb.ne.0 .and. itbrrb.ne.1 ) then
+ WRITE(NFECRA,2200) 'ITBRRB',ITBRRB
+ iok = iok + 1
+endif
+
+! On regarde si ICPSYR a des valeurs realistes
+if(nscal.gt.0) then
+ do iscal = 1, nscal
+ if(icpsyr(iscal).ne.0.and.icpsyr(iscal).ne.1) then
+ chaine=nomvar(ipprtp(isca(iscal)))
+ WRITE(NFECRA,2650)CHAINE(1:8),'ICPSYR',ISCAL,ICPSYR(ISCAL)
+ iok = iok + 1
+ endif
+ enddo
+endif
+
+! On compte le nombre de scalaires couples
+nbsccp = 0
+if(nscal.gt.0) then
+ do iscal = 1, nscal
+ nbsccp = nbsccp+icpsyr(iscal)
+ enddo
+endif
+
+! On regarde s'il y a du couplage
+
+call nbcsyr (nbccou)
+!==========
+
+! S'il n'y a pas de couplage
+if(nbccou.eq.0) then
+
+! et qu'il n'y a pas zero scalaire couple, on s'arrete
+ if(nbsccp.ne.0) then
+ write(nfecra,2660)nbsccp,nscal
+ iok = iok + 1
+ endif
+
+! Sinon, s'il y a du couplage
+else
+
+! et qu'il n'y a pas un et un seul scalaire couple, on s'arrete
+ if(nbsccp.ne.1) then
+ write(nfecra,2661)nscal,nbsccp
+ iok = iok + 1
+ endif
+
+! que le scalaire couple n'est pas la temperature, on s'arrete
+! attention : tout est pret, mais il n'y a pas eu de valid.
+! en outre, ca permet de bien verifier que l'utilisateur
+! ne s'est pas trompe dans 99% des cas d'utilisation
+! (en compressible, on couple l'energie)
+ do iscal = 1, nscal
+ if(icpsyr(iscal).eq.1) then
+ if(ippmod(icompf).lt.0) then
+ if(abs(iscsth(iscal)).ne.1) then
+ write(nfecra,2662)iscal,iscsth(iscal)
+ iok = iok + 1
+ endif
+ else
+ if(iscsth(iscal).ne.3) then
+ write(nfecra,2663)iscal,iscal,iscsth(iscal)
+ iok = iok + 1
+ endif
+ endif
+ endif
+ enddo
+
+endif
+
+
+! --- Estimateurs d'erreur pour Navier-Stokes
+
+do iphas = 1, nphas
+ do iest = 1, nestmx
+ iiesca = iescal(iest,iphas)
+ if (iiesca.ne.0.and.iiesca.ne.1.and.iiesca.ne.2) then
+ write(nfecra,2664) iphas,iest,iest,iphas,iiesca, &
+ iespre,iesder,iescor,iestot
+ iok = iok + 1
+ endif
+ enddo
+enddo
+
+
+! --- Distance a la paroi
+
+if(ineedy.eq.1) then
+
+ if(abs(icdpar).ne.1.and.abs(icdpar).ne.2) then
+ write(nfecra,2700) icdpar
+ iok = iok + 1
+ endif
+ if(nitmay.lt.1) then
+ WRITE(NFECRA,3100) 'NITMAY',NITMAY
+ iok = iok + 1
+ endif
+ if(imligy.gt.1) then
+ WRITE(NFECRA,2750) 'IMLIGY',IMLIGY
+ iok = iok + 1
+ endif
+ if(ircfly.ne.1.and.ircfly.ne.0) then
+ WRITE(NFECRA,2200) 'IRCFLY',IRCFLY
+ iok = iok + 1
+ endif
+ if(ischcy.ne.1.and.ischcy.ne.0) then
+ WRITE(NFECRA,2200) 'ISCHCY',ISCHCY
+ iok = iok + 1
+ endif
+ if(isstpy.ne.1.and.isstpy.ne.0) then
+ WRITE(NFECRA,2200) 'ISSTPY',ISSTPY
+ iok = iok + 1
+ endif
+ if(imgrpy.ne.1.and.imgrpy.ne.0) then
+ WRITE(NFECRA,2200) 'IMGRPY',IMGRPY
+ iok = iok + 1
+ endif
+ if(ntcmxy.lt.1) then
+ WRITE(NFECRA,3100) 'NTCMXY',NTCMXY
+ iok = iok + 1
+ endif
+
+ if(blency.gt.1.d0.or.blency.lt.0.d0) then
+ WRITE(NFECRA,2710) 'BLENCY',BLENCY
+ iok = iok + 1
+ endif
+ if(climgy.lt.1.d0) then
+ WRITE(NFECRA,2720) 'CLIMGY',CLIMGY
+ iok = iok + 1
+ endif
+ if(abs(extray-1.d0).gt.epzero.and.abs(extray).gt.epzero) then
+ WRITE(NFECRA,2730) 'EXTRAY',EXTRAY
+ iok = iok + 1
+ endif
+ if(coumxy.le.0.d0) then
+ WRITE(NFECRA,2740) 'COUMXY',COUMXY
+ iok = iok + 1
+ endif
+ if(yplmxy.le.0.d0) then
+ WRITE(NFECRA,2740) 'YPLMXY',YPLMXY
+ iok = iok + 1
+ endif
+
+endif
+
+
+!===============================================================================
+! 2. MULTIGRILLE : TABLEAUX DU MULTIGRILLE : formats 3000
+!===============================================================================
+
+! --- Options generales
+
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(imgr(ii).ne.0.and.imgr(ii).ne.1) then
+ chaine=nomvar(ipp)
+ WRITE(NFECRA,3000) CHAINE(1:8),'IMGR ',II,IMGR(II)
+ iok = iok + 1
+ endif
+ do iphas = 1, nphas
+ if(imgr(ii).eq.1.and.iconv(ii).eq.1) then
+ write(nfecra,3001)
+ iok = iok + 1
+ endif
+ enddo
+ if(imgr(ii).eq.1) then
+ if(ncymax(ii).le.0) then
+ WRITE(NFECRA,3010) CHAINE(1:8),'NCYMAX',II,NCYMAX(II)
+ iok = iok + 1
+ endif
+ if(nitmgf(ii).le.0) then
+ WRITE(NFECRA,3010) CHAINE(1:8),'NITMGF',II,NITMGF(II)
+ iok = iok + 1
+ endif
+ endif
+ endif
+enddo
+imgrok = 0
+do ipp = 2, nvppmx
+ ii = itrsvr(ipp)
+ if(ii.ge.1) then
+ if(imgr(ii).eq.1) then
+ imgrok = 1
+ endif
+ endif
+enddo
+
+! --- Options specifiques de niveau plus eleve
+
+if(imgrok.eq.1.and.ncegrm.le.0)then
+ WRITE(NFECRA,3100)'NCEGRM',NCEGRM
+ iok = iok + 1
+endif
+if(imgrok.eq.1.and.ngrmax.le.0)then
+ WRITE(NFECRA,3100)'NGRMAX',NGRMAX
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 3. TABLEAUX DE cstphy.h : formats 4000
+!===============================================================================
+
+do iphas = 1, nphas
+
+! --- Constantes physiques de chaque phase
+
+ if(ro0(iphas) .lt.0d0) then
+ WRITE(NFECRA,2511)IPHAS,'RO0 ', RO0(IPHAS)
+ iok = iok + 1
+ endif
+ if(viscl0(iphas).lt.0d0) then
+ WRITE(NFECRA,2511)IPHAS,'VISCL0', VISCL0(IPHAS)
+ iok = iok + 1
+ endif
+
+! --- Turbulence
+
+! On a besoin de UREF si on initialise la turbulence (debut de calcul
+! en turbulence ou suite laminaire->turbulent)
+! Ici on met juste un avertissement, car sans UREF l'utilisateur peut
+! initialiser la turbulence a la main. Un test complementaire sera fait
+! dans inivar.
+ if(itytur(iphas).eq.2.or.itytur(iphas).eq.3 &
+ .or.iturb(iphas).eq.50.or.iturb(iphas).eq.60) then
+ if(uref(iphas) .lt.0.d0) then
+ write(nfecra,4100)iphas, uref(iphas)
+ endif
+ endif
+
+ if(iturb(iphas).eq.10) then
+ if(xlomlg(iphas).le.0.d0) then
+ WRITE(NFECRA,2511)IPHAS,'XLOMLG', XLOMLG(IPHAS)
+ iok = iok + 1
+ endif
+ endif
+
+! LES
+ if(itytur(iphas).eq.4) then
+ if(xlesfl(iphas).lt.0.d0) then
+ WRITE(NFECRA,2511) IPHAS,'XLESFL', XLESFL(IPHAS)
+ iok = iok + 1
+ endif
+ if(ales (iphas).lt.0.d0) then
+ WRITE(NFECRA,2511) IPHAS,'ALES ', ALES(IPHAS)
+ iok = iok + 1
+ endif
+ if(bles (iphas).lt.0.d0) then
+ WRITE(NFECRA,2511) IPHAS,'BLES ', BLES(IPHAS)
+ iok = iok + 1
+ endif
+ if(csmago(iphas).lt.0.d0) then
+ WRITE(NFECRA,2511)IPHAS, 'CSMAGO', CSMAGO(IPHAS)
+ iok = iok + 1
+ endif
+ if(cwale(iphas).lt.0.d0) then
+ WRITE(NFECRA,2511)IPHAS, 'CWALE', CWALE(IPHAS)
+ iok = iok + 1
+ endif
+ if(idries(iphas).eq.1.and.cdries(iphas).lt.0) then
+ WRITE(NFECRA,2511) IPHAS,'CDRIES', CDRIES(IPHAS)
+ iok = iok + 1
+ endif
+ if(iturb(iphas).eq.41) then
+ if(xlesfd(iphas).lt.0.d0) then
+ WRITE(NFECRA,2511) IPHAS,'XLESFD', XLESFD(IPHAS)
+ iok = iok + 1
+ endif
+ if(smagmx(iphas).lt.0.d0) then
+ WRITE(NFECRA,2511) IPHAS,'SMAGMX', SMAGMX(IPHAS)
+ iok = iok + 1
+ endif
+ endif
+ endif
+
+enddo
+
+! --- Scalaires
+
+if(nscal.gt.0) then
+
+! Scalaire passif, temperature, enthalpie, energie
+ do ii = 1, nscal
+ if (iscsth(ii).lt.-1.or.iscsth(ii).gt.3) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4300)chaine(1:8),ii,iscsth(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! Phase porteuse
+ do ii = 1, nscal
+ if (iphsca(ii).gt.nphas.or.iphsca(ii).lt.1) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4310)chaine(1:8),ii,nphas,iphsca(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! Scalaire associe dans le cas des variances
+ do ii = 1, nscal
+ if (iscavr(ii).gt.nscal.or.iscavr(ii).lt.0) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4320)chaine(1:8),ii,nscal,iscavr(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! On verifie que le scalaire associe a une fluctuation n'est
+! pas une fluctuation
+ do ii = 1, nscal
+ if (iscavr(ii).gt.0) then
+ if (iscavr(iscavr(ii)).gt.0) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ chain2=nomvar(ipprtp(isca(iscavr(ii))))
+ write(nfecra,4321)chaine(1:8),chain2(1:8),ii,iscavr(ii), &
+ iscavr(ii),iscavr(iscavr(ii))
+ iok = iok + 1
+ endif
+ endif
+ enddo
+
+! Mode de clipping dans le cas des variances
+! pour les scalaires non variance, on n'utilise pas ICLVFL.
+! On demande donc a l'utilisateur de ne pas y toucher
+! (ca permet d'etre sur qu'il sait ce qu'il fait)
+ do ii = 1, nscal
+ if (iscavr(ii).le.nscal.and.iscavr(ii).gt.0) then
+ if(iclvfl(ii).ne.0.and. &
+ iclvfl(ii).ne.1.and.iclvfl(ii).ne.2) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4330)chaine(1:8),ii,iclvfl(ii)
+ iok = iok + 1
+ endif
+ elseif (iscavr(ii).eq.0) then
+ if(iclvfl(ii).ne.-1) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4331)chaine(1:8),ii,iclvfl(ii)
+ iok = iok + 1
+ endif
+ endif
+ enddo
+
+! Valeur de la diffusivite positive (si cste)
+! si pas cste, on verifiera apres usphyv
+ do ii = 1, nscal
+ if (ivisls(ii).le.0.and.visls0(ii).lt.0d0) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4340)chaine(1:8),ii,ii,ivisls(ii),visls0(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! Valeur du sigma positif
+ do ii = 1, nscal
+ if (sigmas(ii).le.0d0) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4350)chaine(1:8),ii,sigmas(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! Si on n'utilise pas la borne inf de clipping, on demande
+! a l'utilisateur de ne pas y toucher (ca permet d'etre sur
+! qu'il sait ce qu'il fait)
+ do ii = 1, nscal
+ if(iscavr(ii).gt.0.and.iscavr(ii).le.nscal.and. &
+ iclvfl(ii).ne.2.and.scamin(ii).ne.-grand) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4360)chaine(1:8),ii,scamin(ii),ii,iclvfl(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! Si on n'utilise pas la borne sup de clipping, on demande
+! a l'utilisateur de ne pas y toucher (ca permet d'etre sur
+! qu'il sait ce qu'il fait)
+ do ii = 1, nscal
+ if(iscavr(ii).gt.0.and.iscavr(ii).le.nscal.and. &
+ iclvfl(ii).ne.2.and.scamax(ii).ne.grand) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4361)chaine(1:8),ii,scamax(ii),ii,iclvfl(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! Valeur de la borne sup de clipping si on l'utilise
+ do ii = 1, nscal
+ if(iscavr(ii).gt.0.and.iscavr(ii).le.nscal.and. &
+ iclvfl(ii).eq.2.and.scamax(ii).le.0.d0) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4370)chaine(1:8),ii,scamax(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! Warning sur Rvarfl < 0
+ do ii = 1, nscal
+ if(iscavr(ii).gt.0.and.iscavr(ii).le.nscal.and. &
+ rvarfl(ii).le.0.d0) then
+ chaine=nomvar(ipprtp(isca(ii)))
+ write(nfecra,4380)chaine(1:8),ii,rvarfl(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+
+! Rien a verifier sur SCAMIN SCAMAX
+
+! Si CP0 est utilise (resolution d'un scalaire en temperature
+! et CP constant), il doit etre positif
+ do iphas = 1, nphas
+ if(icp(iphas).eq.0) then
+ if (cp0(iphas).lt.0.d0) then
+ iisct = 0
+ do iis = 1, nscal
+ if (iphsca(iis).eq.iphas.and. &
+ abs(iscsth(iis)).eq.1) then
+ iisct = 1
+ endif
+ enddo
+ if (iisct.eq.1) then
+ WRITE(NFECRA,2511)IPHAS,'CP0 ',CP0(IPHAS)
+ iok = iok + 1
+ endif
+ endif
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 4. TABLEAUX DE period.h : formats 5000
+!===============================================================================
+
+! --- periodicite de rotation incompatible avec couplage
+! renforce vitesse pression et l'ALE
+if(iperot.gt.0.and. (ipucou.ne.0.or.iale.ne.0)) then
+ write(nfecra,5003)iperio,ipucou,iale
+ iok = iok + 1
+endif
+
+! --- periodicite incompatible avec le mode de calcul
+! direct de la distance a la paroi
+if(iperio.eq.1.and.ineedy.eq.1.and.abs(icdpar).eq.2) then
+ write(nfecra,5005)iperio, icdpar
+ iok = iok + 1
+endif
+
+
+! --- periodicite de rotation incompatible avec le rayonnement DOM
+!if(iperio.gt.0.and.iirayo.gt.0) then ! de translation aussi ?
+if(iperot.gt.0.and.iirayo.gt.0) then
+ if(iirayo.eq.1) then
+ write(nfecra,5008) iperio , irapha, iirayo
+ iok = iok + 1
+ endif
+endif
+
+! --- periodicite de rotation douteuse avec rij
+! (et donc a fortiori avec ordre 2 sur Rij)
+if(iperot.gt.0) then
+ do iphas = 1, nphas
+ if(itytur(iphas).eq.3) then
+ write(nfecra,5009)iperio,iturb(iphas),iphas
+! IOK = IOK + 1
+ endif
+ enddo
+endif
+
+! --- periodicite de rotation douteuse avec ordre 2 vitesse
+if(iperot.gt.0) then
+ do iphas = 1, nphas
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+ if( (abs(thetav(iuiph)-0.5d0).lt.1.d-3).or. &
+ (abs(thetav(iviph)-0.5d0).lt.1.d-3).or. &
+ (abs(thetav(iwiph)-0.5d0).lt.1.d-3)) then
+ write(nfecra,5010)iperio,iphas, &
+ thetav(iuiph),thetav(iviph),thetav(iwiph)
+! IOK = IOK + 1
+ endif
+ enddo
+endif
+
+
+!===============================================================================
+! 5. TABLEAUX DE parall.h : formats 6000 (limitations)
+!===============================================================================
+
+! --- parallelisme incompatible avec lagrangien
+if(irangp.ge.0.and.iilagr.ne.0) then
+ write(nfecra,6002)irangp,iilagr
+ iok = iok + 1
+endif
+
+! --- parallelisme incompatible avec le mode de calcul
+! direct de la distance a la paroi
+if(irangp.ge.0.and.ineedy.eq.1.and.abs(icdpar).eq.2) then
+ write(nfecra,6005)irangp, icdpar
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 6. METHODE ALE (albase.h, alstru.h) : formats 7000
+!===============================================================================
+
+if (iale.ne.0 .and. iale.ne.1) then
+ write(nfecra,7000)iale
+ iok = iok + 1
+endif
+
+if (iale.eq.1) then
+
+ if (nalinf.lt.0) then
+ write(nfecra,7010)nalinf
+ iok = iok + 1
+ endif
+
+ if (alpnmk.lt.0.d0 .or. alpnmk.gt.1.d0 .or. &
+ gamnmk.lt.0.d0 .or. gamnmk.gt.1.d0 .or. &
+ betnmk.lt.0.d0 .or. betnmk.gt.0.5d0 ) then
+ write(nfecra,7020)alpnmk,betnmk,gamnmk
+ iok = iok + 1
+ endif
+
+ if (nalimx.le.0) then
+ write(nfecra,7030)nalimx
+ iok = iok + 1
+ endif
+ if (epalim.le.0.d0) then
+ write(nfecra,7040)epalim
+ iok = iok + 1
+ endif
+
+ if (italin.ne.-999 .and. italin.ne.0 .and. italin.ne.1) then
+ write(nfecra,7050)italin
+ iok = iok + 1
+ endif
+
+endif
+
+!===============================================================================
+! 7. COMPRESSIBLE : formats 8000
+!===============================================================================
+
+if(ippmod(icompf).ge.0) then
+ do iphas = 1, nphas
+ if(t0(iphas).le.0.d0.or.p0(iphas).le.0.d0) then
+ write(nfecra,8000)iphas,t0(iphas),p0(iphas)
+ iok = iok + 1
+ endif
+ enddo
+endif
+
+!===============================================================================
+! 8. FORMATS VERIFICATION
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NDIM DOIT ETRE UN ENTIER EGAL A 3 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ La dimension de l espace est 3, meme pour les calculs ',/,&
+'@ physiquement bidimensionnels. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ Verifier le fichier maillage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A33, ' DOIT ETRE UN ENTIER ',/,&
+'@ SUPERIEUR OU EGAL A -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A33, ' DOIT ETRE UN ENTIER ',/,&
+'@ STRICTEMENT POSITIF OU EGAL A -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1220 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ICHRVR(',I10 ,') DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ ICHRVR indique si la variable doit etre incluse dans les ',/,&
+'@ fichiers de post-traitement ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1230 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NCAPT DOIT ETRE UN ENTIER INFERIEUR OU EGAL A ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ NCAPT est le nombre de sondes utilisees pour les ',/,&
+'@ historiques. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1240 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IHISVR(',I10 ,',1) DOIT ETRE UN ENTIER EGAL A -1 ',/,&
+'@ POSITIF OU NUL ET INFERIEUR OU EGAL A NCAPT =',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IHISVR(I,1) indique les sondes a utiliser pour la variable',/,&
+'@ I (-1 signifiant que toutes sont utilisees) ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1250 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IHISVR(',I10 ,',',I10 ,') DOIT ETRE UN ENTIER ',/,&
+'@ STRICTEMENT POSITIF ET ',/,&
+'@ INFERIEUR OU EGAL A NCAPT = ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ IHISVR(I,j+1) indique le numero de la jieme sonde a ',/,&
+'@ utiliser pour la variable a post-traiter numero I ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1260 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ILISVR(',I10 ,') DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ ILISVR(I) indique si la variable I sera suivie lors des ',/,&
+'@ impressions dans le listing ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1270 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ITRSVR(',I10 ,') DOIT ETRE UN ENTIER COMPRIS ENTRE ',/,&
+'@ 0 ET NVAR=',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE PARAMETRE ',A6,' DOIT ETRE UN ENTIER MULTIPLE DE ',/,&
+'@ DE CERTAINS DES ENTIERS SUIVANTS : ',/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ IL VAUT ICI ',A6,' = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ Ce parametre precise les variables supplementaires ',/,&
+'@ a post-traiter. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER ',/,&
+'@ STRICTEMENT POSITIF ET INFERIEUR OU EGAL A ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ON DEMANDE UNE EXTRAPOLATION TEMPORELLE DE RHO AVEC ',/,&
+'@ IROEXT(IPHAS) = ',I10 ,/,&
+'@ CECI EST INCOMPATIBLE AVEC RHO CONSTANT ',/,&
+'@ IROVAR(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PARAMETRES DU SCHEMA NUMERIQUE POUR LA VARIABLE ',A8 ,/,&
+'@ ',/,&
+'@ Parametre ISTAT ICONV ',/,&
+'@ Valeurs acceptees 0 ou 1 0 ou 1 ',/,&
+'@ Valeurs entrees ici',I10 ,I10 ,/,&
+'@ ',/,&
+'@ Parametre IDIFF IDIFFT ',/,&
+'@ Valeurs acceptees 0 ou 1 0 ou 1 ',/,&
+'@ Valeurs entrees ici',10X ,I10 ,I10 ,/,&
+'@ ',/,&
+'@ Parametre THETAV BLENCV ISCHCV ISSTPC',/,&
+'@ Valeurs acceptees [0.; 1.] [0.; 1.] 0 ou 1 0 ou 1',/,&
+'@ Valeurs entrees ici ',E14.5 ,E14.5,I10 ,I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2111 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITE POUR LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Schema en temps pour la vitesse phase ',I10 ,/,&
+'@ THETA n''a pas la meme valeur pour les 3 composantes ',/,&
+'@ ',/,&
+'@ Parametre THETAV U V W ',/,&
+'@ Valeurs entrees ici ',E10.2,E10.2,E10.2 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2112 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ DONNEES NON ADMISSIBLES POUR LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ LE PARAMETRE THETAV POUR LA PRESSION DOIT VALOIR 1 ',/,&
+'@ ',/,&
+'@ Pour la phase ', I10,' il vaut ici ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2113 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ DONNEES NON ADMISSIBLES POUR LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ LE PARAMETRE THETFL DU SCHEMA EN TEMPS POUR LE FLUX DE ',/,&
+'@ MASSE EST DIFFERENT DE CELUI DE LA PHASE 1 ',E14.5 ,/,&
+'@ THETFL A ETE IMPOSE ICI A ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2114 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ DONNEES NON ADMISSIBLES POUR LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' ',/,&
+'@ LE PARAMETRE ISTMPF DU SCHEMA EN TEMPS POUR LE FLUX DE ',/,&
+'@ MASSE EST DIFFERENT DE CELUI DE LA PHASE 1 ',I10 ,/,&
+'@ ISTMPF A ETE IMPOSE ICI A ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2121 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ LA VALEUR RECOMMANDEE POUR LE PARAMETRE THETAV DU SCHEMA ',/,&
+'@ EN TEMPS DE LA VARIABLE ',A8 ,' EST 0.5 ',/,&
+'@ THETAV A ETE IMPOSE ICI A ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2122 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ LA VALEUR RECOMMANDEE POUR LE PARAMETRE BLENCV DU SCHEMA ',/,&
+'@ CONVECTIF DE LA VARIABLE ',A8 ,' EST 1.0 ',/,&
+'@ BLENCV A ETE IMPOSE ICI A ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2123 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ LA VALEUR RECOMMANDEE POUR LE PARAMETRE ISSTPC DU SCHEMA ',/,&
+'@ CONVECTIF DE LA VARIABLE ',A8 ,' EST 1 ',/,&
+'@ ISSTPC A ETE IMPOSE ICI A ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2124 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ LA VALEUR RECOMMANDEE POUR LE PARAMETRE ISSTPC DU SCHEMA ',/,&
+'@ CONVECTIF DE LA VARIABLE ',A8 ,' EST 0 ',/,&
+'@ ISSTPC A ETE IMPOSE ICI A ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2125 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' ORDRE 2 EN TEMPS OU LES ',/,&
+'@ LA VALEUR RECOMMANDEE POUR LE PARAMETRE NSWRSM POUR ',/,&
+'@ LA VARIABLE ',A8 ,' EST ',I10 ,/, &
+'@ NSWRSM A ETE IMPOSE ICI A ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2127 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ LA VALEUR RECOMMANDEE POUR LE PARAMETRE BLENCV DU SCHEMA ',/,&
+'@ CONVECTIF DE LA VARIABLE ',A8 ,' EST 1.0 ',/,&
+'@ BLENCV A ETE IMPOSE ICI A ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2131 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,/,&
+'@ LE SCHEMA EN TEMPS POUR LA VITESSE EST D ORDRE 1 ',/,&
+'@ (THETAV = ',E10.2 ,') ',/,&
+'@ CERTAINS TERMES SONT CEPENDANT PRIS A L''ORDRE 2 AVEC ',/,&
+'@ LES CHOIX SUIVANTS : ',/,&
+'@ ',/,&
+'@ Parametres ISTMPF ISNO2T ISTO2T IROEXT IVIEXT ICPEXT ',/,&
+'@ Valeurs entrees ',6I7 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2132 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,/,&
+'@ LE SCHEMA EN TEMPS POUR LA VITESSE EST D ORDRE 2 ',/,&
+'@ (THETAV = ',E10.2 ,') ',/,&
+'@ CERTAINS TERMES SONT CEPENDANT PRIS A L''ORDRE 1 AVEC ',/,&
+'@ LES CHOIX SUIVANTS : ',/,&
+'@ ',/,&
+'@ Parametres ISTMPF ISNO2T ISTO2T IROEXT IVIEXT ICPEXT ',/,&
+'@ Valeurs entrees ',6I7 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2133 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ SCALAIRE ',I10,' ISSO2T = ',I10 ,/,&
+'@ EST DIFFERENT DE ISNO2T DE LA PHASE IPHAS = ',I10 ,/,&
+'@ ISNO2T(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2134 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX NON STANDARD DU SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ SCALAIRE ',I10,' IVSEXT = ',I10 ,/,&
+'@ EST DIFFERENT DE IVIEXT DE LA PHASE IPHAS = ',I10 ,/,&
+'@ IVIEXT(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2135 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX INCOMPATIBLE POUR LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Phase IPHAS = ',I10 ,/,&
+'@ La chaleur massique est extrapolee en temps avec ',/,&
+'@ ICPEXT(IPHAS) = ',I10 ,/,&
+'@ Pour cela, elle doit etre variable, or ',/,&
+'@ ICP(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1 ',/,&
+'@ - desactiver le choix d''extrapolation de Cp en temps ',/,&
+'@ ou ',/,&
+'@ - imposer Cp variable ',/,&
+'@ (et le renseigner alors dans usphyv) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2136 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX INCOMPATIBLE POUR LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Scalaire ISCAL = ',I10 ,/,&
+'@ La diffusivite est extrapolee en temps avec ',/,&
+'@ IVSEXT(ISCAL) = ',I10 ,/,&
+'@ Pour cela, elle doit etre variable, or ',/,&
+'@ IVISLS(ISCAL) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1 ',/,&
+'@ - desactiver le choix d''extrapolation en temps ',/,&
+'@ de la diffusivite ',/,&
+'@ ou ',/,&
+'@ - imposer la diffusivite variable ',/,&
+'@ (et la renseigner alors dans usphyv) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2137 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX INCOMPATIBLE POUR LES ESTIMATEURS D''ERREUR ',/,&
+'@ ',/,&
+'@ On a active un ou plusieurs estimateurs d''erreur pour ',/,&
+'@ Navier-Stokes dans un calcul a champ de vitesse fige. ',/,&
+'@ Le ou les estimateurs ne seront pas calcules. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou ',/,&
+'@ usini1 : ',/,&
+'@ desactiver les estimateurs d erreur ou ',/,&
+'@ le calcul a champ de vitesse fige (ICCVFG) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2140 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,' on souhaite utiliser un schema en',/,&
+'@ temps d''ordre 2 : ',/,&
+'@ U,V,W : THETA = ',3E12.4 ,/,&
+'@ Termes sources Navier-Stokes: ISNO2T = ',I10 ,/,&
+'@ THETSN = ',E12.4 ,/,&
+'@ Masse volumique : IROEXT = ',I10 ,/,&
+'@ THETRO = ',E12.4 ,/,&
+'@ Viscosite : IVIEXT = ',I10 ,/,&
+'@ THETVI = ',E12.4 ,/,&
+'@ La version actuelle ne le permet pas lorsque l''une des ',/,&
+'@ options suivantes a ete activee (c''est le cas ici) : ',/,&
+'@ - utilisation d''un estimateur d''erreur (IESCAL) ',/,&
+'@ - couplage instationnaire (IPUCOU) ',/,&
+'@ - prise en compte specifique de la pression ',/,&
+'@ hydrostatique (IPHYDR et ICALHY) ',/,&
+'@ - pas de temps variable en temps ou en espace ou ',/,&
+'@ algorithme stationnaire (IDTVAR) ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2141 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ On souhaite utiliser un couplage ',/,&
+'@ vitesse-pression par point fixe (NTERUP = ',I10 ,/,&
+'@ La version actuelle ne le permet pas lorsque l''une des ',/,&
+'@ options suivantes a ete activee (c''est le cas ici) : ',/,&
+'@ - utilisation d''un estimateur d''erreur (IESCAL) ',/,&
+'@ - couplage instationnaire (IPUCOU) ',/,&
+'@ - prise en compte specifique de la pression ',/,&
+'@ hydrostatique (IPHYDR et ICALHY) ',/,&
+'@ - algorithme stationnaire (IDTVAR=-1) ',/,&
+'@ - module compressible (IPPMOD(ICOMPF)>=0) ',/,&
+'@ - champ de vitesse fige (ICCVFG=1) ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2142 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,' avec le modele de turbulence ',/,&
+'@ k-epsilon (ITURB = ',I10 ,') couple (IKECOU = ',I10,') :',/,&
+'@ la version courante ne permet pas de traiter les ',/,&
+'@ equations du modele k-epsilon a l''ordre 2 en temps avec',/,&
+'@ couplage. ',/,&
+'@ Une ou plusieurs valeurs parmi les suivantes ne sont ',/,&
+'@ donc pas permises : ',/,&
+'@ ',/,&
+'@ THETST ISTO2T THETA K THETA EPS ',/,&
+'@ ', E12.4, I10, E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2143 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,' avec le modele de turbulence ',/,&
+'@ v2f (ITURB = ',I10 ,') couple (IKECOU = ',I10, ') :',/,&
+'@ la version courante ne permet pas de traiter les ',/,&
+'@ equations du modele v2f a l''ordre 2 en temps avec ',/,&
+'@ couplage. ',/,&
+'@ Une ou plusieurs valeurs parmi les suivantes ne sont ',/,&
+'@ donc pas permises : ',/,&
+'@ ',/,&
+'@ THETST ISTO2T THETA K THETA EPS ',/,&
+'@ ', E12.4, I10, E12.4, E12.4 ,/,&
+'@ THETA PHI THETA FB ',/,&
+'@ ', E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2144 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,' avec le modele de turbulence ',/,&
+'@ k-omega (ITURB = ',I10 ,') couple (IKECOU = ',I10,') :',/,&
+'@ la version courante ne permet pas de traiter les ',/,&
+'@ equations du modele k-omega a l''ordre 2 en temps avec ',/,&
+'@ couplage. ',/,&
+'@ Une ou plusieurs valeurs parmi les suivantes ne sont ',/,&
+'@ donc pas permises : ',/,&
+'@ ',/,&
+'@ THETST ISTO2T THETA K THETA OMEGA ',/,&
+'@ ', E12.4, I10, E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2145 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ La version actuelle ne permet pas de modifier le schema en',/,&
+'@ temps lorsqu''une physique particuliere est activee ',/,&
+'@ (combustion, charbon, electrique). ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface, usini1 ',/,&
+'@ et usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2146 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,' les termes sources provenant du module ',/,&
+'@ Lagrangien ne sont pas traites a l''ordre 2 en temps ',/,&
+'@ dans la version courante malgre le choix utilisateur ',/,&
+'@ suivant : ',/,&
+'@ ',/,&
+'@ Pour Navier-Stokes Pour la turbulence ',/,&
+'@ THETSN ISNO2T THETST ISTO2T ',/,&
+'@ ', E12.4, I10, E12.4, I10 ,/,&
+'@ ',/,&
+'@ (Les autres termes sources pourraient etre traites a ',/,&
+'@ l''ordre 2) ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface, usini1 ',/,&
+'@ et uslag1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2147 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ OPTIONS DE CALCUL INCOMPATIBLES AVEC LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Les termes sources provenant du module ',A11 ,/,&
+'@ ne sont pas traites a l''ordre 2 en temps ',/,&
+'@ dans la version courante malgre le choix utilisateur ',/,&
+'@ suivant : ',/,&
+'@ ',/,&
+'@ Pour le scalaire ',I10 ,/,&
+'@ THETSS ISSO2T ',/,&
+'@ ', E12.4, I10 ,/,&
+'@ ',/,&
+'@ (Les autres termes sources pourraient etre traites a ',/,&
+'@ l''ordre 2) ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface, usini1 ',/,&
+'@ et ',A6 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2148 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ALGORITHME STATIONNAIRE ',/,&
+'@ COEFFICIENT DE RELAXATION POUR LA VARIABLE ',A8 ,/,&
+'@ ',/,&
+'@ RELAXV doit etre un reel compris entre 0 et 1 ',/,&
+'@ Il vaut ici ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2149 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITE ALGORITHME STATIONNAIRE ',/,&
+'@ ',/,&
+'@ Coefficient de relaxation vitesse phase ',I10 ,/,&
+'@ RELAXV n''a pas la meme valeur pour les 3 composantes ',/,&
+'@ ',/,&
+'@ Parametre RELAXV U V W ',/,&
+'@ Valeurs entrees ici ',E10.2,E10.2,E10.2 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2150 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L''ALGORITHME STATIONNAIRE N''EST PAS COMPATIBLE AVEC ',/,&
+'@ LE MODULE LAGRANGIEN QUI EST UNE APPROCHE INSTATIONNAIRE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ L''indicateur IILAGR a ete positionne a ',I10 ,/,&
+'@ dans uslag1 (module lagrangien active pour IILAGR>0). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2151 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L''ALGORITHME STATIONNAIRE N''EST PAS COMPATIBLE AVEC ',/,&
+'@ LA L.E.S. QUI EST UNE MODELISATION INSTATIONNAIRE DE ',/,&
+'@ LA TURBULENCE ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ L''indicateur ITURB a ete positionne a ',I10 ,/,&
+'@ dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2201 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2202 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LA PRISE EN COMPTE EXPLICITE DE LA PRESSION ',/,&
+'@ HYDROSTATIQUE N''EST IMPLANTEE QUE POUR LE MONOPHASIQUE ',/,&
+'@ IPHYDR VAUT ICI ',I10 ,/,&
+'@ ET NPHAS ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! 2203 format(
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/,
+! &'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,
+! &'@ ========= ',/,
+! &'@ ON DEMANDE LA PRISE EN COMPTE EXPLICITE DE LA PRESSION ',/,
+! &'@ HYDROSTATIQUE POUR LES CONDITIONS DE SORTIE EN PRESSION ',/,
+! &'@ AVEC ACCELERATION DE LA PESANTEUR NULLE ',/,
+! &'@ ',/,
+! &'@ ICALHY VAUT ICI ',I10 ,/,
+! &'@ G VAUT ICI ',3E14.5 ,/,
+! &'@ ',/,
+! &'@ Le calcul ne sera pas execute. ',/,
+! &'@ ',/,
+! &'@ Verifier les parametres donnes via l''interface ou usini1.',/,
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/)
+ 2204 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ DONNEES NON ADMISSIBLES POUR LE SCHEMA EN TEMPS ',/,&
+'@ ',/,&
+'@ ON DEMANDE LA PRISE UN SCHEMA EN TEMPS POUR LA VITESSE ',/,&
+'@ D''ORDRE 2 AVEC UN PAS DE TEMPS NON CONSTANT, UN ',/,&
+'@ ALGORITHME STATIONNAIRE OU LES MATRICES POIDS ',/,&
+'@ ',/,&
+'@ THETAV VAUT ICI ',E14.5,' POUR LA VITESSE ',/,&
+'@ ALORS QUE IDTVAR VAUT ',I10 ,/,&
+'@ ET IPUCOU VAUT ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2205 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0, 1, 2, 3 OU 4 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2206 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ANOMAX DOIT ETRE UN REEL POSITIF OU NUL ET ',/,&
+'@ INFERIEUR OU EGAL A PI/2 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ On demande la reconstruction des gradients par moindres ',/,&
+'@ carres sur voisinage etendu reduit (IMRGRA = ',I10 ,').',/,&
+'@ Le critere est base sur l''angle de non orthogonalite ',/,&
+'@ des faces ANOMAX qui doit etre fourni en radians et ',/,&
+'@ compris dans les bornes indiquees ci-dessus. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2207 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L''UTILISATION DE LA METHODE DE CALCUL DE GRADIENT PAR ',/,&
+'@ MOINDRES CARRES EST IMPOSSIBLE AVEC ',/,&
+'@ NPHAS SUPERIEUR A 1 OU ',/,&
+'@ EXTRAG(IPR(1)) DIFFERENT DE 0 ET 1 ',/,&
+'@ ',/,&
+'@ ON A ICI ',/,&
+'@ IMRGRA = ',I10 ,/,&
+'@ NPHAS = ',I10 ,/,&
+'@ EXTRAG(IPR(1)) = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2208 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ EN K-EPS PROD LIN (ITURB=21) ET EN V2F (ITURB=50) ',/,&
+'@ IKECOU DOIT ETRE EGAL A 0 ',/,&
+'@ ITURB VAUT ICI ',I10 ,/,&
+'@ IKECOU VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2209 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE MODELE DE PAROI A DEUX ECHELLES (IDEUCH=1 OU 2) ',/,&
+'@ EST INCOMPATIBLE AVEC UN CALCUL EN LAMINAIRE, EN ',/,&
+'@ LONGUEUR DE MELANGE OU EN L.E.S. ',/,&
+'@ POUR LA PHASE ',I10 ,/,&
+'@ ON A ICI ITURB=',I10 ,/,&
+'@ ET IDEUCH=',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L''ALGORITHME STATIONNAIRE EST INCOMPATIBLE AVEC LE ',/,&
+'@ COUPLAGE DES TERMES SOURCES EN K-EPS, V2F OU K-OMEGA ',/,&
+'@ ',/,&
+'@ POUR LA PHASE ',I10 ,/,&
+'@ ON A ICI IKECOU=',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2211 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0, 1 OU 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IMLIGR(',I10 ,') DOIT ETRE UN ENTIER ',/,&
+'@ INFERIEUR OU EGAL A 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IMLIGR(I) indique le mode de limitation des gradients ',/,&
+'@ pour la variable I ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IRCFLU(',I10 ,') DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IRCFLU(I) indique si les flux sont reconstruits ',/,&
+'@ pour la variable I ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2311 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IRCFLU(',I10 ,') = ',I10 ,' EST INCOMPATIBLE AVEC ',/,&
+'@ ISCHCV(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IRCFLU(I) = 0 indique que les flux ne sont pas ',/,&
+'@ reconstruits pour la variable I. ',/,&
+'@ ISCHCV(I) = 0 (schema SOLU) demande une reconstruction ',/,&
+'@ pour les flux convectifs. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ CLIMGR(',I10 ,') DOIT ETRE UN REEL ',/,&
+'@ SUPERIEUR OU EGAL A 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ CLIMGR(I) est le coefficient de limitation des gradients ',/,&
+'@ pour la variable I ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2330 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ EXTRAG(',I10 ,') DOIT ETRE UN REEL EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2331 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ EXTRAG(',I10 ,') DOIT ETRE NUL ',/,&
+'@ (Des valeurs non nulles sont autorisees pour la ',/,&
+'@ pression uniquement) ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IRESOL(',I10 ,') DOIT ETRE UN ENTIER EGAL ',/,&
+'@ A -1 OU A IPOL*1000+ J ',/,&
+'@ AVEC IPOL LE DEGRE DU POLYNOME DE PRECONDITIONNEMENT ',/,&
+'@ ET J = 0 POUR GRADIENT CONJUGUE ',/,&
+'@ = 1 POUR JACOBI (IPOL = 0 DANS CE CAS) ',/,&
+'@ = 2 POUR BI-CGSTAB ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IRESOL(I) indique le solveur lineaire a utiliser ',/,&
+'@ pour la variable I ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2401 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IDIRCL(',I10 ,') DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IDIRCL(I) indique si le code doit decaler la diagonale de ',/,&
+'@ la matrice de la variable I en l''absence de Dirichlet ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ RISQUE D ECHEC A LA RESOLUTION DU SYSTEME LINEAIRE ',/,&
+'@ IRESOL(',I10 ,') = ',I10 ,/,&
+'@ ET LA VARIABLE EST CONVECTEE (ICONV = ',I10,') ',/,&
+'@ ',/,&
+'@ Le calcul sera engage. ',/,&
+'@ ',/,&
+'@ Le solveur iteratif choisi peut ne pas converger sur le ',/,&
+'@ systeme lineaire resultant du type de probleme considere',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2420 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ RISQUE DE PERTE D''INFORMATION EN CALCUL SUITE ',/,&
+'@ ',/,&
+'@ Le calcul sera engage. ',/,&
+'@ ',/,&
+'@ Un modele de LES a ete active par ITURB(IPHAS) = ',I10 ,/,&
+'@ mais on a desactive l''ecriture ou la lecture du fichier',/,&
+'@ suite auxiliaire : ',/,&
+'@ ILEAUX = ',I10 ,' IECAUX = ',I10 ,/,&
+'@ Bien que ce fichier ne soit pas necessaire a la poursuite ',/,&
+'@ d''un calcul, il contient neanmoins des informations ',/,&
+'@ qui permettent d''eviter les perturbations numeriques ',/,&
+'@ au moment des suites. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A -1, 0, 1 OU 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2510 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2511 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2520 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ DTMIN DOIT ETRE SUPERIEUR OU EGAL A 0. ET ',/,&
+'@ INFERIEUR OU EGAL A DTMAX ',/,&
+'@ ICI DTMIN = ',E14.5 ,' ET DTMAX = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Quand le pas de temps n est pas uniforme et constant, ',/,&
+'@ les reels DTMIN et DTMAX bornent ses variations. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2530 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ CDTVAR(',I10 ,') DOIT ETRE UN REEL STRICTEMENT POSITIF',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ CDTVAR(I) est le coefficient multiplicatif applique au pas',/,&
+'@ de temps pour la resolution de la variable I. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2540 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ON DEMANDE UNE LIMITATION DU PAS DE TEMPS LIEE AUX EFFETS ',/,&
+'@ DE DENSITE (IPTLRO = ',I10 ,') AVEC UNE OPTION DE ',/,&
+'@ PAS DE TEMPS FIXE (IDTVAR = ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul sera engage, mais le pas de temps ne sera pas ',/,&
+'@ clippe. Le code indiquera juste les eventuels ',/,&
+'@ depassements de critere local. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2541 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ON DEMANDE UNE LIMITATION DU PAS DE TEMPS LIEE AUX EFFETS ',/,&
+'@ DE DENSITE (IPTLRO = ',I10 ,') AVEC UN ALGORITHME ',/,&
+'@ STATIONNAIRE (IDTVAR = ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul sera engage, l''option IPTLRO ignoree. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2600 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0, 10, 20, 21, 30, 31,',/,&
+'@ 40, 41, 42, 50, OU 60' ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2605 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LA METHODE DES VORTEX NE PEUT ETRE ACTIVEE QUE POUR UN ',/,&
+'@ CALCUL MONOPHASIQUE. ',/,&
+'@ ON A ICI ',/,&
+'@ NPHAS =',I10 ,/,&
+'@ IVRETX=',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2606 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LA METHODE DES VORTEX NE CONCERNE QUE LES CALCULS EN LES',/,&
+'@ ON A ICI ',/,&
+'@ ITURB(1)=',I10 ,/,&
+'@ IVRETX =',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute en ignorant le mot clef IVRTEX. ',/,&
+'@ (il est repositione a 0) ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2607 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ON DEMANDE LA REDUCTION DU VOISINAGE ETENDU POUR LE ',/,&
+'@ CALCUL DES GRADIENTS PAR MOINDRE CARRES, POUR UN ',/,&
+'@ CALCUL EN L.E.S AVEC LE MODELE DYNAMIQUE. ',/,&
+'@ MODELE DYNAMIQUE. ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ITURB =',I10 ,/,&
+'@ IMRGRA=',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera engage. ',/,&
+'@ ',/,&
+'@ Le calcul de la moyenne locale de la constante de ',/,&
+'@ Smagorinsky dynamique peut etre degrade. ',/,&
+'@ ',/,&
+'@ Il est conseille : ',/,&
+'@ - soit d''utiliser une methode de calculs des gradients ',/,&
+'@ par moindre carres sur voisinage etendu complet ',/,&
+'@ (IMRGRA = 2) ',/,&
+'@ - soit de calculer sa propre moyenne de la constante ',/,&
+'@ dynamique dans la subroutine USSMAG. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2610 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,' : DONNEES INCOHERENTES ',/,&
+'@ ',A31,I10 ,/,&
+'@ ',A31,I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! 2620 FORMAT
+! & (' ATTENTION : ON DEMANDE ',A6,' = ',I10,/,
+! & ' AVEC GRAVITE = ',3E14.5)
+ 2621 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ON DEMANDE LA PRISE EN COMPTE DE L''ACCELERATION DE LA ',/,&
+'@ PESANTEUR ',3E14.5 ,/,&
+'@ SANS RESOLUTION D''UNE VARIABLE TEMPERATURE OU ENERGIE ',/,&
+'@ (ISCALT = ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul sera engage. ',/,&
+'@ ',/,&
+'@ Il n''y a pas d''incompatibilite a prendre en compte ',/,&
+'@ l''acceleration de la pesanteur sans effets thermiques, ',/,&
+'@ mais, souvent, la masse volumique depend essentiellement',/,&
+'@ de la temperature et la combinaison des options du ',/,&
+'@ present calcul est caracteristique d''un oubli. ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier les parametres donnes via ',/,&
+'@ l''interface ou usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2622 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ON DEMANDE LA PRISE EN COMPTE DES TERMES DE GRAVITE DANS ',/,&
+'@ LES EQUATIONS DE LA TURBULENCE (',A6,' = ',I10 ,') ',/,&
+'@ SANS RESOLUTION D''UNE VARIABLE TEMPERATURE OU ENERGIE ',/,&
+'@ ',/,&
+'@ Le calcul sera engage. ',/,&
+'@ ',/,&
+'@ Si des effets de gravite sont recherches, il convient de ',/,&
+'@ s assurer que la masse volumique est variable. ',/,&
+'@ Le nombre de Prandtl turbulent sera pris egal a 1. ',/,&
+'@ Elle peut varier en fonction d autres grandeurs que ',/,&
+'@ la temperature ou l enthalpie ; si c est le cas, ce ',/,&
+'@ message pourra etre ignore ; sinon, verifier usini1 ',/,&
+'@ ou imposer une variation de masse volumique dans usphyv.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2623 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Le coefficient RELAXV des variables de la turbulence a ete ',/,&
+'@ modifie alors que IKECOU ne vaut pas 0. Il vaut ici ',/,&
+'@ - pour k : ',E12.4 ,/,&
+'@ - pour epsilon (ou omega) : ',E12.4 ,/,&
+'@ ',/,&
+'@ La modification sera sans effet (RELAXV n''est utile que ',/,&
+'@ si IKECOU=0) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2624 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Le coefficient RELAXV des variables de la turbulence doit ',/,&
+'@ etre un reel compris entre 0 et 1. Il vaut ici : ',/,&
+'@ - pour k : ',E12.4 ,/,&
+'@ - pour epsilon (ou omega) : ',E12.4 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2625 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Le coefficient RELAXV de la pression doit etre un reel ',/,&
+'@ compris entre 0 et 1. Il vaut ici : ',E12.4 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2630 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ On demande la prise en compte de l''amortissement de ',/,&
+'@ Van Driest (IDRIES(IPHAS) = ', I10,')' ,/,&
+'@ avec un modele LES incompatible (ITURB(IPHAS) = ',I10,')',/,&
+'@ (modele dynamique et modele WALE) ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas realise. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2640 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL INCLUS DANS L''INTERVALLE [0;1]',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2650 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ',A6,'(',I10 ,') DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ ICPSYR(I) est l indicateur de couplage du scalaire I avec ',/,&
+'@ SYRTHES. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2660 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE POUR LE COUPLAGE SYRTHES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Aucun couplage avec SYRTHES n''a ete defini. ',/,&
+'@ Le nombre de scalaires couples est cependant ',I10 ,/,&
+'@ (Le nombre de scalaires total est ici ',I10 ,') ',/,&
+'@ Verifier le couplage SYRTHES-Noyau. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2661 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE POUR LE COUPLAGE SYRTHES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Un couplage avec SYRTHES a ete defini. ',/,&
+'@ Le couplage avec SYRTHES necessite de disposer d''un ',/,&
+'@ scalaire couple (et d''un seul). ',/,&
+'@ Le nombre de scalaires total est ici ',I10 ,/,&
+'@ Le nombre de scalaires couples est ici ',I10 ,/,&
+'@ Verifier le couplage SYRTHES-Noyau. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2662 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE POUR LE COUPLAGE SYRTHES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Un couplage avec SYRTHES a ete defini. ',/,&
+'@ Si le code est couple a SYRTHES, le scalaire couple doit ',/,&
+'@ etre la temperature. ',/,&
+'@ Le scalaire couple est ici le scalaire ',I10 ,/,&
+'@ Ce n''est pas une temperature car ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@ Pour coupler un scalaire qui n''est pas la temperature, ',/,&
+'@ contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2663 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE POUR LE COUPLAGE SYRTHES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Un couplage avec SYRTHES a ete defini. ',/,&
+'@ En compressible, si le code est couple a SYRTHES, le ',/,&
+'@ scalaire couple doit etre l''energie. ',/,&
+'@ Le scalaire couple est ici le scalaire ',I10 ,/,&
+'@ Ce n''est pas l''energie car ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2664 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX DU CALCUL DES ESTIMATEURS D''ERREUR ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,' l''indicateur IESCAL relatif a ',/,&
+'@ l''estimateur d''erreur numero IEST = ',I10 ,' pour ',/,&
+'@ Navier-Stokes doit etre un entier egal a 0, 1 ou 2. ',/,&
+'@ Il vaut ici : IESCAL(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Rq. : les valeurs possibles de IEST sont : ',/,&
+'@ IESPRE = ',I10 ,/,&
+'@ IESDER = ',I10 ,/,&
+'@ IESCOR = ',I10 ,/,&
+'@ IESTOT = ',I10 ,/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2700 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHOIX DU MODE DE CALCUL DE LA DISTANCE A LA PAROI ',/,&
+'@ ',/,&
+'@ ICDPAR DOIT ETRE UN ENTIER EGAL A -2, -1, 1 ou 2 ',/,&
+'@ IL VAUT ICI ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2710 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL INCLUS DANS LINTERVALLE [0.;1.]',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2720 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL SUPERIEUR OU EGAL A 1. ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2730 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL EGAL A 0. OU A 1. ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2740 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL STRICTEMENT POSITIF. ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2750 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER INFERIEUR OU EGAL A 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ',A6,'(',I10 ,') DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L algorithme de resolution multigrille algebrique ',/,&
+'@ n est pas compatible avec les variables convectees. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ',A6,'(',I10 ,') DOIT ETRE UN ENTIER ',/,&
+'@ STRICTEMENT POSITIF ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER STRICTEMENT POSITIF ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ LA VITESSE DE REFERENCE UREF N''A PAS ETE INITIALISEE ',/,&
+'@ OU A ETE MAL INITIALISEE (VALEUR NEGATIVE). ',/,&
+'@ ELLE VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul pourra etre execute si la turbulence est ',/,&
+'@ initialisee a partir d''un fichier suite de calcul ou par ',/,&
+'@ la routine usiniv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ISCSTH(',I10 ,') DOIT ETRE UN ENTIER EGAL A -1,0,1,2,3',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ IPHSCA(',I10 ,') DOIT ETRE UN ENTIER ',/,&
+'@ STRICTEMENT POSITIF ET ',/,&
+'@ INFERIEUR OU EGAL A NPHAS = ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IPHSCA est le numero de la phase porteuse du scalaire. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ISCAVR(',I10 ,') DOIT ETRE UN ENTIER ',/,&
+'@ POSITIF OU NUL ET ',/,&
+'@ INFERIEUR OU EGAL A NSCAL = ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Si ISCAVR(I) est nul, le scalaire I n est pas une variance',/,&
+'@ Si ISCAVR(I) est positif, le scalaire I est une variance :',/,&
+'@ il s agit de la variance des fluctuations du scalaire J ',/,&
+'@ dont le numero est ISCAVR(I) ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4321 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE SCALAIRE ',A8 ,'EST DEFINI COMME LA FLUCTUATION ',/,&
+'@ DU SCALAIRE ',A8 ,/,&
+'@ (ISCAVR(',I10 ,') = ',I10 ,'), ',/,&
+'@ QUI EST LUI-MEME DEFINI COMME UNE FLUCTUATION ',/,&
+'@ (ISCAVR(',I10 ,') = ',I10 ,'). ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Si ISCAVR(I) est positif, le scalaire I est une variance :',/,&
+'@ il s agit de la variance des fluctuations du scalaire J ',/,&
+'@ dont le numero est ISCAVR(I) et on a donc forcement ',/,&
+'@ ISCAVR(J) = 0 ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4330 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ICLVFL(',I10 ,') DOIT ETRE UN ENTIER EGAL A 0, 1 OU 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ ICLVFL(I) indique le mode de clipping du scalaire I ',/,&
+'@ lorsqu il s agit d une variance de fluctuations. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4331 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ICLVFL(',I10 ,') N EST UTILISE QUE POUR LES VARIANCES ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ALORS QUE LE SCALAIRE N EST PAS UNE VARIANCE. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ ICLVFL(I) indique le mode de clipping du scalaire I ',/,&
+'@ lorsqu il s agit d une variance de fluctuations. ',/,&
+'@ Il n est pas utilise pour les autres scalaires. ',/,&
+'@ L utilisateur est invite a ne pas modifier ICLVFL pour ',/,&
+'@ les scalaires qui ne sont pas des variances. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4340 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ VISLS0(',I10 ,') DOIT ETRE UN REEL POSITIF ',/,&
+'@ QUAND IVISLS(',I10 ,') = ',I10 ,/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ VISLS0(I) est le coefficient de diffusion moleculaire du ',/,&
+'@ scalaire et doit etre positif quand ivisls est different',/,&
+'@ de 1 (dans ce cas, un coefficient variable est donne ',/,&
+'@ dans usphyv). ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4350 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SIGMAS(',I10 ,') DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ SIFMAS(I) est le nombre de Prandtl turbulent associe ',/,&
+'@ au scalaire I. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4360 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SCAMIN(',I10 ,') VAUT ICI ',E14.5 ,/,&
+'@ AVEC ICLVFL(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ SCAMIN(I) est la valeur minimale acceptee pour le ',/,&
+'@ scalaire I. Lorsque le scalaire est une variance ',/,&
+'@ (ISCAVR(I) > 0) la valeur de SCAMIN n est prise en ',/,&
+'@ compte que si ICLVFL(I) = 2 ',/,&
+'@ Si l utilisateur souhaite effectivement que le ',/,&
+'@ scalaire I (en fait, une variance) soit limite a SCAMIN ',/,&
+'@ (positif) il faut imposer ICLVFL = 2 dans usini1. ',/,&
+'@ Si l utilisateur souhaite utiliser l option ICLVFL = 1 ',/,&
+'@ il est invite a ne pas modifier SCAMIN dans usini1. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4361 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SCAMAX(',I10 ,') VAUT ICI ',E14.5 ,/,&
+'@ AVEC ICLVFL(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ SCAMAX(I) est la valeur maximale acceptee pour le ',/,&
+'@ scalaire I. Lorsque le scalaire est une variance ',/,&
+'@ (ISCAVR(I) > 0) la valeur de SCAMAX n est prise en ',/,&
+'@ compte que si ICLVFL(I) = 2 ',/,&
+'@ Si l utilisateur souhaite effectivement que le ',/,&
+'@ scalaire I (en fait, une variance) soit limite a SCAMAX ',/,&
+'@ (positif) il faut imposer ICLVFL = 2 dans usini1. ',/,&
+'@ Si l utilisateur souhaite utiliser l option ICLVFL = 1 ',/,&
+'@ il est invite a ne pas modifier SCAMAX dans usini1. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4370 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SCAMAX(',I10 ,') DOIT ETRE UN REEL STRICTEMENT POSITIF',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ SCAMAX(I) est la valeur maximale acceptee pour le ',/,&
+'@ scalaire I, ici une variance ',/,&
+'@ Avec ICLVFL(I) = 2, la valeur de SCAMAX doit donc etre ',/,&
+'@ strictment positive. ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4380 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ RVARFL(',I10 ,') DOIT ETRE UN REEL STRICTEMENT POSITIF',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ RVARFL(I) est le coefficient R pour le scalaire I (qui est',/,&
+'@ une variance) intervenant dans le terme de dissipation :',/,&
+'@ - (1/R) rho scalaire epsilon/k ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LA PERIODICITE DE ROTATION N''EST PAS COMPATIBLE AVEC LE',/,&
+'@ COUPLAGE VITESSE PRESSION RENFORCE OU LA METHODE ',/,&
+'@ ALE DANS LA VERSION COURANTE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ La variable COMMANDE_PERIO a ete renseignee dans le ',/,&
+'@ lanceur (la periodicite a ete activee, ce qui se traduit',/,&
+'@ par IPERIO = ',I10, ') ',/,&
+'@ et certaines periodicites sont de rotation. ',/,&
+'@ L''indicateur IPUCOU a ete positionne a ',I10 ,/,&
+'@ dans l''interface ou usini1 (couplage renforce pour ',/,&
+'@ IPUCOU=1). ',/,&
+'@ L''indicateur IALE a ete positionne a ',I10 ,/,&
+'@ dans l''interface ou usini1 (methode activee si IALE=1) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODE DE CALCUL DE LA DISTANCE A LA PAROI INCOMPATIBLE ',/,&
+'@ AVEC LA PERIODICITE ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ La variable COMMANDE_PERIO a ete renseignee dans le ',/,&
+'@ lanceur (la periodicite a ete activee, ce qui se traduit',/,&
+'@ par IPERIO = ',I10, '). ',/,&
+'@ Les parametres de calcul specifies necessitent le calcul ',/,&
+'@ la distance a la paroi (Rij-eps LRR avec echo de paroi, ',/,&
+'@ LES avec amortissement de van Driest ou k-omega SST). ',/,&
+'@ Le mode de calcul de la distance a la paroi defini par ',/,&
+'@ ICDPAR = ',I10, ' ne permet pas de prendre en compte ',/,&
+'@ la periodicite. ',/,&
+'@ ',/,&
+'@ Utiliser ICDPAR = 1 ou -1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! 5007 format(
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/,
+! &'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,
+! &'@ ========= ',/,
+! &'@ LA PERIODICITE N''EST PAS COMPATIBLE AVEC LE',/,
+! &'@ RAYONNEMENT SEMI-TRANSPARENT (ORDONNEES DISCRETES) ',/,
+! &'@ DANS LA VERSION COURANTE ',/,
+! &'@ ',/,
+! &'@ Le calcul ne peut etre execute. ',/,
+! &'@ ',/,
+! &'@ L''indicateur IPERIO a ete positionne a ',I10 ,/,
+! &'@ dans usini1 (periodicite activee pour IPERIO=1). ',/,
+! &'@ L''indicateur IIRAYO(',I10,') a ete positionne a ',I10 ,/,
+! &'@ dans usray1. ',/,
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/)
+ 5008 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LA PERIODICITE DE ROTATION N''EST PAS COMPATIBLE AVEC LE',/,&
+'@ RAYONNEMENT SEMI-TRANSPARENT (ORDONNEES DISCRETES) ',/,&
+'@ DANS LA VERSION COURANTE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ La variable COMMANDE_PERIO a ete renseignee dans le ',/,&
+'@ lanceur (la periodicite a ete activee, ce qui se traduit',/,&
+'@ par IPERIO = ',I10, ') ',/,&
+'@ et certaines periodicites sont de rotation. ',/,&
+'@ L''indicateur IIRAYO(',I10,') a ete positionne a ',I10 ,/,&
+'@ dans l''interface ou usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5009 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ DES DEFAUTS PEUVENT SE RENCONTRER LORS DE L''UTILISATION',/,&
+'@ DE LA PERIODICITE DE ROTATION EN RIJ-EPSILON. ',/,&
+'@ ',/,&
+'@ La variable COMMANDE_PERIO a ete renseignee dans le ',/,&
+'@ lanceur (la periodicite a ete activee, ce qui se traduit',/,&
+'@ par IPERIO = ',I10, ') ',/,&
+'@ et certaines periodicites sont de rotation. ',/,&
+'@ L''indicateur ITURB(IPHAS) a ete positionne a ',I10 ,/,&
+'@ pour la phase IPHAS = ',I10 ,' dans usini1. ',/,&
+'@ ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ Les defauts eventuels evoques proviennent de la prise en',/,&
+'@ compte de la rotation du tenseur de viscosite orthotrope',/,&
+'@ Il a cependant en general une influence faible de sorte ',/,&
+'@ que les tests menes jusqu''a present n''ont pas fait ',/,&
+'@ apparaitre de probleme. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ DES DEFAUTS PEUVENT SE RENCONTRER LORS DE L''UTILISATION',/,&
+'@ DE LA PERIODICITE DE ROTATION AVEC UN SCHEMA D''ORDRE ',/,&
+'@ DEUX EN TEMPS POUR LA VITESSE. ',/,&
+'@ ',/,&
+'@ La variable COMMANDE_PERIO a ete renseignee dans le ',/,&
+'@ lanceur (la periodicite a ete activee, ce qui se traduit',/,&
+'@ par IPERIO = ',I10, ') ',/,&
+'@ et certaines periodicites sont de rotation. ',/,&
+'@ Les indicateurs THETAV des trois composantes Ux, Uy, Uz ',/,&
+'@ de la vitesse pour la phase IPHAS = ',I10 ,/,&
+'@ ont ete positionnes (dans usini1 ou par defaut suite aux',/,&
+'@ options de calcul selectionnees) aux valeurs suivantes :',/,&
+'@ THETAV(IU(IPHAS)) THETAV(IV(IPHAS)) THETAV(IW(IPHAS)) ',/,&
+'@ ',E14.5 ,' ',E14.5 ,' ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul peut etre execute. ',/,&
+'@ Les defauts eventuels evoques proviennent de la prise en',/,&
+'@ compte de la rotation du tenseur gradient de vitesse. ',/,&
+'@ En effet, on met en oeuvre une methode explicite qui est',/,&
+'@ susceptible de faire chuter l''ordre du schema en temps.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 6002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE PARALLELISME N''EST PAS COMPATIBLE AVEC LE MODULE ',/,&
+'@ LAGRANGIEN DANS LA VERSION COURANTE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Le processeur courant est de rang ',I10 ,/,&
+'@ L''indicateur IILAGR a ete positionne a ',I10 ,/,&
+'@ dans uslag1 (module lagrangien active pour IILAGR>0). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODE DE CALCUL DE LA DISTANCE A LA PAROI INCOMPATIBLE ',/,&
+'@ AVEC LE PARALLELISME ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Le processeur courant est de rang ',I10 ,/,&
+'@ Les parametres de calcul specifies necessitent le calcul ',/,&
+'@ la distance a la paroi (Rij-eps LRR avec echo de paroi, ',/,&
+'@ LES avec amortissement de van Driest ou k-omega SST). ',/,&
+'@ Le mode de calcul de la distance a la paroi defini par ',/,&
+'@ ICDPAR = ',I10, ' ne permet pas de prendre en compte ',/,&
+'@ le parallelisme. ',/,&
+'@ ',/,&
+'@ Utiliser ICDPAR = 1 ou -1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INDICATEUR DE METHODE ALE ',/,&
+'@ ',/,&
+'@ IALE DOIT VALOIR 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usalin.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE D''ITERATIONS D''INITIALISATION DU FLUIDE EN ALE ',/,&
+'@ ',/,&
+'@ NALINF DOIT ETRE UN ENTIER POSITIF ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usalin.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ COEFFICIENTS DE LA METHODE DE NEWMARK NON VALIDES ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ ALPNMK doit etre compris entre 0 et 1 ',/,&
+'@ BETNMK doit etre compris entre 0 et 1/2 ',/,&
+'@ GAMNMK doit etre compris entre 0 et 1 ',/,&
+'@ On a ici : ',/,&
+'@ ',/,&
+'@ ALPNMK BETNMK GAMNMK ',/,&
+'@ ', E12.4, E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface, usini1 ',/,&
+'@ ou usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE D''ITERATIONS MAX DE COUPLAGE IMPLICITE EN ALE ',/,&
+'@ ',/,&
+'@ NALIMX DOIT ETRE UN ENTIER POSITIF ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usalin.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PRECISION DU COUPLAGE IMPLICITE EN ALE ',/,&
+'@ ',/,&
+'@ EPALIM DOIT ETRE UN REEL STRICTEMENT POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usalin.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ITERATION D''INITIALISATION DE L''ALE ',/,&
+'@ ',/,&
+'@ ITALIN DOIT VALOIR 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes dans usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= MODULE COMPRESSIBLE ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,/,&
+'@ T0 ET P0 DOIVENT ETRE DES REELS STRICTEMENT POSITIFS ',/,&
+'@ ILS VALENT ICI : ',/,&
+'@ T0 = ',E14.5 ,/,&
+'@ P0 = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les parametres donnes via l''interface ou usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NDIM must have value equal to 3 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ space dimension can only be 3 even for 2D simulations ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1',/,&
+'@ Check the mesh file ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A33, ' MUST BE AN INTEGER ',/, &
+'@ SUPERIEUR or EGAL A -1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A33, ' MUST BE AN INTEGER ',/,&
+'@ LARGER OR EQUAL TO 1 or EQUAL TO -1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1220 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ICHRVR(',I10 ,') MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ ICHRVR defines whether the variable should be included in ',/,&
+'@ post-processing files ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1230 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NCAPT MUST BE AN INTEGER LESS THAN or EGAL A ',I10 ,/, &
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The computation CANNOT start. ',/,&
+'@ ',/,&
+'@ NCAPT is the number of probes for history/ time series ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1240 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IHISVR(',I10 ,',1) MUST BE AN INTEGER EGAL to -1 ',/,&
+'@ or Zero, or positive but less than NCAPT =',I10 ,/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IHISVR(I,1) is the number of probes for variable I ',/,&
+'@ (-1 means all probes are used) ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1250 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IHISVR(',I10 ,',',I10 ,') MUST BE AN INTEGER ',/,&
+'@ LARGER OR EQUAL TO 1 AND ',/,&
+'@ LESS OR EQUAL TO NCAPT = ',I10 ,/,&
+'@ IT HAS VALUE =',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IHISVR(I,j+1) gives the number of the j-ieth probe ',/,&
+'@ to be used with variable number I to post-process ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1260 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ILISVR(',I10 ,') MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ ILISVR(I) tells if variable (I)should be included ',/,&
+'@ in the printed listing ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1270 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ITRSVR(',I10 ,') MUST BE AN INTEGER ',/,&
+'@ BETWEEN 0 and NVAR=',I10 ,/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PARAMETER ',A6,' MUST BE AN INTEGER MULTIPLE OF ',/,&
+'@ THE FOLLOWING INTEGER : ',/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ ',A6,' = ',I10 ,/,&
+'@ IT HAS VALUE ',A6,' = ', I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ This parameter tells which extra variables should be ',/,&
+'@ included for post-processing ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER ',/,&
+'@ STRICTLY POSITIVE AND LESS THAN or EGAL TO',I10 ,/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ TEMPORAL EXTRAPOLATION OF DENSITY RHO REQUESTED, ',/,&
+'@ BUT IROEXT(IPHAS) = ',I10 ,/,&
+'@ THIS IS INCOMPATIBLE WITH RHO = CONSTANT ',/,&
+'@ IROVAR(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PARAMETERS OF NUMERICAL SCHEME FOR VARIABLE ',A8 ,/,&
+'@ ',/,&
+'@ Parameter ISTAT ICONV ',/,&
+'@ Values accepted 0 or 1 0 or 1 ',/,&
+'@ Values entered here',I10 ,I10 ,/,&
+'@ ',/,&
+'@ PARAMETER IDIFF IDIFFT ',/,&
+'@ Values accepted 0 or 1 0 or 1 ',/,&
+'@ Values entered here',10X ,I10 ,I10 ,/,&
+'@ ',/,&
+'@ PARAMETER THETAV BLENCV ISCHCV ISSTPC',/,&
+'@ Values accepted [0.; 1.] [0.; 1.] 0 or 1 0 or 1',/,&
+'@ Values entered here ',E14.5 ,E14.5,I10 ,I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2111 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITY FOR TIME DISCRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ TIME DISCRETISATION SCHEME for velocity phase ',I10 ,/,&
+'@ THETA DOES NOT HAVE SAME VALUE FOR ALL 3 COMPONENTS ',/,&
+'@ ',/,&
+'@ Parameter THETAV U V W ',/,&
+'@ Values entered here',E10.2,E10.2,E10.2 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2112 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITY FOR TIME DISCRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ PARAMETER THETAV FOR PRESSURE MUST BE EQUAL TO 1 ',/,&
+'@ ',/,&
+'@ for phase ', I10,' but has value ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2113 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITY FOR TIME DISCRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' IN L.E.S. ',/,&
+'@ PARAMETER THETFL FOR TIME DISCRETISATION FOR MASS FLUX ',/,&
+'@ IS DIFFERENT FROM THAT OF PHASE 1 ',E14.5 ,/,&
+'@ THETFL WAS SET AT ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2114 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITY FOR TIME DISCRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' ',/,&
+'@ PARAMETER ISTMPF IN SCHEME EN TEMPS POUR LE FLUX DE ',/,&
+'@ MASSE IS DIFFERENT FROM THAT OF PHASE 1',I10 ,/, &
+'@ ISTMPF IS NOW IMPOSED AS ',I10 ,/,&
+'@ ',/,&
+'@ Computation will NOT proceed ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2121 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' IN L.E.S. ',/,&
+'@ RECOMMENDED VALUE FOR PARAMETER THETAV IN TIME-SCHEME ',/,&
+'@ FOR VARIABLE ',A8 ,' IS 0.5 ',/,&
+'@ THETAV IS NOW IMPOSED AT ',E14.5 ,/,&
+'@ ',/,&
+'@ computation will go on ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ user interface or usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2122 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' WITH L.E.S. ',/,&
+'@ THE VALUE RECOMMANDED FOR THE PARAMETER BLENCV ',/, &
+'@ FOR CONVECTION OF VARIABLE ',A8 ,' EST 1.0 ',/,&
+'@ BLENCV IS NOW IMPOSED AS ',E14.5 ,/,&
+'@ ',/,&
+'@ computation will go on ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2123 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ THE VALUE RECOMMANDED FOR THE PARAMETER ISSTPC IN SCHEME ',/,&
+'@ CONVECTION OF VARIABLE ',A8 ,' IS 1 ',/,&
+'@ ISSTPC IS NOW IMPOSED AS ',I10 ,/,&
+'@ ',/,&
+'@ Computation will go on ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2124 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ THE VALUE RECOMMANDED FOR THE PARAMETER ISSTPC IN SCHEME ',/,&
+'@ CONVECTION OF VARIABLE ',A8 ,' IS 0 ',/,&
+'@ ISSTPC IS NOW IMPOSED AS ',I10 ,/,&
+'@ ',/,&
+'@ Computation will go on ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2125 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' ORDRE 2 EN TEMPS or the ',/,&
+'@ THE VALUE RECOMMANDED FOR THE PARAMETER NSWRSM FOR ',/,&
+'@ VARIABLE ',A8 ,' IS ',I10 ,/,&
+'@ NSWRSM IS NOW IMPOSED AS ',I10 ,/,&
+'@ ',/,&
+'@ computation will go on ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2127 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,' EN L.E.S. ',/,&
+'@ THE VALUE RECOMMANDED FOR THE PARAMETER BLENCV IN ',/,&
+'@ CONVECTION OF VARIABLE ',A8 ,' IS 1.0 ',/,&
+'@ BLENCV IS NOW IMPOSED AS ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation will NOT proceed ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2131 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ CHOICE OF TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,/,&
+'@ TIME-SCHEME FOR VELOCITY IS FIRST ORDER ',/,&
+'@ (THETAV = ',E10.2 ,') ',/,&
+'@ CERTAIN TERMES ARE HOWEVER SECOND ORDER IN TIME WITH ',/,&
+'@ THE FOLLOWING SETTINGS: ',/,&
+'@ ',/,&
+'@ parameters ISTMPF ISNO2T ISTO2T IROEXT IVIEXT ICPEXT ',/,&
+'@ Values entered ',6I7 ,/,&
+'@ ',/,&
+'@ computation will go on. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2132 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ CHOICE OF TIME-SCHEME ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,/,&
+'@ TIME-SCHEME FOR VELOCITY IS SECOND ORDER ',/,&
+'@ (THETAV = ',E10.2 ,') ',/,&
+'@ CERTAIN TERMES ARE HOWEVER FIRST ORDER IN TIME WITH ',/,&
+'@ THE FOLLOWING SETTINGS: ',/,&
+'@ ',/,&
+'@ parameters ISTMPF ISNO2T ISTO2T IROEXT IVIEXT ICPEXT ',/,&
+'@ Values entered ',6I7 ,/,&
+'@ ',/,&
+'@ computation will go on. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2133 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ SCALAR ',I10,' ISSO2T = ',I10 ,/,&
+'@ IS DIFFERENT FROM ISNO2T IN PHASE IPHAS = ',I10 ,/,&
+'@ ISNO2T(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ computation will go on ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2134 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON-STANDARD CHOICE WITH TIME-SCHEME ',/,&
+'@ ',/,&
+'@ SCALAIRE ',I10,' IVSEXT = ',I10 ,/,&
+'@ IS DIFFERENT FROM IVIEXT IN PHASE IPHAS = ',I10 ,/,&
+'@ IVIEXT(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ computation will go on ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2135 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITY FOR TIME DISCRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Phase IPHAS = ',I10 ,/,&
+'@ Specific heat is extrapolated in time with ',/,&
+'@ ICPEXT(IPHAS) = ',I10 ,/,&
+'@ in which case it should be variable, or ',/,&
+'@ ICP(IPHAS) = ',I10 ,/,&
+'@ ',/,&
+'@ Computation will NOT go on ',/,&
+'@ ',/,&
+'@ Verify the parameters given via l''interface or usini1 ',/,&
+'@ - deactivate xtrapolation of Cp in time ',/,&
+'@ or ',/,&
+'@ - define Cp as variable ',/,&
+'@ (give its variation law in usphyv) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2136 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITY FOR TIME DISCRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Scalar ISCAL = ',I10 ,/,&
+'@ Diffusivity is extrapolated in time wih ',/,&
+'@ IVSEXT(ISCAL) = ',I10 ,/,&
+'@ it should thus be a variable, or ',/,&
+'@ IVISLS(ISCAL) = ',I10 ,/,&
+'@ ',/,&
+'@ Computation will NOT proceed ',/,&
+'@ ',/,&
+'@ Verify the parameters given via user interface or usini1 ',/,&
+'@ - deactivate intepolation in time ',/,&
+'@ for diffusivity ',/,&
+'@ or ',/,&
+'@ - impose diffusivite variable ',/,&
+'@ (and describe variation law in usphyv) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2137 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHEN READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ CHOICE INCOMPATIBLE FOR ERROR ESTIMATES ',/,&
+'@ ',/,&
+'@ One or several error estimates are activated for ',/,&
+'@ Navier-Stokes in simulation with frozen velocity field. ',/,&
+'@ estimates will not be computed ',/,&
+'@ ',/,&
+'@ Computation will NOT proceed ',/,&
+'@ ',/,&
+'@ Verify the parameters given via l''interface or ',/,&
+'@ usini1 : ',/,&
+'@ desactivate ERROR ESTIMATES (ICCVFG) ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2140 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ for phase ',I10 ,' a second ordre time-scheme was ',/,&
+'@ requested : ',/,&
+'@ U,V,W : THETA = ',3E12.4 ,/,&
+'@ Source terme in Navier-Stokes: ISNO2T = ',I10 ,/,&
+'@ THETSN = ',E12.4 ,/,&
+'@ Density : IROEXT = ',I10 ,/,&
+'@ THETRO = ',E12.4 ,/,&
+'@ Viscosity : IVIEXT = ',I10 ,/,&
+'@ THETVI = ',E12.4 ,/,&
+'@ Current version does not allow this in combination with ',/,&
+'@ one of the following option (which has been activated ): ',/,&
+'@ - Error estimation (IESCAL) ',/,&
+'@ - reinforced U-P coupling (IPUCOU) ',/,&
+'@ - specific treatment of hydrostatic pressure ',/,&
+'@ contribution (IPHYDR et ICALHY) ',/,&
+'@ - time-step variable with space or iteration or ',/,&
+'@ steady-state algorithm(IDTVAR) ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2141 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Pressure-Velocity coupling by fixed-point method ',/,&
+'@ was selected by setting NTERUP = ',I10 ,/,&
+'@ Current version does not allow this in combination with ',/,&
+'@ one of the following options (which has been activated ): ',/,&
+'@ - Error estimation (IESCAL) ',/,&
+'@ - reinforced U-P coupling (IPUCOU) ',/,&
+'@ - specific treatment of hydrostatic pressure ',/,&
+'@ contribution (IPHYDR et ICALHY) ',/,&
+'@ - time-step variable with space or iteration or ',/,&
+'@ steady-state algorithm(IDTVAR=-1) ',/,&
+'@ - compressible module (IPPMOD(ICOMPF)>=0) ',/,&
+'@ - frozen velocity field (ICCVFG=1) ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2142 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ for phase ',I10 ,' with the k-epsilon turbulence ',/,&
+'@ model (ITURB = ',I10 ,') solved coupled(IKECOU = ',I10,'):',/,&
+'@ the current version does not allow second order ',/,&
+'@ in time resolution of k-epsilon equations in a coupled ',/,&
+'@ manner. ',/,&
+'@ ',/,&
+'@ Thus one or more of the values below are not permited ',/,&
+'@ ',/,&
+'@ THETST ISTO2T THETA K THETA EPS ',/,&
+'@ ', E12.4, I10, E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2143 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ for phase ',I10 ,' with the V2F turbulence ',/,&
+'@ model (ITURB = ',I10 ,') solved coupled(IKECOU = ',I10,'):',/,&
+'@ the current version does not allow second order ',/,&
+'@ in time resolution of V2F equations in a coupled ',/,&
+'@ manner. ',/,&
+'@ ',/,&
+'@ Thus one or more of the values below are not permited ',/,&
+'@ ',/,&
+'@ THETST ISTO2T THETA K THETA EPS ',/,&
+'@ ', E12.4, I10, E12.4, E12.4 ,/,&
+'@ THETA PHI THETA FB ',/,&
+'@ ', E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2144 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ for phase ',I10 ,' with the k-omega turbulence ',/,&
+'@ model (ITURB = ',I10 ,') solved coupled(IKECOU = ',I10,'):',/,&
+'@ the current version does not allow second order ',/,&
+'@ in time resolution of k-omega equations in a coupled ',/,&
+'@ manner. ',/,&
+'@ ',/,&
+'@ Thus one or more of the values below are not permited ',/,&
+'@ ',/,&
+'@ THETST ISTO2T THETA K THETA OMEGA ',/,&
+'@ ', E12.4, I10, E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2145 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ The current version does not allow changing the time ',/,&
+'@ discretisation scheme when a specific physics is active ',/,&
+'@ (combustion, coal, electrical, ...). ',/,&
+'@ ',/,&
+'@ Verify the parameters given via interface, usini1 ',/,&
+'@ and usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2146 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,' the source terms stemming from the ',/,&
+'@ Lagrangien module will not be computed as second order ',/,&
+'@ in this version, despite user settings chosen below ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ For Navier-Stokes For turbulence ',/,&
+'@ THETSN ISNO2T THETST ISTO2T ',/,&
+'@ ', E12.4, I10, E12.4, I10 ,/,&
+'@ ',/,&
+'@ (other termes sources could be second order in time ',/,&
+'@ ) ',/,&
+'@ ',/,&
+'@ Verify the parameters given via interface, usini1 ',/,&
+'@ and uslag1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2147 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ OPTIONS NOT COMPATIBLE WITH TIME DICRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ source terms coming from module ',A11 ,/,&
+'@ will not be computed as second order ',/,&
+'@ in this version, despite user settings chosen below ',/,&
+'@ ',/,&
+'@ Pour le scalaire ',I10 ,/,&
+'@ THETSS ISSO2T ',/,&
+'@ ', E12.4, I10 ,/,&
+'@ ',/,&
+'@ (Les autres termes sources pourraient etre traites a ',/,&
+'@ l''ordre 2) ',/,&
+'@ ',/,&
+'@ Verify the parameters given via l''interface, usini1 ',/,&
+'@ et ',A6 ,/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2148 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ALGORITHME STATIONNAIRE ',/,&
+'@ COEFFICIENT DE RELAXATION POUR LA VARIABLE ',A8 ,/,&
+'@ ',/,&
+'@ RELAXV MUST BE A REAL comprised between 0 et 1 ',/,&
+'@ it has here a value of ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2149 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITE ALGORITHME STATIONNAIRE ',/,&
+'@ ',/,&
+'@ relaxation Coefficient of velocity phase ',I10 ,/,&
+'@ RELAXV should have the same value for all components ',/,&
+'@ ',/,&
+'@ PARAMETER RELAXV U V W ',/,&
+'@ Values entered here ',E10.2,E10.2,E10.2 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2150 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ L''ALGORITHME STATIONNAIRE N''EST PAS COMPATIBLE AVEC ',/,&
+'@ LE MODULE LAGRANGIEN QUI EST UNE APPROCHE INSTATIONNAIRE',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Integer parameter IILAGR was set to ',I10 ,/,&
+'@ in uslag1 (lagrangian module active for IILAGR>0). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2151 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ STEADY STATE SOLVER SCHEME IS NOT COMPATIBLE WITH ',/,&
+'@ L.E.S. TRUBULENCE MODELLING WHICH IS TIME-DEPENDENT ',/,&
+'@ BY NATURE ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Integer parameter ITURB was set to ',I10 ,/,&
+'@ in usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2201 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2202 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ HYDROSTATIQUE PRESSURE ONLY VALID FOR SINGLE PHASE FLOW ',/,&
+'@ IPHYDR HAS VLAUE ',I10 ,/,&
+'@ AND NPHAS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! 2203 format(
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/,
+! &'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,
+! &'@ ========= ',/,
+! &'@ GRAVITY IS SET TO ZERO ',/,
+! &'@ THIS IS NOT COMPATIBLE WITH HYDROSTATIQUE PRESSURE OPTION ',/,
+! &'@ ',/,
+! &'@ ',/,
+! &'@ ICALHY IS EQUAL ',I10 ,/,
+! &'@ IS EQUAL ',3E14.5 ,/,
+! &'@ ',/,
+! &'@ Computation CAN NOT run ',/,
+! &'@ ',/,
+! &'@ Check the input data given via User Interface or in usini1.',/,
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/)
+ 2204 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOMPATIBILITY FOR TIME DISCRETISATION SCHEME ',/,&
+'@ ',/,&
+'@ ON DEMANDE LA PRISE UN SCHEMA EN TEMPS FOR VELOCITY ',/,&
+'@ D''ORDRE 2 AVEC UN PAS DE TEMPS NON CONSTANT, UN ',/,&
+'@ ALGORITHME STATIONNAIRE or the MATRICES POIDS ',/,&
+'@ ',/,&
+'@ THETAV IS EQUAL ',E14.5,' FOR VELOCITY ',/,&
+'@ ALORS QUE IDTVAR VAUT ',I10 ,/,&
+'@ ET IPUCOU VAUT ',I10 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2205 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER EQUAL TO 0, 1, 2, 3 or 4 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2206 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ANOMAX DOIT ETRE A REAL POSITIVE or NUL AND ',/,&
+'@ LESS THAN or EQUAL TO PI/2 ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ On demande la reconstruction des gradients par moindres ',/,&
+'@ carres sur voisinage etendu reduit (IMRGRA = ',I10 ,').',/,&
+'@ Le critere est base sur l''angle de non orthogonalite ',/,&
+'@ des faces ANOMAX qui doit etre fourni en radians et ',/,&
+'@ compris dans the bornes indiquees ci-dessus. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2207 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ L''UTILISATION DE LA METHODE DE CALCUL DE GRADIENT PAR ',/,&
+'@ MOINDRES CARRES EST IMPOSSIBLE AVEC ',/,&
+'@ NPHAS SUPERIEUR A 1 or ',/,&
+'@ EXTRAG(IPR(1)) DIFFERENT DE 0 ET 1 ',/,&
+'@ ',/,&
+'@ ON A ICI ',/,&
+'@ IMRGRA = ',I10 ,/,&
+'@ NPHAS = ',I10 ,/,&
+'@ EXTRAG(IPR(1)) = ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2208 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ EN K-EPS PROD LIN (ITURB=21) ET EN V2F (ITURB=50) ',/,&
+'@ IKECOU DOIT ETRE EGAL A 0 ',/,&
+'@ ITURB IS EQUAL ',I10 ,/,&
+'@ IKECOU IS EQUAL ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2209 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ 2u*scales version of WALL FUNCTION (IDEUCH=1 or 2) ',/,&
+'@ EST INCOMPATIBLE AVEC UN CALCUL EN LAMINAIRE, EN ',/,&
+'@ LONGUEUR DE MELANGE or EN L.E.S. ',/,&
+'@ POUR LA PHASE ',I10 ,/,&
+'@ ON A ICI ITURB=',I10 ,/,&
+'@ ET IDEUCH=',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SOLVE STEADY-STATE EQN. OPTION IS NOT COMPATIBLE WITH ',/,&
+'@ COUPLING OF SOURCES TERMES IN K-EPS, V2F or K-OMEGA ',/, &
+'@ ',/,&
+'@ FOR THE PHASE ',I10 ,/,&
+'@ WE HAVE IKECOU=',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2211 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' MUST BE AN INTEGER EGAL A 0, 1 or 2 ',/, &
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IMLIGR(',I10 ,') MUST BE AN INTEGER ',/, &
+'@ LESS THAN or EGAL A 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IMLIGR(I) indique le mode de limitation des gradients ',/,&
+'@ pour la variable I ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IRCFLU(',I10 ,') MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IRCFLU(I) flags if fluxes are reconstructed for ',/&
+'@ variable I ',/&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2311 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IRCFLU(',I10 ,') = ',I10 ,' IS INCOMPATIBLE WITH ',/,&
+'@ ISCHCV(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IRCFLU(I) = 0 fluxes are not reconstructed for variable I ',/,&
+'@ ',/, &
+'@ ISCHCV(I) = 0 (schema SOLU) requests a reconstruction ',/,&
+'@ for convective fluxes ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ CLIMGR(',I10 ,') DOIT ETRE A REAL ',/,&
+'@ SUPERIEUR or EGAL A 1 ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ CLIMGR(I) is the coefficient limiting the gradients ',/,&
+'@ for variable I ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2330 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ EXTRAG(',I10 ,') MUST BE REAL and equal 0 or 1 ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2331 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ EXTRAG(',I10 ,') MUST BE ZERO ',/,&
+'@ (non zero values are only possible for pressure ',/,&
+'@ ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IRESOL(',I10 ,') MUST BE AN INTEGER EQUAL ',/,&
+'@ to -1 or to IPOL*1000+ J ',/,&
+'@ where IPOL is the order of the preconditionning polynomial ',/,&
+'@ and J = 0 for conjugate grandient ',/,&
+'@ = 1 for JACOBI (IPOL = 0 DANS CE CAS) ',/,&
+'@ = 2 for BI-CGSTAB ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IRESOL(I) is the linear system reso methode to use ',/,&
+'@ for variable I ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2401 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ IDIRCL(',I10 ,') MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IDIRCL(I) tells if the diagonal of the matrix for variable',/,&
+'@ I should be shifted in the absence of Dirichlet condition ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2410 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ RESOLUTION OF LINEAR SYSTEM COULD FAIL ',/,&
+'@ IRESOL(',I10 ,') = ',I10 ,/,&
+'@ AND THE VARIABLE IS ADVECTED (ICONV = ',I10,') ',/,&
+'@ ',/,&
+'@ The calculation will be launched nevertheless ',/,&
+'@ ',/,&
+'@ The chosen linear solver could fail to converge ',/,&
+'@ because of the nature of the problem ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2420 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ RISQUE DE PERTE D''INFORMATION EN CALCUL SUITE ',/,&
+'@ ',/,&
+'@ The calculation will run. ',/&
+'@ ',/,&
+'@ A turbulence model was activated by ITURB(IPHAS) = ',I10 ,/,&
+'@ but writing to auxiliary restart file was de-activated ',/,&
+'@ ',/,&
+'@ ILEAUX = ',I10 ,' IECAUX = ',I10 ,/,&
+'@ Although this file is not necessary to restart ',/,&
+'@ a computation, it does contain information that avoid ',/,&
+'@ numerical perturbations when restarting a computation ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER equal to -1, 0, 1 or 2 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2510 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' must be a positive real number ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2511 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE A POSITIVE REAL ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2520 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ DTMIN must be > or = 0. and ',/,&
+'@ DTMIN must be < or = DTMAX ',/,&
+'@ Here DTMIN = ',E14.5 ,' and DTMAX = ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ When the time-step is non uniforme and constant ',/,&
+'@ DTMIN <= timestep <= DTMAX ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2530 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ CDTVAR(',I10 ,') DOIT ETRE A STRICTLY POSITIVE REAL ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ CDTVAR(I) multiplyer coefficient applied to the ',/,&
+'@ timestep for the resolution of variable I. ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2540 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ON DEMANDE UNE LIMITATION DU PAS DE TEMPS LIEE AUX EFFETS ',/,&
+'@ DE DENSITE (IPTLRO = ',I10 ,') AVEC UNE OPTION DE ',/,&
+'@ PAS DE TEMPS FIXE (IDTVAR = ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul sera engage, mais le pas de temps ne sera pas ',/,&
+'@ clippe. Le code indiquera juste the eventuels ',/,&
+'@ depassements de critere local. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2541 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ A time-step reduction in liaison with variable density ',/,&
+'@ effects (IPTLRO = ',I10 ,') was requested while ',/,&
+'@ steady-state algorythm is selected (IDTVAR = ',I10 ,') ',/,&
+'@ ',/,&
+'@ Computation will run, but option IPTLRO is ignored ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2600 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' MUST BE AN INTEGER EGAL A 0, 10, 20, 21, 30, 31,',/, &
+'@ 40, 41, 42, 50, or 60' ,/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2605 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ Synthetic Vortex method for LES inlet is not compatible ',/,&
+'@ with mutiphase option ',/,&
+'@ we have here ',/,&
+'@ NPHAS =',I10 ,/,&
+'@ IVRETX=',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2606 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ Synthetic Vortex method is only for for LES ',/,&
+'@ here we have ',/,&
+'@ ITURB(1)=',I10 ,/,&
+'@ IVRETX =',I10 ,/,&
+'@ ',/,&
+'@ computation will go on while ignoring keyword IVRTEX. ',/,&
+'@ (it is reset to 0) ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2607 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ A reduction of the extened neighbourhood was selected ',/,&
+'@ for the caculation of the gradients by least squares. ',/,&
+'@ However this will also be applied to the averaging in ',/,&
+'@ the LES Dynamic model (also selected) ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ITURB =',I10 ,/,&
+'@ IMRGRA=',I10 ,/,&
+'@ ',/,&
+'@ Computation will run, but ',/,&
+'@ ',/,&
+'@ averaging of the Smagorinsky constant can be ',/,&
+'@ degraded, as it uses the same reduced neighbourhood. ',/,&
+'@ ',/,&
+'@ Recommendation ',/,&
+'@ - use extended neighbourhood ',/,&
+'@ ',/,&
+'@ (IMRGRA = 2) ',/,&
+'@ - user defines (yourself) the averaging of the dynamic' ,/,&
+'@ Smagorinsky constant via subroutine USSMAG. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2610 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,' : DONNEES INCOHERENTES ',/,&
+'@ ',A31,I10 ,/,&
+'@ ',A31,I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! 2620 FORMAT
+! & (' ATTENTION : ON DEMANDE ',A6,' = ',I10,/,
+! & ' AVEC GRAVITE = ',3E14.5)
+ 2621 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ Gravity is taken into account ',/,&
+'@ ',3E14.5 ,/,&
+'@ without solving for temperature or energy ',/,&
+'@ (ISCALT = ',I10 ,') ',/,&
+'@ ',/,&
+'@ The calculation will run. ',/,&
+'@ ',/,&
+'@ The above options are not incompatible ',/,&
+'@ but gravity is more often activated when density is ',/,&
+'@ variable with temperature (natural convection) ',/,&
+'@ this could be an error ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2622 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ Gravity is taken into account ',/,&
+'@ in the turbulence source terms (',A6,' = ',I10 ,') ',/,&
+'@ without solving for temperature or energy ',/,&
+'@ ',/,&
+'@ The calculation will run. ',/&
+'@ ',/,&
+'@ gravity usualy afects turbulence only via density effects ',/,&
+'@ Check that density is variable. ',/,&
+'@ other than via temperature ',/,&
+'@ this could be by user defined density ',/,&
+'@ in subroutine usphyv. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2623 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Coefficient RELAXV for turbulence variables was modified ',/,&
+'@ although IKECOU is not = 0. It is in fact to ',/,&
+'@ - for k : ',E12.4 ,/,&
+'@ - for epsilon (or omega) : ',E12.4 ,/,&
+'@ ',/,&
+'@ The modification will be ignored (RELAXV is only useful ',/,&
+'@ if IKECOU=0) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2624 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ LCoefficient RELAXV for turbulence variables must ',/,&
+'@ be a REAL comprised between 0 and 1. IT IS EQUAL : ',/,&
+'@ - for k : ',E12.4 ,/,&
+'@ - for epsilon (ou omega) : ',E12.4 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2625 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Coefficient RELAXV for the pressure must be a REAL ',/,&
+'@ between 0 et 1. It IS EQUAL : ',E12.4 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2630 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',/,&
+'@ Van Driest near wall damping was selected ',/,&
+'@ Van Driest (IDRIES(IPHAS) = ', I10,')' ,/,&
+'@ with a LES model not compatible (ITURB(IPHAS) = ',I10,')',/,&
+'@ (dynamic model or WALE model) ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2640 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' must be a REAL number in the range [0;1] ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2650 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',A8 ,/,&
+'@ ',A6,'(',I10 ,') MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ ICPSYR(I) is a flag for coupling scalar I with ',/,&
+'@ SYRTHES (solid walls modeller) ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2660 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE POUR LE COUPLAGE SYRTHES ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ No coupling with SYRTHES has been defined ',/,&
+'@ The number of coupled scalars is however ',I10 ,/,&
+'@ (the total number of scalars is',I10 ,') ',/,&
+'@ Verify the couplage SYRTHES-Noyau. ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2661 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE POUR LE COUPLAGE SYRTHES ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ A coupling with SYRTHES was defined ',/,&
+'@ This requires a coupled scalar (and only one). ',/,&
+'@ The total number of scalars is ',I10 ,/,&
+'@ The number of coupled scalars is ',I10 ,/,&
+'@ Verify le couplage SYRTHES-Noyau. ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2662 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE for coupling with SYRTHES ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ The coupled scalar must be the temperature ',/,&
+'@ ',/,&
+'@ Here it is scalar number : ',I10 ,/,&
+'@ which is not temperature because ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2663 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INCOHERENCE IN COUPLING WITH SYRTHES ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ For compressible and SYRTHES coupling ',/,&
+'@ the coupled scalar must be energy. ',/,&
+'@ here it is scalar ',I10 ,/,&
+'@ which is not the energy here since '&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2664 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ CHOIX DU CALCUL DES ESTIMATEURS D''ERREUR ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ phase ',I10 ,' flag IESCAL related to ',/,&
+'@ error estimate number IEST = ',I10 ,' for ',/,&
+'@ Navier-Stokes MUST BE AN INTEGER egal to 0, 1 or 2. ',/,&
+'@ It IS EQUAL : IESCAL(',I10 ,',',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Rq. : the possible values of IEST are : ',/,&
+'@ IESPRE = ',I10 ,/,&
+'@ IESDER = ',I10 ,/,&
+'@ IESCOR = ',I10 ,/,&
+'@ IESTOT = ',I10 ,/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2700 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ Choice of method for computing distance to the wall ',/,&
+'@ ',/,&
+'@ ICDPAR MUST BE AN INTEGER EQUAL TO -2, -1, 1 or 2 ',/,&
+'@ IL IS EQUAL ', I10 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2710 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE A REAL INCLUD IN SEGMENT [0.;1.]',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2720 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE A REAL SUPERIEUR or EGAL A 1. ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2730 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE A REAL EGAL A 0. or A 1. ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2740 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE A STRICTLY POSITIVE REAL. ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2750 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER LESS THAN or EGAL A 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ',A6,'(',I10 ,') MUST BE AN INTEGER EQUAL 0 OR 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ The multigrid algorithm for the linear system resolution ',/,&
+'@ is not compatible with convected variables. ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ VARIABLE ',A8 ,/,&
+'@ ',A6,'(',I10 ,') MUST BE AN INTEGER ',/,&
+'@ STRICTLY POSITIVE ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',A6,' MUST BE AN INTEGER STRICTLY POSITIVE ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ REFERENCE VELOCITY UREF WAS NOT DEFINED ',/,&
+'@ or is ill defined (NEGATIVE value ? ). ',/,&
+'@ It IS EQUAL ',E14.5 ,/,&
+'@ ',/,&
+'@ calculation can only run if turbulence is defined ',/,&
+'@ via a restart file or ',/,&
+'@ suroutine usiniv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAR ',A8 ,/,&
+'@ ISCSTH(',I10 ,') MUST BE AN INTEGER EGAL A -1,0,1,2,3',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ IPHSCA(',I10 ,') MUST BE AN INTEGER ',/,&
+'@ STRICTLY POSITIVE AND ',/,&
+'@ LESS THAN or EGAL A NPHAS = ',I10 ,/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ IPHSCA is number of fluid phase related to scalar . ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ISCAVR(',I10 ,') MUST BE AN INTEGER ',/,&
+'@ POSITIVE or NUL AND ',/,&
+'@ LESS THAN or EGAL A NSCAL = ',I10 ,/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ If ISCAVR(I) =0 , le scalare I is not a variance ',/,&
+'@ If ISCAVR(I) is POSITIVE, scalare I is a variance : ',/,&
+'@ it is the variance of fluctuations of scalaire J ',/,&
+'@ who''s number is ISCAVR(I) ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4321 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ THE SCALAR ',A8 ,'IS DEFINED AS FLUCTUATION ',/,&
+'@ OF SCALAR ',A8 ,/,&
+'@ (ISCAVR(',I10 ,') = ',I10 ,'), ',/,&
+'@ WHICH ITSELF IS DEFINED AS A FLUCTUATION ',/,&
+'@ (ISCAVR(',I10 ,') = ',I10 ,'). ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ If ISCAVR(I) is POSITIVE, scalar I is a variance : ',/,&
+'@ variance of fluctuations of scalar J ',/,&
+'@ who''s number is ISCAVR(I) , so we must have ',/,&
+'@ ISCAVR(J) = 0 ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4330 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ICLVFL(',I10 ,') MUST BE AN INTEGER EGAL A 0, 1 or 2 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ ICLVFL(I) defines the type of clipping of scalar I ',/,&
+'@ when it is a variance of fluctuations. ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4331 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ ICLVFL(',I10 ,') is only used for VARIANCES ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ BUT THE SCALAR IS NOT A VARIANCE ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ ICLVFL(I) flags the type of clipping for scalar I ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4340 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ VISLS0(',I10 ,') MUST BE A REAL POSITIVE ',/,&
+'@ WHILE IVISLS(',I10 ,') = ',I10 ,/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ VISLS0(I) is the molecular diffusion coefficient of the ',/,&
+'@ scalar and MUST BE POSITIVE when ivisls is different ',/,&
+'@ from 1 (it must then be defined in USPHYV ) ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4350 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SIGMAS(',I10 ,') MUST BE A REAL POSITIVE ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ SIFMAS(I) is the turbulent Prandtl turbulent ',/,&
+'@ associated to scalar I. ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4360 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SCAMIN(',I10 ,') IS EQUAL ',E14.5 ,/,&
+'@ AVEC ICLVFL(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ SCAMIN(I) is the minimale acceptable value for ',/,&
+'@ scalaire I. When this scalar is a variance ',/,&
+'@ (ISCAVR(I) > 0) value of SCAMIN is only used if ',/,&
+'@ ICLVFL(I) = 2 ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4361 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SCAMAX(',I10 ,') IS EQUAL ',E14.5 ,/,&
+'@ AVEC ICLVFL(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ SCAMAX(I) is the maximum acceptable value for ',/,&
+'@ scalar I. When this is a variance ',/,&
+'@ (ISCAVR(I) > 0) the value of SCAMAX is only used ',/,&
+'@ if ICLVFL(I) = 2 ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4370 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ SCAMAX(',I10 ,') MUST BE A REAL STRICTLY POSITIVE ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ SCAMAX(I) is the maximum acceptable value for ',/,&
+'@ scalar I, which is a variance ',/,&
+'@ with ICLVFL(I) = 2, value SCAMAX must be ',/,&
+'@ strictly positive. ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4380 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ SCALAIRE ',A8 ,/,&
+'@ RVARFL(',I10 ,') MUST BE A REAL STRICTLY POSITIVE ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ RVARFL(I) is the coefficient R for the scalar I (which is ',/,&
+'@ a variance) related to the dissipation equation sourceterme',/,&
+'@ - (1/R) rho scalaire epsilon/k ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ANGULAR PERIODICITE IS NOT COMPATIBLE WITH THE ',/,&
+'@ ENHANCED PRESSSURE-VELOCITY COUPLING or ALE METHOD ',/,&
+'@ IN THE CURRENT VERSION ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ variable COMMANDE_PERIO was defined in the run-case script',/,&
+'@ (periodicity was activated which results in : ',/,&
+'@ IPERIO = ',I10, ') ',/,&
+'@ and some peridic boundaries involve rotation. ',/,&
+'@ The flag IPUCOU is defined as ',I10 ,/,&
+'@ in the interface or usini1 (enhanced coupling for ',/,&
+'@ IPUCOU=1). ',/,&
+'@ The ALE fag IALE is defined as ',I10 ,/,&
+'@ in the interface or usini1 (method activated if IALE=1) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5004 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PERIODICITY IS INCOMPATIBLE WITH THE MULTIGRID SOLVER ',/,&
+'@ IN THE CURRENT VERSION ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ variable COMMANDE_PERIO was defined in the run-case script',/,&
+'@ (periodicity was activated which results in : ',/,&
+'@ IPERIO = ',I10, ') ',/,&
+'@ Flag IMGR is defined as 1 for one variable at least ',/,&
+'@ in the interface or usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PERIODICITY IS INCOMPATIBLE WITH THIS METHOD FOR ',/,&
+'@ COMPUTING DISTANCE TO WALL IN THE CURRENT VERSION ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ variable COMMANDE_PERIO was defined in the run-case script',/,&
+'@ (periodicity was activated which results in : ',/,&
+'@ IPERIO = ',I10, ') ',/,&
+'@ the parameters specified need the calculation of the ',/,&
+'@ distance to the wall (Rij-eps LRR with wall echo term , ',/,&
+'@ van Driest damping or k-omega SST). ',/,&
+'@ The method for computing wall distance : ',/,&
+'@ ICDPAR = ',I10, ' is not compatible with ',/,&
+'@ periodicity ',/,&
+'@ ',/,&
+'@ Recommendation: use ICDPAR = 1 or -1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! 5007 format(
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/,
+! &'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,
+! &'@ ========= ',/,
+! &'@ PERIODICITY IS NOT COMPATIBLE WITH RADIATIVE HEAT ',/,
+! &'@ TRANSFER IN SEMI TRANSPARENT MEDIA ',/,
+! &'@ (in the current version) ',/,
+! &'@ ',/,
+! &'@ The calculation could NOT run. ',/,
+! &'@ ',/,
+! &'@ Flag IPERIO is equl to ',I10 ,/,
+! &'@ in usini1 (periodicity actived if IPERIO=1). ',/,
+! &'@ Flag IIRAYO(',I10,') is equal to ',I10 ,/,
+! &'@ in usray1. ',/,
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/)
+ 5008 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ROTATION PERIODICITY IS NOT COMPATIBLE WITH RADIATIVE HEAT ',/,&
+'@ TRANSFER IN SEMI TRANSPARENT MEDIA ',/,&
+'@ (in the current version) ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ variable COMMANDE_PERIO was activated in the runcase script',/,&
+'@ Flag IPERIO is equal to ',I10 ,/,&
+'@ (periodicity actived if IPERIO=1). ',/,&
+'@ Flag IIRAYO(',I10,') is equal to ',I10 ,/,&
+'@ in usray1. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5009 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ DEFECTS CAN APPEAR WHEN USING A COMBINATION OF',/, &
+'@ ANGULAR PERIODICITE (ROTATION) AND RSTM RIJ-EPSILON. ',/,&
+'@ ',/,&
+'@ COMMANDE_PERIO was defined in the run-case script ',/,&
+'@ ',/,&
+'@ and IPERIO = ',I10, ') ',/,&
+'@ and some periodic boundaries involve rotation ',/,&
+'@ Flag for turb ITURB(IPHAS) is = ',I10 ,/,&
+'@ phase IPHAS = ',I10 ,' in usini1. ',/,&
+'@ ',/,&
+'@ Job can run. ',/,&
+'@ ',/,&
+'@ The defects are related to the turbulent transport terms',/,&
+'@ in the Re stress equations (equivalent to an anisotropic',/,&
+'@ diffusion tensor), but these terms are generaly small ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING : WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ DEFECTS CAN APPEAR WHEN USING A COMBINATION OF ',/,&
+'@ ANGULAR PERIODICITE (ROTATION) AND SECOND ORDER SCHEME ',/,&
+'@ IN TIME FOR VELOCITY ',/,&
+'@ ',/,&
+'@ COMMANDE_PERIO was defined in the run-case script ',/,&
+'@ ',/,&
+'@ and IPERIO = ',I10, ') ',/,&
+'@ Flags THETAV for 3 velocity components Ux, Uy, Uz ',/,&
+'@ of velocity for phase IPHAS = ',I10 ,/,&
+'@ are selected (in usini1 or by default ',/,&
+'@ with the following values :' ,/,&
+'@ THETAV(IU(IPHAS)) THETAV(IV(IPHAS)) THETAV(IW(IPHAS)) ',/,&
+'@ ',E14.5 ,' ',E14.5 ,' ',E14.5 ,/,&
+'@ ',/,&
+'@ Job can run. ',/,&
+'@ defects are due to the computation of the velocity ',/,&
+'@ gradient tensor at rotation perodicity boundaries ',/,&
+'@ This uses an explicit approach which reduces the order ',/,&
+'@ of the time discretization scheme ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 6002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PARALLEL COMPUTING AND LAGRANGIAN PARTICULE TRANSPORT ',/,&
+'@ OR NOT COMPATIBLE IN THE CURRENT VERSION ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ The present CPU has rank ',I10 ,/,&
+'@ Flag IILAGR had value',I10 ,/,&
+'@ in uslag1 ( lagrangien module is active for IILAGR>0). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6004 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PARALLEL COMPUTING AND MUTIGRID SOLVER ',/,&
+'@ OR NOT COMPATIBLE IN THE CURRENT VERSION ',/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ The present CPU has rank ',I10 ,/,&
+'@ Flag IMGR is set to 1 ',/,&
+'@ for at least one variable in interface or usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 6005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ THIS METHOD FOR COMPUTING WALL DISTANCES ',/,&
+'@ IS NOT COMPATIBLE WITH PARALLEL COMPUTING ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ The present CPU has rank ',I10 ,/,&
+'@ ',/,&
+'@ Wall distance is necessary for RSTM wall echo terms, or,',/,&
+'@ van Driest damping or k-omega SST). ',/,&
+'@ Method for comuting wall distance is defined by ',/,&
+'@ ICDPAR = ',I10, ' ',/,&
+'@ l IS NOT COMPATIBLE WITH PARALLEL COMPUTING ',/,&
+'@ ',/,&
+'@ Use ICDPAR = 1 or -1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ FLAG FOR ALE METHOD ',/,&
+'@ ',/,&
+'@ IALE should be = 0 or 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given in interface or usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NOMBRE D''ITERATIONS D''INITIALISATION DU FLUIDE EN ALE ',/,&
+'@ ',/,&
+'@ NALINF MUST BE A POSITIVE INTEGER ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given in interface or usalin.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ NON VALID COEFFICIENTS IN NEWMARK METHOD ',/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ ALPNMK MUST BE between 0 and 1 ',/,&
+'@ BETNMK MUST BE between 0 and 1/2 ',/,&
+'@ GAMNMK MUST BE between 0 and 1 ',/,&
+'@ We have here: ',/,&
+'@ ',/,&
+'@ ALPNMK BETNMK GAMNMK ',/,&
+'@ ', E12.4, E12.4, E12.4 ,/,&
+'@ ',/,&
+'@ Verify the parameters given in interface, usini1 ',/,&
+'@ or usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ MAX number of iterations for implicit ALE method ',/,&
+'@ ',/,&
+'@ NALIMX MUST BE A POSITIVE INTEGER ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given in interface or usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ PRECISION DU COUPLAGE IMPLICITE EN ALE ',/,&
+'@ ',/,&
+'@ EPALIM MUST BE A REAL NUMBER, STRICTLY POSITIVE ',/,&
+'@ IT HAS VALUE ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given in interface or usalin.' ,/, &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ INITIALISATION ITERATION FOR ALE ',/,&
+'@ ',/,&
+'@ ITALIN must be = 0 or 1 ',/,&
+'@ IT HAS VALUE ',I10 ,/,&
+'@ ',/,&
+'@ The calculation could NOT run. ',/,&
+'@ ',/,&
+'@ Verify the parameters given in usalin. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: STOP WHILE READING INPUT DATA ',/,&
+'@ ========= ',/,&
+'@ COMPRESSIBLE FLOW MODULE ',/,&
+'@ PHASE ',I10 ,/,&
+'@ T0 AND P0 MUST BE STRICTLY POSITIVE REAL NUMBERS ',/,&
+'@ Here they have values: ',/,&
+'@ T0 = ',E14.5 ,/,&
+'@ P0 = ',E14.5 ,/,&
+'@ ',/,&
+'@ Computation CAN NOT run ',/,&
+'@ ',/,&
+'@ Check the input data given via User Interface or in usini1.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+!===============================================================================
+! 8. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/base/verlon.f90 b/src/base/verlon.f90
new file mode 100644
index 0000000..cd8958d
--- /dev/null
+++ b/src/base/verlon.f90
@@ -0,0 +1,80 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine verlon &
+!================
+
+ ( chaine, ii1, ii2, lpos )
+
+!==============================================================================
+! FONCTION :
+! --------
+
+! VERIFICATION DE LA LONGUEUR D'UNE CHAINE DE CARACTERES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! chaine ! a ! <-- ! chaine de caracteres a verifier !
+! ii1 ! e ! --> ! position premier caractere non blanc !
+! ii2 ! e ! --> ! position dernier caractere non blanc !
+! lpos ! e ! --> ! longueur effective de la chaine !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+! Arguments
+
+character chaine*(*)
+integer ii1,ii2,lpos
+
+! VARIABLES LOCALES
+
+integer n1,iprbla,idrbla
+
+!===============================================================================
+
+ii1 = 0
+ii2 = 0
+lpos = 0
+n1 = len ( chaine )
+if ( n1 .le. 0 ) return
+
+ii1 = iprbla ( chaine, n1 )
+ii2 = idrbla ( chaine, n1 )
+lpos = ii2 - ii1 + 1
+
+end
diff --git a/src/base/vert1d.f90 b/src/base/vert1d.f90
new file mode 100644
index 0000000..8d4090a
--- /dev/null
+++ b/src/base/vert1d.f90
@@ -0,0 +1,443 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine vert1d &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfabor , nfpt1d , iappel , &
+ ifpt1d , nppt1d , iclt1d , ia , &
+ rgpt1d , eppt1d , &
+ xlmbt1 , rcpt1d , dtpt1d , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! VERIFICATION DES DONNEES UTILISATEUR DU MODULE THERMIQUE 1D EN PAROI
+
+! IAPPEL = 1 (un seul appel a l'initialisation) :
+! VERIFICATION DU NOMBRE DE CELLULES OU L'ON IMPOSE UNE PAROI
+! VERIFICATION DE ISUIT1
+
+! IAPPEL = 2 (un seul appel a l'initialisation) :
+! VERIFICATION DU REPERAGE DES CELLULES OU L'ON IMPOSE
+! UNE PAROI
+! VERIFICATION DES DONNEES RELATIVE AU MAILLAGE
+
+! IAPPEL = 3 (appel a chaque pas de temps) :
+! VERIFICATION DES TYPES DE C.L. EN PAROI EXTERIEURE
+! VERIFICATION DES VALEURS DES COEFFICIENTS PHYSIQUE DU CALCUL
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nfpt1d ! e ! <-- ! nombre de faces avec module therm 1d !
+! ifpt1d ! e ! <-- ! numero de la face en traitement !
+! ! ! ! thermique en paroi !
+! nppt1d ! e ! <-- ! nombre de points de discretisation !
+! ! ! ! dans la paroi !
+! eppt1d ! r ! <-- ! epaisseur de la paroi !
+! rgpt1d ! r ! <-- ! raison du maillage !
+! iclt1d ! e ! <-- ! type de condition limite !
+! xlmbt1 ! r ! <-- ! diffusivite thermique !
+! rcpt1d ! r ! <-- ! rocp !
+! dtpt1d ! tr ! <-- ! pas de temps !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "entsor.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer nfabor , nfpt1d
+integer iappel
+
+integer ifpt1d(nfpt1d) , nppt1d(nfpt1d) , iclt1d(nfpt1d)
+integer ia(*)
+
+double precision eppt1d(nfpt1d) , rgpt1d(nfpt1d)
+double precision xlmbt1(nfpt1d) , rcpt1d(nfpt1d) , dtpt1d(nfpt1d)
+double precision ra(*)
+
+! Variables locales
+integer idebia , idebra
+integer ii, ifac
+
+!===============================================================================
+
+
+idebia = idbia0
+idebra = idbra0
+
+
+if(iappel.eq.1) then
+
+ if ((nfpt1d.lt.0).or.(nfpt1d.gt.nfabor)) then
+ write(nfecra,1000)nfabor,nfpt1d
+ call csexit(1)
+ endif
+ if (isuit1.ne.0 .and. isuit1.ne.1) then
+ write(nfecra,1010)isuit1
+ call csexit(1)
+ endif
+
+else if (iappel.eq.2) then
+
+ do ii = 1, nfpt1d
+ if (ifpt1d(ii).lt.0 .or. ifpt1d(ii).gt.nfabor) then
+ write(nfecra,2000)nfabor,ii,ifpt1d(ii)
+ call csexit(1)
+ endif
+ enddo
+
+ do ii = 1, nfpt1d
+ ifac = ifpt1d(ii)
+ if (nppt1d(ii).le.0) then
+ write(nfecra,2010)ii,ifac,nppt1d(ii)
+ call csexit(1)
+ endif
+ if (eppt1d(ii).le.0.d0) then
+ WRITE(NFECRA,2020)'EPPT1D','EPPT1D',II,EPPT1D(II),IFAC
+ call csexit(1)
+ endif
+ if (rgpt1d(ii).le.0.d0) then
+ WRITE(NFECRA,2020)'RGPT1D','RGPT1D',II,RGPT1D(II),IFAC
+ call csexit(1)
+ endif
+ enddo
+
+else if (iappel.eq.3) then
+
+ do ii = 1, nfpt1d
+ ifac = ifpt1d(ii)
+ if (iclt1d(ii).ne.1 .and. iclt1d(ii).ne.3) then
+ WRITE(NFECRA,3000)'ICLT1D','ICLT1D',II,ICLT1D(II),IFAC
+ call csexit(1)
+ endif
+ if (xlmbt1(ii).le.0.d0) then
+ WRITE(NFECRA,2020)'XLMBT1','XLMBT1',II,XLMBT1(II),IFAC
+ call csexit(1)
+ endif
+ if (rcpt1d(ii).le.0.d0) then
+ WRITE(NFECRA,2020)'RCPT1D','RCPT1D',II,RCPT1D(II),IFAC
+ call csexit(1)
+ endif
+ if (dtpt1d(ii).le.0.d0) then
+ WRITE(NFECRA,2020)'DTPT1D','DTPT1D',II,DTPT1D(II),IFAC
+ call csexit(1)
+ endif
+ enddo
+
+endif
+
+!----
+! FORMATS
+!----
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE THERMIQUE 1D EN PAROI ',/,&
+'@ ',/,&
+'@ NFPT1D DOIT ETRE POSITIF ET INFERIEUR A NFABOR ',/,&
+'@ ON A ICI ',/,&
+'@ NFABOR=',I10 ,/,&
+'@ NFPT1D=',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE THERMIQUE 1D EN PAROI ',/,&
+'@ ',/,&
+'@ ISUIT1 DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE THERMIQUE 1D EN PAROI ',/,&
+'@ ',/,&
+'@ LE TABLEAU IFPT1D(II) DOIT RENVOYER A UN NUMERO DE FACE ',/,&
+'@ DE BORD',/,&
+'@ ON A ICI ',/,&
+'@ NFABOR =',I10 ,/,&
+'@ IFPT1D(',I10, ')=',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE THERMIQUE 1D EN PAROI ',/,&
+'@ ',/,&
+'@ LE TABLEAU NPPT1D(II) DOIT RENVOYER A UN ENTIER POSITIF ',/,&
+'@ ON A ICI ',/,&
+'@ NPPT1D(',I10, ')=',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE THERMIQUE 1D EN PAROI ',/,&
+'@ ',/,&
+'@ LE TABLEAU ',A6,' DOIT RENVOYER A UN REEL > 0 ',/,&
+'@ ON A ICI ',/,&
+'@ ',A6,'(',I10, ')=',E14.5 ,/,&
+'@ (FACE DE BORD NUMERO ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE THERMIQUE 1D EN PAROI ',/,&
+'@ ',/,&
+'@ LE TABLEAU ',A6,' NE PEUT CONTENIR QUE LES VALEURS ',/,&
+'@ 1 OU 3',/, &
+'@ ON A ICI ',/,&
+'@ ',A6,'(',I10, ')=',I10 ,/,&
+'@ (FACE DE BORD NUMERO ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ 1D-WALL THERMAL MODULE ',/,&
+'@ ',/,&
+'@ NFPT1D MUST BE POSITIVE AND LOWER THAN NFABOR ',/,&
+'@ ONE HAS HERE ',/,&
+'@ NFABOR=',I10 ,/,&
+'@ NFPT1D=',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ 1D-WALL THERMAL MODULE ',/,&
+'@ ',/,&
+'@ ISUIT1 MUST BE AN INTEGER EQUAL TO 0 OR 1 ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ 1D-WALL THERMAL MODULE ',/,&
+'@ ',/,&
+'@ THE ARRAY IFPT1D(II) MUST GIVE A BOUNDARY FACE NUMBER ',/,&
+'@ ONE HAS HERE ',/,&
+'@ NFABOR =',I10 ,/,&
+'@ IFPT1D(',I10, ')=',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ 1D-WALL THERMAL MODULE ',/,&
+'@ ',/,&
+'@ THE ARRAY NPPT1D(II) MUST GIVE A POSITIVE INTEGER ',/,&
+'@ ONE HAS HERE ',/,&
+'@ NPPT1D(',I10, ')=',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ 1D-WALL THERMAL MODULE ',/,&
+'@ ',/,&
+'@ THE ARRAY ',A6,' MUST GIVE A POSITIVE REAL ',/,&
+'@ ONE HAS HERE ',/,&
+'@ ',A6,'(',I10, ')=',E14.5 ,/,&
+'@ (BOUNDARY FACE NUMBER ',I10 ,') ',/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT DURING THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ 1D-WALL THERMAL MODULE ',/,&
+'@ ',/,&
+'@ THE ARRAY ',A6,' CAN ONLY TAKE THE VALUES 1 OR 3 ',/,&
+'@ ONE HAS HERE ',/,&
+'@ ',A6,'(',I10, ')=',I10 ,/,&
+'@ (BOUNDARY FACE NUMBER ',I10 ,') ',/,&
+'@ ',/,&
+'@ The calculation will not run. ',/,&
+'@ ',/,&
+'@ Verify uspt1d. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+return
+
+end
+
diff --git a/src/base/viscfa.f90 b/src/base/viscfa.f90
new file mode 100644
index 0000000..8845140
--- /dev/null
+++ b/src/base/viscfa.f90
@@ -0,0 +1,240 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine viscfa &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ vistot , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DE LA VITESSE DE DIFFUSION SUR LES FACETTES
+! VISCF,B = VISCOSITE*SURFACE/DISTANCE, HOMOGENE A UN DEBIT EN KG/S
+
+! RQE : A PRIORI, PAS BESOIN DE TECHNIQUE DE RECONSTRUCTION
+! ( A AMELIORER SI NECESSAIRE )
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! imvisf ! e ! <-- ! methode de calcul de la visc face !
+! ! ! ! = 0 arithmetique !
+! ! ! ! = 1 harmonique !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! vistot(ncelet ! tr ! <-- ! valeur de la viscosite !
+! viscf(nfac) ! tr ! --> ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --> ! visc*surface/dist aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+
+include "paramx.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse , imvisf
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision vistot(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ifac, ii, jj, idimte, itenso
+double precision visci, viscj, surfn, dist, pond
+
+!===============================================================================
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (vistot)
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ vistot , vistot , vistot, &
+ vistot , vistot , vistot, &
+ vistot , vistot , vistot )
+endif
+
+
+if( imvisf.eq.0 ) then
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ visci = vistot(ii)
+ viscj = vistot(jj)
+ surfn = ra(isrfan-1+ifac)
+ dist = ra(idist-1+ifac)
+
+ viscf(ifac) = 0.5d0*( visci +viscj )*surfn/dist
+
+ enddo
+
+else
+
+ do ifac = 1,nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ visci = vistot(ii)
+ viscj = vistot(jj)
+ surfn = ra(isrfan-1+ifac)
+ dist = ra(idist-1+ifac)
+ pond = ra(ipond-1+ifac)
+
+ viscf(ifac) = &
+ visci*viscj / (pond*visci+(1.d0-pond)*viscj) * surfn/dist
+
+ enddo
+
+endif
+
+do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+ surfn = ra(isrfbn-1+ifac)
+ dist = ra(idistb-1+ifac)
+
+ viscb(ifac) = vistot(ii)*surfn/dist
+
+enddo
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/visdyn.f90 b/src/base/visdyn.f90
new file mode 100644
index 0000000..e6f55be
--- /dev/null
+++ b/src/base/visdyn.f90
@@ -0,0 +1,738 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine visdyn &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smagor , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , w9 , w10 , xmij , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA VISCOSITE "TURBULENTE" POUR
+! UN MODELE LES SMAGORINSKI DYNAMIQUE
+
+! SMAGO = LijMij/MijMij
+
+! PROPCE(1,IVISCT(IPHAS)) = ROM * SMAGO * L**2 * SQRT ( 2 * Sij.Sij )
+! Sij = (DUi/Dxj + DUj/Dxi)/2
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smagor(ncelet ! tr ! <-- ! constante de smagorinsky dans le cas !
+! , nphas) ! ! ! d'un modlele dynamique !
+! w1..10(ncelet ! tr ! --- ! tableau de travail !
+! xmij(ncelet,6 ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smagor(ncelet)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision w9(ncelet),w10(ncelet),xmij(ncelet,6)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ii, iel, iccocg, inc
+integer iuiph, iviph, iwiph
+integer ipcliu, ipcliv, ipcliw
+integer ipcrom, ipcvst, iphydp
+integer iclipc
+integer idimte, itenso
+double precision coef, radeux, deux, delta, deltaf
+double precision s11, s22, s33, s11f, s22f, s33f
+double precision dudy, dudz, dvdx, dvdz, dwdx, dwdy
+double precision dudyf, dudzf, dvdxf, dvdzf, dwdxf, dwdyf
+double precision xfil, xa, xb, xfil2, xsmgmx
+double precision aij, bij
+double precision xl11, xl22, xl33, xl12, xl13, xl23
+double precision xm11, xm22, xm33, xm12, xm13, xm23
+double precision smagma, smagmn, smagmy
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables (dans RTP)
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+! --- Rang des variables dans PROPCE (prop. physiques au centre)
+ipcvst = ipproc(ivisct(iphas))
+ipcrom = ipproc(irom (iphas))
+
+! --- Rang des c.l. des variables dans COEFA COEFB
+! (c.l. std, i.e. non flux)
+ipcliu = iclrtp(iuiph,icoef)
+ipcliv = iclrtp(iviph,icoef)
+ipcliw = iclrtp(iwiph,icoef)
+
+! --- Pour le calcul de la viscosite de sous-maille
+xfil = xlesfl(iphas)
+xfil2 = xlesfd(iphas)
+xa = ales(iphas)
+xb = bles(iphas)
+deux = 2.d0
+radeux = sqrt(deux)
+xsmgmx = smagmx(iphas)
+
+!===============================================================================
+! 2. CALCUL DES GRADIENTS DE VITESSE ET DE
+! S11**2+S22**2+S33**2+2*(S12**2+S13**2+S23**2)
+!===============================================================================
+
+! Les RTPA ont ete echange pour les calculs en parallele,
+! au debut du pas de temps (donc pas utile de le refaire ici)
+
+iccocg = 1
+inc = 1
+iphydp = 0
+
+! W1 = DUDX, W2 = DUDY, W3=DUDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , &
+ nswrgr(iuiph) , imligr(iuiph) , iphydp , iwarni(iuiph) , &
+ nfecra , epsrgr(iuiph) , climgr(iuiph) , extrag(iuiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iuiph) , coefa(1,ipcliu) , coefb(1,ipcliu) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+! Filtrage de W1, LE RESULTAT EST DANS W6
+
+call cfiltr &
+!==========
+ ( w1 , w6 , w7 , w8 )
+
+do iel = 1, ncel
+ s11 = w1(iel)
+ s11f = w6(iel)
+ xmij(iel,1) = s11
+ propce(iel,ipcvst) = s11**2
+ w9(iel) = s11f**2
+enddo
+
+
+! W2 = DUDY, W3=DUDZ
+! W4 = DVDX, W1 = DVDY, W5=DVDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , &
+ nswrgr(iviph) , imligr(iviph) , iphydp , iwarni(iviph) , &
+ nfecra , epsrgr(iviph) , climgr(iviph) , extrag(iviph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iviph) , coefa(1,ipcliv) , coefb(1,ipcliv) , &
+ w4 , w1 , w5 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+call cfiltr &
+!==========
+ ( w1 , w6 , w7 , w8 )
+
+do iel = 1, ncel
+ s22 = w1(iel)
+ s22f = w6(iel)
+ xmij(iel,2) = s22
+ propce(iel,ipcvst) = propce(iel,ipcvst) + s22**2
+ w9(iel) = w9(iel) + s22f**2
+enddo
+
+call cfiltr &
+!==========
+ ( w2 , w6 , w8 , w1 )
+
+call cfiltr &
+!==========
+ ( w4 , w7 , w8 , w1 )
+
+do iel = 1, ncel
+ dudy = w2(iel)
+ dvdx = w4(iel)
+ dudyf = w6(iel)
+ dvdxf = w7(iel)
+ xmij(iel,4) = 0.5d0*(dudy+dvdx)
+ propce(iel,ipcvst) = propce(iel,ipcvst) + 0.5d0*(dudy+dvdx)**2
+ w9(iel) = w9(iel) + 0.5d0*(dudyf+dvdxf)**2
+enddo
+
+! W3=DUDZ
+! W5=DVDZ
+! W2 = DWDX, W4 = DWDY, W1=DWDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , &
+ nswrgr(iwiph) , imligr(iwiph) , iphydp , iwarni(iwiph) , &
+ nfecra , epsrgr(iwiph) , climgr(iwiph) , extrag(iwiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iwiph) , coefa(1,ipcliw) , coefb(1,ipcliw) , &
+ w2 , w4 , w1 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+call cfiltr &
+!==========
+ ( w1 , w6 , w7 , w8 )
+
+do iel = 1, ncel
+ s33 = w1(iel)
+ s33f = w6(iel)
+ xmij(iel,3) = s33
+ propce(iel,ipcvst) = propce(iel,ipcvst) + s33**2
+ w9(iel) = w9(iel) + s33f**2
+enddo
+
+call cfiltr &
+!==========
+ ( w2 , w1 , w7 , w8 )
+
+call cfiltr &
+!==========
+ ( w3 , w6 , w7 , w8 )
+
+do iel = 1, ncel
+ dudz = w3(iel)
+ dwdx = w2(iel)
+ dudzf = w6(iel)
+ dwdxf = w1(iel)
+ xmij(iel,5) = 0.5d0*(dudz+dwdx)
+ propce(iel,ipcvst) = &
+ propce(iel,ipcvst) + 0.5d0*(dudz+dwdx)**2
+ w9(iel) = w9(iel) + 0.5d0*(dudzf+dwdxf)**2
+enddo
+
+call cfiltr &
+!==========
+ ( w4 , w1 , w7 , w8 )
+
+call cfiltr &
+!==========
+ ( w5 , w6 , w7 , w8 )
+
+do iel = 1, ncel
+ dvdz = w5(iel)
+ dwdy = w4(iel)
+ dvdzf = w6(iel)
+ dwdyf = w1(iel)
+ xmij(iel,6) = 0.5d0*(dvdz+dwdy)
+ propce(iel,ipcvst) = &
+ propce(iel,ipcvst) + 0.5d0*(dvdz+dwdy)**2
+ w9(iel) = w9(iel) + 0.5d0*(dvdzf+dwdyf)**2
+enddo
+
+do iel = 1, ncel
+ propce(iel,ipcvst) = radeux*sqrt(propce(iel,ipcvst))
+ w9(iel) = radeux*sqrt(w9(iel) )
+enddo
+
+! Ici XMIJ contient Sij
+! PROPCE(IEL,IPCVST) contient ||S||
+! SQRT(2)*SQRT(S11^2+S22^2+S33^2+2(S12^2+S13^2+S23^2))
+! W9 contient ||SF||
+! SQRT(2)*SQRT(S11F^2+S22F^2+S33F^2+2(S12F^2+S13F^2+S23F^2))
+
+!===============================================================================
+! 3. CALCUL DE Mij
+!===============================================================================
+
+do iel = 1, ncel
+ w7(iel) = xfil *(xa*volume(iel))**xb
+enddo
+
+do ii = 1, 6
+
+ call cfiltr &
+ !==========
+ ( xmij(1,ii) , w1 , w2 , w3 )
+
+ do iel = 1, ncel
+ delta = w7(iel)
+ w2(iel) = -deux*delta**2*propce(iel,ipcvst)*xmij(iel,ii)
+ enddo
+
+ call cfiltr &
+ !==========
+ ( w2 , w3 , w4 , w5 )
+
+ do iel = 1, ncel
+ delta = w7(iel)
+ deltaf = xfil2*delta
+ aij = -deux*deltaf**2*w9(iel)*w1(iel)
+ bij = w3(iel)
+ xmij(iel,ii) = aij - bij
+ enddo
+
+enddo
+
+! Ici Aij contient alpha_ij, Bij contient beta_ij tilde
+! et XMIJ contient M_ij
+
+!===============================================================================
+! 4. CALCUL DE LA CONSTANTE DE SMAGORINSKY DYNAMIQUE
+!===============================================================================
+
+! FILTRAGE DE LA VITESSE ET DE SON CARRE
+
+
+! U**2
+do iel = 1,ncel
+ w9(iel) = rtp(iel,iuiph)*rtp(iel,iuiph)
+enddo
+call cfiltr &
+!==========
+ ( w9 , w1 , w7 , w8 )
+
+! V**2
+do iel = 1,ncel
+ w9(iel) = rtp(iel,iviph)*rtp(iel,iviph)
+enddo
+call cfiltr &
+!==========
+ ( w9 , w2 , w7 , w8 )
+
+! W**2
+do iel = 1,ncel
+ w9(iel) = rtp(iel,iwiph)*rtp(iel,iwiph)
+enddo
+call cfiltr &
+!==========
+ ( w9 , w3 , w7 , w8 )
+
+! UV
+do iel = 1,ncel
+ w9(iel) = rtp(iel,iuiph)*rtp(iel,iviph)
+enddo
+call cfiltr &
+!==========
+ ( w9 , w4 , w7 , w8 )
+
+! UW
+do iel = 1,ncel
+ w9(iel) = rtp(iel,iuiph)*rtp(iel,iwiph)
+enddo
+call cfiltr &
+!==========
+ ( w9 , w5 , w7 , w8 )
+
+! VW
+do iel = 1,ncel
+ w9(iel) = rtp(iel,iviph)*rtp(iel,iwiph)
+enddo
+call cfiltr &
+!==========
+ ( w9 , w6 , w7 , w8 )
+
+! U
+call cfiltr &
+!==========
+ ( rtp(1,iuiph) , w7 , w8 , w9 )
+
+! V
+call cfiltr &
+!==========
+ ( rtp(1,iviph) , w8 , w9 , smagor )
+
+! W
+call cfiltr &
+!==========
+ ( rtp(1,iwiph) , w9 , smagor , w10 )
+
+do iel = 1, ncel
+
+! --- Calcul de Lij
+ xl11 = w1(iel) - w7(iel) * w7(iel)
+ xl22 = w2(iel) - w8(iel) * w8(iel)
+ xl33 = w3(iel) - w9(iel) * w9(iel)
+ xl12 = w4(iel) - w7(iel) * w8(iel)
+ xl13 = w5(iel) - w7(iel) * w9(iel)
+ xl23 = w6(iel) - w8(iel) * w9(iel)
+
+ xm11 = xmij(iel,1)
+ xm22 = xmij(iel,2)
+ xm33 = xmij(iel,3)
+ xm12 = xmij(iel,4)
+ xm13 = xmij(iel,5)
+ xm23 = xmij(iel,6)
+! ---Calcul de Mij :: Lij
+ w1(iel) = xm11 * xl11 + 2.d0* xm12 * xl12 + 2.d0* xm13 * xl13 + &
+ xm22 * xl22 + 2.d0* xm23 * xl23 + &
+ xm33 * xl33
+! ---Calcul de Mij :: Mij
+ w2(iel) = xm11 * xm11 + 2.d0* xm12 * xm12 + 2.d0* xm13 * xm13 + &
+ xm22 * xm22 + 2.d0* xm23 * xm23 + &
+ xm33 * xm33
+
+enddo
+
+if(irangp.ge.0) then
+ call parcom(w1)
+ call parcom(w2)
+endif
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w1 , w1 , w1 , &
+ w1 , w1 , w1 , &
+ w1 , w1 , w1 )
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w2 , w2 , w2 , &
+ w2 , w2 , w2 , &
+ w2 , w2 , w2 )
+endif
+
+! Par defaut on fait une moyenne locale du numerateur et du
+! denominateur, puis seulement on fait le rapport.
+! L'utilisateur peut faire autrement dans USSMAG
+
+call cfiltr &
+!==========
+ ( w1 , w3 , w5 , w6 )
+
+call cfiltr &
+!==========
+ ( w2 , w4 , w5 , w6 )
+
+do iel = 1, ncel
+ if(abs(w4(iel)).le.epzero) then
+ smagor(iel) = xsmgmx**2
+ else
+ smagor(iel) = w3(iel)/w4(iel)
+ endif
+enddo
+
+call ussmag &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smagor , w1 , w2 , &
+ w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+iclipc = 0
+do iel = 1, ncel
+ if(smagor(iel).ge.xsmgmx**2) then
+ smagor(iel) = xsmgmx**2
+ iclipc = iclipc + 1
+ elseif(smagor(iel).le.-xsmgmx**2) then
+ smagor(iel) = -xsmgmx**2
+ iclipc = iclipc + 1
+ endif
+enddo
+
+!===============================================================================
+! 3. CALCUL DE LA VISCOSITE (DYNAMIQUE)
+!===============================================================================
+
+! On clippe en (mu + mu_t)>0 dans phyvar
+
+do iel = 1, ncel
+ coef = smagor(iel)
+ delta = xfil * (xa*volume(iel))**xb
+ propce(iel,ipcvst) = propce(iel,ipcrom) &
+ * coef * delta**2 * propce(iel,ipcvst)
+enddo
+
+! Quelques impressions
+if(iwarni(iuiph).ge.1) then
+
+ smagma = -1.0d12
+ smagmn = 1.0d12
+ smagmy = 0.d0
+ do iel = 1, ncel
+ smagma = max(smagma,smagor(iel))
+ smagmn = min(smagmn,smagor(iel))
+ smagmy = smagmy + smagor(iel)*volume(iel)
+ enddo
+ if(irangp.ge.0) then
+ call parmax(smagma)
+ !==========
+ call parmin(smagmn)
+ !==========
+ call parsom(smagmy)
+ !==========
+ call parcpt(iclipc)
+ !==========
+ endif
+ smagmy = smagmy / voltot
+ write(nfecra,1000) iclipc
+ write(nfecra,2001) iphas
+ write(nfecra,2002) smagma, smagmn, smagmy
+ write(nfecra,2003)
+
+endif
+
+!----
+! FORMAT
+!----
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' Nb Clipping Constante Smagorinsky par valeurs maximales ',I10,/)
+ 2001 format( &
+' --- Phase : ',I10 ,/,&
+' --- Informations sur la constante de Smagorinsky^2 ',/,&
+' ---------------------------------- ',/,&
+' Valeur moy Valeur min Valeur max ',/,&
+' ---------------------------------- ' )
+ 2002 format( &
+ e12.4 , e12.4, e12.4 )
+ 2003 format( &
+' ---------------------------------- ',/)
+
+#else
+
+ 1000 format( &
+' Nb of clipping of the Smagorinsky constant by max values',I10,/)
+ 2001 format( &
+' --- Phase: ',I10 ,/,&
+' --- Informations on the squared Smagorinsky constant' ,/,&
+' --------------------------------' ,/,&
+' Mean value Min value Max value' ,/,&
+' --------------------------------' )
+ 2002 format( &
+ e12.4 , e12.4, e12.4 )
+ 2003 format( &
+' --------------------------------' ,/)
+
+#endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/vislmg.f90 b/src/base/vislmg.f90
new file mode 100644
index 0000000..160a255
--- /dev/null
+++ b/src/base/vislmg.f90
@@ -0,0 +1,369 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vislmg &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA VISCOSITE TURBULENTE POUR
+! UN MODELE DE LONGUEUR DE MELANGE SIMPLE
+
+! VISCT = ROM * (XKAPPA * L) **2 * SQRT ( 2 * Sij.Sij )
+! Sij = (DUi/Dxj + DUj/Dxi)/2
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iccocg, inc, iphydp
+integer iuiph, iviph, iwiph
+integer ipcliu, ipcliv, ipcliw
+integer ipcrom, ipcvst
+double precision coef, deux
+double precision s11, s22, s33
+double precision dudy, dudz, dvdx, dvdz, dwdx, dwdy
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables (dans RTP)
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+! --- Rang des variables dans PROPCE (prop. physiques au centre)
+ipcvst = ipproc(ivisct(iphas))
+ipcrom = ipproc(irom (iphas))
+
+! --- Rang des c.l. des variables dans COEFA COEFB
+! (c.l. std, i.e. non flux)
+ipcliu = iclrtp(iuiph,icoef)
+ipcliv = iclrtp(iviph,icoef)
+ipcliw = iclrtp(iwiph,icoef)
+
+!===============================================================================
+! 2. CALCUL DES GRADIENTS DE VITESSE ET DE
+! S11**2+S22**2+S33**2+2*(S12**2+S13**2+S23**2)
+!===============================================================================
+
+iccocg = 1
+inc = 1
+iphydp = 0
+
+! W1 = DUDX, W2 = DUDY, W3=DUDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , &
+ nswrgr(iuiph) , imligr(iuiph) , iphydp , iwarni(iuiph) , &
+ nfecra , epsrgr(iuiph) , climgr(iuiph) , extrag(iuiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iuiph) , coefa(1,ipcliu) , coefb(1,ipcliu) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ s11 = w1(iel)
+ propce(iel,ipcvst) = s11**2
+enddo
+
+
+! W2 = DUDY, W3=DUDZ
+! W4 = DVDX, W1 = DVDY, W5=DVDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr ,nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , &
+ nswrgr(iviph) , imligr(iviph) , iphydp , iwarni(iviph) , &
+ nfecra , epsrgr(iviph) , climgr(iviph) , extrag(iviph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iviph) , coefa(1,ipcliv) , coefb(1,ipcliv) , &
+ w4 , w1 , w5 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ s22 = w1(iel)
+ propce(iel,ipcvst) = propce(iel,ipcvst) + s22**2
+enddo
+do iel = 1, ncel
+ dudy = w2(iel)
+ dvdx = w4(iel)
+ propce(iel,ipcvst) = propce(iel,ipcvst) + 0.5d0*(dudy+dvdx)**2
+enddo
+
+
+! W3=DUDZ
+! W1 = DVDY, W5=DVDZ
+! W2 = DWDX, W4 = DWDY, W1=DWDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr ,nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , &
+ nswrgr(iwiph) , imligr(iwiph) , iphydp , iwarni(iwiph) , &
+ nfecra , epsrgr(iwiph) , climgr(iwiph) , extrag(iwiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iwiph) , coefa(1,ipcliw) , coefb(1,ipcliw) , &
+ w2 , w4 , w1 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ s33 = w1(iel)
+ propce(iel,ipcvst) = propce(iel,ipcvst) + s33**2
+enddo
+do iel = 1, ncel
+ dudz = w3(iel)
+ dwdx = w2(iel)
+ dvdz = w5(iel)
+ dwdy = w4(iel)
+ propce(iel,ipcvst) = &
+ propce(iel,ipcvst) + 0.5d0*((dudz+dwdx)**2+(dvdz+dwdy)**2)
+enddo
+
+
+!===============================================================================
+! 3. CALCUL DE LA VISCOSITE (DYNAMIQUE)
+!===============================================================================
+
+deux = 2.d0
+coef = (xkappa*xlomlg(iphas))**2 * sqrt(deux)
+
+do iel = 1, ncel
+ propce(iel,ipcvst) = &
+ propce(iel,ipcrom) * coef * sqrt(propce(iel,ipcvst))
+enddo
+
+
+!----
+! FORMAT
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/visort.f90 b/src/base/visort.f90
new file mode 100644
index 0000000..e19eab8
--- /dev/null
+++ b/src/base/visort.f90
@@ -0,0 +1,293 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine visort &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w2 , w3 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DE LA VITESSE DE DIFFUSION "ORTHOTROPE"
+! VISCF,B = VISCOSITE*SURFACE/DISTANCE, HOMOGENE A UN DEBIT EN KG/S
+
+! =
+! (NX**2*VISC11_MOY_FACE
+! +NY**2*VISC22_MOY_FACE+NZ**2*VISC33_MOY_FACE)*SURFACE/DISTANCE
+
+! LA VISCOSITE EST DONNE PAR W1, W2, W3
+
+! RQE : A PRIORI, PAS BESOIN DE TECHNIQUE DE RECONSTRUCTION
+! ( A AMELIORER SI NECESSAIRE )
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! imvisf ! e ! <-- ! methode de calcul de la visc face !
+! ! ! ! = 0 arithmetique !
+! ! ! ! = 1 harmonique !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! w1,2,3(ncelet ! tr ! <-- ! valeurs de la viscosite !
+! viscf(nfac) ! tr ! --> ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --> ! visc*surface/dist aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse , imvisf
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ifac, ii, jj
+integer idimte, itenso
+double precision viscxi, viscxj, viscyi, viscyj, visczi, visczj
+double precision sx2, sy2, sz2, dist, pond, surfn
+
+!===============================================================================
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (w1)
+ !==========
+ call parcom (w2)
+ !==========
+ call parcom (w3)
+ !==========
+endif
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 21
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w1 , w1 , w1 , &
+ w2 , w2 , w2 , &
+ w3 , w3 , w3 )
+endif
+
+
+if( imvisf.eq.0 ) then
+
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ surfn = ra(isrfan-1+ifac)
+ dist = ra(idist -1+ifac)
+
+ viscxi = w1(ii)
+ viscxj = w1(jj)
+ viscyi = w2(ii)
+ viscyj = w2(jj)
+ visczi = w3(ii)
+ visczj = w3(jj)
+
+ sx2 = surfac(1,ifac)**2
+ sy2 = surfac(2,ifac)**2
+ sz2 = surfac(3,ifac)**2
+
+ viscf(ifac) = 0.5d0*( &
+ (viscxi+viscxj)*sx2 &
+ + (viscyi+viscyj)*sy2 &
+ + (visczi+visczj)*sz2 ) / (surfn*dist)
+
+ enddo
+
+else
+
+ do ifac = 1,nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ surfn = ra(isrfan-1+ifac)
+ dist = ra(idist -1+ifac)
+ pond = ra(ipond -1+ifac)
+
+ viscxi = w1(ii)
+ viscxj = w1(jj)
+ viscyi = w2(ii)
+ viscyj = w2(jj)
+ visczi = w3(ii)
+ visczj = w3(jj)
+
+ sx2 = surfac(1,ifac)**2
+ sy2 = surfac(2,ifac)**2
+ sz2 = surfac(3,ifac)**2
+
+ viscf(ifac) = &
+ ( viscxi*viscxj*sx2 &
+ /(pond*viscxi+(1.d0-pond)*viscxj) &
+ + viscyi*viscyj*sy2 &
+ /(pond*viscyi+(1.d0-pond)*viscyj) &
+ + visczi*visczj*sz2 &
+ /(pond*visczi+(1.d0-pond)*visczj) &
+ ) /(surfn*dist)
+ enddo
+
+endif
+
+do ifac=1,nfabor
+
+ ii = ifabor(ifac)
+
+ surfn = ra(isrfbn-1+ifac)
+ dist = ra(idistb-1+ifac)
+
+ viscxi = w1(ii)
+ viscyi = w2(ii)
+ visczi = w3(ii)
+
+ sx2 = surfbo(1,ifac)**2
+ sy2 = surfbo(2,ifac)**2
+ sz2 = surfbo(3,ifac)**2
+
+ viscb(ifac) = &
+ (viscxi*sx2+viscyi*sy2+visczi*sz2)/(surfn*dist)
+
+enddo
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/base/vissec.f90 b/src/base/vissec.f90
new file mode 100644
index 0000000..4ac5690
--- /dev/null
+++ b/src/base/vissec.f90
@@ -0,0 +1,616 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vissec &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ trav , &
+ viscf , viscb , vistot , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! AJOUT AU SECOND MEMBRE DES TERMES
+
+! GRAD( (K -2/3 MU) DIV(U) ) + DIV( MU (GRAD_TRANSPOSE(U)) )
+
+! AVEC MU = MU_LAMINAIRE + MU_TURBULENT
+! ET K = VISCOSITE EN VOLUME (NULLE EN GENERAL)
+
+! DIV(U) EST CALCULE A PARTIR DE FLUMAS/RHO
+! GRAD_TRANSPOSE(U) EST UN GRADIENT CELLULE
+
+! REMARQUES :
+! - Theoriquement le terme en div(u) devrait plutot etre calcule
+! par un gradient cellule, pour correspondre exactement au
+! terme en dUj/dxi. Mais comme la partie en dUi/dxj est
+! calculee completement autrement (gradient facette et implicitation)
+! de toute facon on n'aura jamais Trace(tau_ij)=0 exactement.
+! - Pour la meme raison, comme le terme en dUi/dxj est calcule sur les
+! elements de bord et pas celui en dUj/dxi, il est difficile de
+! traiter le terme en div(u) de maniere rigoureuse. Il est donc
+! conserve sur les elements de bord.
+! - En LES, le tenseur <(u-<u>)(u-<u>)> est modelise par mut <S>
+! et non pas par mut <S> - 2/3 mut Tr(<S>) Id + 2/3 k Id
+! de sorte que il n'apparait pas ici de mut div<u>
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! phase courante !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! trav(ncelet,3 ! tr ! <-- ! tableau de travail pour sec mem !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! vistot(ncelet ! tr ! --- ! tableau de travail pour mu !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "cstphy.h"
+include "entsor.h"
+include "numvar.h"
+include "optcal.h"
+include "vector.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision trav(ncelet,3)
+double precision viscf(nfac), viscb(nfabor)
+double precision vistot(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iccocg, inc, iel, ifac, ivar, isou, ii, jj, init
+integer idim
+integer iuiph, iviph, iwiph
+integer iclvar
+integer nswrgp, imligp, iwarnp
+integer ipcrom, ipbrom, ipcvis, ipcvst, iflmas, iflmab
+integer idimte, itenso, iphydp
+integer ipcvsv
+
+double precision epsrgp, climgp, extrap
+double precision romf, d2s3m, vecfac
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+
+if(ippmod(icompf).ge.0) then
+ if(iviscv(iphas).gt.0) then
+ ipcvsv = ipproc(iviscv(iphas))
+ else
+ ipcvsv = 0
+ endif
+else
+ ipcvsv = -1
+endif
+
+
+iflmas = ipprof(ifluma(iuiph))
+
+ipbrom = ipprob(irom (iphas))
+iflmab = ipprob(ifluma(iuiph))
+
+
+! Si on extrapole les termes sources, on prend les prop a l'instant n
+if(isno2t(iphas).gt.0) then
+ if(iroext(iphas).gt.0) then
+ ipcrom = ipproc(iroma (iphas))
+ ipbrom = ipprob(iroma (iphas))
+ endif
+ if(iviext(iphas).gt.0) then
+ ipcvis = ipproc(ivisla(iphas))
+ ipcvst = ipproc(ivista(iphas))
+ endif
+! Il faudrait aussi faire quelque chose pour le flux de masse, non ?
+endif
+
+! --- Calcul de la viscosite totale
+
+if (itytur(iphas).eq.3) then
+ do iel = 1, ncel
+ vistot(iel) = propce(iel,ipcvis)
+ enddo
+else
+ do iel = 1, ncel
+ vistot(iel) = propce(iel,ipcvis) + propce(iel,ipcvst)
+ enddo
+endif
+
+! Pour la periodicite de rotation, il faut avoir calcule
+! le gradient avec grdcel. La seule solution consiste donc a
+! echanger VISTOT puis a faire le produit, y compris sur les
+! cellules halo (calcul sur le halo, exceptionnellement).
+! Pour le parallelisme, on s'aligne sur la sequence ainsi definie.
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (vistot)
+ !==========
+endif
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+( idimte , itenso , &
+ vistot , vistot , vistot , &
+ vistot , vistot , vistot , &
+ vistot , vistot , vistot )
+endif
+
+
+!===============================================================================
+! 2. CALCUL DES TERMES EN GRAD_TRANSPOSE
+!===============================================================================
+
+do isou = 1, 3
+
+ if (isou.eq.1) ivar = iuiph
+ if (isou.eq.2) ivar = iviph
+ if (isou.eq.3) ivar = iwiph
+
+! Ceci pointe eventuellement sur ICLRTP(IVAR,ICOEF)
+ iclvar = iclrtp(ivar,icoeff)
+
+! --- Calcul du gradient de la vitesse
+
+ iccocg = 1
+ inc = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w4 , w4 , w4 , &
+ rtpa(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do iel = 1, ncelet
+ w6(iel) = 1.d0
+ enddo
+ do ifac = 1, nfabor
+ w6(ifabor(ifac)) = 0.d0
+ enddo
+
+! --- Assemblage sur les faces internes
+
+ do idim = 1, 3
+
+! On a echange le gradient dans grdcel et vistot plus haut
+
+ if(idim.eq.1) then
+ do iel = 1, ncelet
+ w4(iel) = vistot(iel)*w1(iel)
+ enddo
+ elseif(idim.eq.2) then
+ do iel = 1, ncelet
+ w4(iel) = vistot(iel)*w2(iel)
+ enddo
+ elseif(idim.eq.3) then
+ do iel = 1, ncelet
+ w4(iel) = vistot(iel)*w3(iel)
+ enddo
+ endif
+
+
+
+
+! On initialise TRAV(NCEL+1, NCELET)
+! (valeur bidon, mais pas NaN : les calculs sur le halo sont
+! par principe denue de sens, sauf exception)
+ if(ncelet.gt.ncel) then
+ do iel = ncel+1, ncelet
+ trav(iel,idim) = 0.d0
+ enddo
+ endif
+
+
+
+ if(ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+!MO VECFAC = SURFAC(ISOU,IFAC)
+!MO & *(POND(IFAC)*W4(II)+(1.D0-POND(IFAC))*W4(JJ))
+ vecfac = surfac(isou,ifac)*(w4(ii)+w4(jj))*0.5d0
+ trav(ii,idim) = trav(ii,idim) + vecfac*w6(ii)
+ trav(jj,idim) = trav(jj,idim) - vecfac*w6(jj)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+!MO VECFAC = SURFAC(ISOU,IFAC)
+!MO & *(POND(IFAC)*W4(II)+(1.D0-POND(IFAC))*W4(JJ))
+ vecfac = surfac(isou,ifac)*(w4(ii)+w4(jj))*0.5d0
+ trav(ii,idim) = trav(ii,idim) + vecfac*w6(ii)
+ trav(jj,idim) = trav(jj,idim) - vecfac*w6(jj)
+ enddo
+
+ endif
+
+
+! --- Assemblage sur les faces de bord
+
+!MO IF(IVECTB.EQ.1) THEN
+!MOC
+!MO!CDIR NODEP
+!MO DO IFAC = 1, NFABOR
+!MO II = IFABOR(IFAC)
+!MO TRAV(II,IDIM) = TRAV(II,IDIM) + SURFBO(ISOU,IFAC)*W4(II)
+!MO ENDDO
+!MOC
+!MO ELSE
+!MOC
+!MOC VECTORISATION NON FORCEE
+!MO DO IFAC = 1, NFABOR
+!MO II = IFABOR(IFAC)
+!MO TRAV(II,IDIM) = TRAV(II,IDIM) + SURFBO(ISOU,IFAC)*W4(II)
+!MO ENDDO
+!MOC
+!MO ENDIF
+
+ enddo
+
+enddo
+
+!===============================================================================
+! 3. CALCUL DES TERMES EN DIV
+!===============================================================================
+! Pour periodicite et parallelisme, ROM est echange dans phyvar.
+! ou apres avoir ete calcule dans cfmsvl en compressible
+
+! Ici pour l'ordre 2 en temps, il faudrait tout prendre en n...
+
+
+do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+!MO ROMF = POND(IFAC)*PROPCE(II,IPCROM)
+!MO & + (1.D0-POND(IFAC))*PROPCE(JJ,IPCROM)
+ romf = (propce(ii,ipcrom)+propce(jj,ipcrom))*0.5d0
+ viscf(ifac) = propfa(ifac,iflmas)/romf
+enddo
+do ifac = 1, nfabor
+ viscb(ifac) = propfb(ifac,iflmab)/propfb(ifac,ipbrom)
+enddo
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf ,viscb ,w1)
+
+d2s3m = -2.d0/3.d0
+
+
+if(ipcvsv.gt.0) then
+ do iel = 1, ncel
+ w4(iel) = ( propce(iel,ipcvsv) + d2s3m*vistot(iel) ) &
+ * w1(iel)/volume(iel)
+ enddo
+elseif(ipcvsv.eq.0) then
+ do iel = 1, ncel
+ w4(iel) = ( viscv0(iphas) + d2s3m*vistot(iel) ) &
+ * w1(iel)/volume(iel)
+ enddo
+else
+
+ if( itytur(iphas).eq.4) then
+ do iel = 1, ncel
+ w4(iel) = d2s3m*propce(iel,ipcvis)*w1(iel)/volume(iel)
+ enddo
+ else
+ do iel = 1, ncel
+ w4(iel) = d2s3m*vistot(iel)*w1(iel)/volume(iel)
+ enddo
+ endif
+endif
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (w4)
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w4 , w4 , w4 , &
+ w4 , w4 , w4 , &
+ w4 , w4 , w4 )
+endif
+
+
+do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+!MO VISCF (IFAC) = (POND(IFAC)*W4(II)+(1.D0-POND(IFAC))*W4(JJ))
+ viscf (ifac) = (w4(ii)+w4(jj))*0.5d0
+enddo
+
+do isou = 1, 3
+
+ idim = isou
+
+
+! --- Assemblage sur les faces internes
+
+ if(ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vecfac = surfac(isou,ifac)*viscf(ifac)
+ trav(ii,idim) = trav(ii,idim) + vecfac
+ trav(jj,idim) = trav(jj,idim) - vecfac
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ vecfac = surfac(isou,ifac)*viscf(ifac)
+ trav(ii,idim) = trav(ii,idim) + vecfac
+ trav(jj,idim) = trav(jj,idim) - vecfac
+ enddo
+
+ endif
+
+
+! --- Assemblage sur les faces de bord
+
+ if(ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ trav(ii,idim) = trav(ii,idim) + surfbo(isou,ifac)*w4(ii)
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ trav(ii,idim) = trav(ii,idim) + surfbo(isou,ifac)*w4(ii)
+ enddo
+
+ endif
+
+! --- Calcul des efforts aux bords (partie 4/5)
+
+ if (ineedf.eq.1) then
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ ra(iforbr+(ifac-1)*ndim+isou-1) = &
+ ra(iforbr+(ifac-1)*ndim+isou-1) &
+ + surfbo(isou,ifac)*w4(ii)
+ enddo
+ endif
+
+enddo
+
+
+return
+
+end
diff --git a/src/base/vissma.f90 b/src/base/vissma.f90
new file mode 100644
index 0000000..d591687
--- /dev/null
+++ b/src/base/vissma.f90
@@ -0,0 +1,377 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vissma &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA VISCOSITE "TURBULENTE" POUR
+! UN MODELE LES SMAGORINSKI
+
+! PROPCE(1,IVISCT(IPHAS)) = ROM * (SMAGO * L) **2 * SQRT ( 2 * Sij.Sij )
+! Sij = (DUi/Dxj + DUj/Dxi)/2
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iccocg, inc
+integer iuiph, iviph, iwiph
+integer ipcliu, ipcliv, ipcliw
+integer ipcrom, ipcvst, iphydp
+double precision coef, deux, delta
+double precision s11, s22, s33
+double precision dudy, dudz, dvdx, dvdz, dwdx, dwdy
+double precision xfil, xa , xb , radeux
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables (dans RTP)
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+! --- Rang des variables dans PROPCE (prop. physiques au centre)
+ipcvst = ipproc(ivisct(iphas))
+ipcrom = ipproc(irom (iphas))
+
+! --- Rang des c.l. des variables dans COEFA COEFB
+! (c.l. std, i.e. non flux)
+ipcliu = iclrtp(iuiph,icoef)
+ipcliv = iclrtp(iviph,icoef)
+ipcliw = iclrtp(iwiph,icoef)
+! --- Pour le calcul de la viscosite de sous-maille
+xfil = xlesfl(iphas)
+xa = ales(iphas)
+xb = bles(iphas)
+deux = 2.d0
+radeux = sqrt(deux)
+
+!===============================================================================
+! 2. CALCUL DES GRADIENTS DE VITESSE ET DE
+! S11**2+S22**2+S33**2+2*(S12**2+S13**2+S23**2)
+!===============================================================================
+
+iccocg = 1
+inc = 1
+iphydp = 0
+
+! W1 = DUDX, W2 = DUDY, W3=DUDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , &
+ nswrgr(iuiph) , imligr(iuiph) , iphydp , iwarni(iuiph) , &
+ nfecra , epsrgr(iuiph) , climgr(iuiph) , extrag(iuiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iuiph) , coefa(1,ipcliu) , coefb(1,ipcliu) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ s11 = w1(iel)
+ propce(iel,ipcvst) = s11**2
+enddo
+
+
+! W2 = DUDY, W3=DUDZ
+! W4 = DVDX, W1 = DVDY, W5=DVDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , &
+ nswrgr(iviph) , imligr(iviph) , iphydp , iwarni(iviph) , &
+ nfecra , epsrgr(iviph) , climgr(iviph) , extrag(iviph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iviph) , coefa(1,ipcliv) , coefb(1,ipcliv) , &
+ w4 , w1 , w5 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ s22 = w1(iel)
+ propce(iel,ipcvst) = propce(iel,ipcvst) + s22**2
+enddo
+do iel = 1, ncel
+ dudy = w2(iel)
+ dvdx = w4(iel)
+ propce(iel,ipcvst) = propce(iel,ipcvst) + 0.5d0*(dudy+dvdx)**2
+enddo
+
+
+! W3=DUDZ
+! W1 = DVDY, W5=DVDZ
+! W2 = DWDX, W4 = DWDY, W1=DWDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , &
+ nswrgr(iwiph) , imligr(iwiph) , iphydp , iwarni(iwiph) , &
+ nfecra , epsrgr(iwiph) , climgr(iwiph) , extrag(iwiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iwiph) , coefa(1,ipcliw) , coefb(1,ipcliw) , &
+ w2 , w4 , w1 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ s33 = w1(iel)
+ propce(iel,ipcvst) = propce(iel,ipcvst) + s33**2
+enddo
+do iel = 1, ncel
+ dudz = w3(iel)
+ dwdx = w2(iel)
+ dvdz = w5(iel)
+ dwdy = w4(iel)
+ propce(iel,ipcvst) = &
+ propce(iel,ipcvst) + 0.5d0*((dudz+dwdx)**2+(dvdz+dwdy)**2)
+enddo
+
+
+!===============================================================================
+! 3. CALCUL DE LA VISCOSITE (DYNAMIQUE)
+!===============================================================================
+
+coef = csmago(iphas)**2 * radeux
+
+do iel = 1, ncel
+ delta = xfil* (xa*volume(iel))**xb
+ delta = coef * delta**2
+ propce(iel,ipcvst) = &
+ propce(iel,ipcrom) * delta * sqrt(propce(iel,ipcvst))
+enddo
+
+
+!----
+! FORMAT
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/vissst.f90 b/src/base/vissst.f90
new file mode 100644
index 0000000..dee9113
--- /dev/null
+++ b/src/base/vissst.f90
@@ -0,0 +1,432 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vissst &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , s2kw , divukw , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA VISCOSITE TURBULENTE POUR
+! LE MODELE K-OMEGA SST
+
+! VISCT = ROM * A1 * K /MAX(A1*W ; SQRT(S2KW)*F2)
+! AVEC S2KW = 2 * Sij.Sij
+! Sij = (DUi/Dxj + DUj/Dxi)/2
+
+! ET F2 = TANH(ARG2**2)
+! ARG2**2 = MAX(2*SQRT(K)/CMU/W/Y ; 500*NU/W/Y**2)
+
+! DIVU EST CALCULE EN MEME TEMPS QUE S2KW POUR ETRE REUTILISE
+! DANS TURBKW
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! s2kw(ncelet) ! tr ! --> ! 2 sij.sij !
+! divukw(ncelet ! tr ! --> ! divergence du u pour utilisation dans !
+! ! ! ! turbkw !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "cstnum.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision s2kw(ncelet), divukw(ncelet)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iccocg, inc
+integer iuiph, iviph, iwiph, ikiph, iomgip
+integer ipcliu, ipcliv, ipcliw
+integer ipcrom, ipcvis, ipcvst
+integer nswrgp, imligp, iwarnp, iphydp
+integer ifacpt
+double precision epsrgp, climgp, extrap
+double precision xk, xw, rom, xmu, xdist, xarg2, xf2
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables (dans RTP)
+iuiph = iu (iphas)
+iviph = iv (iphas)
+iwiph = iw (iphas)
+ikiph = ik (iphas)
+iomgip = iomg(iphas)
+
+! --- Rang des variables dans PROPCE (prop. physiques au centre)
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+ipcrom = ipproc(irom (iphas))
+
+! --- Rang des c.l. des variables dans COEFA COEFB
+! (c.l. std, i.e. non flux)
+ipcliu = iclrtp(iuiph,icoef)
+ipcliv = iclrtp(iviph,icoef)
+ipcliw = iclrtp(iwiph,icoef)
+
+!===============================================================================
+! 2. CALCUL DES GRADIENTS DE VITESSE ET DE
+! S2KW = 2* (S11**2+S22**2+S33**2+2*(S12**2+S13**2+S23**2)
+!===============================================================================
+
+iccocg = 1
+inc = 1
+
+
+! SMBRK = DUDX ,W4 = DUDY ,W5 = DUDZ
+
+nswrgp = nswrgr(iuiph)
+imligp = imligr(iuiph)
+iwarnp = iwarni(iuiph)
+epsrgp = epsrgr(iuiph)
+climgp = climgr(iuiph)
+extrap = extrag(iuiph)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iuiph) , coefa(1,ipcliu) , coefb(1,ipcliu) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+
+! S2KW = (S11)**2
+! DIVUKW = S11
+
+do iel = 1, ncel
+ s2kw (iel) = w1(iel)**2
+ divukw(iel) = w1(iel)
+enddo
+
+
+nswrgp = nswrgr(iviph)
+imligp = imligr(iviph)
+iwarnp = iwarni(iviph)
+epsrgp = epsrgr(iviph)
+climgp = climgr(iviph)
+extrap = extrag(iviph)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iviph) , coefa(1,ipcliv) , coefb(1,ipcliv) , &
+ w1 , w4 , w5 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+
+! S2KW = 2 (S11)**2 + 2 (S22)**2 + (2 S12)**2
+! DIVUKW = S11 + S22
+
+do iel = 1, ncel
+ s2kw (iel) = 2.d0*(s2kw(iel) + w4(iel)**2) &
+ + (w1(iel)+w2(iel))**2
+ divukw(iel) = divukw(iel) + w4(iel)
+enddo
+
+nswrgp = nswrgr(iwiph)
+imligp = imligr(iwiph)
+iwarnp = iwarni(iwiph)
+epsrgp = epsrgr(iwiph)
+climgp = climgr(iwiph)
+extrap = extrag(iwiph)
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iwiph) , coefa(1,ipcliw) , coefb(1,ipcliw) , &
+ w1 , w2 , w4 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+! S2KW = 2 (S11)**2 + 2 (S22)**2 + 2 (S33)**2
+! + (2 S12)**2 + (2 S13)**2 + (2 S23)**2 )
+! DIVUKW = S11 + S22 + S33
+
+do iel = 1, ncel
+ s2kw (iel) = s2kw(iel) + 2.d0*w4(iel)**2 &
+ + (w1(iel)+w3(iel))**2 &
+ + (w2(iel)+w5(iel))**2
+ divukw(iel) = divukw(iel) + w4(iel)
+enddo
+
+!===============================================================================
+! 3. CALCUL DE LA DISTANCE A LA PAROI
+!===============================================================================
+
+if(abs(icdpar).eq.2) then
+ do iel = 1 , ncel
+ ifacpt = ia(iifapa(iphas)-1+iel)
+ if (ifacpt.gt.0) then
+ w1(iel) = &
+ (cdgfbo(1,ifacpt)-xyzcen(1,iel))**2 &
+ +(cdgfbo(2,ifacpt)-xyzcen(2,iel))**2 &
+ +(cdgfbo(3,ifacpt)-xyzcen(3,iel))**2
+ w1(iel) = sqrt(w1(iel))
+ else
+ w1(iel) = grand
+ endif
+ enddo
+else
+ do iel = 1 , ncel
+ w1(iel) = max(ra(idipar+iel-1),epzero)
+ enddo
+endif
+
+!===============================================================================
+! 4. CALCUL DE LA VISCOSITE
+!===============================================================================
+
+do iel = 1, ncel
+
+ xk = rtpa(iel,ikiph)
+ xw = rtpa(iel,iomgip)
+ rom = propce(iel,ipcrom)
+ xmu = propce(iel,ipcvis)
+ xdist = w1(iel)
+ xarg2 = max ( &
+ 2.d0*sqrt(xk)/cmu/xw/xdist, &
+ 500.d0*xmu/rom/xw/xdist**2 )
+ xf2 = tanh(xarg2**2)
+
+ propce(iel,ipcvst) = rom*ckwa1*xk &
+ /max( ckwa1*xw , sqrt(s2kw(iel))*xf2 )
+
+enddo
+
+
+!----
+! FORMAT
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/viswal.f90 b/src/base/viswal.f90
new file mode 100644
index 0000000..7629de4
--- /dev/null
+++ b/src/base/viswal.f90
@@ -0,0 +1,418 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine viswal &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ w9 , w10 , w11 , w12 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA VISCOSITE "TURBULENTE" POUR
+! UN MODELE LES WALE
+
+! PROPCE(1,IVISCT(IPHAS)) = ROM * (CWALE*L)**2 *
+! [(Sijd.Sijd)**(3/2)] / [(Sij.Sij)**(5/2) + (Sijd.Sijd)**(5/4)]
+!
+! avec
+! Sij = 0.5*[DUi/Dxj + DUj/Dxi]
+! et
+! Sijd = 0.5*[DUi/Dxk.DUk/Dxj + DUj/Dxk.DUk/Dxi] - 1/3*Delta_ij.Gkk**2
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc(ncepdp ! tr ! <-- ! tableau de travail pour pdc !
+! , 6)! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! w1..12(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision w4(ncelet) , w5(ncelet) , w6(ncelet)
+double precision w7(ncelet) , w8(ncelet) , w9(ncelet)
+double precision w10(ncelet) , w11(ncelet) , w12(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinra
+integer iel, iccocg, inc
+integer iuiph, iviph, iwiph
+integer ipcliu, ipcliv, ipcliw
+integer ipcrom, ipcvst, iphydp, ipcvis
+integer i, j, k
+
+double precision coef, deux, delta, tiers
+double precision sij, sijd, s, sd, sinv
+double precision xfil, xa , xb , radeux, con
+double precision duidxj(ndim,ndim), kdelta(ndim,ndim)
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+
+! --- Numero des variables (dans RTP)
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+! --- Rang des variables dans PROPCE (prop. physiques au centre)
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+ipcrom = ipproc(irom (iphas))
+
+! --- Rang des c.l. des variables dans COEFA COEFB
+! (c.l. std, i.e. non flux)
+ipcliu = iclrtp(iuiph,icoef)
+ipcliv = iclrtp(iviph,icoef)
+ipcliw = iclrtp(iwiph,icoef)
+! --- Pour le calcul de la viscosite de sous-maille
+xfil = xlesfl(iphas)
+xa = ales(iphas)
+xb = bles(iphas)
+deux = 2.d0
+radeux = sqrt(deux)
+tiers = 1.d0/3.d0
+
+
+!===============================================================================
+! 2. CALCUL DU GRADIENT DE VITESSE
+! W1 = DU/DX, W2 = DU/DY, W3 = DU/DZ
+! W4 = DV/DX, W5 = DV/DY, W6 = DV/DZ
+! W7 = DW/DX, W8 = DW/DY, W9 = DW/DZ
+!===============================================================================
+
+iccocg = 1
+inc = 1
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , &
+ nswrgr(iuiph) , imligr(iuiph) , iphydp , iwarni(iuiph) , &
+ nfecra , epsrgr(iuiph) , climgr(iuiph) , extrag(iuiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w12 , w12 , w12 , &
+ rtpa(1,iuiph) , coefa(1,ipcliu) , coefb(1,ipcliu) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w10 , w11 , w12 , &
+ rdevel , rtuser , ra )
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , &
+ nswrgr(iviph) , imligr(iviph) , iphydp , iwarni(iviph) , &
+ nfecra , epsrgr(iviph) , climgr(iviph) , extrag(iviph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w12 , w12 , w12 , &
+ rtpa(1,iviph) , coefa(1,ipcliv) , coefb(1,ipcliv) , &
+ w4 , w5 , w6 , &
+! ------ ------ ------
+ w10 , w11 , w12 , &
+ rdevel , rtuser , ra )
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , &
+ nswrgr(iwiph) , imligr(iwiph) , iphydp , iwarni(iwiph) , &
+ nfecra , epsrgr(iwiph) , climgr(iwiph) , extrag(iwiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w12 , w12 , w12 , &
+ rtpa(1,iwiph) , coefa(1,ipcliw) , coefb(1,ipcliw) , &
+ w7 , w8 , w9 , &
+! ------ ------ ------
+ w10 , w11 , w12 , &
+ rdevel , rtuser , ra )
+
+! Kronecker delta Dij
+
+kdelta(1,1) = 1
+kdelta(1,2) = 0
+kdelta(1,3) = 0
+kdelta(2,1) = 0
+kdelta(2,2) = 1
+kdelta(2,3) = 0
+kdelta(3,1) = 0
+kdelta(3,2) = 0
+kdelta(3,3) = 1
+
+coef = cwale(iphas)**2 * radeux
+
+do iel = 1, ncel
+
+ duidxj(1,1) = w1(iel)
+ duidxj(1,2) = w2(iel)
+ duidxj(1,3) = w3(iel)
+ duidxj(2,1) = w4(iel)
+ duidxj(2,2) = w5(iel)
+ duidxj(2,3) = w6(iel)
+ duidxj(3,1) = w7(iel)
+ duidxj(3,2) = w8(iel)
+ duidxj(3,3) = w9(iel)
+
+ s = 0.d0
+ sd = 0.d0
+
+ do i = 1, ndim
+ do j = 1, ndim
+
+! Sij = 0.5 * (dUi/dXj + dUj/dXi)
+
+ sij = 0.5d0*(duidxj(i,j)+duidxj(j,i))
+
+ s = s + 2.d0*sij**2
+
+ do k = 1, ndim
+
+! traceless symmetric part of the square of the velocity gradient tensor
+! Sijd = 0.5 * ( dUi/dXk dUk/dXj + dUj/dXk dUk/dXi) - 1/3 Dij dUk/dXk dUk/dXk
+
+ sijd = 0.5d0*(duidxj(i,k)*duidxj(k,j)+ duidxj(j,k)*duidxj(k,i)) &
+ -tiers*kdelta(i,j)*duidxj(k,k)**2
+
+ sd = sd + sijd**2
+
+ enddo
+ enddo
+ enddo
+
+! S = SQRT ( 2 Sij Sij )
+
+ s = sqrt(s)
+
+
+!===============================================================================
+! 3. CALCUL DE LA VISCOSITE TURBULENTE
+!===============================================================================
+
+! Turbulent inverse time scale =
+! (Sijd Sijd)^3/2 / [ (Sij Sij)^5/2 + (Sijd Sijd)^5/4 ]
+
+ sinv = (s**2.5d0 + sd**1.25d0)
+ if (sinv.gt.0.d0) then
+ con = sd**1.5d0 / sinv
+ else
+ con = 0.d0
+ endif
+
+ delta = xfil* (xa*volume(iel))**xb
+ delta = coef * delta**2
+
+ propce(iel,ipcvst) = propce(iel,ipcrom) * delta * con
+
+enddo
+
+!----
+! FORMAT
+!----
+
+!----
+! FIN
+!----
+
+return
+
+end subroutine
diff --git a/src/base/vor2cl.f90 b/src/base/vor2cl.f90
new file mode 100644
index 0000000..72450a0
--- /dev/null
+++ b/src/base/vor2cl.f90
@@ -0,0 +1,294 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine vor2cl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ idevel , irepvo , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! TRANSFERT DES VORTEX DANS LES TABLEAUX RCDOCL
+! AVEC CHANGEMENT DE REPERE EVENTUEL
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! irepvo ! te ! <-- ! numero de l'entree associe a chaque !
+! (nfabor) ! ! ! face de bord (=0 si pas de vortex) !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer irepvo(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ii, iphas, ient
+double precision xu, xv, xw
+
+integer ipass
+data ipass /0/
+save ipass
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+if(irangp.ge.0.and.ipass.eq.1) then
+ do ii = 1, nnent
+ call parbcr(0,3,dir1(1,ii))
+ !==========
+ call parbcr(0,3,dir2(1,ii))
+ !==========
+ call parbcr(0,3,dir3(1,ii))
+ !==========
+ enddo
+endif
+
+! on envoie la vitesse calcule par le processeur 0
+! a tous les autres processeurs
+
+if(irangp.ge.0) then
+ do ient = 1, nnent
+ call parbcr(0,icvmax,ra(iuvort+(ient-1)*icvmax))
+ !==========
+ call parbcr(0,icvmax,ra(ivvort+(ient-1)*icvmax))
+ !==========
+ call parbcr(0,icvmax,ra(iwvort+(ient-1)*icvmax))
+ !==========
+ enddo
+endif
+
+do ii = 1, nnent
+ icvor2(ii) = 0
+enddo
+
+do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+ ient = irepvo(ifac)
+ if(ient.ne.0) then
+ icvor2(ient) = icvor2(ient) + 1
+ do iphas = 1, nphas
+
+ itypfb(ifac,iphas) = ientre
+ ii = ia(iifagl+(ient-1)*icvmax+icvor2(ient)-1)
+
+ xu = ra(iuvort+(ient-1)*icvmax+ii-1)
+ xv = ra(ivvort+(ient-1)*icvmax+ii-1)
+ xw = ra(iwvort+(ient-1)*icvmax+ii-1)
+
+ rcodcl(ifac,iu(iphas),1) = xu*dir3(1,ient)+xv*dir1(1,ient) &
+ + xw*dir2(1,ient)
+ rcodcl(ifac,iv(iphas),1) = xu*dir3(2,ient)+xv*dir1(2,ient) &
+ + xw*dir2(2,ient)
+ rcodcl(ifac,iw(iphas),1) = xu*dir3(3,ient)+xv*dir1(3,ient) &
+ + xw*dir2(3,ient)
+ enddo
+
+ endif
+
+enddo
+
+! ---
+! FIN
+! ---
+
+return
+end
diff --git a/src/base/vordep.f90 b/src/base/vordep.f90
new file mode 100644
index 0000000..2f95f33
--- /dev/null
+++ b/src/base/vordep.f90
@@ -0,0 +1,330 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vordep &
+!================
+
+ ( ncevor , nvor , ient , dtref , &
+ ivorce , yzcel , xu , xv , xw , &
+ yzvor , yzvora , signv , temps , tpslim )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! METHODE DES VORTEX POUR LES ENTREES EN L.E.S. :
+! - DEPLACEMENT DES VORTEX
+! - TRAITEMENT DES VORTEX MORTS ET SORTANTS
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncevor ! e ! <-- ! nombre de face a l'entree ou est !
+! ! ! ! utilise la methode !
+! nvor ! e ! <-- ! nombre de vortex a l'entree !
+! ient ! e ! <-- ! numero de l'entree !
+! dtref ! r ! <-- ! pas de temps !
+! ivorce ! te ! <-- ! numero du vortex le plus proche d'une !
+! (nvomax) ! ! ! face donnee !
+! yzcel ! tr ! <-- ! coordonnees des faces d'entree dans !
+! (icvmax ,2) ! ! ! le referentiel local !
+! xu(icvmax) ! tr ! --- ! composante de vitesse principale !
+! xv(icvmax) ! tr ! <-- ! composantes de vitesse transverses !
+! xw(icvmax) ! tr ! <-- ! !
+! yzvor ! tr ! --> ! nouvelles coordonnees du centre !
+! (nvomax,2) ! ! ! des vortex !
+! yzvora ! tr ! <-- ! anciennes coordonnees du centre !
+! (nvomax,2) ! ! ! des vortex !
+! signv(nvomax) ! tr ! <-- ! sens de rotation des vortex !
+! temps ! tr ! <-- ! temps ecoule depuis la creation !
+! (nvomax) ! ! ! du vortex !
+! tpslim ! tr ! <-- ! duree de vie du vortex !
+! (nvomax) ! ! ! !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncevor , nvor , ient
+integer ivorce(nvomax)
+
+double precision dtref
+double precision yzcel(icvmax ,2)
+double precision xu(icvmax) , xv(icvmax) , xw(icvmax)
+double precision yzvor(nvomax,2) , yzvora(nvomax,2)
+double precision signv(nvomax)
+double precision temps(nvomax) , tpslim(nvomax)
+
+! VARIABLES LOCALES
+
+integer ii, jj, kk, iii, iun
+
+double precision sens, dy, dz
+double precision xxv, xxw
+double precision drand(1), u_vor, ek_vor, ee_vor
+double precision dd, yy, zz
+double precision phidat
+
+!===============================================================================
+! 1. DEPLACEMENT DES VORTEX
+!===============================================================================
+iun = 1
+do ii = 1, nvor
+ temps(ii) = temps(ii) + dtref
+enddo
+
+! - Deplacement aleatoire
+
+if(idepvo(ient).eq.1)then
+
+ do ii = 1, nvor
+ yzvora(ii,1) = yzvor(ii,1)
+ yzvora(ii,2) = yzvor(ii,2)
+ enddo
+ do ii = 1, nvor
+ sens = 1.d0
+ call zufall(iun,drand(1))
+ if (drand(1).lt.0.5d0) sens = -1.d0
+ call zufall(iun,drand(1))
+ dy = drand(1) * ud(ient) * dtref
+ yzvor(ii,1) = yzvor(ii,1) + sens * dy
+ sens = 1.d0
+ call zufall(iun,drand(1))
+ if (drand(1).lt.0.5d0) sens = -1.d0
+ call zufall(iun,drand(1))
+ dz = drand(1) * ud(ient) * dtref
+ yzvor(ii,2) = yzvor(ii,2) + sens * dz
+ enddo
+
+! - Convection des vortex
+
+elseif(idepvo(ient).eq.2) then
+
+ do ii = 1, nvor
+ yzvora(ii,1) = yzvor(ii,1)
+ yzvora(ii,2) = yzvor(ii,2)
+ enddo
+
+ do ii = 1, nvor
+ kk = ivorce(ii)
+ xxv = xv(kk)
+ xxw = xw(kk)
+ yzvor(ii,1) = yzvor(ii,1) + dtref * xxv
+ yzvor(ii,2) = yzvor(ii,2) + dtref * xxw
+ enddo
+
+endif
+
+!===============================================================================
+! 2. GESTION DES VORTEX SORTANT DU DOMAINE
+!===============================================================================
+
+if(icas(ient).eq.1) then
+
+ if(iclvor(1,ient).eq.1.or.iclvor(1,ient).eq.2) then
+ do ii = 1, nvor
+ if(yzvor(ii,1).gt.(lly(ient)/2.d0)) then
+ yzvor(ii,1) = yzvora(ii,1)
+ endif
+ enddo
+ elseif(iclvor(1,ient).eq.3) then
+ do ii = 1, nvor
+ if(yzvor(ii,1).gt.(lly(ient)/2.d0).and. &
+ yzvor(ii,1).lt.(3.d0*lly(ient)/2.d0)) then
+ yzvor(ii,1) = yzvor(ii,1) - lly(ient)
+ elseif(yzvor(ii,1).lt.-(lly(ient)/2.d0).and. &
+ yzvor(ii,1).gt.-(3.d0*lly(ient)/2.d0)) then
+ yzvor(ii,1) = yzvor(ii,1) + lly(ient)
+ elseif(yzvor(ii,1).gt.(3.d0*lly(ient)/2.d0).or. &
+ yzvor(ii,1).lt.-(3.d0*lly(ient)/2.d0)) then
+ yzvor(ii,1) = yzvora(ii,1)
+ endif
+ enddo
+ endif
+
+ if(iclvor(2,ient).eq.1.or.iclvor(2,ient).eq.2) then
+ do ii = 1, nvor
+ if(yzvor(ii,2).gt.(llz(ient)/2.d0)) then
+ yzvor(ii,2) = yzvora(ii,2)
+ endif
+ enddo
+ elseif(iclvor(2,ient).eq.3) then
+ do ii = 1, nvor
+ if(yzvor(ii,2).gt.(llz(ient)/2.d0).and. &
+ yzvor(ii,2).lt.(3.d0*llz(ient)/2.d0)) then
+ yzvor(ii,2) = yzvor(ii,2) - llz(ient)
+ elseif(yzvor(ii,2).lt.-(llz(ient)/2.d0).and. &
+ yzvor(ii,2).gt.-(3.d0*llz(ient)/2.d0)) then
+ yzvor(ii,2) = yzvor(ii,2) + llz(ient)
+ elseif(yzvor(ii,2).gt.(3.d0*llz(ient)/2.d0).or. &
+ yzvor(ii,2).lt.-(3.d0*llz(ient)/2.d0)) then
+ yzvor(ii,2) = yzvora(ii,2)
+ endif
+ enddo
+ endif
+
+ if(iclvor(3,ient).eq.1.or.iclvor(3,ient).eq.2) then
+ do ii = 1, nvor
+ if(yzvor(ii,1).lt.-(lly(ient)/2.d0)) then
+ yzvor(ii,1) = yzvora(ii,1)
+ endif
+ enddo
+ endif
+
+ if(iclvor(4,ient).eq.1.or.iclvor(4,ient).eq.2) then
+ do ii = 1, nvor
+ if(yzvor(ii,2).lt.-(llz(ient)/2.d0)) then
+ yzvor(ii,2) = yzvora(ii,2)
+ endif
+ enddo
+ endif
+
+elseif(icas(ient).eq.2) then
+ do ii = 1, nvor
+ if((yzvor(ii,1)**2+yzvor(ii,2)**2).gt. &
+ (lld(ient)/2.0d0)**2)then
+ yzvor(ii,1) = yzvora(ii,1)
+ yzvor(ii,2) = yzvora(ii,2)
+ endif
+ enddo
+
+elseif(icas(ient).eq.3.or.icas(ient).eq.4) then
+ do ii = 1, nvor
+ if(yzvor(ii,1).lt.ymin(ient).or. &
+ yzvor(ii,1).gt.ymax(ient)) then
+ yzvor(ii,1) = yzvora(ii,1)
+ endif
+ if(yzvor(ii,2).lt.zmin(ient).or. &
+ yzvor(ii,2).gt.zmax(ient)) then
+ yzvor(ii,2) = yzvora(ii,2)
+ endif
+ enddo
+endif
+
+!===============================================================================
+! 3. REGENERATION DES VORTEX MORTS
+!===============================================================================
+
+do ii = 1, nvor
+ if(temps(ii).gt.tpslim(ii))then
+ temps(ii) = 0.d0
+
+! - Position
+
+ if(icas(ient).eq.1) then
+ call zufall(iun,drand(1))
+ yzvor(ii,1) = lly(ient) * drand(1) - lly(ient) / 2.d0
+ call zufall(iun,drand(1))
+ yzvor(ii,2) = llz(ient) * drand(1) - llz(ient) / 2.d0
+ elseif(icas(ient).eq.2) then
+ 15 continue
+ call zufall(iun,drand(1))
+ yzvor(ii,1) = lld(ient) * drand(1) - lld(ient) / 2.0d0
+ call zufall(iun,drand(1))
+ yzvor(ii,2) = lld(ient) * drand(1) - lld(ient) / 2.0d0
+ if((yzvor(ii,1)**2+yzvor(ii,2)**2).gt. &
+ (lld(ient)/2.0d0)**2) then
+ goto 15
+ endif
+ elseif(icas(ient).eq.3.or.icas(ient).eq.4) then
+ call zufall(iun,drand(1))
+ yzvor(ii,1) = ymin(ient) + lly(ient) * drand(1)
+ call zufall(iun,drand(1))
+ yzvor(ii,2) = zmin(ient) + llz(ient) * drand(1)
+ endif
+
+! - Duree de vie
+
+ if(itlivo(ient).eq.1) then
+ tpslim(ii) = tlimvo(ient)
+ elseif(itlivo(ient).eq.2) then
+ yy = yzvor(ii,1)
+ zz = yzvor(ii,2)
+ iii = 0
+ u_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),udat(1,ient),iii)
+ ek_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),kdat(1,ient),iii)
+ ee_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),epsdat(1,ient),iii)
+ tpslim(ii) = 5.d0*cmu*ek_vor**(3.d0/2.d0)/ee_vor
+ tpslim(ii) = tpslim(ii)/u_vor
+ endif
+
+! - Sens de rotation
+
+ call zufall(iun,drand(1))
+ if(drand(1).gt.0.5d0) signv(ii) = -1.0d0*signv(ii)
+ endif
+enddo
+
+!===============================================================================
+! 4. RECHERCHE DE LA FACE LA PLUS PROCHE DE CHAQUE VORTEX
+!===============================================================================
+
+do ii = 1, nvor
+ kk = 0
+ dd = grand
+ do jj = 1, ncevor
+ if(((yzcel(jj,1)-yzvor(ii,1))**2+ &
+ (yzcel(jj,2)-yzvor(ii,2))**2).lt.dd)then
+ dd = (yzcel(jj,1)-yzvor(ii,1))**2 &
+ +(yzcel(jj,2)-yzvor(ii,2))**2
+ kk = jj
+ endif
+ enddo
+ ivorce(ii) = kk
+enddo
+
+! ---
+! FIN
+! ---
+
+return
+
+end
diff --git a/src/base/vorimp.f90 b/src/base/vorimp.f90
new file mode 100644
index 0000000..0fc1b53
--- /dev/null
+++ b/src/base/vorimp.f90
@@ -0,0 +1,259 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vorimp &
+!================
+
+ ( ient )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! IMPRESSION DES PARAMETRES DE LA METHODE DES VORTEX
+! APRES INTERVENTION UTILISATEUR DANS usvort
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ient ! e ! <-- ! numero de l'entree !
+! nnent ! e ! <-- ! nombre d'entrees utilisant des vortex !
+! nvort(nentmx) ! te ! -> ! nombre de vortex a chaque entree !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "optcal.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ient
+
+! VARIABLES LOCALES
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+! On ne peut pas faire ces impressions dans impini car la geometrie
+! des entrees n'est pas encore connue.
+
+!===============================================================================
+! 1. Methode vortex
+!===============================================================================
+
+ipass = ipass + 1
+
+write(nfecra,9010) ient, nvort(ient), icvor(ient), icas(ient)
+write(nfecra,9020) dir1(1,ient),dir1(2,ient),dir1(3,ient), &
+ dir2(1,ient),dir2(2,ient),dir2(3,ient), &
+ dir3(1,ient),dir3(2,ient),dir3(3,ient), &
+ cen(1,ient) ,cen(2,ient) ,cen(3,ient)
+if(icas(ient).eq.1) then
+ write(nfecra,9030) iclvor(1,ient),iclvor(2,ient), &
+ iclvor(3,ient),iclvor(4,ient)
+endif
+write(nfecra,9040) ymin(ient),ymax(ient),zmin(ient),zmax(ient)
+if(icas(ient).eq.1) then
+ write(nfecra,9050) lly(ient),llz(ient)
+endif
+if(icas(ient).eq.2) then
+ write(nfecra,9060) lld(ient)
+endif
+write(nfecra,9070) itlivo(ient)
+if(itlivo(ient).eq.1) then
+ write(nfecra,9080) tlimvo(ient)
+endif
+write(nfecra,9090) isgmvo(ient)
+if(isgmvo(ient).eq.1) then
+ write(nfecra,9100) xsgmvo(ient)
+endif
+write(nfecra,9110) idepvo(ient)
+if(idepvo(ient).eq.1) then
+ write(nfecra,9120) ud(ient)
+endif
+if(icas(ient).eq.1.or.icas(ient).eq.2.or.icas(ient).eq.3) then
+ write(nfecra,9130) ndat(ient)
+elseif(icas(ient).eq.4) then
+ write(nfecra,9140) udebit(ient),kdebit(ient),edebit(ient)
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 9010 format( &
+'------------- ',/,&
+' -- Entree : ',I10 /,&
+'------------- ',/,&
+' NVORT = ',4X,I10, ' (Nombre de vortex )',/,&
+' ICVOR = ',4X,I10, ' (Nombre de faces a l''entree )',/,&
+' ICAS = ',4X,I10, ' (1 : conduite rectangulaire ',/,&
+' ',14X, ' 2 : conduite circulaire ',/,&
+' ',14X, ' 3 : sans CL mais avec fichier',/,&
+' ',14X, ' 4 : sans CL ni fichier )',/)
+ 9020 format( &
+' --- Directions principales du repere local ',/,&
+' ---- X ---- ---- Y ---- ---- Z ---- ',/,&
+' DIR1 = ', E14.5,' ',E14.5,' ',E14.5 /,&
+' DIR2 = ', E14.5,' ',E14.5,' ',E14.5 /,&
+' DIR3 = ', E14.5,' ',E14.5,' ',E14.5 /,&
+' ',/,&
+' --- Coordonnees du centre de l''entree ',/,&
+' CEN = ', E14.5,' ',E14.5,' ',E14.5, /)
+ 9030 format( &
+' --- Conditions aux limites dans le repere local ',/,&
+' Plan y = -LLY/2 ',4X,I10, ' (1 : paroi ',/,&
+' Plan z = LLZ/2 ',4X,I10, ' 2 : symetrie ',/,&
+' Plan y = LLY/2 ',4X,I10, ' 3 : periodicite )',/,&
+' Plan z = -LLZ/2 ',4X,I10, ' ',/)
+ 9040 format( &
+' --- Dimensions de l''entree dans le repere local ',/,&
+' ---- min ---- ---- max ---- ',/,&
+' Y = ',E14.5,' ',E14.5,' ',/,&
+' Z = ',E14.5,' ',E14.5,' ',/)
+ 9050 format( &
+' LLY = ',E14.5, ' (longueur de la conduite dans ',/,&
+' LLZ = ',E14.5, ' les directions DIR1 et DIR2) ',/)
+ 9060 format( &
+' LLD = ',E14.5, ' (diametre de la conduite ) ',/)
+ 9070 format( &
+' --- Duree de vie des vortex ',/,&
+' ITLIVO = ',4X,I10, ' (1 : constante ',/,&
+' ',14X, ' 2 : en k^(3/2).U/epsilon ) ',/)
+ 9080 format( &
+' TLIMVO = ',E14.5, ' (1 : duree de vie imposee ) ',/)
+ 9090 format( &
+' --- Taille des vortex ',/,&
+' ISGMVO = ',4X,I10, ' (1 : taille constante ',/,&
+' ',14X, ' 2 : en k^(3/2)/epsilon ',/,&
+' ',14X, ' 2 : en max[nu.k/eps,200.Lk]) ',/)
+ 9100 format( &
+' XSGMVO = ',E14.5, ' (1 : taille imposee ) ',/)
+ 9110 format( &
+' --- Marche en temps ',/,&
+' IDEPVO = ',4X,I10, ' (1 : deplacement aleatoire ',/,&
+' ',14X, ' 2 : convection des vortex ',/)
+ 9120 format( &
+' UD = ',E14.5, ' (1 : vit. de deplacement max) ',/)
+ 9130 format( &
+' --- Fichier de donnees ',/,&
+' NDAT = ',4X,I10, ' (Nombre de lignes du fichier )',/)
+ 9140 format( &
+' --- Donnees a l''entree ',/,&
+' UDEBIT = ',E14.5, ' (vitesse debitante imposee) ',/,&
+' KDEBIT = ',E14.5, ' (energie cinetique imposee) ',/,&
+' EDEBIT = ',E14.5, ' (dissipation imposee) ',/)
+
+#else
+
+ 9010 format( &
+'----------- ',/,&
+' -- Inlet: ',I10 /,&
+'----------- ',/,&
+' NVORT = ',4X,I10, ' (Number of vortices )',/,&
+' ICVOR = ',4X,I10, ' (Number of faces at the inlet)',/,&
+' ICAS = ',4X,I10, ' (1 : rectangular duct ',/,&
+' ',14X, ' 2 : pipe ',/,&
+' ',14X, ' 3 : wo BC but with file ',/,&
+' ',14X, ' 4 : wo BC neither file )',/)
+ 9020 format( &
+' --- Main directions for the local frame ',/,&
+' ---- X ---- ---- Y ---- ---- Z ---- ',/,&
+' DIR1 = ', E14.5,' ',E14.5,' ',E14.5 /,&
+' DIR2 = ', E14.5,' ',E14.5,' ',E14.5 /,&
+' DIR3 = ', E14.5,' ',E14.5,' ',E14.5 /,&
+' ',/,&
+' --- Inlet center coordinates ',/,&
+' CEN = ', E14.5,' ',E14.5,' ',E14.5, /)
+ 9030 format( &
+' --- Boundary conditions in the local frame ',/,&
+' Y plane = -LLY/2 ',4X,I10, ' (1 : wall ',/,&
+' Z plane = LLZ/2 ',4X,I10, ' 2 : symmetry ',/,&
+' Y plane = LLY/2 ',4X,I10, ' 3 : periodicity )',/,&
+' Z plane = -LLZ/2 ',4X,I10, ' ',/)
+ 9040 format( &
+' --- Inlet dimensions in the local framae ',/,&
+' ---- min ---- ---- max ---- ',/,&
+' Y = ',E14.5,' ',E14.5,' ',/,&
+' Z = ',E14.5,' ',E14.5,' ',/)
+ 9050 format( &
+' LLY = ',E14.5, ' (duct length in the directions',/,&
+' LLZ = ',E14.5, ' DIR1 and DIR2 ) ',/)
+ 9060 format( &
+' LLD = ',E14.5, ' (pipe diameter ) ',/)
+ 9070 format( &
+' --- Vortices life time ',/,&
+' ITLIVO = ',4X,I10, ' (1 : constant ',/,&
+' ',14X, ' 2 : in k^(3/2).U/epsilon ) ',/)
+ 9080 format( &
+' TLIMVO = ',E14.5, ' (1 : given life time ) ',/)
+ 9090 format( &
+' --- Vortices size ',/,&
+' ISGMVO = ',4X,I10, ' (1 : constant ',/,&
+' ',14X, ' 2 : in k^(3/2)/epsilon ',/,&
+' ',14X, ' 2 : in max[nu.k/eps,200.Lk]) ',/)
+ 9100 format( &
+' XSGMVO = ',E14.5, ' (1 : given size ) ',/)
+ 9110 format( &
+' --- Time marching ',/,&
+' IDEPVO = ',4X,I10, ' (1 : random displacement ',/,&
+' ',14X, ' 2 : vortices convection ',/)
+ 9120 format( &
+' UD = ',E14.5, ' (1 : max displacement vel. ) ',/)
+ 9130 format( &
+' --- Data file ',/,&
+' NDAT = ',4X,I10, ' (Number of lines in the file )',/)
+ 9140 format( &
+' --- Inlet date ',/,&
+' UDEBIT = ',E14.5, ' (given velocity ) ',/,&
+' KDEBIT = ',E14.5, ' (given kinetic energy) ',/,&
+' EDEBIT = ',E14.5, ' (given dissipation ) ',/)
+
+#endif
+
+!===============================================================================
+! 2. FIN
+!===============================================================================
+
+return
+end
diff --git a/src/base/vorin0.f90 b/src/base/vorin0.f90
new file mode 100644
index 0000000..6674b9f
--- /dev/null
+++ b/src/base/vorin0.f90
@@ -0,0 +1,143 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine vorin0 &
+!================
+
+ ( nfabor , irepvo )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INITIALISATION PAR DEFAUT DES PARAMETRES POUR LA METHODE
+! DES VORTEX AVANT DE PASSER LA MAIN A L'UTILISATEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! irepvo ! te ! --> ! numero de l'entree associe a chaque !
+! (nfabor) ! ! ! face de bord (=0 si pas de vortex) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nfabor, irepvo(nfabor)
+
+! VARIABLES LOCALES
+
+integer ii, jj, ifac
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. PARAMETRES DE LA METHODE
+!===============================================================================
+
+! ---> Nombre d'entrees
+
+nnent = -999
+
+! ---> Nombre de vortex
+
+do ii = 1, nentmx
+ nvort(ii) = -999
+enddo
+
+! ---> Defintion du cas
+
+do ii = 1, nentmx
+ icas(ii) = - 999
+enddo
+
+! ---> Tableau de reperage et repere local
+
+do ifac = 1, nfabor
+ irepvo(ifac) = 0
+enddo
+
+do ii = 1, nentmx
+ do jj = 1, 3
+ dir1(jj,ii) = 0.d0
+ dir2(jj,ii) = 0.d0
+ cen(jj,ii) = 0.d0
+ enddo
+enddo
+
+! ---> Conditions aux limites et grandeurs caracteristiques
+
+do ii = 1, nentmx
+ do jj = 1, 4
+ iclvor(jj,ii) = -999
+ enddo
+ lly(ii) = -999.d0
+ llz(ii) = -999.d0
+ lld(ii) = -999.d0
+enddo
+
+! ---> Parametres physiques
+
+do ii = 1, nentmx
+ itlivo(ii) = -999
+ tlimvo(ii) = -999.d0
+ isgmvo(ii) = -999
+ xsgmvo(ii) = -999.d0
+ idepvo(ii) = -999
+ ud(ii) = 0.d0
+enddo
+
+! ---> Donnees utilisateurs
+
+do ii = 1, nentmx
+ WRITE(FICVOR(II),'(1A6,I2.2)') 'vordat',II
+ udebit(ii) = 0.d0
+ kdebit(ii) = -999.d0
+ edebit(ii) = -999.d0
+enddo
+
+return
+end
diff --git a/src/base/vorini.f90 b/src/base/vorini.f90
new file mode 100644
index 0000000..de65f7c
--- /dev/null
+++ b/src/base/vorini.f90
@@ -0,0 +1,603 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vorini &
+!================
+
+ ( ncevor , nvor , ient , &
+ ivorce , xyz , yzcel , xu , xv , xw , &
+ yzvor , signv , temps , tpslim )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! INITIALISATION DE LA METHODE DES VORTEX POUR LES ENTREES EN L.E.S.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncevor ! e ! <-- ! nombre de face a l'entree ou est !
+! ! ! ! utilise la methode !
+! nvor ! e ! <-- ! nombre de vortex a l'entree !
+! ient ! e ! <-- ! numero de l'entree !
+! ivorce ! te ! <-- ! numero du vortex le plus proche d'une !
+! (nvomax) ! ! ! face donnee !
+! xyz(icvmax,3) ! ! <-- ! coordonnees des faces d'entree dans !
+! ! ! ! le calcul !
+! yzcel ! tr ! <-- ! coordonnees des faces d'entree dans !
+! (icvmax ,2) ! ! ! le referentiel local !
+! xu(icvmax) ! tr ! --- ! composante de vitesse principale !
+! xv(icvmax) ! tr ! <-- ! composantes de vitesse transverses !
+! xw(icvmax) ! tr ! <-- ! !
+! yzvor ! tr ! <-- ! coordonnees du centre des vortex !
+! (nvomax,2) ! ! ! !
+! signv(nvomax) ! tr ! <-- ! sens de rotation des vortex !
+! temps ! tr ! <-- ! temps ecoule depuis la creation !
+! (nvomax) ! ! ! du vortex !
+! tpslim ! tr ! <-- ! duree de vie du vortex !
+! (nvomax) ! ! ! !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncevor , nvor , ient
+integer ivorce(nvomax)
+
+double precision xyz(icvmax,3) , yzcel(icvmax,2)
+double precision xu(icvmax) , xv(icvmax) , xw(icvmax)
+double precision yzvor(nvomax,2) , signv(nvomax)
+double precision temps(nvomax) , tpslim(nvomax)
+
+
+! VARIABLES LOCALES
+
+integer ii, jj, kk, iii, iun, ivort, iient, iok
+
+double precision dd
+double precision drand(1), phidat, xx, yy, zz
+double precision uu, vv, ww
+double precision u_vor, ek_vor, ee_vor
+
+integer ilect
+data ilect /0/
+save ilect
+!===============================================================================
+! 1. CALCUL DU REPERE LOCAL ET CHANGEMENT DE REPERE
+!===============================================================================
+
+ilect = ilect + 1
+if(ilect.eq.1) then
+ write(nfecra,1000) nnent, isuivo
+endif
+
+if(icas(ient).eq.1.or.icas(ient).eq.2.or.icas(ient).eq.3) then
+
+ dir3(1,ient)=dir1(2,ient)*dir2(3,ient)-dir1(3,ient)*dir2(2,ient)
+ dir3(2,ient)=dir1(3,ient)*dir2(1,ient)-dir1(1,ient)*dir2(3,ient)
+ dir3(3,ient)=dir1(1,ient)*dir2(2,ient)-dir1(2,ient)*dir2(1,ient)
+
+elseif(icas(ient).eq.4) then
+
+! On s'aide du vecteur surface d'une face de l'entree (supposee plane)
+! pour definir le repere local
+
+ vv = sqrt(surf(1,ient)**2 + surf(2,ient)**2 + surf(3,ient)**2)
+
+ dir3(1,ient) = -surf(1,ient)/vv
+ dir3(2,ient) = -surf(2,ient)/vv
+ dir3(3,ient) = -surf(3,ient)/vv
+
+! On se fixe, par exemple, x1 = 0 et y1 = 1 et on norme le vecteur
+
+ dir1(1,ient) = 0.d0
+ dir1(2,ient) = 1.d0
+ if (abs(dir3(3,ient)).gt.epzero) then
+ dir1(3,ient) = -dir3(2,ient)/dir3(3,ient)
+ else
+ dir1(3,ient) = 0.d0
+ endif
+
+ vv = sqrt(dir1(1,ient)**2 + dir1(2,ient)**2 + dir1(3,ient)**2)
+
+ dir1(1,ient) = dir1(1,ient)/vv
+ dir1(2,ient) = dir1(2,ient)/vv
+ dir1(3,ient) = dir1(3,ient)/vv
+
+! On obtient le dernier vecteur par produit vectoriel des deux autres
+
+ dir2(1,ient) = &
+ dir3(2,ient)*dir1(3,ient) - dir3(3,ient)*dir1(2,ient)
+ dir2(2,ient) = &
+ dir3(3,ient)*dir1(1,ient) - dir3(1,ient)*dir1(3,ient)
+ dir2(3,ient) = &
+ dir3(1,ient)*dir1(2,ient) - dir3(2,ient)*dir1(1,ient)
+
+endif
+
+! - Changement de repere (on suppose que les vecteurs sont normes)
+
+do ii = 1, ncevor
+ xx = xyz(ii,1) - cen(1,ient)
+ yy = xyz(ii,2) - cen(2,ient)
+ zz = xyz(ii,3) - cen(3,ient)
+ yzcel(ii,1) = dir1(1,ient)*xx+dir1(2,ient)*yy+dir1(3,ient)*zz
+ yzcel(ii,2) = dir2(1,ient)*xx+dir2(2,ient)*yy+dir2(3,ient)*zz
+enddo
+
+! - Dimensions min et max de l entree
+
+ymax(ient) = -grand
+ymin(ient) = grand
+zmax(ient) = -grand
+zmin(ient) = grand
+do ii = 1, ncevor
+ ymax(ient) = max(ymax(ient),yzcel(ii,1))
+ ymin(ient) = min(ymin(ient),yzcel(ii,1))
+ zmax(ient) = max(zmax(ient),yzcel(ii,2))
+ zmin(ient) = min(zmin(ient),yzcel(ii,2))
+enddo
+
+! - Verification
+
+if(icas(ient).eq.1) then
+ if(lly(ient).lt.ymax(ient)-ymin(ient).or. &
+ llz(ient).lt.zmax(ient)-zmin(ient)) then
+ write(nfecra,2000) ient
+ call csexit(1)
+ endif
+elseif(icas(ient).eq.2) then
+ if(lld(ient).lt.ymax(ient)-ymin(ient).or. &
+ lld(ient).lt.zmax(ient)-zmin(ient)) then
+ write(nfecra,2000) ient
+ call csexit(1)
+ endif
+endif
+!===============================================================================
+! 2. IMPRESSIONS DES PARAMETES A CHAQUE ENTREE
+!===============================================================================
+
+call vorimp(ient)
+!==========
+!===============================================================================
+! 3. REMPLISSAGE DES TABLEAUX DE DONNEES EN ENTREE
+!===============================================================================
+
+iun = 1
+
+if(icas(ient).eq.1.or.icas(ient).eq.2.or.icas(ient).eq.3) then
+ open(file=ficvor(ient),unit=impdvo)
+ rewind(impdvo)
+ do ii = 1, ndat(ient)
+ read(impdvo,*) &
+ xdat(ii,ient) , ydat(ii,ient) , zdat(ii,ient) , &
+ udat(ii,ient) , vdat(ii,ient) , wdat(ii,ient) , &
+ dudat(ii,ient), kdat(ii,ient) , epsdat(ii,ient)
+ enddo
+ close(impdvo)
+ write(nfecra,3000)
+elseif(icas(ient).eq.4) then
+ xdat(1,ient) = cen(1,ient)
+ ydat(1,ient) = cen(2,ient)
+ zdat(1,ient) = cen(3,ient)
+ udat(1,ient) = udebit(ient)
+ vdat(1,ient) = 0.d0
+ wdat(1,ient) = 0.d0
+ dudat(1,ient) = 0.d0
+ kdat(1,ient) = kdebit(ient)
+ epsdat(1,ient) = edebit(ient)
+endif
+
+! On suppose que les donnees sont fournies
+! dans le repere du calcul (et non dans le repere local).
+! C'est plus simple pour l'utilisateur, et plus
+! naturel pour faire du couplage
+
+do ii = 1, ndat(ient)
+ xx = xdat(ii,ient) - cen(1,ient)
+ yy = ydat(ii,ient) - cen(2,ient)
+ zz = zdat(ii,ient) - cen(3,ient)
+ uu = udat(ii,ient)
+ vv = vdat(ii,ient)
+ ww = wdat(ii,ient)
+ ydat(ii,ient) = dir1(1,ient)*xx+dir1(2,ient)*yy+dir1(3,ient)*zz
+ zdat(ii,ient) = dir2(1,ient)*xx+dir2(2,ient)*yy+dir2(3,ient)*zz
+ udat(ii,ient) = dir3(1,ient)*uu+dir3(2,ient)*vv+dir3(3,ient)*ww
+ vdat(ii,ient) = dir1(1,ient)*uu+dir1(2,ient)*vv+dir1(3,ient)*ww
+ wdat(ii,ient) = dir2(1,ient)*uu+dir2(2,ient)*vv+dir2(3,ient)*ww
+enddo
+
+! --- Verfication des donnees
+
+iok = 0
+do ii = 1, ndat(ient)
+ if(udat(ii,ient).le.0.d0.or.kdat(ii,ient).le.0.d0.or. &
+ epsdat(ii,ient).le.0.d0) then
+ write(nfecra,3100) ient
+ call csexit (1)
+ endif
+ if(icas(ient).eq.1) then
+ if(ydat(ii,ient).lt.-lly(ient)/2.d0.or. &
+ ydat(ii,ient).gt.lly(ient)/2.d0.or. &
+ zdat(ii,ient).lt.-llz(ient)/2.d0.or. &
+ zdat(ii,ient).gt.llz(ient)/2.d0) then
+ iok = iok + 1
+ endif
+ elseif(icas(ient).eq.2) then
+ if(ydat(ii,ient).lt.-lld(ient)/2.d0.or. &
+ ydat(ii,ient).gt.lld(ient)/2.d0.or. &
+ zdat(ii,ient).lt.-lld(ient)/2.d0.or. &
+ zdat(ii,ient).gt.lld(ient)/2.d0) then
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+if(iok.gt.0) then
+ write(nfecra,3200) ient
+endif
+
+!===============================================================================
+! 4. LECTURE DU FICHIER SUITE / INITIALISATION DU CHAMP DE VORTEX
+!===============================================================================
+
+if(isuivo.eq.1) then
+
+ if(ient.eq.1) then
+ open(unit=impmvo,file=ficmvo)
+ rewind(impmvo)
+ endif
+
+ read(impmvo,100) iient
+ read(impmvo,100) ivort
+ if(ivort.ne.nvor.or.iient.ne.ient) then
+ write(nfecra,4500) ient, ivort, nvor
+ initvo(ient) = 1
+ else
+ do ii = 1, nvor
+ read(impmvo,200) yzvor(ii,1), yzvor(ii,2), &
+ temps(ii), tpslim(ii), signv(ii)
+ enddo
+ initvo(ient) = 0
+ write(nfecra,4000)
+ endif
+
+ if(ient.eq.nnent) then
+ close(impmvo)
+ endif
+
+endif
+
+if(isuivo.eq.0.or.initvo(ient).eq.1) then
+
+!-------------------------------
+! Tirage des positions
+!-------------------------------
+ iun = 1
+ if(icas(ient).eq.1)then
+ do ii = 1, nvor
+ call zufall(iun,drand(1))
+ yzvor(ii,1) = lly(ient) * drand(1) - lly(ient)/2.d0
+ call zufall(iun,drand(1))
+ yzvor(ii,2) = llz(ient) * drand(1) - llz(ient)/2.d0
+ enddo
+ elseif(icas(ient).eq.2) then
+ do ii = 1, nvor
+ 15 continue
+ call zufall(iun,drand(1))
+ yzvor(ii,1) = lld(ient) * drand(1) - lld(ient)/2.0d0
+ call zufall(iun,drand(1))
+ yzvor(ii,2) = lld(ient) * drand(1) - lld(ient)/2.0d0
+ if ((yzvor(ii,1)**2+yzvor(ii,2)**2).gt. &
+ (lld(ient)/2.d0)**2) then
+ goto 15
+ endif
+ enddo
+ elseif(icas(ient).eq.3.or.icas(ient).eq.4) then
+ do ii = 1, nvor
+ call zufall(iun,drand(1))
+ yzvor(ii,1) = ymin(ient) + lly(ient) * drand(1)
+ call zufall(iun,drand(1))
+ yzvor(ii,2) = zmin(ient) + llz(ient) * drand(1)
+ enddo
+ endif
+!--------------
+! Duree de vie
+!--------------
+ if(itlivo(ient).eq.1) then
+ do ii = 1, nvor
+ call zufall(iun,drand(1))
+ temps(ii) = drand(1)*tlimvo(ient)
+
+! on fait cela pour que les vortex ne disparaissent pas tous
+! en meme temps .
+
+ tpslim(ii) = tlimvo(ient)
+ enddo
+ elseif(itlivo(ient).eq.2) then
+ do ii = 1, nvor
+ yy = yzvor(ii,1)
+ zz = yzvor(ii,2)
+ iii = 0
+ u_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),udat(1,ient),iii)
+ ek_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),kdat(1,ient),iii)
+ ee_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),epsdat(1,ient),iii)
+ tpslim(ii) = 5.d0*cmu*ek_vor**(3.d0/2.d0)/ee_vor
+ tpslim(ii) = tpslim(ii)/u_vor
+ temps(ii) = 0.d0
+ enddo
+ endif
+!------------------
+! Sens de rotation
+!------------------
+ do ii = 1, nvor
+ signv(ii) = 1.d0
+ call zufall(iun,drand(1))
+ if (drand(1).lt.0.5d0) signv(ii) = -1.d0
+ enddo
+endif
+
+!===============================================================================
+! 5. AJOUT DE LA VITESSE MOYENNE POUR U
+!===============================================================================
+
+do ii = 1, ncevor
+ yy = yzcel(ii,1)
+ zz = yzcel(ii,2)
+ iii = 0
+ u_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),udat(1,ient),iii)
+ xu(ii)= u_vor
+enddo
+
+!===============================================================================
+! 6. RECHERCHE DE LA FACE LA PLUS PROCHE DE CHAQUE VORTEX
+!===============================================================================
+do ii = 1, nvor
+ kk = 0
+ dd = grand
+ do jj = 1, ncevor
+ if(((yzcel(jj,1)-yzvor(ii,1))**2+ &
+ (yzcel(jj,2)-yzvor(ii,2))**2).lt.dd)then
+ dd = (yzcel(jj,1)-yzvor(ii,1))**2 &
+ +(yzcel(jj,2)-yzvor(ii,2))**2
+ kk = jj
+ endif
+ enddo
+ ivorce(ii) = kk
+enddo
+
+! FORMATS
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+' ',/,&
+' ** METHODE DES VORTEX ',/,&
+' ------------------ ',/,&
+' NNENT = ',4X,I10, ' (Nombre d entrees )',/,&
+' ISUIVO = ',4X,I10, ' (1 : suite de calcul )' )
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES DIMENSIONS MAX DE L''ENTREE SONT INCOMPATIBLES AVEC ',/,&
+'@ LES DONNEES A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3000 format( &
+' ',/,&
+' -- Fin de la lecture du fichier de donnees ',/)
+ 3100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ U, K ET EPSILON SONT DES GRANDEURS QUI SONT DEFINIES ',/,&
+'@ POSITIVES DANS LE REPERE LOCAL DE L''ENTREE ',/,&
+'@ ',/,&
+'@ VERIFIER LE FICHIER DE DONNEE DE L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES DIMENSIONS MAX DE L''ENTREE SONT INCOMPATIBLES AVEC ',/,&
+'@ CELLES DU FICHIER DE DONNEES ',/,&
+'@ ',/,&
+'@ VERIFIER LE FICHIER DE DONNEE DE L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4000 format( &
+' -- Fin de la lecture du fichier suite ',/)
+
+ 4500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE NOMBRE DE VORTEX A CHANGE A L''ENTREE',I10 ,/,&
+'@ NVORT VALAIT PRECECEDEMENT ',I10 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ET VAUT MAINTENANT ',I10 ,/,&
+'@ ',/,&
+'@ LA METHODE EST REINITIALISE A CETTE ENTREE ',/,&
+'@ ',/,&
+'@ Le calcul sera execute ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 100 format(i10)
+ 200 format(5e13.5)
+
+#else
+
+ 1000 format( &
+' ',/,&
+' ** VORTEX METHOD ',/,&
+' ------------- ',/,&
+' NNENT = ',4X,I10, ' (Number of inlets )',/,&
+' ISUIVO = ',4X,I10, ' (1: calculation restart )' )
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE MAX DIMENSIONS OF THE INLET ARE INCOMPATIBLE WITH ',/,&
+'@ THE DATA AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3000 format( &
+' ',/,&
+' -- End reading the data file ',/)
+ 3100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ U, K AND EPSILON ARE QUANTITIES WHICH MUST BE POSITIVE ',/,&
+'@ IN THE LOCAL FRAME OF THE INLET ',/,&
+'@ ',/,&
+'@ VERIFY THE DATA FILE FOR THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE MAX DIMENSIONS OF THE INLET ARE INCOMPATIBLE WITH ',/,&
+'@ THE ONES FROM THE DATA FILE ',/,&
+'@ ',/,&
+'@ VERIFY THE DATA FILE FOR THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4000 format( &
+' -- End reading the restart file ',/)
+
+ 4500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE NUMBER OF VORTICES HAS CHANGED AT THE INLET ',I10 ,/,&
+'@ NVORT WAS PREVIOUSLY ',I10 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ IT IS CURRENTLY ',I10 ,/,&
+'@ ',/,&
+'@ THE METHOD IS RE-INITIALIZED AT THIS INLET ',/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 100 format(i10)
+ 200 format(5e13.5)
+
+#endif
+
+return
+end
diff --git a/src/base/vorlgv.f90 b/src/base/vorlgv.f90
new file mode 100644
index 0000000..a0608d9
--- /dev/null
+++ b/src/base/vorlgv.f90
@@ -0,0 +1,148 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vorlgv &
+!================
+
+ ( ncevor , ient , dtref , &
+ yzcel , xu , xv , xw )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! GENRATION DES FLUCUTUATIONS DE VITESSE DANS LA DIRECTION
+! PRINCIPALE A PARTIR DE L'EQUATION DE LANGEVIN
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncevor ! e ! <-- ! nombre de face a l'entree ou est !
+! ! ! ! utilise la methode !
+! ient ! e ! <-- ! numero de l'entree !
+! dtref ! r ! <-- ! pas de temps !
+! yzcel ! tr ! <-- ! coordonnees des faces d'entree dans !
+! (icvmax ,2) ! ! ! le referentiel local !
+! xu(icvmax) ! tr ! <-- ! composante de vitesse principale !
+! xv(icvmax) ! tr ! <-- ! composantes de vitesse transverses !
+! xw(icvmax) ! tr ! <-- ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncevor, ient
+
+double precision dtref
+double precision yzcel(icvmax ,2)
+double precision xu(icvmax ), xv(icvmax ), xw(icvmax )
+
+! VARIABLES LOCALES
+
+integer ii, iii, iun
+double precision dw1(1)
+
+double precision cst1, cst2
+parameter (cst1 = 1.8d0)
+parameter (cst2 = 0.6d0)
+
+double precision sinth, costh
+double precision norme, ufluc, ek_vor, ee_vor, u_vor, du_vor
+double precision phidat, vfluc, yy, zz
+
+!===============================================================================
+! 1. CALCUL DES FLUCTUATIONS DE VITESSE (SELON LA DIRECTION X)
+!===============================================================================
+
+iun = 1
+
+do ii = 1, ncevor
+ yy = yzcel(ii,1)
+ zz = yzcel(ii,2)
+
+ iii = 0
+ u_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),udat(1,ient),iii)
+
+ if(icas(ient).eq.2) then
+ du_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),dudat(1,ient),iii)
+ ek_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),kdat(1,ient),iii)
+ ee_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),epsdat(1,ient),iii)
+
+ ufluc = xu(ii) - u_vor
+
+ norme = sqrt(yzcel(ii,1)**2+yzcel(ii,2)**2)
+ costh = yzcel(ii,1) / norme
+ sinth = yzcel(ii,2) / norme
+ vfluc = - costh*xv(ii) - sinth*xw(ii)
+
+! le signe - vient du fait que l'on veut
+! la fluctuation dans la direction normale
+! a la paroi
+
+ call normalen(iun,dw1(1))
+ ufluc = ( ufluc - &
+ (1.d0-2.d0/3.d0*cst2)*du_vor*vfluc*dtref + &
+ 2.d0* sqrt(2.d0/3.d0*(cst1-1.d0)*ee_vor*dtref) &
+ *dw1(1))
+ ufluc = ufluc/(1.d0+(0.5d0*cst1*dtref*ee_vor &
+ /ek_vor))
+ xu(ii) = u_vor + ufluc
+ else
+ xu(ii) = u_vor
+ endif
+enddo
+
+! ---
+! FIN
+! ---
+
+return
+
+end
diff --git a/src/base/vorpre.f90 b/src/base/vorpre.f90
new file mode 100644
index 0000000..ec62c30
--- /dev/null
+++ b/src/base/vorpre.f90
@@ -0,0 +1,386 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vorpre &
+!================
+
+ ( idbia0 , idbra0 , ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ irepvo , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce , propfa , propfb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE DE PREPATATION DE LA METHODE DES VORTEX
+! Gestion memoire, connectivites, ...
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ifinia ! e ! --> ! numero de la derniere case libre dans !
+! ! ! ! ia apres la reservation memoire !
+! ifinra ! e ! --> ! numero de la derniere case libre dans !
+! ! ! ! ra apres la reservation memoire !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! irepvo ! te ! <-- ! tab entier pour reperage des faces de !
+! ! ! ! bord pour la methode des vortex !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , ifinia , ifinra
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer irepvo(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ii, iphas
+integer ient, ipcvis, ipcrom
+integer iappel
+integer isurf(nentmx)
+double precision xx, yy, zz
+double precision xxv, yyv, zzv
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+nvomax = 0
+do ient = 1, nnent
+ nvomax = max(nvort(ient),nvomax)
+enddo
+
+! NVOMAX = nombre max de vortex (utilise plus tard)
+
+do ient = 1, nnent
+ icvor2(ient) = 0
+enddo
+
+do ifac = 1, nfabor
+ ient = irepvo(ifac)
+ if(ient.ne.0) then
+ icvor2(ient) = icvor2(ient) + 1
+ endif
+enddo
+
+! ICVOR2 = compteur du nombre local de faces
+! utilisant des vortex a l'entree IENT
+
+icvmax = 0
+if(irangp.ge.0) then
+ do ient = 1, nnent
+ icvor(ient) = icvor2(ient)
+ call parcpt(icvor(ient))
+ !==========
+ icvmax = max(icvmax,icvor(ient))
+ enddo
+else
+ do ient = 1, nnent
+ icvor(ient) = icvor2(ient)
+ icvmax = max(icvmax,icvor(ient))
+ enddo
+endif
+
+! ICVOR = nombre global de faces utilisant des vortex a l'entree IENT
+
+! ICVMAX = max du nombre global de faces utilisant des vortex
+! (toutes entrees confondues).
+
+iappel = 2
+call memvor &
+!==========
+ ( idebia , idebra , iappel , nfabor , ifinia , ifinra )
+
+idebia = ifinia
+idebra = ifinra
+
+!===============================================================================
+! 2. CONSTRUCTION DE LA " GEOMETRIE GOBALE "
+!===============================================================================
+
+do ient = 1, nnent
+ icvor2(ient) = 0
+ xsurfv(ient) = 0.d0
+ isurf(ient) = 0
+enddo
+
+! Chaque processeur stocke dans les tableaux RA(IW1X),...
+! les coordonnees des faces ou il doit ensuite utiliser des vortex
+
+iphas = 1
+ipcvis = ipproc(iviscl(iphas))
+ipcrom = ipproc(irom(iphas))
+do ifac = 1, nfabor
+ ient = irepvo(ifac)
+ if(ient.ne.0) then
+ iel = ifabor(ifac)
+ icvor2(ient) = icvor2(ient) + 1
+ ra(iw1x+(ient-1)*icvmax+icvor2(ient)-1)= cdgfbo(1,ifac)
+ ra(iw1y+(ient-1)*icvmax+icvor2(ient)-1)= cdgfbo(2,ifac)
+ ra(iw1z+(ient-1)*icvmax+icvor2(ient)-1)= cdgfbo(3,ifac)
+ ra(iw1v+(ient-1)*icvmax+icvor2(ient)-1) = &
+ propce(iel,ipcvis)/propce(iel,ipcrom)
+ xsurfv(ient) = xsurfv(ient) + sqrt(surfbo(1,ifac)**2 &
+ + surfbo(2,ifac)**2 + surfbo(3,ifac)**2)
+! Vecteur surface d'une face de l'entree
+ if (isurf(ient).eq.0) then
+ surf(1,ient) = surfbo(1,ifac)
+ surf(2,ient) = surfbo(2,ifac)
+ surf(3,ient) = surfbo(3,ifac)
+ isurf(ient) = 1
+ endif
+ endif
+enddo
+
+if(irangp.ge.0) then
+ do ient = 1, nnent
+ call parsom(xsurfv(ient))
+ !==========
+ enddo
+endif
+
+! -------------
+! En parallele
+! -------------
+if(irangp.ge.0) then
+ do ient = 1, nnent
+ call paragv &
+ !==========
+ ( icvor2(ient), icvor(ient), &
+ ra(iw1x + (ient-1)*icvmax) , &
+ ra(ixyzv + (ient-1)*3*icvmax) )
+ call paragv &
+ !==========
+ ( icvor2(ient), icvor(ient), &
+ ra(iw1y + (ient-1)*icvmax) , &
+ ra(ixyzv + (ient-1)*3*icvmax + icvmax) )
+ call paragv &
+ !==========
+ ( icvor2(ient), icvor(ient), &
+ ra(iw1z + (ient-1)*icvmax) , &
+ ra(ixyzv + (ient-1)*3*icvmax + 2*icvmax) )
+ call paragv &
+ !==========
+ ( icvor2(ient), icvor(ient), &
+ ra(iw1v + (ient-1)*icvmax) , &
+ ra(ivisv + (ient-1)*3*icvmax) )
+ enddo
+
+! -> A la fin de cette etape, tous les processeurs connaissent
+! les coordonees des faces d'entree
+
+else
+! ----------------------
+! Sur 1 seul processeur
+! ----------------------
+ do ient = 1,nnent
+ do ii = 1, icvor(ient)
+ ra(ixyzv+(ient-1)*3*icvmax+ii-1)= &
+ ra(iw1x+(ient-1)*icvmax + ii -1)
+ ra(ixyzv+(ient-1)*3*icvmax+icvmax + ii-1) = &
+ ra(iw1y+(ient-1)*icvmax + ii -1)
+ ra(ixyzv+(ient-1)*3*icvmax+2*icvmax + ii-1) = &
+ ra(iw1z+(ient-1)*icvmax + ii -1)
+ ra(ivisv+(ient-1)*icvmax+ii-1) = &
+ ra(iw1v+(ient-1)*icvmax+ii-1)
+ enddo
+ enddo
+endif
+
+!===============================================================================
+! 3. CONSTRUCTION DE LA CONNECTIVITE
+!===============================================================================
+
+do ient = 1, nnent
+ icvor2(ient) = 0
+ do ifac = 1, icvmax
+ ia(iifagl+(ient-1)*icvmax+ifac-1) = 0
+ enddo
+enddo
+
+! On cherche ensuite le numero de la ligne du tableau RA(IXYZV) qui est
+! associe a la Ieme face d'entree utilisant des vortex (dans la
+! numerotation chronologique que suit ICVOR2).
+
+do ifac = 1, nfabor
+ ient = irepvo(ifac)
+ if(ient.ne.0) then
+ icvor2(ient) = icvor2(ient) + 1
+ do ii = 1, icvor(ient)
+ xx = cdgfbo(1,ifac)
+ yy = cdgfbo(2,ifac)
+ zz = cdgfbo(3,ifac)
+ xxv = ra(ixyzv+(ient-1)*3*icvmax+ii-1)
+ yyv = ra(ixyzv+(ient-1)*3*icvmax+icvmax+ii-1)
+ zzv = ra(ixyzv+(ient-1)*3*icvmax+2*icvmax+ii-1)
+ if(abs(xxv-xx).lt.epzero.and.abs(yyv-yy).lt.epzero.and. &
+ abs(zzv-zz).lt.epzero) then
+ ia(iifagl+(ient-1)*icvmax+icvor2(ient)-1) = ii
+ endif
+ enddo
+ endif
+enddo
+
+! La methode de vortex va generer un tableau de vitesse RA(IUVOR)
+! qui aura la meme structure que RA(IXYZV).
+! Le tableau RA(IXYZV) sera envoyee a tous les processeurs
+! la vitesse a imposer � la Ieme face se trouvera � la ligne IA(IIFAGL+I)
+
+iappel = 3
+call memvor &
+!==========
+ ( idebia , idebra , iappel , nfabor , ifinia , ifinra )
+
+! ---
+! FIN
+! ---
+
+return
+end
diff --git a/src/base/vortex.f90 b/src/base/vortex.f90
new file mode 100644
index 0000000..77ac35c
--- /dev/null
+++ b/src/base/vortex.f90
@@ -0,0 +1,208 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vortex &
+!================
+
+ ( ivorce , visco , xyz , &
+ yzcel , xu , xv , xw , &
+ yzvor , yzvora , signv , &
+ sigma , gamma , temps , tpslim )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! GESTION DES ENTREES L.E.S. PAR LA METHODE DES VORTEX
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ivorce ! te ! <-- ! numero du vortex le plus proche d'un !
+! (nvomax) ! ! ! vortex donne !
+! visco ! tr ! <-- ! viscosite cinematique sur les faces !
+!(icvmax,nnent) ! ! ! d'entree !
+! xyz(icvmax,3) ! ! <-- ! coordonnees des cellules d'entree !
+! ! ! ! dans le referentiel global !
+! yzcel ! tr ! <-- ! coordonnees des faces d'entree dans !
+! (nelvmx ,2) ! ! ! le referentiel local !
+! xu(nelvmx) ! tr ! <-- ! composante de vitesse principale !
+! xv(nelvmx) ! tr ! <-- ! composantes de vitesse transverses !
+! xw(nelvmx) ! tr ! <-- ! !
+! yzvor ! tr ! <-- ! coordonnees du centre des vortex !
+! (nvomax,2) ! ! ! !
+! yzvora ! tr ! <-- ! anciennes coordonnees du centre !
+! (nvomax,2) ! ! ! des vortex !
+! signv(nvomax) ! tr ! <-- ! sens de rotation des vortex !
+! sigma ! tr ! <-- ! taille des vortex !
+!(nvomax,nnent) ! ! ! !
+! gamma ! tr ! <-- ! intensite des vortex !
+!(nvomax,2,nnen ! ! ! (dans les deux directions du plan) !
+! temps ! tr ! <-- ! temps ecoule depuis la creation !
+! (nvomax) ! ! ! du vortex !
+! tpslim ! tr ! <-- ! duree de vie du vortex !
+!(nvomax,nnent) ! ! ! !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "optcal.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ivorce(nvomax,nnent)
+
+double precision yzcel(icvmax,2,nnent) , visco(icvmax,nnent)
+double precision xyz(icvmax,3,nnent) , xu(icvmax,nnent)
+double precision xv(icvmax,nnent) , xw(icvmax,nnent)
+double precision yzvor(nvomax,2,nnent) , yzvora(nvomax,2,nnent)
+double precision signv(nvomax,nnent)
+double precision sigma(nvomax,nnent) , gamma(nvomax,2,nnent)
+double precision temps(nvomax,nnent) , tpslim(nvomax,nnent)
+
+! VARIABLES LOCALES
+
+integer ii, ient
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+
+! L'EQUATION DE LANGEVIN RESTE A TRAVAILLER POUR UN CAS 3D QUELCONQUE
+! OU A MODIFIER . VU LE PEU D'IMPORTANCE QU'ELLE A SUR CE QUI SE PASSE
+! EN AVAL DE L'ENTREE (L'IMPORTANT ETANT D'IMPOSER V' ET W'), ON NE VA
+! PAS PLUS LOIN (ON ANNULE CES CONTRIBUTION POUR LE MOMENT POUR LES
+! CAS 3 ET 4)
+
+ipass = ipass + 1
+
+do ient = 1, nnent
+
+ if (ipass.eq.1)then
+
+ call vorini &
+ !==========
+ ( icvor(ient) , nvort(ient) , &
+ ient , ivorce(1,ient) , &
+ xyz(1,1,ient) , yzcel(1,1,ient) , &
+ xu(1,ient) , xv(1,ient) , xw(1,ient) , &
+ yzvor(1,1,ient) , signv(1,ient) , temps(1,ient) , &
+ tpslim(1,ient) )
+
+ endif
+
+!===============================================================================
+! 2. DEPLACEMENT DU VORTEX
+!===============================================================================
+
+ call vordep &
+ !==========
+ ( icvor(ient) , nvort(ient) , ient , dtref , &
+ ivorce(1,ient) , yzcel(1,1,ient) , &
+ xu(1,ient) , xv(1,ient) , xw(1,ient) , &
+ yzvor(1,1,ient) , yzvora(1,1,ient), signv(1,ient) , &
+ temps(1,ient) , tpslim(1,ient) )
+
+!===============================================================================
+! 3. CALCUL DE LA VITESSE
+!===============================================================================
+
+ call vorvit &
+ !==========
+ ( icvor(ient) , nvort(ient) , ient , &
+ ivorce(1,ient) , visco(1,ient) , &
+ yzcel(1,1,ient) , xu(1,ient) , xv(1,ient) , &
+ xw(1,ient) , yzvor(1,1,ient) , signv(1,ient) , &
+ sigma(1,ient) , gamma(1,1,ient) , temps(1,ient) )
+
+!===============================================================================
+! 4. CALCUL DES FLUCTUATIONS DANS LE SENS DE L'ECOULEMENT
+!===============================================================================
+
+ call vorlgv &
+ !==========
+ ( icvor(ient) , ient , dtref , &
+ yzcel(1,1,ient) , xu(1,ient) , &
+ xv(1,ient) , xw(1,ient) )
+
+enddo
+
+!===============================================================================
+! 5. ECRITURE DU FICHIER SUITE
+!===============================================================================
+
+! on ecrit a tous les pas de temps pour eviter
+! les mauvaises surprises en cas de fin prematuree.
+! Il ne faut pas mettre cette partie dans la boucle sur IENT
+! car on accede deja a l'unite IMPMVO(=IMPDVO) dans VORINI.
+! Seul le premier processeur ecrit (test avant l'appel � VORTEX)
+
+open(unit=impvvo,file=ficvvo)
+rewind(impvvo)
+do ient = 1, nnent
+ write(impvvo,100) ient
+ write(impvvo,100) nvort(ient)
+ do ii = 1, nvort(ient)
+ write(impvvo,200) yzvor(ii,1,ient),yzvor(ii,2,ient), &
+ temps(ii,ient), tpslim(ii,ient), signv(ii,ient)
+ enddo
+enddo
+close(impvvo)
+
+!===============================================================================
+! 6. FIN
+!===============================================================================
+
+! FORMATS
+
+ 100 format(i10)
+ 200 format(5e13.5)
+
+return
+
+end
diff --git a/src/base/vorver.f90 b/src/base/vorver.f90
new file mode 100644
index 0000000..dd61bae
--- /dev/null
+++ b/src/base/vorver.f90
@@ -0,0 +1,1095 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vorver &
+!================
+
+ ( nfabor , irepvo , iappel )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL DE LA METHODE DES VORTEX
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! irepvo ! te ! <-- ! numero de l'entree associe a chaque !
+! (nfabor) ! ! ! face de bord (=0 si pas de vortex) !
+! iappel ! e ! <-- ! indique les donnes a verifier !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "optcal.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nfabor , irepvo(nfabor) , iappel
+
+! VARIABLES LOCALES
+
+integer iok, nmax , ii, jj
+double precision norm1, norm2, crosp
+
+!===============================================================================
+
+iok = 0
+
+!===============================================================================
+! 1. IAPPEL = 1
+!===============================================================================
+
+if(iappel.eq.1) then
+
+! --- Nombre d'entree
+
+ if (nnent.gt.nentmx.or.nnent.le.0) then
+ write(nfecra,1000) nentmx, nnent
+ iok = iok + 1
+ endif
+
+! --- Nombre de vortex
+
+ do ii = 1, nnent
+ if(nvort(ii).le.0) then
+ write(nfecra,2000) ii, nvort(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! --- Reperage des entrees
+
+ nmax = 0
+ do ii = 1, nfabor
+ if(irepvo(ii).lt.0.or.irepvo(ii).gt.nnent) then
+ write(nfecra,2200) nnent,irepvo(ii)
+ iok = iok + 1
+ else
+ nmax = max(nmax,irepvo(ii))
+ endif
+ enddo
+ if(irangp.ge.0) then
+ call parcmx(nmax)
+ endif
+ if(nmax.eq.0) then
+ write(nfecra,2200) nnent,nmax
+ iok = iok + 1
+ endif
+
+!===============================================================================
+! 2. IAPPEL = 2
+!===============================================================================
+
+elseif(iappel.eq.2) then
+
+! --- Dimensions des Tableaux
+
+ if (nnent.gt.nentmx.or.nnent.le.0) then
+ write(nfecra,1000) nentmx, nnent
+ iok = iok + 1
+ endif
+
+ nmax = 0
+
+ do ii = 1, nnent
+ if(icas(ii).eq.4) then
+ ndat(ii) = 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(ndat(ii).le.0) then
+ write(nfecra,1100) ndatmx, ndat(ii), ii
+ iok = iok + 1
+ else
+ nmax = max(nmax,ndat(ii))
+ endif
+ if(nmax.gt.ndatmx) then
+ write(nfecra,1100) ndatmx, nmax, ii
+ iok = iok + 1
+ endif
+ enddo
+
+! --- Nombre de vortex
+
+ do ii = 1, nnent
+ if(nvort(ii).le.0) then
+ write(nfecra,2000) ii, nvort(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! --- Suite de calcul
+
+ if(isuivo.ne.0.and.isuivo.ne.1) then
+ write(nfecra,2100) isuivo
+ iok = iok + 1
+ endif
+
+! --- Reperage des entrees
+
+ nmax = 0
+ do ii = 1, nfabor
+ if(irepvo(ii).lt.0.or.irepvo(ii).gt.nnent) then
+ write(nfecra,2200) nnent,irepvo(ii)
+ iok = iok + 1
+ else
+ nmax = max(nmax,irepvo(ii))
+ endif
+ enddo
+ if(irangp.ge.0) then
+ call parcmx(nmax)
+ endif
+ if(nmax.eq.0) then
+ write(nfecra,2200) nnent,nmax
+ iok = iok + 1
+ endif
+
+! --- Definition du cas
+
+ do ii = 1, nnent
+ if(icas(ii).ne.1.and.icas(ii).ne.2.and. &
+ icas(ii).ne.3.and.icas(ii).ne.4) then
+ write(nfecra,3000) ii, icas(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+! --- Repere locale
+
+ do ii = 1, nnent
+ if (icas(ii).ne.4) then
+ norm1 = dir1(1,ii)**2.d0+dir1(2,ii)**2.d0+dir1(3,ii)**2.d0
+ norm2 = dir1(1,ii)**2.d0+dir1(2,ii)**2.d0+dir1(3,ii)**2.d0
+ crosp = (dir1(2,ii)*dir2(3,ii)-dir1(3,ii)*dir2(2,ii))**2.d0 &
+ + (dir1(1,ii)*dir2(3,ii)-dir1(3,ii)*dir2(1,ii))**2.d0 &
+ + (dir1(1,ii)*dir2(2,ii)-dir1(2,ii)*dir2(1,ii))**2.d0
+ if(abs(norm1*norm2*crosp).lt.epzero) then
+ iok = iok + 1
+ write(nfecra,3100)ii,sqrt(norm1),sqrt(norm2),sqrt(crosp)
+ endif
+ if(abs(norm1-1.d0).gt.epzero.or. &
+ abs(norm2-1.d0).gt.epzero.and. &
+ abs(norm1*norm2*crosp).gt.epzero) then
+ write(nfecra,3150) ii, sqrt(norm1),sqrt(norm2)
+ endif
+ endif
+ enddo
+
+! --- Conditions aux limites
+
+ do ii = 11, nnent
+ if(icas(ii).eq.1) then
+ do jj = 1, 4
+ if(iclvor(jj,ii).ne.1 &
+ .and.iclvor(jj,ii).ne.2 &
+ .and.iclvor(jj,ii).ne.3) then
+ write(nfecra,3200) iclvor(jj,ii), jj, ii
+ iok = iok + 1
+ endif
+ enddo
+ if((iclvor(1,ii).eq.3.and.iclvor(3,ii).ne.3).or. &
+ (iclvor(1,ii).ne.3.and.iclvor(3,ii).eq.3).or. &
+ (iclvor(2,ii).eq.3.and.iclvor(4,ii).ne.3).or. &
+ (iclvor(2,ii).ne.3.and.iclvor(4,ii).eq.3)) then
+ write(nfecra,3250) iclvor(jj,ii), jj, ii
+ iok = iok + 1
+ endif
+ endif
+ enddo
+
+! --- Dimension carateristiques
+
+ do ii = 1, nnent
+ if(icas(ii).eq.1.and.(llz(ii).le.0.d0.or. &
+ lly(ii).le.0.d0)) then
+ write(nfecra,3400) llz(ii), lly(ii), ii
+ iok = iok + 1
+ endif
+ if(icas(ii).eq.2.and.lld(ii).le.0.d0) then
+ write(nfecra,3500) lld(ii), ii
+ iok = iok + 1
+ endif
+ enddo
+
+! --- Parametres pour la duree de vie, la taille, et le deplacement des vortex
+
+ do ii = 1, nnent
+ if(itlivo(ii).ne.1.and.itlivo(ii).ne.2) then
+ write(nfecra,4000) itlivo(ii), ii
+ iok = iok + 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(itlivo(ii).eq.1.and.tlimvo(ii).le.0.d0) then
+ write(nfecra,4100) tlimvo(ii), ii
+ iok = iok + 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(isgmvo(ii).ne.1.and.isgmvo(ii).ne.2.and. &
+ isgmvo(ii).ne.3) then
+ write(nfecra,4200) isgmvo(ii), ii
+ iok = iok + 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(isgmvo(ii).eq.1.and.xsgmvo(ii).le.0.d0) then
+ write(nfecra,4300) xsgmvo(ii), ii
+ iok = iok + 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(idepvo(ii).ne.1.and.idepvo(ii).ne.2.and. &
+ idepvo(ii).ne.3) then
+ write(nfecra,4400) idepvo(ii), ii
+ iok = iok + 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(idepvo(ii).eq.1.and.ud(ii).le.0.d0) then
+ write(nfecra,4500) ud(ii), ii
+! IOK = IOK + 1
+ endif
+ enddo
+
+! --- Donnees utilisateur
+
+ do ii = 1, nnent
+ if(icas(ii).eq.4.and.udebit(ii).le.0.d0) then
+ write(nfecra,5000) ii, udebit(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(icas(ii).eq.4.and.kdebit(ii).le.0.d0) then
+ write(nfecra,5100) ii, kdebit(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+ do ii = 1, nnent
+ if(icas(ii).eq.4.and.edebit(ii).le.0.d0) then
+ write(nfecra,5200) ii, edebit(ii)
+ iok = iok + 1
+ endif
+ enddo
+
+endif
+!===============================================================================
+! 3. FORMATS
+!===============================================================================
+
+#if defined(_CS_LANG_FR)
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NNENT DOIT ETRE UN ENTIER POSITIF INFERIEUR A ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort ou augmenter la taille de NENTMX dans ',/,&
+'@ vortex.h ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NDAT DOIT ETRE UN ENTIER POSITIF INFERIEUR A ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort ou agmenter la taille de NDAT dans ',/,&
+'@ vortex.h ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE NOMBRE DE VORTEX NVORT A L''ENTREE',I10 ,/,&
+'@ DOIT ETRE UN ENTIER POSITIF ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ISUIVO DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ IREPVO INDIQUE LE NUMERO DE L''ENTREE ',/,&
+'@ IL S AGIT D UN ENTIER POSITIF INFERIEUR OU EGAL A ',I10 ,/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ICAS INDIQUE LE CAS TRAITE ',/,&
+'@ IL S AGIT D UN ENTIER POSITIF INFERIEUR OU EGAL A 4 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES VECTEURS DIR1 ET DIR2 NE PEUVENT ETRE NI NULS ',/,&
+'@ NI COLINEAIRES ',/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ||DIR1|| VAUT ',E14.5 ,/,&
+'@ ||DIR2|| VAUT ',E14.5 ,/,&
+'@ ||DIR1 ^ DIR2 || VAUT ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3150 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES VECTEURS DIR1 ET DIR2 NE SONT PAS NORMES ',/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ||DIR1|| VAUT ',E14.5 ,/,&
+'@ ||DIR2|| VAUT ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ICLVOR INDIQUE LE TYPE DE CONDITION AUX LIMITES ',/,&
+'@ IL S AGIT D UN ENTIER POSITIF INFERIEUR OU EGAL A 4 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ SUR LE COTE ',I10 ,/,&
+'@ DE L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3250 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ VERFIFIER LA COHERENCE DES CONDITION AUX LIMITES ',/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ NOMBRE IMPAIR DE CONDITIONS PERIODIQUES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LLY ET LLZ SONT LES DIMENSIONS DE L''ENTREE ',/,&
+'@ ELLES VALENT ICI ',E14.5, ' ET ',E14.5 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LLD EST LE DIAMETRE DE LA CONDUITE ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ITLIVO INDIQUE LE TYPE DE MODELE UTILISE POUR CALCULER ',/,&
+'@ LA DUREE DE VIE DES VORTEX ',/,&
+'@ IL S AGIT D UN ENTIER POSITIF INFERIEUR OU EGAL A 2 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ TLIMVO EST LA DUREE DE VIE MAXIMALE DES VORTEX ',/,&
+'@ ELLE VAUT ICI ',E14.5 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ISGMVO INDIQUE LE TYPE DE MODELE UTILISE POUR CALCULER ',/,&
+'@ LA TAILLE DES VORTEX ',/,&
+'@ IL S AGIT D UN ENTIER POSITIF INFERIEUR OU EGAL A 3 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ XSGMVO EST LA TAILLE MAXIMALE DES VORTEX ',/,&
+'@ ELLE VAUT ICI ',E14.5 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ IDEPVO INDIQUE LE TYPE DE MODELE UTILISE POUR CALCULER ',/,&
+'@ LE DEPLACEMENT DES VORTEX ',/,&
+'@ IL S AGIT D UN ENTIER POSITIF INFERIEUR OU EGAL A 3 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ UD EST LA VITESSE MAXIMALE DE DEPLCAMENT DES VORTEX ',/,&
+'@ ELLE VAUT ICI ',E14.5 ,/,&
+'@ A L''ENTREE ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul sera execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LA VITESSE DEBITANTE UDEBIT A L''ENTREE ',I10 ,/,&
+'@ VAUT ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ L ENERGIE CINETIQUE KDEBIT A L''ENTREE ',I10 ,/,&
+'@ VAUT ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LA DISSIPATION EDEBIT A L''ENTREE ',I10 ,/,&
+'@ VAUT ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ NNENT MUST BE A POSITIVE INTEGER LOWER THAN',I10 ,/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort or increase the size of NENTMX in vortex.h ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ NDAT MUST BE A POSITIVE INTEGER LOWER THAN ',I10 ,/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort or increase the size of NDAT in vortex.h ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE NUMBER OF VORTICES NVORT AT THE INLET ',I10 ,/,&
+'@ MUST BE A POSITIVE INTEGER ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ISUIVO MUST BE AN INTEGER EQUAL TO 0 OR 1 ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ IREPVO GIVES THE INLET NUMBER ',/,&
+'@ IT IS A POSITIVE INTEGER LOWER THAN ',I10 ,/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ICAS GIVES THE CHOSEN CASE ',/,&
+'@ IT IS A POSITIVE INTEGER LOWER THAN 4 ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE VECTORS DIR1 AND DIR2 CANNOT BE NULL NOR COLINEAR ',/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ||DIR1|| IS ',E14.5 ,/,&
+'@ ||DIR2|| IS ',E14.5 ,/,&
+'@ ||DIR1 ^ DIR2 || IS ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3150 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE VECTORS DIR1 AND DIR2 ARE NOT NORMED ',/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ||DIR1|| IS ',E14.5 ,/,&
+'@ ||DIR2|| IS ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ICLVOR GIVES THE TYPE OF THE BOUNDARY CONDITIONS ',/,&
+'@ IT IS A POSITIVE INTEGER LOWER THAN 4 ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ ON THE SIDE ',I10 ,/,&
+'@ OF THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3250 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ VERIFY THE COHERENCY OF THE BOUNDARY CONDITIONS ',/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ODD NUMBER OF PERIODIC CONDITIONS ',/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ LLY AND LLZ ARE THE INLET DIMENSIONS ',/,&
+'@ THEIR VALUES ARE ',E14.5, ' AND ',E14.5 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ LLD IS THE PIPE DIAMETER ',/,&
+'@ ITS VALUE IS ',E14.5 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ITLIVO GIVES THE MODEL TYPE USED TO COMPUTE THE ',/,&
+'@ VORTICES LIFE TIME ',/,&
+'@ IT IS A POSITIVE INTEGER LOWER THAN OR EQUAL TO 2 ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ TLIMVO IS THE MAXIMUM LIFE TIME OF THE VORTICES ',/,&
+'@ ITS VALUE IS ',E14.5 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ ISGMVO GIVES THE MODEL TYPE USED TO COMPUTE THE ',/,&
+'@ VORTICES SIZE ',/,&
+'@ IT IS A POSITIVE INTEGER LOWER THAN OR EQUAL TO 3 ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ XSGMVO IS THE MAXIMUM SIZE OF THE VORTICES ',/,&
+'@ ITS VALUE IS ',E14.5 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ IDEPVO GIVES THE MODEL TYPE USED TO COMPUTE THE ',/,&
+'@ VORTICES DISPLACEMENT ',/,&
+'@ IT IS A POSITIVE INTEGER LOWER THAN OR EQUAL TO 3 ',/,&
+'@ ITS VALUE IS ',I10 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ UD IS THE MAXIMUM DISPLACEMENT VELOCITY OF THE VORTICES ',/,&
+'@ ITS VALUE IS ',E14.5 ,/,&
+'@ AT THE INLET ',I10 ,/,&
+'@ ',/,&
+'@ The calculation will be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE INLET VELOCITY UDEBIT AT THE INLET ',I10 ,/,&
+'@ IS ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE INLET KINETIC ENERGY KDEBIT AT THE INLET ',I10 ,/,&
+'@ IS ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE INLET DISSIPATION EDEBIT AT THE INLET ',I10 ,/,&
+'@ IS ',E14.5 ,/,&
+'@ ',/,&
+'@ The calculation will not be run. ',/,&
+'@ ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+#endif
+
+!===============================================================================
+! 3. SORTIE ET IMPRESSIONS FINALES
+!===============================================================================
+
+if(iok.gt.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+else
+ write(nfecra,9998)
+endif
+
+#if defined(_CS_LANG_FR)
+
+ 9998 format( &
+' ',/,&
+' Pas d''erreur detectee lors de la verification des donnees ',/,&
+' pour la methode des vortex (usvort). ',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#else
+
+ 9998 format( &
+' ',/,&
+' No error detected during the verification of the parameters ',/,&
+' for the vortex method (usvort). ',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ WARNING: ABORT IN THE DATA SPECIFICATION ',/,&
+'@ ======== ',/,&
+'@ THE CALCULATION PARAMETERS ARE INCOHERENT OR INCOMPLETE ',/,&
+'@ ',/,&
+'@ The calculation will not be run (',I10,' errors). ',/,&
+'@ ',/,&
+'@ Refer to the previous warnings for further information. ',/,&
+'@ Verify usvort. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#endif
+
+return
+end
diff --git a/src/base/vorvit.f90 b/src/base/vorvit.f90
new file mode 100644
index 0000000..b17cf25
--- /dev/null
+++ b/src/base/vorvit.f90
@@ -0,0 +1,448 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine vorvit &
+!================
+
+ ( ncevor , nvor , ient , ivorce , visco , &
+ yzcel , xu , xv , xw , &
+ yzvor , signv , sigma , gamma , temps )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! METHODE DES VORTEX POUR LES CONDITIONS AUX LIMITES D'ENTREE EN
+! L.E.S. : CALCUL DES LA VITESSE DES VORTEX
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncevor ! e ! <-- ! nombre de face a l'entree ou est !
+! ! ! ! utilise la methode !
+! nvor ! e ! ! nombre de vortex a l'entree ou est !
+! ! ! ! utilisee la methode !
+! ient ! e ! <-- ! numero de l'entree ou est utilisee !
+! ! ! ! la methode !
+! ivorce ! te ! <-- ! numero du vortex le plus proche d'une !
+! (nvomax) ! ! ! face donnee !
+! visco ! tr ! <-- ! viscosite cinematique sur les faces !
+!(icvmax,nnent) ! ! ! d'entree !
+! yzcel ! tr ! <-- ! coordonnees des faces d'entree dans !
+! (icvmax ,2) ! ! ! le referentiel local !
+! xu(icvmax) ! tr ! <-- ! composante de vitesse principale !
+! xv(icvmax) ! tr ! <-- ! composantes de vitesse transverses !
+! xw(icvmax) ! tr ! <-- ! !
+! yzvor ! tr ! <-- ! coordonnees du centre des vortex !
+! (nvomax,2) ! ! ! !
+! signv(nvomax) ! tr ! <-- ! sens de rotation des vortex !
+! sigma ! tr ! <-- ! taille des vortex !
+!(nvomax,nnent) ! ! ! !
+! gamma ! tr ! <-- ! intensite (circulation) des vortex !
+!(nvomax,2,nnen ! ! ! dans les deux directions du plan !
+! temps ! tr ! <-- ! temps ecoule depuis la creation !
+! (nvomax) ! ! ! du vortex !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncevor , nvor , ient
+integer ivorce(nvomax)
+
+double precision yzcel(icvmax,2) , visco(icvmax)
+double precision xu(icvmax ) , xv(icvmax ) , xw(icvmax )
+double precision yzvor(nvomax,2) , signv(nvomax) , sigma(nvomax)
+double precision gamma(nvomax,2) , temps(nvomax)
+
+! VARIABLES LOCALES
+
+
+integer ii, jj, iii
+
+double precision yy, zz, xvisc
+double precision norme, vv, ww, theta, dv, dw
+double precision yparoi, zparoi, yperio, zperio, ysym, zsym
+double precision phidat
+double precision alpha, ek_vor, ee_vor, v_vor, w_vor
+double precision lt, lk, deuxpi
+
+!===============================================================================
+! 1. CALCUL DE GAMMA
+!===============================================================================
+
+alpha = 4.d0 * sqrt(pi * xsurfv(ient)/ &
+ (3.d0 * nvor*(2.d0*log(3.d0)-3.d0*log(2.d0))))
+
+do ii = 1, nvor
+ yy = yzvor(ii,1)
+ zz = yzvor(ii,2)
+ iii = 0
+ ek_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),kdat(1,ient),iii)
+ gamma(ii,1) = alpha*sqrt(ek_vor)*signv(ii)
+ gamma(ii,2) = gamma(ii,1)
+enddo
+
+!===============================================================================
+! 2. CALCUL DE SIGMA
+!===============================================================================
+
+if(isgmvo(ient).eq.1) then
+ do ii = 1, nvor
+ sigma(ii) = xsgmvo(ient)
+ enddo
+elseif (isgmvo(ient).eq.2) then
+ do ii = 1, nvor
+ yy = yzvor(ii,1)
+ zz = yzvor(ii,2)
+ iii = 0
+ ek_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),kdat(1,ient),iii)
+ ee_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),epsdat(1,ient),iii)
+ sigma(ii) = (cmu**(0.75d0))*(ek_vor**(1.5d0))/ee_vor
+ enddo
+elseif (isgmvo(ient).eq.3) then
+ do ii = 1, nvor
+ yy = yzvor(ii,1)
+ zz = yzvor(ii,2)
+ iii = 0
+ ek_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),kdat(1,ient),iii)
+ ee_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),epsdat(1,ient),iii)
+ xvisc = visco(ivorce(ii))
+ lt = sqrt(5.d0*xvisc*ek_vor/ee_vor)
+ lk = 200.d0*(xvisc**3/ee_vor)**(0.25d0)
+ sigma(ii) = max(lt,lk)
+ enddo
+endif
+
+!===============================================================================
+! 3. CALCUL DU CHAMP DE VITESSE INDUIT (AU CENTRE DES CELLULES)
+!===============================================================================
+
+deuxpi = 2.d0*pi
+
+do ii = 1, ncevor
+ vv = 0.d0
+ ww = 0.d0
+ do jj = 1, nvor
+ yy = yzvor(jj,1)-yzcel(ii,1)
+ zz = yzvor(jj,2)-yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+
+!===============================================================================
+! 4. TRAITEMENT DES CONDITIONS AUX LIMITES
+!===============================================================================
+! suite des boucles en DO
+! -----------------------
+! Conduite rectangulaire
+! -----------------------
+ if(icas(ient).eq.1) then
+
+! Periodicites
+
+ if(iclvor(1,ient).eq.3) then
+ if(yzvor(jj,1).gt.0.d0) then
+ yperio = yzvor(jj,1) - lly(ient)
+ zperio = yzvor(jj,2)
+ else
+ yperio = yzvor(jj,1) + lly(ient)
+ zperio = yzvor(jj,2)
+ endif
+ yy = yperio - yzcel(ii,1)
+ zz = zperio - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+ endif
+
+ if(iclvor(2,ient).eq.3) then
+ if(yzvor(jj,2).gt.0.d0) then
+ yperio = yzvor(jj,1)
+ zperio = yzvor(jj,2) - llz(ient)
+ else
+ yperio = yzvor(jj,1)
+ zperio = yzvor(jj,2) + llz(ient)
+ endif
+ yy = yperio - yzcel(ii,1)
+ zz = zperio - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+ endif
+
+! Parois
+
+ if(iclvor(1,ient).eq.1) then
+ yparoi = lly(ient)/2.d0
+ zparoi = yzcel(ii,2)
+ yparoi = 2.d0*yparoi - yzvor(jj,1)
+ zparoi = 2.d0*zparoi - yzvor(jj,2)
+ yy = yparoi - yzcel(ii,1)
+ zz = zparoi - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+ endif
+
+ if(iclvor(3,ient).eq.1) then
+ yparoi = - lly(ient)/2.d0
+ zparoi = yzcel(ii,2)
+ yparoi = 2.d0*yparoi - yzvor(jj,1)
+ zparoi = 2.d0*zparoi - yzvor(jj,2)
+ yy = yparoi - yzcel(ii,1)
+ zz = zparoi - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+ endif
+
+ if(iclvor(2,ient).eq.1) then
+ yparoi = yzcel(ii,1)
+ zparoi = llz(ient)/2.d0
+ yparoi = 2.d0*yparoi - yzvor(jj,1)
+ zparoi = 2.d0*zparoi - yzvor(jj,2)
+ yy = yparoi - yzcel(ii,1)
+ zz = zparoi - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+ endif
+
+ if(iclvor(4,ient).eq.1) then
+ yparoi = yzcel(ii,1)
+ zparoi = -llz(ient)/2.d0
+ yparoi = 2.d0*yparoi - yzvor(jj,1)
+ zparoi = 2.d0*zparoi - yzvor(jj,2)
+ yy = yparoi - yzcel(ii,1)
+ zz = zparoi - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+ endif
+
+! Symetries
+
+ if(iclvor(1,ient).eq.2) then
+ ysym = lly(ient)/2.d0
+ zsym = yzcel(ii,2)
+ ysym = 2.d0*ysym - yzvor(jj,1)
+ zsym = 2.d0*zsym - yzvor(jj,2)
+ yy = ysym - yzcel(ii,1)
+ zz = zsym - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ vv = vv - dv
+ endif
+ endif
+
+ if(iclvor(3,ient).eq.2) then
+ ysym = - lly(ient)/2.d0
+ zsym = yzcel(ii,2)
+ ysym = 2.d0*ysym - yzvor(jj,1)
+ zsym = 2.d0*zsym - yzvor(jj,2)
+ yy = ysym - yzcel(ii,1)
+ zz = zsym - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ vv = vv - dv
+ endif
+ endif
+
+ if(iclvor(2,ient).eq.2) then
+ ysym = yzcel(ii,1)
+ zsym = llz(ient)/2.d0
+ ysym = 2.d0*ysym - yzvor(jj,1)
+ zsym = 2.d0*zsym - yzvor(jj,2)
+ yy = ysym - yzcel(ii,1)
+ zz = zsym - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ ww = ww + dw
+ endif
+ endif
+
+ if(iclvor(4,ient).eq.2) then
+ ysym = yzcel(ii,1)
+ zsym = -llz(ient)/2.d0
+ ysym = 2.d0*ysym - yzvor(jj,1)
+ zsym = 2.d0*zsym - yzvor(jj,2)
+ yy = ysym - yzcel(ii,1)
+ zz = zsym - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ ww = ww + dw
+ endif
+ endif
+
+! --------------------
+! Conduite circulaire
+! --------------------
+ elseif(icas(ient).eq.2) then
+
+ yparoi = yzcel(ii,1)*((lld(ient)/2.0d0) &
+ /sqrt(yzcel(ii,1)**2 + yzcel(ii,2)**2))
+ zparoi = yzcel(ii,2)*((lld(ient)/2.0d0) &
+ /sqrt(yzcel(ii,1)**2 + yzcel(ii,2)**2))
+ yparoi = 2.d0*yparoi - yzvor(jj,1)
+ zparoi = 2.d0*zparoi - yzvor(jj,2)
+
+ yy = yparoi - yzcel(ii,1)
+ zz = zparoi - yzcel(ii,2)
+ norme = yy**2+zz**2
+ alpha = sigma(jj)
+
+ if(norme.gt.epzero.and.norme.lt.4.d0*alpha) then
+ theta = -norme/(2.d0*alpha**2)
+ theta = exp(theta)
+ dv = zz/norme*(1.d0-theta)*gamma(jj,1)*theta/deuxpi
+ dw = yy/norme*(1.d0-theta)*gamma(jj,2)*theta/deuxpi
+ vv = vv - dv
+ ww = ww + dw
+ endif
+
+ endif
+
+ enddo
+ xv(ii) = vv
+ xw(ii) = ww
+enddo
+
+!===============================================================================
+! 5. AJOUT DE LA VITESSE MOYENNE POUR V ET W
+!===============================================================================
+if(icas(ient).eq.1.or.icas(ient).eq.2.or.icas(ient).eq.3) then
+ do ii = 1, ncevor
+ yy = yzcel(ii,1)
+ zz = yzcel(ii,2)
+ iii = 0
+ v_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),vdat(1,ient),iii)
+ w_vor = phidat(nfecra,icas(ient),ndat(ient),yy,zz, &
+ ydat(1,ient),zdat(1,ient),wdat(1,ient),iii)
+ xv(ii) = xv(ii) + v_vor
+ xw(ii) = xw(ii) + w_vor
+ enddo
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/base/zufall.f90 b/src/base/zufall.f90
new file mode 100644
index 0000000..9ecdb08
--- /dev/null
+++ b/src/base/zufall.f90
@@ -0,0 +1,446 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! LIBRAIRIE DE SOUS-PROGRAMMES DE GENERATION DE NOMBRES ALEATOIRES
+!=======================================================================
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+
+! Ce package de sous-programmes a ete telechargee sur
+! http://www.netlib.org/random/zufall.f
+
+
+! README for zufall random number package
+! ------ --- ------ ------ ------ -------
+! This package contains a portable random number generator set
+! for: uniform (u in [0,1)), normal (<g> = 0, <g^2> = 1), and
+! Poisson distributions. The basic module, the uniform generator,
+! uses a lagged Fibonacci series generator:
+
+! t = u(n-273) + u(n-607)
+! u(n) = t - float(int(t))
+
+! where each number generated, u(k), is floating point. Since
+! the numbers are floating point, the left end boundary of the
+! range contains zero. This package is nearly portable except
+! for the following. (1) It is written in lower case, (2) the
+! test package contains a timer (second) which is not portable,
+! and (3) there are cycle times (in seconds) in data statements
+! for NEC SX-3, Fujitsu VP2200, and Cray Y-MP. Select your
+! favorite and comment out the others. Replacement functions
+! for 'second' are included - comment out the others. Otherwise
+! the package is portable and returns the same set of floating
+! point numbers up to word precision on any machine. There are
+! compiler directives ($cdir for Cray, *vdir for SX-3, and VOCL
+! for Fujitsu VP2200) which should be otherwise ignored.
+
+! To compile this beast, note that all floating point numbers
+! are declared 'double precision'. On Cray X-MP, Y-MP, and C-90
+! machines, use the cft77 (cf77) option -dp to run this in 64
+! bit mode (not 128 bit double).
+
+! External documentation, "Lagged Fibonacci Random Number Generators
+! for the NEC SX-3," is to be published in the International
+! Journal of High Speed Computing (1994). Otherwise, ask the
+! author:
+
+! W. P. Petersen
+! IPS, RZ F-5
+! ETHZ
+! CH 8092, Zurich
+! Switzerland
+
+! e-mail: wpp at ips.ethz.ch.
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+subroutine zufall(n,a)
+implicit none
+
+! portable lagged Fibonacci series uniform random number
+! generator with "lags" -273 und -607:
+
+! t = u(i-273)+buff(i-607) (floating pt.)
+! u(i) = t - float(int(t))
+
+double precision a(*)
+double precision buff(607)
+double precision t
+integer i,k,ptr,vl,k273,k607
+integer buffsz,nn,n,left,q,qq
+integer aptr,aptr0,bptr
+
+common /klotz0/buff,ptr
+data buffsz/607/
+
+aptr = 0
+nn = n
+
+1 continue
+
+if(nn .le. 0) return
+
+! factor nn = q*607 + r
+
+q = (nn-1)/607
+left = buffsz - ptr
+
+if(q .le. 1) then
+
+! only one or fewer full segments
+
+ if(nn .lt. left) then
+ do 2 i=1,nn
+ a(i+aptr) = buff(ptr+i)
+2 continue
+ ptr = ptr + nn
+ return
+ else
+ do 3 i=1,left
+ a(i+aptr) = buff(ptr+i)
+3 continue
+ ptr = 0
+ aptr = aptr + left
+ nn = nn - left
+! buff -> buff case
+ vl = 273
+ k273 = 334
+ k607 = 0
+ do 4 k=1,3
+!dir$ ivdep
+ do 5 i=1,vl
+ t = buff(k273+i) + buff(k607+i)
+ buff(k607+i) = t - float(int(t))
+5 continue
+ k607 = k607 + vl
+ k273 = k273 + vl
+ vl = 167
+ if(k.eq.1) k273 = 0
+4 continue
+
+ goto 1
+ endif
+else
+
+! more than 1 full segment
+
+ do 6 i=1,left
+ a(i+aptr) = buff(ptr+i)
+6 continue
+ nn = nn - left
+ ptr = 0
+ aptr = aptr+left
+
+! buff -> a(aptr0)
+
+ vl = 273
+ k273 = 334
+ k607 = 0
+ do 7 k=1,3
+ if(k.eq.1)then
+ do 8 i=1,vl
+ t = buff(k273+i) + buff(k607+i)
+ a(aptr+i) = t - float(int(t))
+8 continue
+ k273 = aptr
+ k607 = k607 + vl
+ aptr = aptr + vl
+ vl = 167
+ else
+!dir$ ivdep
+ do 9 i=1,vl
+ t = a(k273+i) + buff(k607+i)
+ a(aptr+i) = t - float(int(t))
+9 continue
+ k607 = k607 + vl
+ k273 = k273 + vl
+ aptr = aptr + vl
+ endif
+7 continue
+ nn = nn - 607
+
+! a(aptr-607) -> a(aptr) for last of the q-1 segments
+
+ aptr0 = aptr - 607
+ vl = 607
+
+ do 10 qq=1,q-2
+ k273 = 334 + aptr0
+!dir$ ivdep
+ do 11 i=1,vl
+ t = a(k273+i) + a(aptr0+i)
+ a(aptr+i) = t - float(int(t))
+11 continue
+ nn = nn - 607
+ aptr = aptr + vl
+ aptr0 = aptr0 + vl
+10 continue
+
+! a(aptr0) -> buff, last segment before residual
+
+ vl = 273
+ k273 = 334 + aptr0
+ k607 = aptr0
+ bptr = 0
+ do 12 k=1,3
+ if(k.eq.1) then
+ do 13 i=1,vl
+ t = a(k273+i) + a(k607+i)
+ buff(bptr+i) = t - float(int(t))
+13 continue
+ k273 = 0
+ k607 = k607 + vl
+ bptr = bptr + vl
+ vl = 167
+ else
+!dir$ ivdep
+ do 14 i=1,vl
+ t = buff(k273+i) + a(k607+i)
+ buff(bptr+i) = t - float(int(t))
+14 continue
+ k607 = k607 + vl
+ k273 = k273 + vl
+ bptr = bptr + vl
+ endif
+12 continue
+ goto 1
+endif
+end
+
+!===============================================================================
+
+subroutine zufalli(seed)
+implicit none
+
+! generates initial seed buffer by linear congruential
+! method. Taken from Marsaglia, FSU report FSU-SCRI-87-50
+! variable seed should be 0 < seed <31328
+
+integer seed
+integer ptr
+double precision s,t
+double precision buff(607)
+integer ij,kl,i,ii,j,jj,k,l,m
+common /klotz0/buff,ptr
+data ij/1802/,kl/9373/
+
+if(seed.ne.0) ij = seed
+
+i = mod(ij/177,177) + 2
+j = mod(ij,177) + 2
+k = mod(kl/169,178) + 1
+l = mod(kl,169)
+do 1 ii=1,607
+ s = 0.0
+ t = 0.5
+ do 2 jj=1,24
+ m = mod(mod(i*j,179)*k,179)
+ i = j
+ j = k
+ k = m
+ l = mod(53*l+1,169)
+ if(mod(l*m,64).ge.32) s = s+t
+ t = .5*t
+2 continue
+ buff(ii) = s
+1 continue
+return
+end
+
+!===============================================================================
+
+subroutine normalen(n,x)
+implicit none
+
+! Box-Muller method for Gaussian random numbers
+
+double precision x(*)
+double precision xbuff(1024)
+integer i,ptr,xptr,first
+integer buffsz,nn,n,left
+common /klotz1/xbuff,first,xptr
+data buffsz/1024/
+
+nn = n
+if(nn .le. 0) return
+if(first.eq.0)then
+ call normal00
+ first = 1
+endif
+ptr = 0
+
+1 continue
+left = buffsz - xptr
+if(nn .lt. left) then
+ do 2 i=1,nn
+ x(i+ptr) = xbuff(xptr+i)
+2 continue
+ xptr = xptr + nn
+ return
+else
+ do 3 i=1,left
+ x(i+ptr) = xbuff(xptr+i)
+3 continue
+ xptr = 0
+ ptr = ptr+left
+ nn = nn - left
+ call normal00
+ goto 1
+endif
+end
+
+!===============================================================================
+
+subroutine normal00
+implicit none
+double precision pi,twopi
+parameter(pi=3.141592653589793)
+double precision xbuff(1024),r1,r2,t1,t2
+integer first,xptr,i
+common /klotz1/xbuff,first,xptr
+
+twopi = 2.*pi
+call zufall(1024,xbuff)
+do 1 i=1,1024,2
+ r1 = twopi*xbuff(i)
+ t1 = cos(r1)
+ t2 = sin(r1)
+ r2 = sqrt(-2.*log(1.-xbuff(i+1)))
+ xbuff(i) = t1*r2
+ xbuff(i+1) = t2*r2
+1 continue
+return
+end
+
+!===============================================================================
+
+subroutine fische(n,mu,p)
+implicit none
+integer p(*)
+integer indx(1024)
+integer n,i,ii,jj,k,left,nl0,nsegs,p0
+double precision u(1024),q(1024)
+double precision q0,pmu,mu
+
+! Poisson generator for distribution function of p's:
+
+! q(mu,p) = exp(-mu) mu**p/p !
+
+! initialize arrays, pointers
+
+if (n.le.0) return
+
+pmu = exp(-mu)
+p0 = 0
+
+nsegs = (n-1)/1024
+left = n - nsegs*1024
+nsegs = nsegs + 1
+nl0 = left
+
+do 2 k = 1,nsegs
+
+ do 3 i=1,left
+ indx(i) = i
+ p(p0+i) = 0
+ q(i) = 1.0
+3 continue
+
+! Begin iterative loop on segment of p's
+
+1 continue
+
+! Get the needed uniforms
+
+ call zufall(left,u)
+
+ jj = 0
+
+!dir$ ivdep
+ do 4 i=1,left
+ ii = indx(i)
+ q0 = q(ii)*u(i)
+ q(ii) = q0
+ if( q0.gt.pmu ) then
+ jj = jj + 1
+ indx(jj) = ii
+ p(p0+ii) = p(p0+ii) + 1
+ endif
+4 continue
+
+! any left in this segment?
+
+ left = jj
+ if(left.gt.0)then
+ goto 1
+ endif
+
+ p0 = p0 + nl0
+ nl0 = 1024
+ left = 1024
+
+2 continue
+
+return
+end
+
+!===============================================================================
+
+block data
+implicit none
+
+! globally accessable, compile-time initialized data
+
+integer ptr,xptr,first
+double precision buff(607),xbuff(1024)
+common /klotz0/buff,ptr
+common /klotz1/xbuff,first,xptr
+data ptr/0/,xptr/0/,first/0/
+end
+
+!===============================================================================
+
+!----------------------------
+! FIN DE LA LIBRAIRIE
+!----------------------------
+
diff --git a/src/cfbl/Makefile.am b/src/cfbl/Makefile.am
new file mode 100644
index 0000000..bf9a032
--- /dev/null
+++ b/src/cfbl/Makefile.am
@@ -0,0 +1,82 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cfbl \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/cfbl/cfpoin.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcscfbl.la
+libcscfbl_la_SOURCES = \
+cfbsc2.f90 \
+cfbsc3.f90 \
+cfcdts.f90 \
+cfdivs.f90 \
+cfdttv.f90 \
+cfener.f90 \
+cfini1.f90 \
+cfiniv.f90 \
+cfmsfl.f90 \
+cfmsgs.f90 \
+cfmsvl.f90 \
+cfmsvs.f90 \
+cfphyv.f90 \
+cfprop.f90 \
+cfqdmv.f90 \
+cfrusb.f90 \
+cfvarp.f90 \
+cfxtcl.f90 \
+memcfe.f90 \
+memcfm.f90 \
+memcft.f90 \
+memcfv.f90
+libcscfbl_la_LDFLAGS = -no-undefined
+
+libcscfbl_la_SOURCES += \
+$(top_srcdir)/users/cfbl/uscfcl.f90 \
+$(top_srcdir)/users/cfbl/uscfpv.f90 \
+$(top_srcdir)/users/cfbl/uscfth.f90 \
+$(top_srcdir)/users/cfbl/uscfx1.f90 \
+$(top_srcdir)/users/cfbl/uscfx2.f90 \
+$(top_srcdir)/users/cfbl/uscfxi.f90
+
+cfbldir = $(pkgdatadir)/users/cfbl
+cfbl_DATA = \
+$(top_srcdir)/users/cfbl/uscfcl.f90 \
+$(top_srcdir)/users/cfbl/uscfpv.f90 \
+$(top_srcdir)/users/cfbl/uscfth.f90 \
+$(top_srcdir)/users/cfbl/uscfx1.f90 \
+$(top_srcdir)/users/cfbl/uscfx2.f90 \
+$(top_srcdir)/users/cfbl/uscfxi.f90
diff --git a/src/cfbl/Makefile.in b/src/cfbl/Makefile.in
new file mode 100644
index 0000000..3f1dfab
--- /dev/null
+++ b/src/cfbl/Makefile.in
@@ -0,0 +1,646 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/cfbl
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcscfbl_la_LIBADD =
+am_libcscfbl_la_OBJECTS = cfbsc2.lo cfbsc3.lo cfcdts.lo cfdivs.lo \
+ cfdttv.lo cfener.lo cfini1.lo cfiniv.lo cfmsfl.lo cfmsgs.lo \
+ cfmsvl.lo cfmsvs.lo cfphyv.lo cfprop.lo cfqdmv.lo cfrusb.lo \
+ cfvarp.lo cfxtcl.lo memcfe.lo memcfm.lo memcft.lo memcfv.lo \
+ uscfcl.lo uscfpv.lo uscfth.lo uscfx1.lo uscfx2.lo uscfxi.lo
+libcscfbl_la_OBJECTS = $(am_libcscfbl_la_OBJECTS)
+libcscfbl_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcscfbl_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcscfbl_la_SOURCES)
+DIST_SOURCES = $(libcscfbl_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(cfbldir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+cfblDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(cfbl_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cfbl \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/cfbl/cfpoin.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcscfbl.la
+libcscfbl_la_SOURCES = cfbsc2.f90 cfbsc3.f90 cfcdts.f90 cfdivs.f90 \
+ cfdttv.f90 cfener.f90 cfini1.f90 cfiniv.f90 cfmsfl.f90 \
+ cfmsgs.f90 cfmsvl.f90 cfmsvs.f90 cfphyv.f90 cfprop.f90 \
+ cfqdmv.f90 cfrusb.f90 cfvarp.f90 cfxtcl.f90 memcfe.f90 \
+ memcfm.f90 memcft.f90 memcfv.f90 \
+ $(top_srcdir)/users/cfbl/uscfcl.f90 \
+ $(top_srcdir)/users/cfbl/uscfpv.f90 \
+ $(top_srcdir)/users/cfbl/uscfth.f90 \
+ $(top_srcdir)/users/cfbl/uscfx1.f90 \
+ $(top_srcdir)/users/cfbl/uscfx2.f90 \
+ $(top_srcdir)/users/cfbl/uscfxi.f90
+libcscfbl_la_LDFLAGS = -no-undefined
+cfbldir = $(pkgdatadir)/users/cfbl
+cfbl_DATA = \
+$(top_srcdir)/users/cfbl/uscfcl.f90 \
+$(top_srcdir)/users/cfbl/uscfpv.f90 \
+$(top_srcdir)/users/cfbl/uscfth.f90 \
+$(top_srcdir)/users/cfbl/uscfx1.f90 \
+$(top_srcdir)/users/cfbl/uscfx2.f90 \
+$(top_srcdir)/users/cfbl/uscfxi.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cfbl/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/cfbl/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcscfbl.la: $(libcscfbl_la_OBJECTS) $(libcscfbl_la_DEPENDENCIES)
+ $(libcscfbl_la_LINK) $(libcscfbl_la_OBJECTS) $(libcscfbl_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+uscfcl.lo: $(top_srcdir)/users/cfbl/uscfcl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscfcl.lo `test -f '$(top_srcdir)/users/cfbl/uscfcl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cfbl/uscfcl.f90
+
+uscfpv.lo: $(top_srcdir)/users/cfbl/uscfpv.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscfpv.lo `test -f '$(top_srcdir)/users/cfbl/uscfpv.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cfbl/uscfpv.f90
+
+uscfth.lo: $(top_srcdir)/users/cfbl/uscfth.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscfth.lo `test -f '$(top_srcdir)/users/cfbl/uscfth.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cfbl/uscfth.f90
+
+uscfx1.lo: $(top_srcdir)/users/cfbl/uscfx1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscfx1.lo `test -f '$(top_srcdir)/users/cfbl/uscfx1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cfbl/uscfx1.f90
+
+uscfx2.lo: $(top_srcdir)/users/cfbl/uscfx2.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscfx2.lo `test -f '$(top_srcdir)/users/cfbl/uscfx2.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cfbl/uscfx2.f90
+
+uscfxi.lo: $(top_srcdir)/users/cfbl/uscfxi.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscfxi.lo `test -f '$(top_srcdir)/users/cfbl/uscfxi.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cfbl/uscfxi.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-cfblDATA: $(cfbl_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(cfbldir)" || $(MKDIR_P) "$(DESTDIR)$(cfbldir)"
+ @list='$(cfbl_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(cfblDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(cfbldir)/$$f'"; \
+ $(cfblDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(cfbldir)/$$f"; \
+ done
+
+uninstall-cfblDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(cfbl_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(cfbldir)/$$f'"; \
+ rm -f "$(DESTDIR)$(cfbldir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(cfbldir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-cfblDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-cfblDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-cfblDATA install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-saturneincludeHEADERS \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-cfblDATA uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/cfbl/cfbsc2.f90 b/src/cfbl/cfbsc2.f90
new file mode 100644
index 0000000..8d79f81
--- /dev/null
+++ b/src/cfbl/cfbsc2.f90
@@ -0,0 +1,1354 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cfbsc2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , iifbru , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ifrusb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvar , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscf , viscb , &
+ smbrp , &
+ dpdx , dpdy , dpdz , dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! CALCUL DU BILAN EXPLICITE DE LA VARIABLE PVAR (VITESSE,SCALAIRES)
+
+! -- . -----> -->
+! SMBRP = SMBRP - \ m PVAR +Visc ( grad PVAR ) . n
+! /__ ij ij ij ij ij
+! j
+
+! ATTENTION : SMBRP DEJA INITIALISE AVANT L'APPEL A BILSCA
+! IL CONTIENT LES TERMES SOURCES EXPLICITES, ETC....
+
+! BLENCP = 1 : PAS D'UPWIND EN DEHORS DU TEST DE PENTE
+! BLENCP = 0 : UPWIND
+! ISCHCP = 1 : CENTRE
+! ISCHCP = 0 : SECOND ORDER
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de la variable !
+! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
+! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! ircflp ! e ! <-- ! indicateur = 1 rec flux, 0 sinon !
+! ischcp ! e ! <-- ! indicateur = 1 centre , 0 2nd order !
+! isstpp ! e ! <-- ! indicateur = 1 sans test de pente !
+! ! ! ! = 0 avec test de pente !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! iifbru ! e ! <-- ! pointeur flux de bord rusanov !
+! ipp ! e ! <-- ! numero de variable pour post !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! blencp ! r ! <-- ! 1 - proportion d'upwind !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ifrusb(nfabor ! te ! <-- ! indicateur flux de rusanov !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! pvar (ncelet ! tr ! <-- ! variable resolue (instant precedent) !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour p !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! cofafp, b ! tr ! <-- ! tableaux des cond lim pour le flux de !
+! (nfabor) ! ! ! diffusion de p !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! viscf (nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
+! ! ! ! pour second membre !
+! viscb (nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
+! ! ! ! pour second membre !
+! smbrp(ncelet ! tr ! <-- ! bilan au second membre !
+! dpdx,y,z ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet) ! ! ! !
+! dpdxa,ya,za ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet) ! ! ! avec decentrement amont !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "vector.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , iconvp , idiffp , nswrgp , imligp
+integer ircflp , ischcp , isstpp
+integer inc , imrgra , iccocg , iifbru
+integer iwarnp , ipp
+double precision blencp , epsrgp , climgp, extrap
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ifrusb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pvar (ncelet), coefap(nfabor), coefbp(nfabor)
+double precision cofafp(nfabor), cofbfp(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision viscf (nfac), viscb (nfabor)
+double precision smbrp(ncelet)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+character*8 cnom
+integer idebia, idebra
+integer ifac,ii,jj,infac,iel,iupwin, iij, iii, iok
+integer itenso, idimte, iphydp
+integer iiu(nphsmx),iiv(nphsmx),iiw(nphsmx)
+integer iitytu(nphsmx)
+integer iir11(nphsmx),iir22(nphsmx),iir33(nphsmx)
+integer iir12(nphsmx),iir13(nphsmx),iir23(nphsmx)
+double precision pfac,pfacd,pip,pjp,flui,fluj,flux
+double precision difx,dify,difz,djfx,djfy,djfz,pif,pjf
+double precision testi,testj,testij
+double precision dpxf,dpyf,dpzf
+double precision dcc, ddi, ddj, tesqck
+double precision dijpfx, dijpfy, dijpfz
+double precision diipfx, diipfy, diipfz
+double precision djjpfx, djjpfy, djjpfz
+double precision diipbx, diipby, diipbz
+double precision pond, dist, surfan
+double precision pfac1, pfac2, pfac3, unsvol
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+chaine = nomvar(ipp)
+cnom = chaine(1:8)
+
+if(iwarnp.ge.2) then
+ if (ischcp.eq.1) then
+ WRITE(NFECRA,1000)CNOM,' CENTRE ', &
+ (1.d0-blencp)*100.d0
+ else
+ WRITE(NFECRA,1000)CNOM,' 2ND ORDER ', &
+ (1.d0-blencp)*100.d0
+ endif
+endif
+
+iupwin = 0
+if(blencp.eq.0.d0) iupwin = 1
+
+!===============================================================================
+! 2. CALCUL DU BILAN AVEC TECHNIQUE DE RECONSTRUCTION
+!===============================================================================
+
+! ======================================================================
+! ---> CALCUL DU GRADIENT DE P
+! ======================================================================
+! DPDX sert a la fois pour la reconstruction des flux et pour le test
+! de pente. On doit donc le calculer :
+! - quand on a de la diffusion et qu'on reconstruit les flux
+! - quand on a de la convection SOLU
+! - quand on a de la convection, qu'on n'est pas en upwind pur
+! et qu'on reconstruit les flux
+! - quand on a de la convection, qu'on n'est pas en upwind pur
+! et qu'on n'a pas shunte le test de pente
+
+if( (idiffp.ne.0 .and. ircflp.eq.1) .or. &
+ (iconvp.ne.0 .and. iupwin.eq.0 .and. &
+ (ischcp.eq.0 .or. ircflp.eq.1 .or. isstpp.eq.0)) ) then
+
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dpdxa , dpdxa , dpdxa , &
+ pvar , coefap , coefbp , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+else
+ do iel = 1, ncelet
+ dpdx(iel) = 0.d0
+ dpdy(iel) = 0.d0
+ dpdz(iel) = 0.d0
+ enddo
+endif
+
+
+! ======================================================================
+! ---> CALCUL DU GRADIENT DECENTRE DPDXA, DPDYA, DPDZA POUR TST DE PENTE
+! ======================================================================
+
+do iel = 1, ncelet
+ dpdxa(iel) = 0.d0
+ dpdya(iel) = 0.d0
+ dpdza(iel) = 0.d0
+enddo
+
+if( iconvp.gt.0.and.iupwin.eq.0.and.isstpp.eq.0 ) then
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+ pif = pvar(ii) +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ pfac = pjf
+ if( flumas(ifac ).gt.0.d0 ) pfac = pif
+
+ pfac1 = pfac*surfac(1,ifac )
+ pfac2 = pfac*surfac(2,ifac )
+ pfac3 = pfac*surfac(3,ifac )
+
+ dpdxa(ii) = dpdxa(ii) +pfac1
+ dpdya(ii) = dpdya(ii) +pfac2
+ dpdza(ii) = dpdza(ii) +pfac3
+
+ dpdxa(jj) = dpdxa(jj) -pfac1
+ dpdya(jj) = dpdya(jj) -pfac2
+ dpdza(jj) = dpdza(jj) -pfac3
+
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+ pif = pvar(ii) +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ pfac = pjf
+ if( flumas(ifac ).gt.0.d0 ) pfac = pif
+
+ pfac1 = pfac*surfac(1,ifac )
+ pfac2 = pfac*surfac(2,ifac )
+ pfac3 = pfac*surfac(3,ifac )
+
+ dpdxa(ii) = dpdxa(ii) +pfac1
+ dpdya(ii) = dpdya(ii) +pfac2
+ dpdza(ii) = dpdza(ii) +pfac3
+
+ dpdxa(jj) = dpdxa(jj) -pfac1
+ dpdya(jj) = dpdya(jj) -pfac2
+ dpdza(jj) = dpdza(jj) -pfac3
+
+ enddo
+
+ endif
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac )
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+ pfac = inc*coefap(ifac ) &
+ +coefbp(ifac )*(pvar(ii)+diipbx*dpdx(ii) &
+ +diipby*dpdy(ii)+diipbz*dpdz(ii) )
+ dpdxa(ii) = dpdxa(ii) +pfac*surfbo(1,ifac )
+ dpdya(ii) = dpdya(ii) +pfac*surfbo(2,ifac )
+ dpdza(ii) = dpdza(ii) +pfac*surfbo(3,ifac )
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac =1,nfabor
+ ii = ifabor(ifac )
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+ pfac = inc*coefap(ifac ) &
+ +coefbp(ifac )*(pvar(ii)+diipbx*dpdx(ii) &
+ +diipby*dpdy(ii)+diipbz*dpdz(ii) )
+ dpdxa(ii) = dpdxa(ii) +pfac*surfbo(1,ifac )
+ dpdya(ii) = dpdya(ii) +pfac*surfbo(2,ifac )
+ dpdza(ii) = dpdza(ii) +pfac*surfbo(3,ifac )
+ enddo
+
+ endif
+
+ do iel = 1, ncel
+ unsvol = 1.d0/volume(iel)
+ dpdxa(iel) = dpdxa(iel)*unsvol
+ dpdya(iel) = dpdya(iel)*unsvol
+ dpdza(iel) = dpdza(iel)*unsvol
+ enddo
+
+! TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (dpdxa)
+ !==========
+ call parcom (dpdya)
+ !==========
+ call parcom (dpdza)
+ !==========
+ endif
+
+! TRAITEMENT DE LA PERIODICITE
+
+! On echange pour la translation
+! pour la rotation, on prend le gradient simple (pas de temps precedent)
+
+ if(iperio.eq.1) then
+
+! Pour les rotations
+! avec la vitesse et les tensions de Reynolds,
+! on utilise la valeur du gradient simple (PERING) a defaut de mieux.
+! Dans les autres cas, on echange DPDXA
+
+! On recupere d'abord certains COMMON necessaires a PERING
+
+ call pergra &
+ !==========
+ ( nphsmx , nphas , &
+ iiu , iiv , iiw , &
+ iitytu , &
+ iir11 , iir22 , iir33 , iir12 , iir13 , iir23 )
+
+ call pering &
+ !==========
+ ( nphas , ivar , &
+ idimte , itenso , iperot , iguper , igrper , &
+ iiu , iiv , iiw , iitytu , &
+ iir11 , iir22 , iir33 , iir12 , iir13 , iir23 , &
+ dpdxa , dpdya , dpdza , &
+ ra(idudxy) , ra(idrdxy) )
+
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dpdxa , dpdxa , dpdxa , &
+ dpdya , dpdya , dpdya , &
+ dpdza , dpdza , dpdza )
+ endif
+
+endif
+
+
+! ======================================================================
+! ---> ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+! ======================================================================
+
+infac = 0
+
+if(ncelet.gt.ncel) then
+ do iel = ncel+1, ncelet
+ smbrp(iel) = 0.d0
+ enddo
+endif
+
+
+! --> FLUX UPWIND PUR
+! =====================
+
+if(iupwin.eq.1) then
+
+ if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+! reconstruction uniquement si IRCFLP = 1
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+ infac = infac+1
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+ smbrp(ii) = smbrp(ii) -flux
+ smbrp(jj) = smbrp(jj) +flux
+
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+ infac = infac+1
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+ smbrp(ii) = smbrp(ii) -flux
+ smbrp(jj) = smbrp(jj) +flux
+
+ enddo
+
+ endif
+
+
+! --> FLUX SANS TEST DE PENTE
+! ============================
+
+elseif(isstpp.eq.1) then
+
+ if (ivecti.eq.1) then
+
+ iok = 0
+!CDIR NODEP
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pif = pond*pip +(1.d0-pond)*pjp
+ pjf = pif
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pif = pvar(ii) &
+ +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) &
+ +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+
+! BLENDING
+! ----------
+
+ pif = blencp*pif+(1.d0-blencp)*pvar(ii)
+ pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
+
+
+! FLUX
+! ------
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) -flux
+ smbrp(jj) = smbrp(jj) +flux
+
+ enddo
+! Le call csexit ne doit pas etre dans la boucle, sinon
+! le VPP la devectorise.
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+ else
+
+ iok = 0
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pif = pond*pip +(1.d0-pond)*pjp
+ pjf = pif
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pif = pvar(ii) &
+ +difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) &
+ +djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+
+! BLENDING
+! ----------
+
+ pif = blencp*pif+(1.d0-blencp)*pvar(ii)
+ pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
+
+
+! FLUX
+! ------
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) -flux
+ smbrp(jj) = smbrp(jj) +flux
+
+ enddo
+! Le call csexit ne doit pas etre dans la boucle, sinon
+! le VPP la devectorise (pour la boucle non vectorisee forcee,
+! ce n'est pas grave, c'est juste pour recopier exactement
+! la precedente)
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+ endif
+
+
+
+
+! --> FLUX AVEC TEST DE PENTE (separe pour vectorisation)
+! =============================
+
+else
+
+ if (ivecti.eq.1) then
+
+ iok = 0
+!CDIR NODEP
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+ dist = ra(idist-1+ifac)
+ surfan = ra(isrfan-1+ifac)
+
+! ON RECALCULE II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+
+! TEST DE PENTE
+! ---------------
+
+ testi = dpdxa(ii)*surfac(1,ifac) +dpdya(ii)*surfac(2,ifac) &
+ + dpdza(ii)*surfac(3,ifac)
+ testj = dpdxa(jj)*surfac(1,ifac) +dpdya(jj)*surfac(2,ifac) &
+ + dpdza(jj)*surfac(3,ifac)
+ testij= dpdxa(ii)*dpdxa(jj) +dpdya(ii)*dpdya(jj) &
+ + dpdza(ii)*dpdza(jj)
+
+ if( flumas(ifac).gt.0.d0) then
+ dcc = dpdx(ii)*surfac(1,ifac) +dpdy(ii)*surfac(2,ifac) &
+ + dpdz(ii)*surfac(3,ifac)
+ ddi = testi
+ ddj = ( pvar(jj)-pvar(ii) )/dist *surfan
+ else
+ dcc = dpdx(jj)*surfac(1,ifac) +dpdy(jj)*surfac(2,ifac) &
+ + dpdz(jj)*surfac(3,ifac)
+ ddi = ( pvar(jj)-pvar(ii) )/dist *surfan
+ ddj = testj
+ endif
+ tesqck = dcc**2 -(ddi-ddj)**2
+
+
+! UPWIND
+! --------
+
+!MO IF( (TESTI*TESTJ).LE.0.D0 .OR. TESTIJ.LE.0.D0 ) THEN
+ if( tesqck.le.0.d0 .or. testij.le.0.d0 ) then
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+ infac = infac+1
+
+ else
+
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pif = pond*pip +(1.d0-pond)*pjp
+ pjf = pif
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pif = pvar(ii) &
+ + difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) &
+ + djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+ endif
+
+
+! BLENDING
+! ----------
+
+ pif = blencp*pif+(1.d0-blencp)*pvar(ii)
+ pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
+
+
+! FLUX
+! ------
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) -flux
+ smbrp(jj) = smbrp(jj) +flux
+
+ enddo
+! Le call csexit ne doit pas etre dans la boucle, sinon
+! le VPP la devectorise.
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+ else
+
+ iok = 0
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+ dist = ra(idist-1+ifac)
+ surfan = ra(isrfan-1+ifac)
+
+! ON RECALCULE II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+
+! TEST DE PENTE
+! ---------------
+
+ testi = dpdxa(ii)*surfac(1,ifac) +dpdya(ii)*surfac(2,ifac) &
+ + dpdza(ii)*surfac(3,ifac)
+ testj = dpdxa(jj)*surfac(1,ifac) +dpdya(jj)*surfac(2,ifac) &
+ + dpdza(jj)*surfac(3,ifac)
+ testij= dpdxa(ii)*dpdxa(jj) +dpdya(ii)*dpdya(jj) &
+ + dpdza(ii)*dpdza(jj)
+
+ if( flumas(ifac).gt.0.d0) then
+ dcc = dpdx(ii)*surfac(1,ifac) +dpdy(ii)*surfac(2,ifac) &
+ + dpdz(ii)*surfac(3,ifac)
+ ddi = testi
+ ddj = ( pvar(jj)-pvar(ii) )/dist *surfan
+ else
+ dcc = dpdx(jj)*surfac(1,ifac) +dpdy(jj)*surfac(2,ifac) &
+ + dpdz(jj)*surfac(3,ifac)
+ ddi = ( pvar(jj)-pvar(ii) )/dist *surfan
+ ddj = testj
+ endif
+ tesqck = dcc**2 -(ddi-ddj)**2
+
+
+! UPWIND
+! --------
+
+!MO IF( (TESTI*TESTJ).LE.0.D0 .OR. TESTIJ.LE.0.D0 ) THEN
+ if( tesqck.le.0.d0 .or. testij.le.0.d0 ) then
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+ infac = infac+1
+
+ else
+
+
+! CENTRE
+! --------
+
+ if (ischcp.eq.1) then
+
+ pif = pond*pip +(1.d0-pond)*pjp
+ pjf = pif
+
+
+! SECOND ORDER
+! --------------
+
+ elseif(ischcp.eq.0) then
+
+ difx = cdgfac(1,ifac) - xyzcen(1,ii)
+ dify = cdgfac(2,ifac) - xyzcen(2,ii)
+ difz = cdgfac(3,ifac) - xyzcen(3,ii)
+ djfx = cdgfac(1,ifac) - xyzcen(1,jj)
+ djfy = cdgfac(2,ifac) - xyzcen(2,jj)
+ djfz = cdgfac(3,ifac) - xyzcen(3,jj)
+
+! on laisse la reconstruction de PIF et PJF meme si IRCFLP=0
+! sinon cela revient a faire de l'upwind
+ pif = pvar(ii) &
+ + difx*dpdx(ii)+dify*dpdy(ii)+difz*dpdz(ii)
+ pjf = pvar(jj) &
+ + djfx*dpdx(jj)+djfy*dpdy(jj)+djfz*dpdz(jj)
+
+ else
+ write(nfecra,9000)ischcp
+ iok = 1
+ endif
+
+ endif
+
+
+! BLENDING
+! ----------
+
+ pif = blencp*pif+(1.d0-blencp)*pvar(ii)
+ pjf = blencp*pjf+(1.d0-blencp)*pvar(jj)
+
+
+! FLUX
+! ------
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+
+! ASSEMBLAGE
+! ------------
+
+ smbrp(ii) = smbrp(ii) -flux
+ smbrp(jj) = smbrp(jj) +flux
+
+ enddo
+! Le call csexit ne doit pas etre dans la boucle, sinon
+! le VPP la devectorise (pour la boucle non vectorisee forcee,
+! ce n'est pas grave, c'est juste pour recopier exactement
+! la precedente)
+ if(iok.ne.0) then
+ call csexit (1)
+ endif
+
+ endif
+
+endif
+
+
+
+if(iwarnp.ge.2) then
+ write(nfecra,1100)cnom,infac,nfac
+endif
+
+
+! ======================================================================
+! ---> ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+! ======================================================================
+
+! Lorsque IIFBRU.GT.0, on ne prend pas en compte le flux convectif
+! sur les faces pour lesquelles on dispose par ailleurs d'un
+! flux de C.L.
+
+! Lorsque IIFBRU.LE.0, on adopte le sch�ma standard (i.e. on prend
+! en compte le flux convectitf).
+
+! Dans les deux cas, si on prend en compte le flux convectif, il
+! pourrait etre utile de vraiment utiliser la condition imposee
+! a la limite, i.e. de ne pas utiliser un sch�ma upwind (sinon,
+! on ne verra pas certaines C.L.). Actuellement, avec les conditions
+! aux limites propos�es, il n'y a que 3 cas pour lesquels on
+! prend en compte le flux convectif ici : paroi, symetrie et
+! sortie supersonique. Dans les deux premiers, le flux est nul.
+! Pour le dernier, un traitement upwind correspond a utiliser
+! effectivement la valeur de bord. On peut donc conserver
+! le code tel quel.
+
+! On n'impose pas le flux convectif sur les faces pour lesquelles
+! il sera impos� par les C.L.
+if(iifbru.gt.0) then
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pip = pvar(ii) &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
+
+! FLUX = ICONVP*( FLUI*PVAR(II) +FLUJ*PFAC )
+! & + IDIFFP*VISCB(IFAC)*( PIP -PFACD )
+ flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
+ *dble(1-ifrusb(ifac)) &
+ + idiffp*viscb(ifac)*( pip -pfacd )
+ smbrp(ii) = smbrp(ii) -flux
+
+ enddo
+
+ else
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pip = pvar(ii) &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
+
+! FLUX = ICONVP*( FLUI*PVAR(II) +FLUJ*PFAC )
+! & + IDIFFP*VISCB(IFAC)*( PIP -PFACD )
+ flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
+ *dble(1-ifrusb(ifac)) &
+ + idiffp*viscb(ifac)*( pip -pfacd )
+ smbrp(ii) = smbrp(ii) -flux
+
+ enddo
+
+ endif
+
+! On ne dispose pas de flux issu des C.L. : traitement std
+else
+
+ if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pip = pvar(ii) &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
+
+ flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
+ + idiffp*viscb(ifac)*( pip -pfacd )
+ smbrp(ii) = smbrp(ii) -flux
+
+ enddo
+
+ else
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pip = pvar(ii) &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
+
+ flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
+ + idiffp*viscb(ifac)*( pip -pfacd )
+ smbrp(ii) = smbrp(ii) -flux
+
+ enddo
+
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(1X,A8,' : CONVECTION EN ',A11, &
+ ' BLENDING A ',F4.0,' % D''UPWIND')
+ 1100 format(1X,A8,' : ',I10,' FACES UPWIND SUR ', &
+ I10,' FACES INTERNES ')
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS cfbsc2 ',/,&
+'@ ========= ',/,&
+'@ APPEL DE cfbsc2 POUR ',A8 ,' AVEC ISCHCP = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''assistance. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfbsc3.f90 b/src/cfbl/cfbsc3.f90
new file mode 100644
index 0000000..cce7be8
--- /dev/null
+++ b/src/cfbl/cfbsc3.f90
@@ -0,0 +1,516 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cfbsc3 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvar , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscf , viscb , &
+ flvarf , flvarb , &
+ dpdx , dpdy , dpdz , dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! CALCUL DU FLUX DE CONVECTION-DIFFUSION D'UNE VARIABLE AUX FACES
+
+! . -----> -->
+! FLVARF (FACEij) = m PVAR - Visc ( grad PVAR ) . n
+! ij ij ij ij ij
+
+! . -----> -->
+! FLVARB (FABi) = m PVAR - Visc ( grad PVAR ) . n
+! i i i i i
+
+
+! CALCUL EN UPWIND
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de la variable !
+! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
+! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! ircflp ! e ! <-- ! indicateur = 1 rec flux, 0 sinon !
+! ischcp ! e ! <-- ! indicateur = 1 centre , 0 2nd order !
+! isstpp ! e ! <-- ! indicateur = 1 sans test de pente !
+! ! ! ! = 0 avec test de pente !
+! inc ! e ! <-- ! indicateur = 0 resol sur increment !
+! ! ! ! 1 sinon !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! iccocg ! e ! <-- ! indicateur = 1 pour recalcul de cocg !
+! ! ! ! 0 sinon !
+! ipp ! e ! <-- ! numero de variable pour post !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! blencp ! r ! <-- ! 1 - proportion d'upwind !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! pvar (ncelet ! tr ! <-- ! variable resolue (instant precedent) !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour p !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! cofafp, b ! tr ! <-- ! tableaux des cond lim pour le flux de !
+! (nfabor) ! ! ! diffusion de p !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! viscf (nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
+! ! ! ! pour second membre !
+! viscb (nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
+! ! ! ! pour second membre !
+! flvarf(nfac) ! tr ! --> ! flux de convection-diffusion !
+! ! ! ! aux faces internes !
+! flvarb(nfabor ! tr ! --> ! flux de convection-diffusion !
+! ! ! ! aux faces de bord !
+! dpdx,y,z ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet) ! ! ! !
+! dpdxa,ya,za ! tr ! --- ! tableau de travail pour le grad de p !
+! (ncelet) ! ! ! avec decentrement amont !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "vector.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , iconvp , idiffp , nswrgp , imligp
+integer ircflp , ischcp , isstpp
+integer inc , imrgra , iccocg
+integer iwarnp , ipp
+double precision blencp , epsrgp , climgp, extrap
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pvar (ncelet), coefap(nfabor), coefbp(nfabor)
+double precision cofafp(nfabor), cofbfp(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision viscf (nfac), viscb (nfabor)
+double precision flvarf(nfac), flvarb(nfabor)
+double precision dpdx (ncelet),dpdy (ncelet),dpdz (ncelet)
+double precision dpdxa(ncelet),dpdya(ncelet),dpdza(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+character*8 cnom
+integer idebia, idebra
+integer ifac,ii,jj,infac,iel, iij, iii
+integer iphydp
+double precision pfac,pfacd,pip,pjp,flui,fluj,flux
+double precision pif,pjf
+double precision dpxf,dpyf,dpzf
+double precision dijpfx, dijpfy, dijpfz
+double precision diipfx, diipfy, diipfz
+double precision djjpfx, djjpfy, djjpfz
+double precision diipbx, diipby, diipbz
+double precision pond
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+chaine = nomvar(ipp)
+cnom = chaine(1:8)
+
+
+!===============================================================================
+! 2. CALCUL DU BILAN AVEC TECHNIQUE DE RECONSTRUCTION
+!===============================================================================
+
+! ======================================================================
+! ---> CALCUL DU GRADIENT DE PVAR
+! ======================================================================
+! DPDX sert pour la reconstruction des flux de diffusion
+! (convection en upwind)
+! On doit donc le calculer uniquement si on a de la diffusion
+! et qu'on reconstruit les flux
+
+if( idiffp.ne.0 .and. ircflp.eq.1 ) then
+
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dpdxa , dpdxa , dpdxa , &
+ pvar , coefap , coefbp , &
+ dpdx , dpdy , dpdz , &
+! ------ ------ ------
+ dpdxa , dpdya , dpdza , &
+ rdevel , rtuser , ra )
+
+else
+ do iel = 1, ncelet
+ dpdx(iel) = 0.d0
+ dpdy(iel) = 0.d0
+ dpdz(iel) = 0.d0
+ enddo
+endif
+
+
+! ======================================================================
+! ---> ASSEMBLAGE A PARTIR DES FACETTES FLUIDES
+! ======================================================================
+
+infac = 0
+
+do ifac = 1, nfac
+ flvarf(ifac) = 0.d0
+enddo
+
+do ifac = 1, nfabor
+ flvarb(ifac) = 0.d0
+enddo
+
+
+! --> FLUX UPWIND PUR
+! =====================
+
+if (ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+! reconstruction uniquement si IRCFLP = 1
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+ infac = infac+1
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+! --- FLVARF(IFAC) : flux de convection-diffusion de la variable
+! a la face ij
+
+ flvarf(ifac) = flux
+
+ enddo
+
+else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! ON RECALCULE A CE NIVEAU II' ET JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ dpxf = 0.5d0*(dpdx(ii) + dpdx(jj))
+ dpyf = 0.5d0*(dpdy(ii) + dpdy(jj))
+ dpzf = 0.5d0*(dpdz(ii) + dpdz(jj))
+
+ pip = pvar(ii) &
+ + ircflp*(dpxf*diipfx+dpyf*diipfy+dpzf*diipfz)
+ pjp = pvar(jj) &
+ + ircflp*(dpxf*djjpfx+dpyf*djjpfy+dpzf*djjpfz)
+
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+
+ pif = pvar(ii)
+ pjf = pvar(jj)
+ infac = infac+1
+
+ flux = iconvp*( flui*pif +fluj*pjf ) &
+ + idiffp*viscf(ifac)*( pip -pjp )
+
+! --- FLVARF(IFAC) : flux de convection-diffusion de la variable
+! a la face ij
+
+ flvarf(ifac) = flux
+
+ enddo
+
+endif
+
+
+! ======================================================================
+! ---> ASSEMBLAGE A PARTIR DES FACETTES DE BORD
+! ======================================================================
+
+if (ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pip = pvar(ii) &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
+
+ flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
+ + idiffp*viscb(ifac)*( pip -pfacd )
+
+! --- FLVARB(IFAC) : flux de convection-diffusion de la variable
+! a la face de bord i
+
+ flvarb(ifac) = flux
+
+ enddo
+
+else
+
+ do ifac = 1, nfabor
+
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+
+ pip = pvar(ii) &
+ +ircflp*(dpdx(ii)*diipbx+dpdy(ii)*diipby+dpdz(ii)*diipbz)
+
+ pfac = inc*coefap(ifac) +coefbp(ifac)*pip
+ pfacd = inc*cofafp(ifac) +cofbfp(ifac)*pip
+
+ flux = iconvp*( flui*pvar(ii) +fluj*pfac ) &
+ + idiffp*viscb(ifac)*( pip -pfacd )
+
+! --- FLVARB(IFAC) : flux de convection-diffusion de la variable
+! a la face de bord i
+
+ flvarb(ifac) = flux
+
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfcdts.f90 b/src/cfbl/cfcdts.f90
new file mode 100644
index 0000000..6200406
--- /dev/null
+++ b/src/cfbl/cfcdts.f90
@@ -0,0 +1,622 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfcdts &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , iifbru , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ifrusb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvara , coefap , coefbp , cofafp , cofbfp , flumas , flumab , &
+ viscfm , viscbm , viscfs , viscbs , &
+ rovsdt , smbrp , pvar , &
+ dam , xam , dpvar , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , smbini , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION SUR UN PAS DE TEMPS D'UNE EQUATION DE CONVECTION
+! /DIFFUSION/TERME SOURCE POUR LA VARIABLE PVAR EN COMPRESSIBLE
+
+! ROVSDT.( PVAR -PVARA )
+! ( -> ---> )
+! + DIV( RO.U PVAR -VISC GRAD( PVAR ) ).VOLUME = SMBR
+! ( )
+
+! ON RESOUT EN FAIT :
+
+! ROVSDT.DPVAR
+! ( -> ---> )
+! + DIV( RO.U DPVAR -VISC GRAD( DPVAR ) ).VOLUME = SMBR
+! ( )
+! AVEC
+! SMBR = SMBR
+! ( ->n ---> n )
+! - DIV( RO.U DPVAR -VISC GRAD( DPVAR ) ).VOLUME
+! ( )
+! ET DPVAR = INCREMENT VARIABLE PVAR
+
+! Attention, on suppose qu'on arrive ici avec PVAR initialise
+! Y COMPRIS DANS LE HALO EN PERIODICITE (appel a promav pour
+! le calcul de la norme)
+
+
+
+
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iconvp ! e ! <-- ! indicateur = 1 convection, 0 sinon !
+! idiffp ! e ! <-- ! indicateur = 1 diffusion , 0 sinon !
+! ndircp ! e ! <-- ! indicateur = 0 si decalage diagonale !
+! ireslp ! e ! <-- ! indicateur = 0 gradco !
+! ! ! ! = 1 jacobi !
+! ! ! ! = 2 bi-cgstab !
+! imrgra ! e ! <-- ! indicateur = 0 gradrc 97 !
+! ! e ! <-- ! = 1 gradmc 99 !
+! nswrsp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! du second membre !
+! nswrgp ! e ! <-- ! nombre de sweep pour reconstruction !
+! ! ! ! des gradients !
+! imligp ! e ! <-- ! methode de limitation du gradient !
+! ! ! ! < 0 pas de limitation !
+! ! ! ! = 0 a partir des gradients voisins !
+! ! ! ! = 1 a partir du gradient moyen !
+! ircflp ! e ! <-- ! indicateur = 1 rec flux ; 0 sinon !
+! ischcp ! e ! <-- ! indicateur = 1 centre , 0 2nd order !
+! isstpp ! e ! <-- ! indicateur = 1 sans test de pente !
+! ! ! ! = 0 avec test de pente !
+! iescap ! e ! <-- ! =1 calcul de l'indicateur prediction !
+! iifbru ! e ! <-- ! pointeur flux de bord rusanov !
+! imgrp ! e ! <-- ! indicateur = 0 pas de mgm !
+! ! ! ! = 1 sinon !
+! nitmap ! e ! <-- ! nombre max d'iter pour resol iterativ !
+! ipp ! e ! <-- ! numero de variable pour post !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! nfecrl ! e ! <-- ! unite du fichier sortie std !
+! blencp ! r ! <-- ! 1 - proportion d'upwind !
+! epsilp ! r ! <-- ! precision pour resol iter !
+! epsrgp ! r ! <-- ! precision relative pour la !
+! ! ! ! reconstruction des gradients 97 !
+! climgp ! r ! <-- ! coef gradient*distance/ecart !
+! extrap ! r ! <-- ! coef extrap gradient !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ifrusb(nfabor ! te ! <-- ! indicateur flux de rusanov !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! pvara(ncelet ! tr ! <-- ! variable resolue (instant precedent) !
+! coefap, b ! tr ! <-- ! tableaux des cond lim pour p !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! cofafp, b ! tr ! <-- ! tableaux des cond lim pour le flux de !
+! (nfabor) ! ! ! diffusion de p !
+! flumas(nfac) ! tr ! <-- ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! <-- ! flux de masse aux faces de bord !
+! viscfm(nfac) ! tr ! <-- ! visc*surface/dist aux faces internes !
+! ! ! ! pour la matrice !
+! viscbm(nfabor ! tr ! <-- ! visc*surface/dist aux faces de bord !
+! ! ! ! pour la matrice !
+! viscfs(nfac) ! tr ! <-- ! idem viscfm pour second membre !
+! viscbs(nfabor ! tr ! <-- ! idem viscbm pour second membre !
+! rovsdt(ncelet ! tr ! <-- ! rho*volume/dt !
+! smbrp(ncelet ! tr ! <-- ! bilan au second membre !
+! pvar (ncelet ! tr ! <-- ! variable resolue !
+! dam(ncelet ! tr ! --> ! tableau de travail pour matrice !
+! ! ! ! et resultat estimateur !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! smbini(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , iconvp , idiffp , ndircp
+integer nitmap
+integer imrgra , nswrsp , nswrgp , imligp , ircflp
+integer ischcp , isstpp , iescap , iifbru , imgrp
+integer ncymxp , nitmfp
+integer ipp , iwarnp
+double precision blencp , epsilp , epsrgp , climgp , extrap
+double precision thetap , epsrsp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ifrusb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision pvara(ncelet), coefap(nfabor), coefbp(nfabor)
+double precision cofafp(nfabor), cofbfp(nfabor)
+double precision flumas(nfac), flumab(nfabor)
+double precision viscfm(nfac), viscbm(nfabor)
+double precision viscfs(nfac), viscbs(nfabor)
+double precision rovsdt(ncelet), smbrp(ncelet)
+double precision pvar(ncelet)
+double precision dam(ncelet), xam(nfac ,2)
+double precision dpvar(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet), w4(ncelet)
+double precision w5(ncelet), w6(ncelet), w7(ncelet), w8(ncelet)
+double precision smbini(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+character*8 cnom
+integer idebia, idebra
+integer isym,ireslp,ireslq,ipol,isqrt
+integer inc,isweep,niterf,iccocg,iel,icycle,nswmod
+integer iphas,idimte,itenso,iinvpe, iinvpp
+double precision residu,rnorm
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! NOMS
+chaine = nomvar(ipp)
+cnom = chaine(1:8)
+
+! MATRICE A PRIORI SYMETRIQUE ( = 1)
+isym = 1
+if( iconvp.gt.0 ) isym = 2
+
+
+! METHODE DE RESOLUTION ET DEGRE DU PRECOND DE NEUMANN
+! 0 SI CHOIX AUTOMATIQUE GRADCO OU BICGSTAB
+! 0 SI CHOIX AUTOMATIQUE JACOBI
+! DONNE PAR IRESLP/1000 SI NON AUTOMATIQUE
+if (ireslp.eq.-1) then
+ ireslq = 0
+ ipol = 0
+ if( iconvp.gt.0 ) then
+ ireslq = 1
+ ipol = 0
+ endif
+else
+ ireslq = mod(ireslp,1000)
+ ipol = (ireslp-ireslq)/1000
+endif
+
+
+! PRISE DE SQRT DANS PS
+isqrt = 1
+
+! PRISE EN COMPTE DE LA PERIODICITE
+
+! Initialisation pour test avant promav
+iinvpe = 0
+
+if(iperio.eq.1) then
+
+
+! Par defaut, toutes les periodicites seront traitees dans percom,
+! les variables etant assimilees a des scalaires (meme si ce sont
+! des composantes de vecteurs ou de tenseur)
+ idimte = 0
+ itenso = 0
+
+ iinvpe = 1
+
+ do iphas = 1, nphas
+ if(ivar.eq.iu(iphas).or.ivar.eq.iv(iphas).or. &
+ ivar.eq.iw(iphas).or. &
+ ivar.eq.ir11(iphas).or.ivar.eq.ir12(iphas).or. &
+ ivar.eq.ir13(iphas).or.ivar.eq.ir22(iphas).or. &
+ ivar.eq.ir23(iphas).or.ivar.eq.ir33(iphas)) then
+
+! Pour la vitesse et les tensions de Reynolds
+! seules seront echangees les informations sur les faces periodiques
+! de translation dans percom ; on ne touche pas aux informations
+! relatives aux faces de periodicite de rotation.
+ idimte = 0
+ itenso = 1
+
+! Lors de la resolution par increments, on echangera egalement les
+! informations relatives aux faces de periodicite de translation.
+! Pour les faces de periodicite de rotation, l'increment sera
+! annule dans percom (iinvpe=2).
+ iinvpe = 2
+
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 1. CONSTRUCTION MATRICE "SIMPLIFIEE" DE RESOLUTION
+!===============================================================================
+
+call matrix &
+!==========
+ ( ncelet , ncel , nfac , nfabor , &
+ iconvp , idiffp , ndircp , isym , nfecra , &
+ thetap , &
+ ifacel , ifabor , &
+ coefbp , rovsdt , flumas , flumab , viscfm , viscbm , &
+ dam , xam )
+
+
+!===============================================================================
+! 2. BOUCLES SUR LES NON ORTHOGONALITES
+! (A PARTIR DE LA SECONDE ITERATION)
+!===============================================================================
+
+
+! AVANT DE BOUCLER SUR LES SWEEP, ON STOCKE LE SECOND MEMBRE SANS
+! RECONSTRUCTION DANS LE TABLEAU AUXILIAIRE SMBINI
+
+do iel = 1, ncel
+ smbini(iel) = smbrp(iel)
+enddo
+
+! On passe toujours dans cfbsc2 avec INC=1
+inc = 1
+! Sauf pour les matrices poids (NSWRSP=-1 ... a priori bloque dans
+! verini en compressible)
+if (nswrsp.eq.-1) then
+ nswrsp = 1
+ inc = 0
+endif
+
+
+! Ca serait bien de le simplifier plus tard aussi ce nombre de sweeps
+! Attention, pour les matrices poids il faut pouvoir ne faire
+! qu'un seul sweep
+nswmod = max( nswrsp, 1 )
+do 100 isweep = 1, nswmod
+
+! ---> INCREMENTATION ET RECONSTRUCTION DU SECOND MEMBRE
+! ON NE RECALCULE COCG QU'AU PREMIER PASSAGE (PRESQUE)
+
+ if( isweep.eq.1) then
+ iccocg = 1
+
+ else
+ iccocg = 0
+ do iel = 1, ncel
+! SMBINI CONTIENT LES TERMES INSTAT, EN DIV(RHO U) ET SOURCE DE MASSE
+! DU SECOND MEMBRE MIS A JOUR A CHAQUE SWEEP
+ smbini(iel) = smbini(iel) - rovsdt(iel)*dpvar(iel)
+ smbrp(iel) = smbini(iel)
+ enddo
+ endif
+
+ call cfbsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , iifbru , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ifrusb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvar , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscfs , viscbs , &
+ smbrp , &
+! ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ call prodsc(ncelet,ncel,isqrt,smbrp,smbrp,residu)
+
+! ---> RESIDU DE NORMALISATION CALCULE AU PREMIER SWEEP
+! (NORME C.L +TERMES SOURCES+ TERMES DE NON ORTHOGONALITE)
+
+! Attention, lors de l'appel a promav, ici pour une variable qui
+! n'est pas en increments et qui est supposee initialisee
+! y compris dans le halo.
+! Pour les variables vitesse et les tensions de Reynolds
+! (IINVPE=2), il ne faudra donc pas annuler le halo
+! des periodicites de rotation, mais au contraire le laisser
+! inchange.
+! Pour les autres variables (scalaires) IINVPE=1 permettra de
+! tout echanger, meme si c'est superflu.
+ if( isweep.eq.1 ) then
+ if(iinvpe.eq.2) then
+ iinvpp = 3
+ else
+ iinvpp = iinvpe
+ endif
+ call promav(ncelet,ncel,nfac,isym,iinvpp,ifacel, &
+ dam,xam,pvar,w1)
+ do iel = 1, ncel
+ w1(iel) = w1(iel) + smbrp(iel)
+ enddo
+ call prodsc(ncelet,ncel,isqrt,w1,w1,rnorm)
+ rnsmbr(ipp) = rnorm
+ endif
+
+! ---> RESOLUTION IMPLICITE SUR L'INCREMENT DPVAR
+
+ do iel = 1, ncel
+ dpvar(iel) = 0.d0
+ enddo
+
+ call invers &
+ !==========
+ ( cnom , idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ isym , ipol , ireslq , nitmap , imgrp , &
+ ncymxp , nitmfp , &
+ iwarnp , nfecra , niterf , icycle , iinvpe , &
+ epsilp , rnorm , residu , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dam , xam , smbrp , dpvar , &
+ w3 , w4 , w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+
+ nbivar(ipp) = niterf
+ if(abs(rnorm).gt.epzero) then
+ resvar(ipp) = residu/rnorm
+ else
+ resvar(ipp) = 0.d0
+ endif
+
+! ---> INCREMENTATION SOLUTION
+
+ do iel = 1, ncel
+ pvar(iel) = pvar(iel)+dpvar(iel)
+ enddo
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) call parcom (pvar)
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE : SEULE LA PERIODICITE IMPLICITE
+! EST ASSUREE (SCALAIRE ET TRANSLATION DE VECTEUR ET DE TENSEUR)
+
+if(iperio.eq.1) then
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar , &
+ pvar , pvar , pvar )
+endif
+
+! ---> TEST DE CONVERGENCE
+
+call prodsc(ncelet,ncel,isqrt,smbrp,smbrp,residu)
+
+if( residu.le.epsrsp*rnorm ) then
+ if(iwarnp.ge.1) then
+ write( nfecra,1000) cnom,isweep,residu,rnorm
+ endif
+ goto 200
+endif
+
+if(iwarnp.ge.3) then
+ write( nfecra,1000) cnom,isweep,residu,rnorm
+endif
+
+ 100 continue
+
+if(iwarnp.ge.2) then
+ write( nfecra,1100)cnom, nswmod
+endif
+
+!===============================================================================
+! 3. SORTIE OU CALCUL D'ESTIMATEURS POUR LES VITESSES
+! A L'ETAPE DE PREDICTION
+!===============================================================================
+
+ 200 continue
+
+! ---> TEST DE PASSAGE DANS LE CALCUL
+
+if (iescap.gt.0) then
+
+! ---> CALCUL DE LA CONTRIBUTION COMPOSANTE PAR COMPOSANTE. DE L ESTIMATEUR
+
+
+! SMBINI CONTIENT LES TERMES INSTAT ET EN DIV(U) DU SECOND MEMBRE
+! MIS A JOUR A CHAQUE SWEEP,DONC AU DERNIER, POUR KMAX +1, ON A:
+
+ do iel = 1,ncel
+ smbrp(iel) = smbini(iel) - rovsdt(iel)*dpvar(iel)
+ enddo
+
+ inc = 1
+ iccocg = 1
+
+ call cfbsc2 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , iifbru , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ifrusb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ pvar , coefap , coefbp , cofafp , cofbfp , &
+ flumas , flumab , viscfs , viscbs , &
+ smbrp , &
+! ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! CONTRIBUTION DES NORMES L2 DES DIFFERENTES COMPOSANTES
+! DANS LE TABLEAU DAM QUI EST ICI DISPONIBLE.
+
+ do iel = 1,ncel
+ dam(iel) = (smbrp(iel)/ volume(iel))**2
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format ( &
+ 1X,A8,' : CV-DIF-TS',I5,' IT - RES= ',E12.5,' NORME= ', E12.5)
+ 1100 format ( &
+'@ ',/,&
+'@ @@ ATTENTION : ',A8 ,' CONVECTION-DIFFUSION-TERMES SOURCES ',/,&
+'@ ========= ',/,&
+'@ Nombre d''iterations maximal ',I10 ,' atteint ',/,&
+'@ ' )
+
+!12345678 : CV-DIF-TS 2000 IT - RES= 1234567890234 NORME= 12345678901234
+!ATTENTION 12345678 : NON CONVERGENCE DU SYSTEME CONV-DIFF-TS
+!----
+! FIN
+!----
+
+end
diff --git a/src/cfbl/cfdivs.f90 b/src/cfbl/cfdivs.f90
new file mode 100644
index 0000000..4f60186
--- /dev/null
+++ b/src/cfbl/cfdivs.f90
@@ -0,0 +1,525 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfdivs &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ diverg , ux , uy , uz , &
+ vistot , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+! v
+! CALCULE DIVERG = DIVERG + DIV(SIGMA .U)
+
+! v t
+! AVEC SIGMA = MU (GRAD(U) + GRAD(U)) + (KAPPA - 2/3 MU) DIV(U) Id
+
+! ET MU = MU_LAMINAIRE + MU_TURBULENT
+
+! DIV(U) EST CALCULE A PARTIR DE FLUMAS/RHO
+! GRAD_TRANSPOSE(U) EST UN GRADIENT CELLULE
+
+! REMARQUES :
+! - Theoriquement le terme en div(u) devrait plutot etre calcule
+! par un gradient cellule, pour correspondre exactement au
+! terme en dUj/dxi. Mais comme la partie en dUi/dxj est
+! calculee completement autrement (gradient facette et implicitation)
+! de toute facon on n'aura jamais Trace(tau_ij)=0 exactement.
+! - Pour la meme raison, comme le terme en dUi/dxj est calcule sur les
+! elements de bord et pas celui en dUj/dxi, il est difficile de
+! traiter le terme en div(u) de maniere rigoureuse. Il est donc
+! conserve sur les elements de bord.
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! phase courante !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! diverg(ncelet ! tr ! --> ! div(sigma.u) !
+! ux,y,z(ncelet ! tr ! <-- ! composantes du vecteur u !
+! vistot(ncelet ! tr ! --- ! tableau de travail pour mu !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstphy.h"
+include "entsor.h"
+include "numvar.h"
+include "optcal.h"
+include "vector.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision diverg(ncelet)
+double precision ux(ncelet), uy(ncelet), uz(ncelet)
+double precision vistot(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iccocg, inc, iel, ifac, ivar, isou, ii, jj
+integer iuiph, iviph, iwiph
+integer iclvar
+integer nswrgp, imligp, iwarnp
+integer ipcvis, ipcvst, ipcvsv
+integer idimte, itenso, iphydp
+double precision epsrgp, climgp, extrap
+double precision vecfac, visttt
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+if(iviscv(iphas).gt.0) then
+ ipcvsv = ipproc(iviscv(iphas))
+else
+ ipcvsv = 0
+endif
+
+
+! --- Calcul de la viscosite totale
+
+if (itytur(iphas).eq.3 ) then
+ do iel = 1, ncel
+ vistot(iel) = propce(iel,ipcvis)
+ enddo
+else
+ do iel = 1, ncel
+ vistot(iel) = propce(iel,ipcvis) + propce(iel,ipcvst)
+ enddo
+endif
+
+! Pour la periodicite de rotation, il faut avoir calcule
+! le gradient avec grdcel. La seule solution consiste donc a
+! echanger VISTOT puis a faire le produit, y compris sur les
+! cellules halo (calcul sur le halo, exceptionnellement).
+! Pour le parallelisme, on s'aligne sur la sequence ainsi definie.
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if(irangp.ge.0) then
+ call parcom (vistot)
+ !==========
+ if(ipcvsv.gt.0) then
+ call parcom (propce(1,ipcvsv))
+ !==========
+ endif
+endif
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+( idimte , itenso , &
+ vistot , vistot , vistot , &
+ vistot , vistot , vistot , &
+ vistot , vistot , vistot )
+ if(ipcvsv.gt.0) then
+ call percom &
+ !==========
+( idimte , itenso , &
+ propce(1,ipcvsv) , propce(1,ipcvsv) , propce(1,ipcvsv) , &
+ propce(1,ipcvsv) , propce(1,ipcvsv) , propce(1,ipcvsv) , &
+ propce(1,ipcvsv) , propce(1,ipcvsv) , propce(1,ipcvsv) )
+ endif
+endif
+
+
+!===============================================================================
+! 2. CALCUL DES TERMES DE LA DIVERGENCE
+!===============================================================================
+
+! --- Boucle sur les composantes de vitesse Ui
+
+do isou = 1, 3
+
+ if (isou.eq.1) ivar = iuiph
+ if (isou.eq.2) ivar = iviph
+ if (isou.eq.3) ivar = iwiph
+
+! Ceci pointe eventuellement sur ICLRTP(IVAR,ICOEF)
+ iclvar = iclrtp(ivar,icoeff)
+
+! --- Calcul du gradient de la vitesse
+
+ iccocg = 1
+ inc = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+
+! --- Assemblage sur les faces internes
+
+! On a echange le gradient dans grdcel et vistot plus haut
+
+ if(ipcvsv.gt.0) then
+ if (isou.eq.1) then
+ do iel = 1, ncelet
+ visttt = propce(iel,ipcvsv) - 2.d0/3.d0*vistot(iel)
+ w4(iel) = vistot(iel)*( 2.d0*w1(iel)*ux(iel) &
+ + w2(iel)*uy(iel) &
+ + w3(iel)*uz(iel) ) &
+ + visttt*w1(iel)*ux(iel)
+ w5(iel) = vistot(iel)*w2(iel)*ux(iel) &
+ + visttt*w1(iel)*uy(iel)
+ w6(iel) = vistot(iel)*w3(iel)*ux(iel) &
+ + visttt*w1(iel)*uz(iel)
+ enddo
+
+ elseif(isou.eq.2) then
+ do iel = 1, ncelet
+ visttt = propce(iel,ipcvsv) - 2.d0/3.d0*vistot(iel)
+ w4(iel) = vistot(iel)*w1(iel)*uy(iel) &
+ + visttt*w2(iel)*ux(iel)
+ w5(iel) = vistot(iel)*( w1(iel)*ux(iel) &
+ + 2.d0*w2(iel)*uy(iel) &
+ + w3(iel)*uz(iel) ) &
+ + visttt*w2(iel)*uy(iel)
+ w6(iel) = vistot(iel)*w3(iel)*uy(iel) &
+ + visttt*w2(iel)*uz(iel)
+ enddo
+
+ elseif(isou.eq.3) then
+ do iel = 1, ncelet
+ visttt = propce(iel,ipcvsv) - 2.d0/3.d0*vistot(iel)
+ w4(iel) = vistot(iel)*w1(iel)*uz(iel) &
+ + visttt*w3(iel)*ux(iel)
+ w5(iel) = vistot(iel)*w2(iel)*uz(iel) &
+ + visttt*w3(iel)*uy(iel)
+ w6(iel) = vistot(iel)*( w1(iel)*ux(iel) &
+ + w2(iel)*uy(iel) &
+ + 2.d0*w3(iel)*uz(iel) ) &
+ + visttt*w3(iel)*uz(iel)
+ enddo
+
+ endif
+
+ else
+
+ if (isou.eq.1) then
+ do iel = 1, ncelet
+ visttt = viscv0(iphas) - 2.d0/3.d0*vistot(iel)
+ w4(iel) = vistot(iel)*( 2.d0*w1(iel)*ux(iel) &
+ + w2(iel)*uy(iel) &
+ + w3(iel)*uz(iel) ) &
+ + visttt*w1(iel)*ux(iel)
+ w5(iel) = vistot(iel)*w2(iel)*ux(iel) &
+ + visttt*w1(iel)*uy(iel)
+ w6(iel) = vistot(iel)*w3(iel)*ux(iel) &
+ + visttt*w1(iel)*uz(iel)
+ enddo
+
+ elseif(isou.eq.2) then
+ do iel = 1, ncelet
+ visttt = viscv0(iphas) - 2.d0/3.d0*vistot(iel)
+ w4(iel) = vistot(iel)*w1(iel)*uy(iel) &
+ + visttt*w2(iel)*ux(iel)
+ w5(iel) = vistot(iel)*( w1(iel)*ux(iel) &
+ + 2.d0*w2(iel)*uy(iel) &
+ + w3(iel)*uz(iel) ) &
+ + visttt*w2(iel)*uy(iel)
+ w6(iel) = vistot(iel)*w3(iel)*uy(iel) &
+ + visttt*w2(iel)*uz(iel)
+ enddo
+
+ elseif(isou.eq.3) then
+ do iel = 1, ncelet
+ visttt = viscv0(iphas) - 2.d0/3.d0*vistot(iel)
+ w4(iel) = vistot(iel)*w1(iel)*uz(iel) &
+ + visttt*w3(iel)*ux(iel)
+ w5(iel) = vistot(iel)*w2(iel)*uz(iel) &
+ + visttt*w3(iel)*uy(iel)
+ w6(iel) = vistot(iel)*( w1(iel)*ux(iel) &
+ + w2(iel)*uy(iel) &
+ + 2.d0*w3(iel)*uz(iel) ) &
+ + visttt*w3(iel)*uz(iel)
+ enddo
+
+ endif
+
+ endif
+
+
+
+! On initialise DIVERG(NCEL+1, NCELET)
+! (valeur bidon, mais pas NaN : les calculs sur le halo sont
+! par principe denue de sens, sauf exception)
+ if(ncelet.gt.ncel) then
+ do iel = ncel+1, ncelet
+ diverg(iel) = 0.d0
+ enddo
+ endif
+
+
+
+ if(ivecti.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+!MO VECFAC = SURFAC(ISOU,IFAC)
+!MO & *(POND(IFAC)*W4(II)+(1.D0-POND(IFAC))*W4(JJ))
+ vecfac = surfac(1,ifac)*(w4(ii)+w4(jj))*0.5d0 &
+ + surfac(2,ifac)*(w5(ii)+w5(jj))*0.5d0 &
+ + surfac(3,ifac)*(w6(ii)+w6(jj))*0.5d0
+ diverg(ii) = diverg(ii) + vecfac
+ diverg(jj) = diverg(jj) - vecfac
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+!MO VECFAC = SURFAC(ISOU,IFAC)
+!MO & *(POND(IFAC)*W4(II)+(1.D0-POND(IFAC))*W4(JJ))
+ vecfac = surfac(1,ifac)*(w4(ii)+w4(jj))*0.5d0 &
+ + surfac(2,ifac)*(w5(ii)+w5(jj))*0.5d0 &
+ + surfac(3,ifac)*(w6(ii)+w6(jj))*0.5d0
+ diverg(ii) = diverg(ii) + vecfac
+ diverg(jj) = diverg(jj) - vecfac
+ enddo
+
+ endif
+
+
+! --- Assemblage sur les faces de bord
+
+ if(ivectb.eq.1) then
+
+!CDIR NODEP
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ vecfac = surfbo(1,ifac)*w4(ii) &
+ + surfbo(2,ifac)*w5(ii) &
+ + surfbo(3,ifac)*w6(ii)
+ diverg(ii) = diverg(ii) + vecfac
+ enddo
+
+ else
+
+! VECTORISATION NON FORCEE
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ vecfac = surfbo(1,ifac)*w4(ii) &
+ + surfbo(2,ifac)*w5(ii) &
+ + surfbo(3,ifac)*w6(ii)
+ diverg(ii) = diverg(ii) + vecfac
+ enddo
+
+ endif
+
+enddo
+
+
+return
+
+end
diff --git a/src/cfbl/cfdttv.f90 b/src/cfbl/cfdttv.f90
new file mode 100644
index 0000000..c160fba
--- /dev/null
+++ b/src/cfbl/cfdttv.f90
@@ -0,0 +1,312 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfdttv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iwarnp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ wcf , &
+ wflmas , wflmab , viscb , w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DE LA CONTRAINTE LIEE AU CFL POUR L'ALGO COMPRESSIBLE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules avec tsm !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,nvar) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! wcf(ncelet) ! tr ! --> ! contrainte compressible !
+! wflmas(nfac) ! tr ! --- ! tab de trav aux faces internes !
+! wflmab(nfabor ! tr ! --- ! tab de trav aux faces de bord !
+! viscb(nfabor ! tr ! --- ! tab de trav aux faces de bord !
+! w1..6 (ncelet ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iwarnp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision wcf(ncelet)
+double precision wflmas(nfac), wflmab(nfabor), viscb(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia, ifinra
+integer ifac , iel , iphas , ivar , iscal
+integer init
+integer iw7 , iw8 , iw9 , iw10 , iw11 , iw12
+integer iviscf, icoefu, ixam
+
+!===============================================================================
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+
+iscal = irho(iphas)
+ivar = isca(iscal)
+
+!===============================================================================
+! 1. MEMOIRE
+!===============================================================================
+
+call memcft &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iw7 , iw8 , iw9 , iw10 , iw11 , iw12 , &
+ iviscf , icoefu , ixam , &
+ ifinia , ifinra )
+
+idebia = ifinia
+idebra = ifinra
+
+!===============================================================================
+! 2. CALCUL DE LA CONDITION CFL ASSOCIEE A LA MASSE VOLUMIQUE
+!===============================================================================
+
+! ---> Calcul du "flux de masse" associe a la masse volumique
+
+do ifac = 1, nfac
+ wflmas(ifac) = 0.d0
+enddo
+do ifac = 1, nfabor
+ wflmab(ifac) = 0.d0
+enddo
+
+call cfmsfl &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ wflmas , wflmab , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ ra(iw7), ra(iw8), ra(iw9), ra(iw10) , ra(iw11) , ra(iw12) , &
+ ra(iviscf) , viscb , ra(icoefu) , ra(ixam) , &
+ rdevel , rtuser , &
+ ra )
+
+! ---> Sommation sur les faces (depend de si l'on explicite ou non
+! le terme de convection)
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,wflmas,wflmab,w1)
+
+do ifac = 1, nfac
+ wflmas(ifac) = max(0.d0,wflmas(ifac))
+enddo
+do ifac = 1, nfabor
+ wflmab(ifac) = max(0.d0,wflmab(ifac))
+enddo
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,wflmas,wflmab,w2)
+
+
+! ---> Calcul du coefficient CFL/Dt
+
+do iel = 1, ncel
+ wcf(iel) = max( -dble(iconv(ivar))*w1(iel)/volume(iel), &
+ max( dble(1-iconv(ivar))*w2(iel)/volume(iel), 0.d0 ) )
+enddo
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfener.f90 b/src/cfbl/cfener.f90
new file mode 100644
index 0000000..5fc334c
--- /dev/null
+++ b/src/cfbl/cfener.f90
@@ -0,0 +1,1121 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfener &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR L'ENERGIE TOTALE SUR UN PAS DE TEMPS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cfpoin.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ifinia, ifinra
+integer ivar , iphas
+integer ifac , iel
+integer init , isqrt , iii
+integer iclvar, iclvaf
+integer ipcrom, ipcvst, ipcvsl, iflmas, iflmab
+integer ippvar, ipp
+integer nswrgp, imligp, iwarnp
+integer iconvp, idiffp, ndircp, ireslp, nitmap
+integer nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+double precision epsrgp, climgp, extrap, blencp, epsilp
+double precision sclnor, thetap, epsrsp
+
+integer iwb , inc , iccocg , icoefa , icoefb
+integer ivar0 , iphydp , iij , ii , jj
+integer iccfth , imodif
+integer iel1 , iel2, iifru, iifbe
+integer idimte, itenso , iterns
+integer maxelt, ils, idbia1
+double precision flux
+double precision dijpfx, dijpfy, dijpfz, pond , pip , pjp
+double precision diipfx, diipfy, diipfz, djjpfx, djjpfy, djjpfz
+! DOUBLE PRECISION FLUI , FLUJ
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero de phase associee au scalaire traite
+iphas = iphsca(iscal)
+
+! --- Numero de variable de calcul et de post associe au scalaire traite
+ivar = isca(iscal)
+ippvar = ipprtp(ivar)
+
+! --- Numero des conditions aux limites
+iclvar = iclrtp(ivar,icoef)
+iclvaf = iclrtp(ivar,icoeff)
+
+! --- Numero des grandeurs physiques
+ipcrom = ipproc(irom (iphas))
+ipcvst = ipproc(ivisct(iphas))
+iflmas = ipprof(ifluma(ivar ))
+iflmab = ipprob(ifluma(ivar ))
+if(ivisls(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+else
+ ipcvsl = 0
+endif
+
+! --- Indicateur flux de bord Rusanov
+if(iifbru.gt.0) then
+ iifru = iifbru+(iphas-1)*nfabor
+else
+ iifru = 1
+endif
+
+! --- Indicateur flux conductif de bord impos�
+if(iifbet.gt.0) then
+ iifbe = iifbet+(iphas-1)*nfabor
+else
+ iifbe = 1
+endif
+
+! --- Impressions
+chaine = nomvar(ippvar)
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+endif
+
+! --- Reservation de la memoire
+
+call memcfe &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwb , &
+ ifinia , ifinra )
+
+idebia = ifinia
+idebra = ifinra
+
+!===============================================================================
+! 2. TERMES SOURCES
+!===============================================================================
+
+! --> Theta-schema de resolution
+
+! Pour l'instant on prend THETA=1 et on ne code pas le theta-schema
+
+! --> Initialisation
+
+do iel = 1, ncel
+ smbrs(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+
+! TERME SOURCE VOLUMIQUE DE CHALEUR : RHO*PHI *VOLUME
+! ================================= v
+
+maxelt = max(ncelet,nfac,nfabor)
+ils = idebia
+idbia1 = ils + maxelt
+CALL IASIZE('CFENER',IDBIA1)
+
+call ustssc &
+!==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+! ------ ------
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , drtp , dam , &
+ rdevel , rtuser , ra )
+
+do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + rovsdt(iel)*rtp(iel,ivar)
+ rovsdt(iel) = max(-rovsdt(iel),zero)
+enddo
+
+
+! TERMES DE SOURCE DE MASSE
+! =========================
+
+! GAMMA(IEL) = SMACEL(IEL,IPR(IPHAS))
+
+! Terme implicite : GAMMA*VOLUME
+! n
+! Terme explicite : GAMMA*VOLUME*e - GAMMA*VOLUME*e
+! inj
+if (ncesmp.gt.0) then
+ iterns = 1
+ call catsma ( ncelet , ncel , ncesmp , iterns , &
+ isno2t(iphas), thetav(ivar), &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtpa(1,ivar) , smacel(1,ivar) , &
+ smacel(1,ipr(iphas)) , smbrs , rovsdt , w1)
+endif
+
+! __ n+1
+! TERME D'ACCUMULATION DE MASSE : > (Q .n) *S
+! ============================= -- pr ij ij
+
+init = 1
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,propfa(1,iflmas),propfb(1,iflmab),w1)
+
+! __ n+1 n
+! TERME INSTATIONNAIRE EXPLICITE : > (Q .n) *S * e
+! ============================== -- pr ij ij
+
+do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+enddo
+
+! RHO*VOLUME __ n+1
+! TERME INSTATIONNAIRE IMPLICITE : ---------- - > (Q .n) *S
+! ============================== DT -- pr ij ij
+
+do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) - iconv(ivar)*w1(iel) &
+ + istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel)
+enddo
+
+! __ v
+! TERME DE DISSIPATION VISQUEUSE : > ((SIGMA *U).n) *S
+! ============================== -- ij ij
+
+if( idiff(iu(iphas)).ge. 1 ) then
+! ^^^
+ call cfdivs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rtp(1,iu(iphas)), rtp(1,iv(iphas)), rtp(1,iw(iphas)), &
+! ------
+ w9 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+! __ P n+1
+! TERME DE TRANSPORT DE PRESSION : - > (---) *(Q .n) *S
+! ============================== -- RHO ij pr ij ij
+
+
+if(igrdpp(iphas).gt.0) then
+ do iel = 1, ncel
+ w9(iel) = rtp(iel,isca(irho(iphas)))
+ enddo
+else
+ do iel = 1, ncel
+ w9(iel) = rtpa(iel,isca(irho(iphas)))
+ enddo
+endif
+
+! Avec Reconstruction : ca pose probleme pour l'instant
+
+
+! Calcul du gradient de P/RHO
+
+! DO IEL = 1, NCEL
+! W7(IEL) = RTP(IEL,IPR(IPHAS))/W9(IEL)
+! ENDDO
+
+! Rq : A defaut de connaitre les parametres pour P/RHO on prend ceux de P
+
+! III = IPR(IPHAS)
+! INC = 1
+! ICCOCG = 1
+! NSWRGP = NSWRGR(III)
+! IMLIGP = IMLIGR(III)
+! IWARNP = IWARNI(III)
+! EPSRGP = EPSRGR(III)
+! CLIMGP = CLIMGR(III)
+! EXTRAP = EXTRAG(III)
+
+! On alloue localement 2 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB de P/RHO
+
+! ICOEFA = IDEBRA
+! ICOEFB = ICOEFA + NFABOR
+! IFINRA = ICOEFB + NFABOR
+! CALL RASIZE ('CFENER',IFINRA)
+!==========
+
+! DO IFAC = 1, NFABOR
+! RA(ICOEFA+IFAC-1) = ZERO
+! RA(ICOEFB+IFAC-1) = 1.D0
+! ENDDO
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+! IF(IRANGP.GE.0) THEN
+! CALL PARCOM(W7)
+ !==========
+! ENDIF
+
+! Periodique
+! IF(IPERIO.EQ.1) THEN
+! IDIMTE = 0
+! ITENSO = 0
+! CALL PERCOM
+ !==========
+! &( IDIMTE , ITENSO ,
+! & W7 , W7 , W7 ,
+! & W7 , W7 , W7 ,
+! & W7 , W7 , W7 )
+! ENDIF
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+! IVAR0 = 0
+! IPHYDP = 0
+! CALL GRDCEL
+!==========
+! & ( IDEBIA , IFINRA ,
+! & NDIM , NCELET , NCEL , NFAC , NFABOR , NFML , NPRFML ,
+! & NNOD , LNDFAC , LNDFBR , NCELBR , NPHAS ,
+! & NIDEVE , NRDEVE , NITUSE , NRTUSE ,
+! & IVAR0 , IMRGRA , INC , ICCOCG , NSWRGP , IMLIGP , IPHYDP ,
+! & IWARNP , NFECRA , EPSRGP , CLIMGP , EXTRAP ,
+! & IFACEL , IFABOR , IFMFBR , IFMCEL , IPRFML ,
+! & IPNFAC , NODFAC , IPNFBR , NODFBR ,
+! & IDEVEL , ITUSER , IA ,
+! & XYZCEN , SURFAC , SURFBO , CDGFAC , CDGFBO , XYZNOD , VOLUME ,
+! & W7 , W7 , W7 ,
+! & W7 , RA(ICOEFA) , RA(ICOEFB) ,
+! & W1 , W2 , W3 ,
+! & W4 , W5 , W6 ,
+! & RDEVEL , RTUSER , RA )
+
+! On libere la place dans RA
+
+! IFINRA = IDEBRA
+
+! Faces internes
+! DO IFAC = 1, NFAC
+
+! II = IFACEL(1,IFAC)
+! JJ = IFACEL(2,IFAC)
+
+! IIJ = IDIJPF-1+3*(IFAC-1)
+! DIJPFX = RA(IIJ+1)
+! DIJPFY = RA(IIJ+2)
+! DIJPFZ = RA(IIJ+3)
+
+! POND = RA(IPOND-1+IFAC)
+
+! Calcul II' et JJ'
+
+! DIIPFX = CDGFAC(1,IFAC) - (XYZCEN(1,II)+
+! & (1.D0-POND) * DIJPFX)
+! DIIPFY = CDGFAC(2,IFAC) - (XYZCEN(2,II)+
+! & (1.D0-POND) * DIJPFY)
+! DIIPFZ = CDGFAC(3,IFAC) - (XYZCEN(3,II)+
+! & (1.D0-POND) * DIJPFZ)
+! DJJPFX = CDGFAC(1,IFAC) - XYZCEN(1,JJ)+
+! & POND * DIJPFX
+! DJJPFY = CDGFAC(2,IFAC) - XYZCEN(2,JJ)+
+! & POND * DIJPFY
+! DJJPFZ = CDGFAC(3,IFAC) - XYZCEN(3,JJ)+
+! & POND * DIJPFZ
+
+! PIP = W7(II)
+! & +W1(II)*DIIPFX+W2(II)*DIIPFY+W3(II)*DIIPFZ
+
+! PJP = W7(JJ)
+! & +W1(JJ)*DJJPFX+W2(JJ)*DJJPFY+W3(JJ)*DJJPFZ
+
+! FLUI = (PROPFA(IFAC,IFLMAS)+ABS(PROPFA(IFAC,IFLMAS)))
+! FLUJ = (PROPFA(IFAC,IFLMAS)-ABS(PROPFA(IFAC,IFLMAS)))
+
+! VISCF(IFAC) = -(POND*PIP*FLUI+POND*PJP*FLUJ)
+
+! ENDDO
+
+! Sans Reconstruction
+
+! En periodique et parallele, echange avant utilisation
+! des valeurs aux faces
+
+! Parallele
+if(irangp.ge.0) then
+ call parcom(w9)
+ !==========
+endif
+
+! Periodique
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+( idimte , itenso , &
+ w9 , w9 , w9 , &
+ w9 , w9 , w9 , &
+ w9 , w9 , w9 )
+endif
+
+! Faces internes
+do ifac = 1, nfac
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+ viscf(ifac) = &
+ - rtp(iel1,ipr(iphas))/w9(iel1) &
+ *0.5d0*( propfa(ifac,iflmas) +abs(propfa(ifac,iflmas)) ) &
+ - rtp(iel2,ipr(iphas))/w9(iel2) &
+ *0.5d0*( propfa(ifac,iflmas) -abs(propfa(ifac,iflmas)) )
+enddo
+
+! Faces de bord : pour les faces ou on a calcule un flux de Rusanov,
+! on remplace la contribution standard par le flux de Rusanov qui
+! contient tous les flux convectifs (et il faudra donc eliminer le
+! flux convectif dans cfbsc2)
+
+if(iifbru.gt.0) then
+
+ do ifac = 1, nfabor
+ if(ia(iifru+ifac-1).eq.0) then
+
+ iel = ifabor(ifac)
+ viscb(ifac) = - propfb(ifac,iflmab) &
+ * ( coefa(ifac,iclrtp(ipr(iphas),icoef)) &
+ + coefb(ifac,iclrtp(ipr(iphas),icoef))*rtp(iel,ipr(iphas)) )&
+ / ( coefa(ifac,iclrtp(isca(irho(iphas)),icoef)) &
+ + coefb(ifac,iclrtp(isca(irho(iphas)),icoef))*w9(iel) )
+
+ else
+ viscb(ifac) = - propfb(ifac,ipprob(ifbene(iphas)))
+ endif
+ enddo
+
+else
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+ viscb(ifac) = - propfb(ifac,iflmab) &
+ * ( coefa(ifac,iclrtp(ipr(iphas),icoef)) &
+ + coefb(ifac,iclrtp(ipr(iphas),icoef))*rtp(iel,ipr(iphas)) )&
+ / ( coefa(ifac,iclrtp(isca(irho(iphas)),icoef)) &
+ + coefb(ifac,iclrtp(isca(irho(iphas)),icoef))*w9(iel) )
+
+ enddo
+endif
+
+! Divergence
+init = 0
+call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,smbrs)
+
+
+! TERME DE FORCES DE PESANTEUR : RHO*g.U *VOLUME
+! ============================
+
+do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + w9(iel)*volume(iel) &
+ *( gx*rtp(iel,iu(iphas)) &
+ + gy*rtp(iel,iv(iphas)) &
+ + gz*rtp(iel,iw(iphas)) )
+enddo
+
+! Kij*Sij LAMBDA Cp MUT
+! "VITESSE" DE DIFFUSION FACETTE : --------- avec K = ------ + -- .------
+! ============================== IJ.nij Cv Cv SIGMAS
+
+if( idiff(ivar).ge. 1 ) then
+
+! MUT/SIGMAS
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvst)/sigmas(iscal)
+ enddo
+! CP*MUT/SIGMAS
+ if(icp(iphas).gt.0) then
+ do iel = 1, ncel
+ w1(iel) = w1(iel)*propce(iel,ipproc(icp(iphas)))
+ enddo
+ else
+ do iel = 1, ncel
+ w1(iel) = w1(iel)*cp0(iphas)
+ enddo
+ endif
+! (CP/CV)*MUT/SIGMAS
+ if(icv(iphas).gt.0) then
+ do iel = 1, ncel
+ w1(iel) = w1(iel)/propce(iel,ipproc(icv(iphas)))
+ enddo
+ else
+ do iel = 1, ncel
+ w1(iel) = w1(iel)/cv0(iphas)
+ enddo
+ endif
+! (CP/CV)*MUT/SIGMAS+LAMBDA/CV
+ if(ipcvsl.eq.0)then
+ do iel = 1, ncel
+ w1(iel) = w1(iel) + visls0(iscal)
+ enddo
+ else
+ do iel = 1, ncel
+ w1(iel) = w1(iel) + propce(iel,ipcvsl)
+ enddo
+ endif
+
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+
+! TERME DIFFUSIF COMPLEMENTAIRE : - div( K grad ( epsilon - Cv.T ) )
+! ============================= 1 2
+! - div( K grad ( -.u ) )
+! 2
+
+! Terme complementaire au centre des cellules
+ iccfth = 7
+ imodif = 0
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w9 , ra(iwb), w8 , w1 , &
+! ------ -------
+ rdevel , rtuser , ra )
+
+! Calcul de la divergence avec reconstruction
+
+
+! Calcul du gradient de (0.5*u*u+EPSILONsup)
+
+
+do iel = 1, ncel
+ w7(iel) =0.5d0*( rtp(iel,iu(iphas))**2 &
+ +rtp(iel,iv(iphas))**2 &
+ +rtp(iel,iw(iphas))**2 ) + w9(iel)
+enddo
+
+! Rq : A defaut de connaitre les parametres, on prend ceux de la Vitesse
+
+iii = iu(iphas)
+inc = 1
+iccocg = 1
+nswrgp = nswrgr(iii)
+imligp = imligr(iii)
+iwarnp = iwarni(iii)
+epsrgp = epsrgr(iii)
+climgp = climgr(iii)
+extrap = extrag(iii)
+
+! On alloue localement 2 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB
+
+icoefa = idebra
+icoefb = icoefa + nfabor
+ifinra = icoefb + nfabor
+CALL RASIZE ('CFENER',IFINRA)
+!==========
+
+do ifac = 1, nfabor
+ ra(icoefa+ifac-1) = zero
+ ra(icoefb+ifac-1) = 1.d0
+enddo
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+if(irangp.ge.0) then
+ call parcom(w7)
+ !==========
+endif
+
+! Periodique
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+( idimte , itenso , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 )
+endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ivar0 = 0
+iphydp = 0
+call grdcel &
+!==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , w7 , w7 , &
+ w7 , ra(icoefa) , ra(icoefb) , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! On libere la place dans RA
+
+ifinra = idebra
+
+! Faces internes
+
+do ifac = 1, nfac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+! Calcul II' et JJ'
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ pip = w7(ii) &
+ +w1(ii)*diipfx+w2(ii)*diipfy+w3(ii)*diipfz
+
+ pjp = w7(jj) &
+ +w1(jj)*djjpfx+w2(jj)*djjpfy+w3(jj)*djjpfz
+
+ flux = viscf(ifac)*(pip-pjp)
+
+ smbrs(ii) = smbrs(ii) - flux
+ smbrs(jj) = smbrs(jj) + flux
+
+enddo
+
+
+! Assemblage a partir des facettes de bord
+! Pour les faces � flux impos� ou temperature impos�e, tout est
+! pris par le terme de diffusion de l'energie. On ne doit donc
+! pas prendre en compte la contribution des termes en u2 et e-CvT
+! quand IA(IIFBE+IFAC-1).NE.0
+
+ if(iifbet.gt.0) then
+ do ifac = 1, nfabor
+
+ if(ia(iifbe+ifac-1).eq.0) then
+ iel = ifabor(ifac)
+
+ flux = viscb(ifac)*( w9(iel) - ra(iwb +ifac-1) &
+ + 0.5d0*( rtp(iel,iu(iphas))**2 - &
+ ( coefa(ifac,iclrtp(iu(iphas),icoef)) &
+ + coefb(ifac,iclrtp(iu(iphas),icoef))*rtp(iel,iu(iphas)) )**2 &
+ + rtp(iel,iv(iphas))**2 - &
+ ( coefa(ifac,iclrtp(iv(iphas),icoef)) &
+ + coefb(ifac,iclrtp(iv(iphas),icoef))*rtp(iel,iv(iphas)) )**2 &
+ + rtp(iel,iw(iphas))**2 - &
+ ( coefa(ifac,iclrtp(iw(iphas),icoef)) &
+ + coefb(ifac,iclrtp(iw(iphas),icoef))*rtp(iel,iw(iphas)) )**2))
+
+ smbrs(iel) = smbrs(iel) - flux
+
+ endif
+
+ enddo
+
+! Sinon : meme code, mais sans le test
+ else
+
+ do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+ flux = viscb(ifac)*( w9(iel) - ra(iwb +ifac-1) &
+ + 0.5d0*( rtp(iel,iu(iphas))**2 - &
+ ( coefa(ifac,iclrtp(iu(iphas),icoef)) &
+ + coefb(ifac,iclrtp(iu(iphas),icoef))*rtp(iel,iu(iphas)) )**2 &
+ + rtp(iel,iv(iphas))**2 - &
+ ( coefa(ifac,iclrtp(iv(iphas),icoef)) &
+ + coefb(ifac,iclrtp(iv(iphas),icoef))*rtp(iel,iv(iphas)) )**2 &
+ + rtp(iel,iw(iphas))**2 - &
+ ( coefa(ifac,iclrtp(iw(iphas),icoef)) &
+ + coefb(ifac,iclrtp(iw(iphas),icoef))*rtp(iel,iw(iphas)) )**2))
+
+ smbrs(iel) = smbrs(iel) - flux
+
+ enddo
+ endif
+
+else
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+endif
+
+!===============================================================================
+! 4. RESOLUTION
+!===============================================================================
+
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+nitmap = nitmax(ivar)
+ndircp = ndircl(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+ipp = ippvar
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+thetap = thetav(ivar)
+iescap = 0
+
+call cfcdts &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iscal , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , iifbru , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iifru) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbrs , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 5. IMPRESSIONS ET CLIPPINGS
+!===============================================================================
+
+! Valeur bidon
+ iii = 1
+
+call clpsca &
+!==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , rtp(1,iii) , rtp )
+
+! --- Traitement utilisateur pour gestion plus fine des bornes
+! et actions correctives �ventuelles.
+ iccfth = -4
+ imodif = 0
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! --- Bilan explicite (voir codits : on enleve l'increment)
+
+if (iwarni(ivar).ge.2) then
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) &
+ - istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel)&
+ *(rtp(iel,ivar)-rtpa(iel,ivar)) &
+ * max(0,min(nswrsm(ivar)-2,1))
+ enddo
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,smbrs,smbrs,sclnor)
+ write(nfecra,1200)chaine(1:8) ,sclnor
+endif
+
+!===============================================================================
+! 6. ACTUALISATION FINALE DE LA PRESSION (et calcul de la temp�rature)
+!===============================================================================
+! n+1 n+1 n+1
+! On utilise l'equation d'etat P =P(RHO ,H )
+
+! --- Calcul de P et T au centre des cellules
+ iccfth = 24
+ imodif = 0
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ rtp(1,ipr(iphas)) , rtp(1,isca(itempk(iphas))) , w8 , w9 , &
+! ----------------- --------------------------
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 7. COMMUNICATION DE LA PRESSION, DE L'ENERGIE ET DE LA TEMPERATURE
+!===============================================================================
+
+if(irangp.ge.0) then
+ call parcom (rtp(1,ipr(iphas)))
+ !==========
+ call parcom (rtp(1,ivar))
+ !==========
+ call parcom (rtp(1,isca(itempk(iphas))))
+ !==========
+endif
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), &
+ rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), &
+ rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)))
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar), &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar), &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) )
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,isca(itempk(iphas))) , rtp(1,isca(itempk(iphas))) , &
+ rtp(1,isca(itempk(iphas))) , rtp(1,isca(itempk(iphas))) , &
+ rtp(1,isca(itempk(iphas))) , rtp(1,isca(itempk(iphas))) , &
+ rtp(1,isca(itempk(iphas))) , rtp(1,isca(itempk(iphas))) , &
+ rtp(1,isca(itempk(iphas))) )
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(/, &
+' ** RESOLUTION POUR LA VARIABLE ',A8 ,/,&
+' --------------------------- ',/)
+ 1200 format(1X,A8,' : BILAN EXPLICITE = ',E14.5)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfini1.f90 b/src/cfbl/cfini1.f90
new file mode 100644
index 0000000..13d51ca
--- /dev/null
+++ b/src/cfbl/cfini1.f90
@@ -0,0 +1,440 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cfini1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR
+! LE COMPRESSIBLE SANS CHOC
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer ipp , ii
+integer iphas, iok
+
+!===============================================================================
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+ endif
+enddo
+do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ call csexit (1)
+ !==========
+ endif
+enddo
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! 1.1 Definition des scamin et des scamax des variables transportees
+! ==================================================================
+
+
+do iphas = 1, nphas
+
+ if( (abs(scamin(irho (iphas))+grand).gt.epzero).or. &
+ (abs(scamin(ienerg(iphas))+grand).gt.epzero).or. &
+ (abs(scamin(itempk(iphas))+grand).gt.epzero).or. &
+ (abs(scamax(irho (iphas))-grand).gt.epzero).or. &
+ (abs(scamax(ienerg(iphas))-grand).gt.epzero).or. &
+ (abs(scamax(itempk(iphas))-grand).gt.epzero) ) then
+ write(nfecra,2000) &
+ scamin(irho (iphas)),scamax(irho (iphas)), &
+ scamin(ienerg(iphas)),scamax(ienerg(iphas)), &
+ scamin(itempk(iphas)),scamax(itempk(iphas))
+ call csexit (1)
+ endif
+! SCAMIN(IRHO (IPHAS)) = -GRAND
+! SCAMAX(IRHO (IPHAS)) = GRAND
+! SCAMIN(IENERG(IPHAS)) = -GRAND
+! SCAMAX(IENERG(IPHAS)) = GRAND
+! SCAMIN(ITEMPK(IPHAS)) = -GRAND
+! SCAMAX(ITEMPK(IPHAS)) = GRAND
+
+enddo
+
+! 1.2 Nature des scalaires transportes
+! ====================================
+
+! ---- Type de scalaire (0 passif, 1 temperature en K
+! -1 temperature en C
+! 2 enthalpie en J
+! 3 energie totale en J)
+! La distinction -1/1 sert pour le rayonnement
+
+do iphas = 1, nphas
+
+ iscsth(irho (iphas)) = 0
+ iscsth(ienerg(iphas)) = 3
+ iscsth(itempk(iphas)) = 0
+
+ iscalt(iphas) = ienerg(iphas)
+
+enddo
+
+
+! - Schema convectif % schema 2ieme ordre
+! = 0 : upwind
+! = 1 : second ordre
+do ii = 1, nvarmx
+ blencv(ii) = 0.d0
+enddo
+
+! Upwind necessaire pour le schema utilise
+
+
+! 1.3 Variable courante : nom, sortie chrono, suivi listing, sortie hist
+! ======================================================================
+
+! Comme pour les autres variables,
+! si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! NOMVAR( ) = nom de la variable
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes
+
+! NB : Les 8 premiers caracteres du noms seront repris dans le
+! listing 'developpeur'
+
+! ======================================================================
+
+do iphas = 1, nphas
+
+ ipp = ipprtp(isca(irho (iphas)))
+ NOMVAR(IPP) = 'Rho'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+ ipp = ipprtp(isca(ienerg(iphas)))
+ NOMVAR(IPP) = 'EnergieT'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+ ipp = ipprtp(isca(itempk(iphas)))
+ NOMVAR(IPP) = 'Temp K'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+enddo
+
+
+!===============================================================================
+! 2. PARAMETRES GLOBAUX
+!===============================================================================
+
+! --- Couplage vitesse/pression (0 : algorithme classique,
+! 1 : couplage instationnaire)
+! Uniquement en monophasique et en incompressible
+
+if( ipucou.ne.0 ) then
+ write(nfecra,3000) ipucou
+ call csexit (1)
+endif
+
+
+! --- Estimateurs pour Navier-Stokes
+
+! Interdits en compressible
+
+do iphas = 1, nphas
+ if( (iescal(iespre,iphas).ne.0) .or. &
+ (iescal(iesder,iphas).ne.0) .or. &
+ (iescal(iescor,iphas).ne.0) .or. &
+ (iescal(iestot,iphas).ne.0) ) then
+ write(nfecra,4000)
+ call csexit (1)
+ endif
+! IESCAL(IESPRE,IPHAS) = 0
+! IESCAL(IESDER,IPHAS) = 0
+! IESCAL(IESCOR,IPHAS) = 0
+! IESCAL(IESTOT,IPHAS) = 0
+enddo
+
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL PAR DEFAUT
+!===============================================================================
+
+! Pour chaque phase
+
+do iphas = 1, nphas
+
+! --> Conditions aux limites prenant en compte l'equilibre hydrostatique
+! (oui = 1 , non = 0)
+
+ icfgrp(iphas) = 1
+
+
+! ---> Masse volumique variable et viscosite constante (pour les suites)
+ irovar(iphas) = 1
+ ivivar(iphas) = 0
+
+enddo
+
+
+!===============================================================================
+! 4. ON REDONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+call uscfx1
+!==========
+
+!===============================================================================
+! 5. OPTIONS DE CALCUL OBLIGATOIRES
+! qui pourront etre remontees au dessus de uscfx1
+! selon les developpements
+!===============================================================================
+
+! Pour chaque phase
+
+do iphas = 1, nphas
+
+ idiff(isca(irho(iphas))) = 1
+
+! --> Implicitation du terme de convection de l'equation de masse
+! (oui = 1 , non = 0)
+! On choisit 0 ; c'est la seule option qui a ete testee. Elle
+! facilite le codage pour le respect du flux de masse au bord.
+
+ iconv(isca(irho(iphas))) = 0
+
+! --> Prise en compte de la pression predite pour resoudre Navier-Stokes
+! (oui = 1 , non = 0)
+
+ igrdpp(iphas) = 0
+
+! --> Prediction de pression par une equation d'evolution
+
+! ATTENTION PAS ENCORE IMPLEMENTE
+!======== LAISSER IPPRED(IPHAS) = 0
+
+ ippred(iphas) = 0
+
+
+enddo
+
+!===============================================================================
+! 6. VERIFICATIONS
+!===============================================================================
+
+iok = 0
+do iphas = 1, nphas
+ if(icfgrp(iphas).ne.0.and.icfgrp(iphas).ne.1) then
+ WRITE(NFECRA,5000)IPHAS,'ICFGRP',ICFGRP(IPHAS)
+ iok = 1
+ endif
+enddo
+
+if (iok.ne.0) then
+ call csexit (1)
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMPRESSIBLE) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMPRESSIBLE) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMPRESSIBLE) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les bornes des variables rho, energie ou temperature ',/,&
+'@ ont ete modifiees dans usini1 : ',/,&
+'@ ',/,&
+'@ SCAMIN SCAMAX ',/,&
+'@ rho ',2E14.5 ,/,&
+'@ energie ',2E14.5 ,/,&
+'@ temperature ',2E14.5 ,/,&
+'@ ',/,&
+'@ Les bornes de ces variables ne doivent pas etre modifiees ',/,&
+'@ dans usini1. On peut modifier les bornes des variables ',/,&
+'@ rho et energie dans uscfx1, mais ce n''est pas conseille. ',/,&
+'@ Il est preferable de gerer les depassements �ventuels ',/,&
+'@ au moyen du sous programme uscfth (arret du calcul en fin ',/,&
+'@ de pas de temps en cas de depassement). ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMPRESSIBLE) DEMANDEE ',/,&
+'@ ',/,&
+'@ L''option IPUCOU = ',I10 ,/,&
+'@ n''est pas compatible avec le module compressible ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Imposer IPUCOU = 0 dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMPRESSIBLE) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les estimateurs ne sont pas compatibles avec le module ',/,&
+'@ compressible ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Imposer IESCAL(.,.) = 0 dans usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 5000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMPRESSIBLE) DEMANDEE ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier uscfx1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/cfbl/cfiniv.f90 b/src/cfbl/cfiniv.f90
new file mode 100644
index 0000000..c532236
--- /dev/null
+++ b/src/cfbl/cfiniv.f90
@@ -0,0 +1,411 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfiniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMPRESSIBLE SANS CHOC
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifinia, ifinra
+integer iwcel1, iwcel2, iwcel3, iwcel4
+integer iel , iphas , iccfth, imodif
+integer iirom , iiromb, ifac
+
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Reservation de la memoire pour appel � uscfth
+
+call memcfv &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwcel1 , iwcel2 , iwcel3 , iwcel4 , &
+ ifinia , ifinra )
+
+idebia = ifinia
+idebra = ifinra
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+ if ( ipass.eq.1 ) then
+
+! ----- Initialisations par defaut
+
+ do iphas = 1, nphas
+
+! ON MET LA TEMPERATURE A T0
+ do iel = 1, ncel
+ rtp(iel,isca(itempk((iphas)))) = t0(iphas)
+ enddo
+
+! On initialise Cv, rho et l'energie
+ iccfth = 0
+ imodif = 1
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iwcel1), ra(iwcel2), ra(iwcel3), ra(iwcel4), &
+ rdevel , rtuser , ra )
+
+! On initialise la diffusivite thermique
+ visls0(ienerg(iphas)) = visls0(itempk(iphas))/cv0(iphas)
+
+ if(ivisls(ienerg(iphas)).gt.0) then
+ if(ivisls(itempk(iphas)).gt.0) then
+ if(icv(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) = &
+ propce(iel,ipproc(ivisls(itempk(iphas)))) &
+ / propce(iel,ipproc(icv(iphas)))
+ enddo
+ else
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) = &
+ propce(iel,ipproc(ivisls(itempk(iphas)))) / cv0(iphas)
+ enddo
+ endif
+ else
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) = &
+ visls0(itempk(iphas)) / propce(iel,ipproc(icv(iphas)))
+ enddo
+ endif
+ endif
+
+ enddo
+
+! ----- On donne la main a l'utilisateur
+
+ call uscfxi &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ ra(iwcel1), ra(iwcel2), ra(iwcel3), ra(iwcel4), &
+ rdevel , rtuser , ra )
+
+! ----- Initialisation des proprietes physiques ROM et ROMB
+
+ do iphas = 1, nphas
+
+ iirom = ipproc(irom (iphas))
+ iiromb = ipprob(irom (iphas))
+
+ do iel = 1, ncel
+ propce(iel,iirom) = rtp(iel,isca(irho(iphas)))
+ enddo
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,iiromb) = &
+ coefa(ifac,iclrtp(isca(irho(iphas)),icoef)) &
+ + coefb(ifac,iclrtp(isca(irho(iphas)),icoef)) &
+ * rtp(iel,isca(irho(iphas)))
+ enddo
+
+ enddo
+
+! ----- Initialisation de la viscosite en volume
+
+ do iphas = 1, nphas
+
+ if(iviscv(iphas).gt.0) then
+ do iel = 1, ncel
+ propce(iel,ipproc(iviscv(iphas))) = viscv0(iphas)
+ enddo
+ endif
+
+ enddo
+
+ endif
+
+else
+
+ if ( ipass.eq.1 ) then
+
+! ----- Initialisations par defaut
+
+ do iphas = 1, nphas
+
+! On initialise Cv
+
+ iccfth = 0
+ imodif = 1
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(iwcel1), ra(iwcel2), ra(iwcel3), ra(iwcel4), &
+ rdevel , rtuser , ra )
+
+ enddo
+
+ endif
+
+endif
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cfbl/cfmsfl.f90 b/src/cfbl/cfmsfl.f90
new file mode 100644
index 0000000..842d954
--- /dev/null
+++ b/src/cfbl/cfmsfl.f90
@@ -0,0 +1,839 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfmsfl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ flumas , flumab , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , w11 , w12 , &
+ trflms , trflmb , coefu , xam , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DU "FLUX DE MASSE" AUX FACES
+! POUR LE CALCUL DE LA CONTRAINTE LIEE AU CFL
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! itspdv ! e ! <-- ! calcul termes sources prod et dissip !
+! ! ! ! (0 : non , 1 : oui) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! flumas(nfac) ! tr ! --> ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! --> ! flux de masse aux faces de bord !
+! w1..12(ncelet ! tr ! --- ! tableau de travail !
+! trflms(nfac) ! tr ! --- ! tableau de travail !
+! trflmb(nfabor ! tr ! --- ! tableau de travail !
+! coefu(nfabo,3 ! tr ! --- ! tableau de travail cl de la qdm !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision flumas(nfac), flumab(nfabor)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision w4(ncelet) , w5(ncelet) , w6(ncelet)
+double precision w7(ncelet) , w8(ncelet) , w9(ncelet)
+double precision w10(ncelet), w11(ncelet), w12(ncelet)
+double precision trflms(nfac), trflmb(nfabor)
+double precision coefu(nfabor,3), xam(nfac,2)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer ivar , iphas
+integer ifac , iel
+integer init , inc , iccocg, ii, jj
+integer ipp
+integer nswrgp, imligp, iwarnp
+integer iconvp, idiffp
+integer ircflp, ischcp, isstpp
+
+integer iirom , iiromb
+integer ivar0 , imvis1, iccfth, imodif, isou
+integer imaspe, iflmb0, iismph
+integer icliup, iclivp, icliwp, iclvar
+integer idimte, itenso
+integer iuiph , iviph , iwiph
+integer itsqdm, iiun , iextts
+integer maxelt, ils
+
+double precision epsrgp, climgp, extrap, blencp
+double precision flui , fluj , pfac , thetv
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero de phase associee au scalaire traite
+iphas = iphsca(iscal)
+
+! --- Numero des variables de calcul
+! Masse volumique
+ivar = isca(iscal)
+! Vitesses
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+! Masse volumique dans PROPCE
+iirom = ipproc(irom (iphas))
+iiromb = ipprob(irom (iphas))
+
+! ---> Initialisation du flux de masse
+
+do ifac = 1, nfac
+ flumas(ifac) = 0.d0
+enddo
+do ifac = 1, nfabor
+ flumab(ifac) = 0.d0
+enddo
+
+!===============================================================================
+! 2. FLUX DE MASSE AUX FACES
+!===============================================================================
+
+! 2.1 TERMES SOURCES DE L'EQUATION DE QDM
+! =======================================
+
+! FX -> W5 , FY -> W6 , FZ -> W7
+
+! Apres premiers tests, il semble (tube � choc en double d�tente)
+! que ce ne soit pas une bonne id�e de prendre en compte dans
+! l'�quation de la masse tous les termes de l'�quation de la
+! quantit� de mouvement (en particulier le terme convectif, mais
+! les termes de diffusion, en gradient transpos�, source de masse
+! et utilisateur n'ont pas �t� vraiment test�s, dans la mesure ou
+! ils �taient nuls pour tous les cas unitaires consid�r�s).
+! Bien entendu, s'agissant de tests pr�liminaires, il est possible
+! que le comportement insatisfaisant observ� soit le fruit d'une
+! simple erreur de codage (mais on ne l'a pas trouv�e...).
+! On propose donc par s�curit� de ne pas prendre en compte les termes
+! source de l'�quation de la quantit� de mouvement, hormis le terme
+! de gravit� (car il contrebalance le gradient de pression et son
+! effet est bien visible lorsqu'on est dans une situation
+! d'�quilibre).
+! Cependant, on conserve ici le codage
+! pr�liminaire qui a permis d'effectuer les tests (version 1.1.0.h).
+! On l'encapsule dans un test qui le d�sactive obligatoirement
+! (ainsi, pas de question utilisateur intempestive, et toujours
+! la possibilit� de poursuivre les tests si on a le temps ou
+! si on rencontre des pbs...).
+! Noter que, avec ces termes, le syst�me devient difficile � analyser
+! sur le papier (alors que sans ces termes, on est dans la
+! configuration Euler + gravit�).
+
+! --- Initialisation
+do iel = 1, ncel
+ w10(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ w11(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ w12(iel) = 0.d0
+enddo
+
+
+! Test sur les termes source de qdm
+itsqdm = 0
+if(itsqdm.ne.0) then
+
+
+! --- Terme source utilisateur
+
+ maxelt = max(ncelet, nfac, nfabor)
+ ils = idebia
+ ifinia = ils + maxelt
+ CALL IASIZE('CFMSFL',IFINIA)
+
+! Suivant X
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w10 , w9 , &
+! ------ ------
+ w8 , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Suivant Y
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w11 , w9 , &
+! ------ ------
+ w8 , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Suivant Z
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w12 , w9 , &
+! ------ ------
+ w8 , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! --- Terme de convection de quantite de mouvement
+ if(iconv(iuiph).ge.1) then
+
+ icliup = iclrtp(iuiph ,icoef)
+ iclivp = iclrtp(iviph ,icoef)
+ icliwp = iclrtp(iwiph ,icoef)
+
+ init = 1
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ iismph = iisymp+nfabor*(iphas-1)
+ nswrgp = nswrgr(iuiph)
+ imligp = imligr(iuiph)
+ iwarnp = iwarni(iuiph)
+ epsrgp = epsrgr(iuiph)
+ climgp = climgr(iuiph)
+ extrap = extrag(iuiph)
+
+ imaspe = 1
+
+! Calcul du flux de masse
+ call inimas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,iirom) , propfb(1,iiromb), &
+ rtpa (1,iuiph) , rtpa (1,iviph) , rtpa (1,iwiph) , &
+ coefa(1,icliup) , coefa(1,iclivp) , coefa(1,icliwp) , &
+ coefb(1,icliup) , coefb(1,iclivp) , coefb(1,icliwp) , &
+ flumas , flumab , &
+! ------ ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+! Calcul du terme convecte suivant les 3 directions
+! sans reconstruction
+ do isou = 1, 3
+ if(isou.eq.1) ivar0 = iuiph
+ if(isou.eq.1) iclvar = icliup
+ if(isou.eq.2) ivar0 = iviph
+ if(isou.eq.2) iclvar = iclivp
+ if(isou.eq.3) ivar0 = iwiph
+ if(isou.eq.3) iclvar = icliwp
+
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ trflms(ifac) = -(flui*rtpa(ii,ivar0)+fluj*rtpa(jj,ivar0))
+ enddo
+
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+ pfac = coefa(ifac,iclvar) &
+ + coefb(ifac,iclvar)*rtpa(ii,ivar0)
+ trflmb(ifac) = - ( flui*rtpa(ii,ivar0) + fluj*pfac )
+ enddo
+
+ init = 0
+ if(isou.eq.1) then
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,trflms,trflmb,w10)
+ elseif(isou.eq.2) then
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,trflms,trflmb,w11)
+ elseif(isou.eq.3) then
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,trflms,trflmb,w12)
+ endif
+
+ enddo
+
+ endif
+
+
+! --- Terme de viscosite
+
+ if( idiff(iuiph).ge.1 ) then
+
+ do iel = 1, ncelet
+ w8(iel) = 1.d0
+ w9(iel) = 0.d0
+ enddo
+
+ call cfdivs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w10 , w8 , w9 , w9 , &
+! ------
+ w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ call cfdivs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w11 , w9 , w8 , w9 , &
+! ------
+ w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ call cfdivs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w12 , w9 , w9 , w8 , &
+! ------
+ w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+
+! --- Terme source de masse
+! On met tout en explicite pour l'instant ... a modifier lors des
+! tests sur ce terme (cf. remarque en debut de fichier)
+ iiun = 1
+ iextts = 0
+ thetv = 0.d0
+ do isou = 1, 3
+ if(isou.eq.1) then
+ ivar0 = iuiph
+ call catsma &
+ !==========
+ ( ncelet, ncel , ncesmp , iiun , iextts , thetv , &
+ icetsm, itypsm(1,ivar0) , volume , rtpa(1,ivar0) , &
+ smacel(1,ivar0), smacel(1,ipr(iphas)), &
+ w10 , w1 , w2 )
+ do iel = 1, ncel
+ w10(iel) = w10(iel) + w2(iel)
+ enddo
+
+ elseif(isou.eq.2) then
+ ivar0 = iviph
+ call catsma &
+ !==========
+ ( ncelet, ncel , ncesmp , iiun , iextts , thetv , &
+ icetsm, itypsm(1,ivar0) , volume , rtpa(1,ivar0) , &
+ smacel(1,ivar0), smacel(1,ipr(iphas)), &
+ w11 , w1 , w2 )
+ do iel = 1, ncel
+ w11(iel) = w11(iel) + w2(iel)
+ enddo
+
+ elseif(isou.eq.3) then
+ ivar0 = iwiph
+ call catsma &
+ !==========
+ ( ncelet, ncel , ncesmp , iiun , iextts , thetv , &
+ icetsm, itypsm(1,ivar0) , volume , rtpa(1,ivar0) , &
+ smacel(1,ivar0), smacel(1,ipr(iphas)), &
+ w12 , w1 , w2 )
+ do iel = 1, ncel
+ w12(iel) = w12(iel) + w2(iel)
+ enddo
+
+ endif
+
+ enddo
+
+endif
+! Fin du Test sur les termes source de qdm
+
+
+! --- Terme de forces volumiques (gravite)
+do iel = 1, ncel
+ w5(iel) = gx + w10(iel)/rtpa(iel,ivar)
+ w6(iel) = gy + w11(iel)/rtpa(iel,ivar)
+ w7(iel) = gz + w12(iel)/rtpa(iel,ivar)
+enddo
+
+
+! 2.2 CALCUL DU TERME DE DIFFUSION D'ENTROPIE
+! ===========================================
+
+! --- Calcul de l'entropie au centre des cellules et affectation a W1
+iccfth = 6
+imodif = 0
+call uscfth &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w8 , w9 , w10 , &
+! ------
+ rdevel , rtuser , ra )
+
+! --- Communication de l'entropie
+if(irangp.ge.0) then
+ call parcom (w1)
+ !==========
+endif
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w1 , w1 , w1 , &
+ w1 , w1 , w1 , &
+ w1 , w1 , w1 )
+endif
+
+! --- Calcul de dt*Beta/Rho au centre des cellules et affectation a W2
+iccfth = 162
+imodif = 0
+call uscfth &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w2 , w8 , w9 , w10 , &
+! ------
+ rdevel , rtuser , ra )
+
+! --- Pour la condition au bord sur l'entropie
+! COEFA=COEFA(.,ITEMPK) et COEFB=COEFB(.,ITEMPK)
+
+
+do iel = 1, ncel
+ w2(iel) = dt(iel) * w2(iel) / rtpa(iel,ivar)
+enddo
+
+! --- Calcul de dt*Beta/Rho aux faces et affectation a TRFLMS et TRFLMB
+imvis1 = 1
+
+call viscfa &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvis1 , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w2 , &
+ trflms , trflmb , &
+! ------ ------
+ rdevel , rtuser , ra )
+
+! --- Calcul du flux de diffusion
+
+! Conditions aux limites de flux nul pour l'entropie
+! on utilise COEFU comme tableau de travail)
+do ifac = 1, nfabor
+ coefu(ifac,1) = 0.d0
+ coefu(ifac,2) = 1.d0
+enddo
+
+inc =1
+iccocg = 1
+ivar0 = 0
+iconvp = 0
+idiffp = 1
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+ipp = ipprtp(ivar)
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+
+call cfbsc3 &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , coefu(1,1) , coefu(1,2) , &
+ coefu(1,1) , coefu(1,2) , &
+ trflms , trflmb , trflms , trflmb , &
+ flumas , flumab , &
+! ------ ------
+ w2 , w3 , w4 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+
+! 2.3 CALCUL DU FLUX DE MASSE AUX FACES
+! =====================================
+
+! --- Calcul des "vitesses" de convection au centre des cellules
+
+do iel = 1, ncel
+ w10(iel) = rtpa(iel,iuiph) + dt(iel)*w5(iel)
+ w11(iel) = rtpa(iel,iviph) + dt(iel)*w6(iel)
+ w12(iel) = rtpa(iel,iwiph) + dt(iel)*w7(iel)
+enddo
+
+! --- Calcul du flux par appel a INIMAS
+
+! Pour �viter d'appliquer une condition limite inadapt�e, on impose
+! un simple flux nul. Noter que cela ne sert qu'a reconstruire des
+! gradients. La valeur au bord importe peu, dans la mesure ou le
+! flux de bord est ecras� ensuite.
+
+! Pour �viter d'avoir recours a d'autres tableaux, on simule un flux
+! nul avec :
+! TRFLMB = 1 pour COEFB = 1 et
+! INC = 0 pour COEFA = 0
+
+! On prend ROM = W1 = 1 et ROMB = TRFLMB = 1
+! (et ROMB sert aussi pour COEFB=1)
+do iel = 1, ncel
+ w1(iel) = 1.d0
+enddo
+do ifac = 1, nfabor
+ trflmb(ifac) = 1.d0
+enddo
+
+icliup = iclrtp(iuiph ,icoef)
+iclivp = iclrtp(iviph ,icoef)
+icliwp = iclrtp(iwiph ,icoef)
+
+init = 0
+! ^ Il y a deja le flux de diffusion d'entropie dans FLUMAS
+inc = 0
+! ^ Comme indiqu� ci-dessus, pour un flux nul
+iccocg = 1
+ivar0 = 0
+iflmb0 = 1
+iismph = iisymp+nfabor*(iphas-1)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+iwarnp = iwarni(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+
+imaspe = 1
+
+call inimas &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ivar0 , ivar0 , ivar0 , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , trflmb , &
+ w10 , w11 , w12 , &
+ coefa(1,icliup) , coefa(1,iclivp) , coefa(1,icliwp) , &
+ trflmb , trflmb , trflmb , &
+ flumas , flumab , &
+! ------ ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfmsgs.f90 b/src/cfbl/cfmsgs.f90
new file mode 100644
index 0000000..0b4993b
--- /dev/null
+++ b/src/cfbl/cfmsgs.f90
@@ -0,0 +1,845 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfmsgs &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ flumas , flumab , flabgs , flbbgs , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , w11 , w12 , &
+ trflms , trflmb , coefu , xam , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DU "FLUX DE MASSE" AUX FACES
+! POUR LA RESOLUTION DE LA MASSE VOLUMIQUE
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! itspdv ! e ! <-- ! calcul termes sources prod et dissip !
+! ! ! ! (0 : non , 1 : oui) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! flumas(nfac) ! tr ! --> ! flux de masse aux faces internes !
+! flumab(nfabor ! tr ! --> ! flux de masse aux faces de bord !
+! w1..12(ncelet ! tr ! --- ! tableau de travail !
+! trflms(nfac) ! tr ! --- ! tableau de travail !
+! trflmb(nfabor ! tr ! --- ! tableau de travail !
+! coefu(nfabo,3 ! tr ! --- ! tableau de travail cl de la qdm !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision flumas(nfac), flumab(nfabor)
+double precision flabgs(nfac), flbbgs(nfabor)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision w4(ncelet) , w5(ncelet) , w6(ncelet)
+double precision w7(ncelet) , w8(ncelet) , w9(ncelet)
+double precision w10(ncelet), w11(ncelet), w12(ncelet)
+double precision trflms(nfac), trflmb(nfabor)
+double precision coefu(nfabor,3), xam(nfac,2)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer ivar , iphas
+integer ifac , iel
+integer init , inc , iccocg, ii, jj
+integer ipp
+integer nswrgp, imligp, iwarnp
+integer iconvp, idiffp
+integer ircflp, ischcp, isstpp
+
+integer iirom , iiromb
+integer ivar0 , imvis1, iccfth, imodif, isou
+integer imaspe, iflmb0, iismph
+integer icliup, iclivp, icliwp, iclvar
+integer idimte, itenso
+integer iuiph , iviph , iwiph
+integer itsqdm, iiun , iextts
+integer maxelt, ils
+
+double precision epsrgp, climgp, extrap, blencp
+double precision flui , fluj , pfac , thetv
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero de phase associee au scalaire traite
+iphas = iphsca(iscal)
+
+! --- Numero des variables de calcul
+! Masse volumique
+ivar = isca(iscal)
+! Vitesses
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+! Masse volumique dans PROPCE
+iirom = ipproc(irom (iphas))
+iiromb = ipprob(irom (iphas))
+
+! ---> Initialisation du flux de masse
+
+do ifac = 1, nfac
+ flumas(ifac) = 0.d0
+enddo
+do ifac = 1, nfabor
+ flumab(ifac) = 0.d0
+enddo
+do ifac = 1, nfac
+ flabgs(ifac) = 0.d0
+enddo
+do ifac = 1, nfabor
+ flbbgs(ifac) = 0.d0
+enddo
+
+!===============================================================================
+! 2. FLUX DE MASSE AUX FACES
+!===============================================================================
+
+! 2.1 TERMES SOURCES DE L'EQUATION DE QDM
+! =======================================
+
+! FX -> W5 , FY -> W6 , FZ -> W7
+
+! Apres premiers tests, il semble (tube � choc en double d�tente)
+! que ce ne soit pas une bonne id�e de prendre en compte dans
+! l'�quation de la masse tous les termes de l'�quation de la
+! quantit� de mouvement (en particulier le terme convectif, mais
+! les termes de diffusion, en gradient transpos�, source de masse
+! et utilisateur n'ont pas �t� vraiment test�s, dans la mesure ou
+! ils �taient nuls pour tous les cas unitaires consid�r�s).
+! Bien entendu, s'agissant de tests pr�liminaires, il est possible
+! que le comportement insatisfaisant observ� soit le fruit d'une
+! simple erreur de codage (mais on ne l'a pas trouv�e...).
+! On propose donc par s�curit� de ne pas prendre en compte les termes
+! source de l'�quation de la quantit� de mouvement, hormis le terme
+! de gravit� (car il contrebalance le gradient de pression et son
+! effet est bien visible lorsqu'on est dans une situation
+! d'�quilibre).
+! Cependant, pour l'avenir, on conserve ici le codage
+! pr�liminaire qui a permis d'effectuer les tests (version 1.1.0.h).
+! On l'encapsule dans un test qui le d�sactive obligatoirement
+! (ainsi, pas de question utilisateur intempestive, et toujours
+! la possibilit� de poursuivre les tests si l'on a le temps ou si
+! on rencontre des pbs...).
+! Noter que, avec ces termes, le syst�me devient difficile � analyser
+! sur le papier (alors que sans ces termes, on est dans la
+! configuration Euler + gravit�).
+
+! --- Initialisation
+do iel = 1, ncel
+ w10(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ w11(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ w12(iel) = 0.d0
+enddo
+
+
+! Test sur les termes source de qdm
+itsqdm = 0
+if(itsqdm.ne.0) then
+
+
+! --- Terme source utilisateur
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('CFMSGS',IFINIA)
+
+! Suivant X
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w10 , w9 , &
+! ------ ------
+ w8 , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Suivant Y
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w11 , w9 , &
+! ------ ------
+ w8 , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! Suivant Z
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w12 , w9 , &
+! ------ ------
+ w8 , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! --- Terme de convection de quantite de mouvement
+ if(iconv(iuiph).ge.1) then
+
+ icliup = iclrtp(iuiph ,icoef)
+ iclivp = iclrtp(iviph ,icoef)
+ icliwp = iclrtp(iwiph ,icoef)
+
+ init = 1
+ inc = 1
+ iccocg = 1
+ iflmb0 = 1
+ iismph = iisymp+nfabor*(iphas-1)
+ nswrgp = nswrgr(iuiph)
+ imligp = imligr(iuiph)
+ iwarnp = iwarni(iuiph)
+ epsrgp = epsrgr(iuiph)
+ climgp = climgr(iuiph)
+ extrap = extrag(iuiph)
+
+ imaspe = 1
+
+! Calcul du flux de masse
+ call inimas &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iuiph , iviph , iwiph , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ propce(1,iirom) , propfb(1,iiromb), &
+ rtpa (1,iuiph) , rtpa (1,iviph) , rtpa (1,iwiph) , &
+ coefa(1,icliup) , coefa(1,iclivp) , coefa(1,icliwp) , &
+ coefb(1,icliup) , coefb(1,iclivp) , coefb(1,icliwp) , &
+ flumas , flumab , &
+! ------ ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+! Calcul du terme convecte suivant les 3 directions
+! sans reconstruction
+ do isou = 1, 3
+ if(isou.eq.1) ivar0 = iuiph
+ if(isou.eq.1) iclvar = icliup
+ if(isou.eq.2) ivar0 = iviph
+ if(isou.eq.2) iclvar = iclivp
+ if(isou.eq.3) ivar0 = iwiph
+ if(isou.eq.3) iclvar = icliwp
+
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ flui = 0.5d0*( flumas(ifac) +abs(flumas(ifac)) )
+ fluj = 0.5d0*( flumas(ifac) -abs(flumas(ifac)) )
+ trflms(ifac) = -(flui*rtpa(ii,ivar0)+fluj*rtpa(jj,ivar0))
+ enddo
+
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ flui = 0.5d0*( flumab(ifac) +abs(flumab(ifac)) )
+ fluj = 0.5d0*( flumab(ifac) -abs(flumab(ifac)) )
+ pfac = coefa(ifac,iclvar) &
+ + coefb(ifac,iclvar)*rtpa(ii,ivar0)
+ trflmb(ifac) = - ( flui*rtpa(ii,ivar0) + fluj*pfac )
+ enddo
+
+ init = 0
+ if(isou.eq.1) then
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,trflms,trflmb,w10)
+ elseif(isou.eq.2) then
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,trflms,trflmb,w11)
+ elseif(isou.eq.3) then
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,trflms,trflmb,w12)
+ endif
+
+ enddo
+
+ endif
+
+
+! --- Terme de viscosite
+
+ if( idiff(iuiph).ge.1 ) then
+
+ do iel = 1, ncelet
+ w8(iel) = 1.d0
+ w9(iel) = 0.d0
+ enddo
+
+ call cfdivs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w10 , w8 , w9 , w9 , &
+! ------
+ w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ call cfdivs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w11 , w9 , w8 , w9 , &
+! ------
+ w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ call cfdivs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w12 , w9 , w9 , w8 , &
+! ------
+ w7 , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+
+! --- Terme source de masse
+! On met tout en explicite pour l'instant ... a modifier lors des
+! tests sur ce terme (cf. remarque en debut de fichier)
+ iiun = 1
+ iextts = 0
+ thetv = 0.d0
+ do isou = 1, 3
+ if(isou.eq.1) then
+ ivar0 = iuiph
+ call catsma &
+ !==========
+ ( ncelet, ncel , ncesmp , iiun , iextts , thetv , &
+ icetsm, itypsm(1,ivar0) , volume , rtpa(1,ivar0) , &
+ smacel(1,ivar0), smacel(1,ipr(iphas)), &
+ w10 , w1 , w2 )
+ do iel = 1, ncel
+ w10(iel) = w10(iel) + w2(iel)
+ enddo
+
+ elseif(isou.eq.2) then
+ ivar0 = iviph
+ call catsma &
+ !==========
+ ( ncelet, ncel , ncesmp , iiun , iextts , thetv , &
+ icetsm, itypsm(1,ivar0) , volume , rtpa(1,ivar0) , &
+ smacel(1,ivar0), smacel(1,ipr(iphas)), &
+ w11 , w1 , w2 )
+ do iel = 1, ncel
+ w11(iel) = w11(iel) + w2(iel)
+ enddo
+
+ elseif(isou.eq.3) then
+ ivar0 = iwiph
+ call catsma &
+ !==========
+ ( ncelet, ncel , ncesmp , iiun , iextts , thetv , &
+ icetsm, itypsm(1,ivar0) , volume , rtpa(1,ivar0) , &
+ smacel(1,ivar0), smacel(1,ipr(iphas)), &
+ w12 , w1 , w2 )
+ do iel = 1, ncel
+ w12(iel) = w12(iel) + w2(iel)
+ enddo
+
+ endif
+
+ enddo
+
+endif
+! Fin du Test sur les termes source de qdm
+
+
+! --- Terme de forces volumiques (gravite)
+do iel = 1, ncel
+ w5(iel) = gx + w10(iel)/rtpa(iel,ivar)
+ w6(iel) = gy + w11(iel)/rtpa(iel,ivar)
+ w7(iel) = gz + w12(iel)/rtpa(iel,ivar)
+enddo
+
+
+! 2.2 CALCUL DU TERME DE DIFFUSION D'ENTROPIE
+! ===========================================
+
+! --- Calcul de l'entropie au centre des cellules et affectation a W1
+iccfth = 6
+imodif = 0
+call uscfth &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w8 , w9 , w10 , &
+! ------
+ rdevel , rtuser , ra )
+
+! --- Communication de l'entropie
+if(irangp.ge.0) then
+ call parcom (w1)
+ !==========
+endif
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w1 , w1 , w1 , &
+ w1 , w1 , w1 , &
+ w1 , w1 , w1 )
+endif
+
+! --- Calcul de dt*Beta/Rho au centre des cellules et affectation a W2
+iccfth = 162
+imodif = 0
+call uscfth &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w2 , w8 , w9 , w10 , &
+! ------
+ rdevel , rtuser , ra )
+
+! --- Pour la condition au bord sur l'entropie
+! COEFA=COEFA(.,ITEMPK) et COEFB=COEFB(.,ITEMPK)
+
+
+do iel = 1, ncel
+ w2(iel) = dt(iel) * w2(iel)
+enddo
+
+! --- Calcul de dt*Beta aux faces et affectation a TRFLMS et TRFLMB
+imvis1 = 1
+
+call viscfa &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvis1 , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w2 , &
+ trflms , trflmb , &
+! ------ ------
+ rdevel , rtuser , ra )
+
+! --- Calcul du flux de diffusion
+
+! Conditions aux limites de flux nul pour l'entropie
+! on utilise COEFU comme tableau de travail)
+do ifac = 1, nfabor
+ coefu(ifac,1) = 0.d0
+ coefu(ifac,2) = 1.d0
+enddo
+
+inc =1
+iccocg = 1
+ivar0 = 0
+iconvp = 0
+idiffp = 1
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+ipp = ipprtp(ivar)
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+
+call cfbsc3 &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , coefu(1,1) , coefu(1,2) , &
+ coefu(1,1) , coefu(1,2) , &
+ trflms , trflmb , trflms , trflmb , &
+ flabgs , flbbgs , &
+! ------ ------
+ w2 , w3 , w4 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+
+! 2.3 CALCUL DU FLUX DE MASSE AUX FACES
+! =====================================
+
+! --- Calcul des "vitesses" de convection au centre des cellules
+
+do iel = 1, ncel
+ w10(iel) = rtpa(iel,iuiph) + dt(iel)*w5(iel)
+ w11(iel) = rtpa(iel,iviph) + dt(iel)*w6(iel)
+ w12(iel) = rtpa(iel,iwiph) + dt(iel)*w7(iel)
+enddo
+
+! --- Calcul du flux par appel a INIMAS
+
+! Pour �viter d'appliquer une condition limite inadapt�e, on impose
+! un simple flux nul. Noter que cela ne sert qu'a reconstruire des
+! gradients. La valeur au bord importe peu, dans la mesure ou le
+! flux de bord est ecras� ensuite.
+
+! Pour �viter d'avoir recours a d'autres tableaux, on simule un flux
+! nul avec :
+! TRFLMB = 1 pour COEFB = 1 et
+! INC = 0 pour COEFA = 0
+
+! On prend ROM = W1 = 1 et ROMB = TRFLMB = 1
+! (et ROMB sert aussi pour COEFB=1)
+do iel = 1, ncel
+ w1(iel) = 1.d0
+enddo
+do ifac = 1, nfabor
+ trflmb(ifac) = 1.d0
+enddo
+
+icliup = iclrtp(iuiph ,icoef)
+iclivp = iclrtp(iviph ,icoef)
+icliwp = iclrtp(iwiph ,icoef)
+
+init = 1
+inc = 0
+! ^ Comme indiqu� ci-dessus, pour un flux nul
+iccocg = 1
+ivar0 = 0
+iflmb0 = 1
+iismph = iisymp+nfabor*(iphas-1)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+iwarnp = iwarni(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+
+imaspe = 1
+
+call inimas &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ivar0 , ivar0 , ivar0 , imaspe , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iflmb0 , init , inc , imrgra , iccocg , nswrgp , imligp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ia(iismph) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , trflmb , &
+ w10 , w11 , w12 , &
+ coefa(1,icliup) , coefa(1,iclivp) , coefa(1,icliwp) , &
+ trflmb , trflmb , trflmb , &
+ flumas , flumab , &
+! ------ ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfmsvl.f90 b/src/cfbl/cfmsvl.f90
new file mode 100644
index 0000000..6372b3f
--- /dev/null
+++ b/src/cfbl/cfmsvl.f90
@@ -0,0 +1,805 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfmsvl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , w11 , w12 , &
+ wflmas , wflmab , &
+ coefu , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS CONVECTION DIFFUSION TERME SOURCE
+! POUR LA MASSE VOLUMIQUE SUR UN PAS DE TEMPS
+! (ALGORITHME COMPRESSIBLE EN RHO, U, E)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! itspdv ! e ! <-- ! calcul termes sources prod et dissip !
+! ! ! ! (0 : non , 1 : oui) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1..12(ncelet ! tr ! --- ! tableau de travail !
+! wflmas(nfac) ! tr ! --- ! tableau de w flux de masse aux faces !
+! wflmab(nfabor ! tr ! --- ! tableau de w flux de masse aux bords !
+! coefu(nfabo,3 ! tr ! --- ! tableau de travail cl de la qdm !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision w4(ncelet) , w5(ncelet) , w6(ncelet)
+double precision w7(ncelet) , w8(ncelet) , w9(ncelet)
+double precision w10(ncelet), w11(ncelet), w12(ncelet)
+double precision wflmas(nfac), wflmab(nfabor)
+double precision coefu(nfabor,3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , iphas
+integer ifac , iel
+integer init , inc , iccocg, isqrt , ii, jj, iii
+integer iclvar, iclvaf
+integer iflmas, iflmab
+integer ippvar, ipp , iphydp
+integer nswrgp, imligp, iwarnp
+integer istatp, iconvp, idiffp, ireslp, ndircp, nitmap
+integer nswrsp, ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+double precision epsrgp, climgp, extrap, blencp, epsilp
+double precision epsrsp
+double precision sclnor
+
+integer iccfth, imodif
+integer idimte, itenso
+integer iij
+integer iwfabg, iwfbbg
+double precision dijpfx, dijpfy, dijpfz, pond
+double precision diipfx, diipfy, diipfz, djjpfx, djjpfy, djjpfz
+double precision diipbx, diipby, diipbz
+double precision pip , pjp , thetv, relaxp
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iwfabg = idebra
+iwfbbg = iwfabg+nfac
+idebra = iwfbbg+nfabor
+CALL RASIZE('CFMSVL',IDEBRA)
+
+! --- Numero de phase associee au scalaire traite
+iphas = iphsca(iscal)
+
+! --- Numero de variable de calcul et de post associe au scalaire traite
+ivar = isca(iscal)
+ippvar = ipprtp(ivar)
+
+! --- Numero des conditions aux limites
+iclvar = iclrtp(ivar,icoef)
+iclvaf = iclrtp(ivar,icoeff)
+
+! --- Flux de masse associe a l'energie
+iflmas = ipprof(ifluma(isca(ienerg(iphas))))
+iflmab = ipprob(ifluma(isca(ienerg(iphas))))
+
+chaine = nomvar(ippvar)
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+endif
+
+!===============================================================================
+! 2. TERMES SOURCES
+!===============================================================================
+
+! --> Initialisation
+
+do iel = 1, ncel
+ smbrs(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+
+
+! TERME SOURCE DE MASSE
+! =====================
+
+if (ncesmp.gt.0) then
+ do ii = 1, ncesmp
+ iel = icetsm(ii)
+ smbrs(iel) = smbrs(iel) + smacel(iel,ipr(iphas))*volume(iel)
+ enddo
+endif
+
+
+! TERME INSTATIONNAIRE
+! ====================
+
+do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) + istat(ivar)*(volume(iel)/dt(iel))
+enddo
+
+!===============================================================================
+! 3. CALCUL DU "FLUX DE MASSE" ET DE LA "VISCOSITE" AUX FACES
+!===============================================================================
+
+! Ici VISCF et VISCB sont deux tableaux de travail.
+! On calcule WFLMAS et WFLMAB, WFABGS , WFBBGS
+
+call cfmsgs &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ wflmas , wflmab , ra(iwfabg) , ra(iwfbbg) , &
+! ------ ------ ------ ------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , w11 , w12 , &
+ viscf , viscb , coefu , xam , &
+ rdevel , rtuser , &
+ ra )
+
+
+! Calcul du gradient de rho pour la reconstruction de rho
+! (contribution du terme convectif)
+
+ircflp = ircflu(ivar)
+
+if(ircflp.gt.0) then
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iphydp = 0
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtpa(1,ivar) , &
+ coefa(1,iclrtp(ivar,icoef)) , coefb(1,iclrtp(ivar,icoef)) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ else
+ do ii = 1, ncelet
+ w1(ii) = 0.d0
+ w2(ii) = 0.d0
+ w3(ii) = 0.d0
+ enddo
+ endif
+
+
+! Au bord, on �crase WFLMAB pour imposer le d�bit souhait�.
+! Si on explicite le terme de convection (choix retenu par d�faut,
+! seul test�), pas de probl�me.
+! Si on implicite le terme de convection, on n'impose pas
+! n�cessairement le bon d�bit (cela d�pend du traitement de
+! la convection au bord dans bilsc2 et de la condition � la
+! limite sur rho : ainsi, si l'on se place sur une sortie pour
+! laquelle la condition n'est pas valeur bord = valeur interne,
+! la convection �tant trait�e en upwind, c'est la valeur interne
+! de rho qui intervient dans le flux de bord et non pas
+! la valeur de bord comme suppos� ci-dessous.
+
+if(iconv(ivar).le.0) then
+
+ if(ircflp.gt.0) then
+
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ iij = idijpf-1+3*(ifac-1)
+ dijpfx = ra(iij+1)
+ dijpfy = ra(iij+2)
+ dijpfz = ra(iij+3)
+
+ pond = ra(ipond-1+ifac)
+
+ diipfx = cdgfac(1,ifac) - (xyzcen(1,ii)+ &
+ (1.d0-pond) * dijpfx)
+ diipfy = cdgfac(2,ifac) - (xyzcen(2,ii)+ &
+ (1.d0-pond) * dijpfy)
+ diipfz = cdgfac(3,ifac) - (xyzcen(3,ii)+ &
+ (1.d0-pond) * dijpfz)
+ djjpfx = cdgfac(1,ifac) - xyzcen(1,jj)+ &
+ pond * dijpfx
+ djjpfy = cdgfac(2,ifac) - xyzcen(2,jj)+ &
+ pond * dijpfy
+ djjpfz = cdgfac(3,ifac) - xyzcen(3,jj)+ &
+ pond * dijpfz
+
+ pip = rtpa(ii,ivar) &
+ + ircflp*(w1(ii)*diipfx+w2(ii)*diipfy+w3(ii)*diipfz)
+ pjp = rtpa(jj,ivar) &
+ + ircflp*(w1(jj)*djjpfx+w2(jj)*djjpfy+w3(jj)*djjpfz)
+
+ wflmas(ifac) = -0.5d0* &
+ ( pip *(wflmas(ifac)+abs(wflmas(ifac))) &
+ + pjp *(wflmas(ifac)-abs(wflmas(ifac))))
+ enddo
+
+ else
+ do ifac = 1, nfac
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+ wflmas(ifac) = -0.5d0* &
+ ( rtpa(ii,ivar)*(wflmas(ifac)+abs(wflmas(ifac))) &
+ + rtpa(jj,ivar)*(wflmas(ifac)-abs(wflmas(ifac))))
+ enddo
+ endif
+
+ do ifac = 1, nfabor
+ wflmab(ifac) = -propfb(ifac,iflmab)
+ enddo
+
+ init = 0
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,wflmas,wflmab,smbrs)
+
+ do ifac = 1, nfac
+ ra(iwfabg+ifac-1) = - ra(iwfabg+ifac-1)
+ enddo
+ do ifac = 1, nfabor
+ ra(iwfbbg+ifac-1) = - ra(iwfbbg+ifac-1)
+ enddo
+ init = 0
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,ra(iwfabg),ra(iwfbbg),smbrs)
+
+else
+
+ if(ircflp.gt.0) then
+
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ pip = rtpa(ii,ivar) &
+ +ircflp*(w1(ii)*diipbx+w2(ii)*diipby+w3(ii)*diipbz)
+
+ wflmab(ifac) = -propfb(ifac,iflmab)/ &
+ ( coefa(ifac,iclrtp(ivar,icoef)) &
+ + coefb(ifac,iclrtp(ivar,icoef))*pip )
+ enddo
+
+ else
+ do ifac = 1, nfabor
+ ii = ifabor(ifac)
+ wflmab(ifac) = -propfb(ifac,iflmab)/ &
+ ( coefa(ifac,iclrtp(ivar,icoef)) &
+ + coefb(ifac,iclrtp(ivar,icoef))*rtpa(ii,ivar) )
+ enddo
+ endif
+
+endif
+
+
+! On calcule VISCF et VISCB
+
+call cfmsvs &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ viscf , viscb , &
+! ------ ------
+ w1 , w9 , w10 , &
+ rdevel , rtuser , &
+ ra )
+
+
+! On annule la viscosit� au bord afin que la contribution
+! au flux de bord soit exactement WFLMAB (dans lequel on a mis
+! le flux de masse souhait�). Si on n'annule pas, on risque
+! d'obtenir des contributions non nulles de la partie diffusive,
+! sauf si on a impos� une condition de Neumann homogene sur rho.
+! Pour le moment, on prefere prendre des precautions (la
+! modification de VISCB se traduit simplement par la modification
+! de la matrice portant sur les incr�ments, ou encore par une
+! une condition de Neumann homog�ne sur les incr�ments).
+
+do ifac = 1, nfabor
+ viscb (ifac) = 0.d0
+enddo
+
+!===============================================================================
+! 4. RESOLUTION
+!===============================================================================
+
+istatp = istat (ivar)
+iconvp = iconv (ivar)
+idiffp = idiff (ivar)
+ireslp = iresol(ivar)
+ndircp = ndircl(ivar)
+nitmap = nitmax(ivar)
+nswrsp = nswrsm(ivar)
+nswrgp = nswrgr(ivar)
+imligp = imligr(ivar)
+ircflp = ircflu(ivar)
+ischcp = ischcv(ivar)
+isstpp = isstpc(ivar)
+iescap = 0
+imgrp = imgr (ivar)
+ncymxp = ncymax(ivar)
+nitmfp = nitmgf(ivar)
+ipp = ippvar
+iwarnp = iwarni(ivar)
+blencp = blencv(ivar)
+epsilp = epsilo(ivar)
+epsrsp = epsrsm(ivar)
+epsrgp = epsrgr(ivar)
+climgp = climgr(ivar)
+extrap = extrag(ivar)
+relaxp = relaxv(ivar)
+thetv = thetav(ivar)
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtvar , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetv , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , rtpa(1,ivar) , &
+ coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ wflmas , wflmab , &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbrs , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 5. IMPRESSIONS ET CLIPPINGS
+!===============================================================================
+
+! --- Clipping aux bornes d�finies par l'utilisateur ou par defaut
+! (par d�faut, pas de borne contraignate)
+
+! Valeur bidon
+iii = 1
+
+call clpsca &
+!==========
+ ( ncelet , ncel , nvar , nscal , iscal , &
+ propce , rtp(1,iii) , rtp )
+
+! --- Traitement utilisateur pour gestion plus fine des bornes
+! et actions correctives �ventuelles.
+ iccfth = -2
+ imodif = 0
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w7 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+
+! --- Bilan explicite (voir codits : on enleve l'increment)
+
+if (iwarni(ivar).ge.2) then
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) &
+ - istat(ivar)*(volume(iel)/dt(iel)) &
+ *(rtp(iel,ivar)-rtpa(iel,ivar)) &
+ * max(0,min(nswrsm(ivar)-2,1))
+ enddo
+ isqrt = 1
+ call prodsc(ncelet,ncel,isqrt,smbrs,smbrs,sclnor)
+ write(nfecra,1200)chaine(1:8) ,sclnor
+endif
+
+!===============================================================================
+! 6. COMMUNICATION DE RHO
+!===============================================================================
+
+if(irangp.ge.0) then
+ call parcom (rtp(1,ivar))
+ !==========
+endif
+
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar), &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar), &
+ rtp(1,ivar) , rtp(1,ivar) , rtp(1,ivar) )
+endif
+
+! On ne remplit pas PROPCE et PROPFB ici, car on veut disposer de
+! rho � l'instant pr�c�dent pour r�soudre en qdm et energie
+! On modifiera PROPCE et PROPFB apr�s resolution de l'energie.
+
+
+!===============================================================================
+! 7. CALCUL DU FLUX DE MASSE ACOUSTIQUE AUX FACES
+!===============================================================================
+
+! Ce flux est stocke en tant que flux de masse associe a l'energie
+inc = 1
+iccocg = 1
+
+call cfbsc3 &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iconvp , idiffp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , inc , imrgra , iccocg , &
+ ipp , iwarnp , &
+ blencp , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ wflmas , wflmab , &
+ viscf , viscb , &
+ propfa(1,iflmas), propfb(1,iflmab), &
+! ---------------- ----------------
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! Si ICONV = 0, le terme convectif n'est pas traite par CFBSC3
+! il faut donc le rajouter a la main
+! Noter egalement que si ICONV = 0, PROPFB contient zero au sortir
+! de cfbsc3 et qu'on lui ajoute donc le flux de masse WFLMAB
+! (coh�rent avec le flux impos� au bord et avec un signe n�gatif,
+! car WFLMAB etait, ci-dessus, utilise au second membre)
+if(iconv(ivar).le.0) then
+ do ifac = 1, nfac
+ propfa(ifac,iflmas) = propfa(ifac,iflmas) - wflmas(ifac) &
+ - ra(iwfabg+ifac-1)
+ enddo
+ do ifac = 1, nfabor
+ propfb(ifac,iflmab) = propfb(ifac,iflmab) - wflmab(ifac) &
+ - ra(iwfbbg+ifac-1)
+ enddo
+endif
+
+
+!===============================================================================
+! 8. ACTUALISATION DE LA PRESSION
+!===============================================================================
+! Pred n+1 n
+! On utilise l'equation d'etat P =P(rho ,e )
+
+! --- Calcul de P au centre des cellules et actualisation de RTP
+if(igrdpp(iphas).gt.0) then
+
+ iccfth = 24
+ imodif = 0
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ rtp(1,ipr(iphas)) , w8 , w9 , w10 , &
+! -----------------
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 9. COMMUNICATION DE LA PRESSION
+!===============================================================================
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,ipr(iphas)))
+ !==========
+ endif
+
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), &
+ rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), &
+ rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)))
+ endif
+
+endif
+
+! Pas de v�rification ni de clipping de la pression, car on
+! considere que la masse volumique et l'�nergie ont �t� v�rifiees,
+! sont correctes et donc que la pression l'est aussi (elle
+! vient d'�tre calcul�e avec un sous-pgm utilisateur).
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(/, &
+' ** RESOLUTION POUR LA VARIABLE ',A8 ,/,&
+' --------------------------- ',/)
+ 1200 format(1X,A8,' : BILAN EXPLICITE = ',E14.5)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cfbl/cfmsvs.f90 b/src/cfbl/cfmsvs.f90
new file mode 100644
index 0000000..3040afb
--- /dev/null
+++ b/src/cfbl/cfmsvs.f90
@@ -0,0 +1,287 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfmsvs &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ viscf , viscb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DE LA "VISCOSITE" AUX FACES (Delta t c2)
+! POUR LA RESOLUTION DE LA MASSE VOLUMIQUE
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! itspdv ! e ! <-- ! calcul termes sources prod et dissip !
+! ! ! ! (0 : non , 1 : oui) !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! viscf(nfac) ! tr ! --> ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --> ! visc*surface/dist aux faces de bord !
+! w1..3(ncelet) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iphas
+integer ifac , iel
+
+integer imvis1, iccfth, imodif
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero de phase associee au scalaire traite
+iphas = iphsca(iscal)
+
+do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+enddo
+do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+enddo
+
+!===============================================================================
+! 2. VISCOSITE AUX FACES
+!===============================================================================
+
+! --- Calcul de c2 et affectation a W1
+iccfth = 126
+imodif = 0
+call uscfth &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , ra(1) , w2 , w3 , &
+! ------
+ rdevel , rtuser , ra )
+
+! --- "Vitesse" de diffusion de RHO = dt*c2
+do iel = 1, ncel
+
+ w1(iel) = dt(iel)*w1(iel)
+
+enddo
+
+! --- Calcul de (c2)ij par une moyenne harmonique
+imvis1 = 1
+
+call viscfa &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvis1 , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+! ------ ------
+ rdevel , rtuser , ra )
+
+
+! Au bord, voir le sous-programme appelant.
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfphyv.f90 b/src/cfbl/cfphyv.f90
new file mode 100644
index 0000000..56a5464
--- /dev/null
+++ b/src/cfbl/cfphyv.f90
@@ -0,0 +1,399 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE : COMPRESSIBLE SANS CHOC
+
+! Calcul des proprietes physiques variables
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...3(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer iphas , iel
+integer ifac
+integer iirom , iiromb
+integer maxelt, ils
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+! 2. ON DONNE LA MAIN A L'UTILISATEUR
+!===============================================================================
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('CFPHYV',IFINIA)
+
+iuscfp = 1
+call uscfpv &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+! Si IUSCFP = 0, l'utilisateur n'a pas inclus le ss pgm uscfpv dans
+! ses sources. C'est une erreur si Cp, Cv ou Lambda est variable.
+! On se contente de faire le test au premier passage.
+if(ipass.eq.0) then
+ ipass = ipass + 1
+ do iphas = 1, nphas
+ if((ivisls(itempk(iphas)).gt.0.or. &
+ icp(iphas).gt.0.or.icv(iphas).gt.0).and.iuscfp.eq.0) then
+ write(nfecra,1000) &
+ ivisls(itempk(iphas)),icp(iphas),icv(iphas)
+ call csexit (1)
+ !==========
+ endif
+ enddo
+endif
+
+!===============================================================================
+! 3. MISE A JOUR DE LAMBDA/CV
+!===============================================================================
+
+! On a v�rifi� auparavant que CV0 �tait non nul.
+! Si CV variable est nul, c'est une erreur utilisateur. On fait
+! un test � tous les passages (pas optimal), sachant que pour
+! le moment, on est en gaz parfait avec CV constant : si quelqu'un
+! essaye du CV variable, ce serait dommage que cela lui explose � la
+! figure pour de mauvaises raisons.
+! Si IVISLS(IENERG(IPHAS)).EQ.0, on a forcement IVISLS(ITEMPK(IPHAS)).EQ.0
+! et ICV(IPHAS).EQ.0, par construction de IVISLS(IENERG(IPHAS)) dans
+! le sous-programme cfvarp
+
+do iphas = 1, nphas
+
+ if(ivisls(ienerg(iphas)).gt.0) then
+
+ if(ivisls(itempk(iphas)).gt.0) then
+
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) = &
+ propce(iel,ipproc(ivisls(itempk(iphas))))
+ enddo
+
+ else
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) = &
+ visls0(itempk(iphas))
+ enddo
+
+ endif
+
+ if(icv(iphas).gt.0) then
+
+ do iel = 1, ncel
+ if(propce(iel,ipproc(icv(iphas))).le.0.d0) then
+ write(nfecra,2000)iel,propce(iel,ipproc(icv(iphas)))
+ call csexit (1)
+ !==========
+ endif
+ enddo
+
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) = &
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) &
+ / propce(iel,ipproc(icv(iphas)))
+ enddo
+
+ else
+
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) = &
+ propce(iel,ipproc(ivisls(ienerg(iphas)))) &
+ / cv0(iphas)
+ enddo
+
+ endif
+
+ else
+
+ visls0(ienerg(iphas)) = visls0(itempk(iphas))/cv0(iphas)
+
+ endif
+
+
+enddo
+
+
+!===============================================================================
+! 3. MISE A JOUR DE ROM et ROMB :
+! On ne s'en sert a priori pas, mais la variable existe
+! On a ici des valeurs issues du pas de temps pr�c�dent (y compris
+! pour les conditions aux limites) ou issues de valeurs initiales
+! L'�change p�rio/parall sera fait dans phyvar.
+!===============================================================================
+
+do iphas = 1, nphas
+
+ iirom = ipproc(irom (iphas))
+ iiromb = ipprob(irom (iphas))
+
+ do iel = 1, ncel
+ propce(iel,iirom) = rtpa(iel,isca(irho(iphas)))
+ enddo
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,iiromb) = &
+ coefa(ifac,iclrtp(isca(irho(iphas)),icoef)) &
+ + coefb(ifac,iclrtp(isca(irho(iphas)),icoef)) &
+ * rtpa(iel,isca(irho(iphas)))
+ enddo
+
+enddo
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION (MODULE COMPRESSIBLE) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Une ou plusieurs des propri�t�s suivantes a �t� d�clar�e ',/,&
+'@ variable (rep�r�e ci-dessous par un indicateur non nul) ',/,&
+'@ et une loi doit �tre fournie dans uscfpv. ',/,&
+'@ propri�t� indicateur ',/,&
+'@ - conductivit� thermique ',I10 ,/,&
+'@ - capacit� calorifique � pression constante ',I10 ,/,&
+'@ - capacit� calorifique � volume constant ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Renseigner uscfpv ou d�clarer les propri�t�s constantes et',/,&
+'@ uniformes (uscfx2 pour la conductivit� thermique, ',/,&
+'@ uscfth pour les capacit�s calorifiques). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION (MODULE COMPRESSIBLE) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ La capacit� calorifique � volume constant pr�sente (au ',/,&
+'@ moins) une valeur n�gative ou nulle : ',/,&
+'@ cellule ',I10, ' Cv = ',E18.9 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cfbl/cfprop.f90 b/src/cfbl/cfprop.f90
new file mode 100644
index 0000000..0a2edfc
--- /dev/null
+++ b/src/cfbl/cfprop.f90
@@ -0,0 +1,251 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfprop &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT POUR
+! POUR LE COMPRESSIBLE SANS CHOC
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! <-- ! numero de la derniere propriete !
+! ! ! ! (les proprietes sont dans propce, !
+! ! ! ! propfa ou prpfb) !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp, ipppst
+
+! VARIABLES LOCALES
+
+integer iprop, ipp, iphas
+
+!===============================================================================
+!===============================================================================
+! 1. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFA, PROPFB
+! Physique particuliere : Compressible sans choc
+!===============================================================================
+
+if ( ippmod(icompf).ge.0 ) then
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+
+ iprop = ipropp
+
+! Proprietes des phases : CV s'il est variable
+ do iphas = 1, nphas
+ if(icv(iphas).ne.0) then
+ iprop = iprop + 1
+ icv (iphas) = iprop
+ endif
+ enddo
+
+! Proprietes des phases : Viscosite en volume
+ do iphas = 1, nphas
+ if(iviscv(iphas).ne.0) then
+ iprop = iprop + 1
+ iviscv(iphas) = iprop
+ endif
+ enddo
+
+! Flux de masse specifique pour la vitesse (si on en veut un)
+ do iphas = 1, nphas
+ if(iflmau(iphas).gt.0) then
+ iprop = iprop + 1
+ ifluma(iu (iphas)) = iprop
+ ifluma(iv (iphas)) = iprop
+ ifluma(iw (iphas)) = iprop
+ endif
+ enddo
+
+! Flux de Rusanov au bord pour Qdm et E
+ do iphas = 1, nphas
+ iprop = iprop + 1
+ ifbrhu(iphas) = iprop
+ iprop = iprop + 1
+ ifbrhv(iphas) = iprop
+ iprop = iprop + 1
+ ifbrhw(iphas) = iprop
+ iprop = iprop + 1
+ ifbene(iphas) = iprop
+ enddo
+
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+ nsalpp = iprop - ipropp
+ nsalto = iprop
+
+! ---- On renvoie IPROPP au cas ou d'autres proprietes devraient
+! etre numerotees ensuite
+
+ ipropp = iprop
+
+
+! ---> Positionnement dans le tableau PROPCE
+! et reperage du rang pour le post-traitement
+
+ iprop = nproce
+
+ do iphas = 1, nphas
+
+ if(icv(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(icv (iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+
+ if(iviscv(iphas).gt.0) then
+ iprop = iprop + 1
+ ipproc(iviscv(iphas)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+
+ enddo
+
+ nproce = iprop
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+ iprop = nprofb
+
+ do iphas = 1, nphas
+ iprop = iprop + 1
+ ipprob(ifbrhu(iphas)) = iprop
+ iprop = iprop + 1
+ ipprob(ifbrhv(iphas)) = iprop
+ iprop = iprop + 1
+ ipprob(ifbrhw(iphas)) = iprop
+ iprop = iprop + 1
+ ipprob(ifbene(iphas)) = iprop
+ enddo
+
+ nprofb = iprop
+
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+ iprop = nprofa
+
+ do iphas = 1, nphas
+ if(iflmau(iphas).gt.0) then
+ iprop = iprop + 1
+ ipprof(ifluma(iu(iphas))) = iprop
+ endif
+ enddo
+
+ nprofa = iprop
+
+!===============================================================================
+! 2. ENTREES SORTIES (entsor.h)
+!===============================================================================
+
+! Comme pour les autres variables,
+! si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! NOMVAR( ) = nom de la variable
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes
+
+! NB : Seuls les 8 premiers caracteres du nom seront repris dans le
+! listing le plus detaille
+
+!--> chaleur specifique a volume constant
+ if(icv (iphas).gt.0) then
+ ipp = ipppro(ipproc(icv (iphas)))
+ NOMVAR(IPP) = 'ch. sp volume constant'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = 0
+ endif
+
+!--> viscosite laminaire
+ if(iviscv(iphas).gt.0) then
+ ipp = ipppro(ipproc(iviscv(iphas)))
+ NOMVAR(IPP) = 'visc. volume'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = 0
+ endif
+
+endif
+
+
+return
+end
diff --git a/src/cfbl/cfqdmv.f90 b/src/cfbl/cfqdmv.f90
new file mode 100644
index 0000000..6086757
--- /dev/null
+++ b/src/cfbl/cfqdmv.f90
@@ -0,0 +1,973 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfqdmv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ flumas , flumab , &
+ coefa , coefb , ckupdc , smacel , frcxt , dfrcxt , &
+ tpucou , trav , viscf , viscb , viscfi , viscbi , &
+ dam , xam , &
+ drtp , smbr , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! RESOLUTION DES EQUATIONS N-S 1 PHASE INCOMPRESSIBLE OU RO VARIABLE
+! SUR UN PAS DE TEMPS (CONVECTION/DIFFUSION - PRESSION /CONTINUITE)
+
+! AU PREMIER APPEL, ON EFFECTUE LA PREDICITION DES VITESSES
+! ET ON CALCULE UN ESTIMATEUR SUR LA VITESSE PREDITE
+
+! AU DEUXIEME APPEL, ON CALCULE UN ESTIMATEUR GLOBAL
+! POUR NAVIER-STOKES :
+! ON UTILISE TRAV, SMBR ET LES TABLEAUX DE TRAVAIL
+! ON APPELLE BILSC2 AU LIEU DE CODITS
+! ON REMPLIT LE PROPCE ESTIMATEUR IESTOT
+! CE DEUXIEME APPEL INTERVIENT DANS NAVSTO APRES RESOLP
+! LORS DE CE DEUXIEME APPEL
+! RTPA ET RTP SONT UN UNIQUE TABLEAU (= RTP)
+! LE FLUX DE MASSE EST LE FLUX DE MASSE DEDUIT DE LA VITESSE
+! AU CENTRE CONTENUE DANS RTP
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! flumas ! tr ! <-- ! flux de masse aux faces internes !
+! (nfac ) ! ! ! (distinction iappel=1 ou 2) !
+! flumab ! tr ! <-- ! flux de masse aux faces de bord !
+! (nfabor ) ! ! ! (distinction iappel=1 ou 2) !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+!dfrcxt(ncelet, ! tr ! <-- ! variation de force exterieure !
+! 3,nphas) ! ! ! generant lapression hydrostatique !
+! tpucou ! tr ! --> ! couplage vitesse pression !
+! (ncelel,ndim) ! ! ! !
+! trav(ncelet,3 ! tr ! --> ! smb qui servira pour normalisation !
+! ! ! ! dans resolp !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! viscfi(nfac) ! tr ! --- ! idem viscf pour increments !
+! viscbi(nfabor ! tr ! --- ! idem viscb pour increments !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbr (ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! coefu(nfab,3) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cfpoin.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision flumas(nfac), flumab(nfabor)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision frcxt(ncelet,3,nphas), dfrcxt(ncelet,3,nphas)
+double precision tpucou(ncelet,ndim), trav(ncelet,3)
+double precision viscf(nfac), viscb(nfabor)
+double precision viscfi(nfac), viscbi(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet)
+double precision smbr(ncelet), rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision coefu(nfabor,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer iel , ielpdc, ifac , ivar , isou , iii
+integer iccocg, inc , init , iphydp, ii
+integer ireslp, nswrgp, imligp, iwarnp, ipp
+integer ipriph, ikiph , iuiph , iviph , iwiph
+integer iclik , iclvar, iclvaf, iclipr
+integer ipcrom, ipcvis, ipcvst
+integer iconvp, idiffp, ndircp, nitmap, nswrsp
+integer ircflp, ischcp, isstpp, iescap
+integer imgrp , ncymxp, nitmfp
+integer idimte, itenso
+integer idiaex, iterns
+integer iifru
+integer maxelt, ils
+double precision rnorm , vitnor
+double precision romvom, rtprom
+double precision epsrgp, climgp, extrap, blencp, epsilp
+double precision epsrsp
+double precision vit1 , vit2 , vit3 , thetap, pfac, pfac1
+double precision cpdc11, cpdc22, cpdc33, cpdc12, cpdc13, cpdc23
+double precision d2s3 , pbord , diipbx, diipby, diipbz, pip, xkb
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipriph = ipr(iphas)
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ ikiph = ik(iphas)
+endif
+
+if(itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ iclik = iclrtp(ikiph ,icoef)
+endif
+
+ipcrom = ipproc(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+! Indicateur flux de bord Rusanov
+if(iifbru.gt.0) then
+ iifru = iifbru+(iphas-1)*nfabor
+else
+ iifru = 1
+endif
+
+!===============================================================================
+! 2. GRADIENT DE PRESSION ET GRAVITE
+!===============================================================================
+
+! ---> PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE :
+
+if (iphydr.eq.1) then
+
+! on doit pouvoir adapter l'option iphydr au compressible,
+! mais noter plusieurs points
+! - on dispose de la masse volumique au pas de temps courant et au
+! pas de temps pr�c�dent (au pas de temps pr�c�dent dans propce
+! en particulier)
+! - la correction de pression est ici g�n�ree par la resolution de
+! l'energie (la pression change sans que rho ne change)
+! - si l'objectif se limite a adapter le calcul de grad p pour
+! qu'il compense le rho0 g, noter quand meme que l'on ne resout
+! pas en rho-rho0 et que P est tjrs coh�rent avec rho (par la
+! thermo)
+
+ do iel = 1, ncel
+
+! variation de force (utilise dans resolp)
+
+ if(igrdpp(iphas).gt.0) then
+ rtprom = rtp(iel,isca(irho(iphas)))
+ else
+ rtprom = rtpa(iel,isca(irho(iphas)))
+ endif
+
+ dfrcxt(iel,1,iphas) = rtprom*gx - frcxt(iel,1,iphas)
+ dfrcxt(iel,2,iphas) = rtprom*gy - frcxt(iel,2,iphas)
+ dfrcxt(iel,3,iphas) = rtprom*gz - frcxt(iel,3,iphas)
+ enddo
+! Ajout eventuel des pertes de charges
+ if (ncepdp.gt.0) then
+ do ielpdc = 1, ncepdp
+ iel=icepdc(ielpdc)
+ vit1 = rtp(iel,iuiph)
+ vit2 = rtp(iel,iviph)
+ vit3 = rtp(iel,iwiph)
+ cpdc11 = ckupdc(ielpdc,1)
+ cpdc22 = ckupdc(ielpdc,2)
+ cpdc33 = ckupdc(ielpdc,3)
+ cpdc12 = ckupdc(ielpdc,4)
+ cpdc13 = ckupdc(ielpdc,5)
+ cpdc23 = ckupdc(ielpdc,6)
+ dfrcxt(iel,1,iphas) = dfrcxt(iel,1,iphas) &
+ -rtp(iel,isca(irho(iphas)))*(cpdc11*vit1+cpdc12*vit2+cpdc13*vit3)
+ dfrcxt(iel,2,iphas) = dfrcxt(iel,2,iphas) &
+ -rtp(iel,isca(irho(iphas)))*(cpdc12*vit1+cpdc22*vit2+cpdc23*vit3)
+ dfrcxt(iel,3,iphas) = dfrcxt(iel,3,iphas) &
+ -rtp(iel,isca(irho(iphas)))*(cpdc13*vit1+cpdc23*vit2+cpdc33*vit3)
+ enddo
+ endif
+
+ if(irangp.ge.0) then
+ call parcom (dfrcxt(1,1,iphas))
+ !==========
+ call parcom (dfrcxt(1,2,iphas))
+ !==========
+ call parcom (dfrcxt(1,3,iphas))
+ !==========
+ endif
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dfrcxt(1,1,iphas),dfrcxt(1,1,iphas),dfrcxt(1,1,iphas), &
+ dfrcxt(1,2,iphas),dfrcxt(1,2,iphas),dfrcxt(1,2,iphas), &
+ dfrcxt(1,3,iphas),dfrcxt(1,3,iphas),dfrcxt(1,3,iphas))
+ endif
+
+endif
+
+! Fin du test sur IPHYDR
+
+
+! ---> PRISE EN COMPTE DU GRADIENT DE PRESSION
+
+iccocg = 1
+inc = 1
+nswrgp = nswrgr(ipriph)
+imligp = imligr(ipriph)
+iwarnp = iwarni(ipriph)
+epsrgp = epsrgr(ipriph)
+climgp = climgr(ipriph)
+extrap = extrag(ipriph)
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipriph , imrgra , inc , iccocg , nswrgp , imligp , iphydr , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ frcxt(1,1,iphas), frcxt(1,2,iphas), frcxt(1,3,iphas), &
+ rtp(1,ipriph) , coefa(1,iclrtp(ipriph,icoef)) , &
+ coefb(1,iclrtp(ipriph,icoef)) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+if (iphydr.eq.1) then
+ do iel = 1, ncel
+ trav(iel,1) = ( frcxt(iel,1,iphas) - w1(iel) )*volume(iel)
+ trav(iel,2) = ( frcxt(iel,2,iphas) - w2(iel) )*volume(iel)
+ trav(iel,3) = ( frcxt(iel,3,iphas) - w3(iel) )*volume(iel)
+ enddo
+else
+ do iel = 1, ncel
+
+ if(igrdpp(iphas).gt.0) then
+ rtprom = rtp(iel,isca(irho(iphas)))
+ else
+ rtprom = rtpa(iel,isca(irho(iphas)))
+ endif
+
+ trav(iel,1) = ( rtprom*gx - w1(iel) )*volume(iel)
+ trav(iel,2) = ( rtprom*gy - w2(iel) )*volume(iel)
+ trav(iel,3) = ( rtprom*gz - w3(iel) )*volume(iel)
+ enddo
+endif
+
+! Calcul des efforts aux parois (partie 2/5), si demande
+! La pression a la face est calculee comme dans gradrc/gradmc
+if (ineedf.eq.1) then
+ iclipr = iclrtp(ipriph,icoef)
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ii = idiipb-1+3*(ifac-1)
+ diipbx = ra(ii+1)
+ diipby = ra(ii+2)
+ diipbz = ra(ii+3)
+ pip = rtpa(iel,ipriph) &
+ +diipbx*w1(iel) +diipby*w2(iel) &
+ +diipbz*w3(iel)
+ pfac = coefa(ifac,iclipr) +coefb(ifac,iclipr)*pip
+ pfac1= rtpa(iel,ipriph) &
+ +(cdgfbo(1,ifac)-xyzcen(1,iel))*w1(iel) &
+ +(cdgfbo(2,ifac)-xyzcen(2,iel))*w2(iel) &
+ +(cdgfbo(3,ifac)-xyzcen(3,iel))*w3(iel)
+ pfac = coefb(ifac,iclipr)*(extrag(ipriph)*pfac1 &
+ +(1.d0-extrag(ipriph))*pfac) &
+ +(1.d0-coefb(ifac,iclipr))*pfac
+ do isou = 1, 3
+ ra(iforbr+(ifac-1)*ndim + isou-1) = &
+ ra(iforbr+(ifac-1)*ndim + isou-1) &
+ + pfac*surfbo(isou,ifac)
+ enddo
+ enddo
+endif
+
+
+! Elimination du flux au bord associ� au gradient de pression :
+! il est pris en compte par les conditions aux limites dans
+! le flux de Rusanov
+
+if(iifbru.gt.0) then
+
+ do ifac = 1, nfabor
+
+ if(ia(iifru+ifac-1).eq.1) then
+
+ iel = ifabor(ifac)
+
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+
+ pip = rtp(iel,ipriph) &
+ +(w1(iel)*diipbx+w2(iel)*diipby+w3(iel)*diipbz)
+
+ pbord = coefa(ifac,iclrtp(ipriph,icoef)) &
+ + coefb(ifac,iclrtp(ipriph,icoef))*pip
+
+ trav(iel,1) = trav(iel,1) + pbord*surfbo(1,ifac)
+ trav(iel,2) = trav(iel,2) + pbord*surfbo(2,ifac)
+ trav(iel,3) = trav(iel,3) + pbord*surfbo(3,ifac)
+
+ endif
+
+ enddo
+
+endif
+
+! Flux de C .L. associ� � Rusanov (PROPFB contient la contribution
+! de - div(rho u u) - grad P si on est pass� dans cfrusb
+! ou 0 sinon).
+! Pour ne pas ajouter le flux div(rho u u) deux fois, on a remplace
+! codits et bilsc2 par cfcdts et cfbsc2 qui ne different des
+! precedents que par les indicateurs qui permettent de
+! ne pas prendre en compte le flux convectif aux faces de bord
+! pour lesquelles on est passe dans cfrusb
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ trav(iel,1) = trav(iel,1) - propfb(ifac,ipprob(ifbrhu(iphas)))
+ trav(iel,2) = trav(iel,2) - propfb(ifac,ipprob(ifbrhv(iphas)))
+ trav(iel,3) = trav(iel,3) - propfb(ifac,ipprob(ifbrhw(iphas)))
+enddo
+
+
+! ---> 2/3 RHO * GRADIENT DE K SI k epsilon
+! NB : ON NE PREND PAS LE GRADIENT DE (RHO K), MAIS
+! CA COMPLIQUERAIT LA GESTION DES CL ...
+
+if( (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) .and.igrhok(iphas).eq.1) then
+ iccocg = 1
+ inc = 1
+ nswrgp = nswrgr(ikiph)
+ imligp = imligr(ikiph)
+ epsrgp = epsrgr(ikiph)
+ climgp = climgr(ikiph)
+ extrap = extrag(ikiph)
+
+ iwarnp = iwarni(iuiph)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ikiph , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtp(1,ikiph) , coefa(1,iclik) , coefb(1,iclik) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ d2s3 = 2.d0/3.d0
+ do iel = 1, ncel
+ romvom = -rtp(iel,isca(irho(iphas)))*volume(iel)*d2s3
+ trav(iel,1) = trav(iel,1) + w1(iel) * romvom
+ trav(iel,2) = trav(iel,2) + w2(iel) * romvom
+ trav(iel,3) = trav(iel,3) + w3(iel) * romvom
+ enddo
+
+! Calcul des efforts aux parois (partie 3/5), si demande
+ if (ineedf.eq.1) then
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ii = idiipb-1+3*(ifac-1)
+ diipbx = ra(ii+1)
+ diipby = ra(ii+2)
+ diipbz = ra(ii+3)
+ xkb = rtpa(iel,ikiph) + diipbx*w1(iel) &
+ + diipby*w2(iel) + diipbz*w3(iel)
+ xkb = coefa(ifac,iclik)+coefb(ifac,iclik)*xkb
+ xkb = d2s3*propce(iel,ipcrom)*xkb
+ do isou = 1, 3
+ ra(iforbr+(ifac-1)*ndim + isou-1) = &
+ ra(iforbr+(ifac-1)*ndim + isou-1) &
+ + xkb*surfbo(isou,ifac)
+ enddo
+ enddo
+ endif
+
+endif
+
+
+
+! ---> TERMES DE GRADIENT TRANSPOSE
+
+if (ivisse(iphas).eq.1) then
+
+ call vissec &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ trav , &
+! ------
+ viscf , viscb , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+! ---> TERMES DE PERTES DE CHARGE
+! SI IPHYDR=1 LE TERME A DEJA ETE PRIS EN COMPTE AVANT
+
+if((ncepdp.gt.0).and.(iphydr.eq.0)) then
+
+ idiaex = 1
+ call tsepdc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncepdp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , idiaex , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , trav , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+! ---> - DIVERGENCE DE RIJ
+
+if(itytur(iphas).eq.3 ) then
+
+ do isou = 1, 3
+
+ if(isou.eq.1) ivar = iuiph
+ if(isou.eq.2) ivar = iviph
+ if(isou.eq.3) ivar = iwiph
+
+ call divrij &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , isou , ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , coefu , &
+ rdevel , rtuser , ra )
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,viscf,viscb,w1)
+
+ do iel = 1, ncel
+ trav(iel,isou) = trav(iel,isou) - w1(iel)
+ enddo
+
+ enddo
+
+endif
+
+
+
+! ---> "VITESSE" DE DIFFUSION FACETTE
+! SI ON FAIT AUTRE CHOSE QUE DU K EPS, IL FAUDRA LA METTRE
+! DANS LA BOUCLE
+
+if( idiff(iuiph).ge. 1 ) then
+
+! --- Si la vitesse doit etre diffusee, on calcule la viscosite
+! pour le second membre (selon Rij ou non)
+
+ if (itytur(iphas).eq.3) then
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis)
+ enddo
+ else
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis) + propce(iel,ipcvst)
+ enddo
+ endif
+
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+! Quand on n'est pas en Rij ou que irijnu = 0, les tableaux
+! VISCFI, VISCBI se trouvent remplis par la meme occasion
+! (ils sont confondus avec VISCF, VISCB)
+! En Rij avec irijnu = 1, on calcule la viscosite increment
+! de la matrice dans VISCFI, VISCBI
+
+ if(itytur(iphas).eq.3 .and. irijnu(iphas).eq.1) then
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcvis) + propce(iel,ipcvst)
+ enddo
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , &
+ viscfi , viscbi , &
+ rdevel , rtuser , ra )
+ endif
+
+else
+
+! --- Si la vitesse n'a pas de diffusion, on annule la viscosite
+! (matrice et second membre sont dans le meme tableau,
+! sauf en Rij avec IRIJNU = 1)
+
+ do ifac = 1, nfac
+ viscf(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscb(ifac) = 0.d0
+ enddo
+
+ if(itytur(iphas).eq.3.and.irijnu(iphas).eq.1) then
+ do ifac = 1, nfac
+ viscfi(ifac) = 0.d0
+ enddo
+ do ifac = 1, nfabor
+ viscbi(ifac) = 0.d0
+ enddo
+ endif
+
+endif
+
+
+! 2.2 RESOLUTION IMPLICITE NON COUPLEE DES 3 COMPO. DE VITESSES
+! ==============================================================
+
+! ---> BOUCLE SUR LES DIRECTIONS DE L'ESPACE (U, V, W)
+
+
+! Remarque : On suppose que le couplage vitesse pression
+! n'est valable que pour une seule phase.
+
+do isou = 1, 3
+
+ if(isou.eq.1) then
+ ivar = iuiph
+ endif
+ if(isou.eq.2) then
+ ivar = iviph
+ endif
+ if(isou.eq.3) then
+ ivar = iwiph
+ endif
+ ipp = ipprtp(ivar)
+
+ iclvar = iclrtp(ivar,icoef)
+ iclvaf = iclrtp(ivar,icoeff)
+
+
+! ---> TERMES SOURCES UTILISATEURS
+
+ do iel = 1, ncel
+ smbr (iel) = 0.d0
+ drtp (iel) = 0.d0
+ enddo
+
+ maxelt = max(ncelet, nfac, nfabor)
+ ils = idebia
+ ifinia = ils + maxelt
+ CALL IASIZE('CFQDMV',IFINIA)
+
+ call ustsns &
+ !==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbr , drtp , &
+! ------ ------
+ dam , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+ do iel = 1, ncel
+ rovsdt(iel) = max(-drtp(iel),zero)
+ smbr (iel) = smbr(iel) + drtp(iel) * rtp(iel,ivar)
+ enddo
+
+
+! ---> TERME D'ACCUMULATION DE MASSE -(dRO/dt)*Volume
+
+ init = 1
+ call divmas(ncelet,ncel,nfac,nfabor,init,nfecra, &
+ ifacel,ifabor,flumas,flumab,w1)
+
+
+
+! ---> AJOUT DANS LE TERME SOURCE ET DANS LE TERME INSTATIONNAIRE
+
+ do iel = 1, ncel
+ smbr(iel) = smbr (iel) + &
+ trav(iel,isou)+iconv(ivar)*w1(iel)*rtpa(iel,ivar)
+ enddo
+
+ do iel = 1, ncel
+ rovsdt(iel) = rovsdt(iel) + &
+ istat(ivar)*(propce(iel,ipcrom)/dt(iel))*volume(iel) &
+ -iconv(ivar)*w1(iel)
+ enddo
+
+
+! ---> PERTES DE CHARGE
+
+ if (ncepdp.gt.0) then
+ do ielpdc = 1, ncepdp
+ iel = icepdc(ielpdc)
+ rovsdt(iel) = rovsdt(iel) + &
+ propce(iel,ipcrom)*volume(iel)*ckupdc(ielpdc,isou)
+ enddo
+ endif
+
+
+! ---> TERMES DE SOURCE DE MASSE
+
+ if (ncesmp.gt.0) then
+ iterns = 1
+ call catsma ( ncelet , ncel , ncesmp , iterns , &
+ isno2t(iphas), thetav(ivar), &
+ icetsm , itypsm(1,ivar) , &
+ volume , rtp(1,ivar) , smacel(1,ivar) , &
+ smacel(1,ipr(iphas)) , smbr , rovsdt , w1)
+ endif
+
+
+
+! ---> PARAMETRES POUR LA RESOLUTION DU SYSTEME
+
+ iconvp = iconv (ivar)
+ idiffp = idiff (ivar)
+ ireslp = iresol(ivar)
+ ndircp = ndircl(ivar)
+ nitmap = nitmax(ivar)
+!MO IMRGRA
+ nswrsp = nswrsm(ivar)
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ ircflp = ircflu(ivar)
+ ischcp = ischcv(ivar)
+ isstpp = isstpc(ivar)
+ imgrp = imgr (ivar)
+ ncymxp = ncymax(ivar)
+ nitmfp = nitmgf(ivar)
+!MO IPP
+ iwarnp = iwarni(ivar)
+ blencp = blencv(ivar)
+ epsilp = epsilo(ivar)
+ epsrsp = epsrsm(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ thetap = thetav(ivar)
+ iescap = 0
+
+
+! ---> FIN DE LA CONSTRUCTION ET DE LA RESOLUTION DU SYSTEME
+
+ call cfcdts &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , iifbru , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iifru) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ coefa(1,iclvaf) , coefb(1,iclvaf) , &
+ flumas , flumab , &
+ viscfi , viscbi , viscf , viscb , &
+ rovsdt , smbr , rtp(1,ivar) , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! PAS DE COUPLAGE INSTATIONNAIRE EN COMPRESSIBLE
+
+enddo
+
+! ---> FIN DE LA BOUCLE SUR U, V, W,
+
+
+! ---> IMPRESSION DE NORME
+
+if (iwarni(iuiph).ge.2) then
+ rnorm = -1.d0
+ do iel = 1, ncel
+ vitnor = &
+ sqrt(rtp(iel,iuiph)**2+rtp(iel,iviph)**2+rtp(iel,iwiph)**2)
+ rnorm = max(rnorm,vitnor)
+ enddo
+ if (irangp.ge.0) call parmax (rnorm)
+ !==========
+ write(nfecra,1100) iphas, rnorm
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1100 format(/, &
+ 1X,'Phase ',I4,' : Vitesse maximale apres qdm ',E12.4)
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cfbl/cfrusb.f90 b/src/cfbl/cfrusb.f90
new file mode 100644
index 0000000..9866b89
--- /dev/null
+++ b/src/cfbl/cfrusb.f90
@@ -0,0 +1,316 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfrusb &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ gammag , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ sorti1 , sorti2 , gamagr , masmor , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! Flux de rusanov au bord pour euler + energie
+
+! d rho /dt + div rho u = 0
+! d rho u /dt + div rho u u + grad P = 0
+! d E /dt + div rho u E + div u P = 0
+
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! imodif ! e ! <-- ! modification directe de rtp (imodif=1 !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! gammag ! r ! <-- ! gamma du gaz !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp,rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! sorti1,2(*) ! tr ! --> ! variables de sortie !
+! gamagr(*) ! tr ! --- ! constante gamma equivalent du gaz !
+! masmor(*) ! tr ! --- ! masse molaire des constituants du gaz !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cfpoin.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer imodif , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision gammag
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*),propfa(nfac,*),propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision sorti1(*), sorti2(*), gamagr(*), masmor(*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ifac0
+integer iel , ifac
+integer ipriph , irhiph , ieniph
+integer iuiph , iviph , iwiph
+integer iclp , iclr , icle
+integer iclu , iclv , iclw
+integer iflmab
+double precision und , uni , rund , runi , cd , ci
+double precision rrus , runb
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipriph = ipr(iphas)
+irhiph = isca(irho (iphas))
+ieniph = isca(ienerg(iphas))
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+iclp = iclrtp(ipriph,icoef)
+iclr = iclrtp(irhiph,icoef)
+icle = iclrtp(ieniph,icoef)
+iclu = iclrtp(iuiph,icoef)
+iclv = iclrtp(iviph,icoef)
+iclw = iclrtp(iwiph,icoef)
+
+iflmab = ipprob(ifluma(ieniph))
+
+ifac0 = imodif
+ifac = ifac0
+iel = ifabor(ifac)
+
+!===============================================================================
+! 1. GRANDEURS LIEES A RUSANOV
+!===============================================================================
+
+
+und = (coefa(ifac,iclu)*surfbo(1,ifac) &
+ + coefa(ifac,iclv)*surfbo(2,ifac) &
+ + coefa(ifac,iclw)*surfbo(3,ifac))/ra(isrfbn+ifac-1)
+uni = (rtp(iel,iuiph)*surfbo(1,ifac) &
+ + rtp(iel,iviph)*surfbo(2,ifac) &
+ + rtp(iel,iwiph)*surfbo(3,ifac))/ra(isrfbn+ifac-1)
+rund = coefa(ifac,iclr)*und
+runi = rtp(iel,irhiph) *uni
+cd = sqrt(gammag*coefa(ifac,iclp)/coefa(ifac,iclr))
+ci = sqrt(gammag*rtp(iel,ipriph)/rtp(iel,irhiph))
+rrus = max(abs(und)+cd,abs(uni)+ci)
+
+runb = 0.5d0*(coefa(ifac,iclr)*und+rtp(iel,irhiph)*uni) &
+ - 0.5d0*rrus*(coefa(ifac,iclr)-rtp(iel,irhiph))
+
+!===============================================================================
+! 2. FLUX CONVECTIFS DE RUSANOV
+!===============================================================================
+
+
+! Reperage de la face pour annuler les flux convectifs
+! calcules au bord par bilsc2 ou cfbsc2 pour la qdm (div(rho u u))
+! et l'energie (div(rho u E)) ainsi que les termes en
+! grad(P) et div(u P)
+
+ia(iifbru+ifac-1+(iphas-1)*nfabor) = 1
+
+! Flux de masse
+propfb(ifac,iflmab) = runb*ra(isrfbn+ifac-1)
+
+! Flux de Qdm (la partie centree en pression pourrait etre prise dans
+! la condition � la limite de pression, ce qui eviterait de retoucher
+! le gradient de pression de la qdm, mais qui donne moins de
+! flexibilit� quant � la condition � la limite de pression utilisee
+! pour la reconstruction du gradient, si le maillage est non
+! orthogonal en entree)
+propfb(ifac,ipprob(ifbrhu(iphas))) = ra(isrfbn+ifac-1)* &
+ 0.5d0*( &
+ (rund*coefa(ifac,iclu)+runi*rtp(iel,iuiph)) &
+ -rrus*( coefa(ifac,iclr)*coefa(ifac,iclu) &
+ -rtp(iel,irhiph) *rtp(iel,iuiph) )) &
+ + surfbo(1,ifac)* &
+ 0.5d0*(coefa(ifac,iclp)+rtp(iel,ipriph))
+propfb(ifac,ipprob(ifbrhv(iphas))) = ra(isrfbn+ifac-1)* &
+ 0.5d0*( &
+ (rund*coefa(ifac,iclv)+runi*rtp(iel,iviph)) &
+ -rrus*( coefa(ifac,iclr)*coefa(ifac,iclv) &
+ -rtp(iel,irhiph) *rtp(iel,iviph) )) &
+ + surfbo(2,ifac)* &
+ 0.5d0*(coefa(ifac,iclp)+rtp(iel,ipriph))
+propfb(ifac,ipprob(ifbrhw(iphas))) = ra(isrfbn+ifac-1)* &
+ 0.5d0*( &
+ (rund*coefa(ifac,iclw)+runi*rtp(iel,iwiph)) &
+ -rrus*( coefa(ifac,iclr)*coefa(ifac,iclw) &
+ -rtp(iel,irhiph) *rtp(iel,iwiph) )) &
+ + surfbo(3,ifac)* &
+ 0.5d0*(coefa(ifac,iclp)+rtp(iel,ipriph))
+! Flux de E
+propfb(ifac,ipprob(ifbene(iphas))) = ra(isrfbn+ifac-1)* &
+ 0.5d0*( &
+ rund*coefa(ifac,icle)+runi*rtp(iel,ieniph) &
+ +und*coefa(ifac,iclp)+ uni*rtp(iel,ipriph) &
+ -rrus*( coefa(ifac,iclr)*coefa(ifac,icle) &
+ -rtp(iel,irhiph) *rtp(iel,ieniph) ))
+
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cfbl/cfvarp.f90 b/src/cfbl/cfvarp.f90
new file mode 100644
index 0000000..def30e5
--- /dev/null
+++ b/src/cfbl/cfvarp.f90
@@ -0,0 +1,251 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cfvarp
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES
+! POUR LE COMPRESSIBLE SANS CHOC SELON
+! REMPLISSAGE DES PARAMETRES (DEJA DEFINIS) POUR LES SCALAIRES PP
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer ii, iphas, iprop, iok, iccfth, imodif
+integer iit(1)
+double precision dblpre(1)
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+
+if ( ippmod(icompf).ge.0 ) then
+
+ iprop =0
+
+ do iphas = 1, nphas
+
+! ---- Masse volumique
+ iprop = iprop + 1
+ irho(iphas) = iscapp(iprop)
+! Alias pour les C.L.
+ irun(iphas) = irho(iphas)
+
+! ---- Energie totale
+ iprop = iprop + 1
+ ienerg(iphas) = iscapp(iprop)
+! Alias pour les C.L.
+ irunh(iphas) = ienerg(iphas)
+
+! ---- Temperature (post)
+ iprop = iprop + 1
+ itempk(iphas) = iscapp(iprop)
+
+! ---- Phase associee
+ iphsca(irho (iphas)) = iphas
+ iphsca(ienerg(iphas)) = iphas
+ iphsca(itempk(iphas)) = iphas
+
+! ---- Viscosite dynamique de reference relative au scalaire IRHO
+ ivisls(irho (iphas)) = 0
+ visls0(irho (iphas)) = epzero
+
+! ---- Viscosite dynamique de reference relative au scalaire ITEMPK
+ ivisls(itempk(iphas)) = 0
+ visls0(itempk(iphas)) = epzero
+
+! ---- Initialisation par defaut de la viscosite en volume (cste)
+ iviscv(iphas) = 0
+ viscv0(iphas) = 0.d0
+
+
+!===============================================================================
+! 2. OPTIONS DE CALCUL
+!===============================================================================
+
+! --> Cv constant ou variable (par defaut : constant)
+ icv(iphas) = 0
+ cv0(iphas) = 0.d0
+
+ iccfth = -1
+ imodif = 0
+ ii = 1
+ iit(1) = 1
+ dblpre(1) = 0.d0
+ call uscfth &
+ !==========
+ ( ii , ii , &
+ ii , ii , ii , ii , ii , ii , ii , &
+ ii , ii , ii , ii , &
+ ii , ii , ii , &
+ iccfth , imodif , iphas , &
+ ii , ii , ii , ii , &
+ iit , iit , iit , iit , iit , &
+ iit , iit , iit , iit , &
+ iit , iit , iit , iit , &
+ dblpre , dblpre , dblpre , dblpre , dblpre , dblpre , dblpre , &
+ dblpre , dblpre , dblpre , dblpre , dblpre , dblpre , &
+ dblpre , dblpre , &
+ dblpre , dblpre , dblpre , dblpre , &
+ dblpre , dblpre , dblpre , dblpre )
+
+! --> Utilisation d'un flux de masse specifique pour la vitesse
+
+! ATTENTION PAS ENCORE IMPLEMENTE
+!======== LAISSER IFLMAU(IPHAS) = 0
+
+ iflmau(iphas) = 0
+
+ enddo
+
+
+!===============================================================================
+! 3. ON REDONNE LA MAIN A L'UTILISATEUR
+!===============================================================================
+
+ call uscfx2
+ !==========
+
+
+!===============================================================================
+! 4. TRAITEMENT ET VERIFICATION DES DONNEES FOURNIES PAR L'UTILISATEUR
+!===============================================================================
+
+! ---- Viscosite dynamique de reference relative au scalaire IENERG
+ do iphas = 1, nphas
+ if(ivisls(itempk(iphas)).gt.0 .or. icv(iphas).gt.0) then
+ ivisls(ienerg(iphas)) = 1
+ else
+ ivisls(ienerg(iphas)) = 0
+ endif
+
+ visls0(ienerg(iphas)) = epzero
+
+ enddo
+
+ iok = 0
+
+ do iphas = 1, nphas
+
+ if(visls0(itempk(iphas)).le.0.d0) then
+ write(nfecra,1000) iphas, visls0(itempk(iphas))
+ iok = 1
+ endif
+
+ if(viscv0(iphas).lt.0.d0) then
+ write(nfecra,2000) iphas, viscv0(iphas)
+ iok = 1
+ endif
+
+ enddo
+
+ if(iok.gt.0) call csexit (1)
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= MODULE COMPRESSIBLE ',/,&
+'@ ',/,&
+'@ LA CONDUCTIVITE THERMIQUE (PHASE ',I6,') DOIT ETRE ',/,&
+'@ UN REEL POSITIF STRICTEMENT ',/,&
+'@ ELLE A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier uscfx2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= MODULE COMPRESSIBLE ',/,&
+'@ ',/,&
+'@ LA CONDUCTIVITE THERMIQUE (PHASE ',I6,') DOIT ETRE ',/,&
+'@ ',/,&
+'@ LA VISCOSITE EN VOLUME (PHASE ',I6,') DOIT ETRE ',/,&
+'@ UN REEL POSITIF ',/,&
+'@ ELLE A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier uscfx2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
+
diff --git a/src/cfbl/cfxtcl.f90 b/src/cfbl/cfxtcl.f90
new file mode 100644
index 0000000..977960d
--- /dev/null
+++ b/src/cfbl/cfxtcl.f90
@@ -0,0 +1,1277 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cfxtcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! COMPRESSIBLE SANS CHOC
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cfpoin.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iphas , ivar , ifac , iel
+integer ii , iii , imodif, iccfth
+integer icalep, icalgm
+integer iflmab
+integer ipriph, iuiph , iviph , iwiph
+integer irhiph, ieniph, itkiph
+integer iclp , iclr
+integer iclu , iclv , iclw
+integer nvarcf
+
+integer nvcfmx
+parameter (nvcfmx=7)
+integer ivarcf(nvcfmx)
+
+double precision hint , gammag
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+do iphas = 1, nphas
+
+ ipriph = ipr (iphas)
+ iuiph = iu (iphas)
+ iviph = iv (iphas)
+ iwiph = iw (iphas)
+ irhiph = isca(irho (iphas))
+ ieniph = isca(ienerg(iphas))
+ itkiph = isca(itempk(iphas))
+ iclp = iclrtp(ipriph,icoef)
+ iclr = iclrtp(irhiph,icoef)
+ iclu = iclrtp(iuiph ,icoef)
+ iclv = iclrtp(iviph ,icoef)
+ iclw = iclrtp(iwiph ,icoef)
+
+ iflmab = ipprob(ifluma(ieniph))
+
+! Liste des variables compressible :
+ ivarcf(1) = ipriph
+ ivarcf(2) = iuiph
+ ivarcf(3) = iviph
+ ivarcf(4) = iwiph
+ ivarcf(5) = irhiph
+ ivarcf(6) = ieniph
+ ivarcf(7) = itkiph
+ nvarcf = 7
+
+! Calcul de epsilon_sup = e - CvT
+! On en a besoin si on a des parois a temperature imposee.
+! Il est calcul� aux cellules W5 et aux faces de bord COEFU.
+! On n'en a besoin ici qu'aux cellules de bord : s'il est
+! n�cessaire de gagner de la m�moire, on pourra modifier
+! uscfth.
+
+ icalep = 0
+ do ifac = 1, nfabor
+ if(icodcl(ifac,itkiph).eq.5) then
+ icalep = 1
+ endif
+ enddo
+ if(icalep.ne.0) then
+ iccfth = 7
+ imodif = 0
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w5 , coefu(1,1) , w3 , w4 , &
+! ------ ---------
+ rdevel , rtuser , ra )
+ endif
+
+
+! Calcul de gamma (constant ou variable ; pour le moment : cst)
+! On en a besoin pour les entrees sorties avec rusanov
+
+ icalgm = 0
+ do ifac = 1, nfabor
+ if ( ( itypfb(ifac,iphas).eq.iesicf ) .or. &
+ ( itypfb(ifac,iphas).eq.isopcf ) .or. &
+ ( itypfb(ifac,iphas).eq.ierucf ) .or. &
+ ( itypfb(ifac,iphas).eq.ieqhcf ) ) then
+ icalgm = 1
+ endif
+ enddo
+ if(icalgm.ne.0) then
+ iccfth = 1
+ imodif = 0
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w6 , w4 , &
+ rdevel , rtuser , ra )
+
+ if(ieos(iphas).eq.1) then
+ gammag = w6(1)
+ else
+! Gamma doit etre passe a cfrusb ; s'il est variable
+! il est dans le tableau W6 et il faut ajouter
+! GAMMAG = W6(IFABOR(IFAC)) selon IEOS
+! dans la boucle sur les faces.
+! En attendant que IEOS different de 1 soit code, on stoppe
+ write(nfecra,7000)
+ call csexit (1)
+ endif
+
+ endif
+
+
+
+! Boucle sur les faces
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES DE PAROI
+!===============================================================================
+
+ if ( itypfb(ifac,iphas).eq.iparoi) then
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! En paroi, on traite toutes les variables.
+ do ivar = 1, nvar
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+! Le flux de masse est nul
+
+ propfb(ifac,iflmab) = 0.d0
+
+! Pression :
+
+! Si la gravite est predominante : pression hydrostatique
+! (approximatif et surtout explicite en rho)
+
+ if(icfgrp(iphas).eq.1) then
+
+ icodcl(ifac,ipriph) = 3
+ hint = dt(iel)/ra(idistb-1+ifac)
+ rcodcl(ifac,ipriph,3) = -hint &
+ * ( gx*(cdgfbo(1,ifac)-xyzcen(1,iel)) &
+ + gy*(cdgfbo(2,ifac)-xyzcen(2,iel)) &
+ + gz*(cdgfbo(3,ifac)-xyzcen(3,iel)) ) &
+ * rtp(iel,irhiph)
+
+ else
+
+! En g�n�ral : proportionnelle a la valeur interne
+! (Pbord = COEFB*Pi)
+! Si on d�tend trop : Dirichlet homogene
+
+ iccfth = 91
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , ifac , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+! En outre, il faut appliquer une pre-correction pour compenser
+! le traitement fait dans condli... Si on pouvait remplir COEFA
+! et COEFB directement, on gagnerait en simplicite, mais cela
+! demanderait un test sur IPPMOD dans condli : � voir)
+
+ icodcl(ifac,ipriph) = 1
+ if(coefb(ifac,iclp).lt.rinfin*0.5d0.and. &
+ coefb(ifac,iclp).gt.0.d0 ) then
+ hint = dt(iel)/ra(idistb-1+ifac)
+ rcodcl(ifac,ipriph,1) = 0.d0
+ rcodcl(ifac,ipriph,2) = &
+ hint*(1.d0/coefb(ifac,iclp)-1.d0)
+ else
+ rcodcl(ifac,ipriph,1) = 0.d0
+ endif
+
+ endif
+
+
+! La vitesse et la turbulence sont trait�es de mani�re standard,
+! dans condli.
+
+! Pour la thermique, on doit effectuer ici un pr�traitement,
+! la variable r�solue �tant l'energie
+! (energie interne+epsilon sup+energie cin�tique). En particulier
+! lorsque la paroi est � temp�rature impos�e, on pr�pare le
+! travail de clptur. Hormis l'�nergie r�solue, toutes les
+! variables rho et s prendront arbitrairement une condition de
+! flux nul (leurs conditions aux limites ne servent qu'� la
+! reconstruction des gradients et il parait d�licat d'imposer
+! autre chose qu'un flux nul sans risque de cr�er des valeurs
+! aberrantes au voisinage de la couche limite)
+
+! Par d�faut : adiabatique
+ if( icodcl(ifac,itkiph).eq.0.and. &
+ icodcl(ifac,ieniph).eq.0) then
+ icodcl(ifac,itkiph) = 3
+ rcodcl(ifac,itkiph,3) = 0.d0
+ endif
+
+! Temperature imposee
+ if(icodcl(ifac,itkiph).eq.5) then
+
+! On impose la valeur de l'energie qui conduit au bon flux.
+! On notera cependant qu'il s'agit de la condition � la
+! limite pour le flux diffusif. Pour la reconstruction
+! des gradients, il faudra utiliser autre chose.
+! Par exemple un flux nul ou encore toute autre
+! condition respectant un profil : on se calquera sur
+! ce qui sera fait pour la temp�rature si c'est possible,
+! sachant que l'energie contient l'energie cinetique,
+! ce qui rend le choix du profil d�licat.
+
+ icodcl(ifac,ieniph) = 5
+ if(icv(iphas).eq.0) then
+ rcodcl(ifac,ieniph,1) = &
+ cv0(iphas)*rcodcl(ifac,itkiph,1)
+ else
+ rcodcl(ifac,ieniph,1) = propce(iel,ipproc(icv(iphas))) &
+ *rcodcl(ifac,itkiph,1)
+ endif
+ rcodcl(ifac,ieniph,1) = rcodcl(ifac,ieniph,1) &
+ + 0.5d0*(rtp(iel,iuiph)**2+ &
+ rtp(iel,iviph)**2+rtp(iel,iwiph)**2) &
+ + w5(iel)
+! ^epsilon sup (cf USCFTH)
+
+! Les flux en grad epsilon sup et �nergie cin�tique doivent
+! �tre nuls puisque tout est pris par le terme de
+! diffusion d'energie.
+ ia(iifbet+ifac-1+(iphas-1)*nfabor) = 1
+
+! Flux nul pour la reconstruction �ventuelle de temp�rature
+ icodcl(ifac,itkiph) = 3
+ rcodcl(ifac,itkiph,3) = 0.d0
+
+! Flux impose
+ elseif(icodcl(ifac,itkiph).eq.3) then
+
+! On impose le flux sur l'energie
+ icodcl(ifac,ieniph) = 3
+ rcodcl(ifac,ieniph,3) = rcodcl(ifac,itkiph,3)
+
+! Les flux en grad epsilon sup et �nergie cin�tique doivent
+! �tre nuls puisque tout est pris par le terme de
+! diffusion d'energie.
+ ia(iifbet+ifac-1+(iphas-1)*nfabor) = 1
+
+! Flux nul pour la reconstruction �ventuelle de temp�rature
+ icodcl(ifac,itkiph) = 3
+ rcodcl(ifac,itkiph,3) = 0.d0
+
+ endif
+
+
+! Scalaires : flux nul (par defaut dans typecl pour iparoi)
+
+
+!===============================================================================
+! 3. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES DE SYMETRIE
+!===============================================================================
+
+ elseif ( itypfb(ifac,iphas).eq.isymet ) then
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! En symetrie, on traite toutes les variables.
+ do ivar = 1, nvar
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+! Le flux de masse est nul
+
+ propfb(ifac,iflmab) = 0.d0
+
+! Condition de Pression
+
+ iccfth = 90
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , ifac , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+
+! Pression :
+! En g�n�ral : proportionnelle a la valeur interne
+! (Pbord = COEFB*Pi)
+! Si on d�tend trop : Dirichlet homogene
+
+! En outre, il faut appliquer une pre-correction pour compenser le
+! traitement fait dans condli... Si on pouvait remplir COEFA
+! et COEFB directement, on gagnerait en simplicite, mais cela
+! demanderait un test sur IPPMOD dans condli : � voir)
+
+ icodcl(ifac,ipriph) = 3
+ rcodcl(ifac,ipriph,1) = 0.d0
+ rcodcl(ifac,ipriph,2) = rinfin
+ rcodcl(ifac,ipriph,3) = 0.d0
+
+! Toutes les autres variables prennent un flux nul (sauf la vitesse
+! normale, qui est nulle) : par defaut dans typecl pour isymet.
+
+!===============================================================================
+! 4. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE/SORTIE
+! ETAPE DE THERMO
+!===============================================================================
+
+
+!===============================================================================
+! 4.1 Entree/sortie impos�e (par exemple : entree supersonique)
+!===============================================================================
+
+ elseif ( itypfb(ifac,iphas).eq.iesicf ) then
+
+! On a
+! - la vitesse,
+! - 2 variables parmi P, rho, T, E (mais pas (T,E)),
+! - la turbulence
+! - les scalaires
+
+! On recherche la variable a initialiser
+! (si on a donne une valeur nulle, c'est pas adapte : on supposera
+! qu'on n'a pas initialise et on sort en erreur)
+ iccfth = 10000
+ if(rcodcl(ifac,ipriph,1).gt.0.d0) iccfth = 2*iccfth
+ if(rcodcl(ifac,irhiph,1).gt.0.d0) iccfth = 3*iccfth
+ if(rcodcl(ifac,itkiph,1).gt.0.d0) iccfth = 5*iccfth
+ if(rcodcl(ifac,ieniph,1).gt.0.d0) iccfth = 7*iccfth
+ if((iccfth.le.70000.and.iccfth.ne.60000).or. &
+ (iccfth.eq.350000)) then
+ write(nfecra,1000)iccfth
+ call csexit (1)
+ endif
+ iccfth = iccfth + 900
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! On traite d'abord les variables autres que la turbulence et les
+! scalaires passifs : celles-ci sont traitees plus bas.
+ do iii = 1, nvarcf
+ ivar = ivarcf(iii)
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+! On calcule les variables manquantes parmi P,rho,T,E
+! COEFA sert de tableau de transfert dans USCFTH
+
+ do ivar = 1, nvar
+ coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
+ enddo
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , ifac , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+
+! Rusanov, flux de masse et type de conditions aux limites :
+! voir plus bas
+
+
+!===============================================================================
+! 4.2 Sortie supersonique
+!===============================================================================
+
+ elseif ( itypfb(ifac,iphas).eq.isspcf ) then
+
+! On impose un Dirichlet �gal � la valeur interne pour rho u E
+! (on impose des Dirichlet d�duit pour les autres variables).
+! Il est inutile de passer dans Rusanov.
+! Il serait n�cessaire de reconstruire ces valeurs en utilisant
+! leur gradient dans la cellule de bord : dans un premier temps,
+! on utilise des valeurs non reconstruites (non consistant mais
+! potentiellement plus stable).
+! On pourrait imposer des flux nuls (a tester), ce qui �viterait
+! la n�cessit� de reconstruire les valeurs.
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! On traite d'abord les variables autres que la turbulence et les
+! scalaires passifs : celles-ci sont traitees plus bas.
+ do iii = 1, nvarcf
+ ivar = ivarcf(iii)
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+! Valeurs de rho u E
+ rcodcl(ifac,irhiph,1) = rtp(iel,irhiph)
+ rcodcl(ifac,iuiph ,1) = rtp(iel,iuiph)
+ rcodcl(ifac,iviph ,1) = rtp(iel,iviph)
+ rcodcl(ifac,iwiph ,1) = rtp(iel,iwiph)
+ rcodcl(ifac,ieniph,1) = rtp(iel,ieniph)
+
+! Valeurs de P et s d�duites
+ iccfth = 924
+
+ do ivar = 1, nvar
+ coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
+ enddo
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , ifac , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+! flux de masse et type de conditions aux limites :
+! voir plus bas
+
+
+!===============================================================================
+! 4.3 Sortie a pression imposee
+!===============================================================================
+
+ elseif ( itypfb(ifac,iphas).eq.isopcf ) then
+
+! Sortie subsonique a priori (si c'est supersonique dans le
+! domaine, ce n'est pas pour autant que c'est supersonique
+! � la sortie, selon la pression que l'on a impos�e)
+
+! On utilise un scenario dans lequel on a une 1-d�tente et un
+! 2-contact entrant dans le domaine. On d�termine les conditions
+! sur l'interface selon la thermo et on passe dans Rusanov
+! ensuite pour lisser.
+
+! Si P n'est pas donn�, erreur ; on sort aussi en erreur si P
+! n�gatif, m�me si c'est possible, dans la plupart des cas ce
+! sera une erreur
+ if(rcodcl(ifac,ipriph,1).lt.-rinfin*0.5d0) then
+ write(nfecra,1100)
+ call csexit (1)
+ endif
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! On traite d'abord les variables autres que la turbulence et les
+! scalaires passifs : celles-ci sont traitees plus bas.
+ do iii = 1, nvarcf
+ ivar = ivarcf(iii)
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+! Valeurs de rho, u, E, s
+ iccfth = 93
+
+ do ivar = 1, nvar
+ coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
+ enddo
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , ifac , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+! Rusanov, flux de masse et type de conditions aux limites :
+! voir plus bas
+
+
+!===============================================================================
+! 4.4 Entree � rho et U imposes
+!===============================================================================
+
+ elseif ( itypfb(ifac,iphas).eq.ierucf ) then
+
+! Entree subsonique a priori (si c'est supersonique dans le
+! domaine, ce n'est pas pour autant que c'est supersonique
+! � l'entree, selon les valeurs que l'on a impos�es)
+
+! On utilise un scenario d�tente ou choc.
+! On d�termine les conditions sur l'interface
+! selon la thermo et on passe dans Rusanov ensuite pour lisser.
+
+! Si rho et u ne sont pas donn�s, erreur
+ if(rcodcl(ifac,irhiph,1).lt.-rinfin*0.5d0.or. &
+ rcodcl(ifac,iuiph ,1).lt.-rinfin*0.5d0.or. &
+ rcodcl(ifac,iviph ,1).lt.-rinfin*0.5d0.or. &
+ rcodcl(ifac,iwiph ,1).lt.-rinfin*0.5d0) then
+ write(nfecra,1200)
+ call csexit (1)
+ endif
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! On traite d'abord les variables autres que la turbulence et les
+! scalaires passifs : celles-ci sont traitees plus bas.
+ do iii = 1, nvarcf
+ ivar = ivarcf(iii)
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+! Valeurs de P, E, s
+ iccfth = 92
+
+ do ivar = 1, nvar
+ coefa(ifac,iclrtp(ivar,icoef)) = rcodcl(ifac,ivar,1)
+ enddo
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , ifac , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+! Rusanov, flux de masse et type de conditions aux limites :
+! voir plus bas
+
+
+!===============================================================================
+! 4.5 Entree � rho*U et rho*U*H imposes
+!===============================================================================
+
+ elseif ( itypfb(ifac,iphas).eq.ieqhcf ) then
+
+! Entree subsonique a priori (si c'est supersonique dans le
+! domaine, ce n'est pas pour autant que c'est supersonique
+! � l'entree, selon les valeurs que l'on a impos�es)
+
+! On utilise un scenario dans lequel on a un 2-contact et une
+! 3-d�tente entrant dans le domaine. On d�termine les conditions
+! sur l'interface selon la thermo et on passe dans Rusanov
+! ensuite pour lisser.
+
+! Si rho et u ne sont pas donn�s, erreur
+ if(rcodcl(ifac,irun (iphas),1).lt.-rinfin*0.5d0.or. &
+ rcodcl(ifac,irunh(iphas),1).lt.-rinfin*0.5d0) then
+ write(nfecra,1300)
+ call csexit (1)
+ endif
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! On traite d'abord les variables autres que la turbulence et les
+! scalaires passifs : celles-ci sont traitees plus bas.
+ do iii = 1, nvarcf
+ ivar = ivarcf(iii)
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+! A coder
+
+! Noter que IRUN(IPHAS) = ISCA(IRHO (IPHAS))
+! et IRUNH(IPHAS) = ISCA(IENER(IPHAS))
+! (aliases pour simplifier uscfcl)
+
+ write(nfecra,1301)
+ call csexit (1)
+
+!===============================================================================
+! 5. CONDITION NON PREVUE
+!===============================================================================
+! Stop
+ else
+
+ write(nfecra,1400)
+ call csexit (1)
+
+! --- Fin de test sur les types de faces
+ endif
+
+
+!===============================================================================
+! 6. FIN DU TRAITEMENT DES ENTREE/SORTIES
+! CALCUL DU FLUX DE MASSE,
+! CALCUL DES FLUX DE BORD AVEC RUSANOV (SI BESOIN)
+! TYPE DE C .L. (DIRICHLET NEUMANN)
+!===============================================================================
+
+ if ( ( itypfb(ifac,iphas).eq.iesicf ) .or. &
+ ( itypfb(ifac,iphas).eq.isspcf ) .or. &
+ ( itypfb(ifac,iphas).eq.isopcf ) .or. &
+ ( itypfb(ifac,iphas).eq.ierucf ) .or. &
+ ( itypfb(ifac,iphas).eq.ieqhcf ) ) then
+
+!===============================================================================
+! 6.1 Flux de bord Rusanov ou simplement flux de masse
+! Attention a bien avoir calcule gamma pour Rusanov
+!===============================================================================
+
+! Sortie supersonique :
+ if ( itypfb(ifac,iphas).eq.isspcf ) then
+
+! Seul le flux de masse est calcule (on n'appelle pas Rusanov)
+! (toutes les variables sont connues)
+
+ propfb(ifac,iflmab) = coefa(ifac,iclr)* &
+ ( coefa(ifac,iclu)*surfbo(1,ifac) &
+ + coefa(ifac,iclv)*surfbo(2,ifac) &
+ + coefa(ifac,iclw)*surfbo(3,ifac) )
+
+! Entree subsonique
+
+ else if ( itypfb(ifac,iphas).eq.ierucf ) then
+
+! Seul le flux de masse est calcule (on n'appelle pas Rusanov)
+
+ propfb(ifac,iflmab) = coefa(ifac,iclr)* &
+ ( coefa(ifac,iclu)*surfbo(1,ifac) &
+ + coefa(ifac,iclv)*surfbo(2,ifac) &
+ + coefa(ifac,iclw)*surfbo(3,ifac) )
+
+
+
+! Autres entrees/sorties :
+ else
+
+! On calcule des flux par Rusanov (PROPFB)
+! (en particulier, le flux de masse est complete)
+
+ call cfrusb &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ifac , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ gammag , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+!===============================================================================
+! 6.2 Recuperation de COEFA
+!===============================================================================
+
+! On r�tablit COEFA dans RCODCL
+ do ivar = 1, nvar
+ rcodcl(ifac,ivar,1) = coefa(ifac,iclrtp(ivar,icoef))
+ enddo
+
+!===============================================================================
+! 6.3 Types de C.L.
+!===============================================================================
+
+! P : Dirichlet sauf IESICF : Neumann (choix arbitraire)
+! rho, U, E, T : Dirichlet
+! k, R, eps, scal : Dirichlet/Neumann selon flux de masse
+
+! Pour P, le Neumann est cens� etre moins genant pour les
+! reconstructions de gradient si la valeur de P fournie par
+! l'utilisateur est tres differente de la valeur interne.
+! Le choix est cependant arbitraire.
+
+! On suppose que par defaut,
+! RCODCL(IFAC,X,1) = utilisateur ou calcule ci-dessus
+! RCODCL(IFAC,X,2) = RINFIN
+! RCODCL(IFAC,X,3) = 0.D0
+! et si ICODCL(IFAC,X) = 3, seul RCODCL(IFAC,X,3) est utilis�
+
+
+!-------------------------------------------------------------------------------
+! Pression : Dirichlet ou Neumann homogene
+!-------------------------------------------------------------------------------
+
+! Entree sortie imposee : Neumann
+ if ( itypfb(ifac,iphas).eq.iesicf ) then
+ icodcl(ifac,ipriph) = 3
+! Entree subsonique
+ else if ( itypfb(ifac,iphas).eq.ierucf ) then
+ icodcl(ifac,ipriph) = 3
+ rcodcl(ifac,ipriph,3) = 0.d0
+! Autres entrees/sorties : Dirichlet
+ else
+ icodcl(ifac,ipriph) = 1
+ endif
+
+!-------------------------------------------------------------------------------
+! rho U E T : Dirichlet
+!-------------------------------------------------------------------------------
+
+! Masse volumique
+ icodcl(ifac,irhiph) = 1
+! Vitesse
+ icodcl(ifac,iuiph) = 1
+ icodcl(ifac,iviph) = 1
+ icodcl(ifac,iwiph) = 1
+! Energie totale
+ icodcl(ifac,ieniph) = 1
+! Temperature
+ icodcl(ifac,itkiph) = 1
+
+!-------------------------------------------------------------------------------
+! turbulence et scalaires passifs : Dirichlet/Neumann selon flux
+!-------------------------------------------------------------------------------
+
+! Dirichlet ou Neumann homog�ne
+! On choisit un Dirichlet si le flux de masse est entrant et
+! que l'utilisateur a donn� une valeur dans RCODCL
+
+ if(propfb(ifac,iflmab).ge.0.d0) then
+ if(itytur(iphas).eq.2) then
+ icodcl(ifac,ik (iphas)) = 3
+ icodcl(ifac,iep(iphas)) = 3
+ elseif(itytur(iphas).eq.3) then
+ icodcl(ifac,ir11(iphas)) = 3
+ icodcl(ifac,ir22(iphas)) = 3
+ icodcl(ifac,ir33(iphas)) = 3
+ icodcl(ifac,ir12(iphas)) = 3
+ icodcl(ifac,ir13(iphas)) = 3
+ icodcl(ifac,ir23(iphas)) = 3
+ icodcl(ifac,iep (iphas)) = 3
+ elseif(iturb(iphas).eq.50) then
+ icodcl(ifac,ik (iphas)) = 3
+ icodcl(ifac,iep (iphas)) = 3
+ icodcl(ifac,iphi(iphas)) = 3
+ icodcl(ifac,ifb (iphas)) = 3
+ elseif(iturb(iphas).eq.60) then
+ icodcl(ifac,ik (iphas)) = 3
+ icodcl(ifac,iomg(iphas)) = 3
+ endif
+ if(nscaus.gt.0) then
+ do ii = 1, nscaus
+ icodcl(ifac,isca(ii)) = 3
+ enddo
+ endif
+ else
+ if(itytur(iphas).eq.2) then
+ if(rcodcl(ifac,ik (iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,iep(iphas),1).gt.0.d0) then
+ icodcl(ifac,ik (iphas)) = 1
+ icodcl(ifac,iep(iphas)) = 1
+ else
+ icodcl(ifac,ik (iphas)) = 3
+ icodcl(ifac,iep(iphas)) = 3
+ endif
+ elseif(itytur(iphas).eq.3) then
+ if(rcodcl(ifac,ir11(iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,ir22(iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,ir33(iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,ir12(iphas),1).gt.-rinfin*0.5d0.and. &
+ rcodcl(ifac,ir13(iphas),1).gt.-rinfin*0.5d0.and. &
+ rcodcl(ifac,ir23(iphas),1).gt.-rinfin*0.5d0.and. &
+ rcodcl(ifac,iep (iphas),1).gt.0.d0) then
+ icodcl(ifac,ir11(iphas)) = 1
+ icodcl(ifac,ir22(iphas)) = 1
+ icodcl(ifac,ir33(iphas)) = 1
+ icodcl(ifac,ir12(iphas)) = 1
+ icodcl(ifac,ir13(iphas)) = 1
+ icodcl(ifac,ir23(iphas)) = 1
+ icodcl(ifac,iep (iphas)) = 1
+ else
+ icodcl(ifac,ir11(iphas)) = 3
+ icodcl(ifac,ir22(iphas)) = 3
+ icodcl(ifac,ir33(iphas)) = 3
+ icodcl(ifac,ir12(iphas)) = 3
+ icodcl(ifac,ir13(iphas)) = 3
+ icodcl(ifac,ir23(iphas)) = 3
+ icodcl(ifac,iep (iphas)) = 3
+ endif
+ elseif(iturb(iphas).eq.50) then
+ if(rcodcl(ifac,ik (iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,iep (iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,iphi(iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,ifb (iphas),1).gt.-rinfin*0.5d0 ) then
+ icodcl(ifac,ik (iphas)) = 1
+ icodcl(ifac,iep (iphas)) = 1
+ icodcl(ifac,iphi(iphas)) = 1
+ icodcl(ifac,ifb (iphas)) = 1
+ else
+ icodcl(ifac,ik (iphas)) = 3
+ icodcl(ifac,iep (iphas)) = 3
+ icodcl(ifac,iphi(iphas)) = 3
+ icodcl(ifac,ifb (iphas)) = 3
+ endif
+ elseif(iturb(iphas).eq.60) then
+ if(rcodcl(ifac,ik (iphas),1).gt.0.d0.and. &
+ rcodcl(ifac,iomg(iphas),1).gt.0.d0 ) then
+ icodcl(ifac,ik (iphas)) = 1
+ icodcl(ifac,iomg(iphas)) = 1
+ else
+ icodcl(ifac,ik (iphas)) = 3
+ icodcl(ifac,iomg(iphas)) = 3
+ endif
+ endif
+ if(nscaus.gt.0) then
+ do ii = 1, nscaus
+ if(rcodcl(ifac,isca(ii),1).gt.-rinfin*0.5d0) then
+ icodcl(ifac,isca(ii)) = 1
+ else
+ icodcl(ifac,isca(ii)) = 3
+ endif
+ enddo
+ endif
+ endif
+
+
+! Les RCODCL ont ete initialises a -RINFIN pour permettre de
+! verifier ceux que l'utilisateur a modifies. On les remet a zero
+! si l'utilisateur ne les a pas modifies.
+! On traite la turbulence et les scalaires passifs (pour
+! simplifier la boucle, on traite toutes les variables : les
+! variables du compressible sont donc vues deux fois, mais ce
+! n'est pas grave).
+ do ivar = 1, nvar
+ if(rcodcl(ifac,ivar,1).le.-rinfin*0.5d0) then
+ rcodcl(ifac,ivar,1) = 0.d0
+ endif
+ enddo
+
+
+! --- Fin de test sur les faces d'entree sortie
+ endif
+
+! --- Fin de boucle sur les faces de bord
+ enddo
+
+! --- Fin de boucle sur les phases
+enddo
+
+!----
+! FORMATS
+!----
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION ',/,&
+'@ ========= ',/,&
+'@ Deux variables independantes et deux seulement parmi ',/,&
+'@ P, rho, T et E doivent etre imposees aux bords de type ',/,&
+'@ IESICF dans uscfcl (ICCFTH = ',I10,'). ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans uscfcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION ',/,&
+'@ ========= ',/,&
+'@ La pression n''a pas ete fournie en sortie a pression ',/,&
+'@ impos�e. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans uscfcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION ',/,&
+'@ ========= ',/,&
+'@ La masse volumique ou la vitesse n''a pas �t� fournie ',/,&
+'@ en entree a masse volumique et vitesse imposee. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans uscfcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1300 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION ',/,&
+'@ ========= ',/,&
+'@ Le debit massique ou le debit enthalpique n''a pas �t� ',/,&
+'@ fourni en entree a debit massique et enthalpique impos�.',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans uscfcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1301 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION ',/,&
+'@ ========= ',/,&
+'@ Entree � debit massique et debit enthalpique non prevue ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement pour uscfcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1400 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION ',/,&
+'@ ========= ',/,&
+'@ Une condition a la limite ne fait pas partie des ',/,&
+'@ conditions aux limites predefinies en compressible. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans uscfcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION ',/,&
+'@ ========= ',/,&
+'@ cfxtcl doit etre modifie pour prendre en compte une loi ',/,&
+'@ d''etat a gamma variable. Seul est pris en compte le ',/,&
+'@ cas IEOS = 1 ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier IEOS dans uscfth. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cfbl/memcfe.f90 b/src/cfbl/memcfe.f90
new file mode 100644
index 0000000..b13dd06
--- /dev/null
+++ b/src/cfbl/memcfe.f90
@@ -0,0 +1,120 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memcfe &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwb , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE AVANT APPEL USCFTH DANS ENERGI
+! RESERVATION TAB DE TRAV FACES DE BORD
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iwb ! e ! --> ! pointeur de wb (tab travail nfabor) !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ra en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! - REMARQUE : INTERDICTION DE TOUCHER A IDBIA0 IDBRA0
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+integer iwb
+integer ifinia , ifinra
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+
+iwb = idebra
+ifinra = iwb + nfabor
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMCFE',IFINIA)
+!==========
+
+CALL RASIZE('MEMCFE',IFINRA)
+!==========
+
+return
+end
diff --git a/src/cfbl/memcfm.f90 b/src/cfbl/memcfm.f90
new file mode 100644
index 0000000..ba5ddcf
--- /dev/null
+++ b/src/cfbl/memcfm.f90
@@ -0,0 +1,170 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memcfm &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , &
+ iw7 , iw8 , iw9 , iw10 , iw11 , iw12 , &
+ iwflms , iwflmb , &
+ icoefu , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE POUR L'EQUATION SUR LA MASSE VOLUMIQUE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtr ! e ! --> ! "pointeur" sur dtr !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! iw1,2,...,12 ! e ! --> ! "pointeur" sur w1 a w12 !
+! iwflms,b ! e ! --> ! "pointeur" sur wflmas et wflmab !
+! icoefu ! e ! --> ! "pointeur" sur coefu !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idtr
+integer iviscf , iviscb , idam , ixam
+integer idrtp , ismbr , irovsd
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9 , iw10 , iw11 , iw12
+integer iwflms , iwflmb
+integer icoefu
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+iw1 = irovsd + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+iw10 = iw9 + ncelet
+iw11 = iw10 + ncelet
+iw12 = iw11 + ncelet
+iwflms = iw12 + ncelet
+iwflmb = iwflms + nfac
+icoefu = iwflmb + nfabor
+ifinra = icoefu + nfabor*ndim
+
+!---> VERIFICATION
+
+CALL RASIZE('MEMCFM',IFINRA)
+!==========
+
+return
+end
diff --git a/src/cfbl/memcft.f90 b/src/cfbl/memcft.f90
new file mode 100644
index 0000000..f9dfa10
--- /dev/null
+++ b/src/cfbl/memcft.f90
@@ -0,0 +1,141 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memcft &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iw7 , iw8 , iw9 , iw10 , iw11 , iw12 , &
+ iviscf , icoefu , ixam , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE DANS CFDTTV POUR MEMCFT
+
+! (APPELE PAR DTTVAR EN COMPRESSIBLE SANS CHOC)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iw7..12 ! e ! --> ! "pointeurs" sur w7 a w12 !
+! iviscf ! e ! --> ! "pointeur" sur viscf !
+! icoefu ! e ! --> ! "pointeur" sur coefu !
+! ixam ! e ! --> ! "pointeur" sur xam !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! e ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! e ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer iw7 , iw8 , iw9 , iw10 , iw11 , iw12
+integer iviscf , icoefu , ixam
+integer ifinia , ifinra
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+
+iw7 = idebra
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+iw10 = iw9 + ncelet
+iw11 = iw10 + ncelet
+iw12 = iw11 + ncelet
+iviscf = iw12 + ncelet
+icoefu = iviscf + nfac
+ixam = icoefu + nfabor*3
+ifinra = ixam + nfac*2
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMCFT',IFINIA)
+!==========
+
+CALL RASIZE('MEMCFT',IFINRA)
+!==========
+
+return
+end
diff --git a/src/cfbl/memcfv.f90 b/src/cfbl/memcfv.f90
new file mode 100644
index 0000000..e413aef
--- /dev/null
+++ b/src/cfbl/memcfv.f90
@@ -0,0 +1,124 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memcfv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwcel1 , iwcel2 , iwcel3 , iwcel4 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE AVANT APPEL USCFTH DANS CFINIV
+! RESERVATION TAB DE TRAV CELLULE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iwcel1 ! e ! --> ! pointeur de w1 (tab travail ncelet) !
+! iwceli ! e ! --> ! pointeur de wi (tab travail ncelet) !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ra en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! - REMARQUE : INTERDICTION DE TOUCHER A IDBIA0 IDBRA0
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer nideve , nrdeve , nituse , nrtuse
+integer iwcel1 , iwcel2 , iwcel3 , iwcel4
+integer ifinia , ifinra
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifinia = idebia
+
+iwcel1 = idebra
+iwcel2 = iwcel1 + ncelet
+iwcel3 = iwcel2 + ncelet
+iwcel4 = iwcel3 + ncelet
+ifinra = iwcel4 + ncelet
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMCFV',IFINIA)
+!==========
+
+CALL RASIZE('MEMCFV',IFINRA)
+!==========
+
+return
+end
diff --git a/src/cogz/Makefile.am b/src/cogz/Makefile.am
new file mode 100644
index 0000000..9953398
--- /dev/null
+++ b/src/cogz/Makefile.am
@@ -0,0 +1,94 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/cogz/coincl.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcscogz.la
+libcscogz_la_SOURCES = \
+coini1.f90 \
+colecd.f90 \
+coprop.f90 \
+cothht.f90 \
+covarp.f90 \
+d3phst.f90 \
+d3pini.f90 \
+d3pint.f90 \
+d3pphy.f90 \
+d3ptcl.f90 \
+d3pver.f90 \
+ebuini.f90 \
+ebuphy.f90 \
+ebutcl.f90 \
+ebutss.f90 \
+ebuver.f90 \
+lwcgfu.f90 \
+lwcini.f90 \
+lwcphy.f90 \
+lwctcl.f90 \
+lwctss.f90 \
+lwcurl.f90 \
+lwcver.f90 \
+pdflwc.f90 \
+pdfpp3.f90 \
+pdfpp4.f90
+libcscogz_la_LDFLAGS = -no-undefined
+
+libcscogz_la_SOURCES += \
+$(top_srcdir)/users/cogz/usd3p1.f90 \
+$(top_srcdir)/users/cogz/usd3pc.f90 \
+$(top_srcdir)/users/cogz/usd3pi.f90 \
+$(top_srcdir)/users/cogz/usebu1.f90 \
+$(top_srcdir)/users/cogz/usebuc.f90 \
+$(top_srcdir)/users/cogz/usebui.f90 \
+$(top_srcdir)/users/cogz/uslwc1.f90 \
+$(top_srcdir)/users/cogz/uslwcc.f90 \
+$(top_srcdir)/users/cogz/uslwci.f90
+
+cogzdir = $(pkgdatadir)/users/cogz
+cogz_DATA = \
+$(top_srcdir)/users/cogz/usd3p1.f90 \
+$(top_srcdir)/users/cogz/usd3pc.f90 \
+$(top_srcdir)/users/cogz/usd3pi.f90 \
+$(top_srcdir)/users/cogz/usebu1.f90 \
+$(top_srcdir)/users/cogz/usebuc.f90 \
+$(top_srcdir)/users/cogz/usebui.f90 \
+$(top_srcdir)/users/cogz/uslwc1.f90 \
+$(top_srcdir)/users/cogz/uslwcc.f90 \
+$(top_srcdir)/users/cogz/uslwci.f90
diff --git a/src/cogz/Makefile.in b/src/cogz/Makefile.in
new file mode 100644
index 0000000..0354695
--- /dev/null
+++ b/src/cogz/Makefile.in
@@ -0,0 +1,665 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/cogz
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcscogz_la_LIBADD =
+am_libcscogz_la_OBJECTS = coini1.lo colecd.lo coprop.lo cothht.lo \
+ covarp.lo d3phst.lo d3pini.lo d3pint.lo d3pphy.lo d3ptcl.lo \
+ d3pver.lo ebuini.lo ebuphy.lo ebutcl.lo ebutss.lo ebuver.lo \
+ lwcgfu.lo lwcini.lo lwcphy.lo lwctcl.lo lwctss.lo lwcurl.lo \
+ lwcver.lo pdflwc.lo pdfpp3.lo pdfpp4.lo usd3p1.lo usd3pc.lo \
+ usd3pi.lo usebu1.lo usebuc.lo usebui.lo uslwc1.lo uslwcc.lo \
+ uslwci.lo
+libcscogz_la_OBJECTS = $(am_libcscogz_la_OBJECTS)
+libcscogz_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcscogz_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcscogz_la_SOURCES)
+DIST_SOURCES = $(libcscogz_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(cogzdir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+cogzDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(cogz_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/cogz/coincl.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcscogz.la
+libcscogz_la_SOURCES = coini1.f90 colecd.f90 coprop.f90 cothht.f90 \
+ covarp.f90 d3phst.f90 d3pini.f90 d3pint.f90 d3pphy.f90 \
+ d3ptcl.f90 d3pver.f90 ebuini.f90 ebuphy.f90 ebutcl.f90 \
+ ebutss.f90 ebuver.f90 lwcgfu.f90 lwcini.f90 lwcphy.f90 \
+ lwctcl.f90 lwctss.f90 lwcurl.f90 lwcver.f90 pdflwc.f90 \
+ pdfpp3.f90 pdfpp4.f90 $(top_srcdir)/users/cogz/usd3p1.f90 \
+ $(top_srcdir)/users/cogz/usd3pc.f90 \
+ $(top_srcdir)/users/cogz/usd3pi.f90 \
+ $(top_srcdir)/users/cogz/usebu1.f90 \
+ $(top_srcdir)/users/cogz/usebuc.f90 \
+ $(top_srcdir)/users/cogz/usebui.f90 \
+ $(top_srcdir)/users/cogz/uslwc1.f90 \
+ $(top_srcdir)/users/cogz/uslwcc.f90 \
+ $(top_srcdir)/users/cogz/uslwci.f90
+libcscogz_la_LDFLAGS = -no-undefined
+cogzdir = $(pkgdatadir)/users/cogz
+cogz_DATA = \
+$(top_srcdir)/users/cogz/usd3p1.f90 \
+$(top_srcdir)/users/cogz/usd3pc.f90 \
+$(top_srcdir)/users/cogz/usd3pi.f90 \
+$(top_srcdir)/users/cogz/usebu1.f90 \
+$(top_srcdir)/users/cogz/usebuc.f90 \
+$(top_srcdir)/users/cogz/usebui.f90 \
+$(top_srcdir)/users/cogz/uslwc1.f90 \
+$(top_srcdir)/users/cogz/uslwcc.f90 \
+$(top_srcdir)/users/cogz/uslwci.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cogz/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/cogz/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcscogz.la: $(libcscogz_la_OBJECTS) $(libcscogz_la_DEPENDENCIES)
+ $(libcscogz_la_LINK) $(libcscogz_la_OBJECTS) $(libcscogz_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+usd3p1.lo: $(top_srcdir)/users/cogz/usd3p1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usd3p1.lo `test -f '$(top_srcdir)/users/cogz/usd3p1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/usd3p1.f90
+
+usd3pc.lo: $(top_srcdir)/users/cogz/usd3pc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usd3pc.lo `test -f '$(top_srcdir)/users/cogz/usd3pc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/usd3pc.f90
+
+usd3pi.lo: $(top_srcdir)/users/cogz/usd3pi.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usd3pi.lo `test -f '$(top_srcdir)/users/cogz/usd3pi.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/usd3pi.f90
+
+usebu1.lo: $(top_srcdir)/users/cogz/usebu1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usebu1.lo `test -f '$(top_srcdir)/users/cogz/usebu1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/usebu1.f90
+
+usebuc.lo: $(top_srcdir)/users/cogz/usebuc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usebuc.lo `test -f '$(top_srcdir)/users/cogz/usebuc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/usebuc.f90
+
+usebui.lo: $(top_srcdir)/users/cogz/usebui.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usebui.lo `test -f '$(top_srcdir)/users/cogz/usebui.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/usebui.f90
+
+uslwc1.lo: $(top_srcdir)/users/cogz/uslwc1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslwc1.lo `test -f '$(top_srcdir)/users/cogz/uslwc1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/uslwc1.f90
+
+uslwcc.lo: $(top_srcdir)/users/cogz/uslwcc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslwcc.lo `test -f '$(top_srcdir)/users/cogz/uslwcc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/uslwcc.f90
+
+uslwci.lo: $(top_srcdir)/users/cogz/uslwci.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslwci.lo `test -f '$(top_srcdir)/users/cogz/uslwci.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cogz/uslwci.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-cogzDATA: $(cogz_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(cogzdir)" || $(MKDIR_P) "$(DESTDIR)$(cogzdir)"
+ @list='$(cogz_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(cogzDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(cogzdir)/$$f'"; \
+ $(cogzDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(cogzdir)/$$f"; \
+ done
+
+uninstall-cogzDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(cogz_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(cogzdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(cogzdir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(cogzdir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-cogzDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-cogzDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-cogzDATA install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-saturneincludeHEADERS \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-cogzDATA uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/cogz/coini1.f90 b/src/cogz/coini1.f90
new file mode 100644
index 0000000..efc62ed
--- /dev/null
+++ b/src/cogz/coini1.f90
@@ -0,0 +1,752 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine coini1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR
+! POUR LA COMBUSTION
+! FLAMME DE DIFFUSION ET DE PREMELANGE
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer ipp , ii , jj, iok, idirac
+integer isc , iphas
+double precision wmolme
+
+!===============================================================================
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+ endif
+enddo
+do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ call csexit (1)
+ !==========
+ endif
+enddo
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! 1.1 Definition des scamin et des scamax des variables transportees
+! ==================================================================
+
+! --> Flamme de diffusion : chimie 3 points
+
+if ( ippmod(icod3p).ge.0 ) then
+
+! ---- Taux de melange
+ scamin(ifm) = 0.d0
+ scamax(ifm) = 1.d0
+
+! ---- Variance du taux de melange
+! Type de clipping superieur pour la variance
+! 0 pas de clipping, 1 clipping var max de fm, 2 clipping a SCAMAX
+ iclvfl(ifp2m) = 1
+! SCAMIN(IFP2M) = 0.D0
+! SCAMAX(IFP2M) = 0.25D0
+
+! ---- Enthalpie
+ if ( ippmod(icod3p).eq.1 ) then
+ scamin(ihm) = -grand
+ scamax(ihm) = +grand
+ endif
+
+endif
+
+
+! --> Flamme de premelange : modele EBU
+
+if ( ippmod(icoebu).ge.0 ) then
+
+! ---- Fraction massique des gaz frais
+ scamin(iygfm) = 0.d0
+ scamax(iygfm) = 1.d0
+
+! ---- Taux de melange
+ if ( ippmod(icoebu).eq.2 .or. &
+ ippmod(icoebu).eq.3 ) then
+ scamin(ifm) = 0.d0
+ scamax(ifm) = 1.d0
+ endif
+
+! ---- Enthalpie
+ if ( ippmod(icoebu).eq.1 .or. &
+ ippmod(icoebu).eq.3 ) then
+ scamin(ihm) = -grand
+ scamax(ihm) = +grand
+ endif
+
+endif
+
+
+! --> Flamme de premelange : modele LWC
+
+if ( ippmod(icolwc).ge.0 ) then
+ scamin(ifm) = 0.d0
+ scamax(ifm) = 1.d0
+
+ iclvfl(ifp2m) = 0
+
+ scamin(iyfm) = 0.d0
+ scamax(iyfm) = 1.d0
+
+ iclvfl(iyfp2m) = 0
+
+ if ( ippmod(icolwc).ge.2 ) then
+ scamin(icoyfp) =-0.25d0
+ scamax(icoyfp) = 0.25d0
+ endif
+
+endif
+
+! 1.2 Nature des scalaires transportes
+! ====================================
+
+do isc = 1, nscapp
+
+
+! ---- Type de scalaire (0 passif, 1 temperature en K
+! -1 temperature en C
+! 2 enthalpie)
+! La distinction -1/1 sert pour le rayonnement
+ iscsth(iscapp(isc)) = 0
+
+enddo
+
+
+! 1.3 L'utilisation de la variable enthalpie necessite un traitement
+! particulier
+! ==================================================================
+
+
+! ---- On resout en enthalpie avec un CP constant (Cf. cpvarp)
+if ( ippmod(icod3p).eq.1 .or. &
+ ippmod(icoebu).eq.1 .or. &
+ ippmod(icoebu).eq.3 .or. &
+ ippmod(icolwc).eq.1 .or. &
+ ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) then
+
+ iphas = iphsca(ihm)
+
+ iscalt(iphas) = ihm
+ iscsth(ihm) = 2
+
+endif
+
+
+! 1.4 Donnees physiques ou numeriques propres aux scalaires COMBUSTION
+! ====================================================================
+
+do isc = 1, nscapp
+
+ jj = iscapp(isc)
+
+ if ( iscavr(jj).le.0 ) then
+
+! ---- En combustion on considere que la viscosite turbulente domine
+! ON S'INTERDIT DONC LE CALCUL DES FLAMMES LAMINAIRES AVEC Le =/= 1
+
+ visls0(jj) = viscl0(iphsca(jj))
+
+ endif
+
+! ---- Schmidt ou Prandtl turbulent
+
+ sigmas(jj) = 0.7d0
+
+! ---- Coeff dissipation des fluctuations
+
+ rvarfl(jj) = 0.8d0
+
+ ii = isca(iscapp(isc))
+
+! ------ Niveau de detail des impressions pour les variables et
+! donc les scalaires (valeurs 0 ou 1)
+! Si = -10000 non modifie par l'utilisateur -> niveau 1
+ if(iwarni(ii).eq.-10000) then
+ iwarni(ii) = 1
+ endif
+
+! ---- Informations relatives a la resolution des scalaires
+
+! - Facteur multiplicatif du pas de temps
+
+ cdtvar(ii) = 1.d0
+
+! - Schema convectif % schema 2ieme ordre
+! = 0 : upwind
+! = 1 : second ordre
+ blencv(ii) = 1.d0
+
+! - Type de schema convetif second ordre (utile si BLENCV > 0)
+! = 0 : Second Order Linear Upwind
+! = 1 : Centre
+ ischcv(ii) = 1
+
+! - Test de pente pour basculer d'un schema centre vers l'upwind
+! = 0 : utilisation automatique du test de pente
+! = 1 : calcul sans test de pente
+ isstpc(ii) = 0
+
+! - Reconstruction des flux de convetion et de diffusion aux faces
+! = 0 : pas de reconstruction
+ ircflu(ii) = 1
+
+enddo
+
+
+! 1.5 Variable courante : nom, sortie chrono, suivi listing, sortie histo
+
+! Comme pour les autres variables,
+! si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! NOMVAR( ) = nom de la variable
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes
+
+! NB : Les 8 premiers caracteres du noms seront repris dans le
+! listing 'developpeur'
+
+! =======================================================================
+
+! --> Flamme de diffusion : chimie 3 points - chmie equilibre
+
+if ( ippmod(icod3p).ge.0 ) then
+
+! ---- Taux de melange
+ ipp = ipprtp(isca(ifm))
+ NOMVAR(IPP) = 'Fra_MEL'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! ---- Variance du taux melange
+ ipp = ipprtp(isca(ifp2m))
+ NOMVAR(IPP) = 'Var_FrMe'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+endif
+
+
+! --> Flamme de premelange : Modele EBU
+
+if ( ippmod(icoebu).ge.0 ) then
+
+! ---- Fraction massique des gaz frais
+ ipp = ipprtp(isca(iygfm))
+ NOMVAR(IPP) = 'Fra_GF'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! ---- Taux de melange
+if ( ippmod(icoebu).ge.2 ) then
+ ipp = ipprtp(isca(ifm))
+ NOMVAR(IPP) = 'Fra_MEL'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+
+! --> Flamme de premelange : Modeles BML et LWC
+
+if ( ippmod(icolwc).ne.-1 ) then
+! --- Taux de melange
+ ipp = ipprtp(isca(ifm))
+ NOMVAR(IPP) = 'Fra_Mel'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+! --- Variance du taux de melange
+ ipp = ipprtp(isca(ifp2m))
+ NOMVAR(IPP) = 'Var_FMe'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+! --- Fraction massique
+ ipp = ipprtp(isca(iyfm))
+ NOMVAR(IPP) = 'Fra_Mas'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+! --- Variance de la fraction massique
+ ipp = ipprtp(isca(iyfp2m))
+ NOMVAR(IPP) = 'Var_FMa'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+! --- Covariance
+ if (ippmod(icolwc).ge.2) then
+ ipp = ipprtp(isca(icoyfp))
+ NOMVAR(IPP) = 'COYF_PP4'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+
+endif
+! --> Si Transport de l'enthalpie
+
+ if ( ippmod(icod3p).eq.1 .or. &
+ ippmod(icoebu).eq.1 .or. &
+ ippmod(icoebu).eq.3 .or. &
+ ippmod(icolwc).eq.1 .or. &
+ ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) then
+ ipp = ipprtp(isca(ihm))
+ NOMVAR(IPP) = 'Enthalpy'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! --> Flamme de diffusion :
+
+if ( ippmod(icod3p).ge.0 ) then
+ ipp = ipppro(ipproc(itemp))
+ NOMVAR(IPP) = 'Temperature'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(1)))
+ NOMVAR(IPP) = 'YM_Fuel'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(2)))
+ NOMVAR(IPP) = 'YM_Oxyd'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(3)))
+ NOMVAR(IPP) = 'YM_Prod'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+endif
+
+! ---> Physique particuliere : Flamme de premelange (modele EBU)
+
+if ( ippmod(icoebu).ge.0 ) then
+ ipp = ipppro(ipproc(itemp))
+ NOMVAR(IPP) = 'Temperature'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(1)))
+ NOMVAR(IPP) = 'YM_Fuel'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(2)))
+ NOMVAR(IPP) = 'YM_Oxyd'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(3)))
+ NOMVAR(IPP) = 'YM_Prod'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+endif
+
+! ---> Physique particuliere : Flamme de premelange (modele LWC)
+
+if ( ippmod(icolwc).ge. 0 ) then
+ ipp = ipppro(ipproc(itsc))
+ NOMVAR(IPP) = 'T.SOURCE'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(itemp))
+ NOMVAR(IPP) = 'Temperature'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(1)))
+ NOMVAR(IPP) = 'YM_Fuel'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(2)))
+ NOMVAR(IPP) = 'YM_Oxyd'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(iym(3)))
+ NOMVAR(IPP) = 'YM_Prod'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ do idirac = 1, ndirac
+ ipp = ipppro(ipproc(irhol(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'RHOL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(iteml(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'TEML',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(ifmel(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'FMEL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(ifmal(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'FMAL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(iampl(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'AMPL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(itscl(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'TSCL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(imaml(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'MAML',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ enddo
+
+endif
+
+! ---> Physique particuliere : Flamme de diffusion (chimie 3 points)
+! Flamme de premelange (modele EBU 1 et 3)
+! Flamme de premelange (modele LWC 1, 3 et 5)
+! AVEC RAYONNEMENT
+
+if ( ( ippmod(icod3p).eq.1 .or. &
+ ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 .or. &
+ ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) &
+ .and. (iirayo.ge.1) ) then
+ ipp = ipppro(ipproc(ickabs))
+ NOMVAR(IPP) = 'KABS'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(it4m))
+ NOMVAR(IPP) = 'TEMP4'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(it3m))
+ NOMVAR(IPP) = 'TEMP3'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+endif
+
+
+!===============================================================================
+! 3. INFORMATIONS COMPLEMENTAIRES
+!===============================================================================
+
+! --> Calcul de RO0 a partir de T0 et P0
+
+ iphas = 1
+ if ( ippmod(icod3p).ne.-1 .or. &
+ ippmod(icoebu).ne.-1 .or. &
+ ippmod(icolwc).ne.-1 ) then
+ wmolme = wmolg(2)
+ ro0(iphas) = p0(iphas)*wmolme / (rr*t0(iphas))
+ endif
+
+! On met les constantes a -GRAND pour obliger l'utilisateur a les definir
+! (ou les laisser) dans usebu1, usd3p1 ou uslwc1.
+! --> Constante modele EBU par defaut
+cebu =-grand
+
+! --> Constantes modele LWC par defaut
+vref =-grand
+lref =-grand
+ta =-grand
+tstar =-grand
+
+! --> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+srrom =-grand
+
+! --> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 =-grand
+
+! --> Diffusion 3 points, tableaux HH HF THF
+! (generes dans d3pphy)
+
+nmaxf = 9
+nmaxh = 9
+
+! ---> Masse volumique variable et viscosite constante (pour les suites)
+irovar(iphas) = 1
+ivivar(iphas) = 0
+
+!===============================================================================
+! 4. ON REDONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+if ( ippmod(icoebu).ge.0 ) then
+ call usebu1
+ !==========
+else if( ippmod(icod3p).ge.0 ) then
+ call usd3p1
+ !==========
+else if( ippmod(icolwc).ge.0 ) then
+ call uslwc1
+! ==========
+endif
+
+!===============================================================================
+! 5. VERIFICATION DES DONNERS FOURNIES PAR L'UTLISATEUR
+!===============================================================================
+
+iok = 0
+if ( ippmod(icoebu).ge.0 ) then
+
+ call ebuver (iok)
+ !==========
+ if(iok.gt.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+ !==========
+ else
+ write(nfecra,9998)
+ endif
+
+else if( ippmod(icod3p).ge.0 ) then
+ call d3pver (iok)
+ !==========
+ if(iok.gt.0) then
+ write(nfecra,9991)iok
+ call csexit (1)
+ else
+ write(nfecra,9990)
+ endif
+
+else if( ippmod(icolwc).ge.0 ) then
+ call lwcver (iok)
+ !==========
+ if(iok.gt.0) then
+ write(nfecra,9993)iok
+ call csexit (1)
+ else
+ write(nfecra,9992)
+ endif
+
+endif
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (usebu1).',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier usebu1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9990 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (usd3p1).',/)
+ 9991 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier usd3p1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9992 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (uslwc1).',/)
+ 9993 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier uslwc1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+return
+end
diff --git a/src/cogz/colecd.f90 b/src/cogz/colecd.f90
new file mode 100644
index 0000000..7ab4e1c
--- /dev/null
+++ b/src/cogz/colecd.f90
@@ -0,0 +1,685 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine colecd
+!================
+!===============================================================================
+! FONCTION :
+! ---------
+
+! LECTURE DU FICHIER DE DONNEES PHYSIQUE PARTICULIERE
+! RELATIF A LA COMBUSTION GAZ
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+! VARIABLES LOCALES
+
+character*150 chain1,chain2
+character*12 nomcoe(ngazem)
+
+integer it, igg, ir, ige, iat, ios
+integer ncgm, nrgm
+integer inicoe , inicha
+integer idebch , ifinch , lonch
+integer ichai , ichcoe
+integer atgaze(ngazem,natom)
+integer igoxy(nrgazm), igfuel(nrgazm)
+integer ncoel
+integer iico2 , iih2o
+
+double precision tmin , tmax
+double precision kabse(ngazem)
+double precision compog(ngazem,ngazgm)
+double precision ehcoel (ngazem,npot) , wmolce (ngazem)
+double precision cpcoel(ngazem)
+double precision mfuel, mreac, epsi, nmolg, bilan
+double precision moxyd
+
+!===============================================================================
+!===============================================================================
+! -0. INITIALISATION et VERIFICATIONS
+!===============================================================================
+
+
+epsi = 1.d-9
+
+
+if (indjon.ne.1.and.indjon.ne.0) then
+ write(nfecra,9900) indjon
+ call csexit (1)
+ !==========
+endif
+
+!===============================================================================
+! -1. UTILISATION DE JANAF
+!===============================================================================
+
+if (indjon.eq.1) then
+
+
+! 1.1 LECTURE DU FICHIER DONNEES SPECIFIQUES
+!===================================================
+
+! --> Ouverture du fichier
+
+ open ( unit=impfpp, file=ficfpp, &
+ STATUS='OLD', FORM='FORMATTED', ACCESS='SEQUENTIAL', &
+ iostat=ios, err=99 )
+ rewind ( unit=impfpp,err=99 )
+
+! --> On se limite pour l'instant a de la combustion gaz
+! Plus exactement a une flamme de diffusion chimie 3 corps
+! et a une flamme de premelange modele EBU
+! --------------------------------------------------------
+
+! --> Lecture des donnees
+
+! ---- Nb de constituants gazeux elementaires
+
+ read ( impfpp,*,err=999,end=999 ) ngaze
+ if ( ngaze.gt.ngazem ) then
+ write(nfecra,9990) ngazem,ngaze
+ call csexit (1)
+ !==========
+ endif
+
+! ---- Nb de points de tabulation ENTH-TEMP
+
+ read ( impfpp,*,err=999,end=999 ) npo
+ if ( npo.gt.npot ) then
+ write(nfecra,9991) npot, npo
+ call csexit (1)
+ !==========
+ endif
+
+! --- Temperature Min et Max
+
+ read (impfpp,*,err=999,end=999) tmin
+ read (impfpp,*,err=999,end=999) tmax
+
+! ---- Lecture des noms des constituants elementaires gazeux
+
+ do ige=1 , ngaze
+ do inicoe=1,len(nomcoe(ige))
+ NOMCOE(IGE)(INICOE:INICOE)=' '
+ enddo
+ enddo
+
+ do inicha=1,len(chain1)
+ CHAIN1(INICHA:INICHA)=' '
+ enddo
+
+ do inicha=1,len(chain2)
+ CHAIN2(INICHA:INICHA)=' '
+ enddo
+
+ read ( impfpp,*,err=999,end=999 )
+ read ( impfpp,1010,err=999,end=999 ) chain1
+ call verlon (chain1 , idebch , ifinch , lonch)
+ chain2(1:lonch)=chain1(idebch:ifinch)
+
+ ige =1
+ ichcoe=0
+ do ichai = 1, lonch
+ IF (CHAIN2(ICHAI:ICHAI).NE.' ') THEN
+ ichcoe=ichcoe+1
+ nomcoe(ige)(ichcoe:ichcoe)=chain2(ichai:ichai)
+ else
+ if (ichcoe.ne.0) then
+ ige=ige+1
+ ichcoe=0
+ endif
+ endif
+ enddo
+
+ 1010 format(a150)
+
+
+! ---- Rayonnement
+! Le rayonnement n'est autorise qu'avec des modeles permeatiques,
+! car en adiabatique l'enthalpie est une grandeur algebrique qui
+! ne prend pas en compte les pertes par rayonnement.
+
+ if ( iirayo.gt.0 .and. ippmod(icod3p).ne.1 &
+ .and. ippmod(icoebu).ne.1 .and. ippmod(icoebu).ne.3 &
+ .and. ippmod(icolwc).ne.1 .and. ippmod(icolwc).ne.3 &
+ .and. ippmod(icolwc).ne.5 ) then
+ write(nfecra,9993) &
+ iirayo,ippmod(icod3p),ippmod(icoebu),ippmod(icolwc)
+ call csexit (1)
+ !==========
+ endif
+
+! ---- Coefficient d'absorption des especes courantes
+
+ read (impfpp,*,err=999,end=999 ) &
+ ( kabse(ige),ige=1,ngaze )
+
+! ---- Nb especes atomiques (C, H, O, N, ...)
+
+ read (impfpp,*,err=999,end=999 ) nato
+ if ( nato.gt.natom ) then
+ write(nfecra,9994) natom,nato
+ call csexit (1)
+ !==========
+ endif
+
+! ---- Masse molaire especes atomiques
+! Composition des especes courantes en fonction des especes
+! elementaires
+
+ do iat = 1, nato
+ read (impfpp,*,err=999,end=999 ) wmolat(iat), &
+ ( atgaze(ige,iat),ige=1,ngaze )
+ enddo
+
+! ---- Nb especes globales
+
+ read (impfpp,*,err=999,end=999 ) ngazg
+! On ne considere qu'UNE SEULE REACTION GLOBALE
+! NGAZG = NCGM = 3 par consequent (F, O, P)
+ ncgm = 3
+ if ( ngazg.ne.ncgm ) then
+ write(nfecra,9995) ncgm,ngazg
+ call csexit (1)
+ !==========
+ endif
+
+! ---- Composition des especes globales en fonction des especes
+! courantes
+
+ do igg = 1, ngazg
+ read (impfpp,*,err=999,end=999 ) &
+ ( compog(ige,igg),ige=1,ngaze )
+ enddo
+
+! ----- Nb de reactions globales
+
+ read (impfpp,*,err=999,end=999 ) nrgaz
+! On ne considere qu'UNE SEULE REACTION GLOBALE
+ nrgm = 1
+ if ( nrgaz.ne.nrgm ) then
+ write(nfecra,9996) nrgm,nrgaz
+ call csexit (1)
+ !==========
+ endif
+
+! ---- No des especes concernees par la rapport stoechio
+! Stoechio en especes globales des reactions
+
+ do ir = 1, nrgaz
+ read (impfpp,*,err=999,end=999 ) &
+ igfuel(ir),igoxy(ir),( stoeg(igg,ir),igg=1,ngazg )
+ enddo
+
+! --> Fermeture du fichier
+
+ close(impfpp)
+
+! 1.2 CALCULS DE DONNEES COMPLEMENTAIRES
+!===============================================
+
+! ---- Calcul des masses molaires des especes courantes
+
+ do ige = 1, ngaze
+ wmole(ige) = 0.d0
+ do iat = 1, nato
+ wmole(ige)= wmole(ige) + atgaze(ige,iat)*wmolat(iat)
+ enddo
+ enddo
+
+! --- Discretisation de la temperature
+
+ do it = 1, npo
+ th(it) = dble(it-1)*(tmax-tmin)/dble(npo-1)+tmin
+ enddo
+
+! ---Calcul des enthalpies par appel a la subroutine PPTBHT
+
+ ncoel = ngaze
+ do ige = 1, ngaze
+ wmolce(ige) = wmole (ige)
+ enddo
+
+ call pptbht &
+ !==========
+ ( ncoel , &
+ nomcoe , ehcoel , cpcoel , wmolce )
+
+ do ige = 1 ,ngaze
+ do it = 1 , npo
+ ehgaze(ige,it) = ehcoel (ige,it)
+ enddo
+ enddo
+
+! ---- Calcul des masses molaires des especes globales
+! de la tabulation temperature - enthalpie massique
+! et des coefficients d'absorption des especes globales
+! si RAYONNEMENT
+
+ do igg = 1 , ngazg
+ wmolg(igg) = 0.d0
+ nmolg = 0.d0
+ do ige = 1 , ngaze
+ wmolg(igg) = wmolg(igg)+compog(ige,igg)*wmole(ige)
+ nmolg = nmolg + compog(ige,igg)
+ enddo
+ do it = 1,npo
+ ehgazg(igg,it) = 0.d0
+ if ( ( ippmod(icod3p).eq.1 .or. &
+ ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 .or. &
+ ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) &
+ .and. (iirayo.ge.1) ) then
+ ckabsg(igg) = 0.d0
+ endif
+ do ige = 1 , ngaze
+ ehgazg(igg,it) = ehgazg(igg,it) &
+ + compog(ige,igg)*wmole(ige)*ehgaze(ige,it)
+ if ( ( ippmod(icod3p).eq.1 .or. &
+ ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 .or. &
+ ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) &
+ .and. (iirayo.ge.1) ) then
+ ckabsg(igg) = ckabsg(igg) &
+ + compog(ige,igg)*kabse(ige)*wmole(ige)
+ endif
+ enddo
+ ehgazg(igg,it) = ehgazg(igg,it)/wmolg(igg)
+ if ( ( ippmod(icod3p).eq.1 .or. &
+ ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 .or. &
+ ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) &
+ .and. (iirayo.ge.1) ) then
+ ckabsg(igg) = ckabsg(igg)/wmolg(igg)
+ endif
+ enddo
+ wmolg(igg) = wmolg(igg) / nmolg
+ do ige = 1 , ngaze
+ compog(ige,igg) = compog(ige,igg) / nmolg
+ enddo
+ enddo
+
+! ---- Calcul des coefficients molaires XCO2 , XH2O
+
+ do ige = 1 , ngaze
+ IF (NOMCOE(IGE)(1:3).EQ.'CO2') IICO2=IGE
+ IF (NOMCOE(IGE)(1:3).EQ.'H2O') IIH2O=IGE
+ enddo
+
+ xco2 = compog(iico2,3)
+ xh2o = compog(iih2o,3)
+
+! ---- Calcul bilan pour verification
+! et taux de melange a la stochio pour chaque reaction
+
+ do ir = 1, nrgaz
+ do iat = 1, nato
+ bilan = 0.d0
+ do igg = 1, ngazg
+ do ige = 1, ngaze
+ bilan = bilan &
+ + stoeg(igg,ir)*compog(ige,igg)*atgaze(ige,iat)
+ enddo
+ enddo
+ if ( abs(bilan) .gt. epsi ) then
+ write(nfecra,9997) ir, iat
+ call csexit (1)
+ !==========
+ endif
+ enddo
+ mfuel = stoeg(igfuel(ir),ir)*wmolg(igfuel(ir))
+ moxyd = stoeg(igoxy(ir),ir)*wmolg(igoxy(ir))
+ mreac = mfuel + moxyd
+ fs(ir) = mfuel/mreac
+ enddo
+
+! ---- Calcul des coefficients de la fraction massique d'oxydant
+! du programme pdflwc
+
+ coeff1 = compog(2,2)*wmole(2)/wmolg(2)
+
+ coeff3 = moxyd / mfuel
+
+ coeff2 = coeff3*coeff1
+
+!===============================================================================
+! -2. UTILISATION D'UNE TABULATION ENTHALPIE-TEMPERATURE
+!===============================================================================
+
+else
+
+ open ( unit=impfpp, file=ficfpp, &
+ STATUS='OLD', FORM='FORMATTED', ACCESS='SEQUENTIAL', &
+ iostat=ios, err=99 )
+ rewind ( unit=impfpp,err=99 )
+
+! ---- Nb de points de tabulation ENTH-TEMP
+
+ read ( impfpp,*,err=999,end=999 ) npo
+ if ( npo.gt.npot ) then
+ write(nfecra,9991) npot, npo
+ call csexit (1)
+ !==========
+ endif
+
+! --- Tabulation ENTH-TEMP pour les especes globales
+
+ do it = 1, npo
+ read (impfpp,*,err=999,end=999) th(it), &
+ ehgazg(1,it),ehgazg(2,it),ehgazg(3,it)
+ enddo
+
+! On ne considere qu'UNE SEULE REACTION GLOBALE
+! NGAZG = NCGM = 3 par consequent (F, O, P)
+ ngazg = 3
+
+! On ne considere qu'UNE SEULE REACTION GLOBALE
+ nrgaz = 1
+
+! --- Masses molaires pour les especes globales
+
+ read (impfpp,*,err=999,end=999) wmolg(1),wmolg(2),wmolg(3)
+
+! --- Fraction de melange a la stoechiometrie
+
+ read (impfpp,*,err=999,end=999) fs(1)
+
+! --- Rayonnement
+
+ if ( iirayo.gt.0 .and. ippmod(icod3p).ne.1 &
+ .and. ippmod(icoebu).ne.1 .and. ippmod(icoebu).ne.3 &
+ .and. ippmod(icolwc).ne.1 .and. ippmod(icolwc).ne.3 &
+ .and. ippmod(icolwc).ne.5 ) then
+ write(nfecra,9993) &
+ iirayo,ippmod(icod3p),ippmod(icoebu),ippmod(icolwc)
+ call csexit (1)
+ !==========
+ endif
+
+! --- Coefficients d'absorption des especes globales
+
+ read (impfpp,*,err=999,end=999) ckabsg(1),ckabsg(2),ckabsg(3)
+
+! --- Coefficients molaires de CO2 et H2O dans les produits
+! (pour le rayonnement)
+
+ read (impfpp,*,err=999,end=999) xco2, xh2o
+
+
+! ---> Fermeture du fichier
+
+ close (impfpp)
+
+
+! ---- Calcul des coefficients de la fraction massique d oxydant
+! on consid�re que l'oxydant est un m�lange d'O2 et N2
+
+ coeff1 = ((wmolg(2)-0.028)/(0.032-0.028))* (0.032/wmolg(2))
+
+ coeff3 = (1-fs(1))/fs(1)
+
+ coeff2 = coeff3*coeff1
+
+endif
+
+
+return
+
+!============================
+! 3. SORTIE EN ERREUR
+!============================
+
+ 99 continue
+write ( nfecra,9998 )
+call csexit (1)
+!==========
+
+ 999 continue
+write ( nfecra,9999 )
+call csexit (1)
+!==========
+
+
+!--------
+! FORMATS
+!--------
+
+
+ 9900 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ L''indicateur INDJON doit etre un entier de valeur ',/,&
+'@ 1 (utilisation de Janaf) ou 0 (tabulation utilisateur). ',/,&
+'@ ',/,&
+'@ Il vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier INDJON dans usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9990 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes courantes doit etre ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9991 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Le nombre de points de tabulation est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9993 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ LE RAYONNEMENT NE PEUT ETRE ACTIVE QU''AVEC UN MODELE DE ',/,&
+'@ COMBUSTION EN CONDITIONS PERMEATIQUES. ',/,&
+'@ ',/,&
+'@ Un mode de rayonnement a ete specifie ',/,&
+'@ IIRAYO = ',I10 ,/,&
+'@ Or dans usppmo on a : ',/,&
+'@ IPPMOD(ICOD3P) = ',I10 ,/,&
+'@ IPPMOD(ICOEBU) = ',I10 ,/,&
+'@ IPPMOD(ICOLWC) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique et usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9994 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes elementaires est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9995 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes globales doit etre ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9996 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Le nombre de reactions globales doit etre ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9997 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Probleme de conservation rencontre dans la ',/,&
+'@ reaction ',I10 ,' pour l''element ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9998 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Erreur a l''ouverture du fichier parametrique. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (COLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (COMBUSTION GAZ) ',/,&
+'@ ',/,&
+'@ Erreur a la lecture du fichier parametrique. ',/,&
+'@ Le fichier a ete ouvert mais est peut etre incomplet ',/,&
+'@ ou son format inadapte. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+end
+
+
diff --git a/src/cogz/coprop.f90 b/src/cogz/coprop.f90
new file mode 100644
index 0000000..f02fcbb
--- /dev/null
+++ b/src/cogz/coprop.f90
@@ -0,0 +1,516 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine coprop &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT POUR
+! POUR LA COMBUSTION
+! FLAMME DE DIFFUSION ET DE PREMELANGE
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! <-- ! numero de la derniere propriete !
+! ! ! ! (les proprietes sont dans propce, !
+! ! ! ! propfa ou prpfb) !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp, ipppst
+
+! VARIABLES LOCALES
+
+integer iprop, icg, idirac
+
+!===============================================================================
+!===============================================================================
+! 1. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFA, PROPFB
+! Physique particuliere : Flamme de diffusion chimie 3 points
+!===============================================================================
+
+if ( ippmod(icod3p).ge.0 ) then
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+
+ iprop = ipropp
+
+ iprop = iprop + 1
+ itemp = iprop
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ iym(icg) = iprop
+ enddo
+ if ( ippmod(icod3p).eq.1 .and. iirayo.gt.0 ) then
+ iprop = iprop + 1
+ ickabs= iprop
+ iprop = iprop + 1
+ it4m = iprop
+ iprop = iprop + 1
+ it3m = iprop
+ endif
+
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+ nsalpp = iprop - ipropp
+ nsalto = iprop
+
+! ---- On renvoie IPROPP au cas ou d'autres proprietes devraient
+! etre numerotees ensuite
+
+ ipropp = iprop
+
+
+! ---> Positionnement dans le tableau PROPCE
+! et reperage du rang pour le post-traitement
+
+ iprop = nproce
+
+ iprop = iprop + 1
+ ipproc(itemp) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ ipproc(iym(icg)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ enddo
+
+ if ( ippmod(icod3p).eq.1 .and. iirayo.gt.0 ) then
+
+ iprop = iprop + 1
+ ipproc(ickabs) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(it4m) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(it3m) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ endif
+
+ nproce = iprop
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+ iprop = nprofb
+ if ( ippmod(icod3p).eq.1 .and. iirayo.gt.0 ) then
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ ipprob(iym(icg)) = iprop
+ enddo
+ endif
+ nprofb = iprop
+
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+ iprop = nprofa
+! Exemple INUTILE DANS NOTRE CAS
+! IPROP = IPROP + 1
+! IPPROF(ITEMP) = IPROP
+ nprofa = iprop
+
+ endif
+
+
+
+!===============================================================================
+! 2. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFA, PROPFB
+! Physique particuliere : Flamme de diffusion chimie equilibre
+!===============================================================================
+
+! IF ( LPP(IDEQA).OR.LPP(IDEQR) ) THEN
+! ENDIF
+
+
+
+!===============================================================================
+! 3. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFA, PROPFB
+! Physique particuliere : Flamme de premelange - Modele EBU
+!===============================================================================
+
+if ( ippmod(icoebu).ge.0 ) then
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+ iprop = ipropp
+
+ iprop = iprop + 1
+ itemp = iprop
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ iym(icg) = iprop
+ enddo
+ if ( ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) &
+ .and. ( iirayo.gt.0 ) ) then
+ iprop = iprop + 1
+ ickabs= iprop
+ iprop = iprop + 1
+ it4m = iprop
+ iprop = iprop + 1
+ it3m = iprop
+ endif
+
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+ nsalpp = iprop - ipropp
+ nsalto = iprop
+
+! ---- On renvoie IPROPP au cas ou d'autres proprietes devraient
+! etre numerotees ensuite
+
+ ipropp = iprop
+
+
+! ---> Positionnement dans le tableau PROPCE
+! et reperage du rang pour le post-traitement
+
+ iprop = nproce
+
+ iprop = iprop + 1
+ ipproc(itemp) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ ipproc(iym(icg)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ enddo
+
+ if ( ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) &
+ .and. ( iirayo.gt.0 ) ) then
+
+ iprop = iprop + 1
+ ipproc(ickabs) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(it4m) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(it3m) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ endif
+
+ nproce = iprop
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+ iprop = nprofb
+ if ( ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) &
+ .and. ( iirayo.gt.0 ) ) then
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ ipprob(iym(icg)) = iprop
+ enddo
+ endif
+ nprofb = iprop
+
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+ iprop = nprofa
+! Exemple INUTILE DANS NOTRE CAS
+! IPROP = IPROP + 1
+! IPPROF(ITEMP) = IPROP
+ nprofa = iprop
+
+ endif
+
+
+
+!===============================================================================
+! 4. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFA, PROPFB
+! Physique particuliere : Flamme de premelange - Modele BML
+!===============================================================================
+
+! IF ( IPPMOD(ICOBML).GE.0 ) THEN
+! ENDIF
+
+
+
+!===============================================================================
+! 5. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFA, PROPFB
+! Physique particuliere : Flamme de premelange - Modele LWC
+!===============================================================================
+
+if ( ippmod(icolwc).ge.0 ) then
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+ iprop = ipropp
+
+ iprop = iprop + 1
+ itemp = iprop
+
+ iprop = iprop + 1
+ imam = iprop
+
+ iprop = iprop + 1
+ itsc = iprop
+
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ iym(icg) = iprop
+ enddo
+
+ do idirac = 1, ndirac
+! masse volumique Locale
+ iprop = iprop + 1
+ irhol(idirac) = iprop
+! Temperature L .
+ iprop = iprop + 1
+ iteml(idirac) = iprop
+! Fraction de Melange L.
+ iprop = iprop + 1
+ ifmel(idirac) = iprop
+! Fraction Massique L.
+ iprop = iprop + 1
+ ifmal(idirac) = iprop
+! Amplitude L.
+ iprop = iprop + 1
+ iampl(idirac) = iprop
+! Terme Source Chimique L.
+ iprop = iprop + 1
+ itscl(idirac) = iprop
+! MAsse Molaire L.
+ iprop = iprop + 1
+ imaml(idirac) = iprop
+ enddo
+
+ if ( ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 &
+ .or. ippmod(icolwc).eq.5 ) &
+ .and. ( iirayo.gt.0 ) ) then
+ iprop = iprop + 1
+ ickabs= iprop
+ iprop = iprop + 1
+ it4m = iprop
+ iprop = iprop + 1
+ it3m = iprop
+ endif
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+ nsalpp = iprop - ipropp
+ nsalto = iprop
+
+
+! ---> Positionnement dans le tableau PROPCE
+
+ iprop = nproce
+
+ iprop = iprop + 1
+ ipproc(itemp) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(imam) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(itsc) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ ipproc(iym(icg)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ enddo
+
+ do idirac = 1, ndirac
+ iprop = iprop + 1
+ ipproc(irhol(idirac)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(iteml(idirac)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(ifmel(idirac)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(ifmal(idirac)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(iampl(idirac)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(itscl(idirac)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(imaml(idirac)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ enddo
+
+ if ( ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 &
+ .or. ippmod(icolwc).eq.5 ) &
+ .and. ( iirayo.gt.0 ) ) then
+
+ iprop = iprop + 1
+ ipproc(ickabs) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(it4m) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(it3m) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ endif
+
+ nproce = iprop
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+ iprop = nprofb
+ if ( ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 &
+ .or. ippmod(icolwc).eq.5) &
+ .and. ( iirayo.gt.0 ) ) then
+ do icg = 1, ngazg
+ iprop = iprop + 1
+ ipprob(iym(icg)) = iprop
+ enddo
+ endif
+ nprofb = iprop
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+ iprop = nprofa
+! Exemple INUTILE DANS NOTRE CAS
+! IPROP = IPROP + 1
+! IPPROF(ITEMP) = IPROP
+ nprofa = iprop
+
+endif
+
+
+return
+
+end
diff --git a/src/cogz/cothht.f90 b/src/cogz/cothht.f90
new file mode 100644
index 0000000..9b316bc
--- /dev/null
+++ b/src/cogz/cothht.f90
@@ -0,0 +1,207 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cothht &
+!================
+
+ ( mode , nespec , nespem , xespec , &
+ npo , npot , th , eh , &
+ enthal , temper )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CETTE FONCTION CALCULE L'ENTHALPIE A PARTIR DE LA
+! COMPOSITION ET DE LA VALEUR DE LA TEMPERATURE
+! SPECIFIQUE A LA COMBUSTION GAZ
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! mode ! e ! <-- ! -1 : t -> h ; 1 : h -> t !
+! nespec ! e ! <-- ! nb de constituants !
+! nespem ! e ! <-- ! nb maximal de constituants !
+! xespec ! tr ! <-- ! fraction massique des constituants !
+! npo ! e ! <-- ! nombre de ponits de tabulation !
+! npot ! e ! <-- ! nombre maximal de ponits !
+! ! ! ! de tabulation !
+! th ! tr ! <-- ! tabulation temperature en kelvin !
+! eh ! tr ! <-- ! tabulation enthalpie - temperature !
+! enthal ! r ! <-- ! enthalpie massique j/kg !
+! temper ! r ! <-- ! temperature en kelvin !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+
+!===============================================================================
+
+
+! Arguments
+
+integer mode , npo , npot , nespec , nespem
+
+double precision xespec(nespem)
+double precision th(npot) , eh(nespem,npot)
+double precision temper , enthal
+
+! VARIABLES LOCALES
+
+integer it , iesp
+
+double precision eh1 , eh0
+
+!===============================================================================
+!===============================================================================
+! 1. CALCUL DE L'ENTHALPIE A PARTIR DE LA TEMPERATURE
+!===============================================================================
+
+if ( mode.eq.-1 ) then
+
+ it = npo
+ if ( temper.ge.th(it) ) then
+ enthal = zero
+ do iesp = 1, nespec
+ enthal = enthal + xespec(iesp)*eh(iesp,it)
+ enddo
+ go to 11
+ endif
+
+ it = 1
+ if ( temper.le.th(it) ) then
+ enthal = zero
+ do iesp = 1, nespec
+ enthal = enthal + xespec(iesp)*eh(iesp,it)
+ enddo
+ go to 11
+ endif
+ 10 continue
+
+ it = it + 1
+ if ( temper.le.th(it) ) then
+ eh0 = zero
+ eh1 = zero
+ do iesp = 1, nespec
+ eh0 = eh0 + xespec(iesp)*eh(iesp,it-1)
+ eh1 = eh1 + xespec(iesp)*eh(iesp,it )
+ enddo
+ enthal = eh0 &
+ + (eh1-eh0)*(temper-th(it-1))/(th(it)-th(it-1))
+ goto 11
+ endif
+ goto 10
+ 11 continue
+
+
+!===============================================================================
+! 2. CALCUL DE LA TEMPERATURE A PARTIR DE l'ENTHALPIE
+!===============================================================================
+
+else if ( mode.eq.1 ) then
+
+ it = npo-1
+ eh1 = zero
+ do iesp = 1, nespec
+ eh1 = eh1 + xespec(iesp)*eh(iesp,it+1)
+ enddo
+ if ( enthal.ge.eh1 ) temper = th(it+1)
+
+ it = 1
+ eh0 = zero
+ do iesp = 1, nespec
+ eh0 = eh0 + xespec(iesp)*eh(iesp,it )
+ enddo
+ if ( enthal.le.eh0 ) temper = th(it)
+
+ do it = 1, npo-1
+ eh0 = zero
+ eh1 = zero
+ do iesp = 1, nespec
+ eh0 = eh0 + xespec(iesp)*eh(iesp,it )
+ eh1 = eh1 + xespec(iesp)*eh(iesp,it+1)
+ enddo
+ if ( enthal.ge.eh0 .and. enthal.le.eh1 ) &
+ temper = th(it) &
+ + (enthal-eh0)*(th(it+1)-th(it))/(eh1-eh0)
+ enddo
+
+
+else
+
+ write(nfecra,1000) mode
+ call csexit (1)
+ !==========
+
+
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS COTHHT ',/,&
+'@ ========= ',/,&
+'@ VALEUR INCORRECTE DE L''ARGUMENT MODE ',/,&
+'@ CE DOIT ETRE UN ENTIER EGAL A 1 OU -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/covarp.f90 b/src/cogz/covarp.f90
new file mode 100644
index 0000000..491e6f4
--- /dev/null
+++ b/src/cogz/covarp.f90
@@ -0,0 +1,183 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine covarp
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES SELON
+! POUR LA COMBUSTION
+! FLAMME DE DIFFUSION ET DE PREMELANGE
+! REMPLISSAGE DES PARAMETRES (DEJA DEFINIS) POUR LES SCALAIRES PP
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer isc, iphas
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! 1.1 Flamme de diffusion : chimie 3 points
+! =========================================
+
+if ( ippmod(icod3p).ge.0 ) then
+
+! ---- Taux de melange
+ ifm = iscapp(1)
+
+! ---- Variance du taux de melange
+ ifp2m = iscapp(2)
+ iscavr(ifp2m) = ifm
+
+! ---- Enthalpie
+ if ( ippmod(icod3p).eq.1 ) ihm = iscapp(3)
+endif
+
+
+! 1.2 Flamme de premelange : modele EBU
+! =====================================
+
+if ( ippmod(icoebu).ge.0 ) then
+
+! ---- Fraction massique des gaz frais
+ iygfm = iscapp(1)
+ if ( ippmod(icoebu).eq.2 .or. &
+ ippmod(icoebu).eq.3 ) then
+
+! ---- Taux de melange
+ ifm = iscapp(2)
+ endif
+ if ( ippmod(icoebu).eq.1 ) ihm = iscapp(2)
+ if ( ippmod(icoebu).eq.3 ) ihm = iscapp(3)
+endif
+
+
+! 1.3 Flamme de premelange : modele BML A DEVELOPPER
+! ==================================================
+
+! 1.4 Flamme de premelange : modele LWC
+! =====================================
+
+if (ippmod(icolwc).ge.0 ) then
+
+ ifm = iscapp(1)
+ ifp2m = iscapp(2)
+ iscavr(ifp2m) = ifm
+
+ iyfm = iscapp(3)
+ iyfp2m = iscapp(4)
+ iscavr(iyfp2m)= iyfm
+
+ if (ippmod(icolwc).ge.2 ) then
+ icoyfp = iscapp(5)
+ endif
+
+ if (ippmod(icolwc).eq.1 ) ihm = iscapp(5)
+ if (ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) ihm = iscapp(6)
+
+endif
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+! A RENSEIGNER OBLIGATOIREMENT (sinon pb dans varpos)
+! IPHSCA, IVISLS, ICP
+!===============================================================================
+
+do isc = 1, nscapp
+
+ if ( iscavr(iscapp(isc)).le.0 ) then
+
+! ---- Notre physque particuliere est monophasique
+ iphsca(iscapp(isc)) = 1
+
+! ---- Viscosite dynamique de reference relative au scalaire
+! ISCAPP(ISC)
+ ivisls(iscapp(isc)) = 0
+
+ endif
+
+enddo
+
+if ( ippmod(icod3p).eq.1 .or. &
+ ippmod(icoebu).eq.1 .or. &
+ ippmod(icoebu).eq.3 .or. &
+ ippmod(icolwc).eq.1 .or. &
+ ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) then
+
+
+! ---- Bien que l on soit en enthalpie on conserve un CP constant
+
+ iphas = iphsca(ihm)
+ icp(iphas) = 0
+
+endif
+
+return
+end
+
diff --git a/src/cogz/d3phst.f90 b/src/cogz/d3phst.f90
new file mode 100644
index 0000000..3071b3a
--- /dev/null
+++ b/src/cogz/d3phst.f90
@@ -0,0 +1,218 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine d3phst &
+!================
+
+ ( ncelet , ncel , indpdf , &
+ dirmin , dirmax , fdeb , ffin , hrec , &
+ fm , hm , &
+ hstoe )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME DE DIFFUSION
+! CALCUL DE L'ENTHALPIE STOECHIOMETRIQUE LOCALE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! indpdf ! te ! <-- ! indicateur passage ou non par les pdf !
+! dirmin ! tr ! <-- ! pdf : dirac en fmin !
+! dirmax ! tr ! <-- ! pdf : dirac en fmax !
+! fdeb ! tr ! <-- ! pdf : abscisse debut rectangle !
+! ffin ! tr ! <-- ! pdf : abscisse fin rectangle !
+! hrec ! tr ! <-- ! pdf : hauteur rectangle !
+! fm ! tr ! <-- ! fraction de melange moyenne !
+! hm ! tr ! <-- ! enthalpie massique moyenne !
+! ! ! ! si ecoulement permeatique !
+! hstoe ! tr ! <-- ! enthalpie stoechiometrique !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+! Arguments
+
+integer ncelet, ncel
+integer indpdf(ncelet)
+double precision dirmin(ncelet), dirmax(ncelet)
+double precision fdeb(ncelet), ffin(ncelet), hrec(ncelet)
+double precision fm(ncelet), hm(ncelet), hstoe(ncelet)
+
+
+! VARIABLES LOCALES
+
+integer icel
+double precision fsir, hhh, hct, f1, f2
+double precision epsi
+
+integer n1, n2
+double precision hsmax, hsmin
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+epsi = 1.d-6
+fsir = fs(1)
+
+n1 = 0
+n2 = 0
+hsmin = grand
+hsmax =-grand
+
+
+do icel = 1, ncel
+
+ if ( indpdf(icel) .eq. 0 ) then
+
+!===============================================================================
+! 1. DETERMINATION DE HSTOE SANS INTEGRATION
+!===============================================================================
+
+ if ( fm(icel).le.fsir .and. fm(icel).gt.epsi ) then
+ hstoe(icel) = ( fsir*hm(icel)+(fm(icel)-fsir)*hinoxy ) &
+ / fm(icel)
+ elseif( fm(icel).lt.(1.d0-epsi) ) then
+ hstoe(icel) = ((1.d0-fsir)*hm(icel)+(fsir-fm(icel))*hinfue) &
+ / (1.d0-fm(icel))
+ endif
+
+ else
+
+!===============================================================================
+! 2. DETERMINATION DE HSTOE AVEC INTEGRATION
+!===============================================================================
+
+ hct = dirmin(icel)*hinoxy+dirmax(icel)*hinfue
+ hhh = 0.d0
+ if ( hrec(icel).gt.epsi ) then
+
+ if (fdeb(icel).le.fsir) then
+ f1 = fdeb(icel)
+ f2 = min(fsir,ffin(icel))
+ hct = hct + hrec(icel)* &
+ (f2-f1)*hinoxy*(2.d0*fsir-f1-f2)/(2.d0*fsir)
+ hhh = hhh + hrec(icel)*(f2**2-f1**2)/(2.d0*fsir)
+ endif
+ if (ffin(icel).gt.fsir) then
+ f1 = max( fsir,fdeb(icel))
+ f2 = ffin(icel)
+ hct = hct + hrec(icel) * &
+ (f2-f1)*hinfue*(f2+f1-2.d0*fsir)/(2.d0*(1.d0-fsir))
+ hhh = hhh + &
+ hrec(icel)*(f2-f1)*(2.d0-f1-f2)/(2.d0*(1.d0-fsir))
+ endif
+ hstoe(icel) = (hm(icel)-hct)/ hhh
+
+! Clipping a HSTOEA = HH(1) en max
+! Clipping a HSTOEA = HH(NMAXH) em min
+
+ if ( hstoe(icel) .gt. hh(1) ) then
+ n1 = n1 + 1
+ hsmax = max(hstoe(icel),hsmax)
+ hstoe(icel) = hh(1)
+ endif
+
+ if ( hstoe(icel) .lt. hh(nmaxh) ) then
+ n2 = n2 + 1
+ hsmin = min(hstoe(icel),hsmin)
+ hstoe(icel) = hh(nmaxh)
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+if (irangp.ge.0) then
+ call parcpt (n1)
+ !==========
+ call parcpt (n2)
+ !==========
+ call parmax (hsmax)
+ !==========
+ call parmin (hsmin)
+ !==========
+endif
+
+if ( n1.gt.0 ) then
+ write(nfecra,1000) n1,hsmax,hh(1)
+endif
+if ( n2.gt.0 ) then
+ write(nfecra,1001) n2,hsmin,hh(nmaxh)
+endif
+
+!----
+! FORMATS
+!----
+
+ 1000 format(1X,' Clipping de HSTOE EN MAX EN ',I8,' POINTS',/, &
+ 1X,' Valeur Max : ',G15.7,/, &
+ 1X,' Valeur De Clipping : ',G15.7,/)
+ 1001 format(1X,' Clipping de HSTOE EN MIN EN ',I8,' POINTS',/, &
+ 1X,' Valeur Max : ',G15.7,/, &
+ 1X,' Valeur De Clipping : ',G15.7,/)
+
+return
+end
+
diff --git a/src/cogz/d3pini.f90 b/src/cogz/d3pini.f90
new file mode 100644
index 0000000..9fcaea9
--- /dev/null
+++ b/src/cogz/d3pini.f90
@@ -0,0 +1,434 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine d3pini &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE :
+! COMBUSTION GAZ - FLAMME DE DIFFUSION CHIMIE 3 POINTS
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer iel, igg, iphas, mode
+integer iscal, ivar, ii, idimte, itenso
+double precision coefg(ngazgm), hair, tinitk
+double precision valmax, valmin
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+iphas = 1
+
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+! ---> Initialisation au 1er passage avec de l'air a TINITK
+! ======================
+
+ if ( ipass.eq.1 ) then
+
+! ----- Calcul de l'enthalpie de l'air HAIR a TINITK
+
+ tinitk = t0(iphas)
+ coefg(1) = zero
+ coefg(2) = 1.d0
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hair , tinitk )
+
+! ----- On en profite pour initialiser TINFUE et TINOXY
+! et calculer HINFUE et HINOXY a partir de TINITK et HAIR
+! CAR on n'a pas encore vu usd3pc.F
+
+ tinoxy = tinitk
+ tinfue = tinitk
+ hinoxy = hair
+ hinfue = hair
+
+ do iel = 1, ncel
+
+! ----- Moyenne et variance du taux de melange
+
+ rtp(iel,isca(ifm)) = zero
+ rtp(iel,isca(ifp2m)) = zero
+
+! ----- Enthalpie
+
+ if ( ippmod(icod3p).eq.1 ) then
+ rtp(iel,isca(ihm)) = hair
+ endif
+
+ enddo
+
+! ---> Initialisation au 2eme passage
+
+ else if ( ipass.eq.2 ) then
+
+ do iel = 1, ncel
+
+! ----- Moyenne et variance du taux de melange
+
+ rtp(iel,isca(ifm)) = fs(1)
+ rtp(iel,isca(ifp2m)) = zero
+
+! ----- Enthalpie
+
+ if ( ippmod(icod3p).eq.1 ) then
+ rtp(iel,isca(ihm)) = hinfue*fs(1)+hinoxy*(1.d0-fs(1))
+ endif
+
+ enddo
+
+! ----- On donne la main a l'utilisateur
+
+ call usd3pi &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+! ----- En periodique et en parallele,
+! il faut echanger ces initialisations
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,isca(ifm )))
+ !==========
+ call parcom(rtp(1,isca(ifp2m)))
+ !==========
+ if ( ippmod(icod3p).eq.1 ) then
+ call parcom(rtp(1,isca(ihm )))
+ !==========
+ endif
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ ivar = isca(ifm )
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ idimte = 0
+ itenso = 0
+ ivar = isca(ifp2m)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ if ( ippmod(icod3p).eq.1 ) then
+ idimte = 0
+ itenso = 0
+ ivar = isca(ihm )
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+ endif
+
+
+! Impressions de controle
+
+ write(nfecra,2000)
+
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ ivar = isca(iscal)
+ valmax = -grand
+ valmin = grand
+ do iel = 1, ncel
+ valmax = max(valmax,rtp(iel,ivar))
+ valmin = min(valmin,rtp(iel,ivar))
+ enddo
+ chaine = nomvar(ipprtp(ivar))
+ if (irangp.ge.0) then
+ call parmin(valmin)
+ !==========
+ call parmax(valmax)
+ !==========
+ endif
+ write(nfecra,2010)chaine(1:8),valmin,valmax
+ enddo
+
+ write(nfecra,2020)
+
+ endif
+
+endif
+
+
+!----
+! FORMATS
+!----
+
+ 2000 format( &
+' ',/,&
+' ----------------------------------------------------------- ',/,&
+' ',/,&
+' ',/,&
+' ** INITIALISATION DES VARIABLES PROPRES AU GAZ (FL DIF 3PT) ',/,&
+' -------------------------------------------------------- ',/,&
+' 2eme PASSAGE ',/,&
+' --------------------------------- ',/,&
+' Variable Valeur min Valeur max ',/,&
+' --------------------------------- ' )
+
+ 2010 format( &
+ 2x, a8, e12.4, e12.4 )
+
+ 2020 format( &
+' --------------------------------- ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/d3pint.f90 b/src/cogz/d3pint.f90
new file mode 100644
index 0000000..47189fa
--- /dev/null
+++ b/src/cogz/d3pint.f90
@@ -0,0 +1,477 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine d3pint &
+!================
+
+ ( ncelet , ncel , indpdf , &
+ dirmin , dirmax , fdeb , ffin , hrec , &
+ fm , hm , p , &
+ propce , &
+ w1 )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME DE DIFFUSION
+! Integration des variables thermodynamiques en fonction de
+! la fraction de melange
+! Rq : Il serait judicieux de ponderer l'integration de la
+! temperature par les CP
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! indpdf ! ti ! <-- ! indicteur passage ou non par les pdf !
+! dirmin ! tr ! <-- ! pdf : dirac en fmin !
+! dirmax ! tr ! <-- ! pdf : dirac en fmax !
+! fdeb ! tr ! <-- ! pdf : abscisse debut rectangle !
+! ffin ! tr ! <-- ! pdf : abscisse fin rectangle !
+! hrec ! tr ! <-- ! pdf : hauteur rectangle !
+! fm ! tr ! <-- ! fraction de melange moyenne !
+! hm ! tr ! <-- ! enthalpie massique moyenne !
+! ! ! ! si ecoulement permeatique !
+! p ! tr ! <-- ! pression !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules ( concentrations, temp. ) ! !
+! w1 ! tr ! --- ! tableau de tavail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+
+!===============================================================================
+! Arguments
+
+integer ncelet, ncel
+integer indpdf(ncelet)
+double precision dirmin(ncelet), dirmax(ncelet)
+double precision fdeb(ncelet), ffin(ncelet), hrec(ncelet)
+double precision fm(ncelet), hm(ncelet), p(ncelet)
+double precision propce(ncelet,*), w1(ncelet)
+
+
+! VARIABLES LOCALES
+
+integer icel, icg, iphas
+integer ih, if, jh, jf, ipcrom
+integer ipcsca, ipctem, ipckab, ipct4, ipct3
+double precision aa1, bb1, aa2, bb2, f1, f2, a, b, fmini, fmaxi
+double precision u, v, c, d, temsmm, fsir
+
+
+!===============================================================================
+
+integer ipass
+data ipass /0/
+save ipass
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. ON COMPTE LES PASSAGES
+!===============================================================================
+
+ipass = ipass + 1
+
+
+!===============================================================================
+! 1. INTEGRATION DES NGAZG FRACTIONS MASSIQUES D'ESPECES GLOBALES
+!===============================================================================
+
+! ---> En flamme de diffusion chimie 3 points :
+! - il n'y a qu'une seule reaction globale (IR= )
+! - le taux de melange f varie entre 0 et 1
+fsir = fs(1)
+fmini = zero
+fmaxi = 1.d0
+
+do icel = 1, ncel
+
+ do icg = 1, ngazg
+
+! ---> Determination des parametres des droites Variables(f)
+! Y = A + B F
+! En flamme de diffusion, il n'y a qu'une seule reaction globale
+! (IR=1)
+! Par definition les fractions massiques des especes globales
+! sont alors
+
+! F 0 FS 1
+! YFUEL 0 0 1
+! YOXYD 1 0 0
+! YPROD 0 1 0
+
+ if ( icg.eq.1 ) then
+! Fuel
+ aa1 = zero
+ bb1 = zero
+ aa2 = -fsir/(1.d0-fsir)
+ bb2 = 1.d0/(1.d0-fsir)
+
+ elseif ( icg.eq.2 ) then
+! Oxydant
+ aa1 = 1.d0
+ bb1 = -1.d0/fsir
+ aa2 = zero
+ bb2 = zero
+ elseif ( icg.eq.3 ) then
+! Produits
+ aa1 = zero
+ bb1 = 1.d0/fsir
+ aa2 = 1.d0/(1.d0-fsir)
+ bb2 = -1.d0/(1.d0-fsir)
+ endif
+
+ ipcsca = ipproc(iym(icg))
+
+ if ( indpdf(icel) .eq. 1 ) then
+
+! ---> Integration de la PDF
+
+ propce(icel,ipcsca) = dirmin(icel) * ( aa1 + bb1 * fmini ) &
+ + dirmax(icel) * ( aa2 + bb2 * fmaxi )
+ if ( fdeb(icel).lt.fsir ) then
+ f1 = fdeb(icel)
+ f2 = min( fsir,ffin(icel) )
+ propce(icel,ipcsca) = propce(icel,ipcsca) &
+ + hrec(icel)*(f2-f1)*(aa1+bb1*5.d-1*(f2+f1))
+ endif
+ if ( ffin(icel).gt.fsir ) then
+ f1 = max(fsir,fdeb(icel))
+ f2 = ffin(icel)
+ propce(icel,ipcsca) = propce(icel,ipcsca) &
+ + hrec(icel)*(f2-f1)*(aa2+bb2*5.d-1*(f2+f1))
+ endif
+ else
+
+! ---> Degenerescence sur la valeur moyenne
+
+ if ( fm(icel).le.fsir ) then
+ propce(icel,ipcsca) = aa1+bb1*fm(icel)
+ else
+ propce(icel,ipcsca) = aa2+bb2*fm(icel)
+ endif
+
+ endif
+
+ enddo
+
+enddo
+
+
+!===============================================================================
+! 2. DETERMINATION LOCALE DE L'ENTHALPIE DES GAZ STOECHIOMETRIQUES
+! BRULES EN PERMEATIQUE (non adiab)
+! (stocke dans le tableau W1)
+!===============================================================================
+
+! ---> Calcul de HSTOE dans W1
+
+! ---- Initialisation
+
+do icel = 1, ncel
+ w1(icel) = hstoea
+enddo
+
+if ( ippmod(icod3p).eq.1 ) then
+
+ call d3phst &
+ !==========
+ ( ncelet , ncel , indpdf , &
+ dirmin , dirmax , fdeb , ffin , hrec , &
+ fm , hm , &
+ w1 )
+
+endif
+
+
+!===============================================================================
+! 3. INTEGRATION a) DE LA TEMPERATURE
+! b) DU COEFFICIENT D'ABSORPTION si rayonnement
+! c) DES TERME T^4 et T^3 si rayonnement
+! d) DE LA MASSE VOLUMIQUE
+!===============================================================================
+
+
+! ---> Positions des variables, coefficients
+
+ipctem = ipproc(itemp)
+if ( iirayo.gt.0 ) then
+ ipckab = ipproc(ickabs)
+ ipct4 = ipproc(it4m)
+ ipct3 = ipproc(it3m)
+endif
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+
+do icel = 1, ncel
+
+ if ( indpdf(icel) .eq. 1 ) then
+
+! ---> Integration de la PDF
+
+ ih = 1
+ do jh = 1,(nmaxh-1)
+ if ( w1(icel).gt.hh(jh+1) .and. w1(icel).le.hh(jh) ) &
+ ih = jh
+ enddo
+ if ( w1(icel) .ge. hh(1) ) ih = 1
+ if ( w1(icel) .le. hh(nmaxh) ) ih = nmaxh-1
+ propce(icel,ipctem) = dirmin(icel)*tinoxy + &
+ dirmax(icel)*tinfue
+ temsmm = dirmin(icel)/wmolg(2)*tinoxy &
+ + dirmax(icel)/wmolg(1)*tinfue
+ if ( iirayo.gt.0 ) then
+ propce(icel,ipckab) = &
+ dirmin(icel)*ckabsg(2) + dirmax(icel)*ckabsg(1)
+ propce(icel,ipct4) = &
+ dirmin(icel)*tinoxy**4 + dirmax(icel)*tinfue**4
+ propce(icel,ipct3) = &
+ dirmin(icel)*tinoxy**3 + dirmax(icel)*tinfue**3
+ endif
+ if = 1
+ do jf = 1, (nmaxf-1)
+ if ( fdeb(icel).ge.ff(jf) .and. &
+ fdeb(icel).lt.ff(jf+1) ) if = jf
+ enddo
+ if ( fdeb(icel) .le. ff(1) ) if = 1
+ if ( fdeb(icel) .ge. ff(nmaxf) ) if = nmaxf-1
+ f2 = zero
+ f1 = fdeb(icel)
+ do while ( (ffin(icel)-f2).gt.epzero )
+ f2 = min(ff(if+1),ffin(icel))
+! Dans le tableau TFH,
+! on extrait sur chaque ligne i : T = Ai+Bi*F
+! et on construit pour la valeur courante de HSTOE (W1)
+! T = A+B*F
+ aa1 = tfh(if,ih)
+ bb1 = (tfh(if+1,ih)-tfh(if,ih))/(ff(if+1)-ff(if))
+ aa2 = tfh(if,ih+1)
+ bb2 = (tfh(if+1,ih+1)-tfh(if,ih+1))/(ff(if+1)-ff(if))
+ a = aa1 + (w1(icel)-hh(ih))*(aa2-aa1)/(hh(ih+1)-hh(ih))
+ b = bb1 + (w1(icel)-hh(ih))*(bb2-bb1)/(hh(ih+1)-hh(ih))
+ a = a - b*ff(if)
+
+! ----- Calcul de la temperature par integration
+
+ propce(icel,ipctem) = propce(icel,ipctem) &
+ + hrec(icel)*(f2-f1)*(a+b*(f1+f2)/2.d0)
+
+! ----- Preparation aux calculs du coefficient d'absorption
+! de T^4 et de T^3
+! Cote pauvre
+! UNSMM = (FS-F)/FS / WMOLG(2)+ F/FS / WMOLG(3)
+! CKABS = (FS-F)/FS * CKABSG(2) + F/FS * CKABSG(3)
+! Cote riche
+! UNSMM = (F-FS)/(1-FS)/WMOLG(1) + (1-F)/(1-FS)/WMOLG(3)
+! CKABS = (F-FS)/(1-FS)*CKABSG(1) + (1-F)/(1-FS)*CKABSG(3)
+! Partout
+! UNSMM = c + df
+! CKABS = u + vF
+! TEMSMM = T*UNSMM = (c+df)*(a+bf) = ca +(cb+ad)f + bd f^2
+! T^4 = (a+bf)^4
+! = a4 + 4a3b f + 6a2b2 f^2 + 4ab3 f^3 + b4 f^4
+! T^3 = (a+bf)^3
+! = a3 + 3a2b f + 3ab2 f^2 + b3 f^3
+
+
+ if ( f1.lt.fsir ) then
+! On a demarre cote pauvre
+ c = 1.d0/wmolg(2)
+ d = (-1.d0/wmolg(2)+1.d0/wmolg(3))/fsir
+ else
+! On termine cote riche (en commencant avec f1=fs)
+ c = ( -fsir/wmolg(1)+1.d0/wmolg(3))/(1.d0-fsir)
+ d = ( 1.d0/wmolg(1)-1.d0/wmolg(3))/(1.d0-fsir)
+ endif
+
+ if ( iirayo.gt.0 ) then
+ if ( f1.lt.fsir ) then
+! On a demarre cote pauvre
+ u = ckabsg(2)
+ v = (-ckabsg(2)+ ckabsg(3))/fsir
+ else
+! On termine cote riche (en commencant avec f1=fs)
+ u = (-fsir*ckabsg(1)+ ckabsg(3))/(1.d0-fsir)
+ v = ( ckabsg(1)- ckabsg(3))/(1.d0-fsir)
+ endif
+
+! ----- Calcul du coefficient d'absorption
+! et des termes T^4 et de T^3 (si rayonnement)
+
+ propce(icel,ipckab) = propce(icel,ipckab) + &
+ hrec(icel)*( u*(f2-f1) + v*(f2**2-f1**2)*0.5d0 )
+
+ propce(icel,ipct4) = propce(icel,ipct4) + &
+ hrec(icel)* &
+ ( a**4 * (f2-f1) &
+ + (4.d0*a**3 *b ) * (f2**2-f1**2)/2.d0 &
+ + (6.d0*(a**2)*(b**2) ) * (f2**3-f1**3)/3.d0 &
+ + (4.d0*a *(b**3) ) * (f2**4-f1**4)/4.d0 &
+ + ( (b**4) ) * (f2**5-f1**5)/5.d0 )
+
+ propce(icel,ipct3) = propce(icel,ipct3) + &
+ hrec(icel)* &
+ ( (a**3) * (f2-f1) &
+ + (3.d0*(a**2)*b ) * (f2**2-f1**2)/2.d0 &
+ + (3.d0*a *(b**2) ) * (f2**3-f1**3)/3.d0 &
+ + ( (b**3) ) * (f2**4-f1**4)/4.d0 )
+
+ endif
+
+! ----- Calcul du terme Temperature/masse molaire
+
+ temsmm = temsmm + hrec(icel)* &
+ ( a*c * (f2-f1) &
+ + (c*b+a*d) * (f2**2-f1**2)/2.d0 &
+ + b*d * (f2**3-f1**3)/3.d0 )
+
+ if = if+1
+ f1 = f2
+ enddo
+
+ else
+
+! ---> Degenerescence sur la valeur moyenne
+
+ ih = 1
+ do jh = 1, (nmaxh-1)
+ if ( w1(icel).gt.hh(jh+1) .and. w1(icel).le.hh(jh) ) &
+ ih = jh
+ enddo
+ if ( w1(icel) .ge. hh(1) ) ih =1
+ if ( w1(icel) .le. hh(nmaxh) ) ih =nmaxh-1
+ if = 1
+ do jf = 1, (nmaxf-1)
+ if ( fm(icel).ge.ff(jf) .and. fm(icel).lt.ff(jf+1) ) &
+ if = jf
+ enddo
+ if ( fm(icel) .le. ff(1) ) if = 1
+ if ( fm(icel) .ge. ff(nmaxf) ) if = nmaxf-1
+ aa1 = tfh(if,ih)
+ bb1 = (tfh(if+1,ih)-tfh(if,ih))/(ff(if+1)-ff(if))
+ aa2 = tfh(if,ih+1)
+ bb2 = (tfh(if+1,ih+1)-tfh(if,ih+1))/(ff(if+1)-ff(if))
+ a = aa1 + (w1(icel)-hh(ih))*(aa2-aa1)/(hh(ih+1)-hh(ih))
+ b = bb1 + (w1(icel)-hh(ih))*(bb2-bb1)/(hh(ih+1)-hh(ih))
+ a = a - b*ff(if)
+
+! ----- Calcul de la temperature a partir de la valeur moyenne
+
+ propce(icel,ipctem) = a+b*fm(icel)
+
+ if ( fm(icel).lt.fsir ) then
+! On a demarre cote pauvre
+ c = 1.d0/wmolg(2)
+ d = (-1.d0/wmolg(2)+1.d0/wmolg(3))/fsir
+ else
+! On termine cote riche (en commencant avec f1=fs)
+ c = ( -fsir/wmolg(1)+1.d0/wmolg(3))/(1.d0-fsir)
+ d = ( 1.d0/wmolg(1)-1.d0/wmolg(3))/(1.d0-fsir)
+ endif
+
+ if ( iirayo.gt.0 ) then
+ if ( fm(icel).lt.fsir ) then
+! On a demarre cote pauvre
+ u = ckabsg(2)
+ v = (-ckabsg(2)+ ckabsg(3))/fsir
+ else
+! On termine cote riche (en commencant avec f1=fs)
+ u = (-fsir*ckabsg(1)+ ckabsg(3))/(1.d0-fsir)
+ v = ( ckabsg(1)- ckabsg(3))/(1.d0-fsir)
+ endif
+
+! ----- Calcul du coefficient d'absorption
+! et des termes T^4 et de T^3
+! a partir de la valeur moyenne (si rayonnement)
+
+ propce(icel,ipckab) = u + v*fm(icel)
+ propce(icel,ipct4) = a**4 &
+ + (4.d0*(a**3)*b ) * fm(icel) &
+ + (6.d0*(a**2)*(b**2) ) * fm(icel)**2 &
+ + (4.d0*a *(b**3) ) * fm(icel)**3 &
+ + ( (b**4) ) * fm(icel)**4
+
+ propce(icel,ipct3) = a**3 &
+ + ( 3.d0*(a**2)*b ) * fm(icel) &
+ + ( 3.d0*a *(b**2) ) * fm(icel)**2 &
+ + ( (b**3) ) * fm(icel)**3
+
+ endif
+
+! ----- Calcul du terme Temperature/masse molaire
+
+ temsmm = a*c +(c*b+a*d)*fm(icel) + b*d*fm(icel)**2
+
+ endif
+
+! ---> Calcul de la masse volumique
+
+ if (ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+ propce(icel,ipcrom) = srrom*propce(icel,ipcrom) &
+ + (1.d0-srrom)* &
+ ( p0(iphas)/(rr*temsmm) )
+ endif
+
+enddo
+
+
+return
+end
+
diff --git a/src/cogz/d3pphy.f90 b/src/cogz/d3pphy.f90
new file mode 100644
index 0000000..fc54080
--- /dev/null
+++ b/src/cogz/d3pphy.f90
@@ -0,0 +1,466 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine d3pphy &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ dirmin , dirmax , fdeb , ffin , hrec , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME DE DIFFUSION
+! Calcul de RHO mutualise pour chimie 3 points
+! adiabatique ou permeatique (transport de H)
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! dirmin ! tr ! --- ! pdf : dirac en fmin !
+! dirmax ! tr ! --- ! pdf : dirac en fmax !
+! fdeb ! tr ! --- ! pdf : abscisse debut rectangle !
+! ffin ! tr ! --- ! pdf : abscisse fin rectangle !
+! hrec ! tr ! --- ! pdf : hauteur rectangle !
+! w1-w3(ncelet) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+! rpp ! tr ! --- ! macro tableau reel pp !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer iinpdf
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision dirmin(ncelet),dirmax(ncelet)
+double precision fdeb(ncelet),ffin(ncelet)
+double precision hrec(ncelet)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer if, ih, iel, icg
+integer ifac, mode, izone
+integer iphas, ipbrom, ipcrom, ipbycg, ipcycg
+double precision coefg(ngazgm), fsir, hhloc, tstoea, tin
+double precision temsmm
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 0. ON COMPTE LES PASSAGES
+!===============================================================================
+
+ipass = ipass + 1
+
+!===============================================================================
+! 1. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+! On reserve la memoire pour le tabeau INDPDF : passage ou non
+! par les PDF (on le garde pendant tout le sous-programme
+
+iinpdf = idebia
+ifinia = iinpdf + ncelet
+CALL IASIZE('D3PPHY',IFINIA)
+!==========
+
+!===============================================================================
+! 2. DETERMINATION DES GRANDEURS THERMOCHIMIQUES
+!===============================================================================
+
+if ( ipass.le.2 ) then
+
+! Rq : Il faut avoir vu usd3pc.F pour calculer correctement HH et FF
+
+! ---> Calcul de TSTOEA
+
+! ---- Initialisation
+ do icg = 1, ngazgm
+ coefg(icg) = zero
+ enddo
+
+ hstoea = fs(1)*hinfue + (1.d0-fs(1))*hinoxy
+ coefg(1) = zero
+ coefg(2) = zero
+ coefg(3) = 1.d0
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hstoea , tstoea )
+
+
+! ---> Construction d'une table Temperature en fonction de la richesse
+! et de l'enthalpie stoechiometrique
+! de dimension 9X9
+
+ fsir = fs(1)
+
+! ---- Calcul du tableau FF(IF)
+
+ do if = 1, (nmaxf/2+1)
+ ff(if) = fsir * dble(2*if-2)/dble(nmaxf-1)
+ enddo
+ do if = (nmaxf/2+2), nmaxf
+ ff(if) = fsir + dble(2*if-nmaxf-1) &
+ / dble(nmaxf-1)*(1.d0-fsir)
+ enddo
+
+! ---- Remplissage du tableau HH(IH)
+
+ coefg(1) = zero
+ coefg(2) = zero
+ coefg(3) = 1.d0
+ tin = min(tinfue,tinoxy)
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hh(nmaxh) , tin )
+ hh(1) = hstoea
+ do ih = 2, (nmaxh-1)
+ hh(ih) = hh(1) + (hh(nmaxh)-hh(1))* &
+ dble(ih-1)/dble(nmaxh-1)
+ enddo
+
+! ---- Remplissage du tableau TFH(IF,IH)
+
+ do ih = 1, nmaxh
+ do if = 1, (nmaxf/2+1)
+! ----- Melange pauvre
+ coefg(1) = zero
+ coefg(2) = (fsir-ff(if))/fsir
+ coefg(3) = ff(if)/fsir
+ hhloc = hinoxy + dble(2*if-2)/dble(nmaxf-1) &
+ * (hh(ih)-hinoxy)
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hhloc , tfh(if,ih) )
+ enddo
+ do if = (nmaxf/2+2), nmaxf
+! ----- Melange riche
+ coefg(1) = (ff(if)-fsir)/(1.d0-fsir)
+ coefg(2) = 0.d0
+ coefg(3) = (1.d0-ff(if))/(1.d0-fsir)
+ hhloc = ( dble(2*if)*(hinfue-hh(ih)) &
+ + dble(2*nmaxf)*hh(ih) &
+ - hinfue*dble(nmaxf+1) ) &
+ / dble(nmaxf-1)
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hhloc , tfh(if,ih) )
+ enddo
+
+ enddo
+
+endif
+
+
+!===============================================================================
+! 3. CALCUL DE PARAMETRES DE LA FONCTION DENSITE DE PROBABILITE
+! POUR LA FRACTION DE MELANGE
+!===============================================================================
+
+! --- Definition des bornes min et max de la pdf
+! dans les 2 tableaux de travail W1 et W2
+
+do iel = 1, ncel
+ w1(iel) = 0.d0
+ w2(iel) = 1.d0
+enddo
+
+call pppdfr &
+!==========
+ ( ncelet,ncel, ia(iinpdf), &
+ rtp(1,isca(ifm)), rtp(1,isca(ifp2m)), &
+ w1, w2, &
+ dirmin, dirmax, fdeb, ffin, hrec )
+
+
+
+!===============================================================================
+! 4. INTEGRATION DE LA FONCTION DENSITE DE PROBABILITE
+! POUR DETERMINER LA TEMPERATURE
+! LES FRACTIONS MASSIQUES
+! LA MASSE VOLUMIQUE
+! qsp RAYONNEMENT
+! Ces variables d'etat sont dans PROPCE
+!===============================================================================
+
+if ( ippmod(icod3p).eq.1 ) then
+
+ call d3pint &
+ !==========
+ ( ncelet,ncel, ia(iinpdf), &
+ dirmin,dirmax,fdeb,ffin,hrec, &
+ rtp(1,isca(ifm)),rtp(1,isca(ihm)),rtp(1,ipr(1)), &
+ propce, &
+ w1 )
+
+else
+
+ call d3pint &
+ !==========
+ ( ncelet,ncel, ia(iinpdf), &
+ dirmin,dirmax,fdeb,ffin,hrec, &
+ rtp(1,isca(ifm)),w2,rtp(1,ipr(1)), &
+ propce, &
+ w1 )
+
+endif
+
+
+!===============================================================================
+! 4. CALCUL DE RHO ET DES FRACTIONS MASSIQUES DES ESPECES GLOBALES
+! SUR LES BORDS
+!===============================================================================
+
+! --> Masse volumique au bord
+
+iphas = 1
+ibrom(iphas) = 1
+ipbrom = ipprob(irom(iphas))
+ipcrom = ipproc(irom(iphas))
+
+! ---- Masse volumique au bord pour toutes les facettes
+! Les facettes d'entree seront recalculees apres
+! a partir des CL (si IPASS > 1). .
+
+
+! ---- Au premier passage sans suite ou si on n'a pas relu la
+! masse volumique dans le fichier suite, on n'a pas recalcule la
+! masse volumique dans d3pint, pas la peine de la reprojeter aux
+! faces.
+
+if ( ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbrom) = propce(iel,ipcrom)
+ enddo
+
+endif
+
+! ---- Masse volumique au bord pour les facettes d'entree UNIQUEMENT
+! Le test sur IZONE sert pour les reprises de calcul
+! On suppose implicitement que les elements ci-dessus ont ete relus
+! dans le fichier suite (i.e. pas de suite en combustion d'un calcul
+! a froid) -> sera pris en compte eventuellement dans les versions
+! suivantes
+
+if(ipass.gt.1 .or. isuite.eq.1 ) then
+ do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if(izone.gt.0) then
+ if ( ientfu(izone).eq.1 .or. ientox(izone).eq.1 ) then
+ temsmm = tinfue/wmolg(1)
+ if ( ientox(izone).eq.1 ) temsmm = tinoxy/wmolg(2)
+ propfb(ifac,ipbrom) = p0(iphas)/(rr*temsmm)
+ endif
+ endif
+ enddo
+endif
+
+! --> Fractions massiques des especes globales au bord
+! Uniquement si rayonnement
+
+if ( iirayo.gt.0 ) then
+ do icg = 1, ngazg
+ ipbycg = ipprob(iym(icg))
+ ipcycg = ipproc(iym(icg))
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbycg) = propce(iel,ipcycg)
+ enddo
+ enddo
+endif
+
+
+!===============================================================================
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/d3ptcl.f90 b/src/cogz/d3ptcl.f90
new file mode 100644
index 0000000..96c95c1
--- /dev/null
+++ b/src/cogz/d3ptcl.f90
@@ -0,0 +1,579 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine d3ptcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! COMBUSTION GAZ CHIMIE 3 POINTS
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer igg, iphas, ifac, izone, mode
+integer ii, iel, ifue, ioxy, iok
+integer ipbrom, icke, ipcvis
+double precision qisqc, viscla, d2s3, uref2, rhomoy, dhy, xiturb
+double precision ustar2, xkent, xeent
+double precision qcalc(nozppm)
+double precision coefg(ngazgm)
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+ipbrom = ipprob(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+d2s3 = 2.d0/3.d0
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+
+!===============================================================================
+! 1. ECHANGES EN PARALLELE POUR LES DONNEES UTILISATEUR
+!===============================================================================
+
+! En realite on pourrait eviter cet echange en modifiant usd3pc et en
+! demandant a l'utilisateur de donner les grandeurs dependant de la
+! zone hors de la boucle sur les faces de bord : les grandeurs
+! seraient ainsi disponibles sur tous les processeurs. Cependant,
+! ca rend le sous programme utilisateur un peu plus complique et
+! surtout, si l'utilisateur le modifie de travers, ca ne marche pas.
+! On suppose que toutes les gandeurs fournies sont positives, ce qui
+! permet d'utiliser un max pour que tous les procs les connaissent.
+! Si ce n'est pas le cas, c'est plus complique mais on pourrait
+! s'en tirer avec un max quand meme.
+
+if(irangp.ge.0) then
+ call parmax(tinfue)
+ !==========
+ call parmax(tinoxy)
+ !==========
+ call parrmx(nozapm,qimp )
+ !==========
+ call parimx(nozapm,iqimp )
+ !==========
+ call parimx(nozapm,ientox)
+ !==========
+ call parimx(nozapm,ientfu)
+ !==========
+endif
+
+
+!===============================================================================
+! 2. SI IQIMP = 1 : CORRECTION DES VITESSES (EN NORME) POUR CONTROLER
+! LES DEBITS IMPOSES
+! SI IQIMP = 0 : CALCUL DE QIMP
+
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+
+! --- Debit calcule
+
+do izone = 1, nozppm
+ qcalc(izone) = 0.d0
+enddo
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ qcalc(izone) = qcalc(izone) - propfb(ifac,ipbrom) * &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+enddo
+
+if(irangp.ge.0) then
+ call parrsm(nozapm,qcalc)
+endif
+
+do izone = 1, nozapm
+ if ( iqimp(izone).eq.0 ) then
+ qimp(izone) = qcalc(izone)
+ endif
+enddo
+
+
+! --- Correction des vitesses en norme
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( iqimp(izone).eq.1 ) then
+ if(qcalc(izone).lt.epzero) then
+ write(nfecra,2001)izone,iqimp(izone),qcalc(izone)
+ iok = iok + 1
+ endif
+ endif
+enddo
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if ( iqimp(izone).eq.1 ) then
+ qisqc = qimp(izone)/qcalc(izone)
+ rcodcl(ifac,iu(iphas),1) = rcodcl(ifac,iu(iphas),1)*qisqc
+ rcodcl(ifac,iv(iphas),1) = rcodcl(ifac,iv(iphas),1)*qisqc
+ rcodcl(ifac,iw(iphas),1) = rcodcl(ifac,iw(iphas),1)*qisqc
+ endif
+enddo
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le debit est impose sur la zone IZONE = ', I10 ,/,&
+'@ puisque IQIMP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, le produit RHO D S integre est nul : ',/,&
+'@ il vaut = ',E14.5 ,/,&
+'@ (D est la direction selon laquelle est impose le debit).',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usd3pc, et en particulier ',/,&
+'@ - que le vecteur RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) qui determine',/,&
+'@ la direction de la vitesse est non nul et n''est pas ',/,&
+'@ uniformement perpendiculaire aux face d''entree ',/,&
+'@ - que la surface de l''entree n''est pas nulle (ou que ',/,&
+'@ le nombre de faces de bord dans la zone est non nul) ',/,&
+'@ - que la masse volumique n''est pas nulle ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 3. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LA TURBULENCE
+! (pour n'importe quel modele)
+!===============================================================================
+
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique de la turbulence
+
+ if ( icalke(izone).ne.0 ) then
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ + rcodcl(ifac,iv(iphas),1)**2 &
+ + rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,epzero)
+ rhomoy = propfb(ifac,ipbrom)
+ iel = ifabor(ifac)
+ viscla = propce(iel,ipcvis)
+ icke = icalke(izone)
+ dhy = dh(izone)
+ xiturb = xintur(izone)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+ if (icke.eq.1) then
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscla, cmu, xkappa, &
+ ustar2, xkent, xeent )
+ else if (icke.eq.2) then
+ call keenin &
+ !==========
+ ( uref2, xiturb, dhy, cmu, xkappa, xkent, xeent )
+ endif
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES DE BORD
+! ======
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LES SCALAIRES
+!===============================================================================
+
+
+if ( ippmod(icod3p).eq.1 ) then
+
+! On regarde s'il y a une entree carburant au moins et
+! une entree oxydant au moins
+ ifue = 0
+ ioxy = 0
+ do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( ientfu(izone).eq.1 ) then
+ ifue = 1
+ elseif( ientox(izone).eq.1 ) then
+ ioxy = 1
+ endif
+ enddo
+ if(irangp.ge.0) then
+ call parcmx(ifue)
+ call parcmx(ioxy)
+ endif
+
+! Entree carburant a TINFUE : calcul de HINFUE
+ if(ifue.eq.1) then
+ coefg(1) = 1.d0
+ coefg(2) = zero
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hinfue , tinfue )
+ endif
+
+! Entree oxydant a TINOXY : calcul de HINOXY
+ if(ioxy.eq.1) then
+ coefg(1) = zero
+ coefg(2) = 1.d0
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hinoxy , tinoxy )
+ endif
+
+endif
+
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique des scalaires physiques particulieres
+
+! Entree carburant a TINFUE
+
+ if ( ientfu(izone).eq.1 ) then
+
+! - Moyenne du taux de melange
+ rcodcl(ifac,isca(ifm),1) = 1.d0
+
+! - Variance du taux d emelange
+ rcodcl(ifac,isca(ifp2m),1) = 0.d0
+
+! - Enthalpie du melange gazeux
+ if ( ippmod(icod3p).eq.1 ) then
+ rcodcl(ifac,isca(ihm),1) = hinfue
+ endif
+
+ elseif( ientox(izone).eq.1 ) then
+
+! Entree oxydant a TINOXY
+
+! - Moyenne du taux de melange
+ rcodcl(ifac,isca(ifm),1) = 0.d0
+
+! - Variance du taux d emelange
+ rcodcl(ifac,isca(ifp2m),1) = 0.d0
+
+! - Enthalpie du melange gazeux
+ if ( ippmod(icod3p).eq.1 ) then
+ rcodcl(ifac,isca(ihm),1) = hinoxy
+ endif
+
+
+ endif
+
+ endif
+
+enddo
+
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/d3pver.f90 b/src/cogz/d3pver.f90
new file mode 100644
index 0000000..036ecfe
--- /dev/null
+++ b/src/cogz/d3pver.f90
@@ -0,0 +1,176 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine d3pver &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL
+! COMBUSTION GAZ : FLAMME DE DIFFUSION 3 POINTS
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+integer iphas
+
+!===============================================================================
+
+!===============================================================================
+! 1. OPTIONS DU CALCUL : TABLEAUX DE ppincl.h : formats 2000
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+
+if( srrom.lt.0d0 .or. srrom.ge.1d0) then
+ WRITE(NFECRA,2000)'SRROM ', SRROM
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 2. TABLEAUX DE cstphy.h et ppthch.F : formats 3000
+!===============================================================================
+
+iphas = 1
+
+! --> Masse volumique
+
+if( ro0(iphas).lt.0d0) then
+ WRITE(NFECRA,3000)IPHAS,'RO0 ', RO0(IPHAS)
+ iok = iok + 1
+endif
+
+! --> Diffusivite dynamique en kg/(m s) : DIFTL0
+
+if( diftl0.lt.0d0) then
+ WRITE(NFECRA,3010)'DIFTL0', DIFTL0
+ iok = iok + 1
+else
+ visls0(ihm) = diftl0
+endif
+
+!===============================================================================
+! 3. FORMATS VERIFICATION
+!===============================================================================
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6, ' DOIT ETRE UN REEL ',/,&
+'@ SUPERIEUR OU EGAL A ZERO ET INFERIEUR STRICTEMENT A 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usd3p1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usd3p1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usd3p1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!===============================================================================
+! 6. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/cogz/ebuini.f90 b/src/cogz/ebuini.f90
new file mode 100644
index 0000000..51994e0
--- /dev/null
+++ b/src/cogz/ebuini.f90
@@ -0,0 +1,519 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ebuini &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION GAZ MODELE EBU
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer iel, mode, igg, iphas, izone
+integer iscal, ivar, ii, idimte, itenso
+double precision hinit, coefg(ngazgm), hair, tinitk
+double precision sommqf, sommqt, sommq, tentm, fmelm
+double precision valmax, valmin, xkent, xeent, d2s3
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+iphas = 1
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+! ---> Initialisation au 1er passage avec de l'air a TINITK
+! ======================
+
+ if ( ipass.eq.1 ) then
+
+! ----- Temperature du melange : air a TINITK
+ tinitk = t0(iphas)
+
+! ----- Enthalpie de l'air a TINITK
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ coefg(1) = zero
+ coefg(2) = 1.d0
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hair , tinitk )
+ endif
+
+! ----- On en profite pour initialiser FRMEL et TGF
+! CAR on n'a pas encore vu usebuc.F
+
+ frmel = zero
+ tgf = 300.d0
+
+! ---- Initialisation de k et epsilon
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+ do iel = 1, ncel
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+
+ endif
+
+! ----- Fraction massique de gaz frais
+
+ rtp(iel,isca(iygfm)) = 1.d0
+
+! ----- Fraction de melange
+
+ if ( ippmod(icoebu).eq.2 .or. ippmod(icoebu).eq.3 ) then
+ rtp(iel,isca(ifm)) = zero
+ endif
+
+! ----- Enthalpie du melange
+
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ rtp(iel,isca(ihm)) = hair
+ endif
+
+ enddo
+
+! ---> Initialisation au 2eme passage
+
+ else if ( ipass.eq.2 ) then
+
+! ----- Calculs preliminaires : Fraction de melange, T, H
+! (la valeur NOZAPM est utilisee pour inclure les aspects parall)
+ sommqf = zero
+ sommq = zero
+ sommqt = zero
+ do izone = 1, nozapm
+ sommqf = sommqf + qimp(izone)*fment(izone)
+ sommqt = sommqt + qimp(izone)*tkent(izone)
+ sommq = sommq + qimp(izone)
+ enddo
+
+ if(abs(sommq).gt.epzero) then
+ fmelm = sommqf / sommq
+ tentm = sommqt / sommq
+ else
+ fmelm = zero
+ tentm = t0(iphas)
+ endif
+
+! ----- Enthalpie du melange HINIT
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ coefg(1) = fmelm
+ coefg(2) = (1.d0-fmelm)
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hinit , tentm )
+ endif
+
+
+ do iel = 1, ncel
+
+! ----- Fraction massique de gaz frais
+
+ rtp(iel,isca(iygfm)) = 5.d-1
+
+! ----- Fraction de melange
+
+ if ( ippmod(icoebu).eq.2 .or. ippmod(icoebu).eq.3 ) then
+ rtp(iel,isca(ifm)) = fmelm
+ endif
+
+! ----- Enthalpie du melange
+
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ rtp(iel,isca(ihm)) = hinit
+ endif
+
+ enddo
+
+! ----- On donne la main a l'utilisateur
+
+ call usebui &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+! ----- En periodique et en parallele,
+! il faut echanger ces initialisations (qui sont en fait dans RTPA)
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,isca(iygfm)))
+ !==========
+ if ( ippmod(icoebu).eq.2 .or. ippmod(icoebu).eq.3 ) then
+ call parcom(rtp(1,isca(ifm )))
+ !==========
+ endif
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ call parcom(rtp(1,isca(ihm )))
+ !==========
+ endif
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ ivar = isca(iygfm)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ if ( ippmod(icoebu).eq.2 .or. ippmod(icoebu).eq.3 ) then
+ idimte = 0
+ itenso = 0
+ ivar = isca(ifm )
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ idimte = 0
+ itenso = 0
+ ivar = isca(ihm )
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+ endif
+
+
+! Impressions de controle
+
+ write(nfecra,2000)
+
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ ivar = isca(iscal)
+ valmax = -grand
+ valmin = grand
+ do iel = 1, ncel
+ valmax = max(valmax,rtp(iel,ivar))
+ valmin = min(valmin,rtp(iel,ivar))
+ enddo
+ chaine = nomvar(ipprtp(ivar))
+ if (irangp.ge.0) then
+ call parmin(valmin)
+ !==========
+ call parmax(valmax)
+ !==========
+ endif
+ write(nfecra,2010)chaine(1:8),valmin,valmax
+ enddo
+
+ write(nfecra,2020)
+
+ endif
+
+endif
+
+!----
+! FORMATS
+!----
+
+
+ 2000 format( &
+' ',/,&
+' ----------------------------------------------------------- ',/,&
+' ',/,&
+' ',/,&
+' ** INITIALISATION DES VARIABLES PROPRES AU GAZ (FL PRE EBU) ',/,&
+' -------------------------------------------------------- ',/,&
+' 2eme PASSAGE ',/,&
+' --------------------------------- ',/,&
+' Variable Valeur min Valeur max ',/,&
+' --------------------------------- ' )
+
+ 2010 format( &
+ 2x, a8, e12.4, e12.4 )
+
+ 2020 format( &
+' --------------------------------- ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/ebuphy.f90 b/src/cogz/ebuphy.f90
new file mode 100644
index 0000000..3e1d600
--- /dev/null
+++ b/src/cogz/ebuphy.f90
@@ -0,0 +1,504 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ebuphy &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ yfuegf , yoxygf , yprogf , &
+ yfuegb , yoxygb , yprogb , &
+ temp , masmel , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME DE PREMELAMGE MODELE EBU
+! Calcul de RHO adiabatique ou permeatique (transport de H)
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision yfuegf(ncelet),yoxygf(ncelet),yprogf(ncelet)
+double precision yfuegb(ncelet),yoxygb(ncelet),yprogb(ncelet)
+double precision temp(ncelet),masmel(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ipctem, ipcfue, ipcoxy, ipcpro
+integer igg, iphas, iel, ipcrom
+integer ipckab, ipt4, ipt3
+integer ifac, izone
+integer ipbrom, ipbycg, ipcycg, mode
+double precision coefg(ngazgm), ygfm, ygbm, epsi
+double precision nbmol , temsmm , fmel , ckabgf, ckabgb
+double precision masmgb, hgb, tgb, masmgf, masmg
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 0. ON COMPTE LES PASSAGES
+!===============================================================================
+
+ipass = ipass + 1
+
+!===============================================================================
+! 1. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! ---> Initialisation
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+! ---> Positions des variables, coefficients
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+ipbrom = ipprob(irom(iphas))
+ipctem = ipproc(itemp)
+ipcfue = ipproc(iym(1))
+ipcoxy = ipproc(iym(2))
+ipcpro = ipproc(iym(3))
+if ( iirayo.gt.0 ) then
+ ipckab = ipproc(ickabs)
+ ipt4 = ipproc(it4m)
+ ipt3 = ipproc(it3m)
+endif
+
+
+!===============================================================================
+! 2. DETERMINATION DES GRANDEURS THERMOCHIMIQUES
+!===============================================================================
+
+! ---> Grandeurs GAZ FRAIS
+
+! ----- Fournies par l'utilisateur
+! FMEL --> Taux de melange
+! constant pour les options 0 et 1
+! variable sinon
+! TGF --> Temperature gaz frais en K identique
+! pour premelange frais et dilution
+! ----- Deduites
+! YFUEGF( .) --> Fraction massique fuel gaz frais
+! YOXYGF( .) --> Fraction massique oxydant gaz frais
+! YPROGF( .) --> Fraction massique produits gaz frais
+! HGF --> Enthalpie massique gaz frais identique
+! pour premelange frais et dilution
+! MASMGF --> Masse molaire gaz frais
+! CKABGF --> Coefficient d'absorption
+
+! ---> Grandeurs GAZ BRULES
+
+! ----- Deduites
+! TGB --> Temperature gaz brules en K
+! YFUEGB( .) --> Fraction massique fuel gaz brules
+! YOXYGB( .) --> Fraction massique oxydant gaz brules
+! YPROGB( .) --> Fraction massique produits gaz brules
+! MASMGB --> Masse molaire gaz brules
+! CKABGB --> Coefficient d'absorption
+
+! ---> Grandeurs MELANGE
+
+! MASMEL --> Masse molaire du melange
+! PROPCE( .,IPCTEM) --> Temperature du melange
+! PROPCE( .,IPCROM) --> Masse volumique du melange
+! PROPCE(,.F,O,P ) --> Fractions massiques en F, O, P
+! PROPCE( .,IPCKAB) --> Coefficient d'absorption
+! PROPCE( .,IPT4 ) --> terme T^4
+! PROPCE( .,IPT3 ) --> terme T^3
+
+
+! ---> Fractions massiques des gaz frais et brules en F, O, P
+
+do iel = 1, ncel
+
+ if ( ippmod(icoebu).eq.0 .or. ippmod(icoebu).eq.1 ) then
+ fmel = frmel
+ else
+ fmel = rtp(iel,isca(ifm))
+ endif
+
+ yfuegf(iel) = fmel
+ yoxygf(iel) = 1.d0-fmel
+ yprogf(iel) = 0.d0
+
+ yfuegb(iel) = max(zero,(fmel-fs(1))/(1.d0-fs(1)))
+ yprogb(iel) = (fmel-yfuegb(iel))/fs(1)
+ yoxygb(iel) = 1.d0 - yfuegb(iel) - yprogb(iel)
+
+enddo
+
+epsi = 1.d-06
+
+do iel = 1, ncel
+
+! ---> Coefficients d'absorption des gaz frais et brules
+
+ if ( iirayo.gt.0 ) then
+ ckabgf = yfuegf(iel)*ckabsg(1) + yoxygf(iel)*ckabsg(2) &
+ + yprogf(iel)*ckabsg(3)
+ ckabgb = yfuegb(iel)*ckabsg(1) + yoxygb(iel)*ckabsg(2) &
+ + yprogb(iel)*ckabsg(3)
+ endif
+
+! ---> Masse molaire des gaz frais
+
+ coefg(1) = yfuegf(iel)
+ coefg(2) = yoxygf(iel)
+ coefg(3) = yprogf(iel)
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ masmgf = 1.d0/nbmol
+
+! ---> Calcul de l'enthalpie des gaz frais
+
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hgf , tgf )
+
+! ---> Masse molaire des gaz brules
+
+ coefg(1) = yfuegb(iel)
+ coefg(2) = yoxygb(iel)
+ coefg(3) = yprogb(iel)
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ masmgb = 1.d0/nbmol
+
+ ygfm = rtp(iel,isca(iygfm))
+ ygbm = 1.d0 - ygfm
+
+! ---> Masse molaire du melange
+
+ masmel(iel) = 1.d0 / ( ygfm/masmgf + ygbm/masmgb )
+
+! ---> Calcul Temperature des gaz brules
+
+ if ( ippmod(icoebu).eq.0 .or. ippmod(icoebu).eq.2 ) then
+! ---- EBU Standard et modifie en conditions adiabatiques (sans H)
+ hgb = hgf
+ else if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+! ---- EBU Standard et modifie en conditions permeatiques (avec H)
+ hgb = hgf
+ if ( ygbm.gt.epsi ) then
+ hgb = ( rtp(iel,isca(ihm))-hgf*ygfm ) / ygbm
+ endif
+ endif
+
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hgb , tgb )
+
+ if ( ippmod(icoebu).eq.0 .or. ippmod(icoebu).eq.2 ) then
+! ---- EBU Standard et modifie en conditions adiabatiques (sans H)
+ tgbad = tgb
+ endif
+
+! ---> Temperature du melange
+! Rq PPl : Il serait plus judicieux de ponderer par les CP (GF et GB)
+ propce(iel,ipctem) = ygfm*tgf + ygbm*tgb
+
+! ---> Temperature / Masse molaire
+
+ temsmm = ygfm*tgf/masmgf + ygbm*tgb/masmgb
+
+! ---> Masse volumique du melange
+
+ if (ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+ propce(iel,ipcrom) = srrom*propce(iel,ipcrom) &
+ + (1.d0-srrom)* &
+ ( p0(iphas)/(rr*temsmm) )
+ endif
+
+! ---> Fractions massiques des especes globales
+
+ propce(iel,ipcfue) = yfuegf(iel)*ygfm + yfuegb(iel)*ygbm
+ propce(iel,ipcoxy) = yoxygf(iel)*ygfm + yoxygb(iel)*ygbm
+ propce(iel,ipcpro) = yprogf(iel)*ygfm + yprogb(iel)*ygbm
+
+! ---> Grandeurs relatives au rayonnement
+
+ if ( iirayo.gt.0 ) then
+ propce(iel,ipckab) = ygfm*ckabgf + ygbm*ckabgb
+ propce(iel,ipt4) = ygfm*tgf**4 + ygbm*tgb**4
+ propce(iel,ipt3) = ygfm*tgf**3 + ygbm*tgb**3
+ endif
+
+enddo
+
+
+!===============================================================================
+! 3. CALCUL DE RHO ET DES FRACTIONS MASSIQUES DES ESPECES GLOBALES
+! SUR LES BORDS
+!===============================================================================
+
+! --> Masse volumique au bord
+
+iphas = 1
+ibrom(iphas) = 1
+
+! ---- Masse volumique au bord pour toutes les facettes
+! Les facettes d'entree seront recalculees apres
+! a partir des CL (si IPASS > 2).
+
+! ---- Au premier passage sans suite ou si on n'a pas relu la
+! masse volumique dans le fichier suite, on n'a pas recalcule la
+! masse volumique ci-dessus, pas la peine de la reprojeter aux
+! faces.
+
+if (ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbrom) = propce(iel,ipcrom)
+ enddo
+
+endif
+
+
+! ---- Masse volumique au bord pour les facettes d'entree UNIQUEMENT
+! Le test sur IZONE sert pour les reprises de calcul
+! On suppose implicitement que les elements ci-dessus ont ete relus
+! dans le fichier suite (i.e. pas de suite en combustion d'un calcul
+! a froid) -> sera pris en compte eventuellement dans les versions
+! suivantes
+
+if ( ipass.gt.1 .or. isuite.eq.1 ) then
+ do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if(izone.gt.0) then
+ if ( ientgb(izone).eq.1 .or. ientgf(izone).eq.1 ) then
+ coefg(1) = fment(izone)
+ coefg(2) = 1.d0-fment(izone)
+ coefg(3) = zero
+ if ( ientgb(izone).eq.1 ) then
+ coefg(1) = max(zero,(fment(izone)-fs(1))/(1.d0-fs(1)))
+ coefg(3) = (fment(izone)-coefg(1))/fs(1)
+ coefg(2) = 1.d0 - coefg(1) - coefg(3)
+ endif
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ masmg = 1.d0/nbmol
+ temsmm = tkent(izone)/masmg
+ propfb(ifac,ipbrom) = p0(iphas)/(rr*temsmm)
+ endif
+ endif
+ enddo
+endif
+
+
+! --> Fractions massiques des especes globales au bord
+! Uniquement si transport de H
+
+if ( iirayo.gt.0 ) then
+ do igg = 1, ngazg
+ ipbycg = ipprob(iym(igg))
+ ipcycg = ipproc(iym(igg))
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbycg) = propce(iel,ipcycg)
+ enddo
+ enddo
+endif
+
+!===============================================================================
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/ebutcl.f90 b/src/cogz/ebutcl.f90
new file mode 100644
index 0000000..090ad39
--- /dev/null
+++ b/src/cogz/ebutcl.f90
@@ -0,0 +1,622 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ebutcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! COMBUSTION GAZ MODELE EBU
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer igg, iphas, ifac, izone, mode
+integer ipbrom, icke, ipcvis, ii, iel, iok
+double precision qisqc, viscla, d2s3, uref2, rhomoy, dhy, xiturb
+double precision ustar2, xkent, xeent, hgazf , tgazf, hgazb, tgazb
+double precision qcalc(nozppm), hgent(nozppm)
+double precision coefg(ngazgm)
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+ipbrom = ipprob(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+d2s3 = 2.d0/3.d0
+
+do igg = 1, ngazgm
+ coefg(igg) = 0
+enddo
+
+!===============================================================================
+! 1. ECHANGES EN PARALLELE POUR LES DONNEES UTILISATEUR
+!===============================================================================
+
+! En realite on pourrait eviter cet echange en modifiant usebuc et en
+! demandant a l'utilisateur de donner les grandeurs dependant de la
+! zone hors de la boucle sur les faces de bord : les grandeurs
+! seraient ainsi disponibles sur tous les processeurs. Cependant,
+! ca rend le sous programme utilisateur un peu plus complique et
+! surtout, si l'utilisateur le modifie de travers, ca ne marche pas.
+! On suppose que toutes les gandeurs fournies sont positives, ce qui
+! permet d'utiliser un max pour que tous les procs les connaissent.
+! Si ce n'est pas le cas, c'est plus complique mais on peut s'en tirer
+! avec un max quand meme.
+
+if(irangp.ge.0) then
+ call parrmx(nozapm,qimp )
+ !==========
+ call parrmx(nozapm,fment )
+ !==========
+ call parrmx(nozapm,tkent )
+ !==========
+ call parimx(nozapm,iqimp )
+ !==========
+ call parimx(nozapm,ientgf)
+ !==========
+ call parimx(nozapm,ientgb)
+ !==========
+endif
+
+!===============================================================================
+! 2. SI IQIMP = 1 : CORRECTION DES VITESSES (EN NORME) POUR CONTROLER
+! LES DEBITS IMPOSES
+! SI IQIMP = 0 : CALCUL DE QIMP
+
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+
+! --- Debit calcule
+
+do izone = 1, nozppm
+ qcalc(izone) = 0.d0
+enddo
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ qcalc(izone) = qcalc(izone) - propfb(ifac,ipbrom) * &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+enddo
+if(irangp.ge.0) then
+ call parrsm(nozapm,qcalc)
+endif
+do izone = 1, nozapm
+ if ( iqimp(izone).eq.0 ) then
+ qimp(izone) = qcalc(izone)
+ endif
+enddo
+
+! --- Correction des vitesses en norme
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( iqimp(izone).eq.1 ) then
+ if(qcalc(izone).lt.epzero) then
+ write(nfecra,2001)izone,iqimp(izone),qcalc(izone)
+ iok = iok + 1
+ endif
+ endif
+enddo
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if ( iqimp(izone).eq.1 ) then
+ qisqc = qimp(izone)/qcalc(izone)
+ rcodcl(ifac,iu(iphas),1) = rcodcl(ifac,iu(iphas),1)*qisqc
+ rcodcl(ifac,iv(iphas),1) = rcodcl(ifac,iv(iphas),1)*qisqc
+ rcodcl(ifac,iw(iphas),1) = rcodcl(ifac,iw(iphas),1)*qisqc
+ endif
+enddo
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le debit est impose sur la zone IZONE = ', I10 ,/,&
+'@ puisque IQIMP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, le produit RHO D S integre est nul : ',/,&
+'@ il vaut = ',E14.5 ,/,&
+'@ (D est la direction selon laquelle est impose le debit).',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usebuc, et en particulier ',/,&
+'@ - que le vecteur RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) qui determine',/,&
+'@ la direction de la vitesse est non nul et n''est pas ',/,&
+'@ uniformement perpendiculaire aux face d''entree ',/,&
+'@ - que la surface de l''entree n''est pas nulle (ou que ',/,&
+'@ le nombre de faces de bord dans la zone est non nul) ',/,&
+'@ - que la masse volumique n''est pas nulle ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 4. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LA TURBULENCE
+!===============================================================================
+
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique de la turbulence
+
+ if ( icalke(izone).ne.0 ) then
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ + rcodcl(ifac,iv(iphas),1)**2 &
+ + rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,epzero)
+ rhomoy = propfb(ifac,ipbrom)
+ iel = ifabor(ifac)
+ viscla = propce(iel,ipcvis)
+ icke = icalke(izone)
+ dhy = dh(izone)
+ xiturb = xintur(izone)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+ if (icke.eq.1) then
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscla, cmu, xkappa, &
+ ustar2, xkent, xeent )
+ else if (icke.eq.2) then
+ call keenin &
+ !==========
+ ( uref2, xiturb, dhy, cmu, xkappa, xkent, xeent )
+ endif
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 3. VERIFICATION DES DONNEES POUR LA FRACTION DE MELANGE
+! ET LA TEMPERATURE DES GAZ FRAIS
+! (modele ebu)
+!===============================================================================
+
+iphas = 1
+
+! --- FRMEL et TGF (on n'en veut qu'un : on prend le max)
+! EBU nominal est a f homogene
+! On se limite pour l'instant a une temperature
+! des gaz frais identiques
+
+frmel = 0.d0
+tgf = 0.d0
+do ifac = 1, nfabor
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+ izone = izfppp(ifac)
+ if ( ippmod(icoebu).eq.0 .or. ippmod(icoebu).eq.1 ) then
+ frmel = max(fment(izone),frmel)
+ endif
+ if (ientgf(izone).eq.1) then
+ tgf = max(tkent(izone),tgf)
+ endif
+ endif
+enddo
+
+if(irangp.ge.0) then
+ call parmax(frmel)
+ call parmax(tgf )
+endif
+
+! Attention, ici on modifie FMENT et TKENT sur les zones
+! presentes sur le proc local. Ca suffit pour le traitement qui suit.
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+ if ( ippmod(icoebu).eq.0 .or. ippmod(icoebu).eq.1 ) then
+ fment(izone) = frmel
+ endif
+ if (ientgf(izone).eq.1) then
+ tkent(izone) = tgf
+ endif
+ endif
+enddo
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LES SCALAIRES
+! (modele ebu)
+!===============================================================================
+
+
+! ---> Combustion gaz USEBUC
+! Flamme de premelange modele EBU
+
+iphas = 1
+
+! Enthalpie du melange gazeux :
+! hors de la boucle pour eviter un appel par face.
+! Suppose que une entree est forcement IENTGF=1 ou IENTGB=1
+
+if ( ippmod(icoebu) .eq. 1 .or. &
+ ippmod(icoebu) .eq. 3 ) then
+
+ do ii = 1, nzfppp
+ izone = ilzppp(ii)
+! Entree premelange froid ou dilution
+ if ( ientgf(izone).eq.1 ) then
+ tgazf = tkent(izone)
+ coefg(1) = fment(izone)
+ coefg(2) = 1.d0 - fment(izone)
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hgazf , tgazf )
+ hgent(izone) = hgazf
+! Entree gaz brules (flamme pilote)
+ elseif ( ientgb(izone).eq.1 ) then
+ tgazb = tkent(izone)
+ coefg(1) = max(zero,(fment(izone)-fs(1))/(1.d0-fs(1)))
+ coefg(3) = (fment(izone)-coefg(1))/fs(1)
+ coefg(2) = 1.d0 - coefg(1) - coefg(3)
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hgazb , tgazb )
+ hgent(izone) = hgazb
+ endif
+ enddo
+
+endif
+
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique des scalaires physiques particulieres
+
+! Entree premelange froid ou dilution
+
+ if ( ientgf(izone).eq.1 ) then
+
+! - Fraction massique de gaz frais
+ rcodcl(ifac,isca(iygfm),1) = 1.d0
+
+! - Fraction de melange
+ if ( ippmod(icoebu) .eq. 2 .or. &
+ ippmod(icoebu) .eq. 3 ) then
+ rcodcl(ifac,isca(ifm),1) = fment(izone)
+ endif
+
+! - Enthalpie du melange gazeux
+ if ( ippmod(icoebu) .eq. 1 .or. &
+ ippmod(icoebu) .eq. 3 ) then
+ rcodcl(ifac,isca(ihm),1) = hgent(izone)
+ endif
+
+ elseif ( ientgb(izone).eq.1 ) then
+
+! Entree gaz brules (flamme pilote)
+
+! - Fraction massique de gaz frais
+ rcodcl(ifac,isca(iygfm),1) = zero
+
+! - Fraction de melange
+ if ( ippmod(icoebu) .eq. 2 .or. &
+ ippmod(icoebu) .eq. 3 ) then
+ rcodcl(ifac,isca(ifm),1) = fment(izone)
+ endif
+
+! - Enthalpie du melange gazeux
+ if ( ippmod(icoebu) .eq. 1 .or. &
+ ippmod(icoebu) .eq. 3 ) then
+ rcodcl(ifac,isca(ihm),1) = hgent(izone)
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/ebutss.f90 b/src/cogz/ebutss.f90
new file mode 100644
index 0000000..6a8e8f0
--- /dev/null
+++ b/src/cogz/ebutss.f90
@@ -0,0 +1,344 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ebutss &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ izfppp , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME PREMELANGE MODELE EBU
+! ON PRECISE LES TERMES SOURCES POUR UN SCALAIRE PP
+! SUR UN PAS DE TEMPS
+
+! ATTENTION : LE TRAITEMENT DES TERMES SOURCES EST DIFFERENT
+! --------- DE CELUI DE USTSSC.F
+
+! ON RESOUT ROVSDT*D(VAR) = SMBRS
+
+! ROVSDT ET SMBRS CONTIENNENT DEJA D'EVENTUELS TERMES SOURCES
+! UTILISATEUR. IL FAUT DONC LES INCREMENTER ET PAS LES
+! ECRASER
+
+! POUR DES QUESTIONS DE STABILITE, ON NE RAJOUTE DANS ROVSDT
+! QUE DES TERMES POSITIFS. IL N'Y A PAS DE CONTRAINTE POUR
+! SMBRS
+
+! DANS LE CAS D'UN TERME SOURCE EN CEXP + CIMP*VAR ON DOIT
+! ECRIRE :
+! SMBRS = SMBRS + CEXP + CIMP*VAR
+! ROVSDT = ROVSDT + MAX(-CIMP,ZERO)
+
+! ON FOURNIT ICI ROVSDT ET SMBRS (ILS CONTIENNENT RHO*VOLUME)
+! SMBRS en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! ROVSDT en kg /s
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar, ipcrom, iel, iphas
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Numero des grandeurs physiques (voir usclim)
+ipcrom = ipproc(irom(iphas))
+
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES
+!===============================================================================
+
+if ( ivar.eq.isca(iygfm) ) then
+
+! ---> Terme source pour la fraction massique moyenne de gaz frais
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---> Calcul de K et Epsilon en fonction du modele de turbulence
+
+ if (itytur(iphas).eq.2) then
+
+ do iel = 1, ncel
+ w1(iel) = rtpa(iel,ik(iphas))
+ w2(iel) = rtpa(iel,iep(iphas))
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+ do iel = 1, ncel
+ w1(iel) = 0.5d0 *( rtpa(iel,ir11(iphas)) &
+ +rtpa(iel,ir22(iphas)) &
+ +rtpa(iel,ir33(iphas)) )
+ w2(iel) = rtpa(iel,iep(iphas))
+ enddo
+
+ elseif (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+ w1(iel) = rtpa(iel,ik(iphas))
+ w2(iel) = rtpa(iel,iep(iphas))
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+ do iel = 1, ncel
+ w1(iel) = rtpa(iel,ik(iphas))
+ w2(iel) = cmu*rtpa(iel,ik(iphas))*rtpa(iel,iomg(iphas))
+ enddo
+
+ endif
+
+ do iel = 1, ncel
+ if ( w1(iel).gt.epzero .and. &
+ w2(iel).gt.epzero ) then
+ w3(iel) = cebu*w2(iel)/w1(iel) &
+ *propce(iel,ipcrom)*volume(iel) &
+ *(1.d0 - rtpa(iel,ivar))
+ smbrs(iel) = smbrs(iel) - rtpa(iel,ivar)*w3(iel)
+ rovsdt(iel) = rovsdt(iel) + max(w3(iel),zero)
+ endif
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES PHYSIQUE PARTICULIERE POUR LA VARIABLE ' &
+ ,a8,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cogz/ebuver.f90 b/src/cogz/ebuver.f90
new file mode 100644
index 0000000..513685b
--- /dev/null
+++ b/src/cogz/ebuver.f90
@@ -0,0 +1,196 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ebuver &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL
+! COMBUSTION GAZ : FLAMME DE PREMELANGE - MODELE EBU
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+integer iphas
+
+!===============================================================================
+!===============================================================================
+! 1. OPTIONS DU CALCUL : TABLEAUX DE ppincl.h : formats 2000
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+
+if( srrom.lt.0d0 .or. srrom.ge.1d0) then
+ WRITE(NFECRA,2000)'SRROM ', SRROM
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 42. TABLEAUX DE cstphy.h et ppthch.F : formats 3000
+!===============================================================================
+
+iphas = 1
+
+! --> Masse volumique
+
+if( ro0(iphas).lt.0d0) then
+ WRITE(NFECRA,3000)IPHAS,'RO0 ', RO0(IPHAS)
+ iok = iok + 1
+endif
+
+! --> Diffusivite dynamique en kg/(m s) : DIFTL0
+
+if( diftl0.lt.0d0) then
+ WRITE(NFECRA,3010)'DIFTL0', DIFTL0
+ iok = iok + 1
+else
+ visls0(ihm) = diftl0
+endif
+
+! --> Constante du modele EBU
+
+if( cebu.lt.0d0) then
+ WRITE(NFECRA,3020)'CEBU', CEBU
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 3. FORMATS VERIFICATION
+!===============================================================================
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6, ' DOIT ETRE UN REEL ',/,&
+'@ SUPERIEUR OU EGAL A ZERO ET INFERIEUR STRICTEMENT A 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usebu1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usebu1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usebu1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A4,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usebu1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 6. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/cogz/lwcgfu.f90 b/src/cogz/lwcgfu.f90
new file mode 100644
index 0000000..53f1ac5
--- /dev/null
+++ b/src/cogz/lwcgfu.f90
@@ -0,0 +1,103 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lwcgfu &
+!================
+! --------------------------------------------------------
+ ( gfunc , f , fm , yfp2m , fp2m )
+! --------------------------------------------------------
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES VALEURS DE LA FONCTION G
+! SUIVANT LES PARAMETRES F, FM, FP2M. YP2M
+
+! LE RESULTAT EST :
+! ---------------
+! CALCUL DE LA VALEUR DE G AU POINT F
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+! gfunc ! r ! --> ! valeur de g au point f !
+! f ! r ! <-- ! valeur de la fraction de melange !
+! fm ! r ! <-- ! moyenne de la fraction de melange !
+! fp2m ! r ! <-- ! variance de la fraction de melange !
+! yp2m ! r ! <-- ! variance de la fraction massique !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+! Arguments
+
+double precision gfunc , f, fm, yfp2m, fp2m
+
+
+! VARIABLES LOCALES
+
+double precision epsi
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --> Initialisation
+
+gfunc = 0.d0
+epsi = 1.d-09
+
+!===============================================================================
+! 2. CALCUL DES VALEURS DE LA FONCTION G
+!===============================================================================
+
+if (fp2m .le. epsi) then
+ gfunc = 1.d0
+else
+ gfunc = (f-fm) * sqrt( 1.d0 + yfp2m/fp2m )
+endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/cogz/lwcini.f90 b/src/cogz/lwcini.f90
new file mode 100644
index 0000000..5bd5fed
--- /dev/null
+++ b/src/cogz/lwcini.f90
@@ -0,0 +1,549 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lwcini &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION GAZ MODELE LWC
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer iel, mode, igg, iphas, izone
+integer iscal, ivar, ii, idimte, itenso
+double precision hinit, coefg(ngazgm), hair, tinitk
+double precision sommqf, sommqt, sommq, tentm, fmelm
+double precision valmax, valmin, xkent, xeent, d2s3
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+iphas = 1
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+! ---> Initialisation au 1er passage avec de l'air a TINITK
+! ======================
+
+ if ( ipass.eq.1 ) then
+
+! ----- Temperature du melange : air a TINITK
+ tinitk = t0(iphas)
+
+! ----- Enthalpie de l'air a TINITK
+ if ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) then
+ coefg(1) = zero
+ coefg(2) = 1.d0
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hair , tinitk )
+ endif
+
+! ----- On en profite pour initialiser FRMEL et TGF
+! CAR on n'a pas encore vu usebuc.F
+
+ frmel = zero
+ tgf = 300.d0
+
+! ---- Initialisation de k et epsilon
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+ do iel = 1, ncel
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+
+ endif
+
+! ----- Fraction massique de fuel et sa variance
+
+ rtp(iel,isca(iyfm)) = fmax
+ rtp(iel,isca(iyfp2m)) = zero
+
+! ----- Fraction de melange et sa variance
+
+ rtp(iel,isca(ifm)) = fmax
+ rtp(iel,isca(ifp2m)) = zero
+
+ if ( ippmod(icolwc).ge. 2) then
+ rtp(iel,isca(icoyfp)) = zero
+ endif
+
+! ----- Enthalpie du melange
+
+ if ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5) then
+ rtp(iel,isca(ihm)) = hair
+ endif
+
+ enddo
+
+! ---> Initialisation au 2eme passage
+
+ else if ( ipass.eq.2 ) then
+
+! ----- Calculs preliminaires : Fraction de melange, T, H
+! (la valeur NOZAPM est utilisee pour inclure les aspects parall)
+ sommqf = zero
+ sommq = zero
+ sommqt = zero
+ do izone = 1, nozapm
+ sommqf = sommqf + qimp(izone)*fment(izone)
+ sommqt = sommqt + qimp(izone)*tkent(izone)
+ sommq = sommq + qimp(izone)
+ enddo
+
+ if(abs(sommq).gt.epzero) then
+ fmelm = sommqf / sommq
+ tentm = sommqt / sommq
+ else
+ fmelm = zero
+ tentm = t0(iphas)
+ endif
+
+! ----- Enthalpie du melange HINIT
+ if ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) then
+ coefg(1) = fmelm
+ coefg(2) = (1.d0-fmelm)
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hinit , tentm )
+ endif
+
+
+! ----- On donne la main a l'utilisateur
+
+ call uslwci &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+! ----- En periodique et en parallele,
+! il faut echanger ces initialisations (qui sont en fait dans RTPA)
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,isca(iyfm)))
+ !==========
+ call parcom(rtp(1,isca(iyfp2m )))
+ !==========
+ call parcom(rtp(1,isca(ifm)))
+ !==========
+ call parcom(rtp(1,isca(ifp2m )))
+ !==========
+
+ if ( ippmod(icolwc).ge.2) then
+ call parcom(rtp(1,isca(icoyfp )))
+ !==========
+ endif
+
+ if (ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) then
+ call parcom(rtp(1,isca(ihm )))
+ !==========
+ endif
+
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+
+ idimte = 0
+ itenso = 0
+ ivar = isca(iyfm)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+
+ idimte = 0
+ itenso = 0
+ ivar = isca(iyfp2m)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+
+ idimte = 0
+ itenso = 0
+ ivar = isca(ifm)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+
+ idimte = 0
+ itenso = 0
+ ivar = isca(ifp2m)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+
+ if ( ippmod(icolwc).ge.2) then
+ idimte = 0
+ itenso = 0
+ ivar = isca(icoyfp)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+ if ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 &
+ .or. ippmod(icolwc).eq.5 ) then
+ idimte = 0
+ itenso = 0
+ ivar = isca(ihm)
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+ endif
+
+
+! Impressions de controle
+
+ write(nfecra,2000)
+
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ ivar = isca(iscal)
+ valmax = -grand
+ valmin = grand
+ do iel = 1, ncel
+ valmax = max(valmax,rtp(iel,ivar))
+ valmin = min(valmin,rtp(iel,ivar))
+ enddo
+ chaine = nomvar(ipprtp(ivar))
+ if (irangp.ge.0) then
+ call parmin(valmin)
+ !==========
+ call parmax(valmax)
+ !==========
+ endif
+ write(nfecra,2010)chaine(1:8),valmin,valmax
+ enddo
+
+ write(nfecra,2020)
+
+ endif
+
+endif
+
+!----
+! FORMATS
+!----
+
+
+ 2000 format( &
+' ',/,&
+' ----------------------------------------------------------- ',/,&
+' ',/,&
+' ',/,&
+' ** INITIALISATION DES VARIABLES PROPRES AU GAZ (FL PRE LWC) ',/,&
+' -------------------------------------------------------- ',/,&
+' 2eme PASSAGE ',/,&
+' --------------------------------- ',/,&
+' Variable Valeur min Valeur max ',/,&
+' --------------------------------- ' )
+
+ 2010 format( &
+ 2x, a8, e12.4, e12.4 )
+
+ 2020 format( &
+' --------------------------------- ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/lwcphy.f90 b/src/cogz/lwcphy.f90
new file mode 100644
index 0000000..8f1ab0a
--- /dev/null
+++ b/src/cogz/lwcphy.f90
@@ -0,0 +1,323 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lwcphy &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME DE PREMELANGE MODELE LWC
+! Calcul de RHO adiabatique ou permeatique (transport de H)
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer igg, iphas, iel, ipcrom
+integer izone , ifac, ipbrom
+double precision coefg(ngazgm)
+double precision nbmol , temsmm
+double precision masmg
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 0. ON COMPTE LES PASSAGES
+!===============================================================================
+
+ipass = ipass + 1
+
+!===============================================================================
+! 1. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! ---> Initialisation
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+! ---> Positions des variables, coefficients
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+ipbrom = ipprob(irom(iphas))
+
+!===============================================================================
+! 2. DETERMINATION DES GRANDEURS THERMOCHIMIQUES MOYENNES
+!===============================================================================
+
+
+if ( (ippmod(icolwc).eq.0) .or. (ippmod(icolwc).eq.1) ) then
+
+ call pdflwc &
+ !==========
+ ( ncelet , ncel , &
+ rtp(1,isca(ifm)) , rtp(1,isca(ifp2m)) , &
+ rtp(1,isca(iyfm)) , rtp(1,isca(iyfp2m)) , &
+ propce )
+
+endif
+
+ if ( (ippmod(icolwc).eq.2) .or. (ippmod(icolwc).eq.3) ) then
+
+ call pdfpp3 &
+ !==========
+ ( ncelet , ncel , &
+ rtp(1,isca(ifm)) , rtp(1,isca(ifp2m)) , &
+ rtp(1,isca(iyfm)) , rtp(1,isca(iyfp2m)) , &
+ rtp(1,isca(icoyfp)) , &
+ propce )
+
+ endif
+
+ if ( (ippmod(icolwc).eq.4).or.(ippmod(icolwc).eq.5) ) then
+
+ call pdfpp4 &
+ !==========
+ ( ncelet , ncel , &
+ rtp(1,isca(ifm)) , rtp(1,isca(ifp2m)) , &
+ rtp(1,isca(iyfm)) , rtp(1,isca(iyfp2m)) , &
+ rtp(1,isca(icoyfp)) , &
+ propce )
+
+ endif
+
+!===============================================================================
+! 3. CALCUL DE RHO ET DES FRACTIONS MASSIQUES DES ESPECES GLOBALES
+! SUR LES BORDS
+!===============================================================================
+
+! --> Masse volumique au bord
+
+iphas = 1
+ibrom(iphas) = 1
+
+! ---- Masse volumique au bord pour toutes les facettes
+! Les facettes d'entree seront recalculees.
+
+do ifac = 1, nfabor
+iel = ifabor(ifac)
+ propfb(ifac,ipbrom) = propce(iel,ipcrom)
+enddo
+
+! ---- Masse volumique au bord pour les facettes d'entree UNIQUEMENT
+! Le test sur IZONE sert pour les reprises de calcul
+
+if ( ipass.gt.1 .or. isuite.eq.1 ) then
+ do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if(izone.gt.0) then
+ if ( ientgb(izone).eq.1 .or. ientgf(izone).eq. 1) then
+ coefg(1) = fment(izone)
+ coefg(2) = 1.d0-fment(izone)
+ coefg(3) = zero
+ if ( ientgb(izone).eq.1 ) then
+ coefg(1) = max(zero,(fment(izone)-fs(1))/(1.d0-fs(1)))
+ coefg(3) = (fment(izone)-coefg(1))/fs(1)
+ coefg(2) = 1.d0 - coefg(1) - coefg(3)
+ endif
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ masmg = 1.d0/nbmol
+ temsmm = tkent(izone)/masmg
+ propfb(ifac,ipbrom) = p0(iphas)/(rr*temsmm)
+ endif
+ endif
+ enddo
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/lwctcl.f90 b/src/cogz/lwctcl.f90
new file mode 100644
index 0000000..775fcbe
--- /dev/null
+++ b/src/cogz/lwctcl.f90
@@ -0,0 +1,663 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lwctcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! COMBUSTION GAZ MODELE LWC
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra , nbr
+integer igg, iphas, ifac, izone, mode
+integer ipbrom, icke, ipcvis, ii, iel, iok
+double precision qisqc, viscla, d2s3, uref2, rhomoy, dhy, xiturb
+double precision ustar2, xkent, xeent, hgazf , tgazf, hgazb, tgazb
+double precision qcalc(nozppm), hgent(nozppm)
+double precision coefg(ngazgm)
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+ipbrom = ipprob(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+d2s3 = 2.d0/3.d0
+
+do igg = 1, ngazgm
+ coefg(igg) = 0
+enddo
+
+!===============================================================================
+! 1. ECHANGES EN PARALLELE POUR LES DONNEES UTILISATEUR
+!===============================================================================
+
+! En realite on pourrait eviter cet echange en modifiant usebuc et en
+! demandant a l'utilisateur de donner les grandeurs dependant de la
+! zone hors de la boucle sur les faces de bord : les grandeurs
+! seraient ainsi disponibles sur tous les processeurs. Cependant,
+! ca rend le sous programme utilisateur un peu plus complique et
+! surtout, si l'utilisateur le modifie de travers, ca ne marche pas.
+! On suppose que toutes les gandeurs fournies sont positives, ce qui
+! permet d'utiliser un max pour que tous les procs les connaissent.
+! Si ce n'est pas le cas, c'est plus complique mais on peut s'en tirer
+! avec un max quand meme.
+
+if(irangp.ge.0) then
+ call parrmx(nozapm,qimp )
+ !==========
+ call parrmx(nozapm,fment )
+ !==========
+ call parrmx(nozapm,tkent )
+ !==========
+ call parimx(nozapm,iqimp )
+ !==========
+ call parimx(nozapm,ientgf)
+ !==========
+ call parimx(nozapm,ientgb)
+ !==========
+endif
+
+!===============================================================================
+! 2. SI IQIMP = 1 : CORRECTION DES VITESSES (EN NORME) POUR CONTROLER
+! LES DEBITS IMPOSES
+! SI IQIMP = 0 : CALCUL DE QIMP
+
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+
+! --- Debit calcule
+
+do izone = 1, nozppm
+ qcalc(izone) = 0.d0
+enddo
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ qcalc(izone) = qcalc(izone) - propfb(ifac,ipbrom) * &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+enddo
+if(irangp.ge.0) then
+ call parrsm(nozapm,qcalc)
+endif
+do izone = 1, nozapm
+ if ( iqimp(izone).eq.0 ) then
+ qimp(izone) = qcalc(izone)
+ endif
+enddo
+
+! --- Correction des vitesses en norme
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( iqimp(izone).eq.1 ) then
+ if(qcalc(izone).lt.epzero) then
+ write(nfecra,2001)izone,iqimp(izone),qcalc(izone)
+ iok = iok + 1
+ endif
+ endif
+enddo
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if ( iqimp(izone).eq.1 ) then
+ qisqc = qimp(izone)/qcalc(izone)
+ rcodcl(ifac,iu(iphas),1) = rcodcl(ifac,iu(iphas),1)*qisqc
+ rcodcl(ifac,iv(iphas),1) = rcodcl(ifac,iv(iphas),1)*qisqc
+ rcodcl(ifac,iw(iphas),1) = rcodcl(ifac,iw(iphas),1)*qisqc
+ endif
+enddo
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le debit est impose sur la zone IZONE = ', I10 ,/,&
+'@ puisque IQIMP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, le produit RHO D S integre est nul : ',/,&
+'@ il vaut = ',E14.5 ,/,&
+'@ (D est la direction selon laquelle est impose le debit).',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uslwcc, et en particulier ',/,&
+'@ - que le vecteur RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) qui determine',/,&
+'@ la direction de la vitesse est non nul et n''est pas ',/,&
+'@ uniformement perpendiculaire aux face d''entree ',/,&
+'@ - que la surface de l''entree n''est pas nulle (ou que ',/,&
+'@ le nombre de faces de bord dans la zone est non nul) ',/,&
+'@ - que la masse volumique n''est pas nulle ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 4. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LA TURBULENCE
+!===============================================================================
+
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique de la turbulence
+
+ if ( icalke(izone).ne.0 ) then
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ + rcodcl(ifac,iv(iphas),1)**2 &
+ + rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,epzero)
+ rhomoy = propfb(ifac,ipbrom)
+ iel = ifabor(ifac)
+ viscla = propce(iel,ipcvis)
+ icke = icalke(izone)
+ dhy = dh(izone)
+ xiturb = xintur(izone)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+ if (icke.eq.1) then
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscla, cmu, xkappa, &
+ ustar2, xkent, xeent )
+ else if (icke.eq.2) then
+ call keenin &
+ !==========
+ ( uref2, xiturb, dhy, cmu, xkappa, xkent, xeent )
+ endif
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 3. VERIFICATION DES DONNEES POUR LA FRACTION DE MELANGE
+! ET LA TEMPERATURE DES GAZ FRAIS
+! (modele lwc)
+!===============================================================================
+
+iphas = 1
+
+! --- FRMEL et TGF (on n'en veut qu'un : on prend le max)
+! EBU nominal est a f homogene
+! On se limite pour l'instant a une temperature
+! des gaz frais identiques
+
+! FRMEL = 0.D0
+! TGF = 0.D0
+! DO IFAC = 1, NFABOR
+! IF ( ITYPFB(IFAC,IPHAS).EQ.IENTRE ) THEN
+! IZONE = IZFPPP(IFAC)
+! IF ( IPPMOD(ICOEBU).EQ.0 .OR. IPPMOD(ICOEBU).EQ.1 ) THEN
+! FRMEL = MAX(FMENT(IZONE),FRMEL)
+! ENDIF
+! IF (IENTGF(IZONE).EQ.1) THEN
+! TGF = MAX(TKENT(IZONE),TGF)
+! ENDIF
+! ENDIF
+! ENDDO
+
+! IF(IRANGP .GE.0) THEN
+! CALL PARMAX(FRMEL)
+! CALL PARMAX(TGF )
+! ENDIF
+
+! Attention, ici on modifie FMENT et TKENT sur les zones
+! presentes sur le proc local. Ca suffit pour le traitement qui suit.
+! DO IFAC = 1, NFABOR
+! IZONE = IZFPPP(IFAC)
+! IF ( ITYPFB(IFAC,IPHAS).EQ.IENTRE ) THEN
+! IF ( IPPMOD(ICOEBU).EQ.0 .OR. IPPMOD(ICOEBU).EQ.1 ) THEN
+! FMENT(IZONE) = FRMEL
+! ENDIF
+! IF (IENTGF(IZONE).EQ.1) THEN
+! TKENT(IZONE) = TGF
+! ENDIF
+! ENDIF
+! ENDDO
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LES SCALAIRES
+! (modele ebu)
+!===============================================================================
+
+
+! ---> Combustion gaz USLWCC
+! Flamme de premelange modele LWC
+
+iphas = 1
+
+! Enthalpie du melange gazeux :
+! hors de la boucle pour eviter un appel par face.
+! Suppose que une entree est forcement IENTGF=1 ou IENTGB=1
+
+
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+! Entree 1
+ if ( ientgf(izone).eq.1 ) then
+ tgazf = tkent(izone)
+ coefg(1) = fment(izone)
+ coefg(2) = 1.d0 - fment(izone)
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hgazf , tgazf )
+ hgent(izone) = hgazf
+! Entree 2
+ elseif ( ientgb(izone).eq.1 ) then
+ tgazb = tkent(izone)
+ coefg(1) = fment(izone)
+ coefg(2) = 1.d0 - fment(izone)
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hgazb , tgazb )
+ hgent(izone) = hgazb
+ endif
+enddo
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique des scalaires physiques particulieres
+
+! Entree gaz frais
+
+ if ( ientgf(izone).eq.1 ) then
+
+! - Fraction massique de fuel
+ rcodcl(ifac,isca(iyfm),1) = fment(izone)
+
+! - Variance de la fraction massique
+ rcodcl(ifac,isca(iyfp2m),1) = zero
+
+! - Fraction de melange
+ rcodcl(ifac,isca(ifm),1) = fment(izone)
+
+! - Variance de la fraction de melange
+ rcodcl(ifac,isca(ifp2m),1) = zero
+
+ if ( ippmod(icolwc).ge.2 ) then
+ rcodcl(ifac,isca(icoyfp),1) = zero
+ endif
+
+! - Enthalpie du melange gazeux
+ if ( ippmod(icolwc) .eq. 1 .or. &
+ ippmod(icolwc) .eq. 3 .or. &
+ ippmod(icolwc) .eq. 5 ) then
+ rcodcl(ifac,isca(ihm),1) = hgent(izone)
+ endif
+
+ elseif ( ientgb(izone).eq.1 ) then
+
+! Entree gaz brule
+
+! - Fraction massique de fuel
+ rcodcl(ifac,isca(iyfm),1) = zero
+
+! - Variance de la fraction massique
+ rcodcl(ifac,isca(iyfp2m),1) = zero
+
+! - Fraction de melange
+ rcodcl(ifac,isca(ifm),1) = fment(izone)
+
+! - Variance de la fraction de melange
+ rcodcl(ifac,isca(ifp2m),1) = zero
+
+ if ( ippmod(icolwc) .ge.2) then
+ rcodcl(ifac,isca(icoyfp),1) = zero
+ endif
+
+! - Enthalpie du melange gazeux
+ if ( ippmod(icolwc) .eq. 1 .or. &
+ ippmod(icolwc) .eq. 3 .or. &
+ ippmod(icolwc) .eq. 5 ) then
+ rcodcl(ifac,isca(ihm),1) = hgent(izone)
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+! Calcul de FMIN/FMAX et HMIN/HMAX sur les entrees
+
+fmin = 1.e+30
+fmax =-1.e+30
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+ if ( fment(izone) .lt. fmin ) then
+ fmin= fment(izone)
+ hmin= hgent(izone)
+ endif
+ if ( fment(izone) .gt. fmax ) then
+ fmax= fment(izone)
+ hmax= hgent(izone)
+ endif
+ endif
+enddo
+
+if (irangp.ge.0) then
+ nbr = 1
+ call parmxl(nbr,fmax,hmax)
+ call parmnl(nbr,fmin,hmin)
+endif
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cogz/lwctss.f90 b/src/cogz/lwctss.f90
new file mode 100644
index 0000000..81902c3
--- /dev/null
+++ b/src/cogz/lwctss.f90
@@ -0,0 +1,543 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lwctss &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ izfppp , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME PREMELANGE MODELE LWC
+! ON PRECISE LES TERMES SOURCES POUR UN SCALAIRE PP
+! SUR UN PAS DE TEMPS
+
+! ATTENTION : LE TRAITEMENT DES TERMES SOURCES EST DIFFERENT
+! --------- DE CELUI DE USTSSC.F
+
+! ON RESOUT ROVSDT*D(VAR) = SMBRS
+
+! ROVSDT ET SMBRS CONTIENNENT DEJA D'EVENTUELS TERMES SOURCES
+! UTILISATEUR. IL FAUT DONC LES INCREMENTER ET PAS LES
+! ECRASER
+
+! POUR DES QUESTIONS DE STABILITE, ON NE RAJOUTE DANS ROVSDT
+! QUE DES TERMES POSITIFS. IL N'Y A PAS DE CONTRAINTE POUR
+! SMBRS
+
+! DANS LE CAS D'UN TERME SOURCE EN CEXP + CIMP*VAR ON DOIT
+! ECRIRE :
+! SMBRS = SMBRS + CEXP + CIMP*VAR
+! ROVSDT = ROVSDT + MAX(-CIMP,ZERO)
+
+! ON FOURNIT ICI ROVSDT ET SMBRS (ILS CONTIENNENT RHO*VOLUME)
+! SMBRS en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! ROVSDT en kg /s
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivar, iel, iphas, idirac, ivar0
+integer iphydp , itenso , idimte
+integer inc , iccocg
+integer ipcvst
+integer ipcrom, ii
+
+integer iptscl(ndracm), ipfmal(ndracm)
+integer ipfmel(ndracm), iprhol(ndracm)
+double precision sum, epsi
+double precision tsgrad, tschim, tsdiss
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+epsi = 1.0d-10
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! ---
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+! --- Numero des grandeurs physiques (voir usclim)
+do idirac = 1, ndirac
+ iptscl(idirac) = ipproc(itscl(idirac))
+ ipfmal(idirac) = ipproc(ifmal(idirac))
+ ipfmel(idirac) = ipproc(ifmel(idirac))
+ iprhol(idirac) = ipproc(irhol(idirac))
+enddo
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES
+!===============================================================================
+
+if ( ivar.eq.isca(iyfm) ) then
+
+! ---> Terme source pour la fraction massique moyenne de fuel
+
+ do iel = 1, ncel
+ sum = zero
+ do idirac = 1, ndirac
+ sum = sum + propce(iel,iprhol(idirac)) &
+ *propce(iel,iptscl(idirac))*volume(iel)
+ enddo
+
+! terme implicite
+
+ if (rtpa(iel,ivar).gt.epsi) then
+ rovsdt(iel) = rovsdt(iel) + max(-sum/rtpa(iel,ivar),zero)
+ endif
+
+! terme explicite
+
+ smbrs(iel) = smbrs(iel) + sum
+
+ enddo
+
+endif
+
+! ---> Terme source pour la variance de la fraction massique moyenne de fuel
+
+if (ivar.eq.isca(iyfp2m)) then
+
+ do iel = 1, ncel
+ sum = zero
+ do idirac = 1, ndirac
+ sum = sum + (propce(iel,iptscl(idirac))*volume(iel) &
+ *(propce(iel,ipfmal(idirac)) - rtpa(iel,isca(iyfm))) &
+ *propce(iel,iprhol(idirac)))
+ enddo
+ smbrs(iel) = smbrs(iel) + sum
+ enddo
+
+endif
+
+! ---> Terme source pour la covariance
+
+if ( ivar.eq.isca(icoyfp)) then
+
+! --- Calcul du gradient de F
+! =======================
+
+ ii = isca(ifm)
+ do iel = 1, ncel
+ w10(iel) = rtpa(iel,ii)
+ enddo
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(w10)
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w10 , w10 , w10 , &
+ w10 , w10 , w10 , &
+ w10 , w10 , w10 )
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+ iphydp = 0
+ inc = 1
+ iccocg = 1
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgr(ii) , imligr(ii) , &
+ iphydp , iwarni(ii) , nfecra , &
+ epsrgr(ii) , climgr(ii) , extrag(ii) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w10 , w10 , w10 , &
+ w10 , coefa(1,iclrtp(ii,icoef)) , &
+ coefb(1,iclrtp(ii,icoef)) , &
+ w1 , w2 , w3 , &
+! d./dx1 , d./dx2 , d./dx3 ,
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+! --- Calcul du gradient de Yfuel
+! ===========================
+
+ ii = isca(iyfm)
+ do iel = 1, ncel
+ w11(iel) = rtpa(iel,ii)
+ enddo
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(w11)
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w11 , w11 , w11 , &
+ w11 , w11 , w11 , &
+ w11 , w11 , w11 )
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+ iphydp = 0
+ inc = 1
+ iccocg = 1
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgr(ii) , imligr(ii) , &
+ iphydp , iwarni(ii) , nfecra , &
+ epsrgr(ii) , climgr(ii) , extrag(ii) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w11 , w11 , w11 , &
+ w11 , coefa(1,iclrtp(ii,icoef)) , &
+ coefb(1,iclrtp(ii,icoef)) , &
+ w7 , w8 , w9 , &
+! d./dx1 , d./dx2 , d./dx3 ,
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+
+! --- Calcul du terme source
+! ======================
+
+
+! ---> Calcul de K et Epsilon en fonction du modele de turbulence
+
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ do iel = 1, ncel
+ w10(iel) = rtpa(iel,ik(iphas))
+ w11(iel) = rtpa(iel,iep(iphas))
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+ do iel = 1, ncel
+ w10(iel) = ( rtpa(iel,ir11(iphas)) &
+ +rtpa(iel,ir22(iphas)) &
+ +rtpa(iel,ir33(iphas)) ) / 2.d0
+ w11(iel) = rtpa(iel,iep(iphas))
+ enddo
+
+ elseif (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+ w10(iel) = rtpa(iel,ik(iphas))
+ w11(iel) = rtpa(iel,iep(iphas))
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+ do iel = 1, ncel
+ w10(iel) = rtpa(iel,ik(iphas))
+ w11(iel) = cmu*rtpa(iel,ik(iphas))*rtpa(iel,iomg(iphas))
+ enddo
+
+ endif
+
+ do iel=1,ncel
+
+! A confirmer :
+! Le terme de dissipation devrait etre implicite
+! Dans le terme de dissipation, il manque une constante Cf
+! Peut-elle etre consideree egale a 1 ?
+! Verifier le signe du terme de production
+!-
+! terme implicite
+
+
+ w11(iel) = w11(iel)/(w10(iel)*rvarfl(iscal)) &
+ *volume(iel)*propce(iel,ipcrom)
+ rovsdt(iel) = rovsdt(iel) + max(w11(iel),zero)
+
+! terme de gradient
+
+ tsgrad = (2.0d0 &
+ * propce(iel,ipcvst)/(sigmas(iscal)) &
+ *(w1(iel)*w7(iel)+w2(iel)*w8(iel)+w3(iel)*w9(iel))) &
+ *volume(iel)
+
+
+! terme de dissipation
+
+ tsdiss = -w11(iel) * rtpa(iel,ivar)
+
+! terme de chimique
+
+ tschim = zero
+ do idirac = 1, ndirac
+ tschim = tschim &
+ + (propce(iel,iptscl(idirac)) &
+ *(propce(iel,ipfmel(idirac))-rtpa(iel,isca(ifm))) &
+ *volume(iel))*propce(iel,iprhol(idirac))
+ enddo
+
+! --> Somme des termes
+
+ smbrs(iel) = smbrs(iel) + tschim + tsgrad + tsdiss
+
+ enddo
+
+ endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cogz/lwcurl.f90 b/src/cogz/lwcurl.f90
new file mode 100644
index 0000000..b10229c
--- /dev/null
+++ b/src/cogz/lwcurl.f90
@@ -0,0 +1,193 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lwcurl &
+!================
+
+ ( ampen1 , valmoy , valvar , valmin , valmax , &
+ exit01 , exit02 , ampl01 , ampl02 )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES PARAMETRES DE LA PDF
+! PDF LIBBY - WILLIAMS 2 POINTS EN UTILISANT LE
+! MOMENT D'ORDRE 3 DEDUIT DES RECURRENCES SUR
+! LES FONCTIONS BETA
+
+! COMMENTAIRES : HYPOTHESE DE CURL MODIFIEE
+! ------------
+! a partir de la valeur moyenne d'une variable,
+! des extremas et de la variance de cette variable
+! on en deduit 2 etat autour de l'etat moyen
+! et une amplitude pour chaque etat
+
+! LE RESULTAT EST :
+! ---------------
+
+! CALCUL DES PARAMETRES ASSOCIES AUX FONCTIONS DIRAC
+
+! Les Diracs sont en position [F(.,1),Y(.,1)] et [F(.,2),Y(.,2)]
+! Leurs amplitudes respectives sont D(.,1) et D(.,2)
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ampen1 ! r ! <-- ! amplitude totale des pics !
+! valmoy ! r ! <-- ! valeur moyenne de la variable !
+! valvar ! r ! <-- ! variance de la variable !
+! valmin ! r ! <-- ! min de la variable !
+! valmax ! r ! <-- ! max de la variable !
+! exit01 ! r ! --> ! etat 1 !
+! exit02 ! r ! --> ! etat 2 !
+! ampl01 ! r ! --> ! amplitude 1 !
+! ampl02 ! r ! --> ! amplitude 2 !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+double precision valmoy, valvar
+double precision valmin, valmax
+double precision exit01, exit02
+double precision ampl01, ampl02
+double precision ampen1
+
+! VARIABLES LOCALES
+
+double precision tvv, c, d
+double precision moyadm, varadm, tvvadm
+double precision epsi
+!===============================================================================
+! 0. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! ---> Test sur l'amplitude totale des pics
+! si elle est trop faible on positionne
+! les deux etat sur l'etat moyen
+
+epsi = 1.d-6
+
+if (ampen1.gt.epsi) then
+
+! ---> Test sur la variance,
+! si elle est trop faible on positionne
+! les deux etat sur l'etat moyen
+
+ if ((valvar.gt.epsi)) then
+
+! ---> on travaille en variable adimentionnelle pour ce calcul
+
+ moyadm = (valmoy-valmin)/(valmax-valmin)
+ varadm = valvar/((valmax-valmin)**2)
+
+! ---> calcul du moment d'ordre 3 adim
+
+ tvvadm = 2.d0*varadm**2 &
+ *((1.d0-2.d0*moyadm)/((moyadm*(1-moyadm))+varadm))
+
+! ---> calcul du moment d'ordre 3 non adim
+
+ tvv = ((valmax-valmin)**3)*tvvadm
+
+! ---> calcul du termedu polynome du moment 3
+
+ c=(4.d0+tvv**2/valvar**3)
+
+! ---> determination du signe de la racine
+
+ if ((1.d0-moyadm).gt.moyadm) then
+ d = 0.5d0+sqrt((c-4.d0)/(4.d0*c))
+ else
+ d = 0.5d0-sqrt((c-4.d0)/(4.d0*c))
+ endif
+
+! ---> calcul des amplitudes des 2 pics
+
+ ampl01 = ampen1 * d
+ ampl02 = ampen1 - ampl01
+
+! -----> Calcul des positions des deux pics
+
+ exit01 = valmoy - sqrt((1.d0-d)/(d)*valvar)
+ exit02 = valmoy + sqrt((d)/(1.d0-d)*valvar)
+
+ exit01 = max(valmin,min(exit01,valmax))
+ exit02 = max(valmin,min(exit02,valmax))
+
+ else
+! variance faible
+
+ ampl01 = ampen1/2.d0
+ ampl02 = ampl01
+
+ exit01 = valmoy
+ exit02 = valmoy
+
+ endif
+
+else
+! amplitude totale faible
+
+ ampl01 = ampen1/2.d0
+ ampl02 = ampl01
+
+ exit01 = valmoy
+ exit02 = valmoy
+
+endif
+
+end
diff --git a/src/cogz/lwcver.f90 b/src/cogz/lwcver.f90
new file mode 100644
index 0000000..89b0913
--- /dev/null
+++ b/src/cogz/lwcver.f90
@@ -0,0 +1,207 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lwcver &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL
+! COMBUSTION GAZ : FLAMME DE PREMELANGE - MODELE LWC
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+integer iphas
+
+!===============================================================================
+!===============================================================================
+! 1. OPTIONS DU CALCUL : TABLEAUX DE ppincl.h : formats 2000
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+
+if( srrom.lt.0d0 .or. srrom.ge.1d0) then
+ WRITE(NFECRA,2000)'SRROM ', SRROM
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 2. TABLEAUX DE cstphy.h et ppthch.F : formats 3000
+!===============================================================================
+
+iphas = 1
+
+! --> Masse volumique
+
+if( ro0(iphas).lt.0d0) then
+ WRITE(NFECRA,3000)IPHAS,'RO0 ', RO0(IPHAS)
+ iok = iok + 1
+endif
+
+! --> Diffusivite dynamique en kg/(m s) : DIFTL0
+
+if( diftl0.lt.0d0) then
+ WRITE(NFECRA,3010)'DIFTL0', DIFTL0
+ iok = iok + 1
+else
+ visls0(ihm) = diftl0
+endif
+
+! --> Constante du modele LWC
+
+if( vref.lt.0d0) then
+ WRITE(NFECRA,3020)'VREF', VREF
+ iok = iok + 1
+endif
+if( lref.lt.0d0) then
+ WRITE(NFECRA,3020)'LREF', LREF
+ iok = iok + 1
+endif
+if( ta.lt.0d0) then
+ WRITE(NFECRA,3020)'TA', TA
+ iok = iok + 1
+endif
+if( tstar.lt.0d0) then
+ WRITE(NFECRA,3020)'TSTAR', TSTAR
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 3. FORMATS VERIFICATION
+!===============================================================================
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6, ' DOIT ETRE UN REEL ',/,&
+'@ SUPERIEUR OU EGAL A ZERO ET INFERIEUR STRICTEMENT A 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uslwc1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uslwc1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uslwc1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A4,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uslwc1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 6. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/cogz/pdflwc.f90 b/src/cogz/pdflwc.f90
new file mode 100644
index 0000000..4d85427
--- /dev/null
+++ b/src/cogz/pdflwc.f90
@@ -0,0 +1,777 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine pdflwc &
+!================
+
+ ( ncelet , ncel , &
+ fm , fp2m , yfm , yfp2m , &
+ propce )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES PARAMETRES DE LA PDF
+! PDF LIBBY - WILLIAMS 2 POINTS AVEC HYPOTHESE DE CURL
+
+
+! COMMENTAIRES :
+! ------------
+
+! Dans un diagramme (F, Yf), on construit deux droites:
+! - La droite de combustion complete
+! - La droite de melange
+
+! Dans ce domaine, nous allons trouver deux pics qui
+! definiront une troisieme droite sur laquelle on definit
+! une abscisse curviligne G.
+
+
+! LE RESULTAT EST :
+! ---------------
+
+! CALCUL DES PARAMETRES ASSOCIES AUX FONCTIONS DIRAC
+
+! Les Diracs sont en position [F(.,1),Y(.,1)] et [F(.,2),Y(.,2)]
+! Leurs amplitudes respectives sont D(.,1) et D(.,2)
+! Pour chaque dirac,
+! on calcule la temperature [T(.,1), T(.,2)]
+! la masse volumique [RHO(.,1), RHO(.,2)]
+! le terme source chimique [W(.,1),W(.,2)]
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! fm ! tr ! <-- ! moyenne de la fraction de melange !
+! fp2m ! tr ! <-- ! variance de la fraction de melange !
+! yfm ! tr ! <-- ! moyenne de la fraction massique !
+! yfp2m ! tr ! <-- ! variance de la fraction massique !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel
+
+double precision fm(ncelet) , fp2m(ncelet)
+double precision yfm(ncelet) , yfp2m(ncelet)
+double precision propce(ncelet,*)
+
+! VARIABLES LOCALES
+
+integer iel, igg, idirac, iphas
+integer mode
+
+double precision coefg(ngazgm), epsi
+double precision yfuel
+double precision yoxyd, yo2
+double precision yprod,fmp,fp2mp,yfmp,yfp2mp
+
+! --- Expression des droites
+
+double precision aa1, aa2
+double precision aa3, aa6
+double precision bb1, bb2
+double precision bb3, bb6
+double precision f12, f13, f14
+double precision f15, f16
+
+! --- Extrema
+
+double precision gmin, gmax, gp2m
+double precision g1max, g2max, g3max
+double precision g1min, g2min
+double precision g3min, g4min
+
+! --- Position des Diracs
+
+double precision f(ndracm) , y(ndracm) , d(ndracm)
+double precision g(ndracm) , h(ndracm)
+double precision teml(ndracm) , maml(ndracm)
+double precision w(ndracm) , rhol(ndracm)
+double precision theta(ndracm)
+
+! --- Pointeurs & autres
+
+integer ipctem, ipcmam, ipcrom
+integer ipampl(ndracm), ipfmel(ndracm)
+integer ipfmal(ndracm), ipteml(ndracm)
+integer ipmaml(ndracm)
+integer iprhol(ndracm), iptscl(ndracm)
+integer ipcfue, ipcoxy, ipcpro, ipctsc
+! INTEGER IPCKAB, IPT4 , IPT3
+double precision nbmol, temsmm
+double precision sum1, sum2, sum3, sum4, sum5, sum6 , sum16
+double precision sum7, sum8, sum9, sum10, sum11, sum12, sum15
+double precision sum17
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 0. POSITION DES VARIABLES
+!===============================================================================
+
+do idirac = 1, ndirac
+ ipampl(idirac) = ipproc(iampl(idirac))
+ ipfmel(idirac) = ipproc(ifmel(idirac))
+ ipfmal(idirac) = ipproc(ifmal(idirac))
+ ipteml(idirac) = ipproc(iteml(idirac))
+ ipmaml(idirac) = ipproc(imaml(idirac))
+ iprhol(idirac) = ipproc(irhol(idirac))
+ iptscl(idirac) = ipproc(itscl(idirac))
+enddo
+ipcfue = ipproc(iym(1))
+ipcoxy = ipproc(iym(2))
+ipcpro = ipproc(iym(3))
+ipctsc = ipproc(itsc)
+ipctem = ipproc(itemp)
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+ipcmam = ipproc(imam)
+
+! IF ( IIRAYO.GT.0 ) THEN
+! IPCKAB = IPPROC(ICKABS)
+! IPT4 = IPPROC(IT4M)
+! IPT3 = IPPROC(IT3M)
+! ENDIF
+
+! ---> Initialisation
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+epsi = 1.d-09
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+ipass = ipass + 1
+
+do iel = 1, ncel
+
+
+ fmp = max(min(fmax,fm(iel)),fmin)
+ yfmp = fmp-((fmp-max(zero,(fmp-fs(1))/(1.d0-fs(1)))) &
+ /(fm(iel)-max(zero, &
+ (fm(iel)-fs(1))/(1.d0-fs(1))))*(fm(iel)-yfm(iel)))
+ yfmp = max(min(yfm(iel),fmp), &
+ zero,(fmp-fs(1))/(1.d0-fs(1)))
+ fp2mp = max(min(fp2m(iel), &
+ (min(fmax,(1-fs(1))*yfmp+fs(1))-fmp) &
+ * (fmp-max(fmin,yfmp))),zero)
+ yfp2mp = max(min(yfp2m(iel),(fmp-yfmp) &
+ * (yfmp-max(zero, &
+ (fmp-fs(1))/(1.d0-fs(1))))),zero)
+
+
+!===============================================================================
+! 2. NON PASSAGE PAR LA PDF
+!===============================================================================
+
+ if ( (fp2mp.le.epsi).and.(yfp2mp.le.epsi )) then
+
+ sum1 = zero
+ sum2 = zero
+ sum3 = zero
+ sum4 = zero
+ sum5 = zero
+ sum6 = zero
+ sum15 = zero
+ sum16 = zero
+
+ do idirac =1, ndirac
+ d(idirac) = 1.d0 / ndirac
+ f(idirac) = fmp
+ y(idirac) = yfmp
+
+! ---> Calcul de l'enthalpie
+
+ h(idirac) = ((hmax-hmin)*f(idirac) + hmin*fmin - hmax*fmax) &
+ / (fmin-fmax)
+
+! ---> Calcul de la fraction massique des gaz (F, O et P)
+
+ yfuel = y(idirac)
+ yoxyd = 1.d0 - (coeff3+1.0d0)*f(idirac) + coeff3*y(idirac)
+ yprod = 1.d0 - yfuel - yoxyd
+ yo2 = coeff1 - (coeff1 + coeff2) * f(idirac) &
+ + coeff2 * y(idirac)
+
+! ---> Calcul de la masse molaire et de la temperature
+
+ coefg(1) = yfuel
+ coefg(2) = yoxyd
+ coefg(3) = yprod
+
+! ------ Masse molaire
+
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ maml(idirac) = 1.d0/nbmol
+
+! ------ Calcul de la temperature pour le pic 1 et 2
+
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ h(idirac) , teml(idirac) )
+
+! ---> Calcul de la masse volumique en 1 et 2
+
+ if ( ipass.gt.1.or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ rhol(idirac) = p0(iphas) * maml(idirac) &
+ / (rr*teml(idirac))
+ else
+ rhol(idirac) = ro0(iphas)
+ endif
+
+! ---> Calcul du terme source en 1 et 2 du scalaire YFM
+
+ theta(idirac) = ta / teml(idirac) &
+ * (1.d0 - teml(idirac) / tstar)
+
+ w(idirac) = vref / lref * (- d(idirac)*rhol(idirac) &
+ * yfuel*yo2 &
+ * exp( -theta(idirac) ))
+
+! ---> Masse molaire du melange
+
+ sum1 = sum1 + d(idirac)*maml(idirac)
+
+! ---> Temperature du melange
+
+ sum2 = sum2 + d(idirac)*teml(idirac)
+
+! ---> Temperature / Masse molaire
+
+ sum3 = sum3 + d(idirac)*teml(idirac)/maml(idirac)
+
+! ---> Fractions massiques des especes globales
+
+ sum4 = sum4 + yfuel*d(idirac)
+
+ sum5 = sum5 + yoxyd*d(idirac)
+
+ sum6 = sum6 + yprod*d(idirac)
+
+ sum15 = sum15 +rhol(idirac)*d(idirac)
+
+ sum16 = sum16 +w(idirac)
+
+! ---> Stockage des proprietes via PROPCE
+
+ propce(iel,ipampl(idirac)) = d(idirac)
+ propce(iel,ipfmel(idirac)) = f(idirac)
+ propce(iel,ipfmal(idirac)) = y(idirac)
+ propce(iel,ipteml(idirac)) = teml(idirac)
+ propce(iel,ipmaml(idirac)) = maml(idirac)
+ propce(iel,iprhol(idirac)) = rhol(idirac)
+ propce(iel,iptscl(idirac)) = w(idirac)
+
+ enddo
+
+ propce(iel,ipcmam) = sum1
+ propce(iel,ipctem) = sum2
+ temsmm = sum3
+ propce(iel,ipcfue) = sum4
+ propce(iel,ipcoxy) = sum5
+ propce(iel,ipcpro) = sum6
+ propce(iel,ipctsc) = sum16
+
+! ---> Masse volumique du melange
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ propce(iel,ipcrom) = srrom * propce(iel,ipcrom) &
+ + (1.d0-srrom) * (p0(iphas)/(rr*temsmm))
+ endif
+
+ else
+
+!===============================================================================
+! 3. PASSAGE PAR LA PDF
+!===============================================================================
+
+ if ( ( (fp2mp.gt.epsi) .and. (yfp2mp.lt.epsi) ) &
+ .or.( (fp2mp.lt.epsi) .and. (yfp2mp.gt.epsi) ) )then
+
+! -- Choix suivant les differents cas
+
+! --- CAS 1 : Droite Verticale
+! =====
+ if (fp2mp .lt. epsi) then
+
+! ---> Choix des extrema
+
+ gmin = max ( - yfmp, &
+ - (yfmp-(fmp-fs(1))/(1.d0-fs(1))))
+ gmax = fmp - yfmp
+
+! ---> Calcul des amplitudes des Diracs
+
+ d(1) = gmax / ( gmax-gmin )
+ d(2) = (1.d0 - d(1))
+
+! ---> Calcul de la variance de l'abscisse curviligne (GP2M)
+
+ gp2m = fp2mp + yfp2mp
+
+! ---> Test sur GP2M
+
+ g(1) = -sqrt( -gmin/gmax*gp2m )
+ g(2) = -d(1) * g(1) / d(2)
+
+ do idirac = 1, ndirac
+ f(idirac) = &
+ fmp + g(idirac) * sqrt( fp2mp/gp2m)
+ y(idirac) = &
+ yfmp + g(idirac) * sqrt( yfp2mp/gp2m)
+ enddo
+
+! --- CAS 2 : Droite Horizontale
+! =====
+
+ elseif (yfp2mp .lt. epsi) then
+
+! ---> Calcul des differentes intersections des droites
+
+ f12 = yfmp
+ f13 = fs(1) + yfmp * (1-fs(1))
+ f14 = fmin
+ f15 = fmax
+
+! ---> Calcul des extrema de l'abscisse curviligne
+! Appel de la function G
+
+ call lwcgfu(g2max, f15, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g3max, f13, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g1min, f12, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g2min, f14, fmp, yfp2mp, fp2mp)
+
+! ---> Choix des extrema
+
+ gmin = max( g1min, g2min)
+ gmax = min( g2max, g3max)
+! ---> Calcul des amplitudes des Diracs
+
+ d(1) = gmax / ( gmax-gmin )
+ d(2) = (1.d0 - d(1))
+
+! ---> Calcul de la variance de l'abscisse curviligne (GP2M)
+
+ gp2m = fp2mp + yfp2mp
+
+ g(1) = -sqrt( -gmin/gmax*gp2m )
+ g(2) = -d(1) * g(1) / d(2)
+
+ do idirac = 1, ndirac
+ f(idirac) = &
+ fmp + g(idirac) * sqrt( fp2mp/gp2m)
+ y(idirac) = &
+ yfmp + g(idirac) * sqrt( yfp2mp/gp2m)
+ enddo
+ endif
+
+ elseif ( (fp2mp.gt.epsi) .and. (yfp2mp.gt.epsi) ) then
+
+! --- CAS 3 : Parallelisme avec la Droite de Melange
+! =====
+
+ if ( ((yfp2mp / fp2mp) .lt. 1.d0 + epsi) &
+ .and. ((yfp2mp / fp2mp) .gt. 1.d0 - epsi) ) then
+
+ aa1 = 1.d0
+ bb1 = yfmp - fmp
+
+ aa3 = 1.d0 / (1.d0-fs(1))
+ bb3 = -fs(1) / (1.d0-fs(1))
+
+ aa6 = zero
+ bb6 = zero
+
+! ---> Calcul des differentes intersections de ces droites
+
+ f13 = (bb3-bb1) / (aa1-aa3)
+ f14 = fmin
+ f15 = fmax
+ f16 = (bb6-bb1) / (aa1-aa6)
+
+! ---> Calcul des extrema de l'abscisse curviligne
+! Appel de la function G
+
+ call lwcgfu(g2max,f15, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g3max,f13, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g2min,f14, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g3min,f16, fmp, yfp2mp, fp2mp)
+
+ gmin = max( g2min, g3min)
+ gmax = min( g2max, g3max)
+
+! ---> Calcul des amplitudes des Diracs
+
+ d(1) = gmax / ( gmax-gmin )
+ d(2) = (1.d0 - d(1))
+
+! ---> Calcul de la variance de l'abscisse curviligne (GP2M)
+
+ gp2m = fp2mp + yfp2mp
+
+! ---> Test sur GP2M
+
+ g(1) = -sqrt( -gmin/gmax*gp2m )
+ g(2) = -d(1) * g(1) / d(2)
+
+ do idirac = 1, ndirac
+ f(idirac) = &
+ fmp + g(idirac) * sqrt( fp2mp/gp2m)
+ y(idirac) = &
+ yfmp + g(idirac) * sqrt( yfp2mp/gp2m)
+ enddo
+
+! --- CAS 4 : Parallelisme avec la Droite de Combustion Complete
+! =====
+ elseif ( ((sqrt(yfp2mp/fp2mp) * (1.d0-fs(1))) &
+ .lt. 1.d0 + epsi) &
+ .and. ((sqrt(yfp2mp/fp2mp) * (1.d0-fs(1))) &
+ .gt. 1.d0 - epsi) ) then
+
+ aa1 = sqrt( yfp2mp/fp2mp )
+ bb1 = yfmp - sqrt( yfp2mp/fp2mp ) * fmp
+
+ aa2 = 1.d0
+ bb2 = zero
+
+ aa6 = zero
+ bb6 = zero
+
+! ---> Calcul des differentes intersections de ces droites
+
+ f12 = (bb2-bb1) / (aa1-aa2)
+ f14 = fmin
+ f15 = fmax
+ f16 = (bb6-bb1) / (aa1-aa6)
+
+! ---> Calcul des extrema de l'abscisse curviligne
+! Appel de la function G
+
+ call lwcgfu(g2max,f15, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g1max,f12, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g2min,f14, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g3min,f16, fmp, yfp2mp, fp2mp)
+
+ gmin = max( g2min, g3min)
+ gmax = min( g1max, g2max)
+
+! ---> Calcul des amplitudes des Diracs
+
+ d(1) = gmax / ( gmax-gmin )
+ d(2) = (1.d0 - d(1))
+
+! ---> Calcul de la variance de l'abscisse curviligne (GP2M)
+
+ gp2m = fp2mp + yfp2mp
+
+! ---> Test sur GP2M
+
+ g(1) = -sqrt( -gmin/gmax*gp2m )
+ g(2) = -d(1) * g(1) / d(2)
+
+ do idirac = 1, ndirac
+ f(idirac) = &
+ fmp + g(idirac) * sqrt( fp2mp/gp2m)
+ y(idirac) = &
+ yfmp + g(idirac) * sqrt( yfp2mp/gp2m)
+ enddo
+
+! --- CAS GENERAL
+!==========
+ else
+
+! ---> Expression des differentes droites: Y=AX+B
+
+
+ aa1 = -sqrt( yfp2mp/fp2mp )
+ bb1 = yfmp - aa1 * fmp
+
+ aa2 = 1.d0
+ bb2 = zero
+
+ aa3 = 1.d0 / (1.d0-fs(1))
+ bb3 = -fs(1) / (1.d0-fs(1))
+
+ aa6 = zero
+ bb6 = zero
+
+! ---> Calcul des differentes intersections de ces droites
+
+ f12 = (bb2-bb1) / (aa1-aa2)
+ f13 = (bb3-bb1) / (aa1-aa3)
+ f14 = fmin
+ f15 = fmax
+ f16 = (bb6-bb1) / (aa1-aa6)
+
+! ---> Calcul des extrema de l'abscisse curviligne
+! Appel de la function G
+
+ call lwcgfu(g1max, f12, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g2max, f15, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g3max, f13, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g1min, f12, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g2min, f14, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g3min, f16, fmp, yfp2mp, fp2mp)
+ call lwcgfu(g4min, f13, fmp, yfp2mp, fp2mp)
+
+!===============================================================================
+! 4. CALCUL DES PARAMETRES DES DEUX PICS DE DIRAC
+!===============================================================================
+
+! ---> Choix des extrema suivant les pentes des droites
+
+ if ( aa1 .gt. aa3 ) then
+ gmin = max ( g2min, g3min, g4min )
+ gmax = min ( g1max, g2max )
+
+ elseif (( aa1 .gt. aa2 ).and. ( aa1 .le. aa3 )) then
+ gmin = max ( g2min, g3min )
+ gmax = min ( g1max, g2max, g3max )
+
+ elseif ( aa1 .le. aa2 ) then
+ gmin = max ( g1min, g2min, g3min )
+ gmax = min ( g2max, g3max )
+ endif
+
+! ---> Calcul des amplitudes des Diracs
+
+ d(1) = gmax / ( gmax-gmin )
+ d(2) = (1.d0 - d(1))
+
+! ---> Calcul de la variance de l'abscisse curviligne (GP2M)
+
+ gp2m = fp2mp + yfp2mp
+
+ g(1) = -sqrt( gmin/gmax*gp2m )
+ g(2) = -d(1) * g(1) / d(2)
+
+ do idirac = 1, ndirac
+ f(idirac) = &
+ fmp + g(idirac) * sqrt( fp2mp/gp2m)
+ y(idirac) = &
+ yfmp + g(idirac) * sqrt( yfp2mp/gp2m)
+ enddo
+
+ endif
+ endif
+
+!===============================================================================
+! 5. DETERMINATION DES GRANDEURS THERMOCHIMIQUES DES DEUX PICS
+!===============================================================================
+
+! ---> Calcul de l'enthalpies en 1 et 2
+
+ sum7 = zero
+ sum8 = zero
+ sum9 = zero
+ sum10 = zero
+ sum11 = zero
+ sum12 = zero
+ sum17 = zero
+
+ do idirac = 1, ndirac
+ h(idirac) = ((hmax-hmin)*f(idirac) + hmin*fmin - hmax*fmax) &
+ / (fmin-fmax)
+
+! ---> Calcul de la fraction massique des gaz (F, O et P) en 1 et 2
+
+ yfuel = y(idirac)
+ yoxyd = 1.d0 - (coeff3+1.0d0)*f(idirac) + coeff3*y(idirac)
+ yprod = 1.d0 - yfuel - yoxyd
+ yo2 = coeff1 - (coeff1 + coeff2) * f(idirac) &
+ + coeff2 * y(idirac)
+
+! ---> Coefficients d'absorption pour les pics 1 et 2
+
+! IF ( IIRAYO .GT. 0 ) THEN
+! KABSGF = YFUEGF(IEL)*KABSG(1) + YOXYGF(IEL)*KABSG(2)
+! & + YPROGF(IEL)*KABSG(3)
+! KABSGB = YFUEGB(IEL)*KABSG(1) + YOXYGB(IEL)*KABSG(2)
+! & + YPROGB(IEL)*KABSG(3)
+! ENDIF
+
+
+! ---> Calcul de la masse molaire et de la temperature en 1 et 2
+
+ coefg(1) = yfuel
+ coefg(2) = yoxyd
+ coefg(3) = yprod
+
+! ------ Masse molaire pour le pic 1 et 2
+
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ maml(idirac) = 1.d0/nbmol
+
+! ------ Calcul de la temperature pour le pic 1 et 2
+
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ h(idirac) , teml(idirac) )
+
+! ---> Calcul de la masse volumique en 1 et 2
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ rhol(idirac) = p0(iphas) * maml(idirac) &
+ / (rr*teml(idirac))
+ else
+ iphas = 1
+ rhol(idirac) = ro0(iphas)
+ endif
+
+! ---> Calcul du terme source en 1 et 2 du scalaire YFM
+
+ theta(idirac) = ta / teml(idirac) &
+ * (1.d0 - teml(idirac) / tstar)
+
+ w(idirac) = vref / lref * (- d(idirac)*rhol(idirac) &
+ * yfuel*yo2 &
+ * exp( -theta(idirac) ))
+
+! ---> Masse molaire du melange
+
+ sum7 = sum7 + d(idirac)*maml(idirac)
+
+! ---> Temperature du melange
+
+ sum8 = sum8 + d(idirac)*teml(idirac)
+
+! ---> Temperature / Masse molaire
+
+ sum9 = sum9 + d(idirac)*teml(idirac)/maml(idirac)
+
+! ---> Fractions massiques des especes globales
+
+ sum10 = sum10 + yfuel*d(idirac)
+
+ sum11 = sum11 + yoxyd*d(idirac)
+
+ sum12 = sum12 + yprod*d(idirac)
+
+ sum17 = sum17 +w(idirac)
+
+! ---> Stockage des proprietes via PROPCE
+
+ propce(iel,ipampl(idirac)) = d(idirac)
+ propce(iel,ipfmel(idirac)) = f(idirac)
+ propce(iel,ipfmal(idirac)) = y(idirac)
+ propce(iel,ipmaml(idirac)) = maml(idirac)
+ propce(iel,ipteml(idirac)) = teml(idirac)
+ propce(iel,iprhol(idirac)) = rhol(idirac)
+ propce(iel,iptscl(idirac)) = w(idirac)
+
+! ---> Grandeurs relatives au rayonnement
+
+! IF ( IIRAYO .GT. 0 ) THEN
+! PROPCE(IEL,IPCKAB) = YGFM*KABSGF + YGBM*KABSGB
+! PROPCE(IEL,IPT4) = YGFM*TGF**4+YGBM*TGB**4
+! PROPCE(IEL,IPT3) = YGFM*TGF**3+YGBM*TGB**3
+! ENDIF
+
+ enddo
+
+ propce(iel,ipcmam) = sum7
+ propce(iel,ipctem) = sum8
+ temsmm = sum9
+ propce(iel,ipcfue) = sum10
+ propce(iel,ipcoxy) = sum11
+ propce(iel,ipcpro) = sum12
+ propce(iel,ipctsc) = sum17
+
+! ---> Masse volumique du melange
+
+ if (ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+ propce(iel,ipcrom) = srrom * propce(iel,ipcrom) &
+ + (1.d0-srrom) * (p0(iphas)/(rr*temsmm))
+ endif
+
+ endif
+
+enddo
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/cogz/pdfpp3.f90 b/src/cogz/pdfpp3.f90
new file mode 100644
index 0000000..09b5d13
--- /dev/null
+++ b/src/cogz/pdfpp3.f90
@@ -0,0 +1,645 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine pdfpp3 &
+!================
+
+ ( ncelet , ncel , &
+ fm , fp2m , yfm , yfp2m , coyfp , &
+ propce )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES PARAMETRES DE LA PDF
+! PDF LIBBY - WILLIAMS 3 POINTS AVEC HYPOTHESE DE CURL
+! PDFPP3 RIVISE
+
+! COMMENTAIRES :
+! ------------
+
+! Dans un diagramme (F, Yf), on construit deux droites:
+! - La droite de combustion complete
+! - La droite de melange
+
+! Dans ce domaine, nous allons trouver deux pics qui
+! definiront une troisieme droite sur laquelle on definit
+! une abscisse curviligne G.
+
+
+! LE RESULTAT EST :
+! ---------------
+
+! CALCUL DES PARAMETRES ASSOCIES AUX FONCTIONS DIRAC
+
+! Les Diracs sont en position [F(.,1),Y(.,1)] et [F(.,2),Y(.,2)]
+! Leurs amplitudes respectives sont D(.,1) et D(.,2)
+! Pour chaque dirac,
+! on calcule la temperature [T(.,1), T(.,2)]
+! la masse volumique [RHO(.,1), RHO(.,2)]
+! le terme source chimique [W(.,1),W(.,2)]
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! fm ! tr ! <-- ! moyenne de la fraction de melange !
+! fp2m ! tr ! <-- ! variance de la fraction de melange !
+! yfm ! tr ! <-- ! moyenne de la fraction massique !
+! yfp2m ! tr ! <-- ! variance de la fraction massique !
+! coyfp ! tr ! -> ! covariance
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "coincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel
+
+double precision fm(ncelet) , fp2m(ncelet)
+double precision yfm(ncelet) , yfp2m(ncelet)
+double precision coyfp(ncelet)
+double precision propce(ncelet,*)
+
+! VARIABLES LOCALES
+
+integer iel, igg, idirac, iphas
+integer mode
+integer clicoy, cliy1, cliy2 , cliy2p
+integer clif , cliy , clifp2, clyfp2
+
+double precision coefg(ngazgm), epsi
+double precision yfuel
+double precision yoxyd, yo2
+double precision yprod,fmp,fp2mp,yfmp,yfp2mp,coyfpp
+double precision y1, y2, f1, f2
+double precision cstfa1, cstfa2, yfmpmx, cst
+double precision dyfmp
+double precision climax, climin
+
+! --- Position des Diracs
+
+double precision f(ndracm) , y(ndracm) , d(ndracm)
+double precision h(ndracm) , teml(ndracm)
+double precision maml(ndracm) , w(ndracm)
+double precision rhol(ndracm) , theta(ndracm)
+double precision ymin(ndracm) , ymax(ndracm)
+double precision y2p(ndracm)
+
+! --- Pointeurs & autres
+
+integer ipctem, ipcmam, ipcrom
+integer ipampl(ndracm), ipfmel(ndracm)
+integer ipfmal(ndracm), ipteml(ndracm)
+integer ipmaml(ndracm)
+integer iprhol(ndracm)
+integer iptscl(ndracm)
+integer ipcfue, ipcoxy, ipcpro, ipctsc
+double precision nbmol, temsmm
+double precision sum7, sum8, sum9, sum10, sum11, sum12, sum17
+double precision sum1, sum2, sum3, sum4, sum5, sum6, sum16, sum15
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+! ---> Position des variables
+
+do idirac = 1, ndirac
+ ipampl(idirac) = ipproc(iampl(idirac))
+ ipfmel(idirac) = ipproc(ifmel(idirac))
+ ipfmal(idirac) = ipproc(ifmal(idirac))
+ ipteml(idirac) = ipproc(iteml(idirac))
+ ipmaml(idirac) = ipproc(imaml(idirac))
+ iprhol(idirac) = ipproc(irhol(idirac))
+ iptscl(idirac) = ipproc(itscl(idirac))
+enddo
+ipcfue = ipproc(iym(1))
+ipcoxy = ipproc(iym(2))
+ipcpro = ipproc(iym(3))
+ipctsc = ipproc(itsc)
+ipctem = ipproc(itemp)
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+ipcmam = ipproc(imam)
+
+! ---> Initialisation
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+epsi = 1.d-6
+
+! Compteur pour clipping
+
+clicoy = 0
+cliy1 = 0
+cliy2 = 0
+cliy2p = 0
+clif = 0
+cliy = 0
+clifp2 = 0
+clyfp2 = 0
+
+!===============================================================================
+! 0. CALCULS PRELIMINAIRES
+!===============================================================================
+
+ipass = ipass + 1
+
+! Controle de l intialisation de FMIN et FMAX
+
+if ( (ipass.le.1 .and. isuite.eq.0 ) .or. &
+ (ipass.le.1 .and. isuite.eq.1 &
+ .and. initro(iphas).ne.1) ) then
+ fmin = 4.405286343612334e-02
+ fmax = 5.506607929515418e-02
+endif
+
+do iel =1, ncel
+
+!-- F
+ if ((fm(iel).le.fmin).or.(fm(iel).ge.fmax)) then
+ fmp = max (min(fmax,fm(iel)),fmin)
+ clif = clif +1
+ else
+ fmp = fm(iel)
+ endif
+!---Y
+ climax = (fmax-fmp)*fmin/(fmax-fmin)
+ climin = max(zero,(fmp-fs(1))/(1.d0-fs(1)))
+ if (( yfm(iel).ge.climax).or.(yfm(iel).lt.climin)) then
+ yfmp = max(climin,min(yfm(iel),climax))
+ cliy = cliy + 1
+ else
+ yfmp = yfm(iel)
+ endif
+!-- FP2M
+ climax = (fmax -fmp)*(fmp-fmin)
+ climin = zero
+
+ if ((fp2m(iel).ge.climax).or.(fp2m(iel).lt.climin)) then
+ fp2mp = max(climin,min(fp2m(iel),climax))
+ clifp2 = clifp2 + 1
+ else
+ fp2mp = fp2m(iel)
+ endif
+! -- YFP2M
+! YFMAX = FMIN dans le cas Moreau
+ climax = (fmin-yfmp)*yfmp
+ climin = zero
+ if ((yfp2m(iel).ge.climax).or.(yfp2m(iel).lt.climin)) then
+ yfp2mp = max(climin,min(yfp2m(iel),climax))
+ clyfp2 = clyfp2 + 1
+ else
+ yfp2mp = yfp2m(iel)
+ endif
+
+! --> Clip pour la covariance
+
+ climax = sqrt(fp2mp*yfp2mp)
+ climin = -sqrt(fp2mp*yfp2mp)
+ if (coyfp(iel).ge.climax) then
+ coyfpp = climax
+ clicoy = clicoy + 1
+ elseif (coyfp(iel).le.climin) then
+ coyfpp = climin
+ clicoy = clicoy + 1
+ else
+ coyfpp = coyfp(iel)
+ endif
+
+ yfmpmx = (fmax - fmp)*fmin/(fmax - fmin)
+ dyfmp = (yfmpmx - yfmp)
+
+ if (((fp2mp.lt.epsi).and.(yfp2mp.lt.epsi)) &
+ .or. &
+ ((yfmp.lt.epsi ).or.(dyfmp.lt.epsi)) &
+ .or. &
+ ((fmp -fmin).lt.epsi) &
+ .or. &
+ ( fp2mp.lt.epsi ) &
+ .or. &
+ (((fmax -fmp).lt.epsi) )) then
+
+!===============================================================================
+! 1. NON PASSAGE PAR PDF
+!===============================================================================
+
+ sum1 = zero
+ sum2 = zero
+ sum3 = zero
+ sum4 = zero
+ sum5 = zero
+ sum6 = zero
+ sum15 = zero
+ sum16 = zero
+
+ do idirac =1, ndirac
+ d(idirac) = 1.d0 / ndirac
+ f(idirac) = fmp
+ y(idirac) = yfmp
+
+!---> Calcul de l'enthalpie
+
+ h(idirac) = ((hmax-hmin)*f(idirac) + hmin*fmin - hmax*fmax) &
+ / (fmin-fmax)
+
+! ---> Calcul de la fraction massique des gaz (F, O et P)
+
+ yfuel = y(idirac)
+ yoxyd = 1.d0 - (coeff3+1.0d0)*f(idirac) + coeff3*y(idirac)
+ yprod = 1.d0 - yfuel - yoxyd
+ yo2 = coeff1 - (coeff1 + coeff2) * f(idirac) &
+ + coeff2 * y(idirac)
+
+! ---> Calcul de la masse molaire et de la temperature
+
+ coefg(1) = yfuel
+ coefg(2) = yoxyd
+ coefg(3) = yprod
+
+! ------ Masse molaire
+
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ maml(idirac) = 1.d0/nbmol
+
+! ------ Calcul de la temperature pour le pic 1 et 2
+
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ h(idirac) , teml(idirac) )
+
+! ---> Calcul de la masse volumique en 1 et 2
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ rhol(idirac) = p0(iphas) * maml(idirac) &
+ / (rr*teml(idirac))
+ else
+ rhol(idirac) = ro0(iphas)
+ endif
+
+! ---> Calcul du terme source en 1 et 2 du scalaire YFM
+
+ theta(idirac) = ta / teml(idirac) &
+ * (1.d0 - teml(idirac) / tstar)
+
+ w(idirac) = vref / lref * (- d(idirac)*rhol(idirac) &
+ * yfuel*yo2 &
+ * exp( -theta(idirac) ))
+! -> BO 27/06 Controle du signe de W
+
+ w(idirac) = min( w(idirac), zero)
+
+! ---> Masse molaire du melange
+
+ sum1 = sum1 + d(idirac)*maml(idirac)
+
+! ---> Temperature du melange
+
+ sum2 = sum2 + d(idirac)*teml(idirac)
+
+! ---> Temperature / Masse molaire
+
+ sum3 = sum3 + d(idirac)*teml(idirac)/maml(idirac)
+
+! ---> Fractions massiques des especes globales
+
+ sum4 = sum4 + yfuel*d(idirac)
+
+ sum5 = sum5 + yoxyd*d(idirac)
+
+ sum6 = sum6 + yprod*d(idirac)
+
+ sum15 = sum15 +rhol(idirac)*d(idirac)
+
+ sum16 = sum16 +w(idirac)
+
+! ---> Stockage des proprietes via PROPCE
+
+ propce(iel,ipampl(idirac)) = d(idirac)
+ propce(iel,ipfmel(idirac)) = f(idirac)
+ propce(iel,ipfmal(idirac)) = y(idirac)
+ propce(iel,ipteml(idirac)) = teml(idirac)
+ propce(iel,ipmaml(idirac)) = maml(idirac)
+ propce(iel,iprhol(idirac)) = rhol(idirac)
+ propce(iel,iptscl(idirac)) = w(idirac)
+
+ enddo
+
+ propce(iel,ipcmam) = sum1
+ propce(iel,ipctem) = sum2
+ temsmm = sum3
+ propce(iel,ipcfue) = sum4
+ propce(iel,ipcoxy) = sum5
+ propce(iel,ipcpro) = sum6
+ propce(iel,ipctsc) = sum16
+
+!---> Masse volumique du melange
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ propce(iel,ipcrom) = srrom*propce(iel,ipcrom) &
+ +(1.d0-srrom)*(p0(iphas)/(rr*temsmm))
+ endif
+
+ else
+
+!==================================================================================
+! 2. PASSAGE PAR PDF
+!==================================================================================
+
+! -------> Constantes
+
+ cst = 1.d0
+
+!-------->Calcul de F1 et F2 avec Curl em F
+
+ call lwcurl &
+! =========
+ ( cst , fmp , fp2mp , &
+ fmin , fmax , &
+ f1 , f2 , cstfa1 , cstfa2 )
+
+! ------> On calcul les Moyennes conditionnelles Y1, Y2
+
+ y2 = ((fmp*yfmp + coyfpp) - f1*yfmp) &
+ /(cstfa1*(f2 - f1))
+ y1 = (yfmp - cstfa2*y2)/cstfa1
+
+ ymin(1) = max(zero , ((f1- fs(1))/(1d0-fs(1))))
+ ymax(1) = (fmax - f1)*fmin/(fmax - fmin)
+ ymin(2) = max(zero , ((f2- fs(1))/(1d0-fs(1))))
+ ymax(2) = (fmax - f2)*fmin/(fmax - fmin)
+
+! clipping pour les moyennes conditionnelles
+
+! Y1 = MAX(YMIN(1),MIN(Y1,YMAX(1)))
+! ===> compteur
+
+ if (y1.ge.ymax(1)) then
+ y1 = ymax(1)
+ cliy1 = cliy1 + 1
+ elseif (y1.le.ymin(1)) then
+ y1 = ymin(1)
+ cliy1 = cliy1 + 1
+ endif
+! == fin
+! Y2 = MAX(YMIN(2),MIN(Y2,YMAX(2)))
+
+ if (y2.ge.ymax(2)) then
+ y2 = ymax(2)
+ cliy2 = cliy2 + 1
+ elseif (y2.le.ymin(2)) then
+ y2 = ymin(2)
+ cliy2 = cliy2 + 1
+ endif
+
+ y2p(1) = ((yfmp**2 + yfp2mp) - cstfa2*(y2**2)) &
+ /cstfa1 - y1**2
+! WRITE(NFECRA,*) ' Y2P(1)=',Y2P(1)
+
+! clipping pour variance conditionnelles
+
+! Y2P(1) = MAX(ZERO,
+! & MIN(Y2P(1),((Y1-YMIN(1))*(YMAX(1) - Y1))))
+! ====> Compteur
+
+ climax =( (y1-ymin(1))*(ymax(1) - y1))
+ climin = zero
+ if (y2p(1).ge.climax) then
+ y2p(1) = climax
+ cliy2p = cliy2p + 1
+ elseif (y2p(1).le.climin) then
+ y2p(1) = climin
+ cliy2p = cliy2p + 1
+ endif
+!==== fin
+ call lwcurl &
+! =========
+ ( cstfa1 , y1 , y2p(1) , &
+ ymin(1) , ymax(1) , &
+ y(1) , y(2) , d(1) , d(2) )
+
+! ---------> Parametres des dirac en F1
+
+ f(1) = f1
+ f(2) = f1
+
+! ---------> Parametres du dirac en F2
+
+ f(3) = f2
+ y(3) = y2
+ d(3) = cstfa2
+
+!===============================================================================
+! 3. DETERMINATION DES GRANDEURS THERMOCHIMIQUES DES DEUX PICS
+!===============================================================================
+
+! ---> Calcul de l'enthalpies en 1 et 2
+
+ sum7 = zero
+ sum8 = zero
+ sum9 = zero
+ sum10 = zero
+ sum11 = zero
+ sum12 = zero
+ sum17 = zero
+
+ do idirac = 1, ndirac
+ h(idirac) = ( (hmax-hmin)*f(idirac) &
+ + hmin*fmin - hmax*fmax) / (fmin-fmax)
+
+! ---> Calcul de la fraction massique des gaz (F, O et P) en 1 et 2
+
+ yfuel = y(idirac)
+ yoxyd = 1.d0 - (coeff3+1.0d0)*f(idirac) &
+ + coeff3*y(idirac)
+ yprod = 1.d0 - yfuel - yoxyd
+ yo2 = coeff1 - (coeff1 + coeff2) * f(idirac) &
+ + coeff2 * y(idirac)
+
+! ---> Calcul de la masse molaire et de la temperature en 1 et 2
+
+ coefg(1) = yfuel
+ coefg(2) = yoxyd
+ coefg(3) = yprod
+
+! ------ Masse molaire pour le pic 1 et 2
+
+ nbmol = 0.d0
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ maml(idirac) = 1.d0/nbmol
+
+! ------ Calcul de la temperature pour le pic 1 et 2
+
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ h(idirac) , teml(idirac) )
+
+! ---> Calcul de la masse volumique en 1 et 2
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ rhol(idirac) = p0(iphas) * maml(idirac) &
+ /(rr*teml(idirac))
+ else
+ rhol(idirac) = ro0(iphas)
+ endif
+
+! ---> Calcul du terme source en 1 et 2 du scalaire YFM
+
+ theta(idirac) = ta / teml(idirac) &
+ *(1.d0 - teml(idirac)/tstar)
+
+ w(idirac) = vref / lref &
+ *(- d(idirac)*rhol(idirac) &
+ * yfuel*yo2 &
+ * exp( -theta(idirac) ))
+! ---> Controle du signe de W
+
+ w(idirac) = min( w(idirac), zero)
+
+
+! ---> Masse molaire du melange
+
+ sum7 = sum7 + d(idirac)*maml(idirac)
+
+! ---> Temperature du melange
+
+ sum8 = sum8 + d(idirac)*teml(idirac)
+
+! ---> Temperature / Masse molaire
+
+ sum9 = sum9 + d(idirac)*teml(idirac) &
+ /maml(idirac)
+
+! ---> Fractions massiques des especes globales
+
+ sum10 = sum10 + yfuel*d(idirac)
+
+ sum11 = sum11 + yoxyd*d(idirac)
+
+ sum12 = sum12 + yprod*d(idirac)
+
+ sum17 = sum17 + w(idirac)
+
+! ---> Stockage des proprietes via PROPCE
+
+ propce(iel,ipampl(idirac)) = d(idirac)
+ propce(iel,ipfmel(idirac)) = f(idirac)
+ propce(iel,ipfmal(idirac)) = y(idirac)
+ propce(iel,ipmaml(idirac)) = maml(idirac)
+ propce(iel,ipteml(idirac)) = teml(idirac)
+ propce(iel,iprhol(idirac)) = rhol(idirac)
+ propce(iel,iptscl(idirac)) = w(idirac)
+
+
+ if ((f(idirac).ne.zero).and.(y(idirac).ne.zero)) then
+ if ((f(idirac).gt.fs(1)).or. &
+ (f(idirac).lt.0.8*fs(1))) then
+ WRITE(NFECRA,*)'==============F OUT=============*', &
+ idirac
+ WRITE(NFECRA,*)'F',F(IDIRAC)
+ WRITE(NFECRA,*)' IEL =', IEL
+ endif
+
+ if ((y(idirac).gt.f(idirac)) &
+ .or.(y(idirac).lt.-epsi)) then
+ WRITE(NFECRA,*)'=============Y OUT=================', &
+ idirac
+ WRITE(NFECRA,*)'Y',Y(IDIRAC)
+ WRITE(NFECRA,*)' IEL =', IEL
+ endif
+ endif
+ enddo
+
+ propce(iel,ipcmam) = sum7
+ propce(iel,ipctem) = sum8
+ temsmm = sum9
+ propce(iel,ipcfue) = sum10
+ propce(iel,ipcoxy) = sum11
+ propce(iel,ipcpro) = sum12
+ propce(iel,ipctsc) = sum17
+
+! ---> Masse volumique du melange
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ propce(iel,ipcrom) = srrom * propce(iel,ipcrom) &
+ + (1.d0-srrom) * (p0(iphas)/(rr*temsmm))
+ endif
+
+ endif
+enddo
+
+end
diff --git a/src/cogz/pdfpp4.f90 b/src/cogz/pdfpp4.f90
new file mode 100644
index 0000000..b2fe8d5
--- /dev/null
+++ b/src/cogz/pdfpp4.f90
@@ -0,0 +1,971 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine pdfpp4 &
+!================
+
+ ( ncelet , ncel , &
+ fm , fp2m , yfm , yfp2m , coyfp , &
+ propce )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES PARAMETRES DE LA PDF
+! PDF LIBBY - WILLIAMS 4 POINTS AVEC HYPOTHESE DE CURL
+! OU CURL MODIFIE
+
+
+! COMMENTAIRES :
+! ------------
+
+! Dans un diagramme (F, Yf), on construit deux droites:
+! - La droite de combustion complete
+! - La droite de melange
+
+! Dans ce domaine, nous allons construire deux pics sur F qui
+! seront dedoubler chaque un en deux avec un Curl sur Yf
+
+
+! LE RESULTAT EST :
+! ---------------
+
+! CALCUL DES PARAMETRES ASSOCIES AUX FONCTIONS DIRAC
+
+! Les positions des Pics sont :
+! [F(1),Y1(1)] et [F(1),Y1(2)]
+! [F(2),Y2(1)] et [F(2),Y2(2)]
+! Leurs amplitudes respectives sont :
+! D1(1) et D1(2)
+! D2(1) et D2(2)
+! Pour chaque dirac, on calcule :
+! la temperature Ti(j),
+! la masse volumique RHOi(j),
+! le terme source chimique Wi(j),
+! i etant la positiion sur F du pic de Dirac
+! j etant la positiion sur Yf du pic de Dirac
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! fm ! tr ! <-- ! moyenne de la fraction de melange !
+! fp2m ! tr ! <-- ! variance de la fraction de melange !
+! yfm ! tr ! <-- ! moyenne de la fraction massique !
+! yfp2m ! tr ! <-- ! variance de la fraction massique !
+! coyfp ! tr ! <-- ! covariance !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "coincl.h"
+include "parall.h"
+
+!===============================================================================
+! Arguments
+!===============================================================================
+
+integer ncelet, ncel
+
+double precision fm(ncelet) , fp2m(ncelet)
+double precision yfm(ncelet) , yfp2m(ncelet)
+double precision coyfp(ncelet)
+double precision propce(ncelet,*)
+
+!===============================================================================
+! VARIABLES LOCALES
+!===============================================================================
+
+integer iel, igg, idirac
+integer mode, iphas
+
+integer ipctem, ipcmam, ipcrom
+integer ipampl(ndracm), ipfmel(ndracm)
+integer ipfmal(ndracm), ipteml(ndracm)
+integer ipmaml(ndracm)
+integer iprhol(ndracm)
+integer iptscl(ndracm)
+integer ipcfue, ipcoxy, ipcpro, ipctsc
+! INTEGER IPCKAB, IPT4 , IPT3
+
+double precision f(ndracm), y(ndracm), d(ndracm)
+double precision h(ndracm), teml(ndracm)
+double precision maml(ndracm), w(ndracm)
+double precision rhol(ndracm), theta(ndracm)
+
+double precision coefg(ngazgm), epsi
+double precision yfuel
+double precision yoxyd, yo2
+double precision yprod,fmp,fp2mp,yfmp,yfp2mp,coyfpp
+double precision yfp2max
+
+double precision nbmol, temsmm
+double precision sum7, sum8, sum9, sum10, sum11, sum12, sum17
+double precision sum1, sum2, sum3, sum4, sum5, sum6, sum16, sum15
+double precision wmin, wmax, tetmin, tetmax, o2min, o2max
+
+double precision y1, y2, f1, f2
+double precision cstfa1, cstfa2, cst
+double precision cstvar
+! DOUBLE PRECISION CSTVA2
+
+double precision ymin(2), ymax(2)
+double precision y2p(2)
+double precision y2pmin(2), y2pmax(2)
+
+! ---> variables pour clipping
+
+integer icpt1,icpt2
+integer cly2p1, cly2p2, cly2p3,cly2p4
+integer clfp2m, clyf21, clyf22
+integer clcyf1, clcyf2
+
+double precision vymx, vfmx
+! DOUBLE PRECISION VYMN
+double precision vcyfmx, vcyfmn
+double precision mxcyfp,mxcfp, mncyfp
+double precision mxccyf, mnccyf
+double precision mxyfp2,maxfp2, mnyfp2
+double precision mxcoyf, mncoyf
+double precision mcy2p1, mcy2p3
+double precision mcy2p2, mcy2p4
+double precision my2p1 , my2p3, my2p2, my2p4
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 0. POSITION ET INITIALISATION DES VARIABLES
+!===============================================================================
+
+do idirac = 1, ndirac
+ ipampl(idirac) = ipproc(iampl(idirac))
+ ipfmel(idirac) = ipproc(ifmel(idirac))
+ ipfmal(idirac) = ipproc(ifmal(idirac))
+ ipteml(idirac) = ipproc(iteml(idirac))
+ ipmaml(idirac) = ipproc(imaml(idirac))
+ iprhol(idirac) = ipproc(irhol(idirac))
+ iptscl(idirac) = ipproc(itscl(idirac))
+enddo
+
+ipcfue = ipproc(iym(1))
+ipcoxy = ipproc(iym(2))
+ipcpro = ipproc(iym(3))
+ipctsc = ipproc(itsc)
+ipctem = ipproc(itemp)
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+ipcmam = ipproc(imam)
+
+! IF ( IIRAYO.GT.0 ) THEN
+! IPCKAB = IPPROC(ICKABS)
+! IPT4 = IPPROC(IT4M)
+! IPT3 = IPPROC(IT3M)
+! ENDIF
+
+! ---> Initialisation des variables et compteurs
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+epsi = 1.d-10
+
+clfp2m = 0
+clyf21 = 0
+clyf22 = 0
+clcyf1 = 0
+clcyf2 = 0
+
+cly2p1 = 0
+cly2p2 = 0
+cly2p3 = 0
+cly2p4 = 0
+
+wmax = -1.d+10
+wmin = 1.d+10
+tetmin = 1.d+10
+tetmax = -1.d+10
+o2max = -1.d+10
+o2min = 1.d+10
+
+mxcfp = -1.d+10
+mxcyfp = -1.d+10
+mncyfp = -1.d+10
+mxccyf = -1.d+10
+mnccyf = -1.d+10
+
+maxfp2= -1.d+10
+mxyfp2= -1.d+10
+mnyfp2= -1.d+10
+mxcoyf= -1.d+10
+mncoyf= -1.d+10
+
+mcy2p1=-1.d+10
+mcy2p3=-1.d+10
+mcy2p2=-1.d+10
+mcy2p4=-1.d+10
+
+my2p1=-1.d+10
+my2p3=-1.d+10
+my2p2=-1.d+10
+my2p4=-1.d+10
+
+icpt1 = 0
+icpt2 = 0
+
+!===============================================================================
+! 1. BOUCLE SUR LES CELLULES
+!===============================================================================
+
+ipass = ipass + 1
+
+do iel = 1, ncel
+
+! ---> position des variables
+
+fmp=fm(iel)
+yfmp=max(yfm(iel), zero)
+fp2mp=fp2m(iel)
+yfp2mp=yfp2m(iel)
+coyfpp=coyfp(iel)
+
+!===============================================================================
+! TEST DE PASSAGE OU NON PAR LA PDF
+! (non passage par pdf si aucune variance ni en f ni en y)
+! (on peut si on veut toujours passer par la pdf,
+! le cas des variances nulles y est traite)
+!===============================================================================
+
+ if (((fp2mp.lt.epsi).and.(yfp2mp.lt.epsi))) then
+
+!===============================================================================
+! 2. NON PASSAGE PAR PDF
+!===============================================================================
+
+ icpt1 = icpt1 +1
+
+ sum1 = zero
+ sum2 = zero
+ sum3 = zero
+ sum4 = zero
+ sum5 = zero
+ sum6 = zero
+ sum15 = zero
+ sum16 = zero
+
+! ---> boucle sur chaque DIRAC
+
+ do idirac =1, ndirac
+
+! ---> calcul de f, Y, Amplitude de chaque DIRAC == Val moy
+
+ d(idirac) = 1.d0 / ndirac
+ f(idirac) = fmp
+ y(idirac) = yfmp
+
+! ---> Calcul de l'enthalpie
+
+ h(idirac) = ((hmax-hmin)*f(idirac) + hmin*fmax - hmax*fmin) &
+ / (fmax-fmin)
+
+! ---> Calcul de la fraction massique des gaz (F, O et P)
+
+ yfuel = y(idirac)
+ yoxyd = 1.d0 - (coeff3+1.0d0)*f(idirac) + coeff3*y(idirac)
+ yprod = 1.d0 - yfuel - yoxyd
+ yo2 = coeff1 - (coeff1 + coeff2) * f(idirac) &
+ + coeff2 * y(idirac)
+
+! ---> Calcul de la masse molaire et de la temperature
+
+ coefg(1) = yfuel
+ coefg(2) = yoxyd
+ coefg(3) = yprod
+
+! ---> Masse molaire
+
+ nbmol = zero
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ maml(idirac) = 1.d0/nbmol
+
+! ---> Calcul de la temperature pour chaque pic
+
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ h(idirac) , teml(idirac) )
+
+! ---> Calcul de la masse volumique pour chaque pic
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ rhol(idirac) = p0(iphas) * maml(idirac) &
+ / (rr*teml(idirac))
+ else
+ rhol(idirac) = ro0(iphas)
+ endif
+
+! ---> Calcul du terme source du scalaire YFM pour chaque pic
+
+ theta(idirac) = ta / teml(idirac) &
+ * (1.d0 - teml(idirac) / tstar)
+
+ w(idirac) = vref / lref * (- d(idirac) &
+ * yfuel*yo2 &
+ * exp( -theta(idirac) ))
+
+! ---> Controle du signe de W
+
+ w(idirac) = min( w(idirac), zero)
+
+! ---> Masse molaire du melange
+
+ sum1 = sum1 + d(idirac)*maml(idirac)
+
+! ---> Temperature du melange
+
+ sum2 = sum2 + d(idirac)*teml(idirac)
+
+! ---> Temperature / Masse molaire
+
+ sum3 = sum3 + d(idirac)*teml(idirac)/maml(idirac)
+
+! ---> Fractions massiques des especes globales
+
+ sum4 = sum4 + yfuel*d(idirac)
+ sum5 = sum5 + yoxyd*d(idirac)
+ sum6 = sum6 + yprod*d(idirac)
+ sum15 = sum15 +rhol(idirac)*d(idirac)
+ sum16 = sum16 +w(idirac)
+
+! ---> Stockage des proprietes via PROPCE
+
+ propce(iel,ipampl(idirac)) = d(idirac)
+ propce(iel,ipfmel(idirac)) = f(idirac)
+ propce(iel,ipfmal(idirac)) = y(idirac)
+ propce(iel,ipteml(idirac)) = teml(idirac)
+ propce(iel,ipmaml(idirac)) = maml(idirac)
+ propce(iel,iprhol(idirac)) = rhol(idirac)
+ propce(iel,iptscl(idirac)) = w(idirac)
+
+!fin de boucle sur chaque DIRAC
+ enddo
+
+ propce(iel,ipcmam) = sum1
+ propce(iel,ipctem) = sum2
+ temsmm = sum3
+ propce(iel,ipcfue) = sum4
+ propce(iel,ipcoxy) = sum5
+ propce(iel,ipcpro) = sum6
+ propce(iel,ipctsc) = sum16
+
+! ---> Masse volumique du melange
+
+ if ( ipass.gt.1.or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ propce(iel,ipcrom) = srrom*propce(iel,ipcrom) &
+ +(1.d0-srrom)*(p0(iphas)/(rr*temsmm))
+ endif
+
+ else
+
+!==================================================================================
+! 3. PASSAGE PAR PDF
+!==================================================================================
+
+ icpt2 = icpt2 + 1
+
+! ---> Clipping sur la variance en f
+
+ vfmx = (fmax-fmp)*(fmp-fmin)
+
+ if (fp2mp.gt.vfmx) then
+ if ((fp2mp-vfmx).gt.mxcfp) then
+ mxcfp=(fp2mp-vfmx)
+ maxfp2=vfmx
+ endif
+ fp2mp=vfmx
+ clfp2m=clfp2m+1
+ endif
+
+! ---> Calcul des positions et amplitudes en F des Pics avec lWCURL en F
+
+ cst = 1.d0
+
+ call lwcurl &
+! =========
+ ( cst , fmp , fp2mp , &
+ fmin , fmax , &
+ f1 , f2 , cstfa1 , cstfa2 )
+
+ f(1) = f1
+ f(2) = f1
+ f(3) = f2
+ f(4) = f2
+
+! ---> Determination des valeur max et min de Yf en F1 et F2
+
+ ymin(1) = max(zero , ((f1- fs(1))/(1d0-fs(1))))
+ ymax(1) = f1
+ ymin(2) = max(zero , ((f2- fs(1))/(1d0-fs(1))))
+ ymax(2) = f2
+
+! ---> clipping COVARIANCE en fonction des bornes des moyennes conditionnelles
+
+ vcyfmx=min(ymax(2)*cstfa2*(f2-f1)-yfmp*(fmp-f1) &
+ ,yfmp*(f2-fmp)-ymin(1)*cstfa1*(f2-f1))
+
+ vcyfmn=max(ymin(2)*cstfa2*(f2-f1)-yfmp*(fmp-f1) &
+ ,yfmp*(f2-fmp)-ymax(1)*cstfa1*(f2-f1))
+
+ if (coyfpp.gt.vcyfmx) then
+ if ((coyfpp-vcyfmx).gt.mxccyf) then
+ mxccyf=(coyfpp-vcyfmx)
+ mxcoyf=vcyfmx
+ endif
+ coyfpp=vcyfmx
+ clcyf1=clcyf1+1
+ elseif (coyfpp.lt.vcyfmn) then
+ if ((vcyfmn-coyfpp).gt.mnccyf) then
+ mnccyf=(vcyfmn-coyfpp)
+ mncoyf=vcyfmn
+ endif
+ coyfpp=vcyfmn
+ clcyf2=clcyf2+1
+ endif
+
+! ---> On calcul les Moyennes conditionnelles Y1, Y2
+
+ if ((f2-f1).gt.epsi) then
+ y2 = (yfmp*(fmp- f1) + coyfpp) &
+ /(cstfa2*(f2 - f1))
+ y1 = (yfmp*(f2-fmp) - coyfpp) &
+ /(cstfa1*(f2 - f1))
+ else
+ y2 = yfmp
+ y1 = yfmp
+ endif
+ if ((fmp-yfmp).lt.epsi) then
+ y2=f2
+ y1=f1
+ endif
+ if ((yfmp-max(zero,(fmp -fs(1)) &
+ /(1.d0 - fs(1)))).lt.epsi) then
+ y2=max(zero,(f2 -fs(1))/(1.d0 - fs(1)))
+ y1=max(zero,(f1 -fs(1))/(1.d0 - fs(1)))
+ endif
+
+! ---> Determination des valeurs max et min des variances de y en F1 et F2
+
+ y2pmax(1) =(y1-ymin(1))*(ymax(1) - y1)
+ y2pmin(1) = zero
+ y2pmax(2) = (y2-ymin(2))*(ymax(2) - y2)
+ y2pmin(2) = zero
+
+! ---> calcul de la variance en Y max avec Y2PMAX 1 et 2
+
+ yfp2max=cstfa1*(y1**2+y2pmax(1)) &
+ +cstfa2*(y2**2+y2pmax(2))-yfmp**2
+ vymx=yfp2max
+
+! ---> rapport des variances conditionnelles
+
+ if (((ymax(2)-y2).gt.epsi).and.((y2-ymin(2)).gt.epsi) &
+ .and.((ymax(1)-y1).gt.epsi).and.((y1-ymin(1)).gt.epsi)) &
+ then
+ cstvar = ((ymax(2)-y2)*(y2-ymin(2))) &
+ /((ymax(1)-y1)*(y1 -ymin(1)))
+ endif
+
+
+! ---> clipping VARIANCE Y
+! (on peut soit clipper la variance en y en fonction
+! des valeurs extremes des variances conditionnelles
+! ou clipper directement les variances conditionnelles)
+
+! CSTVA2 = (CSTFA1*Y1**2+CSTFA2*Y2**2)-YFMP**2
+
+! IF (((YMAX(2)-Y2).GT.EPSI).AND.((Y2-YMIN(2)).GT.EPSI)
+! & .AND.((YMAX(1)-Y1).GT.EPSI).AND.((Y1-YMIN(1)).GT.EPSI))
+! & THEN
+
+! VYMX=MIN(Y2PMAX(1)*(CSTFA1+CSTFA2*CSTVAR)+CSTVA2
+! & ,Y2PMAX(2)*(CSTFA1/CSTVAR+CSTFA2)+CSTVA2)
+! VYMN=MAX(Y2PMIN(1)*(CSTFA1+CSTFA2*CSTVAR)+CSTVA2
+! & ,Y2PMIN(2)*(CSTFA1/CSTVAR+CSTFA2)+CSTVA2)
+
+! ELSEIF (((YMAX(2)-Y2).GT.EPSI)
+! & .AND.((Y2-YMIN(2)).GT.EPSI)) THEN
+! VYMX=Y2PMAX(2)*CSTFA2+CSTVA2
+! VYMN=Y2PMIN(2)*CSTFA2+CSTVA2
+
+! ELSEIF (((YMAX(1)-Y1).GT.EPSI)
+! & .AND.((Y1-YMIN(1)).GT.EPSI)) THEN
+! VYMX=Y2PMAX(1)*CSTFA1+CSTVA2
+! VYMN=Y2PMIN(1)*CSTFA1+CSTVA2
+! ENDIF
+
+ if (yfp2mp.gt.vymx) then
+ if ((yfp2mp-vymx).gt.mxcyfp) then
+ mxcyfp=(yfp2mp-vymx)
+ mxyfp2=vymx
+ endif
+ yfp2mp=vymx
+ clyf21=clyf21+1
+! ELSEIF (YFP2M(IEL).LT.VYMN) THEN
+! IF ((VYMN-YFP2MP).GT.MNCYFP) THEN
+! MNCYFP=(VYMN-YFP2MP)
+! MNYFP2=VYMN
+! ENDIF
+! YFP2MP=VYMN
+! CLYF22=CLYF22+1
+ endif
+
+! ---> calcul des variances conditionnelles
+
+ if (((ymax(2)-y2).gt.epsi).and.((y2-ymin(2)).gt.epsi) &
+ .and.((ymax(1)-y1).gt.epsi).and.((y1-ymin(1)).gt.epsi)) &
+ then
+
+ y2p(1) = ((yfmp**2)+yfp2mp &
+ -cstfa2*(y2**2)-cstfa1*(y1**2)) &
+ /(cstfa1 + cstfa2*cstvar)
+
+ y2p(2) = ((yfmp**2)+yfp2mp &
+ -cstfa2*(y2**2)-cstfa1*(y1**2)) &
+ /(cstfa1/cstvar + cstfa2)
+
+ elseif (((ymax(2)-y2).gt.epsi) &
+ .and.((y2-ymin(2)).gt.epsi)) then
+
+ y2p(1) = zero
+
+ y2p(2) = ((yfmp**2)+yfp2mp &
+ -cstfa2*(y2**2)-cstfa1*(y1**2)) &
+ /cstfa2
+
+ elseif (((ymax(1)-y1).gt.epsi) &
+ .and.((y1-ymin(1)).gt.epsi)) then
+
+ y2p(2) = zero
+
+ y2p(1) = ((yfmp**2)+yfp2mp &
+ -cstfa2*(y2**2)-cstfa1*(y1**2)) &
+ /cstfa1
+
+ else
+ y2p(1) = zero
+ y2p(2) = zero
+ endif
+
+! ---> clipping pour variances conditionnelles
+
+ if (y2p(1).gt.y2pmax(1)) then
+ if ((y2p(1)-y2pmax(1)).gt.mcy2p1) then
+ mcy2p1=(y2p(1)-y2pmax(1))
+ my2p1=y2pmax(1)
+ endif
+ y2p(1) = y2pmax(1)
+ y2p(2) = (((yfmp**2)+yfp2mp-cstfa1* &
+ ((y1**2)+y2p(1)))/cstfa2)-(y2**2)
+ cly2p1 = cly2p1 + 1
+ elseif (y2p(1).lt.y2pmin(1)) then
+ if ((y2pmin(1)-y2p(1)).gt.mcy2p3) then
+ mcy2p3=(y2pmin(1)-y2p(1))
+ my2p3=y2pmin(1)
+ endif
+ y2p(1) = y2pmin(1)
+ y2p(2) = (((yfmp**2)+yfp2mp-cstfa1* &
+ ((y1**2)+y2p(1)))/cstfa2)-(y2**2)
+ cly2p3 = cly2p3 + 1
+ endif
+ if (y2p(2).gt.y2pmax(2)) then
+ if ((y2p(2)-y2pmax(2)).gt.mcy2p2) then
+ mcy2p2=(y2p(2)-y2pmax(2))
+ my2p2=y2pmax(2)
+ endif
+ y2p(2) = y2pmax(2)
+ y2p(1) = (((yfmp**2)+yfp2mp-cstfa2* &
+ ((y2**2)+y2p(2)))/cstfa1)-(y1**2)
+ cly2p2 = cly2p2 + 1
+ elseif (y2p(2).lt.y2pmin(2)) then
+ if ((y2pmin(2)-y2p(2)).gt.mcy2p4) then
+ mcy2p4=(y2pmin(2)-y2p(2))
+ my2p4=y2pmin(2)
+ endif
+ y2p(2) = y2pmin(2)
+ y2p(1) = (((yfmp**2)+yfp2mp-cstfa2* &
+ ((y2**2)+y2p(2)))/cstfa1)-(y1**2)
+ cly2p4 = cly2p4 + 1
+ endif
+
+! ---> calcul des positions et amplitudes des pics en Y sur F1
+
+ call lwcurl &
+! =========
+ ( cstfa1 , y1 , y2p(1) , &
+ ymin(1) , ymax(1) , &
+ y(1) , y(2) , d(1) , d(2) )
+
+! ---> calcul des positions et amplitudes des pics en Y sur F2
+
+ call lwcurl &
+! =========
+ ( cstfa2 , y2 , y2p(2) , &
+ ymin(2) , ymax(2) , &
+ y(3) , y(4) , d(3) , d(4) )
+
+
+!===============================================================================
+! 2. DETERMINATION DES GRANDEURS THERMOCHIMIQUES DES DEUX PICS
+!===============================================================================
+
+! ---> Calcul de l'enthalpies en 1 et 2
+
+ sum7 = zero
+ sum8 = zero
+ sum9 = zero
+ sum10 = zero
+ sum11 = zero
+ sum12 = zero
+ sum17 = zero
+
+! ---> boucle sur chaque DIRAC
+
+ do idirac = 1, ndirac
+
+! ---> Calcul de l'enthalpie
+
+ h(idirac) = ( (hmax-hmin)*f(idirac) &
+ + hmin*fmax - hmax*fmin) / (fmax-fmin)
+
+! ---> Calcul de la fraction massique des gaz (F, O et P) pour chaque pic
+
+ yfuel = y(idirac)
+ yoxyd = 1.d0 - (coeff3+1.0d0)*f(idirac) &
+ + coeff3*y(idirac)
+ yprod = 1.d0 - yfuel - yoxyd
+ yo2 = coeff1 - (coeff1 + coeff2) * f(idirac) &
+ + coeff2 * y(idirac)
+
+! ---> Coefficients d'absorption pour chaque pic
+
+! IF ( IIRAYO .GT. 0 ) THEN
+! KABSGF = YFUEGF(IEL)*KABSG(1) + YOXYGF(IEL)*KABSG(2)
+! & +YPROGF(IEL)*KABSG(3)
+! KABSGB = YFUEGB(IEL)*KABSG(1) + YOXYGB(IEL)*KABSG(2)
+! & +YPROGB(IEL)*KABSG(3)
+! ENDIF
+
+
+! ---> Calcul de la masse molaire et de la temperature pour chaque pic
+
+ coefg(1) = yfuel
+ coefg(2) = yoxyd
+ coefg(3) = yprod
+
+! ---> Masse molaire pour chaque pic
+
+ nbmol = zero
+ do igg = 1, ngazg
+ nbmol = nbmol + coefg(igg)/wmolg(igg)
+ enddo
+ maml(idirac) = 1.d0/nbmol
+
+! --->Calcul de la temperature pour chaque pic
+
+ mode = 1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ h(idirac) , teml(idirac) )
+
+! ---> Calcul de la masse volumique pour chaque pic
+
+ if ( ipass.gt.1.or. &
+ (isuite.eq.1.and.initro(iphas).eq.1)) then
+ rhol(idirac) = p0(iphas) * maml(idirac) &
+ /(rr*teml(idirac))
+ else
+ rhol(idirac) = ro0(iphas)
+ endif
+
+! ---> Calcul du terme source du scalaire YFM pour chaque pic
+
+ theta(idirac) = ta / teml(idirac) &
+ *(1.d0 - teml(idirac)/tstar)
+
+ tetmax = max(theta(idirac),tetmax)
+ tetmin = min(theta(idirac),tetmin)
+
+ w(idirac) = vref / lref &
+ *(- d(idirac) &
+ * yfuel*yo2 &
+ * exp( -theta(idirac) ))
+
+ wmax = max(w(idirac),wmax)
+ wmin = min(w(idirac),wmin)
+ o2max = max(yo2,o2max)
+ o2min = min(yo2,o2min)
+
+! ---> Controle du signe de W
+
+ w(idirac) = min( w(idirac), zero)
+
+! ---> Masse molaire du melange
+
+ sum7 = sum7 + d(idirac)*maml(idirac)
+
+! ---> Temperature du melange
+
+ sum8 = sum8 + d(idirac)*teml(idirac)
+
+! ---> Temperature / Masse molaire
+
+ sum9 = sum9 + d(idirac)*teml(idirac) &
+ /maml(idirac)
+
+! ---> Fractions massiques des especes globales
+
+ sum10 = sum10 + yfuel*d(idirac)
+
+ sum11 = sum11 + yoxyd*d(idirac)
+
+ sum12 = sum12 + yprod*d(idirac)
+
+ sum17 = sum17 + w(idirac)
+
+! ---> Stockage des proprietes via PROPCE
+
+ propce(iel,ipampl(idirac)) = d(idirac)
+ propce(iel,ipfmel(idirac)) = f(idirac)
+ propce(iel,ipfmal(idirac)) = y(idirac)
+ propce(iel,ipmaml(idirac)) = maml(idirac)
+ propce(iel,ipteml(idirac)) = teml(idirac)
+ propce(iel,iprhol(idirac)) = rhol(idirac)
+ propce(iel,iptscl(idirac)) = w(idirac)
+
+! ---> Grandeurs relatives au rayonnement
+
+! IF ( IIRAYO.GT.0 ) THEN
+! PROPCE(IEL,IPCKAB) = YGFM*KABSGF + YGBM*KABSGB
+! PROPCE(IEL,IPT4) = YGFM*TGF**3+YGBM*TGB**3
+! PROPCE(IEL,IPT3) = YGFM*TGF**3+YGBM*TGB**3
+! ENDIF
+
+! fin de boucle sur chaque DIRAC
+ enddo
+
+
+ propce(iel,ipcmam) = sum7
+ propce(iel,ipctem) = sum8
+ temsmm = sum9
+ propce(iel,ipcfue) = sum10
+ propce(iel,ipcoxy) = sum11
+ propce(iel,ipcpro) = sum12
+ propce(iel,ipctsc) = sum17
+
+! ---> Masse volumique du melange
+
+ if ( ipass.gt.1 .or. &
+ (isuite.eq.1.and.initro(iphas).eq.1) ) then
+ propce(iel,ipcrom) = srrom * propce(iel,ipcrom) &
+ + (1.d0-srrom) * (p0(iphas)/(rr*temsmm))
+ endif
+
+! de passage ou non par la PDF
+endif
+
+! fin de boucle sur les cellules
+enddo
+
+! ---> impression clipping
+
+if(irangp.ge.0) then
+ call parcpt(clfp2m)
+ call parmax(mxcfp)
+ call parmax(maxfp2)
+endif
+
+WRITE(NFECRA,*)' nombre de clip haut sur la variance en f =', &
+ clfp2m
+WRITE(NFECRA,*)' ecart maximum (valeur atteinte-valeur max) =', &
+ mxcfp
+WRITE(NFECRA,*)' valeur max (pour l ecart max) =', MAXFP2
+WRITE(NFECRA,*)' '
+
+ if(irangp.ge.0) then
+ call parcpt(clyf21)
+ call parmax(mxcyfp)
+ call parmax(mxyfp2)
+ endif
+
+WRITE(NFECRA,*)' nombre de clip haut sur la variance en y =', &
+ clyf21
+WRITE(NFECRA,*)' ecart maximum (valeur atteinte-valeur max) =', &
+ mxcyfp
+WRITE(NFECRA,*)' valeur max (pour l ecart max) =', MXYFP2
+WRITE(NFECRA,*)' '
+
+! WRITE(NFECRA,*)' nombre de clip bas sur la variance en y =',
+! & CLYF22
+! WRITE(NFECRA,*)' ecart maximum (valeur min-valeur atteinte) =',
+! & MNCYFP
+! WRITE(NFECRA,*)' valeur min (pour l ecart max) =', MNYFP2
+! WRITE(NFECRA,*)' '
+
+if(irangp.ge.0) then
+ call parcpt(clcyf1)
+ call parmax(mxccyf)
+ call parmax(mxcoyf)
+endif
+
+WRITE(NFECRA,*)' nombre de clip haut sur la covariance =', &
+ clcyf1
+WRITE(NFECRA,*)' ecart maximum (valeur atteinte-valeur max)F =', &
+ mxccyf
+WRITE(NFECRA,*)' valeur max (pour l ecart max) =', MXCOYF
+WRITE(NFECRA,*)' '
+
+if(irangp.ge.0) then
+ call parcpt(clcyf2)
+ call parmax(mnccyf)
+ call parmin(mncoyf)
+endif
+
+WRITE(NFECRA,*)' nombre de clip bas sur la covariance =', &
+ clcyf2
+WRITE(NFECRA,*)' ecart maximum (valeur min-valeur atteinte) =', &
+ mnccyf
+WRITE(NFECRA,*)' valeur min (pour l ecart max) =', MNCOYF
+WRITE(NFECRA,*)' '
+
+if(irangp.ge.0) then
+ call parcpt(cly2p1)
+ call parmax(mcy2p1)
+ call parmax(my2p1)
+endif
+
+write(nfecra,*) &
+' nombre de clip haut sur la variance conditionnelle 1 =', CLY2P1
+WRITE(NFECRA,*)' ecart maximum (valeur atteinte-valeur max) =', &
+ mcy2p1
+WRITE(NFECRA,*)' valeur max (pour l ecart max) =', MY2P1
+WRITE(NFECRA,*)' '
+
+if(irangp.ge.0) then
+ call parcpt(cly2p3)
+ call parmax(mcy2p3)
+ call parmin(my2p3)
+endif
+
+write(nfecra,*) &
+' nombre de clip bas sur la variance conditionnelle 1 =', CLY2P3
+WRITE(NFECRA,*)' ecart maximum (valeur min-valeur atteinte) =', &
+ mcy2p3
+WRITE(NFECRA,*)' valeur min (pour l ecart max) =', MY2P3
+WRITE(NFECRA,*)' '
+
+if(irangp.ge.0) then
+ call parcpt(cly2p2)
+ call parmax(mcy2p2)
+ call parmax(my2p2)
+endif
+
+write(nfecra,*) &
+' nombre de clip haut sur la variance conditionnelle 2 =', CLY2P2
+WRITE(NFECRA,*)' ecart maximum (valeur atteinte-valeur max) =', &
+ mcy2p2
+WRITE(NFECRA,*)' valeur max (pour l ecart max) =', MY2P2
+WRITE(NFECRA,*)' '
+
+if(irangp.ge.0) then
+ call parcpt(cly2p4)
+ call parmax(mcy2p4)
+ call parmin(my2p4)
+endif
+
+write(nfecra,*) &
+' nombre de clip bas sur la variance conditionnelle 2=', CLY2P4
+WRITE(NFECRA,*)' ecart maximum (valeur min-valeur atteinte) =', &
+ mcy2p4
+WRITE(NFECRA,*)' valeur min (pour l ecart max) =', MY2P4
+WRITE(NFECRA,*)' '
+
+if(irangp.ge.0) then
+ call parcpt(icpt1)
+ call parcpt(icpt2)
+ call parmax(o2max)
+ call parmin(o2min)
+ call parmax(tetmax)
+ call parmin(tetmin)
+ call parmax(wmax)
+ call parmin(wmin)
+endif
+
+WRITE(NFECRA,*) ' POINT NON PDF = ',ICPT1
+WRITE(NFECRA,*) ' POINT AVEC PDF = ',ICPT2
+WRITE(NFECRA,*) ' MIN MAX O2 = ',O2MIN,O2MAX
+WRITE(NFECRA,*) ' MIN MAX THETA = ',TETMIN,TETMAX
+WRITE(NFECRA,*) ' MIN MAX W = ',WMIN,WMAX
+
+ end
diff --git a/src/cplv/Makefile.am b/src/cplv/Makefile.am
new file mode 100644
index 0000000..fd40805
--- /dev/null
+++ b/src/cplv/Makefile.am
@@ -0,0 +1,96 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/rayt \
+-I$(top_srcdir)/include/lagr \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/cplv/cpincl.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcscplv.la
+libcscplv_la_SOURCES = \
+cpcym2.f90 \
+cpflux.f90 \
+cpini1.f90 \
+cpiniv.f90 \
+cplecd.f90 \
+cplin1.f90 \
+cplini.f90 \
+cplph1.f90 \
+cplphy.f90 \
+cplpro.f90 \
+cpltcl.f90 \
+cpltss.f90 \
+cpltsv.f90 \
+cplvar.f90 \
+cplver.f90 \
+cplym1.f90 \
+cppdf4.f90 \
+cppdfr.f90 \
+cpphy1.f90 \
+cpphy2.f90 \
+cpphyv.f90 \
+cpprop.f90 \
+cpptcl.f90 \
+cprays.f90 \
+cpteh1.f90 \
+cpteh2.f90 \
+cptehm.f90 \
+cpthp1.f90 \
+cpthp2.f90 \
+cptssc.f90 \
+cptsvc.f90 \
+cptsvi.f90 \
+cpvarp.f90 \
+cpveri.f90 \
+memcp1.f90
+libcscplv_la_LDFLAGS = -no-undefined
+
+libcscplv_la_SOURCES += \
+$(top_srcdir)/users/cplv/uscpcl.f90 \
+$(top_srcdir)/users/cplv/uscpi1.f90 \
+$(top_srcdir)/users/cplv/uscpiv.f90 \
+$(top_srcdir)/users/cplv/uscpl1.f90 \
+$(top_srcdir)/users/cplv/uscplc.f90
+
+cplvdir = $(pkgdatadir)/users/cplv
+cplv_DATA = \
+$(top_srcdir)/users/cplv/uscpcl.f90 \
+$(top_srcdir)/users/cplv/uscpi1.f90 \
+$(top_srcdir)/users/cplv/uscpiv.f90 \
+$(top_srcdir)/users/cplv/uscpl1.f90 \
+$(top_srcdir)/users/cplv/uscplc.f90
diff --git a/src/cplv/Makefile.in b/src/cplv/Makefile.in
new file mode 100644
index 0000000..35ffb22
--- /dev/null
+++ b/src/cplv/Makefile.in
@@ -0,0 +1,648 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/cplv
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcscplv_la_LIBADD =
+am_libcscplv_la_OBJECTS = cpcym2.lo cpflux.lo cpini1.lo cpiniv.lo \
+ cplecd.lo cplin1.lo cplini.lo cplph1.lo cplphy.lo cplpro.lo \
+ cpltcl.lo cpltss.lo cpltsv.lo cplvar.lo cplver.lo cplym1.lo \
+ cppdf4.lo cppdfr.lo cpphy1.lo cpphy2.lo cpphyv.lo cpprop.lo \
+ cpptcl.lo cprays.lo cpteh1.lo cpteh2.lo cptehm.lo cpthp1.lo \
+ cpthp2.lo cptssc.lo cptsvc.lo cptsvi.lo cpvarp.lo cpveri.lo \
+ memcp1.lo uscpcl.lo uscpi1.lo uscpiv.lo uscpl1.lo uscplc.lo
+libcscplv_la_OBJECTS = $(am_libcscplv_la_OBJECTS)
+libcscplv_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcscplv_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcscplv_la_SOURCES)
+DIST_SOURCES = $(libcscplv_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(cplvdir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+cplvDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(cplv_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/rayt \
+-I$(top_srcdir)/include/lagr \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/cplv/cpincl.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcscplv.la
+libcscplv_la_SOURCES = cpcym2.f90 cpflux.f90 cpini1.f90 cpiniv.f90 \
+ cplecd.f90 cplin1.f90 cplini.f90 cplph1.f90 cplphy.f90 \
+ cplpro.f90 cpltcl.f90 cpltss.f90 cpltsv.f90 cplvar.f90 \
+ cplver.f90 cplym1.f90 cppdf4.f90 cppdfr.f90 cpphy1.f90 \
+ cpphy2.f90 cpphyv.f90 cpprop.f90 cpptcl.f90 cprays.f90 \
+ cpteh1.f90 cpteh2.f90 cptehm.f90 cpthp1.f90 cpthp2.f90 \
+ cptssc.f90 cptsvc.f90 cptsvi.f90 cpvarp.f90 cpveri.f90 \
+ memcp1.f90 $(top_srcdir)/users/cplv/uscpcl.f90 \
+ $(top_srcdir)/users/cplv/uscpi1.f90 \
+ $(top_srcdir)/users/cplv/uscpiv.f90 \
+ $(top_srcdir)/users/cplv/uscpl1.f90 \
+ $(top_srcdir)/users/cplv/uscplc.f90
+libcscplv_la_LDFLAGS = -no-undefined
+cplvdir = $(pkgdatadir)/users/cplv
+cplv_DATA = \
+$(top_srcdir)/users/cplv/uscpcl.f90 \
+$(top_srcdir)/users/cplv/uscpi1.f90 \
+$(top_srcdir)/users/cplv/uscpiv.f90 \
+$(top_srcdir)/users/cplv/uscpl1.f90 \
+$(top_srcdir)/users/cplv/uscplc.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cplv/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/cplv/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcscplv.la: $(libcscplv_la_OBJECTS) $(libcscplv_la_DEPENDENCIES)
+ $(libcscplv_la_LINK) $(libcscplv_la_OBJECTS) $(libcscplv_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+uscpcl.lo: $(top_srcdir)/users/cplv/uscpcl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscpcl.lo `test -f '$(top_srcdir)/users/cplv/uscpcl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cplv/uscpcl.f90
+
+uscpi1.lo: $(top_srcdir)/users/cplv/uscpi1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscpi1.lo `test -f '$(top_srcdir)/users/cplv/uscpi1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cplv/uscpi1.f90
+
+uscpiv.lo: $(top_srcdir)/users/cplv/uscpiv.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscpiv.lo `test -f '$(top_srcdir)/users/cplv/uscpiv.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cplv/uscpiv.f90
+
+uscpl1.lo: $(top_srcdir)/users/cplv/uscpl1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscpl1.lo `test -f '$(top_srcdir)/users/cplv/uscpl1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cplv/uscpl1.f90
+
+uscplc.lo: $(top_srcdir)/users/cplv/uscplc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscplc.lo `test -f '$(top_srcdir)/users/cplv/uscplc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/cplv/uscplc.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-cplvDATA: $(cplv_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(cplvdir)" || $(MKDIR_P) "$(DESTDIR)$(cplvdir)"
+ @list='$(cplv_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(cplvDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(cplvdir)/$$f'"; \
+ $(cplvDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(cplvdir)/$$f"; \
+ done
+
+uninstall-cplvDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(cplv_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(cplvdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(cplvdir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(cplvdir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-cplvDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-cplvDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-cplvDATA install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-saturneincludeHEADERS \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-cplvDATA uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/cplv/cpcym2.f90 b/src/cplv/cpcym2.f90
new file mode 100644
index 0000000..a650d36
--- /dev/null
+++ b/src/cplv/cpcym2.f90
@@ -0,0 +1,910 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpcym2 &
+!================
+
+ ( ncelet , ncel , nrtbmc , &
+ indpdf , &
+ rtp , &
+ f1m , f2m , f3m , f4m , f5m , f6m , f7m , &
+ f3max , &
+ f1cl , f2cl , f3cl , f4cl , f5cl , f6cl , f7cl , &
+ f4m1 , f4m2 , d4cl , d4f4 , hrec , &
+ rtbmc , w1 , &
+ fuel1 , fuel2 , fuel3 , oxyd , prod1 , prod2 , &
+ xiner )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES CONCENTRATIONS GAZEUSES MOYENNES
+! VALEURS CELLULES
+! ----------------
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! fvap ! tr ! <-- ! moyenne du traceur 1 mvl [fovm+co] !
+! fhet ! tr ! -> ! moyenne du traceur 3 c h�terog�ne !
+! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
+! indpdf ! te ! <-- ! passage par les pdf !
+! f1m ! tr ! <-- ! moyenne du traceur 1 mvl [chx1m+co] !
+! f2m ! tr ! <-- ! moyenne du traceur 2 mvl [chx2m+co] !
+! f3m ! tr ! <-- ! moyenne du traceur 3 (co c.het) !
+! f4m ! tr ! <-- ! moyenne du traceur 4 (air) !
+! f5m ! tr ! <-- ! moyenne du traceur 5 (h2o) !
+! fuel1 ! tr ! <- ! fraction massique chx1m !
+! fuel2 ! tr ! <- ! fraction massique chx2m !
+! fuel3 ! tr ! <- ! fraction massique co !
+! oxyd ! tr ! <- ! fraction massique o2 !
+! prod1 ! tr ! <- ! fraction massique co2 !
+! prod2 ! tr ! <- ! fraction massique h2o !
+! xiner ! tr ! <- ! fraction massique n2 !
+! f4m1 ! tr ! <-- ! borne minimum !
+! f4m2 ! tr ! <-- ! borne max !
+! d4cl ! tr ! <-- ! amplitude du pic de dirac en f4cl !
+! d4f4 ! tr ! <-- ! amplitude du pic de dirac en 1 !
+! ! ! ! (air pur) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel , nrtbmc
+integer indpdf(ncelet)
+
+double precision rtp(ncelet,*)
+double precision f1m(ncelet) , f2m(ncelet)
+double precision f3m(ncelet) , f4m(ncelet) , f5m(ncelet)
+double precision f6m(ncelet) , f7m(ncelet) , f3max(ncelet)
+
+double precision f1cl(ncelet) , f2cl(ncelet)
+double precision f3cl(ncelet) , f4cl(ncelet), f5cl(ncelet)
+double precision f6cl(ncelet) , f7cl(ncelet)
+
+double precision f4m1(ncelet) , f4m2(ncelet) , d4cl(ncelet)
+double precision d4f4(ncelet) , hrec(ncelet)
+
+double precision fuel1(ncelet), fuel2(ncelet) , fuel3(ncelet)
+double precision oxyd(ncelet) , prod1(ncelet), prod2(ncelet)
+double precision xiner(ncelet)
+
+double precision rtbmc(ncelet,nrtbmc)
+double precision w1(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel , icha , ii
+
+integer n1 , n2 , n3 , n4 , n5 , n6 , n7 , n8 , n9
+integer n10
+integer itbr , icla
+integer nclo2,nclco,nclo21,nclco1
+integer nbrint
+parameter (nbrint = 10)
+integer inttmp(nbrint)
+
+double precision anu1 , anu2 , anu3
+double precision somm
+
+double precision zchx10 , zchx20 , zco0 , zco20
+double precision zn20 , zh2o0 , zo20
+double precision ychx10 , ychx20
+double precision zchx11 , zchx21 , zco1 , zco21
+double precision zn21 , zh2o1 , zo21
+double precision zchx12 , zchx22 , zco2 , zco22
+double precision zn22 , zh2o2 , zo22
+double precision zchx13 , zchx23 , zco3 , zco23
+double precision zn23 , zh2o3 , zo23
+double precision reac1 , reac2 , reac3
+double precision x2 , xch , xck , xash , xwat
+
+double precision zcof10 , zcof20 , zh2o10 , zh2o20
+double precision cx1m , cx2m
+double precision wmchx1 , wmchx2 , wmco , wmco2 , wmh2o
+double precision wmo2 , wmn2 , wmc
+double precision achx1f1, acof1 , achx2f2, acof2
+double precision yo2ox
+double precision ah2of1 , ah2of2
+
+! Variables pour le support de la Pdf et sa description
+
+double precision f42m
+double precision zzcl(7),zzs1(7),zzs2(7),zzs3(7)
+double precision zz(7) ,zzoxy(7)
+
+double precision f4s1 , f4s2 , f4s3
+double precision bb1 , bb2 , den1 , den2
+double precision fp1 , fp2 , fp3 , fp4 , fp5 , zco2t , zcot
+
+double precision f4loc,f6loc,f7loc,s4loc,s6loc,s7loc
+double precision foxy ,foxycl
+
+double precision sommin,sommax,ao2min,ao2max
+
+double precision cmaxs1,cmins1,cmaxa1,cmina1
+double precision cmaxs2,cmins2,cmaxa2,cmina2
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation tableau de travail
+
+do iel = 1, ncel
+ w1(iel) = zero
+ do itbr = 1, nrtbmc
+ rtbmc(iel,itbr) = zero
+ enddo
+enddo
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Masses molaires
+
+wmco = wmole(ico )
+wmo2 = wmole(io2 )
+wmco2 = wmole(ico2 )
+wmh2o = wmole(ih2o )
+wmn2 = wmole(in2)
+wmc = wmolat(iatc)
+
+! --- Calcul de F1M de chaque charbon dans RTBMC
+! de F2M de chaque charbon dans RTBMC
+
+! ------ W1 = - Somme des X2(icla)
+
+do icla = 1, nclacp
+ do iel = 1, ncel
+ xck = rtp(iel,isca(ixck(icla)))
+ xch = rtp(iel,isca(ixch(icla)))
+ xash = rtp(iel,isca(inp (icla)))*xmash(icla)
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ xwat = rtp(iel,isca(ixwt(icla)))
+ else
+ xwat = 0.d0
+ endif
+ x2 = xch + xck + xash + xwat
+ w1(iel) = w1(iel) - x2
+ enddo
+enddo
+
+! ------ RTBMC(IF1MC(ICHA)) = F1M(ICHA)
+! RTBMC(IF2MC(ICHA)) = F2M(ICHA)
+
+do icha = 1, ncharb
+ do iel = 1, ncel
+ rtbmc(iel,if1mc(icha)) = rtp(iel,isca(if1m(icha))) &
+ / (1.d0+w1(iel))
+ rtbmc(iel,if2mc(icha)) = rtp(iel,isca(if2m(icha))) &
+ / (1.d0+w1(iel))
+ enddo
+enddo
+
+
+! --- Calcul de CX1M, CX2M
+! et des coefficient relatifs a l'expression de
+! ZCHx1m0, ZCHx2m0, ZCO0, ZO20 et ZN20
+! introduction de ZH2O0
+! fonctions de F1, F2, F3 et F4
+
+do iel = 1, ncel
+
+! ---- YCHX1,20 en kg/kg de melange et
+! ZCHX1,20 en nb de moles/ kg de melange
+
+ ychx10 = zero
+ ychx20 = zero
+ zchx10 = zero
+ zchx20 = zero
+ zcof10 = zero
+ zcof20 = zero
+ zh2o10 = zero
+ zh2o20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( rtbmc(iel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ zchx10 = zchx10 + den1 * &
+ ( rtbmc(iel,if1mc(icha))*a1(icha) )
+ zcof10 = zcof10 + den1 * &
+ ( rtbmc(iel,if1mc(icha))*b1(icha) )
+ zh2o10 = zh2o10 + den1 * &
+ ( rtbmc(iel,if1mc(icha))*c1(icha) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( rtbmc(iel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ zchx20 = zchx20 + den2 * &
+ ( rtbmc(iel,if2mc(icha))*a2(icha) )
+ zcof20 = zcof20 + den2 * &
+ ( rtbmc(iel,if2mc(icha))*b2(icha) )
+ zh2o20 = zh2o20 + den2 * &
+ ( rtbmc(iel,if2mc(icha))*c2(icha) )
+ enddo
+ rtbmc(iel,ix1mc) = 4.d0
+ if ( zchx10.gt.epzero ) &
+ rtbmc(iel,ix1mc) = ( ychx10/zchx10-wmolat(iatc) ) &
+ / wmolat(iath)
+ rtbmc(iel,ix2mc) = 2.d0
+ if ( zchx20.gt.epzero ) &
+ rtbmc(iel,ix2mc) = ( ychx20/zchx20-wmolat(iatc) ) &
+ / wmolat(iath)
+
+ rtbmc(iel,ichx1f1) = 0.d0
+ rtbmc(iel,icof1 ) = 0.d0
+ rtbmc(iel,ih2of1 ) = 0.d0
+ if ( f1m(iel).gt.epzero ) then
+ rtbmc(iel,ichx1f1) = zchx10 / f1m(iel)
+ rtbmc(iel,icof1 ) = zcof10 / f1m(iel)
+ rtbmc(iel,ih2of1 ) = zh2o10 / f1m(iel)
+ endif
+ rtbmc(iel,ichx2f2) = 0.d0
+ rtbmc(iel,icof2 ) = 0.d0
+ rtbmc(iel,ih2of2 ) = 0.d0
+ if ( f2m(iel).gt.epzero ) then
+ rtbmc(iel,ichx2f2) = zchx20 / f2m(iel)
+ rtbmc(iel,icof2 ) = zcof20 / f2m(iel)
+ rtbmc(iel,ih2of2 ) = zh2o20 / f2m(iel)
+ endif
+
+enddo
+
+! ---- Initialisation des fractions massiques avec de l'air
+
+do iel = 1, ncel
+ fuel1(iel) = zero
+ fuel2(iel) = zero
+ fuel3(iel) = zero
+ oxyd(iel) = wmo2*ao2f4
+ prod1(iel) = zero
+ prod2(iel) = zero
+ xiner(iel) = wmn2*an2f4
+enddo
+
+nclo2 = 0
+nclco = 0
+nclo21 = 0
+nclco1 = 0
+
+cmina1 = 1.d+20
+cmaxa1 = -1.d+20
+cmina2 = 1.d+20
+cmaxa2 = -1.d+20
+cmins1 = 1.d+20
+cmaxs1 = -1.d+20
+cmins2 = 1.d+20
+cmaxs2 = -1.d+20
+
+!===============================================================================
+! 3. CALCUL DE LA COMPOSITION DU MELANGE SANS LES PDF
+! SI LES FLUCTUATIONS DE S SONT TROP FAIBLES
+!===============================================================================
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.0 ) then
+
+! --> Calculs preliminaires
+
+ if ( ieqco2 .eq. 1 ) then
+ zco2t = (rtp(iel,isca(iyco2))/ (1.d0+w1(iel)))/wmco2
+ else if ( ieqco2 .eq. 2 ) then
+ zcot = (rtp(iel,isca(iyco2))/ (1.d0+w1(iel)))/wmco
+ endif
+
+ cx1m = rtbmc(iel,ix1mc)
+ cx2m = rtbmc(iel,ix2mc)
+ wmchx1 = wmolat(iatc) + cx1m*wmolat(iath)
+ wmchx2 = wmolat(iatc) + cx2m*wmolat(iath)
+ achx1f1 = rtbmc(iel,ichx1f1)
+ achx2f2 = rtbmc(iel,ichx2f2)
+ acof1 = rtbmc(iel,icof1)
+ acof2 = rtbmc(iel,icof2)
+ ah2of1 = rtbmc(iel,ih2of1)
+ ah2of2 = rtbmc(iel,ih2of2)
+
+! --> Composition de la phase gazeuse avant combustion (indice 0)
+
+! ZCHX10 = ACHX1F1*F1
+! ZCHX20 = ACHX2F2*F2
+! ZCO0 = ACOF1*F1 + ACOF2*F2 + ACOF3*F3
+! ZCO20 = ZERO
+! ZH2O0 = ZERO
+! ZO20 = AO2F4*F4 + AO2F3*F3
+! ZN20 = AN2F4*F4
+
+ zchx10 = achx1f1*f1m(iel)
+ zchx20 = achx2f2*f2m(iel)
+ zco0 = (acof1*f1m(iel)+acof2*f2m(iel) + &
+ acof3*f3m(iel))
+ zo20 = ao2f4*f4m(iel)+ao2f6*f6m(iel)+ao2f7*f7m(iel) &
+ +ao2f3*f3m(iel)
+ zn20 = an2f4*f4m(iel)+an2f6*f6m(iel)+an2f7*f7m(iel)
+ zco20 = aco2f4*f4m(iel)+aco2f6*f6m(iel)+aco2f7*f7m(iel)
+ zh2o0 = ah2of4*f4m(iel)+ah2of6*f6m(iel)+ah2of7*f7m(iel) &
+ +ah2of5*f5m(iel)+ah2of1*f1m(iel)+ah2of2*f2m(iel)
+
+! --> Calcul de la composition du melange
+
+ anu1 = 0.25d0*(cx1m-cx2m)
+ reac1 = min(zchx10, (zo20/anu1))
+ zchx11 = zchx10 - reac1
+ zo21 = zo20 - anu1*reac1
+ zchx21 = zchx20 + reac1
+ zco1 = zco0
+ zco21 = zco20
+ zh2o1 = zh2o0 + 2.d0*anu1*reac1
+ zn21 = zn20
+
+ anu2 = 0.25d0*(2.d0 + cx2m)
+ reac2 = min(zchx21, (zo21/anu2))
+ zchx12 = zchx11
+ zchx22 = zchx21 - reac2
+ zo22 = zo21 - anu2*reac2
+ zco2 = zco1 + reac2
+ zco22 = zco21
+ zh2o2 = zh2o1 + .5d0*cx2m*reac2
+ zn22 = zn21
+
+ anu3 = 0.5d0
+ if ( ieqco2 .eq. 0 ) then
+ reac3 = min(zco2, (zo22/anu3))
+ zchx13 = zchx12
+ zchx23 = zchx22
+ zo23 = zo22 - anu3*reac3
+ zco3 = zco2 - reac3
+ zco23 = zco22 + reac3
+ zh2o3 = zh2o2
+ zn23 = zn22
+
+ else if ( ieqco2 .eq. 1 ) then
+
+! Transport de CO2
+
+ zchx13 = zchx12
+ zchx23 = zchx22
+
+ if ( (zco2-(zco2t-zco22)) .lt. -epzero ) then
+ nclco = nclco +1
+ cmins1 = min((zco2-zco2t),cmins1)
+ cmaxs1 = max((zco2-zco2t),cmins1)
+ endif
+ if ( (zo22-anu3*(zco2t-zco22)) .lt. -epzero ) then
+ nclo2 = nclo2 +1
+ cmins2 = min((zo22-anu3*zco2t),cmins2)
+ cmaxs2 = max((zo22-anu3*zco2t),cmins2)
+ endif
+ reac3 = min(max(zco2t-zco22,0.d0),zco2,zo22/anu3)
+
+! RTP(IEL,ISCA(IYCO2))= ZCO2T*(1.D0+W1(IEL))*WMCO2
+
+ zo23 = zo22 - anu3*reac3
+ zco3 = zco2 - reac3
+ zco23 = zco22 + reac3
+
+ zh2o3 = zh2o2
+ zn23 = zn22
+
+ else
+
+ write(nfecra,3000) ieqco2
+ call csexit(1)
+
+ endif
+
+ fuel1(iel) = zchx13 * wmchx1
+ fuel2(iel) = zchx23 * wmchx2
+ fuel3(iel) = zco3 * wmco
+ prod1(iel) = zco23 * wmco2
+ prod2(iel) = zh2o3 * wmh2o
+ oxyd(iel) = zo23 * wmo2
+ xiner(iel) = zn23 * wmn2
+
+ endif
+
+enddo
+
+!===============================================================================
+! 4. CALCUL DE LA COMPOSITION DU MELANGE AVEC LES PDF
+!===============================================================================
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.1 ) then
+
+! --> Calculs preliminaires
+
+ if ( ieqco2 .eq. 1 ) then
+ zco2t = (rtp(iel,isca(iyco2))/(1.d0+w1(iel)))/wmco2
+ else if ( ieqco2 .eq. 2 ) then
+ zcot = (rtp(iel,isca(iyco2))/(1.d0+w1(iel)))/wmco
+ endif
+
+ cx1m = rtbmc(iel,ix1mc)
+ cx2m = rtbmc(iel,ix2mc)
+ wmchx1 = wmolat(iatc) + cx1m*wmolat(iath)
+ wmchx2 = wmolat(iatc) + cx2m*wmolat(iath)
+ achx1f1 = rtbmc(iel,ichx1f1)
+ achx2f2 = rtbmc(iel,ichx2f2)
+ acof1 = rtbmc(iel,icof1)
+ acof2 = rtbmc(iel,icof2)
+ ah2of1 = rtbmc(iel,ih2of1)
+ ah2of2 = rtbmc(iel,ih2of2)
+
+ f4loc = f4m(iel)/(f4m(iel)+f6m(iel)+f7m(iel))
+ f6loc = f6m(iel)/(f4m(iel)+f6m(iel)+f7m(iel))
+ f7loc = f7m(iel)/(f4m(iel)+f6m(iel)+f7m(iel))
+ s4loc = oxyo2 (1)*wmo2 +oxyn2 (1)*wmn2 &
+ +oxyh2o(1)*wmh2o+oxyco2(1)*wmco2
+ s6loc = oxyo2 (2)*wmo2 +oxyn2 (2)*wmn2 &
+ +oxyh2o(2)*wmh2o+oxyco2(2)*wmco2
+ s7loc = oxyo2 (3)*wmo2 +oxyn2 (3)*wmn2 &
+ +oxyh2o(3)*wmh2o+oxyco2(3)*wmco2
+
+ yo2ox = wmo2 &
+ /(f4loc*s4loc+f6loc*s6loc+f7loc*s7loc)
+ an2f3 = (1.d0-yo2ox)/wmole(in2) * (1.d0-f3max(iel))
+
+ anu1 = 0.25d0*(cx1m-cx2m)
+ anu2 = 0.25d0*(2.d0 + cx2m)
+ anu3 = 0.5d0
+
+ foxy = f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel)
+ foxycl = f4cl(iel)+f5cl(iel)+f6cl(iel)+f7cl(iel)
+
+! Concentrations aux extr�mit�s
+
+ do ii = 1,7
+ zzcl(ii) = zero
+ zzoxy(ii) = zero
+ enddo
+
+ zzcl(ichx1)= achx1f1*f1cl(iel)
+ zzcl(ichx2)= achx2f2*f2cl(iel)
+ zzcl(ico) = acof1 *f1cl(iel)+acof2*f2cl(iel) &
+ +acof3*f3cl(iel)
+ zzcl(io2) = ao2f4*f4cl(iel)+ao2f6*f6cl(iel)+ao2f7*f7cl(iel) &
+ +ao2f3*f3cl(iel)
+ zzcl(in2) = an2f4*f4cl(iel)+an2f6*f6cl(iel)+an2f7*f7cl(iel)
+ zzcl(ih2o) = ah2of4*f4cl(iel)+ah2of6*f6cl(iel) &
+ +ah2of7*f7cl(iel) &
+ +ah2of1*f1cl(iel)+ah2of2*f2cl(iel) &
+ +ah2of5*f5cl(iel)
+ zzcl(ico2) = aco2f4*f4cl(iel)+aco2f6*f6cl(iel) &
+ +aco2f7*f7cl(iel)
+
+ zzoxy(io2) = (ao2f4*f4m(iel)+ao2f6*f6m(iel)+ao2f7*f7m(iel)) &
+ /foxy
+ zzoxy(in2) = (an2f4*f4m(iel)+an2f6*f6m(iel)+an2f7*f7m(iel)) &
+ /foxy
+ zzoxy(ih2o) = ( ah2of4*f4m(iel)+ah2of6*f6m(iel) &
+ +ah2of7*f7m(iel) &
+ +ah2of5*f5m(iel) ) &
+ /foxy
+ zzoxy(ico2) = (aco2f4*f4m(iel)+aco2f6*f6m(iel) &
+ +aco2f7*f7m(iel)) &
+ /foxy
+
+! Calcul de la stoechiom�trie de la premi�re r�action
+
+ if ( zzcl(ichx1) .gt. 0.d0 .or. &
+ zzoxy(io2) .gt. 0.d0 ) then
+ f4s1 = ( anu1 * zzcl(ichx1) + foxycl * zzoxy(io2) ) &
+ / ( anu1 * zzcl(ichx1) + zzoxy(io2) )
+ else
+ f4s1 = 1.d0
+ endif
+
+! Calcul des concentrations au premier point stoechio
+! avant r�action
+
+ do ii = 1,7
+ zzs1(ii) = zzcl(ii) &
+ + (f4s1-foxycl)/(1.d0-foxycl) &
+ *(zzoxy(ii)-zzcl(ii))
+ enddo
+
+ zzs1(ichx2) = zzs1(ichx2) + zzs1(ichx1)
+ zzs1(io2) = zero
+ zzs1(ih2o) = zzs1(ih2o) + 2.d0*anu1*zzs1(ichx1)
+ zzs1(ichx1) = zero
+
+! Calcul de la stoechiometrie de la deuxi�me r�action
+
+ if ( zzs1(ichx2) .gt. 0.d0 .or. &
+ zzoxy(io2) .gt. 0.d0 ) then
+ f4s2 = ( anu2 * zzs1(ichx2) + f4s1 * zzoxy(io2) ) &
+ /( anu2 * zzs1(ichx2) + zzoxy(io2) )
+ else
+ f4s2 = 1.d0
+ endif
+
+! Calcul des concentrations au deuxi�me point stoechio
+! avant r�action
+
+ if ( abs(1.d0-f4s1).gt. 0.d0 ) then
+ do ii = 1,7
+ zzs2(ii) = zzs1(ii) &
+ + (f4s2-f4s1) / (1.d0-f4s1) * (zzoxy(ii) - zzs1(ii))
+ enddo
+ else
+ do ii = 1,7
+ zzs2(ii) = zzs1(ii)
+ enddo
+ endif
+
+ zzs2(ico) = zzs2(ico) + zzs2(ichx2)
+ zzs2(ih2o) = zzs2(ih2o) + (2.d0*anu2-1.d0)*zzs2(ichx2)
+ zzs2(io2) = zero
+ zzs2(ichx2) = zero
+
+! Calcul de la stoechiometrie de la troisi�me r�action
+! CO + O2 => CO2
+! Les concentrations sont d�sormais lin�aires entre F4S2 et 1
+! ZZ(F4,II) = ZZS2(II) + (F4-F4S2)/(1-F4S2)*(ZZF4(II)-ZZS2(II))
+! On cherche le point tel que
+! ZZ(f4s3,ICO) = ZZ(F4S3,IO2)/ANU3
+! La formule est semblable � la pr�cedente en substituant
+! ANU2 par ANU3
+
+ if ( zzs2(ico) .gt. 0.d0 .or. &
+ zzs2(io2) .gt. 0.d0 ) then
+ f4s3 = ( anu3 * zzs2(ico ) + f4s2 * zzoxy(io2) ) &
+ / ( anu3 * zzs2(ico ) + zzoxy(io2) )
+ else
+ f4s3 = 1.d0
+ endif
+
+! Calcul des concentrations au troisi�me point stoechio
+! avant r�action
+
+ if ( abs(1.d0-f4s2).gt. 0.d0 ) then
+ do ii = 1,7
+ zzs3(ii) = zzs2(ii) &
+ + (f4s3-f4s2) / (1.d0-f4s2) * (zzoxy(ii) - zzs2(ii))
+ enddo
+ else
+ do ii = 1,7
+ zzs3(ii) = zzs2(ii)
+ enddo
+ endif
+
+! Le nombre de moles de r�action est le nombre de moles de CO
+
+ if ( ieqco2 .eq. 0 ) then
+ zzs3(ico2) = zzs3(ico2) + zzs3(ico)
+ zzs3(io2) = zero
+ zzs3(ico) = zero
+ endif
+
+! D�sormais on connait les concentrations en 5 points
+! cl,s1,s2,s3,f4
+! les concentrations interm�diaires sont lin�aires par morceaux
+! et les param�tres de la pdf D4cl,D4f4, F4m1,F4m2,HREC
+
+! On initialise par les concentrations aux extr�mit�s
+ do ii = 1,7
+ zz(ii) = d4cl(iel)*zzcl(ii)+d4f4(iel)*zzoxy(ii)
+ enddo
+
+! Int�gration sur le premier intervalle de richesse (entre cl et s1)
+
+ bb1 = max(f4m1(iel),foxycl)
+ bb2 = min(f4m2(iel),f4s1)
+ if( bb2.gt.bb1 ) then
+ do ii = 1,7
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(f4s1-foxycl) &
+ *( (zzcl(ii)*f4s1-zzs1(ii)*foxycl) &
+ + (zzs1(ii)-zzcl(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+! Int�gration sur le deuxi�me intervalle de (entre s1 et s2)
+
+ bb1 = max(f4m1(iel),f4s1)
+ bb2 = min(f4m2(iel),f4s2)
+ if( bb2.gt.bb1 ) then
+ do ii = 1,7
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(f4s2-f4s1) &
+ * ( (zzs1(ii)*f4s2-zzs2(ii)*f4s1) &
+ + (zzs2(ii)-zzs1(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+! Int�gration de s2 � s3
+
+ bb1 = max(f4m1(iel),f4s2)
+ bb2 = min(f4m2(iel),f4s3)
+ if( bb2.gt.bb1 ) then
+ do ii = 1,7
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(f4s3-f4s2) &
+ * ( (zzs2(ii)*f4s3-zzs3(ii)*f4s2) &
+ + (zzs3(ii)-zzs2(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+! Int�gration de s3 � f4
+
+ bb1 = max(f4m1(iel),f4s3)
+ bb2 = min(f4m2(iel),1.d0)
+ if ( bb2.gt.bb1 ) then
+ do ii = 1,7
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(1.d0-f4s3) &
+ * ( (zzs3(ii)*1.d0-zzoxy(ii)*f4s3) &
+ +(zzoxy(ii)-zzs3(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+ if ( ieqco2 .eq. 1 ) then
+
+! Transport de CO2
+
+ if ( (zz(ico) - (zco2t-zz(ico2))) .lt. -epzero ) then
+ nclco1 = nclco1 +1
+ cmina1 = min((zz(ico)- (zco2t-zz(ico2))),cmina1)
+ cmaxa1 = max((zz(ico)- (zco2t-zz(ico2))),cmaxa1)
+ endif
+ if ( (zz(io2)-anu3*(zco2t-zz(ico2))) .lt. -epzero ) then
+ nclo21 = nclo21 +1
+ cmina2 = min((zz(io2) -anu3*(zco2t-zz(ico2))),cmina2)
+ cmaxa2 = max((zz(io2) -anu3*(zco2t-zz(ico2))),cmaxa2)
+ endif
+
+ reac3 = min(max(zco2t-zz(ico2),0.d0),zz(ico), &
+ zz(io2)/anu3)
+
+ zz(ico ) = zz(ico) - reac3
+ zz(io2 ) = zz(io2) - anu3*reac3
+ zz(ico2) = zz(ico2)+ reac3
+
+! RTP(IEL,ISCA(IYCO2))= ZCO2T*(1.D0+W1(IEL))*WMCO2
+
+ else if ( ieqco2 .ne. 0 ) then
+
+ write(nfecra,3000) ieqco2
+ call csexit(1)
+
+ endif
+
+ fuel1(iel) = zz(ichx1) * wmchx1
+ fuel2(iel) = zz(ichx2) * wmchx2
+ fuel3(iel) = zz(ico ) * wmco
+ prod1(iel) = zz(ico2 ) * wmco2
+ prod2(iel) = zz(ih2o ) * wmh2o
+ oxyd(iel) = zz(io2 ) * wmo2
+ xiner(iel) = zz(in2 ) * wmn2
+
+ endif
+
+enddo
+
+n2 = 0
+do iel = 1, ncel
+ if ( fuel3(iel) .lt. (-epzero) ) then
+ n2= n2 + 1
+ endif
+enddo
+
+if ( ieqco2 .eq. 1 .or. ieqco2 .eq.2 ) then
+
+
+ if (irangp.ge.0) then
+
+ call parcpt(n2)
+ call parcpt(nclco)
+ call parcpt(nclco1)
+ call parcpt(nclo2)
+ call parcpt(nclo21)
+
+ call parmin(cmins1)
+ call parmin(cmina1)
+ call parmin(cmins2)
+ call parmin(cmina2)
+
+ call parmax(cmaxs1)
+ call parmax(cmaxa1)
+ call parmax(cmaxs2)
+ call parmax(cmaxa2)
+
+ endif
+
+ WRITE(NFECRA,*) ' Point a CO < 0 ',N2
+ WRITE(NFECRA,*) ' Clipping CO2 - CO sans avec : ',NCLCO,NCLCO1
+ WRITE(NFECRA,*) ' Min Max sans : ',CMINS1,CMAXS1
+ WRITE(NFECRA,*) ' Min Max avec : ',CMINA1,CMAXA1
+ WRITE(NFECRA,*) ' Clipping CO2 - O2 sans avec : ',NCLO2,NCLO21
+ WRITE(NFECRA,*) ' Min Max sans : ',CMINS2,CMAXS2
+ WRITE(NFECRA,*) ' Min Max avec : ',CMINA2,CMAXA2
+
+endif
+
+!===============================================================================
+! 5. IMPRESSION
+!===============================================================================
+
+n2 = 0
+n3 = 0
+n4 = 0
+n5 = 0
+n6 = 0
+n7 = 0
+n8 = 0
+n9 = 0
+n10 = 0
+
+! --> Controle des parametres de la pdf
+
+n1 = ncel
+
+do iel = 1, ncel
+ if ( indpdf(iel).ne.0 ) then
+ n2 = n2 +1
+ endif
+enddo
+
+! --> Controle des differentes valeurs des fractions massiques
+
+sommin = 1.d+20
+sommax =-1.d+20
+do iel = 1, ncel
+
+ somm = fuel1(iel) + fuel2(iel) + fuel3(iel) &
+ + oxyd(iel) &
+ + prod1(iel) + prod2(iel) + xiner(iel)
+
+ sommin = min(sommin,somm)
+ sommax = max(sommax,somm)
+
+ if ( abs(somm-1.d0).lt.epsicp ) then
+ n3 = n3 +1
+ endif
+
+ if ( fuel1(iel).lt.(-epzero) .or. &
+ fuel1(iel).gt.(1.d0+epzero) ) n4 = n4+1
+ if ( fuel2(iel).lt.(-epzero) .or. &
+ fuel2(iel).gt.(1.d0+epzero) ) n5 = n5+1
+ if ( fuel3(iel).lt.(-epzero) .or. &
+ fuel3(iel).gt.(1.d0+epzero) ) n6 = n6+1
+ if ( oxyd(iel).lt.(-epzero) .or. &
+ oxyd(iel).gt.(1.d0+epzero) ) n7 = n7+1
+ if ( xiner(iel).lt.(-epzero) .or. &
+ xiner(iel).gt.(1.d0+epzero) ) n8 = n8+1
+ if ( prod1(iel).lt.(-epzero) .or. &
+ prod1(iel).gt.(1.d0+epzero) ) n9 = n9+1
+ if ( prod2(iel).lt.(-epzero) .or. &
+ prod2(iel).gt.(1.d0+epzero) ) n10 = n10+1
+
+enddo
+
+n1 = ncel
+
+if (irangp.ge.0) then
+ inttmp( 1) = n1
+ inttmp( 2) = n2
+ inttmp( 3) = n3
+ inttmp( 4) = n4
+ inttmp( 5) = n5
+ inttmp( 6) = n6
+ inttmp( 7) = n7
+ inttmp( 8) = n8
+ inttmp( 9) = n9
+ inttmp(10) = n10
+ call parism(nbrint,inttmp)
+ !==========
+endif
+
+write(nfecra,1000) n1 , n2
+
+write(nfecra,2200) n3 , n4, n5, n6, n7, n8, &
+ n9, n10
+
+if ( irangp .ge. 0 ) then
+ call parmin(sommin)
+ call parmax(sommax)
+endif
+
+write(NFECRA,*) ' Somme Min MAX = ',SOMMIN,SOMMAX
+
+!-------
+! FORMAT
+!-------
+
+ 1000 format (/, &
+'MODELISATION DE LA COMBUSTION AVEC LE MODELE DE DIFFUSION ', &
+'TURBULENTE (CPCYM2)',/, &
+'CHIMIE RAPIDE A 3 CORPS - EXTENSION A 3 COMBUSTIBLES ', &
+'(Application au FUEL)',/, &
+'==========================================================', &
+'==================',/, &
+' Nb de points de calculs = ',&
+ i9,/, &
+' Nb de points turbulents (passage par les PDF) = ',&
+ i9)
+
+ 2200 format(/, &
+'CONTROLE DES VALEURS DES FRACTIONS MASSIQUES',/, &
+' Nb de points de calculs qui respectent somme des Yi = 1 = ', &
+ i9,/, &
+' Nb de points YCHX1 ,YCHX2 < 0 ou > 1 = ',I9,I9,/, &
+' Nb de points YC0 < 0 ou > 1 = ',I9,/, &
+' Nb de points YO2 ,YN2 < 0 ou > 1 = ',I9,I9,/, &
+' Nb de points YCO2 ,YH2O < 0 ou > 1 = ',I9,I9,/)
+
+ 3000 format(/, &
+'MODELE DE CO CHARBON ACTIVE : ',/, &
+' AVEC IEQCO2 = ',I2,/, &
+'HORS SEUL LES OPTIONS 0 , 1 et 2 SONT DISPONIBLES',/, &
+' ARRET DU CALCUL : VERIFIER USPPMO')
+
+
+return
+end
diff --git a/src/cplv/cpflux.f90 b/src/cplv/cpflux.f90
new file mode 100644
index 0000000..20418b9
--- /dev/null
+++ b/src/cplv/cpflux.f90
@@ -0,0 +1,658 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpflux &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ rtpa , propce , volume , &
+ w1 , w2 , w3 , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES TERMES DE TRANSFERT DE MASSE ENTRE LA PHASE CONTINUE
+! ET LA PHASE DISPERSEE
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant precedent) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! w1, w2, w3 ! tr ! --- ! tableaux de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+
+double precision rtpa(ncelet,*), propce(ncelet,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision volume(ncelet)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , iphas , icha , icla
+integer ipcrom , ipcte1 , ipctem , ipcro2 , ipcdia
+integer ipcgd1 , ipcgd2 , ipcgch , ipcght , ipcyox
+integer ipcsec
+integer ipcvsl , ipccp, iromf , ipcte2
+integer npoin1,npoin2,npoin3,npoin4,npoin5,npoin6
+integer npoin63, npoin65
+integer npyv, modntl
+
+double precision x2 , xch , xck , xash , xnp , xuash
+double precision pparo2 , xdfchi , xdfext , xdftot0 , xdftot1
+double precision devto1(ncharm) , devto2(ncharm) , coxck , den
+double precision diacka
+double precision dp , lv, yvs, yv , tebl , shrd , xmeau, xmgaz
+double precision xnuss, tlimit , tmini
+double precision tmin, tmax, yvmin, yvmax, yymax
+
+integer ipyco2
+double precision pprco2
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS ET CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Initialisation des termes de transfert de masse
+
+do icla = 1, nclacp
+ ipcgd1 = ipproc(igmdv1(icla))
+ ipcgd2 = ipproc(igmdv2(icla))
+ ipcgch = ipproc(igmdch(icla))
+ ipcght = ipproc(igmhet(icla))
+ do iel = 1, ncel
+ propce(iel,ipcgd1) = zero
+ propce(iel,ipcgd2) = zero
+ propce(iel,ipcgch) = zero
+ propce(iel,ipcght) = zero
+ enddo
+enddo
+
+! --- Initialisation des tableaux de travail
+
+do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+enddo
+
+! --- Calcul de la masse volumique du melange gazeux
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+
+! ---- W1 = Somme (X2i)
+! W2 = Somme (X2i/Rho2i)
+
+do icla = 1, nclacp
+ ipcro2 = ipproc(irom2(icla))
+ do iel = 1, ncel
+ xck = rtpa(iel,isca(ixck(icla)))
+ xch = rtpa(iel,isca(ixch(icla)))
+ xash = rtpa(iel,isca(inp (icla)))*xmash(icla)
+ x2 = xch + xck + xash
+
+! Prise en compte de l'humidite
+
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ x2 = x2+rtpa(iel,isca(ixwt(icla)))
+ endif
+
+ w1(iel) = w1(iel) + x2
+ w2(iel) = w2(iel) + x2 / propce(iel,ipcro2)
+ enddo
+enddo
+
+! ---- W3 : Rho 1
+
+do iel = 1, ncel
+ w3(iel) = (1.d0-w1(iel)) / (1.d0/propce(iel,ipcrom)-w2(iel))
+enddo
+
+
+
+!===============================================================================
+! 2. TRANSFERTS DE MASSE PAR DEVOLATILISATION
+!===============================================================================
+
+ipcte1 = ipproc(itemp1)
+
+do icla = 1, nclacp
+
+ ipcgd1 = ipproc(igmdv1(icla))
+ ipcgd2 = ipproc(igmdv2(icla))
+ ipcgch = ipproc(igmdch(icla))
+ ipctem = ipproc(itemp2(icla))
+
+ do iel = 1, ncel
+
+! --- Transfert de masse du au degagemnt des MV legeres (s-1) < 0
+
+ propce(iel,ipcgd1) = -y1ch(ichcor(icla))*a1ch(ichcor(icla)) &
+ * exp(-e1ch(ichcor(icla))/(rr*propce(iel,ipctem)))
+
+! --- Transfert de masse du au degagemnt des MV lourdes (s-1) < 0
+
+ propce(iel,ipcgd2) = -y2ch(ichcor(icla))*a2ch(ichcor(icla)) &
+ * exp(-e2ch(ichcor(icla))/(rr*propce(iel,ipctem)))
+
+! --- Taux de disparition du charbon reactif (s-1) < 0
+
+ propce(iel,ipcgch) = - a1ch(ichcor(icla)) &
+ * exp(-e1ch(ichcor(icla))/(rr*propce(iel,ipctem))) &
+ - a2ch(ichcor(icla)) &
+ * exp(-e2ch(ichcor(icla))/(rr*propce(iel,ipctem)))
+
+ enddo
+
+enddo
+
+
+!===============================================================================
+! 3. CALCUL DE RHO_COKE MOYEN POUR CHAQUE CHARBON
+! On suppose pour le calcul de la masse volumique du coke que
+! la devolatilisation a lieu a volume constant
+!===============================================================================
+
+! --- Initialisation
+
+do icha = 1, ncharb
+ devto1(icha) = zero
+ devto2(icha) = zero
+ rhock(icha) = rho0ch(icha)
+enddo
+
+! --- Calcul de l'integrale de GMDEV1 et GMDEV2 pour chaque charbon
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+do icla = 1, nclacp
+ ipcgd1 = ipproc(igmdv1(icla))
+ ipcgd2 = ipproc(igmdv2(icla))
+ do iel = 1, ncel
+ xch = rtpa(iel,isca(ixch(icla)))
+ devto1(ichcor(icla)) = devto1(ichcor(icla)) - &
+ ( propce(iel,ipcgd1)*xch*propce(iel,ipcrom) &
+ *volume(iel) )
+ devto2(ichcor(icla)) = devto2(ichcor(icla)) - &
+ ( propce(iel,ipcgd2)*xch*propce(iel,ipcrom) &
+ *volume(iel) )
+ enddo
+ if(irangp.ge.0) then
+ call parsom(devto1(ichcor(icla)))
+ call parsom(devto2(ichcor(icla)))
+ endif
+enddo
+
+! --- Calcul de la masse volumique moyenne du coke
+
+do icha = 1, ncharb
+ den = y2ch(icha)*devto1(icha)+y1ch(icha)*devto2(icha)
+ if ( den.gt.epsicp ) then
+ rhock(icha) = rho0ch(icha) * ( 1.d0 - &
+ ( y1ch(icha)*y2ch(icha)*(devto1(icha)+devto2(icha))/den ) )
+ endif
+enddo
+
+!===============================================================================
+! 4. TRANSFERTS DE MASSE PAR COMBUSTION HETEROGENE AVEC O2
+!===============================================================================
+
+ipcyox = ipproc(iym1(io2))
+ipcte1 = ipproc(itemp1)
+
+do icla = 1, nclacp
+
+ ipcght = ipproc(igmhet(icla))
+ ipcdia = ipproc(idiam2(icla))
+ icha = ichcor(icla)
+ ipctem = ipproc(itemp2(icla))
+
+ do iel = 1, ncel
+
+ xnp = rtpa(iel,isca(inp(icla)))
+ xuash = xnp*(1.d0-xashch(icha))*xmp0(icla)
+
+! --- Calcul de la pression partielle en oxygene (atm)
+! ---
+! PO2 = RHO1*RR*T*YO2/MO2
+
+ pparo2 = w3(iel)*rr*propce(iel,ipcte1) &
+ * propce(iel,ipcyox)/wmole(io2)
+ pparo2 = pparo2 / prefth
+
+! --- Coefficient de cinetique chimique de formation de CO
+! en (kg.m-2.s-1.atm(-n))
+
+ xdfchi = ahetch(ichcor(icla)) &
+ * exp(-ehetch(ichcor(icla))*4185.d0 &
+ / (rr * propce(iel,ipctem)) )
+
+! --- Coefficient de diffusion en (Kg/m2/s/atm) : XDFEXT
+! Coefficient global pour n=0.5 en (kg/m2/s) : XDFTOT0
+! Coefficient global pour n=1 en (Kg/m2/s) : XDFTOT1
+
+ diacka = propce(iel,ipcdia)/diam20(icla)
+ if ( diacka .gt. epsicp ) then
+ xdfext = 2.53d-7*((propce(iel,ipctem))**0.75d0) &
+ / propce(iel,ipcdia)*2.d0
+ xdftot1 = pparo2 / ( 1.d0/xdfchi + 1.d0/xdfext )
+ xdftot0 = -(xdfchi**2)/(2.d0*xdfext)+(pparo2*xdfchi**2 &
+ + (xdfchi**4)/(4.d0*xdfext**2))**0.5d0
+ else
+ xdftot1 = xdfchi*pparo2
+ xdftot0 = xdfchi*pparo2**0.5d0
+ endif
+
+! Rq AE : Pour l'instant, on se limite a ce test
+! L'introduction d'une correlation de soufflage viendra
+! ulterieurement.
+
+! --- Calcul de COXCK tq : Se = COXCK * XCK**(2/3)
+
+ coxck = zero
+ if ( xuash.gt.epsicp ) then
+ coxck = pi*(diam20(icla)**2)* &
+ (rho20(icla)/(rhock(icha)*xuash))**(2.d0/3.d0)
+ endif
+
+! --- Calcul de PROPCE(IEL,IPCGHT) = - COXCK*XDFTOT0*PPARO2*XNP < 0
+! --- ou PROPCE(IEL,IPCGHT) = - COXCK*XDFTOT1*PPARO2*XNP < 0
+
+ if (iochet(icha).eq.1) then
+ propce(iel,ipcght) = - xdftot1*coxck*xnp
+ else
+ propce(iel,ipcght) = - xdftot0*coxck*xnp
+ endif
+
+ enddo
+
+enddo
+
+!===============================================================================
+! 5. TRANSFERTS DE MASSE PAR COMBUSTION HETEROGENE AVEC CO2
+!===============================================================================
+
+if ( ihtco2 .eq. 1) then
+
+ ipyco2 = ipproc(iym1(ico2))
+ ipcte1 = ipproc(itemp1)
+
+ do icla = 1, nclacp
+
+ ipcght = ipproc(ighco2(icla))
+ ipcdia = ipproc(idiam2(icla))
+ icha = ichcor(icla)
+ ipctem = ipproc(itemp2(icla))
+
+ do iel = 1, ncel
+
+ xnp = rtpa(iel,isca(inp(icla)))
+ xuash = xnp*(1.d0-xashch(icha))*xmp0(icla)
+
+! --- Calcul de la pression partielle en oxygene (atm)
+! ---
+! PCO2 = RHO1*RR*T*YO2/MO2
+
+ pprco2 = w3(iel)*rr*propce(iel,ipcte1) &
+ *propce(iel,ipyco2)/wmole(ico2)
+ pprco2 = pprco2 / prefth
+
+! --- Coefficient de cinetique chimique de formation de CO
+! en (kg.m-2.s-1.atm(-n))
+
+ xdfchi = ahetc2(ichcor(icla)) &
+ * exp(-ehetc2(ichcor(icla))*4185.d0 &
+ / (rr * propce(iel,ipctem)) )
+
+! --- Coefficient de diffusion en (Kg/m2/s/atm) : XDFEXT
+! Coefficient global pour n=0.5 en (kg/m2/s) : XDFTOT0
+! Coefficient global pour n=1 en (Kg/m2/s) : XDFTOT1
+
+ diacka = propce(iel,ipcdia)/diam20(icla)
+ if ( diacka .gt. epsicp ) then
+ xdfext = 2.53d-7*((propce(iel,ipctem))**0.75d0) &
+ / propce(iel,ipcdia)*2.d0
+ xdftot1 = pprco2 / ( 1.d0/xdfchi + 1.d0/xdfext )
+ xdftot0 = -(xdfchi**2)/(2.d0*xdfext)+(pprco2*xdfchi**2 &
+ +(xdfchi**4)/(4.d0*xdfext**2))**0.5d0
+ else
+ xdftot1 = xdfchi*pprco2
+ xdftot0 = xdfchi*pprco2**0.5d0
+ endif
+
+! Rq AE : Pour l'instant, on se limite a ce test
+! L'introduction d'une correlation de soufflage viendra
+! ulterieurement.
+
+! --- Calcul de COXCK tq : Se = COXCK * XCK**(2/3)
+
+ coxck = zero
+ if ( xuash.gt.epsicp ) then
+ coxck = pi*(diam20(icla)**2)* &
+ (rho20(icla)/(rhock(icha)*xuash))**(2.d0/3.d0)
+ endif
+
+! --- Calcul de PROPCE(IEL,IPCGHT) = - COXCK*XDFTOT0*PPRCO2*XNP < 0
+! --- ou PROPCE(IEL,IPCGHT) = - COXCK*XDFTOT1*PPRCO2*XNP < 0
+
+ if (ioetc2(icha).eq.1) then
+ propce(iel,ipcght) = - xdftot1*coxck*xnp
+ else
+ propce(iel,ipcght) = - xdftot0*coxck*xnp
+ endif
+
+ enddo
+
+ enddo
+
+endif
+
+!===============================================================================
+! 6. TRANSFERTS DE MASSE LORS DE LA PHASE DE SECHAGE
+!===============================================================================
+
+if ( ippmod(icp3pl) .eq. 1 ) then
+
+! Chaleur Latente en J/kg
+ lv = 2.263d+6
+ tebl = 100.d0+tkelvi
+
+ xnuss = 2.d0
+ shrd = 2.d0
+ xmeau = 0.018d0
+
+ tlimit = 302.24d0
+ tmini = tlimit*(1.d0-tlimit/(lv*xmeau))
+ write(NFECRA,*) ' TMIN = ',TMINI
+
+ do iel = 1, ncel
+ if ( ivisls(ihm).gt.0 ) then
+ ipcvsl = ipproc(ivisls(ihm))
+ if ( icp(iphas).gt.0 ) then
+ ipccp = ipproc(icp(iphas))
+ w1(iel) = propce(iel,ipcvsl) * propce(iel,ipccp)
+ else
+ w1(iel) = propce(iel,ipcvsl) * cp0(iphas)
+ endif
+ else
+ if ( icp(iphas).gt.0 ) then
+ ipccp = ipproc(icp(iphas))
+ w1(iel) = visls0(ihm) * propce(iel,ipccp)
+ else
+ w1(iel) = visls0(ihm) * cp0(iphas)
+ endif
+ endif
+ enddo
+
+ if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+ elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+ else
+ modntl = 1
+ endif
+
+ do icla = 1, nclacp
+
+ npoin1 = 0
+ npoin2 = 0
+ npoin3 = 0
+ npoin4 = 0
+ npoin5 = 0
+ npoin6 = 0
+ npoin63 = 0
+ npoin65 = 0
+
+ icha = ichcor(icla)
+
+ iromf = ipproc(irom1)
+ ipcte1 = ipproc(itemp1)
+ ipcte2 = ipproc(itemp2(icla))
+ ipcsec = ipproc(igmsec(icla))
+ ipcro2 = ipproc(irom2(icla))
+
+! -------- Calcul du diametre des particules dans W2
+! On calcule le d20 = (A0.D0**2+(1-A0)*DCK**2)**0.5
+
+
+ tmax = -1.d+20
+ tmin = 1.d+20
+ yvmin = 1.d+20
+ yvmax =-1.d+20
+
+ npyv = 0
+ yymax = 0.d0
+
+ do iel = 1, ncel
+
+ propce(iel,ipcsec) = 0.d0
+
+ if ( rtpa(iel,isca(ixwt(icla))) .gt. epsicp ) then
+
+ npoin1 = npoin1 + 1
+
+ xnp = rtpa(iel,isca(inp(icla)))
+
+! Calcul du diametre des particules dans W2
+! On calcule le d20 = (A0.D0**2+(1-A0)*DCK**2)**0.5
+
+ dp = ( xashch(icha)*diam20(icla)**2 + &
+ (1.d0-xashch(icha))*propce(iel,ipcdia)**2 &
+ )**0.5
+
+! IF ( PROPCE(IEL,IPCTE2).LT. TEBL ) THEN
+
+ npoin2 = npoin2 + 1
+
+ if ( propce(iel,ipcte2) .gt. tlimit )then
+ xmgaz = propce(iel,ipproc(immel))
+ yvs = xmeau/xmgaz &
+ *exp( lv*xmeau &
+ *(1.d0/tebl-1.d0/propce(iel,ipcte2)) &
+ /rr )
+
+ else
+ xmgaz = propce(iel,ipproc(immel))
+ yvs = xmeau/xmgaz &
+ *exp( lv*xmeau &
+ *(1.d0/tebl-1.d0/tlimit) &
+ /rr ) &
+ *(lv*xmeau*(propce(iel,ipcte2)-tmini)) &
+ /(tlimit*tlimit)
+ endif
+
+! YV = 2.D0*YVS/3.D0
+
+ yv = yvs+ (1.d0/3.d0) &
+ *(propce(iel,ipproc(iym1(ih2o)))-yvs)
+
+ if ( yv .lt. 0.d0 ) then
+ write(nfecra,*) yv,yvs,propce(iel,ipproc(iym1(ih2o)))
+ write(nfecra,*) propce(iel,ipcte2),tmini
+ call csexit(1)
+ endif
+ if ( yv .ge. 1.d0) then
+ yymax = max(yymax,yv)
+ npyv = npyv +1
+ yv = 0.99d0
+ endif
+
+ yvmin=min(yvmin,yv)
+ yvmax=max(yvmax,yv)
+
+ if ( yv .gt. epsicp .and. yv .lt. 1.d0) then
+
+ npoin3 = npoin3 + 1
+
+ propce(iel,ipcsec) = pi*dp*propce(iel,iromf) &
+ *diftl0*shrd*xnp &
+ *log(1.d0/(1.d0-yv))
+ if ( propce(iel,ipcsec) .lt. 0.d0 ) then
+ propce(iel,ipcsec) = 0.d0
+ npoin63 = npoin63 + 1
+ endif
+ else
+
+ npoin4 = npoin4 + 1
+
+ propce(iel,ipcsec) = 0.d0
+ endif
+
+! ELSE
+
+! NPOIN5 = NPOIN5 + 1
+
+! PROPCE(IEL,IPCSEC) = W1(IEL)*XNUSS*XNP
+! & *PI*DP
+! & *( PROPCE(IEL,IPCTE1)
+! & -PROPCE(IEL,IPCTE2))/LV
+
+
+! PROPCE(IEL,IPCSEC) = 6.D0*W1(IEL)*XNUSS
+! & /(DP**2)
+! & / PROPCE(IEL,IPCRO2)
+! & *( PROPCE(IEL,IPCTE1)
+! & -PROPCE(IEL,IPCTE2))/LV
+
+! IF ( PROPCE(IEL,IPCSEC) .LT. 0.D0 ) THEN
+! PROPCE(IEL,IPCSEC) = 0.D0
+! NPOIN65 = NPOIN65 + 1
+! endif
+
+! ENDIF
+
+ else
+ propce(iel,ipcsec) = 0.d0
+ endif
+
+ tmax = max(propce(iel,ipcsec),tmax)
+ tmin = min(propce(iel,ipcsec),tmin)
+
+
+
+ enddo
+
+ if ( irangp .ge. 0 ) then
+ call parmin(tmin)
+ call parmax(tmax)
+ call parmin(yvmin)
+ call parmax(yvmax)
+ call parcpt(npyv)
+ call parmax(yymax)
+ endif
+
+
+ if (modntl.eq.0) then
+ WRITE(NFECRA,*) ' POUR LA CLASSE = ',ICLA,NCEL
+ WRITE(NFECRA,*) ' NBRE DE PTS XWAT >0 =',NPOIN1
+ WRITE(NFECRA,*) ' T < TEBL =',NPOIN2
+ WRITE(NFECRA,*) ' YV >0 =',NPOIN3
+ WRITE(NFECRA,*) ' YV <0 =',NPOIN4
+ WRITE(NFECRA,*) ' T >= TEBL =',NPOIN5
+ WRITE(NFECRA,*) ' ANNUL G =', &
+ npoin63+npoin65
+ WRITE(NFECRA,*) ' ANNUL G T < TEBL=', &
+ npoin63
+ WRITE(NFECRA,*) ' ANNUL G T >= TEBL=', &
+ npoin65
+ WRITE(NFECRA,*) ' MIN MAX TS = ',TMIN,TMAX
+ WRITE(NFECRA,*) ' MIN MAX YV = ',YVMIN,YVMAX
+
+ WRITE(NFECRA,*) ' CLIPPING DE YV EN MAX ',NPYV,YYMAX
+ endif
+
+ enddo
+
+endif
+
+!===============================================================================
+! FORMATS
+!----
+
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpini1.f90 b/src/cplv/cpini1.f90
new file mode 100644
index 0000000..d5dad4d
--- /dev/null
+++ b/src/cplv/cpini1.f90
@@ -0,0 +1,686 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpini1
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES TRANSPORTEES
+! ET DES VARIABLES ALGEBRIQUES
+! COMBUSTION CHARBON PULVERISE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ihmpre.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer ipp , icla , ii , jj , iok
+integer icha , isc , is, iphas
+double precision wmolme
+
+!===============================================================================
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+ endif
+enddo
+do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ call csexit (1)
+ !==========
+ endif
+enddo
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! --> Definition des scamin et des scamax des variables transportees
+
+! ---- Variables propres a la suspension gaz - particules
+
+scamin(ihm) = -grand
+scamax(ihm) = +grand
+
+! ---- Variables propres a la phase dispersee
+
+do icla = 1, nclacp
+
+
+! SCAMIN(IH2(ICLA)) = EH0SOL(ICH(ICHCOR(ICLA)))
+! Prise en compte de l'humidite :
+! IF ( IPPMOD(ICP3PL) .EQ. 1 ) THEN
+! SCAMIN(IH2(ICLA)) = EH0SOL(IWAT(ICHCOR(ICLA)))
+! ENDIF
+
+ scamin(ih2(icla)) = -grand
+
+ scamax(ih2(icla)) = +grand
+ scamin(inp(icla)) = 0.d0
+ scamax(inp(icla)) = +rinfin
+ scamin(ixch(icla)) = 0.d0
+ scamax(ixch(icla)) = 1.d0
+ scamin(ixck(icla)) = 0.d0
+ scamax(ixck(icla)) = 1.d0
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ scamin(ixwt(icla)) = 0.d0
+ scamax(ixwt(icla)) = 1.d0
+ endif
+enddo
+do icha = 1, ncharb
+ scamin(if1m(icha)) = 0.d0
+ scamax(if1m(icha)) = 1.d0
+ scamin(if2m(icha)) = 0.d0
+ scamax(if2m(icha)) = 1.d0
+enddo
+
+! ---- Variables propres a la phase continue
+
+scamin(if3m) = 0.d0
+scamax(if3m) = 1.d0
+if ( ihtco2 .eq. 1 ) then
+ scamin(if3mc2) = 0.d0
+ scamax(if3mc2) = 1.d0
+endif
+scamin(if4p2m) = 0.d0
+scamax(if4p2m) = 0.25d0
+if ( ippmod(icp3pl) .eq. 1 ) then
+ scamin(if5m) = 0.d0
+ scamax(if5m) = 1.d0
+endif
+
+! Oxycombustion
+
+if ( noxyd .ge. 2 ) then
+ scamin(if6m) = 0.d0
+ scamax(if6m) = 1.d0
+endif
+if ( noxyd .eq. 3 ) then
+ scamin(if7m) = 0.d0
+ scamax(if7m) = 1.d0
+endif
+
+! Modele de CO
+
+if ( ieqco2 .ge. 1 ) then
+ scamin(iyco2) = 0.d0
+ scamax(iyco2) = 1.d0
+endif
+
+! --> Nature des scalaires transportes
+
+do isc = 1, nscapp
+
+! ---- Type de scalaire (0 passif, 1 temperature en K
+! -1 temperature en C
+! 2 enthalpie)
+! La distinction -1/1 sert pour le rayonnement
+ iscsth(iscapp(isc)) = 0
+
+enddo
+
+
+! ---- On resout en enthalpie avec un CP constant (Cf. cpvarp)
+
+iphas = iphsca(ihm)
+iscalt(iphas) = ihm
+iscsth(ihm) = 2
+
+! --> Donnees physiques ou numeriques propres aux scalaires CP
+
+do isc = 1, nscapp
+
+ jj = iscapp(isc)
+
+ if ( iscavr(jj).le.0 ) then
+
+! En combustion on considere que la viscosite turbulente domine
+! ON S'INTERDIT DONC LE CALCUL DES FLAMMES LAMINAIRES AVEC Le =/= 1
+
+ visls0(jj) = viscl0(iphsca(jj))
+
+ endif
+
+! ------ Schmidt ou Prandtl turbulent
+
+ sigmas(jj) = 0.7d0
+
+! ------ Coeff dissipation des fluctuations
+
+ rvarfl(jj) = 0.8d0
+
+ ii = isca(iscapp(isc))
+
+! ------ Niveau de detail des impressions pour les variables et
+! donc les scalaires (valeurs 0 ou 1)
+! Si = -10000 non modifie par l'utilisateur -> niveau 1
+ if(iwarni(ii).eq.-10000) then
+ iwarni(ii) = 1
+ endif
+
+! - Interface Code_Saturne:
+! ======================
+
+! NOMVAR, ICHRVR,ILISVR, IHISVR are
+! already filled in UINUM1 routine
+
+ if (iihmpr.ne.1) then
+
+! ------ Informations relatives a la resolution des scalaires
+
+! - Facteur multiplicatif du pas de temps
+ cdtvar(ii) = 1.d0
+
+! - Schema convectif % schema 2ieme ordre
+! = 0 : upwind
+! = 1 : second ordre
+ blencv(ii) = 0.d0
+
+! - Type de schema convetif second ordre (utile si BLENCV > 0)
+! = 0 : Second Order Linear Upwind
+! = 1 : Centre
+ ischcv(ii) = 1
+
+! - Test de pente pour basculer d'un schema centre vers l'upwind
+! = 0 : utlisation automatique du test de pente
+! = 1 : calcul sans test de pente
+ isstpc(ii) = 0
+
+! - Reconstruction des flux de convetion et de diffusion aux faces
+! = 0 : pas de reconstruction
+ ircflu(ii) = 0
+
+ endif
+
+enddo
+
+! - Interface Code_Saturne:
+! ======================
+
+! NOMVAR, ICHRVR,ILISVR, IHISVR are
+! already filled in CSENSO routine
+
+if (iihmpr.ne.1) then
+
+!---> Variable courante : nom, sortie chrono, suivi listing, sortie histo
+
+! Comme pour les autres variables,
+! si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! NOMVAR( ) = nom de la variable
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes
+
+! NB : Les 8 premiers caracteres du noms seront repris dans le
+! listing 'developpeur'
+
+
+! ---- Variables propres a la suspension gaz - particules
+
+ipp = ipprtp(isca(ihm))
+NOMVAR(IPP) = 'Enthalpy'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- Variables propres a la phase dispersee
+
+do icla = 1, nclacp
+ ipp = ipprtp(isca(ixck(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'XCK_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(ixch(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'XCH_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(inp(icla)))
+ WRITE(NOMVAR(IPP),'(A5,I2.2)')'NP_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(ih2(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'ENT_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ ipp = ipprtp(isca(ixwt(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'XWT_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+enddo
+do icha = 1, ncharb
+ ipp = ipprtp(isca(if1m(icha)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Fr_MV1' ,ICHA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(if2m(icha)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Fr_MV2' ,ICHA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+enddo
+
+! ---- Variables propres a la phase continue
+
+ipp = ipprtp(isca(if3m))
+NOMVAR(IPP) = 'Fr_HET_O2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+if ( ihtco2 .eq. 1 ) then
+ ipp = ipprtp(isca(if3mc2))
+ NOMVAR(IPP) = 'Fr_HET_CO2'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+ipp = ipprtp(isca(if4p2m))
+NOMVAR(IPP) = 'Var_AIR'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+if ( ippmod(icp3pl) .eq. 1 ) then
+ ipp = ipprtp(isca(if5m))
+ NOMVAR(IPP) = 'FR_H2O'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+if ( noxyd .ge. 2 ) then
+ ipp = ipprtp(isca(if6m))
+ NOMVAR(IPP) = 'FR_OXYD2'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+if ( noxyd .eq. 3 ) then
+ ipp = ipprtp(isca(if7m))
+ NOMVAR(IPP) = 'FR_OXYD3'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+if ( ieqco2 .ge. 1 ) then
+ ipp = ipprtp(isca(iyco2))
+ NOMVAR(IPP) = 'FR_CO2'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+
+! ---> Variables algebriques propres a la suspension gaz - particules
+
+ipp = ipppro(ipproc(immel))
+NOMVAR(IPP) = 'XM'
+ichrvr(ipp) = 0
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+! ---> Variables algebriques propres a la phase dispersee
+
+do icla = 1, nclacp
+ ipp = ipppro(ipproc(itemp2(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Tem_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(irom2(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Rho_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(idiam2(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Dia_CK' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(igmdch(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_DCH' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(igmdv1(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_DV1' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(igmdv2(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_DV2' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(igmhet(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_HET_O2' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ if ( ihtco2 .eq. 1 ) then
+ ipp = ipppro(ipproc(ighco2(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_HET_CO2' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ endif
+
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ ipp = ipppro(ipproc(igmsec(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_SEC' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ endif
+
+ ipp = ipppro(ipproc(ix2(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Frm_CP' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+enddo
+
+! ---> Variables algebriques propres a la phase continue
+
+ipp = ipppro(ipproc(itemp1))
+NOMVAR(IPP) = 'Temp_GAZ'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(irom1))
+NOMVAR(IPP) = 'ROM_GAZ'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(1)))
+NOMVAR(IPP) = 'YM_CHx1m'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(2)))
+NOMVAR(IPP) = 'YM_CHx2m'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(3)))
+NOMVAR(IPP) = 'YM_CO'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(4)))
+NOMVAR(IPP) = 'YM_O2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(5)))
+NOMVAR(IPP) = 'YM_CO2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(6)))
+NOMVAR(IPP) = 'YM_H2O'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(7)))
+NOMVAR(IPP) = 'YM_N2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+endif
+
+
+
+!===============================================================================
+! 3. INFORMATIONS COMPLEMENTAIRES
+!===============================================================================
+
+! ---> Definition des pointeurs du tableau TBMCR utilise dans cpphy1.F
+! et dans les sous-programmes appeles
+
+is = 0
+do icha = 1, ncharb
+ is = is + 1
+ if1mc(icha) = is
+ is = is + 1
+ if2mc(icha) = is
+enddo
+is = is + 1
+ix1mc = is
+is = is + 1
+ix2mc = is
+is = is + 1
+ichx1f1 = is
+is = is + 1
+ichx2f2 = is
+is = is + 1
+icof1 = is
+is = is + 1
+icof2 = is
+is = is + 1
+ih2of1 = is
+is = is + 1
+ih2of2 = is
+
+
+! ---> Initialisation
+
+! ---- Calcul de RO0 a partir de T0 et P0
+! (loi des gaz parfaits applliquee a l'air)
+
+! On initialise RO0 avec l'oxydant 1 qui est sense etre
+! l'oxydant majoritaire
+
+wmolme = ( wmole(io2) *oxyo2(1) +wmole(in2) *oxyn2(1) &
+ +wmole(ih2o)*oxyh2o(1)+wmole(ico2)*oxyco2(1)) &
+ /(oxyo2(1)+oxyn2(1)+oxyh2o(1)+oxyco2(1))
+
+ro0(iphas) = p0(iphas)*wmolme / (rr*t0(iphas))
+
+! ---- Initialisation pour la masse volumique du coke
+
+do icha = 1, ncharb
+ rhock(icha) = rho0ch(icha)
+enddo
+
+! On met SRROM et DIFTL0 a -GRAND pour forcer l'utilisateur a les
+! definir dans uscpi1
+! ---> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+srrom = -grand
+
+! ---> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+! C'est cette valeur par defaut qui est TOUJOURS utilisee dans les
+! calculs charbon (un peu etonnant de ne pas prendre en
+! compte les variations de ce parametre physique si on
+! recherche des informations sur les flux thermiques aux parois)
+
+diftl0 =-grand
+
+! ---> Masse volumique variable et viscosite constante (pour les suites)
+irovar(iphas) = 1
+ivivar(iphas) = 0
+
+!===============================================================================
+! 4. ON REDONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+! - Interface Code_Saturne
+! ======================
+
+if(iihmpr.eq.1) then
+
+ call uicpi1(srrom)
+ !==========
+
+ diftl0 = 4.25d-5
+
+endif
+
+call uscpi1
+!==========
+
+!===============================================================================
+! 5. VERIFICATION DES DONNERS FOURNIES PAR L'UTLISATEUR
+!===============================================================================
+
+iok = 0
+call cpveri (iok)
+!==========
+
+if(iok.gt.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+ !==========
+else
+ write(nfecra,9998)
+endif
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P.) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P.) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (uscpi1).',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier uscpi1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/cplv/cpiniv.f90 b/src/cplv/cpiniv.f90
new file mode 100644
index 0000000..3bc0dc6
--- /dev/null
+++ b/src/cplv/cpiniv.f90
@@ -0,0 +1,431 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpiniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION CP
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ige, mode, icla, icha, iphas
+
+double precision t1init, h1init, coefe(ngazem)
+double precision t2init, h2init
+double precision f1mc(ncharm), f2mc(ncharm)
+double precision xkent, xeent, d2s3
+
+integer imode , isol , ioxy
+double precision wmh2o,wmco2,wmn2,wmo2,dmas
+
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+! RQ IMPORTANTE : pour la combustion CP, 1 seul passage suffit
+
+if ( isuite.eq.0 .and. ipass.eq.1 ) then
+
+ iphas = 1
+
+! --> Initialisation de k et epsilon
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+ do iel = 1, ncel
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+ enddo
+
+ endif
+
+! --> On initialise tout le domaine de calcul avec de l'air a TINITK
+! ================================================
+
+! ---- Calculs de H1INIT et H2INIT
+
+ t1init = t0(iphas)
+ t2init = t0(iphas)
+
+! ------ Variables de transport relatives a la phase solide :
+! calcul de H
+
+ do icla = 1, nclacp
+ icha = ichcor(icla)
+
+ do iel = 1, ncel
+
+ rtp(iel,isca(ixch(icla))) = zero
+ rtp(iel,isca(ixck(icla))) = zero
+ rtp(iel,isca(inp(icla) )) = zero
+ rtp(iel,isca(ih2(icla) )) = zero
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ rtp(iel,isca(ixwt(icla))) = zero
+ endif
+
+ enddo
+ enddo
+
+! ------ Variables de transport relatives au melange
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+
+! On considere l'oxydant 1
+
+ coefe(io2) = wmole(io2)*oxyo2(1) &
+ /( wmole(io2) *oxyo2(1) +wmole(in2) *oxyn2(1) &
+ +wmole(ih2o)*oxyh2o(1)+wmole(ico2)*oxyco2(1))
+ coefe(ih2o) = wmole(ih2o)*oxyh2o(1) &
+ /( wmole(io2) *oxyo2(1) +wmole(in2) *oxyn2(1) &
+ +wmole(ih2o)*oxyh2o(1)+wmole(ico2)*oxyco2(1))
+ coefe(ico2) = wmole(ico2)*oxyco2(1) &
+ /( wmole(io2) *oxyo2(1) +wmole(in2) *oxyn2(1) &
+ +wmole(ih2o)*oxyh2o(1)+wmole(ico2)*oxyco2(1))
+ coefe(in2) = 1.d0-coefe(io2)-coefe(ih2o)-coefe(ico2)
+
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , h1init , coefe , f1mc , f2mc , &
+ t1init )
+
+ do iel = 1, ncel
+ rtp(iel,isca(ihm)) = h1init
+ enddo
+
+! ------ Variables de transport relatives au melange gazeux
+! (scalaires passifs et variances associees)
+
+ do icha = 1, ncharb
+ do iel = 1, ncel
+ rtp(iel,isca(if1m(icha))) = zero
+ rtp(iel,isca(if2m(icha))) = zero
+ enddo
+ enddo
+ do iel = 1, ncel
+ rtp(iel,isca(if3m)) = zero
+
+ if ( ihtco2 .eq. 1 ) then
+ rtp(iel,isca(if3mc2)) = zero
+ endif
+
+ rtp(iel,isca(if4p2m)) = zero
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ rtp(iel,isca(if5m)) = zero
+ endif
+
+ if ( noxyd .ge. 2 ) then
+ rtp(iel,isca(if6m)) = zero
+ endif
+ if ( noxyd .eq. 3 ) then
+ rtp(iel,isca(if7m)) = zero
+ endif
+
+ if ( ieqco2.ge.1 ) then
+
+ ioxy = 1
+ wmo2 = wmole(io2)
+ wmco2 = wmole(ico2)
+ wmh2o = wmole(ih2o)
+ wmn2 = wmole(in2)
+
+ dmas = ( oxyo2 (ioxy)*wmo2 +oxyn2 (ioxy)*wmn2 &
+ +oxyh2o(ioxy)*wmh2o+oxyco2(ioxy)*wmco2 )
+ xco2 = oxyco2(ioxy)*wmco2/dmas
+
+ rtp(iel,isca(iyco2)) = oxyco2(ioxy)*wmco2/dmas
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 2. ON DONNE LA MAIN A L'UTILISATEUR
+!===============================================================================
+
+if (ipass.eq.1) then
+ call uscpiv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cplecd.f90 b/src/cplv/cplecd.f90
new file mode 100644
index 0000000..9269c8c
--- /dev/null
+++ b/src/cplv/cplecd.f90
@@ -0,0 +1,1523 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cplecd
+!================
+!===============================================================================
+! FONCTION :
+! ---------
+
+! LECTURE DU FICHIER DE DONNEES PHYSIQUE PARTICULIERE
+! RELATIF A LA COMBUSTION CHARBON PULVERISE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+! VARIABLES LOCALES
+
+character *150 chain1,chain2
+character *12 nomcoe(ngazem)
+
+integer it , ice , iat , ios , ii , ioxy
+integer ncoel , inicoe , inicha , ierror
+integer idecal , icla , iclapc , icha , is
+integer idebch , ifinch , lonch , ichai , ichcoe
+integer atcoel(ngazem,natom)
+
+double precision fcor , pcisec , pcipur , xashpc
+double precision hco20 , ho20 , hh2o0
+double precision den1 , den2
+double precision tmin , tmax
+double precision ipci(ncharm)
+double precision wmolce(ngazem), ehcoel(ngazem,npot)
+double precision cpcoel(ngazem,npot),det,matdet
+double precision wmv1,wmvch1,wmv2,wmvch2
+double precision a11,a12,a13,a21,a22,a23,a31,a32,a33
+double precision dhvol1,dhvol2,hcoke,hchar,ehvol1,ehvol2
+double precision wmco,wmo2,wmco2,wmh2o,wmn2,wmc
+double precision dmf4,dmf6,dmf7
+
+
+!===============================================================================
+
+!==================================================
+! 1. LECTURE DU FICHIER DONNEES SPECIFIQUES
+!==================================================
+
+! --> Ouverture du fichier
+
+open ( unit=impfpp, file=ficfpp, &
+ STATUS='OLD', FORM='FORMATTED', ACCESS='SEQUENTIAL', &
+ iostat=ios, err=99 )
+rewind (unit=impfpp,err=99 )
+
+! --> Lecture thermochimie
+
+read (impfpp,*,err=999,end=999 )
+
+! ---- Nb de constituants elementaires (gazeux et solide)
+
+read ( impfpp,*,err=999,end=999 ) ncoel
+if ( ncoel.gt.ngazem ) then
+ write(nfecra,9991) ngazem,ncoel
+ call csexit (1)
+endif
+
+! ---- Nb de points de tabulation ENTH-TEMP
+
+read ( impfpp,*,err=999,end=999 ) npo
+if ( npo.gt.npot ) then
+ write(nfecra,9992) npot,npo
+ call csexit (1)
+endif
+
+! --- Lecture des noms des constituants elementaires
+
+do ice=1,ncoel
+ do inicoe=1,len(nomcoe(ice))
+ NOMCOE(ICE)(INICOE:INICOE)=' '
+ enddo
+enddo
+
+do inicha=1,len(chain1)
+ CHAIN1(INICHA:INICHA)=' '
+enddo
+
+do inicha=1,len(chain2)
+ CHAIN2(INICHA:INICHA)=' '
+enddo
+
+read (impfpp,*,err=999,end=999 )
+read (impfpp,1010,err=999,end=999 ) chain1
+call verlon (chain1, idebch, ifinch, lonch)
+chain2(1:lonch)=chain1(idebch:ifinch)
+
+ice=1
+ichcoe=0
+do ichai=1,lonch
+ IF (CHAIN2(ICHAI:ICHAI).NE.' ') THEN
+ ichcoe=ichcoe+1
+ nomcoe(ice)(ichcoe:ichcoe) =chain2(ichai:ichai)
+ else
+ if (ichcoe.ne.0) then
+ ice=ice+1
+ ichcoe=0
+ endif
+ endif
+enddo
+
+ 1010 format(a150)
+
+! --- Temperature Min et Max
+
+read (impfpp,*,err=999,end=999) tmin
+read (impfpp,*,err=999,end=999) tmax
+
+
+! ---- Nb especes atomiques (C, H, O, N, ...)
+
+read (impfpp,*,err=999,end=999 ) nato
+if ( nato.gt.natom ) then
+ write(nfecra,9993) natom,nato
+ call csexit (1)
+ !==========
+endif
+
+! ---- Masse molaire especes atomiques
+! Composition des constituants elementaires en fonction
+! des especes elementaires
+
+do iat = 1, nato
+ read (impfpp,*,err=999,end=999 ) wmolat(iat), &
+ ( atcoel(ice,iat),ice=1,ncoel )
+enddo
+
+! ---- Calcul des masses molaires des constituants elementaires
+
+do ice = 1, ncoel
+ wmolce(ice) = 0.d0
+ do iat = 1, nato
+ wmolce(ice)= wmolce(ice) + atcoel(ice,iat)*wmolat(iat)
+ enddo
+enddo
+
+
+! --> Lecture rayonnement
+
+read (impfpp,*,err=999,end=999 )
+
+! ---- Coefficient d'absorption du melange gazeux
+
+read (impfpp,*,err=999,end=999 ) ckabs1
+
+
+! --> Lecture caracteristiques charbon
+
+read (impfpp,*,err=999,end=999 )
+
+! ---- Nb de charbons
+
+read ( impfpp,*,err=999,end=999 ) ncharb
+if ( ncharb.gt.ncharm ) then
+ write(nfecra,9995) ncharm,ncharb
+ call csexit (1)
+endif
+
+! ---- Nb de classes par charbon
+
+read (impfpp,*,err=999,end=999 ) &
+ ( nclpch(icha),icha=1,ncharb )
+do icha = 1, ncharb
+ if ( nclpch(icha).gt.nclcpm ) then
+ write(nfecra,9996) nclcpm,nclpch(icha),icha
+ call csexit (1)
+ endif
+enddo
+
+! ---- Calcul du nb de classes et remplissage de ICHCOR
+
+nclacp = 0
+do icha = 1, ncharb
+ nclacp = nclacp + nclpch(icha)
+enddo
+idecal = 0
+do icha = 1, ncharb
+ do iclapc = 1, nclpch(icha)
+ icla = iclapc+idecal
+ ichcor(icla) = icha
+ enddo
+ idecal = nclpch(icha)
+enddo
+
+! ---- Diametre initial par classe (m)
+
+read (impfpp,*,err=999,end=999 ) &
+ ( diam20(icla),icla=1,nclacp )
+
+! ---- Composition elementaire en C, H, O sur sec (% en masse)
+
+read (impfpp,*,err=999,end=999 ) &
+ ( cch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( hch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( och(icha),icha=1,ncharb )
+
+! ---- PCI sur charbon sec ou pur suivant la valeur de IPCI
+
+read (impfpp,*,err=999,end=999 ) &
+ ( ipci(icha),pcich(icha),icha=1,ncharb )
+
+! ---- CP moyen du charbon sec (J/kg/K)
+
+read (impfpp,*,err=999,end=999 ) &
+ ( cp2ch(icha),icha=1,ncharb )
+
+! ---- Masse volumique initiale (kg/m3)
+
+read (impfpp,*,err=999,end=999 ) &
+ ( rho0ch(icha),icha=1,ncharb )
+
+! ---- Caracteristiques coke
+
+read (impfpp,*,err=999,end=999 )
+
+! ------- Composition elementaire en C, H, O sur sec (%)
+
+read (impfpp,*,err=999,end=999 ) &
+ ( cck(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( hck(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( ock(icha),icha=1,ncharb )
+
+! ------ PCI sur charbon sec
+
+read (impfpp,*,err=999,end=999 ) &
+ ( pcick(icha),icha=1,ncharb )
+
+! ---- Caracteristiques cendres
+
+read (impfpp,*,err=999,end=999 )
+
+! ------ Taux de cendre (kg/kg) en %
+
+read (impfpp,*,err=999,end=999 ) &
+ ( xashch(icha),icha=1,ncharb )
+! Transformation en kg/kg
+do icha = 1, ncharb
+ xashch(icha) = xashch(icha)/100.d0
+enddo
+
+! ------ Enthalpie de formation des cendres (J/kg)
+
+read (impfpp,*,err=999,end=999 ) &
+ ( h0ashc(icha),icha=1,ncharb )
+
+! ------ CP des cendres (J/kg/K)
+
+read (impfpp,*,err=999,end=999 ) &
+ ( cpashc(icha),icha=1,ncharb )
+
+! ------ Taux d'humidite (kg/kg) en %
+
+read (impfpp,*,err=999,end=999 ) &
+ ( xwatch(icha),icha=1,ncharb )
+
+! Transformation en kg/kg
+do icha = 1, ncharb
+ xwatch(icha) = xwatch(icha)/100.d0
+enddo
+
+! Transformation du taux de cendre de sec
+! sur humide en kg/kg
+
+do icha = 1, ncharb
+ xashch(icha) = xashch(icha)*(1.d0-xwatch(icha))
+enddo
+
+! ---- Parametres de devolatilisation (modele de Kobayashi)
+
+read (impfpp,*,err=999,end=999 )
+
+read (impfpp,*,err=999,end=999 ) &
+ ( iy1ch(icha),y1ch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( iy2ch(icha),y2ch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( a1ch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( a2ch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( e1ch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( e2ch(icha),icha=1,ncharb )
+
+! ---- Parametres combustion heterogene pour O2(modele a sphere retrecissante)
+
+read (impfpp,*,err=999,end=999 )
+
+read (impfpp,*,err=999,end=999 ) &
+ ( ahetch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( ehetch(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( iochet(icha),icha=1,ncharb)
+
+! ---- Parametres combustion heterogene pour CO2(modele a sphere retrecissante)
+
+read (impfpp,*,err=999,end=999 )
+
+read (impfpp,*,err=999,end=999 ) &
+ ( ahetc2(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( ehetc2(icha),icha=1,ncharb )
+read (impfpp,*,err=999,end=999 ) &
+ ( ioetc2(icha),icha=1,ncharb)
+
+! --> Lecture caracteristiques Oxydants
+
+read (impfpp,*,err=999,end=999 )
+
+! ---- Nb d'oxydants
+
+read ( impfpp,*,err=999,end=999 ) noxyd
+if ( noxyd.lt.1 .or. noxyd .gt. 3 ) then
+ write(nfecra,9895) noxyd
+ call csexit (1)
+endif
+
+! ---- Composition en O2,N2,H2O,N2
+
+do ioxy=1,3
+ oxyo2 (ioxy) = 0.d0
+ oxyn2 (ioxy) = 0.d0
+ oxyh2o(ioxy) = 0.d0
+ oxyco2(ioxy) = 0.d0
+enddo
+
+read (impfpp,*,err=999,end=999 ) &
+ ( oxyo2(ioxy),ioxy=1,noxyd )
+read (impfpp,*,err=999,end=999 ) &
+ ( oxyn2(ioxy),ioxy=1,noxyd )
+read (impfpp,*,err=999,end=999 ) &
+ ( oxyh2o(ioxy),ioxy=1,noxyd )
+read (impfpp,*,err=999,end=999 ) &
+ ( oxyco2(ioxy),ioxy=1,noxyd )
+
+! --> Fermeture du fichier (ne pas oublier, car l'unite sert pour janaf)
+
+close(impfpp)
+
+
+!==============================================
+! 2. CALCULS DE DONNEES COMPLEMENTAIRES
+!==============================================
+
+
+! --> Discretisation de la temperature
+
+do it = 1, npo
+ th(it) = dble(it-1)*(tmax-tmin)/dble(npo-1) + tmin
+enddo
+
+! --> Calcul des enthalpies pour les differentes especes courantes
+
+call pptbht &
+!==========
+ ( ncoel , &
+ nomcoe , ehcoel , cpcoel , wmolce )
+
+! --> Calcul tabulation enthalpie - temperature pour le melange gazeux
+
+! ---- Nb de constituants gazeux
+! ATTENTION ON COMPTE EGALEMENT CH4 et le monomere CH2
+
+ngaze = 2 + 5 + 2*ncharb
+
+! ---- Definition des pointeurs pour les tableaux WMOLE et EHGAZE
+! REMARQUE : Cette position de pointeurs va egalement servir
+! pour le tableau de pointeurs IYM1 relatif aux
+! tableaux PROPCE et PROPFB
+! ON BALAYE JUSTE DE 1 A (NGAZE-2*NCHARB)
+
+is = 0
+is = is + 1
+ichx1 = is
+is = is + 1
+ichx2 = is
+is = is + 1
+ico = is
+is = is + 1
+io2 = is
+is = is + 1
+ico2 = is
+is = is + 1
+ih2o = is
+is = is + 1
+in2 = is
+do icha = 1, ncharb
+ ichx1c(icha) = is + icha
+ ichx2c(icha) = is + icha + ncharb
+enddo
+
+! ---- Remplissage de EHGAZE et WMOLE
+! a partir de EHCOEL et WMOLCE
+
+! ------ ATTENTION :
+! On prend par defaut
+! du CH4 pour CHX1m
+! et le monomere CH2 (jouant le role du C2H4) pour CHX2m
+
+do it = 1, npo
+ ehgaze(ichx1,it) = ehcoel(1,it)
+ ehgaze(ichx2,it) = ehcoel(2,it)
+ ehgaze(ico ,it) = ehcoel(3,it)
+ ehgaze(io2 ,it) = ehcoel(4,it)
+ ehgaze(ico2 ,it) = ehcoel(5,it)
+ ehgaze(ih2o ,it) = ehcoel(6,it)
+ ehgaze(in2 ,it) = ehcoel(7,it)
+enddo
+wmole(ichx1) = wmolce(1)
+! ------ ATTENTION : Il faut prendre la masse molaire du monomere CH2
+! et non celle du C2H4
+wmole(ichx2) = wmolat(iatc)+wmolat(iath)*2.d0
+wmole(ico ) = wmolce(3)
+wmole(io2 ) = wmolce(4)
+wmole(ico2 ) = wmolce(5)
+wmole(ih2o ) = wmolce(6)
+wmole(in2 ) = wmolce(7)
+
+
+! --> Calcul tabulation enthalpie - temperature pour le solide
+! Charbon reactif, Coke et Cendres
+
+! ---- Nb de constituants solide
+
+nsolid = 4*ncharb
+
+! ---- Definition des pointeurs ICH, ICK et IASH
+
+is = 0
+do icha = 1, ncharb
+ is = is + 1
+ ich(icha) = is
+ is = is + 1
+ ick(icha) = is
+ is = is + 1
+ iash(icha) = is
+
+ is = is + 1
+ iwat(icha) = is
+
+enddo
+
+! ---- Calcul relatif au charbon reactif
+
+alpham = zero
+betam = zero
+
+do icha = 1, ncharb
+
+! ------ Composition du charbon reactif
+! sous la forme CH(ALPHA)O(BETA)
+! et calcul de la masse molaire
+
+ alpha(icha) = (hch(icha)/wmolat(iath)) &
+ / (cch(icha)/wmolat(iatc))
+ beta(icha) = (och(icha)/wmolat(iato)) &
+ / (cch(icha)/wmolat(iatc))
+ alpham = alpham + alpha(icha)
+ betam = betam + beta(icha)
+ wmols(ich(icha)) = wmolat(iatc) + alpha(icha)*wmolat(iath) &
+ + beta(icha)*wmolat(iato)
+enddo
+alpham = alpham / dble(ncharb)
+betam = betam / dble(ncharb)
+
+! ------ Transformation par la formule de Schaff du
+! PCI sur sec en PCI sur pur LORSQUE IPCI = 1
+
+fcor = 1.2
+do icha = 1, ncharb
+
+ if (ipci(icha).eq.1) then
+! On donne directement le PCI sur sec J/kg ---> kcal/kg
+ pcisec = pcich(icha)/1000.d0/xcal2j
+ xashpc = xashch(icha)*100.d0
+ pcipur = ( pcisec+5.95d0*(zero+(1.d0-fcor)*xashpc) )*100.d0 &
+ / ( 100.d0-zero-fcor*xashpc )
+! Conversion de PCI sur pur de kcal/kg ----> J/kg
+ pcipur = pcipur*1000.d0*xcal2j
+! On ecrase PCICH sur sec par PCIPUR
+ pcich(icha) = pcipur
+ endif
+
+enddo
+
+! ------ Calcul de : H02 pour CH , CK , ASH et WT
+
+do icha = 1, ncharb
+ hco20 = ehgaze(ico2,1)*wmole(ico2)
+ hh2o0 = ehgaze(ih2o,1)*wmole(ih2o)
+ ho20 = ehgaze(io2 ,1)*wmole(io2 )
+
+ h02ch(icha) = pcich(icha) + &
+ ( hco20 + alpha(icha)/2.d0*hh2o0 - &
+ (1.d0+alpha(icha)/4.d0-beta(icha)/2.d0)*ho20 ) &
+ / wmols(ich(icha))
+
+ eh0sol(ich(icha)) = h02ch(icha)
+
+enddo
+
+! Pour l'instant H02CK et H02ASH sont nulles
+
+do icha = 1, ncharb
+
+ eh0sol(ick (icha)) = 0.d0
+ eh0sol(iash(icha)) = 0.d0
+
+enddo
+
+! Calcul de H02 pour l'eau liquide : d'apres JANAF
+! H0 = -15871802.2
+! CP = 4181.35
+
+do icha = 1, ncharb
+ eh0sol(iwat(icha)) = -15871802.2d0
+enddo
+
+! Construction table enthalpie/temperature Charbon
+! ---> Pour l'instant meme table que le Gaz
+
+! Nombre de tabulation : NPOC
+
+npoc = npo
+
+do ii = 1, npoc
+ thc(ii) = th(ii)
+enddo
+
+
+! ------ Calcul de EHSOLI pour le charbon reactif
+! Si CP2CH > 0 : HCH = H02CH + CP2CH(T2-TREFTH)
+! Sinon : On considere le PCI constant qqs T2
+
+do icha = 1, ncharb
+ if ( cp2ch(icha).gt.epsicp ) then
+ do it = 1, npoc
+ ehsoli(ich(icha),it) = eh0sol(ich(icha)) &
+ + cp2ch(icha)*(thc(it)-trefth)
+ enddo
+ else
+ do it = 1, npoc
+ hco20 = ehgaze(ico2,it)*wmole(ico2)
+ hh2o0 = ehgaze(ih2o,it)*wmole(ih2o)
+ ho20 = ehgaze(io2,it) *wmole(io2)
+ ehsoli(ich(icha),it) = pcich(icha) + &
+ ( hco20 + alpha(icha)/2.d0*hh2o0 - &
+ (1.d0+alpha(icha)/4.d0-beta(icha)/2.d0)*ho20 ) &
+ / wmols(ich(icha))
+ enddo
+ endif
+enddo
+
+! ---- Calcul relatif au coke
+
+! ------ Par defaut Coke = Carbone solide
+! GAMMA = 0 et DELTA = 0
+! Si CP2CH > 0 : HCK = H02CH + CP2CH(T2-TREFTH)
+! Sinon : HCK = Enthalpie du carbone pur
+
+gamma(icha) = zero
+delta(icha) = zero
+do icha = 1, ncharb
+ wmols(ick(icha)) = wmolce(8)
+ if (cp2ch(icha).gt.epsicp) then
+ do it = 1, npoc
+ ehsoli(ick(icha),it) = eh0sol(ick(icha)) &
+ + cp2ch(icha)*(thc(it)-trefth)
+ enddo
+ else
+ do it = 1, npoc
+ ehsoli(ick(icha),it) = ehcoel(8,it)
+ enddo
+ endif
+enddo
+
+! ------ Coke = CH(GAMMA)O(DELTA)
+
+do icha = 1, ncharb
+ if ( pcick(icha).gt.epsicp ) then
+ gamma(icha) = hck(icha)/cck(icha)
+ delta(icha) = ock(icha)/cck(icha)
+ wmols(ick(icha)) = wmolat(iatc)+gamma(icha)*wmolat(iath) &
+ + delta(icha)*wmolat(iato)
+! On considere le PCI constant qqs T
+ do it = 1, npoc
+ hco20 = ehgaze(ico2,it)*wmole(ico2)
+ hh2o0 = ehgaze(ih2o,it)*wmole(ih2o)
+ ho20 = ehgaze(io2,it) *wmole(io2)
+ ehsoli(ick(icha),it) = pcick(icha) + &
+ ( hco20 + gamma(icha)/2.d0*hh2o0 - &
+ (1.d0+gamma(icha)/4.d0-delta(icha)/2.d0)*ho20 ) &
+ / wmols(ich(icha))
+ enddo
+ endif
+enddo
+
+! ---- Calcul relatif aux cendres
+
+do icha = 1, ncharb
+ if (cp2ch(icha).gt.epsicp) then
+ do it = 1, npoc
+ ehsoli(iash(icha),it) = eh0sol(iash(icha)) &
+ + cp2ch(icha)*(thc(it)-trefth)
+ enddo
+ else
+ do it = 1, npoc
+ ehsoli(iash(icha),it) = h0ashc(icha) &
+ + cpashc(icha)*(thc(it)-trefth)
+ enddo
+ endif
+ wmols(iash(icha)) = zero
+enddo
+
+! ---- Calcul relatif a l'eau
+
+do icha = 1, ncharb
+ cp2wat(icha) = 4181.35d0
+
+ do it = 1, npoc
+ ehsoli(iwat(icha),it) = eh0sol(iwat(icha)) &
+ +cp2wat(icha)*(thc(it)-trefth)
+ enddo
+enddo
+
+! --> Calcul relatifs aux matieres volatiles
+
+! On test que l'on utilise la meme option pour Y1 et Y2
+! pour chaque charbon
+
+do icha = 1, ncharb
+ if ( iy1ch(icha).ne. iy2ch(icha) ) then
+
+ write(nfecra,9980) icha,iy1ch(icha),iy2ch(icha)
+ call csexit(1)
+
+ endif
+ if ( iy1ch(icha).lt. 0 .or. iy1ch(icha).le.0 .or. &
+ iy2ch(icha).lt. 0 .or. iy2ch(icha).le.0 ) then
+ write(nfecra,9981) icha,iy1ch(icha),iy1ch(icha)
+ call csexit(1)
+ endif
+enddo
+
+! ---- Matieres volatiles legeres : [CH(CHX1); CO]
+! CH(ALPHA)O(BETA) --> A1 CH(CHX1) + B1 CO
+! + (1-A1-B1) CH(GAMMA)O(DELTA)
+! Si IY1CH = 0 CHX1 fixe , Y1CH calcule
+! Si IY1CH = 1 Y1CH fixe , CHX1 calcule
+! Si IY1CH = 2 Y1CH fixe, CHX1 fixe, on ajoute de l'eau
+! CH(ALPHA)O(BETA) --> A1 CH(CHX1) + B1 CO + C1 H2O
+! + (1-A1-B1) CH(GAMMA)O(DELTA)
+
+do icha = 1, ncharb
+ if ( iy1ch(icha).eq.0 ) then
+ chx1(icha) = 4.d0
+ den1 = ( (1.d0-delta(icha))*chx1(icha)-gamma(icha) ) &
+ * wmols(ich(icha))
+ y1ch(icha) = ( ( gamma(icha)*(beta(icha)-1.d0) + &
+ alpha(icha)*(1.d0-delta(icha)) ) &
+ *(wmolat(iatc)+chx1(icha)*wmolat(iath)) &
+ + ( beta(icha)*(chx1(icha)-gamma(icha)) + &
+ delta(icha)*(alpha(icha)-chx1(icha)) ) &
+ *wmole(ico) ) &
+ / den1
+ elseif(iy1ch(icha) .eq. 1) then
+ den1 = y1ch(icha)*(1.d0-delta(icha))*wmols(ich(icha)) &
+ - wmolat(iath)*(gamma(icha)*(beta(icha)-1.d0) + &
+ alpha(icha)*(1.d0-delta(icha))) &
+ + wmole(ico)*(delta(icha)-beta(icha))
+ chx1(icha) = ( wmolat(iatc)*(alpha(icha)-gamma(icha)) &
+ + wmolat(iato)*(delta(icha)*alpha(icha)- &
+ beta(icha) *gamma(icha) ) &
+ + y1ch(icha)*gamma(icha)*wmols(ich(icha)) ) &
+ / den1
+ elseif(iy1ch(icha) .eq. 2) then
+ chx1(icha) = 4.d0
+ endif
+
+ if ( iy1ch(icha).lt.2) then
+ den1 = (1.d0-delta(icha))*chx1(icha)-gamma(icha)
+ a1(icha) = ( gamma(icha)*(beta(icha)-1.d0) + &
+ alpha(icha)*(1.d0-delta(icha)) ) / den1
+ b1(icha) = ( beta(icha)*(chx1(icha)-gamma(icha)) + &
+ delta(icha)*(alpha(icha)-chx1(icha)) ) / den1
+ c1(icha) = zero
+ else
+ wmv1 = y1ch(icha)*( wmolat(iatc) &
+ +alpha(icha)*wmolat(iath) &
+ +beta(icha)*wmolat(iato) )
+ wmvch1 = wmolat(iatc) + chx1(icha)*wmolat(iath)
+
+ a11 = 4.d0-gamma(icha)
+ a12 = -gamma(icha)
+ a13 = 2.d0
+ a21 = -delta(icha)
+ a22 = 1.d0-delta(icha)
+ a23 = 1.d0
+ a31 = wmvch1
+ a32 = wmole(ico)
+ a33 = wmole(ih2o)
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+
+ den1 = 1.d0 / det
+
+ a11 = (alpha(icha)-gamma(icha))
+ a12 = -gamma(icha)
+ a13 = 2.d0
+ a21 = (beta(icha)-delta(icha) )
+ a22 = (1.d0-delta(icha))
+ a23 = 1.d0
+ a31 = wmv1
+ a32 = wmole(ico)
+ a33 = wmole(ih2o)
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+ a1(icha) = den1 * det
+
+ a11 = 4.d0-gamma(icha)
+ a12 = alpha(icha)-gamma(icha)
+ a13 = 2.d0
+ a21 = -delta(icha)
+ a22 = beta(icha)-delta(icha)
+ a23 = 1.d0
+ a31 = wmvch1
+ a32 = wmv1
+ a33 = wmole(ih2o)
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+ b1(icha) = den1 * det
+
+ a11 = 4.d0-gamma(icha)
+ a12 = -gamma(icha)
+ a13 = alpha(icha)-gamma(icha)
+ a21 = -delta(icha)
+ a22 = 1.d0-delta(icha)
+ a23 = beta(icha)-delta(icha)
+ a31 = wmvch1
+ a32 = wmole(ico)
+ a33 = wmv1
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+ c1(icha) = den1 * det
+ endif
+ enddo
+
+! ---- Matieres volatiles lourdes : [CH(CHX2); CO]
+! CH(ALPHA)O(BETA) --> A2 CH(CHX2) + B2 CO
+! + (1-A2-B2) CH(GAMMA)O(DELTA)
+! Si IY2CH = 0 CHX2 fixe, Y2CH calcule
+! Si IY2CH = 1 Y2CH fixe, CHX2 calcule
+! Si IY2CH = 2 Y2CH fixe, CHX2 fixe, on ajoute de l'eau
+! CH(ALPHA)O(BETA) --> A2 CH(CHX2) + B2 CO + C2 H2O
+! + (1-A2-B2) CH(GAMMA)O(DELTA)
+
+do icha = 1, ncharb
+ if ( iy2ch(icha).eq.0 ) then
+ chx2(icha) = 2.d0
+ den2 = ( (1.d0-delta(icha))*chx2(icha)-gamma(icha) ) &
+ * wmols(ich(icha))
+ y2ch(icha) = ( ( gamma(icha)*(beta(icha)-1.d0) + &
+ alpha(icha)*(1.d0-delta(icha)) ) &
+ *(wmolat(iatc)+chx2(icha)*wmolat(iath)) &
+ + ( beta(icha)*(chx2(icha)-gamma(icha)) + &
+ delta(icha)*(alpha(icha)-chx2(icha)) ) &
+ *wmole(ico) ) &
+ / den2
+ elseif(iy2ch(icha).eq.1) then
+ den2 = y2ch(icha)*(1.d0-delta(icha))*wmols(ich(icha)) &
+ - wmolat(iath)*(gamma(icha)*(beta(icha)-1.d0) + &
+ alpha(icha)*(1.d0-delta(icha))) &
+ + wmole(ico)*(delta(icha)-beta(icha))
+ chx2(icha) = ( wmolat(iatc)*(alpha(icha)-gamma(icha)) &
+ + wmolat(iato)*(delta(icha)*alpha(icha)- &
+ beta(icha) *gamma(icha) ) &
+ + y2ch(icha)*gamma(icha)*wmols(ich(icha)) ) &
+ / den2
+ else
+ y2ch(icha) = min(2.d0*y1ch(icha),(1.d0+y1ch(icha))/2.d0)
+ chx2(icha) = 2.d0
+ endif
+
+ if( iy2ch(icha).lt.2) then
+ den2 = (1.d0-delta(icha))*chx2(icha)-gamma(icha)
+ a2(icha) = ( gamma(icha)*(beta(icha)-1.d0) + &
+ alpha(icha)*(1.d0-delta(icha)) ) / den2
+ b2(icha) = ( beta(icha)*(chx2(icha)-gamma(icha)) + &
+ delta(icha)*(alpha(icha)-chx2(icha)) ) / den2
+ c2(icha) = zero
+ else
+ wmv2 = y2ch(icha)*( wmolat(iatc) &
+ +alpha(icha)*wmolat(iath) &
+ +beta(icha)*wmolat(iato) )
+ wmvch2 = wmolat(iatc) + chx2(icha)*wmolat(iath)
+
+ a11 = 2.d0-gamma(icha)
+ a12 = - gamma(icha)
+ a13 = 2.d0
+ a21 = -delta(icha)
+ a22 = 1.d0-delta(icha)
+ a23 = 1.d0
+ a31 = wmvch2
+ a32 = wmole(ico)
+ a33 = wmole(ih2o)
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+ den2 = 1.d0 / det
+
+ a11 = (alpha(icha)-gamma(icha))
+ a12 = - gamma(icha)
+ a13 = 2.d0
+ a21 = (beta(icha)-delta(icha) )
+ a22 = (1.d0-delta(icha))
+ a23 = 1.d0
+ a31 = wmv2
+ a32 = wmole(ico)
+ a33 = wmole(ih2o)
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+ a2(icha) = den2 * det
+
+ a11 = (2.d0-gamma(icha))
+ a12 = (alpha(icha)-gamma(icha))
+ a13 = 2.d0
+ a21 = -delta(icha)
+ a22 = (beta(icha)-delta(icha))
+ a23 = 1.d0
+ a31 = wmvch2
+ a32 = wmv2
+ a33 = wmole(ih2o)
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+ b2(icha) = den2 * det
+
+ a11 = 2.d0-gamma(icha)
+ a12 = - gamma(icha)
+ a13 = alpha(icha)-gamma(icha)
+ a21 = -delta(icha)
+ a22 = 1.d0-delta(icha)
+ a23 = (beta(icha)-delta(icha))
+ a31 = wmvch2
+ a32 = wmole(ico)
+ a33 = wmv2
+ det = matdet(a11, a12, a13, a21, a22, a23, a31, a32, a33)
+ c2(icha) = den2 * det
+ endif
+enddo
+
+! --> Calcul de EHGAZE et de WMOLE
+! pour les especes CH(CHX1) et CH(CHX2)
+
+! ---- Especes CH(CHX1)
+
+do icha = 1, ncharb
+ wmole(ichx1c(icha)) = wmolat(iatc)+chx1(icha)*wmolat(iath)
+ if ( iy1ch(icha).eq.0 .or. iy1ch(icha).eq.2 ) then
+ do it = 1, npo
+ ehgaze(ichx1c(icha),it) = ehgaze(ichx1,it)
+ enddo
+ else
+! On a suppose D(HDEV,1,ICHA) = 0
+ do it = 1, npo
+ den1 = a1(icha)*wmole(ichx1c(icha))
+ ehgaze(ichx1c(icha),it) = &
+ ( ( ehsoli(ich(icha),it) - &
+ (1.d0-y1ch(icha))*ehsoli(ick(icha),it) ) &
+ * wmols(ich(icha)) &
+ - b1(icha)*wmole(ico)*ehgaze(ico,it) ) &
+ / den1
+ enddo
+ endif
+enddo
+
+! ---- Especes CH(CHX2)
+
+do icha = 1, ncharb
+ wmole(ichx2c(icha)) = wmolat(iatc)+chx2(icha)*wmolat(iath)
+ if ( iy2ch(icha).eq.0 .or. iy2ch(icha).eq.2 ) then
+ do it = 1, npo
+ ehgaze(ichx2c(icha),it) = ehgaze(ichx2,it)
+ enddo
+ else
+! On a suppose D(HDEV,2,ICHA) = 0
+ do it = 1, npo
+ den2 = a2(icha)*wmole(ichx2c(icha))
+ ehgaze(ichx2c(icha),it) = &
+ ( ( ehsoli(ich(icha),it) - &
+ (1.d0-y2ch(icha))*ehsoli(ick(icha),it) ) &
+ * wmols(ich(icha)) &
+ - b2(icha)*wmole(ico)*ehgaze(ico,it) ) &
+ / den2
+ enddo
+ endif
+enddo
+
+
+! --> Calcul pour les differentes classes
+
+do icla = 1, nclacp
+
+! ---- Diametre min (m)
+
+ dia2mn(icla) = zero
+
+! ---- Masse volumique (kg/m3)
+
+ rho20(icla) = rho0ch(ichcor(icla))
+ rho2mn(icla) = rho20(icla)*xashch(ichcor(icla))
+
+! ---- Masse initiale de la particule (m)
+
+ xmp0(icla) = rho20(icla)*pi*(diam20(icla)**3)/6.d0
+
+! ---- Masse de cendres de la particule (m)
+
+ xmash(icla) = xmp0(icla)*xashch(ichcor(icla))
+
+
+enddo
+
+! AFFICHAGE RECAPITULATIF
+! =======================
+
+write(nfecra,8000)
+
+! Constante du modele de devolatilisation
+
+write(nfecra,8100)
+do icha=1,ncharb
+ write(nfecra,8101) icha
+ if ( iy1ch(icha) .eq.0 ) then
+ write(nfecra,8102)
+ else if ( iy1ch(icha) .eq.1 ) then
+ write(nfecra,8103)
+ else if ( iy1ch(icha) .eq.2 ) then
+ write(nfecra,8104)
+ endif
+
+ write(nfecra,8105) y1ch(icha),y2ch(icha)
+enddo
+
+
+! Composition matieres volatiles
+
+write(nfecra,8010)
+
+write(nfecra,8051)
+ierror = 0
+do icha=1,ncharb
+ write(nfecra,8052) icha,chx1(icha),chx2(icha)
+ if ( chx1(icha) .le. 0.d0 .or. chx2(icha) .le. 0 ) then
+ ierror = 1
+ endif
+enddo
+if ( ierror .eq. 1 ) then
+ write(nfecra,9970)
+ call csexit(1)
+endif
+
+do icha=1,ncharb
+ write(nfecra,8011) icha
+ write(nfecra,8012)
+ write(nfecra,8013) a1(icha),b1(icha),c1(icha)
+ write(nfecra,8014) a2(icha),b2(icha),c2(icha)
+enddo
+
+! Calcul de DHdev
+
+write(nfecra,8001)
+do icha=1,ncharb
+
+! Enthalie du Charbon
+
+ hchar = ehsoli(ich(icha),1)
+ hcoke = ehsoli(ick(icha),1)
+
+! Enthalpie des matieres volatiles
+
+ ehvol1 = ( a1(icha)*ehgaze(ichx1c(icha),1)*wmole(ichx1c(icha)) &
+ +b1(icha)*ehgaze(ico ,1)*wmole(ico) &
+ +c1(icha)*ehgaze(ih2o,1)*wmole(ih2o) ) &
+ /( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+
+ ehvol2 = ( a2(icha)*ehgaze(ichx2c(icha),1)*wmole(ichx2c(icha)) &
+ +b2(icha)*ehgaze(ico ,1)*wmole(ico) &
+ +c2(icha)*ehgaze(ih2o,1)*wmole(ih2o) ) &
+ /( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+
+ dhvol1 = hchar-y1ch(icha)*ehvol1-(1.d0-y1ch(icha))*hcoke
+ dhvol2 = hchar-y2ch(icha)*ehvol2-(1.d0-y2ch(icha))*hcoke
+
+ write(nfecra,8002) icha,dhvol1,dhvol2,pcich(icha)
+
+enddo
+
+! Loi enthalpie/temperature
+
+write(nfecra,8020)
+do icha = 1, ncharb
+ write(nfecra,8011) icha
+ write(nfecra,8021)
+ do ii = 1, npoc
+ write(nfecra,8022)thc(ii),ehsoli(ich (icha),ii) &
+ ,ehsoli(ick (icha),ii) &
+ ,ehsoli(iash(icha),ii) &
+ ,ehsoli(iwat(icha),ii)
+ enddo
+enddo
+
+! Calcul des AiFj : nbre de mole de i par kg de j a l'origine
+
+wmco = wmole(ico)
+wmo2 = wmole(io2)
+wmco2 = wmole(ico2)
+wmh2o = wmole(ih2o)
+wmn2 = wmole(in2)
+wmc = wmolat(iatc)
+
+acof3 = 1.d0/wmc
+ao2f3 = -.5d0/wmc
+
+dmf4 = ( oxyo2 (1)*wmo2 +oxyn2 (1)*wmn2 &
+ +oxyh2o(1)*wmh2o+oxyco2(1)*wmco2 )
+
+if ( dmf4 .le. 0.d0 ) then
+ write(nfecra,9896) oxyo2(1) ,oxyn2(1) , &
+ oxyh2o(1),oxyco2(1)
+ call csexit(1)
+endif
+
+ao2f4 = oxyo2(1) / dmf4
+an2f4 = oxyn2(1) / dmf4
+ah2of4 = oxyh2o(1) / dmf4
+aco2f4 = oxyco2(1) / dmf4
+
+if ( noxyd .ge. 2.d0 ) then
+ dmf6 = ( oxyo2 (2)*wmo2 +oxyn2 (2)*wmn2 &
+ +oxyh2o(2)*wmh2o+oxyco2(2)*wmco2 )
+ if ( dmf6 .le. 0.d0 ) then
+ write(nfecra,9897) oxyo2(2) ,oxyn2(2) , &
+ oxyh2o(2),oxyco2(2)
+ call csexit(1)
+ endif
+
+ ao2f6 = oxyo2(2) / dmf6
+ an2f6 = oxyn2(2) / dmf6
+ ah2of6 = oxyh2o(2) / dmf6
+ aco2f6 = oxyco2(2) / dmf6
+
+else
+ ao2f6 = 0.d0
+ an2f6 = 0.d0
+ ah2of6 = 0.d0
+ aco2f6 = 0.d0
+endif
+
+if ( noxyd .eq. 3.d0 ) then
+ dmf7 = ( oxyo2 (3)*wmo2 +oxyn2 (3)*wmn2 &
+ +oxyh2o(3)*wmh2o+oxyco2(3)*wmco2 )
+ if ( dmf7 .le. 0.d0 ) then
+ write(nfecra,9898) oxyo2(3) ,oxyn2(3) , &
+ oxyh2o(3),oxyco2(3)
+ call csexit(1)
+ endif
+
+ ao2f7 = oxyo2(3) / dmf7
+ an2f7 = oxyn2(3) / dmf7
+ ah2of7 = oxyh2o(3) / dmf7
+ aco2f7 = oxyco2(3) / dmf7
+
+else
+ ao2f7 = 0.d0
+ an2f7 = 0.d0
+ ah2of7 = 0.d0
+ aco2f7 = 0.d0
+endif
+
+ah2of5 = 1.d0/wmh2o
+
+return
+
+
+!============================
+! 3. SORTIE EN ERREUR
+!============================
+
+ 99 continue
+write ( nfecra,9998 )
+call csexit (1)
+!==========
+
+ 999 continue
+write ( nfecra,9999 )
+call csexit (1)
+!==========
+
+
+!--------
+! FORMATS
+!--------
+
+
+ 8000 format(1X,' RECAPITULATIF SUR LES CHARBONS :'/, &
+ 1X,' ============================== ' )
+ 8001 format(/,3X,'Delta Hdev ',/, &
+ 5X,' Numero Charbon',6X,'Legeres',7X,'Lourdes',9X,'PCI')
+ 8002 format(10x,i3,8x,g15.7,1x,g15.7,g15.7)
+
+ 8010 format(/,3X,'COMPOSITION MATIERES VOLATILES ')
+ 8011 format(/,5X,' Numero Charbon',I6)
+ 8012 format(18X,'CHX1 ',12X,'CO',12X,'H2O')
+ 8013 format( 8X,' MV1 ',G15.7,G15.7,G15.7)
+ 8014 format( 8X,' MV2 ',G15.7,G15.7,G15.7)
+ 8020 format(/,3X,'LOI ENTHALPIE/TEMERATURE ')
+ 8021 format( 10X,'TEMPERATURE',9X,'Hch ',10X,'Hcoke',10X, &
+ 'Hash',10X,'Hwat')
+ 8022 format( 8x,5(g15.7))
+
+ 8050 format(/,3X,'COMPOSITION DU CHARBON ')
+ 8051 format(/,5X,'Numero Charbon',7X,'CHX1',12X,'CHX2')
+ 8052 format(10x,i3,8x,g15.7,1x,g15.7)
+
+ 8100 format(/,3X,'CONSTANTE DU MODELE DE DEVOLATILISATION')
+ 8101 format(/,8X,'CHARBON ',I2)
+ 8102 format(/,12X,'OPTION 0 : Y1 et Y2 CALCULES ')
+ 8103 format(/,12X,'OPTION 1 : Y1 et Y2 FIXES ')
+ 8104 format(/,12X,'OPTION 2 : CHX1 et CHX2 FIXES ')
+
+ 8105 format(12X,'Y1CH = ',G15.7,3X,'Y2CH = ',G15.7)
+
+ 9970 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ CERTAINES VALEURS DE CHX1 ET CHX2 SONT NEGATIVES ',/,&
+'@ OU NULLES ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9980 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Vous utilisez une option differente pour Y1 et Y2 ',/,&
+'@ pour le charbon ',I2,' ',/,&
+'@ IY1CH = ',I2,' ',/,&
+'@ IY2CH = ',I2,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9981 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Vous utilisez une option pour Y1 et Y2 non disponible ',/,&
+'@ pour le charbon ',I2,' ',/,&
+'@ IY1CH = ',I2,' ',/,&
+'@ IY2CH = ',I2,' ',/,&
+'@ ',/,&
+'@ seules les valeur : 0 , 1 ou 2 sont admissibles. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9991 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes courantes doit etre inferieur ',/,&
+'@ ou egal a',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9992 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Le nombre de points de tabulation est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9993 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes elementaires est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9995 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Le nombre de charbons est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9996 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Le nombre de classes par charbon est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' pour le charbon ',I10 ,/,&
+'@ dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Erreur a l''ouverture du fichier parametrique. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Erreur a la lecture du fichier parametrique. ',/,&
+'@ Le fichier a ete ouvert mais est peut etre incomplet ',/,&
+'@ ou son format inadapte. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9895 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ Le nombre d''Oxydants doit etre compris entre 1 et 3 ',/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9896 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ LA COMPOSITION DE L''OXYDANT 1 EST ERRONEE ',/,&
+'@ O2 : ',G15.7,' ',/,&
+'@ N2 : ',G15.7,' ',/,&
+'@ H2O : ',G15.7,' ',/,&
+'@ CO2 : ',G15.7,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9897 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ LA COMPOSITION DE L''OXYDANT 2 EST ERRONEE ',/,&
+'@ O2 : ',G15.7,' ',/,&
+'@ N2 : ',G15.7,' ',/,&
+'@ H2O : ',G15.7,' ',/,&
+'@ CO2 : ',G15.7,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9898 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ LA COMPOSITION DE L''OXYDANT 3 EST ERRONEE ',/,&
+'@ O2 : ',G15.7,' ',/,&
+'@ N2 : ',G15.7,' ',/,&
+'@ H2O : ',G15.7,' ',/,&
+'@ CO2 : ',G15.7,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9899 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (CPLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (CHARBON PULVERISE) ',/,&
+'@ ',/,&
+'@ LA COMPOSITION DE L''OXYDANT 1 EST ERRONEE ',/,&
+'@ O2 : ',G15.7,' ',/,&
+'@ N2 : ',G15.7,' ',/,&
+'@ H2O : ',G15.7,' ',/,&
+'@ CO2 : ',G15.7,' ',/,&
+'@ ',/,&
+'@ ALORS QUE L''OXYDANT 1 DOIT OBLIGATOIREMENT CONTENIR ',/,&
+'@ DE L''OXYGENE ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+end
+
+
+ function matdet &
+!==============
+
+ ( a11 , a12 , a13 , a21 , a22 , a23 , a31 , a32 , a33 )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DU DETERMINANT DE LA MATRICE 3x3
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! aa1 a a33 ! r ! <-- ! coefficient de la matrice !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision a11, a12, a13, a21, a22, a23, a31, a32, a33
+double precision matdet
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCUL DU DETERMINANT
+!===============================================================================
+
+matdet = a11*a22*a33 + a21*a32*a13 + a31*a12*a23 &
+ - a11*a32*a23 - a21*a12*a33 - a31*a22*a13
+
+end
diff --git a/src/cplv/cplin1.f90 b/src/cplv/cplin1.f90
new file mode 100644
index 0000000..7f2d949
--- /dev/null
+++ b/src/cplv/cplin1.f90
@@ -0,0 +1,472 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cplin1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! INIT DES OPTIONS DES VARIABLES TRANSPORTEES
+! ET DES VARIABLES ALGEBRIQUES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer ipp , ii , jj , iok
+integer icha , isc , is, iphas
+double precision wmolme
+
+!===============================================================================
+
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+ endif
+enddo
+do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ call csexit (1)
+ !==========
+ endif
+enddo
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! --> Definition des scamin et des scamax des variables transportees
+
+! ---- Variables euleriennes transportees dont les termes sources
+! sont alimentes par le module Langrangien
+
+scamin(ihm) = -grand
+scamax(ihm) = +grand
+
+do icha = 1, ncharb
+
+ scamin(if1m(icha)) = 0.d0
+ scamax(if1m(icha)) = 1.d0
+
+ scamin(if2m(icha)) = 0.d0
+ scamax(if2m(icha)) = 1.d0
+
+enddo
+
+scamin(if3m) = 0.d0
+scamax(if3m) = 1.d0
+
+scamin(if4p2m) = 0.d0
+scamax(if4p2m) = 0.25d0
+
+
+! --> Nature des scalaires transportes
+
+do isc = 1, nscapp
+
+! ---- Type de scalaire (0 passif, 1 temperature en K
+! -1 temperature en C
+! 2 enthalpie)
+! La distinction -1/1 sert pour le rayonnement
+ iscsth(iscapp(isc)) = 0
+
+enddo
+
+
+! ---- On resout en enthalpie avec un CP constant (Cf. cpvarp)
+
+iphas = iphsca(ihm)
+iscalt(iphas) = ihm
+iscsth(ihm) = 2
+
+! --> Donnees physiques ou numeriques propres aux scalaires CP
+
+do isc = 1, nscapp
+
+ jj = iscapp(isc)
+
+ if ( iscavr(jj).le.0 ) then
+
+! En combustion on considere que la viscosite turbulente domine
+! ON S'INTERDIT DONC LE CALCUL DES FLAMMES LAMINAIRES AVEC Le =/= 1
+
+ visls0(jj) = viscl0(iphsca(jj))
+
+ endif
+
+! ------ Schmidt ou Prandtl turbulent
+
+ sigmas(jj) = 0.7d0
+
+! ------ Coeff dissipation des fluctuations
+
+ rvarfl(jj) = 0.8d0
+
+ ii = isca(iscapp(isc))
+
+! ------ Niveau de detail des impressions pour les variables et
+! donc les scalaires (valeurs 0 ou 1)
+! Si = -10000 non modifie par l'utilisateur -> niveau 1
+ if(iwarni(ii).eq.-10000) then
+ iwarni(ii) = 1
+ endif
+
+! ------ Informations relatives a la resolution des scalaires
+
+! - Facteur multiplicatif du pas de temps
+ cdtvar(ii) = 1.d0
+
+! - Schema convectif % schema 2ieme ordre
+! = 0 : upwind
+! = 1 : second ordre
+ blencv(ii) = 0.d0
+
+! - Type de schema convetif second ordre (utile si BLENCV > 0)
+! = 0 : Second Order Linear Upwind
+! = 1 : Centre
+ ischcv(ii) = 1
+
+! - Test de pente pour basculer d'un schema centre vers l'upwind
+! = 0 : utlisation automatique du test de pente
+! = 1 : calcul sans test de pente
+ isstpc(ii) = 0
+
+! - Reconstruction des flux de convetion et de diffusion aux faces
+! = 0 : pas de reconstruction
+ ircflu(ii) = 0
+
+enddo
+
+
+!---> Variable courante : nom, sortie chrono, suivi listing, sortie histo
+
+! Comme pour les autres variables,
+! si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! NOMVAR( ) = nom de la variable
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes
+
+! NB : Les 8 premiers caracteres du noms seront repris dans le
+! listing 'developpeur'
+
+
+! ---- Variables propres a la suspension gaz - particules
+
+ipp = ipprtp(isca(ihm))
+NOMVAR(IPP) = 'Enthalpy'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+do icha = 1, ncharb
+
+ ipp = ipprtp(isca(if1m(icha)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Fr_MV1' ,ICHA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+ ipp = ipprtp(isca(if2m(icha)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Fr_MV2' ,ICHA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+enddo
+
+ipp = ipprtp(isca(if3m))
+NOMVAR(IPP) = 'Fr_HET'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+ipp = ipprtp(isca(if4p2m))
+NOMVAR(IPP) = 'Var_AIR'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+
+! ---> Variables algebriques propres a la suspension gaz - particules
+
+ipp = ipppro(ipproc(immel))
+NOMVAR(IPP) = 'XM'
+ichrvr(ipp) = 0
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+! ---> Variables algebriques propres a la phase continue
+
+ipp = ipppro(ipproc(itemp1))
+NOMVAR(IPP) = 'Temp_GAZ'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(irom1))
+NOMVAR(IPP) = 'ROM_GAZ'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(1)))
+NOMVAR(IPP) = 'YM_CHx1m'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(2)))
+NOMVAR(IPP) = 'YM_CHx2m'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(3)))
+NOMVAR(IPP) = 'YM_CO'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(4)))
+NOMVAR(IPP) = 'YM_O2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(5)))
+NOMVAR(IPP) = 'YM_CO2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(6)))
+NOMVAR(IPP) = 'YM_H2O'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(7)))
+NOMVAR(IPP) = 'YM_N2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+
+!===============================================================================
+! 3. INFORMATIONS COMPLEMENTAIRES
+!===============================================================================
+
+! ---> Definition des pointeurs du tableau TBMCR utilise dans cpphy1.F
+! et dans les sous-programmes appeles
+
+is = 0
+do icha = 1, ncharb
+ is = is + 1
+ if1mc(icha) = is
+ is = is + 1
+ if2mc(icha) = is
+enddo
+is = is + 1
+ix1mc = is
+is = is + 1
+ix2mc = is
+is = is + 1
+ichx1f1 = is
+is = is + 1
+ichx2f2 = is
+is = is + 1
+icof1 = is
+is = is + 1
+icof2 = is
+
+! ---> Initialisation
+
+! ---- Calcul de RO0 a partir de T0 et P0
+! (loi des gaz parfaits appliquee a l'air)
+
+wmolme = (wmole(io2)+xsi*wmole(in2)) / (1.d0+xsi)
+ro0(iphas) = p0(iphas)*wmolme / (rr*t0(iphas))
+
+! ---- Initialisation pour la masse volumique du coke
+
+do icha = 1, ncharb
+ rhock(icha) = rho0ch(icha)
+enddo
+
+! On met SRROM et DIFTL0 a -GRAND pour forcer l'utilisateur a les
+! definir dans cplin1
+! ---> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+srrom =-grand
+
+! ---> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 = -grand
+
+! ---> Masse volumique variable et viscosite constante (pour les suites)
+irovar(iphas) = 1
+ivivar(iphas) = 0
+
+!===============================================================================
+! 4. ON REDONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+call uscpl1
+!==========
+
+!===============================================================================
+! 5. VERIFICATION DES DONNERS FOURNIES PAR L'UTLISATEUR
+!===============================================================================
+
+iok = 0
+call cplver (iok)
+!==========
+
+if(iok.gt.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+ !==========
+else
+ write(nfecra,9998)
+endif
+
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P. COUPLE LAGRANGIEN) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P. COUPLE LAGRANGIEN) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (uscpl1).',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P. COUPLE LAGRANGIEN) DEMANDEE ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier uscpl1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/cplv/cplini.f90 b/src/cplv/cplini.f90
new file mode 100644
index 0000000..7a7513f
--- /dev/null
+++ b/src/cplv/cplini.f90
@@ -0,0 +1,350 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cplini &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! INITIALISATION DES VARIABLES DE CALCUL
+
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ige, mode, icha, iphas
+
+double precision t1init, h1init, coefe(ngazem)
+double precision f1mc(ncharm), f2mc(ncharm)
+double precision xkent, xeent, d2s3
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+! RQ IMPORTANTE : pour la combustion CP, 1 seul passage suffit
+
+if ( isuite.eq.0 .and. ipass.eq.1 ) then
+
+ iphas = 1
+
+! --> Initialisation de k et epsilon
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+ if (itytur(iphas).eq.2) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+ do iel = 1, ncel
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+ enddo
+
+ endif
+
+! --> On initialise tout le domaine de calcul avec de l'air a TINITK
+! ================================================
+
+! Enthalpie
+
+ t1init = t0(iphas)
+
+! ------ Variables de transport relatives au melange
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(io2) = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
+ coefe(in2) = 1.d0 - coefe(io2)
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , h1init , coefe , f1mc , f2mc , &
+ t1init )
+
+ do iel = 1, ncel
+ rtp(iel,isca(ihm)) = h1init
+ enddo
+
+! Fraction massique et variance
+
+ do icha = 1, ncharb
+ do iel = 1, ncel
+ rtp(iel,isca(if1m(icha))) = zero
+ rtp(iel,isca(if2m(icha))) = zero
+ enddo
+ enddo
+ do iel = 1, ncel
+ rtp(iel,isca(if3m)) = zero
+ rtp(iel,isca(if4p2m)) = zero
+ enddo
+
+endif
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cplph1.f90 b/src/cplv/cplph1.f90
new file mode 100644
index 0000000..450b18d
--- /dev/null
+++ b/src/cplv/cplph1.f90
@@ -0,0 +1,369 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cplph1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ nitbcp , nrtbcp , nitbmc , nrtbmc , nitbwo , nrtbwo , &
+ f1m , f2m , f3m , f4m , f3p2m , f4p2m , &
+ enth , &
+ rtp , propce , rom1 , &
+ itbcp , rtbcp , &
+ itbmc , rtbmc , &
+ itbwo , rtbwo )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE GAZEUSE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE, MASSE VOLUMIQUE ET CONCENTRATIONS MOYENNES
+! (UTILISATION D'UNE PDF RECTANGLE-DIRAC)
+
+
+! CLONE DE CPPHY1
+
+
+! REACTIONS HETEROGENES
+! - Pyrolyse
+! Composition elementaire de la mole de matieres volatiles
+! Le charbon reactif s'ecrit C(1)H(ALPHA)O(BETA)
+
+! -(k1)-> ALPHA/4 CH4 + BETA CO + (1-ALPHA/4-BETA) Coke
+! Charbon reactif
+! -(k2)-> ALPHA/Y CXHY + BETA CO + (1-ALPHA/RYSX-BETA) Coke
+
+! Avec RYSX = Y/X
+
+! - Combustion heterogene
+
+! Coke + 1/2 (O2 + XSI N2) -> CO + XSI/2 N2
+
+! - Reactions en phase gaz
+
+! (4/(4-RYSX)) CH4 + (O2 + XSI N2) -(1)-> 4/X/(4-RYSX)*CXHY + 2 H2O
+! + XSI N2
+! CXHY + X/4*(2+RYSX) (O2 + XSI N2) -(2)-> X CO + Y/2 H2O
+! + X/4*(2+RYSX)*XSI N2
+! CO + 1/2 (O2 + XSI N2) -(3)-> CO2 + XSI/2 N2
+
+! CHOIX DES VARIABLES
+
+! F1 est la fractions massique des matieres volatiles : CH4 + CO
+! F2 est la fractions massique des matieres volatiles : CXHY + CO
+! F3 est la fraction massique de carbone venant de la combustion
+! heterogene
+
+! Soit Y les fractions massiques et Z les concentrations (moles/kg)
+! indice f avant reaction, b final
+
+! PDF CONJOINTE DEGENERE EN UNE PDF 1D DE TYPE RECTANGLE - DIRAC
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nitbcp ! e ! <-- ! taille du macro tableau cp entiers !
+! nrtbcp ! e ! <-- ! taille du macro tableau cp reels !
+! nitbmc ! e ! <-- ! taille du macro tableau mc entiers !
+! nrtbmc ! e ! <-- ! taille du macro tableau mc reels !
+! nitbwo ! e ! <-- ! taille du macro tableau work entiers !
+! nrtbwo ! e ! <-- ! taille du macro tableau work reels !
+! pa ! tr ! <-- ! pression absolue en pascals !
+! f1m ! tr ! <-- ! moyenne du traceur 1 mvl [chx1+co] !
+! f2m ! tr ! <-- ! moyenne du traceur 2 mvl [chx2+co] !
+! f3m ! tr ! <-- ! moyenne du traceur 3 (co c.het) !
+! f4m ! tr ! <-- ! moyenne du traceur 4 (air) !
+! f3p2m ! tr ! <-- ! variance du traceur 3 (co c.het) !
+! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
+! enth ! tr ! <-- ! enthalpie en j/kg soit du gaz !
+! ! ! ! soit du melange !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! itbcp ! tr ! <-- ! macro tableau entier cp travail !
+! rtbcp ! tr ! <-- ! macro tableau reel cp travail !
+! itbmc ! tr ! <-- ! macro tableau entier mc travail !
+! rtbmc ! tr ! <-- ! macro tableau reel mc travail !
+! itbwo ! tr ! <-- ! macro tableau entier travail !
+! rtbwo ! tr ! <-- ! macro tableau reel travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+integer nitbcp , nrtbcp
+integer nitbmc , nrtbmc
+integer nitbwo , nrtbwo
+integer itbcp(ncelet,nitbcp)
+integer itbmc(ncelet,nitbmc)
+integer itbwo(ncelet,nitbwo)
+
+double precision f1m(ncelet), f2m(ncelet)
+double precision f3m(ncelet), f4m(ncelet)
+double precision f3p2m(ncelet), f4p2m(ncelet)
+double precision enth(ncelet), rom1(ncelet)
+
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision rtbcp(ncelet,nrtbcp)
+double precision rtbmc(ncelet,nrtbmc)
+double precision rtbwo(ncelet,nrtbwo)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , iphas , ice
+integer iitbcp , iitbmc , iitbwo
+integer ipcte1
+integer ipcyf1 , ipcyf2 , ipcyf3 , ipcyox
+integer ipcyp1 , ipcyp2 , ipcyin , ipcyce
+double precision wmolme , wmchx1 , wmchx2
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Initialisation des tableaux d'entiers de travail
+
+do iel = 1, ncel
+ do iitbcp = 1, nitbcp
+ itbcp(iel,iitbcp) = 0
+ enddo
+ do iitbmc = 1, nitbmc
+ itbmc(iel,iitbmc) = 0
+ enddo
+ do iitbwo = 1, nitbwo
+ itbwo(iel,iitbwo) = 0
+ enddo
+enddo
+
+! --- Initialisation des tableaux de reels de travail
+
+do iel = 1, ncel
+ do iitbcp = 1, nrtbcp
+ rtbcp(iel,iitbcp) = zero
+ enddo
+ do iitbmc = 1, nrtbmc
+ rtbmc(iel,iitbmc) = zero
+ enddo
+ do iitbwo = 1, nrtbwo
+ rtbwo(iel,iitbwo) = zero
+ enddo
+enddo
+
+
+!===============================================================================
+! 2. DETERMINATION DU TYPE DE PDF
+!===============================================================================
+
+! --> Determination du type de PDF
+
+! ---- Reconstitution de 3 moyennes et de 1 variance
+
+call cppdf4 &
+!==========
+( ncelet , ncel , &
+ f1m , f2m , f3m , f4m , f4p2m , &
+ itbcp(1,1) , &
+! INDPDF
+ rtbcp(1,1) , rtbcp(1,2) , rtbcp(1,3) , rtbcp(1,4) )
+! SI7 SI8 SP2M F4I7
+
+
+!===============================================================================
+! 3. CALCUL DES PARAMETRES DE LA PDF CENTREE RECTANGLE - PICS DE DIRAC
+!===============================================================================
+
+call cppdfr &
+!==========
+ ( ncelet , ncel , &
+ itbcp(1,1) , rtbcp(1,1) , rtbcp(1,2) , rtbcp(1,3) , &
+! INTPDF SI7 SI8 SP2M
+ rtbcp(1,5) , rtbcp(1,6) , rtbcp(1,7) , rtbcp(1,8) , &
+! DSI7 DSI8 SDEB SFIN
+ rtbcp(1,9) )
+! HAUT
+
+
+!===============================================================================
+! 4. CALCUL DES CONCENTRATIONS MOYENNES
+!===============================================================================
+
+
+ipcyf1 = ipproc(iym1(ichx1))
+ipcyf2 = ipproc(iym1(ichx2))
+ipcyf3 = ipproc(iym1(ico ))
+ipcyox = ipproc(iym1(io2 ))
+ipcyp1 = ipproc(iym1(ico2 ))
+ipcyp2 = ipproc(iym1(ih2o ))
+ipcyin = ipproc(iym1(in2 ))
+
+call cplym1 &
+!==========
+ ( ncelet , ncel , nitbmc , nrtbmc , &
+ rtp , &
+ f1m , f2m , f3m , f4m , &
+ itbcp(1,1) , &
+! INTPDF
+ rtbcp(1,1) , rtbcp(1,2) , rtbcp(1,3) , rtbcp(1,4) , &
+! SI7 SI8 SP2M F4I7
+ rtbcp(1,5) , rtbcp(1,6) , rtbcp(1,7) , rtbcp(1,8) , &
+! DSI7 DSI8 SDEB SFIN
+ rtbcp(1,9) , &
+! HAUT
+ propce(1,ipcyf1) , propce(1,ipcyf2) , propce(1,ipcyf3) , &
+ propce(1,ipcyox) , propce(1,ipcyp1) , propce(1,ipcyp2) , &
+ propce(1,ipcyin) , &
+ itbmc , rtbmc , &
+! MACRO TABLEAU MULTI CHARBONS ENTIERS REELS
+ itbwo(1,1) , &
+ rtbwo(1,1) , rtbwo(1,2) , rtbwo(1,3), rtbwo(1,4) )
+! TABLEAUX DE TRAVAIL
+
+! IMPORTANT : Voir dams PPINI1 pour savoir comment est range RTBMC
+
+! --> Clipping eventuel des fractions massiques
+
+do iel = 1, ncel
+ do ice = 1, (ngaze-2*ncharb)
+ ipcyce = ipproc(iym1(ice))
+ if ( abs(propce(iel,ipcyce)).lt.epsicp ) &
+ propce(iel,ipcyce) = zero
+ enddo
+enddo
+
+
+!===============================================================================
+! 4. CALCUL DE LA TEMPERATURE ET DE LA MASSE VOLUMIQUE
+!===============================================================================
+
+ipcte1 = ipproc(itemp1)
+
+! CALCUL DE LA TEMPERATURE DU GAZ
+! EN FONCTION DE L'ENTHALPIE DU GAZ ET DES CONCENTRATIONS
+
+ call cpteh1 &
+ !==========
+ ( ncelet , ncel , nitbmc , nrtbmc , &
+ enth, &
+ propce(1,ipcyf1), propce(1,ipcyf2), propce(1,ipcyf3), &
+ propce(1,ipcyox), propce(1,ipcyp1), propce(1,ipcyp2), &
+ propce(1,ipcyin), &
+ propce(1,ipcte1), &
+ itbmc , rtbmc , &
+! MACRO TABLEAU MULTI CHARBONS ENTIERS REELS
+ rtbwo(1,1) , rtbwo(1,2) )
+! TABLEAUX DE TRAVAIL
+
+iphas = 1
+ipcte1 = ipproc(itemp1)
+do iel = 1, ncel
+ wmchx1 = wmolat(iatc)+rtbmc(iel,ix1mc)*wmolat(iath)
+ wmchx2 = wmolat(iatc)+rtbmc(iel,ix2mc)*wmolat(iath)
+ wmolme = propce(iel,ipcyf1)/wmchx1 &
+ + propce(iel,ipcyf2)/wmchx2 &
+ + propce(iel,ipcyf3)/wmole(ico ) &
+ + propce(iel,ipcyox)/wmole(io2 ) &
+ + propce(iel,ipcyp1)/wmole(ico2) &
+ + propce(iel,ipcyp2)/wmole(ih2o) &
+ + propce(iel,ipcyin)/wmole(in2 )
+
+! stockage de la masse molaire du melange
+
+ propce(iel,ipproc(immel)) = 1.d0 / wmolme
+
+! ---- On ne met pas la pression mecanique RTP(IEL,IPR(IPHAS))
+! mais P0(IPHAS)
+
+ rom1(iel) = p0(iphas)/(wmolme*rr*propce(iel,ipcte1))
+enddo
+
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cplphy.f90 b/src/cplv/cplphy.f90
new file mode 100644
index 0000000..312c4cc
--- /dev/null
+++ b/src/cplv/cplphy.f90
@@ -0,0 +1,448 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cplphy &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! Calcul de RHO de la phase gazeuse
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usppiv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ntbcpi, icpwi, ntbcpr, icpwr
+integer ntbmci, imcwi, ntbmcr, imcwr
+integer ntbwoi, iwori, ntbwor, iworr
+integer ifinia, ifinra
+integer iel, icha, iphas, ipcrom
+integer izone, ifac
+integer ipbrom
+double precision srrom1
+double precision wmolme
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 0. ON COMPTE LES PASSAGES
+!===============================================================================
+
+ipass = ipass + 1
+
+!===============================================================================
+! 1. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Initialisation des tableaux de travail
+
+do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+ w4(iel) = zero
+ w5(iel) = zero
+ w6(iel) = zero
+ w7(iel) = zero
+ w8(iel) = zero
+enddo
+
+!===============================================================================
+! 2. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE GAZEUSE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE
+! MASSE VOLUMIQUE
+! CONCENTRATIONS DES ESPECES GAZEUSES
+!===============================================================================
+
+! --- Calcul de l'enthalpie du gaz dans W8
+! de F1M dans W2
+! de F2M dans W3
+! de F3M dans W4
+! de F4M dans W5
+! de F4P2M dans W7
+
+
+! ---- W2 = F1M = SOMME(F1M(ICHA))
+! W3 = F2M = SOMME(F2M(ICHA))
+! W4 = F3M
+! W5 = F4M = 1. - F1M - F2M - F3M
+! W7 = F4P2M
+
+do icha = 1, ncharb
+ do iel = 1, ncel
+ w2(iel) = w2(iel) + rtp(iel,isca(if1m(icha)))
+ w3(iel) = w3(iel) + rtp(iel,isca(if2m(icha)))
+ enddo
+enddo
+
+do iel = 1,ncel
+ w4(iel) = rtp(iel,isca(if3m))
+ w5(iel) = 1.d0 - w2(iel) - w3(iel) -w4(iel)
+ w7(iel) = rtp(iel,isca(if4p2m))
+ w8(iel) = rtp(iel,isca(ihm))
+enddo
+
+! --- Gestion memoire
+! Autres tableaux
+
+! ------ Macro tableau d'entiers TBCPI : NTBCPI
+! Macro tableau de reels TBCPR : NTBCPR
+! Macro tableau d'entiers TBMCI : NTBMCI
+! Macro tableau de reels TBMCR : NTBMCR
+! Macro tableau d'entiers TBWOI : NTBWOI
+! Macro tableau de reels TBWOR : NTBWOR
+
+ntbcpi = 1
+ntbcpr = 9
+ntbmci = 0
+ntbmcr = 2 + 2*ncharb + 4
+
+! Ce sont en fait X1M, X2M,
+! F1M(ICHA) et F2M(ICHA) pour chaque charbon
+! ACHX1F1, ACHX2F2, ACOF1, ACOF2
+ntbwoi = 1
+ntbwor = 4
+
+call memcp1 &
+!==========
+ ( idebia , idebra , &
+ nvar , ncelet , ncel , nfac , nfabor , &
+ ntbcpi , icpwi , &
+ ntbcpr , icpwr , &
+ ntbmci , imcwi , &
+ ntbmcr , imcwr , &
+ ntbwoi , iwori , &
+ ntbwor , iworr , &
+ ifinia , ifinra )
+
+call cplph1 &
+!==========
+ ( ifinia , ifinra , &
+ ncelet , ncel , &
+ ntbcpi , ntbcpr , ntbmci , ntbmcr , ntbwoi , ntbwor , &
+ w2 , w3 , w4 , w5 , w6 , w7 , &
+! F1M F2M F3M F4M F3P2M F4P2M
+ w8 , &
+! ENTH
+ rtp , propce , w1 , &
+! ----
+! ATTENTION W1 contient RHO1
+ ia(icpwi) , ra(icpwr) , &
+ ia(imcwi) , ra(imcwr) , &
+ ia(iwori) , ra(iworr) )
+
+
+!===============================================================================
+! 3. Relaxation de la masse volumique de la phase gazeuse
+!===============================================================================
+
+! --- Calcul de Rho avec relaxation
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+
+if (ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+ srrom1 = srrom
+else
+ srrom1 = 1.d0
+endif
+
+
+do iel = 1, ncel
+! ---- Sous relaxation eventuelle a donner dans ppini1.F
+ propce(iel,ipcrom) = srrom1*propce(iel,ipcrom) &
+ + (1.d0-srrom1)*w1(iel)
+enddo
+
+
+!===============================================================================
+! 4. CALCUL DE RHO DE LA PHASE GAZEUSE
+
+! VALEURS FACES
+! -------------
+!===============================================================================
+
+iphas = 1
+ibrom(iphas) = 1
+ipbrom = ipprob(irom(iphas))
+ipcrom = ipproc(irom(iphas))
+
+! ---> Masse volumique au bord pour toutes les faces
+! Les faces d'entree seront recalculees.
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbrom) = propce(iel,ipcrom)
+enddo
+
+! ---> Masse volumique au bord pour les faces d'entree UNIQUEMENT
+! Le test sur IZONE sert pour les reprises de calcul
+
+if ( ipass.gt.1 .or. isuite.eq.1 ) then
+ do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+ if(izone.gt.0) then
+ if ( ientat(izone).eq.1 ) then
+ wmolme = (1.d0+xsi) / (wmole(io2)+xsi*wmole(in2))
+ propfb(ifac,ipbrom) = p0(iphas) &
+ /(wmolme*rr*timpat(izone))
+ endif
+ endif
+
+ enddo
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cplpro.f90 b/src/cplv/cplpro.f90
new file mode 100644
index 0000000..a199aea
--- /dev/null
+++ b/src/cplv/cplpro.f90
@@ -0,0 +1,162 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cplpro &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! -> ! numero de la derniere case utlisee !
+! ! ! ! dans ipproc, ipprob, ipprof !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp, ipppst
+
+! VARIABLES LOCALES
+
+integer iprop, ige
+
+!===============================================================================
+
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+iprop = ipropp
+
+! Phase continue
+iprop = iprop + 1
+itemp1 = iprop
+do ige = 1, (ngaze-2*ncharb)
+! ---- Cf. definition de NGAZE dans cplecd.F
+ iprop = iprop + 1
+ iym1(ige) = iprop
+enddo
+iprop = iprop + 1
+immel = iprop
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+nsalpp = iprop - ipropp
+nsalto = iprop
+
+
+! ---> Positionnement dans le tableau PROPCE
+
+iprop = nproce
+
+! Phase continue (melange gazeux)
+iprop = iprop + 1
+ipproc(itemp1) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+do ige = 1, (ngaze-2*ncharb)
+! ---- Cf. definition de NGAZE dans cplecd.F
+ iprop = iprop + 1
+ ipproc(iym1(ige)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+enddo
+
+iprop = iprop + 1
+ipproc(immel) = iprop
+ ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+nproce = iprop
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+iprop = nprofb
+nprofb = iprop
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+iprop = nprofa
+nprofa = iprop
+
+return
+end
diff --git a/src/cplv/cpltcl.f90 b/src/cplv/cpltcl.f90
new file mode 100644
index 0000000..9f36620
--- /dev/null
+++ b/src/cplv/cpltcl.f90
@@ -0,0 +1,579 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpltcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ii, iphas, ifac, izone, mode, iel, ige, iok
+integer icha, ipbrom, icke, ipcvis
+integer nbrval
+double precision qisqc, viscla, d2s3, uref2, rhomoy, dhy, xiturb
+double precision ustar2, xkent, xeent, t1
+double precision h1 (nozppm)
+double precision qimpc (nozppm) , qcalc(nozppm)
+double precision coefe (ngazem)
+double precision f1mc (ncharm) , f2mc (ncharm)
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+ipbrom = ipprob(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 1. ECHANGES EN PARALLELE POUR LES DONNEES UTILISATEUR
+!===============================================================================
+
+! En realite on pourrait eviter cet echange en modifiant uscpcl et en
+! demandant a l'utilisateur de donner les grandeurs dependant de la
+! zone hors de la boucle sur les faces de bord : les grandeurs
+! seraient ainsi disponibles sur tous les processeurs. Cependant,
+! ca rend le sous programme utilisateur un peu plus complique et
+! surtout, si l'utilisateur le modifie de travers, ca ne marche pas.
+! On suppose que toutes les grandeurs fournies sont positives, ce qui
+! permet d'utiliser un max pour que tous les procs les connaissent.
+! Si ce n'est pas le cas, c'est plus complique mais on peut s'en tirer
+! avec un max quand meme.
+
+if(irangp.ge.0) then
+ call parimx(nozapm,iqimp )
+ !==========
+ call parimx(nozapm,ientat)
+ !==========
+ call parimx(nozapm,ientcp)
+ !==========
+ call parrmx(nozapm,qimpat)
+ !==========
+ call parrmx(nozapm,timpat)
+ !==========
+ nbrval = nozppm*ncharm
+ call parrmx(nbrval,qimpcp)
+ !==========
+ nbrval = nozppm*ncharm
+ call parrmx(nbrval,timpcp)
+ !==========
+ nbrval = nozppm*ncharm*nclcpm
+ call parrmx(nbrval,distch)
+ !==========
+endif
+
+
+!===============================================================================
+! 2. CORRECTION DES VITESSES (EN NORME) POUR CONTROLER LES DEBITS
+! IMPOSES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+! --- Debit calcule
+
+do izone = 1, nozppm
+ qcalc(izone) = 0.d0
+enddo
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if (izone .gt. 0) then
+ if ( iqimp(izone).eq.2) then
+ qcalc(izone) = qcalc(izone) - &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+ else
+ qcalc(izone) = qcalc(izone) - propfb(ifac,ipbrom) * &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+ endif
+ endif
+enddo
+
+if(irangp.ge.0) then
+ call parrsm(nozapm,qcalc )
+endif
+
+do izone = 1, nozapm
+ if ( iqimp(izone).eq.0 ) then
+ qimpc(izone) = qcalc(izone)
+ endif
+enddo
+
+! --- Correction des vitesses en norme
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( iqimp(izone).eq.1 .or. iqimp(izone).eq.2) then
+ if(abs(qcalc(izone)).lt.epzero) then
+ write(nfecra,2001)izone,iqimp(izone),qcalc(izone)
+ iok = iok + 1
+ endif
+ endif
+enddo
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if (izone .gt. 0) then
+ if ( iqimp(izone).eq.1 .or. iqimp(izone).eq.2) then
+ qimpc(izone) = qimpat(izone)
+ qisqc = qimpc(izone)/qcalc(izone)
+ rcodcl(ifac,iu(iphas),1) = rcodcl(ifac,iu(iphas),1)*qisqc
+ rcodcl(ifac,iv(iphas),1) = rcodcl(ifac,iv(iphas),1)*qisqc
+ rcodcl(ifac,iw(iphas),1) = rcodcl(ifac,iw(iphas),1)*qisqc
+ endif
+ endif
+
+enddo
+
+
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= ',/,&
+'@ COMBUSTION CHARBON PULVERISE COUPLE AU ',/,&
+'@ TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON : ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/&
+'@ ',/,&
+'@ Le debit est impose sur la zone IZONE = ', I10 ,/,&
+'@ puisque IQIMP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, le produit RHO D S integre est nul : ',/,&
+'@ il vaut = ',E14.5 ,/,&
+'@ (D est la direction selon laquelle est impose le debit).',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpcl, et en particulier ',/,&
+'@ - que le vecteur RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) qui determine',/,&
+'@ la direction de la vitesse est non nul et n''est pas ',/,&
+'@ uniformement perpendiculaire aux face d''entree ',/,&
+'@ - que la surface de l''entree n''est pas nulle (ou que ',/,&
+'@ le nombre de faces de bord dans la zone est non nul) ',/,&
+'@ - que la masse volumique n''est pas nulle ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 3. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LA TURBULENCE
+
+!===============================================================================
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique de la turbulence
+
+ if ( icalke(izone).ne.0 ) then
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ + rcodcl(ifac,iv(iphas),1)**2 &
+ + rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ rhomoy = propfb(ifac,ipbrom)
+ iel = ifabor(ifac)
+ viscla = propce(iel,ipcvis)
+ icke = icalke(izone)
+ dhy = dh(izone)
+ xiturb = xintur(izone)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+ if (icke.eq.1) then
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscla, cmu, xkappa, &
+ ustar2, xkent, xeent )
+ else if (icke.eq.2) then
+ call keenin &
+ !==========
+ ( uref2, xiturb, dhy, cmu, xkappa, xkent, xeent )
+ endif
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LES SCALAIRES
+!===============================================================================
+
+do ii = 1, nzfppp
+
+ izone = ilzppp(ii)
+
+! Une entree IENTRE est forcement du type
+! IENTAT = 1 ou IENTCP = 1
+
+ if ( ientat(izone).eq.1 ) then
+
+! ------ Calcul de H1(IZONE)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(io2) = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
+ coefe(in2) = 1.d0 - coefe(io2)
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ t1 = timpat(izone)
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , h1(izone) , coefe , f1mc , f2mc , &
+ t1 )
+
+ endif
+
+enddo
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique des scalaires physiques particulieres
+
+ do icha = 1, ncharb
+
+! ------ CL pour F1M et F2M du charbon ICHA
+ rcodcl(ifac,isca(if1m(icha)),1) = zero
+ rcodcl(ifac,isca(if2m(icha)),1) = zero
+
+ enddo
+
+! ------ CL pour F3M
+ rcodcl(ifac,isca(if3m),1) = zero
+! ------ CL pour FP4M
+ rcodcl(ifac,isca(if4p2m),1) = zero
+! ------ CL pour HM
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(io2) = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
+ coefe(in2) = 1.d0 - coefe(io2)
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ t1 = timpat(izone)
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , h1(izone) , coefe , f1mc , f2mc , &
+ t1 )
+ rcodcl(ifac,isca(ihm),1) = h1(izone)
+
+ endif
+
+enddo
+
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpltss.f90 b/src/cplv/cpltss.f90
new file mode 100644
index 0000000..a581c53
--- /dev/null
+++ b/src/cplv/cpltss.f90
@@ -0,0 +1,404 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpltss &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ izfppp , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , tslagr , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! ON PRECISE LES TERMES SOURCES POUR UN SCALAIRE PP
+! SUR UN PAS DE TEMPS
+
+! ATTENTION : LE TRAITEMENT DES TERMES SOURCES EST DIFFERENT
+! --------- DE CELUI DE USTSSC.F
+
+! ON RESOUT ROVSDT*D(VAR) = SMBRS
+
+! ROVSDT ET SMBRS CONTIENNENT DEJA D'EVENTUELS TERMES SOURCES
+! UTILISATEUR. IL FAUT DONC LES INCREMENTER ET PAS LES
+! ECRASER
+
+! POUR DES QUESTIONS DE STABILITE, ON NE RAJOUTE DANS ROVSDT
+! QUE DES TERMES POSITIFS. IL N'Y A PAS DE CONTRAINTE POUR
+! SMBRS
+
+! DANS LE CAS D'UN TERME SOURCE EN CEXP + CIMP*VAR ON DOIT
+! ECRIRE :
+! SMBRS = SMBRS + CEXP + CIMP*VAR
+! ROVSDT = ROVSDT + MAX(-CIMP,ZERO)
+
+! ON FOURNIT ICI ROVSDT ET SMBRS (ILS CONTIENNENT RHO*VOLUME)
+! SMBRS en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! ROVSDT en kg /s
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision tslagr(ncelet,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia , idebra
+integer ivar , iel
+integer iscala , icha
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES
+!===============================================================================
+
+! --> Terme source pour les matieres volatiles legeres
+
+if ( ivar.ge.isca(if1m(1)) .and. ivar.le.isca(if1m(ncharb)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+ icha = ivar-isca(if1m(1))+1
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + tslagr(iel,itsmv1(icha))
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ enddo
+
+endif
+
+! --> Terme source pour les matieres volatiles lourdes
+
+if ( ivar.ge.isca(if2m(1)) .and. ivar.le.isca(if2m(ncharb)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Contribution du TS interfacial pour le bilan explicite
+
+ icha = ivar-isca(if2m(1))+1
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + tslagr(iel,itsmv2(icha))
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ enddo
+
+endif
+
+! --> Terme source pour le traceur 3 (C de la comb. het.)
+
+if ( ivar.eq.isca(if3m) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + tslagr(iel,itsco)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ enddo
+
+endif
+
+! --> Terme source pour la variance du traceur 4 (Air)
+
+if ( ivar.eq.isca(if4p2m) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Calcul des termes sources explicite et implicite
+! relatif aux echanges interfaciaux entre phases
+
+! -> appel commente => SMBRS et ROVSDT non modifies
+! NUMTRA = 4
+! CALL CPTSVI
+!!==========
+! & ( NCELET , NCEL , NUMTRA ,
+! & RTP , PROPCE , VOLUME ,
+! & SMBRS , ROVSDT ,
+! & W1 , W2 ,
+! & W3 )
+
+
+! ---- Calcul des termes sources explicite et implicite
+! relatif aux termes de production et de dissipation
+
+! Pointeur relatif au scalaire associe
+! (0 si pas de scalaire associe)
+ iscala = 0
+
+ call cpltsv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ smbrs , rovsdt , &
+ viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES PHYSIQUE PARTICULIERE POUR LA VARIABLE ' &
+ ,a8,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cplv/cpltsv.f90 b/src/cplv/cpltsv.f90
new file mode 100644
index 0000000..dcadf97
--- /dev/null
+++ b/src/cplv/cpltsv.f90
@@ -0,0 +1,433 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpltsv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ smbrs , rovsdt , &
+ wfb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! TERMES SOURCES DE PRODUCTION ET DE DISSIPATION POUR
+! LA VARIANCE (BILANS EXPLICITE ET IMPLICITE)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! iscala ! e ! <-- ! numero du scalaire associe !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! wfb(nfabor) ! tr ! --- ! tableau de travail faces de bord !
+! w1..8(ncelet) ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "period.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal , iscala
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision wfb(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ivar , ivarsc , ivarut, ivar0
+integer iel, iphas , ifac
+integer ipcrom, ipcvst
+integer ikiph, ieiph, iomgip
+integer ir11ip, ir22ip, ir33ip
+integer icha
+integer inc , iccocg , nswrgp , imligp , iwarnp
+integer ifinra , icoefa , icoefb
+integer iphydp , idimte , itenso
+
+double precision xk , xe , rhovst
+double precision epsrgp , climgp , extrap
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Numero du scalaire eventuel associe dans le cas fluctuation
+! ISCALA et numero de variable de calcul
+if (iscala.gt.0) then
+ ivarsc = isca(iscala)
+else
+ ivarsc = 0
+endif
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Numero des variables de calcul
+if ( itytur(iphas).eq.2 .or. iturb(iphas).eq.50 ) then
+ ikiph = ik (iphas)
+ ieiph = iep (iphas)
+elseif ( itytur(iphas).eq.3 ) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ieiph = iep (iphas)
+elseif ( iturb(iphas).eq.60 ) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+endif
+
+! --- Numero des grandeurs physiques
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES DE PRODUCTION PAR LES GRADIENTS
+! ET DE DISSIPATION
+!===============================================================================
+
+if ( itytur(iphas).eq.2 .or. itytur(iphas).eq.3 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60 ) then
+
+ inc = 1
+ iccocg = 1
+ if (ivarsc.gt.0) then
+ ivarut = ivarsc
+ else
+! A defaut de savoir pour F4M on prend comme pour F3M
+ ivarut = isca(if3m)
+ endif
+ nswrgp = nswrgr(ivarut)
+ imligp = imligr(ivarut)
+ iwarnp = iwarni(ivarut)
+ epsrgp = epsrgr(ivarut)
+ climgp = climgr(ivarut)
+ extrap = extrag(ivarut)
+
+ do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+ w4(iel) = zero
+ w5(iel) = zero
+ w6(iel) = zero
+ w7(iel) = zero
+ enddo
+
+! ---- W7 = FJM (kg/kg du melange gazeux)
+
+ if (ivarsc.eq.0) then
+ do icha = 1, ncharb
+ do iel = 1, ncel
+ w1(iel) = w1(iel) + rtp(iel,isca(if1m(icha)))
+ w2(iel) = w2(iel) + rtp(iel,isca(if2m(icha)))
+ enddo
+ enddo
+ do iel = 1, ncel
+ w7(iel) = 1.d0 - ( w1(iel) + w2(iel) + rtp(iel,isca(if3m)))
+ enddo
+ else
+ do iel = 1, ncel
+ w7(iel) = rtp(iel,ivarsc)
+ enddo
+ endif
+
+! --> Calcul des COEFA et COEFB de FIM afin d'en calculer son gradient
+! On alloue localement 2 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB de FIM
+
+ icoefa = idebra
+ icoefb = icoefa + nfabor
+ ifinra = icoefb + nfabor
+ CALL RASIZE ('CPLTSV',IFINRA)
+ !==========
+
+ do ifac = 1, nfabor
+ ra(icoefa+ifac-1) = zero
+ ra(icoefb+ifac-1) = 1.d0
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+ ra(icoefa+ifac-1) = zero
+ ra(icoefb+ifac-1) = zero
+ if (ivarsc.eq.0) ra(icoefa+ifac-1) = 1.d0
+ endif
+ enddo
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(w7)
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 )
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , w7 , w7 , &
+ w7 , ra(icoefa) , ra(icoefb) , &
+! FIM COEFA COEFB
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ if ( itytur(iphas).eq.2 .or. iturb(iphas).eq.50 ) then
+ xk = rtpa(iel,ikiph)
+ xe = rtpa(iel,ieiph)
+ elseif ( itytur(iphas).eq.3 ) then
+ xk = &
+ 0.5d0*(rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip))
+ xe = rtpa(iel,ieiph)
+ elseif ( iturb(iphas).eq.60 ) then
+ xk = rtpa(iel,ikiph)
+ xe = cmu*xk*rtpa(iel,iomgip)
+ endif
+
+ rhovst = propce(iel,ipcrom)*xe/ &
+ (xk * rvarfl(iscal))*volume(iel)
+ rovsdt(iel) = rovsdt(iel) + max(zero,rhovst)
+ smbrs(iel) = smbrs(iel) + &
+ 2.d0*propce(iel,ipcvst)*volume(iel)/sigmas(iscal) &
+ * (w1(iel)**2 + w2(iel)**2 + w3(iel)**2) &
+ - rhovst*rtpa(iel,ivar)
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cplv/cplvar.f90 b/src/cplv/cplvar.f90
new file mode 100644
index 0000000..3fd6c33
--- /dev/null
+++ b/src/cplv/cplvar.f90
@@ -0,0 +1,137 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cplvar
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! INIT DES POSITIONS DES VARIABLES TRANSPORTEES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer is, iphas, icha, isc
+
+!===============================================================================
+
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! ---> Variables propres a la phase continue
+
+ihm = iscapp(1)
+
+! ---> Variables propres a la phase continue
+
+do icha = 1, ncharb
+ is = 1+icha
+ if1m(icha) = iscapp(is)
+ is = 1+ncharb+icha
+ if2m(icha) = iscapp(is)
+enddo
+
+is = 1+ncharb*2
+is = is+1
+if3m = iscapp(is)
+is = is+1
+if4p2m = iscapp(is)
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+! A RENSEIGNER OBLIGATOIREMENT (sinon pb dans varpos)
+! - PROPRES AUX SCALAIRES : IPHSCA, IVISLS, ISCAVR
+! Rq : pas de variance associee a un scalaire dans notre cas
+! - PROPRES A LA SUSPENSION : ICP
+!===============================================================================
+
+do isc = 1, nscapp
+
+ if ( iscavr(iscapp(isc)).le.0 ) then
+
+! ---- Notre physque particuliere est monophasique
+ iphsca(iscapp(isc)) = 1
+
+! ---- Viscosite dynamique de reference relative au scalaire
+! ISCAPP(ISC)
+ ivisls(iscapp(isc)) = 0
+
+ endif
+
+enddo
+
+! ---- Bien que l on soit en enthalpie on conserve un CP constant
+
+iphas = iphsca(ihm)
+icp(iphas) = 0
+
+
+return
+end
diff --git a/src/cplv/cplver.f90 b/src/cplv/cplver.f90
new file mode 100644
index 0000000..1f6bbd6
--- /dev/null
+++ b/src/cplv/cplver.f90
@@ -0,0 +1,188 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cplver &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! VERIFICATION DES PARAMETRES DE CALCUL
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+character chaine*80
+integer ipp, isc, jj, iphas
+integer ige
+
+!===============================================================================
+
+!===============================================================================
+! 1. OPTIONS DU CALCUL : TABLEAUX DE ppincl.h : formats 2000
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+
+if( srrom.lt.0d0 .or. srrom.gt.1d0) then
+ WRITE(NFECRA,2000)'SRROM ', SRROM
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 2. TABLEAUX DE cstphy.h et ppthch.F : formats 3000
+!===============================================================================
+
+iphas = 1
+
+! --> Masse volumique
+
+if( ro0(iphas).lt.0d0) then
+ WRITE(NFECRA,3000)IPHAS,'RO0 ', RO0(IPHAS)
+ iok = iok + 1
+ endif
+
+! --> Diffusivite dynamique en kg/(m s) : DIFTL0
+
+if( diftl0.lt.0d0) then
+ WRITE(NFECRA,3010)'DIFTL0', DIFTL0
+ iok = iok + 1
+else
+ visls0(ihm) = diftl0
+endif
+
+!===============================================================================
+! 3. FORMATS VERIFICATION
+!===============================================================================
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P. COUPLE LAGRANGIEN) ',/,&
+'@ ',/,&
+'@ ',A6, ' DOIT ETRE UN REEL ',/,&
+'@ COMPRIS ENTRE 0 ET 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpi1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P. COUPLE LAGRANGIEN) ',/,&
+'@ ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpi1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (C.P. COUPLE LAGRANGIEN) ',/,&
+'@ ',/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpi1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 4. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/cplv/cplym1.f90 b/src/cplv/cplym1.f90
new file mode 100644
index 0000000..3714fcf
--- /dev/null
+++ b/src/cplv/cplym1.f90
@@ -0,0 +1,1134 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cplym1 &
+!================
+
+ ( ncelet , ncel , nitbmc , nrtbmc , &
+ rtp , &
+ f1m , f2m , f3m , f4m , &
+ indpdf , si7 , si8 , sp2m , f4i7 , &
+ dsi7 , dsi8 , sdeb , sfin , haut , &
+ fuel1 , fuel2 , fuel3 , oxyd , prod1 , prod2 , &
+ xiner , &
+ itbmc , rtbmc , &
+ ipi7i8 , &
+ sp , si , sr , w1 )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! CALCUL DES CONCENTRATIONS GAZEUSES MOYENNES
+! VALEURS CELLULES
+! ----------------
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nitbmc ! e ! <-- ! taille du macro tableau mc entiers !
+! nrtbmc ! e ! <-- ! taille du macro tableau mc reels !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! f1m ! tr ! <-- ! moyenne du traceur 1 mvl [chx1m+co] !
+! f2m ! tr ! <-- ! moyenne du traceur 2 mvl [chx2m+co] !
+! f3m ! tr ! <-- ! moyenne du traceur 3 (co c.het) !
+! f4m ! tr ! <-- ! moyenne du traceur 4 (air) !
+! indpdf ! te ! <-- ! passage par les pdf !
+! si7 ! tr ! <-- ! abscisse curviligne au point i7 !
+! si8 ! tr ! <-- ! abscisse curviligne au point i8 !
+! sp2m ! tr ! <-- ! variance droite support !
+! f4i7 ! tr ! <-- ! f4 au point i7 !
+! dsi7 ! tr ! <-- ! dirac au point i7 !
+! dsi8 ! tr ! <-- ! dirac au point i8 !
+! sdeb ! tr ! <-- ! abscisse debut rectangle !
+! sfin ! tr ! <-- ! abscisse fin rectangle !
+! hrec ! tr ! <-- ! hauteur rectangle !
+! fuel1 ! tr ! <- ! fraction massique chx1m !
+! fuel2 ! tr ! <- ! fraction massique chx2m !
+! fuel3 ! tr ! <- ! fraction massique co !
+! oxyd ! tr ! <- ! fraction massique o2 !
+! prod1 ! tr ! <- ! fraction massique co2 !
+! prod2 ! tr ! <- ! fraction massique h2o !
+! xiner ! tr ! <- ! fraction massique n2 !
+! itbmc ! tr ! <-- ! macro tableau entier mc travail !
+! rtbmc ! tr ! <-- ! macro tableau reel mc travail !
+! ipi7i8 ! te ! <-- ! position des points i7 et i8 dans !
+! ! ! ! les differents domaines de richesse !
+! sp ! tr ! <-- ! delimitation sur le support des !
+! ! ! ! domaines pauvre et intermediaire !
+! si ! tr ! <-- ! delimitation sur le support des !
+! ! ! ! domaines intermediaire et riche !
+! sr ! tr ! <-- ! delimitation sur le support des !
+! ! ! ! domaines riche et hyper-riche !
+! w1 ! tr ! <-- ! tableau de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer nitbmc , nrtbmc
+integer itbmc(ncelet,nitbmc)
+integer indpdf(ncelet) , ipi7i8(ncelet)
+
+double precision rtp(ncelet,*)
+double precision f1m(ncelet) , f2m(ncelet)
+double precision f3m(ncelet) , f4m(ncelet)
+double precision dsi7(ncelet) , dsi8(ncelet) , sdeb(ncelet)
+double precision sfin(ncelet) , haut(ncelet)
+double precision si7(ncelet) , si8(ncelet) , sp2m(ncelet)
+double precision f4i7(ncelet)
+double precision fuel1(ncelet), fuel2(ncelet) , fuel3(ncelet)
+double precision oxyd(ncelet) , prod1(ncelet) , prod2(ncelet)
+double precision xiner(ncelet)
+double precision rtbmc(ncelet,nrtbmc)
+double precision sp(ncelet) , si(ncelet) , sr(ncelet)
+double precision w1(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel, icha, itbr, itbi, ige
+
+integer n1 , n2 , n3 , n4 , n5 , n6 , n7 , n8 , n9
+integer n10, n11, n12, n13, n14, n15, n16, n17, n18, n19
+integer n20, n21, n22, n23, n24, n25, n26, n27, n28, n29
+integer n30, n31, n32
+integer nbrint
+parameter (nbrint = 32)
+integer inttmp(nbrint)
+
+double precision zcof10 , zcof20
+double precision cx1m , cx2m
+double precision wmchx1 , wmchx2 , wmco , wmco2 , wmh2o
+double precision wmo2 , wmn2 , wmc
+double precision achx1f1, acof1 , achx2f2, acof2
+double precision cc1 , cc2 , cc3 , cc4
+double precision f1i7 , f2i7 , f3i7
+double precision vars
+double precision zc(ngazem)
+double precision ac0(ngazem) , bc0(ngazem)
+double precision ac1(ngazem) , bc1(ngazem)
+double precision ac2(ngazem) , bc2(ngazem)
+double precision ac3(ngazem) , bc3(ngazem)
+double precision ai(ngazem) , bi(ngazem)
+double precision anu1 , anu2 , anu3
+double precision s1, s2, s3, sm1, sm2
+double precision den1 , den2 , somm
+#ifdef DEBUG
+double precision sommf , mom0 , mom1 , mom2
+#endif
+double precision zchx10 , zchx20 , zco0 , zco20
+double precision zn20 , zh2o0 , zo20
+double precision ychx10 , ychx20
+#ifdef DEBUG
+double precision yco0 , yco20
+double precision yn20 , yh2o0 , yo20
+#endif
+double precision zchx11 , zchx21 , zco1 , zco21
+double precision zn21 , zh2o1 , zo21
+double precision zchx12 , zchx22 , zco2 , zco22
+double precision zn22 , zh2o2 , zo22
+double precision zchx13 , zchx23 , zco3 , zco23
+double precision zn23 , zh2o3 , zo23
+double precision reac1 , reac2 , reac3
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation tableau de travail
+
+do iel = 1, ncel
+ w1(iel) = zero
+ do itbr = 1, nrtbmc
+ rtbmc(iel,itbr) = zero
+ enddo
+ do itbi = 1, nitbmc
+ itbmc(iel,itbi) = 0
+ enddo
+enddo
+
+!===============================================================================
+! 2. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Calcul de F1M de chaque charbon dans RTBMC
+! de F2M de chaque charbon dans RTBMC
+
+! ------ RTBMC(IF1MC(ICHA)) = F1M(ICHA)
+! RTBMC(IF2MC(ICHA)) = F2M(ICHA)
+
+do icha = 1, ncharb
+ do iel = 1, ncel
+ rtbmc(iel,if1mc(icha)) = rtp(iel,isca(if1m(icha)))
+ rtbmc(iel,if2mc(icha)) = rtp(iel,isca(if2m(icha)))
+ enddo
+enddo
+
+
+! --- Masses molaires
+
+wmco = wmole(ico )
+wmo2 = wmole(io2 )
+wmco2 = wmole(ico2 )
+wmh2o = wmole(ih2o )
+wmn2 = wmole(in2 )
+wmc = wmolat(iatc)
+
+
+! --- Calcul de CX1M, CX2M
+! et des coefficient relatifs a l'expression de
+! ZCHx1m0, ZCHx2m0, ZCO0, ZO20 et ZN20
+! fonctions de F1, F2, F3 et F4
+
+do iel = 1, ncel
+
+! ---- YCHX1,20 en kg/kg de melange et
+! ZCHX1,20 en nb de moles/ kg de melange
+
+ ychx10 = zero
+ ychx20 = zero
+ zchx10 = zero
+ zchx20 = zero
+ zcof10 = zero
+ zcof20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( rtbmc(iel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ zchx10 = zchx10 + den1 * &
+ ( rtbmc(iel,if1mc(icha))*a1(icha) )
+ zcof10 = zcof10 + den1 * &
+ ( rtbmc(iel,if1mc(icha))*b1(icha) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( rtbmc(iel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ zchx20 = zchx20 + den2 * &
+ ( rtbmc(iel,if2mc(icha))*a2(icha) )
+ zcof20 = zcof20 + den2 * &
+ ( rtbmc(iel,if2mc(icha))*b2(icha) )
+ enddo
+ rtbmc(iel,ix1mc) = 4.d0
+ if ( zchx10.gt.epzero ) &
+ rtbmc(iel,ix1mc) = ( ychx10/zchx10-wmolat(iatc) ) &
+ / wmolat(iath)
+ rtbmc(iel,ix2mc) = 2.d0
+ if ( zchx20.gt.epzero ) &
+ rtbmc(iel,ix2mc) = ( ychx20/zchx20-wmolat(iatc) ) &
+ / wmolat(iath)
+
+ rtbmc(iel,ichx1f1) = 0.d0
+ rtbmc(iel,icof1 ) = 0.d0
+ if ( f1m(iel).gt.epzero ) then
+ rtbmc(iel,ichx1f1) = zchx10 / f1m(iel)
+ rtbmc(iel,icof1 ) = zcof10 / f1m(iel)
+ endif
+ rtbmc(iel,ichx2f2) = 0.d0
+ rtbmc(iel,icof2 ) = 0.d0
+ if ( f2m(iel).gt.epzero ) then
+ rtbmc(iel,ichx2f2) = zchx20 / f2m(iel)
+ rtbmc(iel,icof2 ) = zcof20 / f2m(iel)
+ endif
+
+enddo
+
+! ---- Initialisation des fractions massiques avec de l'air
+
+do iel = 1, ncel
+ fuel1(iel) = zero
+ fuel2(iel) = zero
+ fuel3(iel) = zero
+ oxyd(iel) = wmo2*ao2f4
+ prod1(iel) = zero
+ prod2(iel) = zero
+ xiner(iel) = wmn2*an2f4
+ ipi7i8(iel) = 0
+ sp(iel) = zero
+ si(iel) = zero
+ sr(iel) = zero
+enddo
+
+
+
+!===============================================================================
+! 3. CALCUL DE LA COMPOSITION DU MELANGE SANS LES PDF
+! SI LES FLUCTUATIONS DE S SONT TROP FAIBLES
+! SI SI7 ET SI8 SONT TROP PROCHE DE 0
+! ALORS F1 = F1M, F2 = F2M , F3 = F3M ET F4 = F4M
+!===============================================================================
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.0 ) then
+
+! --> Calculs preliminaires
+
+ cx1m = rtbmc(iel,ix1mc)
+ cx2m = rtbmc(iel,ix2mc)
+ wmchx1 = wmolat(iatc) + cx1m*wmolat(iath)
+ wmchx2 = wmolat(iatc) + cx2m*wmolat(iath)
+ achx1f1 = rtbmc(iel,ichx1f1)
+ achx2f2 = rtbmc(iel,ichx2f2)
+ acof1 = rtbmc(iel,icof1)
+ acof2 = rtbmc(iel,icof2)
+
+! --> Composition de la phase gazeuse avant combustion (indice 0)
+
+! ZCHX10 = ACHX1F1*F1
+! ZCHX20 = ACHX2F2*F2
+! ZCO0 = ACOF1*F1 + ACOF2*F2 + ACOF3*F3
+! ZCO20 = ZERO
+! ZH2O0 = ZERO
+! ZO20 = AO2F4*F4 + AO2F3*F3
+! ZN20 = AN2F4*F4
+
+ zchx10 = achx1f1*f1m(iel)
+ zchx20 = achx2f2*f2m(iel)
+ zco0 = (acof1*f1m(iel)+acof2*f2m(iel) + &
+ acof3*f3m(iel))
+ zo20 = (ao2f4*f4m(iel)+ao2f3*f3m(iel))
+ zn20 = (an2f4*f4m(iel))
+ zco20 = zero
+ zh2o0 = zero
+! ---- Test
+#ifdef DEBUG
+ ychx10 = zchx10*wmchx1
+ ychx20 = zchx20*wmchx2
+ yco0 = zco0 * wmco
+ yo20 = zo20*wmo2
+ yn20 = zn20*wmn2
+ yco20 = zco20*wmco2
+ yh2o0 = zh2o0*wmh2o
+ somm = ychx10 + ychx20 + yco0 + yo20 + yn20 + &
+ yco20 + yh2o0
+ if (abs(somm-1.d0).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMME0', SOMM
+ write(NFECRA,*) 'F1M',F1M(IEL)
+ write(NFECRA,*) 'F2M',F2M(IEL)
+ write(NFECRA,*) 'F3M',F3M(IEL)
+ write(NFECRA,*) 'F4M',F4M(IEL)
+ endif
+#endif
+! ---- Fin test
+
+! --> Calcul de la composition du melange
+
+ anu1 = 0.25d0*(cx1m-cx2m)
+ reac1 = min(zchx10, (zo20/anu1))
+ zchx11 = zchx10 - reac1
+ zo21 = zo20 - anu1*reac1
+ zchx21 = zchx20 + reac1
+ zco1 = zco0
+ zco21 = zco20
+ zh2o1 = zh2o0 + 2.d0*anu1*reac1
+ zn21 = zn20
+
+ anu2 = 0.25d0*(2.d0 + cx2m)
+ reac2 = min(zchx21, (zo21/anu2))
+ zchx12 = zchx11
+ zchx22 = zchx21 - reac2
+ zo22 = zo21 - anu2*reac2
+ zco2 = zco1 + reac2
+ zco22 = zco21
+ zh2o2 = zh2o1 + .5d0*cx2m*reac2
+ zn22 = zn21
+
+ anu3 = 0.5d0
+ reac3 = min(zco2, (zo22/anu3))
+ zchx13 = zchx12
+ zchx23 = zchx22
+ zo23 = zo22 - anu3*reac3
+ zco3 = zco2 - reac3
+ zco23 = zco22 + reac3
+ zh2o3 = zh2o2
+ zn23 = zn22
+
+ fuel1(iel) = zchx13 * wmchx1
+ fuel2(iel) = zchx23 * wmchx2
+ fuel3(iel) = zco3 * wmco
+ prod1(iel) = zco23 * wmco2
+ prod2(iel) = zh2o3 * wmh2o
+ oxyd(iel) = zo23 * wmo2
+ xiner(iel) = zn23 * wmn2
+
+! ---- Test
+#ifdef DEBUG
+ somm = fuel1(iel) + fuel2(iel) + fuel3(iel) &
+ + prod1(iel) + prod2(iel) &
+ + oxyd(iel) + xiner(iel)
+! IF (ABS(SOMM-1.D0).GT.EPSICP) THEN
+ if ( (abs(somm-1.d0).gt.epsicp) .or. &
+ (prod2(iel).lt.(-epzero) .or. &
+ prod2(iel).gt.(1.d0+epzero)) ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'INDPDF0',INDPDF(IEL)
+ write(NFECRA,*) 'F1M',F1M(IEL)
+ write(NFECRA,*) 'F2M',F2M(IEL)
+ write(NFECRA,*) 'F3M',F3M(IEL)
+ write(NFECRA,*) 'F4M',F4M(IEL)
+ sommf = f1m(iel) + f2m(iel) + f3m(iel) + f4m(iel)
+ write(NFECRA,*) 'SOMME F', SOMMF
+ write(NFECRA,*) 'AO2F4, AO2F3 ', AO2F4, AO2F3
+ write(NFECRA,*) 'ZCHX1, 0,1,2,3', &
+ zchx10,zchx11,zchx12,zchx13
+ write(NFECRA,*) 'ZCHX2, 0,1,2,3', &
+ zchx20,zchx21,zchx22,zchx23
+ write(NFECRA,*) 'ZCO, 0,1,2,3', &
+ zco0,zco1,zco2,zco3
+ write(NFECRA,*) 'ZCO2, 0,1,2,3', &
+ zco20,zco21,zco22,zco23
+ write(NFECRA,*) 'ZH2O, 0,1,2,3', &
+ zh2o0,zh2o1,zh2o2,zh2o3
+ write(NFECRA,*) 'ZO2, 0,1,2,3', &
+ zo20,zo21,zo22,zo23
+ write(NFECRA,*) 'ZN2, 0,1,2,3', &
+ zn20,zn21,zn22,zn23
+ write(NFECRA,*) 'Fuel1',FUEL1(IEL)
+ write(NFECRA,*) 'Fuel2',FUEL2(IEL)
+ write(NFECRA,*) 'Fuel3',FUEL3(IEL)
+ write(NFECRA,*) 'Oxyd',OXYD(IEL)
+ write(NFECRA,*) 'Iner',XINER(IEL)
+ write(NFECRA,*) 'Prod1',PROD1(IEL)
+ write(NFECRA,*) 'Prod2',PROD2(IEL)
+ write(NFECRA,*) 'SOMME Y', SOMM
+ endif
+#endif
+! ---- Fin Test
+
+ endif
+
+enddo
+
+
+
+!===============================================================================
+! 4. CALCUL DE LA COMPOSITION DU MELANGE AVEC LES PDF
+! ATTENTION : ON SE LIMITE POUR L'INSTANT A INDPDF = 3 SUPPORT (I4,M)
+!===============================================================================
+
+
+! --> I7 = I4 : F1I7 = F2I7 = F3I7 = 0
+! F4I7 = 1
+
+! --> RELATIONS SUR LE SUPPORT DE LA PDF
+! FJ = FJM + CJ*S avec CJ = (FJM-FJI7)/SI7 (J = 1 a 4)
+
+! Devectorisation de la boucle pour VPP 5000
+
+!CDIR NOVECTOR
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.3 ) then
+
+! --> Calculs preliminaires
+
+ cx1m = rtbmc(iel,ix1mc)
+ cx2m = rtbmc(iel,ix2mc)
+ wmchx1 = wmolat(iatc) + cx1m*wmolat(iath)
+ wmchx2 = wmolat(iatc) + cx2m*wmolat(iath)
+ achx1f1 = rtbmc(iel,ichx1f1)
+ achx2f2 = rtbmc(iel,ichx2f2)
+ acof1 = rtbmc(iel,icof1)
+ acof2 = rtbmc(iel,icof2)
+
+! ---- Calcul de F1I7, F2I7, F3I7
+
+ f1i7 = zero
+ f2i7 = zero
+ f3i7 = 1.d0 - f4i7(iel)
+
+! ----- Calcul de C1, C2, C3 et C4
+
+ cc1 = (f1i7 -f1m(iel)) / si7(iel)
+ cc2 = (f2i7 -f2m(iel)) / si7(iel)
+ cc3 = (f3i7 -f3m(iel)) / si7(iel)
+ cc4 = (f4i7(iel)-f4m(iel)) / si7(iel)
+
+! ---- Rq : les autres pointeurs sont deja definis dans cplecd.F
+
+! --> Initialisation
+
+ do ige = 1, (ngaze-2*ncharb)
+ zc(ige) = zero
+ enddo
+
+! --> Calculs des coefficients avant combustion phase gaz
+! ZC(IGE) = AC0(IGE) + BC0(IGE) * S
+
+ ac0(ichx1) = achx1f1*f1m(iel)
+ bc0(ichx1) = achx1f1*cc1
+ ac0(ichx2) = achx2f2*f2m(iel)
+ bc0(ichx2) = achx2f2*cc2
+ ac0(ico ) = acof1*f1m(iel)+acof2*f2m(iel) + &
+ acof3*f3m(iel)
+ bc0(ico ) = acof1*cc1 +acof2*cc2 + &
+ acof3*cc3
+ ac0(ico2 ) = zero
+ bc0(ico2 ) = zero
+ ac0(ih2o ) = zero
+ bc0(ih2o ) = zero
+ ac0(io2 ) = ao2f3*f3m(iel)+ao2f4*f4m(iel)
+ bc0(io2 ) = ao2f3*cc3 +ao2f4*cc4
+ ac0(in2 ) = an2f4*f4m(iel)
+ bc0(in2 ) = an2f4*cc4
+
+! ---- Test
+#ifdef DEBUG
+ wmole(ichx1) = wmchx1
+ wmole(ichx2) = wmchx2
+ somm = 0.d0
+ sommf = 0.d0
+ do ige = 1, (ngaze-2*ncharb)
+ somm = somm + ac0(ige)*wmole(ige)
+ sommf = sommf + bc0(ige)*wmole(ige)
+ enddo
+ if (abs(somm-1.d0).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'F4I7 ', F4I7(IEL)
+ write(NFECRA,*) 'SOMM AC0', SOMM
+ endif
+ if (abs(sommf).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMM BC0', SOMMF
+ endif
+#endif
+! ---- Fin Test
+
+! --> Les pics de Dirac sont situes dans des domaines
+! ou la reaction n'est pas possible (points froids)
+
+ do ige = 1, (ngaze-2*ncharb)
+ zc(ige) = dsi7(iel)*(ac0(ige)+bc0(ige)*si7(iel)) &
+ + dsi8(iel)*(ac0(ige)+bc0(ige)*si8(iel))
+ enddo
+
+! --> Initialisation des coefficients avant integration
+
+ do ige = 1, (ngaze-2*ncharb)
+ ac1(ige) = ac0(ige)
+ bc1(ige) = bc0(ige)
+ ac2(ige) = ac0(ige)
+ bc2(ige) = bc0(ige)
+ ac3(ige) = ac0(ige)
+ bc3(ige) = bc0(ige)
+ enddo
+
+! --> Integration dans le domaine hyper riche
+
+! Rq : On rajoute le test suivant CAR
+! si F1M = 0 alors le domaine hyper riche n'existe pas
+
+ if ( f1m(iel).gt.epsicp ) then
+
+ anu1 = 0.25d0*(cx1m-cx2m)
+ s1 = - (ac0(io2)-ac0(ichx1)*anu1) &
+ / (bc0(io2)-bc0(ichx1)*anu1)
+ sm1 = max(sdeb(iel),s1)
+ sm2 = sfin(iel)
+
+ do ige = 1, (ngaze-2*ncharb)
+ ai(ige) = ac0(ige)
+ bi(ige) = bc0(ige)
+ enddo
+ bi(ichx1) = (ac0(ichx1)+bc0(ichx1)*si8(iel))/(si8(iel)-s1)
+ ai(ichx1) = -s1*bi(ichx1)
+ ai(ichx2) = ac0(ichx2) + (ac0(ichx1)-ai(ichx1))
+ bi(ichx2) = bc0(ichx2) + (bc0(ichx1)-bi(ichx1))
+ ai(io2 ) = ac0(io2 ) - anu1*(ac0(ichx1)-ai(ichx1))
+ bi(io2 ) = bc0(io2 ) - anu1*(bc0(ichx1)-bi(ichx1))
+ ai(ih2o ) = ac0(ih2o ) + 2.d0*anu1*(ac0(ichx1)-ai(ichx1))
+ bi(ih2o ) = bc0(ih2o ) + 2.d0*anu1*(bc0(ichx1)-bi(ichx1))
+
+ if ( sm1.lt.sm2 ) then
+
+ do ige = 1, (ngaze-2*ncharb)
+ zc(ige) = zc(ige) &
+ + haut(iel)*(sm2-sm1)*(ai(ige)+.5d0*bi(ige)*(sm1+sm2))
+ enddo
+
+ endif
+
+ do ige = 1, (ngaze-2*ncharb)
+ ac1(ige) = ( ac0(ige)*s1-ai(ige)*si7(iel) + &
+ s1*si7(iel)*(bc0(ige)-bi(ige)) ) &
+ / ( s1-si7(iel) )
+ bc1(ige) = (ai(ige)+bi(ige)*s1-ac1(ige)) / s1
+ enddo
+
+! ---- Apres la premiere reaction, on se trouve hors du domaine hyper riche
+! CHX1 ne doit plus exister AC1(ICHX1) = BC1(ICHX1) = 0
+
+! ---- Test
+#ifdef DEBUG
+ somm = 0.d0
+ sommf = 0.d0
+ do ige = 1, (ngaze-2*ncharb)
+ somm = somm + ac1(ige)*wmole(ige)
+ sommf = sommf + bc1(ige)*wmole(ige)
+ enddo
+ if ( abs(ac1(ichx1)).gt.epsicp .or. &
+ abs(bc1(ichx1)).gt.epsicp ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'AC1(ICHX1)', AC1(ICHX1)
+ write(NFECRA,*) 'BC1(ICHX1)', BC1(ICHX1)
+ endif
+ if ( abs(somm-1.d0).gt.epsicp ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMM AC1', SOMM
+ endif
+ if ( abs(sommf).gt.epsicp ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMM BC1', SOMMF
+ endif
+ if ( abs(ac1(io2)+bc1(io2)*s1).gt.epsicp ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'AC01(IO2)', AC0(IO2),AC1(IO2)
+ write(NFECRA,*) 'BC01(IO2)', BC0(IO2),BC1(IO2)
+ endif
+#endif
+! ---- Fin Test
+
+ endif
+
+! --> Integration dans le domaine riche
+
+ anu2 = 0.25d0*(2.d0 + cx2m)
+ s2 = - (ac1(io2)-ac1(ichx2)*anu2) &
+ / (bc1(io2)-bc1(ichx2)*anu2)
+
+ sm1 = max(sdeb(iel),s2)
+ sm2 = min(sfin(iel),s1)
+
+ do ige = 1, (ngaze-2*ncharb)
+ ai(ige) = ac1(ige)
+ bi(ige) = bc1(ige)
+ enddo
+
+ bi(ichx2) = (ac1(ichx2)+bc1(ichx2)*s1)/(s1-s2)
+ ai(ichx2) = -s2*bi(ichx2)
+ ai(io2 ) = ac1(io2 ) - anu2*(ac1(ichx2)-ai(ichx2))
+ bi(io2 ) = bc1(io2 ) - anu2*(bc1(ichx2)-bi(ichx2))
+ ai(ico ) = ac1(ico ) + (ac1(ichx2)-ai(ichx2))
+ bi(ico ) = bc1(ico ) + (bc1(ichx2)-bi(ichx2))
+ ai(ih2o ) = ac1(ih2o) + .5d0*cx2m*(ac1(ichx2)-ai(ichx2))
+ bi(ih2o ) = bc1(ih2o) + .5d0*cx2m*(bc1(ichx2)-bi(ichx2))
+
+ if ( sm1.lt.sm2 ) then
+
+ do ige = 1, (ngaze-2*ncharb)
+ zc(ige) = zc(ige) &
+ + haut(iel)*(sm2-sm1)*(ai(ige)+.5d0*bi(ige)*(sm1+sm2))
+ enddo
+
+ endif
+
+ do ige = 1, (ngaze-2*ncharb)
+! AC2(IGE) = (AC1(IGE)*S2-AI(IGE)*SI7(IEL)) +
+! & S2*SI7(IEL)*(BC1(IGE)-BI(IGE))/(S2-SI7(IEL))
+! BC2(IGE) = (AI(IGE)+BI(IGE)*S2-AC2(IGE))/(S2-SI7(IEL))
+ ac2(ige) = ( ac1(ige)*s2-ai(ige)*si7(iel) + &
+ s2*si7(iel)*(bc1(ige)-bi(ige)) ) &
+ / ( s2-si7(iel) )
+ bc2(ige) = (ai(ige)+bi(ige)*s2-ac2(ige)) / s2
+ enddo
+
+! ---- Apres la seconde reaction, on se trouve hors du domaine riche
+! CHX1 et CHX2 ne doivent plus exister
+! AC2(ICHX1) = BC2(ICHX1) = AC2(ICHX2) = BC2(ICHX2) = 0
+
+! ---- Test
+#ifdef DEBUG
+ somm = 0.d0
+ sommf = 0.d0
+ do ige = 1, (ngaze-2*ncharb)
+ somm = somm + ac2(ige)*wmole(ige)
+ sommf = sommf + bc2(ige)*wmole(ige)
+ enddo
+ if (abs(ac2(ichx1)).gt.epsicp .or. &
+ abs(bc2(ichx1)).gt.epsicp .or. &
+ abs(ac2(ichx2)).gt.epsicp .or. &
+ abs(bc2(ichx2)).gt.epsicp ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'AC2(ICHX1)', AC2(ICHX1)
+ write(NFECRA,*) 'BC2(ICHX1)', BC2(ICHX1)
+ write(NFECRA,*) 'AC2(ICHX2)', AC2(ICHX2)
+ write(NFECRA,*) 'BC2(ICHX2)', BC2(ICHX2)
+ endif
+ if (abs(somm-1.d0).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMM AC2', SOMM
+ endif
+ if (abs(sommf).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMM BC2', SOMMF
+ endif
+ if (abs(ac2(io2)+bc2(io2)*s2).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'AC12(IO2)', AC1(IO2),AC2(IO2)
+ write(NFECRA,*) 'BC12(IO2)', BC1(IO2),BC2(IO2)
+ endif
+#endif
+! ---- Fin Test
+
+! --> Integration dans le domaine intermediaire
+
+ anu3 = 0.5d0
+ s3 = - (ac2(io2)-ac2(ico)*anu3) &
+ / (bc2(io2)-bc2(ico)*anu3)
+
+ sm1 = max(sdeb(iel),s3)
+ sm2 = min(sfin(iel),s2)
+
+ do ige = 1, (ngaze-2*ncharb)
+ ai(ige) = ac2(ige)
+ bi(ige) = bc2(ige)
+ enddo
+
+ bi(ico) = (ac2(ico)+bc2(ico)*s2)/(s2-s3)
+ ai(ico) = -s3*bi(ico)
+ ai(io2) = ac2(io2 ) - anu3*(ac2(ico)-ai(ico))
+ bi(io2) = bc2(io2 ) - anu3*(bc2(ico)-bi(ico))
+ ai(ico2) = ac2(ico2) + (ac2(ico)-ai(ico))
+ bi(ico2) = bc2(ico2) + (bc2(ico)-bi(ico))
+
+ if ( sm1.lt.sm2 ) then
+
+ do ige = 1, (ngaze-2*ncharb)
+ zc(ige) = zc(ige) &
+ + haut(iel)*(sm2-sm1)*(ai(ige)+.5d0*bi(ige)*(sm1+sm2))
+ enddo
+
+ endif
+
+ do ige = 1, (ngaze-2*ncharb)
+ ac3(ige) = ( ac2(ige)*s3-ai(ige)*si7(iel) + &
+ s3*si7(iel)*(bc2(ige)-bi(ige)) ) &
+ / ( s3-si7(iel) )
+ bc3(ige) = (ai(ige)+bi(ige)*s3-ac3(ige)) / s3
+ enddo
+
+! ---- Apres la troisieme reaction, om se trouve dans le domaine pauvre
+! CHX1,CHX2 et CO doivent etre nuls
+! AC3(ICHX1) = BC3(ICHX1) = 0
+! AC3(ICHX2) = BC3(ICHX2) = 0
+! AC3(ICO ) = BC3(ICO ) = 0
+
+! ---- Test
+#ifdef DEBUG
+ somm = 0.d0
+ sommf = 0.d0
+ do ige = 1, (ngaze-2*ncharb)
+ somm = somm + ac3(ige)*wmole(ige)
+ sommf = sommf + bc3(ige)*wmole(ige)
+ enddo
+ if (abs(ac3(ichx1)).gt.epsicp .or. &
+ abs(bc3(ichx1)).gt.epsicp .or. &
+ abs(ac3(ichx2)).gt.epsicp .or. &
+ abs(bc3(ichx2)).gt.epsicp .or. &
+ abs(ac3(ico)).gt.epsicp .or. &
+ abs(bc3(ico)).gt.epsicp ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'AC3(ICHX1)', AC3(ICHX1)
+ write(NFECRA,*) 'BC3(ICHX1)', BC3(ICHX1)
+ write(NFECRA,*) 'AC3(ICHX2)', AC3(ICHX2)
+ write(NFECRA,*) 'BC3(ICHX2)', BC3(ICHX2)
+ write(NFECRA,*) 'AC3(ICO)', AC3(ICO)
+ write(NFECRA,*) 'BC3(ICO)', BC3(ICO)
+ endif
+ if (abs(somm-1.d0).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMM AC3', SOMM
+ endif
+ if (abs(sommf).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'SOMM BC3', SOMMF
+ endif
+ if (abs(ac3(io2)+bc3(io2)*s3).gt.epsicp) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'AC23(IO2)', AC2(IO2),AC3(IO2)
+ write(NFECRA,*) 'BC23(IO2)', BC2(IO2),BC3(IO2)
+ endif
+#endif
+! ---- Fin Test
+
+! --> Integration dans le domaine pauvre
+
+ sm1 = sdeb(iel)
+ sm2 = min(sfin(iel),s3)
+
+ do ige = 1, (ngaze-2*ncharb)
+ ai(ige) = ac3(ige)
+ bi(ige) = bc3(ige)
+ enddo
+
+ if ( sm1.lt.sm2 ) then
+
+ do ige = 1, (ngaze-2*ncharb)
+ zc(ige) = zc(ige) &
+ + haut(iel)*(sm2-sm1)*(ai(ige)+.5d0*bi(ige)*(sm1+sm2))
+ enddo
+
+ endif
+
+ fuel1(iel) = zc(ichx1) * wmchx1
+ fuel2(iel) = zc(ichx2) * wmchx2
+ fuel3(iel) = zc(ico ) * wmco
+ prod1(iel) = zc(ico2 ) * wmco2
+ prod2(iel) = zc(ih2o ) * wmh2o
+ oxyd(iel) = zc(io2 ) * wmo2
+ xiner(iel) = zc(in2 ) * wmn2
+
+! ---- Test
+#ifdef DEBUG
+ somm = fuel1(iel) + fuel2(iel) + fuel3(iel) &
+ + prod1(iel) + prod2(iel) &
+ + oxyd(iel) + xiner(iel)
+ if ( (abs(somm-1.d0).gt.epsicp) .or. &
+ (prod2(iel).lt.(-epzero) .or. &
+ prod2(iel).gt.(1.d0+epzero)) ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'INDPDF3',INDPDF(IEL)
+ write(NFECRA,*) 'ACHX1F1',ACHX1F1
+ write(NFECRA,*) 'ACHX2F2',ACHX2F2
+ write(NFECRA,*) 'ACOF1',ACOF1
+ write(NFECRA,*) 'ACOF2',ACOF2
+ write(NFECRA,*) 'AO2F4',AO2F4
+ write(NFECRA,*) 'AO2F3',AO2F3
+ write(NFECRA,*) 'AN2F4',AN2F4
+ write(NFECRA,*) 'F1M',F1M(IEL)
+ write(NFECRA,*) 'F2M',F2M(IEL)
+ write(NFECRA,*) 'F3M',F3M(IEL)
+ write(NFECRA,*) 'F4M',F4M(IEL)
+ sommf = f1m(iel) + f2m(iel) + f3m(iel) + f4m(iel)
+ write(NFECRA,*) 'SOMME F', SOMMF
+ write(NFECRA,*) 'SI7 ',SI7(IEL)
+ write(NFECRA,*) 'SI8 ',SI8(IEL)
+ write(NFECRA,*) 'SDEB ',SDEB(IEL)
+ write(NFECRA,*) 'SFIN ',SFIN(IEL)
+ write(NFECRA,*) 'HAUT ',HAUT(IEL)
+ write(NFECRA,*) 'DSI7 ',DSI7(IEL)
+ write(NFECRA,*) 'DSI8 ',DSI8(IEL)
+ anu1 = 0.25d0*(cx1m-cx2m)
+ s1 = - (anu1*ac0(io2)-ac0(ichx1)) &
+ / (anu1*bc0(io2)-bc0(ichx1))
+ write(NFECRA,*) 'S1 ', S1
+ anu2 = 0.25d0*(2.d0 + cx2m)
+ s2 = - (anu2*ac1(io2)-ac1(ichx2)) &
+ / (anu2*bc1(io2)-bc1(ichx2))
+ write(NFECRA,*) 'S2 ', S2
+ anu3 = 0.5d0
+ s3 = - (anu3*ac2(io2)-ac2(ico)) &
+ / (anu3*bc2(io2)-bc2(ico))
+ write(NFECRA,*) 'S3 ', S3
+ mom0 = haut(iel)*(sfin(iel)-sdeb(iel)) &
+ + dsi8(iel)+dsi7(iel)
+ write(NFECRA,*) 'MOM0 ', MOM0, 1.D0
+ mom1 = haut(iel)*(sfin(iel)**2-sdeb(iel)**2)/2.d0 &
+ + dsi7(iel)*si7(iel)+dsi8(iel)*si8(iel)
+ write(NFECRA,*) 'MOM1 ', MOM1, 0.D0
+ mom2 = haut(iel)*(sfin(iel)**3-sdeb(iel)**3)/3.d0 &
+ + dsi7(iel)*si7(iel)**2+dsi8(iel)*si8(iel)**2
+ write(NFECRA,*) 'MOM2 ', MOM2, SP2M(IEL)
+ write(NFECRA,*) 'Fuel1',FUEL1(IEL)
+ write(NFECRA,*) 'Fuel2',FUEL2(IEL)
+ write(NFECRA,*) 'Fuel3',FUEL3(IEL)
+ write(NFECRA,*) 'Oxyd',OXYD(IEL)
+ write(NFECRA,*) 'Iner',XINER(IEL)
+ write(NFECRA,*) 'Prod1',PROD1(IEL)
+ write(NFECRA,*) 'Prod2',PROD2(IEL)
+ write(NFECRA,*) 'SOMME', SOMM
+ endif
+#endif
+! ---- Fin Test
+
+ endif
+
+enddo
+
+
+
+!===============================================================================
+! 5. IMPRESSION
+!===============================================================================
+
+n2 = 0
+n3 = 0
+n4 = 0
+n5 = 0
+n6 = 0
+n7 = 0
+n8 = 0
+n9 = 0
+n10 = 0
+n11 = 0
+n12 = 0
+n13 = 0
+n14 = 0
+n15 = 0
+n16 = 0
+n17 = 0
+n18 = 0
+n19 = 0
+n20 = 0
+n21 = 0
+n22 = 0
+n23 = 0
+n24 = 0
+n25 = 0
+n26 = 0
+n27 = 0
+n28 = 0
+n29 = 0
+n30 = 0
+n31 = 0
+n32 = 0
+
+! --> Controle des differentes valeurs des fractions massiques
+
+do iel = 1, ncel
+ somm = fuel1(iel) + fuel2(iel) + fuel3(iel) + oxyd(iel) &
+ + prod1(iel) + prod2(iel) + xiner(iel)
+ if ( fuel1(iel).lt.(-epzero) .or. &
+ fuel1(iel).gt.(1.d0+epzero) ) n14 = n14+1
+ if ( fuel2(iel).lt.(-epzero) .or. &
+ fuel2(iel).gt.(1.d0+epzero) ) n15 = n15+1
+ if ( fuel3(iel).lt.(-epzero) .or. &
+ fuel3(iel).gt.(1.d0+epzero) ) n16 = n16+1
+ if ( oxyd(iel).lt.(-epzero) .or. &
+ oxyd(iel).gt.(1.d0+epzero) ) n17 = n17+1
+ if ( xiner(iel).lt.(-epzero) .or. &
+ xiner(iel).gt.(1.d0+epzero) ) n18 = n18+1
+ if ( prod1(iel).lt.(-epzero) .or. &
+ prod1(iel).gt.(1.d0+epzero) ) n19 = n19+1
+ if ( prod2(iel).lt.(-epzero) .or. &
+ prod2(iel).gt.(1.d0+epzero) ) n20 = n20+1
+
+ if ( abs(somm-1.d0).lt.epsicp ) n3 = n3 +1
+enddo
+
+! --> Controle des parametres de la pdf
+
+do iel = 1, ncel
+ if ( indpdf(iel).ne.0 ) then
+ vars = sp2m(iel) / (-si7(iel)*si8(iel))
+ if ( vars.gt.epzero .and. &
+ vars.le.(1.-epzero) ) n2 = n2+1
+ if ( dsi7(iel).lt.epzero .and. dsi8(iel).lt.epzero ) &
+ n4 = n4+1
+ if ( dsi7(iel).gt.epzero .and. dsi8(iel).lt.epzero ) &
+ n5 = n5+1
+ if ( dsi7(iel).lt.epzero .and. dsi8(iel).gt.epzero ) &
+ n6 = n6+1
+ if ( dsi7(iel).gt.epzero .and. dsi8(iel).gt.epzero ) &
+ n7 = n7+1
+ if ( dsi7(iel).lt.(-epzero) ) n8 = n8+1
+ if ( dsi8(iel).lt.(-epzero) ) n9 = n9+1
+ if ( haut(iel).lt.(-epzero) ) n10 = n10+1
+ n27 = n27+1
+ if ( sdeb(iel).lt.si7(iel) .or. sdeb(iel).gt.si8(iel) ) &
+ n11 = n11+1
+ if ( sfin(iel).lt.si7(iel) .or. sfin(iel).gt.si8(iel) ) &
+ n12 = n12+1
+ if ( (sfin(iel)-sdeb(iel)).lt.zero ) n13 = n13+1
+ if ( indpdf(iel).eq.12 ) n28 = n28+1
+ if ( indpdf(iel).eq.2 ) n29 = n29+1
+ if ( indpdf(iel).eq.13 ) n31 = n31+1
+ if ( indpdf(iel).eq.11 ) n30 = n30+1
+ if ( indpdf(iel).eq.3 ) n32 = n32+1
+ if ( ipi7i8(iel).gt.10 .and. ipi7i8(iel).lt.15 ) n21 = n21+1
+ if ( ipi7i8(iel).gt.20 .and. ipi7i8(iel).lt.25 ) n22 = n22+1
+ if ( ipi7i8(iel).eq.11 .or. ipi7i8(iel).eq.21 ) n23 = n23+1
+ if ( ipi7i8(iel).eq.12 .or. ipi7i8(iel).eq.22 ) n24 = n24+1
+ if ( ipi7i8(iel).eq.13 .or. ipi7i8(iel).eq.23 ) n25 = n25+1
+ if ( ipi7i8(iel).eq.14 .or. ipi7i8(iel).eq.24 ) n26 = n26+1
+ endif
+enddo
+
+n1 = ncel
+
+if (irangp.ge.0) then
+ inttmp( 1) = n1
+ inttmp( 2) = n2
+ inttmp( 3) = n3
+ inttmp( 4) = n4
+ inttmp( 5) = n5
+ inttmp( 6) = n6
+ inttmp( 7) = n7
+ inttmp( 8) = n8
+ inttmp( 9) = n9
+ inttmp(10) = n10
+ inttmp(11) = n11
+ inttmp(12) = n12
+ inttmp(13) = n13
+ inttmp(14) = n14
+ inttmp(15) = n15
+ inttmp(16) = n16
+ inttmp(17) = n17
+ inttmp(18) = n18
+ inttmp(19) = n19
+ inttmp(20) = n20
+ inttmp(21) = n21
+ inttmp(22) = n22
+ inttmp(23) = n23
+ inttmp(24) = n24
+ inttmp(25) = n25
+ inttmp(26) = n26
+ inttmp(27) = n27
+ inttmp(28) = n28
+ inttmp(29) = n29
+ inttmp(30) = n30
+ inttmp(31) = n31
+ inttmp(32) = n32
+ call parism(nbrint,inttmp)
+ !==========
+endif
+
+write(nfecra,1000) n1 , n27
+write(nfecra,1100) n28, n29, n31, n30, n32, n21, n22, n23, &
+ n24, n25, n26
+write(nfecra,2000) n4 , n5 , n6 , n7
+write(nfecra,2100) n27, n2 , n8 , n9 , n10, n11, n12, n13
+write(nfecra,2200) n1 , n3 , n14, n15, n16, n17, n18, n19, n20
+
+!-------
+! FORMAT
+!-------
+
+ 1000 format (/, &
+'MODELISATION DE LA COMBUSTION AVEC LE MODELE DE DIFFUSION ', &
+'TURBULENTE (CPLYM1)',/, &
+'CHIMIE RAPIDE A 3 CORPS - EXTENSION A 3 COMBUSTIBLES ', &
+'(Application au CP)',/, &
+'==========================================================', &
+'==================',/, &
+' Nb de points de calculs = ',&
+ i9,/, &
+' Nb de points turbulents (passage par les PDF) = ',&
+ i9)
+
+ 1100 format( &
+! ..v.7..1....v ....2....v....3....v....4....v....5....v....6....v....7.I
+' Nb de points turbulents pour lesquels I7 app. [I4,L3] T12 = ',&
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I7 app. [I4,L5] T2 = ',&
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I7 app. [I4,L5] T13 = ',&
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I7 app. [L5,I3max] T11= ',&
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I7 = I4 T3 = ',&
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I7 domaine P = ', &
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I7 domaine I = ', &
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I8 domaine P = ', &
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I8 domaine I = ', &
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I8 domaine R = ', &
+ i9,/, &
+' - - - - - - - - - - - - pour lesquels I8 domaine HR = ', &
+ i9)
+
+ 2000 format( &
+'PDF CONJOINTE DEGENEREE EN PDF MONODIMENSIONNELLE',/, &
+' Nb de points PDF rectangle sans Dirac = ',I9,/,&
+' - - - - - - - - - - - - - et Dirac en I7 = ',I9,/,&
+' - - - - - - - - - - - - - et Dirac en I8 = ',I9,/,&
+' - - - - - - - - - - - - - et Diracs en I8 et I7 = ',I9)
+
+ 2100 format( &
+'CONTROLE DES PARAMETRES DE LA PDF',/, &
+' Nb de points turbulents (passage par les PDF) = ', &
+ i9,/, &
+' Nb de points turbulents pour lesquels VARS est physique = ', &
+ i9,/ &
+' Nb de points Dirac_I7, Dirac_I8, HAUT < 0 = ',I9,I9,I9,/,&
+' Nb de points Abs.Deb < SI7 ou > SI8 = ', I9,/, &
+' Nb de points Abs.Fin < SI7 ou > SI8 = ', I9,/, &
+' Nb de points (Abs.Fin-Abs.Deb) < 0 = ', I9)
+
+ 2200 format( &
+'CONTROLE DES VALEURS DES FRACTIONS MASSIQUES',/, &
+' Nb de points de calculs = ', &
+ i9,/, &
+' Nb de points de calculs qui respectent somme des Yi = 1 = ', &
+ i9,/, &
+' Nb de points YCHx1m,YCHx2m,YCO < 0 ou > 1 = ',I9,I9,I9,/, &
+' Nb de points YO2,YN2 < 0 ou > 1 = ',I9,I9,/, &
+' Nb de points YCO2,YH2O < 0 ou > 1 = ',I9,I9)
+
+
+return
+end
diff --git a/src/cplv/cppdf4.f90 b/src/cplv/cppdf4.f90
new file mode 100644
index 0000000..f4ceeed
--- /dev/null
+++ b/src/cplv/cppdf4.f90
@@ -0,0 +1,179 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cppdf4 &
+!================
+
+ ( ncelet , ncel , &
+ f1m , f2m , f3m , f4m , f4p2m , &
+ indpdf , &
+ si7 , si8 , sp2m , f4i7 )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DU TYPE DE PDF
+! PDF CONJOINTE DEGENERRE EN UNE PDF 1D DE TYPE RECTANGLE - DIRAC
+! SUPPORT (I7,I8) passant par M
+
+! --> RECONSTITUTION DE 4 MOMENTS : I7 = I4 et I8 = I6
+! -->
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! f1m ! tr ! <-- ! moyenne du traceur 1 (mv chz +co) !
+! f2m ! tr ! <-- ! moyenne du traceur 2 (mv cxhy +co) !
+! f3m ! tr ! <-- ! moyenne du traceur 3 (co c.het) !
+! f4m ! tr ! <-- ! moyenne du traceur 4 (air) !
+! f3p2m ! tr ! <-- ! variance du traceur 3 (co c.het) !
+! indpdf ! te ! <- ! passage par les pdf !
+! si7 ! tr ! <- ! abscisse curviligne au point i7 !
+! si8 ! tr ! <- ! abscisse curviligne au point i8 !
+! sp2m ! tr ! <- ! variance droite support !
+! f4i7 ! tr ! <- ! f4 au point i7 !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel
+integer indpdf(ncelet)
+
+double precision f1m(ncelet), f2m(ncelet), f3m(ncelet)
+double precision f4m(ncelet), f4p2m(ncelet)
+double precision si7(ncelet), si8(ncelet), sp2m(ncelet)
+double precision f4i7(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel
+
+double precision f1i7, f2i7, f3i7, f4i8, s2max, t1, t2
+double precision xf3max
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Parametres relatifs a la variance T1 et a la moyenne T2
+t1 = 1.d-04
+t2 = 5.d-03
+
+! --- Initialisation des tableaux
+
+do iel = 1, ncel
+ f4i7(iel) = 0.d0
+ si7(iel) = 0.d0
+ si8(iel) = 0.d0
+ sp2m(iel) = 0.d0
+ indpdf(iel) = 0.d0
+enddo
+
+
+!===============================================================================
+! 2. TYPE DE PDF
+! INDPDF = 0 : PAS DE PDF
+! INDPDF = 3 : SUPPORT (I7,I8)= (I4,M)
+!===============================================================================
+
+do iel = 1, ncel
+ if ( f4p2m(iel).gt.t1 .and. &
+ f4m(iel) .ge.t2 .and. f4m(iel).le.(1.d0-t2) ) then
+ indpdf(iel) = 3
+ else
+ indpdf(iel) = 0
+ endif
+enddo
+
+
+!===============================================================================
+! 3. CALCULS DES PARAMETRES DE LA PDF : SI7, SI8 et SP2M
+! CALCUL DE F4I7
+!===============================================================================
+
+xf3max = 2.d0*0.012d0 / (2.d0*0.028d0 + xsi*0.028d0)
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.3 ) then
+ f4i7(iel) = 1.d0
+ f1i7 = 0.d0
+ f2i7 = 0.d0
+ f3i7 = 0.d0
+ si7(iel) = - sqrt ( &
+ ( sqrt(6.d0)/2.d0*(f1m(iel)-f1i7) + &
+ sqrt(6.d0)/4.d0*(f2m(iel)+f3m(iel)-f2i7-f3i7) )**2 + &
+ ( 3.d0*sqrt(2.d0)/4.d0*(f2m(iel)-f2i7) + &
+ sqrt(2.d0)/4.d0*(f3m(iel)-f3i7) )**2 + &
+ ( f3m(iel)-f3i7 )**2 )
+ f4i8 = (1.d0-xf3max)*f3m(iel) &
+ / (f3m(iel)+xf3max*(1.d0-f3m(iel)-f4m(iel)))
+ si8(iel) = si7(iel)*(f4m(iel)-f4i8)/(f4m(iel)-f4i7(iel))
+ sp2m(iel) = f4p2m(iel)/(f4m(iel)-f4i7(iel))**2*(si7(iel))**2
+ s2max = -si7(iel)*si8(iel)
+ if (sp2m(iel).gt.s2max) indpdf(iel) = 0
+ endif
+
+enddo
+
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cppdfr.f90 b/src/cplv/cppdfr.f90
new file mode 100644
index 0000000..e162a84
--- /dev/null
+++ b/src/cplv/cppdfr.f90
@@ -0,0 +1,318 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cppdfr &
+!================
+
+ ( ncelet , ncel , &
+ indpdf , sc , sd , sp2m , &
+ dsc , dsd , sdeb , sfin , &
+ hrec )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES PARAMETRES DE LA PDF
+! PDF RECTANGLE - PICS DE DIRAC CENTREE PPl - AE
+
+! LE RESULTAT EST :
+! ---------------
+! CALCUL DES PARAMETRES ASSOCIES AUX FONCTIONS RECTANGLE - DIRAC
+
+! DSC contient le Dirac en SC
+! DSD - - - - - le Dirac en SD
+! SDEB - - - - - l'abcisse de debut du rectangle
+! SFIN - - - - - - - - - - - fin - - - - - - -
+! HREC - - - - - la hauteur du rectangle
+! INDPDF indique le passage ou non par la pdf
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! sp2m ! tr ! <-- ! variance de s !
+! sc ! tr ! <-- ! borne min de s !
+! sd ! tr ! <-- ! borne max de s !
+! dsc ! tr ! <- ! dirac en c !
+! dsd ! tr ! <- ! dirac en d !
+! sdeb ! tr ! <- ! abscisse debut rectangle !
+! sfin ! tr ! <- ! abscisse fin rectangle !
+! hrec ! tr ! <- ! hauteur rectangle !
+! indpdf ! tr ! <- ! indicateur passage ou non par pdf !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer indpdf(ncelet)
+
+double precision sp2m(ncelet)
+double precision sc(ncelet) , sd(ncelet)
+double precision dsc(ncelet) , dsd(ncelet)
+double precision sdeb(ncelet) , sfin(ncelet)
+double precision hrec(ncelet)
+
+
+! VARIABLES LOCALES
+
+integer iel
+integer n1 , n2 , n3 , n4 , n5
+#ifdef DEBUG
+double precision mom0 , mom1 , mom2
+#endif
+double precision t1 , t2 , t3 , epsi
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+epsi = 1.d-06
+! Parametre relatif a la variance
+t1 = 1.d-05
+! Parametre relatif a la moyenne
+t2 = 5.d-04
+! Parametre supplementaire
+t3 = sqrt(3.d0*t1)
+
+do iel = 1, ncel
+ if ( indpdf(iel).gt.0 ) then
+ if ( (sp2m(iel).lt.t1) .or. (abs(sd(iel)+sc(iel)).lt.t2) ) &
+ indpdf(iel) = 0
+ endif
+enddo
+
+
+!===============================================================================
+! 2. CALCUL DES PARAMETRES DE LA FONCTION DENSITE DE PROBABILITE
+
+! DONNEES POUR LES FONCTIONS RECTANGLES
+! SC contient la borne inferieure de S
+! SD - - - - la borne superieure de S
+! SP2M - - - - la variance de S
+! SM - - - - la moyenne de S = 0
+
+! SC -- DEB ---- 0 ---- FIN ---------- SD
+
+! PARAMETRES ASSOCIES AUX FONCTIONS RECTANGLES
+! DSC contient le pic de Dirac en C
+! DSD - - - - le pic de Dirac en D
+! SDEB - - - - l'abcisse de debut du rectangle
+! SFIN - - - - - - - - - - - fin - - - - - -
+! HREC - - - - la hauteur du rectangle
+! INDPDF - - - - le type de PDF : 2,3,11,12,13
+! (= 0 si pas de passage par les pdf)
+
+!===============================================================================
+
+do iel = 1, ncel
+
+ if (indpdf(iel).gt.0) then
+
+ if ( ( sd(iel) .ge.(-sc(iel)) .and. &
+ sp2m(iel).le.(sc(iel)**2)/3.d0 ) .or. &
+ ( sd(iel) .lt.(-sc(iel)) .and. &
+ sp2m(iel).le.(sd(iel)**2)/3.d0 ) ) then
+
+! --> Rectangle seul
+
+ hrec(iel) = sqrt(3.d0*sp2m(iel))
+! ATTENTION HREC n'est pas la hauteur du rectangle
+! mais un intermediaire de calcul
+ dsc(iel) = zero
+ dsd(iel) = zero
+ sdeb(iel) = - hrec(iel)
+ sfin(iel) = + hrec(iel)
+ elseif ( sd(iel) .ge.(-sc(iel)) .and. &
+ sp2m(iel).le.(-sc(iel)/3.d0*(sc(iel)+2.d0*sd(iel))) &
+ ) then
+
+! --> Rectangle et un Dirac en SC
+
+ sdeb(iel) = sc(iel)
+ sfin(iel) = (3.d0*sp2m(iel)+sdeb(iel)**2)/(-2.d0*sdeb(iel))
+ dsc(iel)= (sfin(iel)+sdeb(iel))/(sfin(iel)-sdeb(iel))
+ dsd(iel) = zero
+ elseif ( sd(iel) .lt.(-sc(iel)) .and. &
+ sp2m(iel).lt. (-sd(iel)/3.d0*(2.d0*sc(iel)+sd(iel))) &
+ ) then
+
+! --> Rectangle et un Dirac en SD
+
+ sfin(iel) = sd(iel)
+ sdeb(iel) = (3.d0*sp2m(iel)+sfin(iel)**2)/(-2.d0*sfin(iel))
+ dsd(iel) = (-sfin(iel)-sdeb(iel))/(sfin(iel)-sdeb(iel))
+ dsc(iel)= zero
+ else
+
+! --> Rectangle et deux Diracs en SC et SD
+
+ sdeb(iel) = sc(iel)
+ sfin(iel) = sd(iel)
+ dsd(iel) = (3.d0*sp2m(iel)+sdeb(iel)**2 &
+ +2.d0*sdeb(iel)*sfin(iel)) &
+ / ((sfin(iel)-sdeb(iel))**2)
+ dsc(iel)= dsd(iel)+(sfin(iel)+sdeb(iel)) &
+ /(sfin(iel)-sdeb(iel))
+
+ endif
+
+ if ( abs(sfin(iel)-sdeb(iel)).gt.epsi ) then
+ hrec(iel) = (1.d0-dsc(iel)-dsd(iel))/(sfin(iel)-sdeb(iel))
+ else
+ sdeb(iel) = min(sd(iel),max(sc(iel),-t3))
+ sfin(iel) = min(sd(iel),max(sc(iel),+t3))
+ hrec(iel) = (1.d0-dsc(iel)-dsd(iel))/(sfin(iel)-sdeb(iel))
+ endif
+
+ endif
+
+enddo
+
+
+!===============================================================================
+! 3. IMPRESSION
+!===============================================================================
+
+n1 = 0
+n2 = 0
+n3 = 0
+n4 = 0
+n5 = 0
+
+do iel = 1, ncel
+ if ( indpdf(iel).ne.0 ) n1 = n1+1
+ if ( indpdf(iel).eq.3 ) n2 = n2+1
+ if ( indpdf(iel).eq.12 ) n3 = n3+1
+ if ( indpdf(iel).eq.13 ) n4 = n4+1
+ if ( indpdf(iel).eq.11 ) n5 = n5+1
+
+! ---- Test
+#ifdef DEBUG
+ if ( indpdf(iel).ne.0 ) then
+ mom0 = hrec(iel)*(sfin(iel)-sdeb(iel)) &
+ + dsc(iel)+dsd(iel)
+ if ( abs(mom0-1.d0).gt.epsi ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'MOM0 VC VA', MOM0, 1.D0
+ endif
+ mom1 = hrec(iel)*(sfin(iel)**2-sdeb(iel)**2)/2.d0 &
+ + dsc(iel)*sc(iel)+dsd(iel)*sd(iel)
+ if ( mom1.gt.epsi ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'MOM1 VC VA', MOM1, 0.D0
+ endif
+ mom2 = hrec(iel)*(sfin(iel)**3-sdeb(iel)**3)/3.d0 &
+ + dsc(iel)*sc(iel)**2+dsd(iel)*sd(iel)**2
+ if ( abs(mom2-sp2m(iel)).gt.epsi ) then
+ write(NFECRA,*) 'PB CELLULE ',IEL
+ write(NFECRA,*) 'MOM2 VC VA', MOM2, SP2M(IEL)
+ endif
+ endif
+#endif
+! ---- Fin Test
+
+enddo
+
+if (irangp.ge.0) then
+ call parcpt (n1)
+ !==========
+ call parcpt (n2)
+ !==========
+ call parcpt (n3)
+ !==========
+ call parcpt (n4)
+ !==========
+ call parcpt (n5)
+ !==========
+endif
+
+write(nfecra,1000) ncel, n1, n2, n3, n4, n5
+
+
+!----
+! FORMATS
+!----
+
+ 1000 format (/, &
+'CONTROLE DES PARAMETRES DANS CPPDFR.F',/, &
+'======================================',/, &
+' Nb de points de calculs = ', &
+ i6,/, &
+' Nb de points turbulents (passage par les PDF) = ', &
+ i6,/, &
+! ..v.7..1....v ....2....v....3....v....4....v....5....v....6....v....7.I
+' Nb de points turbulents pour lesquels support PDF = I4M = ', &
+ i6,/, &
+' Nb de points turbulents pour lesquels C app. [I4,L3] = ', &
+ i6,/, &
+' - - - - - - - - - - - - pour lesquels C app. [I4,L5] = ', &
+ i6,/, &
+' - - - - - - - - - - - - pour lesquels C app. [L5,I3max] = ', &
+ i6)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpphy1.f90 b/src/cplv/cpphy1.f90
new file mode 100644
index 0000000..360e5ac
--- /dev/null
+++ b/src/cplv/cpphy1.f90
@@ -0,0 +1,437 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpphy1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ nitbcp , nrtbcp , nitbmc , nrtbmc , nitbwo , nrtbwo , &
+ f1m , f2m , f3m , f4m , f5m , &
+ f6m , f7m , f4p2m , f3max , &
+ enth , &
+ rtp , propce , rom1 , &
+ itbcp , rtbcp , &
+ itbmc , rtbmc , &
+ itbwo , rtbwo )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE GAZEUSE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE, MASSE VOLUMIQUE ET CONCENTRATIONS MOYENNES
+! (UTILISATION D'UNE PDF RECTANGLE-DIRAC)
+
+! ==> CHIMIE RAPIDE MODELE EN 3 POINTS
+! EXTENSION A TROIS COMBUSTIBLES POUR LE CHARBON PULVERISE
+! --------------------
+
+! REACTIONS HETEROGENES
+! - Pyrolyse
+! Composition elementaire de la mole de matieres volatiles
+! Le charbon reactif s'ecrit C(1)H(ALPHA)O(BETA)
+
+! -(k1)-> ALPHA/4 CH4 + BETA CO + (1-ALPHA/4-BETA) Coke
+! Charbon reactif
+! -(k2)-> ALPHA/Y CXHY + BETA CO + (1-ALPHA/RYSX-BETA) Coke
+
+! Avec RYSX = Y/X
+
+! - Combustion heterogene
+
+! Coke + 1/2 (O2 + XSI N2) -> CO + XSI/2 N2
+
+! - Reactions en phase gaz
+
+! (4/(4-RYSX)) CH4 + (O2 + XSI N2) -(1)-> 4/X/(4-RYSX)*CXHY + 2 H2O
+! + XSI N2
+! CXHY + X/4*(2+RYSX) (O2 + XSI N2) -(2)-> X CO + Y/2 H2O
+! + X/4*(2+RYSX)*XSI N2
+! CO + 1/2 (O2 + XSI N2) -(3)-> CO2 + XSI/2 N2
+
+! CHOIX DES VARIABLES
+
+! F1 est la fractions massique des matieres volatiles : CH4 + CO
+! F2 est la fractions massique des matieres volatiles : CXHY + CO
+! F3 est la fraction massique de carbone venant de la combustion
+! heterogene
+
+! Soit Y les fractions massiques et Z les concentrations (moles/kg)
+! indice f avant reaction, b final
+
+! PDF CONJOINTE DEGENERE EN UNE PDF 1D DE TYPE RECTANGLE - DIRAC
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nitbcp ! e ! <-- ! taille du macro tableau cp entiers !
+! nrtbcp ! e ! <-- ! taille du macro tableau cp reels !
+! nitbmc ! e ! <-- ! taille du macro tableau mc entiers !
+! nrtbmc ! e ! <-- ! taille du macro tableau mc reels !
+! nitbwo ! e ! <-- ! taille du macro tableau work entiers !
+! nrtbwo ! e ! <-- ! taille du macro tableau work reels !
+! pa ! tr ! <-- ! pression absolue en pascals !
+! f1m ! tr ! <-- ! moyenne du traceur 1 mvl [chx1+co] !
+! f2m ! tr ! <-- ! moyenne du traceur 2 mvl [chx2+co] !
+! f3m ! tr ! <-- ! moyenne du traceur 3 (co c.het) !
+! f4m ! tr ! <-- ! moyenne du traceur 4 (air) !
+! f4m ! tr ! <-- ! moyenne du traceur 5 (h2o) !
+! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
+! enth ! tr ! <-- ! enthalpie en j/kg soit du gaz !
+! ! ! ! soit du melange !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! itbcp ! tr ! <-- ! macro tableau entier cp travail !
+! rtbcp ! tr ! <-- ! macro tableau reel cp travail !
+! itbmc ! tr ! <-- ! macro tableau entier mc travail !
+! rtbmc ! tr ! <-- ! macro tableau reel mc travail !
+! itbwo ! tr ! <-- ! macro tableau entier travail !
+! rtbwo ! tr ! <-- ! macro tableau reel travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+integer nitbcp , nrtbcp
+integer nitbmc , nrtbmc
+integer nitbwo , nrtbwo
+integer itbcp(ncelet,nitbcp)
+integer itbmc(ncelet,nitbmc)
+integer itbwo(ncelet,nitbwo)
+
+double precision f1m(ncelet), f2m(ncelet)
+double precision f3m(ncelet), f4m(ncelet) , f5m(ncelet)
+double precision f6m(ncelet), f7m(ncelet)
+double precision f4p2m(ncelet)
+double precision f3max(ncelet)
+double precision enth(ncelet)
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision rom1(ncelet)
+double precision rtbcp(ncelet,nrtbcp)
+double precision rtbmc(ncelet,nrtbmc)
+double precision rtbwo(ncelet,nrtbwo)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , iphas , ice
+integer iitbcp , iitbmc , iitbwo
+integer ipcte1
+integer ipcyf1 , ipcyf2 , ipcyf3 , ipcyox
+integer ipcyp1 , ipcyp2 , ipcyin , ipcyce
+integer ipdf , nbf3
+
+double precision wmolme , wmchx1 , wmchx2
+double precision f1cl , f2cl , f3cl , f4cl , f5cl
+double precision f6cl , f7cl
+double precision fp1 , fp2 , fp4 , fp5, fp6, fp7
+double precision xalpha , xbeta , xgam
+double precision f4cmin,f4cmax,xden
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Initialisation des tableaux d'entiers de travail
+
+do iel = 1, ncel
+ do iitbcp = 1, nitbcp
+ itbcp(iel,iitbcp) = 0
+ enddo
+ do iitbmc = 1, nitbmc
+ itbmc(iel,iitbmc) = 0
+ enddo
+ do iitbwo = 1, nitbwo
+ itbwo(iel,iitbwo) = 0
+ enddo
+enddo
+
+! --- Initialisation des tableaux de reels de travail
+
+do iel = 1, ncel
+ do iitbcp = 1, nrtbcp
+ rtbcp(iel,iitbcp) = zero
+ enddo
+ do iitbmc = 1, nrtbmc
+ rtbmc(iel,iitbmc) = zero
+ enddo
+ do iitbwo = 1, nrtbwo
+ rtbwo(iel,iitbwo) = zero
+ enddo
+enddo
+
+!===============================================================================
+! 2. DETERMINATION DU TYPE DE PDF
+!===============================================================================
+
+nbf3 = 0
+do iel = 1, ncel
+
+! Calcul de Fcl
+
+ if ( f1m(iel)+f2m(iel) .gt. 0.d0 ) then
+ fp1 = f1m(iel)/(f1m(iel)+f2m(iel))
+ fp2 = f2m(iel)/(f1m(iel)+f2m(iel))
+ else
+ fp1 = 0.d0
+ fp2 = 0.d0
+ endif
+ if (f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel) .gt. 0.d0 ) then
+ fp4 = f4m(iel)/(f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel))
+ fp5 = f5m(iel)/(f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel))
+ fp6 = f6m(iel)/(f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel))
+ fp7 = f7m(iel)/(f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel))
+ else
+ fp4 = 0.d0
+ fp5 = 0.d0
+ fp6 = 0.d0
+ fp7 = 0.d0
+ endif
+
+! Calcul de F3MAX
+
+ if ( ( ao2f4*f4m(iel)+ao2f6*f6m(iel) &
+ +ao2f7*f7m(iel) ) .gt. 0.d0 ) then
+ f3max(iel) = 1.d0 &
+ /(1.d0+0.5d0*(1.d0/wmolat(iatc)) &
+ *(f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel)) &
+ /(ao2f4*f4m(iel)+ao2f6*f6m(iel)+ao2f7*f7m(iel)) )
+ else
+ f3max(iel) = 1.d0
+ endif
+
+ if ( f3m(iel) .gt. f3max(iel) ) then
+ f3m(iel) = f3max(iel)
+ nbf3 = nbf3 + 1
+ endif
+
+ xden = f3m(iel)/f3max(iel)+f1m(iel)+f2m(iel)
+
+ if ( xden .gt. 1.d-15 ) then
+
+ xalpha = 1.d0-1.d0/xden
+
+ f1cl = (1.d0-xalpha)*f1m(iel)
+ f2cl = (1.d0-xalpha)*f2m(iel)
+ f3cl = (1.d0-xalpha)*f3m(iel)
+ f4cl = xalpha*fp4 + (1.d0-xalpha)*f4m(iel)
+ f5cl = xalpha*fp5 + (1.d0-xalpha)*f5m(iel)
+ f6cl = xalpha*fp6 + (1.d0-xalpha)*f6m(iel)
+ f7cl = xalpha*fp7 + (1.d0-xalpha)*f7m(iel)
+
+ else
+ f1cl = fp1
+ f2cl = fp2
+ f3cl = 0.d0
+ f4cl = 0.d0
+ f5cl = 0.d0
+ f6cl = 0.d0
+ f7cl = 0.d0
+ endif
+
+ rtbcp(iel,1) = f1cl
+ rtbcp(iel,2) = f2cl
+ rtbcp(iel,3) = f3cl
+ rtbcp(iel,4) = f4cl
+ rtbcp(iel,5) = f5cl
+ rtbcp(iel,6) = f6cl
+ rtbcp(iel,7) = f7cl
+
+! bornes min et max de la pdf : F4CL a 1
+
+ rtbcp(iel,8) = 1.d0
+
+! Somme de F4+F5
+
+ rtbcp(iel,14) = f4m(iel)+f5m(iel)+f6m(iel)+f7m(iel)
+
+enddo
+
+if ( irangp .ge. 0 ) then
+ call parcpt(nbf3)
+endif
+WRITE(NFECRA,*) ' Nombre de clipping sur F3 : ',NBF3
+
+call pppdfr &
+!==========
+ ( ncelet,ncel, &
+ itbcp(1,1) , &
+ rtbcp(1,14), f4p2m , &
+! F4+F5
+ rtbcp(1,4), rtbcp(1,8), &
+! FMINI FMAXI
+ rtbcp(1,9) , rtbcp(1,10) , rtbcp(1,11) , rtbcp(1,12), &
+! D4CL D4F4 F4M1 F4M2
+ rtbcp(1,13) )
+! HREC
+
+!===============================================================================
+! 2.CALCUL DES CONCENTRATIONS MOYENNES
+!===============================================================================
+
+
+ipcyf1 = ipproc(iym1(ichx1))
+ipcyf2 = ipproc(iym1(ichx2))
+ipcyf3 = ipproc(iym1(ico ))
+ipcyox = ipproc(iym1(io2 ))
+ipcyp1 = ipproc(iym1(ico2 ))
+ipcyp2 = ipproc(iym1(ih2o ))
+ipcyin = ipproc(iym1(in2 ))
+
+call cpcym2 &
+!==========
+ ( ncelet , ncel , nrtbmc , &
+ itbcp(1,1) , &
+! INTPDF
+ rtp , &
+ f1m , f2m , f3m , f4m , f5m , f6m , f7m , &
+ f3max , &
+ rtbcp(1,1),rtbcp(1,2),rtbcp(1,3),rtbcp(1,4),rtbcp(1,5), &
+! F1CL F2CL F3CL F4CL F5CL
+ rtbcp(1,6) , rtbcp(1,7) , &
+! F6CL F7CL
+ rtbcp(1,11) , rtbcp(1,12) , rtbcp(1,9) , &
+! F4M1 F4M2 D4CL
+ rtbcp(1,10) ,rtbcp(1,13) , &
+! D4F4 HREC
+ rtbmc , rtbwo(1,1) , &
+ propce(1,ipcyf1) , propce(1,ipcyf2) , propce(1,ipcyf3) , &
+ propce(1,ipcyox) , propce(1,ipcyp1) , propce(1,ipcyp2) , &
+ propce(1,ipcyin) )
+
+! --> Clipping eventuel des fractions massiques
+
+do iel = 1, ncel
+ do ice = 1, ngaze
+ ipcyce = ipproc(iym1(ice))
+ if ( abs(propce(iel,ipcyce)) .lt. epsicp ) &
+ propce(iel,ipcyce) = zero
+ enddo
+enddo
+
+!===============================================================================
+! 4. CALCUL DE LA TEMPERATURE ET DE LA MASSE VOLUMIQUE
+!===============================================================================
+
+ipcte1 = ipproc(itemp1)
+
+! --- Transport d'H2
+
+call cpteh1 &
+!==========
+ ( ncelet , ncel , nitbmc , nrtbmc , &
+ enth, &
+ propce(1,ipcyf1), propce(1,ipcyf2), propce(1,ipcyf3), &
+ propce(1,ipcyox), propce(1,ipcyp1), propce(1,ipcyp2), &
+ propce(1,ipcyin), &
+ propce(1,ipcte1), &
+ itbmc , rtbmc , &
+! MACRO TABLEAU MULTI CHARBONS ENTIERS REELS
+ rtbwo(1,1) , rtbwo(1,2) )
+! TABLEAUX DE TRAVAIL
+
+iphas = 1
+ipcte1 = ipproc(itemp1)
+do iel = 1, ncel
+ wmchx1 = wmolat(iatc)+rtbmc(iel,ix1mc)*wmolat(iath)
+ wmchx2 = wmolat(iatc)+rtbmc(iel,ix2mc)*wmolat(iath)
+ wmolme = propce(iel,ipcyf1)/wmchx1 &
+ + propce(iel,ipcyf2)/wmchx2 &
+ + propce(iel,ipcyf3)/wmole(ico ) &
+ + propce(iel,ipcyox)/wmole(io2 ) &
+ + propce(iel,ipcyp1)/wmole(ico2) &
+ + propce(iel,ipcyp2)/wmole(ih2o) &
+ + propce(iel,ipcyin)/wmole(in2 )
+
+! stockage de la masse molaire du melange
+
+ propce(iel,ipproc(immel)) = 1.d0 / wmolme
+
+! ---- On ne met pas la pression mecanique RTP(IEL,IPR(IPHAS))
+! mais P0(IPHAS)
+
+ rom1(iel) = p0(iphas) / (wmolme*rr*propce(iel,ipcte1))
+enddo
+
+!===============================================================================
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpphy2.f90 b/src/cplv/cpphy2.f90
new file mode 100644
index 0000000..2f46b42
--- /dev/null
+++ b/src/cplv/cpphy2.f90
@@ -0,0 +1,361 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpphy2 &
+!================
+
+ ( ncelet , ncel , &
+ rtp , propce )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
+! (CLASSES DE PARTICULES)
+! VALEURS CELLULES
+! ----------------
+
+! FRACTION MASSIQUE DE SOLIDE
+! ET CLIPPING EVENTUELS
+! DIAMETRE
+! MASSE VOLUMIQUE
+! ET CLIPPING EVENTUELS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+
+double precision rtp(ncelet,*) , propce(ncelet,*)
+
+! VARIABLES LOCALES
+
+integer nbrint
+parameter (nbrint=8)
+integer iel , icla , ipcro2 , ipcdi2
+integer n1 , n2 , n3 , n4 , n5 , n6
+integer n7 , n8 , ipcx2c
+integer inttmp(nbrint)
+
+double precision xch , dch , xnp , xck , dck , d1s3
+double precision xashcl , xuash
+double precision x2min , x2max , dckmin , dckmax
+double precision dchmin , dchmax , romin , romax , coedmi
+double precision ro2ini , roh2o
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+d1s3 = 1.d0/3.d0
+
+!===============================================================================
+! 2. CALCUL POUR CHAQUE CLASSE
+! DE LA FRACTION MASSIQUE DE SOLIDE
+! DU DIAMETRE DU COKE
+! DE LA MASSE VOLUMIQUE DU CHARBON
+!===============================================================================
+
+! --> Coefficient relatif au diametre de coke
+
+coedmi = 1.2d0
+
+do icla = 1, nclacp
+
+ n1 = 0
+ n2 = 0
+ n3 = 0
+ n4 = 0
+ n5 = 0
+ n6 = 0
+ n7 = 0
+ n8 = 0
+ x2min = grand
+ x2max = -grand
+ dchmin = grand
+ dchmax = -grand
+ dckmin = grand
+ dckmax = -grand
+ romin = grand
+ romax = -grand
+
+ do iel = 1, ncel
+
+ ipcx2c = ipproc(ix2(icla))
+ ipcro2 = ipproc(irom2(icla))
+ ipcdi2 = ipproc(idiam2(icla))
+ xck = rtp(iel,isca(ixck(icla)))
+ xch = rtp(iel,isca(ixch(icla)))
+ xnp = rtp(iel,isca(inp(icla)))
+ xashcl = xashch(ichcor(icla))
+ xuash = xnp*xmp0(icla)*(1.d0-xashcl)
+
+! --- Calcul de la fraction massique de solide
+
+ propce(iel,ipcx2c) = xch + xck + xnp*xmash(icla)
+
+! Prise en compte de l'humidite
+
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ propce(iel,ipcx2c) = propce(iel,ipcx2c) &
+ +rtp(iel,isca(ixwt(icla)))
+ endif
+
+
+! ---- Clipping eventuels pour la fraction massique de solide
+
+ if ( propce(iel,ipcx2c) .gt. (1.d0+epsicp) ) then
+ n1 = n1 + 1
+ x2max = max(propce(iel,ipcx2c),x2max)
+ propce(iel,ipcx2c) = 1.d0
+ else if ( propce(iel,ipcx2c) .lt. (zero-epsicp) ) then
+ n2 = n2 + 1
+ x2min = min(propce(iel,ipcx2c),x2min)
+ propce(iel,ipcx2c) = zero
+ endif
+
+
+! --- Initialisation
+
+ propce(iel,ipcro2) = rho20(icla)
+ propce(iel,ipcdi2) = diam20(icla)
+
+ if ( xuash.gt.epsicp ) then
+
+! --- Calcul du diametre du charbon reactif : Dch
+
+ dch = diam20(icla)*(xch/xuash)**d1s3
+
+! ---- Clipping eventuels pour le diametre du charbon reactif
+
+ if ( dch .gt. (diam20(icla)+epsicp) ) then
+ n3 = n3 + 1
+ dchmax = max(dch,dchmax)
+ dch = diam20(icla)
+ else if ( dch .lt. (zero-epsicp) ) then
+ n4 = n4 + 1
+ dchmin = min(dch,dchmin)
+ dch = zero
+ endif
+
+! --- Calcul du diametre du coke : Dck stocke ds PROPCE(IEL,IPCDI2)
+
+ dck = ( (xch/rho20(icla)+xck/rhock(ichcor(icla)))/ &
+ ((1.d0-xashcl)*pi/6.d0*xnp) )**d1s3
+
+! ---- Clipping eventuels pour le diametre du coke
+
+ if ( dck .gt. coedmi*diam20(icla) ) then
+ n5 = n5 + 1
+ dckmax = max(dck,dckmax)
+ dck = diam20(icla)*coedmi
+ else if ( dck .lt. (zero-epsicp) ) then
+ n6 = n6 + 1
+ dckmin = min(dck,dckmin)
+ dck = zero
+ endif
+ propce(iel,ipcdi2) = dck
+
+! --- Masse volumique
+
+ ro2ini = rho20(icla)
+! Prise en compte de l'humidite
+ if ( ippmod(icp3pl) .eq. 1 ) then
+! pour l'instant on suppose que ROH2O est constant
+ roh2o = 998.203
+ ro2ini = rho20(icla)+ rtp(iel,isca(ixwt(icla))) &
+ *roh2o
+ endif
+
+ propce(iel,ipcro2) = &
+ ( xashcl*diam20(icla)**3*rho20(icla) + &
+ (1.d0-xashcl)*(dck**3-dch**3)*rhock(ichcor(icla)) + &
+ (1.d0-xashcl)*dch**3*ro2ini ) / &
+ ( xashcl*diam20(icla)**3 + &
+ (1.d0-xashcl)*dck**3 )
+
+! ---- Clipping pour la masse volumique
+
+ if ( propce(iel,ipcro2) .gt. (ro2ini+epsicp) ) then
+ n7 = n7 + 1
+ romax = max(propce(iel,ipcro2),romax)
+ propce(iel,ipcro2) = rho20(icla)
+ endif
+ if ( propce(iel,ipcro2) .lt. (rhock(ichcor(icla))-epsicp) ) &
+ then
+ n8 = n8 + 1
+ romin = min(propce(iel,ipcro2),romin)
+ propce(iel,ipcro2) = rhock(ichcor(icla))
+ endif
+ endif
+
+ enddo
+
+ if (irangp.ge.0) then
+
+ inttmp(1) = n1
+ inttmp(2) = n2
+ inttmp(3) = n3
+ inttmp(4) = n4
+ inttmp(5) = n5
+ inttmp(6) = n6
+ inttmp(7) = n7
+ inttmp(8) = n8
+ call parism (nbrint,inttmp)
+ !==========
+ n1 = inttmp(1)
+ n2 = inttmp(2)
+ n3 = inttmp(3)
+ n4 = inttmp(4)
+ n5 = inttmp(5)
+ n6 = inttmp(6)
+ n7 = inttmp(7)
+ n8 = inttmp(8)
+
+ call parmax (x2max )
+ !==========
+ call parmax (dchmax)
+ !==========
+ call parmax (dckmax)
+ !==========
+ call parmax (romax )
+ !==========
+
+ call parmin (x2min )
+ !==========
+ call parmin (dchmin)
+ !==========
+ call parmin (dckmin)
+ !==========
+ call parmin (romin )
+ !==========
+ endif
+
+ if ( n1 .gt. 0 ) then
+ write(nfecra,1001) icla, n1, x2max
+ endif
+ if ( n2 .gt. 0 ) then
+ write(nfecra,1002) icla, n2, x2min
+ endif
+ if ( n3 .gt. 0 ) then
+ write(nfecra,1003) icla, n3, dchmax
+ endif
+ if ( n4 .gt. 0 ) then
+ write(nfecra,1004) icla, n4, dchmin
+ endif
+ if ( n5 .gt. 0 ) then
+ write(nfecra,1005) icla, n5, dckmax
+ endif
+ if ( n6 .gt. 0 ) then
+ write(nfecra,1006) icla, n6, dckmin
+ endif
+ if ( n7 .gt. 0 ) then
+ write(nfecra,1007) icla, n7, romax
+ endif
+ if ( n8 .gt. 0 ) then
+ write(nfecra,1008) icla, n8, romin
+ endif
+
+enddo
+
+!----
+! FORMATS
+!----
+
+ 1001 format(/,1X,' CLIPPING EN MAX DE LA FRM SOL. POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Max : ',G15.7)
+ 1002 format(/,1X,' CLIPPING EN MIN DE LA FRM SOL. POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Max : ',G15.7)
+ 1003 format(/,1X,' CLIPPING EN MAX DU DIAMETRE CH POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Max : ',G15.7)
+ 1004 format(/,1X,' CLIPPING EN MIN DU DIAMETRE CH POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Min : ',G15.7)
+ 1005 format(/,1X,' CLIPPING EN MAX DU DIAMETRE CK POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Max : ',G15.7)
+ 1006 format(/,1X,' CLIPPING EN MIN DU DIAMETRE CK POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Min : ',G15.7)
+ 1007 format(/,1X,' CLIPPING EN MAX DE LA MASSE VOL. POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Max : ',G15.7)
+ 1008 format(/,1X,' CLIPPING EN MIN DE LA MASSE VOL. POUR LA CLASSE ', &
+ I3,/,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Min : ',G15.7)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpphyv.f90 b/src/cplv/cpphyv.f90
new file mode 100644
index 0000000..7bbc874
--- /dev/null
+++ b/src/cplv/cpphyv.f90
@@ -0,0 +1,597 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ f3max , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ w9 , w10 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE : COMBUSTION CHARBON PULVERISE
+
+! Calcul de RHO du melange
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usppiv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision f3max(ncelet)
+
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision w9(ncelet),w10(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ntbcpi, icpwi, ntbcpr, icpwr
+integer ntbmci, imcwi, ntbmcr, imcwr
+integer ntbwoi, iwori, ntbwor, iworr
+integer ifinia, ifinra
+integer iel, icha, icla, iphas, ipcrom, ipcro2
+integer izone, ifac
+integer ipbrom, ipcx2c, iromf , ioxy
+
+double precision x1sro1, x2sro2, srrom1, uns1pw
+double precision x2tot, wmolme, unsro1
+double precision ff4min,ff4max
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 0. ON COMPTE LES PASSAGES
+!===============================================================================
+
+ipass = ipass + 1
+
+!===============================================================================
+! 1. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Initialisation des tableaux de travail
+
+do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+ w4(iel) = zero
+ w5(iel) = zero
+ w6(iel) = zero
+ w7(iel) = zero
+ w8(iel) = zero
+enddo
+
+! Pointeur sur masse volumique du gaz aux cellules
+iromf = ipproc(irom1)
+
+!===============================================================================
+! 2. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
+! VALEURS CELLULES
+! ----------------
+! FRACTION MASSIQUE DE SOLIDE
+! DIAMETRE
+! MASSE VOLUMIQUE
+!===============================================================================
+
+call cpphy2 &
+!==========
+ ( ncelet , ncel , &
+ rtp , propce )
+
+!===============================================================================
+! 3. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE GAZEUSE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE
+! MASSE VOLUMIQUE
+! CONCENTRATIONS DES ESPECES GAZEUSES
+!===============================================================================
+
+! --- Calcul de l'enthalpie du gaz dans W8
+! de F1M dans W2
+! de F2M dans W3
+! de F3M dans W4
+! de F4M dans W5
+! de F5M dans W6
+! de F4P2M dans W7
+
+! ---- W1 = - Somme des X2(i)
+
+do icla = 1, nclacp
+ ipcx2c = ipproc(ix2(icla))
+ do iel = 1, ncel
+ w1(iel) = w1(iel) - propce(iel,ipcx2c)
+ enddo
+enddo
+
+
+! ---- W2 = F1M = SOMME(F1M(ICHA))
+! W3 = F2M = SOMME(F2M(ICHA))
+! W4 = F3M
+! W6 = F5M
+! W9 = F6M
+! W10= F7M
+! W5 = F4M = 1. - F1M - F2M - F3M - F5M -F6M -F7M
+! W7 = F4P2M
+
+do icha = 1, ncharb
+ do iel = 1, ncel
+ w2(iel) = w2(iel) + rtp(iel,isca(if1m(icha)))
+ w3(iel) = w3(iel) + rtp(iel,isca(if2m(icha)))
+ enddo
+enddo
+
+ff4min = 1.d+20
+ff4max =-1.d+20
+do iel = 1, ncel
+
+ uns1pw = 1.d0/(1.d0+w1(iel))
+
+ w4(iel) = rtp(iel,isca(if3m))
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ w6(iel) = rtp(iel,isca(if5m))
+ else
+ w6(iel) = 0.d0
+ endif
+
+ if ( noxyd .ge. 2 ) then
+ w9(iel) = rtp(iel,isca(if6m))
+ if ( noxyd .eq. 3 ) then
+ w10(iel) = rtp(iel,isca(if7m))
+ else
+ w10(iel) = 0.d0
+ endif
+ else
+ w9(iel) = 0.d0
+ w10(iel) = 0.d0
+ endif
+
+ w5(iel) = 1.d0 &
+ -( w2(iel)+w3(iel)+w4(iel) &
+ +w6(iel)+w9(iel)+w10(iel))*uns1pw
+
+ ff4max = max(ff4max,w5(iel))
+ ff4min = min(ff4min,w5(iel))
+
+! IF ( W5(IEL) .LT. 0.D0 ) THEN
+! W5(IEL) = 0.D0
+! ENDIF
+
+ w2(iel) = w2(iel) *uns1pw
+ w3(iel) = w3(iel) *uns1pw
+ w4(iel) = w4(iel) *uns1pw
+ w6(iel) = w6(iel) *uns1pw
+ w9(iel) = w9(iel) *uns1pw
+ w10(iel)= w10(iel) *uns1pw
+
+ w7(iel) = rtp(iel,isca(if4p2m))*uns1pw
+
+enddo
+
+if ( irangp .ge. 0 ) then
+ call parmin(ff4min)
+ call parmax(ff4max)
+endif
+WRITE(NFECRA,*) ' Valeur min max de F4 : ',FF4MIN,FF4MAX
+
+! ---- W8 = H1 (transport de H2)
+! Transport d'H2
+
+do icla = 1, nclacp
+ do iel = 1, ncel
+ w8(iel) = w8(iel) - rtp(iel,isca(ih2(icla)))
+ enddo
+enddo
+do iel = 1, ncel
+ w8(iel) = (rtp(iel,isca(ihm))+w8(iel))/ ( 1.d0+w1(iel) )
+enddo
+
+! --- Gestion memoire
+! Autres tableaux
+
+! ------ Macro tableau d'entiers TBCPI : NTBCPI
+! Macro tableau de reels TBCPR : NTBCPR
+! Macro tableau d'entiers TBMCI : NTBMCI
+! Macro tableau de reels TBMCR : NTBMCR
+! Macro tableau d'entiers TBWOI : NTBWOI
+! Macro tableau de reels TBWOR : NTBWOR
+
+ntbcpi = 1
+ntbcpr = 15
+ntbmci = 0
+ntbmcr = 2 + 2*ncharb + 4
+! Ce sont en fait X1M, X2M,
+! F1M(ICHA) et F2M(ICHA) pour chaque charbon
+! ACHX1F1, ACHX2F2, ACOF1, ACOF2
+ntbwoi = 1
+ntbwor = 4
+
+call memcp1 &
+!==========
+ ( idebia , idebra , &
+ nvar , ncelet , ncel , nfac , nfabor , &
+ ntbcpi , icpwi , &
+ ntbcpr , icpwr , &
+ ntbmci , imcwi , &
+ ntbmcr , imcwr , &
+ ntbwoi , iwori , &
+ ntbwor , iworr , &
+ ifinia , ifinra )
+
+call cpphy1 &
+!==========
+ ( ifinia , ifinra , &
+ ncelet , ncel , &
+ ntbcpi , ntbcpr , ntbmci , ntbmcr , ntbwoi , ntbwor , &
+ w2 , w3 , w4 , w5 , w6 , &
+! F1M F2M F3M F4M F5M
+ w9 , w10 , w7 , f3max , &
+! F6M F7M F4P2M
+ w8 , &
+! ENTH
+ rtp , propce , propce(1,iromf) , &
+! ---------------- (masse vol. gaz)
+ ia(icpwi) , ra(icpwr) , &
+ ia(imcwi) , ra(imcwr) , &
+ ia(iwori) , ra(iworr) )
+
+!===============================================================================
+! 4. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE
+!===============================================================================
+
+! --- Transport d'H2
+
+call cpteh2 &
+!==========
+ ( ncelet , ncel , &
+ rtp , propce , &
+ w3 , w4 )
+
+!===============================================================================
+! 5. CALCUL DES PROPRIETES PHYSIQUES DU MELANGE
+! VALEURS CELLULES
+! ----------------
+! MASSE VOLUMIQUE
+!===============================================================================
+
+! --- W2 = - Somme des X2(i)
+
+do iel = 1, ncel
+ w2(iel) = zero
+enddo
+
+do icla = 1, nclacp
+ ipcx2c = ipproc(ix2(icla))
+ do iel = 1, ncel
+ w2(iel) = w2(iel) - propce(iel,ipcx2c)
+ enddo
+enddo
+
+! --- Calcul de Rho du melange : 1/Rho = X1/Rho1 + Somme(X2/Rho2)
+! On sous relaxe quand on a un rho n a disposition, ie
+! a partir du deuxieme passage ou
+! a partir du premier passage si on est en suite de calcul et
+! qu'on a relu la masse volumique dans le fichier suite.
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+
+if (ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+ srrom1 = srrom
+else
+ srrom1 = 0.d0
+endif
+
+do iel = 1, ncel
+ x2sro2 = zero
+ do icla = 1, nclacp
+ ipcro2 = ipproc(irom2(icla))
+ ipcx2c = ipproc(ix2(icla))
+ x2sro2 = x2sro2 + propce(iel,ipcx2c) / propce(iel,ipcro2)
+ enddo
+ x1sro1 = (1.d0+w2(iel)) / propce(iel,iromf)
+! ---- Sous relaxation eventuelle a donner dans ppini1.F
+ propce(iel,ipcrom) = srrom1*propce(iel,ipcrom) &
+ + (1.d0-srrom1)/(x1sro1+x2sro2)
+enddo
+
+
+!===============================================================================
+! 6. CALCUL DE RHO DU MELANGE
+
+! VALEURS FACETTES
+! ----------------
+!===============================================================================
+
+iphas = 1
+ibrom(iphas) = 1
+ipbrom = ipprob(irom(iphas))
+ipcrom = ipproc(irom(iphas))
+
+! ---> Masse volumique au bord pour toutes les facettes
+! Les facettes d'entree seront recalculees.
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbrom) = propce(iel,ipcrom)
+enddo
+
+! ---> Masse volumique au bord pour les facettes d'entree UNIQUEMENT
+! Le test sur IZONE sert pour les reprises de calcul
+
+if ( ipass.gt.1 .or. isuite.eq.1 ) then
+ do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+ if(izone.gt.0) then
+ if ( ientat(izone).eq.1 .or. ientcp(izone).eq.1 ) then
+ x2sro2 = zero
+ x2tot = zero
+ do icla = 1, nclacp
+ x2sro2 = x2sro2 + x20(izone,icla)/rho20(icla)
+ x2tot = x2tot + x20(izone,icla)
+ enddo
+
+ ioxy = inmoxy(izone)
+ wmolme =( oxyo2(ioxy)+oxyn2(ioxy) &
+ +oxyh2o(ioxy)+oxyco2(ioxy)) &
+ /( wmole(io2) *oxyo2(ioxy) &
+ +wmole(in2) *oxyn2(ioxy) &
+ +wmole(ih2o)*oxyh2o(ioxy) &
+ +wmole(ico2)*oxyco2(ioxy) )
+
+ unsro1 = (wmolme*rr*timpat(izone)) / p0(iphas)
+ x1sro1 = (1.d0-x2tot) * unsro1
+ propfb(ifac,ipbrom) = 1.d0 / (x1sro1+x2sro2)
+ endif
+ endif
+
+ enddo
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpprop.f90 b/src/cplv/cpprop.f90
new file mode 100644
index 0000000..955d227
--- /dev/null
+++ b/src/cplv/cpprop.f90
@@ -0,0 +1,283 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpprop &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT SELON
+! COMBUSTION CHARBON PULVERISE
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! <-- ! numero de la derniere propriete !
+! ! ! ! (les proprietes sont dans propce, !
+! ! ! ! propfa ou prpfb) !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppcpfu.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp, ipppst
+
+! VARIABLES LOCALES
+
+integer iprop, ige , icla, iprop2
+
+!===============================================================================
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+iprop = ipropp
+
+! Phase continue (melange gazeux)
+iprop = iprop + 1
+itemp1 = iprop
+iprop = iprop + 1
+irom1 = iprop
+do ige = 1, (ngaze-2*ncharb)
+! ---- Cf. definition de NGAZE dans cplecd.F
+ iprop = iprop + 1
+ iym1(ige) = iprop
+enddo
+iprop = iprop + 1
+immel = iprop
+
+iprop2 = iprop
+
+! Phase dispersee (classes de particules)
+do icla = 1, nclacp
+ iprop = iprop2 + icla
+ itemp2(icla) = iprop
+ iprop = iprop2 + 1*nclacp + icla
+ ix2(icla) = iprop
+ iprop = iprop2 + 2*nclacp + icla
+ irom2(icla) = iprop
+ iprop = iprop2 + 3*nclacp + icla
+ idiam2(icla) = iprop
+ iprop = iprop2 + 4*nclacp + icla
+ igmdch(icla) = iprop
+ iprop = iprop2 + 5*nclacp + icla
+ igmdv1(icla) = iprop
+ iprop = iprop2 + 6*nclacp + icla
+ igmdv2(icla) = iprop
+ iprop = iprop2 + 7*nclacp + icla
+ igmhet(icla) = iprop
+ if ( ihtco2 .eq. 1 ) then
+ iprop = iprop2 + 8*nclacp + icla
+ ighco2(icla) = iprop
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ iprop = iprop2 + 9*nclacp + icla
+ igmsec(icla) = iprop
+ endif
+ else
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ iprop = iprop2 + 8*nclacp + icla
+ igmsec(icla) = iprop
+ endif
+ endif
+enddo
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+nsalpp = iprop - ipropp
+nsalto = iprop
+
+! ---- On renvoie IPROPP au cas ou d'autres proprietes devraient
+! etre numerotees ensuite
+
+ipropp = iprop
+
+! ---> Positionnement dans le tableau PROPCE
+! et reperage du rang pour le post-traitement
+
+iprop = nproce
+
+! Phase continue (melange gazeux)
+iprop = iprop + 1
+ipproc(itemp1) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+iprop = iprop + 1
+ipproc(irom1) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+do ige = 1, (ngaze-2*ncharb)
+! ---- Cf. definition de NGAZE dans cplecd.F
+ iprop = iprop + 1
+ ipproc(iym1(ige)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+enddo
+
+iprop = iprop + 1
+ipproc(immel) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+iprop2 = iprop
+
+! Phase dispersee (classes de particules)
+do icla = 1, nclacp
+
+ iprop = iprop2 + icla
+ ipproc(itemp2(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 1*nclacp + icla
+ ipproc(ix2(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 2*nclacp + icla
+ ipproc(irom2(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 3*nclacp + icla
+ ipproc(idiam2(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 4*nclacp + icla
+ ipproc(igmdch(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 5*nclacp + icla
+ ipproc(igmdv1(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 6*nclacp + icla
+ ipproc(igmdv2(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 7*nclacp + icla
+ ipproc(igmhet(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ if ( ihtco2 .eq. 1 ) then
+ iprop = iprop2 + 8*nclacp + icla
+ ipproc(ighco2(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ iprop = iprop2 + 9*nclacp + icla
+ ipproc(igmsec(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+ else
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ iprop = iprop2 + 8*nclacp + icla
+ ipproc(igmsec(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+ endif
+
+enddo
+
+nproce = iprop
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+iprop = nprofb
+nprofb = iprop
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+iprop = nprofa
+nprofa = iprop
+
+
+! - Interface Code_Saturne
+! ======================
+! Construction de l'indirection entre la numerotation du noyau et XML
+if (iihmpr.eq.1) then
+ call uicppr (nclacp, nsalpp, nsalto, ippmod, icp3pl, ipppro, &
+ ipproc, ihtco2, itemp1, irom1, iym1, immel, &
+ itemp2, ix2, irom2, idiam2, igmdch, igmdv1, &
+ igmdv2, igmhet, ighco2, igmsec)
+
+endif
+
+return
+end
diff --git a/src/cplv/cpptcl.f90 b/src/cplv/cpptcl.f90
new file mode 100644
index 0000000..02325e8
--- /dev/null
+++ b/src/cplv/cpptcl.f90
@@ -0,0 +1,761 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpptcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! COMBUSTION CHARBON PULVERISE
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ii, iphas, ifac, izone, mode, iel, ige, iok
+integer icha, iclapc, isol, icla
+integer ipbrom, icke, idecal, ipcvis
+integer nbrval, ioxy
+double precision qisqc, viscla, d2s3, uref2, rhomoy, dhy, xiturb
+double precision ustar2, xkent, xeent, t1, t2, totcp , dmas
+double precision h1 (nozppm) , h2 (nozppm,nclcpm)
+double precision x2h20t(nozppm) , x20t (nozppm)
+double precision qimpc (nozppm) , qcalc(nozppm)
+double precision coefe (ngazem)
+double precision xsolid(nsolim)
+double precision f1mc (ncharm) , f2mc (ncharm)
+double precision wmh2o,wmco2,wmn2,wmo2
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+ipbrom = ipprob(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+d2s3 = 2.d0/3.d0
+
+
+
+
+!===============================================================================
+! 1. ECHANGES EN PARALLELE POUR LES DONNEES UTILISATEUR
+!===============================================================================
+
+! En realite on pourrait eviter cet echange en modifiant uscpcl et en
+! demandant a l'utilisateur de donner les grandeurs dependant de la
+! zone hors de la boucle sur les faces de bord : les grandeurs
+! seraient ainsi disponibles sur tous les processeurs. Cependant,
+! ca rend le sous programme utilisateur un peu plus complique et
+! surtout, si l'utilisateur le modifie de travers, ca ne marche pas.
+! On suppose que toutes les grandeurs fournies sont positives, ce qui
+! permet d'utiliser un max pour que tous les procs les connaissent.
+! Si ce n'est pas le cas, c'est plus complique mais on peut s'en tirer
+! avec un max quand meme.
+
+if(irangp.ge.0) then
+ call parimx(nozapm,iqimp )
+ !==========
+ call parimx(nozapm,ientat)
+ !==========
+ call parimx(nozapm,ientcp)
+ !==========
+ call parrmx(nozapm,qimpat)
+ !==========
+ call parrmx(nozapm,timpat)
+ !==========
+ nbrval = nozppm*ncharm
+ call parrmx(nbrval,qimpcp)
+ !==========
+ nbrval = nozppm*ncharm
+ call parrmx(nbrval,timpcp)
+ !==========
+ nbrval = nozppm*ncharm*ncpcmx
+ call parrmx(nbrval,distch)
+ !==========
+endif
+
+
+!===============================================================================
+! 2. CORRECTION DES VITESSES (EN NORME) POUR CONTROLER LES DEBITS
+! IMPOSES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+! --- Debit calcule
+
+do izone = 1, nozppm
+ qcalc(izone) = 0.d0
+enddo
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ qcalc(izone) = qcalc(izone) - propfb(ifac,ipbrom) * &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+enddo
+
+if(irangp.ge.0) then
+ call parrsm(nozapm,qcalc )
+endif
+
+do izone = 1, nozapm
+ if ( iqimp(izone).eq.0 ) then
+ qimpc(izone) = qcalc(izone)
+ endif
+enddo
+
+! --- Correction des vitesses en norme
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( iqimp(izone).eq.1 ) then
+ if(abs(qcalc(izone)).lt.epzero) then
+ write(nfecra,2001)izone,iqimp(izone),qcalc(izone)
+ iok = iok + 1
+ endif
+ endif
+enddo
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if ( iqimp(izone).eq.1 ) then
+ qimpc(izone) = qimpat(izone)
+ do icha = 1, ncharb
+ qimpc(izone) = qimpc(izone) + qimpcp(izone,icha)
+ enddo
+ qisqc = qimpc(izone)/qcalc(izone)
+ rcodcl(ifac,iu(iphas),1) = rcodcl(ifac,iu(iphas),1)*qisqc
+ rcodcl(ifac,iv(iphas),1) = rcodcl(ifac,iv(iphas),1)*qisqc
+ rcodcl(ifac,iw(iphas),1) = rcodcl(ifac,iw(iphas),1)*qisqc
+ endif
+
+enddo
+
+
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= CHARBON PULVERISE ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le debit est impose sur la zone IZONE = ', I10 ,/,&
+'@ puisque IQIMP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, le produit RHO D S integre est nul : ',/,&
+'@ il vaut = ',E14.5 ,/,&
+'@ (D est la direction selon laquelle est impose le debit).',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpcl, et en particulier ',/,&
+'@ - que le vecteur RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) qui determine',/,&
+'@ la direction de la vitesse est non nul et n''est pas ',/,&
+'@ uniformement perpendiculaire aux face d''entree ',/,&
+'@ - que la surface de l''entree n''est pas nulle (ou que ',/,&
+'@ le nombre de faces de bord dans la zone est non nul) ',/,&
+'@ - que la masse volumique n''est pas nulle ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 3. VERIFICATIONS
+! Somme des DISTributions CHarbon = 100% pour les zones IENTCP =1
+!===============================================================================
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( ientcp(izone).eq.1 ) then
+ do icha = 1, ncharb
+ totcp = 0.d0
+ do iclapc = 1, nclpch(icha)
+ totcp = totcp + distch(izone,icha,iclapc)
+ enddo
+ if(abs(totcp-100.d0).gt.epzero) then
+ write(nfecra,2010)
+ do iclapc = 1, nclpch(icha)
+ write(nfecra,2011)izone,icha,iclapc, &
+ distch(izone,icha,iclapc)
+ enddo
+ write(nfecra,2012)izone,ientcp(izone),icha, &
+ totcp,totcp-100.d0
+ iok = iok + 1
+ endif
+ enddo
+ endif
+enddo
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= CHARBON PULVERISE ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Zone Charbon Classe Distch(%) ' )
+ 2011 format( &
+'@ ',I10 ,' ',I10 ,' ',I10 ,' ',E14.5 )
+ 2012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= CHARBON PULVERISE ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ On impose une entree charbon en IZONE = ', I10 ,/,&
+'@ puisque IENTCP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, la somme des distributions par classe ',/,&
+'@ en pourcentage pour le charbon ICHA = ', I10 ,/,&
+'@ est differente de 100% : elle vaut TOTCP = ', E14.5 ,/,&
+'@ avec TOTCP-100 = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 4. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LA TURBULENCE
+
+!===============================================================================
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique de la turbulence
+
+ if ( icalke(izone).ne.0 ) then
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ + rcodcl(ifac,iv(iphas),1)**2 &
+ + rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ rhomoy = propfb(ifac,ipbrom)
+ iel = ifabor(ifac)
+ viscla = propce(iel,ipcvis)
+ icke = icalke(izone)
+ dhy = dh(izone)
+ xiturb = xintur(izone)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+ if (icke.eq.1) then
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscla, cmu, xkappa, &
+ ustar2, xkent, xeent )
+ else if (icke.eq.2) then
+ call keenin &
+ !==========
+ ( uref2, xiturb, dhy, cmu, xkappa, xkent, xeent )
+ endif
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LES SCALAIRES
+!===============================================================================
+
+do ii = 1, nzfppp
+
+ izone = ilzppp(ii)
+
+! Une entree IENTRE est forcement du type
+! IENTAT = 1 ou IENTCP = 1
+ if ( ientat(izone).eq.1 .or. ientcp(izone).eq.1) then
+
+ x20t (izone) = zero
+ x2h20t(izone) = zero
+
+ idecal = 0
+
+ do icha = 1, ncharb
+
+ do iclapc = 1, nclpch(icha)
+
+ icla = iclapc + idecal
+! ------ Calcul de X2 total par zone
+! Petite retouche au cas ou l'entree est fermee
+ if(abs(qimpc(izone)).lt.epzero) then
+ x20(izone,icla) = 0.d0
+ else
+ x20(izone,icla) = qimpcp(izone,icha)/qimpc(izone) &
+ * distch(izone,icha,iclapc)*1.d-2
+ endif
+ x20t(izone) = x20t(izone) + x20(izone,icla)
+! ------ Calcul de H2 de la classe ICLA
+ do isol = 1, nsolim
+ xsolid(isol) = zero
+ enddo
+ if ( ientcp(izone).eq.1 ) then
+ t2 = timpcp(izone,icha)
+ xsolid(ich(icha)) = 1.d0-xashch(icha)
+ xsolid(ick(icha)) = zero
+ xsolid(iash(icha)) = xashch(icha)
+
+! Prise en compte de l'humidite
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ xsolid(ich(icha)) = xsolid(ich(icha))-xwatch(icha)
+ xsolid(iwat(icha)) = xwatch(icha)
+ else
+ xsolid(iwat(icha)) = 0.d0
+ endif
+
+ else
+ t2 = timpat(izone)
+
+ xsolid(ich(icha)) = (1.d0-xashch(icha) &
+ -xwatch(icha))
+ xsolid(ick(icha)) = 0.d0
+ xsolid(iash(icha)) = xashch(icha)
+ xsolid(iwat(icha)) = xwatch(icha)
+
+ endif
+ mode = -1
+ t1 = t2
+ call cpthp2 &
+ !==========
+ ( mode , icla , h2(izone,icla) , xsolid , t2 , t1 )
+
+ x2h20t(izone) = x2h20t(izone) + &
+ x20(izone,icla)*h2(izone,icla)
+
+ enddo
+
+ idecal = idecal + nclpch(icha)
+
+ enddo
+
+! ------ Calcul de H1(IZONE)
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+
+ ioxy = inmoxy(izone)
+ dmas = wmole(io2) *oxyo2(ioxy) +wmole(in2) *oxyn2(ioxy) &
+ +wmole(ih2o)*oxyh2o(ioxy)+wmole(ico2)*oxyco2(ioxy)
+
+ coefe(io2) = wmole(io2) *oxyo2(ioxy) /dmas
+ coefe(ih2o) = wmole(ih2o)*oxyh2o(ioxy)/dmas
+ coefe(ico2) = wmole(ico2)*oxyco2(ioxy)/dmas
+ coefe(in2) = wmole(in2) *oxyn2(ioxy) /dmas
+
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ t1 = timpat(izone)
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , h1(izone) , coefe , f1mc , f2mc , &
+ t1 )
+
+ endif
+
+enddo
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique des scalaires physiques particulieres
+
+ idecal = 0
+
+ do icha = 1, ncharb
+
+ do iclapc = 1, nclpch(icha)
+
+ icla = iclapc + idecal
+! ------ CL pour Xch de la classe ICLA
+ rcodcl(ifac,isca(ixch(icla)),1) = x20(izone,icla) &
+ * (1.d0-xashch(icha))
+! Prise en compte de l'humidite
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ rcodcl(ifac,isca(ixch(icla)),1) = x20(izone,icla) &
+ *(1.d0-xashch(icha) &
+ -xwatch(icha))
+ endif
+! ------ CL pour Xck de la classe ICLA
+ rcodcl(ifac,isca(ixck(icla)),1) = 0.d0
+! ------ CL pour Np de la classe ICLA
+ rcodcl(ifac,isca(inp(icla)),1) = x20(izone,icla) &
+ / xmp0(icla)
+! ------ CL pour Xwater de la classe ICLA
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ rcodcl(ifac,isca(ixwt(icla)),1) = x20(izone,icla) &
+ *xwatch(icha)
+ endif
+! ------ CL pour H2 de la classe ICLA
+ rcodcl(ifac,isca(ih2(icla)),1) = x20(izone,icla) &
+ *h2(izone,icla)
+
+ enddo
+
+ idecal = idecal + nclpch(icha)
+
+! ------ CL pour X1F1M et X1F2M du charbon ICHA
+ rcodcl(ifac,isca(if1m(icha)),1) = zero
+ rcodcl(ifac,isca(if2m(icha)),1) = zero
+
+ enddo
+
+! ------ CL pour X1.F3M_O2
+ rcodcl(ifac,isca(if3m),1) = zero
+! ------ CL pour X1.F3M_CO2
+ if ( ihtco2 .eq. 1 ) then
+ rcodcl(ifac,isca(if3mc2),1) = zero
+ endif
+! ------ CL pour X1.FP4M
+ rcodcl(ifac,isca(if4p2m),1) = zero
+! ------ CL pour HM
+ rcodcl(ifac,isca(ihm),1) = (1.d0-x20t(izone))*h1(izone) &
+ + x2h20t(izone)
+! ------ CL pour X1.F5M
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ rcodcl(ifac,isca(if5m),1) = zero
+ endif
+! ------ CL pour X1.F6M
+ if ( noxyd .ge. 2 ) then
+ if ( inmoxy(izone) .eq. 2 ) then
+ rcodcl(ifac,isca(if6m),1) = (1.d0-x20t(izone))
+ else
+ rcodcl(ifac,isca(if6m),1) = zero
+ endif
+ endif
+! ------ CL pour X1.F7M
+ if ( noxyd .eq. 3 ) then
+ if ( inmoxy(izone) .eq. 3 ) then
+ rcodcl(ifac,isca(if7m),1) = (1.d0-x20t(izone))
+ else
+ rcodcl(ifac,isca(if7m),1) = zero
+ endif
+ endif
+
+! ------ CL pour X1.YCO2
+ if ( ieqco2 .ge. 1 ) then
+
+ ioxy = inmoxy(izone)
+ wmo2 = wmole(io2)
+ wmco2 = wmole(ico2)
+ wmh2o = wmole(ih2o)
+ wmn2 = wmole(in2)
+
+ dmas = ( oxyo2 (ioxy)*wmo2 +oxyn2 (ioxy)*wmn2 &
+ +oxyh2o(ioxy)*wmh2o+oxyco2(ioxy)*wmco2 )
+ xco2 = oxyco2(ioxy)*wmco2/dmas
+ rcodcl(ifac,isca(iyco2),1) = xco2*(1.d0-x20t(izone))
+ endif
+
+ endif
+
+enddo
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cprays.f90 b/src/cplv/cprays.f90
new file mode 100644
index 0000000..f278bc7
--- /dev/null
+++ b/src/cplv/cprays.f90
@@ -0,0 +1,139 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cprays &
+!================
+
+ ( ivar , ncelet , ncel , &
+ volume , propce , smbrs , rovsdt )
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME CHARBON PULVERISE
+! PRISE EN COMPTE DES TERMES SOURCES RADIATIFS
+! IMPLICITE ET EXPLICITE DANS L'EQUATION DES PARTICULES
+! DE LA CLASSE ICLA
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ivar ! e ! <-- ! numero de la variable scalaire !
+! ! ! ! energie (enthalpie h2) pour le !
+! ! ! ! charbon !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! volume(ncelet ! tr ! <-- ! volume des cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! smbrs(ncelet ! tr ! <-- ! second membre du systeme !
+! rovsdt(ncelet ! tr ! <-- ! diagonale du systeme !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "numvar.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ivar , ncelet, ncel
+
+double precision volume(ncelet)
+double precision smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision propce(ncelet,*)
+
+! VARIABLES LOCALES
+
+integer iel , numcla , ipcl
+
+!===============================================================================
+
+!===============================================================================
+! 1. RECHERCHE DE LA ZONE MEMOIRE (IPH) EN FONCTION DU NUMERO DE PHASE
+! COURANT IPHAS POUR TROUVER LES BONS TERMES SOURCES
+!===============================================================================
+
+numcla = ivar-isca(ih2(1))+1
+ipcl = 1+numcla
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES RADIATIFS
+!===============================================================================
+
+
+do iel = 1,ncel
+ propce(iel,ipproc(itsri(ipcl))) = max(-propce(iel,ipproc(itsri(ipcl))),zero)
+enddo
+
+do iel = 1,ncel
+ if ( propce(iel,ipproc(ix2(numcla))) .gt. epzero ) then
+
+!--> PARTIE EXPLICITE
+
+ smbrs(iel) = smbrs(iel) + propce(iel,ipproc(itsre(ipcl)))*volume(iel) &
+ *propce(iel,ipproc(ix2(numcla)))
+
+!--> PARTIE IMPLICITE
+
+ rovsdt(iel) = rovsdt(iel) + propce(iel,ipproc(itsri(ipcl)))*volume(iel)
+ endif
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cplv/cpteh1.f90 b/src/cplv/cpteh1.f90
new file mode 100644
index 0000000..1efb3b2
--- /dev/null
+++ b/src/cplv/cpteh1.f90
@@ -0,0 +1,335 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpteh1 &
+!================
+
+ ( ncelet , ncel , ntbmci , ntbmcr , &
+ eh , &
+ fuel1 , fuel2 , fuel3 , oxyd , prod1 , prod2 , &
+ xiner , &
+ tp , &
+ tbmci , tbmcr , &
+ eh0 , eh1 )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DU GAZ
+! EN FONCTION DE L'ENTHALPIE DU GAZ ET DES CONCENTRATIONS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! ntbmci ! e ! <-- ! taille du macro tableau mc entiers !
+! ntbmcr ! e ! <-- ! taille du macro tableau mc reels !
+! eh ! tr ! <-- ! enthalpie du gaz !
+! ! ! ! (j/kg de melange gazeux) !
+! fuel1 ! tr ! <-- ! fraction massique chx1 !
+! fuel2 ! tr ! <-- ! fraction massique chx2 !
+! fuel3 ! tr ! <-- ! fraction massique co !
+! oxyd ! tr ! <-- ! fraction massique o2 !
+! prod1 ! tr ! <-- ! fraction massique co2 !
+! prod2 ! tr ! <-- ! fraction massique h2o !
+! xiner ! tr ! <-- ! fraction massique n2 !
+! tp ! tr ! --> ! temperature du gaz (kelvin) !
+! tbmci ! tr ! <-- ! macro tableau entier mc travail !
+! tbmcr ! tr ! <-- ! macro tableau reel mc travail !
+! eh0 ! tr ! <-- ! tableau reel de travail !
+! eh1 ! tr ! <-- ! tableau reel de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer ntbmci , ntbmcr
+integer tbmci(ncelet,ntbmci)
+
+double precision eh(ncelet)
+double precision fuel1(ncelet), fuel2(ncelet), fuel3(ncelet)
+double precision oxyd(ncelet), xiner(ncelet)
+double precision prod1(ncelet),prod2(ncelet)
+double precision tp(ncelet)
+double precision tbmcr(ncelet,ntbmcr)
+double precision eh0(ncelet), eh1(ncelet)
+
+! VARIABLES LOCALES
+
+integer i, icel, icha
+
+double precision ychx10 , ychx20 , ehchx1 , ehchx2
+double precision den1 , den2
+
+!===============================================================================
+
+! RQ IMPORTANTE : Pour la definition des pointeurs pour TBMC
+! VOIR PPINI1.F
+
+i = npo-1
+do icel = 1, ncel
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m a TH(NPO)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i+1)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i+1)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i+1)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i+1)
+ endif
+
+! --- Clipping eventuel de TP a TH(NPO) si EH > EH1
+
+ eh1(icel) = fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i+1) &
+ + oxyd(icel) *ehgaze(io2 ,i+1) &
+ + prod1(icel)*ehgaze(ico2,i+1) &
+ + prod2(icel)*ehgaze(ih2o,i+1) &
+ + xiner(icel)*ehgaze(in2 ,i+1)
+
+ if ( eh(icel).ge.eh1(icel) ) tp(icel)= th(i+1)
+enddo
+
+
+
+i = 1
+do icel = 1, ncel
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m a TH(1)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+! --- Clipping eventuel de TP a TH(1) si EH < EH0
+
+ eh0(icel) = fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i) &
+ + oxyd(icel) *ehgaze(io2 ,i) &
+ + prod1(icel)*ehgaze(ico2,i) &
+ + prod2(icel)*ehgaze(ih2o,i) &
+ + xiner(icel)*ehgaze(in2 ,i)
+
+ if ( eh(icel).le.eh0(icel) ) tp(icel)= th(i)
+enddo
+
+
+do i = 1, npo-1
+ do icel = 1, ncel
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m pour TH(I)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+ eh0(icel) = fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i ) &
+ + oxyd(icel) *ehgaze(io2 ,i ) &
+ + prod1(icel)*ehgaze(ico2,i ) &
+ + prod2(icel)*ehgaze(ih2o,i ) &
+ + xiner(icel)*ehgaze(in2 ,i )
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m pour TH(I+1)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i+1)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i+1)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i+1)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i+1)
+ endif
+
+ eh1(icel) = fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i+1) &
+ + oxyd(icel) *ehgaze(io2 ,i+1) &
+ + prod1(icel)*ehgaze(ico2,i+1) &
+ + prod2(icel)*ehgaze(ih2o,i+1) &
+ + xiner(icel)*ehgaze(in2 ,i+1)
+
+ if ( eh(icel).ge.eh0(icel) .and. eh(icel).le.eh1(icel) ) then
+ tp(icel)= th(i) + (eh(icel)-eh0(icel)) * &
+ (th(i+1)-th(i))/(eh1(icel)-eh0(icel))
+ endif
+ enddo
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpteh2.f90 b/src/cplv/cpteh2.f90
new file mode 100644
index 0000000..fa53cef
--- /dev/null
+++ b/src/cplv/cpteh2.f90
@@ -0,0 +1,267 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpteh2 &
+!================
+
+ ( ncelet , ncel , &
+ rtp , propce , &
+ eh0 , eh1 )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DES PARTICULES
+! EN FONCTION DE L'ENTHALPIE DU SOLIDE ET DES CONCENTRATIONS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! eh0 ! tr ! <-- ! tableau reel de travail !
+! eh1 ! tr ! <-- ! tableau reel de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision eh0(ncelet), eh1(ncelet)
+
+! VARIABLES LOCALES
+
+integer i , icla , icha , icel
+integer ipcte1 , ipcte2
+integer ihflt2
+double precision h2 , x2 , xch , xck
+double precision xash , xnp , xtes , xwat
+
+!===============================================================================
+! RQ IMPORTANTE : On suppose pour l'instant que H2 = H02 + CP2(T2-TREF)
+
+ihflt2 = 1
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Initialisation des tableaux
+
+do icel = 1, ncel
+ eh0(icel) = zero
+ eh1(icel) = zero
+enddo
+
+! --- Initialisation de T2 a T1
+
+ipcte1 = ipproc(itemp1)
+do icla = 1, nclacp
+ ipcte2 = ipproc(itemp2(icla))
+ do icel = 1, ncel
+ propce(icel,ipcte2) = propce(icel,ipcte1)
+ enddo
+enddo
+
+!===============================================================================
+! 2. CALCUL DE LA TEMPERATURE DES PARTICULES
+!===============================================================================
+
+if ( ihflt2.eq.0 ) then
+
+! --> H2 fonction lineaire de T2
+
+ do icla = 1, nclacp
+ ipcte2 = ipproc(itemp2(icla))
+ icha = ichcor(icla)
+ do icel = 1, ncel
+ propce(icel,ipcte2) = &
+ (rtp(icel,isca(ih2(icla)))-h02ch(icha)) &
+ / cp2ch(icha) + trefth
+ enddo
+ enddo
+
+else
+
+! --> H2 tabule
+
+ do icla = 1, nclacp
+
+ ipcte2 = ipproc(itemp2(icla))
+
+ i = npoc-1
+ do icel = 1, ncel
+ xch = rtp(icel,isca(ixch(icla)))
+ xnp = rtp(icel,isca(inp(icla)))
+ xck = rtp(icel,isca(ixck(icla)))
+ xash = xmash(icla)*xnp
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ xwat = rtp(icel,isca(ixwt(icla)))
+ else
+ xwat = 0.d0
+ endif
+
+ x2 = xch + xck + xash + xwat
+
+ if ( x2 .gt. epsicp*100.d0 ) then
+
+ h2 = rtp(icel,isca(ih2(icla)))/x2
+
+ xtes = xmp0(icla)*xnp
+
+ if ( xtes.gt.epsicp .and. x2.gt.epsicp*100.d0 ) then
+ eh1(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i+1) &
+ + xck /x2 * ehsoli(ick(ichcor(icla) ),i+1) &
+ + xash/x2 * ehsoli(iash(ichcor(icla)),i+1) &
+ + xwat/x2 * ehsoli(iwat(ichcor(icla)),i+1)
+ if ( h2.ge.eh1(icel) ) then
+ propce(icel,ipcte2) = thc(i+1)
+
+ endif
+ endif
+
+ endif
+
+ enddo
+
+ i = 1
+ do icel = 1, ncel
+ xch = rtp(icel,isca(ixch(icla)))
+ xnp = rtp(icel,isca(inp(icla)))
+ xck = rtp(icel,isca(ixck(icla)))
+ xash = xmash(icla)*xnp
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ xwat = rtp(icel,isca(ixwt(icla)))
+ else
+ xwat = 0.d0
+ endif
+
+ x2 = xch + xck + xash + xwat
+
+ if ( x2 .gt. epsicp*100.d0 ) then
+
+ h2 = rtp(icel,isca(ih2(icla)))/x2
+
+ xtes = xmp0(icla)*xnp
+
+ if ( xtes.gt.epsicp .and. x2.gt.epsicp*100.d0 ) then
+ eh0(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i) &
+ + xck /x2 * ehsoli(ick(ichcor(icla) ),i) &
+ + xash/x2 * ehsoli(iash(ichcor(icla)),i) &
+ + xwat/x2 * ehsoli(iwat(ichcor(icla)),i)
+ if ( h2.le.eh0(icel) ) then
+ propce(icel,ipcte2) = thc(i)
+ endif
+ endif
+
+ endif
+
+ enddo
+
+ do i = 1, npoc-1
+ do icel = 1, ncel
+ xch = rtp(icel,isca(ixch(icla)))
+ xnp = rtp(icel,isca(inp(icla)))
+ xck = rtp(icel,isca(ixck(icla)))
+ xash = xmash(icla)*xnp
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ xwat = rtp(icel,isca(ixwt(icla)))
+ else
+ xwat = 0.d0
+ endif
+
+ x2 = xch + xck + xash + xwat
+
+ if ( x2 .gt. epsicp*100.d0 ) then
+
+ h2 = rtp(icel,isca(ih2(icla)))/x2
+
+ xtes = xmp0(icla)*xnp
+
+ if ( xtes.gt.epsicp .and. x2.gt.epsicp*100.d0 ) then
+ eh0(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i ) &
+ + xck /x2 * ehsoli(ick(ichcor(icla) ),i ) &
+ + xash/x2 * ehsoli(iash(ichcor(icla)),i ) &
+ + xwat/x2 * ehsoli(iwat(ichcor(icla)),i )
+
+ eh1(icel) = xch /x2 * ehsoli(ich(ichcor(icla) ),i+1) &
+ + xck /x2 * ehsoli(ick(ichcor(icla) ),i+1) &
+ + xash/x2 * ehsoli(iash(ichcor(icla)),i+1) &
+ + xwat/x2 * ehsoli(iwat(ichcor(icla)),i+1)
+
+ if ( h2.ge.eh0(icel) .and. h2.le.eh1(icel) ) then
+ propce(icel,ipcte2) = thc(i) + (h2-eh0(icel)) * &
+ (thc(i+1)-thc(i))/(eh1(icel)-eh0(icel))
+ endif
+ endif
+
+ endif
+
+ enddo
+ enddo
+
+ enddo
+
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cptehm.f90 b/src/cplv/cptehm.f90
new file mode 100644
index 0000000..a9280da
--- /dev/null
+++ b/src/cplv/cptehm.f90
@@ -0,0 +1,424 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cptehm &
+!================
+
+ ( ncelet , ncel , ntbmci , ntbmcr , &
+ eh , rtp , &
+ fuel1 , fuel2 , fuel3 , oxyd , prod1 , prod2 , &
+ xiner , &
+ tp , &
+ tbmci , tbmcr , &
+ eh0 , eh1 , x1 )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DU MELANGE
+! EN FONCTION DE L'ENTHALPIE DU MELANGE ET DES CONCENTRATIONS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! ntbmci ! e ! <-- ! taille du macro tableau mc entiers !
+! ntbmcr ! e ! <-- ! taille du macro tableau mc reels !
+! eh ! tr ! <-- ! enthalpie du gaz !
+! ! ! ! (j/kg de melange gazeux) !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! fuel1 ! tr ! <-- ! fraction massique chx1 !
+! fuel2 ! tr ! <-- ! fraction massique chx2 !
+! fuel3 ! tr ! <-- ! fraction massique co !
+! oxyd ! tr ! <-- ! fraction massique o2 !
+! prod1 ! tr ! <-- ! fraction massique co2 !
+! prod2 ! tr ! <-- ! fraction massique h2o !
+! xiner ! tr ! <-- ! fraction massique n2 !
+! tp ! tr ! --> ! temperature du melange (kelvin) !
+! tbmci ! tr ! <-- ! macro tableau entier mc travail !
+! tbmcr ! tr ! <-- ! macro tableau reel mc travail !
+! eh0 ! tr ! <-- ! tableau reel de travail !
+! eh1 ! tr ! <-- ! tableau reel de travail !
+! x1 ! tr ! <-- ! tableau reel de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer ntbmci , ntbmcr
+integer tbmci(ncelet,ntbmci)
+
+double precision eh(ncelet) , rtp(ncelet,*)
+double precision fuel1(ncelet), fuel2(ncelet), fuel3(ncelet)
+double precision oxyd(ncelet), xiner(ncelet)
+double precision prod1(ncelet),prod2(ncelet)
+double precision tp(ncelet)
+double precision tbmcr(ncelet,ntbmcr)
+double precision eh0(ncelet), eh1(ncelet), x1(ncelet)
+
+! VARIABLES LOCALES
+
+integer i, icel, icha , icla
+
+double precision ychx10 , ychx20 , ehchx1 , ehchx2
+double precision den1 , den2
+double precision xch , xck , xash , x2 , x2h2
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+
+! RQ IMPORTANTE : Pour la definition des pointeurs pour TBMC
+! VOIR PPINI1.F
+
+! --- Calcul de X1
+
+do icel = 1, ncel
+ x1(icel) = 1.d0
+enddo
+
+do icla = 1, nclacp
+ do icel = 1, ncel
+ xck = rtp(icel,isca(ixck(icla)))
+ xch = rtp(icel,isca(ixch(icla)))
+ xash = rtp(icel,isca(inp(icla)))*xmash(icla)
+ x2 = xch + xck + xash
+ x1(icel) = x1(icel) - x2
+ enddo
+enddo
+
+
+!===============================================================================
+! 2. CALCUL DE LA TEMPERATURE DU MELANGE GAZEUX
+!===============================================================================
+
+i = npo-1
+
+do 100 icel = 1, ncel
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m a TH(NPO)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i+1)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i+1)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i+1)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i+1)
+ endif
+
+! --- Calcul de Somme (X2.H2) a TH(NPO)
+
+ x2h2 = zero
+ do icla = 1, nclacp
+ xck = rtp(icel,isca(ixck(icla)))
+ xch = rtp(icel,isca(ixch(icla)))
+ xash = rtp(icel,isca(inp(icla)))*xmash(icla)
+ x2h2 = x2h2 &
+ + xch * ehsoli(ich(ichcor(icla) ),i+1) &
+ + xck * ehsoli(ick(ichcor(icla) ),i+1) &
+ + xash * ehsoli(iash(ichcor(icla)),i+1)
+ enddo
+
+! --- Clipping eventuel de TP a TH(NPO) si EH > EH1
+
+ eh1(icel) = ( fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i+1) &
+ + oxyd(icel) *ehgaze(io2 ,i+1) &
+ + prod1(icel)*ehgaze(ico2,i+1) &
+ + prod2(icel)*ehgaze(ih2o,i+1) &
+ + xiner(icel)*ehgaze(in2 ,i+1) ) * x1(icel) &
+ + x2h2
+
+ if ( eh(icel).ge.eh1(icel) ) tp(icel)= th(i+1)
+ 100 continue
+
+
+
+i = 1
+do 200 icel = 1, ncel
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m a TH(1)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+! --- Calcul de Somme (X2.H2) a TH(1)
+
+ x2h2 = zero
+ do icla = 1, nclacp
+ xck = rtp(icel,isca(ixck(icla)))
+ xch = rtp(icel,isca(ixch(icla)))
+ xash = rtp(icel,isca(inp(icla)))*xmash(icla)
+ x2h2 = x2h2 &
+ + xch * ehsoli(ich(ichcor(icla) ),i) &
+ + xck * ehsoli(ick(ichcor(icla) ),i) &
+ + xash * ehsoli(iash(ichcor(icla)),i)
+ enddo
+
+! --- Clipping eventuel de TP a TH(1) si EH < EH0
+
+ eh0(icel) = ( fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i) &
+ + oxyd(icel) *ehgaze(io2 ,i) &
+ + prod1(icel)*ehgaze(ico2,i) &
+ + prod2(icel)*ehgaze(ih2o,i) &
+ + xiner(icel)*ehgaze(in2 ,i) ) * x1(icel) &
+ + x2h2
+
+ if ( eh(icel).le.eh0(icel) ) tp(icel)= th(i)
+ 200 continue
+
+
+do i = 1, npo-1
+ do icel = 1, ncel
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m pour TH(I)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+! --- Calcul de Somme (X2.H2) pour TH(I)
+
+ x2h2 = zero
+ do icla = 1, nclacp
+ xck = rtp(icel,isca(ixck(icla)))
+ xch = rtp(icel,isca(ixch(icla)))
+ xash = rtp(icel,isca(inp(icla)))*xmash(icla)
+ x2h2 = x2h2 &
+ + xch * ehsoli(ich(ichcor(icla) ),i ) &
+ + xck * ehsoli(ick(ichcor(icla) ),i ) &
+ + xash * ehsoli(iash(ichcor(icla)),i )
+ enddo
+
+ eh0(icel) = ( fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i ) &
+ + oxyd(icel) *ehgaze(io2 ,i ) &
+ + prod1(icel)*ehgaze(ico2,i ) &
+ + prod2(icel)*ehgaze(ih2o,i ) &
+ + xiner(icel)*ehgaze(in2 ,i ) ) * x1(icel) &
+ + x2h2
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m pour TH(I+1)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha)) &
+ +b1(icha)*wmole(ico) &
+ +c1(icha)*wmole(ih2o) )
+ ychx10 = ychx10 + den1 * &
+ ( tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i+1)* &
+ tbmcr(icel,if1mc(icha))*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha)) &
+ +b2(icha)*wmole(ico) &
+ +c2(icha)*wmole(ih2o) )
+ ychx20 = ychx20 + den2 * &
+ ( tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i+1)* &
+ tbmcr(icel,if2mc(icha))*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i+1)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i+1)
+ endif
+
+! --- Calcul de Somme (X2.H2) pour TH(I+1)
+
+ x2h2 = zero
+ do icla = 1, nclacp
+ xck = rtp(icel,isca(ixck(icla)))
+ xch = rtp(icel,isca(ixch(icla)))
+ xash = rtp(icel,isca(inp(icla)))*xmash(icla)
+ x2h2 = x2h2 &
+ + xch * ehsoli(ich(ichcor(icla) ),i+1) &
+ + xck * ehsoli(ick(ichcor(icla) ),i+1) &
+ + xash * ehsoli(iash(ichcor(icla)),i+1)
+ enddo
+
+ eh1(icel) = ( fuel1(icel)*ehchx1 &
+ + fuel2(icel)*ehchx2 &
+ + fuel3(icel)*ehgaze(ico ,i+1) &
+ + oxyd(icel) *ehgaze(io2 ,i+1) &
+ + prod1(icel)*ehgaze(ico2,i+1) &
+ + prod2(icel)*ehgaze(ih2o,i+1) &
+ + xiner(icel)*ehgaze(in2 ,i+1) ) * x1(icel) &
+ + x2h2
+
+ if ( eh(icel).ge.eh0(icel) .and. eh(icel).le.eh1(icel) ) then
+ tp(icel)= th(i) + (eh(icel)-eh0(icel)) * &
+ (th(i+1)-th(i))/(eh1(icel)-eh0(icel))
+ endif
+
+ enddo
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpthp1.f90 b/src/cplv/cpthp1.f90
new file mode 100644
index 0000000..a362fe8
--- /dev/null
+++ b/src/cplv/cpthp1.f90
@@ -0,0 +1,523 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpthp1 &
+!================
+
+ ( mode , eh , xesp , f1mc , f2mc , &
+ tp )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DU GAZ
+! EN FONCTION DE L'ENTHALPIE DU GAZ ET DES CONCENTRATIONS
+! SI MODE = 1
+! CALCUL DE L'ENTHALPIE DU GAZ
+! EN FONCTION DE LA TEMPERATURE DU GAZ ET DES CONCENTRATIONS
+! SI MODE = -1
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! eh ! tr ! <-- ! enthalpie du gaz !
+! ! ! ! (j/kg de melange gazeux) !
+! xesp ! tr ! <-- ! fraction massique des especes !
+! f1mc ! tr ! <-- ! f1 moyen !
+! f2mc ! tr ! <-- ! f2 moyen !
+! tp ! tr ! --> ! temperature du gaz (kelvin) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer mode
+double precision eh,tp
+double precision xesp(ngazem)
+double precision f1mc(ncharm),f2mc(ncharm)
+
+! VARIABLES LOCALES
+
+integer i , icha
+
+double precision ychx10 , ychx20 , ehchx1 , ehchx2
+double precision den1 , den2
+double precision eh0 , eh1
+
+!===============================================================================
+!===============================================================================
+! 1. CALCUL DE LA TEMPERATURE A PARTIR DE l'ENTHALPIE
+!===============================================================================
+
+if ( mode .eq. 1 ) then
+
+ i = npo
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m a TH(NPO)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+! --- Clipping eventuel de TP a TH(NPO) si EH > EH1
+
+ eh1 = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i) &
+ + xesp(io2 )*ehgaze(io2 ,i) &
+ + xesp(ico2 )*ehgaze(ico2,i) &
+ + xesp(ih2o )*ehgaze(ih2o,i) &
+ + xesp(in2 )*ehgaze(in2 ,i)
+
+ if ( eh .ge. eh1 ) then
+ tp = th(i)
+ goto 501
+ endif
+
+ i = 1
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m a TH(1)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+! --- Clipping eventuel de TP a TH(1) si EH < EH0
+
+ eh0 = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i) &
+ + xesp(io2 )*ehgaze(io2 ,i) &
+ + xesp(ico2 )*ehgaze(ico2,i) &
+ + xesp(ih2o )*ehgaze(ih2o,i) &
+ + xesp(in2 )*ehgaze(in2 ,i)
+
+ if ( eh .le. eh0 ) then
+ tp= th(i)
+ goto 501
+ endif
+
+
+ 500 continue
+ i = i + 1
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m pour TH(I-1)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i-1)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i-1)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i-1)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i-1)
+ endif
+ eh0 = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i-1) &
+ + xesp(io2 )*ehgaze(io2 ,i-1) &
+ + xesp(ico2 )*ehgaze(ico2,i-1) &
+ + xesp(ih2o )*ehgaze(ih2o,i-1) &
+ + xesp(in2 )*ehgaze(in2 ,i-1)
+
+! --- Calcul de l'enthalpie de l'espece gazeuse CHx1m
+! et CHx2m pour TH(I)
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+ eh1 = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i) &
+ + xesp(io2 )*ehgaze(io2 ,i) &
+ + xesp(ico2 )*ehgaze(ico2,i) &
+ + xesp(ih2o )*ehgaze(ih2o,i) &
+ + xesp(in2 )*ehgaze(in2 ,i)
+
+ if ( eh .ge. eh0 .and. eh .le. eh1 ) then
+ tp = th(i-1) + (eh-eh0) * &
+ (th(i)-th(i-1))/(eh1-eh0)
+ goto 501
+ endif
+ goto 500
+ 501 continue
+
+!===============================================================================
+! 1. CALCUL DE L'ENTHALPIE A PARTIR DE LA TEMPERATURE
+!===============================================================================
+
+else if ( mode .eq. -1 ) then
+
+ i = npo
+
+! --- Calcul en Max
+
+ if ( tp .ge. th(i) ) then
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+ eh = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i) &
+ + xesp(io2 )*ehgaze(io2 ,i) &
+ + xesp(ico2 )*ehgaze(ico2,i) &
+ + xesp(ih2o )*ehgaze(ih2o,i) &
+ + xesp(in2 )*ehgaze(in2 ,i)
+ goto 601
+ endif
+
+! Clipping en Min
+
+ i = 1
+
+ if ( tp .le. th(i) ) then
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+! --- Clipping eventuel de TP a TH(1) si EH < EH0
+
+ eh = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i) &
+ + xesp(io2 )*ehgaze(io2 ,i) &
+ + xesp(ico2 )*ehgaze(ico2,i) &
+ + xesp(ih2o )*ehgaze(ih2o,i) &
+ + xesp(in2 )*ehgaze(in2 ,i)
+ goto 601
+ endif
+
+! Interpolation dans la table
+
+ i = 1
+ 600 continue
+
+ i = i + 1
+ if ( tp .le. th(i) ) then
+
+! --- Calcul de l'enthalpie de l'espece gazeuse TH(I-1)
+
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i-1)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i-1)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i-1)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i-1)
+ endif
+
+ eh0 = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i-1) &
+ + xesp(io2 )*ehgaze(io2 ,i-1) &
+ + xesp(ico2 )*ehgaze(ico2,i-1) &
+ + xesp(ih2o )*ehgaze(ih2o,i-1) &
+ + xesp(in2 )*ehgaze(in2 ,i-1)
+
+! --- Calcul de l'enthalpie de l'espece gazeuse TH(I)
+
+ ehchx1 = zero
+ ehchx2 = zero
+ ychx10 = zero
+ ychx20 = zero
+ do icha = 1, ncharb
+ den1 = 1.d0 &
+ / ( a1(icha)*wmole(ichx1c(icha))+b1(icha)*wmole(ico))
+ ychx10 = ychx10 + den1 * &
+ ( f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ ehchx1 = ehchx1 + den1 * &
+ ( ehgaze(ichx1c(icha),i)* &
+ f1mc(icha)*a1(icha)*wmole(ichx1c(icha)) )
+ den2 = 1.d0 &
+ / ( a2(icha)*wmole(ichx2c(icha))+b2(icha)*wmole(ico))
+ ychx20 = ychx20 + den2 * &
+ ( f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ ehchx2 = ehchx2 + den2 * &
+ ( ehgaze(ichx2c(icha),i)* &
+ f2mc(icha)*a2(icha)*wmole(ichx2c(icha)) )
+ enddo
+ if ( ychx10.gt.epzero ) then
+ ehchx1 = ehchx1 / ychx10
+ else
+ ehchx1 = ehgaze(ichx1,i)
+ endif
+ if ( ychx20.gt.epzero ) then
+ ehchx2 = ehchx2 / ychx20
+ else
+ ehchx2 = ehgaze(ichx2,i)
+ endif
+
+ eh1 = xesp(ichx1)*ehchx1 &
+ + xesp(ichx2)*ehchx2 &
+ + xesp(ico )*ehgaze(ico ,i) &
+ + xesp(io2 )*ehgaze(io2 ,i) &
+ + xesp(ico2 )*ehgaze(ico2,i) &
+ + xesp(ih2o )*ehgaze(ih2o,i) &
+ + xesp(in2 )*ehgaze(in2 ,i)
+
+ eh = eh0 &
+ + (eh1-eh0)*(tp-th(i-1))/(th(i)-th(i-1))
+ goto 601
+ endif
+ goto 600
+
+ 601 continue
+
+else
+ write(nfecra,1000) mode
+ call csexit(1)
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS CPTHP1 ',/,&
+'@ ========= ',/,&
+'@ VALEUR INCORRECTE DE L''ARGUMENT MODE ',/,&
+'@ CE DOIT ETRE UN ENTIER EGAL A 1 OU -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cpthp2.f90 b/src/cplv/cpthp2.f90
new file mode 100644
index 0000000..311eb6b
--- /dev/null
+++ b/src/cplv/cpthp2.f90
@@ -0,0 +1,252 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpthp2 &
+!================
+
+ ( mode , icla , enthal , xsolid , temper , t1)
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DES PARTICULES
+! EN FONCTION DE L'ENTHALPIE ET DES CONCENTRATIONS
+! SI IMODE = 1
+! CALCUL DE L'ENTHALPIE DES PARTICULES
+! EN FONCTION DE LA TEMPERATURE ET DES CONCENTRATIONS
+! SI IMODE = -1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! mode ! e ! <-- ! -1 : t -> h ; 1 : h -> t !
+! icla ! e ! <-- ! numero de la classe !
+! enthal ! r ! <-- ! enthalpie massique j/kg !
+! xsolid ! tr ! <-- ! fraction massique des constituants !
+! temper ! r ! <-- ! temperature en kelvin !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+
+! Arguments
+
+integer mode , icla , icha
+
+double precision xsolid(nsolim)
+double precision temper , enthal , t1
+
+! VARIABLES LOCALES
+
+integer it , isol , ihflt2
+
+double precision eh1 , eh0 , x2
+
+!===============================================================================
+!===============================================================================
+! 1. RQ IMPORTANTE : On suppose pour l'instant que H2 = H02 + CP2(T2-TREF)
+!===============================================================================
+
+ihflt2 = 1
+
+if ( ihflt2.eq.0 ) then
+
+!===============================================================================
+! 2. H2 FONCTION LINEAIRE T2
+!===============================================================================
+
+ icha = ichcor(icla)
+
+ if ( mode.eq.-1 ) then
+
+! --> Loi temperature -> enthalpie (MODE = -1)
+
+ enthal = h02ch(icha) + cp2ch(icha)*(temper-trefth)
+
+ elseif ( mode.eq.1 ) then
+
+! --> Loi enthalpie -> temperature (MODE = 1)
+
+ temper = (enthal-h02ch(icha))/cp2ch(icha) + trefth
+
+ else
+
+ write(nfecra,1000) mode
+ call csexit (1)
+ !==========
+
+ endif
+
+
+elseif( ihflt2.ne.0 ) then
+
+!===============================================================================
+! 3. H2 TABULE
+!===============================================================================
+
+ if ( mode.eq.-1 ) then
+
+! --> Loi temperature -> enthalpie (MODE = -1)
+
+ it = npoc
+ if ( temper.ge.thc(it) ) then
+ enthal = zero
+ do isol = 1, nsolid
+ enthal = enthal + xsolid(isol)*ehsoli(isol,it)
+ enddo
+ go to 11
+ endif
+
+ it = 1
+ if ( temper.le.thc(it) ) then
+ enthal = zero
+ do isol = 1, nsolid
+ enthal = enthal + xsolid(isol)*ehsoli(isol,it)
+ enddo
+ go to 11
+ endif
+ it = 1
+ 10 continue
+
+ it = it + 1
+ if ( temper.le.thc(it) ) then
+ eh0 = zero
+ eh1 = zero
+ do isol = 1, nsolid
+ eh0 = eh0 + xsolid(isol)*ehsoli(isol,it-1)
+ eh1 = eh1 + xsolid(isol)*ehsoli(isol,it )
+ enddo
+ enthal = eh0 &
+ + (eh1-eh0)*(temper-thc(it-1)) &
+ /(thc(it)-thc(it-1))
+ goto 11
+ endif
+ goto 10
+ 11 continue
+
+ elseif ( mode.eq.1 ) then
+
+! --> Loi enthalpie -> temperature (MODE = 1)
+
+ x2 = 0.d0
+ do isol = 1, nsolid
+ x2 = x2 + xsolid(isol)
+ enddo
+
+ if ( x2 .gt. epsicp ) then
+ it = npoc-1
+ eh1 = zero
+ do isol = 1, nsolid
+ eh1 = eh1 + xsolid(isol)*ehsoli(isol,it+1)
+ enddo
+ if ( enthal.ge.eh1 ) temper = thc(it+1)
+
+ it = 1
+ eh0 = zero
+ do isol = 1, nsolid
+ eh0 = eh0 + xsolid(isol)*ehsoli(isol,it )
+ enddo
+ if ( enthal.le.eh0 ) temper = thc(it)
+
+ do it = 1, npoc-1
+ eh0 = zero
+ eh1 = zero
+ do isol = 1, nsolid
+ eh0 = eh0 + xsolid(isol)*ehsoli(isol,it )
+ eh1 = eh1 + xsolid(isol)*ehsoli(isol,it+1)
+ enddo
+ if ( enthal.ge.eh0 .and. enthal.le.eh1 ) &
+ temper = thc(it) &
+ + (enthal-eh0)*(thc(it+1)-thc(it))/(eh1-eh0)
+
+ enddo
+
+ else
+ temper = t1
+ endif
+
+ else
+
+ write(nfecra,1000) mode
+ call csexit (1)
+ !==========
+
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS CPTHP2 ',/,&
+'@ ========= ',/,&
+'@ VALEUR INCORRECTE DE L''ARGUMENT MODE ',/,&
+'@ CE DOIT ETRE UN ENTIER EGAL A 1 OU -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/cplv/cptssc.f90 b/src/cplv/cptssc.f90
new file mode 100644
index 0000000..2b4d732
--- /dev/null
+++ b/src/cplv/cptssc.f90
@@ -0,0 +1,1327 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cptssc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ izfppp , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME CHARBON PULVERISE
+! ON PRECISE LES TERMES SOURCES POUR UN SCALAIRE PP
+! SUR UN PAS DE TEMPS
+
+! ATTENTION : LE TRAITEMENT DES TERMES SOURCES EST DIFFERENT
+! --------- DE CELUI DE USTSSC.F
+
+! ON RESOUT ROVSDT*D(VAR) = SMBRS
+
+! ROVSDT ET SMBRS CONTIENNENT DEJA D'EVENTUELS TERMES SOURCES
+! UTILISATEUR. IL FAUT DONC LES INCREMENTER ET PAS LES
+! ECRASER
+
+! POUR DES QUESTIONS DE STABILITE, ON NE RAJOUTE DANS ROVSDT
+! QUE DES TERMES POSITIFS. IL N'Y A PAS DE CONTRAINTE POUR
+! SMBRS
+
+! DANS LE CAS D'UN TERME SOURCE EN CEXP + CIMP*VAR ON DOIT
+! ECRIRE :
+! SMBRS = SMBRS + CEXP + CIMP*VAR
+! ROVSDT = ROVSDT + MAX(-CIMP,ZERO)
+
+! ON FOURNIT ICI ROVSDT ET SMBRS (ILS CONTIENNENT RHO*VOLUME)
+! SMBRS en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! ROVSDT en kg /s
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , ipcrom, iel, iphas
+integer numcla , numcha , icla , numtra
+integer ipcgch , ipcgd1 , ipcgd2 , ipcght , ipcsec
+integer ixchcl , ixckcl , iscala
+integer ipcro2 , ipcte1 , ipcte2 , ipcvsl , ipccp
+integer ipcdia , ipcvst
+integer mode, ige
+integer ifac , ifinra , icoefa , icoefb
+integer ipcx2c , icha , imode , ii
+integer iterch
+integer itermx,nbpauv,nbrich,nbepau,nberic,ipghc2
+
+double precision epsrgp , climgp , extrap , xnuss
+double precision aux, rhovst
+double precision coefe(ngazem)
+double precision t1, t2, hlv , hh2ov
+double precision f1mc(ncharm), f2mc(ncharm)
+double precision xhdev1 , xhdev2 , xhco , xho2 , gamdv1 , gamdv2
+
+double precision gamhet
+
+double precision xxco,xxo2,xxco2,xxh2o,xco2mx
+double precision xkp,xk0p,xkm,xk0m,wplus,wmoins,t0p,t0m
+double precision auxp,auxm
+
+double precision anmr,xcot,xo2t,xco2e,xo2e,xcoe,tauchi,tautur
+double precision sqh2o , x2
+
+double precision err1mx,err2mx,anmr0
+
+double precision errch,ter1,ddelta,xden
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Numero des grandeurs physiques (voir usclim)
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES POUR LES VARIABLES RELATIVES
+! AUX CLASSES DE PARTICULES
+!===============================================================================
+
+! --> Terme source pour la fraction massique de charbon reactif
+
+if ( ivar.ge.isca(ixch(1)) .and. ivar.le.isca(ixch(nclacp)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+ numcla = ivar-isca(ixch(1))+1
+ ipcgch = ipproc(igmdch(numcla))
+
+ do iel = 1, ncel
+
+! ---- Calcul de W1 = - rho.GMDCH > 0
+
+ w1(iel) = - propce(iel,ipcrom)*propce(iel,ipcgch) &
+ *volume(iel)
+
+! ---- Calcul des parties explicite et implicite du TS
+
+ rovsdt(iel) = rovsdt(iel) + max(w1(iel),zero)
+ smbrs(iel) = smbrs(iel) - w1(iel)*rtpa(iel,ivar)
+
+ enddo
+
+endif
+
+
+! --> Terme source pour la fraction massique de coke
+
+if ( ivar.ge.isca(ixck(1)) .and. ivar.le.isca(ixck(nclacp)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ numcla = ivar-isca(ixck(1))+1
+ ipcgch = ipproc(igmdch(numcla))
+ ipcgd1 = ipproc(igmdv1(numcla))
+ ipcgd2 = ipproc(igmdv2(numcla))
+ ixchcl = isca(ixch(numcla))
+ ixckcl = isca(ixck(numcla))
+ ipcght = ipproc(igmhet(numcla))
+ if ( ihtco2 .eq. 1 ) then
+ ipghc2 = ipproc(ighco2(numcla))
+ endif
+
+ do iel = 1, ncel
+
+! ---- Calcul de W1 = - rho.Xch.GMDCH.Volume > 0
+
+ w1(iel) = - propce(iel,ipcrom)*rtp(iel,ixchcl) &
+ *propce(iel,ipcgch)*volume(iel)
+
+! AE : On prend RTP(IEL,IXCHCL) et pas RTPA(IEL,IXCHCL) afin
+! d'etre conservatif sur la masse
+
+! ---- Calcul de W2 = rho.Xch.(GMDV1+GMDV2)Volume < 0
+
+ w2(iel) = propce(iel,ipcrom)*rtp(iel,ixchcl) &
+ *(propce(iel,ipcgd1)+propce(iel,ipcgd2)) &
+ *volume(iel)
+
+ if ( rtpa(iel,ixckcl) .gt. epsicp ) then
+
+! Reaction C(s) + O2 ---> 0.5CO
+! =============================
+
+! ---- Calcul de la partie implicite > 0 du TS relatif a GMHET
+
+ w3(iel) = - 2.d0/3.d0*propce(iel,ipcrom)*propce(iel,ipcght) &
+ /(rtpa(iel,ixckcl))**(1.d0/3.d0)*volume(iel)
+
+! ---- Calcul de la partie explicite < 0 du TS relatif a GMHET
+
+ w4(iel) = propce(iel,ipcrom)*propce(iel,ipcght) &
+ * (rtpa(iel,ixckcl))**(2.d0/3.d0)*volume(iel)
+
+ else
+ w3(iel) = 0.d0
+ w4(iel) = 0.d0
+ endif
+
+! ---- Calcul des parties explicite et implicite du TS
+
+ rovsdt(iel) = rovsdt(iel) + max(w3(iel),zero)
+ smbrs(iel) = smbrs(iel) + w1(iel) + w2(iel) + w4(iel)
+
+ enddo
+
+ if ( ihtco2 .eq. 1 ) then
+
+ do iel = 1, ncel
+
+ if ( rtpa(iel,ixckcl) .gt. epsicp ) then
+
+! Reaction C(s) + CO2 ---> 2CO
+! =============================
+
+! ---- Calcul de la partie implicite > 0 du TS relatif a GMHET
+
+ w5(iel) = - 2.d0/3.d0*propce(iel,ipcrom) &
+ *propce(iel,ipghc2) &
+ /(rtpa(iel,ixckcl))**(1.d0/3.d0)*volume(iel)
+
+! ---- Calcul de la partie explicite < 0 du TS relatif a GMHET
+
+ w6(iel) = propce(iel,ipcrom)*propce(iel,ipghc2) &
+ *(rtpa(iel,ixckcl))**(2.d0/3.d0)*volume(iel)
+
+ else
+ w5(iel) = 0.d0
+ w6(iel) = 0.d0
+ endif
+
+! ---- Calcul des parties explicite et implicite du TS
+
+ rovsdt(iel) = rovsdt(iel) + max(w5(iel),zero)
+ smbrs(iel) = smbrs(iel) + w6(iel)
+
+ enddo
+
+ endif
+
+endif
+
+
+! --> Terme source pour la fraction massique de d'eau
+
+if ( ippmod(icp3pl) .eq. 1 ) then
+
+ if ( ivar.ge.isca(ixwt(1)) .and. &
+ ivar.le.isca(ixwt(nclacp)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+ numcla = ivar-isca(ixwt(1))+1
+ numcha = ichcor(numcla)
+
+ ipcsec = ipproc(igmsec(numcla))
+ ipcx2c = ipproc(ix2(numcla))
+
+ do iel = 1, ncel
+
+! ---- Calcul des parties explicite et implicite du TS
+
+ if ( rtpa(iel,ivar).gt. epsicp .and. &
+ xwatch(numcha).gt. epsicp ) then
+ w1(iel) = propce(iel,ipcrom)*propce(iel,ipcsec) &
+ *volume(iel) &
+ *(1.d0/propce(iel,ipcx2c)) &
+ *(1.d0/xwatch(numcha))
+
+ rovsdt(iel) = rovsdt(iel) + max(w1(iel),zero)
+ smbrs(iel) = smbrs(iel) - w1(iel)*rtpa(iel,ivar)
+ endif
+
+ enddo
+
+ endif
+
+endif
+
+! --> Terme source pour l'enthalpie du solide
+
+if ( ivar.ge.isca(ih2(1)) .and. ivar.le.isca(ih2(nclacp)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ numcla = ivar-isca(ih2(1))+1
+ numcha = ichcor(numcla)
+ ixchcl = isca(ixch(numcla))
+ ixckcl = isca(ixck(numcla))
+ ipcx2c = ipproc(ix2(numcla))
+ ipcro2 = ipproc(irom2(numcla ))
+ ipcdia = ipproc(idiam2(numcla))
+ ipcte2 = ipproc(itemp2(numcla))
+ ipcte1 = ipproc(itemp1)
+ ipcght = ipproc(igmhet(numcla))
+ if ( ihtco2 .eq. 1 ) then
+ ipghc2 = ipproc(ighco2(numcla))
+ endif
+
+ ipcgd1 = ipproc(igmdv1(numcla))
+ ipcgd2 = ipproc(igmdv2(numcla))
+ ipcgch = ipproc(igmdch(numcla))
+ ixchcl = isca(ixch(numcla))
+ ixckcl = isca(ixck(numcla))
+
+! ---- Calcul preliminaire : calcul de X2(NUMCLA) dans W11
+! ATTENTION tableau a conserver
+
+ do iel = 1, ncel
+! Rq : on utilise PROPCE(IEL,IPCX2C) car on veut X2 a l'iteration n
+! (en RTPA)
+ w11(iel) = propce(iel,ipcx2c)
+ enddo
+
+! ---- Contribution aux bilans explicite et implicite
+! des echanges par diffusion moleculaire
+! 6 Lambda Nu / diam**2 / Rho2 * Rho * (T1-T2)
+
+! ------ Calcul de lambda dans W1
+
+ xnuss = 2.d0
+ do iel = 1, ncel
+ if ( ivisls(ihm).gt.0 ) then
+ ipcvsl = ipproc(ivisls(ihm))
+ if ( icp(iphas).gt.0 ) then
+ ipccp = ipproc(icp(iphas))
+ w1(iel) = propce(iel,ipcvsl) * propce(iel,ipccp)
+ else
+ w1(iel) = propce(iel,ipcvsl) * cp0(iphas)
+ endif
+ else
+ if ( icp(iphas).gt.0 ) then
+ ipccp = ipproc(icp(iphas))
+ w1(iel) = visls0(ihm) * propce(iel,ipccp)
+ else
+ w1(iel) = visls0(ihm) * cp0(iphas)
+ endif
+ endif
+ enddo
+
+! ------ Calcul du diametre des particules dans W2
+! On calcule le d20 = (A0.D0**2+(1-A0)*DCK**2)**0.5
+
+ do iel = 1, ncel
+ w2(iel) = ( xashch(numcha)*diam20(numcla)**2 + &
+ (1.d0-xashch(numcha))*propce(iel,ipcdia)**2 &
+ )**0.5
+ enddo
+
+! ------ Contribution aux bilans explicite et implicite de
+! des echanges par diffusion moleculaire
+
+ do iel = 1, ncel
+ if ( w11(iel).gt.epsicp ) then
+ aux = 6.d0 * w1(iel) * xnuss / w2(iel)**2 &
+ / propce(iel,ipcro2) * propce(iel,ipcrom) &
+ * w11(iel) &
+ * volume(iel)
+ rhovst = aux / cp2ch(numcha) /w11(iel)
+
+ smbrs(iel) = smbrs(iel) - aux * &
+ ( propce(iel,ipcte2) - propce(iel,ipcte1) )
+ rovsdt(iel) = rovsdt(iel) + max(zero,rhovst)
+ endif
+
+ enddo
+
+
+! ---- Contribution aux bilans explicite et implicite
+! du terme echange d'energie entre les phases :
+! GAMA(dev1) H(mv1,T2)+GAMA(dev2) H(mv2,T2)
+
+ do iel = 1, ncel
+
+! Gama Dev1 et Gama Dev2
+
+ gamdv1 = propce(iel,ipcrom)*rtp(iel,ixchcl) &
+ *propce(iel,ipcgd1)
+
+ gamdv2 = propce(iel,ipcrom)*rtp(iel,ixchcl) &
+ *propce(iel,ipcgd2)
+
+! H(mv1,T2)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+
+ coefe(ichx1) = a1(numcha)*wmole(ichx1c(numcha)) &
+ /( a1(numcha)*wmole(ichx1c(numcha)) &
+ +b1(numcha)*wmole(ico) &
+ +c1(numcha)*wmole(ih2o) )
+ coefe(ico ) = b1(numcha)*wmole(ico) &
+ /( a1(numcha)*wmole(ichx1c(numcha)) &
+ +b1(numcha)*wmole(ico) &
+ +c1(numcha)*wmole(ih2o) )
+ coefe(ih2o ) = c1(numcha)*wmole(ih2o) &
+ /( a1(numcha)*wmole(ichx1c(numcha)) &
+ +b1(numcha)*wmole(ico) &
+ +c1(numcha)*wmole(ih2o) )
+
+ t2 = propce(iel,ipcte2)
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ f1mc(numcha) = 1.d0
+
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , xhdev1 , coefe , f1mc , f2mc , &
+ t2 )
+
+! H(mv2,T2)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(ichx2) = a2(numcha)*wmole(ichx2c(numcha)) &
+ /( a2(numcha)*wmole(ichx2c(numcha)) &
+ +b2(numcha)*wmole(ico) &
+ +c2(numcha)*wmole(ih2o) )
+ coefe(ico ) = b2(numcha)*wmole(ico) &
+ /( a2(numcha)*wmole(ichx2c(numcha)) &
+ +b2(numcha)*wmole(ico) &
+ +c2(numcha)*wmole(ih2o) )
+ coefe(ih2o ) = c2(numcha)*wmole(ih2o) &
+ /( a2(numcha)*wmole(ichx2c(numcha)) &
+ +b2(numcha)*wmole(ico) &
+ +c2(numcha)*wmole(ih2o) )
+
+ t2 = propce(iel,ipcte2)
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ f2mc(numcha) = 1.d0
+
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , xhdev2 , coefe , f1mc , f2mc , &
+ t2 )
+
+! Contribution aux bilans explicite et implicite
+
+ smbrs(iel) = smbrs(iel) &
+ + (gamdv1*xhdev1+gamdv2*xhdev2)*volume(iel)
+
+ enddo
+
+! ------ combustion heterogene : C(s) + 02 ---> 0.5 C0
+! GamHET * (28/12 H(CO,T2)-16/12 H(O2,T1) )
+
+ do iel = 1, ncel
+
+! Calcul de HCO(T2)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(ico) = 1.d0
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+
+ t2 = propce(iel,ipcte2)
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , xhco , coefe , f1mc , f2mc , &
+ t2 )
+
+! Calcul de HO2(T1)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(io2) = 1.d0
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+
+ t1 = propce(iel,ipcte1)
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , xho2 , coefe , f1mc , f2mc , &
+ t1 )
+
+! Contribution aux bilans explicite et implicite
+
+ if ( rtpa(iel,ixckcl) .gt. epsicp ) then
+
+ gamhet = propce(iel,ipcrom)*propce(iel,ipcght) &
+ * ( (rtpa(iel,ixckcl))**(2.d0/3.d0) + &
+ 2.d0/3.d0*(rtp(iel,ixckcl)-rtpa(iel,ixckcl)) &
+ /(rtpa(iel,ixckcl))**(1.d0/3.d0) )
+
+ else
+ gamhet = 0.d0
+ endif
+
+ smbrs(iel) = smbrs(iel) &
+ +gamhet &
+ *(28.d0/12.d0*xhco-16.d0/12.d0*xho2) &
+ *volume(iel)
+
+ enddo
+
+! ------ combustion heterogene : C(s) + C02 ---> 2 C0
+! GamHET * (56/12 H(CO,T2)-44/12 H(O2,T1) )
+
+ if ( ihtco2 .eq. 1 ) then
+ do iel = 1, ncel
+
+! Calcul de HCO(T2)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(ico) = 1.d0
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+
+ t2 = propce(iel,ipcte2)
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , xhco , coefe , f1mc , f2mc , &
+ t2 )
+
+! Calcul de HCO2(T1)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(ico2) = 1.d0
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+
+ t1 = propce(iel,ipcte1)
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , xho2 , coefe , f1mc , f2mc , &
+ t1 )
+
+! Contribution aux bilans explicite et implicite
+
+ if ( rtpa(iel,ixckcl) .gt. epsicp ) then
+
+ gamhet = propce(iel,ipcrom)*propce(iel,ipghc2) &
+ * ( (rtpa(iel,ixckcl))**(2.d0/3.d0) + &
+ 2.d0/3.d0*(rtp(iel,ixckcl)-rtpa(iel,ixckcl)) &
+ /(rtpa(iel,ixckcl))**(1.d0/3.d0) )
+
+ else
+ gamhet = 0.d0
+ endif
+
+ smbrs(iel) = smbrs(iel) &
+ +gamhet &
+ *(56.d0/12.d0*xhco-44.d0/12.d0*xho2) &
+ *volume(iel)
+
+ enddo
+
+ endif
+
+! --> Terme source sur H2 issu du sechage)
+
+ if ( ippmod(icp3pl) .eq. 1 ) then
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+
+ ipcsec = ipproc(igmsec(numcla))
+ ipcte2 = ipproc(itemp2(numcla))
+
+ do iel = 1, ncel
+
+! Calcul de H(H2O) a T2
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(ih2o) = 1.d0
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+
+ t2 = propce(iel,ipcte2)
+ if ( t2 .gt. 100.d0 ) then
+ t2 = 100.d0
+ endif
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , hh2ov , coefe , f1mc , f2mc , &
+ t2 )
+
+ hlv = 2.263d+6
+
+! Contribution aux bilans explicite
+
+ if ( rtpa(iel,isca(ixwt(numcla))).gt. epsicp .and. &
+ xwatch(numcha) .gt. epsicp ) then
+
+ aux = -propce(iel,ipcrom)*propce(iel,ipcsec) &
+ *(rtp(iel,isca(ixwt(numcla)))/propce(iel,ipcx2c)) &
+ *(1.d0 /xwatch(numcha)) &
+ *hh2ov
+
+ else
+ aux = 0.d0
+ endif
+
+ smbrs(iel) = smbrs(iel) + aux*volume(iel)
+
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 3. PRISE EN COMPTE DES TERMES SOURCES POUR LES VARIABLES RELATIVES
+! AU MELANGE GAZEUX
+!===============================================================================
+
+! --> Terme source pour les matieres volatiles legeres
+
+if ( ivar.ge.isca(if1m(1)) .and. ivar.le.isca(if1m(ncharb)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Calcul de GMDEV1 = - SOMME (rho.XCH.GMDV1) > 0 --> W1
+
+ numcha = ivar-isca(if1m(1))+1
+ do iel = 1, ncel
+ w1(iel) = zero
+ enddo
+ do icla = 1, nclacp
+ ipcgd1 = ipproc(igmdv1(icla))
+ ixchcl = isca(ixch(icla))
+ if ( ichcor(icla).eq.numcha ) then
+ do iel = 1, ncel
+ w1(iel) = w1(iel) - propce(iel,ipcrom)*rtp(iel,ixchcl) &
+ * propce(iel,ipcgd1)
+ enddo
+ endif
+ enddo
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + volume(iel) * w1(iel)
+ enddo
+
+endif
+
+
+! --> Terme source pour les matieres volatiles lourdes
+
+if ( ivar.ge.isca(if2m(1)) .and. ivar.le.isca(if2m(ncharb)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Calcul de GMDEV2 = - SOMME (rho.XCH.GMDV2) >0 --> W1
+
+ numcha = ivar-isca(if2m(1))+1
+ do iel = 1, ncel
+ w1(iel) = zero
+ enddo
+ do icla = 1, nclacp
+ ipcgd2 = ipproc(igmdv2(icla))
+ ixchcl = isca(ixch(icla))
+ if ( ichcor(icla).eq.numcha ) then
+ do iel = 1, ncel
+ w1(iel) = w1(iel) - propce(iel,ipcrom)*rtp(iel,ixchcl) &
+ * propce(iel,ipcgd2)
+ enddo
+ endif
+ enddo
+
+! ---- Contribution du TS interfacial pour le bilan explicite
+
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + volume(iel) * w1(iel)
+ enddo
+
+endif
+
+
+! --> Terme source pour le traceur 3 (O2) (C de la comb. het.)
+
+if ( ivar.eq.isca(if3m) ) then
+
+! RQ IMPORTANTE : On prend les meme TS que pour Xck
+! afin d'etre conservatif
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Calcul prelimimaire pour la partie explicite : W1
+! pour la partie implicite : W2
+
+ do iel = 1, ncel
+ w1(iel) = zero
+ enddo
+
+ do icla = 1, nclacp
+ ipcght = ipproc(igmhet(icla))
+ ixckcl = isca(ixck(icla))
+ do iel = 1, ncel
+ if ( rtpa(iel,ixckcl) .gt. epsicp ) then
+ w1(iel) = w1(iel) &
+ - propce(iel,ipcrom)*propce(iel,ipcght) &
+ * ( (rtpa(iel,ixckcl))**(2.d0/3.d0) + &
+ 2.d0/3.d0*(rtp(iel,ixckcl)-rtpa(iel,ixckcl)) &
+ /(rtpa(iel,ixckcl))**(1.d0/3.d0) )
+ endif
+ enddo
+ enddo
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + volume(iel) * w1(iel)
+ enddo
+
+endif
+
+
+
+! --> Terme source pour le traceur 3 (CO2) (C de la comb. het.)
+
+if ( ihtco2 .eq. 1 ) then
+ if ( ivar.eq.isca(if3mc2) ) then
+
+! RQ IMPORTANTE : On prend les meme TS que pour Xck
+! afin d'etre conservatif
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Calcul prelimimaire pour la partie explicite : W1
+! pour la partie implicite : W2
+
+ do iel = 1, ncel
+ w1(iel) = zero
+ enddo
+
+ do icla = 1, nclacp
+ ipcght = ipproc(ighco2(icla))
+ ixckcl = isca(ixck(icla))
+ do iel = 1, ncel
+ if ( rtpa(iel,ixckcl) .gt. epsicp ) then
+ w1(iel) = w1(iel) &
+ - propce(iel,ipcrom)*propce(iel,ipcght) &
+ * ( (rtpa(iel,ixckcl))**(2.d0/3.d0) + &
+ 2.d0/3.d0*(rtp(iel,ixckcl)-rtpa(iel,ixckcl))&
+ /(rtpa(iel,ixckcl))**(1.d0/3.d0) )
+ endif
+ enddo
+ enddo
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + volume(iel) * w1(iel)
+ enddo
+
+ endif
+
+endif
+
+! --> Terme source pour la variance du traceur 4 (Air)
+
+if ( ivar.eq.isca(if4p2m) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Calcul des termes sources explicite et implicite
+! relatif aux echanges interfaciaux entre phases
+
+ numtra = 4
+ call cptsvi &
+!!==========
+ ( ncelet , ncel , numtra , &
+ rtp , propce , volume , &
+ smbrs , rovsdt , &
+ w1 , w2 , &
+ w3 )
+
+! ---- Calcul des termes sources explicite et implicite
+! relatif aux termes de production et de dissipation
+
+! Pointeur relatif au scalaire associe
+! (0 si pas de scalaire associe)
+ iscala = 0
+
+ call cptsvc &
+!!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ smbrs , rovsdt , &
+ viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+! --> Terme source pour le traceur 5 (Eau issue du s�chage)
+
+if ( ippmod(icp3pl) .eq. 1 ) then
+
+ if ( ivar.eq.isca(if5m) ) then
+
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+ do iel = 1, ncel
+ w1(iel) = zero
+ enddo
+
+ do icla = 1, nclacp
+
+ ipcsec = ipproc(igmsec(icla))
+ ipcx2c = ipproc(ix2(icla))
+ numcha = ichcor(icla)
+
+ do iel = 1, ncel
+
+ if ( rtpa(iel,isca(ixwt(icla))).gt. epsicp &
+ .and. &
+ xwatch(numcha) .gt. epsicp ) then
+
+ w1(iel) = w1(iel) &
+ + propce(iel,ipcrom)*propce(iel,ipcsec) &
+ *(rtp(iel,isca(ixwt(icla)))/propce(iel,ipcx2c)) &
+ *(1.d0 /xwatch(numcha))
+
+ endif
+
+ enddo
+
+ enddo
+
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + volume(iel) * w1(iel)
+ enddo
+
+ endif
+
+endif
+
+! --> Terme source pour CO2
+
+if ( ieqco2 .ge. 1 ) then
+
+ if ( ivar.eq.isca(iyco2) ) then
+
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+! Oxydation du CO
+! ===============
+
+! Dryer Glassman : XK0P en (moles/m3)**(-0.75) s-1
+
+! XK0P = 1.26D10
+
+! XK0P = 1.26D7 * (1.1)**(NTCABS)
+! IF ( XK0P .GT. 1.26D10 ) XK0P=1.26D10
+
+! T0P = 4807.D0
+
+! Howard : XK0P en (moles/m3)**(-0.75) s-1
+
+! XK0P = 4.11D9
+! T0P = 15090.D0
+
+! Westbrook & Dryer
+
+ xk0p = 23.256d0
+ t0p = 20096.d0
+
+! Dissociation du CO2 (Trinh Minh Chinh)
+! ===================
+
+! XK0M = 5.D8
+! T0M = 4807.D0
+
+! XK0M = 0.D0
+
+! Westbrook & Dryer
+
+ xk0m = 20.03d0
+ t0m = 20096.d0
+
+ err1mx = 0.d0
+ err2mx = 0.d0
+
+! Nombre d'iterations
+
+ itermx = 500
+
+! Nombre de points converges
+
+ nbpauv = 0
+ nbepau = 0
+ nbrich = 0
+ nberic = 0
+
+! Precision pour la convergence
+
+ errch = 1.d-8
+
+ do iel = 1, ncel
+
+ xxco = propce(iel,ipproc(iym1(ico )))/wmole(ico) &
+ *propce(iel,ipproc(irom1))
+ xxo2 = propce(iel,ipproc(iym1(io2 )))/wmole(io2) &
+ *propce(iel,ipproc(irom1))
+ xxco2 = propce(iel,ipproc(iym1(ico2 )))/wmole(ico2) &
+ *propce(iel,ipproc(irom1))
+ xxh2o = propce(iel,ipproc(iym1(ih2o )))/wmole(ih2o) &
+ *propce(iel,ipproc(irom1))
+
+ xxco = max(xxco ,zero)
+ xxo2 = max(xxo2 ,zero)
+ xxco2 = max(xxco2,zero)
+ xxh2o = max(xxh2o,zero)
+
+ xco2mx=xxco2+min(xxco,2.d0*xxo2)
+
+! XKP = XK0P*EXP(-T0P/PROPCE(IEL,IPPROC(ITEMP1)))
+! XKM = XK0M*EXP(-T0M/PROPCE(IEL,IPPROC(ITEMP1)))
+
+ xkp = exp(xk0p-t0p/propce(iel,ipproc(itemp1)))
+ xkm = exp(xk0m-t0m/propce(iel,ipproc(itemp1)))
+
+! Recherche de l'�tat d'�quilibre
+
+! Recerche it�rative sans controle de convergence
+! (pour conserver la parallelisation sur les mailles)
+! sur le nombre de moles de reaction s�parant
+! l'etat avant r�action (tel que calcul� par Cpcym)
+! de l'�tat d'�quilibre
+
+! initialisation par l'�tat transport�
+
+ anmr = xxco2
+ xcot = xxco + xxco2
+ xo2t = xxo2 + 0.5d0*xxco2
+ sqh2o = sqrt(xxh2o)
+
+ iterch = 0
+ 10 continue
+
+ xco2e = anmr
+ xcoe = xcot-anmr
+ xo2e = xo2t-0.5d0*anmr
+ iterch = iterch + 1
+
+ ter1 = xkp*(xo2e**0.25d0)*sqh2o
+ if ( abs(ter1) .gt. 1.d-15 ) then
+ ddelta = (ter1*xcoe-xkm*xco2e) &
+ /(ter1*(1.d0+xcoe/(8.d0*xo2e))+xkm)
+ else
+ ddelta = 0.d0
+ endif
+
+ anmr = anmr + ddelta
+
+! Clipping
+! Cote Pauvre
+ if ( xo2t .gt. 0.5d0*xcot ) then
+ anmr = max(zero,min(xcot,anmr))
+ else
+! Cote Riche
+ anmr = max(zero,min(2.d0*xo2t,anmr))
+ endif
+
+! Test de convergence
+
+ if ( abs(ddelta) .gt. errch &
+ .and. iterch.lt.itermx ) goto 10
+
+! Calcul du nombre de points non converg�
+
+ if ( iterch.eq.itermx &
+ .and. abs(ddelta) .gt. errch ) then
+ nberic = nberic +1
+ endif
+ err1mx = max(err1mx,abs(ddelta))
+
+ xco2e = anmr
+ xcoe = xcot-anmr
+ xo2e = xo2t-0.5d0*anmr
+
+ xden = xkp*sqh2o*(0.5d0*(xo2t+xo2e))**0.25d0
+ if ( xden .ne. 0.d0 ) then
+
+ tauchi = 1.d0/xden
+ tautur = rtpa(iel,ik(iphas))/rtpa(iel,iep(iphas))
+
+ x2 = 0.d0
+ do icla = 1, nclacp
+ x2 = x2 + propce(iel,ipproc(ix2(icla)))
+ enddo
+
+ if ( ieqco2 .eq. 1 ) then
+
+! On transporte CO2
+
+ smbrs(iel) = smbrs(iel) &
+ +wmole(ico2)/propce(iel,ipproc(irom1)) &
+ * (xco2e-xxco2)/(tauchi+tautur) &
+ * (1.d0-x2) &
+ * volume(iel) * propce(iel,ipcrom)
+
+ else if ( ieqco2 .eq. 2 ) then
+
+! On transporte CO
+
+ smbrs(iel) = smbrs(iel) &
+ +wmole(ico)/propce(iel,ipproc(irom1)) &
+ * (xcoe-xxco)/(tauchi+tautur) &
+ * (1.d0-x2) &
+ * volume(iel) * propce(iel,ipcrom)
+
+ endif
+
+ w1(iel) = volume(iel)*propce(iel,ipcrom)/(tauchi+tautur)
+ rovsdt(iel) = rovsdt(iel) + max(w1(iel),zero)
+
+ else
+ rovsdt(iel) = rovsdt(iel) + 0.d0
+ smbrs(iel) = smbrs(iel) + 0.d0
+ endif
+
+ enddo
+
+ if(irangp.ge.0) then
+ call parcpt(nberic)
+ call parmax(err1mx)
+ endif
+ write(NFECRA,*) ' Erreur max = ',ERR1MX
+ write(NFECRA,*) ' Points non ',NBERIC
+
+! Terme source : combustion heterogene par le CO2
+
+ if ( ihtco2 .eq. 1) then
+
+ do iel = 1, ncel
+
+ aux = 0.d0
+ do icla = 1,nclacp
+
+ ixckcl = isca(ixck(icla))
+ ipghc2 = ipproc(ighco2(icla))
+
+ aux = aux &
+ + propce(iel,ipcrom)*propce(iel,ipghc2) &
+ *(rtpa(iel,ixckcl))**(2.d0/3.d0)*volume(iel)
+
+ enddo
+
+ rovsdt(iel) = rovsdt(iel) - aux*(wmole(ico2)/0.012)
+
+ enddo
+
+ endif
+
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES PHYSIQUE PARTICULIERE POUR LA VARIABLE ' &
+ ,a8,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cplv/cptsvc.f90 b/src/cplv/cptsvc.f90
new file mode 100644
index 0000000..849b599
--- /dev/null
+++ b/src/cplv/cptsvc.f90
@@ -0,0 +1,445 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cptsvc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ smbrs , rovsdt , &
+ wfb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME CHARBON PULVERISE
+! TERMES SOURCES DE PRODUCTION ET DE DISSIPATION POUR
+! LA VARIANCE (BILANS EXPLICITE ET IMPLICITE)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! iscala ! e ! <-- ! numero du scalaire associe !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! wfb(nfabor) ! tr ! --- ! tableau de travail faces de bord !
+! w1..8(ncelet) ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal , iscala
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision wfb(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ivar , ivarsc , ivarut , ivar0
+integer iel , iphas , ifac
+integer ipcrom , ipcvst
+integer ikiph , ieiph , iomgip , iphydp
+integer ir11ip , ir22ip , ir33ip
+integer ixchcl , ixckcl , ixnpcl , icla , icha
+integer inc , iccocg , nswrgp , imligp , iwarnp
+integer ifinra , icoefa , icoefb
+integer idimte , itenso
+
+double precision x2 , xk , xe , rhovst
+double precision epsrgp , climgp , extrap
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Numero du scalaire eventuel associe dans le cas fluctuation
+! ISCALA et numero de variable de calcul
+if (iscala.gt.0) then
+ ivarsc = isca(iscala)
+else
+ ivarsc = 0
+endif
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Numero des variables de calcul
+if ( itytur(iphas).eq.2 .or. iturb(iphas).eq.50 ) then
+ ikiph = ik (iphas)
+ ieiph = iep (iphas)
+elseif ( itytur(iphas).eq.3 ) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ieiph = iep (iphas)
+elseif ( iturb(iphas).eq.60 ) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+endif
+
+! --- Numero des grandeurs physiques
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES DE PRODUCTION PAR LES GRADIENTS
+! ET DE DISSIPATION
+!===============================================================================
+
+if ( itytur(iphas).eq.2 .or. itytur(iphas).eq.3 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60) then
+
+ inc = 1
+ iccocg = 1
+ if (ivarsc.gt.0) then
+ ivarut = ivarsc
+ else
+! A defaut de savoir pour F4M on prend comme pour F3M
+ ivarut = isca(if3m)
+ endif
+ nswrgp = nswrgr(ivarut)
+ imligp = imligr(ivarut)
+ iwarnp = iwarni(ivarut)
+ epsrgp = epsrgr(ivarut)
+ climgp = climgr(ivarut)
+ extrap = extrag(ivarut)
+
+! --> Calcul de FIM et X2 dans W7 et W8
+
+ do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+ w4(iel) = zero
+ w5(iel) = zero
+ w6(iel) = zero
+ w7(iel) = zero
+ w8(iel) = 1.d0
+ enddo
+
+! ---- W8 = X1
+
+ do icla = 1, nclacp
+ ixchcl = isca(ixch(icla))
+ ixckcl = isca(ixck(icla))
+ ixnpcl = isca(inp(icla ))
+ do iel = 1, ncel
+ x2 = rtp(iel,ixchcl)+rtp(iel,ixckcl) &
+ + rtp(iel,ixnpcl)*xmash(icla)
+ w8(iel) = w8(iel) - x2
+ enddo
+ enddo
+
+! ---- W7 = FJM (kg/kg du melange gazeux)
+
+ if (ivarsc.eq.0) then
+ do icha = 1, ncharb
+ do iel = 1, ncel
+ w1(iel) = w1(iel) + rtp(iel,isca(if1m(icha)))
+ w2(iel) = w2(iel) + rtp(iel,isca(if2m(icha)))
+ enddo
+ enddo
+ do iel = 1, ncel
+ w7(iel) = 1.d0 - &
+ ( (w1(iel) + w2(iel) + rtp(iel,isca(if3m))) &
+ / w8(iel) )
+ enddo
+ else
+ do iel = 1, ncel
+ w7(iel) = rtp(iel,ivarsc) / w8(iel)
+ enddo
+ endif
+
+! --> Calcul des COEFA et COEFB de FIM afin d'en calculer son gradient
+! On alloue localement 2 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB de FIM
+
+ icoefa = idebra
+ icoefb = icoefa + nfabor
+ ifinra = icoefb + nfabor
+ CALL RASIZE ('CPTSVC',IFINRA)
+ !==========
+
+ do ifac = 1, nfabor
+ ra(icoefa+ifac-1) = zero
+ ra(icoefb+ifac-1) = 1.d0
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+ ra(icoefa+ifac-1) = zero
+ ra(icoefb+ifac-1) = zero
+ if (ivarsc.eq.0) ra(icoefa+ifac-1) = 1.d0
+ endif
+ enddo
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(w7)
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 )
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , w7 , w7 , &
+ w7 , ra(icoefa) , ra(icoefb) , &
+! FIM COEFA COEFB
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ if ( itytur(iphas).eq.2 .or. iturb(iphas).eq.50 ) then
+ xk = rtpa(iel,ikiph)
+ xe = rtpa(iel,ieiph)
+ elseif ( itytur(iphas).eq.3 ) then
+ xk = &
+ 0.5d0*(rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip))
+ xe = rtpa(iel,ieiph)
+ elseif ( iturb(iphas).eq.60 ) then
+ xk = rtpa(iel,ikiph)
+ xe = cmu*xk*rtpa(iel,iomgip)
+ endif
+
+ rhovst = propce(iel,ipcrom)*xe/ &
+ (xk * rvarfl(iscal))*volume(iel)
+ rovsdt(iel) = rovsdt(iel) + max(zero,rhovst)
+ smbrs(iel) = smbrs(iel) + &
+ 2.d0*propce(iel,ipcvst)*volume(iel)/sigmas(iscal) &
+ * (w1(iel)**2 + w2(iel)**2 + w3(iel)**2) * w8(iel)&
+ - rhovst*rtpa(iel,ivar)
+ enddo
+
+! On libere COEFA COEFB
+ ifinra = idebra
+
+endif
+
+
+
+!--------
+! FORMATS
+!--------
+
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cplv/cptsvi.f90 b/src/cplv/cptsvi.f90
new file mode 100644
index 0000000..dd4453e
--- /dev/null
+++ b/src/cplv/cptsvi.f90
@@ -0,0 +1,283 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cptsvi &
+!================
+
+ ( ncelet , ncel , numtra , &
+ rtp , propce , volume , &
+ smbrs , rovsdt , &
+ xf1m , xf2m , &
+ w1 )
+
+!===============================================================================
+! FONCTION :
+! --------
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME CP
+! TERMES DE TRANSFERT DE MASSE ENTRE LA PHASE CONTINUE
+! ET LA PHASE DISPERSEE RELATIF A LA VARIANCE DES DIFFERENTS
+! TRACEURS (BILANS EXPLICITE ET IMPLICITE)
+
+! ATTENTION CETTE SUBROUTINE N'EST OPERATIONNELLE QUE
+! POUR NUMTRA = 3 ou 4
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! numtra ! e ! <-- ! numero du traceur concerne (1,2,3,4) !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant precedent) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! xf1m, xf2m ! tr ! <-- ! somme de f1,f2,f3,f4 sur l'ensemble !
+! ! ! ! sur l'ensemble des charbons et !
+! ! ! ! des classes !
+! w1(ncelet) ! tr ! --- ! tableau de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel , numtra
+
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision volume(ncelet)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision xf1m(ncelet) , xf2m(ncelet)
+double precision w1(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel , icla , icha
+integer iphas , ipcrom , ixchcl , ixckcl , ixnpcl
+integer ipcgd1 , ipcgd2 , ipcght , ipcdia
+
+double precision gamdev1 , gamdev2 , gmdevt , gamhet , d2s3
+double precision fdev(4) , fhet(4) , fsd(4) , fsh(4) , ftrac(4)
+double precision diamdv , diamht , x2 , xmp , diamad
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --> Calcul de X1 = 1. - SOMME(X2) dans W1
+
+do iel = 1, ncel
+ w1(iel) = 1.d0
+enddo
+
+do icla = 1, nclacp
+ ixchcl = isca(ixch(icla))
+ ixckcl = isca(ixck(icla))
+ ixnpcl = isca(inp(icla ))
+ do iel = 1, ncel
+ x2 = rtp(iel,ixchcl)+rtp(iel,ixckcl) &
+ + rtp(iel,ixnpcl)*xmash(icla)
+ w1(iel) = w1(iel) - x2
+ enddo
+enddo
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+
+! Calcul de F1 et F2 sur l'ensemble des charbons
+
+do iel = 1, ncel
+ xf1m(iel) = 0.d0
+ xf2m(iel) = 0.d0
+enddo
+do icha = 1, ncharb
+ do iel = 1, ncel
+ xf1m(iel) = xf1m(iel) + rtp(iel,isca(if1m(icha)))
+ xf2m(iel) = xf2m(iel) + rtp(iel,isca(if2m(icha)))
+ enddo
+enddo
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. CALCULS DES BILANS EXPLICITE ET IMPLICITE
+!===============================================================================
+
+do icla = 1, nclacp
+
+ ixchcl = isca(ixch(icla))
+ ixckcl = isca(ixck(icla))
+ ixnpcl = isca(inp(icla ))
+ ipcgd1 = ipproc(igmdv1(icla))
+ ipcgd2 = ipproc(igmdv2(icla))
+ ipcght = ipproc(igmhet(icla))
+ ipcdia = ipproc(idiam2(icla))
+
+ do iel = 1, ncel
+
+! --> Calculs preliminaires
+
+ ftrac(1) = xf1m(iel) / w1(iel)
+ ftrac(2) = xf2m(iel) / w1(iel)
+ ftrac(3) = rtp(iel,isca(if3m)) / w1(iel)
+ ftrac(4) = 1.d0-ftrac(1)-ftrac(2)-ftrac(3)
+
+ xmp = xmp0(icla)*rtp(iel,ixnpcl)
+ x2 = rtp(iel,ixchcl) + rtp(iel,ixckcl) + &
+ rtp(iel,ixnpcl)*xmash(icla)
+
+ if ( xmp .gt. epsicp .and. &
+ x2 .gt. epsicp ) then
+
+! --> Prise en compte des TS interfaciaux relatifs
+! au phenomene de devolatilisation
+
+ if (rtp(iel,ixchcl).gt.epsicp) then
+
+! On prend comme diametre le diametre initial de la particule
+! la devolatilisation ayant lieu a diametre constant
+
+ diamdv = diam20(icla)
+ fsd(1) = 1.d0 - (1.d0-ftrac(1)) &
+ * exp( ( rtp(iel,ixchcl)*propce(iel,ipcgd1) ) &
+ /( 2.d0*pi*2.77d-4*diamdv &
+ *rtp(iel,ixnpcl)*propce(iel,ipcrom) ) )
+
+ fsd(2) = 1.d0 - (1.d0-ftrac(2)) &
+ * exp( ( rtp(iel,ixchcl)*propce(iel,ipcgd2) ) &
+ /( 2.d0*pi*2.77d-4*diamdv &
+ *rtp(iel,ixnpcl)*propce(iel,ipcrom) ) )
+
+ fsd(3) = ftrac(3) * (1.d0 - fsd(1) - fsd(2)) &
+ / (1.d0 - ftrac(1) - ftrac(2))
+ fsd(4) = ftrac(4) * (1.d0 - fsd(1) - fsd(2)) &
+ / (1.d0 - ftrac(1) - ftrac(2))
+
+ gamdev1 = - propce(iel,ipcrom) * rtp(iel,ixchcl) &
+ * propce(iel,ipcgd1)
+ gamdev2 = - propce(iel,ipcrom) * rtp(iel,ixchcl) &
+ * propce(iel,ipcgd2)
+ gmdevt = gamdev1+gamdev2
+
+ fdev(1) = gamdev1 / gmdevt
+ fdev(2) = gamdev2 / gmdevt
+ fdev(3) = zero
+ fdev(4) = zero
+
+ if ( (fsd(numtra)-ftrac(numtra)) &
+ *(2.d0*fdev(numtra)-fsd(numtra)-ftrac(numtra)) &
+ .gt. epsicp ) then
+ smbrs(iel) = smbrs(iel) + gmdevt &
+ *volume(iel)*(fsd(numtra)-ftrac(numtra)) &
+ *(2.d0*fdev(numtra)-fsd(numtra)-ftrac(numtra))
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ endif
+
+ endif
+
+! --> Prise en compte des TS interfaciaux relatifs
+! au phenomene de combustion heterogene
+
+! On prend comme diametre le diametre du coke
+
+ diamht = propce(iel,ipcdia)
+ diamad = propce(iel,ipcdia) / diam20(icla)
+ fsh(3) = 1.d0
+ if ( diamad.gt.epsicp ) then
+ fsh(3) = 1.d0 - (1.d0-ftrac(3)) &
+ * exp( ( (rtp(iel,ixckcl)**d2s3) &
+ *propce(iel,ipcght) ) &
+ /( 2.d0*pi*2.77d-4*diamht &
+ *rtp(iel,ixnpcl)*propce(iel,ipcrom) ) )
+ endif
+
+ fsh(1) = ftrac(1) * (1.d0-fsh(3))/(1.d0-ftrac(3))
+ fsh(2) = ftrac(2) * (1.d0-fsh(3))/(1.d0-ftrac(3))
+ fsh(4) = ftrac(4) * (1.d0-fsh(3))/(1.d0-ftrac(3))
+
+ gamhet = - propce(iel,ipcrom) * (rtp(iel,ixckcl)**d2s3) &
+ * propce(iel,ipcght)
+
+ fhet(1) = zero
+ fhet(2) = zero
+ fhet(3) = 1.d0
+ fhet(4) = zero
+
+ if ( (fsh(numtra)-ftrac(numtra)) &
+ *(2.d0*fhet(numtra)-fsh(numtra)-ftrac(numtra)) &
+ .gt. epsicp ) then
+ smbrs(iel) = smbrs(iel) + gamhet &
+ *volume(iel)*(fsh(numtra)-ftrac(numtra)) &
+ *(2.d0*fhet(numtra)-fsh(numtra)-ftrac(numtra))
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ endif
+
+ endif
+
+ enddo
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/cplv/cpvarp.f90 b/src/cplv/cpvarp.f90
new file mode 100644
index 0000000..bb9b589
--- /dev/null
+++ b/src/cplv/cpvarp.f90
@@ -0,0 +1,187 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine cpvarp
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES TRANSPORTEES POUR
+! COMBUSTION CHARBON PULVERISE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+integer icla, is, iphas, icha, isc , is1
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! ---> Variables propres a la suspension gaz - particules
+
+ihm = iscapp(1)
+
+! ---> Variables propres a la phase dispersee
+
+do icla = 1, nclacp
+ is = 1+icla
+ inp(icla) = iscapp(is)
+ is = 1+1*nclacp+icla
+ ixch(icla)= iscapp(is)
+ is = 1+2*nclacp+icla
+ ixck(icla) = iscapp(is)
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ is = 1+3*nclacp+icla
+ ixwt(icla) = iscapp(is)
+
+ is = 1+4*nclacp+icla
+ ih2(icla) = iscapp(is)
+
+ else
+ is = 1+3*nclacp+icla
+ ih2(icla) = iscapp(is)
+ endif
+
+enddo
+
+! ---> Variables propres a la phase continue
+
+is1 = is
+do icha = 1, ncharb
+ is = is1+icha
+ if1m(icha) = iscapp(is)
+ is = is1+ncharb+icha
+ if2m(icha) = iscapp(is)
+enddo
+
+is = is+1
+if3m = iscapp(is)
+if ( ihtco2 .eq. 1) then
+ is = is+1
+ if3mc2 = iscapp(is)
+endif
+is = is+1
+if4p2m = iscapp(is)
+if ( ippmod(icp3pl) .eq. 1 ) then
+ is = is+1
+ if5m = iscapp(is)
+endif
+
+if ( noxyd .ge. 2 ) then
+ is = is+1
+ if6m = iscapp(is)
+endif
+if ( noxyd .eq. 3 ) then
+ is = is+1
+ if7m = iscapp(is)
+endif
+
+if ( ieqco2 .ge. 1 ) then
+ is = is+1
+ iyco2 = iscapp(is)
+endif
+
+! - Interface Code_Saturne
+! ======================
+! Construction de l'indirection entre la numerotation du noyau et XML
+
+if (iihmpr.eq.1) then
+ call uicpsc (ncharb, nclacp, noxyd, ippmod, &
+ icp3pl, ieqco2, ihtco2, &
+ ihm, inp, ixch, ixck, ixwt, ih2, &
+ if1m, if2m, if3m, if3mc2, if4p2m, &
+ if5m, if6m, if7m, iyco2)
+endif
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+! A RENSEIGNER OBLIGATOIREMENT (sinon pb dans varpos)
+! - PROPRES AUX SCALAIRES : IPHSCA, IVISLS, ISCAVR
+! Rq : pas de variance associee a un scalaire dans notre cas
+! - PROPRES A LA SUSPENSION : ICP
+!===============================================================================
+
+do isc = 1, nscapp
+
+ if ( iscavr(iscapp(isc)).le.0 ) then
+
+! ---- Notre physique particuliere est monophasique
+ iphsca(iscapp(isc)) = 1
+
+! ---- Viscosite dynamique de reference relative au scalaire
+! ISCAPP(ISC)
+ ivisls(iscapp(isc)) = 0
+
+ endif
+
+enddo
+
+! ---- Bien que l'on soit en enthalpie on conserve un CP constant
+
+iphas = iphsca(ihm)
+icp(iphas) = 0
+
+return
+end
diff --git a/src/cplv/cpveri.f90 b/src/cplv/cpveri.f90
new file mode 100644
index 0000000..8cb3384
--- /dev/null
+++ b/src/cplv/cpveri.f90
@@ -0,0 +1,176 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cpveri &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL
+! COMBUSTION CHARBON PULVERISE
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+integer iphas
+
+!===============================================================================
+
+!===============================================================================
+! 1. OPTIONS DU CALCUL : TABLEAUX DE ppincl.h : formats 2000
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+
+if( srrom.lt.0d0 .or. srrom.ge.1d0) then
+ WRITE(NFECRA,2000)'SRROM ', SRROM
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 2. TABLEAUX DE cstphy.h et ppthch.F : formats 3000
+!===============================================================================
+
+iphas = 1
+
+! --> Masse volumique
+
+if( ro0(iphas).lt.0d0) then
+ WRITE(NFECRA,3000)IPHAS,'RO0 ', RO0(IPHAS)
+ iok = iok + 1
+ endif
+
+! --> Diffusivite dynamique en kg/(m s) : DIFTL0
+
+if( diftl0.lt.0d0) then
+ WRITE(NFECRA,3010)'DIFTL0', DIFTL0
+ iok = iok + 1
+else
+ visls0(ihm) = diftl0
+endif
+
+!===============================================================================
+! 3. FORMATS VERIFICATION
+!===============================================================================
+
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6, ' DOIT ETRE UN REEL ',/,&
+'@ SUPERIEUR OU EGAL A ZERO ET INFERIEUR STRICTEMENT A 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpi1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpi1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier uscpi1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 4. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/cplv/memcp1.f90 b/src/cplv/memcp1.f90
new file mode 100644
index 0000000..d88027e
--- /dev/null
+++ b/src/cplv/memcp1.f90
@@ -0,0 +1,138 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memcp1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ nvar , ncelet , ncel , nfac , nfabor , &
+ ntbcpi , icpwi , &
+ ntbcpr , icpwr , &
+ ntbmci , imcwi , &
+ ntbmcr , imcwr , &
+ ntbwoi , iwori , &
+ ntbwor , iworr , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! PHYSIQUE PARTICULIERE : FLAMME CHARBON PULVERISE
+! GESTION MEMOIRE CALCUL DES PROPRIETES PHYSIQUES PHASE GAZ
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nvar ! e ! <-- ! nombre de variables !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ntbcpi ! e ! <-- ! taille du macro tableau cp entiers !
+! icpwi ! e ! --> ! pointeur macro tableau cp entiers !
+! ntbcpr ! e ! <-- ! taille du macro tableau cp reels !
+! icpwr ! e ! --> ! pointeur macro tableau cp reels !
+! ntbmci ! e ! <-- ! taille du macro tableau mc entiers !
+! imcwi ! e ! --> ! pointeur macro tableau mc entiers !
+! ntbmcr ! e ! <-- ! taille du macro tableau mc reels !
+! imcwr ! e ! --> ! pointeur macro tableau mc reels !
+! ntbwoi ! e ! <-- ! taille du macro tableau work entiers !
+! iwori ! e ! --> ! pointeur macro tableau work entiers !
+! ntbwor ! e ! <-- ! taille du macro tableau work reels !
+! iworr ! e ! --> ! pointeur macro tableau work reels !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ra en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 ,idbra0
+integer nvar
+integer ncelet , ncel , nfac , nfabor
+integer ntbcpi , icpwi , ntbcpr , icpwr
+integer ntbmci , imcwi , ntbmcr , imcwr
+integer ntbwoi , iwori , ntbwor , iworr
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+icpwi = idebia
+imcwi = icpwi + ntbcpi*ncelet
+iwori = imcwi + ntbmci*ncelet
+ifinia = iwori + ntbwoi*ncelet
+
+icpwr = idebra
+imcwr = icpwr + ntbcpr*ncelet
+iworr = imcwr + ntbmcr*ncelet
+ifinra = iworr + ntbwor*ncelet
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMPH1',IFINIA)
+!==========
+
+CALL RASIZE('MEMPH1',IFINRA)
+!==========
+
+return
+end
diff --git a/src/ctwr/Makefile.am b/src/ctwr/Makefile.am
new file mode 100644
index 0000000..2cd401d
--- /dev/null
+++ b/src/ctwr/Makefile.am
@@ -0,0 +1,77 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/ctwr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MPI_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/ctwr \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/ctwr/cs_ctwr_air_props.h \
+$(top_srcdir)/include/ctwr/cs_ctwr.h \
+$(top_srcdir)/include/ctwr/cs_ctwr_halo.h \
+$(top_srcdir)/include/ctwr/cs_ctwr_mesh.h \
+$(top_srcdir)/include/ctwr/ctincl.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcsctwr.la
+libcsctwr_la_SOURCES = \
+cs_ctwr.c \
+cs_ctwr_air_props.c \
+cs_ctwr_f2c.f90 \
+cs_ctwr_halo.c \
+cs_ctwr_mesh.c \
+ctini1.f90 \
+ctiniv.f90 \
+ctphyv.f90 \
+cttssc.f90 \
+ctvarp.f90
+libcsctwr_la_LDFLAGS = -no-undefined
+
+libcsctwr_la_SOURCES += \
+$(top_srcdir)/users/ctwr/usctcl.f90 \
+$(top_srcdir)/users/ctwr/usctdz.f90 \
+$(top_srcdir)/users/ctwr/uscti1.f90 \
+$(top_srcdir)/users/ctwr/usctiv.f90
+
+ctwrdir = $(pkgdatadir)/users/ctwr
+ctwr_DATA = \
+$(top_srcdir)/users/ctwr/usctcl.f90 \
+$(top_srcdir)/users/ctwr/usctdz.f90 \
+$(top_srcdir)/users/ctwr/uscti1.f90 \
+$(top_srcdir)/users/ctwr/usctiv.f90
diff --git a/src/ctwr/Makefile.in b/src/ctwr/Makefile.in
new file mode 100644
index 0000000..07a22df
--- /dev/null
+++ b/src/ctwr/Makefile.in
@@ -0,0 +1,681 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/ctwr
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcsctwr_la_LIBADD =
+am_libcsctwr_la_OBJECTS = cs_ctwr.lo cs_ctwr_air_props.lo \
+ cs_ctwr_f2c.lo cs_ctwr_halo.lo cs_ctwr_mesh.lo ctini1.lo \
+ ctiniv.lo ctphyv.lo cttssc.lo ctvarp.lo usctcl.lo usctdz.lo \
+ uscti1.lo usctiv.lo
+libcsctwr_la_OBJECTS = $(am_libcsctwr_la_OBJECTS)
+libcsctwr_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcsctwr_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcsctwr_la_SOURCES)
+DIST_SOURCES = $(libcsctwr_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(ctwrdir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+ctwrDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(ctwr_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/ctwr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MPI_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/ctwr \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/ctwr/cs_ctwr_air_props.h \
+$(top_srcdir)/include/ctwr/cs_ctwr.h \
+$(top_srcdir)/include/ctwr/cs_ctwr_halo.h \
+$(top_srcdir)/include/ctwr/cs_ctwr_mesh.h \
+$(top_srcdir)/include/ctwr/ctincl.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcsctwr.la
+libcsctwr_la_SOURCES = cs_ctwr.c cs_ctwr_air_props.c cs_ctwr_f2c.f90 \
+ cs_ctwr_halo.c cs_ctwr_mesh.c ctini1.f90 ctiniv.f90 ctphyv.f90 \
+ cttssc.f90 ctvarp.f90 $(top_srcdir)/users/ctwr/usctcl.f90 \
+ $(top_srcdir)/users/ctwr/usctdz.f90 \
+ $(top_srcdir)/users/ctwr/uscti1.f90 \
+ $(top_srcdir)/users/ctwr/usctiv.f90
+libcsctwr_la_LDFLAGS = -no-undefined
+ctwrdir = $(pkgdatadir)/users/ctwr
+ctwr_DATA = \
+$(top_srcdir)/users/ctwr/usctcl.f90 \
+$(top_srcdir)/users/ctwr/usctdz.f90 \
+$(top_srcdir)/users/ctwr/uscti1.f90 \
+$(top_srcdir)/users/ctwr/usctiv.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ctwr/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/ctwr/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcsctwr.la: $(libcsctwr_la_OBJECTS) $(libcsctwr_la_DEPENDENCIES)
+ $(libcsctwr_la_LINK) $(libcsctwr_la_OBJECTS) $(libcsctwr_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ctwr.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ctwr_air_props.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ctwr_halo.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_ctwr_mesh.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+usctcl.lo: $(top_srcdir)/users/ctwr/usctcl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usctcl.lo `test -f '$(top_srcdir)/users/ctwr/usctcl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/ctwr/usctcl.f90
+
+usctdz.lo: $(top_srcdir)/users/ctwr/usctdz.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usctdz.lo `test -f '$(top_srcdir)/users/ctwr/usctdz.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/ctwr/usctdz.f90
+
+uscti1.lo: $(top_srcdir)/users/ctwr/uscti1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uscti1.lo `test -f '$(top_srcdir)/users/ctwr/uscti1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/ctwr/uscti1.f90
+
+usctiv.lo: $(top_srcdir)/users/ctwr/usctiv.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usctiv.lo `test -f '$(top_srcdir)/users/ctwr/usctiv.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/ctwr/usctiv.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-ctwrDATA: $(ctwr_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(ctwrdir)" || $(MKDIR_P) "$(DESTDIR)$(ctwrdir)"
+ @list='$(ctwr_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(ctwrDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(ctwrdir)/$$f'"; \
+ $(ctwrDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(ctwrdir)/$$f"; \
+ done
+
+uninstall-ctwrDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(ctwr_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(ctwrdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(ctwrdir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(ctwrdir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-ctwrDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-ctwrDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-ctwrDATA install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-saturneincludeHEADERS \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-ctwrDATA uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/ctwr/cs_ctwr.c b/src/ctwr/cs_ctwr.c
new file mode 100644
index 0000000..d1bae84
--- /dev/null
+++ b/src/ctwr/cs_ctwr.c
@@ -0,0 +1,2677 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Definitions, Global variables variables, and functions associated with the
+ * exchange zones
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_mem.h>
+#include <bft_file.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_locator.h>
+#include <fvm_nodal_extract.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_ctwr_air_props.h"
+#include "cs_ctwr_halo.h"
+#include "cs_halo.h"
+#include "cs_post.h"
+#include "cs_restart.h"
+#include "cs_selector.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ctwr.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+enum {X, Y, Z} ;
+
+#define CS_LOC_PRODUIT_SCALAIRE(vect1, vect2) \
+ (vect1[X] * vect2[X] + vect1[Y] * vect2[Y] + vect1[Z] * vect2[Z])
+
+#define CS_LOC_MODULE(vect) \
+ sqrt(vect[X] * vect[X] + vect[Y] * vect[Y] + vect[Z] * vect[Z])
+
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* array of exchanges area */
+
+cs_int_t cs_glob_ct_nbr_max = 0;
+
+cs_int_t cs_glob_ct_nbr = 0 ;
+cs_ctwr_zone_t ** cs_glob_ct_tab = NULL;
+
+/* Start and end (negative) numbers associated with
+ dedicated post processing meshes */
+
+static int cs_glob_ct_post_mesh_ext[2] = {0, 1};
+
+/* array containing the stacking of the exchange area*/
+cs_int_t * cs_stack_ct = NULL;
+
+/* array containing the treatment order of the exchanges areas */
+cs_int_t * cs_chain_ct = NULL;
+
+/* Restart file */
+
+static cs_restart_t *cs_glob_ctwr_suite = NULL;
+
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Open the restart file associated to cs_tpar1d
+ * Allocate cs_glob_ctwr_suite
+ *
+ * parameters:
+ * nomsui <- name of the restart file
+ * lngnom <- name length
+ * ireawr <- 1 for reading, 2 for writing
+ *----------------------------------------------------------------------------*/
+
+static void
+cs_loc_ctwr_opnsuite(const char *nomsui,
+ const cs_int_t *lngnom,
+ const cs_restart_mode_t ireawr)
+{
+ char *nombuf;
+
+ /* Name treatment for the C API */
+ nombuf = cs_base_string_f_to_c_create(nomsui, *lngnom);
+
+ cs_glob_ctwr_suite = cs_restart_create(nombuf, ireawr);
+
+ /* Free the memory if necessary */
+ cs_base_string_f_to_c_free(&nombuf);
+}
+
+/*============================================================================
+ * Fonctions publiques pour API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Ajout d'une zone d'echange
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE DEFCT1
+ *
+ * INTEGER ICOUL : <-- : Couleur des elements de la zone d'echange
+ * INTEGER IMctCH : <-- :
+ * INTEGER NTYPct : <-- :
+ * INTEGER NELEct : <-- :
+ * REAL XAP : <-- :
+ * REAL XNP : <-- :
+ * REAL SURFACE : <-- : Surface de la face superieure de la ct
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (defct1, DEFCT1)
+(
+ const cs_int_t *const idimct, /* Dimemsion du probleme 2:2D 3:3D */
+ const char *ze_name, /* Name of Ct area */
+ cs_int_t *ze_n_len, /* lenght of Name of Ct area */
+ const cs_int_t *const imctch, /* 1: Modele de Poppe
+ 2: Merkel 0: Rien */
+ const cs_int_t *const ntypct, /* 1: Contre courant 2: Courant croises
+ 3: Zone de pluie */
+ const cs_int_t *const nelect, /* Nombre d'elements sur chaque ligne du
+ maillage eau pour la zone de noeuds par
+ segment eau */
+ const cs_real_t *const deltat, /* Ecart de temperature impos� en entree
+ de la zone d'echange */
+ const cs_real_t *const teau, /* Teau en entree de la zone d'echange */
+ const cs_real_t *const fem, /* fem en entree de la zone d'echange */
+ const cs_real_t *const xap, /* coefficient lambda de la loi d'echange */
+ const cs_real_t *const xnp, /* exposant n de la loi d'echange */
+ const cs_real_t *const surface, /* Surface totale arrivee d eau de la ct */
+ const cs_real_t *const dgout /* Diametre de goutte pour
+ les zones de pluie */
+)
+{
+ char *_ze_name = NULL;
+
+ if (ze_name != NULL && *ze_n_len > 0)
+ _ze_name = cs_base_string_f_to_c_create(ze_name,
+ *ze_n_len);
+ if (_ze_name != NULL && strlen(_ze_name) == 0)
+ cs_base_string_f_to_c_free(&_ze_name);
+
+ cs_ctwr_definit(*idimct,_ze_name, *imctch,*ntypct,*nelect,
+ *deltat,*teau,*fem,*xap,*xnp,*surface,*dgout);
+
+ if (_ze_name != NULL)
+ cs_base_string_f_to_c_free(&_ze_name);
+}
+
+/*----------------------------------------------------------------------------
+ * R�cup�ration du nombre de zones d'echanges
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE NBZECT
+ * *****************
+ *
+ * INTEGER NBRct : --> : nombre de zones d'echange
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (nbzect, NBZECT)
+(
+ cs_int_t *const nbrct /* <-- nombre de zones d'echanges */
+)
+{
+ *nbrct = cs_glob_ct_nbr ;
+}
+
+/*----------------------------------------------------------------------------
+ * R�cup�ration du modele de Poppe ou de Merkel
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE AEMODEL
+ * ******************
+ *
+ * INTEGER IMctCH : --> : type de ct (Poppe ou Merkel)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aemode, AEMODE)
+(
+ cs_int_t *const imctch /* <-- type de ct (Poppe ou Merkel) */
+)
+{
+ cs_ctwr_zone_t *ct = cs_glob_ct_tab[0];
+
+ *imctch = ct->imctch;
+}
+
+/*----------------------------------------------------------------------------
+ * Addition d'une constante au vecteur de temperature pour toutes les zones
+ * d'echange
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE AEPROTP
+ * ******************
+ *
+ * INTEGER IMctCH : --> : type de ct (Poppe ou Merkel)
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aeprot, AEPROT)
+(
+ cs_real_t *const cons /* <-- constante */
+)
+{
+ cs_int_t ct_id, i, j, ii;
+ cs_ctwr_zone_t *ct;
+
+ for (ct_id = 0; ct_id < cs_glob_ct_nbr; ct_id++) {
+
+ ct = cs_glob_ct_tab[ct_id];
+
+ for (i = 0; i < ct->nnpsct; i++)
+ for (j = 0; j < ct->nelect; j++) {
+ ii = i*ct->nelect + j;
+ ct->teau[ii] += (*cons);
+ }
+
+ }
+}
+
+
+/*----------------------------------------------------------------------------
+ * Resolution des variables eau
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE AETEAU ( )
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aeteau, AETEAU)
+(
+ cs_real_t temp[], /* Temperature air */
+ cs_real_t xa[] , /* humidite air */
+ cs_real_t rho[] , /* masse volumique air */
+ cs_real_t vitx[], /* vitesse air suivant x */
+ cs_real_t vity[], /* vitesse air suivant y */
+ cs_real_t vitz[] /* vitesse air suivant z */
+
+)
+{
+ cs_ctwr_aeteau(temp,xa,rho,vitx,vity,vitz);
+}
+
+
+/*----------------------------------------------------------------------------
+ * Calcul des termes sources pour l'air
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE AETSSC ( )
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aetssc, AETSSC)
+(
+ const cs_int_t *const iscal, /* */
+
+ cs_real_t temp[] , /* Temperature air */
+ cs_real_t xa[] , /* humidite air */
+ cs_real_t rho[] , /* masse volumique air */
+ cs_real_t utsim[], /* vitesse verticale air */
+ cs_real_t utsex[], /* vitesse horizontale air */
+ cs_real_t vitx[] , /* vitesse air suivant x */
+ cs_real_t vity[] , /* vitesse air suivant y */
+ cs_real_t vitz[] /* vitesse air suivant z */
+)
+{
+ cs_ctwr_aetssc(*iscal, temp,xa,rho,utsim,utsex,vitx,vity,vitz);
+}
+
+
+
+
+/*----------------------------------------------------------------------------
+ * Calcul des PdC induites dans les zones de pluie
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE AETSVI ( )
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (aetsvi, AETSVI)
+(
+ const cs_int_t *const idim,
+ const cs_real_t rho[], /* masse volumique air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[], /* vitesse air suivant z */
+ const cs_real_t xair[], /* humidite de l'air */
+ cs_real_t utsex[] /* terme source explicite */
+
+)
+{
+ cs_ctwr_aetsvi(*idim,rho,vitx,vity,vitz,xair,utsex);
+
+}
+
+
+
+/*----------------------------------------------------------------------------
+ * Bilan dans les ct
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE BILANct ( )
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (bilanct, BILANCT)
+(
+ const cs_real_t *const time,
+ cs_real_t fem_entree[], /* debit eau entree */
+ cs_real_t fem_sortie[], /* debit eau sortie */
+ cs_real_t teau_entree[], /* temperature eau entree */
+ cs_real_t teau_sortie[], /* temperature eau sortie */
+ cs_real_t heau_entree[], /* enthalpie eau entree */
+ cs_real_t heau_sortie[], /* enthalpie eau sortie */
+ cs_real_t tair_entree[], /* temperature air entree */
+ cs_real_t tair_sortie[], /* temperature air sortie */
+ cs_real_t xair_entree[], /* */
+ cs_real_t xair_sortie[], /* */
+ cs_real_t hair_entree[], /* */
+ cs_real_t hair_sortie[], /* */
+ cs_real_t debit_entree[], /* */
+ cs_real_t debit_sortie[], /* */
+
+ const cs_real_t temp[], /* Temperature air */
+ const cs_real_t xa[], /* humidite air */
+ const cs_real_t flux_masse_fac[], /* vitesse verticale air */
+ const cs_real_t flux_masse_fbr[], /* vitesse horizontale air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[] /* vitesse air suivant z */
+)
+{
+ cs_ctwr_bilanct(*time,fem_entree,fem_sortie,teau_entree,teau_sortie,
+ heau_entree,heau_sortie,tair_entree,tair_sortie,
+ xair_entree,xair_sortie,hair_entree,hair_sortie,
+ debit_entree,debit_sortie,
+ temp,xa,flux_masse_fac,flux_masse_fbr,vitx,vity,vitz,
+ cs_glob_mesh, cs_glob_mesh_quantities);
+
+}
+
+/*----------------------------------------------------------------------------
+ * Initialict post processing.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE PSTIct
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(pstict, PSTICT)
+(
+ void
+)
+{
+ cs_int_t ct_id;
+
+ for (ct_id = 0; ct_id < cs_glob_ct_nbr; ct_id++)
+ cs_ctwr_post_init(ct_id, -1);
+}
+
+/*----------------------------------------------------------------------------
+ * Write the restart file of the cooling tower module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECT1D
+ * *****************
+ *
+ * CHARACTER NOMSUI : <-- : Name of the restart file
+ * INTEGER LNGNOM : <-- : Name length
+
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ecrctw, ECRCTW)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom
+)
+{
+ cs_int_t nbvent, ierror;
+ cs_int_t ict;
+
+ cs_restart_t *suite;
+ cs_restart_location_t location_id,support;
+ cs_type_t typ_val;
+
+ cs_ctwr_zone_t *ct;
+ char *location_name = NULL;
+ cs_int_t length = 0;
+ fvm_gnum_t *g_elt_num = NULL;
+
+ fvm_lnum_t n_g_elements, n_elements;
+
+ ierror = CS_RESTART_SUCCES;
+
+ /* Open the restart file */
+
+ cs_loc_ctwr_opnsuite(nomsui, lngnom, CS_RESTART_MODE_WRITE);
+
+ /* Pointer to the global restart structure */
+ suite = cs_glob_ctwr_suite;
+
+ if (cs_glob_ctwr_suite == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Abort while opening the cooling tower module restart "
+ "file in write mode.\n"
+ "Verify the existence and the name of the restart file: %s\n"),
+ *nomsui);
+
+ for (ict=0; ict < cs_glob_ct_nbr; ict++) {
+
+ ct = cs_glob_ct_tab[ict];
+
+ length = strlen("Cooling_Tower_restart_") + 3 ;
+ BFT_MALLOC(location_name, length, char);
+ sprintf(location_name, "Cooling_Tower_restart_%02d", ct->num);
+
+ n_g_elements = fvm_nodal_get_n_g_elements(ct->water_mesh, FVM_CELL_HEXA);
+ n_elements = fvm_nodal_get_n_elements(ct->water_mesh, FVM_CELL_HEXA);
+
+ BFT_MALLOC(g_elt_num, n_g_elements, fvm_gnum_t);
+
+ fvm_nodal_get_global_element_num(ct->water_mesh,
+ FVM_CELL_HEXA,
+ g_elt_num);
+
+ location_id = cs_restart_add_location(suite,
+ location_name,
+ n_g_elements,
+ n_elements,
+ g_elt_num);
+
+
+ { /* Write the header */
+ char * nomrub;
+ cs_int_t *tabvar;
+
+ length = strlen("Parametres_int_ctwr_") + 3 ;
+ BFT_MALLOC(nomrub, length, char);
+ sprintf(nomrub, "Parametres_int_ctwr_%02d", ct->num);
+
+
+ BFT_MALLOC(tabvar, 3, cs_int_t);
+
+ tabvar[ 0 ] = ct->imctch; /* modele*/
+ tabvar[ 1 ] = ct->ntypct; /* Type*/
+ tabvar[ 2 ] = ct->nelect; /* nb of node per segment*/
+
+ nbvent = 3;
+ support = CS_RESTART_LOCATION_NONE;
+ typ_val = CS_TYPE_cs_int_t;
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+ {/* Write the header */
+ char * nomrub;
+ cs_real_t *tabvar;
+
+ length = strlen("Parametres_real_ctwr_") + 3 ;
+ BFT_MALLOC(nomrub, length, char);
+ sprintf(nomrub, "Parametres_real_ctwr_%02d", ct->num);
+
+ BFT_MALLOC(tabvar, 4, cs_real_t);
+
+ tabvar[ 0 ] = ct->cl_teau; /* Water entry temperature*/
+ tabvar[ 1 ] = ct->cl_fem; /* Water flow */
+ tabvar[ 2 ] = ct->xap; /* xap */
+ tabvar[ 3 ] = ct->xnp; /* xnp */
+
+
+ nbvent = 4;
+ support = CS_RESTART_LOCATION_NONE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ cs_restart_write_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ BFT_FREE(tabvar);
+ }
+
+
+ { /* Write the temperature */
+ char nomrub[] = "Temperature_eau";
+
+ typ_val = CS_TYPE_cs_real_t;
+ nbvent = 1;
+ cs_restart_write_section(suite,
+ nomrub,
+ location_id,
+ nbvent,
+ typ_val,
+ ct->teau);
+
+ }
+
+ { /* Write the */
+ char nomrub[] = "Flux_eau";
+
+ typ_val = CS_TYPE_cs_real_t;
+ nbvent = 1;
+ cs_restart_write_section(suite,
+ nomrub,
+ location_id,
+ nbvent,
+ typ_val,
+ ct->fem);
+
+ }
+
+ {/* Write the */
+ char nomrub[] = "vitesse_goutte";
+
+ typ_val = CS_TYPE_cs_real_t;
+ nbvent = 1;
+ cs_restart_write_section(suite,
+ nomrub,
+ location_id,
+ nbvent,
+ typ_val,
+ ct->vgoutte);
+
+ }
+
+ }
+
+ /* Close the restart file and free structures */
+ cs_restart_destroy(cs_glob_ctwr_suite);
+ cs_glob_ctwr_suite = NULL;
+}
+
+/*----------------------------------------------------------------------------
+ * Read the restart file of the cooling tower module
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE LECTWR
+ * *****************
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (lecctw, LECCTW)
+(
+ const char *const nomsui,
+ const cs_int_t *const lngnom
+)
+{
+ cs_bool_t corresp_cel, corresp_fac, corresp_fbr, corresp_som;
+ cs_int_t nbvent;
+ cs_int_t i, ict,indfac, ierror;
+
+ cs_restart_t *suite;
+ cs_restart_location_t location_id,support;
+ cs_type_t typ_val;
+
+ fvm_lnum_t n_g_elements, n_elements;
+
+ cs_ctwr_zone_t *ct;
+
+ char *location_name = NULL;
+ cs_int_t length = 0;
+ fvm_gnum_t *g_elt_num = NULL;
+
+ ierror = CS_RESTART_SUCCES;
+
+ /* Open the restart file */
+
+ cs_loc_ctwr_opnsuite(nomsui, lngnom, CS_RESTART_MODE_READ);
+
+
+ if (cs_glob_ctwr_suite == NULL)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Abort while opening the cooling tower AERO module restart file "
+ "in read mode.\n"
+ "Verify the existence and the name of the restart file: %s\n"),
+ *nomsui);
+
+
+ /* Pointer to the global restart structure */
+ suite = cs_glob_ctwr_suite;
+
+ /* Verification of the associated "support" to the restart file */
+ cs_restart_check_base_location(suite, &corresp_cel, &corresp_fac,
+ &corresp_fbr, &corresp_som);
+
+ /* Only boundary faces are of interest */
+ indfac = (corresp_fbr == true ? 1 : 0);
+ if (indfac == 0)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Abort while reading the 1D-wall thermal module restart file.\n"
+ "The number of boundary faces has been modified\n"
+ "Verify that the restart file corresponds to "
+ "the present study.\n"));
+
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ ct = cs_glob_ct_tab[ict];
+ length = strlen("Cooling_Tower_restart_") + 3 ;
+ BFT_MALLOC(location_name, length, char);
+ sprintf(location_name, "Cooling_Tower_restart_%02d", ct->num);
+
+ n_g_elements = fvm_nodal_get_n_g_elements(ct->water_mesh, FVM_CELL_HEXA);
+ n_elements = fvm_nodal_get_n_elements (ct->water_mesh, FVM_CELL_HEXA);
+
+ BFT_MALLOC( g_elt_num , n_g_elements, fvm_gnum_t );
+
+ fvm_nodal_get_global_element_num( ct->water_mesh ,
+ FVM_CELL_HEXA ,
+ g_elt_num );
+
+ location_id = cs_restart_add_location( suite,
+ location_name,
+ n_g_elements,
+ n_elements,
+ g_elt_num );
+
+
+ {
+ char * nomrub;
+ length = strlen("Parametres_int_ctwr_") + 3 ;
+ BFT_MALLOC(nomrub, length, char);
+ sprintf(nomrub, "Parametres_int_ctwr_%02d", ct->num);
+ cs_int_t *tabvar;
+
+ BFT_MALLOC(tabvar, 3, cs_int_t);
+
+ nbvent = 3;
+ support = CS_RESTART_LOCATION_NONE;
+ typ_val = CS_TYPE_cs_int_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for the cooling tower module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ /* Coherency checks between the read and the one from usctdz */
+
+ if (tabvar[ 0 ] != ct->imctch )/* modele*/
+ bft_printf(_("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** cooling tower MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The model is different \n"
+ "PREVIOUS: %d \n"
+ "CURRENT: %d \n" ), tabvar[ 0 ], ct->imctch);
+
+ if (tabvar[ 1 ] != ct->ntypct ) /* Type*/
+ bft_error( __FILE__, __LINE__, 0,
+ _("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** cooling tower MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The type is different \n"
+ "PREVIOUS: %d \n"
+ "CURRENT: %d \n" ), tabvar[ 1 ], ct->ntypct);
+
+ if (tabvar[ 2 ] != ct->nelect ) /* nb of node per segment*/
+ bft_error(__FILE__, __LINE__, 0,
+ _("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** cooling tower MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The number of nodes on each vertical mesh for \n"
+ "the water mesh has been modified.\n"
+ "PREVIOUS: %d nodes\n"
+ "CURRENT: %d nodes\n"
+ "\n"
+ "The calculation will not be run.\n"
+ "\n"
+ "Verify that the restart file corresponds to a\n"
+ "restart file for the cooling tower module.\n"
+ "Verify usctdz.\n"), tabvar[ 2 ], ct->nelect);
+
+
+ BFT_FREE(tabvar);
+
+ }
+
+ {
+ char * nomrub;
+ length = strlen("Parametres_real_ctwr_") + 3 ;
+ BFT_MALLOC(nomrub, length, char);
+ sprintf(nomrub, "Parametres_real_ctwr_%02d", ct->num);
+ cs_real_t *tabvar;
+
+
+ BFT_MALLOC(tabvar, 4, cs_real_t);
+
+ nbvent = 4;
+ support = CS_RESTART_LOCATION_NONE;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ support,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for the cooling tower module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ /* Coherency checks between the read and the one from usctdz */
+
+ if ( CS_ABS( tabvar[ 0 ] - ct->cl_teau ) > 1e-10 )
+ bft_printf(_("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** cooling tower MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The Water entry temperature is different \n"
+ "PREVIOUS: %f \n"
+ "CURRENT: %f \n" ), tabvar[ 0 ], ct->cl_teau );
+
+ if ( CS_ABS( tabvar[ 1 ] - ct->cl_fem ) > 1e-10 )
+ bft_printf(_("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** cooling tower MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The Water entry flow is different \n"
+ "PREVIOUS: %f \n"
+ "CURRENT: %f \n" ), tabvar[ 1 ], ct->cl_fem);
+
+ if (CS_ABS( tabvar[ 2 ] - ct->xap ) > 1e-10 )
+ bft_printf(_("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** cooling tower MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The value of Exchange law lambda coefficient is different \n"
+ "PREVIOUS: %f \n"
+ "CURRENT: %f \n" ), tabvar[ 2 ], ct->xap);
+
+ if (CS_ABS( tabvar[ 3 ] - ct->xnp ) > 1e-10 )
+ bft_printf(_("WARNING: ABORT WHILE READING THE RESTART FILE\n"
+ "******** cooling tower MODULE\n"
+ " CURRENT AND PREVIOUS DATA ARE DIFFERENT\n"
+ "\n"
+ "The value of Exchange law lambda coefficient is different \n"
+ "PREVIOUS: %f \n"
+ "CURRENT: %f \n" ), tabvar[ 3 ], ct->xnp);
+
+ BFT_FREE(tabvar);
+ }
+
+
+
+
+ { /* Read the wall thickness and check the coherency with USPT1D*/
+ char nomrub[] = "Temperature_eau";
+ cs_real_t *tabvar;
+
+
+ BFT_MALLOC(tabvar, n_elements, cs_real_t);
+
+ nbvent = 1;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite ,
+ nomrub ,
+ location_id,
+ nbvent ,
+ typ_val ,
+ tabvar );
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for thethe cooling tower module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ for (i = 0; i < n_elements; i++)
+ ct->teau[i]= tabvar[i];
+
+ BFT_FREE(tabvar);
+
+ }
+
+ { /* Read the wall thickness and check the coherency with USPT1D*/
+ char nomrub[] = "Flux_eau";
+ cs_real_t *tabvar;
+
+ BFT_MALLOC(tabvar, n_elements, cs_real_t);
+
+ nbvent = 1;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ location_id,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for thethe cooling tower module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ for (i = 0; i < n_elements; i++)
+ ct->fem[i]= tabvar[i];
+
+ BFT_FREE(tabvar);
+ }
+
+ { /* Read the wall thickness and check the coherency with USPT1D*/
+ char nomrub[] = "vitesse_goutte";
+ cs_real_t *tabvar;
+
+
+ BFT_MALLOC(tabvar, n_elements, cs_real_t);
+
+ nbvent = 1;
+ typ_val = CS_TYPE_cs_real_t;
+
+ ierror = cs_restart_read_section(suite,
+ nomrub,
+ location_id,
+ nbvent,
+ typ_val,
+ tabvar);
+
+ if (ierror < CS_RESTART_SUCCES)
+ bft_error(__FILE__, __LINE__, 0,
+ _("Problem while reading section in the restart file\n"
+ "for thethe cooling tower module:\n"
+ "<%s>\n"
+ "The calculation will not be run.\n"), nomrub);
+
+ for (i = 0; i < n_elements; i++)
+ ct->vgoutte[i]= tabvar[i];
+
+ BFT_FREE(tabvar);
+ }
+
+ }
+
+ /* Close the restart file and free structures */
+ cs_restart_destroy(cs_glob_ctwr_suite);
+ cs_glob_ctwr_suite = NULL;
+}
+
+/*============================================================================
+ * Fonctions publiques
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * D�finition d'une zone d'echange (qui est ajout�e � celles d�j� d�finies)
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_definit
+(
+ const cs_int_t idimct, /* Dimemsion du probleme 2:2D 3:3D */
+ const char *ze_name, /* Nom de la zone aero */
+ const cs_int_t imctch, /* 1: Modele de Poppe
+ 2: Merkel
+ 0: Rien */
+ const cs_int_t ntypct, /* 1: Contre courant
+ 2: Courant croises
+ 3: Zone de pluie */
+ const cs_int_t nelect, /* Nombre d'elements sur chaque ligne du maillage
+ eau pour la zone de noeuds par segment eau */
+ const cs_real_t deltat, /* Ecart de temperature impos� en entree de la
+ zone d'echange */
+ const cs_real_t teau_cl, /* Teau en entree de la zone d'echange */
+ const cs_real_t fem_cl, /* debit en entree de la zone d'echange */
+ const cs_real_t xap, /* coefficient lambda de la loi d'echange */
+ const cs_real_t xnp, /* exposant n de la loi d'echange */
+ const cs_real_t surface, /* Surface totale arrive d eau de la ct */
+ const cs_real_t dgout /* Diametre de goutte pour les zones de pluie */
+)
+{
+ cs_ctwr_zone_t *ct;
+ cs_int_t length;
+ bft_file_t *f;
+ char *file_name = NULL;
+ bft_file_type_t file_type;
+
+ file_type = BFT_FILE_TYPE_TEXT;
+ /* D�finition d'une nouvelle zone d'echange */
+
+ BFT_MALLOC(ct, 1, cs_ctwr_zone_t);
+
+ ct->num = cs_glob_ct_nbr + 1;
+
+ ct->idimct = idimct;
+ ct->imctch = imctch;
+ ct->ntypct = ntypct;
+ ct->nelect = nelect;
+
+ ct->hmin = 10000.;
+ ct->hmax = -10000.;
+
+ ct->voiseau = NULL;
+ ct->pvoiseau = NULL;
+ ct->voisair = NULL;
+ ct->pvoisair = NULL;
+
+ ct->fac_sup_connect_idx = NULL;
+ ct->fac_sup_connect_lst = NULL;
+
+ ct->surf_fac_sup = NULL;
+ ct->coefeau = NULL;
+ ct->coefair = NULL;
+
+ ct->deltat = deltat;
+ ct->cl_teau = teau_cl;
+ ct->cl_fem = fem_cl;
+ ct->xap = xap;
+ ct->xnp = xnp;
+
+ ct->surface_in = 0.;
+ ct->surface_out = 0.;
+ ct->surface = surface;
+ ct->nnpsct = 0;
+
+ ct->nbfac_sct = 0;
+ ct->nbfac_ict = 0;
+ ct->nbfac_lct = 0;
+ ct->nbfac_ct = 0;
+ ct->nbfbr_sct = 0;
+ ct->nbfbr_ict = 0;
+ ct->nbfbr_lct = 0;
+
+ ct->nbevct = 0;
+
+ ct->id_amont = 999;
+
+ ct->face_sup_mesh = NULL;
+ ct->face_inf_mesh = NULL;
+ ct->face_lat_mesh = NULL;
+
+ ct->cell_mesh = NULL;
+ ct->water_mesh = NULL;
+
+ ct->teau = NULL;
+ ct->fem = NULL;
+ ct->vgoutte = NULL;
+
+ ct->fem_e = 0.0 ;
+ ct->fem_s = 0.0 ;
+ ct->teau_e = 0.0 ;
+ ct->teau_s = 0.0 ;
+ ct->heau_e = 0.0 ;
+ ct->heau_s = 0.0 ;
+ ct->tair_e = 0.0 ;
+ ct->tair_s = 0.0 ;
+ ct->xair_e = 0.0 ;
+ ct->xair_s = 0.0 ;
+ ct->hair_e = 0.0 ;
+ ct->hair_s = 0.0 ;
+ ct->debit_e = 0.0 ;
+ ct->debit_s = 0.0 ;
+
+ ct->dgout = dgout ;
+
+ /* Selection des cellules */
+
+ BFT_MALLOC(ct->ze_cell_list, cs_glob_mesh->n_b_faces, fvm_lnum_t);
+
+ cs_selector_get_cell_list(ze_name, &(ct->nbevct), ct->ze_cell_list);
+
+ BFT_REALLOC(ct->ze_cell_list, ct->nbevct, fvm_lnum_t);
+
+ /* Redimensionnement du tableau des zones d'echange si necessaire */
+
+ if (cs_glob_ct_nbr == cs_glob_ct_nbr_max) {
+ cs_glob_ct_nbr_max = (cs_glob_ct_nbr_max + 1) ;
+ BFT_REALLOC(cs_glob_ct_tab, cs_glob_ct_nbr_max, cs_ctwr_zone_t *);
+ }
+
+ /* Ajout dans le tableau des zones d'echanges */
+
+ cs_glob_ct_tab[cs_glob_ct_nbr] = ct;
+ cs_glob_ct_nbr += 1;
+
+#if defined(HAVE_MPI)
+ ct->cs_array_rank = NULL;
+#endif
+ ct->locat_air_water = NULL;
+ ct->locat_water_air = NULL;
+ ct->locat_cell_ct_upwind= NULL;
+
+ ct->post_mesh_id = 0;
+
+ ct->nnpsct_with_ghosts = 0;
+ ct->water_halo = NULL;
+
+
+ if (cs_glob_rank_id <= 0) {
+ length = strlen("bltctc.") + 3 ;
+ BFT_MALLOC(file_name, length, char);
+ sprintf(file_name, "bltctc.%02d", ct->num);
+
+ f = bft_file_open(file_name,
+ BFT_FILE_MODE_APPEND,
+ file_type);
+
+ bft_file_printf(f, "# BILANS POUR LA ZONE D\'ECHANGES \n");
+ bft_file_printf(f, "# =================================\n");
+ bft_file_printf(f,"\tTEMP\tFLUX A/E\tTA MOY SOR\t TE MOY SOR");
+ bft_file_printf(f,"\tXA MOY SOR\tDEBI A ENT\tDEBI A SOR \n");
+ f = bft_file_free(f);
+ BFT_FREE(file_name);
+
+ }
+
+
+
+}
+
+/*----------------------------------------------------------------------------
+ * Destroy cs_ctwr_t structures
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_all_destroy(void)
+{
+ int i;
+ cs_ctwr_zone_t *ct;
+
+ for (i = 0 ; i < cs_glob_ct_nbr; i++) {
+
+ ct = cs_glob_ct_tab[i];
+ BFT_FREE(ct);
+
+ }
+
+ cs_glob_ct_nbr_max = 0;
+ cs_glob_ct_nbr = 0;
+
+ BFT_FREE(cs_stack_ct);
+ BFT_FREE(cs_chain_ct);
+ BFT_FREE(cs_glob_ctwr_props);
+
+ BFT_FREE(cs_glob_ct_tab);
+}
+
+/*----------------------------------------------------------------------------
+ * Water variables resolution
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_aeteau(cs_real_t temp[], /* Temperature air */
+ cs_real_t xa[], /* humidite air */
+ cs_real_t rho[], /* masse volumique air */
+ cs_real_t vitx[], /* vitesse air suivant x */
+ cs_real_t vity[], /* vitesse air suivant y */
+ cs_real_t vitz[] /* vitesse air suivant z */
+
+)
+{
+ cs_int_t ict,iseg,iloc,i, ii,j ,ieau, nb_dist_water, nb_dist_upw, ind;
+ cs_real_t dhi,vvai,vhai,norme_g;
+ cs_real_t gravite[3];
+ cs_real_t faxn,bxan,xsata,xsate,cfen,ff1,ff2,xlew,eta,aux;
+ cs_real_t vgin,dvg,cpx,rre,rpr,anu;
+ cs_real_t cpe, cpv, cpa, hv0, dgout, visc, conduc, rhoe;
+
+
+ fvm_lnum_t *lst_par_fac_sup_ct, *lst_par_fac_inf_ct_upw;
+ const fvm_lnum_t *locat_cel_upw = NULL;
+
+ cs_ctwr_zone_t *ct;
+ cs_ctwr_zone_t *ct_upw;
+ cs_real_t *tai_inter, *xai_inter, *rhoai_inter,*vx_inter, *vy_inter,*vz_inter;
+ cs_real_t *tai, *xai, *rhoai,*vx, *vy, *vz, *teau_upw_rec, *teau_upw_send ;
+ cs_real_t *fem_upw_rec, *fem_upw_send;
+ cs_ctwr_fluid_props_t *ct_prop = cs_glob_ctwr_props;
+
+ gravite[0] = -ct_prop->gravx;
+ gravite[1] = -ct_prop->gravy;
+ gravite[2] = -ct_prop->gravz;
+
+ norme_g = sqrt( pow(gravite[0],2.)
+ +pow(gravite[1],2.)
+ +pow(gravite[2],2.) );
+
+ gravite[0] /= norme_g;
+ gravite[1] /= norme_g;
+ gravite[2] /= norme_g;
+
+
+ /*--------------------------------------------*
+ * R�solution des variable eau *
+ * sur chaque ct *
+ *--------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ ct = cs_glob_ct_tab[cs_chain_ct[ict]];
+
+ if ((ct->ntypct>=2) && ( ct->idimct==2) )
+ gravite[2] = 1.0;
+
+ cpa = ct_prop->cpa ;
+ cpv = ct_prop->cpv ;
+ cpe = ct_prop->cpe ;
+ hv0 = ct_prop->hv0 ;
+ rhoe = ct_prop->rhoe ;
+ visc = ct_prop->visc ;
+ conduc = ct_prop->cond ;
+
+ dgout = ct->dgout ;
+
+ /*--------------------------------------------*
+ * synchronisation Halo *
+ *--------------------------------------------*/
+
+ if (ct->water_halo != NULL) {
+
+ cs_halo_t *halo = ct->water_halo;
+
+ cs_halo_sync_var(halo, ct->halo_type, temp);
+ cs_halo_sync_var(halo, ct->halo_type, xa);
+ cs_halo_sync_var(halo, ct->halo_type, rho);
+ cs_halo_sync_var(halo, ct->halo_type, vitx);
+ cs_halo_sync_var(halo, ct->halo_type, vity);
+ cs_halo_sync_var(halo, ct->halo_type, vitz);
+
+ }
+
+ /*--------------------------------------------*
+ * interpolation air->eau *
+ *--------------------------------------------*/
+ nb_dist_water = (int) fvm_locator_get_n_dist_points(ct->locat_air_water);
+
+ BFT_MALLOC( tai_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( xai_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( rhoai_inter, nb_dist_water, cs_real_t);
+ BFT_MALLOC( vx_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( vy_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( vz_inter , nb_dist_water, cs_real_t);
+
+ for (ieau= 0 ; ieau < nb_dist_water ; ieau++) {
+ tai_inter[ieau] = 0.;
+ xai_inter[ieau] = 0.;
+ rhoai_inter[ieau] = 0.;
+ vx_inter[ieau] = 0.;
+ vy_inter[ieau] = 0.;
+ vz_inter[ieau] = 0.;
+ for (i = (ct->pvoiseau[ieau]) ; i < (ct->pvoiseau[ieau+1]) ; i++) {
+ tai_inter[ieau] += ct->coefeau[i] * temp[ct->voiseau[i]];
+ xai_inter[ieau] += ct->coefeau[i] * xa[ct->voiseau[i]];
+ rhoai_inter[ieau]+= ct->coefeau[i] * rho[ct->voiseau[i]];
+ vx_inter[ieau] += ct->coefeau[i] * vitx[ct->voiseau[i]];
+ vy_inter[ieau] += ct->coefeau[i] * vity[ct->voiseau[i]];
+ vz_inter[ieau] += ct->coefeau[i] * vitz[ct->voiseau[i]];
+ }
+ }
+ BFT_MALLOC( tai , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( xai , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( rhoai, ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( vx , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( vy , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( vz , ct->nnpsct*ct->nelect, cs_real_t );
+
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ tai_inter, tai, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ xai_inter, xai, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ rhoai_inter,rhoai, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ vx_inter,vx, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ vy_inter,vy, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ vz_inter,vz, NULL, sizeof(cs_real_t),1,0);
+
+ BFT_FREE( tai_inter );
+ BFT_FREE( xai_inter );
+ BFT_FREE( rhoai_inter);
+ BFT_FREE( vx_inter );
+ BFT_FREE( vy_inter );
+ BFT_FREE( vz_inter );
+ /*--------------------------------------------*
+ * end interpolation air->eau *
+ *--------------------------------------------*/
+
+
+
+ /*--------------------------------------------*
+ * Calcul pour la face superieure , *
+ * Introduction des conditions aux limites ct *
+ *--------------------------------------------*/
+ BFT_MALLOC( lst_par_fac_sup_ct , ct->nnpsct, fvm_lnum_t );
+
+ fvm_nodal_get_parent_num(ct->face_sup_mesh,
+ 2,lst_par_fac_sup_ct);
+ ind = 0;
+ for (j=0 ; j < cs_glob_ct_nbr ; j++)
+ if(cs_stack_ct[cs_chain_ct[ict]*cs_glob_ct_nbr + cs_chain_ct[j]] == 1){
+ ct_upw = cs_glob_ct_tab[ cs_chain_ct[j]];
+
+ nb_dist_upw =
+ (int)fvm_locator_get_n_dist_points(ct->locat_cell_ct_upwind[ind]);
+
+ BFT_MALLOC( teau_upw_send , nb_dist_upw, cs_real_t);
+ BFT_MALLOC( fem_upw_send , nb_dist_upw, cs_real_t);
+ BFT_MALLOC( lst_par_fac_inf_ct_upw , (ct_upw->nbfac_ict+ct_upw->nbfbr_ict), fvm_lnum_t );
+
+ fvm_nodal_get_parent_num(ct_upw->face_inf_mesh,
+ 2,lst_par_fac_inf_ct_upw);
+ locat_cel_upw =
+ fvm_locator_get_dist_locations(ct->locat_cell_ct_upwind[ind]);
+
+ for (i=0 ; i < nb_dist_upw ; i++){
+ teau_upw_send[i] = ct_upw->teau[(cs_int_t) locat_cel_upw[i]-1];
+ fem_upw_send[i] = ct_upw->fem[(cs_int_t) locat_cel_upw[i]-1];
+ }
+
+ BFT_MALLOC( teau_upw_rec,
+ (ct_upw->nbfac_ict+ct_upw->nbfbr_ict), cs_real_t );
+ BFT_MALLOC( fem_upw_rec,
+ (ct_upw->nbfac_ict+ct_upw->nbfbr_ict), cs_real_t );
+
+ fvm_locator_exchange_point_var(ct->locat_cell_ct_upwind[ind],
+ teau_upw_send,
+ teau_upw_rec,
+ NULL,
+ sizeof(cs_real_t),
+ 1,0);
+ fvm_locator_exchange_point_var(ct->locat_cell_ct_upwind[ind],
+ fem_upw_send,
+ fem_upw_rec,
+ NULL,
+ sizeof(cs_real_t),
+ 1,0);
+
+ for (i=0 ; i < ct->nnpsct ; i++){
+ ii = 0;
+ while (ii < (ct_upw->nbfac_ict+ct_upw->nbfbr_ict) ){
+ if( lst_par_fac_sup_ct[i] == lst_par_fac_inf_ct_upw[ii]){
+ ct->teau[i*ct->nelect] = teau_upw_rec[ii];
+ ct->fem[i*ct->nelect] = fem_upw_rec[ii];
+ ii = ct_upw->nbfac_ict+ct_upw->nbfbr_ict;
+ }
+ ii++;
+ }
+ }
+ BFT_FREE( teau_upw_rec );
+ BFT_FREE( teau_upw_send );
+ BFT_FREE( fem_upw_rec );
+ BFT_FREE( fem_upw_send );
+ BFT_FREE( lst_par_fac_inf_ct_upw );
+ ind++;
+ }
+
+ BFT_FREE( lst_par_fac_sup_ct );
+
+ /* Pas d'espace */
+ dhi = -(ct->hmax-ct->hmin)/(ct->nelect-1);
+
+ /*--------------------------------------------*/
+ /* Modele de Poppe */
+ /*--------------------------------------------*/
+ if (ct->imctch==1) {
+ /*--------------------------------------------*/
+ /* courant-croise ou contre-courant */
+ /*--------------------------------------------*/
+ if (ct->ntypct<=2) {
+
+ for (iseg = 0 ; iseg < ct->nnpsct ; iseg++) {
+ /*--------------------------------------------*/
+ /* Resolution Fe */
+ /*--------------------------------------------*/
+ for (iloc = 1 ; iloc < ct->nelect ; iloc++) {
+
+ ieau = iseg*ct->nelect + iloc ;
+
+
+ vvai = sqrt( pow((vx[ieau]*gravite[0]),2.)
+ +pow((vy[ieau]*gravite[1]),2.)
+ +pow((vz[ieau]*gravite[2]),2.));
+ vhai = sqrt(pow((vx[ieau]*(1.-gravite[0])),2.)
+ +pow((vy[ieau]*(1.-gravite[1])),2.)
+ +pow((vz[ieau]*(1.-gravite[2])),2.));
+ /* fin interpolation air->eau */
+
+ xsate = cs_ctwr_xsath(ct->teau[ieau]);
+ xsata = cs_ctwr_xsath(tai[ieau]);
+ if (ct->ntypct==1) {
+ faxn=rhoai[ieau]*vvai;
+ }
+ if (ct->ntypct==2) {
+ faxn=rhoai[ieau]*vhai;
+ }
+ bxan=ct->xap*ct->fem[ieau]*pow((faxn/ct->fem[ieau]),ct->xnp);
+ if ( xai[ieau]>xsata ) {
+ aux=xsata;
+ }else{
+ aux=xai[ieau];
+ }
+ cfen=bxan*(xsate- aux )/(ct->fem[ieau]);
+ ct->fem[ieau]=ct->fem[ieau-1]/(1.0-cfen*dhi);
+ }
+ /* Fin de r�solution de Fe */
+
+ /*--------------------------------------------*/
+ /* Resolution Te */
+ /*--------------------------------------------*/
+ for (iloc = 1 ; iloc < ct->nelect ; iloc++) {
+
+ ieau = iseg*ct->nelect + iloc ;
+
+ vvai = sqrt( pow((vx[ieau]*gravite[0]),2.)
+ +pow((vy[ieau]*gravite[1]),2.)
+ +pow((vz[ieau]*gravite[2]),2.));
+ vhai = sqrt( pow((vx[ieau]*(1.-gravite[0])),2.)
+ +pow((vy[ieau]*(1.-gravite[1])),2.)
+ +pow((vz[ieau]*(1.-gravite[2])),2.));
+ /* fin interpolation air->eau */
+
+ xsate = cs_ctwr_xsath(ct->teau[ieau]);
+ xsata = cs_ctwr_xsath(tai[ieau]);
+ if (ct->ntypct==1) {
+ faxn=rhoai[ieau]*vvai;
+ }
+ if (ct->ntypct==2) {
+ faxn=rhoai[ieau]*vhai;
+ }
+ bxan = ct->xap*ct->fem[ieau]*pow((faxn/ct->fem[ieau]),ct->xnp);
+ cfen = bxan/ct->fem[ieau]/cpe;
+ eta = (0.622+xsate)/(0.622+xai[ieau]);
+ xlew = pow(0.866,(2./3.))*(eta-1.)/log(eta);
+ if (xai[ieau]<=xsata) {
+ ff1 = (cpa+cpv*xsate)+(cpa+cpv*xai[ieau])*(xlew-1.);
+ ff2 = xlew*(cpa+cpv*xai[ieau])*tai[ieau] -(xsate-xai[ieau])*hv0;
+ }
+ else {
+ ff1 = xlew*(cpa+cpv*xsata)+(xsate-xsata)*(cpv-cpe);
+ ff2 = xlew*(cpa+cpv*xsata+cpe*(xai[ieau]-xsata))*tai[ieau]
+ -(xsate-xsata)*(cpe*tai[ieau]+hv0);
+ }
+ ct->teau[ieau] = (ct->teau[ieau-1]-cfen*ff2*dhi)
+ /(1.0-cfen*ff1*dhi);
+
+ }
+ /* Fin de resolution Te */
+
+
+ }
+ }
+ /* Fin courant-croise ou contre-courant */
+
+
+ /*--------------------------------------------*/
+ /* zone de pluie */
+ /*--------------------------------------------*/
+ else if (ct->ntypct==3){
+ for (iseg = 0 ; iseg < ct->nnpsct ; iseg++) {
+ /*--------------------------------------------*/
+ /* Resolution Fe */
+ /*--------------------------------------------*/
+ for (iloc = 1 ; iloc < ct->nelect ; iloc++) {
+
+ ieau = iseg*ct->nelect + iloc ;
+ vgin=ct->vgoutte[ieau];
+
+ if (CS_ABS(vgin)>=0.1){
+
+ vvai = sqrt( pow((vx[ieau]*gravite[0]),2.)
+ +pow((vy[ieau]*gravite[1]),2.)
+ +pow((vz[ieau]*gravite[2]),2.));
+ vhai = sqrt( pow((vx[ieau]*(1.-gravite[0])),2.)
+ +pow((vy[ieau]*(1.-gravite[1])),2.)
+ +pow((vz[ieau]*(1.-gravite[2])),2.));
+ /* fin interpolation air->eau */
+
+ xsate = cs_ctwr_xsath(ct->teau[ieau]);
+ xsata = cs_ctwr_xsath(tai[ieau]);
+ dvg=sqrt(pow((vgin+vvai),2.)+pow(vhai,2.));
+ if (xai[ieau]<=xsata) {
+ cpx = cpa+xai[ieau]*cpv;
+ }
+ else {
+ cpx = cpa+xsata*cpv+(xai[ieau]-xsata)*cpe;
+ }
+ rre = dvg*rhoai[ieau]*(1.+xai[ieau])*dgout/visc;
+ rpr = cpx*visc/conduc;
+ anu = 2.+0.6*sqrt(rre)*pow(rpr,(1./3.));
+ bxan = 6.*conduc*anu*ct->fem[ieau]
+ /(0.92*rhoe*vgin*pow(dgout,2.)*cpx);
+ if (xai[ieau]>xsata ) {
+ aux = xsata;
+ }else{
+ aux = xai[ieau];
+ }
+
+ cfen=bxan*(xsate - aux)/(ct->fem[ieau]);
+ ct->fem[ieau]=ct->fem[ieau-1]/(1.0-cfen*dhi);
+ }
+ else {
+ ct->fem[ieau]=ct->fem[ieau-1];
+ }
+ }
+ /* Fin de resolution Fe */
+
+ /*--------------------------------------------*/
+ /* Resolution Te */
+ /*--------------------------------------------*/
+ for (iloc = 1 ; iloc < ct->nelect ; iloc++) {
+
+ ieau = iseg*ct->nelect + iloc ;
+
+ vgin=ct->vgoutte[ieau];
+
+ if (CS_ABS(vgin)>=0.1){
+
+ vvai = sqrt(pow((vx[ieau]*gravite[0]),2.)
+ +pow((vy[ieau]*gravite[1]),2.)
+ +pow((vz[ieau]*gravite[2]),2.));
+ vhai = sqrt(pow((vx[ieau]*(1.-gravite[0])),2.)
+ +pow((vy[ieau]*(1.-gravite[1])),2.)
+ +pow((vz[ieau]*(1.-gravite[2])),2.));
+ /* fin interpolation air->eau */
+
+ xsate = cs_ctwr_xsath(ct->teau[ieau]);
+ xsata = cs_ctwr_xsath(tai[ieau]);
+ dvg=sqrt(pow((vgin+vvai),2.)+pow(vhai,2.));
+ if (xai[ieau]<=xsata) {
+ cpx = cpa+xai[ieau]*cpv;
+ }
+ else {
+ cpx = cpa+xsata*cpv+(xai[ieau]-xsata)*cpe;
+ }
+ rre = dvg*rhoai[ieau]*(1.+xai[ieau])*dgout/visc;
+ rpr = cpx*visc/conduc;
+ anu = 2.+0.6*sqrt(rre)*pow(rpr,(1./3.));
+ bxan = 6.*conduc*anu*ct->fem[ieau]
+ /(0.92*rhoe*vgin*pow(dgout,2.)*cpx);
+ cfen = bxan/ct->fem[ieau]/cpe;
+ eta = (0.622+xsate)/(0.622+xai[ieau]);
+ xlew = pow(0.866,(2./3.))*(eta-1.)/log(eta);
+ if (xai[ieau]<=xsata) {
+ ff1 = (cpa+cpv*xsate)+(cpa+cpv*xai[ieau])*(xlew-1.)-(xsate-xai[ieau])*cpe;
+ ff2 = xlew*(cpa+cpv*xai[ieau])*tai[ieau] -(xsate-xai[ieau])*hv0;
+ }
+ else {
+ ff1 = xlew*(cpa+cpv*xsata)+(xsate-xsata)*(cpv-cpe)
+ -(xsate-xsata)*cpe;
+ ff2 = xlew*(cpa+cpv*xsata+cpe*(xai[ieau]-xsata))*tai[ieau]
+ -(xsate-xsata)*(cpe*tai[ieau]+hv0);
+ }
+ ct->teau[ieau] = (ct->teau[ieau-1]-cfen*ff2*dhi)
+ /(1.0-cfen*ff1*dhi);
+ }
+ else {
+ ct->teau[ieau]=ct->teau[ieau-1];
+ }
+
+ }
+ /* Fin de resolution Te */
+ }
+ }
+ /*--------------------------------------------*/
+ /* fin sur la zone de pluie ntype=3 */
+ /*--------------------------------------------*/
+ }
+ /*--------------------------------------------*/
+ /* Fin Modele de Poppe */
+ /*--------------------------------------------*/
+
+ /*--------------------------------------------*/
+ /* Modele de Merkel */
+ /*--------------------------------------------*/
+ if (ct->imctch==2) {
+
+ if (ct->ntypct<=2) {
+
+ for (iseg = 0 ; iseg < ct->nnpsct ; iseg++) {
+
+ for (iloc = 1 ; iloc < ct->nelect ; iloc++) {
+
+ ieau = iseg*ct->nelect + iloc ;
+
+ vvai = sqrt( pow((vx[ieau]*gravite[0]),2.)
+ +pow((vy[ieau]*gravite[1]),2.)
+ +pow((vz[ieau]*gravite[2]),2.));
+ vhai = sqrt( pow((vx[ieau]*(1.-gravite[0])),2.)
+ +pow((vy[ieau]*(1.-gravite[1])),2.)
+ +pow((vz[ieau]*(1.-gravite[2])),2.));
+ /* fin interpolation air->eau */
+
+ ct->fem[ieau]=ct->fem[ieau-1];
+ xsate = cs_ctwr_xsath(ct->teau[ieau]);
+ xsata = cs_ctwr_xsath(tai[ieau]);
+ if (ct->ntypct==1) {
+ faxn = rhoai[ieau]*vvai;
+ }
+ if (ct->ntypct==2) {
+ faxn = rhoai[ieau]*vhai;
+ }
+
+ bxan = ct->xap*ct->fem[ieau]*pow((faxn/ct->fem[ieau]),ct->xnp);
+ cfen = bxan/ct->fem[ieau]/cpe;
+ ff1 = cpa+cpv*xsate;
+ ff2 = (cpa+xsata*cpv)*tai[ieau]-(xsate-xsata)*hv0;
+ ct->teau[ieau] = (ct->teau[ieau-1]-cfen*ff2*dhi)
+ /(1.0-cfen*ff1*dhi);
+ }
+ } /* fin sur iseg */
+ } /* fin if pour le ntypct<=2 */
+
+ else if (ct->ntypct==3){ /* zone de pluie */
+
+ for (iseg = 0 ; iseg < ct->nnpsct ; iseg++) {
+
+ for (iloc = 1 ; iloc < ct->nelect ; iloc++) {
+ ieau = iseg*ct->nelect + iloc ;
+ ct->fem[ieau]=ct->fem[ieau-1];
+ vgin=ct->vgoutte[ieau];
+
+ if (CS_ABS(vgin)>=0.1){
+
+ vvai = sqrt( pow((vx[ieau]*gravite[0]),2.)
+ +pow((vy[ieau]*gravite[1]),2.)
+ +pow((vz[ieau]*gravite[2]),2.));
+ vhai = sqrt(pow((vx[ieau]*(1.-gravite[0])),2.)
+ +pow((vy[ieau]*(1.-gravite[1])),2.)
+ +pow((vz[ieau]*(1.-gravite[2])),2.));
+ /* fin interpolation air->eau */
+
+ xsate = cs_ctwr_xsath(ct->teau[ieau]);
+ xsata = cs_ctwr_xsath(tai[ieau]);
+ dvg=sqrt(pow((vgin+vvai),2.)+pow(vhai,2.));
+ cpx = cpa+xai[ieau]*cpv;
+ rre = dvg*rhoai[ieau]*(1.+xai[ieau])*dgout/visc;
+ rpr = cpx*visc/conduc;
+ anu = 2.+0.6*sqrt(rre)*pow(rpr,(1./3.));
+ bxan = 6.*conduc*anu*ct->fem[ieau]
+ /(0.92*rhoe*vgin*pow(dgout,2.)*cpx);
+ cfen = bxan/ct->fem[ieau]/cpe;
+ ff1 = cpa+cpv*xsate;
+ ff2 = (cpa+xsata*cpv)*tai[ieau]-(xsate-xsata)*hv0;
+ ct->teau[ieau]=(ct->teau[ieau-1]-cfen*ff2*dhi)
+ /(1.0-cfen*ff1*dhi);
+ }
+ else {
+ ct->teau[ieau]=ct->teau[ieau-1];
+ }
+ }
+ } /* fin sur iseg */
+ } /* fin sur la zone de pluie ntype=3 */
+ }
+ /*--------------------------------------------*/
+ /* Fin du modele de Merkel */
+ /*--------------------------------------------*/
+
+ BFT_FREE( tai );
+ BFT_FREE( xai );
+ BFT_FREE( rhoai );
+ BFT_FREE( vx );
+ BFT_FREE( vy );
+ BFT_FREE( vz );
+
+ }
+ /*--------------------------------------------*/
+ /* Fin de r�solution des variable eau */
+ /* sur chaque ct */
+ /*--------------------------------------------*/
+}
+
+/*----------------------------------------------------------------------------
+* Function cs_ctwr_aetssc
+* Calcul des termes source pour l'air
+*----------------------------------------------------------------------------*/
+void cs_ctwr_aetssc
+(
+ const cs_int_t iscal, /* */
+
+ cs_real_t temp[], /* Temperature air */
+ cs_real_t xa[], /* humidite air */
+ cs_real_t rho[], /* masse volumique air */
+ cs_real_t utsim[], /* vitesse verticale air */
+ cs_real_t utsex[], /* vitesse horizontale air */
+ cs_real_t vitx[], /* vitesse air suivant x */
+ cs_real_t vity[], /* vitesse air suivant y */
+ cs_real_t vitz[] /* vitesse air suivant z */
+)
+{
+ cs_int_t ict,iseg,iloc,ieau,iair,i,nb,nb_dist_water,nb_dist_air;
+ cs_real_t cd1,ain,bin,dhi,dvga,gravite[3],norme_g;
+ cs_real_t fax,fx0,vvai,vhai,tim,tex,xim,xex;
+ cs_real_t bxa,xsata,xsate,ff1,xlew,eta;
+ cs_real_t dvg,cpx,rre,rpr,anu;
+ cs_real_t cpe, cpv, cpa, hv0, dgout, visc, conduc, rhoe;
+ cs_ctwr_zone_t *ct;
+ cs_real_t *tai_inter, *xai_inter, *rhoai_inter,*vx_inter, *vy_inter,*vz_inter,
+ *tei_inter, *femei_inter, *vgin_inter;
+ cs_real_t *tai, *xai, *rhoai,*vx, *vy, *vz, *tei, *femei, *vgin;
+ fvm_lnum_t *lst_par_cel;
+ cs_ctwr_fluid_props_t *ct_prop = cs_glob_ctwr_props;
+
+ gravite[0] = -ct_prop->gravx;
+ gravite[1] = -ct_prop->gravy;
+ gravite[2] = -ct_prop->gravz;
+
+ norme_g = sqrt( pow(gravite[0],2.)
+ +pow(gravite[1],2.)
+ +pow(gravite[2],2.) );
+
+ gravite[0] /= norme_g;
+ gravite[1] /= norme_g;
+ gravite[2] /= norme_g;
+
+
+ /*--------------------------------------------*/
+ /* Calcul de la vitesse des gouttes pour les */
+ /* zones de pluie */
+ /*--------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ ct = cs_glob_ct_tab[cs_chain_ct[ict]];
+ cpa = ct_prop->cpa ;
+ cpv = ct_prop->cpv ;
+ cpe = ct_prop->cpe ;
+ hv0 = ct_prop->hv0 ;
+ rhoe = ct_prop->rhoe ;
+ visc = ct_prop->visc ;
+ conduc = ct_prop->cond ;
+
+ dgout = ct->dgout ;
+
+ if (ct->ntypct==3){
+ /*--------------------------------------------*
+ * synchronisation Halo *
+ *--------------------------------------------*/
+
+ if (ct->water_halo != NULL) {
+
+ cs_halo_t *halo = ct->water_halo;
+
+ cs_halo_sync_var(halo, ct->halo_type, temp);
+ cs_halo_sync_var(halo, ct->halo_type, xa);
+ cs_halo_sync_var(halo, ct->halo_type, rho);
+ cs_halo_sync_var(halo, ct->halo_type, vitx);
+ cs_halo_sync_var(halo, ct->halo_type, vity);
+ cs_halo_sync_var(halo, ct->halo_type, vitz);
+
+ }
+
+ /*--------------------------------------------*
+ * interpolation air->eau *
+ *--------------------------------------------*/
+ nb_dist_water = (int) fvm_locator_get_n_dist_points(ct->locat_air_water);
+
+ BFT_MALLOC( tai_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( xai_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( rhoai_inter, nb_dist_water, cs_real_t);
+ BFT_MALLOC( vx_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( vy_inter , nb_dist_water, cs_real_t);
+ BFT_MALLOC( vz_inter , nb_dist_water, cs_real_t);
+
+ for (ieau= 0 ; ieau < nb_dist_water ; ieau++) {
+ tai_inter[ieau] = 0.;
+ xai_inter[ieau] = 0.;
+ rhoai_inter[ieau] = 0.;
+ vx_inter[ieau] = 0.;
+ vy_inter[ieau] = 0.;
+ vz_inter[ieau] = 0.;
+ for (i = (ct->pvoiseau[ieau]) ; i < (ct->pvoiseau[ieau+1]) ; i++) {
+ tai_inter[ieau] += ct->coefeau[i] * temp[ct->voiseau[i]];
+ xai_inter[ieau] += ct->coefeau[i] * xa[ct->voiseau[i]];
+ rhoai_inter[ieau]+= ct->coefeau[i] * rho[ct->voiseau[i]];
+ vx_inter[ieau] += ct->coefeau[i] * vitx[ct->voiseau[i]];
+ vy_inter[ieau] += ct->coefeau[i] * vity[ct->voiseau[i]];
+ vz_inter[ieau] += ct->coefeau[i] * vitz[ct->voiseau[i]];
+ }
+ }
+ BFT_MALLOC( tai , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( xai , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( rhoai, ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( vx , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( vy , ct->nnpsct*ct->nelect, cs_real_t );
+ BFT_MALLOC( vz , ct->nnpsct*ct->nelect, cs_real_t );
+
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ tai_inter, tai, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ xai_inter, xai, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ rhoai_inter,rhoai, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ vx_inter,vx, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ vy_inter,vy, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_air_water,
+ vz_inter,vz, NULL, sizeof(cs_real_t),1,0);
+ /*--------------------------------------------*
+ * end interpolation air->eau *
+ *--------------------------------------------*/
+
+
+ dhi = -(ct->hmax-ct->hmin)/(ct->nelect-1);
+
+ nb = (int) fvm_nodal_get_n_entities(ct->cell_mesh, 3);
+
+ BFT_MALLOC( lst_par_cel , nb, fvm_lnum_t );
+ fvm_nodal_get_parent_num( ct->cell_mesh, 3, lst_par_cel);
+
+ for (iseg = 0 ; iseg < ct->nnpsct ; iseg++) {
+
+ for (iloc = 1 ; iloc < ct->nelect ; iloc++) {
+
+ ieau = iseg*ct->nelect + iloc ;
+
+ vvai = sqrt(pow((vx[ieau]*gravite[0]),2.)
+ +pow((vy[ieau]*gravite[1]),2.)
+ +pow((vz[ieau]*gravite[2]),2.));
+ /* fin interpolation air->eau */
+
+ dvga = CS_ABS(ct->vgoutte[ieau]+vvai);
+
+ rre = dvga*rhoai[ieau]*dgout/visc;
+ cd1 = (1.+0.15*pow(rre,0.687));
+ ain = (18.*visc*cd1)/(rhoe*pow(dgout,2.));
+ bin = -ain*dvga + 9.81 ;
+ if (bin>0.) {
+ ff1 = 2.*bin*dhi;
+ }
+ else {
+ ff1 = 0.;
+ }
+ ct->vgoutte[ieau] = sqrt((pow(ct->vgoutte[ieau-1],2.)-ff1));
+ }
+ }
+ BFT_FREE( lst_par_cel);
+ BFT_FREE( tai );
+ BFT_FREE( xai );
+ BFT_FREE( rhoai );
+ BFT_FREE( vx );
+ BFT_FREE( vy );
+ BFT_FREE( vz );
+ BFT_FREE( tai_inter );
+ BFT_FREE( xai_inter );
+ BFT_FREE( rhoai_inter );
+ BFT_FREE( vx_inter );
+ BFT_FREE( vy_inter );
+ BFT_FREE( vz_inter );
+ }
+
+ } /* fin boucle ict sur les ct */
+ /* Fin du calcul de la vitesse des gouttes pour les zones de pluie */
+
+ /*--------------------------------------------*/
+ /* Calcul des termes sources pour T et x */
+ /* pour chaque ct */
+ /*--------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+ ct = cs_glob_ct_tab[cs_chain_ct[ict]];
+
+ if ((ct->ntypct >= 2) && ( ct->idimct==2) )
+ gravite[2] = 1.0;
+
+ cpa = ct_prop->cpa ;
+ cpv = ct_prop->cpv ;
+ cpe = ct_prop->cpe ;
+ hv0 = ct_prop->hv0 ;
+ rhoe = ct_prop->rhoe ;
+ visc = ct_prop->visc ;
+ conduc = ct_prop->cond ;
+
+ dgout = ct->dgout ;
+
+ nb = (int) fvm_nodal_get_n_entities(ct->cell_mesh, 3);
+
+ /*--------------------------------------------*
+ * synchronisation Halo *
+ *--------------------------------------------*/
+
+ if (ct->water_halo != NULL) {
+ cs_halo_t *halo = ct->water_halo;
+ cs_halo_sync_var(halo, ct->halo_type, ct->teau);
+ cs_halo_sync_var(halo, ct->halo_type, ct->fem);
+ cs_halo_sync_var(halo, ct->halo_type, ct->vgoutte);
+ }
+
+
+ BFT_MALLOC( lst_par_cel , nb, fvm_lnum_t );
+ fvm_nodal_get_parent_num( ct->cell_mesh, 3, lst_par_cel);
+ /*--------------------------------------------*
+ * interpolation eau->air *
+ *--------------------------------------------*/
+ nb_dist_air = (int) fvm_locator_get_n_dist_points(ct->locat_water_air);
+
+ BFT_MALLOC( tei_inter , nb_dist_air, cs_real_t );
+ BFT_MALLOC( femei_inter , nb_dist_air, cs_real_t );
+ BFT_MALLOC( vgin_inter , nb_dist_air, cs_real_t );
+
+ for (iair= 0 ; iair < nb_dist_air ; iair++) {
+ tei_inter [ iair ] = 0.;
+ femei_inter[ iair ] = 0.;
+ vgin_inter [ iair ] = 0.;
+
+ for (i = (ct->pvoisair[iair]) ; i < (ct->pvoisair[iair+1]) ; i++) {
+ tei_inter[iair] += ct->coefair[ i ]* ct->teau [ ct->voisair[i] ];
+ femei_inter[iair] += ct->coefair[ i ]* ct->fem [ ct->voisair[i] ];
+ vgin_inter[iair] += ct->coefair[ i ]* ct->vgoutte[ ct->voisair[i] ];
+ }
+ }
+ BFT_MALLOC( tei , ct->nbevct, cs_real_t );
+ BFT_MALLOC( femei , ct->nbevct, cs_real_t );
+ BFT_MALLOC( vgin , ct->nbevct, cs_real_t );
+
+ fvm_locator_exchange_point_var(ct->locat_water_air,
+ tei_inter, tei, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_water_air,
+ femei_inter, femei, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_water_air,
+ vgin_inter, vgin, NULL, sizeof(cs_real_t),1,0);
+
+
+
+ /*--------------------------------------------*
+ * end interpolation air->eau *
+ *--------------------------------------------*/
+
+ /*--------------------------------------------*
+ * Modele de Poppe *
+ *--------------------------------------------*/
+ if (ct->imctch==1) {
+ /*--------------------------------------------*
+ * courant-croise ou contre-courant *
+ *--------------------------------------------*/
+ if (ct->ntypct<=2) {
+ for (iloc = 0 ; iloc < ct->nbevct ; iloc++){
+ iair = lst_par_cel[iloc]-1;
+ /* fin interpolation eau->air */
+
+ if (femei[iloc]>1.e-6) {
+ vvai = sqrt(pow((vitx[iair]*gravite[0]),2.)
+ +pow((vity[iair]*gravite[1]),2.)
+ +pow((vitz[iair]*gravite[2]),2.));
+ vhai = sqrt(pow((vitx[iair]*(1.-gravite[0])),2.)
+ +pow((vity[iair]*(1.-gravite[1])),2.)
+ +pow((vitz[iair]*(1.-gravite[2])),2.));
+ if (ct->ntypct==1) {
+ fax = rho[iair]*vvai;
+ }
+ else {
+ fax = rho[iair]*vhai;
+ }
+ bxa = ct->xap*femei[iloc]*pow((fax/femei[iloc]),ct->xnp);
+ xsata = cs_ctwr_xsath(temp[iair]);
+ xsate = cs_ctwr_xsath(tei[iloc]);
+ eta = (0.622+xsate)/(0.622+xa[iair]);
+ xlew = pow(0.866,(2./3.))*(eta-1.)/log(eta);
+ if (xa[iair]<=xsata) {
+ tex = ((cpa+xsate*cpv)+(xlew-1.)*(cpa+xa[iair]*cpv))*tei[iloc];
+ tim = ((cpa+xsate*cpv)+(xlew-1.)*(cpa+xa[iair]*cpv));
+ xex = xsate;
+ xim = 1.;
+ }
+ else {
+ tex=xlew*(cpa+cpv*xsata+(xa[iair]-xsata)*cpe)*tei[iloc]
+ +(xsate-xsata)*cpv*tei[iloc]+(xsate-xsata)*hv0;
+ tim = xlew*(cpa+cpv*xsata+(xa[iair]-xsata)*cpe)+ (xsate-xsata)*cpe;
+ xex = xsate - xsata;
+ xim = 0.;
+ }
+ /* termes sources pour T */
+ if (iscal==1) {
+ utsex[iair] = bxa*tex;
+ utsim[iair] = bxa*tim;
+ }
+ /* termes sources pour x */
+ if (iscal==2) {
+ utsex[iair] = bxa*xex;
+ utsim[iair] = bxa*xim;
+ }
+ }
+ }
+ }
+ /* Fin courant-croise ou contre-courant */
+
+ /*--------------------------------------------*/
+ /* zone de pluie */
+ /*--------------------------------------------*/
+ else if (ct->ntypct==3) {
+
+ for (iloc = 0 ; iloc < ct->nbevct ; iloc++) {
+ iair = lst_par_cel[iloc]-1;
+
+ if (CS_ABS(vgin[iloc])>=0.1) {
+ vvai = sqrt(pow(( vitx[iair]*gravite[0]),2.)
+ +pow(( vity[iair]*gravite[1]),2.)
+ +pow(( vitz[iair]*gravite[2]),2.));
+ vhai = sqrt(pow(( vitx[iair]*(1.-gravite[0])),2.)
+ +pow(( vity[iair]*(1.-gravite[1])),2.)
+ +pow(( vitz[iair]*(1.-gravite[2])),2.));
+ dvg = sqrt(pow((vvai+vgin[iloc]),2.)+pow(vhai,2.));
+
+ bxa = ct->xap*femei[iloc]*pow((fax/femei[iloc]),ct->xnp);
+ xsata = cs_ctwr_xsath(temp[iair]);
+ xsate = cs_ctwr_xsath(tei[iloc]);
+ if (xa[iair]<=xsata) {
+ cpx = cpa+xa[iair]*cpv;
+ }
+ else {
+ cpx = cpa+xsata*cpv+(xa[iair]-xsata)*cpe;
+ }
+ rre = dvg*rho[iair]*(1.+xsata)*dgout/visc;
+ rpr = cpx*visc/conduc;
+ anu = 2.+0.6*sqrt(rre)*pow(rpr,(1./3.));
+ bxa = (6.*conduc*anu*femei[iloc])/(0.92*rhoe*vgin[iloc]*pow(dgout,2.)*cpx);
+ eta = (0.622 + xsate)/(0.622 + xa[iair]);
+ xlew = pow(0.866,(2./3.))*(eta-1.)/log(eta);
+ if (xa[iair]<=xsata) {
+ tex = ((cpa+xsate*cpv)+(xlew-1.)*(cpa+xa[iair]*cpv))*tei[iloc];
+ tim = ((cpa+xsate*cpv)+(xlew-1.)*(cpa+xa[iair]*cpv));
+ xex = xsate;
+ xim = 1.;
+ }
+ else {
+ tex = xlew*(cpa+cpv*xsata+(xa[iair]-xsata)*cpe)*tei[iloc]
+ +(xsate-xsata)*cpv*tei[iloc]+(xsate-xsata)*hv0;
+ tim = xlew*(cpa+cpv*xsata+(xa[iair]-xsata)*cpe)+ (xsate-xsata)*cpe;
+ xex = xsate - xsata;
+ xim = 0.;
+ }
+ /* termes sources pour T */
+ if (iscal==1){
+ utsex[iair] = bxa*tex;
+ utsim[iair] = bxa*tim;
+ }
+ /* termes sources pour x */
+ if (iscal==2){
+ utsex[iair] = bxa*xex;
+ utsim[iair] = bxa*xim;
+ }
+ }
+ }
+ }
+ /* Fin de la zone de pluie */
+ }
+ /*--------------------------------------------*/
+ /* Fin du modele de Poppe */
+ /*--------------------------------------------*/
+
+ /*--------------------------------------------*/
+ /* Modele de Merkel */
+ /*--------------------------------------------*/
+ if (ct->imctch==2) {
+ if (ct->ntypct<=2){
+ for (iloc = 0 ; iloc < ct->nbevct ; iloc++){
+ iair = lst_par_cel[iloc]-1;
+ if (femei[iloc]>1.e-6) {
+ vvai = sqrt(pow(( vitx[iair]*gravite[0]),2.)
+ +pow(( vity[iair]*gravite[1]),2.)
+ +pow(( vitz[iair]*gravite[2]),2.));
+ vhai = sqrt(pow(( vitx[iair]*(1.-gravite[0])),2.)
+ +pow(( vity[iair]*(1.-gravite[1])),2.)
+ +pow(( vitz[iair]*(1.-gravite[2])),2.));
+
+ if (ct->ntypct==1) {
+ fax=rho[iair]*vvai;
+ }
+ else {
+ fax=rho[iair]*vhai;
+ }
+
+ xsata = cs_ctwr_xsath(temp[iair]);
+ xsate = cs_ctwr_xsath(tei[iloc]);
+ bxa = ct->xap*femei[iloc]*pow((fax/femei[iloc]),ct->xnp);
+ fx0 = (xsate-xsata)*(cpv*tei[iloc]+hv0);
+ if (iscal==1) {
+ utsex[iair] = bxa*tei[iloc]*(cpa+cpv*xsata)+bxa*fx0;
+ utsim[iair] = bxa*(cpa+cpv*xsata);
+ }
+ if (iscal==2) {
+ utsex[iair] = 1.e20*xsata;
+ utsim[iair] = 1.e20;
+ }
+ }
+ }
+ } /*Fin du ntypct<=2 */
+
+ else if (ct->ntypct==3){ /* zone de pluie */
+
+ for (iloc = 0 ; iloc < ct->nbevct ; iloc++){
+ iair = lst_par_cel[iloc]-1;
+
+ if (CS_ABS(vgin[iloc])>=0.1) {
+
+ vvai = sqrt(pow(( vitx[iair]*gravite[0]),2.)
+ +pow(( vity[iair]*gravite[1]),2.)
+ +pow(( vitz[iair]*gravite[2]),2.));
+ vhai = sqrt(pow(( vitx[iair]*(1.-gravite[0])),2.)
+ +pow(( vity[iair]*(1.-gravite[1])),2.)
+ +pow(( vitz[iair]*(1.-gravite[2])),2.));
+
+ dvg = sqrt(pow((vvai+vgin[iloc]),2.)+pow(vhai,2.));
+ xsata = cs_ctwr_xsath(temp[iair]);
+ xsate = cs_ctwr_xsath(tei[iloc]);
+ cpx = cpa+xsata*cpv;
+ rre = dvg*rho[iair]*(1.+xsata)*dgout/visc;
+ rpr = cpx*visc/conduc;
+ anu = 2.+0.6*sqrt(rre)*pow(rpr,(1./3.));
+ bxa = (6.*conduc*anu*femei[iloc])/(0.92*rhoe*vgin[iloc]*pow(dgout,2.)*cpx);
+ fx0 = (xsate-xsata)*(cpv*tei[iloc]+hv0);
+ if (iscal==1){
+ utsex[iair] = bxa*tei[iloc]*(cpa+cpv*xsata)+bxa*fx0;
+ utsim[iair] = bxa*(cpa+cpv*xsata);
+ }
+ if (iscal==2) {
+ utsex[iair] = 1.e20*xsata;
+ utsim[iair] = 1.e20;
+ }
+ }
+ }
+ }/* Fin de la zone de pluie ntypct=3 */
+ }
+ /*--------------------------------------------*/
+ /* Fin pour le modele de Merkel */
+ /*--------------------------------------------*/
+ BFT_FREE( lst_par_cel);
+ BFT_FREE( tei_inter );
+ BFT_FREE( femei_inter );
+ BFT_FREE( vgin_inter );
+ BFT_FREE( tei );
+ BFT_FREE( femei );
+ BFT_FREE( vgin );
+ }
+ /*--------------------------------------------*/
+ /* Fin calcul des termes sources pour T et x*/
+ /* pour chaque ct */
+ /*--------------------------------------------*/
+}
+
+
+/*----------------------------------------------------------------------------
+* Function cs_ctwr_aetsvi
+* Calcul des PdC induites dans les zones de pluie
+*----------------------------------------------------------------------------*/
+
+void cs_ctwr_aetsvi
+(
+ const cs_int_t idim,
+ const cs_real_t rho[], /* masse volumique air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[], /* vitesse air suivant z */
+ const cs_real_t xair[], /* humidite de l'air */
+ cs_real_t utsex[] /* terme source explicite */
+)
+{
+ cs_int_t ict, iloc, iair, i, *lst_par_cel, nb,nb_dist_air;
+ cs_real_t dgout, visc, rhoe;
+ cs_real_t absgrv, vginu,vginv,vginw,dvg,qer,rre,cdd1,cff0;
+
+ cs_real_t *femei_inter, *vgin_inter;
+ cs_real_t *femei, *vgin;
+ cs_ctwr_zone_t *ct;
+ cs_ctwr_fluid_props_t *ct_prop = cs_glob_ctwr_props;
+
+ absgrv = sqrt(pow(ct_prop->gravx,2.)+pow(ct_prop->gravy,2.)+pow(ct_prop->gravz,2.));
+
+ /*--------------------------------------------*/
+ /* Calcul de Kg pour chaque ct */
+ /*--------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+ ct = cs_glob_ct_tab[cs_chain_ct[ict]];
+ rhoe = ct_prop->rhoe ;
+ dgout = ct->dgout ;
+ visc = ct_prop->visc ;
+
+ /*--------------------------------------------*
+ * synchronisation Halo *
+ *--------------------------------------------*/
+
+ if (ct->water_halo != NULL) {
+ cs_halo_t *halo = ct->water_halo;
+ cs_halo_sync_var(halo, ct->halo_type, ct->teau);
+ cs_halo_sync_var(halo, ct->halo_type, ct->fem);
+ cs_halo_sync_var(halo, ct->halo_type, ct->vgoutte);
+ }
+
+ nb = (int) fvm_nodal_get_n_entities(ct->cell_mesh, 3);
+
+ BFT_MALLOC( lst_par_cel , (nb*3), fvm_lnum_t );
+ fvm_nodal_get_parent_num( ct->cell_mesh, 3, lst_par_cel);
+ /*--------------------------------------------*
+ * interpolation eau->air *
+ *--------------------------------------------*/
+ nb_dist_air = (int) fvm_locator_get_n_dist_points(ct->locat_water_air);
+
+ BFT_MALLOC( femei_inter , nb_dist_air, cs_real_t);
+ BFT_MALLOC( vgin_inter , nb_dist_air, cs_real_t);
+
+ for (iair= 0 ; iair < nb_dist_air ; iair++) {
+
+ femei_inter[iair] = 0.;
+ vgin_inter[iair] = 0.;
+
+ for (i = (ct->pvoisair[iair]) ; i < (ct->pvoisair[iair+1]) ; i++) {
+
+ femei_inter[ iair ] += ct->coefair[ i ]* ct->fem [ ct->voisair[i] ];
+ vgin_inter [ iair ] += ct->coefair[ i ]* ct->vgoutte[ ct->voisair[i] ];
+ }
+ }
+
+ BFT_MALLOC( femei , ct->nbevct, cs_real_t );
+ BFT_MALLOC( vgin , ct->nbevct, cs_real_t );
+
+ fvm_locator_exchange_point_var(ct->locat_water_air,
+ femei_inter, femei, NULL, sizeof(cs_real_t),1,0);
+ fvm_locator_exchange_point_var(ct->locat_water_air,
+ vgin_inter, vgin, NULL, sizeof(cs_real_t),1,0);
+
+ /*--------------------------------------------*/
+ /* zone de pluie */
+ /*--------------------------------------------*/
+ if (ct->ntypct==3) {
+ for (iloc = 0 ; iloc < ct->nbevct ; iloc++) {
+ iair = lst_par_cel[iloc]-1;
+
+ vginu = -ct_prop->gravx/ absgrv * vgin[iloc];
+ vginv = -ct_prop->gravy/ absgrv * vgin[iloc];
+ vginw = -ct_prop->gravz/ absgrv * vgin[iloc];
+ dvg = sqrt( pow((vitx[iair]+vginu ),2.)
+ + pow((vity[iair]+vginv ),2.)
+ + pow((vitz[iair]+vginw ),2.) );
+ if (vgin[iloc] > 0.1) {
+ qer = femei[iloc]/rhoe;
+ rre = dvg*rho[iair]*(1 + xair[iair])*dgout/visc;
+ cdd1 = (1.+0.15*pow(rre,0.687));
+ cff0 = 18.*cdd1*visc*qer/(vgin[iloc]*pow(dgout,2.));
+ if (idim==1){ utsex[iair] = -cff0 *( vitx[iair]+vginu ) ; }
+ if (idim==2){ utsex[iair] = -cff0 *( vity[iair]+vginv ) ; }
+ if (idim==3){ utsex[iair] = -cff0 *( vitz[iair]+vginw ) ; }
+ }
+ }
+ }
+ /* Fin zones de pluie */
+ BFT_FREE(lst_par_cel);
+ BFT_FREE(femei_inter);
+ BFT_FREE(vgin_inter);
+ BFT_FREE(femei);
+ BFT_FREE(vgin);
+ }
+ /* Fin de calcul de Kg pour chaque ct */
+}
+
+/*----------------------------------------------------------------------------
+* Bilan dans les ct
+*----------------------------------------------------------------------------*/
+
+void cs_ctwr_bilanct
+(
+ const cs_real_t time, /* */
+ cs_real_t fem_entree[], /* debit eau entree */
+ cs_real_t fem_sortie[], /* debit eau sortie */
+ cs_real_t teau_entree[], /* temperature eau entree */
+ cs_real_t teau_sortie[], /* temperature eau sortie */
+ cs_real_t heau_entree[], /* enthalpie eau entree */
+ cs_real_t heau_sortie[], /* enthalpie eau sortie */
+ cs_real_t tair_entree[], /* temperature air entree */
+ cs_real_t tair_sortie[], /* temperature air sortie */
+ cs_real_t xair_entree[], /* */
+ cs_real_t xair_sortie[], /* */
+ cs_real_t hair_entree[], /* */
+ cs_real_t hair_sortie[], /* */
+ cs_real_t debit_entree[], /* */
+ cs_real_t debit_sortie[], /* */
+
+ const cs_real_t temp[], /* Temperature air */
+ const cs_real_t xa[], /* humidite air */
+ const cs_real_t flux_masse_fac[], /* vitesse verticale air */
+ const cs_real_t flux_masse_fbr[], /* vitesse horizontale air */
+ const cs_real_t vitx[], /* vitesse air suivant x */
+ const cs_real_t vity[], /* vitesse air suivant y */
+ const cs_real_t vitz[], /* vitesse air suivant z */
+
+ const cs_mesh_t *mesh, /* <-- structure maillage associ�e */
+ const cs_mesh_quantities_t *mesh_quantities /* <-- grandeurs du maillage */
+)
+{
+ const cs_real_t *i_face_normal = mesh_quantities->i_face_normal;
+ const cs_real_t *b_face_normal = mesh_quantities->b_face_normal;
+ cs_int_t icel_1, icel_2, icel, ifac, ict, idim, i, j, ieau_Sup,
+ ieau_inf, length;
+ cs_real_t cpe, cpv, cpa, hv0;
+ const cs_int_t *i_face_cells = mesh->i_face_cells;
+ const cs_int_t *b_face_cells = mesh->b_face_cells;
+ const cs_real_t *coo_cen = mesh_quantities->cell_cen;
+ cs_real_t xsata,debit,hair,n_sortant[3],vitair[3],aux,
+ surf,surf_e,surf_s;
+
+ fvm_lnum_t *face_sup; /* liste des faces superieures de la ct */
+ fvm_lnum_t *face_inf; /* liste des faces inferior de la ct */
+ fvm_lnum_t *face_lat; /* liste des faces inferior de la ct */
+
+ cs_ctwr_zone_t *ct;
+ bft_file_t *f;
+ char *file_name = NULL;
+ bft_file_type_t file_type;
+ cs_ctwr_fluid_props_t *ct_prop = cs_glob_ctwr_props;
+
+ file_type = BFT_FILE_TYPE_TEXT;
+
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ ct = cs_glob_ct_tab[cs_chain_ct[ict]];
+ cpa = ct_prop->cpa ;
+ cpv = ct_prop->cpv ;
+ cpe = ct_prop->cpe ;
+ hv0 = ct_prop->hv0 ;
+ cs_int_t nbr_fbr_air[3][2] = {{ct->nnpsct,ct->nbfbr_sct},
+ {(ct->nbfbr_ict + ct->nbfac_ict),ct->nbfbr_ict},
+ {(ct->nbfbr_lct + ct->nbfac_lct),ct->nbfbr_lct}};
+
+
+ BFT_MALLOC( face_sup ,(ct->nbfac_sct + ct->nbfbr_sct) ,fvm_lnum_t );
+ fvm_nodal_get_parent_num( ct->face_sup_mesh, 2, face_sup);
+ BFT_MALLOC( face_inf ,(ct->nbfac_ict + ct->nbfbr_ict) ,fvm_lnum_t );
+ fvm_nodal_get_parent_num( ct->face_inf_mesh, 2, face_inf);
+ BFT_MALLOC( face_lat ,(ct->nbfbr_lct + ct->nbfac_lct) ,fvm_lnum_t );
+ fvm_nodal_get_parent_num( ct->face_lat_mesh, 2, face_lat);
+
+ ct->fem_e = 0.0 ;
+ ct->fem_s = 0.0 ;
+ ct->teau_e = 0.0 ;
+ ct->heau_s = 0.0 ;
+ ct->heau_e = 0.0 ;
+ ct->teau_s = 0.0 ;
+ ct->tair_e = 0.0 ;
+ ct->tair_s = 0.0 ;
+ ct->xair_e = 0.0 ;
+ ct->xair_s = 0.0 ;
+ ct->hair_e = 0.0 ;
+ ct->hair_s = 0.0 ;
+ ct->debit_e = 0.0 ;
+ ct->debit_s = 0.0 ;
+
+ /* calcul des valeurs eau */
+
+ for (i = 0 ; i < ct->nnpsct ; i++) {
+ ieau_Sup = i*ct->nelect;
+ ieau_inf = (i+1)*ct->nelect - 1 ;
+
+ surf = ct->surf_fac_sup[i];
+
+ ct->teau_e += ct->teau[ieau_Sup]*ct->fem[ieau_Sup]*surf;
+ ct->fem_e += ct->fem[ieau_Sup]*surf ;
+ ct->heau_e += ct->teau[ieau_Sup]*ct->fem[ieau_Sup]*surf;
+
+ ct->teau_s += ct->teau[ieau_inf]*ct->fem[ieau_inf]*surf;
+ ct->fem_s += ct->fem[ieau_inf]*surf ;
+ ct->heau_s += ct->teau[ieau_inf]*ct->fem[ieau_inf]*surf;
+
+ }
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+
+ MPI_Allreduce (&ct->teau_e, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->teau_e = aux;
+
+ MPI_Allreduce (&ct->fem_e, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->fem_e = aux;
+
+ MPI_Allreduce (&ct->heau_e, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->heau_e = aux;
+
+ MPI_Allreduce (&ct->teau_s, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->teau_s = aux;
+
+ MPI_Allreduce (&ct->fem_s, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->fem_s = aux;
+
+ MPI_Allreduce (&ct->heau_s, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->heau_s = aux;
+
+ }
+#endif
+
+ ct->teau_e /= ct->fem_e ;
+ ct->fem_e /= ct->surface_in;
+ ct->heau_e *= ct_prop->cpe ;
+
+ ct->teau_s /= ct->fem_s ;
+ ct->fem_s /= ct->surface_out ;
+ ct->heau_s *= ct_prop->cpe ;
+
+
+ /* calcul des valeurs air */
+
+ surf_e = 0. ;
+ surf_s = 0. ;
+
+ for (j = 0 ; j < 3 ; j++)
+ for (i = 0 ; i < nbr_fbr_air[j][0] ; i++) {
+ if( i< nbr_fbr_air[j][1] ){
+ if( j==0) ifac = (cs_int_t) face_sup[i]-1;
+ if( j==1) ifac = (cs_int_t) face_inf[i]-1;
+ if( j==2) ifac = (cs_int_t) face_lat[i]-1;
+ icel = b_face_cells[ifac] - 1 ;
+ for (idim = 0 ; idim<3 ; idim++ )
+ n_sortant[idim] = mesh_quantities->b_face_normal[ifac*3+idim];
+ debit = CS_ABS(flux_masse_fbr[ifac]);
+ surf = CS_LOC_MODULE((b_face_normal + 3*ifac));
+ }else{
+ if( j==0) ifac = (cs_int_t) face_sup[i] - mesh->n_b_faces - 1;
+ if( j==1) ifac = (cs_int_t) face_inf[i] - mesh->n_b_faces - 1;
+ if( j==2) ifac = (cs_int_t) face_lat[i] - mesh->n_b_faces - 1;
+ icel_1 = i_face_cells[ifac * 2] - 1;
+ icel_2 = i_face_cells[ifac * 2 + 1] - 1;
+ if ( ct->mark_ze[icel_1] == 1 ) {
+
+ icel = icel_2 ;
+ for (idim = 0 ; idim < 3 ; idim++) {
+ n_sortant[idim] = coo_cen[icel_2*3 + idim] - coo_cen[icel_1*3 + idim];
+ }
+ }
+ if ( ct->mark_ze[icel_2] == 1 ) {
+
+ icel = icel_1 ;
+ for (idim = 0 ; idim < 3 ; idim++) {
+ n_sortant[idim] = coo_cen[icel_1*3 + idim] - coo_cen[icel_2*3 + idim];
+ }
+ }
+ debit = CS_ABS(flux_masse_fac[ifac]);
+ surf = CS_LOC_MODULE((i_face_normal + 3*ifac));
+ }
+ xsata = cs_ctwr_xsath(temp[icel]);
+ hair = (cpa+xa[icel]*cpv)*temp[icel]+xa[icel]*hv0;
+ vitair[0] = vitx[icel] ;
+ vitair[1] = vity[icel] ;
+ vitair[2] = vitz[icel] ;
+ if (CS_LOC_PRODUIT_SCALAIRE(n_sortant, vitair)>0.) {
+ surf_s += surf;
+ ct->hair_s += hair*debit;
+ ct->xair_s += debit*xa[icel];
+ ct->tair_s += debit*temp[icel];
+ ct->debit_s += debit;
+ }
+ else {
+ surf_e += surf;
+ ct->hair_e += hair*debit;
+ ct->xair_e += debit*xa[icel];
+ ct->tair_e += debit*temp[icel];
+ ct->debit_e += debit;
+ }
+ }
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+
+
+ MPI_Allreduce (&ct->tair_e, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->tair_e = aux;
+
+ MPI_Allreduce (&ct->xair_e, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->xair_e = aux;
+
+ MPI_Allreduce (&ct->debit_e, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->debit_e = aux;
+
+ MPI_Allreduce (&ct->hair_e, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->hair_e = aux;
+
+ MPI_Allreduce (&ct->tair_s, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->tair_s = aux;
+
+ MPI_Allreduce (&ct->xair_s, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->xair_s = aux;
+
+ MPI_Allreduce (&ct->debit_s, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->debit_s = aux;
+
+ MPI_Allreduce (&ct->hair_s, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->hair_s = aux;
+
+ }
+#endif
+
+ if (CS_ABS( ct->debit_e )> 1e-10 ){
+ ct->tair_e /= ct->debit_e ;
+ ct->xair_e /= ct->debit_e ;
+ }
+
+ if (CS_ABS( ct->debit_s )> 1e-10 ){
+ ct->tair_s /= ct->debit_s ;
+ ct->xair_s /= ct->debit_s ;
+ }
+
+
+ fem_entree[ict] = ct->fem_e ;
+ fem_sortie[ict] = ct->fem_s ;
+ teau_entree[ict] = ct->teau_e ;
+ teau_sortie[ict] = ct->teau_s ;
+ heau_entree[ict] = ct->heau_e ;
+ heau_sortie[ict] = ct->heau_s ;
+ tair_entree[ict] = ct->tair_e ;
+ tair_sortie[ict] = ct->tair_s ;
+ xair_entree[ict] = ct->xair_e ;
+ xair_sortie[ict] = ct->xair_s ;
+ hair_entree[ict] = ct->hair_e ;
+ hair_sortie[ict] = ct->hair_s ;
+
+ ct->debit_e *= (ct->surface/ct->surface_in) ;
+ ct->debit_s *= (ct->surface/ct->surface_out);
+
+ debit_entree[ict] = ct->debit_e ;
+ debit_sortie[ict] = ct->debit_s ;
+
+
+
+ if (cs_glob_rank_id <= 0) {
+ length = strlen("bltctc.") + 3 ;
+ BFT_MALLOC(file_name, length, char);
+ sprintf(file_name, "bltctc.%02d", ct->num);
+
+ if (CS_ABS(ct->heau_e-ct->heau_s)> 1.e-6){
+ f = bft_file_open(file_name,
+ BFT_FILE_MODE_APPEND,
+ file_type);
+
+ aux =CS_ABS( (ct->hair_s - ct->hair_e)/(ct->heau_e - ct->heau_s) );
+ bft_file_printf(f,
+ "%10f\t%10f\t%10f\t%10f\t%12.5e\t%10f\t%10f\n"
+ ,time
+ ,aux
+ ,ct->tair_s
+ ,ct->teau_s
+ ,ct->xair_s
+ ,ct->debit_e
+ ,ct->debit_s);
+
+ f = bft_file_free(f);
+ }
+ }
+
+ BFT_FREE(file_name);
+ BFT_FREE(face_sup);
+ BFT_FREE(face_inf);
+ BFT_FREE(face_lat);
+ } /* fin de la boucle sur les zones d'echanges */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Initialict post-processing
+ *
+ * parameters:
+ * ct_id --> Id of exchange area
+ * writer_id --> Id of associated writer
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_post_init(cs_int_t ct_id,
+ cs_int_t writer_id)
+{
+ cs_int_t mesh_id = cs_post_get_free_mesh_id();
+
+ cs_ctwr_zone_t * ct = cs_ctwr_by_id(ct_id);
+
+ assert(ct != NULL);
+
+ /* Exit silently if associated writer is not available */
+
+ if (cs_post_writer_exists(writer_id) != CS_TRUE)
+ return;
+
+ /* Initialict post processing flag, and free previous arrays in
+ case this function is called more than once */
+
+ ct->post_mesh_id = mesh_id;
+
+ /* Associate external mesh description with post processing subsystem */
+
+ cs_post_add_existing_mesh(mesh_id,
+ ct->water_mesh,
+ 0,
+ CS_FALSE);
+
+ cs_post_associate(mesh_id, writer_id);
+
+ /* Register post processing function */
+
+ cs_post_add_time_dep_var(cs_ctwr_post_function, ct_id);
+
+ /* Update start and end (negative) numbers associated with
+ dedicated post processing meshes */
+
+ if (cs_glob_ct_post_mesh_ext[0] == 0)
+ cs_glob_ct_post_mesh_ext[0] = mesh_id;
+
+ cs_glob_ct_post_mesh_ext[1] = mesh_id;
+}
+
+/*----------------------------------------------------------------------------
+ * Post process variables associated with exchange area
+ *
+ * parameters:
+ * coupling_id --> Id of exchange area
+ * nt_cur_abs --> Current time step
+ * t_cur_abs --> Current time value
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_post_function(cs_int_t ct_id,
+ cs_int_t nt_cur_abs,
+ cs_real_t t_cur_abs)
+{
+ cs_ctwr_zone_t * ct = cs_ctwr_by_id(ct_id);
+
+ if (ct->post_mesh_id != 0) {
+
+ cs_post_write_var(ct->post_mesh_id,
+ _("T water"),
+ 1,
+ CS_FALSE,
+ CS_FALSE,
+ CS_POST_TYPE_cs_real_t,
+ nt_cur_abs,
+ t_cur_abs,
+ ct->teau,
+ NULL,
+ NULL);
+
+ cs_post_write_var(ct->post_mesh_id,
+ _("Flux water"),
+ 1,
+ CS_FALSE,
+ CS_FALSE,
+ CS_POST_TYPE_cs_real_t,
+ nt_cur_abs,
+ t_cur_abs,
+ ct->fem,
+ NULL,
+ NULL);
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Get pointer to exchange area.
+ *
+ * parameters:
+ * ct_id --> Id (0 to n-1) of exchange area
+ *
+ * returns:
+ * pointer to exchange area structure
+ *----------------------------------------------------------------------------*/
+
+cs_ctwr_zone_t *
+cs_ctwr_by_id(cs_int_t ct_id)
+{
+ cs_ctwr_zone_t *retval = NULL;
+
+ if ( ct_id > -1
+ && ct_id < cs_glob_ct_nbr)
+ retval = cs_glob_ct_tab[ct_id];
+
+ return retval;
+}
+
+
+#undef CS_LOC_PRODUIT_SCALAIRE
+#undef CS_LOC_MODULE
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/ctwr/cs_ctwr_air_props.c b/src/ctwr/cs_ctwr_air_props.c
new file mode 100644
index 0000000..b8dc2e5
--- /dev/null
+++ b/src/ctwr/cs_ctwr_air_props.c
@@ -0,0 +1,398 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Specific laws for air properties (temperature, enthalpy)
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ctwr_air_props.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Global variables
+ *============================================================================*/
+
+cs_ctwr_fluid_props_t *cs_glob_ctwr_props = NULL;
+
+/*============================================================================
+ * Public function prototypes for Fortran API
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Definition des proprietes physiques
+ *
+ * Interface Fortran :
+ *
+ * SUBROUTINE CTPROF
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (ctprof, CTPROF)
+(
+ const cs_real_t *cpa, /* Capacite calorifique de l air */
+ const cs_real_t *cpv, /* Capacite calorifique de la vapeur */
+ const cs_real_t *cpe, /* Capacite calorifique de l eau */
+ const cs_real_t *hv0, /* Chaleur latente */
+ const cs_real_t *rhoe, /* Masse volumique de l eau */
+ const cs_real_t *visc, /* Viscosite Dynamique */
+ const cs_real_t *cond, /* Conductivite */
+ const cs_real_t *gravx, /* gravite selon x */
+ const cs_real_t *gravy, /* gravite selon y */
+ const cs_real_t *gravz /* gravite selon z */
+)
+{
+ if (cs_glob_ctwr_props == NULL)
+ BFT_MALLOC(cs_glob_ctwr_props, 1, cs_ctwr_fluid_props_t);
+
+ cs_glob_ctwr_props->cpa = *cpa;
+ cs_glob_ctwr_props->cpv = *cpv;
+ cs_glob_ctwr_props->cpe = *cpe;
+ cs_glob_ctwr_props->hv0 = *hv0;
+ cs_glob_ctwr_props->rhoe = *rhoe;
+ cs_glob_ctwr_props->visc = *visc;
+ cs_glob_ctwr_props->cond = *cond;
+ cs_glob_ctwr_props->gravx = *gravx;
+ cs_glob_ctwr_props->gravy = *gravy;
+ cs_glob_ctwr_props->gravz = *gravz;
+}
+
+/*----------------------------------------------------------------------------
+ * Calculation of the air humidity at saturation for a given temperature
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE XSATH
+ * ****************
+ *
+ * DOUBLE PRECISION TH : <- : temperature in Celsius degree
+ * DOUBLE PRECISION XSAT : -> : absolute humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (xsath, XSATH)
+(
+ const cs_real_t *th,
+ cs_real_t *xsat
+)
+{
+ *xsat = cs_ctwr_xsath(*th);
+}
+
+/*----------------------------------------------------------------------------
+ * Calculation of the derivative of the absolute humidity at saturation
+ *
+ * Fortran interface:
+ *
+ * SUBROUTINE DXSATH
+ * *****************
+ *
+ * DOUBLE PRECISION TH : <- : temperature in Celsius degree
+ * DOUBLE PRECISION DXSAT : -> : derivative of the humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF (dxsath, DXSATH)
+(
+ const cs_real_t *th,
+ cs_real_t *dxsat
+)
+{
+ *dxsat = cs_ctwr_dxsath(*th);
+}
+
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Calculation of the air humidity at saturation for a given temperature
+ *
+ * parameters:
+ * th <-- temperature in Celsius degree
+ *
+ * returns:
+ * absolute humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_xsath(const cs_real_t th)
+{
+ const cs_real_t Pres = 101325.;
+ cs_real_t xsat,a1,b1,c1,ps,pv;
+
+ /* T less than -20 degrees */
+
+ if (th < -20.) {
+
+ xsat = 0.;
+
+ }
+
+ /* T between -20 and 0 degrees C */
+
+ else if ((th >= -20.) && (th <= 0.)) {
+
+ a1 = 6.4147;
+ b1 = 22.376;
+ c1 = 271.68;
+ ps = a1 + (b1 * th)/(c1 + th);
+ pv = exp(ps);
+ xsat = 0.622 * pv/(Pres - pv);
+
+ }
+
+ /* T between 0 and 40 degrees C */
+
+ else if ((th >= 0.) && (th <= 40.)) {
+
+ a1 = 6.4147;
+ b1 = 17.438;
+ c1 = 239.78;
+ ps = a1 + (b1 * th)/(c1 + th);
+ pv = exp(ps);
+ xsat = 0.622 * pv/(Pres - pv);
+ }
+
+ /* T between 40 and 80 degrees C */
+
+ else if ((th >= 40.) && (th <= 80.)) {
+
+ const cs_real_t T0 = 273.16;
+ const cs_real_t Ax = 8.2969;
+ const cs_real_t Ay = 4.76955;
+ const cs_real_t A0 = 0.78614;
+ a1 = 10.7954;
+ const cs_real_t A2 = 5.028;
+ const cs_real_t A3 = 0.000150475;
+ const cs_real_t A4 = 0.00042873;
+ cs_real_t tt,px,py,g1,g2,g3,g4;
+
+ tt = th/T0;
+ px = Ax * tt;
+ py = Ay * tt/(1. + tt);
+ g1 = a1 * tt/(1. + tt);
+ g2 = -A2 * log10(1. + tt);
+ g3 = A3 * (1. - 1./pow(10.,px));
+ g4 = A4 * (pow(10.,py) - 1.);
+ ps = A0 + g1 + g2 + g3 + g4;
+ pv = pow(10.,ps) * 100.;
+ xsat = 0.622 * pv/(Pres-pv);
+
+ }
+
+ else if (th > 80.) {
+
+ xsat = 0.5 + 0.001*th;
+
+ }
+
+ return xsat;
+}
+
+/*----------------------------------------------------------------------------
+ * Calculation of moist air mass enthalpy
+ *
+ * parameters:
+ * hair <-- absolute humidity of saturated air
+ * tair <-- air temperature in Celsius degree
+ *
+ * returns:
+ * air mass enthalpy
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_enthair(const cs_real_t xair,
+ const cs_real_t tair)
+{
+ const cs_real_t Cpa = 1006. ;
+ const cs_real_t Cpv = 1831. ;
+ const cs_real_t Hvo = 2501600. ;
+ cs_real_t hair;
+
+ hair = ( Cpa + xair * Cpv )* tair + xair * Hvo;
+
+ return hair;
+}
+
+/*----------------------------------------------------------------------------
+ * Calculation water mass enthalpy
+ *
+ * parameters:
+ * teau <-- water temperature in Celsius degree
+ *
+ * returns:
+ * water mass enthalpy
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_heau(const cs_real_t teau)
+{
+ const cs_real_t Cpe = 4179.0 ;
+ cs_real_t heau;
+
+ heau = Cpe * teau;
+
+ return heau;
+}
+
+/*----------------------------------------------------------------------------
+ * Calculation of the derivate of the absolute humidity at saturation
+ *
+ * parameters:
+ * th <-- temperature in Celsius degree
+ *
+ * returns:
+ * derivative of the humidity of saturated air
+ *----------------------------------------------------------------------------*/
+
+cs_real_t
+cs_ctwr_dxsath(const cs_real_t th)
+{
+ const cs_real_t Pres = 101325.;
+ cs_real_t a1,b1,c1,ps,pv,grpim;
+ cs_real_t dxsath;
+
+ /* T less than -20 degrees */
+
+ if (th < -20.) {
+
+ dxsath = 0.;
+
+ }
+
+ /* T between -20 and 0 degrees C */
+
+ else if (th >= -20. && th <= 0.) {
+
+ a1 = 6.4147;
+ b1 = 22.376;
+ c1 = 271.68;
+ ps = a1 + (b1 * th)/(c1 + th);
+ pv = exp(ps);
+ grpim = b1 * c1 / pow(c1 + th,2.);
+
+ dxsath = 0.622 * pv * Pres * grpim /pow(Pres - pv,2.);
+
+ }
+
+ /* T between 0 and 40 degrees C */
+
+ else if (th >=0. && th <= 40.) {
+
+ a1 = 6.4147;
+ b1 = 17.438;
+ c1 = 239.78;
+ ps = a1 + (b1 * th)/(c1 + th);
+ pv = exp(ps);
+ grpim = b1 * c1 / pow(c1 + th,2.);
+
+ dxsath =0.622 * pv * Pres * grpim /pow(Pres - pv,2.);
+
+ }
+
+ /* T between 40 and 80 degrees C */
+
+ else if (th >= 40. && th <= 80.) {
+
+ const cs_real_t T0 = 273.16;
+ const cs_real_t Ax = 8.2969;
+ const cs_real_t Ay = 4.76955;
+ const cs_real_t A0 = 0.78614;
+ a1 = 10.7954;
+ const cs_real_t A2 = 5.028;
+ const cs_real_t A3 = 0.000150475;
+ const cs_real_t A4 = 0.00042873;
+ cs_real_t tt, px, px10, py, py10, pspr, pvpr,
+ g1, g1pr, g2, g2pr, g3, g3pr, g4, g4pr;
+
+ tt = th / T0 ;
+ px = Ax * tt;
+ px10 = pow( 10., px );
+ py = Ay *tt / (1. + tt );
+ py10 = pow( 10., py );
+ g1 = a1 * tt / (1. + tt);
+ g1pr = a1 / (T0 * pow(1. + tt, 2.) );
+ g2 = - A2 * log10(1. + tt );
+ g2pr = - A2 /(T0 * log(10.)*(1. + tt));
+ g3 = A3 *(1. - 1. /px10);
+ g3pr = A3 * Ax * log(10.) / (T0 * px10);
+ g4 = A4 *(py10 - 1.);
+ g4pr = A4 * Ay * log (10.) * py10 / (T0* pow(1. + tt, 2.));
+ ps = A0 + g1 + g2 + g3 + g4;
+ pspr = g1pr + g2pr + g3pr + g4pr;
+ pv = pow(10., ps) *100.;
+ pvpr = log(10.) * pspr * pv;
+ dxsath= Pres * pvpr * 0.622 / pow (Pres - pv, 2);
+
+ }
+ else if (th > 80.) {
+
+ dxsath = 0.001;
+
+ }
+
+ return dxsath ;
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/ctwr/cs_ctwr_f2c.f90 b/src/ctwr/cs_ctwr_f2c.f90
new file mode 100644
index 0000000..205b07e
--- /dev/null
+++ b/src/ctwr/cs_ctwr_f2c.f90
@@ -0,0 +1,100 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine defct &
+!================
+
+ ( idimze, nomze, imzech, ntypze, neleze, &
+ deltat, teaueze, qeaueze, xap, xnp, surface, dgout )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! DEFINITION DE COUPLAGE(S) AVEC LE CODE SYRTHES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idimze ! e ! <-- ! dimension de la zone d'echange !
+! nomze ! a ! <-- ! caracterisation de zone d'echange !
+! imzech ! e ! <-- ! modele de zone d'echange (impose par usppmo) !
+! ntypze ! e ! <-- ! types de zone d'echanges !
+! neleze ! e ! <-- ! nombre d'element pour extrusion de la zone !
+! deltat ! r ! <-- ! ecart de temperature impose !
+! teaueze ! r ! <-- ! Temperature eau de la zone d'echange !
+! qeaueze ! r ! <-- ! debit d'eau traversant la zone d'echange !
+! xap ! r ! <-- ! coefficent !
+! xnp ! r ! <-- ! coefficient !
+! surface ! r ! <-- ! surface de la zone d'echange !
+! dgout ! r ! <-- ! diametre de goutte !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+character*(*) nomze
+
+integer imzech,ntypze,idimze,neleze,icoul
+
+double precision teaueze,qeaueze,deltat
+double precision xap,xnp,surface
+double precision dgout
+
+! Variables locales
+
+integer lnomze
+
+!===============================================================================
+
+lnomze = len(nomze)
+
+
+call defct1( idimze, nomze, lnomze, imzech, ntypze, neleze, &
+!==========
+ deltat, teaueze, qeaueze, xap, xnp, surface, dgout )
+
+
+return
+
+end subroutine
diff --git a/src/ctwr/cs_ctwr_halo.c b/src/ctwr/cs_ctwr_halo.c
new file mode 100644
index 0000000..003ee37
--- /dev/null
+++ b/src/ctwr/cs_ctwr_halo.c
@@ -0,0 +1,1578 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Functions dealing with ghost cells
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_mem.h>
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_timer.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_periodicity.h>
+#include <fvm_interface.h>
+#include <fvm_nodal_extract.h>
+#include <fvm_order.h>
+#include <fvm_parall.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_ctwr.h"
+#include "cs_halo.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ctwr_halo.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure and type definitions
+ *============================================================================*/
+
+typedef struct _vtx_lookup_table {
+
+ cs_int_t n_vertices; /* Number of local vertices in the problem domain */
+ cs_int_t n_interfaces; /* Number of interfaces */
+
+ cs_int_t *if_ranks; /* List of ranks */
+ cs_int_t *rank_ids; /* list of rank ids */
+
+ cs_int_t *index; /* index on table (size = n_vertices + 1) */
+
+ cs_int_t *rank_list; /* list of ranks on which vertices are linked */
+
+} vtx_lookup_table_t;
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*---------------------------------------------------------------------------
+ * Fill a look up table structure without periodicity
+ *
+ * The look up list takes the distant rank value with which a local vertex
+ * is linked.
+ *
+ * parameters:
+ * vtx_lookup --> pointer to a vtx_lookup_table_t structure
+ * ifs --> pointer to a fvm_interface_set_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_vtx_lookup(vtx_lookup_table_t *vtx_lookup,
+ fvm_interface_set_t *ifs)
+{
+ cs_int_t i, vtx_id, rank_id, shift;
+
+ cs_int_t *counter = NULL;
+
+ const cs_int_t n_interfaces = fvm_interface_set_size(ifs);
+
+ BFT_MALLOC(counter, vtx_lookup->n_vertices, cs_int_t);
+
+ for (i = 0; i < vtx_lookup->n_vertices; i++)
+ counter[i] = 0;
+
+ for (rank_id = 0; rank_id < n_interfaces; rank_id++) {
+
+ const fvm_interface_t *interface = fvm_interface_set_get(ifs, rank_id);
+ const fvm_lnum_t interface_size = fvm_interface_size(interface);
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num(interface);
+
+ for (i = 0; i < interface_size; i++) { /* Only parallel vertices */
+
+ vtx_id = local_num[i]-1;
+ shift = vtx_lookup->index[vtx_id] + counter[vtx_id];
+
+ vtx_lookup->rank_list[shift] = vtx_lookup->rank_ids[rank_id];
+ counter[vtx_id] += 1;
+
+ }
+
+ } /* End of loop on ranks */
+
+ BFT_FREE(counter);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Create a vtx_look_up_table_t structure
+ *
+ * parameters:
+ * n_vertices --> number of vertices of the table.
+ * ifs --> pointer to a fvm_interface_set_t structure
+ *
+ * returns:
+ * A pointer to the created vtx_lookup_table_t structure
+ *---------------------------------------------------------------------------*/
+
+static vtx_lookup_table_t *
+_vtx_lookup_create(cs_int_t n_vertices,
+ fvm_interface_set_t *ifs)
+{
+ cs_int_t i, rank_id, tmp_id, interface_size;
+
+ cs_int_t loc_rank_id = -1;
+ vtx_lookup_table_t *vtx_lookup = NULL;
+
+ const fvm_interface_t *interface = NULL;
+ const fvm_lnum_t *local_num = NULL;
+ const cs_int_t n_interfaces = fvm_interface_set_size(ifs);
+
+ BFT_MALLOC(vtx_lookup, 1, vtx_lookup_table_t);
+
+ vtx_lookup->n_vertices = n_vertices;
+ vtx_lookup->n_interfaces = n_interfaces;
+
+ BFT_MALLOC(vtx_lookup->index, n_vertices + 1, cs_int_t);
+ BFT_MALLOC(vtx_lookup->if_ranks, n_interfaces, cs_int_t);
+ BFT_MALLOC(vtx_lookup->rank_ids, n_interfaces, cs_int_t);
+
+ for (i = 0; i < n_vertices + 1; i++)
+ vtx_lookup->index[i] = 0;
+
+ /* Check if cs_glob_rank_id belongs to the interface set in order to
+ arrange if_ranks with local rank at first place */
+
+ for (rank_id = 0; rank_id < n_interfaces; rank_id++) {
+
+ interface = fvm_interface_set_get(ifs, rank_id);
+ vtx_lookup->if_ranks[rank_id] = fvm_interface_rank(interface);
+ vtx_lookup->rank_ids[rank_id] = rank_id;
+
+ if (cs_glob_rank_id == fvm_interface_rank(interface))
+ loc_rank_id = rank_id;
+
+ } /* End of loop on if_ranks */
+
+ /* Define vtx_lookup->if_ranks in right order */
+
+ if (loc_rank_id > 0) {
+
+ tmp_id = vtx_lookup->if_ranks[loc_rank_id];
+ vtx_lookup->if_ranks[loc_rank_id] = vtx_lookup->if_ranks[0];
+ vtx_lookup->if_ranks[0] = tmp_id;
+
+ vtx_lookup->rank_ids[0] = loc_rank_id;
+ vtx_lookup->rank_ids[loc_rank_id] = 0;
+
+ /* Order by increasing numbers */
+
+ if (n_interfaces > 2) {
+
+ fvm_lnum_t *order = NULL;
+ fvm_gnum_t *buffer = NULL;
+ cs_int_t *_rank_ids = NULL;
+
+ assert(sizeof(fvm_lnum_t) == sizeof(cs_int_t));
+
+ BFT_MALLOC(order, n_interfaces - 1, fvm_lnum_t);
+ BFT_MALLOC(buffer, n_interfaces - 1, fvm_gnum_t);
+ BFT_MALLOC(_rank_ids, n_interfaces , cs_int_t);
+
+ _rank_ids[0] = vtx_lookup->rank_ids[0];
+ for (i = 1; i < n_interfaces; i++) {
+ buffer[i-1] = (fvm_gnum_t)vtx_lookup->if_ranks[i];
+ _rank_ids[i] = vtx_lookup->rank_ids[i];
+ }
+
+ fvm_order_local_allocated(NULL,
+ buffer,
+ order,
+ n_interfaces-1);
+
+ for (i = 0; i < n_interfaces - 1; i++) {
+ vtx_lookup->if_ranks[i+1] = (cs_int_t)buffer[order[i]];
+ vtx_lookup->rank_ids[i+1] = _rank_ids[order[i] + 1];
+ }
+
+ BFT_FREE(buffer);
+ BFT_FREE(order);
+ BFT_FREE(_rank_ids);
+
+ } /* End of ordering ranks */
+
+ } /* If rank order has to be changed */
+
+ /* First loop to create index */
+
+ for (rank_id = 0; rank_id < n_interfaces; rank_id++) {
+
+ interface = fvm_interface_set_get(ifs, rank_id);
+ interface_size = fvm_interface_size(interface);
+ local_num = fvm_interface_get_local_num(interface);
+
+ for (i = 0; i < interface_size; i++)
+ vtx_lookup->index[(cs_int_t)local_num[i]] += 1;
+
+ } /* End of loop on if_ranks */
+
+ /* Create index and allocate buffers */
+
+ for (i = 0; i < n_vertices; i++)
+ vtx_lookup->index[i+1] += vtx_lookup->index[i];
+
+ BFT_MALLOC(vtx_lookup->rank_list, vtx_lookup->index[n_vertices], cs_int_t);
+
+ /* Second loop to fill table(s) */
+
+ _fill_vtx_lookup(vtx_lookup, ifs);
+
+ return vtx_lookup;
+}
+
+/*---------------------------------------------------------------------------
+ * Destroy a vtx_lookup structure.
+ *
+ * parameters:
+ * vtx_lookup --> pointer to a vtx_lookup_table_t structure
+ *
+ * returns:
+ * A NULL pointer
+ *---------------------------------------------------------------------------*/
+
+static void
+_vtx_lookup_destroy(vtx_lookup_table_t *vtx_lookup)
+{
+
+ BFT_FREE(vtx_lookup->if_ranks);
+ BFT_FREE(vtx_lookup->rank_ids);
+ BFT_FREE(vtx_lookup->index);
+ BFT_FREE(vtx_lookup->rank_list);
+
+ BFT_FREE(vtx_lookup);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Set checker for this vertex_id according to vtx_lookup features.
+ *
+ * parameters:
+ * vtx_id --> vertex id to deal with
+ * vtx_checker <-> put a tag in the implied categories
+ * vtx_lookup --> pointer to a vtx_lookup_table_t structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_vtx_checker(cs_int_t vtx_id,
+ cs_int_t *vtx_checker,
+ vtx_lookup_table_t *vtx_lookup)
+{
+ cs_int_t i, rank_id;
+
+ for (i = vtx_lookup->index[vtx_id];
+ i < vtx_lookup->index[vtx_id + 1]; i++) {
+
+ rank_id = vtx_lookup->rank_list[i];
+ vtx_checker[rank_id] += 1;
+
+
+
+ } /* End of loop on vtx_lookup */
+
+}
+
+/*---------------------------------------------------------------------------
+ *
+ TODO Build in halo with extrusion
+ *
+ * parameters:
+ * ct <-> pointer to a ct structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_build_halo_with_extrusion(cs_ctwr_zone_t *ct)
+{
+ cs_int_t i, idx, counter, j;
+ cs_int_t *list_tmp = NULL;
+ cs_halo_t *halo = ct->water_halo;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+
+ BFT_MALLOC(list_tmp , halo->n_send_elts[0], cs_int_t);
+
+ for (i = 0; i < halo->n_send_elts[0]; i++)
+ list_tmp[i] = halo->send_list[i];
+
+
+ BFT_REALLOC(halo->send_list, halo->n_send_elts[0]*ct->nelect, cs_int_t);
+
+ counter = 0;
+ for (i = 0; i < n_c_domains; i++){
+
+ for ( idx = halo->send_index[i];
+ idx < halo->send_index[i + 1]; idx++){
+ for ( j = 0; j < ct->nelect ; j++){
+
+ halo->send_list[counter] = list_tmp[idx]*ct->nelect + j ;
+
+ counter++;
+ }
+ }
+ halo->send_index[i] *= ct->nelect ;
+ }
+
+ halo->send_index[n_c_domains] *= ct->nelect ;
+
+ halo->n_send_elts[0] *= ct->nelect;
+ halo->n_send_elts[1] = halo->n_send_elts[0];
+
+ BFT_FREE(list_tmp);
+
+}
+
+/*---------------------------------------------------------------------------
+ * Define the elements of send_halo structure.
+ *
+ * Two main loops. First one for counting number of elements and create index.
+ * Second one for filling the ghost cells list.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure
+ * vtx_faces_idx --> "vtx -> faces" connectivity index
+ * vtx_faces_lst --> "vtx -> faces" connectivity list
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_send_halo(cs_ctwr_zone_t *ct,
+ fvm_interface_set_t *interface_set,
+ cs_int_t *vtx_faces_idx,
+ cs_int_t *vtx_faces_lst)
+{
+ cs_int_t i, fac_idx, shift, rank_id;
+ cs_int_t vtx_id, n_interfaces;
+
+ cs_halo_t *halo = ct->water_halo;
+ vtx_lookup_table_t *vtx_lookup = NULL;
+
+ cs_int_t *vtx_checker = NULL;
+ cs_int_t *counter = NULL;
+ cs_int_t *faces_tag = NULL;
+
+ const cs_int_t n_vertices = fvm_nodal_get_n_entities(ct->face_sup_mesh, 0);
+ const cs_int_t n_faces = fvm_nodal_get_n_entities(ct->face_sup_mesh, 2);
+
+
+ /* We should have the faces -> vertices connectivity to continue */
+
+ if (vtx_faces_lst == NULL)
+ return;
+
+ /* Create a lookup table to accelerate search in
+ fvm_interface_set structure */
+
+ vtx_lookup = _vtx_lookup_create(n_vertices, interface_set);
+ n_interfaces = vtx_lookup->n_interfaces;
+
+
+ BFT_MALLOC(vtx_checker, n_interfaces, cs_int_t);
+ BFT_MALLOC(faces_tag, n_faces * n_interfaces, cs_int_t);
+
+ for (fac_idx = 0; fac_idx < n_faces * n_interfaces; fac_idx++)
+ faces_tag[fac_idx] = 0;
+
+ /* First loop to create index and allocate send_list */
+
+ for (vtx_id = 0; vtx_id < n_vertices; vtx_id++) {
+
+ for (i = 0; i < n_interfaces; i++)
+ vtx_checker[i] = 0;
+
+ _update_vtx_checker(vtx_id, vtx_checker, vtx_lookup);
+
+ for (fac_idx = vtx_faces_idx[vtx_id];
+ fac_idx < vtx_faces_idx[vtx_id + 1]; fac_idx++){
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+ if (vtx_checker[rank_id] == 1 ) {
+
+ if (faces_tag[n_faces*rank_id + vtx_faces_lst[fac_idx ]] != 1){
+
+ halo->send_index[rank_id + 1] += 1;
+ faces_tag[n_faces*rank_id + vtx_faces_lst[fac_idx]] = 1;
+
+ }
+
+ }
+ }
+ }
+ } /* End of loop on vertices */
+
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ halo->send_index[rank_id + 1] += halo->send_index[rank_id];
+
+ } /* End of loop on c_domain_rank */
+
+ BFT_MALLOC(halo->send_list, halo->send_index[halo->n_c_domains], cs_int_t);
+
+
+ /* Initialize counter */
+
+ BFT_MALLOC(counter, n_interfaces, cs_int_t);
+
+ for (i = 0; i < n_interfaces; i++)
+ counter[i] = 0;
+
+
+ /* Second loop to build halo->ghost_cells */
+
+ for (fac_idx = 0; fac_idx < n_faces * n_interfaces; fac_idx++)
+ faces_tag[ fac_idx ] = 0;
+
+ for (vtx_id = 0; vtx_id <n_vertices; vtx_id++) {
+
+ for (i = 0; i < n_interfaces; i++)
+ vtx_checker[i] = 0;
+
+ _update_vtx_checker(vtx_id, vtx_checker, vtx_lookup);
+
+
+ for (fac_idx = vtx_faces_idx[vtx_id];
+ fac_idx < vtx_faces_idx[vtx_id + 1]; fac_idx++){
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+ if (vtx_checker[rank_id] == 1){
+ if (faces_tag[n_faces*rank_id + vtx_faces_lst[fac_idx]] != 1) {
+
+ shift = halo->send_index[rank_id] + counter[rank_id];
+ halo->send_list[shift] = vtx_faces_lst[fac_idx];
+ counter[rank_id] += 1;
+
+ faces_tag[n_faces*rank_id + vtx_faces_lst[fac_idx]] = 1;
+
+ }
+ }
+ }
+ }
+ }
+
+ /* Free memory */
+
+ BFT_FREE(vtx_checker);
+ BFT_FREE(counter);
+
+
+ /* Destroy the lookup table strcuture */
+
+ _vtx_lookup_destroy(vtx_lookup);
+
+ /* Complete halo definition */
+
+ halo->n_send_elts[CS_HALO_STANDARD] = 0;
+ halo->n_send_elts[CS_HALO_EXTENDED] = 0;
+
+ for (i = 0; i < halo->n_c_domains; i++) {
+
+ halo->n_send_elts[CS_HALO_STANDARD] += halo->send_index[i+1]
+ - halo->send_index[i];
+
+ }
+
+ halo->n_send_elts[CS_HALO_EXTENDED] += halo->n_send_elts[CS_HALO_STANDARD];
+}
+
+/*---------------------------------------------------------------------------
+ * Define a buffer on vertices where vertex belonging to the interface_set
+ * are tagged with 1 else 0.
+ *
+ * parameters:
+ * n_vertices --> size of the buffer
+ * interface_set --> pointer to a fvm_interface_set_t structure
+ * p_vertex_tag <-> pointer to the tagged buffer
+ *---------------------------------------------------------------------------*/
+
+static void
+_get_vertex_tag(cs_int_t n_vertices,
+ const fvm_interface_set_t *interface_set,
+ cs_int_t *p_vertex_tag[])
+{
+ cs_int_t i, j, rank_id;
+
+ cs_int_t *vertex_tag = NULL;
+
+ const int ifs_size = fvm_interface_set_size(interface_set);
+
+ BFT_MALLOC(vertex_tag, n_vertices, cs_int_t);
+
+ for (i = 0; i < n_vertices; i++)
+ vertex_tag[i] = 0;
+
+ for (rank_id = 0; rank_id < ifs_size; rank_id++) {
+
+ const fvm_interface_t *interface = fvm_interface_set_get(interface_set, rank_id);
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num(interface);
+ const fvm_lnum_t if_size = fvm_interface_size(interface);
+
+ for (j = 0; j < if_size; j++)
+ vertex_tag[local_num[j]-1] = 1;
+
+ } /* End of loop on ranks */
+
+ *p_vertex_tag = vertex_tag;
+
+}
+
+
+/*---------------------------------------------------------------------------
+ * Exchange number and list of cells constituting send_halo structure for each
+ * frontier ranks. Fill the halo structure from these data.
+ *
+ * parameters:
+ * ct --> pointer to a ct structure
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_halo(cs_ctwr_zone_t *ct)
+{
+ cs_int_t rank_id, i;
+ cs_int_t shift;
+
+#if defined(HAVE_MPI)
+ MPI_Request _request[128];
+ MPI_Request *request = _request;
+ MPI_Status _status[128];
+ MPI_Status *status = _status;
+#endif
+
+ int request_count = 0;
+
+ cs_int_t *count = NULL;
+
+ cs_halo_t *halo = ct->water_halo;
+
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+
+#if defined(HAVE_MPI)
+ if (halo->n_c_domains*2 > 128) {
+ BFT_MALLOC(request, halo->n_c_domains*2, MPI_Request);
+ BFT_MALLOC(status, halo->n_c_domains*2, MPI_Status);
+ }
+#endif
+
+ /* Build index */
+ /* ----------- */
+ /* Receive data from distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Irecv(&(halo->index[rank_id+1]), 1, CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+#endif
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* We wait for receiving all messages */
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ BFT_MALLOC(count, n_c_domains, cs_int_t);
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ shift = rank_id;
+ count[shift] = halo->send_index[rank_id+1]
+ - halo->send_index[rank_id];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Isend(&(count[shift]), 1, CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ local_rank,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+#endif
+
+ }
+ else {
+
+ halo->index[shift+1] = count[shift];
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Wait for all exchanges being done */
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Waitall(request_count, request, status);
+#endif
+ request_count = 0;
+
+ BFT_FREE(count);
+
+ /* Build index */
+ /*-------------*/
+
+ for (i = 0; i < n_c_domains; i++)
+ halo->index[i+1] += halo->index[i];
+
+#if defined(HAVE_MPI)
+ if (request != _request) {
+ BFT_FREE(request);
+ BFT_FREE(status);
+ }
+#endif
+
+ halo->n_elts[CS_HALO_STANDARD] = 0;
+ halo->n_elts[CS_HALO_EXTENDED] = 0;
+
+ for (i = 0; i < n_c_domains; i++) {
+
+ halo->n_elts[CS_HALO_STANDARD] += halo->index[i+1] - halo->index[i];
+
+ }
+
+ halo->n_elts[CS_HALO_EXTENDED] += halo->n_elts[CS_HALO_STANDARD];
+}
+
+/*---------------------------------------------------------------------------
+ * TODO
+ *---------------------------------------------------------------------------*/
+
+static void
+_fill_index_out_halo(cs_ctwr_zone_t *ct)
+{
+ cs_int_t rank_id, i;
+ cs_int_t shift;
+
+#if defined(HAVE_MPI)
+ MPI_Request _request[128];
+ MPI_Request *request = _request;
+ MPI_Status _status[128];
+ MPI_Status *status = _status;
+#endif
+
+ int request_count = 0;
+
+ cs_int_t *count = NULL;
+
+ cs_halo_t *halo = ct->water_halo;
+
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+
+#if defined(HAVE_MPI)
+ if (halo->n_c_domains*2 > 128) {
+ BFT_MALLOC(request, halo->n_c_domains*2, MPI_Request);
+ BFT_MALLOC(status, halo->n_c_domains*2, MPI_Status);
+ }
+#endif
+
+ /* Build index */
+ /* ----------- */
+ /* Receive data from distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Irecv(&(halo->index[rank_id+1]), 1, CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+#endif
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* We wait for receiving all messages */
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Barrier(cs_glob_mpi_comm);
+#endif
+
+ BFT_MALLOC(count, n_c_domains, cs_int_t);
+
+ /* Send data to distant ranks */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ shift = rank_id;
+ count[shift] = halo->send_index[rank_id+1]
+ - halo->send_index[rank_id];
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Isend(&(count[shift]), 1, CS_MPI_INT,
+ halo->c_domain_rank[rank_id],
+ local_rank,
+ cs_glob_mpi_comm,
+ &(request[request_count++]));
+#endif
+
+ }
+ else {
+
+ halo->index[shift+1] = count[shift];
+
+ }
+
+ } /* End of loop on ranks */
+
+ /* Wait for all exchanges being done */
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1)
+ MPI_Waitall(request_count, request, status);
+#endif
+ request_count = 0;
+
+ BFT_FREE(count);
+
+ /* Build index */
+ /*-------------*/
+
+ for (i = 0; i < n_c_domains; i++)
+ halo->index[i+1] += halo->index[i];
+
+ /* Wait for all exchanges being done */
+
+#if defined(HAVE_MPI)
+ if (request_count > 0)
+ MPI_Waitall(request_count, request, status);
+#endif
+ request_count = 0;
+
+ /* Exchange number of elements for each periodicity and for each rank.
+ Then build out_halo->perio_lst */
+
+ halo->n_elts[0] = 0;
+
+ for (i = 0; i < n_c_domains; i++)
+ halo->n_elts[0] += halo->index[i+1] - halo->index[i];
+
+ halo->n_elts[1] = halo->n_elts[0];
+}
+
+/*---------------------------------------------------------------------------
+ * Send "ghost cells to distant_num vertices" connectivity on communicating
+ * ranks and receive the same kind of connectivity from distant ranks.
+ *
+ * parameters:
+ * ct --> pointer to ct structure
+ * send_gface_dist_vtx_idx <-- "ghost face -> distant vertices" index
+ * send_gface_dist_vtx_lst <-- "ghost face -> distant vertices" list
+ * p_gface_dist_vtx_idx --> "ghost face -> distant vertices" index
+ * p_gface_dist_vtx_lst --> "ghost face -> distant vertices" list
+ *---------------------------------------------------------------------------*/
+
+static void
+_exchange_gface_vtx_connect(cs_ctwr_zone_t *ct,
+ cs_int_t *send_gface_dist_vtx_idx,
+ cs_int_t *send_gface_dist_vtx_lst,
+ cs_int_t *p_gface_dist_vtx_idx[],
+ cs_int_t *p_gface_dist_vtx_lst[])
+{
+ cs_int_t i, j, rank_id;
+ cs_int_t send_start_idx, send_end_idx, start_idx, end_idx;
+ cs_int_t n_send_elts, n_recv_elts;
+
+ cs_int_t send_buffer_size = 0;
+
+ cs_int_t *send_idx_buffer = NULL;
+ cs_int_t *gface_dist_vtx_idx = NULL, *gface_dist_vtx_lst = NULL;
+ cs_int_t *send_buffer = NULL, *recv_buffer = NULL;
+
+ cs_halo_t *halo = ct->water_halo;
+
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+ const cs_int_t n_c_domains = halo->n_c_domains;
+ const cs_int_t n_ghost_faces = halo->n_elts[CS_HALO_EXTENDED];
+
+#if defined(HAVE_MPI)
+ MPI_Status status;
+#endif
+
+ /* Allocate buffers */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+ n_send_elts = halo->send_index[ rank_id + 1]- halo->send_index[ rank_id ];
+ send_buffer_size = CS_MAX(send_buffer_size, n_send_elts);
+ }
+ }
+
+ BFT_MALLOC(send_idx_buffer, send_buffer_size, cs_int_t);
+ BFT_MALLOC(gface_dist_vtx_idx, n_ghost_faces + 1, cs_int_t);
+
+ for (i = 0; i < n_ghost_faces + 1; i++)
+ gface_dist_vtx_idx[i] = 0;
+
+ /* Exchange sizes to define gface_dist_vtx_idx */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ recv_buffer = &(gface_dist_vtx_idx[1 + halo->index[rank_id]]);
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+ /* Fill send buffer */
+
+ for (i = halo->send_index[rank_id], j = 0;
+ i < halo->send_index[rank_id + 1]; i++, j++)
+ send_idx_buffer[j] = send_gface_dist_vtx_idx[i+1] - send_gface_dist_vtx_idx[i];
+
+ n_send_elts = halo->send_index[rank_id + 1] - halo->send_index[rank_id];
+ n_recv_elts = halo->index[rank_id + 1] - halo->index[rank_id];
+
+#if defined(HAVE_MPI)
+ MPI_Sendrecv(&(send_idx_buffer[0]), n_send_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ &(recv_buffer[0]), n_recv_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, &status);
+#endif
+
+ } /* If rank != local_rank */
+
+ else {
+
+ for (i = halo->send_index[ rank_id ], j = 0;
+ i < halo->send_index[ rank_id + 1 ]; i++, j++)
+ recv_buffer[j] = send_gface_dist_vtx_idx[i+1] - send_gface_dist_vtx_idx[i];
+
+ } /* rank == local_rank */
+
+ } /* End of loop on if_ranks */
+
+ BFT_FREE(send_idx_buffer);
+
+ /* Define index */
+
+ for (i = 0; i < n_ghost_faces; i++)
+ gface_dist_vtx_idx[i+1] += gface_dist_vtx_idx[i];
+
+ BFT_MALLOC(gface_dist_vtx_lst, gface_dist_vtx_idx[n_ghost_faces], cs_int_t);
+
+ /* Exchange lists to define gface_dist_vtx_lst */
+
+ for (rank_id = 0; rank_id < n_c_domains; rank_id++) {
+
+ /* Exchange conectivity list */
+
+ send_start_idx = send_gface_dist_vtx_idx[halo->send_index[rank_id]];
+ send_end_idx = send_gface_dist_vtx_idx[halo->send_index[rank_id + 1]];
+ n_send_elts = send_end_idx - send_start_idx;
+ send_buffer = &(send_gface_dist_vtx_lst[send_start_idx]);
+
+ start_idx = gface_dist_vtx_idx[halo->index[rank_id]];
+ end_idx = gface_dist_vtx_idx[halo->index[ rank_id + 1]];
+ n_recv_elts = end_idx - start_idx;
+ recv_buffer = &(gface_dist_vtx_lst[start_idx]);
+
+ if (halo->c_domain_rank[rank_id] != local_rank) {
+
+#if defined(HAVE_MPI)
+ MPI_Sendrecv(send_buffer, n_send_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], local_rank,
+ recv_buffer, n_recv_elts, CS_MPI_INT,
+ halo->c_domain_rank[rank_id], halo->c_domain_rank[rank_id],
+ cs_glob_mpi_comm, &status);
+#endif
+
+ }
+ else {
+
+ assert(n_recv_elts == n_send_elts);
+
+ for (i = 0; i < n_send_elts; i++)
+ recv_buffer[i] = send_buffer[i];
+
+ }
+
+ } /* End of loop on ranks */
+
+ *p_gface_dist_vtx_idx = gface_dist_vtx_idx;
+ *p_gface_dist_vtx_lst = gface_dist_vtx_lst;
+
+}
+
+
+/*----------------------------------------------------------------------------
+ *
+ *----------------------------------------------------------------------------*/
+
+static void
+_create_gvtx_faces_connect(cs_ctwr_zone_t *ct,
+ fvm_interface_set_t *interface_set,
+ cs_int_t *vtx_faces_idx[],
+ cs_int_t *vtx_faces_lst[])
+{
+ cs_int_t id, nb, index, index_g;
+
+ cs_int_t *vtx_tag = NULL;
+ fvm_lnum_t *_g_vtx_faces_idx = NULL;
+ fvm_lnum_t *_g_vtx_faces_lst = NULL;
+ cs_int_t *_vtx_faces_idx = NULL;
+ cs_int_t *_vtx_faces_lst = NULL;
+
+
+ const cs_int_t n_vtx
+ = (cs_int_t) fvm_nodal_get_n_entities(ct->face_sup_mesh, 0);
+
+ fvm_nodal_get_vertex_elements(ct->face_sup_mesh,
+ 2,
+ &(_g_vtx_faces_idx),
+ &(_g_vtx_faces_lst));
+ *vtx_faces_idx = NULL;
+ *vtx_faces_lst = NULL;
+
+ if (interface_set == NULL)
+ return;
+
+ _get_vertex_tag(n_vtx, interface_set, &vtx_tag);
+
+ BFT_MALLOC(_vtx_faces_idx, n_vtx + 1, cs_int_t);
+
+ _vtx_faces_idx[0] = 0;
+
+ for (id = 0; id < n_vtx; id++) {
+
+ if (vtx_tag[id] == 1){
+ nb = (cs_int_t) _g_vtx_faces_idx[id + 1] - _g_vtx_faces_idx[id];
+ _vtx_faces_idx[id + 1] = _vtx_faces_idx[id] + nb;
+
+ }else{
+
+ _vtx_faces_idx[id + 1] = _vtx_faces_idx[id];
+
+ }
+
+ }
+
+ BFT_MALLOC( _vtx_faces_lst, _vtx_faces_idx[ n_vtx ] , cs_int_t );
+
+
+ if( _vtx_faces_idx[ n_vtx ] == 0 )
+ return;
+
+ index = 0;
+
+
+ for ( id = 0; id < n_vtx; id++) {
+ if (vtx_tag[ id ] == 1){
+ for ( index_g = _g_vtx_faces_idx[ id ];
+ index_g < _g_vtx_faces_idx[ id + 1 ]; index_g++) {
+
+ _vtx_faces_lst[ index ] = (cs_int_t) _g_vtx_faces_lst[ index_g ];
+ index++;
+
+
+ }
+ }
+ }
+
+
+ *vtx_faces_idx = _vtx_faces_idx ;
+ *vtx_faces_lst = _vtx_faces_lst ;
+
+ BFT_FREE( _g_vtx_faces_idx );
+ BFT_FREE( _g_vtx_faces_lst );
+ BFT_FREE( vtx_tag );
+
+}
+
+
+/*---------------------------------------------------------------------------
+ * Create a local "ghost faces -> distant vertices" connectivity for
+ * in_halo cells.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure
+ * g_faces_vtx_idx --> "faces -> vertices" connectivity index
+ * g_faces_vtx_lst --> "faces -> vertices" connectivity list
+ * p_g_in_faces_vtx_idx<-- "ghost faces -> distant vertices" connect. index
+ * p_g_in_faces_vtx_lst<-- "ghost faces -> distant vertices" connect. list
+ *---------------------------------------------------------------------------*/
+
+static void
+_create_in_faces_vtx_connect( cs_ctwr_zone_t *ct ,
+ fvm_interface_set_t *interface_set ,
+ cs_int_t *g_faces_vtx_idx ,
+ cs_int_t *g_faces_vtx_lst ,
+ cs_int_t *p_g_in_faces_vtx_idx[] ,
+ cs_int_t *p_g_in_faces_vtx_lst[] )
+{
+ cs_int_t i, j, rank_id, nb_face_in, nb_face_out,idfac,ivtx, shift ;
+
+ cs_halo_t *halo = ct->water_halo;
+
+
+ cs_int_t * g_in_faces_vtx_idx;
+ cs_int_t * g_in_faces_vtx_lst;
+
+ cs_int_t *vertex_tag = NULL;
+ cs_int_t *counter = NULL;
+
+ if (interface_set == NULL)
+ return;
+
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+ const cs_int_t n_vertices = (cs_int_t) fvm_nodal_get_n_entities(ct->face_sup_mesh, 0);
+
+ const int ifs_size = fvm_interface_set_size(interface_set);
+
+ nb_face_in = halo->send_index[halo->n_c_domains];
+ nb_face_out = halo->index[halo->n_c_domains];
+
+ BFT_MALLOC(vertex_tag, n_vertices, cs_int_t);
+
+ BFT_MALLOC(g_in_faces_vtx_idx, nb_face_in + 1 , cs_int_t);
+
+
+
+ /* first loop to count*/
+ for (idfac = 0; idfac < nb_face_in + 1; idfac++)
+ g_in_faces_vtx_idx[ idfac ] = 0;
+
+ for (rank_id = 0; rank_id < ifs_size; rank_id++) {
+
+ for (i = 0; i < n_vertices; i++)
+ vertex_tag[i] = -1;
+
+ if( halo->c_domain_rank[ rank_id ] != local_rank ) {
+ const fvm_interface_t *interface = fvm_interface_set_get( interface_set ,
+ rank_id );
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num( interface );
+ const fvm_lnum_t if_size = fvm_interface_size( interface );
+
+ for (j = 0; j < if_size; j++)
+ vertex_tag[ local_num[ j ] - 1 ] = 0;
+
+
+ for(idfac = halo->send_index[rank_id];
+ idfac < halo->send_index[rank_id + 1]; idfac++) {
+ for( ivtx = g_faces_vtx_idx [ halo->send_list[ idfac ] ];
+ ivtx < g_faces_vtx_idx [ halo->send_list[ idfac ] + 1 ]; ivtx++ ){
+ if (vertex_tag[ g_faces_vtx_lst[ ivtx ] ] != -1 )
+ g_in_faces_vtx_idx[ idfac + 1 ]++;
+ }
+
+ }
+
+ }
+ } /* End of loop on ranks */
+
+ BFT_MALLOC( counter, nb_face_in , cs_int_t );
+
+ for( idfac = 0; idfac < nb_face_in; idfac++ ){
+ g_in_faces_vtx_idx[ idfac + 1 ] += g_in_faces_vtx_idx[ idfac ];
+ counter[ idfac ] = 0;
+ }
+
+ /* second loop to */
+ BFT_MALLOC( g_in_faces_vtx_lst, g_in_faces_vtx_idx[ nb_face_in ] , cs_int_t );
+
+
+
+ for (rank_id = 0; rank_id < ifs_size; rank_id++) {
+
+ for (i = 0; i < n_vertices; i++)
+ vertex_tag[i] = -1;
+
+ if( halo->c_domain_rank[ rank_id ] != local_rank ) {
+ const fvm_interface_t *interface = fvm_interface_set_get( interface_set ,
+ rank_id );
+ const fvm_lnum_t *local_num = fvm_interface_get_local_num( interface );
+ const fvm_lnum_t *distant_num = fvm_interface_get_distant_num( interface );
+ const fvm_lnum_t if_size = fvm_interface_size( interface );
+
+ for (j = 0; j < if_size; j++)
+ vertex_tag[ local_num[ j ] - 1 ] = distant_num [ j ] - 1;
+
+
+ for(idfac = halo->send_index[rank_id];
+ idfac < halo->send_index[rank_id + 1]; idfac++){
+ for(ivtx = g_faces_vtx_idx [halo->send_list[idfac]];
+ ivtx < g_faces_vtx_idx [halo->send_list[idfac] + 1]; ivtx++){
+ if (vertex_tag[ g_faces_vtx_lst[ ivtx ] ] != -1 ){
+
+ shift = g_in_faces_vtx_idx[ idfac ] + counter[ idfac ];
+ g_in_faces_vtx_lst[ shift ] = vertex_tag[ g_faces_vtx_lst[ ivtx ] ];
+ counter[ idfac ]++;
+ }
+ }
+ }
+ }
+ } /* End of loop on ranks */
+
+
+ *p_g_in_faces_vtx_idx = g_in_faces_vtx_idx;
+ *p_g_in_faces_vtx_lst = g_in_faces_vtx_lst;
+}
+
+/*---------------------------------------------------------------------------
+ *
+ *---------------------------------------------------------------------------*/
+
+static void
+_update_gfaces_connect(cs_ctwr_zone_t *ct,
+ cs_int_t *faces_vtx_idx,
+ cs_int_t *faces_vtx_lst,
+ cs_int_t *g_vtx_faces_idx[],
+ cs_int_t *g_vtx_faces_lst[])
+{
+ cs_int_t i, idx, shift;
+
+ cs_halo_t *halo = ct->water_halo;
+
+ cs_int_t *new_vtx_faces_idx = NULL;
+ cs_int_t *new_vtx_faces_lst = NULL;
+ cs_int_t *_g_vtx_faces_idx = NULL;
+ cs_int_t *_g_vtx_faces_lst = NULL;
+
+ cs_int_t *counter = NULL;
+
+
+ const cs_int_t n_vertices = (cs_int_t) fvm_nodal_get_n_entities( ct->face_sup_mesh, 0 );
+ const cs_int_t n_faces = (cs_int_t) fvm_nodal_get_n_entities( ct->face_sup_mesh, 2 );
+
+ BFT_MALLOC( new_vtx_faces_idx, n_vertices + 1 , cs_int_t);
+
+ fvm_nodal_get_vertex_elements( ct->face_sup_mesh ,
+ 2 ,
+ &(_g_vtx_faces_idx) ,
+ &(_g_vtx_faces_lst) );
+
+ new_vtx_faces_idx[ 0 ]= 0;
+ for (i = 0; i < n_vertices; i++)
+ new_vtx_faces_idx[ i + 1 ] = _g_vtx_faces_idx[ i + 1 ] - _g_vtx_faces_idx[ i ];
+
+ for (i = 0; i < halo->n_elts[0]; i++)
+ for (idx = faces_vtx_idx[i] ;
+ idx < faces_vtx_idx[i + 1] ; idx++ )
+ {
+ new_vtx_faces_idx[faces_vtx_lst[idx] + 1] +=1;
+ }
+
+ for (i = 0; i < n_vertices; i++) {
+ new_vtx_faces_idx[ i + 1 ] += new_vtx_faces_idx[ i ];
+ }
+ BFT_MALLOC( new_vtx_faces_lst, new_vtx_faces_idx[ n_vertices ] , cs_int_t);
+
+ BFT_MALLOC( counter, n_vertices , cs_int_t);
+
+ for ( i = 0; i < n_vertices ; i++ )
+ counter[ i ] = 0 ;
+
+ for (i = 0; i < n_vertices; i++)
+ for (idx = _g_vtx_faces_idx[ i ] ;
+ idx < _g_vtx_faces_idx[ i + 1] ; idx++ )
+ {
+ shift = new_vtx_faces_idx[ i ] + counter[ i ];
+ new_vtx_faces_lst[ shift ] = _g_vtx_faces_lst[ idx ];
+ counter[ i ]++;
+ }
+
+ for (i = 0; i < halo->n_elts[0]; i++)
+ for (idx = faces_vtx_idx[i] ;
+ idx < faces_vtx_idx[i + 1] ; idx++ )
+ {
+ shift = new_vtx_faces_idx[faces_vtx_lst[idx]]
+ + counter[faces_vtx_lst[idx]];
+
+ new_vtx_faces_lst[ shift ] = i + n_faces ;
+
+ counter[faces_vtx_lst[idx]]++;
+ }
+
+
+ *g_vtx_faces_idx = new_vtx_faces_idx;
+ *g_vtx_faces_lst = new_vtx_faces_lst;
+
+ BFT_FREE( _g_vtx_faces_idx );
+ BFT_FREE( _g_vtx_faces_lst );
+
+ BFT_FREE( counter );
+
+}
+
+/*---------------------------------------------------------------------------
+ * st
+ *---------------------------------------------------------------------------*/
+
+static void
+_create_faces_faces_connect( cs_ctwr_zone_t *ct ,
+ cs_int_t * faces_vtx_idx ,
+ cs_int_t * faces_vtx_lst ,
+ cs_int_t * vtx_faces_idx ,
+ cs_int_t * vtx_faces_lst )
+{
+ cs_int_t i, shift, iface, ivtx, ifext;
+
+ cs_halo_t *halo = ct->water_halo;
+
+ cs_int_t *counter = NULL;
+ cs_int_t *face_tag = NULL;
+
+ const cs_int_t n_faces = ct->nnpsct;
+ const cs_int_t n_faces_with_ghosts = n_faces + halo->n_elts[0];
+
+ BFT_MALLOC(ct->fac_sup_connect_idx, n_faces + 1, cs_int_t);
+ BFT_MALLOC(face_tag, n_faces_with_ghosts, cs_int_t);
+
+ if (vtx_faces_idx == NULL)
+ fvm_nodal_get_vertex_elements(ct->face_sup_mesh,
+ 2,
+ &(vtx_faces_idx),
+ &(vtx_faces_lst));
+
+
+
+ for (iface = 0; iface < n_faces + 1; iface++)
+ ct->fac_sup_connect_idx[ iface ]= 0;
+
+ for (iface = 0; iface < n_faces; iface++)
+ {
+ for (i = 0; i < n_faces_with_ghosts; i ++)
+ face_tag[ i ] = 0;
+
+ face_tag[ iface ] = -1;
+
+ for (ivtx = faces_vtx_idx[iface];
+ ivtx < faces_vtx_idx[iface + 1]; ivtx++) {
+
+ for (ifext = vtx_faces_idx[faces_vtx_lst[ivtx]];
+ ifext < vtx_faces_idx[faces_vtx_lst[ivtx] + 1]; ifext++) {
+
+ if (face_tag[vtx_faces_lst[ifext]] != -1) {
+ ct->fac_sup_connect_idx[iface + 1] ++;
+ face_tag[vtx_faces_lst[ifext]] = -1;
+ }
+ }
+ }
+
+ }
+
+ for (iface = 0; iface < n_faces; iface++)
+ ct->fac_sup_connect_idx[ iface + 1 ] += ct->fac_sup_connect_idx[ iface ];
+
+ BFT_MALLOC( ct->fac_sup_connect_lst, ct->fac_sup_connect_idx[ n_faces ] , cs_int_t);
+
+ BFT_MALLOC( counter, n_faces , cs_int_t);
+
+ for ( i = 0; i < n_faces ; i++ )
+ counter[ i ] = 0 ;
+
+ for (iface = 0; iface < n_faces; iface++)
+ {
+ for (i = 0; i < n_faces_with_ghosts; i ++)
+ face_tag[ i ] = 0;
+
+ face_tag[ iface ] = -1;
+
+ for (ivtx = faces_vtx_idx[ iface ];
+ ivtx < faces_vtx_idx[ iface + 1 ]; ivtx++)
+ {
+ for (ifext = vtx_faces_idx[ faces_vtx_lst[ ivtx ] ];
+ ifext < vtx_faces_idx[ faces_vtx_lst[ ivtx ] + 1 ]; ifext++)
+ {
+ if( face_tag[ vtx_faces_lst[ifext] ] != -1 )
+ {
+ shift = ct->fac_sup_connect_idx[ iface ] + counter[ iface ];
+
+ ct->fac_sup_connect_lst[ shift ] = vtx_faces_lst[ ifext ];
+
+ face_tag[ vtx_faces_lst [ ifext ] ] = -1;
+ counter[ iface ]++;
+ }
+ }
+ }
+
+ }
+
+ BFT_FREE(counter);
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*---------------------------------------------------------------------------
+ * Reverse "ghost cells -> vertex" connectivity into "vertex -> ghost cells"
+ * connectivity for out_halo elements.
+ * Build the connectivity list.
+ *
+ * parameters:
+ * halo --> pointer to a cs_mesh_halo_t structure
+ * n_vertices --> number of vertices
+ * rank_id --> rank number to work with
+ * counter <-> temporary array to count vertices
+ * checker <-> temporary array to check vertices
+ * gcell_vtx_idx --> "ghost cell -> vertices" connectivity index
+ * gcell_vtx_lst --> "ghost cell -> vertices" connectivity list
+ * vtx_gcells_idx --> "vertex -> ghost cells" connectivity index
+ * vtx_gcells_lst <-> "vertex -> ghost cells" connectivity list
+ *---------------------------------------------------------------------------*/
+
+void
+cs_reverse_vtx_faces_connect(const fvm_nodal_t *this_nodal ,
+ cs_int_t *faces_vtx_idx[] ,
+ cs_int_t *faces_vtx_lst[] )
+{
+ cs_int_t iv, ifac, shift ;
+
+ cs_int_t *_faces_vtx_idx = NULL;
+ cs_int_t *_faces_vtx_lst = NULL;
+ cs_int_t *_vtx_faces_idx = NULL;
+ cs_int_t *_vtx_faces_lst = NULL;
+
+ cs_int_t *counter = NULL;
+ const cs_int_t n_vtx = (cs_int_t) fvm_nodal_get_n_entities( this_nodal, 0 );
+ const cs_int_t n_fac = (cs_int_t) fvm_nodal_get_n_entities( this_nodal, 2 );
+
+ BFT_MALLOC( _faces_vtx_idx , n_fac + 1 , cs_int_t);
+ BFT_MALLOC( counter, n_fac , cs_int_t);
+
+ fvm_nodal_get_vertex_elements( this_nodal ,
+ 2 ,
+ &(_vtx_faces_idx) ,
+ &(_vtx_faces_lst) );
+
+ for ( ifac = 0; ifac < n_fac + 1 ; ifac++ )
+ _faces_vtx_idx[ ifac ] = 0 ;
+
+ for ( ifac = 0; ifac < n_fac ; ifac++ )
+ counter[ ifac ] = 0 ;
+
+ for (iv = 0; iv < n_vtx ; iv++) {
+ for ( ifac = _vtx_faces_idx[ iv ];
+ ifac < _vtx_faces_idx[ iv + 1 ] ; ifac++) {
+
+ _faces_vtx_idx[ _vtx_faces_lst[ ifac ] + 1 ] ++;
+
+ }
+
+ }
+
+ for ( ifac = 0; ifac < n_fac ; ifac++ ){
+ _faces_vtx_idx[ ifac + 1 ] += _faces_vtx_idx[ ifac ];
+ }
+
+ BFT_MALLOC( _faces_vtx_lst , _faces_vtx_idx[ n_fac ] , cs_int_t);
+
+ for (iv = 0; iv < n_vtx ; iv++) {
+ for ( ifac = _vtx_faces_idx[ iv ];
+ ifac < _vtx_faces_idx[ iv + 1 ] ; ifac++) {
+
+ shift = _faces_vtx_idx[ _vtx_faces_lst[ ifac ] ]
+ + counter[ _vtx_faces_lst[ ifac ] ];
+
+ _faces_vtx_lst[ shift ] = iv ;
+
+ counter[ _vtx_faces_lst[ ifac ] ]++;
+
+ }
+
+ }
+
+ BFT_FREE( counter );
+
+ *faces_vtx_idx = _faces_vtx_idx;
+ *faces_vtx_lst = _faces_vtx_lst;
+}
+
+
+/*----------------------------------------------------------------------------
+ * Define halo structures for internal and distant ghost cells.
+ *
+ * parameters:
+ * mesh --> pointer to cs_mesh_t structure
+ * interface_set --> pointer to fvm_interface_set_t structure.
+ * p_gcell_vtx_idx <-- pointer to the connectivity index
+ * p_gcell_vtx_lst <-- pointer to the connectivity list
+ *---------------------------------------------------------------------------*/
+
+void
+cs_ctwr_halo_define(cs_ctwr_zone_t *ct,
+ fvm_interface_set_t *interface_set)
+{
+ cs_int_t *vtx_faces_idx = NULL;
+ cs_int_t *vtx_faces_lst = NULL;
+ cs_int_t *g_vtx_faces_idx = NULL;
+ cs_int_t *g_vtx_faces_lst = NULL;
+ cs_int_t *g_faces_vtx_idx = NULL;
+ cs_int_t *g_faces_vtx_lst = NULL;
+
+ cs_int_t *g_out_faces_vtx_idx = NULL;
+ cs_int_t *g_out_faces_vtx_lst = NULL;
+ cs_int_t *g_in_faces_vtx_idx = NULL;
+ cs_int_t *g_in_faces_vtx_lst = NULL;
+
+ cs_halo_t *halo = ct->water_halo;
+
+ ct->halo_type = CS_HALO_EXTENDED;
+
+ /* Define vtx -> faces connectivity for ghost faces */
+
+ _create_gvtx_faces_connect(ct,
+ interface_set,
+ &vtx_faces_idx,
+ &vtx_faces_lst);
+
+ /* Fill cs_halo_t structure for send_halo */
+
+ bft_printf(_(" Local halo definition\n"));
+ bft_printf_flush();
+
+ _fill_send_halo(ct,
+ interface_set,
+ vtx_faces_idx,
+ vtx_faces_lst);
+
+
+ cs_reverse_vtx_faces_connect(ct->face_sup_mesh,
+ &g_faces_vtx_idx,
+ &g_faces_vtx_lst);
+
+ _fill_index_out_halo(ct);
+
+
+ if (halo->n_elts[0] > 0) {
+
+ _create_in_faces_vtx_connect(ct,
+ interface_set,
+ g_faces_vtx_idx,
+ g_faces_vtx_lst,
+ &g_in_faces_vtx_idx,
+ &g_in_faces_vtx_lst);
+
+ _exchange_gface_vtx_connect(ct,
+ g_in_faces_vtx_idx,
+ g_in_faces_vtx_lst,
+ &g_out_faces_vtx_idx,
+ &g_out_faces_vtx_lst);
+
+ bft_printf(_(" Updating the vertex -> faces connectivity\n"));
+ bft_printf_flush();
+
+ _update_gfaces_connect(ct,
+ g_out_faces_vtx_idx,
+ g_out_faces_vtx_lst,
+ &g_vtx_faces_idx,
+ &g_vtx_faces_lst);
+
+
+ /* Free memory */
+
+ BFT_FREE(g_out_faces_vtx_idx);
+ BFT_FREE(g_out_faces_vtx_lst);
+ BFT_FREE(g_in_faces_vtx_idx);
+ BFT_FREE(g_in_faces_vtx_lst);
+
+ }
+
+
+ _create_faces_faces_connect(ct,
+ g_faces_vtx_idx,
+ g_faces_vtx_lst,
+ g_vtx_faces_idx,
+ g_vtx_faces_lst);
+
+
+ _build_halo_with_extrusion(ct);
+
+ /* Fill cs_halo_t structure for out_halo.
+ We use the data from in_halo structure */
+
+ bft_printf(_(" Distant halo definition\n"));
+ bft_printf_flush();
+
+ _fill_halo(ct);
+
+ BFT_FREE(vtx_faces_idx);
+ BFT_FREE(vtx_faces_lst);
+
+
+ /* Update mesh structure elements bound to halo management */
+
+ ct->nnpsct_with_ghosts = ct->nnpsct + halo->n_elts[0] / ct->nelect;
+
+ cs_halo_update_buffers(halo);
+
+#if 0 /* for debugging purposes */
+ cs_halo_dump(halo, 1);
+#endif
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/ctwr/cs_ctwr_mesh.c b/src/ctwr/cs_ctwr_mesh.c
new file mode 100644
index 0000000..c621518
--- /dev/null
+++ b/src/ctwr/cs_ctwr_mesh.c
@@ -0,0 +1,2215 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2009 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Definitions, Global variables variables, and functions associated with the
+ * exchange zones
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined(HAVE_MPI)
+#include <mpi.h>
+#endif
+
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_printf.h>
+#include <bft_mem.h>
+#include <bft_file.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_interface.h>
+#include <fvm_nodal_extract.h>
+#include <fvm_nodal_extrude.h>
+#include <fvm_nodal_project.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_ctwr.h"
+#include "cs_ctwr_air_props.h"
+#include "cs_ctwr_halo.h"
+#include "cs_halo.h"
+#include "cs_mesh_connect.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_ctwr_mesh.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*=============================================================================
+ * Local Macro Definitions
+ *============================================================================*/
+
+enum {X, Y, Z} ;
+
+#define CS_LOC_PRODUIT_SCALAIRE(vect1, vect2) \
+ (vect1[X] * vect2[X] + vect1[Y] * vect2[Y] + vect1[Z] * vect2[Z])
+
+#define CS_LOC_MODULE(vect) \
+ sqrt(vect[X] * vect[X] + vect[Y] * vect[Y] + vect[Z] * vect[Z])
+
+#define CS_PRODUIT_VECTORIEL(prod_vect, vect1, vect2) \
+ (prod_vect[X] = vect1[Y] * vect2[Z] - vect2[Y] * vect1[Z], \
+ prod_vect[Y] = vect2[X] * vect1[Z] - vect1[X] * vect2[Z], \
+ prod_vect[Z] = vect1[X] * vect2[Y] - vect2[X] * vect1[Y])
+
+#define CS_CT_MPI_TAG (int)('C'+'S'+'Z'+'E') /* MPI tag for FVM operations */
+
+
+/*============================================================================
+ * Local variables
+ *============================================================================*/
+
+static double _epsilon_denom = 1.e-14; /* Minimum denominator */
+
+static cs_int_t cs_ctwr_nmaxvoi = 50;
+
+#if defined(HAVE_MPI)
+MPI_Status status;
+#endif
+
+/*============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Fonctions publiques pour API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Create nodal coupled mesh.
+ * Send vertices's coordinates and connectivity of coupled mesh.
+ *
+ * Fortran Interface:
+ *
+ * SUBROUTINE GEOct
+ * *****************
+ *
+ * INTEGER n_ct : <-- : number of exchange area
+ *----------------------------------------------------------------------------*/
+
+void CS_PROCF(geoct, GEOCT) (void)
+{
+ /* construction du maillage eau*/
+ cs_ctwr_maille(cs_glob_mesh, cs_glob_mesh_quantities );
+
+ /* chainage des ct*/
+ cs_ctwr_stacking();
+ /* construction de l'interpolation AIR -> EAU */
+ cs_ctwr_adeau(cs_glob_mesh, cs_glob_mesh_quantities);
+ /* construction de l'interpolation EAU -> AIR */
+ cs_ctwr_adair();
+
+}
+
+
+/*============================================================================
+ * Fonctions publiques
+ *============================================================================*/
+
+/*---------------------------------------------------------------------------
+ * Solve the equation "matrix.x = b" with Cramer's rule.
+ *
+ * parameters:
+ * m[3][3] <-- equation matrix
+ * b[3] <-- b equation right hand side
+ * x[3] <-> equation solution (unchanged if matrix is singular)
+ *
+ * returns:
+ * 1 if matrix is singular, 0 otherwise
+ *----------------------------------------------------------------------------*/
+
+static int
+_inverse_3x3(double m[3][3],
+ double b[3],
+ double x[3])
+{
+ double det, det_inv, x0, x1, x2;
+
+ det = m[0][0]*(m[1][1]*m[2][2] - m[2][1]*m[1][2])
+ - m[1][0]*(m[0][1]*m[2][2] - m[2][1]*m[0][2])
+ + m[2][0]*(m[0][1]*m[1][2] - m[1][1]*m[0][2]);
+
+ if (FVM_ABS(det) < _epsilon_denom)
+ return 1;
+ else
+ det_inv = 1./det;
+
+ /* Use local variables to ensure no aliasing */
+
+ x0 = ( b[0]*(m[1][1]*m[2][2] - m[2][1]*m[1][2])
+ - b[1]*(m[0][1]*m[2][2] - m[2][1]*m[0][2])
+ + b[2]*(m[0][1]*m[1][2] - m[1][1]*m[0][2])) * det_inv;
+
+ x1 = ( m[0][0]*(b[1]*m[2][2] - b[2]*m[1][2])
+ - m[1][0]*(b[0]*m[2][2] - b[2]*m[0][2])
+ + m[2][0]*(b[0]*m[1][2] - b[1]*m[0][2])) * det_inv;
+
+ x2 = ( m[0][0]*(m[1][1]*b[2] - m[2][1]*b[1])
+ - m[1][0]*(m[0][1]*b[2] - m[2][1]*b[0])
+ + m[2][0]*(m[0][1]*b[1] - m[1][1]*b[0])) * det_inv;
+
+ /* Copy local variables to output */
+
+ x[0] = x0; x[1] = x1; x[2] = x2;
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------
+ * Test of coplanarity
+ *----------------------------------------------------------------------------*/
+
+static int
+_is_coplanar(const cs_real_t *coord,
+ const cs_int_t nvoi[cs_ctwr_nmaxvoi],
+ const cs_int_t nbvoi,
+ cs_real_t mat[4][4],
+ cs_real_t vectBase[3][3],
+ const cs_int_t decF,
+ const cs_real_t dh)
+{
+ cs_real_t det,norme1, norme2, min;
+ cs_real_t tmpRes[3];
+ cs_int_t i,ii,iii,ind,i0,i1,i2;
+ cs_int_t numi, numii, numiii;
+
+ det = 0.0;
+ i0 = 0;
+ i1 = 0;
+ i2 = 0;
+ min = 1000.0;
+
+ for(i = 0; i < 4 ; i++){
+ ind = 0;
+ for(ii = 0; ii < 4 ; ii++){
+ if(ii != i){
+ vectBase[0][ind] = mat[ii][1];
+ vectBase[1][ind] = mat[ii][2];
+ vectBase[2][ind] = mat[ii][3];
+ ind++;
+ }
+ }
+ CS_PRODUIT_VECTORIEL(tmpRes, vectBase[0],vectBase[1]);
+ det += pow(-1,i) * mat[i][0] * CS_LOC_PRODUIT_SCALAIRE(vectBase[2], tmpRes);
+ }
+
+ if (CS_ABS(det) <= (0.000001*dh) ) {
+ /*2D*/
+ for(i=0; i< nbvoi ; i++){
+ for(ii=i+1; ii< nbvoi ; ii++){
+ for(iii=ii+1; iii< nbvoi ; iii++){
+ numi = nvoi[i] + decF;
+ numii = nvoi[ii] + decF;
+ numiii = nvoi[iii] + decF;
+ vectBase[0][0] = coord[3*numii ] - coord[3*numi ];
+ vectBase[0][1] = coord[3*numii +1] - coord[3*numi+1];
+ vectBase[0][2] = coord[3*numii +2] - coord[3*numi+2];
+ vectBase[1][0] = coord[3*numiii ] - coord[3*numi ];
+ vectBase[1][1] = coord[3*numiii+1] - coord[3*numi+1];
+ vectBase[1][2] = coord[3*numiii+2] - coord[3*numi+2];
+ CS_PRODUIT_VECTORIEL(tmpRes, vectBase[0],vectBase[1]);
+ if( (CS_LOC_MODULE(tmpRes) > (0.000001*dh))
+ && (CS_ABS(CS_LOC_PRODUIT_SCALAIRE(vectBase[0],vectBase[1]))< min)
+ ){
+ i0 = i;
+ i1 = ii;
+ i2 = iii;
+ }
+ }
+ }
+ }
+ }
+ else{
+ /*3D*/
+ vectBase[0][0] = 1.0; vectBase[1][0] = 0.0; vectBase[2][0] = 0.0;
+ vectBase[0][1] = 0.0; vectBase[1][1] = 1.0; vectBase[2][1] = 0.0;
+ vectBase[0][2] = 0.0; vectBase[1][2] = 0.0; vectBase[2][2] = 1.0;
+ return 3;
+ }
+
+ if (i0 == 0 && i1 == 0 && i2 == 0){
+ /*1D*/
+ vectBase[0][0] = coord[3*(nvoi[1]+ decF) ] - coord[3*(nvoi[0]+ decF) ];
+ vectBase[0][1] = coord[3*(nvoi[1]+ decF)+1] - coord[3*(nvoi[0]+ decF)+1];
+ vectBase[0][2] = coord[3*(nvoi[1]+ decF)+2] - coord[3*(nvoi[0]+ decF)+2];
+ return 1;
+ }
+ else{
+ vectBase[0][0] = coord[3*(nvoi[i1]+ decF) ] - coord[3*(nvoi[i0]+ decF) ];
+ vectBase[0][1] = coord[3*(nvoi[i1]+ decF)+1] - coord[3*(nvoi[i0]+ decF)+1];
+ vectBase[0][2] = coord[3*(nvoi[i1]+ decF)+2] - coord[3*(nvoi[i0]+ decF)+2];
+ vectBase[1][0] = coord[3*(nvoi[i2]+ decF) ] - coord[3*(nvoi[i0]+ decF) ];
+ vectBase[1][1] = coord[3*(nvoi[i2]+ decF)+1] - coord[3*(nvoi[i0]+ decF)+1];
+ vectBase[1][2] = coord[3*(nvoi[i2]+ decF)+2] - coord[3*(nvoi[i0]+ decF)+2];
+ CS_PRODUIT_VECTORIEL(tmpRes, vectBase[0],vectBase[1]);
+ CS_PRODUIT_VECTORIEL(vectBase[1] ,tmpRes,vectBase[0]);
+ norme1= CS_LOC_MODULE(vectBase[0]);
+ norme2= CS_LOC_MODULE(vectBase[1]);
+ vectBase[0][0] /= norme1 ; vectBase[1][0] /= norme2;
+ vectBase[0][1] /= norme1 ; vectBase[1][1] /= norme2;
+ vectBase[0][2] /= norme1 ; vectBase[1][2] /= norme2;
+ vectBase[2][0] = 0.0; vectBase[2][1] = 0.0; vectBase[2][2] = 0.0;
+ return 2;
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Inversion matrice (methode de Jordan)
+ *----------------------------------------------------------------------------*/
+
+static int
+_invmat(cs_real_t mat[4][4],
+ cs_real_t matInv[4][4],
+ cs_int_t idim)
+{
+ cs_real_t aux;
+ cs_int_t i,j,k,err;
+
+ err=1;
+
+ for(i = 0; i < idim + 1; i++)
+ for(j = 0; j < idim + 1; j++)
+ matInv[i][j] = mat[i][j];
+
+
+ i = 0;
+ while (err == 1 && (i < (idim+1))){
+
+ if (CS_ABS(matInv[i][i]) > 1.e-15){
+
+ aux = 1.0/matInv[i][i];
+
+ for(j = 0; j < idim + 1; j++)
+ matInv[i][j] *= aux;
+
+ matInv[i][i]= aux;
+
+ for(k = 0; k < i; k++){
+ aux = matInv[k][i];
+ for(j = 0; j < idim + 1; j++){
+ matInv[k][j] -= aux * matInv[i][j];
+ }
+ matInv[k][i] = -aux *matInv[i][i];
+ }
+
+ for(k = i + 1; k < idim + 1; k++){
+ aux = matInv[k][i];
+ for(j = 0; j < idim + 1; j++){
+ matInv[k][j] -= aux * matInv[i][j];
+ }
+ matInv[k][i] = -aux *matInv[i][i];
+ }
+ i++;
+ }
+ else{
+ err =0;
+ }
+ }
+
+ return err;
+}
+
+/*----------------------------------------------------------------------------
+ * Calculation of the ponderation function
+ *----------------------------------------------------------------------------*/
+
+static cs_real_t
+_weighting(const cs_real_t dx,
+ const cs_real_t dy,
+ const cs_real_t dz,
+ const cs_real_t ouv,
+ const cs_int_t lf,
+ const cs_real_t epgauss,
+ const cs_real_t cx,
+ const cs_real_t cy,
+ const cs_real_t cz)
+{
+ cs_real_t pi, lambda;
+ cs_real_t poids = 0.0;
+ cs_real_t xy = sqrt(pow(dx/cx,2.) + pow(dy/cy,2.) + pow(dz/cz,2.));
+
+ if (xy < ouv)
+ {
+ switch(lf) {
+ case 1:
+ poids=1.-xy/ouv;
+ break;
+ case 2:
+ pi = acos(-1.);
+ poids = 0.5*(1.+cos(pi*xy/ouv));
+ break;
+ case 3:
+ lambda = ouv/sqrt(epgauss*log(10.));
+ poids = exp(-pow((xy/lambda),2.));
+ break;
+ default:
+ assert(lf == 1 || lf == 2 || lf == 3);
+ }
+ }
+
+ return poids ;
+}
+
+/*----------------------------------------------------------------------------
+ * Scalar product between the face normal vector and the gravity vector
+ *----------------------------------------------------------------------------*/
+
+static cs_real_t
+_dot_product_ng(const cs_int_t ifac,
+ const cs_int_t dim,
+ const cs_real_t *surf_f,
+ const cs_real_t gravite[3],
+ const cs_real_t direction)
+{
+ cs_real_t n_sortant[3], g_uni[3];
+ cs_int_t idim;
+ cs_real_t aux1,aux2;
+
+ n_sortant[2] = 0.0 ;
+ g_uni[2] = 0.0;
+
+ aux1 = CS_LOC_MODULE(gravite);
+
+ for (idim = 0 ; idim < 3 ; idim++) {
+ n_sortant[idim] = direction * surf_f[ifac*3+idim];
+ g_uni[idim]= gravite[idim];
+ }
+
+ aux2 = CS_LOC_MODULE(n_sortant);
+ for (idim = 0 ; idim < dim ; idim++) {
+ n_sortant[idim] /= aux2;
+ g_uni[idim] /= aux1 ;
+
+ }
+
+ return CS_LOC_PRODUIT_SCALAIRE(n_sortant , g_uni );
+
+}
+
+
+/*---------------------------------------------------------------------------
+ *
+ *---------------------------------------------------------------------------*/
+
+static void
+_search_height(cs_ctwr_zone_t *ct,
+ const cs_real_t *gravite,
+ cs_real_t *hmin,
+ cs_real_t *hmax)
+{
+ cs_int_t i, ifac, nb,nb_dist, axe, idx, ii, jj;
+ cs_real_t *lst_xyz_sup ; /* coord des sommets de la face Sup */
+ cs_real_t *lst_xyz_inf ; /* coord des sommets de la face Inf*/
+ cs_real_t *lst_xyz_fi ; /* coord des sommets proj de la face Inf*/
+ cs_real_t *lst_xyz_fs ; /* coord des sommets proj de la face Inf*/
+ cs_real_t *hmin_dist;
+ const fvm_coord_t *lst_xyz_dist = NULL;
+
+ cs_real_t aux;
+ const fvm_lnum_t *location_fac = NULL;
+
+ cs_int_t *faces_vtx_idx = NULL;
+ cs_int_t *faces_vtx_lst = NULL;
+
+ const double tolerance = 0.1 ;
+ fvm_nodal_t *fs_tmp_mesh = NULL;
+ fvm_nodal_t *fi_tmp_mesh = NULL;
+
+
+
+ double coeff[3], v_aux[3], vertex_coords[2];
+ double v_x, v_y ;
+ double v_f_x = 0., v_f_y = 0., v_f_z = 0.;
+ double a[3][3] = {{0., 0., 0.} ,
+ {0., 0., 0.} ,
+ {0., 0., 0.} };
+
+ double b_x[3] = {0., 0., 0. };
+ double b_y[3] = {0., 0., 0. };
+ double b_z[3] = {0., 0., 0. };
+
+ double matrice[6] = {0., 0., 0. ,0., 0., 0. };
+
+
+
+ nb = (cs_int_t) fvm_nodal_get_n_entities(ct->face_sup_mesh, 0);
+ BFT_MALLOC(lst_xyz_sup, nb*3, fvm_coord_t);
+ fvm_nodal_get_vertex_coords(ct->face_sup_mesh,
+ FVM_INTERLACE,
+ lst_xyz_sup);
+
+ nb = (cs_int_t) fvm_nodal_get_n_entities(ct->face_inf_mesh, 0);
+ BFT_MALLOC(lst_xyz_inf, nb*3, fvm_coord_t);
+ fvm_nodal_get_vertex_coords(ct->face_inf_mesh,
+ FVM_INTERLACE,
+ lst_xyz_inf);
+
+ fs_tmp_mesh = fvm_nodal_copy(ct->face_sup_mesh);
+ fi_tmp_mesh = fvm_nodal_copy(ct->face_inf_mesh);
+
+ aux = 0.;
+
+ for (i = 0 ; i < 3 ; i++)
+ if(CS_ABS(gravite[i]) > aux) {
+ axe = i;
+ aux = CS_ABS (gravite [ i ]);
+ }
+
+ if (axe == 0) {
+ matrice[1] = 1;
+ matrice[5] = 1;
+ }
+ else {
+ matrice[0] = 1;
+ if (axe == 1)
+ matrice[5] = 1;
+ else
+ matrice[4] = 1;
+ }
+
+
+ fvm_nodal_project_coords(fs_tmp_mesh, matrice);
+ fvm_nodal_project_coords(fi_tmp_mesh, matrice);
+
+ nb = (cs_int_t) fvm_nodal_get_n_entities(fs_tmp_mesh, 0);
+
+ BFT_MALLOC(lst_xyz_fs, nb*2, fvm_coord_t);
+
+ fvm_nodal_get_vertex_coords(fs_tmp_mesh, FVM_INTERLACE, lst_xyz_fs);
+
+
+ nb = (cs_int_t) fvm_nodal_get_n_entities(fi_tmp_mesh, 0);
+
+ BFT_MALLOC(lst_xyz_fi , nb*2 , fvm_coord_t );
+
+ fvm_nodal_get_vertex_coords(fi_tmp_mesh, FVM_INTERLACE, lst_xyz_fi);
+
+ /* Create locator on the proj surf */
+
+ fvm_locator_t *locator = NULL;
+
+#if defined(FVM_HAVE_MPI)
+ locator = fvm_locator_create(tolerance,
+ cs_glob_mpi_comm,
+ cs_glob_n_ranks,
+ 0);
+#else
+ locator = fvm_locator_create(tolerance);
+#endif
+
+ nb = (cs_int_t) fvm_nodal_get_n_entities(fs_tmp_mesh, 0);
+
+
+ fvm_locator_set_nodal(locator,
+ fi_tmp_mesh,
+ 0,
+ 2,
+ nb,
+ NULL,
+ lst_xyz_fs);
+
+ nb_dist = fvm_locator_get_n_dist_points(locator );
+
+ /* Construction de la connectivite Face->sommet du projete */
+
+ BFT_MALLOC(hmin_dist , nb_dist, fvm_coord_t );
+
+ cs_reverse_vtx_faces_connect(fi_tmp_mesh ,
+ &(faces_vtx_idx ) ,
+ &(faces_vtx_lst ) );
+
+ location_fac = fvm_locator_get_dist_locations(locator );
+ lst_xyz_dist = fvm_locator_get_dist_coords( locator );
+
+ for (i = 0 ; i < nb_dist ; i++) {
+
+ ifac = location_fac[ i ] - 1;
+
+ vertex_coords [0] = lst_xyz_dist [ i*2 ];
+ vertex_coords [1] = lst_xyz_dist [ i*2 + 1 ];
+
+ for(ii = 0; ii < 3 ; ii++){
+ b_x[ ii ] = 0. ;
+ b_y[ ii ] = 0. ;
+ b_z[ ii ] = 0. ;
+ for(jj = 0; jj < 3 ; jj++)
+ a[ ii ][ jj ] = 0.;
+
+ }
+
+
+ for (idx = faces_vtx_idx[ ifac ];
+ idx < faces_vtx_idx[ ifac +1 ]; idx++) {
+
+ v_x = lst_xyz_fi[faces_vtx_lst[ idx ]* 2 ];
+ v_y = lst_xyz_fi[faces_vtx_lst[ idx ]* 2 + 1 ];
+
+ v_f_x = lst_xyz_inf[faces_vtx_lst[ idx ]* 3 ];
+ v_f_y = lst_xyz_inf[faces_vtx_lst[ idx ]* 3 + 1 ];
+ v_f_z = lst_xyz_inf[faces_vtx_lst[ idx ]* 3 + 2 ];
+
+ a[0][0] += v_x * v_x;
+ a[0][1] += v_x * v_y;
+ a[0][2] += v_x;
+
+ a[1][1] += v_y * v_y;
+ a[1][2] += v_y;
+
+
+ a[2][2] += 1.;
+
+ b_x[0] += v_x * v_f_x;
+ b_x[1] += v_y * v_f_x;
+ b_x[2] += v_f_x;
+
+ b_y[0] += v_x * v_f_y;
+ b_y[1] += v_y * v_f_y;
+ b_y[2] += v_f_y;
+
+ b_z[0] += v_x * v_f_z;
+ b_z[1] += v_y * v_f_z;
+ b_z[2] += v_f_z;
+
+
+ }
+
+ /* Matrix is symmetric */
+
+ a[1][0] = a[0][1];
+ a[2][0] = a[0][2];
+ a[2][1] = a[1][2];
+
+ if (_inverse_3x3(a, b_x, coeff) == 0 ) {
+
+ v_aux[0] = -( coeff[0]*vertex_coords[0]
+ + coeff[1]*vertex_coords[1]
+ + coeff[2]);
+ }
+ else
+ v_aux[0] = -v_f_x;
+
+ if (_inverse_3x3(a, b_y, coeff) == 0) {
+
+ v_aux[1] = -( coeff[0]*vertex_coords[0]
+ + coeff[1]*vertex_coords[1]
+ + coeff[2]);
+ }
+ else
+ v_aux[1] = -v_f_y;
+
+ if (_inverse_3x3(a, b_z, coeff) == 0) {
+
+ v_aux[2] = -( coeff[0]*vertex_coords[0]
+ + coeff[1]*vertex_coords[1]
+ + coeff[2]);
+ }
+ else
+ v_aux[2] = -v_f_z;
+
+ hmin_dist[i] = CS_LOC_PRODUIT_SCALAIRE(v_aux , gravite)
+ / CS_LOC_MODULE(gravite);
+ }
+
+
+ fvm_locator_exchange_point_var(locator,
+ hmin_dist, hmin, NULL, sizeof(cs_real_t),1,0);
+
+ for (i = 0 ; i < nb ; i++) {
+
+ v_aux[0] = -lst_xyz_sup[i*3 ];/* Opposite Vector to g */
+ v_aux[1] = -lst_xyz_sup[i*3 + 1];
+ v_aux[2] = -lst_xyz_sup[i*3 + 2];
+
+ aux = CS_LOC_PRODUIT_SCALAIRE(v_aux , gravite);
+ hmax[i] = aux / CS_LOC_MODULE(gravite); /* project on "g" axis */
+
+ }
+
+ BFT_FREE(lst_xyz_inf);
+ BFT_FREE(lst_xyz_sup);
+ BFT_FREE(lst_xyz_fi);
+ BFT_FREE(lst_xyz_fs);
+ BFT_FREE(hmin_dist);
+
+ locator = fvm_locator_destroy(locator);
+ fs_tmp_mesh = fvm_nodal_destroy(fs_tmp_mesh );
+ fi_tmp_mesh = fvm_nodal_destroy(fi_tmp_mesh );
+}
+
+
+/*----------------------------------------------------------------------------
+ * Function cs_ctwr_maille
+ * Construction du maillage eau
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_maille
+(
+ const cs_mesh_t *mesh, /* <-- structure maillage associ�e */
+ const cs_mesh_quantities_t *mesh_quantities /* <-- grandeurs du maillage */
+)
+{
+
+
+ cs_int_t icel_1, icel_2, ii, length, nb, rank,
+ dist_rank, res_loc, res_dist;
+ cs_int_t ifac, ict, icpt, icpti, icptl, icptla, icptfac,
+ iaux, i, j;
+ cs_real_t aux , gravite[3], v_aux[3] , alpha ;
+ fvm_coord_t *extrusion_vectors, *lst_xyz_cel, *lst_xyz;
+ fvm_lnum_t *lst_par_fac_sup;
+ fvm_gnum_t *fsup_gb_vt_num = NULL;
+ cs_real_t *hmin_vect ;
+ cs_real_t *hmax_vect ;
+
+ char *mesh_name = NULL ;
+ char *export_name = NULL ;
+ const double tolerance = 0.1 ;
+
+
+ fvm_gnum_t n_vertices;
+
+ cs_int_t *face_sup; /* liste des faces internes superieures de la ct */
+ /* de taille (nbfac_sct ) */
+ cs_int_t *fbr_sup; /* liste des faces de bord superieures de la ct */
+ /* de taille (nbfbr_sct) */
+ cs_int_t *face_inf; /* liste des faces internes inferieures de la ct */
+ /* de taille (nbfac_ict) */
+ cs_int_t *fbr_inf; /* liste des faces de bord inferieures de la ct */
+ /* de taille (nbfac_ict) */
+ cs_int_t *face_lat; /* liste des faces internes laterales de la ct */
+ /* de taille (nbfac_lct ) */
+ cs_int_t *fbr_lat; /* liste des faces de bord laterales de la ct */
+ /* de taille (nbfbr_lct) */
+ cs_int_t *face_ct; /* liste des faces interne de la ct */
+ /* de taille (nbfac_ct) */
+
+
+ const cs_int_t *i_face_cells = mesh->i_face_cells;
+ const cs_int_t *b_face_cells = mesh->b_face_cells;
+ const cs_real_t *i_face_normal = mesh_quantities->i_face_normal;
+ const cs_real_t *b_face_normal = mesh_quantities->b_face_normal;
+
+ fvm_interface_set_t *interface_set = NULL;
+ cs_ctwr_zone_t *ct;
+ cs_ctwr_fluid_props_t *ct_prop = cs_glob_ctwr_props;
+
+ iaux = 0;
+ alpha = 0.875;
+
+ /* Vecteur gravite */
+ gravite[0] = ct_prop->gravx;
+ gravite[1] = ct_prop->gravy;
+ gravite[2] = ct_prop->gravz;
+
+
+ /*--------------------------------------------*/
+ /* List of air nodes for each Exchange Area */
+ /*--------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ icpt = 0;
+ ct = cs_glob_ct_tab[ict];
+ length = strlen("cell_mesh_ct_") + 1 + 1;
+ BFT_MALLOC(mesh_name, length, char);
+ sprintf(mesh_name, "cell_mesh_ct_%d", ict);
+
+ ct->cell_mesh = cs_mesh_connect_cells_to_nodal(mesh,
+ mesh_name,
+ ct->nbevct,
+ ct->ze_cell_list);
+
+ BFT_MALLOC(ct->mark_ze,mesh->n_cells ,cs_int_t );
+
+ /*----------------------------------------------------------*
+ * Begin identification of air nodes for each Exchange Area *
+ *----------------------------------------------------------*/
+
+ for (i = 0; i < mesh->n_cells; i++)
+ for (j = 0; j < ct->nbevct; j++) {
+ if ((ct->ze_cell_list[j]) == i+1) {
+ ct->mark_ze[i]=1;
+ break;
+ }
+ else
+ ct->mark_ze[i]=0;
+ }
+ }
+
+ /*---------------------------------------------*
+ * End list of air nodes for each Exchange Area*
+ *---------------------------------------------*/
+
+ /*--------------------------------------------------------*
+ * Calcul du nombre de noeuds eau des faces superieures *
+ * des zones d'echanges et du nombre de faces superieures *
+ * et inferieures *
+ *--------------------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+ ct = cs_glob_ct_tab[ict];
+ /* Contribution faces internes */
+ for (ifac = 0 ; ifac < mesh->n_i_faces ; ifac++) {
+ assert((ifac * 2 + 1) < (2*mesh->n_i_faces));
+ icel_1 = i_face_cells[ifac * 2] - 1;/* indice de la cellule 1 */
+ icel_2 = i_face_cells[ifac * 2 + 1] - 1;/* indice de la cellule 2 */
+ /* Comparaison des couleurs des cellules 1 et 2 */
+ if((ct->mark_ze[icel_1] == 1) ||
+ (ct->mark_ze[icel_2] == 1)) {
+ if (ct->mark_ze[icel_1] != ct->mark_ze[icel_2]) {
+ if (ct->mark_ze[icel_1] == 1) {
+ aux = _dot_product_ng(ifac ,ct->idimct, i_face_normal, gravite, 1);
+ }
+ if (ct->mark_ze[icel_2] == 1) {
+ aux = _dot_product_ng(ifac ,ct->idimct, i_face_normal, gravite, -1);
+ }
+
+ if (aux < (-alpha) ){
+ ct->nnpsct++;
+ ct->nbfac_sct++;
+ }else{
+ if (aux > alpha ){
+ ct->nbfac_ict++;
+ }else{
+ ct->nbfac_lct++;
+ }
+ }
+ }else{
+ ct->nbfac_ct++;
+ }
+ }
+
+ } /* fin contribution faces internes */
+
+ /* Contribution faces externes */
+ for (ifac = 0 ; ifac < mesh->n_b_faces ; ifac++) {
+ icel_1 = b_face_cells[ifac] - 1; /* indice de la cellule */
+ if (ct->mark_ze[icel_1] == 1) {
+
+ aux = _dot_product_ng(ifac,ct->idimct, b_face_normal, gravite, 1);
+
+ if (aux < (-alpha) ){
+ ct->nnpsct++;
+ ct->nbfbr_sct++;
+ }else{
+ if (aux > alpha ){
+ ct->nbfbr_ict++;
+ }else{
+ ct->nbfbr_lct++;
+ }
+ }
+ }
+ }/* fin contribution faces externes */
+
+
+ /* allocation memoire pour la liste des faces superieures et inferieures
+ * des ct */
+ BFT_MALLOC(face_sup,ct->nbfac_sct ,cs_int_t );
+ BFT_MALLOC(face_inf,ct->nbfac_ict ,cs_int_t );
+ BFT_MALLOC(face_lat,ct->nbfac_lct ,cs_int_t );
+ BFT_MALLOC(fbr_sup ,ct->nbfbr_sct ,cs_int_t );
+ BFT_MALLOC(fbr_inf ,ct->nbfbr_ict ,cs_int_t );
+ BFT_MALLOC(fbr_lat ,ct->nbfbr_lct ,cs_int_t );
+ BFT_MALLOC(face_ct ,ct->nbfac_ct ,cs_int_t );
+
+
+ /* --------------------------------------------------------*
+ * Fin Calcul du nombre de noeuds eau des faces superieures*
+ * des zones d'echanges et du nombre de faces superieures *
+ * et inferieures *
+ *---------------------------------------------------------*/
+
+
+ /*-----------------------------------------------------------------*
+ * Liste des faces superieures et inferieures des zones d echanges *
+ * et liste des noeuds eau des faces sup de la ct sans ct amont *
+ *-----------------------------------------------------------------*/
+
+ /* Contribution faces internes */
+ icpt = 0 ; /*indice tableau des faces sup */
+ icpti = 0 ; /*indice tableau des faces inf */
+ icptla = 0 ; /*indice tableau des faces laterales */
+ icptl = 0 ; /*indice tableau des noeuds sup ct */
+ icptfac = 0 ; /*indice tableau des noeuds sup ct */
+ /* Boucle sur les faces internes du domaine */
+ for (ifac = 0 ; ifac < mesh->n_i_faces ; ifac++) {
+ icel_1 = i_face_cells[ifac * 2] - 1; /* indice de la cellule 1 */
+ icel_2 = i_face_cells[ifac * 2 + 1] - 1; /* indice de la cellule 2 */
+ /* Comparaison couleur de la ct et couleur des cellules 1 et 2 */
+ if((ct->mark_ze[icel_1] == 1) ||
+ (ct->mark_ze[icel_2] ==1)) {
+ if (ct->mark_ze[icel_1] != ct->mark_ze[icel_2]) {
+ if (ct->mark_ze[icel_1] ==1) {
+ aux = _dot_product_ng(ifac ,ct->idimct, i_face_normal, gravite, 1);
+ }
+ if (ct->mark_ze[icel_2] == 1) {
+ aux = _dot_product_ng(ifac ,ct->idimct, i_face_normal, gravite, -1);
+ }
+
+ if (aux < (-alpha) ){
+ /*ajout d'une face sup de la ct*/
+ face_sup[icpt] = ifac + 1;
+ icpt ++;
+ }else{
+ if (aux > alpha ){
+ /*ajout d'un face inf de la ct*/
+ face_inf[icpti] = ifac + 1;
+ icpti ++;
+
+ }else{
+ assert(icptla < ct->nbfac_lct+ct->nbfbr_lct);
+ face_lat[icptla] = ifac + 1;
+ icptla ++;
+ }
+ }
+ }else{
+ face_ct[icptfac] = ifac + 1;
+ icptfac ++;
+ }
+ }
+ }/* fin contribution faces internes */
+
+ /* Contribution faces de bords */
+ /* initialisation des indices */
+ icpt = 0 ; /*indice tableau des faces sup */
+ icpti = 0 ; /*indice tableau des faces inf */
+ icptla = 0 ; /*indice tableau des faces laterales */
+
+
+
+ for (ifac = 0 ; ifac < mesh->n_b_faces ; ifac++) {
+
+ icel_1 = b_face_cells[ifac] - 1;/* indice de la cellule */
+ if ( ct->mark_ze[icel_1]== 1 ) {
+
+ aux = _dot_product_ng(ifac, ct->idimct, b_face_normal, gravite, 1);
+
+ if (aux < (-alpha) ){
+ /* ajout d'une face sup de la ct */
+ fbr_sup[icpt]= ifac + 1;
+ icpt ++;
+ }else{
+ if (aux > alpha ){
+ /*ajout d'un face inf de la ct*/
+ fbr_inf[icpti]= ifac + 1;
+ icpti ++;
+ }else{
+ fbr_lat[icptla]= ifac + 1;
+ icptla ++;
+ }
+ }
+ }
+ } /* fin contribution faces externes */
+
+
+ /*---------------------------------------------------------*
+ * Creation des maillages surfacique en connectivit� nodale*
+ *---------------------------------------------------------*/
+
+ /* mesh for superiors faces */
+
+ BFT_FREE(mesh_name);
+ length = strlen("face_sup_mesh_ct_") + 1 + 1;
+ BFT_MALLOC(mesh_name, length, char);
+ sprintf(mesh_name, "face_sup_mesh_ct_%d", ict);
+
+
+ ct->face_sup_mesh = cs_mesh_connect_faces_to_nodal(mesh,
+ mesh_name,
+ ct->nbfac_sct,
+ ct->nbfbr_sct,
+ face_sup,
+ fbr_sup);
+
+ /* mesh for inferiors faces*/
+ BFT_FREE(mesh_name);
+ length = strlen("face_inf_mesh_ct_") + 1 + 1;
+ BFT_MALLOC(mesh_name, length, char);
+ sprintf(mesh_name, "face_inf_mesh_ct_%d", ict);
+
+
+ ct->face_inf_mesh = cs_mesh_connect_faces_to_nodal(mesh,
+ mesh_name,
+ ct->nbfac_ict,
+ ct->nbfbr_ict,
+ face_inf,
+ fbr_inf);
+ /* mesh for laterals faces*/
+ BFT_FREE(mesh_name);
+ length = strlen("face_lat_mesh_ct_") + 1 + 1;
+ BFT_MALLOC(mesh_name, length, char);
+ sprintf(mesh_name, "face_lat_mesh_ct_%d", ict);
+
+
+ ct->face_lat_mesh = cs_mesh_connect_faces_to_nodal(mesh,
+ mesh_name,
+ ct->nbfac_lct,
+ ct->nbfbr_lct,
+ face_lat,
+ fbr_lat);
+ /* mesh for laterals faces*/
+ BFT_FREE(mesh_name);
+ length = strlen("face_mesh_ct_") + 1 + 1;
+ BFT_MALLOC(mesh_name, length, char);
+ sprintf(mesh_name, "face_mesh_ct_%d", ict);
+
+
+ ct->fac_mesh = cs_mesh_connect_faces_to_nodal(mesh,
+ mesh_name,
+ ct->nbfac_ct,
+ 0,
+ face_ct,
+ NULL);
+ /* water mesh*/
+ BFT_FREE(mesh_name);
+ length = strlen("water_mesh_") + 1 + 1;
+ BFT_MALLOC(mesh_name, length, char);
+ sprintf(mesh_name, "water_mesh_%d", ict);
+
+
+ ct->water_mesh = cs_mesh_connect_faces_to_nodal(mesh,
+ mesh_name,
+ ct->nbfac_sct,
+ ct->nbfbr_sct,
+ face_sup,
+ fbr_sup);
+
+
+ /*--------------------------------------------------------------*
+ * Fin creation des maillages surfacique en connectivit� nodale*
+ *--------------------------------------------------------------*/
+
+ /*--------------------------------------------------------------*
+ * Construct cs_array_rank *
+ *--------------------------------------------------------------*/
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+
+ nb = cs_glob_n_ranks;
+ rank = cs_glob_rank_id;
+ BFT_MALLOC(ct->cs_array_rank, nb, cs_int_t );
+
+
+ ct->cs_array_rank[ rank ] = res_loc = ct->nbevct;
+
+
+ for(dist_rank = 0; dist_rank < nb; dist_rank++ )
+ if(dist_rank != rank ){
+ MPI_Sendrecv(&res_loc, 1, CS_MPI_INT, dist_rank, CS_CT_MPI_TAG,
+ &res_dist, 1, CS_MPI_INT, dist_rank, CS_CT_MPI_TAG,
+ cs_glob_mpi_comm, &status);
+
+ ct->cs_array_rank[ dist_rank ] = res_dist;
+
+ }
+ }
+#endif
+
+ /*--------------------------------------------------------------*
+ * End of Construction cs_array_rank *
+ *--------------------------------------------------------------*/
+
+ /*--------------------------------------------------------------*
+ * Reseach of hmin and hmax *
+ *--------------------------------------------------------------*/
+
+ /* loop on the superior faces for hmax */
+ nb = (cs_int_t) fvm_nodal_get_n_entities(ct->face_sup_mesh, 0);
+
+
+ BFT_MALLOC(hmax_vect , nb , fvm_coord_t );
+ BFT_MALLOC(hmin_vect , nb , fvm_coord_t );
+
+ _search_height(ct ,
+ gravite ,
+ hmin_vect ,
+ hmax_vect );
+
+
+ for (i = 0 ; i < nb ; i++) {
+
+ aux = hmax_vect[ i ];
+ if (aux >= ct->hmax )
+ ct->hmax = aux;
+
+ aux = hmin_vect[ i ];
+ if (aux <= ct->hmin )
+ ct->hmin = aux;
+ }
+
+ /* loop on the sup faces for surface_in and surface_out */
+ BFT_MALLOC(lst_par_fac_sup , ct->nnpsct , fvm_lnum_t );
+
+ fvm_nodal_get_parent_num(ct->face_sup_mesh, 2, lst_par_fac_sup);
+
+ BFT_MALLOC(ct->surf_fac_sup , ct->nnpsct , cs_real_t );
+
+ for (ifac = 0 ; ifac < ct->nnpsct ; ifac++) {
+ if(ifac< ct->nbfbr_sct ){
+ for (ii = 0 ; ii < 3 ; ii++){
+ v_aux[ii] = b_face_normal[3 * (cs_int_t) (lst_par_fac_sup[ ifac ] -1)
+ + ii ];
+ }
+ }
+ else{
+ for (ii = 0 ; ii < 3 ; ii++){
+ v_aux[ii] = i_face_normal[ 3 * (cs_int_t)
+ (lst_par_fac_sup[ifac] - mesh->n_b_faces - 1)
+ + ii ];
+ }
+ }
+ aux = CS_LOC_MODULE(v_aux);
+ ct->surface_in += aux;
+ ct->surface_out += aux;
+ ct->surf_fac_sup[ifac] = aux;
+
+ }
+
+
+
+#if defined(HAVE_MPI)
+ if (cs_glob_n_ranks > 1) {
+
+ nb = cs_glob_n_ranks;
+ rank = cs_glob_rank_id;
+
+ // TODO : changer ce bordel !!!!!!!!!!!!!!!!!
+ // sans doute equivalent a MPI_Allreduce(ct-hmax, ..., MPI_MAX)
+
+ if(ct->cs_array_rank[ rank ] != 0){
+ for(dist_rank = 0; dist_rank < nb; dist_rank++){
+ if(dist_rank != rank ){
+ if(ct->cs_array_rank [ dist_rank ] != 0 ){
+
+ MPI_Sendrecv(&ct->hmax, 1, CS_MPI_REAL, dist_rank, CS_CT_MPI_TAG,
+ &aux, 1, CS_MPI_REAL, dist_rank, CS_CT_MPI_TAG,
+ cs_glob_mpi_comm, &status);
+
+ if ( aux > ct->hmax ) ct->hmax = aux;
+
+ MPI_Sendrecv(&ct->hmin, 1, CS_MPI_REAL, dist_rank, CS_CT_MPI_TAG,
+ &aux , 1, CS_MPI_REAL, dist_rank, CS_CT_MPI_TAG,
+ cs_glob_mpi_comm, &status);
+
+ if ( aux < ct->hmin ) ct->hmin = aux;
+
+ }
+ }
+ }
+ }
+
+ MPI_Allreduce (&ct->surface_in, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->surface_in = aux;
+
+ MPI_Allreduce (&ct->surface_out, &aux, 1, CS_MPI_REAL, MPI_SUM,
+ cs_glob_mpi_comm);
+ ct->surface_out = aux;
+ }
+#endif
+
+ /* -------------------------------------------------------------*
+ * End of Reseach hmin et hmax *
+ *---------------------------------------------------------------*/
+
+
+ nb = fvm_nodal_get_n_entities(ct->water_mesh, 0);
+
+
+
+ BFT_MALLOC(extrusion_vectors, (nb*3), fvm_coord_t);
+
+
+ for (i=0 ; i < nb ; i++){
+
+ aux =CS_ABS(hmax_vect[ i ] - hmin_vect[ i ])/CS_LOC_MODULE(gravite);
+
+ extrusion_vectors[ i*3 ] = gravite[0] * aux;
+ extrusion_vectors[ i*3 + 1] = gravite[1] * aux;
+ extrusion_vectors[ i*3 + 2] = gravite[2] * aux;
+ }
+
+
+
+ fvm_nodal_extrude(ct->water_mesh,
+ ct->nelect,
+ extrusion_vectors,
+ NULL);
+
+ BFT_FREE(extrusion_vectors);
+
+
+ /* Set halo structure for the water mesh */
+
+ n_vertices = fvm_nodal_get_n_entities(ct->face_sup_mesh, 0);
+
+ BFT_MALLOC(fsup_gb_vt_num, n_vertices, fvm_gnum_t);
+
+ fvm_nodal_get_global_vertex_num(ct->face_sup_mesh, fsup_gb_vt_num);
+
+ interface_set = fvm_interface_set_create(n_vertices, NULL, fsup_gb_vt_num,
+ NULL, 0, NULL, NULL, NULL);
+
+#if 0 && defined(DEBUG) && !defined(NDEBUG)
+ fvm_interface_set_dump(interface_set);
+#endif
+
+ /* Creation of the cs_mesh_halo_t structure. */
+
+ bft_printf(_(" Cr�ation des halos\n"));
+ bft_printf_flush();
+
+ ct->water_halo = cs_halo_create(interface_set);
+
+ bft_printf(_(" D�finition des halos\n"));
+ bft_printf_flush();
+
+ cs_ctwr_halo_define(ct, interface_set);
+
+ fvm_interface_set_destroy(interface_set);
+
+ /* Create locator for interpolate */
+
+#if defined(FVM_HAVE_MPI)
+ ct->locat_water_air = fvm_locator_create(tolerance,
+ cs_glob_mpi_comm,
+ cs_glob_n_ranks,
+ 0);
+#else
+ ct->locat_water_air = fvm_locator_create(tolerance);
+#endif
+
+ BFT_MALLOC(lst_xyz_cel , ct->nbevct*3, fvm_coord_t);
+
+ fvm_nodal_get_element_centers(ct->cell_mesh, FVM_INTERLACE, 3, lst_xyz_cel);
+
+ fvm_locator_set_nodal(ct->locat_water_air,
+ ct->water_mesh,
+ 0,
+ 3,
+ ct->nbevct,
+ NULL,
+ lst_xyz_cel);
+
+
+#if defined(FVM_HAVE_MPI)
+ ct->locat_air_water = fvm_locator_create(tolerance,
+ cs_glob_mpi_comm,
+ cs_glob_n_ranks,
+ 0);
+#else
+ ct->locat_air_water = fvm_locator_create(tolerance);
+#endif
+
+ BFT_MALLOC(lst_xyz, ct->nnpsct*ct->nelect*3, fvm_coord_t );
+
+ fvm_nodal_get_element_centers(ct->water_mesh, FVM_INTERLACE, 3, lst_xyz);
+
+
+ fvm_locator_set_nodal(ct->locat_air_water,
+ ct->cell_mesh,
+ 1,
+ 3,
+ ct->nnpsct*ct->nelect,
+ NULL,
+ lst_xyz);
+
+
+ BFT_FREE(mesh_name );
+ BFT_FREE(export_name );
+ BFT_FREE(face_sup );
+ BFT_FREE(face_inf );
+ BFT_FREE(face_lat );
+ BFT_FREE(fbr_sup );
+ BFT_FREE(lst_par_fac_sup );
+ BFT_FREE(fbr_inf );
+ BFT_FREE(fbr_lat );
+ BFT_FREE(face_ct );
+ BFT_FREE(lst_xyz );
+ BFT_FREE(lst_xyz_cel );
+ BFT_FREE(fsup_gb_vt_num );
+
+ }
+ /*--------------------------------------------*
+ * Fin Liste des faces superieures et inferieures des zones d echanges
+ * et liste des noeuds eau des faces sup de la ct*
+ *--------------------------------------------*/
+
+ /*--------------------------------------------*
+ * Initialization of the water variables *
+ *--------------------------------------------*/
+
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+ ct = cs_glob_ct_tab[ict];
+ /* Te */
+ BFT_MALLOC(ct->teau ,(ct->nnpsct_with_ghosts*ct->nelect), cs_real_t);
+ /* Fe */
+ BFT_MALLOC(ct->fem ,(ct->nnpsct_with_ghosts*ct->nelect), cs_real_t);
+ /* vg */
+ BFT_MALLOC(ct->vgoutte,(ct->nnpsct_with_ghosts*ct->nelect), cs_real_t);
+
+ /* initialisation*/
+ for (iaux = 0 ; iaux < (ct->nnpsct_with_ghosts*ct->nelect) ; iaux++) {
+ /* temperature de l eau*/
+ ct->teau[iaux] = ct->cl_teau;
+ /* debit massique par unite de surface */
+ ct->fem[iaux] = ct->cl_fem/ct->surface;
+ /* vitesse des gouttes */
+ ct->vgoutte[iaux] = 0.0;
+ }
+ /* Initialisation en tenant compte de l'�cart de temp�rature impos�*/
+ aux = ct->deltat / ( (cs_real_t) (ct->nelect - 1) ) ;
+ for (i = 0 ; i < ct->nnpsct_with_ghosts ; i++) {
+ for (j = 1 ; j < ct->nelect ; j++) {
+ ii = i*ct->nelect + j ;
+ ct->teau[ ii ] = ct->teau[ ii - 1 ] - aux;
+ }
+ }
+
+
+ }/* fin de la boucle sur les zones d'echanges */
+
+
+ /*----------------------------------------------*
+ * End of fnitialization of the water variables *
+ *----------------------------------------------*/
+
+
+ /*--------------------------------------------*
+ * Initialisation des tableaux d interpolation*
+ *--------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ ct = cs_glob_ct_tab[ ict ];
+ /* Liste des voisins eau des cellules air */
+ nb = (int) fvm_locator_get_n_dist_points(ct->locat_air_water );
+ BFT_MALLOC(ct->voiseau,(nb * cs_ctwr_nmaxvoi ), cs_int_t );
+ /* Coefficients d interpolation eau pour l air*/
+ BFT_MALLOC(ct->coefeau , (nb * cs_ctwr_nmaxvoi ), cs_real_t );
+ /* Positions dans la liste des voisins eau */
+ BFT_MALLOC(ct->pvoiseau, (nb + 1) , cs_int_t );
+ /* Liste des voisins air des noeuds eau */
+
+ ct->pvoiseau[ 0 ] = 0 ;
+
+ for (iaux = 0 ; iaux < (nb *cs_ctwr_nmaxvoi) ; iaux++){
+ ct->voiseau[iaux] = -1 ;
+ }
+
+ nb = (int) fvm_locator_get_n_dist_points(ct->locat_water_air );
+
+ BFT_MALLOC(ct->voisair ,(nb * cs_ctwr_nmaxvoi ), cs_int_t );
+ /* Positions dans la liste voisins air */
+ BFT_MALLOC(ct->pvoisair ,( nb + 1 ), cs_int_t );
+ /* Coefficients d interpolation air pour l eau */
+ BFT_MALLOC(ct->coefair ,( nb * cs_ctwr_nmaxvoi ), cs_real_t );
+
+ ct->pvoisair[0] = 0;
+
+ for (iaux = 0 ; iaux < (nb* cs_ctwr_nmaxvoi) ; iaux++){
+ ct->voisair[iaux] = -1 ;
+ }
+ }
+ /*------------------------------------------------------*
+ * Fin de l initialisation des tableaux d interpolation *
+ *------------------------------------------------------*/
+}
+
+/*----------------------------------------------------------------------------
+ * Function cs_ctwr_adeau
+ * Interpolation AIR -> EAU
+ *----------------------------------------------------------------------------*/
+
+void cs_ctwr_adeau
+(
+ const cs_mesh_t *mesh,
+ const cs_mesh_quantities_t *mesh_quantities
+)
+{
+ /* Coordonn�es des centres des cellules */
+ const cs_real_t *coo_cel = mesh_quantities->cell_cen;
+ const cs_int_t *i_face_cells = mesh->i_face_cells ;
+#if 0 // Is it no more needed?
+ const cs_int_t *cell_cells_idx = mesh->cell_cells_idx ;
+ const cs_int_t *cell_cells_lst = mesh->cell_cells_lst ;
+ const cs_int_t *cell_family = mesh->cell_family ;
+#endif
+
+ cs_int_t ict, iwat,nb_node_water, ii, jj, iair, nbvois,
+ nbn, nvois[ cs_ctwr_nmaxvoi ], ifac, icel_1, icel_2,icel, lf, indice, dim;
+ cs_real_t dhi, dmin;
+ cs_real_t xwat, ywat, zwat,
+ dx, dy, dz, dxx, dyy, dzz, coeff[ cs_ctwr_nmaxvoi ], ouv, aux;
+ cs_real_t vectBase[3][3];
+ cs_real_t cx, cy, cz, epgauss, w,
+ pp[4][4],ppInv[4][4];
+
+ const fvm_coord_t *lst_xyz_water = NULL;
+ fvm_coord_t *lst_xyz_cel ;
+ fvm_lnum_t *lst_par_fac ;
+ fvm_lnum_t *lst_par_cel ;
+
+ const fvm_lnum_t *location_cel = NULL;
+
+ /*--------------------------------------------*
+ * parametres et initialisation *
+ *--------------------------------------------*/
+ cs_ctwr_zone_t *ct;
+
+ /*--------------------------------------------*
+ * fin parametres et initialisation *
+ *--------------------------------------------*/
+
+ /* Make sure with have extended neighborhood */
+
+#if 0 // Is it no more needed?
+ assert(cell_cells_idx != NULL);
+#endif
+
+ /*---------------------------------------------*
+ * Construction des coefficient d'interpolation*
+ * sur chaque zone d echange ict *
+ *---------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ ct = cs_glob_ct_tab[ict];
+
+ nbn = 3 ;
+ if (ct->idimct==3) {
+ nbn = 4 ;
+ }
+
+ /* Calcul de dh */
+ dhi = (ct->hmax-ct->hmin)/(ct->nelect-1);
+
+ /* Copy element centers of the water mesh to an array.*/
+
+ nb_node_water = (int) fvm_locator_get_n_dist_points(ct->locat_air_water);
+
+ /* */
+ location_cel = fvm_locator_get_dist_locations(ct->locat_air_water);
+
+ /* */
+ lst_xyz_water = fvm_locator_get_dist_coords(ct->locat_air_water);
+
+ BFT_MALLOC(lst_xyz_cel , ct->nbevct*3, fvm_coord_t );
+ fvm_nodal_get_element_centers(ct->cell_mesh, FVM_INTERLACE , 3 , lst_xyz_cel);
+
+ BFT_MALLOC(lst_par_cel , ct->nbevct, fvm_lnum_t );
+ fvm_nodal_get_parent_num(ct->cell_mesh, 3, lst_par_cel);
+
+ BFT_MALLOC(lst_par_fac , ct->nbfac_ct, fvm_lnum_t );
+ fvm_nodal_get_parent_num(ct->fac_mesh, 2, lst_par_fac);
+
+
+ /* boucle sur les noeuds eau */
+ for (iwat = 0 ; iwat < nb_node_water ; iwat++) {
+
+ /*--------------------------------------------*
+ * Calcul des coord. du noeud a partir de *
+ * celles du noeud de la face sup *
+ * Noeud = NoeudSup + iloc * dh *g / ||g|| *
+ *--------------------------------------------*/
+ xwat = (cs_real_t) lst_xyz_water[ iwat*3 ] ;
+ ywat = (cs_real_t) lst_xyz_water[ iwat*3 + 1 ] ;
+ zwat = (cs_real_t) lst_xyz_water[ iwat*3 + 2 ] ;
+
+ /*--------------------------------------------*
+ * boucle sur les cellules appartenant a la ct*
+ * recherche du noeud air le plus proche *
+ *--------------------------------------------*/
+ dmin = 1000. ;
+ iair = location_cel[iwat] -1;
+
+ /*--------------------------------------------*
+ * initialiation matrice d interpolation et *
+ * tableau nvois[] et coeff[] *
+ *--------------------------------------------*/
+
+ for (ii=0;ii<4;ii++){
+ for (jj=0;jj<4;jj++) {
+ pp[jj][ii] = 0.0;
+ ppInv[jj][ii]= 0.0;
+ }
+ }
+
+ for (jj=0;jj< cs_ctwr_nmaxvoi;jj++) {
+ coeff[jj]= -1.0 ;
+ nvois[jj]= -1 ;
+ }
+ /* fin initialisation */
+
+ /*-------------------------------------------------*
+ * Recherche des voisins du noeuds air le + proche *
+ * boucle sur les faces internes du maillage *
+ *-------------------------------------------------*/
+ nbvois = 1 ;
+ nvois[0] = iair ;
+
+ for (ifac = 0 ; ifac < ct->nbfac_ct ; ifac++) {
+ icel_1 = i_face_cells[ (lst_par_fac[ifac]- mesh->n_b_faces - 1) * 2 ]-1 ;
+ icel_2 = i_face_cells[ (lst_par_fac[ifac]- mesh->n_b_faces - 1) * 2 + 1]-1 ;
+ if (icel_1==iair) {
+ nvois[nbvois]=icel_2 ;
+ nbvois += 1 ;
+ }
+ else if (icel_2==iair) {
+ nvois[nbvois]=icel_1 ;
+ nbvois += 1 ;
+ }
+ }
+
+#if 0 // Is it no more needed?
+ for (icel = cell_cells_idx[ iair ];
+ icel < cell_cells_idx[ iair + 1 ]; icel++) {
+
+ indice = cell_cells_lst[ icel ] - 1;
+ if (ct->mark_ze[indice+1]==1){
+ nvois[nbvois]= indice ;
+ nbvois += 1 ;
+ }
+ }
+#endif
+
+ /* fin Recherche */
+
+ /*--------------------------------------------*
+ *nombre de voisins insuffisant *
+ *--------------------------------------------*/
+
+ if (nbvois<nbn){
+ nbvois = 1 ;
+ nvois[0] = iair ;
+ coeff[0] = 1.0 ;
+ goto enregistre ;
+ }
+
+ dim = ct->idimct;
+ vectBase[0][0] = 1.0; vectBase[1][0] = 0.0; vectBase[2][0] = 0.0;
+ vectBase[0][1] = 0.0; vectBase[1][1] = 1.0; vectBase[2][1] = 0.0;
+ vectBase[0][2] = 0.0; vectBase[1][2] = 0.0; vectBase[2][2] = 1.0;
+ passage2D : ;
+
+
+ /*--------------------------------------------*/
+ /* Calcul de l'ouverture de la fonction de pond�ration*/
+ /* egale au max de la distance entre le noeud eau et les voisins air */
+ /*--------------------------------------------*/
+ ouv = 0. ;
+ for (ii = 0 ; ii < nbvois ; ii++) {
+ iair = nvois[ii];
+ dxx = (cs_real_t) (coo_cel[iair*3+0] - xwat );
+ dyy = (cs_real_t) (coo_cel[iair*3+1] - ywat );
+ dzz = (cs_real_t) (coo_cel[iair*3+2] - zwat );
+
+ dx = dxx * vectBase[0][0] + dyy * vectBase[0][1] + dzz * vectBase[0][2];
+ dy = dxx * vectBase[1][0] + dyy * vectBase[1][1] + dzz * vectBase[1][2];
+ dz = dxx * vectBase[2][0] + dyy * vectBase[2][1] + dzz * vectBase[2][2];
+
+ aux = pow(dx,2.)+pow(dy,2.)+pow(dz,2.) ;
+ if (ouv<aux) {
+ ouv = aux;
+ }
+ }
+ ouv = sqrt(ouv)*1.1 ;
+ /* fin calcul de l'ouverture */
+
+ /*--------------------------------------------*/
+ /*Construction de la matrice A */
+ /*--------------------------------------------*/
+ for (ii = 0 ; ii < nbvois ; ii++) {
+
+ indice = nvois[ii];
+ dxx = (cs_real_t) (coo_cel[indice*3+0] - xwat) ;
+ dyy = (cs_real_t) (coo_cel[indice*3+1] - ywat) ;
+ dzz = (cs_real_t) (coo_cel[indice*3+2] - zwat) ;
+
+ dx = dxx * vectBase[0][0] + dyy * vectBase[0][1] + dzz * vectBase[0][2];
+ dy = dxx * vectBase[1][0] + dyy * vectBase[1][1] + dzz * vectBase[1][2];
+ dz = dxx * vectBase[2][0] + dyy * vectBase[2][1] + dzz * vectBase[2][2];
+
+ /* parametre de la fonction de ponderation*/
+ cx = 1.0 ;
+ cy = 1.0 ;
+ cz = 1.e10 ;
+ lf = 3;
+ epgauss = 5.0 ;
+ if (dim==3) {
+ cz = 1.0 ;
+ }
+ if (dim==1) {
+ cy = 1.e10 ;
+ cz = 1.e10 ;
+ }
+ /*fonction de ponderation*/
+ w = _weighting(dx,dy,dz,ouv,lf,epgauss,cx,cy,cz) ;
+ if (dim == 1)/* 1D */{
+ pp[0][0] = w + pp[0][0] ;
+ pp[0][1] = w*dx + pp[0][1] ;
+ pp[1][0] = w*dx + pp[1][0] ;
+ pp[1][1] = w*dx*dx + pp[1][1] ;
+ }else
+ if (dim == 2) /* 2D */{
+ pp[0][0] = w + pp[0][0] ;
+ pp[0][1] = w*dx + pp[0][1] ;
+ pp[0][2] = w*dy + pp[0][2] ;
+ pp[1][0] = w*dx + pp[1][0] ;
+ pp[1][1] = w*dx*dx + pp[1][1] ;
+ pp[1][2] = w*dx*dy + pp[1][2] ;
+ pp[2][0] = w*dy + pp[2][0] ;
+ pp[2][1] = w*dx*dy + pp[2][1] ;
+ pp[2][2] = w*dy*dy + pp[2][2] ;
+ }
+ else if (dim == 3)/* 3D */{
+ pp[0][0] = w + pp[0][0] ;
+ pp[0][1] = w*dx + pp[0][1] ;
+ pp[0][2] = w*dy + pp[0][2] ;
+ pp[0][3] = w*dz + pp[0][3] ;
+ pp[1][0] = w*dx + pp[1][0] ;
+ pp[1][1] = w*dx*dx + pp[1][1] ;
+ pp[1][2] = w*dy*dx + pp[1][2] ;
+ pp[1][3] = w*dz*dx + pp[1][3] ;
+ pp[2][0] = w*dy + pp[2][0] ;
+ pp[2][1] = w*dx*dy + pp[2][1] ;
+ pp[2][2] = w*dy*dy + pp[2][2] ;
+ pp[2][3] = w*dz*dy + pp[2][3] ;
+ pp[3][0] = w*dz + pp[3][0] ;
+ pp[3][1] = w*dx*dz + pp[3][1] ;
+ pp[3][2] = w*dy*dz + pp[3][2] ;
+ pp[3][3] = w*dz*dz + pp[3][3] ;
+ }
+ }
+ /*Fin Construction de la matrice A */
+ if(ct->idimct == 3 && dim == 3){
+ dim = _is_coplanar(coo_cel, nvois, nbvois, pp, vectBase, 0, dhi);
+
+ if(dim!= 3){
+ for (ii=0;ii<3;ii++)
+ for (jj=0;jj<3;jj++)
+ pp[jj][ii]=0.0;
+ goto passage2D ;
+ }
+
+ }
+
+ /*--------------------------------------------*/
+ /* inversion de la matrice par la methode de */
+ /* jordan */
+ /*--------------------------------------------*/
+
+ if (_invmat(pp, ppInv, dim) == 0) cs_exit(EXIT_FAILURE);
+
+ /*--------------------------------------------*/
+ /* Calcul des coefficients */
+ /*--------------------------------------------*/
+ for (ii = 0 ; ii < nbvois ; ii++){
+
+ indice = nvois[ii];
+ dxx = (cs_real_t) (coo_cel[indice*3+0] - xwat );
+ dyy = (cs_real_t) (coo_cel[indice*3+1] - ywat );
+ dzz = (cs_real_t) (coo_cel[indice*3+2] - zwat );
+
+ dx = dxx * vectBase[0][0] + dyy * vectBase[0][1] + dzz * vectBase[0][2];
+ dy = dxx * vectBase[1][0] + dyy * vectBase[1][1] + dzz * vectBase[1][2];
+ dz = dxx * vectBase[2][0] + dyy * vectBase[2][1] + dzz * vectBase[2][2];
+
+ /* parametre de la fonction de ponderation*/
+ cx = 1.0 ;
+ cy = 1.0 ;
+ cz = 1.e10 ;
+ lf = 3;
+ epgauss = 5.0 ;
+ if (dim==3) {
+ cz = 1.0 ;
+ }
+ if (dim==1) {
+ cy = 1.e10 ;
+ cz = 1.e10 ;
+ }
+
+ w = _weighting(dx,dy,dz,ouv,lf,epgauss,cx,cy,cz) ;
+
+ if (dim == 1){
+ coeff[ii] = w*(ppInv[0][0]+ppInv[0][1]*dx);
+ }
+ else if (dim ==2){
+ coeff[ii] = w*(ppInv[0][0]+ppInv[0][1]*dx+ppInv[0][2]*dy);
+ }
+ else if (dim ==3){
+ coeff[ii] = w*( ppInv[0][0]
+ +ppInv[0][1]*dx
+ +ppInv[0][2]*dy
+ +ppInv[0][3]*dz );
+ }
+
+ }
+ /* Fin Calcul des coefficients */
+
+ enregistre : ;
+
+ /*--------------------------------------------*/
+ /* boucle while sur pvoiseau pour trouver le */
+ /* dernier indice */
+ /*--------------------------------------------*/
+ indice = 0 ;
+ while (ct->voiseau[indice]!=-1) {
+ indice += 1 ;
+ }
+ /*--------------------------------------------*
+ * Ajout des voisins et des coefficients *
+ *--------------------------------------------*/
+ for (ii = 0 ; ii < nbvois ; ii++) {
+ ct->voiseau[indice+ii] = nvois[ii] ;
+ ct->coefeau[indice+ii] = coeff[ii];
+ }
+
+ ct->pvoiseau[iwat+1] = ct->pvoiseau[iwat] + nbvois ;
+
+ }/* fin boucle sur iseg */
+ BFT_FREE(lst_par_fac);
+ BFT_FREE(lst_xyz_cel);
+ BFT_FREE(lst_par_cel);
+
+ } /* fin boucle sur les zones d echanges ict */
+
+}
+
+/*-----------------------------------------------------------------------------*
+ * Function cs_ctwr_adair *
+ * Interpolation EAU -> AIR *
+ *-----------------------------------------------------------------------------*/
+void cs_ctwr_adair (void)
+{
+ /* Coordonn�es des centres des cellules */
+
+ const fvm_coord_t *lst_xyz_cel = NULL;
+ fvm_coord_t *lst_xyz_water = NULL;
+ const fvm_lnum_t *location_cel = NULL;
+ cs_int_t ict,icol, ilig,ieau,ii,jj,iair,nbvois,
+ nbn,nvois[ cs_ctwr_nmaxvoi ],lf,indice;
+ cs_int_t dim, nb_air_node;
+ cs_real_t dhi,dmin,dist,coeff[ cs_ctwr_nmaxvoi ],ouv,aux;
+ cs_real_t dx,dy,dz,dxx,dyy,dzz;
+ cs_real_t cx,cy,cz,epgauss,w;
+ cs_real_t pp[4][4], ppInv[4][4] ;
+ cs_real_t vectBase[3][3];
+ fvm_lnum_t loca_cel;
+ cs_ctwr_zone_t *ct;
+
+ /*---------------------------------------------*
+ * Construction des coefficient d'interpolation*
+ * sur chaque zone d echange ict *
+ *---------------------------------------------*/
+ for (ict=0 ; ict < cs_glob_ct_nbr ; ict++) {
+
+ ct = cs_glob_ct_tab[ict];
+
+ nbn = 3 ;
+ if (ct->idimct==3) {
+ nbn = 4 ;
+ }
+
+
+ /* Calcul de dh */
+ dhi = (ct->hmax-ct->hmin)/(ct->nelect-1);
+
+ /* Copy element centers of the water mesh to an array.*/
+
+
+ nb_air_node = (int)fvm_locator_get_n_dist_points(ct->locat_water_air);
+
+ lst_xyz_cel = fvm_locator_get_dist_coords(ct->locat_water_air);
+
+ location_cel = fvm_locator_get_dist_locations(ct->locat_water_air);
+
+
+ BFT_MALLOC(lst_xyz_water, (3*ct->nelect*ct->nnpsct) ,fvm_coord_t);
+ fvm_nodal_get_element_centers(ct->water_mesh,FVM_INTERLACE,3, lst_xyz_water );
+
+ if (ct->water_halo != NULL) {
+ BFT_REALLOC(lst_xyz_water, (3*ct->nelect*ct->nnpsct_with_ghosts) ,fvm_coord_t);
+ cs_halo_sync_var_strided(ct->water_halo, ct->halo_type, lst_xyz_water, 3);
+
+ }
+ /*--------------------------------------------*
+ * Loops on the air nodes of teh exchange area*
+ *--------------------------------------------*/
+
+ for (iair = 0 ; iair < nb_air_node ; iair++) {
+
+ loca_cel = location_cel[iair] -1;
+ /*--------------------------------------------*
+ * initialiation matrice d interpolation et *
+ * tableau nvois[] et coeff[] *
+ *--------------------------------------------*/
+
+ for (ii=0;ii<4;ii++) {
+ for (jj=0;jj<4;jj++) {
+ pp[jj][ii]=0.0;
+ ppInv[jj][ii]=0.0;
+ }
+ }
+
+ for (jj=0;jj< cs_ctwr_nmaxvoi;jj++) {
+ coeff[jj]=0.0 ;
+ nvois[jj]= -1 ;
+ }/* fin initialisation */
+
+ /*--------------------------------------------*
+ * Traitement particulier pour les noeuds air *
+ * en bordure inferieure ou superieure des ct *
+ *--------------------------------------------*/
+
+ /* indice du noeud air dans le maillage */
+ dmin = 1000. ;
+
+ if ((loca_cel%(ct->nelect) == 0 ) ||
+ (loca_cel% (ct->nelect) == (ct->nelect-1) )) {
+ for (jj = 0 ; jj < (ct->nelect*ct->nnpsct_with_ghosts); jj++) {
+ dx = (cs_real_t) (lst_xyz_water[3*jj ] - lst_xyz_cel[iair*3 ]) ;
+ dy = (cs_real_t) (lst_xyz_water[3*jj+1] - lst_xyz_cel[iair*3+1]) ;
+ dz = (cs_real_t) (lst_xyz_water[3*jj+2] - lst_xyz_cel[iair*3+2]) ;
+ dist = (pow(dx,2.)+pow(dy,2.)+pow(dz,2.)) ;
+ if (dmin>dist ) {
+ dmin = dist ;
+ ieau = jj ;
+ }
+ }
+ }
+
+ if (dmin<1000.) {
+ /* Cellule air est en bordure inf ou sup, on saute l'etape suivante */
+ nbvois = 1 ;
+ nvois[0] = ieau ;
+ coeff[0] = 1.0 ;
+ goto enregistre ;
+ }
+ /*------------------------------------------------*
+ * Fin Traitement particulier pour les noeuds air *
+ * en bordure inferieure ou superieure des ct *
+ *------------------------------------------------*/
+
+ /*--------------------------------------------*
+ * On continue avec les noeuds air qui ne sont*
+ * pas en bordure *
+ * recherche des cellules air voisines pour *
+ * les noeuds air qui ne sont *
+ * pas en bordure inferieure ou superieure *
+ *--------------------------------------------*/
+ nbvois = 1 ;
+ nvois[0] = loca_cel;
+ /*---------------------------------------------*
+ * Recherche du nombre de voisins du noeuds air*
+ * boucle sur les faces internes du maillage *
+ *---------------------------------------------*/
+
+
+ indice=1;
+ nvois[indice++] = loca_cel + 1;
+ nvois[indice++] = loca_cel - 1;
+ nbvois+=2;
+ icol = loca_cel/(ct->nelect);
+ ilig = loca_cel%(ct->nelect);
+ for (ii = ct->fac_sup_connect_idx[ icol ] ;
+ ii < ct->fac_sup_connect_idx[ icol + 1 ] ; ii++) {
+
+ nvois[indice++] = ct->nelect*ct->fac_sup_connect_lst[ ii ] + ilig-1;
+ nvois[indice++] = ct->nelect*ct->fac_sup_connect_lst[ ii ] + ilig ;
+ nvois[indice++] = ct->nelect*ct->fac_sup_connect_lst[ ii ] + ilig+1;
+ nbvois += 3;
+
+ }
+
+ /*---------------------------------------------*
+ * nombre de voisin eau insuffisants *
+ * meme que noeuds en bordure *
+ *-------------------------------------------- */
+
+ if (nbvois<nbn) {
+ nbvois = 1 ;
+ coeff[0] = 1.0 ;
+ goto enregistre ;
+ }
+
+ dim = ct->idimct;
+ vectBase[0][0] = 1.0; vectBase[1][0] = 0.0; vectBase[2][0] = 0.0;
+ vectBase[0][1] = 0.0; vectBase[1][1] = 1.0; vectBase[2][1] = 0.0;
+ vectBase[0][2] = 0.0; vectBase[1][2] = 0.0; vectBase[2][2] = 1.0;
+
+ passage2D : ;
+
+ /*--------------------------------------------*
+ * Calcul de l'ouverture de la fonction de *
+ * pond�ration egale au max de la distance *
+ * entre le noeud air et les voisins eau *
+ *--------------------------------------------*/
+ ouv = 0. ;
+ for (ii = 0 ; ii < nbvois ; ii++) {
+ ieau = nvois[ii] ;
+ dxx = (cs_real_t) (lst_xyz_water[3*ieau] - lst_xyz_cel[iair*3+0]);
+ dyy = (cs_real_t) (lst_xyz_water[3*ieau+1] - lst_xyz_cel[iair*3+1]);
+ dzz = (cs_real_t) (lst_xyz_water[3*ieau+2] - lst_xyz_cel[iair*3+2]);
+
+ dx = dxx * vectBase[0][0] + dyy * vectBase[0][1] + dzz * vectBase[0][2];
+ dy = dxx * vectBase[1][0] + dyy * vectBase[1][1] + dzz * vectBase[1][2];
+ dz = dxx * vectBase[2][0] + dyy * vectBase[2][1] + dzz * vectBase[2][2];
+
+ aux = pow(dx,2.)+pow(dy,2.)+pow(dz,2.) ;
+ if (ouv<aux) {
+ ouv = aux;
+ }
+ }
+ ouv = sqrt(ouv)*1.1 ;
+ /* Fin de calcul de l'ouverture */
+
+ /*--------------------------------------------*
+ *Construction de la matrice A *
+ *--------------------------------------------*/
+
+ for (ii = 0 ; ii < nbvois ; ii++) {
+
+ ieau = nvois[ii] ;
+ dxx = (cs_real_t) (lst_xyz_water[3*ieau +0] - lst_xyz_cel[iair*3+0]) ;
+ dyy = (cs_real_t) (lst_xyz_water[3*ieau +1] - lst_xyz_cel[iair*3+1]) ;
+ dzz = (cs_real_t) (lst_xyz_water[3*ieau +2] - lst_xyz_cel[iair*3+2]) ;
+
+ dx = dxx * vectBase[0][0] + dyy * vectBase[0][1] + dzz * vectBase[0][2];
+ dy = dxx * vectBase[1][0] + dyy * vectBase[1][1] + dzz * vectBase[1][2];
+ dz = dxx * vectBase[2][0] + dyy * vectBase[2][1] + dzz * vectBase[2][2];
+ /* parametre de la fonction de ponderation*/
+ cx = 1.0 ;
+ cy = 1.0 ;
+ cz = 1.e10 ;
+ lf = 3;
+ epgauss = 5.0 ;
+ if (dim==3) {
+ cz = 1.0 ;
+ }
+ if (dim==1) {
+ cy = 1.e10 ;
+ cz = 1.e10 ;
+ }
+ /*fonction de ponderation*/
+ w = _weighting(dx,dy,dz,ouv,lf,epgauss,cx,cy,cz) ;
+
+ if (dim == 1)/* 1D */{
+ pp[0][0] = w + pp[0][0] ;
+ pp[0][1] = w*dx + pp[0][1] ;
+ pp[1][0] = w*dx + pp[1][0] ;
+ pp[1][1] = w*dx*dx + pp[1][1] ;
+ }else if (dim == 2)/* 2D */{
+ pp[0][0] = w + pp[0][0] ;
+ pp[0][1] = w*dx + pp[0][1] ;
+ pp[0][2] = w*dy + pp[0][2] ;
+ pp[1][0] = w*dx + pp[1][0] ;
+ pp[1][1] = w*dx*dx + pp[1][1] ;
+ pp[1][2] = w*dx*dy + pp[1][2] ;
+ pp[2][0] = w*dy + pp[2][0] ;
+ pp[2][1] = w*dx*dy + pp[2][1] ;
+ pp[2][2] = w*dy*dy + pp[2][2] ;
+ }else if (dim == 3)/* 3D */{
+ pp[0][0] = w + pp[0][0] ;
+ pp[0][1] = w*dx + pp[0][1] ;
+ pp[0][2] = w*dy + pp[0][2] ;
+ pp[0][3] = w*dz + pp[0][3] ;
+ pp[1][0] = w*dx + pp[1][0] ;
+ pp[1][1] = w*dx*dx + pp[1][1] ;
+ pp[1][2] = w*dy*dx + pp[1][2] ;
+ pp[1][3] = w*dz*dx + pp[1][3] ;
+ pp[2][0] = w*dy + pp[2][0] ;
+ pp[2][1] = w*dx*dy + pp[2][1] ;
+ pp[2][2] = w*dy*dy + pp[2][2] ;
+ pp[2][3] = w*dz*dy + pp[2][3] ;
+ pp[3][0] = w*dz + pp[3][0] ;
+ pp[3][1] = w*dx*dz + pp[3][1] ;
+ pp[3][2] = w*dy*dz + pp[3][2] ;
+ pp[3][3] = w*dz*dz + pp[3][3] ;
+
+ }
+
+ }/* Fin de construction de la matrice A*/
+ if(ct->idimct == 3 && dim == 3){
+ dim = _is_coplanar(lst_xyz_water, nvois, nbvois, pp, vectBase,0,dhi);
+ if(dim!= 3) {
+ for (ii=0;ii<3;ii++)
+ for (jj=0;jj<3;jj++)
+ pp[jj][ii]=0.;
+ goto passage2D ;
+ }
+ }
+
+ /*--------------------------------------------*
+ * inversion de la matrice par la methode de *
+ * jordan *
+ *--------------------------------------------*/
+ if (_invmat(pp, ppInv, dim) == 0) cs_exit(EXIT_FAILURE);
+
+ /*--------------------------------------------*
+ * Calcul des coefficients *
+ *--------------------------------------------*/
+ for (ii = 0 ; ii < nbvois ; ii++) {
+ ieau = nvois[ii] ;
+ dxx = (cs_real_t) (lst_xyz_water[3*ieau ] - lst_xyz_cel[iair*3+0]);
+ dyy = (cs_real_t) (lst_xyz_water[3*ieau +1] - lst_xyz_cel[iair*3+1]);
+ dzz = (cs_real_t) (lst_xyz_water[3*ieau +2] - lst_xyz_cel[iair*3+2]);
+
+ dx = dxx * vectBase[0][0] + dyy * vectBase[0][1] + dzz * vectBase[0][2];
+ dy = dxx * vectBase[1][0] + dyy * vectBase[1][1] + dzz * vectBase[1][2];
+ dz = dxx * vectBase[2][0] + dyy * vectBase[2][1] + dzz * vectBase[2][2];
+
+ /*parametre de la fonction de ponderation*/
+ cx = 1.0 ;
+ cy = 1.0 ;
+ cz = 1.e10 ;
+ lf = 3;
+ epgauss = 5.0 ;
+ if (dim==3) {
+ cz = 1.0 ;
+ }
+ if (dim==1) {
+ cy = 1.e10 ;
+ cz = 1.e10 ;
+ }
+
+ w = _weighting(dx,dy,dz,ouv,lf,epgauss,cx,cy,cz) ;
+
+
+
+ if (dim == 1){
+ coeff[ii] = w*(ppInv[0][0]+ppInv[0][1]*dx);
+ }
+ else if (dim == 2){
+ coeff[ii] = w*(ppInv[0][0]+ppInv[0][1]*dx+ppInv[0][2]*dy);
+ }
+ else if (dim == 3){
+ coeff[ii] = w*(ppInv[0][0]
+ +ppInv[0][1]*dx
+ +ppInv[0][2]*dy
+ +ppInv[0][3]*dz );
+ }
+
+ }
+ /* Fin de calcul des coefficients */
+
+ /*---------------------------------------------*
+ * note :Reprise pour les noeuds air en bordure*
+ * ou avec un nbre de voisin insuffisant *
+ *---------------------------------------------*/
+ enregistre : ;
+
+ /*--------------------------------------------*
+ * trouver le dernier indice sur pvoisair *
+ *--------------------------------------------*/
+ indice = 0 ;
+ while (ct->voisair[indice]!=-1) {
+ indice += 1 ;
+ }
+
+ /*--------------------------------------------*
+ * Ajout des voisins et des coefficients *
+ *--------------------------------------------*/
+ for (icol = 0 ; icol < nbvois ; icol++)
+ {
+ ct->voisair[indice + icol] = nvois[ icol ];
+ ct->coefair[indice + icol] = coeff[ icol ];
+ }
+
+
+ ct->pvoisair[iair+1] = ct->pvoisair[iair] + nbvois ;
+ }
+ /*---------------------------------------------*
+ * fin de la boucle sur les noeuds air de la ct*
+ *---------------------------------------------*/
+
+ BFT_FREE(lst_xyz_water);
+
+
+ }/* fin de la boucle sur les ct */
+
+}
+
+
+/*----------------------------------------------------------------------------*
+ * Chaining of the exchange area *
+ *----------------------------------------------------------------------------*/
+
+void
+cs_ctwr_stacking(void)
+{
+ cs_int_t i, j, rank, dist_rank, nb, nb_ct, itmp, ict, ict_uw;
+ cs_int_t * aux;
+ cs_ctwr_zone_t *ct, *ct_upw;
+ cs_real_t tmp;
+ cs_real_t gravite[3];
+ fvm_coord_t * lst_xyz;
+ const double tolerance = 0.1;
+
+ nb = cs_glob_ct_nbr * cs_glob_ct_nbr;
+ cs_ctwr_fluid_props_t *ct_prop = cs_glob_ctwr_props;
+
+ BFT_MALLOC(cs_stack_ct, nb, cs_int_t);
+ BFT_MALLOC(cs_chain_ct, cs_glob_ct_nbr, cs_int_t);
+
+ gravite[0]= ct_prop->gravx;
+ gravite[1]= ct_prop->gravy;
+ gravite[2]= ct_prop->gravz;
+
+ for (i=0 ; i < cs_glob_ct_nbr ; i++)
+ for (j=0 ; j < cs_glob_ct_nbr ; j++)
+ cs_stack_ct[i*cs_glob_ct_nbr + j]=0;
+
+ for (i=0 ; i < cs_glob_ct_nbr; i++)
+ for (j=0 ; j < cs_glob_ct_nbr ; j++)
+ if (CS_ABS(cs_glob_ct_tab[i]->hmax - cs_glob_ct_tab[j]->hmin)< 1.e-6)
+ cs_stack_ct[i*cs_glob_ct_nbr + j] =1;
+
+#if defined(HAVE_MPI)
+
+ if (cs_glob_n_ranks > 1) {
+
+ BFT_MALLOC(aux, nb, cs_int_t);
+ rank = cs_glob_rank_id;
+
+ for (dist_rank = 0; dist_rank < cs_glob_n_ranks; dist_rank++)
+ if (dist_rank != rank){
+
+ MPI_Sendrecv(cs_stack_ct, nb, CS_MPI_INT , dist_rank, CS_CT_MPI_TAG,
+ aux, nb, CS_MPI_INT, dist_rank, CS_CT_MPI_TAG,
+ cs_glob_mpi_comm, &status);
+ for (i=0 ; i < cs_glob_ct_nbr ; i++)
+ for (j=0 ; j < cs_glob_ct_nbr ; j++){
+ if (aux[i*cs_glob_ct_nbr + j] > cs_stack_ct[i*cs_glob_ct_nbr + j])
+ cs_stack_ct[i*cs_glob_ct_nbr + j] = aux[i*cs_glob_ct_nbr + j];
+ }
+ }
+
+ BFT_FREE(aux);
+
+ }
+#endif
+
+ /* to order the exchange area */
+ /*Init the chaining array */
+ for(i = 0; i < cs_glob_ct_nbr ; i++)
+ cs_chain_ct[i] = i;
+
+ for (i = 0; i < cs_glob_ct_nbr ; i++)
+ for (j = i+1; j < cs_glob_ct_nbr ; j++)
+ if (cs_stack_ct[cs_chain_ct[i]*cs_glob_ct_nbr + cs_chain_ct[j]] == 1 ){
+ itmp = cs_chain_ct [i];
+ cs_chain_ct [i] = cs_chain_ct [j];
+ cs_chain_ct [j] = itmp;
+ }
+
+ for(ict = 0; ict< cs_glob_ct_nbr ; ict++){
+
+ ct = cs_glob_ct_tab[cs_chain_ct[ict]];
+ nb_ct = 0;
+
+ for (ict_uw = 0 ; ict_uw < cs_glob_ct_nbr ; ict_uw++)
+ if (cs_stack_ct[cs_chain_ct[ict]*cs_glob_ct_nbr + cs_chain_ct[ict_uw]]
+ == 1){
+
+ nb_ct++;
+ ct_upw = cs_glob_ct_tab[cs_chain_ct[ict_uw]];
+
+ BFT_MALLOC( lst_xyz ,
+ 3*(ct_upw->nbfac_ict+ct_upw->nbfbr_ict) ,fvm_coord_t);
+
+ fvm_nodal_get_element_centers
+ ( ct_upw->face_inf_mesh,FVM_INTERLACE,2,lst_xyz );
+
+ tmp = CS_ABS(ct_upw->hmax - ct_upw->hmin)/(ct_upw->nelect-1);
+ tmp /= CS_LOC_MODULE(gravite);
+
+ for (i=0 ; i < (ct_upw->nbfac_ict+ct_upw->nbfbr_ict) ; i++){
+ lst_xyz[3*i + 0 ] -= tmp * gravite[0];
+ lst_xyz[3*i + 1 ] -= tmp * gravite[1];
+ lst_xyz[3*i + 2 ] -= tmp * gravite[2];
+ }
+
+ BFT_REALLOC(ct->locat_cell_ct_upwind, nb_ct, fvm_locator_t *);
+
+#if defined(FVM_HAVE_MPI)
+ ct->locat_cell_ct_upwind[nb_ct-1] =
+ fvm_locator_create(tolerance,
+ cs_glob_mpi_comm,
+ cs_glob_n_ranks,
+ 0);
+#else
+ ct->locat_cell_ct_upwind[nb_ct-1] = fvm_locator_create(tolerance);
+#endif
+
+ fvm_locator_set_nodal(ct->locat_cell_ct_upwind[nb_ct-1],
+ ct_upw->water_mesh,
+ 0,
+ 3,
+ ct_upw->nbfac_ict+ct_upw->nbfbr_ict,
+ NULL,
+ lst_xyz);
+ BFT_FREE(lst_xyz);
+
+ }
+ }
+}
+
+#undef CS_LOC_PRODUIT_SCALAIRE
+#undef CS_LOC_MODULE
+#undef CS_PRODUIT_VECTORIEL
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/ctwr/ctini1.f90 b/src/ctwr/ctini1.f90
new file mode 100644
index 0000000..13c1fd3
--- /dev/null
+++ b/src/ctwr/ctini1.f90
@@ -0,0 +1,196 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ctini1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR LE MODULE AEROREFRIGERANTS
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "ctincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer iphas, ii, jj, isc, ipp
+
+!===============================================================================
+
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+ endif
+enddo
+do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ call csexit (1)
+ !==========
+ endif
+enddo
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+iscsth(itemp4) = 1
+iscsth(ihumid) = 0
+
+iphas = 1
+iscalt(iphas) = itemp4
+
+irovar(iphas) = 1
+ivivar(iphas) = 0
+
+! --> Donnees physiques ou numeriques propres aux scalaires
+
+do isc = 1, nscapp
+
+ jj = iscapp(isc)
+
+ if (iscavr(jj).le.0) then
+ visls0(jj) = viscl0(iphsca(jj))
+ endif
+
+ blencv(isca(jj)) = 1.d0
+
+enddo
+
+do iphas = 1, nphas
+
+ ipp = ipprtp(isca(itemp4))
+ NOMVAR(IPP) = 'Temperature'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+ ipp = ipprtp(isca(ihumid))
+ NOMVAR(IPP) = 'Humidite'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+enddo
+
+!===============================================================================
+! 2. ON DONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+call uscti1
+!==========
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (AEROREFRIGERANTS) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (AEROREFRIGERANTS) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/ctwr/ctiniv.f90 b/src/ctwr/ctiniv.f90
new file mode 100644
index 0000000..c1d4acd
--- /dev/null
+++ b/src/ctwr/ctiniv.f90
@@ -0,0 +1,253 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ctiniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : ECOULEMENTS ATMOSPHERIQUES
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ctincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. STANDARD INITIALIZATION
+!===============================================================================
+
+
+
+!===============================================================================
+! 3. USER OPTIONS
+!===============================================================================
+
+call usctiv &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/ctwr/ctphyv.f90 b/src/ctwr/ctphyv.f90
new file mode 100644
index 0000000..03d0d01
--- /dev/null
+++ b/src/ctwr/ctphyv.f90
@@ -0,0 +1,475 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ctphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! REMPLISSAGE DES VARIABLES PHYSIQUES : Version Aerorefrigerants
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer iel , iphas
+integer ipcrom, ipcvis, ipccp , ipcray
+integer ipcvsl, ith , iscal , ivart, ii
+integer iclvar
+integer iiii , ipcsig, it
+integer iesp , iesp1 , iesp2 , mode , isrrom
+integer maxelt, ils
+
+double precision tp , delt , somphi, val
+double precision rho , r , cpa , cpe , cpv , del
+double precision hv0 , hvti , rhoj , tti , xxi, xsati , dxsati
+double precision rho0 , t00 , p00 , t1
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 0 - INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+
+!===============================================================================
+! 1 - MASSE VOLUMIQUE
+!===============================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+! (et de ses conditions limites)
+
+ ivart = isca(itemp4)
+
+! --- Position des conditions limites de la variable IVART
+
+ iclvar = iclrtp(ivart,icoef)
+
+! --- Rang de la masse volumique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCROM
+
+ ipcrom = ipproc(irom(iphas))
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ rho0 = 1.293d0
+ t00 = 273.15d0
+ p00 = 101325.d0
+ del = 0.622d0
+ t1 = 273.15d0
+ r = 8.3143d0
+
+
+! Masse volumique au centre des cellules
+! ---------------------------------------
+
+ do iel = 1, ncel
+
+ tti = rtp(iel,isca(itemp4))
+ xxi = rtp(iel,isca(ihumid))
+
+ call xsath(tti,xsati)
+! ==========
+
+ if (xxi .le. xsati) then
+
+ rho = rho0*t00/(tti+t1)*del/(del+xxi)
+
+ else
+
+ if (tti.le.0.d0) then
+ rhoj = 917.0d0
+ else
+ rhoj = 998.36d0 - 0.4116d0*(tti-20.d0) &
+ - 2.24d0*(tti-20.d0)*(tti-70.d0)/625.d0
+ endif
+
+ rho = 1.0d0/((tti+t1)*p00/(t00*p00*rho0*del) &
+ *(del+xsati)+(xxi-xsati)/rhoj)
+
+ endif
+
+ if (rho .lt. 0.1d0) rho = 0.1d0
+ propce(iel,ipcrom) = rho
+
+ enddo
+
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+
+!===============================================================================
+! 2 - CHALEUR SPECIFIQUE
+!===============================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+
+ ivart = isca(itemp4)
+
+! --- Rang de la chaleur specifique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCCP
+
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+ else
+ ipccp = 0
+ endif
+
+! --- Stop si CP n'est pas variable
+
+ if(ipccp.le.0) then
+ write(nfecra,1000) iphas, iphas, icp(iphas)
+ call csexit (1)
+ endif
+
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ cpa = 1006.0d0
+ cpv = 1831.0d0
+ cpe = 4179.0d0
+ hv0 = 2501600.0d0
+
+
+! Chaleur specifique J/(kg degres) au centre des cellules
+! --------------------------------------------------------
+
+ if (ippmod(iaeros).eq.1) then
+
+ do iel = 1, ncel
+
+ tti = rtp(iel,isca(itemp4))
+ xxi = rtp(iel,isca(ihumid))
+
+ call xsath(tti,xsati)
+! ==========
+
+ if (xxi .le. xsati) then
+ propce(iel,ipccp) = cpa + xxi*cpv
+ else
+ hvti = (cpv-cpe)*tti + hv0
+ call dxsath(tti,dxsati)
+ !==========
+ propce(iel,ipccp) = cpa + xsati*cpv + &
+ (xxi-xsati)*cpe + dxsati*hvti
+ endif
+
+ enddo
+
+ elseif (ippmod(iaeros).eq.2) then
+
+ do iel = 1, ncel
+
+ tti = rtp(iel,isca(itemp4))
+
+ call xsath(tti,xsati)
+! ==========
+
+ hvti = cpv*tti + hv0
+
+ call dxsath(tti,dxsati)
+ !==========
+
+ propce(iel,ipccp) = cpa + xsati*cpv + dxsati*hvti
+
+ enddo
+
+ endif
+
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+!===============================================================================
+! 3 - ON PASSE LA MAIN A L'UTILISATEUR
+!===============================================================================
+
+
+
+! La masse volumique au bord est traitee dans phyvar (recopie de la valeur
+! de la cellule de bord).
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DONNEES DE CALCUL INCOHERENTES ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,/,&
+'@ usini1 indique que la chaleur specifique est uniforme ',/,&
+'@ ICP(',I10 ,') = ',I10 ,' alors que ',/,&
+'@ usphyv impose une chaleur specifique variable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1 ou usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/ctwr/cttssc.f90 b/src/ctwr/cttssc.f90
new file mode 100644
index 0000000..05dd0d5
--- /dev/null
+++ b/src/ctwr/cttssc.f90
@@ -0,0 +1,263 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine cttssc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , nckpdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ izfppp , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! nckpdp ! e ! <-- ! nbr de coef du tenseur de pdc (3 ou 6 !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc(ncepdp ! tr ! <-- ! tableau de travail pour pdc !
+! , nckpdp) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "ctincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , nckpdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,nckpdp), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , iel
+integer ipcdc1, ipcdc2, ipcdc3
+integer ipcefj
+double precision valmin,valmax
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES ET VARIABLES STANDARDS
+!===============================================================================
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+' Calcul des termes sources pour la variable : ',A8 )
+
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/ctwr/ctvarp.f90 b/src/ctwr/ctvarp.f90
new file mode 100644
index 0000000..fedfe2f
--- /dev/null
+++ b/src/ctwr/ctvarp.f90
@@ -0,0 +1,114 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ctvarp
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES POUR LE MODULE AEROS
+! REMPLISSAGE DES PARAMETRES (DEJA DEFINIS) POUR LES SCALAIRES PP
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "ctincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer isc, iphas
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! ---- Temperature
+itemp4 = iscapp(1)
+
+! ---- Humidite
+ihumid = iscapp(2)
+
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+! A RENSEIGNER OBLIGATOIREMENT (sinon pb dans varpos)
+! IPHSCA, IVISLS, ICP
+!===============================================================================
+
+do isc = 1, nscapp
+
+ if ( iscavr(iscapp(isc)).le.0 ) then
+
+! ---- Notre physique particuliere est monophasique
+ iphsca(iscapp(isc)) = 1
+
+! ---- Viscosite dynamique moleculaire variable pour les
+! scalaires ISCAPP(ISC)
+ ivisls(iscapp(isc)) = 0
+
+ endif
+
+enddo
+
+iphas = iphsca(itemp4)
+icp(iphas) = 1
+
+return
+end
+
diff --git a/src/elec/Makefile.am b/src/elec/Makefile.am
new file mode 100644
index 0000000..faefd9f
--- /dev/null
+++ b/src/elec/Makefile.am
@@ -0,0 +1,73 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/elec/elincl.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcselec.la
+libcselec_la_SOURCES = \
+elflux.f90 \
+elini1.f90 \
+eliniv.f90 \
+ellecd.f90 \
+elphyv.f90 \
+elprop.f90 \
+elthht.f90 \
+eltssc.f90 \
+elvarp.f90 \
+elveri.f90
+libcselec_la_LDFLAGS = -no-undefined
+
+libcselec_la_SOURCES += \
+$(top_srcdir)/users/elec/uselcl.f90 \
+$(top_srcdir)/users/elec/uselen.f90 \
+$(top_srcdir)/users/elec/useli1.f90 \
+$(top_srcdir)/users/elec/useliv.f90 \
+$(top_srcdir)/users/elec/uselph.f90 \
+$(top_srcdir)/users/elec/uselrc.f90 \
+$(top_srcdir)/users/elec/usetcl.f90
+
+elecdir = $(pkgdatadir)/users/elec
+elec_DATA = \
+$(top_srcdir)/users/elec/uselcl.f90 \
+$(top_srcdir)/users/elec/uselen.f90 \
+$(top_srcdir)/users/elec/useli1.f90 \
+$(top_srcdir)/users/elec/useliv.f90 \
+$(top_srcdir)/users/elec/uselph.f90 \
+$(top_srcdir)/users/elec/uselrc.f90 \
+$(top_srcdir)/users/elec/usetcl.f90
diff --git a/src/elec/Makefile.in b/src/elec/Makefile.in
new file mode 100644
index 0000000..3611e43
--- /dev/null
+++ b/src/elec/Makefile.in
@@ -0,0 +1,648 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/elec
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcselec_la_LIBADD =
+am_libcselec_la_OBJECTS = elflux.lo elini1.lo eliniv.lo ellecd.lo \
+ elphyv.lo elprop.lo elthht.lo eltssc.lo elvarp.lo elveri.lo \
+ uselcl.lo uselen.lo useli1.lo useliv.lo uselph.lo uselrc.lo \
+ usetcl.lo
+libcselec_la_OBJECTS = $(am_libcselec_la_OBJECTS)
+libcselec_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcselec_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcselec_la_SOURCES)
+DIST_SOURCES = $(libcselec_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(elecdir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+elecDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(elec_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/elec/elincl.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcselec.la
+libcselec_la_SOURCES = elflux.f90 elini1.f90 eliniv.f90 ellecd.f90 \
+ elphyv.f90 elprop.f90 elthht.f90 eltssc.f90 elvarp.f90 \
+ elveri.f90 $(top_srcdir)/users/elec/uselcl.f90 \
+ $(top_srcdir)/users/elec/uselen.f90 \
+ $(top_srcdir)/users/elec/useli1.f90 \
+ $(top_srcdir)/users/elec/useliv.f90 \
+ $(top_srcdir)/users/elec/uselph.f90 \
+ $(top_srcdir)/users/elec/uselrc.f90 \
+ $(top_srcdir)/users/elec/usetcl.f90
+libcselec_la_LDFLAGS = -no-undefined
+elecdir = $(pkgdatadir)/users/elec
+elec_DATA = \
+$(top_srcdir)/users/elec/uselcl.f90 \
+$(top_srcdir)/users/elec/uselen.f90 \
+$(top_srcdir)/users/elec/useli1.f90 \
+$(top_srcdir)/users/elec/useliv.f90 \
+$(top_srcdir)/users/elec/uselph.f90 \
+$(top_srcdir)/users/elec/uselrc.f90 \
+$(top_srcdir)/users/elec/usetcl.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/elec/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/elec/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcselec.la: $(libcselec_la_OBJECTS) $(libcselec_la_DEPENDENCIES)
+ $(libcselec_la_LINK) $(libcselec_la_OBJECTS) $(libcselec_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+uselcl.lo: $(top_srcdir)/users/elec/uselcl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uselcl.lo `test -f '$(top_srcdir)/users/elec/uselcl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/elec/uselcl.f90
+
+uselen.lo: $(top_srcdir)/users/elec/uselen.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uselen.lo `test -f '$(top_srcdir)/users/elec/uselen.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/elec/uselen.f90
+
+useli1.lo: $(top_srcdir)/users/elec/useli1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o useli1.lo `test -f '$(top_srcdir)/users/elec/useli1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/elec/useli1.f90
+
+useliv.lo: $(top_srcdir)/users/elec/useliv.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o useliv.lo `test -f '$(top_srcdir)/users/elec/useliv.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/elec/useliv.f90
+
+uselph.lo: $(top_srcdir)/users/elec/uselph.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uselph.lo `test -f '$(top_srcdir)/users/elec/uselph.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/elec/uselph.f90
+
+uselrc.lo: $(top_srcdir)/users/elec/uselrc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uselrc.lo `test -f '$(top_srcdir)/users/elec/uselrc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/elec/uselrc.f90
+
+usetcl.lo: $(top_srcdir)/users/elec/usetcl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usetcl.lo `test -f '$(top_srcdir)/users/elec/usetcl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/elec/usetcl.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-elecDATA: $(elec_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(elecdir)" || $(MKDIR_P) "$(DESTDIR)$(elecdir)"
+ @list='$(elec_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(elecDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(elecdir)/$$f'"; \
+ $(elecDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(elecdir)/$$f"; \
+ done
+
+uninstall-elecDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(elec_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(elecdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(elecdir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(elecdir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-elecDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-elecDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-elecDATA install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-saturneincludeHEADERS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-elecDATA \
+ uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/elec/elflux.f90 b/src/elec/elflux.f90
new file mode 100644
index 0000000..c395ecf
--- /dev/null
+++ b/src/elec/elflux.f90
@@ -0,0 +1,1037 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine elflux &
+!================
+
+ ( idbia0 , idbra0 , iappel , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE POUR LE MODULE ELECTRIQUE
+
+! CALCULS DES VARIABLES PROPCE
+! ELLES SONT UTILISEES POUR LE CALCUL DES TS
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! iappel ! e ! <-- ! numero d'appel !
+! ! ! ! 1 : j, e, j.e !
+! ! ! ! 2 : b, jxb !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! w1..9(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , iappel
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel
+integer ipcefj, ipcsig, ipcsii
+integer ipcla1, ipcla2, ipcla3
+integer ipcdc1, ipcdc2, ipcdc3
+integer ipcdi1, ipcdi2, ipcdi3
+integer inc , iccocg, nswrgp, imligp, iwarnp
+integer ivar0 , iclimv
+integer iphydp, idimte, itenso, ivar , modntl
+
+double precision epsrgp, climgp, extrap, vrmin, vrmax, var
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des grandeurs physiques
+ipcsig = ipproc(ivisls(ipotr))
+ipcsii = ipproc(ivisls(ipoti))
+ipcefj = ipproc(iefjou)
+ipcdc1 = ipproc(idjr(1))
+ipcdc2 = ipproc(idjr(2))
+ipcdc3 = ipproc(idjr(3))
+
+if ( ippmod(ieljou).eq.4 ) then
+ ipcdi1 = ipproc(idji(1))
+ ipcdi2 = ipproc(idji(2))
+ ipcdi3 = ipproc(idji(3))
+endif
+
+! --- Necessite d'une impression (impression si MODNTL=0)
+if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+else
+ modntl = 1
+endif
+
+!===============================================================================
+! 1. PREMIER APPEL : J, E => J.E
+!===============================================================================
+
+if(iappel.eq.1) then
+
+!===============================================================================
+! 1.1 PRISE EN COMPTE DES TERMES SOURCES ET VARIABLES STANDARD ET
+! COMMUNES A TOUTES LES VERSIONS ELECTRIQUES : EFFET JOULE, E, J
+! CAS IELJOU >= 1 ou IELARC >= 1 ou IELION >= 1
+!===============================================================================
+
+! Pour toutes les versions electriques :
+! on doit calculer le terme joule (partie reelle) = j . E
+! produit de la densite de courant par le champ electrique
+
+
+! 2.1 Calcul du grad (potR) (W4, W5, W6)
+! ---------------------------
+
+ ivar = isca(ipotr)
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! C'est indispensable car on vient de calculer IVAR
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,ivar))
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+! POTR
+ w4 , w5 , w6 , &
+! d POTR /dx d POTR /dy d POTR /dz
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! 2.2 Calcul du champ electrique E = - grad (potR) : (-W4, -W5, -W6)
+! -------------------------------------------------
+
+! 2.3 Calcul de la densite de courant j = sig E :
+! -------------------------------------------------
+! PROPCE(IEL,IPCSIG) (-W4, -W5, -W6)
+
+
+ if( ippmod(ieljou).ge.1 .or. ippmod(ielarc).ge.1 ) then
+ do iel = 1, ncel
+ propce(iel,ipcdc1)= - propce(iel,ipcsig) * w4(iel)
+ propce(iel,ipcdc2)= - propce(iel,ipcsig) * w5(iel)
+ propce(iel,ipcdc3)= - propce(iel,ipcsig) * w6(iel)
+ enddo
+ endif
+
+! 2.4 Calcul de l'Effet Joule j . E : PROPCE( .,IPPROC(IEFJOU) )
+! -----------------------------------------------------------------
+! sig E.E
+ do iel = 1, ncel
+ propce(iel,ipcefj)= &
+ propce(iel,ipcsig)*(w4(iel)**2+w5(iel)**2+w6(iel)**2)
+ enddo
+
+
+! 2.5 On imprime les extrema de E et j
+! -------------------------------------
+
+ if(modntl.eq.0) then
+
+ write(nfecra,1000)
+
+! Grad PotR = -E
+ var = w4(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w4(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Gr_PotRX',VRMIN,VRMAX
+
+ var = w5(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w5(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Gr_PotRY',VRMIN,VRMAX
+
+ var = w6(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w6(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Gr_PotRZ',VRMIN,VRMAX
+
+ var = -propce(1,ipcsig) * w4(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = -propce(iel,ipcsig) * w4(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Cour_ReX',VRMIN,VRMAX
+
+ var = -propce(1,ipcsig) * w5(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = -propce(iel,ipcsig) * w5(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Cour_ReY',VRMIN,VRMAX
+
+ var = -propce(1,ipcsig) * w6(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = -propce(iel,ipcsig) * w6(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Cour_ReZ',VRMIN,VRMAX
+
+ endif
+
+
+
+!===============================================================================
+! 1.2 PRISE EN COMPTE ET AJOUT DES TERMES SOURCES ET VARIABLES
+! RELATIVES A LA PRISE EN COMPTE DU POTENTIEL COMPLEXE
+! CAS IELJOU = 2
+!===============================================================================
+
+ if(ippmod(ieljou).ge.2 .or. ippmod(ieljou).eq.4) then
+
+
+! 3.1 Calcul du grad (potI) : (W4, W5, W6)
+! ----------------------------
+
+ ivar = isca(ipoti)
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! C'est indispensable car on vient de calculer IVAR
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,ivar))
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+
+
+! SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+ w4 , w5 , w6 , &
+! d POTI /dx d POTI /dy d POTI /dz
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+! 3.2 Calcul du champ electrique Ei = - grad (potI) : (-W4, -W5, -W6)
+! -------------------------------------------------
+
+! 3.3 Partie imaginaire de la densite de courant :
+! ------------------------------------------------
+! PROPCE(IEL,IPCSIG) (-W4, -W5, -W6)
+
+ if ( ippmod(ieljou).eq.4 ) then
+ do iel = 1, ncel
+ propce(iel,ipcdi1)= -propce(iel,ipcsig)*w4(iel)
+ propce(iel,ipcdi2)= -propce(iel,ipcsig)*w5(iel)
+ propce(iel,ipcdi3)= -propce(iel,ipcsig)*w6(iel)
+ enddo
+ endif
+
+
+! 3.4 Effet Joule total : PROPCE( .,IPPROC(IEFJOU) )
+! ----------------------------------------------------
+
+ do iel = 1, ncel
+
+! ajout de la partie imaginaire et ...
+ propce(iel,ipcefj) = propce(iel,ipcefj) &
+ + propce(iel,ipcsii)*(w4(iel)**2+w5(iel)**2+w6(iel)**2)
+! . ..division par 2
+ propce(iel,ipcefj) = 0.5d0*propce(iel,ipcefj)
+
+ enddo
+
+
+
+! 3.5 On imprime les extrema de E et j
+! -------------------------------------
+
+ if(modntl.eq.0) then
+
+! Grad PotI = -Ei
+ var = w4(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w4(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Gr_PotIX',VRMIN,VRMAX
+
+ var = w5(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w5(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Gr_PotIY',VRMIN,VRMAX
+
+ var = w6(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w6(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Gr_PotIZ',VRMIN,VRMAX
+
+! j=sigma E
+ var = -propce(1,ipcsii) * w4(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = -propce(iel,ipcsii) * w4(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Cour_ImX',VRMIN,VRMAX
+
+ var = -propce(1,ipcsii) * w5(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = -propce(iel,ipcsii) * w5(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Cour_ImY',VRMIN,VRMAX
+
+ var = -propce(1,ipcsii) * w6(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = -propce(iel,ipcsii) * w6(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Cour_ImZ',VRMIN,VRMAX
+
+ write(nfecra,1001)
+
+ endif
+
+ endif
+
+endif
+! Fin du test IAPPEL = 1
+
+!===============================================================================
+! 2. DEUXIEME APPEL : A, B, JXB
+!===============================================================================
+
+if (iappel.eq.2) then
+
+!===============================================================================
+! 2.1 PRISE EN COMPTE ET AJOUT DES TERMES SOURCES ET VARIABLES RELATIVES
+! A LA PRISE EN COMPTE DE L'ARC ELECTRIQUE
+! CAS IELARC = 1 OU 2
+!===============================================================================
+
+
+ if(ippmod(ielarc).ge.1) then
+ ipcla1 = ipproc(ilapla(1))
+ ipcla2 = ipproc(ilapla(2))
+ ipcla3 = ipproc(ilapla(3))
+ endif
+
+! 4.1 ARC ELECTRIQUE DIT 3D : IELARC = 2
+! ----------------------------------------
+! ON PASSE PAR LA RESOLUTION D'EQUATIONS DE POISSON SUR LES
+! -----------------------------------------------------------
+! COMPOSANTES DU POTENTIEL VECTEUR
+! ----------------------------------
+
+ if( ippmod(ielarc).ge.2 ) then
+
+! --> Calcul des composantes du champ magnetique B = (W1, W2, W3)
+!===================================================
+
+
+! Sur Ax
+
+ ivar = isca(ipotva(1))
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! C'est indispensable car on vient de calculer IVAR
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,ivar))
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+
+ ivar0 = 0
+
+! SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+ w4 , w5 , w6 , &
+! d Ax /dx d Ax /dy d Ax /dz
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+! B = rot A
+
+ do iel = 1, ncel
+ w1(iel)= zero
+ w2(iel)= w6(iel)
+ w3(iel)= -w5(iel)
+ enddo
+
+! Sur Ay
+
+ ivar = isca(ipotva(2))
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! C'est indispensable car on vient de calculer IVAR
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,ivar))
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+
+ ivar0 = 0
+
+! SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+ w4 , w5 , w6 , &
+! d Ay /dx d Ay /dy d Ay /dz
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+! B = rot A
+
+ do iel = 1, ncel
+ w1(iel)= w1(iel) - w6(iel)
+ w2(iel)= w2(iel) + zero
+ w3(iel)= w3(iel) + w4(iel)
+ enddo
+
+! Sur Az
+
+ ivar = isca(ipotva(3))
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! C'est indispensable car on vient de calculer IVAR
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(rtp(1,ivar))
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+
+ ivar0 = 0
+
+! SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+ w4 , w5 , w6 , &
+! d Az /dx d Az /dy d Az /dz
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+! B = rot A
+
+ do iel = 1, ncel
+ w1(iel)= w1(iel) + w5(iel)
+ w2(iel)= w2(iel) - w4(iel)
+ w3(iel)= w3(iel) + zero
+ enddo
+
+! 4.2 CAS D'ARC AXISYMETRIQUE : IELARC = 1
+! ------------------------------------------
+! ON PEUT UTILISER LE THEOREME D'AMPERE
+! ---------------------------------------
+
+ else if(ippmod(ielarc).eq.1) then
+
+! Calcul du Champ magnetique calcule :
+!===========================================
+
+! B = / j d S
+
+! Cette version n'a pas ete developpe pour l'instant :
+! - elle ne fonctionne que dans le cas d'un arc axisymetrique
+! - elle demande donc un reperage des plans perpendiculaires
+! a l'arc
+! - elle necessite la connaissance des coordonnees de chaque
+! point du maillage
+
+ write(nfecra,2000)
+ call csexit (1)
+
+ endif
+
+! 4.3 ARC ELECTRIQUE : CALCUL DES FORCES DE LAPLACE j X B
+! ---------------------------------------------------------
+! POUR TOUS LES CAS D'ARCS ELECTRIQUES
+! --------------------------------------
+
+ if( ippmod(ielarc) .ge. 1 ) then
+ do iel = 1, ncel
+ propce(iel,ipcla1)= propce(iel,ipcdc2) * w3(iel) &
+ -propce(iel,ipcdc3) * w2(iel)
+ propce(iel,ipcla2)= propce(iel,ipcdc3) * w1(iel) &
+ -propce(iel,ipcdc1) * w3(iel)
+ propce(iel,ipcla3)= propce(iel,ipcdc1) * w2(iel) &
+ -propce(iel,ipcdc2) * w1(iel)
+ enddo
+ endif
+
+
+! 4.4 Impression de B en arc electrique
+! --------------------------------------
+
+ if( ippmod(ielarc) .ge. 2 ) then
+
+ if(modntl.eq.0) then
+
+ write(nfecra,1000)
+
+! B=rot A
+ var = w1(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w1(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Ch_MagX ',VRMIN,VRMAX
+
+ var = w2(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w2(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Ch_MagY ',VRMIN,VRMAX
+
+ var = w3(1)
+ vrmin = var
+ vrmax = var
+ do iel = 1, ncel
+ var = w3(iel)
+ vrmin = min(vrmin,var)
+ vrmax = max(vrmax,var)
+ enddo
+ if (irangp.ge.0) then
+ call parmin (vrmin)
+ call parmax (vrmax)
+ endif
+ WRITE(NFECRA,1010)'Ch_MagZ ',VRMIN,VRMAX
+
+ write(nfecra,1001)
+
+ endif
+
+ endif
+
+endif
+! Fin du test IAPPEL = 2
+
+!--------
+! FORMATS
+!--------
+
+
+ 1000 format(/, &
+'----------------------------------------- ',/,&
+' Variable Minimum Maximum ',/,&
+'----------------------------------------- ' )
+ 1010 format( &
+'v ',A8,' ',E12.5,' ',E12.5 )
+ 1001 format( &
+'----------------------------------------- ' )
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DANS ELTSSC ',/,&
+'@ ========= ',/,&
+'@ LA VERSION ARC ELECTRIQUE AVEC THEOREME D''AMPERE ',/,&
+'@ (IELARC = 1) N''EST PAS DISPONIBLE ',/,&
+'@ ',/,&
+'@ VEUILLEZ UTILISER LA VERSION DITE 3D ',/,&
+'@ IELARC = 2 ',/,&
+'@ AVEC EQUATION DE TRANSPORT SUR LE POTENTIEL VECTEUR A ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/elec/elini1.f90 b/src/elec/elini1.f90
new file mode 100644
index 0000000..c3e2ba3
--- /dev/null
+++ b/src/elec/elini1.f90
@@ -0,0 +1,522 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine elini1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR LE MODULE ELECTRIQUE
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer idimve , iesp
+integer ipp , ii , iok
+integer isc , iphas , ivar
+
+!===============================================================================
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+iok = 0
+
+do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ iok = iok + 1
+ endif
+enddo
+do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ iok = iok + 1
+ endif
+enddo
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! 1.1 Definition des scamin et des scamax des variables transportees
+! ==================================================================
+
+! --> Dans toutes les versions electriques
+! Enthalpie
+scamin(ihm) = -grand
+scamax(ihm) = +grand
+! Potentiel reel
+scamin(ipotr) = -grand
+scamax(ipotr) = +grand
+! Fractions massiques des constituants
+if ( ngazg .gt. 1 ) then
+ do iesp = 1, ngazg-1
+ scamin(iycoel(iesp)) = 0.d0
+ scamax(iycoel(iesp)) = 1.d0
+ enddo
+endif
+
+! --> Effet Joule (cas potentiel imaginaire)
+! Potentiel imaginaire
+
+if ( ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4 ) then
+ scamin(ipoti) = -grand
+ scamax(ipoti) = +grand
+endif
+
+! --> Arc electrique
+! Potentiel vecteur
+if ( ippmod(ielarc).ge.2 ) then
+ do idimve = 1, ndimve
+ scamin(ipotva(idimve)) = -grand
+ scamax(ipotva(idimve)) = +grand
+ enddo
+endif
+
+! --> Conduction ionique (a developper)
+
+! 1.2 Nature des scalaires transportes
+! ====================================
+
+! ---- Type de scalaire (0 passif, 1 temperature en K
+! -1 temperature en C
+! 2 enthalpie)
+! La distinction -1/1 sert pour le rayonnement
+
+! Par defaut, scalaire "passif"
+do isc = 1, nscapp
+ iscsth(iscapp(isc)) = 0
+enddo
+
+! Pour l'enthalpie
+iphas = iphsca(ihm)
+iscalt(iphas) = ihm
+iscsth(ihm) = 2
+
+! 1.4 Donnees physiques ou numeriques propres aux scalaires ELECTRIQUES
+! =====================================================================
+
+
+! --> Conditions associees aux potentiels
+! (les autres variables ont des comportements par defaut)
+ivar = isca(ipotr)
+iconv (ivar) = 0
+istat (ivar) = 0
+idiff (ivar) = 1
+idifft(ivar) = 0
+idircl(ivar) = 1
+imgr (ivar) = 1
+
+if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+ ivar = isca(ipoti)
+ iconv (ivar) = 0
+ istat (ivar) = 0
+ idiff (ivar) = 1
+ idifft(ivar) = 0
+ idircl(ivar) = 1
+ imgr (ivar) = 1
+endif
+
+if(ippmod(ielarc).ge.2) then
+ do idimve = 1, ndimve
+ ivar = isca(ipotva(idimve))
+ iconv (ivar) = 0
+ istat (ivar) = 0
+ idiff (ivar) = 1
+ idifft(ivar) = 0
+ idircl(ivar) = 1
+ imgr (ivar) = 1
+ enddo
+endif
+
+! --> "Viscosite" associee au potentiel vecteur
+! (c'est la seule qui est constante)
+if ( ippmod(ielarc).ge.2 ) then
+ visls0(ipotva(1)) = 1.d0
+ visls0(ipotva(2)) = 1.d0
+ visls0(ipotva(3)) = 1.d0
+endif
+
+! --> Schmidt ou Prandtl turbulent
+! (pour les potentiels, c'est inutile puisque IDIFFT=0)
+
+do isc = 1, nscapp
+ sigmas(iscapp(isc)) = 0.7d0
+enddo
+
+! ---> Pour tous les scalaires
+
+do isc = 1, nscapp
+
+! ----- Niveau de detail des impressions pour les variables et
+! donc les scalaires (valeurs 0 ou 1)
+! Si = -10000 non modifie par l'utilisateur -> niveau 1
+
+ ivar = isca(iscapp(isc))
+ if(iwarni(ivar).eq.-10000) then
+ iwarni(ivar) = 1
+ endif
+
+! ----- Informations relatives a la resolution des scalaires
+
+! - Facteur multiplicatif du pas de temps
+
+ cdtvar(ivar) = 1.d0
+
+! - Schema convectif % schema 2ieme ordre
+! = 0 : upwind
+! = 1 : second ordre
+ blencv(ivar) = 1.d0
+
+! - Type de schema convectif second ordre (utile si BLENCV > 0)
+! = 0 : Second Order Linear Upwind
+! = 1 : Centre
+ ischcv(ivar) = 1
+
+! - Test de pente pour basculer d'un schema centre vers l'upwind
+! = 0 : utlisation automatique du test de pente
+! = 1 : calcul sans test de pente
+ isstpc(ivar) = 0
+
+! - Reconstruction des flux de convection et de diffusion aux faces
+! = 0 : pas de reconstruction
+ ircflu(ivar) = 1
+
+enddo
+
+
+! 1.5 Variable courante : nom, sortie chrono, suivi listing, sortie histo
+! =======================================================================
+
+! Comme pour les autres variables,
+! si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! NOMVAR( ) = nom de la variable
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes
+
+! NB : Les 8 premiers caracteres du nom seront repris dans le
+! listing 'developpeur'
+
+! =======================================================================
+
+! --> Variables communes aux versions electriques
+
+ipp = ipprtp(isca(ihm))
+NOMVAR(IPP) = 'Enthalpy'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+ipp = ipprtp(isca(ipotr))
+NOMVAR(IPP) = 'POT_EL_R'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+if ( ngazg .gt. 1 ) then
+ do iesp = 1, ngazg-1
+ ipp = ipprtp(isca(iycoel(iesp)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'YM_ESL',IESP
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+endif
+
+! --> Version effet Joule
+
+if ( ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+ ipp = ipprtp(isca(ipoti))
+ NOMVAR(IPP) = 'POT_EL_I'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! --> Version arc electrique
+
+if ( ippmod(ielarc).ge.2 ) then
+ do idimve = 1, ndimve
+ ipp = ipprtp(isca(ipotva(idimve)))
+ WRITE(NOMVAR(IPP),'(A7,I1.1)')'POT_VEC',IDIMVE
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+endif
+
+! --> Version conduction ionique
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+ipp = ipppro(ipproc(itemp) )
+NOMVAR(IPP) = 'Temper'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+ipp = ipppro(ipproc(iefjou) )
+NOMVAR(IPP) = 'PuisJoul'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+do idimve = 1, ndimve
+ ipp = ipppro(ipproc(idjr(idimve)) )
+ WRITE(NOMVAR(IPP),'(A7,I1.1)')'Cour_re',IDIMVE
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+enddo
+
+if ( ippmod(ieljou).eq.4 ) then
+ do idimve = 1, ndimve
+ ipp = ipppro(ipproc(idji(idimve)) )
+ WRITE(NOMVAR(IPP),'(A7,I1.1)')'CouImag',IDIMVE
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+endif
+
+if ( ippmod(ielarc).ge.1 ) then
+ do idimve = 1, ndimve
+ ipp = ipppro(ipproc(ilapla(idimve)) )
+ WRITE(NOMVAR(IPP),'(A7,I1.1)')'For_Lap',IDIMVE
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+
+ if ( ixkabe .eq.1 ) then
+ ipp = ipppro(ipproc(idrad) )
+ NOMVAR(IPP) = 'Coef_Abso'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+
+ if ( ixkabe .eq.2 ) then
+ ipp = ipppro(ipproc(idrad) )
+ NOMVAR(IPP) = 'TS_radia'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+
+endif
+
+if ( ippmod(ielion).ge.1 ) then
+ ipp = ipppro(ipproc(iqelec) )
+ NOMVAR(IPP) = 'Charge'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! Conductivite Electrique
+
+ipp = ipppro(ipproc(ivisls(ipotr)) )
+NOMVAR(IPP) = 'Sigma'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! Conductivite electrique imaginaire :
+! La conductivite reelle et imaginaire sont dans le meme tableau.
+! Il convient donc de ne pas renseigner NOMVAR ICHRVR ILISVR IHISVR
+! pour IPP = IPPPRO(IPPROC(IVISLS(IPOTI)) )
+! puisque IPPROC(IVISLS(IPOTI)) = IPPROC(IVISLS(IPOTR))
+
+!===============================================================================
+! 3. INFORMATIONS COMPLEMENTAIRES
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+! a partir du 2ieme pas de temps, on prend :
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+srrom = 0.d0
+
+! --> Recalage des variables electriques
+! IELCOR = 0 : pas de correction
+! IELCOR = 1 : correction
+ielcor = 0
+
+! Intensite de courant imposee (arc electrique) ou
+! Puissance imposee (Joule)
+couimp = 0.d0
+puisim = 0.d0
+
+! Differentiel de potentiel Initial en arc (et Joule)
+dpot = 0.d0
+
+! Coefficient pour la correction en Joule
+coejou = 1.d0
+
+! ---> Masse volumique variable et viscosite variable (pour les suites)
+irovar(iphas) = 1
+ivivar(iphas) = 1
+
+!===============================================================================
+! 4. ON REDONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+call useli1
+!==========
+
+!===============================================================================
+! 5. VERIFICATION DES DONNEES ELECTRIQUES
+!===============================================================================
+
+iok = 0
+
+call elveri (iok)
+!==========
+
+if(iok.gt.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+ !==========
+else
+ write(nfecra,9998)
+endif
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (JOULE) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (JOULE) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (useli1).',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier useli1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/elec/eliniv.f90 b/src/elec/eliniv.f90
new file mode 100644
index 0000000..010d60d
--- /dev/null
+++ b/src/elec/eliniv.f90
@@ -0,0 +1,404 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine eliniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : VERSIONS ELECTRIQUES
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, mode, iphas , idimve , iesp
+
+double precision tinit, hinit, coefe(ngazem)
+double precision xkent, xeent, d2s3
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+! RQ IMPORTANTE : pour module electrique, 1 seul passage suffit
+
+if ( isuite.eq.0 .and. ipass.eq.1 ) then
+
+ iphas = 1
+
+
+! --> Initialisation de k et epsilon pas standard
+
+
+! ---- Initialisation de k et epsilon
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+ do iel = 1, ncel
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+
+ endif
+
+ enddo
+
+! --> Enthalpie = H(T0) ou 0
+
+! En arc electrique, on initialise tout le domaine de calcul
+! a T0 avec la 1ere espece
+! En Joule, on initialise l'enthalpie a zero, et il faudra
+! que l'utilisateur intervienne, avec sa loi T->H ou une tabulation.
+
+! -- Calculs de HINIT
+
+ if ( ippmod(ielarc).ge.1 ) then
+ mode = -1
+ tinit = t0(iphas)
+ coefe(1) = 1.d0
+ if ( ngazg .gt. 1 ) then
+ do iesp = 2, ngazg
+ coefe(iesp) = 0.d0
+ enddo
+ endif
+ call elthht(mode,ngazg,coefe,hinit,tinit)
+ else
+ hinit = 0.d0
+ endif
+
+! -- Valeurs de l'enthalpie
+
+ do iel = 1, ncel
+ rtp(iel,isca(ihm)) = hinit
+ enddo
+
+
+! --> Fractions massiques = 1 ou 0
+
+ if ( ngazg .gt. 1 ) then
+ do iel = 1, ncel
+ rtp(iel,isca(iycoel(1))) = 1.d0
+ enddo
+ do iesp = 2, ngazg-1
+ do iel = 1, ncel
+ rtp(iel,isca(iycoel(iesp))) = 0.d0
+ enddo
+ enddo
+ endif
+
+
+! --> Potentiels Electrique = 0
+
+! -- Potentiel Reel
+ do iel = 1, ncel
+ rtp(iel,isca(ipotr)) = 0.d0
+ enddo
+
+! -- Potentiel Imaginaire (Joule)
+ if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+ do iel = 1, ncel
+ rtp(iel,isca(ipoti)) = 0.d0
+ enddo
+ endif
+
+! -- Potentiel vecteur (arc elec. 3D)
+ if ( ippmod(ielarc).ge.2 ) then
+ do idimve = 1, ndimve
+ do iel = 1, ncel
+ rtp(iel,isca(ipotva(idimve))) = 0.d0
+ enddo
+ enddo
+ endif
+
+
+! --> Termes sources = 0
+
+! -- Puissance volumique dissipee par effet Joule W/m3
+ do iel = 1, ncel
+ propce(iel,ipproc(iefjou)) = 0.d0
+ enddo
+
+! -- Force de Laplace (arc elec.)
+ if ( ippmod(ielarc).ge.1 ) then
+ do idimve = 1, ndimve
+ do iel = 1, ncel
+ propce(iel,ipproc(ilapla(idimve))) = 0.d0
+ enddo
+ enddo
+ endif
+
+endif
+
+!===============================================================================
+! 2. ON PASSE LA MAIN A L'UTILISATEUR
+!===============================================================================
+
+if (ipass.eq.1) then
+ call useliv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/elec/ellecd.f90 b/src/elec/ellecd.f90
new file mode 100644
index 0000000..91e308d
--- /dev/null
+++ b/src/elec/ellecd.f90
@@ -0,0 +1,369 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ellecd
+!================
+!===============================================================================
+! FONCTION :
+! ---------
+
+! LECTURE DU FICHIER DE DONNEES PHYSIQUE PARTICULIERE
+! RELATIF AU MODULE ELECTRIQUE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+! VARIABLES LOCALES
+
+integer it, ios , iesp, ii , i
+
+!===============================================================================
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+ngazg = 1
+
+!===============================================================================
+! 1. LECTURE DU FICHIER DONNEES SPECIFIQUES
+!===============================================================================
+
+! --> Ouverture du fichier
+
+if ( ippmod(ielarc).ge.1 .or. ippmod(ieljou).eq.3 &
+ .or. ippmod(ieljou).eq.4 ) then
+ open ( unit=impfpp, file=ficfpp, &
+ STATUS='OLD', FORM='FORMATTED', ACCESS='SEQUENTIAL', &
+ iostat=ios, err=99 )
+ rewind ( unit=impfpp,err=99 )
+endif
+
+!==================================================
+! 2. LECTURE D'UN FICHIER ARC ELECTRIQUE
+!==================================================
+! Il n'y a pas de lecture de fichier prevue pour l'effet Joule
+
+
+
+! on transporte l'enthalpie, on suppose qu'il y a du rayonnement
+! la conductivite, la masse volumique, l'emissivite et
+! la viscosite dependent de la temperature
+
+if ( ippmod(ielarc).ge.1 ) then
+
+ ngazg = 0
+
+! ----- NB de constituants et Nb de points de tabulation
+! on saute les lignes de commentaires
+ do ii = 1, 7
+ read (impfpp,*)
+ enddo
+ read ( impfpp,*,err=999,end=999 ) ngazg,npo
+
+ if ( npo.gt.npot ) then
+ write(nfecra,8000) npot
+ call csexit (1)
+ !==========
+ endif
+
+ if ( ngazg.gt. ngazgm) then
+ write(nfecra,8001) ngazgm, ngazg
+ call csexit (1)
+ !==========
+ endif
+
+ if ( ngazg.lt. 1) then
+ write(nfecra,8002)ngazg
+ call csexit (1)
+ !==========
+ endif
+
+! ----- Lecture de l'indicateur pour savoir ce que represente XKABEL
+! on saute les lignes de commentaires
+ do ii = 1, 5
+ read (impfpp,*)
+ enddo
+ read ( impfpp,*,err=999,end=999 ) ixkabe
+ if ( ixkabe .lt. 0 .or. ixkabe .ge. 3 ) then
+ write(nfecra,8003) ixkabe
+ call csexit (1)
+ !==========
+ endif
+
+! ----- En fonction de la temperature pour chaque espece courante
+! Enthalpie massique
+! Masse volumique
+! Chaleur massique
+! Conductivite electrique
+! Viscosite laminaire
+! Conductivite Thermique
+! Coefficent d'absorption (rayonnement)
+! on saute les lignes de commentaires au debut
+
+ if(ngazg.gt.0.and.npo.gt.0) then
+ do ii = 1, 7
+ read (impfpp,*)
+ enddo
+ do iesp = 1, ngazg
+ do it = 1, npo
+ read (impfpp,*,err=999,end=999 ) &
+ th(it) ,ehgazg(iesp,it),rhoel(iesp,it), &
+ cpel(iesp,it) ,sigel(iesp,it) , &
+ visel(iesp,it) ,xlabel(iesp,it), &
+ xkabel(iesp,it)
+ enddo
+ enddo
+ endif
+
+endif
+
+!==================================================
+! 3. LECTURE D'UN FICHIER EFFET JOULE
+!==================================================
+
+if ( ippmod(ieljou).eq. 3 .or. ippmod(ieljou).eq. 4 ) then
+
+! ----- Lecture du transfo de reference
+
+ read (impfpp,*,err=999,end=999 ) ntfref
+
+! ----- Nombre de transfo
+
+! on saute 2 lignes de commentaires
+ read (impfpp,*)
+ read (impfpp,*)
+ read (impfpp,*,err=999,end=999 ) nbtrf
+
+! Boucle sur le nombre de transfo
+
+ do i=1,nbtrf
+
+! on saute la ligne de commentaire
+ read (impfpp,*)
+
+! Tension primaire
+ read (impfpp,*,err=999,end=999 ) tenspr(i)
+
+! Rapport du nombre de spires
+ read (impfpp,*,err=999,end=999 ) rnbs(i)
+
+! Impedances complexes
+ read (impfpp,*,err=999,end=999 ) zr(i),zi(i)
+
+! Type de branchement primaire
+ read (impfpp,*,err=999,end=999 ) ibrpr(i)
+
+! Type de branchement secondaire
+ read (impfpp,*,err=999,end=999 ) ibrsec(i)
+
+ enddo
+
+! ----- Nombre d'electrodes
+
+ read (impfpp,*)
+ read (impfpp,*)
+ read (impfpp,*,err=999,end=999 ) nbelec
+
+! Boucle sur le nombre d'electrodes
+
+ do i=1,nbelec
+
+! Tension primaire
+ read (impfpp,*,err=999,end=999 ) ielecc(i),ielect(i), &
+ ielecb(i)
+
+ enddo
+
+endif
+
+!==================================================
+! 4. LECTURE D'UN FICHIER MIGRATION IONIQUE
+!==================================================
+
+! c'est plus complique (chaque espece peut avoir sa propre mobilite)
+! mais il n'y a pas forcement de rayonnement, ni meme de
+! chauffage significatif par effet Joule
+
+!==============================================
+! 5. CALCULS DE DONNEES COMPLEMENTAIRES
+!==============================================
+
+
+return
+
+
+!============================
+! 3. SORTIE EN ERREUR
+!============================
+
+ 99 continue
+write ( nfecra,9998 )
+call csexit (1)
+!==========
+
+ 999 continue
+write ( nfecra,9999 )
+call csexit (1)
+!==========
+
+
+!--------
+! FORMATS
+!--------
+
+
+ 8000 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ELLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (VERSIONS ELECTRIQUES) ',/,&
+'@ ',/,&
+'@ Le nombre de points de tabulation lu dans le fichier de ',/,&
+'@ donnees doit etre un entier inferieur ou egal ',/,&
+'@ a NPOT = ',I10 ,/,&
+'@ Il vaut ici NPO = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8001 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ELLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (VERSIONS ELECTRIQUES) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes courantes lu dans le fichier de ',/,&
+'@ doit etre un entier inferieur ou egal ',/,&
+'@ a NGAZGM = ',I10 ,/,&
+'@ Il vaut ici NGAZG = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8002 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ELLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (VERSIONS ELECTRIQUES) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes courantes lu dans le fichier de ',/,&
+'@ doit etre un entier superieur ou egal a 1. ',/,&
+'@ Il vaut ici NGAZG = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8003 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ELLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (VERSIONS ELECTRIQUES) ',/,&
+'@ ',/,&
+'@ La valeur de l''indicateur pour le rayonnement ',/,&
+'@ doit etre comprise entre 0 et 2 ',/,&
+'@ elle vaut ici IXKABE = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9998 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ELLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (VERSIONS ELECTRIQUES) ',/,&
+'@ ',/,&
+'@ Erreur a l''ouverture du fichier parametrique. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (ELLECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (VERSIONS ELECTRIQUES) ',/,&
+'@ ',/,&
+'@ Erreur a la lecture du fichier parametrique. ',/,&
+'@ Le fichier a ete ouvert mais est peut etre incomplet ',/,&
+'@ ou son format inadapte. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+end
+
+
diff --git a/src/elec/elphyv.f90 b/src/elec/elphyv.f90
new file mode 100644
index 0000000..68c3391
--- /dev/null
+++ b/src/elec/elphyv.f90
@@ -0,0 +1,857 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine elphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! REMPLISSAGE DES VARIABLES PHYSIQUES : Version Electrique
+
+! ----> Effet Joule
+! ----> Arc Electrique
+! ----> Conduction Ionique
+
+! 1) Masse Volumique
+! 2) Viscosite moleculaire
+! 3) Cp
+! 4) Lambda/Cp moleculaire
+! 4) Diffusivite moleculaire
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+integer iel , iphas
+integer ipcrom, ipcvis, ipccp , ipcray
+integer ipcvsl, ith , iscal , ii
+integer iiii , ipcsig, it
+integer iesp , iesp1 , iesp2 , mode , isrrom
+integer maxelt, ils
+
+double precision tp , delt , somphi, val
+double precision alpro , alpvis, alpcp , alpsig, alplab , alpkab
+double precision rhonp1
+double precision ym (ngazgm),yvol (ngazgm)
+double precision coef(ngazgm,ngazgm)
+double precision roesp (ngazgm),visesp(ngazgm),cpesp(ngazgm)
+double precision sigesp(ngazgm),xlabes(ngazgm),xkabes(ngazgm)
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 0 - INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+
+iphas = 1
+
+! Sous relaxation de la masse volumique (pas au premier pas de temps)
+if(ntcabs.gt.1.and.srrom.gt.0.d0) then
+ isrrom = 1
+else
+ isrrom = 0
+endif
+
+!===============================================================================
+! 1 - EFFET JOULE
+!===============================================================================
+
+! -- Les lois doivent etre imposees par l'utilisateur
+! donc on ne fait rien.
+
+! IF ( IPPMOD(IELJOU).GE.1 ) THEN
+
+
+! -- Attention, dans les modules electriques, la chaleur massique, la
+! conductivite thermique et la conductivite electriques sont
+! toujours dans le tableau PROPCE
+! qu'elles soient physiquement variables ou non.
+
+! On n'utilisera donc PAS les variables
+! =====================
+! CP0(IPHAS), VISLS0(ISCALT(IPHAS))
+! VISLS0(IPOTR) et VISLS0(IPOTI)
+
+! Informatiquement, ceci se traduit par le fait que
+! ICP(IPHAS)>0, IVISLS(ISCALT(IPHAS))>0,
+! IVISLS(IPOTR)>0 et IVISLS(IPOTI)>0
+
+! Les verifications ont ete faites dans elveri
+
+! -- Si la conductivite electrique est toujours la meme pour
+! le potentiel reel et le potentiel imaginaire, on pourrait
+! n'en avoir qu'une seule (modif dans varpos pour definir
+! IVISLS(IPOTI) = IVISLS(IPOTR)) et economiser NCEL reels .
+
+! IPCROM = IPPROC(IROM(IPHAS))
+! IPCVIS = IPPROC(IVISCL(IPHAS))
+! IPCCP = IPPROC(ICP(IPHAS))
+! IPCVSL = IPPROC(IVISLS(ISCALT(IPHAS)))
+! IPCSIR = IPPROC(IVISLS(IPOTR))
+! IPCSII = IPPROC(IVISLS(IPOTI))
+
+! PROPCE(IEL,IPPROC(ITEMP)) =
+! PROPCE(IEL,IPCROM) =
+! PROPCE(IEL,IPCVIS) =
+! PROPCE(IEL,IPCCP) =
+! PROPCE(IEL,IPCVSL) =
+! PROPCE(IEL,IPCSIR) =
+! PROPCE(IEL,IPCSII) =
+
+! ENDIF
+
+!===============================================================================
+! 2 - ARC ELECTRIQUE
+!===============================================================================
+
+if ( ippmod(ielarc).ge.1 ) then
+
+! Un message une fois au moins pour dire
+! qu'on prend les valeurs sur fichier
+ if(ipass.eq.1) then
+ write(nfecra,1000)
+ endif
+
+! Calcul de la temperature a partir de l'enthalpie
+
+ mode = 1
+
+ if ( ngazg .eq. 1 ) then
+ ym(1) = 1.d0
+ mode = 1
+ do iel = 1, ncel
+ call elthht(mode,ngazg,ym,rtp(iel,isca(ihm)), &
+ propce(iel,ipproc(itemp)))
+ enddo
+ else
+ do iel = 1, ncel
+ ym(ngazg) = 1.d0
+ do iesp = 1, ngazg-1
+ ym(iesp) = rtp(iel,isca(iycoel(iesp)))
+ ym(ngazg) = ym(ngazg) - ym(iesp)
+ enddo
+ call elthht(mode,ngazg,ym,rtp(iel,isca(ihm)), &
+ propce(iel,ipproc(itemp)))
+ enddo
+ endif
+
+! Pointeurs pour les differentes variables
+
+ ipcrom = ipproc(irom(iphas))
+ ipcvis = ipproc(iviscl(iphas))
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp(iphas))
+ endif
+ if(ivisls(iscalt(iphas)).gt.0) then
+ ipcvsl = ipproc(ivisls(iscalt(iphas)))
+ endif
+ if ( ivisls(ipotr).gt.0 ) then
+ ipcsig = ipproc(ivisls(ipotr))
+ endif
+ if ( ixkabe .gt. 0 ) then
+ ipcray = ipproc(idrad)
+ endif
+
+! Interpolation des donnees sur le fichier de donnees
+! en fonction de la temperature
+
+ do iel = 1, ncel
+
+! Valeur de la temperature
+
+ tp = propce(iel,ipproc(itemp))
+
+! On determine le IT ou il faut interpoler
+
+ it = 0
+ if ( tp .le. th(1) ) then
+ it = 1
+ else if ( tp .ge. th(npo) ) then
+ it = npo
+ else
+ do iiii = 1, npo-1
+ if ( tp .gt. th(iiii) .and. tp .le. th(iiii+1) ) then
+ it = iiii
+ endif
+ enddo
+ endif
+ if ( it .eq. 0 ) then
+ write(nfecra,9900) tp
+ call csexit(1)
+ endif
+
+! Fraction massique
+
+ ym(ngazg) = 1.d0
+ do iesp = 1, ngazg-1
+ ym(iesp) = rtp(iel,isca(iycoel(iesp)))
+ ym(ngazg) = ym(ngazg) - ym(iesp)
+ enddo
+
+! Masse volumique, Viscosite, CP, Sigm et Lambda de chaque constituant
+
+ if ( tp .le. th(1) ) then
+
+! Extrapolation : Valeur constante = 1ere valeur de la table
+
+ do iesp = 1, ngazg
+ roesp (iesp) = rhoel (iesp,1)
+ visesp(iesp) = visel (iesp,1)
+ cpesp (iesp) = cpel (iesp,1)
+ sigesp(iesp) = sigel (iesp,1)
+ xlabes(iesp) = xlabel(iesp,1)
+ if ( ixkabe .gt. 0 ) then
+ xkabes(iesp) = xkabel(iesp,1)
+ endif
+ enddo
+
+ else if ( tp .ge. th(npo) ) then
+
+! Extrapolation : valeur constante = derniere valeur de la table
+
+ do iesp = 1, ngazg
+ roesp (iesp) = rhoel (iesp,npo)
+ visesp(iesp) = visel (iesp,npo)
+ cpesp (iesp) = cpel (iesp,npo)
+ sigesp(iesp) = sigel (iesp,npo)
+ xlabes(iesp) = xlabel(iesp,npo)
+ if ( ixkabe .gt. 0 ) then
+ xkabes(iesp) = xkabel(iesp,npo)
+ endif
+ enddo
+
+ else
+
+! Interpolation
+
+ delt = th(it+1) - th(it)
+ do iesp = 1, ngazg
+
+! Masse volumique de chaque constituant
+
+ alpro = (rhoel(iesp,it+1)-rhoel(iesp,it))/delt
+ roesp(iesp) = rhoel(iesp,it) + alpro*(tp-th(it))
+
+! Viscosite de chaque constituant
+
+ alpvis = (visel(iesp,it+1)-visel(iesp,it))/delt
+ visesp(iesp) = visel(iesp,it) + alpvis*(tp-th(it))
+
+! CP de chaque constituant
+
+ alpcp = (cpel(iesp,it+1)-cpel(iesp,it))/delt
+ cpesp(iesp) = cpel(iesp,it) + alpcp*(tp-th(it))
+
+! Conductivite electrique (Sigma) de chaque constituant
+
+ alpsig = (sigel(iesp,it+1)-sigel(iesp,it))/delt
+ sigesp(iesp) = sigel(iesp,it) + alpsig*(tp-th(it))
+
+! Conductivite thermique (Lambda) de chaque constituant
+
+ alplab = (xlabel(iesp,it+1)-xlabel(iesp,it))/delt
+ xlabes(iesp) = xlabel(iesp,it) + alplab*(tp-th(it))
+
+! Emission nette radiative ou Terme source radiatif
+! de chaque constituant
+
+ if ( ixkabe .gt. 0 ) then
+ alpkab = (xkabel(iesp,it+1)-xkabel(iesp,it))/delt
+ xkabes(iesp) = xkabel(iesp,it) + alpkab*(tp-th(it))
+ endif
+
+ enddo
+
+ endif
+
+! Masse volumique du melange (sous relaxee eventuellement)
+! ==========================
+
+ rhonp1 = 0.d0
+ do iesp = 1, ngazg
+ rhonp1 = rhonp1+ym(iesp)/roesp(iesp)
+ enddo
+ rhonp1 = 1.d0/rhonp1
+ if(isrrom.eq.1) then
+ propce(iel,ipcrom) = &
+ srrom*propce(iel,ipcrom)+(1.d0-srrom)*rhonp1
+ else
+ propce(iel,ipcrom) = rhonp1
+ endif
+
+! Fraction volumique de chaque constituant
+
+ do iesp = 1, ngazg
+ yvol(iesp) = ym(iesp)*roesp(iesp)/propce(iel,ipcrom)
+ if ( yvol(iesp) .le. 0.d0 ) yvol(iesp) = epzero**2
+ enddo
+
+! Viscosite moleculaire dynamique en kg/(m s)
+! ==========================================
+
+ do iesp1 = 1, ngazg
+ do iesp2 = 1, ngazg
+ coef(iesp1,iesp2) = ( 1.d0 &
+ + sqrt(visesp(iesp1)/visesp(iesp2)) &
+ *sqrt(sqrt(roesp(iesp2)/roesp(iesp1))))**2. &
+ / sqrt( 1.d0 + roesp(iesp1)/roesp(iesp2) ) &
+ / sqrt(8.d0)
+ enddo
+ enddo
+
+ propce(iel,ipcvis) = 0.d0
+ do iesp1=1,ngazg
+
+ somphi = 0.d0
+ do iesp2=1,ngazg
+ if ( iesp1 .ne. iesp2 ) then
+ somphi = somphi &
+ +coef(iesp1,iesp2)*yvol(iesp2)/yvol(iesp1)
+ endif
+ enddo
+
+ propce(iel,ipcvis) = propce(iel,ipcvis) &
+ +visesp(iesp1)/(1.d0+somphi)
+
+ enddo
+
+! Chaleur specifique J/(kg degres)
+! ================================
+
+ if(icp(iphas).gt.0) then
+
+ propce(iel,ipccp) = 0.d0
+ do iesp = 1, ngazg
+ propce(iel,ipccp) = propce(iel,ipccp ) &
+ +ym(iesp)*cpesp(iesp)
+ enddo
+
+ endif
+
+! Lambda/Cp en kg/(m s)
+! ---------------------
+
+ if(ivisls(iscalt(iphas)).gt.0) then
+
+ do iesp1=1,ngazg
+ do iesp2=1,ngazg
+ coef(iesp1,iesp2) = ( 1.d0 &
+ + sqrt(xlabes(iesp1)/xlabes(iesp2)) &
+ *sqrt(sqrt(roesp(iesp2)/roesp(iesp1))))**2.d0 &
+ / sqrt( 1.d0 + roesp(iesp1)/roesp(iesp2) ) &
+ / sqrt(8.d0)
+ enddo
+ enddo
+
+! On calcule d'abord juste Lambda
+
+ propce(iel,ipcvsl) = 0.d0
+ do iesp1=1,ngazg
+
+ somphi = 0.d0
+ do iesp2=1,ngazg
+ if ( iesp1 .ne. iesp2 ) then
+ somphi = somphi &
+ +coef(iesp1,iesp2)*yvol(iesp2)/yvol(iesp1)
+ endif
+ enddo
+
+ propce(iel,ipcvsl) = propce(iel,ipcvsl) &
+ +xlabes(iesp1)/(1.d0+1.065*somphi)
+
+ enddo
+
+! On divise par CP pour avoir Lambda/CP
+! On suppose Cp renseigne au prealable.
+
+ if(ipccp.le.0) then
+
+! --- Si CP est uniforme, on utilise CP0(IPHAS)
+
+ propce(iel,ipcvsl) = propce(iel,ipcvsl)/cp0(iphas)
+
+ else
+
+! --- Si CP est non uniforme, on utilise le CP calcul au dessus
+ propce(iel,ipcvsl) = propce(iel,ipcvsl)/propce(iel,ipccp)
+
+ endif
+ endif
+
+! Conductivite electrique en S/m
+! ==============================
+
+ if ( ivisls(ipotr).gt.0 ) then
+ propce(iel,ipcsig) = 0.d0
+ val = 0.d0
+ do iesp=1,ngazg
+ val = val + yvol(iesp)/sigesp(iesp)
+ enddo
+
+ propce(iel,ipcsig) = 1.d0/val
+ endif
+
+! Emission nette radiative en W/m3
+! ================================
+
+ if ( ixkabe .gt. 0 ) then
+ propce(iel,ipcray) = 0.d0
+ val = 0.d0
+ do iesp=1,ngazg
+ val = val + yvol(iesp)*xkabes(iesp)
+ enddo
+
+ propce(iel,ipcray) = val
+ endif
+
+ enddo
+
+! Diffusivite variable a l'exclusion de l'enthalpie et de IPOTR
+! -------------------------------------------------------------
+! Il n'y a pas d'autres scalaires, et la boucle ne fait donc rien
+
+
+ do ii = 1, nscapp
+
+! --- Numero du scalaire
+ iscal = iscapp(ii)
+
+! --- Si il s'agit de l'enthalpie son cas a deja ete traite plus haut
+ ith = 0
+ if (iscal.eq.iscalt(iphas)) ith = 1
+
+! --- Si il s'agit de Potentiel (IPOTR), son cas a deja ete traite
+ if (iscal.eq.ipotr) ith = 1
+
+! --- Si la variable est une fluctuation, sa diffusivite est
+! la meme que celle du scalaire auquel elle est rattachee :
+! il n'y a donc rien a faire ici : on passe directement
+! a la variable suivante sans renseigner PROPCE(IEL,IPCVSL).
+
+ if ( ith.eq.0 .and. iscavr(iscal).le.0) then
+
+! --- On ne traite ici que les variables non thermiques
+! et pas le potentiel (sigma)
+! et qui ne sont pas des fluctuations
+
+ if(ivisls(iscal).gt.0) then
+
+! --- Rang de Lambda du scalaire
+! dans PROPCE, prop. physiques au centre des elements : IPCVSL
+
+ ipcvsl = ipproc(ivisls(iscal))
+
+ do iel = 1, ncel
+ propce(iel,ipcvsl) = 1.d0
+ enddo
+
+ endif
+
+ endif
+
+ enddo
+
+endif
+
+!===============================================================================
+! 3 - CONDUCTION IONIQUE
+!===============================================================================
+
+! POUR LE MOMENT CETTE OPTION N'EST PAS ACTIVEE
+
+if ( ippmod(ielion).ge.1 ) then
+
+! Masse volumique
+! ---------------
+
+ ipcrom = ipproc(irom(iphas))
+ do iel = 1, ncel
+ propce(iel,ipcrom) = 1.d0
+ enddo
+
+! VISCOSITE
+! =========
+
+ ipcvis = ipproc(iviscl(iphas))
+ do iel = 1, ncel
+ propce(iel,ipcvis) = 1.d-2
+ enddo
+
+! CHALEUR SPECIFIQUE VARIABLE J/(kg degres)
+! =========================================
+
+ if(icp(iphas).gt.0) then
+
+ ipccp = ipproc(icp (iphas))
+
+ do iel = 1, ncel
+ propce(iel,ipccp ) = 1000.d0
+ enddo
+
+ endif
+
+! Lambda/CP VARIABLE en kg/(m s)
+! ===============================
+
+ if (ivisls(iscalt(iphas)).gt.0) then
+
+ ipcvsl = ipproc(ivisls(iscalt(iphas)))
+
+ if(ipccp.le.0) then
+
+! --- Si CP est uniforme, on utilise CP0(IPHAS)
+
+ do iel = 1, ncel
+ propce(iel,ipcvsl) = 1.d0/cp0(iphas)
+ enddo
+
+ else
+
+! --- Si CP est non uniforme, on utilise PROPCE ci dessus
+ do iel = 1, ncel
+ propce(iel,ipcvsl) = 1.d0 /propce(iel,ipccp)
+ enddo
+
+ endif
+
+ endif
+
+! DIFFUSIVITE VARIABLE A L'EXCLUSION DE L'ENTHALPIE
+! ==================================================
+
+ do ii = 1, nscapp
+
+! --- Numero du scalaire
+ iscal = iscapp(ii)
+
+! --- Si il s'agit de l'enthqlpie son cas a deja ete traite plus haut
+ ith = 0
+ if (iscal.eq.iscalt(iphas)) ith = 1
+
+! --- Si la variable est une fluctuation, sa diffusivite est
+! la meme que celle du scalaire auquel elle est rattachee :
+! il n'y a donc rien a faire ici : on passe directement
+! a la variable suivante sans renseigner PROPCE(IEL,IPCVSL).
+
+ if ( ith.eq.0 .and. iscavr(iscal).le.0) then
+
+! --- On ne traite ici que les variables non thermiques
+! et qui ne sont pas des fluctuations
+
+ if(ivisls(iscal).gt.0) then
+
+! --- Rang de Lambda du scalaire
+! dans PROPCE, prop. physiques au centre des elements : IPCVSL
+
+ ipcvsl = ipproc(ivisls(iscal))
+
+! --- Lambda en kg/(m s) au centre des cellules
+
+
+ do iel = 1, ncel
+ propce(iel,ipcvsl) = 1.d0
+ enddo
+
+ endif
+
+ endif
+
+ enddo
+
+endif
+
+!===============================================================================
+! 4 - ON PASSE LA MAIN A L'UTILISATEUR (joule en particulier)
+!===============================================================================
+
+maxelt = max(ncelet, nfac, nfabor)
+ils = idebia
+ifinia = ils + maxelt
+CALL IASIZE('ELPHYV',IFINIA)
+
+call uselph &
+!==========
+ ( ifinia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+
+
+! La masse volumique au bord est traitee dans phyvar (recopie de la valeur
+! de la cellule de bord).
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(/, &
+' Module electrique: proprietes physiques lues sur fichier',/)
+ 9900 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS ELPHYV (MODULE ELECTRIQUE) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Tabulation echoue avec une temperature TP = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/elec/elprop.f90 b/src/elec/elprop.f90
new file mode 100644
index 0000000..fcc70d6
--- /dev/null
+++ b/src/elec/elprop.f90
@@ -0,0 +1,263 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine elprop &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT POUR
+! LE MODULE ELECTRIQUE
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! -> ! numero de la derniere case utlisee !
+! ! ! ! dans ipproc, ipprob, ipprof !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp , ipppst
+
+! VARIABLES LOCALES
+
+integer iprop, idimve
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! Pointeurs dans propce (ca n'implique pas qu'on ne calcule pas
+! les variables non definies ici)
+
+iprop = ipropp
+
+! ---> Temperature en K
+
+iprop = iprop + 1
+itemp = iprop
+
+! ---> Puissance volumique dissipee par effet Joule W/m3
+
+iprop = iprop + 1
+iefjou = iprop
+
+! ---> Densite de courant electrique reelle A/m2
+
+do idimve = 1, ndimve
+ iprop = iprop + 1
+ idjr(idimve) = iprop
+enddo
+
+! Variables specifiques Effet Joule
+! =================================
+
+if ( ippmod(ieljou).eq.4 ) then
+
+! ---> Densite de courant electrique imaginaire A/m2
+
+ do idimve = 1, ndimve
+ iprop = iprop + 1
+ idji(idimve) = iprop
+ enddo
+
+endif
+
+
+! Variables specifiques Arc Electrique
+! ====================================
+
+if ( ippmod(ielarc).ge.1 ) then
+
+! ---> Forces electromagnetiques de Laplace en N/m3
+
+ do idimve = 1, ndimve
+ iprop = iprop + 1
+ ilapla(idimve) = iprop
+ enddo
+
+! ---> Puissance volumique rayonnee W/m3
+! ou coefficient d'absorption
+
+ if ( ixkabe .gt.0 ) then
+ iprop = iprop + 1
+ idrad = iprop
+ endif
+endif
+
+! Variables specifiques Conduction Ionique
+! ========================================
+
+if ( ippmod(ielion).ge.1 ) then
+
+! ---> Charge electrique volumique C/m3
+
+ iprop = iprop + 1
+ iqelec = iprop
+
+endif
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+nsalpp = iprop - ipropp
+nsalto = iprop
+
+! ---- On renvoie IPROPP au cas ou d'autres proprietes devraient
+! etre numerotees ensuite
+
+ipropp = iprop
+
+!===============================================================================
+! 2. POSITIONNEMENT DES PROPRIETES : PROPCE, PROPFB, PROPFA
+!===============================================================================
+
+! ---> Positionnement dans le tableau PROPCE
+
+iprop = nproce
+
+iprop = iprop + 1
+ipproc(itemp) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+iprop = iprop + 1
+ipproc(iefjou) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+do idimve = 1, ndimve
+ iprop = iprop + 1
+ ipproc(idjr(idimve)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+enddo
+
+if ( ippmod(ieljou).eq.4 ) then
+
+! ---> Densite de courant electrique imaginaire A/m2
+
+ do idimve = 1, ndimve
+ iprop = iprop + 1
+ ipproc(idji(idimve)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ enddo
+
+endif
+
+if ( ippmod(ielarc).ge.1 ) then
+
+ do idimve = 1, ndimve
+ iprop = iprop + 1
+ ipproc(ilapla(idimve)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ enddo
+
+ if ( ixkabe .gt. 0 ) then
+ iprop = iprop + 1
+ ipproc(idrad) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+ endif
+
+endif
+
+if ( ippmod(ielion).ge.1 ) then
+
+! ---> Charge electrique volumique C/m3
+
+ iprop = iprop + 1
+ ipproc(iqelec) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+endif
+
+nproce = iprop
+
+
+!===============================================================================
+! 3. POSITIONNEMENT DES PROPRIETES : PROPFB, PROPFA
+!===============================================================================
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+ iprop = nprofb
+ nprofb = iprop
+
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+ iprop = nprofa
+ nprofa = iprop
+
+return
+end
diff --git a/src/elec/elthht.f90 b/src/elec/elthht.f90
new file mode 100644
index 0000000..4ead423
--- /dev/null
+++ b/src/elec/elthht.f90
@@ -0,0 +1,210 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine elthht &
+!================
+
+ ( mode , nesp , yesp , enthal , temper )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCULE L'ENTHALPIE OU LA TEMPERATURE A PARTIR DE LA
+! COMPOSITION ET DE LA VALEUR DE LA TEMPERATURE OU DE
+! ENTHALPIE
+! SPECIFIQUE AU MODULE ELECTRIQUE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! mode ! e ! <-- ! -1 : t -> h ; 1 : h -> t !
+! nesp ! e ! <-- ! nb de constituants !
+! yesp ! tr ! <-- ! fraction massique des constituants !
+! enthal ! r ! <-- ! enthalpie !
+! temper ! r ! <-- ! temperature !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppthch.h"
+include "elincl.h"
+
+!===============================================================================
+
+
+! Arguments
+
+integer mode , nesp
+
+double precision enthal , temper , yesp(nesp)
+
+
+! VARIABLES LOCALES
+
+integer it , iesp
+
+double precision eh1 , eh0
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCUL DE L'ENTHALPIE A PARTIR DE LA TEMPERATURE
+!===============================================================================
+
+if ( mode.eq.-1 ) then
+
+ it=npo
+ if (temper.ge.th(it)) then
+ enthal = 0
+ do iesp=1,nesp
+ enthal = enthal + yesp(iesp)*ehgazg(iesp,it)
+ enddo
+ return
+ endif
+
+ it=1
+ if (temper.le.th(it)) then
+ enthal = 0
+ do iesp=1,nesp
+ enthal = enthal + yesp(iesp)*ehgazg(iesp,it)
+ enddo
+ return
+ endif
+
+ 10 continue
+ it=it+1
+ if (temper.le.th(it)) then
+ eh0 = 0
+ eh1 = 0
+ do iesp=1,nesp
+ eh0 = eh0 + yesp(iesp)*ehgazg(iesp,it-1)
+ eh1 = eh1 + yesp(iesp)*ehgazg(iesp,it)
+ enddo
+ enthal=eh0+(eh1-eh0)*(temper-th(it-1)) &
+ /(th(it)-th(it-1))
+ return
+ endif
+ goto 10
+
+
+!===============================================================================
+! 2. CALCUL DE LA TEMPERATURE A PARTIR DE l'ENTHALPIE
+!===============================================================================
+
+else if ( mode.eq.1 ) then
+
+ it = npo
+ eh1 = 0
+ do iesp=1,nesp
+ eh1 = eh1+yesp(iesp)*ehgazg(iesp,it)
+ enddo
+ if ( enthal .ge. eh1 ) then
+ temper = th (it)
+ return
+ endif
+
+ it = 1
+ eh1 = 0
+ do iesp=1,nesp
+ eh1 = eh1+yesp(iesp)*ehgazg(iesp,it)
+ enddo
+ if ( enthal .le. eh1 ) then
+ temper = th (it)
+ return
+ endif
+
+ 20 continue
+ it = it+1
+ eh0 = eh1
+ eh1 = 0
+ do iesp=1,nesp
+ eh1 = eh1+yesp(iesp)*ehgazg(iesp,it)
+ enddo
+ if ( enthal .le. eh1 ) then
+ temper = th(it-1)+ (enthal-eh0) &
+ *(th(it)-th(it-1))/(eh1-eh0)
+ return
+ endif
+ goto 20
+
+
+else
+
+ write(nfecra,1000) mode
+ call csexit (1)
+ !==========
+
+
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS ELTHHT ',/,&
+'@ ========= ',/,&
+'@ VALEUR INCORRECTE DE L''ARGUMENT MODE ',/,&
+'@ CE DOIT ETRE UN ENTIER EGAL A 1 OU -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/elec/eltssc.f90 b/src/elec/eltssc.f90
new file mode 100644
index 0000000..5e65df8
--- /dev/null
+++ b/src/elec/eltssc.f90
@@ -0,0 +1,404 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine eltssc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ izfppp , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE POUR LE MODULE ELECTRIQUE
+! CALCUL DES TERMES SOURCE ELECTRIQUES POUR L'ENTHALPIE
+! CALCUL DES TERMES SOURCES POUR LE POTENTIEL VECTEUR
+
+! ATTENTION : LE TRAITEMENT DES TERMES SOURCES EST DIFFERENT
+! --------- DE CELUI DE USTSSC.F
+
+! ON RESOUT ROVSDT*D(VAR) = SMBRS
+
+! ROVSDT ET SMBRS CONTIENNENT DEJA D'EVENTUELS TERMES SOURCES
+! UTILISATEUR. IL FAUT DONC LES INCREMENTER ET PAS LES
+! ECRASER
+
+! POUR DES QUESTIONS DE STABILITE, ON NE RAJOUTE DANS ROVSDT
+! QUE DES TERMES POSITIFS. IL N'Y A PAS DE CONTRAINTE POUR
+! SMBRS
+
+! DANS LE CAS D'UN TERME SOURCE EN CEXP + CIMP*VAR ON DOIT
+! ECRIRE :
+! SMBRS = SMBRS + CEXP + CIMP*VAR
+! ROVSDT = ROVSDT + MAX(-CIMP,ZERO)
+
+! ON FOURNIT ICI ROVSDT ET SMBRS (ILS CONTIENNENT RHO*VOLUME)
+! SMBRS en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! ROVSDT en kg /s
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , iel
+integer ipcdc1, ipcdc2, ipcdc3
+integer ipcefj
+double precision valmin,valmax
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES ET VARIABLES STANDARD ET
+! COMMUNES A TOUTES LES VERSIONS ELECTRIQUES : EFFET JOULE, E, J
+! CAS IELJOU >= 1 ou IELARC >= 1 ou IELION >= 1
+!===============================================================================
+
+! 2.1 Terme source pour l'enthalpie :
+! ----------------------------------
+
+if ( ivar.eq.isca(ihm) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ ipcefj = ipproc(iefjou)
+
+! Pour eviter de prendre en compte des TS trop violents
+! sur les premiers pas de temps (gradient sur le potentiel)
+! on ne prend en compte les termes sources qu'a partir du
+! troisieme pas de temps. Sinon on laisse ROVSDT et SMBRS
+! inchanges (pas de TS si ce n'est ceux de ustssc)
+
+ if ( ntcabs .ge. 3 ) then
+ do iel = 1, ncel
+ w1(iel) = propce(iel,ipcefj)*volume(iel)
+ enddo
+
+! Arc electrique : rajout du TS radiatif si l'utilisateur
+! l'a donne dans le fichier dp_elec (purement explicite)
+
+ if( ippmod(ielarc).ge. 1 ) then
+ if ( ixkabe .eq. 2 ) then
+ do iel = 1, ncel
+ w1(iel) = w1(iel) &
+ -propce(iel,ipproc(idrad))*volume(iel)
+ enddo
+ endif
+ endif
+
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + w1(iel)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ enddo
+
+ if (iwarni(ivar).ge.2) then
+ valmin = w1(1)
+ valmax = w1(1)
+ do iel = 1, ncel
+ valmin = min(valmin,w1(iel))
+ valmax = max(valmax,w1(iel))
+ enddo
+ if (irangp.ge.0) then
+ call parmax(valmax)
+ call parmin(valmin)
+ endif
+ write(nfecra,2000) valmin,valmax
+ endif
+ endif
+endif
+
+ 2000 format( &
+ ' Termes Sources sur H min= ',E14.5,', max= ',E14.5)
+ 2010 format(/, &
+ ' Termes Sources sur H : pour eviter les debuts de calcul ',/, &
+ ' trop violents, on ne prend en compte les termes sources',/, &
+ ' d''effet Joule qu''a partir du troisieme pas de temps. ',/)
+
+! 2.1 Terme source pour les composantes potentiel vecteur : ARC ELECTRIQUE
+! ---------------------------------------------------------
+
+if( ippmod(ielarc).ge. 2 ) then
+
+
+! --> Terme source pour les composantes potentiel vecteur
+!============================================================
+
+ if ( ivar .eq. isca(ipotva(1)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ ipcdc1 = ipproc(idjr(1))
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + &
+ permvi*propce(iel,ipcdc1)*volume(iel)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ enddo
+
+ else if ( ivar .eq. isca(ipotva(2)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ ipcdc2 = ipproc(idjr(2))
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + &
+ permvi*propce(iel,ipcdc2)*volume(iel)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ enddo
+
+ else if ( ivar .eq. isca(ipotva(3)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ ipcdc3 = ipproc(idjr(3))
+ do iel = 1, ncel
+ smbrs(iel) = smbrs(iel) + &
+ permvi*propce(iel,ipcdc3)*volume(iel)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+ enddo
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+' Calcul des termes sources pour la variable : ',A8 )
+
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/elec/elvarp.f90 b/src/elec/elvarp.f90
new file mode 100644
index 0000000..56345d0
--- /dev/null
+++ b/src/elec/elvarp.f90
@@ -0,0 +1,170 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine elvarp
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES POUR LE MODULE ELECTRIQUE
+! REMPLISSAGE DES PARAMETRES (DEJA DEFINIS) POUR LES SCALAIRES PP
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer is, iesp , idimve, isc, iphas
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! 1.0 Dans toutes les versions electriques
+! ========================================
+
+! ---- Enthalpie
+is = 1
+ihm = iscapp(is)
+
+! ---- Potentiel reel
+is = is+1
+ipotr = iscapp(is)
+
+! 1.1 Effet Joule (cas potentiel imaginaire)
+! ==========================================
+
+if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+
+! ---- Potentiel imaginaire
+ is = is+1
+ ipoti = iscapp(is)
+
+endif
+
+! 1.2 Arc electrique
+! ==================
+
+if ( ippmod(ielarc).ge.2 ) then
+
+! ---- Potentiel vecteur
+ do idimve = 1, ndimve
+ is = is+1
+ ipotva(idimve) = iscapp(is)
+ enddo
+endif
+
+! 1.3 Conduction ionique
+! ======================
+
+
+! 1.4 Dans toutes les versions electriques
+! ========================================
+
+! ---- Fractions massiques des constituants
+
+if ( ngazg .gt. 1 ) then
+ do iesp = 1, ngazg-1
+ is = is+1
+ iycoel(iesp)=iscapp(is)
+ enddo
+endif
+
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+! A RENSEIGNER OBLIGATOIREMENT (sinon pb dans varpos)
+! IPHSCA, IVISLS, ICP
+!===============================================================================
+
+do isc = 1, nscapp
+
+ if ( iscavr(iscapp(isc)).le.0 ) then
+
+! ---- Notre physique particuliere est monophasique
+ iphsca(iscapp(isc)) = 1
+
+! ---- Viscosite dynamique moleculaire variable pour les
+! scalaires ISCAPP(ISC)
+! Pour l'enthalpie en particulier.
+! Pour le potentiel vecteur, voir plus bas
+ ivisls(iscapp(isc)) = 1
+
+ endif
+
+enddo
+
+! ---- "Viscosite dynamique moleculaire" = 1
+! pour le potentiel vecteur en Arc
+if ( ippmod(ielarc).ge.2 ) then
+ do idimve = 1, ndimve
+ ivisls(ipotva(idimve)) = 0
+ enddo
+endif
+
+! ---- Cp est variable ; pas sur que ce soit indispensable pour le verre
+! mais pour le moment c'est comme ca.
+iphas = iphsca(ihm)
+icp(iphas) = 1
+
+return
+end
+
diff --git a/src/elec/elveri.f90 b/src/elec/elveri.f90
new file mode 100644
index 0000000..e5c3cee
--- /dev/null
+++ b/src/elec/elveri.f90
@@ -0,0 +1,542 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine elveri &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL POUR LE MODULE ELECTRIQUE
+! APRES INTERVENTION UTILISATEUR (COMMONS)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+integer iphas , imono , ntf
+
+!===============================================================================
+
+! --> Verifications tardives ...
+if( ippmod(ielarc).ne.-1.and.ippmod(ielarc).ne.2) then
+ write(nfecra,1000)ippmod(ielarc)
+ iok = iok + 1
+endif
+if( ippmod(ieljou).ne.-1.and.ippmod(ieljou).ne.1.and. &
+ ippmod(ieljou).ne.2.and. &
+ ippmod(ieljou).ne.3.and. &
+ ippmod(ieljou).ne.4 ) then
+ write(nfecra,1001)ippmod(ieljou)
+ iok = iok + 1
+endif
+if( ippmod(ielion).ne.-1) then
+ write(nfecra,1002)ippmod(ielion)
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 2. OPTIONS DU CALCUL : TABLEAUX DE ppincl.h
+! elincl.h
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+if( srrom.lt.0.d0 .or. srrom.ge.1.d0) then
+ WRITE(NFECRA,2000)'SRROM ', SRROM
+ iok = iok + 1
+endif
+
+! --> Recalage des variables electriques
+if( ielcor.ne.0 .and. ielcor.ne.1) then
+ WRITE(NFECRA,2001)'IELCOR', IELCOR
+ iok = iok + 1
+endif
+
+! --> Si on recale
+if( ielcor.eq.1) then
+
+! -- en arc
+ if(ippmod(ielarc).ge.1) then
+! Intensite de courant imposee
+ if( couimp.lt.0.d0 ) then
+ WRITE(NFECRA,2002)'COUIMP', COUIMP
+ iok = iok + 1
+ endif
+! Difference de potentiel initiale imposee
+ if( dpot .lt.0.d0 ) then
+ WRITE(NFECRA,2002)'DPOT ', DPOT
+ iok = iok + 1
+ endif
+ endif
+
+! -- en Joule
+ if( ippmod(ieljou).ge.1) then
+! Puissance dissipee imposee
+ if( puisim.lt.0.d0 ) then
+ WRITE(NFECRA,2002)'PUISIM', PUISIM
+ iok = iok + 1
+ endif
+! Coefficient multiplicatif correcteur initial
+ if( coejou.lt.0.d0 ) then
+ WRITE(NFECRA,2002)'COEJOU', COEJOU
+ iok = iok + 1
+ endif
+! IF( ABS(COEJOU-1.D0).GT.EPZERO ) THEN
+! WRITE(NFECRA,2003)'COEJOU', COEJOU
+! IOK = IOK + 1
+! ENDIF
+! Difference de potentiel initiale imposee
+ if( dpot .lt.0.d0 ) then
+ WRITE(NFECRA,2002)'DPOT ', DPOT
+ iok = iok + 1
+ endif
+ endif
+
+endif
+
+! --> Rho et viscosite variables
+iphas = 1
+if(irovar(iphas).ne.1) then
+ write(nfecra,2010)irovar(iphas)
+ iok = iok + 1
+endif
+if(ivivar(iphas).ne.1) then
+ write(nfecra,2011)ivivar(iphas)
+ iok = iok + 1
+endif
+
+! --> Cp et visls (ihm) variables
+iphas = 1
+if(icp(iphas).le.0) then
+ WRITE(NFECRA,2012)' ICP(1)', ICP(IPHAS), &
+ ' ICP(1)','la chaleur massique ', &
+ ' ICP(1)'
+ iok = iok + 1
+endif
+if(ivisls(ihm).le.0) then
+ WRITE(NFECRA,2012)' IVISLS(IHM)', IVISLS(IHM), &
+ ' IVISLS(IHM)','la propriete lambda/Cp ', &
+ ' IVISLS(IHM)'
+ iok = iok + 1
+endif
+
+! --> Conductivites electriques variables
+! Pour le potentiel reel
+if(ivisls(ipotr).le.0) then
+ WRITE(NFECRA,2012)'IVISLS(IPOTR)', IVISLS(IPOTR), &
+ 'IVISLS(IPOTR)','la cond. elec. reelle ', &
+ 'IVISLS(IPOTR)'
+ iok = iok + 1
+endif
+! Pour le potentiel imaginaire (Joule)
+if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4 ) then
+ if(ivisls(ipoti).le.0) then
+ WRITE(NFECRA,2012)'IVISLS(IPOTI)', IVISLS(IPOTI), &
+ 'IVISLS(IPOTI)','la cond. elec. imag. ', &
+ 'IVISLS(IPOTI)'
+ iok = iok + 1
+ endif
+endif
+
+! --> verif option sur les transfos
+
+if(ippmod(ieljou).eq.3 .or. ippmod(ieljou).eq.4 ) then
+
+ imono = 1
+ do ntf=1,nbtrf
+
+ if ( ibrpr(ntf) .ne. 2 .or. &
+ ibrsec(ntf).ne. 2 ) then
+ imono = 0
+ endif
+ enddo
+
+ if ( imono .eq. 1 .and. ippmod(ieljou).ne.3 ) then
+ write(nfecra,2020)
+ iok = iok + 1
+ endif
+
+ if ( imono .eq. 0 .and. ippmod(ieljou).ne.4 ) then
+ write(nfecra,2021)
+ iok = iok + 1
+ endif
+endif
+
+! ---> verif rayonnement/Arc electrique
+
+
+if ( ippmod(ielarc).ge.1 .and. ixkabe.eq.2 .and. iirayo.gt.0 ) then
+ write(nfecra,2022)
+ iok = iok + 1
+endif
+
+if ( ippmod(ielarc).ge.1 .and. ixkabe.ne.1 .and. iirayo.gt.0 ) then
+ write(nfecra,2023)
+ iok = iok + 1
+endif
+
+
+
+!===============================================================================
+! 5. FORMATS VERIFICATION
+!===============================================================================
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ IPPMOD(IELARC) NE PEUT PRENDRE QUE LES VALEURS -1 ET 2 ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ IPPMOD(IELARC) = -1 : module arc electrique desactive ',/,&
+'@ = 2 : module arc electrique 3D ',/,&
+'@ avec equation sur le potentiel vecteur A ',/,&
+'@ ',/,&
+'@ Aucune autre valeur n''est permise. En ',/,&
+'@ particulier, la version avec calcul de B',/,&
+'@ par le theoreme d''Ampere n''est pas ',/,&
+'@ disponible. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ IPPMOD(IELJOU) NE PEUT PRENDRE QUE LES VALEURS -1, 1 ET 2 ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ IPPMOD(IELJOU) = -1 : module Joule desactive ',/,&
+'@ = 1 : module Joule avec potentiel reel ',/,&
+'@ = 2 : module Joule avec potentiel complexe',/,&
+'@ ',/,&
+'@ Aucune autre valeur n''est permise. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ IPPMOD(IELION) NE PEUT PRENDRE QUE LA VALEUR -1 ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ IPPMOD(IELION) = -1 : module mobilite ionique desactive ',/,&
+'@ ',/,&
+'@ Aucune autre valeur n''est permise. ',/,&
+'@ Le module n''est pas disponible. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usppmo. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ ',A6,' DOIT ETRE UN REEL SUPERIEUR OU EGAL A ZERO ET ',/,&
+'@ INFERIEUR STRICTEMENT A 1. ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier useli1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ ',A6,' DOIT ETRE UN ENTIER COMPRIS EGAL A 0 OU 1 ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier useli1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ ',A6,' DOIT ETRE UN REEL STRICTEMENT POSITIF ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier useli1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+!2003 format(
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/,
+! &'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,
+! &'@ ========= ',/,
+! &'@ MODULE ELECTRIQUE ',/,
+! &'@ ',/,
+! &'@ ',A6,' DOIT ETRE UN REEL EGAL A 1 ',/,
+! &'@ ',/,
+! &'@ IL VAUT ICI ',E14.5 ,/,
+! &'@ ',/,
+! &'@ Le calcul ne peut etre execute. ',/,
+! &'@ ',/,
+! &'@ Verifier useli1. ',/,
+! &'@ ',/,
+! &'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,
+! &'@ ',/)
+
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ IROVAR(1) DOIT ETRE UN ENTIER EGAL A 1 ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IROVAR = 1 indique que la masse volumique est ',/,&
+'@ variable. Elle est donnee par une loi dans uselph ou ',/,&
+'@ par fichier de donnees. ',/,&
+'@ IROVAR ne doit pas etre modifie par l''utilisateur ',/,&
+'@ lorsque le module electrique est active. ',/,&
+'@ ',/,&
+'@ Verifier useli1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ IVIVAR(1) DOIT ETRE UN ENTIER EGAL A 1 ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ IVIVAR = 1 indique que la viscosite moleculaire est ',/,&
+'@ variable. Elle est donnee par une loi dans uselph ou ',/,&
+'@ par fichier de donnees. ',/,&
+'@ IVIVAR ne doit pas etre modifie par l''utilisateur ',/,&
+'@ lorsque le module electrique est active. ',/,&
+'@ ',/,&
+'@ Verifier useli1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ ',A13, ' DOIT ETRE UN ENTIER STRICTEMENT POSITIF ',/,&
+'@ ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ ',A13, ' > 0 indique que ',A26 ,/,&
+'@ est variable. Elle est donnee par une loi dans uselph ou',/,&
+'@ par fichier de donnees. ',/,&
+'@ ',A13, ' ne doit pas etre modifie par ',/,&
+'@ l''utilisateur lorsque le module electrique est active. ',/,&
+'@ ',/,&
+'@ Verifier useli1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ Tout vos branchements sont mono et vous avez choisi ',/,&
+'@ un Type d''ecoulement avec transport du potentiel ',/,&
+'@ imaginaire ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Verifier usppmo et votre fichier dp_elec ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ Certains de vos branchements ne sont pas mono et ',/,&
+'@ vous avez choisis un Type d''ecoulement sans ',/,&
+'@ transport du potentiel imaginaire ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Verifier usppmo et votre fichier dp_elec ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2022 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ VOUS NE POUVEZ PAS ACTIVER LE MODULE RAYONNEMENT ',/,&
+'@ ET INTRODUIRE UN TERME SOURCE RADIATIF DANS LE ',/,&
+'@ FICHIER DP_ELEC ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Verifier votre fichier dp_elec ou desactiver le module ',/,&
+'@ rayonnement ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2023 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ POUR ACTIVER LE MODULE RAYONNEMENT AVEC LE MODULE ',/,&
+'@ ARC ELECTRIQUE IL FAUT DONNER LE COEFFICIENT ',/,&
+'@ D''ABSORPTION DANS LE FICHIER DP_ELEC ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Verifier votre fichier dp_elec ou desactiver le module ',/,&
+'@ rayonnement ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 6. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/fuel/Makefile.am b/src/fuel/Makefile.am
new file mode 100644
index 0000000..4320407
--- /dev/null
+++ b/src/fuel/Makefile.am
@@ -0,0 +1,80 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/fuel/fuincl.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcsfuel.la
+libcsfuel_la_SOURCES = \
+fucym1.f90 \
+fucyno.f90 \
+fuflux.f90 \
+fuini1.f90 \
+fuiniv.f90 \
+fulecd.f90 \
+fupdfr.f90 \
+fuphy1.f90 \
+fuphy2.f90 \
+fuphyv.f90 \
+fuprop.f90 \
+fuptcl.f90 \
+furays.f90 \
+futeh1.f90 \
+futeh2.f90 \
+futhp1.f90 \
+futhp2.f90 \
+futssc.f90 \
+futsvc.f90 \
+futsvi.f90 \
+fuvarp.f90 \
+fuveri.f90 \
+memfu1.f90
+libcsfuel_la_LDFLAGS = -no-undefined
+
+libcsfuel_la_SOURCES += \
+$(top_srcdir)/users/fuel/usfucl.f90 \
+$(top_srcdir)/users/fuel/usfui1.f90 \
+$(top_srcdir)/users/fuel/usfuiv.f90
+
+fueldir = $(pkgdatadir)/users/fuel
+fuel_DATA = \
+$(top_srcdir)/users/fuel/usfucl.f90 \
+$(top_srcdir)/users/fuel/usfui1.f90 \
+$(top_srcdir)/users/fuel/usfuiv.f90
diff --git a/src/fuel/Makefile.in b/src/fuel/Makefile.in
new file mode 100644
index 0000000..06aa689
--- /dev/null
+++ b/src/fuel/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/fuel
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcsfuel_la_LIBADD =
+am_libcsfuel_la_OBJECTS = fucym1.lo fucyno.lo fuflux.lo fuini1.lo \
+ fuiniv.lo fulecd.lo fupdfr.lo fuphy1.lo fuphy2.lo fuphyv.lo \
+ fuprop.lo fuptcl.lo furays.lo futeh1.lo futeh2.lo futhp1.lo \
+ futhp2.lo futssc.lo futsvc.lo futsvi.lo fuvarp.lo fuveri.lo \
+ memfu1.lo usfucl.lo usfui1.lo usfuiv.lo
+libcsfuel_la_OBJECTS = $(am_libcsfuel_la_OBJECTS)
+libcsfuel_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcsfuel_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcsfuel_la_SOURCES)
+DIST_SOURCES = $(libcsfuel_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(fueldir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+fuelDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(fuel_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/fuel/fuincl.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcsfuel.la
+libcsfuel_la_SOURCES = fucym1.f90 fucyno.f90 fuflux.f90 fuini1.f90 \
+ fuiniv.f90 fulecd.f90 fupdfr.f90 fuphy1.f90 fuphy2.f90 \
+ fuphyv.f90 fuprop.f90 fuptcl.f90 furays.f90 futeh1.f90 \
+ futeh2.f90 futhp1.f90 futhp2.f90 futssc.f90 futsvc.f90 \
+ futsvi.f90 fuvarp.f90 fuveri.f90 memfu1.f90 \
+ $(top_srcdir)/users/fuel/usfucl.f90 \
+ $(top_srcdir)/users/fuel/usfui1.f90 \
+ $(top_srcdir)/users/fuel/usfuiv.f90
+libcsfuel_la_LDFLAGS = -no-undefined
+fueldir = $(pkgdatadir)/users/fuel
+fuel_DATA = \
+$(top_srcdir)/users/fuel/usfucl.f90 \
+$(top_srcdir)/users/fuel/usfui1.f90 \
+$(top_srcdir)/users/fuel/usfuiv.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/fuel/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/fuel/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcsfuel.la: $(libcsfuel_la_OBJECTS) $(libcsfuel_la_DEPENDENCIES)
+ $(libcsfuel_la_LINK) $(libcsfuel_la_OBJECTS) $(libcsfuel_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+usfucl.lo: $(top_srcdir)/users/fuel/usfucl.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usfucl.lo `test -f '$(top_srcdir)/users/fuel/usfucl.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/fuel/usfucl.f90
+
+usfui1.lo: $(top_srcdir)/users/fuel/usfui1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usfui1.lo `test -f '$(top_srcdir)/users/fuel/usfui1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/fuel/usfui1.f90
+
+usfuiv.lo: $(top_srcdir)/users/fuel/usfuiv.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usfuiv.lo `test -f '$(top_srcdir)/users/fuel/usfuiv.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/fuel/usfuiv.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-fuelDATA: $(fuel_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(fueldir)" || $(MKDIR_P) "$(DESTDIR)$(fueldir)"
+ @list='$(fuel_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(fuelDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(fueldir)/$$f'"; \
+ $(fuelDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(fueldir)/$$f"; \
+ done
+
+uninstall-fuelDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(fuel_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(fueldir)/$$f'"; \
+ rm -f "$(DESTDIR)$(fueldir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(fueldir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-fuelDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-fuelDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-fuelDATA \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-saturneincludeHEADERS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-fuelDATA \
+ uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/fuel/fucym1.f90 b/src/fuel/fucym1.f90
new file mode 100644
index 0000000..255a3ed
--- /dev/null
+++ b/src/fuel/fucym1.f90
@@ -0,0 +1,680 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine fucym1 &
+!================
+
+ ( ncelet , ncel , &
+ indpdf , &
+ rtp , &
+ f1m , f3m , f4m , f1cl , f3cl , f4cl , &
+ f4m1 , f4m2 , d4cl , d4f4 , hrec , &
+ fuel1 , fuel3 , oxyd , prod1 , prod2 , &
+ xiner , xh2s , xso2 , f4s3no )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES CONCENTRATIONS GAZEUSES MOYENNES
+! VALEURS CELLULES
+! ----------------
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! fvap ! tr ! <-- ! moyenne du traceur 1 mvl [fovm+co] !
+! fhet ! tr ! -> ! moyenne du traceur 3 c h�terog�ne !
+! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
+! indpdf ! te ! <-- ! passage par les pdf !
+! fuel1 ! tr ! <- ! fraction massique fovm !
+! fuel3 ! tr ! <- ! fraction massique co !
+! oxyd ! tr ! <- ! fraction massique o2 !
+! prod1 ! tr ! <- ! fraction massique co2 !
+! prod2 ! tr ! <- ! fraction massique h2o !
+! xiner ! tr ! <- ! fraction massique n2 !
+! xh2s ! tr ! <- ! fraction massique h2s !
+! xso2 ! tr ! <- ! fraction massique so2 !
+! f4m1 ! tr ! <-- ! borne minimum !
+! f4m2 ! tr ! <-- ! borne max !
+! d4cl ! tr ! <-- ! amplitude du pic de dirac en f4cl !
+! d4f4 ! tr ! <-- ! amplitude du pic de dirac en 1 !
+! ! ! ! (air pur) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer indpdf(ncelet)
+
+double precision rtp(ncelet,*)
+double precision f1m(ncelet) , f3m(ncelet) , f4m(ncelet)
+double precision f1cl(ncelet), f3cl(ncelet) , f4cl(ncelet)
+
+double precision f4m1(ncelet) , f4m2(ncelet) , d4cl(ncelet)
+double precision d4f4(ncelet) , hrec(ncelet)
+
+double precision fuel1(ncelet), fuel3(ncelet)
+double precision oxyd(ncelet) , prod1(ncelet), prod2(ncelet)
+double precision xiner(ncelet)
+double precision xh2s(ncelet) , xso2(ncelet)
+double precision f4s3no(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel, icla
+
+integer n1 , n2 , n3 , n4 , n5 , n6 , n7 , n8 , n9
+integer n10, n11
+integer nbrint
+parameter (nbrint = 11)
+integer inttmp(nbrint)
+
+double precision wmfov , wmco , wmco2 , wmh2o
+double precision wmo2 , wmn2 , wmc
+double precision wmh2s , wmso2
+
+double precision anu1 , anu2 , anu3
+double precision somm
+
+double precision zfov0 , zco0 , zco20
+double precision zn20 , zh2o0 , zo20
+double precision zfov1 , zco1 , zco21
+double precision zn21 , zh2o1 , zo21
+double precision zfov2 , zco2 , zco22
+double precision zn22 , zh2o2 , zo22
+double precision zfov3 , zco3 , zco23
+double precision zn23 , zh2o3 , zo23
+double precision reac1 , reac2 , reac3
+
+! Variables pour le support de la Pdf et sa description
+
+double precision zzcl(8),zzs1(8),zzs2(8),zzs3(8),zzf4(8)
+double precision zz(8)
+
+integer ii
+double precision bb1,bb2
+double precision zh2s0,zh2s1,zh2s2,zh2s3
+double precision zso20,zso21,zso22,zso23
+double precision f4s1,f4s2,f4s3,zco2t
+double precision x2t
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Masses molaires
+
+wmco = wmole(ico )
+wmo2 = wmole(io2 )
+wmco2 = wmole(ico2 )
+wmh2o = wmole(ih2o )
+wmn2 = wmole(in2)
+wmfov = wmole(ifov)
+wmh2s = wmole(ih2s)
+wmso2 = wmole(iso2)
+
+wmc = wmolat(iatc)
+
+
+! --- Calcul des coefficient relatifs a l'expression de
+! ZCHx1m0, ZCO0, ZO20 et ZN20
+! fonctions de F1, F3 et F4
+
+! Rappel : 1 = vapeur de fuel, 2 = non utilis�
+! 3 = C sous forme CO provenant de l'oxydation du coke
+! 4 = air
+
+! ---- Initialisation des fractions massiques avec de l'air
+
+do iel = 1, ncel
+ fuel1(iel) = zero
+ fuel3(iel) = zero
+ oxyd(iel) = wmo2*ao2f4
+ prod1(iel) = zero
+ prod2(iel) = zero
+ xiner(iel) = wmn2*an2f4
+ xh2s (iel) = zero
+ xso2 (iel) = zero
+enddo
+
+! ANU1 : nb de moles d'oxyg�ne pour convertir
+! une mole de FOV en CO et H2O
+
+anu1 = 0.5d0+0.25d0*nhcfov
+
+! ANU2 nb de moles d'oxyg�nes pour la r�action H2S -> SO2 + H2O
+
+anu2 = 1.5d0
+
+! ANU3 nb de mole d'oxygene pour la reaction CO -> CO2
+
+anu3 = 0.5d0
+
+if ( ieqnox .eq. 1 ) then
+ do iel=1,ncel
+ f4s3no(iel) = 0.d0
+ enddo
+endif
+
+!===============================================================================
+! 3. CALCUL DE LA COMPOSITION DU MELANGE SANS LES PDF
+! SI LES FLUCTUATIONS DE S SONT TROP FAIBLES
+!===============================================================================
+
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.0 ) then
+
+ if ( ieqco2 .eq. 1 ) then
+
+ x2t = 0.d0
+ do icla = 1, nclafu
+ x2t = x2t+rtp(iel,isca(iyfol(icla)))
+ enddo
+
+ zco2t = ( rtp(iel,isca(iyco2))/(1.d0-x2t) )/wmco2
+
+ endif
+
+! --> Composition de la phase gazeuse avant combustion (indice 0)
+
+! ZFOV0 = AFOVF1*F1
+! ZCO0 = ACOF1*F1 + ACOF3*F3
+! ZCO20 = ZERO
+! ZH2S0 = AH2SF1*F1 + AH2SF3*F3
+! ZSO20 = ZERO
+! ZH2O0 = AH2OF3*F3
+! ZO20 = AO2F4*F4 + AO2F3*F3
+! ZN20 = AN2F4*F4
+
+! ..v.7..x....v ....x....v....x....v....x....v....L....v....x....v....x.I
+ zfov0 = afovf1* f1m(iel)
+ zco0 = acof1 * f1m(iel) + acof3 * f3m(iel)
+ zh2s0 = ah2sf1* f1m(iel) + ah2sf3* f3m(iel)
+ zo20 = ao2f4 * f4m(iel) + ao2f3 * f3m(iel)
+ zn20 = an2f4 * f4m(iel) + an2f3 * f3m(iel)
+ zco20 = zero
+ zso20 = zero
+ zh2o0 = ah2of3 * f3m(iel)
+
+! --> Calcul de la composition du melange
+
+ reac1 = min(zfov0, (zo20/anu1))
+ zfov1 = zfov0 - reac1
+ zo21 = zo20 - anu1*reac1
+ zco1 = zco0 + reac1
+ zco21 = zco20
+ zh2o1 = zh2o0 + 0.5d0*nhcfov*reac1
+ zn21 = zn20
+ zh2s1 = zh2s0
+ zso21 = zso20
+
+ reac2 = min(zh2s1,(zo21/anu2))
+ zfov2 = zfov1
+ zco2 = zco1
+ zo22 = zo21 - anu2 * reac2
+ zh2s2 = zh2s1 - reac2
+ zh2o2 = zh2o1 + reac2
+ zso22 = zso21 + reac2
+ zco22 = zco21
+ zn22 = zn21
+
+ if ( ieqco2 .eq. 0 ) then
+
+ reac3 = min(zco2,(zo22/anu3))
+ zfov3 = zfov2
+ zo23 = zo22 - anu3*reac3
+ zco3 = zco2 - reac3
+ zco23 = zco22 + reac3
+ zh2o3 = zh2o2
+ zn23 = zn22
+ zh2s3 = zh2s2
+ zso23 = zso22
+
+ else if ( ieqco2 .eq. 1 ) then
+
+! Transport de CO2
+
+ zfov3 = zfov2
+ zco2t = min(zco2t,zco2,zo22/anu3)
+
+ zo23 = zo22 - anu3*zco2t
+ zco3 = zco2 - zco2t
+ zco23 = zco2t
+ zh2o3 = zh2o2
+ zn23 = zn22
+ zh2s3 = zh2s2
+ zso23 = zso22
+
+ else if ( ieqco2 .ne. 0 ) then
+
+ write(nfecra,3000) ieqco2
+ call csexit(1)
+
+ endif
+
+ fuel1(iel) = zfov3 * wmfov
+ fuel3(iel) = zco3 * wmco
+ prod1(iel) = zco23 * wmco2
+ prod2(iel) = zh2o3 * wmh2o
+ oxyd(iel) = zo23 * wmo2
+ xiner(iel) = zn23 * wmn2
+ xh2s (iel) = zh2s3 * wmh2s
+ xso2 (iel) = zso23 * wmso2
+
+ endif
+
+enddo
+
+
+
+!===============================================================================
+! 4. CALCUL DE LA COMPOSITION DU MELANGE AVEC LES PDF
+!===============================================================================
+
+! 14/08/2006
+! En toute rigueur, on pourrait calculer l'enthalpie de m�lange aux 5 pts
+! en d�duire la temp�rature et int�grer l'inverse de la masse volumique
+! mais ... les flammes fuligineuses sont rarement adiabatiques.
+! Il faudrait donc rechercher l'enthalpie aux points stoechio comme variable
+! auxilliaire pour retrouver l'enthalpie moyenne (qui tient compte des pertes)
+! En mettant les choses au mieux (i.e. on saurait formuler une hypoth�se de
+! r�partition des pertes entre les 3 points) on en d�duirait une temp�rature
+! lin�aire par morceaux, les fractions mmassiques �tant lin�aires,
+! 1/Rho serait quadratique.
+! D�j� fait une fois (flamme de diff) mais p�nible.
+
+! Pour l'instant on conserve le calcul de la temp�rature et de la masse
+! volumique d'apr�s les concentrations moyennes dans FUPHY1
+! comme pour le cp
+
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.1 ) then
+
+ if ( ieqco2 .eq. 1 ) then
+
+ x2t = 0.d0
+ do icla = 1, nclafu
+ x2t = x2t+rtp(iel,isca(iyfol(icla)))
+ enddo
+
+ zco2t = ( rtp(iel,isca(iyco2))/(1.d0-x2t) )/wmco2
+
+ endif
+
+! Concentrations aux extr�mit�s
+
+ do ii = 1,8
+ zzcl(ii) = zero
+ zzf4(ii) = zero
+ enddo
+
+ zzcl(ifov) = afovf1*f1cl(iel)
+ zzcl(ico) = acof1 *f1cl(iel)+acof3 *f3cl(iel)
+ zzcl(ih2s) = ah2sf1*f1cl(iel)+ah2sf3*f3cl(iel)
+ zzcl(ih2o) = ah2of3*f3cl(iel)
+ zzcl(in2) = an2f3 *f3cl(iel)
+ zzf4(io2) = ao2f4
+ zzf4(in2) = an2f4
+
+! Calcul de la stoechiom�trie de la premi�re r�action
+! FOV + O2 => CO + H2O
+! FOV et O2 sont, avant la premi�re r�action lin�aire en F4
+! ZZ(F4,II) = ZZcl(II) + (F4-F4cl)/(1-F4cl) * (ZZF4(II)-ZZcl(II))
+! On cherche le point tel que
+! ZZ(F4s1,IFOV) = ZZ(F4s1,IO2) / (0.5+0.25*nHCFOV)
+! ANU1*ZZ(F4s1,IFOV) = ZZ(F4s1,IO2)
+! ANU1*(1-F4cl)*ZZcl(IFOV) + ANU1*(F4s1-F4cl)*(ZZF4(IFOV)-ZZcl(IFOV)) =
+! (1-F4cl)*ZZcl(IO2) + (F4s1-F4cl)*(ZZF4(IO2) -ZZcl(IO2))
+! on remarque que ZZcl(IO2) = ZZF4(IFOV) = 0
+
+ f4s1 = ( anu1 * zzcl(ifov) + f4cl(iel) * zzf4(io2) ) &
+ / ( anu1 * zzcl(ifov) + zzf4(io2) )
+
+! Calcul des concentrations au premier point stoechio
+! avant r�action
+
+ do ii = 1,8
+ zzs1(ii) = zzcl(ii) &
+ + (f4s1-f4cl(iel))/(1.d0-f4cl(iel)) &
+ *(zzf4(ii)-zzcl(ii))
+ enddo
+
+! Le nombre de moles de r�action est le nombre de moles de fov
+
+ zzs1(ico) = zzs1(ico) + zzs1(ifov)
+ zzs1(io2) = zero
+ zzs1(ih2o)= zzs1(ih2o) + 0.5d0*nhcfov*zzs1(ifov)
+ zzs1(ifov)= zero
+
+! Calcul de la stoechiometrie de la deuxi�me r�action
+! H2S + O2 => SO2 + H2O
+! Les concentrations sont d�sormais lin�aires entre F4s1 et 1
+! ZZ(F4,II) = ZZs1(II) + (F4-F4s1)/(1-F4s1)*(ZZF4(II)-ZZs1(II))
+! On cherche le point tel que
+! ZZ(f4s2,IH2S) = ZZ(F4S2,IO2)/ANU2
+! a nouveau ZZs1(IO2) = ZZF4(IH2S) = 0
+! La formule est semblable � la pr�cedente en substituant
+! ANU1 par ANU2
+! IFOV par IH2S
+! cl par s1
+! s1 par s2
+
+ f4s2 = ( anu2 * zzs1(ih2s) + f4s1 * zzf4(io2) ) &
+ /( anu2 * zzs1(ih2s) + zzf4(io2) )
+
+! Calcul des concentrations au deuxi�me point stoechio
+! avant r�action
+
+ do ii = 1,8
+ zzs2(ii) = zzs1(ii) &
+ + (f4s2-f4s1) / (1.d0-f4s1) * (zzf4(ii) - zzs1(ii))
+ enddo
+
+! Le nombre de moles de r�action est le nombre de moles de H2S
+
+ zzs2(iso2) = zzs2(iso2) + zzs2(ih2s)
+ zzs2(ih2o) = zzs2(ih2o) + zzs2(ih2s)
+ zzs2(io2) = zero
+ zzs2(ih2s) = zero
+
+! Calcul de la stoechiometrie de la troisi�me r�action
+! CO + O2 => CO2
+! Les concentrations sont d�sormais lin�aires entre F4S2 et 1
+! ZZ(F4,II) = ZZS2(II) + (F4-F4S2)/(1-F4S2)*(ZZF4(II)-ZZS2(II))
+! On cherche le point tel que
+! ZZ(f4s3,ICO) = ZZ(F4S3,IO2)/ANU3
+! La formule est semblable � la pr�cedente en substituant
+! ANU2 par ANU3
+! IH2S par ICO
+! s1 par s2
+! s2 par s3
+
+ f4s3 = ( anu3 * zzs2(ico ) + f4s2 * zzf4(io2) ) &
+ / ( anu3 * zzs2(ico ) + zzf4(io2) )
+
+! si calcul de NOx, on stocke F4S3 pour l'utiliser dans fucyno
+
+ if ( ieqnox .eq. 1 ) then
+ f4s3no(iel) = f4s3
+ endif
+
+! Calcul des concentrations au troisi�me point stoechio
+! avant r�action
+
+ do ii = 1,8
+ zzs3(ii) = zzs2(ii) &
+ + (f4s3-f4s2) / (1.d0-f4s2) * (zzf4(ii) - zzs2(ii))
+ enddo
+
+! Le nombre de moles de r�action est le nombre de moles de CO
+
+ if ( ieqco2 .eq. 0 ) then
+ zzs3(ico2) = zzs3(ico2) + zzs3(ico)
+ zzs3(io2) = zero
+ zzs3(ico) = zero
+ endif
+
+! D�sormais on connait les concentrations en 5 points
+! cl,s1,s2,s3,f4
+! les concentrations interm�diaires sont lin�aires par morceaux
+! et les param�tres de la pdf D4cl,D4f4, F4m1,F4m2,HREC
+
+! On initialise par les concentrations aux extr�mit�s
+ do ii = 1,8
+ zz(ii) = d4cl(iel)*zzcl(ii)+d4f4(iel)*zzf4(ii)
+ enddo
+
+! Int�gration sur le premier intervalle de richesse (entre cl et s1)
+
+ bb1 = max(f4m1(iel),f4cl(iel))
+ bb2 = min(f4m2(iel),f4s1)
+ if( bb2.gt.bb1 ) then
+ do ii = 1,8
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(f4s1-f4cl(iel)) &
+ *( (zzcl(ii)*f4s1-zzs1(ii)*f4cl(iel)) &
+ + (zzs1(ii)-zzcl(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+! Int�gration sur le deuxi�me intervalle de (entre s1 et s2)
+
+ bb1 = max(f4m1(iel),f4s1)
+ bb2 = min(f4m2(iel),f4s2)
+ if( bb2.gt.bb1 ) then
+ do ii = 1,8
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(f4s2-f4s1) &
+ * ( (zzs1(ii)*f4s2-zzs2(ii)*f4s1) &
+ + (zzs2(ii)-zzs1(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+! Int�gration de s2 � s3
+
+ bb1 = max(f4m1(iel),f4s2)
+ bb2 = min(f4m2(iel),f4s3)
+ if( bb2.gt.bb1 ) then
+ do ii = 1,8
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(f4s3-f4s2) &
+ * ( (zzs2(ii)*f4s3-zzs3(ii)*f4s2) &
+ + (zzs3(ii)-zzs2(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+! Int�gration de s3 � f4
+
+ bb1 = max(f4m1(iel),f4s3)
+ bb2 = min(f4m2(iel),1.d0)
+ if ( bb2.gt.bb1 ) then
+ do ii = 1,8
+ zz(ii) = zz(ii) + hrec(iel)*(bb2-bb1)/(1.d0-f4s3) &
+ * ( (zzs3(ii)*1.d0-zzf4(ii)*f4s3) &
+ +(zzf4(ii)-zzs3(ii))*(bb1+bb2)*0.5d0)
+ enddo
+ endif
+
+ if ( ieqco2 .eq. 1 ) then
+
+! Transport de CO2
+
+ zco2t = min(zco2t,zz(ico),2.d0*zz(io2))
+
+ zz(ico ) = zz(ico) - zco2t
+ zz(io2 ) = zz(io2) - anu3*zco2t
+ zz(ico2) = zco2t
+
+ else if ( ieqco2 .ne. 0 ) then
+
+ write(nfecra,3000) ieqco2
+ call csexit(1)
+
+ endif
+
+ fuel1(iel) = zz(ifov ) * wmfov
+ fuel3(iel) = zz(ico ) * wmco
+ prod1(iel) = zz(ico2 ) * wmco2
+ prod2(iel) = zz(ih2o ) * wmh2o
+ oxyd(iel) = zz(io2 ) * wmo2
+ xiner(iel) = zz(in2 ) * wmn2
+ xh2s(iel) = zz(ih2s ) * wmh2s
+ xso2(iel) = zz(iso2 ) * wmso2
+
+ endif
+
+enddo
+
+!===============================================================================
+! 5. IMPRESSION
+!===============================================================================
+
+n2 = 0
+n3 = 0
+n4 = 0
+n5 = 0
+n6 = 0
+n7 = 0
+n8 = 0
+n9 = 0
+n10 = 0
+n11 = 0
+
+! --> Controle des parametres de la pdf
+
+n1 = ncel
+
+do iel = 1, ncel
+ if ( indpdf(iel).ne.0 ) then
+ n2 = n2 +1
+ endif
+enddo
+
+! --> Controle des differentes valeurs des fractions massiques
+
+do iel = 1, ncel
+
+ somm = fuel1(iel) + fuel3(iel) + oxyd(iel) &
+ + prod1(iel) + prod2(iel) + xiner(iel) &
+ + xh2s(iel) + xso2(iel)
+
+ if ( abs(somm-1.d0).lt.epsicp ) n3 = n3 +1
+ if ( fuel1(iel).lt.(-epzero) .or. &
+ fuel1(iel).gt.(1.d0+epzero) ) n4 = n4+1
+ if ( fuel3(iel).lt.(-epzero) .or. &
+ fuel3(iel).gt.(1.d0+epzero) ) n5 = n5+1
+ if ( oxyd(iel).lt.(-epzero) .or. &
+ oxyd(iel).gt.(1.d0+epzero) ) n6 = n6+1
+ if ( xiner(iel).lt.(-epzero) .or. &
+ xiner(iel).gt.(1.d0+epzero) ) n7 = n7+1
+ if ( prod1(iel).lt.(-epzero) .or. &
+ prod1(iel).gt.(1.d0+epzero) ) n8 = n8+1
+ if ( prod2(iel).lt.(-epzero) .or. &
+ prod2(iel).gt.(1.d0+epzero) ) n9 = n9+1
+ if ( xh2s(iel).lt.(-epzero) .or. &
+ xh2s(iel).gt.(1.d0+epzero) ) n10 = n10+1
+ if ( xso2(iel).lt.(-epzero) .or. &
+ xso2(iel).gt.(1.d0+epzero) ) n11 = n11+1
+
+enddo
+
+n1 = ncel
+
+if (irangp.ge.0) then
+ inttmp( 1) = n1
+ inttmp( 2) = n2
+ inttmp( 3) = n3
+ inttmp( 4) = n4
+ inttmp( 5) = n5
+ inttmp( 6) = n6
+ inttmp( 7) = n7
+ inttmp( 8) = n8
+ inttmp( 9) = n9
+ inttmp(10) = n10
+ inttmp(11) = n11
+ call parism(nbrint,inttmp)
+ !==========
+endif
+
+write(nfecra,1000) n1 , n2
+
+write(nfecra,2200) n3 , n4, n5, n6, n7, n8, &
+ n9, n10, n11
+
+
+!-------
+! FORMAT
+!-------
+
+ 1000 format (/, &
+'MODELISATION DE LA COMBUSTION AVEC LE MODELE DE DIFFUSION ', &
+'TURBULENTE (FUCYM1)',/, &
+'CHIMIE RAPIDE A 3 CORPS - EXTENSION A 3 COMBUSTIBLES ', &
+'(Application au FUEL)',/, &
+'==========================================================', &
+'==================',/, &
+' Nb de points de calculs = ',&
+ i9,/, &
+' Nb de points turbulents (passage par les PDF) = ',&
+ i9)
+
+ 2200 format(/, &
+'CONTROLE DES VALEURS DES FRACTIONS MASSIQUES',/, &
+' Nb de points de calculs qui respectent somme des Yi = 1 = ', &
+ i9,/, &
+' Nb de points YFOV ,YCO < 0 ou > 1 = ',I9,I9,/, &
+' Nb de points YO2 ,YN2 < 0 ou > 1 = ',I9,I9,/, &
+' Nb de points YCO2 ,YH2O < 0 ou > 1 = ',I9,I9,/, &
+' Nb de points YH2S ,YSO2 < 0 ou > 1 = ',I9,I9,/)
+
+ 3000 format(/, &
+'MODELE DE CO FUEL ACTIVE : ',/, &
+' AVEC IEQCO2 = ',I2,/, &
+'HORS SEUL LES OPTIONS 0 et 1 SONT DISPONIBLES',/, &
+' ARRET DU CALCUL : VERIFIER USPPMO')
+
+return
+end
diff --git a/src/fuel/fucyno.f90 b/src/fuel/fucyno.f90
new file mode 100644
index 0000000..277363b
--- /dev/null
+++ b/src/fuel/fucyno.f90
@@ -0,0 +1,472 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fucyno &
+!================
+
+ ( ncelet , ncel , &
+ indpdf , &
+ rtp , propce , &
+ f1m , f3m , f4m , f1cl , f3cl , f4cl , &
+ f4m1 , f4m2 , d4cl , d4f4 , hrec , f4s3 , &
+ fuel1 , fuel3 , oxyd , prod1 , prod2 , &
+ xiner , xh2s , xso2 )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE :
+
+! K1 exp(-E1/RT) (conversion HCN en NO)
+! K2 exp(-E2/RT) (conversion HCN en N2)
+! K3 exp(-E3/RT) (NO thermique)
+
+! VALEURS CELLULES
+! ----------------
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! fvap ! tr ! <-- ! moyenne du traceur 1 mvl [fovm+co] !
+! fhet ! tr ! -> ! moyenne du traceur 3 c h�terog�ne !
+! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
+! indpdf ! te ! <-- ! passage par les pdf !
+! fuel1 ! tr ! <- ! fraction massique fovm !
+! fuel3 ! tr ! <- ! fraction massique co !
+! oxyd ! tr ! <- ! fraction massique o2 !
+! prod1 ! tr ! <- ! fraction massique co2 !
+! prod2 ! tr ! <- ! fraction massique h2o !
+! xiner ! tr ! <- ! fraction massique n2 !
+! xh2s ! tr ! <- ! fraction massique h2s !
+! xso2 ! tr ! <- ! fraction massique so2 !
+! f4m1 ! tr ! <-- ! borne minimum !
+! f4m2 ! tr ! <-- ! borne max !
+! d4cl ! tr ! <-- ! amplitude du pic de dirac en f4cl !
+! d4f4 ! tr ! <-- ! amplitude du pic de dirac en 1 !
+! ! ! ! (air pur) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer indpdf(ncelet)
+
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision f1m(ncelet) , f3m(ncelet) , f4m(ncelet)
+double precision f1cl(ncelet), f3cl(ncelet) , f4cl(ncelet)
+
+double precision f4m1(ncelet) , f4m2(ncelet) , d4cl(ncelet)
+double precision d4f4(ncelet) , hrec(ncelet) , f4s3(ncel)
+
+double precision fuel1(ncelet), fuel3(ncelet)
+double precision oxyd(ncelet) , prod1(ncelet), prod2(ncelet)
+double precision xiner(ncelet)
+double precision xh2s(ncelet) , xso2(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel , icla , i
+
+integer n1 , n2 , n3 , n4 , n5 , n6 , n7 , n8 , n9
+integer n10, n11
+integer nbrint
+integer ipdf1 , ipdf2 , ipdf3
+integer iexp1 , iexp2 , iexp3
+parameter (nbrint = 11)
+integer inttmp(nbrint)
+integer npart
+parameter (npart = 200 )
+
+double precision wmo2
+
+double precision ee1,ee2,ee3,kk1,kk2,kk3
+double precision ts3 , ts3den , ts3num , u , t , ts3s , dirac
+double precision q , r , s , lpa , lri , tmpgaz , tfuel , xmx2
+double precision bb1 , bb2 , bb3 , bb4 , wmco , xo2 , bb
+double precision gh1, gh2 ,gh3 ,gh4 ,gh5,gh6, gh7 , tg
+double precision gh8, gh9 ,gh10,gh11
+double precision dgs , rsf4 , rscl , bmoy , p , spdf
+double precision val(npart+1),tt(npart+1) , gs(npart+1)
+
+!===============================================================================
+
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Masses molaires
+
+wmo2 = wmole(io2)
+
+! --- pointeurs
+
+iexp1 = ipproc(ighcn1)
+iexp2 = ipproc(ighcn2)
+iexp3 = ipproc(ignoth)
+
+! Parametres des lois d'Arrhenius
+
+kk1 = 3.0e12
+ee1 = 3.0e4
+kk2 = 1.2e10
+ee2 = 3.35e4
+kk3 = 3.4e12
+ee3 = 6.69e4
+
+! Pour les termes, indicateur de calcul par PDF ou non
+! = 1 --> passage par pdf
+! = 0 --> on ne passe pas par les pdf
+
+ipdf1 = 0
+ipdf2 = 0
+ipdf3 = 0
+
+! ---- Initialisation
+
+do iel = 1, ncel
+! PROPCE(IEL,IEXP1) = ZERO
+! PROPCE(IEL,IEXP2) = ZERO
+! PROPCE(IEL,IEXP3) = ZERO
+enddo
+
+!===============================================================================
+! 3. CALCUL SANS LES PDF
+!===============================================================================
+
+do iel = 1, ncel
+
+ tg = propce(iel,ipproc(itemp1))
+ propce(iel,iexp1) = kk1*exp(-ee1/tg)
+
+enddo
+
+do iel = 1, ncel
+
+ tg = propce(iel,ipproc(itemp1))
+ xo2 = oxyd(iel)*propce(iel,ipproc(immel)) &
+ /wmo2
+ if ( xo2 .gt. 0.018d0 ) then
+ bb = 0.d0
+ else if ( xo2 .lt. 0.0025d0 ) then
+ bb= 1.d0
+ else
+ bb=(0.018d0-xo2)/(0.018d0-0.0025d0)
+ endif
+
+ propce(iel,iexp2) = kk2*exp(-ee2/tg)*(xo2**bb)
+
+enddo
+
+do iel = 1, ncel
+
+ tg = propce(iel,ipproc(itemp1))
+ xo2 = oxyd(iel)*propce(iel,ipproc(immel)) &
+ /wmo2
+
+ propce(iel,iexp3) = kk3*exp(-ee3/tg)*(xo2**0.5d0)
+
+enddo
+
+!===============================================================================
+! 3. CALCUL AVEC LES PDF
+!===============================================================================
+
+if ( ipdf1 .eq. 1 .or. ipdf2 .eq. 1 .or. ipdf3 .eq. 1 ) then
+
+ do iel=1,ncel
+
+ if ( indpdf(iel).eq.1 ) then
+
+! Calcul de Tfioul moyen
+
+ xmx2 = 0.d0
+ tfuel = 0.d0
+
+ do icla=1,nclafu
+ xmx2 = xmx2 + rtp(iel,isca(iyfol(icla)))
+ enddo
+
+ if ( xmx2 .gt. 0.d0 ) then
+ do icla=1,nclafu
+ tfuel = tfuel + rtp(iel,isca(iyfol(icla))) &
+ *propce(iel,ipproc(itemp3(icla)))
+ enddo
+ tfuel = tfuel/xmx2
+ else
+ tfuel = propce(iel,ipproc(itemp1))
+ endif
+
+! On recupere la valeur de TAIR
+
+ taire = rtp(iel,isca(itaire))
+
+! On initialise par les temperatures Tair (en f4) et Tcl (TFUEL) aux extr��mit��s
+
+ dirac = d4cl(iel)*tfuel + d4f4(iel)*taire
+
+!1 On recupere la valeur de la temperature moyenne
+
+ tmpgaz = propce(iel,ipproc(itemp1))
+
+!1 Integration premier intervalle, entre CL et S3 (stoechio derni��re r��action)
+
+!1 Parametres de la droite entre CL et S3
+
+!1 Detection des bornes d'integration (celles de la pdf) du domaine pauvre
+
+ if(tfuel.gt.epsicp .and. tmpgaz.gt.epsicp) then
+
+ if(f4s3(iel).le.f4m1(iel)) then
+ p=((f4m1(iel)+f4m2(iel))/2.-f4s3(iel))/(1.-f4s3(iel))
+ ts3s=((tmpgaz-dirac)/hrec(iel) &
+ /(f4m2(iel)-f4m1(iel))-taire*p) &
+ /(1.d0-p)
+ else if(f4s3(iel).ge.f4m2(iel)) then
+ ts3s=((tmpgaz-dirac)/hrec(iel) &
+ /(f4m2(iel)-f4m1(iel))-tfuel) &
+ *(f4s3(iel)-f4cl(iel)) &
+ /((f4m1(iel)+f4m2(iel))/2.d0-f4cl(iel))+tfuel
+ else
+ ts3s=(2.*(tmpgaz-dirac)/hrec(iel) &
+ - tfuel*(f4s3(iel)-f4m1(iel))**2 &
+ /(f4s3(iel)-f4cl(iel)) &
+ - taire*(f4m2(iel)-f4s3(iel))**2 &
+ /(1.d0-f4s3(iel))) &
+ /((2.*f4m2(iel)-f4m1(iel)-f4s3(iel)) &
+ +(f4m1(iel)-f4cl(iel))*(f4s3(iel)-f4m1(iel)) &
+ /(f4s3(iel)-f4cl(iel)) &
+ -(f4m2(iel)-f4s3(iel))**2/(1.d0-f4s3(iel)))
+ endif
+
+ bb1 = max( f4m1(iel) , f4cl(iel) )
+ bb2 = min( f4m2(iel) , f4s3(iel) )
+ bb3 = max( f4m1(iel) , f4s3(iel) )
+ bb4 = min( f4m2(iel) , 1.d0 )
+
+! On definit quelques parametres intermediaires pour simplifier le code
+
+ if (bb2 .gt. bb1 ) then
+ lri = hrec(iel)
+ else
+ lri = 0.d0
+ endif
+ if (bb4 .gt. bb3 ) then
+ lpa = hrec(iel)
+ else
+ lpa = 0.d0
+ endif
+
+ p = f4s3(iel) - f4cl(iel)
+ q = bb2**2 - bb1**2
+ r = bb2 - bb1
+ s = 1.d0 - f4s3(iel)
+ t = bb4**2 - bb3**2
+ u = bb4 - bb3
+
+! On calcul de TS3
+
+! TS3=(TMPGAZ-DIRAC+TFUEL*(((LRI*Q)/(2.D0*P))-((LRI*F4S3*R)/P))
+! & - TAIRE*( ((LPA*T)/(2.D0*S)) +(LPA*U) -((LPA*U)/S)))
+! & /
+! & (((LRI*Q)/(2.D0*P))+(LRI*R)-((LRI*F4S3*R)/P)-((LPA*T)
+! & /(2.D0*S)) +((LPA*U)/S) )
+
+ gh1 = -lri*q/(p*2.d0)
+ gh2 = lri*r*f4s3(iel)/p
+ gh3 = lpa*t/(2.d0*s)
+ gh4 = lpa*u
+ gh5 = lpa*u/s
+ gh6 = lri*q/(p*2.d0)
+ gh7 = lri*r
+ gh8 = f4s3(iel)*lri*r/p
+ gh9 = lpa*t/(s*2.d0)
+ gh10= lpa*u/s
+ gh11 = tmpgaz - dirac
+
+ ts3num = gh11 - tfuel*(gh1+gh2) - taire*(gh3+gh4-gh5)
+ ts3den = gh6 + gh7 -gh8 - gh9 + gh10
+
+
+ ts3 = ts3num / ts3den
+ if(abs(ts3-ts3s).gt.1.d0) then
+ WRITE(NFECRA,*) 'TS3 paul-TS3 sandro ', IEL,TS3,TS3S
+ endif
+ endif
+
+ spdf = hrec(iel) * (f4m2(iel) - f4m1(iel))
+
+! Integration
+
+ xo2 = oxyd(iel)*propce(iel,ipproc(immel)) &
+ /wmo2
+
+ do i = 1, npart+1
+ gs(i) = f4m1(iel) + dble(i-1)/dble(npart) &
+ *(f4m2(iel)-f4m1(iel))
+
+ if( gs(i) .le. f4s3(iel) ) then
+ tt(i) = (ts3-tfuel)/(f4s3(iel)-f4cl(iel))* gs(i) &
+ + ts3 - f4s3(iel)*(ts3 - tfuel) &
+ / ( f4s3(iel) - f4cl(iel) )
+
+ else
+ tt(i) = (taire -ts3)/(1.d0-f4s3(iel))*gs(i) &
+ + taire - (taire - ts3)/(1.d0-f4s3(iel))
+
+ endif
+ enddo
+
+ if(xo2.gt.0.018d0) then
+ bmoy=0.d0
+ else if(xo2 .lt. 0.0025d0) then
+ bmoy=1.d0
+ else
+ bmoy=(0.018d0-xo2)/(0.018d0-0.0025d0)
+ endif
+
+! DGS est le pas d'integration
+
+ dgs = ( f4m2(iel) - f4m1(iel) ) / dble(npart)
+
+! Calcul de K1*EXP(-E1/T)
+
+ if ( ipdf1 .eq. 1 ) then
+
+ rsf4 = kk1*exp(-ee1/taire)*d4f4(iel)
+ rscl = kk1*exp(-ee1/tfuel)*d4cl(iel)
+
+ do i = 1, npart+1
+ val(i) = kk1 * exp(-ee1/tt(i)) * hrec(iel)
+ enddo
+
+ propce(iel,iexp1)= rsf4 + rscl
+
+ do i = 1, npart
+ propce(iel,iexp1) = propce(iel,iexp1) &
+ +0.5d0*dgs*(val(i)+val(i+1))
+ enddo
+
+ endif
+
+! Calcul de K2*EXP(-E2/T)
+
+ if ( ipdf2 .eq. 1 ) then
+
+ if ( xo2 .gt. 0.d0 ) then
+ propce(iel,iexp2) = kk2*exp(-ee2/taire) &
+ *d4f4(iel)*xo2**bmoy &
+ +kk2*exp(-ee2/tfuel) &
+ *d4cl(iel)*xo2**bmoy
+
+ do i = 1, npart+1
+ val(i) = kk2*exp(-ee2/tt(i))*hrec(iel)
+ enddo
+
+ do i = 1, npart
+ propce(iel,iexp2) = propce(iel,iexp2) &
+ +0.5d0*dgs*(val(i)+val(i+1)) &
+ *xo2**bmoy
+ enddo
+ else
+ propce(iel,iexp2) = 0.d0
+ endif
+
+ endif
+
+! Calcul de K3*EXP(-E3/T)
+
+ if ( ipdf3 .eq. 1 ) then
+
+ if ( xo2 .gt. 0.d0 ) then
+ propce(iel,iexp3) = kk3*exp(-ee3/taire) &
+ *d4f4(iel)*xo2**(0.5d0) &
+ +kk3*exp(-ee3/tfuel) &
+ *d4cl(iel)*xo2**(0.5d0)
+
+ do i = 1, npart+1
+ val(i) = kk3*exp(-ee3/tt(i))*hrec(iel)
+ enddo
+
+ do i = 1, npart
+ propce(iel,iexp3)= propce(iel,iexp3) &
+ + 0.5d0*dgs*(val(i)+val(i+1))*xo2**(0.5d0)
+ enddo
+ else
+ propce(iel,iexp3)= 0.d0
+ endif
+ endif
+
+ endif
+
+ enddo
+
+endif
+
+return
+end
diff --git a/src/fuel/fuflux.f90 b/src/fuel/fuflux.f90
new file mode 100644
index 0000000..b14b14a
--- /dev/null
+++ b/src/fuel/fuflux.f90
@@ -0,0 +1,378 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fuflux &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ rtpa , propce , volume , &
+ w1 , w2 , w3 , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES TERMES DE TRANSFERT DE MASSE ENTRE LA PHASE CONTINUE
+! ET LA PHASE DISPERSEE
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant precedent) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! w1, w2, w3 ! tr ! --- ! tableaux de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+
+double precision rtpa(ncelet,*), propce(ncelet,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision volume(ncelet)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , iphas , icla
+integer ipcrom , ipcte1 , ipcte2 , ipcro2 , ipcdia
+integer ipcgev , ipcght , ipcyox
+integer ipcvst,ipcvsl,ipccp,ipchgl
+
+double precision xng,xnuss
+double precision pparo2 , xdffli , xdfext , xdftot0 , xdftot1
+double precision diacka, xuash
+double precision dcoke , surf
+
+!===============================================================================
+! 1. INITIALISATIONS ET CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Initialisation des termes de transfert de masse
+
+do icla = 1, nclafu
+ ipcgev = ipproc(igmeva(icla))
+ ipcght = ipproc(igmhtf(icla))
+ do iel = 1, ncel
+ propce(iel,ipcgev) = zero
+ propce(iel,ipcght) = zero
+ enddo
+enddo
+
+! --- Initialisation des tableaux de travail
+
+do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+enddo
+
+! --- Calcul de la masse volumique du melange gazeux
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+ipcte1 = ipproc(itemp1)
+ipcyox = ipproc(iym1(io2))
+
+! --- Numero des grandeurs physiques (voir usclim)
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+! --> Terme source pour l'enthalpie du liquide
+
+do icla = 1, nclafu
+
+ ipcro2 = ipproc(irom3 (icla))
+ ipcdia = ipproc(idiam3(icla))
+ ipcte2 = ipproc(itemp3(icla))
+ ipcght = ipproc(igmhtf(icla))
+ ipchgl = ipproc(ih1hlf(icla))
+
+
+! ---- Contribution aux bilans explicite et implicite
+! des echanges par diffusion moleculaire
+! 6 Lambda Nu / diam**2 / Rho2 * Rho * (T1-T2)
+! ------ Calcul de lambda dans W1
+
+ xnuss = 2.d0
+ do iel = 1, ncel
+ if ( ivisls(ihm).gt.0 ) then
+ ipcvsl = ipproc(ivisls(ihm))
+ if ( icp(iphas).gt.0 ) then
+ ipccp = ipproc(icp(iphas))
+ w1(iel) = propce(iel,ipcvsl) * propce(iel,ipccp)
+ else
+ w1(iel) = propce(iel,ipcvsl) * cp0(iphas)
+ endif
+ else
+ if ( icp(iphas).gt.0 ) then
+ ipccp = ipproc(icp(iphas))
+ w1(iel) = visls0(ihm) * propce(iel,ipccp)
+ else
+ w1(iel) = visls0(ihm) * cp0(iphas)
+ endif
+ endif
+ enddo
+
+!----Contribution aux bilans explicite et implicite des
+! echanges par diffusion moleculaire
+! 6 Lambda Nu / diam**2 / Rho2 * Rho
+! le diametre est en mm donc on multiplie par 1.D-3
+! pour l'avoir en m
+
+ do iel = 1, ncel
+
+
+ if ( rtpa(iel,isca(ing(icla))) .gt. epsifl .and. &
+ propce(iel,ipcte1).gt. propce(iel,ipcte2) ) then
+
+
+! PROPCE(IEL,IPCHGL) = 6.D0 * W1(IEL) * XNUSS
+! & /((PROPCE(IEL,IPCDIA)*1.D-3)**2)
+! & /PROPCE(IEL,IPCRO2)
+
+ propce(iel,ipchgl) = w1(iel)*xnuss*rtpa(iel,isca(ing(icla)))&
+ *pi*propce(iel,ipcdia)*1.d6
+
+ else
+ propce(iel,ipchgl) =0.d0
+ endif
+
+ enddo
+
+enddo
+
+!===============================================================================
+! 2. TRANSFERTS DE MASSE PAR EVAPORATION
+!===============================================================================
+
+do icla = 1, nclafu
+
+ ipcro2 = ipproc(irom3 (icla))
+ ipcdia = ipproc(idiam3(icla))
+ ipcte2 = ipproc(itemp3(icla))
+ ipcgev = ipproc(igmeva(icla))
+ ipchgl = ipproc(ih1hlf(icla))
+
+! FO & PPl 16/09/05 Version avec parametres en dur, en attendant les
+! lectures et inclusion en include
+ tevap1 = 150.d0 + tkelvi
+ tevap2 = 450.d0 + tkelvi
+
+
+! PPl 161205 On r�partit le flux interfacial d'enthalpie entre
+! l'�chauffement de la goutte et l'�vaporation
+
+ do iel = 1, ncel
+
+! --- Transfert de masse du a l'evaporation
+
+ propce(iel,ipcgev) = zero
+
+! IF (PROPCE(IEL,IPCTE2) .GE. TEVAP1 .AND.
+! & PROPCE(IEL,IPCTE2) .LE. TEVAP2 .AND.
+! & RTPA(IEL,ISCA(IYFOL(ICLA))) .GE. EPSIFL ) THEN
+! PROPCE(IEL,IPCGEV) = PROPCE(IEL,IPPROC(IH1HLF)) /
+! & ( RTPA(IEL,ISCA(IYFOL)) * CP2FOL * (TEVAP2-TEVAP1) /
+! & ( ( RTPA(IEL,ISCA(IYFOL)) + RTPA(IEL,ISCA(IFVAP)) )
+! & * (1 .d0-FKC)) + HRFVAP )
+! PPl 161205
+
+! PPl 090106 On teste plut�t les diam�tres car d�sormais les
+! gouttes finissent trop fines
+
+ if ( propce(iel,ipcte2) .gt. tevap1 .and. &
+ propce(iel,ipcdia) .gt. dinikf(icla) .and. &
+ rtpa(iel,isca(iyfol(icla))) .gt. epsifl ) then
+ propce(iel,ipcgev) = propce(iel,ipchgl) &
+ /( hrfvap + cp2fol*(tevap2-tevap1) )
+ endif
+
+ enddo
+
+enddo
+
+!===============================================================================
+! 3. CALCUL DE RHO_COKE MOYEN
+! On suppose pour le calcul de la masse volumique du coke que
+! l'evaporation a lieu a volume de coke constant
+! Par la suite, on suppose (pour commencer ?) que la
+! combustion h�t�rog�ne a lieu � volume constant =>
+! � masse volumique d�croissante
+!===============================================================================
+
+! --- Initialisation
+
+rhokf = rho0fl
+
+! --- Calcul de la masse volumique moyenne du coke
+
+!===============================================================================
+! 4. TRANSFERTS DE MASSE PAR COMBUSTION HETEROGENE
+!===============================================================================
+
+do icla = 1, nclafu
+
+ ipcro2 = ipproc(irom3 (icla))
+ ipcdia = ipproc(idiam3(icla))
+ ipcte2 = ipproc(itemp3(icla))
+ ipcgev = ipproc(igmeva(icla))
+ ipcght = ipproc(igmhtf(icla))
+
+ do iel = 1, ncel
+
+ if ( propce(iel,ipcdia) .le. dinikf(icla) .and. &
+ propce(iel,ipcdia) .gt. diniin(icla) .and. &
+ rtpa(iel,isca(iyfol(icla))) .gt. epsifl ) then
+
+ xng = rtpa(iel,isca(ing(icla)))*1.d9
+
+ xuash = xng*(1.d0-xinfol) &
+ *(rho0fl*pi*((dinifl(icla)*1.d-3)**2))/6.d0
+
+! --- Calcul de la pression partielle en oxygene (atm)
+! ---
+! PO2 = RHO1*RR*T*YO2/MO2
+
+ pparo2 = propce(iel,ipproc(irom1))*rr*propce(iel,ipcte1) &
+ *propce(iel,ipcyox)/wmole(io2)
+ pparo2 = pparo2 / prefth
+
+! --- Calcul de Dcoke en metres
+
+ dcoke = ( ( rtpa(iel,isca(iyfol(icla))) &
+ /(rtpa(iel,isca(ing(icla)))*rho0fl) &
+ -pi*(dinikf(icla)**3)*xinkf/6.d0 ) &
+ *6.d0/(pi*(1.d0-xinkf)) )**(1.d0/3.d0) &
+ *1.d-3
+ if ( dcoke .lt. 0.d0 ) then
+ WRITE(NFECRA,*) 'erreur Dcoke = ',Dcoke,IEL
+ call csexit(1)
+ endif
+
+! --- Coefficient de cinetique chimique de formation de CO
+! en (kg.m-2.s-1.atm(-n))
+
+ xdffli = ahetfl*exp(-ehetfl*4185.d0 &
+ /(rr*propce(iel,ipcte1)))
+
+! --- Coefficient de diffusion en (Kg/m2/s/atm) : XDFEXT
+! Coefficient global pour n=0.5 en (kg/m2/s) : XDFTOT0
+! Coefficient global pour n=1 en (Kg/m2/s) : XDFTOT1
+
+ diacka = dcoke/(dinikf(icla)*1.d-3)
+ if ( diacka .gt. epsifl ) then
+ xdfext = 2.53d-7*((propce(iel,ipcte1))**0.75d0) &
+ / dcoke*2.d0
+ xdftot1 = pparo2 / ( 1.d0/xdffli + 1.d0/xdfext )
+ xdftot0 = -(xdffli**2)/(2.d0*xdfext**2)+(pparo2*xdffli**2 &
+ +(xdffli**4)/(2.d0*xdfext**2))**0.5d0
+ else
+ xdftot1 = xdffli*pparo2
+ xdftot0 = xdffli*pparo2**0.5d0
+ endif
+
+! Surface
+
+ surf = pi*(dcoke**2)
+
+! --- Calcul de PROPCE(IEL,IPCGHT) = - COXCK*XDFTOT0*PPARO2*XNP < 0
+! --- ou PROPCE(IEL,IPCGHT) = - COXCK*XDFTOT1*PPARO2*XNP < 0
+
+ if (iofhet.eq.1) then
+! PROPCE(IEL,IPCGHT) = - XDFTOT1*COXCK*XNG
+ propce(iel,ipcght) = - xdftot1*surf*xng
+ else
+! PROPCE(IEL,IPCGHT) = - XDFTOT0*COXCK*XNG
+ propce(iel,ipcght) = - xdftot0*surf*xng
+ endif
+
+ else
+ propce(iel,ipcght) = 0.d0
+ endif
+
+ enddo
+
+enddo
+
+!===============================================================================
+! FORMATS
+!--------
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/fuini1.f90 b/src/fuel/fuini1.f90
new file mode 100644
index 0000000..209644f
--- /dev/null
+++ b/src/fuel/fuini1.f90
@@ -0,0 +1,556 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine fuini1
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES TRANSPORTEES
+! ET DES VARIABLES ALGEBRIQUES
+! COMBUSTION FUEL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer ipp , ii , jj , iok , icla
+integer isc , iphas
+double precision wmolme
+
+!===============================================================================
+!===============================================================================
+! 0. VERIFICATION ISCALT, ISCSTH
+!===============================================================================
+! L'utilisateur ne doit pas y avoir touche.
+
+do iphas = 1, nphas
+ if(iscalt(iphas).ne.-1) then
+ write(nfecra,1000)iphas,iscalt(iphas)
+ call csexit (1)
+ !==========
+ endif
+enddo
+do ii = 1, nscapp
+ if(iscsth(iscapp(ii)).ne.-10) then
+ write(nfecra,1001)ii,iscapp(ii),iscapp(ii),iscsth(iscapp(ii))
+ call csexit (1)
+ !==========
+ endif
+enddo
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! --> Definition des scamin et des scamax des variables transportees
+
+! ---- Variables propres a la phase dispersee
+
+scamin(ihm) = h02fol
+scamax(ihm) = +grand
+
+do icla=1,nclafu
+ scamin(ing(icla)) = 0.d0
+ scamax(ing(icla)) = +rinfin
+ scamin(iyfol(icla)) = 0.d0
+ scamax(iyfol(icla)) = 4.d-1
+ scamin(ihlf(icla)) = -grand
+ scamax(ihlf(icla)) = +grand
+enddo
+
+! ---- Variables propres a la phase continue
+
+scamin(ifvap) = 0.d0
+scamax(ifvap) = 1.d0
+scamin(ifhtf) = 0.d0
+scamax(ifhtf) = 1.d0
+scamin(if4p2m) = 0.d0
+scamax(if4p2m) = 0.25d0
+
+if ( ieqco2 .ge. 1 ) then
+ scamin(iyco2) = 0.d0
+ scamax(iyco2) = 1.d0
+endif
+
+if ( ieqnox .eq. 1 ) then
+ scamin(iyhcn) = 0.d0
+ scamax(iyhcn) = 1.d0
+ scamin(iyno) = 0.d0
+ scamax(iyno) = 1.d0
+ scamin(itaire) = 0.d0
+ scamax(itaire) = +grand
+endif
+
+! --> Nature des scalaires transportes
+
+do isc = 1, nscapp
+
+! ---- Type de scalaire (0 passif, 1 temperature en K
+! -1 temperature en C
+! 2 enthalpie)
+! La distinction -1/1 sert pour le rayonnement
+ iscsth(iscapp(isc)) = 0
+
+enddo
+
+iphas = 1
+
+! ---- On resout en enthalpie avec un CP constant (Cf. cpvarp)
+
+iphas = iphsca(ihm)
+iscalt(iphas) = ihm
+iscsth(ihm) = 2
+
+! --> Donnees physiques ou numeriques propres aux scalaires CP
+
+do isc = 1, nscapp
+
+ jj = iscapp(isc)
+
+ if ( iscavr(jj) .le. 0 ) then
+
+! En combustion on considere que la viscosite turbulente domine
+! ON S'INTERDIT DONC LE CALCUL DES FLAMMES LAMINAIRES AVEC Le =/= 1
+
+ visls0(jj) = viscl0(iphsca(jj))
+
+ endif
+
+! ------ Schmidt ou Prandtl turbulent
+
+ sigmas(jj) = 0.7d0
+
+! ------ Coeff dissipation des fluctuations
+
+ rvarfl(jj) = 0.8d0
+
+ ii = isca(iscapp(isc))
+
+! ------ Niveau de detail des impressions pour les variables et
+! donc les scalaires (valeurs 0 ou 1)
+! Si = -10000 non modifie par l'utilisateur -> niveau 1
+ if(iwarni(ii).eq.-10000) then
+ iwarni(ii) = 1
+ endif
+
+! ------ Informations relatives a la resolution des scalaires
+
+! - Facteur multiplicatif du pas de temps
+ cdtvar(ii) = 1.d0
+
+! - Schema convectif % schema 2ieme ordre
+! = 0 : upwind
+! = 1 : second ordre
+ blencv(ii) = 0.d0
+
+! - Type de schema convetif second ordre (utile si BLENCV > 0)
+! = 0 : Second Order Linear Upwind
+! = 1 : Centre
+ ischcv(ii) = 1
+
+! - Test de pente pour basculer d'un schema centre vers l'upwind
+! = 0 : utlisation automatique du test de pente
+! = 1 : calcul sans test de pente
+ isstpc(ii) = 0
+
+! - Reconstruction des flux de convetion et de diffusion aux faces
+! = 0 : pas de reconstruction
+ ircflu(ii) = 0
+
+enddo
+
+
+!---> Variable courante : nom, sortie chrono, suivi listing, sortie histo
+
+! Comme pour les autres variables,
+! si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! NOMVAR( ) = nom de la variable
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes
+
+! NB : Les 8 premiers caracteres du noms seront repris dans le
+! listing 'developpeur'
+
+
+! ---- Variables propres a la suspension gaz - particules
+
+ipp = ipprtp(isca(ihm))
+NOMVAR(IPP) = 'Enthalpy'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- Variables propres a la phase dispersee
+
+do icla = 1, nclafu
+ ipp = ipprtp(isca(iyfol(icla)))
+ WRITE(NOMVAR(IPP),'(A8,I2.2)')'YFOL_FOL' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(ihlf(icla)))
+ WRITE(NOMVAR(IPP),'(A7,I2.2)')'HLF_FOL' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(ing(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'NG_FOL' ,ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+enddo
+
+! ---- Variables propres a la phase gaz
+
+ipp = ipprtp(isca(ifvap))
+NOMVAR(IPP) = 'Fr_VAP'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+ipp = ipprtp(isca(ifhtf))
+NOMVAR(IPP) = 'Fr_HET'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+ipp = ipprtp(isca(if4p2m))
+NOMVAR(IPP) = 'Var_AIR'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+if ( ieqco2 .ge. 1 ) then
+ ipp = ipprtp(isca(iyco2))
+ NOMVAR(IPP) = 'FR_CO2'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+if ( ieqnox .eq. 1 ) then
+ ipp = ipprtp(isca(iyhcn))
+ NOMVAR(IPP) = 'FR_HCN'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(iyno))
+ NOMVAR(IPP) = 'FR_NO'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ ipp = ipprtp(isca(itaire))
+ NOMVAR(IPP) = 'Temp_air'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+
+! ---> Variables algebriques propres a la suspension gaz - particules
+
+ipp = ipppro(ipproc(immel))
+NOMVAR(IPP) = 'XM'
+ichrvr(ipp) = 0
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+! ---> Variables algebriques propres a la phase dispersee
+
+do icla = 1, nclafu
+ ipp = ipppro(ipproc(itemp3(icla)))
+ WRITE(NOMVAR(IPP),'(A7,I2.2)')'Tem_FOL',ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(irom3(icla)))
+ WRITE(NOMVAR(IPP),'(A7,I2.2)')'Rho_FOL',ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(idiam3(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Dia_gt',ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(ih1hlf(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'H1-Hlf',ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(igmeva(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_EVA',ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ ipp = ipppro(ipproc(igmhtf(icla)))
+ WRITE(NOMVAR(IPP),'(A6,I2.2)')'Ga_HET',ICLA
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+enddo
+
+! ---> Variables algebriques propres a la phase continue
+
+ipp = ipppro(ipproc(itemp1))
+NOMVAR(IPP) = 'Temp_GAZ'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(irom1))
+NOMVAR(IPP) = 'ROM_GAZ'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(1)))
+NOMVAR(IPP) = 'YM_FOV'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(2)))
+NOMVAR(IPP) = 'YM_CO'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(3)))
+NOMVAR(IPP) = 'YM_H2S'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(4)))
+NOMVAR(IPP) = 'YM_H2O'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(5)))
+NOMVAR(IPP) = 'YM_CO2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(6)))
+NOMVAR(IPP) = 'YM_SO2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(7)))
+NOMVAR(IPP) = 'YM_O2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+ipp = ipppro(ipproc(iym1(8)))
+NOMVAR(IPP) = 'YM_N2'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+if ( ieqnox .eq. 1 ) then
+
+ ipp = ipppro(ipproc(ighcn1))
+ NOMVAR(IPP) = 'EXP1'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(ighcn2))
+ NOMVAR(IPP) = 'EXP2'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(ignoth))
+ NOMVAR(IPP) = 'EXP3'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+endif
+
+!===============================================================================
+! 3. INFORMATIONS COMPLEMENTAIRES
+!===============================================================================
+
+! ---> Initialisation
+iphas = 1
+! ---- Calcul de RO0 a partir de T0 et P0
+! (loi des gaz parfaits applliquee a l'air)
+
+wmolme = (wmole(io2)+xsi*wmole(in2)) / (1.d0+xsi)
+ro0(iphas) = p0(iphas)*wmolme / (rr*t0(iphas))
+
+! ---- Initialisation pour la masse volumique du coke
+! Maintenant c'est fait dans FULECD
+! RHOKF = RHO0FL
+
+! ---> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+srrom = 0.90d0
+
+! ---> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+! C'est cette valeur par defaut qui est TOUJOURS utilisee dans les
+! calculs charbon (un peu etonnant de ne pas prendre en
+! compte les variations de ce parametre physique si on
+! recherche des informations sur les flux thermiques aux parois)
+
+diftl0 = 4.25d-5
+visls0(ihm) = diftl0
+
+! ---> Masse volumique variable et viscosite constante (pour les suites)
+irovar(iphas) = 1
+ivivar(iphas) = 0
+
+!===============================================================================
+! 4. ON REDONNE LA MAIN A L'UTLISATEUR
+!===============================================================================
+
+call usfui1
+!==========
+
+!===============================================================================
+! 5. VERIFICATION DES DONNERS FOURNIES PAR L'UTLISATEUR
+!===============================================================================
+
+iok = 0
+call fuveri (iok)
+!==========
+
+if(iok.gt.0) then
+ write(nfecra,9999)iok
+ call csexit (1)
+ !==========
+else
+ write(nfecra,9998)
+endif
+
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) DEMANDEE ',/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas la renseigner dans usini1, or ',/,&
+'@ elle a ete affectee comme suit : ',/,&
+'@ ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) DEMANDEE ',/,&
+'@ ',/,&
+'@ Les valeurs de ISCSTH sont renseignees automatiquement. ',/,&
+'@ ',/,&
+'@ L''utilisateur ne doit pas les renseigner dans usini1, or ',/,&
+'@ pour le scalaire ',I10 ,' correspondant au scalaire ',/,&
+'@ physique particuliere ',I10 ,' on a ',/,&
+'@ ISCSTH(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+' ',/,&
+' Pas d erreur detectee lors de la verification des donnees ',/,&
+' (usfui1).',/)
+ 9999 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES PARAMETRES DE CALCUL SONT INCOHERENTS OU INCOMPLETS ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute (',I10,' erreurs). ',/,&
+'@ ',/,&
+'@ Se reporter aux impressions precedentes pour plus de ',/,&
+'@ renseignements. ',/,&
+'@ Verifier usfui1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
diff --git a/src/fuel/fuiniv.f90 b/src/fuel/fuiniv.f90
new file mode 100644
index 0000000..67c1385
--- /dev/null
+++ b/src/fuel/fuiniv.f90
@@ -0,0 +1,378 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fuiniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION FUEL
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ige, mode, iphas, icla
+
+double precision t1init, h1init, coefe(ngazem)
+double precision t2init, h2init
+double precision xkent, xeent, d2s3
+
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+! RQ IMPORTANTE : pour la combustion FU, 1 seul passage suffit
+
+if ( isuite.eq.0 .and. ipass.eq.1 ) then
+
+ iphas = 1
+
+! --> Initialisation de k et epsilon comme dans ESTET
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+ do iel = 1, ncel
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+ enddo
+
+ endif
+
+! --> On initialise tout le domaine de calcul avec de l'air a TINITK
+! ================================================
+
+! ---- Calculs de H1INIT et H2INIT
+
+ t1init = t0(iphas)
+ t2init = t0(iphas)
+
+! ------ Variables de transport relatives a la phase liquide
+
+ h2init = h02fol + cp2fol*(t2init-trefth)
+
+ do icla = 1, nclafu
+ do iel = 1, ncel
+ rtp(iel,isca(iyfol(icla))) = zero
+ rtp(iel,isca(ing(icla) )) = zero
+ rtp(iel,isca(ihlf(icla))) = h2init
+ enddo
+ enddo
+
+! ------ Variables de transport relatives au melange
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+
+ coefe(io2) = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
+ coefe(in2) = 1.d0 - coefe(io2)
+ mode = -1
+ call futhp1 &
+ !==========
+ ( mode , h1init , coefe , t1init )
+
+ do iel = 1, ncel
+ rtp(iel,isca(ihm)) = h1init
+ enddo
+
+! ------ Variables de transport relatives au melange gazeux
+! (scalaires passifs et variances associees)
+
+ do iel = 1, ncel
+ rtp(iel,isca(ifvap)) = zero
+ rtp(iel,isca(ifhtf)) = zero
+ rtp(iel,isca(if4p2m)) = zero
+ if ( ieqco2.ge.1 ) then
+ rtp(iel,isca(iyco2)) = zero
+ endif
+ if ( ieqnox.eq.1 ) then
+ rtp(iel,isca(iyhcn)) = zero
+ rtp(iel,isca(iyno)) = zero
+ rtp(iel,isca(itaire)) = 20.d0+tkelvi
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 2. ON DONNE LA MAIN A L'UTILISATEUR
+!===============================================================================
+
+if (ipass.eq.1) then
+
+ call usfuiv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt, &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+endif
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/fulecd.f90 b/src/fuel/fulecd.f90
new file mode 100644
index 0000000..14ddc9d
--- /dev/null
+++ b/src/fuel/fulecd.f90
@@ -0,0 +1,729 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine fulecd
+!================
+!===============================================================================
+! FONCTION :
+! ---------
+
+! LECTURE DU FICHIER DE DONNEES PHYSIQUE PARTICULIERE
+! RELATIF A LA COMBUSTION FUEL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+! VARIABLES LOCALES
+
+character *150 chain1,chain2
+character *12 nomcoe(ngazem)
+
+integer it , ice , iat , ios
+integer ncoel , inicoe
+integer icla
+integer idebch , ifinch , lonch , ichai , ichcoe
+integer atcoel(ngazem,natom), inicha
+
+double precision tmin , tmax
+double precision wmolce(ngazem), ehcoel(ngazem,npot)
+double precision cpcoel(ngazem,npot)
+double precision ncfov,nhfov,nofov,nsfov
+double precision mhsfov,mcofov,mchfov,mtofov
+double precision nhsfov,ncofov,ncmv,nhmv
+double precision ch2fv,ch4fv,h02fov,yo2ox
+
+!===============================================================================
+!==================================================
+! 1. LECTURE DU FICHIER DONNEES SPECIFIQUES
+!==================================================
+
+! --> Ouverture du fichier
+
+open ( unit=impfpp, file=ficfpp, &
+ STATUS='OLD', FORM='FORMATTED', ACCESS='SEQUENTIAL', &
+ iostat=ios, err=99 )
+rewind (unit=impfpp,err=99 )
+
+! --> Lecture thermochimie
+
+read (impfpp,*,err=999,end=999 )
+
+! ---- Nb de constituants elementaires (gazeux,liquide et solide)
+
+read ( impfpp,*,err=999,end=999 ) ncoel
+if ( ncoel.gt.ngazgm ) then
+ write(nfecra,9991) ngazgm,ncoel
+ call csexit (1)
+endif
+
+! ---- Nb de points de tabulation ENTH-TEMP
+
+read ( impfpp,*,err=999,end=999 ) npo
+if ( npo.gt.npot ) then
+ write(nfecra,9992) npot,npo
+ call csexit (1)
+endif
+
+! --- Lecture des noms des constituants elementaires
+
+do ice=1,ncoel
+ do inicoe=1,len(nomcoe(ice))
+ NOMCOE(ICE)(INICOE:INICOE)=' '
+ enddo
+enddo
+
+do inicha=1,len(chain1)
+ CHAIN1(INICHA:INICHA)=' '
+enddo
+
+do inicha=1,len(chain2)
+ CHAIN2(INICHA:INICHA)=' '
+enddo
+
+read (impfpp,*,err=999,end=999)
+! READ (IMPFPP,*,ERR=999,END=999) CHAIN2
+read (impfpp,1010,err=999,end=999 ) chain1
+call verlon (chain1, idebch, ifinch, lonch)
+chain2(1:lonch)=chain1(idebch:ifinch)
+
+ice=1
+ichcoe=0
+do ichai = 1, lonch
+ IF (CHAIN2(ICHAI:ICHAI).NE.' ') THEN
+ ichcoe=ichcoe+1
+ nomcoe(ice)(ichcoe:ichcoe) =chain2(ichai:ichai)
+ else
+ if (ichcoe.ne.0) then
+ ice=ice+1
+ ichcoe=0
+ endif
+ endif
+enddo
+
+ 1010 format(a150)
+
+! --- Temperature Min et Max
+
+read (impfpp,*,err=999,end=999) tmin
+read (impfpp,*,err=999,end=999) tmax
+
+
+! ---- Nb especes atomiques (C, H, O, N, ...)
+
+read (impfpp,*,err=999,end=999 ) nato
+if ( nato.gt.natom ) then
+ write(nfecra,9993) natom,nato
+ call csexit (1)
+ !==========
+endif
+
+! ---- Masse molaire especes atomiques
+! Composition des constituants elementaires en fonction
+! des especes elementaires
+
+do iat = 1, nato
+ read (impfpp,*,err=999,end=999 ) wmolat(iat), &
+ ( atcoel(ice,iat),ice=1,ncoel )
+enddo
+
+! ---- Calcul des masses molaires des constituants elementaires
+
+do ice = 1, ncoel
+ wmolce(ice) = 0.d0
+ do iat = 1, nato
+ wmolce(ice)= wmolce(ice) + atcoel(ice,iat)*wmolat(iat)
+ enddo
+enddo
+
+
+! --> Lecture rayonnement
+
+read (impfpp,*,err=999,end=999 )
+
+! ---- Coefficient d'absorption du melange gazeux
+
+read (impfpp,*,err=999,end=999 ) ckabs1
+
+
+! --> Lecture caracteristiques fuel
+
+read (impfpp,*,err=999,end=999 )
+
+! ---- Nb de classes de fuel
+
+read (impfpp,*,err=999,end=999 ) nclafu
+
+! --> Diametre initial (mm)
+
+read (impfpp,*,err=999,end=999 ) ( dinifl(icla),icla=1,nclafu )
+
+! --> Composition elementaire en C, H, O, S, In (% en masse)
+! In d�signe les inertes (m�taux, etc.) qui resteront
+! dans le r�sidu solide
+
+read (impfpp,*,err=999,end=999 ) cfol
+read (impfpp,*,err=999,end=999 ) hfol
+read (impfpp,*,err=999,end=999 ) ofol
+read (impfpp,*,err=999,end=999 ) sfol
+
+cfol = 1.d-2 * cfol
+hfol = 1.d-2 * hfol
+ofol = 1.d-2 * ofol
+sfol = 1.d-2 * sfol
+xinfol = 1.d0-cfol-hfol-ofol-sfol
+if (xinfol .lt. zero) then
+ WRITE(NFECRA,*)'Erreur dans les fractions massiques du FOL'
+! STOP
+endif
+WRITE (NFECRA,*) 'Fractions massiques elementaires / FOL '
+WRITE (NFECRA,*) ' C = ',CFOL
+WRITE (NFECRA,*) ' H = ',HFOL
+WRITE (NFECRA,*) ' O = ',OFOL
+WRITE (NFECRA,*) ' S = ',SFOL
+WRITE (NFECRA,*) ' In= ',XINFOL
+
+
+! --> PCI
+
+read (impfpp,*,err=999,end=999 ) pcifol
+
+! --> CP moyen du fuel sec (J/kg/K)
+
+read (impfpp,*,err=999,end=999 ) cp2fol
+
+! --> Masse volumique initiale (kg/m3)
+
+read (impfpp,*,err=999,end=999 ) rho0fl
+
+! --> Caracteristiques du coke
+
+read (impfpp,*,err=999,end=999)
+
+! ------- Composition elementaire en C, H, O, S (% / pur)
+
+read (impfpp,*,err=999,end=999 ) ckf
+read (impfpp,*,err=999,end=999 ) hkf
+read (impfpp,*,err=999,end=999 ) okf
+read (impfpp,*,err=999,end=999 ) skf
+
+ckf = 1.d-2 * ckf
+hkf = 1.d-2 * hkf
+okf = 1.d-2 * okf
+skf = 1.d-2 * skf
+
+if ( abs(ckf+hkf+okf+skf-1.d0) .gt. 1.d-15 ) then
+ write(nfecra,9990) ckf+hkf+okf+skf
+ call csexit(1)
+endif
+
+! ------ PCI
+
+read (impfpp,*,err=999,end=999 ) pcikf
+
+! ---- Fraction de coke dans le fuel
+
+read (impfpp,*,err=999,end=999) fkc
+WRITE (NFECRA,*)' Fraction massique de coke / FOL'
+write (nfecra,*) fkc
+
+! Les inertes restent dans le coke
+xinkf = zero
+if ( fkc .gt. zero) xinkf = xinfol/fkc
+if ( (ckf+hkf+okf+skf) .gt. 1.d0) then
+ WRITE(NFECRA,*)'Erreur dans les fractions massiques du KF'
+! STOP
+endif
+
+WRITE (NFECRA,*) 'Fractions massiques elementaires / coke '
+WRITE (NFECRA,*) ' C = ',CKF*(1.D0-XINKF)
+WRITE (NFECRA,*) ' H = ',HKF*(1.D0-XINKF)
+WRITE (NFECRA,*) ' O = ',OKF*(1.D0-XINKF)
+WRITE (NFECRA,*) ' S = ',SKF*(1.D0-XINKF)
+WRITE (NFECRA,*) ' In= ',XInKF
+
+! Compatibilite des fractions massiques et des formules mol�culaires
+! masses �l�mentaires dans le fuel, le coke, les vapeurs
+! F K MV
+! C CFOL CKF*FKC CFOL-CKF*FKC
+! H HFOL HKF*FKC HFOL-HKF*FKC
+! O OFOL OKF*FKC OFOL-OKF*FKC
+! S SFOL SKF*FKC SFOL-SKF*FKC
+! In XInFOL XInFOL 0
+! elements dans les vapeurs
+ncfov = (cfol-ckf*fkc*(1.d0-xinkf))/wmolat(iatc)/(1.d0-fkc)
+nhfov = (hfol-hkf*fkc*(1.d0-xinkf))/wmolat(iath)/(1.d0-fkc)
+nofov = (ofol-okf*fkc*(1.d0-xinkf))/wmolat(iato)/(1.d0-fkc)
+nsfov = (sfol-skf*fkc*(1.d0-xinkf))/wmolat(iats)/(1.d0-fkc)
+! on consid�re que S se d�gage sous forme H2S
+! que O CO
+nhsfov = nsfov
+ncofov = nofov
+ncmv = ncfov - ncofov
+nhmv = nhfov - 2.d0*nhsfov
+
+! Les vapeurs sont alors constitu�es de nHSFOV moles de H2S
+! nCOFOV CO
+! nCMV CHn
+! o� CHn est un hydrocarbure mod�le de formule moyenne avec
+nhcfov = nhmv/ncmv
+WRITE(NFECRA,*) ' nHCFOV = ',NHCFOV ,NHMV,NCMV
+
+! Les masses dans les vapeurs sont
+mhsfov = (wmolat(iats)+2.d0*wmolat(iath))*nhsfov
+mcofov = (wmolat(iatc)+wmolat(iato))*ncofov
+mchfov = wmolat(iatc)*ncmv+wmolat(iath)*nhmv
+mtofov = mhsfov+mcofov+mchfov
+
+WRITE(NFECRA,*) ' mtoFOV = ',MTOFOV
+
+! Les fractions massiques dans les vapeurs sont
+hsfov = mhsfov / mtofov
+cofov = mcofov / mtofov
+chfov = mchfov / mtofov
+WRITE (NFECRA,*) 'Fractions massiques sp�cifiques / FOV '
+WRITE (NFECRA,*) ' H2S = ',HSFOV
+WRITE (NFECRA,*) ' CO = ',COFOV
+WRITE (NFECRA,*) ' CHn = ',CHFOV
+WRITE (NFECRA,*) ' ..n = ',nHCFOV
+ch4fv = zero
+ch2fv = chfov
+if ( nhcfov.ge.2.d0 .and. nhcfov.le.4.d0 ) then
+ WRITE(NFECRA,*) 'Le FOV est equivalent a un melange '
+ ch2fv = 2.d0-0.5d0*nhcfov
+ ch4fv = (1-ch2fv)*16.d0/(12.d0+nhcfov)
+ ch2fv = ch2fv*14.d0/(12.d0+nhcfov)
+ ch4fv = ch4fv * chfov
+ ch2fv = ch2fv * chfov
+ WRITE (NFECRA,*) ' H2S = ',HSFOV
+ WRITE (NFECRA,*) ' CO = ',COFOV
+ WRITE (NFECRA,*) ' CH4 = ',CH4FV
+ WRITE (NFECRA,*) 'C2H4 = ',CH2FV
+endif
+WRITE(NFECRA,*) ' nHCFOV 2 = ',NHCFOV
+
+! ---- Parametre d'evaporation
+
+ read (impfpp,*,err=999,end=999) tevap1
+ read (impfpp,*,err=999,end=999) tevap2
+
+! ---- Parametres combustion heterogene (modele a sphere retrecissante)
+
+read (impfpp,*,err=999,end=999 )
+
+read (impfpp,*,err=999,end=999 ) ahetfl
+read (impfpp,*,err=999,end=999 ) ehetfl
+read (impfpp,*,err=999,end=999 ) iofhet
+
+! --> Fermeture du fichier (ne pas oublier, car l'unite sert pour janaf)
+
+close(impfpp)
+
+!==============================================
+! 2.
+!==============================================
+
+
+! --> Discretisation de la temperature
+
+do it = 1, npo
+ th(it) = dble(it-1)*(tmax-tmin)/dble(npo-1) + tmin
+enddo
+
+! --> Calcul des enthalpies pour les differentes especes courantes
+
+call pptbht &
+!==========
+ ( ncoel , &
+ nomcoe , ehcoel , cpcoel , wmolce )
+
+! --> Calcul tabulation enthalpie - temperature pour le melange gazeux
+
+! ---- Nb de constituants gazeux
+! ATTENTION ON COMPTE EGALEMENT H2S et le monomere SO2
+
+ngaze = 8
+
+! ---- Definition des pointeurs pour les tableaux WMOLE et EHGAZE
+! REMARQUE : Cette position de pointeurs va egalement servir
+! pour le tableau de pointeurs IYM1 relatif aux
+! tableaux PROPCE et PROPFB
+! ON BALAYE JUSTE DE 1 A NGAZE
+
+! ATTENTION : ordre des esp�ces dans EHCOEL, WMOLCE
+! vient du fichier data_FUE
+! Actuellement 1 CH4
+! 2 C2H4
+! 3 CO
+! 4 O2
+! 5 CO2
+! 6 H2O
+! 7 N2
+! 8 C (solide)
+! 9 H2S
+! 10 SO2
+ifov = 1
+ico = 2
+ih2s = 3
+ih2o = 4
+ico2 = 5
+iso2 = 6
+io2 = 7
+in2 = 8
+
+! ---- Remplissage de EHGAZE et WMOLE
+! a partir de EHCOEL et WMOLCE
+
+do it = 1, npo
+ ehgaze(ifov ,it) = ( ch4fv*ehcoel(1,it) + ch2fv*ehcoel(2,it) )
+ ehgaze(ico ,it) = ehcoel( 3,it)
+ ehgaze(io2 ,it) = ehcoel( 4,it)
+ ehgaze(ico2 ,it) = ehcoel( 5,it)
+ ehgaze(ih2o ,it) = ehcoel( 6,it)
+ ehgaze(in2 ,it) = ehcoel( 7,it)
+ ehgaze(ih2s ,it) = ehcoel( 9,it)
+ ehgaze(iso2 ,it) = ehcoel(10,it)
+enddo
+wmole(ifov ) = (ch4fv+ch2fv)/(ch4fv/wmolce(1)+ch2fv/wmolce(2))
+
+wmole(ifov ) = (1.d0*0.012d0 + nhcfov *0.001d0 )
+WRITE(NFECRA,*) ' Wmole IFOV = ',WMOLE(IFOV ),CH4FV,CH2FV
+wmole(ico ) = wmolce( 3)
+wmole(io2 ) = wmolce( 4)
+wmole(ico2 ) = wmolce( 5)
+wmole(ih2o ) = wmolce( 6)
+wmole(in2 ) = wmolce( 7)
+wmole(ih2s ) = wmolce( 9)
+wmole(iso2 ) = wmolce(10)
+
+! Concentrations dans les vapeurs
+afovf1 = chfov / wmole(ifov)
+acof1 = cofov / wmole(ico)
+ah2sf1 = hsfov / wmole(ih2s)
+! Caract�risation de l'oxydant
+yo2ox = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
+! Caract�ristion des gaz issus de la combustion h�t�rog�ne
+! Max est le point o� F3 est maximal ; il correspond � un
+! m�lange stoechiometrique de coke et d'oxydant
+! On suppose, pour l'instant, que l'oxydant est un melange O2, N2
+! � modifier si recyclage de fum�es
+! FF3MAX(CKF*C+OKF*O+SKF*S+HKF*H) + (1-F3max)*(YO2Ox*O2+(1-YO2Ox)*N2) =>
+! CO + H2O + H2S + N2
+! On suppose que S est prioritaire pour H
+! Masse de C dans les r�actants FF3MAX*CKF
+! Masse de O FF3MAX*OKF + (1-F3max)*YO2Ox
+! Masse de S FF3MAX*SKF
+! Masse de H FF3MAX*HKF
+! Masse de N (1-FF3MAX)*(1-YO2Ox)
+! Nombre de C FF3MAX*CKF / WMOLAT(IATC)
+! Nombre de O (FF3MAX*OKF+(1-F3max*YO2Ox)/WMOLAT(IATO)
+! Nombre de S FF3MAX*SKF / WMOLAT(IATS)
+! Nombre de H FF3MAX*HKF / WMOLAT(IATH)
+! Nombre de moles de H2S dans les produits = nombre de moles de S
+! Nombre de moles de H2O dans les produits = 1/2 nombre H-nb moles H2S
+! Nombre de moles de CO = nombre de moles de C
+! Nombre de moles de O dans les produits = nb moles CO + H2O
+! Et il vient :
+! FF3MAX * ( CKF/WMOLAT(IATC) + 0.5*HKF/WOLAT(IATH) - SKF/WMOLAT(IATS)
+! -OKF/WMOALT(IATO) - YO2Ox/WOLAT(IATO) )
+! = YO2Ox/WMOLAT(IATO)
+
+! FF3MAX = YO2Ox /(0.016*(CKF/.012 + 0.5*HKF/.001 -SKF/.032)-OKF+YO2Ox)
+
+ ff3max = yo2ox/(wmolat(iato)*(ckf/wmolat(iatc) &
+ +0.5d0*hkf/wmolat(iath) &
+ -skf/wmolat(iats)) &
+ -okf + yo2ox)
+
+! AXXF3 nb de moles de l'esp�ce XX en kilog de F3 calcules en FF3MAX
+ ah2sf3 = ff3max*skf/wmolat(iats)
+ ah2of3 = 0.5d0*ff3max*hkf/wmolat(iath)-ah2sf3
+ acof3 = ff3max*ckf/wmolat(iatc)
+
+! AO2F3 = 0.5d0*FF3MAX*( OKF/WMOLAT(IATO)-CKF/WMOLAT(IATC)
+! & -0.5*HKF/WMOLAT(IATH)+SKF/WMOLAT(IATS))
+ ao2f3 = 0.d0
+
+ an2f3 = (1.d0-yo2ox)/wmole(in2) * (1.d0-ff3max)
+
+ ao2f4 = yo2ox/wmole(io2)
+ an2f4 = (1.d0-yo2ox)/wmole(in2)
+
+! Avec cette convention la concentration en O2 est n�gative en FF3MAX
+! ceci correspond � l'oxyg�ne absorb� par la r�action h�t�rog�ne.
+
+! --> Calcul tabulation enthalpie - temperature pour la phase dispersee
+! Fuel Oil Liquid et Coke
+
+! ---- Nb de constituants solide
+
+nsolid = 2
+
+! ---- Definition des pointeurs IFOL et IKF
+
+ifol = 1
+ikf = 2
+
+! ------ Calcul de H02FOL
+
+! H0, EH & PCI en J/kg
+! CFOL, HFOL sont des fractions massiques �l�mentaires
+! rapports des masses molaires des produits aux �l�ments du
+! combustible (le comburant est dans l'�tat de r�f.)
+
+! ------ Calcul de HRFVAP
+
+! L'enthalpie de formation du fuel gazeux est connue (m�lange CH4, C2H4),
+! Le PCI du fuel liquide est connu , on peut donc reconstituer son
+! enthalpie de formation (on n�glige l'effet de H2S => SO2)
+! on introduit les enthalpies de formation massique du CO2 et de H2O
+
+ h02fol = pcifol &
+ + cfol * 44.d0/12.d0 * ehcoel(5,1) &
+ + hfol * 18.d0/2.d0 * ehcoel(6,1)
+! H02FOL en J/kg (de fol)
+! L'enthalpie de formation de la vapeur de fuel
+! est suppos�e etre des celle des seuls hydrocarbures
+! (i.e. on n�glige, pour l'instant, CO et H2S)
+ h02fov = ch4fv * ehcoel(1,1) + ch2fv * ehcoel(2,1)
+! L'enthalpie de formation du coke peut-�tre consid�r�e nulle
+! (pas loin du graphite)
+
+! L'enthalpie de changement de phase est donc celle de la r�action
+! Fuel_Liquide => FKC*Coke + (1-FKC)*Fuel_Vapeur
+ hrfvap = (1.d0-fkc)*h02fov-h02fol
+
+ WRITE(NFECRA,*) 'Donnees thermo pour le fuel'
+ WRITE(NFECRA,*) 'PCIFOL ',PCIFOL
+ WRITE(NFECRA,*) 'H02FOL ',H02FOL
+ WRITE(NFECRA,*) 'CP2FOL ',CP2FOL
+ WRITE(NFECRA,*) 'HRFVAP ',HRFVAP
+ WRITE(NFECRA,*) 'H02FOV ',H02FOV
+
+! L'enthalpie de la r�action h�t�rog�ne est directement celle de la
+! formation d'une mole de CO � partir de carbone � l'�tat de r�f�rence
+! il est d'usage d'ajouter cette enthalpie � celle de la phase
+! dispers�e
+
+! ------ Calcul de EHSOLI pour le fuel
+! Si CP2FOL > 0 : HFOL = H02FOL + CP2FOL(T2-TREFTH)
+
+ do it = 1, npo
+ ehsoli(ifol,it) = h02fol &
+ + cp2fol * ( th(it) - trefth )
+ enddo
+
+! ---- Calcul relatif au coke
+
+! ------ Coke = CH(GAMMA)O(DELTA)
+
+! On considere le PCI constant qqs T
+
+! Soit le PCI est connu et fourni dans le fichier
+! soit on consid�re qu'il est entierement fourni
+! par la combustion de la fraction carbone
+! suppos�e � l'�tat de r�f�rence
+ do it = 1, npo
+ ehsoli(ikf,it) = cp2fol * ( th(it) - trefth )
+ enddo
+
+WRITE(NFECRA,*) ' Verification des enthalpies de formation'
+WRITE(NFECRA,*) ' CH4 ',EHCOEL(1,1)
+WRITE(NFECRA,*) ' C2H4 ',EHCOEL(2,1)
+WRITE(NFECRA,*) ' FOV ',EHGAZE(IFOV,1)
+WRITE(NFECRA,*) ' FOL ',EHSOLI(IFOL,1)
+WRITE(NFECRA,*) ' KF ',EHSOLI(IKF,1)
+
+! Masse Vol + Diametre (en milimetres)
+! on suppose que les masse vol sont les memes
+! pour le fuel, coke et residu
+
+rhokf = rho0fl
+do icla = 1, nclafu
+ dinikf(icla) = dinifl(icla)*(fkc*rho0fl/rhokf)**(1.d0/3.d0)
+ diniin(icla) = dinifl(icla)*(xinfol*rho0fl/rho0fl)**(1.d0/3.d0)
+ WRITE(NFECRA,*) ' Classe D = ',ICLA,DINIFL(ICLA),DINIKF(ICLA), &
+ diniin(icla)
+enddo
+
+return
+
+
+!============================
+! 3. SORTIE EN ERREUR
+!============================
+
+ 99 continue
+write ( nfecra,9998 )
+call csexit (1)
+!==========
+
+ 999 continue
+write ( nfecra,9999 )
+call csexit (1)
+!==========
+!--------
+! FORMATS
+!--------
+
+
+ 9990 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (FULECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) ',/,&
+'@ ',/,&
+'@ Erreur sur la composition du Coke : ',/,&
+'@ la somme des compositions elementaires doit etre egal ',/,&
+'@ a 1, elle vaut ici : ',G15.7,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9991 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (FULECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes courantes doit etre inferieur ',/,&
+'@ ou egal a',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9992 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (FULECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) ',/,&
+'@ ',/,&
+'@ Le nombre de points de tabulation est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9993 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (FULECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) ',/,&
+'@ ',/,&
+'@ Le nombre d''especes elementaires est limite a ',I10 ,/,&
+'@ Il vaut ',I10 ,' dans le fichier parametrique ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9998 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (FULECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) ',/,&
+'@ ',/,&
+'@ Erreur a l''ouverture du fichier parametrique. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES (FULECD) ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE (FUEL) ',/,&
+'@ ',/,&
+'@ Erreur a la lecture du fichier parametrique. ',/,&
+'@ Le fichier a ete ouvert mais est peut etre incomplet ',/,&
+'@ ou son format inadapte. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+end
+
+
diff --git a/src/fuel/fupdfr.f90 b/src/fuel/fupdfr.f90
new file mode 100644
index 0000000..81e4b65
--- /dev/null
+++ b/src/fuel/fupdfr.f90
@@ -0,0 +1,235 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fupdfr &
+!================
+
+ ( ncelet , ncel , &
+ fvap , fhtf , f4p2m , &
+ indpdf , &
+ f4m1 , f4m2 , d4cl , d4f4 )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DU TYPE DE PDF
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! fvap ! tr ! <-- ! moyenne du traceur 1 mvl [fovm+co] !
+! fhet ! tr ! -> ! moyenne du traceur 3 c h�terog�ne !
+! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
+! indpdf ! te ! <-- ! passage par les pdf !
+! f4m1 ! tr ! <-- ! borne minimum !
+! f4m2 ! tr ! <-- ! borne max !
+! d4cl ! tr ! <-- ! amplitude du pic de dirac en f4cl !
+! d4f4 ! tr ! <-- ! amplitude du pic de dirac en 1 !
+! ! ! ! (air pur) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+integer indpdf(ncelet)
+
+double precision fvap(ncelet) , fhtf(ncelet) , f4p2m(ncelet)
+double precision f4m1(ncelet) , f4m2(ncelet) , d4cl(ncelet)
+double precision d4f4(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel
+
+! Variables pour le support de la Pdf et sa description
+
+double precision t1,t2
+double precision f4m,f42m,f1cl,f3cl,f4cl,f1m,f3m
+
+double precision d2pd1,d2md1
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! Bornes pour le passage par les pdf T1 sur var, T2 sur moy
+
+t1 = 1.d-4
+t2 = 5.d-3
+
+! --- Initialisation des tableaux
+
+do iel = 1, ncel
+ f4m1(iel) = 0.d0
+ f4m2(iel) = 0.d0
+ d4cl(iel) = 0.d0
+ d4f4(iel) = 0.d0
+
+ indpdf(iel) = 0
+enddo
+
+!===============================================================================
+! 2. TYPE DE PDF
+! INDPDF = 0 : PAS DE PDF
+! INDPDF = 1 : Passage par les PDF
+
+! CALCULS DES PARAMETRES DE LA PDF : F4M1,F4M2,D4CL,D4F4
+! CALCUL DE F4I7
+
+
+!===============================================================================
+
+do iel = 1, ncel
+
+! Traceur virtuel au point moyen
+ f1m = fvap(iel)
+ f3m = fhtf(iel)/ff3max
+ f4m = 1.d0 - f1m - f3m
+
+! Calcul des caract�ristiques du point correspondant au
+! combustible moyen
+! F3cl : fraction de masse provenant de F3max et non de F3
+
+ f1cl = f1m*ff3max/(f3m+f1m*ff3max)
+ f3cl = 1.d0-f1cl
+ f4cl = (1.d0-ff3max)*f3cl
+
+! L'intervalle permis pour F4 est [F4cl , 1 ]
+! La valeur maximale de la variance est donc
+! F4p2max = (F4m-F4cl)*(1-F4m)
+! On ne passe par les PDF que si la variance repr�sente
+! une fraction significative de son maximum
+
+ if ( f4m .gt. ( f4cl + t2 ) .and. &
+ f4m .lt. ( 1.d0 - t2 ) .and. &
+ f4p2m(iel) .gt. (t1*(f4m-f4cl)*(1.d0-f4m)) ) then
+ indpdf(iel) = 1
+ else
+ indpdf(iel) = 0
+ endif
+
+ if ( indpdf(iel) .eq.1 )then
+
+! Calcul pr�liminaire pour une pdf rectangle et pics de Dirac
+! sur une droite passant par l'entr�e d'air (F4) et le
+! combsutible moyen local Fcl
+! Soit F4m1 la borne Min
+! F4m2 la borne Max
+! D4cl amplitude du pic de Dirac en F4cl
+! D4f4 amplitude du pic de Dirac en 1 (air pur)
+
+ f42m = f4m**2 + f4p2m(iel)
+
+! rectangle seul
+
+ f4m1(iel) = f4m - sqrt(3.d0*f4p2m(iel))
+ f4m2(iel) = f4m + sqrt(3.d0*f4p2m(iel))
+ d4cl(iel) = zero
+ d4f4(iel) = zero
+
+ if ( f4m1(iel).le.f4cl .or. f4m2(iel).ge. 1.d0) then
+
+! pic en Fcl
+
+ f4m1(iel) = f4cl
+ f4m2(iel) = (3.d0*f42m + f4cl**2 - 4.d0*f4cl*f4m) &
+ /(2.d0*(f4m-f4cl))
+ d4cl(iel) = (f4cl+f4m2(iel)-2.d0*f4m) &
+ /(f4m2(iel)-f4cl)
+
+ if (f4m2(iel).ge.1.d0 .or. d4cl(iel).le.zero) then
+
+! pic en F4
+
+ f4m2(iel) = 1.d0
+ f4m1(iel) = (3.d0*f42m + 1.d0 - 4.d0*f4m) &
+ /(2.d0*(f4m-1.d0))
+ d4f4(iel) = (2.d0*f4m-1.d0-f4m1(iel)) &
+ /(1.d0-f4m1(iel))
+ d4cl(iel) = 0.d0
+
+ if (f4m1(iel).le.f4cl .or. d4f4(iel).le.zero) then
+
+ f4m1(iel) = f4cl
+ f4m2(iel) = 1.d0
+ d2pd1 = (2.d0*f4m-1.d0-f4cl)/(1.d0-f4cl)
+ d2md1 = ( 6.d0*(f42m-f4m*(1.d0+f4cl)) &
+ + 1.d0+f4cl**2+4.d0*f4cl) &
+ / (1.d0-f4cl)**2
+ d4f4(iel) = 0.5d0*(d2pd1+d2md1)
+ d4cl(iel) = 0.5d0*(d2pd1-d2md1)
+ endif
+
+ endif
+
+ endif
+
+ endif
+
+enddo
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/fuphy1.f90 b/src/fuel/fuphy1.f90
new file mode 100644
index 0000000..e12f753
--- /dev/null
+++ b/src/fuel/fuphy1.f90
@@ -0,0 +1,365 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine fuphy1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ nitbfu , nrtbfu , nitbwo , nrtbwo , &
+ fvap , fhtf , f4p2m , &
+ enth , &
+ rtp , propce , rom1 , &
+ itbfu , rtbfu , &
+ itbwo , rtbwo )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE GAZEUSE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE, MASSE VOLUMIQUE ET CONCENTRATIONS MOYENNES
+! (UTILISATION D'UNE PDF RECTANGLE-DIRAC)
+
+! ==> CHIMIE RAPIDE MODELE EN 3 POINTS
+! EXTENSION A TROIS COMBUSTIBLES POUR LE CHARBON PULVERISE
+! --------------------
+
+! REACTIONS HETEROGENES
+! - Evaporation
+! Composition de la vapeur (FOV pour Fuel Oil Vapor)
+
+! Le FOV est suppos� �tre un m�lange de H2S, CO, CHn
+! Les fractions massiques sont HSFOV pour H2S
+! COFOV CO
+! CHFOV CHn
+! l'hydrocarbure moyen est d�termine par nHCFOV
+
+! - Combustion heterogene
+! La composition massque �l�mentairee du coke est donn�e par
+! CKF, HKF, OKF, SKF
+! (et InKF inertes qui resteront dans l'inclusion)
+! lors de la r�action h�terogn�ne, on d�gaze H2S, H2O, CO
+
+! Attention, ceci signifie qu'en presence de FHET il y a
+! eut pr�levement d'O2 dans l'air environnant
+! (avant les r�action homog�nes).
+
+! - Reactions en phase gaz
+
+! Avec l'O2 restant dans l'air (apr�s dilution et oxydation h�t�rog�ne)
+! on consid�re des r�action s successives dans leur ordre
+! de priorit� pour l'acc�s � l'O2
+! CHn + (1/2+n/4)O2 -(1)-> CO + n/2 H2O
+! H2S + 3/2 O2 -(2)-> SO2 + H2O
+! CO + 1/2 O2 -(3)-> CO2
+
+! CHOIX DES VARIABLES
+
+
+! Soit Y les fractions massiques et Z les concentrations (moles/kg)
+! indice f avant reaction, b final
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nitbfu ! e ! <-- ! taille du macro tableau fuel entiers !
+! nrtbfu ! e ! <-- ! taille du macro tableau fuel reels !
+! nitbwo ! e ! <-- ! taille du macro tableau work entiers !
+! nrtbwo ! e ! <-- ! taille du macro tableau work reels !
+! pa ! tr ! <-- ! pression absolue en pascals !
+! fvap ! tr ! <-- ! moyenne du traceur 1 fov [chn+co] !
+! fhtf ! tr ! <-- ! moyenne du traceur 3 (co c.het) !
+! f4p2m ! tr ! <-- ! variance du traceur 4 (air) !
+! enth ! tr ! <-- ! enthalpie en j/kg soit du gaz !
+! ! ! ! soit du melange !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! itbfu ! tr ! <-- ! macro tableau entier fuel travail !
+! rtbfu ! tr ! <-- ! macro tableau reel fuel travail !
+! itbwo ! tr ! <-- ! macro tableau entier travail !
+! rtbwo ! tr ! <-- ! macro tableau reel travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+integer nitbfu , nrtbfu
+integer nitbwo , nrtbwo
+integer itbfu(ncelet,nitbfu)
+integer itbwo(ncelet,nitbwo)
+
+double precision fvap(ncelet), fhtf(ncelet)
+double precision f4p2m(ncelet), enth(ncelet)
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision rom1(ncelet)
+double precision rtbfu(ncelet,nrtbfu)
+double precision rtbwo(ncelet,nrtbwo)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , iphas , ice
+integer ipcte1
+integer ipcyf1 , ipcyf3 , ipcyox
+integer ipcyp1 , ipcyp2 , ipcyin , ipcyce
+integer ipcy2s , ipcyso
+double precision wmolme
+double precision f1m,f3m,f4m,f1cl,f3cl,f4cl
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. DETERMINATION DU TYPE DE PDF
+!===============================================================================
+
+do iel = 1, ncel
+
+! Traceur virtuel au point moyen
+
+ f1m = fvap(iel)
+ f3m = fhtf(iel)/ff3max
+ f4m = 1.d0 - f1m - f3m
+
+! Calcul des caract�ristiques du point correspondant au
+! combustible moyen
+! F3cl : fraction de masse provenant de F3max et non de F3
+
+ if ( (f3m+f1m*ff3max) .gt. 0.d0 ) then
+ f1cl = f1m*ff3max/(f3m+f1m*ff3max)
+ else
+ f1cl = 0.d0
+ endif
+
+ f3cl = 1.d0-f1cl
+ f4cl = (1.d0-ff3max)*f3cl
+
+ rtbfu(iel,1) = f3m
+ rtbfu(iel,2) = f4m
+ rtbfu(iel,3) = f1cl
+ rtbfu(iel,4) = f3cl
+ rtbfu(iel,5) = f4cl
+
+! bornes min et max de la pdf : F4CL a 1
+
+ rtbfu(iel,6) = 1.d0
+
+enddo
+
+call pppdfr &
+!==========
+ ( ncelet,ncel, &
+ itbfu(1,1) , &
+ rtbfu(1,2), rtp(1,isca(if4p2m)), &
+! F4M
+ rtbfu(1,5), rtbfu(1,6), &
+! FMINI FMAXI
+ rtbfu(1,7) , rtbfu(1,8) , rtbfu(1,9) , rtbfu(1,10), &
+! D4CL D4F4 F4M1 F4M2
+ rtbfu(1,11) )
+! HREC
+
+!===============================================================================
+! 2.CALCUL DES CONCENTRATIONS MOYENNES
+!===============================================================================
+
+
+ipcyf1 = ipproc(iym1(ifov))
+ipcyf3 = ipproc(iym1(ico ))
+ipcyox = ipproc(iym1(io2 ))
+ipcyp1 = ipproc(iym1(ico2 ))
+ipcyp2 = ipproc(iym1(ih2o ))
+ipcyin = ipproc(iym1(in2 ))
+ipcy2s = ipproc(iym1(ih2s ))
+ipcyso = ipproc(iym1(iso2 ))
+
+ call fucym1 &
+!!==========
+ ( ncelet , ncel , &
+ itbfu(1,1) , &
+! INTPDF
+ rtp , &
+ fvap , rtbfu(1,1) , rtbfu(1,2) , &
+! F1M F3M F4M
+ rtbfu(1,3) , rtbfu(1,4) ,rtbfu(1,5) , &
+! F1CL F3CL F4CL
+
+ rtbfu(1,9) , rtbfu(1,10) , rtbfu(1,7) , &
+! F4M1 F4M2 D4CL
+ rtbfu(1,8) ,rtbfu(1,11) , &
+! D4F4 HREC
+ propce(1,ipcyf1) , propce(1,ipcyf3) , &
+ propce(1,ipcyox) , propce(1,ipcyp1) , propce(1,ipcyp2) , &
+ propce(1,ipcyin) , &
+ propce(1,ipcy2s) , propce(1,ipcyso) , &
+ rtbfu(1,12) )
+! F4S3 pour NOx
+
+! --> Clipping eventuel des fractions massiques
+
+do iel = 1, ncel
+ do ice = 1, ngaze
+ ipcyce = ipproc(iym1(ice))
+ if ( abs(propce(iel,ipcyce)) .lt. epsifl ) &
+ propce(iel,ipcyce) = zero
+ enddo
+enddo
+
+! MODEL NOx : on y passe pas a la 1ere iter
+
+if ( ieqnox .eq. 1 .and. ntcabs .gt.1) then
+ call fucyno &
+ !==========
+ ( ncelet , ncel , &
+ itbfu(1,1) , &
+! INTPDF
+ rtp , propce , &
+ fvap , rtbfu(1,1) , rtbfu(1,2) , &
+! F1M F3M F4M
+ rtbfu(1,3) , rtbfu(1,4) ,rtbfu(1,5) , &
+! F1CL F3CL F4CL
+
+ rtbfu(1,9) , rtbfu(1,10) , rtbfu(1,7) , &
+! F4M1 F4M2 D4CL
+ rtbfu(1,8) ,rtbfu(1,11) , rtbfu(1,12) , &
+! D4F4 HREC
+ propce(1,ipcyf1) , propce(1,ipcyf3) , &
+ propce(1,ipcyox) , propce(1,ipcyp1) , propce(1,ipcyp2) , &
+ propce(1,ipcyin) , &
+ propce(1,ipcy2s) , propce(1,ipcyso) )
+
+else if ( ieqnox .eq. 1 ) then
+
+ write(*,*) ' passage init ',IGHCN1,IGHCN2,IGNOTH
+ do iel = 1, ncel
+ propce(iel,ipproc(ighcn1)) = 0.d0
+ propce(iel,ipproc(ighcn2)) = 0.d0
+ propce(iel,ipproc(ignoth)) = 0.d0
+ enddo
+
+endif
+
+!===============================================================================
+! 3. CALCUL DE LA TEMPERATURE ET DE LA MASSE VOLUMIQUE
+!===============================================================================
+
+ipcte1 = ipproc(itemp1)
+
+call futeh1 &
+!==========
+ ( ncelet , ncel , &
+ enth, &
+ propce(1,ipcyf1), propce(1,ipcyf3), &
+ propce(1,ipcyox), propce(1,ipcyp1), propce(1,ipcyp2), &
+ propce(1,ipcyin), propce(1,ipcy2s), propce(1,ipcyso), &
+ propce(1,ipcte1), &
+ rtbwo(1,1) , rtbwo(1,2) )
+
+! TABLEAUX DE TRAVAIL
+
+iphas = 1
+ipcte1 = ipproc(itemp1)
+do iel = 1, ncel
+ wmolme = propce(iel,ipcyf1) / wmole(ifov) &
+ + propce(iel,ipcyf3) / wmole(ico ) &
+ + propce(iel,ipcyox) / wmole(io2 ) &
+ + propce(iel,ipcyp1) / wmole(ico2) &
+ + propce(iel,ipcyp2) / wmole(ih2o) &
+ + propce(iel,ipcyin) / wmole(in2 ) &
+ + propce(iel,ipcy2s) / wmole(ih2s) &
+ + propce(iel,ipcyso) / wmole(iso2)
+
+! stockage de la masse molaire du melange
+
+ propce(iel,ipproc(immel)) = 1.d0 / wmolme
+
+! ---- On ne met pas la pression mecanique RTP(IEL,IPR(IPHAS))
+! mais P0(IPHAS)
+
+ rom1(iel) = p0(iphas) / (wmolme * rr * propce(iel,ipcte1) )
+enddo
+
+!===============================================================================
+! FORMATS
+!----
+
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/fuphy2.f90 b/src/fuel/fuphy2.f90
new file mode 100644
index 0000000..2872d1f
--- /dev/null
+++ b/src/fuel/fuphy2.f90
@@ -0,0 +1,204 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine fuphy2 &
+!================
+
+ ( ncelet , ncel , &
+ rtp , propce )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
+! VALEURS CELLULES
+! ----------------
+
+! FRACTION MASSIQUE DE LIQUIDE
+! ET CLIPPING EVENTUELS
+! DIAMETRE
+! MASSE VOLUMIQUE
+! ET CLIPPING EVENTUELS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+
+double precision rtp(ncelet,*) , propce(ncelet,*)
+
+! VARIABLES LOCALES
+
+integer iel
+integer n1 , n2 , ipcdia , icla
+double precision xng , d1s3
+double precision rhofol , diam3m , diam3x
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+d1s3 = 1.d0/3.d0
+
+!===============================================================================
+! 2. CALCUL POUR CHAQUE CLASSE
+! DE LA MASSE VOLUMIQUE DU FOL
+! DE LA FRACTION MASSIQUE DE FOL
+! DU DIAMETRE DU COKE
+!===============================================================================
+
+do icla = 1, nclafu
+
+ n1 = 0
+ n2 = 0
+ diam3m = 1.d0
+ diam3x = 0.d0
+
+ ipcdia = ipproc(idiam3(icla))
+
+ do iel = 1, ncel
+
+! Masse Volumique
+
+ propce(iel,ipproc(irom3(icla))) = rho0fl
+
+ yfol = rtp(iel,isca(iyfol(icla)))
+ xng = rtp(iel,isca(ing(icla)))
+ rhofol = propce(iel,ipproc(irom3(icla)))
+
+! --- Calcul du diametre de la particule
+
+! Attention !
+! Diam en mm
+! Xng en Ggouttes (en milliards de gouttes/kg de m�lange)
+! �a marche mais il faudrait un facteur mis � UN pour s'y retrouver
+
+ if ( yfol .gt. epsifl .and. (xng*yfol) .gt. 0.d0) then
+
+ propce(iel,ipcdia) = ((yfol / rhofol) &
+ /(pi/6.d0 * xng) ) ** d1s3
+
+ if ( propce(iel,ipcdia) .gt. dinifl(icla) ) then
+ n1 = n1+1
+ diam3x = max(diam3x,propce(iel,ipcdia))
+ propce(iel,ipcdia) = dinifl(icla)
+ endif
+
+ if ( propce(iel,ipcdia) .lt. diniin(icla) ) then
+ n2 = n2+1
+ diam3m = min(diam3m,propce(iel,ipcdia))
+ propce(iel,ipcdia) = diniin(icla)
+ endif
+
+ else
+ propce(iel,ipcdia) = dinifl(icla)
+ endif
+
+ enddo
+
+ if (irangp.ge.0) then
+
+ call parcpt (n1)
+ !==========
+ call parcpt (n2)
+ !==========
+
+ call parmax (diam3x)
+ !==========
+ call parmin (diam3m)
+ !==========
+ endif
+
+ if ( n1 .gt. 0 ) then
+ write(nfecra,1001) icla, n1, diam3x
+ endif
+ if ( n2 .gt. 0 ) then
+ write(nfecra,1002) icla, n2, diam3m
+ endif
+
+enddo
+
+!----
+! FORMATS
+!----
+
+ 1001 format(/,1X,' CLIPPING EN MAX DU DIAMETRE CLASSE :',I2, &
+ /,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Max : ',G15.7)
+ 1002 format(/,1X,' CLIPPING EN MIN DU DIAMETRE CLASSE :',I2, &
+ /,10X,' Nombre de points : ',I8, &
+ /,10X,' Valeur Min : ',G15.7)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/fuphyv.f90 b/src/fuel/fuphyv.f90
new file mode 100644
index 0000000..f6bf18b
--- /dev/null
+++ b/src/fuel/fuphyv.f90
@@ -0,0 +1,552 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fuphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE : COMBUSTION FUEL
+
+! Calcul de RHO du melange
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usppiv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ntbfui, ifuwi, ntbfur, ifuwr
+integer ntbwoi, iwori, ntbwor, iworr
+integer ifinia, ifinra
+integer iel, iphas, ipcrom, ipcro2 , ipcte1
+integer izone, ifac , icla
+integer ipbrom, iromf
+double precision qtotz
+double precision x1sro1, x2sro2, srrom1, uns1pw
+double precision x2tot, wmolme, unsro1
+double precision x2h2
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 0. ON COMPTE LES PASSAGES
+!===============================================================================
+
+ipass = ipass + 1
+
+!===============================================================================
+! 1. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Initialisation des tableaux de travail
+
+do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+ w4(iel) = zero
+ w5(iel) = zero
+ w6(iel) = zero
+ w7(iel) = zero
+ w8(iel) = zero
+enddo
+
+! Pointeur sur masse volumique du gaz aux cellules
+iromf = ipproc(irom1)
+
+!===============================================================================
+! 2. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
+! VALEURS CELLULES
+! ----------------
+! FRACTION MASSIQUE DE LIQUIDE
+! DIAMETRE
+! MASSE VOLUMIQUE
+!===============================================================================
+
+call fuphy2 &
+!==========
+ ( ncelet , ncel , &
+ rtp , propce )
+
+!===============================================================================
+! 3. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE GAZEUSE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE
+! MASSE VOLUMIQUE
+! CONCENTRATIONS DES ESPECES GAZEUSES
+!===============================================================================
+
+! --- Calcul de l'enthalpie du gaz dans W8 si transport de H2
+! du melange si pas de transport de H2
+! de F1M dans W2
+! de F2M dans W3
+! de F3M dans W4
+! de F4M dans W5
+! de F3P2M dans W6
+! de F4P2M dans W7
+
+! ---- W1 = - Somme des X2(i)
+
+do iel = 1, ncel
+
+ w1(iel) = 0.d0
+ do icla = 1, nclafu
+ w1(iel) = w1(iel) - rtp(iel,isca(iyfol(icla)))
+ enddo
+ uns1pw = 1.d0 / ( 1.d0 + w1(iel) )
+ w2(iel) = rtp(iel,isca(ifvap)) * uns1pw
+ w4(iel) = rtp(iel,isca(ifhtf)) * uns1pw
+ w6(iel) = rtp(iel,isca(if4p2m)) * uns1pw
+
+! PPl 09 08 2006
+! Les tableaux de travail contiennent les grandeurs massiques de la
+! phase gaz
+! Les grandeurs variances de F1 et F3 ne sont pas utilis�es pour
+! la pdf passant par F4, y placer plutot la variance de F4
+
+! W6(IEL) = RTP(IEL,ISCA(IF4P2M)) * UNS1PW
+! PPl 161205
+! Attention, contrairement au cas charbon, la 2� enthalpie transport�e
+! dans le cas du fuel est celle de l'ensemble liquide + vapeur
+! dans les conditions d'�bullition.
+! La reconstitution de l'enthalpie du gaz seul est donc fausse ...
+
+! X1 * H1 = HM - HLF + FVAP * HrefEvap
+! X2 * H2 = HLF - FVAP * HrefEvap
+! o� X1 et X2 sont les fraction s massiques des deux phases
+! H1 l'enthalpie massique de la phase continue
+! H2 l'enthalpie massique de la phase dispers�e
+! HM l'enthalpie massique du m�lange
+! HLF l'enthalpie du liquide et de la vapeur
+! (ramen�e � la masse de m�lange)
+! FVAP la fraction massique du traceur attach� � la vapeur
+! HrefVap l'enthalpie massique de la vapeur dans les
+! conditons moyennes d'�vaporation soit
+! 0.5*(TEVAP1+Min(Tevap2,Tliqu))
+
+! TEBMOY = 0.5D0 * ( TEVAP1
+! & + MIN( PROPCE(IEL,IPPROC(ITEMP3)) , TEVAP2 ) )
+! EH2 = ( RTP(IEL,ISCA(IHLF ))
+! & - RTP(IEL,ISCA(IFVAP))
+! & * ( H02FOL + HRFVAP + CP2FOL * (TEBMOY-TREFTH) ) )
+! W8(IEL) = (RTP(IEL,ISCA(IHM))-EH2) * UNS1PW
+! PPl 200106 c'�tait bien beau tant qu'il n'y avait que de la vapeur
+! mais avec la combustion h�t�rog�ne c'est le foutoir
+! on repasse (momentan�ment ?) � une enthalpie de phase
+
+ x2h2 = 0.d0
+ do icla = 1, nclafu
+ x2h2 = x2h2 + rtp(iel,isca(ihlf(icla)))
+ enddo
+ w8(iel) = ( rtp(iel,isca(ihm)) - x2h2 ) &
+ *uns1pw
+
+enddo
+
+
+! --- Gestion memoire
+! Autres tableaux
+
+! ------ Macro tableau d'entiers TBFUI : NTBFUI
+! Macro tableau de reels TBFUR : NTBFUR
+! Macro tableau d'entiers TBWOI : NTBWOI
+! Macro tableau de reels TBWOR : NTBWOR
+
+ntbfui = 1
+if ( ieqnox .eq. 0 ) then
+ ntbfur = 11
+else
+ ntbfur = 12
+endif
+ntbwoi = 0
+ntbwor = 2
+
+call memfu1 &
+!==========
+ ( idebia , idebra , &
+ nvar , ncelet , ncel , nfac , nfabor , &
+ ntbfui , ifuwi , &
+ ntbfur , ifuwr , &
+ ntbwoi , iwori , &
+ ntbwor , iworr , &
+ ifinia , ifinra )
+
+iphas = 1
+
+call fuphy1 &
+!==========
+ ( ifinia , ifinra , &
+ ncelet , ncel , &
+ ntbfui , ntbfur , ntbwoi , ntbwor , &
+ w2 , w4 , w6 , &
+! FVAP FHTF F4P2M
+ w8 , &
+! ENTH du gaz
+ rtp , propce , propce(1,iromf) , &
+! ---------------- (masse vol. gaz)
+ ia(ifuwi) , ra(ifuwr) , &
+ ia(iwori) , ra(iworr) )
+
+!===============================================================================
+! 4. CALCUL DES PROPRIETES PHYSIQUES DE LA PHASE DISPERSEE
+! VALEURS CELLULES
+! ----------------
+! TEMPERATURE
+!===============================================================================
+
+if ( ippmod(icfuel).ge.0 ) then
+
+! --- Transport d'H2
+
+ call futeh2 &
+ !==========
+ ( ncelet , ncel , nrtuse , &
+ rtp , propce , rtuser)
+
+endif
+
+
+!===============================================================================
+! 5. CALCUL DES PROPRIETES PHYSIQUES DU MELANGE
+! VALEURS CELLULES
+! ----------------
+! MASSE VOLUMIQUE
+!===============================================================================
+
+! --- W2 = - Somme des X2(i)
+
+do iel = 1, ncel
+ w2(iel) = zero
+enddo
+
+do icla = 1, nclafu
+ do iel = 1, ncel
+ w2(iel) = w2(iel)-rtp(iel,isca(iyfol(icla)))
+ enddo
+enddo
+
+! --- Calcul de Rho du melange : 1/Rho = X1/Rho1 + Somme(X2/Rho2)
+! On sous relaxe quand on a un rho n a disposition, ie
+! a partir du deuxieme passage ou
+! a partir du premier passage si on est en suite de calcul et
+! qu'on a relu la masse volumique dans le fichier suite.
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+
+if (ipass.gt.1.or.(isuite.eq.1.and.initro(iphas).eq.1)) then
+ srrom1 = srrom
+else
+ srrom1 = 0.d0
+endif
+
+do iel = 1, ncel
+
+ x1sro1 = (1.d0+w2(iel)) / propce(iel,iromf)
+ x2sro2 = zero
+ do icla = 1, nclafu
+
+ ipcro2 = ipproc(irom3(icla))
+ propce(iel,ipcro2) = rho0fl
+
+ x2sro2 = x2sro2 + rtp(iel,isca(iyfol(icla))) &
+ /propce(iel,ipcro2)
+
+ enddo
+
+! ---- Sous relaxation eventuelle a donner dans ppini1.F
+
+ propce(iel,ipcrom) = srrom1*propce(iel,ipcrom) &
+ + (1.d0-srrom1)/(x1sro1+x2sro2)
+ enddo
+
+!===============================================================================
+! 6. CALCUL DE RHO DU MELANGE
+
+! VALEURS FACETTES
+! ----------------
+!===============================================================================
+
+iphas = 1
+ibrom(iphas) = 1
+ipbrom = ipprob(irom(iphas))
+ipcrom = ipproc(irom(iphas))
+
+! ---> Masse volumique au bord pour toutes les facettes
+! Les facettes d'entree seront recalculees.
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ propfb(ifac,ipbrom) = propce(iel,ipcrom)
+enddo
+
+! ---> Masse volumique au bord pour les facettes d'entree UNIQUEMENT
+! Le test sur IZONE sert pour les reprises de calcul
+
+if ( ipass.gt.1 .or. isuite.eq.1 ) then
+ do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+ if(izone.gt.0) then
+ if ( ientat(izone).eq.1 .or. ientfl(izone).eq.1 ) then
+ qtotz = qimpfl(izone) + qimpat(izone)
+ x2tot = qimpfl(izone) / qtotz
+ x2sro2 = x2tot / rho0fl
+ wmolme = (1.d0 + xsi) / (wmole(io2) + xsi * wmole(in2) )
+ unsro1 = (wmolme * rr * timpat(izone)) / p0(iphas)
+ x1sro1 = (1.d0 - x2tot) * unsro1
+ propfb(ifac,ipbrom) = 1.d0 / (x1sro1 + x2sro2)
+ endif
+ endif
+
+ enddo
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/fuprop.f90 b/src/fuel/fuprop.f90
new file mode 100644
index 0000000..51c01d8
--- /dev/null
+++ b/src/fuel/fuprop.f90
@@ -0,0 +1,250 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fuprop &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT SELON
+! COMBUSTION FUEL
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! <-- ! numero de la derniere propriete !
+! ! ! ! (les proprietes sont dans propce, !
+! ! ! ! propfa ou prpfb) !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "ppcpfu.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp, ipppst
+
+! VARIABLES LOCALES
+
+integer iprop, ige , icla , iprop2
+
+!===============================================================================
+
+! ---> Definition des pointeurs relatifs aux variables d'etat
+
+iprop = ipropp
+
+! Phase continue (melange gazeux)
+iprop = iprop + 1
+itemp1 = iprop
+iprop = iprop + 1
+irom1 = iprop
+do ige = 1, ngaze
+ iprop = iprop +1
+ iym1(ige) = iprop
+enddo
+iprop = iprop + 1
+immel = iprop
+
+if ( ieqnox .eq. 1 ) then
+ iprop = iprop + 1
+ ighcn1 = iprop
+ iprop = iprop + 1
+ ighcn2 = iprop
+ iprop = iprop + 1
+ ignoth = iprop
+endif
+
+! Phase dispersee (classes de particules)
+
+iprop2 = iprop
+do icla = 1, nclafu
+ iprop = iprop2 + icla
+ itemp3(icla) = iprop
+ iprop = iprop2 + 1*nclafu + icla
+ irom3(icla) = iprop
+ iprop = iprop2 + 2*nclafu + icla
+ idiam3(icla) = iprop
+ iprop = iprop2 + 3*nclafu + icla
+ ih1hlf(icla) = iprop
+ iprop = iprop2 + 4*nclafu + icla
+ igmeva(icla) = iprop
+ iprop = iprop2 + 5*nclafu + icla
+ igmhtf(icla) = iprop
+enddo
+
+! ---- Nb de variables algebriques (ou d'etat)
+! propre a la physique particuliere NSALPP
+! total NSALTO
+
+nsalpp = iprop - ipropp
+nsalto = iprop
+
+! ---- On renvoie IPROPP au cas ou d'autres proprietes devraient
+! etre numerotees ensuite
+
+ipropp = iprop
+
+! ---> Positionnement dans le tableau PROPCE
+! et reperage du rang pour le post-traitement
+
+iprop = nproce
+
+! Phase continue (melange gazeux)
+iprop = iprop + 1
+ipproc(itemp1) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+iprop = iprop + 1
+ipproc(irom1) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+do ige = 1, ngaze
+ iprop = iprop + 1
+ ipproc(iym1(ige)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+enddo
+
+iprop = iprop + 1
+ipproc(immel) = iprop
+ipppst = ipppst + 1
+ipppro(iprop) = ipppst
+
+if ( ieqnox .eq. 1 ) then
+
+ iprop = iprop + 1
+ ipproc(ighcn1) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(ighcn2) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop + 1
+ ipproc(ignoth) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+endif
+
+! Phase dispersee (classes de particules)
+
+iprop2 = iprop
+do icla = 1, nclafu
+
+ iprop = iprop2 + icla
+ ipproc(itemp3(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 1*nclafu + icla
+ ipproc(irom3(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 2*nclafu + icla
+ ipproc(idiam3(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 3*nclafu + icla
+ ipproc(ih1hlf(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 4*nclafu + icla
+ ipproc(igmeva(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+ iprop = iprop2 + 5*nclafu + icla
+ ipproc(igmhtf(icla)) = iprop
+ ipppst = ipppst + 1
+ ipppro(iprop) = ipppst
+
+enddo
+
+
+nproce = iprop
+
+
+! ---> Positionnement dans le tableau PROPFB
+! Au centre des faces de bord
+
+iprop = nprofb
+nprofb = iprop
+
+! ---> Positionnement dans le tableau PROPFA
+! Au centre des faces internes (flux de masse)
+
+iprop = nprofa
+nprofa = iprop
+
+return
+end
diff --git a/src/fuel/fuptcl.f90 b/src/fuel/fuptcl.f90
new file mode 100644
index 0000000..c82ad4d
--- /dev/null
+++ b/src/fuel/fuptcl.f90
@@ -0,0 +1,702 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fuptcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefol , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! COMBUSTION FUEL
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefol(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ii, iphas, ifac, izone, mode, iel, ige, iok
+integer icla
+integer ipbrom, icke, ipcvis
+integer nbrval
+double precision qisqc, viscla, d2s3, uref2, rhomoy, dhy, xiturb
+double precision xkent, xeent, t1, t2, ustar2
+double precision h1(nozppm) , h3(nozppm)
+double precision x30(nozppm,nclcpm),x30t(nozppm)
+double precision xmg0(nozppm,nclcpm)
+double precision x3h30t(nozppm)
+double precision qimpc(nozppm) , qcalc(nozppm)
+double precision coefe(ngazem)
+double precision xsolid(2)
+double precision hlf , totfu , sdeb , sdebt
+double precision volm,volmp,dmp
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+ipbrom = ipprob(irom (iphas))
+ipcvis = ipproc(iviscl(iphas))
+
+d2s3 = 2.d0 / 3.d0
+
+!===============================================================================
+! 1. ECHANGES EN PARALLELE POUR LES DONNEES UTILISATEUR
+!===============================================================================
+
+! En realite on pourrait eviter cet echange en modifiant uscpcl et en
+! demandant a l'utilisateur de donner les grandeurs dependant de la
+! zone hors de la boucle sur les faces de bord : les grandeurs
+! seraient ainsi disponibles sur tous les processeurs. Cependant,
+! ca rend le sous programme utilisateur un peu plus complique et
+! surtout, si l'utilisateur le modifie de travers, ca ne marche pas.
+! On suppose que toutes les grandeurs fournies sont positives, ce qui
+! permet d'utiliser un max pour que tous les procs les connaissent.
+! Si ce n'est pas le cas, c'est plus complique mais on peut s'en tirer
+! avec un max quand meme.
+
+if(irangp.ge.0) then
+ call parimx(nozapm,iqimp )
+ !==========
+ call parimx(nozapm,ientat)
+ !==========
+ call parimx(nozapm,ientfl)
+ !==========
+ call parrmx(nozapm,qimpat)
+ !==========
+ call parrmx(nozapm,timpat)
+ !==========
+ nbrval = nozppm
+ call parrmx(nbrval,qimpfl)
+ !==========
+ nbrval = nozppm
+ call parrmx(nbrval,timpfl)
+ !==========
+ nbrval = nozppm*nclcpm
+ call parrmx(nbrval,distfu)
+ !==========
+endif
+
+
+!===============================================================================
+! 2. CORRECTION DES VITESSES (EN NORME) POUR CONTROLER LES DEBITS
+! IMPOSES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+!===============================================================================
+
+! --- Debit calcule
+
+do izone = 1, nozppm
+ qcalc(izone) = 0.d0
+ h1(izone) = 0.d0
+enddo
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ qcalc(izone) = qcalc(izone) - propfb(ifac,ipbrom) * &
+ ( rcodcl(ifac,iu(iphas),1)*surfbo(1,ifac) + &
+ rcodcl(ifac,iv(iphas),1)*surfbo(2,ifac) + &
+ rcodcl(ifac,iw(iphas),1)*surfbo(3,ifac) )
+enddo
+
+if(irangp .ge. 0) then
+ call parrsm(nozapm,qcalc )
+endif
+
+do izone = 1, nozapm
+ if ( iqimp(izone) .eq. 0 ) then
+ qimpc(izone) = qcalc(izone)
+ endif
+enddo
+
+! --- Correction des vitesses en norme
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( iqimp(izone) .eq. 1 ) then
+ if(abs(qcalc(izone)) .lt. epzero) then
+ write(nfecra,2001)izone,iqimp(izone),qcalc(izone)
+ iok = iok + 1
+ endif
+ endif
+enddo
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+do ifac = 1, nfabor
+ izone = izfppp(ifac)
+ if ( iqimp(izone) .eq. 1 ) then
+ qimpc(izone) = qimpat(izone) + qimpfl(izone)
+ qisqc = qimpc(izone) / qcalc(izone)
+ rcodcl(ifac,iu(iphas),1) = rcodcl(ifac,iu(iphas),1)*qisqc
+ rcodcl(ifac,iv(iphas),1) = rcodcl(ifac,iv(iphas),1)*qisqc
+ rcodcl(ifac,iw(iphas),1) = rcodcl(ifac,iw(iphas),1)*qisqc
+ endif
+enddo
+
+
+
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= FUEL ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le debit est impose sur la zone IZONE = ', I10 ,/,&
+'@ puisque IQIMP(IZONE) = ', I10 ,/,&
+'@ Or, sur cette zone, le produit RHO D S integre est nul : ',/,&
+'@ il vaut = ',E14.5 ,/,&
+'@ (D est la direction selon laquelle est impose le debit).',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usfucl, et en particulier ',/,&
+'@ - que le vecteur RCODCL(IFAC,IU(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IV(IPHAS),1), ',/,&
+'@ RCODCL(IFAC,IW(IPHAS),1) qui determine',/,&
+'@ la direction de la vitesse est non nul et n''est pas ',/,&
+'@ uniformement perpendiculaire aux face d''entree ',/,&
+'@ - que la surface de l''entree n''est pas nulle (ou que ',/,&
+'@ le nombre de faces de bord dans la zone est non nul) ',/,&
+'@ - que la masse volumique n''est pas nulle ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 3. VERIFICATIONS
+! Somme des DISTributions FUel = 100% pour les zones IENTFL =1
+!===============================================================================
+
+iok = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ if ( ientfl(izone).eq.1 ) then
+ totfu = 0.d0
+ do icla = 1, nclafu
+ totfu = totfu + distfu(izone,icla)
+ enddo
+ if(abs(totfu-100.d0).gt.epzero) then
+ write(nfecra,2010)
+ do icla = 1, nclafu
+ write(nfecra,2011)izone,icla, &
+ distfu(izone,icla)
+ enddo
+ write(nfecra,2012)izone,ientfu(izone), &
+ totfu,totfu-100.d0
+ iok = iok + 1
+ endif
+ endif
+enddo
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= FUEL ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Zone Classe Distfu(%) ' )
+ 2011 format( &
+'@ ',I10 ,' ',I10 ,' ',E14.5 )
+ 2012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE PHYSIQUES PARTICULIERES ',/,&
+'@ ========= FUEL ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ On impose une entree fuel en IZONE = ', I10 ,/,&
+'@ puisque IENTFL(IZONE) = ', I10 ,/, &
+'@ Or, sur cette zone, la somme des distributions ',/,&
+'@ en pourcentage pour le fuel IFOL = ', I10 ,/,&
+'@ est differente de 100% : elle vaut TOTFOL = ', E14.5 ,/,&
+'@ avec TOTFOL-100 = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usfucl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 4. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LA TURBULENCE
+
+!===============================================================================
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique de la turbulence
+
+ if ( icalke(izone).ne.0 ) then
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ + rcodcl(ifac,iv(iphas),1)**2 &
+ + rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ rhomoy = propfb(ifac,ipbrom)
+ iel = ifabor(ifac)
+ viscla = propce(iel,ipcvis)
+ icke = icalke(izone)
+ dhy = dh(izone)
+ xiturb = xintur(izone)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+ if (icke.eq.1) then
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscla, cmu, xkappa, &
+ ustar2, xkent, xeent )
+ else if (icke.eq.2) then
+ call keenin &
+ !==========
+ ( uref2, xiturb, dhy, cmu, xkappa, xkent, xeent )
+ endif
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+ endif
+
+ enddo
+
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LES SCALAIRES
+!===============================================================================
+
+do ii = 1, nzfppp
+
+ izone = ilzppp(ii)
+
+! Une entree IENTRE est forcement du type
+! IENTAT = 1 ou IENTFL = 1
+ if ( ientat(izone).eq.1 .or. ientfl(izone).eq.1) then
+
+ x30t (izone) = zero
+ x3h30t(izone) = zero
+
+ do icla = 1, nclafu
+
+! ------ Calcul de X3 total par zone
+! Petite retouche au cas ou l'entree est fermee
+ if(abs(qimpc(izone)).lt.epzero) then
+ x30(izone,icla) = 0.d0
+ else
+ x30(izone,icla) = qimpfl(izone)/qimpc(izone) &
+ *distfu(izone,icla)*1.d-2
+ endif
+ x30t(izone) = x30t(izone) + x30(izone,icla)
+
+ enddo
+! ------ Calcul de H3 , XMG0
+ if ( ientfl(izone) .eq. 1 ) then
+ t2 = timpfl(izone)
+ xsolid(1) = 1.d0-fkc
+ xsolid(2) = fkc
+ mode = -1
+ call futhp2 &
+ !==========
+ ( mode , h3(izone), xsolid , t2 )
+
+ do icla = 1, nclafu
+ xmg0(izone,icla) = pi/6.d0*(dinifl(icla)**3)*rho0fl
+ enddo
+ else
+ h3(izone) = zero
+ do icla = 1, nclafu
+ xmg0(izone,icla) = 1.d0
+ enddo
+ endif
+ x3h30t(izone) = x30t(izone)*h3(izone)
+
+
+! ------ Calcul de H1(IZONE)
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(io2) = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
+ coefe(in2) = 1.d0 - coefe(io2)
+ hlf = zero
+ t1 = timpat(izone)
+ mode = -1
+ call futhp1 &
+ !==========
+ ( mode , h1(izone) , coefe , t1 )
+
+ endif
+enddo
+
+
+do ifac = 1, nfabor
+
+ izone = izfppp(ifac)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+
+! ---- Traitement automatique des scalaires physiques particulieres
+
+ do icla = 1, nclafu
+! ------ CL pour Xfol
+ rcodcl(ifac,isca(iyfol(icla)),1) = x30(izone,icla)
+! ------ CL pour Ng
+ rcodcl(ifac,isca(ing(icla)),1) = x30(izone,icla) &
+ /xmg0(izone,icla)
+! ------ CL pour X2HLF
+ rcodcl(ifac,isca(ihlf(icla)),1) = x30(izone,icla)*h3(izone)
+ enddo
+! ------ CL pour X1.FVAP
+ rcodcl(ifac,isca(ifvap),1) = zero
+! ------ CL pour X1.FHTF
+ rcodcl(ifac,isca(ifhtf),1) = zero
+! ------ CL pour FP4M
+ rcodcl(ifac,isca(if4p2m),1) = zero
+! ------ CL pour HM
+ rcodcl(ifac,isca(ihm),1) = ( 1.d0 - x30t(izone) ) &
+ * h1(izone) + x3h30t(izone)
+
+! ------ CL pour X1.YCO2
+ if ( ieqco2 .ge. 1 ) then
+ rcodcl(ifac,isca(iyco2),1) = zero
+ endif
+
+! ------ CL pour X1.HCN et X1.NO
+ if ( ieqnox .eq. 1 ) then
+ rcodcl(ifac,isca(iyhcn),1) = zero
+ rcodcl(ifac,isca(iyno ),1) = zero
+! ------ CL pour Tair
+ rcodcl(ifac,isca(itaire ),1) = timpat(izone)
+ endif
+
+ endif
+
+enddo
+
+! MODEL NOX :
+! - Calcul de Tair moyen sur les entrees (on moyenne en fonction du debit)
+! - Calcul Ymoy : taux de vapeur moyen en sortie
+
+if ( ieqnox .eq. 1) then
+
+! Calcul Tair
+
+ sdeb = 0.d0
+ sdebt= 0.d0
+
+ do ii = 1, nzfppp
+
+ izone = ilzppp(ii)
+
+! Une entree IENTRE est forcement du type
+! IENTAT = 1 ou IENTFL = 1
+ if ( ientat(izone).eq.1 .or. ientfl(izone).eq.1) then
+
+ sdeb = sdeb + qimpat(izone)
+ sdebt = sdebt + qimpat(izone)*timpat(izone)
+
+ endif
+ enddo
+
+ if ( irangp .ge. 0 ) then
+ call parsom(sdeb)
+ call parsom(sdebt)
+ endif
+
+ taire = sdebt/sdeb
+
+endif
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+
+return
+end
diff --git a/src/fuel/furays.f90 b/src/fuel/furays.f90
new file mode 100644
index 0000000..d791f4e
--- /dev/null
+++ b/src/fuel/furays.f90
@@ -0,0 +1,139 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine furays &
+!================
+
+ ( ivar , ncelet , ncel , &
+ volume , propce , smbrs , rovsdt )
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE PHYSIQUE PARTICULIERE : COMBUSTION FIOUL LOURD
+! PRISE EN COMPTE DES TERMES SOURCES RADIATIFS
+! IMPLICITE ET EXPLICITE DANS L'EQUATION DES PARTICULES
+! DE LA CLASSE ICLA
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ivar ! e ! <-- ! numero de la variable scalaire !
+! ! ! ! energie (enthalpie h2) pour le !
+! ! ! ! charbon !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! volume(ncelet ! tr ! <-- ! volume des cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! smbrs(ncelet ! tr ! <-- ! second membre du systeme !
+! rovsdt(ncelet ! tr ! <-- ! diagonale du systeme !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "numvar.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ivar , ncelet, ncel
+
+double precision volume(ncelet)
+double precision smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision propce(ncelet,*)
+
+! VARIABLES LOCALES
+
+integer iel , numcla , ipcl
+
+!===============================================================================
+
+!===============================================================================
+! 1. RECHERCHE DE LA ZONE MEMOIRE (IPH) EN FONCTION DU NUMERO DE PHASE
+! COURANT IPHAS POUR TROUVER LES BONS TERMES SOURCES
+!===============================================================================
+
+numcla = ivar-isca(ihlf(1))+1
+ipcl = 1+numcla
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES RADIATIFS
+!===============================================================================
+
+
+do iel = 1,ncel
+ propce(iel,ipproc(itsri(ipcl))) = max(-propce(iel,ipproc(itsri(ipcl))),zero)
+enddo
+
+do iel = 1,ncel
+ if ( propce(iel,ipproc(iyfol(numcla))) .gt. epzero ) then
+
+!--> PARTIE EXPLICITE
+
+ smbrs(iel) = smbrs(iel) + propce(iel,ipproc(itsre(ipcl)))*volume(iel) &
+ *propce(iel,ipproc(iyfol(numcla)))
+
+!--> PARTIE IMPLICITE
+
+ rovsdt(iel) = rovsdt(iel) + propce(iel,ipproc(itsri(ipcl)))*volume(iel)
+ endif
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/fuel/futeh1.f90 b/src/fuel/futeh1.f90
new file mode 100644
index 0000000..b15a417
--- /dev/null
+++ b/src/fuel/futeh1.f90
@@ -0,0 +1,176 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine futeh1 &
+!================
+
+ ( ncelet , ncel , &
+ eh , &
+ fuel1 , fuel3 , oxyd , prod1 , prod2 , &
+ xiner , xh2s , xso2 , &
+ tp , &
+ eh0 , eh1 )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DU GAZ
+! EN FONCTION DE L'ENTHALPIE DU GAZ ET DES CONCENTRATIONS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! eh ! tr ! <-- ! enthalpie du gaz !
+! ! ! ! (j/kg de melange gazeux) !
+! fuel1 ! tr ! <-- ! fraction massique chx1 !
+! fuel2 ! tr ! <-- ! fraction massique chx2 !
+! fuel3 ! tr ! <-- ! fraction massique co !
+! oxyd ! tr ! <-- ! fraction massique o2 !
+! prod1 ! tr ! <-- ! fraction massique co2 !
+! prod2 ! tr ! <-- ! fraction massique h2o !
+! xiner ! tr ! <-- ! fraction massique n2 !
+! tp ! tr ! --> ! temperature du gaz (kelvin) !
+! eh0 ! tr ! <-- ! tableau reel de travail !
+! eh1 ! tr ! <-- ! tableau reel de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel
+
+double precision eh(ncelet)
+double precision fuel1(ncelet), fuel3(ncelet)
+double precision oxyd(ncelet), xiner(ncelet)
+double precision prod1(ncelet),prod2(ncelet)
+double precision xh2s(ncelet) , xso2(ncelet)
+double precision tp(ncelet)
+double precision eh0(ncelet), eh1(ncelet)
+
+! VARIABLES LOCALES
+
+integer ii, icel
+
+!===============================================================================
+
+ii = npo-1
+do icel = 1, ncel
+
+! --- Clipping eventuel de TP a TH(NPO) si EH > EH1
+
+ eh1(icel) = fuel1(icel)*ehgaze(ifov,ii+1) &
+ + fuel3(icel)*ehgaze(ico ,ii+1) &
+ + oxyd(icel) *ehgaze(io2 ,ii+1) &
+ + prod1(icel)*ehgaze(ico2,ii+1) &
+ + prod2(icel)*ehgaze(ih2o,ii+1) &
+ + xiner(icel)*ehgaze(in2 ,ii+1) &
+ + xh2s (icel)*ehgaze(ih2s,ii+1) &
+ + xso2 (icel)*ehgaze(iso2,ii+1)
+
+ if ( eh(icel).ge.eh1(icel) ) tp(icel)= th(ii+1)
+enddo
+
+ii = 1
+do icel = 1, ncel
+
+! --- Clipping eventuel de TP a TH(1) si EH < EH0
+
+ eh0(icel) = fuel1(icel)*ehgaze(ifov,ii) &
+ + fuel3(icel)*ehgaze(ico ,ii) &
+ + oxyd(icel) *ehgaze(io2 ,ii) &
+ + prod1(icel)*ehgaze(ico2,ii) &
+ + prod2(icel)*ehgaze(ih2o,ii) &
+ + xiner(icel)*ehgaze(in2 ,ii) &
+ + xh2s (icel)*ehgaze(ih2s,ii) &
+ + xso2 (icel)*ehgaze(iso2,ii)
+
+ if ( eh(icel).le.eh0(icel) ) tp(icel)= th(1)
+enddo
+
+do ii = 1, npo-1
+ do icel = 1, ncel
+
+ eh0(icel) = fuel1(icel)*ehgaze(ifov,ii) &
+ +fuel3(icel)*ehgaze(ico ,ii) &
+ +oxyd(icel) *ehgaze(io2 ,ii) &
+ +prod1(icel)*ehgaze(ico2,ii) &
+ +prod2(icel)*ehgaze(ih2o,ii) &
+ +xiner(icel)*ehgaze(in2 ,ii) &
+ +xh2s (icel)*ehgaze(ih2s,ii) &
+ +xso2 (icel)*ehgaze(iso2,ii)
+
+ eh1(icel) = fuel1(icel)*ehgaze(ifov,ii+1) &
+ +fuel3(icel)*ehgaze(ico ,ii+1) &
+ +oxyd(icel) *ehgaze(io2 ,ii+1) &
+ +prod1(icel)*ehgaze(ico2,ii+1) &
+ +prod2(icel)*ehgaze(ih2o,ii+1) &
+ +xiner(icel)*ehgaze(in2 ,ii+1) &
+ +xh2s (icel)*ehgaze(ih2s,ii+1) &
+ +xso2 (icel)*ehgaze(iso2,ii+1)
+
+ if ( eh(icel).ge.eh0(icel) .and. eh(icel).le.eh1(icel) ) then
+ tp(icel)= th(ii) + (eh(icel)-eh0(icel)) &
+ *(th(ii+1)-th(ii))/(eh1(icel)-eh0(icel))
+ endif
+ enddo
+enddo
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/futeh2.f90 b/src/fuel/futeh2.f90
new file mode 100644
index 0000000..7ed298a
--- /dev/null
+++ b/src/fuel/futeh2.f90
@@ -0,0 +1,173 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine futeh2 &
+!================
+
+ ( ncelet , ncel , nrtuse , &
+ rtp , propce , rtuser )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DES PARTICULES
+! EN FONCTION DE L'ENTHALPIE DU FOL ET DES CONCENTRATIONS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! eh0 ! tr ! <-- ! tableau reel de travail !
+! eh1 ! tr ! <-- ! tableau reel de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel , nrtuse
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision rtuser(nrtuse)
+
+! VARIABLES LOCALES
+
+integer icel , icla
+integer ipcte1 , ipcte2
+integer mode
+double precision eh2, xsolid(2)
+double precision mkfini,diamgt
+double precision masgut,mfgout,mkgout,rhofol
+
+!===============================================================================
+! RQ IMPORTANTE : On suppose pour l'instant que H2 = H02 + CP2(T2-TREF)
+
+
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! --- Initialisation des tableaux
+
+ipcte1 = ipproc(itemp1)
+
+do icla = 1, nclafu
+
+ ipcte2 = ipproc(itemp3(icla))
+
+ do icel = 1, ncel
+
+! --- Initialisation de T2 a T20
+
+ propce(icel,ipcte2) = 373.d0
+! 20/09/05 Pour l'instant TinFol en dur, un jour on recuperera dans USFUCL
+ enddo
+enddo
+
+!===============================================================================
+! 2. CALCUL DE LA TEMPERATURE DES PARTICULES
+!===============================================================================
+
+mode = 1
+
+do icla = 1, nclafu
+
+ ipcte2 = ipproc(itemp3(icla))
+
+ mkfini = rho0fl*pi/6.d0*dinikf(icla)**3
+
+ do icel = 1, ncel
+
+ rhofol = propce(icel,ipproc(irom3(icla)))
+ diamgt = propce(icel,ipproc(idiam3(icla)))
+ masgut = rho0fl*pi/6.d0*diamgt**3
+ if (diamgt.le.dinikf(icla)) then
+ mkgout = masgut
+ else
+ mkgout = mkfini
+ endif
+ mfgout = masgut - mkgout
+ xsolid(1) = 1.d0-fkc
+ xsolid(2) = fkc
+ if(masgut.gt.zero) then
+ xsolid(1) = mfgout / masgut
+ xsolid(2) = mkgout / masgut
+ endif
+ xsolid(1) = min(1.d0,max(0.d0,xsolid(1)))
+ xsolid(2) = min(1.d0,max(0.d0,xsolid(2)))
+
+ if ( rtp(icel,isca(iyfol(icla))) .gt. (3.d3*epsifl) ) then
+ eh2 = rtp(icel,isca(ihlf(icla))) &
+ /rtp(icel,isca(iyfol(icla)))
+ call futhp2 &
+! ============
+ ( mode , eh2 , xsolid , propce(icel,ipcte2) )
+ else
+ propce(icel,ipcte2) = propce(icel,ipcte1)
+ endif
+
+ enddo
+
+enddo
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/futhp1.f90 b/src/fuel/futhp1.f90
new file mode 100644
index 0000000..c12b7a3
--- /dev/null
+++ b/src/fuel/futhp1.f90
@@ -0,0 +1,273 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine futhp1 &
+!================
+
+ ( mode , eh , xesp , tp )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DU GAZ
+! EN FONCTION DE L'ENTHALPIE DU GAZ ET DES CONCENTRATIONS
+! SI MODE = 1
+! CALCUL DE L'ENTHALPIE DU GAZ
+! EN FONCTION DE LA TEMPERATURE DU GAZ ET DES CONCENTRATIONS
+! SI MODE = -1
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! eh ! tr ! <-- ! enthalpie du gaz !
+! ! ! ! (j/kg de melange gazeux) !
+! xesp ! tr ! <-- ! fraction massique des especes !
+! tp ! tr ! --> ! temperature du gaz (kelvin) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHAMNUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer mode
+double precision eh,tp
+double precision xesp(ngazem)
+
+! VARIABLES LOCALES
+
+integer ii
+
+double precision eh0 , eh1
+
+!===============================================================================
+!===============================================================================
+! 1. CALCUL DE LA TEMPERATURE A PARTIR DE l'ENTHALPIE
+!===============================================================================
+
+if ( mode .eq. 1 ) then
+
+ ii = npo
+
+
+! --- Clipping eventuel de TP a TH(NPO) si EH > EH1
+
+ eh1 = xesp(ifov )*ehgaze(ifov,ii) &
+ + xesp(ico )*ehgaze(ico ,ii) &
+ + xesp(io2 )*ehgaze(io2 ,ii) &
+ + xesp(ico2 )*ehgaze(ico2,ii) &
+ + xesp(ih2o )*ehgaze(ih2o,ii) &
+ + xesp(in2 )*ehgaze(in2 ,ii) &
+ + xesp(ih2s )*ehgaze(ih2s,ii) &
+ + xesp(iso2 )*ehgaze(iso2,ii)
+
+ if ( eh .ge. eh1 ) then
+ tp = th(ii)
+ goto 501
+ endif
+
+ ii = 1
+
+! --- Clipping eventuel de TP a TH(1) si EH < EH0
+
+ eh0 = xesp(ifov )*ehgaze(ifov,ii) &
+ + xesp(ico )*ehgaze(ico ,ii) &
+ + xesp(io2 )*ehgaze(io2 ,ii) &
+ + xesp(ico2 )*ehgaze(ico2,ii) &
+ + xesp(ih2o )*ehgaze(ih2o,ii) &
+ + xesp(in2 )*ehgaze(in2 ,ii) &
+ + xesp(ih2s )*ehgaze(ih2s,ii) &
+ + xesp(iso2 )*ehgaze(iso2,ii)
+
+ if ( eh .le. eh0 ) then
+ tp= th(ii)
+ goto 501
+ endif
+
+
+ 500 continue
+ ii = ii + 1
+
+! --- Clipping eventuel de TP a TH(II-1) si EH < EH0
+
+ eh0 = xesp(ifov )*ehgaze(ifov,ii-1) &
+ + xesp(ico )*ehgaze(ico ,ii-1) &
+ + xesp(io2 )*ehgaze(io2 ,ii-1) &
+ + xesp(ico2 )*ehgaze(ico2,ii-1) &
+ + xesp(ih2o )*ehgaze(ih2o,ii-1) &
+ + xesp(in2 )*ehgaze(in2 ,ii-1) &
+ + xesp(ih2s )*ehgaze(ih2s,ii-1) &
+ + xesp(iso2 )*ehgaze(iso2,ii-1)
+
+ eh1 = xesp(ifov )*ehgaze(ifov,ii) &
+ + xesp(ico )*ehgaze(ico ,ii) &
+ + xesp(io2 )*ehgaze(io2 ,ii) &
+ + xesp(ico2 )*ehgaze(ico2,ii) &
+ + xesp(ih2o )*ehgaze(ih2o,ii) &
+ + xesp(in2 )*ehgaze(in2 ,ii) &
+ + xesp(ih2s )*ehgaze(ih2s,ii) &
+ + xesp(iso2 )*ehgaze(iso2,ii)
+
+ if ( eh .ge. eh0 .and. eh .le. eh1 ) then
+ tp = th(ii-1) + (eh-eh0) * &
+ (th(ii)-th(ii-1))/(eh1-eh0)
+ goto 501
+ endif
+ goto 500
+ 501 continue
+
+!===============================================================================
+! 1. CALCUL DE L'ENTHALPIE A PARTIR DE LA TEMPERATURE
+!===============================================================================
+
+else if ( mode .eq. -1 ) then
+
+ ii = npo
+
+! --- Calcul en Max
+
+ eh = xesp(ifov )*ehgaze(ifov,ii) &
+ +xesp(ico )*ehgaze(ico ,ii) &
+ +xesp(io2 )*ehgaze(io2 ,ii) &
+ +xesp(ico2 )*ehgaze(ico2,ii) &
+ +xesp(ih2o )*ehgaze(ih2o,ii) &
+ +xesp(in2 )*ehgaze(in2 ,ii) &
+ +xesp(ih2s )*ehgaze(ih2s,ii) &
+ +xesp(iso2 )*ehgaze(iso2,ii)
+ if (tp.gt.th(ii)) goto 601
+
+! Clipping en Min
+
+ ii = 1
+
+
+! --- Clipping eventuel de TP a TH(1) si EH < EH0
+
+ eh = xesp(ifov )*ehgaze(ifov,ii) &
+ +xesp(ico )*ehgaze(ico ,ii) &
+ +xesp(io2 )*ehgaze(io2 ,ii) &
+ +xesp(ico2 )*ehgaze(ico2,ii) &
+ +xesp(ih2o )*ehgaze(ih2o,ii) &
+ +xesp(in2 )*ehgaze(in2 ,ii) &
+ +xesp(ih2s )*ehgaze(ih2s,ii) &
+ +xesp(iso2 )*ehgaze(iso2,ii)
+ if (tp.lt.th(ii)) goto 601
+
+! Interpolation dans la table
+
+ ii = 1
+ 600 continue
+
+ ii = ii + 1
+ if ( tp .le. th(ii) ) then
+
+! --- Calcul de l'enthalpie de l'espece gazeuse TH(II-1)
+
+ eh0 = xesp(ifov )*ehgaze(ifov,ii-1) &
+ +xesp(ico )*ehgaze(ico ,ii-1) &
+ +xesp(io2 )*ehgaze(io2 ,ii-1) &
+ +xesp(ico2 )*ehgaze(ico2,ii-1) &
+ +xesp(ih2o )*ehgaze(ih2o,ii-1) &
+ +xesp(in2 )*ehgaze(in2 ,ii-1) &
+ +xesp(ih2s )*ehgaze(ih2s,ii-1) &
+ +xesp(iso2 )*ehgaze(iso2,ii-1)
+
+! --- Calcul de l'enthalpie de l'espece gazeuse TH(I)
+
+ eh1 = xesp(ifov )*ehgaze(ifov,ii) &
+ +xesp(ico )*ehgaze(ico ,ii) &
+ +xesp(io2 )*ehgaze(io2 ,ii) &
+ +xesp(ico2 )*ehgaze(ico2,ii) &
+ +xesp(ih2o )*ehgaze(ih2o,ii) &
+ +xesp(in2 )*ehgaze(in2 ,ii) &
+ +xesp(ih2s )*ehgaze(ih2s,ii) &
+ +xesp(iso2 )*ehgaze(iso2,ii)
+
+ eh = eh0 &
+ +(eh1-eh0)*(tp-th(ii-1))/(th(ii)-th(ii-1))
+ goto 601
+ endif
+ goto 600
+
+ 601 continue
+
+else
+ write(nfecra,1000) mode
+ call csexit(1)
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS FUTHP1 ',/,&
+'@ ========= ',/,&
+'@ VALEUR INCORRECTE DE L''ARGUMENT MODE ',/,&
+'@ CE DOIT ETRE UN ENTIER EGAL A 1 OU -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
+
diff --git a/src/fuel/futhp2.f90 b/src/fuel/futhp2.f90
new file mode 100644
index 0000000..a82e27f
--- /dev/null
+++ b/src/fuel/futhp2.f90
@@ -0,0 +1,240 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine futhp2 &
+!================
+
+ ( mode , enthal , xsolid , temper )
+
+!===============================================================================
+! FONCTION :
+! --------
+! CALCUL DE LA TEMPERATURE DES PARTICULES
+! EN FONCTION DE L'ENTHALPIE ET DES CONCENTRATIONS
+! SI IMODE = 1
+! CALCUL DE L'ENTHALPIE DES PARTICULES
+! EN FONCTION DE LA TEMPERATURE ET DES CONCENTRATIONS
+! SI IMODE = -1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! mode ! e ! <-- ! -1 : t -> h ; 1 : h -> t !
+! enthal ! r ! <-- ! enthalpie massique j/kg !
+! xsolid ! tr ! <-- ! fraction massique des constituants !
+! temper ! r ! <-- ! temperature en kelvin !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+
+! Arguments
+
+integer mode
+
+double precision xsolid(2)
+double precision temper , enthal
+
+! VARIABLES LOCALES
+
+integer it , isol , ihflt2
+
+double precision eh1 , eh0
+
+!===============================================================================
+!===============================================================================
+! 1. RQ IMPORTANTE : On suppose pour l'instant que H2 = H02 + CP2(T2-TREF)
+!===============================================================================
+
+ihflt2 = 0
+
+if ( ihflt2.eq.0 ) then
+
+!===============================================================================
+! 2. H2 FONCTION LINEAIRE T2
+!===============================================================================
+
+
+ if ( mode.eq.-1 ) then
+
+! --> Loi temperature -> enthalpie (MODE = -1)
+
+ enthal = h02fol + cp2fol*(temper-trefth)
+
+ elseif ( mode.eq.1 ) then
+
+! --> Loi enthalpie -> temperature (MODE = 1)
+
+ temper = (enthal-h02fol)/cp2fol + trefth
+
+ else
+
+ write(nfecra,1000) mode
+ call csexit (1)
+ !==========
+
+ endif
+
+
+else
+
+!===============================================================================
+! 3. H2 TABULE
+!===============================================================================
+
+ if ( mode.eq.-1 ) then
+
+! --> Loi temperature -> enthalpie (MODE = -1)
+
+ it = npo
+ if ( temper.ge.th(it) ) then
+ enthal = zero
+ do isol = 1, 2
+ enthal = enthal + xsolid(isol)*ehsoli(isol,it)
+ enddo
+ go to 11
+ endif
+
+ it = 1
+ if ( temper.le.th(it) ) then
+ enthal = zero
+ do isol = 1, 2
+ enthal = enthal + xsolid(isol)*ehsoli(isol,it)
+ enddo
+ go to 11
+ endif
+ it = 1
+ 10 continue
+
+ it = it + 1
+ if ( temper.le.th(it) ) then
+ eh0 = zero
+ eh1 = zero
+ do isol = 1, 2
+ eh0 = eh0 + xsolid(isol)*ehsoli(isol,it-1)
+ eh1 = eh1 + xsolid(isol)*ehsoli(isol,it )
+ enddo
+ enthal = eh0 &
+ + (eh1-eh0)*(temper-th(it-1))/(th(it)-th(it-1))
+ goto 11
+ endif
+ goto 10
+ 11 continue
+
+ elseif ( mode.eq.1 ) then
+
+! --> Loi enthalpie -> temperature (MODE = 1)
+
+ it = npo-1
+ eh1 = zero
+ do isol = 1, 2
+ eh1 = eh1 + xsolid(isol)*ehsoli(isol,it+1)
+ enddo
+ if ( enthal.ge.eh1 ) temper = th(it+1)
+
+ it = 1
+ eh0 = zero
+ do isol = 1, 2
+ eh0 = eh0 + xsolid(isol)*ehsoli(isol,it )
+ enddo
+ if ( enthal.le.eh0 ) temper = th(it)
+
+ do it = 1, npo-1
+ eh0 = zero
+ eh1 = zero
+ do isol = 1, 2
+ eh0 = eh0 + xsolid(isol)*ehsoli(isol,it )
+ eh1 = eh1 + xsolid(isol)*ehsoli(isol,it+1)
+ enddo
+ if ( enthal.ge.eh0 .and. enthal.le.eh1 ) &
+ temper = th(it) &
+ + (enthal-eh0)*(th(it+1)-th(it))/(eh1-eh0)
+ enddo
+
+ else
+
+ write(nfecra,1000) mode
+ call csexit (1)
+ !==========
+
+ endif
+
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS FUTHP2 ',/,&
+'@ ========= ',/,&
+'@ VALEUR INCORRECTE DE L''ARGUMENT MODE ',/,&
+'@ CE DOIT ETRE UN ENTIER EGAL A 1 OU -1 ',/,&
+'@ IL VAUT ICI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/fuel/futssc.f90 b/src/fuel/futssc.f90
new file mode 100644
index 0000000..ac588d8
--- /dev/null
+++ b/src/fuel/futssc.f90
@@ -0,0 +1,895 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine futssc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ izfppp , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME FUEL
+! ON PRECISE LES TERMES SOURCES POUR UN SCALAIRE PP
+! SUR UN PAS DE TEMPS
+
+
+! ATTENTION : LE TRAITEMENT DES TERMES SOURCES EST DIFFERENT
+! --------- DE CELUI DE USTSSC.F
+
+! ON RESOUT ROVSDT*D(VAR) = SMBRS
+
+! ROVSDT ET SMBRS CONTIENNENT DEJA D'EVENTUELS TERMES SOURCES
+! UTILISATEUR. IL FAUT DONC LES INCREMENTER ET PAS LES
+! ECRASER
+
+! POUR DES QUESTIONS DE STABILITE, ON NE RAJOUTE DANS ROVSDT
+! QUE DES TERMES POSITIFS. IL N'Y A PAS DE CONTRAINTE POUR
+! SMBRS
+
+! DANS LE CAS D'UN TERME SOURCE EN CEXP + CIMP*VAR ON DOIT
+! ECRIRE :
+! SMBRS = SMBRS + CEXP + CIMP*VAR
+! ROVSDT = ROVSDT + MAX(-CIMP,ZERO)
+
+! ON FOURNIT ICI ROVSDT ET SMBRS (ILS CONTIENNENT RHO*VOLUME)
+! SMBRS en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! ROVSDT en kg /s
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp, numtra
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , ipcrom, iel, iphas , icla , numcla
+integer iexp1 , iexp2 , iexp3 , ifac
+integer iscala
+integer ipcro2 , ipcte1 , ipcte2
+integer ipcdia , ipcvst
+integer imode , iesp
+integer ipcgev , ipcght , ipchgl
+integer itermx,nbpauv,nbrich,nbepau,nberic
+
+double precision aux, rhovst
+double precision t1, h1, t2, h2
+double precision xng,rhofol , rom
+double precision gameva,fdev,fsd,ftrac,hfov
+double precision ho2,hco,xesp(ngazem),xcoke,t2mt1
+double precision gmech,gmvap,gmhet
+
+double precision xxco,xxo2,xxco2,xxh2o,xco2mx
+double precision xkp,xk0p,xkm,xk0m,wplus,wmoins,t0p,t0m
+double precision auxp,auxm, aux1 , aux2 , aux3
+
+double precision xeq,anmr,xcot,xo2t,xco2e,xo2e,xcoe,tauchi,tautur
+double precision sqh2o , x2 , wmhcn , wmno
+
+integer iterch
+double precision err1mx,err2mx,anmr0
+
+double precision errch,ter1,ddelta,fn,qpr
+double precision auxmax,auxmin
+double precision ymoy,volm,volmp,dmp
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Numero des grandeurs physiques (voir usclim)
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+! --- Temperature phase gaz
+
+ipcte1 = ipproc(itemp1)
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES POUR LES VARIABLES RELATIVES
+! AUX CLASSES DE PARTICULES
+!===============================================================================
+
+! --> Terme source pour l'enthalpie du liquide
+
+if ( ivar .ge. isca(ihlf(1)) .and. &
+ ivar .le. isca(ihlf(nclafu)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ numcla = ivar-isca(ihlf(1))+1
+
+ ipcro2 = ipproc(irom3 (numcla))
+ ipcdia = ipproc(idiam3(numcla))
+ ipcte2 = ipproc(itemp3(numcla))
+ ipcgev = ipproc(igmeva(numcla))
+ ipcght = ipproc(igmhtf(numcla))
+ ipchgl = ipproc(ih1hlf(numcla))
+
+! La variable est l'enthalpie du liquide ramen�e �
+! la masse de m�lange
+! Les flux interfaciaux contribuent � faire varier l'enthalpie
+! du liquide
+! La vapeur emporte son enthalpie
+! flux = PROPCE(IEL,IPPROC(IGMEVA))
+! enthalpie massique reconstitu�e � partir de EHGAZE(IFOV )
+! � la temp�rature de la goutte
+! L'oxydation h�terog�ne comporte un flux "entrant" d'O2
+! un flux sortant de CO
+! le flux net est celui du carbone
+! fluxIN = 16/12 * PROPCE(IEL,IPPROC(IGMHTF))
+! fluxOUT = 28/12 * PROPCE(IEL,IPPROC(IGMHTF))
+! Enthalpie entrante reconstitu�e � partir de EHGAZE(IO2 )
+! � la temp�rature du gaz environnant
+! Enthalpie sortante reconstitu�e � partir de EHGAZE(ICO )
+! � la temp�rature du grain
+
+ imode = -1
+ do iel = 1, ncel
+
+ rom = propce(iel,ipcrom)
+
+ do iesp = 1, ngazem
+ xesp(iesp) = zero
+ enddo
+
+ xesp(ifov) = 1.d0
+ call futhp1(imode,hfov,xesp,propce(iel,ipcte2))
+
+ xesp(ifov) = zero
+ xesp(io2) = 1.d0
+ call futhp1(imode,ho2 ,xesp,propce(iel,ipcte1))
+
+ xesp(io2) = zero
+ xesp(ico) = 1.d0
+ call futhp1(imode,hco ,xesp,propce(iel,ipcte2))
+
+ t2mt1 = propce(iel,ipcte2)-propce(iel,ipcte1)
+
+ gmech = -propce(iel,ipchgl)*t2mt1
+ gmvap = propce(iel,ipcgev)*hfov*t2mt1
+ gmhet = 16.d0/12.d0*propce(iel,ipcght)*ho2 &
+ -28.d0/12.d0*propce(iel,ipcght)*hco
+
+ smbrs(iel) = smbrs(iel) + &
+ ( gmech+gmvap+gmhet )*rom*volume(iel)
+
+ rhovst = ( propce(iel,ipchgl) &
+ -propce(iel,ipcgev)*hfov )/cp2fol &
+ *rom*volume(iel)
+
+ rovsdt(iel) = rovsdt(iel) + max(zero,rhovst)
+
+ enddo
+
+! --> T.S. pour la masse de liquide
+
+elseif ( ivar .ge. isca(iyfol(1)) .and. &
+ ivar .le. isca(iyfol(nclafu)) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ numcla = ivar-isca(iyfol(1))+1
+
+ ipcro2 = ipproc(irom3 (numcla))
+ ipcdia = ipproc(idiam3(numcla))
+ ipcte2 = ipproc(itemp3(numcla))
+ ipcgev = ipproc(igmeva(numcla))
+ ipcght = ipproc(igmhtf(numcla))
+ ipchgl = ipproc(ih1hlf(numcla))
+
+ do iel = 1, ncel
+
+ t2mt1 = propce(iel,ipcte2)-propce(iel,ipcte1)
+ gmvap = -propce(iel,ipcgev)*t2mt1
+ gmhet = -propce(iel,ipcght)
+
+ smbrs(iel) = smbrs(iel) &
+ - propce(iel,ipcrom)*volume(iel)*(gmvap+gmhet)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+
+ enddo
+
+! --> T.S. pour le traceur de la vapeur
+
+elseif ( ivar .eq. isca(ifvap) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ do icla = 1, nclafu
+
+ ipcte2 = ipproc(itemp3(icla))
+ ipcgev = ipproc(igmeva(icla))
+
+ do iel = 1, ncel
+
+ t2mt1 = propce(iel,ipcte2)-propce(iel,ipcte1)
+ gmvap = -propce(iel,ipcgev)*t2mt1
+
+ smbrs(iel) = smbrs(iel) &
+ + gmvap*propce(iel,ipcrom)*volume(iel)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+
+ enddo
+
+ enddo
+
+! --> T.S. pour le traceur du C ex r�action heterogene
+
+elseif ( ivar .eq. isca(ifhtf) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ do icla = 1, nclafu
+
+ ipcght = ipproc(igmhtf(icla))
+
+ do iel = 1, ncel
+
+ smbrs(iel) = smbrs(iel) &
+ -propce(iel,ipcrom)*propce(iel,ipcght)*volume(iel)
+! ROVSDT(IEL) = ROVSDT(IEL) + ZERO
+
+ enddo
+
+ enddo
+
+endif
+
+! --> Terme source pour la variance du traceur 4 (Air)
+
+if ( ivar.eq.isca(if4p2m) ) then
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Calcul des termes sources explicite et implicite
+! relatif aux echanges interfaciaux entre phases
+
+ numtra = 4
+ call futsvi &
+!!==========
+ ( ncelet , ncel , numtra , &
+ rtp , propce , volume , &
+ smbrs , rovsdt , w1 )
+
+! ---- Calcul des termes sources explicite et implicite
+! relatif aux termes de production et de dissipation
+
+! Pointeur relatif au scalaire associe
+! (0 si pas de scalaire associe)
+
+ iscala = 0
+
+ call futsvc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ smbrs , rovsdt , &
+ viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+! --> Terme source pour CO2
+
+if ( ieqco2 .ge. 1 ) then
+
+ if ( ivar.eq.isca(iyco2) ) then
+
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+! ---- Contribution du TS interfacial aux bilans explicite et implicite
+
+! Oxydation du CO
+! ===============
+
+! Dryer Glassman : XK0P en (moles/m3)**(-0.75) s-1
+
+! XK0P = 1.26D10
+
+! XK0P = 1.26D7 * (1.1)**(NTCABS)
+! IF ( XK0P .GT. 1.26D10 ) XK0P=1.26D10
+
+! T0P = 4807.D0
+
+! Howard : XK0P en (moles/m3)**(-0.75) s-1
+
+! XK0P = 4.11D9
+! T0P = 15090.D0
+
+! Westbrook & Dryer
+
+ xk0p = 23.256
+ t0p = 20096.
+
+! Dissociation du CO2 (Trinh Minh Chinh)
+! ===================
+
+! XK0M = 5.D8
+! T0M = 4807.D0
+
+! XK0M = 0.D0
+
+! Westbrook & Dryer
+
+ xk0m = 20.03
+ t0m = 20096.
+
+ err1mx = 0.d0
+ err2mx = 0.d0
+
+! Nombre d'iterations
+
+ itermx = 5000
+
+! Nombre de points converges
+
+ nbpauv = 0
+ nbepau = 0
+ nbrich = 0
+ nberic = 0
+
+! Precision pour la convergence
+
+ errch = 1.d-8
+
+ do iel = 1, ncel
+
+ xxco = propce(iel,ipproc(iym1(ico )))/wmole(ico) &
+ *propce(iel,ipcrom)
+ xxo2 = propce(iel,ipproc(iym1(io2 )))/wmole(io2) &
+ *propce(iel,ipcrom)
+ xxco2 = propce(iel,ipproc(iym1(ico2 )))/wmole(ico2) &
+ *propce(iel,ipcrom)
+ xxh2o = propce(iel,ipproc(iym1(ih2o )))/wmole(ih2o) &
+ *propce(iel,ipcrom)
+
+ xxco = max(xxco ,zero)
+ xxo2 = max(xxo2 ,zero)
+ xxco2 = max(xxco2,zero)
+ xxh2o = max(xxh2o,zero)
+
+ xco2mx=xxco2+min(xxco,2.d0*xxo2)
+
+! XKP = XK0P*EXP(-T0P/PROPCE(IEL,IPPROC(ITEMP1)))
+! XKM = XK0M*EXP(-T0M/PROPCE(IEL,IPPROC(ITEMP1)))
+! if ( iel .eq. 36 ) then
+ xkp = exp(xk0p-t0p/propce(iel,ipproc(itemp1)))
+ xkm = exp(xk0m-t0m/propce(iel,ipproc(itemp1)))
+ xeq = exp(xk0m-xk0p)
+
+! Recherche de l'�tat d'�quilibre
+
+! Recerche it�rative sans controle de convergence
+! (pour conserver la parallelisation sur les mailles)
+! sur le nombre de moles de reaction s�parant
+! l'etat avant r�action (tel que calcul� par Cpcym)
+! de l'�tat d'�quilibre
+
+! initialisation par l'�tat transport�
+
+ anmr = xxco2
+ xcot = xxco + xxco2
+ xo2t = xxo2 + 0.5d0*xxco2
+ sqh2o = sqrt(xxh2o)
+
+ xo2e = xo2t-0.5d0*anmr
+
+! Si presence de O2 et H2O
+
+ if ( xo2e .gt. 0.d0 .and. sqh2o .gt. 0.d0 ) then
+
+ if ( iel.eq.36 .or. iel.eq.15151) then
+ write(*,*) ' TEST = ',SQH2O,SQH2O .GT. 0.D0
+ endif
+
+ iterch = 0
+ 10 continue
+
+ xco2e = anmr
+ xcoe = xcot-anmr
+ xo2e = xo2t-0.5d0*anmr
+ iterch = iterch + 1
+
+ if ( iel.eq. 36 .or. iel.eq.15151) then
+ write(*,*) ' ITERCH = ',ITERCH
+ endif
+
+ ter1 = xkp*sqh2o
+
+ ddelta = (ter1*xcoe*xo2e-xkm*xco2e*(xo2e**0.75d0)) &
+ /(ter1*(xo2e+xcoe/8.d0)+xkm*(xo2e**0.75d0))
+
+
+ anmr = anmr + ddelta
+
+! Clipping
+! Cote Pauvre
+ if ( xo2t .gt. 0.5d0*xcot ) then
+ anmr = max( zero, min(xcot,anmr))
+ else
+! Cote Riche
+ anmr = max( zero, min(2.d0*xo2t,anmr))
+ endif
+
+! Test de convergence
+
+ if ( abs(ddelta) .gt. errch &
+ .and. iterch.lt.itermx ) goto 10
+
+! Calcul du nombre de points non converg�
+
+ if ( iterch.eq.itermx &
+ .and. abs(ddelta) .gt. errch ) then
+
+ nberic = nberic +1
+
+ endif
+ 20 continue
+ err1mx = max(err1mx,abs(ddelta))
+
+ xco2e = anmr
+ xcoe = xcot-anmr
+ xo2e = xo2t-0.5d0*anmr
+
+ tauchi = 1.d0/(xkp*sqh2o*(0.5d0*(xo2t+xo2e))**0.25d0)
+ tautur = rtpa(iel,ik(iphas))/rtpa(iel,iep(iphas))
+
+ x2 = 0.d0
+ do icla = 1,nclafu
+ x2 = x2 + rtp(iel,isca(iyfol(icla)))
+ enddo
+
+! On transporte CO2
+
+ smbrs(iel) = smbrs(iel) &
+ +wmole(ico2)/propce(iel,ipcrom) &
+ * (xco2e-xxco2)/(tauchi+tautur) * volume(iel) &
+ * (1.d0-x2)
+
+ w1(iel) = volume(iel)/(tauchi+tautur)
+ rovsdt(iel) = rovsdt(iel) + max(w1(iel),zero)
+
+ else
+
+! Pas de CO
+
+ smbrs(iel) = smbrs(iel) + 0.d0
+ rovsdt(iel) = rovsdt(iel)+ 0.d0
+
+ endif
+
+ enddo
+
+ if(irangp.ge.0) then
+ call parcpt(nberic)
+ call parmax(err1mx)
+ endif
+ write(NFECRA,*) ' Erreur max = ',ERR1MX
+ write(NFECRA,*) ' Points non ',NBERIC
+
+ endif
+
+endif
+
+
+! --> Terme source pour HCN et NO : uniquement a partir de la 2eme
+! iter
+
+if ( ieqnox .eq. 1 .and. ntcabs .gt. 1) then
+
+ if ( ivar.eq.isca(iyhcn) .or. ivar.eq.isca(iyno) ) then
+
+ iexp1 = ipproc(ighcn1)
+ iexp2 = ipproc(ighcn2)
+ iexp3 = ipproc(ignoth)
+
+! QPR= %N lib�r� pendant l'evaporation/taux de matieres volatiles
+! moyen
+
+ qpr = 0.5d0
+
+! YMOY = % vapeur en sorties
+
+ ymoy = 0.d0
+ volm = 0.d0
+ dmp = 0.d0
+ volmp = 0.d0
+ do ifac=1,nfabor
+
+ if ( itypfb(ifac,iphas).eq. isolib ) then
+
+ iel = ifabor(ifac)
+
+ ymoy = ymoy + rtpa(iel,isca(ifvap))*volume(iel)
+ volm = volm + volume(iel)
+ do icla=1,nclafu
+ dmp = dmp + rtpa(iel,isca(ing(icla))) &
+ *volume(iel)*dinifl(icla)
+ volmp = volmp + volume(iel)
+ enddo
+
+ endif
+ enddo
+
+ if ( irangp .ge. 0 ) then
+ call parsom(ymoy)
+ call parsom(volm)
+ call parsom(dmp)
+ call parsom(volmp)
+ endif
+
+ if ( ymoy .gt. 0.d0 .and. volm .gt. 0.d0 ) then
+ ymoy = ymoy/volm
+ if ( dmp .gt. 0.d0 .and. volmp .gt.0.d0 ) then
+ ymoy = ymoy/(dmp/volmp)
+ WRITE(NFECRA,*) ' Taux YMOY = ',YMOY
+ else
+ write(nfecra,2000)
+ ymoy = 0.5d0
+ endif
+ else
+ write(nfecra,2000)
+ ymoy = 0.5d0
+ endif
+
+! Azote dans le fuel
+
+ fn = 0.015
+
+! Masse molaire
+
+ wmhcn = 0.027d0
+ wmno = 0.030d0
+
+ if ( ivar.eq.isca(iyhcn) ) then
+
+! Terme source HCN
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ auxmin = 1.d+20
+ auxmax =-1.d+20
+
+ do iel=1,ncel
+
+ aux = volume(iel)*propce(iel,ipcrom) &
+ *(propce(iel,iexp1)+propce(iel,iexp2)) &
+ *rtpa(iel,isca(iyno)) &
+ *propce(iel,ipproc(immel)) &
+ /wmole(io2)
+
+ smbrs(iel) = smbrs(iel) &
+ -aux*rtpa(iel,ivar)
+ rovsdt(iel) = rovsdt(iel) + aux
+
+ gmvap = 0.d0
+ gmhet = 0.d0
+ do icla=1,nclafu
+
+ ipcgev = ipproc(igmeva(icla))
+ ipcght = ipproc(igmhtf(icla))
+ ipcte2 = ipproc(itemp3(icla))
+ ipcte1 = ipproc(itemp1)
+
+ gmvap = gmvap &
+ + propce(iel,ipcrom)*volume(iel) &
+ *propce(iel,ipcgev) &
+ *(propce(iel,ipcte2)-propce(iel,ipcte1))
+
+ gmhet = gmhet &
+ +propce(iel,ipcrom)*volume(iel) &
+ *propce(iel,ipcght)
+
+ enddo
+
+ aux = -fn*wmhcn/(wmole(in2)/2.d0) &
+ *(qpr*gmvap+(1.d0-qpr*ymoy)/ymoy*gmhet)
+ smbrs(iel) = smbrs(iel) + aux
+ auxmin = min(auxmin,aux)
+ auxmax = max(auxmax,aux)
+
+ enddo
+ write(*,*) ' AUX MIN MAX = ',AUXMIN,AUXMAX
+
+ endif
+
+ if ( ivar.eq.isca(iyno) ) then
+
+! Terme source NO
+
+ if (iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+ endif
+
+ do iel=1,ncel
+
+ aux1 = volume(iel)*propce(iel,ipcrom) &
+ *propce(iel,iexp1)*rtpa(iel,isca(iyhcn)) &
+ *propce(iel,ipproc(immel))/wmhcn
+ aux2 = volume(iel)*propce(iel,ipcrom) &
+ *propce(iel,iexp2)*rtpa(iel,isca(iyhcn)) &
+ *wmno/wmhcn
+ aux3 = volume(iel)*propce(iel,ipcrom)**1.5d0 &
+ *propce(iel,iexp3) &
+ *(propce(iel,ipproc(iym1(io2))))*0.5d0 &
+ * propce(iel,ipproc(iym1(in2)))
+
+ smbrs(iel) = smbrs(iel) - aux1*rtpa(iel,ivar) &
+ + aux2 + aux3
+ rovsdt(iel) = rovsdt(iel) + aux1
+ enddo
+
+ endif
+
+ endif
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES PHYSIQUE PARTICULIERE POUR LA VARIABLE ' &
+ ,a8,/)
+ 2000 format(' ATTENTION : LE TAUX DE VAPEUR EN SORTIE', &
+ ' EST NULLE',/, &
+ ' ON PREND QPR = 0.5')
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/fuel/futsvc.f90 b/src/fuel/futsvc.f90
new file mode 100644
index 0000000..32ec053
--- /dev/null
+++ b/src/fuel/futsvc.f90
@@ -0,0 +1,433 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine futsvc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , iscala , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ smbrs , rovsdt , &
+ wfb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME FUEL
+! TERMES SOURCES DE PRODUCTION ET DE DISSIPATION POUR
+! LA VARIANCE (BILANS EXPLICITE ET IMPLICITE)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! iscala ! e ! <-- ! numero du scalaire associe !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! wfb(nfabor) ! tr ! --- ! tableau de travail faces de bord !
+! w1..8(ncelet) ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal , iscala
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision wfb(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ivar , ivarsc , ivarut , ivar0
+integer iel , iphas , ifac , icla
+integer ipcrom , ipcvst
+integer ikiph , ieiph , iomgip , iphydp
+integer ir11ip , ir22ip, ir33ip
+integer inc , iccocg , nswrgp , imligp , iwarnp
+integer ifinra , icoefa , icoefb
+integer idimte , itenso
+
+double precision xk , xe , rhovst
+double precision epsrgp , climgp , extrap
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Numero du scalaire eventuel associe dans le cas fluctuation
+! ISCALA et numero de variable de calcul
+if (iscala.gt.0) then
+ ivarsc = isca(iscala)
+else
+ ivarsc = 0
+endif
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Numero des variables de calcul
+if ( itytur(iphas).eq.2 .or. iturb(iphas).eq.50 ) then
+ ikiph = ik (iphas)
+ ieiph = iep (iphas)
+elseif ( itytur(iphas).eq.3 ) then
+ ir11ip = ir11(iphas)
+ ir22ip = ir22(iphas)
+ ir33ip = ir33(iphas)
+ ieiph = iep (iphas)
+elseif ( iturb(iphas).eq.60 ) then
+ ikiph = ik (iphas)
+ iomgip = iomg(iphas)
+endif
+
+! --- Numero des grandeurs physiques
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES TERMES SOURCES DE PRODUCTION PAR LES GRADIENTS
+! ET DE DISSIPATION
+!===============================================================================
+
+if ( itytur(iphas).eq.2 .or. itytur(iphas).eq.3 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60) then
+
+ inc = 1
+ iccocg = 1
+ if (ivarsc.gt.0) then
+ ivarut = ivarsc
+ else
+! A defaut de savoir pour F4M on prend comme pour IFVAP
+ ivarut = isca(ifvap)
+ endif
+ nswrgp = nswrgr(ivarut)
+ imligp = imligr(ivarut)
+ iwarnp = iwarni(ivarut)
+ epsrgp = epsrgr(ivarut)
+ climgp = climgr(ivarut)
+ extrap = extrag(ivarut)
+
+! --> Calcul de FIM et X2 dans W7 et W8
+
+ do iel = 1, ncel
+ w1(iel) = zero
+ w2(iel) = zero
+ w3(iel) = zero
+ w4(iel) = zero
+ w5(iel) = zero
+ w6(iel) = zero
+ w7(iel) = zero
+ w8(iel) = 1.d0
+ enddo
+
+! ---- W8 = X1
+
+ do iel = 1, ncel
+ w8(iel) = 1.d0
+ enddo
+ do icla = 1, nclafu
+ do iel = 1, ncel
+ w8(iel) = w8(iel) - rtp(iel,isca(iyfol(icla)))
+ enddo
+ enddo
+
+! ---- W7 = FJM (kg/kg du melange gazeux)
+
+ if (ivarsc.eq.0) then
+ do iel = 1, ncel
+ w7(iel) = 1.d0 &
+ -( rtp(iel,isca(ifhtf)) &
+ +rtp(iel,isca(ifvap)) ) / w8(iel)
+
+ enddo
+ else
+ do iel = 1, ncel
+ w7(iel) = rtp(iel,ivarsc) / w8(iel)
+ enddo
+ endif
+
+! --> Calcul des COEFA et COEFB de FIM afin d'en calculer son gradient
+! On alloue localement 2 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB de FIM
+
+ icoefa = idebra
+ icoefb = icoefa + nfabor
+ ifinra = icoefb + nfabor
+ CALL RASIZE ('FUTSVC',IFINRA)
+ !==========
+
+ do ifac = 1, nfabor
+ ra(icoefa+ifac-1) = zero
+ ra(icoefb+ifac-1) = 1.d0
+ if ( itypfb(ifac,iphas).eq.ientre ) then
+ ra(icoefa+ifac-1) = zero
+ ra(icoefb+ifac-1) = zero
+ if (ivarsc.eq.0) ra(icoefa+ifac-1) = 1.d0
+ endif
+ enddo
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom(w7)
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 , &
+ w7 , w7 , w7 )
+ endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w7 , w7 , w7 , &
+ w7 , ra(icoefa) , ra(icoefb) , &
+! FIM COEFA COEFB
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1, ncel
+ if ( itytur(iphas).eq.2 .or. iturb(iphas).eq.50 ) then
+ xk = rtpa(iel,ikiph)
+ xe = rtpa(iel,ieiph)
+ elseif ( itytur(iphas).eq.3 ) then
+ xk = &
+ 0.5d0*(rtpa(iel,ir11ip)+rtpa(iel,ir22ip)+rtpa(iel,ir33ip))
+ xe = rtpa(iel,ieiph)
+ elseif ( iturb(iphas).eq.60 ) then
+ xk = rtpa(iel,ikiph)
+ xe = cmu*xk*rtpa(iel,iomgip)
+ endif
+
+ rhovst = propce(iel,ipcrom)*xe/ &
+ (xk * rvarfl(iscal))*volume(iel)
+ rovsdt(iel) = rovsdt(iel) + max(zero,rhovst)
+ smbrs (iel) = smbrs (iel) + &
+ 2.d0*propce(iel,ipcvst)*volume(iel)/sigmas(iscal) &
+ * (w1(iel)**2 + w2(iel)**2 + w3(iel)**2) * w8(iel)&
+ - rhovst*rtpa(iel,ivar)
+
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/fuel/futsvi.f90 b/src/fuel/futsvi.f90
new file mode 100644
index 0000000..715391d
--- /dev/null
+++ b/src/fuel/futsvi.f90
@@ -0,0 +1,235 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine futsvi &
+!================
+
+ ( ncelet , ncel , numtra , &
+ rtp , propce , volume , &
+ smbrs , rovsdt , &
+ w1 )
+
+!===============================================================================
+! FONCTION :
+! --------
+! ROUTINE PHYSIQUE PARTICULIERE : FLAMME FUEL
+! TERMES DE TRANSFERT DE MASSE ENTRE LA PHASE CONTINUE
+! ET LA PHASE DISPERSEE RELATIF A LA VARIANCE DES DIFFERENTS
+! TRACEURS (BILANS EXPLICITE ET IMPLICITE)
+
+! ATTENTION CETTE SUBROUTINE N'EST OPERATIONNELLE QUE
+! POUR NUMTRA = 3 ou 4
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! numtra ! e ! <-- ! numero du traceur concerne (1,2,3,4) !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant precedent) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! w1(ncelet) ! tr ! --- ! tableau de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , ncel , numtra
+
+double precision rtp(ncelet,*), propce(ncelet,*)
+double precision volume(ncelet)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision w1(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel , icla , iphas
+integer ipcrom
+integer ixckcl , ixnpcl , ipcght , ipcdia
+
+double precision gamvap , gamhet , d2s3
+double precision fvap(4), fsd(4) , fsh(4) , ftrac(4)
+double precision fhet(4)
+double precision diamht , diamad
+
+integer ipcte1 , ipcte2
+double precision t2mt1
+
+!===============================================================================
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! ---- W1 = X1
+
+do iel = 1, ncel
+ w1(iel) = 1.d0
+enddo
+do icla = 1, nclafu
+ do iel = 1, ncel
+ w1(iel) = w1(iel) - rtp(iel,isca(iyfol(icla)))
+ enddo
+enddo
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. CALCULS DES BILANS EXPLICITE ET IMPLICITE
+!===============================================================================
+
+
+iphas = 1
+ipcrom = ipproc(irom(iphas))
+ixckcl = isca(ifhtf)
+ipcte1 = ipproc(itemp1)
+
+do icla = 1, nclafu
+
+ ixnpcl = isca(ing(icla))
+ ipcght = ipproc(igmhtf(icla))
+ ipcdia = ipproc(idiam3(icla))
+ ipcte2 = ipproc(itemp3(icla))
+
+ do iel = 1, ncel
+
+ if ( rtp(iel,ixnpcl) .gt. epsifl ) then
+
+! --> Calculs preliminaires
+
+ ftrac(1) = rtp(iel,isca(ifvap)) / w1(iel)
+ ftrac(3) = rtp(iel,isca(ifhtf)) / w1(iel)
+ ftrac(4) = 1.d0-ftrac(1)-ftrac(3)
+
+! --> Prise en compte des TS interfaciaux relatifs
+! au phenomene d'evaporation
+
+! GAMVAP = PROPCE(IEL,IPPROC(IGMEVA(ICLA)))*PROPCE(IEL,IPCROM)
+
+ t2mt1 = propce(iel,ipcte2)-propce(iel,ipcte1)
+ gamvap = -propce(iel,ipproc(igmeva(icla)))*t2mt1 &
+ *propce(iel,ipcrom)
+
+ fsd(1) = 0.d0
+ fsd(3) = 0.d0
+ fsd(4) = 0.d0
+
+ fvap(1) = 1.d0
+ fvap(3) = 0.d0
+ fvap(4) = 0.d0
+
+ if ( (fsd(numtra)-ftrac(numtra)) &
+ *(2.d0*fvap(numtra)-fsd(numtra)-ftrac(numtra)) &
+ .gt. epsifl ) then
+ smbrs(iel) = smbrs(iel) + gamvap &
+ *volume(iel)*(fsd(numtra)-ftrac(numtra)) &
+ *(2.d0*fvap(numtra)-fsd(numtra)-ftrac(numtra))
+ endif
+
+! --> Prise en compte des TS interfaciaux relatifs
+! au phenomene de combustion heterogene
+
+ gamhet = -propce(iel,ipcrom)*propce(iel,ipcght)
+
+ diamht = ( ( rtp(iel,isca(iyfol(icla))) &
+ /(rtp(iel,isca(ing(icla)))*rho0fl) &
+ -pi*(dinikf(icla)**3)*xinkf/6.d0 ) &
+ *6.d0/(pi*(1.d0-xinkf)) )
+ diamht = abs(diamht)**(1.d0/3.d0)
+
+ diamad = propce(iel,ipcdia) / dinikf(icla)
+
+ fsh(3) = 1.d0
+ if ( diamad.gt.epsifl ) then
+ fsh(3) = 1.d0 - (1.d0-ftrac(3)) &
+ * exp( propce(iel,ipcght) &
+ /( 2.d0*pi*2.77d-4*diamht &
+ *rtp(iel,ixnpcl)*propce(iel,ipcrom) ) )
+ endif
+
+ fsh(1) = ftrac(1) * (1.d0-fsh(3))/(1.d0-ftrac(3))
+ fsh(4) = ftrac(4) * (1.d0-fsh(3))/(1.d0-ftrac(3))
+
+ fhet(1) = zero
+ fhet(3) = 1.d0
+ fhet(4) = zero
+
+ if ( (fsh(numtra)-ftrac(numtra)) &
+ *(2.d0*fhet(numtra)-fsh(numtra)-ftrac(numtra)) &
+ .gt. epsifl ) then
+ smbrs(iel) = smbrs(iel) + gamhet &
+ *volume(iel)*(fsh(numtra)-ftrac(numtra)) &
+ *(2.d0*fhet(numtra)-fsh(numtra)-ftrac(numtra))
+ endif
+
+ endif
+
+ enddo
+
+enddo
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/fuel/fuvarp.f90 b/src/fuel/fuvarp.f90
new file mode 100644
index 0000000..dfbba50
--- /dev/null
+++ b/src/fuel/fuvarp.f90
@@ -0,0 +1,147 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine fuvarp
+!================
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES TRANSPORTEES POUR
+! COMBUSTION FUEL
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer is, iphas, isc, icla
+
+!===============================================================================
+!===============================================================================
+! 1. DEFINITION DES POINTEURS
+!===============================================================================
+
+! ---> Variables propres a la suspension gaz - particules
+
+ihm = iscapp(1)
+
+! ---> Variables propres a la phase dispersee
+
+do icla = 1, nclafu
+ is = 1+icla
+ ing(icla) = iscapp(is)
+ is = 1+1*nclafu+icla
+ iyfol(icla) = iscapp(is)
+ is = 1+2*nclafu+icla
+ ihlf(icla) = iscapp(is)
+enddo
+
+! ---> Variables propres a la phase gaz
+
+is = is + 1
+ifvap = iscapp(is)
+is = is + 1
+ifhtf = iscapp(is)
+is = is + 1
+if4p2m = iscapp(is)
+
+if ( ieqco2 .ge. 1 ) then
+ is = is+1
+ iyco2 = iscapp(is)
+endif
+
+if ( ieqnox .eq. 1 ) then
+ is = is+1
+ iyhcn = iscapp(is)
+ is = is+1
+ iyno = iscapp(is)
+ is = is+1
+ itaire = iscapp(is)
+endif
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+! A RENSEIGNER OBLIGATOIREMENT (sinon pb dans varpos)
+! - PROPRES AUX SCALAIRES : IPHSCA, IVISLS, ISCAVR
+! Rq : pas de variance associee a un scalaire dans notre cas
+! - PROPRES A LA SUSPENSION : ICP
+!===============================================================================
+
+do isc = 1, nscapp
+
+ if ( iscavr(iscapp(isc)) .le. 0 ) then
+
+! ---- Notre physique particuliere est monophasique
+ iphsca(iscapp(isc)) = 1
+
+! ---- Viscosite dynamique de reference relative au scalaire
+! ISCAPP(ISC)
+ ivisls(iscapp(isc)) = 0
+
+ endif
+
+enddo
+
+! ---- Bien que l on soit en enthalpie on conserve un CP constant
+
+iphas = iphsca(ihm)
+icp(iphas) = 0
+
+return
+end
diff --git a/src/fuel/fuveri.f90 b/src/fuel/fuveri.f90
new file mode 100644
index 0000000..341ad33
--- /dev/null
+++ b/src/fuel/fuveri.f90
@@ -0,0 +1,176 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine fuveri &
+!================
+
+ ( iok )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! VERIFICATION DES PARAMETRES DE CALCUL
+! COMBUSTION FUEL
+! APRES INTERVENTION UTILISATEUR
+! (COMMONS)
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iok
+
+! VARIABLES LOCALES
+
+integer iphas
+
+!===============================================================================
+
+!===============================================================================
+! 1. OPTIONS DU CALCUL : TABLEAUX DE ppincl.h : formats 2000
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+
+if( srrom.lt.0d0 .or. srrom.ge.1d0) then
+ WRITE(NFECRA,2000)'SRROM ', SRROM
+ iok = iok + 1
+endif
+
+!===============================================================================
+! 2. TABLEAUX DE futphy.h et ppthch.F : formats 3000
+!===============================================================================
+
+iphas = 1
+
+! --> Masse volumique
+
+if( ro0(iphas).lt.0d0) then
+ WRITE(NFECRA,3000)IPHAS,'RO0 ', RO0(IPHAS)
+ iok = iok + 1
+endif
+
+! --> Diffusivite dynamique en kg/(m s) : DIFTL0
+
+if( diftl0.lt.0d0) then
+ WRITE(NFECRA,3010)'DIFTL0', DIFTL0
+ iok = iok + 1
+else
+ visls0(ihm) = diftl0
+endif
+
+!===============================================================================
+! 3. FORMATS VERIFICATION
+!===============================================================================
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6, ' DOIT ETRE UN REEL ',/,&
+'@ SUPERIEUR OU EGAL A ZERO ET INFERIEUR STRICTEMENT A 1 ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usfui1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHASE ',I10 ,/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usfui1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ',A6,' DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL VAUT ICI ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usfui1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 6. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/src/fuel/memfu1.f90 b/src/fuel/memfu1.f90
new file mode 100644
index 0000000..cf2791e
--- /dev/null
+++ b/src/fuel/memfu1.f90
@@ -0,0 +1,132 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memfu1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ nvar , ncelet , ncel , nfac , nfabor , &
+ ntbfui , ifuwi , &
+ ntbfur , ifuwr , &
+ ntbwoi , iwori , &
+ ntbwor , iworr , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! PHYSIQUE PARTICULIERE : FLAMME FUEL
+! GESTION MEMOIRE CALCUL DES PROPRIETES PHYSIQUES PHASE GAZ
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! e ! <-- ! pointeur de la premiere cas libre des !
+! ! ! ! tableaux ia/ra !
+! nvar ! e ! <-- ! nombre de variables !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ntbcpi ! e ! <-- ! taille du macro tableau cp entiers !
+! icpwi ! e ! --> ! pointeur macro tableau cp entiers !
+! ntbcpr ! e ! <-- ! taille du macro tableau cp reels !
+! icpwr ! e ! --> ! pointeur macro tableau cp reels !
+! ntbmci ! e ! <-- ! taille du macro tableau mc entiers !
+! imcwi ! e ! --> ! pointeur macro tableau mc entiers !
+! ntbmcr ! e ! <-- ! taille du macro tableau mc reels !
+! imcwr ! e ! --> ! pointeur macro tableau mc reels !
+! ntbwoi ! e ! <-- ! taille du macro tableau work entiers !
+! iwori ! e ! --> ! pointeur macro tableau work entiers !
+! ntbwor ! e ! <-- ! taille du macro tableau work reels !
+! iworr ! e ! --> ! pointeur macro tableau work reels !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre !
+! ! ! ! dans ra en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 ,idbra0
+integer nvar
+integer ncelet , ncel , nfac , nfabor
+integer ntbfui , ifuwi , ntbfur , ifuwr
+integer ntbwoi , iwori , ntbwor , iworr
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+ifuwi = idebia
+iwori = ifuwi + ntbfui*ncelet
+ifinia = iwori + ntbwoi*ncelet
+
+ifuwr = idebra
+iworr = ifuwr + ntbfur*ncelet
+ifinra = iworr + ntbwor*ncelet
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMFU1',IFINIA)
+!==========
+
+CALL RASIZE('MEMFU1',IFINRA)
+!==========
+
+return
+end
diff --git a/src/lagr/Makefile.am b/src/lagr/Makefile.am
new file mode 100644
index 0000000..81e16ae
--- /dev/null
+++ b/src/lagr/Makefile.am
@@ -0,0 +1,132 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/lagr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MPI_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@ @CFLAGS_EXT@
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/lagr/cs_lagr.h \
+$(top_srcdir)/include/lagr/cs_lagr_perio.h \
+$(top_srcdir)/include/lagr/lagdim.h \
+$(top_srcdir)/include/lagr/lagpar.h \
+$(top_srcdir)/include/lagr/lagran.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcslagr.la
+libcslagr_la_SOURCES = \
+cs_lagr.c \
+cs_lagr_perio.c \
+diverv.f90 \
+enslag.f90 \
+enswaf.f90 \
+lagaff.f90 \
+lagcar.f90 \
+lagcel.f90 \
+lagcou.f90 \
+lagdeb.f90 \
+lageli.f90 \
+lagent.f90 \
+lageqp.f90 \
+lagerr.f90 \
+lages1.f90 \
+lages2.f90 \
+lagesp.f90 \
+lagfch.f90 \
+laggra.f90 \
+laghis.f90 \
+lagich.f90 \
+lagidp.f90 \
+lagimp.f90 \
+lagini.f90 \
+lagipn.f90 \
+lagitf.f90 \
+lagitg.f90 \
+lagitp.f90 \
+laglec.f90 \
+laglis.f90 \
+lagnew.f90 \
+lagnpr.f90 \
+lagnwc.f90 \
+lagopt.f90 \
+lagout.f90 \
+lagphy.f90 \
+lagpoi.f90 \
+lagrus.f90 \
+lagsta.f90 \
+lagstf.f90 \
+lagtri.f90 \
+lagune.f90 \
+memla1.f90 \
+memla2.f90 \
+ouestu.f90
+libcslagr_la_LDFLAGS = -no-undefined
+
+libcslagr_la_SOURCES += \
+$(top_srcdir)/users/lagr/uslabo.f90 \
+$(top_srcdir)/users/lagr/usladp.f90 \
+$(top_srcdir)/users/lagr/uslaed.f90 \
+$(top_srcdir)/users/lagr/uslaen.f90 \
+$(top_srcdir)/users/lagr/uslafe.f90 \
+$(top_srcdir)/users/lagr/uslag1.f90 \
+$(top_srcdir)/users/lagr/uslag2.f90 \
+$(top_srcdir)/users/lagr/uslain.f90 \
+$(top_srcdir)/users/lagr/uslapr.f90 \
+$(top_srcdir)/users/lagr/uslaru.f90 \
+$(top_srcdir)/users/lagr/uslast.f90 \
+$(top_srcdir)/users/lagr/uslatc.f90 \
+$(top_srcdir)/users/lagr/uslatp.f90
+
+lagrdir = $(pkgdatadir)/users/lagr
+lagr_DATA = \
+$(top_srcdir)/users/lagr/uslabo.f90 \
+$(top_srcdir)/users/lagr/usladp.f90 \
+$(top_srcdir)/users/lagr/uslaed.f90 \
+$(top_srcdir)/users/lagr/uslaen.f90 \
+$(top_srcdir)/users/lagr/uslafe.f90 \
+$(top_srcdir)/users/lagr/uslag1.f90 \
+$(top_srcdir)/users/lagr/uslag2.f90 \
+$(top_srcdir)/users/lagr/uslain.f90 \
+$(top_srcdir)/users/lagr/uslapr.f90 \
+$(top_srcdir)/users/lagr/uslaru.f90 \
+$(top_srcdir)/users/lagr/uslast.f90 \
+$(top_srcdir)/users/lagr/uslatc.f90 \
+$(top_srcdir)/users/lagr/uslatp.f90
diff --git a/src/lagr/Makefile.in b/src/lagr/Makefile.in
new file mode 100644
index 0000000..54d20d8
--- /dev/null
+++ b/src/lagr/Makefile.in
@@ -0,0 +1,740 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/lagr
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcslagr_la_LIBADD =
+am_libcslagr_la_OBJECTS = cs_lagr.lo cs_lagr_perio.lo diverv.lo \
+ enslag.lo enswaf.lo lagaff.lo lagcar.lo lagcel.lo lagcou.lo \
+ lagdeb.lo lageli.lo lagent.lo lageqp.lo lagerr.lo lages1.lo \
+ lages2.lo lagesp.lo lagfch.lo laggra.lo laghis.lo lagich.lo \
+ lagidp.lo lagimp.lo lagini.lo lagipn.lo lagitf.lo lagitg.lo \
+ lagitp.lo laglec.lo laglis.lo lagnew.lo lagnpr.lo lagnwc.lo \
+ lagopt.lo lagout.lo lagphy.lo lagpoi.lo lagrus.lo lagsta.lo \
+ lagstf.lo lagtri.lo lagune.lo memla1.lo memla2.lo ouestu.lo \
+ uslabo.lo usladp.lo uslaed.lo uslaen.lo uslafe.lo uslag1.lo \
+ uslag2.lo uslain.lo uslapr.lo uslaru.lo uslast.lo uslatc.lo \
+ uslatp.lo
+libcslagr_la_OBJECTS = $(am_libcslagr_la_OBJECTS)
+libcslagr_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcslagr_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcslagr_la_SOURCES)
+DIST_SOURCES = $(libcslagr_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(lagrdir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+lagrDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(lagr_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/lagr \
+ at BFT_CPPFLAGS@ @FVM_CPPFLAGS@ @MPI_CPPFLAGS@
+
+AM_CFLAGS = @CFLAGS_DBG@ @CFLAGS_OPT@ @CFLAGS_EXT@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/lagr/cs_lagr.h \
+$(top_srcdir)/include/lagr/cs_lagr_perio.h \
+$(top_srcdir)/include/lagr/lagdim.h \
+$(top_srcdir)/include/lagr/lagpar.h \
+$(top_srcdir)/include/lagr/lagran.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcslagr.la
+libcslagr_la_SOURCES = cs_lagr.c cs_lagr_perio.c diverv.f90 enslag.f90 \
+ enswaf.f90 lagaff.f90 lagcar.f90 lagcel.f90 lagcou.f90 \
+ lagdeb.f90 lageli.f90 lagent.f90 lageqp.f90 lagerr.f90 \
+ lages1.f90 lages2.f90 lagesp.f90 lagfch.f90 laggra.f90 \
+ laghis.f90 lagich.f90 lagidp.f90 lagimp.f90 lagini.f90 \
+ lagipn.f90 lagitf.f90 lagitg.f90 lagitp.f90 laglec.f90 \
+ laglis.f90 lagnew.f90 lagnpr.f90 lagnwc.f90 lagopt.f90 \
+ lagout.f90 lagphy.f90 lagpoi.f90 lagrus.f90 lagsta.f90 \
+ lagstf.f90 lagtri.f90 lagune.f90 memla1.f90 memla2.f90 \
+ ouestu.f90 $(top_srcdir)/users/lagr/uslabo.f90 \
+ $(top_srcdir)/users/lagr/usladp.f90 \
+ $(top_srcdir)/users/lagr/uslaed.f90 \
+ $(top_srcdir)/users/lagr/uslaen.f90 \
+ $(top_srcdir)/users/lagr/uslafe.f90 \
+ $(top_srcdir)/users/lagr/uslag1.f90 \
+ $(top_srcdir)/users/lagr/uslag2.f90 \
+ $(top_srcdir)/users/lagr/uslain.f90 \
+ $(top_srcdir)/users/lagr/uslapr.f90 \
+ $(top_srcdir)/users/lagr/uslaru.f90 \
+ $(top_srcdir)/users/lagr/uslast.f90 \
+ $(top_srcdir)/users/lagr/uslatc.f90 \
+ $(top_srcdir)/users/lagr/uslatp.f90
+libcslagr_la_LDFLAGS = -no-undefined
+lagrdir = $(pkgdatadir)/users/lagr
+lagr_DATA = \
+$(top_srcdir)/users/lagr/uslabo.f90 \
+$(top_srcdir)/users/lagr/usladp.f90 \
+$(top_srcdir)/users/lagr/uslaed.f90 \
+$(top_srcdir)/users/lagr/uslaen.f90 \
+$(top_srcdir)/users/lagr/uslafe.f90 \
+$(top_srcdir)/users/lagr/uslag1.f90 \
+$(top_srcdir)/users/lagr/uslag2.f90 \
+$(top_srcdir)/users/lagr/uslain.f90 \
+$(top_srcdir)/users/lagr/uslapr.f90 \
+$(top_srcdir)/users/lagr/uslaru.f90 \
+$(top_srcdir)/users/lagr/uslast.f90 \
+$(top_srcdir)/users/lagr/uslatc.f90 \
+$(top_srcdir)/users/lagr/uslatp.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lagr/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/lagr/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcslagr.la: $(libcslagr_la_OBJECTS) $(libcslagr_la_DEPENDENCIES)
+ $(libcslagr_la_LINK) $(libcslagr_la_OBJECTS) $(libcslagr_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_lagr.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cs_lagr_perio.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+uslabo.lo: $(top_srcdir)/users/lagr/uslabo.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslabo.lo `test -f '$(top_srcdir)/users/lagr/uslabo.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslabo.f90
+
+usladp.lo: $(top_srcdir)/users/lagr/usladp.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usladp.lo `test -f '$(top_srcdir)/users/lagr/usladp.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/usladp.f90
+
+uslaed.lo: $(top_srcdir)/users/lagr/uslaed.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslaed.lo `test -f '$(top_srcdir)/users/lagr/uslaed.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslaed.f90
+
+uslaen.lo: $(top_srcdir)/users/lagr/uslaen.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslaen.lo `test -f '$(top_srcdir)/users/lagr/uslaen.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslaen.f90
+
+uslafe.lo: $(top_srcdir)/users/lagr/uslafe.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslafe.lo `test -f '$(top_srcdir)/users/lagr/uslafe.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslafe.f90
+
+uslag1.lo: $(top_srcdir)/users/lagr/uslag1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslag1.lo `test -f '$(top_srcdir)/users/lagr/uslag1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslag1.f90
+
+uslag2.lo: $(top_srcdir)/users/lagr/uslag2.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslag2.lo `test -f '$(top_srcdir)/users/lagr/uslag2.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslag2.f90
+
+uslain.lo: $(top_srcdir)/users/lagr/uslain.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslain.lo `test -f '$(top_srcdir)/users/lagr/uslain.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslain.f90
+
+uslapr.lo: $(top_srcdir)/users/lagr/uslapr.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslapr.lo `test -f '$(top_srcdir)/users/lagr/uslapr.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslapr.f90
+
+uslaru.lo: $(top_srcdir)/users/lagr/uslaru.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslaru.lo `test -f '$(top_srcdir)/users/lagr/uslaru.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslaru.f90
+
+uslast.lo: $(top_srcdir)/users/lagr/uslast.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslast.lo `test -f '$(top_srcdir)/users/lagr/uslast.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslast.f90
+
+uslatc.lo: $(top_srcdir)/users/lagr/uslatc.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslatc.lo `test -f '$(top_srcdir)/users/lagr/uslatc.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslatc.f90
+
+uslatp.lo: $(top_srcdir)/users/lagr/uslatp.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o uslatp.lo `test -f '$(top_srcdir)/users/lagr/uslatp.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/lagr/uslatp.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-lagrDATA: $(lagr_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(lagrdir)" || $(MKDIR_P) "$(DESTDIR)$(lagrdir)"
+ @list='$(lagr_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(lagrDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(lagrdir)/$$f'"; \
+ $(lagrDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(lagrdir)/$$f"; \
+ done
+
+uninstall-lagrDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lagr_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(lagrdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(lagrdir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(lagrdir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-lagrDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-lagrDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-lagrDATA \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-saturneincludeHEADERS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-lagrDATA \
+ uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/lagr/cs_lagr.c b/src/lagr/cs_lagr.c
new file mode 100644
index 0000000..eaf1959
--- /dev/null
+++ b/src/lagr/cs_lagr.c
@@ -0,0 +1,625 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Utilitarian functions for the diphasic lagrangian module
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_lagr.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Local structure definitions
+ *============================================================================*/
+
+/*=============================================================================
+ * Local Macro definitions
+ *============================================================================*/
+
+/*============================================================================
+ * Static global variables
+ *============================================================================*/
+
+/* variable for _orient3D_set_maxvalue */
+
+static double MAX24; /* bounding box size */
+static double SNAP_TO_GRID; /* for rounding of coordinates */
+static double Orient3D_split_2_25; /* split to bit MAX0^2 * 2^25 */
+static double C1_ORIENTATION_3D; /* static orientation filter */
+static double C2_ORIENTATION_3D; /* semi-static orientation filter */
+static double C3_ORIENTATION_3D; /* half degree 3 unit for semi-static filter */
+static double C4_PERTURB_OR_3D; /* static filter for perturbation */
+
+/* variable for _orientation3D */
+
+static const cs_int_t POSITIVE = 1 ;
+static const cs_int_t NEGATIVE = -1 ;
+static const cs_int_t COPLANAR = 0 ;
+
+/*=============================================================================
+ * Private function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check if IEEE 754 standard is respected for floating storage for this
+ * architecture. Test on the accuracy of the computation.
+ *
+ * Returns:
+ * integer (EXIT_FAILURE / EXIT_SUCCES)
+ *----------------------------------------------------------------------------*/
+
+static cs_int_t
+_check_ieee_standard(void)
+{
+ double dd;
+
+ double d = 9007199254740992.0; /* 2^53 */
+
+ dd = d + 1;
+ if (dd != d) return EXIT_FAILURE; /* compute with too much bits */
+
+ dd = d - 1;
+ if (dd == d) return EXIT_FAILURE; /* compute with not enough bits */
+
+ return EXIT_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ * The argument is an upperbound on the coordinates.
+ * Change the data conditioning.
+ *
+ * d --> upper bound on data values.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+static inline void
+_orient3D_set_maxvalue(double d)
+{
+ float D;
+
+ /* Coordinates precision */
+ double MAX0 = 1.0; /* 2^0 */
+
+ MAX24 = 16777216.0; /* 2^24 */
+ SNAP_TO_GRID = 6755399441055744.0; /* 3 * 2^51 */
+ Orient3D_split_2_25 = 453347182355485940514816.0; /* 3 * 2^77 */
+ C1_ORIENTATION_3D = 75497472.0; /* 9 * 2^23 */
+ C2_ORIENTATION_3D = 3.0/9007199254740992.0; /* 3 * 2^(-53) */
+ C3_ORIENTATION_3D = 0.5; /* 1/2 */
+ C4_PERTURB_OR_3D = 5066549580791808.0; /* 9 * 2^49 */
+
+ D = d * 4503599627370497.0; /* 2^52 + 1 */
+
+ /* On x86 or compatible, force extended-precision (80-bit) calculation
+ using x87 FPU instead of SSE instructions (64-bit). */
+
+#if defined(__GNUC__) && ( defined(__i386) \
+ || defined(__x86_64__) || defined(__amd64__))
+ {
+ double s = D;
+ __asm__ __volatile__("fldl %1\n\t" \
+ "faddl %2\n\t" \
+ "fsubl %2\n\t" \
+ "fstpl %0"
+ : "=m" (s)
+ : "m" (d), "m" (s));
+ D = s;
+ }
+
+/* On other architectures, a compiler option such ICC's
+ "-fp-model extended" is required. If the architecture does not
+ support Intel-type 80-bit precision calculations, the code
+ must be adapted. */
+
+#else
+ D = (d + D) -D; /* get the power of two closer to d */
+#endif
+
+ if (D < ((float)d))
+ D *= 2; /* grid max size 2^b */
+
+ MAX0 = D / 16777216.0; /* grid step 2^k = 2^b / 2^24 */
+ MAX24 = D;
+ SNAP_TO_GRID *= MAX0;
+ Orient3D_split_2_25 *= MAX0*MAX0;
+ C1_ORIENTATION_3D *= MAX0*MAX0*MAX0;
+ C3_ORIENTATION_3D *= MAX0*MAX0*MAX0;
+ C4_PERTURB_OR_3D *= MAX0*MAX0*MAX0*MAX0;
+}
+
+/*----------------------------------------------------------------------------
+ * Round a coordinate on the grid
+ *
+ * value --> valoe to round
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+static inline void
+_orient3D_normalize(float *value)
+{
+ /* round a value with fixed precision */
+
+ if ( (*value > MAX24) || (*value < -MAX24)) {
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("overflow |%g| > %g\nVerify the bounding box"
+ " for your data."), *value, MAX24);
+
+ *value=0.0;
+
+ }
+ else {
+
+ /* On x86 or compatible, force extended-precision (80-bit) calculation
+ using x87 FPU instead of SSE instructions (64-bit). */
+
+#if defined(__GNUC__) && ( defined(__i386) \
+ || defined(__x86_64__) || defined(__amd64__))
+ {
+ double d = *value, s = SNAP_TO_GRID;
+ __asm__ __volatile__("fldl %1\n\t" \
+ "faddl %2\n\t" \
+ "fsubl %2\n\t" \
+ "fstpl %0"
+ : "=m" (d)
+ : "m" (d), "m" (s));
+ *value = d;
+ }
+
+ /* On other architectures, a compiler option such ICC's
+ "-fp-model extended" is required. If the architecture does not
+ support Intel-type 80-bit precision calculations, the code
+ must be adapted. */
+#else
+ *value = ( *value + SNAP_TO_GRID ) - SNAP_TO_GRID;
+#endif
+ }
+
+}
+
+/*----------------------------------------------------------------------------
+ * Split a in two numbers. a=a1+a0, a1 get the most significant digit
+ * format specify the range of the input, and how to split if format is
+ * _split_i_j it means that a is of degree i (in terms of original coordinates)
+ * the splitting bit is MAX0^i * 2^j
+ *
+ * inline is not an ansi feature and not recognized everywhere
+ * BUT it looks as if -O optimization level lead to inlining anyway
+ * on Linux machines
+ *
+ * a --> value to treat
+ * a0 <-- a = a0 + a1
+ * a1 <-- a = a0 + a1
+ * format -->
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+static inline void
+_orient3D_split(double a,
+ double *a1,
+ double *a0,
+ double format)
+{
+ volatile double _a1 = (a + format);
+ *a1 = _a1 -format;
+ *a0 = a - *a1;
+}
+
+/*----------------------------------------------------------------------------
+ * Compute the orientation of the four points assumed to be rounded on
+ * the grid.
+ * The last argument specify if the perturbation technique is used in case of
+ * coplanarity
+ *
+ * ax --> X coordinate of the first vertex
+ * ay --> Y coordinate of the first vertex
+ * az --> Z coordinate of the first vertex
+ * bx --> X coordinate of the second vertex
+ * by --> Y coordinate of the second vertex
+ * bz --> Z coordinate of the second vertex
+ * cx --> X coordinate of the third vertex
+ * cy --> Y coordinate of the third vertex
+ * cz --> Z coordinate of the third vertex
+ * dx --> X coordinate of the fourth vertex
+ * dy --> Y coordinate of the fourth vertex
+ * dz --> Z coordinate of the fourth vertex
+ * pturb <->
+ *
+ * Returns:
+ * orientation of the four vertices (a,b,c,d).
+ * 0 = COPLANAR, 1 = POSITIVE, -1 = NEGATIVE.
+ *----------------------------------------------------------------------------*/
+
+static cs_int_t
+_orientation3D(float ax,
+ float ay,
+ float az,
+ float bx,
+ float by,
+ float bz,
+ float cx,
+ float cy,
+ float cz,
+ float dx,
+ float dy,
+ float dz,
+ cs_int_t PERTURBED)
+{
+ double error;
+ double M10, M11, M20, M21, M30, M31;
+ double RA, RB, RC, RD;
+ double RB0, RB1, RC0, RC1, RD0, RD1;
+
+ /* points are assumed to be distincts */
+
+ double A = (double)bx - (double)ax; /* x y z */
+ double B = (double)by - (double)ay;
+ double C = (double)bz - (double)az; /* | A B C | */
+ double D = (double)cx - (double)ax; /* | D E F | */
+ double E = (double)cy - (double)ay; /* | G H I | */
+ double F = (double)cz - (double)az;
+ double G = (double)dx - (double)ax;
+ double H = (double)dy - (double)ay;
+ double I = (double)dz - (double)az;
+
+ /* minors computation */
+
+ double M1 = D*H - E*G;
+ double M2 = A*H - B*G;
+ double M3 = A*E - B*D;
+
+ /* determinant computation */
+
+ double det = (C*M1 - F*M2) + I*M3;
+
+ if (det > C1_ORIENTATION_3D ) return POSITIVE;
+ if (det < -C1_ORIENTATION_3D ) return NEGATIVE;
+
+ /* det is small */
+ /* Orientation 3D, continuing */
+
+ error = (fabs(C*M1) + fabs(F*M2)) + fabs(I*M3);
+ error *= C2_ORIENTATION_3D;
+
+ if (error < C3_ORIENTATION_3D) error = 0.0;
+ if (det > error) return POSITIVE;
+ if (det < -error) return NEGATIVE;
+
+ /* det is very small, exact computation must be done */
+ /* Orientation 3D, continuing */
+
+ if (error != 0.0) { /* otherwise, exact value 0 already certified */
+
+ _orient3D_split(M1, &M11, &M10, Orient3D_split_2_25);
+ _orient3D_split(M2, &M21, &M20, Orient3D_split_2_25);
+ _orient3D_split(M3, &M31, &M30, Orient3D_split_2_25);
+
+ det = C*M11 - F*M21 + I*M31;
+ det += (C*M10 - F*M20 + I*M30); /* less significant */
+
+ if (det>0) return POSITIVE;
+ if (det<0) return NEGATIVE;
+
+ }
+
+ /* points are coplanar */
+
+ if (! PERTURBED) return COPLANAR;
+
+ /* start perturbation scheme */
+ /* (x,y,x) |-->(x+e^3(x^2+y^2+z^2), y+e^2(x^2+y^2+z^2), z +e(x^2+y^2+z^2)) */
+
+ RA = ax*ax + ay*ay + az*az;
+ RB = bx*bx + by*by + bz*bz - RA;
+ RC = cx*cx + cy*cy + cz*cz - RA;
+ RD = dx*dx + dy*dy + dz*dz - RA;
+
+ /* epsilon term */
+
+ det = (RB*M1 - RC*M2) + RD*M3; /* reuse minors */ /* A B RB */
+ if (det > C4_PERTURB_OR_3D) return POSITIVE; /* D E RC */
+ if (det < -C4_PERTURB_OR_3D) return NEGATIVE; /* G H RD */
+
+ /* det is small, doing exact computation */
+
+ /* modif EDF deb */
+ _orient3D_split(M1, &M11, &M10, Orient3D_split_2_25);
+ _orient3D_split(M2, &M21, &M20, Orient3D_split_2_25);
+ _orient3D_split(M3, &M31, &M30, Orient3D_split_2_25);
+ /* modif EDF fin */
+
+ _orient3D_split(RB, &RB1, &RB0, Orient3D_split_2_25);
+ _orient3D_split(RC, &RC1, &RC0, Orient3D_split_2_25);
+ _orient3D_split(RD, &RD1, &RD0, Orient3D_split_2_25);
+
+ det = RB1*M11 - RC1*M21 + RD1*M31;
+ det += (RB1*M10 + RB0*M11) - (RC1*M20 + RC0*M21) + (RD1*M30 + RD0*M31);
+ det += (RB0*M10 - RC0*M20 + RD0*M30); /* less significant */
+ if (det>0) return POSITIVE;
+ if (det<0) return NEGATIVE;
+
+ /* points coplanar in special direction go to e^2 term */
+
+ M1 = D*I - F*G; /* A RB C */
+ M2 = A*I - C*G; /* D RC F */
+ M3 = A*F - C*D; /* G RD I */
+ det = (-RB*M1 + RC*M2) - RD*M3;
+ if (det > C4_PERTURB_OR_3D) return POSITIVE;
+ if (det < -C4_PERTURB_OR_3D) return NEGATIVE;
+
+ /* det is small, doing exact computation */
+
+ _orient3D_split(M1, &M11, &M10, Orient3D_split_2_25);
+ _orient3D_split(M2, &M21, &M20, Orient3D_split_2_25);
+ _orient3D_split(M3, &M31, &M30, Orient3D_split_2_25);
+
+ det = -RB1*M11 + RC1*M21 - RD1*M31;
+ det += -(RB1*M10 + RB0*M11) + (RC1*M20 + RC0*M21) - (RD1*M30 + RD0*M31);
+ det += (-RB0*M10 + RC0*M20 - RD0*M30); /* less significant */
+ if (det>0) return POSITIVE;
+ if (det<0) return NEGATIVE;
+
+ /* points coplanar in special direction go to e^3 term */
+
+ M1 = E*I - F*H; /* RB B C */
+ M2 = B*I - C*H; /* RC E F */
+ M3 = B*F - C*E; /* RD H I */
+ det = (RB*M1 - RC*M2) + RD*M3;
+ if (det > C4_PERTURB_OR_3D) return POSITIVE;
+ if (det < -C4_PERTURB_OR_3D) return NEGATIVE;
+
+ /* det is small, doing exact computation */
+
+ _orient3D_split (M1, &M11, &M10, Orient3D_split_2_25);
+ _orient3D_split (M2, &M21, &M20, Orient3D_split_2_25);
+ _orient3D_split (M3, &M31, &M30, Orient3D_split_2_25);
+ det = RB1*M11 - RC1*M21 + RD1*M31;
+ det += (RB1*M10 + RB0*M11) - (RC1*M20 + RC0*M21) + (RD1*M30 + RD0*M31);
+ det += (RB0*M10 - RC0*M20 + RD0*M30); /* less significant */
+ if (det>0) return POSITIVE;
+ if (det<0) return NEGATIVE;
+
+ /* points are colinear */
+
+ return COPLANAR;
+}
+
+/*============================================================================
+ * Public function definitions
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Check if IEEE 754 standard is respected for floating storage for this
+ * architecture. If the standard is not respected the particle trajectography
+ * may be wrong.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (csieee,CSIEEE)(void)
+{
+
+ if (_check_ieee_standard()) {
+
+ bft_error(__FILE__, __LINE__, 0,
+ _("IEEE 754 arithmetic is not supported by the "
+ "current architecture."));
+
+ }
+}
+
+/*----------------------------------------------------------------------------
+ * Check the relative localization of two vertices. We want to know if these
+ * two vertices are identical.
+ *
+ * pvalmax --> upperbound on coordinates
+ * px --> X coordinate of the vertex P
+ * py --> Y coordinate of the vertex P
+ * pz --> Z coordinate of the vertex P
+ * qx --> X coordinate of the vertex Q
+ * qy --> Y coordinate of the vertex Q
+ * qz --> Z coordinate of the vertex Q
+ * sign <-> return tag (1 -> identical else 0)
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (coloca,COLOCA)(cs_real_t *pvalmax,
+ cs_real_t *px,
+ cs_real_t *py,
+ cs_real_t *pz,
+ cs_real_t *qx,
+ cs_real_t *qy,
+ cs_real_t *qz,
+ cs_int_t *sign)
+{
+ float xx0, yy0, zz0;
+ float xx1, yy1, zz1;
+
+ xx0 = (float) *px;
+ yy0 = (float) *py;
+ zz0 = (float) *pz;
+
+ xx1 = (float) *qx;
+ yy1 = (float) *qy;
+ zz1 = (float) *qz;
+
+ /* We look for the nearest and upper value to valmax by power of 2 */
+
+ _orient3D_set_maxvalue(*pvalmax);
+
+ _orient3D_normalize(&xx0);
+ _orient3D_normalize(&yy0);
+ _orient3D_normalize(&zz0);
+
+ _orient3D_normalize(&xx1);
+ _orient3D_normalize(&yy1);
+ _orient3D_normalize(&zz1);
+
+ /* We check if the two vertices are identical */
+
+ if ( (xx0==xx1) && (yy0==yy1) && (zz0==zz1) )
+ *sign = 1;
+ else
+ *sign = 0;
+
+}
+
+/*----------------------------------------------------------------------------
+ * Look for coordinate system orientation to locate particles in relation to
+ * faces.
+ *
+ * pvalmax --> upper bound on coordinates
+ * px --> X coordinate of the first vertex
+ * py --> Y coordinate of the first vertex
+ * pz --> Z coordinate of the first vertex
+ * qx --> X coordinate of the second vertex
+ * qy --> Y coordinate of the second vertex
+ * qz --> Z coordinate of the second vertex
+ * cdgx --> X coordinate of the third vertex
+ * cdgy --> Y coordinate of the third vertex
+ * cdgz --> Z coordinate of the third vertex
+ * crgx --> X coordinate of the fourth vertex
+ * crgy --> Y coordinate of the fourth vertex
+ * crgz --> Z coordinate of the fourth vertex
+ * sign <-> orientation of the four vertices.
+ * pturb <->
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (coturn,COTURN)(cs_real_t *pvalmax,
+ cs_real_t *px,
+ cs_real_t *py,
+ cs_real_t *pz,
+ cs_real_t *qx,
+ cs_real_t *qy,
+ cs_real_t *qz,
+ cs_real_t *cdgx,
+ cs_real_t *cdgy,
+ cs_real_t *cdgz,
+ cs_real_t *crdx,
+ cs_real_t *crdy,
+ cs_real_t *crdz,
+ cs_int_t *sign,
+ cs_int_t *pturb)
+{
+ float xx0, yy0, zz0;
+ float xx1, yy1, zz1;
+ float xx2, yy2, zz2;
+ float xx3, yy3, zz3;
+
+ /* Several "cast" */
+
+ xx0 = (float) *px;
+ yy0 = (float) *py;
+ zz0 = (float) *pz;
+
+ xx1 = (float) *qx;
+ yy1 = (float) *qy;
+ zz1 = (float) *qz;
+
+ xx2 = (float) *cdgx;
+ yy2 = (float) *cdgy;
+ zz2 = (float) *cdgz;
+
+ xx3 = (float) *crdx;
+ yy3 = (float) *crdy;
+ zz3 = (float) *crdz;
+
+ /* We look for the nearest and upper value to valmax by power of 2 */
+
+ _orient3D_set_maxvalue(*pvalmax);
+
+ _orient3D_normalize(&xx0);
+ _orient3D_normalize(&yy0);
+ _orient3D_normalize(&zz0);
+
+ _orient3D_normalize(&xx1);
+ _orient3D_normalize(&yy1);
+ _orient3D_normalize(&zz1);
+
+ _orient3D_normalize(&xx2);
+ _orient3D_normalize(&yy2);
+ _orient3D_normalize(&zz2);
+
+ _orient3D_normalize(&xx3);
+ _orient3D_normalize(&yy3);
+ _orient3D_normalize(&zz3);
+
+ /* *sign == 0 => COPLANAR,
+ *sign == 1 => POSITIVE orientation,
+ *sign == 1 => NEGATIVE orientation */
+
+ *sign = _orientation3D(xx0, yy0, zz0,
+ xx1, yy1, zz1,
+ xx2, yy2, zz2,
+ xx3, yy3, zz3,
+ *pturb);
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/lagr/cs_lagr_perio.c b/src/lagr/cs_lagr_perio.c
new file mode 100644
index 0000000..dd0d4c8
--- /dev/null
+++ b/src/lagr/cs_lagr_perio.c
@@ -0,0 +1,262 @@
+/*============================================================================
+ *
+ * This file is part of the Code_Saturne Kernel, element of the
+ * Code_Saturne CFD tool.
+ *
+ * Copyright (C) 1998-2008 EDF S.A., France
+ *
+ * contact: saturne-support at edf.fr
+ *
+ * The Code_Saturne Kernel 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.
+ *
+ * The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ *
+ *============================================================================*/
+
+/*============================================================================
+ * Management of the periodicity for particles
+ *============================================================================*/
+
+#if defined(HAVE_CONFIG_H)
+#include "cs_config.h"
+#endif
+
+/*----------------------------------------------------------------------------
+ * Standard C library headers
+ *----------------------------------------------------------------------------*/
+
+#include <assert.h>
+
+/*----------------------------------------------------------------------------
+ * BFT library headers
+ *----------------------------------------------------------------------------*/
+
+#include <bft_error.h>
+#include <bft_printf.h>
+
+/*----------------------------------------------------------------------------
+ * FVM library headers
+ *----------------------------------------------------------------------------*/
+
+#include <fvm_periodicity.h>
+
+/*----------------------------------------------------------------------------
+ * Local headers
+ *----------------------------------------------------------------------------*/
+
+#include "cs_base.h"
+#include "cs_halo.h"
+#include "cs_mesh.h"
+
+/*----------------------------------------------------------------------------
+ * Header for the current file
+ *----------------------------------------------------------------------------*/
+
+#include "cs_lagr_perio.h"
+
+/*----------------------------------------------------------------------------*/
+
+BEGIN_C_DECLS
+
+/*============================================================================
+ * Public functions definition for API Fortran
+ *============================================================================*/
+
+/*----------------------------------------------------------------------------
+ * Build buffers to keep the link between a given halo cell and :
+ * - the related real cell
+ * - the transformation id
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE PERLOC
+ * *****************
+ *
+ * INTEGER ICELCR(NCELET-NCEL) : <- : related real cell buffer
+ * INTEGER IPERCR(NCELET-NCEL) : <- : transformation id buffer
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (perloc, PERLOC)(cs_int_t *icelcr,
+ cs_int_t *ipercr)
+{
+ cs_int_t i, rank_id, shift, t_id;
+ cs_int_t start_std, end_std, length, start_ext, end_ext;
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ cs_halo_t *halo = mesh->halo;
+
+ const cs_int_t n_transforms = mesh->n_transforms;
+ const cs_int_t local_rank = (cs_glob_rank_id == -1) ? 0:cs_glob_rank_id;
+
+ if (mesh->halo_type == CS_HALO_N_TYPES)
+ return;
+
+ assert(halo != NULL);
+
+ for (t_id = 0; t_id < n_transforms; t_id++) {
+
+ shift = 4 * halo->n_c_domains * t_id;
+
+ for (rank_id = 0; rank_id < halo->n_c_domains; rank_id++) {
+
+ if ( mesh->n_domains == 1
+ || halo->c_domain_rank[rank_id] == local_rank) {
+
+ start_std = halo->perio_lst[shift + 4*rank_id];
+ length = halo->perio_lst[shift + 4*rank_id + 1];
+ end_std = start_std + length;
+
+ for (i = start_std; i < end_std; i++) {
+
+ icelcr[i] = halo->send_list[i] + 1;
+ ipercr[i] = t_id;
+
+ } /* End of loop on standard ghost cells */
+
+ if (mesh->halo_type == CS_HALO_EXTENDED) {
+
+ start_ext = halo->perio_lst[shift + 4*rank_id + 2];
+ length = halo->perio_lst[shift + 4*rank_id + 3];
+ end_ext = start_ext + length;
+
+ for (i = start_ext; i < end_ext; i++) {
+
+ icelcr[i] = halo->send_list[i] + 1;
+ ipercr[i] = t_id;
+
+ }
+
+ } /* If an extended halo exists */
+
+ } /* If on local rank */
+
+ } /* End of loop on ranks */
+
+ } /* End of loop on transformations */
+
+}
+
+/*----------------------------------------------------------------------------
+ * Apply transformation to the location of a particle.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE LAGPER
+ * *****************
+ *
+ * INTEGER ITRANS : -> : transformation id buffer
+ * DOUBLE PRECISION VTX_A : -> : location of vertex before transform.
+ * DOUBLE PRECISION VTX_B : <- : location of the vertex after transform.
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (lagper, LAGPER)(const cs_int_t *itrans,
+ const cs_real_t vtx_a[],
+ cs_real_t vtx_b[])
+{
+ cs_int_t i, j, rev_id;
+
+ cs_real_t vect[4];
+ cs_real_t matrix[3][4];
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ fvm_periodicity_t *periodicity = mesh->periodicity;
+
+ /* Get the matrix for this transformation */
+
+ rev_id = fvm_periodicity_get_reverse_id(mesh->periodicity, *itrans);
+ fvm_periodicity_get_matrix(periodicity, rev_id, matrix);
+
+ /* Initialize vectors */
+
+ for (i = 0; i < 3; i++) {
+ vtx_b[i] = 0.;
+ vect[i] = vtx_a[i];
+ }
+ vect[3] = 1;
+
+ /* Compute transformation */
+
+ for (i = 0; i < 3; i++)
+ for (j = 0; j < 4; j++)
+ vtx_b[i] += matrix[i][j]*vect[j];
+
+}
+
+
+/*----------------------------------------------------------------------------
+ * Apply rotation on the velocity vector of a particle.
+ *
+ * Fortran Interface :
+ *
+ * SUBROUTINE LAGVEC
+ * *****************
+ *
+ * INTEGER ITRANS : -> : transformation id
+ * DOUBLE PRECISION VECTI : -> : vector before transformation
+ * DOUBLE PRECISION VECTF : <- : vector after transformation
+ *
+ * Returns:
+ *----------------------------------------------------------------------------*/
+
+void
+CS_PROCF (lagvec, LAGVEC)(const cs_int_t *itrans,
+ const cs_real_t vecti[],
+ cs_real_t vectf[])
+{
+ cs_int_t i, j, rev_id;
+
+ cs_real_t matrix[3][4];
+
+ cs_mesh_t *mesh = cs_glob_mesh;
+ fvm_periodicity_t *periodicity = mesh->periodicity;
+
+ /* test if the transformation is a rotation */
+
+ if (FVM_PERIODICITY_ROTATION ==
+ fvm_periodicity_get_type(periodicity, *itrans)) {
+
+ /* Get the matrix for this transformation */
+
+ rev_id = fvm_periodicity_get_reverse_id(mesh->periodicity, *itrans);
+ fvm_periodicity_get_matrix(periodicity, rev_id, matrix);
+
+ for (i = 0; i < 3; i++) {
+ vectf[i] = 0;
+ for (j = 0; j < 3; j++)
+ vectf[i] += matrix[i][j]*vecti[j];
+ }
+
+ } /* If the periodicity is a rotation */
+
+ else {
+
+ /* There is no rotation. Copy the input vector */
+
+ for (i = 0; i < 3; i++)
+ vectf[i] = vecti[i];
+
+ }
+
+}
+
+/*----------------------------------------------------------------------------*/
+
+END_C_DECLS
diff --git a/src/lagr/diverv.f90 b/src/lagr/diverv.f90
new file mode 100644
index 0000000..64ce9ac
--- /dev/null
+++ b/src/lagr/diverv.f90
@@ -0,0 +1,326 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine diverv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , &
+ div , ux , vy , wz , &
+ coefax , coefay , coefaz , &
+ coefbx , coefby , coefbz , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! CALCUL DE LA DIVERGENCE D'UN VECTEUR
+
+! (On ne s'embete pas, on appelle 3 fois le gradient)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! div(ncelet) ! tr ! --> ! divergence du vecteur !
+! ux,uy,uz ! tr ! --> ! composante du vecteur !
+! (ncelet) ! ! ! !
+! coefax,... ! tr ! -> ! conditions aux limites pour les !
+! coefbz ! ! ! faces de bord !
+! (nfabor) ! ! ! !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet)
+double precision div(ncelet)
+double precision ux(ncelet) , vy(ncelet) , wz(ncelet)
+double precision coefax(nfabor) , coefay(nfabor) , coefaz(nfabor)
+double precision coefbx(nfabor) , coefby(nfabor) , coefbz(nfabor)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision w4(ncelet) , w5(ncelet) , w6(ncelet)
+double precision w7(ncelet) , w8(ncelet) , w9(ncelet)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivar0
+integer iphydp,idimte,itenso
+integer iel
+integer inc, iccocg
+integer nswrgp, imligp, iwarnp
+double precision epsrgp, climgp, extrap
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+if(irangp.ge.0) then
+ call parcom(ux)
+ !==========
+ call parcom(vy)
+ !==========
+ call parcom(wz)
+ !==========
+endif
+
+! Periodique
+if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+( idimte , itenso , &
+ ux , ux , ux , &
+ vy , vy , vy , &
+ wz , wz , wz )
+endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+
+! Sans prise en compte de la pression hydrostatique
+
+iphydp = 0
+
+inc = 1
+iccocg = 1
+nswrgp = 100
+imligp = -1
+iwarnp = 2
+epsrgp = 1.d-8
+climgp = 1.5d0
+extrap = 0.d0
+
+!===============================================================================
+! 1. Calcul du gradient de UX DANS W1
+!===============================================================================
+
+call grdcel &
+!==========
+( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ux , ux , ux , &
+ ux , coefax , coefbx , &
+ w1 , w4 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 2. Calcul du gradient de VY DANS W2
+!===============================================================================
+
+call grdcel &
+!==========
+( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ vy , vy , vy , &
+ vy , coefay , coefby , &
+ w4 , w2 , w5 , &
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 3. Calcul du gradient de VZ DANS W3
+!===============================================================================
+
+call grdcel &
+!==========
+( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ wz , wz , wz , &
+ wz , coefaz , coefbz , &
+ w5 , w6 , w3 , &
+ w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 4. Calcul de la divergence du vecteur (UX,VY,WZ)
+!===============================================================================
+
+do iel = 1,ncel
+ div(iel) = w1(iel) + w2(iel) + w3(iel)
+enddo
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/enslag.f90 b/src/lagr/enslag.f90
new file mode 100644
index 0000000..8f41af0
--- /dev/null
+++ b/src/lagr/enslag.f90
@@ -0,0 +1,877 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine enslag &
+!================
+
+ ( idbia0 , idbra0 , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , iforce , &
+ itepa , &
+ ettp , tepa , ra)
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SAUVEGARDE DES TRAJECTOIRES AU FORMAT ENSIGHT GOLD
+
+! 1. AU PREMIER PASSAGE : OUVERTURE D'UN FICHIER
+! SCRATCH ET DEBUT D'ECRITURE SEQUENTIELLE
+
+! 2. A CHAQUE PASSAGE : ECRITURE DANS LE TEMPORAIRE
+
+! 3. AU DERNIER PASSAGE : ECRITURE SUR LE FICHIER FINAL
+! AU BON FORMAT POUR ENSIGHT
+
+! REMARQUE : on dispose de 15 fichiers de sortie,
+! les unites logiques sont defini dans INIINI.F
+! et on y accede par IMPLA5(1) a IMPLA5(15)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! nfin ! e ! <-- ! nfin = 1 si dernier pas de temps !
+! ! ! ! nfin = 0 sinon !
+! iforce ! e ! <-- ! force l'ecriture si = numero de la !
+! ! ! ! particule courante !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules !
+! ! ! ! etape courante ou precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!==============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer nfin , iforce
+integer itepa(nbpmax,nivep)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer nl , np
+
+integer numl
+integer nume(nliste)
+integer ii1 , ii2 , lpos , nlmax , ios
+integer npt , ipt , lmax
+integer ix,iy,iz,ii
+integer iu1l , iv1l , iw1l
+integer iu2l , iv2l , iw2l
+integer itpl , idml , itel , impl
+integer ihpl , idckl , imchl , imckl
+integer ifinia, ifinra
+
+double precision xpl , ypl , zpl
+double precision u1l , v1l , w1l
+double precision u2l , v2l , w2l
+double precision tpl , dml , tel , mpl
+double precision hpl , dckl , mchl , mckl
+character fich*80
+character name*80
+
+integer ipass
+data ipass /0/
+save ipass
+
+!==============================================================================
+
+!===============================================================================
+! -1. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+!--> Compteur de passages
+
+ipass = ipass+1
+
+nlmax = 0
+
+!===============================================================================
+! 1. OUVERTURE DU FICHIER TAMPON AU PREMIER PASSAGE
+!===============================================================================
+
+if (ipass.eq.1) then
+
+ OPEN (IMPLA3,FILE='SCRATCH3.lag', &
+ STATUS='UNKNOWN',FORM='UNFORMATTED', &
+ ACCESS='SEQUENTIAL')
+
+ do nl = 1,nbvis
+ nplist(nl) = 0
+ list0(nl) = liste(nl)
+ enddo
+
+endif
+
+!===============================================================================
+! 2. ECRITURE SEQUENTIELLE DES INFOS TRAJECTOIRES
+! POUR CHAQUE PARTICULE A VISUALISER SUIVANT LA FREQUENCE
+!===============================================================================
+
+if ((mod(ipass-1,nvisla).eq.0 .or. iforce.gt.0) &
+ .and. nfin.eq.0) then
+
+
+ do nl = 1,nbvis
+
+ np = liste(nl)
+
+ if ( (np.ge.1 .and. iforce.eq.0 ) .or. &
+ (iforce.eq.np) ) then
+
+! sortie du domaine ?
+ if (itepa(np,jisor).gt.0) then
+
+!--->incrementation du nombre d'enregistrement pour la particule NP :
+ nplist(nl) = nplist(nl)+1
+
+ if (nplist(nl).gt.nlmax) nlmax = nplist(nl)
+
+!--->numero de liste :
+ write(impla3) nl
+
+!--->coordonnees de la particule NP :
+ write(impla3) ettp(np,jxp), ettp(np,jyp), ettp(np,jzp)
+
+!--->vitesse du fluide vu :
+ if (ivisv1.eq.1) then
+ write(impla3) ettp(np,juf), ettp(np,jvf), ettp(np,jwf)
+ endif
+
+!--->vitesse de la particule :
+ if (ivisv2.eq.1) then
+ write(impla3) ettp(np,jup), ettp(np,jvp), ettp(np,jwp)
+ endif
+
+!--->temps de sejour :
+ if (ivistp.eq.1) then
+ write(impla3) tepa(np,jrtsp)
+ endif
+
+!--->diametre :
+ if (ivisdm.eq.1) then
+ write(impla3) ettp(np,jdp)
+ endif
+
+!--->masse :
+ if (ivismp.eq.1) then
+ write(impla3) ettp(np,jmp)
+ endif
+
+!--->temperature :
+ if (iviste.eq.1) then
+ write(impla3) ettp(np,jtp)
+ endif
+
+!--->Specifique charbon :
+! Temperature
+ if (ivishp.eq.1) then
+ write(impla3) ettp(np,jhp)
+ endif
+! Diametre du coeur retrecisant
+ if (ivisdk.eq.1) then
+ write(impla3) tepa(np,jrdck)
+ endif
+! Masse charbon reactif
+ if (ivisch.eq.1) then
+ write(impla3) ettp(np,jmch)
+ endif
+! Masse de coke
+ if (ivisck.eq.1) then
+ write(impla3) ettp(np,jmck)
+ endif
+
+ endif
+
+ endif
+
+ enddo
+
+
+endif
+
+!===============================================================================
+! 3.1 FIN DU CALCUL (NFIN=1) : OUVERTURE DES FICHIERS RESU
+!===============================================================================
+
+if (nfin.eq.1) then
+
+ NAME = ' '
+ NAME = 'trajectoire'
+
+! 0) ouverture du fichier .ensight.CASE :
+
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+14) = '.ensight.CASE'
+ ii2 = ii2 + 14
+ open ( unit=impla2, file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla2,err=99 )
+
+ rewind(impla2)
+ write(impla2,5010)
+ write(impla2,5011)
+ write(impla2,5012)
+
+! 1) ouverture du fichier .ensight.geom + entete fichier case(suite)
+
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+13) = '.ensight.geom'
+ ii2 = ii2 + 13
+
+ write(impla2,5013) fich (ii1:ii2)
+ write(impla2,5014)
+
+ open ( unit=impla1, file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+
+ rewind ( unit=impla1,err=99 )
+
+! 2) ouverture du fichier .vitflu + entete fichier case(suite)
+
+ if (ivisv1.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.vitflu'
+ ii2 = ii2 + 7
+ open ( unit=impla5(1), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(1),err=99 )
+
+ write(impla2,5015) fich (ii1:ii2)
+
+ endif
+
+! 3) ouverture du fichier .vitpar + entete fichier case(suite)
+
+ if (ivisv2.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.vitpar'
+ ii2 = ii2 + 7
+ open ( unit=impla5(2), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(2),err=99 )
+
+ write(impla2,5016) fich (ii1:ii2)
+
+ endif
+
+! 4) ouverture du fichier .tpssej + entete fichier case(suite)
+
+ if (ivistp.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.tpssej'
+ ii2 = ii2 + 7
+ open ( unit=impla5(3), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(3),err=99 )
+
+ write(impla2,5017) fich (ii1:ii2)
+
+ endif
+
+! 5) ouverture du fichier .diamet + entete fichier case(suite)
+
+ if (ivisdm.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.diamet'
+ ii2 = ii2 + 7
+ open ( unit=impla5(4), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(4),err=99 )
+
+ write(impla2,5018) fich (ii1:ii2)
+
+ endif
+
+! 6) ouverture du fichier .masse + entete fichier case(suite)
+
+ if (ivismp.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.masse'
+ ii2 = ii2 + 7
+ open ( unit=impla5(5), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(5),err=99 )
+
+ write(impla2,5019) fich (ii1:ii2)
+
+ endif
+
+! 7) ouverture du fichier .temper + entete fichier case(suite)
+
+ if (iviste.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.temper'
+ ii2 = ii2 + 7
+ open ( unit=impla5(6), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(6),err=99 )
+
+ write(impla2,5020) fich (ii1:ii2)
+
+ endif
+
+! 8) ouverture du fichier .tempch + entete fichier case(suite)
+
+ if (ivishp.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.tempch'
+ ii2 = ii2 + 7
+ open ( unit=impla5(7), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(7),err=99 )
+
+ write(impla2,5021) fich (ii1:ii2)
+
+ endif
+
+! 9) ouverture du fichier .dck + entete fichier case(suite)
+
+ if (ivisdk.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.dck'
+ ii2 = ii2 + 7
+ open ( unit=impla5(8), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(8),err=99 )
+
+ write(impla2,5022) fich (ii1:ii2)
+
+ endif
+
+! 10) ouverture du fichier .mch + entete fichier case(suite)
+
+ if (ivisch.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.mch'
+ ii2 = ii2 + 7
+ open ( unit=impla5(9), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(9),err=99 )
+
+ write(impla2,5023) fich (ii1:ii2)
+
+ endif
+
+! 11) ouverture du fichier .mch + entete fichier case(suite)
+
+ if (ivisck.eq.1) then
+ fich = name
+ call verlon ( fich, ii1, ii2, lpos )
+ FICH(II2+1:II2+7) = '.mck'
+ ii2 = ii2 + 7
+ open ( unit=impla5(10), file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL', IOSTAT=IOS, ERR=99 )
+ rewind ( unit=impla5(10),err=99 )
+
+ write(impla2,5024) fich (ii1:ii2)
+
+ endif
+
+!===============================================================================
+! 3.2 FIN DU CALCUL (NFIN=1): ECRITURE SUR FICHIERS FINAUX
+! ET FERMETURE DU TEMPORAIRE
+! OU SAUVEGARDE INTERMEDIAIRE
+!===============================================================================
+
+! 1) ON COMPTE LE NOMBRE TOTAL D'ENREGISTREMENTS
+
+ npt = 0
+ nlmax = 0
+ lmax = 0
+ do nl = 1,nbvis
+ npt = npt + nplist(nl)
+ lmax = max(lmax,nplist(nl))
+ if (nplist(nl).gt.nlmax) nlmax = nplist(nl)
+ nume(nl) = 0
+ enddo
+
+! 2) Allocation Memoire
+
+ ifinia = idebia
+ ix = idebra
+ iy = ix+lmax
+ iz = iy+lmax
+ ifinra = iz +lmax
+
+ if (ivisv1.eq.1) then
+ iu1l = ifinra
+ iv1l = iu1l +lmax
+ iw1l = iv1l +lmax
+ ifinra = iw1l +lmax
+ endif
+ if (ivisv2.eq.1) then
+ iu2l = ifinra
+ iv2l = iu2l +lmax
+ iw2l = iv2l +lmax
+ ifinra = iw2l +lmax
+ endif
+ if (ivistp.eq.1) then
+ itpl = ifinra
+ ifinra = itpl +lmax
+ endif
+ if (ivisdm.eq.1) then
+ idml = ifinra
+ ifinra = idml +lmax
+ endif
+ if (ivismp.eq.1) then
+ impl = ifinra
+ ifinra = impl +lmax
+ endif
+ if (iviste.eq.1) then
+ itel = ifinra
+ ifinra = itel +lmax
+ endif
+ if (ivishp.eq.1) then
+ ihpl = ifinra
+ ifinra = ihpl +lmax
+ endif
+ if (ivisdk.eq.1) then
+ idckl= ifinra
+ ifinra = idckl +lmax
+ endif
+ if (ivisch.eq.1) then
+ imchl = ifinra
+ ifinra = imchl +lmax
+ endif
+ if (ivisck.eq.1) then
+ imckl = ifinra
+ ifinra = imckl +lmax
+ endif
+
+ CALL RASIZE('ENSLAG',IFINRA)
+ !==========
+
+! 3) ON REMPLIT LES ENTETES DES FICHIERS : geo + variable
+
+ rewind(impla1)
+
+ write(impla1,3000)
+ write(impla1,3001)
+ write(impla1,3002)
+ write(impla1,3003)
+
+ if (ivisv1.eq.1) then
+ rewind(impla5(1))
+ write(impla5(1),4000)
+ endif
+
+ if (ivisv2.eq.1) then
+ rewind(impla5(2))
+ write(impla5(2),4001)
+ endif
+
+ if (ivistp.eq.1) then
+ rewind(impla5(3))
+ write(impla5(3),4002)
+ endif
+
+ if (ivisdm.eq.1) then
+ rewind(impla5(4))
+ write(impla5(4),4003)
+ endif
+
+ if (ivismp.eq.1) then
+ rewind(impla5(5))
+ write(impla5(5),4004)
+ endif
+
+ if (iviste.eq.1) then
+ rewind(impla5(6))
+ write(impla5(6),4005)
+ endif
+
+ if (ivishp.eq.1) then
+ rewind(impla5(7))
+ write(impla5(7),4006)
+ endif
+
+ if (ivisdk.eq.1) then
+ rewind(impla5(8))
+ write(impla5(8),4007)
+ endif
+
+ if (ivisch.eq.1) then
+ rewind(impla5(9))
+ write(impla5(9),4008)
+ endif
+
+ if (ivisck.eq.1) then
+ rewind(impla5(10))
+ write(impla5(10),4009)
+ endif
+
+ do nl = 1,nbvis
+
+ np = liste(nl)
+
+ if (itepa(np,jisor).gt.0) then
+
+ rewind(impla3)
+
+ ipt = 0
+ do ii=1,npt
+
+ read(impla3) numl
+ read(impla3) xpl,ypl,zpl
+ if (ivisv1.eq.1) read(impla3) u1l,v1l,w1l
+ if (ivisv2.eq.1) read(impla3) u2l,v2l,w2l
+ if (ivistp.eq.1) read(impla3) tpl
+ if (ivisdm.eq.1) read(impla3) dml
+ if (ivismp.eq.1) read(impla3) mpl
+ if (iviste.eq.1) read(impla3) tel
+ if (ivishp.eq.1) read(impla3) hpl
+ if (ivisdk.eq.1) read(impla3) dckl
+ if (ivisch.eq.1) read(impla3) mchl
+ if (ivisck.eq.1) read(impla3) mckl
+
+ if (numl .eq. nl ) then
+
+ ipt = ipt+1
+
+ ra(ix+ipt-1) = xpl
+ ra(iy+ipt-1) = ypl
+ ra(iz+ipt-1) = zpl
+ if (ivisv1.eq.1) then
+ ra(iu1l+ipt-1) = u1l
+ ra(iv1l+ipt-1) = v1l
+ ra(iw1l+ipt-1) = w1l
+ endif
+ if (ivisv2.eq.1) then
+ ra(iu2l+ipt-1) = u2l
+ ra(iv2l+ipt-1) = v2l
+ ra(iw2l+ipt-1) = w2l
+ endif
+ if (ivistp.eq.1) then
+ ra(itpl+ipt-1) = tpl
+ endif
+ if (ivisdm.eq.1) then
+ ra(idml+ipt-1) = dml
+ endif
+ if (ivismp.eq.1) then
+ ra(impl+ipt-1) = mpl
+ endif
+ if (iviste.eq.1) then
+ ra(itel+ipt-1) = tel
+ endif
+ if (ivishp.eq.1) then
+ ra(ihpl+ipt-1) = hpl
+ endif
+ if (ivisdk.eq.1) then
+ ra(idckl+ipt-1) = dckl
+ endif
+ if (ivisch.eq.1) then
+ ra(imchl+ipt-1) = mchl
+ endif
+ if (ivisck.eq.1) then
+ ra(imckl+ipt-1) = mckl
+ endif
+
+ endif
+ enddo
+
+! Ecriture Fichier Geometrie
+
+ write(impla1,3010)
+ write(impla1,1010) nl
+ write(impla1,3004) list0(nl)
+ write(impla1,3005)
+ write(impla1,1010) ipt
+ do ii=1,ipt
+ write(impla1,1030) ra(ix+ii-1)
+ enddo
+ do ii=1,ipt
+ write(impla1,1030) ra(iy+ii-1)
+ enddo
+ do ii=1,ipt
+ write(impla1,1030) ra(iz+ii-1)
+ enddo
+ write(impla1,3006)
+ write(impla1,1010) ipt-1
+ do ii=1,ipt-1
+ write(impla1,1020) ii,ii+1
+ enddo
+
+! Ecriture Fichiers Variables
+
+ if (ivisv1.eq.1) then
+
+ write(impla5(1),3010)
+ write(impla5(1),1010) nl
+ write(impla5(1),3005)
+ do ii=1,ipt
+ write(impla5(1),1030) ra(iu1l+ii-1)
+ enddo
+ do ii=1,ipt
+ write(impla5(1),1030) ra(iv1l+ii-1)
+ enddo
+ do ii=1,ipt
+ write(impla5(1),1030) ra(iw1l+ii-1)
+ enddo
+ endif
+
+ if (ivisv2.eq.1) then
+ write(impla5(2),3010)
+ write(impla5(2),1010) nl
+ write(impla5(2),3005)
+ do ii=1,ipt
+ write(impla5(2),1030) ra(iu2l+ii-1)
+ enddo
+ do ii=1,ipt
+ write(impla5(2),1030) ra(iv2l+ii-1)
+ enddo
+ do ii=1,ipt
+ write(impla5(2),1030) ra(iw2l+ii-1)
+ enddo
+ endif
+
+ if (ivistp.eq.1) then
+ write(impla5(3),3010)
+ write(impla5(3),1010) nl
+ write(impla5(3),3005)
+ do ii=1,ipt
+ write(impla5(3),1030) ra(itpl+ii-1)
+ enddo
+ endif
+ if (ivisdm.eq.1) then
+ write(impla5(4),3010)
+ write(impla5(4),1010) nl
+ write(impla5(4),3005)
+ do ii=1,ipt
+ write(impla5(4) ,1030) ra(idml+ii-1)
+ enddo
+ endif
+ if (ivismp.eq.1) then
+ write(impla5(5),3010)
+ write(impla5(5),1010) nl
+ write(impla5(5),3005)
+ do ii=1,ipt
+ write(impla5(5),1030) ra(impl+ii-1)
+ enddo
+ endif
+ if (iviste.eq.1) then
+ write(impla5(6),3010)
+ write(impla5(6),1010) nl
+ write(impla5(6),3005)
+ do ii=1,ipt
+ write(impla5(6),1030) ra(itel+ii-1)
+ enddo
+ endif
+ if (ivishp.eq.1) then
+ write(impla5(7),3010)
+ write(impla5(7),1010) nl
+ write(impla5(7),3005)
+ do ii=1,ipt
+ write(impla5(7),1030) ra(ihpl+ii-1)
+ enddo
+ endif
+ if (ivisdk.eq.1) then
+ write(impla5(8),3010)
+ write(impla5(8),1010) nl
+ write(impla5(8),3005)
+ do ii=1,ipt
+ write(impla5(8),1030) ra(idckl+ii-1)
+ enddo
+ endif
+ if (ivisch.eq.1) then
+ write(impla5(9),3010)
+ write(impla5(9),1010) nl
+ write(impla5(9),3005)
+ do ii=1,ipt
+ write(impla5(9),1030) ra(imchl+ii-1)
+ enddo
+ endif
+ if (ivisck.eq.1) then
+ write(impla5(10),3010)
+ write(impla5(10),1010) nl
+ write(impla5(10),3005)
+ do ii=1,ipt
+ write(impla5(10),1030) ra(imckl+ii-1)
+ enddo
+ endif
+
+ endif
+
+ enddo
+
+ close(impla1)
+ close(impla2)
+ close(impla3)
+ if (ivisv1.eq.1) close(impla5(1))
+ if (ivisv2.eq.1) close(impla5(2))
+ if (ivistp.eq.1) close(impla5(3))
+ if (ivisdm.eq.1) close(impla5(4))
+ if (ivismp.eq.1) close(impla5(5))
+ if (iviste.eq.1) close(impla5(6))
+ if (ivishp.eq.1) close(impla5(7))
+ if (ivisdk.eq.1) close(impla5(8))
+ if (ivisch.eq.1) close(impla5(9))
+ if (ivisck.eq.1) close(impla5(10))
+
+endif
+
+
+return
+
+ 99 continue
+write (nfecra,9999) fich (ii1:ii2), ios
+call csexit(1)
+
+!--------
+! FORMATS
+!--------
+
+ 1010 format (i10)
+ 1020 format (i10,i10)
+ 1030 format (e12.5)
+
+ 3000 format('geometrie trajectoire')
+ 3001 format('au format ensight6 : .case')
+ 3002 format('node id assign')
+ 3003 format('element id assign')
+ 3004 format('trajectoire',I10)
+ 3005 format('coordinates')
+ 3006 format('bar2')
+
+ 3010 format('part')
+
+ 4000 format('vitesse fluide vu')
+ 4001 format('vitesse particules')
+ 4002 format('temps de sejour')
+ 4003 format('diametre')
+ 4004 format('masse')
+ 4005 format('temerature')
+ 4006 format('temperature')
+ 4007 format('dck')
+ 4008 format('mch')
+ 4009 format('mck')
+
+ 5010 format('FORMAT')
+ 5011 format('type: ensight gold')
+ 5012 format('GEOMETRY')
+ 5013 format('model: ',A)
+ 5014 format('VARIABLE')
+ 5015 format('vector per node: vitesse_fluide_vu ',A )
+ 5016 format('vector per node: vitesse_particules ',A )
+ 5017 format('scalar per node: temps_de_sejour ',A )
+ 5018 format('scalar per node: diametre ',A )
+ 5019 format('scalar per node: masse ',A )
+ 5020 format('scalar per node: temperature ',A )
+ 5021 format('scalar per node: temperature ',A )
+ 5022 format('scalar per node: dck ',A )
+ 5023 format('scalar per node: mch ',A )
+ 5024 format('scalar per node: mck ',A )
+
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ERREUR D''OUVERTURE SUR LE FICHIER : ',A ,/,&
+'@ AVEC UN IOSTAT EGAL A : ',I6 ,/,&
+'@ (ENSLAG) ',/,&
+'@ ',/,&
+'@ Verifier les numero de fichiers utilises par le Lagrangien',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/enswaf.f90 b/src/lagr/enswaf.f90
new file mode 100644
index 0000000..575ede0
--- /dev/null
+++ b/src/lagr/enswaf.f90
@@ -0,0 +1,812 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine enswaf &
+!================
+
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , &
+ itepa , &
+ ettp , tepa , trav )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Ecriture des fichiers pour Ensight7 au format CASE pour la
+! visualisation des deplacements des particules et de variables
+! associees.
+
+! La visualisation des deplacement et le choix des variables
+! associees est realise dans le sous-programme USLAG1.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! nfin ! e ! <-- ! nfin = 1 si dernier pas de temps !
+! ! ! ! nfin = 0 sinon !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules !
+! ! ! ! etape courante ou precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! trav(nbpmax,3 ! tr ! --- ! tableaux de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!==============================================================================
+
+! Arguments
+
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer nfin
+integer itepa(nbpmax,nivep)
+
+double precision ettp(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision trav(nbpmax,3)
+
+! VARIABLES LOCALES
+
+integer npt , ipt
+integer np , nl
+integer ii1 , ii2 , lpos , n1 , n2
+
+character fich*80 , name*80 , entet*80
+
+integer ipwaf
+data ipwaf /0/
+save ipwaf
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+!===============================================================================
+! 1. Initialisations
+!===============================================================================
+
+if (nfin.eq.0) ipwaf = ipwaf + 1
+
+if (ipwaf.eq.1) itlag = 0
+
+FICH = ' '
+FICH = 'deplacement'
+call verlon (fich,ii1,ii2,lpos)
+entet = fich(ii1:ii2)
+
+!===============================================================================
+! 2. ENREGISTREMENTS des deplacement.geom====
+!===============================================================================
+
+!-->Faut-il enregistrer ?
+
+if ( (mod(ipwaf-1,nvisla).eq.0 .and. nfin.eq.0) .or. &
+ (nfin.eq.1 .and. mod(ipwaf-1,nvisla).ne.0) ) then
+
+!-->Nombre de particules a visualisees encore presentent dans le domaine
+
+ npt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) npt = npt + 1
+ enddo
+
+!-->Y a t-il encore des particules a visualiser ?
+
+ if (npt.eq.0) goto 100
+
+!-->Nombre d'enregistrements et incrementation du temps physique
+
+ if (itlag.le.9999) then
+ itlag = itlag + 1
+ timlag(itlag) = ttclag
+ else
+ write(nfecra,9000) itlag
+ goto 100
+ endif
+
+!-->Ouverture des fichiers type deplacement.geo0001
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+4) = '.geo'
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ ii2 = ii2 + 5
+ fich(ii2:ii2+lpos) = name(n1:n2)
+
+ ii2 = ii2 + lpos
+ open ( impla1, file=fich(ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture de l'entete
+
+ WRITE(IMPLA1,'(A)') 'geometrie deplacement'
+ WRITE(IMPLA1,'(A)') 'au format ensight6'
+ WRITE(IMPLA1,'(A)') 'node id given'
+ WRITE(IMPLA1,'(A)') 'element id given'
+ WRITE(IMPLA1,'(A)') 'coordinates'
+ WRITE(IMPLA1,'(I8)') NPT
+
+!-->Ecriture des points
+
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ WRITE(IMPLA1,'(I8,3E12.5)') NP, &
+ ettp(np,jxp), &
+ ettp(np,jyp), &
+ ettp(np,jzp)
+ endif
+ enddo
+
+!-->Ecriture de la geometrie Ensight
+
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'deplacements'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(I8)') NPT
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ WRITE(IMPLA1,'(2I8)') IPT , NP
+ endif
+ enddo
+ close(impla1)
+
+else
+
+ if (nfin.eq.0) return
+ goto 100
+
+endif
+
+!===============================================================================
+! 3. Ecriture de deplacement.tpssej0001
+!===============================================================================
+
+if (ivistp.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = tepa(np,jrtsp)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.tpssej'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 4. Ecriture de deplacement.temper0001
+!===============================================================================
+
+if (iviste.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,jtp)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.temper'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 5. Ecriture de deplacement.diamet0001
+!===============================================================================
+
+if (ivisdm.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,jdp)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.diamet'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 6. Ecriture de deplacement.massep0001
+!===============================================================================
+
+if (ivismp.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,jmp)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.massep'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 7. Charbon : Ecriture de deplacement.temp_ch0001
+!===============================================================================
+
+if (ivishp.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,jhp)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.tempch'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 8. Charbon : Ecriture de deplacement.dck0001
+!===============================================================================
+
+if (ivisdk.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = tepa(np,jrdck)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+4) = '.dck'
+ ii2 = ii2 + 4
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 9. Charbon : Ecriture de deplacement.mch0001
+!===============================================================================
+
+if (ivisch.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,jmch)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+4) = '.mch'
+ ii2 = ii2 + 4
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 10. Charbon : Ecriture de deplacement.mck0001
+!===============================================================================
+
+if (ivisck.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,jmck)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.mck'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( REAL(TRAV(NP,1)), NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 11. Ecriture de deplacement.vitflu0001
+!===============================================================================
+
+if (ivisv1.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,juf)
+ trav(ipt,2) = ettp(np,jvf)
+ trav(ipt,3) = ettp(np,jwf)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.vitflu'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( (REAL(TRAV(NP,NL)),NL=1,3),NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 12. Ecriture de deplacement.vitpar0001
+!===============================================================================
+
+if (ivisv2.eq.1) then
+
+ ipt = 0
+ do nl = 1,nbvis
+ np = liste(nl)
+ if (np.ge.1 .and. itepa(np,jisor).ne.0) then
+ ipt = ipt + 1
+ trav(ipt,1) = ettp(np,jup)
+ trav(ipt,2) = ettp(np,jvp)
+ trav(ipt,3) = ettp(np,jwp)
+ endif
+ enddo
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+7) = '.vitpar'
+ ii2 = ii2 + 7
+ WRITE (NAME,'(I4.4)') ITLAG
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+
+ open ( impla1, file=fich(ii1:ii2+lpos), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+
+!-->Ecriture
+
+ WRITE(IMPLA1,'(A)') FICH(II1:II2+LPOS)
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A)') 'point'
+ WRITE(IMPLA1,'(6E12.5)') ( (REAL(TRAV(NP,NL)),NL=1,3),NP=1,NPT )
+ close(impla1)
+
+endif
+
+!===============================================================================
+! 13. Ecriture du deplacement.case au dernier passage
+!===============================================================================
+
+ 100 continue
+
+if (nfin.eq.1) then
+
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ NAME = ' '
+ NAME = '.CASE'
+ call verlon (name,n1,n2,lpos)
+ fich(ii2+1:ii2+lpos) = name(n1:n2)
+ ii2 = ii2 + lpos
+ open ( unit=impla1, file=fich (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', ACCESS='SEQUENTIAL' )
+ rewind ( unit=impla1 )
+
+ WRITE(IMPLA1,'(A)') 'FORMAT'
+ WRITE(IMPLA1,'(A)') 'type: ensight'
+ WRITE(IMPLA1,'(A)') 'GEOMETRY'
+ FICH = ' '
+ fich = entet
+ call verlon (fich,ii1,ii2,lpos)
+ FICH(II2+1:II2+8) = '.geo===='
+ call verlon (fich,ii1,ii2,lpos)
+ NAME = ' '
+ NAME = 'model: 1 '
+ name(29:29+ii2-ii1+1) = fich(ii1:ii2)
+ call verlon (name,ii1,ii2,lpos)
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+
+ WRITE(IMPLA1,'(A)') 'VARIABLE'
+ FICH = ' '
+ fich = entet
+ call verlon (fich,n1,n2,lpos)
+
+! Rem : les trois lignes suivantes sont pour eviter une erreur
+! de lecture fichier .CASE lors de sa lecture par ensight
+! s'il n'y a aucune VARIABLE a voir.
+
+! NAME = 'constant per case : 1 constant 1.0'
+! CALL VERLON (NAME,II1,II2,LPOS)
+! WRITE(IMPLA1,'(A)') NAME(II1:II2)
+
+ if (ivistp.eq.1) then
+ NAME = 'scalar per node : 1 temps_de_sejour '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 2
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.tpssej===='
+ ii2 = ii2 + 11
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (iviste.eq.1) then
+ NAME = 'scalar per node : 1 temperature '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 6
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.temper===='
+ ii2 = ii2 + 11
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivisdm.eq.1) then
+ NAME = 'scalar per node : 1 diametre '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 9
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.diamet===='
+ ii2 = ii2 + 11
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivismp.eq.1) then
+ NAME = 'scalar per node : 1 masse '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 12
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.massep===='
+ ii2 = ii2 + 11
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivishp.eq.1) then
+ NAME = 'scalar per node : 1 tempch '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 11
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.tempch===='
+ ii2 = ii2 + 11
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivisdk.eq.1) then
+ NAME = 'scalar per node : 1 dck '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 14
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.dck===='
+ ii2 = ii2 + 8
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivisch.eq.1) then
+ NAME = 'scalar per node : 1 mch '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 14
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.mch===='
+ ii2 = ii2 + 8
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivisck.eq.1) then
+ NAME = 'scalar per node : 1 mck '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 14
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.mck===='
+ ii2 = ii2 + 8
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivisv1.eq.1) then
+ NAME = 'vector per node : 1 vitesse_fluide '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 3
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.vitflu===='
+ ii2 = ii2 + 11
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ if (ivisv2.eq.1) then
+ NAME = 'vector per node : 1 vitesse_partic '
+ call verlon (name,ii1,ii2,lpos)
+ ii2 = ii2 + 3
+ name(ii2+1:ii2+n2)=fich(n1:n2)
+ ii2 = ii2 + n2
+ call verlon (name,ii1,ii2,lpos)
+ NAME(II2+1:II2+11) = '.vitpar===='
+ ii2 = ii2 + 11
+ WRITE(IMPLA1,'(A)') NAME(II1:II2)
+ endif
+
+ WRITE(IMPLA1,'(A)') 'TIME'
+ WRITE(IMPLA1,'(A)') 'time set:'
+ FICH = ' '
+ FICH = 'number of steps:'
+ WRITE(NAME,'(I4)') ITLAG
+ call verlon(name,n1,n2,lpos)
+ !==========
+ fich(25+1:25+lpos) = name(n1:n2)
+ WRITE(IMPLA1,'(A)') FICH(1:25+LPOS)
+ WRITE(IMPLA1,'(A)') 'filename start number: 1'
+ WRITE(IMPLA1,'(A)') 'filename increment: 1'
+ WRITE(IMPLA1,'(A)') 'time values:'
+ WRITE(IMPLA1,'(6E12.5)') (TIMLAG(NL),NL=1,ITLAG)
+
+ close(impla1)
+
+endif
+
+return
+
+!-------
+! FORMAT
+!-------
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ LE NOMBRE D''ENREGISTREMENTS TEMPORELS DEMANDES POUR ',/,&
+'@ LE POST-PROCESSING EN MODE DEPLACEMENT DEPASSE ',/,&
+'@ LE MAXIMUM ADMISSIBLE. ',/,&
+'@ ',/,&
+'@ LE NOMBRE DE PAS DE TEMPS DEMANDE EST DE : ',I10 ,/,&
+'@ LE MAXIMUM ADMISSIBLE EST 9999 ',/,&
+'@ ',/,&
+'@ Le calcul continue, mais les enregistrements sont arretes.',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagaff.f90 b/src/lagr/lagaff.f90
new file mode 100644
index 0000000..8edec2b
--- /dev/null
+++ b/src/lagr/lagaff.f90
@@ -0,0 +1,458 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagaff &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , statis , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -----------------------------------
+
+! ECRITURE SUR FICHIERS DES INFORMATIONS SUR LE NOMBRE DE PARTICULES
+! - nombre de particules dans le domaine
+! - nombre de particules entrantes
+! - nombre de particules sorties
+
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa(nbpmax, ! tr ! <-- ! caracteristiques des particules !
+! nvep) ! ! ! aux particules (poids, ...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! statis(ncelet ! tr ! <-- ! cumul des statistiques volumiques !
+! nvlsta) ! ! ! !
+! w1..w3(ncelet ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "optcal.h"
+include "pointe.h"
+include "entsor.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "cstphy.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision statis(ncelet,nvlsta)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+integer iphas
+double precision dnbpr
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+iphas = ilphas
+ipass = ipass + 1
+
+!===============================================================================
+! 2. OUVERTURE DU FICHIER DE STOCKAGE
+!===============================================================================
+
+! Seul le premier processeur ecrit les informations
+if (irangp.le.0) then
+
+ if (ipass.eq.1 ) then
+
+ if ( iroule .ge. 1 .and. &
+ (iphyla.eq.2 .and. iencra.eq.1) ) then
+ write(implal,1000)
+ elseif ( iroule .ge. 1 .and. &
+ (iphyla.ne.2 .or. iencra.ne.1) ) then
+ write(implal,1001)
+ elseif ( iroule .ne. 1 .and. &
+ (iphyla.eq.2 .and. iencra.eq.1) ) then
+ write(implal,1002)
+ else
+ write(implal,1003)
+ endif
+
+ endif
+
+!===============================================================================
+! 2 - Ecriture des INFORMATIONS
+!===============================================================================
+
+ if (nbptot.gt.0) then
+ dnbpr = (nbpert*100.d0)/dble(nbptot)
+ else
+ dnbpr = 0
+ endif
+
+ if ( iroule.ge.1 .and. &
+ (iphyla.eq.2 .and. iencra.eq.1) ) then
+
+ write(implal,2000) iplas,(dtp*iplas), &
+ nbpart , dnbpar , &
+ nbpnew , dnbpnw , &
+ nbpout-nbperr , dnbpou-dnbper , &
+ nbperr , dnbper , &
+ dnbpr , &
+ npcsup , dnpcsu , &
+ npclon , dnpclo , &
+ npkill , dnpkil , &
+ npencr , dnpenc
+
+ elseif ( iroule.ge.1 .and. &
+ (iphyla.ne.2 .or. iencra.ne.1) ) then
+
+ write(implal,2001) iplas,(dtp*iplas), &
+ nbpart , dnbpar , &
+ nbpnew , dnbpnw , &
+ nbpout-nbperr , dnbpou-dnbper , &
+ nbperr , dnbper , &
+ dnbpr , &
+ npcsup , dnpcsu , &
+ npclon , dnpclo , &
+ npkill , dnpkil
+
+ elseif ( iroule.lt.1 .and. &
+ (iphyla.eq.2 .and. iencra.eq.1) ) then
+
+ write(implal,2002) iplas,(dtp*iplas), &
+ nbpart , dnbpar , &
+ nbpnew , dnbpnw , &
+ nbpout-nbperr , dnbpou-dnbper , &
+ nbperr , dnbper , &
+ dnbpr , &
+ npencr , dnpenc
+
+ else
+
+ write(implal,2003) iplas,(dtp*iplas), &
+ nbpart , dnbpar , &
+ nbpnew , dnbpnw , &
+ nbpout-nbperr , dnbpou-dnbper , &
+ nbperr , dnbper , &
+ dnbpr
+
+ endif
+
+endif
+
+!===============================================================================
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format('# ** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/, &
+ '# ------------------------------------- ',/, &
+ '# ',/, &
+ '# colonne 1 : numero de pas de temps ',/, &
+ '# colonne 2 : temps physique ',/, &
+ '# colonne 3 : nbre inst. de part. ',/, &
+ '# colonne 4 : nbre inst. de part. (avec poids)',/, &
+ '# colonne 5 : nbre inst. de part. injectees',/, &
+ '# colonne 6 : nbre inst. de part. injectees', &
+ ' (avec poids)',/, &
+ '# colonne 7 : nbre inst. de part. sorties ou deposees',/,&
+ '# colonne 8 : nbre inst. de part. sorties ou deposees', &
+ ' (avec poids)',/, &
+ '# colonne 9 : nbre inst. de part. perdues (reperage) ',/,&
+ '# colonne 10 : nbre inst. de part. perdues', &
+ ' (reperage, avec poids)',/, &
+ '# colonne 11 : % de part. perdues',/, &
+ '# colonne 12 : nbre inst. de part. qui ont subi le', &
+ ' clonage',/, &
+ '# colonne 13 : nbre inst. de part. qui ont subi le', &
+ ' clonage (avec poids)',/, &
+ '# colonne 14 : nbre inst. de nouvel. part. par clonage',/,&
+ '# colonne 15 : nbre inst. de nouvel. part. par clonage', &
+ ' (avec poids)',/, &
+ '# colonne 16 : nbre inst. de nouvel. part. eliminees par',&
+ ' roulette russe ',/, &
+ '# colonne 17 : nbre inst. de nouvel. part. eliminees par',&
+ ' roulette russe (avec poids)',/, &
+ '# colonne 18 : nbre inst. de part encrassees', &
+ ' (Charbon)) '/, &
+ '# colonne 19 : nbre inst. de part encrassees', &
+ ' (Charbon, avec poids))',/, &
+ '# ')
+
+ 1001 format('# ** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/, &
+ '# ------------------------------------- ',/, &
+ '# ',/, &
+ '# colonne 1 : numero de pas de temps ',/, &
+ '# colonne 2 : temps physique ',/, &
+ '# colonne 3 : nbre inst. de part. ',/, &
+ '# colonne 4 : nbre inst. de part. (avec poids)',/, &
+ '# colonne 5 : nbre inst. de part. injectees',/, &
+ '# colonne 6 : nbre inst. de part. injectees', &
+ ' (avec poids)',/, &
+ '# colonne 7 : nbre inst. de part. sorties ou deposees',/,&
+ '# colonne 8 : nbre inst. de part. sorties ou deposees', &
+ ' (avec poids)',/, &
+ '# colonne 9 : nbre inst. de part. perdues (reperage) ',/,&
+ '# colonne 10 : nbre inst. de part. perdues', &
+ ' (reperage, avec poids)',/, &
+ '# colonne 11 : % de part. perdues',/, &
+ '# colonne 12 : nbre inst. de part. qui ont subi le', &
+ ' clonage',/, &
+ '# colonne 13 : nbre inst. de part. qui ont subi le', &
+ ' clonage (avec poids)',/, &
+ '# colonne 14 : nbre inst. de nouvel. part. par clonage',/,&
+ '# colonne 15 : nbre inst. de nouvel. part. par clonage', &
+ ' (avec poids)',/, &
+ '# colonne 16 : nbre inst. de nouvel. part. eliminees par',&
+ ' roulette russe ',/, &
+ '# colonne 17 : nbre inst. de nouvel. part. eliminees par',&
+ ' roulette russe (avec poids)',/, &
+ '# ')
+
+ 1002 format('# ** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/, &
+ '# ------------------------------------- ',/, &
+ '# ',/, &
+ '# colonne 1 : numero de pas de temps ',/, &
+ '# colonne 2 : temps physique ',/, &
+ '# colonne 3 : nbre inst. de part. ',/, &
+ '# colonne 4 : nbre inst. de part. (avec poids)',/, &
+ '# colonne 5 : nbre inst. de part. injectees',/, &
+ '# colonne 6 : nbre inst. de part. injectees', &
+ ' (avec poids)',/, &
+ '# colonne 7 : nbre inst. de part. sorties ou deposees',/,&
+ '# colonne 8 : nbre inst. de part. sorties ou deposees', &
+ ' (avec poids)',/, &
+ '# colonne 9 : nbre inst. de part. perdues (reperage)',/, &
+ '# colonne 10 : nbre inst. de part. perdues', &
+ ' (reperage, avec poids)',/, &
+ '# colonne 11 : % de part. perdues ',/, &
+ '# colonne 12 : nbre inst. de part. encrassees', &
+ ' (Charbon)) '/, &
+ '# colonne 13 : nbre inst. de part. encrassees', &
+ ' (Charbon, avec poids))',/, &
+ '# ')
+
+ 1003 format('# ** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/, &
+ '# ------------------------------------- ',/, &
+ '# ',/, &
+ '# colonne 1 : numero de pas de temps ',/, &
+ '# colonne 2 : temps physique ',/, &
+ '# colonne 3 : nbre inst. de part. ',/, &
+ '# colonne 4 : nbre inst. de part. (avec poids)',/, &
+ '# colonne 5 : nbre inst. de part. injectees',/, &
+ '# colonne 6 : nbre inst. de part. injectees', &
+ ' (avec poids)',/, &
+ '# colonne 7 : nbre inst. de part. sorties ou deposees',/,&
+ '# colonne 8 : nbre inst. de part. sorties ou deposees', &
+ ' (avec poids)',/, &
+ '# colonne 9 : nbre inst. de part. perdues (reperage)',/, &
+ '# colonne 10 : nbre inst. de part. perdues', &
+ ' (reperage, avec poids)',/, &
+ '# colonne 11 : % de part. perdues ',/, &
+ '# ')
+
+ 2000 format(1x,i8,2x,e10.4,2x,4(i8,2x,e10.4),2x,e10.4,4(i8,2x,e10.4))
+ 2001 format(1x,i8,2x,e10.4,2x,4(i8,2x,e10.4),2x,e10.4,3(i8,2x,e10.4))
+ 2002 format(1x,i8,2x,e10.4,2x,4(i8,2x,e10.4),2x,e10.4,1(i8,2x,e10.4))
+ 2003 format(1x,i8,2x,e10.4,2x,4(i8,2x,e10.4),2x,e10.4)
+
+!====
+! FIN
+!====
+
+return
+
+end
diff --git a/src/lagr/lagcar.f90 b/src/lagr/lagcar.f90
new file mode 100644
index 0000000..edeed2a
--- /dev/null
+++ b/src/lagr/lagcar.f90
@@ -0,0 +1,702 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagcar &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , &
+ piil , bx , tempct , statis , &
+ gradpr , gradvf , energi , dissip , romp , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! CALCUL DES CARACTERISTIQUES DES PARTICULES : Tp, TL et PI
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! --> ! temps caracteristiques dynamique !
+! tlag(nbpmax) ! tr ! --> ! temps caracteristiques fluide !
+! piil(nbpmax,3 ! tr ! --> ! terme dans l'integration des eds up !
+! bx(nbpmax,3,2 ! tr ! --> ! caracteristiques de la turbulence !
+! tempct ! tr ! --> ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! statis(ncelet ! tr ! <-- ! cumul des statistiques volumiques !
+! nvlsta) ! ! ! !
+! gradpr ! tr ! <-- ! gradient de pression !
+! (ncelet,3) ! ! ! !
+! gradvf ! tr ! <-- ! gradient de la vitesse du fluide !
+! (ncelet,3) ! ! ! !
+! energi(ncelet ! tr ! --- ! tableau de travail !
+! dissip(ncelet ! tr ! --- ! tableau de travail !
+! romp(nbpmax) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3)
+double precision piil(nbpmax,3) , bx(nbpmax,3,2)
+double precision tempct(nbpmax,2)
+double precision statis(ncelet,nvlsta)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision energi(ncelet) , dissip(ncelet), romp(nbpmax)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel , ip , id , igvx , igvy , igvz , ivt
+integer iromf , iphas
+
+double precision cd1 , cd2 , rec , cl , c0 , cb , cbcb
+double precision upart , vpart , wpart
+double precision uflui , vflui , wflui
+double precision uvwdif , tl , uvwr
+double precision rep , d2 , d3 , fdr , d1s3 , d3s444 , d6spi
+double precision bb1 , bb2 , bb3 , ktil , bx1 , bx2 , bx3
+double precision vpmx , vpmy , vpmz
+double precision r11 , r22 , r33
+double precision xnul , rom , prt , fnus , xrkl , xcp
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+iphas = ilphas
+
+cd1 = 0.15d0
+cd2 = 0.687d0
+rec = 1000.d0
+c0 = 2.1d0
+cl = 1.d0 / (0.5d0 + (3.d0/4.d0)*c0 )
+cb = 0.8d0
+cbcb = 0.64d0
+
+d6spi = 6.d0 / pi
+d1s3 = 1.d0 / 3.d0
+d3s444 = 0.44d0 * 3.d0 / 4.d0
+
+! Pointeur sur la masse volumique en fonction de l'ecoulement
+
+if ( ippmod(icp3pl).ge.0 .or. ippmod(icfuel).ge.0 ) then
+ iromf = ipproc(irom1)
+else
+ iromf = ipproc(irom(iphas))
+endif
+
+! Calcul de la masse volumique
+
+do ip = 1,nbpart
+ if ( itepa(ip,jisor).gt.0 ) then
+ d3 = ettp(ip,jdp) * ettp(ip,jdp) * ettp(ip,jdp)
+ romp(ip) = ettp(ip,jmp) * d6spi / d3
+ endif
+enddo
+
+!===============================================================================
+! 2. CALCUL DE Tp ET DE Tc SI THERMIQUE
+!===============================================================================
+
+do ip = 1,nbpart
+
+ if ( itepa(ip,jisor) .gt.0 ) then
+
+ iel = itepa(ip,jisor)
+
+ rom = propce(iel,iromf)
+ xnul = propce(iel,ipproc(iviscl(iphas))) / rom
+
+ uvwr = sqrt( ( ettp(ip,juf) -ettp(ip,jup) )* &
+ ( ettp(ip,juf) -ettp(ip,jup) ) &
+ + ( ettp(ip,jvf) -ettp(ip,jvp) )* &
+ ( ettp(ip,jvf) -ettp(ip,jvp) ) &
+ + ( ettp(ip,jwf) -ettp(ip,jwp) )* &
+ ( ettp(ip,jwf) -ettp(ip,jwp) ) )
+
+!---> CALCUL DU REYNOLDS LOCAL
+
+ rep = uvwr * ettp(ip,jdp) / xnul
+
+!---> CALCUL DU COEFFICIENT DE TRAINEE
+
+ d2 = ettp(ip,jdp) * ettp(ip,jdp)
+
+ if (rep.le.rec) then
+ fdr = 18.d0 * xnul * (1.d0 + cd1 * rep**cd2) / d2
+ else
+ fdr = d3s444 * uvwr / ettp(ip,jdp)
+ endif
+
+!---> CALCUL DE Tp
+
+ taup(ip) = romp(ip) / rom / fdr
+
+!---> CALCUL UTILISATEUR DE Tp
+
+ call uslatp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ip , itepa , idevel , ituser , ia , &
+ rep , uvwr , rom , romp(ip) , xnul , taup(ip) , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , &
+ rdevel , rtuser , ra )
+
+!---> CALCUL DE Tc
+
+ if ( (iphyla.eq.1 .and. itpvar.eq.1) .or. &
+ (iphyla.eq.2) ) then
+
+! CP fluide
+
+ if (icp(iphas).gt.0) then
+ xcp = propce( 1,ipproc(icp(iphas)) )
+ else
+ xcp = cp0(iphas)
+ endif
+
+! CALCUL DU NUSSELT LOCAL
+
+ if ( ippmod(icp3pl).ge.0 .or. &
+ ippmod(icpl3c).ge.0 .or. &
+ ippmod(icod3p).ge.1 .or. &
+ ippmod(icoebu).eq.1 .or. &
+ ippmod(icoebu).eq.3 .or. &
+ ippmod(icfuel).ge.0 .or. &
+ ippmod(ielarc).ge.0 .or. &
+ ippmod(ieljou).ge.0 ) then
+ ivt = ihm
+ else
+ ivt = iscalt(iphas)
+ endif
+
+! a priori en combustion gaz ou CP, la diffusvite est toujours constante
+
+ if (ippmod(icoebu).eq.0 .or. ippmod(icoebu).eq.2) then
+ xrkl = diftl0 / rom
+ else if (ivisls(ivt).ge.1) then
+ xrkl = propce(iel,ipproc(ivisls(ivt))) / rom
+ else
+ xrkl = visls0(ivt) / rom
+ endif
+
+ prt = xnul / xrkl
+ fnus = 2.d0 + 0.55d0 * rep**0.5d0 * prt**(d1s3)
+
+! Calcul du temps caracteristique thermique Tc
+
+ tempct(ip,1) = d2 * romp(ip) * ettp(ip,jcp) &
+ / ( fnus * 6.d0 * rom * xcp * xrkl )
+
+!---> CALCUL UTILISATEUR DE Tc
+
+ call uslatc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ip , itepa , idevel , ituser , ia , &
+ rep , uvwr , rom , romp(ip) , xnul , &
+ xcp , xrkl , tempct(ip,1) , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , &
+ rdevel , rtuser , ra )
+
+! Terme source implicite pour le couplage retour thermique
+
+ tempct(ip,2) = fnus * pi * ettp(ip,jdp) * xrkl * rom
+
+ endif
+
+ endif
+
+enddo
+
+
+!===============================================================================
+! 3. CALCUL DE TL
+!===============================================================================
+
+!--> Calcul de l'energie turbulente et de la dissipation
+! en fonction du modele de turbulence
+
+if (idistu.eq.1) then
+
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50) then
+ do iel = 1,ncel
+ energi(iel) = rtp(iel,ik(iphas))
+ dissip(iel) = rtp(iel,iep(iphas))
+ enddo
+ else if (itytur(iphas).eq.3) then
+ do iel = 1,ncel
+ energi(iel) = 0.5d0*( rtp(iel,ir11(iphas)) &
+ +rtp(iel,ir22(iphas)) &
+ +rtp(iel,ir33(iphas)) )
+ dissip(iel) = rtp(iel,iep(iphas))
+ enddo
+ else if (iturb(iphas).eq.60) then
+ do iel = 1,ncel
+ energi(iel) = rtp(iel,ik(iphas))
+ dissip(iel) = cmu*energi(iel)*rtp(iel,iomg(iphas))
+ enddo
+ else
+ write(nfecra,2000) iilagr, idistu, iphas, iturb(iphas)
+ call csexit (1)
+! ======
+ endif
+
+!--> Calcul de TL et BX
+
+ do ip = 1,nbpart
+
+ if (itepa(ip,jisor).gt.0) then
+
+ iel = itepa(ip,jisor)
+
+
+ if (dissip(iel).gt.0.d0 .and. &
+ energi(iel).gt.0.d0 ) then
+
+ tl = cl * energi(iel) / dissip(iel)
+ tl = max(tl,epzero)
+
+ upart = ettp(ip,jup)
+ vpart = ettp(ip,jvp)
+ wpart = ettp(ip,jwp)
+ uflui = ettp(ip,juf)
+ vflui = ettp(ip,jvf)
+ wflui = ettp(ip,jwf)
+
+ if (modcpl.gt.0 .and. iplas.gt.modcpl) then
+ if (statis(iel,ilpd).gt.seuil) then
+ upart = statis(iel,ilvx) / statis(iel,ilpd)
+ vpart = statis(iel,ilvy) / statis(iel,ilpd)
+ wpart = statis(iel,ilvz) / statis(iel,ilpd)
+ uflui = rtp(iel,iu(iphas))
+ vflui = rtp(iel,iv(iphas))
+ wflui = rtp(iel,iw(iphas))
+ endif
+ endif
+
+ uvwdif = (uflui-upart) * (uflui-upart) &
+ + (vflui-vpart) * (vflui-vpart) &
+ + (wflui-wpart) * (wflui-wpart)
+
+ uvwdif = (3.d0 * uvwdif) / (2.d0 *energi(iel))
+
+ if (modcpl.gt.0 .and. iplas.gt.modcpl) then
+
+ if (idirla.eq.1) then
+ bb1 = sqrt( 1.d0 + cbcb *uvwdif )
+ tlag(ip,1)= tl / bb1
+ bb2 = sqrt( 1.d0 + 4.d0 *cbcb *uvwdif )
+ tlag(ip,2)= tl / bb2
+ bb3 = sqrt( 1.d0 + 4.d0 *cbcb *uvwdif )
+ tlag(ip,3)= tl / bb3
+
+ else if (idirla.eq.2) then
+ bb1 = sqrt( 1.d0 + 4.d0 *cbcb *uvwdif )
+ tlag(ip,1)= tl / bb1
+ bb2 = sqrt( 1.d0 + cbcb *uvwdif )
+ tlag(ip,2)= tl / bb2
+ bb3 = sqrt( 1.d0 + 4.d0 *cbcb *uvwdif )
+ tlag(ip,3)= tl / bb3
+
+ else if (idirla.eq.3) then
+ bb1 = sqrt( 1.d0 + 4.d0 *cbcb *uvwdif )
+ tlag(ip,1)= tl / bb1
+ bb2 = sqrt( 1.d0 + 4.d0 *cbcb *uvwdif )
+ tlag(ip,2)= tl / bb2
+ bb3 = sqrt( 1.d0 + cbcb *uvwdif )
+ tlag(ip,3)= tl / bb3
+ else
+ write(nfecra,1000) idirla
+ call csexit(1)
+! ======
+ endif
+
+ if (itytur(iphas).eq.3) then
+ r11 = rtp(iel,ir11(iphas))
+ r22 = rtp(iel,ir22(iphas))
+ r33 = rtp(iel,ir33(iphas))
+ ktil = 3.d0 * ( r11*bb1 + r22*bb2 + r33*bb3 ) &
+ / (2.d0 * (bb1+bb2+bb3) )
+ else if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ ktil = energi(iel)
+ endif
+
+ bx1 = dissip(iel) * ( (c0*bb1*ktil/energi(iel)) &
+ +(2.d0 *(bb1*ktil/energi(iel) -1.d0)/3.d0) )
+ bx2 = dissip(iel) * ( (c0*bb2*ktil/energi(iel)) &
+ +(2.d0 *(bb2*ktil/energi(iel) -1.d0)/3.d0) )
+ bx3 = dissip(iel) * ( (c0*bb3*ktil/energi(iel)) &
+ +(2.d0 *(bb3*ktil/energi(iel) -1.d0)/3.d0) )
+
+ if (bx1.gt.0.d0) then
+ bx(ip,1,nor) = sqrt(bx1)
+ else
+ bx(ip,1,nor) = 0.d0
+ endif
+
+ if (bx2.gt.0.d0) then
+ bx(ip,2,nor) = sqrt(bx2)
+ else
+ bx(ip,2,nor) = 0.d0
+ endif
+
+ if (bx3.gt.0.d0) then
+ bx(ip,3,nor) = sqrt(bx3)
+ else
+ bx(ip,3,nor) = 0.d0
+ endif
+
+ else
+
+ tlag(ip,1) = tl
+ tlag(ip,2) = tl
+ tlag(ip,3) = tl
+
+ if (idiffl.eq.0) then
+ uvwdif = sqrt(uvwdif)
+ tlag(ip,1) = tl/(1.d0 + cb*uvwdif)
+ tlag(ip,2) = tlag(ip,1)
+ tlag(ip,3) = tlag(ip,1)
+ endif
+
+ bx(ip,1,nor) = sqrt(c0*dissip(iel))
+ bx(ip,2,nor) = bx(ip,1,nor)
+ bx(ip,3,nor) = bx(ip,1,nor)
+ endif
+
+ else
+
+ tlag(ip,1) = epzero
+ tlag(ip,2) = epzero
+ tlag(ip,3) = epzero
+ bx(ip,1,nor) = zero
+ bx(ip,2,nor) = zero
+ bx(ip,3,nor) = zero
+
+ endif
+
+ endif
+
+ enddo
+
+else
+
+ do ip = 1,nbpart
+
+ if ( itepa(ip,jisor) .gt.0 ) then
+ tlag(ip,1) = epzero
+ tlag(ip,2) = epzero
+ tlag(ip,3) = epzero
+ bx(ip,1,nor) = zero
+ bx(ip,2,nor) = zero
+ bx(ip,3,nor) = zero
+ endif
+
+ enddo
+
+endif
+
+!===============================================================================
+! 4. CALCUL DE PII
+!===============================================================================
+
+do id = 1,3
+
+ igvx = 3*(id-1)+1
+ igvy = 3*(id-1)+2
+ igvz = 3*(id-1)+3
+
+ do ip = 1,nbpart
+
+ if ( itepa(ip,jisor).gt.0 ) then
+
+!---> Calcul de II = ( -grad(P)/Rom(f)+grad(<Vf>)*(<Up>-<Uf>) )
+! ou
+! Calcul de II = ( -grad(P)/Rom(f) )
+
+ iel = itepa(ip,jisor)
+
+ piil(ip,id) = gradpr(iel,id)
+
+ if (modcpl.gt.0 .and. iplas.gt.modcpl) then
+ if ( statis(iel,ilpd) .gt. seuil ) then
+ vpmx = statis(iel,ilvx) / statis(iel,ilpd)
+ vpmy = statis(iel,ilvy) / statis(iel,ilpd)
+ vpmz = statis(iel,ilvz) / statis(iel,ilpd)
+
+ uflui = rtp(iel,iu(iphas))
+ vflui = rtp(iel,iv(iphas))
+ wflui = rtp(iel,iw(iphas))
+
+ piil(ip,id) = gradpr(iel,id) &
+ +gradvf(iel,igvx) * (vpmx-uflui) &
+ +gradvf(iel,igvy) * (vpmy-vflui) &
+ +gradvf(iel,igvz) * (vpmz-wflui)
+
+ endif
+ endif
+
+!---> Terme purement explicite : probleme avec petit diametre
+! NE PAS EFFACER SVP !
+
+! IF (IILAGR.EQ.2 .AND. ISTALA.GE.1) THEN
+
+! IF (STATIS(IEL,ILPD).GT.SEUIL) THEN
+
+! ROM = PROPCE(IEL,IROMF)
+
+! FF = ROMP(IP) / ROM
+! & *( STATIS(IEL,ILFV) / (DBLE(NPST)*VOLUME(IEL)) )
+! & *( ETTP(IP,JUF+(ID-1)) - ETTP(IP,JUP+(ID-1)))
+! & /TAUP(IP)
+
+! PIIL(IP,ID) = PIIL(IP,ID) - FF
+
+! ENDIF
+
+! ENDIF
+
+ endif
+
+ enddo
+
+enddo
+
+!==============================================================================
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE CHOIX DE LA DIRECTION DU MODELE COMPLET ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGCAR). ',/,&
+'@ ',/,&
+'@ IDIRLA DEVRAIT ETRE UN ENTIER EGAL A 1 2 OU 3 ',/,&
+'@ (LA VALEUR 1 POUR UN ECOULEMENT SELON L''AXE X, ',/,&
+'@ LA VALEUR 2 POUR UN ECOULEMENT SELON L''AXE Y, ',/,&
+'@ LA VALEUR 3 POUR UN ECOULEMENT SELON L''AXE Z) ',/,&
+'@ IL VAUT ICI IDIRLA = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IDIRLA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE MODULE LAGRANGIEN EST INCOMPATIBLE AVEC LE MODELE ',/,&
+'@ DE TURBULENCE SELECTIONNE. ',/,&
+'@ ',/,&
+'@ Le module Lagrangien a ete active avec IILAGR = ',I10 ,/,&
+'@ et la dispersion turbulente est prise en compte ',/,&
+'@ avec IDISTU = ',I10 ,/,&
+'@ Le modele de turbulence active pour la phase ',I6 ,/,&
+'@ correspond a ITURB = ',I10 ,/,&
+'@ Or, les seuls traitements de la turbulence compatibles ',/,&
+'@ avec le module Lagrangien et la dispersion turbulente ',/,&
+'@ sont k-epsilon et Rij-epsilon, v2f et k-omega. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR et IDISTU dans la subroutine ',/,&
+'@ USLAG1 et verifier la valeur de ITURB dans la subroutine ',/,&
+'@ USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagcel.f90 b/src/lagr/lagcel.f90
new file mode 100644
index 0000000..b009942
--- /dev/null
+++ b/src/lagr/lagcel.f90
@@ -0,0 +1,1411 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagcel &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , icocel , itycel , ifrlag , itepa , ibord , &
+ indep , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , parbor , auxl , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Trajectographie des particules : le propos de ce sous-programme
+! est de donner le numero de la cellule d'arrive d'une particule
+! connaissant les coordonnees du point de depart, celles
+! du point d'arrive, ainsi que le numero de la cellule de depart.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! itrifb(nfabor ! te ! --> ! tab d'indirection pour tri des faces !
+! nphas) ! ! ! !
+! icocel ! te ! --> ! connectivite cellules -> faces !
+! (lndnod) ! ! ! face de bord si numero negatif !
+! itycel ! te ! --> ! connectivite cellules -> faces !
+! (ncelet+1) ! ! ! !
+! ifrlag ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module lagrangien !
+! itepa ! te ! --> ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! --> ! si nordre=2, contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! indep ! te ! --> ! pour chaque particule : !
+! (nbpmax) ! ! ! numero de la cellule de depart !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! surfbn(nfabor ! tr ! -> ! surface des faces de bord !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant et prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! parbor(nfabor ! tr ! <-- ! cumul des statistiques aux frontieres !
+! nvisbr) ! ! ! !
+! auxl(nbpmax,3 ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer icocel(lndnod) , itycel(ncelet+1)
+integer ifrlag(nfabor) , itepa(nbpmax,nivep)
+integer ibord(nbpmax)
+integer indep(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision surfbn(nfabor)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision parbor(nfabor,nvisbr) , auxl(nbpmax,3)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+
+integer iel, ifac, kfac, nbp, icecpt
+integer ii, jj, in, ip
+integer indian, ifaold, ifanew
+integer isuivi, ierror, ierrie
+integer itypfo, iconfo(100)
+
+integer icelcr , ipercr, itepas, iper
+double precision pta(3), ptb(3), vect(3), vectn(3)
+
+!===============================================================================
+! -1. MACRO DE DEBUGGAGE DEVELOPPEUR
+!===============================================================================
+
+! ATTENTION INTERVENTION DEVELOPPEUR UNIQUEMENT.
+
+! Si cette macro est vrai elle permet les impressions listing
+! de l'avance des particules (si IMPLTG = 1), et permet la sortie
+! des fichers Ensight de debuggage en cas de perte de particule
+! en mode sans erreur (si IERRIE = 1).
+! Lorsque cette macro est vrai, il est conseille d'avoir un NBPART
+! petit, sans quoi les temps de calcul seront enormes a cause
+! des ecritures disque du au fichier SCRATCH4.lag.
+
+! PAR DEFAUT : DEBUG_LAGCEL = 0
+
+
+#define DEBUG_LAGCEL 0
+
+
+
+#if DEBUG_LAGCEL
+integer impltg
+integer ipt , kpt , npt , ipart , ielold
+integer nquad4 , ntria3 , nsided
+#endif
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+do ip = 1,nbpmax
+ ibord(ip) = 0
+enddo
+
+#if DEBUG_LAGCEL
+!--> IMPLTG =1 ecriture de la progression des particules dans le listing
+! (utile si DEBUG_LAGCEL = 1)
+
+! mettre IMPLTG a 1 ici
+impltg = 1
+
+#endif
+
+
+!--> Si IERRIE est non nul alors on se place en mode sans erreur de
+! trajectoire : il y a arret du calcul a la 1ere erreur sur le
+! reperage.
+
+ierrie = 0
+
+!--> La valeur de IERR bascule a 1 s'il y a une erreur et si IERRIE = 1
+
+! ne pas modifier cette initialisation SVP
+ierr = 0
+
+nbperr = 0
+dnbper = 0.d0
+
+
+!--> Si on est en instationnaire, RAZ des statistiques aux frontieres
+
+if (iensi3.eq.1) then
+
+ if (isttio.eq.0 .or. (isttio.eq.1 .and. iplas.le.nstbor)) then
+ tstatp = 0.d0
+ npstf = 0
+ do ii = 1,nvisbr
+ do ifac = 1,nfabor
+ parbor(ifac,ii) = 0.d0
+ enddo
+ enddo
+ endif
+
+ tstatp = tstatp + dtp
+ npstf = npstf + 1
+ npstft = npstft + 1
+
+endif
+
+if (iphyla.eq.2 .and. iencra.eq.1) then
+ npencr = 0
+ dnpenc = 0.d0
+endif
+
+
+! Traitement de la periodicite
+
+if (iperio.eq.1) then
+
+ icelcr = idebia
+ ipercr = icelcr + ncelet-ncel
+ ifinia = ipercr + ncelet-ncel
+ CALL IASIZE('LAGCEL', IFINIA)
+ !==========
+
+ do iel = 1,ncelet-ncel
+ ia(icelcr+iel-1) = 0
+ ia(ipercr+iel-1) = -1
+ enddo
+
+ call perloc(ia(icelcr), ia(ipercr))
+ !==========
+
+endif
+
+!===============================================================================
+! 2. Reperage des particules dans le maillage
+!===============================================================================
+
+!--> Boucle principale : les particules sont traitees une par une
+
+do ip = 1,nbpart
+
+! utile car IDEPO2
+ if (itepa(ip,jisor).gt.0) then
+
+ ifanew = 0
+ icecpt = 0
+
+!--> Ouverture du fichier SCRATCH qui permettra l'ecriture des infos
+! en mode DEBUG
+
+#if DEBUG_LAGCEL
+ OPEN (IMPLA4,FILE='SCRATCH4.lag', &
+ STATUS='UNKNOWN',FORM='UNFORMATTED', &
+ ACCESS='SEQUENTIAL')
+ nquad4 = 0
+ ntria3 = 0
+ nsided = 0
+#endif
+
+!--> Etiquette de retour pour le suivi de la particule dans la cellule voisine
+
+ 100 continue
+
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9001) ip, itepa(ip,jisor)
+#endif
+
+!--> Attention :
+
+! 1) IEL est cst jusqu'au GOTO 100, ITEPA(IP,JISOR) est modifie
+! jusqu'au GOTO 100
+
+! 2) IFAOLD contient le numero de la derniere face traversee par la
+! trajectoire de la particule IP, si > 0 face interne,
+! si < 0 face de bord, IFAOLD est cst jusqu'au GOTO 100,
+! IFANEW est modifie jusqu'au GOTO 100
+
+ iel = itepa(ip,jisor)
+ isuivi = -999
+ ifaold = ifanew
+ indian = 0
+ icecpt = icecpt + 1
+
+! ---> Elimination des particules qui posent problemes
+! (boucles infinies)
+
+ if (icecpt.gt.30) then
+ itepa(ip,jisor) = 0
+ nbperr = nbperr + 1
+ dnbper = dnbper + tepa(ip,jrpoi)
+ if (ierrie.eq.0) then
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9103) ip
+#endif
+ goto 200
+ else
+ write(nfecra,9103) ip
+ ierr = 1
+ goto 300
+ endif
+ endif
+
+!--> Balayage des KFAC faces entourant la cellule IEL,
+! elles sont stockees entre ITYCEL(IEL) et ITYCEL(IEL+1)-1
+! (donc KFAC ne peut pas valoir ITYCEL(IEL+1)...)
+
+! Remarque : si on veut supprimer le DO WHILE il faut utiliser
+! la ligne suivante
+! DO KFAC = ITYCEL(IEL),ITYCEL(IEL+1)-1
+
+ kfac = itycel(iel)-1
+
+ do while (indian.eq.0)
+
+ kfac = kfac + 1
+
+!--> Cas ou aucune face a INDIAN= -1 ou 1 sur la cellule n'a ete
+! detectee, gestion de l'erreur :
+
+ if (kfac.eq.itycel(iel+1)) then
+ if (ierrie.eq.0) then
+ itepa(ip,jisor) = 0
+ nbperr = nbperr + 1
+ dnbper = dnbper + tepa(ip,jrpoi)
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9102) iel,ip
+#endif
+ goto 200
+ else
+ write(nfecra,9102) iel,ip
+ ierr = 1
+ goto 300
+ endif
+ endif
+
+ ifac = icocel(kfac)
+
+!--> Boucle sur les faces internes (numero positif dans ICOCEL)
+! resultat : INDIAN = 0 le rayon PQ ne sort pas de la cellule
+! ~~~~~~~~ par cette face
+! INDIAN = -1 meme cellule
+! INDIAN = 1 sortie de la cellule par cette face
+
+!--> Si la face interne a deja ete traitee dans la cellule precedente
+! son numero est dans IFAOLD et on ne la retraite pas une 2eme fois
+
+ if (ifac.gt.0 .and. ifac.ne.ifaold) then
+
+ in = 0
+ do nbp = ipnfac(ifac),ipnfac(ifac+1)-1
+ in = in + 1
+ iconfo(in) = nodfac(nbp)
+ enddo
+ itypfo = ipnfac(ifac+1) - ipnfac(ifac) + 1
+ iconfo(itypfo) = iconfo(1)
+
+#if DEBUG_LAGCEL
+ nbp = ipnfac(ifac+1) - ipnfac(ifac)
+ write(impla4) &
+ nbp,ifac,iel,(nodfac(in),in=ipnfac(ifac),ipnfac(ifac+1)-1)
+ if (nbp.eq.4) then
+ nquad4 = nquad4 + 1
+ else if (nbp.eq.3) then
+ ntria3 = ntria3 + 1
+ else if (nbp.ge.5) then
+ nsided = nsided + 1
+ endif
+#endif
+
+ call ouestu &
+ !==========
+ ( nfecra , ndim , nnod , &
+ ierror , &
+ ettpa(ip,jxp) , ettpa(ip,jyp) , ettpa(ip,jzp) , &
+ ettp(ip,jxp) , ettp(ip,jyp) , ettp(ip,jzp) , &
+ cdgfac(1,ifac) , cdgfac(2,ifac) , cdgfac(3,ifac) ,&
+ xyzcen(1,iel) , xyzcen(2,iel) , xyzcen(3,iel) ,&
+ itypfo , iconfo , xyznod , &
+ indian )
+
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9004) ip , ifac , indian
+#endif
+
+! ---> Elimination des particules qui posent problemes
+
+ if (ierror.eq.1) then
+ ierror = 0
+ itepa(ip,jisor) = 0
+ nbperr = nbperr + 1
+ dnbper = dnbper + tepa(ip,jrpoi)
+ if (ierrie.eq.0) then
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9101) ifac,ip
+#endif
+ goto 200
+ else
+ write(nfecra,9101) ifac,ip
+ ierr = 1
+ goto 300
+ endif
+
+!--> Si la particule passe dans la cellule voisine
+
+ else if (indian.eq.1) then
+
+!--> Si la particule IP est dans la cellule II alors le voisin ne
+! peut etre que la cellule JJ, et vice versa, et inversement, et
+! ainsi de suite.
+
+ ifanew = ifac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ if (iel.eq.ii) then
+ itepa(ip,jisor) = jj
+ else if (iel.eq.jj) then
+ itepa(ip,jisor) = ii
+ endif
+
+! Traitement de la periodicite (debut).
+! Ne marchera pas si on passe en parallele. Le fait d'�tre dans le halo
+! n'est pas suffisant pour conclure si la cellule est periodique.
+
+ if (itepa(ip,jisor).gt.ncel) then
+
+! Si on est sur un plan de periodicite, on passe
+! a l'ordre 1 sur les schemas
+
+ ibord(ip) = -1
+
+ itepas = itepa(ip,jisor)
+ itepa(ip,jisor) = ia(icelcr+itepas-ncel-1)
+
+! On recupere les informations sur la peridodicite
+
+ iper = ia(ipercr+itepas-ncel-1)
+
+! Faire un test si IPER != -1 pour ne traiter que les cellules periodiques
+! Finir l'impl�mentation dans PERLOC
+
+! POINT DE DEPART
+
+ pta(1) = ettpa(ip,jxp)
+ pta(2) = ettpa(ip,jyp)
+ pta(3) = ettpa(ip,jzp)
+
+ call lagper(iper, pta, ptb)
+ !==========
+
+ ettpa(ip,jxp) = ptb(1)
+ ettpa(ip,jyp) = ptb(2)
+ ettpa(ip,jzp) = ptb(3)
+
+! POINT D'ARRIVEE
+
+ pta(1) = ettp(ip,jxp)
+ pta(2) = ettp(ip,jyp)
+ pta(3) = ettp(ip,jzp)
+
+ iper = ia(ipercr+itepas-ncel-1)
+
+ call lagper(iper, pta, ptb)
+ !==========
+
+ ettp(ip,jxp) = ptb(1)
+ ettp(ip,jyp) = ptb(2)
+ ettp(ip,jzp) = ptb(3)
+
+! MODIFICATION DES VITESSES PARTICULES
+
+ vect(1) = ettpa(ip,jup)
+ vect(2) = ettpa(ip,jvp)
+ vect(3) = ettpa(ip,jwp)
+
+ call lagvec(iper, vect, vectn)
+ !==========
+
+ ettpa(ip,jup) = vectn(1)
+ ettpa(ip,jvp) = vectn(2)
+ ettpa(ip,jwp) = vectn(3)
+
+ vect(1) = ettp(ip,jup)
+ vect(2) = ettp(ip,jvp)
+ vect(3) = ettp(ip,jwp)
+
+ call lagvec(iper, vect, vectn)
+ !==========
+
+ ettp(ip,jup) = vectn(1)
+ ettp(ip,jvp) = vectn(2)
+ ettp(ip,jwp) = vectn(3)
+
+! MODIFICATION DES VITESSES FLUIDES VUES
+
+ vect(1) = ettpa(ip,juf)
+ vect(2) = ettpa(ip,jvf)
+ vect(3) = ettpa(ip,jwf)
+
+ call lagvec(iper, vect, vectn)
+ !==========
+
+ ettpa(ip,juf) = vectn(1)
+ ettpa(ip,jvf) = vectn(2)
+ ettpa(ip,jwf) = vectn(3)
+
+ vect(1) = ettp(ip,juf)
+ vect(2) = ettp(ip,jvf)
+ vect(3) = ettp(ip,jwf)
+
+ call lagvec(iper, vect, vectn)
+ !==========
+
+ ettp(ip,juf) = vectn(1)
+ ettp(ip,jvf) = vectn(2)
+ ettp(ip,jwf) = vectn(3)
+
+ ifanew = 0
+
+ endif
+
+! Traitement de la periodicite (fin)
+
+!--> Retour pour balayage des faces de la cellule suivante
+
+ goto 100
+
+ endif
+
+!--> Balayage des faces de bord (reperees par leur valeur negative
+! dans ICOCEL)
+
+! resultat : INDIAN = 0 le rayon PQ ne sort pas de la cellule par
+! ~~~~~~~~ cette face
+! INDIAN = -1 meme cellule
+! INDIAN = 1 interaction avec la frontiere
+
+ else if (ifac.lt.0 .and. ifac.ne.ifaold) then
+
+ ifac = -ifac
+
+ in = 0
+ do nbp = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ in = in + 1
+ iconfo(in) = nodfbr(nbp)
+ enddo
+ itypfo = ipnfbr(ifac+1) - ipnfbr(ifac) + 1
+ iconfo(itypfo) = iconfo(1)
+
+#if DEBUG_LAGCEL
+ nbp = ipnfbr(ifac+1) - ipnfbr(ifac)
+ write(impla4) &
+ nbp, -ifac, iel, &
+ (nodfbr(in),in=ipnfbr(ifac),ipnfbr(ifac+1)-1)
+ if (nbp.eq.4) then
+ nquad4 = nquad4 + 1
+ else if (nbp.eq.3) then
+ ntria3 = ntria3 + 1
+ else if (nbp.ge.5) then
+ nsided = nsided + 1
+ endif
+#endif
+
+ call ouestu &
+ !==========
+ ( nfecra , ndim , nnod , &
+ ierror , &
+ ettpa(ip,jxp) , ettpa(ip,jyp) , ettpa(ip,jzp) , &
+ ettp(ip,jxp) , ettp(ip,jyp) , ettp(ip,jzp) , &
+ cdgfbo(1,ifac) , cdgfbo(2,ifac) , cdgfbo(3,ifac) ,&
+ xyzcen(1,iel) , xyzcen(2,iel) , xyzcen(3,iel) ,&
+ itypfo , iconfo , xyznod , &
+ indian )
+
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9002) ip , ifac , indian
+#endif
+
+! ---> Elimination des particules qui posent problemes
+
+ if (ierror.eq.1) then
+ ierror = 0
+ itepa(ip,jisor) = 0
+ nbperr = nbperr + 1
+ dnbper = dnbper + tepa(ip,jrpoi)
+ if (ierrie.eq.0) then
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9101) ifac,ip
+#endif
+ goto 200
+ else
+ write(nfecra,9101) ifac,ip
+ ierr = 1
+ goto 300
+ endif
+
+!--> Si la trajectoire de la particule traverse la face de bord
+
+ else if (indian.eq.1) then
+ if (nordre.eq.2) ibord(ip) = ifac
+
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9003) ifac
+#endif
+
+!--> Traitement de l'interaction particule/frontiere
+
+! 1) modification du numero de la cellule de depart
+! (ITEPA(IP,JISOR) = IEL ou 0)
+
+! 2) P devient K, intersection entre la rayon PQ et le plan
+! de la face de bord
+
+! 3) Q est a determiner selon la nature de l'interaction
+! particule/frontiere
+
+! resultat : ISUIVI = 0 -> on ne suit plus la particule
+! ~~~~~~~~ dans le maillage apres USLABO
+! ISUIVI = 1 -> la particule continue a etre suivie
+! ISUIVI = -999 valeur initiale aberrante
+
+! Blindage dans USLABO : ISUIVI ne peut que valoir 0 ou 1 apres.
+
+ call uslabo &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ ifac , ip , isuivi , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , ifrlag , itepa , indep , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , parbor , ettp(1,jup) , &
+ ettp(1,juf) , auxl , &
+ rdevel , rtuser , ra )
+
+!--> Si la particule continue sa route (ex : rebond) apres l'interaction
+! avec la frontiere, il faut continuer a la suivre donc GOTO 100
+
+ if (isuivi.eq.1) then
+ ifanew = -ifac
+ goto 100
+ else if (isuivi.ne.0 .and. isuivi.ne.1) then
+ write (nfecra,8010) ifrlag(ifac) , isuivi
+ call csexit (1)
+ !==========
+ endif
+
+ endif
+
+! fin de IF (IFAC.GT.0 .AND. IFAC.NE.IFAOLD) THEN
+ endif
+
+! fin de DO WHILE
+ enddo
+
+!--> Fin de la boucle sur les faces entourant la cellule courante
+
+ 200 continue
+
+#if DEBUG_LAGCEL
+ if (impltg.eq.1) write(nfecra,9005) ip , itepa(ip,jisor)
+ CLOSE(IMPLA4, STATUS='DELETE')
+#endif
+
+!-->Fin de la boucle principale sur les particules
+
+ endif
+
+enddo
+
+return
+
+
+!===============================================================================
+! 3. Gestion des erreurs et ecriture des fichiers debugX
+!===============================================================================
+
+!--> debugX.CASE sont une aide graphique au debuggage, ils contiennent :
+! 1) le dernier morceau de la trajectoire de la particule
+! qui a un pepin,
+! 2) les faces (avec leur numero global) entourant les volumes
+! qui contiennent le dernier morceau de trajectoire,
+! 3) le fichier debug2.geom contient en plus les CDG faces et cellules
+! qui ont pour numero d'element Ensight celui de l'element
+! de maillage (face ou cellule) associe.
+
+!--> On ecrit 4 fichiers :
+! 1) debug1.geom et debug1.CASE ecris au format ensight,
+! 2) debug2.geom et debug2.CASE ecris au format ensight gold.
+! Les deux fichiers .CASE peuvent etre lus avec Ensight7 indifferemment.
+
+!--> L'ecriture des fichiers debugX est declenchee par defaut
+! par une erreur sur la detection de la trajectoire (IERR=1).
+
+! ATTENTION : seules les faces de forme triangles et quadrangles sont
+! ========= reconnues par le format ensight et donc enregistrees
+! dans debug1.geom !
+! Le format ensight gold reconnait toutes formes de faces
+! et doit etre utilise par defaut...
+
+
+ 300 continue
+
+#if DEBUG_LAGCEL
+
+if (ierr.eq.1) then
+
+
+!...FORMAT ENSIGHT
+
+
+ write(nfecra,9050)
+ OPEN (IMPLA1,FILE='debug1.geom', &
+ STATUS='UNKNOWN',FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL')
+
+ WRITE(IMPLA1,'(A)') 'geometrie debuggage'
+ WRITE(IMPLA1,'(A)') 'au format ensight6'
+ WRITE(IMPLA1,'(A)') 'node id given'
+ WRITE(IMPLA1,'(A)') 'element id given'
+ WRITE(IMPLA1,'(A)') 'coordinates'
+ WRITE(IMPLA1,'(I8)') 4*NQUAD4 + 3*NTRIA3 + 2
+
+ kpt = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.lt.5) then
+ do in = 1,nbp
+ kpt = max(kpt,iconfo(in))
+ WRITE(IMPLA1,'(I8,3E12.5)') ICONFO(IN), &
+ xyznod(1,iconfo(in)), &
+ xyznod(2,iconfo(in)), &
+ xyznod(3,iconfo(in))
+ enddo
+ endif
+ enddo
+
+ WRITE(IMPLA1,'(I8,3E12.5)') KPT + 1, &
+ ettpa(ip,jxp), &
+ ettpa(ip,jyp), &
+ ettpa(ip,jzp)
+
+ WRITE(IMPLA1,'(I8,3E12.5)') KPT + 2, &
+ ettp(ip,jxp), &
+ ettp(ip,jyp), &
+ ettp(ip,jzp)
+
+ WRITE(IMPLA1,'(A)') 'part 1'
+ WRITE(IMPLA1,'(A,I9)') 'detail particule ',IP
+ WRITE(IMPLA1,'(A)') 'bar2'
+ npt = 1
+ WRITE(IMPLA1,'(I8)') NPT
+ WRITE(IMPLA1,'(3I8)') NPT , KPT + 1 , KPT + 2
+
+ WRITE(IMPLA1,'(A)') 'part 2'
+ WRITE(IMPLA1,'(A)') 'faces'
+
+ if (ntria3.gt.0) then
+ WRITE(IMPLA1,'(A)') 'tria3'
+ WRITE(IMPLA1,'(I8)') NTRIA3
+ endif
+
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (ifac.lt.0) ifac = -ifac
+ if (nbp.eq.3) then
+ WRITE(IMPLA1,'(4I8)') &
+ ifac , ( iconfo(in) , in=1,nbp )
+ endif
+ enddo
+
+ if (nquad4.gt.0) then
+ WRITE(IMPLA1,'(A)') 'quad4'
+ WRITE(IMPLA1,'(I8)') NQUAD4
+ endif
+
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (ifac.lt.0) ifac = -ifac
+ if (nbp.eq.4) then
+ WRITE(IMPLA1,'(5I8)') &
+ ifac , ( iconfo(in) , in=1,nbp )
+ endif
+ enddo
+
+ close(impla1)
+
+
+ write(nfecra,9055)
+ OPEN (IMPLA1,FILE='debug1.CASE', &
+ STATUS='UNKNOWN',FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL')
+ WRITE(IMPLA1,'(A)') 'FORMAT'
+ WRITE(IMPLA1,'(A)') 'type: ensight'
+ WRITE(IMPLA1,'(A)') 'GEOMETRY'
+ WRITE(IMPLA1,'(A)') 'model: debug1.geom'
+ close(impla1)
+
+
+!...FORMAT ENSIGHT GOLD
+
+!-> Ouverture
+
+ write(nfecra,9060)
+ OPEN (IMPLA1,FILE='debug2.geom', &
+ STATUS='UNKNOWN',FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL')
+
+!-> Entete
+
+ WRITE(IMPLA1,'(A)') 'geometrie debuggage'
+ WRITE(IMPLA1,'(A)') 'au format ensight gold'
+ WRITE(IMPLA1,'(A)') 'node id given'
+ WRITE(IMPLA1,'(A)') 'element id given'
+
+!-> Id des points du segment de trajectoire
+
+ kpt = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ do in = 1,nbp
+ kpt = max(kpt,iconfo(in))
+ enddo
+ enddo
+
+!-> Part de la trajectoire
+
+ ipart = 1
+ WRITE(IMPLA1,'(A)') 'part'
+ WRITE(IMPLA1,'(I10)') IPART
+ WRITE(IMPLA1,'(A,I9)') 'detail particule ',IP
+ WRITE(IMPLA1,'(A)') 'coordinates'
+ npt = 2
+ WRITE(IMPLA1,'(I10)') NPT
+ WRITE(IMPLA1,'(I10)') KPT + 1
+ WRITE(IMPLA1,'(I10)') KPT + 2
+ do in = 0,2
+ WRITE(IMPLA1,'(E12.5)') ETTPA(IP,JXP+IN)
+ WRITE(IMPLA1,'(E12.5)') ETTP(IP,JXP+IN)
+ enddo
+
+ WRITE(IMPLA1,'(A)') 'bar2'
+ npt = 1
+ kpt = 2
+ WRITE(IMPLA1,'(I10)') NPT
+ WRITE(IMPLA1,'(I10)') IP
+ WRITE(IMPLA1,'(2I10)') NPT,KPT
+
+!-> Part des triangles
+
+ if (ntria3.gt.0) then
+ ipart = ipart+1
+ WRITE(IMPLA1,'(A)') 'part'
+ WRITE(IMPLA1,'(I10)') IPART
+ WRITE(IMPLA1,'(A)') 'faces triangles'
+ WRITE(IMPLA1,'(A)') 'coordinates'
+ WRITE(IMPLA1,'(I10)') NTRIA3*3
+
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.eq.3) then
+ do in = 1,nbp
+ WRITE(IMPLA1,'(I10)') ICONFO(IN)
+ enddo
+ endif
+ enddo
+ do in = 1,3
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (nbp.eq.3) then
+ do ii = 1,nbp
+ WRITE(IMPLA1,'(E12.5)') XYZNOD(IN,ICONFO(II))
+ enddo
+ endif
+ enddo
+ enddo
+
+ WRITE(IMPLA1,'(A)') 'tria3'
+ WRITE(IMPLA1,'(I10)') NTRIA3
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (ifac.lt.0) ifac = -ifac
+ IF (NBP.EQ.3) WRITE(IMPLA1,'(I10)') IFAC
+ enddo
+ kpt = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.eq.3) then
+ WRITE(IMPLA1,'(3I10)') KPT+1,KPT+2,KPT+3
+ kpt = kpt+3
+ endif
+ enddo
+ endif
+
+!-> Part des quadrangles
+
+ if (nquad4.gt.0) then
+ ipart = ipart+1
+ WRITE(IMPLA1,'(A)') 'part'
+ WRITE(IMPLA1,'(I10)') IPART
+ WRITE(IMPLA1,'(A)') 'faces quadrangles'
+ WRITE(IMPLA1,'(A)') 'coordinates'
+ WRITE(IMPLA1,'(I10)') NQUAD4*4
+
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.eq.4) then
+ do in = 1,nbp
+ WRITE(IMPLA1,'(I10)') ICONFO(IN)
+ enddo
+ endif
+ enddo
+ do in = 1,3
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (nbp.eq.4) then
+ do jj = 1,nbp
+ WRITE(IMPLA1,'(E12.5)') XYZNOD(IN,ICONFO(JJ))
+ enddo
+ endif
+ enddo
+ enddo
+
+ WRITE(IMPLA1,'(A)') 'quad4'
+ WRITE(IMPLA1,'(I10)') NQUAD4
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (ifac.lt.0) ifac = -ifac
+ IF (NBP.EQ.4) WRITE(IMPLA1,'(I10)') IFAC
+ enddo
+ kpt = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.eq.4) then
+ WRITE(IMPLA1,'(4I10)') KPT+1,KPT+2,KPT+3,KPT+4
+ kpt = kpt+4
+ endif
+ enddo
+ endif
+
+!-> Part des Polygones
+
+ if (nsided.gt.0) then
+ ipart = ipart+1
+ WRITE(IMPLA1,'(A)') 'part'
+ WRITE(IMPLA1,'(I10)') IPART
+ WRITE(IMPLA1,'(A)') 'faces polygones'
+ WRITE(IMPLA1,'(A)') 'coordinates'
+
+ kpt = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.ge.5) kpt = kpt + nbp
+ enddo
+ WRITE(IMPLA1,'(I10)') KPT
+
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.ge.5) then
+ do in = 1,nbp
+ WRITE(IMPLA1,'(I10)') ICONFO(IN)
+ enddo
+ endif
+ enddo
+ do in = 1,3
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (nbp.ge.5) then
+ do jj = 1,nbp
+ WRITE(IMPLA1,'(E12.5)') XYZNOD(IN,ICONFO(JJ))
+ enddo
+ endif
+ enddo
+ enddo
+
+ WRITE(IMPLA1,'(A)') 'nsided'
+ WRITE(IMPLA1,'(I10)') NSIDED
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (ifac.lt.0) ifac = -ifac
+ IF (NBP.GE.5) WRITE(IMPLA1,'(I10)') IFAC
+ enddo
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ IF (NBP.GE.5) WRITE(IMPLA1,'(I10)') NBP
+ enddo
+ kpt = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(in),in = 1,nbp)
+ if (nbp.ge.5) then
+ WRITE(IMPLA1,'(100I10)') (KPT+II,II = 1,NBP)
+ kpt = kpt+nbp
+ endif
+ enddo
+ endif
+
+!-> Part des points supplementaires (CDG faces et CDG cellules)
+
+
+ ipart = ipart + 1
+ WRITE(IMPLA1,'(A)') 'part'
+ WRITE(IMPLA1,'(I10)') IPART
+ WRITE(IMPLA1,'(A)') 'CDG faces et CDG cellules'
+ WRITE(IMPLA1,'(A)') 'coordinates'
+
+ kpt = 0
+ ielold = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (iel.ne.ielold) then
+ ielold = iel
+ kpt = kpt + 1
+ endif
+ enddo
+ WRITE(IMPLA1,'(I10)') NQUAD4 + NTRIA3 + NSIDED + KPT
+
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (ifac.gt.0) then
+ WRITE(IMPLA1,'(I10)') IFAC
+ else if (ifac.lt.0) then
+ WRITE(IMPLA1,'(I10)') -IFAC
+ endif
+ enddo
+
+ ielold = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (iel.ne.ielold) then
+ ielold = iel
+ WRITE(IMPLA1,'(I10)') IEL
+ endif
+ enddo
+
+ do ip = 1,3
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (ifac.gt.0) then
+ WRITE(IMPLA1,'(E12.5)') CDGFAC(IP,IFAC)
+ else if (ifac.lt.0) then
+ WRITE(IMPLA1,'(E12.5)') CDGFBO(IP,-IFAC)
+ endif
+ enddo
+ ielold = 0
+ rewind(impla4)
+ do ipt = 1, nquad4 + ntria3 + nsided
+ read(impla4) nbp, ifac, iel, (iconfo(ii),ii = 1,nbp)
+ if (iel.ne.ielold) then
+ ielold = iel
+ WRITE(IMPLA1,'(E12.5)') XYZCEN(IP,IEL)
+ endif
+ enddo
+ enddo
+
+!-> Fermeture du fichier geometrique
+
+ close(impla1)
+
+!-> Ecriture du fichier CASE
+
+ write(nfecra,9065)
+ OPEN (IMPLA1,FILE='debug2.CASE', &
+ STATUS='UNKNOWN',FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL')
+ WRITE(IMPLA1,'(A)') 'FORMAT'
+ WRITE(IMPLA1,'(A)') 'type: ensight gold'
+ WRITE(IMPLA1,'(A)') 'GEOMETRY'
+ WRITE(IMPLA1,'(A)') 'model: debug2.geom'
+ close(impla1)
+
+endif
+
+close(impla4)
+
+if (ierr.eq.1) then
+ write(nfecra,9100)
+ return
+endif
+
+write(nfecra,9999) ierrie , ierr
+call csexit (1)
+!==========
+
+#endif
+
+!--------
+! FORMATS
+!--------
+
+ 8010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ L''INDICATEUR DE SUIVI DE PARTICULE DANS LE MAILLAGE ',/,&
+'@ APRES INTERACTION AVEC LA FRONTIERE NB = ',I10 ,/,&
+'@ A UNE VALEUR NON PERMISE (LAGCEL). ',/,&
+'@ ',/,&
+'@ ISUIVI DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ISUIVI = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ISUIVI dans la subroutine USLABO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#if DEBUG_LAGCEL
+ 9001 format(3X,'@@ Particule N�',I6,' >> cellule de depart : ',I7)
+
+ 9002 format(3X,'@@ Particule N�',I6,' > face de bord : ',I7 &
+ ,' REPERE = ',I2)
+
+ 9003 format(3X,'@@ Interaction frontiere -> face de bord : ',I7)
+
+ 9004 format(3X,'@@ Particule N�',I6,' > face interne : ',I7 &
+ ,' REPERE = ',I2)
+
+ 9005 format(3X,'@@ Particule N�',I6,' >> cellule d''arrive : ',I7,/)
+
+
+ 9050 format(/3X,'** ECRITURE DU FICHIER debug1.geom ', &
+ /3X,' AU FORMAT ENSIGHT6')
+
+ 9055 format(/3X,'** ECRITURE DU FICHIER debug1.CASE ', &
+ /3X,' AU FORMAT ENSIGHT6')
+
+ 9060 format(/3X,'** ECRITURE DU FICHIER debug2.geom ', &
+ /3X,' AU FORMAT ENSIGHT GOLD')
+
+ 9065 format(/3X,'** ECRITURE DU FICHIER debug2.CASE ', &
+ /3X,' AU FORMAT ENSIGHT GOLD',/)
+
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS LE REPERAGE D''UNE PARTICULE ',/,&
+'@ ========= (LAGCEL) ',/,&
+'@ ',/,&
+'@ Les fichiers debug1.CASE et debug2.CASE peuvent fournir ',/,&
+'@ une explication de la cause de cet echec de ',/,&
+'@ l''algorithme. ',/,&
+'@ La cause la plus probable est la presence d''une face ',/,&
+'@ non plane dans le maillage (due a un recollement ',/,&
+'@ par exemple). ',/,&
+'@ ',/,&
+'@ Choisir de preference le fichier debug2.CASE ',/,&
+'@ au format ensight gold, celui-ci contient plus ',/,&
+'@ d''inforamtion que debug1.CASE au format ensight6. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute en mode sans erreur. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+#endif
+
+ 9101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS LE REPERAGE D''UNE PARTICULE ',/,&
+'@ ========= (LAGCEL) ',/,&
+'@ ',/,&
+'@ ECHEC DE REPERAGE SUR LA FACE ',I10 ,/,&
+'@ POUR LA PARTICULE ',I10 ,/,&
+'@ ',/,&
+'@ Explication possible : le reperage echoue lorsque la ',/,&
+'@ position d''arrive de la particule fait partie du ',/,&
+'@ plan de la face. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute en mode sans erreur. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9102 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS LE REPERAGE D''UNE PARTICULE ',/,&
+'@ ========= (LAGCEL) ',/,&
+'@ ',/,&
+'@ AUCUNE FACE ENTOURANT LA CELLULE ',I10 ,/,&
+'@ N''EST TRAVERSEE PAR LA DROITE PASSANT PAR LES POINTS ',/,&
+'@ DE DEPART ET D''ARRIVEE DE LA PARTICULE ',I10 ,/,&
+'@ ',/,&
+'@ Explication possible : mauvais traitement d''une ',/,&
+'@ cellule concave (amelioration a venir). ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute en mode sans erreur. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9103 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS LE REPERAGE D''UNE PARTICULE ',/,&
+'@ ========= (LAGCEL) ',/,&
+'@ ',/,&
+'@ ECHEC DE REPERAGE POUR LA PARTICULE ',I10 ,/,&
+'@ TROP DE CELLULES PARCOURUES ',/,&
+'@ ',/,&
+'@ Explication possible : mauvais traitement d''une ',/,&
+'@ cellule concave (amelioration a venir). ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute en mode sans erreur. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+#if DEBUG_LAGCEL
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS LE REPERAGE D''UNE PARTICULE ',/,&
+'@ ========= (LAGCEL) ',/,&
+'@ ',/,&
+'@ LA DETECTION DE LA TRAJECTOIRE DE LA PARTICULE EST SORTIE ',/,&
+'@ EN ERREUR (MODE SANS ERREUR ENCLENCHE AVEC ',/,&
+'@ IERRIE = ',I10,'), ',/,&
+'@ SANS QUE L''INDICATEUR D''ECRITURE DES FICHIERS DEBUG ',/,&
+'@ AIT ETE ACTIVE (IERR = ',I10,'). ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+#endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagcou.f90 b/src/lagr/lagcou.f90
new file mode 100644
index 0000000..e6e4ede
--- /dev/null
+++ b/src/lagr/lagcou.f90
@@ -0,0 +1,535 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagcou &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , indep , ibord , &
+ idevel , ituser , ia , &
+ volume , rtp , propce , &
+ ettp , ettpa , tepa , taup , tempct , tsfext , tslagr , &
+ cpgd1 , cpgd2 , cpght , &
+ tslag , volp , volm , &
+ auxl1 , auxl2 , auxl3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -----------------------------------
+
+! CALCUL DES TERMES SOURCES DU COUPLAGE RETOUR
+
+! Remarque : les termes sources sont calcules pour
+! la cellule de depart de la particule
+! lors de l'iteration courante. Attention, meme
+! si la particule est sortante du domaine de
+! calcul (peu importe la maniere) on doit calculer
+! un terme source qui correspond a ce qu'echange le
+! fluide porteur et la particule au debut du pas de
+! temps. Si NORDRE = 2 et que la particule est en
+! interaction avec la frontiere, alors les termes
+! source sont calcules comme si NORDRE=1
+! (on oublie le pre-remplissage de TSFEXT dans
+!ONFC LAGES2).
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! indep ! te ! <-- ! pour chaque particule : !
+! (nbpmax) ! ! ! numero de la cellule de depart !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tsfext(nbpmax ! tr ! <-- ! forces externes !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tslagr(nbpmax ! tr ! --> ! termes sources de couplage retour !
+! ntersl) ! ! ! !
+! cpgd1,cpgd2, ! tr ! <-- ! termes de devolatilisation 1 et 2 et !
+! cpght(nbpmax ! ! ! de combusion heterogene (charbon !
+! ! ! ! avec couplage retour thermique) !
+! tslag(nbpmax, ! tr ! --- ! tableau de travail !
+! ntersl) ! ! ! !
+! volp(ncelet) ! tr ! --- ! fraction volumique des particules !
+! volm(ncelet) ! tr ! --- ! fraction massique des particules !
+! auxl1(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl2(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl3(nbpmax) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep), indep(nbpmax), ibord(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision volume(ncelet) , propce(ncelet,*) , rtp(ncelet,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tempct(nbpmax,2)
+double precision tsfext(nbpmax)
+double precision cpgd1(nbpmax) , cpgd2(nbpmax) , cpght(nbpmax)
+double precision tslag(ncelet,ntersl)
+double precision volp(ncelet) , volm(ncelet)
+double precision tslagr(ncelet,ntersl)
+double precision auxl1(nbpmax) , auxl2(nbpmax) , auxl3(nbpmax)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer npt , iel , ivar , icha , iphas
+double precision tvmax , tauv , taum , aux1
+double precision uuf , vvf , wwf , mf
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+iphas = ilphas
+
+tvmax = 0.8d0
+
+! Nombre de passage pour les termes sources en stationnaire
+
+if (isttio.eq.1 .and. iplas.ge.nstits) npts = npts + 1
+
+ntxerr = 0
+vmax = 0.d0
+tmamax = 0.d0
+
+do iel=1,ncel
+ volp(iel) = 0.d0
+ volm(iel) = 0.d0
+enddo
+
+do ivar = 1,ntersl
+ do iel = 1,ncel
+ tslag(iel,ivar) = 0.d0
+ enddo
+enddo
+
+!===============================================================================
+! 2. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! Finalisation des forces externes (Si la particule a interagit avec
+! une frontiere du domaine de calcul, on degenere a l'ordre 1).
+
+
+do npt = 1,nbpart
+ aux1 = dtp/taup(npt)
+ if (nordre.eq.1 .or. ibord(npt).gt.0) then
+ tsfext(npt)= (1.d0-exp(-aux1)) *ettp(npt,jmp) *taup(npt)
+ else
+ tsfext(npt) = tsfext(npt) &
+ + (1.d0- (1.d0-exp(-aux1)) /aux1 ) * taup(npt) &
+ * ettp(npt,jmp)
+ endif
+enddo
+
+do npt = 1,nbpart
+ auxl1(npt) = tepa(npt,jrpoi)* &
+ ( ettp(npt,jmp) * ettp(npt,jup) &
+ -ettpa(npt,jmp) * ettpa(npt,jup) &
+ -gx*tsfext(npt) ) / dtp
+ auxl2(npt) = tepa(npt,jrpoi)* &
+ ( ettp(npt,jmp) * ettp(npt,jvp) &
+ -ettpa(npt,jmp)* ettpa(npt,jvp) &
+ -gy*tsfext(npt) ) / dtp
+ auxl3(npt) = tepa(npt,jrpoi)* &
+ ( ettp(npt,jmp) * ettp(npt,jwp) &
+ -ettpa(npt,jmp)* ettpa(npt,jwp) &
+ -gz*tsfext(npt) ) / dtp
+enddo
+
+!===============================================================================
+! 3. TERMES SOURCES DE QUANTITE DE MOUVEMENT
+!===============================================================================
+
+if (ltsdyn.eq.1) then
+
+ do npt = 1,nbpart
+
+ iel = indep(npt)
+
+! Volume et masse des particules dans la maille
+
+ volp(iel) = volp(iel) &
+ + tepa(npt,jrpoi)*pi*(ettpa(npt,jdp)**3)/6.d0
+ volm(iel) = volm(iel) &
+ + tepa(npt,jrpoi)*ettpa(npt,jmp)
+
+! TS de QM
+
+ tslag(iel,itsvx) = tslag(iel,itsvx) - auxl1(npt)
+ tslag(iel,itsvy) = tslag(iel,itsvy) - auxl2(npt)
+ tslag(iel,itsvz) = tslag(iel,itsvz) - auxl3(npt)
+ tslag(iel,itsli) = tslag(iel,itsli) &
+ - 2.d0*tepa(npt,jrpoi)*ettp(npt,jmp) &
+ / taup(npt)
+
+ enddo
+
+!===============================================================================
+! 4. TERMES SOURCES SUR LA TURBULENCE
+!===============================================================================
+
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60 ) then
+! En v2f (ITURB=50) les TS lagrangiens influent uniquement sur k et eps
+! (difficile d'ecrire quoi que ce soit sur v2, qui perd son sens de
+! "composante de Rij")
+
+ do npt = 1,nbpart
+
+ iel = indep(npt)
+
+ uuf = 0.5d0 * ( ettpa(npt,juf) + ettp(npt,juf) )
+ vvf = 0.5d0 * ( ettpa(npt,jvf) + ettp(npt,jvf) )
+ wwf = 0.5d0 * ( ettpa(npt,jwf) + ettp(npt,jwf) )
+
+ tslag(iel,itske) = tslag(iel,itske) &
+ - uuf * auxl1(npt) &
+ - vvf * auxl2(npt) &
+ - wwf * auxl3(npt)
+
+ enddo
+
+ do iel = 1,ncel
+
+ tslag(iel,itske) = tslag(iel,itske) &
+ - ettp(npt,juf) * tslag(iel,itsvx) &
+ - ettp(npt,jvf) * tslag(iel,itsvy) &
+ - ettp(npt,jwf) * tslag(iel,itsvz)
+
+ enddo
+
+ else if (itytur(iphas).eq.3) then
+
+ do npt = 1,nbpart
+
+ iel = indep(npt)
+
+ uuf = 0.5d0 * ( ettpa(npt,juf) + ettp(npt,juf) )
+ vvf = 0.5d0 * ( ettpa(npt,jvf) + ettp(npt,jvf) )
+ wwf = 0.5d0 * ( ettpa(npt,jwf) + ettp(npt,jwf) )
+
+ tslag(iel,itsr11) = tslag(iel,itsr11) &
+ - 2.d0 * uuf * auxl1(npt)
+
+ tslag(iel,itsr12) = tslag(iel,itsr12) &
+ - uuf * auxl2(npt) &
+ - vvf * auxl1(npt)
+
+ tslag(iel,itsr13) = tslag(iel,itsr13) &
+ - uuf * auxl3(npt) &
+ - wwf * auxl1(npt)
+
+ tslag(iel,itsr22) = tslag(iel,itsr22) &
+ - 2.d0 * vvf * auxl2(npt)
+
+ tslag(iel,itsr23) = tslag(iel,itsr23) &
+ - vvf * auxl3(npt) &
+ - wwf * auxl2(npt)
+
+ tslag(iel,itsr33) = tslag(iel,itsr33) &
+ - 2.d0 * wwf * auxl3(npt)
+
+ enddo
+
+ do iel = 1,ncel
+
+ tslag(iel,itsr11) = tslag(iel,itsr11) &
+ - 2.d0 * rtp(iel,iu(iphas)) * tslag(iel,itsvx)
+
+ tslag(iel,itsr12) = tslag(iel,itsr12) &
+ - rtp(iel,iu(iphas)) * tslag(iel,itsvy) &
+ - rtp(iel,iv(iphas)) * tslag(iel,itsvx)
+
+ tslag(iel,itsr13) = tslag(iel,itsr13) &
+ - rtp(iel,iu(iphas)) * tslag(iel,itsvz) &
+ - rtp(iel,iw(iphas)) * tslag(iel,itsvx)
+
+ tslag(iel,itsr22) = tslag(iel,itsr22) &
+ - 2.d0 * rtp(iel,iv(iphas)) * tslag(iel,itsvy)
+
+ tslag(iel,itsr23) = tslag(iel,itsr23) &
+ - rtp(iel,iv(iphas)) * tslag(iel,itsvz) &
+ - rtp(iel,iw(iphas)) * tslag(iel,itsvy)
+
+ tslag(iel,itsr33) = tslag(iel,itsr33) &
+ - 2.d0 * rtp(iel,iw(iphas)) * tslag(iel,itsvz)
+
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 5. TERME SOURCE MASSIQUES
+!===============================================================================
+
+if ( ltsmas.eq.1 .and. (impvar.eq.1 .or. idpvar.eq.1) ) then
+
+ do npt = 1,nbpart
+
+! Dans saturne TSmasse > 0 ===> Apport de masse sur le fluide
+
+ iel = indep(npt)
+
+ tslag(iel,itsmas) = tslag(iel,itsmas) - tepa(npt,jrpoi) &
+ * ( ettp(npt,jmp) - ettpa(npt,jmp) ) /dtp
+
+ enddo
+
+endif
+
+!===============================================================================
+! 6. TERMES SOURCES THERMIQUE
+!===============================================================================
+
+if (ltsthe.eq.1) then
+
+ if (iphyla.eq.1 .and. itpvar.eq.1) then
+
+ do npt = 1,nbpart
+
+ iel = indep(npt)
+
+ tslag(iel,itste) = tslag(iel,itste) &
+ -( ettp(npt,jmp) *ettp(npt,jtp) *ettp(npt,jcp) &
+ -ettpa(npt,jmp) *ettpa(npt,jtp) &
+ *ettpa(npt,jcp) ) / dtp * tepa(npt,jrpoi)
+
+ tslag(iel,itsti) = tslag(iel,itsti) &
+ + tempct(npt,2) * tepa(npt,jrpoi)
+
+ enddo
+
+ if (iirayo.gt.0) then
+
+ do npt = 1,nbpart
+
+ iel = indep(npt)
+
+ aux1 = pi *ettp(npt,jdp) *ettp(npt,jdp) *tepa(npt,jreps) &
+ *(propce(iel,ipproc(ilumin)) &
+ -4.d0 *stephn *ettp(npt,jtp)**4 )
+
+ tslag(iel,itste) =tslag(iel,itste)+aux1*tepa(npt,jrpoi)
+
+ enddo
+
+ endif
+
+ else if (iphyla.eq.2) then
+
+ do npt = 1,nbpart
+
+ iel = indep(npt)
+ icha = itepa(npt,jinch)
+
+ tslag(iel,itste) = tslag(iel,itste) &
+ -( ettp(npt,jmp) *ettp(npt,jhp) &
+ *ettp(npt,jcp) &
+ -ettpa(npt,jmp)*ettpa(npt,jhp) &
+ *ettpa(npt,jcp) ) &
+ /dtp*tepa(npt,jrpoi)
+
+ tslag(iel,itsti) = tslag(iel,itsti) &
+ + tempct(npt,2) * tepa(npt,jrpoi)
+
+ tslag(iel,itsmv1(icha)) = tslag(iel,itsmv1(icha)) &
+ + tepa(npt,jrpoi) * cpgd1(npt)
+
+ tslag(iel,itsmv2(icha)) = tslag(iel,itsmv2(icha)) &
+ + tepa(npt,jrpoi) * cpgd2(npt)
+
+ tslag(iel,itsco) = tslag(iel,itsco) &
+ + tepa(npt,jrpoi) * cpght(npt)
+
+ tslag(iel,itsfp4) = 0.d0
+
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 7. Verif que le taux volumique maximal TVMAX admissible de particules
+! ne soit pas depasse dans quelques cellules.
+!===============================================================================
+
+do iel = 1,ncel
+
+ mf = volume(iel) * propce(iel,ipproc(irom(iphas)))
+ tauv = volp(iel) / volume(iel)
+ taum = volm(iel) / mf
+
+ if (tauv.gt.tvmax) then
+
+ ntxerr = ntxerr + 1
+
+ do ivar =1,ntersl
+ tslagr(iel,ivar) = 0.d0
+ enddo
+
+ endif
+
+ vmax = max(tauv,vmax)
+ tmamax = max(tmamax,taum)
+
+enddo
+
+!===============================================================================
+! 8. MOYENNE TEMPORELLE DES TERMES SOURCES
+!===============================================================================
+
+if (isttio.eq.1 .and. npts.gt.0) then
+
+ do ivar = 1,ntersl
+ do iel = 1,ncel
+ tslagr(iel,ivar) = &
+ ( tslag(iel,ivar) + (npts-1.d0)*tslagr(iel,ivar) ) / dble(npts)
+ enddo
+ enddo
+
+else
+
+ do ivar = 1,ntersl
+ do iel = 1,ncel
+ tslagr(iel,ivar) = tslag(iel,ivar)
+ enddo
+ enddo
+
+endif
+
+!===============================================================================
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagdeb.f90 b/src/lagr/lagdeb.f90
new file mode 100644
index 0000000..d6ff6ac
--- /dev/null
+++ b/src/lagr/lagdeb.f90
@@ -0,0 +1,423 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagdeb &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icocel , itycel , &
+ idevel , ituser , ia , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Ce sous-programme est lu lors du premier passage dans le module
+! Lagrangien (IPLAR=1).
+
+! Construction du stockage compact (tableaux "positions"/"valeurs")
+! des connectivites cellules -> faces
+! (pour tous formats de maillage).
+! On part des connectivites faces->cellule IFACEL et IFABOR.
+! Les faces de bord sont stockees avec un numero negatif.
+
+
+! On rappelle que la lecture des connectivites face->sommets
+! pour un maillage .slc est faite dans LAGGET, appelee par LETGEO.
+
+
+
+! ----------------------------------------------------------------
+! Schema d'association entre les tableaux ITYCEL "positions"
+! et ICOCEL "valeurs"
+! ----------------------------------------------------------------
+
+
+! Tableau des valeurs ICOCEL (de dimension LNDNOD)
+
+
+! .---.------..------.------.------..------.------..------.------.
+! | | ... ||IFACn | ... | || IFACm| ... || ... | |
+! `---'------'`------'------'------'`------'------'`------'------'
+! 1 iVal jVal-1 jVal LNDNOD
+! | | |
+! | | |
+! `----------. .---' .------------'
+! | | |
+! | | |
+! .-----.-------.------.------.-------.------.--------.
+! | 1 | ... | iVal | jVal | ... |LNDNOD|LNDNOD+1|
+! `-----'-------'------'------'-------'------'--------'
+! 1 iPos iPos+1 nPos-1 nPos=NCELET+1
+
+
+! Tableau des positions ITYCEL (de dimension NCELET+1)
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icocel ! te ! --> ! connectivite cellules -> faces !
+! (lndnod) ! ! ! face de bord si numero negatif !
+! itycel ! te ! --> ! connectivite cellules -> faces !
+! (ncelet+1) ! ! ! pointeur du tableau icocel !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer icocel(lndnod) , itycel(ncelet+1)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision rdevel(nrdeve) , rtuser(nrtuse) , ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+integer iel , ifac , ip , n1
+integer nbfac1 , nbfac2
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. Connectivite cellules -> faces
+! Les faces de bord sont stockees avec des valeurs negatives
+!===============================================================================
+
+!-->Initialisation
+
+do n1 = 1,ncelet+1
+ itycel(n1) = 0
+enddo
+do n1 = 1,lndnod
+ icocel(n1) = 0
+enddo
+
+!-->Premier passage : on compte le nombre de faces par cellules
+
+do ifac = 1,nfac
+ do ip = 1,2
+ iel = ifacel(ip,ifac)
+ itycel(iel) = itycel(iel) + 1
+ enddo
+enddo
+
+do ifac = 1,nfabor
+ iel = ifabor(ifac)
+ itycel(iel) = itycel(iel) + 1
+enddo
+
+!-->Verification
+
+ip = 0
+do iel = 1,ncelet
+ ip = ip + itycel(iel)
+enddo
+if (ip.ne.lndnod) then
+ write(nfecra,5000) lndnod , ip
+ call csexit (1)
+endif
+
+!-->Deuxieme passage : on calcule les positions du tableau ICOCEL
+
+nbfac2 = itycel(1)
+itycel(1) = 1
+do iel = 2, ncelet+1
+ nbfac1 = nbfac2
+ nbfac2 = itycel(iel)
+ itycel(iel) = itycel(iel-1) + nbfac1
+enddo
+
+!-->Verification
+
+if (itycel(ncelet+1).ne.lndnod+1) then
+ write(nfecra,1000) itycel(ncelet+1) , lndnod+1
+ call csexit (1)
+endif
+
+!-->Troisieme passage : on remplit le tableau de connectivites ICOCEL
+! Rem : les faces de bord sont stockees avec des valeurs negatives
+
+do ifac = 1,nfac
+ do ip = 1,2
+ iel = ifacel(ip,ifac)
+ n1 = itycel(iel)
+ do while (icocel(n1).ne.0)
+ n1 = n1 + 1
+ if (n1.eq.itycel(iel+1)) then
+ write(nfecra,2000)
+ call csexit (1)
+ endif
+ enddo
+ icocel(n1) = ifac
+ enddo
+enddo
+
+do ifac = 1,nfabor
+ iel = ifabor(ifac)
+ n1 = itycel(iel)
+ do while (icocel(n1).ne.0)
+ n1 = n1 + 1
+ if (n1.eq.itycel(iel+1)) then
+ write(nfecra,3000)
+ call csexit (1)
+ endif
+ enddo
+ icocel(n1) = -ifac
+enddo
+
+!-->Archive : ancienne version du 3e passage NE PAS SUPPRIMER SVP
+! Attention ne marche pas dans le cas de la TURBINE,
+! peut-etre a cause du fait que deux cellules ont en commun
+! plusieurs faces
+
+! N1 = 0
+! DO IEL = 1,NCEL
+! DO IFAC = 1,NFAC
+! DO IP = 1,2
+! IF (IFACEL(IP,IFAC).EQ.IEL) THEN
+! N1 = N1 + 1
+! ICOCEL(N1) = ICOCEL(N1) - IFAC
+! ENDIF
+! ENDDO
+! ENDDO
+! DO IFAC = 1,NFABOR
+! IF (IFABOR(IFAC).EQ.IEL) THEN
+! N1 = N1 + 1
+! ICOCEL(N1) = ICOCEL(N1) - IFAC
+! ENDIF
+! ENDDO
+! ENDDO
+
+
+!-->Verification
+
+do n1 = 1,lndnod
+ if (icocel(n1).eq.0) then
+ write(nfecra,4000)
+ call csexit (1)
+ endif
+enddo
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ Erreur dans la construction de la connectivite ',/,&
+'@ cellules -> faces (LAGDEB) ',/,&
+'@ ',/,&
+'@ Mauvais remplissage de ITYCEL : le dernier ',/,&
+'@ element de ITYCEL ne vaut pas LNDNOD+1 ',/,&
+'@ ',/,&
+'@ ITYCEL(NCELET+1) = ',I10 ,/,&
+'@ LNDNOD+1 = ',I10 ,/,&
+'@ ',/,&
+'@ Verifier le remplissage de ITYCEL dans LAGDEB ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ Erreur dans la construction de la connectivite ',/,&
+'@ cellules -> faces (LAGDEB) ',/,&
+'@ ',/,&
+'@ Mauvais remplissage de ITYCEL avec les faces internes ',/,&
+'@ ',/,&
+'@ Verifier le remplissage de ITYCEL dans LAGDEB ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ Erreur dans la construction de la connectivite ',/,&
+'@ cellules -> faces (LAGDEB) ',/,&
+'@ ',/,&
+'@ Mauvais remplissage de ITYCEL avec les faces de bord ',/,&
+'@ ',/,&
+'@ Verifier le remplissage de ITYCEL dans LAGDEB ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ Erreur dans la construction de la connectivite ',/,&
+'@ cellules -> faces (LAGDEB) ',/,&
+'@ ',/,&
+'@ Mauvais remplissage de ICOCEL ',/,&
+'@ (ICOCEL contient au moins une valeur nulle) ',/,&
+'@ ',/,&
+'@ Verifier le remplissage de ICOCEL dans LAGDEB ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 5000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ Erreur dans la construction de la connectivite ',/,&
+'@ cellules -> faces (LAGDEB) ',/,&
+'@ ',/,&
+'@ La taille du tableau ICOCEL n''est plus identique a ',/,&
+'@ celle calculee dans LAGINI ',/,&
+'@ ',/,&
+'@ - LAGINI : LNDNOD = ',I10 ,/,&
+'@ - LAGDEB : LNDNOD = ',I10 ,/,&
+'@ ',/,&
+'@ Verifier le calcul de LNDNOD dans LAGINI et LAGDEB ',/,&
+'@ ou l''integrite des tableaux IFACEL et IFABOR ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/lagr/lageli.f90 b/src/lagr/lageli.f90
new file mode 100644
index 0000000..18f18f0
--- /dev/null
+++ b/src/lagr/lageli.f90
@@ -0,0 +1,210 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lageli &
+!================
+
+! -------------------------------------------------
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ npars , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , idevel , ituser , ia , &
+ dnpars , &
+ ettp , ettpa , tepa , rdevel , rtuser , ra )
+! -------------------------------------------------
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! ELIMINATION DES PARTICULES QUI SONT SORTIES DU DOMAIME
+! --> on gere la memoire pour eviter les places libres
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! npars ! e ! --> ! nombre max de particules sorties !
+! ! ! ! eliminees !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! dnpars ! e ! --> ! nombre max de particules sorties !
+! ! ! ! eliminees (poids stat inclus) !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!==============================================================================
+
+! Arguments
+
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer npars
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision dnpars
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer nbp , npt , i , ivar
+double precision dnbp
+
+!===============================================================================
+
+nbp = nbpart
+dnbp = dnbpar
+
+npars = 0
+dnpars = 0.d0
+
+do npt = nbpart,1,-1
+
+ if (nbpart.lt.1) then
+ WRITE(NFECRA,*) ' erreur lageli '
+ endif
+
+ if (itepa(npt,jisor).eq.0) then
+
+ npars = npars + 1
+ dnpars = dnpars + tepa(nbp,jrpoi)
+
+! ---> la particule est sortie du domaine
+
+ if (npt.eq.nbp) then
+
+! ---> c'est la derniere particule, on la supprime seulement
+
+ nbp = nbp - 1
+ dnbp = dnbp - tepa(nbp,jrpoi)
+
+ do i = 1,nliste
+ if ( liste(i).eq.npt ) then
+ liste(i) = -1
+ endif
+ enddo
+
+ else
+
+! ---> la particule NPT est supprime et on met a la place la
+! particule NBP
+
+ do ivar = 1,nvp
+ ettp(npt,ivar) = ettp(nbp,ivar)
+ enddo
+
+ do ivar = 1,nvp
+ ettpa(npt,ivar) = ettpa(nbp,ivar)
+ enddo
+
+ do ivar = 1,nvep
+ tepa(npt,ivar) = tepa(nbp,ivar)
+ enddo
+
+ do ivar = 1,nivep
+ itepa(npt,ivar) = itepa(nbp,ivar)
+ enddo
+
+ do i = 1,nliste
+ if (liste(i).eq.npt) then
+ liste(i) = -1
+ endif
+ enddo
+
+ do i = 1,nliste
+ if (liste(i).eq.nbp) then
+ liste(i) = npt
+ endif
+ enddo
+
+ nbp = nbp - 1
+ dnbp = dnbp - tepa(nbp,jrpoi)
+
+ endif
+
+ endif
+
+enddo
+
+! ---> On met NBPART a la bonne valeur
+
+nbpart = nbp
+dnbpar = dnbp
+
+!===============================================================================
+
+!====
+! FIN
+!====
+
+end
diff --git a/src/lagr/lagent.f90 b/src/lagr/lagent.f90
new file mode 100644
index 0000000..8406a0b
--- /dev/null
+++ b/src/lagr/lagent.f90
@@ -0,0 +1,2145 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagent &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itycel , icocel , &
+ itypfb , itrifb , ifrlag , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , vagaus , auxl , w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Gestion de l'injection des particules dans le domaine de calcul
+
+! 1. initialisation par l'utilisateur via USLAG2
+! des classes de particules et du type d'interaction
+! particule/face de frontiere.
+
+! 2. injection des particules dans le domaine : initialisation
+! des tableau ETTP, ITEPA(IP,JISOR) et TEPA(IP,JRPOI).
+
+! 3. modification des conditions d'injection des particules :
+! retouche des ETTP, ITEPA(IP,JISOR) et TEPA(IP,JRPOI).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! -> ! longueur du tableau icocel
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icocel ! te ! <-- ! connectivite cellules -> faces !
+! (lndnod) ! ! ! face de bord si numero negatif !
+! itycel ! te ! <-- ! connectivite cellules -> faces !
+! (ncelet+1) ! ! ! pointeur du tableau icocel !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! itrifb(nfabor ! te ! <-- ! tab d'indirection pour tri des faces !
+! nphas) ! ! ! !
+! ifrlag ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module lagrangien !
+! itepa ! te ! --> ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! surfbn(nfabor ! tr ! <-- ! surface des faces de bord !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec ou !
+! ! ! ! instant courant si ntcabs = 1) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! vagaus ! tr ! --> ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! auxl(nbpmax,3 ! tr ! --- ! tableau de travail !
+! w1..w3(ncelet ! tr ! --- ! tableaux de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+include "radiat.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer icocel(lndnod) , itycel(ncelet+1)
+integer itepa(nbpmax,nivep) , ifrlag(nfabor)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision surfbn(nfabor)
+double precision dt(ncelet) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision vagaus(nbpmax,*)
+double precision auxl(nbpmax,3)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifinia, ifinra
+
+integer iel , ifac , iphas , ip , nb , nc, ii, ifvu
+integer iiwork , iok , n1 , nd , icha
+integer npt , nfin , npar1 , npar2 , mode , idvar
+integer maxelt, idbia1, ils
+
+double precision vn1 , vn2 , vn3 , pis6 , d3
+double precision dmasse , rd(1) , aa
+double precision xxpart , yypart , zzpart
+double precision tvpart , uupart , vvpart , wwpart
+double precision ddpart , ttpart
+double precision surf , volp , vitp
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! Init aberrante pour forcer l'utilisateur a mettre sa valeur
+
+iphas = ilphas
+
+pis6 = pi / 6.d0
+
+do nb = 1, nflagm
+ iusncl(nb) = 0
+ iusclb(nb) = 0
+enddo
+
+do nb = 1, nflagm
+ do nc = 1, nclagm
+ do nd = 1,ndlagm
+ ruslag(nc,nb,nd) = 0.d0
+ enddo
+ do nd = 1,ndlaim
+ iuslag(nc,nb,nd) = 0
+ enddo
+ enddo
+enddo
+
+do nb = 1, nflagm
+ do nc = 1, nclagm
+
+ iuslag(nc,nb,ijnbp) = 0
+ iuslag(nc,nb,ijfre) = 0
+ iuslag(nc,nb,iclst) = 0
+ iuslag(nc,nb,ijuvw) = -2
+ iuslag(nc,nb,ijprtp) = -2
+ iuslag(nc,nb,ijprdp) = -2
+ iuslag(nc,nb,ijprpd) = -2
+
+ ruslag(nc,nb,iuno) = -grand
+ ruslag(nc,nb,iupt) = -grand
+ ruslag(nc,nb,ivpt) = -grand
+ ruslag(nc,nb,iwpt) = -grand
+ ruslag(nc,nb,ipoit) = -grand
+
+ ruslag(nc,nb,idpt) = -grand
+ ruslag(nc,nb,ivdpt) = -grand
+ ruslag(nc,nb,iropt) = -grand
+
+ if ( iphyla.eq.1 ) then
+
+! Thermique
+
+ if ( itpvar.eq.1 ) then
+ ruslag(nc,nb,itpt) = -grand
+ ruslag(nc,nb,icpt) = -grand
+ ruslag(nc,nb,iepsi) = -grand
+ endif
+
+ else if ( iphyla .eq. 2 ) then
+
+! Charbon
+! (REM : le diametre du coeur retrecissant est calcule dans lagich.F)
+
+ iuslag(nc,nb,inuchl) = 0
+ ruslag(nc,nb,ihpt) = -grand
+ ruslag(nc,nb,imcht) = -grand
+ ruslag(nc,nb,imckt) = -grand
+ ruslag(nc,nb,icpt) = -grand
+
+ endif
+
+ enddo
+enddo
+
+do ifac = 1,nfabor
+ ifrlag(ifac) = 0
+enddo
+
+! Mise a zero des debits pour chaque zone de bord
+
+do nb = 1,nflagm
+ deblag(nb) = 0.d0
+enddo
+
+!===============================================================================
+! 2. Initialisation utilisateur par classe et par frontiere
+!===============================================================================
+
+maxelt = max(ncelet,nfac,nfabor)
+ils = idebia
+idbia1 = ils + maxelt
+call iasize('lagent', idbia1)
+!==========
+
+if (iihmpr.eq.1) then
+ call uilag2 &
+ !==========
+ ( nfabor, nozppm, nclagm, nflagm, nbclst, &
+ ientrl, isortl, idepo1, idepo2, idepo3, &
+ idepfa, iencrl, irebol, iphyla, &
+ ijnbp, ijfre, iclst, ijuvw, iuno, iupt, ivpt, iwpt, &
+ ijprpd, ipoit, idebt, ijprdp, idpt, ivdpt, &
+ iropt, ijprtp, itpt, icpt, iepsi, &
+ ihpt, inuchl, imcht, imckt, &
+ ichcor, cp2ch, diam20, rho0ch, xashch, &
+ ifrlag, iusncl, iusclb, iuslag, ruslag )
+endif
+
+call uslag2 &
+!==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 3. Controles
+!===============================================================================
+
+iok = 0
+
+! --> Les faces doivent toutes appartenir a une zone frontiere
+
+do ifac = 1, nfabor
+ if(ifrlag(ifac).le.0 .or. ifrlag(ifac).gt.nflagm) then
+ iok = iok + 1
+ write(nfecra,1000) ifac,nflagm,ifrlag(ifac)
+ endif
+enddo
+
+if (iok.gt.0) then
+ call csexit (1)
+ !==========
+endif
+
+! --> On construit une liste des numeros des zones frontieres.
+
+nfrlag = 0
+do ifac = 1, nfabor
+ ifvu = 0
+ do ii = 1, nfrlag
+ if (ilflag(ii).eq.ifrlag(ifac)) then
+ ifvu = 1
+ endif
+ enddo
+ if(ifvu.eq.0) then
+ nfrlag = nfrlag + 1
+ if(nfrlag.le.nflagm) then
+ ilflag(nfrlag) = ifrlag(ifac)
+ else
+ write(nfecra,1001) nfrlag
+ WRITE(NFECRA,'(I10)') (ILFLAG(II),II=1,NFRLAG)
+ call csexit (1)
+ !==========
+ endif
+ endif
+enddo
+
+! --> Nombre de classes.
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ if (iusncl(nb).lt.0 .or. iusncl(nb).gt.nclagm) then
+ iok = iok + 1
+ write(nfecra,1010) nb,nclagm,iusncl(nb)
+ endif
+enddo
+
+! --> Nombre de particules.
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ do nc = 1,iusncl(nb)
+ if ( iuslag(nc,nb,ijnbp).lt.0 .or. &
+ iuslag(nc,nb,ijnbp).gt.nbpmax ) then
+ iok = iok + 1
+ write(nfecra,1020) nc,nb,nbpmax,iuslag(nc,nb,ijnbp)
+ endif
+ enddo
+enddo
+
+! Verification des classes de particules : Uniquement un warning
+
+if (nbclst.gt.0 ) then
+ do ii = 1,nfrlag
+ nb = ilflag(ii)
+ do nc = 1,iusncl(nb)
+ if (iuslag(nc,nb,iclst).le.0 .or. &
+ iuslag(nc,nb,iclst).gt.nbclst ) then
+ write(nfecra,1021) nc,nb,nbclst,iuslag(nc,nb,iclst)
+ endif
+ enddo
+ enddo
+endif
+
+! --> Frequence d'injection.
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (iuslag(nc,nb,ijfre).lt.0) then
+ iok = iok + 1
+ write(nfecra,1030) nb,nc,iuslag(nc,nb,ijfre)
+ endif
+ enddo
+enddo
+
+! --> Conditions au bord.
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ if ( iusclb(nb).ne.ientrl .and. iusclb(nb).ne.isortl .and. &
+ iusclb(nb).ne.irebol .and. iusclb(nb).ne.idepo1 .and. &
+ iusclb(nb).ne.idepo2 .and. iusclb(nb).ne.idepo3 .and. &
+ iusclb(nb).ne.iencrl .and. iusclb(nb).ne.jbord1 .and. &
+ iusclb(nb).ne.jbord2 .and. iusclb(nb).ne.jbord3 .and. &
+ iusclb(nb).ne.jbord4 .and. iusclb(nb).ne.jbord5 .and. &
+ iusclb(nb).ne.idepfa ) then
+ iok = iok + 1
+ write(nfecra,1040) nb
+ endif
+enddo
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ if (iusclb(nb).eq.idepo2 .and. iensi2.ne.1) then
+ iok = iok + 1
+ write(nfecra,1041) nb
+ endif
+enddo
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ if (iusclb(nb).eq.iencrl .and. iphyla.ne.2) then
+ iok = iok + 1
+ write(nfecra,1042) nb
+ endif
+enddo
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ if (iusclb(nb).eq.iencrl .and. iencra.ne.1) then
+ iok = iok + 1
+ write(nfecra,1043) nb
+ endif
+enddo
+
+! --> Type de condition pour le taux de presence.
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if ( iuslag(nc,nb,ijprpd).lt.1 .or. &
+ iuslag(nc,nb,ijprpd).gt.2 ) then
+ iok = iok + 1
+ write(nfecra,1053) nb, nc, iuslag(nc,nb,ijprpd)
+ endif
+ enddo
+enddo
+
+! --> Type de condition pour la vitesse.
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if ( iuslag(nc,nb,ijuvw).lt.-1 .or. &
+ iuslag(nc,nb,ijuvw).gt.2 ) then
+ iok = iok + 1
+ write(nfecra,1050) nb,nc,iuslag(nc,nb,ijuvw)
+ endif
+ enddo
+enddo
+
+! --> Type de condition pour le diametre.
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if ( iuslag(nc,nb,ijprdp).lt.1 .or. &
+ iuslag(nc,nb,ijprdp).gt.2 ) then
+ iok = iok + 1
+ write(nfecra,1051) nb, nc, iuslag(nc,nb,ijprdp)
+ endif
+ enddo
+enddo
+
+! --> Type de condition pour le diametre.
+
+if ( iphyla.eq.1 .and. &
+ (itpvar.eq.1 .or. idpvar.eq.1 .or. impvar.eq.1) ) then
+ do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if ( iuslag(nc,nb,ijprtp).lt.1 .or. &
+ iuslag(nc,nb,ijprtp).gt.2 ) then
+ iok = iok + 1
+ write(nfecra,1052) nb, nc, iuslag(nc,nb,ijprtp)
+ endif
+ enddo
+ enddo
+endif
+
+! --> Poids statistiques
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (ruslag(nc,nb,ipoit).le.0.d0) then
+ iok = iok + 1
+ write(nfecra,1055) nb, nc, ruslag(nc,nb,ipoit)
+ endif
+ enddo
+enddo
+
+! --> Debit massique de particule
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (ruslag(nc,nb,idebt).lt.0.d0) then
+ iok = iok + 1
+ write(nfecra,1056) nb, nc, ruslag(nc,nb,idebt)
+ endif
+ enddo
+enddo
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (ruslag(nc,nb,idebt).gt.0.d0 .and. &
+ iuslag(nc,nb,ijnbp).eq.0 ) then
+ iok = iok + 1
+ write(nfecra,1057) nb, nc, ruslag(nc,nb,idebt), &
+ iuslag(nc,nb,ijnbp)
+ endif
+ enddo
+enddo
+
+! --> Proprietes des particules : le diametre, son ecart-type, et rho
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (ruslag(nc,nb,iropt).lt.0.d0 .or. &
+ ruslag(nc,nb,idpt) .lt.0.d0 .or. &
+ ruslag(nc,nb,ivdpt).lt.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,1060) nb, nc, &
+ ruslag(nc,nb,iropt), &
+ ruslag(nc,nb,idpt), &
+ ruslag(nc,nb,ivdpt)
+ endif
+ enddo
+enddo
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if ( ruslag(nc,nb,idpt).lt.3.d0*ruslag(nc,nb,ivdpt) ) then
+ iok = iok + 1
+ write(nfecra,1065) nb, nc, &
+ ruslag(nc,nb,idpt)-3.d0*ruslag(nc,nb,ivdpt)
+ endif
+ enddo
+enddo
+
+! --> Proprietes des particules : Temperature et CP
+
+if (iphyla.eq.1 .and. itpvar.eq.1) then
+
+ do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (ruslag(nc,nb,icpt) .lt.0.d0 .or. &
+ ruslag(nc,nb,itpt) .lt.tkelvn ) then
+ iok = iok + 1
+ write(nfecra,1070) &
+ iphyla, itpvar, nb, nc, &
+ ruslag(nc,nb,itpt), ruslag(nc,nb,icpt)
+ endif
+ enddo
+ enddo
+
+endif
+
+! --> Proprietes des particules : Emissivite
+
+if (iphyla.eq.1 .and. itpvar.eq.1 .and. iirayo.gt.0) then
+
+ do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (ruslag(nc,nb,iepsi) .lt.0.d0 .or. &
+ ruslag(nc,nb,iepsi) .gt.1.d0 ) then
+ iok = iok + 1
+ write(nfecra,1075) &
+ iphyla, itpvar, nb, nc, ruslag(nc,nb,iepsi)
+ endif
+ enddo
+ enddo
+
+endif
+
+! Charbon
+
+if (iphyla.eq.2) then
+
+! --> Numero du charbon
+
+ do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (iuslag(nc,nb,inuchl).lt.0.d0 &
+ .and. iuslag(nc,nb,inuchl).gt.ncharb) then
+ iok = iok + 1
+ write(nfecra,1080) nb, nc, ncharb, iuslag(nc,nb,inuchl)
+ endif
+ enddo
+ enddo
+
+! --> Proprietes des particules de Charbon.
+
+ do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (ruslag(nc,nb,ihpt) .lt.0.d0 .or. &
+ ruslag(nc,nb,icpt) .lt.0.d0 .or. &
+ ruslag(nc,nb,imcht) .lt.0.d0 .or. &
+ ruslag(nc,nb,imckt) .lt.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,1090) &
+ iphyla, nb, nc, &
+ ruslag(nc,nb,ihpt), ruslag(nc,nb,icpt), &
+ ruslag(nc,nb,imcht), ruslag(nc,nb,imckt)
+ endif
+ enddo
+ enddo
+endif
+
+! --> Stop si erreur.
+
+if(iok.gt.0) then
+ call csexit (1)
+ !==========
+endif
+
+
+!===============================================================================
+! 4. Transformation des donnees utilisateur
+!===============================================================================
+
+! --> Injection des part 1ere iter seulement si freq d'injection nulle
+
+do ii = 1, nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (iuslag(nc,nb,ijfre).eq.0 .and. iplas.eq.1) then
+ iuslag(nc,nb,ijfre) = ntcabs
+ endif
+ if (iuslag(nc,nb,ijfre).eq.0 .and. iplas.gt.1) then
+ iuslag(nc,nb,ijfre) = ntcabs+1
+ endif
+ enddo
+enddo
+
+! --> Calcul du nombre de particules a injecter pour cette iteration
+
+nbpnew = 0
+dnbpnw = 0.d0
+
+! Dans le cas ou on a un taux de presence impose dans une zone,
+! on corrige IUSLAG(NC,NB,IJNBP) donne dans USLAG2 qui n'a
+! pas de sens puisque l'on injecte 1 particule par maille
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+! pour chaque classe :
+ do nc = 1, iusncl(nb)
+! si de nouvelles particules doivent entrer :
+ if (mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0) then
+
+ if ( iuslag(nc,nb,ijprpd) .eq. 2 ) then
+ iuslag(nc,nb,ijnbp)=0
+ do ifac = 1,nfabor
+ if (ifrlag(ifac).eq.nb) then
+ iuslag(nc,nb,ijnbp)=iuslag(nc,nb,ijnbp)+1
+ endif
+ enddo
+ endif
+ endif
+ enddo
+enddo
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ do nc = 1, iusncl(nb)
+ if (mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0) then
+ nbpnew = nbpnew + iuslag(nc,nb,ijnbp)
+ endif
+ enddo
+enddo
+
+! --> Limite du nombre de particules a NBPMAX
+
+if ( (nbpart+nbpnew).gt.nbpmax ) then
+ write(nfecra,3000) nbpart,nbpnew,nbpmax
+ nbpnew = 0
+endif
+
+! --> Si pas de new particules alors RETURN
+
+if (nbpnew.eq.0) return
+
+! --> Tirage aleatoire des positions des NBPNEW nouvelles particules
+! au niveau des zones de bord et reperage des cellules correspondantes
+
+! initialisation du compteur de nouvelles particules
+
+npt = nbpart
+
+! On reserve d'abord la memoire si on a de nouvelles particules
+! on garde IIWORK jusqu'a lagnwc
+
+iiwork = idebia
+ifinia = iiwork + nbpnew
+ifinra = idebra
+CALL IASIZE('LAGENT',IFINIA)
+!==========
+
+! Ensuite, on regarde ou on les met
+
+! pour chaque zone de bord :
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+! pour chaque classe :
+ do nc = 1, iusncl(nb)
+! si de nouvelles particules doivent entrer :
+ if (mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0) then
+
+ if ( iuslag(nc,nb,ijprpd) .eq. 1 ) then
+
+ call lagnew &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npt , nbpnew , iuslag(nc,nb,ijnbp) , &
+ nideve , nrdeve , nituse , nrtuse , &
+ nb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ifrlag , itepa(1,jisor) , ia(iiwork) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ surfbn , ettp , &
+ rdevel , rtuser , ra )
+
+ elseif ( iuslag(nc,nb,ijprpd) .eq. 2 ) then
+
+ call lagnpr &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npt , nbpnew , iuslag(nc,nb,ijnbp) , &
+ nideve , nrdeve , nituse , nrtuse , &
+ nb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ifrlag , itepa(1,jisor) , ia(iiwork) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ surfbn , ettp , &
+ rdevel , rtuser , ra )
+ endif
+
+ endif
+ enddo
+enddo
+
+!-->TEST DE CONTROLE (NE PAS MODIFIER)
+
+if ( (nbpart+nbpnew).ne.npt ) then
+ write(nfecra,3010) nbpnew, npt-nbpart
+ call csexit (1)
+ !==========
+endif
+
+!--> Injection en continu des particules
+
+if ( injcon.eq.1 ) then
+
+! reinitialisation du compteur de nouvelles particules
+
+ npt = nbpart
+
+! pour chaque zone de bord:
+
+ do ii = 1,nfrlag
+ nb = ilflag(ii)
+
+! pour chaque classe :
+
+ do nc = 1, iusncl(nb)
+
+! si de nouvelles particules doivent entrer :
+ if ( mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0 ) then
+
+ call lagnwc &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npt , nbpnew , iuslag(nc,nb,ijnbp) , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itycel , icocel , &
+ ifrlag , itepa(1,jisor) , ia(iiwork) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ surfbn , ettp , &
+ rdevel , rtuser , ra )
+
+ endif
+
+ enddo
+ enddo
+
+endif
+
+!-->TEST DE CONTROLE (NE PAS MODIFIER)
+
+if ( (nbpart+nbpnew).ne.npt ) then
+ write(nfecra,3010) nbpnew, npt-nbpart
+ call csexit (1)
+ !==========
+endif
+
+
+! reinitialisation du compteur de nouvelles particules
+
+npt = nbpart
+
+! pour chaque zone de bord:
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+
+! pour chaque classe :
+ do nc = 1, iusncl(nb)
+
+! si de nouvelles particules doivent entrer :
+ if (mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0) then
+
+ do ip = npt+1 , npt+iuslag(nc,nb,ijnbp)
+ iel = itepa(ip,jisor)
+ ifac = ia(iiwork+ip-1)
+
+!-->COMPOSANTES DE LA VITESSE DES PARTICULES
+
+! si composantes de la vitesse imposee :
+ if (iuslag(nc,nb,ijuvw).eq.1) then
+ ettp(ip,jup) = ruslag(nc,nb,iupt)
+ ettp(ip,jvp) = ruslag(nc,nb,ivpt)
+ ettp(ip,jwp) = ruslag(nc,nb,iwpt)
+
+! si norme de la vitesse imposee :
+ else if (iuslag(nc,nb,ijuvw).eq.0) then
+ aa = -1.d0 / surfbn(ifac)
+ vn1 = surfbo(1,ifac) * aa
+ vn2 = surfbo(2,ifac) * aa
+ vn3 = surfbo(3,ifac) * aa
+ ettp(ip,jup) = vn1 * ruslag(nc,nb,iuno)
+ ettp(ip,jvp) = vn2 * ruslag(nc,nb,iuno)
+ ettp(ip,jwp) = vn3 * ruslag(nc,nb,iuno)
+
+! si vitesse du fluide vu :
+ else if (iuslag(nc,nb,ijuvw).eq.-1) then
+ ettp(ip,jup) = rtpa(iel,iu(iphas))
+ ettp(ip,jvp) = rtpa(iel,iv(iphas))
+ ettp(ip,jwp) = rtpa(iel,iw(iphas))
+
+! si profil de vitesse impose :
+ else if (iuslag(nc,nb,ijuvw).eq.2) then
+
+ idvar = 1
+ xxpart = ettp(ip,jxp)
+ yypart = ettp(ip,jyp)
+ zzpart = ettp(ip,jzp)
+
+ call uslapr &
+ !==========
+ ( idebia , idebra , &
+ idvar , iel , nb , nc , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , &
+ idevel , ituser , ia , &
+ xxpart , yypart , zzpart , &
+ tvpart , uupart , vvpart , wwpart , ddpart , ttpart , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , &
+ rdevel , rtuser , ra )
+
+ ettp(ip,jup) = uupart
+ ettp(ip,jvp) = vvpart
+ ettp(ip,jwp) = wwpart
+
+ endif
+
+!-->Vitesse du fluide vu
+
+ ettp(ip,juf) = rtpa(iel,iu(iphas))
+ ettp(ip,jvf) = rtpa(iel,iv(iphas))
+ ettp(ip,jwf) = rtpa(iel,iw(iphas))
+
+!--> TEMPS DE SEJOUR
+
+ tepa(ip,jrtsp) = 0.d0
+
+!--> Diametre
+
+! si diametre constant imposee :
+ if (iuslag(nc,nb,ijprdp).eq.1) then
+ if (ruslag(nc,nb,ivdpt) .gt. 0.d0) then
+ n1 = 1
+ call normalen(n1,rd)
+ ettp(ip,jdp) = ruslag(nc,nb,idpt) &
+ + rd(1) * ruslag(nc,nb,ivdpt)
+
+! On verifie qu'on obtient un diam�tre dans la gamme des 99,7%
+
+ d3 = 3.d0 * ruslag(nc,nb,ivdpt)
+ if (ettp(ip,jdp).lt.ruslag(nc,nb,idpt)-d3) &
+ ettp(ip,jdp)= ruslag(nc,nb,idpt)
+ if (ettp(ip,jdp).gt.ruslag(nc,nb,idpt)+d3) &
+ ettp(ip,jdp)= ruslag(nc,nb,idpt)
+ else
+ ettp(ip,jdp) = ruslag(nc,nb,idpt)
+ endif
+
+! si profil pour le diametre :
+ else if (iuslag(nc,nb,ijprdp).eq.2) then
+
+ idvar = 2
+ xxpart = ettp(ip,jxp)
+ yypart = ettp(ip,jyp)
+ zzpart = ettp(ip,jzp)
+
+ call uslapr &
+ !==========
+ ( idebia , idebra , &
+ idvar , iel , nb , nc , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , &
+ idevel , ituser , ia , &
+ xxpart , yypart , zzpart , &
+ tvpart , uupart , vvpart , wwpart , ddpart , ttpart , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , &
+ rdevel , rtuser , ra )
+
+ ettp(ip,jdp) = ddpart
+
+ endif
+
+!--> Autres variables : masse, ... en fonction de la physique
+
+ d3 = ettp(ip,jdp) * ettp(ip,jdp) * ettp(ip,jdp)
+
+ if (nbclst.gt.0) then
+ itepa(ip,jclst) = iuslag(nc,nb,iclst)
+ endif
+
+ if ( iphyla.eq.0 .or. iphyla.eq.1 ) then
+
+ ettp(ip,jmp) = ruslag(nc,nb,iropt) * pis6 * d3
+
+ if ( iphyla.eq.1 .and. itpvar.eq.1 ) then
+
+! si Temperature constante imposee :
+ if (iuslag(nc,nb,ijprtp).eq.1) then
+ ettp(ip,jtp) = ruslag(nc,nb,itpt)
+! si profil pour la temperature :
+ else if (iuslag(nc,nb,ijprtp).eq.2) then
+
+ idvar = 3
+ xxpart = ettp(ip,jxp)
+ yypart = ettp(ip,jyp)
+ zzpart = ettp(ip,jzp)
+
+ call uslapr &
+ !==========
+ ( idebia , idebra , &
+ idvar , iel , nb , nc , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , &
+ idevel , ituser , ia , &
+ xxpart , yypart , zzpart , &
+ tvpart , uupart , vvpart , wwpart , ddpart , ttpart , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , &
+ rdevel , rtuser , ra )
+
+ ettp(ip,jtp) = ttpart
+
+ endif
+
+ if ( ippmod(icp3pl).ge.0 .or. &
+ ippmod(icpl3c).ge.0 .or. &
+ ippmod(icfuel).ge.0 ) then
+
+ ettp(ip,jtf) = propce(iel,ipproc(itemp1)) -tkelvi
+
+ else if ( ippmod(icod3p).ge.0 .or. &
+ ippmod(icoebu).ge.0 .or. &
+ ippmod(ielarc).ge.0 .or. &
+ ippmod(ieljou).ge.0 ) then
+
+ ettp(ip,jtf) = propce(iel,ipproc(itemp)) -tkelvi
+
+! Kelvin
+ else if ( iscsth(iscalt(iphas)).eq.1 ) then
+
+ ettp(ip,jtf) = rtpa(iel,isca(iscalt(iphas))) -tkelvi
+
+! Celsius
+ else if ( iscsth(iscalt(iphas)).eq.-1 ) then
+
+ ettp(ip,jtf) = rtpa(iel,isca(iscalt(iphas)))
+
+ else if ( iscsth(iscalt(iphas)).eq.2 ) then
+
+ mode = 1
+ call usthht(mode, rtpa(iel,isca(iscalt(iphas))), &
+ ettp(ip,jtf))
+
+ endif
+
+ ettp(ip,jcp) = ruslag(nc,nb,icpt)
+ tepa(ip,jreps) = ruslag(nc,nb,iepsi)
+
+ endif
+
+ else if ( iphyla.eq.2 ) then
+
+ itepa(ip,jinch) = iuslag(nc,nb,inuchl)
+ ettp(ip,jhp) = ruslag(nc,nb,ihpt)
+ ettp(ip,jtf) = propce(iel,ipproc(itemp1)) - tkelvi
+ ettp(ip,jcp) = ruslag(nc,nb,icpt)
+
+ ettp(ip,jmch) = ruslag(nc,nb,imcht)
+ ettp(ip,jmck) = ruslag(nc,nb,imckt)
+
+ tepa(ip,jrdck) = ettp(ip,jdp)
+ tepa(ip,jrd0p) = ettp(ip,jdp)
+
+ icha = itepa(ip,jinch)
+ ettp(ip,jmp) = ettp(ip,jmch) &
+ + ettp(ip,jmck) &
+ + xashch(icha) * pis6 * d3 * rho0ch(icha)
+
+ endif
+
+!--> POIDS STATISTIQUE
+
+ if (iuslag(nc,nb,ijprpd).eq.1) then
+ tepa(ip,jrpoi) = ruslag(nc,nb,ipoit)
+ else if (iuslag(nc,nb,ijprpd).eq.2) then
+
+ idvar = 0
+ xxpart = ettp(ip,jxp)
+ yypart = ettp(ip,jyp)
+ zzpart = ettp(ip,jzp)
+
+ call uslapr &
+ !==========
+ ( idebia , idebra , &
+ idvar , iel , nb , nc , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , &
+ idevel , ituser , ia , &
+ xxpart , yypart , zzpart , &
+ tvpart , uupart , vvpart , wwpart , ddpart , ttpart , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , &
+ rdevel , rtuser , ra )
+
+ volp = pis6*d3
+ surf = sqrt( surfbo(1,ifac)*surfbo(1,ifac) &
+ +surfbo(2,ifac)*surfbo(2,ifac) &
+ +surfbo(3,ifac)*surfbo(3,ifac) )
+ vitp = sqrt( ettp(ip,jup)*ettp(ip,jup) &
+ +ettp(ip,jvp)*ettp(ip,jvp) &
+ +ettp(ip,jwp)*ettp(ip,jwp) )
+ tepa(ip,jrpoi) =tvpart*(surf*vitp*dtp)/volp
+
+ endif
+
+ enddo
+
+ npt = npt + iuslag(nc,nb,ijnbp)
+
+ endif
+
+ enddo
+enddo
+
+!-->TEST DE CONTROLE (NE PAS MODIFIER)
+
+if ( (nbpart+nbpnew).ne.npt ) then
+ write(nfecra,3010) nbpnew, npt-nbpart
+ call csexit (1)
+ !==========
+endif
+
+
+!===============================================================================
+! 5. MODIFICATION DES POIDS POUR AVOIR LE DEBIT
+!===============================================================================
+
+! reinitialisation du compteur de nouvelles particules
+
+ npt = nbpart
+
+! pour chaque zone de bord :
+
+ do ii = 1,nfrlag
+ nb = ilflag(ii)
+
+! pour chaque classe :
+
+ do nc = 1,iusncl(nb)
+
+! si de nouvelles particules sont entrees,
+! et si on a un debit non nul :
+
+ if ( mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0 .and. &
+ ruslag(nc,nb,idebt) .gt. 0.d0 .and. &
+ iuslag(nc,nb,ijnbp) .gt. 0 ) then
+
+ dmasse = 0.d0
+ do ip = npt+1 , npt+iuslag(nc,nb,ijnbp)
+ dmasse = dmasse + ettp(ip,jmp)
+ enddo
+
+! Calcul des Poids
+
+ if ( dmasse.gt.0.d0 ) then
+ do ip = npt+1 , npt+iuslag(nc,nb,ijnbp)
+ tepa(ip,jrpoi) = ( ruslag(nc,nb,idebt)*dtp ) / dmasse
+ enddo
+ else
+ write(nfecra,1057) nb, nc, ruslag(nc,nb,idebt), &
+ iuslag(nc,nb,ijnbp)
+ call csexit (1)
+ !==========
+ endif
+
+ endif
+
+ npt = npt + iuslag(nc,nb,ijnbp)
+
+ enddo
+
+ enddo
+
+!-->TEST DE CONTROLE (NE PAS MODIFIER)
+
+if ( (nbpart+nbpnew).ne.npt ) then
+ write(nfecra,3010) nbpnew, npt-nbpart
+ call csexit (1)
+ !==========
+endif
+
+!===============================================================================
+! 6. CALCUL DE LA MASSE TOTALE INJECTES EN CHAQUE ZONE
+! Attention cette valeur est modifie dans USLABO pour tenir compte
+! des particules qui sortent
+! + calcul du nombres physiques de particules qui rentrent (tenant
+! compte des poids)
+!===============================================================================
+
+! reinitialisation du compteur de nouvelles particules
+
+npt = nbpart
+dnbpnw = 0.d0
+
+! pour chaque zone de bord :
+
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+ deblag(nb) = 0.d0
+
+! pour chaque classe :
+
+ do nc = 1,iusncl(nb)
+
+! si de nouvelles particules sont entrees,
+
+ if ( mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0 .and. &
+ iuslag(nc,nb,ijnbp) .gt. 0 ) then
+
+ do ip = npt+1 , npt+iuslag(nc,nb,ijnbp)
+ deblag(nb) = deblag(nb) + tepa(ip,jrpoi)*ettp(ip,jmp)
+ dnbpnw = dnbpnw + tepa(ip,jrpoi)
+ enddo
+
+ endif
+
+ npt = npt + iuslag(nc,nb,ijnbp)
+
+ enddo
+
+enddo
+
+!===============================================================================
+! 7. SIMULATION DES VITESSES TURBULENTES FLUIDES INSTANTANNEES VUES
+! PAR LES PARTICULES SOLIDES LE LONG DE LEUR TRAJECTOIRE.
+!===============================================================================
+
+! si de nouvelles particules doivent entrer :
+
+npar1 = nbpart+1
+npar2 = nbpart+nbpnew
+
+call lagipn &
+!==========
+ ( ifinia , ifinra , &
+ ncelet , ncel , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npar1 , npar2 , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ rtpa , &
+ ettp , tepa , vagaus , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 8. MODIFICATION DES TABLEAUX DE DONNEES PARTICULAIRES
+!===============================================================================
+
+call uslain &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nbpnew , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , ia(iiwork) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , vagaus , w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+! reinitialisation du compteur de nouvelles particules
+npt = nbpart
+
+! pour chaque zone de bord:
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+
+! pour chaque classe :
+ do nc = 1, iusncl(nb)
+
+! si de nouvelles particules doivent entrer :
+ if (mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0) then
+
+ do ip = npt+1 , npt+iuslag(nc,nb,ijnbp)
+
+ if (ettp(ip,jdp).lt.0.d0 .and. &
+ ruslag(nc,nb,ivdpt).gt.0.d0) then
+ write(nfecra,4000) ruslag(nc,nb,idpt), &
+ ruslag(nc,nb,ivdpt), &
+ ettp(ip,jdp)
+ endif
+
+ enddo
+
+ npt = npt + iuslag(nc,nb,ijnbp)
+
+ endif
+
+ enddo
+enddo
+
+! Ici on peut laisser choir IIWORK (et donc reprendre
+! IDEBIA et IDEBRA comme indicateur de la zone de memoire libre)
+
+!===============================================================================
+! 8. IMPRESSIONS POUR POST-PROCESSING EN MODE TRAJECTOIRES
+!===============================================================================
+
+if ( iensi1.eq.1 ) then
+
+ nfin = 0
+
+! reinitialisation du compteur de nouvelles particules
+ npt = nbpart
+
+! pour chaque zone de bord :
+ do ii = 1, nfrlag
+ nb = ilflag(ii)
+
+! pour chaque classe :
+ do nc = 1, iusncl(nb)
+
+! si de nouvelles particules doivent entrer :
+ if (mod(ntcabs,iuslag(nc,nb,ijfre)).eq.0) then
+
+ do ip = npt+1 , npt+iuslag(nc,nb,ijnbp)
+ call enslag &
+ !==========
+ ( ifinia , ifinra , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , ip , &
+ itepa , &
+ ettp , tepa , ra)
+ enddo
+ npt = npt + iuslag(nc,nb,ijnbp)
+
+ endif
+ enddo
+ enddo
+endif
+
+!===============================================================================
+! 9. NOUVEAU NOMBRE DE PARTICULES TOTAL
+!===============================================================================
+
+! NBPART : NOMBRE DE PARTICULES PRESENTES DANS LE DOMAINE
+
+! NBPTOT : NOMBRE DE PARTICULES TOTAL INJECTE DANS
+! LE CALCUL DEPUIS LE DEBUT SUITE COMPRISE
+
+nbpart = nbpart + nbpnew
+dnbpar = dnbpar + dnbpnw
+
+nbptot = nbptot + nbpnew
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT INCOMPLETES OU ERRONEES ',/,&
+'@ ',/,&
+'@ Le numero de zone associee a la face ',I10 ,' doit etre ',/,&
+'@ un entier strictement positif et inferieur ou egal a ',/,&
+'@ NFLAGM = ',I10 ,/,&
+'@ Ce numero (IFRLAG(IFAC)) vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le nombre maximal de zones frontieres qui peuvent etre ',/,&
+'@ definies par l''utilisateur est NFLAGM = ',I10 ,/,&
+'@ Il a ete depasse. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@ Les zones frontieres NFLAGM premieres zones frontieres ',/,&
+'@ portent ici les numeros suivants : ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT INCOMPLETES OU ERRONEES ',/,&
+'@ ',/,&
+'@ Le nombre de classes de la zone numero ',I10 ,' doit ',/,&
+'@ etre un entier positif ou nul et inferieur ou egal ',/,&
+'@ a NCLAGM = ',I10 ,/,&
+'@ Ce nombre (IUSNCL(NB) ) vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le nombre de particules dans la classe ',I10 ,/,&
+'@ dans la zone frontiere ',I10 ,/,&
+'@ doit etre un entier strictement positif et ',/,&
+'@ inferieur ou egal a NBPMAX = ',I10 ,/,&
+'@ ',/,&
+'@ Ce nombre (IUSLAG(NC,NB,IJNBP)) vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME A L''EXECUTION DU MODULE LAGRANGIEN',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le numero de groupe statistique de particules ',/,&
+'@ dans la classe NC= ',I10 ,/,&
+'@ dans la zone frontiere NB= ',I10 ,/,&
+'@ doit etre un entier strictement positif et ',/,&
+'@ inferieur ou egal a NBCLST = ',I10 ,/,&
+'@ ',/,&
+'@ Ce nombre (IUSLAG(NC,NB,IJNBP)) vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul continue mais cette classe statistique sera ',/,&
+'@ ignoree ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ La frequence d''injection des particules doit etre un ',/,&
+'@ entier positif ou nul (nul signifiant que ',/,&
+'@ les particules ne injectees qu''au debut du calcul). ',/,&
+'@ ',/,&
+'@ Ce nombre pour la frontiere NB =',I10 ,/,&
+'@ et pour la classe NC =',I10 ,/,&
+'@ vaut ici IUSLAG (NC,NB,IJFRE) =',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Les conditions aux bords sont representees par ',/,&
+'@ une variable dont les valeurs sont ',/,&
+'@ obligatoirement les suivantes : ',/,&
+'@ ',/,&
+'@ = IENTRL zone d''injection de particules ',/,&
+'@ = ISORTL sortie du domaine ',/,&
+'@ = IREBOL rebond des particules ',/,&
+'@ = IDEPO1 deposition definitive ',/,&
+'@ = IDEPO2 deposition definitive mais la particule reste ',/,&
+'@ en memoire (utile si IENSI2 = 1 uniquement) ',/,&
+'@ = IDEPO3 deposition et remise en suspension possible ',/,&
+'@ suivant les condition de l''ecoulement ',/,&
+'@ = IENCRL encrassement (Charbon uniquement IPHYLA = 2) ',/,&
+'@ = JBORD1 interaction particule/frontiere utilisateur ',/,&
+'@ = JBORD2 interaction particule/frontiere utilisateur ',/,&
+'@ = JBORD3 interaction particule/frontiere utilisateur ',/,&
+'@ = JBORD4 interaction particule/frontiere utilisateur ',/,&
+'@ = JBORD5 interaction particule/frontiere utilisateur ',/,&
+'@ ',/,&
+'@ Cette valeur pour la frontiere NB = ',I10 ,/,&
+'@ est erronees. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ La condition a la limite representee par la variable ',/,&
+'@ IDEPO2 n''est admissible que pour un post-processing ',/,&
+'@ en mode deplacement IENSI2 = 1 . ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IENSI2 dans USLAG1 et les ',/,&
+'@ conditions aux limites pour la frontiere NB =',I10 ,/,&
+'@ dans USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1042 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ La condition a la limite representee par le type ',/,&
+'@ IENCRL n''est admissible que lorsque les particules ',/,&
+'@ transportees sont des grains de charbon IPHYLA = 2 ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IPHYLA dans USLAG1 et les ',/,&
+'@ conditions aux limites pour la frontiere NB =',I10 ,/,&
+'@ dans USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1043 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ La condition a la limite representee par le type ',/,&
+'@ ENCRAS n''est admissible que lorsque l''option ',/,&
+'@ encrassement est enclenche IENCRA = 1 ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IENCRA dans USLAG1 et les ',/,&
+'@ conditions aux limites pour la frontiere NB =',I10 ,/,&
+'@ dans USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le type de condition au bord pour la vitesse est ',/,&
+'@ represente par un entier dont les valeurs sont ',/,&
+'@ obligatoirement les suivantes ',/,&
+'@ =-1 vitesse fluide imposee ',/,&
+'@ = 0 vitesse imposee selon la direction normale a la ',/,&
+'@ face de bord et de norme RUSLAG(NB,NC,IUNO) ',/,&
+'@ = 1 vitesse imposee : on donne RUSLAG(NB,NC,IUPT) ',/,&
+'@ RUSLAG(NB,NC,IVPT) ',/,&
+'@ RUSLAG(NB,NC,IWPT) ',/,&
+'@ = 2 profil de vitesse imposee dans USLAPR ',/,&
+'@ ',/,&
+'@ Ce nombre pour la frontiere NB = ',I10 ,/,&
+'@ et pour la classe NC = ',I10 ,/,&
+'@ vaut ici IUSLAG(NC,NB,IJUVW) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ (Si IUSLAG(NC,NB,IJUVW) vaut -2 il n''a par ete renseigne)',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1051 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le type de condition au bord pour le diametre est ',/,&
+'@ represente par un entier dont les valeurs sont ',/,&
+'@ obligatoirement les suivantes ',/,&
+'@ = 1 diametre imposee dans la zone : ',/,&
+'@ on donne RUSLAG(NB,NC,IDPT) ',/,&
+'@ RUSLAG(NB,NC,IVDPT) ',/,&
+'@ = 2 profil de diametre imposee dans USLAPR ',/,&
+'@ ',/,&
+'@ Ce nombre pour la frontiere NB = ',I10 ,/,&
+'@ et pour la classe NC = ',I10 ,/,&
+'@ vaut ici IUSLAG(NC,NB,IJPRDP) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ (Si IUSLAG(NC,NB,IJPRDP) vaut -2 il n''a par ete renseigne)',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1052 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le type de condition au bord pour la temperature est ',/,&
+'@ represente par un entier dont les valeurs sont ',/,&
+'@ obligatoirement les suivantes ',/,&
+'@ = 1 temperature imposee dans la zone : ',/,&
+'@ on donne RUSLAG(NB,NC,ITPT)) ',/,&
+'@ = 2 profil de temperature imposee dans USLAPR ',/,&
+'@ ',/,&
+'@ Ce nombre pour la frontiere NB = ',I10 ,/,&
+'@ et pour la classe NC = ',I10 ,/,&
+'@ vaut ici IUSLAG(NC,NB,IJPRTP) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ (Si IUSLAG(NC,NB,IJPRTP) vaut -2 il n''a par ete renseigne)',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1053 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le type de condition au bord pour la taux de presence est ',/,&
+'@ represente par un entier dont les valeurs sont ',/,&
+'@ obligatoirement les suivantes ',/,&
+'@ = 1 distribution uniforme ',/,&
+'@ on donne RUSLAG(NB,NC,IPOID)) ',/,&
+'@ = 2 profil de taux de presence imposee dans USLAPR ',/,&
+'@ ',/,&
+'@ Ce nombre pour la frontiere NB = ',I10 ,/,&
+'@ et pour la classe NC = ',I10 ,/,&
+'@ vaut ici IUSLAG(NC,NB,IJPRPD) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ (Si IUSLAG(NC,NB,IJPRPD) vaut -2 il n''a par ete renseigne)',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1055 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le poids statistique des particules doit etre un reel ',/,&
+'@ strictement positif. ',/,&
+'@ ',/,&
+'@ Ce nombre pour la frontiere NB =',I10 ,/,&
+'@ et pour la classe NC =',I10 ,/,&
+'@ vaut ici RUSLAG (NC,NB,IPOIT) =',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1056 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le debit massique des particules doit etre un reel ',/,&
+'@ positif ou nul (nul signifiant que le debit n''est pas ',/,&
+'@ pris en compte). ',/,&
+'@ ',/,&
+'@ Ce nombre pour la frontiere NB =',I10 ,/,&
+'@ et pour la classe NC =',I10 ,/,&
+'@ vaut ici RUSLAG (NC,NB,IDEBT) =',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1057 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Les proprietes physiques des particules au bord pour ',/,&
+'@ la frontiere NB = ',I10 ,' et la classe NC = ',I10 ,/,&
+'@ ne sont pas physiques. ',/,&
+'@ Le debit massique impose ',/,&
+'@ vaut ici RUSLAG (NC,NB,IDEBT) =',E14.5 ,/,&
+'@ alors que le nombre de particules injectees est nul ',/,&
+'@ IUSLAG (NC,NB,IJNBP) =',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Les proprietes physiques des particules au bord pour ',/,&
+'@ la frontiere NB = ',I10 ,' et la classe NC = ',I10 ,/,&
+'@ ne sont pas physiques : ',/,&
+'@ Masse volumique : RUSLAG(NC,NB,IROPT) = ',E14.5 ,/,&
+'@ Diametre moyen : RUSLAG(NC,NB,IDPT) = ',E14.5 ,/,&
+'@ Ecart type : RUSLAG(NC,NB,IVDPT) = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ Verifier le fichier dp_FCP si l''option Charbon pulverise ',/,&
+'@ est activee. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1065 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ L''ecart-type fourni est trop grand par rapport ',/,&
+'@ au diametre moyen pour ',/,&
+'@ la frontiere NB = ',I10 ,' et la classe NC = ',I10 ,/,&
+'@ ',/,&
+'@ Il y a un risque non nul de calcul d''un diametre negatif.',/,&
+'@ ',/,&
+'@ Theoriquement 99,7% des particules se trouvent entre : ',/,&
+'@ RUSLAG(NC,NB,IDPT)-3*RUSLAG(NC,NB,IVDPT) ',/,&
+'@ RUSLAG(NC,NB,IDPT)+3*RUSLAG(NC,NB,IVDPT) ',/,&
+'@ Pour eviter des diametres aberrants, dans le module ',/,&
+'@ lagrangien, avec un clipping, on impose que 100% des ',/,&
+'@ particules doivent etre dans cet intervalle. ',/,&
+'@ ',/,&
+'@ Or on a : ',/,&
+'@ RUSLAG(NC,NB,IDPT)-3*RUSLAG(NC,NB,IVDPT) = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ Verifier le fichier dp_FCP si l''option Charbon pulverise ',/,&
+'@ est activee. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1070 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Une equation sur la temperature est associee ',/,&
+'@ aux particules (IPHYLA = ',I10,') : ',/,&
+'@ ITPVAR = ',I10 ,/,&
+'@ Les proprietes physiques des particules au bord pour ',/,&
+'@ la frontiere NB = ',I10 ,' et la classe NC = ',I10 ,/,&
+'@ doivent etre renseignees : ',/,&
+'@ Temperature : RUSLAG(NC,NB,ITPT) = ',E14.5 ,/,&
+'@ Cp : RUSLAG(NC,NB,ICPT) = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1075 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Une equation sur la temperature est associee ',/,&
+'@ aux particules (IPHYLA = ',I10,') : ',/,&
+'@ ITPVAR = ',I10 ,/,&
+'@ avec prise em compte des echanges thermiques radiatifs. ',/,&
+'@ L''emissivite des particules doit etre renseignee et ',/,&
+'@ comprise entre 0 et 1 (inclus). ',/,&
+'@ ',/,&
+'@ L''emissivite pour la frontiere NB = ',I10 ,/,&
+'@ et la classe NC = ',I10 ,/,&
+'@ vaut : RUSLAG(NC,NB,IEPSI) = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1080 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE LAGRANGIEN OPTION CHARBON PULVERISE ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ L''INDICATEUR SUR LE NUMERO DU CHARBON ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ Le numero du charbon injecte pour ',/,&
+'@ la frontiere NB = ',I10 ,' et la classe NC = ',I10 ,/,&
+'@ devrait etre compris entre 1 et NCHARB= ',I10 ,/,&
+'@ Le nombre de charbon NCHARB est donne dans dp_FCP. ',/,&
+'@ ',/,&
+'@ Il vaut ici : IUSLAG(NC,NB,INUCHL) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2 et le fichier dp_FCP. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1090 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE LAGRANGIEN OPTION CHARBON PULVERISE ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ L''option de transport de particules de charbon pulverise ',/,&
+'@ est active (IPHYLA = ',I10,') ',/,&
+'@ Les proprietes physiques des particules au bord pour ',/,&
+'@ la frontiere NB = ',I10 ,' et la classe NC = ',I10 ,/,&
+'@ doivent etre renseignees : ',/,&
+'@ Temperature : RUSLAG(NC,NB,IHPT) = ',E14.5 ,/,&
+'@ Cp : RUSLAG(NC,NB,ICPT) = ',E14.5 ,/,&
+'@ Masse de charbon ',/,&
+'@ reactif : RUSLAG(NC,NB,IMCHT) = ',E14.5 ,/,&
+'@ Masse de coke : RUSLAG(NC,NB,IMCKT) = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2 et le fichier dp_FCP. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le nombre de nouvelles particules injectees conduit a un ',/,&
+'@ nombre total de particules superieur au maximum prevu : ',/,&
+'@ ',/,&
+'@ Nombre de particules courant : NBPART = ',I10 ,/,&
+'@ Nombre de nouvelles particules : NBPNEW = ',I10 ,/,&
+'@ Nombre maximal de particules : NBPMAX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit, mais on n''injecte aucune particule',/,&
+'@ ',/,&
+'@ Ajuster NBPMAX dans USLAG1 et verifier USLAG2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le nombre de particules injectees dans le domaine ',/,&
+'@ pour cette iteration Lagrangienne ne correspond pas ',/,&
+'@ a celui specifie dans les conditions aux limites. ',/,&
+'@ ',/,&
+'@ Nombre de particules specifie pour l''injection : ',/,&
+'@ NBPNEW = ',I10 ,/,&
+'@ Nombre de particules effectivement injectees : ',/,&
+'@ NPT-NBPART = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGENT) ',/,&
+'@ ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT ERRONEES ',/,&
+'@ ',/,&
+'@ Le reconstruction du duametre d''une particule a partir ',/,&
+'@ du diametre moyen et de l''ecart type donne une valeur ',/,&
+'@ de diametre negatif, a cause d''un tirage aleatoire ',/,&
+'@ dans un des "bord de la Gaussienne". ',/,&
+'@ ',/,&
+'@ Diametre moyen : ',E14.5 ,/,&
+'@ Ecart type : ',E14.5 ,/,&
+'@ Diametre calcule : ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Mettre en place une verification du diametre en fonction ',/,&
+'@ des donnees granulometriques dans USLAIN. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/lagr/lageqp.f90 b/src/lagr/lageqp.f90
new file mode 100644
index 0000000..83de878
--- /dev/null
+++ b/src/lagr/lageqp.f90
@@ -0,0 +1,508 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lageqp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , propce , propfa , propfb , &
+ viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ fmala , fmalb , &
+ ul , vl , wl , alphal , phia , phi , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , w12 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! RESOLUTION D'UNE EQUATION DE POISSON
+
+! div[ALPHA grad(PHI)] = div(ALPHA <Up>)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet) ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet) ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! fmala(nfac) ! tr ! --- ! flux de masse au faces internes !
+! fmalb(nfabor) ! tr ! --- ! flux de masse au faces de bord !
+! ul,vl,wl ! tr ! <-- ! vitesse lagrangien !
+! (ncelet) ! ! ! !
+! alphal ! tr ! <-- ! taux de presence !
+! (ncelet) ! ! ! !
+! phi , phia ! tr ! --> ! terme de correction en n et n-1 !
+! (ncelet) ! ! ! !
+! w1..w9(ncelet ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision ul(ncelet), vl(ncelet), wl(ncelet)
+double precision phia(ncelet), phi(ncelet), alphal(ncelet)
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision fmala(nfac) , fmalb(nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet), w12(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra , ifinia , ifinra
+integer idtva0, ivar
+integer ifac, iel
+integer ipp
+integer nswrgp, imligp, iwarnp , iescap
+integer iconvp, idiffp, ndircp, ireslp, nitmap
+integer nswrsp, ircflp, ischcp, isstpp
+integer imgrp, ncymxp, nitmfp
+integer icoefax,icoefay,icoefaz,icefap
+integer icoefbx,icoefby,icoefbz,icefbp
+double precision epsrgp, climgp, extrap, blencp, epsilp, epsrsp
+double precision relaxp, thetap
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+CHAINE = 'Correction pression'
+write(nfecra,1000) chaine(1:19)
+
+!===============================================================================
+! 2. TERMES SOURCES
+!===============================================================================
+
+! --> Initialisation
+
+do iel = 1, ncel
+ smbrs(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ rovsdt(iel) = 0.d0
+enddo
+do iel = 1, ncel
+ phi(iel) = 0.d0
+ phia(iel) = 0.d0
+ drtp(iel) = 0.d0
+enddo
+
+! "VITESSE" DE DIFFUSION FACE
+
+ call viscfa &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ alphal , &
+ viscf , viscb , &
+ rdevel , rtuser , ra )
+
+! CALCUL de div(Alpha Up) avant correction
+
+do iel = 1, ncel
+ w1(iel) = -ul(iel)*alphal(iel)
+ w2(iel) = -vl(iel)*alphal(iel)
+ w3(iel) = -wl(iel)*alphal(iel)
+enddo
+
+! --> Calcul du gradient de W1
+! ========================
+
+! On alloue localement 6 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB de W1,W2,W3
+
+icoefax = idebra
+icoefbx = icoefax + nfabor
+icoefay = icoefbx + nfabor
+icoefby = icoefay + nfabor
+icoefaz = icoefby + nfabor
+icoefbz = icoefaz + nfabor
+ifinra = icoefbz + nfabor
+CALL RASIZE ('LAGEQP',IFINRA)
+!==========
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+
+ ra(icoefax+ifac-1) = w1(iel)
+ ra(icoefbx+ifac-1) = zero
+
+ ra(icoefay+ifac-1) = w2(iel)
+ ra(icoefby+ifac-1) = zero
+
+ ra(icoefaz+ifac-1) = w3(iel)
+ ra(icoefbz+ifac-1) = zero
+
+enddo
+
+call diverv &
+!==========
+ ( idebia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , &
+ smbrs , w1 , w2 , w3 , &
+ ra(icoefax) , ra(icoefay) , ra(icoefaz) , &
+ ra(icoefbx) , ra(icoefby) , ra(icoefbz) , &
+ w4 , w5 , w6 , w7 , w8 , &
+ w9 , w10 , w11 , w12 , &
+ rdevel , rtuser , &
+ ra )
+
+! On libere la place dans RA
+
+ifinra = idebra
+
+! --> Conditions aux limites sur PHI
+! ==============================
+
+! On alloue localement 2 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB de PHI
+
+ifinia = idebia
+icefap = idebra
+icefbp = icefap + nfabor
+ifinra = icefbp + nfabor
+CALL RASIZE ('LAGEQP',IFINRA)
+!==========
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+
+ if ( ia(iitypf+ifac-1) .eq. ientre ) then
+
+! Flux Nul
+
+ ra(icefap+ifac-1) = zero
+ ra(icefbp+ifac-1) = 1.d0
+
+ else if ( ia(iitypf+ifac-1) .eq. iparoi) then
+
+! FLux nul
+
+ ra(icefap+ifac-1) = zero
+ ra(icefbp+ifac-1) = 1.d0
+
+ else if ( ia(iitypf+ifac-1) .eq. iparug) then
+
+! FLux nul
+
+ ra(icefap+ifac-1) = zero
+ ra(icefbp+ifac-1) = 1.d0
+
+ else if ( ia(iitypf+ifac-1) .eq. isymet) then
+
+! FLux nul
+
+ ra(icefap+ifac-1) = zero
+ ra(icefbp+ifac-1) = 1.d0
+
+ else if ( ia(iitypf+ifac-1) .eq. isolib ) then
+
+! Valeur Imposee
+
+ ra(icefap+ifac-1) = phia(iel)
+ ra(icefbp+ifac-1) = zero
+
+ else
+ write(nfecra,1100) ia(iitypf+ifac-1)
+ call csexit (1)
+! ======
+ endif
+
+enddo
+
+!===============================================================================
+! 3. RESOLUTION
+!===============================================================================
+
+! Pas de stationnaire
+idtva0 = 0
+! Pas de terme de convection
+iconvp = 0
+! Diffusion
+idiffp = 1
+! Methode de resolution : Gradient conjugue (pas de convection)
+ireslp = 0
+! Valeur par defaut
+ndircp = 1
+nitmap = 1000
+nswrsp = 2
+nswrgp = 10000
+imligp = 1
+ircflp = 1
+ischcp = 1
+isstpp = 0
+imgrp = 1
+ncymxp = 100
+nitmfp = 100
+iwarnp = 10
+blencp = 0.d0
+epsilp = 1.d-8
+epsrsp = 1.d-8
+epsrgp = 1.d-5
+climgp = 1.5d0
+extrap = 0.d0
+relaxp = 1.d0
+iescap = 0
+
+ipp = 1
+NOMVAR(IPP) = 'PoissonL'
+
+! IVAR = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+
+ivar = 0
+
+! On annule les flux de masse
+
+do ifac = 1,nfac
+ fmala(ifac) = zero
+enddo
+
+do ifac = 1,nfabor
+ fmalb(ifac) = zero
+enddo
+
+! Dans le cas d'un theta-schema on met theta = 1 (ordre 1)
+
+thetap = 1.0d0
+
+call codits &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtva0 , ivar , iconvp , idiffp , ireslp , ndircp , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgrp , ncymxp , nitmfp , ipp , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ phia , phia , ra(icefap) , ra(icefbp) , &
+ ra(icefap) , ra(icefbp) , &
+ fmala , fmalb , &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbrs , phi , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(/, &
+' ** RESOLUTION POUR LA VARIABLE ',A19 ,/,&
+' --------------------------- ',/)
+
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ERREUR A LA RESOLUTION DE L''EQUATION DE POISSON : ',/,&
+'@ CONDITIONS AUX LIMITES SUR PHI NON PREVUES (LAGEQP). ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/lagr/lagerr.f90 b/src/lagr/lagerr.f90
new file mode 100644
index 0000000..8bf0451
--- /dev/null
+++ b/src/lagr/lagerr.f90
@@ -0,0 +1,85 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine lagerr
+!================
+
+
+
+
+!===============================================================================
+! FONCTION
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Ecriture du fichier FICSTP pour une sortie propre si erreur
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "optcal.h"
+include "entsor.h"
+
+!===============================================================================
+
+
+!===============================================================================
+
+OPEN ( IMPSTP, FILE='ficstp', &
+ STATUS='UNKNOWN', &
+ FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL' )
+
+WRITE(IMPSTP,'(A)') ' '
+WRITE(IMPSTP,'(I6)') NTCABS
+WRITE(IMPSTP,'(A)') ' '
+
+close (impstp)
+
+return
+end
diff --git a/src/lagr/lages1.f90 b/src/lagr/lages1.f90
new file mode 100644
index 0000000..1c3609a
--- /dev/null
+++ b/src/lagr/lages1.f90
@@ -0,0 +1,498 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine lages1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , &
+ taup , tlag , piil , &
+ bx , vagaus , gradpr , gradvf , romp , &
+ brgaus , terbru , fextla , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS PAR UN SCHEMA D'ORDRE 1 (scheO1)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (pas de temps precedent) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul des statistiques volumiques !
+!(ncelet,nvlsta ! ! ! !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! piil(nbpmax,3 ! tr ! <-- ! terme dans l'integration des eds up !
+! bx(nbpmax,3,2 ! tr ! <-- ! caracteristiques de la turbulence !
+! vagaus ! tr ! <-- ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! gradpr(ncel,3 ! tr ! <-- ! gradient de pression !
+! gradvf(ncel,3 ! tr ! <-- ! gradient de la vitesse du fluide !
+! romp ! tr ! <-- ! masse volumique des particules !
+! fextla ! tr ! <-- ! champ de forces exterieur !
+!(ncelet,3) ! ! ! utilisateur (m/s2) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod ,lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep) , statis(ncelet,*)
+double precision taup(nbpmax) , tlag(nbpmax,3)
+double precision piil(nbpmax,3) , bx(nbpmax,3,2)
+double precision vagaus(nbpmax,*)
+double precision brgaus(nbpmax,*) , terbru(nbpmax)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision romp(nbpmax)
+double precision fextla(nbpmax,3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , ip , id , i0 , iromf , iphas , mode
+
+double precision aa , bb , cc , dd , ee
+double precision aux1 , aux2 ,aux3 , aux4 , aux5 , aux6
+double precision aux7 , aux8 , aux9 , aux10 , aux11
+double precision ter1f , ter2f , ter3f
+double precision ter1p , ter2p , ter3p , ter4p , ter5p
+double precision ter1x , ter2x , ter3x , ter4x , ter5x
+double precision tci , force
+double precision gama2 , omegam , omega2
+double precision grga2 , gagam , gaome
+double precision p11 , p21 , p22 , p31 , p32 , p33
+double precision grav(3) , rom , vitf
+double precision tempf
+double precision ddbr, tix2, tiu2, tixiu
+double precision tbrix1, tbrix2, tbriu
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+iphas = ilphas
+
+grav(1) = gx
+grav(2) = gy
+grav(3) = gz
+
+! Pointeur sur la masse volumique en fonction de l'ecoulement
+
+if ( ippmod(icp3pl).ge.0 .or. ippmod(icfuel).ge.0 ) then
+ iromf = ipproc(irom1)
+else
+ iromf = ipproc(irom(iphas))
+endif
+
+!===============================================================================
+! 2. INTEGRATION DES EDS SUR LES PARTICULES
+!===============================================================================
+
+do id = 1,3
+
+ i0 = id - 1
+
+ do ip = 1,nbpart
+
+ if (itepa(ip,jisor).gt.0) then
+
+ iel = itepa(ip,jisor)
+
+ rom = propce(iel,iromf)
+
+ if (id.eq.1) vitf = rtpa(iel,iu(iphas))
+ if (id.eq.2) vitf = rtpa(iel,iv(iphas))
+ if (id.eq.3) vitf = rtpa(iel,iw(iphas))
+
+!---> (2.1) Calcul preliminaires :
+! ----------------------------
+
+! calcul de II*TL+<u> et [(grad<P>/rhop+g)*tau_p+<Uf>] ?
+
+ tci = piil(ip,id) * tlag(ip,id) + vitf
+
+ force = &
+ ( rom * gradpr(iel,id) / romp(ip) &
+ +grav(id)+ fextla(ip,id) ) * taup(ip)
+
+!---> (2.2) Calcul des coefficients/termes deterministes :
+! ----------------------------------------------------
+
+! sur HP-UX : l'option de compil +T genere des messages du type :
+! === MATH LIBRARY ERROR 14: DEXP(X) UNDERFLOW
+! au passage de l'exponentiel si l'exposant est < a -7.0D2
+
+
+ aux1 = exp( -dtp / taup(ip))
+ aux2 = exp( -dtp / tlag(ip,id))
+ aux3 = tlag(ip,id) / (tlag(ip,id)-taup(ip))
+
+ aux4 = tlag(ip,id) / (tlag(ip,id)+taup(ip))
+ aux5 = tlag(ip,id) * (1.d0-aux2)
+ aux6 = bx(ip,id,nor) * bx(ip,id,nor) * tlag(ip,id)
+
+ aux7 = tlag(ip,id) - taup(ip)
+ aux8 = bx(ip,id,nor) * bx(ip,id,nor) * aux3**2
+
+!---> termes pour la trajectoire
+
+ aa = taup(ip) * (1.d0 - aux1)
+ bb = (aux5 - aa) * aux3
+ cc = dtp - aa - bb
+
+ ter1x = aa * ettpa(ip,jup+i0)
+ ter2x = bb * ettpa(ip,juf+i0)
+ ter3x = cc * tci
+ ter4x = (dtp - aa) * force
+
+!---> termes pour le fluide vu
+
+ ter1f = ettpa(ip,juf+i0) * aux2
+ ter2f = tci * (1.d0-aux2)
+
+!---> termes pour la vitesse des particules
+
+ dd = aux3 * (aux2 - aux1)
+ ee = 1.d0 - aux1
+
+ ter1p = ettpa(ip,jup+i0) * aux1
+ ter2p = ettpa(ip,juf+i0) * dd
+ ter3p = tci * (ee-dd)
+ ter4p = force * ee
+
+!---> (2.3) Calcul des coefficients pour les integrales stochastiques :
+
+
+!---> integrale sur la position des particules
+
+ gama2 = 0.5d0 * (1.d0 - aux2*aux2 )
+ omegam = 0.5d0 * aux4 * ( aux5 - aux2*aa ) &
+ -0.5d0 * aux2 * bb
+ omegam = omegam * sqrt(aux6)
+
+ omega2 = aux7 &
+ * (aux7*dtp - 2.d0 * (tlag(ip,id)*aux5-taup(ip)*aa)) &
+ + 0.5d0 * tlag(ip,id) * tlag(ip,id) * aux5 &
+ * (1.d0 + aux2) &
+ + 0.5d0 * taup(ip) * taup(ip) * aa * (1.d0+aux1) &
+ - 2.d0 * aux4 * tlag(ip,id) * taup(ip) * taup(ip) &
+ * (1.d0 - aux1*aux2)
+
+ omega2 = aux8 * omega2
+
+
+ if (abs(gama2).gt.epzero) then
+
+ p21 = omegam / sqrt(gama2)
+ p22 = omega2 - p21**2
+
+ p22 = sqrt( max(zero,p22) )
+
+ else
+ p21 = 0.d0
+ p22 = 0.d0
+ endif
+
+ ter5x = p21 * vagaus(ip,id) + p22 * vagaus(ip,3+id)
+
+!---> integrale sur la vitesse du fluide vu
+
+ p11 = sqrt( gama2*aux6 )
+ ter3f = p11*vagaus(ip,id)
+
+!---> integrale sur la vitesse des particules
+
+ aux9 = 0.5d0 * tlag(ip,id) * (1.d0 - aux2*aux2)
+ aux10 = 0.5d0 * taup(ip) * (1.d0 - aux1*aux1)
+ aux11 = taup(ip) * tlag(ip,id) * (1.d0 - aux1*aux2) &
+ / (taup(ip) + tlag(ip,id))
+
+ grga2 = (aux9 - 2.d0*aux11 + aux10) * aux8
+ gagam = (aux9 - aux11) * (aux8 / aux3)
+ gaome = ( (tlag(ip,id) - taup(ip)) * (aux5 - aa) &
+ - tlag(ip,id) * aux9 - taup(ip) * aux10 &
+ + (tlag(ip,id) + taup(ip)) * aux11) * aux8
+
+ if(p11.gt.epzero) then
+ p31 = gagam / p11
+ else
+ p31 = 0.d0
+ endif
+
+ if(p22.gt.epzero) then
+ p32 = (gaome-p31*p21) / p22
+ else
+ p32 = 0.d0
+ endif
+
+ p33 = grga2 - p31**2 - p32**2
+
+ p33 = sqrt( max(zero,p33) )
+
+ ter5p = p31 * vagaus(ip,id) &
+ + p32 * vagaus(ip,3+id) &
+ + p33 * vagaus(ip,6+id)
+
+
+!---> (2.3) Calcul des Termes dans le cas du mouvement Brownien :
+
+
+ if ( lamvbr .eq. 1 ) then
+
+! Calcul de la temperature du fluide en fonction du type
+! d'ecoulement
+
+ if ( ippmod(icp3pl).ge.0 .or. &
+ ippmod(icpl3c).ge.0 ) then
+
+ tempf = propce(iel,ipproc(itemp1))
+
+ else if ( ippmod(icod3p).ge.0 .or. &
+ ippmod(icoebu).ge.0 .or. &
+ ippmod(ielarc).ge.0 .or. &
+ ippmod(ieljou).ge.0 ) then
+
+ tempf = propce(iel,ipproc(itemp))
+
+ else if ( iscsth(iscalt(iphas)).eq.-1 ) then
+ tempf = rtpa(iel,isca(iscalt(iphas)))
+
+ else if ( iscsth(iscalt(iphas)).eq.1 ) then
+ tempf = rtpa(iel,isca(iscalt(iphas)))
+
+ else if ( iscsth(iscalt(iphas)).eq.2 ) then
+ mode = 1
+ call usthht(mode,rtpa(iel,isca(iscalt(iphas))),tempf)
+ !==========
+ tempf = tempf+tkelvi
+ else
+ tempf = t0(iphas)
+ endif
+
+ ddbr = sqrt( 2.d0*kboltz*tempf &
+ /(ettp(ip,jmp)*taup(ip)) )
+ tix2 = (taup(ip)*ddbr)**2 &
+ *(dtp - taup(ip)*(1.d0-aux1) &
+ *(3.d0-aux1) /2.d0 )
+
+ tiu2 = ddbr*ddbr*taup(ip) &
+ *(1.d0-exp(-2.d0*dtp/taup(ip)))/2.d0
+
+ tixiu = (ddbr*taup(ip)*(1.d0-aux1))**2/2.d0
+
+ tbrix2 = tix2-(tixiu*tixiu)/tiu2
+ if ( tbrix2 .gt.0.d0 ) then
+ tbrix2 = sqrt(tbrix2)*brgaus(ip,id)
+ else
+ tbrix2 = 0.d0
+ endif
+
+ if ( tiu2 .gt. 0.d0 ) then
+ tbrix1 = tixiu/sqrt(tiu2)*brgaus(ip,3+id)
+ else
+ tbrix1 = 0.d0
+ endif
+
+ if ( tiu2 .gt. 0.d0 ) then
+ tbriu = sqrt(tiu2)*brgaus(ip,3+id)
+ terbru(ip) = sqrt(tiu2)
+ else
+ tbriu = 0.d0
+ terbru(ip) = 0.d0
+ endif
+
+ else
+ tbrix1 = 0.d0
+ tbrix2 = 0.d0
+ tbriu = 0.d0
+ endif
+
+!===============================================================================
+! 3. FINALISATION DES ECRITURES
+!===============================================================================
+
+!---> trajectoire
+
+ ettp(ip,jxp+i0) = ettpa(ip,jxp+i0) &
+ + ter1x + ter2x + ter3x + ter4x + ter5x &
+ + tbrix1 + tbrix2
+
+!---> vitesse fluide vu
+
+ ettp(ip,juf+i0) = ter1f + ter2f + ter3f
+
+!---> vitesse particules
+
+ ettp(ip,jup+i0) = ter1p + ter2p + ter3p + ter4p + ter5p &
+ + tbriu
+
+ endif
+
+ enddo
+
+enddo
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lages2.f90 b/src/lagr/lages2.f90
new file mode 100644
index 0000000..61bfaa4
--- /dev/null
+++ b/src/lagr/lages2.f90
@@ -0,0 +1,540 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine lages2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , &
+ vagaus , auxl , gradpr , gradvf , &
+ romp , brgaus , terbru , fextla , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS PAR UN SCHEMA D'ORDRE 2 (sche2c)
+
+! Lorsqu'il y a eu interaction avec une face de bord,
+! les calculs de la vitesse de la particule et de
+! la vitesse du fluide vu sont forcement a l'ordre 1
+! (meme si on est a l'ordre 2 par ailleurs).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! --> ! si nordre=2, contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant et prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul des statistiques volumiques !
+!(ncelet,nvlsta ! ! ! !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! piil(nbpmax,3 ! tr ! <-- ! terme dans l'integration des eds up !
+! tsup(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse des particules !
+! tsuf(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse du fluide vu !
+! bx(nbpmax,3,2 ! tr ! <-- ! caracteristiques de la turbulence !
+! tsfext(nbpmax ! tr ! --> ! infos pour couplage retour dynamique !
+! vagaus ! tr ! <-- ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! auxl ! tr ! --- ! tableau auxiliaire !
+! gradpr(ncel,3 ! tr ! <-- ! gradient de pression !
+! gradvf(ncel,3 ! tr ! <-- ! gradient de la vitesse du fluide !
+! romp ! tr ! <-- ! masse volumique des particules !
+! fextla ! tr ! <-- ! champ de forces exterieur !
+!(ncelet,3) ! ! ! utilisateur (m/s2) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep) , statis(ncelet,*)
+double precision taup(nbpmax) , tlag(nbpmax,3)
+double precision piil(nbpmax,3) , bx(nbpmax,3,2)
+double precision tsuf(nbpmax,3) , tsup(nbpmax,3)
+double precision tsfext(nbpmax)
+double precision vagaus(nbpmax,*) , auxl(nbpmax,7)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision romp(nbpmax)
+double precision brgaus(nbpmax,*) , terbru(nbpmax)
+double precision fextla(nbpmax,3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , ip , id , i0 , iromf , iphas
+double precision aux0 , aux1 , aux2 , aux3 , aux4 , aux5
+double precision aux6 , aux7 , aux8 , aux9 , aux10 , aux11
+double precision aux12 , aux14 , aux15 , aux16
+double precision aux17 , aux18 , aux19 , aux20
+double precision ter1 , ter2 , ter3 , ter4 , ter5
+double precision sige , tapn
+double precision gamma2 , omegam , omega2
+double precision grgam2 , gagam , gaome
+double precision p11 , p21 , p22 , p31 , p32 , p33
+double precision grav(3) , rom , vitf
+double precision tbriu
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+iphas = ilphas
+
+grav(1) = gx
+grav(2) = gy
+grav(3) = gz
+
+! Pointeur sur la masse volumique en fonction de l'ecoulement
+
+if ( ippmod(icp3pl).ge.0 .or. ippmod(icfuel).ge.0 ) then
+ iromf = ipproc(irom1)
+else
+ iromf = ipproc(irom(iphas))
+endif
+
+!===============================================================================
+! 2. INTEGRATION DES EDS SUR LES PARTICULES
+!===============================================================================
+
+!===============================================================================
+! 2.1 CALCUL A CHAQUE SOUS PAS DE TEMPS
+!===============================================================================
+
+!---> Calcul de tau_p*A_p et de II*TL+<u> :
+! -------------------------------------
+
+do id = 1,3
+
+ do ip = 1,nbpart
+
+ if (itepa(ip,jisor).gt.0) then
+
+ iel = itepa(ip,jisor)
+
+ rom = propce(iel,iromf)
+
+ auxl(ip,id) = &
+ ( rom *gradpr(iel,id) /romp(ip) &
+ +grav(id)+fextla(ip,id) ) * taup(ip)
+
+ if (nor.eq.1) then
+ if (id.eq.1) vitf = rtpa(iel,iu(iphas))
+ if (id.eq.2) vitf = rtpa(iel,iv(iphas))
+ if (id.eq.3) vitf = rtpa(iel,iw(iphas))
+ else
+ if (id.eq.1) vitf = rtp(iel,iu(iphas))
+ if (id.eq.2) vitf = rtp(iel,iv(iphas))
+ if (id.eq.3) vitf = rtp(iel,iw(iphas))
+ endif
+ auxl(ip,id+3) = piil(ip,id) * tlag(ip,id) + vitf
+
+ endif
+
+ enddo
+
+enddo
+
+!===============================================================================
+! 2.2 ETAPE DE PREDICTION :
+!===============================================================================
+
+if (nor.eq.1) then
+
+
+!---> Sauvegarde de tau_p^n
+! ---------------------
+
+ do ip = 1,nbpart
+
+ if (itepa(ip,jisor).gt.0) then
+
+ auxl(ip,7) = taup(ip)
+
+ endif
+
+ enddo
+
+!---> Sauvegarde couplage
+! -------------------
+
+ if (iilagr.eq.2) then
+
+ do ip = 1,nbpart
+
+ if (itepa(ip,jisor).gt.0) then
+
+ aux0 = -dtp/taup(ip)
+ aux1 = exp(aux0)
+ tsfext(ip) = taup(ip) * ettp(ip,jmp) &
+ * (-aux1 + (aux1-1.d0) / aux0)
+
+ endif
+
+ enddo
+
+ endif
+
+
+!---> Chargement des termes a t = t_n :
+! ---------------------------------
+
+ do id = 1,3
+
+ i0 = id - 1
+
+ do ip = 1,nbpart
+
+ if (itepa(ip,jisor).gt.0) then
+
+ aux0 = -dtp / taup(ip)
+ aux1 = -dtp / tlag(ip,id)
+ aux2 = exp(aux0)
+ aux3 = exp(aux1)
+ aux4 = tlag(ip,id) / (tlag(ip,id) - taup(ip))
+ aux5 = aux3 - aux2
+
+ tsuf(ip,id) = 0.5d0 * ettpa(ip,juf+i0) * aux3 &
+ + auxl(ip,id+3) * ( -aux3 + (aux3-1.d0) /aux1)
+
+ ter1 = 0.5d0 * ettpa(ip,jup+i0) * aux2
+ ter2 = 0.5d0 * ettpa(ip,juf+i0) * aux4 * aux5
+ ter3 = auxl(ip,id+3)* &
+ ( - aux2 + ((tlag(ip,id) + taup(ip)) / dtp) &
+ * (1.d0 - aux2) &
+ - (1.d0 + tlag(ip,id) / dtp) * aux4 * aux5)
+ ter4 = auxl(ip,id) * (-aux2 + (aux2 - 1.d0) / aux0)
+
+ tsup(ip,id) = ter1 + ter2 + ter3 + ter4
+
+ endif
+
+ enddo
+
+ enddo
+
+!---> Schema d'Euler :
+! ----------------
+
+ call lages1 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , taup , tlag , piil , &
+ bx , vagaus , gradpr , gradvf , romp , &
+ brgaus , terbru , fextla , &
+ rdevel , rtuser , ra )
+
+else
+
+!===============================================================================
+! 2.2 ETAPE DE CORRECTION :
+!===============================================================================
+
+!---> Calcul de Us :
+! --------------
+
+ do id = 1,3
+
+ i0 = id - 1
+
+ do ip = 1,nbpart
+
+ if (itepa(ip,jisor).gt.0 .and. ibord(ip).eq.0) then
+
+ aux0 = -dtp / taup(ip)
+ aux1 = -dtp / tlag(ip,id)
+ aux2 = exp(aux0)
+ aux3 = exp(aux1)
+ aux4 = tlag(ip,id) / (tlag(ip,id) - taup(ip))
+ aux5 = aux3 - aux2
+ aux6 = aux3 * aux3
+
+ ter1 = 0.5d0 * ettpa(ip,juf+i0) * aux3
+ ter2 = auxl(ip,id+3) * (1.d0 - (aux3 - 1.d0) / aux1)
+
+ ter3 = -aux6 + (aux6 - 1.d0) / (2.d0 * aux1)
+ ter4 = 1.d0 - (aux6 - 1.d0) / (2.d0 * aux1)
+ sige = (ter3 * bx(ip,id,nor-1) + ter4 * bx(ip,id,nor)) &
+ * (1.d0 / (1.d0 - aux6) )
+
+ ter5 = 0.5d0 * tlag(ip,id) * (1.d0 - aux6)
+
+ ettp(ip,juf+i0) = tsuf(ip,id) + ter1 + ter2 &
+ + sige * sqrt(ter5) * vagaus(ip,id)
+
+!---> Calcul de Up :
+! --------------
+
+ ter1 = 0.5d0 * ettpa(ip,jup+i0) * aux2
+ ter2 = 0.5d0 * ettpa(ip,juf+i0) * aux4 * aux5
+ ter3 = auxl(ip,id+3)* &
+ ( 1.d0 - ((tlag(ip,id) + taup(ip)) /dtp) *(1.d0-aux2) &
+ + (tlag(ip,id) / dtp) * aux4 * aux5) &
+ + auxl(ip,id) * (1.d0 - (aux2 - 1.d0) / aux0)
+
+ tapn = auxl(ip,7)
+ aux7 = exp(-dtp / tapn)
+ aux8 = 1.d0 - aux3 * aux7
+ aux9 = 1.d0 - aux6
+ aux10 = 1.d0 - aux7 * aux7
+
+ aux11 = tapn / (tlag(ip,id) + tapn)
+ aux12 = tlag(ip,id) / (tlag(ip,id) - tapn)
+ aux14 = tlag(ip,id) - tapn
+
+ aux15 = tlag(ip,id) * (1.d0-aux3)
+ aux16 = tapn * (1.d0 - aux7)
+ aux17 = sige * sige * aux12 * aux12
+
+ aux18 = 0.5d0 * tlag(ip,id) * aux9
+ aux19 = 0.5d0 * tapn * aux10
+ aux20 = tlag(ip,id) * aux11 * aux8
+
+! ---> calcul de la matrice de correlation
+
+ gamma2 = sige * sige * aux18
+
+ grgam2 = aux17 * (aux18 - 2.d0 * aux20 + aux19)
+
+ gagam = sige * sige * aux12 * (aux18 - aux20)
+
+ omega2 = aux17 * (aux14 * &
+ (aux14 * dtp - 2.d0 * tlag(ip,id) * aux15 &
+ + 2.d0 * tapn * aux16) &
+ + tlag(ip,id) * tlag(ip,id) * aux18 &
+ + tapn * tapn * aux19 &
+ - 2.d0 * tlag(ip,id) * tapn * aux20)
+
+ omegam = aux14 * (1.d0-aux3) - aux18 + tapn * aux11 * aux8
+ omegam = omegam * sige * sige * aux12 * tlag(ip,id)
+
+ gaome = aux17 * (aux14 * (aux15 - aux16) - tlag(ip,id) &
+ * aux18 - tapn * aux19 + tapn * tlag(ip,id) * aux8 )
+
+! ---> simulation du vecteur Gaussien
+
+ p11 = sqrt( max (zero,gamma2) )
+
+ if (p11.gt.epzero) then
+ p21 = omegam / p11
+ p22 = omega2 - p21 * p21
+ p22 = sqrt( max (zero,p22) )
+ else
+ p21 = 0.d0
+ p22 = 0.d0
+ endif
+
+ if (p11.gt.epzero) then
+ p31 = gagam / p11
+ else
+ p31 = 0.d0
+ endif
+
+ if (p22.gt.epzero) then
+ p32 = (gaome - p31 * p21) / p22
+ else
+ p32 = 0.d0
+ endif
+
+ p33 = grgam2 - p31 * p31 - p32 * p32
+ p33 = sqrt( max(zero,p33) )
+
+ ter4 = p31 * vagaus(ip,id) &
+ + p32 * vagaus(ip,3+id) + p33 * vagaus(ip,6+id)
+
+! ---> Calcul des Termes dans le cas du mouvement Brownien
+
+ if ( lamvbr .eq. 1 ) then
+ tbriu = terbru(ip)*brgaus(ip,3+id)
+ else
+ tbriu = 0.d0
+ endif
+
+! ---> finalisation de l'ecriture
+
+ ettp(ip,jup+i0) = tsup(ip,id) +ter1 +ter2 +ter3 +ter4 &
+ + tbriu
+
+ endif
+
+ enddo
+
+ enddo
+
+endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagesp.f90 b/src/lagr/lagesp.f90
new file mode 100644
index 0000000..144cc21
--- /dev/null
+++ b/src/lagr/lagesp.f90
@@ -0,0 +1,357 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagesp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , stativ , &
+ taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , &
+ vagaus , gradpr , gradvf , brgaus , terbru , romp , auxl2 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS PAR UN SCHEMA D'ORDRE 2 : LAGES2
+! INTEGRATION DES EDS PAR UN SCHEMA D'ORDRE 1 : LAGES1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! --> ! si nordre=2, contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! piil(nbpmax,3 ! tr ! --> ! terme dans l'integration des eds up !
+! tsup(nbpmax,3 ! tr ! --> ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse des particules !
+! tsuf(nbpmax,3 ! tr ! --> ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse du fluide vu !
+! bx(nbpmax,3,2 ! tr ! <-- ! caracteristiques de la turbulence !
+! tsfext(nbpmax ! tr ! <-- ! infos pour le couplage retour !
+! vagaus ! tr ! <-- ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! gradpr(ncel,3 ! tr ! <-- ! gradient de pression !
+! gradvf(ncel,3 ! tr ! <-- ! gradient de la vitesse du fluide !
+! romp ! tr ! --- ! masse volumique des particules !
+! auxl2 ! tr ! --- ! tableau de travail !
+! (nbpmax,7) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,*),stativ(ncelet,*)
+double precision taup(nbpmax) , tlag(nbpmax,3)
+double precision piil(nbpmax,3) , bx(nbpmax,3,2)
+double precision tsuf(nbpmax,3) , tsup(nbpmax,3)
+double precision tsfext(nbpmax)
+double precision vagaus(nbpmax,*)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision brgaus(nbpmax,*) , terbru(nbpmax)
+double precision romp(nbpmax) , auxl2(nbpmax,7)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ip , ifinia , ifinra, ifexla
+double precision d3 , aa
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! Calcul de la masse volumique des particules
+
+aa = 6.d0 / pi
+do ip = 1,nbpart
+ if ( itepa(ip,jisor).gt.0 ) then
+ d3 = ettp(ip,jdp) * ettp(ip,jdp) * ettp(ip,jdp)
+ romp(ip) = aa * ettp(ip,jmp) / d3
+ endif
+enddo
+
+!===============================================================================
+! 2. PRISE EN COMPTE DES FORCES UTILISATEURS EXTERIEURES
+!===============================================================================
+
+ifinia = idebia
+ifexla = idebra
+ifinra = ifexla + 3*nbpmax
+CALL RASIZE('LAGESP',IFINRA)
+!==========
+
+do ip = 1,3*nbpmax
+ ra(ifexla+ip-1) = 0.d0
+enddo
+
+call uslafe &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , stativ , &
+ taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , &
+ vagaus , gradpr , gradvf , &
+ romp , ra(ifexla) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 3. PRISE EN COMPTE DES FORCES CHIMIQUES
+! - Forces de Van der Vaals
+! - Forces electrostatiques
+!===============================================================================
+
+if ( ladlvo .eq. 1 ) then
+
+ call lagfch &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , stativ , &
+ taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , &
+ vagaus , gradpr , gradvf , &
+ romp , ra(ifexla) , &
+ rdevel , rtuser , ra )
+
+ endif
+
+!===============================================================================
+! 4. ORDRE 1
+!===============================================================================
+
+if (nordre.eq.1) then
+
+ call lages1 &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ ettp , ettpa , tepa , &
+ statis , taup , tlag , piil , &
+ bx , vagaus , gradpr , gradvf , romp , &
+ brgaus , terbru , ra(ifexla) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 5. ORDRE 2
+!===============================================================================
+
+else
+
+ call lages2 &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , &
+ statis , taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , vagaus , &
+ auxl2 , gradpr , gradvf , &
+ romp , brgaus , terbru , ra(ifexla) , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+
+end
diff --git a/src/lagr/lagfch.f90 b/src/lagr/lagfch.f90
new file mode 100644
index 0000000..fef6af7
--- /dev/null
+++ b/src/lagr/lagfch.f90
@@ -0,0 +1,495 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagfch &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , stativ , &
+ taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , &
+ vagaus , gradpr , gradvf , &
+ romp , fextla , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! CALCUL DES FORCES DLVO
+
+! - FORCES DE VAN DER WAALS
+! - FORCES ELECTROSTATIQUES
+
+! ELLES DOIVENT ETRE CONNUES EN CHAQUE CELLULE
+! ET ETRE HOMOGENES A LA GRAVITE (M/S2)
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! --> ! si nordre=2, contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! piil(nbpmax,3 ! tr ! <-- ! terme dans l'integration des eds up !
+! tsup(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse des particules !
+! tsuf(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse du fluide vu !
+! bx(nbpmax,3,2 ! tr ! <-- ! caracteristiques de la turbulence !
+! tsfext(nbpmax ! tr ! <-- ! infos pour le couplage retour !
+! vagaus ! tr ! <-- ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! gradpr(ncel,3 ! tr ! <-- ! gradient de pression !
+! gradvf(ncel,3 ! tr ! <-- ! gradient de la vitesse du fluide !
+! romp ! tr ! --- ! masse volumique des particules !
+! fextla ! tr ! --> ! champ de forces exterieur !
+!(ncelet,3) ! ! ! utilisateur (m/s2) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,*),stativ(ncelet,*)
+double precision taup(nbpmax) , tlag(nbpmax,3)
+double precision piil(nbpmax,3) , bx(nbpmax,3,2)
+double precision tsuf(nbpmax,3) , tsup(nbpmax,3)
+double precision tsfext(nbpmax)
+double precision vagaus(nbpmax,*)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision romp(nbpmax)
+double precision fextla(nbpmax,3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra,ifinia , ifinra
+integer idppar, inxpar, inypar, inzpar
+integer ip , iel , iphas , mode
+
+double precision val , tempf , dnorm
+double precision debye, aa
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE ET INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = 1
+
+!===============================================================================
+! 1. CALCUL DE LA DISTANCE A LA PAROI + NORMAL A LA PAROI
+!===============================================================================
+
+ifinia = idebia
+idppar = idebra
+inxpar = idppar + nbpart
+inypar = inxpar + nbpart
+inzpar = inypar + nbpart
+ifinra = inzpar + nbpart
+CALL RASIZE('LAGFCH',IFINRA)
+!==========
+
+do ip = 1,nbpart
+ ra(idppar+ip-1) = 0.d0
+ ra(inxpar+ip-1) = 0.d0
+ ra(inypar+ip-1) = 0.d0
+ ra(inzpar+ip-1) = 0.d0
+enddo
+
+call usladp &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , &
+ taup , tlag , piil , &
+ vagaus , gradpr , gradvf , &
+ romp , &
+ ra(idppar) ,ra(inxpar) , ra(inypar) , ra(inzpar) , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 2. FORCES DE VAN DER WAALS
+! Pour etre homogene a des m/s2 on divise par la masse
+!===============================================================================
+
+do ip = 1,nbpart
+
+! Force = -A/6 dp/2 /D**2
+
+ if ( ra(idppar+ip-1) .gt. dparmn ) then
+
+ val = (cstham*ettp(ip,jdp)/2.d0) &
+ /(6.d0*ra(idppar+ip-1)*ra(idppar+ip-1))
+
+ dnorm = sqrt( ra(inxpar+ip-1)*ra(inxpar+ip-1) &
+ +ra(inypar+ip-1)*ra(inypar+ip-1) &
+ +ra(inzpar+ip-1)*ra(inzpar+ip-1) )
+
+! Attention la normale est oriente du fluide vers l'exterieur
+
+ aa = dnorm*ettp(ip,jmp)
+
+ fextla(ip,1) = fextla(ip,1) + val*ra(inxpar+ip-1) /aa
+ fextla(ip,2) = fextla(ip,2) + val*ra(inypar+ip-1) /aa
+ fextla(ip,3) = fextla(ip,3) + val*ra(inzpar+ip-1) /aa
+
+ endif
+
+enddo
+
+!===============================================================================
+! 3. FORCES ELECTROSTATIQUES
+! Pour etre homogene a des m/s2 on divise par la masse
+!===============================================================================
+
+do ip = 1,nbpart
+
+ iel = itepa(ip,jisor)
+
+! Calcul de la temperature du fluide en fonction du type
+! d'ecoulement
+
+ if ( ra(idppar+ip-1) .gt. dparmn ) then
+
+ if ( ippmod(icp3pl).ge.0 .or. &
+ ippmod(icpl3c).ge.0 ) then
+
+ tempf = propce(iel,ipproc(itemp1)) - tkelvi
+
+ else if ( ippmod(icod3p).ge.0 .or. &
+ ippmod(icoebu).ge.0 .or. &
+ ippmod(ielarc).ge.0 .or. &
+ ippmod(ieljou).ge.0 ) then
+
+ tempf = propce(iel,ipproc(itemp)) - tkelvi
+
+ else if ( iscsth(iscalt(iphas)).eq.-1 ) then
+ tempf = rtp(iel,isca(iscalt(iphas)))
+
+ else if ( iscsth(iscalt(iphas)).eq.1 ) then
+ tempf = rtp(iel,isca(iscalt(iphas))) - tkelvi
+
+ else if ( iscsth(iscalt(iphas)).eq.2 ) then
+ mode = 1
+ call usthht (mode, rtp(iel,isca(iscalt(iphas))), tempf)
+ !==========
+ else
+ tempf = t0(iphas)
+ endif
+
+! FORCE :
+
+! Longueur de Debye
+
+ if (fion .ne. 0 .and. cstfar .gt. 0.d0) then
+ debye = sqrt( (epseau*epsvid*rr*tempf) &
+ /(2000.d0*cstfar*cstfar*fion) )
+ else
+ write(nfecra,9001) fion,cstfar
+ call csexit(1)
+ endif
+
+ if ( debye .gt. 0.d0 ) then
+ debye = sqrt(debye)
+ else
+ write(nfecra,9002) ip,debye,tempf,fion,epseau,epsvid
+ call csexit(1)
+ endif
+
+ val = -4.d0*pi*epseau*epsvid*phi1*phi2*(ettp(ip,jdp)/2.d0) &
+ *exp(-ra(idppar+ip-1)/debye) &
+ /debye
+
+ dnorm = sqrt( ra(inxpar+ip-1)*ra(inxpar+ip-1) &
+ +ra(inypar+ip-1)*ra(inypar+ip-1) &
+ +ra(inzpar+ip-1)*ra(inzpar+ip-1) )
+
+! Attention la normale est oriente du fluide vers l'exterieur
+
+ fextla(ip,1)= fextla(ip,1)+val*ra(inxpar+ip-1) &
+ /(dnorm*ettp(ip,jmp))
+ fextla(ip,2)= fextla(ip,2)+val*ra(inypar+ip-1) &
+ /(dnorm*ettp(ip,jmp))
+ fextla(ip,3)= fextla(ip,3)+val*ra(inzpar+ip-1) &
+ /(dnorm*ettp(ip,jmp))
+
+ endif
+
+enddo
+
+!===============================================================================
+! 4. FORCES D'ADHESION
+!===============================================================================
+
+if ( dcoup .gt. 0.d0 ) then
+ gamasv = cstham/(24.d0*pi*dcoup*dcoup)
+else
+ write(nfecra,9010) dcoup
+ call csexit(1)
+endif
+
+do ip = 1,nbpart
+
+! Force = 3*PI*(Dp/2)*Gamma_SV + SIG2*PI*(Dp/2)/Eps0
+
+ if ( ra(idppar+ip-1) .le. dparmn ) then
+
+ val = 3.d0*pi*(ettp(ip,jdp)/2.d0)*gamasv &
+ + sigch*sigch*pi*(ettp(ip,jdp)/2.d0)/epsvid
+
+ dnorm = sqrt( ra(inxpar+ip-1)*ra(inxpar+ip-1) &
+ +ra(inypar+ip-1)*ra(inypar+ip-1) &
+ +ra(inzpar+ip-1)*ra(inzpar+ip-1) )
+
+! Attention la normale est oriente du fluide vers l'exterieur
+
+ aa = dnorm*ettp(ip,jmp)
+
+ fextla(ip,1)= fextla(ip,1)+val*ra(inxpar+ip-1) /aa
+ fextla(ip,2)= fextla(ip,2)+val*ra(inypar+ip-1) /aa
+ fextla(ip,3)= fextla(ip,3)+val*ra(inzpar+ip-1) /aa
+
+ endif
+
+enddo
+
+!==============================================================================
+
+!--------
+! FORMATS
+!--------
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA VALEUR DE LA FORCE IONIQUE EST NULLE ',/,&
+'@ OU LA VALEUR DE LA CONSTANTE DE FARADET EST NEGATIVE ',/,&
+'@ OU NULLEE ',/,&
+'@ ',/,&
+'@ FORCE IONIQUE : ',G15.7 ,/,&
+'@ CSTE DE FARADET : ',G15.7 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs de FION et de CSTFAR ',/,&
+'@ dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA VALEUR DE L''EPAISSEUR DE LA DOUBLE COUCHE ',/,&
+'@ EST NEGATIVE OU NULLE : ',/,&
+'@ NUMERO DE PARTICULE : ',I10 ,/,&
+'@ EPAISSEUR : ',G15.7 ,/,&
+'@ TEMPERATURE : ',G15.7 ,/,&
+'@ FORCE IONIQUE : ',G15.7 ,/,&
+'@ CSTE DIELECTIQUE DU VIDE : ',G15.7 ,/,&
+'@ CSTE DIELECTIQUE DE L''EAU : ',G15.7 ,/,&
+'@ CSTE DE FARADET : ',G15.7 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs des CSTES dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA VALEUR DE DISTANCE DE COUPURE EST ',/,&
+'@ EST NEGATIVE OU NULLE : ',G15.7 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs des CSTES dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/laggra.f90 b/src/lagr/laggra.f90
new file mode 100644
index 0000000..3c926f0
--- /dev/null
+++ b/src/lagr/laggra.f90
@@ -0,0 +1,420 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine laggra &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , propce , coefa , coefb , &
+ gradpr , gradvf , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! 1) Calcul de (- (GRADIENT DE PRESSION) / ROM )
+
+! 2) Calcul du gradient de Vitesse
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! coefa,coefb ! tr ! <-- ! tableaux des cond lim pour pvar !
+! (nfabor) ! ! ! sur la normale a la face de bord !
+! gradpr(ncel,3 ! tr ! --> ! gradient de pression !
+! gradvf(ncel,9 ! tr ! --> ! gradient de vitesse fluide !
+! w1...w3(ncel) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision coefa(ndimfb,*) , coefb(ndimfb,*)
+double precision rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+integer inc , iccocg , ipriph , iclipr
+integer iuiph , iviph , iwiph
+integer ipcliu , ipcliv , ipcliw
+integer iromf , idimte , itenso
+integer iel , iphydp , iphas
+double precision unsrho
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 0. PARAMETRES
+!===============================================================================
+
+!-->Rappel de differents paramtrage possibles pour le calcul du gradient
+
+! INC = 1 ! 0 RESOL SUR INCREMENT 1 SINON
+! ICCOCG = 1 ! 1 POUR RECALCUL DE COCG 0 SINON
+! NSWRGR = 100 ! mettre 1 pour un maillage regulie (par defaut : 100)
+! IMLIGR = -1 ! LIMITATION DU GRADIENT : < 0 PAS DE LIMITATION
+! IWARNI = 1 ! NIVEAU D'IMPRESSION
+! EPSRGR = 1.D-8 ! PRECISION RELATIVE POUR LA REC GRA 97
+! CLIMGR = 1.5D0 ! COEF GRADIENT*DISTANCE/ECART
+! EXTRAG = 0 ! COEF GRADIENT*DISTANCE/ECART
+! IPHYDP = 0 ! =1 NE CONCERNE QUE LE GRADIENT DE PRESSION
+
+
+!-->Parametrage des calculs des gradients
+
+inc = 1
+iccocg = 1
+iphydp = 0
+
+!-->Numero de la phase continue qui est la phase porteuse
+
+iphas = ilphas
+
+!===============================================================================
+! 1. CALCUL DE : - (GRADIENT DE PRESSION)/ROM
+!===============================================================================
+
+ipriph = ipr(iphas)
+iclipr = iclrtp(ipriph,icoef)
+
+! Calcul du gradient de pression
+
+
+! ---> TRAITEMENT DU PARALLELISME
+
+if (irangp.ge.0) call parcom (rtp(1,ipriph))
+ !==========
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ (idimte , itenso , &
+ rtp(1,ipriph) , rtp(1,ipriph) , rtp(1,ipriph) , &
+ rtp(1,ipriph) , rtp(1,ipriph) , rtp(1,ipriph) , &
+ rtp(1,ipriph) , rtp(1,ipriph) , rtp(1,ipriph) )
+endif
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ipriph , imrgra , inc , iccocg , &
+ nswrgr(ipriph) , imligr(ipriph) , iphydp , &
+ iwarni(ipriph) , nfecra , &
+ epsrgr(ipriph) , climgr(ipriph) , extrag(ipriph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtp(1,ipriph) , coefa(1,iclipr) , coefb(1,iclipr) , &
+ gradpr(1,1) , gradpr(1,2) , gradpr(1,3) , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+! Pointeur sur la masse volumique en fonction de l'ecoulement
+
+if ( ippmod(icp3pl).ge.0 .or. ippmod(icfuel).ge.0 ) then
+ iromf = ipproc(irom1)
+else
+ iromf = ipproc(irom(iphas))
+endif
+
+! Calcul de -Grad P / Rom
+
+do iel = 1,ncel
+ unsrho = 1.d0 / propce(iel,iromf)
+ gradpr(iel,1) = -gradpr(iel,1) * unsrho
+ gradpr(iel,2) = -gradpr(iel,2) * unsrho
+ gradpr(iel,3) = -gradpr(iel,3) * unsrho
+enddo
+
+!===============================================================================
+! 2. CALCUL DU GRADIENT DE VITESSE :
+!===============================================================================
+
+if (modcpl.gt.0 .and. iplas.ge.modcpl) then
+
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+ ipcliu = iclrtp(iuiph,icoef)
+ ipcliv = iclrtp(iviph,icoef)
+ ipcliw = iclrtp(iwiph,icoef)
+
+! ---> TRAITEMENT DU PARALLELISME
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,iuiph))
+ !==========
+ call parcom (rtp(1,iviph))
+ !==========
+ call parcom (rtp(1,iwiph))
+ !==========
+ endif
+
+! ---> TRAITEMENT DE LA PERIODICITE
+
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ (idimte , itenso , &
+ rtp(1,iuiph),rtp(1,iuiph),rtp(1,iuiph), &
+ rtp(1,iviph),rtp(1,iviph),rtp(1,iviph), &
+ rtp(1,iwiph),rtp(1,iwiph),rtp(1,iwiph) )
+ endif
+
+! COMPOSANTE X
+! ============
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , &
+ nswrgr(iuiph) , imligr(iuiph) , iphydp , &
+ iwarni(iuiph) , nfecra , &
+ epsrgr(iuiph) , climgr(iuiph) , extrag(iuiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtp(1,iuiph) , coefa(1,ipcliu) , coefb(1,ipcliu) , &
+ gradvf(1,1) , gradvf(1,2) , gradvf(1,3) , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+! COMPOSANTE Y
+! ============
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iviph , imrgra , inc , iccocg , &
+ nswrgr(iviph) , imligr(iviph) , iphydp , &
+ iwarni(iviph) , nfecra , &
+ epsrgr(iviph) , climgr(iviph) , extrag(iviph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtp(1,iviph) , coefa(1,ipcliv) , coefb(1,ipcliv) , &
+ gradvf(1,4) , gradvf(1,5) , gradvf(1,6) , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+! COMPOSANTE Z
+! ============
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iwiph , imrgra , inc , iccocg , &
+ nswrgr(iwiph) , imligr(iwiph) , iphydp , &
+ iwarni(iwiph) , nfecra , &
+ epsrgr(iwiph) , climgr(iwiph) , extrag(iwiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ rtp(1,iwiph) , coefa(1,ipcliw) , coefb(1,ipcliw) , &
+ gradvf(1,7) , gradvf(1,8) , gradvf(1,9) , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/lagr/laghis.f90 b/src/lagr/laghis.f90
new file mode 100644
index 0000000..4f1d1b1
--- /dev/null
+++ b/src/lagr/laghis.f90
@@ -0,0 +1,505 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine laghis &
+!================
+
+ ( idbia0 , idbra0 , ndim , ncelet , ncel , &
+ nideve , nrdeve , nituse , nrtuse , modhis , nvlsta , &
+ idevel , ituser , ia , &
+ xyzcen , volume , statis , stativ , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE D'ECRITURE DES HISTORIQUES POUR LE LAGRANGIEN
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! modhis ! e ! <-- ! indicateur valant 0,1 ou 2 !
+! ! ! ! 1,2 = ecriture intermediaire, finale |
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra ! tr ! -- ! tableau des reels !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "cstnum.h"
+include "optcal.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0, idbra0
+integer ndim, ncelet, ncel
+integer nideve , nrdeve , nituse , nrtuse , nvlsta
+integer modhis
+integer idevel(nideve), ituser(nituse), ia(*)
+double precision xyzcen(ndim,ncelet) , volume(ncelet)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character nomfic*300, nenvar*300
+integer ii, ii1, ii2, lpos, inam1, inam2, lng
+integer icap,ncap,ipp,ipp2,nbpdte, jtcabs
+integer idmoyd, idebia, idebra, ifinia ,ifinra
+integer iel , ivarl
+integer nbcap(nvppmx)
+integer ipas , ilpd1 , il , ilfv1 , icla , ilts1
+
+double precision xtcabs,xyztmp(3)
+double precision varcap(ncaptm)
+double precision dmoy
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 0. INITIALISATIONS LOCALES
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+! Test : Si il n'y a pas de capteur ====> On ne fait rien
+
+if(ncapt.le.0) return
+
+!===============================================================================
+! 2. OUVERTURE DU FICHIER DE STOCKAGE histla.tmp
+!===============================================================================
+
+if(ipass.eq.1 .and. irangp.le.0) then
+ NOMFIC = ' '
+ nomfic = emphis
+ call verlon ( nomfic,ii1,ii2,lpos)
+ !==========
+
+ NOMFIC(II2+1:II2+10) = 'histla.tmp'
+ ii2 = ii2+10
+ open ( unit=impli1, file=nomfic (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='UNFORMATTED', &
+ ACCESS='SEQUENTIAL')
+endif
+
+!===============================================================================
+! 3. ECRITURE DES RESULTATS dans le FICHIER DE STOCKAGE
+!===============================================================================
+
+if(modhis.eq.0.or.modhis.eq.1) then
+
+ ifinia = idebia
+ idmoyd = idebra
+ ifinra = idmoyd + ncelet
+ CALL RASIZE('LAGHIS',IFINRA)
+ !==========
+
+ do ipas = 1,1+nbclst
+
+! Moyenne
+
+ do il = 1,nvlsta
+
+ ivarl = (ipas-1)*nvlsta+il
+ ilpd1 = (ipas-1)*nvlsta+ilpd
+ ilfv1 = (ipas-1)*nvlsta+ilfv
+ icla = ipas -1
+
+! Pour l'instant on fait des chrono sur toutes les variables Stat. Lag.
+! et sur tout les capteurs
+
+ if ( ihslag(ivarl).ge. 1 ) then
+
+ if ( ivarl .ne. ilpd1 .and. ivarl .ne. ilfv1 ) then
+ do iel=1,ncel
+ if ( statis(iel,ilpd1) .gt. seuil ) then
+ ra(idmoyd+iel-1) = statis(iel,ivarl) &
+ /statis(iel,ilpd1)
+ else
+ ra(idmoyd+iel-1) = 0.d0
+ endif
+ enddo
+
+ else if (ivarl.eq.ilpd1) then
+ do iel=1,ncel
+ ra(idmoyd+iel-1) = statis(iel,ivarl)
+ enddo
+ else
+ do iel=1,ncel
+ if (npst.gt.0) then
+ ra(idmoyd+iel-1) = statis(iel,ivarl) &
+ /(dble(npst)*volume(iel))
+ else
+ ra(idmoyd+iel-1) = 0.d0
+ endif
+ enddo
+ endif
+
+ do icap = 1, ncapt
+ if (irangp.lt.0) then
+ varcap(icap) = ra(idmoyd+nodcap(icap)-1)
+ else
+ call parhis(nodcap(icap), ndrcap(icap), &
+ !==========
+ ra(idmoyd), varcap(icap))
+ endif
+ enddo
+ ncap = ncapt
+
+ if (irangp.le.0) then
+ write(impli1) ntcabs, ttcabs, (varcap(icap), &
+ icap=1,ncap)
+
+
+ endif
+
+ endif
+ enddo
+
+! Variance
+
+ do il = 1,nvlsta-1
+
+ ivarl = (ipas-1)*nvlsta+il
+ ilpd1 = (ipas-1)*nvlsta+ilpd
+ ilfv1 = (ipas-1)*nvlsta+ilfv
+ ilts1 = (ipas-1)*nvlsta+ilts
+ icla = ipas -1
+
+! Pour l'instant on fait des chrono sur toutes les variables Stat. Lag.
+! et sur tout les capteurs
+
+ if ( ihslag(ivarl).eq. 2 ) then
+ do iel = 1, ncel
+
+ if ( ivarl.ne.ilfv ) then
+ if ( statis(iel,ilpd1).gt.seuil ) then
+ ra(idmoyd+iel-1) = stativ(iel,ivarl)/statis(iel,ilpd1) &
+ -( statis(iel,ivarl)/statis(iel,ilpd1) &
+ *statis(iel,ivarl)/statis(iel,ilpd1) )
+ else
+ ra(idmoyd+iel-1) = zero
+ endif
+ else
+ if ( statis(iel,ilpd1).gt.seuil .and. npst.gt.0 ) then
+ dmoy = statis(iel,ivarl) &
+ /(dble(npst)*volume(iel))
+ ra(idmoyd+iel-1) = stativ(iel,ivarl) &
+ /( dble(npst) * volume(iel) ) &
+ -dmoy*dmoy
+
+ else if ( statis(iel,ilpd1).gt.seuil .and. &
+ iplas.ge.idstnt ) then
+ dmoy = statis(iel,ivarl) / volume(iel)
+ ra(idmoyd+iel-1) = stativ(iel,ilfv) / volume(iel) &
+ -dmoy*dmoy
+ else
+ ra(idmoyd+iel-1) = zero
+ endif
+ endif
+ ra(idmoyd+iel-1) = sqrt( max(zero,ra(idmoyd+iel-1)))
+ enddo
+
+ do icap = 1, ncapt
+ if (irangp.lt.0) then
+ varcap(icap) = ra(idmoyd+nodcap(icap)-1)
+ else
+ call parhis(nodcap(icap), ndrcap(icap), &
+ !==========
+ ra(idmoyd), varcap(icap))
+ endif
+ enddo
+ ncap = ncapt
+
+ if (irangp.le.0) then
+ write(impli1) ntcabs, ttcabs, (varcap(icap), &
+ icap=1,ncap)
+ endif
+
+ endif
+ enddo
+
+ enddo
+
+endif
+
+!===============================================================================
+! 4. EN CAS DE SAUVEGARDE INTERMEDIAIRE OU FINALE,
+! TRANSMISSION DES INFORMATIONS DANS LES DIFFERENTS FICHIERS
+!===============================================================================
+
+! On sauve aussi au premier passage pour permettre une
+! verification des le debut du calcul
+
+if(modhis.eq.1.or.modhis.eq.2.or.ipass.eq.1) then
+
+! --> nombre de pas de temps enregistres
+
+ if(modhis.eq.2) then
+ nbpdte = ipass - 1
+ else
+ nbpdte = ipass
+ endif
+
+! --> nombre de capteur par variable
+ do ipp = 1, 2*nvlsta
+ nbcap(ipp) = ncapt
+ enddo
+
+! --> ecriture un fichier par variable
+
+
+ do ipas = 1,1+nbclst
+
+ do ipp = 1, 2*nvlsta
+
+ if ( ipp .le. nvlsta) then
+ ivarl = (ipas-1)*nvlsta+il
+ ilpd1 = (ipas-1)*nvlsta+ilpd
+ ilfv1 = (ipas-1)*nvlsta+ilfv
+ ilts1 = (ipas-1)*nvlsta+ilts
+ icla = ipas -1
+ else
+ ivarl = (ipas-1)*nvlsta+(il-nvlsta)
+ ilpd1 = (ipas-1)*nvlsta+ilpd
+ ilfv1 = (ipas-1)*nvlsta+ilfv
+ ilts1 = (ipas-1)*nvlsta+ilts
+ icla = ipas -1
+ endif
+
+ if ( (ipp .le. nvlsta .and. ihslag(ipp).ge. 1 ) &
+ .or. &
+ (ipp .gt. nvlsta .and. (ipp-nvlsta).ne.ilpd &
+ .and. ihslag(ipp-nvlsta).eq. 2 ) )then
+
+ if(irangp.le.0) then
+! --> nom du fichier
+ NOMFIC = ' '
+ nomfic = emphis
+ call verlon (nomfic,ii1,ii2,lpos)
+ !==========
+
+ if ( ipas.eq.1 ) then
+ if ( ipp.le.nvlsta ) then
+ nenvar = nomlag(ipp)
+ else
+ nenvar = nomlav(ipp-nvlsta)
+ endif
+ else
+ if ( ipp.le.nvlsta ) then
+ WRITE(NENVAR,'(A8,A4,I3)') &
+ NOMLAG(IPP),'_grp',ICLA
+ else
+ WRITE(NENVAR,'(A8,A4,I3)') &
+ NOMLAV(IPP-NVLSTA),'_grp',ICLA
+ endif
+ endif
+ call verlon(nenvar,inam1,inam2,lpos)
+ !==========
+ call undscr(inam1,inam2,nenvar)
+ !==========
+ NOMFIC(II2+1:II2+4)='Lag_'
+ nomfic(ii2+4+1:ii2+4+lpos) = nenvar(inam1:inam2)
+ ii2 = ii2+4+lpos
+ NOMFIC(II2+1:II2+1) = '.'
+ ii2 = ii2+1
+ nenvar = exthis
+ call verlon(nenvar,inam1,inam2,lpos)
+ !==========
+ call undscr(inam1,inam2,nenvar)
+ !==========
+ nomfic(ii2+1:ii2+lpos) = nenvar(inam1:inam2)
+ ii2 = ii2+lpos
+! --> ouverture
+ open ( unit=impli2, file=nomfic (ii1:ii2), &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL')
+! --> entete
+ write(impli2,100)
+ write(impli2,101)
+ write(impli2,102) nomlag(ipp)
+ write(impli2,100)
+ write(impli2,103)
+ write(impli2,104)
+ write(impli2,103)
+ endif
+
+ do ii=1,ncapt
+ if (irangp.lt.0 .or. &
+ irangp.eq.ndrcap(ii)) then
+ xyztmp(1) = xyzcen(1,nodcap(ii))
+ xyztmp(2) = xyzcen(2,nodcap(ii))
+ xyztmp(3) = xyzcen(3,nodcap(ii))
+ endif
+ if (irangp.ge.0) then
+ lng = 3
+ call parbcr(ndrcap(ii), lng , xyztmp)
+ !==========
+ endif
+ if(irangp.le.0) then
+ write(impli2,105) ii, &
+ xyztmp(1), xyztmp(2), xyztmp(3)
+ endif
+ enddo
+
+ if(irangp.le.0) then
+
+ write(impli2,103)
+ write(impli2,106) nbpdte
+ write(impli2,103)
+
+ write(impli2,103)
+ write(impli2,107)
+ write(impli2,103)
+
+ write(impli2,100)
+ write(impli2,103)
+
+! --> boucle sur les differents enregistrements
+! et les variables
+ rewind(impli1)
+ do ii = 1, nbpdte
+ do ipp2 = 1, 2*nvlsta
+ if ( (ipp2 .le.nvlsta &
+ .and. ihslag(ipp2) .ge. 1 ) &
+ .or. &
+ (ipp2 .gt.nvlsta &
+ .and. ihslag(ipp2-nvlsta) .eq. 2 ) ) then
+
+ read(impli1) &
+ jtcabs, xtcabs, (varcap(icap),icap=1,nbcap(ipp2))
+
+ if(ipp2.eq.ipp) &
+ write(impli2,1000) &
+ jtcabs, xtcabs, (varcap(icap),icap=1,nbcap(ipp))
+
+ endif
+ enddo
+ enddo
+
+! --> fermeture fichier
+ close(impli2)
+
+ endif
+
+ endif
+
+ enddo
+
+ enddo
+
+endif
+
+!===============================================================================
+! 5. EN CAS DE SAUVEGARDE FINALE, DESTRUCTION DU TMP
+!===============================================================================
+
+!MO IF(MODHIS.EQ.2) THEN
+!MO NOMFIC = ' '
+!MO NOMFIC = EMPHIS
+!MO CALL VERLON ( NOMFIC,II1,II2,LPOS)
+!MOC !==========
+!MO NOMFIC(II2+1:II2+8) = 'hist.tmp'
+!MO II2 = II2+8
+!MO LPOS = LPOS+8
+!MOC
+!MO NENVAR = ' '
+!MO NENVAR = 'rm '
+!MO NENVAR(4:4+LPOS) = NOMFIC ( II1:II2 )
+!MO CALL SYSTEM(NENVAR)
+!MOC !==========
+!MO ENDIF
+
+!===============================================================================
+! 6. AFFICHAGES
+!===============================================================================
+
+ 100 FORMAT ('# ---------------------------------------------------')
+ 101 FORMAT ('# FICHIER HISTORIQUE EN TEMPS')
+ 102 FORMAT ('# VARIABLE ',A16)
+ 103 FORMAT ('# ')
+ 104 FORMAT ('# POSITION DES CAPTEURS (colonne)')
+ 105 FORMAT ('# ',I6,')',3(1X,E14.7))
+ 106 FORMAT ('# NOMBRE D''ENREGISTREMENTS :',I7)
+ 107 format ( &
+'# COLONNE 1 : NUMERO DU PAS DE TEMPS ',/, &
+'# 2 : TEMPS PHYSIQUE (ou No pas de temps*DTREF ',/,&
+'# en pas de temps non uniforme)',/,&
+'# 3 A 100 : VALEUR AUX CAPTEURS')
+ 1000 format ( 1(1x,i7,1x),101(1x,e14.7))
+
+return
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagich.f90 b/src/lagr/lagich.f90
new file mode 100644
index 0000000..7ed494d
--- /dev/null
+++ b/src/lagr/lagich.f90
@@ -0,0 +1,721 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagich &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , tsvar , &
+ cpgd1 , cpgd2 , cpght , &
+ skp1 , skp2 , skglob , &
+ gamhet , deltah , tempf , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS POUR LE CHARBON
+
+! - Temperature (JHP)
+! - Masse de charbon reactif (JMCH)
+! - Masse de coke (JMCK)
+
+! ET CALCUL DU DIAMETRE DU COEUR RETRECISSANT (JRDCK)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tsvar ! tr ! <-- ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable ivar, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+! cpgd1,cpgd2, ! tr ! --> ! termes de devolatilisation 1 et 2 et !
+! cpght(nbpmax ! ! ! de combusion heterogene (charbon !
+! ! ! ! avec couplage retour thermique) !
+! sk1,sk2, ! tr ! --- ! tableaux de travail !
+! skglob(nbpmax ! ! ! !
+! gamhet(nbpmax ! tr ! --- ! tableau de travail !
+! deltah(nbpmax ! tr ! --- ! tableau de travail !
+! tempf(ncelet) ! tr ! --- ! tableau de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision tsvar(nbpmax,nvp1)
+double precision skp1(nbpmax) , skp2(nbpmax) , skglob(nbpmax)
+double precision gamhet(nbpmax) , deltah(nbpmax) , tempf(ncelet)
+double precision cpgd1(nbpmax), cpgd2(nbpmax), cpght(nbpmax)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer npt , iel , icha , mode , ige
+integer iromf , iphas
+double precision aux1 , aux2 , aux3 , aux4 , aux5 , aux6
+double precision ter1 , ter2 , ter3 , diamp2, d2
+double precision tpk , tfk , skc , skdd , se , po2
+double precision ho2tf , hctp , hcotp , den , sherw
+double precision coef , mp0 , d6spi , dpis6 , d1s3 , d2s3
+double precision gamdv1(ncharm2) , gamdv2(ncharm2)
+double precision f1mc(ncharm2) , f2mc(ncharm2)
+double precision coefe(ngazem)
+
+double precision precis
+parameter ( precis = 1.d-15 )
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+iphas = ilphas
+
+d6spi = 6.d0 / pi
+dpis6 = pi / 6.d0
+d1s3 = 1.d0 / 3.d0
+d2s3 = 2.d0 / 3.d0
+
+! --- Si couplage retour thermique :
+
+if ( ltsthe.eq.1 .and. nor.eq.1 ) then
+ do npt = 1,nbpart
+ cpgd1(npt) = 0.d0
+ cpgd2(npt) = 0.d0
+ cpght(npt) = 0.d0
+ enddo
+endif
+if ( ltsthe.eq.1 ) then
+ coef = 1.d0 / dble(nordre)
+endif
+
+!===============================================================================
+! 2. Pointeur sur la masse volumique en fonction de l'ecoulement
+!===============================================================================
+
+if ( ippmod(icp3pl).ge.0 ) then
+ iromf = ipproc(irom1)
+else
+ iromf = ipproc(irom(iphas))
+endif
+
+!===============================================================================
+! 3. Temperature moyenne Fluide en Kelvin dans le cas ou la phase
+! porteuse est une flamme de charbon pulverise
+!===============================================================================
+
+if ( ippmod(icp3pl).ge.0 .or. ippmod(icpl3c).ge.0 ) then
+
+ do iel = 1,ncel
+ tempf(iel) = propce(iel,ipproc(itemp1))
+ enddo
+
+else
+ write(nfecra,1000) iphyla, ippmod(icpl3c), ippmod(icp3pl)
+ call csexit (1)
+ !==========
+endif
+
+!===============================================================================
+! 4. Calcul des constantes de vitesses SPK1 et SPK2 du transfert
+! de masse par devolatilisation avec des lois d'Arrhenius
+!===============================================================================
+
+! RR --> Constante des gaz parfaits en J/mol/K
+
+do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+ icha = itepa(npt,jinch)
+ tpk = ettp(npt,jhp) + tkelvi
+ aux1 = 1.d0 / (rr*tpk)
+ skp1(npt) = a1ch(icha) * exp( -e1ch(icha) * aux1)
+ skp2(npt) = a2ch(icha) * exp( -e2ch(icha) * aux1)
+ endif
+enddo
+
+!===============================================================================
+! 5. Calcul de la masse volumique du coke
+! On suppose pour le calcul de la masse volumique du coke que
+! la devolatilisation a lieu a volume constant
+!===============================================================================
+
+! --- Initialisation
+
+do icha = 1,ncharm
+ gamdv1(icha) = 0.d0
+ gamdv2(icha) = 0.d0
+ rhock(icha) = rho0ch(icha)
+enddo
+
+! --- Calcul de l'integrale de GAMDV1 et GAMDV2 pour chaque charbon
+
+do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+ icha = itepa(npt,jinch)
+ aux1 = skp1(npt) * y1ch(icha) * ettp(npt,jmch)
+ aux2 = skp2(npt) * y2ch(icha) * ettp(npt,jmch)
+
+ gamdv1(icha) = gamdv1(icha) + aux1
+ gamdv2(icha) = gamdv2(icha) + aux2
+
+! --- Couplage retour thermique
+
+ if ( ltsthe.eq.1 ) then
+ cpgd1(npt) = cpgd1(npt) + coef*aux1
+ cpgd2(npt) = cpgd2(npt) + coef*aux2
+ endif
+
+ endif
+enddo
+
+! --- Calcul de la masse volumique moyenne du coke
+
+do icha = 1,ncharb
+ den = y2ch(icha)*gamdv1(icha) + y1ch(icha)*gamdv2(icha)
+ if ( den.gt.precis ) then
+ rhock(icha) = rho0ch(icha) &
+ *( y2ch(icha)*gamdv1(icha)+y1ch(icha)*gamdv2(icha) &
+ -y1ch(icha)*y2ch(icha)*(gamdv1(icha)+gamdv2(icha)) ) &
+ / den
+ endif
+enddo
+
+!===============================================================================
+! 6. Calcul du diametre du coeur retrecissant
+!===============================================================================
+
+do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+ icha = itepa(npt,jinch)
+
+ tepa(npt,jrdck) = &
+ ( (d6spi / ( 1.d0-xashch(icha)) ) &
+ *( ettp(npt,jmch)/rho0ch(icha) &
+ +ettp(npt,jmck)/rhock(icha) ) )**d1s3
+ endif
+enddo
+
+!===============================================================================
+! 7. Calcul de la constante globale de reaction
+!===============================================================================
+
+! --- Hypothese Sherwood = 2.
+
+sherw = 2.d0
+
+do npt = 1,nbpart
+
+ if (itepa(npt,jisor).gt.0) then
+
+ icha = itepa(npt,jinch)
+
+ tpk = ettp(npt,jhp) + tkelvi
+
+! --- Coefficient de cinetique chimique de formation de CO
+! en (kg.m-2.s-1.atm(-n))
+
+ skc = ahetch(icha) &
+ * exp(-ehetch(icha)*4185.d0 / (rr*tpk) )
+
+! --- Coefficient de diffusion en (Kg/m2/s/atm) et constante
+! globale de reaction
+
+ if ( tepa(npt,jrdck).gt.epsicp ) then
+ skdd = sherw * 2.53d-7 * (tpk**0.75d0) / tepa(npt,jrdck)
+ skglob(npt) = (skc*skdd) / (skc+skdd)
+ else
+ skglob(npt) = skc
+ endif
+
+ endif
+enddo
+
+!===============================================================================
+! 8. Calcul de la GAMMAhet , GAMMACH et 0.5(MO2/MC)*(HO2(Tp)-HO2(TF))
+!===============================================================================
+
+do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+
+ icha = itepa(npt,jinch)
+ iel = itepa(npt,jisor)
+
+ tpk = ettp(npt,jhp) + tkelvi
+ tfk = ettp(npt,jtf) + tkelvi
+
+! --- Calcul de la pression partielle en oxygene (atm)
+! ---
+! PO2 = RHO1*RR*T*YO2/MO2
+
+ po2 = propce(iel,iromf) * rr * tempf(iel) &
+ * propce(iel,ipproc(iym1(io2))) / wmole(io2) / prefth
+
+! --- Calcul de (Surface efficace)/(Mck**2/3) : SE
+
+ se = ( pi*(1.d0-xashch(icha)) )**d1s3 &
+ * ( 6.d0/rhock(icha) )**d2s3
+
+! --- Calcul de la GamHET/(Mck**2/3)
+
+ gamhet(npt) = se * po2 * skglob(npt)
+
+! --- Pas de combustion heterogene si Mch/Mp >= 1.D-3
+
+ if ( ettpa(npt,jmch).ge.(1.d-3*ettpa(npt,jmp)) ) then
+ gamhet(npt) = 0.d0
+ endif
+
+! --- Couplage retour thermique
+
+ if ( ltsthe.eq.1 ) then
+ cpght(npt) = cpght(npt) &
+ + coef * gamhet(npt) &
+ * ( ettp(npt,jmck)**d2s3 )
+ endif
+
+! --- Calcul de Hc(Tp)-Mco/Mc Hco2(Tp)+0.5Mo2/Mc Ho2(Tf)
+
+! Calcul de Hcoke(TP)
+
+ hctp = h02ch(icha) + ettp(npt,jcp)*(tpk-trefth)
+
+! Calcul de MCO/MC HCO(TP)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(ico) = wmole(ico) / wmolat(iatc)
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ mode = -1
+ call cpthp1 ( mode , hcotp , coefe , f1mc , f2mc , tpk )
+ !==========
+
+! Calcul de MO2/MC/2. HO2(TF)
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(io2) = wmole(io2) / wmolat(iatc) / 2.d0
+
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ mode = -1
+ call cpthp1 ( mode , ho2tf , coefe , f1mc , f2mc , tfk )
+ !==========
+
+ deltah(npt) = hcotp - ho2tf - hctp
+
+ endif
+
+enddo
+
+!===============================================================================
+! 9. Integration Masse de Charbon reactif
+!===============================================================================
+
+if (nor.eq.1) then
+ do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+
+ aux1 = exp(-(skp1(npt)+skp2(npt))*dtp)
+ ettp(npt,jmch) = ettpa(npt,jmch)*aux1
+
+! Clipping
+ if ( ettp(npt,jmch).lt.precis ) then
+ ettp(npt,jmch) = 0.d0
+ endif
+
+ endif
+ enddo
+
+else if (nor.eq.2) then
+ do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0 .and. ibord(npt).eq.0) then
+
+ aux1 = exp(-(skp1(npt)+skp2(npt))*dtp)
+ ettp(npt,jmch) = 0.5d0 * ( ettp(npt,jmch) &
+ + ettpa(npt,jmch)*aux1 )
+
+! Clipping
+ if ( ettp(npt,jmch).lt.precis ) then
+ ettp(npt,jmch) = 0.d0
+ endif
+
+ endif
+ enddo
+endif
+
+!===============================================================================
+! 10. Integration Masse de Coke
+!===============================================================================
+
+if (nor.eq.1) then
+ do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+
+ icha = itepa(npt,jinch)
+
+ aux1 = skp1(npt) * (1.d0-y1ch(icha)) * ettpa(npt,jmch) &
+ + skp2(npt) * (1.d0-y2ch(icha)) * ettpa(npt,jmch)
+
+ if ( ettpa(npt,jmck).gt.precis ) then
+
+ aux2 = ettpa(npt,jmck)**d1s3
+ aux3 = aux2 + d2s3 *gamhet(npt) *dtp
+
+ ter1 = (aux1*aux2-gamhet(npt)*ettpa(npt,jmck)) *dtp/aux3
+
+ tsvar(npt,jmck) = 0.5d0 * ter1
+
+ ettp(npt,jmck) = ettpa(npt,jmck) + ter1
+
+ else
+ ter1 = aux1 * dtp
+ tsvar(npt,jmck) = 0.5d0 * ter1
+ ettp(npt,jmck) = ettpa(npt,jmck) + ter1
+ endif
+! Clipping
+ if ( ettp(npt,jmck).lt.0.d0 ) then
+ ettp(npt,jmck) = 0.d0
+ endif
+
+ endif
+ enddo
+
+else if (nor.eq.2) then
+ do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0 .and. ibord(npt).eq.0) then
+
+ icha = itepa(npt,jinch)
+
+ aux1 = skp1(npt) * (1.d0-y1ch(icha)) * ettp(npt,jmch) &
+ + skp2(npt) * (1.d0-y2ch(icha)) * ettp(npt,jmch)
+
+ if ( ettpa(npt,jmck).gt.precis ) then
+
+ aux2 = ettpa(npt,jmck)**d1s3
+ aux3 = aux2 + d2s3 *gamhet(npt) *dtp
+
+ ter1 = ( aux1 *aux2 -gamhet(npt) *ettpa(npt,jmck)) &
+ * dtp / aux3
+
+ ettp(npt,jmck) = ettpa(npt,jmck) &
+ +tsvar(npt,jmck)+0.5d0*ter1
+
+ else
+ ter1 = aux1*dtp
+ ettp(npt,jmck) = ettpa(npt,jmck) &
+ + tsvar(npt,jmck) + 0.5d0*ter1
+ endif
+! Clipping
+ if ( ettp(npt,jmck).lt.0.d0 ) then
+ ettp(npt,jmck) = 0.d0
+ endif
+
+ endif
+ enddo
+endif
+
+!===============================================================================
+! 11. Integration de la temperature des grains de charbon
+!===============================================================================
+
+if (nor.eq.1) then
+ do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+
+ icha = itepa(npt,jinch)
+ iel = itepa(npt,jisor)
+
+ d2 = ettp(npt,jdp)*ettp(npt,jdp)
+ diamp2 = xashch(icha)*tepa(npt,jrd0p)*tepa(npt,jrd0p) &
+ +(1.d0-xashch(icha))*tepa(npt,jrdck)*tepa(npt,jrdck)
+
+ aux1 = tempct(npt,1)*diamp2/d2
+
+! Combustion heterogene
+ aux2 = ( -gamhet(npt) *(ettp(npt,jmck)**d2s3) *deltah(npt) )
+
+! Rayonnement
+
+ aux3 = pi * diamp2 &
+ * ( propce(iel,ipproc(ilumin)) &
+ - 4.d0*stephn*((ettp(npt,jhp)+tkelvi)**4) )
+
+ aux4 = ettpa(npt,jtf) + aux1*(aux2+aux3)
+
+ aux5 = dtp/aux1
+ aux6 = exp(-aux5)
+
+ ter1 = ettpa(npt,jhp) * aux6
+ ter2 = aux4 * (1.d0-aux6)
+ ter3 = aux4 * ( -aux6+(1.d0-aux6) / aux5 )
+
+ tsvar(npt,jhp) = 0.5d0 * ter1 + ter3
+ ettp(npt,jhp) = ter1 + ter2
+
+ endif
+ enddo
+
+else if (nor.eq.2) then
+ do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0 .and. ibord(npt).eq.0) then
+
+
+ icha = itepa(npt,jinch)
+ iel = itepa(npt,jisor)
+
+ d2 = ettp(npt,jdp)*ettp(npt,jdp)
+ diamp2 = xashch(icha)*tepa(npt,jrd0p)*tepa(npt,jrd0p) &
+ + (1.d0-xashch(icha))*tepa(npt,jrdck)*tepa(npt,jrdck)
+
+ aux1 = tempct(npt,1)*diamp2/d2
+
+! Combustion heterogene
+ aux2 = -gamhet(npt) *(ettp(npt,jmck)**d2s3) *deltah(npt)
+
+! Rayonnement
+
+ aux3 = pi * diamp2 &
+ * ( propce(iel,ipproc(ilumin)) &
+ - 4.d0*stephn*((ettp(npt,jhp)+tkelvi)**4) )
+
+ aux4 = ettp(npt,jtf) + aux1*(aux2+aux3)
+
+ aux5 = dtp / aux1
+ aux6 = exp(-aux5)
+
+ ter1 = ettpa(npt,jhp) * aux6
+ ter2 = aux4 * ( 1.d0-((1.d0-aux6)/aux5) )
+
+ ettp(npt,jhp) = tsvar(npt,jhp) + 0.5d0*ter1 + ter2
+
+ endif
+ enddo
+endif
+
+!===============================================================================
+! 12. Mise a jour du diametre du coeur retrecissant
+!===============================================================================
+
+do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+ icha = itepa(npt,jinch)
+
+ tepa(npt,jrdck) = ( (d6spi/(1.d0-xashch(icha)) ) &
+ * ( ettp(npt,jmch)/rho0ch(icha) &
+ + ettp(npt,jmck)/rhock(icha) ) )**d1s3
+ endif
+enddo
+
+!===============================================================================
+! 13. Calcul du diametre des grains de charbon
+!===============================================================================
+
+do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+ icha = itepa(npt,jinch)
+ ettp(npt,jdp) = (xashch(icha)*(tepa(npt,jrd0p)**2) &
+ + (1.d0-xashch(icha)) &
+ *(tepa(npt,jrdck)**2) )**0.5d0
+ endif
+enddo
+
+!===============================================================================
+! 14. Calcul de la masse des grains de charbon
+!===============================================================================
+
+do npt = 1,nbpart
+ if (itepa(npt,jisor).gt.0) then
+ icha = itepa(npt,jinch)
+ mp0 = dpis6 * (tepa(npt,jrd0p)**3) * rho0ch(icha)
+ ettp(npt,jmp) = ettp(npt,jmch) + ettp(npt,jmck) &
+ + xashch(icha)*mp0
+ endif
+enddo
+
+!===============================================================================
+
+!=======
+! FORMAT
+!=======
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE TRANSPORT LAGRANGIEN DE PARTICULES DE CHARBON ',/,&
+'@ EST ACTIVE (LAGICH), ALORS QU''AUCUNE PHYSIQUE ',/,&
+'@ PARTICULIERE SUR LA COMBUSTION DU CHABON PULVERISE ',/,&
+'@ N''EST PAS ENCLENCHE (USPPMO). ',/,&
+'@ ',/,&
+'@ IPHYLA = ', I10 ,/,&
+'@ IPPMOD(ICPL3C) = ', I10 ,/,&
+'@ IPPMOD(ICP3PL) = ', I10 ,/,&
+'@ ',/,&
+'@ Le transport Lagrangien de particule de charbon doit ',/,&
+'@ etre couple avec la combustion d''une flamme de charbon ',/,&
+'@ pulverise en phase continue. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IPHYLA dans la subroutine USLAG1 et ',/,&
+'@ verifier la valeur de IPPMOD dans la subroutine USPPMO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagidp.f90 b/src/lagr/lagidp.f90
new file mode 100644
index 0000000..5bbd25b
--- /dev/null
+++ b/src/lagr/lagidp.f90
@@ -0,0 +1,202 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagidp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl1 , auxl2 , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS POUR LE DIAMETRE DES PARTICULES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tsvar ! tr ! <-- ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable ivar, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+! auxl1(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl2(nbpmax) ! tr ! --- ! tableau de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision tsvar(nbpmax,nvp1)
+double precision auxl1(nbpmax) , auxl2(nbpmax)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer npt
+
+!===============================================================================
+
+
+
+do npt = 1,nbpart
+
+ if ( itepa(npt,jisor).gt.0 ) then
+
+ auxl1(npt) = 1.d0
+ auxl2(npt) = ettp(npt,jdp)
+
+ endif
+enddo
+
+call lagitg &
+!==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ jdp , &
+ itepa(1,jisor) , ibord , &
+ ettp , ettpa , auxl1 , auxl2 , tsvar )
+
+!===============================================================================
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagimp.f90 b/src/lagr/lagimp.f90
new file mode 100644
index 0000000..dabb2ee
--- /dev/null
+++ b/src/lagr/lagimp.f90
@@ -0,0 +1,201 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagimp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl1 , auxl2 , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS POUR LA MASSE DES PARTICULES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tsvar ! tr ! <-- ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable ivar, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+! auxl1(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl2(nbpmax) ! tr ! --- ! tableau de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision tsvar(nbpmax,nvp1)
+double precision auxl1(nbpmax) , auxl2(nbpmax)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer npt
+
+!===============================================================================
+
+
+do npt = 1,nbpart
+
+ if ( itepa(npt,jisor).gt.0 ) then
+
+ auxl1(npt) = 1.d0
+ auxl2(npt) = ettp(npt,jmp)
+
+ endif
+enddo
+
+call lagitg &
+!==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ jmp , &
+ itepa(1,jisor) , ibord , &
+ ettp , ettpa , auxl1 , auxl2 , tsvar )
+
+!===============================================================================
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagini.f90 b/src/lagr/lagini.f90
new file mode 100644
index 0000000..5bf398f
--- /dev/null
+++ b/src/lagr/lagini.f90
@@ -0,0 +1,228 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagini &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , nfac , nfabor , &
+ lndnod , &
+ ifacel , ifabor , &
+ nbrfac , &
+ ia , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Remplissage de LNDNOD pour l'allocation de memoire dans MEMLA1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! lndnod ! e ! --> ! dim. connect. cellules->faces !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! nbrfac(ncel) ! te ! --- ! tableau de travail entier !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "period.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+integer nfac , nfabor
+integer lndnod
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer nbrfac(ncelet)
+integer ia(*)
+
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+
+integer idebia , idebra
+integer iel , ifac , ip
+!===============================================================================
+!===============================================================================
+! 0. GESTION DE LA MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. Calcul de la dimension du tableau de connectivites cellules->faces
+!===============================================================================
+
+!-->Initialisation
+
+do iel = 1,ncelet
+ nbrfac(iel) = 0
+enddo
+
+!-->Pour chaque cellule on compte le nombre de faces internes qui l'entourent
+
+do ifac = 1,nfac
+ do ip = 1,2
+ iel = ifacel(ip,ifac)
+ nbrfac(iel) = nbrfac(iel) + 1
+ enddo
+enddo
+
+!-->Pour chaque cellule on compte le nombre de faces de bord qui l'entourent
+
+do ifac = 1,nfabor
+ iel = ifabor(ifac)
+ nbrfac(iel) = nbrfac(iel) + 1
+enddo
+
+!-->verif : chaque cellule ne peut avoir moins de 4 faces en regard
+! Rem : d'apres la routine LEDGEO on a toujours NDIM = 3
+
+ip = 0
+do iel = 1,ncel
+ if (nbrfac(iel).lt.4) then
+ ip = ip + 1
+ endif
+enddo
+if (ip.gt.0) then
+ write(nfecra,9000) ip
+ call csexit (1)
+endif
+
+!--->Traitement de la periodicite
+
+if (iperio.eq.1) then
+
+ ip = 0
+ do iel = ncel+1,ncelet
+ if (nbrfac(iel).ne.1) then
+ ip = ip + 1
+ endif
+ enddo
+ if (ip.gt.0) then
+ write(nfecra,9001) ip
+ call csexit (1)
+ endif
+
+endif
+
+!-->Calcul de la dimension du tableau de connectivite
+
+lndnod = 0
+do iel = 1,ncelet
+ lndnod = lndnod + nbrfac(iel)
+enddo
+
+!===============================================================================
+! 2. Ouverture du fichier listing specifique lagrangien
+!===============================================================================
+
+open ( unit=implal, file=ficlal, &
+ STATUS='UNKNOWN', FORM='FORMATTED', &
+ ACCESS='SEQUENTIAL')
+rewind(implal)
+
+!--------
+! FORMATS
+!--------
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ Il y a ',I10,' cellules qui ont moins de 4 faces. ',/,&
+'@ Erreur rencontree dans LAGINI (module Lagrangien). ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ Il y a ',I10,' cellules du halo periodique qui ',/,&
+'@ ne comportent pas qu''une unique face. ',/,&
+'@ Erreur rencontree dans LAGINI (module Lagrangien). ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le maillage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagipn.f90 b/src/lagr/lagipn.f90
new file mode 100644
index 0000000..7ccccd7
--- /dev/null
+++ b/src/lagr/lagipn.f90
@@ -0,0 +1,254 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagipn &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npar1 , npar2 , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ rtp , &
+ ettp , tepa , vagaus , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Initialisation de la vitesse fluide vu pour les nouvelles
+! particules.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! npar1 ,npar2 ! e ! <-- ! borne min et max des particules !
+! ! ! ! a initialiser !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! vagaus ! tr ! --> ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! w1...w3(ncel) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer npar1 , npar2
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision rtp(ncelet,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision vagaus(nbpmax,*)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , npt , nomb , iphas
+double precision tu , d2s3
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+iphas = ilphas
+d2s3 = 2.d0 / 3.d0
+
+!===============================================================================
+! 2. SIMULATION DES VITESSES TURBULENTES FLUIDES INSTANTANNEES VUES
+! PAR LES PARTICULES SOLIDES LE LONG DE LEUR TRAJECTOIRE.
+!===============================================================================
+
+if (idistu.eq.1) then
+
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ do iel = 1,ncel
+ w1(iel) = rtp(iel,ik(iphas))
+ enddo
+ else if (itytur(iphas).eq.3) then
+ do iel = 1,ncel
+ w1(iel) = 0.5d0 * ( rtp(iel,ir11(iphas)) &
+ + rtp(iel,ir22(iphas)) &
+ + rtp(iel,ir33(iphas)) )
+ enddo
+ else
+ write(nfecra,9000) iilagr, idistu, iphas, iturb(iphas)
+ call csexit (1)
+ !==========
+ endif
+else
+ do iel = 1,ncel
+ w1(iel) = 0.d0
+ enddo
+endif
+
+
+!---> CALCUL DES TIRAGES ALEATOIRES
+! CALCUL DU TEMPS CARACTERISTIQUE DES PARTICULES
+! remarque : NORMALEN est dans le fichier ZUFALL.F
+! ^^^^^^^^
+
+if (idistu.eq.1) then
+ nomb = npar2-npar1+1
+ call normalen (nomb,vagaus(npar1,1))
+ call normalen (nomb,vagaus(npar1,2))
+ call normalen (nomb,vagaus(npar1,3))
+else
+ do npt = npar1,npar2
+ vagaus(npt,1) = 0.d0
+ vagaus(npt,2) = 0.d0
+ vagaus(npt,3) = 0.d0
+ enddo
+endif
+
+do npt = npar1,npar2
+
+ iel = itepa(npt,jisor)
+
+ tu = sqrt( d2s3*w1(iel) )
+
+ ettp(npt,juf) = rtp(iel,iu(iphas)) + vagaus(npt,1)*tu
+ ettp(npt,jvf) = rtp(iel,iv(iphas)) + vagaus(npt,2)*tu
+ ettp(npt,jwf) = rtp(iel,iw(iphas)) + vagaus(npt,3)*tu
+
+enddo
+
+!--------
+! FORMATS
+!--------
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGIPN) ',/,&
+'@ ',/,&
+'@ LE MODULE LAGRANGIEN EST INCOMPATIBLE AVEC LE MODELE ',/,&
+'@ DE TURBULENCE SELECTIONNE. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Le module Lagrangien a ete active avec IILAGR = ',I10 ,/,&
+'@ et la dispersion turbulente est prise en compte ',/,&
+'@ avec IDISTU = ',I10 ,/,&
+'@ Le modele de turbulence active pour la phase ',I6 ,/,&
+'@ correspond a ITURB = ',I10 ,/,&
+'@ Or, les seuls traitements de la turbulence compatibles ',/,&
+'@ avec le module Lagrangien et la dispersion turbulente ',/,&
+'@ sont k-epsilon et Rij-epsilon, v2f et k-omega. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR et IDISTU dans la subroutine ',/,&
+'@ USLAG1 et verifier la valeur de ITURB dans la subroutine ',/,&
+'@ USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagitf.f90 b/src/lagr/lagitf.f90
new file mode 100644
index 0000000..4817dac
--- /dev/null
+++ b/src/lagr/lagitf.f90
@@ -0,0 +1,329 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagitf &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , tsvar , &
+ auxl1 , auxl2 , tempf , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS POUR LA TEMPERATURE FLUIDE
+! VU PAR LES PARTICULES.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tsvar ! tr ! <-- ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable ivar, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+! auxl1(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl2(nbpmax) ! tr ! --- ! tableau de travail !
+! tempf(ncelet) ! tr ! --- ! tableau de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision tsvar(nbpmax,nvp1)
+double precision auxl1(nbpmax) , auxl2(nbpmax)
+double precision tempf(ncelet)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer npt , iel , iphas , mode
+double precision ct , aux1 , aux2 , ter1 , ter2
+double precision energ , dissip
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+iphas = ilphas
+
+ct = 1.d0
+
+mode = 1
+
+!===============================================================================
+! 2. Temperature moyenne Fluide en degres Celsius
+!===============================================================================
+
+if ( ippmod(icp3pl).ge.0 .or. &
+ ippmod(icpl3c).ge.0 .or. &
+ ippmod(icfuel).ge.0 ) then
+
+ do iel = 1,ncel
+ tempf(iel) = propce(iel,ipproc(itemp1)) - tkelvi
+ enddo
+
+else if ( ippmod(icod3p).ge.0 .or. &
+ ippmod(icoebu).ge.0 .or. &
+ ippmod(ielarc).ge.0 .or. &
+ ippmod(ieljou).ge.0 ) then
+
+ do iel = 1,ncel
+ tempf(iel) = propce(iel,ipproc(itemp)) - tkelvi
+ enddo
+
+else if ( iscsth(iscalt(iphas)).eq.-1 ) then
+ do iel = 1,ncel
+ tempf(iel) = rtp(iel,isca(iscalt(iphas)))
+ enddo
+
+else if ( iscsth(iscalt(iphas)).eq.1 ) then
+ do iel = 1,ncel
+ tempf(iel) = rtp(iel,isca(iscalt(iphas))) - tkelvi
+ enddo
+
+else if ( iscsth(iscalt(iphas)).eq.2 ) then
+ do iel = 1,ncel
+ call usthht (mode, rtp(iel,isca(iscalt(iphas))), tempf(iel))
+ !==========
+ enddo
+endif
+
+!===============================================================================
+! 3. INTEGRATION DE L'EDS SUR LES PARTICULES
+!===============================================================================
+
+do npt = 1,nbpart
+
+ if ( itepa(npt,jisor).gt.0 ) then
+
+ iel = itepa(npt,jisor)
+
+ if (itytur(iphas).eq.2 .or. itytur(iphas).eq.3 .or. &
+ iturb(iphas).eq.50 .or. iturb(iphas).eq.60 ) then
+
+ if ( itytur(iphas).eq.2 .or. iturb(iphas).eq.50 ) then
+
+ energ = rtp(iel,ik(iphas))
+ dissip = rtp(iel,iep(iphas))
+
+ else if ( itytur(iphas).eq.3 ) then
+
+ energ = 0.5d0 * ( rtp(iel,ir11(iphas)) &
+ + rtp(iel,ir22(iphas)) &
+ + rtp(iel,ir33(iphas)) )
+ dissip = rtp(iel,iep(iphas))
+
+ else if (iturb(iphas).eq.60) then
+
+ energ = rtp(iel,ik(iphas))
+ dissip = cmu*rtp(iel,ik(iphas))*rtp(iel,iomg(iphas))
+
+ endif
+
+ auxl1(npt) = energ / ( ct*dissip )
+ auxl1(npt) = max( auxl1(npt),epzero )
+
+ else
+
+ auxl1(npt) = epzero
+
+ endif
+
+ endif
+enddo
+
+if (nor.eq.1) then
+
+ do npt = 1,nbpart
+
+ if (itepa(npt,jisor).gt.0) then
+
+ iel = itepa(npt,jisor)
+
+ aux1 = -dtp/auxl1(npt)
+ aux2 = exp(aux1)
+
+ ter1 = ettpa(npt,jtf) * aux2
+ ter2 = tempf(iel) * ( 1.d0-aux2 )
+
+ ettp(npt,jtf) = ter1 + ter2
+
+! Pour le cas NORDRE= 2, on calcule en plus TSVAR pour NOR= 2
+
+ tsvar(npt,jtf) = 0.5d0 * ter1 &
+ + tempf(iel) * ( -aux2 +(aux2-1.d0) / aux1 )
+ endif
+ enddo
+
+else if (nor.eq.2) then
+
+ do npt = 1,nbpart
+
+ if ( itepa(npt,jisor).gt.0 .and. ibord(npt).eq.0 ) then
+
+ iel = itepa(npt,jisor)
+
+ aux1 = -dtp/auxl1(npt)
+ aux2 = exp(aux1)
+
+ ter1 = 0.5d0 * ettpa(npt,jtf) * aux2
+ ter2 = tempf(iel) * (1.d0 - (aux2-1.d0) / aux1)
+
+ ettp(npt,jtf) = tsvar(npt,jtf) + ter1 + ter2
+ endif
+ enddo
+endif
+
+!===============================================================================
+
+!=======
+! FORMAT
+!=======
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagitg.f90 b/src/lagr/lagitg.f90
new file mode 100644
index 0000000..913868a
--- /dev/null
+++ b/src/lagr/lagitg.f90
@@ -0,0 +1,231 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagitg &
+!================
+
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ ivar , &
+ isorti , ibord , &
+ ettp , ettpa , tcarac , pip , tsvar )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DE L'EDS POUR LA VARIABLE IVAR
+
+
+! d V V - PIP
+! EDS : --- = - -------
+! d t TCARAC
+
+! Lorsqu'il y a eu interaction avec une face de bord,
+! l'integration est degeneree a l'ordre 1
+! (meme si on est a l'ordre 2 par ailleurs).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ivar ! e ! <-- ! numero de la variable a integrer !
+! ! ! ! dans le tableau ettp !
+! isorti(nbpmax ! te ! <-- ! pour chaque particule : !
+! ! ! ! * numero de sa cellule !
+! ! ! ! * 0 si sortie du domaine !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tcarac(nbpmax ! tr ! <-- ! temps caracteristique associe a l'eds !
+! pip(nbpmax) ! tr ! <-- ! second membre associe a l'eds !
+! tsvar ! tr ! --> ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable ivar, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ivar
+integer isorti(nbpmax) , ibord(nbpmax)
+
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tcarac(nbpmax) , pip(nbpmax)
+double precision tsvar(nbpmax,nvp1)
+
+! VARIABLES LOCALES
+
+integer npt
+double precision aux1 , aux2 , ter1 , ter2 , ter3
+
+!===============================================================================
+
+
+ if (nor.eq.1) then
+
+ do npt = 1, nbpart
+ if (isorti(npt).gt.0) then
+
+ if (tcarac(npt).le.0.d0) then
+ write(nfecra,2000) ivar, tcarac(npt), npt
+ call csexit (1)
+ endif
+
+ aux1 = dtp/tcarac(npt)
+ aux2 = exp(-aux1)
+
+ ter1 = ettpa(npt,ivar) * aux2
+ ter2 = pip(npt) * (1.d0-aux2)
+
+! Pour le cas NORDRE= 1 ou s'il y a rebond,
+! le ETTP suivant est le resultat final
+
+ ettp(npt,ivar) = ter1 + ter2
+
+! Pour le cas NORDRE= 2, on calcule en plus TSVAR pour NOR= 2
+
+ ter3 = ( -aux2 + (1.d0-aux2) / aux1 ) * pip(npt)
+ tsvar(npt,ivar) = 0.5d0 * ter1 + ter3
+ endif
+ enddo
+
+ else if (nor.eq.2) then
+
+ do npt = 1, nbpart
+ if (isorti(npt).gt.0 .and. ibord(npt).eq.0) then
+
+ if (tcarac(npt).le.0.d0) then
+ write(nfecra,2000) ivar, tcarac(npt), npt
+ call csexit (1)
+ endif
+
+ aux1 = dtp/tcarac(npt)
+ aux2 = exp(-aux1)
+
+ ter1 = 0.5d0 * ettpa(npt,ivar) * aux2
+ ter2 = pip(npt) * ( 1.d0 - (1.d0-aux2) / aux1 )
+
+! Pour le cas NORDRE= 2, le ETTP suivant est le resultat final
+
+ ettp(npt,ivar) = tsvar(npt,ivar) + ter1 + ter2
+ endif
+ enddo
+
+ else
+ write(nfecra,1000) nor
+ call csexit (1)
+ !==========
+ endif
+
+!===============================================================================
+
+!-------
+! FORMAT
+!-------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ L''INDICATEUR SUR L''ORDRE D''INTEGRATION ',/,&
+'@ DES EQUATIONS DIFFERENTIELLES STOCHASTIQUES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGITG). ',/,&
+'@ ',/,&
+'@ NORDRE DEVRAIT ETRE UN ENTIER EGAL A 1 OU 2 ',/,&
+'@ IL VAUT ICI NORDRE = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NORDRE dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ LE TEMPS CARACTERISTIQUE LIE A L''EQUATION ',/,&
+'@ DIFFERENTIELLE STOCHASTIQUE DE LA VARIABLE ',/,&
+'@ NUMERO ',I10 ,'UNE VALEUR NON PERMISE (LAGITG). ',/,&
+'@ ',/,&
+'@ TCARAC DEVRAIT ETRE UN ENTIER STRICTEMENT POSITIF ',/,&
+'@ IL VAUT ICI TCARAC = ', E10.4 ,/,&
+'@ POUR LA PARTICULE NUMERO ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagitp.f90 b/src/lagr/lagitp.f90
new file mode 100644
index 0000000..68c75e3
--- /dev/null
+++ b/src/lagr/lagitp.f90
@@ -0,0 +1,252 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagitp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl1 , auxl2 , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS POUR LA TEMPERATURE DES PARTICULES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet) ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tsvar ! tr ! <-- ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable ivar, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+! auxl1(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl2(nbpmax) ! tr ! --- ! tableau de travail !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision tsvar(nbpmax,nvp1)
+double precision auxl1(nbpmax) , auxl2(nbpmax)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer npt , iel
+double precision srad
+
+!===============================================================================
+
+!===============================================================================
+! REMPLISSAGE DU TEMPS CARACTERISTIQUE ET DU "PSEUDO SECOND MEMBRE"
+!===============================================================================
+
+do npt = 1,nbpart
+
+ if (itepa(npt,jisor).gt.0) then
+
+ auxl1(npt) = tempct(npt,1)
+
+ if (nor.eq.1) then
+ auxl2(npt) = ettpa(npt,jtf)
+ else
+ auxl2(npt) = ettp(npt,jtf)
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! PRISE EN COMPTE DU RAYONNEMENT S'IL Y A LIEU
+!===============================================================================
+
+if (iirayo.gt.0) then
+
+ do npt = 1,nbpart
+
+ iel = itepa(npt,jisor)
+
+ if (iel.gt.0) then
+
+ if (nor.eq.1) then
+
+ srad = pi *ettpa(npt,jdp) *ettpa(npt,jdp) &
+ *tepa(npt,jreps) *(propce(iel,ipproc(ilumin)) &
+ -4.d0 *stephn *ettpa(npt,jtp)**4 )
+ auxl2(npt) = ettpa(npt,jtf) &
+ +auxl1(npt) *srad /ettpa(npt,jcp) /ettpa(npt,jmp)
+ else
+
+ srad = pi *ettp(npt,jdp) *ettp(npt,jdp) *tepa(npt,jreps) &
+ *(propce(iel,ipproc(ilumin)) &
+ -4.d0 *stephn *ettp(npt,jtp)**4 )
+ auxl2(npt) = ettp(npt,jtf) &
+ +auxl1(npt) *srad /ettp(npt,jcp) /ettp(npt,jmp)
+
+ endif
+
+ endif
+
+ enddo
+
+endif
+
+!===============================================================================
+! INTEGRATION
+!===============================================================================
+
+call lagitg &
+!==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ jtp , &
+ itepa(1,jisor) , ibord , &
+ ettp , ettpa , auxl1 , auxl2 , tsvar )
+
+!===============================================================================
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/laglec.f90 b/src/lagr/laglec.f90
new file mode 100644
index 0000000..7a8c316
--- /dev/null
+++ b/src/lagr/laglec.f90
@@ -0,0 +1,2097 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine laglec &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ia , &
+ rtpa , propce , &
+ ettp , tepa , statis , stativ , parbor , tslagr , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Lecture des fichiers suite Lagrangien "lagamo" et "lasamo"
+! contenant les informations sur les particule, les statistiques
+! volumiques et aux frontieres, ainsi que les termes sources
+! de couplage retour.
+
+! Tous les tableaux sont initialise a zero avant d'�tre remplis
+! dans le cas d'une suite (sinon ils restent a zero).
+! On realise donc ici l'initialisation des tableaux ouverts
+! dans MEMLA1, ce qui termine l'etape d'initialisation debutee
+! dans LAGOPT.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!TODO cartouche
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules instant precedent !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! parbor ! tr ! <-- ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,ntersl ! ! ! lagrangien sur la phase porteuse !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "cstphy.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer itepa(nbpmax,nivep) , ia(*)
+
+double precision rtpa(ncelet,*) , propce(ncelet,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision tslagr(ncelet,ntersl)
+double precision parbor(nfabor,nvisbr)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character rubriq*64 , car4*4, car8*8, kar8*8
+character nomnvl(nvplmx)*60 , nomtsl(nvplmx)*60
+character nomite(nvplmx)*64 , nomrte(nvplmx)*64
+integer idebia , idebra
+integer ncelok , nfaiok , nfabok , nsomok
+integer ierror , irtyp , itysup , nbval
+integer ilecec , nberro , ivers
+integer mvls , ivar , ip , icha
+integer ifac , iel , iok , iphas
+integer jphyla , jtpvar , jdpvar , jmpvar
+integer jsttio , jdstnt , mstist , mvlsts
+integer mstbor , musbor , mstits , jturb, jtytur
+integer mode , ipas , ivl , nclsto
+integer impaml , impmls
+
+!===============================================================================
+!===============================================================================
+! 0. Gestion memoire
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. Initialisations par defaut
+!===============================================================================
+
+!---> Il faut faire dans cette routine les initialisations des
+! tableaux lagrangiens ouverts dans la routine MEMLA1
+! (sauf ITYCEL et ICOCEL qui sont initialises dans LAGDEB),
+
+iphas = ilphas
+
+do ivar = 1,nvp
+ do ip = 1,nbpmax
+ ettp(ip,ivar) = 0.d0
+ enddo
+enddo
+
+do ivar = 1,nivep
+ do ip = 1,nbpmax
+ itepa(ip,ivar) = 0
+ enddo
+enddo
+
+do ivar = 1,nvep
+ do ip = 1,nbpmax
+ tepa(ip,ivar) = 0.d0
+ enddo
+enddo
+
+if (istala.eq.1) then
+ do ipas = 0,nbclst
+ do ivl = 1,nvlsta
+ ivar = ipas*nvlsta +ivl
+ do iel = 1,ncel
+ statis(iel,ivar) = 0.d0
+ enddo
+ enddo
+ enddo
+ do ipas = 0,nbclst
+ do ivl = 1,nvlsta-1
+ ivar = ipas*(nvlsta-1) +ivl
+ do iel = 1,ncel
+ stativ(iel,ivar) = 0.d0
+ enddo
+ enddo
+ enddo
+endif
+
+if (iilagr.eq.2) then
+ do ivar = 1,ntersl
+ do iel = 1,ncel
+ tslagr(iel,ivar) = 0.d0
+ enddo
+ enddo
+endif
+
+if (iensi3.eq.1 .and. nvisbr.gt.0) then
+ do ivar = 1,nvisbr
+ do ifac = 1,nfabor
+ parbor(ifac,ivar) = 0.d0
+ enddo
+ enddo
+endif
+
+if (isuila.eq.0) return
+
+!===============================================================================
+! 2. LECTURE DU FICHIER SUITE : VARIABLES LIEES AUX PARTICULES
+!===============================================================================
+
+! ---> Ouverture
+
+write(nfecra,6000)
+
+! (ILECEC=1:lecture)
+ilecec = 1
+call opnsui(ficaml,len(ficaml),ilecec,impaml,ierror)
+!==========
+if(ierror.ne.0) then
+ write(nfecra,9010) ficaml, ficaml
+ call csexit (1)
+endif
+
+write(nfecra,6010)
+
+! ---> Type de fichier suite
+! Pourrait porter le numero de version si besoin.
+! On ne se sert pas de IVERS pour le moment
+
+itysup = 0
+nbval = 1
+irtyp = 1
+RUBRIQ = 'version_fichier_suite_Lagrangien_variables'
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ivers,ierror)
+
+if(ierror.ne.0) then
+ write(nfecra,9020) ficaml, ficaml
+ call csexit (1)
+endif
+
+! ---> Tests
+
+iok = 0
+
+! Dimensions des supports
+
+call tstsui(impaml,ncelok,nfaiok,nfabok,nsomok)
+!==========
+if(ncelok.eq.0) then
+ write(nfecra,9030) ficaml
+ iok = iok + 1
+endif
+
+IF(NFAIOK.EQ.0) WRITE(NFECRA,9031) FICAML,'internes','internes'
+
+IF(NFABOK.EQ.0) WRITE(NFECRA,9031) FICAML,'de bord ','de bord '
+
+! Nombre de particules dans le domaine du calcul
+
+itysup = 0
+nbval = 1
+
+RUBRIQ = 'nombre_courant_particules'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nbpart,ierror)
+
+if(ierror.ne.0) then
+ write(nfecra,9040) ficaml, &
+ 'nombre_courant_particules ', &
+ ficaml
+ iok = iok + 1
+endif
+if(nbpart.gt.nbpmax) then
+ write(nfecra,9050) ficaml, nbpart, nbpmax
+ iok = iok + 1
+endif
+
+! Physique associee aux particules
+
+RUBRIQ = 'indicateur_physique_particules'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jphyla,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9040) ficaml, rubriq, ficaml
+ iok = iok + 1
+endif
+
+RUBRIQ = 'indicateur_temperature_particules'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jtpvar,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9040) ficaml, &
+ 'indicateur_temperature_particules ', &
+ ficaml
+ iok = iok + 1
+endif
+
+! Arret
+if(iok.ne.0) then
+ call csexit (1)
+endif
+
+RUBRIQ = 'indicateur_diametre_particules'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jdpvar,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9062) ficaml, &
+ 'indicateur_diametre_particules '
+ jdpvar = idpvar
+endif
+
+RUBRIQ = 'indicateur_masse_particules'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jmpvar,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9062) ficaml, &
+ 'indicateur_masse_particules '
+ jmpvar = impvar
+endif
+
+! ---> On previent si des parametres sont differents
+
+if ( jphyla.ne.iphyla .or. &
+ jtpvar.ne.itpvar .or. &
+ jdpvar.ne.idpvar .or. &
+ jmpvar.ne.impvar ) then
+ write(nfecra,9070) ficaml, &
+ jphyla, jtpvar, jdpvar, jmpvar, &
+ iphyla, itpvar, idpvar, impvar
+endif
+
+! ---> Verification de la compatibilite si changement de thermique
+
+if (jphyla.ne.0 .and. iphyla.eq.0) then
+ write(nfecra,9071) ficaml
+endif
+
+if (itpvar.eq.1 .and. jtpvar.eq.0) then
+ write(nfecra,9072) ficaml, tpart, cppart
+endif
+
+if (iphyla.eq.2 .and. jphyla.ne.2) then
+ write(nfecra,9073) ficaml, ficaml
+ call csexit (1)
+endif
+
+if ( (jphyla.eq.2 .and. iphyla.eq.1) .or. &
+ (jphyla.eq.1 .and. iphyla.eq.2) ) then
+ write(nfecra,9074) ficaml, ficaml
+ call csexit (1)
+endif
+
+! ---> Infos suivi du calcul
+
+RUBRIQ = 'nombre_iterations_Lagrangiennes'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ iplas,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9060) ficaml, &
+ 'nombre_iterations_Lagrangiennes ', &
+ 'IPLAS',IPLAS
+endif
+
+if(istala.eq.1 .and. isuist.eq.0 .and. iplas.ge.idstnt) then
+ write(nfecra,9065) ficaml, isuist, iplas +1, idstnt
+ call csexit (1)
+endif
+
+if(iensi3.eq.1 .and. isuist.eq.0 .and. iplas.ge.nstbor) then
+ write(nfecra,9066) ficaml, isuist, iplas +1, nstbor
+ call csexit (1)
+endif
+
+RUBRIQ = 'temps_physique_Lagrangien'
+irtyp = 2
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ttclag,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9061) ficaml, &
+ 'temps_physique_Lagrangien ', &
+ 'TTCLAG',TTCLAG
+endif
+
+RUBRIQ = 'nombre_total_particules'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nbptot,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9060) ficaml, &
+ 'nombre_total_particules ', &
+ 'NBPTOT',NBPTOT
+endif
+
+RUBRIQ = 'nombre_particules_perdues'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nbpert,ierror)
+if(ierror.ne.0) then
+ write(nfecra,9060) ficaml, &
+ 'nombre_particules_perdues ', &
+ 'NBPERT',NBPERT
+endif
+
+RUBRIQ = 'nombre_variables_utilisateur'
+irtyp = 1
+call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ mvls,ierror)
+if(ierror.ne.0) then
+ mvls = 0
+ if (nvls.gt.0) then
+ write(nfecra,9062) ficaml, &
+ 'nombre_variables_utilisateur '
+ endif
+endif
+
+if (nvls.lt.mvls) then
+ write(nfecra,9080) ficaml, mvls, nvls, nvls, nvls
+ mvls = nvls
+elseif (nvls.gt.mvls ) then
+ write(nfecra,9080) ficaml, mvls, nvls, nvls, nvls
+endif
+
+! --> Caracteristiques et infos particulaires (ENTIERS)
+
+nberro = 0
+
+NOMITE(JISOR) = 'numero_cellule_particules'
+if (nbclst.gt.0) then
+ NOMITE(JCLST) = 'numero_groupe_statistiques'
+endif
+if (iphyla.eq.2) then
+ NOMITE(JINCH) = 'numero_charbon'
+endif
+
+nbval = nbpart
+irtyp = 1
+
+do ivar = 1, nivep
+ rubriq = nomite(ivar)
+ call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ itepa(1,ivar),ierror)
+ nberro = nberro+ierror
+enddo
+
+! --> Caracteristiques et infos particulaires (REELS)
+
+NOMRTE(JRTSP) = 'temps_sejour_particules'
+NOMRTE(JRPOI) = 'poids_statistiques_particules'
+if (iphyla.eq.1 .and. itpvar.eq.1 .and. iirayo.gt.0) then
+ NOMRTE(JREPS) = 'emissivite_particules'
+endif
+if (iphyla.eq.2) then
+ NOMRTE(JRDCK) = 'diametre_coeur_retrecissant_charbon'
+ NOMRTE(JRD0P) = 'diametre_initial_charbon'
+ NOMRTE(JRR0P) = 'masse_volumique_initial_charbon'
+endif
+
+nbval = nbpart
+irtyp = 2
+
+do ivar = 1, nvep
+ rubriq = nomrte(ivar)
+ call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tepa(1,ivar),ierror)
+ nberro = nberro+ierror
+enddo
+
+dnbpar = 0.d0
+do ip = 1, nbpart
+ dnbpar = dnbpar + tepa(ip,jrpoi)
+enddo
+
+! --> Variables particulaires
+
+NOMNVL(JXP) = 'variable_positionX_particule'
+NOMNVL(JYP) = 'variable_positionY_particule'
+NOMNVL(JZP) = 'variable_positionZ_particule'
+NOMNVL(JUP) = 'variable_vitesseU_particule'
+NOMNVL(JVP) = 'variable_vitesseV_particule'
+NOMNVL(JWP) = 'variable_vitesseW_particule'
+NOMNVL(JUF) = 'variable_vitesseU_fluide_vu'
+NOMNVL(JVF) = 'variable_vitesseV_fluide_vu'
+NOMNVL(JWF) = 'variable_vitesseW_fluide_vu'
+NOMNVL(JMP) = 'variable_masse_particule'
+NOMNVL(JDP) = 'variable_diametre_particule'
+if (iphyla.eq.1 .and. itpvar.eq.1) then
+ NOMNVL(JTP) = 'variable_temperature_particule'
+ NOMNVL(JTF) = 'variable_temperature_fluide_vu'
+ NOMNVL(JCP) = 'variable_chaleur_specifique_particule'
+elseif (iphyla.eq.2) then
+ NOMNVL(JHP) = 'variable_temperature_particule'
+ NOMNVL(JTF) = 'variable_temperature_fluide_vu'
+ NOMNVL(JMCH) = 'variable_masse_charbon_reactif'
+ NOMNVL(JMCK) = 'variable_masse_coke'
+ NOMNVL(JCP) = 'variable_chaleur_specifique_particule'
+endif
+if (mvls.gt.0) then
+ do ip = 1,mvls
+ WRITE(CAR4,'(I4.4)') IP
+ NOMNVL(JVLS(IP)) = 'variable_supplementaire_'//CAR4
+ enddo
+endif
+
+nbval = nbpart
+irtyp = 2
+
+do ivar = jmp, jwf
+ rubriq = nomnvl(ivar)
+ call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ettp(1,ivar),ierror)
+ nberro = nberro+ierror
+enddo
+
+if (iphyla.eq.1 .and. itpvar.eq.1) then
+
+ if (itpvar.eq.1 .and. jtpvar.eq.0) then
+
+ do ip = 1,nbpart
+ iel = itepa(ip,jisor)
+ ettp(ip,jtp) = tpart
+ ettp(ip,jcp) = cppart
+ if ( ippmod(icp3pl).ge.0 .or. &
+ ippmod(icpl3c).ge.0 .or. &
+ ippmod(icfuel).ge.0 ) then
+ ettp(ip,jtf) = propce(iel,ipproc(itemp1)) -tkelvi
+ else if ( ippmod(icod3p).ge.0 .or. &
+ ippmod(icoebu).ge.0 .or. &
+ ippmod(ielarc).ge.0 .or. &
+ ippmod(ieljou).ge.0 ) then
+ ettp(ip,jtf) = propce(iel,ipproc(itemp)) -tkelvi
+ else if ( iscsth(iscalt(iphas)).eq.1 ) then
+ ettp(ip,jtf) = rtpa(iel,isca(iscalt(iphas))) -tkelvi
+ else if ( iscsth(iscalt(iphas)).eq.-1 ) then
+ ettp(ip,jtf) = rtpa(iel,isca(iscalt(iphas)))
+ else if ( iscsth(iscalt(iphas)).eq.2 ) then
+ mode = 1
+ call usthht(mode, rtpa(iel,isca(iscalt(iphas))), &
+ ettp(ip,jtf))
+ endif
+ enddo
+
+ else if (itpvar.eq.1 .and. jtpvar.eq.1) then
+ do ivar = jtp,jcp
+ rubriq = nomnvl(ivar)
+ call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ettp(1,ivar),ierror)
+ nberro = nberro+ierror
+ enddo
+ endif
+
+else if (iphyla.eq.2) then
+ do ivar = jhp,jcp
+ rubriq = nomnvl(ivar)
+ call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ettp(1,ivar),ierror)
+ nberro = nberro+ierror
+ enddo
+endif
+
+if (mvls.gt.0) then
+ do ivar = 1,mvls
+ rubriq = nomnvl(jvls(ivar))
+ call lecsui(impaml,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ettp(1,jvls(ivar)),ierror)
+ nberro = nberro+ierror
+ enddo
+endif
+
+! ---> Si pb : arret
+
+
+if(nberro.ne.0) then
+ write(nfecra,9041) ficaml, ficaml
+ call csexit (1)
+endif
+
+write(nfecra,6011)
+
+! ---> Fermeture du fichier suite
+
+call clssui(impaml,ierror)
+
+if(ierror.ne.0) then
+ write(nfecra,9090) ficaml, ficaml
+endif
+
+write(nfecra,6099)
+
+
+!===============================================================================
+! 3. LECTURE DU FICHIER SUITE STATISTIQUES ET TERMES SOURCES
+! DE COUPLAGE RETOUR
+!===============================================================================
+
+if (isuist.eq.1) then
+
+! ---> Ouverture
+
+ write(nfecra,7000)
+
+! (ILECEC=1:lecture)
+ ilecec = 1
+ call opnsui(ficmls,len(ficmls),ilecec,impmls,ierror)
+ !==========
+ if(ierror.ne.0) then
+ write(nfecra,9010) ficmls, ficmls
+ call csexit (1)
+ endif
+
+ write(nfecra,7010)
+
+! ---> Type de fichier suite
+! Pourrait porter le numero de version si besoin.
+! On ne se sert pas de IVERS pour le moment
+
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+
+ RUBRIQ = 'version_fichier_suite_Lagrangien_statistiques'
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ivers,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9020) ficaml, ficaml
+ call csexit (1)
+ endif
+
+ RUBRIQ = 'indicateur_ecoulement_stationnaire'
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jsttio,ierror)
+ if (ierror.ne.0) then
+ write(nfecra,9040) ficaml, &
+ 'indicateur_ecoulement_stationnaire ', &
+ ficaml
+ call csexit (1)
+ endif
+
+! Dimensions des supports
+
+ call tstsui(impmls,ncelok,nfaiok,nfabok,nsomok)
+ !==========
+ if(ncelok.eq.0) then
+ write(nfecra,9030) ficmls
+ call csexit (1)
+ endif
+
+ IF(NFAIOK.EQ.0) WRITE(NFECRA,9031) FICMLS,'internes','internes'
+
+ IF(NFABOK.EQ.0) WRITE(NFECRA,9031) FICMLS,'de bord ','de bord '
+
+
+! --> Est-on cense lire une suite de stats volumiques ?
+
+ if (istala.eq.1 .and. iplas.ge.idstnt) then
+
+ nberro = 0
+ itysup = 0
+ nbval = 1
+
+ RUBRIQ = 'iteration_debut_statistiques'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jdstnt,ierror)
+ nberro = nberro+ierror
+
+ RUBRIQ = 'iteration_debut_statistiques_stationnaires'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ mstist,ierror)
+ nberro = nberro+ierror
+
+! ---> S'il y a des erreurs, on suppose que c'est parce que le fichier
+! suite ne contient pas d'infos sur les stats volumiques.
+! Dans ce cas, si on est en instationnaire on se dit que c'est
+! pas grave, on saute l'etape et on continue. Par contre si on
+! est dans une configuration de calcul de stats volumiques
+! en stationnaire on stoppe.
+
+ if(nberro.ne.0) then
+ if ( isttio.eq.0 .or. &
+ (isttio.eq.1 .and. iplas.lt.nstist) ) then
+ write(nfecra,9110) ficmls, isttio, idstnt, nstist, iplas+1
+ goto 9991
+ else
+ write(nfecra,9120) ficmls, isttio, idstnt, nstist, iplas+1
+ call csexit (1)
+ endif
+ endif
+
+! --> A partir d'ici on considere que le fichier suite contient
+! des stats volumiques
+
+ if ( jsttio.ne.isttio .or. &
+ jdstnt.ne.idstnt .or. &
+ mstist.ne.nstist ) then
+ write (nfecra,9130) ficmls, &
+ jsttio, jdstnt, mstist, &
+ isttio, idstnt, nstist
+ endif
+
+! --> Lecture de l'avancement du calcul stats volumiques
+
+ RUBRIQ = 'nombre_iterations_statistiques_stationnaires'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npst,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9060) ficmls, &
+ 'nombre_iterations_statistiques_stationnaires ', &
+ 'NPST',NPST
+ endif
+
+ RUBRIQ = 'temps_statistiques_stationnaires'
+ irtyp = 2
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tstat,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9061) ficmls, &
+ 'temps_statistiques_stationnaires ', &
+ 'TSTAT',TSTAT
+ endif
+
+ RUBRIQ = 'classe_statistique_particules'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nclsto,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9061) ficmls, &
+ 'classes_statistiques ', &
+ 'NBCLST',NCLSTO
+ endif
+
+! --> Verif de coherence de l'avancement du calcul avec les
+! indicateurs de calcul de la suite actuelle :
+
+! 1) Amont Instationnaire -> Actuel Instationnaire : OK
+! (NPST = 0)
+! -> Actuel Stationnaire : Exit sauf debut
+
+! 2) Amont Stationnaire -> Actuel Instationnaire : OK
+! (NPST > 0) (pertes Stats amont)
+! -> Actuel Stationnaire : OK si IDSTNT et
+! NSTIST n'ont pas change, sinon Exit)
+
+ if (npst.eq.0 .and. (isttio.eq.1 .and. nstist.le.iplas)) then
+ write(nfecra,9140) ficmls, iplas+1, nstist
+ call csexit (1)
+ endif
+
+ if ( npst.gt.0 .and. &
+ ( (isttio.eq.1 .and. iplas.le.nstist) .or. &
+ isttio.eq.0) ) then
+ write(nfecra,9141) ficmls
+ endif
+
+ if (npst.gt.0 .and. (isttio.eq.1 .and. iplas.ge.nstist)) then
+ if ( jdstnt.ne.idstnt .or. &
+ mstist.ne.nstist ) then
+ write(nfecra,9142) ficmls
+ call csexit (1)
+ endif
+ endif
+
+ if ( nbclst .ne. nclsto ) then
+ write(nfecra,9143) ficmls
+ call csexit (1)
+ endif
+
+! --> Stats supplementaires utilisateurs
+
+ RUBRIQ = 'nombre_statistiques_utilisateur'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ mvlsts,ierror)
+
+ if (nvlsts.lt.mvlsts) then
+ write(nfecra,9150) ficmls, mvlsts, nvlsts, nvlsts, nvlsts
+ endif
+
+! --> Lecture des Statistiques volumiques. Pas de traitement d'erreurs,
+! on suppose qu'elles sont dues a un changement de physique.
+
+ itysup = 1
+ irtyp = 2
+ nbval = 1
+
+ do ipas = 0,nbclst
+ do ivl = 1,nvlsta
+ ivar = ipas*nvlsta +ivl
+ if (ipas.gt.0) then
+ WRITE(CAR4,'(I4.4)') IPAS
+ RUBRIQ = 'moy_stat_vol_groupe_'//CAR4//'_'//NOMLAG(IVAR)
+ else
+ RUBRIQ = 'moy_stat_vol_'//NOMLAG(IVAR)
+ endif
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ statis(1,ivar),ierror)
+ enddo
+
+ do ivl = 1,nvlsta-1
+ if (ipas.gt.0) then
+ WRITE(CAR4,'(I4.4)') IPAS
+ RUBRIQ = 'var_stat_vol_groupe_'//CAR4//'_'//NOMLAV(IVAR)
+ else
+ RUBRIQ = 'var_stat_vol_'//NOMLAV(IVAR)
+ endif
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ stativ(1,ivar),ierror)
+ enddo
+ enddo
+
+ endif
+
+
+ 9991 continue
+
+ if (iensi3.eq.1 .and. nvisbr.gt.0 .and. nfabok.ne.0) then
+
+ itysup = 0
+ nbval = 1
+
+ RUBRIQ = 'iteration_debut_stats_frontieres_stationnaires'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ mstbor,ierror)
+
+! ---> S'il y a une erreur, on suppose que c'est parce que le fichier
+! suite ne contient pas d'infos sur les stats aux frontieres.
+! Dans ce cas, si on est en instationnaire on se dit que c'est
+! pas grave, on saute l'etape et on continue. Par contre si on
+! est dans une configuration de calcul de stats aux frontieres
+! en stationnaire on stoppe.
+
+ if(ierror.ne.0) then
+ if ( isttio.eq.0 .or. &
+ (isttio.eq.1 .and. iplas.lt.nstbor) ) then
+ write(nfecra,9210) ficmls, isttio, nstbor, iplas+1
+ goto 9992
+ else
+ write(nfecra,9220) ficmls, isttio, nstbor, iplas+1
+ call csexit (1)
+ endif
+ endif
+
+! --> A partir d'ici on considere que le fichier suite contient
+! des stats volumiques
+
+ if ( jsttio.ne.isttio .or. &
+ mstbor.ne.nstbor ) then
+ write (nfecra,9230) ficmls, &
+ jsttio, mstbor, &
+ isttio, nstbor
+ endif
+
+! --> Lecture de l'avancement du calcul stats aux frontieres
+
+ RUBRIQ = 'nombre_iterations_stats_frontieres'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npstft,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9060) ficmls, &
+ 'nombre_iterations_stats_frontieres ', &
+ 'NPSTFT',NPSTFT
+ endif
+
+ RUBRIQ = 'nombre_iterations_stats_frontieres_stationnaires'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npstf,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9060) ficmls, &
+ 'nombre_iterations_stats_frontieres_stationnaires ', &
+ 'NPSTF',NPSTF
+ endif
+
+ RUBRIQ = 'temps_stats_frontieres_stationnaires'
+ irtyp = 2
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tstatp,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9060) ficmls, &
+ 'temps_stats_frontieres_stationnaires ', &
+ 'TSTATP',TSTATP
+ endif
+
+! --> Verif de coherence de l'avancement du calcul avec les
+! indicateurs de calcul de la suite actuelle :
+
+
+ if (npstf.eq.0 .and. (isttio.eq.1 .and. nstbor.le.iplas)) then
+ write(nfecra,9240) ficmls, iplas+1, nstbor
+ call csexit (1)
+ endif
+
+ if ( npstf.gt.0 .and. &
+ ( (isttio.eq.1 .and. iplas.le.nstbor) .or. &
+ isttio.eq.0) ) then
+ write(nfecra,9241) ficmls
+ endif
+
+ if (npstf.gt.0 .and. (isttio.eq.1 .and. iplas.ge.nstbor)) then
+ if (mstbor.ne.nstbor) then
+ write(nfecra,9242) ficmls
+ call csexit (1)
+ endif
+ endif
+
+! --> Stats supplementaires utilisateurs
+
+ RUBRIQ = 'nombre_stats_frontieres_utilisateur'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ musbor,ierror)
+
+ if (nusbor.lt.musbor) then
+ write(nfecra,9250) ficmls, musbor, nusbor, nusbor, nusbor
+ endif
+
+! --> Lecture des stats aux frontieres. Pas de traitement d'erreurs,
+! on suppose qu'elles sont dues a un changement de physique.
+
+ itysup = 3
+ irtyp = 2
+ nbval = 1
+
+ do ivar = 1,nvisbr
+ RUBRIQ = 'stat_bord_'//NOMBRD(IVAR)
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ parbor(1,ivar),ierror)
+ enddo
+
+ endif
+
+ 9992 continue
+
+ if (iilagr.eq.2) then
+
+ itysup = 0
+ nbval = 1
+
+ RUBRIQ = 'iteration_debut_termes_sources_stationnaires'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ mstits,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9020) ficmls, &
+ 'iteration_debut_termes_sources_stationnaires ', &
+ 'NSTITS',MSTITS
+ endif
+
+! ---> S'il y a une erreur, on suppose que c'est parce que le fichier
+! suite ne contient pas d'infos sur les TS de couplage retour.
+! Dans ce cas, si on est en instationnaire on se dit que c'est
+! pas grave, on saute l'etape et on continue. Par contre si on
+! est dans une configuration de calcul de stats aux frontieres
+! en stationnaire on stoppe.
+
+ if(ierror.ne.0) then
+ if ( isttio.eq.0 .or. &
+ (isttio.eq.1 .and. iplas.lt.nstits) ) then
+ write(nfecra,9310) ficmls, isttio, nstits, iplas+1
+ goto 9993
+ else
+ write(nfecra,9320) ficmls, isttio, nstits, iplas+1
+ call csexit (1)
+ endif
+ endif
+
+! --> A partir d'ici on considere que le fichier suite contient
+! des stats volumiques
+
+ RUBRIQ = 'modele_turbulence_termes_sources'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ jturb,ierror)
+
+ jtytur = jturb/10
+
+ if ( jsttio.ne.isttio .or. &
+ mstits.ne.nstits ) then
+ IF (JTYTUR.EQ.2) CAR8 = 'k-eps'
+ IF (JTYTUR.EQ.3) CAR8 = 'Rij-eps'
+ IF (JTURB.EQ.50) CAR8 = 'v2f'
+ IF (JTURB.EQ.60) CAR8 = 'k-omega'
+ IF (ITYTUR(IPHAS).EQ.2) KAR8 = 'k-eps'
+ IF (ITYTUR(IPHAS).EQ.3) KAR8 = 'Rij-eps'
+ IF (ITURB(IPHAS).EQ.50) KAR8 = 'v2f'
+ IF (ITURB(IPHAS).EQ.60) KAR8 = 'k-omega'
+ write (nfecra,9330) ficmls, &
+ jsttio, mstits, car8, &
+ isttio, nstits, kar8
+ endif
+
+
+! --> Lecture de l'avancement du couplage retour
+
+ RUBRIQ = 'nombre_iterations_termes_sources_stationnaires'
+ irtyp = 1
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npts,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9060) ficmls, &
+ 'nombre_iterations_termes_sources_stationnaires ', &
+ 'NPTS',NPTS
+ endif
+
+! --> Verif de coherence de l'avancement du calcul avec les
+! indicateurs de calcul de la suite actuelle :
+
+ if (npts.eq.0 .and. (isttio.eq.1 .and. nstits.le.iplas)) then
+ write(nfecra,9340) ficmls, iplas+1, nstits
+ call csexit (1)
+ endif
+
+ if ( npts.gt.0 .and. &
+ ( (isttio.eq.1 .and. iplas.le.nstits) .or. &
+ isttio.eq.0) ) then
+ write(nfecra,9341) ficmls
+ endif
+
+ if (npts.gt.0 .and. (isttio.eq.1 .and. iplas.ge.nstits)) then
+ if (mstits.ne.nstits) then
+ write(nfecra,9342) ficmls
+ call csexit (1)
+ endif
+ endif
+
+! On donne des labels au different TS pour les noms de rubriques
+! On donne le meme label au keps, au v2f et au k-omega (meme variable k)
+
+ if (ltsdyn.eq.1) then
+ NOMTSL(ITSVX) = 'terme_source_vitesseX'
+ NOMTSL(ITSVY) = 'terme_source_vitesseY'
+ NOMTSL(ITSVZ) = 'terme_source_vitesseZ'
+ NOMTSL(ITSLI) = 'terme_source_vitesse_implicite'
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ NOMTSL(ITSKE) = 'terme_source_turbulence_keps'
+ else if (itytur(iphas).eq.3) then
+ NOMTSL(ITSR11) = 'terme_source_turbulence_R11'
+ NOMTSL(ITSR12) = 'terme_source_turbulence_R12'
+ NOMTSL(ITSR13) = 'terme_source_turbulence_R13'
+ NOMTSL(ITSR22) = 'terme_source_turbulence_R22'
+ NOMTSL(ITSR23) = 'terme_source_turbulence_R23'
+ NOMTSL(ITSR33) = 'terme_source_turbulence_R33'
+ endif
+ endif
+ if (ltsmas.eq.1) then
+ NOMTSL(ITSMAS) = 'terme_source_masse'
+ endif
+ if (ltsthe.eq.1) then
+ if (iphyla.eq.1 .and. itpvar.eq.1) then
+ NOMTSL(ITSTE) = 'terme_source_thermique_explicite'
+ NOMTSL(ITSTI) = 'terme_source_thermique_implicite'
+ else if (iphyla.eq.2) then
+ NOMTSL(ITSTE) = 'terme_source_thermique_explicite'
+ NOMTSL(ITSTI) = 'terme_source_thermique_implicite'
+ do icha = 1,ncharb
+ WRITE(CAR4,'(I4.4)') ICHA
+ NOMTSL(ITSMV1(ICHA)) = 'terme_source_legeres_F1_'//CAR4
+ NOMTSL(ITSMV2(ICHA)) = 'terme_source_lourdes_F2_'//CAR4
+ enddo
+ NOMTSL(ITSCO) = 'terme_source_F3'
+ NOMTSL(ITSFP4) = 'terme_source_variance_traceur_air'
+ endif
+ endif
+
+! Termes source de couplage retour
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ do ivar = 1,ntersl
+ rubriq = nomtsl(ivar)
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tslagr(1,ivar),ierror)
+ enddo
+
+
+! Dans le cas specifique de la combustion de grains de charbon
+! avec un couplage retour sur une combustion gaz en phase porteuse
+
+! --> A verifier l'utilite de cette lecture pour une suite...
+
+ if (ippmod(icpl3c).ge.0) then
+ do ivar = 1, nsalpp
+ icha = nsalto-nsalpp+ivar
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ WRITE(CAR4,'(I4.4)') IVAR
+ RUBRIQ = 'scalaires_physiques_pariculieres_charbon'//CAR4
+ call lecsui(impmls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(icha)),ierror)
+ enddo
+ endif
+
+ endif
+
+ 9993 continue
+
+ write(nfecra,6011)
+
+! ---> Fermeture du fichier suite
+
+ call clssui(impmls,ierror)
+
+ if(ierror.ne.0) write(nfecra,9090) ficmls, ficmls
+
+! ---> En cas d'erreur, on continue quand meme
+
+ write(nfecra,7099)
+
+endif
+
+write(nfecra,2000)
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+
+ 2000 format( &
+' ',/,&
+'-------------------------------------------------------------',/)
+
+ 6000 FORMAT (/, 3X,'** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/, &
+ 3X,' ------------------------------------- ',/, &
+ 3X,' Lecture d''un fichier suite ',/, &
+ 3X,' sur les variables liees aux particules ' )
+ 6010 FORMAT ( 3X,' Debut de la lecture ' )
+ 6011 FORMAT ( 3X,' Fin de la lecture ' )
+ 6099 FORMAT ( 3X,' Fin de la lecture du fichier suite ',/, &
+ 3X,' sur les variables liees aux particules ',/)
+
+ 7000 FORMAT (/, 3X,'** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/, &
+ 3X,' ------------------------------------- ',/, &
+ 3X,' Lecture d''un fichier suite ',/, &
+ 3X,' sur les statistiques et TS couplage retour' )
+ 7010 FORMAT ( 3X,' Debut de la lecture ' )
+ 7099 FORMAT ( 3X,' Fin de la lecture du fichier suite ',/, &
+ 3X,' sur les statistiques et TS couplage retour' )
+
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE D''UN FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',/,&
+'@ ',/,&
+'@ ERREUR A L''OUVERTURE DU FICHIER SUITE ',A13 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier l''existence et le nom (',A13 ,') du ',/,&
+'@ fichier suite dans le repertoire de travail. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ TYPE DE FICHIER INCORRECT ',/,&
+'@ ',/,&
+'@ Le fichier ',A13 ,' ne semble pas etre un fichier ',/,&
+'@ suite Lagrangien. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ a un fichier suite Lagrangien. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de cellules a ete modifie ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de faces ',A8 ,' a ete modifie. ',/,&
+'@ ',/,&
+'@ Le calcul peut etre execute mais les donnees ',/,&
+'@ sur les faces ',A8 ,' ne seront pas relues ',/,&
+'@ dans le fichier suite. ',/,&
+'@ Elles seront initialisees par des valeurs par defaut. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite ',A13 ,' utilise ',/,&
+'@ correspond bien a un fichier suite Lagrangien, ',/,&
+'@ et qu''il n''a pas ete endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DES VARIABLES PARTICULAIRES ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite ',A13 ,' utilise ',/,&
+'@ correspond bien a un fichier suite Lagrangien, ',/,&
+'@ et qu''il n''a pas ete endommage. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de particules contenu dans le fichier suite ',/,&
+'@ est superieur au nombre de particule maximal autorise ',/,&
+'@ NBPART = ',I10 ,/,&
+'@ NBPMAX = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Augmenter la valeur de NBPMAX dans USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le mot cle est initialise avec sa valeur par defaut ',/,&
+'@ ou celle donnee dans le sous-programme USLAG1 : ',/,&
+'@ ',A10 ,' = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9061 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le mot cle est initialise avec sa valeur par defaut ',/,&
+'@ ou celle donnee dans le sous-programme USLAG1 : ',/,&
+'@ ',A10 ,' = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9062 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ ERREUR A LA LECTURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9065 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ L''INDICATEUR DE CALCUL DES STATISTIQUES VOLUMIQUES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGLEC). ',/,&
+'@ ',/,&
+'@ LORSQU''IL N''Y A PAS DE SUITE DE CALCUL SUR LES ',/,&
+'@ STATISTIQUES VOLUMIQUES (ISUIST = ', I3, '),' ,/,&
+'@ IDSTNT DOIT ETRE UN ENTIER SUPERIEUR AU NUMERO ',/,&
+'@ DE L''ITERATION LAGRANGIENNE DE REDEMARRAGE ', I10 ,/,&
+'@ IL VAUT ICI IDSTNT = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IDSTNT dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9066 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ L''INDICATEUR DE CALCUL STATIONNAIRES DES STATISTIQUES ',/,&
+'@ AUX FRONTIERES A UNE VALEUR NON PERMISE (LAGLEC). ',/,&
+'@ ',/,&
+'@ LORSQU''IL N''Y A PAS DE SUITE DE CALCUL SUR LES ',/,&
+'@ STATISTIQUES AUX FRONTIERES (ISUIST = ', I3, '),' ,/,&
+'@ NSTBOR DOIT ETRE UN ENTIER SUPERIEUR AU NUMERO ',/,&
+'@ DE L''ITERATION LAGRANGIENNE DE REDEMARRAGE ', I10 ,/,&
+'@ IL VAUT ICI NSTBOR = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NSTBOR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9070 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant la physique associee ',/,&
+'@ aux particules sont modifies : ',/,&
+'@ ',/,&
+'@ IPHYLA ITPVAR IDPVAR IMPVAR ',/,&
+'@ AMONT : ',4I10 ,/,&
+'@ ACTUEL: ',4I10 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9071 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Aucune selection de physique associee aux particules ',/,&
+'@ n''est active. Les donnees amont sont perdues. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9072 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Une equation sur la temperature des particules est ',/,&
+'@ enclenchee en cours de calcul. ',/,&
+'@ Initialisation par defaut : ',/,&
+'@ Temperature TPART = ', E14.5 ,/,&
+'@ Chaleur massique CPPART = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9073 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ L''indicateur d''un calcul Lagrangien de grains ',/,&
+'@ de charbon est enclenche (IPHYLA = 2). ',/,&
+'@ Le fichier suite ',A13 ,' ne correspond pas ',/,&
+'@ a un calcul Lagrangien de grains de charbon. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHYLA dans le sous-programme USLAG1. ',/,&
+'@ Verifier le fichier suite utilise. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9074 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ Le fichier suite ',A13 ,' correspond ',/,&
+'@ a un calcul Lagrangien de grains de charbon. ',/,&
+'@ L''indicateur de physique actuel associee aux particules',/,&
+'@ a une valeur non permise dans le cadre d''une suite ',/,&
+'@ d''un calcul Lagrangien de grains de charbon. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier IPHYLA dans le sous-programme USLAG1. ',/,&
+'@ Verifier le fichier suite utilise. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9080 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ L''indicateur du nombre de variables supplementaires ',/,&
+'@ utilisateur est modifie, ou n''a pas pu etre relu. ',/,&
+'@ ',/,&
+'@ NVLS ',/,&
+'@ AMONT : ',I10 ,' ACTUEL : ',I10 ,/,&
+'@ ',/,&
+'@ Si ACTUEL > AMONT, on initialise les ',I10 ,' 1eres ',/,&
+'@ variables supplementaires actuelles avec celles ',/,&
+'@ du fichier suite, les autres sont initialisees a zero.',/,&
+'@ ',/,&
+'@ Si ACTUEL < AMONT, on initialise les ',I10 ,' 1eres ',/,&
+'@ variables supplementaires actuelles avec les 1eres ',/,&
+'@ du fichier suite, le reste des variables du fichier ',/,&
+'@ suite sont perdues. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9090 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom : ',A13 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9110 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ LES STATISTIQUES VOLUMIQUES DU CALCUL AMONT ',/,&
+'@ NE PEUVENT PAS ETRE RELUES OU SONT ABSENTES ',/,&
+'@ DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des ',/,&
+'@ statistiques volumiques sont positionnes en mode ',/,&
+'@ instationnaire ou en debut de calcul stationnaire : ',/,&
+'@ ',/,&
+'@ ISTTIO IDSTNT NSTIST Iter de redemarrage ',/,&
+'@ ',4I10 ,/,&
+'@ ',/,&
+'@ Elles seront initialisees par des valeurs par defaut. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9120 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ LES STATISTIQUES VOLUMIQUES DU CALCUL AMONT ',/,&
+'@ NE PEUVENT PAS ETRE RELUES OU SONT ABSENTES ',/,&
+'@ DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des ',/,&
+'@ statistiques volumiques sont positionnes ',/,&
+'@ en mode stationnaire : ',/,&
+'@ ',/,&
+'@ ISTTIO IDSTNT NSTIST Iter de redemarrage ',/,&
+'@ ',4I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9130 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des ',/,&
+'@ statistiques volumiques sont modifies : ',/,&
+'@ ',/,&
+'@ ISTTIO IDSTNT NSTIST ',/,&
+'@ AMONT : ',3I10 ,/,&
+'@ ACTUEL: ',3I10 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9140 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL ACTUEL DES STATISTIQUES VOLUMIQUES ',/,&
+'@ EST EN MODE STATIONNAIRE, ALORS QUE LE FICHIER ',/,&
+'@ SUITE CONTIENT DES STATISTIQUES INSTATIONNAIRES. ',/,&
+'@ ',/,&
+'@ NSTIST devrait etre un entier superieur ou egal ',/,&
+'@ a l''iteration Lagrangienne absolue de redemarrage ',/,&
+'@ du calcul (iteration : ',I10 ,') ',/,&
+'@ ',/,&
+'@ Il vaut ici NSTIST = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9141 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL ACTUEL DES STATISTIQUES VOLUMIQUES ',/,&
+'@ EST EN MODE INSTATIONNAIRE, ALORS QUE LE FICHIER ',/,&
+'@ SUITE CONTIENT DES STATISTIQUES STATIONNAIRES. ',/,&
+'@ ',/,&
+'@ Les statistiques volumiques stationnaires amont ',/,&
+'@ seront remises a zero. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9142 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL SE POURSUIT AVEC UN CALCUL DE ',/,&
+'@ STATISTIQUES VOLUMIQUES EN MODE STATIONNAIRE ',/,&
+'@ MAIS LES INDICATEURS DE CONTROLES DES STATISTIQUES ',/,&
+'@ ON ETE MODIFIEES. ',/,&
+'@ ',/,&
+'@ Pour eviter les incoherences dans le calcul ',/,&
+'@ IDSTNT et NSTIST ne devraient pas etre modifies entre ',/,&
+'@ deux calculs de statistiques volumiques stationnaires.',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9143 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL SE POURSUIT AVEC UN CALCUL DE ',/,&
+'@ STATISTIQUES VOLUMIQUES EN MODE STATIONNAIRE ',/,&
+'@ MAIS LES INDICATEURS DE CONTROLES DES STATISTIQUES ',/,&
+'@ ON ETE MODIFIEES. ',/,&
+'@ ',/,&
+'@ Pour eviter les incoherences dans le calcul ',/,&
+'@ NBCLST ne devrait pas etre modifies entre ',/,&
+'@ deux calculs de statistiques volumiques. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9150 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ L''indicateur du nombre de statistiques volumiques ',/,&
+'@ supplementaires utilisateur est modifie, ',/,&
+'@ ou n''a pas pu etre relu. ',/,&
+'@ ',/,&
+'@ NVLSTS ',/,&
+'@ AMONT : ',I10 ,' ACTUEL : ',I10 ,/,&
+'@ ',/,&
+'@ Si ACTUEL > AMONT, on initialise les ',I10 ,' 1eres ',/,&
+'@ statistiques supplementaires actuelles avec celles ',/,&
+'@ du fichier suite, les autres sont initialisees a zero.',/,&
+'@ ',/,&
+'@ Si ACTUEL < AMONT, on initialise les ',I10 ,' 1eres ',/,&
+'@ statistiques supplementaires actuelles avec les 1eres ',/,&
+'@ du fichier suite, le reste des statistiques du fichier',/,&
+'@ suite sont perdues. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ LES STATISTIQUES AUX FRONTIERES DU CALCUL AMONT ',/,&
+'@ NE PEUVENT PAS ETRE RELUES OU SONT ABSENTES ',/,&
+'@ DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des ',/,&
+'@ statistiques aux frontieres sont positionnes en mode ',/,&
+'@ instationnaire ou en debut de calcul stationnaire : ',/,&
+'@ ',/,&
+'@ ISTTIO NSTBOR Iter de redemarrage ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ Elles seront initialisees par des valeurs par defaut. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9220 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ LES STATISTIQUES AUX FRONTIERES DU CALCUL AMONT ',/,&
+'@ NE PEUVENT PAS ETRE RELUES OU SONT ABSENTES ',/,&
+'@ DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des ',/,&
+'@ statistiques aux frontieres sont positionnes ',/,&
+'@ en mode stationnaire : ',/,&
+'@ ',/,&
+'@ ISTTIO NSTBOR Iter de redemarrage ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9230 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des ',/,&
+'@ statistiques aux frontieres sont modifies : ',/,&
+'@ ',/,&
+'@ ISTTIO NSTBOR ',/,&
+'@ AMONT : ',2I10 ,/,&
+'@ ACTUEL: ',2I10 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9240 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL ACTUEL DES STATISTIQUES AUX FRONTIERES ',/,&
+'@ EST EN MODE STATIONNAIRE, ALORS QUE LE FICHIER ',/,&
+'@ SUITE CONTIENT DES STATISTIQUES INSTATIONNAIRES. ',/,&
+'@ ',/,&
+'@ NSTBOR devrait etre un entier superieur ou egal ',/,&
+'@ a l''iteration Lagrangienne absolue de redemarrage ',/,&
+'@ du calcul (iteration : ',I10 ,') ',/,&
+'@ ',/,&
+'@ Il vaut ici NSTBOR = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9241 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL ACTUEL DES STATISTIQUES AUX FRONTIERES ',/,&
+'@ EST EN MODE INSTATIONNAIRE, ALORS QUE LE FICHIER ',/,&
+'@ SUITE CONTIENT DES STATISTIQUES STATIONNAIRES. ',/,&
+'@ ',/,&
+'@ Les statistiques aux frontieres stationnaires amont ',/,&
+'@ seront remises a zero. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9242 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL SE POURSUIT AVEC UN CALCUL DE ',/,&
+'@ STATISTIQUES AUX FRONTIERES EN MODE STATIONNAIRE ',/,&
+'@ MAIS LES INDICATEURS DE CONTROLES DES STATISTIQUES ',/,&
+'@ ON ETE MODIFIEES. ',/,&
+'@ ',/,&
+'@ Pour eviter les incoherences dans le calcul ',/,&
+'@ NSTBOR ne devrait pas etre modifie entre deux calculs ',/,&
+'@ de statistiques aux frontieres stationnaires. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9250 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ L''indicateur du nombre de statistiques aux frontieres ',/,&
+'@ supplementaires utilisateur est modifie, ',/,&
+'@ ou n''a pas pu etre relu. ',/,&
+'@ ',/,&
+'@ NUSBOR ',/,&
+'@ AMONT : ',I10 ,' ACTUEL : ',I10 ,/,&
+'@ ',/,&
+'@ Si ACTUEL > AMONT, on initialise les ',I10 ,' 1eres ',/,&
+'@ statistiques supplementaires actuelles avec celles ',/,&
+'@ du fichier suite, les autres sont initialisees a zero.',/,&
+'@ ',/,&
+'@ Si ACTUEL < AMONT, on initialise les ',I10 ,' 1eres ',/,&
+'@ statistiques supplementaires actuelles avec les 1eres ',/,&
+'@ du fichier suite, le reste des statistiques du fichier',/,&
+'@ suite sont perdues. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ LES TERMES SOURCES DE COUPLAGE RETOUR DU CALCUL AMONT ',/,&
+'@ NE PEUVENT PAS ETRE RELUES OU SONT ABSENTS ',/,&
+'@ DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des termes sources ',/,&
+'@ de couplage retour sont positionnes en mode ',/,&
+'@ instationnaire ou en debut de calcul stationnaire : ',/,&
+'@ ',/,&
+'@ ISTTIO NSTITS Iter de redemarrage ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ Ils seront initialisees par des valeurs par defaut. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ ',/,&
+'@ LES TERMES SOURCES DE COUPLAGE RETOUR DU CALCUL AMONT ',/,&
+'@ NE PEUVENT PAS ETRE RELUES OU SONT ABSENTS ',/,&
+'@ DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des termes sources ',/,&
+'@ de couplage retour sont positionnes ',/,&
+'@ en mode stationnaire : ',/,&
+'@ ',/,&
+'@ ISTTIO NSTITS Iter de redemarrage ',/,&
+'@ ',3I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9330 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Les indicateurs concernant le calcul ',/,&
+'@ instationnaire/stationnaire des termes sources ',/,&
+'@ de couplage retour sont modifies : ',/,&
+'@ ',/,&
+'@ ISTTIO NSTITS Turbulence ',/,&
+'@ AMONT : ',2I10,A13 ,/,&
+'@ ACTUEL: ',2I10,A13 ,/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1 et USINI1 ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9340 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL ACTUEL DES TERMES SOURCES DE COUPLAGE RETOUR ',/,&
+'@ EST EN MODE STATIONNAIRE, ALORS QUE LE FICHIER ',/,&
+'@ SUITE CONTIENT DES TERMES SOURCES INSTATIONNAIRES. ',/,&
+'@ ',/,&
+'@ NSTITS devrait etre un entier superieur ou egal ',/,&
+'@ a l''iteration Lagrangienne absolue de redemarrage ',/,&
+'@ du calcul (iteration : ',I10 ,') ',/,&
+'@ ',/,&
+'@ Il vaut ici NSTITS = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9341 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL ACTUEL DES TERMES SOURCES DE COUPLAGE RETOUR ',/,&
+'@ EST EN MODE INSTATIONNAIRE, ALORS QUE LE FICHIER ',/,&
+'@ SUITE CONTIENT DES TERMES SOURCES STATIONNAIRES. ',/,&
+'@ ',/,&
+'@ Les termes sources de couplage retour stationnaires ',/,&
+'@ amont seront remises a zero. ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@ Il est conseille de verifier ces indicateurs dans ',/,&
+'@ le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9342 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= LAGRANGIEN ',A13 ,/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ LE CALCUL SE POURSUIT AVEC UN CALCUL DES TERMES ',/,&
+'@ SOURCES DE COUPLAGE RETOUR EN MODE STATIONNAIRE ',/,&
+'@ MAIS LES INDICATEURS DE CONTROLES DES TERMES SOURCES ',/,&
+'@ ON ETE MODIFIEES. ',/,&
+'@ ',/,&
+'@ Pour eviter les incoherences dans le calcul ',/,&
+'@ NSTITS ne devrait pas etre modifie entre deux calculs ',/,&
+'@ de termes sources de couplage retour stationnaires. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier ces indicateurs dans le sous-programme USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/laglis.f90 b/src/lagr/laglis.f90
new file mode 100644
index 0000000..2c14b9e
--- /dev/null
+++ b/src/lagr/laglis.f90
@@ -0,0 +1,600 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine laglis &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , statis , stativ , tslagr , parbor , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! ECITURE DES INFOS DANS LE LISTING
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,ntersl ! ! ! lagrangien sur la phase porteuse !
+! parbor ! tr ! <-- ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve) , ituser(nituse) , ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision tslagr(ncelet,ntersl)
+double precision parbor(nfabor,nvisbr)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifinia, ifinra
+integer ifac , iel , ivf , itabvr , nbrcel
+integer ivff , iflu , icla , ii , nb
+double precision aa , bb , gmax , gmin , gmoy
+character chcond*16
+
+!===============================================================================
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+if (nbpart.ne.0) then
+ aa = 100.d0 / dble(nbpart)
+else
+ aa = 0.d0
+endif
+
+!===============================================================================
+! 2. AFFICHAGE LISTING
+!===============================================================================
+
+write (nfecra,1000)
+
+! NOMBRE DE PARTICULES
+
+write(nfecra,1001)
+write(nfecra,1010) iplas , iplar
+write(nfecra,1001)
+write(nfecra,1020)
+write(nfecra,1002)
+write(nfecra,1031) nbpnew, dnbpnw
+if (iroule.ge.1) then
+ write(nfecra,1037) npcsup, dnpcsu
+ write(nfecra,1032) npclon, dnpclo
+ write(nfecra,1034) npkill, dnpkil
+endif
+if (iphyla.eq.2 .and. iencra.eq.1) then
+ write(nfecra,1038) npencr, dnpenc
+endif
+write(nfecra,1033) nbpout-nbperr, (dnbpou-dnbper)
+write(nfecra,1035) nbperr, dnbper
+write(nfecra,1036) nbpart, dnbpar
+write(nfecra,1001)
+if (nbptot.gt.0) then
+ write(nfecra,1050) (nbpert*100.d0)/dble(nbptot)
+ write(nfecra,1001)
+endif
+
+! DEBIT SUR CHAQUE ZONE
+
+write(nfecra,7000)
+write(nfecra,1002)
+do ii = 1,nfrlag
+ nb = ilflag(ii)
+
+ if ( iusclb(nb) .eq. ientrl) then
+ CHCOND = 'ENTREE'
+ else if ( iusclb(nb) .eq. irebol) then
+ CHCOND = 'REBOND'
+ else if ( iusclb(nb) .eq. isortl) then
+ CHCOND = 'SORTIE'
+ else if ( iusclb(nb) .eq. idepo1 .or. &
+ iusclb(nb) .eq. idepo2 .or. &
+ iusclb(nb) .eq. idepo3 ) then
+ CHCOND = 'DEPOSITION'
+ else if ( iusclb(nb) .eq. iencrl) then
+ CHCOND = 'ENCRASSEMENT'
+ else if ( iusclb(nb) .eq. idepfa) then
+ CHCOND = 'FORCES_CHIMIQUES'
+ else
+ CHCOND = 'UTILISATEUR'
+ endif
+
+ write(nfecra,7001) nb,deblag(nb)/dtp,chcond
+enddo
+write(nfecra,1001)
+
+! STATISTIQUES VOLUMIQUES
+
+if (istala.eq.1) then
+ write(nfecra,2000)
+ write(nfecra,1002)
+ write(nfecra,2005) idstnt
+
+ if (iplas.ge.idstnt) then
+
+ if (isttio.eq.0) then
+ write(nfecra,2010) npstt
+ endif
+ if (isttio.eq.1 .and. iplas.lt.nstist) then
+ write(nfecra,2020) npstt
+ write(nfecra,2030) nstist
+ else if (isttio.eq.1 .and. iplas.ge.nstist) then
+ write(nfecra,2020) npstt
+ write(nfecra,2040) npst
+ endif
+ write(nfecra,1001)
+
+ if (nvlsta.gt.0) then
+ write(nfecra,3010)
+ write(nfecra,1002)
+
+ ifinia = idebia
+ itabvr = idebra
+ ifinra = itabvr + ncelet
+ CALL RASIZE('LAGLIS',IFINRA)
+ !==========
+
+! MOYENNE
+
+ do ivf = 1, nvlsta
+
+ ivff = ivf
+ icla = 0
+ iflu = 0
+
+ call uslaen &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivff , ivff , ivff , iflu , ilpd , icla , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , stativ , ra(itabvr), &
+ rdevel , rtuser , ra )
+
+ nbrcel = 0
+
+ gmax = -grand
+ gmin = grand
+ gmoy = 0.d0
+
+ do iel = 1,ncel
+ bb = ra(itabvr+iel-1)
+ if (bb.gt.seuil) then
+ nbrcel = nbrcel + 1
+ gmax = max (gmax, bb)
+ gmin = min (gmin, bb)
+ gmoy = gmoy + bb
+ endif
+ enddo
+
+ if (nbrcel.gt.0) then
+ gmoy = gmoy /dble(nbrcel)
+ else
+ gmax = 0.d0
+ gmin = 0.d0
+ gmoy = 0.d0
+ endif
+ write(nfecra,3020) nomlag(ivf), gmin, gmax, gmoy
+
+ enddo
+ endif
+ endif
+
+ write(nfecra,1001)
+
+endif
+
+! STATISTIQUES PARIETALES
+
+if (iensi3.eq.1) then
+
+ write(nfecra,5000)
+ write(nfecra,1002)
+ if (isttio.eq.1) then
+ if (iplas.ge.nstbor) then
+ write(nfecra,5020) npstf
+ else
+ write(nfecra,5010) nstbor
+ endif
+ endif
+ write(nfecra,5030) npstft
+ write(nfecra,1001)
+
+ if (nvisbr.gt.0) then
+ write(nfecra,6000)
+ write(nfecra,1002)
+
+ if (nvisbr.gt.1) then
+
+ itabvr = idebra
+ ifinra = itabvr + nfabor
+ CALL RASIZE('LAGLIS',IFINRA)
+ !==========
+
+ do ifac = 1,nfabor
+ if (parbor(ifac,inbr).gt.seuilf) then
+ ra(itabvr+ifac-1) = 1.d0 / parbor(ifac,inbr)
+ else
+ ra(itabvr+ifac-1) = 0.d0
+ endif
+ enddo
+
+ endif
+
+ do ivf = 1, nvisbr
+
+ ivff = ivf
+ call lagstf &
+ !==========
+ ( ncelet , nfabor , nvisbr , &
+ ivff , &
+ gmin , gmax , gmoy , &
+ parbor , ra(itabvr) )
+
+ write(nfecra,6010) nombrd(ivf), gmin, gmax, gmoy
+
+ enddo
+
+ write(nfecra,1001)
+
+ endif
+
+endif
+
+! INFO SUR LE COUPLAGE RETOUR
+
+if (iilagr.eq.2) then
+
+ if (isttio.eq.0) then
+ write(nfecra,4000)
+ write(nfecra,1002)
+
+ else if (isttio.eq.1) then
+ write(nfecra,4010)
+ write(nfecra,1002)
+
+ if (iplas.lt.nstits) then
+ write(nfecra,4020) nstits
+ else if (iplas.ge.nstist) then
+ write(nfecra,4030) npts
+ endif
+
+ endif
+
+ write(nfecra,4050) vmax
+ write(nfecra,4060) tmamax
+ write(nfecra,4070) ntxerr
+
+ write(nfecra,1001)
+
+endif
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(3X,'** INFORMATIONS SUR LE CALCUL LAGRANGIEN',/3X, &
+ ' -------------------------------------')
+
+ 1001 format('-----------------------------------------------------', &
+ '----------')
+
+ 1002 format(' ---------------------------------------------------', &
+ '-----')
+
+ 1010 format('Iters Lagrangiennes absolues/relatives : ', &
+ I10,' /',I10)
+
+ 1020 format(' Pour cette iteration, nombre de particules',/, &
+ ' (sans et avec leur poids statistique) :')
+ 1031 format('ln nouvelles injectees ',I8,3X,E14.5)
+ 1032 format('ln nouvelles par clonage ',I8,3X,E14.5)
+ 1033 format('ln sorties ou deposees definitivement ',I8,3X,E14.5)
+ 1034 format('ln eliminees par roulette russe ',I8,3X,E14.5)
+ 1035 format('ln perdues par erreur de reperage ',I8,3X,E14.5)
+ 1036 format('ln total restantes en fin de passage ',I8,3X,E14.5)
+ 1037 format('ln qui ont subit le clonage ',I8,3X,E14.5)
+ 1038 format('ln de charbon encrassees ',I8,3X,E14.5)
+
+ 1050 format('% de particules perdues (suites comprises) : ',E10.4)
+
+ 2000 format(' Statistiques volumiques :')
+
+ 2005 format('Debut des statistiques a l''iteration absolue : ',I10)
+
+ 2010 format('Nombre d''iterations dans les stats instationnaires : ', &
+ i10)
+
+ 2020 format('Nombre d''iterations total dans les statistiques :',I10)
+
+ 2030 format('RAZ des stats (debut du calcul stationnaire : ',I10,' )')
+
+ 2040 format('Nombre d''iterations dans les stats stationnaires :',I9)
+
+ 3010 format(' Stats volumiques Valeur min Valeur max ', &
+ 'Valeur moy')
+
+ 3020 format('lc ',A13,2X,E12.5,2X,E12.5,2X,E12.5)
+
+ 4000 format(' Termes sources de couplage-retour instationnaires :')
+
+ 4010 format(' Termes sources de couplage-retour :')
+
+ 4020 format('RAZ des TS (debut du calcul stationnaire : ',I10,')')
+
+ 4030 format('Nombre d''iterations dans les TS stationnaires :',I10)
+
+ 4050 format('Taux volumiques max de particules : ',E14.5)
+
+ 4060 format('Taux massiques max de particules : ',E14.5)
+
+ 4070 format('Nbr de cellules qui ont un taux volumique > 0.8 :',I10)
+
+ 5000 format(' Statistiques aux frontieres :')
+
+ 5010 format('RAZ des stats aux frontieres (debut stationnaire : ', &
+ I8,')')
+
+ 5020 format('Nbr d''iters des stats frontieres stationnaires : ',I10)
+
+ 5030 format('Nbr d''iters total dans les stats aux frontieres :',I10)
+
+ 6000 format(' Stats frontieres Valeur min Valeur max ', &
+ 'Valeur moy')
+
+ 6010 format('lp ', A13, 2X, E12.5, 2X, E12.5, 2X, E12.5)
+
+ 7000 format(3X,'ZONE DEBIT(kg/s) TYPE CL ')
+
+ 7001 format(2x, i3, 10x, e12.5, 9x, a16)
+
+!====
+! FIN
+!====
+
+end
+
+!-----------------------------------------------------------------------
+!Iterations Lagrangiennes absolues/relatives : 1234567 /1234567
+!-----------------------------------------------------------------------
+! Pour cette iteration, nombre particules :
+! ---------------------------------------------------------
+!ln nouvelles injectees 12345678 0.3067e+04
+!ln qui ont ete clonees 12345678
+!ln nouvelles par clonage 12345678
+!ln sortantes du domaine 12345678
+!ln eliminees par roulette russe 12345678
+!ln perdues par erreur de reperage 12345678
+!ln total restantes en fin de passage 12345678
+!-----------------------------------------------------------------------
+!Poucentage de particules perdues pour ce calcul : 1234567890
+!-----------------------------------------------------------------------
+! Statistiques volumiques :
+! ---------------------------------------------------------
+!Debut des stat a l'iteration Lagrangienne absolue : 1234567
+!Nombre de passages dans les stat instationnaires : 1234567
+!Nombre de passages total dans les stat : 1234567
+!RAZ des statistiques stationnaires (debut du cumul : 1234567)
+!Nombre de passages dans les stat stationnaires : 1234567
+!-----------------------------------------------------------------------
+! Stat volumiques Valeur min Valeur max Valeur moy
+! ---------------------------------------------------------
+!lc 1234567890123 -0.47302e+03 -0.30677e+04 -0.30677e+04
+!-----------------------------------------------------------------------
+! Termes sources de couplage-retour
+! ---------------------------------------------------------
+!Taux volumiques max de particules :
+!Taux massiques max de particules :
+!Nbr de cellules qui ont un taux volumique > 0.8 :
+!-----------------------------------------------------------------------
+! Statistiques aux frontieres :
+! ---------------------------------------------------------
+!RAZ des stat aux frontieres (debut stationnaire : 1234567890)
+!Nbr d''iter des stat aux frontieres stationnaires : 1234567890
+!Nbr d''iter total dans les stat aux frontieres : 1234567890
+!-----------------------------------------------------------------------
+! Stat volumiques Valeur min Valeur max Valeur moy
+! ---------------------------------------------------------
+!lp nombreImpacts -0.47302e+03 -0.30677e+04
+!-----------------------------------------------------------------------
+
diff --git a/src/lagr/lagnew.f90 b/src/lagr/lagnew.f90
new file mode 100644
index 0000000..630fb41
--- /dev/null
+++ b/src/lagr/lagnew.f90
@@ -0,0 +1,485 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagnew &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npt , nptnew , new , &
+ nideve , nrdeve , nituse , nrtuse , &
+ izone , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ifrlag , isorti , iworkp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , ettp , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! TIRAGE ALEATOIRE DE LA POSITION DES PARTICULES A INJECTER
+! DANS LE DOMAINE DE CALCUL AU NIVEAU DES FACES
+! D'UNE ZONE DE COULEUR : POSITIONS + REPERAGE DE LA CELLULE
+! ATTENTION : CE TIRAGE ALEATOIRE NE FONCTIONNE QU'AVEC DES FACES
+! TRIANGULAIRE OU QUADRANGULAIRES.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! npt ! e ! --> ! nombre courant de particules !
+! nptnew ! e ! <-- ! nombre total de nouvelles particules !
+! ! ! ! pour toutes les zones d'injection !
+! new ! e ! <-- ! nombre de nouvelles part a injecter !
+! ! ! ! pour la zone d'injection courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! izone ! e ! <-- ! numero de la zone d'injection !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! ifrlag ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module lagrangien !
+! isorti ! te ! --> ! pour chaque particule : !
+! (nbpmax) ! ! ! * numero de sa cellule !
+! ! ! ! * 0 si sortie du domaine !
+! iworkp(nptnew ! te ! --> ! numero de la face d'injection !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! surfbn(nfabor ! tr ! <-- ! surface des faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!==============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer npt , nptnew , new
+integer nideve , nrdeve , nituse , nrtuse
+integer izone
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer ifrlag(nfabor) , isorti(nbpmax) , iworkp(nptnew)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision surfbn(nfabor)
+double precision ettp(nbpmax,nvp)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer nnn , nnnn , ifac , np , ii
+integer ifrbr , minfac , maxfac
+integer iconfo(100)
+
+double precision surfm , rda(1) , rd , eps , pm1 , pm6
+double precision ctr(6,3) , vec(3) , are(2,3) , surftr(2)
+
+!===============================================================================
+
+eps = 1.d-3
+
+! CALCUL DE LA SURFACE MAX DE L'ENTREE :
+
+surfm = -10.d0
+minfac = nfabor+1
+maxfac = 0
+
+do ifac = 1,nfabor
+ ifrbr = ifrlag(ifac)
+ if (ifrbr.eq.izone) then
+ surfm = max( surfm,surfbn(ifac) )
+ minfac = min (ifac,minfac)
+ maxfac = max (ifac,maxfac)
+ endif
+enddo
+
+! STOP PAR SECURITE
+
+if (maxfac.eq.0.or.minfac.eq.nfabor+1) then
+ write(nfecra,9000) izone
+ call csexit (1)
+ !==========
+endif
+
+! BOUCLE SUR LES NOUVELLES PARTICULES :
+
+do np = 1,new
+
+! incrementation du pointeur sur les particules
+
+ npt = npt + 1
+
+! tirage aleatoire d'une face :
+
+ 100 continue
+
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+
+ rd = rd*(dble(maxfac-minfac+1)-eps)
+ ifac = minfac + int(rd)
+
+ if (ifac .lt. minfac .or. ifac .gt. maxfac) goto 100
+
+! numero de la face :
+
+ ifrbr = ifrlag(ifac)
+
+ if (ifrbr.ne.izone) goto 100
+
+! tirage aleatoire pour determiner si cette face convient
+! plus la fa7 est grande plus elle a des chance d'etre choisie
+
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+
+ if (rd.gt.(surfbn(ifac)/surfm)) goto 100
+
+! ATTENTION :
+
+! type de face : 3 ou 4 points supports
+! pour l'instant je ne sais pas traiter les autres
+! avec plus de points supports...
+
+ ii = ipnfbr(ifac+1)-ipnfbr(ifac)
+ if (ii.gt.4) goto 100
+
+! si face a 4 points, on choisit l'un des deux triangles
+
+ if (ii.eq.4) then
+
+ ii = 0
+ do nnnn = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ ii = ii+1
+ iconfo(ii) = nodfbr(nnnn)
+ enddo
+
+! longueur des arretes 1 et 2 du premier triangle :
+
+ are(1,1) = xyznod(1,iconfo(2)) - xyznod(1,iconfo(1))
+ are(1,2) = xyznod(2,iconfo(2)) - xyznod(2,iconfo(1))
+ are(1,3) = xyznod(3,iconfo(2)) - xyznod(3,iconfo(1))
+ are(2,1) = xyznod(1,iconfo(3)) - xyznod(1,iconfo(1))
+ are(2,2) = xyznod(2,iconfo(3)) - xyznod(2,iconfo(1))
+ are(2,3) = xyznod(3,iconfo(3)) - xyznod(3,iconfo(1))
+
+! surface du premier triangle
+
+ vec(1) = are(1,2)*are(2,3)-are(1,3)*are(2,2)
+ vec(2) = are(1,3)*are(2,1)-are(1,1)*are(2,3)
+ vec(3) = are(1,1)*are(2,2)-are(1,2)*are(2,1)
+ surftr(1) = sqrt(vec(1)**2+vec(2)**2+vec(3)**2)
+
+! longueur des arretes 1 et 2 du deuxieme triangle :
+
+ are(1,1) = xyznod(1,iconfo(3)) - xyznod(1,iconfo(1))
+ are(1,2) = xyznod(2,iconfo(3)) - xyznod(2,iconfo(1))
+ are(1,3) = xyznod(3,iconfo(3)) - xyznod(3,iconfo(1))
+ are(2,1) = xyznod(1,iconfo(4)) - xyznod(1,iconfo(1))
+ are(2,2) = xyznod(2,iconfo(4)) - xyznod(2,iconfo(1))
+ are(2,3) = xyznod(3,iconfo(4)) - xyznod(3,iconfo(1))
+
+! surface du deuxieme triangle
+
+ vec(1) = are(1,2)*are(2,3) - are(1,3)*are(2,2)
+ vec(2) = are(1,3)*are(2,1) - are(1,1)*are(2,3)
+ vec(3) = are(1,1)*are(2,2) - are(1,2)*are(2,1)
+ surftr(2) = sqrt(vec(1)*vec(1)+vec(2)*vec(2)+vec(3)*vec(3))
+
+! tirage d'un nombre aleatoire entre 0 et 1
+! pour determiner quel triangle choisir
+
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+
+! si le deuxieme triangle est choisit, on reorganise
+! les points : 4 <--> 2
+
+ if (rd.le.( surftr(2) / (surftr(1)+surftr(2)) )) then
+ nnnn = iconfo(4)
+ iconfo(4) = iconfo(2)
+ iconfo(2) = nnnn
+ endif
+
+! dans le cas ou la face est un triangle...
+
+ else if (ii.eq.3) then
+
+ ii = 0
+ do nnnn = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ ii = ii+1
+ iconfo(ii) = nodfbr(nnnn)
+ enddo
+
+ endif
+
+! constitution des coordonnees du triangle
+
+ do nnnn = 1,3
+ ctr(nnnn,1) = xyznod(1,iconfo(nnnn))
+ ctr(nnnn,2) = xyznod(2,iconfo(nnnn))
+ ctr(nnnn,3) = xyznod(3,iconfo(nnnn))
+ enddo
+
+! tirage aleatoire d'un point dans le triangle
+! constitue des points 1,2,3
+
+ 200 continue
+
+! 1) tirage du point 4 sur l'arete 12
+
+ 300 continue
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+ if (rd.eq.0.d0 .or. rd.eq.1.d0) goto 300
+
+ do nnnn = 1,3
+ ctr(4,nnnn) = rd*ctr(1,nnnn) + (1.d0-rd)*ctr(2,nnnn)
+ enddo
+
+! 2) tirage du point 5 sur l'arete 13
+
+ 400 continue
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+ if (rd.eq.0.d0 .or. rd.eq.1.d0) goto 400
+
+ do nnnn = 1,3
+ ctr(5,nnnn) = rd*ctr(1,nnnn) +( 1.d0-rd)*ctr(3,nnnn)
+ enddo
+
+! 3) le point 6 est le sommet du parallelogramme 1465
+
+ do nnnn = 1,3
+ ctr(6,nnnn) = ctr(4,nnnn) + ctr(5,nnnn) - ctr(1,nnnn)
+ enddo
+
+! 4) reste a verifier que le point 6 appartient au triangle 123
+
+! 4.1) vecteur normal au triangle : 12^13
+
+ vec(1) = (ctr(2,2)-ctr(1,2))*(ctr(3,3)-ctr(1,3)) &
+ - (ctr(2,3)-ctr(1,3))*(ctr(3,2)-ctr(1,2))
+ vec(2) = (ctr(2,3)-ctr(1,3))*(ctr(3,1)-ctr(1,1)) &
+ - (ctr(2,1)-ctr(1,1))*(ctr(3,3)-ctr(1,3))
+ vec(3) = (ctr(2,1)-ctr(1,1))*(ctr(3,2)-ctr(1,2)) &
+ - (ctr(2,2)-ctr(1,2))*(ctr(3,1)-ctr(1,1))
+
+! 4.2) produit mixte pour le point 1 :
+
+ pm1 = 0.d0
+ pm1 = pm1 + vec(1) * &
+ ( (ctr(2,2)-ctr(1,2))*(ctr(3,3)-ctr(2,3)) &
+ -(ctr(2,3)-ctr(1,3))*(ctr(3,2)-ctr(2,2)) )
+ pm1 = pm1 + vec(2) * &
+ ( (ctr(2,3)-ctr(1,3))*(ctr(3,1)-ctr(2,1)) &
+ -(ctr(2,1)-ctr(1,1))*(ctr(3,3)-ctr(2,3)) )
+ pm1 = pm1 + vec(3) * &
+ ( (ctr(2,1)-ctr(1,1))*(ctr(3,2)-ctr(2,2)) &
+ -(ctr(2,2)-ctr(1,2))*(ctr(3,1)-ctr(2,1)) )
+
+! 4.3) produit mixte pour le point 6 :
+
+ pm6 = 0.d0
+ pm6 = pm6 + vec(1) * &
+ ( (ctr(2,2)-ctr(6,2))*(ctr(3,3)-ctr(2,3)) &
+ -(ctr(2,3)-ctr(6,3))*(ctr(3,2)-ctr(2,2)) )
+ pm6 = pm6 + vec(2) * &
+ ( (ctr(2,3)-ctr(6,3))*(ctr(3,1)-ctr(2,1)) &
+ -(ctr(2,1)-ctr(6,1))*(ctr(3,3)-ctr(2,3)) )
+ pm6 = pm6 + vec(3) * &
+ ( (ctr(2,1)-ctr(6,1))*(ctr(3,2)-ctr(2,2)) &
+ -(ctr(2,2)-ctr(6,2))*(ctr(3,1)-ctr(2,1)) )
+
+! 4.4) 6 est dans le triangle si PM1*PM6>=0
+
+ if (pm1*pm6.lt.0.d0) goto 200
+
+! 5) POUR PLUS DE SECURITE, ON DEPLACE LE POINT
+! D'UN EPSILON EN DIRECTION DU CENTRE CELLULE
+
+! ATTENTION : CE DECALAGE PEUT ETRE DANGEREUX DANS LE CAS
+! DE CELULES CONCAVES
+
+ ctr(6,1) = ctr(6,1) + (xyzcen(1,ifabor(ifac))-ctr(6,1))*eps
+ ctr(6,2) = ctr(6,2) + (xyzcen(2,ifabor(ifac))-ctr(6,2))*eps
+ ctr(6,3) = ctr(6,3) + (xyzcen(3,ifabor(ifac))-ctr(6,3))*eps
+
+
+! LE TRAITEMENT EST TERMINE POUR LE POINT NPT,
+! ON REMPLIT LES TABLEAUX POUR LE LAGRANGIEN :
+
+ ettp(npt,jxp) = ctr(6,1)
+ ettp(npt,jyp) = ctr(6,2)
+ ettp(npt,jzp) = ctr(6,3)
+
+ isorti(npt) = ifabor(ifac)
+ iworkp(npt) = ifac
+
+enddo
+
+!===============================================================================
+
+!-------
+! FORMAT
+!-------
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGNEW). ',/,&
+'@ ',/,&
+'@ PROBLEME DANS LA GESTION DE NOUVELLES PARTICULES ',/,&
+'@ ',/,&
+'@ Le nombre de faces de la zone ',I10 ,/,&
+'@ est egal a zero. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/lagr/lagnpr.f90 b/src/lagr/lagnpr.f90
new file mode 100644
index 0000000..5d73707
--- /dev/null
+++ b/src/lagr/lagnpr.f90
@@ -0,0 +1,461 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagnpr &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npt , nptnew , new , &
+ nideve , nrdeve , nituse , nrtuse , &
+ izone , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ifrlag , isorti , iworkp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , ettp , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! TIRAGE ALEATOIRE DE LA POSITION DES PARTICULES A INJECTER
+! DANS LE DOMAINE DE CALCUL AU NIVEAU DES FACES
+! D'UNE ZONE DE COULEUR : POSITIONS + REPERAGE DE LA CELLULE
+! ATTENTION : CE TIRAGE ALEATOIRE NE FONCTIONNE QU'AVEC DES FACES
+! TRIANGULAIRE OU QUADRANGULAIRES.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! npt ! e ! --> ! nombre courant de particules !
+! nptnew ! e ! <-- ! nombre total de nouvelles particules !
+! ! ! ! pour toutes les zones d'injection !
+! new ! e ! <-- ! nombre de nouvelles part a injecter !
+! ! ! ! pour la zone d'injection courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! izone ! e ! <-- ! numero de la zone d'injection !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! ifrlag ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module lagrangien !
+! isorti ! te ! --> ! pour chaque particule : !
+! (nbpmax) ! ! ! * numero de sa cellule !
+! ! ! ! * 0 si sortie du domaine !
+! iworkp(nptnew ! te ! --> ! numero de la face d'injection !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! surfbn(nfabor ! tr ! <-- ! surface des faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!==============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer npt , nptnew , new
+integer nideve , nrdeve , nituse , nrtuse
+integer izone
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer ifrlag(nfabor) , isorti(nbpmax) , iworkp(nptnew)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision surfbn(nfabor)
+double precision ettp(nbpmax,nvp)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer nnn , nnnn , ifac , ii
+integer ifrbr , minfac , maxfac
+integer iconfo(100)
+
+double precision surfm , rda(1) , rd , eps , pm1 , pm6
+double precision ctr(6,3) , vec(3) , are(2,3) , surftr(2)
+
+!===============================================================================
+
+eps = 1.d-3
+
+! CALCUL DE LA SURFACE MAX DE L'ENTREE :
+
+surfm = -10.d0
+minfac = nfabor+1
+maxfac = 0
+
+do ifac = 1,nfabor
+ ifrbr = ifrlag(ifac)
+ if (ifrbr.eq.izone) then
+ surfm = max( surfm,surfbn(ifac) )
+ minfac = min (ifac,minfac)
+ maxfac = max (ifac,maxfac)
+ endif
+enddo
+
+! STOP PAR SECURITE
+
+if (maxfac.eq.0.or.minfac.eq.nfabor+1) then
+ write(nfecra,9000) izone
+ call csexit (1)
+ !==========
+endif
+
+! BOUCLE SUR LES FACES DE LA ZONE
+
+do ifac = 1,nfabor
+ ifrbr = ifrlag(ifac)
+ if (ifrbr.eq.izone) then
+
+! incrementation du pointeur sur les particules
+
+ npt = npt + 1
+
+! ATTENTION :
+
+! type de face : 3 ou 4 points supports
+! pour l'instant je ne sais pas traiter les autres
+! avec plus de points supports...
+
+ ii = ipnfbr(ifac+1)-ipnfbr(ifac)
+ if (ii.gt.4) goto 100
+
+! si face a 4 points, on choisit l'un des deux triangles
+
+ if (ii.eq.4) then
+
+ ii = 0
+ do nnnn = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ ii = ii+1
+ iconfo(ii) = nodfbr(nnnn)
+ enddo
+
+! longueur des arretes 1 et 2 du premier triangle :
+
+ are(1,1) = xyznod(1,iconfo(2)) - xyznod(1,iconfo(1))
+ are(1,2) = xyznod(2,iconfo(2)) - xyznod(2,iconfo(1))
+ are(1,3) = xyznod(3,iconfo(2)) - xyznod(3,iconfo(1))
+ are(2,1) = xyznod(1,iconfo(3)) - xyznod(1,iconfo(1))
+ are(2,2) = xyznod(2,iconfo(3)) - xyznod(2,iconfo(1))
+ are(2,3) = xyznod(3,iconfo(3)) - xyznod(3,iconfo(1))
+
+! surface du premier triangle
+
+ vec(1) = are(1,2)*are(2,3)-are(1,3)*are(2,2)
+ vec(2) = are(1,3)*are(2,1)-are(1,1)*are(2,3)
+ vec(3) = are(1,1)*are(2,2)-are(1,2)*are(2,1)
+ surftr(1) = sqrt(vec(1)**2+vec(2)**2+vec(3)**2)
+
+! longueur des arretes 1 et 2 du deuxieme triangle :
+
+ are(1,1) = xyznod(1,iconfo(3)) - xyznod(1,iconfo(1))
+ are(1,2) = xyznod(2,iconfo(3)) - xyznod(2,iconfo(1))
+ are(1,3) = xyznod(3,iconfo(3)) - xyznod(3,iconfo(1))
+ are(2,1) = xyznod(1,iconfo(4)) - xyznod(1,iconfo(1))
+ are(2,2) = xyznod(2,iconfo(4)) - xyznod(2,iconfo(1))
+ are(2,3) = xyznod(3,iconfo(4)) - xyznod(3,iconfo(1))
+
+! surface du deuxieme triangle
+
+ vec(1) = are(1,2)*are(2,3) - are(1,3)*are(2,2)
+ vec(2) = are(1,3)*are(2,1) - are(1,1)*are(2,3)
+ vec(3) = are(1,1)*are(2,2) - are(1,2)*are(2,1)
+ surftr(2) = sqrt(vec(1)*vec(1)+vec(2)*vec(2)+vec(3)*vec(3))
+
+! tirage d'un nombre aleatoire entre 0 et 1
+! pour determiner quel triangle choisir
+
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+
+! si le deuxieme triangle est choisit, on reorganise
+! les points : 4 <--> 2
+
+ if (rd.le.( surftr(2) / (surftr(1)+surftr(2)) )) then
+ nnnn = iconfo(4)
+ iconfo(4) = iconfo(2)
+ iconfo(2) = nnnn
+ endif
+
+! dans le cas ou la face est un triangle...
+
+ else if (ii.eq.3) then
+
+ ii = 0
+ do nnnn = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ ii = ii+1
+ iconfo(ii) = nodfbr(nnnn)
+ enddo
+
+ endif
+
+! constitution des coordonnees du triangle
+
+ do nnnn = 1,3
+ ctr(nnnn,1) = xyznod(1,iconfo(nnnn))
+ ctr(nnnn,2) = xyznod(2,iconfo(nnnn))
+ ctr(nnnn,3) = xyznod(3,iconfo(nnnn))
+ enddo
+
+! tirage aleatoire d'un point dans le triangle
+! constitue des points 1,2,3
+
+ 200 continue
+
+! 1) tirage du point 4 sur l'arete 12
+
+ 300 continue
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+ if (rd.eq.0.d0 .or. rd.eq.1.d0) goto 300
+
+ do nnnn = 1,3
+ ctr(4,nnnn) = rd*ctr(1,nnnn) + (1.d0-rd)*ctr(2,nnnn)
+ enddo
+
+! 2) tirage du point 5 sur l'arete 13
+
+ 400 continue
+ nnn = 1
+ call zufall(nnn,rda)
+ rd=rda(1)
+ if (rd.eq.0.d0 .or. rd.eq.1.d0) goto 400
+
+ do nnnn = 1,3
+ ctr(5,nnnn) = rd*ctr(1,nnnn) +( 1.d0-rd)*ctr(3,nnnn)
+ enddo
+
+! 3) le point 6 est le sommet du parallelogramme 1465
+
+ do nnnn = 1,3
+ ctr(6,nnnn) = ctr(4,nnnn) + ctr(5,nnnn) - ctr(1,nnnn)
+ enddo
+
+! 4) reste a verifier que le point 6 appartient au triangle 123
+
+! 4.1) vecteur normal au triangle : 12^13
+
+ vec(1) = (ctr(2,2)-ctr(1,2))*(ctr(3,3)-ctr(1,3)) &
+ - (ctr(2,3)-ctr(1,3))*(ctr(3,2)-ctr(1,2))
+ vec(2) = (ctr(2,3)-ctr(1,3))*(ctr(3,1)-ctr(1,1)) &
+ - (ctr(2,1)-ctr(1,1))*(ctr(3,3)-ctr(1,3))
+ vec(3) = (ctr(2,1)-ctr(1,1))*(ctr(3,2)-ctr(1,2)) &
+ - (ctr(2,2)-ctr(1,2))*(ctr(3,1)-ctr(1,1))
+
+! 4.2) produit mixte pour le point 1 :
+
+ pm1 = 0.d0
+ pm1 = pm1 + vec(1) * &
+ ( (ctr(2,2)-ctr(1,2))*(ctr(3,3)-ctr(2,3)) &
+ -(ctr(2,3)-ctr(1,3))*(ctr(3,2)-ctr(2,2)) )
+ pm1 = pm1 + vec(2) * &
+ ( (ctr(2,3)-ctr(1,3))*(ctr(3,1)-ctr(2,1)) &
+ -(ctr(2,1)-ctr(1,1))*(ctr(3,3)-ctr(2,3)) )
+ pm1 = pm1 + vec(3) * &
+ ( (ctr(2,1)-ctr(1,1))*(ctr(3,2)-ctr(2,2)) &
+ -(ctr(2,2)-ctr(1,2))*(ctr(3,1)-ctr(2,1)) )
+
+! 4.3) produit mixte pour le point 6 :
+
+ pm6 = 0.d0
+ pm6 = pm6 + vec(1) * &
+ ( (ctr(2,2)-ctr(6,2))*(ctr(3,3)-ctr(2,3)) &
+ -(ctr(2,3)-ctr(6,3))*(ctr(3,2)-ctr(2,2)) )
+ pm6 = pm6 + vec(2) * &
+ ( (ctr(2,3)-ctr(6,3))*(ctr(3,1)-ctr(2,1)) &
+ -(ctr(2,1)-ctr(6,1))*(ctr(3,3)-ctr(2,3)) )
+ pm6 = pm6 + vec(3) * &
+ ( (ctr(2,1)-ctr(6,1))*(ctr(3,2)-ctr(2,2)) &
+ -(ctr(2,2)-ctr(6,2))*(ctr(3,1)-ctr(2,1)) )
+
+! 4.4) 6 est dans le triangle si PM1*PM6>=0
+
+ if (pm1*pm6.lt.0.d0) goto 200
+
+! 5) POUR PLUS DE SECURITE, ON DEPLACE LE POINT
+! D'UN EPSILON EN DIRECTION DU POINT PRESSION
+
+! ATTENTION : CE DECALAGE PEUT ETRE DANGEREUX DANS LE CAS
+! DE CELULES CONCAVES
+
+ ctr(6,1) = ctr(6,1) + (xyzcen(1,ifabor(ifac))-ctr(6,1))*eps
+ ctr(6,2) = ctr(6,2) + (xyzcen(2,ifabor(ifac))-ctr(6,2))*eps
+ ctr(6,3) = ctr(6,3) + (xyzcen(3,ifabor(ifac))-ctr(6,3))*eps
+
+! LE TRAITEMENT EST TERMINE POUR LE POINT NPT,
+! ON REMPLIT LES TABLEAUX POUR LE LAGRANGIEN :
+
+ ettp(npt,jxp) = ctr(6,1)
+ ettp(npt,jyp) = ctr(6,2)
+ ettp(npt,jzp) = ctr(6,3)
+
+ isorti(npt) = ifabor(ifac)
+ iworkp(npt) = ifac
+
+ endif
+
+ 100 continue
+
+enddo
+
+!===============================================================================
+
+!-------
+! FORMAT
+!-------
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGNPR). ',/,&
+'@ ',/,&
+'@ PROBLEME DANS LA GESTION DE NOUVELLES PARTICULES ',/,&
+'@ ',/,&
+'@ Le nombre de faces de la zone ',I10 ,/,&
+'@ est egal a zero. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/lagr/lagnwc.f90 b/src/lagr/lagnwc.f90
new file mode 100644
index 0000000..c74ff66
--- /dev/null
+++ b/src/lagr/lagnwc.f90
@@ -0,0 +1,509 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagnwc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npt , nptnew , new , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itycel , icocel , &
+ ifrlag , isorti , iworkp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , ettp , &
+ rdevel , rtuser , ra )
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INJECTION EN CONTINUE DES PARTICULES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! npt ! e ! --> ! nombre courant de particules !
+! nptnew ! e ! <-- ! nombre total de nouvelles particules !
+! ! ! ! pour toutes les zones d'injection !
+! new ! e ! <-- ! nombre de nouvelles part a injecter !
+! ! ! ! pour la zone d'injection courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icocel ! te ! <-- ! connectivite cellules -> faces !
+! (lndnod) ! ! ! face de bord si numero negatif !
+! itycel ! te ! <-- ! connectivite cellules -> faces !
+! (ncelet+1) ! ! ! pointeur du tableau icocel !
+! isorti ! te ! <-- ! pour chaque particule : !
+! (nbpmax) ! ! ! * numero de sa cellule !
+! ! ! ! * 0 si sortie du domaine !
+! iworkp(nptnew ! te ! <-- ! numero de la face d'injection !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! surfbn(nfabor ! tr ! <-- ! surface des faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "period.h"
+include "lagpar.h"
+include "lagran.h"
+
+!==============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer npt , nptnew , new
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer icocel(lndnod) , itycel(ncelet+1)
+integer isorti(nbpmax)
+integer ifrlag(nfabor) , iworkp(nptnew)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision surfbn(nfabor)
+double precision ettp(nbpmax,nvp)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, ifinia
+
+integer np , iel , n1 , ifac , kfac , nbp
+integer ii , jj , in , isort
+integer indian , ifaold , ifanew
+integer itypfo , iconfo(100)
+integer idehor , ierrie , icecpt
+integer icelcr, ipercr ,itepas, iper
+
+double precision rd(1)
+double precision xf, yf, zf
+double precision up, vp, wp, uf, vf, wf
+double precision pta(3), ptb(3), vect(3), vectn(3)
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! Traitement de la periodicite
+
+if (iperio.eq.1) then
+
+ icelcr = idebia
+ ipercr = icelcr + ncelet-ncel
+ ifinia = ipercr + ncelet-ncel
+ CALL IASIZE('LAGNWC', IFINIA)
+ !==========
+
+ do iel = 1,ncelet-ncel
+ ia(icelcr+iel-1) = 0
+ ia(ipercr+iel-1) = -1
+ enddo
+ call perloc(ia(icelcr), ia(ipercr))
+ !==========
+
+endif
+
+!===============================================================================
+! 2. Injection des particules
+!===============================================================================
+
+! BOUCLE SUR LES NOUVELLES PARTICULES :
+
+do np = 1,new
+
+! RAZ du compteur de cellules traversees
+
+ icecpt = 0
+
+!-->IDEHOR = 1 si exterieur du domaine de calcul
+
+ idehor = 0
+
+! Incrementation du pointeur sur les particules
+
+ npt = npt + 1
+
+! On sauvegarde la maille de depart
+
+ isort = isorti(npt)
+
+! Tirage aleatoire
+
+ n1 = 1
+ call zufall(n1,rd)
+
+! Nouvelle position : on le fait dans la
+! direction de la vitesse mais possibilite
+! de le faire par rapport a la normale
+
+ xf = ettp(npt,jxp) + rd(1) *dtp *ettp(npt,jup)
+ yf = ettp(npt,jyp) + rd(1) *dtp *ettp(npt,jvp)
+ zf = ettp(npt,jzp) + rd(1) *dtp *ettp(npt,jwp)
+
+ up = ettp(npt,jup)
+ vp = ettp(npt,jvp)
+ wp = ettp(npt,jwp)
+
+ uf = ettp(npt,juf)
+ vf = ettp(npt,jvf)
+ wf = ettp(npt,jwf)
+
+ if ( xf.eq. ettp(npt,jxp) &
+ .and. yf.eq. ettp(npt,jyp) &
+ .and. zf.eq. ettp(npt,jzp) ) goto 300
+
+! Est-ce que le point est dans le domaine (Clone de LAGCEL)
+
+! Numero de face d 'injection dans l'element
+
+ ifanew = iworkp(npt)
+
+ 100 continue
+
+ iel = isort
+ ifaold = ifanew
+ indian = 0
+ icecpt = icecpt + 1
+
+! ---> Elimination des particules qui posent problemes
+! la particule reste au niveau de la face d'entree
+! (boucles infinies)
+
+ if (icecpt.gt.30) then
+ idehor = 1
+ goto 200
+ endif
+
+! --> balayage des KFAC faces entourant la cellule IEL
+! Elles sont stockees entre ITYCEL(IEL) et ITYCEL(IEL+1)-1
+! (donc KFAC ne peut pas valoir ITYCEL(IEL+1)...)
+
+ kfac = itycel(iel)-1
+
+ do while (indian.eq.0)
+
+ kfac = kfac + 1
+
+! --> Erreur : la particule reste au niveau de la face
+! d'entree
+
+ if (kfac.eq.itycel(iel+1)) then
+ idehor = 1
+ goto 200
+ endif
+
+ ifac = icocel(kfac)
+
+!-->boucle sur les faces internes
+
+!-->si la face interne a deja ete traitee dans la cellule precedente
+! son numero est dans IFAOLD et on ne la retraite pas une seconde fois
+
+ if (ifac.gt.0 .and. ifac.ne.ifaold) then
+
+ in = 0
+ do nbp = ipnfac(ifac),ipnfac(ifac+1)-1
+ in = in + 1
+ iconfo(in) = nodfac(nbp)
+ enddo
+ itypfo = ipnfac(ifac+1) - ipnfac(ifac) + 1
+ iconfo(itypfo) = iconfo(1)
+
+ call ouestu &
+ !==========
+ ( nfecra , ndim , nnod , &
+ ierrie , &
+ ettp(npt,jxp) , ettp(npt,jyp) , ettp(npt,jzp) , &
+ xf , yf , zf ,&
+ cdgfac(1,ifac) , cdgfac(2,ifac) , cdgfac(3,ifac) ,&
+ xyzcen(1,iel) , xyzcen(2,iel) , xyzcen(3,iel) ,&
+ itypfo , iconfo , xyznod , &
+ indian )
+
+ if (ierrie.eq.1) then
+ idehor = 1
+ goto 200
+
+!-->si la particule passe dans la cellule voisine
+
+ else if (indian.eq.1) then
+
+!-->si la particule NPT est dans la cellule II alors le voisin ne
+! peut etre que la cellule JJ, et vice versa, et inversement, et
+! ainsi de suite.
+
+ ifanew = ifac
+
+ ii = ifacel(1,ifac)
+ jj = ifacel(2,ifac)
+
+ if (iel.eq.ii) then
+ isort = jj
+ else if (iel.eq.jj) then
+ isort = ii
+ endif
+
+! Traitement de la periodicite
+! Meme commentaire que dans lagcel.F
+
+ if (isort.gt.ncel) then
+
+ itepas = isort
+ isort = ia(icelcr+itepas-ncel-1)
+
+! On recupere les informations sur la periodicite
+
+ iper = ia(ipercr+itepas-ncel-1)
+
+! MODIFICATION DE LA POSITION
+
+ pta(1)= xf
+ pta(2)= yf
+ pta(3)= zf
+
+ call lagper(iper,pta, ptb)
+ !==========
+
+ xf = ptb(1)
+ yf = ptb(2)
+ zf = ptb(3)
+
+! MODIFICATION DE LA VITESSE
+
+ vect(1) = up
+ vect(2) = vp
+ vect(3) = wp
+
+ call lagvec(iper, vect, vectn)
+ !==========
+
+ up = vectn(1)
+ vp = vectn(2)
+ wp = vectn(3)
+
+! MODIFICATION DE LA VITESSE FLUIDE VUE
+
+ vect(1) = uf
+ vect(2) = vf
+ vect(3) = wf
+
+ call lagvec(iper, vect, vectn)
+ !==========
+
+ uf = vectn(1)
+ vf = vectn(2)
+ wf = vectn(3)
+
+ ifanew = 0
+
+ endif
+
+!--> Retour pour balayage des face de la cellule suivante
+
+ goto 100
+
+ endif
+
+!--> Balayage des faces de bord (reperees par leur valeur negative
+! dans ICOCEL)
+
+! resultat : INDIAN = 0 le rayon PQ ne sort pas de la cellule par
+! ~~~~~~~~ cette face
+! INDIAN = -1 meme cellule
+! INDIAN = 1 interaction avec la frontiere
+
+ else if (ifac.lt.0 .and. ifac.ne.ifaold) then
+
+ ifac = -ifac
+
+ in = 0
+ do nbp = ipnfbr(ifac),ipnfbr(ifac+1)-1
+ in = in + 1
+ iconfo(in) = nodfbr(nbp)
+ enddo
+ itypfo = ipnfbr(ifac+1) - ipnfbr(ifac) + 1
+ iconfo(itypfo) = iconfo(1)
+
+ call ouestu &
+ !==========
+ ( nfecra , ndim , nnod , &
+ ierrie , &
+ ettp(npt,jxp) , ettp(npt,jyp) , ettp(npt,jzp) , &
+ xf , yf , zf ,&
+ cdgfbo(1,ifac) , cdgfbo(2,ifac) , cdgfbo(3,ifac) ,&
+ xyzcen(1,iel) , xyzcen(2,iel) , xyzcen(3,iel) ,&
+ itypfo , iconfo , xyznod , &
+ indian )
+
+!-->si la trajectoire de la particule traverse la face de bord
+! alors on laisse la particule au niveau de la face d'entree
+
+ if (ierrie.eq.1 .or. indian.eq.1) then
+ idehor = 1
+ goto 200
+ endif
+
+ endif
+
+! fin de DO WHILE
+ enddo
+
+!-->Fin de la boucle principale sur les particules
+
+ 200 continue
+
+! Si le point est dans le domaine, alors on injecte la
+! particule du point sinon on laisse la particule au niveau
+! de l'entree
+
+ if (idehor.eq.0) then
+ ettp(npt,jxp) = xf
+ ettp(npt,jyp) = yf
+ ettp(npt,jzp) = zf
+ isorti(npt) = isort
+ endif
+
+ 300 continue
+
+enddo
+
+!==============================================================================
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/lagr/lagopt.f90 b/src/lagr/lagopt.f90
new file mode 100644
index 0000000..09f5884
--- /dev/null
+++ b/src/lagr/lagopt.f90
@@ -0,0 +1,3391 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagopt
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! 1) Initialisation par defaut du parametrage du module
+! lagrangien
+
+! 2) Lecture du parametrage utilisateur
+
+! 3) Verifications du parametrage utilisateur et
+! controles de coherence
+
+! 4) Initialisation des variables en COMMON et des pointeurs
+! sur les tableaux lies aux particules, aux statistiques,
+! aux conditions aux limites, aux variables parietales,
+! aux donnees pour le couplage retour.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "lagpar.h"
+include "lagdim.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+include "radiat.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+integer ii , ip , irf , iphas , icha , i1 , i2 , i3, iok
+
+!===============================================================================
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+! V�rification que la norme IEEE 754 est respect�e par l'architecture.
+! Dans le cas contraire la trajectographie des particules du module
+! lagrangien est susceptible de ne pas fonctionner correctement.
+
+call csieee
+!==========
+
+!===============================================================================
+! 1. INITIALISATIONS PAR DEFAUT DU MODULE LAGRANGIEN
+! ^^^^^^
+! TOUTES CES INITIALISATIONS PRENNENT DES VALEURS NON ADMISSIBLES
+! A LA VERIFICATION POUR ETRE SUR QUE L'UTILISATEUR LES A MODIFIEES
+!===============================================================================
+
+! ILPHAS : numero de la phase continue qui est la phase porteuse
+! des particules
+
+ilphas = 1
+
+
+! IILAGR = 0 : PAS DE CALCUL LAGRANGIEN
+! = 1 : DIPHASIQUE LAGRANGIEN SANS COUPLAGE RETOUR
+! = 2 : DIPHASIQUE LAGRANGIEN AVEC COUPLAGE RETOUR
+! = 3 : DIPHASIQUE LAGRANGIEN SUR CHAMP FIGE
+
+iilagr = 0
+
+! ISUILA = 0 : PAS DE SUITE LAGRANGIENNE
+! = 1 : SUITE LAGRANGIENNE
+
+isuila = 0
+
+! Suite statistiques et TS couplage retour si =1
+
+isuist = 0
+
+! IPHYLA = 0 : PUREMENT DYNAMIQUE
+! = 1 : EQUATION SUR TP, DP et MP
+! = 2 : CHARBON
+
+iphyla = 0
+
+! EQUATION SUR LE DIAMETRE (O : NON , 1 : OUI)
+
+idpvar = 0
+
+! EQUATION SUR LA TEMPERATURE (O : NON , 1 : OUI)
+
+itpvar = 0
+
+! EQUATION SUR LA MASSE (O : NON , 1 : OUI)
+
+impvar = 0
+
+! TEMPERATURE D'INITIALISATION DES PARTICULES DEJA PRESENTES
+
+tpart = -999.d0
+
+! CHALEUR MASSIQUE D'INITIALISATION DES PARTICULES DEJA PRESENTES
+
+cppart = -999.d0
+
+! ENCRASSEMENT
+! IENCRA = 0 pas d'encrassement
+! = 1 encrassement
+! TPRENC : TEMPERATURE MINIMUM POUR l'ENCRASSEMENT
+! VISREF : VISCOSITE CRITIQUE
+
+iencra = 0
+
+do icha = 1 , ncharm2
+ tprenc(icha) = -999.d0
+ visref(icha) = -999.d0
+enddo
+
+! NOMBRE DE PARTICULES MAXIMAL AUTORISE DANS LE DOMAINE
+
+nbpmax = 1000
+
+! NOMBRE DE VARIABLES SUPPLEMENTAIRE SUR LES PARTICULES
+
+nvls = 0
+
+! CARACTERE STATIONNAIRE DE L'ECOULEMENT DE LA PHASE CONTINUE
+
+isttio = 0
+
+! Nombre de passages absolus (i.e. suite comprise) avant de faire
+! une moyenne en temps (CALCUL STATIONNAIRE) des termes sources
+! de couplage retour (seulement si ISTTIO = 1)
+
+nstits = 1
+
+! COUPLAGE RETOUR SUR LA DYNAMIQUE (Vitesse + Turbulence)
+
+ltsdyn = 0
+
+! COUPLAGE UTILE SUR LA MASSE
+
+ltsmas = 0
+
+! COUPLAGE UTILE SUR LA THERMIQUE OU LES VARIABLES CHARBON
+
+ltsthe = 0
+
+! STATISTIQUES
+
+! Calcul statistiques si = 1 ; si 0 pas de stat ; si -1 stop
+
+istala = 0
+
+! Nombre de variables statistiques supplementaires
+
+nvlsts = 0
+
+! Numero du pas de temps pour debut statistque
+
+idstnt = 1
+
+! Debut calcul stationnaire
+
+nstist = 1
+
+! Seuil en POIDS STAT de particules pour les stats
+
+seuil = 0.d0
+
+! Nom des variables
+
+do ii = 1,nvplmx
+
+ write(nomlag(ii),'(A6,I4.4)') 'MoyLag',ii
+
+ write(nomlav(ii),'(A6,I4.4)') 'VarLag',ii
+
+ write(nombrd(ii),'(A6,I4.4)') 'BrdLag',ii
+
+enddo
+
+! Historique pour la moyenne et la variance
+
+do ii = 1,nvplmx
+ ihslag(ii) = 0
+enddo
+
+! INJECTION CONTINUE
+
+injcon = 0
+
+! ROULETTE RUSSE
+
+iroule = 0
+
+! ORDRE D'INTEGRATION
+
+nordre = 2
+
+! DISPERSION TURBULENTE
+
+idistu = 1
+
+! DIFFUSION TURBULENTE
+
+idiffl = 1
+
+! MODEL COMPLET
+
+modcpl = 0
+
+! DIRECTION ASSOCIEE AU MODEL COMPLET
+
+idirla = 0
+
+! CORRECTION DE PRESSION (EXPERIMENTAL)
+
+ilapoi = 0
+
+! POSTPROCESSING MODE : TRAJECTOIRES
+
+iensi1 = 0
+
+! POSTPROCESSING MODE : DEPLACEMENTS
+
+iensi2 = 0
+
+! NOMBRE DE PARTICULES A VISUALISER MAXIMUM=NLISTE
+
+nbvis = 20
+
+! FREQUENCE D'AQUISITION DES DONNEES A VISUALISER
+
+nvisla = 1
+
+! INITIALISATION : PAR DEFAUT ON NE VISUALISE AUCUNE PARTICULE
+
+do ii = 1, nliste
+ liste(ii) = -1
+ list0(ii) = -1
+ nplist(ii) = 0
+enddo
+
+! POSTPROCESSING VARIABLE : VITESSE DU FLUIDE VU
+
+ivisv1 = 0
+
+! POSTPROCESSING VARIABLE : VITESSE DE LA PARTICULE
+
+ivisv2 = 0
+
+! POSTPROCESSING VARIABLE : TEMPS DE SEJOUR
+
+ivistp = 0
+
+! POSTPROCESSING VARIABLE : DIAMETRE
+
+ivisdm = 0
+
+! POSTPROCESSING VARIABLE : MASSE
+
+ivismp = 0
+
+! POSTPROCESSING VARIABLE : TEMPERATURE
+
+iviste = 0
+
+! POSTPROCESSING VARIABLE : TEMPERATURE CHARBON
+
+ivishp = 0
+
+! POSTPROCESSING VARIABLE : DIAMETRE DU COEUR RETRECISSANT
+
+ivisdk = 0
+
+! POSTPROCESSING VARIABLE : MASSE CHARBON REACTIF
+
+ivisch = 0
+
+! POSTPROCESSING VARIABLE : MASSE COKE
+
+ivisck = 0
+
+! POSTPROCESSING MODE : INTERACTIONS PARTICULES/FRONTIERES
+
+iensi3 = 0
+
+! POSTPROCESSING : STAT PARIETALES STATIONNAIRES
+
+nstbor = 1
+
+! Seuil en POIDS STAT de particules pour les stats
+
+seuilf = 0.d0
+
+! INFORMATIONS A ENREGISTRER
+
+inbrbd = 0
+iflmbd = 0
+iangbd = 0
+ivitbd = 0
+iencbd = 0
+
+nusbor = 0
+
+! Type de moyenne applicable pour affichage et post-processing
+
+do ii = 1,nusbrd+10
+ imoybr(ii) = 0
+enddo
+
+!===============================================================================
+! 2.1 INITIALISATIONS UTILISATEUR DU MODULE LAGRANGIEN
+! ^^^^^^^^^^^
+!===============================================================================
+
+if (iihmpr.eq.1) then
+
+ do ii = 1, nvplmx
+ call fclag1(nomlag(ii), len(nomlag(ii)), ii)
+ call fclag2(nomlav(ii), len(nomlav(ii)), ii)
+ call fclag3(nombrd(ii), len(nombrd(ii)), ii)
+ enddo
+
+ call uilag1 &
+ !==========
+ ( iilagr, isuila, isuist, nbpmax, isttio, injcon, &
+ iphyla, idpvar, itpvar, impvar, &
+ iencra, tprenc, visref, enc1, enc2, &
+ nstits, ltsdyn, ltsmas, ltsthe, &
+ nordre, idistu, idiffl, modcpl, idirla, &
+ iensi1, iensi2, ntlal, nbvis, nvisla, &
+ ivisv1, ivisv2, ivistp, ivisdm, iviste, &
+ ivismp, ivishp, ivisdk, ivisch, ivisck, &
+ istala, nbclst, seuil, idstnt, &
+ ihslag, iensi3, seuilf, nstbor, &
+ inbrbd, iflmbd, iangbd, ivitbd, iencbd, imoybr )
+
+ do ii = 1, nvplmx
+ call cfname(1, nomlag(ii), len(nomlag(ii)), ii)
+ call cfname(2, nomlav(ii), len(nomlav(ii)), ii)
+ call cfname(3, nombrd(ii), len(nombrd(ii)), ii)
+ enddo
+
+endif
+
+call uslag1
+!==========
+
+if (iilagr.eq.0) return
+
+!===============================================================================
+! 2.2 VERIFICATION DES INITIALISATIONS UTILISATEUR DU MODULE LAGRANGIEN
+!===============================================================================
+
+! on doit verifier toutes les options entrees par l'utilisateur
+! qui est inventif
+! et si une valeur ne correspond pas, on ne corrige pas, on s'arrete.
+
+iok = 0
+
+! IILAGR
+
+if (iilagr.lt.0 .or. iilagr.gt.3) then
+ write(nfecra,1010) iilagr
+ iok = iok + 1
+endif
+
+! CALCUL SUR CHAMP FIGE : SUITE OBLIGATOIRE
+! ATTENTION : LE CHAMP FIGE LAGRANGIEN N"EST PAS LE MEME QUE CELUI
+! DE L'EULERIEN. POUR LE LAGRANGIEN VITESSE PRESSION ET SCALAIRES
+! SONT CONSTANTS.
+
+if (iilagr.eq.3 .and. isuite.ne.1) then
+ write(nfecra,1012) iilagr, isuite
+ iok = iok + 1
+endif
+
+if (iilagr.eq.3) iccvfg = 1
+
+if (iilagr.ne.2 .and. ippmod(icpl3c).ge.1) then
+ write(nfecra,1013) iilagr, ippmod(icpl3c)
+ iok = iok + 1
+endif
+
+if (iilagr.gt.0 .and. idtvar.eq.2) then
+ write(nfecra,1014) iilagr, idtvar
+ iok = iok + 1
+endif
+
+! ISUILA ISUIST
+
+if (isuila.lt.0 .or. isuila.gt.1) then
+ write(nfecra,1020) isuila
+ iok = iok + 1
+endif
+
+if (isuila.eq.1 .and. isuite.eq.0) then
+ write(nfecra,1021)
+ iok = iok + 1
+endif
+
+if (isuila.eq.1) then
+ if (isuist.lt.0 .or. isuist.gt.1) then
+ write(nfecra,1022) isuist
+ iok = iok + 1
+ endif
+else
+ isuist = 0
+endif
+
+! IPHYLA
+
+if (iphyla.lt.0 .or. iphyla.gt.2) then
+ write(nfecra,1030) iphyla
+ iok = iok + 1
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+! IDPVAR ITPVAR IMPVAR
+
+if (iphyla.eq.1) then
+ if (idpvar.lt.0 .or. idpvar.gt.1) then
+ write(nfecra,1031) idpvar
+ iok = iok + 1
+ endif
+ if (itpvar.lt.0 .or. itpvar.gt.1) then
+ write(nfecra,1032) itpvar
+ iok = iok + 1
+ endif
+ if (impvar.lt.0 .or. impvar.gt.1) then
+ write(nfecra,1033) impvar
+ iok = iok + 1
+ endif
+ ii = ilphas
+ if (itpvar.eq.1 .and. iscalt(ii).eq.-1) then
+ write(nfecra,1034) itpvar, ii, ii, iscalt(ii)
+ iok = iok + 1
+ endif
+else
+ itpvar = 0
+ impvar = 0
+ idpvar = 0
+endif
+
+if (isuila.eq.1 .and. iphyla.eq.1 .and. itpvar.eq.1) then
+ if (cppart.lt.0) then
+ write(nfecra,1036) cppart
+ iok = iok + 1
+ endif
+ if (tpart.lt.tkelvn) then
+ write(nfecra,1037) tkelvn, tpart
+ iok = iok + 1
+ endif
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+! IENCRA TPRENC VISREF
+
+if (iphyla.eq.2) then
+ if (iencra.lt.0 .or. iencra.gt.1) then
+ write(nfecra,1040) iencra
+ iok = iok + 1
+ endif
+
+ do icha = 1 , ncharb
+ if (iencra.eq.1 .and. visref(icha).lt.0) then
+ write(nfecra,1041) iencra, visref(icha), icha
+ iok = iok + 1
+ endif
+ if (iencra.eq.1 .and. tprenc(icha).lt.tkelvn) then
+ write(nfecra,1042) iencra, tkelvn, tprenc(icha), icha
+ iok = iok + 1
+ endif
+ enddo
+
+else
+ iencra = 0
+endif
+
+if (iphyla.ne.2 .and. ippmod(icpl3c).ge.0) then
+ write(nfecra,1043) iphyla, ippmod(icpl3c)
+ iok = iok + 1
+endif
+
+if ( iphyla.eq.2 .and. (ippmod(icpl3c).lt.0 .and. &
+ ippmod(icp3pl).lt.0) ) then
+ write(nfecra,1044) iphyla, ippmod(icpl3c), ippmod(icp3pl)
+ iok = iok + 1
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+! NBPMAX
+
+if (nbpmax.lt.0) then
+ write(nfecra,1050) nbpmax
+ iok = iok + 1
+endif
+
+! NVLS
+
+if (nvls.lt.0 .or. nvls.gt.nusvar) then
+ write(nfecra,1060) nusvar, nvls
+ iok = iok + 1
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+! ISTTIO NSTITS LTSDYN LTSMAS LTSTHE
+
+! Si champs figes alors forcement en stationnaire
+if (iilagr.eq.3) isttio = 1
+
+if (isttio.lt.0 .or. isttio.gt.1) then
+ write(nfecra,1061) isttio
+ iok = iok + 1
+endif
+
+if (iilagr.eq.2) then
+ if (isttio.eq.1 .and. nstits.lt.1) then
+ write(nfecra,1062) nstits
+ iok = iok + 1
+ endif
+ if (ltsdyn.lt.0 .or. ltsdyn.gt.1) then
+ write(nfecra,1063) ltsdyn
+ iok = iok + 1
+ endif
+ if (iphyla.eq.1 .and. (impvar.eq.1 .or. idpvar.eq.1)) then
+ if (ltsmas.lt.0 .or. ltsmas.gt.1) then
+ write(nfecra,1064) ltsmas
+ iok = iok + 1
+ endif
+ else
+ ltsmas = 0
+ endif
+ if ((iphyla.eq.1 .and. itpvar.eq.1) .or. iphyla.eq.2) then
+ if (ltsthe.lt.0 .or. ltsthe.gt.1) then
+ write(nfecra,1065) ltsthe
+ iok = iok + 1
+ endif
+ else
+ ltsthe = 0
+ endif
+ if (ltsdyn.eq.1 .and. iccvfg.eq.1) then
+ write(nfecra,1066) ltsdyn, iccvfg
+ iok = iok + 1
+ endif
+ if (ltsdyn.ne.1 .and. ltsthe.ne.1 .and. ltsmas.ne.1) then
+ write(nfecra,1067) iilagr, ltsdyn, ltsthe, ltsmas
+ iok = iok + 1
+ endif
+else
+ ltsdyn = 0
+ ltsmas = 0
+ ltsthe = 0
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+! ISTALA SEUIL IDSTNT NSTIST NVLSTS
+
+if (istala.lt.0 .or. istala.gt.1) then
+ write(nfecra,1070) istala
+ iok = iok + 1
+endif
+
+if (istala.eq.1) then
+ if (seuil.lt.0.d0) then
+ write(nfecra,1071) seuil
+ iok = iok + 1
+ endif
+ if (idstnt.lt.1) then
+ write(nfecra,1072) idstnt
+ iok = iok + 1
+ endif
+ if (isttio.eq.1) then
+ if (nstist.lt.idstnt) then
+ write(nfecra,1073) idstnt, nstist
+ iok = iok + 1
+ endif
+ endif
+ if (nvlsts.lt.0 .or. nvlsts.gt.nussta) then
+ write(nfecra,1074) nussta, nvlsts
+ iok = iok + 1
+ endif
+ if ( nbclst .lt. 0 .or. nbclst.gt. nclstm ) then
+ write(nfecra,1075) nclstm,nbclst
+ iok = iok + 1
+ endif
+
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+if (istala.eq.0) then
+ isuist = 0
+ seuil = 0.d0
+ idstnt = 0
+ nstist = 0
+endif
+
+! INJCON
+
+if (injcon.lt.0 .or. injcon.gt.1) then
+ write(nfecra,1080) injcon
+ iok = iok + 1
+endif
+
+! IROULE
+
+if (iroule.lt.0 .or. iroule.gt.2) then
+ write(nfecra,1090) iroule
+ iok = iok + 1
+endif
+
+! NORDRE
+
+if (nordre.ne.1 .and. nordre.ne.2) then
+ write(nfecra,2000) nordre
+ iok = iok + 1
+endif
+
+! IDISTU
+
+if (idistu.lt.0 .or. idistu.gt.1) then
+ write(nfecra,2010) idistu
+ iok = iok + 1
+endif
+
+ii = ilphas
+if (idistu.eq.1 .and. itytur(ii).ne.2 .and. itytur(ii).ne.3 &
+ .and. iturb(ii).ne.50 .and. iturb(ii).ne.60 ) then
+ write(nfecra,2011) iilagr, idistu, ii, iturb(ii)
+ iok = iok + 1
+else if (idistu.eq.0 .and. iturb(ii).ne.0 .and. &
+ itytur(ii).ne.2 .and. itytur(ii).ne.3 &
+ .and. iturb(ii).ne.50 .and. iturb(ii).ne.60) then
+ write(nfecra,2012) iilagr, idistu, ii, iturb(ii)
+ iok = iok + 1
+endif
+
+! IDISTU
+
+if (idiffl.lt.0 .or. idiffl.gt.1) then
+ write(nfecra,2013) idiffl
+ iok = iok + 1
+endif
+
+! MODCPL IDIRLA
+
+if (modcpl.lt.0) then
+ write(nfecra,2014) modcpl
+ iok = iok + 1
+endif
+if (modcpl.gt.0) then
+ if (modcpl.lt.idstnt) then
+ write(nfecra,2015) modcpl, idstnt
+ iok = iok + 1
+ endif
+ if (istala.eq.0) then
+ write(nfecra,2018) modcpl, istala
+ iok = iok + 1
+ endif
+ if (idirla.ne.1 .and. idirla.ne.2 .and. idirla.ne.3) then
+ write(nfecra,2016) idirla
+ iok = iok + 1
+ endif
+endif
+
+! ILAPOI
+
+if (ilapoi.lt.0 .or. ilapoi.gt.1) then
+ write(nfecra,2017) ilapoi
+ iok = iok + 1
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+! IENSI1 IENSI2
+
+if (iensi1.lt.0 .or. iensi1.gt.1) then
+ write(nfecra,2030) iensi1
+ iok = iok + 1
+endif
+if (iensi2.lt.0 .or. iensi2.gt.1) then
+ write(nfecra,2031) iensi2
+ iok = iok + 1
+endif
+
+! NBVIS NVISLA
+
+if (iensi1.eq.1 .or. iensi2.eq.1) then
+ if (nbvis.gt.nbpmax .or. nbvis.gt.nliste .or. nbvis.lt.0) then
+ write(nfecra,2032) nbpmax, nliste, nbvis
+ iok = iok + 1
+ endif
+ if (nvisla.le.0 ) then
+ write(nfecra,2033) nvisla
+ iok = iok + 1
+ endif
+
+! IVISV1 IVISV2 IVISTP IVISDM IVISTE
+
+ if (ivisv1.lt.0 .or. ivisv1.gt.1) then
+ write(nfecra,2040) ivisv1
+ iok = iok + 1
+ endif
+ if (ivisv2.lt.0 .or. ivisv2.gt.1) then
+ write(nfecra,2041) ivisv2
+ iok = iok + 1
+ endif
+ if (ivistp.lt.0 .or. ivistp.gt.1) then
+ write(nfecra,2042) ivistp
+ iok = iok + 1
+ endif
+ if (ivisdm.lt.0 .or. ivisdm.gt.1) then
+ write(nfecra,2043) ivisdm
+ iok = iok + 1
+ endif
+ if (iphyla.eq.1 .and. itpvar.eq.1) then
+ if (iviste.lt.0 .or. iviste.gt.1) then
+ write(nfecra,2044) iviste
+ iok = iok + 1
+ endif
+ else
+ iviste = 0
+ endif
+
+! IVISHP IVISDK IVISCH IVISCK
+
+ if (iphyla.eq.2) then
+ if (ivishp.lt.0 .or. ivishp.gt.1) then
+ write(nfecra,2045) ivishp
+ iok = iok + 1
+ endif
+ if (ivisdk.lt.0 .or. ivisdk.gt.1) then
+ write(nfecra,2046) ivisdk
+ iok = iok + 1
+ endif
+ if (ivisch.lt.0 .or. ivisch.gt.1) then
+ write(nfecra,2047) ivisch
+ iok = iok + 1
+ endif
+ if (ivisck.lt.0 .or. ivisck.gt.1) then
+ write(nfecra,2048) ivisck
+ iok = iok + 1
+ endif
+ else
+ ivishp = 0
+ ivisdk = 0
+ ivisch = 0
+ ivisck = 0
+ endif
+
+endif
+
+! IENSI3 NSTBOR
+
+if (iensi3.lt.0 .or. iensi3.gt.1) then
+ write(nfecra,2050) iensi3
+ iok = iok + 1
+endif
+if (iensi3.eq.1 .and. isttio.eq.1) then
+ if (nstbor.lt.1) then
+ write(nfecra,2057) nstbor
+ iok = iok + 1
+ endif
+else
+ nstbor = 1
+endif
+if (iensi3.eq.1) then
+ if (seuilf.lt.0.d0) then
+ write(nfecra,2058) seuilf
+ iok = iok + 1
+ endif
+else
+ seuilf = 0.d0
+endif
+
+! INBRBD IFLMBD IANGBD IVITBD IENCBD NUSBOR
+
+if (iensi3.eq.1) then
+
+ if (iphyla.eq.2 .and. iencra.eq.1) then
+ if (iencbd.lt.0 .or. iencbd.gt.1) then
+ write(nfecra,2051)
+ iok = iok + 1
+ endif
+ else
+ iencbd = 0
+ endif
+
+ if (inbrbd.lt.0 .or. inbrbd.gt.1) then
+ write(nfecra,2052) inbrbd
+ iok = iok + 1
+ endif
+ if (iflmbd.lt.0 .or. iflmbd.gt.1) then
+ write(nfecra,2053) iflmbd
+ iok = iok + 1
+ endif
+ if (iangbd.lt.0 .or. iangbd.gt.1) then
+ write(nfecra,2054) iangbd
+ iok = iok + 1
+ endif
+ if (ivitbd.lt.0 .or. ivitbd.gt.1) then
+ write(nfecra,2055) ivitbd
+ iok = iok + 1
+ endif
+ if (nusbor.lt.0 .or. nusbor.gt.nusbrd) then
+ write(nfecra,2056) nusbrd, nusbor
+ iok = iok + 1
+ endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+ irf = 0
+
+ if (inbrbd.eq.1) then
+ irf = irf + 1
+ if (imoybr(irf).eq.2) then
+ write(nfecra,2060) inbrbd, imoybr(irf)
+ endif
+ endif
+ if (iflmbd.eq.1) then
+ irf = irf + 1
+ if (imoybr(irf).eq.2 .and. inbrbd.eq.0) then
+ iok = iok + 1
+ WRITE(NFECRA,2061) NOMBRD(IRF), 'IFLMBD', IFLMBD, &
+ imoybr(irf), inbrbd
+ endif
+ endif
+ if (iangbd.eq.1) then
+ irf = irf + 1
+ if (imoybr(irf).eq.2 .and. inbrbd.eq.0) then
+ iok = iok + 1
+ WRITE(NFECRA,2061) NOMBRD(IRF), 'IANGBD', IANGBD, &
+ imoybr(irf), inbrbd
+ endif
+ endif
+ if (ivitbd.eq.1) then
+ irf = irf + 1
+ if (imoybr(irf).eq.2 .and. inbrbd.eq.0) then
+ iok = iok + 1
+ WRITE(NFECRA,2061) NOMBRD(IRF), 'IVITBD', IVITBD, &
+ imoybr(irf), inbrbd
+ endif
+ endif
+ if (iphyla.eq.2 .and. iencra.eq.1 .and. iencbd.eq.1) then
+ irf = irf + 1
+ if (imoybr(irf).eq.2 .and. inbrbd.eq.0) then
+ iok = iok + 1
+ WRITE(NFECRA,2061) NOMBRD(IRF), 'IENCBD', IENCBD, &
+ imoybr(irf), inbrbd
+ endif
+ endif
+ if (nusbor.gt.0) then
+ do ii = 1,nusbor
+ irf = irf + 1
+ if (imoybr(irf).eq.2 .and. inbrbd.eq.0) then
+ iok = iok + 1
+ write(nfecra,2062) nombrd(irf), ii, imoybr(irf), inbrbd
+ endif
+ enddo
+ endif
+
+ do ii = 1, irf
+ if (imoybr(ii).ne.0 .and. &
+ imoybr(ii).ne.1 .and. imoybr(ii).ne.2) then
+ iok = iok + 1
+ write(nfecra,2063) imoybr(irf), nombrd(irf)
+ endif
+ enddo
+
+endif
+
+if (iok.ne.0) call csexit (1)
+ !==========
+
+!===============================================================================
+! 3. INITIALISATIONS DES VARIABLES EN COMMON
+
+! ATTENTION :
+! ^^^^^^^^^^^
+
+! CES INITIALISATIONS NE DOIVENT ETRE MODIFIEES PAR L'UTILISATEUR
+
+!===============================================================================
+
+
+
+! 3.1 GENERALITES (D'AUTRES INITIALISATIONS SONT FAITES DANS LAGLEC)
+
+
+! NOMBRE DE PASSAGES ABSOLUS DANS LE MODULE LAGRANGIEN
+
+iplas = 0
+
+! NOMBRE DE PASSAGES RELATIFS DANS LE MODULE LAGRANGIEN
+
+iplar = 0
+
+! PAS DE TEMPS LAGRANGIEN (LAGUNE) : Par defaut le pas de temps
+! de reference de la phase continue
+dtp = dtref
+
+! TEMPS COURANT PHYSIQUE LAGRANGIEN
+
+ttclag = 0.d0
+
+! INDICATEUR D'ERREUR (LAGCEL)
+
+ierr = 0
+
+! NBPART/DNBPAR : NOMBRE DE PARTICULES PRESENTES DANS LE DOMAINE
+! DE CALCUL A CHAQUE ITERATION
+
+nbpart = 0
+dnbpar = 0.d0
+
+! NBPERR/DNBPER : NOMBRE DE PARTICULES ELIMINES EN ERREUR
+
+nbperr = 0
+dnbper = 0.d0
+
+! NBPERT : NOMBRE DE PARTICULES ELIMINEES EN ERREUR DANS
+! LE CALCUL DEPUIS LE DEBUT SUITE COMPRISE
+
+nbpert = 0
+
+! NBPTOT : NOMBRE DE PARTICULES DU CALCUL (SUITES COMPRISES)
+
+nbptot = 0
+
+! NBPOUT/DNBPOU : Contient les particules sorties de facon normale,
+! plus les particules sorties en erreur de reperage.
+
+nbpout = 0
+dnbpou = 0.d0
+
+! NDEPOT : Nombre de particules deposees definitivement
+! dont on garde une trace en memoire pour le
+! post-processing en mode deplacement.
+
+ndepot = 0
+
+! NPCLON/DNPCLO : NOMBRE DE NOUVELLES PARTICULES PAR CLONNAGE
+! NPKILL/DNPCSU : NOMBRE DE PARTICULES VICTIMES DE LA ROULETTE RUSSE
+! NPCSUP/DNPKIL : NOMBRE DE PARTICULES QUI ON SUBI LE CLONNAGE
+
+npclon = 0
+dnpclo = 0.d0
+
+npcsup = 0
+dnpcsu = 0.d0
+
+npkill = 0
+dnpkil = 0.d0
+
+! NPENCR/DNPENC : nombre de grains de charbon "encrasses"
+
+npencr = 0
+dnpenc = 0.d0
+
+
+! CONDITIONS AUX LIMITES
+
+do ii = 1,nflagm
+ ilflag(ii) = 0
+ iusncl(ii) = 0
+ iusclb(ii) = 0
+ iusmoy(ii) = 0
+ deblag(ii) = 0
+enddo
+do i1 = 1,ndlaim
+ do i2 = 1,nflagm
+ do i3 = 1,nclagm
+ iuslag(i3,i2,i1) = 0
+ enddo
+ enddo
+enddo
+do i1 = 1,ndlagm
+ do i2 = 1,nflagm
+ do i3 = 1,nclagm
+ ruslag(i3,i2,i1) = 0
+ enddo
+ enddo
+enddo
+
+
+! STATISTIQUES VOLUMIQUES
+
+! Nombre de pas de temps DEPUIS LE DEBUT DU CALCUL STATIONNAIRES
+! des stats
+
+npst = 0
+
+! Nombre de pas de temps total des stats depuis le debut
+! du calcul, partie instationnaire comprise
+
+npstt = 0
+
+! Temps physique des stats
+
+tstat = 0.d0
+
+! STATISTIQUES AUX FRONTIERES
+
+! Nombre de pas de temps DEPUIS LE DEBUT DU CALCUL STATIONNAIRES
+! des stats aux frontieres
+
+npstf = 0
+
+! Nombre de pas de temps total des stats aux frontieres
+! depuis le debut du calcul, partie instationnaire comprise
+
+npstft = 0
+
+! Temps physique des stats aux frontieres
+
+tstatp = 0.d0
+
+! COUPLAGE RETOUR
+
+! Nombre de pas de temps DEPUIS LE DEBUT DU CALCUL STATIONNAIRES
+! des termes sources pour le couplage retour
+
+npts = 0
+
+! Initialisation du sous-pas
+
+nor = 0
+
+! NOMBRE D'ENREGISTREMENT POUR LE POST DEPLACEMENT (ENSWAF)
+
+itlag = 0
+
+! TEMPS PHYSIQUE LAGRANGIEN POUR LE POST (ENSWAF)
+
+do ii = 1,9999
+ timlag(ii) = 0.d0
+enddo
+
+! FINALISATION DE LA LISTE DE PARTICULES A VISUALISER
+
+do ii = nbvis+1, nliste
+ liste (ii) = -1
+enddo
+
+! les trous, les repetitions dans le tableau LISTE seront
+! suprimes, et les numeros seront ranges par ordre croissant.
+
+call lagtri
+!==========
+
+! ------------------------------------------------
+! 3.2 DIMENSIONS DES TABLEAUX LIEES AUX PARTICULES
+! ------------------------------------------------
+
+!--> NOMBRE MINIMAL DE VARIABLES LIEES AUX PARTICULES
+
+! NVP : Variables sur les particules avec equation (ETTP et ETTPA)
+! NVEP : Variables d'etat (reels) sur les particules (TEPA)
+! NIVEP : Variables d'etat (entiers) sur les particules (ITEPA)
+
+nvp = 11
+nvep = 2
+nivep = 1
+
+if (nbclst.gt.0) then
+
+! --> Statistique par classe :
+! 1 VARIABLE D'ETAT ENTIERE SUPPLEMENTAIRE : Numero de la
+! classe statique a laquelle appartient la particule
+
+ nivep = nivep +1
+
+endif
+
+
+if (iphyla.eq.1) then
+
+! --> EQUATION SUR LA TEMPERATURE :
+! 3 VARIABLES SUPPLEMENTAIRES Tp, Tf, Cp dans ETTP et ETTPA
+
+ if (itpvar.eq.1) nvp = nvp + 3
+
+! --> EQUATION SUR LA TEMPERATURE ET RAYONNEMENT : EMISSIVITE
+
+ if (itpvar.eq.1 .and. iirayo.gt.0) nvep = nvep + 1
+
+else if (iphyla.eq.2) then
+
+! --> CHARBON :
+
+! ETTP et ETTPA :
+! -------------
+! 5 VARIABLES SUPPLEMENTAIRES Tp, Tf, Mch, Mck, Cp
+ nvp = nvp + 5
+
+! TEPA :
+! ----
+! 3 VARIABLES D'ETATS REELLES SUPPLEMENTAIRES : Dck, D0P, R0P
+
+ nvep = nvep + 3
+
+! ITEPA :
+! -----
+! 1 VARIABLE D'ETAT ENTIERE SUPPLEMENTAIRE : Numero du charbon
+ nivep = nivep + 1
+
+endif
+
+!--> VARIABLES UTILISATEURS SUPPLEMENTAIRES : NVLS
+
+if (nvls.gt.0) nvp = nvp + nvls
+
+!--> NVP1 represente le nombre de variables sur les particules en
+! enlevant position, vitesse particule et vitesse fluides (TSVAR)
+
+nvp1 = nvp - 9
+
+
+! 3.3 DEFINITION DES POINTEURS SUR LES VARIABLES LIEES AUX PARTICULES
+
+
+! 3.3.1 TABLEAU ETTP
+! ~~~~~~~~~~~~~~~~~~
+
+! Attention il faut que
+! JMP, JDP, JXP, JYP, JZP, JUP, JVP, JWP, JUF, JVF, JWF
+! soient les derniers pointeurs pour les tableaux ETTP et ETTPA
+! a cause du remplissage et de la dimension du tableau
+! TSVAR(NBPMAX,NVP1) et de son mode de lecture/ecriture
+! (cf. LAGITG).
+
+! JXP,JYP,JZP : COORDONNES DE LA POSITION DE LA PARTICULE NPT
+! JUP,JVP,JWP : COMPOSANTES DE LA VITESSE ABSOLUE
+! JUF,JVF,JWF : COMPOSANTES DE LA VITESSE DU FLUIDE VU
+
+! JMP,JDP : MASSE, DIAMETRE
+! JTP,JTF,JCP : TEMPERATURE PARTICULE ET FLUIDE ET CHALEUR SPECIFIQUE
+! JVLS(NUSVAR) : VARIABLE SUPPLEMENTAIRES
+
+! Charbon
+! -------
+! JHP : Temperature en degres Celsius grain de charbon
+! JMCH : MASSE DE CHARBON REACTIF
+! JMCK : MASSE DE COKE
+
+jtp = 0
+jtf = 0
+jcp = 0
+jhp = 0
+jmch = 0
+jmck = 0
+do ii = 1,nusvar
+ jvls(ii) = 0
+enddo
+
+irf = 0
+
+if (iphyla.eq.1) then
+
+ if (itpvar.eq.1) then
+ jtp = irf + 1
+ jtf = jtp + 1
+ jcp = jtf + 1
+ irf = jcp
+ endif
+
+else if (iphyla.eq.2) then
+
+ jhp = irf + 1
+ jtf = jhp + 1
+ jmch = jtf + 1
+ jmck = jmch + 1
+ jcp = jmck + 1
+ irf = jcp
+
+endif
+
+if (nvls.gt.0) then
+ do ii = 1,nvls
+ irf = irf + 1
+ jvls(ii) = irf
+ enddo
+ irf = jvls(nvls)
+endif
+
+jmp = irf + 1
+jdp = jmp + 1
+jxp = jdp + 1
+jyp = jxp + 1
+jzp = jyp + 1
+jup = jzp + 1
+jvp = jup + 1
+jwp = jvp + 1
+juf = jwp + 1
+jvf = juf + 1
+jwf = jvf + 1
+irf = jwf
+
+if (irf.gt.nvp) then
+ write(nfecra,3004) irf, nvp
+ call csexit(1)
+endif
+
+! 3.3.2 TABLEAU TEPA
+! ~~~~~~~~~~~~~~~~~~
+
+! JRTSP : TEMPS DE SEJOUR DES PARTICULES
+! JRPOI : POIDS DES PARTICULES
+! JREPS : EMISSIVITE DES PARTICULES
+
+! Charbon
+! -------
+! JRDCK : DIAMETRE DU COEUR RETRECISSANT
+! JRD0P : DIAMETRE INITIAL DES PARTICULES
+! JRR0P : MASSE VOLUMIQUE INITIALE DES PARTICULES
+
+jreps = 0
+jrdck = 0
+jrr0p = 0
+jrr0p = 0
+
+jrtsp = 1
+jrpoi = 2
+irf = jrpoi
+
+if (iphyla.eq.1 .and. itpvar.eq.1 .and. iirayo.gt.0) then
+ jreps = irf + 1
+ irf = jreps
+endif
+
+if (iphyla.eq.2) then
+ jrdck = irf + 1
+ jrd0p = jrdck + 1
+ jrr0p = jrd0p + 1
+ irf = jrr0p
+endif
+
+if (irf.ne.nvep) then
+ write(nfecra,3005) irf, nvep
+ call csexit(1)
+endif
+
+! 3.3.3 TABLEAU ITEPA
+! ~~~~~~~~~~~~~~~~~~~
+
+! JISOR : MAILLE D'ARRIVEE
+
+! Statistique par classe
+! ----------------------
+
+! JCLST : classe (statique) a laquelle la particule appartient
+
+! Charbon
+! -------
+! JINCH : NUMERO DU CHARBON DE LA PARTICULE
+
+jinch = 0
+
+jisor = 1
+irf = jisor
+
+if (nbclst .gt. 0) then
+ jclst = irf + 1
+ irf = jclst
+endif
+
+if (iphyla.eq.2) then
+ jinch = irf + 1
+ irf = jinch
+endif
+
+if (irf.ne.nivep) then
+ write(nfecra,3006) irf, nivep
+ call csexit(1)
+endif
+
+
+! 3.4 DEFINITION DES POINTEURS LIES A L'INJECTION DES PARTICULES
+
+
+! 3.4.1 TABLEAU RUSLAG (DONNEES D'ENTREE)
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! IUNO : Norme de la vitesse
+! IUPT : U par classe et zones
+! IVPT : V par classe et zones
+! IWPT : W par classe et zones
+! IDEBT : Debit
+! IPOIT : Poids de la particule
+! IDPT : Diametre
+! IVDPT : Ecart-type du diametre
+! ITPT : Temperature
+! ICPT : Cp
+! IEPSI : Emissivite
+! IROPT : Masse volumique
+! IHPT : Temperature
+! IMCHT : Masse de charbon reactif
+! IMCKT : Masse de coke
+! IDCKT : Diametre du coeur retrecissant
+
+iuno = 1
+iupt = iuno + 1
+ivpt = iupt + 1
+iwpt = ivpt + 1
+itpt = iwpt + 1
+idpt = itpt + 1
+ivdpt = idpt + 1
+iropt = ivdpt + 1
+icpt = iropt + 1
+iepsi = icpt + 1
+ipoit = iepsi + 1
+idebt = ipoit + 1
+irf = idebt
+
+! Specifique Charbon
+
+ihpt = irf + 1
+imcht = ihpt + 1
+imckt = imcht + 1
+irf = imckt
+
+if (irf.gt.ndlagm) then
+ write(nfecra,3001) irf, ndlagm
+ call csexit(1)
+endif
+
+! 3.4.2 TABLEAU IUSLAG (DONNEES D'ENTREE)
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! IJNBP : nbr de part par classe et zones frontieres
+! IJFRE : frequence d'injection
+! ICLST : numero de groupe auquel appartient la particule
+! (uniquement si on souhaite des statistiques par groupe)
+! IJUVW : type de condition vitesse
+! IJPRTP : profil de temperature pour les particules
+! IJPRPD : profil de poids statistiques
+! IJPRDP : profil de diametre pour les particules
+! INUCHL : numero du charbon de la particule (si IPHYLA=2)
+
+ijnbp = 1
+ijfre = ijnbp + 1
+iclst = ijfre + 1
+ijuvw = iclst + 1
+ijprtp = ijuvw + 1
+ijprdp = ijprtp + 1
+ijprpd = ijprdp + 1
+irf = ijprpd
+
+! Specifique Charbon
+
+inuchl = irf + 1
+irf = inuchl
+
+if (irf.gt.ndlaim) then
+ write(nfecra,3002) irf, ndlaim
+ call csexit(1)
+endif
+
+! -----------------------------------------------
+! 3.5 DIEMSIONS DU TABLEAU LIEES AUX STATISTIQUES
+! -----------------------------------------------
+
+! NVLSTA : NOMBRE DE VARIABLES LIEES AUX STATISTIQUES
+! DIMENSION DU TABLEAU STATIS
+! NVLSTS : VARIABLES LIEES AUX STATISTIQUES SUPPLEMENTAIRES
+
+if (istala.eq.0) then
+
+ nvlsta = 0
+
+else if(istala.eq.1) then
+
+ nvlsta = 6 + nvlsts
+
+ if (iphyla .eq. 1) then
+
+ if (idpvar.eq.1) nvlsta = nvlsta + 1
+
+ if (impvar.eq.1) nvlsta = nvlsta + 1
+
+ if (itpvar.eq.1) nvlsta = nvlsta + 1
+
+ else if (iphyla .eq. 2) then
+
+ nvlsta = nvlsta + 4
+
+ if (iencra.eq.1) then
+ nvlsta = nvlsta + 1
+ endif
+
+ endif
+
+endif
+
+if(nvlsta.gt.nvplmx) then
+ write(nfecra,3003) nvlsta, nvplmx
+ call csexit(1)
+endif
+
+! --------------------------------------------------
+! 3.6 DEFINITION DES POINTEURS LIES AUX STATISTIQUES
+! --------------------------------------------------
+
+! ILVX,ILVY,ILVZ : Vitesse
+! ILFV : Concentrations volumiques
+! ILPD : Somme des poids statistiques
+
+! ILTP : Temperature
+! ILDP : Diametre
+! ILMP : Masse
+
+! ILHP : Temperature
+! ILMCH : Masse de charbon reactif
+! ILMCK : Masse de coke
+! ILMDK : Diametre du coeur retrecissant
+
+! ILVU(NUSSTA) : Statistiques utilisateur
+
+ip = 0
+ilvx = ip + 1
+ilvy = ilvx + 1
+ilvz = ilvy + 1
+ilfv = ilvz + 1
+ilts = ilfv + 1
+irf = ilts
+
+iltp = 0
+ildp = 0
+ilmp = 0
+ilhp = 0
+ilmch = 0
+ilmck = 0
+ildck = 0
+
+do ii = 1,nussta
+ ilvu(ii) = 0
+enddo
+
+if (iphyla.eq.1) then
+
+ if (itpvar.eq.1) then
+ iltp = irf + 1
+ irf = iltp
+ endif
+
+ if (idpvar.eq.1) then
+ ildp = irf + 1
+ irf = ildp
+ endif
+
+ if (impvar.eq.1) then
+ ilmp = irf + 1
+ irf = ilmp
+ endif
+
+else if (iphyla.eq.2) then
+
+ ilhp = irf + 1
+ ilmch = ilhp + 1
+ ilmck = ilmch + 1
+ ildck = ilmck + 1
+ irf = ildck
+
+endif
+
+if (nvlsts.gt.0) then
+ do ii = 1,nvlsts
+ ilvu(ii) = irf + ii
+ enddo
+ irf = irf + nvlsts
+endif
+
+ilpd = irf + 1
+
+
+! 3.7 DEFINITION DES POINTEURS LIES AUX STATISTIQUES AUX FRONTIERES
+
+
+! INBRBD : NOMBRE D'INTERACTIONS PARTICULES/FRONTIERES
+! IFLMBD : FLUX DE MASSE PARTICULAIRE
+! IANGBD : ANGLE VITESSE
+! IVITBD : VITESSE DE LA PARTICULE
+! IENCBD : MASSE DE GRAINS DE CHARBON ENCRASSES
+! NUSBOR : INFORMATIONS UTILISATEUR SUPPLEMENTAIRES
+! NVISBR : NOMBRE TOTAL D'INTERACTIONS A ENREGISTRER
+
+if (iensi3.eq.1) then
+
+ irf = 0
+
+ if (inbrbd.eq.1) then
+ irf = irf + 1
+ inbr = irf
+ endif
+
+ if (iflmbd.eq.1) then
+ irf = irf + 1
+ iflm = irf
+ endif
+
+ if (iangbd.eq.1) then
+ irf = irf + 1
+ iang = irf
+ endif
+
+ if (ivitbd.eq.1) then
+ irf = irf + 1
+ ivit = irf
+ endif
+
+ if (iphyla.eq.2 .and. iencra.eq.1 .and. iencbd.eq.1) then
+ irf = irf + 1
+ ienc = irf
+ endif
+
+ if (nusbor.gt.0) then
+ do ii = 1,nusbor
+ irf = irf + 1
+ iusb(ii) = irf
+ enddo
+ endif
+
+ nvisbr = irf
+
+else
+
+ nvisbr = 0
+
+endif
+
+
+! 3.8 DEFINITION DES POINTEURS LIES AUX TERMES SOURCES LAGRANGIEN
+! POUR COUPLAGE RETOUR
+
+
+! Couplage-retour uniquement vers la phase continue numero ILPHAS
+
+iphas = ilphas
+
+! Nombre de termes sources de couplage-retour
+
+ntersl = 0
+
+irf = 0
+itsvx = 0
+itsvy = 0
+itsvz = 0
+itsli = 0
+itske = 0
+itsr11 = 0
+itsr12 = 0
+itsr13 = 0
+itsr22 = 0
+itsr23 = 0
+itsr33 = 0
+itsmas = 0
+itste = 0
+itsti = 0
+do icha = 1,ncharm2
+ itsmv1(icha) = 0
+ itsmv2(icha) = 0
+enddo
+itsco = 0
+itsfp4 = 0
+
+! Dynamique : Vitesse + Turbulence
+
+if (ltsdyn.eq.1) then
+
+ ntersl = ntersl + 4
+
+ itsvx = irf + 1
+ itsvy = itsvx + 1
+ itsvz = itsvy + 1
+ itsli = itsvz + 1
+ irf = itsli
+
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+! K-eps, v2f et k-omega
+ ntersl = ntersl + 1
+
+ itske = irf + 1
+ irf = itske
+
+ else if (itytur(iphas).eq.3) then
+! RIJ
+ ntersl = ntersl + 6
+
+ itsr11 = irf + 1
+ itsr12 = itsr11 + 1
+ itsr13 = itsr12 + 1
+ itsr22 = itsr13 + 1
+ itsr23 = itsr22 + 1
+ itsr33 = itsr23 + 1
+ irf = itsr33
+ else
+ write(nfecra,3010) iilagr, ltsdyn, iphas, iturb(iphas)
+ call csexit (1)
+ !==========
+ endif
+
+endif
+
+! Masse
+
+if (ltsmas.eq.1) then
+
+ ntersl = ntersl + 1
+
+ itsmas = irf + 1
+ irf = itsmas
+
+endif
+
+! Thermique
+
+if (ltsthe.eq.1) then
+
+ if (iphyla.eq.1) then
+
+! Temperature
+
+ if (itpvar.eq.1) then
+
+ ntersl = ntersl + 2
+
+ itste = irf + 1
+ itsti = itste + 1
+ irf = itsti
+
+ endif
+
+! Charbon
+
+ else if (iphyla.eq.2) then
+
+ ntersl = ntersl + 4 + 2*ncharb
+
+ itste = irf + 1
+ itsti = itste + 1
+
+ do icha = 1,ncharb
+ itsmv1(icha) = itsti + icha
+ enddo
+
+ do icha = 1,ncharb
+ itsmv2(icha) = itsmv1(ncharb) + icha
+ enddo
+
+ itsco = itsmv2(ncharb) + 1
+ itsfp4 = itsco + 1
+ irf = itsfp4
+
+ endif
+
+endif
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE MODULE LAGRANGIEN A UNE VALEUR ',/,&
+'@ NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IILAGR DEVRAIT ETRE UN ENTIER EGAL A 0, 1, 2 OU 3. ',/,&
+'@ IL VAUT ICI IILAGR = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE MODULE LAGRANGIEN IILAGR ET ',/,&
+'@ L''INDICATEUR DE SUITE ONT DES VALEURS INCOMPATIBLES ',/,&
+'@ (LAGOPT). ',/,&
+'@ ',/,&
+'@ IILAGR = ', I10 ,/,&
+'@ ISUITE = ', I10 ,/,&
+'@ ',/,&
+'@ Le module lagrangien est active en mode champs figes, ',/,&
+'@ alors que le calcul de la phase continue n''est pas ',/,&
+'@ une suite. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR dans la subroutine USLAG1 et ',/,&
+'@ verifier la valeur de ISUITE dans la subroutine USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1013 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA PHYSIQUE PARTICULIERE COMBUTION CHARBON PULVERISE ',/,&
+'@ COUPLE AU TRANSPORT LAGRANGIEN DES PARTICULES ',/,&
+'@ DE CHARBON EST ACTIVEE (USPPMO), ALORS QUE LE COUPLAGE',/,&
+'@ RETOUR DE LA PHASE DISPERSEE SUR LE PHASE CONTINUE ',/,&
+'@ N''EST PAS ENCLENCHE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IILAGR = ', I10 ,/,&
+'@ IPPMOD(ICPL3C) = ', I10 ,/,&
+'@ ',/,&
+'@ Le module lagrangien doit etre active en mode couplage ',/,&
+'@ retour pour etre couple avec la combustion d''une ',/,&
+'@ flamme de charbon pulverise en phase continue. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR dans la subroutine USLAG1 et ',/,&
+'@ verifier la valeur de IPPMOD dans la subroutine USPPMO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1014 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE MODULE LAGRANGIEN IILAGR ET ',/,&
+'@ LE CHOIX DU TYPE DE PAS DE TEMPS IDTVAR ',/,&
+'@ ONT DES VALEURS INCOMPATIBLES (LAGOPT). ',/,&
+'@ ',/,&
+'@ IILAGR = ', I10 ,/,&
+'@ IDTVAR = ', I10 ,/,&
+'@ ',/,&
+'@ Le module lagrangien ne peut pas etre active avec un pas ',/,&
+'@ de temps variable en temps et en espace. Seuls les pas ',/,&
+'@ de temps uniforme et constant, et variable en temps et ',/,&
+'@ uniforme en espace sont possibles. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR dans la subroutine USLAG1 et ',/,&
+'@ verifier la valeur de IDTVAR dans la subroutine USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE SUITE DU MODULE LAGRANGIEN A UNE ',/,&
+'@ VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ ISUILA DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ISUILA = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ALERTE A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ (LAGOPT). ',/,&
+'@ ',/,&
+'@ Le module lagrangien est active en suite de calcul, ',/,&
+'@ alors que le calcul de la phase continue n''est pas ',/,&
+'@ une suite. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ISUILA dans la subroutine USLAG1. ',/,&
+'@ Verifier la valeur de ISUITE dans la subroutine USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1022 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE SUITE DE CALCUL SUR LES STATISTIQUES ',/,&
+'@ VOLUMIQUE ET AUX FRONTIERES, AINSI QUE SUR LES ',/,&
+'@ TERMES SOURCES DE COUPLAGES RETOUR ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ ISUIST DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ISUIST = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ISUIST dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DES MODELES PHYSIQUES LIES AUX PARTICULES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IPHYLA DEVRAIT ETRE UN ENTIER EGAL A 0 1 OU 2 ',/,&
+'@ IL VAUT ICI IPHYLA = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IPHYLA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''EQUATION DU DIAMETRE DES ',/,&
+'@ PARTICULES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IDPVAR DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IDPVAR = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IDPVAR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1032 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''EQUATION DE LA TEMPERATURE DES ',/,&
+'@ PARTICULES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ ITPVAR DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ITPVAR = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ITPVAR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1033 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''EQUATION DE LA MASSE DES ',/,&
+'@ PARTICULES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IMPVAR DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IMPVAR = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IMPVAR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1034 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''EQUATION DE LA TEMPERATURE DES ',/,&
+'@ PARTICULES EST ACTIVE (ITPVAR = ',I10,'),' ,/,&
+'@ ALORS QU''AUCUN SCALAIRE THERMIQUE N''EST DISPONIBLE ',/,&
+'@ POUR LA PHASE CONTINUE IPHAS = ',I10,' (LAGOPT). ',/,&
+'@ ',/,&
+'@ ISCALT DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL 1 ',/,&
+'@ IL VAUT ICI ISCALT(',I10 ,') = ',I10 ,/,&
+'@ ',/,&
+'@ La valeur de ISCALT est renseignee automatiquement ',/,&
+'@ si une physique particuliere est activee dans USPPMO. ',/,&
+'@ ',/,&
+'@ L''utilisateur doit renseigner ISCALT dans USINI1 si ',/,&
+'@ aucune physique particuliere n''est activee dans USPPMO.',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ITPVAR dans la subroutine USLAG1, ',/,&
+'@ verifier la valeur de ISCALT dans la subroutine USINI1 et ',/,&
+'@ verifier la valeur de IPPMOD dans la subroutine USPPMO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1036 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA CHALEUR MASSIQUE D''INITIALISATION DES PARTICULES ',/,&
+'@ DEJA PRESENTE DANS LE DOMAINE DE CALCUL ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ CPPART DEVRAIT ETRE UN REEL STRICTEMENT POSITIF ',/,&
+'@ IL VAUT ICI CPPART = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de CPPART dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1037 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA TEMPERATURE D''INITIALISATION DES PARTICULES ',/,&
+'@ DEJA PRESENTE DANS LE DOMAINE DE CALCUL ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ TPART DEVRAIT ETRE UN REEL SUPERIEUR A ',E14.5 ,/,&
+'@ (EN DEGRES CELSIUS) ',/,&
+'@ IL VAUT ICI TPART = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de TPART dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''ENCRASSEMENT DES PARTICULES ',/,&
+'@ DE CHARBON A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IENCRA DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IENCRA = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IENCRA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''ENCRASSEMENT DES PARTICULES ',/,&
+'@ DE CHARBON EST ACTIVE (IENCRA = ',I10,')' ,/,&
+'@ AVEC UNE VALEUR DE VISCOSITE CRITIQUE ',/,&
+'@ NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ VISREF DEVRAIT ETRE UN REEL STRICTEMENT POSITIF (Pa.s) ',/,&
+'@ IL VAUT ICI VISREF = ', E14.5 ,/,&
+'@ POUR LE CHARBON :' , I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de VISREF dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1042 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''ENCRASSEMENT DES PARTICULES ',/,&
+'@ DE CHARBON EST ACTIVE (IENCRA = ',I10,')' ,/,&
+'@ AVEC UNE VALEUR DE TEMPERATURE SEUIL ',/,&
+'@ NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ TPRENC DEVRAIT ETRE UN REEL SUPERIEUR A ',E14.5 ,/,&
+'@ (EN DEGRES CELSIUS) ',/,&
+'@ IL VAUT ICI TPRENC = ', E14.5 ,/,&
+'@ POUR LE CHARBON :' , I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de TPRENC dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1043 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA PHYSIQUE PARTICULIERE COMBUTION CHARBON PULVERISE ',/,&
+'@ COUPLE AU TRANSPORT LAGRANGIEN DES PARTICULES ',/,&
+'@ DE CHARBON EST ACTIVEE (USPPMO), ALORS QUE L''OPTION ',/,&
+'@ TRANSPORT DE PARTICULE DE CHARBON ',/,&
+'@ N''EST PAS ENCLENCHEE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IPHYLA = ', I10 ,/,&
+'@ IPPMOD(ICPL3C) = ', I10 ,/,&
+'@ ',/,&
+'@ Le module lagrangien doit etre active en mode transport ',/,&
+'@ de particules de charbon pour etre couple avec la ',/,&
+'@ combustion d''une flamme de charbon pulverise en phase ',/,&
+'@ continue. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IPHYLA dans la subroutine USLAG1 et ',/,&
+'@ verifier la valeur de IPPMOD dans la subroutine USPPMO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1044 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE TRANSPORT LAGRANGIEN DE PARTICULES DE CHARBON ',/,&
+'@ EST ACTIVE (LAGOPT), ALORS QU''AUCUNE PHYSIQUE ',/,&
+'@ PARTICULIERE SUR LA COMBUSTION DU CHABON PULVERISE ',/,&
+'@ N''EST PAS ENCLENCHE (USPPMO). ',/,&
+'@ ',/,&
+'@ IPHYLA = ', I10 ,/,&
+'@ IPPMOD(ICPL3C) = ', I10 ,/,&
+'@ IPPMOD(ICP3PL) = ', I10 ,/,&
+'@ ',/,&
+'@ Le transport lagrangien de particule de charbon doit ',/,&
+'@ etre couple avec la combustion d''une flamme de charbon ',/,&
+'@ pulverise en phase continue. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IPHYLA dans la subroutine USLAG1 et ',/,&
+'@ verifier la valeur de IPPMOD dans la subroutine USPPMO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE NOMBRE DE PARTIUCULES A TRAITER ',/,&
+'@ PAR LE MODULE LAGRANGIEN A UNE VALEUR ',/,&
+'@ NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NBPMAX DEVRAIT ETRE UN ENTIER STRICTEMENT POSITIF ',/,&
+'@ IL VAUT ICI NBPMAX = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NBPMAX dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE NOMBRE DE VARIABLES ',/,&
+'@ SUPPLEMENTAIRES LIEES AUX PARTICULES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NVLS DEVRAIT ETRE UN ENTIER ENTRE 0 ET ',I10 ,/,&
+'@ IL VAUT ICI NVLS = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NVLS dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1061 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE CARACTERE STATIONNAIRE DE ',/,&
+'@ L''ECOULEMENT DE LA PHASE CONTINUE ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ ISTTIO DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ISTTIO = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ISTTIO dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1062 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE DECLENCHEMENT DU CALCUL ',/,&
+'@ STATIONNAIRE DES STATISTIQUES POUR UN COUPLAGE RETOUR',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NSTITS DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL A 1 ',/,&
+'@ IL VAUT ICI NSTITS = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NSTITS dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1063 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE COUPLAGE RETOUR SUR LA DYNAMIQUE ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ LTSDYN DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI LTSDYN = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de LTSDYN dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1064 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE COUPLAGE RETOUR SUR LA MASSE ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ LTSMAS DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI LTSMAS = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de LTSMAS dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1065 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE COUPLAGE RETOUR SUR LA THERMIQUE ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ LTSTHE DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI LTSTHE = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de LTSTHE dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1066 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE COUPLAGE RETOUR SUR LA DYNAMIQUE ',/,&
+'@ EST ACTIVE (LTSDYN = ',I10,') (LAGOPT), ',/,&
+'@ ALORS QUE LA PHASE PORTEUSE EST CALCULEE AVEC ',/,&
+'@ L''OPTION CHAMP FIGE (ICCVFG = ',I10,') (USINI1). ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de LTSDYN dans la subroutine USLAG1 et ',/,&
+'@ verifier la valeur de ICCVFG dans la subroutine USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1067 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGOPT). ',/,&
+'@ ',/,&
+'@ L''INDICATEUR SUR LE COUPLAGE RETOUR EST ACTIVE ',/,&
+'@ IILAGR = ',I10 ,/,&
+'@ ALORS QU''AUCUN COUPLAGE RETOUR N''EST ENCLENCHE ',/,&
+'@ DYNAMIQUE : LTSDYN = ',I10 ,/,&
+'@ THERMIQUE : LTSTHE = ',I10 ,/,&
+'@ MASSIQUE : LTSMAS = ',I10 ,/,&
+'@ ',/,&
+'@ LES COUPLAGES RETOUR SUR LA THERMIQUE ET SUR LA MASSE ',/,&
+'@ NECESSITENT L''ACTIVATION D''UNE PHYSIQUE ADEQUATE ',/,&
+'@ ASSOCIEE AUX PARTICULES. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR dans la subroutine USLAG1. ',/,&
+'@ Verifier la valeur de IPHYLA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1070 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE LANCEMENT DU CALCUL DES STATISTIQUES',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ ISTALA DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ISTALA = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ISTALA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1071 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE SEUIL POUR LE CALCUL DES STATISTIQUES ',/,&
+'@ VOLUMIQUES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ SEUIL DEVRAIT ETRE UN REEL SUPERIEUR OU EGAL A 0.D0 ',/,&
+'@ IL VAUT ICI SEUIL = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de SEUIL dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1072 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE SEUIL POUR LE CALCUL DES STATISTIQUES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IDSTNT DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL A 1 ',/,&
+'@ IL VAUT ICI IDSTNT = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IDSTNT dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1073 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE CALCUL STATIONNAIRE DES STATISTIQUES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NSTIST DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL ',/,&
+'@ A IDSTNT = ', I10 ,/,&
+'@ IL VAUT ICI NSTIST = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NSTIST dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1074 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE NOMBRE DE VARIABLES ',/,&
+'@ SUPPLEMENTAIRES LIEES AUX STATISTIQUES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NVLSTS DEVRAIT ETRE UN ENTIER ENTRE 0 ET ',I10 ,/,&
+'@ IL VAUT ICI NVLSTS = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NVLSTS dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+1075 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE NOMBRE DE CLASSE DE STATISTIQUE ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NBCLST DEVRAIT ETRE UN ENTIER ENTRE 1 ET ',I10 ,/,&
+'@ IL VAUT ICI NBCLST = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NBCLST dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1080 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''UTILISATION DE L''INJECTION ',/,&
+'@ CONTINUE A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ INJCON DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI INJCON = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de INJCON dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1090 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''UTILISATION DE LA METHODE ',/,&
+'@ DE CLONAGE/FUSION DES PARTICULES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IROULE DEVRAIT ETRE UN ENTIER COMPRIS ENTRE 0 ET 2 ',/,&
+'@ IL VAUT ICI IROULE = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IROULE dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''ORDRE D''INTEGRATION ',/,&
+'@ DES EQUATIONS DIFFERENTIELLES STOCHASTIQUES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NORDRE DEVRAIT ETRE UN ENTIER EGAL A 1 OU 2 ',/,&
+'@ IL VAUT ICI NORDRE = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NORDRE dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LA PRISE EN COMPTE DE LA DISPERSION ',/,&
+'@ TURBULENTE A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IDISTU DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IDISTU = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IDISTU dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE MODULE LAGRANGIEN EST INCOMPATIBLE AVEC LE MODELE ',/,&
+'@ DE TURBULENCE SELECTIONNE (LAGOPT). ',/,&
+'@ ',/,&
+'@ Le module lagrangien a ete active avec IILAGR = ',I10 ,/,&
+'@ et la dispersion turbulente est prise en compte ',/,&
+'@ avec IDISTU = ',I10 ,/,&
+'@ Le modele de turbulence active pour la phase ',I6 ,/,&
+'@ correspond a ITURB = ',I10 ,/,&
+'@ Or, les seuls traitements de la turbulence compatibles ',/,&
+'@ avec le module Lagrangien et la dispersion turbulente ',/,&
+'@ sont k-epsilon et Rij-epsilon, v2f et k-omega ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR et IDISTU dans la subroutine ',/,&
+'@ USLAG1 et verifier la valeur de ITURB dans la subroutine ',/,&
+'@ USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2012 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE MODULE LAGRANGIEN EST INCOMPATIBLE AVEC LE MODELE ',/,&
+'@ DE TURBULENCE SELECTIONNE (LAGOPT). ',/,&
+'@ ',/,&
+'@ Le module lagrangien a ete active avec IILAGR = ',I10 ,/,&
+'@ et la dispersion turbulente n''est pas prise en compte ',/,&
+'@ avec IDISTU = ',I10 ,/,&
+'@ Le modele de turbulence active pour la phase ',I6 ,/,&
+'@ correspond a ITURB = ',I10 ,/,&
+'@ Or, les seuls traitements de la turbulence compatibles ',/,&
+'@ avec le module lagrangien sont : calcul laminaire, ',/,&
+'@ k-epsilon, Rij-epsilon, v2f et k-omega. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR et IDISTU dans la subroutine ',/,&
+'@ USLAG1 et verifier la valeur de ITURB dans la subroutine ',/,&
+'@ USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2013 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LA PRISE EN COMPTE DE LA DIFFUSION ',/,&
+'@ TURBULENTE A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IDIFFL DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IDIFFL = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IDIFFL dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2014 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE CHOIX DU MODELE DE DISPERSION ',/,&
+'@ TURBULENTE A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ MODCPL DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL A 0 ',/,&
+'@ IL VAUT ICI MODCPL = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de MODCPL dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2015 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE CHOIX DU MODELE DE DISPERSION ',/,&
+'@ TURBULENTE EST INCOMPATIBLE AVEC CELUI DU CALCUL ',/,&
+'@ DES STATISTIQUES (LAGOPT). ',/,&
+'@ ',/,&
+'@ LE MODELE COMPLET DE DISPERSION TURBULENTE EST ACTIVE ',/,&
+'@ (MODCPL = ',I10,')' ,/,&
+'@ AVANT LE DEBUT DU CALCUL DES STATISTIQUES ',/,&
+'@ (IDSTNT = ',I10,')' ,/,&
+'@ ',/,&
+'@ Il est necessaire d''avoir calcule des statistiques ',/,&
+'@ pour declencher le modele de dispersion turbulent complet.',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de MODCPL dans la subroutine USLAG1. ',/,&
+'@ Verifier la valeur de IDSTNT dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2016 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE CHOIX DE LA DIRECTION DU MODELE COMPLET ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IDIRLA DEVRAIT ETRE UN ENTIER EGAL A 1, 2 OU 3 ',/,&
+'@ (LA VALEUR 1 POUR UN ECOULEMENT SELON L''AXE X, ',/,&
+'@ LA VALEUR 2 POUR UN ECOULEMENT SELON L''AXE Y, ',/,&
+'@ LA VALEUR 3 POUR UN ECOULEMENT SELON L''AXE Z) ',/,&
+'@ IL VAUT ICI IDIRLA = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IDIRLA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2017 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE RESOLUTION DE L''EQUATION DE POISSON ',/,&
+'@ POUR LES VITESSE MOYENNES ET DE CORRECTION DES ',/,&
+'@ VITESSES INSTANTANNEES DES PARTICULES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ ILAPOI DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI ILAPOI = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de ILAPOI dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2018 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR LE CHOIX DU MODELE DE DISPERSION ',/,&
+'@ TURBULENTE A UNE VALEUR NON COMPATIBLE AVEC ',/,&
+'@ CELUI DE L''ENCLENCHEMENT DES STATISTIQUES (LAGOPT). ',/,&
+'@ ',/,&
+'@ LE MODELE COMPLET DE DISPERSION TURBULENTE EST ACTIVE ',/,&
+'@ (MODCPL = ',I10,')' ,/,&
+'@ AVANT L''ENCLENCHEMENT DU CALCUL DES STATISTIQUES ',/,&
+'@ (ISTALA = ',I10,')' ,/,&
+'@ ',/,&
+'@ Il est necessaire d''activer le calcul des statistiques ',/,&
+'@ pour declencher le modele de dispersion turbulent complet.',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de MODCPL dans la subroutine USLAG1. ',/,&
+'@ Verifier la valeur de ISTALA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING EN MODE TRAJECTOIRES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IENSI1 DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IENSI1 = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IENSI1 dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING EN MODE DEPLACEMENTS ',/,&
+'@ PARTICULAIRES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IENSI2 DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IENSI2 = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IENSI2 dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2032 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE NOMBRE DE PARTICULE A VISUALISER EN POST-PROCESSING ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NBVIS DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL A 0 ',/,&
+'@ INFERIEUR AU NOMBRE MAX DE PARTICULES NBPMAX = ',I10 ,/,&
+'@ INFERIEUR AU PARAMETRE NLISTE = ',I10 ,/,&
+'@ ',/,&
+'@ IL VAUT ICI NBVIS = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NBVIS dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2033 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE LA FREQUENCE D''ACQUISITION DES DONNES ',/,&
+'@ POUR LES SORTIES DE POST-PROCESSING EN ',/,&
+'@ MODE TRAJECTOIRES OU MODE DEPLACEMENTS ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NVISLA DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL A 1 ',/,&
+'@ IL VAUT ICI NVISLA = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NVISLA dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "VITESSE DU FLUIDE VU" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISV1 DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISV1 = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISV1 dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "VITESSE DES PARTICULES" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISV2 DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISV2 = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISV2 dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2042 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "TEMPS DE SEJOUR DES PARTICULES" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISTP DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISTP = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISTP dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2043 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "DIAMETRE DES PARTICULES" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISDM DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISDM = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISDM dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2044 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "TEMPERATURE DES PARTICULES" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISTE DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISTE = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISTE dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2045 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "TEMPERATURE OU ENTHALPIE DES PARTICULES DE CHARBON" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISHP DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISHP = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISHP dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2046 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "DIAMETRE DU COEUR RETRECISSANT DES PARTICULES ',/,&
+'@ DE CHARBON" A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISDK DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISDK = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISDK dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2047 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "MASSE CHARBON REACTIF DES PARTICULES DE CHARBON" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISCH DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISCH = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISCH dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2048 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE POST-PROCESSING SUR LA VARIABLE ',/,&
+'@ "MASSE DE COKE DES PARTICULES DE CHARBON" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVISCK DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVISCK = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVISCK dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR SUR L''ACTIVATION DES STATISTIQUES ',/,&
+'@ SUR LES INTERACTIONS PARTICULES/FRONTIERES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IENSI3 DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IENSI3 = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IENSI3 dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2051 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE CALCUL DE LA STATISTIQUE AUX FRONTIERES',/,&
+'@ "MASSE DE GRAINS DE CHARBON ENCRASSES" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IENCBD DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IENCBD = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IENCBD dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2052 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE CALCUL DE LA STATISTIQUE AUX FRONTIERES',/,&
+'@ "NOMBRE D''INTERACTIONS PARTICULES/FRONTIERES" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ INBRBD DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI INBRBD = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de INBRBD dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2053 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE CALCUL DE LA STATISTIQUE AUX FRONTIERES',/,&
+'@ "FLUX DE MASSE PARTICULAIRE LIE AUX INTERACTIONS" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IFLMBD DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IFLMBD = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IFLMBD dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2054 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE CALCUL DE LA STATISTIQUE AUX FRONTIERES',/,&
+'@ "ANGLE ENTRE LA VITESSE DE LA PARTICULE ET LE PLAN ',/,&
+'@ DE LA FACE FRONTIERE" ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IANGBD DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IANGBD = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IANGBD dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2055 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE CALCUL DE LA STATISTIQUE AUX FRONTIERES',/,&
+'@ "VITESSE DE LA PARTICULE AU MOMENT DE L''INTERACTION"',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IVITBD DEVRAIT ETRE UN ENTIER EGAL A 0 OU 1 ',/,&
+'@ IL VAUT ICI IVITBD = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IVITBD dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2056 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE NOMBRE D''INFORMATIONS SUPPLEMENTAIRES POUR LE ',/,&
+'@ CALCUL DES STATISTIQUES AUX FRONTIERES ',/,&
+'@ A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NUSBOR DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL A 0 ',/,&
+'@ ET INFERIEUR OU EGAL A NUSBRD = ',I10 ,/,&
+'@ IL VAUT ICI NUSBOR = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NUSBOR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2057 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE CALCUL STATIONNAIRE DES STATISTIQUES ',/,&
+'@ AUX FRONTIERES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ NSTBOR DEVRAIT ETRE UN ENTIER SUPERIEUR OU EGAL A 1 ',/,&
+'@ IL VAUT ICI NSTBOR = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de NSTBOR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2058 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE SEUIL POUR LE CALCUL DES STATISTIQUES ',/,&
+'@ AUX FRONTIERES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ SEUILF DEVRAIT ETRE UN REEL SUPERIEUR OU EGAL A 0.D0 ',/,&
+'@ IL VAUT ICI SEUILF = ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de SEUILF dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2060 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA STATISTIQUE AUX FRONTIERES ',/,&
+'@ "NOMBRE D''INTERACTIONS PARTICULES/FRONTIERES" ',/,&
+'@ EST ACTIVE AVEC APPLICATION DE LA MOYENNE ',/,&
+'@ PARTICULAIRE (LAGOPT). ',/,&
+'@ ',/,&
+'@ LES INDICATEURS DE CALCUL DES STATISTIQUES VALENT : ',/,&
+'@ INBRBD = ',I10 ,/,&
+'@ IMOYBR(INBR) = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul continue mais risque de donner des affichages ',/,&
+'@ et des sorties graphiques incoherentes. Une suite ',/,&
+'@ de calcul est possible sans pertes de donnees. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IMOYBR(INBR) dans la USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2061 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA STATISTIQUE AUX FRONTIERES : ',/,&
+'@ ',A60 ,/,&
+'@ EST ACTIVE AVEC APPLICATION DE LA MOYENNE ',/,&
+'@ PARTICULAIRE, ALORS QUE LE COMPTE DU NOMBRE ',/,&
+'@ D''INTERACTIONS PARTICULES/FRONTIERES N''EST PAS ',/,&
+'@ ENCLENCHE (LAGOPT). ',/,&
+'@ ',/,&
+'@ LES INDICATEURS DE CALCUL DES STATISTIQUES VALENT : ',/,&
+'@ ',A12, ' = ',I10 ,/,&
+'@ IMOYBR = ',I10 ,/,&
+'@ ',/,&
+'@ INBRBD DEVRAIT ETRE A 1, IL VAUT ICI INBRBD = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de INBRBD dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2062 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA STATISTIQUE AUX FRONTIERES UTILISATEUR : ',/,&
+'@ ',A60 ,/,&
+'@ EST ACTIVE AVEC APPLICATION DE LA MOYENNE ',/,&
+'@ PARTICULAIRE, ALORS QUE LE COMPTE DU NOMBRE ',/,&
+'@ D''INTERACTIONS PARTICULES/FRONTIERES N''EST PAS ',/,&
+'@ ENCLENCHE (LAGOPT). ',/,&
+'@ ',/,&
+'@ LES INDICATEURS DE CALCUL DES STATISTIQUES VALENT : ',/,&
+'@ STAT UTILISATEUR NUMERO ',I10 ,/,&
+'@ IMOYBR = ',I10 ,/,&
+'@ ',/,&
+'@ INBRBD DEVRAIT ETRE A 1, IL VAUT ICI INBRBD = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de INBRBD dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2063 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ L''INDICATEUR DE MOYENNE POUR LE CALCUL DES STATISTIQUES',/,&
+'@ AUX FRONTIERES A UNE VALEUR NON PERMISE (LAGOPT). ',/,&
+'@ ',/,&
+'@ IMOYBR DEVRAIT ETRE UN ENTIER EGAL A 0, 1 OU 2 ',/,&
+'@ IL VAUT ICI IMOYBR = ', I10 ,/,&
+'@ POUR LA STATISTIQUE AUX FRONTERES : ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IMOYBR dans la subroutine USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE NOMBRE DE DONNEES REELLES SUR L''INJECTION ',/,&
+'@ DES PARTICULES DANS LE DOMAINE DE CALCUL EST ',/,&
+'@ SUPERIEUR AU NOMBRE MAXIMAL PREVU PAR DEFAUT. ',/,&
+'@ (LAGOPT). ',/,&
+'@ ',/,&
+'@ LE NOMBRE DE DONNEES REELLES DEMANDEES VAUT : ',I10 ,/,&
+'@ ',/,&
+'@ LE NOMBRE DE DONNEES MAXIMAL PREVU PAR DEFAUT VAUT ',/,&
+'@ NDLAGM = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE NOMBRE DE DONNEES ENTIERES SUR L''INJECTION ',/,&
+'@ DES PARTICULES DANS LE DOMAINE DE CALCUL EST ',/,&
+'@ SUPERIEUR AU NOMBRE MAXIMAL PREVU PAR DEFAUT. ',/,&
+'@ (LAGOPT). ',/,&
+'@ ',/,&
+'@ LE NOMBRE DE DONNEES ENTIERES DEMANDEES VAUT : ',I10 ,/,&
+'@ ',/,&
+'@ LE NOMBRE DE DONNEES MAXIMAL PREVU PAR DEFAUT VAUT ',/,&
+'@ NDLAIM = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGOPT)',/,&
+'@ LE NOMBRE DE STATISTIQUES VOLUMIQUES LAGRANGIENNES ',/,&
+'@ NVLSTA = ', I10 ,/,&
+'@ EST SUPERIEUR AU NOMBRE MAXIMAL PREVU ',/,&
+'@ NVPLMX = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3004 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGOPT)',/,&
+'@ LE NOMBRE DE POINTEURS DANS LES TABLEAUX DE ',/,&
+'@ VARIABLES PARTICULAIRES ETTP ET ETTPA ',/,&
+'@ IRF = ', I10 ,/,&
+'@ EST SUPERIEUR AU NOMBRE MAXIMAL CALCULE ',/,&
+'@ NVP = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3005 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGOPT)',/,&
+'@ LE NOMBRE DE POINTEURS DANS LE TABLEAUX DE ',/,&
+'@ PARAMETRES PARTICULAIRES TEPA ',/,&
+'@ IRF = ', I10 ,/,&
+'@ EST SUPERIEUR AU NOMBRE MAXIMAL CALCULE ',/,&
+'@ NVEP = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3006 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (LAGOPT)',/,&
+'@ LE NOMBRE DE POINTEURS DANS LE TABLEAUX DE ',/,&
+'@ PARAMETRES PARTICULAIRES ITEPA ',/,&
+'@ IRF = ', I10 ,/,&
+'@ EST SUPERIEUR AU NOMBRE MAXIMAL CALCULE ',/,&
+'@ NIVEP = ', I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE MODULE LAGRANGIEN EST INCOMPATIBLE AVEC LE MODELE ',/,&
+'@ DE TURBULENCE SELECTIONNE (LAGOPT). ',/,&
+'@ ',/,&
+'@ Le module lagrangien a ete active avec IILAGR = ',I10 ,/,&
+'@ et le couplage inverse sur la dynamique est pris en ',/,&
+'@ compte avec LTSDYN = ',I10 ,/,&
+'@ Le modele de turbulence active pour la phase ',I6 ,/,&
+'@ correspond a ITURB = ',I10 ,/,&
+'@ Or, les seuls traitements de la turbulence compatibles ',/,&
+'@ avec le module Lagrangien et le couplage inverse sur ',/,&
+'@ la dynamique sont k-epsilon, Rij-epsilon, v2f ',/,&
+'@ et k-omega ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier la valeur de IILAGR et IDISTU dans la subroutine ',/,&
+'@ USLAG1 et verifier la valeur de ITURB dans la subroutine ',/,&
+'@ USINI1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+
+end
diff --git a/src/lagr/lagout.f90 b/src/lagr/lagout.f90
new file mode 100644
index 0000000..3e5e546
--- /dev/null
+++ b/src/lagr/lagout.f90
@@ -0,0 +1,1242 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagout &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icocel , itycel , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , parbor , statis , stativ , tslagr , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! 1. Ecriture du fichier suite 'lagava' :
+! * variables sur les particules (ETTP)
+! * informations sur les particules (ITEPA, TEPA)
+
+! 2. Ecriture du fichier suite statistiques et termes sources
+! 'lasava' :
+! * statistiques volumiques (STATIS)
+! * statistiques aux frontieres (PARBOR)
+! * termes sources de couplage retour (TSLAGR)
+
+! 3. Finalisation des sorties graphiques
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icocel ! te ! <-- ! connectivite cellules -> faces !
+! (lndnod) ! ! ! face de bord si numero negatif !
+! itycel ! te ! <-- ! connectivite cellules -> faces !
+! (ncelet+1) ! ! ! pointeur du tableau icocel !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,ntersl ! ! ! lagrangien sur la phase porteuse !
+! parbor ! tr ! <-- ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer icocel(lndnod) , itycel(ncelet+1)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision tslagr(ncelet,ntersl)
+double precision parbor(nfabor,nvisbr)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+
+character rubriq*64 , car4*4
+character nomnvl(nvplmx)*60 , nomtsl(nvplmx)*60
+character nomite(nvplmx)*64 , nomrte(nvplmx)*64
+integer idebia , idebra
+integer ifinia , ifinra
+integer ierror , irtyp , itysup , nbval
+integer ivers , ilecec , iphas
+integer nfin , iforce , icha , ii
+integer itrav1
+integer ipas , jj
+integer impavl , impvls
+
+!===============================================================================
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. ECRITURE DU FICHIER SUITE : VARIABLES LIEES AUX PARTICULES
+!===============================================================================
+
+iphas = ilphas
+
+! ---> Ouverture (et on saute si erreur)
+! ILECEC = 2 : ecriture
+
+write(nfecra,6010)
+
+ilecec = 2
+call opnsui(ficavl, len(ficavl), ilecec, impavl, ierror)
+!==========
+if (ierror.ne.0) then
+ write(nfecra,9010) ficavl
+ goto 9998
+endif
+
+write(nfecra,6011)
+
+
+! Entete et Infos sur le calcul ou on saute si erreur
+! On inclut une rubrique destinee a distinguer ce fichier
+! d'un autre fichier suite
+! Pour le moment, IVERS n'est pas utilise
+
+itysup = 0
+nbval = 1
+
+ivers = 111
+RUBRIQ = 'version_fichier_suite_Lagrangien_variables'
+irtyp = 1
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,ivers, &
+ ierror)
+if (ierror.ne.0) then
+ write(nfecra,9010)
+ goto 9998
+endif
+
+! Temps (par securite)
+
+RUBRIQ = 'nombre_iterations_Lagrangiennes'
+irtyp = 1
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,iplas, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9020) &
+ 'nombre_iterations_Lagrangiennes ', &
+ 'IPLAS', IPLAS
+endif
+
+RUBRIQ = 'temps_physique_Lagrangien'
+irtyp = 2
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,ttclag, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9021) &
+ 'temps_physique_Lagrangien ', &
+ 'TTCLAG', TTCLAG
+endif
+
+! Infos sur le suivi du calcul
+
+irtyp = 1
+
+RUBRIQ = 'nombre_courant_particules'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,nbpart, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9030) &
+ 'nombre_courant_particules ', &
+ 'NBPART', NBPART
+ goto 9998
+endif
+
+RUBRIQ = 'nombre_total_particules'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,nbptot, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9020) &
+ 'nombre_total_particules ', &
+ 'NBPTOT', NBPTOT
+endif
+
+RUBRIQ = 'nombre_particules_perdues'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,nbpert, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9020) &
+ 'nombre_particules_perdues ', &
+ 'NBPERT', NBPERT
+endif
+
+RUBRIQ = 'indicateur_physique_particules'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,iphyla, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9030) &
+ 'indicateur_physique_particules ', &
+ 'IPHYLA', IPHYLA
+ goto 9998
+endif
+
+RUBRIQ = 'indicateur_temperature_particules'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,itpvar, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9030) &
+ 'indicateur_temperature_particules ', &
+ 'ITPVAR', ITPVAR
+ goto 9998
+endif
+
+RUBRIQ = 'indicateur_diametre_particules'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,idpvar, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9020) &
+ 'indicateur_diametre_particules ', &
+ 'IDPVAR', IDPVAR
+endif
+
+RUBRIQ = 'indicateur_masse_particules'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,impvar, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9020) &
+ 'indicateur_masse_particules ', &
+ 'IMPVAR', IMPVAR
+endif
+
+RUBRIQ = 'nombre_variables_utilisateur'
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp,nvls, &
+ ierror)
+if(ierror.ne.0) then
+ write(nfecra,9020) &
+ 'nombre_variables_utilisateur ', &
+ 'NVLS', NVLS
+endif
+
+write(nfecra,6012)
+
+! Variables particulaires
+
+NOMNVL(JXP) = 'variable_positionX_particule'
+NOMNVL(JYP) = 'variable_positionY_particule'
+NOMNVL(JZP) = 'variable_positionZ_particule'
+NOMNVL(JUP) = 'variable_vitesseU_particule'
+NOMNVL(JVP) = 'variable_vitesseV_particule'
+NOMNVL(JWP) = 'variable_vitesseW_particule'
+NOMNVL(JUF) = 'variable_vitesseU_fluide_vu'
+NOMNVL(JVF) = 'variable_vitesseV_fluide_vu'
+NOMNVL(JWF) = 'variable_vitesseW_fluide_vu'
+NOMNVL(JMP) = 'variable_masse_particule'
+NOMNVL(JDP) = 'variable_diametre_particule'
+if (iphyla.eq.1 .and. itpvar.eq.1) then
+ NOMNVL(JTP) = 'variable_temperature_particule'
+ NOMNVL(JTF) = 'variable_temperature_fluide_vu'
+ NOMNVL(JCP) = 'variable_chaleur_specifique_particule'
+elseif (iphyla.eq.2) then
+ NOMNVL(JHP) = 'variable_temperature_particule'
+ NOMNVL(JTF) = 'variable_temperature_fluide_vu'
+ NOMNVL(JMCH) = 'variable_masse_charbon_reactif'
+ NOMNVL(JMCK) = 'variable_masse_coke'
+ NOMNVL(JCP) = 'variable_chaleur_specifique_particule'
+endif
+if (nvls.gt.0) then
+ do ii = 1,nvls
+ WRITE(CAR4,'(I4.4)') II
+ NOMNVL(JVLS(II)) = 'variable_supplementaire_'//CAR4
+ enddo
+endif
+
+itysup = 0
+nbval = nbpart
+irtyp = 2
+
+do ii = jmp,jwf
+ rubriq = nomnvl(ii)
+ call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ettp(1,ii),ierror)
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9100) rubriq
+ goto 9998
+ endif
+enddo
+
+do ii = 1,jmp-1
+ rubriq = nomnvl(ii)
+ call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ettp(1,ii),ierror)
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9101) rubriq
+ endif
+enddo
+
+! Caracteristiques et infos particulaires (ENTIERS)
+
+NOMITE(JISOR) = 'numero_cellule_particules'
+if (iphyla.eq.2) then
+ NOMITE(JINCH) = 'numero_charbon'
+endif
+
+itysup = 0
+nbval = nbpart
+irtyp = 1
+
+rubriq = nomite(jisor)
+call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ itepa(1,jisor),ierror)
+if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9100) rubriq
+ goto 9998
+endif
+
+! groupe statistique particules
+
+if (nbclst .gt. 0 ) then
+ NOMITE(JCLST) = 'numero_groupe_statistiques'
+
+ itysup = 0
+ nbval = nbpart
+ irtyp = 1
+
+ rubriq = nomite(jclst)
+ call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ itepa(1,jclst),ierror)
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9100) rubriq
+ goto 9998
+ endif
+endif
+
+! Numero du charbon des particules
+
+if (iphyla.eq.2) then
+ rubriq = nomite(jinch)
+ call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ itepa(1,jinch),ierror)
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9101) rubriq
+ endif
+endif
+
+! Caracteristiques et infos particulaires (REELS)
+
+NOMRTE(JRTSP) = 'temps_sejour_particules'
+NOMRTE(JRPOI) = 'poids_statistiques_particules'
+if (iphyla.eq.1 .and. itpvar.eq.1 .and.iirayo.gt.0) then
+ NOMRTE(JREPS) = 'emissivite_particules'
+endif
+if (iphyla.eq.2) then
+ NOMRTE(JRDCK) = 'diametre_coeur_retrecissant_charbon'
+ NOMRTE(JRD0P) = 'diametre_initial_charbon'
+ NOMRTE(JRR0P) = 'masse_volumique_initial_charbon'
+endif
+
+itysup = 0
+nbval = nbpart
+irtyp = 2
+
+do ii = 1, nvep
+ rubriq = nomrte(ii)
+ call ecrsui(impavl,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tepa(1,ii),ierror)
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9101) rubriq
+ endif
+enddo
+
+write(nfecra,6013)
+
+! ---> Fermeture du fichier suite
+call clssui(impavl,ierror)
+
+if (ierror.ne.0) then
+ write(nfecra,9140) ficavl
+endif
+
+! ---> En cas d'erreur, on continue quand meme
+ 9998 continue
+
+write(nfecra,6014)
+
+!===============================================================================
+! 2. ECRITURE DU FICHIER SUITE STATISTIQUES ET TERMES SOURCES
+! DE COUPLAGE RETOUR
+!===============================================================================
+
+
+if ( (istala.eq.1 .and. iplas.ge.idstnt) .or. &
+ iilagr.eq.2 .or. &
+ (iensi3.eq.1 .and. nvisbr.gt.0) ) then
+
+
+! ---> Ouverture (et on saute si erreur)
+! ILECEC = 2 : ecriture
+
+ write(nfecra,7010)
+
+ ilecec = 2
+ call opnsui(ficvls, len(ficvls), ilecec, impvls, ierror)
+ !==========
+ if (ierror.ne.0) then
+ write(nfecra,9510) ficvls
+ goto 9999
+ endif
+
+ write(nfecra,7011)
+
+
+! Entete et Infos sur le calcul ou on saute si erreur
+! On inclut une rubrique destinee a distinguer ce fichier
+! d'un autre fichier suite
+! Pour le moment, IVERS n'est pas utilise
+
+ itysup = 0
+ nbval = 1
+
+ ivers = 111
+ RUBRIQ = 'version_fichier_suite_Lagrangien_statistiques'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp,ivers, &
+ ierror)
+
+ if(ierror.ne.0) then
+ write(nfecra,9510)
+ goto 9999
+ endif
+
+! ---> On ecrit ISTTIO c'est utile dans tous les cas
+
+ RUBRIQ = 'indicateur_ecoulement_stationnaire'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ isttio, ierror)
+
+ if(ierror.ne.0) then
+ write(nfecra,9510)
+ goto 9999
+ endif
+
+! --> En premier, on ecrit les statistiques volumiques
+
+ if (istala.eq.1 .and. iplas.ge.idstnt) then
+
+ RUBRIQ = 'iteration_debut_statistiques'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ idstnt,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'iteration_debut_statistiques ', &
+ 'IDSTNT', IDSTNT
+ endif
+
+ RUBRIQ = 'iteration_debut_statistiques_stationnaires'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nstist,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'iteration_debut_statistiques_stationnaires ', &
+ 'NSTIST', NSTIST
+ endif
+
+ RUBRIQ = 'nombre_iterations_statistiques_stationnaires'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npst,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'nombre_iterations_statistiques_stationnaires ', &
+ 'NPST', NPST
+ endif
+
+ RUBRIQ = 'temps_statistiques_stationnaires'
+ irtyp = 2
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tstat,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9521) &
+ 'temps_statistiques_stationnaires ', &
+ 'TSTAT', TSTAT
+ endif
+
+ RUBRIQ = 'classe_statistique_particules'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nbclst,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'classes_statistiques ', &
+ 'NBCLST', NBCLST
+ endif
+
+ RUBRIQ = 'nombre_statistiques_utilisateur'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nvlsts,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'nombre_statistiques_utilisateur ', &
+ 'NVLSTS', NVLSTS
+ endif
+
+! Statistiques volumiques
+
+ itysup = 1
+ irtyp = 2
+ nbval = 1
+
+ do ipas = 0,nbclst
+ do jj = 1,nvlsta
+
+ ii = ipas*nvlsta +jj
+ if (ipas.gt.0) then
+ WRITE(CAR4,'(I4.4)') IPAS
+ RUBRIQ = 'moy_stat_vol_groupe_'//CAR4//'_'//NOMLAG(II)
+ else
+ RUBRIQ = 'moy_stat_vol_'//NOMLAG(II)
+ endif
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ statis(1,ii),ierror)
+
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9550) rubriq
+ endif
+ enddo
+
+ do jj = 1,nvlsta-1
+ if (ipas.gt.0) then
+ WRITE(CAR4,'(I4.4)') IPAS
+ RUBRIQ = 'var_stat_vol_groupe_'//CAR4//'_'//NOMLAV(II)
+ else
+ RUBRIQ = 'var_stat_vol_'//NOMLAV(II)
+ endif
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ stativ(1,ii),ierror)
+
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9550) rubriq
+ endif
+
+ enddo
+
+ enddo
+
+ endif
+
+! --> En second, c'est le tour des statistiques aux frontieres
+
+ if (iensi3.eq.1 .and. nvisbr.gt.0) then
+
+ itysup = 0
+ nbval = 1
+
+ RUBRIQ = 'iteration_debut_stats_frontieres_stationnaires'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nstbor,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'iteration_debut_stats_frontieres_stationnaires ', &
+ 'NSTBOR', NSTBOR
+ endif
+
+ RUBRIQ = 'nombre_iterations_stats_frontieres'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npstft,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'nombre_iterations_stats_frontieres ', &
+ 'NPSTFT', NPSTFT
+ endif
+
+ RUBRIQ = 'nombre_iterations_stats_frontieres_stationnaires'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npstf,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'nombre_iterations_stats_frontieres_stationnaires ', &
+ 'NPSTF', NPSTF
+ endif
+
+ RUBRIQ = 'temps_stats_frontieres_stationnaires'
+ irtyp = 2
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tstatp,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9521) &
+ 'temps_stats_frontieres_stationnaires ', &
+ 'TSTATP', TSTATP
+ endif
+
+ RUBRIQ = 'nombre_stats_frontieres_utilisateur'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nusbor,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9521) &
+ 'nombre_stats_frontieres_utilisateur ', &
+ 'NUSBOR', NUSBOR
+ endif
+
+! Statistiques aux frontieres
+
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+
+ do ii = 1,nvisbr
+ RUBRIQ = 'stat_bord_'//NOMBRD(II)
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ parbor(1,ii),ierror)
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9550) rubriq
+ endif
+ enddo
+
+ endif
+
+! --> Enfin, en cas de couplage retour, on ecrit les termes sources
+
+ if (iilagr.eq.2) then
+
+ itysup = 0
+ nbval = 1
+
+ RUBRIQ = 'iteration_debut_termes_sources_stationnaires'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ nstits,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'iteration_debut_termes_sources_stationnaires ', &
+ 'NSTITS', NSTITS
+ endif
+
+ RUBRIQ = 'nombre_iterations_termes_sources_stationnaires'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ npts,ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'nombre_iterations_termes_sources_stationnaires ', &
+ 'NPTS', NPTS
+ endif
+
+ RUBRIQ = 'modele_turbulence_termes_sources'
+ irtyp = 1
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ iturb(iphas),ierror)
+ if(ierror.ne.0) then
+ write(nfecra,9520) &
+ 'modele_turbulence_termes_sources ', &
+ 'ITURB',ITURB(IPHAS)
+ endif
+
+! On donne des labels au different TS pour les noms de rubriques
+! On donne le meme label au keps, au v2f et au k-omega (meme variable k)
+
+ if (ltsdyn.eq.1) then
+ NOMTSL(ITSVX) = 'terme_source_vitesseX'
+ NOMTSL(ITSVY) = 'terme_source_vitesseY'
+ NOMTSL(ITSVZ) = 'terme_source_vitesseZ'
+ NOMTSL(ITSLI) = 'terme_source_vitesse_implicite'
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ NOMTSL(ITSKE) = 'terme_source_turbulence_keps'
+ else if (itytur(iphas).eq.3) then
+ NOMTSL(ITSR11) = 'terme_source_turbulence_R11'
+ NOMTSL(ITSR12) = 'terme_source_turbulence_R12'
+ NOMTSL(ITSR13) = 'terme_source_turbulence_R13'
+ NOMTSL(ITSR22) = 'terme_source_turbulence_R22'
+ NOMTSL(ITSR23) = 'terme_source_turbulence_R23'
+ NOMTSL(ITSR33) = 'terme_source_turbulence_R33'
+ endif
+ endif
+ if (ltsmas.eq.1) then
+ NOMTSL(ITSMAS) = 'terme_source_masse'
+ endif
+ if (ltsthe.eq.1) then
+ if (iphyla.eq.1 .and. itpvar.eq.1) then
+ NOMTSL(ITSTE) = 'terme_source_thermique_explicite'
+ NOMTSL(ITSTI) = 'terme_source_thermique_implicite'
+ else if (iphyla.eq.2) then
+ NOMTSL(ITSTE) = 'terme_source_thermique_explicite'
+ NOMTSL(ITSTI) = 'terme_source_thermique_implicite'
+ do icha = 1,ncharb
+ WRITE(CAR4,'(I4.4)') ICHA
+ NOMTSL(ITSMV1(ICHA)) = 'terme_source_legeres_F1_'//CAR4
+ NOMTSL(ITSMV2(ICHA)) = 'terme_source_lourdes_F2_'//CAR4
+ enddo
+ NOMTSL(ITSCO) = 'terme_source_F3'
+ NOMTSL(ITSFP4) = 'terme_source_variance_traceur_air'
+ endif
+ endif
+
+! Termes source de couplage retour
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ do ii = 1,ntersl
+ rubriq = nomtsl(ii)
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ tslagr(1,ii),ierror)
+ if(ierror.ne.0) then
+! advienne que pourra sur le format
+ write(nfecra,9550) rubriq
+ endif
+ enddo
+
+! Dans le cas specifique de la combustion de grains de charbon
+! avec un couplage retour sur une combustion gaz en phase porteuse
+
+! --> A verifier l'utilite de cette sauvegarde pour une suite...
+
+ if (ippmod(icpl3c).ge.0) then
+ do ii = 1, nsalpp
+ icha = nsalto-nsalpp+ii
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+ WRITE(CAR4,'(I4.4)') II
+ RUBRIQ = 'scalaires_physiques_pariculieres_charbon'//CAR4
+ call ecrsui(impvls,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(icha)),ierror)
+ if(ierror.ne.0) write(nfecra,9550) rubriq
+ enddo
+
+ endif
+
+ endif
+
+ write(nfecra,7013)
+
+! ---> Fermeture du fichier suite
+ call clssui(impvls,ierror)
+
+ if(ierror.ne.0) then
+ write(nfecra,9700) ficvls
+ endif
+
+! ---> En cas d'erreur, on continue quand meme
+ 9999 continue
+
+ write(nfecra,7014)
+
+endif
+
+!===============================================================================
+! 3. Visualisations
+!===============================================================================
+
+if (ntcabs.lt.ntmabs) return
+
+nfin = 1
+
+!-->Stockage des trajectoires au format Ensight Gold
+
+if (iensi1.eq.1) then
+
+ iforce = 0
+ call enslag &
+ !==========
+ ( idebia , idebra , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , iforce , &
+ itepa , &
+ ettp , tepa , ra )
+
+endif
+
+!-->Stockage des deplacements au format Ensight Gold
+
+if (iensi2.eq.1) then
+
+ ifinia = idebia
+ itrav1 = idebra
+ ifinra = itrav1 + 3*nbpmax
+ CALL RASIZE ('LAGOUT',IFINRA)
+ !==========
+
+ call enswaf &
+ !==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , &
+ itepa , &
+ ettp , tepa , ra(itrav1) )
+
+endif
+
+!===============================================================================
+! 4. FIN
+!===============================================================================
+
+return
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+ 6010 FORMAT (/, 3X,'** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/,&
+ 3X,' ------------------------------------- ',/,&
+ 3X,' Ecriture d''un fichier suite ',/,&
+ 3X,' sur les variables liees aux particules ',/)
+
+
+ 6011 FORMAT ( 3X,' Debut de l''ecriture ' )
+ 6012 FORMAT ( 3X,' Fin de l''ecriture des infos sur le calcul ' )
+ 6013 FORMAT ( 3X,' Fin de l''ecriture des infos particulaires ' )
+ 6014 FORMAT ( 3X,' Fin de l''ecriture du fichier suite ',/,&
+ 3X,' sur les variables liees aux particules ',/)
+
+ 7010 FORMAT (/, 3X,'** INFORMATIONS SUR LE CALCUL LAGRANGIEN ',/,&
+ 3X,' ------------------------------------- ',/,&
+ 3X,' Ecriture d''un fichier suite ',/,&
+ 3X,' sur les statistiques volumiques et aux ',/,&
+ 3X,' fontieres, ainsi que les termes sources ',/,&
+ 3X,' de couplage retour ',/)
+
+
+ 7011 FORMAT ( 3X,' Debut de l''ecriture des stats et TS ' )
+ 7013 FORMAT ( 3X,' Fin de l''ecriture des statistiques et TS ' )
+ 7014 FORMAT ( 3X,' Fin de l''ecriture du fichier suite ',/,&
+ 3X,' sur les statistiques et TS couplage retour ',/)
+
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES CARACTERISTIQUES DES PARTICULES ',/,&
+'@ ',/,&
+'@ ERREUR A L''OUVERTURE EN ECRITURE DU FICHIER SUITE ',/,&
+'@ (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se termine mais ne fournira pas de fichier ',/,&
+'@ suite sur les caracteristiques des particules. ',/,&
+'@ ',/,&
+'@ Verifier que le repertoire de travail est accessible en ',/,&
+'@ ecriture et que le fichier suite peut y etre cree. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES CARACTERISTIQUES DES PARTICULES ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ LA VALEUR DU MOT CLE CONCERNE VAUT : ',/,&
+'@ ',A10 ,' = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES CARACTERISTIQUES DES PARTICULES ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ LA VALEUR DU MOT CLE CONCERNE VAUT : ',/,&
+'@ ',A10 ,' = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES CARACTERISTIQUES DES PARTICULES ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ LA VALEUR DU MOT CLE CONCERNE VAUT : ',/,&
+'@ ',A10 ,' = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul continue mais ne fournira pas de fichier ',/,&
+'@ suite sur les caracteristiques des particules. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES CARACTERISTIQUES DES PARTICULES ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le calcul continue mais ne fournira pas de fichier ',/,&
+'@ suite sur les caracteristiques des particules. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9101 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES CARACTERISTIQUES DES PARTICULES ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9140 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A LA FERMETURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES CARACTERISTIQUES DES PARTICULES ',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom : ',A13 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9510 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES STATISTIQUES ET LES TERMES SOURCES ',/,&
+'@ DE COUPLAGE RETOUR ',/,&
+'@ ',/,&
+'@ ERREUR A L''OUVERTURE EN ECRITURE DU FICHIER SUITE ',/,&
+'@ (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul continue mais ne fournira pas de fichier ',/,&
+'@ suite sur les statistiques volumiques et aux frontieres ',/,&
+'@ ainsi que sur les termes sources de couplage retour ',/,&
+'@ ',/,&
+'@ Verifier que le repertoire de travail est accessible en ',/,&
+'@ ecriture et que le fichier suite peut y etre cree. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9520 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES STATISTIQUES ET LES TERMES SOURCES ',/,&
+'@ DE COUPLAGE RETOUR ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ LA VALEUR DU MOT CLE CONCERNE VAUT : ',/,&
+'@ ',A10 ,' = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9521 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES STATISTIQUES ET LES TERMES SOURCES ',/,&
+'@ DE COUPLAGE RETOUR ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ LA VALEUR DU MOT CLE CONCERNE VAUT : ',/,&
+'@ ',A10 ,' = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9550 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES STATISTIQUES ET LES TERMES SOURCES ',/,&
+'@ DE COUPLAGE RETOUR ',/,&
+'@ ',/,&
+'@ ERREUR A L''ECRITURE DE LA RUBRIQUE ',/,&
+'@ ',A60 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ Voir le sous-programme LAGOUT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9700 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A LA FERMETURE DU FICHIER SUITE LAGRANGIEN ',/,&
+'@ ========= SUR LES STATISTIQUES ET LES TERMES SOURCES ',/,&
+'@ DE COUPLAGE RETOUR ',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom : ',A13 ,/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagphy.f90 b/src/lagr/lagphy.f90
new file mode 100644
index 0000000..4014ea8
--- /dev/null
+++ b/src/lagr/lagphy.f90
@@ -0,0 +1,366 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagphy &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , &
+ tempct , tsvar , auxl , &
+ cpgd1 , cpgd2 , cpght , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! INTEGRATION DES EDS CONCERNANT LES PHYSIQUES PARTICULIERES
+! LIEES AUX PARTICULES :
+
+! - Temperature du fluide vu par les particules,
+! - Temperature des particules,
+! - Diametre des particules
+! - Masse des particules
+! - Variables liees aux grains de charbon (Temp,MCH,MCK),
+! - Variables Utilisateur supplementaires.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tsvar ! tr ! <-- ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable courante, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+! auxl(nbpmax,3 ! tr ! --- ! tableau de travail lagrangien !
+! cpgd1,cpgd2, ! tr ! --> ! termes de devolatilisation 1 et 2 et !
+! cpght(nbpmax ! ! ! de combusion heterogene (charbon !
+! ! ! ! avec couplage retour thermique) !
+! w1..w3(ncelet ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision tsvar(nbpmax,nvp1) , auxl(nbpmax,3)
+double precision cpgd1(nbpmax) , cpgd2(nbpmax) , cpght(nbpmax)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ifinia , ifinra
+integer iwl1 , iwl2
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+
+!===============================================================================
+! 2. INTEGRATION DE LA TEMPERATURE FLUIDE VU PAR LES PARTICULES
+!===============================================================================
+
+if ( iphyla.eq.2 .or. (iphyla.eq.1 .and. itpvar.eq.1) ) then
+
+ call lagitf &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl(1,1) , auxl(1,2) , w1 , &
+ ra )
+
+endif
+
+!===============================================================================
+! 3. INTEGRATION DE LA TEMPERATURE DES PARTICULES
+!===============================================================================
+
+if ( iphyla.eq.1 .and. itpvar.eq.1 ) then
+
+ call lagitp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl(1,1) , auxl(1,2) , &
+ ra )
+
+endif
+
+!===============================================================================
+! 4. INTEGRATION DU DIAMETRE DES PARTICULES
+!===============================================================================
+
+if ( iphyla.eq.1 .and. idpvar.eq.1 ) then
+
+ call lagidp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl(1,1) , auxl(1,2) , &
+ ra )
+
+endif
+
+!===============================================================================
+! 5. INTEGRATION DE LA MASSE DES PARTICULES
+!===============================================================================
+
+if (iphyla.eq.1 .and. impvar.eq.1) then
+
+ call lagimp &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl(1,1) , auxl(1,2) , &
+ ra )
+
+endif
+
+!===============================================================================
+! 6. INTEGRATION DES EQUATIONS DU CHARBON : HP, MCH, MCK
+!===============================================================================
+
+if (iphyla.eq.2) then
+
+ ifinia = idebia
+ iwl1 = idebra
+ iwl2 = iwl1 + nbpmax
+ ifinra = iwl2 + nbpmax
+ CALL RASIZE('LAGUNE',IFINRA)
+! ==========
+
+ call lagich &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ itepa , ibord , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , tsvar ,&
+ cpgd1 , cpgd2 , cpght , &
+ auxl(1,1) , auxl(1,2) , auxl(1,3) , &
+ ra(iwl1) , ra(iwl2) , w1 , ra )
+
+endif
+
+!===============================================================================
+! 7. INTEGRATION DES VARIABLES UTILISATEURS SUPPLEMENTAIRES
+!===============================================================================
+
+if (nvls.ge.1) then
+
+ call uslaed &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , &
+ tempct , tsvar , &
+ auxl(1,1) , auxl(1,2) , auxl(1,3) , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagpoi.f90 b/src/lagr/lagpoi.f90
new file mode 100644
index 0000000..b529200
--- /dev/null
+++ b/src/lagr/lagpoi.f90
@@ -0,0 +1,434 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagpoi &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac ,lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icocel , itycel , ifrlag , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , statis , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! RESOLUTION DE L'EQUATION DE POISSON POUR LES VITESSE MOYENNES
+! DES PARTICULES
+! ET CORRECTION DES VITESSES INSTANTANNEES
+! DES PARTICULES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icocel ! te ! --> ! connectivite cellules -> faces !
+! (lndnod) ! ! ! face de bord si numero negatif !
+! itycel ! te ! --> ! connectivite cellules -> faces !
+! (ncelet+1) ! ! ! pointeur du tableau icocel !
+! ifrlag ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module lagrangien !
+! itepa ! te ! --> ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! moyennes statistiques !
+!(ncelet,nvlsta ! ! ! !
+! w1...w3(ncel) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer icocel(lndnod) , itycel(ncelet+1)
+integer ifrlag(nfabor) , itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifinia, ifinra
+integer npt , iel , ifac
+integer iphila , iphil
+integer iw1 , iw2 , iw3 , iw4 , iw5
+integer iw6 , iw7 , iw8 , iw9
+integer idtr , ifmala , ifmalb
+integer iviscf , iviscb , idam , ixam
+integer idrtp , ismbr , irovsd
+integer icoefap , icoefbp
+integer ivar0
+integer inc, iccocg
+integer nswrgp , imligp , iwarnp
+integer idimte , itenso , iphydp
+double precision epsrgp , climgp , extrap
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+ifmala = irovsd + ncelet
+ifmalb = ifmala + nfac
+
+iphila = ifmalb + nfabor
+iphil = iphila + ncelet
+iw1 = iphil + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+ifinra = iw9 + ncelet
+CALL RASIZE('LAGPOI',IFINRA)
+! ==========
+
+do iel=1,ncel
+ if ( statis(iel,ilpd) .gt. seuil ) then
+ statis(iel,ilvx) = statis(iel,ilvx) &
+ /statis(iel,ilpd)
+ statis(iel,ilvy) = statis(iel,ilvy) &
+ /statis(iel,ilpd)
+ statis(iel,ilvz) = statis(iel,ilvz) &
+ /statis(iel,ilpd)
+ statis(iel,ilfv) = statis(iel,ilfv) &
+ /( dble(npst) * volume(iel) )
+ else
+ statis(iel,ilvx) = 0.d0
+ statis(iel,ilvy) = 0.d0
+ statis(iel,ilvz) = 0.d0
+ statis(iel,ilfv) = 0.d0
+ endif
+enddo
+
+call lageqp &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , propce , propfa , propfb , &
+ ra(iviscf) , ra(iviscb) , &
+ ra(idam) , ra(ixam) , &
+ ra(idrtp) , ra(ismbr) , ra(irovsd) , &
+ ra(ifmala) , ra(ifmalb) , &
+ statis(1,ilvx) , statis(1,ilvy) , statis(1,ilvz) , &
+ statis(1,ilfv) , &
+ ra(iphila) , ra(iphil) , &
+ w1 , w2 , w3 , ra(iw1) , ra(iw2) , &
+ ra(iw3) , ra(iw4) , ra(iw5) , ra(iw6) , &
+ ra(iw7) , ra(iw8) , ra(iw9) , &
+ rdevel , rtuser , &
+ ra )
+
+! Calcul du gradient du Correcteur PHI
+! ====================================
+
+
+! On alloue localement 2 tableaux de NFABOR pour le calcul
+! de COEFA et COEFB de W1,W2,W3
+
+icoefap = ifinra
+icoefbp = icoefap + nfabor
+ifinra = icoefbp + nfabor
+CALL RASIZE ('LAGEQP',IFINRA)
+!==========
+
+do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ra(icoefap+ifac-1) = ra(iphil+iel-1)
+ ra(icoefbp+ifac-1) = zero
+enddo
+
+inc = 1
+iccocg = 1
+nswrgp = 100
+imligp = -1
+iwarnp = 2
+epsrgp = 1.d-8
+climgp = 1.5d0
+extrap = 0.d0
+
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+if(irangp.ge.0) then
+ call parcom(ra(iphil))
+ !==========
+endif
+
+! Periodique
+if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ ra(iphil) , ra(iphil) , ra(iphil) , &
+ ra(iphil) , ra(iphil) , ra(iphil) , &
+ ra(iphil) , ra(iphil) , ra(iphil) )
+endif
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ivar0 = 0
+
+! Sans prise en compte de la pression hydrostatique
+
+iphydp = 0
+
+call grdcel &
+!==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(iphil) , ra(iphil) , ra(iphil) , &
+ ra(iphil) , ra(icoefap) , ra(icoefbp) , &
+ w1 , w2 , w3 , &
+ ra(iw1) , ra(iw2) , ra(iw3) , &
+ rdevel , rtuser , ra )
+
+! CORRECTION DES VITESSES MOYENNES ET RETOUR AU CUMUL
+
+do iel = 1,ncel
+ if ( statis(iel,ilpd) .gt. seuil ) then
+ statis(iel,ilvx) = statis(iel,ilvx) - w1(iel)
+ statis(iel,ilvy) = statis(iel,ilvy) - w2(iel)
+ statis(iel,ilvz) = statis(iel,ilvz) - w3(iel)
+ endif
+enddo
+
+do iel = 1,ncel
+ if ( statis(iel,ilpd) .gt. seuil ) then
+ statis(iel,ilvx) = statis(iel,ilvx)*statis(iel,ilpd)
+ statis(iel,ilvy) = statis(iel,ilvy)*statis(iel,ilpd)
+ statis(iel,ilvz) = statis(iel,ilvz)*statis(iel,ilpd)
+ statis(iel,ilfv) = statis(iel,ilfv) &
+ *( dble(npst) * volume(iel) )
+ endif
+enddo
+
+! CORRECTION DES VITESSES INSTANTANNES
+
+do npt = 1,nbpart
+ if ( itepa(npt,jisor).gt.0 ) then
+ iel = itepa(npt,jisor)
+ ettp(npt,jup) = ettp(npt,jup) - w1(iel)
+ ettp(npt,jvp) = ettp(npt,jvp) - w2(iel)
+ ettp(npt,jwp) = ettp(npt,jwp) - w3(iel)
+ endif
+enddo
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagrus.f90 b/src/lagr/lagrus.f90
new file mode 100644
index 0000000..2634321
--- /dev/null
+++ b/src/lagr/lagrus.f90
@@ -0,0 +1,337 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagrus &
+!================
+
+ ( idbia0 , idbra0 , &
+ ncelet , ncel , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , indep , &
+ idevel , ituser , ia , &
+ ettp , ettpa , tepa , croule , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -----------------------------------
+
+! Roulette russe et clonage applique aux particules
+! suivant un critere d'importance (CROULE)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! indep(nbpmax) ! te ! <-- ! numero de sa cellule de depart !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! croule(ncelet ! tr ! <-- ! critere d'importance !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ncelet , ncel
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep) , indep(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision croule(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer iel , ield , nclo , npars
+integer npt , n , n1 , iva , nc
+double precision aux(1) , coeff , pnew , dnpars
+
+!===============================================================================
+
+!===============================================================================
+! 0. Initialisation
+!===============================================================================
+
+! NPCLON : NOMBRE DE NOUVELLES PARTICULES PAR CLONNAGE
+
+! NPKILL : NOMBRE DE PARTICULES VICTIMES DE LA ROULETTE RUSSE
+
+! NPCSUP : NOMBRE DE PARTICULES QUI ON SUBIT LE CLONNAGE
+
+npclon = 0
+npcsup = 0
+npkill = 0
+
+dnpclo = 0.d0
+dnpcsu = 0.d0
+dnpkil = 0.d0
+
+!===============================================================================
+! 1. Clonage / Fusion (ou "Roulette Russe")
+!===============================================================================
+
+
+! Boucle sur les particules
+
+do npt = 1,nbpart
+
+ if (itepa(npt,jisor).ne.indep(npt)) then
+
+ iel = itepa(npt,jisor)
+ ield = indep(npt)
+
+! Rapport des fonction d'importance entre la cellule de depart
+! et celle d'arrivee
+
+ coeff = croule(iel) / croule(ield)
+
+ if (coeff.lt.1.d0) then
+
+!---------------
+! ROULETTE RUSSE
+!---------------
+
+ n1 = 1
+ call zufall(n1,aux(1))
+
+ if (aux(1).lt.coeff) then
+
+! La particule survit avec une probabilite COEFF
+
+ tepa(npt,jrpoi) = tepa(npt,jrpoi)/coeff
+
+ else
+
+! La particule est supprimee avec une probabilite (1-COEFF)
+
+ itepa(npt,jisor) = 0
+ npkill = npkill + 1
+ dnpkil = dnpkil + tepa(npt,jrpoi)
+ endif
+
+ else if (coeff.gt.1.d0) then
+
+!--------
+! CLONAGE
+!--------
+
+ n = int(coeff)
+ n1 = 1
+ call zufall(n1,aux(1))
+
+ if (aux(1).lt.(coeff-dble(n))) then
+
+! Clonage en N+1 particules
+
+ nclo = n + 1
+
+ else
+
+! Clonage en N particules
+
+ nclo = n
+
+ endif
+
+ if ((nbpart+npclon+nclo+1).gt.nbpmax) then
+ write(nfecra,5000) nbpart, npclon+nclo+1, nbpmax
+ goto 1000
+ endif
+
+ npcsup = npcsup + 1
+ dnpcsu = dnpcsu + tepa(npt,jrpoi)
+ pnew = tepa(npt,jrpoi) / dble(nclo)
+
+ do nc = 1,nclo
+
+ npclon = npclon + 1
+ dnpclo = dnpclo + pnew
+
+ do iva = 1,nvp
+ ettp(nbpart+npclon,iva) = ettp(npt,iva)
+ enddo
+
+ do iva = 1,nvp
+ ettpa(nbpart+npclon,iva) = ettpa(npt,iva)
+ enddo
+
+ do iva = 1,nvep
+ tepa(nbpart+npclon,iva) = tepa(npt,iva)
+ enddo
+
+ tepa(nbpart+npclon,jrpoi) = pnew
+
+ do iva = 1,nivep
+ itepa(nbpart+npclon,iva) = itepa(npt,iva)
+ enddo
+
+ enddo
+
+! Modif de la particule elle meme
+
+ itepa(npt,jisor) = 0
+
+ endif
+ endif
+enddo
+
+ 1000 continue
+
+! Actualisation du nouveau nombre de particules
+
+nbpart = nbpart + npclon
+dnbpar = dnbpar + dnpclo
+
+!===============================================================================
+! 2. On elimine les particules qui ont perdu � la Roulette Russe
+! et celles qui ont subit le clonage.
+!===============================================================================
+
+call lageli &
+!==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ npars , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ dnpars , &
+ ettp , ettpa , tepa , &
+ rdevel , rtuser , ra )
+
+if ( npars.ne.(npkill+npcsup) ) then
+ write(nfecra,9000)
+ call csexit(1)
+ !==========
+endif
+
+!-------
+! FORMAT
+!-------
+
+ 5000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ CLONAGE / FUSION DES PARTICULES ',/,&
+'@ ',/,&
+'@ Le nombre de nouvelles particules clonees conduit a un ',/,&
+'@ nombre total de particules superieur au maximum prevu : ',/,&
+'@ Nombre de particules courant : NBPART = ',I10 ,/,&
+'@ Nombre de particules clonnees : NPCLON = ',I10 ,/,&
+'@ Nombre maximal de particules : NBPMAX = ',I10 ,/,&
+'@ ',/,&
+'@ On ne clone plus de particules por cette iteration. ',/,&
+'@ ',/,&
+'@ Verifier NBPMAX dans USLAG1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ CLONAGE / FUSION DES PARTICULES ',/,&
+'@ ',/,&
+'@ La somme des particules detruites a la Roulette Russe ',/,&
+'@ avec celles qui ont subit le clonage ',/,&
+'@ est different de celui des particules eliminees. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier LAGRUS et LAGELI. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagsta.f90 b/src/lagr/lagsta.f90
new file mode 100644
index 0000000..23461c3
--- /dev/null
+++ b/src/lagr/lagsta.f90
@@ -0,0 +1,589 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagsta &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , tepa , statis , stativ , &
+ w1 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -----------------------------------
+
+! CALCUL DES STATISTIQUES SUR LES PARTICULES
+
+
+! ISTTIO = 0 : calcul instationnaire pour le lagrangien
+! = 1 : calcul stationnaire pour le lagrangien
+
+! ISTALA : calcul statistiques si >= 1 sinon pas de stat
+
+! ISUIST : suite calcul statistiques si >= 1 sinon pas de stat
+
+! IDSTNT : Numero du pas de temps pour debut statistque
+
+! NSTIST : iteration Lagrangienne du debut calcul stationnaire
+
+! NPST : nombre d'iterations de calcul de stats stationnaires
+
+! NPSTT : nombre d'iterations total des stats depuis le debut
+! du calcul, partie instationnaire comprise
+! (Attention : uniquement pour affichage listing,
+! ne pas faire de test dessus, preferer IDSTNT)
+
+! TSTAT : temps physique de calcul des statistiques stationnaires
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis(ncelet ! tr ! --> ! cumul des statistiques volumiques !
+! nvlsta) ! ! ! !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! w1(ncelet) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision w1(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer npt , nv , iel, nv1, izcl
+integer ilvx1 , ilvy1 , ilvz1 , ilpd1 , ilfv1 , ilts1
+integer iltp1 , ildp1 , ilmp1
+integer ilhp1 , ilmch1 , ilmck1 , ildck1
+double precision pis6 , concen
+
+!===============================================================================
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INCREMENTATION DES COMPTEURS ET INITIALISATION
+!===============================================================================
+
+! ISTTIO = 0 : calcul instationnaire pour le lagrangien
+! = 1 : calcul stationnaire pour le lagrangien
+! NSTIST : iter de depart pour le debut calcul stationnaire
+! NPST : nombre de pas de temps pour le cumul des stats
+! stationnaires
+! NPSTT : nombre de pas de temps total des stats depuis le debut
+! du calcul, partie instationnaire comprise (pour listing)
+! TSTAT : temps physique de calcul des statistiques stationnaires
+
+!-> Si on est en instationnaire, ou si le debut des stat stationnaires
+! n'est pas encore enclenchee, on remet les stat a zero a chaque
+! pas de temps
+
+if (isttio.eq.0 .or. (isttio.eq.1 .and. iplas.le.nstist)) then
+
+ npst = 0
+ tstat = 0.d0
+
+! Statistiques globales
+ do nv = 1,nvlsta
+ do iel = 1,ncel
+ statis(iel,nv) = 0.d0
+ enddo
+ enddo
+
+ do nv = 1,nvlsta-1
+ do iel = 1,ncel
+ stativ(iel,nv) = 0.d0
+ enddo
+ enddo
+
+! Statistiques par groupe
+ if (nbclst.gt.0) then
+
+ do nv = 1, nvlsta*nbclst
+ nv1 = nvlsta + nv
+ do iel = 1,ncel
+ statis(iel,nv1) = 0.d0
+ enddo
+ enddo
+
+ do nv = 1, (nvlsta-1)*nbclst
+ nv1 = (nvlsta-1) + nv
+ do iel = 1,ncel
+ stativ(iel,nv1) = 0.d0
+ enddo
+ enddo
+
+ endif
+
+endif
+
+npst = npst + 1
+tstat = tstat + dtp
+
+npstt = iplas - idstnt + 1
+
+!===============================================================================
+! 2 - CALCUL DES STATISTIQUES PARTICULAIRES
+!===============================================================================
+
+! * Moyenne et variance des composantes de la vitesse
+! * Moyenne et variance du taux de presence
+! (i.e. concentration volumique)
+! * Moyenne et variance du temps de s�jour
+! * Somme du poids statistiques associ� aux particules
+! (i.e . nombre de particules par cellules)
+
+! * Moyenne et variance de la temperature
+! * Moyenne et variance du diametre
+! * Moyenne et variance de la masse
+
+! * Moyenne et variance de la temperature
+! * Moyenne et variance de la masse de charbon reactif
+! * Moyenne et variance de la masse de coke
+! * Moyenne et variance du diametre du coeur retrecissant
+
+
+pis6 = pi / 6.d0
+
+!===============================================================================
+! 2.1 - STATISTIQUES GLOBALES
+!===============================================================================
+
+do npt = 1,nbpart
+
+ if (itepa(npt,jisor).gt.0) then
+
+! * Moyenne et variance des composantes de la vitesse
+
+ iel = itepa(npt,jisor)
+
+ statis(iel,ilvx) = statis(iel,ilvx) &
+ + tepa(npt,jrpoi) * ettp(npt,jup)
+ statis(iel,ilvy) = statis(iel,ilvy) &
+ + tepa(npt,jrpoi) * ettp(npt,jvp)
+ statis(iel,ilvz) = statis(iel,ilvz) &
+ + tepa(npt,jrpoi) * ettp(npt,jwp)
+
+ stativ(iel,ilvx) = stativ(iel,ilvx) &
+ + tepa(npt,jrpoi) * ettp(npt,jup) * ettp(npt,jup)
+
+ stativ(iel,ilvy) = stativ(iel,ilvy) &
+ + tepa(npt,jrpoi) * ettp(npt,jvp) * ettp(npt,jvp)
+ stativ(iel,ilvz) = stativ(iel,ilvz) &
+ + tepa(npt,jrpoi) * ettp(npt,jwp) * ettp(npt,jwp)
+
+! * Moyenne et variance du taux de presence
+
+ concen = (ettp(npt,jdp)**3) *pis6
+
+ statis(iel,ilfv) = statis(iel,ilfv) &
+ + tepa(npt,jrpoi) * concen
+
+ stativ(iel,ilfv) = stativ(iel,ilfv) &
+ + tepa(npt,jrpoi) * concen * concen
+
+! * Moyenne et variance du temps de s�jour
+
+ statis(iel,ilts) = statis(iel,ilts) &
+ + tepa(npt,jrpoi) * tepa(npt,jrtsp)
+
+ stativ(iel,ilts) = stativ(iel,ilts) &
+ + tepa(npt,jrpoi) * tepa(npt,jrtsp) * tepa(npt,jrtsp)
+
+! * Somme du poids statistiques associ� aux particules
+
+ statis(iel,ilpd) = statis(iel,ilpd) + tepa(npt,jrpoi)
+
+ if (iphyla.eq.1) then
+
+! * Moyenne et variance de la temperature
+
+ if ( itpvar .eq. 1 ) then
+
+ statis(iel,iltp) = statis(iel,iltp) &
+ + tepa(npt,jrpoi) * ettp(npt,jtp)
+
+ stativ(iel,iltp) = stativ(iel,iltp) &
+ + tepa(npt,jrpoi)*ettp(npt,jtp)*ettp(npt,jtp)
+
+ endif
+
+! * Moyenne et variance du diametre
+
+ if ( idpvar .eq. 1 ) then
+
+ statis(iel,ildp) = statis(iel,ildp) &
+ + tepa(npt,jrpoi) * ettp(npt,jdp)
+
+ stativ(iel,ildp) = stativ(iel,ildp) &
+ + tepa(npt,jrpoi)*ettp(npt,jdp)*ettp(npt,jdp)
+
+ endif
+
+! * Moyenne et variance de la masse
+
+ if ( impvar .eq. 1 ) then
+
+ statis(iel,ilmp) = statis(iel,ilmp) &
+ + tepa(npt,jrpoi) * ettp(npt,jmp)
+
+ stativ(iel,ilmp) = stativ(iel,ilmp) &
+ + tepa(npt,jrpoi)*ettp(npt,jmp)*ettp(npt,jmp)
+
+ endif
+
+ else if ( iphyla .eq. 2 ) then
+
+! * Moyenne et variance de la temperature
+! * Moyenne et variance de la masse de charbon reactif
+! * Moyenne et variance de la masse de coke
+! * Moyenne et variance du diametre du coeur retrecissant
+
+ statis(iel,ilhp) = statis(iel,ilhp) &
+ + tepa(npt,jrpoi) * ettp(npt,jhp)
+ statis(iel,ilmch) = statis(iel,ilmch) &
+ + tepa(npt,jrpoi) * ettp(npt,jmch)
+ statis(iel,ilmck) = statis(iel,ilmck) &
+ + tepa(npt,jrpoi) * ettp(npt,jmck)
+ statis(iel,ildck) = statis(iel,ildck) &
+ + tepa(npt,jrpoi) * tepa(npt,jrdck)
+
+ stativ(iel,ilhp) = stativ(iel,ilhp) &
+ + tepa(npt,jrpoi)*ettp(npt,jhp)*ettp(npt,jhp)
+ stativ(iel,ilmch) = stativ(iel,ilmch) &
+ + tepa(npt,jrpoi)*ettp(npt,jmch)*ettp(npt,jmch)
+ stativ(iel,ilmck) = stativ(iel,ilmck) &
+ + tepa(npt,jrpoi)*ettp(npt,jmck)*ettp(npt,jmck)
+ stativ(iel,ildck) = stativ(iel,ildck) &
+ + tepa(npt,jrpoi)*tepa(npt,jrdck)*tepa(npt,jrdck)
+
+ endif
+
+ endif
+
+enddo
+
+!===============================================================================
+! 2.2 - STATISTIQUES PAR GROUPE
+!===============================================================================
+
+if (nbclst.gt.0) then
+
+ do izcl = 1,nbclst
+
+ do npt = 1,nbpart
+
+ if (itepa(npt,jisor).gt.0 .and. &
+ itepa(npt,jclst).eq. izcl ) then
+
+! * Moyenne et variance des composantes de la vitesse
+
+ iel = itepa(npt,jisor)
+
+ ilvx1 = ilvx + izcl*nvlsta
+ ilvy1 = ilvy + izcl*nvlsta
+ ilvz1 = ilvz + izcl*nvlsta
+
+ statis(iel,ilvx1) = statis(iel,ilvx1) &
+ + tepa(npt,jrpoi) * ettp(npt,jup)
+ statis(iel,ilvy1) = statis(iel,ilvy1) &
+ + tepa(npt,jrpoi) * ettp(npt,jvp)
+ statis(iel,ilvz1) = statis(iel,ilvz1) &
+ + tepa(npt,jrpoi)*ettp(npt,jwp)
+
+ ilvx1 = ilvx + izcl*(nvlsta-1)
+ ilvy1 = ilvy + izcl*(nvlsta-1)
+ ilvz1 = ilvz + izcl*(nvlsta-1)
+
+ stativ(iel,ilvx1) = stativ(iel,ilvx1) &
+ + tepa(npt,jrpoi) * ettp(npt,jup) * ettp(npt,jup)
+ stativ(iel,ilvy1) = stativ(iel,ilvy1) &
+ + tepa(npt,jrpoi) * ettp(npt,jvp) * ettp(npt,jvp)
+ stativ(iel,ilvz1) = stativ(iel,ilvz1) &
+ + tepa(npt,jrpoi) * ettp(npt,jwp) * ettp(npt,jwp)
+
+! * Moyenne et variance du taux de presence
+
+
+ concen = (ettp(npt,jdp)**3) *pis6
+
+ ilfv1 = ilfv+izcl*nvlsta
+ statis(iel,ilfv1) = statis(iel,ilfv1) &
+ +tepa(npt,jrpoi)*concen
+
+ ilfv1 = ilfv+izcl*(nvlsta-1)
+ stativ(iel,ilfv1) = stativ(iel,ilfv1) &
+ +tepa(npt,jrpoi)*concen*concen
+
+! * Moyenne et variance du temps de s�jour
+
+ ilts1 = ilts+izcl*nvlsta
+ statis(iel,ilts1) = statis(iel,ilts1) &
+ + tepa(npt,jrpoi) * tepa(npt,jrtsp)
+
+ ilts1 = ilts+izcl*(nvlsta-1)
+ stativ(iel,ilts1) = stativ(iel,ilts1) &
+ + tepa(npt,jrpoi)*tepa(npt,jrtsp)*tepa(npt,jrtsp)
+
+! * Somme du poids statistiques associ� aux particules
+
+ ilpd1 = ilpd+izcl*nvlsta
+ statis(iel,ilpd1) = statis(iel,ilpd1) + tepa(npt,jrpoi)
+
+ if ( iphyla .eq. 1 ) then
+
+! * Moyenne et variance de la temperature
+
+ if ( itpvar .eq. 1 ) then
+
+ iltp1 = iltp+izcl*nvlsta
+ statis(iel,iltp1) = statis(iel,iltp1) &
+ + tepa(npt,jrpoi) * ettp(npt,jtp)
+
+ iltp1 = iltp+izcl*(nvlsta-1)
+ stativ(iel,iltp1) = stativ(iel,iltp1) &
+ + tepa(npt,jrpoi)*ettp(npt,jtp)*ettp(npt,jtp)
+
+ endif
+
+! * Moyenne et variance du diametre
+
+ if ( idpvar .eq. 1 ) then
+
+ ildp1 = ildp+izcl*nvlsta
+ statis(iel,ildp1) = statis(iel,ildp1) &
+ + tepa(npt,jrpoi) * ettp(npt,jdp)
+
+ ildp1 = ildp+izcl*(nvlsta-1)
+ stativ(iel,ildp1) = stativ(iel,ildp1) &
+ + tepa(npt,jrpoi)*ettp(npt,jdp)*ettp(npt,jdp)
+
+ endif
+
+! * Moyenne et variance de la masse
+
+ if ( impvar .eq. 1 ) then
+
+ ilmp1 = ilmp+izcl*nvlsta
+ statis(iel,ilmp1) = statis(iel,ilmp1) &
+ + tepa(npt,jrpoi) * ettp(npt,jmp)
+
+ ilmp1 = ilmp+izcl*(nvlsta-1)
+ stativ(iel,ilmp1) = stativ(iel,ilmp1) &
+ + tepa(npt,jrpoi)*ettp(npt,jmp)*ettp(npt,jmp)
+
+ endif
+
+ else if ( iphyla .eq. 2 ) then
+
+! * Moyenne et variance de la temperature
+! * Moyenne et variance de la masse de charbon reactif
+! * Moyenne et variance de la masse de coke
+! * Moyenne et variance du diametre du coeur retrecissant
+
+ ilhp1 = ilhp +izcl*nvlsta
+ ilmch1 = ilmch1+izcl*nvlsta
+ ilmck1 = ilmck1+izcl*nvlsta
+ ildck1 = ildck1+izcl*nvlsta
+
+ statis(iel,ilhp1) = statis(iel,ilhp1) &
+ + tepa(npt,jrpoi) * ettp(npt,jhp)
+ statis(iel,ilmch1) = statis(iel,ilmch1) &
+ + tepa(npt,jrpoi) * ettp(npt,jmch)
+ statis(iel,ilmck1) = statis(iel,ilmck1) &
+ + tepa(npt,jrpoi) * ettp(npt,jmck)
+ statis(iel,ildck1) = statis(iel,ildck1) &
+ + tepa(npt,jrpoi) * tepa(npt,jrdck)
+
+ ilhp1 = ilhp +izcl*(nvlsta-1)
+ ilmch1 = ilmch1+izcl*(nvlsta-1)
+ ilmck1 = ilmck1+izcl*(nvlsta-1)
+ ildck1 = ildck1+izcl*(nvlsta-1)
+
+ stativ(iel,ilhp1) = stativ(iel,ilhp1) &
+ + tepa(npt,jrpoi)*ettp(npt,jhp)*ettp(npt,jhp)
+ stativ(iel,ilmch1) = stativ(iel,ilmch1) &
+ + tepa(npt,jrpoi)*ettp(npt,jmch)*ettp(npt,jmch)
+ stativ(iel,ilmck1) = stativ(iel,ilmck1) &
+ + tepa(npt,jrpoi)*ettp(npt,jmck)*ettp(npt,jmck)
+ stativ(iel,ildck1) = stativ(iel,ildck1) &
+ + tepa(npt,jrpoi)*tepa(npt,jrdck)*tepa(npt,jrdck)
+
+ endif
+
+ endif
+
+ enddo
+
+ enddo
+
+endif
+
+!===============================================================================
+
+!====
+! FIN
+!====
+
+end
diff --git a/src/lagr/lagstf.f90 b/src/lagr/lagstf.f90
new file mode 100644
index 0000000..f11a8b1
--- /dev/null
+++ b/src/lagr/lagstf.f90
@@ -0,0 +1,157 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagstf &
+!================
+
+ ( ncelet , nfabor , nvisbr , &
+ ivar , &
+ gmin , gmax , gmoy , &
+ parbor , unsnbr )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! CALCUL DES VALEURS MIN MAX ET MOYENNE POUR LES
+! STATISTIQUES AUX FRONTIERES.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! ivar ! e ! <-- ! numero de la variable a integrer !
+! gmin...gmoy ! e ! --> ! variations min max et moyenne !
+! parbor ! tr ! <-- ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! unsnbr(nfabor ! e ! <-- ! inverse du nombre interaction !
+! ! ! ! frontiere pour moyenne !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet , nfabor , nvisbr
+integer ivar
+double precision gmax , gmin , gmoy
+double precision parbor(nfabor, nvisbr), unsnbr(nfabor)
+
+! VARIABLES LOCALES
+
+integer nbrfac , ifac
+
+!==============================================================================
+
+
+nbrfac = 0
+
+gmax = -grand
+gmin = grand
+gmoy = 0.d0
+
+if (imoybr(ivar).eq.2) then
+
+ do ifac = 1,nfabor
+ if (parbor(ifac,inbr).gt.seuilf) then
+ nbrfac = nbrfac + 1
+ gmax = max (gmax, parbor(ifac,ivar)*unsnbr(ifac))
+ gmin = min (gmin, parbor(ifac,ivar)*unsnbr(ifac))
+ gmoy = gmoy + (parbor(ifac,ivar)*unsnbr(ifac))
+ endif
+ enddo
+
+else if (imoybr(ivar).eq.1) then
+
+ do ifac = 1,nfabor
+ if (parbor(ifac,inbr).gt.seuilf) then
+ nbrfac = nbrfac + 1
+ gmax = max (gmax, parbor(ifac,ivar)/tstatp)
+ gmin = min (gmin, parbor(ifac,ivar)/tstatp)
+ gmoy = gmoy + (parbor(ifac,ivar)/tstatp)
+ endif
+ enddo
+
+else if (imoybr(ivar).eq.0) then
+
+ do ifac = 1,nfabor
+ if (parbor(ifac,inbr).gt.seuilf) then
+ nbrfac = nbrfac + 1
+ gmax = max (gmax, parbor(ifac,ivar))
+ gmin = min (gmin, parbor(ifac,ivar))
+ gmoy = gmoy + parbor(ifac,ivar)
+ endif
+ enddo
+
+endif
+
+if (nbrfac.gt.0) then
+ gmoy = gmoy /dble(nbrfac)
+else
+ gmax = 0.d0
+ gmin = 0.d0
+ gmoy = 0.d0
+endif
+
+!-------
+! FORMAT
+!-------
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/lagr/lagtri.f90 b/src/lagr/lagtri.f90
new file mode 100644
index 0000000..06b53df
--- /dev/null
+++ b/src/lagr/lagtri.f90
@@ -0,0 +1,155 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine lagtri
+!================
+
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! La liste des particules a visualiser est donnee par l'utilisateur
+! dans USLAG1. Cette subroutine verifie cette liste :
+! 1. elle suprime les trous dans le tableau,
+! 2. suprime les doublons,
+! 3. range les particules a visualiser par ordre croissant.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ! ! ! !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer i , i1 , i2 , ii , ind , j , tlist(nliste)
+
+!===============================================================================
+
+!... VERIFICATION DES NUMEROS DES PARTICULES DESIREES
+
+ind = 0
+do i = 1,nliste
+ tlist (i) = -1
+ if ( liste (i).gt.0 ) then
+ ind = ind + 1
+ tlist (ind) = liste (i)
+ endif
+enddo
+
+!... RANGEMENT DU TABLEAU LISTE SANS TROU
+
+do i = 1,nliste
+ liste (i) = tlist (i)
+enddo
+
+!... RANGEMENT DU TABLEAU LISTE SANS REPETITION
+
+i1 = 0
+do i = 1,ind
+ ii = liste (i)
+ if ( ii .gt. 0 ) then
+ do j = i+1, ind
+ if ( ii.eq.liste (j) ) then
+ liste (j) = -1
+ i1 = i1 + 1
+ endif
+ enddo
+ endif
+enddo
+
+if ( i1.gt.0 ) then
+ i2 = 0
+ do i = 1,ind
+ tlist (i) = -1
+ if ( liste (i).gt.0 ) then
+ i2 = i2 + 1
+ tlist (i2) = liste (i)
+ endif
+ enddo
+ ind = i2
+ do i = 1,ind
+ liste (i) = tlist (i)
+ enddo
+ do i = ind+1,nliste
+ liste (i) = -1
+ enddo
+endif
+
+!... RANGEMENT DU TABLEAU LISTE PAR ORDRE CROISSANT
+
+i = 1
+ 50 continue
+i2 = i + 1
+if ( liste (i2).gt.0 .and. &
+ liste (i2).lt.liste (i) ) then
+ i1 = liste (i)
+ liste (i) = liste (i2)
+ liste (i2) = i1
+ i = 1
+ goto 50
+else
+ i = i2
+ if ( i.lt.ind ) goto 50
+endif
+
+if ( ind.gt.nbvis ) then
+ do i = ind+1,nliste
+ liste (i) = -1
+ enddo
+endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/lagune.f90 b/src/lagr/lagune.f90
new file mode 100644
index 0000000..a0fbda5
--- /dev/null
+++ b/src/lagr/lagune.f90
@@ -0,0 +1,1044 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine lagune &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icocel , itycel , ifrlag , itepa , indep , ibord , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , statis , stativ , tslagr , parbor , &
+ taup , tlag , piil , bx , vagaus , tsuf , tsup , &
+ tsvar , tempct , tsfext , cpgd1 , cpgd2 , cpght , &
+ gradpr , gradvf , croule , brgaus , terbru , &
+ w1 , w2 , w3 , auxl , auxl2 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Sous-programme principal du module de modelisation Lagrangienne
+! des ecoulements diphasiques a inclusions dispersees.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icocel ! te ! --> ! connectivite cellules -> faces !
+! (lndnod) ! ! ! face de bord si numero negatif !
+! itycel ! te ! --> ! connectivite cellules -> faces !
+! (ncelet+1) ! ! ! pointeur du tableau icocel !
+! ifrlag ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module lagrangien !
+! itepa ! te ! --> ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! indep ! te ! --> ! pour chaque particule : !
+! (nbpmax) ! ! ! numero de la cellule de depart !
+! ibord ! te ! --> ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant et prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! --> ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! --> ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! --> ! moyennes statistiques !
+!(ncelet,nvlsta ! ! ! !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! tslagr ! tr ! --> ! terme de couplage retour du !
+!(ncelet,ntersl ! ! ! lagrangien sur la phase porteuse !
+! parbor ! tr ! --> ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! taup(nbpmax) ! tr ! --> ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! --> ! temps caracteristique fluide !
+! piil(nbpmax,3 ! tr ! --> ! terme dans l'integration des eds up !
+! bx(nbpmax,3,2 ! tr ! --> ! caracteristiques de la turbulence !
+! vagaus ! tr ! --> ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! tsup(nbpmax,3 ! tr ! --> ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse des particules !
+! tsuf(nbpmax,3 ! tr ! --> ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse du fluide vu !
+! tsvar ! tr ! --> ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable courante, utilise pour la !
+! tempct ! tr ! --> ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! tsfext(nbpmax ! tr ! --> ! forces externes !
+! cpgd1,cpgd2, ! tr ! --> ! termes de devolatilisation 1 et 2 et !
+! cpght(nbpmax ! ! ! de combusion heterogene (charbon !
+! ! ! ! avec couplage retour thermique) !
+! gradpr(ncel,3 ! tr ! --> ! gradient de pression !
+! gradvf(ncel,9 ! tr ! --> ! gradient de vitesse fluide !
+! croule ! tr ! --> ! fonction d'importance pour roulette !
+! (ncelet) ! ! ! russe !
+! w1..w3(ncelet ! tr ! --- ! tableaux de travail !
+! auxl(nbpmax,3 ! tr ! --- ! tableau de travail !
+! auxl2 ! tr ! --- ! tableau de travail !
+! (nbpmax,7) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer icocel(lndnod) , itycel(ncelet+1)
+integer ifrlag(nfabor) , itepa(nbpmax,nivep)
+integer indep(nbpmax) , ibord(nbpmax)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision tslagr(ncelet,ntersl)
+double precision parbor(nfabor,nvisbr)
+double precision taup(nbpmax) , tlag(nbpmax,3) , piil(nbpmax,3)
+double precision vagaus(nbpmax,*) , bx(nbpmax,3,2)
+double precision tsuf(nbpmax,3) , tsup(nbpmax,3)
+double precision tsvar(nbpmax,nvp1)
+double precision tempct(nbpmax,2) , tsfext(nbpmax)
+double precision cpgd1(nbpmax) , cpgd2(nbpmax) , cpght(nbpmax)
+double precision brgaus(nbpmax,*) , terbru(nbpmax)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision croule(ncelet)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision auxl(nbpmax,3) , auxl2(nbpmax,7)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifinia, ifinra
+
+integer ip , npt , iok
+integer nfin , npars , iel , ivf
+integer npar1 , npar2
+integer iforce , iitslg
+integer modntl
+
+double precision dnpars
+
+! NOMBRE DE PASSAGES DANS LA ROUTINE
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+!===============================================================================
+! 0. GESTION MEMOIRE ET COMPTEUR DE PASSAGE
+!===============================================================================
+
+ipass = ipass + 1
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+iplar = iplar + 1
+iplas = iplas + 1
+
+nbpnew = 0
+npcsup = 0
+npclon = 0
+npkill = 0
+npencr = 0
+nbpout = 0
+nbperr = 0
+
+dnbpnw = 0.d0
+dnpcsu = 0.d0
+dnpclo = 0.d0
+dnpkil = 0.d0
+dnpenc = 0.d0
+dnbpou = 0.d0
+dnbper = 0.d0
+
+!-->Sur Champ fige Lagrangien : RTPA = RTP
+! Rem : cette boucle pourrait etre faite au 1er passage
+! mais la presence de usproj incite a la prudence...
+
+if (iilagr.eq.3) then
+ do ivf = 1,nvar
+ do iel = 1,ncel
+ rtpa(iel,ivf) = rtp(iel,ivf)
+ enddo
+ enddo
+endif
+
+!-->au premier passage relatif :
+
+if (iplar.eq.1) then
+
+! Connectivite cellules -> faces
+
+ call lagdeb &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icocel , itycel , &
+ idevel , ituser , ia , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+!===============================================================================
+! 2. MISE A JOUR DES NOUVELLES PARTICULES ENTREES DANS LE DOMAINE
+!===============================================================================
+
+! Au premier pas de temps on initalise les particules avec RTP et
+! non RTPA car RTPA = initialisation
+
+if ( ntcabs.eq.1 ) then
+
+ call lagent &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itycel , icocel , &
+ ia(iitypf) , ia(iitrif) , ifrlag , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(isrfbn) , dt , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , vagaus , auxl , w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+else
+
+ call lagent &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itycel , icocel , &
+ ia(iitypf) , ia(iitrif) , ifrlag , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(isrfbn) , dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , vagaus , auxl , w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+endif
+
+!===============================================================================
+! 2.1 CALCUL DE LA FONCTION D'IMPORTANCE POUR LA ROULETTE RUSSE
+!===============================================================================
+
+if (iroule.ge.1) then
+
+ call uslaru &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iitypf) , ia(iitrif) , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(isrfbn) , dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , vagaus , croule , auxl , &
+ ra(idipar) , ra(iyppar) , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+ iok = 0
+ do iel = 1,ncel
+ if (croule(iel).le.0.d0) iok = iok + 1
+ enddo
+ if (iok.ne.0) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+ endif
+
+endif
+
+!===============================================================================
+! 3. GESTION DU TEMPS QUI PASSE...
+!===============================================================================
+
+!-->Gestion du pas de temps Lagrangien
+
+dtp = dtref
+
+!-->Incrementation du TEMPS COURANT LAGRANGIEN
+
+ttclag = ttclag + dtp
+
+!-->Test pour savoir si le domaine contient des particules
+
+if (nbpart.eq.0) goto 20
+
+!-->On enregistre l'element de depart de la particule
+
+do ip = 1,nbpart
+ indep(ip) = itepa(ip,jisor)
+enddo
+
+!===============================================================================
+! 4. GRADIENT DE PRESSION ET DE LA VITESSE FLUIDE
+!===============================================================================
+
+! Au premier pas de temps on calcul les gradient avec RTP et
+! non RTPA car RTPA = initialisation (gradients nuls)
+
+if ( ntcabs.eq.1 ) then
+
+ call laggra &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , propce , coefa , coefb , &
+ gradpr , gradvf , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+else
+
+ call laggra &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtpa , propce , coefa , coefb , &
+ gradpr , gradvf , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 4. Initialisation des variables aleatoires gaussiennes
+!===============================================================================
+
+!---> CALCUL DES TIRAGES ALEATOIRES
+! remarque : NORMALEN est dans le fichier ZUFALL.F
+! ^^^^^^^^
+
+if (idistu.eq.1) then
+ do ivf = 1,nvgaus
+ call normalen(nbpart, vagaus(1,ivf))
+ enddo
+else
+ do ivf = 1,nvgaus
+ do ip = 1,nbpmax
+ vagaus(ip,ivf) = 0.d0
+ enddo
+ enddo
+endif
+
+!---> CALCUL DES TIRAGES ALEATOIRES POUR LE MVT BROWNIEN
+
+if ( lamvbr .eq. 1 ) then
+
+ do ivf = 1,nbrgau
+ call normalen(nbpart, brgaus(1,ivf))
+ enddo
+
+endif
+
+!===============================================================================
+! 5. PROGRESSION DES PARTICULES
+!===============================================================================
+
+ 10 continue
+
+nor = mod(nor,nordre)
+nor = nor + 1
+
+!---> Recopie des resultats de l'etape precedente :
+
+if (nor.eq.1) then
+
+ do ivf = 1,nvp
+ do ip = 1,nbpart
+ ettpa(ip,ivf) = ettp(ip,ivf)
+ enddo
+ enddo
+
+endif
+
+!-----> CALCUL GRADIENT DE PRESSION ET DE LA VITESSE FLUIDE
+! EN N+1 (avec RTP)
+
+if (nor.eq.2 .and. iilagr.ne.3) then
+
+ call laggra &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rtp , propce , coefa , coefb , &
+ gradpr , gradvf , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!-----> CALCUL DES CARACTERISTIQUES DES PARTICULES
+
+if (nor.eq.1) then
+
+! sous pas de temps n (avec RTPA)
+
+ call lagcar &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , dt , rtpa , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , &
+ piil , bx , tempct , statis , &
+ gradpr , gradvf , w1 , w2 , auxl(1,1) , &
+ rdevel , rtuser , ra )
+
+else
+
+! sous pas de temps n+1 (avec RTP)
+
+ call lagcar &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , &
+ piil , bx , tempct , statis , &
+ gradpr , gradvf , w1 , w2 , auxl(1,1) , &
+ rdevel , rtuser , ra )
+
+endif
+
+
+!---> INTEGRATION DES EQUATIONS DIFFERENTIELLES STOCHASTIQUES
+! POSITION, VITESSE FLUIDE, VITESSE PARTICULE
+
+call lagesp &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , &
+ statis , stativ , taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , &
+ vagaus , gradpr , gradvf , brgaus , terbru , &
+ auxl(1,1) , auxl2 , rdevel , rtuser , ra )
+
+!---> INTEGRATION DES EQUATIONS DIFFERENTIELLES STOCHASTIQUES
+! LIEES AUX PHYSIQUES PARTICULIERES PARTICULAIRES
+
+if ( iphyla.eq.1 .or. iphyla.eq.2 ) then
+
+ if ( nor.eq.1 ) then
+ call lagphy &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl , cpgd1 , cpgd2 , cpght , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+ else
+ call lagphy &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ tsvar , auxl , cpgd1 , cpgd2 , cpght , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+ endif
+
+endif
+
+!===============================================================================
+! 6. Couplage Retour - Calcul des termes sources
+!===============================================================================
+
+if (iilagr.eq.2 .and. nor.eq.nordre) then
+
+ ifinia = idebia
+ iitslg = idebra
+ ifinra = iitslg + ntersl*nbpmax
+ CALL RASIZE('LAGUNE',IFINRA)
+ !==========
+
+ call lagcou &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , indep , ibord , &
+ idevel , ituser , ia , &
+ volume , rtp , propce , &
+ ettp , ettpa , tepa , taup , &
+ tempct , tsfext , tslagr , &
+ cpgd1 , cpgd2 , cpght , &
+ ra(iitslg) , w1 , w2 , &
+ auxl(1,1) , auxl(1,2) , auxl(1,3) , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 7. Reperage des particules - Traitement des conditions aux limites
+! pour la position des particules
+!===============================================================================
+
+if (nor.eq.1) then
+
+ call lagcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ia(iitypf) , ia(iitrif) , &
+ icocel , itycel , ifrlag , itepa , ibord , indep , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(isrfbn) , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , parbor , auxl , &
+ rdevel , rtuser , ra )
+
+ if (ierr.eq.1) then
+ call lagerr
+ !==========
+ goto 20
+ endif
+
+endif
+
+!===============================================================================
+! 9. ELIMINATION DES PARTICULES QUI SONT SORTIES DU DOMAINE
+!===============================================================================
+
+! ATTENTION : NBPOUT contient les particules sorties de facon
+! normal + les particules sorties en erreur de reperage.
+
+if (nor.eq.nordre) then
+
+ call lageli &
+ !==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ npars , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ dnpars , &
+ ettp , ettpa , tepa , &
+ rdevel , rtuser , ra )
+
+ nbpout = npars
+ dnbpou = dnpars
+
+endif
+
+!===============================================================================
+! 10. TEMPS DE SEJOUR
+!===============================================================================
+
+if (nor.eq.nordre) then
+
+ do npt = 1,nbpart
+ if ( itepa(npt,jisor).gt.0 ) then
+ tepa(npt,jrtsp) = tepa(npt,jrtsp) + dtp
+ endif
+ enddo
+
+endif
+
+!===============================================================================
+! 11. CALCUL STATISTIQUES
+!===============================================================================
+
+if (nor.eq.nordre .and. istala.eq.1 .and. iplas.ge.idstnt) then
+
+ call lagsta &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , tepa , statis , stativ , &
+ w1 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 12. Equation de Poisson
+!===============================================================================
+
+if (nor.eq.nordre .and. ilapoi.eq.1) then
+
+ call lagpoi &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icocel , itycel , ifrlag , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , statis , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+! 13. Methode de reduction de variances : Clonage/Fusion des particules
+!===============================================================================
+
+if ( nor.eq.nordre .and. iroule.ge.1 ) then
+
+ call lagrus &
+ !==========
+ ( idebia , idebra , &
+ ncelet , ncel , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , indep , &
+ idevel , ituser , ia , &
+ ettp , ettpa , tepa , croule , &
+ rdevel , rtuser , ra )
+
+ if (npclon.gt.0) then
+
+ npar1 = nbpart - npclon + 1
+ npar2 = nbpart
+
+ call lagipn &
+ !==========
+ ( idebia , idebra , &
+ ncelet , ncel , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npar1 , npar2 , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ rtp , &
+ ettp , tepa , vagaus , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+endif
+
+!===============================================================================
+! 14. UN AUTRE TOUR ?
+!===============================================================================
+
+if (nordre.eq.2 .and. nor.eq.1) goto 10
+
+!===============================================================================
+! 15. BRANCHEMENT UTILISATEUR POUR MODIF DES VARIABLES EVENTUELLES
+! EN FIN D'ITERATION LAGRANGIENNE
+!===============================================================================
+
+call uslast &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ statis , stativ , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 16. Visualisations
+!===============================================================================
+
+ 20 continue
+
+nfin = 0
+
+!-->Stockage des trajectoires au format Ensight Gold
+
+if (iensi1.eq.1) then
+
+ iforce = 0
+
+ call enslag &
+ !==========
+ ( idebia , idebra , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , iforce , &
+ itepa , &
+ ettp , tepa , ra )
+endif
+
+if (iensi2.eq.1) then
+ call enswaf &
+ !==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , &
+ itepa , &
+ ettp , tepa , auxl )
+endif
+
+!===============================================================================
+! 17. NOMBRE DE PARITICULES PERDUES (SUITES COMPRISES)
+!===============================================================================
+
+nbpert = nbpert + nbperr
+
+!===============================================================================
+! 18. ECRITURE SUR FICHIERS DES INFORMATIONS SUR LE NOMBRE DE PARTICULES
+! - nombre de particules dans le domaine
+! - nombre de particules entrantes
+! - nombre de particules sorties
+! - ...
+
+!===============================================================================
+
+if (ipass.eq.1) then
+ modntl = 0
+elseif(ntlal.gt.0) then
+ modntl = mod(ntcabs,ntlal)
+elseif(ntlal.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+else
+ modntl = 1
+endif
+
+if (modntl.eq.0) then
+ call lagaff &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , statis , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LA TECHNIQUE DE CLONAGE/FUSION DES PARTICULES ',/,&
+'@ EST ENCLENCHEE AVEC UNE FONCTION D''IMPORTANCE ',/,&
+'@ COMPORTANT DES VALEURS NEGATIVES OU NULLES ',/,&
+'@ (LAGUNE). ',/,&
+'@ ',/,&
+'@ LES ELEMENTS DU TABLEAU CROULE DOIVENT STRICTEMENT ',/,&
+'@ POSITIFS. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs de CROULE dans la subroutine USLARU. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/lagr/memla1.f90 b/src/lagr/memla1.f90
new file mode 100644
index 0000000..c4203da
--- /dev/null
+++ b/src/lagr/memla1.f90
@@ -0,0 +1,189 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memla1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ lndnod , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ iiitep , iicoce , iityce , &
+ iettp , iettpa , iitepa , istatc , istatv , &
+ itslag , istatf , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Reservation de la memoire pour les tableaux qui doivent
+! etre conserves en dehors de la boucle en temps, notamment
+! pour le post-processing.
+
+! Remarque : tous les tableaux ouverts ici doivent
+! recevoir une initialisation de valeurs
+! par defaut dans le sous-programme LAGLEC
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! pointeur de la premiere cas libre !
+! ! ! ! dans ia en entree !
+! idbra0 ! e ! <-- ! pointeur de la premiere cas libre !
+! ! ! ! dans ra en entree !
+! ndim ! e ! <-- ! dimension (3) !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! iiitep ! e ! --> ! pointeur sur itepa !
+! iicoce ! e ! --> ! pointeur sur icocel !
+! iityce ! e ! --> ! pointeur sur itycel !
+! iettp ! e ! --> ! pointeur sur ettp !
+! iettpa ! e ! --> ! pointeur sur ettpa (simple init. ici) !
+! iitepa ! e ! --> ! pointeur sur tepa !
+! istatc ! e ! --> ! pointeur sur statis !
+! itslag ! e ! --> ! pointeur sur tslagr !
+! istatf ! e ! --> ! pointeur sur parbor !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ra en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer lndnod
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer iiitep , iicoce , iityce
+integer iettp , iettpa
+integer iitepa , istatc , istatv , itslag , istatf
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+!===============================================================================
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+
+! IETTPA est simplement initialise ici, pour eviter un arret avec les
+! options de compilation check bounds. La reservation memoire
+! correspondante est faite dans memla2.
+
+idebia = idbia0
+idebra = idbra0
+
+
+if (iilagr.eq.0) then
+
+ iiitep = idebia
+ iicoce = iiitep
+ iityce = iicoce
+ iifrla = iityce
+ ifinia = iifrla
+
+ iettpa = idebra
+ iettp = iettpa
+ iitepa = iettp
+ istatc = iitepa
+ istatv = istatc
+ itslag = istatv
+ istatf = itslag
+ ifinra = istatf
+
+else
+
+ iiitep = idebia
+ iicoce = iiitep + nbpmax * nivep
+ iityce = iicoce + lndnod
+ iifrla = iityce + ncelet + 1
+ ifinia = iifrla + nfabor
+
+ iettpa = idebra
+ iettp = iettpa
+ iitepa = iettp + nbpmax * nvp
+ istatc = iitepa + nbpmax * nvep
+ istatv = istatc + ncelet * nvlsta &
+ + ncelet * nvlsta * nbclst
+ itslag = istatv + ncelet * max((nvlsta-1),0) &
+ + ncelet * max((nvlsta-1),0) * nbclst
+ istatf = itslag + ntersl * ncelet
+ ifinra = istatf + nfabor * nvisbr
+
+endif
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMLA1',IFINIA)
+!==========
+
+CALL RASIZE('MEMLA1',IFINRA)
+!==========
+
+return
+end
diff --git a/src/lagr/memla2.f90 b/src/lagr/memla2.f90
new file mode 100644
index 0000000..a5ab7f8
--- /dev/null
+++ b/src/lagr/memla2.f90
@@ -0,0 +1,236 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memla2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ nfabor , ncelet , nfac , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ iindep , iibord , iettpa , iauxl , iauxl2 , &
+ itaup , iitlag , ipiil , &
+ ivagau , itsuf , itsup , ibx , &
+ igradp , igradv , icroul , &
+ itepct , itsfex , itsvar , &
+ icpgd1 , icpgd2 , icpght , &
+ ibrgau , itebru , &
+ iw1 , iw2 , iw3 , &
+ ifinia , ifinra )
+
+
+!===============================================================================
+! FONCTION
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! Reservation de la memoire pour les tableaux qui ne doivent pas
+! etre conserves en dehors de la boucle en temps.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0/idbra0 ! tr ! <-- ! pointeur de la premiere cas libre des !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! ncelet ! e ! <-- ! nombre d'elements !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! iindep ! e ! --> ! pointeur sur indep (num cel de depart !
+! iibord ! e ! --> ! pointeur sur ibord !
+! iettpa ! e ! --> ! pointeur sur ettpa !
+! iauxl ! e ! --> ! pointeur sur auxl !
+! iauxl2 ! e ! --> ! pointeur sur auxl2 !
+! itaup ! e ! --> ! pointeur sur taup !
+! iitlag ! e ! --> ! pointeur sur tlag !
+! ipiil ! e ! --> ! pointeur sur piil !
+! ivagau ! e ! --> ! pointeur sur vagaus !
+! itsuf ! e ! --> ! pointeur sur tsuf !
+! itsup ! e ! --> ! pointeur sur tsup !
+! ibx ! e ! --> ! pointeur sur bx !
+! igradp ! e ! --> ! pointeur sur gradpr !
+! igradv ! e ! --> ! pointeur sur gradvf !
+! icroul ! e ! --> ! pointeur sur croule !
+! itepct ! e ! --> ! pointeur sur tempct !
+! itsfex ! e ! --> ! pointeur sur tsfext !
+! itsvar ! e ! --> ! pointeur sur tsvar !
+! icpgd1 ! e ! --> ! pointeur sur cpgd1 !
+! icpgd2 ! e ! --> ! pointeur sur cpgd2 !
+! icpght ! e ! --> ! pointeur sur cpght !
+! iw1 ! e ! --> ! pointeur sur w1 !
+! iw2 ! e ! --> ! pointeur sur w2 !
+! iw3 ! e ! --> ! pointeur sur w3 !
+! ! ! ! !
+! ! tr ! ! tableaux ia/ra !
+! ifinia ! tr ! --> ! pointeur de la premiere cas libre dan !
+! ! tr ! ! dans ia en sortie !
+! ifinra ! tr ! --> ! pointeur de la premiere cas libre dan !
+! ! tr ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer nfabor , ncelet , nfac
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer iindep , iibord , iettpa , iauxl , iauxl2
+integer itaup , iitlag , ipiil
+integer ivagau , itsuf , itsup , ibx
+integer igradp , igradv , icroul
+integer itepct , itsfex , itsvar
+integer icpgd1 , icpgd2 , icpght
+integer ibrgau , itebru
+integer iw1 , iw2 , iw3
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+
+iibord = idebia
+ifinia = iibord + nbpmax
+
+iindep = ifinia
+ifinia = iindep + nbpmax
+
+iettpa = idebra
+iauxl = iettpa + nbpmax * nvp
+itaup = iauxl + nbpmax * 3
+iitlag = itaup + nbpmax
+ipiil = iitlag + nbpmax * 3
+ivagau = ipiil + nbpmax * 3
+itsuf = ivagau + nbpmax * nvgaus
+itsup = itsuf + nbpmax * 3
+ibx = itsup + nbpmax * 3
+itsvar = ibx + nbpmax * 3 * 2
+igradp = itsvar + nbpmax * nvp1
+iw1 = igradp + ncelet * 3
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+ifinra = iw3 + ncelet
+
+if ( (iphyla.eq.1 .and. itpvar.eq.1) .or. &
+ iphyla.eq.2 ) then
+ itepct = ifinra
+ ifinra = itepct + 2*nbpmax
+else
+ itepct = 1
+endif
+
+if (iilagr.eq.2) then
+ itsfex = ifinra
+ ifinra = itsfex + nbpmax
+else
+ itsfex = 1
+endif
+
+if ( iilagr.eq.2 .and. iphyla.eq.2 &
+ .and. ltsthe .eq.1 ) then
+ icpgd1 = ifinra
+ icpgd2 = icpgd1 + nbpmax
+ icpght = icpgd2 + nbpmax
+ ifinra = icpght + nbpmax
+else
+ icpgd1 = 1
+ icpgd2 = 1
+ icpght = 1
+endif
+
+if (modcpl.gt.0) then
+ igradv = ifinra
+ ifinra = igradv + ncelet * 9
+else
+ igradv = 1
+endif
+
+if (iroule.eq.1) then
+ icroul = ifinra
+ ifinra = icroul + ncelet
+else
+ icroul = 1
+endif
+
+if ( lamvbr .eq. 1 ) then
+ ibrgau = ifinra
+ itebru = ibrgau + nbpmax * nbrgau
+ ifinra = itebru + nbpmax
+else
+ ibrgau = 1
+endif
+
+if (nordre.eq.2) then
+ iauxl2 = ifinra
+ ifinra = iauxl2 + nbpmax*7
+else
+ iauxl2 = 1
+endif
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMLA2',IFINIA)
+! ==========
+
+CALL RASIZE('MEMLA2',IFINRA)
+! ==========
+
+return
+end
diff --git a/src/lagr/ouestu.f90 b/src/lagr/ouestu.f90
new file mode 100644
index 0000000..afad20e
--- /dev/null
+++ b/src/lagr/ouestu.f90
@@ -0,0 +1,585 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ouestu &
+!================
+
+ ( nfecra , ndim , npoint , &
+ ierror , &
+ px , py , pz , &
+ qx , qy , qz , &
+ cdgx , cdgy , cdgz , &
+ celx , cely , celz , &
+ itypf7 , iconf7 , xyznod , &
+ indian )
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! reperage d'une particule par rapport a une face :
+! soient P le point de depart de la particule
+! et Q le point d'arrivee ; on obtient :
+
+! INDIAN = 0 le rayon PQ ne sort pas de la cellule par cette face
+! INDIAN = -1 meme cellule
+! INDIAN = 1 sortie de la cellule par cette face
+
+! ATTENTION : POUR UTILISER CES SUBROUTINE DE REPERAGE, IL EST
+! NECESSAIRE QUE LE TYPE DOUBLE PRECISION SOIT CODE SUR 8 OCTETS,
+! i.e. DOUBLE PRECISION = REAL*8
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nfecra ! e ! <-- ! unite du fichier de sortie listing !
+! ndim ! e ! <-- ! dimension de l'espace (=3) !
+! npoint ! e ! <-- ! nombre de noeuds !
+! ierror ! e ! --> ! indicateur d'erreur !
+! px,py,pz ! r ! <-- ! point de depart de la particule !
+! qx,qy,qz ! r ! <-- ! point de d'arrive de la particule !
+! cdgx,..,cdgz ! r ! <-- ! centre de gravite de la face !
+! celx,..,celz ! r ! <-- ! centre de gravite de la cellule !
+! ! ! ! contenant le point de depart !
+! itypf7 ! e ! <-- ! nombre de points support de la face !
+! iconf7(itypf7 ! e ! <-- ! numero des points support !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! indian ! e ! --> ! indicateur d'orientation !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "cstnum.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nfecra , ndim , npoint
+integer indian , ierror
+integer itypf7 , iconf7(itypf7)
+
+double precision px , py , pz
+double precision qx , qy , qz
+double precision cdgx , cdgy , cdgz
+double precision celx , cely , celz
+double precision xyznod(ndim,npoint)
+
+! VARIABLES LOCALES
+
+integer in , is , isign , il , it , ii
+integer ijklug , ittour , ipturb , isensf , ipos
+
+double precision valmax
+double precision cr1x , cr1y , cr1z
+double precision cr2x , cr2y , cr2z
+
+!===============================================================================
+
+
+!===============================================================================
+! -1. MACRO DE DEBUGGAGE DEVELOPPEUR
+!===============================================================================
+
+! ATTENTION INTERVENTION DEVELOPPEUR UNIQUEMENT.
+
+! Si cette macro est vrai elle permet les impressions
+! dans le listing du detail des erreurs de reperage.
+
+! PAR DEFAUT : DEBUG_OUESTU = 0
+
+
+#define DEBUG_OUESTU 0
+
+!===============================================================================
+! 0. Initialisations
+!===============================================================================
+
+ierror = 0
+
+ittour = 0
+
+indian = 0
+
+ijklug = 0
+
+ipturb = 0
+
+! Calcul de ValMax en local : VALEUR MAX POUR L'ARRONDI
+
+valmax = epzero
+
+! ---> Face
+do is = 1,itypf7
+
+ ii = iconf7(is)
+ do il = 1,3
+ valmax = max( valmax,abs( xyznod(il,ii) ) )
+ enddo
+
+enddo
+
+! ---> Centre de gravite de la face
+valmax = max(valmax,abs(cdgx))
+valmax = max(valmax,abs(cdgy))
+valmax = max(valmax,abs(cdgz))
+
+! ---> Centre de gravite de la cellule de depart
+valmax = max(valmax,abs(celx))
+valmax = max(valmax,abs(cely))
+valmax = max(valmax,abs(celz))
+
+! ---> Point de depart de la particule
+valmax = max(valmax,abs(px))
+valmax = max(valmax,abs(py))
+valmax = max(valmax,abs(pz))
+
+! ---> Point d'arrivee de la particule
+valmax = max(valmax,abs(qx))
+valmax = max(valmax,abs(qy))
+valmax = max(valmax,abs(qz))
+
+!===============================================================================
+! 1. Position relative de P et Q : les 2 points sont-ils confondus ?
+!===============================================================================
+
+call coloca &
+!==========
+ ( valmax , &
+ px , py , pz , &
+ qx , qy , qz , &
+ ipos )
+
+!--> Si P et Q sont confondus, la particule est dans le meme cellule
+
+if (ipos.eq.1) then
+ indian = -1
+ return
+endif
+
+!===============================================================================
+! 2. Verification de l'orientation de la face
+!===============================================================================
+
+! Ici on verifie dans quel sens sont lus les points
+! de la face par rapport a la cellule dans laquelle
+! se trouve la particule (au point P)
+! "bien" orientee : ISENSF = 1
+! "mal" orientee : ISENSF = -1
+
+!--> Coordonnees du premier point support S(1) de la face
+
+ii = iconf7(1)
+cr1x = xyznod(1,ii)
+cr1y = xyznod(2,ii)
+cr1z = xyznod(3,ii)
+
+!--> Coordonnees du deuxieme point support S(2) de la face
+
+ii = iconf7(2)
+cr2x = xyznod(1,ii)
+cr2y = xyznod(2,ii)
+cr2z = xyznod(3,ii)
+
+!--> Orientation de PgS(1)S(2)
+
+call coturn &
+!==========
+ ( valmax , &
+ px , py , pz , &
+ cdgx , cdgy , cdgz , &
+ cr1x , cr1y , cr1z , &
+ cr2x , cr2y , cr2z , &
+ isensf , ipturb )
+
+!--> Si l'orientation precedente a echouee, on en essaie une autre,
+! mais elle est dangereuse dans le cas des cellules convaves.
+
+! En periodicite, on force ISENSF a zero a cause d'un probleme
+! potentiel de reperage des particules dans le cas contraire
+! (FIXME: determiner la source du probleme)
+if (iperio.eq.1) isensf = 0
+
+if (isensf.eq.0) then
+
+!--> Orientation de GgS(1)S(2)
+
+ call coturn &
+ !==========
+ ( valmax , &
+ celx , cely , celz , &
+ cdgx , cdgy , cdgz , &
+ cr1x , cr1y , cr1z , &
+ cr2x , cr2y , cr2z , &
+ isensf , ipturb )
+
+endif
+
+if (isensf.eq.0) then
+#if DEBUG_OUESTU
+ write(nfecra,1010)
+#endif
+ ierror = 1
+ return
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if DEBUG_OUESTU
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR DANS LE REPERAGE D''UNE PARTICULE : ',/,&
+'@ LA RECHERCHE DE L''ORIENTATION DE LA FACE A ECHOUEE ',/,&
+'@ ',/,&
+'@ La particule est perdue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+#endif
+
+!===============================================================================
+! 2. Test sur le 1er point support de la face
+!===============================================================================
+
+!-->orientation de PQgS(1)
+
+call coturn &
+!==========
+ ( valmax , &
+ px , py , pz , &
+ qx , qy , qz , &
+ cdgx , cdgy , cdgz , &
+ cr1x , cr1y , cr1z , &
+ isign , ipturb )
+
+isign = isign * isensf
+
+if (isign.eq.0) then
+#if DEBUG_OUESTU
+ write(nfecra,1020)
+#endif
+ ierror = 1
+ return
+endif
+
+!--------
+! FORMATS
+!--------
+
+#if DEBUG_OUESTU
+ 1020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR DANS LE REPERAGE D''UNE PARTICULE : ',/,&
+'@ L''ORIENTATION DE PQgS(1) A ECHOUEE ',/,&
+'@ ',/,&
+'@ Cause probable : les points PQgS(1) sont coplanaires. ',/,&
+'@ ',/,&
+'@ La particule est perdue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+#endif
+
+!===============================================================================
+! 3. Boucle sur tous les points supports S(i) de la face
+! On cherche dans quel est le triangle construit sur les sommets et
+! le CDG de la face, qui est perce par la droite PQ
+!===============================================================================
+
+do is = 2, itypf7
+
+!--> Coordonnees des points supports
+
+ ii = iconf7(is)
+ cr1x = xyznod(1,ii)
+ cr1y = xyznod(2,ii)
+ cr1z = xyznod(3,ii)
+
+!--> Orientation de PQgS(i) avec 2 =< i =< ITYPF7
+
+ call coturn &
+ !==========
+ ( valmax , &
+ px , py , pz , &
+ qx , qy , qz , &
+ cdgx , cdgy , cdgz , &
+ cr1x , cr1y , cr1z , &
+ in , ipturb )
+
+ in = in * isensf
+
+ if (in.eq.0) then
+#if DEBUG_OUESTU
+ write(nfecra,1030) is
+#endif
+ ierror = 1
+ return
+ endif
+
+!--> Si inversion de l'orientation de PQgS(i) alors orientation
+! de PQS(i-1)S(i)
+
+ if (isign.eq.-in) then
+
+!--> Le triangle gS(i-1)S(i) est t-il traverse par le rayon PQ ?
+! si oui, on repere le triangle en question
+
+ if (isign.eq.1) ijklug = is
+
+ isign = in
+
+!--> Orientation de PQS(i-1)S(i)
+
+ ii = iconf7(is-1)
+ cr2x = xyznod(1,ii)
+ cr2y = xyznod(2,ii)
+ cr2z = xyznod(3,ii)
+
+ call coturn &
+ !==========
+ ( valmax , &
+ px , py , pz , &
+ qx , qy , qz , &
+ cr2x , cr2y , cr2z , &
+ cr1x , cr1y , cr1z , &
+ it , ipturb )
+
+ it = it * isensf
+
+ if (it.eq.0) then
+#if DEBUG_OUESTU
+ write(nfecra,1040)
+#endif
+ ierror = 1
+ return
+ endif
+
+ ittour = ittour + it
+
+ endif
+
+enddo
+
+if (ittour.ne.-2 .and. ittour.ne.2 .and. ittour.ne.0) then
+#if DEBUG_OUESTU
+ write(nfecra,2010) ittour
+#endif
+ ierror = 1
+ return
+else if ((ittour.eq.-2 .or. ittour.eq.2) .and. ijklug.eq.0) then
+#if DEBUG_OUESTU
+ write(nfecra,2020)
+#endif
+ ierror = 1
+ return
+endif
+
+!--> Si la droite PQ ne traverse pas la face, ou s'elle rentre dans
+! la cellule par cette face, on retourne dans LAGCEL
+
+if (ittour.eq.0 .or. ittour.eq.-2) return
+
+!--------
+! FORMATS
+!--------
+
+#if DEBUG_OUESTU
+ 1030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR DANS LE REPERAGE D''UNE PARTICULE : ',/,&
+'@ L''ORIENTATION DE PQgS(i) A ECHOUEE, i = ',I2 ,/,&
+'@ ',/,&
+'@ Cause probable : les points PQgS(i) sont coplanaires. ',/,&
+'@ ',/,&
+'@ La particule est perdue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR DANS LE REPERAGE D''UNE PARTICULE : ',/,&
+'@ L''ORIENTATION DE PQS(i-1)S(i) A ECHOUEE ',/,&
+'@ ',/,&
+'@ Cause Probable : points PQS(i-1)S(i) coplanaires. ',/,&
+'@ ',/,&
+'@ La particule est perdue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR DANS LE REPERAGE D''UNE PARTICULE : ',/,&
+'@ L''INDICE DE PASSAGE DOIT ESTRE EGALE A -2, 0 ou 2 ',/,&
+'@ IL EST CALCULE A : ',I2 ,/,&
+'@ ',/,&
+'@ La particule est perdue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR DANS LE REPERAGE D''UNE PARTICULE : ',/,&
+'@ LA DETERMINATION DU TRIANGLE DE PASSAGE ',/,&
+'@ DE LA PARTICULE A ECHOUEE ',/,&
+'@ ',/,&
+'@ La particule est perdue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+#endif
+
+!===============================================================================
+! 4. Position relative des points d'arrive et de depart et de la face
+!===============================================================================
+
+!--> Dans la cas ou la droite PQ construite sur les points d'arrive Q
+! et de depart P de la particule, sort de la cellule par la face
+! courante (ie ITTOUR = 2), on veut savoir si P et Q se trouve
+! de part et d'autre de la face, ou du meme cote :
+
+! ATTENTION : test perturbe (IPTURB=1) : si Q est sur la face,
+! la detection fonctionnera (a moins que QgS(i-1)s(i)
+! ne soient coplanaires).
+
+ipturb = 1
+
+ii = iconf7(ijklug-1)
+cr1x = xyznod(1,ii)
+cr1y = xyznod(2,ii)
+cr1z = xyznod(3,ii)
+
+ii = iconf7(ijklug)
+cr2x = xyznod(1,ii)
+cr2y = xyznod(2,ii)
+cr2z = xyznod(3,ii)
+
+!--> Orientation de QgS(i-1)S(i)
+
+ call coturn &
+ !==========
+ ( valmax , &
+ qx , qy , qz , &
+ cdgx , cdgy , cdgz , &
+ cr1x , cr1y , cr1z , &
+ cr2x , cr2y , cr2z , &
+ isign , ipturb )
+
+if (isign.eq.0) then
+#if DEBUG_OUESTU
+ write(nfecra,3010)
+#endif
+ ierror = 1
+ return
+endif
+
+!--> Position relative entre P Q et la face
+
+indian = -isign * isensf
+
+!--------
+! FORMATS
+!--------
+
+#if DEBUG_OUESTU
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR DANS LE REPERAGE D''UNE PARTICULE : ',/,&
+'@ LA POSITION RELATIVE DE Q PAR RAPPORT A P ',/,&
+'@ A LA FACE A ECHOUEE ',/,&
+'@ ',/,&
+'@ Cause Probable : points QgS(i-1)S(i) coplanaires. ',/,&
+'@ ',/,&
+'@ La particule est perdue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+#endif
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/mati/Makefile.am b/src/mati/Makefile.am
new file mode 100644
index 0000000..ad10578
--- /dev/null
+++ b/src/mati/Makefile.am
@@ -0,0 +1,52 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/mati \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+../../include/mati/matiss.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcsmati.la
+libcsmati_la_SOURCES = \
+memmat.f90 \
+mtimpi.f90 \
+mtini1.f90 \
+mtkpdc.f90 \
+mtphyv.f90 \
+mtproj.f90 \
+mttsns.f90 \
+mttssc.f90 \
+mttycl.f90
+libcsmati_la_LDFLAGS = -no-undefined
diff --git a/src/mati/Makefile.in b/src/mati/Makefile.in
new file mode 100644
index 0000000..b56320b
--- /dev/null
+++ b/src/mati/Makefile.in
@@ -0,0 +1,594 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/mati
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcsmati_la_LIBADD =
+am_libcsmati_la_OBJECTS = memmat.lo mtimpi.lo mtini1.lo mtkpdc.lo \
+ mtphyv.lo mtproj.lo mttsns.lo mttssc.lo mttycl.lo
+libcsmati_la_OBJECTS = $(am_libcsmati_la_OBJECTS)
+libcsmati_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcsmati_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcsmati_la_SOURCES)
+DIST_SOURCES = $(libcsmati_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(saturneincludedir)"
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/mati \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+../../include/mati/matiss.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcsmati.la
+libcsmati_la_SOURCES = \
+memmat.f90 \
+mtimpi.f90 \
+mtini1.f90 \
+mtkpdc.f90 \
+mtphyv.f90 \
+mtproj.f90 \
+mttsns.f90 \
+mttssc.f90 \
+mttycl.f90
+
+libcsmati_la_LDFLAGS = -no-undefined
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mati/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/mati/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcsmati.la: $(libcsmati_la_OBJECTS) $(libcsmati_la_DEPENDENCIES)
+ $(libcsmati_la_LINK) $(libcsmati_la_OBJECTS) $(libcsmati_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-saturneincludeHEADERS install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/mati/memmat.f90 b/src/mati/memmat.f90
new file mode 100644
index 0000000..ad488cd
--- /dev/null
+++ b/src/mati/memmat.f90
@@ -0,0 +1,147 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memmat &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncofab , nproce , nprofa , nprofb , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! GESTION MEMOIRE ADDITIONNELLE POUR LES VARIABLES MATISSE
+! PERSISTANTES DANS LE PAS DE TEMPS
+
+! SOUS-PROGRAMME SPECIFIQUE A MATISSE (COPIE DE MEMTRI)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncofab ! e ! <-- ! nombre de couple de cl a prevoir !
+! nproce ! e ! <-- ! nombre de prop phy aux centres !
+! nprofa ! e ! <-- ! nombre de prop phy aux faces internes !
+! nprofb ! e ! <-- ! nombre de prop phy aux faces de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "matiss.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncofab , nproce , nprofa , nprofb
+integer nideve , nrdeve , nituse , nrtuse
+integer ifinia , ifinra
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+!===============================================================================
+
+! --> Reservation de memoire entiere (en common)
+
+iiconr = idebia
+ifinia = iiconr + ncelet
+
+! --> Reservation de memoire reelle
+
+ifinra = idebra
+
+
+! --> Verification
+
+CALL IASIZE('MEMMAT',IFINIA)
+!==========
+
+CALL RASIZE('MEMMAT',IFINRA)
+!==========
+
+return
+end
diff --git a/src/mati/mtimpi.f90 b/src/mati/mtimpi.f90
new file mode 100644
index 0000000..cf44480
--- /dev/null
+++ b/src/mati/mtimpi.f90
@@ -0,0 +1,553 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine mtimpi
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! AFFICHAGE DES DONNEES DE CALCUL MATISSE
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "ihmpre.h"
+include "matiss.h"
+include "cstphy.h"
+include "entsor.h"
+include "optcal.h"
+
+!===============================================================================
+
+! Arguments
+
+! VARIABLES LOCALES
+
+character*15 name
+integer kechrg, kergrs, keclgr, kergch, keciel
+integer ii , iphas
+double precision djechr, djercl, djeclr, djerch
+double precision hbdtoi
+double precision tsor0 , dbm , cxsd
+double precision ureel , betmat, hrfmat, richar
+
+!===============================================================================
+!===============================================================================
+
+
+!===============================================================================
+! RECAPITULATIF DANS LE FICHIER resuMatisse.txt
+!===============================================================================
+
+
+! --- Ouverture du fichier
+! (il sera ferme au dernier pas de temps par mtproj)
+
+NAME='resuMatisse'
+open(unit=impmat,file=name, &
+ FORM='FORMATTED', STATUS='UNKNOWN', ERR=900)
+goto 950
+
+! - En cas d'erreur : message et stop
+
+ 900 write (0, 9998) name
+write (nfecra, 9999) name
+call csexit (1)
+!==========
+ 950 continue
+
+
+! --- Ecriture des donnees geometriques
+
+! On recupere les donnees non stockees dans les COMMON
+! et utiles seulement pour l'affichage
+
+call csmhdb(djechr, djercl, djeclr, djerch, &
+ kechrg, kergrs, keclgr, kergch, &
+ hbdtoi, keciel)
+
+! On imprime
+
+write(impmat,1001)
+write(impmat,1002)
+write(impmat,1001)
+
+if (itypen.eq.1) then
+ WRITE(IMPMAT,2096) ' Emm '
+else
+ WRITE(IMPMAT,2096) ' Vault'
+endif
+
+if (ialveo.eq.0) then
+ write(impmat,2097) hreso
+else
+ write(impmat,2098) hreso
+ write(impmat,2099) hplen
+endif
+
+write(impmat,2100) epregi
+write(impmat,2101) epchem
+write(impmat,2102) djechr
+write(impmat,2103) kechrg
+write(impmat,2104) djercl
+write(impmat,2105) kergrs
+if (itypen.eq.0) then
+ write(impmat,2106) djeclr
+ write(impmat,2107) keclgr
+ write(impmat,2108) djerch
+ write(impmat,2109) kergch
+endif
+if (itypen.eq.1) then
+ write(impmat,2124) hbdtoi
+ write(impmat,2125) hfttoi
+ write(impmat,2126) keciel
+endif
+
+write(impmat,2110) hconve
+write(impmat,2111) rconve
+write(impmat,2112) hchali
+write(impmat,2113) hcheva
+write(impmat,2114) ptrres
+write(impmat,2115) nptran
+write(impmat,2116) netran
+write(impmat,2117) frdtra
+write(impmat,2118) plgres
+write(impmat,2119) nplgrs
+write(impmat,2120) nelgrs
+write(impmat,2121) epchel
+write(impmat,2122) nchest
+write(impmat,2123) dmcont
+
+
+! --- Ecriture des parametres de calcul
+
+write(impmat,*)
+write(impmat,1001)
+write(impmat,1003)
+write(impmat,1001)
+
+write(impmat,3099) ntmabs
+write(impmat,3100) iphydr
+write(impmat,1151)
+write(impmat,3101) dtdtmx
+
+
+! --- Chargement thermique
+
+write(impmat,*)
+write(impmat,1001)
+write(impmat,1004)
+write(impmat,1001)
+
+write(impmat,3102) imdcnt
+write(impmat,1151)
+write(impmat,3103) puicon
+write(impmat,3104) tinit
+write(impmat,3105) tcrit
+write(impmat,3106) emicon
+write(impmat,3107) emimur
+
+
+! --- Chargement hydraulique
+
+write(impmat,*)
+write(impmat,1001)
+write(impmat,1005)
+write(impmat,1001)
+
+write(impmat,4107) icofor
+if (iconlg.eq.1) then
+ WRITE(IMPMAT,4108) ' En ligne '
+else
+ WRITE(IMPMAT,4108) ' Pas triangulaire'
+endif
+write(impmat,4109) ialveo
+write(impmat,4110) debmas
+write(impmat,4111) pdccha
+write(impmat,4112) pdcfch
+write(impmat,4113) dhchea
+write(impmat,4114) sdchea
+write(impmat,4115) pdcche
+write(impmat,4116) pdccch
+write(impmat,4117) dhches
+write(impmat,4118) sdches
+write(impmat,4119) pdcalg
+write(impmat,4120) pdcatv
+write(impmat,4121) argamt
+write(impmat,4122) pdcslg
+write(impmat,4123) pdcstv
+write(impmat,4124) argavl
+write(impmat,4125) amppdc
+write(impmat,4126) dpvent
+if (ialveo.eq.1) then
+ write(impmat,4127) dhalve
+endif
+
+
+! --- Pertes de charge : cartes
+
+write(impmat,*)
+write(impmat,1001)
+write(impmat,1006)
+write(impmat,1001)
+
+write(impmat,5100)
+write(impmat,5000)
+do ii = 1, nzocar(irange,icpdce)
+ write(impmat,5003) vizcar(1, ii, irange, icpdce), &
+ vizcar(2, ii, irange, icpdce)
+enddo
+write(impmat,5001)
+do ii = 1, nzocar(iligne,icpdce)
+ write(impmat,5003) vizcar(1, ii, iligne, icpdce), &
+ vizcar(2, ii, iligne, icpdce)
+enddo
+write(impmat,5002)
+do ii = 1, nzocar(ialtit,icpdce)
+ write(impmat,5003) vizcar(1, ii, ialtit, icpdce), &
+ vizcar(2, ii, ialtit, icpdce)
+enddo
+
+write(impmat,5101)
+write(impmat,5000)
+do ii = 1, nzocar(irange,icpdcs)
+ write(impmat,5003) vizcar(1, ii, irange, icpdcs), &
+ vizcar(2, ii, irange, icpdcs)
+enddo
+write(impmat,5001)
+do ii = 1, nzocar(iligne,icpdcs)
+ write(impmat,5003) vizcar(1, ii, iligne, icpdcs), &
+ vizcar(2, ii, iligne, icpdcs)
+enddo
+write(impmat,5002)
+do ii = 1, nzocar(ialtit,icpdcs)
+ write(impmat,5003) vizcar(1, ii, ialtit, icpdcs), &
+ vizcar(2, ii, ialtit, icpdcs)
+enddo
+
+write(impmat,5102)
+write(impmat,5000)
+do ii = 1, nzocar(irange,icpdcr)
+ write(impmat,5003) vizcar(1, ii, irange, icpdcr), &
+ vizcar(2, ii, irange, icpdcr)
+enddo
+write(impmat,5001)
+do ii = 1, nzocar(iligne,icpdcr)
+ write(impmat,5003) vizcar(1, ii, iligne, icpdcr), &
+ vizcar(2, ii, iligne, icpdcr)
+enddo
+
+
+! --- Sources de chaleur homogeneisees : cartes
+
+write(impmat,*)
+write(impmat,1001)
+write(impmat,1007)
+write(impmat,1001)
+
+write(impmat,5000)
+do ii = 1, nzocar(irange,icpuis)
+ write(impmat,5004) vizcar(1, ii, irange, icpuis), &
+ vizcar(2, ii, irange, icpuis), &
+ vcarth(ii, irange)
+
+enddo
+write(impmat,5001)
+do ii = 1, nzocar(iligne,icpuis)
+ write(impmat,5004) vizcar(1, ii, iligne, icpuis), &
+ vizcar(2, ii, iligne, icpuis), &
+ vcarth(ii, iligne)
+
+enddo
+write(impmat,5002)
+do ii = 1, nzocar(ialtit,icpuis)
+ write(impmat,5004) vizcar(1, ii, ialtit, icpuis), &
+ vizcar(2, ii, ialtit, icpuis), &
+ vcarth(ii, ialtit)
+
+enddo
+
+
+! --- Affichage banniere de resultats
+
+write(impmat,*)
+write(impmat,1001)
+write(impmat,1008)
+write(impmat,1001)
+
+
+! --- Affichage Richardson en convection forcee
+! selon la formule Ri = g beta DeltaT H_ref / U**2 avec :
+! . g = -GZ gravite verticale, valeur positive
+! . beta = 1/T en gaz parfait, ici 1/((TINIT+TSOR0)*0.5 + TKELVI)
+! . DeltaT = TSOR0-TINIT
+! . H_ref = EPCHEL*NCHEST hauteur de la zone de stockage
+! . U = UREEL vitesse reelle horizontale dans la zone de stockage
+
+! en outre :
+! . TSOR0 = temperature de sortie evaluee a partir de la
+! puissance des conteneurs, ie telle que on ait equilibre entre
+! debit * Cp (TSOR0-TINIT) en Joule/s et
+! NPTRAN*NPLGRS*PUICON en Joule/s
+! . le debit est calcule a partir du debit reel en corrigeant
+! par le facteur d'echelle transverse du modele par rapport au
+! cas reel FRDTRA.
+
+! En convection naturelle, le Richardson est affiche par mttsns
+
+if (icofor.eq.1) then
+
+ iphas = 1
+ dbm = debmas/frdtra
+ tsor0 = tinit + nptran*nplgrs*puicon/(dbm*cp0(iphas))
+
+ cxsd = ptrres/dmcont
+ ureel = vitref/(cxsd-1.d0)*cxsd
+
+ betmat = 1.d0/((tinit+tsor0)*0.5d0 + tkelvi)
+
+ hrfmat = epchel*nchest
+
+ richar = -gz*betmat*(tsor0-tinit)*hrfmat/(ureel**2)
+ write(impmat,1011) richar
+
+endif
+
+
+! --- Des resultats seront affiches par mttsns et mtproj
+! le fichier n'est donc pas ferme
+
+!===============================================================================
+! FORMATS
+!===============================================================================
+
+! --- Texte
+
+ 1001 format(74('-'))
+ 1002 format(7(' '),'Geometrie :')
+ 1003 format(7(' '),'Parametres de calcul :')
+ 1004 format(7(' '),'Chargement thermique :')
+ 1005 format(7(' '),'Chargement hydraulique :')
+ 1006 format(7(' '),'Zones de pertes de charges :')
+ 1007 format(7(' '),'Repartition des sources de chaleurs', &
+ ' homogeneisees:')
+ 1008 format(7(' '),'Resultats :')
+ 1011 format(' Nombre de Richardson ',&
+ ':', E12.5)
+
+ 1151 format(' (1 oui, 0 non)')
+
+! --- Geometrie
+
+ 2096 format(' Concept d''entrepot ', &
+ ' :',A6)
+ 2097 format(' Hauteur du r�seau de conteneurs ', &
+ ' :',E12.5,' m')
+ 2098 format(' Hauteur max des alv�oles ', &
+ ' :',E12.5,' m')
+ 2099 format(' Hauteur min des alv�oles ', &
+ ' :',E12.5,' m')
+ 2100 format(' Epaisseur des registres/cloisons amont et aval ', &
+ ' :',E12.5,' m')
+ 2101 format(' Epaisseur des cheminees ', &
+ ' :',E12.5,' m')
+ 2102 format(' Jeu amont entre cheminee/registre ', &
+ ' :',E12.5,' m')
+ 2103 format(' Nb d''elements entre cheminee/registre amont ', &
+ ' :',I12)
+ 2104 format(' Jeu entre registre amont/colis ', &
+ ' :',E12.5,' m')
+ 2105 format(' Nb d''elements entre registre amont/reseau de colis ', &
+ ' :',I12)
+ 2106 format(' Jeu entre colis/registre aval ', &
+ ' :',E12.5,' m')
+ 2107 format(' Nb d''elements entre colis/registre aval ', &
+ ' :',I12)
+ 2108 format(' Jeu aval entre registre/cheminee ', &
+ ' :',E12.5,' m')
+ 2109 format(' Nb d''elements entre registre/cheminee aval ', &
+ ' :',I12)
+ 2110 format(' Hauteur du convergent ', &
+ ' :',E12.5,' m')
+ 2111 format(' Rapport du convergent ', &
+ ' :',E12.5,' m')
+ 2112 format(' Hauteur de la cheminee d''alimentation ', &
+ ' :',E12.5,' m')
+ 2113 format(' Hauteur de la cheminee d''evacuation ', &
+ ' :',E12.5,' m')
+ 2114 format(' Pas transversal du reseau de conteneur ', &
+ ' :',E12.5,' m')
+ 2115 format(' Nombre de pas d''espace transversal ', &
+ ' :',I12)
+ 2116 format(' Nombre d''elements par pas transversal ', &
+ ' :',I12)
+ 2117 format(' Facteur de reduction transversal du modele/reel ', &
+ ' :',E12.5)
+ 2118 format(' Pas longitudinal du reseau de conteneur ', &
+ ' :',E12.5,' m')
+ 2119 format(' Nombre de pas d''espace longitudinal ', &
+ ' :',I12)
+ 2120 format(' Nombre d''elements par pas longitudinal ', &
+ ' :',I12)
+ 2121 format(' Epaisseur d''une couche d''element (zone stockage) ', &
+ ' :',E12.5,' m')
+ 2122 format(' Nombre de couche d''element dans la zone stockage ', &
+ ' :',I12)
+ 2123 format(' Diametre des conteneurs ', &
+ ' :',E12.5,' m')
+ 2124 format(' Hauteur du bord de toit ', &
+ ' :',E12.5,' m')
+ 2125 format(' Hauteur du faite de toit ', &
+ ' :',E12.5,' m')
+ 2126 format(' Nombre de couches d''elements du ciel d''entrepot ', &
+ ' :',I12)
+
+! --- Parametres de calcul
+
+ 3099 format(' Nombre de pas de temps ', &
+ ' :',I12)
+ 3100 format(' Prise en compte de la pression hydrostatique ', &
+ ' :',I12)
+ 3101 format(' delta temperature max/pas de temps ', &
+ ' :',E12.5)
+ 3102 format(' Modelisation des panaches de convection naturelle ', &
+ ' :',I12)
+ 3103 format(' Puissance d''un conteneur ', &
+ ' :',E12.5,' W')
+ 3104 format(' Temperature d''air en entree ', &
+ ' :',E12.5,' �C')
+ 3105 format(' Temperature d''air de sortie critique ', &
+ ' :',E12.5,' �C')
+ 3106 format(' Emissivite des conteneurs ', &
+ ' :',E12.5)
+ 3107 format(' Emissivite des murs ', &
+ ' :',E12.5)
+
+! --- Chargement hydraulique
+
+ 4107 format(' Regime hydraulique de circulation forcee (1 oui, 0 non', &
+ '):',I12)
+ 4108 format(' Reseau de conteneur ', &
+ ' :',A17)
+ 4109 format(' Entreposage en alveole (1 oui, 0 non) ', &
+ ' :',I12)
+ 4110 format(' Debit de circulation forcee ', &
+ ' :',E12.5, ' kg/s')
+ 4111 format(' Perte de charge du diffuseur de cheminee d''alimentati', &
+ 'on:',E12.5)
+ 4112 format(' Perte de charge du filtre de cheminee d''alimentation ', &
+ ' :',E12.5)
+ 4113 format(' Diametre hydraulique de la cheminee d''alimentation ', &
+ ' :',E12.5, ' m')
+ 4114 format(' Surface debitante de la cheminee d''alimentation ', &
+ ' :',E12.5, ' m�')
+ 4115 format(' Perte de charge du diffuseur de cheminee d''evacuation', &
+ ' :',E12.5)
+ 4116 format(' Perte de charge du clapet de cheminee d''evacuation ', &
+ ' :',E12.5)
+ 4117 format(' Diametre hydraulique de la cheminee d''evacuation ', &
+ ' :',E12.5, ' m')
+ 4118 format(' Surface debitante de la cheminee d''evacuation ', &
+ ' :',E12.5, ' m�')
+ 4119 format(' Perte de charge porte d''entree AMONT longitudinale ', &
+ ' :',E12.5)
+ 4120 format(' Perte de charge porte d''entree AMONT transversale ', &
+ ' :',E12.5)
+ 4121 format(' Angle d''inclinaison du registre AMONT (degre) ', &
+ ' :',E12.5, ' �')
+ 4122 format(' Perte de charge porte de sortie AVAL longitudinale ', &
+ ' :',E12.5)
+ 4123 format(' Perte de charge porte de sortie AVAL transversale ', &
+ ' :',E12.5)
+ 4124 format(' Angle d''inclinaison du registre AMONT (degre) ', &
+ ' :',E12.5, ' �')
+ 4125 format(' Amplificateur des pertes de charge de reseau ', &
+ ' :',E12.5)
+ 4126 format(' Differentiel de pression entree/sortie ', &
+ ' :',E12.5, ' Pa')
+ 4127 format(' Diametre hydraulique de l''alveole ', &
+ ' :',E12.5, ' m')
+
+
+! --- Cartes
+
+ 5000 format(' - Direction longitudinale', &
+ ' (distance en nombre de rangees)')
+ 5001 format(' - Direction transversale', &
+ ' (distance en nombre de lignes)')
+ 5002 format(' - Direction verticale', &
+ ' (hauteur en nombre de mailles)')
+
+ 5003 format(' * min :', E12.5,' max :', E12.5)
+ 5004 format(' * min :', E12.5,' max :', E12.5,' val :', E12.5)
+
+ 5100 format(' Entree')
+ 5101 format(' Sortie')
+ 5102 format(' R�seau')
+
+! --- Erreurs
+
+ 9998 format(/, &
+'Code_Saturne : Erreur d''initialisation :',/, &
+'Impossible d''ouvrir le fichier : ',A,/)
+ 9999 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET MATISSE (MTIMPI) ',/,&
+'@ ========= ',/,&
+'@ ARRET A L''OUVERTURE DU FICHIER RESUME MATISSE ',/,&
+'@ ',/,&
+'@ Le fichier ',A15,' ne peut etre ouvert. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+return
+end
diff --git a/src/mati/mtini1.f90 b/src/mati/mtini1.f90
new file mode 100644
index 0000000..aeb9bc0
--- /dev/null
+++ b/src/mati/mtini1.f90
@@ -0,0 +1,681 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine mtini1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INITIALISATION DES COMMON MATISSE
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "ihmpre.h"
+include "matiss.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+! VARIABLES LOCALES
+
+integer ii , jj , kk
+integer iphas
+integer iarret
+double precision tsor0
+double precision xmapmn, xmapmx
+double precision xmapvl
+double precision cxsd , cysd , por0
+double precision ustmat, drfmat
+double precision prfmat, erfmat, srfmat
+
+!===============================================================================
+
+!===============================================================================
+! 1. PAR DEFAUT MATISSE N'EST PAS ACTIVE
+!===============================================================================
+
+! Ceci doit etre present en dehors du if defined xml :
+! on ne peut activer Matisse que avec IHM et XML
+
+! Ainsi, dans les autres sous-programmes Matisse, il est inutile de
+! tester si l'interface ou Xml sont disponibles (en effet, si
+! l'interface ou Xml ne sont pas disponibles, mtini1 est le seul
+! sous-programme Matisse dans lequel on entre).
+
+imatis = 0
+
+
+!===============================================================================
+! 2. LECTURE DE LA BALISE MATISSE EN XML (si xml present)
+!===============================================================================
+
+! --- Lecture de IMATIS
+! (si IHM presente ; sinon, Matisse ne sera pas actif)
+
+if (iihmpr.eq.1) then
+ call csmtpr(imatis)
+endif
+
+! --- Si Matisse n'est pas actif, on sort a la fin du if
+! Sinon, on lit les donnees, on les traite, ...
+
+if (imatis.eq.1) then
+
+
+!===============================================================================
+! 3. REMPLISSAGE DES COMMONS A PARTIR DU XML
+!===============================================================================
+
+! On remplit les COMMON de donn�es g�om�triques et physiques
+! a partir du contenu du fichier xml
+
+! --- /IMTGEO/
+
+ call csgein(nptran, nplgrs, nelgrs, nchest, netran, itypen)
+
+! --- /RMTGEO/
+
+ call csgedb(epregi, epchem, hconve, rconve, hchali, hcheva, &
+ hfttoi, ptrres, frdtra, plgres, epchel, dmcont)
+
+! --- /IMTPHY/
+
+ call csphat(imdcnt, icofor, iconlg, ialveo)
+
+! --- /RMTPHY/
+
+ call csphdb(dtdtmx, puicon, tinit, tcrit, emicon, emimur, &
+ hepcnt, dhpcnt, debmas, pdccha, pdcfch, dhchea, &
+ sdchea, pdcche, pdccch, dhches, sdches, pdcalg, &
+ pdcatv, argamt, pdcslg, pdcstv, argavl, amppdc, &
+ dhalve, hreso, hplen, dpvent)
+
+! --- Cartes 2D et 3D
+
+ do ii = 1, ncarte
+ do jj = 1, nmtdir
+ call csnbmp(jj,ii, nzocar(jj,ii))
+ if (nzocar(jj,ii) .gt. nzonmx) then
+ write(nfecra,9011) nzocar(jj,ii), nzonmx
+ call csexit (1)
+ endif
+ enddo
+ enddo
+
+ do ii = 1, ncarte
+ do jj = 1, nmtdir
+ do kk = 1 , nzocar(jj,ii)
+ call csdfmp (kk ,jj, ii, xmapmn, xmapmx, xmapvl)
+ vizcar(1, kk, jj, ii) = xmapmn
+ vizcar(2, kk, jj, ii) = xmapmx
+ if (ii.eq.icpuis) then
+ vcarth(kk, jj) = xmapvl
+ endif
+ enddo
+ enddo
+ enddo
+
+
+!===============================================================================
+! 4. CALCULS COMPLEMENTAIRES AVANT VERIFICATIONS
+!===============================================================================
+
+! Variables en common
+
+! --- Hauteur d'erosion reduite a un nombre entier de mailles
+ hercnt = epchel*int(hepcnt/epchel)
+
+
+!===============================================================================
+! 5. VERIFICATIONS
+!===============================================================================
+
+! --- Par defaut, tout est suppose correct (on ne s'arretera donc pas)
+ iarret = 0
+
+
+! --- Matisse n'est pas parallele
+
+ if (irangp.ge.0) then
+ iarret = 1
+ write(nfecra,9001)
+ endif
+
+
+! --- NSCAUS = 3
+! Matisse a besoin de 3 scalaires et 3 seulement
+! Des developpements supplementaires sont necessaires pour
+! que d'autres scalaires utilisateurs puissent etre pris en compte
+! (exemple : acces a ustssc)
+
+ if(nscaus.ne.3) then
+ iarret = 1
+ write(nfecra,9021) nscaus
+ endif
+
+
+! --- TCRIT > TINIT (cf calcul de VITREF)
+! TCRIT est la "Temperature d'air de sortie critique en degres C"
+! c'est une estimation de la temperature de l'air en sortie de
+! l'entrepot et donc naturellement strictement superieure a TINIT
+
+ if(tcrit.le.tinit) then
+ iarret = 1
+ write(nfecra,9031) tcrit, tinit
+ endif
+
+
+! --- RCONVE = 1 si 2D
+! RCONVE est le rapport du convergent represente sur le maillage.
+! Attention, "respresente sur le maillage" est important :
+! il ne s'agit pas du convergent reel.
+! En 2D, il ne peut pas y avoir de convergent (le convergent
+! reduit la dimension X, transverse, des cheminees) et RCONVE
+! est donc necessairement unite.
+! Pour savoir si l'on fait une simulation 2D, on regarde si
+! FRDTRA est non unite (necessaire mais non suffisant : FRDTRA
+! non unite indique que l'on represente une configuration
+! 3D par un calcul 2D, i.e. a une seule maille dans la
+! direction X).
+
+ if ( (abs(frdtra-1.d0).ge.epzero).and. &
+ (abs(rconve-1.d0).ge.epzero) ) then
+ iarret = 1
+ write(nfecra,9041) frdtra, rconve
+ endif
+
+
+! --- Si on modelise les panaches, la hauteur doit etre correcte
+! HERCNT est la hauteur reduite a un numbre entier de mailles
+! dans la direction verticale : c'est la hauteur que l'on
+! va reellement prendre en compte dans le calcul. Elle doit
+! etre positive et ne pas depasser la hauteur de l'espace
+! libre au dessus des colis :
+
+! HERCNT > 0 et HERCNT <= NCHEST*EPCHEL-HRESO
+
+ if(imdcnt.eq.1) then
+ if ( (hercnt.le.0.d0).or. &
+ (hercnt.gt.nchest*epchel-hreso) ) then
+ iarret = 1
+ write(nfecra,9051) imdcnt, &
+ hepcnt, hercnt, &
+ nchest*epchel, nchest, epchel, hreso, &
+ hercnt, nchest*epchel-hreso
+ endif
+ endif
+
+
+! --- ARRET EVENTUEL
+
+ if(iarret.ne.0) then
+ call csexit (1)
+ !==========
+ endif
+
+
+!===============================================================================
+! 6. VALEURS PAR DEFAUT
+!===============================================================================
+
+! === On ne traite qu'une seule et unique phase
+! ===========================================================
+
+! On ne le dit qu'une fois, au debut, pour eviter d'en oublier
+
+ iphas = 1
+
+
+! === Options numeriques
+! ===========================================================
+
+
+! --- IPHYDR = 0 � cause des pertes de charges dans la cheminee
+! Plus exactement, a cause des pertes de charges en
+! sortie, avec presence de gravite.
+! A noter, cependant, qu'il semble que meme avec ICALHY = 0
+! l'option IPHYDR cause des problemes (et que c'�tait d�j� le cas
+! dans les premieres versions de Matisse, puisque l'option etait
+! certes proposee par d�faut =1, mais mise systematiquement =0
+! dans tous les cas de calcul).
+! Bien qu'il s'agisse de la valeur par defaut de Code_Saturne 1.2,
+! on laisse l'option ici dans la mesure ou des tests
+! supplementaires seraient necessaires pour comprendre pourquoi
+! on rencontre des difficultes avec les configurations etudiees
+! dans Matisse.
+
+ iphydr = 0
+
+
+! --- Par contre, l'extrapolation de la pression fournit des resultats
+! satisfaisants. Elle est utile et ne fait pas apparaitre de
+! probleme sur les cas testes.
+
+ extrag(ipr(iphas)) = 1.d0
+
+
+! --- IPUCOU prend sa valeur par defaut de Code_Saturne 1.2
+! L'option est cependant conservee ici, dans la mesure ou elle
+! etait prise egale a 1 auparavant et ou cela fait une difference
+! (toute petite, certes, mais on garde ici la ligne pour memoire).
+
+ ipucou = 0
+
+
+! --- Pas de convection pour les temperatures solides
+! Pas de phenomene diffusif pour les parois (le rayonnement est
+! traite par terme source)
+
+ iconv(isca(itpcmt)) = 0
+ iconv(isca(itppmt)) = 0
+ idiff(isca(itppmt)) = 0
+
+
+! --- Schema convectif : robuste
+
+ blencv(iu(iphas)) = 0.0d0
+ blencv(iv(iphas)) = 0.0d0
+ blencv(iw(iphas)) = 0.0d0
+ if(nscaus.ge.1) then
+ do ii = 1, nscaus
+ blencv(isca(ii)) = 0.0d0
+ enddo
+ endif
+
+
+! === Proprietes physiques et pas de temps
+! ===========================================================
+
+
+! --- Connectivite du rayonnement a calculer
+! (au premier passage dans mttssc)
+
+ icnrok = 0
+
+
+! --- Masse volumique, chaleur massique
+
+! On prend comme reference :
+! - la masse volumique RRFMAT a la temperature TRFMAT en degres C
+! - on utilise la loi des gaz parfaits
+! - on fixe CP0
+
+ ro0(iphas) = (trfmat + tkelvi)*rrfmat /(tinit + tkelvi)
+ cp0(iphas) = crfmat
+
+! On fixe P0 a 1 atm et PRED0 a 0
+! La reference de pression est prise au niveau de l'alimentation
+ p0(iphas) = 1.013d5
+ pred0(iphas) = 0.d0
+ xyzp0(1,iphas) = 0.d0
+ xyzp0(2,iphas) = 0.d0
+ xyzp0(3,iphas) = hchali
+ ixyzp0(iphas) = 1
+
+
+! --- Vitesse de reference
+! pour le calcul de la viscosite turbulente et
+! pour les pertes de charge, le Richardson, ...
+! la vitesse de reference n'est pas utilisee pour le calcul du pas
+! de temps : le pas de temps est pris ici uniforme et constant ;
+! s'il etait envisage de le prendre variable en temps, pour
+! l'adapter automatiquement a la configuration finale du
+! calcul une fois l'etat stationnaire etabli, il conviendrait
+! alors d'utiliser la vitesse de reference pour calculer une
+! limite basee par exemple sur un nombre de Courant.
+
+
+! - En convection naturelle
+! l'echelle de vitesse est calculee par analyse dimensionnelle
+! comme VITREF = P / (E S), a partir :
+! . de l'energie (E, en Joule/m3) que l'air initialement a TINIT
+! peut extraire s'il atteint la temperature critique de
+! sortie TCRIT : E = RO0(IPHAS)*CP0(IPHAS)*(TSOR0-TINIT)
+! . de la puissance (P, en Joule/s) d'une ligne (x cst) de
+! NPLGRS conteneurs, P = PUICON * NPLGRS
+! . de la surface verticale (S en m2) de la coupe transverse
+! d'une ligne de conteneurs, S = PTRRES*EPCHEL*NCHEST
+
+ if(icofor.eq.0)then
+
+ tsor0 = tcrit
+ prfmat = puicon * nplgrs
+ erfmat = ro0(iphas)*cp0(iphas)*(tsor0-tinit)
+ srfmat = ptrres*epchel*nchest
+
+ vitref = prfmat/(erfmat*srfmat)
+
+
+! - En convection forcee
+! La vitesse de reference est calculee comme le rapport du debit
+! reel total (DEBMAS/RO0(IPHAS)) a la surface de la zone de
+! stockage (NPTRAN*PTRRES*NCHEST*EPCHEL).
+! Elle est corrigee par le facteur de reduction transverse
+! FRDTRA du maillage par rapport a la realite afin d'obtenir
+! une vitesse representative de la vitesse reelle.
+
+ else
+
+ vitref = &
+ debmas/(ro0(iphas)*frdtra*nptran*ptrres*nchest*epchel)
+
+! TSOR0 inutile ici ; on conserve la formule pour memoire
+! TSOR0= TINIT + NPTRAN*NPLGRS*PUICON/(DEBMAS/FRDTRA)/CP0(IPHAS)
+
+ endif
+
+
+! --- Viscosite dynamique totale (modelisee, constante et uniforme)
+
+! Le tableau VISCL0 contient la viscosite dynamique totale
+! (moleculaire + turbulente). On evalue d'abord la viscosite
+! turbulente puis on ajoute la viscosite moleculaire XMUMAT.
+
+! La viscosite dynamique turbulente est modelisee sous la forme
+! mu_t = rho * u*_ref * D_ref, formule dans laquelle :
+! . u*_ref est la vitesse de frottement deduite de la vitesse de
+! reference VITREF calculee ci-dessus et d'une intensite
+! turbulente imposee RTURB0
+! . D_ref est une distance de reference basee sur l'encombrement
+! du milieu
+
+! La valeur de u*_ref est calculee a partir de l'energie cinetique
+! turbulente k par u*_ref = Cmu**(1/4) k**(1/2). La valeur de k
+! se deduit de l'intensite turbulente I, supposee connue, par
+! k = 3/2 (I V_ref)**2 avec V_ref la vitesse de reference
+! VITREF calculee precedemment.
+
+! La valeur de D_ref est calculee par D_ref = 0.2(Pt - d) ou Pt est
+! le pas transverse du reseau et d le diametre des conteneurs.
+
+! Ainsi, mu_t = rho * u*_ref * L_ref
+! . u*_ref = Cmu**(1/4) * (3/2)**(1/2) * I * V_ref
+! . L_ref = 0.2 * (Pt - d)
+
+! On ajoute la viscosite moleculaire XMUMAT a mu_t pour obtenir
+! la viscosite dynamique totale VISCL0
+
+! VISCL0 est recalcule dans mtphyv (VITREF est mis a jour au cours
+! du calcul)
+
+
+! - Calcul de la viscosite turbulente
+
+ ustmat = cmu**0.25d0 * sqrt(1.5d0) * (rturb0/100.d0) * vitref
+ drfmat = 0.2d0 * (ptrres-dmcont)
+ viscl0(iphas) = ro0(iphas) * ustmat * drfmat
+
+! - Ajout de la viscosite moleculaire
+
+ viscl0(iphas) = viscl0(iphas) + xmumat
+
+
+! --- Pas de temps
+
+! - Pas de temps uniforme en espace et constant en temps
+! Initialement, on souhaitait adopter dans Matisse un pas de
+! temps variable en temps, mais l'option n'a jamais ete
+! effectivement utilisee.
+! Quels que soient les choix par defaut de Code_Saturne, on
+! conserve IDTVAR ici pour memoire, au cas ou l'on reprendrait
+! les tests plus tard.
+
+ idtvar = 0
+
+! - Calcul de la porosite verticale liee a la presence d'un
+! conteneur :
+! POR0 = section horizontale passante /section horizontale totale
+! (on suppose le conteneur cylindrique � base circulaire,
+! d'axe vertical)
+! Utilise pour le calcul du pas de temps ci-dessous
+
+ cxsd = ptrres/dmcont
+ cysd = plgres/dmcont
+ por0 = 1.d0 - pi/(cxsd*cysd*4.d0)
+
+! - On calcule le pas de temps par analyse dimensionnelle pour que
+! le volume d'air avoisinant un conteneur ne voie pas sa
+! temperature croitre de plus de DTDTMX degres en un pas de
+! temps.
+! On a donc DTREF = E * V / P avec :
+! . E = RO0(IPHAS)*CP0(IPHAS)*DTDTMX, en Joule/m3, l'energie
+! maximale que l'air peut recevoir par pas de temps,
+! . V = (PLGRES*PTRRES*EPCHEL*NCHEST)*POR0, en m3, le volume
+! d'air entourant un conteneur.
+! . P = PUICON, en Joule/s, la puissance d'un conteneur
+
+ dtref = ro0(iphas)*cp0(iphas)*dtdtmx &
+ * (plgres*ptrres*epchel*nchest)*por0 / puicon
+
+
+! --- Diffusivite des scalaires
+! Une diffusivite de reference est fournie ici pour tous les
+! scalaires, mais la diffusivite est variable (voir mtphyv).
+! Il s'agit plutot d'une securite.
+! Pour la temperature de l'air ambiant (scalaire ITAAMT),
+! l'initialisation est ici de type "Prandtl=1" (on considere
+! un Prandtl "efficace" incluant la turbulence)
+! Pour la temperature de peau des parois (scalaires ITPPMT),
+! il n'y a pas de phenomene de diffusion pris en compte :
+! peu importe donc la valeur adoptee.
+
+ if(nscaus.gt.0) then
+
+! On boucle sur les scalaires utilisateurs :
+ do ii = 1, nscaus
+! Pour les scalaires qui ne sont pas des variances
+ if(iscavr(ii).le.0) then
+! On definit la diffusivite
+ visls0(ii) = viscl0(iphsca(ii))
+ endif
+ enddo
+
+ endif
+
+! Fin du test IF (IMATIS.EQ.1)
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MATISSE ',/,&
+'@ ========= ',/,&
+'@ ARRET SUR LE PARALLELISME DANS MTINI1 ',/,&
+'@ ',/,&
+'@ Le parallelisme n''est pas prevu avec Matisse ',/,&
+'@ or le calcul semble avoir ete lance en parallele. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET MATISSE (MTINI1) ',/,&
+'@ ========= ',/,&
+'@ ARRET SUR LE NOMBRE DE ZONES DES CARTES 2D ET 3D. ',/,&
+'@ ',/,&
+'@ Le nombre de zones demande est ',I10 , /,&
+'@ Le nombre maximal de zones autorise est NZONMX ',I10 , /,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9021 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET MATISSE (MTINI1) ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE SCALAIRES INCORRECT. ',/,&
+'@ ',/,&
+'@ NSCAUS represente ',/,&
+'@ le nombre de scalaires requis pour Matisse. ',/,&
+'@ ',/,&
+'@ NSCAUS doit etre exactement egal a 3. ',/,&
+'@ ',/,&
+'@ Il vaut ici ',/,&
+'@ NSCAUS = ',I10 ,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9031 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET MATISSE (MTINI1) ',/,&
+'@ ========= ',/,&
+'@ ECART TCRIT-TINIT NEGATIF OU NUL. ',/,&
+'@ ',/,&
+'@ TCRIT represente ',/,&
+'@ la temperature d''air de sortie critique en degres C. ',/,&
+'@ TINIT represente ',/,&
+'@ la temperature d''air en entree en degres C. ',/,&
+'@ ',/,&
+'@ TCRIT est une estimation de la temperature de l''air ',/,&
+'@ en sortie de l''entrepot. ',/,&
+'@ TCRIT doit donc naturellement etre strictement ',/,&
+'@ superieure a TINIT. ',/,&
+'@ ',/,&
+'@ Or, les donnees saisies sont telles que ',/,&
+'@ TCRIT = ',E12.5 ,' ',/,&
+'@ TINIT = ',E12.5 ,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier les donnes saisies pour que TCRIT > TINIT. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9041 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET MATISSE (MTINI1) ',/,&
+'@ ========= ',/,&
+'@ RAPPORT DE CONVERGENT NON UNITE EN 2D. ',/,&
+'@ ',/,&
+'@ RCONVE represente ',/,&
+'@ le rapport du convergent represente sur le maillage. ',/,&
+'@ ',/,&
+'@ RCONVE doit etre unite pour un calcul bidimensionnel. ',/,&
+'@ ',/,&
+'@ Ici, le calcul est apparemment bidimensionnel puisque ',/,&
+'@ le facteur de reduction transverse saisi n''est pas ',/,&
+'@ unite : FRDTRA = ',E12.5 ,' ',/,&
+'@ Or, la valeur saisie pour le rapport du convergent ',/,&
+'@ n''est pas unite : RCONVE = ',E12.5 ,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier la valeur du facteur de reduction transverse ',/,&
+'@ ou du rapport de convergent. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9051 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET MATISSE (MTINI1) ',/,&
+'@ ========= ',/,&
+'@ HAUTEUR D''EROSION DES PANACHES INADAPTEE. ',/,&
+'@ ',/,&
+'@ La modelisation des panaches est activee ',/,&
+'@ avec IMDCNT = ',I10 ,' ',/,&
+'@ La hauteur d''erosion des panaches reduite a un nombre ',/,&
+'@ entier de mailles doit etre strictement positive et ',/,&
+'@ inferieure ou egale a la distance separant le plafond ',/,&
+'@ du sommet du reseau de colis. ',/,&
+'@ ',/,&
+'@ La hauteur d''erosion saisie est HEPCNT = ',E12.5 ,/,&
+'@ ',/,&
+'@ La hauteur d''erosion reduite a un nombre entier de ',/,&
+'@ mailles est HERCNT = ',E12.5 ,/,&
+'@ Le plafond est a la hauteur NCHEST*EPCHEL = ',E12.5 ,/,&
+'@ avec NCHEST = ',I10 ,' et EPCHEL = ',E12.5 ,' ',/,&
+'@ La hauteur du reseau de colis est HRESO = ',E12.5 ,/,&
+'@ ',/,&
+'@ L''inegalite suivante n''est pas verifiee : ',/,&
+'@ 0 < HERCNT <= (NCHEST*EPCHEL - HRESO) ',/,&
+'@ ',E12.5 ,' ',E12.5 ,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Descativer la modelisation des panaches ou modifier la ',/,&
+'@ hauteur d''erosion prescrite. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+return
+end
diff --git a/src/mati/mtkpdc.f90 b/src/mati/mtkpdc.f90
new file mode 100644
index 0000000..9c6aea9
--- /dev/null
+++ b/src/mati/mtkpdc.f90
@@ -0,0 +1,416 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mtkpdc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdp , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES PERTES DE CHARGE POUR MATISSE (COPIE DE USKPDC)
+
+! TRAITEMENT DES REGISTRES UNIQUEMENT (ENTREE ET SORTIE)
+
+! LES AUTRES PERTES DE CHARGES (ISOTROPES)
+! SONT TRAITEES DANS MTTSNS
+
+
+
+! IAPPEL = 1 :
+! CALCUL DU NOMBRE DE CELLULES OU L'ON IMPOSE UNE PDC
+! IAPPEL = 2 :
+! REPERAGE DES CELLULES OU L'ON IMPOSE UNE PDC
+! IAPPEL = 3 :
+! CALCUL DES VALEURS DES COEFS DE PDC
+
+
+! CKUPDC EST LE COEFF DE PDC CALCULE.
+
+! IL INTERVIENT DANS LA QDM COMME SUIT :
+! RHO DU/DT = - GRAD P + TSPDC (+ AUTRES TERMES)
+! AVEC TSPDC = - RHO CKUPDC U ( en kg/(m2 s))
+
+
+! POUR UNE PDC REPARTIE,
+
+! SOIT KSIL = DHL/(0.5 RHO U**2) DONNE DANS LA LITTERATURE
+! (DHL EST LA PERTE DE CHARGE PAR UNITE DE LONGUEUR)
+
+! LE TERME SOURCE TSPDC VAUT DHL = - KSIL *(0.5 RHO U**2)
+
+! ON A CKUPDC = 0.5 KSIL ABS(U)
+
+
+! POUR UNE PDC SINGULIERE,
+
+! SOIT KSIS = DHS/(0.5 RHO U**2) DONNE DANS LA LITTERATURE
+! (DHS EST LA PERTE DE CHARGE SINGULIERE)
+
+! LE TERME SOURCE TSPDC VAUT DHS/L = - KSIS/L *(0.5 RHO U**2)
+
+! ON A CKUPDC = 0.5 KSIS/L ABS(U)
+
+! OU L DESIGNE LA LONGUEUR SUR LAQUELLE
+! ON A CHOISI DE REPRESENTER LA ZONE DE PDC SINGULIERE
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncepdp ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "matiss.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , iappel
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel , ielpdc, ikpdc
+integer ifml , icoul
+double precision alpha , cosalp, sinalp
+double precision vit2 , vit3 , ck2 , ck3
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+if(iappel.eq.1.or.iappel.eq.2) then
+
+!===============================================================================
+
+! 1. POUR CHAQUE PHASE : UN OU DEUX APPELS
+
+! PREMIER APPEL :
+
+! IAPPEL = 1 : NCEPDP : CALCUL DU NOMBRE DE CELLULES
+! AVEC PERTES DE CHARGE
+
+
+! DEUXIEME APPEL (POUR LES PHASES AVEC NCEPDP > 0) :
+
+! IAPPEL = 2 : ICEPDC : REPERAGE DU NUMERO DES CELLULES
+! AVEC PERTES DE CHARGE
+
+! REMARQUES :
+
+! Ne pas utiliser CKUPDC dans cette section
+! (il est rempli au troisieme appel, IAPPEL = 3)
+
+! Ne pas utiliser ICEPDC dans cette section
+! au premier appel (IAPPEL = 1)
+
+! On passe ici a chaque pas de temps
+! (ATTENTION au cout calcul de vos developpements)
+
+!===============================================================================
+
+
+! 1.1 A completer par l'utilisateur : selection des cellules
+! Pour Matisse, c'est fait par defaut selon les couleurs
+! -----------------------------------------------------------
+
+! --- Aucune pdc (initialisation)
+
+ ielpdc = 0
+
+! --- Pdc definies selon les couleurs du maillage
+! registres d'entree ICMTRI et de sortie ICMTRO
+ do iel = 1, ncel
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+ if(icoul.eq.icmtri) then
+ ielpdc = ielpdc + 1
+ if (iappel.eq.2) icepdc(ielpdc) = iel
+ elseif(icoul.eq.icmtro) then
+ ielpdc = ielpdc + 1
+ if (iappel.eq.2) icepdc(ielpdc) = iel
+ endif
+ enddo
+
+
+! 1.2 Sous section generique a ne pas modifier
+! ---------------------------------------------
+
+! --- Pour IAPPEL = 1,
+! Renseigner NCEPDP, nombre de cellules avec pdc
+! Le bloc ci dessous est valable pourles 2 exemples ci dessus
+
+ if (iappel.eq.1) then
+ ncepdp = ielpdc
+ endif
+
+!-------------------------------------------------------------------------------
+
+elseif(iappel.eq.3) then
+
+!===============================================================================
+
+! 2. POUR CHAQUE PHASE AVEC NCEPDP > 0 , TROISIEME APPEL
+
+! TROISIEME APPEL (POUR LES PHASES AVEC NCEPDP > 0) :
+
+! IAPPEL = 3 : CKUPDC : CALCUL DES COEFFICIENTS DE PERTE DE CHARGE
+! DANS LE REPERE DE CALCUL
+! STOCKES DANS L'ORDRE
+! K11, K22, K33, K12, K13, K23
+
+
+! REMARQUE :
+
+! Veillez a ce que les coefs diagonaux soient positifs.
+
+! Vous risquez un PLANTAGE si ce n'est pas le cas.
+
+! AUCUN controle ulterieur ne sera effectue.
+
+! ===========================================================
+
+
+! 2.1 A completer par l'utilisateur : valeur des coefs
+! Pour Matisse, c'est fait par defaut selon les couleurs
+! -----------------------------------------------------
+
+! --- Attention
+! Il est important que les CKUPDC soient completes (par des valeurs
+! nulles eventuellement) dans la mesure ou ils seront utilises pour
+! calculer un terme source dans les cellules identifiees precedemment.
+! On les initialise tous par des valeurs nulles.
+
+ do ikpdc = 1, 6
+ do ielpdc = 1, ncepdp
+ ckupdc(ielpdc,ikpdc) = 0.d0
+ enddo
+ enddo
+
+! --- Tenseur diagonal : pas pour Matisse
+! On elimine la section
+
+! --- Tenseur 3x3
+
+
+ do ielpdc = 1, ncepdp
+
+! Identification de la zone traitee
+ iel = icepdc(ielpdc)
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+
+! Donnees relatives aux registres "amont"
+ if(icoul.eq.icmtri)then
+ alpha = argamt*pi/180.d0
+ ck2 = 0.5d0*pdcalg/epregi
+ ck3 = 0.5d0*pdcatv/epregi
+! Donnees relatives aux registres "aval"
+ elseif(icoul.eq.icmtro)then
+ alpha = argavl*pi/180.d0
+ ck2 = 0.5d0*pdcslg/epregi
+ ck3 = 0.5d0*pdcstv/epregi
+! Par securite (la selection precedente des elements
+! a ete faite sur les couleurs ICMTRI et ICMTRO)
+ else
+ alpha = 0.d0
+ ck2 = 0.d0
+ ck3 = 0.d0
+ endif
+
+! Calcul des pertes de charge
+ cosalp = cos(alpha)
+ sinalp = sin(alpha)
+ vit2 = cosalp*rtpa(iel,iv(iphas)) &
+ - sinalp*rtpa(iel,iw(iphas))
+ vit3 = sinalp*rtpa(iel,iv(iphas)) &
+ + cosalp*rtpa(iel,iw(iphas))
+
+ ckupdc(ielpdc,1) = 0.d0
+ ckupdc(ielpdc,2) = &
+ cosalp**2*ck2*abs(vit2)+sinalp**2*ck3*abs(vit3)
+ ckupdc(ielpdc,3) = &
+ sinalp**2*ck2*abs(vit2)+cosalp**2*ck3*abs(vit3)
+ ckupdc(ielpdc,4) = 0.d0
+ ckupdc(ielpdc,5) = 0.d0
+ ckupdc(ielpdc,6) = &
+ cosalp*sinalp*(-ck2*abs(vit2)+ck3*abs(vit3))
+
+ enddo
+
+!-------------------------------------------------------------------------------
+
+endif
+
+return
+
+end
diff --git a/src/mati/mtphyv.f90 b/src/mati/mtphyv.f90
new file mode 100644
index 0000000..4481594
--- /dev/null
+++ b/src/mati/mtphyv.f90
@@ -0,0 +1,508 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mtphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE MATISSE : REMPLISSAGE DES VARIABLES PHYSIQUES
+! COPIE DE LA ROUTINE UTILISATEUR USPHYV
+
+
+
+! ATTENTION : (on conserve pour memoire les mises en garde de usphyv)
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "cstnum.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "matiss.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel , icoul , ifml
+integer iphas , ivarta, ivartc
+integer ipcrom, ipcvis, ipcvsl, ipcvsc, ipcvsp
+double precision xrtp , un0 , visct1
+double precision trfmtk, ustmat, drfmat
+double precision hray , zeta , f12 , cxy
+
+
+!===============================================================================
+! 0. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation memoire
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. REPERAGE DES VARIABLES
+!===============================================================================
+
+! --- Une seule phase
+iphas = 1
+
+! --- Reperage des scalaires (temp�rature air et de peau des colis)
+! ISCALT est complete en retour de l'IHM
+
+ivarta = isca(iscalt(iphas))
+ivartc = isca(itpcmt)
+
+! --- Rang de la masse volumique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCROM
+
+ipcrom = ipproc(irom(iphas))
+
+! --- Rang de la viscosite dynamique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCVIS
+
+ipcvis = ipproc(iviscl(iphas))
+
+! --- Rang des diffusivites des scalaires
+! dans PROPCE, prop. physiques au centre des elements : IPCVS*
+! - IPCVSL : scalaire ITAAMT = T air ambiant (scalaire temperature)
+! - IPCVSC : scalaire ITPCMT = T PeauColis
+! - IPCVSP : scalaire ITPPMT = T PeauParoi
+
+ipcvsl = ipproc(ivisls(iscalt(iphas)))
+ipcvsc = ipproc(ivisls(itpcmt))
+ipcvsp = ipproc(ivisls(itppmt))
+
+
+!===============================================================================
+! 2. GRANDEURS GEOMETRIQUES
+!===============================================================================
+
+! --- CXY et F12 (facteur de forme rayonnement)
+cxy = (ptrres + plgres) * 0.5d0
+zeta = cxy/dmcont
+f12 = 2.d0/pi*( (zeta**2 - 1.d0)**0.5d0 &
+ - zeta + asin(1.d0/zeta) )
+
+
+!===============================================================================
+! 3. MASSE VOLUMIQUE
+!===============================================================================
+
+! --- Masse volumique au centre des cellules
+
+! Utilisation de la loi des gaz parfait
+! (attention, il faut des temperatures en Kelvin)
+trfmtk = trfmat+tkelvi
+do iel = 1, ncel
+ xrtp = rtp(iel,ivarta)
+ propce(iel,ipcrom) = trfmtk*rrfmat /(xrtp + tkelvi)
+enddo
+
+!===============================================================================
+! 4. VISCOSITE DYNAMIQUE ET DIFFUSIVITE DES SCALAIRES
+!===============================================================================
+
+! --- Remarque : par securite, on s'assure que la viscosite et la
+! diffusivite ne sont jamais nulles en ajoutant si besoins la
+! viscosite moleculaire de l'air.
+
+
+do iel = 1, ncel
+
+
+! --- Vitesse de reference locale : max de la vitesse instantanee et
+! locale et de la vitesse de reference calculee dans mtini1
+
+ un0 = sqrt(rtpa(iel,iu(iphas))**2 + rtpa(iel,iv(iphas))**2 &
+ + rtpa(iel,iw(iphas))**2)
+ un0 = max(vitref,un0)
+
+
+! --- Viscosite totale de reference : VISCL0 calculee dans mtini1
+! MAIS en convection naturelle, VITREF est modifie dans mttsns
+! il faut donc alors recalculer VISCL0 ici.
+! Par securite on le recalcule aussi en convection forcee.
+
+! La viscosite dynamique turbulente est modelisee sous la forme
+! mu_t = rho * u*_ref * D_ref, formule dans laquelle :
+! . u*_ref est la vitesse de frottement deduite de la vitesse de
+! reference VITREF calculee precedemment et d'une intensite
+! turbulente imposee RTURB0
+! . D_ref est une distance de reference basee sur l'encombrement
+! du milieu
+
+! La valeur de u*_ref est calculee a partir de l'energie cinetique
+! turbulente k par u*_ref = Cmu**(1/4) k**(1/2). La valeur de k
+! se deduit de l'intensite turbulente I, supposee connue, par
+! k = 3/2 (I V_ref)**2 avec V_ref la vitesse de reference
+! VITREF calculee precedemment.
+
+! La valeur de D_ref est calculee par D_ref = 0.2(Pt - d) ou Pt est
+! le pas transverse du reseau et d le diametre des conteneurs.
+
+! Ainsi, mu_t = rho * u*_ref * L_ref
+! . u*_ref = Cmu**(1/4) * (3/2)**(1/2) * I * V_ref
+! . L_ref = 0.2 * (Pt - d)
+
+! On ajoute la viscosite moleculaire XMUMAT a mu_t pour obtenir
+! la viscosite dynamique totale VISCL0
+
+ ustmat = cmu**0.25d0 * sqrt(1.5d0) * (rturb0/100.d0) * vitref
+ drfmat = 0.2d0 * (ptrres-dmcont)
+
+ viscl0(iphas) = ro0(iphas) * ustmat * drfmat + xmumat
+
+
+! --- Viscosite totale VISCT1 calculee comme ci-dessus mais
+! . avec la vitesse de reference UN0 calculee ci-dessus
+! . avec la masse volumique instantanee et locale
+
+! La viscosite dynamique turbulente est modelisee sous la forme
+! mu_t = rho * u*_ref * D_ref, formule dans laquelle :
+! . u*_ref est la vitesse de frottement deduite de la vitesse de
+! reference UN0 calculee ci-dessus et d'une intensite
+! turbulente imposee RTURB0
+! . D_ref est un distance de reference basee sur l'encombrement
+! du milieu
+
+! La valeur de u*_ref est calculee � partir de l'energie cinetique
+! turbulente k par u*_ref = Cmu**(1/4) k**(1/2). La valeur de k
+! se deduit de l'intensite turbulente I, supposee connue, par
+! k = 3/2 (I V_ref)**2 avec V_ref la vitesse de reference
+! UN0 calculee precedemment.
+
+! La valeur de D_ref est calculee par D_ref = 0.2(Pt - d) ou Pt est
+! le pas transverse du reseau et d le diametre des conteneurs.
+
+! Ainsi, mu_t = rho * u*_ref * L_ref
+! . u*_ref = Cmu**(1/4) * (3/2)**(1/2) * I * V_ref
+! . L_ref = 0.2 * (Pt - d)
+
+! On ajoute la viscosite moleculaire XMUMAT a mu_t pour obtenir
+! la viscosite dynamique totale VISCL0
+
+ ustmat = cmu**0.25d0 * sqrt(1.5d0) * (rturb0/100.d0) * un0
+ drfmat = 0.2d0 * (ptrres-dmcont)
+
+ visct1 = propce(iel,ipcrom) * ustmat * drfmat + xmumat
+
+
+! --- Reperage des elements selon les zones du maillage
+
+! Couleur de l'element courant
+! (hypotheses : une couleur et une seule, pas de groupe,
+! et donc pas de boucle sur les familles)
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+
+
+! --- Zone de stockage
+ if(icoul.eq.icmtst) then
+
+! Viscosite totale
+ propce(iel,ipcvis) = max(viscl0(iphas),visct1)
+
+! Conductivite totale pour l'air (Nb de Prandlt total = 1.)
+ propce(iel,ipcvsl) = propce(iel,ipcvis)
+
+! Diffusivite equivalente pour la temperature de peau des colis
+! . Au dessus de HRESO ou entreposage en alveole : zero
+! . En dessous de HRESO sans alveole : rayonnement
+! phi lineique = HRAY*RF*(CXY-DMCONT)*gradT
+! avec RF=DMCONT/CXY rapport surfacique
+! On ajoute la viscosite moleculaire
+! (pour eviter zero dans les conditions aux limites)
+ if(xyzcen(3,iel).ge.hreso.or.ialveo.eq.1) then
+ propce(iel,ipcvsc) = 0.d0
+ else
+ hray = stephn*f12*emicon*(rtp(iel,ivartc)+tkelvi)**3
+ propce(iel,ipcvsc) = hray*(cxy-dmcont)*dmcont/cxy
+ endif
+ propce(iel,ipcvsc) = propce(iel,ipcvsc) + xmumat
+
+! Diffusivite equivalente pour la temperature de peau des murs
+! Pas de diffusion pour ce scalaire : traitement par terme source
+! (viscosite moleculaire pour eviter zero)
+ propce(iel,ipcvsp) = xmumat
+
+
+! --- Obstacles (registres amont)
+
+ elseif(icoul.eq.icmtri)then
+ propce(iel,ipcvis) = max(viscl0(iphas),visct1)
+ propce(iel,ipcvsl) = xmumat
+ propce(iel,ipcvsc) = xmumat
+ propce(iel,ipcvsp) = xmumat
+
+! --- Obstacles (registres aval)
+
+ elseif(icoul.eq.icmtro) then
+ propce(iel,ipcvis) = max(viscl0(iphas),visct1)
+ propce(iel,ipcvsl) = xmumat
+ propce(iel,ipcvsc) = xmumat
+ propce(iel,ipcvsp) = xmumat
+
+! --- Defaut (les autres zones)
+
+ elseif(icoul.eq.icmtdf) then
+ propce(iel,ipcvis) = max(viscl0(iphas),visct1)
+ propce(iel,ipcvsl) = propce(iel,ipcvis)
+ propce(iel,ipcvsc) = xmumat
+ propce(iel,ipcvsp) = xmumat
+
+! --- Cheminee d'alimentation (au dessus du convergent eventuel)
+! . on dope la diffusion pour homogeneiser T et U
+! et diminuer les risques de refoulement
+
+ elseif(icoul.eq.icmtci) then
+ propce(iel,ipcvis) = max(viscl0(iphas),20.d0*visct1)
+ propce(iel,ipcvsl) = propce(iel,ipcvis)
+ propce(iel,ipcvsc) = xmumat
+ propce(iel,ipcvsp) = xmumat
+
+! --- Cheminee d'evacuation (au dessus du convergent eventuel)
+! . on dope la diffusion pour homogeneiser T et U
+! et diminuer les risques de refoulement
+
+ elseif(icoul.eq.icmtco) then
+ propce(iel,ipcvis) = max(viscl0(iphas),20.d0*visct1)
+ propce(iel,ipcvsl) = propce(iel,ipcvis)
+ propce(iel,ipcvsc) = xmumat
+ propce(iel,ipcvsp) = xmumat
+
+! --- Sinon ...
+
+ else
+ propce(iel,ipcvis) = max(viscl0(iphas),visct1)
+ propce(iel,ipcvsl) = propce(iel,ipcvis)
+ propce(iel,ipcvsc) = xmumat
+ propce(iel,ipcvsp) = xmumat
+ endif
+
+enddo
+
+
+!===============================================================================
+! FORMATS
+!===============================================================================
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/mati/mtproj.f90 b/src/mati/mtproj.f90
new file mode 100644
index 0000000..f15d2c8
--- /dev/null
+++ b/src/mati/mtproj.f90
@@ -0,0 +1,395 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mtproj &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvep , nivep , ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , statis , tslagr , parbor , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! MODIFICATION UTILISATEUR EN FIN DE PAS DE TEMPS POUR MATISSE
+
+! COPIE ET SPECIALISATION DE USPROJ
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particules autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! moyennes statistiques !
+!(ncelet,nvlsta ! ! ! !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,ntersl ! ! ! lagrangien sur la phase porteuse !
+! parbor ! tr ! <-- ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "matiss.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta) , tslagr(ncelet,ntersl)
+double precision parbor(nfabor,nvisbr)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , ifac , ifml , icoul
+integer iphas , iuiph , iflmab
+double precision ts0 , vs0 , taamax , tpcmax , tppmax
+double precision flmass , bilent , potflo
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Gestion memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Une seule phase
+
+iphas = 1
+
+!===============================================================================
+! 1. AFFICHAGES
+!===============================================================================
+
+
+! --- Affichages au dernier pas de temps seulement
+
+if (ntmabs .eq. ntcabs) then
+
+! --- Nombre de Richardson : calcul et affichage par
+! . mtimpi en convection forcee
+! . mttsns en convection naturelle
+
+
+! --- Puissance totale
+ if (irangp.le.0) then
+ write(impmat,1001) puitot
+ endif
+
+
+! --- Debit enthalpique
+ if (irangp.le.0) then
+ write(impmat,1002) debcon
+ endif
+
+
+! --- Coeff d'echange
+ if (irangp.le.0) then
+ write(impmat,1011) cfecca
+ write(impmat,1012) cfecma
+ endif
+
+! --- Bilan masse en sortie
+! (la correction par FRDTRA est la correction correspondant
+! au rapport d'echelle transverse entre le reel et le modele)
+ iuiph = iu(iphas)
+ iflmab = ipprob(ifluma(iuiph))
+ flmass = 0.d0
+ do ifac = 1, nfabor
+ ifml = ifmfbr(ifac)
+ icoul = iprfml(ifml,1)
+ if (icoul.eq.icmtfo) then
+ flmass = flmass + propfb(ifac,iflmab)
+ endif
+ enddo
+ flmass = flmass * frdtra
+ if (irangp.ge.0) call parsom(flmass)
+
+ if (irangp.le.0) then
+ write(impmat,1021) flmass
+ endif
+
+! --- Temperature moyenne dans la cheminee d'evacuation
+! (scalaire 1)
+ ts0 = 0.d0
+ vs0 = 0.d0
+ do iel = 1, ncel
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+ if(icoul.eq.icmtco) then
+ ts0 = ts0 + volume(iel)*rtp(iel,isca(itaamt))
+ vs0 = vs0 + volume(iel)
+ endif
+ enddo
+ ts0 = ts0/max(vs0,epzero)
+ if (irangp.le.0) then
+ write(impmat,1022) ts0
+ endif
+
+
+! --- Calcul du bilan enthalpique en pourcentage
+! On calcule le rapport de rhoUS * Cp * Delta T (Watt)
+! a PUITOT (multiplication par 1.D3 car PUITOT est en kW,
+! division par 100 pour obtenir une donnee en %)
+! L'ecart de temperature est pris comme l'ecart entre la
+! temperature de sortie TS0 et la temperature d'entree TINIT
+ bilent = &
+ cp0(iphas)*flmass*(ts0-tinit)/(puitot*1.d3)*100.d0
+ if (irangp.le.0) then
+ write(impmat,1031) bilent
+ endif
+
+
+! --- Calcul du potentiel de flottabilite
+! Calcul de delta_rho * g * delta_h en Pascal avec, a pression
+! constante : delta_rho = rho_ref/T_ref * delta_T
+! D'ou POTFLO = rho_ref/T_ref * delta_T * g * Delta_h
+! L'ecart de temperature est pris comme l'�cart entre la
+! temperature de sortie TS0 et la temperature d'entree TINIT
+! L'ecart de hauteur est pris entre le haut de la cheminee de
+! sortie et la mi hauteur de la zone de stockage (z=0 au sol)
+ potflo = rrfmat/(trfmat+tkelvi)*(ts0-tinit) &
+ * sqrt(gx**2+gy**2+gz**2)*(hcheva-0.5d0*epchel*nchest)
+ if (irangp.le.0) then
+ write(impmat,1032) potflo
+ endif
+
+
+! --- Calcul des max des scalaires
+! . TAA* : Temperature Air Ambiant (scalaire ITAAMT)
+! . TPC* : Temperature Peau Colis (scalaire ITPCMT)
+! . TPP* : Temperature Peau Paroi (scalaire ITPPMT)
+
+ taamax = 0.d0
+ tpcmax = 0.d0
+ tppmax = 0.d0
+
+ do iel = 1, ncel
+ taamax = max(taamax , rtp(iel,isca(itaamt)))
+ tpcmax = max(tpcmax , rtp(iel,isca(itpcmt)))
+ tppmax = max(tppmax , rtp(iel,isca(itppmt)))
+ enddo
+
+ if (irangp.ge.0) then
+ call parmax(taamax)
+ call parmax(tpcmax)
+ call parmax(tppmax)
+ endif
+
+ if (irangp.le.0) then
+ write(impmat,1041) taamax
+ write(impmat,1042) tpcmax
+ write(impmat,1043) tppmax
+ endif
+
+ close(impmat)
+
+! Fin du test sur NTCABS
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+
+ 1001 format(' Puissance totale de l''installation ', &
+' :',E12.5, ' kW')
+ 1002 format(' Debit enthalpique vers le ciel de l''entrepot ', &
+' :',E12.5, ' kW')
+
+ 1011 format(' Coefficient d''echange moyen conteneur/air ', &
+' :',E12.5,' W/m2/C')
+ 1012 format(' Coefficient d''echange moyen mur/air ', &
+' :',E12.5,' W/m2/C')
+
+ 1021 format(' Debit masse de circulation d''air ', &
+' :',E12.5, ' kg/s')
+ 1022 format(' Temperature d''air en sortie ', &
+' :',E12.5, ' �C')
+
+ 1031 format(' Bilan enthalpique ', &
+' :',E12.5, ' %')
+ 1032 format(' Potentiel de flottabilite ', &
+' :',E12.5, ' Pa')
+
+ 1041 format(' Temperature maximale d''air ambiant ', &
+' :',E12.5, ' �C')
+ 1042 format(' Temperature maximale des conteneurs ', &
+' :',E12.5, ' �C')
+ 1043 format(' Temperature maximale des murs ', &
+' :',E12.5, ' �C')
+
+return
+end
diff --git a/src/mati/mttsns.f90 b/src/mati/mttsns.f90
new file mode 100644
index 0000000..8dbb93a
--- /dev/null
+++ b/src/mati/mttsns.f90
@@ -0,0 +1,1159 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mttsns &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ crvexp , crvimp , &
+ dam , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+!C FONCTION :
+! ----------
+
+! CALCUL DES TERMES SOURCES POUR LA COMPOSANTE DE VITESSE IVAR
+
+! SOUS-PROGRAMME SPECIFIQUE A MATISSE (COPIE DE USTSNS)
+
+
+! LES TERMES SOURCES SONT LES PERTES QUI N'ONT PAS ETE TRAITEES
+! DANS MTKPDC (I.E. TOUT SAUF LES REGISTRES)
+
+! IL SERAIT POSSIBLE DE REGROUPER MTTSNS ET MTKPDC EN UN SEUL
+! SOUS-PROGRAMME.
+
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT RHO*VOLUME)
+! CRVEXP en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! CRVIMP en kg /s :
+
+! VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CRVEXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CRVIMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de variable !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
+! crvimp(ncelet ! tr ! --> ! tableau de travail pour part implicit !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "matiss.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision dam(ncelet ),xam(nfac ,2)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ipcrom, ipp
+integer iel , ifml , icoul
+integer indixy, izone , nzones
+integer modntl
+double precision xlimin, xlimax, yrgmin, yrgmax, zalmin, zalmax
+double precision xzomin, xzomax, yzomin, yzomax
+double precision xtzc , xlzc , xhzc , xlce , xlcs
+double precision salv , xlalv , dhplen
+double precision cxsd , cysd , ctsd , rs0 , gapscx
+double precision rapsrf, smesr , smssr
+double precision fpfl , qlqp
+double precision roe , we0 , ve0
+double precision ros , ws0 , vs0 , ts0
+double precision rom , w0 , walv , un0 , unh , ureel
+double precision reye0 , reys0 , reyalv, reyres, reyhor
+double precision richar, betmat, gmat
+double precision teta0 , sde , sds , xxaa , xxem
+double precision acoeff, aprim
+double precision cpe , cps , cpc , pdce , pdcs
+double precision vamcaa, vamhaa, pdcfaa, pdcbaa, pdcraa, cmptaa
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Gestion memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Reperage des variables
+
+ipcrom = ipproc(irom (iphas))
+
+! --- Reperage du pas de temps pour les impressions listing
+
+if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+else
+ modntl = 1
+endif
+
+! --- Impressions
+
+ipp = ipprtp(ivar)
+chaine = nomvar(ipp)
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+endif
+if ((irangp.le.0).and.(modntl.eq.0)) then
+ write(nfecra,2001)chaine(1:8)
+endif
+
+! --- Compteurs pour moyennes et affichages
+
+! Vitesse alveole moyenne corrigee (reelle)
+vamcaa = 0.d0
+! Perte de charge moyenne alveole par frottement (Pa)
+pdcfaa = 0.d0
+! Perte de charge moyenne alveole par bifurcation laterale (Pa)
+pdcbaa = 0.d0
+! Perte de charge moyenne alveole par alimentation (reunification) (Pa)
+pdcraa = 0.d0
+! Vitesse alveole moyenne homogeneisee
+vamhaa = 0.d0
+! Compteur pour moyenne
+cmptaa = 0.d0
+
+
+!===============================================================================
+! 1. DIMENSIONS GEOMETRIQUES
+!===============================================================================
+
+
+! --- Dimensions de la zone de stockage
+! (Transverse (x), Longitudinal (y), Hauteur (z))
+
+xtzc = ptrres*nptran
+xlzc = plgres*nplgrs
+xhzc = epchel*nchest
+
+
+! --- Section debitante des cheminees (SDE : Entree Amont et SDS : Sortie)
+! FRDTRA, le facteur de reduction transverse, est le facteur
+! par lequel il faut diviser les sections d'entree ou les
+! debits si l'on represente un entrepot (reel, 3D) par un
+! calcul 2D.
+! SDCHEA et SDCHES sont les sections passantes reelles en entree
+! et sortie, au dessus des convergents eventuels.
+! SDE et SDS sont les sections passantes correspondantes
+! a prendre en compte dans le calcul (sections reelles divisees
+! par FRDTRA, rendant compte d'une reduction eventuelle du domaine
+! dans la direction transverse par rapport a la realite).
+! Neanmoins, SDE et SDS ne sont pas necessairement les sections
+! passantes geometriquement representees dans le maillage (voir
+! les rapports SMESR et SMSSR).
+
+sde = sdchea/frdtra
+sds = sdches/frdtra
+
+
+! --- Longueur cheminee
+! (XLCE : cheminee d'Entree sans le convergent,
+! XLCS : cheminee de Sortie sans le convergent ou sans le toit)
+
+xlce = hchali - hconve
+if (itypen.eq.1) then
+ xlcs = hcheva - hfttoi
+else
+ xlcs = hcheva - hconve
+endif
+
+
+! --- Surface debitante d'une alveole (entre chemise et colis)
+
+salv = pi * abs(dhalve**2 - dmcont**2)*0.25d0
+
+
+! --- Rapport des sections modele/voulu : SMESR et SMSSR
+
+! On multiplie les vitesses issues directement du calcul
+! dans les cheminees (au dessus des convergents eventuels)
+! par SMESR ou SMSRS pour obtenir des vitesses reelles.
+! SMESR est associe a la cheminee d'entree et SMSSR a la
+! cheminee de sortie.
+! SMESR et SMSSR different de FRDTRA (voir FRDTRA plus haut).
+
+! SMESR (resp. SMSSR) est le rapport entre la section passante
+! de la cheminee d'entree (resp. de sortie) telle qu'elle est
+! representee geometriquement dans le modele et la section
+! passante que l'on souhaite a modeliser (les sections sont
+! prises au dessus du convergent eventuel).
+! La section representee geometriquement peut etre differente de
+! la section que l'on souhaite modeliser par exemple si les
+! cheminees reelles sont de section circulaire alors qu'on les
+! modelise de section carree.
+! La section que l'on souhaite modeliser peut etre differente de
+! la section reelle si l'on realise un calcul 2D pour
+! representer une configuration reelle 3D (rapport FRDTRA).
+
+! Pour un cas modelise en 3D :
+! FRDTRA = 1, i.e. SDE=SDCHEA : la section que l'on souhaite
+! modeliser est egale a la section reelle,
+! on a, pour la cheminee d'entree (et de meme pour la cheminee
+! de sortie) :
+! SMESR = EPCHEM*XTZC/(RCONVE*SDCHEA)
+! ceci est bien le rapport des sections passantes
+! "(representee geometriquement)/(que l'on souhaite modeliser)"
+! (les sections sont prises au dessus du convergent eventuel).
+
+! Pour un cas modelise en 2D :
+! FRDTRA non unite, i.e. SDE=SDCHEA/FRDTRA : la section que
+! l'on souhaite modeliser est differente de la section reelle
+! (en general la section que l'on souhaite modeliser est une
+! fraction de la section reelle, dans la mesure ou la
+! puissance des colis modelises en 2D est une fraction de
+! la puissance totale reelle)
+! RCONV = 1 puisqu'il n'est pas possible de representer
+! geometriquement un convergent sur un maillage 2D,
+! on a, pour la cheminee d'entree (et de meme pour la cheminee
+! de sortie) :
+! SMESR = EPCHEM*XTZC/SDE
+! ceci est bien le rapport des sections passantes
+! "(representee geometriquement)/(que l'on souhaite modeliser)"
+! (les sections etant prises au dessus du convergent eventuel).
+
+smesr = epchem*xtzc/(rconve*sde)
+smssr = epchem*xtzc/(rconve*sds)
+
+
+! --- Rapport pas du reseau / diametre d'un conteneur
+
+cxsd = ptrres/dmcont
+cysd = plgres/dmcont
+ctsd = sqrt((cxsd*0.5d0)**2 + cysd**2)
+
+
+! --- Porosite de gap entre tubes
+
+gapscx = (cxsd - 1.d0) / cxsd
+
+!===============================================================================
+! 2. GRANDEURS PHYSIQUES
+!===============================================================================
+
+! --- Temperature et vitesse verticale en entree et sortie
+! (la vitesse servira pour le calcul des pertes de charges)
+
+! W moyenne dans la cheminee d'entree et volume correspondant
+we0 = 0.d0
+ve0 = 0.d0
+! W moyenne dans la cheminee de sortie et volume correspondant
+ws0 = 0.d0
+vs0 = 0.d0
+! T moyenne dans la cheminee de sortie
+ts0 = 0.d0
+
+do iel = 1, ncel
+ w0 = rtpa(iel,iw(iphas))
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+! Cheminee d'entree
+ if(icoul.eq.icmtci) then
+ ve0 = ve0 + volume(iel)
+ we0 = we0 + volume(iel)*w0
+! Cheminee de sortie
+ elseif(icoul.eq.icmtco) then
+ vs0 = vs0 + volume(iel)
+ ws0 = ws0 + volume(iel)*w0
+ ts0 = ts0 + volume(iel)*rtpa(iel,isca(itaamt))
+ endif
+enddo
+
+we0 = abs(we0)/max(ve0,epzero)
+ws0 = abs(ws0)/max(vs0,epzero)
+ts0 = ts0 /max(vs0,epzero)
+
+
+! --- Masse volumique entree a TINIT et sortie a TS0
+
+roe = (trfmat+tkelvi)*rrfmat/(tinit+tkelvi)
+ros = (trfmat+tkelvi)*rrfmat/(ts0 +tkelvi)
+
+
+! --- Calcul des coefficients de perte de charge des cheminees
+
+! - Entree
+
+! Nombre de Reynolds (on impose 1 au minimum)
+reye0 = roe*we0*smesr*dhchea/xmumat + 1.d0
+
+! Coefficient de perte de charge : frottement + diffuseur + filtre
+cpe = 0.3164d0 * reye0**(-0.25d0) * (xlce/dhchea) &
+ + pdccha + pdcfch
+
+
+! - Sortie
+
+! Nombre de Reynolds (on impose 1 au minimum)
+reys0 = ros*ws0*smssr*dhches/xmumat + 1.d0
+
+! Coefficient de perte de charge : frottement + diffuseur + clapet
+cps = 0.3164d0 * reys0**(-0.25d0) * (xlcs/dhches) &
+ + pdcche + pdccch
+
+! Pertes de charge (en Pa) et affichage
+if (ivar.eq.iw(iphas)) then
+
+ pdce = cpe * 0.5d0*roe*(we0*smesr)**2
+ pdcs = cps * 0.5d0*ros*(ws0*smssr)**2
+
+ if ((irangp.le.0).and.(ntcabs.eq.ntmabs)) then
+ write(impmat,5008) pdce
+ write(impmat,5009) pdcs
+ endif
+
+ if ((irangp.le.0).and.(modntl.eq.0)) then
+ write(nfecra,2002) &
+ reye0 , reys0 , &
+ we0*smesr, ws0*smssr, &
+ we0 , ws0 , &
+ smesr , smssr , &
+ pdce , pdcs , &
+ tinit , ts0 , &
+ roe , ros , &
+ cpe , cps
+ endif
+
+endif
+
+
+! --- Perte de charge reseau Diagramme 8.11 et 8.12 IdelCik
+! Definition de XXEM et XXAA
+
+! - Reseau de conteneurs en ligne (reseau a pas carre)
+
+if(iconlg.eq.1) then
+
+ xxem = -0.2d0
+ rs0 = (cxsd - 1.d0)/(cysd - 1.d0)
+ xxaa = nplgrs * (cxsd - 1.d0)**(-0.5d0)
+ if(ptrres.le.plgres) then
+ xxaa = xxaa * 1.52d0 * rs0**(-0.2d0)
+ else
+ xxem = xxem * rs0**(-2.d0)
+ xxaa = xxaa * 0.32d0 * (rs0-0.9d0)**(-0.68d0)
+ endif
+
+! - Reseau de conteneurs en quinconce (reseau a pas triangulaire)
+
+else
+
+ xxem =-0.27d0
+ rs0 = (cxsd - 1.d0)/(ctsd - 1.d0)
+ xxaa = (4.6d0 - 2.7d0*rs0)*(2.d0 - cxsd) + 3.2d0
+ xxaa = min(xxaa,3.2d0)
+! Pour N RANGEE de tubes
+ xxaa = xxaa * (nplgrs+1)
+
+endif
+
+! Le Reynolds est calcule pour un ecoulement de circulation naturelle
+! pour un diametre de DH m
+! Il sert dans les pertes de charges plus bas
+reyres = (roe+ros)*0.5d0 * vitref * dmcont / (gapscx * xmumat)
+
+! La vitesse sert a l'affichage
+un0 = vitref/(gapscx**2)
+
+! Affichage
+if( ivar.eq.iw(iphas).and.(modntl.eq.0) &
+ .and.(irangp.le.0) ) then
+ write(nfecra,2003) &
+ 0.5d0*rrfmat*un0*vitref*amppdc*xxaa*(reyres**xxem), &
+ xxaa*(reyres**xxem)
+endif
+
+
+!===============================================================================
+! 3. DEFINITION DES PERTES DE CHARGE
+!===============================================================================
+
+! === Boucle sur les cellules et selection selon leur couleur
+! ===========================================================
+
+do iel = 1, ncel
+
+ rom = propce(iel,ipcrom)
+
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+
+! === Cheminee d'alimentation (au dessus du convergent eventuel)
+! ===========================================================
+
+ if(icoul.eq.icmtci) then
+ crvimp(iel) = &
+ -0.5d0*volume(iel)*rom*we0*smesr*smesr/xlce*cpe
+
+! === Cheminee d'evacuation (au dessus du convergent eventuel)
+! ===========================================================
+
+ elseif(icoul.eq.icmtco) then
+ crvimp(iel) = &
+ -0.5d0*volume(iel)*rom*ws0*smssr*smssr/xlcs*cps
+
+! === Sortie de la zone de stockage
+! ===========================================================
+
+ elseif((icoul.eq.icmtro).or. &
+ (icoul.eq.icmtjo.and.ialveo.eq.1)) then
+
+! Pour representer les murs en sortie, on impose des pertes de
+! charge "infinies". Les portes de sortie doivent rester libres.
+
+! La position des murs dans la direction X est definie par des
+! zones dont les bornes XLIMIN et XLIMAX sont stockees dans
+! VIZCAR (avec l'indicateur ICPDCS faisant reference aux pertes de
+! charges a la sortie de la zone de stockage)
+ nzones = nzocar(iligne,icpdcs)
+ do izone = 1, nzones
+ xlimin = ptrres*vizcar(1,izone,iligne,icpdcs)
+ xlimax = ptrres*vizcar(2,izone,iligne,icpdcs)
+ if ( (xyzcen(1,iel).ge.xlimin).and. &
+ (xyzcen(1,iel).lt.xlimax) ) then
+ crvimp(iel) = crvimp(iel) - 1.d5*volume(iel)
+ endif
+ enddo
+
+! La position des murs dans la direction Z est definie par des
+! zones dont les bornes ZALMIN et ZALMAX sont stockees dans
+! VIZCAR (avec l'indicateur ICPDCS faisant reference aux pertes de
+! charges a la sortie de la zone de stockage)
+ nzones = nzocar(ialtit,icpdcs)
+ do izone = 1, nzones
+ zalmin = epchel*vizcar(1,izone,ialtit,icpdcs)
+ zalmax = epchel*vizcar(2,izone,ialtit,icpdcs)
+ if ( (xyzcen(3,iel).ge.zalmin).and. &
+ (xyzcen(3,iel).lt.zalmax) ) then
+ crvimp(iel) = crvimp(iel) - 1.d5*volume(iel)
+ endif
+ enddo
+
+
+! === Reseau dans la zone de stockage
+! ===========================================================
+
+! On traite successivement :
+! . pertes de charge de base en reseau
+! . pertes de charge verticales dans les alveoles
+! . pertes de charge horizontales pour le stockage en alveoles
+! . pertes de charge en zone libre de colis, stockage sans alveole
+
+! En resume :
+
+! - par defaut, partout, pour x, y, z : pdc= reseau
+
+! - en alveole, zone de colis, pour z : pdc= frot., bif., reu.
+! - en alveole, plenums, pour x, y : pdc=pdc+frot., bif., reu.
+! - en alveole, zone de colis, pour x, y : pdc= plenum inf*1.D4
+
+! - sans alveole, plenum sup, pour x, y, z : pdc= zero
+! - sans alveole, zone de colis, pour x, y, z : pdc=pdc*cartes (*0 ou *1)
+
+
+ elseif(icoul.eq.icmtst) then
+
+! --- Vitesse de reference (corrigee : vitesse en reseau)
+
+ un0 = sqrt(rtpa(iel,iu(iphas))**2 &
+ + rtpa(iel,iv(iphas))**2 &
+ + rtpa(iel,iw(iphas))**2)
+ un0 = max(vitref,un0)
+ un0 = un0/(gapscx**2)
+
+
+! --- Pertes de charge de base en reseau (cas standard)
+
+ if(ivar.eq.iw(iphas)) then
+ teta0 = 0.53d0 * xxaa * reyres**xxem
+ else
+ teta0 = 1.00d0 * xxaa * reyres**xxem
+ endif
+
+! Perte de charge en reseau de base
+! Attention, cette valeur est ecrasee ensuite
+! - pour le traitement des alveoles eventuelles
+! - dans les zones libres de colis
+
+ crvimp(iel) = &
+ -0.5d0*volume(iel)*rom*teta0*un0*amppdc/xlzc
+
+
+! --- Pertes de charges verticales dans les alveoles
+
+! On traite successivement :
+! . la perte de charge de frottement
+! . la perte de charge par bifurcation branche laterale
+! . la perte de charge d'alimentation apres alveole (reunification)
+
+ if(ialveo.eq.1) then
+
+ if ( xyzcen(3,iel).lt.hreso.and. &
+ xyzcen(3,iel).gt.hplen ) then
+
+ if(ivar.eq.iw(iphas)) then
+
+
+! - Perte de charge verticale par frottement
+
+! Vitesse verticale homogeneisee dans l'alveole
+ walv = abs (rtpa(iel,iw(iphas)))
+! Rapport surface d'un pas / surface passante reelle d'une alveole
+ rapsrf = ptrres * plgres / salv
+! Reynolds en alveole base sur une vitesse corrigee (minimum a 1)
+ reyalv = 1.d0 + &
+ rom*walv*rapsrf*abs(dhalve-dmcont)/xmumat
+! Hauteur d'alveole
+ xlalv = hreso - hplen
+! Coefficient de perte de charge reguliere par frottement par metre
+ cpc = &
+ 0.3164d0*reyalv**(-0.25d0)/abs(dhalve-dmcont)
+
+! Perte de charge verticale par frottement
+! On ecrase la perte de charge standard en reseau
+! calculee precedemment.
+ crvimp(iel) = &
+ - 0.5d0*volume(iel)*rom*walv*(rapsrf**2)*cpc
+
+
+! Compteurs pour impressions
+
+ cmptaa = cmptaa + 1.d0
+ pdcfaa = pdcfaa &
+ + 0.5d0*rom*(walv*rapsrf)**2 * cpc*xlalv
+ vamcaa = vamcaa + walv * rapsrf
+ vamhaa = vamhaa + walv
+
+
+! - Perte de charge verticale par bifurcation branche laterale
+! (cf Idel'cik, page 263, diagramme 7.21)
+
+! Rapport de surface (FPFL) et de debit (QLQP)
+! entre la branche laterale et la branche rectiligne de
+! la bifurcation (cf Idel'cik)
+ fpfl = hplen * ptrres / salv
+ qlqp = 1.d0 / nplgrs
+
+ if(qlqp*fpfl.gt.0.8d0) then
+ aprim = 0.9d0
+ else
+ aprim = 1.0d0
+ endif
+
+! Coefficient de perte de charge singuliere par bifurcation
+ cpc = aprim*(1.d0+(qlqp*fpfl)**2)/((qlqp*fpfl)**2)
+
+! Perte de charge verticale par bifurcation laterale
+! On l'ajoute a la perte de charge par frottement
+! calculee precedemment.
+! Comme la perte de charge est repartie sur la hauteur de l'alveole
+! il faut diviser par XLALV
+ crvimp(iel) = crvimp(iel) &
+ - 0.5d0*volume(iel)*rom*walv*(rapsrf**2) &
+ * cpc/xlalv
+
+
+! Compteurs pour impressions
+ pdcbaa = pdcbaa + 0.5d0*rom*(walv*rapsrf)**2 * cpc
+
+
+! - Perte de charge verticale par alimentation apres alveole (reunification)
+! (cf Idel'cik, page 249, diagramme 7.7)
+
+! Rapport de surface (FPFL) et de debit (QLQP)
+! entre la branche laterale et la branche rectiligne de
+! l'alimention (reunification) (cf Idel'cik)
+ fpfl = (xhzc - hreso) * ptrres / salv
+ qlqp = 1.d0 / nplgrs
+
+ acoeff = 1.d0
+
+! Coefficient de perte de charge singuliere par alimentation
+ cpc = acoeff &
+ * ( 1.d0 + (qlqp*fpfl)**2 - 2.d0*(1.d0-qlqp) ) &
+ / ( (qlqp*fpfl)**2 )
+
+
+! Perte de charge verticale par alimentation (reunification)
+! On l'ajoute a la perte de charge par frottement et a la
+! perte de charge singuliere calculee precedemment.
+! Comme la perte de charge est repartie sur la hauteur de l'alveole
+! il faut diviser par XLALV
+ crvimp(iel) = crvimp(iel) &
+ - 0.5d0*volume(iel)*rom*walv*(rapsrf**2) &
+ * cpc/xlalv
+
+! Compteurs pour impressions
+ pdcraa = pdcraa + 0.5d0*rom*(walv*rapsrf)**2 * cpc
+
+
+! Fin du traitement des pertes de charges verticales en alveole
+ endif
+ endif
+ endif
+
+
+! --- Pertes de charges horizontales pour le stockage en alveoles
+
+! On traite successivement :
+! . la perte de charge de reunion (au dessus des colis) et
+! de bifurcation (au dessous des colis)
+! . la perte de charge de frottement
+! au dessus et au dessous des colis
+! . la perte de charge dans la zone de colis
+
+ if(ialveo.eq.1) then
+
+ if(ivar.eq.iu(iphas).or.ivar.eq.iv(iphas)) then
+
+
+! - Perte de charge horizontale de reunion et de bifurcation
+
+! La perte de charge calculee dans la zone des colis sera modifiee
+! plus bas (pour simplifier les tests, les formules valables
+! au dessus et au dessous des colis sont egalement appliquees
+! dans la zone des colis).
+
+! Rapport de debit (QLQP) entre la branche laterale et
+! la branche rectiligne (cf Idel'cik)
+ qlqp = 1.d0 / nplgrs
+
+ if(xyzcen(3,iel).gt.hreso) then
+
+! Coefficient de perte de charge horizontale de reunion
+! pour le stockage en alveoles (apres alveole, branche rectiligne)
+! (cf Idel'cik, page 249, diagramme 7.7)
+
+ cpc = (1.55d0*qlqp-qlqp**2) / (1.d0-qlqp)**2
+
+ else
+
+! Coefficient de perte de charge horizontale de bifurcation
+! pour le stockage en alveoles (avant alveole, branche rectiligne)
+! (cf Idel'cik, page 265, diagramme 7.23)
+
+! Ici, on traite la zone XYZCEN(3,IEL).LE.HRESO et donc non
+! seulement le dessous des colis mais aussi la zone des colis.
+! Neanmoins, la perte de charge dans la zone des colis sera
+! modifiee plus bas.
+
+ cpc = 0.4d0 * qlqp**2 / (1.d0-qlqp)**2
+
+ endif
+
+
+! Perte de charge horizontale de reunion ou de bifurcation
+! On l'ajoute a CRVIMP
+! Comme la perte de charge est repartie sur la hauteur de l'alveole
+! il faut diviser par XLZC
+! On utilise la vitesse de gap UN0 (les puits sont supposes traverser
+! les plenums superieur et inferieur)
+ crvimp(iel) = crvimp(iel) &
+ - 0.5d0*volume(iel)*rom*un0 * cpc/xlzc
+
+
+! - Perte de charge horizontale de frottement
+! au dessus et au dessous des colis
+
+! La perte de charge calculee dans la zone des colis sera modifiee
+! plus bas (pour simplifier les tests, les formules valables
+! au dessus et au dessous des colis sont egalement appliques
+! dans la zone des colis).
+
+! Vitesse homogeneisee locale
+ unh = sqrt(rtpa(iel,iu(iphas))**2 &
+ + rtpa(iel,iv(iphas))**2 &
+ + rtpa(iel,iw(iphas))**2)
+
+! Reynolds au dessus et au dessous des colis (minimum 1)
+! seul le diametre hydraulique considere differe
+ if(xyzcen(3,iel).gt.hreso) then
+ dhplen = 2.d0*(xhzc - hreso)
+ else
+ dhplen = 2.d0*hplen
+ endif
+ reyhor = rom*unh*dhplen/xmumat + 1.d0
+
+! Coefficient de perte de charge reguliere par frottement par metre
+ cpc = &
+ 0.3164d0 * reyhor**(-0.25d0) / dhplen
+
+! Perte de charge horizontale par frottement
+! On l'ajoute a la perte de charge par reunion et bifurcation
+! On ne doit pas diviser par XLZC car CPC est deja calcule par
+! metre : on n'a pas multiplie par XLZC dans CPC
+ crvimp(iel) = crvimp(iel) &
+ - 0.5d0*volume(iel)*rom*un0 * cpc
+
+
+! - Perte de charge horizontale dans la zone des colis
+! On augmente la valeur de perte de charge calculee
+! precedemment, pour guider l'ecoulement sur la verticale
+
+ if ( xyzcen(3,iel).lt.hreso.and. &
+ xyzcen(3,iel).gt.hplen) then
+ crvimp(iel) = crvimp(iel) * 1.d4
+ endif
+
+! Fin du traitement des pertes de charges horizontales en alveole
+ endif
+ endif
+
+
+! --- Perte de charge en zone libre de colis en stockage sans alveole
+! Dans les zones libres, on annule la perte de charge
+
+ if(ialveo.ne.1) then
+
+! Au dessus des colis
+ if (xyzcen(3,iel).ge.hreso) then
+ crvimp(iel) = 0.d0
+ endif
+
+! Les entrepots ne sont pas uniformement remplis.
+! Pour repr�senter la carte d'encombrement des rangees de colis, on
+! repere les rangees occupees (coordonnee Y, indicateur IRANGE)
+! par leurs bornes YZOMIN et YZOMAX qui sont stockees dans VIZCAR
+! (avec l'indicateur ICPDCR faisant reference aux pertes de
+! charge en reseau)
+
+ yrgmin = 0.d0
+ yrgmax = nplgrs*plgres
+
+ if ( (xyzcen(2,iel).ge.yrgmin).and. &
+ (xyzcen(2,iel).lt.yrgmax) ) then
+
+ indixy = 0
+ nzones = nzocar(irange,icpdcr)
+ do izone = 1, nzones
+ yzomin = plgres*vizcar(1,izone,irange,icpdcr)
+ yzomax = plgres*vizcar(2,izone,irange,icpdcr)
+ if ( (xyzcen(2,iel).ge.yzomin).and. &
+ (xyzcen(2,iel).lt.yzomax) ) then
+ indixy = 1
+ endif
+ enddo
+
+ if (indixy.eq.0) then
+ crvimp(iel) = 0.d0
+ endif
+
+ endif
+
+! Les entrepots ne sont pas uniformement remplis.
+! Pour repr�senter la carte d'encombrement des lignes de colis, on
+! repere les lignes occupees (coordonnee X, indicateur ILIGNE)
+! par leurs bornes XZOMIN et XZOMAX qui sont stockees dans VIZCAR
+! (avec l'indicateur ICPDCR faisant reference aux pertes de
+! charge en reseau)
+
+ xlimin = 0.d0
+ xlimax = nptran*ptrres
+
+ if ( (xyzcen(1,iel).ge.xlimin).and. &
+ (xyzcen(1,iel).lt.xlimax) ) then
+ indixy = 0
+ nzones = nzocar(iligne,icpdcr)
+ do izone = 1, nzones
+ xzomin = ptrres*vizcar(1,izone,iligne,icpdcr)
+ xzomax = ptrres*vizcar(2,izone,iligne,icpdcr)
+ if ( (xyzcen(1,iel).ge.xzomin).and. &
+ (xyzcen(1,iel).lt.xzomax) ) then
+ indixy = 1
+ endif
+ enddo
+
+ if (indixy.eq.0) then
+ crvimp(iel) = 0.d0
+ endif
+
+ endif
+
+! Fin du traitement des pertes de charges en zone libre sans alveole
+ endif
+
+
+! === Entree de la zone de stockage
+! ===========================================================
+
+ elseif((icoul.eq.icmtri).or. &
+ (icoul.eq.icmtji.and.ialveo.eq.1)) then
+
+! Pour repr�senter les murs en entree, on impose des pertes de
+! charge "infinies". Les portes d'entree doivent rester libres.
+
+! La position des murs dans la direction X est definie par des
+! zones dont les bornes XLIMIN et XLIMAX sont stockees dans
+! VIZCAR (avec l'indicateur ICPDCE faisant reference a la sortie)
+ nzones = nzocar(iligne,icpdce)
+ do izone = 1, nzones
+ xlimin = ptrres*vizcar(1,izone,iligne,icpdce)
+ xlimax = ptrres*vizcar(2,izone,iligne,icpdce)
+ if ( (xyzcen(1,iel).ge.xlimin).and. &
+ (xyzcen(1,iel).lt.xlimax) ) then
+ crvimp(iel) = crvimp(iel) - 1.d5*volume(iel)
+ endif
+ enddo
+
+! La position des murs dans la direction Z est definie par des
+! zones dont les bornes ZALMIN et ZALMAX sont stockees dans
+! VIZCAR (avec l'indicateur ICPDCE faisant reference a la sortie)
+ nzones = nzocar(ialtit,icpdce)
+ do izone = 1, nzones
+ zalmin = epchel*vizcar(1,izone,ialtit,icpdce)
+ zalmax = epchel*vizcar(2,izone,ialtit,icpdce)
+ if ( (xyzcen(3,iel).ge.zalmin).and. &
+ (xyzcen(3,iel).lt.zalmax) ) then
+ crvimp(iel) = crvimp(iel) - 1.d5*volume(iel)
+ endif
+ enddo
+
+! Fin du test sur les couleurs et de la boucle sur les elements
+ endif
+enddo
+
+!===============================================================================
+! 4. CALCULS ET AFFICHAGES FINALS
+!===============================================================================
+
+! --- Moyennes relatives au cas alveoles
+
+if(cmptaa.gt.0.d0) then
+
+ vamcaa = vamcaa/cmptaa
+ pdcfaa = pdcfaa/cmptaa
+ pdcbaa = pdcbaa/cmptaa
+ pdcraa = pdcraa/cmptaa
+ vamhaa = vamhaa/cmptaa
+
+ if ((modntl.eq.0).and.(irangp.le.0)) then
+ write(nfecra,2004) vamcaa, vamhaa, &
+ pdcfaa, pdcbaa, pdcraa
+ endif
+endif
+
+
+! --- En convection naturelle,
+! . actualisation et impression de la vitesse de reference
+! (utilisee dans mtphyv en particulier)
+! . calcul et impression du Richardson
+
+if(icofor.eq.0.and.ivar.eq.iw(iphas))then
+
+! - Vitesse de reference
+
+! Calcul de la moyenne des vitesses homogenes moyennes
+! dans les cheminees d'entree et de sortie :
+! 0.5D0*(WE0+WS0)
+! Cette vitesse est relative a une section de cheminee
+! sur le maillage de EPCHEM*XTZC/RCONVE (section dans
+! la partie haute, au dessus du convergent eventuel) :
+! le debit associe, represente sur le maillage, est donc
+! Q=0.5D0*(WE0+WS0)*EPCHEM*XTZC/RCONVE
+! Ce debit traverse ensuite la zone de stockage de section
+! passante XTZC*XHZC. La vitesse qui s'en deduit dans
+! cette region est donc Q/(XTZC*XHZC), soit
+! 0.5D0*(WE0+WS0)*EPCHEM*XTZC/(RCONVE*XTZC*XHZC)
+! On la relaxe a partir de l'ancienne valeur de VITREF
+
+ vitref = ( 0.5d0*(we0+ws0)*epchem/(rconve*xhzc) &
+ + vitref )*0.5d0
+
+! Impressions
+ if ((modntl.eq.0).and.(irangp.le.0)) then
+ write(nfecra,2005) vitref, viscl0(iphas)
+ endif
+
+
+! - Richardson
+
+! Calcul selon la formule Ri = g beta DeltaT H_ref / U**2 avec :
+! . beta = 1/((TS0+TINIT)*0.5D0 + TKELVI)
+! . DeltaT = TS0-TINIT (temperature sortie-entree)
+! . H_ref = XHZC (hauteur zone de stockage)
+! . U = VITREF/GAPSCX (U gap)
+
+ gmat = sqrt(gx**2+gy**2+gz**2)
+ betmat = 1.d0/((ts0+tinit)*0.5d0 + tkelvi)
+ ureel = vitref/gapscx
+
+ richar = gmat*betmat*(ts0-tinit)*xhzc/(ureel**2)
+
+! Impressions
+ if ((modntl.eq.0).and.(irangp.le.0)) then
+ write(nfecra,2006) ureel, richar
+ endif
+ if ((irangp.le.0).and.(ntcabs.eq.ntmabs)) then
+ write(impmat,5011) richar
+ endif
+
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES MATISSE POUR LA VARIABLE ',A8,/)
+ 2001 FORMAT (/,3X,'** INFORMATIONS SUR MATISSE, VARIABLE ',A8,/, &
+ 3X,' -------------------------------------------')
+ 2002 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Cheminees (au dessus des convergents eventuels) ',/,&
+'mati --------------------------- entree sortie unite',/,&
+'mati --------------------------------------------------------',/,&
+'mati Nombre de Reynolds ', E12.5 , E12.5 ,' -',/,&
+'mati Vitesse reelle ', E12.5 , E12.5 ,' m/s',/,&
+'mati Vitesse homogeneisee ', E12.5 , E12.5 ,' m/s',/,&
+'mati Sct� maillage/a representer', E11.5 , E12.5 ,' -',/,&
+'mati Perte de charge ', E12.5 , E12.5 ,' Pa',/,&
+'mati T� (TINIT, moyenne sortie)', E12.5 , E12.5 ,' �C',/,&
+'mati Masse volumique associee ', E12.5 , E12.5 ,' kg/m3',/,&
+'mati Coeff. de perte de charge ', E12.5 , E12.5 ,' -',/,&
+'mati --------------------------------------------------------',/)
+ 2003 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Reseau ',/,&
+'mati ------ ',/,&
+'mati Perte de charge reseau (/0.53) ', E12.5 ,' Pa',/,&
+'mati Coeff. de perte de charge (/0.53) ', E12.5 ,' -',/,&
+'mati --------------------------------------------------------',/)
+ 2004 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Alveoles ',/,&
+'mati -------- ',/,&
+'mati Vitesse moyenne reelle ', E12.5 ,' m/s',/,&
+'mati Vitesse moyenne homogeneisee ', E12.5 ,' m/s',/,&
+'mati Pdc reguliere moyenne de frottement ', E12.5 ,' Pa',/,&
+'mati Pdc singuliere moyenne de bifurcation ', E12.5 ,' Pa',/,&
+'mati Pdc singuliere moyenne de reunification', E11.5 ,' Pa',/,&
+'mati --------------------------------------------------------',/)
+ 2005 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Vitesse de reference (zone de stockage) ',/,&
+'mati -------------------- ',/,&
+'mati Vitesse debitante homogeneisee ', E12.5 ,' m/s',/,&
+'mati Viscosite dynamique totale ', E12.5 ,' kg/m/s',/,&
+'mati --------------------------------------------------------',/)
+ 2006 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Richardson (zone de stockage) ',/,&
+'mati ---------- ',/,&
+'mati Vitesse reelle de reference ', E12.5 ,' m/s',/,&
+'mati Richardson base sur la vitesse reelle ', E12.5 ,' -',/,&
+'mati --------------------------------------------------------',/)
+
+ 5008 format(' Perte de charge de cheminee d''entree ',&
+ ' :', E12.5, ' Pa')
+ 5009 format(' Perte de charge de cheminee de sortie ',&
+ ':', E12.5, ' Pa')
+ 5011 format(' Nombre de Richardson ',&
+ ':', E12.5)
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/mati/mttssc.f90 b/src/mati/mttssc.f90
new file mode 100644
index 0000000..6bbf54b
--- /dev/null
+++ b/src/mati/mttssc.f90
@@ -0,0 +1,1350 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mttssc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ iconra , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ crvexp , crvimp , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+
+! CALCUL DES TERMES SOURCES POUR LE SCALAIRE ISCAL
+
+! SOUS-PROGRAMME SPECIFIQUE A MATISSE (COPIE DE USTSSC)
+
+! LES SEULS SCALAIRES TRAITES SONT
+! ISCA(ITAAMT) TEMPERATURE DE L'AIR
+! ISCA(ITPCMT) TEMPERATURE DE PEAU DES COLIS
+! ISCA(ITPPMT) TEMPERATURE DE PEAU DES MURS
+
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT RHO*VOLUME)
+! CRVEXP en kg variable/s :
+! ex : pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! CRVIMP en kg /s :
+
+! VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CRVEXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CRVIMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! iconra ! te ! <-- ! tab de connectivite pour !
+! (ncelet+1) ! ! ! le rayonnement et les panaches !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
+! crvimp(ncelet ! tr ! --> ! tableau de travail pour terme instat !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "cstnum.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+include "matiss.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer iconra(ncelet)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar , iiscvr, ipcrom, iphas
+integer icoul , ifml , iel , jel
+integer modntl
+integer nzones, izone
+double precision xnu0 , xlamb0, prand0, phi0
+double precision gmat , untier
+double precision fform , emis
+double precision hplus , hmoin , hmax , difx , dify , dhmur
+double precision fragh , xxav , tbulk , un0 , ptot
+double precision raleiz, reynol
+double precision xnsraz, xnsrey, xnsalv
+double precision hraz , hrey , h0 , hray
+double precision hmrey , hmraz , hm0 , hmray , hnb
+double precision cpcont, cpparo
+double precision xlimin, xlimax, yrgmin, yrgmax, zalmin, zalmax
+double precision sqz
+double precision dhe , dhs , ptcn
+double precision fptsto, pvccsc, pccsc
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Gestion memoire
+idebia = idbia0
+idebra = idbra0
+
+
+! --- Numero du scalaire a traiter : ISCAL (argument)
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+! --- Indicateur de variance
+! Si ISCAVR = 0 :
+! le scalaire ISCAL n'est pas une variance
+! Si ISCAVR > 0 et ISCAVR < NSCAL + 1 :
+! le scalaire ISCAL est une variance associee
+! au scalaire ISCAVR
+iiscvr = iscavr(iscal)
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Masse volumique
+ipcrom = ipproc(irom(iphas))
+
+
+! --- Reperage du pas de temps pour les impressions listing
+if(ntlist.gt.0) then
+ modntl = mod(ntcabs,ntlist)
+elseif(ntlist.eq.-1.and.ntcabs.eq.ntmabs) then
+ modntl = 0
+else
+ modntl = 1
+endif
+
+! --- Impression
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+endif
+if((irangp.le.0).and.(modntl.eq.0)) then
+ write(nfecra,2001) chaine(1:8)
+endif
+
+! --- Numerique
+untier = 1.d0/3.d0
+
+!===============================================================================
+! 1. DIMENSIONS GEOMETRIQUES
+!===============================================================================
+
+
+!===============================================================================
+! 2. PROPRIETES PHYSIQUES
+!===============================================================================
+
+! --- Proprietes de l'air
+
+! Nombre de Prandtl moleculaire
+prand0 = 0.7d0
+! Viscosite cinematique moleculaire (nu en m2.s-1)
+xnu0 = xmumat/ro0(iphas)
+! Condutivite thermique moleculaire (lambda en W.m-1.K-1)
+xlamb0 = (xnu0/prand0)*cp0(iphas)*ro0(iphas)
+
+
+! --- Capacite thermique fictive pour le solide
+
+! On cherche un etat stationnaire comme limite d'un transitoire
+! Les equations portant sur la temperature T des solides
+! comportent un terme en CP dT/dt qui tend vers zero a
+! convergence. La valeur de CP est utilisee pour accelerer
+! la convergence : elle correspond a l'utilisation d'un
+! pas de temps adapte pour la temperature des solides (comme
+! on pourrait le faire avec CDTVAR)
+
+cpcont = 1.d0
+cpparo = 1.d0
+
+
+!===============================================================================
+! 2. EROSION DES PANACHES DE CONVECTION NATURELLE
+!===============================================================================
+
+! Le but est de reporter dans la zone de ciel une partie de la
+! puissance transmise a l'air dans la zone de stockage.
+! Ceci permet de simuler l'effet des panaches, le debit
+! enthalpique de ceux-ci etant prescrit par l'utilisateur.
+
+! Calcul de DHS, DHE
+
+! --- Debit enthalpique de convection naturelle calcule (initialisation)
+dhs = 0.d0
+
+! --- Debit enthalpique de convection naturelle impose pour les panaches
+
+! Nul par defaut (pas de modelisation des panaches)
+dhe = 0.d0
+! Calcul, si modelisation des panaches
+if(imdcnt.eq.1) then
+ dhe = dhpcnt/frdtra
+endif
+
+!===============================================================================
+! 2. RAYONNEMENT
+!===============================================================================
+
+! --- Flux d'un conteneur (puissance ramenee a la surface en W.m-2)
+
+! En cas de stockage en alveole, il y a un plenum inferieur libre
+if(ialveo.eq.1) then
+ phi0 = puicon/((hreso-hplen)*dmcont*pi)
+else
+ phi0 = puicon/(hreso*dmcont*pi)
+endif
+
+! --- Facteur de forme (alveole ou mur) / conteneur
+
+! En alveole, le conteneur voit l'alveole entiere et c'est tout
+if(ialveo.eq.1) then
+
+ fform = 1.d0
+
+! Sans alveole, le facteur de forme depend de la structure du reseau
+else
+
+! Pour un reseau en ligne, considerer une rangee suffit
+! (valable jusqu'a PTRRES/DMCONT=4)
+ fform = sqrt( sqrt(dmcont/ptrres) + (dmcont/ptrres) )
+
+! Pour un reseau en quinconce (reseau a pas triangulaire), on
+! complete par la contribution d'une seconde rangee
+ if(iconlg.eq.0) then
+ fform = max( (fform + 0.22d0), 1.d0 )
+ endif
+
+endif
+
+
+! --- Emissivite equivalente (conteneur / mur)
+emis = 1.d0/(1.d0/emicon + 1.d0/emimur)
+
+! --- Densite de surface d'echange (par unite de hauteur)
+xxav = pi*dmcont/(ptrres*plgres)
+
+
+! --- Connectivite pour le rayonnement colis / plafond
+! et pour la modelisation des panaches
+! Une connectivite est necessaire pour relier la couche
+! superieure de la zone occupee par des colis et les
+! mailles situees directement sous le plafond
+
+! Cote du haut des mailles du haut des conteneurs
+hplus = hreso
+! Cote du bas des mailles du haut des conteneurs
+hmoin = hreso - epchel
+! Cote du bas des mailles touchant le plafond
+hmax = epchel*nchest - epchel
+
+! Calcul de la connectivite
+! Attention, c'est quadratique ...
+! mais on ne le fait qu'au premier passage
+
+! Calcul uniquement si pas deja fait et si utile
+! (utile si les colis ne touchent pas le plafond)
+if( (icnrok.eq.0).and.(hreso.lt.epchel*nchest) ) then
+! On repere les mailles de plafond dans la zone de stockage
+ do iel = 1, ncel
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+ if(icoul.eq.icmtst.and.xyzcen(3,iel).gt.hmax)then
+! On repere la maille du haut des colis situee dessous
+ do jel = 1, ncel
+ difx = abs(xyzcen(1,jel)-xyzcen(1,iel))
+ dify = abs(xyzcen(2,jel)-xyzcen(2,iel))
+ if(difx.lt.ptrres*1.d-2.and.dify.lt.plgres*1.d-2) then
+ if ( xyzcen(3,jel).lt.hplus.and. &
+ xyzcen(3,jel).gt.hmoin ) then
+ iconra(iel) = jel
+ endif
+ endif
+ enddo
+ endif
+ enddo
+! On indique que la connectivite a ete calculee
+ icnrok = 1
+endif
+
+!===============================================================================
+
+! ON VA COMPLETER CI-DESSOUS LES TERMES SOURCES
+! - PUREMENT EXPLICITES (PUISSANCE)
+! - PARTIELLEMENT EXPLICITES ET IMPLICITES (ECHANGES)
+
+
+! ON UTILISE LE MODELE DE TERME SOURCE SUIVANT, POUR UN SCALAIRE F :
+
+! S = A * F + B
+
+! APPARAISSANT DANS LES EQUATIONS DE TRANSPORT DE F SOUS LA FORME :
+
+! RHO VOLUME D(F)/Dt = VOLUME*S
+
+
+! CE TERME A UNE PARTIE QU'ON VEUT IMPLICITER : A
+! ET UNE PARTIE QU'ON VA TRAITER EN EXPLICITE : B
+
+
+! PAR EXEMPLE SI ON A :
+! A = - RHO / TAUF
+! B = RHO * PRODF
+! AVEC
+! TAUF = 10.D0 [secondes ] (TEMPS DE DISSIPATION DE F)
+! PRODF = 100.D0 [variable/s] (PRODUCTION DE F PAR UNITE DE TEMPS)
+
+! ON A ALORS
+! CRVIMP(IEL) = VOLUME(IEL)* A = - VOLUME(IEL) (RHO / TAUF )
+! CRVEXP(IEL) = VOLUME(IEL)* B = VOLUME(IEL) (RHO * PRODF)
+
+!===============================================================================
+
+! === Initialisation
+! ===========================================================
+
+! --- Compteurs
+! pour moyenne et affichage, mais pas seulement
+
+! Coefficient d'echange moyen de convection forcee
+hmrey = 0.d0
+! Coefficient d'echange moyen de convection naturelle
+hmraz = 0.d0
+! Coefficient d'echange convectif moyen efficace
+hm0 = 0.d0
+! Coefficient d'echange radiatif moyen pour les parois
+hmray = 0.d0
+! Compteur pour moyenne
+hnb = 0.d0
+! Puissance totale sans panache
+ptot = 0.d0
+! Puissance totale avec panache
+ptcn = 0.d0
+
+! Gravite
+gmat = sqrt(gx**2+gy**2+gz**2)
+
+
+! === Boucle sur les cellules et selection selon couleur
+! ===========================================================
+
+do iel = 1, ncel
+
+! Vitesse horizontale
+ un0 = sqrt(rtp(iel,iu(iphas))**2+rtp(iel,iv(iphas))**2)
+
+! Temperature de reference Kelvin
+ tbulk = (tinit+rtp(iel,isca(itaamt)))*0.5d0 + tkelvi
+
+! Raleigh/DeltaT = FRAGH = g*H**3*beta/(nu a)
+! . g = GMAT
+! . H = XYZCEN(3,IEL) : on suppose que le sol est a z=0
+! . beta = 1/TBULK
+! . nu = XNU0
+! . a = nu/Pr = XNU0/PRAND0
+
+ fragh = gmat*xyzcen(3,iel)**3*prand0/(tbulk*xnu0**2)
+
+! Couleur pour selection de la zone de stockage
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+
+ if(icoul.eq.icmtst) then
+
+
+! === Calcul du coefficient d'echange par rayonnement
+! ===========================================================
+
+! Coeff d'echange = flux / (S (Tcolis-Tparoi))
+! = Sigma Epsilon FactForme (Tcolis+Tparoi)(Tcolis**2+Tparoi**2)
+
+! La paroi consideree est le plafond ou les murs ou les alveoles
+
+! --- Zone de ciel
+! On utilise la connectivite calculee precedemment
+ if(icnrok.eq.1.and.xyzcen(3,iel).gt.hmax) then
+
+! En presence d'alveoles,
+! le plafond echange avec les alveoles face a face
+! (seule l'alveole directement en face est vue,
+! l'alveole voit un disque de plafond)
+! La temperature du plafond et des alveoles est representee
+! par le meme scalaire
+! Ce coefficient est utilise pour le calcul des termes sources
+! permettant de determiner la temperature de peau des parois
+! (plafond, mur, alveoles)
+! On le verra aussi intervenir pour un calcul de temperature
+! de colis, mais dans la zone de ciel ou la temperature de colis
+! n'a pas de signification (et comme il n'y a pas de diffusion
+! en alveoles, c'est ok)
+ if(ialveo.eq.1) then
+ hray = stephn*emimur &
+ * (0.25d0*pi*dmcont**2)/(ptrres*plgres) &
+ * ( rtp(iconra(iel),isca(itppmt))+tkelvi &
+ +rtp( iel ,isca(itppmt))+tkelvi) &
+ * ((rtp(iconra(iel),isca(itppmt))+tkelvi)**2 &
+ +(rtp( iel ,isca(itppmt))+tkelvi)**2)
+
+! Sans alveoles,
+! le plafond echange avec les colis face a face
+! Ce coefficient sera utilise pour le calcul des termes sources
+! permettant de determiner la temperature de peau du plafond
+ else
+ hray = stephn*emis &
+ * (0.25d0*pi*dmcont**2)/(ptrres*plgres) &
+ * ( rtp(iconra(iel),isca(itpcmt))+tkelvi &
+ +rtp( iel ,isca(itppmt))+tkelvi) &
+ * ((rtp(iconra(iel),isca(itpcmt))+tkelvi)**2 &
+ +(rtp( iel ,isca(itppmt))+tkelvi)**2)
+ endif
+
+! --- Zones de murs ou d'alveoles
+! les murs et les alveoles echangent avec les colis
+! le facteur de forme calcule precedemment s'applique
+! il prend en compte le cas avec ou sans alveoles
+! Ce coefficient sera utilise pour le calcul des termes sources
+! permettant de determiner
+! - la temperature de peau des parois
+! - la temperature de peau des colis, en alveole (FFORM=1)
+
+ else
+ hray = stephn*emis &
+ * fform &
+ * ( rtp(iel,isca(itpcmt))+tkelvi &
+ +rtp(iel,isca(itppmt))+tkelvi) &
+ * ((rtp(iel,isca(itpcmt))+tkelvi)**2 &
+ +(rtp(iel,isca(itppmt))+tkelvi)**2)
+ endif
+
+
+! === Puissance transmise a l'air et a la peau des colis par conduction
+! ===========================================================
+
+! Pour l'air :
+! en stationnaire, toute la puissance des colis se retrouve tot ou
+! tard dans l'air (elle peut transiter par la peau des colis,
+! par les alveoles, par les murs, mais elle est extraite par
+! l'air).
+
+! Pour la peau des colis :
+! toute la puissance des colis est transmise par conduction a
+! la peau des colis.
+
+
+ if (iscal.eq.itaamt.or.iscal.eq.itpcmt) then
+
+! --- Puissance des colis par unite de surface au sol
+! On prend en compte la carte de remplissage ensuite
+
+! On doit fournit un CRVEXP en Watt/CP, soit de la dimension de
+! PUICON/CP.
+
+! Comme la puissance integree sur la hauteur du colis doit etre
+! la puissance totale du colis, PUICON, on doit imposer dans
+! chaque maille une fraction de PUICON.
+! Pour une repartition uniforme en hauteur, cette fraction est
+! la hauteur de la maille VOLUME/(PTRRES*PLGRES) divisee par
+! la hauteur totale du colis.
+! Les repartitions non uniformes en hauteur sont traitees par
+! les cartes de repartition en altitude, plus bas.
+! On impose donc CRVEXP = PUICON/CP * VOLUME/(PTRRES*PLGRES)
+! puis on divise par la hauteur de colis (plus bas, lors du
+! traitement des cartes de repartition en altitude).
+
+! Noter que comme on multiplie par VOLUME/(PTRRES*PLGRES) ici
+! et qu'on divise plus bas par EPCHEL, on pourrait simplifier,
+! puisque, a priori, EPCHEL = VOLUME/(PTRRES*PLGRES)
+
+
+! Air ambiant
+ if (iscal.eq.itaamt) then
+ crvexp(iel) = puicon/cp0(iphas) &
+ * volume(iel)/(ptrres*plgres)
+! Peau des colis
+ elseif(iscal.eq.itpcmt) then
+ crvexp(iel) = puicon/cpcont &
+ * volume(iel)/(ptrres*plgres)
+ endif
+
+! --- Prise en compte des cartes de remplissage (adimensionnelles)
+! Les entrepots ne sont pas uniformement remplis.
+
+! Pour repr�senter la carte d'encombrement des lignes de colis, on
+! repere les lignes occupees (coordonnee X, indicateur ILIGNE)
+! par leurs bornes XLIMIN et XLIMAX qui sont stockees dans VIZCAR
+! (avec l'indicateur ICPUIS faisant reference a la puissance)
+ nzones = nzocar(iligne,icpuis)
+ do izone = 1, nzones
+ xlimin = ptrres*vizcar(1,izone,iligne,icpuis)
+ xlimax = ptrres*vizcar(2,izone,iligne,icpuis)
+ if ((xyzcen(1,iel).ge.xlimin).and. &
+ (xyzcen(1,iel).lt.xlimax)) then
+ crvexp(iel) = crvexp(iel) * vcarth(izone,iligne)
+ endif
+ enddo
+
+! Pour repr�senter la carte d'encombrement des rangees de colis, on
+! repere les rangees occupees (coordonnee Y, indicateur IRANGE)
+! par leurs bornes YRGMIN et YRGMAX qui sont stockees dans VIZCAR
+! (avec l'indicateur ICPUIS faisant reference a la puissance)
+ nzones = nzocar(irange,icpuis)
+ do izone = 1, nzones
+ yrgmin = plgres*vizcar(1,izone,irange,icpuis)
+ yrgmax = plgres*vizcar(2,izone,irange,icpuis)
+ if ((xyzcen(2,iel).ge.yrgmin).and. &
+ (xyzcen(2,iel).lt.yrgmax)) then
+ crvexp(iel) = crvexp(iel) * vcarth(izone,irange)
+ endif
+ enddo
+
+! Pour repr�senter la carte d'encombrement en hauteur de colis, on
+! repere les couches occupees (coordonnee Z, indicateur IALTIT)
+! par leurs bornes ZALMIN et ZALMAX qui sont stockees dans VIZCAR
+! (avec l'indicateur ICPUIS faisant reference a la puissance)
+! SQZ permet d'integrer VCARTH sur les zones afin que
+! de normer VCARTH de telle sorte que la multiplication par
+! VCARTH/SQZ permette de retrouver, en integrant sur la hauteur,
+! toute la puissance du colis.
+ sqz = 0.d0
+ nzones = nzocar(ialtit,icpuis)
+ do izone = 1, nzones
+ zalmin = epchel*vizcar(1,izone,ialtit,icpuis)
+ zalmax = epchel*vizcar(2,izone,ialtit,icpuis)
+ sqz = sqz + vcarth(izone,ialtit) * &
+ ( vizcar(2,izone,ialtit,icpuis) - &
+ vizcar(1,izone,ialtit,icpuis) )
+ enddo
+ do izone = 1, nzones
+ zalmin = epchel*vizcar(1,izone,ialtit,icpuis)
+ zalmax = epchel*vizcar(2,izone,ialtit,icpuis)
+ if ((xyzcen(3,iel).ge.zalmin).and. &
+ (xyzcen(3,iel).lt.zalmax)) then
+ crvexp(iel) = crvexp(iel)* &
+ vcarth(izone,ialtit)/(sqz*epchel)
+ endif
+ enddo
+
+! On calcule la puissance totale injectee (Watt)
+
+! Air ambiant
+ if (iscal.eq.itaamt) then
+ ptot = ptot + crvexp(iel)*cp0(iphas)
+ endif
+
+ endif
+
+
+! === Echange convectif conteneur / air et radiatif conteneur / mur
+! ===========================================================
+
+! Pour la determination de la temperature de peau des colis
+
+! On calcule le coefficient d'echange convectif efficace selon
+! la configuration (convection naturelle, forcee, mixte).
+! On ajoute le terme de rayonnement a partir du coefficient
+! equivalent HRAY calcule precedemment.
+
+ if (iscal.eq.itpcmt) then
+
+! --- Convection naturelle verticale le long des colis
+! Van Vliet&Ross et Vliet&Liu
+
+! Rayleigh a partir du flux d'un conteneur
+ raleiz = fragh*phi0*xyzcen(3,iel)/xlamb0
+! Nusselt associe
+ xnsraz = 0.17d0 * raleiz**0.25d0
+ xnsraz = max(xnsraz,(0.6d0 * raleiz**0.2d0))
+! Coefficient d'echange de convection naturelle conteneur / air
+! Hypothese que le zero est a la base des colis
+ hraz = xnsraz*xlamb0/xyzcen(3,iel)
+! Coefficient d'echange moyen de convection naturelle
+ hmraz = hmraz + hraz
+
+
+! --- Convection forcee transversale dans le reseau de colis
+! Zukauskas
+
+! Reynolds (vitesse horizontale gap, diametre
+ reynol = (un0*ptrres/(ptrres-dmcont)) * dmcont / xnu0
+! Nusselt associe
+ xnsrey = 0.35d0*(ptrres/plgres)**0.2d0 &
+ * 0.89d0*reynol**0.6d0
+! Coefficient d'echange de convection forcee conteneur / air
+ hrey = xnsrey*xlamb0/dmcont
+! Coefficient d'echange moyen de convection forcee
+ hmrey = hmrey + hrey
+
+! --- Compteur pour les moyennes
+
+ hnb = hnb + 1.d0
+
+
+! --- Prise en compte du type de reseau (en ligne ou en quinconce)
+! et de la presence d'alveoles
+
+! - Alveoles
+! convection naturelle uniquement
+
+ if(ialveo.eq.1) then
+
+! Nusselt associe
+ xnsalv = 0.17d0 * raleiz**0.25d0
+! Coefficient d'echange de convection naturelle conteneur / air
+! Hypothese que le zero est a la base des colis
+ h0 = xnsalv*xlamb0/xyzcen(3,iel)
+
+
+! - Reseau en ligne (pas carre) sans alveoles
+! 2/3 conv.force (face+cotes) + 1/3 conv.nat (sillage arriere)
+
+ elseif(iconlg.eq.1)then
+ h0 = (hraz+2.d0*hrey)/3.d0
+
+! - Reseau en quinconce (pas triangulaire) sans alveoles
+! conv.force (pas de protection du colis amont)
+
+ else
+ h0 = hrey
+ endif
+
+! - Sans alveoles
+! le coefficient d'echange est toujours au moins egal a celui
+! de la convection naturelle
+ if(ialveo.ne.1) then
+ h0 = max(hraz,h0)
+ endif
+
+! - Coefficient d'echange convectif moyen efficace
+ hm0 = hm0 + h0
+
+
+! --- Ajout du terme conductif et du terme radiatif
+
+! CRVEXP contient deja la puissance des colis transmise
+! par conduction
+! On veut ajouter dans CRVEXP des Watt/CP soit H0*Surface*T/CP.
+! On a ici XXAV*VOLUME = PI*DMCONT*EPCHEL, qui est la surface
+! d'�change dans la cellule.
+
+
+! - Alveoles
+! echange par convection naturelle et
+! les colis rayonnent avec le plafond et les alveoles
+
+ if(ialveo.eq.1) then
+
+ crvexp(iel) = crvexp(iel) &
+ +h0 *(xxav*volume(iel)) &
+ *rtp(iel,isca(itaamt))/cpcont &
+ +hray*(xxav*volume(iel)) &
+ *rtp(iel,isca(itppmt))/cpcont
+ crvimp(iel) = -(h0+hray)*(xxav*volume(iel))/cpcont
+
+
+! - Sans alveole
+! echange par convection mixte seul
+! les colis ne rayonnent qu'entre eux, et ceci est pris en compte
+! par diffusion
+
+ else
+
+ crvexp(iel) = crvexp(iel) &
+ +h0 *(xxav*volume(iel)) &
+ *rtp(iel,isca(itaamt))/cpcont
+ crvimp(iel) = - h0 *(xxav*volume(iel))/cpcont
+
+ endif
+
+ endif
+
+
+
+! === Echange convectif mur / air et radiatif mur / conteneur
+! ===========================================================
+
+! Pour la determination de la temperature de peau des parois
+! (murs et alveoles)
+
+ if (iscal.eq.itppmt) then
+
+! --- Echange par convection paroi / air
+
+! - Alveoles
+! convection naturelle uniquement
+
+ if(ialveo.eq.1) then
+
+! Rayleigh a partir du flux d'un conteneur
+ raleiz = fragh*phi0*xyzcen(3,iel)/xlamb0
+! Nusselt associe
+ xnsalv = 0.17d0 * raleiz**0.25d0
+! Coefficient d'echange de convection naturelle alveole / air
+! Hypothese que le zero est a la base des colis
+ hraz = xnsalv*xlamb0/xyzcen(3,iel)
+! Coefficient d'echange efficace alveole / air
+! Convection naturelle seule
+ h0 = hraz
+
+
+! - Sans alveole
+! convection naturelle (Mac Adams) ou convection forcee
+
+ else
+
+! .Convection naturelle
+
+! Rayleigh a partir de l'ecart de temperature paroi - air
+ raleiz = &
+ fragh*(rtp(iel,isca(itppmt))-rtp(iel,isca(itaamt)))
+! Nusselt associe (Mac Adams)
+ xnsraz = 0.12d0*(abs(raleiz))**untier
+! Coefficient d'echange de convection naturelle paroi / air
+ hraz = xnsraz*xlamb0/xyzcen(3,iel)
+! Coefficient d'echange moyen de convection naturelle
+ hmraz = hmraz + hraz
+
+
+! .Convection forcee
+
+! Espace mur reseau
+ dhmur = ptrres-dmcont
+! Reynolds associ� (vitesse horizontale hors reseau, pres des murs)
+ reynol = dhmur*un0/xnu0
+! Nusselt associe (Colburn)
+ xnsrey = 0.023d0*reynol**0.8d0*prand0**untier
+! Coefficient d'echange de convection forcee paroi / air
+ hrey = xnsrey*xlamb0/dhmur
+! Coeficient d'echange moyen de convection forcee
+ hmrey = hmrey + hrey
+
+
+! .Coefficient d'echange efficace (le plus efficace est dominant)
+ h0 = max(hraz,hrey)
+
+ endif
+
+
+! - Coefficient d'echange convectif moyen efficace
+ hm0 = hm0 + h0
+! - Coefficient d'echange moyen de convection naturelle
+ hmraz = hmraz + hraz
+! - Compteur pour les moyennes
+ hnb = hnb + 1.d0
+
+
+! --- Ajout du terme conductif et du terme radiatif
+
+! On veut ajouter dans CRVEXP des Watt/CP soit H0*Surface*T/CP.
+! On calcule H0*VOLUME*T/CP et on divise par une distance
+! plus bas. On pourrait faire les choses plus directement.
+
+! Les echanges radiatifs sont les echanges avec les colis.
+
+
+! - Coefficient d'echange radiatif moyen pour les parois
+ hmray = hmray + hray
+
+
+! - Echanges convectifs
+ crvexp(iel) = h0*volume(iel)*rtp(iel,isca(itaamt))/cpparo
+ crvimp(iel) =-h0*volume(iel)/cpparo
+
+
+! - Echange radiatif dans le ciel
+ if(icnrok.eq.1.and.xyzcen(3,iel).gt.hmax) then
+
+! .Alveoles : le plafond echange avec les alveoles
+ if(ialveo.eq.1) then
+ crvexp(iel) = crvexp(iel) &
+ +hray*volume(iel) &
+ *rtp(iconra(iel),isca(itppmt))/cpparo
+
+! .Sans alveole : le plafond echange avec le dessus des colis
+ else
+ crvexp(iel) = crvexp(iel) &
+ +hray*volume(iel) &
+ *rtp(iconra(iel),isca(itpcmt))/cpparo
+ endif
+
+
+! - Echange radiatif avec les colis pour les autres parois
+! (murs et alveoles)
+ else
+ crvexp(iel) = crvexp(iel) &
+ +hray*volume(iel)*rtp(iel,isca(itpcmt))/cpparo
+
+ endif
+
+
+! - La partie implicite est la meme pour tous
+ crvimp(iel) = crvimp(iel) - hray*volume(iel)/cpparo
+
+
+! - On divise par une distance
+! Plus exactement, on multiplie par la surface d'echange et
+! on divise par le volume (on aurait donc pu eviter de multiplier
+! par le volume).
+
+
+! .Au dessus ou au dessous des colis, le plafond ou le sol echangent
+! sur une surface de PTRRES*PLGRES
+! dans des cellules de volume EPCHEL*PTRRES*PLGRES.
+! Le rapport Surface/Volume est donc 1/EPCHEL
+
+ if(xyzcen(3,iel).lt.epchel.or.xyzcen(3,iel).gt.hmax) then
+ crvexp(iel) = crvexp(iel)/epchel
+ crvimp(iel) = crvimp(iel)/epchel
+
+
+! .En stockage en alveoles, les alveoles echangent
+! sur une surface de PI*DHALVE*EPCHEL
+! dans des cellules de volume EPCHEL*PTRRES*PLGRES.
+! Le rapport Surface/Volume est donc PI*DHALVE/(PTRRES*PLGRES)
+! A priori DHALVE est positif, mais on laisse le ABS (pour le
+! cas, ou il serait defini comme la difference entre le
+! diametre des colis et des alveoles)
+
+ elseif(ialveo.eq.1) then
+ crvexp(iel) = &
+ crvexp(iel)*pi*abs(dhalve)/(ptrres*plgres)
+ crvimp(iel) = &
+ crvimp(iel)*pi*abs(dhalve)/(ptrres*plgres)
+
+
+! .Sans alveoles, les murs echangent
+! sur une surface de PLGRES*EPCHEL
+! dans des cellules de volume EPCHEL*PTRRES*PLGRES.
+! Le rapport Surface/Volume est donc 1/PTRRES
+! La ou il n'y a pas de mur, la temperature de mur ne signifie
+! rien, mais on peut quand meme l'y calculer (il n'y a pas de
+! phenomene de diffusion, tout est local)
+
+ else
+ crvexp(iel) = crvexp(iel)/ptrres
+ crvimp(iel) = crvimp(iel)/ptrres
+
+ endif
+
+ endif
+
+
+! Fin du test sur la zone de stockage
+ endif
+enddo
+
+
+! === Pour l'air, sans modelisation des panaches de convection naturelle
+! ===========================================================
+
+if(iscal.eq.itaamt) then
+
+ if(imdcnt.eq.0)then
+
+! --- Calcul du debit enthalpique de convection naturelle
+! sortant en haut de la zone des colis : rho*W*S*Cp*DeltaT
+! (il aurait ete plus correct d'utiliser FLUMAS)
+
+ do iel = 1, ncel
+
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+ if(icoul.eq.icmtst) then
+
+ if(icnrok.eq.1.and.xyzcen(3,iel).gt.hmax) then
+ jel = iconra(iel)
+ dhs = dhs + &
+ propce(jel,ipcrom)*rtp(jel,iw(iphas)) &
+ *(volume(jel)/epchel) &
+ *cp0(iphas)*(rtp(jel,isca(itaamt))-tinit)
+ endif
+
+ endif
+ enddo
+
+
+! --- Calcul de la puissance en kW,
+! avec correction si representation 3D en 2D
+
+ puitot = ptot*frdtra*1.d-3
+
+
+! --- Calcul du debit enthalpique de convection naturelle en kW,
+! avec correction si representation 3D en 2D
+
+ debcon = dhs*frdtra*1.d-3
+
+! --- Impression de PUITOT et DEBCON
+ if (irangp.le.0.and.modntl.eq.0) then
+ write(nfecra,2002) puitot, debcon
+ endif
+
+
+! === Pour l'air, modelisation des panaches de convection naturelle
+! ===========================================================
+
+ elseif(imdcnt.eq.1) then
+
+
+! --- Le debit enthalpique des panaches ne peut pas etre plus grand
+! que la puissance totale disponible ; sinon, c'est qu'il
+! a ete mal predit ou que la puissance a ete mal imposee :
+! les cartes ou la puissance d'un conteneur peuvent etre en
+! cause
+! On fait ce test ici, dans la mesure ou PTOT est calcule juste
+! au dessus.
+
+ if(dhpcnt.ge.ptot*frdtra)then
+ write(nfecra,9001) imdcnt, dhpcnt, ptot*frdtra, &
+ dhpcnt, ptot*frdtra
+ call csexit (1)
+ !==========
+ endif
+
+! --- Modification du terme source pour la modelisation des panaches
+
+! On redistribue la puissance transmise a l'air uniquement :
+! une fraction de la puissance totale est retiree de la zone
+! de stockage et injectee directement dans le ciel au dessus
+! des conteneurs. La repartition se fait a priori de maniere
+! homogene (le panache de tous les conteneurs presents recoit
+! la meme fraction de la puissance totale), puis on applique
+! la carte de repartition thermique XY.
+
+! - Calcul des grandeurs independantes de la maille
+
+! Fraction de la puissance totale a conserver
+! dans la zone de stockage
+ fptsto = 1.d0-dhe/ptot
+
+! Puissance Volumique a ajouter dans la zone de Ciel au dessus
+! d'un Conteneur de puissance PUICON, divise par CP
+ pvccsc = ( (dhe/ptot)*puicon / (hercnt*ptrres*plgres) ) &
+ / cp0(iphas)
+
+ do iel = 1, ncel
+
+ ifml = ifmcel(iel )
+ icoul = iprfml(ifml,1)
+
+ if(icoul.eq.icmtst) then
+
+! - Reduction dans la zone de stockage
+
+! La puissance est reduite pour tous les conteneurs de maniere
+! homogene, en fonction du rapport entre le debit enthalpique
+! des panaches impose par l'utilisateur et la puissance totale
+! presente dans l'entrepot. Les cartes de repartition thermique
+! ayant deja ete appliquees a CRVEXP, c'est bien le rapport de
+! reduction (et non pas la valeur absolue de la reduction) qui
+! est homogene.
+
+ crvexp(iel) = crvexp(iel)*fptsto
+
+
+ if ( xyzcen(3,iel).lt.(hercnt+hreso).and. &
+ xyzcen(3,iel).gt.hreso) then
+
+! - Report dans la zone des panaches (1/2)
+
+! Calcul de la puissance a ajouter dans la zone de ciel, au dessus
+! d'un conteneur de puissance PUICON (deja divise par CP)
+
+ pccsc = pvccsc * volume(iel)
+
+! Les entrepots ne sont pas uniformement remplis.
+! Application de la carte thermique horizontale XY pour
+! selectionner les positions auxquelles un conteneur (ou
+! une fraction de conteneur est presente, puisque l'on
+! peut avoir des demi-conteneurs, par exemple sur un plan
+! de symetrie)
+
+! Pour repr�senter la carte d'encombrement des lignes de colis, on
+! repere les lignes occupees (coordonnee X, indicateur ILIGNE)
+! par leurs bornes XLIMIN et XLIMAX qui sont stockees dans VIZCAR
+! (avec l'indicateur ICPUIS faisant reference a la puissance)
+ nzones = nzocar(iligne,icpuis)
+ do izone = 1, nzones
+ xlimin = ptrres*vizcar(1,izone,iligne,icpuis)
+ xlimax = ptrres*vizcar(2,izone,iligne,icpuis)
+ if ((xyzcen(1,iel).ge.xlimin).and. &
+ (xyzcen(1,iel).lt.xlimax)) then
+ pccsc = pccsc * &
+ vcarth(izone,iligne)
+ endif
+ enddo
+
+! Pour repr�senter la carte d'encombrement des rangees de colis, on
+! repere les rangees occupees (coordonnee Y, indicateur IRANGE)
+! par leurs bornes YRGMIN et YRGMAX qui sont stockees dans VIZCAR
+! (avec l'indicateur ICPUIS faisant reference a la puissance)
+ nzones = nzocar(irange,icpuis)
+ do izone = 1, nzones
+ yrgmin = plgres*vizcar(1,izone,irange,icpuis)
+ yrgmax = plgres*vizcar(2,izone,irange,icpuis)
+ if ((xyzcen(2,iel).ge.yrgmin).and. &
+ (xyzcen(2,iel).lt.yrgmax)) then
+ pccsc = pccsc * &
+ vcarth(izone,irange)
+ endif
+ enddo
+
+! Ajout de la puissance des panaches a la puissance deja existante
+
+ crvexp(iel) = crvexp(iel) + pccsc
+
+! Fin si zone de panache
+ endif
+
+! Fin si zone de stockage
+ endif
+
+
+! --- Calcul de la puissance totale incluant la modelisation
+! des panaches de convection natuelle
+! (normalement la puissance totale n'a pas ete modifiee)
+
+ ptcn = ptcn + crvexp(iel)*cp0(iphas)
+
+! Fin boucle NCEL
+ enddo
+
+! --- Calcul et impression de la puissance totale incluant la modelisation
+! des panaches de convection naturelle
+! en kW, avec correction si representation 3D en 2D
+
+ puitot = ptcn*frdtra*1.d-3
+ if ((irangp.le.0).and.(modntl.eq.0)) then
+ write(nfecra,2003) puitot
+ endif
+
+! Fin si on modelise les panaches
+ endif
+! Fin si scalaire = air ambiant
+endif
+
+
+
+! === Impressions pour la temperature de peau des colis et des parois
+! ===========================================================
+
+! --- Valeur fictive : pas de convection forcee en alveole
+! (valeur bizarre, mais uniquement pour affichage)
+if (ialveo.eq.1) then
+ hmrey = -1.00001d10
+endif
+
+! --- Temperature de peau des colis
+
+if(iscal.eq.itpcmt) then
+
+! Si rien a moyenner, on prend une valeur negative
+! (mais les numerateurs seront nuls, normalement)
+ if (hnb.lt.epzero) then
+ hnb = -epzero
+ endif
+
+! Stockage en common pour impression ulterieure
+ cfecca = hm0/hnb
+
+! Impressions des coefficients d'echange moyens
+ if ((irangp.le.0).and.(modntl.eq.0)) then
+ write(nfecra,2004) hmrey/hnb, hmraz/hnb, hm0/hnb
+ endif
+
+endif
+
+! --- Temperature de peau des parois
+
+if(iscal.eq.itppmt) then
+
+! Si rien a moyenner, on prend une valeur negative
+! (mais les numerateurs seront nuls, normalement)
+ if (hnb.lt.epzero) then
+ hnb = -epzero
+ endif
+
+! Stockage en common pour impression ulterieure
+ cfecma = hm0/hnb
+
+! Impressions des coefficients d'echange moyens
+ if ((irangp.le.0).and.(modntl.eq.0)) then
+ write(nfecra,2005) &
+ hmrey/hnb, hmraz/hnb, hmray/hnb, hm0/hnb
+ endif
+
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES MATISSE POUR LA VARIABLE ',A8,/)
+
+ 2001 FORMAT (/,3X,'** INFORMATIONS SUR MATISSE, VARIABLE ',A8,/, &
+ 3X,' -------------------------------------------')
+ 2002 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Puissance (sans modelisation panaches) ',/,&
+'mati -------------------------------------- ',/,&
+'mati Puissance totale ', E12.5 ,' kW',/,&
+'mati Debit enthalpique de conv. naturelle ', E12.5 ,' kW',/,&
+'mati --------------------------------------------------------',/)
+ 2003 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Puissance (avec modelisation panaches) ',/,&
+'mati -------------------------------------- ',/,&
+'mati Puissance totale avec erosion panaches', E12.5 ,' kW',/,&
+'mati --------------------------------------------------------',/)
+ 2004 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Coeff. d echange moyens (calcul T� de peau des colis) ',/,&
+'mati ----------------------------------------------------- ',/,&
+'mati Convection forcee ', E12.5 ,' W/m2/�C',/,&
+'mati Convection naturelle ', E12.5 ,' W/m2/�C',/,&
+'mati Efficace ', E12.5 ,' W/m2/�C',/,&
+'mati --------------------------------------------------------',/)
+ 2005 format ( &
+'mati --------------------------------------------------------',/,&
+'mati Coeff. d echange moyens (calcul T� de peau des parois) ',/,&
+'mati ------------------------------------------------------ ',/,&
+'mati Convection forcee ', E12.5 ,' W/m2/�C',/,&
+'mati Convection naturelle ', E12.5 ,' W/m2/�C',/,&
+'mati Rayonnement ', E12.5 ,' W/m2/�C',/,&
+'mati Efficace ', E12.5 ,' W/m2/�C',/,&
+'mati --------------------------------------------------------',/)
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET MATISSE (MTTSSC) ',/,&
+'@ ========= ',/,&
+'@ DEBIT ENTHALPIQUE DES PANACHES INADAPTE. ',/,&
+'@ ',/,&
+'@ La modelisation des panaches est activee ',/,&
+'@ avec IMDCNT = ',I10 ,' ',/,&
+'@ Le debit enthalpique des panaches de convection ',/,&
+'@ naturelle doit etre strictement inferieur a la ',/,&
+'@ puissance totale des colis presents dans l''entrepot ',/,&
+'@ puisqu''il en represente une partie. ',/,&
+'@ ',/,&
+'@ Le debit enthalpique prescrit est DHPCNT =',E12.5 ,/,&
+'@ La puissance totale reelle est PTOT*FRDTRA =',E12.5 ,/,&
+'@ ',/,&
+'@ L''inegalite suivante n''est pas verifiee : ',/,&
+'@ DHPCNT < PTOT*FRDTRA ',/,&
+'@ ',E12.5 ,' ',E12.5 ,' ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Desactiver la modelisation des panaches ou ',/,&
+'@ modifier la valeur du debit enthalpique prescrit ou ',/,&
+'@ modifier la puissance totale (carte de remplissage ou ',/,&
+'@ puissance des colis). ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/mati/mttycl.f90 b/src/mati/mttycl.f90
new file mode 100644
index 0000000..20d7897
--- /dev/null
+++ b/src/mati/mttycl.f90
@@ -0,0 +1,381 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine mttycl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , icodcl , isostd , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , frcxt , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! TRAITEMENT DES CODES DE CONDITIONS AUX LIMITES DE MATISSE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! itrifb(nfabor ! te ! --> ! tab d'indirection pour tri des faces !
+! nphas) ! ! ! !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! isostd ! te ! --> ! indicateur de sortie standard !
+! (nfabor+1) ! ! ! +numero de la face de reference !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! frcxt(ncelet, ! tr ! <-- ! force exterieure generant la pression !
+! 3,nphas) ! ! ! hydrostatique !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rijipb ! tr ! --- ! tab de trav pour valeurs en iprime !
+! (nfabor,6 ) ! ! ! des rij au bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+include "matiss.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer isostd(nfabor+1,nphas)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision frcxt(ncelet,3,nphas)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iphas , ifac , ifml , icoul
+double precision dbm , roe
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Gestion memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Une seule phase
+
+iphas = 1
+
+!===============================================================================
+! 2. BOUCLE SUR LES FACES DE BORD
+!===============================================================================
+
+do ifac = 1, nfabor
+
+! --- Couleur de la face de bord
+
+ ifml = ifmfbr(ifac )
+ icoul = iprfml(ifml,1)
+
+
+!===============================================================================
+! 3. ENTREE : classique en convection forcee, a pression imposee sinon
+!===============================================================================
+
+ if(icoul.eq.icmtfi) then
+
+
+! --- Convection forcee
+ if(icofor.eq.1)then
+
+! Type de base : IENTRE
+ itypfb(ifac,iphas) = ientre
+
+! Temperature exterieure prise a TINIT
+ rcodcl(ifac,isca(itaamt),1) = tinit
+ rcodcl(ifac,isca(itpcmt),1) = tinit
+ rcodcl(ifac,isca(itppmt),1) = tinit
+
+! Vitesses transverses nulles
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+
+! Vitesse debitante W est calculee a partir du debit massique par
+! W = - debit massique / (masse volumique * surface)
+! . On suppose la vitesse verticale descendante (d'ou le signe).
+! . ROE est la masse volumique exterieure evaluee a partir de
+! la temperature TINIT (degres C) en utilisant la loi d'etat.
+! . La surface de l'entree du maillage est calculee par la formule
+! NPTRAN*PTRRES*EPCHEM/RCONVE. En effet, la surface au bas de la
+! cheminee est NPTRAN*PTRRES*EPCHEM et on divise par le rapport
+! du convergent represente sur le maillage (>=1) pour obtenir
+! la surface d'entree. (en 2D, il faut RCONVE=1, sinon, on impose
+! un debit plus grand que le debit souhaite).
+! . La correction du debit massique par FRDTRA correspond au
+! rapport d'echelle transverse eventuel entre le maillage et la
+! realite .
+
+ roe = rrfmat*(trfmat+tkelvi)/(tinit+tkelvi)
+ dbm = debmas/frdtra
+ rcodcl(ifac,iw(iphas),1) = &
+ -dbm*rconve/(roe*nptran*ptrres*epchem)
+
+
+! --- Convection naturelle (ICOFOR=0)
+ else
+
+! Type de base indefini
+! (dans une version ulterieure de Code_Saturne, on disposera de
+! sorties a pression imposee)
+ itypfb(ifac,iphas) = iindef
+
+! Dirichlet sur les temperatures
+ icodcl(ifac,isca(itaamt) ) = 1
+ rcodcl(ifac,isca(itaamt),1) = tinit
+ icodcl(ifac,isca(itpcmt) ) = 1
+ rcodcl(ifac,isca(itpcmt),1) = tinit
+ icodcl(ifac,isca(itppmt) ) = 1
+ rcodcl(ifac,isca(itppmt),1) = tinit
+
+! Dirichlet nul sur les vitesses transverses (nul par symetrie)
+ icodcl(ifac,iu(iphas) ) = 1
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ icodcl(ifac,iv(iphas) ) = 1
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+
+! Neumann homogene sur la vitesse debitante (on impose la pression)
+ icodcl(ifac,iw(iphas) ) = 3
+
+! Pression nulle
+ icodcl(ifac,ipr(iphas) ) = 1
+ rcodcl(ifac,ipr(iphas),1) = p0(iphas)
+
+ endif
+
+
+!===============================================================================
+! 4. SORTIE (pression imposee)
+!===============================================================================
+
+ elseif(icoul.eq.icmtfo) then
+
+! Type de base : sortie libre
+ itypfb(ifac,iphas) = isolib
+
+! Temperature imposee en cas de reentree
+ rcodcl(ifac,isca(itaamt),1) = tcrit
+ rcodcl(ifac,isca(itpcmt),1) = tinit
+ rcodcl(ifac,isca(itppmt),1) = tinit
+
+! Pression imposee (ecart hydrostatique par rapport a l'entree
+! + decalage eventuel DPVENT)
+ icodcl(ifac,ipr(iphas) ) = 1
+ rcodcl(ifac,ipr(iphas),1) = p0(iphas) + dpvent &
+ - dabs(gz) * ro0(iphas) * (hcheva - hchali)
+
+!===============================================================================
+! 5. LE RESTE : glissement et Neumann homogene
+!===============================================================================
+
+! --- Sol
+ elseif(icoul.eq.icmtfg) then
+ itypfb(ifac,iphas) = isymet
+
+! --- Plafond
+ elseif(icoul.eq.icmtfc) then
+ itypfb(ifac,iphas) = isymet
+
+! --- Symetries
+ elseif(icoul.eq.icmtfs) then
+ itypfb(ifac,iphas) = isymet
+
+! --- Parois
+ elseif(icoul.eq.icmtfw) then
+ itypfb(ifac,iphas) = isymet
+
+ endif
+
+enddo
+
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/pprt/Makefile.am b/src/pprt/Makefile.am
new file mode 100644
index 0000000..1c2fede
--- /dev/null
+++ b/src/pprt/Makefile.am
@@ -0,0 +1,79 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+-I$(top_srcdir)/include/cfbl \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/pprt/ppcpfu.h \
+$(top_srcdir)/include/pprt/ppincl.h \
+$(top_srcdir)/include/pprt/ppppar.h \
+$(top_srcdir)/include/pprt/ppthch.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcspprt.la
+libcspprt_la_SOURCES = \
+memppt.f90 \
+ppcabs.f90 \
+ppclim.f90 \
+ppcsca.f90 \
+ppini1.f90 \
+ppinii.f90 \
+ppiniv.f90 \
+ppinv2.f90 \
+pplecd.f90 \
+pppdfr.f90 \
+ppphyv.f90 \
+ppprcl.f90 \
+ppprop.f90 \
+ppray4.f90 \
+pptbht.f90 \
+pptssc.f90 \
+pptycl.f90 \
+ppvarp.f90
+libcspprt_la_LDFLAGS = -no-undefined
+
+libcspprt_la_SOURCES += \
+$(top_srcdir)/users/pprt/usppmo.f90
+
+pprtdir = $(pkgdatadir)/users/pprt
+pprt_DATA = \
+$(top_srcdir)/users/pprt/usppmo.f90
diff --git a/src/pprt/Makefile.in b/src/pprt/Makefile.in
new file mode 100644
index 0000000..ec51f92
--- /dev/null
+++ b/src/pprt/Makefile.in
@@ -0,0 +1,630 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/pprt
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcspprt_la_LIBADD =
+am_libcspprt_la_OBJECTS = memppt.lo ppcabs.lo ppclim.lo ppcsca.lo \
+ ppini1.lo ppinii.lo ppiniv.lo ppinv2.lo pplecd.lo pppdfr.lo \
+ ppphyv.lo ppprcl.lo ppprop.lo ppray4.lo pptbht.lo pptssc.lo \
+ pptycl.lo ppvarp.lo usppmo.lo
+libcspprt_la_OBJECTS = $(am_libcspprt_la_OBJECTS)
+libcspprt_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcspprt_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcspprt_la_SOURCES)
+DIST_SOURCES = $(libcspprt_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pprtdir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+pprtDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pprt_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/atmo \
+-I$(top_srcdir)/include/cfbl \
+-I$(top_srcdir)/include/cogz \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/ctwr \
+-I$(top_srcdir)/include/elec \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/pprt/ppcpfu.h \
+$(top_srcdir)/include/pprt/ppincl.h \
+$(top_srcdir)/include/pprt/ppppar.h \
+$(top_srcdir)/include/pprt/ppthch.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcspprt.la
+libcspprt_la_SOURCES = memppt.f90 ppcabs.f90 ppclim.f90 ppcsca.f90 \
+ ppini1.f90 ppinii.f90 ppiniv.f90 ppinv2.f90 pplecd.f90 \
+ pppdfr.f90 ppphyv.f90 ppprcl.f90 ppprop.f90 ppray4.f90 \
+ pptbht.f90 pptssc.f90 pptycl.f90 ppvarp.f90 \
+ $(top_srcdir)/users/pprt/usppmo.f90
+libcspprt_la_LDFLAGS = -no-undefined
+pprtdir = $(pkgdatadir)/users/pprt
+pprt_DATA = \
+$(top_srcdir)/users/pprt/usppmo.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/pprt/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/pprt/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcspprt.la: $(libcspprt_la_OBJECTS) $(libcspprt_la_DEPENDENCIES)
+ $(libcspprt_la_LINK) $(libcspprt_la_OBJECTS) $(libcspprt_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+usppmo.lo: $(top_srcdir)/users/pprt/usppmo.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usppmo.lo `test -f '$(top_srcdir)/users/pprt/usppmo.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/pprt/usppmo.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pprtDATA: $(pprt_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pprtdir)" || $(MKDIR_P) "$(DESTDIR)$(pprtdir)"
+ @list='$(pprt_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(pprtDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pprtdir)/$$f'"; \
+ $(pprtDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pprtdir)/$$f"; \
+ done
+
+uninstall-pprtDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pprt_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pprtdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pprtdir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(pprtdir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pprtDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pprtDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-pprtDATA install-ps \
+ install-ps-am install-saturneincludeHEADERS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-pprtDATA \
+ uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/pprt/memppt.f90 b/src/pprt/memppt.f90
new file mode 100644
index 0000000..abcaf5b
--- /dev/null
+++ b/src/pprt/memppt.f90
@@ -0,0 +1,126 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2007 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine memppt &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nvar , nscal , nphas , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! MEMORY MANAGEMENT FOR THE SPECIFIC PHYSICS MODULES
+
+!-------------------------------------------------------------------------------
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "vector.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nvar , nscal , nphas
+integer ifinia , ifinra
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. AIGUILLAGE VERS LE MODELE ADEQUAT (pour l'instant seulement atmo)
+!===============================================================================
+
+! ---> Atmospheric module
+
+if ( ippmod(iatmos).ge.0 ) then
+ call mematm &
+ !==========
+ ( idebia , idebra , ifinia , ifinra )
+
+endif
+
+!----
+! FIN
+!----
+
+return
+end
+
diff --git a/src/pprt/ppcabs.f90 b/src/pprt/ppcabs.f90
new file mode 100644
index 0000000..36151df
--- /dev/null
+++ b/src/pprt/ppcabs.f90
@@ -0,0 +1,504 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ppcabs &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+
+! SOUS-PROGRAMME PHYSIQUES PARTICULIERES
+
+! DONNE LA VALEUR DU COEFFICIENT D'ABSORPTION POUR
+! LE MELANGE GAZEUX ET LES PARTICULES POUR LE CP.
+
+! NOTER QUE IPHAS VAUT 1.
+
+! DANS LE CAS DU MODELE P-1 ON VERIFIE QUE LA LONGUEUR OPTIQUE
+! DU MILIEU EST AU MINIMUM DE L'ORDRE DE L'UNITE
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...3(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "parall.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra, iel, ifac, icla, ipck, icha, iok
+double precision xm, d2, vv, sf, xlc, xkmin, pp
+
+!===============================================================================
+
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1 - COEFFICIENT D'ABSORPTION DU MELANGE GAZEUX (m-1)
+!===============================================================================
+
+if ( ippmod(icod3p).ge.0 .or. ippmod(icoebu).ge.0 ) then
+
+! ----> Combustion gaz : Flamme de diffusion
+! Flamme de premelange (Modele EBU)
+
+ if (imodak.eq.1) then
+
+ do iel = 1, ncel
+ xm = 1.d0/ ( propce(iel,ipproc(iym(1)))/wmolg(1) &
+ + propce(iel,ipproc(iym(2)))/wmolg(2) &
+ + propce(iel,ipproc(iym(3)))/wmolg(3) )
+ w1(iel) = propce(iel,ipproc(iym(3)))*xm/wmolg(3)*xco2
+ w2(iel) = propce(iel,ipproc(iym(3)))*xm/wmolg(3)*xh2o
+ w3(iel) = 0.d0
+ enddo
+ call raydak(ncel,ncelet, &
+ !==========
+ propce(1,ipproc(icak(1))),w1,w2,w3,propce(1,ipproc(itemp)))
+
+ write(NFECRA,*) ' a verifier '
+ write(NFECRA,*) ' a finir : raydak '
+ write(NFECRA,*) ' Le codage est a terminer par le groupe I81'
+ write(NFECRA,*) ' 13-10-03 22:38:03 '
+ call csexit(1)
+
+ else
+ do iel = 1, ncel
+ propce(iel,ipproc(icak(1))) = propce(iel,ipproc(ickabs))
+ enddo
+ endif
+
+else if ( ippmod(icp3pl).ge.0 ) then
+
+! ----> Charbon
+
+ if (imodak.eq.1) then
+
+ do iel = 1,ncel
+! concentration volumique en CO2
+ w1(iel) = propce(iel,ipproc(immel))/wmole(ico2) &
+ *propce(iel,ipproc(iym1(ico2)))
+! concentration volumique en H20
+ w2(iel) = propce(iel,ipproc(immel))/wmole(ih2o) &
+ *propce(iel,ipproc(iym1(ih2o)))
+! fraction volumique de suies
+ w3(iel) = 0.d0
+
+ enddo
+
+ call raydak(ncel,ncelet, &
+ !==========
+ propce(1,ipproc(icak(1))),w1,w2,w3,propce(1,ipproc(itemp1)))
+
+ else
+ do iel = 1, ncel
+ propce(iel,ipproc(icak(1))) = ckabs1
+ enddo
+ endif
+
+else if ( ippmod(icfuel).ge.0 ) then
+
+! ----> Fuel
+
+ if (imodak.eq.1) then
+
+ do iel = 1,ncel
+! concentration volumique en CO2
+ w1(iel) = propce(iel,ipproc(immel))/wmole(ico2) &
+ *propce(iel,ipproc(iym1(ico2)))
+! concentration volumique en H20
+ w2(iel) = propce(iel,ipproc(immel))/wmole(ih2o) &
+ *propce(iel,ipproc(iym1(ih2o)))
+! fraction volumique de suies
+ w3(iel) = 0.d0
+
+ enddo
+
+ call raydak(ncel,ncelet, &
+ !==========
+ propce(1,ipproc(icak(1))),w1,w2,w3,propce(1,ipproc(itemp1)))
+
+ else
+ do iel = 1, ncel
+ propce(iel,ipproc(icak(1))) = ckabs1
+ enddo
+ endif
+
+endif
+
+
+!===============================================================================
+! 2 - COEFFICIENT D'ABSORPTION DES PARTICULES PAR CLASSE K2/X2 (m-1)
+!===============================================================================
+
+! ----> Charbon
+
+if ( ippmod(icp3pl).ge.0 ) then
+
+ do icla = 1, nclacp
+
+ ipck = 1 + icla
+ icha = ichcor(icla)
+
+ do iel = 1, ncel
+
+! ---> Calcul du diametre des particules
+
+ d2 = ( xashch(icha)*diam20(icla)**2 + &
+ ( 1.d0-xashch(icha)) &
+ *propce(iel,ipproc(idiam2(icla)))**2 )**0.5d0
+
+! ---> Calcul du coeficient d'absorption des particules K2/X2
+! 3./2. ROM/(ROM2*D2)
+
+ propce(iel,ipproc(icak(ipck))) = &
+ 1.5d0*propce(iel,ipproc(irom(iphas))) &
+ / ( propce(iel,ipproc(irom2(icla)))*d2)
+
+ enddo
+
+ enddo
+
+endif
+
+! ----> Fuel
+
+if ( ippmod(icfuel).ge.0 ) then
+
+ do icla = 1, nclafu
+
+ ipck = 1 + icla
+
+ do iel = 1, ncel
+
+! ---> Calcul du coeficient d'absorption des particules K2/X2
+! 3./2. ROM/(ROM2*D2)
+
+ propce(iel,ipproc(icak(ipck))) = &
+ 1.5d0*propce(iel,ipproc(irom(iphas))) &
+ / ( propce(iel,ipproc(irom3(icla))) &
+ *propce(iel,ipproc(idiam3(icla))) )
+
+ enddo
+
+ enddo
+
+endif
+
+!===============================================================================
+! 3 - COEFFICIENT D'ABSORPTION GAZ (Arc Electrique)
+!===============================================================================
+
+
+if ( ippmod(ielarc).ge.1 ) then
+
+ do iel = 1, ncel
+
+! ---> Directement donne par le fichier dp_elec
+
+ propce(iel,ipproc(icak(1))) = propce(iel,ipproc(idrad))
+
+ enddo
+
+endif
+
+!===============================================================================
+! 4 - CLIPPING DU COEFFICIENT D'ABSORPTION DANS LA CAS DE L'APPROX P-1
+!===============================================================================
+
+
+!--> MODELE P-1 : Controle standard des valeurs du coefficient
+! d'absorption. Ce coefficient doit assurer une
+! longueur optique au minimum de l'ordre de l'unite.
+
+
+ if (iirayo.eq.2) then
+
+! Coefficient d'absorption du melange gaz-particules de charbon
+
+ do iel = 1, ncel
+ w3(iel) = propce(iel,ipproc(icak(1)))
+ enddo
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipck = 1+icla
+ do iel = 1,ncel
+ w3(iel) = w3(iel) &
+ + ( propce(iel,ipproc(ix2(icla))) &
+ * propce(iel,ipproc(icak(ipck))) )
+ enddo
+ enddo
+ elseif ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipck = 1+icla
+ do iel = 1,ncel
+ w3(iel) = w3(iel) &
+ + ( propce(iel,ipproc(iyfol(icla))) &
+ * propce(iel,ipproc(icak(ipck))) )
+ enddo
+ enddo
+ endif
+
+! Calcul de la longueur caract�ristique XLC du domaine de calcul
+
+ sf = 0.d0
+ vv = 0.d0
+
+ do ifac = 1,nfabor
+ sf = sf + sqrt( &
+ surfbo(1,ifac)**2 + &
+ surfbo(2,ifac)**2 + &
+ surfbo(3,ifac)**2 )
+ enddo
+ if (irangp.ge.0) then
+ call parsom(sf)
+ !==========
+ endif
+
+ do iel = 1,ncel
+ vv = vv + volume(iel)
+ enddo
+ if (irangp.ge.0) then
+ call parsom(vv)
+ !==========
+ endif
+
+ xlc = 3.6d0 * vv / sf
+
+! Clipping de CK a XKMIN
+
+ xkmin = 1.d0 / xlc
+
+ iok = 0.d0
+ do iel = 1,ncel
+ if (w3(iel).lt.xkmin) then
+ iok = iok +1
+ endif
+ enddo
+
+! Arret en fin de pas de temps si epaisseur optique trop grande
+ pp = xnp1mx/100.0d0
+ if (dble(iok).gt.pp*dble(ncel)) then
+ write(nfecra,1000) xkmin, dble(iok)/dble(ncel)*100.d0, &
+ xnp1mx
+ istpp1 = 1
+! CALL CSEXIT (1)
+ !==========
+ endif
+
+ endif
+
+! -------
+! FORMAT
+! -------
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT APPROXIMATION P-1 (PPCABS) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ LA LONGUEUR OPTIQUE DU MILIEU SEMI-TRANSPARENT ',/,&
+'@ DOIT AU MOINS ETRE DE L''ORDRE DE L''UNITE POUR ETRE ',/,&
+'@ DANS LE DOMAINE D''APPLICATION DE L''APPROXIMATION P-1',/,&
+'@ CELA NE SEMBLE PAS ETRE LE CAS ICI. ',/,&
+'@ ',/,&
+'@ LE COEFFICIENT D''ABSORPTION MINIMUM POUR ASSURER CETTE ',/,&
+'@ LONGUEUR OPTIQUE EST XKMIN = ',E10.4 ,/,&
+'@ CETTE VALEUR N''EST PAS ATTEINTE POUR ', E10.4,'% ',/,&
+'@ DES CELLULES DU MAILLAGE. ',/,&
+'@ LE POURCENTAGE DE CELLULES DU MAILLAGE POUR LESQUELLES ',/,&
+'@ ON ADMET QUE CETTE CONDITION SOIT VIOLEE EST IMPOSE ',/,&
+'@ PAR DEFAUT OU DANS USINI1 A XNP1MX = ', E10.4,'% ',/,&
+'@ ',/,&
+'@ Le calcul est interrompu. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs du coefficient d''absorption CK ',/,&
+'@ dans PPCABS, USRAY3 ou Fichier thermochimie. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+
+end
diff --git a/src/pprt/ppclim.f90 b/src/pprt/ppclim.f90
new file mode 100644
index 0000000..91c696d
--- /dev/null
+++ b/src/pprt/ppclim.f90
@@ -0,0 +1,499 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ppclim &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer idbia1, maxelt, ils
+
+!===============================================================================
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+maxelt = max(ncelet,nfac,nfabor)
+ils = idebia
+idbia1 = ils + maxelt
+CALL IASIZE('PPCLIM',IDBIA1)
+
+!===============================================================================
+! 2. AIGUILLAGE VERS LE MODELE ADEQUAT
+!===============================================================================
+
+! ---> Combustion gaz
+! Flamme de diffusion chimie 3 points
+
+if ( ippmod(icod3p).ge.0 ) then
+ call usd3pc &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+ endif
+
+
+! ---> Combustion gaz
+! Flamme de premelange modele EBU
+
+if ( ippmod(icoebu).ge.0 ) then
+ call usebuc &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion gaz
+! Flamme de premelange modele LWC
+
+if ( ippmod(icolwc).ge.0 ) then
+ call uslwcc &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion charbon pulverise
+
+if ( ippmod(icp3pl).ge.0 ) then
+
+ call uscpcl &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+endif
+
+! ---> Combustion charbon pulverise couple Lagrangien
+
+if ( ippmod(icpl3c).ge.0 ) then
+ call uscplc &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion fuel
+
+if ( ippmod(icfuel).ge.0 ) then
+ call usfucl &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Compressible sans choc
+
+if ( ippmod(icompf).ge.0 ) then
+ call uscfcl &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Versions electriques
+! Effet Joule
+! Arcs Electriques
+! Conduction ionique
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+ call uselcl &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+ if ( ippmod(ieljou).eq.3 .or. ippmod(ieljou).eq.4 ) then
+
+ call usetcl &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+ endif
+
+endif
+
+! ------> Version ecoulements atmospheriques
+
+if ( ippmod(iatmos).ge.0 ) then
+
+ call usatcl &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+endif
+
+! ---> Versions aerorefrigerants
+
+if (ippmod(iaeros).ge.0) then
+
+ call usctcl &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/ppcsca.f90 b/src/pprt/ppcsca.f90
new file mode 100644
index 0000000..0ab3528
--- /dev/null
+++ b/src/pprt/ppcsca.f90
@@ -0,0 +1,260 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ppcsca
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! CALCUL DE NSCAPP SUIVANT LA PHYSIQUE PARTICULIERE
+! DEMANDEE PAR l'UTILISATEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "elincl.h"
+include "fuincl.h"
+include "ppcpfu.h"
+include "atincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer iok
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. MODELES DE COMBUSTION GAZ (ICO...)
+!===============================================================================
+
+! --> Flamme de diffusion
+
+if ( ippmod(icod3p).eq.0 ) nscapp = 2
+if ( ippmod(icod3p).eq.1 ) nscapp = 3
+
+if ( ippmod(icodeq).eq.0 ) nscapp = 2
+if ( ippmod(icodeq).eq.1 ) nscapp = 3
+
+! --> Flamme de premelange (modele EBU)
+
+if ( ippmod(icoebu).eq.0 ) nscapp = 1
+if ( ippmod(icoebu).eq.1 ) nscapp = 2
+if ( ippmod(icoebu).eq.2 ) nscapp = 2
+if ( ippmod(icoebu).eq.3 ) nscapp = 3
+
+! ---> Modele BML
+
+if ( ippmod(icobml).eq.0 ) nscapp = 2
+if ( ippmod(icobml).eq.1 ) nscapp = 3
+
+! ---> Modele LWC
+
+if ( ippmod(icolwc).eq.0 ) nscapp = 4
+if ( ippmod(icolwc).eq.1 ) nscapp = 5
+if ( ippmod(icolwc).eq.2 ) nscapp = 5
+if ( ippmod(icolwc).eq.3 ) nscapp = 6
+if ( ippmod(icolwc).eq.4 ) nscapp = 5
+if ( ippmod(icolwc).eq.5 ) nscapp = 6
+
+! ---nombre de Dirac pour le modele LWC
+
+if ( ippmod(icolwc).eq.0 .or. &
+ ippmod(icolwc).eq.1 ) then
+ ndirac = 2
+
+else if ( ippmod(icolwc).eq.2 .or. &
+ ippmod(icolwc).eq.3 ) then
+ ndirac = 3
+
+else if ( ippmod(icolwc).eq.4 .or. &
+ ippmod(icolwc).eq.5 ) then
+ ndirac = 4
+endif
+
+!===============================================================================
+! 2. MODELES DE COMBUSTION CHARBON PULVERISE (ICP...)
+!===============================================================================
+
+! --> Flamme charbon pulverise
+
+! ------ Transport d'H2
+if ( ippmod(icp3pl).eq.0 ) then
+
+ nscapp = 1 + 2*ncharb + 2 + 4*nclacp + (noxyd-1)
+
+ if ( ihtco2.eq. 1) nscapp = nscapp + 1
+ if ( ieqco2.ge. 1) nscapp = nscapp + 1
+
+endif
+
+! ------ Transport d'H2 + phase de sechage
+
+if ( ippmod(icp3pl).eq.1 ) then
+
+ nscapp = 1 + 2*ncharb + 3 +5*nclacp + (noxyd-1)
+
+ if ( ihtco2.eq. 1) nscapp = nscapp + 1
+ if ( ieqco2.eq. 1) nscapp = nscapp + 1
+
+endif
+
+! --> Flamme charbon pulverise couple Lagrangien
+
+if ( ippmod(icpl3c).eq.0 ) then
+ nscapp = 1 + 2*ncharb + 2
+endif
+
+!===============================================================================
+! 3. MODELE COMPRESSIBLE SANS CHOC : rho, e, s
+!===============================================================================
+
+if ( ippmod(icompf).ge.0 ) nscapp = 3*nphas
+
+
+!===============================================================================
+! 4. MODELES ELECTRIQUES : Effet Joule (IELJOU)
+! Arc electrique (IELARC)
+! Conduction ionique (IELION)
+!===============================================================================
+
+
+! --> Effet Joule
+
+ if ( ippmod(ieljou).eq.1 ) nscapp = 2 + ngazg-1
+ if ( ippmod(ieljou).eq.2 ) nscapp = 3 + ngazg-1
+
+ if ( ippmod(ieljou).eq.3 ) nscapp = 2 + ngazg-1
+ if ( ippmod(ieljou).eq.4 ) nscapp = 3 + ngazg-1
+
+! --> Arc electrique
+
+ if ( ippmod(ielarc).eq.1 ) nscapp = 2 + ngazg-1
+ if ( ippmod(ielarc).eq.2 ) nscapp = 5 + ngazg-1
+
+! --> Conduction ionique
+
+ if ( ippmod(ielion).eq.1 ) nscapp = 2 + ngazg-1
+
+!===============================================================================
+! 5. MODELES DE COMBUSTION FUEL (ICFUEL)
+!===============================================================================
+
+if ( ippmod(icfuel).ge.0 ) then
+ nscapp = 4 + 3*nclafu
+ if ( ieqco2.ge. 1) nscapp = nscapp + 1
+ if ( ieqnox.eq. 1) nscapp = nscapp + 3
+endif
+
+!===============================================================================
+! 6. MODELE ATMOSPHERIQUE (IATMOS)
+!===============================================================================
+
+if ( ippmod(iatmos).eq.0 ) nscapp = 0
+if ( ippmod(iatmos).eq.1 ) nscapp = 1
+if ( ippmod(iatmos).eq.2 ) nscapp = 3
+
+!===============================================================================
+! 8. MODELISATION DES AEROREFRIGERANTS (IAEROS)
+!===============================================================================
+
+if ( ippmod(iaeros).ge.0 ) nscapp = 2
+
+!===============================================================================
+! 9. VERIFICATION : UNE SEULE PHASE
+!===============================================================================
+
+iok = 0
+
+if( nscapp.gt.0 .and. ippmod(icompf).lt.0 ) then
+! ^^^^^^^^^^^^^^^^^^^^^^^^^
+! On peut penser faire du multiphasique avec la physique particuliere
+! compressible sans choc... (mettons deux pressions ind�pendantes
+! par exemple) ... a mettre en place si necessaire ...
+
+ if(nphas.ne.1) then
+ write(nfecra,1000)
+ iok = iok + 1
+ endif
+endif
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ SEULE UNE PHASE PERMISE EN PHYSIQUE PARTICULIERE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Arret dans ppcsca. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+return
+end
diff --git a/src/pprt/ppini1.f90 b/src/pprt/ppini1.f90
new file mode 100644
index 0000000..f0c62b4
--- /dev/null
+++ b/src/pprt/ppini1.f90
@@ -0,0 +1,144 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ppini1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES SELON
+! LE TYPE DE PHYSIQUE PARTICULIERE
+! EN COMPLEMENT DE CE QUI A ETTE DEJA FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! ---> Combustion gaz : Flamme de diffusion (Chimie 3 points)
+! Flamme de premelange (Modele EBU)
+! Flamme de premelange (Modele LWC)
+
+if ( ippmod(icod3p).ge.0 .or. ippmod(icoebu).ge.0 &
+ .or. ippmod(icolwc).ge.0 ) then
+ call coini1
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Charbon Pulverise
+
+if ( ippmod(icp3pl).ge.0 ) then
+ call cpini1
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Eulerienne Charbon Pulverise
+! Couplee Transport Lagrangien
+
+if ( ippmod(icpl3c).ge.0 ) then
+ call cplin1
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion fuel
+
+if ( ippmod(icfuel).ge.0 ) then
+ call fuini1
+ !==========
+endif
+
+! ---> Physique particuliere : Compressible
+
+if ( ippmod(icompf).ge.0) then
+ call cfini1
+ !==========
+endif
+
+! ---> Physique particuliere : Versions electriques
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+ call elini1
+ !==========
+endif
+
+! ---> Physique particuliere : Ecoulements atmospheriques
+
+if ( ippmod(iatmos).ge.0 ) then
+ call atini1
+ !==========
+endif
+
+! ---> Physique particuliere : Aerorefrigerants
+
+if ( ippmod(iaeros).ge.0) then
+ call ctini1
+ !==========
+endif
+
+return
+end
diff --git a/src/pprt/ppinii.f90 b/src/pprt/ppinii.f90
new file mode 100644
index 0000000..9c357f2
--- /dev/null
+++ b/src/pprt/ppinii.f90
@@ -0,0 +1,593 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ppinii
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INITIALISATION PAR DEFAUT DES COMMONS PHYSIQUE PARTICULIERE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "elincl.h"
+include "ppcpfu.h"
+include "atincl.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer ipp, icla, icha, iesp, igg, it, ir, ih, if, izone
+integer isol, ige, iat , iii
+integer idirac
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. REMPLISSAGE INCLUDE ppincl.h
+! INCLUDE GENERAL PROPRE A LA PHYSIQUE PARTICULIERE
+!===============================================================================
+
+! ---> Initialisation tableau IPPMOD
+
+do ipp = 1, nmodmx
+ ippmod(ipp) = -1
+enddo
+
+! ---> Initialisation pour la combustion gaz
+! Variables transportees
+ifm = 0
+ifp2m = 0
+iygfm = 0
+icm = 0
+icp2m = 0
+ifpcpm = 0
+iyfm = 0
+iyfp2m = 0
+icoyfp = 0
+! Variables algebriques ou d'etat
+nsalpp = 0
+nsalto = 0
+itemp = 0
+do igg = 1, ngazgm
+ iym(igg) = 0
+enddo
+ickabs = 0
+it4m = 0
+it3m = 0
+do idirac = 1, ndracm
+ irhol (idirac) = 0
+ iteml (idirac) = 0
+ ifmel (idirac) = 0
+ ifmal (idirac) = 0
+ iampl (idirac) = 0
+ itscl (idirac) = 0
+ imaml (idirac) = 0
+enddo
+
+! ---> Initialisation pour la combustion du charbon
+! Variables transportees
+do icha = 1, ncharb
+ if1m(icha) = 0
+ if2m(icha) = 0
+enddo
+if3m = 0
+if4p2m = 0
+if5m = 0
+if6m = 0
+if7m = 0
+iyco2 = 0
+do icla = 1, nclcpm
+ ixck(icla) = 0
+ ixch(icla) = 0
+ inp(icla) = 0
+ ih2(icla) = 0
+ ixwt(icla) = 0
+enddo
+! Variables algebriques ou d'etat
+itemp1 = 0
+do ige = 1, ngazem
+ iym1(ige) = 0
+enddo
+immel = 0
+do icla = 1, nclcpm
+ ix2(icla) = 0
+ itemp2(icla) = 0
+ irom2(icla) = 0
+ idiam2(icla) = 0
+ igmdch(icla) = 0
+ igmdv1(icla) = 0
+ igmdv2(icla) = 0
+ igmhet(icla) = 0
+ ighco2(icla) = 0
+ igmsec(icla) = 0
+enddo
+
+! ---> Initialisation pour la combustion fuel
+! Variables transportees
+
+ihm = 0
+do icla = 1, nclafu
+ ing(icla) = 0
+ iyfol(icla) = 0
+ ihlf (icla) = 0
+enddo
+ifvap = 0
+ifhtf = 0
+if4p2m = 0
+iyco2 = 0
+iyhcn = 0
+iyno = 0
+itaire = 0
+
+! Variables algebriques ou d'etat
+
+itemp1 = 0
+do ige = 1, ngazem
+ iym1(ige) = 0
+enddo
+
+do icla=1,nclafu
+ ix3(icla) = 0
+ itemp3(icla) = 0
+ irom3(icla) = 0
+ idiam3(icla) = 0
+ igmeva(icla) = 0
+ igmhtf(icla) = 0
+enddo
+
+ighcn1 = 0
+ighcn2 = 0
+ignoth = 0
+
+! ---> Initialisation pour l'effet Joule , Arc electrique et conduction ionique
+
+ipotr = 0
+ipoti = 0
+ipotva(1) = 0
+ipotva(2) = 0
+ipotva(3) = 0
+do iesp=1,ngazgm
+ iycoel(iesp) = 0
+enddo
+
+! ---> Initialisation de l'enthalpie commune a tous
+
+ihm = 0
+
+! ---> Coefficient de relation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+srrom = 1.d0
+
+
+!===============================================================================
+! 2. REMPLISSAGE INCLUDE ppthch.h
+! INCLUDE THERMOCHIMIE POUR LA PHYSIQUE PARTICULIERE
+!===============================================================================
+
+
+! ---> Initialisation Common / TCHPPI /
+
+npo = 0
+ngaze = 0
+ngazg = 0
+nato = 0
+nrgaz = 0
+
+! ---> Initialisation Common / TCHPPR /
+
+do it = 1, npot
+ th(it) = zero
+enddo
+
+do ir = 1, nrgazm
+ fs(ir) = zero
+enddo
+
+do igg = 1, ngazgm
+ do it = 1, npot
+ ehgazg(igg,it) = zero
+ enddo
+ do ir = 1, nrgazm
+ stoeg(igg,ir) = zero
+ enddo
+ wmolg(igg) = zero
+ ckabsg(igg)= zero
+enddo
+
+ckabs1 = zero
+
+diftl0 = zero
+
+do ige = 1, ngazem
+ do it = 1, npot
+ ehgaze(ige,it) = zero
+ enddo
+ wmole(ige) = zero
+enddo
+
+do iat = 1, natom
+ wmolat(iat) = zero
+enddo
+
+xco2 = zero
+xh2o = zero
+
+
+!===============================================================================
+! 3. REMPLISSAGE INCLUDE coincl.h
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE RELATIF A
+! LA COMBUSTION GAZ
+!===============================================================================
+
+! ---> Modele de flamme de diffusion (chimie 3 points)
+
+nmaxh = 0
+nmaxf = 0
+tinoxy = zero
+tinfue = zero
+do izone = 1, nozppm
+ ientox(izone) = 0
+ ientfu(izone) = 0
+enddo
+hinfue = zero
+hinoxy = zero
+hstoea = zero
+do ih = 1, nmaxhm
+ hh(ih) = zero
+enddo
+do if = 1, nmaxfm
+ ff(if)= zero
+ do ih = 1, nmaxhm
+ tfh(if,ih) = zero
+ enddo
+enddo
+
+! ---> Modele de flamme de premelange (modele EBU et LWC)
+! On prend 300K pour temperature des gaz frais.
+! En suite de calcul c'est ecrase par le fichier suite
+! Cette valeur ne sert que lors du premier appel a ebuphy
+! (ensuite, la valeur imposee dans les CL prend le pas)
+
+cebu = 2.5d0
+vref = zero
+lref = zero
+ta = zero
+tstar = zero
+frmel = zero
+tgf = 300.d0
+do izone = 1, nozppm
+ ientgf(izone) = 0
+ ientgb(izone) = 0
+ qimp(izone) = zero
+ fment(izone) = zero
+ tkent(izone) = zero
+enddo
+hgf = zero
+tgbad = zero
+
+fmin = zero
+fmax = 1.d0
+hmin = zero
+hmax = zero
+coeff1 = zero
+coeff2 = zero
+coeff3 = zero
+
+!===============================================================================
+! 4. REMPLISSAGE INCLUDE cpincl.h
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE RELATIF A
+! LA COMBUSTION CP
+!===============================================================================
+
+! ---> Donnees relatives au charbon
+
+! ---- Par charbon
+ncharb = 0
+nsolid = 0
+
+do icha = 1, ncharm
+
+ nclpch(icha) = 0
+
+ cch(icha) = zero
+ hch(icha) = zero
+ och(icha) = zero
+ alpha(icha) = zero
+ beta(icha) = zero
+ pcich(icha) = zero
+ rho0ch(icha) = zero
+
+ cck(icha) = zero
+ hck(icha) = zero
+ ock(icha) = zero
+ rhock(icha) = zero
+ gamma(icha) = zero
+ delta(icha) = zero
+ pcick(icha) = zero
+
+ xashch(icha) = zero
+ cpashc(icha) = zero
+ h0ashc(icha) = zero
+
+ xwatch(icha) = zero
+
+ iy1ch(icha) = 0
+ y1ch(icha) = zero
+ a1ch(icha) = zero
+ e1ch(icha) = zero
+ iy2ch(icha) = 0
+ y2ch(icha) = zero
+ a2ch(icha) = zero
+ e2ch(icha) = zero
+
+ ahetch(icha) = zero
+ ehetch(icha) = zero
+
+ iochet(icha) = 0
+
+ ahetc2(icha) = zero
+ ehetc2(icha) = zero
+
+ ioetc2(icha) = 0
+
+ ich(icha) = 0
+ ick(icha) = 0
+ iash(icha) = 0
+ iwat(icha) = 0
+
+enddo
+
+alpham = zero
+betam = zero
+
+do isol = 1, nsolim
+ do it = 1, npot
+ ehsoli(isol,it) = zero
+ enddo
+ wmols(isol) = zero
+enddo
+
+! ---- Par classe
+
+nclacp = 0
+do icla = 1, nclcpm
+ ichcor(icla) = 0
+ diam20(icla) = zero
+ dia2mn(icla) = zero
+ rho20(icla) = zero
+ rho2mn(icla) = zero
+ xmp0(icla) = zero
+ xmash(icla) = zero
+enddo
+
+! ---> Definition des Pointeurs du tableau TBMCR utilise dans cpphy1.F
+! et les sous-programmes appeles
+
+ do icha = 1, ncharm
+ if1mc(icha) = 0
+ if2mc(icha) = 0
+ enddo
+ ix1mc = 0
+ ix2mc = 0
+ ichx1f1 = 0
+ ichx2f2 = 0
+ icof1 = 0
+ icof2 = 0
+ ih2of1 = 0
+ ih2of2 = 0
+
+! ---> Donnees relatives a la combustion des especes gazeuses
+
+do icha = 1, ncharm
+ ichx1c(icha) = 0
+ ichx2c(icha) = 0
+enddo
+ichx1 = 0
+ichx2 = 0
+ico = 0
+io2 = 0
+ico2 = 0
+ih2o = 0
+in2 = 0
+
+xsi = 3.76d0
+
+do icha = 1, ncharm
+ chx1(icha) = zero
+ chx2(icha) = zero
+ a1(icha) = zero
+ a2(icha) = zero
+ b1(icha) = zero
+ b2(icha) = zero
+enddo
+
+
+! ---> Donnees complementaires relatives au calcul de rho sur les facettes
+! d'entree
+
+do izone = 1, nozppm
+ ientat(izone) = 0
+ ientcp(izone) = 0
+ timpat(izone) = zero
+ do icla = 1, nclcpm
+ x20(izone,icla) = zero
+ enddo
+enddo
+
+!===============================================================================
+! 5. REMPLISSAGE INCLUDE fuincl.h
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE RELATIF A
+! LA COMBUSTION FUEL
+!===============================================================================
+
+! ---> Donnees relatives au fuel
+
+nsolid = 0
+
+! ---- Par classe
+
+nclafu = 0
+
+! 1 seul fioul
+
+cfol = zero
+hfol = zero
+ofol = zero
+pcifol = zero
+rho0fl = zero
+
+ckf = zero
+hkf = zero
+okf = zero
+rhokf = zero
+pcikf = zero
+
+yfol = zero
+afol = zero
+efol = zero
+
+ahetfl = zero
+ehetfl = zero
+
+iofhet = 0
+
+ifol = 0
+ikf = 0
+
+do isol = 1, nsolim
+ do it = 1, npot
+ ehsoli(isol,it) = zero
+ enddo
+ wmols(isol) = zero
+enddo
+
+! ---> Donnees relatives a la combustion des especes gazeuses
+
+ifov = 0
+ico = 0
+io2 = 0
+ico2 = 0
+ih2o = 0
+in2 = 0
+
+xsi = 3.76d0
+fvapmx = 2.d0*0.012d0 / (2.d0*0.028d0 + xsi*0.028d0)
+
+fov = zero
+a = zero
+b = zero
+
+
+! ---> Donnees complementaires relatives au calcul de rho sur les facettes
+! d'entree
+
+do izone = 1, nozppm
+ ientat(izone) = 0
+ ientfl(izone) = 0
+ timpat(izone) = zero
+ timpfl(izone) = zero
+enddo
+
+!===============================================================================
+! 6. REMPLISSAGE INCLUDE elincl.h
+! INCLUDE POUR LA PHYSIQUE PARTICULIERE RELATIF A
+! EFFET JOULE, ARC ELECTRIQUE, CONDUCTION IONIQUE
+!===============================================================================
+
+do iii=1,ntypmx
+ ientm1(iii)=0
+ ielph1(iii)=0
+ ielph2(iii)=0
+ ielph3(iii)=0
+ ielneu(iii)=0
+enddo
+
+do it=1,npot
+ do iesp=1,ngazgm
+ rhoel (iesp,it) = 0.d0
+ cpel (iesp,it) = 0.d0
+ sigel (iesp,it) = 0.d0
+ xlabel(iesp,it) = 0.d0
+ visel (iesp,it) = 0.d0
+ xkabel(iesp,it) = 0.d0
+ enddo
+enddo
+
+do iesp=1,ngazgm
+ qespel(iesp) = 0.d0
+ suscep(iesp) = 0.d0
+enddo
+
+!===============================================================================
+! 7. REMPLISSAGE INCLUDE atincl.h
+! INCLUDE POUR LA VERSION ATMOSPHERIQUE
+!===============================================================================
+
+imeteo = 1
+nbmetd = 0
+nbmett = 0
+nbmetm = 0
+do izone = 1, nozppm
+ iprofm(izone) = 0
+enddo
+
+return
+end
+
diff --git a/src/pprt/ppiniv.f90 b/src/pprt/ppiniv.f90
new file mode 100644
index 0000000..b3d6839
--- /dev/null
+++ b/src/pprt/ppiniv.f90
@@ -0,0 +1,429 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ppiniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL POUR
+! LA PHYSIQUE PARTICULIERE
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. AIGUILLAGE VERS LE MODELE ADEQUAT
+!===============================================================================
+
+
+! ---> Combustion gaz
+! Flamme de diffusion : chimie 3 points
+
+ if ( ippmod(icod3p).ge.0 ) then
+ call d3pini &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+ endif
+
+! ---> Combustion gaz
+! Flamme de premelange : modele EBU
+
+ if ( ippmod(icoebu).ge.0 ) then
+ call ebuini &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion gaz
+! Flamme de premelange : modele LWC
+
+ if ( ippmod(icolwc).ge.0 ) then
+ call lwcini &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion charbon pulverise
+
+if ( ippmod(icp3pl).ge.0 ) then
+ call cpiniv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion charbon pulverise couples Lagrangien
+
+if ( ippmod(icpl3c).ge.0 ) then
+ call cplini &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion fuel
+
+if (ippmod(icfuel).ge.0 ) then
+ call fuiniv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Compressible
+
+if ( ippmod(icompf).ge.0 ) then
+ call cfiniv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Version electrique
+! Effet Joule
+! Conduction ionique
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+ call eliniv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+endif
+
+! ---> Ecoulements atmospheriques
+
+if ( ippmod(iatmos).ge.0 ) then
+
+ call atiniv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+endif
+
+! ---> Ecoulements aerorefrigerants
+
+if ( ippmod(iaeros).ge.0 ) then
+
+ call ctiniv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+endif
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/ppinv2.f90 b/src/pprt/ppinv2.f90
new file mode 100644
index 0000000..a3f0a58
--- /dev/null
+++ b/src/pprt/ppinv2.f90
@@ -0,0 +1,294 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ppinv2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL POUR
+! LA PHYSIQUE PARTICULIERE
+
+! Cette routine est appelee dans l'etape de resolution
+! des scalaires
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+! UNIQUEMENT POUR LES PHYSIQUES "COMBUSTION GAZ"
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. AIGUILLAGE VERS LE MODELE ADEQUAT
+!===============================================================================
+
+
+! ---> Combustion gaz
+! Flamme de diffusion : chimie 3 points
+
+ if ( ippmod(icod3p).ge.0 ) then
+ call d3pini &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+ endif
+
+! ---> Combustion gaz
+! Flamme de premelange : modele EBU
+
+ if ( ippmod(icoebu).ge.0 ) then
+ call ebuini &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Combustion gaz
+! Flamme de premelange : modele LWC
+
+ if ( ippmod(icolwc).ge.0 ) then
+ call lwcini &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+endif
+
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/pplecd.f90 b/src/pprt/pplecd.f90
new file mode 100644
index 0000000..0d44997
--- /dev/null
+++ b/src/pprt/pplecd.f90
@@ -0,0 +1,129 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine pplecd
+!================
+!===============================================================================
+! FONCTION :
+! ---------
+
+! LECTURE DU FICHIER DE DONNEES PHYSIQUE PARTICULIERE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+
+! VARIABLES LOCALES
+
+
+!===============================================================================
+
+!===============================================================================
+! 1. AIGUILLAGE VERS LE MODELE ADEQUAT
+!===============================================================================
+
+! ---> Flamme de diffusion - Chimie 3 points
+! Flamme de premelange - Modele EBU
+! Flamme de premelange - Modele LWC
+
+if ( ippmod(icod3p).ge.0 .or. ippmod(icoebu).ge.0 &
+ .or. ippmod(icolwc).ge.0 ) then
+ call colecd
+ !==========
+endif
+
+
+! ---> Flamme charbon pulverise
+
+if ( ippmod(icp3pl).ge.0 ) then
+ call cplecd
+ !==========
+endif
+
+! ---> Combustion charbon pulverise couple transport Lagrangien
+! des particules de charbon
+
+if ( ippmod(icpl3c).ge.0 ) then
+ call cplecd
+ !==========
+endif
+
+! ---> Flamme fuel
+
+if ( ippmod(icfuel).ge.0 ) then
+ call fulecd
+ !==========
+endif
+
+! ---> Version Electrique : Effet Joule, Arc Electrique,
+! Conduction Ionique
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+ call ellecd
+ !==========
+endif
+
+!----
+! FIN
+!----
+
+return
+end
+
diff --git a/src/pprt/pppdfr.f90 b/src/pprt/pppdfr.f90
new file mode 100644
index 0000000..78a59f2
--- /dev/null
+++ b/src/pprt/pppdfr.f90
@@ -0,0 +1,361 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine pppdfr &
+!================
+
+ ( ncelet , ncel , indpdf , &
+ fm , fp2m , &
+ fmini , fmaxi , &
+ dirmin , dirmax , fdeb , ffin , hrec )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! CALCUL DES PARAMETRES DE LA PDF
+! PDF RECTANGLE - PICS DE DIRAC "GENERALISEE" PPl - AE
+
+! LE RESULTAT EST :
+! ---------------
+! CALCUL DES PARAMETRES ASSOCIES AUX FONCTIONS RECTANGLE - DIRAC
+
+! INDPDF indique le passage ou non par la pdf
+! DIRMIN contient le Dirac en FMINI
+! DIRMAX - - - - le Dirac en FMAXI
+! FDEB - - - - l'abcisse de debut du rectangle
+! FFIN - - - - - - - - - - - fin - - - - - -
+! HREC - - - - la hauteur du rectangle
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! indpdf ! te ! --> ! indicateur passage ou non par pdf !
+! fm ! tr ! <-- ! moyenne de la fraction de melange !
+! fp2m ! tr ! <-- ! variance de la fraction de melange !
+! fmini ! tr ! <-- ! borne min de la fraction de melange !
+! fmaxi ! tr ! <-- ! borne max de la fraction de melange !
+! dirmin ! tr ! <- ! dirac en fmini !
+! dirmax ! tr ! <- ! dirac en fmaxi !
+! fdeb ! tr ! <- ! abscisse debut rectangle !
+! ffin ! tr ! <- ! abscisse fin rectangle !
+! hrec ! tr ! <- ! hauteur rectangle !
+! xinpdf ! tr ! <- ! indicateur passage ou non par pdf !
+! ! ! ! pourrait etre entier mais puisqu'on a !
+! ! ! ! un tableau de travail reel on s"en !
+! ! ! ! sert !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!==============================================================================
+! DONNEES EN COMMON
+!==============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel
+integer indpdf(ncelet)
+
+double precision fm(ncelet), fp2m(ncelet)
+double precision fmini(ncelet), fmaxi(ncelet)
+double precision dirmin(ncelet), dirmax(ncelet)
+double precision fdeb(ncelet), ffin(ncelet)
+double precision hrec(ncelet)
+
+
+! VARIABLES LOCALES
+
+integer iel, n1, n2, n3, n4, n5 , nfp2 , nbspdf
+double precision t1, t2, t3, t1mod, t2mod , fp2max
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. INITIALISATION
+!===============================================================================
+
+do iel = 1, ncel
+
+ indpdf(iel) = 0
+
+ dirmin(iel) = 0.d0
+ dirmax(iel) = 0.d0
+ fdeb (iel) = 0.d0
+ ffin (iel) = 0.d0
+ hrec (iel) = 0.d0
+
+enddo
+
+!===============================================================================
+! 1. CALCULS PRELIMINAIRES
+!===============================================================================
+
+! Parametre relatif a la variance
+t1 = 1.d-08
+! Parametre relatif a la moyenne
+t2 = 5.d-07
+
+do iel = 1, ncel
+
+! Modifs des parametres T1 et T2 afin de tenir compte du fait que
+! FMINI < FM < FMAXI
+ t1mod = t1*(fmaxi(iel)-fmini(iel))**2
+ t2mod = t2*(fmaxi(iel)-fmini(iel))
+ if ( (fp2m(iel).gt.t1mod) &
+ .and.(fm(iel) .ge. (fmini(iel) + t2mod)) &
+ .and.(fm(iel) .le. (fmaxi(iel) - t2mod)) ) then
+ indpdf(iel) = 1
+ endif
+enddo
+
+! Clipping de la variance
+
+nfp2 = 0
+do iel = 1, ncel
+ fp2max = (fmaxi(iel)-fm(iel))*(fm(iel)-fmini(iel))
+ if ( fp2m(iel) .gt. fp2max ) then
+ fp2m(iel) = fp2max
+ nfp2 = nfp2 + 1
+ endif
+enddo
+if ( irangp .ge. 0 ) then
+ call parcpt(nfp2)
+endif
+WRITE(NFECRA,*) ' PPPDFR : Points de clipping', &
+ ' de la variance : ',NFP2
+
+!===============================================================================
+! 2. CALCUL DES PARAMETRES DE LA FONCTION DENSITE DE PROBABILITE
+!===============================================================================
+
+do iel = 1, ncel
+
+ if ( indpdf(iel).eq.1 ) then
+
+ if ( ( (fm(iel) .le.(fmini(iel) + fmaxi(iel))*0.5d0) &
+ .and.(fp2m(iel).le.(fm(iel) - fmini(iel))**2/3.d0)) &
+ .or. ( (fm(iel) .gt.(fmini(iel) + fmaxi(iel))*0.5d0) &
+ .and.(fp2m(iel).le.(fmaxi(iel) -fm(iel))**2/3.d0)) ) &
+ then
+
+! --> Rectangle seul
+
+ hrec(iel) = sqrt(3.d0*fp2m(iel))
+ dirmin(iel) = 0.d0
+ dirmax(iel) = 0.d0
+ fdeb(iel) = fm(iel) - hrec(iel)
+ ffin(iel) = fm(iel) + hrec(iel)
+
+ elseif( (fm(iel) .le.(fmini(iel) + fmaxi(iel))*0.5d0) &
+ .and. (fp2m(iel).le.((fm(iel) - fmini(iel)) &
+ *(2.d0*fmaxi(iel) +fmini(iel)-3.d0*fm(iel))/3.d0)) )&
+ then
+
+! --> Rectangle et un Dirac en FMINI
+
+ fdeb(iel) = fmini(iel)
+ dirmax(iel) = 0.d0
+ ffin(iel) = fmini(iel) +1.5d0*( (fm(iel) - fmini(iel))**2 &
+ + fp2m(iel) ) &
+ /(fm(iel) - fmini(iel))
+ dirmin(iel) = (3.d0*fp2m(iel) -(fm(iel) - fmini(iel))**2) &
+ / (3.d0*((fm(iel) - fmini(iel))**2 +fp2m(iel)))
+
+ elseif( (fm(iel) .gt.(fmini(iel) + fmaxi(iel))*0.5d0) &
+ .and. (fp2m(iel).le.((fmaxi(iel) - fm(iel)) &
+ *(3.d0*fm(iel)-fmaxi(iel)-2.d0*fmini(iel))/3.d0)) )&
+ then
+
+! --> Rectangle et un Dirac en FMAXI (c'est juste ;
+! le HI/81/02/03/A contient une erreur p 12)
+
+ ffin(iel) = fmaxi(iel)
+ dirmin(iel) = 0.d0
+ fdeb(iel) = fmini(iel) &
+ + ( 3.d0*( (fm(iel)-fmini(iel))**2+fp2m(iel) ) &
+ + (fmaxi(iel) - fmini(iel))**2 &
+ - 4.d0*(fm(iel) - fmini(iel)) &
+ *(fmaxi(iel) - fmini(iel)) ) &
+ / (2.d0*(fm(iel) - fmaxi(iel)))
+ dirmax(iel) = ( 3.d0*fp2m(iel) -(fm(iel) - fmaxi(iel))**2 ) &
+ / ( 3.d0*((fm(iel) - fmaxi(iel))**2 +fp2m(iel)) )
+
+ else
+
+! --> Rectangle et deux Diracs
+
+ fdeb(iel) = fmini(iel)
+ ffin(iel) = fmaxi(iel)
+ dirmax(iel) = 3.d0*((fm(iel) - fmini(iel))**2 +fp2m(iel)) &
+ /(fmaxi(iel) - fmini(iel))**2 &
+ -2.d0*(fm(iel) - fmini(iel)) &
+ /(fmaxi(iel) - fmini(iel))
+ dirmin(iel) = dirmax(iel) + 1.d0 - 2.d0*(fm(iel)-fmini(iel))&
+ /(fmaxi(iel)-fmini(iel))
+
+ endif
+
+ if ( abs(ffin(iel) - fdeb(iel)).gt.epzero ) then
+ hrec(iel) = ( 1.d0-dirmin(iel)-dirmax(iel) ) &
+ / ( ffin(iel)-fdeb(iel) )
+ else
+ t3 = sqrt(3.d0*t1*(fmaxi(iel)-fmini(iel))**2)
+ fdeb(iel) = min(fmaxi(iel),max(fmini(iel),fm(iel) - t3))
+ ffin(iel) = min(fmaxi(iel),max(fmini(iel),fm(iel) + t3))
+
+ if ( abs(ffin(iel) - fdeb(iel)).gt.epzero ) then
+ hrec(iel) = ( 1.d0-dirmin(iel)-dirmax(iel) ) &
+ /( ffin(iel) - fdeb(iel) )
+ else
+ hrec(iel) = 0.d0
+ endif
+
+ endif
+
+ else
+ dirmin(iel) = 0.d0
+ dirmax(iel) = 0.d0
+ fdeb(iel) = 0.d0
+ ffin(iel) = 0.d0
+ hrec(iel) = 0.d0
+ endif
+
+enddo
+
+! Verification : si Hrec <= 0 on passe sans les PDF
+
+nbspdf = 0.d0
+do iel=1,ncel
+ if ( hrec(iel) .le. 0.d0 .and. indpdf(iel).eq.1 ) then
+
+ indpdf(iel) = 0
+ nbspdf = nbspdf + 1
+
+ endif
+enddo
+
+if ( irangp .ge. 0 ) then
+ call parcpt(nbspdf)
+endif
+WRITE(NFECRA,*) ' PPPDFR : Basculement sans les PDF ',NBSPDF
+
+!===============================================================================
+! 4. IMPRESSION
+!===============================================================================
+
+n1 = 0
+n2 = 0
+n3 = 0
+n4 = 0
+n5 = 0
+do iel = 1, ncel
+ if ( indpdf(iel).eq.1 ) then
+ n1 = n1+1
+ if ( dirmin(iel).gt.epzero &
+ .and. dirmax(iel).lt.epzero ) then
+ n2 = n2+1
+ else if ( dirmin(iel).lt.epzero &
+ .and. dirmax(iel).gt.epzero ) then
+ n3 = n3+1
+ else if ( dirmin(iel).gt.epzero &
+ .and. dirmax(iel).gt.epzero ) then
+ n4 = n4+1
+ else if ( dirmin(iel).lt.epzero &
+ .and. dirmax(iel).lt.epzero ) then
+ n5 = n5+1
+ endif
+ endif
+enddo
+
+if ( irangp.ge.0 ) then
+
+ call parcpt (n1)
+ !==========
+ call parcpt (n2)
+ !==========
+ call parcpt (n3)
+ !==========
+ call parcpt (n4)
+ !==========
+ call parcpt (n5)
+ !==========
+endif
+
+write(nfecra,1000) n1, ncel
+write(nfecra,2000) n5, n2, n3, n4
+
+
+!----
+! FORMATS
+!----
+
+ 1000 format ( /, &
+'PDF RECTANGLE - PICS DE DIRAC COPDFR',/, &
+'MOYENNE, VARIANCE DU TRACEUR TRANPORTES',/, &
+'NOMBRE DE POINTS TURBULENTS (PASSAGE PAR LES PDF) = ',I6,/, &
+'NOMBRE DE POINTS DE CALCULS = ',I6 )
+ 2000 format( &
+' Nb points avec PDF rectangle sans Dirac = ',I6,/,&
+' - - - - - - - - - -- - - - et Dirac en FMINI = ',I6,/,&
+' - - - - - - - - - -- - - - - - - - - - FMAXI = ',I6,/,&
+' - - - - - - - - - - - - - - - Diracs en FMINI et FMAXI = ',I6,/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/ppphyv.f90 b/src/pprt/ppphyv.f90
new file mode 100644
index 0000000..3a632e1
--- /dev/null
+++ b/src/pprt/ppphyv.f90
@@ -0,0 +1,520 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ppphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE PHYSIQUE PARTICULIERE : REMPLISSAGE DES VARIABLES PHYSIQUES
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique ppvist devra etre creee)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usppiv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra , ifinia , ifinra
+integer if3max, iw9 , iw10
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+! 2. AIGUILLAGE VERS LE MODELE ADEQUAT
+!===============================================================================
+
+! ---> Flamme de diffusion chimie 3 points
+
+ if ( ippmod(icod3p).ge.0 ) then
+
+ call d3pphy &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! ---> Flamme de diffusion chimie equilibre
+
+! IF ( IPPMOD(ICODEQ).GE.0 )
+
+
+! ---> Flamme de premelange : Modele EBU
+
+ if ( ippmod(icoebu).ge.0 ) then
+
+ call ebuphy &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+ endif
+
+! ---> Flamme de premelange : Modele BML
+
+! IF ( IPPMOD(ICOBML).GE.0 )
+! & CALL BMLPHY
+
+! ---> Flamme de premelange : Modele LWC
+
+ if ( ippmod(icolwc).ge.0 ) then
+
+ call lwcphy &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet,ncel,nfac,nfabor,nfml, nprfml , &
+ nnod , lndfac , lndfbr, ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse, nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr, ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr, nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser, ia , &
+ xyzcen, surfac, surfbo,cdgfac, cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser, ra )
+ endif
+
+! ---> Flamme charbon pulverise
+
+ if ( ippmod(icp3pl).ge.0 ) then
+
+ ifinia = idebia
+
+ if3max = idebra
+ iw9 = if3max + ncelet
+ iw10 = iw9 + ncelet
+ ifinra = iw10 + ncelet
+ CALL RASIZE('PPPPHY',IFINRA)
+
+ call cpphyv &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ra(if3max), &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ ra(iw9), ra(iw10), &
+ rdevel , rtuser , ra )
+
+ endif
+
+! ---> Flamme charbon pulverise couplee Transport Lagrangien
+! des particules de charbon
+
+ if ( ippmod(icpl3c).ge.0 ) then
+
+ call cplphy &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! ---> Flamme fuel
+
+ if ( ippmod(icfuel).ge.0 ) then
+
+ call fuphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! ---> Compressible
+
+ if ( ippmod(icompf).ge.0 ) then
+
+ call cfphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+ endif
+
+! ---> Physique particuliere : Versions electriques
+! Effet Joule
+! Arc electrique
+! Conduction ionique
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+! En Joule, on impose a l'utilisateur de programmer ses lois
+! sur les proprietes (masse volumique , ...)
+! Des exemples physiques sont fournis dans uselph.
+! En arc electrique, on lit un fichier de donnees et on interpole.
+
+ call elphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+! ---> Aerorefrigerants
+
+if ( ippmod(iaeros).ge.0 ) then
+
+ call ctphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+! ---> Atmospheric Flows
+
+if ( ippmod(iatmos).ge.1 ) then
+
+ call atphyv &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/ppprcl.f90 b/src/pprt/ppprcl.f90
new file mode 100644
index 0000000..2622182
--- /dev/null
+++ b/src/pprt/ppprcl.f90
@@ -0,0 +1,432 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ppprcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ rcodcl , coefu , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! PREPARATION DU REMPLISSAGE DES CONDITIONS AUX LIMITES
+
+! AIGUILLAGE SPECIFIQUE AUX PHYSIQUES PARTICULIERES
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefu ! tr ! --- ! tab de trav !
+! nfabor,3 ! ! ! (vitesse en i' ) !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "cfpoin.h"
+include "atincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefu(nfabor,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, izone, icha, iclapc
+integer iphas, ivar
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! ---> Combustion gaz USEBUC
+! Flamme de diffusion : chimie 3 points
+
+if ( ippmod(icod3p).ge.0 ) then
+
+ do izone = 1, nozppm
+ qimp(izone) = zero
+ iqimp(izone) = 0
+ ientox(izone) = 0
+ ientfu(izone) = 0
+ enddo
+
+ tinoxy = zero
+ tinfue = zero
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+! ---> Combustion gaz USEBUC
+! Flamme de premelange : modele EBU
+
+elseif ( ippmod(icoebu).ge.0 ) then
+
+ do izone = 1, nozppm
+ iqimp(izone) = 0
+ qimp(izone) = zero
+ icalke(izone) = 0
+ dh(izone) = zero
+ xintur(izone) = zero
+ fment(izone) = zero
+ tkent(izone) = zero
+ ientgf(izone) = 0
+ ientgb(izone) = 0
+ enddo
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+
+! ---> Combustion charbon pulverise USCPCL
+
+elseif ( ippmod(icp3pl).ge.0 ) then
+
+ do izone = 1, nozppm
+ iqimp(izone) = 0
+ icalke(izone) = 0
+ ientcp(izone) = 0
+ ientat(izone) = 0
+ dh(izone) = zero
+ xintur(izone) = zero
+ qimpat(izone) = zero
+ timpat(izone) = zero
+ do icha = 1, ncharm
+ qimpcp(izone,icha) = zero
+ timpcp(izone,icha) = zero
+ do iclapc = 1, ncpcmx
+ distch(izone,icha,iclapc) = zero
+ enddo
+ enddo
+ enddo
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+! ---> Combustion charbon pulverise couple Lagrangien USCPLC
+
+elseif ( ippmod(icpl3c).ge.0 ) then
+
+ do izone = 1, nozppm
+ iqimp(izone) = 0
+ icalke(izone) = 0
+ ientat(izone) = 0
+ dh(izone) = zero
+ xintur(izone) = zero
+ qimpat(izone) = zero
+ timpat(izone) = zero
+ do icha = 1, ncharm
+ qimpcp(izone,icha) = zero
+ enddo
+ enddo
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+! ---> Combustion fuel USFUCL
+
+elseif ( ippmod(icfuel).ge.0 ) then
+
+ do izone = 1, nozppm
+ iqimp(izone) = 0
+ icalke(izone) = 0
+ ientat(izone) = 0
+ dh(izone) = zero
+ xintur(izone) = zero
+ qimpat(izone) = zero
+ timpat(izone) = zero
+ ientfl(izone) = 0
+ qimpfl(izone) = zero
+ timpfl(izone) = zero
+ enddo
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+! ---> Compressible
+
+elseif ( ippmod(icompf).ge.0 ) then
+
+! Zones
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+! Marqueur d'utilisation de Rusanov au bord (0 = non)
+! Marqueur de flux conductif impose au bord (0 = non)
+ do iphas = 1, nphas
+ do ifac = 1, nfabor
+ ia(iifbru+ifac-1+(iphas-1)*nfabor) = 0
+ ia(iifbet+ifac-1+(iphas-1)*nfabor) = 0
+ enddo
+ enddo
+
+! Flux de Rusanov au bord pour Qdm et E
+ do iphas = 1, nphas
+ do ifac = 1, nfabor
+ propfb(ifac,ipprob(ifbrhu(iphas))) = 0.d0
+ propfb(ifac,ipprob(ifbrhv(iphas))) = 0.d0
+ propfb(ifac,ipprob(ifbrhw(iphas))) = 0.d0
+ propfb(ifac,ipprob(ifbene(iphas))) = 0.d0
+ enddo
+ enddo
+
+! Initialisation des RCODCL(IFAC,.,1) � -RINFIN
+! pour savoir si l'utilisateur les a modifies (ils sont
+! initialises par defaut � 0)
+ do ivar = 1, nvar
+ do ifac = 1, nfabor
+ rcodcl(ifac,ivar,1) =-rinfin
+ enddo
+ enddo
+
+! ---> Version electrique
+! Effet Joule
+! Conduction ionique
+
+elseif ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+! ---> Version ecoulements atmospheriques
+
+elseif ( ippmod(iatmos).ge.0 ) then
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+ do izone = 1, nozppm
+ iprofm(izone) = 0
+ enddo
+
+! Initialisation des RCODCL(IFAC,.,1) � RINFIN
+! pour savoir si l'utilisateur les a modifies (ils sont
+! initialises par defaut � 0)
+ do ivar = 1, nvar
+ do ifac = 1, nfabor
+ rcodcl(ifac,ivar,1) = rinfin
+ enddo
+ enddo
+
+! ---> Version aerorefrigerants
+
+elseif ( ippmod(iaeros).ge.0 ) then
+
+ do ifac = 1, nfabor
+ izfppp(ifac) = 0
+ enddo
+
+endif
+
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/ppprop.f90 b/src/pprt/ppprop.f90
new file mode 100644
index 0000000..729113d
--- /dev/null
+++ b/src/pprt/ppprop.f90
@@ -0,0 +1,142 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ppprop &
+!================
+
+ ( ipropp , ipppst )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES D'ETAT SELON
+! LE TYPE DE PHYSIQUE PARTICULIERE
+! (DANS VECTEURS PROPCE, PROPFA, PROPFB)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ipropp ! e ! <-- ! numero de la derniere propriete !
+! ! ! ! (les proprietes sont dans propce, !
+! ! ! ! propfa ou prpfb) !
+! ipppst ! e ! <-- ! pointeur indiquant le rang de la !
+! ! ! ! derniere grandeur definie aux !
+! ! ! ! cellules (rtp,propce...) pour le !
+! ! ! ! post traitement !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "atincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ipropp, ipppst
+
+!===============================================================================
+
+! ---> Physique particuliere : Combustion Gaz
+
+if ( ippmod(icod3p).ge.0 .or. ippmod(icoebu).ge.0 &
+ .or. ippmod(icolwc).ge.0 ) then
+ call coprop(ipropp,ipppst)
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Charbon Pulverise
+
+if ( ippmod(icp3pl).ge.0 ) then
+ call cpprop(ipropp,ipppst)
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Charbon Pulverise
+! Couplee Transport Lagrangien des particules de charbon
+
+if ( ippmod(icpl3c).ge.0 ) then
+ call cplpro (ipropp,ipppst)
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Fuel
+
+if ( ippmod(icfuel).ge.0 ) then
+ call fuprop(ipropp,ipppst)
+ !==========
+endif
+
+! ---> Physique particuliere : Compressible
+
+if ( ippmod(icompf).ge.0 ) then
+ call cfprop(ipropp,ipppst)
+ !==========
+endif
+
+! ---> Physique particuliere : Versions electriques
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+ call elprop(ipropp,ipppst)
+ !==========
+endif
+
+! ---> Physique particuliere : Atmospherique
+
+if ( ippmod(iatmos).ge.1 ) then
+ call atprop(ipropp,ipppst)
+ !==========
+endif
+
+end
diff --git a/src/pprt/ppray4.f90 b/src/pprt/ppray4.f90
new file mode 100644
index 0000000..0273523
--- /dev/null
+++ b/src/pprt/ppray4.f90
@@ -0,0 +1,482 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ppray4 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+
+ mode , &
+
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ tparop , hparop , tempk , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+
+! SOUS-PROGRAMME PHYSIQUES PARTICULIERES
+! POUR LES CONVERSIONS TEMPERATURE <-> ENTHALPIE
+! POUR LE MELANGE GAZEUX
+
+
+
+! A) L'ENTHALPIE DOIT ETRE CONVERTIE EN TEMPERATURE EN KELVIN
+! IL FAUT ECRIRE UNE LOI DE CONVERSION :
+! ENTHALPIE -> TEMPERATURE (MODE = 1)
+! POUR REMPLIR TEMPK
+
+
+! B) SI DE PLUS ON CALCULE LES TEMPERATURES DE PAROI
+! ALORS IL FAUT FOURNIR UNE LOI DE CONVERSION :
+! TEMPERATURE -> ENTHALPIE (MODE = -1)
+! POUR REMPLIR HPAROP
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! mode ! e ! <-- ! type de conversion enthal<->tempk !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! cofrua,cofrub ! tr ! --> ! conditions aux limites aux !
+!(nfabor) ! ! ! faces de bord pour la luminances !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! tempk(ncelet) ! tr ! --> ! temperature en kelvin !
+! hparop(nfabor ! tr ! --> ! enthalpie massique de paroi en j/kg !
+! ! ! ! (en degres celsius ou kelvin) !
+! tparop(nfabor ! tr ! <-- ! temperature de paroi en kelvin !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer mode
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+
+double precision tempk(ncelet)
+double precision tparop(nfabor), hparop(nfabor)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , ifac , icla , icha , isol , ige
+integer ipcx2c , ixchcl, ixckcl, ixnpcl, igg, iii
+integer iesp
+double precision coefg(ngazgm), coefe(ngazem)
+double precision f1mc(ncharm) , f2mc(ncharm)
+double precision x2t , h2 , x2h2 , hf , xsolid(nsolim),t1
+double precision ym (ngazgm)
+double precision diamgt,masgut,mkgout,mfgout,mkfini,rhofol
+
+!===============================================================================
+
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1 - INITIALISATIONS GENERALES
+!===============================================================================
+
+
+!===============================================================================
+! 2.1 - CALCUL DE LA TEMPERATURE EN KELVIN AUX CELLULES
+!===============================================================================
+
+!---> CONVERSION ENTHALPIE -> TEMPERATURE (MODE = 1)
+! AUX CELLULES FLUIDES
+! (UTILE SI NON TRANSPARENT)
+! -----------------------------------------------
+
+
+if (mode.eq.1) then
+
+! ---- Combustion gaz : Flamme de Premelange ou Flamme de Diffusion
+
+ if ( ippmod(icoebu).ge.0 .or. &
+ ippmod(icod3p).ge.0 ) then
+
+ do iel = 1,ncel
+ tempk(iel) = propce(iel, ipproc(itemp))
+ enddo
+
+! ---- Combustion charbon pulverise
+
+ else if ( ippmod(icp3pl).ge.0 ) then
+
+ do iel = 1,ncel
+ tempk(iel) = propce(iel, ipproc(itemp1))
+ enddo
+
+! ---- Combustion fuel
+
+ else if ( ippmod(icfuel).ge.0 ) then
+
+ do iel = 1,ncel
+ tempk(iel) = propce(iel, ipproc(itemp1))
+ enddo
+
+! ---- Module Electrique
+
+ else if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+
+ do iel = 1,ncel
+ tempk(iel) = propce(iel, ipproc(itemp))
+ enddo
+
+ endif
+
+endif
+
+
+!===============================================================================
+! 2.2 - CALCUL DE L'ENTHALPIE AU FACES DE BORD
+!===============================================================================
+
+!---> CONVERSION TEMPERATURE -> ENTHALPIE (MODE = -1)
+! AUX FACES DE BORD DE PAROI
+! (INUTILE POUR LES PAROIS ISOTH(IFAC)=3 ET EPS(IFAC)=0)
+! ------------------------------------------------------
+
+
+if (mode.eq.-1) then
+
+ do ifac = 1,nfabor
+
+ if (itypfb(ifac).eq.iparoi .or. &
+ itypfb(ifac).eq.iparug) then
+
+! Numero de la cellule en regard
+
+ iel = ifabor(ifac)
+
+! ---- Combustion gaz : Flamme de Premelange ou Flamme de Diffusion
+
+ if ( ippmod(icoebu).ge.0 .or. &
+ ippmod(icod3p).ge.0 ) then
+
+ do igg = 1, ngazgm
+ coefg(igg) = zero
+ enddo
+ coefg(1) = propfb(ifac,ipprob(iym(1)))
+ coefg(2) = propfb(ifac,ipprob(iym(2)))
+ coefg(3) = propfb(ifac,ipprob(iym(3)))
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hparop(ifac) , tparop(ifac) )
+
+! ---- Combustion charbon pulverise
+
+ else if ( ippmod(icp3pl).ge.0 ) then
+
+ x2t = zero
+ x2h2 = zero
+ do icla = 1, nclacp
+ icha = ichcor(icla)
+ ixchcl = isca(ixch(icla))
+ ixckcl = isca(ixck(icla))
+ ixnpcl = isca(inp(icla ))
+ ipcx2c = ipproc(ix2(icla))
+ x2t = x2t + propce(iel,ipcx2c)
+ h2 = zero
+ do isol = 1, nsolim
+ xsolid(isol) = zero
+ enddo
+ if (propce(iel,ipcx2c).gt.epsicp) then
+ xsolid(ich(icha) ) = rtp(iel,ixchcl) &
+ / propce(iel,ipcx2c)
+ xsolid(ick(icha) ) = rtp(iel,ixckcl) &
+ / propce(iel,ipcx2c)
+ xsolid(iash(icha)) = rtp(iel,ixnpcl)*xmash(icla) &
+ / propce(iel,ipcx2c)
+ if ( ippmod(icp3pl).eq.1 ) then
+ xsolid(iwat(icha)) = rtp(iel,isca(ixwt(icla))) &
+ /propce(iel,ipcx2c)
+ endif
+ iii = icla
+ t1 = tparop(ifac)
+ call cpthp2 &
+ !==========
+ ( mode , iii , h2 , xsolid , &
+ tparop(ifac) , t1 )
+ endif
+ x2h2 = x2h2 + propce(iel,ipcx2c)*h2
+ enddo
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ do icha = 1, ncharb
+ f1mc(icha) = rtp(iel,isca(if1m(icha))) &
+ / (1.d0-x2t)
+ f2mc(icha) = rtp(iel,isca(if2m(icha))) &
+ / (1.d0-x2t)
+ enddo
+ do icha = (ncharb+1), ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ do ige = 1, (ngaze-2*ncharb)
+ coefe(ige) = propce(iel,ipproc(iym1(ige)))
+ enddo
+ call cpthp1 &
+ !==========
+ ( mode , hf , coefe , &
+ f1mc , f2mc ,tparop(ifac) )
+ hparop(ifac) = (1.d0-x2t)*hf+x2h2
+
+! ---- Combustion fuel
+
+ else if ( ippmod(icfuel).ge.0 ) then
+
+ x2t = zero
+ x2h2 = zero
+
+ do icla=1,nclafu
+
+ x2t = x2t+rtpa(iel,isca(iyfol(icla)))
+
+ mkfini = rho0fl*pi/6.d0*dinikf(icla)**3
+ rhofol = propce(iel,ipproc(irom3(icla)))
+ diamgt = propce(iel,ipproc(idiam3(icla)))
+ masgut = rhofol*pi/6.d0*diamgt**3
+ if (diamgt.le.dinikf(icla)) then
+ mkgout = masgut
+ else
+ mkgout = mkfini
+ endif
+ mfgout = masgut - mkgout
+ xsolid(1) = 1.d0-fkc
+ xsolid(2) = fkc
+ if(masgut.gt.epzero) then
+ xsolid(1) = mfgout / masgut
+ xsolid(2) = mkgout / masgut
+ endif
+ xsolid(1) = min(1.d0,max(0.d0,xsolid(1)))
+ xsolid(2) = min(1.d0,max(0.d0,xsolid(2)))
+
+ call futhp2 &
+ !==========
+ ( mode , h2 , xsolid , tparop(ifac) )
+
+ x2h2 = x2h2 + rtpa(iel,isca(iyfol(icla)))*h2
+
+ enddo
+
+ do ige = 1,ngaze
+ coefe(ige) = propce(iel,ipproc(iym1(ige)))
+ enddo
+ call futhp1 &
+ !==========
+ ( mode , hf , coefe , tparop(ifac) )
+ hparop(ifac) = (1.d0-x2t)*hf+x2h2
+
+! ---- Module Electrique
+
+
+ else if ( ippmod(ieljou).ge.1 ) then
+
+ call usthht (mode,hparop(ifac),tparop(ifac))
+
+ else if ( ippmod(ielarc).ge.1 ) then
+
+ if ( ngazg .eq. 1 ) then
+ ym(1) = 1.d0
+ call elthht(mode,ngazg,ym,hparop(ifac),tparop(ifac))
+ else
+ ym(ngazg) = 1.d0
+ do iesp = 1, ngazg-1
+ ym(iesp) = rtp(iel,isca(iycoel(iesp)))
+ ym(ngazg) = ym(ngazg) - ym(iesp)
+ enddo
+ call elthht(mode,ngazg,ym,hparop(ifac),tparop(ifac))
+ endif
+
+! ELSE IF ( IPPMOD(IELION).GE.1 ) THEN
+! ... to be implemented ...
+
+ endif
+
+ endif
+
+ enddo
+
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/pptbht.f90 b/src/pprt/pptbht.f90
new file mode 100644
index 0000000..701c33f
--- /dev/null
+++ b/src/pprt/pptbht.f90
@@ -0,0 +1,261 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine pptbht &
+!================
+
+ ( ncoel , &
+ nomcoe , ehcoel , cpcoel , wmolce )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! PHYSIQUES PARTICULIERES
+
+! CALCUL DE L'ENTHALPIE ET DU CP
+! A PARTIR DE LA BANDE DE JANAF
+
+
+! Arguments
+!_______________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!_______________!____!_____!________________________________________________!
+! ncoel ! e ! <-- ! nombre de const. elem. !
+! nomcoe(ngazem)! a ! <-- ! nom des constituants elementaires !
+! ehcoel ! tr ! <- ! enthalpie pour chaque constituant !
+! (ngazem,npot) ! ! ! elementaire !
+! cpcoel(ngazem)! tr ! <- ! cp pour chaque constituant !
+! wmolce(ngazem)! tr ! <- ! masse molaire de chaque constituant !
+!_______________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstphy.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer ncoel
+
+character*12 nomcoe(ngazem)
+
+double precision ehcoel(ngazem,npot) , cpcoel(ngazem)
+double precision wmolce (ngazem)
+
+! VARIABLES LOCALES
+
+character*40 dummy
+character*12 nomesp
+
+integer ind , iches , indtp , inicff , injcff
+integer ne , nt , nc , iok
+integer icoeff(ngazem)
+
+double precision cth , ctc
+
+double precision tlim(3) , wcoeff(2,7) , coeff(ngazem,2,7)
+
+!===============================================================================
+
+
+!===============================================================================
+! 2. LECTURE DU FICHIER DE DONNEES THERMODYNAMIQUES TABLE DE JANAF
+!===============================================================================
+
+! Initialisation
+
+
+do iches= 1, 12
+ NOMESP(ICHES:ICHES)=' '
+enddo
+
+do ne = 1 , ngazem
+ icoeff(ne) = 0
+ do inicff = 1, 2
+ do injcff = 1, 7
+ coeff(ne,inicff,injcff) = 0.d0
+ enddo
+ enddo
+enddo
+
+do ne = 1 , ncoel
+ cpcoel(ne)= 0.d0
+ do nt = 1, npo
+ ehcoel(ne,nt)= 0.d0
+ enddo
+enddo
+
+OPEN(UNIT=IMPJNF, FILE='JANAF', STATUS='OLD' , FORM='FORMATTED')
+
+READ (IMPJNF,'(A)') DUMMY
+
+! Lecture des domaines de temperature
+
+read (impjnf,*) (tlim(indtp) , indtp=1,3)
+
+! Boucle de lecture des especes chimiques avec stockage partiel
+
+ 5 continue
+
+READ (IMPJNF,'(A12,6X,A6)') NOMESP,DUMMY
+
+IF (NOMESP(1:3).EQ.'END') GOTO 100
+
+read (impjnf,*) (wcoeff(1,injcff), injcff=1,5)
+read (impjnf,*) (wcoeff(1,injcff), injcff=6,7), &
+ (wcoeff(2,injcff), injcff=1,3)
+read (impjnf,*) (wcoeff(2,injcff), injcff=4,7)
+
+! On ne stocke les coefficients que si
+! l'espece consideree fait partie de l'exemple
+
+do ne = 1, ncoel
+ if ( nomcoe(ne).eq.nomesp ) then
+ icoeff(ne) = 1
+ do inicff = 1, 2
+ do injcff = 1, 7
+ coeff(ne,inicff,injcff) = wcoeff(inicff,injcff)
+ enddo
+ enddo
+ endif
+enddo
+
+goto 5
+
+ 100 continue
+
+! Arret de la lecture si tous les renseignements necessaires ont ete
+! enregistres
+
+close(impjnf)
+
+! Test et stop eventuel
+
+iok = 0
+do ne = 1, ncoel
+ if(icoeff(ne).eq.0) then
+ iok = iok + 1
+ write(nfecra,1000) nomcoe(ne)
+ endif
+enddo
+if(iok.ne.0) then
+ write(nfecra,1100) iok
+ call csexit (1)
+ !==========
+endif
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PHYSIQUE PARTICULIERE ',/,&
+'@ ========= ',/,&
+'@ L''ESPECE ',A12 ,' EST INCONNUE DANS JANAF ',/,&
+'@ ',/,&
+'@ ' )
+ 1100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ',/,&
+'@ ',/,&
+'@ LE FICHIER PARAMETRIQUE FAIT REFERENCE A ',I10 ,/,&
+'@ ESPECE(S) INCONNUE(S) DANS JANAF (data/thch). ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier parametrique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!======================================================================================
+! 3. CALCUL DES ENTHALPIES ET DES CP
+!======================================================================================
+
+! Constante des gaz parfaits en J/mol/K
+
+do nt = 1,npo
+
+! Determination du jeu de coefficients utilises
+
+ if (th(nt) .gt. tlim(2)) then
+ ind = 1
+ else
+ ind = 2
+ endif
+
+ do ne = 1, ncoel
+ ehcoel(ne,nt) = coeff(ne,ind,6) + coeff(ne,ind,1) * th(nt)
+ cpcoel(ne) = coeff(ne,ind,1)
+ cth = th(nt)
+ ctc = 1.d0
+
+! Dans la table de Janaf, les COEFF sont adimensionnels (CP/R,H/R)
+
+ do nc = 2, 5
+ cth = cth * th(nt)
+ ctc = ctc * th(nt)
+ ehcoel(ne,nt) = ehcoel(ne,nt) &
+ + coeff(ne,ind,nc) * cth / dble(nc)
+ cpcoel(ne) = cpcoel(ne) + coeff(ne,ind,nc) * ctc
+ enddo
+
+! Calcul du CP et du H pour chaque espece
+
+ ehcoel(ne,nt) = ehcoel(ne,nt) * rr / wmolce(ne)
+ cpcoel(ne) = cpcoel(ne) * rr / wmolce(ne)
+ enddo
+
+enddo
+
+return
+
+end
diff --git a/src/pprt/pptssc.f90 b/src/pprt/pptssc.f90
new file mode 100644
index 0000000..5f99848
--- /dev/null
+++ b/src/pprt/pptssc.f90
@@ -0,0 +1,450 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine pptssc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , tslagr , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE
+! ON PRECISE LES TERMES SOURCES POUR UN SCALAIRE PP
+! SUR UN PAS DE TEMPS
+
+! ATTENTION : LE TRAITEMENT DES TERMES SOURCES EST DIFFERENT
+! --------- DE CELUI DE USTSSC.F
+
+! ON RESOUT ROVSDT*D(VAR) = SMBRS
+
+! ROVSDT ET SMBRS CONTIENNENT DEJA D'EVENTUELS TERMES SOURCES
+! UTILISATEUR. IL FAUT DONC LES INCREMENTER ET PAS LES
+! ECRASER
+
+! POUR DES QUESTIONS DE STABILITE, ON NE RAJOUTE DANS ROVSDT
+! QUE DES TERMES POSITIFS. IL N'Y A PAS DE CONTRAINTE POUR
+! SMBRS
+
+! DANS LE CAS D'UN TERME SOURCE EN CEXP + CIMP*VAR ON DOIT
+! ECRIRE :
+! SMBRS = SMBRS + CEXP + CIMP*VAR
+! ROVSDT = ROVSDT + MAX(-CIMP,ZERO)
+
+! ON FOURNIT ICI ROVSDT ET SMBRS (ILS CONTIENNENT RHO*VOLUME)
+! SMBRS en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! ROVSDT en kg /s
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smbrs(ncelet) ! tr ! --> ! second membre explicite !
+! rovsdt(ncelet ! tr ! --> ! partie diagonale implicite !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,*) ! ! ! lagrangien !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smbrs(ncelet), rovsdt(ncelet)
+double precision tslagr(ncelet,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+! 2. AIGUILLAGE VERS LE MODELE ADEQUAT
+!===============================================================================
+
+! ---> Flamme de premelange : Modele EBU
+
+if ( ippmod(icoebu).ge.0 ) then
+ call ebutss &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+endif
+
+
+! ---> Flamme de premelange : Modele BML
+
+! IF ( IPPMOD(ICOBML).GE.0 )
+! CALL BMLTSS
+
+! ---> Flamme de premelange : Modele LWC
+
+if ( ippmod(icolwc).ge.0 ) then
+ call lwctss &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Flamme charbon pulverise
+
+if ( ippmod(icp3pl).ge.0 ) then
+ call cptssc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iitypf) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Flamme charbon pulverise couplee Transport Lagrangien
+! des particules de charbon
+
+if ( ippmod(icpl3c).ge.0 .and. iilagr.eq.2 ) then
+ call cpltss &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iitypf) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , tslagr , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Flamme fuel
+
+if ( ippmod(icfuel).ge.0 ) then
+ call futssc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iitypf) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Versions electriques :
+! Effet Joule
+! Arc Electrique
+! Conduction ionique
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+ call eltssc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iitypf) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+endif
+
+! ---> Version aerorefrigerant :
+
+if ( ippmod(iaeros).ge.0 ) then
+ call cttssc &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , ia(iitypf) , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ ia(iizfpp) , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smbrs , rovsdt , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+endif
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/pprt/pptycl.f90 b/src/pprt/pptycl.f90
new file mode 100644
index 0000000..c056993
--- /dev/null
+++ b/src/pprt/pptycl.f90
@@ -0,0 +1,538 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine pptycl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CONDITIONS AUX LIMITES AUTOMATIQUES
+
+! AIGUILLAGE SPECIFIQUE AUX PHYSIQUES PARTICULIERES
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+! Arguments
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "atincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iok, ifvu, ii, izone, izonem
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+! 2. LISTE DES ZONES (pour n'importe quel modele)
+!===============================================================================
+
+! --> Faces appartiennent toutes a une zone frontiere
+
+iok = 0
+
+do ifac = 1, nfabor
+ if(izfppp(ifac).le.0.or.izfppp(ifac).gt.nozppm) then
+ iok = iok + 1
+ write(nfecra,1000)ifac,nozppm,izfppp(ifac)
+ endif
+enddo
+
+if(iok.gt.0) then
+ call csexit (1)
+ !==========
+endif
+
+! --> On construit une liste des numeros des zones frontieres.
+! (liste locale au processeur, en parallele)
+nzfppp = 0
+do ifac = 1, nfabor
+ ifvu = 0
+ do ii = 1, nzfppp
+ if (ilzppp(ii).eq.izfppp(ifac)) then
+ ifvu = 1
+ endif
+ enddo
+ if(ifvu.eq.0) then
+ nzfppp = nzfppp + 1
+ if(nzfppp.le.nbzppm) then
+ ilzppp(nzfppp) = izfppp(ifac)
+ else
+ write(nfecra,1001) nbzppm
+ write(nfecra,1002)(ilzppp(ii),ii=1,nbzppm)
+ call csexit (1)
+ !==========
+ endif
+ endif
+enddo
+
+! ---> Plus grand numero de zone
+
+izonem = 0
+do ii = 1, nzfppp
+ izone = ilzppp(ii)
+ izonem = max(izonem,izone)
+enddo
+if(irangp.ge.0) then
+ call parcmx(izonem)
+ !==========
+endif
+nozapm = izonem
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PHYSIQUE PARTICULIERE ',/,&
+'@ ========= ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT INCOMPLETES OU ERRONEES ',/,&
+'@ ',/,&
+'@ Le numero de zone associee a la face ',I10 ,' doit etre ',/,&
+'@ un entier strictement positif et inferieur ou egal a ',/,&
+'@ NOZPPM = ',I10 ,/,&
+'@ Ce numero (IZFPPP(IFAC)) vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PHYSIQUE PARTICULIERE ',/,&
+'@ ========= ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le nombre maximal de zones frontieres qui peuvent etre ',/,&
+'@ definies par l''utilisateur est NBZPPM = ',I10 ,/,&
+'@ Il a ete depasse. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites. ',/,&
+'@ ',/,&
+'@ Les NBZPPM premieres zones frontieres ',/,&
+'@ portent ici les numeros suivants : ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1002 format(i10)
+
+
+
+!===============================================================================
+! 5. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR TOUTES LES FACES D'ENTREE
+! =========================
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LES CONDITIONS AUX LIMITES
+! POUR LES SCALAIRES
+! (selon le modele)
+!===============================================================================
+
+
+! ---> Chimie 3 points : USD3PC
+
+if ( ippmod(icod3p).ge.0 ) then
+
+ call d3ptcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+! ---> Combustion gaz USEBUC
+! Flamme de premelange modele EBU
+
+elseif ( ippmod(icoebu).ge.0 ) then
+
+ call ebutcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+! ---> Combustion gaz USLWCC
+! Flamme de premelange modele LWC
+
+elseif ( ippmod(icolwc).ge.0 ) then
+
+ call lwctcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+! ---> Combustion charbon pulverise USCPCL
+
+elseif ( ippmod(icp3pl).ge.0 ) then
+
+ call cpptcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+! ---> Combustion charbon pulverise couple Lagrangien USCPLC
+
+elseif ( ippmod(icpl3c).ge.0 ) then
+
+ call cpltcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+! ---> Combustion fuel USFUCL
+
+elseif ( ippmod(icfuel).ge.0 ) then
+
+ call fuptcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+! ---> Compressible USCFCL
+
+elseif ( ippmod(icompf).ge.0 ) then
+
+ call cfxtcl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+! ---> Ecoulements atmospheriques
+
+elseif ( ippmod(iatmos).ge.0 ) then
+
+ call attycl &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbmetd , nbmett , nbmetm , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , iprofm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ ra(itmmet) , ra(iztmet) , ra(izdmet) , &
+ ra(ixmet) , ra(iymet) , ra(ipmer) , &
+ ra(ittmet) , ra(iqvmet) , ra(iumet) , &
+ ra(ivmet) , ra(iekmet) , ra(iepmet) , &
+ ra(irmet) , ra(itpmet) , ra(iphmet) , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+endif
+!----
+! FORMATS
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/src/pprt/ppvarp.f90 b/src/pprt/ppvarp.f90
new file mode 100644
index 0000000..0014397
--- /dev/null
+++ b/src/pprt/ppvarp.f90
@@ -0,0 +1,140 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ppvarp
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES POSITIONS DES VARIABLES SELON
+! LE TYPE DE PHYSIQUE PARTICULIERE
+! REMPLISSAGE DES PARAMETRES (DEJA DEFINIS) POUR LES SCALAIRES PP
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "elincl.h"
+include "atincl.h"
+
+!===============================================================================
+
+
+!===============================================================================
+
+! ---> Physique particuliere : Combustion Gaz
+
+if ( ippmod(icod3p).ge.0 .or. ippmod(icoebu).ge.0 &
+ .or. ippmod(icolwc).ge.0 ) then
+ call covarp
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Charbon Pulverise
+
+if ( ippmod(icp3pl).ge.0 ) then
+ call cpvarp
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Charbon Pulverise
+! Couplee Transport Lagrangien des particules de charbon
+
+if ( ippmod(icpl3c).ge.0 ) then
+ call cplvar
+ !==========
+endif
+
+! ---> Physique particuliere : Combustion Fuel
+
+if ( ippmod(icfuel).ge.0 ) then
+ call fuvarp
+ !==========
+endif
+
+! ---> Physique particuliere : Compressible
+
+if ( ippmod(icompf).ge.0) then
+ call cfvarp
+ !==========
+endif
+
+! ---> Physique particuliere : Versions Electriques
+
+if ( ippmod(ieljou).ge.1 .or. &
+ ippmod(ielarc).ge.1 .or. &
+ ippmod(ielion).ge.1 ) then
+ call elvarp
+ !==========
+endif
+
+! ---> Physique particuliere : Version Atmospherique
+
+if ( ippmod(iatmos).ge.1 ) then
+ call atvarp
+ !==========
+endif
+
+! ---> Physique particuliere : Aerorefrigerants
+
+if ( ippmod(iaeros).ge.0 ) then
+ call ctvarp
+ !==========
+endif
+
+return
+end
diff --git a/src/rayt/Makefile.am b/src/rayt/Makefile.am
new file mode 100644
index 0000000..11a6461
--- /dev/null
+++ b/src/rayt/Makefile.am
@@ -0,0 +1,76 @@
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/rayt/radiat.h
+
+# Library source files
+
+noinst_LTLIBRARIES = libcsrayt.la
+libcsrayt_la_SOURCES = \
+memra1.f90 \
+memra2.f90 \
+memra3.f90 \
+raycli.f90 \
+raydak.f90 \
+raydir.f90 \
+raydom.f90 \
+raylec.f90 \
+rayopt.f90 \
+rayout.f90 \
+raypar.f90 \
+raypun.f90 \
+raysca.f90 \
+raysol.f90 \
+rmodak.f90
+libcsrayt_la_LDFLAGS = -no-undefined
+
+libcsrayt_la_SOURCES += \
+$(top_srcdir)/users/rayt/usray1.f90 \
+$(top_srcdir)/users/rayt/usray2.f90 \
+$(top_srcdir)/users/rayt/usray3.f90 \
+$(top_srcdir)/users/rayt/usray4.f90 \
+$(top_srcdir)/users/rayt/usray5.f90
+
+raytdir = $(pkgdatadir)/users/rayt
+rayt_DATA = \
+$(top_srcdir)/users/rayt/usray1.f90 \
+$(top_srcdir)/users/rayt/usray2.f90 \
+$(top_srcdir)/users/rayt/usray3.f90 \
+$(top_srcdir)/users/rayt/usray4.f90 \
+$(top_srcdir)/users/rayt/usray5.f90
diff --git a/src/rayt/Makefile.in b/src/rayt/Makefile.in
new file mode 100644
index 0000000..c9cd4d7
--- /dev/null
+++ b/src/rayt/Makefile.in
@@ -0,0 +1,641 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#------------------------------------------------------------------------------
+# This file is part of the Code_Saturne Kernel, element of the
+# Code_Saturne CFD tool.
+#
+# Copyright (C) 2009 EDF S.A., France
+#
+# The Code_Saturne Kernel 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.
+#
+# The Code_Saturne Kernel 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 Licence
+# along with the Code_Saturne Kernel; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-------------------------------------------------------------------------------
+
+# Main part
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/rayt
+DIST_COMMON = $(saturneinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/cs_bft.m4 \
+ $(top_srcdir)/config/cs_blas.m4 \
+ $(top_srcdir)/config/cs_config_info.m4 \
+ $(top_srcdir)/config/cs_fvm.m4 \
+ $(top_srcdir)/config/cs_libxml2.m4 \
+ $(top_srcdir)/config/cs_mei.m4 $(top_srcdir)/config/cs_mpi.m4 \
+ $(top_srcdir)/config/cs_syrthes.m4 \
+ $(top_srcdir)/config/gettext.m4 $(top_srcdir)/config/iconv.m4 \
+ $(top_srcdir)/config/lib-ld.m4 \
+ $(top_srcdir)/config/lib-link.m4 \
+ $(top_srcdir)/config/lib-prefix.m4 $(top_srcdir)/config/nls.m4 \
+ $(top_srcdir)/config/po.m4 $(top_srcdir)/config/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/cs_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcsrayt_la_LIBADD =
+am_libcsrayt_la_OBJECTS = memra1.lo memra2.lo memra3.lo raycli.lo \
+ raydak.lo raydir.lo raydom.lo raylec.lo rayopt.lo rayout.lo \
+ raypar.lo raypun.lo raysca.lo raysol.lo rmodak.lo usray1.lo \
+ usray2.lo usray3.lo usray4.lo usray5.lo
+libcsrayt_la_OBJECTS = $(am_libcsrayt_la_OBJECTS)
+libcsrayt_la_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+ $(libcsrayt_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
+ $@
+SOURCES = $(libcsrayt_la_SOURCES)
+DIST_SOURCES = $(libcsrayt_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(raytdir)" \
+ "$(DESTDIR)$(saturneincludedir)"
+raytDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(rayt_DATA)
+saturneincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(saturneinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFT_CPPFLAGS = @BFT_CPPFLAGS@
+BFT_LDFLAGS = @BFT_LDFLAGS@
+BFT_LIBS = @BFT_LIBS@
+BLAS_CPPFLAGS = @BLAS_CPPFLAGS@
+BLAS_LDFLAGS = @BLAS_LDFLAGS@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_DBG = @CFLAGS_DBG@
+CFLAGS_EXT = @CFLAGS_EXT@
+CFLAGS_HOT = @CFLAGS_HOT@
+CFLAGS_OPT = @CFLAGS_OPT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_DBG = @FCFLAGS_DBG@
+FCFLAGS_HOT = @FCFLAGS_HOT@
+FCFLAGS_OPT = @FCFLAGS_OPT@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+FVM_CPPFLAGS = @FVM_CPPFLAGS@
+FVM_LDFLAGS = @FVM_LDFLAGS@
+FVM_LIBS = @FVM_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LDRPATH = @LDRPATH@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBXML2_CPPFLAGS = @LIBXML2_CPPFLAGS@
+LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MEI_CPPFLAGS = @MEI_CPPFLAGS@
+MEI_LDFLAGS = @MEI_LDFLAGS@
+MEI_LIBS = @MEI_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_BIN = @MPI_BIN@
+MPI_CPPFLAGS = @MPI_CPPFLAGS@
+MPI_LDFLAGS = @MPI_LDFLAGS@
+MPI_LIBS = @MPI_LIBS@
+MPI_TYPE = @MPI_TYPE@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+PYEXE = @PYEXE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYRTHES_CC = @SYRTHES_CC@
+SYRTHES_CFLAGS = @SYRTHES_CFLAGS@
+SYRTHES_CPPFLAGS = @SYRTHES_CPPFLAGS@
+SYRTHES_FC = @SYRTHES_FC@
+SYRTHES_FCFLAGS = @SYRTHES_FCFLAGS@
+SYRTHES_FCLIBS = @SYRTHES_FCLIBS@
+SYRTHES_LDFLAGS = @SYRTHES_LDFLAGS@
+SYRTHES_LIBS = @SYRTHES_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_aux_dir = @ac_aux_dir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cs_python = @cs_python@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+ecs_prefix = @ecs_prefix@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mei_libdir = @mei_libdir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+syrthes_prefix = @syrthes_prefix@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_FCFLAGS = \
+-I$(top_srcdir)/include/base \
+-I$(top_srcdir)/include/pprt \
+-I$(top_srcdir)/include/cplv \
+-I$(top_srcdir)/include/fuel \
+-I$(top_srcdir)/include/lagr \
+-I$(top_srcdir)/include/rayt \
+ at FCFLAGS_DBG@ @FCFLAGS_OPT@
+
+AM_LDFLAGS =
+
+# Public header files (to be installed)
+saturneincludedir = $(includedir)
+saturneinclude_HEADERS = \
+$(top_srcdir)/include/rayt/radiat.h
+
+
+# Library source files
+noinst_LTLIBRARIES = libcsrayt.la
+libcsrayt_la_SOURCES = memra1.f90 memra2.f90 memra3.f90 raycli.f90 \
+ raydak.f90 raydir.f90 raydom.f90 raylec.f90 rayopt.f90 \
+ rayout.f90 raypar.f90 raypun.f90 raysca.f90 raysol.f90 \
+ rmodak.f90 $(top_srcdir)/users/rayt/usray1.f90 \
+ $(top_srcdir)/users/rayt/usray2.f90 \
+ $(top_srcdir)/users/rayt/usray3.f90 \
+ $(top_srcdir)/users/rayt/usray4.f90 \
+ $(top_srcdir)/users/rayt/usray5.f90
+libcsrayt_la_LDFLAGS = -no-undefined
+raytdir = $(pkgdatadir)/users/rayt
+rayt_DATA = \
+$(top_srcdir)/users/rayt/usray1.f90 \
+$(top_srcdir)/users/rayt/usray2.f90 \
+$(top_srcdir)/users/rayt/usray3.f90 \
+$(top_srcdir)/users/rayt/usray4.f90 \
+$(top_srcdir)/users/rayt/usray5.f90
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/rayt/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/rayt/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libcsrayt.la: $(libcsrayt_la_OBJECTS) $(libcsrayt_la_DEPENDENCIES)
+ $(libcsrayt_la_LINK) $(libcsrayt_la_OBJECTS) $(libcsrayt_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.f90.o:
+ $(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+ $(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+ $(LTFCCOMPILE) -c -o $@ $<
+
+usray1.lo: $(top_srcdir)/users/rayt/usray1.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usray1.lo `test -f '$(top_srcdir)/users/rayt/usray1.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/rayt/usray1.f90
+
+usray2.lo: $(top_srcdir)/users/rayt/usray2.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usray2.lo `test -f '$(top_srcdir)/users/rayt/usray2.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/rayt/usray2.f90
+
+usray3.lo: $(top_srcdir)/users/rayt/usray3.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usray3.lo `test -f '$(top_srcdir)/users/rayt/usray3.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/rayt/usray3.f90
+
+usray4.lo: $(top_srcdir)/users/rayt/usray4.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usray4.lo `test -f '$(top_srcdir)/users/rayt/usray4.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/rayt/usray4.f90
+
+usray5.lo: $(top_srcdir)/users/rayt/usray5.f90
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o usray5.lo `test -f '$(top_srcdir)/users/rayt/usray5.f90' || echo '$(srcdir)/'`$(top_srcdir)/users/rayt/usray5.f90
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-raytDATA: $(rayt_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(raytdir)" || $(MKDIR_P) "$(DESTDIR)$(raytdir)"
+ @list='$(rayt_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(raytDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(raytdir)/$$f'"; \
+ $(raytDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(raytdir)/$$f"; \
+ done
+
+uninstall-raytDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(rayt_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(raytdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(raytdir)/$$f"; \
+ done
+install-saturneincludeHEADERS: $(saturneinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(saturneincludedir)" || $(MKDIR_P) "$(DESTDIR)$(saturneincludedir)"
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(saturneincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ $(saturneincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+uninstall-saturneincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(saturneinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(saturneincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(saturneincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(raytdir)" "$(DESTDIR)$(saturneincludedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-raytDATA install-saturneincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-raytDATA uninstall-saturneincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-raytDATA install-saturneincludeHEADERS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-raytDATA \
+ uninstall-saturneincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/rayt/memra1.f90 b/src/rayt/memra1.f90
new file mode 100644
index 0000000..2411386
--- /dev/null
+++ b/src/rayt/memra1.f90
@@ -0,0 +1,117 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memra1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nvar , nscal , nphas , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! GESTION MEMOIRE DES VARIABLES LIEES AU RAYONNEMENT
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "numvar.h"
+include "optcal.h"
+include "ppppar.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nvar , nscal , nphas
+integer ifinia , ifinra
+
+! VARIALBES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!--> NOMBRE DE PHASES POUR LESQUELLES ON FAIT DU RAYONNEMENT
+
+iizfrd = idebia
+ifinia = iizfrd + nfabor
+
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMRA1',IFINIA)
+! ==========
+
+return
+end
diff --git a/src/rayt/memra2.f90 b/src/rayt/memra2.f90
new file mode 100644
index 0000000..07e5c01
--- /dev/null
+++ b/src/rayt/memra2.f90
@@ -0,0 +1,187 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memra2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtr , iviscf , iviscb , idam , ixam , &
+ idrtp , ismbr , irovsd , &
+
+ icorua , icorub , iflxma , iflxmb , itek , &
+
+ iw1 , iw2 , iw3 , iw4 , iw5 , iw6 , iw7 , &
+ iw8 , iw9 , iw10 , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! GESTION MEMOIRE POUR LE CALCUL DES TERMES SOURCES RADIATIFS
+! ET DU FLUX INCIDENT RADIATIF PARIETAL (RAYDOM)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idtr ! e ! --> ! "pointeur" sur dtr !
+! iviscf, b ! e ! --> ! "pointeur" sur viscf, viscb !
+! idam, ixam ! e ! --> ! "pointeur" sur dam, xam !
+! idrtp ! e ! --> ! "pointeur" sur drtp !
+! ismbr ! e ! --> ! "pointeur" sur smbr !
+! irovsd ! e ! --> ! "pointeur" sur rovsdt !
+! icorua,icorub ! e ! --> ! "pointeur" sur cofrua et cofrub !
+! iflxma,iflxmb ! e ! --> ! "pointeur" sur flumas et flumab !
+! itek ! e ! --> ! "pointeur" sur tempk !
+! iw1,2,...,11 ! e ! --> ! "pointeur" sur w1 a w10 !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "numvar.h"
+include "optcal.h"
+include "ppppar.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idtr
+integer iviscf , iviscb , idam , ixam
+integer idrtp , ismbr , irovsd
+integer iw1 , iw2 , iw3 , iw4 , iw5 , iw6
+integer iw7 , iw8 , iw9 , iw10
+integer ifinia , ifinra
+
+integer icorua , icorub
+integer iflxma , iflxmb
+integer itek
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+!===============================================================================
+!---> INITIALISATION
+!===============================================================================
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+!===============================================================================
+
+idtr = idebra
+iviscf = idtr + ncelet
+iviscb = iviscf + nfac
+idam = iviscb + nfabor
+ixam = idam + ncelet
+idrtp = ixam + nfac*2
+ismbr = idrtp + ncelet
+irovsd = ismbr + ncelet
+iw1 = irovsd + ncelet
+iw2 = iw1 + ncelet
+iw3 = iw2 + ncelet
+iw4 = iw3 + ncelet
+iw5 = iw4 + ncelet
+iw6 = iw5 + ncelet
+iw7 = iw6 + ncelet
+iw8 = iw7 + ncelet
+iw9 = iw8 + ncelet
+iw10 = iw9 + ncelet
+itek = iw10 + ncelet
+ifinra = itek + ncelet * nphasc
+
+icorua = ifinra
+icorub = icorua + nfabor
+iflxma = icorub + nfabor
+iflxmb = iflxma + nfac
+ifinra = iflxmb + nfabor
+
+!===============================================================================
+!---> VERIFICATION
+!===============================================================================
+
+CALL RASIZE('MEMRA2',IFINRA)
+!==========
+
+return
+
+end
diff --git a/src/rayt/memra3.f90 b/src/rayt/memra3.f90
new file mode 100644
index 0000000..7183e2b
--- /dev/null
+++ b/src/rayt/memra3.f90
@@ -0,0 +1,144 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine memra3 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iisoth , itek , itext , itint , &
+ ifinia , ifinra )
+
+!===============================================================================
+! FONCTION
+! --------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! GESTION MEMOIRE POUR LA RESOLUTION DES TEMPERATURES DE PAROI
+! (RAYCLI)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iisoth ! e ! --> ! "pointeur" sur isoth !
+! itext ! e ! --> ! "pointeur" sur text !
+! itint ! e ! --> ! "pointeur" sur tint !
+! itek ! e ! --> ! "pointeur" sur tempk !
+! ifinia ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+! ifinra ! e ! --> ! pointeur de la premiere cas libre dan !
+! ! ! ! dans ia en sortie !
+!__________________.____._____.________________________________________________.
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "numvar.h"
+include "optcal.h"
+include "ppppar.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+
+integer ifinia , ifinra
+
+integer iisoth , itext , itint , itek
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+!===============================================================================
+!---> INITIALISATION
+
+idebia = idbia0
+idebra = idbra0
+
+!---> PLACE MEMOIRE RESERVEE AVEC DEFINITION DE IFINIA IFINRA
+
+iisoth = idebia
+ifinia = iisoth + nfabor
+
+itek = idebra
+ifinra = itek + ncelet
+
+itint = ifinra
+itext = itint + nfabor
+ifinra = itext + nfabor
+
+!---> VERIFICATION
+
+CALL IASIZE('MEMRA3',IFINIA)
+!==========
+
+CALL RASIZE('MEMRA3',IFINRA)
+!==========
+
+return
+end
diff --git a/src/rayt/raycli.f90 b/src/rayt/raycli.f90
new file mode 100644
index 0000000..dfc7039
--- /dev/null
+++ b/src/rayt/raycli.f90
@@ -0,0 +1,1351 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raycli &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , isvhb , isvtb , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ izfrad , isothm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefa , coefb , hbord , tbord , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ text , tint , tempk , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! 1) Calcul des temperatures de paroi
+! 2) Mise a jours des conditions aux limites de la variable
+! energetique
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! isvhb ! e ! <-- ! indicateur de sauvegarde des !
+! ! ! ! coefficients d'echange aux bords !
+! isvtb ! e ! <-- ! indicateur de sauvegarde des !
+! ! ! ! temperatures aux bords !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfrad(nfabor ! te ! <-- ! numero de zone des faces de bord !
+! isothm(nfabor ! te ! <-- ! type de condition de paroi !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! hbord ! tr ! --> ! coefficients d'echange aux bords !
+! (nfabor) ! ! ! !
+! tbord ! tr ! --> ! temperature aux bords i !
+! (nfabor) ! ! ! !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! text (nfabor ! tr ! --> ! temperature de bord externe !
+! tint (nfabor ! tr ! --> ! temperature de bord interne !
+! tempk(ncelet) ! tr ! --> ! temperature en kelvin !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "parall.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer isvhb , isvtb
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer idevel(nideve), ituser(nituse), ia(*)
+integer izfrad(nfabor),isothm(nfabor)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision hbord(nfabor),tbord(nfabor)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+
+double precision tempk(ncelet)
+double precision text(nfabor), tint(nfabor)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ideb, ivart, iscat
+integer mode, iok, ifvu, ii, izonem, izone
+integer maxelt, idbia1, ils
+
+double precision tmin , tmax , tx
+double precision cpp, xmtk
+
+integer ipacli
+data ipacli /0/
+save ipacli
+
+!===============================================================================
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+maxelt = max(ncelet,nfac,nfabor)
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+!---> NUMERO DE PASSAGE RELATIF
+
+ipacli = ipacli + 1
+ideb = 0
+
+!---> VALEURS MIN ET MAX ADMISSIBLES POUR LA TEMPERATURE DE PAROI
+! EN KELVIN
+
+tmin = 0.d0
+tmax = grand + tkelvi
+
+!---> COEFF DE RELAX
+
+! TX est strictement superieur a 0 et inferieur ou egal a 1
+
+! Pour calculer la temperature de paroi, on calcule un increment
+! de temperature DeltaT entre l'etape courante n et l'etape
+! precedente n-1, puis on calcule :
+! n n-1 n-1
+! T = T + DeltaT si le rapport DeltaT/T =< TX, sinon
+
+! n n-1 n-1 n-1
+! T = T * (1 + TX *((DeltaT/T ) / |DeltaT/T |))
+
+tx = 0.1d0
+
+
+!---> INITIALISATIONS PAR DEFAUT BIDON
+
+do ifac = 1,nfabor
+ izfrad(ifac) = -1
+ isothm(ifac) = -1
+ propfb(ifac,ipprob(ixlam)) = -grand
+ propfb(ifac,ipprob(iepa)) = -grand
+ propfb(ifac,ipprob(ieps)) = -grand
+ text (ifac) = -grand
+ tint (ifac) = -grand
+enddo
+
+
+!===============================================================================
+! 2. SI PAS DE FICHIER SUITE ALORS INITIALISATION AU PREMIER PASSAGE
+! DE TPAROI ET QINCID :
+! LECTURE DE L'INITIALISATION DE TPAROI A TINT
+! QINCID EST INITIALISE A STEPHN*TINT**4 (SI ON INITIALISE QINCID
+! A ZERO, ON AURA UN DEFICIT SUR LA CONDITION LIMITE DE LUMINANCE
+! AUX PAROIS AU 1er PAS DE TEMPS EN DOM)
+!===============================================================================
+
+if (ipacli.eq.1 .and. isuird.eq.0) then
+
+! Indicateur : si non suite et premier pas de temps.
+ ideb = 1
+
+ do iel = 1,ncelet
+ propce(iel,ipproc(itsri(1))) = zero
+ propce(iel,ipproc(itsre(1))) = zero
+ enddo
+
+ do ifac = 1,nfabor
+ propfb(ifac,ipprob(ihconv)) = zero
+ propfb(ifac,ipprob(ifconv)) = zero
+ enddo
+
+! On utilise TBORD comme auxiliaire pour l'appel a USRAY2
+! pour �tre sur que TPAROI ne sera pas modifi�
+! (puisqu'on a TBORD libre)
+! On utilise FLUNET comme auxiliaire pour l'appel a USRAY2
+! pour �tre sur que QINCID ne sera pas modifi�
+! (puisqu'on a FLUNET libre)
+
+ do ifac = 1,nfabor
+ tbord(ifac) = zero
+ propfb(ifac,ipprob(ifnet)) = zero
+ enddo
+
+! - Interface Code_Saturne
+! ======================
+
+ if (iihmpr.eq.1) then
+
+!---> NUMERO DU SCALAIRE ET DE LA VARIABLE THERMIQUE
+ ivart = isca(iscalt(irapha))
+
+ call uiray2 &
+ !==========
+ ( itypfb, iparoi, iparug, ivart , izfrad, &
+ isothm, itpimp, ipgrno, iprefl, ifgrno, ifrefl, &
+ nozppm, nfabor, nvar, &
+ propfb(1,ipprob(ieps)), propfb(1,ipprob(iepa)), &
+ tint, text, &
+ propfb(1,ipprob(ixlam)), rcodcl)
+
+ endif
+
+ ils = idebia
+ idbia1 = ils + maxelt
+ CALL IASIZE('RAYCLI',IDBIA1)
+
+ call usray2 &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , izfrad , isothm , &
+ tmin , tmax , tx , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , &
+ tbord , propfb(1,ipprob(ifnet)) , propfb(1,ipprob(ihconv)) ,&
+ propfb(1,ipprob(ifconv)), &
+ propfb(1,ipprob(ixlam)) , propfb(1,ipprob(iepa)) , &
+ propfb(1,ipprob(ieps)) , &
+ text , tint , &
+ ra )
+
+ write(nfecra,1000)
+
+! Tparoi en Kelvin et QINCID en W/m2
+ do ifac = 1,nfabor
+ propfb(ifac,ipprob(itparo)) = tint(ifac)
+ propfb(ifac,ipprob(iqinci)) = stephn*tint(ifac)**4
+ if ( itypfb(ifac,irapha).eq.iparoi .or. &
+ itypfb(ifac,irapha).eq.iparug ) then
+ propfb(ifac,ipprob(itparo)) = tint(ifac)
+ propfb(ifac,ipprob(iqinci)) = stephn*tint(ifac)**4
+ else
+ propfb(ifac,ipprob(itparo)) = 0.d0
+ propfb(ifac,ipprob(iqinci)) = 0.d0
+ endif
+ enddo
+
+! Fin d�tection premier passage
+endif
+
+!===============================================================================
+! 3. PHASE
+!===============================================================================
+
+!---> NUMERO DU SCALAIRE ET DE LA VARIABLE THERMIQUE
+ iscat = iscalt(irapha)
+ ivart = isca(iscalt(irapha))
+
+!===============================================================================
+! 3.1 DONNEES SUR LES FACES FRONTIERES
+!===============================================================================
+
+! On utilise TBORD comme auxiliaire pour l'appel a USRAY2
+! pour �tre sur que TPAROI ne sera pas modifi�
+! (puisqu'on a TBORD libre)
+! On utilise FLUNET comme auxiliaire pour l'appel a USRAY2
+! pour �tre sur que QINCID ne sera pas modifi�
+! (puisqu'on a FLUNET libre)
+
+ do ifac = 1,nfabor
+ tbord (ifac) = propfb(ifac,ipprob(itparo))
+ propfb(ifac,ipprob(ifnet)) = propfb(ifac,ipprob(iqinci))
+ enddo
+
+! - Interface Code_Saturne
+! ======================
+
+ if (iihmpr.eq.1) then
+
+ call uiray2 &
+ !==========
+ ( itypfb, iparoi, iparug, ivart , izfrad, &
+ isothm, itpimp, ipgrno, iprefl, ifgrno, ifrefl, &
+ nozppm, nfabor, nvar, &
+ propfb(1,ipprob(ieps)), propfb(1,ipprob(iepa)), tint, text, &
+ propfb(1,ipprob(ixlam)), rcodcl)
+
+ endif
+
+ ils = idebia
+ idbia1 = ils + maxelt
+ CALL iasize('raycli', idbia1)
+
+ call usray2 &
+ !==========
+ ( idbia1 , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ maxelt , ia(ils), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , izfrad , isothm , &
+ tmin , tmax , tx , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , &
+ tbord , propfb(1,ipprob(ifnet)) , propfb(1,ipprob(ifconv)) ,&
+ propfb(1,ipprob(ifconv)) , propfb(1,ipprob(ixlam)), &
+ propfb(1,ipprob(iepa)) , propfb(1,ipprob(ieps)) , &
+ text , tint , &
+ ra )
+
+!===============================================================================
+! 3.2 CONTROLE DES DONNEES UTILISATEUR
+!===============================================================================
+
+!--> Arret si le numero de zone est non renseigne ou mal renseigne
+
+ iok = 0
+
+ do ifac = 1, nfabor
+ if (izfrad(ifac).le.0.or.izfrad(ifac).gt.nozrdm) then
+ iok = iok + 1
+ write(nfecra,2000)ifac,nozrdm,izfrad(ifac)
+ endif
+ enddo
+
+ if(iok.ne.0) then
+ call csexit (1)
+ !==========
+ endif
+
+! --> On construit une liste des numeros des zones frontieres.
+! (liste locale au processeur, en parallele)
+! Stop si depassement.
+
+ nzfrad = 0
+ do ifac = 1, nfabor
+ ifvu = 0
+ do ii = 1, nzfrad
+ if (ilzrad(ii).eq.izfrad(ifac)) then
+ ifvu = 1
+ endif
+ enddo
+ if(ifvu.eq.0) then
+ nzfrad = nzfrad + 1
+ if(nzfrad.le.nbzrdm) then
+ ilzrad(nzfrad) = izfrad(ifac)
+ else
+ write(nfecra,2001) nbzrdm
+ write(nfecra,2002)(ilzrad(ii),ii=1,nbzrdm)
+ call csexit (1)
+ !==========
+ endif
+ endif
+ enddo
+
+! ---> Plus grand numero de zone atteint
+
+ izonem = 0
+ do ii = 1, nzfrad
+ izone = ilzrad(ii)
+ izonem = max(izonem,izone)
+ enddo
+ if(irangp.ge.0) then
+ call parcmx(izonem)
+ !==========
+ endif
+ nozarm = izonem
+
+
+
+
+! On verra si ca coute cher ou non.
+! Pour le moment on le fait tout le temps.
+! IF(IWARNI(IVART).GE.-1.OR.IPACLI.LE.3) THEN
+ if(1.eq.1) then
+
+ iok = 0
+
+!--> Si en paroi ISOTHM non renseignee : stop
+ do ifac = 1, nfabor
+ if( (itypfb(ifac,irapha).eq.iparoi .or. &
+ itypfb(ifac,irapha).eq.iparug) .and. &
+ isothm(ifac) .eq.-1 ) then
+ iok = iok + 1
+ write(nfecra,2110) irapha,ifac,izfrad(ifac)
+ endif
+ enddo
+
+!--> Si ISOTHM renseignee en non paroi : stop
+ do ifac = 1, nfabor
+ if( itypfb(ifac,irapha).ne.iparoi .and. &
+ itypfb(ifac,irapha).ne.iparug .and. &
+ isothm(ifac) .ne.-1 ) then
+ iok = iok + 1
+ write(nfecra,2111) &
+ irapha,ifac,izfrad(ifac),isothm(ifac)
+ endif
+ enddo
+
+!--> Si valeur physique erronee : stop
+ do ifac = 1, nfabor
+ if(isothm(ifac).eq.itpimp ) then
+ if(propfb(ifac,ipprob(ieps)) .lt.0.d0.or. &
+ propfb(ifac,ipprob(ieps)).gt.1.d0.or. &
+ tint(ifac).le.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2120) irapha,ifac,izfrad(ifac), &
+ propfb(ifac,ipprob(ieps)), &
+ tint(ifac)
+ endif
+ elseif(isothm(ifac).eq.ipgrno ) then
+ if(propfb(ifac,ipprob(ieps)) .lt.0.d0.or. &
+ propfb(ifac,ipprob(ieps)).gt.1.d0.or. &
+ propfb(ifac,ipprob(ixlam)).le.0.d0.or. &
+ propfb(ifac,ipprob(iepa)) .le.0.d0.or. &
+ text(ifac).le.0.d0.or. &
+ tint(ifac).le.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2130) irapha,ifac,izfrad(ifac), &
+ propfb(ifac,ipprob(ieps)) , &
+ propfb(ifac,ipprob(ixlam)), &
+ propfb(ifac,ipprob(iepa)) , &
+ text(ifac),tint(ifac)
+ endif
+ elseif(isothm(ifac).eq.iprefl ) then
+ if(propfb(ifac,ipprob(ixlam)).le.0.d0.or. &
+ propfb(ifac,ipprob(iepa)) .le.0.d0.or. &
+ text(ifac).le.0.d0.or. &
+ tint(ifac).le.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2140) irapha,ifac,izfrad(ifac), &
+ propfb(ifac,ipprob(ixlam)) , &
+ propfb(ifac,ipprob(iepa)) , &
+ text(ifac),tint(ifac)
+ endif
+ elseif(isothm(ifac).eq.ifgrno ) then
+ if(propfb(ifac,ipprob(ieps)).lt.0.d0.or. &
+ propfb(ifac,ipprob(ieps)).gt.1.d0.or. &
+ tint(ifac).le.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2150) irapha,ifac,izfrad(ifac), &
+ propfb(ifac,ipprob(ieps)), &
+ tint(ifac)
+ endif
+ elseif(isothm(ifac).eq.ifrefl ) then
+ if(tint(ifac).le.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2160) irapha,ifac,izfrad(ifac), &
+ tint(ifac)
+ endif
+ elseif(isothm(ifac).ne.-1) then
+ iok = iok + 1
+ write(nfecra,2170) irapha,ifac,izfrad(ifac), &
+ isothm(ifac)
+ endif
+ enddo
+
+!--> Si valeur renseignee sans raison : stop
+ do ifac = 1, nfabor
+ if(isothm(ifac).eq.itpimp ) then
+ if(propfb(ifac,ipprob(ixlam)).gt.0.d0.or. &
+ propfb(ifac,ipprob(iepa)) .gt.0.d0.or. &
+ text(ifac).gt.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2220) irapha,ifac,izfrad(ifac), &
+ propfb(ifac,ipprob(ixlam)), &
+ propfb(ifac,ipprob(iepa)) ,text(ifac)
+ endif
+ elseif(isothm(ifac).eq.iprefl ) then
+ if(propfb(ifac,ipprob(ieps)).ge.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2240) irapha,ifac,izfrad(ifac), &
+ propfb(ifac,ipprob(ieps))
+ endif
+ elseif(isothm(ifac).eq.ifgrno ) then
+ if(propfb(ifac,ipprob(ixlam)).gt.0.d0.or. &
+ propfb(ifac,ipprob(iepa)) .gt.0.d0.or. &
+ text(ifac).gt.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2250) irapha,ifac,izfrad(ifac), &
+ propfb(1,ipprob(ixlam)),propfb(1,ipprob(iepa)), &
+ text(ifac)
+ endif
+ elseif(isothm(ifac).eq.ifrefl ) then
+ if(propfb(ifac,ipprob(ieps)) .ge.0.d0.or. &
+ propfb(ifac,ipprob(ixlam)).gt.0.d0.or. &
+ propfb(ifac,ipprob(iepa)) .gt.0.d0.or. &
+ text(ifac).gt.0.d0 ) then
+ iok = iok + 1
+ write(nfecra,2260) irapha,ifac,izfrad(ifac), &
+ propfb(ifac,ipprob(ieps)) , &
+ propfb(ifac,ipprob(ixlam)), &
+ propfb(ifac,ipprob(iepa)) ,text(ifac)
+ endif
+ endif
+ enddo
+
+!--> Stop si erreur
+ if(iok.ne.0) then
+ call csexit (1)
+ !==========
+ endif
+
+ endif
+
+
+!===============================================================================
+! 3.2 COMPLETION DES DONNEES UTILISATEUR
+!===============================================================================
+
+! ICODCL et EPS (quand il est nul)
+
+ do ifac = 1, nfabor
+ if( isothm(ifac).eq.itpimp ) then
+ icodcl(ifac,ivart) = 5
+ elseif(isothm(ifac).eq.ipgrno ) then
+ icodcl(ifac,ivart) = 5
+ elseif(isothm(ifac).eq.iprefl ) then
+ icodcl(ifac,ivart) = 5
+ propfb(ifac,ipprob(ieps)) = 0.d0
+ elseif(isothm(ifac).eq.ifgrno ) then
+ icodcl(ifac,ivart) = 5
+ elseif(isothm(ifac).eq.ifrefl ) then
+ icodcl(ifac,ivart) = 3
+ propfb(ifac,ipprob(ieps)) = 0.d0
+ endif
+ enddo
+
+
+!===============================================================================
+! 4. STOCKAGE DE LA TEMPERATURE (en Kelvin) dans TEMPK(IEL)
+!===============================================================================
+
+ if (abs(iscsth(iscat)).eq.1) then
+
+!---> ON REMPLIT TEMPK
+
+ if (iscsth(iscat).eq.-1) then
+ do iel = 1, ncel
+ tempk(iel) = rtpa(iel,ivart) + tkelvi
+ enddo
+ else
+ do iel = 1, ncel
+ tempk(iel) = rtpa(iel,ivart)
+ enddo
+ endif
+
+ else if (iscsth(iscat).eq.2) then
+
+!---> LECTURES DES DONNEES UTILISATEURS (TBORD est un auxiliaire)
+
+ mode = 1
+
+ if (ippmod(iphpar).le.1) then
+
+ call usray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ mode , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha) ,&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , &
+ propfb(1,ipprob(itparo)) , tbord , tempk , &
+! Resultat : T en K
+ rdevel , rtuser , &
+ ra )
+
+ else
+
+ call ppray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+
+ mode , &
+
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha) ,&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ propfb(1,ipprob(itparo)) , tbord , tempk , &
+! Resultat : T en K
+ rdevel , rtuser , &
+ ra )
+
+ endif
+
+ endif
+
+!===============================================================================
+! 5. CALCUL DES TEMPERATURES DE PAROIS
+!===============================================================================
+
+
+! DANS TOUS LES CAS HFCONV CONTIENT Lambda * Hturb / distance
+! (HFCONV : W/(m2 K) ; Hturb est sans dimension)
+! (au premier passage, il est nul)
+
+!--> CALCUL DU FLUX CONVECTIF
+! Par flux convectif, on entend bien sur
+! flux convectif parallele a la paroi,
+! on suppose que la paroi est etanche...
+! Le flux est calcule dans condli clptur, sauf au premier
+! passage sans suite de calcul, puisque raycli est appele avant.
+
+
+if (ideb.eq.1) then
+
+ do ifac = 1,nfabor
+ if (isothm(ifac).ne.-1) then
+ propfb(ifac,ipprob(ifconv)) = &
+ propfb(ifac,ipprob(ihconv))*(tempk(ifabor(ifac))- &
+ propfb(ifac,ipprob(itparo)))
+ endif
+ enddo
+
+endif
+
+
+!--> Les cas ou il faut calculer TPAROI sont, au premier passage sans suite
+! des cas a temperature imposee TPAROI = TINT
+
+ if (ideb.eq.1) then
+
+ do ifac = 1,nfabor
+ if (isothm(ifac).eq.ipgrno .or. &
+ isothm(ifac).eq.iprefl .or. &
+ isothm(ifac).eq.ifgrno ) then
+ isothm(ifac) = itpimp
+ endif
+ enddo
+
+ endif
+
+ if(ideb.eq.0) then
+
+ call raypar &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha) ,&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+
+ icodcl , isothm , izfrad , &
+
+ idevel , ituser , ia , &
+
+ tmin , tmax , tx , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+
+ propfb(1,ipprob(itparo)) , propfb(1,ipprob(iqinci)) , &
+ text , tint , &
+ propfb(1,ipprob(ixlam)) , propfb(1,ipprob(iepa)) , &
+ propfb(1,ipprob(ieps)) , propfb(1,ipprob(ihconv)) , &
+ propfb(1,ipprob(ifconv)) , tempk , &
+
+ ra )
+
+ endif
+
+
+!===============================================================================
+! 6. CHANGEMENT DES CONDITIONS LIMITES UTILISATEUR
+!===============================================================================
+
+!===============================================================================
+! 6.1 LA VARIABLE TRANSPORTEE EST LA TEMPERATURE
+!===============================================================================
+
+ if (abs(iscsth(iscat)).eq.1) then
+
+ if(iscsth(iscat).eq.-1) then
+ xmtk = -tkelvi
+ else
+ xmtk = 0.d0
+ endif
+
+ do ifac = 1,nfabor
+
+ if (isothm(ifac).eq.itpimp .or. &
+ isothm(ifac).eq.ipgrno .or. &
+ isothm(ifac).eq.ifgrno ) then
+ rcodcl(ifac,ivart,1) = propfb(ifac,ipprob(itparo))+xmtk
+ rcodcl(ifac,ivart,2) = rinfin
+ rcodcl(ifac,ivart,3) = 0.d0
+
+ else if (isothm(ifac).eq.iprefl) then
+ rcodcl(ifac,ivart,1) = text(ifac)+xmtk
+ rcodcl(ifac,ivart,2) = propfb(ifac,ipprob(ixlam))/ &
+ propfb(ifac,ipprob(iepa))
+ rcodcl(ifac,ivart,3) = 0.d0
+
+ else if (isothm(ifac).eq.ifrefl) then
+ icodcl(ifac,ivart) = 3
+ rcodcl(ifac,ivart,1) = 0.d0
+ rcodcl(ifac,ivart,2) = rinfin
+ endif
+
+ enddo
+
+!===============================================================================
+! 6.2 LA VARIABLE TRANSPORTEE EST L'ENTHALPIE
+!===============================================================================
+
+ elseif (iscsth(iscat).eq.2) then
+
+!---> LECTURES DES DONNEES UTILISATEURS
+! ON CONVERTIT TPAROI EN ENTHALPIE DE BORD, STOCKEE DANS FLUNET,
+! QUI EST UTILISE COMME AUXILIAIRE
+
+ mode = 0
+
+ do ifac = 1,nfabor
+ if (isothm(ifac).eq.itpimp.or. &
+ isothm(ifac).eq.ipgrno.or. &
+ isothm(ifac).eq.ifgrno ) then
+ mode = -1
+ endif
+ enddo
+
+ if (mode.eq.-1) then
+
+ if (ippmod(iphpar).le.1) then
+
+ call usray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ mode , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha) ,&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ propfb(1,ipprob(itparo)) , propfb(1,ipprob(ifnet)) , &
+ tempk , &
+! HPAROI
+ rdevel , rtuser , &
+ ra )
+
+ else
+
+ call ppray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+
+ mode , &
+
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha) ,&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ propfb(1,ipprob(itparo)) , propfb(1,ipprob(ifnet)) , &
+ tempk , &
+! HPAROI
+ rdevel , rtuser , &
+ ra )
+
+ endif
+
+ endif
+
+ mode = 0
+
+ do ifac = 1,nfabor
+ if (isothm(ifac).eq.iprefl) then
+ mode = -1
+ endif
+ enddo
+
+ if (mode.eq.-1) then
+
+ if (ippmod(iphpar).le.1) then
+
+ call usray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ mode , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha) ,&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ text , tbord , tempk , &
+! HEXT
+ rdevel , rtuser , &
+ ra )
+
+ else
+
+ call ppray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+
+ mode , &
+
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha) ,&
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ text , tbord , tempk , &
+! HEXT
+ rdevel , rtuser , &
+ ra )
+
+ endif
+
+ endif
+
+ do ifac = 1,nfabor
+
+ if (isothm(ifac).eq.itpimp.or. &
+ isothm(ifac).eq.ipgrno.or. &
+ isothm(ifac).eq.ifgrno ) then
+ rcodcl(ifac,ivart,1) = propfb(ifac,ipprob(ifnet))
+ rcodcl(ifac,ivart,2) = rinfin
+ rcodcl(ifac,ivart,3) = 0.d0
+
+ else if (isothm(ifac).eq.iprefl) then
+
+ if (icp(irapha).gt.0) then
+ iel = ifabor(ifac)
+ cpp = propce(iel,ipproc(icp(irapha)))
+ else
+ cpp = cp0(irapha)
+ endif
+
+ rcodcl(ifac,ivart,1) = tbord(ifac)
+ rcodcl(ifac,ivart,2) = propfb(ifac,ipprob(ixlam)) &
+ / (propfb(ifac,ipprob(iepa))*cpp)
+ rcodcl(ifac,ivart,3) = 0.d0
+
+ else if (isothm(ifac).eq.ifrefl) then
+ icodcl(ifac,ivart) = 3
+ rcodcl(ifac,ivart,1) = 0.d0
+ rcodcl(ifac,ivart,2) = rinfin
+ endif
+
+ enddo
+
+ endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 FORMAT (/, 3X,'** INFORMATIONS SUR LE MODULE DE RAYONNEMENT ',/, &
+ 3X,' ------------------------------------------',/, &
+ 3X,' Initialisation de la temperature de paroi ',/, &
+ 3X,' (TPAROI) avec le profil utilisateur (TINTP) ',/, &
+ 3X,' et du flux incident aux parois (QINCID). ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ LES CONDITIONS AUX LIMITES SONT INCOMPLETES OU ERRONEES ',/,&
+'@ ',/,&
+'@ Le numero de zone associee a la face ',I10 ,' doit etre ',/,&
+'@ un entier strictement positif et inferieur ou egal a ',/,&
+'@ NOZRDM = ',I10 ,/,&
+'@ Ce numero (IZFRDP(IFAC)) vaut ici ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ PROBLEME DANS LES CONDITIONS AUX LIMITES ',/,&
+'@ ',/,&
+'@ Le nombre maximal de zones frontieres qui peuvent etre ',/,&
+'@ definies par l''utilisateur est NBZRDM = ',I10 ,/,&
+'@ Il a ete depasse. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier les conditions aux limites dans usray2. ',/,&
+'@ ',/,&
+'@ Les NBZRDM premieres zones frontieres ',/,&
+'@ portent ici les numeros suivants : ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2002 format(i10)
+
+ 2110 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ ISOTHP DOIT ETRE RENSEIGNE SUR TOUTES LES FACES DE PAROI',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Il ne l''a pas ete pour la face ',I10 ,/,&
+'@ zone ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2111 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ ISOTHP A ETE RENSEIGNE SUR UNE FACE NON PAROI ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Sur la face ',I10 ,', zone ',I10 ,', ISOTHP a ete ',/,&
+'@ renseigne dans usray2 (ISOTHP = ',I10 ,') alors que ',/,&
+'@ la face n''a pas ete declaree de type IPAROI ou IPARUG ',/,&
+'@ dans usclim. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2 et usclim. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2120 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ EPSP DOIT ETRE UN REEL INCLUS DANS [0.; 1.] ',/,&
+'@ TINTP DOIT ETRE UN REEL STRICTEMENT POSITIF ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = ITPIMP ',/,&
+'@ EPSP = ',E14.5 ,/,&
+'@ TINTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2130 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ EPSP DOIT ETRE UN REEL INCLUS DANS [0.; 1.] ',/,&
+'@ XLAMP, EPAP, TINTP, TEXTP DOIVENT ETRE DES REELS ',/,&
+'@ STRICTEMENT POSITIFS ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = IPGRNO ',/,&
+'@ EPSP = ',E14.5 ,/,&
+'@ XLAMP = ',E14.5 ,' EPAP = ',E14.5 ,/,&
+'@ TEXTP = ',E14.5 ,' TINTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2140 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ XLAMP, EPAP, TINTP, TEXTP DOIVENT ETRE DES REELS ',/,&
+'@ STRICTEMENT POSITIFS ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = IPREFL ',/,&
+'@ XLAMP = ',E14.5 ,' EPAP = ',E14.5 ,/,&
+'@ TEXTP = ',E14.5 ,' TINTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2150 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ EPSP DOIT ETRE UN REEL INCLUS DANS [0.; 1.] ',/,&
+'@ TINTP DOIT ETRE UN REEL STRICTEMENT POSITIF ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = IFGRNO ',/,&
+'@ EPSP = ',E14.5 ,/,&
+'@ TINTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2160 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ TINTP DOIT ETRE UN REEL STRICTEMENT POSITIF ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = IFREFL ',/,&
+'@ TINTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2170 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ VALEUR NON ADMISSIBLE DE ISOTHP ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2220 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ XLAMP, EPAP ET TEXTP NE DOIVENT PAS ETRE RENSEIGNES ',/,&
+'@ AVEC ISOTHP = ITPIMP ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = ITPIMP ',/,&
+'@ XLAMP = ',E14.5 ,' EPAP = ',E14.5 ,/,&
+'@ TEXTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2240 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ EPSP NE DOIT PAS ETRE RENSEIGNE AVEC ISOTHP = IPREFL ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = IPREFL ',/,&
+'@ EPSP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2250 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ XLAMP, EPAP, TEXTP NE DOIVENT PAS ETRE RENSEIGNES ',/,&
+'@ AVEC ISOTHP = IFGRNO ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = IFGRNO ',/,&
+'@ XLAMP = ',E14.5 ,' EPAP = ',E14.5 ,/,&
+'@ TEXTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2260 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ XLAMP, EPAP, TEXTP NE DOIVENT PAS ETRE RENSEIGNES ',/,&
+'@ AVEC ISOTHP = IFREFL ',/,&
+'@ ',/,&
+'@ Phase ',I10 ,/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' ISOTHP = IFREFL ',/,&
+'@ EPSP = ',E14.5 ,/,&
+'@ XLAMP = ',E14.5 ,' EPAP = ',E14.5 ,/,&
+'@ TEXTP = ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/rayt/raydak.f90 b/src/rayt/raydak.f90
new file mode 100644
index 0000000..588d45a
--- /dev/null
+++ b/src/rayt/raydak.f90
@@ -0,0 +1,175 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raydak &
+!================
+
+ ( ncel , ncelet , &
+ ck , pco2 , ph2o , fv , temp )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! CALCUL DES PROPRIETES RADIATIVES D'UN GAZ EN FONCTION DE LA
+! TEMPERATURE,DE LA COMPOSITION DES PRODUITS EN CO2, H2O ET SUIES
+! EN UTILISANT LES REGRESSIONS LINEAIRES ETABLIES PAR MODAK.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ck (ncelet) ! tr ! --> ! coefficient d'absorption du milieu !
+! ! ! ! (nul si transparent) !
+! pco2(ncelet) ! tr ! <-- ! pression partielle de co2 !
+! pco2(ncelet) ! tr ! <-- ! pression partielle de h2o !
+! fv (ncelet) ! tr ! <-- ! fraction volumique de suies !
+! temp(ncelet) ! tr ! <-- ! temperature !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "cstnum.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ncelet, ncel
+double precision ck(ncelet), temp(ncelet), fv(ncelet)
+double precision pco2(ncelet), ph2o(ncelet)
+
+! VARIABLES LOCALES
+
+integer iel
+double precision alpha, path, te, ts, sootk, tmin, tmax
+
+!===============================================================================
+!===============================================================================
+! CALCULS
+!===============================================================================
+
+! --- Longueur moyenne de penetration du rayonnement
+
+path = 15.d0
+
+tmax = 2000.d0
+tmin = 300.d0
+
+! ATTENTION : LES TEMPERATURES UTILISEES DANS MODAK SONT MISES EN KELVIN
+! =========
+
+do iel = 1, ncel
+
+! --- Temperature du melange gazeux
+
+ te = temp(iel)
+
+! --- Temperature du corps noir
+
+ ts = temp(iel)
+
+! --- Limitation A TMAX = 2000 K et TMIN = 300 K
+
+ if ( temp(iel).gt.tmax ) then
+ ts = tmax
+ te = tmax
+ endif
+ if ( temp(iel).lt.tmin ) then
+ ts = tmin
+ te = tmin
+ endif
+
+! --- Fraction volumique de suies
+
+ sootk = 7.d0*fv(iel)/0.95d-6
+
+! --- Calcul de l'absorptivite du fluide
+
+ call absorb &
+ !==========
+ ( ts , te , path , sootk , pco2(iel) , ph2o(iel) , alpha )
+
+! --- Test d'erreur
+
+ if ( (1.d0-alpha).le.epzero ) then
+ write(nfecra,1000) iel, alpha, pco2(iel), ph2o(iel), &
+ sootk, te, path, fv(iel)
+ call csexit(1)
+ endif
+
+! --- Calcul du coeffcient d'absorption
+
+ ck(iel) = - log(1.d0-alpha)/path
+
+enddo
+
+!========
+! FORMATS
+!========
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ERREUR RAYDAK : CALCUL DE ABSORPTIVITE ',/,&
+'@ ============= ',/,&
+'@ IEL = ', I10 ,/,&
+'@ ALPHA = ', G15.7 ,/,&
+'@ PCO2 = ', G15.7 ,/,&
+'@ PH2O = ', G15.7 ,/,&
+'@ SOOTK = ', G15.7 ,/,&
+'@ TE = ', G15.7 ,/,&
+'@ PATH = ', G15.7 ,/,&
+'@ FV = ', G15.7 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+return
+
+end
diff --git a/src/rayt/raydir.f90 b/src/rayt/raydir.f90
new file mode 100644
index 0000000..f524974
--- /dev/null
+++ b/src/rayt/raydir.f90
@@ -0,0 +1,123 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raydir &
+!================
+
+ ( sx,sy,sz,ndirs )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! CALCUL DES COSINUS DIRECTEURS DE LA DIRECTION
+! DE PROPAGATION DU RAYONNEMENT
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!sx,sy,sz ! r ! --> ! cosinus directeurs du rayonnement !
+! ndirs ! e ! -> ! nombre de directions par 1/8 de !
+! ! ! ! sphere !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer ndirs
+double precision sx(ndirs),sy(ndirs),sz(ndirs)
+
+! VARIABLES LOCALES
+
+double precision teta(6,3)
+double precision phi1,teta1
+integer ii,kk,nray,jray,iia,iib
+
+!===============================================================================
+
+data teta &
+ / .785398d0, .785398d0, .785398d0, 1.256637d0, .300162d0, .448799d0, &
+ .785398d0, 1.256637d0, 1.427996d0, .999598d0, 1.374447d0, 1.121997d0, &
+ .785398d0, .314159d0, .142800d0, .205855d0, .571199d0, .785398d0 /
+
+!===============================================================================
+
+! 0 - INITIALISATION
+! --------------
+! FORMULE : NDIRS = 3*NRAY -2
+
+if (ndirs.eq.4) nray = 2
+if (ndirs.eq.16) nray = 6
+
+! 1 - CALCUL DES COSINUS DIRECTEURS
+! ------------------------------
+
+sz(1 ) = cos(atan(tan(teta(1,3))/cos(teta(1,1))))
+sy(1 ) = sz(1 )
+sx(1 ) = sz(1 )
+
+jray = 1
+
+do ii = 0,2
+
+ iia = 3 + ii
+ iib = 1 + ii
+ if (iia.gt.3) iia = iia-3
+
+ do kk = 2,nray
+ jray = jray+1
+ teta1 = teta(kk,iib)
+ phi1 = atan(tan(teta(kk,iia))/cos(teta(kk,iib)))
+ sx(jray) = sin(phi1)*cos(teta1)
+ sy(jray) = sin(phi1)*sin(teta1)
+ sz(jray) = cos(phi1)
+ enddo
+
+enddo
+
+return
+
+end
diff --git a/src/rayt/raydom.f90 b/src/rayt/raydom.f90
new file mode 100644
index 0000000..0135c1e
--- /dev/null
+++ b/src/rayt/raydom.f90
@@ -0,0 +1,1695 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raydom &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ izfrad , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ flurds , flurdb , &
+ dtr , viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , tempk , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! Enveloppe principale du module de r�solution de l'�quation
+! des transferts radiatifs
+
+! Deux methodes sont disponibles :
+
+! 1) La methode : "Discretes Ordinates Methods" (DOM)
+! 2) L'approximation P-1 (recommand� uniquement pour le CP)
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! izfrad(nfabor ! te ! <-- ! numero de zone des faces de bord !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! cofrua,cofrub ! tr ! --- ! conditions aux limites aux !
+!(nfabor) ! ! ! faces de bord pour la luminances !
+! flurds,flurdb ! tr ! --- ! pseudo flux de masse (faces internes !
+!(nfac)(nfabor) ! ! ! et faces de bord ) !
+! dtr(ncelet) ! tr ! --- ! dt*cdtvar !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! tempk(ncelet) ! tr ! --> ! temperature en kelvin !
+! ,nphasc) ! ! ! !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "period.h"
+include "lagpar.h"
+include "lagdim.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "fuincl.h"
+include "ppincl.h"
+include "cpincl.h"
+include "radiat.h"
+include "ihmpre.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer izfrad(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision cofrua(nfabor), cofrub(nfabor)
+double precision flurds(nfac), flurdb(nfabor)
+
+double precision dtr(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision w4(ncelet) , w5(ncelet) , w6(ncelet)
+double precision w7(ncelet) , w8(ncelet) , w9(ncelet)
+double precision w10(ncelet)
+
+double precision tempk(ncelet,nphasc)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iappel
+integer ifac , iel , iok , izone
+integer inc , iccocg , iwarnp , imligp , nswrgp
+integer mode , icla , ipcla , ivar0
+integer iscat , ivart , iphydp
+integer idimte , itenso
+integer iflux(nozrdm)
+double precision epsrgp, climgp, extrap
+double precision surfbn
+double precision aa, bb, ckmin, unspi, xlimit, cofrmn, flunmn
+double precision flux(nozrdm)
+double precision vv, sf, xlc, xkmin, pp
+
+integer ipadom
+data ipadom /0/
+save ipadom
+
+!==============================================================================
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS GENERALES
+!===============================================================================
+
+!---> NUMERO DE PASSAGE RELATIF
+
+ipadom = ipadom + 1
+if (ipadom.gt.1 .and. mod(ntcabs,nfreqr).ne.0) return
+
+write(nfecra,1000)
+
+!---> INITIALISATION DES CONSTANTES
+
+unspi = 1.d0/pi
+
+!===============================================================================
+! 2. PHASE
+!===============================================================================
+
+!---> NUMERO DU SCALAIRE ET DE LA VARIABLE THERMIQUE
+
+ iscat = iscalt(irapha)
+ ivart = isca(iscalt(irapha))
+
+!===============================================================================
+! 3.1 COEFFICIENT D'ABSORPTION DU MILIEU SEMI-TRANSPARENT
+!===============================================================================
+
+!--> INITIALISATION NON ADMISSIBLE POUR TEST APRES USRAY3
+
+ do iel = 1,ncel
+ propce(iel,ipproc(icak(1))) = -grand
+ enddo
+
+!--> COEFFICIENT D'ABSORPTION POUR LA PHYSIQUE PARTICULIERE
+
+! ATTENTION : DANS LE CAS DE L'APPROXIMATION P-1, LE COEFFICIENT
+! D'ABSORPTION EST UTILISE POUR CALCULER LES CONDITIONS AUX
+! LIMITES DE L'EQUATION A RESOUDRE.
+
+ if (ippmod(iphpar).ge.2) then
+
+ call ppcabs &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , &
+ ra )
+
+!-----> W10 SERT A STOCKER TEMPORAIREMENT
+! LE COEFFICIENT D'ABSORPTION DU MELANGE GAZ-PARTICULE
+
+ if (ippmod(icp3pl).ge.0 .or. ippmod(icfuel).ge.0) then
+
+ do iel = 1,ncel
+ w10(iel) = propce(iel,ipproc(icak(1)))
+ enddo
+
+ if (ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ w10(iel) = w10(iel) &
+ + ( propce(iel,ipproc(ix2(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) )
+ enddo
+ enddo
+ else if ( ippmod(icfuel) .ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ w10(iel) = w10(iel) &
+ + ( rtpa(iel,isca(iyfol(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) )
+ enddo
+ enddo
+ endif
+
+ do iel = 1,ncel
+ propce(iel,ipproc(icak(1))) = w10(iel)
+ enddo
+ endif
+
+ else
+
+
+!---> LECTURES DES DONNEES UTILISATEURS
+
+! - Interface Code_Saturne
+! ======================
+
+ if (iihmpr.eq.1) then
+
+ call uiray3(propce(1,ipproc(icak(1))), ncel, imodak)
+ !==========
+
+ if (iirayo.eq.2 .and. ippmod(iphpar).le.1 .and. ipadom.le.3) then
+ sf = 0.d0
+ vv = 0.d0
+
+! Calcul de la longueur caract�ristique du domaine de calcul
+ do ifac = 1,nfabor
+ sf = sf + sqrt(surfbo(1,ifac)**2 + &
+ surfbo(2,ifac)**2 + &
+ surfbo(3,ifac)**2 )
+ enddo
+ if (irangp.ge.0) then
+ call parsom(sf)
+ !==========
+ endif
+
+ do iel = 1,ncel
+ vv = vv + volume(iel)
+ enddo
+ if (irangp.ge.0) then
+ call parsom(vv)
+ !==========
+ endif
+
+ xlc = 3.6d0 * vv / sf
+
+! Clipping pour la variable CK
+
+ xkmin = 1.d0 / xlc
+
+ iok = 0
+ do iel = 1,ncel
+ if (propce(iel,ipproc(icak(1))).lt.xkmin) then
+ iok = iok +1
+ endif
+ enddo
+
+! Alerte si epaisseur optique trop grande
+
+ pp = xnp1mx/100.0d0
+ if (dble(iok).gt.pp*dble(ncel)) then
+ write(nfecra,6000) xkmin, dble(iok)/dble(ncel)*100.d0, &
+ xnp1mx
+ endif
+ endif
+
+ endif
+
+ call usray3 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha), &
+ ipnfac , nodfac , ipnfbr , nodfbr , izfrad , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ propce(1,ipproc(icak(1))), &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , &
+ ra )
+
+ endif
+
+!--> VERIFICATIONS GENERALES :
+
+!---> P-1 : VERIFICATION QUE CK DU MILIEU EST STRICTEMENT
+! SUPERIEUR A ZERO POUR TOUTES CELLULES
+
+ if (iirayo.eq.2) then
+
+ ckmin = propce(1,ipproc(icak(1)))
+ do iel = 1, ncel
+ ckmin = min(ckmin,propce(iel,ipproc(icak(1))))
+ enddo
+ if (ckmin.lt.0.d0) then
+ write(nfecra,2020)
+ call csexit (1)
+ !==========
+ endif
+
+ else if (iirayo.eq.1) then
+
+!---> DOM : VERIFICATION QUE CK DU MILIEU EST SUPERIEUR OU EGAL A 0
+
+ ckmin = propce(1,ipproc(icak(1)))
+ do iel = 1, ncel
+ ckmin = min(ckmin,propce(iel,ipproc(icak(1))))
+ enddo
+ if (ckmin.lt.0.d0) then
+ write(nfecra,2010) ckmin
+ call csexit (1)
+ !==========
+ endif
+
+ endif
+
+!---> VERIFICATION D'UN CAS TRANSPARENT
+
+ aa = zero
+ do iel = 1,ncel
+ aa = aa + propce(iel,ipproc(icak(1)))
+ enddo
+ if (irangp.ge.0) then
+ call parmax(aa)
+ !==========
+ endif
+ if (aa.le.epzero) then
+ write(nfecra,1100)
+ idiver = -1
+ endif
+
+!===============================================================================
+! 3.2 CONDITIONS AUX LIMITES POUR LES EQNS DE LA DOM ET DE L'APPROX P-1
+
+! REMPLISSAGE DES CONDITIONS AUX LIMITES POUR LA LUMINANCE
+! (TABLEAUX COFRUA & COFRUB)
+!===============================================================================
+
+!-----> INITIALISATIONS NON ADMISSIBLES POUR TEST APRES USRAY5
+
+ do ifac = 1,nfabor
+ cofrua(ifac) = -grand
+ cofrub(ifac) = -grand
+ enddo
+
+ iappel = 1
+
+ call usray5 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha), &
+ ipnfac , nodfac , ipnfbr , nodfbr , izfrad , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ propfb(1,ipprob(itparo)) , propfb(1,ipprob(iqinci)) , &
+ propfb(1,ipprob(ifnet)) , propfb(1,ipprob(ixlam)) , &
+ propfb(1,ipprob(iepa)) , propfb(1,ipprob(ieps)) , &
+ propce(1,ipproc(icak(1))) , &
+ rdevel , rtuser , &
+ ra )
+
+
+!---> BLINDAGE POUR UN DIRICHLET SUR LA LUMINANCE
+! (UNIQUEMENT POUR LA METHODE DOM, SANS OBJET POUR L'APPROX P-1)
+
+ if (iirayo.eq.1) then
+ do ifac = 1,nfabor
+ cofrub(ifac) = zero
+ enddo
+ endif
+
+!---> VERIFICATION DU REMPLISSAGE DE COFRUA & COFRUB
+
+! Attention : dans le cas de l'approx P-1 la valeur de COFRUA peut
+! etre grande (de l'ordre de TPAROI**4), d'ou la valeur de COFRMN
+
+ iok = 0
+ xlimit = -grand*0.1d0
+! GRAND n'est pas assez grand...
+ cofrmn = rinfin
+
+ do ifac = 1,nfabor
+ if (cofrua(ifac).le.xlimit) then
+ iok = iok + 1
+ cofrmn = min(cofrmn,cofrua(ifac))
+ write(nfecra,3000)ifac,izfrad(ifac),itypfb(ifac,irapha)
+ endif
+ enddo
+
+ if (iok.ne.0) then
+ write(nfecra,3100) irapha, cofrmn
+ call csexit (1)
+ !==========
+ endif
+
+ cofrmn = rinfin
+
+ if (iirayo.eq.2) then
+
+ do ifac = 1,nfabor
+ if (cofrub(ifac).le.xlimit) then
+ iok = iok + 1
+ cofrmn = min(cofrmn,cofrub(ifac))
+ write(nfecra,3000)ifac,izfrad(ifac),itypfb(ifac,irapha)
+ endif
+ enddo
+
+ if (iok.ne.0) then
+ write(nfecra,3200) irapha,cofrmn
+ call csexit (1)
+ !==========
+ endif
+
+ endif
+
+!===============================================================================
+! 4. STOCKAGE DE LA TEMPERATURE (en Kelvin) dans TEMPK(IEL,IPH)
+!===============================================================================
+
+ if (idiver.ge.0) then
+
+ if(abs(iscsth(iscat)).eq.1) then
+
+!---> TRANSPORT DE LA TEMPERATURE
+
+ if (iscsth(iscat).eq.-1) then
+ do iel = 1, ncel
+ tempk(iel,1) = rtpa(iel,ivart) + tkelvi
+ enddo
+ else
+ do iel = 1, ncel
+ tempk(iel,1) = rtpa(iel,ivart)
+ enddo
+ endif
+
+!---> TRANSPORT DE L'ENTHALPIE (FLURDB est un auxiliaire)
+
+ else if (iscsth(iscat).eq.2) then
+
+ mode = 1
+
+ if (ippmod(iphpar).le.1) then
+
+ call usray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ mode , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ propfb(1,ipprob(itparo)) , flurdb , tempk(1,1) , &
+ rdevel , rtuser , &
+ ra )
+
+ else
+
+ call ppray4 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ mode , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha), &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ propfb(1,ipprob(itparo)) , flurdb , tempk(1,1) , &
+ rdevel , rtuser , &
+ ra )
+
+ endif
+
+ if ( ippmod(icp3pl).ge.0 ) then
+
+! Temperature des particules
+
+ do icla = 1, nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ tempk(iel,ipcla) = propce(iel,ipproc(itemp2(icla)))
+ enddo
+ enddo
+
+! Fuel
+
+ else if ( ippmod(icfuel).ge.0 ) then
+
+ do icla = 1, nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ tempk(iel,ipcla) = propce(iel,ipproc(itemp3(icla)))
+ enddo
+ enddo
+
+ endif
+
+ else
+ write(nfecra,3500)iscat,iscsth(iscat)
+ call csexit (1)
+ !==========
+ endif
+
+!---> ON SE SERT DE PROPCE(IEL,IPPROC(ITSRI(1))) COMME UN AUXILIAIRE POUR
+! STOCKER STEPHN*CK*TEMPK**4 ICI
+! PLUS BAS ON JUSTIFIERA LE NOM.
+
+ if ( ippmod(icod3p).eq.-1 .and. &
+ ippmod(icoebu).eq.-1 ) then
+
+! Rayonnement standard, flamme CP ou fuel
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = stephn * &
+ propce(iel,ipproc(icak(1)))*(tempk(iel,1)**4)
+ enddo
+
+ else
+
+! Flamme de diffusion ou flamme de premelange
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = stephn * &
+ propce(iel,ipproc(icak(1)))*propce(iel,ipproc(it4m))
+ enddo
+
+ endif
+
+! Charbon
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(ipcla))) = stephn * &
+ propce(iel,ipproc(icak(ipcla)))*(tempk(iel,ipcla)**4)
+ enddo
+ enddo
+
+! Fuel
+
+ else if ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(ipcla))) = stephn * &
+ propce(iel,ipproc(icak(ipcla)))*(tempk(iel,ipcla)**4)
+ enddo
+ enddo
+ endif
+
+ else
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = zero
+ enddo
+! fin de IF (IDIVER.GE.0) THEN
+ endif
+
+!===============================================================================
+! 5.1 MODELE DE RAYONNEMENT P-1
+!===============================================================================
+
+ if (iirayo.eq.2) then
+
+!--> Terme source explicite de l'equation sur Theta4
+
+ do iel = 1, ncel
+ smbrs(iel) = 3.d0 * propce(iel,ipproc(icak(1))) * &
+ ( tempk(iel,1) ** 4) * volume(iel)
+ enddo
+
+! Tenir compte de l'absorption des particules
+
+! Charbon
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ smbrs(iel) = smbrs(iel) &
+ + ( 3.d0 * propce(iel,ipproc(ix2(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) &
+ * (tempk(iel,ipcla)**4) * volume(iel) )
+ enddo
+ enddo
+
+! FUEL
+
+ else if ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ smbrs(iel) = smbrs(iel) &
+ +( 3.d0 * rtpa(iel,isca(iyfol(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) &
+ * (tempk(iel,ipcla)**4) * volume(iel) )
+ enddo
+ enddo
+ endif
+
+!--> Terme source implicite de l'equation sur Theta4
+
+ do iel = 1, ncel
+ rovsdt(iel) = 3.d0 * propce(iel,ipproc(icak(1))) &
+ * volume(iel)
+ enddo
+
+! Tenir compte de l'absorption des particules
+
+! Charbon
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + (3.d0 * propce(iel,ipproc(ix2(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) &
+ * volume(iel) )
+ enddo
+ enddo
+
+! Fuel
+
+ else if ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + (3.d0*rtpa(iel,isca(iyfol(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) &
+ * volume(iel) )
+ enddo
+ enddo
+
+ endif
+
+!--> Inverse du coefficient de diffusion de l'equation sur Theta4
+! A priori W10 contient deja la bonne info, mais pour plus de
+! securite on le re-remplit
+
+ do iel = 1, ncel
+ w10(iel) = propce(iel,ipproc(icak(1)))
+ enddo
+
+! Tenir compte de l'absorption des particules
+
+! Charbon
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ w10(iel) = w10(iel) &
+ + ( propce(iel,ipproc(ix2(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) )
+ enddo
+ enddo
+
+! Fuel
+
+ else if ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ w10(iel) = w10(iel) &
+ + ( rtpa(iel,isca(iyfol(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) )
+ enddo
+ enddo
+
+ endif
+
+ call raypun &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ flurds , flurdb , &
+ dtr , viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+
+ propce(1,ipproc(iabs(1))),propce(1,ipproc(iemi(1))), &
+ propce(1,ipproc(itsre(1))) , propce(1,ipproc(iqx)) , &
+ propce(1,ipproc(iqy)) , propce(1,ipproc(iqz)) , &
+ propfb(1,ipprob(iqinci)), propfb(1,ipprob(ieps)) , &
+ propfb(1,ipprob(itparo)), &
+
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 5.2 RESOLUTION DE L'EQUATION DES TRANSFERTS RADIATIFS
+!===============================================================================
+
+ else if (iirayo.eq.1) then
+
+!--> Terme source explicite de l'equation sur la luminance
+
+
+ do iel = 1, ncel
+ smbrs(iel) = propce(iel,ipproc(itsri(1))) *volume(iel) &
+ *unspi
+ enddo
+
+! Charbon
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ smbrs(iel) = smbrs(iel) &
+ + propce(iel,ipproc(ix2(icla))) &
+ *propce(iel,ipproc(itsri(ipcla)))*volume(iel) &
+ *unspi
+ enddo
+ enddo
+
+! Fuel
+
+ elseif ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ smbrs(iel) = smbrs(iel) &
+ + rtpa(iel,isca(iyfol(icla))) &
+ *propce(iel,ipproc(itsri(ipcla)))*volume(iel) &
+ *unspi
+ enddo
+ enddo
+
+ endif
+
+!--> Terme source implicite de l'equation sur la luminance
+! KL + div(LS) = KL0 integre sur le volume de controle
+
+ do iel = 1, ncel
+ rovsdt(iel) = propce(iel,ipproc(icak(1))) * volume(iel)
+ enddo
+
+! Charbon
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ rovsdt(iel) = rovsdt(iel) + &
+ propce(iel,ipproc(ix2(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) &
+ * volume(iel)
+ enddo
+ enddo
+
+! Fuel
+
+ elseif ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ rovsdt(iel) = rovsdt(iel) &
+ + rtpa(iel,isca(iyfol(icla))) &
+ * propce(iel,ipproc(icak(ipcla))) &
+ * volume(iel)
+ enddo
+ enddo
+
+ endif
+
+ call raysol &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , irapha , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ flurds , flurdb , &
+ dtr , viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , &
+ propce(1,ipproc(iabs(1))),propce(1,ipproc(iemi(1))) ,&
+ propce(1,ipproc(itsre(1))),propce(1,ipproc(iqx)) ,&
+ propce(1,ipproc(iqy)) , propce(1,ipproc(iqz)) , &
+ propfb(1,ipprob(iqinci) ), propfb(1,ipprob(ifnet)) , &
+ rdevel , rtuser , &
+ ra )
+
+
+ endif
+
+!===============================================================================
+! 5.3 STOCKAGE DE L'INTEGRALE DE LA LUMINANCE POUR LE LANGRANGIEN
+!===============================================================================
+
+! Si dans le module lagrangien on resout une equation de la temperature
+! sur les particules (IPHYLA=1 et ITPVAR=1) ou si les particules
+! sont des grains de charbon (IPHYLA=2), on a besoin de
+! / -> ->
+! l'integrale de la luminance SA= / L( X , S ). DOMEGA
+! /4.PI
+! On stocke cette variable quelque soit le choix des options
+
+ do iel = 1,ncel
+ propce(iel,ipproc(ilumin)) = propce(iel,ipproc(itsre(1)))
+ enddo
+
+!===============================================================================
+! 6. FLUX NET RADIATIF AUX PAROIS : CALCUL ET INTEGRATION
+!===============================================================================
+
+
+!---> INITIALISATION NON ADMISSIBLE POUR TEST APRES USRAY5
+
+ do ifac = 1,nfabor
+ propfb(ifac,ipprob(ifnet)) = -grand
+ enddo
+
+!---> LECTURES DES DONNEES UTILISATEURS
+
+ iappel = 2
+
+ call usray5 &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , irapha , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb(1,irapha), &
+ ipnfac , nodfac , ipnfbr , nodfbr , izfrad , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ propfb(1,ipprob(itparo)) , propfb(1,ipprob(iqinci)) , &
+ propfb(1,ipprob(ifnet)) , propfb(1,ipprob(ixlam)) , &
+ propfb(1,ipprob(iepa)) , propfb(1,ipprob(ieps)) , &
+ propce(1,ipproc(icak(1))) , &
+ rdevel , rtuser , &
+ ra )
+
+!---> VERIFICATION DE FLUNET
+
+ iok = 0
+ xlimit = -grand*0.1d0
+ flunmn = grand
+
+ do ifac = 1,nfabor
+ if (propfb(ifac,ipprob(ifnet)).le.xlimit) then
+ iok = iok + 1
+ flunmn = min(flunmn,propfb(ifac,ipprob(ifnet)))
+ write(nfecra,4000)ifac,izfrad(ifac),itypfb(ifac,irapha)
+ endif
+ enddo
+
+ if (iok.ne.0) then
+ write(nfecra,4100) irapha,flunmn
+ call csexit (1)
+ !==========
+ endif
+
+!--> Int�gration du flux net sur les diff�rentes zones de frontieres
+! IFLUX sert en parallele pour reperer les zones existantes
+
+ do izone = 1, nozrdm
+ flux(izone) = 0.d0
+ iflux(izone) = 0
+ enddo
+ do ifac = 1,nfabor
+ surfbn = ra(isrfbn-1+ifac)
+ izone = izfrad(ifac)
+ flux(izone) = flux(izone) &
+ + propfb(ifac,ipprob(ifnet))*surfbn
+ iflux(izone) = 1
+ enddo
+ if(irangp.ge.0) then
+ call parrsm(nozarm,flux )
+ call parimx(nozarm,iflux)
+ endif
+
+
+ write(nfecra,5000)
+ write(nfecra,5010)
+ do izone = 1, nozarm
+ if(iflux(izone).eq.1) then
+ write(nfecra,5020) izone,flux(izone)
+ endif
+ enddo
+ write(nfecra,5000)
+
+
+!--> Int�gration de la densit� de flux net aux frontieres
+
+ aa = zero
+ do ifac = 1,nfabor
+ surfbn = ra(isrfbn-1+ifac)
+ aa = aa + propfb(ifac,ipprob(ifnet)) * surfbn
+ enddo
+ if(irangp.ge.0) then
+ call parsom(aa)
+ endif
+ write(nfecra,5030) aa
+
+!===============================================================================
+! 7. TERMES SOURCES RADIATIFS IMPLICITE ET EXPLICITE
+!===============================================================================
+
+
+!===============================================================================
+! 7.1 TERMES SOURCES RADIATIFS SEMI-ANALYTIQUES
+!===============================================================================
+
+ if (idiver.ge.0) then
+
+!--> On stocke dans le tableau de travail W9 le CP
+! Attention : il faut conserver W9 dans la suite de la routine,
+! car son contenu est utilis� plus loin
+
+ if (icp(irapha).gt.0) then
+ do iel = 1,ncel
+ w9(iel) = 1.d0/propce(iel,ipproc(icp(irapha)))
+ enddo
+ else
+ do iel = 1,ncel
+ w9(iel) = 1.d0/cp0(irapha)
+ enddo
+ endif
+
+ do iel = 1,ncel
+
+!--> part d'absorption du terme source explicite
+
+ propce(iel,ipproc(iabs(1))) = &
+propce(iel,ipproc(icak(1)))*propce(iel,ipproc(itsre(1)))
+
+!--> part d'�mission du terme source explicite
+
+ propce(iel,ipproc(iemi(1))) = -4.d0 * &
+ propce(iel,ipproc(itsri(1)))
+
+ enddo
+
+! Combustion CP : On rajoute la contribution des particules
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+! Fluide
+ propce(iel,ipproc(iabs(1))) = &
+ propce(iel,ipproc(iabs(1))) &
+ + propce(iel,ipproc(ix2(icla))) * &
+ propce(iel,ipproc(icak(ipcla)))*propce(iel,ipproc(itsre(1)))
+!
+ propce(iel,ipproc(iemi(1))) = &
+ propce(iel,ipproc(iemi(1))) &
+ - 4.0d0*propce(iel,ipproc(ix2(icla))) &
+ * propce(iel,ipproc(itsri(ipcla)))
+! Particule
+ propce(iel,ipproc(iabs(ipcla))) = &
+ propce(iel,ipproc(icak(ipcla))) * &
+ propce(iel,ipproc(itsre(1)))
+ propce(iel,ipproc(iemi(ipcla))) = - 4.0d0 * &
+ propce(iel,ipproc(itsri(ipcla)))
+ propce(iel,ipproc(itsre(ipcla))) = &
+ propce(iel,ipproc(iabs(ipcla))) + &
+ propce(iel,ipproc(iemi(ipcla)))
+ enddo
+ enddo
+
+! Combustion Fuel : On rajoute la contribution des particules
+
+ elseif ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+! Fluide
+ propce(iel,ipproc(iabs(1))) = &
+ propce(iel,ipproc(iabs(1))) &
+ + rtpa(iel,isca(iyfol(icla))) * &
+ propce(iel,ipproc(icak(ipcla)))*propce(iel,ipproc(itsre(1)))
+!
+ propce(iel,ipproc(iemi(1))) = &
+ propce(iel,ipproc(iemi(1))) &
+ - 4.0d0*rtpa(iel,isca(iyfol(icla))) &
+ * propce(iel,ipproc(itsri(ipcla)))
+! Particule
+ propce(iel,ipproc(iabs(ipcla))) = &
+ propce(iel,ipproc(icak(ipcla))) * &
+ propce(iel,ipproc(itsre(1)))
+ propce(iel,ipproc(iemi(ipcla))) = - 4.0d0 * &
+ propce(iel,ipproc(itsri(ipcla)))
+ propce(iel,ipproc(itsre(ipcla))) = &
+ propce(iel,ipproc(iabs(ipcla))) + &
+ propce(iel,ipproc(iemi(ipcla)))
+ enddo
+ enddo
+
+ endif
+
+!--> Premi�re m�thode pour le calcul du terme source explicite :
+! il est calcul� comme la somme des termes d'absorption et d'�mission
+! (il faudra multiplier ce terme par VOLUME(IEL) dans COVOFI->RAYSCA)
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsre(1))) = &
+ propce(iel,ipproc(iabs(1)))+propce(iel,ipproc(iemi(1)))
+ enddo
+
+!--> Terme source implicite,
+! (il faudra multiplier ce terme par VOLUME(IEL) dans COVOFI->RAYSCA)
+
+ if ( ippmod(icod3p).eq.-1 .and. &
+ ippmod(icoebu).eq.-1 ) then
+
+! Rayonnement standard, flamme CP ou fuel
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = &
+ -16.d0*propce(iel,ipproc(icak(1))) *stephn * &
+ (tempk(iel,1)**3) * w9(iel)
+ enddo
+
+ else
+
+! Flamme de diffusion ou flamme de premelange
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = &
+ -16.d0*stephn*propce(iel,ipproc(icak(1)))* &
+ propce(iel,ipproc(it3m)) * w9(iel)
+ enddo
+
+ endif
+
+
+! Combustion CP : On rajoute la contribution des particules
+
+ if ( ippmod(icp3pl).ge.0 ) then
+ do icla = 1,nclacp
+ ipcla = 1+icla
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = &
+ propce(iel,ipproc(itsri(1))) - &
+ 16.d0*propce(iel,ipproc(icak(ipcla))) * &
+ propce(iel,ipproc(ix2(icla))) * stephn * (tempk(iel,ipcla)**3) &
+ / cp2ch(ichcor(icla))
+ propce(iel,ipproc(itsri(ipcla))) = &
+ -16.d0*propce(iel,ipproc(icak(ipcla))) *stephn &
+ *(tempk(iel,ipcla)**3) / cp2ch(ichcor(icla))
+ enddo
+ enddo
+
+! Combustion FUEL : On rajoute la contribution des particules
+
+ elseif ( ippmod(icfuel).ge.0 ) then
+ do icla = 1,nclafu
+ ipcla = 1+icla
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = &
+ propce(iel,ipproc(itsri(1))) - &
+ 16.d0*propce(iel,ipproc(icak(ipcla))) * &
+ rtpa(iel,isca(iyfol(icla))) * stephn * (tempk(iel,ipcla)**3) &
+ /cp2fol
+ propce(iel,ipproc(itsri(ipcla))) = &
+ -16.d0*propce(iel,ipproc(icak(ipcla))) *stephn &
+ *(tempk(iel,ipcla)**3) / cp2fol
+ enddo
+ enddo
+ endif
+
+ else
+ do iel = 1,ncel
+ propce(iel,ipproc(iabs(1))) = zero
+ propce(iel,ipproc(iemi(1))) = zero
+ propce(iel,ipproc(itsre(1))) = zero
+ propce(iel,ipproc(itsri(1))) = zero
+ enddo
+ endif
+
+!===============================================================================
+! 7.2 TERME SOURCE RADIATIF EXPLICITE CONSERVATIF
+!===============================================================================
+
+! A partir d'ici COFRUA et COFRUB deviennent les CL pour la divergence
+
+ if (idiver.eq.1 .or. idiver.eq.2) then
+
+ do ifac = 1,nfabor
+ cofrub(ifac) = zero
+ enddo
+
+!--> calcul de la divergence
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+ if(irangp.ge.0) then
+ call parcom (propce(1,ipproc(iqx)))
+ !==========
+ call parcom (propce(1,ipproc(iqy)))
+ !==========
+ call parcom (propce(1,ipproc(iqz)))
+ !==========
+ endif
+
+! Periodique
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ propce(1,ipproc(iqx)) , propce(1,ipproc(iqx)) , propce(1,ipproc(iqx)) , &
+ propce(1,ipproc(iqy)) , propce(1,ipproc(iqy)) , propce(1,ipproc(iqy)) , &
+ propce(1,ipproc(iqz)) , propce(1,ipproc(iqz)) , propce(1,ipproc(iqz)) )
+ endif
+
+
+! Donnees pour le calcul de la divergence
+
+ inc = 1
+ iccocg = 1
+ imligp = -1
+ iwarnp = iimlum
+ epsrgp = 1.d-8
+ climgp = 1.5d0
+ extrap = 0.d0
+ nswrgp = 100
+
+!------->>direction X
+
+ do ifac = 1,nfabor
+ surfbn = ra(isrfbn-1+ifac)
+ cofrua(ifac) = &
+ propfb(ifac,ipprob(ifnet)) *surfbo(1,ifac) /surfbn
+ enddo
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+! sera a revoir pour la periodicite de rotation
+ ivar0 = 0
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ propce(1,ipproc(iqx)) , cofrua , cofrub , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsre(1))) = - w1(iel)
+ enddo
+
+!------->>direction Y
+
+ do ifac = 1,nfabor
+ surfbn = ra(isrfbn-1+ifac)
+ cofrua(ifac) = &
+ propfb(ifac,ipprob(ifnet)) *surfbo(2,ifac) /surfbn
+ enddo
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+! sera a revoir pour la periodicite de rotation
+ ivar0 = 0
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ propce(1,ipproc(iqy)) , cofrua , cofrub , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsre(1))) = propce(iel,ipproc(itsre(1))) - w2(iel)
+ enddo
+
+!------->>direction Z
+
+ do ifac = 1,nfabor
+ surfbn = ra(isrfbn-1+ifac)
+ cofrua(ifac) = &
+ propfb(ifac,ipprob(ifnet)) *surfbo(3,ifac) /surfbn
+ enddo
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+! sera a revoir pour la periodicite de rotation
+ ivar0 = 0
+ iphydp = 0
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w1 , w1 , w1 , &
+ propce(1,ipproc(iqz)) , cofrua , cofrub , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsre(1))) = &
+ propce(iel,ipproc(itsre(1))) - w3(iel)
+ enddo
+
+! Fin du calcul de la divergence
+ endif
+
+
+!===============================================================================
+! 7.3 TERME SOURCE RADIATIF EXPLICITE SEMI-ANALYTIQUE CORRIGE
+!===============================================================================
+
+
+ if (idiver.eq.2) then
+
+!---> comparaison des termes sources semi-analytique et conservatif
+
+ aa = zero
+ do iel = 1,ncel
+ aa = aa + propce(iel,ipproc(itsre(1))) * volume(iel)
+ enddo
+
+ bb = zero
+ do iel = 1,ncel
+ bb = bb + (propce(iel,ipproc(iabs(1))) + &
+ propce(iel,ipproc(iemi(1)))) * volume(iel)
+ enddo
+
+ if(irangp.ge.0) then
+ call parsom(aa)
+ call parsom(bb)
+ endif
+
+ aa = aa/bb
+
+!---> correction du terme source semi-analytique par le conservatif
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsre(1))) = &
+ (propce(iel,ipproc(iabs(1))) + &
+ propce(iel,ipproc(iemi(1)))) * aa
+ enddo
+
+ endif
+
+!===============================================================================
+! 7.4 FINALISATION DU TERME SOURCE EXPLICITE
+!===============================================================================
+
+ if (idiver.ge.0) then
+
+!--> Integration volumique du terme source explicite
+! Le resultat de cette integration DOIT etre le meme que l'integration
+! surfacique de la densite de flux net radiatif faite plus haut
+! si IDIVER = 1 ou 2
+
+ aa = zero
+ do iel = 1,ncel
+ aa = aa + propce(iel,ipproc(itsre(1))) * volume(iel)
+ enddo
+ if(irangp.ge.0) then
+ call parsom(aa)
+ endif
+ write(nfecra,5040) aa
+ write(nfecra,5050)
+ write(nfecra,5000)
+
+!--> Correction du terme source explicite si
+! la variable transportee est la temperature
+! (il faudra multiplier ce terme par VOLUME(IEL) dans COVOFI->RAYSCA)
+
+ if (abs(iscsth(iscalt(irapha))).eq.1) then
+ do iel = 1,ncel
+ propce(iel,ipproc(itsre(1))) = &
+ propce(iel,ipproc(itsre(1))) * w9(iel)
+ enddo
+ endif
+
+ else
+ write(nfecra,5000)
+ endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 FORMAT (/, 3X,'** INFORMATIONS SUR LE TERME SOURCE RADIATIF',/, &
+ 3X,' -----------------------------------------' )
+ 1100 FORMAT (/, 3X,' Calcul effectue en rayonnement transparent' ,/)
+
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE RAYONNEMENT EST ACTIVE AVEC LE MODELE DOM. ',/,&
+'@ LA VALEUR MINIMALE DU COEFFICIENT D ABSORPTION A EST ',/,&
+'@ EGALE A ', E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE RAYONNEMENT EST ACTIVE AVEC LE MODELE P-1. ',/,&
+'@ LE COEFFICIENT D''ABSORBTION DOIT ETRE STRICTEMENT ',/,&
+'@ SUPERIEUR A ZERO. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ CONDITIONS AUX LIMITES MAL RENSEIGNEES ',/,&
+'@ ',/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' Type = ',I10 )
+ 3100 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ LES COEFFICIENTS DE CONDITIONS AUX LIMITES (COFRUA) ',/,&
+'@ NE SONT PAS RENSEIGNES POUR CERTAINES ',/,&
+'@ FACES DE BORD (Phase ',I10 ,') ',/,&
+'@ ',/,&
+'@ Valeur minimale COFRUA ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage de usray5. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3200 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ LES COEFFICIENTS DE CONDITIONS AUX LIMITES (COFRUB) ',/,&
+'@ NE SONT PAS RENSEIGNES POUR CERTAINES ',/,&
+'@ FACES DE BORD (Phase ',I10 ,') ',/,&
+'@ ',/,&
+'@ Valeur minimale COFRUB ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage de usray5. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3500 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE RAYONNEMENT EST ACTIVE. ',/,&
+'@ ',/,&
+'@ Le scalaire ',I10 ,' devrait etre la temperature ou ',/,&
+'@ l''enthalpie. On a ISCSTH = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4000 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT (FLUNET NON RENSEIGNE) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' Type = ',I10 )
+ 4100 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ LE FLUNET N''EST PAS RENSEIGNEE POUR CERTAINES ',/,&
+'@ FACES DE BORD (Phase ',I10 ,') ',/,&
+'@ ',/,&
+'@ Valeur minimale ',E14.5 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage de usray5. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 5000 format('-----------------------------------------------------', &
+ '--------------')
+
+ 5010 format('Zone Flux net radiatif (Watt) (normale', &
+ ' unitaire sortante)')
+
+ 5020 format(i6,13x,e10.4)
+
+ 5030 format('Flux net radiatif sur toutes les frontieres Fnet = ', &
+ E10.4,' Watt')
+
+ 5040 format('Int�grale volumique du terme source radiatif Srad = ', &
+ E10.4,' Watt')
+
+ 5050 format('(Si IDIVER = 1 ou 2 alors on doit avoir Srad = -Fnet)')
+
+ 6000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT APPROXIMATION P-1 (RAYDOM) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ LA LONGUEUR OPTIQUE DU MILIEU SEMI-TRANSPARENT ',/,&
+'@ DOIT AU MOINS ETRE DE L''ORDRE DE L''UNITE POUR ETRE ',/,&
+'@ DANS LE DOMAINE D''APPLICATION DE L''APPROXIMATION P-1',/,&
+'@ CELA NE SEMBLE PAS ETRE LE CAS ICI. ',/,&
+'@ ',/,&
+'@ LE COEFFICIENT D''ABSORPTION MINIMUM POUR ASSURER CETTE ',/,&
+'@ LONGUEUR OPTIQUE EST XKMIN = ',E10.4 ,/,&
+'@ CETTE VALEUR N''EST PAS ATTEINTE POUR ', E10.4,'% ',/,&
+'@ DES CELLULES DU MAILLAGE. ',/,&
+'@ LE POURCENTAGE DE CELLULES DU MAILLAGE POUR LESQUELLES ',/,&
+'@ ON ADMET QUE CETTE CONDITION SOIT VIOLEE EST IMPOSE ',/,&
+'@ PAR DEFAUT OU DANS USINI1 A XNP1MX = ', E10.4,'% ',/,&
+'@ ',/,&
+'@ Verifier les valeurs du coefficient d''absorption CK ',/,&
+'@ dans l''interface ou le modifier dans USRAY3. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+end
+
diff --git a/src/rayt/raylec.f90 b/src/rayt/raylec.f90
new file mode 100644
index 0000000..25befc2
--- /dev/null
+++ b/src/rayt/raylec.f90
@@ -0,0 +1,390 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raylec &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idevel , ituser , ia , &
+ propce , propfb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! Lecture du fichier suite au 1er passage
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "pointe.h"
+include "entsor.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nideve , nrdeve , nituse , nrtuse
+
+integer idevel(nideve), ituser(nituse), ia(*)
+
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+double precision propce(ncelet,*)
+double precision propfb(nfabor,*)
+!
+! VARIABLES LOCALES
+
+character rubriq*64
+character cphase(nphsmx)*2
+integer idebia, idebra
+integer iok
+
+integer jphast
+integer ncelok , nfaiok , nfabok , nsomok
+integer ierror , irtyp , itysup , nbval
+integer ilecec , nberro , ivers
+integer impamr
+
+!===============================================================================
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. LECTURE DU FICHIER SUITE
+!===============================================================================
+
+if (isuird.eq.1) then
+
+! ---> Ouverture
+
+ write(nfecra,6000)
+
+! (ILECEC=1:lecture)
+ ilecec = 1
+ call opnsui(ficamr,len(ficamr),ilecec,impamr,ierror)
+ !==========
+ if (ierror.ne.0) then
+ write(nfecra,9011) ficamr
+ call csexit (1)
+ endif
+
+ write(nfecra,6010)
+
+
+! ---> Type de fichier suite
+! Pourrait porter le numero de version si besoin.
+! On ne se sert pas de IVERS pour le moment
+
+ itysup = 0
+ nbval = 1
+ irtyp = 1
+ RUBRIQ = 'version_fichier_suite_rayonnement'
+ call lecsui(impamr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ ivers,ierror)
+
+ if (ierror.ne.0) then
+ write(nfecra,9200)ficamr
+ call csexit (1)
+ endif
+
+
+! ---> Tests
+
+ iok = 0
+
+! Dimensions des supports
+
+ call tstsui(impamr,ncelok,nfaiok,nfabok,nsomok)
+ !==========
+ if (ncelok.eq.0) then
+ write(nfecra,9210)
+ iok = iok + 1
+ endif
+ if (nfabok.eq.0) then
+ write(nfecra,9211)
+ iok = iok + 1
+ endif
+
+
+! ---> Pour test ulterieur si pb : arret
+
+ nberro = 0
+
+! ---> Lecture des donnees
+
+! Aux faces de bord
+
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tparoi_fb'
+ call lecsui(impamr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(itparo)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'qincid_fb'
+ call lecsui(impamr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(iqinci)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'hfconv_fb'
+ call lecsui(impamr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(ihconv)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'flconv_fb'
+ call lecsui(impamr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(ifconv)),ierror)
+ nberro=nberro+ierror
+
+
+! Aux cellules
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'rayimp_ce'
+ call lecsui(impamr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(itsri(1))),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'rayexp_ce'
+ call lecsui(impamr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(itsre(1))),ierror)
+ nberro=nberro+ierror
+
+
+! ---> Si pb : arret
+
+ if(nberro.ne.0) then
+ write(nfecra,9100)
+ call csexit (1)
+ endif
+
+ write(nfecra,6011)
+
+! ---> Fermeture du fichier suite
+
+ call clssui(impamr,ierror)
+
+ if (ierror.ne.0) then
+ write(nfecra,8011) ficamr
+ endif
+
+ write(nfecra,6099)
+
+! Fin d�tection suite rayonnement
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1110 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : LECTURE DU FICHIER SUITE RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ DONNEES AMONT ET ACTUELLES DIFFERENTES ',/,&
+'@ ',/,&
+'@ Le de phases qui rayonnent a ete modifie ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier le fichier suite rayonnement. ',/,&
+'@ ',/,&
+'@ NPHAS ',/,&
+'@ AMONT : ',I10 ,/,&
+'@ ACTUEL: ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 6000 FORMAT ( 3X,'** INFORMATIONS SUR LE MODULE DE RAYONNEMENT ',/,&
+ 3X,' ------------------------------------------ ',/,&
+ 3X,' Lecture d''un fichier suite ' )
+ 6010 FORMAT ( 3X,' Debut de la lecture ' )
+ 6011 FORMAT ( 3X,' Fin de la lecture ' )
+ 6099 FORMAT ( 3X,' Fin de la lecture du fichier suite ',/,&
+' ',/,&
+'-------------------------------------------------------------',/)
+
+ 8011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= RAYONNEMENT ',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= RAYONNEMENT ',/,&
+'@ ERREUR A L''OUVERTURE DU FICHIER SUITE ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Verifier l''existence et le nom (',A13,') du ',/,&
+'@ fichier suite dans le repertoire de travail. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/)
+ 9200 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= RAYONNEMENT',/,&
+'@ TYPE DE FICHIER INCORRECT ',/,&
+'@ ',/,&
+'@ Le fichier ',A13 ,' ne semble pas etre un fichier ',/,&
+'@ suite rayonnement. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier que le fichier suite utilise correspond bien ',/,&
+'@ a un fichier suite rayonnement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9210 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= RAYONNEMENT ',/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de cellules a ete modifie ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9211 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= RAYONNEMENT ',/,&
+'@ DONNEES AMONT ET ACTUELLES INCOHERENTES ',/,&
+'@ ',/,&
+'@ Le nombre de faces de bord a ete modifie ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: ARRET A LA LECTURE DU FICHIER SUITE ',/,&
+'@ ========= RAYONNEMENT ',/,&
+'@ ERREUR LORS DE LA LECTURE DES DONNEES ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/rayt/rayopt.f90 b/src/rayt/rayopt.f90
new file mode 100644
index 0000000..0f4490b
--- /dev/null
+++ b/src/rayt/rayopt.f90
@@ -0,0 +1,792 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine rayopt
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! 1) Initialisation par defaut du parametrage du module de
+! transferts thermiques radiatifs
+! 2) Lecture du parametrage utilisateur
+! 3) Controle de coherence avec les physiques particulieres
+! 4) Verifications du parametrage utilisateur
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer ii, jj, iphas, iok , iiscal, iscaok, ipp, iph, nmodpp, iverif
+character car4*4
+character*2 num
+
+!===============================================================================
+!===============================================================================
+! 0. REDEFINITION DU NOMBRE DE PHASES POUR LE CHARBON PULVERISE
+!===============================================================================
+
+!--> nphasc: for pulverized coal and fuel combustion:
+! nphasc = 1 (gaz) + number of classes (particles or droplets)
+
+!--> For pulverized coal and fuel combustion:
+if ( ippmod(icp3pl) .ge. 0 ) then
+ nphasc = 1 + nclacp
+else if ( ippmod(icfuel) .ge. 0 ) then
+ nphasc = 1 + nclafu
+else
+ nphasc = 1
+endif
+
+nmodpp = 0
+do ipp = 2, nmodmx
+ if (ippmod(ipp).ne.-1) then
+ nmodpp = nmodpp+1
+ endif
+enddo
+
+!===============================================================================
+! 1. INITIALISATIONS PAR DEFAUT DU MODULE DE TRANSFERTS RADIATIFS
+! ^^^^^^
+!===============================================================================
+
+
+!--> IIRAYO = 0 : PAS DE TRANSFERTS RADIATIFS
+! = 1 : TRANSFERTS RADIATIFS, METHODE DES ORDONNEES DISCRETES
+! = 2 : TRANSFERTS RADIATIFS, APPROXIMATION P-1
+! On initialise a -1 pour montrer que ce n'est pas initialise ...
+! (on fera un test apres usray1)
+iirayo = -1
+
+!--> IRAPHA : NUMERO DE LA PHASE POUR LAQUELLE ON FAIT DU RAYONNEMENT
+
+irapha = 1
+
+!--> CALCUL DU COEFFICIENT D'ABSORPTION
+! IMODAK = 0 : sans utiliser modak
+! 1 : a l'aide modak
+
+imodak = 0
+
+!--> INDICATEUR SUITE DE CALCUL (LECTURE DU FICHIER SUITE)
+
+isuird = -1
+
+!--> FREQUENCE DE PASSAGE DANS LE MODULE RAYONNEMENT
+
+nfreqr = -1
+
+!--> NOMBRE DE DIRECTIONS : 32 OU 128
+
+ndirec = -1
+
+!--> NOMBRE DE BANDES SPECTRALES (PAS UTILISE)
+
+nbande = 1
+
+!--> POURCENTAGE DE CELLULES OU L'ON ADMET QUE LA LONGUEUR OPTIQUE DEPASSE
+! L'UNITE POUR LE MODELE P-1
+
+xnp1mx = 10.d0
+
+!--> INITIALISATION DU MODE DE CALCUL DU TERME SOURCE RADIATIF EXPLICITE
+! IDIVER = 0 => CALCUL SEMI-ANALYTIQUE (OBLIGATOIRE SI TRANSPARENT)
+! IDIVER = 1 => CALCUL CONSERVATIF
+! IDIVER = 2 => CALCUL SEMI-ANALYTIQUE CORRIGE POUR ETRE CONSERVATIF
+! REMARQUE : SI TRANSPARENT IDIVER = -1 AUTOMATIQUEMENT DANS RAYDOM
+
+idiver = -1
+
+!--> NIVEAU D'AFFICHAGE (0,1,2) DES RENSEIGNEMENTS TEMPERATURE DE PAROI
+
+iimpar = -1
+
+!--> NIVEAU D'AFFICHAGE (0,1,2) DES RENSEIGNEMENTS RESOLUTION LUMINANCE
+
+iimlum = -1
+
+! - Interface Code_Saturne
+! ======================
+
+if (iihmpr.eq.1) then
+
+ call uiray1(iirayo, isuird, ndirec, nfreqr, idiver, iimpar, iimlum)
+ !==========
+
+endif
+
+call usray1
+!==========
+
+!===============================================================================
+! 2. VERIFICATION LA COHERENCE D'UTILISATION DU MODULE DE RAYONNEMENT
+! AVEC LA THERMIQUE OU LES PHYSIQUES PARTICULIERES (COMBUSTION)
+!===============================================================================
+
+iok = 0
+
+!--> IIRAYO = 0 (pas de rayonnement).
+
+if(iirayo.eq.-1) then
+ iirayo = 0
+endif
+
+if (iirayo.ne.0 .and. iirayo.ne.1 .and. iirayo.ne.2) then
+ write(nfecra,1010) iirayo
+ iok = iok + 1
+endif
+
+if (imodak.ne.0 .and. imodak.ne.1) then
+ write(nfecra,1020) imodak
+ iok = iok + 1
+endif
+
+!--> ISCSTH
+
+! Si physique particuliere avec fichier parametrique,
+! ISCSTH a ete renseigne
+! dans ppini1 ou coini1 (a verifier en elec).
+! Si physique classique et ISCSTH pas modifie dans USRAY1
+! ou pas de variable thermique
+! STOP.
+
+if(ippmod(iphpar).ge.2) then
+
+! Il y a une seule phase ; si on rayonne
+ if (iirayo.eq.1 .or. iirayo.eq.2) then
+! On cherche s'il y a un scalaire thermique
+ iscaok = 0
+ do iiscal = 1, nscal
+ if (iiscal.eq.iscalt(irapha)) then
+ iscaok = 1
+! Et on regarde si on a dit enthalpie
+ if (iscsth(iiscal).ne.2) then
+ write(nfecra,3000) irapha,iiscal,iiscal
+ iok = iok + 1
+ endif
+ endif
+ enddo
+ if (iscaok.eq.0) then
+ write(nfecra,3001) irapha,irapha
+ iok = iok + 1
+ endif
+ endif
+
+else
+
+! Pour la phase qui rayonne
+ if (iirayo.eq.1 .or. iirayo.eq.2) then
+
+! On cherche s'il y a un scalaire thermique
+ iscaok = 0
+ do iiscal = 1, nscal
+ if (iiscal.eq.iscalt(irapha)) then
+ iscaok = 1
+
+! Et on regarde si on a dit temp C, K ou enthalpie
+ if (abs(iscsth(iiscal)).ne.1.and. &
+ iscsth(iiscal) .ne.2 ) then
+ write(nfecra,3010) irapha,iiscal,iiscal
+ iok = iok + 1
+ endif
+
+ endif
+ enddo
+ if(iscaok.eq.0)then
+ write(nfecra,3011)irapha,irapha
+ iok = iok + 1
+ endif
+
+ endif
+
+endif
+
+!--> Stop si erreur.
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ IIRAYO NE PEUT PRENDRE POUR VALEURS QUE 0 1 OU 2 ',/,&
+'@ IIRAYO vaut ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Arret dans rayopt. ',/,&
+'@ Verifier usray1 ou l''interface graphique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ IMODAK NE PEUT PRENDRE POUR VALEURS QUE 0 OU 1 ',/,&
+'@ IMODAK vaut',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Arret dans rayopt. ',/,&
+'@ Verifier usray1 ou l''interface graphique. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ACTIVEE : ENTHALPIE NECESSAIRE ',/,&
+'@ ',/,&
+'@ Avec rayonnement, pour la phase ',I10 ,', il faut ',/,&
+'@ preciser la variable energetique representee par le ',/,&
+'@ scalaire ',I10 ,' en renseignant ISCSTH(',I10 ,') ',/,&
+'@ dans usini1 : soit ',/,&
+'@ -1 temperature en C ',/,&
+'@ 1 temperature en K ',/,&
+'@ 2 enthalpie ',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Avec physique particuliere, cette initialisation aurait ',/,&
+'@ du etre automatique. ~~~~~~ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ PHYSIQUE PARTICULIERE ACTIVEE : ENTHALPIE NECESSAIRE ',/,&
+'@ ',/,&
+'@ Lorsque le rayonnement est utilise (phase ',I10 ,'), il ',/,&
+'@ faut indiquer qu''un scalaire represente la variable ',/,&
+'@ energetique (enthalpie) en renseignant ',/,&
+'@ ISCALT(',I10 ,') dans usini1 (numero du scalaire). ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Avec physique particuliere, cette initialisation aurait ',/,&
+'@ du etre automatique. ~~~~~~ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ ISCSTH DOIT ETRE RENSEIGNE OBLIGATOIREMENT DANS USINI1 ',/,&
+'@ ',/,&
+'@ Avec rayonnement, pour la phase ',I10 ,', il faut ',/,&
+'@ preciser la variable energetique representee par le ',/,&
+'@ scalaire ',I10 ,' en renseignant ISCSTH(',I10 ,') ',/,&
+'@ dans usini1 : soit ',/,&
+'@ -1 temperature en C ',/,&
+'@ 1 temperature en K ',/,&
+'@ 2 enthalpie ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ IL FAUT UTILISER UNE VARIABLE ENERGETIQUE. ',/,&
+'@ ',/,&
+'@ Lorsque le rayonnement est utilise (phase ',I10 ,', il ',/,&
+'@ faut indiquer qu''un scalaire represente la variable ',/,&
+'@ energetique (temperature ou enthalpie) en renseignant ',/,&
+'@ ISCALT(',I10 ,') dans usini1 (numero du scalaire). ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usini1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 3. VERIFICATIONS (uniquement s'il y a du rayonnement)
+!===============================================================================
+
+iok = 0
+
+if (iirayo.gt.0) then
+
+! Positionnement des pointeurs
+! 5eme passage (les autres sont dans iniusi)
+
+ call varpos(nmodpp)
+ !==========
+
+! --> ISUIRD
+
+ if (isuird.ne.0 .and. isuird.ne.1 ) then
+ write(nfecra,4000) isuird
+ iok = iok + 1
+ endif
+
+! --> NFREQR
+
+ if (nfreqr.le.0) then
+ write(nfecra,4010) nfreqr
+ iok = iok + 1
+ endif
+
+! --> NDIREC
+! Choix entre 32 et 128 directions (cf raysol)
+ if (ndirec.ne.32 .and. ndirec.ne.128 ) then
+ write(nfecra,4020) ndirec
+ iok = iok + 1
+ endif
+
+! --> IDIVER
+! Choix entre 0 1 et 2
+ if (idiver.ne.0 .and. idiver.ne.1 .and. idiver.ne.2) then
+ write(nfecra,4030) idiver
+ iok = iok + 1
+ endif
+
+! --> IIMPAR
+! Choix entre 0 1 et 2
+ if (iimpar.ne.0 .and. iimpar.ne.1 .and. iimpar.ne.2) then
+ write(nfecra,4040) iimpar
+ iok = iok + 1
+ endif
+
+! --> IIMLUM
+! Choix entre 0 1 et 2
+ if (iimlum.ne.0 .and. iimlum.ne.1 .and. iimlum.ne.2) then
+ write(nfecra,4050) iimlum
+ iok = iok + 1
+ endif
+
+else
+ return
+endif
+
+!--> Stop si erreur.
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+!===============================================================================
+! 5. POST-PROCESSING
+!===============================================================================
+
+!--> INITIALISATION DES DONNEES POST-PROCESSING
+! NBRAYF : NOMBRE MAX DES SORTIES DE VARIABLES FACETTES DE BORD
+
+do ii = 1, nbrayf
+ WRITE(CAR4,'(I4.4)') II
+ NBRVAF(II) = 'RAYTFB'//CAR4
+ irayvf(ii) = 0
+enddo
+
+!--> LUMINENCE
+
+ipp = ipppro(ipproc(ilumin))
+NOMVAR(IPP) = 'Lumin'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = 0
+ilisvr(ipp) = 0
+
+!--> VECTEUR DENSITE DE FLUX RADIATIF
+
+! composante x
+ipp = ipppro(ipproc(iqx))
+NOMVAR(IPP) = 'Qxrad'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = -1
+ilisvr(ipp) = 0
+
+! composante y
+ipp = ipppro(ipproc(iqy))
+NOMVAR(IPP) = 'Qyrad'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = -1
+ilisvr(ipp) = 0
+
+! composante z
+ipp = ipppro(ipproc(iqz))
+NOMVAR(IPP) = 'Qzrad'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = -1
+ilisvr(ipp) = 0
+
+!--> TERME SOURCE IMPLICITE
+
+ipp = ipppro(ipproc(itsri(1)))
+NOMVAR(IPP) = 'ITSRI'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = 0
+ilisvr(ipp) = 0
+
+!--> TERME SOURCE RADIATIF (ANALYTIQUE/CONSERVATIF/SEMI-ANALYTIQUE)
+
+ipp = ipppro(ipproc(itsre(1)))
+NOMVAR(IPP) = 'Srad'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = -1
+ilisvr(ipp) = 0
+
+!--> PART DE L'ABSORPTION DANS LE TERME SOURCE RADIATIF
+
+ipp = ipppro(ipproc(iabs(1)))
+NOMVAR(IPP) = 'Absorp'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = -1
+ilisvr(ipp) = 0
+
+!--> PART DE L'EMISSION DANS LE TERME SOURCE RADIATIF
+
+ipp = ipppro(ipproc(iemi(1)))
+NOMVAR(IPP) = 'Emiss'
+ichrvr(ipp) = 0
+ihisvr(ipp,1) = -1
+ilisvr(ipp) = 0
+
+!--> COEFFICIENT D'ABSORPTION DU MILIEU SEMI-TRANSPARENT
+
+ipp = ipppro(ipproc(icak(1)))
+NOMVAR(IPP) = 'CoefAb'
+ichrvr(ipp) = 0
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+
+do iphas = 1, nphasc-1
+
+ WRITE(NUM,'(I1)') IPHAS
+
+!--> TERME SOURCE IMPLICITE
+
+ ipp = ipppro(ipproc(itsri(iphas)))
+ NOMVAR(IPP) = 'ITSRI_'//NUM
+ ichrvr(ipp) = 0
+ ihisvr(ipp,1) = 0
+ ilisvr(ipp) = 0
+
+
+!--> TERME SOURCE RADIATIF (ANALYTIQUE/CONSERVATIF/SEMI-ANALYTIQUE)
+
+ ipp = ipppro(ipproc(itsre(iphas)))
+ NOMVAR(IPP) = 'Srad_'//NUM
+ ichrvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+ ilisvr(ipp) = 0
+
+!--> PART DE L'ABSORPTION DANS LE TERME SOURCE RADIATIF
+
+ ipp = ipppro(ipproc(iabs(iphas)))
+ NOMVAR(IPP) = 'Absorp_'//NUM
+ ichrvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+ ilisvr(ipp) = 0
+
+!--> PART DE L'EMISSION DANS LE TERME SOURCE RADIATIF
+
+ ipp = ipppro(ipproc(iemi(iphas)))
+ NOMVAR(IPP) = 'Emiss_'//NUM
+ ichrvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+ ilisvr(ipp) = 0
+
+!--> COEFFICIENT D'ABSORPTION DU MILIEU SEMI-TRANSPARENT
+
+ ipp = ipppro(ipproc(icak(iphas)))
+ NOMVAR(IPP) = 'CoefAb_'//NUM
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+enddo
+
+!===============================================================================
+! 6. INITIALISATIONS UTILISATEURS
+! ^^^^^^^^^^^^
+!===============================================================================
+
+! - Code_Saturne GUI
+! ================
+
+if (iihmpr.eq.1) then
+
+ ! properties on boundaries
+ do ii = 1, nbrayf
+ call fcnmra(nbrvaf(ii), len(nbrvaf(ii)), ii)
+ enddo
+
+ call uiray4(nbrayf, nphas, iirayo, irayvf)
+ !==========
+
+ do ii = 1, nbrayf
+ call cfnmra(nbrvaf(ii), len(nbrvaf(ii)), ii)
+ enddo
+
+ ! properties on cells
+ do ii = 1,nvppmx
+ call fcnmva (nomvar(ii), len(nomvar(ii)), ii)
+ !==========
+ enddo
+
+ call csenso &
+ !==========
+ ( nvppmx, ncapt, nthist, ntlist, &
+ ichrvl, ichrbo, ichrsy, ichrmd, &
+ fmtchr, len(fmtchr), optchr, len(optchr), &
+ ntchr, iecaux, &
+ ipstdv, ipstyp, ipstcl, ipstft, ipstfo, &
+ ichrvr, ilisvr, ihisvr, isca, iscapp, &
+ ipprtp, xyzcap )
+
+ do ii = 1,nvppmx
+ call cfnmva(nomvar(ii), len(nomvar(ii)), ii)
+ !==========
+ enddo
+
+ call nvamem
+ !==========
+
+ ! take into acount users modifications by subroutine usini1
+ iverif = 0
+ call usipes(nmodpp, iverif)
+ !==========
+
+endif
+
+call usray1
+!==========
+
+! --> IRAYVF
+! Choix entre -1 et 1
+if (iirayo.eq.1 .or. iirayo.eq.2) then
+ do ii = 1, nbrayf
+ if (irayvf(ii).ne.1 .and. irayvf(ii).ne.-1) then
+ write(nfecra,4070) nbrvaf(ii), irayvf(ii)
+ iok = iok + 1
+ endif
+ enddo
+endif
+
+!--> Stop si erreur.
+
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+ 4000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INDICATEUR DE SUITE DE CALCUL NON ADMISSIBLE ',/,&
+'@ ',/,&
+'@ L''indicateur de suite de calcul doit etre 0 ou 1 (ISUIRD)',/,&
+'@ Il vaut ici ISUIRD = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ FREQUENCE DE PASSAGE DANS LE MODULE DE RAYONNEMENT ',/,&
+'@ NON ADMISSIBLE ',/,&
+'@ ',/,&
+'@ La frequence de passage doit etre superieure ou egale a 1 ',/,&
+'@ Elle vaut ici NFREQR = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ NOMBRE DE DIRECTIONS NON ADMISSIBLE ',/,&
+'@ ',/,&
+'@ Le nombre de directions doit etre 32 ou 128 (NDIREC) ',/,&
+'@ Il vaut ici NDIREC = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ INDICATEUR DU MODE DE CALCUL DU TERME SOURCE RADIATIF ',/,&
+'@ EXPLICITE NON ADMISSIBLE ',/,&
+'@ ',/,&
+'@ L''indicateur du mode de calcul doit etre 0, 1 ou 2 ',/,&
+'@ Il vaut ici IDIVER = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4040 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ERREUR A L''ENTREE DES DONNEES',/,&
+'@ ========= ',/,&
+'@ NIVEAU D''AFFICHAGE DES RENSIGNEMENTS DES ',/,&
+'@ TEMPERATURE DE PAROI NON ADMISSIBLE ',/,&
+'@ ',/,&
+'@ Le niveau d''affichage doit etre 0, 1 ou 2 (IIMPAR) ',/,&
+'@ Il vaut ici IIMPAR = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4050 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ERREUR A L''ENTREE DES DONNEES',/,&
+'@ ========= ',/,&
+'@ NIVEAU D''AFFICHAGE DES RENSIGNEMENTS SUR LA ',/,&
+'@ RESOLUTION DE LA LUMINANCE NON ADMISSIBLE ',/,&
+'@ ',/,&
+'@ Le niveau d''affichage doit etre 0, 1 ou 2 (IIMLUM) ',/,&
+'@ Il vaut ici IIMLUM = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4070 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT : ERREUR A L''ENTREE DES DONNEES',/,&
+'@ ========= ',/,&
+'@ INDICATEUR DE SORTIE EN POSTPROCESSING ',/,&
+'@ POUR ',A40 ,/,&
+'@ NON ADMISSIBLE ',/,&
+'@ ',/,&
+'@ L''indicateur de postprocessing doit etre -1 ou 1 ',/,&
+'@ Il vaut ici IRAYVF = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray1. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+return
+
+end
diff --git a/src/rayt/rayout.f90 b/src/rayt/rayout.f90
new file mode 100644
index 0000000..1201b79
--- /dev/null
+++ b/src/rayt/rayout.f90
@@ -0,0 +1,453 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine rayout &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE RAYONNEMENT :
+! --------------------------------------
+
+! 1) ECRITURE FICHIER SUITE,
+! 2) Ecriture des fichiers Ensight pour les sorties sur les
+! frontieres du domaine de calcul
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! longueur du tableau icocel (optionnel !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ! ! ! le module lagrangien !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+include "parall.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nideve , nrdeve , nituse , nrtuse
+integer nvar , nscal , nphas , iph
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character rubriq*64
+character cphase(nphsmx)*2
+integer idebia , idebra
+integer ifinia , ifinra
+integer itrav1 , ip
+integer ierror , nberro , irtyp , itysup , nbval
+integer ivers , ilecec
+integer impavr
+
+!===============================================================================
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. ECRITURE DU FICHIER SUITE DU MODULE DE RAYONNEMENT
+!===============================================================================
+
+
+! ---> Ouverture (et on saute si erreur)
+! ILECEC = 2 : ecriture
+
+write(nfecra,6010)
+
+ilecec = 2
+call opnsui(ficavr, len(ficavr), ilecec, impavr, ierror)
+!==========
+if (ierror.ne.0) then
+ write(nfecra,9020)
+ goto 9998
+endif
+
+write(nfecra,6011)
+
+! Entete et Dimensions ou on saute si erreur
+! On inclut une rubrique destinee a distinguer ce fichier
+! d'un autre fichier suite
+! Pour le moment, IVERS n'est pas utilise
+
+nberro = 0
+
+ivers = 111
+itysup = 0
+nbval = 1
+irtyp = 1
+RUBRIQ = 'version_fichier_suite_rayonnement'
+call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp,ivers, &
+ ierror)
+nberro=nberro+ierror
+
+itysup = 0
+nbval = 1
+irtyp = 1
+
+if(nberro.ne.0) then
+ write(nfecra,9120)
+ goto 9998
+endif
+
+write(nfecra,6012)
+
+! Temps (par securite)
+
+nberro = 0
+
+RUBRIQ = 'nbre_pas_de_temps'
+itysup = 0
+nbval = 1
+irtyp = 1
+call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp,ntcabs, &
+ ierror)
+nberro=nberro+ierror
+
+RUBRIQ = 'instant_precedent'
+itysup = 0
+nbval = 1
+irtyp = 2
+call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp,ttcabs, &
+ ierror)
+nberro=nberro+ierror
+
+if(nberro.ne.0) then
+ write(nfecra,8121)
+endif
+
+! Donnees
+
+nberro = 0
+
+! Aux faces de bord
+
+ itysup = 3
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'tparoi_fb'
+ call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(itparo)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'qincid_fb'
+ call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(iqinci)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'hfconv_fb'
+ call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(ihconv)),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'flconv_fb'
+ call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propfb(1,ipprob(ifconv)),ierror)
+ nberro=nberro+ierror
+
+
+! Aux cellules
+
+ itysup = 1
+ nbval = 1
+ irtyp = 2
+
+ RUBRIQ = 'rayimp_ce'
+ call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(itsri(1))),ierror)
+ nberro=nberro+ierror
+
+ RUBRIQ = 'rayexp_ce'
+ call ecrsui(impavr,rubriq,len(rubriq),itysup,nbval,irtyp, &
+ propce(1,ipproc(itsre(1))),ierror)
+ nberro=nberro+ierror
+
+! ---> Si pb : on saute
+
+if(nberro.ne.0) then
+ write(nfecra,9100)
+ goto 9998
+endif
+
+write(nfecra,6013)
+
+! ---> Fermeture du fichier suite
+call clssui(impavr,ierror)
+
+if (ierror.ne.0) then
+ write(nfecra,8011) ficavr
+endif
+
+write(nfecra,6014)
+
+! ---> En cas d'erreur, on continue quand meme
+ 9998 continue
+
+
+return
+
+
+!--------
+! FORMATS
+!--------
+
+ 6010 FORMAT (/, 3X,'** INFORMATIONS SUR LE MODULE DE RAYONNEMENT ',/, &
+ 3X,' ------------------------------------------',/, &
+ 3X,' Ecriture d''un fichier suite ',/)
+
+ 6011 FORMAT ( 3X,' Debut de l''ecriture ',/)
+ 6012 FORMAT ( 3X,' Fin de l''ecriture des dimensions ',/)
+ 6013 FORMAT ( 3X,' Fin de l''ecriture des donnees ',/)
+ 6014 FORMAT ( 3X,' Fin de l''ecriture du fichier suite ',/)
+
+ 9020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ ERREUR A L''OUVERTURE DU FICHIER SUITE RAYONNEMENT ',/,&
+'@ ',/,&
+'@ Le calcul continue mais ',/,&
+'@ ne fournira pas de fichier suite rayonnement. ',/,&
+'@ ',/,&
+'@ Verifier que le repertoire de travail est accessible en ',/,&
+'@ ecriture et que le fichier suite peut y etre cree. ',/,&
+'@ Voir le sous-programme rayout. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9120 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR LORS DE L''ECRITURE DES DIMENSIONS ',/,&
+'@ ',/,&
+'@ Le calcul continue mais ',/,&
+'@ ne fournira pas de fichier suite rayonnement. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme rayout. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8121 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR LORS DE L''ECRITURE DU PAS DE TEMPS ET DU TEMPS',/,&
+'@ ',/,&
+'@ Le calcul continue... ',/,&
+'@ ',/,&
+'@ Voir le sous-programme rayout. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9100 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION: A L''ECRITURE DU FICHIER SUITE RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ ERREUR LORS DE L''ECRITURE DES DONNEES ',/,&
+'@ ',/,&
+'@ Le calcul continue mais ',/,&
+'@ ne fournira pas de fichier suite rayonnement. ',/,&
+'@ ',/,&
+'@ Voir le sous-programme rayout. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8011 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR A LA FERMETURE DU FICHIER SUITE ',/,&
+'@ ========= AVAL RAYONNMEMENT',/,&
+'@ ',/,&
+'@ Probleme sur le fichier de nom (',A13,') ',/,&
+'@ ',/,&
+'@ Le calcul se poursuit... ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 7000 format( &
+' ',/,&
+' Module de rayonnement : ',/,&
+' Ecriture du fichier Ensight de bord non disponible ',/,&
+' en parallele. ',/,&
+' ',/)
+
+!----
+! FIN
+!----
+
+end
diff --git a/src/rayt/raypar.f90 b/src/rayt/raypar.f90
new file mode 100644
index 0000000..485ac6d
--- /dev/null
+++ b/src/rayt/raypar.f90
@@ -0,0 +1,1001 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raypar &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , isothp , izfrap , &
+ idevel , ituser , ia , &
+ tmin , tmax , tx , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefa , coefb , &
+ rdevel , rtuser , &
+ tparop , qincip , textp , tintp , &
+ xlamp , epap , epsp , &
+ hfconp , flconp , tempkp , &
+
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+! CALCUL DES TEMPERATURES DE PAROIS AVEC UN BILAN DE FLUX
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iphas ! e ! <-- ! numero de la phase !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! isothp(nfabor ! te ! <-- ! liste des frontieres isothermes !
+! izfrap(nfabor ! te ! <-- ! numero de zone des faces de bord !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! tparop(nfabor ! tr ! --> ! temperature de paroi en kelvin !
+! qincip(nfabor ! tr ! <-- ! densite de flux radiatif aux bords !
+! textp(nfabor) ! tr ! <-- ! temperature de bord externe !
+! ! ! ! en degres celcius !
+! tintp(nfabor) ! tr ! <-- ! temperature de bord interne !
+! ! ! ! en degres celcius !
+! xlamp(nfabor) ! tr ! <-- ! coefficient de conductivite thermique !
+! ! ! ! des facettes de paroi (w/m/k) !
+! epap(nfabor) ! tr ! <-- ! epaisseur des facettes de paroi (m) !
+! epsp(nfabor) ! tr ! <-- ! emissivite des facettes de bord !
+! hfconp(nfabor ! tr ! <-- ! coefficient d'echange fluide aux !
+! ! ! ! faces de bord !
+! flconp(nfabor ! tr ! <-- ! densite de flux convectif aux faces !
+! tempkp(ncelet ! tr ! <-- ! temperature en kelvin !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "ppppar.h"
+include "radiat.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+integer isothp(nfabor), izfrap(nfabor)
+integer icodcl(nfabor,nvar)
+
+double precision tmin , tmax , tx
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision tparop(nfabor), qincip(nfabor)
+double precision textp(nfabor), tintp(nfabor)
+double precision xlamp(nfabor), epap(nfabor), epsp(nfabor)
+double precision hfconp(nfabor) , flconp(nfabor)
+double precision tempkp(ncelet)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+
+integer ivart, ifac, iel, izone
+integer ifacmx, ifacmn
+integer n1min,n1max,nrelax,nmoins,nplus
+integer iitpim,iipgrn,iipref,iifgrn,iifref
+integer indtp(nozrdm)
+integer nbrval, indtpm
+integer nb1int ,nb2int ,nbrrdp
+parameter (nb1int=5,nb2int=5,nbrrdp=5)
+integer inttm1(nb1int),inttm2(nb2int)
+
+double precision esl,epp,sigt3,sigt4
+double precision tpmin,tpmax,rapp,rapmax,abrapp
+double precision qcmax,qrmax
+double precision qcmin,qrmin
+double precision qrayt,qconv,qinci,detep
+double precision surfbn,und0,tp4
+double precision xtpmax,ytpmax,ztpmax,xtpmin,ytpmin,ztpmin
+double precision tzomax(nozrdm),tzomin(nozrdm),tzomoy(nozrdm)
+double precision flunet(nozrdm),radios(nozrdm),surft(nozrdm)
+double precision rdptmp(nbrrdp)
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+
+und0 = 1.d0
+
+ivart = isca(iscalt(iphas))
+
+
+tpmax = -grand
+tpmin = grand
+
+rapmax = 0.d0
+n1min = 0
+n1max = 0
+nrelax = 0
+nmoins = 0
+nplus = 0
+iitpim = 0
+iipgrn = 0
+iipref = 0
+iifgrn = 0
+iifref = 0
+
+ifacmx = 0
+ifacmn = 0
+
+!===============================================================================
+! 2. Decompte du nombre de couleurs differentes de facettes de bord
+! On suppose qu'on en a au moins une
+!===============================================================================
+
+
+do izone = 1, nozrdm
+ indtp (izone) = 0
+ tzomax(izone) = -grand
+ tzomin(izone) = grand
+enddo
+
+!===============================================================================
+! 3. Calcul des temperatures de paroi
+!===============================================================================
+
+! 3.1) parois isothermes
+! ----------------------
+
+
+do ifac = 1, nfabor
+ if (isothp(ifac).eq.itpimp) then
+ izone = izfrap(ifac)
+
+! Calcul
+ tparop(ifac) = tintp(ifac)
+
+! Max-Min
+ qconv = flconp(ifac)
+ qinci = qincip(ifac)
+ sigt4 = stephn*tparop(ifac)**4
+ epp = epsp(ifac)
+ qrayt = epp *( qinci - sigt4 )
+
+ if (tpmax.le.tparop(ifac)) then
+ ifacmx = ifac
+ tpmax = tparop(ifac)
+ qcmax = qconv
+ qrmax = qrayt
+ endif
+
+ if (tpmin.ge.tparop(ifac)) then
+ ifacmn = ifac
+ tpmin = tparop(ifac)
+ qcmin = qconv
+ qrmin = qrayt
+ endif
+
+ tzomax(izone) = max(tzomax(izone),tparop(ifac))
+ tzomin(izone) = min(tzomin(izone),tparop(ifac))
+
+! Reperage pour impression
+ iitpim = 1
+ indtp(izone) = itpimp
+
+
+ endif
+enddo
+
+
+! 3.2) parois grises ou noires (non reflechissantes)
+! --------------------------------------------------
+
+do ifac = 1, nfabor
+ if (isothp(ifac).eq.ipgrno) then
+ izone = izfrap(ifac)
+
+! Calcul
+ esl = epap(ifac) /xlamp(ifac)
+ qconv = flconp(ifac)
+ qinci = qincip(ifac)
+ epp = epsp(ifac)
+
+ sigt3 = stephn*tparop(ifac)**3
+ qrayt = epp *( qinci -sigt3*tparop(ifac))
+
+ detep = ( esl*(qconv+qrayt) - (tparop(ifac)-textp(ifac)) ) &
+ / ( 1.d0+ 4.d0*esl*epp*sigt3 + esl*hfconp(ifac) )
+
+ rapp = detep /tparop(ifac)
+ abrapp = abs(rapp)
+
+! Relaxation
+ if (abrapp.ge.tx) then
+ nrelax = nrelax +1
+ tparop(ifac) = tparop(ifac) * (1.d0+ tx*sign(und0,rapp))
+ else
+ tparop(ifac) = tparop(ifac) + detep
+ endif
+
+ rapmax = max(rapmax,abrapp)
+
+ if (rapp.le.0.d0) then
+ nmoins = nmoins+1
+ else
+ nplus = nplus +1
+ endif
+
+! Clipping
+ if (tparop(ifac).lt.tmin) then
+ n1min = n1min +1
+ tparop(ifac) = tmin
+ endif
+ if (tparop(ifac).gt.tmax) then
+ n1max = n1max +1
+ tparop(ifac) = tmax
+ endif
+
+! Max-Min
+ if (tpmax.le.tparop(ifac)) then
+ ifacmx = ifac
+ tpmax = tparop(ifac)
+ qcmax = qconv
+ qrmax = qrayt
+ endif
+
+ if (tpmin.ge.tparop(ifac)) then
+ ifacmn = ifac
+ tpmin = tparop(ifac)
+ qcmin = qconv
+ qrmin = qrayt
+ endif
+
+ tzomax(izone) = max(tzomax(izone),tparop(ifac))
+ tzomin(izone) = min(tzomin(izone),tparop(ifac))
+
+! Reperage pour impression
+ iipgrn = 1
+ indtp(izone) = ipgrno
+
+ endif
+enddo
+
+
+! 3.3) parois reflechissantes
+! ---------------------------
+
+
+do ifac = 1, nfabor
+ if (isothp(ifac).eq.iprefl) then
+ izone = izfrap(ifac)
+
+! Calcul
+ esl = epap(ifac) /xlamp(ifac)
+ qconv = flconp(ifac)
+
+ detep = ( esl*qconv - (tparop(ifac)-textp(ifac)) ) &
+ / ( 1.d0 + esl*hfconp(ifac) )
+
+ rapp = detep /tparop (ifac)
+ abrapp = abs(rapp)
+
+! Relaxation
+ if (abrapp.ge.tx) then
+ nrelax = nrelax +1
+ tparop(ifac) = tparop(ifac) * (1.d0+ tx*sign(und0,rapp))
+ else
+ tparop(ifac) = tparop(ifac) + detep
+ endif
+
+ rapmax = max(rapmax,abrapp)
+
+ if (rapp.le.0.d0) then
+ nmoins = nmoins+1
+ else
+ nplus = nplus +1
+ endif
+
+! Clipping
+ if (tparop(ifac).lt.tmin) then
+ n1min = n1min +1
+ tparop(ifac) = tmin
+ endif
+ if (tparop(ifac).gt.tmax) then
+ n1max = n1max +1
+ tparop(ifac) = tmax
+ endif
+
+! Max-Min
+ if (tpmax.le.tparop(ifac)) then
+ ifacmx = ifac
+ tpmax = tparop(ifac)
+ qcmax = qconv
+ qrmax = 0.d0
+ endif
+
+ if (tpmin.ge.tparop(ifac)) then
+ ifacmn = ifac
+ tpmin = tparop(ifac)
+ qcmin = qconv
+ qrmin = 0.d0
+ endif
+
+ tzomax(izone) = max(tzomax(izone),tparop(ifac))
+ tzomin(izone) = min(tzomin(izone),tparop(ifac))
+
+! Reperage pour impression
+ iipref = 1
+ indtp(izone) = iprefl
+
+ endif
+enddo
+
+
+
+! 3.4) parois a flux de conduction impose non reflechissante
+! si le flux impose est nul, la paroi est adiabatique
+! (la transmition de chaleur par rayonnement est
+! equilibree avec celle de la convection)
+
+
+do ifac = 1, nfabor
+ if (isothp(ifac).eq.ifgrno) then
+ izone = izfrap(ifac)
+
+! Calcul
+ qconv = flconp(ifac)
+ qinci = qincip(ifac)
+ epp = epsp(ifac)
+
+ sigt3 = stephn*tparop(ifac)**3
+ qrayt = epp *( qinci -sigt3*tparop(ifac))
+
+ detep = ( qconv + qrayt - rcodcl(ifac,ivart,3) ) &
+ / ( 4.d0*epp*sigt3 + hfconp(ifac) )
+
+ rapp = detep /tparop (ifac)
+ abrapp = abs(rapp)
+
+! Relaxation
+ if (abrapp.ge.tx) then
+ nrelax = nrelax +1
+ tparop(ifac) = tparop(ifac) * (1.d0+ tx*sign(und0,rapp))
+ else
+ tparop(ifac) = tparop(ifac) + detep
+ endif
+
+ rapmax = max(rapmax,abrapp)
+
+ if (rapp.le.0.d0) then
+ nmoins = nmoins+1
+ else
+ nplus = nplus +1
+ endif
+
+! Clipping
+ if (tparop(ifac).lt.tmin) then
+ n1min = n1min +1
+ tparop(ifac) = tmin
+ endif
+ if (tparop(ifac).gt.tmax) then
+ n1max = n1max +1
+ tparop(ifac) = tmax
+ endif
+
+! Max-Min
+ if (tpmax.le.tparop(ifac)) then
+ ifacmx = ifac
+ tpmax = tparop(ifac)
+ qcmax = qconv
+ qrmax = qrayt
+ endif
+
+ if (tpmin.ge.tparop(ifac)) then
+ ifacmn = ifac
+ tpmin = tparop(ifac)
+ qcmin = qconv
+ qrmin = qrayt
+ endif
+
+ tzomax(izone) = max(tzomax(izone),tparop(ifac))
+ tzomin(izone) = min(tzomin(izone),tparop(ifac))
+
+! Reperage pour impression
+ iifgrn = 1
+ indtp(izone) = ifgrno
+
+ endif
+enddo
+
+
+! 3.5) parois a flux de conduction imposee et reflechissante
+! equivalent a impose un flux total au fluide
+
+
+
+do ifac = 1, nfabor
+ if (isothp(ifac).eq.ifrefl) then
+ izone = izfrap(ifac)
+
+! Calcul
+ iel = ifabor(ifac)
+
+ tparop(ifac)= hfconp(ifac)*tempkp(iel)-rcodcl(ifac,ivart,3)
+ tparop(ifac)= tparop(ifac)/max(hfconp(ifac),epzero)
+
+! Clipping
+ if (tparop(ifac).lt.tmin) then
+ n1min = n1min +1
+ tparop(ifac) = tmin
+ endif
+ if (tparop(ifac).gt.tmax) then
+ n1max = n1max +1
+ tparop(ifac) = tmax
+ endif
+
+! Max-Min
+ qconv = flconp(ifac)
+ qrayt = 0.d0
+
+ if (tpmax.le.tparop(ifac)) then
+ ifacmx = ifac
+ tpmax = tparop(ifac)
+ qcmax = qconv
+ qrmax = qrayt
+ endif
+
+ if (tpmin.ge.tparop(ifac)) then
+ ifacmn = ifac
+ tpmin = tparop(ifac)
+ qcmin = qconv
+ qrmin = qrayt
+ endif
+
+ tzomax(izone) = max(tzomax(izone),tparop(ifac))
+ tzomin(izone) = min(tzomin(izone),tparop(ifac))
+
+! Reperage pour impression
+ iifref = 1
+ indtp(izone) = ifrefl
+
+ endif
+enddo
+
+
+!===============================================================================
+! 4. IMPRESSIONS
+!===============================================================================
+
+
+
+! Test pour savoir s'il y a des zones de paroi
+! (donc si des impressions sont necessaires)
+
+if (irangp.ge.0) then
+ call parimx(nozarm,indtp )
+ !==========
+endif
+
+indtpm = 0
+do izone = 1, nozrdm
+ if (indtp(izone).ne.0) then
+ indtpm = 1
+ endif
+enddo
+
+! Si il y a des parois
+
+if(indtpm.gt.0) then
+
+! Si on veut imprimer en niveau 1 au moins
+
+ if (iimpar.ge.1) then
+
+! Calcul de TZOMOY FLUNET RADIOS SURFT
+
+ do izone = 1, nozrdm
+ tzomoy(izone) = zero
+ flunet(izone) = zero
+ radios(izone) = zero
+ surft (izone) = zero
+ enddo
+ do ifac = 1, nfabor
+ surfbn = ra(isrfbn-1+ifac)
+ izone = izfrap(ifac)
+ if (indtp(izone).ne.0) then
+ tp4 = tparop(ifac)**4
+ tzomoy(izone)= tzomoy(izone) + tparop(ifac)*surfbn
+ flunet(izone)= flunet(izone) &
+ + epsp(ifac) *(qincip(ifac) -stephn*tp4 )*surfbn
+ radios(izone)= radios(izone) &
+ - ( epsp(ifac) *stephn*tp4 &
+ +(1.d0-epsp(ifac))*qincip(ifac) )*surfbn
+ surft (izone) = surft(izone) + surfbn
+ endif
+ enddo
+
+ if(irangp.ge.0) then
+ call parrsm(nozarm,tzomoy)
+ !==========
+ call parrsm(nozarm,flunet)
+ !==========
+ call parrsm(nozarm,radios)
+ !==========
+ call parrsm(nozarm,surft )
+ !==========
+ endif
+
+ do izone = 1, nozrdm
+ if (indtp(izone).ne.0) then
+ tzomoy(izone) = tzomoy(izone)/surft(izone)
+ radios(izone) = radios(izone)/surft(izone)
+ endif
+ enddo
+
+
+! Determination de la TPMAX TPMIN et des grandeurs associees
+
+ if(ifacmx.gt.0) then
+ xtpmax = xyzcen(1,ifabor(ifacmx))
+ ytpmax = xyzcen(2,ifabor(ifacmx))
+ ztpmax = xyzcen(3,ifabor(ifacmx))
+ else
+ xtpmax = 0.d0
+ ytpmax = 0.d0
+ ztpmax = 0.d0
+ endif
+ if(ifacmn.gt.0) then
+ xtpmin = xyzcen(1,ifabor(ifacmn))
+ ytpmin = xyzcen(2,ifabor(ifacmn))
+ ztpmin = xyzcen(3,ifabor(ifacmn))
+ else
+ xtpmin = 0.d0
+ ytpmin = 0.d0
+ ztpmin = 0.d0
+ endif
+
+ if(irangp.ge.0) then
+
+ rdptmp(1) = xtpmax
+ rdptmp(2) = ytpmax
+ rdptmp(3) = ztpmax
+ rdptmp(4) = qcmax
+ rdptmp(5) = qrmax
+ nbrval = nbrrdp
+ call parmxl(nbrval,tpmax,rdptmp)
+ !==========
+ xtpmax = rdptmp(1)
+ ytpmax = rdptmp(2)
+ ztpmax = rdptmp(3)
+ qcmax = rdptmp(4)
+ qrmax = rdptmp(5)
+
+ rdptmp(1) = xtpmin
+ rdptmp(2) = ytpmin
+ rdptmp(3) = ztpmin
+ rdptmp(4) = qcmin
+ rdptmp(5) = qrmin
+ nbrval = nbrrdp
+ call parmnl(nbrval,tpmin,rdptmp)
+ !==========
+ xtpmin = rdptmp(1)
+ ytpmin = rdptmp(2)
+ ztpmin = rdptmp(3)
+ qcmin = rdptmp(4)
+ qrmin = rdptmp(5)
+
+ endif
+
+
+! Determination des compteurs et autres
+
+ if(irangp.ge.0) then
+
+ call parmax(rapmax)
+ !==========
+
+ inttm2(1) = nmoins
+ inttm2(2) = nplus
+ inttm2(3) = n1min
+ inttm2(4) = n1max
+ inttm2(5) = nrelax
+ nbrval = nb2int
+ call parism(nbrval,inttm2)
+ !==========
+ nmoins = inttm2(1)
+ nplus = inttm2(2)
+ n1min = inttm2(3)
+ n1max = inttm2(4)
+ nrelax = inttm2(5)
+
+ call parrmx(nozarm,tzomax)
+ !==========
+ call parrmn(nozarm,tzomin)
+ !==========
+
+ inttm1(1) = iitpim
+ inttm1(2) = iipgrn
+ inttm1(3) = iipref
+ inttm1(4) = iifgrn
+ inttm1(5) = iifref
+ nbrval = nb1int
+ call parimx(nbrval,inttm1)
+ !==========
+ iitpim = inttm1(1)
+ iipgrn = inttm1(2)
+ iipref = inttm1(3)
+ iifgrn = inttm1(4)
+ iifref = inttm1(5)
+
+ endif
+
+
+! Impressions
+
+ write(nfecra,1000)
+ write(nfecra,1010)
+
+ if (nrelax.gt.0) then
+ write(nfecra,2010) tx*100.d0 ,nrelax
+ write(nfecra,1010)
+ endif
+
+ if ( n1min.gt.0 .or. n1max.gt.0 ) then
+ write(nfecra,2020)
+ write(nfecra,2030) n1min
+ write(nfecra,2040) n1max
+ write(nfecra,1010)
+ endif
+
+ if (rapmax.gt.0 .or. nmoins.gt.0 .or. nplus.gt.0 ) then
+ write(nfecra,2050) rapmax * 100.d0
+ write(nfecra,2060) nmoins
+ write(nfecra,2070) nplus
+ write(nfecra,1010)
+ endif
+
+ if (iitpim.eq.1) then
+ write(nfecra,3020)
+ do izone = 1, nozrdm
+ if (indtp(izone).eq.itpimp) then
+ write(nfecra,3000) izone, &
+ tzomax(izone)-tkelvi, &
+ tzomin(izone)-tkelvi, &
+ tzomoy(izone)-tkelvi, &
+ flunet(izone)
+ endif
+ enddo
+ write(nfecra,1010)
+ endif
+
+ if (iipgrn.eq.1) then
+ write(nfecra,3010)
+ do izone = 1, nozrdm
+ if (indtp(izone).eq.ipgrno) then
+ write(nfecra,3000) izone, &
+ tzomax(izone)-tkelvi, &
+ tzomin(izone)-tkelvi, &
+ tzomoy(izone)-tkelvi, &
+ flunet(izone)
+ endif
+ enddo
+ write(nfecra,1010)
+ endif
+
+ if (iipref.eq.1) then
+ write(nfecra,3030)
+ do izone = 1, nozrdm
+ if (indtp(izone).eq.iprefl) then
+ write(nfecra,3000) izone, &
+ tzomax(izone)-tkelvi, &
+ tzomin(izone)-tkelvi, &
+ tzomoy(izone)-tkelvi, &
+ flunet(izone)
+ endif
+ enddo
+ write(nfecra,1010)
+ endif
+
+ if (iifgrn.eq.1) then
+ write(nfecra,3040)
+ do izone = 1, nozrdm
+ if (indtp(izone).eq.ifgrno) then
+ write(nfecra,3000) izone, &
+ tzomax(izone)-tkelvi, &
+ tzomin(izone)-tkelvi, &
+ tzomoy(izone)-tkelvi, &
+ flunet(izone)
+ endif
+ enddo
+ write(nfecra,1010)
+ endif
+
+ if (iifref.eq.1) then
+ write(nfecra,3050)
+ do izone = 1, nozrdm
+ if (indtp(izone).eq.ifrefl) then
+ write(nfecra,3000) izone, &
+ tzomax(izone)-tkelvi, &
+ tzomin(izone)-tkelvi, &
+ tzomoy(izone)-tkelvi, &
+ flunet(izone)
+ endif
+ enddo
+ write(nfecra,1010)
+ endif
+
+ endif
+
+
+! Si on veut imprimer EN PLUS en niveau 2
+! =======
+
+ if (iimpar.ge.2) then
+
+ write(nfecra,5010) tpmax-tkelvi
+ write(nfecra,5020) xtpmax, ytpmax, ztpmax
+ write(nfecra,5030) qcmax
+ write(nfecra,5040) qrmax
+ write(nfecra,5050) tpmin-tkelvi
+ write(nfecra,5060) xtpmin, ytpmin, ztpmin
+ write(nfecra,5070) qcmin
+ write(nfecra,5080) qrmin
+
+ endif
+
+endif
+
+! -------
+! FORMATS
+! -------
+
+ 1000 FORMAT (/, 3X,'** INFORMATIONS SUR LA TEMPERATURE DES PAROIS',/, &
+ 3X,' ------------------------------------------')
+
+ 1010 format('------------------------------------' &
+ ,'-----------------------------------')
+
+ 2010 format('ATTENTION, temperature de paroi relaxee a ',G7.2,'%' &
+ ,' en (',I8,' points)')
+
+ 2020 format('ATTENTION, temperature de paroi CLIPPE AU MIN-MAX :')
+
+ 2030 format('NOMBRE DE POINTS CLIPPE AU MINIMUM : ',I8)
+
+ 2040 format('NOMBRE DE POINTS CLIPPE AU MAXIMUM : ',I8)
+
+ 2050 format('Variation maximale : ',G9.4,'%')
+
+ 2060 format('Temperature de paroi diminuant : ',I8,' faces de bord')
+
+ 2070 format('Temperature de paroi augmentant : ',I8,' faces de bord')
+
+ 3000 format(i10,8x,e10.4,4x,e10.4,4x,e10.4,4x,e10.4)
+
+ 3010 format('Grises ou noires Temp max (C) ' &
+ ,'Temp min (C) Temp moy (C) Flux Net (W)')
+
+ 3020 format('Profils imposes Temp max (C) ' &
+ ,'Temp min (C) Temp moy (C) Flux Net (W)')
+
+ 3030 format('Parois a EPS=0 Temp max (C) ' &
+ ,'Temp min (C) Temp moy (C) Flux Net (W)')
+
+ 3040 format('Flux imp EPS!=0 Temp max (C) ' &
+ ,'Temp min (C) Temp moy (C) Flux Net (W)')
+
+ 3050 format('Flux imp EPS=0 Temp max (C) ' &
+ ,'Temp min (C) Temp moy (C) Flux Net (W)')
+
+ 5010 format(/,12X,'TEMPERATURE PAROI MAXIMALE (Degre celsius) = ', &
+ g15.7)
+ 5020 format(15X,' AU POINT X Y Z = ',E10.4,2X,E10.4,2X,E10.4)
+
+ 5030 format(15X,' FLUX CONVECTIF = ',G15.7)
+
+ 5040 format(15X,' FLUX RADIATIF = ',G15.7)
+
+ 5050 format(/,12X,'TEMPERATURE PAROI MINIMALE (Degre celsius) = ', &
+ g15.7)
+
+ 5060 format(15X,' AU POINT X Y Z = ',E10.4,2X,E10.4,2X,E10.4)
+
+ 5070 format(15X,' FLUX CONVECTIF = ',G15.7)
+
+ 5080 format(15X,' FLUX RADIATIF = ',G15.7,/)
+
+
+! ---
+! FIN
+! ---
+
+return
+
+end
+
+! ---------------------------------------------------------------------------------
+! Variation maximale : .1484E-13%
+! Temperature de paroi diminuant : 33
+! Temperature de paroi augmentant : 27
+! ---------------------------------------------------------------------------------
+! Zones de parois Temp max (C) Temp min (C) Temp moy (C) Flux Net (W)
+! 15 0.7941E+03 0.7410E+03 0.7688E+03 0.7688E+03
+! ---------------------------------------------------------------------------------
+! Profils imposes Temp max (C) Temp min (C) Temp moy (C) Flux Net (W)
+! 15 0.7941E+03 0.7410E+03 0.7688E+03 0.7688E+03
+! ---------------------------------------------------------------------------------
+
diff --git a/src/rayt/raypun.f90 b/src/rayt/raypun.f90
new file mode 100644
index 0000000..6c15abb
--- /dev/null
+++ b/src/rayt/raypun.f90
@@ -0,0 +1,518 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raypun &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ flurds , flurdb , &
+ dtr , viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ theta4 , thetaa , sa , &
+ qx , qy , qz , &
+ qincid , eps , tparoi , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , ckmel , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+! CALCUL DES FLUX ET DU TERME SOURCE RADIATIFS
+! AVEC L'APPROXIMATION P-1
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iphas ! e ! <-- ! numero de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! cofrua,cofrub ! tr ! --- ! conditions aux limites aux !
+!(nfabor) ! ! ! faces de bord pour la luminance !
+! flurds,flurdb ! tr ! --- ! pseudo flux de masse (faces internes !
+!(nfac)(nfabor) ! ! ! et faces de bord ) !
+! dtr(ncelet) ! tr ! --- ! dt*cdtvar !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! theta4(ncelet ! tr ! --- ! pseudo temperature radiative !
+! thetaa(ncelet ! tr ! --- ! pseudo temp rar pdt precedent (nulle) !
+! sa (ncelet) ! tr ! --> ! part d'absorption du terme source rad !
+! qxqyqz(ncelet ! tr ! --> ! composante du vecteur densite de flux !
+! ! ! ! radiatif explicite !
+! qincid(nfabor ! tr ! --> ! densite de flux radiatif aux bords !
+! eps (nfabor) ! tr ! <-- ! emissivite des facettes de bord !
+! tparoi(nfabor ! tr ! <-- ! temperature de paroi en kelvin !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! ckmel(ncelet) ! tr ! <-- ! coeff d'absorption du melange !
+! ! ! ! gaz-particules de charbon !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+include "parall.h"
+include "period.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision cofrua(nfabor), cofrub(nfabor)
+double precision flurds(nfac), flurdb(nfabor)
+
+double precision dtr(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+
+double precision theta4(ncelet), thetaa(ncelet)
+double precision sa(ncelet)
+double precision qx(ncelet), qy(ncelet), qz(ncelet)
+double precision qincid(nfabor), tparoi(nfabor), eps(nfabor)
+
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision ckmel(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+character*80 cnom
+
+integer idebia, idebra
+integer ifac , iel
+integer iconv1, idiff1, ndirc1, ireso1
+integer nitmap, nswrsp, nswrgp, iwarnp
+integer imgr1 , imligp, ircflp, ischcp, isstpp, iescap
+integer ncymap, nitmgp
+integer inum
+integer idtva0, ivar0
+integer inc, iccocg, iphydp
+integer idimte , itenso
+double precision epsrgp, blencp, climgp, epsilp, extrap, epsrsp
+double precision aa, aaa, aaaa, relaxp, thetap
+
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. PARAMETRAGE DU SOLVEUR ET INITIALISATION
+!===============================================================================
+
+!--> Gradient Conjugue
+
+ireso1 = 0
+
+!--> Parametrage de CODITS
+
+! IVAR0= 0 LA VARIABLE N'EST ICI NI RIJ NI VITESSE
+ivar0 = 0
+nitmap = 1000
+! IMRGRA = 0
+nswrsp = 1
+nswrgp = 100
+imligp = -1
+ircflp = 1
+ischcp = 1
+isstpp = 0
+iescap = 0
+imgr1 = 1
+ncymap = 100
+nitmgp = 10
+iwarnp = iimlum
+blencp = zero
+epsilp = 1.d-8
+epsrsp = 1.d-8
+epsrgp = 1.d-5
+climgp = 1.5d0
+extrap = zero
+relaxp = 1.d0
+
+!--> Il y a des dirichlets
+
+ndirc1 = 1
+
+!--> Pas de convection pour le modele P1
+
+iconv1 = 0
+
+!--> Equation de diffusion
+
+idiff1 = 1
+
+!--> Remise a zero des tableaux avant resolution
+
+do iel = 1,ncel
+ drtp(iel) = zero
+ theta4(iel) = zero
+ thetaa(iel) = zero
+enddo
+
+do ifac = 1,nfac
+ flurds(ifac) = zero
+enddo
+
+do ifac = 1,nfabor
+ flurdb(ifac) = zero
+enddo
+
+!===============================================================================
+! 2. COEFFICIENT DE DIFFUSION AUX FACES
+!===============================================================================
+
+do iel = 1,ncel
+ ckmel(iel) = 1.d0 / ckmel(iel)
+enddo
+
+call viscfa &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , imvisf , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , ckmel , viscf , viscb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 3. RESOLUTION
+!===============================================================================
+
+! Parametre pour schemas en temps et stationnaire
+thetap = 1.d0
+idtva0 = 0
+
+CNOM = ' '
+WRITE(CNOM,'(A)') 'Rayon P1'
+inum = 1
+nomvar(inum) = cnom
+
+call codits &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtva0 , ivar0 , iconv1 , idiff1 , ireso1 , ndirc1 , nitmap , &
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgr1 , ncymap , nitmgp , inum , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , &
+ thetaa , thetaa , cofrua , cofrub , cofrua , cofrub , &
+ flurds , flurdb , &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbrs , theta4 , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 4. Vecteur densite de flux radiatif
+!===============================================================================
+
+! En periodique et parallele, echange avant calcul du gradient
+
+! Parallele
+if (irangp.ge.0) then
+ call parcom (theta4)
+ !==========
+endif
+
+! Periodique
+if (iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ theta4 , theta4 , theta4 , &
+ theta4 , theta4 , theta4 , &
+ theta4 , theta4 , theta4)
+endif
+
+! Calcul de la densite du flux radiatif QX, QY, QZ
+
+inc = 1
+iccocg = 1
+imligp = -1
+iwarnp = iimlum
+epsrgp = 1.d-8
+climgp = 1.5d0
+extrap = 0.d0
+nswrgp = 100
+ivar0 = 0
+iphydp = 0
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml, &
+ nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp, &
+ iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , &
+ volume , &
+ w7 , w7 , w7 , &
+ theta4 , cofrua , cofrub , &
+ w1 , w2 , w3 , &
+ w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+aa = - stephn * 4.d0 / 3.d0
+
+do iel = 1,ncel
+ aaa = aa * ckmel(iel)
+ qx(iel) = w1(iel) * aaa
+ qy(iel) = w2(iel) * aaa
+ qz(iel) = w3(iel) * aaa
+enddo
+
+!===============================================================================
+! 5. Terme Source Radiatif d'absorption et densite de flux incident
+!===============================================================================
+
+! Calcul de la part d'absorption du terme Source Radiatif
+
+aa = 4.d0 * stephn
+do iel = 1,ncel
+ sa(iel) = aa * theta4(iel)
+enddo
+
+! Calcul du flux incident Qincid
+
+do ifac = 1, nfabor
+
+ iel = ifabor(ifac)
+
+ if (itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug ) then
+
+!--> Premiere version plus chere et legerement plus precise
+
+ aaaa = tparoi(ifac)**4
+
+ aaa = 1.5d0 * ra(idistb-1+ifac) / ckmel(iel) &
+ * ( 2.d0 /(2.d0-eps(ifac)) -1.d0 )
+ aa = ( aaa * aaaa + theta4(iel) ) / (1.d0 + aaa)
+
+ qincid(ifac) = stephn * (2.d0 * aa - eps(ifac) * aaaa) &
+ / (2.d0 - eps(ifac))
+
+!--> Deuxieme version plus cheap mais moins precise
+
+! QINCID(IFAC) = STEPHN *
+! & (2.D0 * THETA4(IFABOR(IFAC)) - EPS(IFAC) * TPAROI(IFAC)**4)
+! & / (2.D0 - EPS(IFAC))
+
+ else
+ qincid(ifac) = stephn * theta4(iel) &
+ + ( qx(iel) * surfbo(1,ifac) + &
+ qy(iel) * surfbo(2,ifac) + &
+ qz(iel) * surfbo(3,ifac) ) / &
+ (0.5d0 * ra(isrfbn-1+ifac) )
+ endif
+
+enddo
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/rayt/raysca.f90 b/src/rayt/raysca.f90
new file mode 100644
index 0000000..e8825bd
--- /dev/null
+++ b/src/rayt/raysca.f90
@@ -0,0 +1,132 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raysca &
+!================
+
+ ( iisca , &
+ ncelet , ncel , &
+ smbrs , rovsdt , volume , propce )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+! PRISE EN COMPTE DES TERMES SOURCES RADIATIFS
+! IMPLICITE ET EXPLICITE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iisca ! e ! <-- ! num scalaire temperature ou enthalpie !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! smbrs(ncelet) ! tr ! <-- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! <-- ! tableau de travail pour terme instat !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+include "entsor.h"
+include "numvar.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iisca , ncelet , ncel
+
+double precision volume(ncelet)
+double precision smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision propce(ncelet,*)
+
+! VARIABLES LOCALES
+
+integer iel
+
+!===============================================================================
+
+!===============================================================================
+! 1. PRISE EN COMPTE DES TERMES SOURCES RADIATIFS
+!===============================================================================
+
+
+if (abs(iscsth(iisca)).eq.1 .or. iscsth(iisca).eq.2) then
+
+ do iel = 1,ncel
+ propce(iel,ipproc(itsri(1))) = max(-propce(iel,ipproc(itsri(1))),zero)
+ enddo
+
+ do iel = 1,ncel
+
+!--> PARTIE EXPLICITE
+
+ smbrs(iel) = smbrs(iel) + propce(iel,ipproc(itsre(1)))*volume(iel)
+
+!--> PARTIE IMPLICITE
+
+ rovsdt(iel)= rovsdt(iel) + propce(iel,ipproc(itsri(1)))*volume(iel)
+
+ enddo
+
+endif
+!
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/rayt/raysol.f90 b/src/rayt/raysol.f90
new file mode 100644
index 0000000..9d6e70b
--- /dev/null
+++ b/src/rayt/raysol.f90
@@ -0,0 +1,579 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine raysol &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ flurds , flurdb , &
+ dtr , viscf , viscb , &
+ dam , xam , &
+ drtp , smbrs , rovsdt , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , &
+ ru , rua , &
+ sa , &
+ qx , qy , qz , &
+ qincid , snplus , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+! CALCUL DES FLUX ET DU TERME SOURCE RADIATIFS
+
+! 1/ DONNEES DES LUMINANCES ENTRANTES AUX LIMITES DU DOMAINE
+! (C.L : REFLEXION ET EMISSION ISOTROPE)
+
+! -> -> ->
+! 2/ CALCUL DE LA LUMINANCE L( X , S ) AU POINT X
+
+! D L
+! PAR RESOLUTION DE L'EQUATION : --- = -TK.L +TS
+! D S
+! -> o
+! OU ENCORE : DIV (L.S ) = -TK.L + TK.L
+
+! -> / -> -> ->
+! 3/ CALCUL DES DENSITES DE FLUX Q = / L( X , S ).S DOMEGA
+! /4.PI
+
+! / -> ->
+! ET DE L'ABSORPTION SA= / L( X , S ). DOMEGA
+! /4.PI
+
+! PAR INTEGRATION DES LUMINANCES SUR LES ANGLES SOLIDES.
+
+! N . B : CA SERT A CALCULER LE TAUX D'ECHAUFFEMENT
+! -----
+! / -> -> -> ->
+! 4/ CALCUL DU FLUX INCIDENT QINCID = / L( X , S ).S . N DOMEGA
+! /->->
+! -> / S.N >0
+! N NORMALE FLUIDE VERS PAROI
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iphas ! e ! <-- ! numero de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! cofrua,cofrub ! tr ! --- ! conditions aux limites aux !
+!(nfabor) ! ! ! faces de bord pour la luminance !
+! flurds,flurdb ! tr ! --- ! pseudo flux de masse (faces internes !
+!(nfac)(nfabor) ! ! ! et faces de bord ) !
+! dtr(ncelet) ! tr ! --- ! dt*cdtvar !
+! viscf(nfac) ! tr ! --- ! visc*surface/dist aux faces internes !
+! viscb(nfabor ! tr ! --- ! visc*surface/dist aux faces de bord !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! drtp(ncelet ! tr ! --- ! tableau de travail pour increment !
+! smbrs(ncelet ! tr ! --- ! tableau de travail pour sec mem !
+! rovsdt(ncelet ! tr ! --- ! tableau de travail pour terme instat !
+! w1...9(ncelet ! tr ! --- ! tableau de travail !
+! ru (ncelet) ! tr ! --- ! luminance !
+! rua (ncelet) ! tr ! --- ! luminance pdt precedent (nulle) !
+! sa (ncelet) ! tr ! --> ! part d'absorption du terme source rad !
+! qxqyqz(ncelet ! tr ! --> ! composante du vecteur densite de flux !
+! ! ! ! radiatif explicite !
+! qincid(nfabor ! tr ! --> ! densite de flux radiatif aux bords !
+! snplus(nfabor ! tr ! --- ! integration du demi-espace egale a pi !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,nphas)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision cofrua(nfabor), cofrub(nfabor)
+double precision flurds(nfac), flurdb(nfabor)
+
+double precision dtr(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision dam(ncelet), xam(nfac,2)
+double precision drtp(ncelet), smbrs(ncelet)
+double precision rovsdt(ncelet)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet)
+
+double precision ru(ncelet), rua(ncelet)
+double precision sa(ncelet)
+double precision qx(ncelet), qy(ncelet), qz(ncelet)
+double precision qincid(nfabor), snplus(nfabor)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+character*80 cnom
+
+integer idebia, idebra
+integer ifac , iel
+integer iconv1, idiff1, ndirc1, ireso1
+integer nitmap, nswrsp, nswrgp, iwarnp
+integer imgr1 , imligp, ircflp, ischcp, isstpp, iescap
+integer ncymap, nitmgp
+integer idir , ndirs , kdir , ipp , inum
+integer ii, jj, kk, idtva0, ivar0
+double precision epsrgp, blencp, climgp, epsilp, extrap, epsrsp
+double precision sx, sy, sz, domega
+double precision sxt(ndirs8), syt(ndirs8), szt(ndirs8)
+double precision aa, surfbn
+double precision relaxp, thetap
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+ivar0 = 0
+nitmap = 1000
+! IMRGRA = 0
+nswrsp = 2
+nswrgp = 100
+imligp = -1
+ircflp = 1
+ischcp = 1
+isstpp = 0
+iescap = 0
+imgr1 = 0
+ncymap = 100
+nitmgp = 10
+iwarnp = iimlum
+blencp = zero
+epsilp = 1.d-8
+epsrsp = 1.d-8
+epsrgp = 1.d-5
+climgp = 1.5d0
+extrap = zero
+relaxp = 1.d0
+
+!--> Il y a des dirichlets
+
+ndirc1 = 1
+
+!--> Convection pure
+
+iconv1 = 1
+
+!--> JACOBI
+
+ireso1 = 1
+
+!===============================================================================
+! 2. Choix du nombre de directions et calcul des coordonnees SX,SY,SZ
+!===============================================================================
+
+
+ndirs = ndirec/8
+
+domega = pi /(2 *ndirs)
+
+call raydir &
+!==========
+ (sxt, syt, szt, ndirs)
+
+!===============================================================================
+! / -> ->
+! 3. CORRECTION DES C.L. POUR RESPECTER : PI= / S. N DOMEGA
+! /2PI
+!===============================================================================
+
+do ifac = 1,nfabor
+ snplus(ifac) = zero
+enddo
+
+do ii = -1,1,2
+ do jj = -1,1,2
+ do kk = -1,1,2
+ do idir = 1,ndirs
+
+ sx = ii *sxt (idir)
+ sy = jj *syt (idir)
+ sz = kk *szt (idir)
+
+ do ifac = 1,nfabor
+ surfbn = ra(isrfbn-1+ifac)
+ aa = sx * surfbo(1,ifac) &
+ + sy * surfbo(2,ifac) &
+ + sz * surfbo(3,ifac)
+ aa = aa / surfbn
+ snplus(ifac) =snplus(ifac) +0.5d0 *(-aa+abs(aa)) *domega
+ enddo
+
+ enddo
+ enddo
+ enddo
+enddo
+
+do ifac = 1,nfabor
+ cofrua(ifac) = cofrua(ifac) *(pi /snplus(ifac))
+enddo
+
+!===============================================================================
+! 4. INITIALISATION POUR INTEGRATION DANS LES BOUCLES SUIVANTES
+!===============================================================================
+
+do ifac = 1, nfabor
+ qincid(ifac) = zero
+ snplus(ifac) = zero
+enddo
+
+do iel = 1, ncelet
+ sa(iel) = zero
+ qx(iel) = zero
+ qy(iel) = zero
+ qz(iel) = zero
+enddo
+
+!--> Stockage du SMBRS dans tableau tampon, il sont recharges
+! a chaque changement de direction
+
+do iel = 1, ncel
+ w10(iel) = smbrs(iel)
+enddo
+
+!--> ROVSDT charge une seule fois
+do iel = 1, ncel
+ rovsdt(iel) = max(rovsdt(iel),zero)
+enddo
+
+!--> ON SAUVEGARDE LE NOM DE LA PREMIERE VARIABLE
+! Attention, le passage du nom de variable pour les impressions
+! est fait par common dans NOMVAR (pas tres pratique).
+! Des infos sont egalement remplies en common (residu, nbiter...)
+! Les directions n'etant pas des variables qu'on se donne
+! la possibilite d'imprimer dans le listing, on utilise
+! la position numero 1 qui est une poubelle.
+
+ipp = 1
+NOMVAR(IPP) = 'RayonXXX'
+
+!===============================================================================
+! 5. RESOLUTION DE L'EQUATION DES TRANSFERTS RADIATIFS
+!===============================================================================
+
+!===============================================================================
+! 5.1 DISCRETISATION ANGULAIRE
+!===============================================================================
+
+kdir = 0
+
+do ii = -1,1,2
+ do jj = -1,1,2
+ do kk = -1,1,2
+ do idir = 1,ndirs
+
+ sx = ii * sxt(idir)
+ sy = jj * syt(idir)
+ sz = kk * szt(idir)
+
+ kdir = kdir + 1
+
+ CNOM = ' '
+ WRITE(CNOM,'(A5,I3.3)')'Rayon',KDIR
+ inum = ipp
+ nomvar(inum) = cnom
+
+!===============================================================================
+! 5.2 DISCRETISATION SPATIALE
+!===============================================================================
+
+!===============================================================================
+! 5.1.1 PREPARATION ET PARAMETRAGE DE LA RESOLUTION
+!===============================================================================
+
+!--> Terme source explicite
+
+ do iel = 1, ncel
+ smbrs(iel) = w10(iel)
+ enddo
+
+!--> Terme source implicite (ROVSDT vu plus haut)
+
+!--> Pas de diffusion facette
+
+ idiff1 = 0
+ do ifac = 1,nfac
+ viscf(ifac) = zero
+ enddo
+ do ifac = 1,nfabor
+ viscb(ifac) = zero
+ enddo
+
+ do iel = 1,ncelet
+ drtp(iel) = zero
+ ru(iel) = zero
+ rua(iel) = zero
+ enddo
+
+ do ifac = 1,nfac
+ flurds(ifac) = &
+ + sx*surfac(1,ifac) &
+ + sy*surfac(2,ifac) &
+ + sz*surfac(3,ifac)
+ enddo
+
+ do ifac = 1,nfabor
+ flurdb(ifac) = &
+ + sx*surfbo(1,ifac) &
+ + sy*surfbo(2,ifac) &
+ + sz*surfbo(3,ifac)
+ enddo
+
+!===============================================================================
+! 5.1.2 RESOLUTION
+!===============================================================================
+
+! Dans le cas d'un theta-schema on met theta = 1
+! Pas de relaxation en stationnaire non plus
+
+ thetap = 1.0d0
+ idtva0 = 0
+
+ call codits &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ idtva0 , ivar0 , iconv1 , idiff1 , ireso1 , ndirc1 , nitmap ,&
+ imrgra , nswrsp , nswrgp , imligp , ircflp , &
+ ischcp , isstpp , iescap , &
+ imgr1 , ncymap , nitmgp , inum , iwarnp , &
+ blencp , epsilp , epsrsp , epsrgp , climgp , extrap , &
+ relaxp , thetap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rua , ru , &
+ cofrua , cofrub , cofrua , cofrub , flurds , flurdb , &
+ viscf , viscb , viscf , viscb , &
+ rovsdt , smbrs , ru , &
+ dam , xam , drtp , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 5.2 INTEGRATION DES FLUX ET TERME SOURCE
+!===============================================================================
+
+ do iel = 1,ncel
+ aa = ru(iel) *domega
+ sa(iel) = sa(iel) + aa
+ qx(iel) = qx(iel) + aa * sx
+ qy(iel) = qy(iel) + aa * sy
+ qz(iel) = qz(iel) + aa * sz
+ enddo
+
+!===============================================================================
+! 5.3 FLUX INCIDENT A LA PAROI
+!===============================================================================
+
+ do ifac = 1,nfabor
+
+ surfbn = ra(isrfbn-1+ifac)
+ aa = sx * surfbo(1,ifac) &
+ + sy * surfbo(2,ifac) &
+ + sz * surfbo(3,ifac)
+ aa = aa / surfbn
+
+ aa = 0.5d0 *(aa+abs(aa)) *domega
+
+ snplus(ifac) = snplus(ifac) + aa
+
+ qincid(ifac) = qincid(ifac) + aa*ru(ifabor(ifac))
+
+ enddo
+
+ enddo
+ enddo
+ enddo
+enddo
+
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/src/rayt/rmodak.f90 b/src/rayt/rmodak.f90
new file mode 100644
index 0000000..358948d
--- /dev/null
+++ b/src/rayt/rmodak.f90
@@ -0,0 +1,964 @@
+!-------------------------------------------------------------------------------
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! LIBRAIRIE DE SOUS-PROGRAMMES RMODAK
+!==========================================
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+! SOUS-PROGRAMMES DE LA PHYSIQUE PARTICULIERE
+! RELATIFS AU CALCUL DU COEFFICIENT D'ABSORPTION AVEC MODAK
+
+! References : MODAK A.T.,
+! "Radiation from products of combustion",
+! Fire Research, 1 pp. 339-361, 1978.
+
+! MECHITOUA N.
+! "Modelisation numerique du rayonnment dans les
+! milieux semi-transoparents",
+! Raport EDF, HE/44/87-15, 1987.
+
+
+!==============================================================================
+
+subroutine absorb &
+!================
+
+ ( ts , te , path , sootk , &
+ pco2 , ph2o , alpha )
+
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ON CALCULE LES ABSORPTIVITES (PAR RAPPORT
+! A UNE SOURCE DE CORPS NOIR) D'UN MELANGE GAZEUX ISOTHERME,
+! HOMOGENE DE SUIE, CO2 ET H2O A LA PRESSION TOTALE D'1 ATM.
+
+! SI LA TEMPERATURE DU CORPS NOIR EST EGALE A LA TEMPERATURE DU
+! MELANGE, L'ABSORPTIVITE EST EGALE A L'EMISSIVITE.
+! LES EMISSIVITES AINSI CALCULEES SONT EN BON ACCORD AVEC LES
+! CALCULS SPECTRAUX ET LES MESURES EXPERIMENTALES
+
+! TS ET TE DOIVENT ETRE COMPRIS ENTRE 300 ET 2000 KELVIN
+
+! LA LONGUEUR D'ONDE 0.94 MICRON.
+! SOOTK EST LIEE A LA FRACTION VOLUMIQUE DE SUIE FV SUIVANT
+! LA FORMULE :
+! SOOTK=7FV/0.94E-6
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ts ! r ! <-- ! temperature du corps noir (k) !
+! te ! r ! <-- ! temperature du melange (k) !
+! path ! r ! <-- ! penetration du rayonnement dans le !
+! ! ! ! melange (m) !
+! sootk ! r ! <-- ! coefficient d'absorption des suies !
+! pco2 ! r ! <-- ! pression partielle de co2 dans un !
+! ! ! ! melange de presssion totale 1 atm. !
+! ph2o ! r ! <-- ! pression partielle de h2o dans un !
+! ! ! ! melange de presssion totale 1 atm. !
+! alpha ! r ! <- ! absorptivite
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+double precision ts, te, path, sootk, pco2, ph2o, alpha
+
+! VARIABLES LOCALES
+
+double precision tmax, tmin, ptotal, ratio, pathl, pcl, pwl
+double precision as, taus, ag, power, zeta
+double precision emigas
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+tmax = 3000.d0
+tmin = 298.d0
+if (ts.lt.tmin .or. ts.gt.tmax ) goto 1
+if (te.lt.tmin .or. te.gt.tmax ) goto 2
+
+! --- Pression totale : PTOTAL
+
+ptotal = pco2 + ph2o
+
+if ( ptotal.gt.1.d0 ) goto 3
+
+! --- Rapport temeperature melange et temperature source : RATIO
+
+ratio = te/ts
+
+! --- Loncueur de penetration du rayonment effectif : PATHL
+
+pathl = path/ratio
+pcl = pco2*pathl
+pwl = ph2o*pathl
+if (pcl.gt.5.98d0 .or. pwl.gt.5.98d0) goto 4
+
+! --- Calcul de l'absortivite des suies : AS
+
+as = 0.d0
+if (sootk.le.0.d0) goto 51
+call tasoot &
+!==========
+ ( sootk , path , ts , taus )
+
+as = 1.d0-taus
+
+ 51 continue
+
+! --- Calcul de l'absorptivite du gaz : AG
+! = emissivite du gaz
+
+ag = 0.d0
+if (pco2.lt.0.0011d0 .and. ph2o.lt.0.0011d0) goto 52
+if (pcl .lt.0.0011d0 .and. pwl .lt.0.0011d0) goto 52
+ag = emigas( pathl, pco2, ph2o, ts )
+
+! --- Calcul de la fraction de vapeur d'eau : ZETA
+
+zeta = ph2o/ptotal
+power = 0.65d0-0.2d0*zeta
+ag = ag*(ratio**power)
+
+ 52 continue
+alpha = as + ag -as*ag
+! ALPHA = ABS(ALPHA)
+if (alpha.le.1.d-8) goto 8
+
+return
+
+ 4 continue
+write(nfecra,1000)
+goto 8
+
+ 3 continue
+write(nfecra,1001)
+goto 8
+
+ 2 continue
+write(nfecra,1002)
+goto 8
+
+ 1 continue
+write(nfecra,1003)
+
+ 8 continue
+alpha= 1.d-8
+
+
+!========
+! FORMATS
+!========
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ERREUR MODAK : ',/,&
+'@ ============ ',/,&
+'@ LE PRODUIT PATH*TS/T*PCO2 OU PATH*TS/T*PH2O ',/,&
+'@ DEPASSE LA VALEUR 5.98 ATM.METRE. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ERREUR MODAK : ',/,&
+'@ ============ ',/,&
+'@ LA SOMME DES PRESSIONS PARTIELLES DES GAZ CO2 ET H2O ',/,&
+'@ DEPASSE UN ATMOSPHERE. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1002 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ERREUR MODAK : ',/,&
+'@ ============ ',/,&
+'@ LA TEMPERATURE DU MELANGE TE ',/,&
+'@ SORT DES LIMITES DU DOMAINE. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1003 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ERREUR MODAK : ',/,&
+'@ ============ ',/,&
+'@ LA TEMPERATURE DU CORPS NOIR TS ',/,&
+'@ SORT DES LIMITES DU DOMAINE. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+return
+end
+
+!==============================================================================
+
+subroutine chebyc &
+!================
+
+ ( norpol , argpol , valpol )
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DU POLYNOME DE CHEBYCHEV D'ORDRE NORPOL
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! norpol ! e ! <-- ! ordre du polynome de chebychev !
+! argpol ! r ! <-- ! argument du polynome de chebychev !
+! valpol ! r ! --> ! valeur du polynome de chebychev !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+integer norpol
+double precision argpol , valpol
+
+! VARIABLES LOCALES
+
+integer ict
+double precision f, vm2,vm1
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+valpol = 1.d0
+if (norpol.le.0) then
+ goto 1
+else
+ goto 2
+endif
+
+ 1 return
+
+ 2 valpol = argpol
+
+if ( (norpol-1).le.0) then
+ goto 1
+else
+ goto 3
+endif
+ 3 f = argpol+argpol
+vm1 = argpol
+vm2 = 1.d0
+do ict = 2, norpol
+ valpol = f*vm1-vm2
+ vm2 = vm1
+ vm1 = valpol
+enddo
+
+return
+end
+
+!==============================================================================
+
+subroutine asympt &
+!================
+
+ ( zz , zzv )
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+!FONCC CALCUL DE L'EXPANSION ASYMPTOTIQUE POUR LA FONCTION PENTAGAMMA
+!FONCC
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! zz ! r ! <-- ! !
+! zzv ! r ! --> ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision zz, zzv
+
+! VARIABLES LOCALES
+
+double precision zi1, zi2, zi3, d1s3
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+d1s3 = 1.d0/3.d0
+zi1 = 1.d0/zz
+zi2 = zi1*zi1
+zi3 = zi1*zi2
+zzv = zi3 * ( &
+ (2.d0+3.d0*zi1) + &
+ zi2*(2.d0 + zi2*(-1.d0 + &
+ zi2*( 1.d0+d1s3 &
+ + zi2*(-3.d0+10.d0*zi2) ) &
+ ) &
+ ) &
+ )
+
+return
+end
+
+!==============================================================================
+
+subroutine tasoot &
+!================
+
+ ( zkled , pathl , tblack , taus )
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA TRANSMISSIVITE(TAUS) DE PATH
+! A UNE TEMPERATURE DONNEE.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! zkled ! r ! <-- ! !
+! pathl ! r ! <-- ! penetration du rayonnement dans le !
+! ! ! ! melange !
+! tblack ! r ! <-- ! temperature source ou temperature !
+! ! ! ! du gaz !
+! taus ! r ! --> ! transmissivite de path !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision zkled, pathl, tblack, taus
+
+! VARIABLES LOCALES
+
+double precision arg , val
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+if ( zkled.le.0.d0 ) goto 1
+
+arg = 1.d0 + zkled*pathl*tblack*6.5333d-5
+
+call pentag &
+!==========
+ ( arg , val )
+
+taus = val*.1539897336d0
+return
+
+ 1 taus = 1.d0
+
+return
+end
+
+!==============================================================================
+
+subroutine pentag &
+!================
+
+ ( argfpe , valfpe )
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA VALEUR VAL DE LA
+! FONCTION PENTAGAMMA D ARGUMENT X.
+! ON UTILISE LES FORMULES ASYMPTOTIQUES ET DE RECURRENCE
+! D'ABRAMOWITZ ET STEGUN.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! argfpe ! r ! <-- ! argument de la fonction pentagamma !
+! valfpe ! r ! --> ! valeur de la fonction pentagamma !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision argfpe, valfpe
+
+! VARIABLES LOCALES
+
+double precision zz, zzv, zs
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+if (argfpe.ge.4.d0) goto 1
+if (argfpe.ge.3.d0) goto 2
+if (argfpe.ge.2.d0) goto 3
+
+zs = ( 1.d0/(argfpe+2.d0)**4 + 1.d0/(argfpe+1.d0)**4 &
+ + 1.d0/argfpe**4 )*6.d0
+zz = argfpe+3.d0
+call asympt &
+!==========
+ ( zz, zzv )
+
+goto 4
+
+ 3 continue
+zs = (1.d0/(argfpe+1.d0)**4+1.d0/argfpe**4)*6.d0
+zz = argfpe+2.d0
+call asympt &
+!==========
+ ( zz, zzv )
+goto 4
+
+ 2 continue
+zs= 6.d0/argfpe**4
+zz= argfpe+1.d0
+call asympt &
+!==========
+ ( zz, zzv )
+
+goto 4
+
+ 1 continue
+zs = 0.d0
+! La ligne suivante est ajoutee simplement pour eviter un warning
+! sous Foresys (var non initialisee) en attendant que la routine
+! soit revue de maniere globale (pour l'instant, l'utilisation
+! de rmodak est bloquee en amont).
+zz= argfpe
+
+call asympt &
+!==========
+ ( zz, zzv )
+
+ 4 continue
+valfpe = zzv+zs
+
+return
+end
+
+!==============================================================================
+
+ function fdleck &
+!==============
+
+ ( val , pl , te )
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE LA CORRECTION APPORTEE POUR LE MELANGE
+! DE CO2 ET H2O LORSQUE LES LONGUEURS D ONDES SONT AU DELA DE 2.7
+! ET 15 MICRONS
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! val ! r ! -> ! !
+! pl ! r ! -> ! !
+! te ! r ! -> ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision val, pl, te, fdleck
+
+! VARIABLES LOCALES
+
+double precision term, term2, term3, tt, tt2, aa, bb, cc
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+if (pl.lt.0.1d0) goto 1
+
+term = val/(10.7d0+101.d0*val) - val**10.4d0/111.7d0
+term2 = log10(101.325d0*pl)
+term2 = term2**2.76d0
+tt = te/1000.d0
+tt2 = tt*tt
+aa = -1.0204082d0
+bb = 2.2448979d0
+cc = -0.23469386d0
+term3 = aa*tt2+bb*tt+cc
+
+! --- TERM3 represente l'ajustement de temperature
+
+fdleck = term*term2*term3
+
+return
+
+ 1 fdleck= 0.d0
+
+return
+end
+
+!==============================================================================
+
+ function emigas &
+!==============
+! -------------------------------------------------------------
+ ( pathl , pc , pw , te )
+! -------------------------------------------------------------
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! CALCUL DE L EMISSIVITE A UN PATH DONNE
+! D'UN MELANGE DE CO2 ET H2O A LA TEMPERATURE TE
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! pathl ! r ! -> ! valeur du path !
+! pc ! r ! -> ! pression partielle de co2 !
+! pw ! r ! -> ! pression partielle de h2o !
+! te ! r ! -> ! temperature !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+double precision pathl, pc, pw, te, emigas
+
+! VARIABLES LOCALES
+
+double precision tmin, tmax, pcl, ec
+double precision pwl, pcwl, dels, ew, pcpw, xi, fdleck
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+tmin = 298.d0
+tmax = 3000.d0
+emigas = 0.d0
+
+if ( te.lt.tmin .or. te.gt.tmax ) return
+
+ec = 0.d0
+
+if ( pc.lt.0.0011d0 .or. pc.gt.1.d0 ) goto 1
+
+pcl = pc*pathl
+
+if ( pcl.lt.0.0011d0 .or. pcl.gt.5.98d0 ) goto 1
+
+call scrtch &
+!==========
+ ( pc , pcl , te , 1 , ec)
+
+ 1 continue
+
+if ( pw.lt.0.0011d0 .or. pw.gt.1.d0 ) goto 2
+
+pwl = pw*pathl
+
+if ( pwl.lt.0.0011d0 .or. pwl.gt.5.98d0 ) goto 2
+
+call scrtch &
+!==========
+ ( pw , pwl , te , 2 , ew )
+
+emigas = ec + ew
+
+if ( ec.le.0.0d0 ) return
+
+pcpw = pc + pw
+xi = pw / pcpw
+if ( xi.lt.0.01d0 ) return
+pcwl = pcpw*pathl
+
+if ( pcwl.lt.0.1d0 ) return
+
+dels = fdleck(xi,pcwl,te)
+emigas = emigas - dels
+
+return
+
+2 continue
+emigas = ec
+
+return
+end
+
+!==============================================================================
+
+subroutine scrtch &
+!================
+
+ ( pp , pl , te , index , val )
+
+
+!===============================================================================
+! FONCTION :
+! --------
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! pp ! r ! -> ! !
+! pl ! r ! -> ! !
+! te ! r ! -> ! !
+! index ! e ! -> ! !
+! val ! r ! -> ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+!===============================================================================
+
+! Arguments
+
+integer index
+double precision pp, pl, te, val
+
+! VARIABLES LOCALES
+
+integer ii, jj, kk, iii, jjj, kkk
+double precision cc(3,4,4), cw(3,4,4), sc(3,4,4)
+double precision xx, yy, zz, v6, v7
+double precision tix, tjy, tkz
+
+!===============================================================================
+! CALCUL
+!===============================================================================
+
+if ( index.eq.2 ) goto 2
+
+! --- CC represente untebleau de 48 elements pour CO2
+
+cc(1,1,1) = -.2754568d1
+cc(1,1,2) = -.2997857d0
+cc(1,1,3) = -.1232494d0
+cc(1,1,4) = .1279287d-1
+cc(1,2,1) = .1503051d1
+cc(1,2,2) = .3156449d0
+cc(1,2,3) = .1058126d-1
+cc(1,2,4) = -.3729625d-1
+cc(1,3,1) = -.247411d0
+cc(1,3,2) = -.3323846d-1
+cc(1,3,3) = -.1819471d-1
+cc(1,3,4) = .2289789d-1
+cc(1,4,1) = .4994029d-1
+cc(1,4,2) = -.1986786d-2
+cc(1,4,3) = .3007898d-2
+cc(1,4,4) = -.1175598d-2
+cc(2,1,1) = .5737722d-2
+cc(2,1,2) = -.9328458d-2
+cc(2,1,3) = .2906286d-2
+cc(2,1,4) = .422752d-3
+cc(2,2,1) = -.3151784d-2
+cc(2,2,2) = .5632821d-2
+cc(2,2,3) = -.3260295d-2
+cc(2,2,4) = .7065884d-3
+cc(2,3,1) = .1668751d-3
+cc(2,3,2) = -.7326533d-3
+cc(2,3,3) = .3639855d-3
+cc(2,3,4) = .3228318d-3
+cc(2,4,1) = .7386638d-3
+cc(2,4,2) = -.7277073d-3
+cc(2,4,3) = .5925968d-3
+cc(2,4,4) = -.2021413d-3
+cc(3,1,1) = .3385611d-2
+cc(3,1,2) = -.5439185d-2
+cc(3,1,3) = .176456d-2
+cc(3,1,4) = .3036031d-3
+cc(3,2,1) = -.18627d-2
+cc(3,2,2) = .3236275d-2
+cc(3,2,3) = -.195225d-2
+cc(3,2,4) = .3474022d-3
+cc(3,3,1) = .1204807d-3
+cc(3,3,2) = -.4479927d-3
+cc(3,3,3) = .2497521d-3
+cc(3,3,4) = .1812996d-3
+cc(3,4,1) = .4218169d-3
+cc(3,4,2) = -.4046608d-3
+cc(3,4,3) = .3256861d-3
+cc(3,4,4) = -.9514981d-4
+
+goto 4
+
+ 2 continue
+
+! --- CW represente untebleau de 48 elements pour H2O
+
+cw(1,1,1) = -.2594279d1
+cw(1,1,2) = -.7118472d0
+cw(1,1,3) = -.9956839d-3
+cw(1,1,4) = .1226560d-1
+cw(1,2,1) = .2510331d1
+cw(1,2,2) = .6481808d0
+cw(1,2,3) = -.3330587d-1
+cw(1,2,4) = -.5524345d-2
+cw(1,3,1) = -.4191636d0
+cw(1,3,2) = -.1375180d0
+cw(1,3,3) = .3877930d-1
+cw(1,3,4) = .8862328d-3
+cw(1,4,1) = -.322912d-1
+cw(1,4,2) = -.1820241d-1
+cw(1,4,3) = -.2223133d-1
+cw(1,4,4) = -.5940781d-3
+cw(2,1,1) = .1126869d0
+cw(2,1,2) = -.8133829d-1
+cw(2,1,3) = .1514940d-1
+cw(2,1,4) = .1393980d-2
+cw(2,2,1) = -.9298805d-2
+cw(2,2,2) = .4550660d-1
+cw(2,2,3) = -.2082008d-1
+cw(2,2,4) = .2013361d-2
+cw(2,3,1) = -.4375032d-1
+cw(2,3,2) = .1924597d-1
+cw(2,3,3) = .8859877d-2
+cw(2,3,4) = -.4618414d-2
+cw(2,4,1) = .7077876d-2
+cw(2,4,2) = -.2096188d-1
+cw(2,4,3) = .1458262d-2
+cw(2,4,4) = .3851421d-2
+cw(3,1,1) = .5341517d-1
+cw(3,1,2) = -.3407693d-1
+cw(3,1,3) = .4354611d-2
+cw(3,1,4) = .1492038d-2
+cw(3,2,1) = -.4708178d-2
+cw(3,2,2) = .2086896d-1
+cw(3,2,3) = -.9477533d-2
+cw(3,2,4) = .6153272d-3
+cw(3,3,1) = -.2104622d-1
+cw(3,3,2) = .7515796d-2
+cw(3,3,3) = .5965509d-2
+cw(3,3,4) = -.2756144d-2
+cw(3,4,1) = .4318975d-2
+cw(3,4,2) = -.1005744d-1
+cw(3,4,3) = .4091084d-3
+cw(3,4,4) = .2550435d-2
+
+ 4 continue
+
+xx = log(pp)/3.45d0 + 1.d0
+yy = (log(pl)+2.555d0) / 4.345d0
+zz = (te-1150.d0) / 850.d0
+val = 0.d0
+
+do ii =1, 3
+ iii = ii-1
+ call chebyc &
+ !==========
+ ( iii , xx , tix )
+
+ v6 = 0.d0
+ do jj = 1, 4
+ jjj = jj-1
+ call chebyc &
+ !==========
+ ( jjj, yy , tjy )
+
+ v7 = 0.d0
+ do kk = 1, 4
+ kkk = kk-1
+ call chebyc &
+ !==========
+ ( kkk , zz , tkz )
+
+ if (index.eq.1) sc(ii,jj,kk) = cc(ii,jj,kk)
+ if (index.eq.2) sc(ii,jj,kk) = cw(ii,jj,kk)
+ v7 = v7 + tkz*sc(ii,jj,kk)
+ enddo
+
+ v6 = v6 + v7*tjy
+ enddo
+
+ val = val + v6*tix
+
+enddo
+
+val = exp(val)
+
+return
+end
diff --git a/users/atmo/usatcl.f90 b/users/atmo/usatcl.f90
new file mode 100644
index 0000000..e9752d8
--- /dev/null
+++ b/users/atmo/usatcl.f90
@@ -0,0 +1,822 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usatcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LA VERSION PART. ATMOSPHERIQUE
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! On balaye les faces de bord et selon un critere on affecte tel
+! ou tel type de conditions aux limites. Dans l'exemple donne
+! ci dessous, c'est la couleur (propriete 1 de la famille)
+! qui permet de distinguer les differents types de bord. On
+! aurait pu aussi travailler avec les coordonnees du centre
+! des faces, mais "c'eut ete moins pratique".
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "atincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ii, ivar, iphas
+integer izone
+integer ilelt, nlelt
+double precision uref2, d2s3
+double precision rhomoy, dh, ustar2
+double precision xintur
+double precision zref,xuref
+double precision ustar,rugd
+double precision zent,xuent,xvent
+double precision xkent, xeent
+double precision tpent
+
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE ECOULEMENTS ATMOSPHERIQUES ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usatcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+! Paremeters for the analytical rough wall law (neutral)
+zref=10.d0
+xuref=10.d0
+rugd=0.1d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+!===============================================================================
+
+
+! --- On impose en couleur 11 une condition basee sur le profil meteo
+! avec choix automatique entre entree et sortie a partir du profil
+
+CALL GETFBR('11',NLELT,LSTELT)
+
+! - Numero de zone (on numerote de 1 a n)
+izone = 1
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - On indique que les conditions a la limite seront tirees
+! du profil meteo
+ iprofm(izone) = 1
+
+enddo
+
+! --- On impose en couleur 21 une condition d'entree avec des valeurs
+! tirees du profil meteo
+
+CALL GETFBR('21',NLELT,LSTELT)
+
+! - Numero de zone (on numerote de 1 a n)
+izone = 2
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - On indique que les conditions a la limite seront tirees
+! du profil meteo
+ iprofm(izone) = 1
+
+! - On force les faces a etre des faces d'entree
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = ientre
+ enddo
+
+enddo
+
+! --- On impose en couleur 31 une condition d'entree avec des valeurs
+! tirees du profil meteo, sauf pour les variables dynamiques sur
+! lesquelles on impose un profil analytique rugueux
+
+CALL GETFBR('31',NLELT,LSTELT)
+
+! - Numero de zone (on numerote de 1 a n)
+izone = 3
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - On indique que les conditions a la limite seront tirees
+! du profil meteo
+ iprofm(izone) = 1
+
+ ustar=xkappa*xuref/log((zref+rugd)/rugd)
+ xuent=ustar/xkappa*log((zent+rugd)/rugd)
+ xkent=ustar**2/sqrt(cmu)
+ xeent=ustar**3/xkappa/(zent+rugd)
+
+
+ do iphas = 1, nphas
+
+ itypfb(ifac,iphas) = ientre
+
+ rcodcl(ifac,iu(iphas),1) = xuent
+ rcodcl(ifac,iv(iphas),1) = xvent
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! ITYTUR est un indicateur qui vaut ITURB/10
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ enddo
+
+enddo
+
+! --- On impose en couleur 12 une sortie pour toutes les phases
+CALL GETFBR('12',NLELT,LSTELT)
+!==========
+
+! - Numero de zone (on numerote de 1 a n)
+izone = 4
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = isolib
+
+ enddo
+
+enddo
+
+! --- On impose en couleur 15 une paroi rugueuse pour toutes les phases
+CALL GETFBR('15',NLELT,LSTELT)
+!==========
+
+! - Numero de zone (on numerote de 1 a n)
+izone = 5
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT RUGUEUX POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = iparug
+
+! Rugosite pour la vitesse
+ rcodcl(ifac,iu(iphas),3) = rugd
+ enddo
+
+ if(nscal.gt.0) then
+
+! SI TEMPERATURE IMPOSEE A 20 AVEC LOI DE PAROI RUGUEUSE (SCALAIRE II=1)
+! AVEC RUGOSITE DE 1cm
+! II = 1
+! ICODCL(IFAC,ISCA(II)) = 6
+! RCODCL(IFAC,ISCA(II),1) = 20.D0
+! RCODCL(IFAC,ISCA(II),3) = 0.001D0
+
+! SI FLUX IMPOSE A 4.D0 (SCALAIRE II=2)
+! II = 2
+! ICODCL(IFAC,ISCA(II)) = 3
+! RCODCL(IFAC,ISCA(II),3) = 4.D0
+
+ endif
+
+enddo
+
+! --- On impose en couleur 4 une symetrie pour toutes les phases
+CALL GETFBR('4',NLELT,LSTELT)
+!==========
+
+! - Numero de zone (on numerote de 1 a n)
+izone = 6
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = isymet
+ enddo
+
+
+enddo
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/atmo/usati1.f90 b/users/atmo/usati1.f90
new file mode 100644
index 0000000..cfca1b9
--- /dev/null
+++ b/users/atmo/usati1.f90
@@ -0,0 +1,112 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usati1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DE CALCUL NON STANDARD
+! POUR LA VERSION ATMOSPHERIQUE
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "atincl.h"
+
+
+!===============================================================================
+
+integer iphas
+
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. EXEMPLE D'OPTIONS DE CALCUL A MODIFIER
+!===============================================================================
+
+! Pour chaque phase
+
+do iphas = 1, nphas
+
+! --> Masse volumique et viscosite
+
+irovar(iphas) = 0
+ivivar(iphas) = 0
+
+! ---> lecture du fichier meteo
+imeteo = 1
+
+enddo
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/atmo/usativ.f90 b/users/atmo/usativ.f90
new file mode 100644
index 0000000..e38b384
--- /dev/null
+++ b/users/atmo/usativ.f90
@@ -0,0 +1,379 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usativ &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbmetd , nbmett , nbmetm , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ tmprom , ztprom , zdprom , xmet , ymet , pmer , &
+ ttprom , qvprom , uprom , vprom , ekprom , epprom , &
+ rprom , tpprom , phprom , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE: VERSION ATMOSPHERIQUE
+! PENDANT DE USINIV
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+
+
+
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME USPHYV
+! ET PAS ICI
+
+
+
+! POUR LA COMBUSTION, LE CHARBON, L'INITIALISATION EST FAITE
+! PAR DEFAUT : IL EST CONSEILLE DE LA CONSERVER.
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbmetd , nbmett , nbmetm
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision tmprom(nbmetm)
+double precision ztprom(nbmett) , zdprom(nbmetd)
+double precision xmet(nbmetm) , ymet(nbmetm) , pmer(nbmetm)
+double precision ttprom(nbmett,nbmetm) , qvprom(nbmett,nbmetm)
+double precision uprom(nbmetd,nbmetm) , vprom(nbmetd,nbmetm)
+double precision ekprom(nbmetd,nbmetm) , epprom(nbmetd,nbmetm)
+double precision rprom(nbmett,nbmetm) , tpprom(nbmett,nbmetm)
+double precision phprom(nbmett,nbmetm)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iutile,iphas
+double precision d2s3
+double precision zent,xuent,xvent,xkent,xeent,tpent
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) then
+! Indicateur de non passage dans le sous-programme
+ iusini = 0
+ return
+endif
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+! --- INCONNUES
+! Exemple : Initialisation a partir des profils meteo
+
+
+if (isuite.eq.0) then
+
+! Initialisation with the input meteo profile
+
+ iphas=1
+
+ do iel = 1, ncel
+
+ zent=xyzcen(3,iel)
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, uprom , zent , ttcabs, xuent )
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, vprom , zent , ttcabs, xvent )
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, ekprom, zent , ttcabs, xkent )
+
+ call intprf &
+ !==========
+ (nbmetd, nbmetm, &
+ zdprom, tmprom, epprom, zent , ttcabs, xeent )
+
+ rtp(iel,iu(iphas))=xuent
+ rtp(iel,iv(iphas))=xvent
+ rtp(iel,iw(iphas))=0.d0
+
+! ITYTUR est un indicateur qui vaut ITURB/10
+ if (itytur(iphas).eq.2) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+
+ endif
+
+ if (iscalt(iphas).ge.0) then
+! On suppose que le scalaire est la temperature potentielle :
+ call intprf &
+ !==========
+ (nbmett, nbmetm, &
+ ztprom, tmprom, tpprom, zent , ttcabs, tpent )
+
+ rtp(iel,isca(iscalt(iphas))) = tpent
+
+ endif
+ enddo
+
+endif
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/usalcl.f90 b/users/base/usalcl.f90
new file mode 100644
index 0000000..0675bd2
--- /dev/null
+++ b/users/base/usalcl.f90
@@ -0,0 +1,636 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usalcl &
+!================
+
+ ( idbia0 , idbra0 , itrale , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itypfb , ialtyb , impale , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , xyzno0 , depale , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (IALTYB,ICODCL,RCODCL) POUR LA VITESSE DE MAILLAGE
+
+! POSSIBILITE DE FIXER DIRECTEMENT LE DEPLACEMENT DES
+! NOEUDS
+
+
+
+! CE SOUS PROGRAMME UTILISATEUR EST OBLIGATOIRE EN ALE
+! ====================================================
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord, pour
+! pour la vitesse de maillage uniquement (pour les autres
+! variables, se reporter a l'Interface Graphique ou a usclim)
+
+
+! On balaye les faces de bord et selon un critere on affecte tel
+! ou tel type de conditions aux limites. Dans l'exemple donne
+! ci dessous, c'est la couleur (propriete 1 de la famille)
+! qui permet de distinguer les differents types de bord. On
+! aurait pu aussi travailler avec les coordonnees du centre
+! des faces, mais "c'eut ete moins pratique".
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standards" :
+! --------------------------------
+
+! Trois types de conditions "standards" sont disponibles. On
+! specifie pour chaque face le type de condition choisi.
+! Le choix se fait en remplissant le tableau IALTYB.
+
+
+! * IALTYB(IFAC) = IBFIXE : la face IFAC correspond a un bord
+! de maillage fixe. Une condition de Dirichlet nulle sera
+! affectee automatiquement a la vitesse de maillage. En
+! outre, le deplacement des noeuds sera automatiquement
+! impose a 0 (cf. plus base sur IMPALE), sauf si
+! l'utilisateur a modifie la condition pour au moins une
+! des conposantes de la vitesse de maillage (ICODCL modifie,
+! cf. conditions non standards)
+
+
+! * IALTYB(IFAC) = IGLISS : la face IFAC est une face a maillage
+! glissant. La composante normale a la face de la vitesse
+! de maillage sera forcee a 0, les autres composantes seront
+! traitees en Neumann homogene (pour les faces non alignees
+! avec les axes, la condition de Neumann homogene est
+! seulement partiellement implicitee), comme pour les
+! conditions de symetrie de la vitesse fluide.
+
+
+! * IALTYB(IFAC) = IVIMPO : la face IFAC a une vitesse de maillage
+! imposee. Cette vitesse est specifiee en remplissant le
+! tableau RCODCL correspondant :
+! RCODCL(IFAC,IUMA,1) = vitesse de maillage selon X
+! RCODCL(IFAC,IVMA,1) = vitesse de maillage selon Y
+! RCODCL(IFAC,IWMA,1) = vitesse de maillage selon Z
+! Les composantes non specifiees de RCODCL(.,I.MA,1) seront mises
+! a 0 (seules les composantes non nulles sont donc a specifier)
+
+
+
+! Pour les conditions "non standards" :
+! ------------------------------------
+
+! Autres que fixe, glissement ou vitesse imposee, on donne
+
+! - pour chaque face et chaque composante IVAR=IUMA, IVMA, IWMA :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet
+! 3 : Neumann
+! 4 : Symetrie
+! Les valeurs des 3 reels RCODCL sont les suivantes
+
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! La dimension de RCODCL(IFAC,IVAR,1) est en m/s
+
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" en kg/(m2 s) (entre la
+! valeur imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! RCODCL(IFAC,IVAR,2) = (VISCMA) / D
+! (D a la dimension d'une distance en m, VISCMA est
+! la viscosite de maillage)
+! NB : la definition de RCODCL(.,.,2) est calquee sur le cas
+! des autres variables standards de l'ecoulement. Il n'a pas
+! grand sens physique dans le cas de la vitesse de maillage.
+
+! RCODCL(IFAC,IVAR,3) :
+! Densite de flux en kg/(m s2) = J si ICODCL(IFAC,IVAR)= 3
+! (< 0 si gain, n normale orientee vers l'exterieur)
+! RCODCL(IFAC,IVAR,3) = -(VISCMA) * (GRAD Um).n
+! (ou Um represente la vitesse de maillage)
+! NB : la definition de RCODCL(.,.,3) est calquee sur le cas
+! des autres variables standards de l'ecoulement.
+! RCODCL(.,.,3) = 0.D0 permet de specifier un Neumann
+! homogene sur la vitesse de maillage. Toute autre valeur
+! aura une signification physique plus discutable.
+
+
+
+! Noter bien que si l'utilisateur affecte une valeur a IALTYB
+! parmi IBFIXE, IGLISS, IVIMPO,
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de ICODCL et RCODCL qu'il aura
+! fournies qui sont retenues pour la face et la composante
+! consideree (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+
+
+! Si l'utilisateur specifie de lui-meme la valeur de ICODCL
+! et de RCODCL pour TOUTES les composantes de la vitesse
+! de maillage, il n'est pas necessaire de specifier IALTYB
+! pour la face concernee (sa valeur ne sera pas utilisee)
+
+
+! REGLE DE COHERENCE
+! ==================
+
+! Si une condition de symetrie (ICODCL=4) a ete imposee sur
+! une des composantes, elle doit l'etre sur toutes les
+! composantes.
+
+
+! DEPLACEMENT FORCE DES NOEUDS
+! ============================
+
+! Pour plus de precision dans le deplacement du maillage, on peut
+! aussi forcer directement le deplacement de certains noeuds,
+! internes ou de bord. Pour cela on remplit les tableaux DEPALE
+! et IMPALE :
+! DEPALE(INOD,1) = deplacement du noeud INOD dans la direction X
+! DEPALE(INOD,2) = deplacement du noeud INOD dans la direction Y
+! DEPALE(INOD,3) = deplacement du noeud INOD dans la direction Z
+! Ce deplacement s'entend comme le deplacement absolu du noeud
+! a partir de sa position dans le maillage d'origine.
+! IMPALE(INOD) = 1 indique que le noeud INOD est a deplacement
+! impose (IMPALE est initialise a 0 ; si sa valeur est laissee
+! nulle, DEPALE ne sera pas pris en compte).
+
+! Lors de la mise a jour du maillage, les noeuds tels que IMPALE=1
+! (internes ou de bord) ne seront pas deplaces a partir de la
+! vitesse de maillage mais directement a partir de DEPALE.
+! Dans le cas ou tous les noeuds d'une face sont a deplacement
+! impose, il n'est pas necessaire de remplir les tableaux de
+! conditions aux limites de vitesse de maillage pour cette faces,
+! ils seront ecrases :
+! -> ICODCL sera mis a 1 (Dirichlet)
+! -> RCODCL sera mis a la valeur moyenne des vitesses des noeuds
+! de la face (vitesses calculees a partir de DEPALE)
+
+! Dans le cas de faces specifies a maillage fixes (IALTYB(IFAC)=IBFIXE),
+! tous les noeuds de la face sont automatiquement mis en
+! deplacement impose, avec une valeur nulle de DEPALE.
+
+
+! CARACTERISTIQUES DES NOEUDS
+! ===========================
+! Le nombre total de noeuds est stocke dans la variable NNOD.
+! Les coordonnees des noeuds sont accessibles par le tableau
+! XYZNOD(3,NNOD).
+! Les coordonnees des noeuds dans le maillage initiale sont
+! accessibles par le tableau XYZNO0(3,NNOD).
+
+! Le reperage des noeuds est possible a partir des faces internes et
+! de bord, grace aux tableaux IPNFAC, NODFAC, IPNFBR, NODFBR.
+! NODFAC (NODFBR) contient sequentiellement la liste des noeuds de
+! toutes les faces internes (de bord).
+! IPNFAC (IPNFBR) contient pour chaque face interne (de bord) le
+! numero de la premiere case de NODFAC (NODFBR) lui correspondant.
+
+! Par exemple, pour recuperer sequentiellement tous les noeuds de la
+! face interne IFAC, il suffit d'ecrire la boucle suivante :
+! DO II = IPNFAC(IFAC), IPNFAC(IFAC+1)-1 <- indices des elements
+! de NODFAC correspondant
+! a IFAC
+! INOD = NODFAC(II) <- recuperation du numero
+! du IIeme noeud de la face
+! IFAC
+! ...
+! ENDDO
+
+
+! INFLUENCE SUR LES CONDITIONS AUX LIMITES DE VITESSE FLUIDE EN PAROI
+! ===================================================================
+! Dans le cas de faces de paroi pour le fluide (ITYPFB=IPAROI ou IPARUG),
+! l'influence de la vitesse de maillage depend de sa signification
+! physique.
+! En effet, dans le cas d'une structure immergee par exemple, le
+! mouvement des faces de paroi de la structure correspond a un mouvement
+! physique et doit donc entrainer le fluide.
+! Dans le cas d'un piston au contraire, les bords lateraux sont des
+! parois ou le mouvement des noeuds n'a aucune signification physique et
+! ne doit pas entrainer le fluide.
+! Dans tous les cas, la vitesse de maillage normale a la face est prise
+! en compte (u.n=w.n a la face), c'est le traitement de la vitesse
+! tangentielle qui differe suivant les cas.
+
+! Par defaut, Code_Saturne gere la relation entre vitesse fluide et vitesse
+! de maillage pour les parois de la maniere suivante :
+! - Si IALTYB(IFAC) = IBFIXE, la vitesse de maillage est nulle, il n'y a
+! pas de probleme (et si la paroi est defilante, l'utilisateur le
+! specifiera dans l'interface ou dans usclim).
+! - Si IALTYB(IFAC) = IGLISS, la vitesse tangentielle de maillage n'est
+! pas prise en compte dans les conditions aux limites de paroi pour le
+! fluide (et si la paroi est defilante, l'utilisateur le specifiera
+! dans l'interface ou dans usclim).
+! - Si IALTYB(IFAC) = IVIMPO, la vitesse tangentielle de maillage est
+! prise en compte comme une vitesse de defilement dans les conditions
+! aux limites de paroi pour le fluide, sauf si une vitesse de
+! defilement de paroi a ete specifiee par l'utilisateur dans l'interface
+! ou dans usclim (auquel cas c'est cette vitesse qui est consideree).
+! - Si IMPALE(INOD) = 1 pour tous les noeuds d'une face, la vitesse
+! tangentielle de maillage deduite de ce deplacement sera prise en
+! compte comme une vitesse de defilement dans les conditions
+! aux limites de paroi pour le fluide, sauf si une vitesse de
+! defilement de paroi a ete specifiee par l'utilisateur dans l'interface
+! ou dans usclim (auquel cas c'est cette vitesse qui est consideree).
+
+! Pour les autres types de conditions aux limites pour le fluide (IENTRE et
+! ISOLIB), la vitesse de maillage n'a pas d'influence.
+
+! Dans le cas de conditions aux limites non standards, c'est a l'utilisateur
+! de gerer directement la relation entre les conditions sur la vitesse de
+! maillage et celles sur la vitesse fluide (les conditions aux limites du
+! fluide pouvant etre modifiees dans cette routine).
+
+
+
+! IDENTIFICATION DES FACES DE BORD
+! ================================
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! itrale ! e ! <-- ! numero d'iteration pour l'ale !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord pour le fluide !
+! nphas ) ! ! ! !
+! ialtyb(nfabor ! te ! --> ! type des faces de bord pour la !
+! ! te ! ! vitesse de maillage !
+! impale(nnod) ! te ! <-- ! indicateur de delacement impose !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! depale(nnod,3 ! tr ! <-- ! deplacement aux noeuds !
+! xyzno0(3,nnod ! tr ! <-- ! coordonnees noeuds maillage initial !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0 , itrale
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itypfb(nfabor,nphas), ialtyb(nfabor)
+integer impale(nnod)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision depale(nnod,3), xyzno0(3,nnod)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ii
+integer inod
+integer ilelt, nlelt
+
+double precision delta, deltaa
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+! SI UN FICHIER ISSU DE L'IHM EST UTILISE, LE SOUS-PROGRAMME N'EST
+! PAS NECESSAIREMENT INDISPENSABLE (RETURN DANS LA VERSION DE
+! LA BIBLIOTHEQUE)
+!===============================================================================
+
+if(iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ LA METHODE ALE A ETE ENCLENCHEE ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usalcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+!===============================================================================
+
+! Calcul du deplacement au temps courant
+deltaa = sin(3.141596d0*(ntcabs-1)/50.d0)
+delta = sin(3.141596d0*ntcabs/50.d0)
+
+! --- On impose en couleur 4 une vitesse de deplacement des faces
+
+CALL GETFBR('4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+ iel = ifabor(ifac)
+
+ ialtyb(ifac) = ivimpo
+ rcodcl(ifac,iuma,1) = 0.d0
+ rcodcl(ifac,ivma,1) = 0.d0
+ rcodcl(ifac,iwma,1) = (delta-deltaa)/dt(iel)
+
+enddo
+
+! --- On impose en couleur 5 un deplacement des noeuds
+
+CALL GETFBR('5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ do ii = ipnfbr(ifac), ipnfbr(ifac+1)-1
+ inod = nodfbr(ii)
+ if (impale(inod).eq.0) then
+ depale(inod,1) = 0.d0
+ depale(inod,2) = 0.d0
+ depale(inod,3) = delta
+ impale(inod) = 1
+ endif
+ enddo
+
+enddo
+
+! --- On impose en couleur 6 un glissement
+
+CALL GETFBR('6',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ialtyb(ifac) = igliss
+
+enddo
+
+! --- On impose ailleurs une condition de bord fixe
+
+CALL GETFBR( 'not (4 or 5 or 6)',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ialtyb(ifac) = ibfixe
+
+enddo
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/usalin.f90 b/users/base/usalin.f90
new file mode 100644
index 0000000..b6bc764
--- /dev/null
+++ b/users/base/usalin.f90
@@ -0,0 +1,160 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usalin
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE UTILISATEUR POUR ENTREE
+! DES PARAMETRES DE DE L'ALE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+
+include "paramx.h"
+include "optcal.h"
+include "albase.h"
+
+
+!===============================================================================
+
+! Arguments
+
+
+! VARIABLES LOCALES
+
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) return
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+
+
+! CE SOUS-PROGRAMME PERMET DE RENSEIGNER LES PARAMETRES
+
+! SPECIFIQUES AU MODULE ALE
+
+
+! IL EST POSSIBLE D'AJOUTER OU DE RETRANCHER DES PARAMETRES
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! SI L'ON DISPOSE DE L'INTERFACE DE CODE_SATURNE :
+
+! on trouvera ci-dessous des exemples commentes.
+
+! L'utilisateur pourra, si necessaire, les decommenter et les
+! adapter a ses besoins.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! --- Activation de la methode ALE
+iale = 1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! --- Nombre de sous-iterations d'initialisation du fluide. Dans le cas
+! d'un calcul suite, il s'agit du nombre d'iterations a partir du
+! debut de l'iteration en cours (i.e. pas un nombre absolu).
+! Dans le cas general, NALINF = 0 pour une suite de calcul.
+
+ nalinf = 75
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! --- Nombre maximal d'iterations d'implicitation du deplacement des
+! structures (=1 pour le couplage explicite)
+nalimx = 15
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! --- Precision relative d'implicitation du deplacement des structures
+epalim = 1.d-5
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! --- Type de viscosite de maillage (cf. usvima)
+! 0 : isotrope
+! 1 : orthotrope
+iortvm = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!----
+! FORMATS
+!----
+
+
+
+return
+end
+
diff --git a/users/base/usaste.f90 b/users/base/usaste.f90
new file mode 100644
index 0000000..002ea60
--- /dev/null
+++ b/users/base/usaste.f90
@@ -0,0 +1,263 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+!-------------------------------------------------------------------------------
+subroutine usaste &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , idfstr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! GESTION DES STRUCTURES MOBILES EN ALE AVEC COUPLAGE EXTERNE
+
+! DEFINITION DES STRUCTURES
+! DEPLACEMENT ET VITESSE INITIAUX
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! idfstr(nfabor ! te ! <-- ! definition des structures !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! aexxst,bexxst ! r ! <-- ! coefficients de prediction du deplact !
+! cfopre ! r ! <-- ! coeff de prediction des efforts !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! xstr0(ndim, ! tr ! <-- ! deplacement initial des structures !
+! nbstru) ! ! ! !
+! vstr0(ndim, ! tr ! <-- ! vitesse initiale des structures !
+! nbstru) ! ! ! !
+! xstreq(ndim, ! tr ! <-- ! deplacement du maillage initial par !
+! nbstru) ! ! ! rapport a l'equilibre !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "pointe.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+include "alaste.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nbstru
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idfstr(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac
+integer ilelt, nlelt
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+
+
+if(1.eq.1) then
+ nbaste = 0
+ return
+endif
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. DEFINITION DES STRUCTURES (appel a l'initialisation)
+!===============================================================================
+
+! On remplit le tableau IDFSTR(NFABOR)
+! IDFSTR(IFAC) est le numero de la structure a laquelle appartient
+! la face de bord IFAC (0 si elle n'appartient a aucune structure)
+! Le nombre de structure est automatiquement determine a partir du
+! plus grand element de IDFSTR (les numeros des structures doivent
+! donc etre affectes de maniere sequentielle sans trou en commencant
+! par 1).
+
+! Dans l'exemple ci-dessous la structure 1 est bordee par les faces de
+! couleur 4, la structure 2 par les faces de couleur 6
+
+
+CALL GETFBR('2 and X < 2.0',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ idfstr(ifac) = -1
+
+enddo
+
+
+CALL GETFBR('2 and X > 2.0',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ idfstr(ifac) = -2
+
+enddo
+
+! On bloque les efforts selon Z des structures 1 et 2
+
+asddlf(3,1) = 0
+asddlf(3,2) = 0
+
+
+
+! --- Indicateur d'impression au meme instant des sorties
+! Code_Saturne et Code_Aster (sortie EnSight pour Code_Aster)
+! (1: OUI, 0: NON)
+
+! Si 0, aucune sortie Code_Aster n'est enclenchee
+! l'utilisateur doit le specifie lui-meme dans le fichier de commande
+
+isyncp = 1
+
+return
+
+end
diff --git a/users/base/usclim.f90 b/users/base/usclim.f90
new file mode 100644
index 0000000..aaeb995
--- /dev/null
+++ b/users/base/usclim.f90
@@ -0,0 +1,989 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usclim &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine.
+
+! Fill boundary conditions arrays (icodcl, rcodcl)
+! for unknown variables.
+
+
+! Introduction
+! ============
+
+! Here we define boundary conditions on a per-face basis.
+
+! Boundary faces may be identified using the 'getfbr' subroutine.
+
+! getfbr(string, nelts, eltlst) :
+! - string is a user-supplied character string containing
+! selection criteria;
+! - nelts is set by the subroutine. It is an integer value
+! corresponding to the number of boundary faces verifying the
+! selection criteria;
+! - lstelt is set by the subroutine. It is an integer array of
+! size nelts containing the list of boundary faces verifying
+! the selection criteria.
+
+! string may contain:
+! - references to colors (ex.: 1, 8, 26, ...
+! - references to groups (ex.: inlet, group1, ...)
+! - geometric criteria (ex. x < 0.1, y >= 0.25, ...)
+! These criteria may be combined using logical operators
+! ('and', 'or') and parentheses.
+! Example: '1 and (group2 or group3) and y < 1' will select boundary
+! faces of color 1, belonging to groups 'group2' or 'group3' and
+! with face center coordinate y less than 1.
+
+
+
+! Boundary condition types
+! ========================
+
+! Boundary conditions may be assigned in two ways.
+
+
+! For "standard" boundary conditions:
+! -----------------------------------
+
+! (inlet, free outlet, wall, symmetry), we define a code
+! in the 'itypfb' array (of dimensions number of boundary faces,
+! number of phases). This code will then be used by a non-user
+! subroutine to assign the following conditions (scalars in
+! particular will receive the conditions of the phase to which
+! they are assigned). Thus:
+
+! Code | Boundary type
+! --------------------------
+! ientre | Inlet
+! isolib | Free outlet
+! isymet | Symmetry
+! iparoi | Wall (smooth)
+! iparug | Rough wall
+
+! Integers ientre, isolib, isymet, iparoi, iparug
+! are defined elsewhere (param.h). Their value is greater than
+! or equal to 1 and less than or equal to ntypmx
+! (value fixed in paramx.h)
+
+
+! In addition, some values must be defined:
+
+
+! - Inlet (more precisely, inlet/outlet with prescribed flow, as
+! the flow may be prescribed as an outflow):
+
+! -> Dirichlet conditions on variables
+! other than pressure are mandatory if the flow is incoming,
+! optional if the flow is outgoing (the code assigns 0 flux
+! if no Dirichlet is specified); thus,
+! at face 'ifac', for the variable 'ivar': rcodcl(ifac, ivar, 1)
+
+
+! - Smooth wall: (= impermeable solid, with smooth friction)
+
+! -> Velocity value for sliding wall if applicable
+! at face ifac, rcodcl(ifac, iu, 1)
+! rcodcl(ifac, iv, 1)
+! rcodcl(ifac, iw, 1)
+! -> Specific code and prescribed temperature value
+! at wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 5
+! rcodcl(ifac, ivar, 1) = prescribed temperature
+! -> Specific code and prescribed flux value
+! at wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 3
+! rcodcl(ifac, ivar, 3) = prescribed flux
+! =
+! Note that the default condition for scalars
+! (other than k and epsilon) is homogeneous Neumann.
+
+
+! - Rough wall: (= impermeable solid, with rough friction)
+
+! -> Velocity value for sliding wall if applicable
+! at face ifac, rcodcl(ifac, iu, 1)
+! rcodcl(ifac, iv, 1)
+! rcodcl(ifac, iw, 1)
+! -> Value of the dynamic roughness height to specify in
+! rcodcl(ifac, iu, 3) (value for iv et iw not used)
+! -> Specific code and prescribed temperature value
+! at rough wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 6
+! rcodcl(ifac, ivar, 1) = prescribed temperature
+! rcodcl(ifac, ivar, 3) = dynamic roughness height
+! -> Specific code and prescribed flux value
+! at rough wall, if applicable:
+! at face ifac, icodcl(ifac, ivar) = 3
+! rcodcl(ifac, ivar, 3) = prescribed flux
+! =
+! Note that the default condition for scalars
+! (other than k and epsilon) is homogeneous Neumann.
+
+! - Symmetry (= impermeable frictionless wall):
+
+! -> Nothing to specify
+
+
+! - Free outlet (more precisely free inlet/outlet with prescribed pressure)
+
+! -> Nothing to prescribe for pressure and velocity
+! For scalars and turbulent values, a Dirichlet value may optionally
+! be specified. The behavior is as follows:
+! * pressure is always handled as a Dirichlet condition
+! * if the mass flow is inflowing:
+! we retain the velocity at infinity
+! Dirichlet condition for scalars and turbulent values
+! (or zero flux if the user has not specified a
+! Dirichlet value)
+! if the mass flow is outflowing:
+! we prescribe zero flux on the velocity, the scalars,
+! and turbulent values
+
+! Note that the pressure will be reset to P0
+! on the first free outlet face found
+
+
+! For "non-standard" conditions:
+! ------------------------------
+
+! Other than (inlet, free outlet, wall, symmetry), we define
+! - on one hand, for each face:
+! -> an admissible 'itypfb' value
+! (i.e. greater than or equal to 1 and less than or equal to
+! ntypmx; see its value in paramx.h).
+! The values predefined in paramx.h:
+! 'ientre', 'isolib', 'isymet', 'iparoi', 'iparug' are in
+! this range, and it is preferable not to assign one of these
+! integers to 'itypfb' randomly or in an inconsiderate manner.
+! To avoid this, we may use 'iindef' if we wish to avoid
+! checking values in paramx.h. 'iindef' is an admissible
+! value to which no predefined boundary condition is attached.
+! Note that the 'itypfb' array is reinitialized at each time
+! step to the non-admissible value of 0. If we forget to
+! modify 'typfb' for a given face, the code will stop.
+
+! - and on the other hand, for each face and each variable:
+! -> a code icodcl(ifac, ivar)
+! -> three real values rcodcl(ifac, ivar, 1)
+! rcodcl(ifac, ivar, 2)
+! rcodcl(ifac, ivar, 3)
+! The value of 'icodcl' is taken from the following:
+! 1: Dirichlet (usable for any variable)
+! 3: Neumann (usable for any variable)
+! 4: Symmetry (usable only for the velocity and
+! components of the Rij tensor)
+! 5: Smooth wall (usable for any variable except for pressure)
+! 6: Rough wall (usable for any variable except for pressure)
+! 9: Free outlet (usable only for velocity)
+! The values of the 3 'rcodcl' components are
+! rcodcl(ifac, ivar, 1):
+! Dirichlet for the variable if icodcl(ifac, ivar) = 1
+! wall value (sliding velocity, temp) if icodcl(ifac, ivar) = 5
+! The dimension of rcodcl(ifac, ivar, 1) is that of the
+! resolved variable: ex U (velocity in m/s),
+! T (temperature in degrees)
+! H (enthalpy in J/kg)
+! F (passive scalar in -)
+! rcodcl(ifac, ivar, 2):
+! "exterior" exchange coefficient (between the prescribed value
+! and the value at the domain boundary)
+! rinfin = infinite by default
+! For velocities U, in kg/(m2 s):
+! rcodcl(ifac, ivar, 2) = (viscl+visct) / d
+! For the pressure P, in s/m:
+! rcodcl(ifac, ivar, 2) = dt / d
+! For temperatures T, in Watt/(m2 degres):
+! rcodcl(ifac, ivar, 2) = Cp*(viscls+visct/sigmas) / d
+! For enthalpies H, in kg /(m2 s):
+! rcodcl(ifac, ivar, 2) = (viscls+visct/sigmas) / d
+! For other scalars F in:
+! rcodcl(ifac, ivar, 2) = (viscls+visct/sigmas) / d
+! (d has the dimension of a distance in m)
+!
+! rcodcl(ifac, ivar, 3) if icodcl(ifac, ivar) <> 6:
+! Flux density (< 0 if gain, n outwards-facing normal)
+! if icodcl(ifac, ivar)= 3
+! For velocities U, in kg/(m s2) = J:
+! rcodcl(ifac, ivar, 3) = -(viscl+visct) * (grad U).n
+! For pressure P, en kg/(m2 s):
+! rcodcl(ifac, ivar, 3) = -dt * (grad P).n
+! For temperatures T, in Watt/m2:
+! rcodcl(ifac, ivar, 3) = -Cp*(viscls+visct/sigmas) * (grad T).n
+! For enthalpies H, in Watt/m2:
+! rcodcl(ifac, ivar, 3) = -(viscls+visct/sigmas) * (grad H).n
+! For other scalars F in :
+! rcodcl(ifac, ivar, 3) = -(viscls+visct/sigmas) * (grad F).n
+
+! rcodcl(ifac, ivar, 3) if icodcl(ifac, ivar) = 6:
+! Roughness for the rough wall law
+! For velocities U, dynamic roughness
+! rcodcl(ifac, ivar, 3) = rugd
+! For other scalars, thermal roughness
+! rcodcl(ifac, ivar, 3) = rugt
+
+
+! Note that if the user assigns a value to itypfb equal to
+! ientre, isolib, isymet, iparoi, or iparug
+! and does not modify icodcl (zero value by default),
+! itypfb will define the boundary condition type.
+
+! To the contrary, if the user prescribes
+! icodcl(ifac, ivar) (nonzero),
+! the values assigned to rcodcl will be used for the considered
+! face and variable (if rcodcl values are not set, the default
+! values will be used for the face and variable, so:
+! rcodcl(ifac, ivar, 1) = 0.d0
+! rcodcl(ifac, ivar, 2) = rinfin
+! rcodcl(ifac, ivar, 3) = 0.d0)
+! Especially, we may have for example:
+! -> set itypfb(ifac, iphas) = iparoi
+! which prescribes default wall conditions for all variables at
+! face ifac,
+! -> and define IN ADDITION for variable ivar on this face
+! specific conditions by specifying
+! icodcl(ifac, ivar) and the 3 rcodcl values.
+
+
+! The user may also assign to itypfb a value not equal to
+! ientre, isolib, isymet, iparoi, iparug, iindef
+! but greater than or equal to 1 and less than or equal to
+! ntypmx (see values in param.h) to distinguish
+! groups or colors in other subroutines which are specific
+! to the case and in which itypfb is accessible.
+! In this case though it will be necessary to
+! prescribe boundary conditions by assigning values to
+! icodcl and to the 3 rcodcl fields (as the value of itypfb
+! will not be predefined in the code).
+
+
+! Consistency rules
+! =================
+
+! A few consistency rules between 'icodcl' codes for
+! variables with non-standard boundary conditions:
+
+! Codes for velocity components must be identical
+! Codes for Rij components must be identical
+! If code (velocity or Rij) = 4
+! we must have code (velocity and Rij) = 4
+! If code (velocity or turbulence) = 5
+! we must have code (velocity and turbulence) = 5
+! If code (velocity or turbulence) = 6
+! we must have code (velocity and turbulence) = 6
+! If scalar code (except pressure or fluctuations) = 5
+! we must have velocity code = 5
+! If scalar code (except pressure or fluctuations) = 6
+! we must have velocity code = 6
+
+
+! Remarks
+! =======
+
+! Caution: to prescribe a flux (nonzero) to Rij,
+! the viscosity to take into account is viscl
+! even if visct exists (visct=rho cmu k2/epsilon)
+
+! We have the ordering array for boundary faces from the
+! previous time step (except for the fist time step,
+! where 'itrifb' has not been set yet).
+! The array of boundary face types 'itypfb' has been
+! reset before entering the subroutine.
+
+
+! Note how to access some variables:
+
+! Cell values
+! Let iel = ifabor(ifac)
+
+! * Density phase iphas, cell iel:
+! propce(iel, ipproc(irom(iphas)))
+! * Dynamic molecular viscosity phase iphas, cell iel:
+! propce(iel, ipproc(iviscl(iphas)))
+! * Turbulent viscosity dynamique phase iphas, cell iel:
+! propce(iel, ipproc(ivisct(iphas)))
+! * Specific heat phase iphas, cell iel:
+! propce(iel, ipproc(icp(iphasl))
+! * Diffusivity: lambda scalaire iscal, cell iel:
+! propce(iel, ipproc(ivisls(iscal)))
+
+! Boundary face values
+
+! * Density phase iphas, boundary face ifac :
+! propfb(ifac, ipprob(irom(iphas)))
+! * Mass flow relative to variable ivar, boundary face ifac:
+! (i.e. the mass flow used for convecting ivar)
+! propfb(ifac, pprob(ifluma(ivar )))
+! * For other values at boundary face ifac:
+! take as an approximation the value in the adjacent cell iel
+! i.e. as above with iel = ifabor(ifac).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! i ! <-- ! number of first free position in ia !
+! idbra0 ! i ! <-- ! number of first free position in ra !
+! ndim ! i ! <-- ! spatial dimension !
+! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
+! ncel ! i ! <-- ! number of cells !
+! nfac ! i ! <-- ! number of interior faces !
+! nfabor ! i ! <-- ! number of boundary faces !
+! nfml ! i ! <-- ! number of families (group classes) !
+! nprfml ! i ! <-- ! number of properties per family (group class) !
+! nnod ! i ! <-- ! number of vertices !
+! lndfac ! i ! <-- ! size of nodfac indexed array !
+! lndfbr ! i ! <-- ! size of nodfbr indexed array !
+! ncelbr ! i ! <-- ! number of cells with faces on boundary !
+! nvar ! i ! <-- ! total number of variables !
+! nscal ! i ! <-- ! total number of scalars !
+! nphas ! i ! <-- ! number of phases !
+! nideve, nrdeve ! i ! <-- ! sizes of idevel and rdevel arrays !
+! nituse, nrtuse ! i ! <-- ! sizes of ituser and rtuser arrays !
+! ifacel(2, nfac) ! ia ! <-- ! interior faces -> cells connectivity !
+! ifabor(nfabor) ! ia ! <-- ! boundary faces -> cells connectivity !
+! ifmfbr(nfabor) ! ia ! <-- ! boundary face family numbers !
+! ifmcel(ncelet) ! ia ! <-- ! cell family numbers !
+! iprfml ! ia ! <-- ! property numbers per family !
+! (nfml, nprfml) ! ! ! !
+! maxelt ! e ! <-- ! max number of cells and faces (int/boundary) !
+! lstelt(maxelt) ! ia ! --- ! work array !
+! ipnfac(nfac+1) ! ia ! <-- ! interior faces -> vertices index (optional) !
+! nodfac(lndfac) ! ia ! <-- ! interior faces -> vertices list (optional) !
+! ipnfbr(nfabor+1) ! ia ! <-- ! boundary faces -> vertices index (optional) !
+! nodfac(lndfbr) ! ia ! <-- ! boundary faces -> vertices list (optional) !
+! icodcl ! ia ! --> ! boundary condition code !
+! (nfabor, nvar) ! ! ! = 1 -> Dirichlet !
+! ! ! ! = 2 -> flux density !
+! ! ! ! = 4 -> sliding wall and u.n=0 (velocity) !
+! ! ! ! = 5 -> friction and u.n=0 (velocity) !
+! ! ! ! = 6 -> roughness and u.n=0 (velocity) !
+! ! ! ! = 9 -> free inlet/outlet (velocity) !
+! ! ! ! inflowing possibly blocked !
+! itrifb(nfabor ! ia ! <-- ! indirection for boundary faces ordering) !
+! (nfabor, nphas) ! ! ! !
+! itypfb ! ia ! --> ! boundary face types !
+! (nfabor, nphas) ! ! ! !
+! idevel(nideve) ! ia ! <-- ! integer work array for temporary developpement !
+! ituser(nituse ! ia ! <-- ! user-reserved integer work array !
+! ia(*) ! ia ! --- ! main integer work array !
+! xyzcen ! ra ! <-- ! cell centers !
+! (ndim, ncelet) ! ! ! !
+! surfac ! ra ! <-- ! interior faces surface vectors !
+! (ndim, nfac) ! ! ! !
+! surfbo ! ra ! <-- ! boundary faces surface vectors !
+! (ndim, nfavor) ! ! ! !
+! cdgfac ! ra ! <-- ! interior faces centers of gravity !
+! (ndim, nfac) ! ! ! !
+! cdgfbo ! ra ! <-- ! boundary faces centers of gravity !
+! (ndim, nfabor) ! ! ! !
+! xyznod ! ra ! <-- ! vertex coordinates (optional) !
+! (ndim, nnod) ! ! ! !
+! volume(ncelet) ! ra ! <-- ! cell volumes !
+! dt(ncelet) ! ra ! <-- ! time step (per cell) !
+! rtp, rtpa ! ra ! <-- ! calculated variables at cell centers !
+! (ncelet, *) ! ! ! (at current and preceding time steps) !
+! propce(ncelet, *)! ra ! <-- ! physical properties at cell centers !
+! propfa(nfac, *) ! ra ! <-- ! physical properties at interior face centers !
+! propfb(nfabor, *)! ra ! <-- ! physical properties at boundary face centers !
+! coefa, coefb ! ra ! <-- ! boundary conditions !
+! (nfabor, *) ! ! ! !
+! rcodcl ! ra ! --> ! boundary condition values !
+! ! ! ! rcodcl(1) = Dirichlet value !
+! ! ! ! rcodcl(2) = exterior exchange coefficient !
+! ! ! ! (infinite if no exchange) !
+! ! ! ! rcodcl(3) = flux density value !
+! ! ! ! (negative for gain) in w/m2 or !
+! ! ! ! roughness height (m) if icodcl=6 !
+! ! ! ! for velocities ( vistl+visct)*gradu !
+! ! ! ! for pressure dt*gradp !
+! ! ! ! for scalars cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! ra ! --- ! work arrays !
+! (ncelet) ! ! ! (computation of pressure gradient) !
+! coefu ! ra ! --- ! tab de trav !
+! (nfabor, 3) ! ! ! (computation of pressure gradient) !
+! rdevel(nrdeve) ! ra ! <-> ! tab reel complementaire developemt !
+! rdevel(nideve) ! ra ! <-- ! real work array for temporary developpement !
+! rtuser(nituse ! ra ! <-- ! user-reserved real work array !
+! ra(*) ! ra ! --- ! main real work array !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! Local variables
+
+integer idebia, idebra
+integer ifac, iel, ii, ivar, iphas
+integer ilelt, nlelt
+double precision uref2, d2s3
+double precision rhomoy, dh, ustar2
+double precision xintur
+double precision xkent, xeent
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+!===============================================================================
+
+if(iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/, &
+'@ @@ WARNING: stop in definition of boundary conditions',/, &
+'@ =======',/, &
+'@ The user subroutine ''usclim'' must be completed.',/, &
+'@',/, &
+'@ The calculation will not be run.',/, &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/)
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. Initialization
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. Assign boundary conditions to boundary faces here
+
+! We may use selection criteria to filter boundary case subsets
+! Loop on faces from a subset
+! Set the boundary condition for each face
+!===============================================================================
+
+! --- For boundary faces of color 2 and x <= 0.01,
+! assign an inlet for all phases
+call getfbr('2 and x < 0.01', nlelt, lstelt)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+ iel = ifabor(ifac)
+
+ do iphas = 1, nphas
+
+ itypfb(ifac,iphas) = ientre
+
+ rcodcl(ifac,iu(iphas),1) = 1.1d0
+ rcodcl(ifac,iv(iphas),1) = 1.1d0
+ rcodcl(ifac,iw(iphas),1) = 1.1d0
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+
+
+ ! Turbulence example computed using equations valid for a pipe.
+
+ ! We will be careful to specify a hydraulic diameter adapted
+ ! to the current inlet.
+
+ ! We will also be careful if necessary to use a more precise
+ ! formula for the dynamic viscosity use in the calculation of
+ ! the Reynolds number (especially if it is variable, it may be
+ ! useful to take the law from 'usphyv'. Here, we use by default
+ ! the 'viscl0" value given in 'usini1'.
+ ! Regarding the density, we have acess to its value at boundary
+ ! faces (romb) so this value is the one used here (specifically,
+ ! it is consistent with the processing in 'usphyv', in case of
+ ! variable density)
+
+ ! Hydraulic diameter
+ dh = 0.075d0
+
+ ! Calculation of friction velocity squared (ustar2)
+ ! and of k and epsilon at the inlet (xkent and xeent) using
+ ! standard laws for a circular pipe
+ ! (their initialization is not needed here but is good practice).
+ rhomoy = propfb(ifac,ipprob(irom(iphas)))
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+
+ call keendb &
+ !==========
+ ( uref2, dh, rhomoy, viscl0(iphas), cmu, xkappa, &
+ ustar2, xkent, xeent )
+
+ ! itytur is a flag equal to iturb/10
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ ! --- Handle scalars attached to the current phase
+ if(nscal.gt.0) then
+ do ii = 1, nscal
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+
+ enddo
+
+enddo
+
+! --- Prescribe at boundary faces of color 3 an inlet for all phases
+call getfbr('3', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+ iel = ifabor(ifac)
+
+ do iphas = 1, nphas
+
+ itypfb(ifac,iphas) = ientre
+
+ rcodcl(ifac,iu(iphas),1) = 1.1d0
+ rcodcl(ifac,iv(iphas),1) = 1.1d0
+ rcodcl(ifac,iw(iphas),1) = 1.1d0
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+
+ ! Turbulence example computed using turbulence intensity data.
+
+ ! We will be careful to specify a hydraulic diameter adapted
+ ! to the current inlet.
+
+ ! Hydraulic diameter
+
+ dh = 0.075d0
+ ! Turbulence intensity
+ xintur = 0.02d0
+
+ ! Calculation of k and epsilon at the inlet (xkent and xeent) using
+ ! the turbulence intensity and standard laws for a circular pipe
+ ! (their initialization is not needed here but is good practice)
+ xkent = epzero
+ xeent = epzero
+
+ call keenin &
+ !==========
+ ( uref2, xintur, dh, cmu, xkappa, xkent, xeent )
+
+ ! itytur is a flag equal to iturb/10
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ ! --- Handle scalars attached to the current phase
+ if(nscal.gt.0) then
+ do ii = 1, nscal
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+
+ enddo
+enddo
+
+! --- Prescribe at boundary faces of group 'outlet' an outlet for all phases
+call getfbr('outlet', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ! Outlet: zero flux for velocity and temperature, prescribed pressure
+ ! Note that the pressure will be set to P0 at the first
+ ! free outlet face (isolib)
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = isolib
+ enddo
+
+enddo
+
+! --- Prescribe at boundary faces of color 5 a wall for all phases
+call getfbr('5', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ! Wall: zero flow (zero flux for pressure)
+ ! friction for velocities (+ turbulent variables)
+ ! zero flux for scalars
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = iparoi
+ enddo
+
+ ! If sliding wall with velocity u(1) = 1:
+ ! rcodcl(ifac, iu(1), 1) = 1.d0
+
+ ! If sliding wall with velocity u = 0: nothing to do
+
+ if(nscal.gt.0) then
+
+ ! If temperature prescribed to 20 with wall law (scalar ii=1):
+ ! ii = 1
+ ! icodcl(ifac, isca(ii)) = 5
+ ! rcodcl(ifac, isca(ii), 1) = 20.d0
+
+ ! If temperature prescribed to 50 with no wall law (simple Dirichlet)
+ ! with exchange coefficient 8 (scalar ii=2):
+ ! ii = 2
+ ! icodcl(ifac, isca(ii)) = 1
+ ! rcodcl(ifac, isca(ii),1) = 50.d0
+ ! rcodcl(ifac, isca(ii), 2) = 8.d0
+
+ ! If flux prescribed to 4.d0 (scalar ii=3):
+ ! ii = 3
+ ! icodcl(ifac, isca(ii)) = 3
+ ! rcodcl(ifac, isca(ii), 3) = 4.D0
+
+ endif
+enddo
+
+! --- Prescribe at boundary faces of color 7 a rough wall for all phases
+call getfbr('7', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ! Wall: zero flow (zero flux for pressure)
+ ! rough friction for velocities (+ turbulent variables)
+ ! zero flux for scalars
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = iparug
+
+ ! Roughness for velocity: 1cm
+ rcodcl(ifac,iu(iphas),3) = 0.01d0
+ enddo
+
+ ! If sliding wall with velocity u(1) = 1:
+ ! rcodcl(ifac, iu(1), 1) = 1.d0
+
+ ! If sliding wall with velocity u = 0: nothing to do
+ if(nscal.gt.0) then
+
+ ! If temperature prescribed to 20 with rough wall law (scalar ii=1)
+ ! with roughness of 1 cm:
+ ! ii = 1
+ ! icodcl(ifac, isca(ii)) = 5
+ ! rcodcl(ifac, isca(ii), 1) = 20.d0
+ ! rcodcl(ifac, isca(ii), 3) = 0.01.d0
+
+ ! If flux prescribed to 4.d0 (scalar ii=3):
+ ! ii = 3
+ ! icodcl(ifac, isca(ii)) = 3
+ ! rcodcl(ifac, isca(ii), 3) = 4.D0
+
+ endif
+
+enddo
+
+! --- Prescribe at boundary faces of color 4 a symmetry
+call getfbr('4', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ! Symmetries
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = isymet
+ enddo
+
+enddo
+
+! From this point on, the examples given are destined to an ADVANCED USE,
+! the user being led to define complex boundary condition combinations.
+
+
+! --- Example of specific boundary conditions fully defined by the user,
+! on the basis of wall conditions.
+! selection (mass flow computation, specific logging, ...)
+! We prescribe for color 1234 a wall for all phases, with in addition:
+! - a Dirichlet condition on velocity of phase 1 (sliding wall
+! with no-slip condition)
+! - a Dirichlet condition on the first scalar.
+
+call getfbr('1234', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = iparoi
+ enddo
+
+ iphas = 1
+ icodcl(ifac,iu(iphas) ) = 1
+ rcodcl(ifac,iu(iphas),1) = 1.d0
+ rcodcl(ifac,iu(iphas),2) = rinfin
+ rcodcl(ifac,iu(iphas),3) = 0.d0
+ icodcl(ifac,iv(iphas) ) = 1
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),2) = rinfin
+ rcodcl(ifac,iv(iphas),3) = 0.d0
+ icodcl(ifac,iw(iphas) ) = 1
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),2) = rinfin
+ rcodcl(ifac,iw(iphas),3) = 0.d0
+
+ ivar = isca(1)
+ icodcl(ifac,ivar ) = 1
+ rcodcl(ifac,ivar,1) = 10.d0
+ rcodcl(ifac,ivar,2) = rinfin
+ rcodcl(ifac,ivar,3) = 0.d0
+
+enddo
+
+! --- Example of specific boundary conditions fully defined by the user,
+! with no definition of a specific type.
+! We prescribe at color 5678 a homogeneous Neumann condition for
+! all variables (whatever the phase).
+
+call getfbr('5678', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! CAUTION: the value of itypfb must be assigned to iindef
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = iindef
+ enddo
+
+ do ii = 1, nvar
+ icodcl(ifac,ii ) = 3
+ rcodcl(ifac,ii,1) = 0.d0
+ rcodcl(ifac,ii,2) = rinfin
+ rcodcl(ifac,ii,3) = 0.d0
+ enddo
+
+enddo
+
+! --- Example of specific boundary conditions fully defined by the user,
+! with the definition of a specific type, for example for future
+! selection (mass flow computation, specific logging, ...)
+! We prescribe for color 6789 a homogeneous Neumann condition for
+! all variables (whatever the phase), except for the first
+! scalar, for which we select a homogeneous Dirichlet.
+
+call getfbr('6789', nlelt, lstelt)
+!==========
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! CAUTION: the value of itypfb must be different from
+! iparoi, ientre, isymet, isolib, iindef,
+! greater than or equal to 1, and
+! less than or equal to ntypmx;
+! these integers are defined in paramx.h
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = 89
+ enddo
+
+ do ii = 1, nvar
+ icodcl(ifac,ii ) = 3
+ rcodcl(ifac,ii,1) = 0.d0
+ rcodcl(ifac,ii,2) = rinfin
+ rcodcl(ifac,ii,3) = 0.d0
+ enddo
+
+ icodcl(ifac,isca(1) ) = 1
+ rcodcl(ifac,isca(1),1) = 0.d0
+ rcodcl(ifac,isca(1),2) = rinfin
+ rcodcl(ifac,isca(1),3) = 0.d0
+
+enddo
+
+!----
+! Formats
+!----
+
+!----
+! End
+!----
+
+return
+end subroutine
diff --git a/users/base/usdpst.f90 b/users/base/usdpst.f90
new file mode 100644
index 0000000..754991a
--- /dev/null
+++ b/users/base/usdpst.f90
@@ -0,0 +1,531 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usdpst &
+!=================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LOCALISER DES CELLULES, DES FACES
+! INTERNES ET/OU DES FACES DE BORD DEFINISSANT UN MAILLAGE DE
+! POST-TRAITEMENT.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! lstcel ! te ! --- ! tableau de travail (liste des !
+! (ncelet) ! ! ! cellules d'un maillage de sortie) !
+! lstfac ! te ! --- ! tableau de travail (liste des faces !
+! (nfac) ! ! ! internes d'un maillage de sortie) !
+! lstfbr ! te ! --- ! tableau de travail (liste des faces !
+! (nfabor) ! ! ! de bord d'un maillage de sortie) !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelet), lstfac(nfac), lstfbr(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer indmod, icas, nbcas, ipart, nbpart, ipref
+integer ntchrl
+
+integer nlcel, nlfac , nlfbr
+integer iel, ifac , ii
+integer idebia, idebra
+integer icoul , icoul1, icoul2, iel1 , iel2
+character*32 nomcas, nomfmt, nommai
+character*96 nomrep, optfmt
+
+double precision xfac , yfac , zfac
+
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+nbcas = 0
+nbpart = 0
+
+! Entiers "pointeurs" sur la premiere case libre de IA et RA
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! CREATION DES GESTIONNAIRES D'ECRITURE POUR LE POST TRAITEMENT
+! (UN PAR CAS ET PAR FORMAT, A RENSEIGNER PAR L'UTILISATEUR)
+!===============================================================================
+
+! NOMBRE DE GESTIONNAIRES (case au sens EnSight, etude au sens MED,
+! ou racine d'une arborescence CGNS)
+
+nbcas = 4
+
+do icas = 1, nbcas
+
+! INITIALISATIONS DIVERSES
+
+ do ii = 1, len(nomcas)
+ NOMCAS (II:II) = ' '
+ enddo
+ do ii = 1, len(nomrep)
+ NOMREP (II:II) = ' '
+ enddo
+ do ii = 1, len(nomfmt)
+ NOMFMT (II:II) = ' '
+ enddo
+ do ii = 1, len(optfmt)
+ OPTFMT (II:II) = ' '
+ enddo
+
+! DEFINITION UTILISATEUR :
+
+! NOMCAS et NOMREP indiquent respectivement le prefixe du nom
+! des fichiers et le repertoire correspondant.
+! Si NOMREP est de la forme xxxx.ensight ou xxxx.med, le lanceur le
+! rapatriera automatiquement sous le nom XXXX.ENSIGHT.$DATE ou
+! XXXX.MED.$DATE dans le repertoire RESU. Si NOMREP est d'une autre
+! forme, il faudra gerer son rapatriement a la main.
+
+! NOMFMT permet de choisir le format de sortie
+! ("EnSight Gold", "MED_fichier", ou "CGNS").
+
+! OPTFMT permet de fournir des options specifiques au format de
+! sortie (separees par des virgules) ;
+! Pour EnSight : "text" ou "binary" (defaut),
+! Pour EnSight, MED, ou CGNS :
+! "discard_polygons" pour supprimer les polygones,
+! "discard_polyhedra" pour supprimer les polyedres.
+! Pour EnSight ou MED :
+! "divide_polygons" pour d�couper les polygones,
+! "divide_polyhedra" pour d�couper les polyedres.
+
+! INDMOD indique si les maillages ecrits seront :
+! 0 : fixes,
+! 1 : deformables a topologie constante,
+! 2 : modifiables (pourront etre completement redefinis en
+! cours de calcul via le sous-programme USMPST).
+! 10 : comme INDMOD = 0, avec champ de d�placement
+! 11 : comme INDMOD = 1, avec champ de d�placement
+! 12 : comme INDMOD = 2, avec champ de d�placement
+
+! NTCHRL donne la frequence de sortie par defaut associee,
+! (la sortie a un pas de temps donne pouvant etre forcee ou
+! empechee via le sous-programme utilisateur USNPST).
+
+ if (icas .eq. 1) then
+
+ NOMCAS = 'chr'
+ NOMREP = 'EnSight'
+ NOMFMT = 'EnSight Gold'
+ OPTFMT = 'binary, discard_polygons'
+ indmod = 0
+ ntchrl = 4
+
+ else if (icas .eq. 2) then
+
+ NOMCAS = 'chr'
+ NOMREP = 'EnSight_text'
+ NOMFMT = 'ensight'
+ OPTFMT = 'text, discard_polyhedra'
+ indmod = 1
+ ntchrl = ntchr
+
+ else if (icas .eq. 3) then
+
+ NOMCAS = 'modif'
+ NOMREP = 'EnSight'
+ NOMFMT = 'ensight'
+ OPTFMT = 'discard_polyhedra'
+ indmod = 2
+ ntchrl = ntchr
+ ntchrl = 2
+
+ else if (icas .eq. 4) then
+
+ NOMCAS = 'CHR'
+ NOMREP = ' '
+ NOMFMT = 'MED'
+ OPTFMT = ' '
+ indmod = 1
+ ntchrl = ntchr
+
+ endif
+
+! DEFINITION EFFECTIVE
+
+ call pstcwr (icas , nomcas, nomrep, nomfmt, optfmt, indmod, ntchrl)
+ !==========
+
+enddo
+
+!===============================================================================
+! NOMBRE DE MAILLAGES EXTRAITS POUR POST TRAITEMENT
+! A RENSEIGNER PAR L'UTILISATEUR
+!===============================================================================
+
+! NBPART est le nombre de "parts" qui seront generees
+! (au sens EnSight ; les �quivalents MED et CGNS sont le maillage
+! et la base respectivement)
+
+! Une "part" peut etre tout volume ou surface que l'on definira par
+! l'identification des cellules ou faces du maillage
+
+! Exemple : 4 "parts", correspondant respectivement � une coupe
+! mixte faces de bord / faces internes, puis � une coupe
+! contenant uniquement des faces internes, puis � deux extraits
+! evolutifs du maillage global. On ajoutera une 5eme "part",
+! alias de la 2eme.
+
+nbpart = 4
+
+!===============================================================================
+! DEBUT DE LA BOUCLE SUR LES PARTS DEFINIES PAR L'UTILISATEUR
+!===============================================================================
+
+do ipart = 1, nbpart
+
+
+!===============================================================================
+! INITIALISATIONS DIVERSES
+! PAS D'INTERVENTION UTILISATEUR REQUISE
+!===============================================================================
+
+ nlcel = 0
+ nlfac = 0
+ nlfbr = 0
+ do iel = 1, ncelet
+ lstcel(iel) = 0
+ enddo
+ do ifac = 1, nfac
+ lstfac(ifac) = 0
+ enddo
+ do ifac = 1, nfabor
+ lstfbr(ifac) = 0
+ enddo
+
+ do ii = 1, len(nommai)
+ NOMMAI(II:II) = ' '
+ enddo
+
+!===============================================================================
+! REPERAGE DES CELLULES OU FACES INCLUSES DANS LE MAILLAGE
+! A RENSEIGNER PAR L'UTILISATEUR
+!===============================================================================
+
+! Ce sous programme est appele avant la definition des
+! conditions aux limites
+
+
+! POUR LA 1ere COUPE (PART 1) : coupe exemple
+
+! Exemple : on selectionne
+! les faces internes situees entre une cellule de
+! couleur 2 et une cellule de couleur 3
+! et les faces de bord de couleur 4
+
+ if (ipart .eq. 1) then
+
+ NOMMAI = 'Coupe 1'
+
+! Pour les faces internes
+
+ do ifac = 1, nfac
+
+! Elements voisins
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+
+! Couleur des elements voisins
+ icoul1 = iprfml(ifmcel(iel1),1)
+ icoul2 = iprfml(ifmcel(iel2),1)
+
+! Determination si la face appartient a la coupe
+
+ if ((icoul1.eq.2.and.icoul2.eq.3).or.(icoul1.eq.3.and.icoul2.eq.2)) then
+ nlfac = nlfac+1
+ lstfac(nlfac)= ifac
+ endif
+
+ enddo
+
+! Pour les faces de bord
+
+ do ifac = 1, nfabor
+
+! Couleur de la face
+ icoul = iprfml(ifmfbr(ifac),1)
+
+! Determination si la face appartient a la coupe
+ if (icoul.eq.4) then
+ nlfbr = nlfbr+1
+ lstfbr(nlfbr)= ifac
+ endif
+
+ enddo
+
+
+
+! POUR LA 2eme COUPE (PART 2) : coupe exemple
+
+! Exemple : on selectionne
+! les faces internes situees a y = 0.5
+
+ else if (ipart .eq. 2) then
+
+ NOMMAI = 'Coupe 2'
+
+! Pour les faces internes
+
+ do ifac = 1, nfac
+
+! Determination si la face appartient a la coupe
+
+! Centre de gravite de la face
+ xfac = cdgfac(1,ifac)
+ yfac = cdgfac(2,ifac)
+ zfac = cdgfac(3,ifac)
+
+ if ((yfac .gt. 0.4999).and.(yfac .lt. 0.5001)) then
+ nlfac = nlfac+1
+ lstfac(nlfac)= ifac
+ endif
+
+ enddo
+
+! POUR LA PART NUMERO 3 (EXTRAIT DU DOMAINE FLUIDE)
+
+! Par defaut : on selectionne toutes les cellules, on modifiera
+! la selection dans USMPST
+
+ else if (ipart .eq. 3) then
+
+ NOMMAI = 'Volume v > 0.5'
+
+ nlcel = ncel
+ nlfac = 0
+ nlfbr = 0
+
+! POUR LA PART NUMERO 4 (EXTRAIT DU DOMAINE FLUIDE)
+
+! Par defaut : on selectionne toutes les faces de bord,
+! on modifiera la selection dans USMPST
+
+ else if (ipart .eq. 4) then
+
+ NOMMAI = 'Surface "iso" v'
+
+ nlcel = 0
+ nlfac = 0
+ nlfbr = nfabor
+
+ endif
+
+!===============================================================================
+! CREATION DES STRUCTURES CONSERVANT LES DONNEES DES PARTS
+! PAS D'INTERVENTION UTILISATEUR REQUISE
+!===============================================================================
+
+ call pstcma (ipart, nommai, nlcel, nlfac, nlfbr, lstcel, lstfac, lstfbr)
+ !==========
+
+!===============================================================================
+! IDENTIFICATION DU MAILLAGE EXTRAIT ET GESTION DE SORTIE
+! A RENSEIGNER PAR L'UTILISATEUR
+!===============================================================================
+
+ if ((ipart .eq. 1) .or. (ipart .eq. 2)) then
+
+! Les maillages extraits numero 1 et 2 sont associes aux cas 1 et 2
+ icas = 1
+ call pstass(ipart, icas)
+ !==========
+ icas = 2
+ call pstass(ipart, icas)
+ !==========
+
+ else if ((ipart .eq. 3) .or. (ipart .eq. 4)) then
+
+! Les maillages extraits numero 3 et 4 sont associes au cas 3
+ icas = 3
+ call pstass(ipart, icas)
+ !==========
+
+ endif
+
+!===============================================================================
+! FIN DE LA BOUCLE SUR LES PARTS DEFINIES PAR L'UTILISATEUR
+!===============================================================================
+
+enddo
+
+!===============================================================================
+! TRAITEMENT DES ALIAS EVENTUELS ; UN ALIAS EST SURTOUT UTILE
+! LORSQU'ON LUI AFFECTE UN 'WRITER' DIFFERENT DU MAILLAGE AUQUEL
+! IL FAIT REFERENCE, AVEC LEQUEL ON PEUT SORTIR DES VARIABLES
+! DIFFERENTES, SANS DUPLICATION EN MEMOIRE DU MAILLAGE POST
+!===============================================================================
+
+! PART NUMERO 7 : ALIAS DE LA PART 2 (POUR SORTIES DE VARIABLES
+! ASSOCIEES INDEPENDANTE)
+
+ipart = 5
+ipref = 2
+
+call pstalm(ipart, ipref)
+!==========
+
+! Pour le maillage numero 5 : writer 3
+icas = 3
+call pstass(ipart, icas)
+!==========
+
+
+return
+
+!===============================================================================
+! FORMATS
+!===============================================================================
+
+end
+
diff --git a/users/base/ushist.f90 b/users/base/ushist.f90
new file mode 100644
index 0000000..337840a
--- /dev/null
+++ b/users/base/ushist.f90
@@ -0,0 +1,423 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ushist &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SORTIE D'HISTORIQUES NON STD LIVREE A L'UTILISATEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ii, kk, node, ndrang, nvarpp, numcel, lng
+double precision xx, yy, zz, xyztmp(3)
+
+! Numero des noeuds ou on sort des historiques
+integer ncapmx
+parameter (ncapmx=100)
+integer icapt(ncapmx)
+save icapt
+integer ircapt(ncapmx)
+save ircapt
+
+! Nombre de noeuds ou on sort des historiques
+integer ncapts
+save ncapts
+
+! Numero du passage actuel dans ce ss pgm
+integer ipass
+data ipass /0/
+save ipass
+
+! Tableau de valeurs temporaires
+double precision vacapt(ncapmx)
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! ---> Gestion memoire
+
+idebia = idbia0
+idebra = idbra0
+
+! ---> Numero du passage actuel dans ce ss pgm
+
+ipass = ipass + 1
+
+!===============================================================================
+! 2. RECHERCHE DES CAPTEURS
+!===============================================================================
+! Les numeros stockes dans IRCAPT donnent le rang du processeur sur
+! lequel se trouve la sonde. L'utilisateur n'a pas a s'en preoccuper
+! specialement tant qu'il utilise bien la fonction FINDPT pour reperer
+! les sondes.
+
+
+! Au premier passage : reperage des numeros de cellule dont le centre est
+! le plus proche des coordonnees XX YY ZZ.
+! En parallelisme, le numero de cellule ICAPT(II) est local au processeur
+! dont le rang est donne par IRCAPT(II) (de 0 a nombre de processeurs-1).
+! NCAPTS donne le nombre de sondes total.
+
+if (ipass.eq.1) then
+
+ ii = 0
+
+ xx = 0.20d0
+ yy = 0.15d0
+ zz = 0.01d0
+ call findpt &
+ !==========
+ ( ncelet , ncel , xyzcen , &
+ xx , yy , zz , node , ndrang)
+ ii = ii + 1
+ icapt(ii) = node
+ ircapt(ii) = ndrang
+
+ xx = 0.70d0
+ yy = 0.15d0
+ zz = 0.01d0
+ call findpt &
+ !==========
+ ( ncelet , ncel , xyzcen , &
+ xx , yy , zz , node , ndrang)
+ ii = ii + 1
+ icapt(ii) = node
+ ircapt(ii) = ndrang
+
+ xx = 0.20d0
+ yy = 0.75d0
+ zz = 0.01d0
+ call findpt &
+ !==========
+ ( ncelet , ncel , xyzcen , &
+ xx , yy , zz , node , ndrang)
+ ii = ii + 1
+ icapt(ii) = node
+ ircapt(ii) = ndrang
+
+ xx = 0.70d0
+ yy = 0.75d0
+ zz = 0.01d0
+ call findpt &
+ !==========
+ ( ncelet , ncel , xyzcen , &
+ xx , yy , zz , node , ndrang)
+ ii = ii + 1
+ icapt(ii) = node
+ ircapt(ii) = ndrang
+
+ ncapts = ii
+
+ if(ii.gt.ncapmx) then
+ WRITE(NFECRA,*) ' USHIST : NCAPMX = ',II,' AU MINIMUM '
+ call csexit (1)
+ endif
+
+endif
+
+
+!===============================================================================
+! 3. OUVERTURE DES FICHIERS
+! EXEMPLE D'UNE VARIABLE PAR FICHIER
+!===============================================================================
+
+! ---> Nombre de variables = nombre de fichiers
+
+nvarpp = nvar
+
+
+! ---> Au premier passage, on ouvre les fichiers et on ecrit une entete
+
+if(ipass.eq.1) then
+
+! --> Test du nombre max de fichiers
+
+ if(nvarpp.gt.nushmx) then
+ write(nfecra,*) &
+ ' USHIST : PAS DROIT A PLUS DE ',NUSHMX,' FICHIERS HISTORIQUES'
+ call csexit (1)
+ endif
+
+ do ii = 1, nvarpp
+
+! --> Ouverture des fichiers avec les unites disponibles
+
+ if (irangp.le.0) then
+ open(file=ficush(ii),unit=impush(ii))
+ endif
+
+! --> On imprime le numero (global) de la cellule et les coordonnees
+! du centre
+
+ do kk = 1, ncapts
+! Numero de cellule (en parallele : local au processeur courant)
+ numcel = icapt(kk)
+ if (irangp.lt.0 .or. irangp.eq.ircapt(kk)) then
+! Coordonnees de la cellule (en parallele, c'est le processeur
+! qui la contient qui travaille)
+ xyztmp(1) = xyzcen(1,numcel)
+ xyztmp(2) = xyzcen(2,numcel)
+ xyztmp(3) = xyzcen(3,numcel)
+ else
+! Valeurs bidons sur les autres processeurs
+ xyztmp(1) = 0.d0
+ xyztmp(2) = 0.d0
+ xyztmp(3) = 0.d0
+ endif
+! En parallele, le processeur qui a trouve la cellule
+! envoie son numero global et ses coordonnees aux autres.
+ if (irangp.ge.0) then
+ call parcel(icapt(kk), ircapt(kk), numcel)
+ !==========
+ lng = 3
+ call parbcr(ircapt(kk), lng , xyztmp)
+ !==========
+ endif
+! On ecrit les informations (seul le processeur 0
+! travaille en parallele : on n'a pasa besoin de
+! plusieurs exemplaires du fichier)
+ if (irangp.le.0) then
+ WRITE(IMPUSH(II),1000) '#',' Cellule ',NUMCEL, &
+ ' Coord ',XYZTMP(1),XYZTMP(2),XYZTMP(3)
+ endif
+
+ enddo
+
+ enddo
+
+endif
+
+ 1000 format(a,a9,i10,a7,3e14.5)
+
+!===============================================================================
+! 4. ECRITURE
+! EXEMPLE D'UNE VARIABLE PAR FICHIER
+!===============================================================================
+
+! Ecriture du numero du pas de temps,
+! de la valeur du temps physique
+! de la variable en tous les points d'historiques
+! En sequentiel, la valeur a ecrire est simplement RTP(ICAPT(KK),II)
+! en parallele, la valeur a ecrire peut etre sur un autre processeur
+! et il faut la determiner dans VACAPT(KK) avec PARHIS.
+
+do ii = 1 , nvarpp
+ do kk = 1, ncapts
+ if (irangp.lt.0) then
+ vacapt(kk) = rtp(icapt(kk),ii)
+ else
+ call parhis(icapt(kk), ircapt(kk), rtp(1,ii), vacapt(kk))
+ !==========
+ endif
+ enddo
+ if (irangp.le.0) then
+ write (impush(ii),1010) ntcabs,ttcabs, &
+ (vacapt(kk),kk=1,ncapts)
+ endif
+enddo
+
+
+
+! ATTENTION : IL FAUT ADAPTER LE FORMAT POUR PLUS DE 9 CAPTEURS
+
+
+ 1010 format(i10,10e17.9)
+
+!===============================================================================
+! 4. FERMETURE
+!===============================================================================
+
+if(ntcabs.eq.ntmabs .and. irangp.le.0) then
+ do ii = 1, nvarpp
+ close(impush(ii))
+ enddo
+endif
+
+
+!===============================================================================
+! 5. SORTIE
+!===============================================================================
+
+return
+end
diff --git a/users/base/usini1.f90 b/users/base/usini1.f90
new file mode 100644
index 0000000..678e0ff
--- /dev/null
+++ b/users/base/usini1.f90
@@ -0,0 +1,2154 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+! Purpose:
+! -------
+
+! User subroutines for input of calculation parameters (Fortran commons).
+! These subroutines are called in all cases.
+
+! If the Code_Saturne GUI is used, this file is not required (but may be
+! used to override parameters entered through the GUI, and to set
+! parameters not accessible through the GUI).
+
+! Several routines are present in the file, each destined to defined
+! specific parameters.
+
+! To modify the default value of parameters which do not appear in the
+! examples provided, code should be placed as follows:
+! - usipsu for numerical and physical options
+! - usipes for input-output related options
+
+! As a convention, "specific physics" defers to the following modules only:
+! pulverized coal, gas combustion, electric arcs.
+
+!-------------------------------------------------------------------------------
+
+
+!===============================================================================
+
+
+subroutine usipph &
+!================
+
+ ( nphmax, nphas , iihmpu, nfecra , iturb , icp , iverif )
+
+
+!===============================================================================
+! Purpose:
+! --------
+
+! User subroutine for input of parameters depending on the number of phases.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nphmax ! i ! <-- ! maximum number of phases !
+! nphas ! i ! <-- ! number of active phases !
+! iihmpu ! i ! <-- ! indicates if the XML file from the GUI is !
+! ! ! ! used (1: yes, 0: no) !
+! nfecra ! i ! <-- ! Fortran unit number for standard output !
+! iturb(nphmax) ! ia ! <-> ! turbulence model !
+! icp(nphmax) ! ia ! <-> ! flag for uniform Cp or not !
+! iverif ! i ! <-- ! flag for elementary tests !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+
+! No common should appear here
+
+
+!===============================================================================
+
+! Arguments
+
+integer nphmax, nphas, iihmpu, nfecra
+integer iturb(nphmax), icp(nphmax)
+integer iverif
+
+! VARIABLES LOCALES
+
+integer iphas
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+!===============================================================================
+
+if (iverif.eq.0) then
+ if(iihmpu.eq.1) then
+ return
+ else
+ write(nfecra,9000)
+ call csexit (1)
+ endif
+endif
+
+ 9000 format( &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/, &
+'@ @@ WARNING: stop in data input',/, &
+'@ =======',/, &
+'@ The user subroutine ''usipph'' must be completed',/, &
+'@ in file usini1.f90',/, &
+'@',/, &
+'@ The calculation will not be run.',/, &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+
+
+! In this subroutine, only the parameters which already appear may
+
+! be set, to the exclusion of any other.
+! ================
+
+
+! If we are not using the Code_Saturne GUI:
+
+! All the parameters which appear in this subroutine must be set.
+! ===
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If we are using the Code_Saturne GUI:
+
+! we will find in the user subroutines commented examples
+! on the model of the present section.
+
+! If necessary, the user may uncomment them and adapt them to
+! his needs.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!===============================================================================
+
+! --- Turbulence (for each phase)
+! 0...Laminar
+! 10...Mixing length
+! 20...k-epsilon
+! 21...k-epsilon (linear production)
+! 30...Rij-epsilon, (standard LRR)
+! 31...Rij-epsilon (SSG)
+! 40...LES (Smagorinsky)
+! 41...LES (Dynamic)
+! 42...LES (WALE)
+! 50...v2f (phi-model)
+! 60...k-omega SST
+! For 10, contact the development team before use
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+iturb(iphas) = 20
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Variable specific heat (ICP=1) or not (ICP=0)
+! for each phase IPHAS
+
+! Should be set only if specific physics (coal, combustion, electric arcs)
+! ARE NOT activated.
+
+! For these specific physics, ICP MUST NOT BE MODIFIED here, and the
+! following options are forced:
+! coal and combustion: constant CP constant;
+! electric arcs: variable CP.
+
+! Caution: complete usphyv with the law defining Cp
+! ========= if and only if variable Cp has been selected here
+! (with icp(iphas)=1)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+icp(iphas) = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!----
+! Formats
+!----
+
+
+return
+end subroutine
+
+
+!===============================================================================
+
+
+subroutine usinsc &
+!================
+
+ ( iihmpu, nfecra , nscaus , iverif )
+
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine for input of the number of user scalars.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iihmpu ! i ! <-- ! indicates if the XML file from the GUI is !
+! ! ! ! used (1: yes, 0: no) !
+! nfecra ! i ! <-- ! Fortran unit number for standard output !
+! nscaus ! i ! <-> ! number of user scalars !
+! iverif ! i ! <-- ! flag for elementary tests !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+
+! No common should appear here
+
+
+!===============================================================================
+
+! Arguments
+
+integer iihmpu, nfecra
+integer nscaus
+integer iverif
+
+! Local variables
+
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+!===============================================================================
+
+if (iverif.eq.0) then
+ if(iihmpu.eq.1) then
+ return
+ else
+ write(nfecra,9000)
+ call csexit (1)
+ endif
+endif
+
+ 9000 format( &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/, &
+'@ @@ WARNING: stop in data input',/, &
+'@ =======',/, &
+'@ The user subroutine ''usinsc'' must be completed',/, &
+'@ in file usini1.f90',/, &
+'@',/, &
+'@ The calculation will not be run.',/, &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+
+
+! In this subroutine, only the parameters which already appear may
+
+! be set, to the exclusion of any other.
+! ================
+
+
+! If we are not using the Code_Saturne GUI:
+
+! All the parameters which appear in this subroutine must be set.
+! ===
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If we are using the Code_Saturne GUI:
+
+! we will find in the user subroutines commented examples
+! on the model of the present section.
+
+! If necessary, the user may uncomment them and adapt them to
+! his needs.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!===============================================================================
+
+! --- Number of USER scalars (thermal or not, and whatever their carrier phase).
+! These scalars come in addition to the following "basic" scalars
+! (which are naturally included in the model):
+! - pressure
+! - turbulent variables
+! - nscapp scalars introduced by an active combustion, coal,
+! or electric arc module.
+
+! Thus, for a calculation with no specific physics, the user scalars
+! may for example be:
+! - temperature or enthalpy,
+! - mass fractions of transported scalars
+! - the variance of another user scalar
+
+! The maximum number of scalars is defined by 'nscamx' in paramx.h;
+! it is the maximum admissible value for: nscaus + nscapp.
+
+
+! Set nscaus = 0 if there is no user scalar.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+nscaus = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!----
+! Formats
+!----
+
+
+return
+end subroutine
+
+
+!===============================================================================
+
+
+subroutine usipsc &
+!================
+
+ ( nscmax, nscaus, iihmpu, nfecra, iscavr, ivisls , iverif )
+
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine for the input of parameters depending on the
+! number of user scalars.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nscmax ! i ! <-- ! maximum number of scalars !
+! nscaus ! i ! <-- ! number of user scalars !
+! iihmpu ! i ! <-- ! indicates if the XML file from the GUI is !
+! ! ! ! used (1: yes, 0: no) !
+! nfecra ! i ! <-- ! Fortran unit number for standard output !
+! iscavr(nscmax) ! ia ! <-- ! associated scalar number for variance scalars !
+! ivisls(nscmax) ! ia ! <-> ! uniform scalar diffusivity flag !
+! iverif ! i ! <-- ! flag for elementary tests !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+
+! No common should appear here
+
+
+!===============================================================================
+
+! Arguments
+
+integer nscmax, nscaus, iihmpu, nfecra
+integer iscavr(nscmax), ivisls(nscmax)
+integer iverif
+
+! Local variables
+
+integer iutile, iscal
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+!===============================================================================
+
+if (iverif.eq.0) then
+ if(iihmpu.eq.1) then
+ return
+ else
+ write(nfecra,9000)
+ call csexit (1)
+ endif
+endif
+
+ 9000 format( &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/, &
+'@ @@ WARNING: stop in data input',/, &
+'@ =======',/, &
+'@ The user subroutine ''usipsc'' must be completed',/, &
+'@ in file usini1.f90',/, &
+'@',/, &
+'@ The calculation will not be run.',/, &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+
+
+! In this subroutine, only the parameters which already appear may
+
+! be set, to the exclusion of any other.
+! ================
+
+
+! If we are not using the Code_Saturne GUI:
+
+! All the parameters which appear in this subroutine must be set.
+! ===
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If we are using the Code_Saturne GUI:
+
+! we will find in the user subroutines commented examples
+! on the model of the present section.
+
+! If necessary, the user may uncomment them and adapt them to
+! his needs.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!===============================================================================
+
+! --- Variance of a USER scalar:
+! If we wish a user scalar j to represent the variance of a
+! user scalar k, we set
+! iscavr(j) = k.
+! The values taken by iscavr are thus naturally greater or equal to 1
+! and less than or equal to the total number of scalars.
+! So, if we set iscavr(j) = k, we must have
+! 0 < j < nscaus+1, 0< k < nscaus+1 and j different from k.
+
+! For example for user scalar 3 to be the variance of user scalar 3,
+! we set:
+! iscavr(3) = 2
+! with nscaus at least equal to 3.
+
+! Do not intervene if you do not wish to explicitly include the
+! variance of a user scalar in the simulation.
+
+! For non-user scalars relative to specific physics (coal, combustion,
+! electric arcs: see usppmo) implicitly defined in the model,
+! the corresponding information is given automatically, and
+! iscavr should not be modified.
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! The test on iutile allows deactivation of the instructions
+! (which are only given as an example).
+
+iutile = 0
+if(iutile.eq.1) then
+ iscavr(3) = 2
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+
+
+! --- Variable diffusivity (ivisls=1) or constant diffusivity (ivisls=0) for
+! each USER scalar, EXCEPT those which represent the variance
+! of another.
+
+! For user scalars iscal which represent the variance of another user
+! scalar, we do not set ivisls(iscal) here.
+! This is the purpose of the test on iscavr(ISCAL) in the example below.
+! Indeed, the diffusivity of the variance of a scalar is assumed to
+! have the same behavior as the diffusivity of this scalar.
+
+! For non-user scalars relative to specific physics (coal, combustion,
+! electric arcs: see usppmo) implicitly defined in the model,
+! the corresponding information is given automatically, and
+! ivisls should not be modified here.
+
+! Caution: complete usphyv with the law defining the diffusivity
+! ========= if and only if ivisls = 1 has been set here.
+
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+do iscal = 1, nscaus
+
+ ! For user scalars which do not represent the variance of another scalar
+ if(iscavr(iscal).le.0) then
+
+ ivisls(iscal) = 0
+
+ endif
+
+enddo
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!----
+! Formats
+!----
+
+
+
+return
+end subroutine
+
+
+!===============================================================================
+
+
+subroutine usipgl &
+!================
+
+ ( nphmax, nesmax, &
+ iespre, iesder, iescor, iestot, &
+ nphas , iihmpu, nfecra, &
+ idtvar, ipucou, iphydr, ialgce , iescal , iverif )
+
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine for the setting of global parameters.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nphmax ! i ! <-- ! maximum number of phases !
+! nesmax ! i ! <-- ! maximum number of error estimators per phase !
+! iespre ! i ! <-- ! number of the prediction error estimator !
+! iesder ! i ! <-- ! number of the derivative error estimator !
+! iescor ! i ! <-- ! number of the correction error estimator !
+! iestot ! i ! <-- ! number of the total error estimator !
+! nphas ! i ! <-- ! number of active phases !
+! iihmpu ! i ! <-- ! indicates if the XML file from the GUI is !
+! ! ! ! used (1: yes, 0: no) !
+! nfecra ! i ! <-- ! Fortran unit number for standard output !
+! idtvar ! i ! --> ! variable time step flag !
+! ipucou ! i ! --> ! reinforced u-p coupling flag !
+! iphydr ! i ! --> ! flag for handling of the equilibrium between !
+! ! ! ! the pressure gradient and the gravity and !
+! ! ! ! head-loss terms !
+! ialgce ! i ! <-- ! option for the method of calculation of !
+! ! ! ! cell centers !
+! iescal ! ia ! <-- ! flag for activation of error estimators for !
+! (nesmax,nphmax) ! ! ! Navier-Stokes !
+! iverif ! i ! <-- ! flag for elementary tests !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+
+! No common should appear here
+
+
+!===============================================================================
+
+! Arguments
+
+integer nphmax, nesmax
+integer iespre, iesder, iescor, iestot
+integer nphas , iihmpu, nfecra
+integer idtvar, ipucou, iphydr
+integer iescal(nesmax,nphmax)
+integer iverif
+
+! Local variables
+
+integer iphas, ialgce
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+!===============================================================================
+
+if (iverif.eq.0) then
+ if(iihmpu.eq.1) then
+ return
+ else
+ write(nfecra,9000)
+ call csexit (1)
+ endif
+endif
+
+ 9000 format( &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/, &
+'@ @@ WARNING: stop in data input',/, &
+'@ =======',/, &
+'@ The user subroutine ''usipgl'' must be completed',/, &
+'@ in file usini1.f90',/, &
+'@',/, &
+'@ The calculation will not be run.',/, &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+
+
+! In this subroutine, only the parameters which already appear may
+
+! be set, to the exclusion of any other.
+! ================
+
+
+! If we are not using the Code_Saturne GUI:
+
+! All the parameters which appear in this subroutine must be set.
+! ===
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If we are using the Code_Saturne GUI:
+
+! we will find in the user subroutines commented examples
+! on the model of the present section.
+
+! If necessary, the user may uncomment them and adapt them to
+! his needs.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!===============================================================================
+
+! --- Time step (0 : uniform and constant
+! 1 : variable in time, uniform in space
+! 2 : variable in time and space
+! -1 : steady algorithm)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+idtvar = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Velocity/pressure coupling (0 : classical algorithm,
+! 1 : transient coupling)
+! Only in single-phase
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+ipucou = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Handling of hydrostatic pressure
+! (0 : usual algorithm
+! 1 : specific handling)
+! Only in single-phase
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphydr = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Estimators for Navier-Stokes (non-frozen velocity field)
+! We recommend running a calculation restart on a few time steps
+! with the activation of the most interesting of those.
+! (=2 to activate, =0 to deactivate).
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+! div(rho u) -Gamma
+iescal(iescor,iphas) = 0
+! resolution precision for the momentum
+iescal(iestot,iphas) = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+!----
+! Formats
+!----
+
+
+return
+end subroutine
+
+
+!===============================================================================
+
+
+subroutine usipsu &
+!================
+
+ ( nmodpp , iverif )
+
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine for the input of additional user parameters.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nmodpp ! i ! <-- ! number of active specific physics models !
+! iverif ! i ! <-- ! flag for elementary tests !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "vector.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "coincl.h"
+include "cpincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nmodpp
+integer iverif
+
+! Local variables
+
+integer iphas, iutile, ii, jj, imom
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+!===============================================================================
+
+if (iverif.eq.0) then
+ if(iihmpr.eq.1) then
+ return
+ else
+ write(nfecra,9000)
+ call csexit (1)
+ endif
+endif
+
+ 9000 format( &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/, &
+'@ @@ WARNING: stop in data input',/, &
+'@ =======',/, &
+'@ The user subroutine ''usipsu'' must be completed',/, &
+'@ in file usini1.f90',/, &
+'@',/, &
+'@ The calculation will not be run.',/, &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+
+
+! This subroutine allows setting parameters
+
+! which do not already appear in the other subroutines of this file.
+
+
+! It is possible to add or remove parameters.
+
+
+! The number of physical properties and variables is known here.
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If we are using the Code_Saturne GUI:
+
+! we will find in the user subroutines commented examples
+! on the model of the present section.
+
+! If necessary, the user may uncomment them and adapt them to
+! his needs.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!===============================================================================
+
+
+! Calculation options (optcal.h)
+! ==============================
+
+! --- Calculation restart: isuite (= 1) or not (0)
+! In case of restart, read auxiliary restart file ileaux (= 1) or not (0).
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+isuite = 0
+ileaux = 1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Duration
+! ntmabs = absolute number of the last time step required
+! if we have already run 10 time steps and want to
+! run 10 more, ntmabs must be set to 10 + 10 = 20
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+ntmabs = 10
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Reference time step
+! The example given below is probably not adapted to your case.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+dtref = 0.01d0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Maximum time step: dtmax
+! Set a value base on characteristic values of your case.
+! otherwise, the code will use a multiple of dtref by default.
+! Example with
+! Ld: "dynamic" length (for example, the domain length)
+! Ud: characteristic flow velocity
+! Lt: thermal length (for example, the domain height gravity-wise)
+! Delta_rho/rho: relative density difference
+! g: gravity acceleration
+
+! dtmax = min(Ld/Ud, sqrt(Lt/(g.Delta_rho/rho)))
+
+
+
+! --- Temperature or enthalpy
+
+
+
+! When specific physics are activated (coal, combustion, electric arcs)
+! we DO NOT edit this section: we DO NOT modify 'iscalt' nor 'iscsth'
+! (the test: if (nmodpp.eq.0) is used for this).
+
+
+! On the other hand, if specific physics are NOT activated:
+
+! If a USER scalar represents the temperature or enthalpy (of phase iphas):
+! we define the number of this scalar in iscalt(iphas) and
+! we set iscsth(iscalt(iphas)) = 1 if it is the temperature
+! or iscsth(iscalt(iphas)) = 2 if it is the enthalpy.
+
+! If no scalar represents the temperature or enthalpy (of phase iphas)
+! we set iscalt(iphas) = -1
+! and we do not define iscsth(iscalt(iphas)).
+
+
+! For the radiative module when used without specific physics, if we
+! have chosen to solve in temperature (that is if
+! iscsth(iscalt(iphas)) = 1), the fluid temperature is considered to
+! be in degrees KELVIN (be careful for boundary conditions an expression
+! of physical properties depending on temperature).
+! Nonetheless, even though it is not recommended, if we wish for the
+! fluid solver to work with a temperature in degrees Celsius, we must set
+! iscsth(iscalt(iphas)) = -1.
+! This choice is a source of user errors. Indeed, the boundary conditions
+! for the fluid temperature will then be in degrees Celsius, while the
+! boundary conditions for radiation in usray2 must still be in Kelvin.
+
+
+! If specific physics are not activated
+! (coal, combustion, electric arcs: see usppmo):
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+if(nmodpp.eq.0) then
+
+ iphas = 1
+
+ ! Number of the scalar representing temperature or enthalpy,
+ ! or -1 if there is none.
+ ! When the choice is done by the Code_Saturne GUI, the scalar representing
+ ! the temperature or enthalpy is always the first.
+ iscalt(iphas) = -1
+
+! If there is a temperature or enthalpy variable:
+ if(iscalt(iphas).gt.0) then
+ ! we indicate if it is the temperature (=1) or the enthalpy (=2).
+ iscsth(iscalt(iphas)) = 1
+ endif
+
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Calculation (restart) with frozen velocity field (1 yes, 0 no)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iccvfg = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Vortex method for inlet conditions in L.E.S.
+! (0: not activated, 1: activated)
+! The vortex method only regards the L.E.S. models
+! and is only valid with one phase.
+! To use the vortex method, edit the 'usvort.f90' user file.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+if (itytur(iphas).eq.4) then
+ ivrtex = 0
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Convective scheme
+
+! blencv = 0 for upwind (order 1 in space, "stable but diffusive")
+! = 1 for centered/second order (order 2 in space)
+! we may use intermediate real values.
+! Here we choose:
+! for the velocity of phase 1 and user scalars:
+! an upwind-centered scheme with 100% centering (blencv=1)
+! for other variables
+! the default code value (upwind standard, centered in LES)
+
+! Specifically, for user scalars
+! if we suspect an excessive level of numerical diffusion on
+! a variable ivar representing a user scalar
+! iscal (with ivar=isca(iscal)), it may be useful to set
+! blencv(ivar) = 1.0d0 to use a second-order scheme in space for
+! convection. For temperature or enthalpy in particular, we
+! may thus choose in this case:
+! blencv(isca(iscalt(iphas))) = 1.0d0
+
+! For non-user scalars relative to specific physics (coal, combustion,
+! electric arcs: see usppmo) implicitly defined by the model,
+! the corresponding information is set automatically elsewhere:
+! we do not modify blencv here.
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+
+blencv(iu(iphas)) = 1.0d0
+blencv(iv(iphas)) = 1.0d0
+blencv(iw(iphas)) = 1.0d0
+if(nscaus.ge.1) then
+ do ii = 1, nscaus
+ blencv(isca(ii)) = 1.0d0
+ enddo
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Algebraic multigrid parameters
+
+! imgr = 0: no multigrid
+! imgr = 1: algebraic multigrid
+
+! Only available for pressure and purely diffusive variables.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+imgr(ipr(iphas)) = 1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+!=========================================================================
+
+! --- Stabilization in turbulent regime
+
+! For difficult cases, a stabilization may be obtained by not
+! reconstructing the convective and diffusive flux for variables
+! of the turbulence model, that is
+! in k-epsilon: if (itytur(iphas).eq.2) then
+! ircflu(ik(iphas)) = 0 and ircflu(iep(iphas)) = 0
+! in Rij-epsilon: if (itytur(iphas).eq.3) then
+! ircflu(ir11(iphas)) = 0, ircflu(ir22(iphas)) = 0,
+! ircflu(ir33(iphas)) = 0,
+! ircflu(ir12(iphas)) = 0, ircflu(ir23(iphas)) = 0,
+! ircflu(ir23(iphas)) = 0,
+! and ircflu(iep(iphas)) = 0
+! (note that variable itytur is equal to iturb/10)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! The test on iutile allows deactivation of the instructions
+! (which are only given as an example).
+
+iutile = 0
+if(iutile.eq.1) then
+
+ iphas = 1
+ if (iturb(iphas).eq.20) then
+ ircflu(ik(iphas)) = 0
+ ircflu(iep(iphas)) = 0
+ endif
+
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! Physical constants (cstphy.h)
+! =============================
+
+! --- gravity (g in m/s2, with the sign in the calculation coordinate axes).
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+gx = 0.d0
+gy = 0.d0
+gz = 0.d0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- rotation vector of the reference frame (omega in s-1)
+
+! If the rotation is not nul, then
+! icorio = 0: rotation is taken into account by rotating the mesh
+! (simulation in the absolute frame)
+! = 1: rotation is taken into account by Coriolis source terms
+! (simulation in the relative frame)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+icorio = 0
+
+omegax = 0.d0
+omegay = 0.d0
+omegaz = 0.d0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Reference fluid properties (for each phase)
+
+! ro0 : density in kg/m3
+! viscl0 : dynamic viscosity in kg/(m s)
+! cp0 : specific heat in J/(degres kg)
+! t0 : reference temperature in Kelvin
+! p0 : total reference pressure in Pascal
+! the calculation is based on a
+! reduced pressure P*=Ptot-ro0*g.(x-xref)
+! (except in compressible case)
+! xyzp0(3,.) : coordinates of the reference point for
+! the total pressure (where it is equal to p0)
+
+! In general, it is not necessary to furnish a reference point xyz0.
+! If there are outlets, the code will take the center of the
+! reference outlet face.
+! On the other hand, if we plan to explicitly fix Dirichlet conditions
+! for pressure, it is better to indicate to which reference the
+! values relate (for a better resolution of reduced pressure).
+
+
+! Other properties are given by default in all cases.
+
+! Nonetheless, we may note that:
+
+! In the standard case (no gas combustion, coal, electric arcs,
+! compressibility):
+! ---------------------
+! ro0, viscl0 and cp0
+! are useful and represent either the fluid properties if they
+! are constant, either simple mean values for the initialization
+! if properties are variable and defined in usphyv.
+! t0 is not useful
+! p0 is useful but is not used in an equation of state. p0
+! is a reference value for the incompressible solver
+! which will serve to set the (possible) domain outlet pressure.
+! We may also take it as 0 or as a physical value in Pascals.
+
+! With the electric module:
+! ------------------------
+! ro0, viscl0 and cp0
+! are useful but simply represent mean initial values;
+! the density, molecular dynamic viscosity, and specific
+! heat are necessarily given in propce (whether they are
+! physically variable or not): see uselph for the Joule effect
+! module and the electric arcs dp_ELE data file.
+! t0 is useful an must be in Kelvin (> 0) but represents a simple
+! initialization value.
+! p0 is useful bu is not used in the equation of state. p0
+! is a reference value for the incompressible solver which
+! will be used to calibrate the (possible) outlet pressure
+! of the domain. We may take it as zero or as a physical
+! value in Pascals.
+
+! With gas combustion:
+! --------------------
+! ro0 is not useful (it is automatically recalculated by the
+! law of ideal gases from t0 and p0).
+! viscl0 is indispensable: it is the molecular dynamic viscosity,
+! assumed constant for the fluid.
+! cp0 is indispensable: it is the heat capacity, assumed constant,
+! (modelization of source terms involving a local Nusselt in
+! the Lagrangian module, reference value allowing the
+! calculation of a radiative
+! (temperature, exchange coefficient) couple).
+! t0 is indispensible and must be in Kelvin (> 0).
+! p0 is indispensable and must be in Pascal (> 0).
+
+! With pulverized coal:
+! ---------------------
+! ro0 is not useful (it is automatically recalculated by the
+! law of ideal gases from t0 and p0).
+! viscl0 is indispensable: it is the molecular dynamic viscosity,
+! assumed constant for the fluid (its effect is expected to
+! be small compared to turbulent effects).
+! cp0 is indispensable: it is the heat capacity, assumed constant,
+! (modelization of source terms involving a local Nusselt in
+! the coal or Lagrangian module, reference value allowing the
+! calculation of a radiative
+! (temperature, exchange coefficient) couple).
+! t0 is indispensable and must be in Kelvin (> 0).
+! p0 is indispensable and must be in Pascal (> 0).
+
+! With compressibility:
+! ---------------------
+! ro0 is not useful, stricto sensu; nonetheless, as experience
+! shows that users often use this variable, it is required
+! to assign to it a strictly positive value (for example,
+! an initial value).
+! viscl0 is useful and represents the molecular dynamic viscosity,
+! when it is constant, or a value which will be used during
+! initializations (or in inlet turbulence conditions,
+! depending on the user choice.
+! cp0 is indispensable: it is the heat capacity, assumed constant
+! in the thermodynamics available by default
+! t0 is indispensable and must be in Kelvin (> 0).
+! p0 is indispensable and must be in Pascal (> 0).
+! With the thermodynamic law available by default,
+! t0 and p0 are used for the initialization of the density.
+! xyzp0 is not useful because the pressure variable directly
+! represents the total pressure.
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+
+ro0(iphas) = 0.235d0
+viscl0(iphas) = 0.84d-6
+cp0(iphas) = 1219.d0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+iphas = 1
+
+t0(iphas) = 1000.d0 + 273.15d0
+p0(iphas) = 1.013d5
+! We only specify XYZ0 if we explicitely fix Dirichlet conditions
+! for the pressure.
+! xyzp0(1,iphas) = 0.d0
+! xyzp0(2,iphas) = 0.d0
+! xyzp0(3,iphas) = 0.d0
+
+
+! --- irovar, ivivar: density and viscosity constant or not ?
+
+! When a specific physics module is active
+! (coal, combustion, electric arcs, compressible: see usppmo)
+! we DO NOT set variables 'irovar' and 'ivivar' here, as
+! they are defined automatically.
+! Nonetheless, for the compressible case, ivivar may be modified
+! in the uscfx1 user subroutine.
+
+! When no specific physics module is active, it is necessary to
+! specify is the density and the molecular viscosity
+! are constant (irovar=0, ivivar=0)
+! or variable (irovar=1, ivivar=1)
+
+! if they are variable, the law must be defined in usphyv;
+! if they are constant, they take values ro0 and viscl0.
+
+! as an example, we assume below that they are constant.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+if(nmodpp.eq.0) then
+ iphas = 1
+ irovar(iphas) = 0
+ ivivar(iphas) = 0
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Minimum (scamin) and maximum (scamax) admissible values for
+! each USER scalar:
+
+! Results are clipped at the end of each time step.
+
+! If scamin > scamax, we do not clip.
+
+! For a scalar jj representing the variance of another, we may
+! abstain from defining these values
+! (a default clipping is set in place).
+! This is the purpose of the test on iscavr(jj) in the example below.
+
+! For non-user scalars relative to specific physics (coal, combustion,
+! electric arcs: see usppmo) implicitly defined according to the
+! model, the information is automatically set elsewhere: we
+! do not set scamin or scamax.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If there are user scalars
+if(nscaus.gt.0) then
+
+ ! Loop on user scalars:
+ do jj = 1, nscaus
+ ! For scalars which are not variances
+ if(iscavr(jj).le.0) then
+ ! We define the min and max bounds
+ scamin(jj) =-grand
+ scamax(jj) =+grand
+ endif
+ enddo
+
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Reference diffusivity visls0 in kg/(m s) for each
+! USER scalar except those which represent the variance of another.
+
+! For non-user scalars relative to specific physics (coal, combustion,
+! electric arcs: see usppmo) implicitly defined in the model,
+! the information is given automatically elsewhere:
+! we do not modify visls0 here.
+
+! For user scalars JJ which represent the variance of another user
+! scalar, we do not define visls0(jj) here.
+! This is the purpose of the test on iscavr(jj) in the example below.
+! Indeed the diffusivity of the variance of a scalar is assumed
+! identical to that scalar's diffusivity.
+
+! When no specific physics has been activated
+! (coal, combustion, electric arcs) and if a user scalar represents
+! the temperature or enthalpy:
+! visls0(iscalt(iphas)) = Lambda/Cp
+
+! Here, as an example, we assign to viscl0 the viscosity of the
+! carrier phase, which is fitting for passive tracers which
+! follow the fluid.
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If there are user scalars
+if(nscaus.gt.0) then
+
+ ! We loop on user scalars:
+ do jj = 1, nscaus
+ ! For scalars which are not variances
+ if(iscavr(jj).le.0) then
+ ! We define the diffusivity
+ visls0(jj) = viscl0(iphsca(jj))
+ endif
+ enddo
+
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Reference velocity for turbulence initialization (m2/s)
+! (useful only with turbulence)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+uref(iphas) = 1.d0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Reference length scale in meters for initialization
+! of epsilon (and specific clipping of turbulence, but
+! this is not the default option)
+! Assign a value of the order of the largest dimension of the
+! physical domain in which the flow may develop.
+! (useful only for turbulence).
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iphas = 1
+almax(iphas) = -grand
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- Definition of moments
+! (at the most nbmomx moments, correlations of maximum order ndgmox)
+
+! We calculate temporal means of the type <f1*f2*f3*...*fn>
+! The fi's are cell-defined variables (arrays rtp and propce).
+
+! idfmom(i,imom) ientifies the variable fi of moment imom
+! if idfmom > 0 it is a resolved variable (rtp)
+! if idfmom < 0 it is an auxiliary variable (propce)
+! imoold(imom) defined in the case of a restart the number, in the
+! previous calculation, of the moment to use to initialize moment
+! imom of the new calculation (by default imoold(imom)=imom).
+! Value -1 indicates the we must reinitialize moment imom.
+! ntdmom(imom) defined the time step at which the moment calculation
+! is started.
+
+! We give below the example of the calculation of moments <u> and <rho u v>
+! the moment <u> is reread in the restart file if we are restarting,
+! the moment <rho u v> is reinitialized to zero.
+! Moment <u> is calculated starting from time step 1000
+! Moment <rho u v> is calculated from time step 10000.
+
+
+! The test on iutile allows deactivation of the instructions
+! (which are only given as an example).
+
+iutile = 0
+if(iutile.eq.1) then
+
+ ! First moment: <u>
+ imom = 1
+ iphas = 1
+ idfmom(1,imom) = iu(iphas)
+ ntdmom(imom) = 1000
+ ! Second moment: <rho u v>
+ imom = 2
+ iphas = 1
+ idfmom(1,imom) = -irom(iphas)
+ idfmom(2,imom) = iu(iphas)
+ idfmom(3,imom) = iv(iphas)
+ imoold(imom) = -1
+ ntdmom(imom) = 10000
+
+endif
+
+!----
+! Formats
+!----
+
+
+return
+end subroutine
+
+
+!===============================================================================
+
+
+subroutine usipes &
+!================
+
+ ( nmodpp , iverif )
+
+
+!===============================================================================
+! Purpose:
+! --------
+
+! User subroutine for the input of additional user parameters for
+! input/output.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nmodpp ! i ! <-- ! number of active specific physics models !
+! iverif ! i ! <-- ! flag for elementary tests !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "vector.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer nmodpp
+integer iverif
+
+! Local variables
+
+integer iphas, ipp, imom
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+!===============================================================================
+
+if (iverif.eq.0) then
+ if(iihmpr.eq.1) then
+ return
+ else
+ write(nfecra,9000)
+ call csexit (1)
+ endif
+endif
+
+ 9000 format( &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/, &
+'@ @@ WARNING: stop in data input',/, &
+'@ =======',/, &
+'@ The user subroutine ''usipes'' must be completed',/, &
+'@ in file usini1.f90',/, &
+'@',/, &
+'@ The calculation will not be run.',/, &
+'@',/, &
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+
+
+! This subroutine allows setting parameters
+
+! which do not already appear in the other subroutines of this file.
+
+
+! It is possible to add or remove parameters.
+
+
+! The number of physical properties and variables is known here.
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! If we are using the Code_Saturne GUI:
+
+! we will find in the user subroutines commented examples
+! on the model of the present section.
+
+! If necessary, the user may uncomment them and adapt them to
+! his needs.
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!===============================================================================
+
+!===============================================================================
+! 1. Input-output (optcal.h)
+!===============================================================================
+
+! --- write auxiliary restart file iecaux = 1 yes, 0 no
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+iecaux = 1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- no log (listing) output
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+ntlist = 1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! --- post-processing output
+
+! ichrvl: post-processing of the fluid domain (yes 1/no 0)
+! ichrbo: post-processing of the domain boundary (yes 1/no 0)
+! ichrsy: post-processing of zones coupled with SYRTHES (yes 1/ no 0)
+! ichrmd: indicates if the meshes output are:
+! 0: fixed,
+! 1: deformable with constant connectivity,
+! 2: modifyable (may be completely redefined during the
+! calculation using the usmpst subroutine).
+! 10: as indmod = 0, with a displacement field
+! 11: as indmod = 1, with a displacement field
+! 11: as indmod = 2, with a displacement field
+
+! fmtchr: output format, amid
+! 'EnSight Gold', 'MED', or 'CGNS'
+! optchr: options associated with the output format, separated by
+! commas, from the following list:
+! 'text' (text format, for EnSight)
+! 'binary' (binary format, default choice)
+! 'big_endian' (forces binary EnSight output to
+! 'big-endian' mode)
+! 'discard_polygons' (ignore polygon-type faces)
+! 'discard_polyhedra' (ignore polyhedron-type cells)
+! 'divide_polygons' (subdivides polygon-type faces)
+! 'divide_polyhedra' (subdivides polyhedron-type cells)
+! 'split_tensors' (writes tensors as separate scalars)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+ichrvl = 1
+ichrbo = 0
+ichrsy = 0
+
+ichrmd = 0
+
+FMTCHR = 'EnSight Gold'
+OPTCHR = 'binary'
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- chronological output step
+! (-1: only one valua at calculation end)
+! (strictly positive valeu: output periodicity)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+ntchr = -1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- history output step
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+nthist = 1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- Number of monitoring points (probes) and their positions
+! (limited to ncaptm=100)
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+ncapt = 4
+xyzcap(1,1) = 0.30d0
+xyzcap(2,1) = 0.15d0
+xyzcap(3,1) = 0.01d0
+
+xyzcap(1,2) = 0.30d0
+xyzcap(2,2) = 0.00d0
+xyzcap(3,2) = 0.01d0
+
+xyzcap(1,3) = 0.30d0
+xyzcap(2,3) =-0.08d0
+xyzcap(3,3) = 0.01d0
+
+xyzcap(1,4) = 0.60d0
+xyzcap(2,4) =-0.05d0
+xyzcap(3,4) = 0.01d0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! --- current variable
+
+! As for other variables,
+! if we do not assign the following array values,
+! default values will be used
+
+! nomvar( ) = variable name
+! ichrvr( ) = chonological output (yes 1/no 0)
+! ilisvr( ) = logging in listing (yes 1/no 0)
+! ihisvr( ) = history output (number of probes and their numbers)
+! if ihisvr(.,1) = -1, output for all probes
+
+! Note: Only the fist 8 characters of a name will be used in the most
+! detailed log.
+
+
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! Current dynamic variables
+
+! Examples for phase 1
+iphas = 1
+
+! pressure variable
+ipp = ipprtp(ipr (iphas))
+nomvar(ipp) = 'Pression'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! variable v1x
+ipp = ipprtp(iu (iphas))
+nomvar(ipp) = 'VitesseX'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! v1y variable
+ipp = ipprtp(iv (iphas))
+nomvar(ipp) = 'VitesseY'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! v1z variable
+ipp = ipprtp(iw (iphas))
+nomvar(ipp) = 'VitesseZ'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+if(itytur(iphas).eq.2) then
+
+ ! turbulent kinetic energy
+ ipp = ipprtp(ik (iphas))
+ nomvar(ipp) = 'EnerTurb'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! turbulent dissipation
+ ipp = ipprtp(iep (iphas))
+ nomvar(ipp) = 'Dissip'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+elseif(itytur(iphas).eq.3) then
+
+ ! Reynolds stresses
+ ipp = ipprtp(ir11 (iphas))
+ nomvar(ipp) = 'Tens.R11'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! Reynolds stresses
+ ipp = ipprtp(ir22 (iphas))
+ nomvar(ipp) = 'Tens.R22'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! Reynolds stresses
+ ipp = ipprtp(ir33 (iphas))
+ nomvar(ipp) = 'Tens.R33'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! Reynolds stresses
+ ipp = ipprtp(ir12 (iphas))
+ nomvar(ipp) = 'Tens.R12'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! Reynolds stresses
+ ipp = ipprtp(ir13 (iphas))
+ nomvar(ipp) = 'Tens.R13'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! Reynolds stresses
+ ipp = ipprtp(ir23 (iphas))
+ nomvar(ipp) = 'Tens.R23'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! turbulent dissipation
+ ipp = ipprtp(iep (iphas))
+ nomvar(ipp) = 'Dissip'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+elseif(iturb(iphas).eq.50) then
+
+! energie turbulente
+ ipp = ipprtp(ik (iphas))
+ nomvar(ipp) = 'EnerTurb'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! dissipation turbulente
+ ipp = ipprtp(iep (iphas))
+ nomvar(ipp) = 'Dissip'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! phi
+ ipp = ipprtp(iphi (iphas))
+ nomvar(ipp) = 'Phi'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! f_barre
+ ipp = ipprtp(ifb (iphas))
+ nomvar(ipp) = 'f_barre'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+elseif(iturb(iphas).eq.60) then
+
+ ! turbulent kinetic energy
+ ipp = ipprtp(ik (iphas))
+ nomvar(ipp) = 'EnerTurb'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ! omega
+ ipp = ipprtp(iomg (iphas))
+ nomvar(ipp) = 'Omega'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+! User scalar variables.
+
+! We may modify here the arrays relative to user scalars, but scalars
+! reserved for specific physics are handled automatically. This explains
+! the tests on 'nscaus', which ensure that the targeted scalars are
+! truly user scalars.
+! By specific physics, we mean only those which are handled in specific
+! modules of the code, such as coal, combustion, electric arcs (see usppmo).
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+if(isca(1).gt.0.and.nscaus.ge.1) then
+ ipp = ipprtp(isca (1))
+ nomvar(ipp) = 'scal 1'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+if(isca(2).gt.0.and.nscaus.ge.2) then
+ ipp = ipprtp(isca (2))
+ nomvar(ipp) = 'scal 2'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+! Other variables
+
+iphas = 1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! Density variable (output for post-processing only if variable or
+! in the case of specific physics)
+ipp = ipppro(ipproc(irom (iphas)))
+nomvar(ipp) = 'masse vol'
+ichrvr(ipp) = max(irovar(iphas),nmodpp)
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! specific heat
+if(icp (iphas).gt.0) then
+ ipp = ipppro(ipproc(icp (iphas)))
+ nomvar(ipp) = 'chal. spec.'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = 0
+endif
+
+! laminar viscosity
+ipp = ipppro(ipproc(iviscl(iphas)))
+nomvar(ipp) = 'visc. laminaire'
+ichrvr(ipp) = 0
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = 0
+
+! turbulent viscosity
+ipp = ipppro(ipproc(ivisct(iphas)))
+nomvar(ipp) = 'visc. turb1'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! Courant number
+ipp = ipppro(ipproc(icour(iphas)))
+nomvar(ipp) = 'Nb Courant'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+! Fourier number
+ipp = ipppro(ipproc(ifour(iphas)))
+nomvar(ipp) = 'Nb Fourier'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+! 'csmago' variable for dynamic L.E.S. models
+! (square of the Samgorinsky "constant")
+if(ismago(iphas).gt.0) then
+ ipp = ipppro(ipproc(ismago(iphas)))
+ nomvar(ipp) = 'Csdyn2'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+endif
+
+! temporal means (example for moment 1)
+if(nbmomt.gt.0) then
+ imom = 1
+ ipp = ipppro(ipproc(icmome(imom)))
+ nomvar(ipp) = 'MoyTps01'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+endif
+
+! total pressure (not defined in compressible case)
+if (ippmod(icompf).lt.0) then
+ ipp = ipppro(ipproc(iprtot(iphas)))
+ nomvar(ipp) = 'Pression totale'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+endif
+
+! local time step
+ipp = ippdt
+nomvar(ipp) = 'pdt local'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! characteristic time of transient velocity/pressure coupling
+ipp = ipptx
+nomvar(ipp) = 'Tx'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+ipp = ippty
+nomvar(ipp) = 'Ty'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+ipp = ipptz
+nomvar(ipp) = 'Tz'
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+!----
+! Formats
+!----
+
+
+
+return
+end subroutine
+
+
+!===============================================================================
+
+
+subroutine ustbtr &
+!================
+
+ ( ncel , ncelet , nfac , nfabor , nnod , &
+ longia , longra , &
+ nideve , nituse , nrdeve , nrtuse )
+
+!===============================================================================
+! Purpose:
+! -------
+
+! User subroutine to define the sizes of macro-arrays ia and ra,
+! of user arrays ituser and rtuser,
+! of developper arrays idevel and rdevel.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! name !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ncel ! i ! <-- ! number of cells !
+! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
+! nfac ! i ! <-- ! number of interior faces !
+! nfabor ! i ! <-- ! number of boundary faces !
+! nnod ! i ! <-- ! number of vertices !
+! longia ! i ! --> ! size of array ia !
+! longra ! i ! --> ! size of array ra !
+! nideve ! i ! --> ! size of array idevel !
+! nituse ! i ! --> ! size of array ituser !
+! nrdeve ! i ! --> ! size of array rdevel !
+! nrtuse ! i ! --> ! size of array rtuser !
+!__________________!____!_____!________________________________________________!
+
+! Type: i (integer), r (real), s (string), a (array), l (logical),
+! and composite types (ex: ra real array)
+! mode: <-- input, --> output, <-> modifies data, --- work array
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! Common blocks
+!===============================================================================
+
+!===============================================================================
+
+! Arguments
+
+integer ncel , ncelet, nfac , nfabor, nnod
+integer longia, longra
+integer nideve, nituse, nrdeve, nrtuse
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. This test allows the user to ensure that the version of this subroutine
+! used is that from his case definition, and not that from the library.
+! If a file from the GUI is used, this subroutine may not be mandatory,
+! thus the default (library reference) version returns immediately.
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. DIMENSION DES MACROS TABLEAUX IA ET RA :
+
+! The user may need to modify the size of integer and real work
+! arrays here: longia and longra respectively.
+
+! The number of integers 'longia' and the number of reals 'longra' depend
+! on calculation options, on the element type and mesh characteristics
+! (2d, 3d, hybrid, non-conforming, ...) and on the number of variables.
+! In k-epsilon, if we note 'ncel' the local number of cells in the mesh,
+! we ay usually use the following coarse overestimation:
+! longia = 45*ncel and longra = 220*ncel. In Rij-epsilon, an additional
+! 20% may be applied.
+! These values are relatively high so as to account for 2D meshes which
+! have many boundary faces. A more precise but complex formula would be
+! necessary. For large 3D cases, a more precise estimation is given by:
+! longia = 25*ncel and longra = 120*ncel.
+
+! If longia and longra are left at 0, then these values are estimated
+! and set automatically.
+
+!===============================================================================
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! Size of main integer work array 'ia'
+
+longia = 0
+
+! Size of main real work array 'ra'
+
+longra = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+!===============================================================================
+! 2. DIMENSIONS DES TABLEAUX UTILISATEUR ITUSER ET RTUSER
+!===============================================================================
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
+
+! Size user-reserved integer array 'ituser'
+
+nituse = 0
+
+! Size user-reserved real array 'rtuser'
+
+nrtuse = 0
+
+! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
+
+
+!----
+! Formats
+!----
+
+
+return
+end subroutine
diff --git a/users/base/usiniv.f90 b/users/base/usiniv.f90
new file mode 100644
index 0000000..762e404
--- /dev/null
+++ b/users/base/usiniv.f90
@@ -0,0 +1,323 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usiniv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : INITIALISATION DES VARIABLES DE CALCUL
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+
+
+
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME USPHYV
+! ET PAS ICI
+
+
+
+! POUR LA COMBUSTION, LE CHARBON, L'INITIALISATION EST FAITE
+! PAR DEFAUT : IL EST CONSEILLE DE LA CONSERVER.
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iutile
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) then
+! Indicateur de non passage dans le sous-programme
+ iusini = 0
+ return
+endif
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+! --- INCONNUES
+! Exemple : 1 est le numero du scalaire utilisateur 1
+! parmi tous les scalaires (utilisateurs + physiques
+! particulieres).
+! ISCA(1) est le numero de la variable de calcul
+! associee.
+! RTP(IEL,ISCA(1)) est la valeur de la variable
+! de calcul dans la cellule IEL.
+
+if (isuite.eq.0) then
+
+ do iel = 1, ncel
+ rtp(iel,isca(1)) = 25.d0
+ enddo
+
+endif
+
+
+!===============================================================================
+! 3. PAS DE TEMPS : EXEMPLE
+! SI ON FAIT UNE SUITE EN PAS DE TEMPS NON UNIFORME ET CONSTANT
+! ET QU'ON DESIRE MODIFIER LE PAS DE TEMPS STOCKE DANS LE SUITE
+! (POUR S'AFFRANCHIR D'UNE EVOLUTION TROP PROGRESSIVE PAR EX)
+!===============================================================================
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+
+if(isuite.eq.1.and.(idtvar.eq.1.or.idtvar.eq.2)) then
+ do iel = 1, ncel
+ dt (iel) = 10.d0*dt(iel)
+ enddo
+endif
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/usjoin.f90 b/users/base/usjoin.f90
new file mode 100644
index 0000000..bcecec9
--- /dev/null
+++ b/users/base/usjoin.f90
@@ -0,0 +1,152 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usjoin &
+!================
+
+ ( )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! DEFINITION DE RECOLLEMENT DE MAILLAGES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+! Variables locales
+
+integer nbjoin, ii
+integer iwarnj
+double precision fract, plane, rtf, mtf, etf
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+! Parameters (default values)
+! ---------------------------
+
+fract = 0.15d0 ! The initial tolerance radius associated to each
+ ! vertex is equal to the lenght of the shortest
+ ! incident edge, multiplied by this fraction.
+
+plane = 30.0 ! When subdividing faces, 2 faces are considered
+ ! coplanar and may be joined if angle between their
+ ! unit normals (cosine) does not exceed this parameter.
+
+iwarnj = 1 ! associated verbosity level
+
+! Advanced parameters
+! -------------------
+
+etf = 0.50d0 ! Edge equivalence tolerance factor
+ ! Used to locally modify the tolerance associated to each
+ ! vertex BEFORE adding equivalences between vertices, and
+ ! after edge intersections.
+ ! = 0 => add no equivalence (may produce very small faces);
+ ! < 1 => reduce the number of equivalences between
+ ! vertices sharing the same edge (more stable);
+ ! = 1 => no change;
+ ! > 1 => increase the number of equivalences between
+ ! vertices sharing the same edge (more merges).
+ ! Not recommmended.
+
+rtf = 0.85d0 ! Reduction tolerance factor during vertices merge
+ ! Used when the combination of merges would lead to a
+ ! resulting merged vertex from a set of vertices not lying
+ ! within the initial tolerance radius of at least one of
+ ! its parent vertices.
+ ! new tol. = tol * coef. Values between [0.0, 1.0[
+
+mtf = 1.00d0 ! Merge tolerance factor
+ ! Used to locally modify the tolerance associated to each
+ ! vertex AFTER adding equivalences between vertices.
+ ! = 0 => add no equivalence (may produce very small faces);
+ ! < 1 => reduce the number of equivalences between
+ ! vertices sharing the same edge (more stable);
+ ! = 1 => no change;
+ ! > 1 => increase the number of equivalences between
+ ! vertices sharing the same edge (more merges).
+ ! Not recommmended.
+
+! -------------------
+! Joinings definition
+! -------------------
+
+nbjoin = 1 ! Number of joinings
+
+do ii = 1, nbjoin
+
+ if (ii .eq. 1) then
+
+ call defjoi('98 or 99', fract, plane, rtf, mtf, etf, iwarnj)
+ !==========
+
+ endif
+
+enddo
+
+return
+
+end subroutine
+
diff --git a/users/base/uskpdc.f90 b/users/base/uskpdc.f90
new file mode 100644
index 0000000..d380aad
--- /dev/null
+++ b/users/base/uskpdc.f90
@@ -0,0 +1,456 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uskpdc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncepdp , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! PERTES DE CHARGE (PDC)
+! POUR LA PHASE IPHAS
+
+! IAPPEL = 1 :
+! CALCUL DU NOMBRE DE CELLULES OU L'ON IMPOSE UNE PDC
+! IAPPEL = 2 :
+! REPERAGE DES CELLULES OU L'ON IMPOSE UNE PDC
+! IAPPEL = 3 :
+! CALCUL DES VALEURS DES COEFS DE PDC
+
+
+! CKUPDC EST LE COEFF DE PDC CALCULE.
+
+! IL INTERVIENT DANS LA QDM COMME SUIT :
+! RHO DU/DT = - GRAD P + TSPDC (+ AUTRES TERMES)
+! AVEC TSPDC = - RHO CKUPDC U ( en kg/(m2 s))
+
+
+! POUR UNE PDC REPARTIE,
+
+! SOIT KSIL = DHL/(0.5 RHO U**2) DONNE DANS LA LITTERATURE
+! (DHL EST LA PERTE DE CHARGE PAR UNITE DE LONGUEUR)
+
+! LE TERME SOURCE TSPDC VAUT DHL = - KSIL *(0.5 RHO U**2)
+
+! ON A CKUPDC = 0.5 KSIL ABS(U)
+
+
+! POUR UNE PDC SINGULIERE,
+
+! SOIT KSIS = DHS/(0.5 RHO U**2) DONNE DANS LA LITTERATURE
+! (DHS EST LA PERTE DE CHARGE SINGULIERE)
+
+! LE TERME SOURCE TSPDC VAUT DHS/L = - KSIS/L *(0.5 RHO U**2)
+
+! ON A CKUPDC = 0.5 KSIS/L ABS(U)
+
+! OU L DESIGNE LA LONGUEUR SUR LAQUELLE
+! ON A CHOISI DE REPRESENTER LA ZONE DE PDC SINGULIERE
+
+
+! IDENTIFICATION DES CELLULES/FACES DE BORD/FACES INTERNES
+! ========================================================
+
+! Les commandes GETCEL, GETFBR et GETFAC permettent d'identifier
+! respectivement les cellules, faces ou faces de bord en fonction
+! de differents criteres.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! La syntaxe des commandes GETFBR et GETFAC est identique.
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncepdp ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp
+integer nideve , nrdeve , nituse , nrtuse
+integer iappel
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ielpdc, iphas, ikpdc
+integer ilelt, nlelt
+integer iutile
+
+double precision alpha, cosalp, sinalp, vit, ck1, ck2
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if(iappel.eq.1.or.iappel.eq.2) then
+
+!===============================================================================
+
+! 1. POUR CHAQUE PHASE : UN OU DEUX APPELS
+
+! PREMIER APPEL :
+
+! IAPPEL = 1 : NCEPDP : CALCUL DU NOMBRE DE CELLULES
+! AVEC PERTES DE CHARGE
+
+
+! DEUXIEME APPEL (POUR LES PHASES AVEC NCEPDP > 0) :
+
+! IAPPEL = 2 : ICEPDC : REPERAGE DU NUMERO DES CELLULES
+! AVEC PERTES DE CHARGE
+
+! REMARQUES :
+
+! Ne pas utiliser CKUPDC dans cette section
+! (il est rempli au troisieme appel, IAPPEL = 3)
+
+! Ne pas utiliser ICEPDC dans cette section
+! au premier appel (IAPPEL = 1)
+
+! On passe ici a chaque pas de temps
+! (ATTENTION au cout calcul de vos developpements)
+
+!===============================================================================
+
+
+! 1.1 A completer par l'utilisateur : selection des cellules
+! -----------------------------------------------------------
+
+! --- Exemple 1 : Aucune pdc (defaut)
+
+ ielpdc = 0
+
+
+! --- Exemple 2 : Pdc definies par coordonnees pour la phase 1
+! Pas de pertes de charge pour la phase 2
+! Le traitement etant different pour les phases
+! un test est necessaire.
+
+! Ce test permet de desactiver l'exemple
+ if(1.eq.0) then
+ if(iphas.eq.1) then
+ ielpdc = 0
+
+ CALL GETCEL('X <= 6.0 and X >= 4.0 and Y >= 2.0 and'// &
+ 'Y <= 8.0',NLELT,LSTELT)
+
+ do ilelt = 1, nlelt
+ iel = lstelt(ilelt)
+ ielpdc = ielpdc + 1
+ if (iappel.eq.2) icepdc(ielpdc) = iel
+ enddo
+
+ else
+ ielpdc = 0
+ endif
+ endif
+
+
+! 1.2 Sous section generique a ne pas modifier
+! ---------------------------------------------
+
+! --- Pour IAPPEL = 1,
+! Renseigner NCEPDP, nombre de cellules avec pdc
+! Le bloc ci dessous est valable pourles 2 exemples ci dessus
+
+ if (iappel.eq.1) then
+ ncepdp = ielpdc
+ endif
+
+!-------------------------------------------------------------------------------
+
+elseif(iappel.eq.3) then
+
+!===============================================================================
+
+! 2. POUR CHAQUE PHASE AVEC NCEPDP > 0 , TROISIEME APPEL
+
+! TROISIEME APPEL (POUR LES PHASES AVEC NCEPDP > 0) :
+
+! IAPPEL = 3 : CKUPDC : CALCUL DES COEFFICIENTS DE PERTE DE CHARGE
+! DANS LE REPERE DE CALCUL
+! STOCKES DANS L'ORDRE
+! K11, K22, K33, K12, K13, K23
+
+
+! REMARQUE :
+
+! Veillez a ce que les coefs diagonaux soient positifs.
+
+! Vous risquez un PLANTAGE si ce n'est pas le cas.
+
+! AUCUN controle ulterieur ne sera effectue.
+
+! ===========================================================
+
+
+! 2.1 A completer par l'utilisateur : valeur des coefs
+! -----------------------------------------------------
+
+! --- Attention
+! Il est important que les CKUPDC soient completes (par des valeurs
+! nulles eventuellement) dans la mesure ou ils seront utilises pour
+! calculer un terme source dans les cellules identifiees precedemment.
+
+! On les initialise tous par des valeurs nulles.
+! Et on demande a l'utilisateur de conserver cette initialisation.
+! =========
+
+ do ikpdc = 1, 6
+ do ielpdc = 1, ncepdp
+ ckupdc(ielpdc,ikpdc) = 0.d0
+ enddo
+ enddo
+
+ if(iphas.eq.1) then
+
+! --- Tenseur diagonal
+! Exemple de pertes de charges dans la direction x
+
+ iutile = 0
+ if (iutile.eq.0) return
+
+ do ielpdc = 1, ncepdp
+ iel=icepdc(ielpdc)
+ vit = sqrt( rtpa(iel,iu(iphas))**2 &
+ + rtpa(iel,iv(iphas))**2 &
+ + rtpa(iel,iw(iphas))**2)
+ ckupdc(ielpdc,1) = 10.d0*vit
+ ckupdc(ielpdc,2) = 0.d0*vit
+ ckupdc(ielpdc,3) = 0.d0*vit
+ enddo
+
+! --- Tenseur 3x3
+! Exemple de pertes de charges a ALPHA = 45 degres x,y
+! la direction x resiste par ck1 et y par ck2
+! ck2 nul represente des ailettes comme ceci : ///////
+! dans le repere de calcul X Y
+
+! Y| /y
+! | /
+! |/
+! \--------------- X
+! \ / ALPHA
+! \
+! \ x
+
+ iutile = 0
+ if (iutile.eq.0) return
+
+ alpha = pi/4.d0
+ cosalp = cos(alpha)
+ sinalp = sin(alpha)
+ ck1 = 10.d0
+ ck2 = 0.d0
+
+ do ielpdc = 1, ncepdp
+ iel=icepdc(ielpdc)
+ vit = sqrt( rtpa(iel,iu(iphas))**2 &
+ + rtpa(iel,iv(iphas))**2 &
+ + rtpa(iel,iw(iphas))**2)
+ ckupdc(ielpdc,1) = (cosalp**2*ck1 + sinalp**2*ck2)*vit
+ ckupdc(ielpdc,2) = (sinalp**2*ck1 + cosalp**2*ck2)*vit
+ ckupdc(ielpdc,3) = 0.d0
+ ckupdc(ielpdc,4) = cosalp*sinalp*(-ck1+ck2)*vit
+ ckupdc(ielpdc,5) = 0.d0
+ ckupdc(ielpdc,6) = 0.d0
+ enddo
+
+ endif
+
+
+!-------------------------------------------------------------------------------
+
+endif
+
+return
+
+end
diff --git a/users/base/usmodg.f90 b/users/base/usmodg.f90
new file mode 100644
index 0000000..1ee04e1
--- /dev/null
+++ b/users/base/usmodg.f90
@@ -0,0 +1,174 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usmodg &
+!================
+
+ ( ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ xyznod )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR MODIF DE LA GEOMETRIE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! --- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! --- ! longueur du tableau nodfbr (optionnel !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! --- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! --- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! --- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! --- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! xyznod ! tr ! --- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+
+double precision xyznod(ndim,nnod)
+
+! VARIABLES LOCALES
+
+integer iutile
+integer inod
+double precision xxx1, xxx2, xxx3
+double precision unsmil
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!============================================================================
+! MODIFICATION DES COORDONNES DES SOMMETS
+!============================================================================
+
+! On donne ci dessous des exemples, desactives par le test.
+
+iutile = 0
+
+if(iutile.eq.1) then
+
+! exemple : division des dimensions par 1000
+! (passage de millimetres en metres)
+
+! ATTENTION :
+
+! LE CHANGEMENT D'ECHELLE DU MAILLAGE EST INCOMPTABILE
+! AVEC LA PERIODICITE, QUELLE QU'ELLE SOIT
+
+! POUR UTILISER LA PERIODICITE, IL FAUT CHANGER D'ECHELLE
+! EN DEHORS DE CODE_SATURNE
+
+ unsmil = 1.d0 / 1000.d0
+
+ do inod = 1, nnod
+ xxx1 = xyznod(1,inod)
+ xxx2 = xyznod(2,inod)
+ xxx3 = xyznod(3,inod)
+ xyznod(1,inod) = xxx1 * unsmil
+ xyznod(2,inod) = xxx2 * unsmil
+ xyznod(3,inod) = xxx3 * unsmil
+ enddo
+
+endif
+
+!-------------------------------------------------------------------------------
+
+return
+
+end
diff --git a/users/base/usmpst.f90 b/users/base/usmpst.f90
new file mode 100644
index 0000000..5c26192
--- /dev/null
+++ b/users/base/usmpst.f90
@@ -0,0 +1,384 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usmpst &
+!================
+
+ ( idbia0 , idbra0 , ipart , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ ncelps , nfacps , nfbrps , &
+ nideve , nrdeve , nituse , nrtuse , imodif , &
+ itypps , ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , &
+ tracel , trafac , trafbr , rdevel , rtuser , ra )
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LA MODIFICATION DES LISTES DE CELLULES
+! OU FACES INTERNES ET DE BORD DEFINISSANT UN MAILLAGE DE POST
+! TRAITEMENT EXISTANT ; CETTE ROUTINE EST APPELEE AUX PAS DE
+! TEMPS AUQUEL CE MAILLAGE EST ACTIF, ET UNIQUEMENT POUR LES
+! MAILLAGES POST UTILISATEUR PRINCIPAUX (NON ALIAS), SI TOUS LES
+! "WRITERS" ASSOCIES A CE MAILLAGE OU SES ALIAS PERMETTENT
+! CETTE MODIFICATION
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ipart ! e ! <-- ! numero du maillage post !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
+! ncelps ! e ! <-- ! nombre de cellules du maillage post !
+! nfacps ! e ! <-- ! nombre de faces interieur post !
+! nfbrps ! e ! <-- ! nombre de faces de bord post !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! imodif ! e ! <-- ! 0 si maillage non modifie par cette !
+! ! ! ! fonction, 1 si modifie !
+! itypps(3) ! te ! <-- ! indicateur de presence (0 ou 1) de !
+! ! ! ! cellules (1), faces (2), ou faces de !
+! ! ! ! de bord (3) dans le maillage post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
+! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
+! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! statis ! tr ! <-- ! statistiques (lagrangien) !
+!ncelet,nvlsta) ! ! ! !
+! tracel(*) ! tr ! <-- ! tab reel valeurs cellules post !
+! trafac(*) ! tr ! <-- ! tab reel valeurs faces int. post !
+! trafbr(*) ! tr ! <-- ! tab reel valeurs faces bord post !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "optcal.h"
+include "numvar.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ipart
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nvlsta
+integer ncelps , nfacps , nfbrps
+integer nideve , nrdeve , nituse , nrtuse, imodif
+
+integer itypps(3)
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision statis(ncelet,nvlsta)
+double precision tracel(ncelps*3)
+double precision trafac(nfacps*3), trafbr(nfbrps*3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer ifac , iphas
+integer ii , jj
+double precision vmin2, v2, w2
+
+
+!===============================================================================
+
+! Remarque : le tableau ITYPPS permet de savoir si le maillage post
+! contient a l'origine des cellules, des faces internes,
+! ou des faces de bord (sur l'ensemble des processeurs).
+
+! Ceci permet d'avoir un traitement "generique" qui
+! peut fonctionner pour tous les numeros de maillage,
+! mais si le maillage post est vide a un instant de
+! post traitement donne, on ne saura plus s'il contenait
+! des cellules ou faces. Dans ce cas, il est preferable
+! d'utiliser explicitement le numero du maillage post
+! pour bien determiner s'il doit contenir des cellules
+! ou des faces.
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. TRAITEMENT DES MAILLAGES POST A REDEFINIR
+! A RENSEIGNER PAR L'UTILISATEUR aux endroits indiques
+!===============================================================================
+
+! Exemple :
+! pour les maillage post utilisateur, on ne conserve que
+! les mailles auxquelles la vitesse est superieure �
+! un seuil donne.
+
+
+if (ipart.eq.3) then
+
+ imodif = 1
+
+ ncelps = 0
+ nfacps = 0
+ nfbrps = 0
+
+ vmin2 = (0.5d0)**2
+
+! SI LE MAILLAGE POST CONTIENT DES CELLULES
+! -----------------------------------------
+
+ if (itypps(1) .eq. 1) then
+
+ do ii = 1, ncel
+
+ iphas = 1
+
+ v2 = rtp(ii, iu(iphas))**2 + rtp(ii, iv(iphas))**2 &
+ + rtp(ii, iw(iphas))**2
+ if (v2 .ge. vmin2) then
+ ncelps = ncelps + 1
+ lstcel(ncelps) = ii
+ endif
+
+ enddo
+
+! SI LE MAILLAGE POST CONTIENT DES FACES INTERNES
+! -----------------------------------------------
+
+ else if (itypps(2) .eq. 1) then
+
+ do ifac = 1, nfac
+
+ iphas = 1
+
+ ii = ifacel(1, ifac)
+ jj = ifacel(2, ifac)
+
+ v2 = rtp(ii, iu(iphas))**2 + rtp(ii, iv(iphas))**2 &
+ + rtp(ii, iw(iphas))**2
+ w2 = rtp(jj, iu(iphas))**2 + rtp(jj, iv(iphas))**2 &
+ + rtp(jj, iw(iphas))**2
+
+ if (v2 .ge. vmin2 .or. w2 .ge. vmin2) then
+ nfacps = nfacps + 1
+ lstfac(nfacps) = ifac
+ endif
+
+ enddo
+
+! SI LE MAILLAGE POST CONTIENT DES FACES DE BORD
+! ----------------------------------------------
+
+ else if (itypps(3) .eq. 1) then
+
+ do ifac = 1, nfabor
+
+ iphas = 1
+
+ ii = ifabor(ifac)
+
+ v2 = rtp(ii, iu(iphas))**2 + rtp(ii, iv(iphas))**2 &
+ + rtp(ii, iw(iphas))**2
+
+ if (v2 .ge. vmin2) then
+ nfbrps = nfbrps + 1
+ lstfbr(nfbrps) = ifac
+ endif
+
+ enddo
+
+ endif
+
+! Fin du test sur le type de mailles deja existantes
+
+else if (ipart.eq.4) then
+
+ imodif = 1
+
+ ncelps = 0
+ nfacps = 0
+ nfbrps = 0
+
+ vmin2 = (0.5d0)**2
+
+! SELECTION DES FACES INTERNES
+! ----------------------------
+
+ do ifac = 1, nfac
+
+ iphas = 1
+
+ ii = ifacel(1, ifac)
+ jj = ifacel(2, ifac)
+
+ v2 = rtp(ii, iu(iphas))**2 + rtp(ii, iv(iphas))**2 &
+ + rtp(ii, iw(iphas))**2
+ w2 = rtp(jj, iu(iphas))**2 + rtp(jj, iv(iphas))**2 &
+ + rtp(jj, iw(iphas))**2
+
+ if ( (v2 .ge. vmin2 .and. w2 .lt. vmin2) &
+ .or. (v2 .lt. vmin2 .and. w2 .ge. vmin2)) then
+ nfacps = nfacps + 1
+ lstfac(nfacps) = ifac
+ endif
+
+ enddo
+
+! SELECTION DES FACES DE BORD
+! ---------------------------
+
+ do ifac = 1, nfabor
+
+ iphas = 1
+
+ ii = ifabor(ifac)
+
+ v2 = rtp(ii, iu(iphas))**2 + rtp(ii, iv(iphas))**2 &
+ + rtp(ii, iw(iphas))**2
+
+ if (v2 .ge. vmin2) then
+ nfbrps = nfbrps + 1
+ lstfbr(nfbrps) = ifac
+ endif
+
+ enddo
+
+endif
+! Fin du test sur le numero de maillage post.
+
+
+return
+
+end
diff --git a/users/base/usnpst.f90 b/users/base/usnpst.f90
new file mode 100644
index 0000000..9874786
--- /dev/null
+++ b/users/base/usnpst.f90
@@ -0,0 +1,236 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usnpst &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE UTILISATEUR : CHOIX DE REALISER DES SORTIES DE
+! POST-TRAITEMENT AU PAS DE TEMPS COURANT
+
+
+! CE SOUS-PROGRAMME EST APPELE A LA FIN DE CHAQUE PAS DE TEMPS.
+
+
+! QUELS QUE SOIENT LES CHOIX REALISES DANS CE SOUS-PROGRAMME ,
+! IL Y AURA TOUJOURS UNE SORTIE POST-TRAITEMENT EN FIN DE CALCUL
+
+
+! ON PASSE UN MAXIMUM D'ARGUMENTS POUR PERMETTRE DE REALISER DES
+! TESTS COMPLEXES SI BESOIN (SORTIE A UN INSTANT DONNE,
+! SORTIE LORSQUE QU'UNE VARIABLE PREND UNE VALEUR DONNEE...)
+
+! ON DISPOSE PAR AILLEURS DES INFORMATIONS SUIVANTES DANS LES
+! COMMONS DU FICHIER optcal.h
+
+! ! NTPABS ! E ! <-- ! NUMERO ABSOLU DU DERNIER PAS DE TEMPS !
+! ! ! ! ! DU CALCUL PRECEDENT EN CAS DE SUITE !
+! ! ! ! ! (SINON = 0) !
+! ! NTCABS ! E ! <-- ! NUMERO ABSOLU DU PAS DE TEMPS COURANT !
+! ! NTMABS ! E ! <-- ! NUMERO ABSOLU DU DERNIER PAS DE TEMPS !
+! ! ! ! ! VISE !
+! ! TTPABS ! E ! <-- ! TEMPS ABSOLU DU DERNIER PAS DE TEMPS !
+! ! ! ! ! DU CALCUL PRECEDENT EN CAS DE SUITE !
+! ! ! ! ! (SINON = 0) !
+! ! TTCABS ! E ! <-- ! TEMPS ABSOLU DU PAS DE TEMPS COURANT !
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "entsor.h"
+include "optcal.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nvlsta
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision statis(ncelet,nvlsta)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer indwri, indact
+
+!===============================================================================
+! ACTIVATION OU DESACTIVATION DES SORTIES
+!===============================================================================
+
+! ON ACTIVE LES SORTIES PAR DEFAUT AUX PAS DE TEMPS MULTIPLES
+! DES FREQUENCES DE SORTIE DES WRITERS DIVERS
+
+call pstntc(ntcabs)
+!==========
+
+! ON PEUT FORCER L'ACTIVATION OU LA DESACTIVATION DES DIFFERENTS
+! WRITERS A UN PAS DE TEMPS DONNE:
+
+! INDWRI = 0 pour traiter tous les writers, ou le numero
+! d'un writer particulier pour le traiter independamment
+
+! INDACT = 1 pour forcer l'activation a ce pas de temps
+! 0 pour forcer la desactivation a ce pas de temps
+
+if (ntcabs .eq. ntmabs) then
+ indwri = 0
+ indact = 1
+ call pstact(indwri, indact)
+ !==========
+endif
+
+return
+end
diff --git a/users/base/usphyv.f90 b/users/base/usphyv.f90
new file mode 100644
index 0000000..73ce884
--- /dev/null
+++ b/users/base/usphyv.f90
@@ -0,0 +1,876 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usphyv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : REMPLISSAGE DES VARIABLES PHYSIQUES
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! dans usini1 si on souhaite imposer une chaleur specifique
+! CP variable pour la phase IPHAS (sinon: ecrasement memoire).
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivart, iclvar, iel, iphas
+integer ipcrom, ipbrom, ipcvis, ipccp
+integer ipcvsl, ith, iscal, ii
+integer iutile
+double precision vara, varb, varc, varam, varbm, varcm, vardm
+double precision varal, varbl, varcl, vardl
+double precision varac, varbc
+double precision xrtp
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 0. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+
+
+
+
+!===============================================================================
+
+
+! LES EXEMPLES FANTAISISTES SUIVANTS SONT A ADAPTER PAR L'UTILISATEUR
+! ====================================================================
+
+! Chaque exemple est encadre par un test sur IUTILE, par securite.
+! Mettre IUTILE a 1 pour activer l'exemple.
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! EXEMPLE 1 : MASSE VOLUMIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! EXEMPLE 2 : VISCOSITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! EXEMPLE 3 : CHALEUR SPECIFIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! EXEMPLE 4 : Lambda/CP VARIABLE EN FONCTION DE LA TEMPERATURE
+! POUR LA TEMPERATURE OU L'ENTHALPIE
+! EXEMPLE 5 : DIFFUSIVITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! POUR LES SCALAIRES
+!===============================================================================
+
+
+
+
+
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 1 : MASSE VOLUMIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! ===========
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la masse volumique
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules (et, de facon optionnelle, aux faces de bord).
+! ===================================================================
+
+! Le test sur IUTILE permet de desactiver les instructions (qui
+! ne sont fournies qu'a titre d'exemple a adapter)
+
+iutile = 0
+if(iutile.eq.1) then
+
+! --- Boucle sur les phases : debut
+ do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+! (et de ses conditions limites)
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ if (iscalt(iphas).gt.0) then
+ ivart = isca(iscalt(iphas))
+ else
+ write(nfecra,9010) iscalt(iphas)
+ call csexit (1)
+ endif
+
+! --- Position des conditions limites de la variable IVART
+
+ iclvar = iclrtp(ivart,icoef)
+
+! --- Rang de la masse volumique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCROM
+! dans PROPFB, prop. physiques au centre des faces de bord : IPBROM
+
+ ipcrom = ipproc(irom(iphas))
+ ipbrom = ipprob(irom(iphas))
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ vara = -4.0668d-3
+ varb = -5.0754d-2
+ varc = 1000.9d0
+
+
+
+! Masse volumique au centre des cellules
+! ---------------------------------------
+! loi RHO = T * ( A * T + B ) + C
+! soit PROPCE(IEL,IPCROM) = XRTP * (VARA*XRTP+VARB) + VARC
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcrom) = xrtp * (vara*xrtp+varb) + varc
+ enddo
+
+
+
+! Masse volumique aux faces de bord
+! ----------------------------------
+
+! Par defaut, la valeur de rho au bord est la valeur prise
+! au centre des elements voisins. C'est l'approche conseillee.
+! Pour etre dans ce cas il suffit de ne rien faire :
+! ne pas prescrire de valeur pour PROPFB(IFAC,IPBROM) et
+! ne pas modifier IBROM(IPHAS)
+! ---------------
+
+! Pour les utilisateurs qui ne souhaiteraient pas suivre ce
+! conseil, on precise que la temperature au bord peut etre
+! fictive, simplement destinee a conserver un flux (c'est
+! en particulier le cas en paroi). La valeur de rho calculee
+! au bord avec en introduisant cette temperature fictive
+! dans une loi physique peut donc etre totalement fausse
+! (negative par exemple).
+
+! Si malgre tout on souhaite imposer la loi :
+! RHO = T * ( A * T + B ) + C
+! soit PROPFB(IFAC,IPBROM) = XRTP * (VARA*XRTP+VARB) + VARC
+! T etant la temperature prise au centre des faces de bord,
+
+! on peut utiliser les lignes de code suivantes (volontairement
+! desactivees, car a manier avec precaution) :
+
+! Noter bien que dans le cas ou l'on impose la masse volumique
+! au bord, il faut le faire sur TOUTES les faces de bord.
+! ======
+
+! IBROM(IPHAS) = 1
+! DO IFAC = 1, NFABOR
+! IEL = IFABOR(IFAC)
+! XRTP = COEFA(IFAC,ICLVAR)+RTP(IEL,IVART)*COEFB(IFAC,ICLVAR)
+! PROPFB(IFAC,IPBROM) = XRTP * (VARA*XRTP+VARB) + VARC
+! ENDDO
+
+! IFABOR(IFAC) est l'element en regard de la face de bord
+
+! Attention IBROM(IPHAS) = 1 est indispensable pour que la loi
+! soit prise en compte. -------------
+
+
+
+ enddo
+! --- Boucle sur les phases : fin
+endif
+! --- Test sur IUTILE : fin
+
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 2 : VISCOSITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! ===========
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la viscosite
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! Le test sur IUTILE permet de desactiver les instructions (qui
+! ne sont fournies qu'a titre d'exemple a adapter)
+
+iutile = 0
+if(iutile.eq.1) then
+
+! --- Boucle sur les phases : debut
+ do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ if (iscalt(iphas).gt.0) then
+ ivart = isca(iscalt(iphas))
+ else
+ write(nfecra,9010) iscalt(iphas)
+ call csexit (1)
+ endif
+
+! --- Rang de la viscosite dynamique moleculaire de la phase IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCVIS
+
+ ipcvis = ipproc(iviscl(iphas))
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varam = -3.4016d-9
+ varbm = 6.2332d-7
+ varcm = -4.5577d-5
+ vardm = 1.6935d-3
+
+
+
+! Viscosite moleculaire dynamique en kg/(m s) au centre des cellules
+! ------------------------------------------------------------------
+! loi MU =
+! T *( T *( AM * T + BM )+ CM )+ DM
+! soit PROPCE(IEL,IPCVIS) =
+! & XRTP*(XRTP*(VARAM*XRTP+VARBM)+VARCM)+VARDM
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvis) = &
+ xrtp*(xrtp*(varam*xrtp+varbm)+varcm)+vardm
+ enddo
+
+
+ enddo
+! --- Boucle sur les phases : fin
+endif
+! --- Test sur IUTILE : fin
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 3 : CHALEUR SPECIFIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! ===========
+
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la chaleur specifique
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! Le test sur IUTILE permet de desactiver les instructions (qui
+! ne sont fournies qu'a titre d'exemple a adapter)
+
+iutile = 0
+if(iutile.eq.1) then
+
+! --- Boucle sur les phases : debut
+ do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ if (iscalt(iphas).gt.0) then
+ ivart = isca(iscalt(iphas))
+ else
+ write(nfecra,9010) iscalt(iphas)
+ call csexit (1)
+ endif
+
+! --- Rang de la chaleur specifique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCCP
+
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+ else
+ ipccp = 0
+ endif
+
+! --- Stop si CP n'est pas variable
+
+ if(ipccp.le.0) then
+ write(nfecra,1000) iphas, iphas, icp(iphas)
+ call csexit (1)
+ endif
+
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varac = 0.00001d0
+ varbc = 1000.0d0
+
+
+
+! Chaleur specifique J/(kg degres) au centre des cellules
+! --------------------------------------------------------
+! loi CP = AC * T + BM
+! soit PROPCE(IEL,IPCCP ) = VARAC*XRTP + VARBC
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipccp ) = varac*xrtp + varbc
+ enddo
+
+
+ enddo
+! --- Boucle sur les phases : fin
+endif
+! --- Test sur IUTILE : fin
+
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 4 : Lambda/CP VARIABLE EN FONCTION DE LA TEMPERATURE
+! =========== POUR LA TEMPERATURE OU L'ENTHALPIE
+
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! le rapport lambda/Cp
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! Le test sur IUTILE permet de desactiver les instructions (qui
+! ne sont fournies qu'a titre d'exemple a adapter)
+
+iutile = 0
+if(iutile.eq.1) then
+
+! --- Boucle sur les phases : debut
+ do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ if (iscalt(iphas).gt.0) then
+ ivart = isca(iscalt(iphas))
+ else
+ write(nfecra,9010) iscalt(iphas)
+ call csexit (1)
+ endif
+
+! --- Rang de Lambda/CP de la variable thermique de phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCVSL
+
+ if(ivisls(iscalt(iphas)).gt.0) then
+ ipcvsl = ipproc(ivisls(iscalt(iphas)))
+ else
+ ipcvsl = 0
+ endif
+
+! --- Stop si Lambda/CP n'est pas variable
+
+ if(ipcvsl.le.0) then
+ write(nfecra,1010) &
+ iscalt(iphas), iscalt(iphas), ivisls(iscalt(iphas))
+ call csexit (1)
+ endif
+
+! --- Rang de la chaleur specifique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCCP
+
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+ else
+ ipccp = 0
+ endif
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varal = -3.3283d-7
+ varbl = 3.6021d-5
+ varcl = 1.2527d-4
+ vardl = 0.58923d0
+
+
+
+! Lambda/Cp en kg/(m s) au centre des cellules
+! ------------------------------------------
+! loi Lambda/CP =
+! { T *( T *( AL * T + BL )+ CL )+ DL } / Cp
+! soit PROPCE(IEL,IPCVSL) =
+! & (XRTP*(XRTP*(VARAL*XRTP+VARBL)+VARCL)+VARDL)/CP0(IPHAS)
+
+! On suppose Cp renseigne au prealable.
+
+ if(ipccp.le.0) then
+
+! --- Si CP est uniforme, on utilise CP0(IPHAS)
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvsl) = &
+ (xrtp*(xrtp*(varal*xrtp+varbl)+varcl)+vardl) &
+ /cp0(iphas)
+ enddo
+
+ else
+
+! --- Si CP est non uniforme, on utilise PROPCE ci dessus
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvsl) = &
+ (xrtp*(xrtp*(varal*xrtp+varbl)+varcl)+vardl) &
+ /propce(iel,ipccp)
+ enddo
+
+ endif
+
+
+ enddo
+! --- Boucle sur les phases : fin
+endif
+! --- Test sur IUTILE : fin
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 5 : DIFFUSIVITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! =========== POUR LES SCALAIRES UTILISATEURS
+! A l'exclusion de
+! temperature, enthalpie (traites plus haut)
+! variances de fluctuations (propriete egale a celle du
+! scalaire associe)
+
+! Ci dessous on donne pour tous les scalaires (aux exclusions
+! ci-dessus pres) la meme loi pour la diffusivite
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! Le test sur IUTILE permet de desactiver les instructions (qui
+! ne sont fournies qu'a titre d'exemple a adapter)
+
+iutile = 0
+if(iutile.eq.1) then
+
+! --- Boucle sur les scalaires : debut
+ do ii = 1, nscaus
+
+! --- Numero du scalaire utilisateur II dans la liste de tous les scalaires
+ iscal = ii
+
+
+! --- S'il s'agit d'une variable thermique,
+! son cas a deja ete traite plus haut
+ ith = 0
+ do iphas = 1, nphas
+ if (iscal.eq.iscalt(iphas)) ith = 1
+ enddo
+
+! --- Si la variable est une fluctuation, sa diffusivite est
+! la meme que celle du scalaire auquel elle est rattachee :
+! il n'y a donc rien a faire ici : on passe directement
+! a la variable suivante sans renseigner PROPCE(IEL,IPCVSL).
+
+ if (ith.eq.0.and.iscavr(iscal).le.0) then
+! --- On ne traite ici que les variables non thermiques
+! et qui ne sont pas des fluctuations
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable thermique pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ iphas = iphsca(iscal)
+ if (iscalt(iphas).gt.0) then
+ ivart = isca(iscalt(iphas))
+ else
+ write(nfecra,9010) iscalt(iphas)
+ call csexit (1)
+ endif
+
+! --- Rang de Lambda du scalaire
+! dans PROPCE, prop. physiques au centre des elements : IPCVSL
+
+ if(ivisls(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+ else
+ ipcvsl = 0
+ endif
+
+! --- Stop si Lambda n'est pas variable
+
+ if(ipcvsl.le.0) then
+ write(nfecra,1010) iscal, iscal, ivisls(iscal)
+ call csexit (1)
+ endif
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varal = -3.3283d-7
+ varbl = 3.6021d-5
+ varcl = 1.2527d-4
+ vardl = 0.58923d0
+
+
+! Lambda en kg/(m s) au centre des cellules
+! ------------------------------------------
+! loi Lambda =
+! T *( T *( AL * T + BL )+ CL )+ DL
+! soit PROPCE(IEL,IPCVSL) =
+! & XRTP*(XRTP*(VARAL*XRTP+VARBL)+VARCL)+VARDL
+
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvsl) = &
+ (xrtp*(xrtp*(varal*xrtp+varbl)+varcl)+vardl)
+ enddo
+
+
+ endif
+! --- Tests sur ITH et ISCAVR : fin
+
+ enddo
+! --- Boucle sur les scalaires : fin
+endif
+! --- Test sur IUTILE : fin
+
+
+
+
+
+
+!===============================================================================
+
+!===============================================================================
+! FORMATS
+!----
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DONNEES DE CALCUL INCOHERENTES ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,/,&
+'@ usini1 indique que la chaleur specifique est uniforme ',/,&
+'@ ICP(',I10 ,') = ',I10 ,' alors que ',/,&
+'@ usphyv impose une chaleur specifique variable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1 ou usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DONNEES DE CALCUL INCOHERENTES ',/,&
+'@ ',/,&
+'@ Pour le scalaire ',I10 ,/,&
+'@ usini1 indique que la diffusivite est uniforme ',/,&
+'@ IVISLS(',I10 ,') = ',I10 ,' alors que ',/,&
+'@ usphyv impose une diffusivite variable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1 ou usphyv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ APPEL A csexit DANS LE SOUS PROGRAMME usphyv ',/,&
+'@ ',/,&
+'@ La variable dont dependent les proprietes physiques ne ',/,&
+'@ semble pas etre une variable de calcul. ',/,&
+'@ En effet, on cherche a utiliser la temperature alors que',/,&
+'@ ISCALT(IPHAS) = ',I10 ,/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage de usphyv (et le test lors de la ',/,&
+'@ definition de IVART). ',/,&
+'@ Verifier la definition des variables de calcul dans ',/,&
+'@ usini1. Si un scalaire doit jouer le role de la ',/,&
+'@ temperature, verifier que ISCALT a ete renseigne. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/usproj.f90 b/users/base/usproj.f90
new file mode 100644
index 0000000..61f8f3a
--- /dev/null
+++ b/users/base/usproj.f90
@@ -0,0 +1,1864 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usproj &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvep , nivep , ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , statis , stativ , tslagr , parbor , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! MODIFICATION UTILISATEUR EN FIN DE PAS DE TEMPS
+! TOUT EST POSSIBLE,
+
+
+! ON DONNE ICI PLUSIEURS EXEMPLES :
+
+! - CALCUL DE BILAN THERMIQUE
+! (au besoin, voir "ADAPTATION A UN SCALAIRE QUELCONQUE")
+
+! - CALCUL DES EFFORTS GLOBAUX SUR UN SOUS-ENSEMBLE DE FACES
+
+! - MODIFICATION ARBITRAIRE D'UNE VARIABLE DE CALCUL
+
+! - EXTRACTION D'UN PROFIL 1D
+
+! - IMPRESSION D'UN MOMENT
+
+! - EXEMPLES D'UTILISATION DES ROUTINES DE PARALLELISME
+
+! CES EXEMPLES SONT DONNES EN SUPPOSANT UN CAS AVEC PERIODICITE
+! (IPERIO .GT.0) ET PARALLELISME (IRANGP.GE.0).
+
+
+! LE CALCUL DE BILAN THERMIQUE FOURNIT EN OUTRE UNE TRAME POUR
+! PLUSIEURS CHOSES
+! - CALCUL DE GRADIENT (AVEC LES PRECAUTIONS UTILES EN PARALLELE ET
+! PERIODIQUE)
+! - CALCUL DE GRANDEUR DEPENDANT DES VALEURS AUX CELLULES VOISINES
+! D'UNE FACE (AVEC LES PRECAUTIONS A PRENDRE EN PARALLELE ET
+! PERIODIQUE : VOIR L'ECHANGE DE DT ET DE CP)
+! - CALCUL D'UNE SOMME SUR LES PROCESSEURS LORS D'UN CALCUL
+! PARALLELE (PARSOM)
+
+
+! IDENTIFICATION DES CELLULES/FACES DE BORD/FACES INTERNES
+! ========================================================
+
+! Les commandes GETCEL, GETFBR et GETFAC permettent d'identifier
+! respectivement les cellules, faces ou faces de bord en fonction
+! de differents criteres.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! La syntaxe des commandes GETFBR et GETFAC est identique.
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particules autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! moyennes statistiques !
+!(ncelet,nvlsta ! ! ! !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! tslagr ! tr ! <-- ! terme de couplage retour du !
+!(ncelet,ntersl ! ! ! lagrangien sur la phase porteuse !
+! parbor ! tr ! <-- ! infos sur interaction des particules !
+!(nfabor,nvisbr ! ! ! aux faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,nvlsta), stativ(ncelet,nvlsta-1)
+double precision tslagr(ncelet,ntersl)
+double precision parbor(nfabor,nvisbr)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel , ielg , ifac , ifacg , ivar
+integer iel1 , iel2 , ieltsm
+integer iortho , impout
+integer ifinia , ifinra
+integer igradx , igrady , igradz
+integer itravx , itravy , itravz , itreco
+integer inc , iccocg
+integer nswrgp , imligp , iphydp , iwarnp
+integer iutile , iphas , iclvar , iii
+integer ipcrom , ipcvst , iflmas , iflmab , ipccp, ipcvsl
+integer idimte , itenso , iscal
+integer ii , nbr , irangv , irang1 , npoint
+integer imom , ipcmom , idtcm
+integer itab(3), iun
+integer ncesmp , icesmp , ismacp , itpsmp
+integer ilelt , nlelt
+
+double precision xrtpa , xrtp
+double precision xbilan , xbilvl , xbilpa , xbilpt
+double precision xbilsy , xbilen , xbilso , xbildv
+double precision xbilmi , xbilma
+double precision epsrgp , climgp , extrap
+double precision xfluxf , xgamma
+double precision diipbx, diipby, diipbz, surfbn, distbr
+double precision visct, flumab , xcp , xvsl, cp0iph, rrr
+double precision xfor(3), xyz(3), xabs, xu, xv, xw, xk, xeps
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! ---> Gestion memoire
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+! 2. EXEMPLE : CALCUL DE BILAN D'ENERGIE RELATIF A LA TEMPERATURE
+! ------------------------------------------------------------
+
+! On suppose que l'on souhaite faire des bilans (convectifs et
+! diffusifs) aux frontieres du domaine de calcul represente
+! ci-dessous (frontieres reperees par leurs couleurs).
+
+! Le scalaire considere est la temperature. On fera egalement
+! intervenir la chaleur massique (pour obtenir des bilans en Joules).
+
+
+
+! Domaine et couleurs
+! -------------------
+! 6
+! --------------------------
+! | |
+! | |
+! 7 | 1 | 5
+! | ^ |
+! | | |
+! --------------------------
+
+! 2 3 4
+
+
+! 2, 4, 7 : parois adiabatiques
+! 6 : paroi a temperature imposee
+! 3 : entree
+! 5 : sortie
+! 1 : symetrie
+
+
+! ---------------------------------------------------------------------
+
+! POUR LA SIGNIFICATION PHYSIQUE DE CALCULS, IL EST UTILE D'ADOPTER
+! UN PAS DE TEMPS UNIFORME EN ESPACE (IDTVAR = 0 OU 1)
+! EN OUTRE, MEME EN SUITE DE CALCUL, LE BILAN EST FAUX SI INPDT0=1
+! (VISCT NON INITIALISE ET T(n-1) NON CONNU)
+
+! ---------------------------------------------------------------------
+
+! VARIABLE TEMPERATURE : IVAR = ISCA(ISCALT) (utiliser RTP(IEL,IVAR))
+
+! ---------------------------------------------------------------------
+
+! LE BILAN A L'INSTANT N VAUT :
+
+
+! n iel=ncelet n-1
+! BILAN = SOMME { VOLUME(iel)*CP*ROM(iel)
+! iel=1
+! *(RTPA(iel,ivar)-RTP(iel,ivar)) }
+
+! ifac=nfabor
+! + SOMME { SURFBN(ifac)*DT(IFABOR(ifac))*CP
+! ifac=1
+
+! * [ VISLS0(ISCALT) + VISCT(IFABOR(ifac))/SIGMAS(ISCALT) ]
+! / DISTBR(ifac)
+! * [ COEFA(ifac,ICLVAR)
+! + (COEFB(ifac,ICLVAR)-1.D0)*RTP(IFABOR(ifac,ivar)) ] }
+
+! ifac=nfabor
+! + SOMME { DT(IFABOR(ifac))*CP
+! ifac=1
+! *RTP(IFABOR(ifac,ivar))*(-FLUMAB(ifac)) }
+
+
+! Le premier terme (nul en stationnaire) est negatif si la quantite
+! d'energie a decru dans le volume.
+! Les autres termes (convection, diffusion) sont positifs si la
+! quantite d'energie a augmente dans le volume par les
+! apports des conditions aux limites.
+
+! En regime stationnaire, un bilan positif indique donc
+! un gain d'energie.
+
+! ---------------------------------------------------------------------
+
+
+! AVEC ROM CALCULE PAR LA LOI REGISSANT LA MASSE VOLUMIQUE DANS USPHYV,
+! SOIT, PAR EXEMPLE :
+! n-1
+! ROM (iel) = P0 / [ RR * ( RTPA(iel,IVAR) + TKELV ) ]
+
+
+! ---------------------------------------------------------------------
+
+! CP ET LAMBDA/CP PEUVENT ETRE VARIABLES
+
+! ---------------------------------------------------------------------
+! ---------------------------------------------------------------------
+
+
+
+
+! ADAPTATION A UN SCALAIRE QUELCONQUE
+! -----------------------------------
+
+! L'approche peut s'utiliser pour realiser le bilan d'un scalaire
+! quelconque (mais les bilans ne sont plus attendus en Joules et
+! la chaleur massique n'intervient donc plus)
+
+! Pour cela :
+
+! - remplacer ISCALT(IPHAS) par le numero ISCAL du scalaire souhaite
+! ISCAL pouvant varier de 1 a NSCAL
+
+! - positionner IPCCP a 0 independamment de la valeur de ICP(IPHAS)
+! et affecter la valeur 1 a CP0IPH (au lieu de CP0(IPHAS)).
+
+!===============================================================================
+
+
+! Le bilan n'est pas valable si INPDT0=1
+if (inpdt0.eq.0) then
+
+
+! 2.1 INITIALISATION
+! ==================
+
+! --> Variables locales
+! -----------------
+
+! XBILVL : bilan volumique des termes instationnaires
+! XBILDV : bilan volumique du au terme en div(rho u)
+! XBILPA : bilan en paroi adiabatique
+! XBILPT : bilan en paroi a temperature imposee
+! XBILSY : bilan en symetrie
+! XBILEN : bilan en entree
+! XBILSO : bilan en sortie
+! XBILMI : bilan lie aux injections de masse
+! XBILMA : bilan lie aux aspirations de masse
+! XBILAN : bilan total
+
+xbilvl = 0.d0
+xbildv = 0.d0
+xbilpa = 0.d0
+xbilpt = 0.d0
+xbilsy = 0.d0
+xbilen = 0.d0
+xbilso = 0.d0
+xbilmi = 0.d0
+xbilma = 0.d0
+xbilan = 0.d0
+
+! --- On travaillera sur la phase 1 uniquement
+iphas = 1
+
+! --- Le numero du scalaire temperature est ISCAL
+iscal = iscalt(iphas)
+
+! --- Le numero de variable temperature est IVAR
+ivar = isca(iscal)
+
+! --- Le numero pour les conditions aux limites est
+iclvar = iclrtp(ivar,icoef)
+
+! --- Numero des grandeurs physiques
+ipcrom = ipproc(irom(iphas))
+ipcvst = ipproc(ivisct(iphas))
+iflmas = ipprof(ifluma(ivar))
+iflmab = ipprob(ifluma(ivar))
+
+! --- On stocke dans IPCCP un indicateur permettant de determiner si
+! la Chaleur massique est constante (=CP0) ou variable. Elle sera
+! utilisee pour realiser les bilans (XBILVL est en Joules).
+if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+else
+ ipccp = 0
+ cp0iph = cp0(iphas)
+endif
+
+! --- On stocke dans IPCVSL un indicateur permettant de determiner si
+! la diffusivite est constante (=VISLS0) ou variable. Elle sera
+! utilisee pour les termes diffusifs.
+if(ivisls(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+else
+ ipcvsl = 0
+endif
+
+
+! --> Echange de Cp et de Dt
+! ----------------------
+
+! Pour calculer les valeurs de flux aux faces internes, il est
+! necessaire d'avoir acces aux variables dans les cellules voisines.
+! En particulier, il faut connaitre la chaleur massique et la valeur
+! du pas de temps. Pour cela,
+! - dans les calculs paralleles, il est necessaire que
+! les cellules situees sur un bord de sous-domaine connaissent
+! la valeur de ces variables dans les cellules situees en
+! vis-a-vis sur le sous-domaine voisin.
+! - dans les calculs periodiques, il est necessaire que
+! les cellules periodiques aient acces a la valeur de ces0
+! variables dans les cellules periodiques correspondantes
+
+! Pour cela, il est necessaire d'appeler les routines de
+! communication PARCOM (parallelisme) et PERCOM (periodicite)
+! pour echanger les valeurs de Cp et de Dt avant de calculer le
+! gradient. L'appel de ces routines doit etre dait dans cet ordre
+! PARCOM puis PERCOM (si parallelisme et periodicite coexistent).
+
+! Si le calcul n'est ni periodique, ni parallele, on peut conserver
+! appels (les tests sur IPERIO et IRANGP assurent la generalite)
+
+
+
+! - Echange pour le parallelisme
+
+ if(irangp.ge.0) then
+
+! Echange de Dt
+ call parcom (dt)
+ !==========
+
+! Echange de Cp si variable (sinon CP0(IPHAS) est utilise)
+ if(ipccp.gt.0) then
+ call parcom (propce(1,ipccp))
+ !==========
+ endif
+
+ endif
+
+
+! - Echange pour la periodicite
+
+ if(iperio.eq.1) then
+
+ idimte = 0
+ itenso = 0
+
+! Echange de Dt
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ dt , dt , dt , &
+ dt , dt , dt , &
+ dt , dt , dt )
+
+! Echange de Cp si variable (sinon CP0(IPHAS) est utilise)
+ if(ipccp.gt.0) then
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ propce(1,ipccp) , propce(1,ipccp) , propce(1,ipccp) , &
+ propce(1,ipccp) , propce(1,ipccp) , propce(1,ipccp) , &
+ propce(1,ipccp) , propce(1,ipccp) , propce(1,ipccp) )
+ endif
+
+ endif
+
+
+
+
+
+! --> Calcul de la valeur reconstruite en I' pour les mailles de bord
+
+
+! Pour les maillages orthogonaux, elle doit etre egale
+! a la valeur au centre de la cellule
+! Cette valeur est calculee dans RA(ITRECO+IFAC-1)
+! (avec IFAC=1,NFABOR)
+
+! Dans le cas de maillages orthogonaux, on peut simplifier :
+! il suffit d'affecter RTP(IEL,IVAR) a RA(ITRECO+IFAC-1),
+! avec IEL=IFABOR(IFAC)
+! (cette option correspond a la deuxieme branche du if ci dessous,
+! avec IORTHO different de 0)
+
+
+iortho = 0
+
+
+! --> Cas des maillages non orthogonaux
+
+if(iortho.eq.0) then
+
+! --- Reservation de la memoire
+
+ ifinia = idebia
+
+ igradx = idebra
+ igrady = igradx+ncelet
+ igradz = igrady+ncelet
+ itravx = igradz+ncelet
+ itravy = itravx+ncelet
+ itravz = itravy+ncelet
+ itreco = itravz+ncelet
+ ifinra = itreco+nfabor
+
+! --- Verification de la disponibilite de la memoire
+
+ CALL IASIZE('USPROJ',IFINIA)
+ CALL RASIZE('USPROJ',IFINRA)
+
+
+! --- Calcul du gradient de la temperature
+
+
+! Pour calculer le gradient de Temperature
+! - dans les calculs paralleles, il est necessaire que
+! les cellules situees sur un bord de sous-domaine connaissent
+! la valeur de temperature dans les cellules situees en
+! vis-a-vis sur le sous-domaine voisin.
+! - dans les calculs periodiques, il est necessaire que
+! les cellules periodiques aient acces a la valeur de la
+! temperature des cellules periodiques correspondantes
+
+! Pour cela, il est necessaire d'appeler les routines de
+! communication PARCOM (parallelisme) et PERCOM (periodicite)
+! pour echanger les valeurs de temperature avant de calculer le
+! gradient. L'appel a ces routines doit etre fait dans cet ordre
+! PARCOM puis PERCOM (pour les cas ou parallelisme et periodicite
+! coexistent).
+! En effet, on se situe ici a la fin du pas de temps n. Or,
+! les variables RTP ne seront echangees qu'en debut du pas de
+! temps n+1. Ici, seules les variables RTPA (obtenues a la fin
+! du pas de temps n-1) ont deja ete echangees.
+
+! Si le calcul n'est ni periodique, ni parallele, on peut conserver
+! appels (les tests sur IPERIO et IRANGP assurent la generalite)
+
+
+
+! - Echange pour le parallelisme
+
+ if(irangp.ge.0) then
+
+ call parcom (rtp(1,ivar))
+ !==========
+
+ endif
+
+! - Echange pour la periodicite
+
+ if(iperio.eq.1) then
+
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+
+ endif
+
+
+! - Calcul du gradient
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , &
+ epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra(itravx) , ra(itravx) , ra(itravx) , &
+ rtp(1,ivar) , coefa(1,iclvar) , coefb(1,iclvar) , &
+ ra(igradx) , ra(igrady) , ra(igradz) , &
+! ---------- ---------- ----------
+ ra(itravx) , ra(itravy) , ra(itravz) , &
+ rdevel , rtuser , ra )
+
+
+! - Calcul de la valeur reconstruite dans les cellules de bord
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ iii = idiipb-1+3*(ifac-1)
+ diipbx = ra(iii+1)
+ diipby = ra(iii+2)
+ diipbz = ra(iii+3)
+ ra(itreco+ifac-1) = rtp(iel,ivar) &
+ + diipbx*ra(igradx+iel-1) &
+ + diipby*ra(igrady+iel-1) &
+ + diipbz*ra(igradz+iel-1)
+ enddo
+
+
+
+
+! --> Cas des maillages orthogonaux
+
+else
+
+! --- Reservation de la memoire
+
+ ifinia = idebia
+
+ itreco = idebra
+ ifinra = itreco+nfabor
+
+! --- Verification de la disponibilite de la memoire
+
+ CALL IASIZE('USPROJ',IFINIA)
+ CALL RASIZE('USPROJ',IFINRA)
+
+! --- Calcul de la valeur reconstruite (en fait, ici, affectation
+! de la valeur non reconstruite)
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ ra(itreco+ifac-1) = rtp(iel,ivar)
+ enddo
+
+endif
+
+
+
+
+
+! 2.2 CALCUL DU BILAN A L'INSTANT N
+! =================================
+
+! --> Bilan sur les volumes internes
+! ------------------------------
+
+! La masse volumique ROM est celle qui a ete calculee en debut de
+! pas de temps a partir de la temperature au pas de temps
+! precedent (dans usphyv ou, si elle est constante RO0)
+
+
+if(ipccp.gt.0) then
+ do iel = 1, ncel
+ xrtpa = rtpa(iel,ivar)
+ xrtp = rtp (iel,ivar)
+ xbilvl = xbilvl &
+ + volume(iel) * propce(iel,ipccp) * propce(iel,ipcrom) &
+ * ( xrtpa - xrtp )
+ enddo
+else
+ do iel = 1, ncel
+ xrtpa = rtpa(iel,ivar)
+ xrtp = rtp (iel,ivar)
+ xbilvl = xbilvl &
+ + volume(iel) * cp0iph * propce(iel,ipcrom) &
+ * ( xrtpa - xrtp )
+ enddo
+endif
+
+
+! --> Bilan sur toutes les faces, internes et de bord, pour prendre
+! en compte le terme en div(rho u)-----------------------------
+! --------------------------------
+
+! Attention, on fait intervenir les valeurs de Cp et de Dt dans
+! les cellules voisines des faces internes, ce qui necessite d'avoir
+! pris ses precautions en periodicite et parallelisme.
+
+! --- Si Cp est variable
+! Noter que si Cp est variable, ecrire ici un bilan sur l'equation
+! de la temerature n'est pas absolument correct
+
+if(ipccp.gt.0) then
+ do ifac = 1, nfac
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+ xbildv = xbildv + propfa(ifac,iflmas) &
+ *(dt(iel1)*propce(iel1,ipccp)*rtp(iel1,ivar) &
+ -dt(iel2)*propce(iel2,ipccp)*rtp(iel2,ivar))
+ enddo
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ xbildv = xbildv + dt(iel) &
+ * propce(iel,ipccp) &
+ * propfb(ifac,iflmab) &
+ * rtp(iel,ivar)
+ enddo
+
+! --- Si Cp est constant
+
+else
+ do ifac = 1, nfac
+ iel1 = ifacel(1,ifac)
+ iel2 = ifacel(2,ifac)
+ xbildv = xbildv + (dt(iel1)+ dt(iel2))*0.5d0 &
+ * cp0iph &
+ * propfa(ifac,iflmas) &
+ * (rtp(iel1,ivar) - rtp(iel2,ivar))
+ enddo
+
+ do ifac = 1, nfabor
+ iel = ifabor(ifac)
+ xbildv = xbildv + dt(iel) &
+ * cp0iph &
+ * propfb(ifac,iflmab) &
+ * rtp(iel,ivar)
+ enddo
+endif
+
+! En cas de terme source de masse, on ajoute la contribution en Gamma*Tn+1
+
+ncesmp=ncetsm(iphas)
+if (ncesmp.gt.0) then
+ icesmp = iicesm(iphas)
+ ismacp = ismace(iphas)
+ itpsmp = iitpsm(iphas)
+ do ieltsm = 1, ncesmp
+ iel = ia(icesmp+ieltsm-1)
+ xrtp = rtp (iel,ivar)
+ xgamma = ra( ismacp+ieltsm+ncesmp*(ipr(iphas)-1)-1)
+ if(ipccp.gt.0) then
+ xbildv = xbildv &
+ - volume(iel) * propce(iel,ipccp) * dt(iel) &
+ * xgamma * xrtp
+ else
+ xbildv = xbildv &
+ - volume(iel) * cp0iph * dt(iel) &
+ * xgamma * xrtp
+ endif
+ enddo
+endif
+
+
+
+! --> Bilan sur les faces de bord
+! ---------------------------
+
+! On distingue ici les differents types de faces de bord
+! pour mieux analyser l'information, mais ce n'est pas oblige.
+
+
+! - Calcul de la contribution des parois de couleur 2, 4, 7
+! (ici adiabatiques, donc flux nul a priori)
+
+CALL GETFBR('2 or 4 or 7',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! --- Element de bord
+
+ iel = ifabor(ifac)
+
+! --- Variables geometriques
+
+ surfbn = ra(isrfbn-1+ifac)
+ distbr = ra(idistb-1+ifac)
+
+! --- Variables physiques
+
+ visct = propce(iel,ipcvst)
+ flumab = propfb(ifac,iflmab)
+
+ if(ipccp.gt.0) then
+ xcp = propce(iel,ipccp)
+ else
+ xcp = cp0iph
+ endif
+
+ if(ipcvsl.gt.0) then
+ xvsl = propce(iel,ipcvsl)
+ else
+ xvsl = visls0(iscal)
+ endif
+
+! --- Calcul de la contribution au flux sur la facette courante
+! (flux de diffusion et de convection, negatif si entrant)
+
+ xfluxf = surfbn * dt(iel) * xcp * &
+ (xvsl+visct/sigmas(iscal))/distbr * &
+ (coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0) &
+ *ra(itreco+ifac-1))&
+ - flumab * dt(iel) * xcp * &
+ (coefa(ifac,iclvar)+ coefb(ifac,iclvar) &
+ *ra(itreco+ifac-1))
+
+ xbilpa = xbilpa + xfluxf
+
+enddo
+
+
+! - Calcul de la contribution des parois de couleur 6
+! (ici a temperature imposee ;
+! le flux convectif est nul a priori)
+
+CALL GETFBR('6',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! --- Element de bord
+
+ iel = ifabor(ifac)
+
+! --- Variables geometriques
+
+ surfbn = ra(isrfbn-1+ifac)
+ distbr = ra(idistb-1+ifac)
+
+! --- Variables physiques
+
+ visct = propce(iel,ipcvst)
+ flumab = propfb(ifac,iflmab)
+
+ if(ipccp.gt.0) then
+ xcp = propce(iel,ipccp)
+ else
+ xcp = cp0iph
+ endif
+
+ if(ipcvsl.gt.0) then
+ xvsl = propce(iel,ipcvsl)
+ else
+ xvsl = visls0(iscal)
+ endif
+
+! --- Calcul de la contribution au flux sur la facette courante
+! (flux de diffusion et de convection, negatif si entrant)
+
+ xfluxf = surfbn * dt(iel) * xcp * &
+ (xvsl+visct/sigmas(iscal))/distbr * &
+ (coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0) &
+ *ra(itreco+ifac-1))&
+ - flumab * dt(iel) * xcp * &
+ (coefa(ifac,iclvar)+ coefb(ifac,iclvar) &
+ *ra(itreco+ifac-1))
+
+ xbilpt = xbilpt + xfluxf
+
+enddo
+
+
+! - Calcul de la contribution des symetries (couleur 1)
+! (a priori nul).
+
+CALL GETFBR('1',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! --- Element de bord
+
+ iel = ifabor(ifac)
+
+! --- Variables geometriques
+
+ surfbn = ra(isrfbn-1+ifac)
+ distbr = ra(idistb-1+ifac)
+
+! --- Variables physiques
+
+ visct = propce(iel,ipcvst)
+ flumab = propfb(ifac,iflmab)
+
+ if(ipccp.gt.0) then
+ xcp = propce(iel,ipccp)
+ else
+ xcp = cp0iph
+ endif
+
+ if(ipcvsl.gt.0) then
+ xvsl = propce(iel,ipcvsl)
+ else
+ xvsl = visls0(iscal)
+ endif
+
+! --- Calcul de la contribution au flux sur la facette courante
+! (flux de diffusion et de convection, negatif si entrant)
+
+ xfluxf = surfbn * dt(iel) * xcp * &
+ (xvsl+visct/sigmas(iscal))/distbr * &
+ (coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0) &
+ *ra(itreco+ifac-1))&
+ - flumab * dt(iel) * xcp * &
+ (coefa(ifac,iclvar)+ coefb(ifac,iclvar) &
+ *ra(itreco+ifac-1))
+
+ xbilsy = xbilsy + xfluxf
+
+enddo
+
+
+! - Calcul de la contribution en entree (couleur 3)
+! (flux de diffusion et de convection)
+
+CALL GETFBR('3',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! --- Element de bord
+
+ iel = ifabor(ifac)
+
+! --- Variables geometriques
+
+ surfbn = ra(isrfbn-1+ifac)
+ distbr = ra(idistb-1+ifac)
+
+! --- Variables physiques
+
+ visct = propce(iel,ipcvst)
+ flumab = propfb(ifac,iflmab)
+
+ if(ipccp.gt.0) then
+ xcp = propce(iel,ipccp)
+ else
+ xcp = cp0iph
+ endif
+
+ if(ipcvsl.gt.0) then
+ xvsl = propce(iel,ipcvsl)
+ else
+ xvsl = visls0(iscal)
+ endif
+
+! --- Calcul de la contribution au flux sur la facette courante
+! (flux de diffusion et de convection, negatif si entrant)
+
+ xfluxf = surfbn * dt(iel) * xcp * &
+ (xvsl+visct/sigmas(iscal))/distbr * &
+ (coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0) &
+ *ra(itreco+ifac-1))&
+ - flumab * dt(iel) * xcp * &
+ (coefa(ifac,iclvar)+ coefb(ifac,iclvar) &
+ *ra(itreco+ifac-1))
+
+ xbilen = xbilen + xfluxf
+
+enddo
+
+! - Calcul de la contribution en sortie (couleur 5)
+! (flux de diffusion et de convection)
+
+CALL GETFBR('5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! --- Element de bord
+
+ iel = ifabor(ifac)
+
+! --- Variables geometriques
+
+ surfbn = ra(isrfbn-1+ifac)
+ distbr = ra(idistb-1+ifac)
+
+! --- Variables physiques
+
+ visct = propce(iel,ipcvst)
+ flumab = propfb(ifac,iflmab)
+
+ if(ipccp.gt.0) then
+ xcp = propce(iel,ipccp)
+ else
+ xcp = cp0iph
+ endif
+
+ if(ipcvsl.gt.0) then
+ xvsl = propce(iel,ipcvsl)
+ else
+ xvsl = visls0(iscal)
+ endif
+
+! --- Calcul de la contribution au flux sur la facette courante
+! (flux de diffusion et de convection, negatif si entrant)
+
+ xfluxf = surfbn * dt(iel) * xcp * &
+ (xvsl+visct/sigmas(iscal))/distbr * &
+ (coefa(ifac,iclvar)+(coefb(ifac,iclvar)-1.d0) &
+ *ra(itreco+ifac-1))&
+ - flumab * dt(iel) * xcp * &
+ (coefa(ifac,iclvar)+ coefb(ifac,iclvar) &
+ *ra(itreco+ifac-1))
+
+ xbilso = xbilso + xfluxf
+
+enddo
+
+
+! --> Bilan sur les termes sources de masse
+! -------------------------------------
+! On va s�parer les injections de masse des aspirations
+! pour plus de generalite
+
+ncesmp=ncetsm(iphas)
+if (ncesmp.gt.0) then
+ icesmp = iicesm(iphas)
+ ismacp = ismace(iphas)
+ itpsmp = iitpsm(iphas)
+ do ieltsm = 1, ncesmp
+! suivant le type d'injection, on utilise la valeur SMACEL ou la valeur ambiante
+! de la temp�rature
+ iel = ia(icesmp+ieltsm-1)
+ xgamma = ra( ismacp+ieltsm+ncesmp*(ipr(iphas)-1)-1)
+ if ( ia( itpsmp+ieltsm+ncesmp*(ivar-1)-1).eq.0 &
+ .or. xgamma.lt.0.d0 ) then
+ xrtp = rtp (iel,ivar)
+ else
+ xrtp = ra( ismacp+ieltsm+ncesmp*(ivar-1)-1)
+ endif
+ if(ipccp.gt.0) then
+ if (xgamma.lt.0.d0) then
+ xbilma = xbilma &
+ + volume(iel) * propce(iel,ipccp) * dt(iel) &
+ * xgamma * xrtp
+ else
+ xbilmi = xbilmi &
+ + volume(iel) * propce(iel,ipccp) * dt(iel) &
+ * xgamma * xrtp
+ endif
+ else
+ if (xgamma.lt.0.d0) then
+ xbilma = xbilma &
+ + volume(iel) * cp0iph * dt(iel) &
+ * xgamma * xrtp
+ else
+ xbilmi = xbilmi &
+ + volume(iel) * cp0iph * dt(iel) &
+ * xgamma * xrtp
+ endif
+ endif
+ enddo
+endif
+
+
+! - Somme des grandeurs sur tous les processeurs (calculs paralleles)
+
+if (irangp.ge.0) then
+ call parsom (xbilvl)
+ call parsom (xbildv)
+ call parsom (xbilpa)
+ call parsom (xbilpt)
+ call parsom (xbilsy)
+ call parsom (xbilen)
+ call parsom (xbilso)
+ call parsom (xbilmi)
+ call parsom (xbilma)
+endif
+
+
+
+
+! --> Bilan total
+! -----------
+
+! On ajoute les differentes contributions calculees plus haut.
+
+xbilan = xbilvl + xbildv + xbilpa + xbilpt + xbilsy + xbilen &
+ + xbilso+ xbilmi + xbilma
+
+
+
+
+! 2.3 ECRITURE DU BILAN A L'INSTANT N
+! ===================================
+
+write(nfecra,2000) &
+ ntcabs, xbilvl, xbildv, xbilpa, xbilpt, xbilsy, xbilen, xbilso, &
+ xbilmi, xbilma, xbilan
+
+
+ 2000 format(/, &
+ 3X,'** BILAN THERMIQUE **',/, &
+ 3X,' ---------------',/, &
+ '---','------', &
+ '------------------------------------------------------------',/,&
+ 'bt ',' ITER', &
+ ' Volumique Divergence Paroi Adia Paroi Timp Symetrie', &
+ ' Entree Sortie Masse inj. Masse asp. Bil. total',/,&
+ 'bt ',I6,10E12.4,/, &
+ '---','------', &
+ '------------------------------------------------------------')
+
+!- Fin du test sur INPDT0
+endif
+
+!===============================================================================
+! 3. EXEMPLE : CALCUL DES EFFORTS GLOBAUX SUR UN SOUS-ENSEMBLE DE FACES
+
+! A FAIRE AVEC PRECAUTIONS ...
+! L'UTILISATEUR PREND SES RESPONSABILITES.
+!===============================================================================
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+! Si les efforts ont bien ete calcules :
+if (ineedf.eq.1) then
+
+ do ii = 1, ndim
+ xfor(ii) = 0.d0
+ enddo
+
+ CALL GETFBR('2 or 3',NLELT,LSTELT)
+ !==========
+
+ do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ do ii = 1, ndim
+ xfor(ii) = xfor(ii) + ra(iforbr + (ifac-1)*ndim + ii-1)
+ enddo
+
+ enddo
+
+ if (irangp.ge.0) then
+ call parrsm(ndim,xfor)
+ endif
+
+endif
+
+!===============================================================================
+! 4. EXEMPLE : MISE A 20 DE LA TEMPERATURE DANS UNE ZONE DONNEE
+! A PARTIR DU TEMPS 12s
+
+! A FAIRE AVEC PRECAUTIONS ...
+! L'UTILISATEUR PREND SES RESPONSABILITES.
+!===============================================================================
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+
+iphas = 1
+iscal = iscalt(iphas)
+
+if (ttcabs.ge.12.d0) then
+
+ if (iscal.gt.0.and.iscal.le.nscal) then
+ do iel = 1, ncel
+ rtp(iel,isca(iscal)) = 20.d0
+ enddo
+ endif
+
+ write(nfecra,3000)
+
+endif
+
+ 3000 format(/, &
+ ' MODIFICATION UTILISATEUR DES VARIABLES EN FIN DE PAS DE TEMPS',&
+ /)
+
+!===============================================================================
+! 5. EXEMPLE : EXTRACTION D'UN PROFIL 1D
+! -----------------------------------
+
+! On cherche ici a extraire le profil de U, V, W, k et eps sur une
+! courbe 1D quelconque en fonction de l'abscisse curviligne.
+! Le profil est ecrit dans le fichier "profil.dat" (ne pas oublier de
+! prevoir son rapatriement par le script de lancement).
+
+! - la courbe utilisee ici est le segment [(0;0;0),(0;0.1;0)], mais la
+! generalisation a une courbe quelconque est simple.
+! - la routine est adaptee au parallelisme et a la periodicite, ainsi
+! qu'au differents modeles de turbulence.
+! - la courbe 1D est discretisee en NPOINT points. Pour chacun de ces
+! points, on calcule le centre de cellule le plus proche et on
+! imprime la valeur des variables au centre de cette cellule. Pour plus
+! de coherence, l'ordonnee imprimee est celle du centre de la cellule.
+! - on evite d'imprimer deux fois la meme cellule (si plusieurs points de
+! la courbe sont associes a la meme cellule).
+!===============================================================================
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+
+if (ntcabs.eq.ntmabs) then
+
+! Seul le processeur de rang 0 (parallele) ou -1 (scalaire) ecrit dans le
+! fichier. On utilise les unites "utilisateur".
+ impout = impusr(1)
+ if (irangp.le.0) then
+ open(impout,file="profil.dat")
+ write(impout,*) &
+ '# z(m) U(m/s) V(m/s) W(m/s) k(m2/s2) eps(m2/s3)'
+ endif
+
+ iphas = 1
+ npoint = 200
+ iel1 = -999
+ irang1 = -999
+ do ii = 1, npoint
+
+ xyz(1) = 0.d0
+ xyz(2) = float(ii-1)/float(npoint-1)*0.1d0
+ xyz(3) = 0.d0
+
+ call findpt &
+ !==========
+ (ncelet, ncel, xyzcen, &
+ xyz(1), xyz(2), xyz(3), iel, irangv)
+
+ if ((iel.ne.iel1).or.(irangv.ne.irang1)) then
+ iel1 = iel
+ irang1 = irangv
+
+! On remplit les variables temporaires XU, XV, ... pour le processeur
+! qui contient le point et on envoie ensuite l'info aux autres
+! processeurs.
+ if (irangp.eq.irangv) then
+ xabs = xyzcen(2,iel)
+ xu = rtp(iel,iu(iphas))
+ xv = rtp(iel,iv(iphas))
+ xw = rtp(iel,iw(iphas))
+ xk = 0.d0
+ xeps = 0.d0
+ if (itytur(iphas).eq.2 .or. iturb(iphas).eq.50 &
+ .or. iturb(iphas).eq.60) then
+ xk = rtp(iel,ik(iphas))
+ elseif (itytur(iphas).eq.3) then
+ xk = ( rtp(iel,ir11(iphas))+rtp(iel,ir22(iphas))+ &
+ rtp(iel,ir33(iphas)) )/2.d0
+ endif
+ if (itytur(iphas).eq.2 .or. itytur(iphas).eq.3 &
+ .or. iturb(iphas).eq.50) then
+ xeps = rtp(iel,iep(iphas))
+ elseif (iturb(iphas).eq.60) then
+ xeps = cmu*rtp(iel,ik(iphas))*rtp(iel,iomg(iphas))
+ endif
+ else
+ xabs = 0.d0
+ xu = 0.d0
+ xv = 0.d0
+ xw = 0.d0
+ xk = 0.d0
+ xeps = 0.d0
+ endif
+
+! Envoi aux autres processeurs si parallele
+ if (irangp.ge.0) then
+ iun = 1
+ call parbcr(irangv,iun,xabs)
+ call parbcr(irangv,iun,xu )
+ call parbcr(irangv,iun,xv )
+ call parbcr(irangv,iun,xw )
+ call parbcr(irangv,iun,xk )
+ call parbcr(irangv,iun,xeps)
+ endif
+
+ if (irangp.le.0) &
+ write(impout,99) xabs,xu,xv,xw,xk,xeps
+
+ 99 format(6g17.9)
+
+ endif
+
+ enddo
+
+ if (irangp.le.0) close(impout)
+
+endif
+
+
+!===============================================================================
+! 6. EXEMPLE : IMPRESSION DU PREMIER MOMENT CALCULE
+!===============================================================================
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+
+if(nbmomt.gt.0) then
+
+! Numero du moment : IMOM
+ imom = 1
+
+! Position dans PROPCE du tableau de cumul temporel des moments
+! PROPCE(IEL,IPCMOM)
+ ipcmom = ipproc(icmome(imom))
+
+! Le cumul temporel des moments doit etre divise par la variable
+! de cumul du temps qui est un tableau NCEL ou un reel :
+! un tableau NCEL si IDTMOM(IMOM) > 0 : PROPCE(IEL,IDTCM)
+! ou un simple reel si IDTMOM(IMOM) < 0 : DTCMOM(IDTCM)
+
+ if(idtmom(imom).gt.0) then
+ idtcm = ipproc(icdtmo(idtmom(imom)))
+ do iel = 1, ncel
+ write(nfecra,4000) iel,propce(iel,ipcmom)/ &
+ max(propce(iel,idtcm),epzero)
+ enddo
+ elseif(idtmom(imom).lt.0) then
+ idtcm = -idtmom(imom)
+ do iel = 1, ncel
+ write(nfecra,4000) iel,propce(iel,ipcmom)/ &
+ max(dtcmom(idtcm),epzero)
+ enddo
+ endif
+
+endif
+
+ 4000 format(' Cellule ',I10,' Premier moment ',E14.5)
+
+
+!===============================================================================
+! 7. EXEMPLE : UTILISATION DES ROUTINES DE CALCUL PARALLELE
+! POUR LES OPERATIONS SUIVANTES~:
+!===============================================================================
+
+! Cet exemple n'a pas d'autre utilite que de fournir la liste des
+! routines utilisables pour simplifier certaines operations
+! globales en parallele.
+
+! ATTENTION, ces routines modifient leur argument
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+
+! Maximum d'un compteur entier II, ici le nombre de cellules par processeur
+
+! Valeur locale
+ii = ncel
+! Calcul du maximum sur les processeurs
+if (irangp.ge.0) then
+ call parcmx(ii)
+endif
+! Ecriture de la valeur maximale renvoyee
+write(nfecra,5010)ii
+ 5010 format(' USPROJ: Nombre de cellules max par processeur = ', I10)
+
+
+! Somme d'un compteur entier II, ici le nombre de cellules
+
+! Valeur locale
+ii = ncel
+! Calcul de la somme sur les processeurs
+if (irangp.ge.0) then
+ call parcpt(ii)
+endif
+! Ecriture de la valeur somme renvoyee
+write(nfecra,5020)ii
+ 5020 format(' USPROJ: Nombre de cellules total = ', I10)
+
+! Somme d'un reel RRR, ici le volume
+
+! Valeur locale
+rrr = 0.d0
+do iel = 1, ncel
+ rrr = rrr + volume(iel)
+enddo
+! Calcul de la somme sur les processeurs
+if (irangp.ge.0) then
+ call parsom(rrr)
+endif
+! Ecriture de la valeur somme renvoyee
+write(nfecra,5030)rrr
+ 5030 format(' USPROJ: Volume du domaine total = ', E14.5)
+
+! Maximum d'un reel RRR, ici le volume par processeur
+
+! Valeur locale
+rrr = 0.d0
+do iel = 1, ncel
+ rrr = rrr + volume(iel)
+enddo
+! Calcul du maximum sur les processeurs
+if (irangp.ge.0) then
+ call parmax(rrr)
+endif
+! Ecriture de la valeur maximale renvoyee
+write(nfecra,5040)rrr
+ 5040 format(' USPROJ: Volume max par processeur = ', E14.5)
+
+! Minimum d'un reel RRR, ici le volume par processeur
+
+! Valeur locale
+rrr = 0.d0
+do iel = 1, ncel
+ rrr = rrr + volume(iel)
+enddo
+! Calcul du minimum sur les processeurs
+if (irangp.ge.0) then
+ call parmin(rrr)
+endif
+! Ecriture de la valeur minimale renvoyee
+write(nfecra,5050)rrr
+ 5050 format(' USPROJ: Volume min par processeur = ', E14.5)
+
+! Maximum d'un r�el et valeurs reelles associ�es
+! ici le volume et sa localisation
+
+! Maximum local et sa localisation (NBR=3 coordonnees)
+nbr = 3
+rrr = -1.d0
+xyz(1) = 0.d0
+xyz(2) = 0.d0
+xyz(3) = 0.d0
+do iel = 1, ncel
+ if (rrr.lt.volume(iel)) then
+ rrr = volume(iel)
+ xyz(1) = xyzcen(1,iel)
+ xyz(2) = xyzcen(2,iel)
+ xyz(3) = xyzcen(3,iel)
+ endif
+enddo
+! Calcul du maximum et localisation sur les processeurs
+if (irangp.ge.0) then
+ call parmxl(nbr,rrr,xyz)
+endif
+! Ecriture de la valeur maximale et localisation renvoyees
+write(nfecra,5060)rrr,xyz(1),xyz(2),xyz(3)
+ 5060 format(' USPROJ: Volume max = ', E14.5,/, &
+ ' Localisation x,y,z = ',3E14.5)
+
+! Minimum d'un r�el et valeurs reelles associ�es
+! ici le volume et sa localisation
+
+! Minimum local et sa localisation (NBR=3 coordonnees)
+nbr = 3
+rrr = 1.d+30
+xyz(1) = 0.d0
+xyz(2) = 0.d0
+xyz(3) = 0.d0
+do iel = 1, ncel
+ if (rrr.gt.volume(iel)) then
+ rrr = volume(iel)
+ xyz(1) = xyzcen(1,iel)
+ xyz(2) = xyzcen(2,iel)
+ xyz(3) = xyzcen(3,iel)
+ endif
+enddo
+! Calcul du minimum et localisation sur les processeurs
+if (irangp.ge.0) then
+ call parmnl(nbr,rrr,xyz)
+endif
+! Ecriture de la valeur minimale et localisation renvoyees
+write(nfecra,5070)rrr,xyz(1),xyz(2),xyz(3)
+ 5070 format(' USPROJ: Volume min = ', E14.5,/, &
+ ' Localisation x,y,z = ',3E14.5)
+
+! Somme d'un tableau d'entiers ici le nombre
+! de cellules, de faces et de faces de bord
+
+! Valeurs locales
+nbr = 3
+itab(1) = ncel
+itab(2) = nfac
+itab(3) = nfabor
+! Calcul de la somme sur les processeurs
+if (irangp.ge.0) then
+ call parism(nbr,itab)
+endif
+! Ecriture de la valeur somme renvoyee
+write(nfecra,5080)itab(1),itab(2),itab(3)
+ 5080 format(' USPROJ: Nombre de cellules = ',I10,/, &
+ ' Nombre de faces internes = ',I10,/, &
+ ' Nombre de faces de bord = ',I10)
+
+! Maximum d'un tableau d'entiers ici le nombre
+! de cellules, de faces et de faces de bord
+
+! Valeurs locales
+nbr = 3
+itab(1) = ncel
+itab(2) = nfac
+itab(3) = nfabor
+! Calcul du maximum sur les processeurs
+if (irangp.ge.0) then
+ call parimx(nbr,itab)
+endif
+! Ecriture de la valeur maximale renvoyee
+write(nfecra,5090)itab(1),itab(2),itab(3)
+ 5090 format(' USPROJ: Nombre de cellules max par proc = ',I10,/, &
+ ' Nombre de faces internes max par proc = ',I10,/, &
+ ' Nombre de faces de bord max par proc = ',I10)
+
+! Minimum d'un tableau d'entiers ici le nombre
+! de cellules, et de faces de bord
+! attention, une somme similaire pour compter les faces internes
+! compte 2 fois les faces internes situes sur les bords des
+! processeurs
+
+! Valeurs locales
+nbr = 2
+itab(1) = ncel
+itab(2) = nfabor
+! Calcul du minimum sur les processeurs
+if (irangp.ge.0) then
+ call parimn(nbr,itab)
+endif
+! Ecriture de la valeur minimale renvoyee
+write(nfecra,5100)itab(1),itab(2)
+ 5100 format(' USPROJ: Nombre de cellules min par proc = ',I10,/, &
+ ' Nombre de faces de bord min par proc = ',I10)
+
+! Somme d'un tableau de reels ici les trois composantes de la vitesse
+! (dans le but de faire une moyenne ensuite par exemple)
+
+! Valeurs locales
+nbr = 3
+xyz(1) = 0.d0
+xyz(2) = 0.d0
+xyz(3) = 0.d0
+do iel = 1, ncel
+ xyz(1) = xyz(1)+rtp(iel,iu(1))
+ xyz(2) = xyz(2)+rtp(iel,iv(1))
+ xyz(3) = xyz(3)+rtp(iel,iw(1))
+enddo
+! Calcul de la somme sur les processeurs
+if (irangp.ge.0) then
+ call parrsm(nbr,xyz)
+endif
+! Ecriture de la valeur somme renvoyee
+write(nfecra,5110)xyz(1),xyz(2),xyz(3)
+ 5110 format(' USPROJ: Somme de U sur le domaine = ',E14.5,/, &
+ ' Somme de V sur le domaine = ',E14.5,/, &
+ ' Somme de W sur le domaine = ',E14.5)
+
+! Maximum d'un tableau de reels ici les trois composantes de la vitesse
+
+! Valeurs locales
+nbr = 3
+xyz(1) = rtp(1,iu(1))
+xyz(2) = rtp(1,iv(1))
+xyz(3) = rtp(1,iw(1))
+do iel = 1, ncel
+ xyz(1) = max(xyz(1),rtp(iel,iu(1)))
+ xyz(2) = max(xyz(2),rtp(iel,iv(1)))
+ xyz(3) = max(xyz(3),rtp(iel,iw(1)))
+enddo
+! Calcul du maximum sur les processeurs
+if (irangp.ge.0) then
+ call parrmx(nbr,xyz)
+endif
+! Ecriture de la valeur somme renvoyee
+write(nfecra,5120)xyz(1),xyz(2),xyz(3)
+ 5120 format(' USPROJ: Maximum de U sur le domaine = ',E14.5,/, &
+ ' Maximum de V sur le domaine = ',E14.5,/, &
+ ' Maximum de W sur le domaine = ',E14.5)
+
+! Minimum d'un tableau de reels ici les trois composantes de la vitesse
+
+! Valeurs locales
+nbr = 3
+xyz(1) = rtp(1,iu(1))
+xyz(2) = rtp(1,iv(1))
+xyz(3) = rtp(1,iw(1))
+do iel = 1, ncel
+ xyz(1) = min(xyz(1),rtp(iel,iu(1)))
+ xyz(2) = min(xyz(2),rtp(iel,iv(1)))
+ xyz(3) = min(xyz(3),rtp(iel,iw(1)))
+enddo
+! Calcul du minimum sur les processeurs
+if (irangp.ge.0) then
+ call parrmn(nbr,xyz)
+endif
+! Ecriture de la valeur somme renvoyee
+write(nfecra,5130)xyz(1),xyz(2),xyz(3)
+ 5130 format(' USPROJ: Minimum de U sur le domaine = ',E14.5,/, &
+ ' Minimum de V sur le domaine = ',E14.5,/, &
+ ' Minimum de W sur le domaine = ',E14.5)
+
+! Envoi d'un tableau de valeurs entieres locales aux autres processeurs
+! par exemple le nombre de cellules, de faces internes et de faces
+! de bord du processeur numero IRANGV=0.
+
+! Valeurs locales
+irangv = 0
+nbr = 3
+itab(1) = ncel
+itab(2) = nfac
+itab(3) = nfabor
+! Envoi aux autres
+if (irangp.ge.0) then
+ call parbci(irangv,nbr,itab)
+endif
+! Ecriture par chaque processeur de la valeur envoyee par le proc 0
+write(nfecra,5140)irangv,itab(1),itab(2),itab(3)
+ 5140 format(' USPROJ: Sur le processeur ', I10 ,/, &
+ ' Nombre de cellules = ',I10,/, &
+ ' Nombre de faces internes = ',I10,/, &
+ ' Nombre de faces de bord = ',I10)
+
+! Envoi d'un tableau de valeurs reelles locales aux autres processeurs
+! par exemple trois valeurs de la vitesse
+! du processeur numero IRANGV=0.
+
+! Valeurs locales
+irangv = 0
+nbr = 3
+xyz(1) = rtp(1,iu(1))
+xyz(2) = rtp(1,iv(1))
+xyz(3) = rtp(1,iw(1))
+! Envoi aux autres
+if (irangp.ge.0) then
+ call parbcr(irangv,nbr,xyz)
+endif
+! Ecriture par chaque processeur de la valeur envoyee par le proc 0
+write(nfecra,5150)irangv,xyz(1),xyz(2),xyz(3)
+ 5150 format(' USPROJ: Sur le processeur ', I10 ,/, &
+ ' Vitesse U dans la premiere cellule = ',E14.5,/, &
+ ' Vitesse V dans la premiere cellule = ',E14.5,/, &
+ ' Vitesse W dans la premiere cellule = ',E14.5)
+
+! Recuperation par tous les processeurs du numero global d'une cellule
+! appartenant a un processeur donne (exemple de la cellule IEL
+! du processeur IRANGV)
+iel = 1
+irangv = 0
+if (irangp.ge.0) then
+ call parcel(iel,irangv,ielg)
+else
+ ielg = -1
+endif
+! Ecriture par chaque processeur du numero global de la cellule IEL
+! du processeur IRANGV
+write(nfecra,5160)iel,irangv,ielg
+ 5160 format(' USPROJ: La cellule de numero local IEL = ',I10,/, &
+ ' sur le processeur IRANGV = ',I10,/, &
+ ' a pour numero global IELG = ',I10)
+
+! Recuperation par le processeur courant du numero global d'une cellule
+! IEL lui appartenant (exemple avec IEL=1, tous les processeurs ayant
+! au moins une cellule)
+iel = 1
+call parclg(iel,irangp,ielg)
+! Ecriture par chaque processeur du numero global de sa cellule IEL
+! (si le processeur a moins de IEL cellules, affiche 0)
+! (en sequentiel, affiche IEL)
+write(nfecra,5170)iel,irangp,ielg
+ 5170 format(' USPROJ: La cellule de numero local IEL = ',I10,/, &
+ ' sur le processeur IRANGP = ',I10,/, &
+ ' a pour numero global IELG = ',I10)
+
+! Recuperation par le processeur courant du numero global d'une face
+! interne IFAC lui appartenant (exemple avec IFAC=1)
+ifac = 1
+call parfig(ifac,irangp,ifacg)
+! Ecriture par chaque processeur du numero global de sa face IFAC
+! (si le processeur a moins de IFAC faces internes, affiche 0)
+! (en sequentiel, affiche IFAC)
+write(nfecra,5180)ifac,irangp,ifacg
+ 5180 format(' USPROJ: La face interne de numero local IFAC = ',I10,/, &
+ ' sur le processeur IRANGP = ',I10,/, &
+ ' a pour numero global IFACG = ',I10)
+
+! Recuperation par le processeur courant du numero global d'une face
+! de bord IFAC lui appartenant (exemple avec IFAC=1)
+ifac = 1
+call parfbg(ifac,irangp,ifacg)
+! Ecriture par chaque processeur du numero global de sa face IFAC
+! (si le processeur a moins de IFAC faces de bord , affiche 0)
+! (en sequentiel, affiche IFAC)
+write(nfecra,5190)ifac,irangp,ifacg
+ 5190 format(' USPROJ: La face de bord de numero local IFAC = ',I10,/, &
+ ' sur le processeur IRANGP = ',I10,/, &
+ ' a pour numero global IFACG = ',I10)
+
+return
+end
diff --git a/users/base/uspt1d.f90 b/users/base/uspt1d.f90
new file mode 100644
index 0000000..019599a
--- /dev/null
+++ b/users/base/uspt1d.f90
@@ -0,0 +1,333 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine uspt1d &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nfpt1d , iphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ ifpt1d , nppt1d , iclt1d , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , &
+ xyznod , volume , &
+ tppt1d , rgpt1d , eppt1d , &
+ tept1d , hept1d , fept1d , &
+ xlmt1d , rcpt1d , dtpt1d , &
+ dt , rtpa , &
+ propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ENTREE DES DONNEES DU MODULE THERMIQUE EN 1D PAROI
+
+! IAPPEL = 1 (un seul appel a l'initialisation) :
+! CALCUL DU NOMBRE DE CELLULES OU L'ON IMPOSE UNE PAROI
+
+! IAPPEL = 2 (un seul appel a l'initialisation) :
+! REPERAGE DES CELLULES OU L'ON IMPOSE UNE PAROI
+! DONNEES RELATIVE AU MAILLAGE
+
+! IAPPEL = 3 (appel a chaque pas de temps) :
+! VALEUR DES COEFFICIENTS PHYSIQUE DU CALCUL
+! TYPE DE CONDITION LIMITE EN PAROI EXTERIEURE
+! ICLT1D = 1 -> TEMPERATURE
+! ICLT1D = 3 -> FLUX
+! INITIALISATION DE LA TEMPERATURE
+
+
+! IDENTIFICATION DES FACES DE BORD
+! ================================
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nfpt1d ! e ! <-- ! nombre de faces avec module therm 1d !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ifpt1d ! te ! <-- ! numero de la face en traitement !
+! ! ! ! thermique en paroi !
+! nppt1d ! te ! <-- ! nombre de points de discretisation !
+! ! ! ! dans la paroi !
+! iclt1d ! te ! <-- ! type de condition limite !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! eppt1d ! tr ! <-- ! epaisseur de la paroi !
+! rgpt1d ! tr ! <-- ! raison du maillage !
+! tppt1d ! tr ! <-- ! temperature de paroi !
+! tept1d ! tr ! <-- ! temperature exterieure !
+! hept1d ! tr ! <-- ! coefficient d'echange exterieur !
+! fept1d ! tr ! <-- ! flux exterieur !
+! xlmt1d ! tr ! <-- ! conductivite thermique de la paroi !
+! rcpt1d ! tr ! <-- ! rocp de la paroi !
+! dtpt1d ! tr ! <-- ! pas de temps de la paroi !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nfpt1d
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , iappel
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer ifpt1d(nfpt1d), nppt1d(nfpt1d), iclt1d(nfpt1d)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision eppt1d(nfpt1d) , rgpt1d(nfpt1d) , tppt1d(nfpt1d)
+double precision tept1d(nfpt1d) , hept1d(nfpt1d) , fept1d(nfpt1d)
+double precision xlmt1d(nfpt1d) , rcpt1d(nfpt1d) , dtpt1d(nfpt1d)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! Variables locales
+
+integer idebia , idebra
+integer ifbt1d , ii , ifac
+integer ilelt, nlelt
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+! --- Relecture d'un fichier suite :
+! ISUIT1 = 0 ------> pas de relecture (reinitialisation du maillage et
+! de la temperature dans la paroi)
+! ISUIT1 = 1 ------> relecture du fichier suite de module thermique 1D
+! ISUIT1 = ISUITE -> relecture si le calcul fluide est une suite
+! L'initialisation de ISUIT1 dans uspt1d est obligatoire.
+
+isuit1 = isuite
+
+ifbt1d = 0
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+if(iappel.eq.1.or.iappel.eq.2) then
+
+
+! --- Determination des faces avec module thermique 1D
+! NFPT1D : nb total de faces avec module thermique 1D
+! IFPT1D(II) : numero de la IIeme face avec module thermque 1D
+
+! Remarque : lors de la relecture d'un fichier suite, NFPT1D et IFPT1D
+! sont compares aux valeurs issues du fichier suite. Une
+! concordance totale est necessaire pour continuer le calcul.
+! En ce qui concerne le test sur IFPT1D, il necessite qui
+! le tableau soit range dans un ordre croissant
+! ( IFPT1D(JJ) > IFPT1D(II) si JJ > II ).
+! Si ce n'est pas possible, contacter l'equipe de developpement
+! pour desactiver le test.
+
+ CALL GETFBR('3',NLELT,LSTELT)
+ !==========
+
+ do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ifbt1d =ifbt1d + 1
+ if (iappel.eq.2) ifpt1d(ifbt1d) = ifac
+
+ enddo
+
+endif
+
+if (iappel.eq.1) then
+ nfpt1d = ifbt1d
+endif
+
+! --- Remplissage des parametres du maillage et d'initialisation
+! (un seul passage en debut de calcul)
+! NPPT1D(II) : nombre de points de discretisation associes a la
+! IIeme face avec module thermique 1D
+! EPPT1D(II) : epaisseur de la paroi associee a la IIeme face avec
+! module thermique 1D
+! RGPT1D(II) : raison geometrique du raffinement du maillage associe
+! a la IIeme face avec module thermique 1D
+! ( RGPT1D(II) > 1 => petites mailles cote fluide )
+! TPPT1D(II) : temperature d'initialisation de la paroi associee a la
+! IIeme face avec module thermique 1D
+
+! Remarque : lors de la relecture d'un fichier suite de module thermique
+! 1D, TPPT1D n'est pas utilise. NFPT1D, EPPT1D et RGPT1D sont
+! compares aux valeurs issues du fichier suite. Une
+! correspondance exacte est necessaire pour continuer le calcul.
+if (iappel.eq.2) then
+ if(iphas.eq.1) then
+ do ii = 1, nfpt1d
+ ifac = ifpt1d(ii)
+ nppt1d(ii) = 8
+ eppt1d(ii) = 0.01144d0
+ rgpt1d(ii) = 1.d0
+ tppt1d(ii) = 25.d0
+ enddo
+ endif
+endif
+
+
+! --- Remplissage des conditions aux limites en paroi externe
+! ICLT1D(II) : type de condition a la limite
+! = 1 : condition de dirichlet, avec coefficient d'echange
+! = 3 : condition de flux
+! TEPT1D(II) : temperature exterieure
+! HEPT1D(II) : coefficient d'echange exterieur
+! FEPT1D(II) : flux applique a l'exterieur ( flux<0 = flux entrant)
+! XLMT1D(II) : coefficient de conductivite lambda de la paroi (W/m/�C)
+! RCPT1D(II) : coefficient rho*Cp de la paroi (J/m3/�C)
+! DTPT1D(II) : pas de temps de resolution de l'equation thermique dans
+! la IIeme face de bord avec module thermique 1D (s)
+if (iappel.eq.3) then
+ if(iphas.eq.1) then
+ do ii = 1, nfpt1d
+ iclt1d(ii) = 1
+! parametres physiques
+ ifac = ifpt1d(ii)
+ if (cdgfbo(2,ifac).le.0.025d0) then
+ iclt1d(ii) = 3
+ fept1d(ii) = -1.d4
+ else
+ iclt1d(ii) = 3
+ fept1d(ii) = 1.d4
+ endif
+ xlmt1d(ii) = 31.5d0
+ rcpt1d(ii) = 3.5d6
+ dtpt1d(ii) = 0.3d0
+ enddo
+ endif
+endif
+
+return
+
+end
+
diff --git a/users/base/ussatc.f90 b/users/base/ussatc.f90
new file mode 100644
index 0000000..602e672
--- /dev/null
+++ b/users/base/ussatc.f90
@@ -0,0 +1,185 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ussatc &
+!================
+
+ ( idbia0 , idbra0 , numcpl , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lcesup , lfbsup , lcecpl , lfbcpl , &
+ ncesup , nfbsup , ncecpl , nfbcpl , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod)
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! DEFINITION DES COUPLAGES CODE_SATURNE / CODE_SATURNE
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+include "cplsat.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer numcpl
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lcesup(ncel), lfbsup(nfabor)
+integer lcecpl(ncel), lfbcpl(nfabor)
+integer ncecpl , nfbcpl
+integer ncesup , nfbsup
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel
+integer ilelt, nlelt
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. DEFINITION DU SUPPORT (commun pour tous les couplages...)
+!===============================================================================
+
+ncesup = 0
+nfbsup = 0
+
+do iel = 1, ncel
+ ncesup = ncesup + 1
+ lcesup(ncesup) = iel
+enddo
+
+!===============================================================================
+! 2. DEFINITION DES ELEMENTS COUPLES (differents pour chaque couplage..)
+!===============================================================================
+
+ncecpl = 0
+nfbcpl = 0
+
+! --- On definit une zone de couplage pour les faces de couleur 99
+! pour le couplage numero 1
+
+if (numcpl.eq.1) then
+
+ CALL GETFBR('99',NLELT,LSTELT)
+ !==========
+ do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ nfbcpl = nfbcpl + 1
+ lfbcpl(nfbcpl) = ifac
+
+ enddo
+
+endif
+
+return
+end
diff --git a/users/base/ussmag.f90 b/users/base/ussmag.f90
new file mode 100644
index 0000000..51e360f
--- /dev/null
+++ b/users/base/ussmag.f90
@@ -0,0 +1,274 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ussmag &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ smagor , mijlij , mijmij , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! MODIFICATION UTILISATEUR DE LA CONSTANTE DE SMAGORINSKY DE LA PHASE
+! IPHAS DANS LE CAS DE L'UTILISATION D'UN MODELE DYNAMIQUE
+
+! SMAGOR = Mij.Lij / Mij.Mij
+
+! EN FAIT, DES MOYENNES LOCALES DU NUMERATEUR ET DU DENOMINATEUR
+! SONT REALISEES AVANT L'APPEL A USSMAG, SOIT
+
+! SMAGOR = < Mij.Lij > / < Mij.Mij >
+
+! DANS CET ROUTINE, Mij.Lij ET Mij.Mij SONT PASSES EN ARGUMENT
+! AVANT LA MOYENNE LOCALE.
+! DANS L'EXEMPLE CI-DESSOUS ON REALISE UNE MOYENNE LOCALE DU
+! RAPPORT.
+! SMAGOR = < Mij.Lij / Mij.Mij >
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! smagor(ncelet ! tr ! <-- ! constante de smagorinsky dans le cas !
+! , nphas) ! ! ! d'un modlele dynamique !
+! mijlij(ncelet ! tr ! <-- ! mij.lij avant moyenne locale !
+! mijmij(ncelet ! tr ! <-- ! mij.mij avant moyenne locale !
+! w1..4(ncelet) ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision smagor(ncelet), mijlij(ncelet), mijmij(ncelet)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. MOYENNE SPATIALE SUR LE VOISINAGE ETENDU
+
+! Dans le cas ou l'utilisateur souhaite utilise le voisinage
+! etendu, il est fortement conseille de passer le mode de
+! calcul des gradients en IMRGRA = 2, afin de conserver
+! la totalite du voisinage etendu. En effet, le calcul de
+! moyenne locale est generalement degradee en voisinage reduit
+! (IMRGRA = 3).
+
+!===============================================================================
+
+! On calcule le rapport
+do iel = 1, ncel
+ if(abs(mijmij(iel)).le.epzero) then
+ w1(iel) = smagmx(iphas)**2
+ else
+ w1(iel) = mijlij(iel)/mijmij(iel)
+ endif
+enddo
+
+! On passe dans le filtre local
+call cfiltr &
+!==========
+ ( ncelet , ncel , nfac , nfabor , &
+ ifacel , ifabor , &
+ volume , &
+ w1 , smagor , w2 , w3 )
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/usstru.f90 b/users/base/usstru.f90
new file mode 100644
index 0000000..9e292f1
--- /dev/null
+++ b/users/base/usstru.f90
@@ -0,0 +1,653 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+! FONCTION :
+! ----------
+
+! GESTION DES STRUCTURES MOBILES EN ALE AVEC COUPLAGE INTERNE
+
+! ON TROUVERA ICI DEUX ROUTINES DIFFERENTES :
+
+! - USSTR1 : APPELEE A L'INITIALISATION, POUR DEFINIR LES STRUCTURES
+! ET LEURS PARAMETRES INITIAUX (VITESSE, DEPLACEMENT)
+
+! - USSTR2 : APPELE A CHAQUE PAS DE TEMPS POUR DEFINIR LES
+! CARACTERISTIQUES (POTENTIELLEMENT VARIABLES) DES
+! STRUCTURES
+
+
+! IDENTIFICATION DES FACES DE BORD
+! ================================
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+!-------------------------------------------------------------------------------
+ subroutine usstr1 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , idfstr , &
+ idevel , ituser , ia , &
+ aexxst , bexxst , cfopre , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ xstr0 , vstr0 , xstreq , &
+ rdevel , rtuser , ra )
+
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! GESTION DES STRUCTURES MOBILES EN ALE AVEC COUPLAGE INTERNE
+
+! DEFINITION DES STRUCTURES
+! DEPLACEMENT ET VITESSE INITIAUX
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! idfstr(nfabor ! te ! <-- ! definition des structures !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! aexxst,bexxst ! r ! <-- ! coefficients de prediction du deplact !
+! cfopre ! r ! <-- ! coeff de prediction des efforts !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! xstr0(ndim, ! tr ! <-- ! deplacement initial des structures !
+! nbstru) ! ! ! !
+! vstr0(ndim, ! tr ! <-- ! vitesse initiale des structures !
+! nbstru) ! ! ! !
+! xstreq(ndim, ! tr ! <-- ! deplacement du maillage initial par !
+! nbstru) ! ! ! rapport a l'equilibre !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "pointe.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nbstru
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idfstr(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision aexxst, bexxst, cfopre
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision xstr0(3,nstrmx), xstreq(3,nstrmx)
+double precision vstr0(3,nstrmx)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac
+integer ilelt, nlelt
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+
+
+if(1.eq.1) then
+ nbstru = 0
+ return
+endif
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. DEFINITION DES STRUCTURES (appel a l'initialisation)
+!===============================================================================
+
+! On remplit le tableau IDFSTR(NFABOR)
+! IDFSTR(IFAC) est le numero de la structure a laquelle appartient
+! la face de bord IFAC (0 si elle n'appartient a aucune structure)
+! Le nombre de structure est automatiquement determine a partir du
+! plus grand element de IDFSTR (les numeros des structures doivent
+! donc etre affectes de maniere sequentielle sans trou en commencant
+! par 1).
+
+! Dans l'exemple ci-dessous la structure 1 est bordee par les faces de
+! couleur 4, la structure 2 par les faces de couleur 6
+
+
+CALL GETFBR('4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ idfstr(ifac) = 1
+
+enddo
+
+CALL GETFBR('6',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ idfstr(ifac) = 2
+
+enddo
+
+
+! Pour chaque structure, on definit si necessaire
+! - une vitesse initiale VSTR0
+! - un deplacement initial XSTR0 (i.e. la valeur du deplacement XSTR
+! au temps t=0 par rapport au maillage initial)
+! - un deplacement par rapport a l'equilibre XSTREQ (i.e. le deplacement
+! du maillage initial par rapport a la position d'equilibre de la
+! structure ; la force de retour exercee par le ressort a un temps
+! donne pour un deplacement XSTR sera donc -k*(XSTR+XSTREQ) ).
+! Toutes les composantes de XSTR0, XSTREQ et VSTR0 sont initialisees a 0
+
+! Exemple : deplacement initial y=2 pour la structure 1
+! deplacement par rapport a l'equilibre yeq=1 pour la
+! structure 1
+! vitesse initiale uz=0.5 pour la structure 2
+
+! Dans le cas d'un calcul initial, ou d'une suite d'un calcul sans ALE,
+! une iteration 0 est automatiquement realisee pour gerer un eventuel
+! deplacement initial des structures. Si necessaire, positionner
+! ITALIN a 1 dans usalin pour activer une iteration 0 dans les autres
+! cas.
+
+xstr0(2,1) = 2.d0
+xstreq(2,1) = 1.d0
+vstr0(3,2) =-0.5d0
+
+! --- Si necessaire on definit les coefficients d'extrapolation utiles
+! en couplage explicite :
+! deplacement predit = X(n) + AEXXST.DT.X'(n)
+! + BEXXST.DT.( X'(n)-X'(n-1) )
+! force envoyee a la structure = CFOPRE.F(n) + (1.D0-CFOPRE).F(n-1)
+
+aexxst = 0.5d0
+bexxst = 0.0d0
+cfopre = 2.d0
+
+! --- Ecriture des fichiers historiques des structures mobiles
+! (deplacement, vitesse, acceleration, force)
+! La periodicite de sortie est la meme que pour les historiques
+! standards (NTHIST)
+ihistr = 1
+
+return
+
+end
+
+
+!===============================================================================
+
+
+ subroutine usstr2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nbstru , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , idfstr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dtcel , &
+ xmstru , xcstru , xkstru , xstreq , xstr , vstr , forstr , &
+ dtstr , &
+ rdevel , rtuser , &
+ ra )
+
+
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! GESTION DES STRUCTURES MOBILES EN ALE AVEC COUPLAGE INTERNE
+
+! SPECIFICATION DES CARACTERISTIQUES DES STRUCTURES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nbstru ! e ! <-- ! nombre de structures definies !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr) ! ! ! (optionnel) !
+! idfstr(nfabor ! te ! <-- ! definition des structures !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dtcel(ncelet) ! tr ! <-- ! pas de temps dans les cellules !
+! xmstru(ndim, ! tr ! --> ! matrice de masse des structures !
+! ndim,nbstru) ! ! ! !
+! xcstru(ndim, ! tr ! --> ! matrice de friction des structures !
+! ndim,nbstru) ! ! ! !
+! xkstru(ndim, ! tr ! --> ! matrice de raideur des structures !
+! ndim,nbstru) ! ! ! !
+! xstreq(ndim, ! tr ! <-- ! deplacement du maillage initial par !
+! nbstru) ! ! ! rapport a l'equilibre !
+! xstr(ndim, ! tr ! <-- ! deplacement des structures !
+! nbstru) ! ! ! !
+! vstr(ndim, ! tr ! <-- ! vitesse des structures !
+! nbstru) ! ! ! !
+! forstr(ndim ! tr ! <-- ! effort sur les structures (contient !
+! nbstru) ! ! ! les efforts dus au fluide) !
+! dtstr(nbstru) ! tr ! --> ! pas de temps des structures !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "optcal.h"
+include "pointe.h"
+include "albase.h"
+include "period.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nbstru
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idfstr(nfabor)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dtcel(ncelet)
+double precision xmstru(3,3,nstrmx)
+double precision xcstru(3,3,nstrmx)
+double precision xkstru(3,3,nstrmx)
+double precision xstreq(3,nstrmx)
+double precision xstr(3,nstrmx)
+double precision vstr(3,nstrmx)
+double precision forstr(3,nstrmx)
+double precision dtstr(nstrmx)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ii, jj, istr
+double precision theta, sint, cost, xm, xc, xk, fx, fy
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+
+
+if(1.eq.1) return
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. COEFFICIENTS DES STRUCTURES (appel a chaque pas de temps)
+!===============================================================================
+
+
+! On remplit ici les coefficients de definissant la structure.
+! - sa masse M (XMSTRU)
+! - son coefficient de friction C (XCSTRU)
+! - son coefficient de raideur K (XKSTRU)
+
+! Le tableau FORSTR contient les efforts exerces par le fluide
+! sur chacune des structures. Il est possible d'y ajouter une
+! composante de force exterieure (gravite par exemple)
+
+! Le tableau XSTR contient le deplacement des structures par rapport
+! au maillage initial
+! Le tableau XSTR0 contient le deplacement des structures dans le
+! maillage initial par rapport a leur position d'equilibre
+! Le tableau XPSTR contient la vitesse des structures
+
+! XSTR, XSTR0 et VSTR sont des DONNEES pouvant servir eventuellement
+! a calculer M, C et K. ILS NE DOIVENT PAS ETRE MODIFIES.
+
+! L'evolution du systeme est resolue de maniere tridimensionnelle,
+! ces trois coefficients sont donc en fait des matrices 3x3.
+
+! L'equation resolue est
+
+! M.X'' + C.X' + K.(X+X0) = F
+! = - = - = - -- -
+
+! (X est le deplacement par rapport a la position initiale du maillage,
+! X0 est le deplacement de la position dans le maillage initial par
+! rapport a l aposition d'equilibre)
+
+! La resolution est effectuee par la methode de Newmark HHT.
+! Le pas de temps utilise peut etre different du pas de temps
+! fluide (a definir dans le tableau DTSTR, initialise par defaut
+! au pas de temps fluide).
+
+
+! On met a zero tous les coefficients
+do istr = 1, nbstru
+
+ do ii = 1, 3
+ do jj = 1, 3
+ xmstru(ii,jj,istr) = 0.d0
+ xcstru(ii,jj,istr) = 0.d0
+ xkstru(ii,jj,istr) = 0.d0
+ enddo
+ enddo
+
+enddo
+
+! Dans l'exemple ci-dessous, la structure 1, de masse 5 kg est retenue par
+! ressort isotrope de raideur 2 N/m et de coefficient de friction 3 kg.s
+
+do ii = 1, 3
+ xmstru(ii,ii,1) = 5.d0
+ xcstru(ii,ii,1) = 2.d0
+ xkstru(ii,ii,1) = 3.d0
+enddo
+
+
+! Dans l'exemple ci-dessous, la structure 2 est contrainte a un mouvement
+! decompose en deux :
+! - dans le plan xOy, le mouvement est force dans une direction X, avec
+! une masse xm, une friction xc et une raideur xk (et la composante
+! normale Y est donc forcee a 0). L'axe X est incline d'un angle THETA
+! par rapport a l'axe x du repere global.
+! - dans la direction z, le mouvement est un mouvement d'oscillation
+! harmonique de masse 1 et de raideur 1 (et de friction nulle) avec un
+! forcage externe en 3.cos(4.t) (en plus des efforts fluides).
+
+theta = pi/6.d0
+cost = cos(theta)
+sint = sin(theta)
+
+
+! Dans le repere local on a donc
+! xm.X'' + xc.X' + xk.X = FX
+! Y = 0
+! Z'' + Z = FZ + 3.cos(4.t)
+
+! FX, FY et FZ sont les composantes des efforts fluides dans le repere
+! local. Soit, a partir des composantes dans le repere global :
+! FX = COST*Fx + SINT*Fy
+! FY = -SINT*Fx + COST*Fy
+! FZ = Fz
+
+! Apres changement de repere, on obtient donc :
+
+xm = 1.d0
+xc = 3.d-1
+xk = 2.d0
+fx = forstr(1,2)
+fy = forstr(2,2)
+
+xmstru(1,1,2) = xm*cost**2
+xmstru(1,2,2) = xm*cost*sint
+xmstru(2,1,2) = xm*cost*sint
+xmstru(2,2,2) = xm*sint**2
+xmstru(3,3,2) = 1.d0
+
+xcstru(1,1,2) = xc*cost**2
+xcstru(1,2,2) = xc*cost*sint
+xcstru(2,1,2) = xc*cost*sint
+xcstru(2,2,2) = xc*sint**2
+
+xkstru(1,1,2) = (xk-1.d0)*cost**2 + 1.d0
+xkstru(1,2,2) = (xk-1.d0)*cost*sint
+xkstru(2,1,2) = (xk-1.d0)*cost*sint
+xkstru(2,2,2) = (xk-1.d0)*sint**2 + 1.d0
+xkstru(3,3,2) = 1.d0
+
+forstr(1,2) = fx*cost**2 + fy*sint*cost
+forstr(2,2) = fx*sint*cost + fy*sint**2
+forstr(3,2) = forstr(3,2) + 3.d0*cos(4.d0*ttcabs)
+
+do istr = 1, nbstru
+ dtstr(istr) = dtcel(1)
+enddo
+
+
+return
+
+end
diff --git a/users/base/ussyrc.f90 b/users/base/ussyrc.f90
new file mode 100644
index 0000000..8a60ac7
--- /dev/null
+++ b/users/base/ussyrc.f90
@@ -0,0 +1,139 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ussyrc &
+!================
+
+ ( )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! DEFINITION DE COUPLAGE(S) AVEC LE CODE SYRTHES
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "parall.h"
+
+!===============================================================================
+
+! Arguments
+
+! Variables locales
+
+character cprjsy
+integer numsyr, nbcsyr, ii
+integer iwarns
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+iwarns = 1
+
+numsyr = -1
+nbcsyr = 3
+
+do ii = 1, nbcsyr
+
+! IPRJSY : ' ' : couplage 3D standard
+! 'x', 'y', ou 'z' : axe de projection pour couplage avec
+! SYRTHES 2D.
+! IWARNS : niveau d'impression associe
+
+! Exemple : couplage surfacique 3D aux les faces de couleur 3
+! avec une instance nommee SYRTHES_01
+
+ if (ii .eq. 1) then
+
+ CPRJSY= ' '
+
+ CALL DEFSYR(NUMSYR, 'SYRTHES_01', CPRJSY, '3', ' ', IWARNS)
+ !==========
+
+! Exemple : couplage surfacique 2D aux les faces du groupe 'wall'
+! avec une instance nommee SYRTHES_02
+
+ else if (ii .eq. 2) then
+
+ CPRJSY= 'z'
+
+ CALL DEFSYR(NUMSYR, 'SYRTHES_02', CPRJSY, &
+ !==========
+ 'wall', ' ', IWARNS)
+
+! Exemple : couplage volumique 3D au niveau de la boite
+! de coins (0, 0, 0) et (1, 1, 1), avec une instance
+! nommee SOLID
+
+ else if (ii .eq. 3) then
+
+ CPRJSY= ' '
+
+ CALL DEFSYR(NUMSYR, 'SOLID', CPRJSY, &
+ !==========
+ ' ', 'box[0., 0., 0., 1., 1., 1.]', IWARNS)
+
+
+ endif
+
+enddo
+
+return
+
+end
+
diff --git a/users/base/usthht.f90 b/users/base/usthht.f90
new file mode 100644
index 0000000..4ebea75
--- /dev/null
+++ b/users/base/usthht.f90
@@ -0,0 +1,235 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usthht &
+!================
+
+ ( mode , enthal , temper )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR
+! LOI ENTHALPIE -> TEMPERATURE (MODE = 1)
+! LOI TEMPERATURE -> ENTHALPIE (MODE = -1)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! mode ! e ! <-- ! -1 : t -> h ; 1 : h -> t !
+! enthal ! r ! <-- ! enthalpie !
+! temper ! r ! <-- ! temperature !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer mode
+
+double precision enthal, temper
+
+! VARIABLES LOCALES
+
+integer it
+
+! Pour le second exemple ci-dessous,
+! donnee de NTAB > 1 valeurs (fictives) de H (=HT) tabulees
+! en fonction de NTAB valeurs de T (=TH) (attention a l'unit� K ou C)
+
+integer ntab
+parameter (ntab=5)
+double precision ht(ntab), th(ntab)
+data ht /100000.d0,200000.d0,300000.d0, &
+ 400000.d0,500000.d0 /
+data th / 100.d0, 200.d0, 300.d0, &
+ 400.d0, 500.d0 /
+
+!===============================================================================
+
+
+! ATTENTION, CE SOUS-PROGRAMME EST APPELE DANS DES BOUCLES :
+! ========= ================
+
+! EVITER LES IMPRESSIONS
+! ======
+
+! EVITER LES OPERATIONS FAISANT APPEL AU PARALLELISME
+! ======
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+
+write(nfecra,9000)
+call csexit (1)
+!==========
+
+!----
+! FORMATS
+!----
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DE LA TEMPERATURE ',/,&
+'@ ========= ',/,&
+'@ LES TABLES ENTHALPIE TEMPERATURE NE SONT PAS DISPONIBLES',/,&
+'@ ',/,&
+'@ Le sous-programme utilisateur usthht doit etre complete. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Le couplage avec SYRTHES necessite la donne d''une ',/,&
+'@ temperature de paroi. ',/,&
+'@ Le scalaire choisi pour le couplage SYRTHES est ici une ',/,&
+'@ enthalpie. ',/,&
+'@ La loi donnant la temperature en fonction de l''enthalpie ',/,&
+'@ doit etre fournie par l''utilisateur dans le ',/,&
+'@ sous-programme usthht. ',/ &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! EXEMPLES
+!===============================================================================
+
+! Premier exemple, correspondant a H=CpT avec Cp = 4000
+! =====================================================
+
+! --- Mode H -> T
+if (mode .eq. 1) then
+ temper = enthal / 4000.d0
+
+! --- Mode T -> H
+else
+ enthal = temper * 4000.d0
+
+endif
+
+return
+
+
+
+
+
+
+
+
+
+
+
+
+! Second exemple, correspondant a une interpolation simple
+! === a partir d'une tabulation H=f(T) entree en DATA ====
+! ================================================
+
+! --- Mode H -> T
+if (mode .eq. 1) then
+
+! Initialisation par defaut
+ temper = 0.d0
+
+! Si H plus petit que la plus petite enthalpie tabulee
+! on limite arbitrairement T a la plus petite temperature
+ if(enthal.le.ht(1)) then
+ temper = th(1)
+
+! Si H plus grand que la plus grande enthalpie tabulee
+! on limite arbitrairement T a la plus grande temperature
+ elseif(enthal.ge.ht(ntab)) then
+ temper = th(ntab)
+
+! Sinon, on interpole lineairement
+ else
+ do it = 2, ntab
+ if(enthal.le.ht(it)) then
+ temper = th(it-1) &
+ +(enthal-ht(it-1))*(th(it)-th(it-1))/(ht(it)-ht(it-1))
+ endif
+ enddo
+ endif
+
+! --- Mode T -> H
+else
+
+! Initialisation par defaut
+ enthal = 0.d0
+
+! Si T plus petit que la plus petite temperature tabulee
+! on limite arbitrairement H a la plus petite enthalpie
+ if(temper.le.th(1)) then
+ enthal = ht(1)
+
+! Si T plus grand que la plus grande temperature tabulee
+! on limite arbitrairement H a la plus grande enthalpie
+ elseif(temper.ge.th(ntab)) then
+ enthal = ht(ntab)
+
+! Sinon, on interpole lineairement
+ else
+ do it = 2, ntab
+ if(temper.le.th(it)) then
+ enthal = ht(it-1) &
+ +(temper-th(it-1))*(ht(it)-ht(it-1))/(th(it)-th(it-1))
+ endif
+ enddo
+ endif
+endif
+
+return
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/base/ustmgr.f90 b/users/base/ustmgr.f90
new file mode 100644
index 0000000..5f63a80
--- /dev/null
+++ b/users/base/ustmgr.f90
@@ -0,0 +1,390 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ustmgr &
+!================
+
+
+ ( iappel , igr , isym , &
+ ncelf , ncelfe , nfacf , iwarnp , &
+ iusmgr , niw , nrw , &
+ ifacef , &
+ daf , xaf , surfaf , volumf , xyzfin , &
+ irscel , &
+ iw , rw )
+
+!==========================================================================
+! FONCTION :
+! ----------
+
+! MULTIGRILLE ALGEBRIQUE :
+
+! DETERMINATION DE LA CONNECTIVITE
+! CELLULE FINE -> CELLULE GROSSIERE (IRSCEL)
+! POUR LA CONSTRUCTION D'UN NIVEAU DE MAILLAGE GROSSIER
+! A PARTIR DU NIVEAU SUPERIEUR
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! iappel ! e ! <-- ! 1 : selection/dimensionnement !
+! ! ! ! 2 : determination de irscel !
+! igr ! e ! <-- ! niveau du maillage grossier !
+! isym ! e ! <-- ! indicateur = 1 matrice sym !
+! ! ! ! = 2 matrice non sym !
+! ncelf ! e ! <-- ! nombre d'elements maillage fin !
+! ncelfe ! e ! <-- ! nombre d'elements etendus fin !
+! nfacf ! e ! <-- ! nombre de faces internes maill. fin !
+! iwarnp ! e ! <-- ! niveau d'impression !
+! iusmgr ! e ! --> ! 0 : agglomeration automatique !
+! ! ! ! 1 : on utilise ce sous-programme !
+! niw / nrw ! e ! --> ! tailles des tableaux iw / rw !
+! ! ! ! pour iappel = 2 !
+! ! ! ! (determinees lorsque iappel = 1) !
+! ifacef ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfacf) ! ! ! du maillage fin !
+! daf(ncelfe) ! tr ! <-- ! diagonale matrice maillage fin !
+! xaf ! tr ! <-- ! extradiagonale matrice maillage fin !
+! (nfacf, isym) ! ! ! !
+! surfaf ! tr ! <-- ! surfaces faces internes maillage fin !
+! (3, nfacf) ! ! ! !
+! volumf ! tr ! <-- ! volumes des cellules du maillage fin !
+! (ncelfe) ! ! ! !
+! xyzfin ! tr ! <-- ! centres des cellules du maillage fin !
+! (3, ncelfe) ! ! ! !
+! irscel ! te ! --> ! cellule fine -> cellule grossiere !
+! (ncelfe) ! ! ! !
+! iw(niw) ! te ! --- ! tableau de travail !
+! rw(nrw) ! tr ! --- ! tableau de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+
+!===============================================================================
+
+! Arguments
+
+integer iappel, igr, isym
+integer ncelf, ncelfe, nfacf
+integer iwarnp
+integer iusmgr, niw, nrw
+
+integer ifacef(2, nfacf)
+integer irscel(ncelfe)
+
+double precision daf(ncelfe), xaf(nfacf, isym)
+double precision surfaf(3, nfacf), volumf(ncelfe)
+double precision xyzfin(3, ncelfe)
+integer iw(niw)
+double precision rw(nrw)
+
+
+! VARIABLES LOCALES
+
+integer ncelg
+integer ifac
+integer indic, irspr2, ipaimp, iw1
+integer iedir
+
+integer imp, jmp, kmp, i, j, k, icel
+integer ntest, ip, jp, kp, ijk, iglob, i1, ig, jg
+double precision dx, dy, dz, xyzmin(3), xyzmax(3)
+double precision xmn, xmx, ymn, ymx, zmn, zmx
+double precision xg, yg, zg, rap, rep, epslon
+double precision ngros
+
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if (1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+ncelg = 0
+epslon = +1.d-6
+
+!===============================================================================
+! 0. INITIALISATION ET DIMENSIONNEMENT
+!===============================================================================
+
+iusmgr = 0
+
+! DIMENSIONNEMENT MEMOIRE
+
+indic = 1
+irspr2 = indic + ncelfe
+ipaimp = irspr2 + ncelfe
+niw = ipaimp + ncelfe
+
+iw1 = 1
+nrw = iw1 + ncelfe
+
+if (iappel.eq.1) return
+
+!===============================================================================
+! 1. CREATION DES CELLULES GROSSIERES : IRSCEL
+!===============================================================================
+
+!===============================================================================
+! MAILLAGE DU CARRE CAS 2D
+
+! BORNE MIN/MAX DU MAILLAGE
+
+do i = 1, 3
+ xyzmin(i) = +1.d12
+ xyzmax(i) = -1.d12
+ do icel = 1, ncelf
+ xyzmin(i) = min(xyzfin(i, icel), xyzmin(i))
+ xyzmax(i) = max(xyzfin(i, icel), xyzmax(i))
+ enddo
+ xyzmin(i) = xyzmin(i) -epslon
+ xyzmax(i) = xyzmax(i) +epslon
+enddo
+
+! EVALUATION DE IMP,JMP,KMP AVEC LA REGLE MAILLAGE REGULIER
+! IMP/(Xmax-Xmin) ~ JMP/(Ymax-Ymin) ~ KMP/(Zmax-Zmin)
+! NCELG ~ IMP.JMP.KMP ~ NCEL/NGROS
+
+
+! CAS 2D
+
+ngros = 4
+
+rap = ncelf/ngros
+dx = xyzmax(1) -xyzmin(1)
+dy = xyzmax(2) -xyzmin(2)
+rep = sqrt(rap*dx/dy)
+kmp = 1
+imp = int(rep)
+jmp = int(rep*dy/dx)
+imp = max(imp, 1)
+jmp = max(jmp, 1)
+ncelg = imp*jmp*kmp
+
+! INCLUSION DANS LE MAILLAGE STRUCTUR� ORTHOGONAL
+
+dx = (xyzmax(1) -xyzmin(1))/imp
+dy = (xyzmax(2) -xyzmin(2))/jmp
+dz = (xyzmax(3) -xyzmin(3))/kmp
+
+do icel = 1, ncelf
+ iw(indic+icel-1) = 0
+ iw(irspr2+icel-1) = 0
+enddo
+
+do icel = 1, ncelf
+
+! INITIALISATION
+ xg = xyzfin(1, icel)
+ yg = xyzfin(2, icel)
+ zg = xyzfin(3, icel)
+ ip = 0
+ jp = 0
+ kp = 0
+
+ do i = 1, imp
+ xmn = xyzmin(1) +(i-1)*dx
+ xmx = xyzmin(1) + i *dx
+ if (ip.eq.0) then
+ if (xg.ge.xmn .and. xg.le.xmx) then
+ ip = i
+ endif
+ endif
+ enddo
+
+ do j = 1, jmp
+ ymn = xyzmin(2) +(j-1)*dy
+ ymx = xyzmin(2) + j *dy
+ if (jp.eq.0) then
+ if (yg.ge.ymn .and. yg.le.ymx) then
+ jp = j
+ endif
+ endif
+ enddo
+
+ do k = 1, kmp
+ zmn = xyzmin(3) +(k-1)*dz
+ zmx = xyzmin(3) + k *dz
+ if (kp.eq.0) then
+ if (zg.ge.zmn .and. zg.le.zmx) then
+ kp = k
+ endif
+ endif
+ enddo
+
+ ijk = ip*jp*kp
+
+ if (ijk.gt.0) then
+ iglob = imp*jmp*(kp-1) +imp*(jp-1)+ip
+ iw(irspr2+icel-1) = iglob
+ iw(indic+iglob-1) = +1
+ else
+ write(nfecra,*) ' pb de programmation dans ustmgr.f90'
+ write(nfecra,*) ' arret dans ustmgr.F'
+ write(nfecra,*) ' ip, jp, kp = ', IP, JP, KP
+ call csexit(1)
+ endif
+
+enddo
+
+
+! DEFINITION DU MAILLAGE PAIR-IMPAIR POUR VISUALISATION
+
+do iglob =1,ncelf
+ iw(ipaimp+iglob-1) = 0
+enddo
+
+do k = 1, kmp
+ do j = 1, jmp
+ i1 = mod(k+j,2) +1
+ do i = i1, imp, 2
+ iglob = imp*jmp*(k-1) +imp*(j-1) +i
+ iw(ipaimp+iglob-1) = -1
+ enddo
+ i1 = mod(k+j+1,2)+1
+ do i = i1, imp, 2
+ iglob = imp*jmp*(k-1) +imp*(j-1) +i
+ iw(ipaimp+iglob-1) = +1
+ enddo
+ enddo
+enddo
+
+! Compactage du maillage structure si, au moins, une maille
+! grossiere ne contient aucune maille du maillage fin non structure
+
+ntest = 0
+do iglob = 1, ncelg
+ if (iw(indic+iglob-1).le.0) ntest=ntest+1
+enddo
+
+if (ntest.le.0) then
+ do icel=1,ncelf
+ irscel(icel) = iw(irspr2+icel-1)
+ enddo
+
+else
+
+ i = 0
+ do iglob = 1, ncelg
+ if (iw(indic+iglob-1).gt.0) then
+ i = i +1
+ iw(indic+iglob-1) = i
+ endif
+ enddo
+
+! NOUVEAU NCELG
+ ncelg = i
+
+ do icel=1,ncelf
+ irscel(icel) = iw(indic+iw(irspr2+icel-1)-1)
+ enddo
+
+endif
+
+i = 0
+j = ncelf
+do icel = 1, ncelf
+ i = min(irscel(icel), i)
+ j = max(irscel(icel), j)
+enddo
+
+iedir = 0
+! IEDIR = 1
+
+if (iedir.gt.0) then
+
+! EXTRACTION DES POINTS DIRICHLETS (DIAGONALE FORTEMENT DOMINANTE)
+
+ do icel = 1, ncelf
+ iw(indic+icel-1) = 0
+ iw(irspr2+icel-1) = 0
+ iw(iw1+icel-1) = daf(icel)
+ enddo
+
+ do ifac = 1, nfacf
+ i = ifacef(1,ifac)
+ j = ifacef(2,ifac)
+ iw(iw1+i-1) = iw(iw1+i-1) +xaf(ifac,1)
+ iw(iw1+j-1) = iw(iw1+j-1) +xaf(ifac,isym)
+ ig = irscel(i)
+ jg = irscel(j)
+ iw(indic+ig-1) = iw(indic+ig-1) +1
+ iw(indic+jg-1) = iw(indic+jg-1) +1
+ enddo
+
+ rep = 0.1d0
+ do icel = 1, ncelf
+ xmx = iw(iw1+icel-1)/daf(icel)
+ ig = irscel(icel)
+ if (xmx.gt.rep) then
+ if (iw(indic+ig-1).ge.2) then
+ ncelg = ncelg+1
+ irscel(icel) = ncelg
+ iw(indic+ig-1) = iw(indic+ig-1) -1
+ iw(indic+ncelg-1) = iw(indic+ncelg-1) -1
+ endif
+ endif
+ enddo
+
+endif
+
+
+!==============================================================================
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/ustske.f90 b/users/base/ustske.f90
new file mode 100644
index 0000000..cff1b3e
--- /dev/null
+++ b/users/base/ustske.f90
@@ -0,0 +1,364 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ustske &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , tinstk , divu , &
+ crkexp , creexp , crkimp , creimp , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE UTILISATEUR ON PRECISE LES TERMES SOURCES UTILISATEURS
+! POUR K-EPSILON SUR UN PAS DE TEMPS (PHASE IPHAS)
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT RHO*VOLUME)
+! CRVEXP en kg variable/s :
+! ex : pour k kg m2/s3
+! pour epsilon kg m2/s4
+! CRVIMP en kg /s :
+
+! VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CR.EXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CR.IMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+! TINSTK = 2 (S11)**2 + 2 (S22)**2 + 2 (S33)**2
+! + (2 S12)**2 + (2 S13)**2 + (2 S23)**2 )
+! DIVU = DUDX + DVDY + DWDZ
+
+! Sij = (dUi/dxj+dUj/dxi)/2
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! tinstk(ncelet ! tr ! <-- ! somme sijsij (en 1/s2) !
+! divu (ncelet ! tr ! <-- ! div(u) (en 1/s ) !
+! crkexp(ncelet ! tr ! --> ! tableau pour k pour part explicit !
+! crkimp(ncelet ! tr ! --> ! tableau pour k pour terme instat !
+! creexp(ncelet ! tr ! --> ! tableau pour eps pour part explicit !
+! creimp(ncelet ! tr ! --> ! tableau pour eps pour terme instat !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..10(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision tinstk(ncelet), divu(ncelet)
+double precision crkexp(ncelet), crkimp(ncelet)
+double precision creexp(ncelet), creimp(ncelet)
+double precision viscf(nfac), viscb(nfabor), xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet), w10(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ikiph, ieiph, ipcrom
+double precision ff, tau, xx
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables k et epsilon de la phase IPHAS courante
+ikiph = ik (iphas)
+ieiph = iep(iphas)
+
+! --- Numero des grandeurs physiques (voir usclim) : masse volumique
+ipcrom = ipproc(irom(iphas))
+
+if(iwarni(ikiph).ge.1) then
+ write(nfecra,1000) iphas
+endif
+
+!===============================================================================
+! 2. EXEMPLE FICTIF :
+
+! Pour la phase 2
+
+! Terme source k :
+! rho volume d(k)/dt = ...
+! ... - rho*volume*ff*epsilon - rho*volume*k/tau
+
+! Terme source epsilon :
+! rho volume d(epsilon)/dt = ...
+! ... + rho*volume*xx
+
+! Avec, pour l'exemple,
+! xx = 2.d0, ff=3.d0, tau = 4.d0
+
+!===============================================================================
+
+
+! --- Si la phase est bien la phase selectionnee
+
+if(iphas.ne.2) then
+
+
+! --- Termes sources explicites
+
+ ff = 3.d0
+ tau = 4.d0
+ xx = 2.d0
+
+ do iel = 1, ncel
+ crkexp(iel) = -propce(iel,ipcrom)*volume(iel) &
+ *ff*rtpa(iel,ieiph)
+ creexp(iel) = propce(iel,ipcrom)*volume(iel)*xx
+ enddo
+
+! --- Termes sources implicites (diagonale)
+! CRKIMP et CREIMP sont initialises a zero avant l'entree dans ce
+! sous-programme : il est donc inutile de completer CREIMP
+! s'il est nul.
+
+ do iel = 1, ncel
+ crkimp(iel) = -propce(iel,ipcrom)*volume(iel)/tau
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES UTILISATEURS K-EPSILON PHASE ',I4,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/base/ustskw.f90 b/users/base/ustskw.f90
new file mode 100644
index 0000000..36225c9
--- /dev/null
+++ b/users/base/ustskw.f90
@@ -0,0 +1,376 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ustskw &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , s2kw , divukw , &
+ gkgw , ggrho , xf1 , &
+ crkexp , crwexp , crkimp , crwimp , &
+ viscf , viscb , xam , w1 , w2 , &
+ w3 , w4 , w5 , w6 , w7 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE UTILISATEUR ON PRECISE LES TERMES SOURCES UTILISATEURS
+! POUR K-OMEGA SUR UN PAS DE TEMPS (PHASE IPHAS)
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT RHO*VOLUME)
+! CRVEXP en kg variable/s :
+! ex : pour k kg.m2/s3
+! pour omega kg/s2
+! CRVIMP en kg/s :
+
+! VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CR.EXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CR.IMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+! S2KW = 2 (S11)**2 + 2 (S22)**2 + 2 (S33)**2
+! + (2 S12)**2 + (2 S13)**2 + (2 S23)**2 )
+
+! Sij = (dUi/dxj+dUj/dxi)/2
+
+! DIVUKW = DUDX + DVDY + DWDZ
+
+! GKGW = GRAD(K).GRAD(OMEGA)
+
+! GGRHO = -G.GRAD(RHO)/PRDTUR/RHO SI IGRAKE>0
+! GGRHO = 0 SI IGRAKE=0
+
+! XF1 = COEFFICIENT F1 DE PONDERATION K-EPS/K-OMEGA
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! s2kw(ncelet) ! tr ! <-- ! 2.sijsij (en 1/s2) !
+! divukw(ncelet ! tr ! <-- ! div(u) (en 1/s ) !
+! gkgw(ncelet) ! tr ! <-- ! grad(k).grad(omega) !
+! ggrho(ncelet) ! tr ! <-- ! -g*grad(rho)/prdtur/rho si igrake>0 !
+! xf1(ncelet) ! tr ! <-- ! coefficient de ponderation k-eps/k-w !
+! crkexp(ncelet ! tr ! --> ! tableau pour k pour part explicit !
+! crkimp(ncelet ! tr ! --> ! tableau pour k pour terme instat !
+! crwexp(ncelet ! tr ! --> ! tableau pour omega pour part explicit !
+! crwimp(ncelet ! tr ! --> ! tableau pour omega pour terme instat !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..10(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision s2kw(ncelet) , divukw(ncelet)
+double precision gkgw(ncelet) , ggrho(ncelet), xf1(ncelet)
+double precision crkexp(ncelet), crkimp(ncelet)
+double precision crwexp(ncelet), crwimp(ncelet)
+double precision viscf(nfac), viscb(nfabor), xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet), w7(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ikiph, iomgip, ipcrom
+double precision ff, tau, xx
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables k et epsilon de la phase IPHAS courante
+ikiph = ik (iphas)
+iomgip = iomg(iphas)
+
+! --- Numero des grandeurs physiques (voir usclim) : masse volumique
+ipcrom = ipproc(irom(iphas))
+
+if(iwarni(ikiph).ge.1) then
+ write(nfecra,1000) iphas
+endif
+
+!===============================================================================
+! 2. EXEMPLE FICTIF :
+
+! Pour la phase 2
+
+! Terme source k :
+! rho volume d(k)/dt = ...
+! ... - rho*volume*ff*epsilon - rho*volume*k/tau
+
+! Terme source omega :
+! rho volume d(omega)/dt = ...
+! ... + rho*volume*xx
+
+! Avec, pour l'exemple,
+! xx = 2.d0, ff=3.d0, tau = 4.d0
+
+!===============================================================================
+
+
+! --- Si la phase est bien la phase selectionnee
+
+if(iphas.ne.2) then
+
+
+! --- Termes sources explicites
+
+ ff = 3.d0
+ tau = 4.d0
+ xx = 2.d0
+
+ do iel = 1, ncel
+ crkexp(iel) = -propce(iel,ipcrom)*volume(iel) &
+ *ff*rtpa(iel,iomgip)
+ crwexp(iel) = propce(iel,ipcrom)*volume(iel)*xx
+ enddo
+
+! --- Termes sources implicites (diagonale)
+! CRKIMP et CREIMP sont initialises a zero avant l'entree dans ce
+! sous-programme : il est donc inutile de completer CRWIMP
+! s'il est nul.
+
+ do iel = 1, ncel
+ crkimp(iel) = -propce(iel,ipcrom)*volume(iel)/tau
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES UTILISATEURS K-EPSILON PHASE ',I4,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/base/ustsma.f90 b/users/base/ustsma.f90
new file mode 100644
index 0000000..b7d4da0
--- /dev/null
+++ b/users/base/ustsma.f90
@@ -0,0 +1,621 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ustsma &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ncesmp , iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! TERMES SOURCES DE MASSE
+! POUR LA PHASE IPHAS
+
+! IAPPEL = 1 :
+! CALCUL DU NOMBRE DE CELLULES AVEC SOURCE DE MASSE
+! NCESMP
+! IAPPEL = 2 :
+! REPERAGE DES CELLULES AVEC SOURCE DE MASSE
+! ICETSM(NCESMP)
+! IAPPEL = 3 :
+! CALCUL DES VALEURS DES COEFS DE SOURCE DE MASSE
+
+! L'equation de conservation de la masse devient :
+
+! d(rho)/dt + div(rho u) = GAMMA
+! -
+
+! L'equation d'une variable f devient :
+
+! d(f)/dt = ..... + GAMMA*(f_i - f)
+
+! discretisee en :
+
+! RHO*(f^(n+1) - f^(n))/DT = .....
+! + GAMMA*(f_i - f^(n+1))
+
+
+! Deux possibilites pour chaque variable f :
+! - Flux de masse a la valeur de f ambiante
+! --> f_i = f^(n+1)
+! (l'equation de f n'est alors pas modifiee)
+! - Flux de masse avec une valeur donnee pour f
+! --> f_i specifie par l'utilisateur
+
+
+
+
+! VARIABLES A REMPLIR PAR L'UTILISATEUR :
+! =======================================
+
+! NCESMP : Nombre de cellules a source de masse
+
+! ICETSM(IELTSM) : Numero de la IELTSMieme cellule a
+! source de masse (IELTSM<=NCESMP)
+
+! SMACEL(IEL,IPR(IPHAS)) : Valeur du flux de masse
+! GAMMA (en kg/m^3/s)
+! dans la IELieme cellule a source
+! de masse
+
+! ITYPSM(IEL,IVAR) : type de flux associe a la variable
+! IVAR dans la IELeme cellule a
+! source de masse (pour toutes les
+! variables sauf IVAR=IPR(IPHAS))
+! + ITYPSM = 0 --> injection a la valeur ambiante
+! de IVAR
+! + ITYPSM = 1 --> injection a une valeur donnee
+! de IVAR
+
+! SMACEL(IEL,IVAR) : Valeur de f_i pour la variable
+! IVAR (pour toutes les variables
+! sauf IVAR=IPR(IPHAS))
+
+
+! REMARQUES
+! =========
+! * Si ITYPSM(IEL,IVAR)=0, SMACEL(IEL,IVAR)
+! n'est pas utilise
+! * Si SMACEL(IEL,IPR(IPHAS))<0,
+! on enleve de la masse au systeme, Code_Saturne
+! utilise donc automatiquement f_i=f^(n+1)
+! QUELLES QUE SOIENT LES VALEURS DE ITYPSM(IEL)
+! et SMACEL(IEL,IVAR)
+
+! * Si une variable n'est pas reliee a la phase iphas
+! pour laquelle les informations precedentes ont ete
+! completees, aucun terme source ne sera impose.
+
+! * Pour un scalaire qui ne repondrait pas a l'equation
+! d(rho f)/dt + d(rho U f)/dx = ...
+! (champ convecteur different par exemple)
+! il est incorrect d'imposer le terme source de masse
+! comme fait ici (sauf en cas d'injection a la valeur
+! ambiante). Il faut introduire directement le terme
+! source comme un terme source scalaire dans ustssc.
+
+
+! IDENTIFICATION DES CELLULES/FACES DE BORD/FACES INTERNES
+! ========================================================
+
+! Les commandes GETCEL, GETFBR et GETFAC permettent d'identifier
+! respectivement les cellules, faces ou faces de bord en fonction
+! de differents criteres.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! La syntaxe des commandes GETFBR et GETFAC est identique.
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules avec tsm !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,nvar) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , iappel
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6)
+double precision smacel(ncesmp,nvar)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ieltsm
+integer ifac, iutile, ii
+integer ilelt, nlelt
+
+double precision vent, vent2
+double precision dh, ustar2
+double precision xkent, xeent
+double precision flucel
+double precision vtot , gamma
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+if(iappel.eq.1.or.iappel.eq.2) then
+
+!===============================================================================
+! 1. POUR CHAQUE PHASE : UN OU DEUX APPELS
+
+! PREMIER APPEL :
+
+! IAPPEL = 1 : NCESMP : CALCUL DU NOMBRE DE CELLULES
+! AVEC TERME SOURCE DE MASSE
+
+
+! DEUXIEME APPEL (POUR LES PHASES AVEC NCESMP > 0) :
+
+! IAPPEL = 2 : ICETSM : REPERAGE DU NUMERO DES CELLULES
+! AVEC TERME SOURCE DE MASSE
+
+
+! REMARQUES :
+
+! Ne pas utiliser SMACEL dans cette section
+! (il est rempli au troisieme appel, IAPPEL = 3)
+
+! Ne pas utiliser ICETSM dans cette section
+! au premier appel (IAPPEL = 1)
+
+! On passe ici a chaque pas de temps
+! (ATTENTION au cout calcul de vos developpements)
+
+!===============================================================================
+
+
+! 1.1 A completer par l'utilisateur : selection des cellules
+! -----------------------------------------------------------
+
+! Exemple 1 : Aucune source de masse (defaut)
+ ieltsm = 0
+
+
+! Exemple 2 : Sources de masse pour la phase 1
+! dans les cellules ayant une face de couleur 6
+! et dans les cellules dont le centre est a x < 2
+
+! Dans ce test en deux parties, il faut faire attention a
+! ne pas compter les cellules deux fois (une cellule dont une
+! face est couleur 6 peut aussi etre a x < 2, mais il ne
+! faut la compter qu'une seule fois). Il faut egalement noter
+! que lors du premier passage, le tableau ICETSM n'existe pas
+! encore (ne pas l'utiliser en dehors des tests IAPPEL.EQ.2).
+
+ iutile = 0
+ if(iutile.eq.1) then
+
+ if(iphas.eq.1) then
+
+ ieltsm = 0
+
+! Cellules dont le centre est a 250 < x < 500
+
+ CALL GETCEL('X < 500.0 and X > 250.0',NLELT,LSTELT)
+ do ilelt = 1, nlelt
+ ii = lstelt(ilelt)
+ ieltsm = ieltsm + 1
+ if (iappel.eq.2) icetsm(ieltsm) = ii
+ enddo
+
+
+! Cellules de bord dont une face est de couleur 3
+
+ CALL GETFBR('3',NLELT,LSTELT)
+ do ilelt = 1, nlelt
+ ifac = lstelt(ilelt)
+ ii = ifabor(ifac)
+! On ne comptabilise cette cellule que si on ne l'a pas deja vue
+! pour cela on prend la negation du test precedent
+ if (.not.(xyzcen(1,ii).lt.500.d0.and. &
+ xyzcen(1,ii).gt.250.d0) )then
+ ieltsm = ieltsm + 1
+ if (iappel.eq.2) icetsm(ieltsm) = ii
+ endif
+ enddo
+
+ else
+ ieltsm = 0
+ endif
+
+ endif
+
+
+! 1.2 Sous section generique a ne pas modifier
+! ---------------------------------------------
+
+! --- Pour IAPPEL = 1,
+! Renseigner NCESMP, nombre de cellules avec terme source de masse
+! Le bloc ci dessous est valable pourles 2 exemples ci dessus
+
+ if (iappel.eq.1) then
+ ncesmp = ieltsm
+ endif
+
+!-------------------------------------------------------------------------------
+
+elseif(iappel.eq.3) then
+
+!===============================================================================
+
+! 2. POUR CHAQUE PHASE AVEC NCESMP > 0 , TROISIEME APPEL
+
+! TROISIEME APPEL (POUR LES PHASES AVEC NCESMP > 0) :
+
+! IAPPEL = 3 : ITYPSM : TYPE DE SOURCE DE MASSE
+! SMACEL : SOURCE DE MASSE
+
+
+! REMARQUE :
+
+! ATTENTION, Si on positionne ITYPSM(IEL,IVAR) A 1, IL FAUT
+! egalement renseigner SMACEL(IEL,IVAR)
+
+!===============================================================================
+
+
+
+! 2.1 A completer par l'utilisateur ITYPSM et SMACEL
+! -----------------------------------------------------
+
+! Exemple 1 : simulation d'une entree par des termes de source de masse
+! et affichage du flux de masse total pour la phase 1
+
+ if(iphas.eq.1) then
+
+ vent = 0.1d0
+ vent2 = vent**2
+ dh = 0.5d0
+! Calcul de la vitesse de frottement au carre (USTAR2)
+! et de k et epsilon en entree (XKENT et XEENT) a partir
+! de lois standards en conduite circulaire
+! (leur initialisation est inutile mais plus propre)
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+
+ call keendb &
+ !==========
+ ( vent2, dh, ro0(iphas), viscl0(iphas), cmu, xkappa, &
+ ustar2, xkent, xeent )
+
+ flucel = 0.d0
+ do ieltsm = 1, ncesmp
+ smacel(ieltsm,ipr(iphas)) = 30000.d0
+ itypsm(ieltsm,iv(iphas)) = 1
+ smacel(ieltsm,iv(iphas)) = vent
+ if (itytur(iphas).eq.2) then
+ itypsm(ieltsm,ik(iphas)) = 1
+ smacel(ieltsm,ik(iphas)) = xkent
+ itypsm(ieltsm,iep(iphas)) = 1
+ smacel(ieltsm,iep(iphas)) = xeent
+ else if (itytur(iphas).eq.3) then
+ itypsm(ieltsm,ir11(iphas)) = 1
+ itypsm(ieltsm,ir12(iphas)) = 1
+ itypsm(ieltsm,ir13(iphas)) = 1
+ itypsm(ieltsm,ir22(iphas)) = 1
+ itypsm(ieltsm,ir23(iphas)) = 1
+ itypsm(ieltsm,ir33(iphas)) = 1
+ smacel(ieltsm,ir11(iphas)) = 2.d0/3.d0*xkent
+ smacel(ieltsm,ir12(iphas)) = 0.d0
+ smacel(ieltsm,ir13(iphas)) = 0.d0
+ smacel(ieltsm,ir22(iphas)) = 2.d0/3.d0*xkent
+ smacel(ieltsm,ir23(iphas)) = 0.d0
+ smacel(ieltsm,ir33(iphas)) = 2.d0/3.d0*xkent
+ itypsm(ieltsm,iep(iphas)) = 1
+ smacel(ieltsm,iep(iphas)) = xeent
+ else if (iturb(iphas).eq.50) then
+ itypsm(ieltsm,ik(iphas)) = 1
+ smacel(ieltsm,ik(iphas)) = xkent
+ itypsm(ieltsm,iep(iphas)) = 1
+ smacel(ieltsm,iep(iphas)) = xeent
+ itypsm(ieltsm,iphi(iphas)) = 1
+ smacel(ieltsm,iphi(iphas)) = 2.d0/3.d0
+! Il n'y a pas de terme source de masse dans l'equation de f_barre
+ else if (iturb(iphas).eq.60) then
+ itypsm(ieltsm,ik(iphas)) = 1
+ smacel(ieltsm,ik(iphas)) = xkent
+ itypsm(ieltsm,iomg(iphas))= 1
+ smacel(ieltsm,iomg(iphas))= xeent/cmu/xkent
+ endif
+ if(nscal.gt.0) then
+ do ii = 1, nscal
+ if(iphsca(ii).eq.iphas) then
+ itypsm(ieltsm,isca(ii)) = 1
+ smacel(ieltsm,isca(ii)) = 1.d0
+ endif
+ enddo
+ endif
+ flucel = flucel+ &
+ volume(icetsm(ieltsm))*smacel(ieltsm,ipr(iphas))
+ enddo
+
+ if (irangp.ge.0) then
+ call parsom (flucel)
+ endif
+
+ if (iwarni(ipr(iphas)).ge.1) then
+ write(nfecra,1000) iphas, flucel
+ endif
+
+ endif
+
+!-------------------------------------------------------------------------------
+
+! Exemple 2 : simulation d'un soutirage (par une pompe par exemple)
+! total de 80 000 kg/s
+! On suppose que l'on souhaite repartir uniformement ce
+! puits de masse sur les NCESMP cellules selectionnees
+! plus haut.
+
+
+! Le test sur IUTILE permet de ne pas passer dans l'exemple si
+! on oublie de l'eliminer, lors de la mise en place d'un calcul
+! reel.
+
+ iutile = 0
+ if(iutile.eq.1) then
+
+ if(iphas.eq.1) then
+
+! Calcul du volume total de la zone ou est impose le terme source
+! (le cas des calculs paralleles est prevu avec parsom)
+ vtot = 0.d0
+ do ieltsm = 1, ncesmp
+ vtot = vtot + volume(icetsm(ieltsm))
+ enddo
+ if (irangp.ge.0) then
+ call parsom (vtot)
+ endif
+
+! Le puits de masse est GAMMA = -80000/VTOT en kg/(m3 s)
+! (quel que soit le nombre de cellules NCESMP)
+! On l'impose ci-dessous (avec un test au cas ou VTOT=0)
+! On calcule au passage le terme puits total pour verification.
+
+ if (vtot.gt.0.d0) then
+ gamma = -80000.d0/vtot
+ else
+ write(nfecra,9000) iphas, vtot
+ call csexit (1)
+ endif
+
+ flucel = 0.d0
+ do ieltsm = 1, ncesmp
+ smacel(ieltsm,ipr(iphas)) = gamma
+ flucel = flucel+ &
+ volume(icetsm(ieltsm))*smacel(ieltsm,ipr(iphas))
+ enddo
+
+ if (irangp.ge.0) then
+ call parsom (flucel)
+ endif
+
+ if (iwarni(ipr(iphas)).ge.1) then
+ write(nfecra,2000) iphas, flucel, vtot
+ endif
+
+ endif
+
+ endif
+
+!-------------------------------------------------------------------------------
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(/,'PHASE ',I3, &
+ ' : FLUX DE MASSE GENERE DANS LE DOMAINE : ',E14.5,/)
+
+ 2000 format(/,'PHASE ',I3, &
+ ' : FLUX DE MASSE GENERE DANS LE DOMAINE : ',E14.5,/, &
+' REPARTI SUR UN VOLUME : ',E14.5)
+
+ 9000 format(/,'PHASE ',I3, &
+ ' : ERREUR DANS USTSMA ',/, &
+' LE VOLUME DE LA ZONE AVEC PUITS DE MASSE VAUT = ',E14.5,/)
+
+return
+
+end
diff --git a/users/base/ustsns.f90 b/users/base/ustsns.f90
new file mode 100644
index 0000000..a616b2b
--- /dev/null
+++ b/users/base/ustsns.f90
@@ -0,0 +1,367 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ustsns &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ crvexp , crvimp , &
+ dam , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE UTILSATEUR ON PRECISE LES TERMES SOURCES UTILISATEURS
+! POUR LA COMPOSANTE DE VITESSE IVAR
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT RHO*VOLUME)
+! CRVEXP en kg variable/s :
+! ex : pour la vitesse kg m/s2
+! CRVIMP en kg /s :
+
+! VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CRVEXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CRVIMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ivar ! e ! <-- ! numero de variable !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
+! crvimp(ncelet ! tr ! --> ! tableau de travail pour part implicit !
+! dam(ncelet ! tr ! --- ! tableau de travail pour matrice !
+! xam(nfac,*) ! tr ! --- ! tableau de travail pour matrice !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer ivar , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision dam(ncelet ),xam(nfac ,2)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer iel, ipcrom, ipp, iutile
+double precision ckp, qdm
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+ipp = ipprtp(ivar)
+
+if(iwarni(ivar).ge.1) then
+ chaine = nomvar(ipp)
+ write(nfecra,1000) chaine(1:8)
+endif
+
+ipcrom = ipproc(irom (iphas))
+
+
+!===============================================================================
+! 2. EXEMPLE DE TERME SOURCE ARBITRAIRE, POUR LA VARIABLE U :
+
+! S = A * U + B
+
+! APPARAISSANT DANS LES EQUATIONS SOUS LA FORME :
+
+! RHO VOLUME D(U)/Dt = VOLUME*S
+
+
+! CE TERME A UNE PARTIE QU'ON VEUT IMPLICITER : A
+! ET UNE PARTIE QU'ON VA TRAITER EN EXPLICITE : B
+
+
+! ICI PAR EXEMPLE ARBITRAIREMENT :
+
+! A = - RHO CKP
+! B = QDM
+! AVEC
+! CKP = 10.D0 [1/s ] (COEFFICIENT DE RAPPEL SUR U)
+! QDM = 100.D0 [kg/(m2 s2)] (PRODUCTION DE QUANTITE DE MOUVEMENT
+! PAR UNITE DE VOLUME ET PAR UNITE DE TEMPS)
+
+! ON A ALORS
+! CRVIMP(IEL) = VOLUME(IEL)* A = - VOLUME(IEL) (RHO CKP )
+! CRVEXP(IEL) = VOLUME(IEL)* B = VOLUME(IEL) (QDM )
+
+! ON REMPLIT CI-DESSOUS CRVIMP ET CRVEXP CORRESPONDANTS.
+
+!===============================================================================
+
+
+
+! ATTENTION, L'EXEMPLE EST COMPLETEMENT ARBITRAIRE
+! =========
+! ET DOIT ETRE REMPLACE PAR LES TERMES UTILISATEURS ADEQUATS
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+ckp = 10.d0
+qdm = 100.d0
+
+do iel = 1, ncel
+ crvimp(iel) = - volume(iel)*propce(iel,ipcrom)*ckp
+enddo
+
+do iel = 1, ncel
+ crvexp(iel) = volume(iel)*qdm
+enddo
+
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES UTILISATEURS POUR LA VARIABLE ',A8,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/base/ustsri.f90 b/users/base/ustsri.f90
new file mode 100644
index 0000000..77ea819
--- /dev/null
+++ b/users/base/ustsri.f90
@@ -0,0 +1,394 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ustsri &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itpsmp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smcelp , gamma , grdvit , produc , &
+ crvexp , crvimp , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE UTILISATEUR ON PRECISE LES TERMES SOURCES UTILISATEURS
+! EN RIJ-EPSILON ET POUR LES VARIABLES RIJ ET EPSILON
+! SUR UN PAS DE TEMPS (PHASE IPHAS)
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT RHO*VOLUME)
+! CRVEXP en kg variable/s :
+! ex : pour Rij kg m2/s3
+! pour epsilon kg m2/s4
+! CRVIMP en kg /s :
+
+! VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CRVEXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CRVIMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+! PRODUC = 2 (S11)**2 + 2 (S22)**2 + 2 (S33)**2
+! + (2 S12)**2 + (2 S13)**2 + (2 S23)**2 )
+! DIVU = DUDX + DVDY + DWDZ
+
+! Sij = (dUi/dxj+dUj/dxi)/2
+
+! Le terme de production est stocke dans PRODUC (6,CNELET).
+! Le terme de gardient de vitesse est stocke dans GRDVIT(NCELET,3,3)
+! ATTENTION : PRODUC n'est defini que pour ITURB=30 et GRDVIT n'est
+! defini que pour ITURB=31.
+! RISQUE D'ECRASEMENT DE TABLEAUX !! !
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itpsmp ! te ! <-- ! type de source de masse pour la !
+! (ncesmp) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smcelp(ncesmp ! tr ! <-- ! valeur de la variable associee a la !
+! ! ! ! source de masse !
+! gamma(ncesmp) ! tr ! <-- ! valeur du flux de masse !
+! grdvit ! tr ! --- ! tableau de travail pour terme grad !
+! (ncelet,3,3) ! ! ! de vitesse uniqt pour iturb=31 !
+! produc ! tr ! <-- ! tableau de travail pour production !
+! (6,ncelet) ! ! ! (sans rho volume) uniqt pour iturb=30 !
+! crvexp(ncelet ! tr ! --> ! tableau pour source partie explicite !
+! crvimp(ncelet ! tr ! --> ! tableau pour source partie implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itpsmp(ncesmp)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6)
+double precision smcelp(ncesmp), gamma(ncesmp)
+double precision grdvit(ncelet,3,3), produc(6,ncelet)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ir11ip, ieiph, iphas0, ipcrom
+double precision ff, tau, xx
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables k et epsilon de la phase IPHAS courante
+ir11ip = ir11(iphas)
+ieiph = iep (iphas)
+
+! --- Numero des grandeurs physiques (voir usclim) : masse volumique
+ipcrom = ipproc(irom(iphas))
+
+if(iwarni(ir11ip).ge.1) then
+ write(nfecra,1000) iphas
+endif
+
+!===============================================================================
+! 2. EXEMPLE FICTIF :
+
+! Pour la phase 2
+
+! Terme source R11 :
+! rho volume d(R11)/dt = ...
+! ... - rho*volume*ff*epsilon - rho*volume*R11/tau
+
+! Terme source epsilon :
+! rho volume d(epsilon)/dt = ...
+! ... + rho*volume*xx
+
+! Avec, pour l'exemple,
+! xx = 2.d0, ff=3.d0, tau = 4.d0
+
+!===============================================================================
+
+iphas0 = 2
+
+
+! --- Pour R11 Phase 2
+! ----------------
+
+if(ivar.eq.ir11(iphas0)) then
+
+ ff = 3.d0
+ tau = 4.d0
+
+! -- Termes sources explicites
+
+ do iel = 1, ncel
+ crvexp(iel) = -propce(iel,ipcrom)*volume(iel) &
+ *ff*rtpa(iel,ieiph)
+ enddo
+
+! -- Termes sources implicites (diagonale)
+
+ do iel = 1, ncel
+ crvimp(iel) = -propce(iel,ipcrom)*volume(iel)/tau
+ enddo
+
+
+! --- Pour epsilon Phase 2
+! --------------------
+
+elseif(ivar.eq.iep(iphas0)) then
+
+ xx = 2.d0
+
+! -- Termes sources explicites
+
+ do iel = 1, ncel
+ crvexp(iel) = propce(iel,ipcrom)*volume(iel)*xx
+ enddo
+
+! -- Termes sources implicites (diagonale) : nuls
+
+! CRVIMP est initialise a zero avant l'entree dans ce
+! sous-programme : il est donc inutile de le completer
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES UTILISATEURS RIJ-EPSILON PHASE ',I4,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/base/ustssc.f90 b/users/base/ustssc.f90
new file mode 100644
index 0000000..37de347
--- /dev/null
+++ b/users/base/ustssc.f90
@@ -0,0 +1,486 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine ustssc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iscal , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ crvexp , crvimp , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE UTILISATEUR
+! ON PRECISE LES TERMES SOURCES UTILISATEURS
+! POUR UN SCALAIRE SUR UN PAS DE TEMPS
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT RHO*VOLUME)
+! CRVEXP en kg variable/s :
+! ex : pour les temperatures kg degres/s
+! pour les enthalpies Joules/s
+! CRVIMP en kg /s :
+
+! VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CRVEXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CRVIMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+
+! IDENTIFICATION DES CELLULES/FACES DE BORD/FACES INTERNES
+! ========================================================
+
+! Les commandes GETCEL, GETFBR et GETFAC permettent d'identifier
+! respectivement les cellules, faces ou faces de bord en fonction
+! de differents criteres.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! La syntaxe des commandes GETFBR et GETFAC est identique.
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iscal ! e ! <-- ! numero du scalaire !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! crvexp(ncelet ! tr ! --> ! tableau de travail pour part explicit !
+! crvimp(ncelet ! tr ! --> ! tableau de travail pour terme instat !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iscal
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*80 chaine
+integer idebia, idebra
+integer ivar, iiscvr, ipcrom, iel, iphas, iutile
+integer ilelt, nlelt
+
+double precision tauf, prodf, volf, pwatt
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero du scalaire a traiter : ISCAL
+
+! ISCAL est une donnee d'entree de ce sous programme
+! qui indique quel scalaire on est en train de traiter
+! en effet ce sous programme est appele successivement pour
+! tous les scalaires du calcul.
+! ISCAL ne doit pas etre modifie par l'utilisateur
+
+! Si le calcul comporte plusieurs scalaires (de 1 a n par exemple)
+! et que l'on souhaite imposer des termes sources pour un
+! scalaire p donne, on doit utiliser ISCAL ici :
+! CRVIMP et CRVEXP ne seront renseignes que "IF(ISCAL.EQ.p)"
+
+
+! --- Numero de la variable associee au scalaire a traiter ISCAL
+ivar = isca(iscal)
+
+! --- Nom de la variable associee au scalaire a traiter ISCAL
+chaine = nomvar(ipprtp(ivar))
+
+! --- Indicateur de variance
+! Si ISCAVR = 0 :
+! le scalaire ISCAL n'est pas une variance
+! Si ISCAVR > 0 et ISCAVR < NSCAL + 1 :
+! le scalaire ISCAL est une variance associee
+! au scalaire ISCAVR
+iiscvr = iscavr(iscal)
+
+! --- Numero de phase associee au scalaire ISCAL
+iphas = iphsca(iscal)
+
+! --- Numero des grandeurs physiques (voir usclim)
+ipcrom = ipproc(irom(iphas))
+
+if(iwarni(ivar).ge.1) then
+ write(nfecra,1000) chaine(1:8)
+endif
+
+
+!===============================================================================
+! 2. EXEMPLE DE TERME SOURCE ARBITRAIRE, POUR LA VARIABLE F :
+
+! S = A * F + B
+
+! APPARAISSANT DANS LES EQUATIONS SOUS LA FORME :
+
+! RHO VOLUME D(F)/Dt = VOLUME*S
+
+
+! CE TERME A UNE PARTIE QU'ON VEUT IMPLICITER : A
+! ET UNE PARTIE QU'ON VA TRAITER EN EXPLICITE : B
+
+
+! ICI PAR EXEMPLE ARBITRAIREMENT :
+
+! A = - RHO / TAUF
+! B = RHO * PRODF
+! AVEC
+! TAUF = 10.D0 [secondes ] (TEMPS DE DISSIPATION DE F)
+! PRODF = 100.D0 [variable/s] (PRODUCTION DE F PAR UNITE DE TEMPS)
+
+! ON A ALORS
+! CRVIMP(IEL) = VOLUME(IEL)* A = - VOLUME(IEL) (RHO / TAUF )
+! CRVEXP(IEL) = VOLUME(IEL)* B = VOLUME(IEL) (RHO * PRODF)
+
+! ON REMPLIT CI-DESSOUS CRVIMP ET CRVEXP CORRESPONDANTS.
+
+!===============================================================================
+
+
+
+! ATTENTION, L'EXEMPLE EST COMPLETEMENT ARBITRAIRE
+! =========
+! ET DOIT ETRE REMPLACE PAR LES TERMES UTILISATEURS ADEQUATS
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+tauf = 10.d0
+prodf = 100.d0
+
+do iel = 1, ncel
+ crvimp(iel) = - volume(iel)*propce(iel,ipcrom)/tauf
+enddo
+
+do iel = 1, ncel
+ crvexp(iel) = volume(iel)*propce(iel,ipcrom)*prodf
+enddo
+
+!===============================================================================
+! 3. EXEMPLE DE TERME SOURCE ARBITRAIRE, POUR LA VARIABLE F = ENTHALPIE :
+
+! IL S'AGIT D'UNE PARTICULARISATION DE L'EXEMPLE PRECEDENT AVEC
+
+! S = B
+
+! APPARAISSANT DANS LES EQUATIONS SOUS LA FORME :
+
+! RHO VOLUME D(F)/Dt = VOLUME*S
+
+
+! IL N'Y A RIEN A IMPLICITER, ON PEUT DONC IMPOSER
+
+! CRVIMP(IEL) = 0.D0
+
+
+! CE TERME A UNE PARTIE QU'ON VA TRAITER EN EXPLICITE : B
+
+! SI F EST UNE ENTHALPIE (J/kg), ON AURA ALORS B EN Watt/m3
+
+! SI ON CONNAIT LA PUISSANCE PWATT A INTRODUIRE UNIFORMEMENT DANS UN
+! VOLUME DONNE VOLF TEL QUE 0<X<1.2, 3.1<Y<4, ON POURRA ALORS
+! ECRIRE, POUR LES CELLULES DU MAILLAGE CONCERNEES :
+
+! CRVEXP(IEL) = VOLUME(IEL)* B = VOLUME(IEL)*(PWATT/VOLF)
+
+
+!===============================================================================
+
+
+
+! ATTENTION, L'EXEMPLE EST COMPLETEMENT ARBITRAIRE
+! =========
+! ET DOIT ETRE REMPLACE PAR LES TERMES UTILISATEURS ADEQUATS
+
+
+! ----------------------------------------------
+
+! Il est assez courant que l'on oublie d'eliminer cet exemple
+! de ce sous-programme.
+! On a donc prevu le test suivant pour eviter les mauvaises surprises
+
+iutile = 0
+
+if(iutile.eq.0) return
+
+! ----------------------------------------------
+
+! PUISSANCE A INTRODUIRE DANS VOLF
+! ATTENTION on suppose qu'on travaille en enthalpie,
+! si on travaille en temperature, il ne faut pas oublier de
+! diviser PWATT par Cp.
+
+pwatt = 100.d0
+
+! CALCUL DE VOLF
+
+volf = 0.d0
+CALL GETCEL('X > 0.0 and X < 1.2 and Y > 3.1 and'// &
+ 'Y < 4.0',NLELT,LSTELT)
+
+do ilelt = 1, nlelt
+ iel = lstelt(ilelt)
+ volf = volf + volume(iel)
+enddo
+
+do ilelt = 1, nlelt
+ iel = lstelt(ilelt)
+! PAS DE TERME IMPLICITE
+ crvimp(iel) = 0.d0
+! PUISSANCE EN EXPLICITE
+ crvexp(iel) = volume(iel)*pwatt/volf
+enddo
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES UTILISATEURS POUR LA VARIABLE ',A8,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/base/ustsv2.f90 b/users/base/ustsv2.f90
new file mode 100644
index 0000000..d772bdd
--- /dev/null
+++ b/users/base/ustsv2.f90
@@ -0,0 +1,401 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine ustsv2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , ivar , isou , ipp , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , produc , gphigk , &
+ crvexp , crvimp , &
+ viscf , viscb , xam , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ w7 , w8 , w9 , w10 , w11 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE UTILISATEUR ON PRECISE LES TERMES SOURCES UTILISATEURS
+! EN V2F ET POUR LES VARIABLES F_BARRE ET PHI
+! SUR UN PAS DE TEMPS (PHASE IPHAS)
+
+! POUR VAR = F_BARRE :
+! ====================
+
+! ON RESOUT VOLUME*DIV(GRAD VAR) =
+! ( VOLUME*F_BARRE + ... + CRVIMP*VAR + CRVEXP ) /L^2
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT VOLUME)
+! F_BARRE est en m3/s
+! CRVEXP est en m3/s
+! CRVIMP est en m3
+
+! POUR VAR = PHI :
+! ================
+
+! ON RESOUT RHO*VOLUME*D(VAR)/DT = ... + CRVIMP*VAR + CRVEXP
+
+! ON FOURNIT ICI CRVIMP ET CRVEXP (ILS CONTIENNENT VOLUME)
+! PHI est sans dimension
+! CRVEXP est en kg/s
+! CRVIMP est en kg/s
+
+! POUR PHI, VEILLER A UTILISER UN CRVIMP NEGATIF
+! (ON IMPLICITERA CRVIMP
+! IE SUR LA DIAGONALE DE LA MATRICE, LE CODE AJOUTERA :
+! MAX(-CRVIMP,0) EN SCHEMA STANDARD EN TEMPS
+! -CRVIMP SI LES TERMES SOURCES SONT A L'ORDRE 2
+! (POUR F_BARRE PAR DE PROBLEME CAR LA MATRICE EST SYMETRIQUE
+! ET ON RESOUT DONC PAR GRADIENT CONJUGUE)
+
+! CES TABLEAUX SONT INITIALISES A ZERO AVANT APPEL A CE SOUS
+! PROGRAMME ET AJOUTES ENSUITE AUX TABLEAUX PRIS EN COMPTE
+! POUR LA RESOLUTION
+
+! EN CAS D'ORDRE 2 DEMANDE SUR LES TERMES SOURCES, ON DOIT
+! FOURNIR CRVEXP A L'INSTANT N (IL SERA EXTRAPOLE) ET
+! CRVIMP A L'INSTANT N+1/2 (IL EST DANS LA MATRICE,
+! ON LE SUPPOSE NEGATIF)
+
+
+
+! PRODUC contient la production de k :
+! 2*mu_t*Sij*Sij -2/3*rho*k*div(u) -2/3*mu_t*div(u)**2 + terme eventuel de gravite
+! GPHIGK contient le produit scalaire grad phi*grad k
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ivar ! e ! <-- ! numero de variable !
+! isou ! e ! <-- ! numero de passage !
+! ipp ! e ! <-- ! numero de variable pour sorties post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! gphigk(ncelet ! tr ! --- ! tableau de travail contenant le prod !
+! ! ! ! grad phi * grad k !
+! produc(ncelet ! tr ! --- ! tableau de travail contenant la !
+! ! ! ! la production p de l'eq de k !
+! crvexp(ncelet ! tr ! --> ! tableau pour source partie explicite !
+! crvimp(ncelet ! tr ! --> ! tableau pour source partie implicite !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! xam(nfac,2) ! tr ! --- ! tableau de travail faces de bord !
+! w1..11(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , ivar , isou , ipp
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision crvexp(ncelet), crvimp(ncelet)
+double precision viscf(nfac), viscb(nfabor)
+double precision produc(ncelet), gphigk(ncelet)
+double precision xam(nfac,2)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision w10(ncelet), w11(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ifbiph, iphiph, iphas0, ipcrom
+double precision ff, tau, xx
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables k et epsilon de la phase IPHAS courante
+ifbiph = ifb (iphas)
+iphiph = iphi(iphas)
+
+! --- Numero des grandeurs physiques (voir usclim) : masse volumique
+ipcrom = ipproc(irom(iphas))
+
+if(iwarni(ifbiph).ge.1) then
+ write(nfecra,1000) iphas
+endif
+
+!===============================================================================
+! 2. EXEMPLE FICTIF :
+
+! Pour la phase 2
+
+! Terme source f_barre :
+! volume div(grad f_barre) = ...
+! ... - volume*ff*phi - volume*f_barre/tau
+
+! Terme source phi :
+! rho volume d(phi)/dt = ...
+! ... + rho*volume*xx
+
+! Avec, pour l'exemple,
+! xx = 2.d0, ff=3.d0, tau = 4.d0
+
+!===============================================================================
+
+iphas0 = 2
+
+
+! --- Pour f_barre Phase 2
+! ---------------------
+
+if(ivar.eq.ifb(iphas0)) then
+
+ ff = 3.d0
+ tau = 4.d0
+
+! -- Termes sources explicites
+
+ do iel = 1, ncel
+ crvexp(iel) = -volume(iel)*ff*rtpa(iel,iphiph)
+ enddo
+
+! -- Termes sources implicites (diagonale)
+
+ do iel = 1, ncel
+ crvimp(iel) = -volume(iel)/tau
+ enddo
+
+
+! --- Pour phi Phase 2
+! --------------------
+
+elseif(ivar.eq.iep(iphas)) then
+
+ xx = 2.d0
+
+! -- Termes sources explicites
+
+ do iel = 1, ncel
+ crvexp(iel) = propce(iel,ipcrom)*volume(iel)*xx
+ enddo
+
+! -- Termes sources implicites (diagonale) : nuls
+
+! CRVIMP est initialise a zero avant l'entree dans ce
+! sous-programme : il est donc inutile de le completer
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(' TERMES SOURCES UTILISATEURS V2F PHASE ',I4,/)
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/base/usvima.f90 b/users/base/usvima.f90
new file mode 100644
index 0000000..afc1b69
--- /dev/null
+++ b/users/base/usvima.f90
@@ -0,0 +1,261 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usvima &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ viscmx , viscmy , viscmz , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LA METHODE ALE :
+! MODIFICATION DE LA VISCOSITE DE MAILLAGE
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! On peut modifier la viscosite de maillage pour limiter
+! la deformation de maillage dans les zones sensibles (couche
+! limite par exemple)
+
+! Si IORTVM = 0, la viscosite de maillage est isotrope. Il suffit
+! de remplir VISCMX.
+! Si IORTVM = 1, la viscosite de maillage est orthotrope, on
+! remplit VISCMX, VISCMY et VISCMZ
+
+! Les tableaux sont initialises a 1 au premier pas de temps.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! viscma(ncelet ! tr ! <-- ! viscoste de maillage !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "albase.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision viscmx(ncelet), viscmy(ncelet), viscmz(ncelet)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel
+double precision xray2, xr2, xcen, ycen, zcen
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. Exemple :
+! On met une valeur tres forte de viscosite pour les points situes
+! a moins de R d'un centre (par exemple pour limiter les
+! deformations en proche paroi d'un cylindre mobile)
+
+
+! En general on specifie les zones de viscosite de maille
+! sur la geometrie initiale, c'est plus facile.
+
+if (ntcabs.eq.0) then
+ xray2 = (1.d-3)**2
+ xcen = 1.d0
+ ycen = 0.d0
+ zcen = 0.d0
+
+ do iel = 1, ncel
+ xr2 = (xyzcen(1,iel)-xcen)**2 + (xyzcen(2,iel)-ycen)**2 &
+ + (xyzcen(3,iel)-zcen)**2
+ if (xr2.lt.xray2) viscmx(iel) = 1.d10
+ enddo
+
+! 2. Si on a une viscosite orthotrope, on peut choisir de moins
+! contraindre le mouvement des noeuds selon z
+ if (iortvm.eq.1) then
+ do iel = 1, ncel
+ viscmy(iel) = viscmx(iel)
+ viscmz(iel) = 1.d0
+ enddo
+ endif
+
+endif
+!----
+! FORMAT
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/usvist.f90 b/users/base/usvist.f90
new file mode 100644
index 0000000..0eccb7a
--- /dev/null
+++ b/users/base/usvist.f90
@@ -0,0 +1,346 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usvist &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , ncepdp , ncesmp , &
+ nideve , nrdeve , nituse , nrtuse , iphas , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , icepdc , icetsm , itypsm , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , ckupdc , smacel , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : MODIFICATION DE LA VISCOSITE TURBULENTE
+
+! Cette routine est appelee au debut de chaque pas de temps
+! apres le calcul de la viscosite turbulente
+! (les grandeurs physiques ont ete calculees dans USPHYV)
+
+! On peut modifier la viscosite turbulente VISCT (kg/(m s))
+
+! La modification de la viscosite turbulente peut conduire a des
+! ecarts tres importants sur la solution et eventuellement
+! A DES RESULTATS ERRONES.
+
+
+
+! L'UTILISATION DE CE SOUS PROGRAMME EST DONC RESERVEE A
+
+! DES UTILISATEURS TRES AVERTIS
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncepdp ! e ! <-- ! nombre de cellules avec pdc !
+! ncesmp ! e ! <-- ! nombre de cellules a source de masse !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de phase !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icepdc(ncelet ! te ! <-- ! numero des ncepdp cellules avec pdc !
+! icetsm(ncesmp ! te ! <-- ! numero des cellules a source de masse !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ckupdc ! tr ! <-- ! tableau de travail pour pdc !
+! (ncepdp,6) ! ! ! !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncepdp , ncesmp
+integer nideve , nrdeve , nituse , nrtuse , iphas
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icepdc(ncepdp)
+integer icetsm(ncesmp), itypsm(ncesmp,nvar)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision ckupdc(ncepdp,6), smacel(ncesmp,nvar)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iccocg, inc
+integer iuiph, iviph, iwiph
+integer ipcliu, ipcliv, ipcliw
+integer ipcrom, ipcvst, iphydp
+double precision dudx, dudy, dudz, sqdu, visct, rom
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. Exemple :
+! Pour la phase 1,
+! VISCT = MAX(VISCT,ROM *SQRT(DUDX**2+DUDX**2+DUDX**2))
+! (relation volontairement fantaisiste)
+! Noter qu'on entre dans ce sous pgm en ayant calcule la
+! viscosite conformement au modele de turbulence choisi
+! Pour les autres phases,
+! on conserve la viscosite standard du modele de
+! turbulence selectionne
+
+!===============================================================================
+
+!===============================================================================
+! 1.1 SELECTION DE LA PHASE A TRAITER
+!===============================================================================
+
+if(iphas.ne.1) then
+ return
+endif
+
+!===============================================================================
+! 1.2 INITIALISATION
+!===============================================================================
+
+! --- Memoire
+idebia = idbia0
+idebra = idbra0
+
+! --- Numero des variables (dans RTP)
+iuiph = iu(iphas)
+iviph = iv(iphas)
+iwiph = iw(iphas)
+
+! --- Rang des variables dans PROPCE (prop. physiques au centre)
+ipcvst = ipproc(ivisct(iphas))
+ipcrom = ipproc(irom (iphas))
+
+! --- Rang des c.l. des variables dans COEFA COEFB
+! (c.l. std, i.e. non flux)
+ipcliu = iclrtp(iuiph,icoef)
+ipcliv = iclrtp(iviph,icoef)
+ipcliw = iclrtp(iwiph,icoef)
+
+!===============================================================================
+! 1.3 CALCUL DU GRADIENT DE U
+!===============================================================================
+
+iccocg = 1
+inc = 1
+iphydp = 0
+
+! W1 = DUDX, W2 = DUDY, W3=DUDZ
+
+call grdcel &
+!==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iuiph , imrgra , inc , iccocg , iphydp , &
+ nswrgr(iuiph) , imligr(iuiph) , &
+ iwarni(iuiph) , nfecra , &
+ epsrgr(iuiph) , climgr(iuiph) , extrag(iuiph) , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ w6 , w6 , w6 , &
+ rtpa(1,iuiph) , coefa(1,ipcliu) , coefb(1,ipcliu) , &
+ w1 , w2 , w3 , &
+! ------ ------ ------
+ w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! 1.4 CALCUL DE LA VISCOSITE DYNAMIQUE
+!===============================================================================
+
+do iel = 1, ncel
+
+! --- Viscosite dynamique et masse volumique en entree de sous pgm
+ visct = propce(iel,ipcvst)
+ rom = propce(iel,ipcrom)
+
+! --- Calculs divers
+ dudx = w1(iel)
+ dudy = w2(iel)
+ dudz = w3(iel)
+ sqdu = sqrt(dudx**2+dudy**2+dudz**2)
+
+! --- Calcul de la nouvelle viscosite dynamique
+ visct = max (visct,rom*sqdu)
+
+! --- Affectation de la nouvelle viscosite dynamique calculee
+ propce(iel,ipcvst) = visct
+
+enddo
+
+!----
+! FORMAT
+!----
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/base/usvort.f90 b/users/base/usvort.f90
new file mode 100644
index 0000000..eafc6bb
--- /dev/null
+++ b/users/base/usvort.f90
@@ -0,0 +1,584 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usvort &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ iphas , iappel , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , irepvo , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! METHODE DES VORTEX POUR LES CONDITIONS AUX LIMITES D'ENTREE
+! EN L.E.S. :
+! DEFINITION DES ENTREES AVEC VORTEX
+! DEFINITION DES CARACTERISTIQUES DES VORTEX
+
+
+! IDENTIFICATION DES FACES DE BORD
+! ================================
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! iphas ! e ! <-- ! numero de la phase !
+! iappel ! e ! <-- ! indique les donnes a renvoyer !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! irepvo ! te ! <-- ! numero de l'entree associe a chaque !
+! (nfabor) ! ! ! face de bord (=0 si pas de vortex) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+include "vortex.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+integer iphas , iappel
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer irepvo(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer ifac, ient
+integer ilelt, nlelt
+
+!===============================================================================
+! 1. PARAMETRES GLOBAUX
+!===============================================================================
+
+! --- Nombre d'entrees avec la methode des vortex
+
+nnent = 2
+
+! --- Nombre de vortex a mettre dans chaque entree
+
+! NVORT min ~ Surface d'entree/(pi*SIGMA**2)
+
+nvort(1) = 500
+nvort(2) = 500
+
+if (iappel.eq.1) then
+
+!===============================================================================
+! 2. DEFINITION DES ZONES D'ENTREE (AU PREMIER PASSAGE)
+!===============================================================================
+
+ do ifac = 1, nfabor
+ irepvo(ifac) = 0
+ enddo
+
+! ------------------
+! ENTREE 1
+! ------------------
+ CALL GETFBR('3',NLELT,LSTELT)
+ !==========
+
+ do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ient = 1
+ irepvo(ifac) = ient
+
+ enddo
+
+! ------------------
+! ENTREE 2
+! ------------------
+ CALL GETFBR('1',NLELT,LSTELT)
+ !==========
+
+ do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ ient = 2
+ irepvo(ifac) = ient
+
+ enddo
+
+elseif (iappel.eq.2) then
+
+!===============================================================================
+! 3. PARAMETRES GEOMETRIQUES ET CONDITIONS LIMITES
+!===============================================================================
+
+! --- Cas trait�
+
+! ICAS = 1...Conduite rectangulaire
+! 2...Conduite circulaire
+! 3...Geometrie quelconque sans traitement specifique des conditions aux limites
+! 4...Geometrie quelconque sans traitement specifique des conditions aux limites
+! ni fichier de donnees (la vitesse moyenne, le niveau de k et de epsilon
+! sont fournis par l'utilisateur)
+
+ ient = 1
+ icas(ient) = 1
+
+ ient = 2
+ icas(ient) = 2
+
+
+! --- Repere definissant le plan d'entree
+
+! Si ICAS = 4, le code se charge de ces donnees
+! Sinon il faut preciser les vecteurs DIR1 et DIR2 definissant
+! un rep�re directe tel que DIR3 soit un vecteur entrant normal
+! a la face d'entree.
+
+ ient = 1
+ if(icas(ient).eq.1.or.icas(ient).eq.2.or.icas(ient).eq.3) then
+ dir1(1,ient) = 1.d0
+ dir1(2,ient) = 0.d0
+ dir1(3,ient) = 0.d0
+
+ dir2(1,ient) = 0.d0
+ dir2(2,ient) = 1.d0
+ dir2(3,ient) = 0.d0
+ endif
+
+ ient = 2
+ if(icas(ient).eq.1.or.icas(ient).eq.2.or.icas(ient).eq.3) then
+ dir1(1,ient) = 0.d0
+ dir1(2,ient) = 1.d0
+ dir1(3,ient) = 0.d0
+
+ dir2(1,ient) = 0.d0
+ dir2(2,ient) = 0.d0
+ dir2(3,ient) = 1.d0
+ endif
+
+! --- Centre du repere local dans le plan d'entree
+
+! Si ICAS = 1 ou ICAS = 2, le centre du repere doit correspondre
+! au centre de gravite de la zone d'entree (rectangle ou cercle)
+
+ ient = 1
+
+ cen(1,ient) = 0.d0
+ cen(2,ient) = 0.d0
+ cen(3,ient) = -6.05d-1
+
+ ient = 2
+
+ cen(1,ient) = -3.664d-1
+ cen(2,ient) = 0.d0
+ cen(3,ient) = 0.d0
+
+! --- Condition aux limites
+
+! -> Si ICAS = 1...Il faut specifier le type de condition aux limite ICLVOR
+! dans les directions DIR1, DIR2, - DIR1, -DIR2
+
+! Ces conditions peuvent etre de 3 types :
+
+! ICLVOR = 1...Condition de paroi
+! 2...Condition de symetrie
+! 3...Condition de periodicite
+
+! y = LLY/2
+! (ICLVOR 1)
+! +-----------------------+
+! | ^ DIR1 |
+! | | |
+! | | |
+! z=- LLZ/2 | +----> DIR2 | z = LLZ/2
+! (ICLVOR 4)| | (ICLVOR 2)
+! | |
+! | |
+! +-----------------------+
+! y = -LLY/2
+! (ICLVOR 3)
+
+
+! -> Si ICAS = 2, les conditions sont necessairement de type paroi
+! -> Si ICAS = 3 ou 4, pas de traitement particulier
+
+ ient = 1
+
+ if(icas(ient).eq.1) then
+ iclvor(1,ient) = 1
+ iclvor(2,ient) = 2
+ iclvor(3,ient) = 1
+ iclvor(4,ient) = 2
+ endif
+
+! LLY et LLZ sont les dimensions de l'entree dans les directions DIR1 et DIR2
+! LDD est le diametre de la conduite
+
+
+ ient = 1
+ lly(ient) = 0.2d0
+ llz(ient) = 0.1d0
+
+ ient = 2
+ lld(2) = 0.154d0
+
+!===============================================================================
+! 5. PARAMETRES PHYSIQUES ET MARCHE EN TEMPS
+!===============================================================================
+
+! --- " Temps de vie " limite du vortex
+
+! ITLIVO = 1...Les vortex sont retire au bout du temps TLIMVO
+! donne par l'utilisateur
+! ( par exemple TLIMVO = 10*DTREF)
+
+! 2...Chaque vortex a un temps d'exitence limite valant
+! 5.Cmu.k^(3/2).U/epsilon
+! ( ou U est la vitesse principale suivant DIR3)
+
+ ient = 1
+ itlivo(ient) = 1
+
+ if(itlivo(ient).eq.1) then
+ tlimvo(ient) = 10.d0*dtref
+ endif
+
+ ient = 2
+ itlivo(ient) = 2
+
+
+! --- " Diametre " des vortex
+
+! ISGMVO = 1...diametre constant XSGMVO donne par l'utilisateur
+! 2...basee sur la formule sigma = Cmu^(3/4).k^(3/2)/epsilon
+! 3...basee sur la formule sigma = max(Lt, Lk) avec
+! Lt = (5 nu.k/epsilon)^(1/2)
+! et Lk = 200.(nu^3/epsilon)^(1/4)
+
+ ient = 1
+ isgmvo(ient) = 1
+
+ if(isgmvo(ient).eq.1) then
+ xsgmvo(ient) = 0.01d0
+ endif
+
+ ient = 2
+ isgmvo(ient) = 2
+
+
+! --- Mode de deplacement des vortex
+
+! IDEPVO = 1...Deplacement en r*UD (r aleatoire dans [0,1])
+! UD a fournir par l'utilisateur
+! 2...Convection par les vortex
+
+ ient = 1
+ idepvo(ient) = 2
+
+ ient = 2
+ idepvo(ient) = 1
+
+ if(idepvo(ient).eq.1) then
+ ud(ient) = 0.7d0
+ endif
+
+!===============================================================================
+! 6. PARAMETRES D'ENTREE / SORTIES ET DONNEES UTILISATEUR
+!===============================================================================
+
+! --- Fichier de donnees utilisateur
+
+! NDAT ...Nombre de lignes du fichier de donnees contenant les donnees :
+! x | y | z | U | V | W | Grad[u.DIR3].n | k | epsilon
+
+! dans le plan d'entree du calcul
+
+! Grad[u.DIR3].n est le gradient dans la direction normale
+! a la paroi, de la vitesse principale dans le plan d'entree.
+! Cette donn�es n'est utilis�e qu'avec ICAS=2
+
+! FICVOR...Nom du fichier de donnees utilisateur
+
+ ient = 1
+ ndat(ient) = 2080
+
+ ient = 2
+ ndat(ient) = 2080
+
+! Par les defaut les fichiers sont nommes "vordat" affect� de l'indice
+! d'entr�e
+
+ ient = 1
+ FICVOR(IENT) = 'entree_1.dat'
+
+ ient = 2
+ FICVOR(IENT) = 'entree_2.dat'
+
+! Pour ICAS = 4, on precise juste la valeur moyenne de U, k et de espilon
+! a l'entree
+
+ if(icas(ient).eq.4) then
+ udebit(ient) = 10.d0
+ kdebit(ient) = 1.d0
+ edebit(ient) = 1.d0
+ endif
+
+! --- Relecture d'un fichier suite eventuel
+
+! ISUIVO = 0...Pas de relecture (reinitialisation des vortex)
+! 1...Relecture du fichier suite de methode des vortex
+
+ isuivo = isuite
+
+
+endif
+
+
+return
+end
+
+!===============================================================================
+! 7. DEFINTION DE LA FONCTION PERMETAT D'IMPOSER LES DONNEES D'ENTREE
+!===============================================================================
+
+ function phidat &
+!==============
+
+ ( nfecra , icas , ndat , &
+ yy , zz , ydat , zdat , &
+ vardat , iii )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! FONCTION PERMETTANT D'INTERPOLER LES DONNEES D'ENTREE FOURNIES
+! PAR L'UTILISATEUR AU CENTRE DES FACES D'ENTREE POUR LESQUELLES
+! EST UTILISEE LA METHODE DES VORTEX
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! nfecra ! e ! <-- ! unite !
+! icas ! e ! <-- ! type de geometrie du cas !
+! ndat ! e ! <-- ! nbr de lignes du fichier de donnees !
+! yy ! e ! <-- ! coordoonnes dans le repere local du !
+! zz ! e ! <-- ! point ou l'on cherche a connaitre la !
+! ! ! ! variable vardat !
+! ydat ! e ! <-- ! coordoonnes ou est connue la variable !
+! zdat ! e ! <-- ! vardat dans le fichier de donnees !
+! vardat ! e ! <-- ! valeur de la variable vardat !
+! iii ! e ! --> ! ligne ou a ete trouvee la donnee la !
+! ! ! ! plus proche du point (yy,zz) !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+integer nfecra, icas, ndat, iii
+double precision zz, yy
+double precision zdat(ndat), ydat(ndat)
+double precision vardat(ndat)
+
+integer ii
+double precision phidat, dist1
+
+
+! Dans l'exemple suivant, on se contente de retourne la valeur situee
+! dans le fichier de donnee a l'abscisse la plus proche du point de
+! coordonn�e (Y,Z) ou l'on cherche a connaitre la valeur de la
+! variable numero VARDAT.
+
+
+if(icas.eq.1.or.icas.eq.2.or.icas.eq.3) then
+
+ if(iii.eq.0) then
+ dist1 = 1.d20
+ do ii = 1,ndat
+ if(sqrt((yy-ydat(ii))**2+(zz-zdat(ii))**2).lt.dist1) then
+ dist1 = sqrt((zz-zdat(ii))**2+(yy-ydat(ii))**2)
+ iii = ii
+ phidat = vardat(ii)
+ endif
+ enddo
+ elseif(iii.ne.0) then
+ phidat = vardat(iii)
+ endif
+
+elseif(icas.eq.4) then
+ phidat = vardat(1)
+endif
+
+return
+end
diff --git a/users/base/usvpst.f90 b/users/base/usvpst.f90
new file mode 100644
index 0000000..7729bbd
--- /dev/null
+++ b/users/base/usvpst.f90
@@ -0,0 +1,1138 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usvpst &
+!================
+
+ ( idbia0 , idbra0 , ipart , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ ncelps , nfacps , nfbrps , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itypps , ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , &
+ tracel , trafac , trafbr , rdevel , rtuser , ra )
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LA SORTIE DE VARIABLES SUR UN MAILLAGE
+! DE POST TRAITEMENT DEJA DEFINI
+
+! PAR DEFAUT, DEUX MAILLAGES SONT DEFINIS AUTOMATIQUEMENT :
+! - LE MAILLAGE VOLUMIQUE (IPART=-1) SELON LA VALEUR DE ICHRVL
+! - LE MAILLAGE DE BORD (IPART=-2) SELON LA VALEUR DE ICHRBO
+! DES MAILLAGES SUPPLEMENTAIRES (CELLULES OU FACES INTERNES ET
+! DE BORD) PEUVENT ETRE DEFINIS ET PARAMETRES A TRAVERS
+! usdpst .F ET usmpst.F.
+
+!ETTE CETTE ROUTINE EST APPELEE UNE FOIS PAR MAILLAGE POST
+! ET PAR PAS DE TEMPS AUQUEL CE MAILLAGE EST ACTIF
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ipart ! e ! <-- ! numero du maillage post !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
+! ncelps ! e ! <-- ! nombre de cellules du maillage post !
+! nfacps ! e ! <-- ! nombre de faces interieur post !
+! nfbrps ! e ! <-- ! nombre de faces de bord post !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itypps(3) ! te ! <-- ! indicateur de presence (0 ou 1) de !
+! ! ! ! cellules (1), faces (2), ou faces de !
+! ! ! ! de bord (3) dans le maillage post !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
+! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
+! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet) ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! statis ! tr ! <-- ! statistiques (lagrangien) !
+!ncelet,nvlsta) ! ! ! !
+! tracel(*) ! tr ! <-- ! tab reel valeurs cellules post !
+! trafac(*) ! tr ! <-- ! tab reel valeurs faces int. post !
+! trafbr(*) ! tr ! <-- ! tab reel valeurs faces bord post !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "optcal.h"
+include "numvar.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ipart
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nvlsta
+integer ncelps , nfacps , nfbrps
+integer nideve , nrdeve , nituse , nrtuse
+
+integer itypps(3)
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtpa(ncelet,*), rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision statis(ncelet,nvlsta)
+double precision tracel(ncelps*3)
+double precision trafac(nfacps*3), trafbr(nfbrps*3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+character*32 namevr
+
+integer ntindp
+integer iel , ifac , iloc , iphas, ivar , iclt
+integer idimt , ii , jj
+integer idimte, itenso, ientla, ivarpr
+integer imom1, imom2, ipcmo1, ipcmo2, idtcm
+double precision pond
+double precision rbid(1)
+
+integer ipass
+data ipass /0/
+save ipass
+
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. TRAITEMENT DES VARIABLES A SORTIR
+! A RENSEIGNER PAR L'UTILISATEUR aux endroits indiques
+!===============================================================================
+
+
+! Un maillage de posttraitement est une "part"
+! (au sens EnSight ; les �quivalents MED et CGNS sont le maillage
+! et la base respectivement)
+! L'utilisateur aura defini ses maillages de posttraitement dans
+! usdpst (NBPART maillages de posttraitement)
+
+
+! La routine est appelee une fois pour chaque maillage IPART.
+! Pour chaque maillage et pour chacune des variables que l'on
+! souhaite posttraiter, on doit definir certains parametres et les
+! passer a la routine PSTEVA qui se charge de l'ecriture effective.
+! Ces parametres sont :
+! NAMEVR : nom de la variable
+! IDIMT : dimension de la variable
+! IENTLA : dans le cas ou IDIMT est >1, IENTLA permet de specifier
+! si le tableau contenant la variable est range de maniere
+! entrelacee X1,Y1,Z1,X2,Y2,Z2,X3,Y3,Z3,... (IENTLA=1)
+! ou non entrelancee X1,X2,X3,...,Y1,Y2,Y3,...,Z1,Z2,Z3,...
+! (IENTLA=0)
+! IVARPR : specifie si le tableau contenant la variable traitee est
+! defini sur le maillage "parent"/
+! En effet, meme si le maillage IPART considere contient
+! le meme nombre d'elements que le maillage complet "parent"
+! (NCELPS=NCEL), l'ordre de numerotation des elements n'est pas
+! forcement le meme. Le tableau TRACEL passe en argument de
+! PSTEVA est construit selon la numerotation du maillage IPART.
+! Pour posttraiter une variable contenue dans un tableau RTUSER
+! par exemple, il faut donc d'abord le reordonner dans le
+! tableau TRACEL :
+! DO ILOC = 1, NCELPS
+! IEL = LSTCEL(ILOC)
+! TRACEL(ILOC) = RTUSER(IEL)
+! ENDDO
+! Une alternative est cependant offerte, pour eviter des copies
+! inutiles. Si NCELPS=NCEL, on peut directement passer RTUSER
+! en argument de PSTEVA, en specifiant IVARPR=1, pour avertir
+! le code que la numerotation est celle du maillage "parent".
+! L'exemple ci-dessus concerne les cellules, mais la
+! problematique est la meme avec les faces internes ou faces de
+! bord.
+
+
+! Remarque : attention aux longueurs des noms de variables.
+
+! On autorise ici jusqu'� 32 caracteres , mais selon le
+! format utilise, les noms peuvent etre tronques :
+
+! - a 19 caracteres pour une sortie EnSight
+! - a 32 caracteres pour ue sortie MED 2.2
+
+! La longueur du nom n'est pas limitee en interne, et en
+! cas de deux variables aux noms tronques ne differant
+! qu'apres le 19ieme caractere, les lignes correspondantes
+! apparaitront normalement dans le fichier texte ".case"
+! EnSight, avec un meme champ de description ; il suffit
+! alors de renommer un de ces champs dans ce fichier
+! texte pour corriger le probleme.
+
+! Les caracteres blancs en debut ou fin de chaine sont
+! supprimes automatiquement. Selon le format utilise,
+! les caracteres interdits (sous EnSight, les caracteres
+! ( ) ] [ + - @ ! # * ^ $ / ainsi que les blancs et les
+! tabulations seront remplaces par le caractere ___________.
+! Ceci ne necessite aucune intervention utilisateur
+! (i.e. inutile d'utiliser ici les anciennes fonctions
+! Fortran VERLON et UNDSCR).
+
+
+! Exemples :
+! pour le maillage post 2, on sort
+! la vitesse, la pression,
+! la temperature imposee aux faces de bord
+! (et 0 sur les eventuelles faces interieures)
+
+! pour le maillage post 1, on sort
+! toutes les variables habituellement post-traitables.
+
+! Le codage de l'exemple pour le maillage post 1 est
+! plus compact.
+
+
+! Les exemples donnes ici correspondent aux maillages
+! definis dans en exemple dans usdpst.F et usmpst.F
+
+
+
+
+
+!===============================================================================
+! 1.1. EXEMPLES DE VARIABLES SUPPLEMENTAIRES A POSTTRAITER SUR LE
+! MAILLAGE VOLUMIQUE COMPLET (IPART=-1)
+!===============================================================================
+
+if (ipart.eq.-1) then
+
+! 1.1.1 SORTIE DE k=1/2(R11+R22+R33) EN MODELE Rij
+! ------------------------------------------------
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+ if (itytur(iphas) .eq. 3) then
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Energie turb'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = 0.5d0*( rtp(iel,ir11(iphas)) + &
+ rtp(iel,ir22(iphas)) +rtp(iel,ir33(iphas)) )
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+! Les variables sont definies sur le tableau de travail ;
+! on n'utilise pas l'indirection (IVARPR = 0)
+ ivarpr = 0
+
+
+! Le maillage ne contient pas de face interne ni de face
+! de bord, on peut donc passer un pointeur bidon RBID a la
+! place de TRAFAC et TRAFBR
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, rbid, rbid)
+
+ endif
+
+
+
+! 1.1.2 SORTIE D'UNE COMBINAISON DE MOMENTS
+! -----------------------------------------
+! On suppose dans cet exemple qu'on dispose de 2 moyennes temporelles
+! (moments) : <u> pour IMOM=1
+! <uu> pour IMOM=2
+! On souhaite faire une sortie graphique de <u'u'>=<uu>-<U>**2
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+ if (nbmomt .ge. 2) then
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Numero des moments :
+ imom1 = 1
+ imom2 = 2
+! Position dans PROPCE du tableau de cumul temporel des moments
+! PROPCE(IEL,IPCMOM)
+ ipcmo1 = ipproc(icmome(imom1))
+ ipcmo2 = ipproc(icmome(imom2))
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = '<upup>'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+! Le cumul temporel des moments doit etre divise par la variable
+! de cumul du temps qui est un tableau NCEL ou un reel :
+! un tableau NCEL si IDTMOM(IMOM) > 0 : PROPCE(IEL,IDTCM)
+! ou un simple reel si IDTMOM(IMOM) < 0 : DTCMOM(IDTCM)
+! Pour ameliorer la lisibilite de cet exemple, on suppose que les
+! moments IMOM1 et IMOM2 ont ete calcules sur le meme temps.
+
+ if(idtmom(imom1).gt.0) then
+ idtcm = ipproc(icdtmo(idtmom(imom1)))
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = propce(iel,ipcmo2)/ &
+ max(propce(iel,idtcm),epzero) &
+ - (propce(iel,ipcmo1)/ &
+ max(propce(iel,idtcm),epzero))**2
+ enddo
+ elseif(idtmom(imom1).lt.0) then
+ idtcm = -idtmom(imom1)
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = propce(iel,ipcmo2)/ &
+ max(dtcmom(idtcm),epzero) &
+ - (propce(iel,ipcmo1)/ &
+ max(dtcmom(idtcm),epzero))**2
+ enddo
+ endif
+
+! Ecriture effective des valeurs calculees
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+! Les variables sont definies sur le tableau de travail ;
+! on n'utilise pas l'indirection (IVARPR = 0)
+ ivarpr = 0
+
+
+! Le maillage ne contient pas de face interne ni de face
+! de bord, on peut donc passer un pointeur bidon RBID a la
+! place de TRAFAC et TRAFBR
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, rbid, rbid)
+
+ endif
+
+
+
+! 1.1.3 SORTIE NUMERO DE DOMAINE EN PARALLELE
+! -------------------------------------------
+
+! Cette variable est independante du temps, on ne la sort
+! donc qu'une fois (voir NTINDP plus bas)
+
+ if (ipass.eq.0 .and. irangp.ge.0) then
+
+ ipass = ipass + 1
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Num processeur'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = irangp + 1
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+! Les variables sont definies sur le tableau de travail ;
+! on n'utilise pas l'indirection (IVARPR = 0)
+ ivarpr = 0
+
+! Cette variable ne depend pas du temps ;
+! on peut lui affecter un numero de pas de temps negatif
+! et ne l'ecrire qu'une fois si on veut eviter de
+! la dupliquer a chaque sortie
+ ntindp = -1
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntindp, ttcabs, tracel, rbid, rbid)
+
+ endif
+! Fin du traitement en cas de sortie de la variable
+
+
+
+
+
+
+
+!===============================================================================
+! 1.2. EXEMPLES DE VARIABLES SUPPLEMENTAIRES A POSTTRAITER SUR LE
+! MAILLAGE DE BORD COMPLET (IPART=-2)
+!===============================================================================
+
+else if (ipart.eq.-2) then
+
+! 1.2.1 TRAITEMENT DE LA MASSE VOLUMIQUE AU BORD
+! ----------------------------------------------
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Rho bord'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+! On utilise directement le tableau propfb defini sur le
+! maillage parent
+ ivarpr = 1
+
+! Le maillage ne contient pas de face interne ni de
+! cellule, on peut donc passer un pointeur bidon RBID a la
+! place de TRAFAC et TRACEL
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rbid, rbid, &
+ propfb(1,ipprob(irom(iphas))))
+
+
+
+
+
+!===============================================================================
+! 1.3. EXEMPLES DE VARIABLES A POSTTRAITER SUR LES MAILLAGE 1 ET 2
+! (IPART=1 OU IPART=2)
+!===============================================================================
+
+
+else if (ipart.eq.1 .or. ipart.eq.2) then
+
+! 1.3.1 TRAITEMENT DE LA VITESSE
+! ------------------------------
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Vitesse interpolee'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 3
+
+! Valeurs entrelac�es
+ ientla = 1
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+! Calcul des valeurs de la variable sur les faces internes
+! Pour simplifier l'exemple, on se contente ici d'une simple
+! interpolation lineaire.
+! Dans les calculs paralleles, si l'on utilise les voisins,
+! il faut faire un echange au prealable, comme d'habitude.
+! Dans les calculs avec periodicite, il faut egalement le faire
+! Pour les calculs ou periodicite et parallelisme coexistent,
+! l'appel a ces routines doit etre fait dans l'ordre
+! PARCOM puis PERCOM
+
+! a renseigner par l'utilisateur
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,iu(iphas)))
+ call parcom (rtp(1,iv(iphas)))
+ call parcom (rtp(1,iw(iphas)))
+ endif
+
+ if(iperio.eq.1) then
+ idimte = 1
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,iu(iphas)), rtp(1,iu(iphas)), rtp(1,iu(iphas)), &
+ rtp(1,iv(iphas)), rtp(1,iv(iphas)), rtp(1,iv(iphas)), &
+ rtp(1,iw(iphas)), rtp(1,iw(iphas)), rtp(1,iw(iphas)))
+ endif
+
+ do iloc = 1, nfacps
+
+ ifac = lstfac(iloc)
+ ii = ifacel(1, ifac)
+ jj = ifacel(2, ifac)
+ pond = ra(ipond-1+ifac)
+
+ trafac(1 + (iloc-1)*idimt ) &
+ = pond * rtp(ii, iu(iphas)) &
+ + (1.d0 - pond) * rtp(jj, iu(iphas))
+ trafac(2 + (iloc-1)*idimt ) &
+ = pond * rtp(ii, iv(iphas)) &
+ + (1.d0 - pond) * rtp(jj, iv(iphas))
+ trafac(3 + (iloc-1)*idimt ) &
+ = pond * rtp(ii, iw(iphas)) &
+ + (1.d0 - pond) * rtp(jj, iw(iphas))
+
+ enddo
+
+
+! Calcul des valeurs de la variable sur les faces de bord
+! Pour simplifier l'exemple, on se contente ici d'une simple
+! recopie de la variable de la cellule adjacente.
+! a renseigner par l'utilisateur
+
+ do iloc = 1, nfbrps
+
+ ifac = lstfbr(iloc)
+ ii = ifabor(ifac)
+
+ trafbr(1 + (iloc-1)*idimt ) = rtp(ii, iu(iphas))
+ trafbr(2 + (iloc-1)*idimt ) = rtp(ii, iv(iphas))
+ trafbr(3 + (iloc-1)*idimt ) = rtp(ii, iw(iphas))
+
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+ ivarpr = 0
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, trafac, trafbr)
+
+
+! 1.3.2 TRAITEMENT DE LA PRESSION
+! -------------------------------
+
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Pression interpolee'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+! Valeurs non entrelac�es (sans importance pour un scalaire)
+ ientla = 0
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+! Numero de variable
+! a renseigner par l'utilisateur
+ ivar = ipr(iphas)
+
+! Calcul des valeurs de la variable sur les faces internes
+! Pour simplifier l'exemple, on se contente ici d'une simple
+! interpolation lineaire.
+! Dans les calculs paralleles, si l'on utilise les voisins,
+! il faut faire un echange au prealable, comme d'habitude.
+! Dans les calculs avec periodicite, il faut egalement le faire
+! Pour les calculs ou periodicite et parallelisme coexistent,
+! l'appel a ces routines doit etre fait dans l'ordre
+! PARCOM puis PERCOM
+
+! a renseigner par l'utilisateur
+
+ if(irangp.ge.0) then
+ call parcom (rtp(1,ivar))
+ endif
+ if(iperio.eq.1) then
+ idimte = 0
+ itenso = 0
+ call percom &
+ !==========
+ ( idimte , itenso , &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar), &
+ rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
+ endif
+
+ do iloc = 1, nfacps
+
+ ifac = lstfac(iloc)
+ ii = ifacel(1, ifac)
+ jj = ifacel(2, ifac)
+ pond = ra(ipond-1+ifac)
+
+ trafac(iloc) = pond * rtp(ii, ivar) &
+ + (1.d0 - pond) * rtp(jj, ivar)
+
+ enddo
+
+
+! Calcul des valeurs de la variable sur les faces de bord
+! Pour simplifier l'exemple, on se contente ici d'une simple
+! recopie de la variable de la cellule adjacente.
+! a renseigner par l'utilisateur
+
+ do iloc = 1, nfbrps
+
+ ifac = lstfbr(iloc)
+ ii = ifabor(ifac)
+
+ trafbr(iloc) = rtp(ii, ivar)
+
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+ ivarpr = 0
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, trafac, trafbr)
+
+
+! 1.3.3 TRAITEMENT DE LA TEMPERATURE AU BORD
+! ------------------------------------------
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+ if(iscalt(iphas).gt.0) then
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Temperature de bord'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+! Valeurs non entrelac�es (sans importance pour un scalaire)
+ ientla = 0
+
+! Annulation de la variable sur les faces internes
+! a renseigner par l'utilisateur
+
+ do iloc = 1, nfacps
+ trafac(iloc) = 0.d0
+ enddo
+
+! Calcul des valeurs de la variable sur les faces de bord
+! a renseigner par l'utilisateur
+
+ ivar = isca(iscalt(iphas))
+ iclt = iclrtp(ivar,icoef)
+
+ do iloc = 1, nfbrps
+ ifac = lstfbr(iloc)
+ ii = ifabor(ifac)
+ trafbr(iloc) = &
+ coefa(ifac,iclt)+coefb(ifac,iclt)*rtp(ii, ivar)
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+ ivarpr = 0
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, trafac, trafbr)
+
+ endif
+
+
+
+
+! Les exemples suivants montrent les differentes facons de
+! sortir la meme variable (entrelacee ou non, avec indirection
+! ou pas)
+
+! 1.3.4 TRAITEMENT DES CENTRES DE GRAVITE, sous forme entrelacee
+! --------------------------------------------------------------
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'cdg faces (entrelaces)'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 3
+
+! Valeurs entrelac�es
+ ientla = 1
+
+ do iloc = 1, nfacps
+
+ ifac = lstfac(iloc)
+
+ trafac(1 + (iloc-1)*idimt ) = cdgfac(1, ifac)
+ trafac(2 + (iloc-1)*idimt ) = cdgfac(2, ifac)
+ trafac(3 + (iloc-1)*idimt ) = cdgfac(3, ifac)
+
+ enddo
+
+! Calcul des valeurs de la variable sur les faces de bord
+
+ do iloc = 1, nfbrps
+
+ ifac = lstfbr(iloc)
+
+ trafbr(1 + (iloc-1)*idimt ) = cdgfbo(1, ifac)
+ trafbr(2 + (iloc-1)*idimt ) = cdgfbo(2, ifac)
+ trafbr(3 + (iloc-1)*idimt ) = cdgfbo(3, ifac)
+
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+ ivarpr = 0
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, trafac, trafbr)
+
+
+! 1.3.5 TRAITEMENT DES CENTRES DE GRAVITE, sous forme non entrelacee
+! ------------------------------------------------------------------
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'cdg faces (non entrelaces)'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 3
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+ do iloc = 1, nfacps
+
+ ifac = lstfac(iloc)
+
+ trafac(iloc) = cdgfac(1, ifac)
+ trafac(iloc + nfacps) = cdgfac(2, ifac)
+ trafac(iloc + 2*nfacps) = cdgfac(3, ifac)
+
+ enddo
+
+! Calcul des valeurs de la variable sur les faces de bord
+
+ do iloc = 1, nfbrps
+
+ ifac = lstfbr(iloc)
+
+ trafbr(iloc) = cdgfbo(1, ifac)
+ trafbr(iloc + nfbrps) = cdgfbo(2, ifac)
+ trafbr(iloc + 2*nfbrps) = cdgfbo(3, ifac)
+
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+ ivarpr = 0
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, trafac, trafbr)
+
+
+! 1.3.6 TRAITEMENT DES CENTRES DE GRAVITE, avec indirection
+! ------------------------------------------------------------------
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'cdg faces (indirection)'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 3
+
+! Valeurs entrelac�es
+ ientla = 1
+
+! Ecriture effective des valeurs calculees
+
+ ivarpr = 1
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rbid, cdgfac, cdgfbo)
+
+
+
+
+
+!===============================================================================
+! 1.4. EXEMPLES DE VARIABLES A POSTTRAITER SUR LES MAILLAGE 3 ET 4
+! (IPART=3 OU IPART=4)
+!===============================================================================
+
+else if (ipart.ge.3 .and. ipart.le.4) then
+
+
+! 1.4.1 TRAITEMENT DE LA VITESSE
+! ------------------------------
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Vitesse'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 3
+
+! Valeurs non entrelac�es
+ ientla = 0
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+! Numero de variable
+! a renseigner par l'utilisateur
+ ivar = iu(iphas)
+
+! Calcul des valeurs de la variable sur les faces internes
+
+ do iloc = 1, nfacps
+
+ ifac = lstfac(iloc)
+ ii = ifacel(1, ifac)
+ jj = ifacel(2, ifac)
+ pond = ra(ipond-1+ifac)
+
+ trafac(iloc) &
+ = pond * rtp(ii, iu(iphas)) &
+ + (1.d0 - pond) * rtp(jj, iu(iphas))
+ trafac(iloc + nfacps) &
+ = pond * rtp(ii, iv(iphas)) &
+ + (1.d0 - pond) * rtp(jj, iv(iphas))
+ trafac(iloc + 2*nfacps) &
+ = pond * rtp(ii, iw(iphas)) &
+ + (1.d0 - pond) * rtp(jj, iw(iphas))
+
+ enddo
+
+! Calcul des valeurs de la variable sur les faces de bord
+! Pour simplifier l'exemple, on se contente ici d'une simple
+! recopie de la variable de la cellule adjacente.
+! a renseigner par l'utilisateur
+
+ do iloc = 1, nfbrps
+
+ ifac = lstfbr(iloc)
+ ii = ifabor(ifac)
+
+ trafbr(iloc ) = rtp(ii, iu(iphas))
+ trafbr(iloc + nfbrps) = rtp(ii, iv(iphas))
+ trafbr(iloc + 2*nfbrps) = rtp(ii, iw(iphas))
+
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+ if (ipart.eq.5) then
+ ivarpr = 1
+ else
+ ivarpr = 0
+ endif
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rtp(1,ivar), trafac, trafbr)
+
+
+! 1.4.2 TRAITEMENT DE LA PRESSION
+! -------------------------------
+
+
+! Initialisation
+! pas d'intervention utilisateur requise
+ do ii = 1, 32
+ NAMEVR (II:II) = ' '
+ enddo
+
+! Nom de la variable
+! a renseigner par l'utilisateur
+ NAMEVR = 'Pression'
+
+! Dimension de la variable (3 = vecteur, 1=scalaire)
+! a renseigner par l'utilisateur
+ idimt = 1
+
+! Valeurs non entrelac�es (sans importance pour un scalaire)
+ ientla = 0
+
+! Phase
+! a renseigner par l'utilisateur
+ iphas = 1
+
+! Numero de variable
+! a renseigner par l'utilisateur
+ ivar = ipr(iphas)
+
+! Calcul des valeurs de la variable sur les faces internes
+
+ do iloc = 1, nfacps
+
+ ifac = lstfac(iloc)
+ ii = ifacel(1, ifac)
+ jj = ifacel(2, ifac)
+ pond = ra(ipond-1+ifac)
+
+ trafac(iloc) &
+ = pond * rtp(ii, ivar) &
+ + (1.d0 - pond) * rtp(jj, ivar)
+
+ enddo
+
+! Calcul des valeurs de la variable sur les faces de bord
+! Pour simplifier l'exemple, on se contente ici d'une simple
+! recopie de la variable de la cellule adjacente.
+! a renseigner par l'utilisateur
+
+ do iloc = 1, nfbrps
+
+ ifac = lstfbr(iloc)
+ ii = ifabor(ifac)
+
+ trafbr(iloc) = rtp(ii, ivar)
+
+ enddo
+
+! Ecriture effective des valeurs calculees
+
+ if (ipart.eq.5) then
+ ivarpr = 1
+ else
+ ivarpr = 0
+ endif
+
+ call psteva(ipart , namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, rtp(1,ivar), trafac, trafbr)
+
+
+endif
+! Fin du test sur le numero de maillage post.
+
+
+return
+
+end
diff --git a/users/cfbl/uscfcl.f90 b/users/cfbl/uscfcl.f90
new file mode 100644
index 0000000..d26cd74
--- /dev/null
+++ b/users/cfbl/uscfcl.f90
@@ -0,0 +1,783 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscfcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+
+
+
+! CE SOUS PROGRAMME UTILISATEUR EST OBLIGATOIRE
+! =============================================
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+!ONC a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! En compressible, on ne peut affecter que les conditions aux
+! limites predefinies
+
+! IPAROI, ISYMET, IESICF, ISSPCF, ISOPCF, IERUCF, IEQHCF
+
+! IPAROI : paroi standard
+! ISYMET : symetrie standard
+
+! IESICF, ISSPCF, ISOPCF, IERUCF, IEQHCF : entree/sortie
+
+! Pour les entrees/sorties, on peut
+! imposer une valeur pour la turbulence et les scalaires
+! passifs dans RCODCL(.,.,1) pour le cas ou le flux de masse
+! serait entrant. Si on ne le fait pas, une condition de
+! nul est appliquee.
+
+! IESICF : entree sortie imposee (par exemple entree supersonique)
+! l'utilisateur impose la vitesse et toutes les
+! variables thermodynamiques
+! ISSPCF : sortie supersonique
+! l'utilisateur n'impose rien
+! ISOPCF : sortie subsonique a pression imposee
+! l'utilisateur impose la pression
+! IERUCF : entree subsonique a vitesse et rho imposes
+! l'utilisateur impose la vitesse et la masse volumique
+! IEQHCF : entree subsonique a debit et debit enthalpique imposes
+! a implementer
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac , iel , ii , iphas
+integer izone , iutile
+integer ilelt, nlelt
+
+double precision uref2 , dhyd , rhomoy
+double precision ustar2, xkent , xeent , d2s3
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ COMPRESSIBLE ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscfcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+!===============================================================================
+
+iphas = 1
+
+
+! --- Exemple d'entree/sortie pour laquelle tout est connu
+
+! sans presumer du caractere subsonique ou supersonique,
+! l'utilisateur souhaite imposer toutes les caracteristiques
+! de l'ecoulement
+! une entree supersonique est un cas particulier
+
+! La turbulence et les scalaires utilisateur prennent un flux nul
+! si la vitesse est sortante.
+
+CALL GETFBR('1 and X <= 1.0 ',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+ iel = ifabor(ifac)
+
+! On numerote les zones de 1 a n...
+ izone = 1
+ izfppp(ifac) = izone
+
+ itypfb(ifac,iphas) = iesicf
+
+! - Vitesse
+ rcodcl(ifac,iu(iphas),1) = 5.0d0
+ rcodcl(ifac,iv(iphas),1) = 0.0d0
+ rcodcl(ifac,iw(iphas),1) = 0.0d0
+
+! - Pression, Masse Volumique, Temperature, Energie Totale Specifique
+
+! Seules 2 variables sur les 4 sont independantes
+! On peut donc fixer le couple de variables que l'on veut
+! (sauf Temperature-Energie) et les 2 autres variables seront
+! calculees automatiquement
+
+! ** Choisir les 2 variables a imposer et effacer les autres
+! (elles sont calcul�es par les lois thermodynamiques dans uscfth)
+
+! Pression (en Pa)
+ rcodcl(ifac,ipr(iphas),1) = 5.d5
+
+! Masse Volumique (en kg/m3)
+! RCODCL(IFAC,ISCA(IRHO (IPHAS)),1) = 1.D0
+
+! Temperature (en K)
+ rcodcl(ifac,isca(itempk(iphas)),1) = 300.d0
+
+! Energie Totale Specifique (en J/kg)
+! RCODCL(IFAC,ISCA(IENERG(IPHAS)),1) = 355.D3
+
+
+! - Turbulence
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+
+
+! Exemple de turbulence calculee a partir
+! de formules valables pour une conduite
+
+! On veillera a specifier le diametre hydraulique
+! adapte a l'entree courante.
+
+! On s'attachera egalement a utiliser si besoin une formule
+! plus precise pour la viscosite dynamique utilisee dans le
+! calcul du nombre de Reynolds (en particulier, lorsqu'elle
+! est variable, il peut etre utile de reprendre ici la loi
+! imposee dans USCFPV. On utilise ici par defaut la valeur
+! VISCL0 donnee dans USINI1
+! En ce qui concerne la masse volumique, on peut utiliser directement
+! sa valeur aux faces de bord si elle est connue (et impos�e
+! ci-dessus). Dans le cas g�n�ral, on propose d'utiliser la valeur
+! de la cellule adjacente.
+
+! Diametre hydraulique
+ dhyd = 0.075d0
+
+! Vitesse de frottement (au carre = USTAR2)
+ rhomoy = rtp(iel,isca(irho(iphas)))
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+
+ call keendb &
+ !==========
+ ( uref2, dhyd, rhomoy, viscl0(iphas), cmu, xkappa, &
+ ustar2, xkent, xeent )
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = 2.d0/3.d0*xkent
+ rcodcl(ifac,ir22(iphas),1) = 2.d0/3.d0*xkent
+ rcodcl(ifac,ir33(iphas),1) = 2.d0/3.d0*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+! - On traite les scalaires rattaches a la phase courante
+! (ne pas boucler sur NSCAL sous peine de modifier rho et energie)
+ if(nscaus.gt.0) then
+ do ii = 1, nscaus
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+
+enddo
+
+! --- Exemple de sortie supersonique
+
+! toutes les caract�ristiques sortent
+! on ne doit rien imposer (ce sont les valeurs internes qui sont
+! utilisees pour le calcul des flux de bord)
+
+! pour la turbulence et les scalaires, si on fournit ici des
+! valeurs de RCODCL, on les impose en Dirichlet si le flux
+! de masse est entrant ; sinon, on impose un flux nul (flux de
+! masse sortant ou RCODCL renseign� ici).
+! Noter que pour la turbulence, il faut renseigner RCODCL pour
+! toutes les variables turbulentes (sinon, on applique un flux
+! nul).
+
+
+CALL GETFBR('2',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! On numerote les zones de 1 a n...
+ izone = 2
+ izfppp(ifac) = izone
+
+ itypfb(ifac,iphas) = isspcf
+
+enddo
+
+! --- Exemple d'entree subsonique (debit, debit enthalpique)
+
+! 2 caracteristiques sur 3 entrent : il faut donner 2 informations
+! la troisieme est deduite par un scenario de 2-contact et
+! 3-detente dans le domaine
+! ici on choisit de donner (rho*(U.n), rho*(U.n)*H)
+! avec H = 1/2 U*U + P/rho + e
+! n la normale unitaire entrante
+
+! ATTENTION, on donne des DENSITES de debit (par unite de surface)
+
+CALL GETFBR('3',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! On numerote les zones de 1 a n...
+ izone = 3
+ izfppp(ifac) = izone
+
+ itypfb(ifac,iphas) = ieqhcf
+
+! - Densite de debit massique (en kg/(m2 s))
+ rcodcl(ifac,irun(iphas),1) = 5.d5
+
+! - Densite de debit enthalpique (en J/(m2 s))
+ rcodcl(ifac,irunh(iphas),1) = 5.d5
+
+
+! Condition non disponible dans la version presente
+ call csexit (1)
+ !==========
+
+enddo
+
+! --- Exemple d'entree subsonique (masse volumique, vitesse)
+
+! 2 caracteristiques sur 3 entrent : il faut donner 2 informations
+! la troisieme est deduite par un scenario de 2-contact et
+! 3-detente dans le domaine
+! ici on choisit de donner (rho, U)
+
+CALL GETFBR('4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! On numerote les zones de 1 a n...
+ izone = 4
+ izfppp(ifac) = izone
+
+ itypfb(ifac,iphas) = ierucf
+
+! - Vitesse d'entree
+ rcodcl(ifac,iu(iphas),1) = 5.0d0
+ rcodcl(ifac,iv(iphas),1) = 0.0d0
+ rcodcl(ifac,iw(iphas),1) = 0.0d0
+
+! - Masse Volumique (en kg/m3)
+ rcodcl(ifac,isca(irho (iphas)),1) = 1.d0
+
+
+! - Turbulence
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+
+
+! Exemple de turbulence calculee a partir
+! de formules valables pour une conduite
+
+! On veillera a specifier le diametre hydraulique
+! adapte a l'entree courante.
+
+! On s'attachera egalement a utiliser si besoin une formule
+! plus precise pour la viscosite dynamique utilisee dans le
+! calcul du nombre de Reynolds (en particulier, lorsqu'elle
+! est variable, il peut etre utile de reprendre ici la loi
+! imposee dans USCFPV. On utilise ici par defaut la valeur
+! VISCL0 donnee dans USINI1
+! En ce qui concerne la masse volumique, on peut utiliser directement
+! sa valeur aux faces de bord si elle est connue (et impos�e
+! ci-dessus). Dans le cas g�n�ral, on propose d'utiliser la valeur
+! de la cellule adjacente.
+
+! Diametre hydraulique
+ dhyd = 0.075d0
+
+! Calcul de la vitesse de frottement au carre (USTAR2)
+! et de k et epsilon en entree (XKENT et XEENT) a partir
+! de lois standards en conduite circulaire
+! (leur initialisation est inutile mais plus propre)
+ rhomoy = propfb(ifac,ipprob(irom(iphas)))
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+
+ call keendb &
+ !==========
+ ( uref2, dhyd, rhomoy, viscl0(iphas), cmu, xkappa, &
+ ustar2, xkent, xeent )
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = 2.d0/3.d0*xkent
+ rcodcl(ifac,ir22(iphas),1) = 2.d0/3.d0*xkent
+ rcodcl(ifac,ir33(iphas),1) = 2.d0/3.d0*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+! - On traite les scalaires rattaches a la phase courante
+! (ne pas boucler sur NSCAL sous peine de modifier rho et energie)
+ if(nscaus.gt.0) then
+ do ii = 1, nscaus
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+
+enddo
+
+! --- Exemple de sortie subsonique
+
+! 1 caracteristique sur 3 sort : il faut donner 1 information
+! les deux autres sont deduites par un scenario de 2-contact et
+! 3-detente dans le domaine
+! ici on choisit de donner P
+
+! La turbulence et les scalaires utilisateur prennent un flux nul.
+
+CALL GETFBR('5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! On numerote les zones de 1 a n...
+ izone = 5
+ izfppp(ifac) = izone
+
+ itypfb(ifac,iphas) = isopcf
+
+! Pression (en Pa)
+ rcodcl(ifac,ipr(iphas),1) = 5.d5
+
+enddo
+
+! --- Exemple de paroi
+
+CALL GETFBR('7',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! On numerote les zones de 1 a n...
+ izone = 7
+ izfppp(ifac) = izone
+
+ itypfb(ifac,iphas) = iparoi
+
+
+! Paroi d�filante
+! Par d�faut, la paroi n'est pas d�filante
+! Si la paroi est d�filante, donner les composantes non nulles
+! de la vitesse. La vitesse sera projet�e dans le plan
+! tangeant � la paroi. Dans l'exemple suivant, on impose
+! Ux = 1. (l'exemple est activ� si IUTILE=1)
+
+ iutile = 0
+ if(iutile.eq.1) then
+ rcodcl(ifac,iu(iphas),1) = 1.d0
+ endif
+
+! Temp�rature impos�e
+! Par d�faut, la paroi est adiabatique
+! Si la paroi est � temp�rature impos�e, l'indiquer par
+! ICODCL = 5 et donner la valeur en Kelvin dans RCODCL(.,.,1)
+! Dans l'exemple suivant, on impose T = 293.15 K (l'exemple
+! est activ� si IUTILE=1)
+
+ iutile = 0
+ if(iutile.eq.1) then
+ icodcl(ifac,isca(itempk(iphas))) = 5
+ rcodcl(ifac,isca(itempk(iphas)),1) = 20.d0 + 273.15d0
+ endif
+
+! Flux impos�
+! Par d�faut, la paroi est adiabatique
+! Si la paroi est � flux impos�, l'indiquer par
+! ICODCL = 3 et donner la valeur en Watt/m2 dans RCODCL(.,.,3)
+! Dans l'exemple suivant, on impose un flux de 1000 W/m2
+! - la plage en �t� - (l'exemple est activ� si IUTILE=1)
+
+ iutile = 0
+ if(iutile.eq.1) then
+ icodcl(ifac,isca(itempk(iphas))) = 3
+ rcodcl(ifac,isca(itempk(iphas)),3) = 1000.d0
+ endif
+
+enddo
+
+! --- Exemple de symetrie
+
+CALL GETFBR('8',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! On numerote les zones de 1 a n...
+ izone = 8
+ izfppp(ifac) = izone
+
+ itypfb(ifac,iphas) = isymet
+
+enddo
+
+! Il est deconseille d'utiliser d'autres types de conditions
+! aux limites que ceux proposes ci-dessus.
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cfbl/uscfpv.f90 b/users/cfbl/uscfpv.f90
new file mode 100644
index 0000000..68db337
--- /dev/null
+++ b/users/cfbl/uscfpv.f90
@@ -0,0 +1,872 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscfpv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : REMPLISSAGE DES VARIABLES PHYSIQUES
+! POUR LA PHYSIQUE PARTICULIERE : COMPRESSIBLE SANS CHOC
+! PENDANT DE USPHYV.F
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+
+! Il FAUT AVOIR PRECISE ICP(IPHAS) = 1
+! ==================
+! automatiquement fait dans uscfth en fonction de la thermo
+! choisie
+
+
+! Il FAUT AVOIR PRECISE IVISLS(Numero de scalaire) = 1
+! ==================
+! dans usini1 si on souhaite une diffusivite VISCLS variable
+! pour le scalaire considere (sinon: ecrasement memoire).
+
+
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - de la conductivite thermique associee LAMBDA W/(m degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+! La masse volumique ne doit pas �tre renseign�e : en compressible,
+! c'est une variable r�solue, que l'on peut initialiser si
+! n�cessaire dans USCFXI (RTP).
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...3(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ivart, iel, iphas
+integer ipcvis, ipcvsv, ipccp
+integer ipcvsl, ith, iscal, ii, iccfth, imodif
+double precision varam, varbm, varcm, vardm
+double precision varal, varbl, varcl, vardl
+double precision varac, varbc
+double precision xrtp
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) then
+ iuscfp = 0
+ return
+endif
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+
+
+! LES EXEMPLES FANTAISISTES SUIVANTS SONT A ADAPTER PAR L'UTILISATEUR
+! ====================================================================
+
+! ILS SONT TOUS SUIVIS DE "CALL CSEXIT (1)" PAR SECURITE
+! (stop a enlever a l'utilisation)
+
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+! EXEMPLE 1 : VISCOSITE VARIABLE EN FONCTION DE LA TEMPERATURE
+
+! EXEMPLE 2 : VISCOSITE EN VOLUME VARIABLE EN FONCTION DE LA TEMPERATURE
+
+! EXEMPLE 3 : CHALEUR SPECIFIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+
+! EXEMPLE 4 : CONDUCTIVITE THERMIQUE VARIABLE
+! EN FONCTION DE LA TEMPERATURE
+
+! EXEMPLE 5 : DIFFUSIVITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! POUR LES SCALAIRES
+!===============================================================================
+
+
+
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 1 : VISCOSITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! ===========
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la viscosite
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable temp�rature pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ ivart = isca(itempk(iphas))
+
+! --- Rang de la viscosite dynamique moleculaire de la phase IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCVIS
+
+ ipcvis = ipproc(iviscl(iphas))
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varam = -3.4016d-9
+ varbm = 6.2332d-7
+ varcm = -4.5577d-5
+ vardm = 1.6935d-3
+
+! Viscosite moleculaire dynamique en kg/(m s) au centre des cellules
+! ------------------------------------------------------------------
+! loi MU =
+! T *( T *( AM * T + BM )+ CM )+ DM
+! soit PROPCE(IEL,IPCVIS) =
+! & XRTP*(XRTP*(VARAM*XRTP+VARBM)+VARCM)+VARDM
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvis) = &
+ xrtp*(xrtp*(varam*xrtp+varbm)+varcm)+vardm
+ enddo
+
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+
+! --- A enlever a l'utilisation
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 2: VISCOSITE EN VOLUME VARIABLE EN FONCTION DE LA TEMPERATURE
+! ==========
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la viscosite
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable temp�rature pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ ivart = isca(itempk(iphas))
+
+! --- Rang de la viscosite dynamique moleculaire en volume de la phase IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCVSV
+
+ if(iviscv(iphas).gt.0) then
+ ipcvsv = ipproc(iviscv(iphas))
+ else
+ ipcvsv = 0
+ endif
+
+! --- Stop si non variable
+
+ if(ipcvsv.le.0) then
+ write(nfecra,2000) iphas, iphas, iviscv(iphas)
+ call csexit (1)
+ endif
+
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varam = -3.4016d-9
+ varbm = 6.2332d-7
+ varcm = -4.5577d-5
+ vardm = 1.6935d-3
+
+! Viscosite en volume en kg/(m s) au centre des cellules
+! ------------------------------------------------------
+! loi KAPPA =
+! T *( T *( AM * T + BM )+ CM )+ DM
+! soit PROPCE(IEL,IPCVSV) =
+! & XRTP*(XRTP*(VARAM*XRTP+VARBM)+VARCM)+VARDM
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvsv) = &
+ xrtp*(xrtp*(varam*xrtp+varbm)+varcm)+vardm
+ enddo
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+
+! --- A enlever a l'utilisation
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+
+
+
+
+!===============================================================================
+! EXEMPLE 3 : CHALEUR SPECIFIQUE VARIABLE EN FONCTION DE LA TEMPERATURE
+! ===========
+
+! Ci dessous on donne pour toutes les phases la meme loi pour
+! la chaleur specifique
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+
+!===============================================================================
+
+! ATTENTION !
+
+! NE PAS RETIRER LA MISE A JOUR DE Cv A LA FIN DE L'EXEMPLE
+
+!===============================================================================
+
+!===============================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable temp�rature pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ ivart = isca(itempk(iphas))
+
+! --- Rang de la chaleur specifique de la phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCCP
+
+ if(icp(iphas).gt.0) then
+ ipccp = ipproc(icp (iphas))
+ else
+ ipccp = 0
+ endif
+
+! --- Stop si CP ou CV n'est pas variable
+
+ if(ipccp.le.0) then
+ write(nfecra,1000) iphas, iphas, icp(iphas)
+ call csexit (1)
+ endif
+ if(icv(iphas).le.0) then
+ write(nfecra,1001) iphas, iphas, icv(iphas)
+ call csexit (1)
+ endif
+
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varac = 0.00001d0
+ varbc = 1000.0d0
+
+
+
+! Chaleur specifique J/(kg degres) au centre des cellules
+! --------------------------------------------------------
+! loi CP = AC * T + BM
+! soit PROPCE(IEL,IPCCP ) = VARAC*XRTP + VARBC
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipccp ) = varac*xrtp + varbc
+ enddo
+
+
+! --- Mise a jour de Cv
+
+ iccfth = 432
+ imodif = 0
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ propce(1, ipproc(icv(iphas)) ) , w1 , w2 , w3 , &
+! ---------------------------------
+ rdevel , rtuser , ra )
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+
+! --- A enlever a l'utilisation
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+
+
+
+!===============================================================================
+! EXEMPLE 4 : CONDUCTIVITE THERMIQUE VARIABLE EN FONCTION
+! =========== DE LA TEMPERATURE
+
+! Ci dessous on donne pour toutes les phases la meme loi pour lambda
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! --- Boucle sur les phases : debut
+do iphas = 1, nphas
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable temp�rature pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ ivart = isca(itempk(iphas))
+
+! --- Rang de Lambda de la temperature de phase courante IPHAS
+! dans PROPCE, prop. physiques au centre des elements : IPCVSL
+
+ if(ivisls(itempk(iphas)).gt.0) then
+ ipcvsl = ipproc(ivisls(itempk(iphas)))
+ else
+ ipcvsl = 0
+ endif
+
+! --- Stop si Lambda n'est pas variable
+
+ if(ipcvsl.le.0) then
+ write(nfecra,1010) &
+ itempk(iphas), itempk(iphas), ivisls(itempk(iphas))
+ call csexit (1)
+ endif
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varal = -3.3283d-7
+ varbl = 3.6021d-5
+ varcl = 1.2527d-4
+ vardl = 0.58923d0
+
+
+
+! Lambda en W/(m K) au centre des cellules
+! ----------------------------------------
+! loi Lambda =
+! { T *( T *( AL * T + BL )+ CL )+ DL }
+! soit PROPCE(IEL,IPCVSL) =
+! & (XRTP*(XRTP*(VARAL*XRTP+VARBL)+VARCL)+VARDL)
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvsl) = &
+ (xrtp*(xrtp*(varal*xrtp+varbl)+varcl)+vardl)
+ enddo
+
+
+enddo
+! --- Boucle sur les phases : fin
+
+
+! --- A enlever a l'utilisation
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+
+
+
+!===============================================================================
+! EXEMPLE 5 : DIFFUSIVITE VARIABLE EN FONCTION DE LA TEMPERATURE
+! =========== POUR LES SCALAIRES UTILISATEURS
+! A l'exclusion de
+! temperature, enthalpie (traites plus haut)
+! variances de fluctuations (propriete egale a celle du
+! scalaire associe)
+
+! Ci dessous on donne pour tous les scalaires (aux exclusions
+! ci-dessus pres) la meme loi pour la diffusivite
+! Les valeurs de cette propriete doivent etre fournies au centre des
+! cellules.
+! ===================================================================
+
+! --- Boucle sur les phases : debut
+do ii = 1, nscaus
+
+! --- Numero du scalaire utilisateur II dans la liste de tous les scalaires
+ iscal = ii
+
+
+! --- S'il s'agit de la temperature,
+! son cas a deja ete traite plus haut
+ ith = 0
+ do iphas = 1, nphas
+ if (iscal.eq.itempk(iphas)) ith = 1
+ enddo
+
+! --- Si la variable est une fluctuation, sa diffusivite est
+! la meme que celle du scalaire auquel elle est rattachee :
+! il n'y a donc rien a faire ici : on passe directement
+! a la variable suivante sans renseigner PROPCE(IEL,IPCVSL).
+
+ if (ith.eq.0.and.iscavr(iscal).le.0) then
+! --- On ne traite ici que les variables non thermiques
+! et qui ne sont pas des fluctuations
+
+
+! Positions des variables, coefficients
+! -------------------------------------
+
+! --- Numero de variable temp�rature pour la phase courante iphas
+! (Pour utiliser le scalaire utilisateur 2 a la place, ecrire
+! IVART = ISCA(2)
+
+ ivart = isca(itempk(iphas))
+
+
+! --- Rang de Lambda du scalaire
+! dans PROPCE, prop. physiques au centre des elements : IPCVSL
+
+ if(ivisls(iscal).gt.0) then
+ ipcvsl = ipproc(ivisls(iscal))
+ else
+ ipcvsl = 0
+ endif
+
+! --- Stop si Lambda n'est pas variable
+
+ if(ipcvsl.le.0) then
+ write(nfecra,1010) iscal, iscal, ivisls(iscal)
+ call csexit (1)
+ endif
+
+! --- Coefficients des lois choisis et imposes par l'utilisateur
+! Les valeurs donnees ici sont fictives
+
+ varal = -3.3283d-7
+ varbl = 3.6021d-5
+ varcl = 1.2527d-4
+ vardl = 0.58923d0
+
+
+! Lambda en kg/(m s) au centre des cellules
+! ------------------------------------------
+! loi Lambda =
+! T *( T *( AL * T + BL )+ CL )+ DL
+! soit PROPCE(IEL,IPCVSL) =
+! & XRTP*(XRTP*(VARAL*XRTP+VARBL)+VARCL)+VARDL
+
+
+ do iel = 1, ncel
+ xrtp = rtp(iel,ivart)
+ propce(iel,ipcvsl) = &
+ (xrtp*(xrtp*(varal*xrtp+varbl)+varcl)+vardl)
+ enddo
+
+
+ endif
+! --- Tests sur ITH et ISCAVR : fin
+
+enddo
+! --- Boucle sur les scalaires : fin
+
+
+! --- A enlever a l'utilisation
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+
+
+
+
+!===============================================================================
+
+!===============================================================================
+! FORMATS
+!----
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DONNEES DE CALCUL INCOHERENTES ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,/,&
+'@ usini1 indique que la capacite calorifique a pression ',/,&
+'@ constante est uniforme ICP(',I10 ,') = ',I10 ,' ',/,&
+'@ alors que l''on cherche a definir une capacite ',/,&
+'@ calorifique variable dans uscfpv. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1 ou uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DONNEES DE CALCUL INCOHERENTES ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,/,&
+'@ uscfth indique que la capacite calorifique a volume ',/,&
+'@ constant est uniforme ICV(',I10 ,') = ',I10 ,' ',/,&
+'@ alors que l''on cherche a definir une capacite ',/,&
+'@ calorifique variable dans uscfpv. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1 ou uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DONNEES DE CALCUL INCOHERENTES ',/,&
+'@ ',/,&
+'@ Pour le scalaire ',I10 ,/,&
+'@ usini1 indique que la diffusivite est uniforme ',/,&
+'@ IVISLS(',I10 ,') = ',I10 ,' alors que ',/,&
+'@ uscfpv impose une diffusivite variable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier usini1 ou uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 2000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ DONNEES DE CALCUL INCOHERENTES ',/,&
+'@ ',/,&
+'@ Pour la phase ',I10 ,/,&
+'@ uscfx2 indique que la viscosite en volume est uniforme',/,&
+'@ IVISCV(',I10 ,') = ',I10 ,' alors que ',/,&
+'@ uscfpv impose une viscosite en volume variable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier uscfx2 ou uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DU CALCUL DES GRANDEURS PHYSIQUES',/,&
+'@ ========= ',/,&
+'@ APPEL A csexit DANS LE SOUS PROGRAMME uscfpv ',/,&
+'@ ',/,&
+'@ Un appel a csexit (arret) a ete rencontre dans le sous ',/,&
+'@ programme uscfpv. L''utilisateur est invite a verifier',/,&
+'@ que les exemples standard fournis par defaut ont bien ',/,&
+'@ ete elimines si besoin. ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Modifier uscfpv. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cfbl/uscfth.f90 b/users/cfbl/uscfth.f90
new file mode 100644
index 0000000..77c6c15
--- /dev/null
+++ b/users/cfbl/uscfth.f90
@@ -0,0 +1,1996 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscfth &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ sorti1 , sorti2 , gamagr , xmasmr , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE UTILISATEUR POUR ENTREE DES PARAMETRES THERMODYNAMIQUES
+
+
+! CE SOUS PROGRAMME UTILISATEUR EST OBLIGATOIRE
+! =============================================
+
+
+
+! CALCUL DE LA PROPRIETE THERMODYNAMIQUE VOULUE
+! EN FONCTION DES PARAMETRES DONNES ET DE LA THERMO CHOISIE
+
+
+! LOIS THERMODYNAMIQUES IMPLEMENTEES :
+! ====================================
+
+! 1. GAZ PARFAIT (fournir la masse molaire XMASML)
+
+! 2. GAZ PARFAIT A GAMMA VARIABLE (� adapter)
+
+! 3. VAN DER WAALS (pas encore implemente)
+
+
+! CALCULS IMPLEMENTES :
+! =====================
+
+! VARIABLE P rho T e h s epsilon-CvT C.L.
+! CODE 1 2 3 4 5 6 7 9
+
+
+! CODE DU CALCUL : *VARIABLE i : i
+
+! di|
+! *DERIVEE PARTIELLE --| : ijk
+! dj|k
+
+! *CALCUL DES VARIABLES A PARTIR DE i ET j : ij
+
+! Et pour un reperage automatique, on utilise les nombres premiers
+! P rho T e s
+! 2 3 5 7 13 (* 10000 pour les calculs aux cellules)
+
+
+
+! -> OPTIONS DE CALCUL : ICCFTH = -1
+
+! -> INITIALISATIONS PAR DEFAUT : ICCFTH = 0
+
+! -> CALCUL DE GAMMA : ICCFTH = 1
+
+! -> VERIFICATION DE rho : ICCFTH = -2
+
+! -> VERIFICATION DE E : ICCFTH = -4
+
+! -> CALCUL DE T ET e EN FONCTION DE P ET rho : ICCFTH = 12 ou 60000
+
+! -> CALCUL DE rho ET e EN FONCTION DE P ET T : ICCFTH = 13 ou 100000
+
+! -> CALCUL DE rho ET T EN FONCTION DE P ET e : ICCFTH = 14 ou 140000
+
+! -> CALCUL DE P ET e EN FONCTION DE rho ET T : ICCFTH = 23 ou 150000
+
+! -> CALCUL DE P ET T EN FONCTION DE rho ET e : ICCFTH = 24 ou 210000
+
+! 2 dP |
+! -> CALCUL DE c = ----| : ICCFTH = 126
+! drho|s
+
+! dP|
+! -> CALCUL DE beta = --| : ICCFTH = 162
+! ds|rho
+
+! de|
+! -> CALCUL DE Cv = --| : ICCFTH = 432
+! dT|rho
+
+! -> CALCUL DE L'ENTROPIE : ICCFTH = 6
+
+
+! -> CALCUL DE epsilon - Cv.T : ICCFTH = 7
+
+
+! -> CALCUL DES CONDITIONS AUX LIMITES
+! - SYMETRIE : ICCFTH = 90
+! - PAROI : ICCFTH = 91
+! - ENTREE : ICCFTH = 92
+! - SORTIE : ICCFTH = 93
+! - T ET e EN FONCTION DE P ET rho : ICCFTH = 912 ou 60900
+! - rho ET e EN FONCTION DE P ET T : ICCFTH = 913 ou 100900
+! - rho ET T EN FONCTION DE P ET e : ICCFTH = 914 ou 140900
+! - P ET e EN FONCTION DE rho ET T : ICCFTH = 923 ou 150900
+! - P ET T EN FONCTION DE rho ET e : ICCFTH = 924 ou 210900
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! iccfth ! e ! <-- ! numero du type de calcul demande !
+! imodif ! e ! <-- ! si calcul aux cellules : modif de rtp !
+! ! ! ! quand imodif > 0 (en particulier !
+! ! ! ! automatise l'init (voir uscfxi) !
+! ! ! ! si calcul aux faces : numero de face !
+! ! ! ! automatise l'init (voir uscfxi) !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp,rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! sorti1,2(*) ! tr ! --> ! variables de sortie !
+! ! ! ! (inutilise si iccfth.lt.0) !
+! gamagr(*) ! tr ! --> ! constante gamma equivalent du gaz !
+! ! ! ! (inutilise si iccfth.lt.0) !
+! ! ! ! (premiere case utilisee en g.p.) !
+! xmasmr(*) ! tr ! --> ! masse molaire des constituants du gaz !
+! ! ! ! (inutilise si iccfth.lt.0) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "entsor.h"
+include "parall.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer iccfth , imodif , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*),propfa(nfac,*),propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision sorti1(*), sorti2(*), gamagr(*), xmasmr(*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iiph , ifac0
+integer ierr
+integer iel , ifac , ivar
+integer ipriph , irhiph , itkiph , ieniph
+integer iuiph , iviph , iwiph
+integer iclp , iclr , iclt , icle
+integer iclu , iclv , iclw
+integer iutile
+double precision gamagp , xmasml , enint
+double precision xmach , xmachi , xmache , dxmach
+
+integer npmax
+parameter (npmax = 1000)
+double precision cstgr(npmax)
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. INITIALISATION
+! Pas d'intervention utilisateur requise.
+!===============================================================================
+
+! Pointeurs m�moire
+idebia = idbia0
+idebra = idbra0
+
+! Indicateur d'erreur (stop si non nul)
+ierr = 0
+
+! Position des variables
+if(iccfth.ge.0.or.iccfth.le.-2) then
+ ipriph = ipr(iphas)
+ irhiph = isca(irho (iphas))
+ itkiph = isca(itempk(iphas))
+ ieniph = isca(ienerg(iphas))
+ iuiph = iu(iphas)
+ iviph = iv(iphas)
+ iwiph = iw(iphas)
+ iclp = iclrtp(ipriph,icoef)
+ iclr = iclrtp(irhiph,icoef)
+ iclt = iclrtp(itkiph,icoef)
+ icle = iclrtp(ieniph,icoef)
+ iclu = iclrtp(iuiph,icoef)
+ iclv = iclrtp(iviph,icoef)
+ iclw = iclrtp(iwiph,icoef)
+endif
+
+
+! Si calcul aux cellules,
+! indique, si > 0, que RTP doit etre modifi�
+! Si calcul aux faces,
+! indique le num�ro de la face consid�r�e
+ifac0 = imodif
+
+!===============================================================================
+! 1. CHOIX DE LA THERMODYNAMIQUE POUR CHAQUE PHASE
+! Intervention utilisateur requise.
+!===============================================================================
+
+! --> IEOS = 1 : Gaz Parfait avec Gamma constant
+! --> IEOS = 2 : Gaz Parfait avec Gamma variable
+! --> IEOS = 3 : Equation d'etat de Van Der Waals
+
+do iiph = 1, nphas
+ ieos(iiph) = 1
+enddo
+
+
+! NE PAS OUBLIER DE RENSEIGNER LES PARAMETRES
+! DANS LA THERMODYNAMIQUE CHOISIE
+! ===========================================
+
+
+!===============================================================================
+! 2. GAZ PARFAIT
+!===============================================================================
+
+if(ieos(iphas).eq.1) then
+
+!===============================================================================
+! 2.1. PARAMETRES A RENSEIGNER PAR L'UTILISATEUR
+! Intervention utilisateur requise.
+!===============================================================================
+
+! Pour chaque phase
+
+! Masse molaire du gaz (en kg/mol)
+
+ if(iccfth.ge.0) then
+
+ if(iphas.eq.1) then
+
+ xmasml = 28.8d-3
+
+ endif
+
+ endif
+
+!===============================================================================
+! 2.2. LOIS IMPLEMENTEES PAR DEFAUT
+! Pas d'intervention utilisateur requise.
+!===============================================================================
+
+! CALCUL DE LA CONSTANTE GAMAGP
+! =============================
+
+! On la suppose sup�rieure ou �gale � 1.
+! On la calcule � chaque appel, m�me si cela peut para�tre cher, dans
+! par coh�rence avec le cas gamma variable, pour lequel, on n'a pas
+! pr�vu de la conserver. Avec un save et un test, on pourrait
+! s'affranchir du calcul si n�cessaire.
+
+ if(iccfth.gt.0) then
+
+ gamagp = 1.d0 + rr/(xmasml*cp0(iphas)-rr)
+
+ if(gamagp.lt.1.d0) then
+ write(nfecra,1010) gamagp
+ call csexit (1)
+ endif
+
+! On renvoie gamma si demande
+ if(iccfth.eq.1) then
+ gamagr(1) = gamagp
+ endif
+
+ endif
+
+
+! OPTIONS DE CALCUL : Cp ET Cv CONSTANTS (hypoth�se gaz parfait)
+! =================
+
+! La valeur de CP0 est � fournir dans usini1. La valeur de CV0
+! est calcul�e plus bas (� partir de CP0).
+
+
+ if(iccfth.eq.-1) then
+
+ icp(iphas) = 0
+ icv(iphas) = 0
+
+
+! INITIALISATIONS PAR DEFAUT (avant uscfxi)
+! ==========================
+! T0 est forc�ment positif (v�rifi� dans verini)
+
+ elseif(iccfth.eq.0) then
+
+ cv0(iphas) = cp0(iphas) - rr/xmasml
+
+ if ( isuite .eq. 0 ) then
+ do iel = 1, ncel
+ rtp(iel,irhiph) = p0(iphas)*xmasml/(rr*t0(iphas))
+ rtp(iel,ieniph) = cv0(iphas)*t0(iphas)
+ enddo
+ endif
+
+
+! VERIFICATION DE rho
+! ===================
+
+ elseif(iccfth.eq.-2) then
+
+
+! --- Clipping si rho est exactement nul + write + stop
+! En effet, si c'est le cas, on va n�cessairement se planter
+! dans la thermo (bon, d'accord, pas dans tous les cas, mais
+! pour le moment, je pr�sume que les fluides � traiter seront
+! assez classiques, avec des pbs � rho = 0)
+! Appel� en fin de resolution de la masse volumique (apres
+! clipping classique et avant communication parallele).
+
+ ierr = 0
+ do iel = 1, ncel
+ if(rtp(iel,irhiph).le.0.d0) then
+ rtp(iel,irhiph) = epzero
+ ierr = ierr + 1
+ endif
+ enddo
+ if(irangp.ge.0) then
+ call parcpt (ierr)
+ endif
+ if(ierr.gt.0) then
+ ntmabs = ntcabs
+ write(nfecra,8000)ierr, epzero
+ endif
+
+
+! VERIFICATION DE e
+! ===================
+
+ elseif(iccfth.eq.-4) then
+
+
+! --- Clipping si e est exactement nul + write + stop
+! En effet, si c'est le cas, on va n�cessairement se planter
+! dans la thermo (bon, d'accord, pas dans tous les cas, mais
+! pour le moment, je pr�sume que les fluides � traiter seront
+! assez classiques, avec des pbs � e = 0)
+
+ ierr = 0
+ do iel = 1, ncel
+ enint = rtp(iel,ieniph) &
+ - 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 &
+ + rtp(iel,iwiph)**2 )
+ if(enint.le.0.d0) then
+ rtp(iel,ieniph) = epzero &
+ + 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 &
+ + rtp(iel,iwiph)**2 )
+ ierr = ierr + 1
+ endif
+ enddo
+ if(irangp.ge.0) then
+ call parcpt (ierr)
+ endif
+ if(ierr.gt.0) then
+ ntmabs = ntcabs
+ write(nfecra,8100)ierr, epzero
+ endif
+
+
+! CALCUL DE T ET e EN FONCTION DE P ET rho :
+! ========================================
+
+ elseif(iccfth.eq.12.or.iccfth.eq.60000) then
+
+! Test des valeurs de rho
+ ierr = 0
+ do iel = 1, ncel
+ if(rtp(iel,irhiph).le.0.d0) then
+ write(nfecra,3010)rtp(iel,irhiph),iel
+ endif
+ enddo
+! Si pb on s'arrete, car rho a �t� fourni par l'utilisateur
+! (initialisation erron�e sans doute)
+ if(ierr.eq.1) then
+ call csexit (1)
+ endif
+
+ do iel = 1, ncel
+! Temperature
+ sorti1(iel) = xmasml*rtp(iel,ipriph)/(rr*rtp(iel,irhiph))
+! Energie totale
+ sorti2(iel) = cv0(iphas)*sorti1(iel) &
+ + 0.5d0*( rtp(iel,iuiph)**2 + rtp(iel,iviph)**2 &
+ + rtp(iel,iwiph)**2 )
+ enddo
+
+! Affectation a RTP
+ if(imodif.gt.0) then
+ do iel = 1, ncel
+ rtp(iel,itkiph) = sorti1(iel)
+ rtp(iel,ieniph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE rho ET e EN FONCTION DE P ET T :
+! ========================================
+
+ elseif(iccfth.eq.13.or.iccfth.eq.100000) then
+
+! Test des valeurs de T
+ ierr = 0
+ do iel = 1, ncel
+ if(rtp(iel,itkiph).le.0.d0) then
+ write(nfecra,2010)rtp(iel,itkiph),iel
+ endif
+ enddo
+! Si pb on s'arrete, car T a �t� fourni par l'utilisateur
+! (initialisation erron�e par exemple, non en K ?)
+ if(ierr.eq.1) then
+ call csexit (1)
+ endif
+
+ do iel = 1, ncel
+! Masse volumique
+ sorti1(iel) = xmasml*rtp(iel,ipriph)/(rr*rtp(iel,itkiph))
+! Energie totale
+ sorti2(iel) = cv0(iphas)*rtp(iel,itkiph) &
+ + 0.5d0*( rtp(iel,iuiph)**2 + rtp(iel,iviph)**2 &
+ + rtp(iel,iwiph)**2 )
+ enddo
+
+! Affectation a RTP
+ if(imodif.gt.0) then
+ do iel = 1, ncel
+ rtp(iel,irhiph) = sorti1(iel)
+ rtp(iel,ieniph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE rho ET T EN FONCTION DE P ET e :
+! ========================================
+
+ elseif(iccfth.eq.14.or.iccfth.eq.140000) then
+
+ do iel = 1, ncel
+! Energie interne (�vite de diviser par T)
+ enint = rtp(iel,ieniph) &
+ - 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 &
+ + rtp(iel,iwiph)**2 )
+! Masse volumique
+ sorti1(iel) = rtp(iel,ipriph) / ( (gamagp-1.d0) * enint )
+! Temperature
+ sorti2(iel) = xmasml * (gamagp-1.d0) * enint / rr
+ enddo
+
+! Affectation a RTP
+ if(imodif.gt.0) then
+ do iel = 1, ncel
+ rtp(iel,irhiph) = sorti1(iel)
+ rtp(iel,itkiph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE P ET e EN FONCTION DE rho ET T :
+! ========================================
+
+ elseif(iccfth.eq.23.or.iccfth.eq.150000) then
+
+ do iel = 1, ncel
+! Pression
+ sorti1(iel) = rtp(iel,irhiph)*rtp(iel,itkiph)*rr/xmasml
+! Energie totale
+ sorti2(iel) = cv0(iphas)*rtp(iel,itkiph) &
+ + 0.5d0*( rtp(iel,iuiph)**2 + rtp(iel,iviph)**2 &
+ + rtp(iel,iwiph)**2 )
+ enddo
+
+! Affectation a RTP
+ if(imodif.gt.0) then
+ do iel = 1, ncel
+ rtp(iel,ipriph) = sorti1(iel)
+ rtp(iel,ieniph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE P ET T EN FONCTION DE rho ET e :
+! ========================================
+
+ elseif(iccfth.eq.24.or.iccfth.eq.210000) then
+
+ do iel = 1, ncel
+! Energie interne (�vite de diviser par T)
+ enint = rtp(iel,ieniph) &
+ - 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 &
+ + rtp(iel,iwiph)**2 )
+! Pression
+ sorti1(iel) = (gamagp-1.d0) * rtp(iel,irhiph) * enint
+! Temperature
+ sorti2(iel) = xmasml * (gamagp-1.d0) * enint / rr
+ enddo
+
+! Affectation a RTP
+ if(imodif.gt.0) then
+ do iel = 1, ncel
+ rtp(iel,ipriph) = sorti1(iel)
+ rtp(iel,itkiph) = sorti2(iel)
+ enddo
+ endif
+
+! 2 2 P
+! CALCUL DE c EN FONCTION DE P ET rho : c = gamma*---
+! ==================================== rho
+
+ elseif(iccfth.eq.126) then
+
+! Test des valeurs de rho (on peut �liminer ce test pour optimiser)
+ iutile = 0
+ if(iutile.eq.1) then
+ ierr = 0
+ do iel = 1, ncel
+ if(rtp(iel,irhiph).le.0.d0) then
+ write(nfecra,4010)rtp(iel,irhiph),iel
+ endif
+ enddo
+ if(ierr.eq.1) then
+ call csexit (1)
+ endif
+ endif
+
+ do iel = 1, ncel
+ sorti1(iel) = gamagp * rtp(iel,ipriph) / rtp(iel,irhiph)
+ enddo
+
+! gamma
+! CALCUL DE beta EN FONCTION DE P ET rho : beta = rho
+! ======================================
+
+ elseif(iccfth.eq.162) then
+
+! Test des valeurs de rho (on peut �liminer ce test pour optimiser)
+ iutile = 0
+ if(iutile.eq.1) then
+ ierr = 0
+ do iel = 1, ncel
+ if(rtp(iel,irhiph).lt.0.d0) then
+ write(nfecra,4020)rtp(iel,irhiph),iel
+ endif
+ enddo
+ if(ierr.eq.1) then
+ call csexit (1)
+ endif
+ endif
+
+ do iel = 1, ncel
+ sorti1(iel) = rtp(iel,irhiph)**gamagp
+ enddo
+
+
+! CALCUL DE LA CHALEUR MASSIQUE A VOLUME CONSTANT
+! ===============================================
+
+! elle est constante !
+
+! P
+! CALCUL DE L'ENTROPIE EN FONCTION DE P ET rho : s = --------
+! ============================================ gamma
+! rho
+ elseif(iccfth.eq.6) then
+
+! Test des valeurs de rho (on peut �liminer ce test pour optimiser)
+ ierr = 0
+ do iel = 1, ncel
+ if(rtp(iel,irhiph).le.0.d0) then
+ write(nfecra,4030)rtp(iel,irhiph),iel
+ endif
+ enddo
+ if(ierr.eq.1) then
+ call csexit (1)
+ endif
+
+ do iel = 1, ncel
+ sorti1(iel) = rtp(iel,ipriph) / (rtp(iel,irhiph)**gamagp)
+ enddo
+
+
+! CALCUL DE epsilon - Cv.T : epsilon - Cv.T = 0
+! ========================
+
+ elseif(iccfth.eq.7) then
+
+! --- A l'interieur du domaine
+
+ do iel = 1, ncel
+ sorti1(iel) = 0.d0
+ enddo
+
+! --- Sur les bords
+
+ do ifac = 1, nfabor
+ sorti2(ifac) = 0.d0
+ enddo
+
+
+! CALCUL DES CONDITIONS AUX LIMITES : sur la face IFAC = IFAC0
+! =================================
+
+! PAROI
+! -----
+
+ elseif(iccfth.eq.91) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! --- Calcul du nombre de Mach normal a la frontiere
+
+ xmach = &
+ ( rtp(iel,iuiph)*surfbo(1,ifac) &
+ + rtp(iel,iviph)*surfbo(2,ifac) &
+ + rtp(iel,iwiph)*surfbo(3,ifac) ) / ra(isrfbn+ifac-1) &
+ / sqrt( gamagp * rtp(iel,ipriph) / rtp(iel,irhiph) )
+
+! --- Pression
+
+! On utilise un Neumann en pression. Bien que cela ne permette
+! pas d'utiliser Rusanov, on espere que cela stabilise.
+! On ajoute un test pour eviter de basculer
+! de detente a choc d'un pas de temps � l'autre
+
+! Detente
+ if(xmach.lt.0.d0.and.coefb(ifac,iclp).le.1.d0) then
+
+ if(xmach.gt.2.d0/(1.d0-gamagp)) then
+ coefb(ifac,iclp) = (1.d0 + (gamagp-1.d0)/2.d0 * xmach) &
+ ** (2.d0*gamagp/(gamagp-1.d0))
+! Si on detend trop fort : Dirichlet nul en pression
+! (la valeur de COEFB ici est utilisee comme indicateur
+! et sera retrait�e plus tard dans cfxtcl)
+ else
+ coefb(ifac,iclp) = rinfin
+ endif
+
+! Choc
+ elseif(xmach.gt.0.d0.and.coefb(ifac,iclp).ge.1.d0) then
+
+ coefb(ifac,iclp) = 1.d0 + gamagp*xmach &
+ *( (gamagp+1.d0)/4.d0*xmach &
+ + sqrt(1.d0 + (gamagp+1.d0)**2/16.d0*xmach**2) )
+
+! Oscillation ou Mach nul
+ else
+ coefb(ifac,iclp) = 1.d0
+ endif
+
+
+! SYMETRIE
+! --------
+
+ elseif(iccfth.eq.90) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! --- On impose un Neumann Homogene en Pression par defaut
+! Pas d'intervention requise
+
+
+! --- ENTREE SUBSONIQUE, RHO ET U DONNES (subsonique par hypoth�se)
+! ----------------------------------
+
+! Contrairement � la conception initiale, on impose un Dirichlet
+! explicite sur la pression et non pas un flux (on se base cpdt
+! sur la meme valeur physique).
+! Ceci a l'avantage de permettre l'utilisation de Rusanov pour
+! lisser les conditions d'entree.
+! En outre, ceci permet de ne pas avoir � g�rer le remplissage de
+! coefb ici (c'est secondaire, car il faut le faire pour la paroi).
+! Si on a des oscillations en temps, on pourra essayer d'eviter
+! le basculement de d�tente � choc d'un pas de temps � l'autre.
+! La pertinence de cette d�marche reste � d�montrer.
+
+ elseif(iccfth.eq.92) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! --- Calcul du nombre de Mach entrant normalement a la frontiere
+
+ xmachi = &
+ ( rtp(iel,iuiph)*surfbo(1,ifac) &
+ + rtp(iel,iviph)*surfbo(2,ifac) &
+ + rtp(iel,iwiph)*surfbo(3,ifac) ) / ra(isrfbn+ifac-1) &
+ / sqrt( gamagp * rtp(iel,ipriph) / rtp(iel,irhiph) )
+ xmache = &
+ ( coefa(ifac,iclu)*surfbo(1,ifac) &
+ + coefa(ifac,iclv)*surfbo(2,ifac) &
+ + coefa(ifac,iclw)*surfbo(3,ifac) ) /ra(isrfbn+ifac-1) &
+ / sqrt( gamagp * rtp(iel,ipriph) / rtp(iel,irhiph) )
+ dxmach = xmachi - xmache
+
+! --- Pression : Detente
+ if(dxmach.le.0.d0) then
+
+ if(dxmach.gt.2.d0/(1.d0-gamagp)) then
+ coefa(ifac,iclp) = rtp(iel,ipriph)* &
+ ( (1.d0 + (gamagp-1.d0)*0.50d0*dxmach) &
+ ** (2.d0*gamagp/(gamagp-1.d0)) )
+ elseif(dxmach.le.2.d0/(1.d0-gamagp) ) then
+ coefa(ifac,iclp) = 0.d0
+ endif
+
+! --- Pression : Choc
+ else
+ coefa(ifac,iclp) = rtp(iel,ipriph)* &
+ ( 1.d0 + gamagp*dxmach &
+ *( (gamagp+1.d0)*0.25d0*dxmach &
+ + sqrt(1.d0 + (gamagp+1.d0)**2/16.d0*dxmach**2) ) )
+ endif
+
+! --- Energie totale
+ coefa(ifac,iclp) = rtp(iel,ipriph)
+ coefa(ifac,icle) = &
+ coefa(ifac,iclp)/((gamagp-1.d0)*coefa(ifac,iclr)) &
+ + 0.5d0*(coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+
+! --- ENTREE SUBSONIQUE, RHO*U ET RHO*U*H DONNES (subsonique par hypoth�se)
+! ------------------------------------------
+
+! Ceci reste a completer :
+ elseif(iccfth.eq.94) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+ write(nfecra,7000)
+
+ call csexit (1)
+ !==========
+
+! P : a calculer avec un newton
+! u et rho en fonction de P
+! E en fonction de H
+! (je l'ai ecrit, reste � le coder ...)
+
+
+! SORTIE SUBSONIQUE (subsonique par hypoth�se)
+! -----------------
+
+ elseif(iccfth.eq.93) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! --- Detente :
+ if(coefa(ifac,iclp).le.rtp(iel,ipriph)) then
+
+! Masse volumique
+ coefa(ifac,iclr) = rtp(iel,irhiph) &
+ * (coefa(ifac,iclp)/rtp(iel,ipriph))**(1.d0/gamagp)
+
+! Vitesse
+ coefa(ifac,iclu) = rtp(iel,iuiph) &
+ + 2.d0/(gamagp-1.d0) &
+ * sqrt(gamagp*rtp(iel,ipriph)/rtp(iel,irhiph)) &
+ * (1.d0-(coefa(ifac,iclp)/rtp(iel,ipriph) &
+ )**((gamagp-1.d0)/(2.d0*gamagp))) &
+ * surfbo(1,ifac)/ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclv) = rtp(iel,iviph) &
+ + 2.d0/(gamagp-1.d0) &
+ * sqrt( gamagp*rtp(iel,ipriph)/rtp(iel,irhiph)) &
+ * (1.d0-(coefa(ifac,iclp)/rtp(iel,ipriph) &
+ )**((gamagp-1.d0)/(2.d0*gamagp))) &
+ * surfbo(2,ifac)/ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclw) = rtp(iel,iwiph) &
+ + 2.d0/(gamagp-1.d0) &
+ * sqrt( gamagp*rtp(iel,ipriph)/rtp(iel,irhiph)) &
+ * (1.d0-(coefa(ifac,iclp)/rtp(iel,ipriph) &
+ )**((gamagp-1.d0)/(2.d0/gamagp))) &
+ * surfbo(3,ifac)/ra(isrfbn+ifac-1)
+
+! Energie totale
+ coefa(ifac,icle) = &
+ coefa(ifac,iclp)/((gamagp-1.d0)*coefa(ifac,iclr)) &
+ + 0.5d0*(coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+! --- Choc :
+ else
+
+! Masse volumique
+ coefa(ifac,iclr) = rtp(iel,irhiph) &
+ * ( (gamagp+1.d0)*coefa(ifac,iclp) &
+ + (gamagp-1.d0)*rtp(iel,ipriph) ) &
+ / ( (gamagp-1.d0)*coefa(ifac,iclp) &
+ + (gamagp+1.d0)*rtp(iel,ipriph) )
+
+! Vitesse
+ coefa(ifac,iclu) = rtp(iel,iuiph) &
+ - (coefa(ifac,iclp)-rtp(iel,ipriph)) &
+ * sqrt(2.d0/ &
+ (rtp(iel,irhiph) &
+ *((gamagp+1.d0)*coefa(ifac,iclp) &
+ +(gamagp-1.d0)*rtp(iel,ipriph) ))) &
+ * surfbo(1,ifac)/ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclv) = rtp(iel,iviph) &
+ - (coefa(ifac,iclp)-rtp(iel,ipriph)) &
+ * sqrt(2.d0/ &
+ (rtp(iel,irhiph) &
+ *((gamagp+1.d0)*coefa(ifac,iclp) &
+ +(gamagp-1.d0)*rtp(iel,ipriph) ))) &
+ * surfbo(2,ifac)/ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclw) = rtp(iel,iwiph) &
+ - (coefa(ifac,iclp)-rtp(iel,ipriph)) &
+ * sqrt(2.d0/ &
+ (rtp(iel,irhiph) &
+ *((gamagp+1.d0)*coefa(ifac,iclp) &
+ +(gamagp-1.d0)*rtp(iel,ipriph) ))) &
+ * surfbo(3,ifac)/ra(isrfbn+ifac-1)
+
+! Energie totale
+ coefa(ifac,icle) = &
+ coefa(ifac,iclp)/((gamagp-1.d0)*coefa(ifac,iclr)) &
+ + 0.5d0*(coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+ endif
+
+
+! T ET e EN FONCTION DE P ET rho
+! ------------------------------
+! on a donn� des valeurs positives strictement (hypoth�se)
+
+ elseif(iccfth.eq.912.or.iccfth.eq.60900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Temperature
+ coefa(ifac,iclt) = &
+ xmasml*coefa(ifac,iclp)/(rr*coefa(ifac,iclr))
+
+! Energie totale
+ coefa(ifac,icle) = &
+ cv0(iphas)*coefa(ifac,iclt) &
+ + 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2 )
+
+
+! rho ET e EN FONCTION DE P ET T
+! ------------------------------
+
+ elseif(iccfth.eq.913.or.iccfth.eq.100900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Masse volumique
+ coefa(ifac,iclr) = &
+ xmasml*coefa(ifac,iclp)/(rr*coefa(ifac,iclt))
+
+! Energie totale
+ coefa(ifac,icle) = &
+ cv0(iphas)*coefa(ifac,iclt) &
+ + 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2 )
+
+
+! rho ET T EN FONCTION DE P ET e
+! ------------------------------
+
+ elseif(iccfth.eq.914.or.iccfth.eq.140900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Masse volumique
+ coefa(ifac,iclr) = coefa(ifac,iclp)/( (gamagp-1.d0)* &
+ (coefa(ifac,icle) &
+ - 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 &
+ + coefa(ifac,iclw)**2 ) ) )
+
+! Temperature
+ coefa(ifac,iclt)= &
+ xmasml*coefa(ifac,iclp)/(rr*coefa(ifac,iclr))
+
+
+! P ET e EN FONCTION DE rho ET T
+! ------------------------------
+
+ elseif(iccfth.eq.923.or.iccfth.eq.150900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Pression
+ coefa(ifac,iclp) = coefa(ifac,iclr)*rr/xmasml &
+ *coefa(ifac,iclt)
+
+! Energie totale
+ coefa(ifac,icle) = cv0(iphas) * coefa(ifac,iclt) &
+ + 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2 )
+
+
+! P ET T EN FONCTION DE rho ET e
+! ------------------------------
+
+ elseif(iccfth.eq.924.or.iccfth.eq.210900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Pression
+ coefa(ifac,iclp) = (gamagp-1.d0)*coefa(ifac,iclr) &
+ *( coefa(ifac,icle) &
+ - 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 &
+ + coefa(ifac,iclw)**2 ) )
+
+
+! Temperature
+ coefa(ifac,iclt)= &
+ xmasml*coefa(ifac,iclp)/(rr*coefa(ifac,iclr))
+
+
+! --- Fin de test sur GAZ PARFAIT
+ endif
+
+
+!===============================================================================
+! 2. GAZ PARFAIT AVEC GAMMA VARIABLE
+!===============================================================================
+
+elseif(ieos(iphas).eq.2) then
+
+!===============================================================================
+
+! PARAMETRES
+! ==========
+
+!-------------------------------------------------------------------------------
+
+! EXEMPLES (A recopier et a adapter apres 'PARAMETRES')
+ if(0.eq.1) then
+!-------------------------------------------------------------------------------
+
+! --> EXEMPLE 1 : GAZ PARFAIT A 3 CONSTITUANTS
+
+! Phase
+ if(iphas.eq.1) then
+
+! Masses molaires des constituants (en kg/mol)
+ cstgr(1) = 18.d-3
+ cstgr(2) = 32.d-3
+ cstgr(3) = 28.d-3
+
+! Calcul de la masse molaire du melange au centre des cellules
+ if(iccfth.gt.0) then
+ do iel = 1, ncel
+ xmasmr(iel) = 1.d0 / ( rtp(iel,isca(1))/cstgr(1) &
+ + rtp(iel,isca(2))/cstgr(2) &
+ + rtp(iel,isca(3))/cstgr(3) )
+ enddo
+
+
+! Calcul du GAMMA equivalent au centre des cellules
+ do iel = 1, ncel
+ gamagr(iel) = propce(iel,ipproc(icp(iphas))) &
+ / ( propce(iel,ipproc(icp(iphas))) - rr/xmasmr(iel) )
+ enddo
+ endif
+
+ endif
+
+!-------------------------------------------------------------------------------
+
+! FIN DES EXEMPLES
+ endif
+!-------------------------------------------------------------------------------
+
+!===============================================================================
+
+
+! TEST DE VALIDITE DE GAMAGR : GAMAGR >= 1
+! ==========================
+
+ ierr = 0
+
+ do iel = 1, ncel
+ if(iccfth.gt.0 .and. gamagr(iel).lt.1.d0) then
+ ierr = 1
+ write(nfecra,1020) iel, gamagr(iel)
+ endif
+ enddo
+
+ if(ierr.eq.1) then
+ call csexit (1)
+ endif
+
+
+! OPTIONS DE CALCUL : Cp ET Cv VARIABLES
+! =================
+
+ if(iccfth.eq.-1) then
+
+ icp(iphas) = 1
+ cp0(iphas) = epzero
+ icv(iphas) = 1
+ cv0(iphas) = epzero
+
+
+! INITIALISATIONS PAR DEFAUT :
+! ==========================
+
+ elseif(iccfth.eq.0) then
+
+ do iel = 1, ncel
+ propce(iel,ipproc(icp(iphas))) = cp0(iphas)
+ propce(iel,ipproc(icv(iphas))) = &
+ cp0(iphas) - rr/xmasmr(iel)
+ rtp(iel,irhiph) = p0(iphas)*xmasmr(iel)/rr/t0(iphas)
+ rtp(iel,ieniph) = &
+ propce(iel,ipproc(icv(iphas)))*t0(iphas)
+ enddo
+
+
+! CALCUL DE T ET e EN FONCTION DE P ET rho :
+! ========================================
+
+ elseif(iccfth.eq.12) then
+
+ do iel = 1, ncel
+
+! Temperature
+ sorti1(iel) = &
+ xmasmr(iel)/rr*rtp(iel,ipriph)/rtp(iel,irhiph)
+
+! Energie totale
+ sorti2(iel) = propce(iel,ipproc(icv(iphas)))*sorti1(iel) &
+ + 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 + rtp(iel,iwiph)**2 )
+
+ enddo
+
+
+ if(imodif.gt.0) then
+! Affectation directe a RTP
+ do iel = 1, ncel
+ rtp(iel,itkiph) = sorti1(iel)
+ rtp(iel,ieniph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE rho ET e EN FONCTION DE P ET T :
+! ========================================
+
+ elseif(iccfth.eq.13) then
+
+ do iel = 1, ncel
+
+! Masse volumique
+ sorti1(iel) = &
+ xmasmr(iel)/rr*rtp(iel,ipriph)/rtp(iel,itkiph)
+
+! Energie totale
+ sorti2(iel) = &
+ propce(iel,ipproc(icv(iphas)))*rtp(iel,itkiph) &
+ + 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 + rtp(iel,iwiph)**2 )
+
+ enddo
+
+
+ if(imodif.gt.0) then
+! Affectation directe a RTP
+ do iel = 1, ncel
+ rtp(iel,irhiph) = sorti1(iel)
+ rtp(iel,ieniph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE rho ET T EN FONCTION DE P ET e :
+! ========================================
+
+ elseif(iccfth.eq.14) then
+
+ do iel = 1, ncel
+
+! Masse volumique
+ sorti1(iel) = &
+ rtp(iel,ipriph)/(gamagr(iel)-1.d0)/( rtp(iel,ieniph) &
+ - 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 + rtp(iel,iwiph)**2 ) )
+
+! Temperature
+ sorti2(iel) = xmasmr(iel)/rr*rtp(iel,ipriph)/sorti1(iel)
+
+ enddo
+
+
+ if(imodif.gt.0) then
+! Affectation directe a RTP
+ do iel = 1, ncel
+ rtp(iel,irhiph) = sorti1(iel)
+ rtp(iel,itkiph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE P ET e EN FONCTION DE rho ET T :
+! ========================================
+
+ elseif(iccfth.eq.23) then
+
+ do iel = 1, ncel
+
+! Pression
+ sorti1(iel) = &
+ rtp(iel,irhiph)*rr/xmasmr(iel)*rtp(iel,itkiph)
+
+! Energie totale
+ sorti2(iel) = &
+ propce(iel,ipproc(icv(iphas)))*rtp(iel,itkiph) &
+ + 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 + rtp(iel,iwiph)**2 )
+
+ enddo
+
+
+ if(imodif.gt.0) then
+! Affectation directe a RTP
+ do iel = 1, ncel
+ rtp(iel,ipriph) = sorti1(iel)
+ rtp(iel,ieniph) = sorti2(iel)
+ enddo
+ endif
+
+
+! CALCUL DE P ET T EN FONCTION DE rho ET e :
+! ========================================
+
+ elseif(iccfth.eq.24) then
+
+ do iel = 1, ncel
+
+! Pression
+ sorti1(iel) = &
+ (gamagr(iel)-1.d0)*rtp(iel,irhiph)*( rtp(iel,ieniph) &
+ - 0.5d0*( rtp(iel,iuiph)**2 &
+ + rtp(iel,iviph)**2 + rtp(iel,iwiph)**2 ) )
+
+! Temperature
+ sorti2(iel) = xmasmr(iel)/rr*sorti1(iel)/rtp(iel,irhiph)
+
+ enddo
+
+ if(imodif.gt.0) then
+! Affectation directe a RTP
+ do iel = 1, ncel
+ rtp(iel,ipriph) = sorti1(iel)
+ rtp(iel,itkiph) = sorti2(iel)
+ enddo
+ endif
+
+! 2 2 P
+! CALCUL DE c EN FONCTION DE P ET rho : c = gamma*---
+! ==================================== rho
+
+ elseif(iccfth.eq.126) then
+
+ do iel = 1, ncel
+
+! --- Test de positivite de P
+ if(rtp(iel,ipriph).lt.0.d0) then
+ write(nfecra,1110) iel , rtp(iel,ipriph)
+ ierr = 1
+
+! --- Test de positivite de rho
+ elseif(rtp(iel,irhiph).le.0.d0) then
+ write(nfecra,1120) iel , rtp(iel,irhiph)
+ ierr = 1
+
+ else
+
+! --- Calcul
+ sorti1(iel) = &
+ gamagr(iel) * rtp(iel,ipriph) / rtp(iel,irhiph)
+
+ endif
+
+ enddo
+
+ if(ierr.eq.1) call csexit (1)
+
+! gamma
+! CALCUL DE beta EN FONCTION DE P ET rho : beta = rho
+! ======================================
+
+ elseif(iccfth.eq.162) then
+
+ do iel = 1, ncel
+
+! --- Test de positivite de rho
+ if(rtp(iel,irhiph).lt.0.d0) then
+ write(nfecra,1220) iel , rtp(iel,irhiph)
+ ierr = 1
+
+ else
+
+! --- Calcul
+ sorti1(iel) = rtp(iel,irhiph)**gamagr(iel)
+
+ endif
+
+ enddo
+
+ if(ierr.eq.1) call csexit (1)
+
+! R
+! CALCUL DE Cv : Cv = Cp - ---
+! ============ M
+
+ elseif(iccfth.eq.432) then
+
+ do iel = 1, ncel
+
+ sorti1(iel) = propce(iel,ipproc(icp(iphas)))-rr/xmasmr(iel)
+
+ enddo
+
+ if(ierr.eq.1) call csexit (1)
+
+! P
+! CALCUL DE L'ENTROPIE EN FONCTION DE P ET rho : s = --------
+! ============================================ gamma
+! rho
+ elseif(iccfth.eq.6) then
+
+ do iel = 1, ncel
+
+! --- Test de positivite de P
+ if(rtp(iel,ipriph).lt.0.d0) then
+ write(nfecra,1310) iel , rtp(iel,ipriph)
+ ierr = 1
+
+! --- Test de positivite de rho
+ elseif(rtp(iel,irhiph).le.0.d0) then
+ write(nfecra,1320) iel , rtp(iel,irhiph)
+ ierr = 1
+
+ else
+
+! --- Calcul
+ sorti1(iel) = &
+ rtp(iel,ipriph) / (rtp(iel,irhiph)**gamagr(iel))
+
+ endif
+
+ enddo
+
+ if(ierr.eq.1) call csexit (1)
+
+
+! CALCUL DE epsilon - Cv.T : epsilon - Cv.T = 0
+! ========================
+
+ elseif(iccfth.eq.7) then
+
+! --- A l'interieur du domaine
+
+ do iel = 1, ncel
+
+ sorti1(iel) = 0.d0
+
+ enddo
+
+! --- Sur les bords
+
+ do ifac = 1, nfabor
+
+ sorti2(ifac) = 0.d0
+
+ enddo
+
+ if(ierr.eq.1) call csexit (1)
+
+
+! CALCUL DES CONDITIONS AUX LIMITES :
+! =================================
+
+! PAROI/SYMETRIE
+! --------------
+ elseif(iccfth.eq.91) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! --- Calcul du nombre de Mach normal a la frontiere
+
+ xmach = ( rtp(iel,iuiph)*surfbo(1,ifac) &
+ + rtp(iel,iviph)*surfbo(2,ifac) &
+ + rtp(iel,iwiph)*surfbo(3,ifac) ) / ra(isrfbn+ifac-1) &
+ / sqrt( gamagr(iel)*rtp(iel,ipriph)/rtp(iel,irhiph) )
+
+! --- Pression / Entropie : Detente
+
+ coefa(ifac,iclp) = 0.d0
+
+ if(xmach.le.0.d0 .and. xmach.gt.2.d0/(1.d0-gamagr(iel))) then
+ coefb(ifac,iclp) = (1.d0 + (gamagr(iel)-1.d0)/2.d0 * xmach) &
+ ** (2.d0*gamagr(iel)/(gamagr(iel)-1.d0))
+ coefb(ifac,iclt) = 1.d0
+
+ elseif(xmach.le.2.d0/(1.d0-gamagr(iel)) ) then
+ coefb(ifac,iclp) = 0.d0
+ coefb(ifac,iclt) = 1.d0
+
+! --- Pression / Entropie : Choc
+
+ else
+ coefb(ifac,iclp) = 1.d0 + gamagr(iel)*xmach &
+ *( (gamagr(iel)+1.d0)/4.d0*xmach &
+ + sqrt(1.d0 + (gamagr(iel)+1.d0)**2/16.d0*xmach**2) )
+ coefb(ifac,iclt) = coefb(ifac,iclp)/(1.d0-coefb(ifac,iclp)) &
+ / rtp(iel,ipriph) * ( rtp(iel,irhiph) &
+ * (rtp(iel,iuiph)**2 &
+ +rtp(iel,iviph)**2+rtp(iel,iwiph)**2) &
+ + rtp(iel,ipriph) *(1.d0-coefb(ifac,iclp)) )
+ endif
+
+! --- Energie totale : Epsilon sup
+
+ coefa(ifac,icle) = 0.d0
+
+ if(ierr.eq.1) call csexit (1)
+
+! ENTREE
+! ------
+ elseif(iccfth.eq.92) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! --- Calcul du nombre de Mach entrant normalement a la frontiere
+
+ xmachi = ( rtp(iel,iuiph)*surfbo(1,ifac) &
+ + rtp(iel,iviph)*surfbo(2,ifac) &
+ + rtp(iel,iwiph)*surfbo(3,ifac) )/ra(isrfbn+ifac-1) &
+ / sqrt(gamagr(iel)*rtp(iel,ipriph)/rtp(iel,irhiph))
+ xmache = ( coefa(ifac,iclu)*surfbo(1,ifac) &
+ + coefa(ifac,iclv)*surfbo(2,ifac) &
+ + coefa(ifac,iclw)*surfbo(3,ifac) )/ra(isrfbn+ifac-1) &
+ / sqrt(gamagr(iel)*rtp(iel,ipriph)/rtp(iel,irhiph))
+ dxmach = xmachi - xmache
+
+! --- Pression : Detente
+ if(dxmach.le.0.d0) then
+
+ if(dxmach.gt.2.d0/(1.d0-gamagr(iel))) then
+ coefa(ifac,iclp) = rtp(iel,ipriph)* &
+ ( (1.d0 + (gamagr(iel)-1.d0)*0.50d0*dxmach) &
+ ** (2.d0*gamagr(iel)/(gamagr(iel)-1.d0)) )
+ elseif(dxmach.le.2.d0/(1.d0-gamagr(iel)) ) then
+ coefa(ifac,iclp) = 0.d0
+ endif
+
+! --- Pression : Choc
+ else
+ coefa(ifac,iclp) = rtp(iel,ipriph)* &
+ ( 1.d0 + gamagr(iel)*dxmach &
+ *( (gamagr(iel)+1.d0)*0.25d0*dxmach &
+ + sqrt(1.d0 + (gamagr(iel)+1.d0)**2/16.d0 &
+ *dxmach**2) ) )
+ endif
+
+! --- Energie totale
+
+ coefa(ifac,iclp) = rtp(iel,ipriph)
+
+ coefa(ifac,icle) = &
+ coefa(ifac,iclp)/((gamagr(iel)-1.d0)*coefa(ifac,iclr)) &
+ + 0.5d0*(coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+! SORTIE
+! ------
+ elseif(iccfth.eq.93) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! --- Calcul du nombre de Mach sortant normalement a la frontiere
+
+ xmach = ( rtp(iel,iuiph)*surfbo(1,ifac) &
+ + rtp(iel,iviph)*surfbo(2,ifac) &
+ + rtp(iel,iwiph)*surfbo(3,ifac) ) / ra(isrfbn+ifac-1) &
+ / sqrt(gamagr(iel)*rtp(iel,ipriph)/rtp(iel,irhiph))
+
+! --- Sortie supersonique : Dirichlet sur toutes les variables
+! -------------------
+ if(xmach.ge.1.d0) then
+ do ivar = 1, nvar
+ coefa(ifac,iclrtp(ivar,icoef)) = rtp(iel,ivar)
+ enddo
+
+! Entropie
+ coefa(ifac,iclt) = &
+ rtp(iel,ipriph)/rtp(iel,irhiph)**gamagr(iel)
+
+! --- Sortie subsonique
+! -----------------
+ elseif(xmach.lt.1.d0 .and. xmach.ge.0.d0) then
+
+! --- Detente :
+ if(coefa(ifac,iclp).le.rtp(iel,ipriph)) then
+
+! Masse volumique
+ coefa(ifac,iclr) = rtp(iel,irhiph) &
+ * (coefa(ifac,iclp)/rtp(iel,ipriph)) &
+ **(1.d0/gamagr(iel))
+
+! Vitesse
+ coefa(ifac,iclu) = rtp(iel,iuiph) &
+ + 2.d0/(gamagr(iel)-1.d0) &
+ * sqrt( gamagr(iel) * rtp(iel,ipriph) / rtp(iel,irhiph) ) &
+ * ( 1.d0 &
+ - (coefa(ifac,iclp)/rtp(iel,ipriph)) &
+ **((gamagr(iel)-1.d0)/2.d0/gamagr(iel)) ) &
+ * surfbo(1,ifac) / ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclv) = rtp(iel,iviph) &
+ + 2.d0/(gamagr(iel)-1.d0) &
+ * sqrt( gamagr(iel) * rtp(iel,ipriph) / rtp(iel,irhiph) ) &
+ * ( 1.d0 &
+ - (coefa(ifac,iclp)/rtp(iel,ipriph)) &
+ **((gamagr(iel)-1.d0)/2.d0/gamagr(iel)) ) &
+ * surfbo(2,ifac) / ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclw) = rtp(iel,iwiph) &
+ + 2.d0/(gamagr(iel)-1.d0) &
+ * sqrt( gamagr(iel) * rtp(iel,ipriph) / rtp(iel,irhiph) ) &
+ * ( 1.d0 &
+ - (coefa(ifac,iclp)/rtp(iel,ipriph)) &
+ **((gamagr(iel)-1.d0)/2.d0/gamagr(iel)) ) &
+ * surfbo(3,ifac) / ra(isrfbn+ifac-1)
+
+! Energie totale
+ coefa(ifac,icle) = coefa(ifac,iclp) &
+ /( (gamagr(iel)-1.d0)*coefa(ifac,iclr) ) &
+ + 0.5d0*(coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 &
+ + coefa(ifac,iclw)**2)
+
+! Entropie
+ coefa(ifac,iclt) = coefa(ifac,iclp) &
+ /coefa(ifac,iclr)**gamagr(iel)
+
+! --- Choc :
+ else
+
+! Masse volumique
+ coefa(ifac,iclr) = rtp(iel,irhiph) &
+ * ( (gamagr(iel)+1.d0)*coefa(ifac,iclp) &
+ + (gamagr(iel)-1.d0)*rtp(iel,ipriph) ) &
+ / ( (gamagr(iel)-1.d0)*coefa(ifac,iclp) &
+ + (gamagr(iel)+1.d0)*rtp(iel,ipriph) )
+
+! Vitesse
+ coefa(ifac,iclu) = rtp(iel,iuiph) &
+ - (coefa(ifac,iclp)-rtp(iel,ipriph))*sqrt(2.d0/rtp(iel,irhiph) &
+ / ( (gamagr(iel)+1.d0)*coefa(ifac,iclp) &
+ + (gamagr(iel)-1.d0)*rtp(iel,ipriph) )) &
+ * surfbo(1,ifac) / ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclv) = rtp(iel,iviph) &
+ - (coefa(ifac,iclp)-rtp(iel,ipriph))*sqrt(2.d0/rtp(iel,irhiph) &
+ / ( (gamagr(iel)+1.d0)*coefa(ifac,iclp) &
+ + (gamagr(iel)-1.d0)*rtp(iel,ipriph) )) &
+ * surfbo(2,ifac) / ra(isrfbn+ifac-1)
+
+ coefa(ifac,iclw) = rtp(iel,iwiph) &
+ - (coefa(ifac,iclp)-rtp(iel,ipriph))*sqrt(2.d0/rtp(iel,irhiph) &
+ / ( (gamagr(iel)+1.d0)*coefa(ifac,iclp) &
+ + (gamagr(iel)-1.d0)*rtp(iel,ipriph) )) &
+ * surfbo(3,ifac) / ra(isrfbn+ifac-1)
+
+! Energie totale
+ coefa(ifac,icle) = coefa(ifac,iclp) &
+ /( (gamagr(iel)-1.d0)*coefa(ifac,iclr) ) &
+ + 0.5d0*(coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+! Entropie
+ coefa(ifac,iclt) = coefa(ifac,iclp) &
+ /coefa(ifac,iclr)**gamagr(iel)
+
+ endif
+
+ else
+ WRITE(NFECRA,*) 'ICCFTH = ',ICCFTH,' MACH = ',XMACH
+ ierr = 1
+ endif
+
+ if(ierr.eq.1) call csexit (1)
+
+
+! T ET e EN FONCTION DE P ET rho
+! ------------------------------
+
+ elseif(iccfth.eq.912.or.iccfth.eq.60900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Temperature
+ coefa(ifac,iclt) = xmasmr(iel)/rr*coefa(ifac,iclp) &
+ /coefa(ifac,iclr)
+
+! Energie totale
+ coefa(ifac,icle) = propce(iel,ipproc(icv(iphas))) &
+ * coefa(ifac,iclt) + 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+
+! rho ET e EN FONCTION DE P ET T
+! ------------------------------
+
+ elseif(iccfth.eq.913.or.iccfth.eq.100900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Masse volumique
+ coefa(ifac,iclr) = xmasmr(iel)/rr*coefa(ifac,iclp) &
+ /coefa(ifac,iclt)
+
+! Energie totale
+ coefa(ifac,icle) = propce(iel,ipproc(icv(iphas))) &
+ * coefa(ifac,iclt) + 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+
+! rho ET T EN FONCTION DE P ET e
+! ------------------------------
+
+ elseif(iccfth.eq.914.or.iccfth.eq.140900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Masse volumique
+ coefa(ifac,iclr) = coefa(ifac,iclp)/(gamagr(iel)-1.d0) &
+ / (coefa(ifac,icle) - 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2 ))
+
+! Temperature
+ coefa(ifac,iclt)= xmasmr(iel)/rr*coefa(ifac,iclp) &
+ /coefa(ifac,iclr)
+
+
+! P ET e EN FONCTION DE rho ET T
+! ------------------------------
+
+ elseif(iccfth.eq.923.or.iccfth.eq.150900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Pression
+ coefa(ifac,iclp) = coefa(ifac,iclr)*rr/xmasmr(iel) &
+ *coefa(ifac,iclt)
+
+! Energie totale
+ coefa(ifac,icle) = propce(iel,ipproc(icv(iphas))) &
+ * coefa(ifac,iclt) + 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2)
+
+
+! P ET T EN FONCTION DE rho ET e
+! ------------------------------
+
+ elseif(iccfth.eq.924.or.iccfth.eq.210900) then
+
+ ifac = ifac0
+ iel = ifabor(ifac)
+
+! Pression
+ coefa(ifac,iclp) = (gamagr(iel)-1.d0)*coefa(ifac,iclr) &
+ *( coefa(ifac,icle) - 0.5d0*( coefa(ifac,iclu)**2 &
+ + coefa(ifac,iclv)**2 + coefa(ifac,iclw)**2 ) )
+
+
+! Temperature
+ coefa(ifac,iclt)= xmasmr(iel)/rr*coefa(ifac,iclp) &
+ /coefa(ifac,iclr)
+
+
+! --- Fin de test sur GAZ PARFAIT A GAMMA VARIABLE
+ endif
+
+! --- Fin de test sur les thermos
+endif
+
+
+!--------
+! FORMATS
+!--------
+
+ 1010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USCFTH ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ GAMMA DOIT ETRE UN REEL SUPERIEUR OU EGAL A 1 ',/,&
+'@ IL A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USCFTH ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ GAMMA DOIT ETRE UN REEL SUPERIEUR OU EGAL A 1 ',/,&
+'@ IL EST NEGATIF OU NUL DANS LA CELLULE ',I10 ,/,&
+'@ IL A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USCFTH ',/,&
+'@ ========= CALCUL DE LA MASSE VOLUMIQUE ',/,&
+'@ ',/,&
+'@ LA TEMPERATURE DOIT ETRE UN REEL POSITIF STRICTEMENT ',/,&
+'@ ELLE VAUT ',E12.4 ,' DANS LA CELLULE ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 3010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USCFTH ',/,&
+'@ ========= CALCUL DE LA TEMPERATURE ',/,&
+'@ ',/,&
+'@ LA MASSE VOLUMIQUE DOIT ETRE UN REEL POSITIF STRICTEMENT',/,&
+'@ ELLE VAUT ',E12.4 ,' DANS LA CELLULE ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 4010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USCFTH ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMODYNAMIQUE ''C2''',/,&
+'@ ',/,&
+'@ LA MASSE VOLUMIQUE DOIT ETRE UN REEL POSITIF STRICTEMENT',/,&
+'@ ELLE VAUT ',E12.4 ,' DANS LA CELLULE ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USCFTH ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMO ''BETA''',/,&
+'@ ',/,&
+'@ LA MASSE VOLUMIQUE DOIT ETRE UN REEL POSITIF ',/,&
+'@ ELLE VAUT ',E12.4 ,' DANS LA CELLULE ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 4030 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USCFTH ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMODYNAMIQUE ''S'' ',/,&
+'@ ',/,&
+'@ LA MASSE VOLUMIQUE DOIT ETRE UN REEL POSITIF STRICTEMENT',/,&
+'@ ELLE VAUT ',E12.4 ,' DANS LA CELLULE ',I10 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 7000 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : CONDITION A LA LIMITE NON DISPONIBLE USCFTH ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ La condition a la limite de type debit et debit ',/,&
+'@ enthalpique imposes n''est pas disponible dans la ',/,&
+'@ version courante. ',/,&
+'@ ',/,&
+'@ Le calcul ne peut pas etre execute. ',/,&
+'@ ',/,&
+'@ Modifier uscfcl. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8000 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : MASSE VOLUMIQUE NEGATIVE OU NULLE (USCFTH) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ rho est negatif ou nul en ',I10 ,' cellules ',/,&
+'@ On le limite a ',E12.4 ,/,&
+'@ et on met fin au calcul. ',/,&
+'@ ',/,&
+'@ Si on souhaite que le calcul se poursuive, on peut ',/,&
+'@ forcer un clipping standard par valeur inferieure en ',/,&
+'@ renseignant la variable SCAMIN associee au scalaire ',/,&
+'@ representant la masse volumique : ISCA(IRHO(IPHAS)) ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 8100 format ( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ENERGIE INTERNE NEGATIVE OU NULLE (USCFTH) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ e-0.5*u*u est negatif ou nul en ',I10 ,' cellules ',/,&
+'@ On le limite a ',E12.4 ,/,&
+'@ et on met fin au calcul. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+
+! formats a eliminer apres mise au point de gama variable
+
+
+
+ 1110 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USTHMO ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMODYNAMIQUE ''C2''',/,&
+'@ ',/,&
+'@ P DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL EST NEGATIF DANS LA CELLULE ',I10 ,/,&
+'@ IL A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 1120 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USTHMO ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMODYNAMIQUE ''C2''',/,&
+'@ ',/,&
+'@ RHO DOIT ETRE UN REEL POSITIF STRICTEMENT ',/,&
+'@ IL EST NEGATIF OU NUL DANS LA CELLULE ',I10 ,/,&
+'@ IL A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1220 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USTHMO ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMO ''BETA'' ',/,&
+'@ ',/,&
+'@ RHO DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL EST NEGATIF DANS LA CELLULE ',I10 ,/,&
+'@ IL A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1310 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USTHMO ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMODYNAMIQUE ''S'' ',/,&
+'@ ',/,&
+'@ P DOIT ETRE UN REEL POSITIF ',/,&
+'@ IL EST NEGATIF DANS LA CELLULE ',I10 ,/,&
+'@ IL A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 1320 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : PROBLEME DANS USTHMO ',/,&
+'@ ========= CALCUL DE LA VARIABLE THERMODYNAMIQUE ''S'' ',/,&
+'@ ',/,&
+'@ RHO DOIT ETRE UN REEL POSITIF STRICTEMENT ',/,&
+'@ IL EST NEGATIF OU NUL DANS LA CELLULE ',I10 ,/,&
+'@ IL A POUR VALEUR ',E12.4 ,/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/cfbl/uscfx1.f90 b/users/cfbl/uscfx1.f90
new file mode 100644
index 0000000..1a4bf9a
--- /dev/null
+++ b/users/cfbl/uscfx1.f90
@@ -0,0 +1,137 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine uscfx1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DE CALCUL NON STANDARD
+! POUR LE COMPRESSIBLE SANS CHOC
+
+! (ex. : ICFGRP, IVIVAR...)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer iphas
+
+!===============================================================================
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscfx1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ options generales. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. OPTIONS DE CALCUL
+!===============================================================================
+
+! Pour chaque phase
+
+do iphas = 1, nphas
+
+! --> Conditions aux limites prenant en compte l'equilibre hydrostatique
+! (oui = 1 , non = 0)
+
+ icfgrp(iphas) = 1
+
+enddo
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cfbl/uscfx2.f90 b/users/cfbl/uscfx2.f90
new file mode 100644
index 0000000..eebd283
--- /dev/null
+++ b/users/cfbl/uscfx2.f90
@@ -0,0 +1,165 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine uscfx2
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR LE COMPRESSIBLE SANS CHOC
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+
+! CE SOUS PROGRAMME UTILISATEUR EST OBLIGATOIRE
+! =============================================
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer iphas
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE COMPRESSIBLE ',/,&
+'@ ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscfx2 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ options generales. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. PROPRIETES PHYSIQUES
+!===============================================================================
+
+! --> Pour chaque phase
+
+iphas = 1
+
+! --> Conductivite thermique laminaire
+
+! Conductivite thermique constante : IVISLS = 0
+! Conductivite thermique variable : IVISLS = 1
+
+ivisls(itempk(iphas)) = 0
+
+! Conductivite thermique de reference :
+
+! VISLS0 = LAMBDA0 (conductivite thermique en W/(m K))
+
+
+! ATTENTION ! IL FAUT QUE VISLS0 SOIT STRICTEMENT POSITIF
+! (donner une valeur meme si la conductivite est variable)
+
+visls0(itempk(iphas)) = 3.d-2
+
+! Si la conductivite thermique est variable, il faut donner
+! sa loi de variation dans uscfpv.F
+
+
+! --> Viscosite en volume
+
+! Viscosite en volume de reference :
+
+! VISCV0 = KAPPA0 (viscosite en volume en kg/(m s))
+! IVISCV = 0 : uniforme en espace et constant en temps
+! = 1 : variable en espace et en temps
+
+iviscv(iphas) = 0
+viscv0(iphas) = 0.d0
+
+! Si la Viscosite en volume est variable, il faut donner
+! sa loi de variation dans uscfpv.F
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cfbl/uscfxi.f90 b/users/cfbl/uscfxi.f90
new file mode 100644
index 0000000..a713b2e
--- /dev/null
+++ b/users/cfbl/uscfxi.f90
@@ -0,0 +1,406 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscfxi &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMPRESSIBLE SANS CHOC
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! dans la boucle en temps avant la resolution des scalaires
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul.
+
+
+! On a repris a titre d'exemple dans cette routine utilisateur
+! l'initialisation choisie par defaut.
+
+! On pourra trouver des exemples d'initialisations dans usiniv.F
+
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1..4(ncelet) ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet), w4(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iphas
+
+integer iccfth, iscal, imodif, iutile
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. IMPRESSION DE CONTROLE
+!===============================================================================
+
+write(nfecra,9001)
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+imodif = 1
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+! --- Pour chaque phase
+
+ iphas = 1
+
+! --- CONDITIONS INITIALES
+! ====================
+
+! --- Vitesse
+ do iel = 1, ncel
+ rtp(iel,iu(iphas)) = 0.d0
+ rtp(iel,iv(iphas)) = 0.d0
+ rtp(iel,iw(iphas)) = 0.d0
+ enddo
+
+
+! --- Scalaires passifs
+
+! Si il y a des scalaires passifs utilisateurs
+ if(nscaus.gt.0) then
+! Boucle sur ces scalaires
+ do iscal = 1, nscaus
+! Si le scalaire est porte par la phase consideree
+ if(iphsca(iscal).eq.iphas) then
+
+ do iel = 1, ncel
+ rtp(iel,isca(iscal)) = 0.d0
+ enddo
+
+ endif
+ enddo
+ endif
+
+
+! --- Pression, Masse Volumique, Temperature, Energie Totale Specifique
+
+! Seules 2 variables sur les 4 sont independantes
+! On peut donc initialiser le couple de variables que l'on veut
+! (sauf Temperature-Energie) et les 2 autres variables seront
+! calculees automatiquement
+
+! ** Initialiser 2 variables et 2 seulement
+
+! Pour cela, imposer IUTILE=1 pour les variables choisies
+! et IUTILE=0 pour les autres
+
+! Ainsi, dans l'exemple fourni, on initialise la pression et
+! la temperature
+
+! ** ICCFTH est un indicateur permettant de reperer quelles variables
+! ont �t� renseign�es. Ne pas le modifier.
+
+
+ iccfth = 10000
+
+! 1. Pression (en Pa)
+ iutile = 1
+ if(iutile.eq.1) then
+ iccfth = iccfth*2
+ do iel = 1, ncel
+ rtp(iel,ipr (iphas) ) = p0(iphas)
+ enddo
+ endif
+
+! 2. Masse Volumique (en kg/m3)
+ iutile = 0
+ if(iutile.eq.1) then
+ iccfth = iccfth*3
+ do iel = 1, ncel
+ rtp(iel,isca(irho (iphas))) = ro0(iphas)
+ enddo
+ endif
+
+! 3. Temperature (en K)
+ iutile = 1
+ if(iutile.eq.1) then
+ iccfth = iccfth*5
+ do iel = 1, ncel
+ rtp(iel,isca(itempk(iphas))) = t0(iphas)
+ enddo
+ endif
+
+! 4. Energie Totale Specifique (en J/kg)
+ iutile = 0
+ if(iutile.eq.1) then
+ iccfth = iccfth*7
+ do iel = 1, ncel
+ rtp(iel,isca(ienerg(iphas))) = cv0(iphas)*t0(iphas)
+ enddo
+ endif
+
+! ** Calcul automatique des deux autres variables
+! Ce sont les valeurs de ICCFTH qui d�terminent les variables
+! connues et les variables � calculer.
+
+ call uscfth &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ iccfth , imodif , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ rdevel , rtuser , ra )
+
+
+! FIN DE TEST DE SUITE
+endif
+
+!----
+! FORMATS
+!----
+
+ 9001 format( &
+' ',/,&
+' uscfxi : Initialisation des variables par l''utilisateur ',/,&
+' ',/)
+
+!----
+! FIN
+!----
+
+
+return
+end
diff --git a/users/cogz/usd3p1.f90 b/users/cogz/usd3p1.f90
new file mode 100644
index 0000000..491b00c
--- /dev/null
+++ b/users/cogz/usd3p1.f90
@@ -0,0 +1,230 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usd3p1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR
+! POUR LA COMBUSTION
+! FLAMME DE DIFFUSION : CHIMIE 3 POINTS
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+integer ipp
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE COMBUSTION GAZ MODELE CHIMIE TROIS POINTS ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usd3p1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+! ---- Taux de melange
+ipp = ipprtp(isca(ifm))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- Variance du taux de melange
+ipp = ipprtp(isca(ifp2m))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- Enthalpie
+ if ( ippmod(icod3p).eq.1 ) then
+ ipp = ipprtp(isca(ihm))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! ---- Temperature
+ipp = ipppro(ipproc(itemp))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Fraction massique du combustible
+ipp = ipppro(ipproc(iym(1)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Fraction massique de l'oxydant
+ipp = ipppro(ipproc(iym(2)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Fraction massique des produits
+ipp = ipppro(ipproc(iym(3)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Flamme de diffusion AVEC RAYONNEMENT
+
+if ( iirayo.gt.0 ) then
+
+! ---- Coeff d'absorption
+ ipp = ipppro(ipproc(ickabs))
+ NOMVAR(IPP) = 'KABS'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! ---- Terme T^4
+ ipp = ipppro(ipproc(it4m))
+ NOMVAR(IPP) = 'TEMP4'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+! ---- Terme T^3
+ ipp = ipppro(ipproc(it3m))
+ NOMVAR(IPP) = 'TEMP3'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+endif
+
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+
+srrom = 0.8d0
+
+
+!===============================================================================
+! 4. CONSTANTES PHYSIQUES
+!===============================================================================
+
+! --> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 = 4.25d-5
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cogz/usd3pc.f90 b/users/cogz/usd3pc.f90
new file mode 100644
index 0000000..44e2664
--- /dev/null
+++ b/users/cogz/usd3pc.f90
@@ -0,0 +1,876 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usd3pc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! COMBUSTION GAZ - FLAMME DE DIFFUSION CHIMIE 3 POINTS
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT USCLIM.F
+
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iphas, izone, ii
+integer ilelt, nlelt
+
+double precision uref2, d2s3
+double precision xkent, xeent
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE COMBUSTION GAZ MODELE CHIMIE TROIS POINTS ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usd3pc DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+! INTERVENTION UTLISATEUR
+
+!===============================================================================
+
+iphas = 1
+
+! ---- Facette de type entree correspondant
+! a une entree de carburant
+
+CALL GETFBR('11',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 1
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ ientfu(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 1
+ qimp(izone) = 2.62609d-4 / 72.d0
+! - Temperature en K
+ tinfue = 436.d0
+
+! ------ Si on impose une entree a debit impose
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 21.47d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.032d0
+ xintur(izone) = 0.d0
+
+! Exemple de cas ou ICALKE(IZONE) = 0 : DEBUT
+! Eliminer ces lignes pour la clarte si on a fait le choix ICALKE(IZONE) = 1
+
+ if(icalke(izone).eq.0) then
+
+! Calcul de k et epsilon en entree (XKENT et XEENT) a partir
+! l'intensite turbulente et de lois standards en conduite
+! circulaire (leur initialisation est inutile mais plus
+! propre)
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ xkent = epzero
+ xeent = epzero
+
+ call keenin &
+ !==========
+ ( uref2, xintur(izone), dh(izone), cmu, xkappa, &
+ xkent, xeent )
+
+! (ITUTYR est un indicateur qui vaut ITURB/10)
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+! Exemple de cas ou ICALKE(IZONE) = 0 : FIN
+
+! ------ Traitement des scalaires physiques particulieres
+! Ils sont traites automatiquement
+
+
+! ------ Traitement des scalaires utilisateurs
+
+! Exemple : On traite les scalaires rattaches a la phase courante : DEBUT
+! Eliminer ces lignes pour la clarte s'il n'y en a pas
+ if ( (nscal-nscapp).gt.0 ) then
+ do ii = 1, (nscal-nscapp)
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+! Exemple : On traite les scalaires rattaches a la phase courante : FIN
+
+enddo
+
+! ---- Facette de type entree correspondant
+! a une entree d'oxydant
+
+CALL GETFBR('21',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 2
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ ientox(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 1
+ qimp(izone) = 4.282d-3 / 72.d0
+! - Temperature en K
+ tinoxy = 353.d0
+
+! ------ Si on impose une entree a debit impose
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.097d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.218d0
+ xintur(izone) = 0.d0
+
+
+! ------ Traitement des scalaires physiques particulieres
+! Ils sont traites automatiquement
+
+! ------ Traitement des scalaires utilisateurs
+
+enddo
+
+! --- On impose en couleur 51 et 59 une paroi laterale
+
+CALL GETFBR('51 to 59',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = iparoi
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 3
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+! --- On impose en couleur 91 une sortie
+
+CALL GETFBR('91',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isolib
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 4
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 41 et 4 une symetrie
+
+CALL GETFBR('41 or 4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SYMETRIES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isymet
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 5
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cogz/usd3pi.f90 b/users/cogz/usd3pi.f90
new file mode 100644
index 0000000..0eaf9d1
--- /dev/null
+++ b/users/cogz/usd3pi.f90
@@ -0,0 +1,315 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usd3pi &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE :
+! COMBUSTION GAZ - FLAMME DE DIFFUSION CHIMIE 3 POINTS
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! dans la boucle en temps avant la resolution des variables
+! scalaires,
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul.
+
+
+! On a repris a titre d'exemple dans cette routine utilisateur
+! l'initialisation choisie par defaut.
+
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, igg, iphas
+double precision coefg(ngazgm)
+
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. IMPRESSION DE CONTROLE
+!===============================================================================
+
+write(nfecra,9001)
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+iphas = 1
+
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+ do iel = 1, ncel
+
+! ----- Moyenne et variance du taux de melange
+
+ rtp(iel,isca(ifm)) = fs(1)
+ rtp(iel,isca(ifp2m)) = zero
+
+! ----- Enthalpie
+
+ if ( ippmod(icod3p).eq.1 ) then
+ rtp(iel,isca(ihm)) = hinfue*fs(1)+hinoxy*(1.d0-fs(1))
+ endif
+
+ enddo
+
+endif
+
+
+!----
+! FORMATS
+!----
+
+ 9001 format( &
+' ',/,&
+' usd3pi : Initialisation des variables par l''utilisateur ',/,&
+' ',/)
+
+
+!----
+! FIN
+!----
+
+
+return
+end
diff --git a/users/cogz/usebu1.f90 b/users/cogz/usebu1.f90
new file mode 100644
index 0000000..17aa0a7
--- /dev/null
+++ b/users/cogz/usebu1.f90
@@ -0,0 +1,241 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usebu1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR
+! POUR LA COMBUSTION
+! FLAMME DE PREMELANGE : MODELE EBU
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+integer ipp
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE COMBUSTION GAZ MODELE EBU : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usebu1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+
+! ---- Fraction massique de gaz frais
+if ( ippmod(icoebu).ge.0 ) then
+ ipp = ipprtp(isca(iygfm))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! ---- Taux de melange
+if ( ippmod(icoebu).ge.2 ) then
+ ipp = ipprtp(isca(ifm))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+
+! ---- Enthalpie
+if ( ippmod(icoebu).eq.1 .or. &
+ ippmod(icoebu).eq.3 ) then
+ ipp = ipprtp(isca(ihm))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! ---- Temperature
+ipp = ipppro(ipproc(itemp))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Fraction massique du combustible
+ipp = ipppro(ipproc(iym(1)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Fraction massique de l'oxydant
+ipp = ipppro(ipproc(iym(2)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Fraction massique des produits
+ipp = ipppro(ipproc(iym(3)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! ---- Modele EBU AVEC RAYONNEMENT
+
+if ( iirayo.gt.0 ) then
+
+! ---- Coeff d'absorption
+ ipp = ipppro(ipproc(ickabs))
+ NOMVAR(IPP) = 'KABS'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! ---- Terme T^4
+ ipp = ipppro(ipproc(it4m))
+ NOMVAR(IPP) = 'TEMP4'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! ---- Terme T^3
+ ipp = ipppro(ipproc(it3m))
+ NOMVAR(IPP) = 'TEMP3'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+endif
+
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+
+srrom = 0.8d0
+
+
+!===============================================================================
+! 4. CONSTANTES PHYSIQUES
+!===============================================================================
+
+! --> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 = 4.25d-5
+
+! --> Constante du modele EBU
+
+cebu = 2.5d0
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cogz/usebuc.f90 b/users/cogz/usebuc.f90
new file mode 100644
index 0000000..8c5e2f8
--- /dev/null
+++ b/users/cogz/usebuc.f90
@@ -0,0 +1,941 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usebuc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! COMBUSTION GAZ MODELE EBU
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT USCLIM.F
+
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iphas, izone, ii
+integer ilelt, nlelt
+
+double precision uref2, xkent, xeent, d2s3
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE COMBUSTION GAZ MODELE EBU : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usebuc DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+! INTERVENTION UTLISATEUR
+
+!===============================================================================
+
+! Pour chaque type de condition relative aux physiques particulieres
+! on affecte un numero de zone de maniere a pouvoir donner les
+! conditions aux limites par zone physique et non par face de maillage
+! Un numero de zone est un entier arbitraire strictement positif
+! et inferieur ou egal a NOZPPM (dont la valeur est fixee en
+! parametre dans ppppar.h)
+
+iphas = 1
+
+
+! ---- Facette de type entree correspondant
+! a une entree de gaz brules (flamme pilote)
+
+CALL GETFBR('11',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 1
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - Indicateur gaz brule
+ ientgb(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 0
+ qimp (izone) = zero
+! - Fraction de melange
+ fment(izone) = 1.d0*fs(1)
+! - Temperature en K
+ tkent(izone) = 2000.d0
+
+! ------ Si on impose une entree a debit impose IQIMP(IZONE) = 1
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 120.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.02d0
+ xintur(izone) = 0.1d0
+
+
+
+! Exemple de cas ou ICALKE(IZONE) = 0 : DEBUT
+! Eliminer ces lignes pour la clarte si on a fait le choix ICALKE(IZONE) = 1
+
+ if(icalke(izone).eq.0) then
+
+! Calcul de k et epsilon en entree (XKENT et XEENT) a partir
+! l'intensite turbulente et de lois standards en conduite
+! circulaire (leur initialisation est inutile mais plus
+! propre)
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ xkent = epzero
+ xeent = epzero
+
+ call keenin &
+ !==========
+ ( uref2, xintur(izone), dh(izone), cmu, xkappa, &
+ xkent, xeent )
+
+! (ITYTUR est un indicateur qui vaut ITURB/10)
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+ endif
+! Exemple de cas ou ICALKE(IZONE) = 0 : FIN
+
+
+! ------ Traitement des scalaires physiques particulieres :
+! Ils sont traites automatiquement
+
+
+! ------ Traitement des scalaires utilisateurs eventuels
+
+! Exemple : On traite les scalaires rattaches a la phase courante : DEBUT
+! Eliminer ces lignes pour la clarte s'il n'y en a pas
+ if ( (nscal-nscapp).gt.0 ) then
+ do ii = 1, (nscal-nscapp)
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+! Exemple : On traite les scalaires rattaches a la phase courante : FIN
+
+
+enddo
+
+
+
+! ---- Facette de type entree correspondant
+! a une entree de gaz frais
+
+CALL GETFBR('12',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 2
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - Indicateur gaz frais
+ ientgf(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 0
+ qimp(izone) = zero
+! - Fraction de melange
+ fment(izone) = 8.d-1*fs(1)
+! - Temperature en K
+ tkent(izone) = 600.d0
+
+! ------ Si on impose une entree a debit impose IQIMP(IZONE) = 1
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 60.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! ------ Traitement de la turbulence
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.08d0
+ xintur(izone) = 0.1d0
+
+enddo
+
+
+! ---- Facette de type entree correspondant
+! a une entree de dilution (traite comme une entree de gaz frais)
+
+CALL GETFBR('13',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 3
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - Indicateur gaz frais
+ ientgf(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 0
+ qimp(izone) = zero
+! - Fraction de melange
+ fment(izone) = zero
+! -Temperature en K
+ tkent(izone) = 600.d0
+
+! ------ Si on impose une entree a debit impose IQIMP(IZONE) = 1
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 120.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.02d0
+ xintur(izone) = 0.1d0
+
+enddo
+
+! --- On impose en couleur 51 et 5 une paroi laterale
+
+CALL GETFBR('51 or 5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = iparoi
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 4
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 91 et 9 une sortie
+
+CALL GETFBR('91 or 9',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isolib
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 5
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 41 et 4 une symetrie
+
+CALL GETFBR('41 or 4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SYMETRIES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isymet
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 6
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cogz/usebui.f90 b/users/cogz/usebui.f90
new file mode 100644
index 0000000..c7b9181
--- /dev/null
+++ b/users/cogz/usebui.f90
@@ -0,0 +1,349 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usebui &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION GAZ MODELE EBU
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! dans la boucle en temps avant la resolution des scalaires
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul.
+
+
+! On a repris a titre d'exemple dans cette routine utilisateur
+! l'initialisation choisie par defaut.
+
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, mode, igg, iphas, izone
+double precision hinit, coefg(ngazgm)
+double precision sommqf, sommqt, sommq, tentm, fmelm
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. IMPRESSION DE CONTROLE
+!===============================================================================
+
+write(nfecra,9001)
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+iphas = 1
+
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+
+! ----- Calculs preliminaires : Fraction de melange, T, H
+! (la valeur NOZAPM est utilisee pour inclure les aspects parall)
+ sommqf = zero
+ sommq = zero
+ sommqt = zero
+ do izone = 1, nozapm
+ sommqf = sommqf + qimp(izone)*fment(izone)
+ sommqt = sommqt + qimp(izone)*tkent(izone)
+ sommq = sommq + qimp(izone)
+ enddo
+
+ if(abs(sommq).gt.epzero) then
+ fmelm = sommqf / sommq
+ tentm = sommqt / sommq
+ else
+ fmelm = zero
+ tentm = t0(iphas)
+ endif
+
+! ----- Enthalpie du melange HINIT
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ coefg(1) = fmelm
+ coefg(2) = (1.d0-fmelm)
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hinit , tentm )
+ endif
+
+
+ do iel = 1, ncel
+
+! ----- Fraction massique de gaz frais
+
+ rtp(iel,isca(iygfm)) = 5.d-1
+
+! ----- Fraction de melange
+
+ if ( ippmod(icoebu).eq.2 .or. ippmod(icoebu).eq.3 ) then
+ rtp(iel,isca(ifm)) = fmelm
+ endif
+
+! ----- Enthalpie du melange
+
+ if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
+ rtp(iel,isca(ihm)) = hinit
+ endif
+
+ enddo
+
+endif
+
+!----
+! FORMATS
+!----
+
+ 9001 format( &
+' ',/,&
+' usd3pi : Initialisation des variables par l''utilisateur ',/,&
+' ',/)
+
+!----
+! FIN
+!----
+
+
+return
+end
diff --git a/users/cogz/uslwc1.f90 b/users/cogz/uslwc1.f90
new file mode 100644
index 0000000..27d6c93
--- /dev/null
+++ b/users/cogz/uslwc1.f90
@@ -0,0 +1,315 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine uslwc1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR
+! POUR LA COMBUSTION
+! FLAMME DE PREMELANGE : MODELE LWC
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+!===============================================================================
+
+integer ipp, idirac
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE COMBUSTION GAZ MODELE LWC : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uslwc1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+
+! ---- Fraction de melange
+if ( ippmod(icolwc).ge.0 ) then
+ ipp = ipprtp(isca(ifm))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! ---- Variance de la fraction de melange
+ ipp = ipprtp(isca(ifp2m))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! ---- Fraction massique de fuel
+ ipp = ipprtp(isca(iyfm))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! ---- Variance de la fraction massique de fuel
+ ipp = ipprtp(isca(iyfp2m))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+if (ippmod(icolwc).ge.2) then
+ ipp = ipprtp(isca(icoyfp))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! ---- Enthalpie
+if ( ippmod(icolwc).eq.1 .or. &
+ ippmod(icolwc).eq.3 .or. &
+ ippmod(icolwc).eq.5 ) then
+ ipp = ipprtp(isca(ihm))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! --- Terme source
+ ipp = ipppro(ipproc(itsc))
+ NOMVAR(IPP) = 'T.SOURCE'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+! --- temperature
+ ipp = ipppro(ipproc(itemp))
+ NOMVAR(IPP) = 'Temperature'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+! --- fraction massique Combustible
+ ipp = ipppro(ipproc(iym(1)))
+ NOMVAR(IPP) = 'YM_Fuel'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+! --- fraction massique Oxydant
+ ipp = ipppro(ipproc(iym(2)))
+ NOMVAR(IPP) = 'YM_Oxyd'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+! --- fraction massique Produit
+ ipp = ipppro(ipproc(iym(3)))
+ NOMVAR(IPP) = 'YM_Prod'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ do idirac = 1, ndirac
+ ipp = ipppro(ipproc(irhol(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'RHOL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(iteml(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'TEML',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(ifmel(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'FMEL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(ifmal(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'FMAL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(iampl(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'AMPL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(itscl(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'TSCL',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+ ipp = ipppro(ipproc(imaml(idirac)))
+ WRITE(NOMVAR(IPP),'(A4,I1)') 'MAML',IDIRAC
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+ enddo
+
+! ---- Modele LWC AVEC RAYONNEMENT
+
+if ( iirayo.gt.0 ) then
+
+! ---- Coeff d'absorption
+ ipp = ipppro(ipproc(ickabs))
+ NOMVAR(IPP) = 'KABS'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! ---- Terme T^4
+ ipp = ipppro(ipproc(it4m))
+ NOMVAR(IPP) = 'TEMP4'
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! ---- Terme T^3
+ ipp = ipppro(ipproc(it3m))
+ NOMVAR(IPP) = 'TEMP3'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+endif
+
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+
+srrom = 0.95d0
+
+
+!===============================================================================
+! 4. CONSTANTES PHYSIQUES
+!===============================================================================
+
+! --> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 = 4.25d-5
+
+! --> Constante du modele LWC
+
+! --- Vitesse de reference
+ vref = 60.d0
+! --- Longueur de reference
+ lref = 0.1d0
+! --- Temperature d'activation
+ ta = 0.2d5
+! --- Temperature de cross-over (combustion du propane)
+ tstar= 0.12d4
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cogz/uslwcc.f90 b/users/cogz/uslwcc.f90
new file mode 100644
index 0000000..0a0a6f5
--- /dev/null
+++ b/users/cogz/uslwcc.f90
@@ -0,0 +1,944 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslwcc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! COMBUSTION GAZ MODELE LWC
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT USCLIM.F
+
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iphas, izone, ii
+integer ilelt, nlelt
+
+double precision uref2, xkent, xeent, d2s3
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE COMBUSTION GAZ MODELE LWC : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uslwcc DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+! INTERVENTION UTLISATEUR
+
+!===============================================================================
+
+! Pour chaque type de condition relative aux physiques particulieres
+! on affecte un numero de zone de maniere a pouvoir donner les
+! conditions aux limites par zone physique et non par face de maillage
+! Un numero de zone est un entier arbitraire strictement positif
+! et inferieur ou egal a NOZPPM (dont la valeur est fixee en
+! parametre dans ppppar.h)
+
+iphas = 1
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+
+! ---- Facette de type entree correspondant
+! a une entree de gaz brules (flamme pilote)
+
+CALL GETFBR('11',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 1
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - Indicateur gaz brule
+ ientgb(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 0
+ qimp (izone) = zero
+! - Fraction de melange
+ fment(izone) = 1.d0*fs(1)
+! - Temperature en K
+ tkent(izone) = 2000.d0
+
+! ------ Si on impose une entree a debit impose IQIMP(IZONE) = 1
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 120.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.02d0
+ xintur(izone) = 0.1d0
+
+
+
+! Exemple de cas ou ICALKE(IZONE) = 0 : DEBUT
+! Eliminer ces lignes pour la clarte si on a fait le choix ICALKE(IZONE) = 1
+
+ if(icalke(izone).eq.0) then
+
+! Calcul de k et epsilon en entree (XKENT et XEENT) a partir
+! l'intensite turbulente et de lois standards en conduite
+! circulaire (leur initialisation est inutile mais plus
+! propre)
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ xkent = epzero
+ xeent = epzero
+
+ call keenin &
+ !==========
+ ( uref2, xintur(izone), dh(izone), cmu, xkappa, &
+ xkent, xeent )
+
+! (ITYTUR est un indicateur qui vaut ITURB/10)
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+ endif
+! Exemple de cas ou ICALKE(IZONE) = 0 : FIN
+
+
+! ------ Traitement des scalaires physiques particulieres :
+! Ils sont traites automatiquement
+
+
+! ------ Traitement des scalaires utilisateurs eventuels
+
+! Exemple : On traite les scalaires rattaches a la phase courante : DEBUT
+! Eliminer ces lignes pour la clarte s'il n'y en a pas
+ if ( (nscal-nscapp).gt.0 ) then
+ do ii = 1, (nscal-nscapp)
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+! Exemple : On traite les scalaires rattaches a la phase courante : FIN
+
+enddo
+
+
+
+! ---- Facette de type entree correspondant
+! a une entree de gaz frais
+
+CALL GETFBR('12',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 2
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - Indicateur gaz frais
+ ientgf(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 0
+ qimp(izone) = zero
+! - Fraction de melange
+ fment(izone) = 8.d-1*fs(1)
+! - Temperature en K
+ tkent(izone) = 600.d0
+
+! ------ Si on impose une entree a debit impose IQIMP(IZONE) = 1
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 60.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! ------ Traitement de la turbulence
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.08d0
+ xintur(izone) = 0.1d0
+
+
+enddo
+
+
+! ---- Facette de type entree correspondant
+! a une entree de dilution (traite comme une entree de gaz frais)
+
+CALL GETFBR('13',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 3
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! - Indicateur gaz frais
+ ientgf(izone) = 1
+! - Debit en kg/s
+ iqimp(izone) = 0
+ qimp(izone) = zero
+! - Fraction de melange
+ fment(izone) = zero
+! - Temperature en K
+ tkent(izone) = 600.d0
+
+! ------ Si on impose une entree a debit impose IQIMP(IZONE) = 1
+! Alors l'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 120.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.02d0
+ xintur(izone) = 0.1d0
+
+enddo
+
+! --- On impose en couleur 51 et 5 une paroi laterale
+
+CALL GETFBR('51 or 5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = iparoi
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 4
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 91 et 9 une sortie
+
+CALL GETFBR('91 or 9',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isolib
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 5
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 41 et 4 une symetrie
+
+CALL GETFBR('41 or 4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SYMETRIES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isymet
+
+! Numero de zone (on numerote de 1 a n)
+ izone = 6
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cogz/uslwci.f90 b/users/cogz/uslwci.f90
new file mode 100644
index 0000000..9582823
--- /dev/null
+++ b/users/cogz/uslwci.f90
@@ -0,0 +1,407 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslwci &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION GAZ MODELE LWC
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! dans la boucle en temps avant la resolution des scalaires
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul.
+
+
+! On a repris a titre d'exemple dans cette routine utilisateur
+! l'initialisation choisie par defaut.
+
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, mode, igg, iphas, izone
+double precision hinit, coefg(ngazgm)
+double precision sommqf, sommqt, sommq, tentm, fmelm
+
+
+character*80 chaine
+integer iscal, ivar, ii
+double precision valmax, valmin
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. IMPRESSION DE CONTROLE
+!===============================================================================
+
+write(nfecra,9001)
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+do igg = 1, ngazgm
+ coefg(igg) = zero
+enddo
+
+iphas = 1
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+! ----- Calculs preliminaires : Fraction de melange, T, H
+! (la valeur NOZAPM est utilisee pour inclure les aspects parall)
+
+ sommqf = zero
+ sommq = zero
+ sommqt = zero
+ do izone = 1, nozapm
+ sommqf = sommqf + qimp(izone)*fment(izone)
+ sommqt = sommqt + qimp(izone)*tkent(izone)
+ sommq = sommq + qimp(izone)
+ enddo
+
+ if(abs(sommq).gt.epzero) then
+ fmelm = sommqf / sommq
+ tentm = sommqt / sommq
+ else
+ fmelm = zero
+ tentm = t0(iphas)
+ endif
+
+! ----- Enthalpie du melange HINIT
+
+ if ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 &
+ .or. ippmod(icolwc).eq.5 ) then
+ coefg(1) = fmelm
+ coefg(2) = (1.d0-fmelm)
+ coefg(3) = zero
+ mode = -1
+ call cothht &
+ !==========
+ ( mode , ngazg , ngazgm , coefg , &
+ npo , npot , th , ehgazg , &
+ hinit , tentm )
+ endif
+
+ do iel = 1, ncel
+
+
+! ---- initialisation de f et y
+! on initialise y=0 pour avoir des gazs brules
+! et enflamer le melange
+
+ rtp(iel,isca(iyfm)) = 0.0d0*fmelm
+ rtp(iel,isca(ifm)) = 0.d0*fmelm
+
+! ---- initialisation des variances
+
+ rtp(iel,isca(iyfp2m)) = zero
+ rtp(iel,isca(ifp2m)) = zero
+
+! ----- initialisation de la covariance pour NDIRAC >= 3
+
+ if ( ippmod(icolwc).ge. 2 ) then
+ rtp(iel,isca(icoyfp)) = zero
+ endif
+
+! ----- Enthalpie du melange
+
+ if ( ippmod(icolwc).eq.1 .or. ippmod(icolwc).eq.3 &
+ .or. ippmod(icolwc).eq.5 ) then
+ rtp(iel,isca(ihm)) = hinit
+ endif
+
+ enddo
+
+! ---> Impressions de controle des valeurs entrees par l'utlisateur
+
+ write(nfecra,2000)
+
+ do ii = 1, nscapp
+ iscal = iscapp(ii)
+ ivar = isca(iscal)
+ valmax = -grand
+ valmin = grand
+ do iel = 1, ncel
+ valmax = max(valmax,rtp(iel,ivar))
+ valmin = min(valmin,rtp(iel,ivar))
+ enddo
+ if ( irangp.ge.0 ) then
+ call parmax(valmax)
+ call parmin(valmin)
+ endif
+
+ chaine = nomvar(ipprtp(ivar))
+ write(nfecra,2010)chaine(1:8),valmin,valmax
+ enddo
+ write(nfecra,2020)
+
+endif
+
+! Initialisation des scalaires
+
+!----
+! FORMATS
+!----
+
+ 9001 format( &
+' ',/,&
+' uslwci : Initialisation des variables par l''utilisateur ',/,&
+' ',/)
+
+ 2000 format( &
+' ',/,&
+' ----------------------------------------------------------- ',/,&
+' ',/,&
+' ',/,&
+' ** INITIALISATION DES VARIABLES PROPRES AU GAZ (FL PRE LWC) ',/,&
+' -------------------------------------------------------- ',/,&
+' 1 SEUL PASSAGE ',/,&
+' --------------------------------- ',/,&
+' Variable Valeur min Valeur max ',/,&
+' --------------------------------- ' )
+
+ 2010 format( &
+ 2x, a8, e12.4, e12.4 )
+
+ 2020 format( &
+' --------------------------------- ',/)
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cplv/uscpcl.f90 b/users/cplv/uscpcl.f90
new file mode 100644
index 0000000..09dd739
--- /dev/null
+++ b/users/cplv/uscpcl.f90
@@ -0,0 +1,906 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscpcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! COMBUSTION CHARBON PULVERISE
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT DE USCLIM.F
+
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "ihmpre.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iphas, ii
+integer izone
+integer icha, iclapc
+integer ilelt, nlelt
+
+double precision uref2, d2s3
+double precision xkent, xeent
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if (iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ CHARBON PULVERISE ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscpcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+! INTERVENTION UTLISATEUR
+
+!===============================================================================
+
+iphas = 1
+
+! ---- Facette de type entree correspondant a une entree d'air
+! Par exemple : Air secondaire ou Air tertiaire
+
+CALL GETFBR('12',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 1
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! ------ Pour ces facettes d'entree , on est a debit impose
+
+ ientat(izone) = 1
+ iqimp(izone) = 1
+! - Numero de l'oxydant
+ inmoxy(izone) = 1
+! - Debit en kg/s pour l'oxydant
+ qimpat(izone) = 1.46d-03
+! - Temperature en K pour l'oxydant
+ timpat(izone) = 400.d0 + tkelvi
+
+! ------ On impose en couleur 12 une entree a debit impose
+! L'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 5.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turbulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.1d0
+ xintur(izone) = 0.1d0
+
+
+
+! Exemple de cas ou ICALKE(IZONE) = 0 : DEBUT
+! Eliminer ces lignes pour la clarte si on a fait le choix ICALKE(IZONE) = 1
+
+ if(icalke(izone).eq.0) then
+
+! Calcul de k et epsilon en entree (XKENT et XEENT) a partir
+! l'intensite turbulente et de lois standards en conduite
+! circulaire (leur initialisation est inutile mais plus
+! propre)
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ xkent = epzero
+ xeent = epzero
+
+ call keenin &
+ !==========
+ ( uref2, xintur(izone), dh(izone), cmu, xkappa, &
+ xkent, xeent )
+
+! (ITYTUR est un indicateur qui vaut ITURB/10)
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+! Exemple de cas ou ICALKE(IZONE) = 0 : FIN
+
+! ------ Traitement des scalaires physiques particulieres
+! Ils sont traites automatiquement
+
+
+! ------ Traitement des scalaires utilisateurs
+
+! Exemple : On traite les scalaires rattaches a la phase courante : DEBUT
+! Eliminer ces lignes pour la clarte s'il n'y en a pas
+ if ( (nscal-nscapp).gt.0 ) then
+ do ii = 1, (nscal-nscapp)
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+
+enddo
+
+! ---- Facette de type entree correspondant a une entree d'air + CP
+! (Air Primaire + Charbon Pulverise)
+
+CALL GETFBR('11',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 2
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! ------ Pour ces facettes d'entree , on est a debit impose
+
+ ientcp(izone) = 1
+ iqimp(izone) = 1
+! - Numero de l'oxydant
+ inmoxy(izone) = 1
+! - Debit en kg/s pour l'oxydant
+ qimpat(izone) = 1.46d-03
+! - Temperature en K pour l'oxydant
+ timpat(izone) = 800.d0 + tkelvi
+
+! ------ Initialisation (debit temperature et composition)
+ do icha = 1, ncharm
+ qimpcp(izone,icha) = zero
+ timpcp(izone,icha) = zero
+ do iclapc = 1, ncpcmx
+ distch(izone,icha,iclapc) = zero
+ enddo
+ enddo
+
+! ------ Traitement pour le charbon ICHA = 1
+ icha = 1
+! - Debit en kg/s pour le charbon ICHA
+ qimpcp(izone,icha) = 1.46d-4
+! - Distribution en masse en % pour le charbon ICHA
+! relative a la classe ICLAPC (1 < ICLAPC < NCLPCH(ICHA))
+ do iclapc = 1, nclpch(icha)
+ distch(izone,icha,iclapc) = 100.d0/dble(nclpch(icha))
+ enddo
+! - Temperature en K pour le charbon ICHA
+ timpcp(izone,icha) = 800.d0 + tkelvi
+
+! ------ On impose en couleur 11 une entree a debit impose
+! L'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 5.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.1d0
+ xintur(izone) = 0.1d0
+
+enddo
+
+! --- On impose en couleur 15 une paroi laterale
+
+CALL GETFBR('15',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = iparoi
+
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 3
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+! --- On impose en couleur 19 une sortie
+
+CALL GETFBR('19',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isolib
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 4
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 14 une symetrie
+
+CALL GETFBR('14 or 4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SYMETRIES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isymet
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 5
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/cplv/uscpi1.f90 b/users/cplv/uscpi1.f90
new file mode 100644
index 0000000..95d957a
--- /dev/null
+++ b/users/cplv/uscpi1.f90
@@ -0,0 +1,411 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine uscpi1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE UTILISATEUR POUR ENTREE DES PARAMETRES DE CALCUL
+! RELATIFS A LA COMBUSTION DU CHARBON PULVERISE
+! (COMMONS)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ihmpre.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer ipp , icla , icha
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if (iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ CHARBON PULVERISE : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscpi1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+
+! --> Variables propres a la suspension gaz - particules
+
+! - Enthalpie de la suspension
+ipp = ipprtp(isca(ihm))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! --> Variables propres a la phase dispersee
+
+do icla = 1, nclacp
+
+! - Fraction massique de coke (de la classe ICLA)
+ ipp = ipprtp(isca(ixck(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! - Fraction massique de charbon reactif (de la classe ICLA)
+ ipp = ipprtp(isca(ixch(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! - Nb de particules par kg de melange (de la classe ICLA)
+ ipp = ipprtp(isca(inp(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! - Enthalpie massique (de la classe ICLA)
+ ipp = ipprtp(isca(ih2(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! - Fraction massique d'eau (de la classe ICLA)
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ ipp = ipprtp(isca(ixwt(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+enddo
+
+! --> Variables propres a la phase continue
+
+do icha = 1, ncharb
+
+! - Moyenne du traceur 1
+! (representatif des MV legeres du charbon ICHA)
+ ipp = ipprtp(isca(if1m(icha)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! - Moyenne du traceur 2
+! (representatif des MV lourdes du charbon ICHA)
+ ipp = ipprtp(isca(if2m(icha)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+enddo
+
+! - Moyenne du traceur 3 (representatif du C libere sous forme de CO
+! lors de la combustion heterogene avec O2)
+ipp = ipprtp(isca(if3m))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! - Moyenne du traceur 3 (representatif du C libere sous forme de CO
+! lors de la combustion heterogene avec CO2)
+if ( ihtco2 .eq. 1) then
+ ipp = ipprtp(isca(if3mc2))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! - Variance associe au traceur 4 (representatif de l'air)
+ipp = ipprtp(isca(if4p2m))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! - Moyenne du traceur 5 (representatif de la vapeur d'eau liberee
+! lors de la phase de sechage)
+if ( ippmod(icp3pl) .eq. 1 ) then
+ ipp = ipprtp(isca(if5m))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! - YCO2
+
+if ( ieqco2 .ge. 1 ) then
+ ipp = ipprtp(isca(iyco2))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+! --> Variables algebriques propres a la suspension gaz - particules
+
+! - Masse molaire du melange gazeux
+ipp = ipppro(ipproc(immel))
+ichrvr(ipp) = 0
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+! --> Variables algebriques propres a la phase dispersee
+
+do icla = 1, nclacp
+
+! - Temperature des particules (de la classe ICLA)
+ ipp = ipppro(ipproc(itemp2(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! - Masse volumique des particules (de la classe ICLA)
+ ipp = ipppro(ipproc(irom2(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! - Diametre des particules (de la classe ICLA)
+ ipp = ipppro(ipproc(idiam2(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+! - Taux de disparition du charbon reactif (s-1) < 0
+! (de la classe ICLA)
+ ipp = ipppro(ipproc(igmdch(icla)))
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+! - Transfert de masse du au degagemnt des MV legeres (s-1) < 0
+! (de la classe ICLA)
+ ipp = ipppro(ipproc(igmdv1(icla)))
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+! - Transfert de masse du au degagemnt des MV lourdes (s-1) < 0
+! (de la classe ICLA)
+ ipp = ipppro(ipproc(igmdv2(icla)))
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+! - Taux de disparition du charbon reactif (s-1) < 0 par O2
+! (de la classe ICLA)
+ ipp = ipppro(ipproc(igmhet(icla)))
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+! - Taux de disparition du charbon reactif (s-1) < 0 par le CO2
+! (de la classe ICLA)
+ if ( ihtco2 .eq. 1 ) then
+ ipp = ipppro(ipproc(ighco2(icla)))
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+ endif
+
+! - Taux de disparitionde l'humidite < 0
+! (de la classe ICLA)
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ ipp = ipppro(ipproc(igmsec(icla)))
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+ endif
+
+! - Fraction massique de solide (de la classe ICLA)
+ ipp = ipppro(ipproc(ix2(icla)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1) = -1
+
+enddo
+
+! --> Variables algebriques propres a la phase continue
+
+! - Temperature du melange gazeux
+ipp = ipppro(ipproc(itemp1))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CHx1m
+ipp = ipppro(ipproc(iym1(1)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CHx2m
+ipp = ipppro(ipproc(iym1(2)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CO
+ipp = ipppro(ipproc(iym1(3)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du O2
+ipp = ipppro(ipproc(iym1(4)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CO2
+ipp = ipppro(ipproc(iym1(5)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du H2O
+ipp = ipppro(ipproc(iym1(6)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du N2
+ipp = ipppro(ipproc(iym1(7)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL
+!===============================================================================
+
+! --- Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+
+srrom = 0.95d0
+
+
+!===============================================================================
+! 4. CONSTANTES PHYSIQUES
+!===============================================================================
+
+! ---> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 = 4.25d-5
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/cplv/uscpiv.f90 b/users/cplv/uscpiv.f90
new file mode 100644
index 0000000..946a371
--- /dev/null
+++ b/users/cplv/uscpiv.f90
@@ -0,0 +1,452 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscpiv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION CP
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul (inconnues transportees),
+! la valeur du pas de temps,
+
+! On a repris a titre d'exemple dans cette routine utilisateur
+! l'initialisation choisie par defaut.
+
+
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ige, mode, icla, icha, iphas
+integer ioxy
+
+double precision t1init, h1init, coefe(ngazem)
+double precision t2init, h2init
+double precision f1mc(ncharm), f2mc(ncharm)
+double precision xkent, xeent, d2s3
+double precision wmh2o,wmco2,wmn2,wmo2,dmas
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. IMPRESSION DE CONTROLE
+!===============================================================================
+
+write(nfecra,9001)
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+ iphas = 1
+
+! --> Initialisation de k et epsilon (exemple)
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+ do iel = 1, ncel
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+ enddo
+
+ endif
+
+! --> On initialise tout le domaine de calcul avec de l'air a TINITK
+! ================================================
+
+! ---- Calculs de H1INIT et H2INIT
+
+ t1init = t0(iphas)
+ t2init = t0(iphas)
+
+! ------ Variables de transport relatives a la phase solide
+
+ do icla = 1, nclacp
+ icha = ichcor(icla)
+
+ do iel = 1, ncel
+
+ rtp(iel,isca(ixch(icla))) = zero
+ rtp(iel,isca(ixck(icla))) = zero
+ rtp(iel,isca(inp(icla) )) = zero
+ rtp(iel,isca(ih2(icla))) = zero
+
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ rtp(iel,isca(ixwt(icla))) = zero
+ endif
+
+ enddo
+ enddo
+
+! ------ Variables de transport relatives au melange
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+
+! On considere l'oxydant 1
+
+ coefe(io2) = wmole(io2)*oxyo2(1) &
+ /( wmole(io2) *oxyo2(1) +wmole(in2) *oxyn2(1) &
+ +wmole(ih2o)*oxyh2o(1)+wmole(ico2)*oxyco2(1))
+ coefe(ih2o) = wmole(ih2o)*oxyh2o(1) &
+ /( wmole(io2) *oxyo2(1) +wmole(in2) *oxyn2(1) &
+ +wmole(ih2o)*oxyh2o(1)+wmole(ico2)*oxyco2(1))
+ coefe(ico2) = wmole(ico2)*oxyco2(1) &
+ /( wmole(io2) *oxyo2(1) +wmole(in2) *oxyn2(1) &
+ +wmole(ih2o)*oxyh2o(1)+wmole(ico2)*oxyco2(1))
+ coefe(in2) = 1.d0-coefe(io2)-coefe(ih2o)-coefe(ico2)
+
+ do icha = 1, ncharm
+ f1mc(icha) = zero
+ f2mc(icha) = zero
+ enddo
+ mode = -1
+ call cpthp1 &
+ !==========
+ ( mode , h1init , coefe , f1mc , f2mc , &
+ t1init )
+
+ do iel = 1, ncel
+ rtp(iel,isca(ihm)) = h1init
+ enddo
+
+! ------ Variables de transport relatives au melange gazeux
+! (scalaires passifs et variances associees)
+
+ do icha = 1, ncharb
+ do iel = 1, ncel
+ rtp(iel,isca(if1m(icha))) = zero
+ rtp(iel,isca(if2m(icha))) = zero
+ enddo
+ enddo
+
+ do iel = 1, ncel
+
+ rtp(iel,isca(if3m)) = zero
+
+ if ( ihtco2 .eq. 1 ) then
+ rtp(iel,isca(if3mc2)) = zero
+ endif
+
+ rtp(iel,isca(if4p2m)) = zero
+
+ if ( ippmod(icp3pl) .eq. 1 ) then
+ rtp(iel,isca(if5m)) = zero
+ endif
+
+ if ( noxyd .ge. 2 ) then
+ rtp(iel,isca(if6m)) = zero
+ endif
+
+ if ( noxyd .eq. 3 ) then
+ rtp(iel,isca(if7m)) = zero
+ endif
+
+ if ( ieqco2.ge.1 ) then
+
+ ioxy = 1
+ wmo2 = wmole(io2)
+ wmco2 = wmole(ico2)
+ wmh2o = wmole(ih2o)
+ wmn2 = wmole(in2)
+
+ dmas = ( oxyo2 (ioxy)*wmo2 +oxyn2 (ioxy)*wmn2 &
+ +oxyh2o(ioxy)*wmh2o+oxyco2(ioxy)*wmco2 )
+ xco2 = oxyco2(ioxy)*wmco2/dmas
+
+ rtp(iel,isca(iyco2)) = oxyco2(ioxy)*wmco2/dmas
+
+ endif
+ enddo
+
+endif
+
+
+!----
+! FORMATS
+!----
+
+ 9001 format( &
+' ',/,&
+' uscpiv : Initialisation des variables par l''utilisateur ',/,&
+' ',/)
+
+!----
+! FIN
+!----
+return
+end
diff --git a/users/cplv/uscpl1.f90 b/users/cplv/uscpl1.f90
new file mode 100644
index 0000000..1c43876
--- /dev/null
+++ b/users/cplv/uscpl1.f90
@@ -0,0 +1,274 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine uscpl1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! ROUTINE UTILISATEUR POUR ENTREE DES PARAMETRES DE CALCUL
+! (COMMONS)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+integer ipp , icha
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ COMBUSTION CHARBON PULVERISE COUPLE AU ',/,&
+'@ TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscpl1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+
+! --> Variables propres a la phase gaz continue
+
+! - Enthalpie de la phase gaz continue
+ipp = ipprtp(isca(ihm))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! --> Variables propres a la phase continue
+
+do icha = 1, ncharb
+
+! - Moyenne du traceur 1
+! (representatif des MV legeres du charbon ICHA)
+ ipp = ipprtp(isca(if1m(icha)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+! - Moyenne du traceur 2
+! (representatif des MV lourdes du charbon ICHA)
+ ipp = ipprtp(isca(if2m(icha)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+
+enddo
+
+! - Moyenne du traceur 3 (representatif du C libere sous forme de CO
+! lors de la combustion heterogene)
+ipp = ipprtp(isca(if3m))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! - Variance associe au traceur 4 (representatif de l'air)
+ipp = ipprtp(isca(if4p2m))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+! --> Variables algebriques propres a la suspension gaz - particules
+
+! - Masse molaire du melange gazeux
+ipp = ipppro(ipproc(immel))
+ichrvr(ipp) = 0
+ilisvr(ipp) = 0
+ihisvr(ipp,1) = -1
+
+! - Temperature du melange gazeux
+ipp = ipppro(ipproc(itemp1))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CHx1m
+ipp = ipppro(ipproc(iym1(1)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CHx2m
+ipp = ipppro(ipproc(iym1(2)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CO
+ipp = ipppro(ipproc(iym1(3)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du O2
+ipp = ipppro(ipproc(iym1(4)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CO2
+ipp = ipppro(ipproc(iym1(5)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du H2O
+ipp = ipppro(ipproc(iym1(6)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du N2
+ipp = ipppro(ipproc(iym1(7)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1) = -1
+
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL
+!===============================================================================
+
+! --- Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+
+srrom = 0.8d0
+
+
+!===============================================================================
+! 4. CONSTANTES PHYSIQUES
+!===============================================================================
+
+! ---> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 = 4.25d-5
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/cplv/uscplc.f90 b/users/cplv/uscplc.f90
new file mode 100644
index 0000000..14ce2fe
--- /dev/null
+++ b/users/cplv/uscplc.f90
@@ -0,0 +1,832 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscplc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN COUPLE CHARBON PULVERISE :
+! --------------------------------------------------------------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+
+! COMBUSTION EULERIENNE DE CHARBON PULVERISE ET
+! TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON
+
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT DE USCLIM.F
+
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iphas, ii
+integer izone
+integer ilelt, nlelt
+
+double precision uref2, d2s3
+double precision xkent, xeent
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ COMBUSTION CHARBON PULVERISE COUPLE AU ',/,&
+'@ TRANSPORT LAGRANGIEN DES PARTICULES DE CHARBON : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscpcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+! INTERVENTION UTLISATEUR
+
+!===============================================================================
+
+ iphas = 1
+
+! ---- Face de type entree correspondant a une entree d'air
+! Par exemple : Air primaire , secondaire ou Air tertiaire
+
+CALL GETFBR('12',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 1
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! ------ Pour ces faces d'entree , on est a debit impose
+
+ ientat(izone) = 1
+ iqimp(izone) = 1
+! - Debit en kg/s pour l'air
+ qimpat(izone) = 1.46d-03
+! - Temperature en K pour l'air
+ timpat(izone) = 400.d0 + tkelvi
+
+
+! ------ On impose en couleur 12 une entree a debit impose
+! L'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 5.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.1d0
+ xintur(izone) = 0.1d0
+
+
+
+! Exemple de cas ou ICALKE(IZONE) = 0 : DEBUT
+! Eliminer ces lignes pour la clarte si on a fait le choix ICALKE(IZONE) = 1
+
+ if(icalke(izone).eq.0) then
+
+! Calcul de k et epsilon en entree (XKENT et XEENT) a partir
+! l'intensite turbulente et de lois standards en conduite
+! circulaire (leur initialisation est inutile mais plus
+! propre)
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ xkent = epzero
+ xeent = epzero
+
+ call keenin &
+ !==========
+ ( uref2, xintur(izone), dh(izone), cmu, xkappa, &
+ xkent, xeent )
+
+! (ITYTUR est un indicateur qui vaut ITURB/10)
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+! Exemple de cas ou ICALKE(IZONE) = 0 : FIN
+
+! ------ Traitement des scalaires physiques particulieres
+! Ils sont traites automatiquement
+
+
+! ------ Traitement des scalaires utilisateurs
+
+! Exemple : On traite les scalaires rattaches a la phase courante : DEBUT
+! Eliminer ces lignes pour la clarte s'il n'y en a pas
+ if ( (nscal-nscapp).gt.0 ) then
+ do ii = 1, (nscal-nscapp)
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+
+enddo
+
+! --- On impose en couleur 15 une paroi laterale
+
+CALL GETFBR('15',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = iparoi
+
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 2
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 19 une sortie
+
+CALL GETFBR('19',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isolib
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 3
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+! --- On impose en couleur 14 et 4 une symetrie
+
+CALL GETFBR('14 or 4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SYMETRIES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isymet
+
+! Numero de zone (on les numerote de 1 a n)
+ izone = 4
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/ctwr/usctcl.f90 b/users/ctwr/usctcl.f90
new file mode 100644
index 0000000..d7d0dcd
--- /dev/null
+++ b/users/ctwr/usctcl.f90
@@ -0,0 +1,704 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usctcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! MODELISATION AEROREFRIGERANTS
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT DE USCLIM.F
+
+
+
+! CE SOUS PROGRAMME UTILISATEUR EST OBLIGATOIRE
+! =============================================
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "ihmpre.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "ctincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, iel, ii, ivar, iphas
+integer ilelt, nlelt, izone
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE AEROREFRIGERANTS ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usctcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ conditions aux limites. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+!===============================================================================
+
+! Pour chaque type de condition relative aux physiques particulieres
+! on affecte un numero de zone de maniere a pouvoir donner les
+! conditions aux limites par zone physique et non par face de maillage
+! Un numero de zone est un entier arbitraire strictement positif
+! et inferieur ou egal a NOZPPM (dont la valeur est fixee en
+! parametre dans ppppar.h)
+
+
+! --- On impose en couleur 2 une sortie libre pour toutes les phases
+CALL GETFBR('2',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ izone = 1
+ izfppp(ifac) = izone
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = isolib
+ enddo
+
+! On impose un profil de pression sur toutes les faces
+ iphas = 1
+ icodcl(ifac,ipr(iphas)) = 1
+ rcodcl(ifac,ipr(iphas),1) = &
+ ro0(iphas)*( gx*(cdgfbo(1,ifac)-xyzp0(1,iphas)) &
+ + gy*(cdgfbo(2,ifac)-xyzp0(2,iphas)) &
+ + gz*(cdgfbo(3,ifac)-xyzp0(3,iphas)))
+
+enddo
+
+! --- On impose en couleur 4 une paroi pour toutes les phases
+CALL GETFBR('4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ izone = 2
+ izfppp(ifac) = izone
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = iparoi
+ enddo
+
+enddo
+
+! --- On impose une symetrie en couleur 5 pour toutes les phases
+CALL GETFBR('5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ izone = 3
+ izfppp(ifac) = izone
+
+! SYMETRIES
+
+ do iphas = 1, nphas
+ itypfb(ifac,iphas) = isymet
+ enddo
+
+enddo
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/ctwr/usctdz.f90 b/users/ctwr/usctdz.f90
new file mode 100644
index 0000000..a13162b
--- /dev/null
+++ b/users/ctwr/usctdz.f90
@@ -0,0 +1,211 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usctdz &
+!=================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR LA DEFINITION DES ZONES D'ECHANGE
+! D'UN AEROREFRIGERANT
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml) ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! ia(*) ! te ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "ctincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer imzech,ntypze,idimze,neleze
+
+double precision teaueze,qeaueze,deltat
+double precision xap,xnp,surface,dgout
+
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+! La modelisation choisie doit etre coherente avec IPPMOD
+
+! IMZECH = 0 - pas de modele
+! 1 - modele de Merkel
+! 2 - modele de Poppe
+
+imzech = ippmod(iaeros)
+
+! Definition de la zone d'echange
+
+idimze = 2
+ntypze = 2
+neleze = 20
+deltat = 10.0d0
+teaueze = 36d0
+qeaueze = 33737.d0
+xap = 0.2d0
+xnp = 0.5d0
+surface = 5183.6d0
+dgout = 0.005d0
+
+call defct &
+!=========
+ ( idimze, '2 or 3', imzech, ntypze, neleze, &
+ deltat, teaueze, qeaueze, xap, xnp, surface, dgout )
+
+
+!===============================================================================
+! FORMATS
+!===============================================================================
+
+return
+end subroutine
+
diff --git a/users/ctwr/uscti1.f90 b/users/ctwr/uscti1.f90
new file mode 100644
index 0000000..9dafbcf
--- /dev/null
+++ b/users/ctwr/uscti1.f90
@@ -0,0 +1,194 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uscti1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "ctincl.h"
+
+!===============================================================================
+
+integer iphas
+
+double precision cpa,cpe,cpv,hv0,rhoe,visc,conduc
+
+!===============================================================================
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE AEROREFRIGERANTS ',/,&
+'@ ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usctin DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ options generales. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. PARAMETRES POUR L'ECART DE TEMPERATURE IMPOSE
+!===============================================================================
+
+! ACTIVATION
+iaeeri = 0
+
+! ECART DE REFRIGERATION A IMPOSER
+vaeeri = 13.d0
+
+! FREQUENCE DE MODIFICATION DE LA TEMPERATURE
+iaeerp = 5
+
+! PAS DE TEMPERATURE POUR LE CALCUL DE LA PENTE DE ECARTREF(TEAU)
+paseri = 0.015d0
+
+! MAXIMUM DE LA TEMPERATURE D'EAU CHAUDE MOYENNE PONDEREE
+aetemx = 80.d0
+
+! MINIMUM DE LA TEMPERATURE D'EAU REFROIDIE MOYENNE PONDEREE
+aetemn = 10.d0
+
+! NOMBRE DE ZONES D'ECHANGES AYANT UNE FRONTIERE ENTREE EAU
+
+nbzsup = 2
+
+! LISTE DES NBZSUP ZONES D'ECHANGES EN BORD DE L'ENTREE EAU
+
+lizsup(1) = 1
+lizsup(2) = 2
+
+! NOMBRE DE ZONES D'ECHANGES AYANT UNE FRONTIERE SORTIE EAU
+nbzinf = 2
+
+! LISTE DES NBZINF ZONES D'ECHANGES EN BORD DE LA SORTIE EAU
+
+lizinf(1) = 1
+lizinf(2) = 2
+
+! INSTANT ACTIVATION ECART IMPOSE
+
+inbaei = 1000.D0
+
+!===============================================================================
+! 2. POST-PROCESSING DES ZONES D'ECHANGES
+!===============================================================================
+
+ichrze = 1
+
+!===============================================================================
+! 3. CALCUL SUITE AEROREFRIGERANT
+!===============================================================================
+
+isuict = isuite
+
+!===============================================================================
+! 4. PROPRIETES DE L'AIR
+!===============================================================================
+
+! Il est deconseille de modifier ici ces proprietes
+
+cpa = 1006.0d0
+cpv = 1831.0d0
+cpe = 4179.0d0
+hv0 = 2501600.0d0
+rhoe = 997.85615d0
+visc = 1.765d-5
+conduc = 0.02493d0
+
+call ctprof &
+!==========
+( cpa, cpv, cpe, hv0, rhoe, visc, conduc, gx, gy, gz )
+
+!----
+! FIN
+!----
+
+return
+end subroutine
diff --git a/users/ctwr/usctiv.f90 b/users/ctwr/usctiv.f90
new file mode 100644
index 0000000..6e76642
--- /dev/null
+++ b/users/ctwr/usctiv.f90
@@ -0,0 +1,326 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usctiv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR : INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE: VERSION ATMOSPHERIQUE
+! PENDANT DE USINIV
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul,
+! les valeurs du pas de temps
+
+
+! On dispose ici de ROM et VISCL initialises par RO0 et VISCL0
+! ou relues d'un fichier suite
+! On ne dispose des variables VISCLS, CP (quand elles sont
+! definies) que si elles ont pu etre relues dans un fichier
+! suite de calcul
+
+! Les proprietes physiaues sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+
+
+
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME USPHYV
+! ET PAS ICI
+
+
+
+! POUR LA COMBUSTION, LE CHARBON, L'INITIALISATION EST FAITE
+! PAR DEFAUT : IL EST CONSEILLE DE LA CONSERVER.
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "ctincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, iutile, iphas
+integer ilelt, nlelt
+
+double precision d2s3
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) then
+! Indicateur de non passage dans le sous-programme
+ iusini = 0
+ return
+endif
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+iphas = 1
+
+if (isuite.eq.0) then
+
+! --- Initialisation de la temperature de l'air a 11 deg Celsius
+! de l'humidite de l'air a 0.0063
+! pour toutes les cellules
+
+ do iel = 1, ncel
+
+ rtp(iel,isca(itemp4)) = 11.d0
+ rtp(iel,isca(ihumid)) = 0.0063d0
+
+ enddo
+
+! --- Initialisation de la temperature de l'air a 20 deg Celsius
+! de l'humidite de l'air a 0.012
+! de la vitesse
+! uniquement pour les cellules de couleur 6
+
+ CALL GETCEL('6',NLELT,LSTELT)
+ !==========
+
+ do ilelt = 1, nlelt
+
+ iel = lstelt(ilelt)
+
+ rtp(iel,iu(iphas)) = -0.5d0
+
+ rtp(iel,isca(itemp4)) = 20.d0
+ rtp(iel,isca(ihumid)) = 0.012d0
+
+ enddo
+
+endif
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/elec/uselcl.f90 b/users/elec/uselcl.f90
new file mode 100644
index 0000000..a219f61
--- /dev/null
+++ b/users/elec/uselcl.f90
@@ -0,0 +1,1066 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uselcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! MODULE ELECTRIQUE
+! (Effet Joule, Arc Electrique, Conduction ionique)
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT DE USCLIM.F
+
+
+
+! CE SOUS PROGRAMME UTILISATEUR EST OBLIGATOIRE
+! =============================================
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac, ii, iphas , iel
+integer idim
+integer izone,iesp
+integer ilelt, nlelt
+
+double precision uref2, d2s3
+double precision rhomoy, dhy, ustar2
+double precision xkent, xeent
+double precision z1 , z2
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uselcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ conditions aux limites. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+!===============================================================================
+
+iphas = 1
+
+
+! --- On impose en couleur 1 une entree ; exemple de Cathode
+! ======================================================
+
+CALL GETFBR('1',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ itypfb(ifac,iphas) = ientre
+
+! - Numero de zone (on numerote de 1 a n)
+ izone = 1
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 0.d0
+
+! Turbulence
+
+! (ITYTUR est un indicateur qui vaut ITURB/10)
+ if (itytur(iphas).eq.2 .or. itytur(iphas).eq.3 &
+ .or. iturb(iphas).eq.50 .or. iturb(iphas).eq.60) then
+
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+
+
+! Exemple de turbulence calculee a partir
+! de formules valables pour une conduite
+
+! On veillera a specifier le diametre hydraulique
+! adapte a l'entree courante.
+
+! On s'attachera egalement a utiliser si besoin une formule
+! plus precise pour la viscosite dynamique utilisee dans le
+! calcul du nombre de Reynolds (en particulier, lorsqu'elle
+! est variable, il peut etre utile de reprendre ici la loi
+! imposee dans USPHYV. On utilise ici par defaut la valeur
+! VISCL0 donnee dans USINI1
+! En ce qui concerne la masse volumique, on dispose directement
+! de sa valeur aux faces de bord (ROMB) et c'est celle que
+! utilise donc ici (elle est en particulier coherente avec
+! le traitement implante dans USPHYV, en cas de masse
+! volumique variable)
+
+! Diametre hydraulique
+ dhy = 0.075d0
+
+! Calcul de la vitesse de frottement au carre (USTAR2)
+! et de k et epsilon en entree (XKENT et XEENT) a partir
+! de lois standards en conduite circulaire
+! (leur initialisation est inutile mais plus propre)
+ rhomoy = propfb(ifac,ipprob(irom(iphas)))
+ ustar2 = 0.d0
+ xkent = epzero
+ xeent = epzero
+
+ call keendb &
+ !==========
+ ( uref2, dhy, rhomoy, viscl0(iphas), cmu, xkappa, &
+ ustar2, xkent, xeent )
+
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif (iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif (iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+! --- On traite les scalaires
+
+! Enthalpie en J/kg
+
+ ii = ihm
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = 1.d6
+
+! Potentiel electrique reel impose a 0. volts (exemple de Cathode en arc)
+
+ ii = ipotr
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = 0.d0
+
+! Fraction massique des (N-1) constituants
+
+ if ( ngazg .gt. 1 ) then
+ do iesp=1,ngazg-1
+ ii = iycoel(iesp)
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = 0.d0
+ enddo
+ endif
+
+! Specifique Version Effet Joule :
+
+! Potentiel Imaginaire impose a 0
+
+ if ( ippmod(ieljou).ge. 2 ) then
+ ii = ipoti
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = 0.d0
+ endif
+
+! Specifique Version Arc Electrique :
+
+! Potentiel vecteur : Flux nul
+
+ if ( ippmod(ielarc).ge.2 ) then
+ do idim= 1,ndimve
+ ii = ipotva(idim)
+ icodcl(ifac,isca(ii)) = 3
+ rcodcl(ifac,isca(ii),3) = 0.d0
+ enddo
+ endif
+
+enddo
+
+! --- On impose en couleur 5 une entree/sortie ;
+! ====================================== exemple d'Electrode en Joule
+! ============================
+
+CALL GETFBR('5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+ itypfb(ifac,iphas) = isolib
+
+! - Numero de zone (on numerote de 1 a n)
+ izone = 2
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! --- On traite les scalaires rattaches a la phase courante
+
+! Enthalpie en J/kg (Par defaut flux nul avec ISOLIB)
+! Rien a faire
+
+! Fraction massique des (N-1) constituants (Par defaut flux nul avec ISOLIB)
+! Rien a faire
+
+! Specifique Version Effet Joule :
+
+! En effet Joule,
+! si l'on souhaite faire un calcul en recalant les conditions
+! aux limites (utiliser IELCOR=1 dans useli1)
+! pour atteindre la valeur de la puissance PUISIM
+! (a imposer dans useli1 en Ampere.Volt)
+! on multiplie la condition limite initiale sur le potentiel
+! reel (et sur le potentiel imaginaire s'il est pris en
+! compte) par le coefficient COEJOU.
+! COEJOU est determine automatiquement pour que la puissance
+! dissipee par effet Joule (partie reelle et partie
+! imaginaire si besoin) soit PUISIM
+! au debut du calcul, COEJOU vaut 1 ; COEJOU est transmis dans
+! les fichiers suites.
+
+! Si on ne souhaite pas faire un calcul avec recalage, on impose
+! directement une valeur adaptee.
+
+ if ( ippmod(ieljou).ge. 1 ) then
+ ii = ipotr
+ icodcl(ifac,isca(ii)) = 1
+ if(ielcor.eq.1) then
+ rcodcl(ifac,isca(ii),1) = 500.d0*coejou
+ else
+ rcodcl(ifac,isca(ii),1) = 500.d0
+ endif
+ endif
+
+ if ( ippmod(ieljou).ge. 2 ) then
+ ii = ipoti
+ icodcl(ifac,isca(ii)) = 1
+ if(ielcor.eq.1) then
+ rcodcl(ifac,isca(ii),1) = sqrt(3.d0)*500.d0*coejou
+ else
+ rcodcl(ifac,isca(ii),1) = sqrt(3.d0)*500.d0
+ endif
+ endif
+
+enddo
+
+! --- On impose en couleur 2 une entree/sortie ;
+! ============================== exemple d'Anode en arc electrique
+! =================================
+
+CALL GETFBR('2',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre (ISOLIB)
+
+ itypfb(ifac,iphas) = isolib
+
+! - Numero de zone (on numerote de 1 a n)
+ izone = 3
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! --- On traite les scalaires rattaches a la phase courante
+
+! Enthalpie en J/kg (Par defaut flux nul avec ISOLIB)
+! Rien a faire
+
+! Potentiel electrique reel
+
+! En arc electrique,
+! si l'on souhaite faire un calcul en recalant le potentiel
+! de l'anode (utiliser IELCOR=1 dans useli1)
+! pour atteindre la valeur du courant COUIMP
+! (a imposer dans useli1 en Amperes)
+! on utilise alors la valeur DPOT comme condition limite
+! DPOT est en effet automatiquement adaptee par le calcul
+! pour que (j.E Volume/DPOT) = COUIMP
+! (initialiser DPOT dans useli1 en Volts avec une valeur
+! representative de la difference de potentiel imposee)
+
+! Si on ne souhaite pas faire un calcul avec recalage, on impose
+! directement une valeur adaptee au cas
+! (par exemple, ici 1000 Volts ).
+
+ ii = ipotr
+ icodcl(ifac,isca(ii)) = 1
+
+ if ( ippmod(ielarc).ge.1 .and. ielcor .eq.1) then
+ rcodcl(ifac,isca(ii),1) = dpot
+ else
+ rcodcl(ifac,isca(ii),1) = 1000.d0
+ endif
+
+
+! Fraction massique des (N-1) constituants (Par defaut flux nul avec ISOLIB)
+
+! Specifique Version Arc Electrique :
+! Potentiel vecteur : flux nul (par defaut)
+
+
+enddo
+
+! --- On impose en couleur 3 une paroi
+! ================================
+
+CALL GETFBR('3',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+! Pour un calcul arc electrique 3D, on cale le potentiel
+! vecteur avec une condition de Dirichlet issue des valeurs
+! du potentiel vecteur au pas de temps precedent
+! dans une zone de paroi choisie
+! Par defaut, ailleurs, un flux nul s'applique (paroi isolee).
+
+ itypfb(ifac,iphas) = iparoi
+
+! - Numero de zone (on numerote de 1 a n)
+ izone = 4
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ if ( ippmod(ielarc).ge.2 ) then
+ if ( cdgfbo(1,ifac) .le. 2.249d-2 .or. &
+ cdgfbo(1,ifac) .ge. 2.249d-2 .or. &
+ cdgfbo(3,ifac) .le. -2.249d-2 .or. &
+ cdgfbo(3,ifac) .ge. 2.249d-2 ) then
+ iel = ifabor(ifac)
+ do idim = 1, ndimve
+ ii = ipotva(idim)
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = rtpa(iel,isca(ii))
+ enddo
+ endif
+ endif
+
+enddo
+
+! --- On impose en couleur 51 : anode avec claquage
+! =============================================
+
+CALL GETFBR('51',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ itypfb(ifac,iphas) = iparoi
+
+! - Numero de zone (on numerote de 1 a n)
+ izone = 5
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! ---- Enthalpie (J/kg ) : coef echange impose
+
+ ii=ihm
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = 2.d4
+ rcodcl(ifac,isca(ii),2) = 1.d5
+
+! Potentiel electrique reel
+
+ ii = ipotr
+ icodcl(ifac,isca(ii)) = 1
+
+ if ( ippmod(ielarc).ge.1 .and. ielcor .eq.1) then
+ rcodcl(ifac,isca(ii),1) = dpot
+ else
+ rcodcl(ifac,isca(ii),1) = 100.d0
+ endif
+
+! Si CLAQUAGE : a adapter en fonction du cas et du
+! sous-programme USELRC
+
+ if ( ippmod(ielarc).ge.1 .and. ielcor .eq.1) then
+ if(iclaq.eq.1 .and. ntcabs.le.ntdcla+30) then
+
+ z1 = zclaq - 2.d-4
+ if(z1.le.0.d0) z1 = 0.d0
+ z2 = zclaq + 2.d-4
+ if(z2.ge.2.d-2) z2 = 2.d-2
+
+ if( cdgfbo(3,ifac).ge.z1 .and. &
+ cdgfbo(3,ifac).le.z2 ) then
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = dpot
+ else
+ icodcl(ifac,isca(ii)) = 3
+ rcodcl(ifac,isca(ii),3) = 0.d0
+ endif
+ endif
+ endif
+
+! Potentiel vecteur : Flux nul
+
+ if ( ippmod(ielarc).ge.2 ) then
+ do idim= 1,ndimve
+ ii = ipotva(idim)
+ icodcl(ifac,isca(ii)) = 3
+ rcodcl(ifac,isca(ii),3) = 0.d0
+ enddo
+ endif
+
+enddo
+
+! --- On impose en couleur 4 une symetrie
+! ===================================
+
+CALL GETFBR('4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SYMETRIES
+
+ itypfb(ifac,iphas) = isymet
+
+! - Numero de zone (on numerote de 1 a n)
+ izone = 6
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! Par defaut tous les scalaires (potentiels en particulier)
+! recoivent une condition de flux nul.
+! En effet Joule, on peut souhaiter imposer une condition
+! d'antisymetrie sur le potentiel imaginaire selon la
+! configuration des electrodes :
+ if ( ippmod(ieljou).ge. 2 ) then
+ ii = ipoti
+ icodcl(ifac,isca(ii)) = 1
+ rcodcl(ifac,isca(ii),1) = 0.d0
+ endif
+
+enddo
+
+!----
+! FORMATS
+!----
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/elec/uselen.f90 b/users/elec/uselen.f90
new file mode 100644
index 0000000..3b09f73
--- /dev/null
+++ b/users/elec/uselen.f90
@@ -0,0 +1,690 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uselen &
+!================
+
+ ( idbia0 , idbra0 , nummai , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ ncelps , nfacps , nfbrps , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ lstcel , lstfac , lstfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , &
+ tracel , trafac , trafbr , rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! POUR LA SORTIE POST-TRAITEMENT MODULE ELECTRIQUE
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! nummai ! ec ! <-- ! numero du maillage post !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! ncelps ! e ! <-- ! nombre de cellules du maillage post !
+! nfacps ! e ! <-- ! nombre de faces interieur post !
+! nfbrps ! e ! <-- ! nombre de faces de bord post !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! lstcel(ncelps ! te ! <-- ! liste des cellules du maillage post !
+! lstfac(nfacps ! te ! <-- ! liste des faces interieures post !
+! lstfbr(nfbrps ! te ! <-- ! liste des faces de bord post !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! tracel(*) ! tr ! <-- ! tab reel valeurs cellules post !
+! trafac(*) ! tr ! <-- ! tab reel valeurs faces int. post !
+! trafbr(*) ! tr ! <-- ! tab reel valeurs faces bord post !
+! w1-w2 ! tr ! --- ! tab reel pour calcul gradient !
+! (ncelet,3) ! ! ! !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "dimfbr.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer nummai
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer ncelps , nfacps , nfbrps
+integer nideve , nrdeve , nituse , nrtuse
+integer idimt
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer lstcel(ncelps), lstfac(nfacps), lstfbr(nfbrps)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(ndimfb,*)
+double precision coefa(ndimfb,*), coefb(ndimfb,*)
+double precision tracel(ncelps*3)
+double precision trafac(nfacps*3), trafbr(nfbrps*3)
+double precision w1(ncelet,3), w2(ncelet,3)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+character*32 namevr
+integer idebia, idebra, iel , iloc
+integer ivar , ivar0 , inc , iccocg
+integer iphydp, nswrgp, imligp, iwarnp, iclimv
+integer ipcsii
+integer ientla, ivarpr
+double precision epsrgp, climgp, extrap
+double precision rbid(1)
+
+!===============================================================================
+!===============================================================================
+! 0. PAR DEFAUT, ON CONSIDERE QUE LE SOUS PROGRAMME CI-DESSOUS CONVIENT
+! A L'UTILISATEUR, C'EST-A-DIRE QUE LA MISE EN OEUVRE DU MODULE
+! ELECTRIQUE DECLENCHE LA PRODUCTION DE CHAMPS STANDARD DANS LE
+! POST-TRAITEMENT.
+! L'UTILISATEUR N'A PAS A MODIFIER LE PRESENT SOUS-PROGRAMME DANS
+! LES CONDITIONS D'UTILISATION STANDARD.
+! DANS LE CAS OU IL SOUHAITE PRODUIRE DES VARIABLES SUPPLEMENTAIRES
+! ILPEUT LES AJOUTER A LA FIN, VOIR LA DOCUMENTATION DE USEEVO
+!===============================================================================
+
+
+idebia = idbia0
+idebra = idbra0
+
+if(nummai.eq.-1) then
+
+!===============================================================================
+! 1. Gradient du potentiel reel
+!===============================================================================
+
+ idimt = 3
+ NAMEVR = 'Gr_PotR'
+
+ ivar = isca(ipotr)
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! Cela a deja ete fait puisqu'on a deja fait le calcul de cette variable
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+! POTR
+ w1(1,1) , w1(1,2) , w1(1,3) , &
+! d POTR /dx d POTR /dy d POTR /dz
+ w2(1,1) , w2(1,2) , w2(1,3) , &
+ rdevel , rtuser , ra )
+
+! Le gradient est defini sur le maillage principal tout entier ;
+! inutile de le recopier, on utilise l'indirection (IVARPR = 1),
+! et les valeurs sont non entrelacees (IENTLA = 0)
+ ientla = 0
+ ivarpr = 1
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, w1, rbid, rbid)
+
+!===============================================================================
+! 2. Gradient du potentiel imaginaire si Joule
+!===============================================================================
+
+ if (ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+
+ idimt = 3
+ NAMEVR = 'Gr_PotI'
+
+ ivar = isca(ipoti)
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! Cela a deja ete fait puisqu'on a deja fait le calcul de cette variable
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+! POTI
+ w1(1,1) , w1(1,2) , w1(1,3) , &
+! d POTR /dx d POTR /dy d POTR /dz
+ w2(1,1) , w2(1,2) , w2(1,3) , &
+ rdevel , rtuser , ra )
+
+! Le gradient est defini sur le maillage principal tout entier ;
+! inutile de le recopier, on utilise l'indirection (IVARPR = 1),
+! et les valeurs sont non entrelacees (IENTLA = 0)
+ ientla = 0
+ ivarpr = 1
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, w1, rbid, rbid)
+
+ endif
+
+!===============================================================================
+! 3. Courant imaginaire si Joule
+!===============================================================================
+
+ if(ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4 ) then
+
+ idimt = 3
+ NAMEVR = 'Cour_Im'
+
+ ivar = isca(ipoti)
+ iclimv = iclrtp(ivar,icoef)
+
+! Commme dans elflux
+ ipcsii = ipproc(ivisls(ipoti))
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! Cela a deja ete fait puisqu'on a deja fait le calcul de cette variable
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+ ivar0 = 0
+
+! Sans prise en compte de la pression hydrostatique
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+! POTI
+ w1(1,1) , w1(1,2) , w1(1,3) , &
+! d POTR /dx d POTR /dy d POTR /dz
+ w2(1,1) , w2(1,2) , w2(1,3) , &
+ rdevel , rtuser , ra )
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = -propce(iel,ipcsii)*w1(iel,1)
+ tracel(iloc+ncelps) = -propce(iel,ipcsii)*w1(iel,2)
+ tracel(iloc+2*ncelps) = -propce(iel,ipcsii)*w1(iel,3)
+ enddo
+
+! La variable est d�finie sur le tableau de travail. On
+! a deja utilise l'indirection via LSTCEL (donc IVARPR = 0),
+! et les valeurs sont non entrelacees (IENTLA = 0)
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, rbid, rbid)
+
+ endif
+
+!===============================================================================
+! 5. Champ Magnetique si Arc
+!===============================================================================
+
+ if( ippmod(ielarc).ge.2 ) then
+
+ idimt = 3
+ NAMEVR = 'Ch_Mag'
+
+! Sur Ax
+
+ ivar = isca(ipotva(1))
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! Cela a deja ete fait puisqu'on a deja fait le calcul de cette variable
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+
+ ivar0 = 0
+
+! SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idebia , idebra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp , &
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+ w1(1,1) , w1(1,2) , w1(1,3) , &
+! d Ax /dx d Ax /dy d Ax /dz
+ w2(1,1) , w2(1,2) , w2(1,3) , &
+ rdevel , rtuser , ra )
+
+! B = rot A
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = zero
+ tracel(iloc+ncelps) = w1(iel,3)
+ tracel(iloc+2*ncelps) = -w1(iel,2)
+ enddo
+
+! Sur Ay
+
+ ivar = isca(ipotva(2))
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! Cela a deja ete fait puisqu'on a deja fait le calcul de cette variable
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+
+ ivar0 = 0
+
+! SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+ w1(1,1) , w1(1,2) , w1(1,3) , &
+! d Ay /dx d Ay /dy d Ay /dz
+ w2(1,1) , w2(1,2) , w2(1,3) , &
+ rdevel , rtuser , ra )
+
+! B = rot A
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = tracel(iloc) - w1(iel,3)
+ tracel(iloc+ncelps) = tracel(iloc + ncelps) + zero
+ tracel(iloc+2*ncelps) = tracel(iloc+2*ncelps) + w1(iel,1)
+ enddo
+
+! Sur Az
+
+ ivar = isca(ipotva(3))
+ iclimv = iclrtp(ivar,icoef)
+
+ inc = 1
+ iccocg = 1
+ nswrgp = nswrgr(ivar)
+ imligp = imligr(ivar)
+ iwarnp = iwarni(ivar)
+ epsrgp = epsrgr(ivar)
+ climgp = climgr(ivar)
+ extrap = extrag(ivar)
+
+! En periodique et parallele, echange avant calcul du gradient
+! Cela a deja ete fait puisqu'on a deja fait le calcul de cette variable
+
+! IVAR0 = 0 (indique pour la periodicite de rotation que la variable
+! n'est pas la vitesse ni Rij)
+
+ ivar0 = 0
+
+! SANS PRISE EN COMPTE DE LA PRESSION HYDROSTATIQUE
+
+ iphydp = 0
+
+ call grdcel &
+ !==========
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml ,&
+ nnod , lndfac , lndfbr , ncelbr , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivar0 , imrgra , inc , iccocg , nswrgp , imligp , iphydp ,&
+ iwarnp , nfecra , epsrgp , climgp , extrap , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume ,&
+ ra , ra , ra , &
+ rtp(1,ivar), coefa(1,iclimv) , coefb(1,iclimv) , &
+ w1(1,1) , w1(1,2) , w1(1,3) , &
+! d Az /dx d Az /dy d Az /dz
+ w2(1,1) , w2(1,2) , w2(1,3) , &
+ rdevel , rtuser , ra )
+
+! B = rot A
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = tracel(iloc) + w1(iel,2)
+ tracel(iloc+ncelps) = tracel(iloc+ncelps) - w1(iel,1)
+ tracel(iloc+2*ncelps) = tracel(iloc+2*ncelps) + zero
+ enddo
+
+! La variable est d�finie sur le tableau de travail. On
+! a deja utilise l'indirection via LSTCEL (donc IVARPR = 0),
+! et les valeurs sont non entrelacees (IENTLA = 0)
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, rbid, rbid)
+
+ endif
+
+
+!===============================================================================
+! 4. Module et Argument du potentiel si IELJOU = 4
+!===============================================================================
+
+ if (ippmod(ieljou).eq.4) then
+
+ idimt = 1
+ NAMEVR = 'ModPot'
+
+ ivar = isca(ipotr)
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ tracel(iloc) = &
+ sqrt( rtp(iel,isca(ipotr))*rtp(iel,isca(ipotr)) &
+ +rtp(iel,isca(ipoti))*rtp(iel,isca(ipoti)) )
+ enddo
+
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, rbid, rbid)
+
+ idimt = 1
+ NAMEVR = 'ArgPot'
+
+ ivar = isca(ipotr)
+
+ do iloc = 1, ncelps
+ iel = lstcel(iloc)
+ if ( rtp(iel,isca(ipotr)) .ne. 0.d0 ) then
+ if ( rtp(iel,isca(ipotr)) .ge. 0.d0 ) then
+ tracel(iloc) = &
+ atan( rtp(iel,isca(ipoti))/rtp(iel,isca(ipotr)))
+ else
+ if ( rtp(iel,isca(ipoti)) .gt. 0.d0 ) then
+ tracel(iloc) = &
+ 4.d0*atan(1.d0) &
+ +atan( rtp(iel,isca(ipoti)) &
+ /rtp(iel,isca(ipotr)))
+ else
+ tracel(iloc) = &
+ -4.d0*atan(1.d0) &
+ +atan( rtp(iel,isca(ipoti)) &
+ /rtp(iel,isca(ipotr)))
+ endif
+ endif
+ else
+ tracel(iloc) = 2.d0*atan(1.d0)
+ endif
+
+ if (tracel(iloc) .lt. 0.d0) then
+ tracel(iloc) = tracel(iloc) + 8.d0**atan(1.d0)
+ endif
+
+ enddo
+
+ ientla = 0
+ ivarpr = 0
+
+ call psteva(nummai, namevr, idimt, ientla, ivarpr, &
+ !==========
+ ntcabs, ttcabs, tracel, rbid, rbid)
+
+ endif
+
+endif
+
+return
+
+end
diff --git a/users/elec/useli1.f90 b/users/elec/useli1.f90
new file mode 100644
index 0000000..93a4904
--- /dev/null
+++ b/users/elec/useli1.f90
@@ -0,0 +1,273 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine useli1
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! INIT DES OPTIONS DES VARIABLES POUR
+! LE MODULE ELECTRIQUE
+! EN COMPLEMENT DE CE QUI A DEJA ETE FAIT DANS USINI1
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+integer ipp, iesp , idimve
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR useli1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ options generales. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+
+! --> Variables communes aux versions electriques
+
+! ---- Enthalpie
+ipp = ipprtp(isca(ihm))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- Potentiel reel
+ipp = ipprtp(isca(ipotr))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+!---- Fractions massiques des constituants
+if ( ngazg .gt. 1 ) then
+ do iesp = 1, ngazg-1
+ ipp = ipprtp(isca(iycoel(iesp)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+endif
+
+! --> Version effet Joule
+
+if ( ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4) then
+ ipp = ipprtp(isca(ipoti))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+! --> Version arc electrique 3D
+
+if ( ippmod(ielarc).ge.2 ) then
+ do idimve = 1, ndimve
+ ipp = ipprtp(isca(ipotva(idimve)))
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+endif
+
+! --> Version conduction ionique
+! indisponible dans la version presente
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! ---- Temperature
+ipp = ipppro(ipproc(itemp) )
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- Conductivite electrique
+ipp = ipppro(ipproc(ivisls(ipotr)))
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- Puissance volumique dissipee par effet Joule
+ipp = ipppro(ipproc(iefjou) )
+ichrvr(ipp) = 1
+ilisvr(ipp) = 1
+ihisvr(ipp,1)= -1
+
+! ---- densite de courant reelle
+do idimve = 1, ndimve
+ ipp = ipppro(ipproc(idjr(idimve)) )
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+enddo
+
+! ---- densite de courant imaginaire
+if ( ippmod(ieljou).eq.4 ) then
+ do idimve = 1, ndimve
+ ipp = ipppro(ipproc(idji(idimve)) )
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+endif
+
+if ( ippmod(ielarc).ge.1 ) then
+
+! ---- Forces electromagnetiques de Laplace
+ do idimve = 1, ndimve
+ ipp = ipppro(ipproc(ilapla(idimve)) )
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ enddo
+
+! ---- Coefficient d'absorption ou TS radiatif
+ if ( ixkabe.gt.0 ) then
+ ipp = ipppro(ipproc(idrad) )
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+ endif
+endif
+
+! ---- Charge electrique volumique
+if ( ippmod(ielion).ge.1 ) then
+ ipp = ipppro(ipproc(iqelec) )
+ ichrvr(ipp) = 1
+ ilisvr(ipp) = 1
+ ihisvr(ipp,1)= -1
+endif
+
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL
+!===============================================================================
+
+! --> Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+srrom = 0.d0
+
+! --> Recalage des variables electriques (joule ou arc electrique)
+! IELCOR = 0 : pas de correction
+! IELCOR = 1 : correction
+ielcor = 0
+
+! Intensite de courant imposee (arc electrique) en Ampere
+! et Puissance imposee (effet Joule/verre) en Watt
+! ces valeurs doivent etre positives
+! (et en general elles sont strictement positives)
+couimp = 0.d0
+puisim = 0.d0
+
+! Differentiel de potentiel initiale
+! la valeur doit etre strictement positive
+dpot = 0.d0
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/elec/useliv.f90 b/users/elec/useliv.f90
new file mode 100644
index 0000000..6b8c194
--- /dev/null
+++ b/users/elec/useliv.f90
@@ -0,0 +1,398 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine useliv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION CP
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul (inconnues transportees),
+! la valeur du pas de temps,
+
+! On a repris a titre d'exemple dans cette routine utilisateur
+! l'initialisation choisie par defaut.
+
+
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, mode, iphas
+integer iesp , idimve
+
+double precision tinit, hinit, coefe(ngazem)
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+! En Joule, on s'arrete (il faut etre sur que la loi H T est la bonne)
+if ( ippmod(ieljou).ge.1 ) then
+
+ write(nfecra,9010)
+ call csexit (1)
+
+! En Arc on continue car on a des valeurs par defaut admissibles
+! (en particulier, une enthalpie tiree du fichier de donnees)
+elseif(ippmod(ielarc).ge.1) then
+
+ if(ntcabs.eq.1) then
+ write(nfecra,9011)
+ endif
+
+ return
+
+endif
+
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA DEFINITION DES PROP. PHYSIQUES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uselph DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ proprietes physiques. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9011 format(/, &
+' Module arc electrique: proprietes physiques lues sur fichier',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. IMPRESSION DE CONTROLE
+!===============================================================================
+
+write(nfecra,9001)
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES : EXEMPLES
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+ iphas = 1
+
+! --> Enthalpie = H(T0) ou 0
+
+! En arc electrique, on initialise tout le domaine de calcul
+! a T0 avec la 1ere espece
+! En Joule, on initialise l'enthalpie a zero, et il faudra
+! que l'utilisateur intervienne, avec sa loi T->H ou une tabulation.
+
+! -- Calculs de HINIT
+
+ if ( ippmod(ielarc).ge.1 ) then
+ mode = -1
+ tinit = t0(iphas)
+ coefe(1) = 1.d0
+ if ( ngazg .gt. 1 ) then
+ do iesp = 2, ngazg
+ coefe(iesp) = 0.d0
+ enddo
+ endif
+ call elthht(mode,ngazg,coefe,hinit,tinit)
+ else
+ mode = -1
+ tinit = t0(iphas)
+ call usthht(mode,hinit,tinit)
+ endif
+
+! -- Valeurs de l'enthalpie
+
+ do iel = 1, ncel
+ rtp(iel,isca(ihm)) = hinit
+ enddo
+
+
+! --> Fractions massiques = 1 ou 0
+
+ if ( ngazg .gt. 1 ) then
+ do iel = 1, ncel
+ rtp(iel,isca(iycoel(1))) = 1.d0
+ enddo
+ do iesp = 2, ngazg-1
+ do iel = 1, ncel
+ rtp(iel,isca(iycoel(iesp))) = 0.d0
+ enddo
+ enddo
+ endif
+
+
+! --> Potentiels Electrique = 0
+
+! -- Potentiel Reel
+ do iel = 1, ncel
+ rtp(iel,isca(ipotr)) = 0.d0
+ enddo
+
+! -- Potentiel Imaginaire (Joule)
+ if ( ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4 ) then
+ do iel = 1, ncel
+ rtp(iel,isca(ipoti)) = 0.d0
+ enddo
+ endif
+
+! -- Potentiel vecteur (arc elec. 3D)
+ if ( ippmod(ielarc).ge.2 ) then
+ do idimve = 1, ndimve
+ do iel = 1, ncel
+ rtp(iel,isca(ipotva(idimve))) = 0.d0
+ enddo
+ enddo
+ endif
+
+endif
+
+!----
+! FORMATS
+!----
+
+ 9001 format(/, &
+' MODULE ELECTRIQUE ',/,&
+' useliv : Initialisation des variables par l''utilisateur ',/,&
+' ' )
+
+!----
+! FIN
+!----
+return
+end
diff --git a/users/elec/uselph.f90 b/users/elec/uselph.f90
new file mode 100644
index 0000000..5adeb01
--- /dev/null
+++ b/users/elec/uselph.f90
@@ -0,0 +1,602 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uselph &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , nphmx , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , ibrom , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , &
+ w5 , w6 , w7 , w8 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! REMPLISSAGE DES VARIABLES PHYSIQUES POUR LE MODULE ELECTRIQUE
+
+! ----> Effet Joule
+! ----> Arc Electrique
+! ----> Conduction Ionique
+
+! 1) Masse Volumique
+! 2) Viscosite moleculaire
+! 3) Chaleur massique Cp
+! 4) Lambda/Cp moleculaire
+! 4) Diffusivite moleculaire
+
+
+
+! ATTENTION :
+! =========
+
+
+! Il est INTERDIT de modifier la viscosite turbulente VISCT ici
+! ========
+! (une routine specifique est dediee a cela : usvist)
+
+! Pour le module electrique, toutes les proprietes physiques sont
+! supposees variables et contenues dans le tableau PROPCE
+! (meme si elles sont physiquement constantes)
+
+
+! Remarques :
+! ---------
+
+! Cette routine est appelee au debut de chaque pas de temps
+
+! Ainsi, AU PREMIER PAS DE TEMPS (calcul non suite), les seules
+! grandeurs initialisees avant appel sont celles donnees
+! - dans usini1 :
+! . la masse volumique (initialisee a RO0(IPHAS))
+! . la viscosite (initialisee a VISCL0(IPHAS))
+! - dans usiniv/useliv :
+! . les variables de calcul (initialisees a 0 par defaut
+! ou a l
+! ou a la valeur donnee dans usiniv)
+
+! On peut donner ici les lois de variation aux cellules
+! - de la masse volumique ROM kg/m3
+! (et eventuellememt aux faces de bord ROMB kg/m3)
+! - de la viscosite moleculaire VISCL kg/(m s)
+! - de la chaleur specifique associee CP J/(kg degres)
+! - des "diffusivites" associees aux scalaires VISCLS kg/(m s)
+
+
+! On dispose des types de faces de bord au pas de temps
+! precedent (sauf au premier pas de temps, ou les tableaux
+! ITYPFB et ITRIFB n'ont pas ete renseignes)
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! Il est conseille de ne garder dans ce sous programme que
+! le strict necessaire.
+
+
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! nphmx ! e ! <-- ! nphsmx !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! ibrom ! te ! <-- ! indicateur de remplissage de romb !
+! (nphmx ) ! ! ! !
+! izfppp ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...8(ncelet ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse , nphmx
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr), ibrom(nphmx)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet),w2(ncelet),w3(ncelet),w4(ncelet)
+double precision w5(ncelet),w6(ncelet),w7(ncelet),w8(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel , iphas
+integer ipcrom, ipcvis, ipccp , ipcvsl, ipcsig
+integer mode
+
+double precision tp
+double precision xkr , xbr
+double precision rom0 , temp0 , dilar , aa , bb , cc
+double precision srrom1, rhonp1
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+!===============================================================================
+! 0 - INITIALISATIONS A CONSERVER
+!===============================================================================
+
+! --- Initialisation memoire
+
+idebia = idbia0
+idebra = idbra0
+
+ipass = ipass + 1
+
+iphas = 1
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+
+! En Joule, on s'arrete : il faut que l'utilisateur
+! donne les proprietes physiques
+if ( ippmod(ieljou).ge.1 ) then
+
+ write(nfecra,9010)
+ call csexit (1)
+
+! En Arc on continue car on a un fichier de donnees
+! Un message indique que l'utilisateur n'a rien fourni
+elseif(ippmod(ielarc).ge.1) then
+
+ if(ipass.eq.1) then
+ write(nfecra,9011)
+ endif
+
+ return
+
+endif
+
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A LA DEFINITION DES PROP. PHYSIQUES ',/,&
+'@ ========= ',/,&
+'@ MODULE ELECTRIQUE ',/,&
+'@ ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uselph DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Ce sous-programme utilisateur permet de definir les ',/,&
+'@ proprietes physiques. Il est indispensable. ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+ 9011 format(/, &
+' Module arc electrique: pas d''intervention utilisateur pour ',/,&
+' le calcul des proprietes physiques.',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+! Message au premier passage pour indiquer que l'utilisateur a
+! rapatrie le sous-programme.
+if(ipass.eq.1) then
+ write(nfecra,1000)
+endif
+
+!===============================================================================
+! 1 - EFFET JOULE
+!===============================================================================
+
+if ( ippmod(ieljou).ge.1 ) then
+
+
+! Attention, dans les modules electriques, la chaleur massique, la
+! conductivite thermique et la conductivite electriques sont
+! toujours dans le tableau PROPCE
+! qu'elles soient physiquement variables ou non.
+
+! On n'utilisera donc PAS les variables
+! =====================
+! CP0(IPHAS), VISLS0(ISCALT(IPHAS))
+! VISLS0(IPOTR) et VISLS0(IPOTI)
+
+! Informatiquement, ceci se traduit par le fait que
+! ICP(IPHAS)>0, IVISLS(ISCALT(IPHAS))>0,
+! IVISLS(IPOTR)>0 et IVISLS(IPOTI)>0
+
+
+
+
+
+! Calcul de la temperature a partir de l'enthalpie
+! ------------------------------------------------
+
+! Ceci depend largement des choix utilisateur en
+! matiere de loi H-T (T en Kelvin)
+
+! On demande de fournir cette loi dans le sous programme usthht
+! (USERS/base/usthht.F)
+! usthht fournit en particulier un exemple d'interpolation
+! a partir d'une tabulation utilisateur
+! usthht en mode T->H sera utilise pour l'initialisation
+! de l'enthalpie dans useliv.
+
+! MODE = 1 : H=RTP(IEL,ISCA(IHM)) -> T=PROPCE(IEL,IPPROC(ITEMP))
+ mode = 1
+
+ do iel = 1, ncel
+ call usthht (mode, &
+ rtp(iel,isca(ihm)),propce(iel,ipproc(itemp)))
+ enddo
+
+
+! Masse volumique au centre des cellules
+! --------------------------------------
+
+! ATTENTION :
+! =========
+! Dans le module electrique effet Joule, on fournira
+! OBLIGATOIREMENT la loi de variation de la masse volumique ici
+! en renseignant PROPCE(IEL,IPCROM)
+! (meme si elle est uniforme ou constante).
+
+
+! Masse Vol : RO = ROM0 / (1+DILAR*(T-T0)
+! (Choudhary) semblable a Plard (HE-25/94/017)
+
+! avec sous-relaxation (sauf au premier pas de temps)
+
+ temp0 = 300.d0
+ rom0 = 2500.d0
+ dilar = 7.5d-5
+ if(ntcabs.gt.1) then
+ srrom1 = srrom
+ else
+ srrom1 = 0.d0
+ endif
+
+ ipcrom = ipproc(irom(iphas))
+ do iel = 1, ncel
+ rhonp1 = rom0 / &
+ (1.d0+ dilar * (propce(iel,ipproc(itemp))-temp0) )
+ propce(iel,ipcrom) = &
+ srrom1*propce(iel,ipcrom)+(1.d0-srrom1)*rhonp1
+ enddo
+
+
+! Viscosite moleculaire dynamique en kg/(m s)
+! ------------------------------------------
+
+! ATTENTION :
+! =========
+! Dans le module electrique effet Joule, on fournira
+! OBLIGATOIREMENT la loi de variation de la viscosite ici
+! en renseignant PROPCE(IEL,IPCVIS)
+! (meme si elle est uniforme ou constante).
+
+
+! Viscosite : MU = EXP((AA/T-BB)-CC)
+! (Choudhary)
+! Plard (HE-25/94/017) ; limite a 1173K par C Delalondre
+
+ ipcvis = ipproc(iviscl(iphas))
+ aa = 10425.d0
+ bb = 500.d0
+ cc =-6.0917d0
+
+ do iel = 1, ncel
+ if ( propce(iel,ipproc(itemp)) .gt. 1173.d0 ) then
+ tp = propce(iel,ipproc(itemp))
+ else
+ tp= 1173.d0
+ endif
+ propce(iel,ipcvis) = exp( (aa/(tp-bb))+cc )
+ enddo
+
+
+! Chaleur specifique J/(kg degres)
+! --------------------------------
+
+! ATTENTION :
+! =========
+! Dans le module electrique effet Joule, on fournira
+! OBLIGATOIREMENT la loi de variation de la chaleur massique ici
+! en renseignant PROPCE(IEL,IPCPP)
+! (meme si elle est uniforme ou constante).
+
+
+! CP = 1381 (Choudhary)
+! coherent avec Plard (HE-25/94/017)
+
+ ipccp = ipproc(icp(iphas))
+ do iel = 1, ncel
+ propce(iel,ipccp) = 1381.d0
+ enddo
+
+
+! Lambda/Cp en kg/(m s)
+! ---------------------
+
+! ATTENTION :
+! =========
+! Dans le module electrique effet Joule, on fournira
+! OBLIGATOIREMENT la loi de variation de la conductivite ici
+! en renseignant PROPCE(IEL,IPCVSL)
+! (meme si elle est uniforme ou constante).
+
+
+! Lambda
+! On suppose Cp renseigne au prealable.
+
+! Plard (HE-25/94/017)
+
+ ipcvsl = ipproc(ivisls(iscalt(iphas)))
+
+ do iel = 1, ncel
+ xbr = 85.25d0 &
+ -5.93d-2*(propce(iel,ipproc(itemp))-tkelvi) &
+ +2.39d-5*(propce(iel,ipproc(itemp))-tkelvi)**2
+ xkr = 16.d0*stephn*(1.4d0)**2*(propce(iel,ipproc(itemp)))**3 &
+ /(3.d0*xbr)
+
+ propce(iel,ipcvsl) = 1.73d0 + xkr
+ enddo
+
+! --- On utilise CP calcule dans PROPCE ci dessus
+ do iel = 1, ncel
+ propce(iel,ipcvsl) = propce(iel,ipcvsl)/propce(iel,ipccp)
+ enddo
+
+
+! Conductivite electrique en S/m
+! ==============================
+
+! ATTENTION :
+! =========
+! Dans le module electrique effet Joule, on fournira
+! OBLIGATOIREMENT la loi de variation de la conductivite ici
+! en renseignant PROPCE(IEL,IPCSIG)
+! (meme si elle est uniforme ou constante).
+
+
+! SIGMA (Plard HE-25/94/017)
+
+ ipcsig = ipproc(ivisls(ipotr))
+ do iel = 1, ncel
+ propce(iel,ipcsig) = &
+ exp(7.605d0-7200.d0/propce(iel,ipproc(itemp)))
+ enddo
+
+! La conductivite electrique pour le potentiel imaginaire est
+! toujours implicitement prise egale a la conductivite
+! utilisee pour le potentiel reel.
+! IL NE FAUT PAS la renseigner.
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! Conductivite electrique imaginaire :
+! La conductivite reelle et imaginaire sont dans le meme tableau.
+! Ce choix est fait en dur dans varpos.
+! Les pointeurs pour les deux existent quand meme.
+! Sinon, on pourrait faire ceci :
+ if(1.eq.0) then
+ if ( ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4 ) then
+ do iel = 1, ncel
+ propce(iel,ipproc(ivisls(ipoti))) = &
+ propce(iel,ipproc(ivisls(ipotr)))
+ enddo
+ endif
+ endif
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+! Diffusivite variable a l'exclusion de l'enthalpie et du potentiel
+! -----------------------------------------------------------------
+! Pour le moment, il n'y a pas d'autres scalaires et
+! on ne fait donc rien
+
+endif
+
+!===============================================================================
+! 2 - ARC ELECTRIQUE
+!===============================================================================
+
+! Les proprietes physiques sont a priori fournies par fichier
+! de donnees. IL n'y a donc rien a faire ici.
+
+! IF ( IPPMOD(IELARC).GE.1 ) THEN
+! ENDIF
+
+
+!===============================================================================
+! 3 - CONDUCTION IONIQUE
+!===============================================================================
+
+! CETTE OPTION N'EST PAS ACTIVABLE
+
+!--------
+! FORMATS
+!--------
+
+ 1000 format(/, &
+' Module electrique: intervention utilisateur pour ',/, &
+' le calcul des proprietes physiques.',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/elec/uselrc.f90 b/users/elec/uselrc.f90
new file mode 100644
index 0000000..8c83386
--- /dev/null
+++ b/users/elec/uselrc.f90
@@ -0,0 +1,775 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uselrc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , viscf , viscb , &
+ w1 , w2 , w3 , w4 , w5 , &
+ w6 , w7 , w8 , w9 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! ROUTINE PHYSIQUE PARTICULIERE POUR LE MODULE ELECTRIQUE
+
+! CALCULS DU COEFFICIENT DE RECALAGE
+! POUR LES VARIABLES ELECTIQUES
+! RECALAGE DES VARIABLES ELECTRIQUES
+! EN FONCTION DE CE COEFFICIENT
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! itypsm ! te ! <-- ! type de source de masse pour les !
+! (ncesmp,nvar) ! ! ! variables (cf. ustsma) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! smacel ! tr ! <-- ! valeur des variables associee a la !
+! (ncesmp,* ) ! ! ! source de masse !
+! ! ! ! pour ivar=ipr, smacel=flux de masse !
+! viscf(nfac) ! tr ! --- ! tableau de travail faces internes !
+! viscb(nfabor ! tr ! --- ! tableau de travail faces de bord !
+! w1..9(ncelet ! tr ! --- ! tableau de travail cellules !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve)
+integer ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision viscf(nfac), viscb(nfabor)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+double precision w7(ncelet), w8(ncelet), w9(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , ifac , iutile
+integer ipcefj , ipcdc1 , ipcdc2 , ipcdc3 , ipcsig
+integer ipdcrp , idimve
+
+double precision somje , coepoa , coefav , coepot
+double precision emax , aiex , amex
+double precision rayo , econs , z1 , z2 , posi
+double precision elcou , dtj , dtjm , delhsh , cdtj , cpmx
+double precision xelec , yelec , zelec
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+
+!===============================================================================
+! 2. ARC ELECTRIQUE
+!===============================================================================
+
+
+
+if ( ippmod(ielarc).ge.1 ) then
+
+! 3 Exemples : pour activer l'un des 3 mettre IUTILE= 1, 2 ou 3
+! Par defaut IUTILE = 1
+
+ iutile = 1
+
+! 2.1 : 1er exemple : cas general
+! ===============================
+
+ if ( iutile .eq. 1) then
+
+! CALCUL DU COEFFICIENT DE RECALAGE
+! -------------------------------
+
+! Calcul de l'integrale sur le Volume de J.E
+! (c'est forcement positif ou nul)
+
+ ipcefj = ipproc(iefjou)
+ somje = 0.d0
+ do iel = 1, ncel
+ somje = somje+propce(iel,ipcefj)*volume(iel)
+ enddo
+
+ if(irangp.ge.0) then
+ call parsom (somje)
+ endif
+
+ coepot = couimp*dpot/max(somje,epzero)
+
+ coepoa = coepot
+
+! On impose COEPOT >= 0.75 et COEPOT <= 1.5
+
+ if ( coepot .gt. 1.50d0 ) coepot = 1.50d0
+ if ( coepot .lt. 0.75d0 ) coepot = 0.75d0
+
+ write(nfecra,1000)coepoa,coepot
+ 1000 format(/, &
+ ' Courant impose/Courant= ',E14.5,', Coeff. recalage= ',E14.5)
+
+! RECALAGE DES VARIABLES ELECTRIQUES
+! ---------------------------------------
+
+! Valeur de DPOT
+! --------------
+
+ dpot = dpot*coepot
+
+! Potentiel Electrique (on pourrait eviter ; c'est pour le post)
+! --------------------
+
+ do iel = 1, ncel
+ rtp(iel,isca(ipotr)) = rtp(iel,isca(ipotr))*coepot
+ enddo
+
+
+! Densite de courant (sert pour A et pour jXB)
+! ------------------
+
+ if(ippmod(ielarc).ge.1 ) then
+ do idimve = 1, ndimve
+ ipdcrp = ipproc(idjr(idimve))
+ do iel = 1, ncel
+ propce(iel,ipdcrp) = propce(iel,ipdcrp) * coepot
+ enddo
+ enddo
+ endif
+
+! Effet Joule (sert pour H au pas de temps suivant)
+! -----------
+
+ ipcefj = ipproc(iefjou)
+ do iel = 1, ncel
+ propce(iel,ipcefj) = propce(iel,ipcefj)*coepot**2
+ enddo
+
+! Fin 1er exemple
+
+ else if ( iutile .eq. 2) then
+
+! 2.2 : 2eme exemple : Autre methode de recalage
+! ==============================================
+! Ceci est un cas particulier et doit etre adapte en fonction
+! du cas et du maillage (intervenir aussi dans uselcl)
+
+! Calcul de l'integrale sur le Volume de J.E
+! -----------------------------------
+! (c'est forcement positif ou nul)
+
+ ipcefj = ipproc(iefjou)
+ somje = 0.d0
+ do iel = 1, ncel
+ somje = somje+propce(iel,ipcefj)*volume(iel)
+ enddo
+
+ if(irangp.ge.0) then
+ call parsom (somje)
+ endif
+
+ if (somje .ne. 0) then
+ coepot = couimp*dpot/max(somje,epzero)
+ endif
+ write(nfecra,1001) couimp,dpot,somje
+
+! Calcul de l'intensite du courant d'arc
+! --------------------------------------
+! Calcul de l'integrale de J sur une surface plane
+! perpendiculaire a l'axe de l'arc
+
+! ATTENTION : changer la valeur des tests sur CDGFAC(3,IFAC)
+! en fonction du maillage
+
+ ipcdc3 = ipproc(idjr(3))
+ elcou = 0.d0
+ do ifac = 1, nfac
+ if( surfac(1,ifac).eq.0.d0 .and. surfac(2,ifac).eq.0.d0 &
+ .and. cdgfac(3,ifac) .lt. 0.7d-2 &
+ .and. cdgfac(3,ifac) .gt. 0.65d-2 ) then
+ iel = ifacel(1,ifac)
+ elcou = elcou + propce(iel,ipcdc3) * surfac(3,ifac)
+ endif
+ enddo
+
+ if(irangp.ge.0) then
+ call parsom (elcou)
+ endif
+
+ if ( abs(elcou).ge.1.d-06 ) then
+ elcou=abs(elcou)
+ else
+ elcou=0.d0
+ endif
+ if(elcou.ne.0.d0) coepoa = couimp/elcou
+ coepot = coepoa
+
+ WRITE(NFECRA,*) ' ELCOU = ',ELCOU
+
+ dtj = 1.d15
+ dtjm =dtj
+ delhsh = 0.d0
+ cdtj= 2.0d2
+
+ do iel = 1, ncel
+ if(propce(iel,ipproc(irom(1))).ne.0.d0) &
+ delhsh = propce(iel,ipcefj) * dt(iel) &
+ /propce(iel,ipproc(irom(1)))
+
+ if(delhsh.ne.0.d0) then
+ dtjm= rtp(iel,isca(iscalt(1)))/delhsh
+ else
+ dtjm= dtj
+ endif
+ dtjm=abs(dtjm)
+ dtj =min(dtj,dtjm)
+ enddo
+ if(irangp.ge.0) then
+ call parmin (dtj)
+ endif
+ WRITE(NFECRA,*) ' DTJ = ',DTJ
+
+ cpmx= sqrt(cdtj*dtj)
+ coepot=cpmx
+ if(ntcabs.gt.5) then
+ if(coepoa.ge.1.05d0 .and. coepot.le.cpmx) then
+ coepot=cpmx
+ else
+ coepot=coepoa
+ endif
+ endif
+
+ write(nfecra,1008)cpmx,coepoa,coepot
+ write(nfecra,1009)elcou,dpot*coepot
+
+! RECALAGE DES VARIABLES ELECTRIQUES
+! ----------------------------------
+
+! Valeur de DPOT
+! --------------
+
+ dpot = dpot*coepot
+
+! Potentiel Electrique (on pourrait eviter ; c'est pour le post)
+! --------------------
+
+ do iel = 1, ncel
+ rtp(iel,isca(ipotr)) = rtp(iel,isca(ipotr))*coepot
+ enddo
+
+
+! Densite de courant (sert pour A et pour jXB)
+! ------------------
+
+ if(ippmod(ielarc).ge.1 ) then
+ do idimve = 1, ndimve
+ do iel = 1, ncel
+ ipdcrp = ipproc(idjr(idimve))
+ propce(iel,ipdcrp) = propce(iel,ipdcrp) * coepot
+ enddo
+ enddo
+ endif
+
+! Effet Joule (sert pour H au pas de temps suivant)
+! -----------
+
+ ipcefj = ipproc(iefjou)
+ do iel = 1, ncel
+ propce(iel,ipcefj) = propce(iel,ipcefj)*coepot**2
+ enddo
+
+ else if ( iutile .eq. 3) then
+
+! 2.3 : 3eme exemple : cas avec claquage
+! =======================================
+! Ceci est un cas particulier et doit etre adapte en fonction
+! du cas et du maillage (intervenir aussi dans uselcl)
+
+
+! Utilisation d'une rampe d'intensite
+! -----------------------------------
+
+ if ( ntcabs.le.200 ) then
+ couimp = 200.d0
+ endif
+
+ if ( ntcabs.gt.200.and.ntcabs.le.400 ) then
+ couimp = 200.d0 + 2 * (ntcabs-200)
+ endif
+
+ if ( ntcabs.gt.400 ) then
+ couimp = 600.d0
+ endif
+
+! UTILISANT D'UN CLAQUAGE AUTO
+! ----------------------------
+
+ if(ntcabs.le.400.or.ntcabs.eq.ntpabs+1) iclaq = 0
+
+ econs = 1.5d5
+
+! ON REPERE SI IL Y A CLAQUAGE ET SI OUI OU
+! -----------------------------------------
+
+ if(ntcabs.ge.400 .and. iclaq .eq. 0 ) then
+ amex = 1.d30
+ aiex = -1.d30
+ emax = 0.d0
+
+! les composantes du champ electrique : J/SIGMA
+
+ ipcdc1 = ipproc(idjr(1))
+ ipcdc2 = ipproc(idjr(2))
+ ipcdc3 = ipproc(idjr(3))
+ ipcsig = ipproc(ivisls(ipotr))
+
+ do iel = 1, ncel
+
+ xelec = propce(iel,ipcdc1)/propce(iel,ipcsig)
+ yelec = propce(iel,ipcdc2)/propce(iel,ipcsig)
+ zelec = propce(iel,ipcdc3)/propce(iel,ipcsig)
+
+ w1(iel) = sqrt ( xelec**2 + yelec**2 + zelec**2 )
+
+ amex = min(amex,w1(iel))
+ aiex = max(aiex,w1(iel))
+ if( w1(iel) .ge. econs) then
+ WRITE(NFECRA,*) 'claquage ', NTCABS, W1(IEL)
+ iclaq = 1
+ ntdcla = ntcabs
+ if(w1(iel).gt.emax) then
+ xclaq = xyzcen(1,iel)
+ yclaq = xyzcen(2,iel)
+ zclaq = xyzcen(3,iel)
+ emax = w1(iel)
+ endif
+ endif
+ enddo
+
+ write(nfecra,*)
+ WRITE(NFECRA,*) ' NT min et max de E = ',NTCABS,AMEX,AiEX
+ write(nfecra,*)
+ write(nfecra,*) xclaq,yclaq,zclaq,ntdcla
+
+ endif
+
+! SI IL Y A CLAQUAGE : ON IMPOSE COLONNE CHAUDE DU CENTRE VERS
+! LE POINT DE CLAQUAGE
+! =============================================================
+
+ if(iclaq .eq. 1) then
+ if(ntcabs.le.ntdcla+30) then
+ z1 = zclaq - 3.d-4
+ if(z1.le.0.d0) z1 = 0.d0
+ z2 = zclaq + 3.d-4
+ if(z2.ge.2.d-2) z2 = 2.d-2
+
+ do iel = 1, ncel
+
+ if( xyzcen(3,iel).ge.z1 .and. xyzcen(3,iel).le.z2) then
+ rayo = sqrt((xclaq*xyzcen(1,iel)-yclaq*xyzcen(2,iel) &
+ /sqrt(xclaq**2+yclaq**2))**2+(xyzcen(3,iel) &
+ -zclaq)**2)
+ posi=xclaq*xyzcen(1,iel)
+ if( rayo.le.5d-4 .and. posi.ge.0d0 ) then
+! RTP(IEL,ISCA(IHM)) = 16.D6
+ rtp(iel,isca(ihm)) = 8.d7
+ endif
+ endif
+ enddo
+ else
+ iclaq = 0
+ endif
+ endif
+
+! Calcul de l'integrale sur le Volume de J.E
+! -----------------------------------
+! (c'est forcement positif ou nul)
+
+ ipcefj = ipproc(iefjou)
+ somje = 0.d0
+ do iel = 1, ncel
+ somje = somje+propce(iel,ipcefj)*volume(iel)
+ enddo
+
+ if(irangp.ge.0) then
+ call parsom (somje)
+ endif
+
+ if (somje .ne. 0) then
+ coepot = couimp*dpot/max(somje,epzero)
+ endif
+ write(nfecra,1001) couimp,dpot,somje
+
+! Calcul de l'intensite du courant d'arc
+! --------------------------------------
+! Calcul de l'integrale de J sur une surface plane
+! perpendiculaire a l'axe de l'arc
+
+! ATTENTION : changer la valeur des tests sur CDGFAC(3,IFAC)
+! en fonction du maillage
+
+ ipcdc3 = ipproc(idjr(3))
+ elcou = 0.d0
+ do ifac = 1, nfac
+ if( surfac(1,ifac).eq.0.d0 .and. surfac(2,ifac).eq.0.d0 &
+ .and. cdgfac(3,ifac) .gt. 0.05d-2 &
+ .and. cdgfac(3,ifac) .lt. 0.08d-2 ) then
+ iel = ifacel(1,ifac)
+ elcou = elcou + propce(iel,ipcdc3) * surfac(3,ifac)
+ endif
+ enddo
+
+ if(irangp.ge.0) then
+ call parsom (elcou)
+ endif
+
+ if ( abs(elcou).ge.1.d-06 ) then
+ elcou=abs(elcou)
+ else
+ elcou=0.d0
+ endif
+ if(elcou.ne.0.d0) coepoa = couimp/elcou
+ coepot = coepoa
+
+ WRITE(NFECRA,*) ' ELCOU = ',ELCOU
+
+ dtj = 1.d15
+ dtjm =dtj
+ delhsh = 0.d0
+ cdtj= 2.0d2
+
+ do iel = 1, ncel
+ if(propce(iel,ipproc(irom(1))).ne.0.d0) &
+ delhsh = propce(iel,ipcefj) * dt(iel) &
+ /propce(iel,ipproc(irom(1)))
+
+ if(delhsh.ne.0.d0) then
+ dtjm= rtp(iel,isca(iscalt(1)))/delhsh
+ else
+ dtjm= dtj
+ endif
+ dtjm=abs(dtjm)
+ dtj =min(dtj,dtjm)
+ enddo
+
+ if(irangp.ge.0) then
+ call parmin (dtj)
+ endif
+
+ cpmx= sqrt(cdtj*dtj)
+ coepot=cpmx
+ if(ntcabs.gt.5) then
+ if(coepoa.ge.1.05d0 .and. coepot.le.cpmx) then
+ coepot=cpmx
+ else
+ coepot=coepoa
+ endif
+ endif
+
+ write(nfecra,1008)cpmx,coepoa,coepot
+ write(nfecra,1009)elcou,dpot*coepot
+
+! RECALAGE DES VARIABLES ELECTRIQUES
+! ----------------------------------
+
+! Valeur de DPOT
+! --------------
+
+ dpot = dpot*coepot
+
+! Potentiel Electrique (on pourrait eviter ; c'est pour le post)
+! --------------------
+
+ do iel = 1, ncel
+ rtp(iel,isca(ipotr)) = rtp(iel,isca(ipotr))*coepot
+ enddo
+
+
+! Densite de courant (sert pour A et pour jXB)
+! ------------------
+
+ if(ippmod(ielarc).ge.1 ) then
+ do idimve = 1, ndimve
+ do iel = 1, ncel
+ ipdcrp = ipproc(idjr(idimve))
+ propce(iel,ipdcrp) = propce(iel,ipdcrp) * coepot
+ enddo
+ enddo
+ endif
+
+! Effet Joule (sert pour H au pas de temps suivant)
+! -----------
+
+ ipcefj = ipproc(iefjou)
+ do iel = 1, ncel
+ propce(iel,ipcefj) = propce(iel,ipcefj)*coepot**2
+ enddo
+
+ else
+ write(nfecra,5000) iutile
+ call csexit(1)
+ endif
+endif
+
+!===============================================================================
+! 3. EFFET JOULE
+!===============================================================================
+
+if ( ippmod(ieljou).ge.1 ) then
+
+! 3.1 CALCUL DU COEFFICIENT DE RECALAGE
+! --------------------------------------
+
+! Calcul de l'integrale sur le Volume de J.E
+! (c'est forcement positif ou nul)
+
+ ipcefj = ipproc(iefjou)
+ somje = 0.d0
+ do iel = 1, ncel
+ somje = somje+propce(iel,ipcefj)*volume(iel)
+ enddo
+
+ if(irangp.ge.0) then
+ call parsom (somje)
+ endif
+
+ coepot = sqrt(puisim/max(somje,epzero))
+
+ coefav = coepot
+
+! On impose COEF >= 0.75 et COEF <= 1.5
+
+ if ( coepot .gt. 1.50d0 ) coepot = 1.50d0
+ if ( coepot .lt. 0.75d0 ) coepot = 0.75d0
+
+ write(nfecra,2000)coefav,coejou
+ 2000 format(/, &
+ ' Puissance impose/Somme jE= ',E14.5,', Coeff. recalage= ',E14.5)
+
+
+! 3.2 RECALAGE DES VARIABLES JOULE
+! ---------------------------------
+
+! Valeur de DPOT (au cas ou utile)
+! --------------
+
+ dpot = dpot*coepot
+
+! Coefficient correcteur COEJOU cumule
+! ------------------------------------
+
+ coejou = coejou*coepot
+
+! Potentiel Electrique (on pourrait eviter ; c'est pour le post)
+! --------------------
+
+ if ( ippmod(ieljou).ne.3 .and. ippmod(ieljou).ne.4 ) then
+ do iel = 1, ncel
+ rtp(iel,isca(ipotr)) = rtp(iel,isca(ipotr))*coepot
+ enddo
+ endif
+
+! Potentiel complexe (on pourrait eviter ; c'est pour le post)
+! -----------------
+
+ if ( ippmod(ieljou).eq.2 ) then
+ do iel = 1, ncel
+ rtp(iel,isca(ipoti)) = rtp(iel,isca(ipoti))*coepot
+ enddo
+ endif
+
+
+! Effet Joule (sert pour H au pas de temps suivant)
+! -----------
+
+ ipcefj = ipproc(iefjou)
+ do iel = 1, ncel
+ propce(iel,ipcefj) = propce(iel,ipcefj)*coepot**2
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+ 1001 format(/, ' Courant impose= ',E14.5, /, &
+ ' Dpot= ',E14.5,/, &
+ ' Somje= ',E14.5)
+
+ 1008 format(/,' Cpmx = ',E14.5,/, &
+ ' COEPOA = ',E14.5,/, &
+ ' COEPOT = ',E14.5)
+
+ 1009 format(/,' Courant calcule = ',E14.5,/, &
+ ' Dpot recale = ',E14.5)
+
+ 5000 format(/,' ERREUR DANS USELRC :',/, &
+ ' VALEUR NON PERMISE DE IUTILE ',/, &
+ ' VERIFIER VOS DONNEES ')
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/elec/usetcl.f90 b/users/elec/usetcl.f90
new file mode 100644
index 0000000..a8c475f
--- /dev/null
+++ b/users/elec/usetcl.f90
@@ -0,0 +1,880 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usetcl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! MODULE ELECTRIQUE
+! (Effet Joule, Arc Electrique, Conduction ionique)
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT DE USCLIM.F
+
+
+
+! CE SOUS PROGRAMME UTILISATEUR EST OBLIGATOIRE
+! =============================================
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "elincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac , ii , iphas , iel
+integer i , ntf , nb , id , itrouv
+integer izone
+integer nborne(nbtrmx)
+integer ilelt , nlelt
+
+double precision rnbs2,capaeq
+double precision sir(nelemx) ,sii(nelemx)
+double precision sirb(nbtrmx,6),siib(nbtrmx,6)
+double precision ur(nbtrmx,6) ,ui(nbtrmx,6)
+double precision sirt(nbtrmx) ,siit(nbtrmx)
+character*200 chain
+
+!===============================================================================
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+!===============================================================================
+
+! 2.1 - Calcul des intensites de courant sur chaque electrode
+! -----------------------------------------------------
+
+! Mise a zero
+
+do i= 1,nbelec
+ sir(i) = 0.d0
+ sii(i) = 0.d0
+enddo
+
+do ntf= 1,nbtrf
+ sirt(ntf) = 0.d0
+ siit(ntf) = 0.d0
+enddo
+
+if(ntcabs.lt.(ntpabs+2)) then
+ do ntf = 1,nbtrf
+ uroff(ntf) = 0.d0
+ uioff(ntf) = 0.d0
+ enddo
+endif
+
+! Boucle sur les faces de bord selectionnees
+
+iphas = 1
+
+do i=1,nbelec
+
+ CHAIN = ' '
+ write(chain,3000) ielecc(i)
+
+ if ( ielect(i).ne. 0 ) then
+ call getfbr(chain,nlelt,lstelt)
+ !==========
+
+ do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ iel = ifabor(ifac)
+
+ do id=1,ndimve
+ sir(i) = sir(i) &
+ +propce(iel,ipproc(idjr(id)))*surfbo(id,ifac)
+ enddo
+
+ if ( ippmod(ieljou) .eq. 4 ) then
+ do id=1,ndimve
+ sii(i) = sii(i) &
+ +propce(iel,ipproc(idji(id)))*surfbo(id,ifac)
+ enddo
+ endif
+
+ enddo
+
+ endif
+
+enddo
+
+
+! 2.2 - Definitions des CL sur les tensions de chaque bornes des transfo
+! ----------------------------------------------------------------
+
+! 2.2.1 Calcul des intensites de courant sur chaque borne des transfo
+
+do i=1,nbelec
+ sirb(ielect(i),ielecb(i)) = 0.d0
+ if ( ippmod(ieljou) .eq. 4 ) then
+ siib(ielect(i),ielecb(i)) = 0.d0
+ endif
+enddo
+
+do i=1,nbelec
+ if ( ielect(i).ne. 0 ) then
+ sirb(ielect(i),ielecb(i)) = sirb(ielect(i),ielecb(i)) &
+ +sir(i)
+ if ( ippmod(ieljou) .eq. 4 ) then
+ siib(ielect(i),ielecb(i)) = siib(ielect(i),ielecb(i)) &
+ +sii(i)
+ endif
+ endif
+enddo
+
+! 2.2.2 Tensions sur chaque bornes des transfo
+
+do ntf=1,nbtrf
+
+! Primaire et Secondaire en Triangle
+
+ if (ibrpr(ntf) .eq. 0 .and. ibrsec(ntf) .eq. 0 ) then
+
+ nborne(ntf) = 3
+
+ rnbs2 = 3.d0*rnbs(ntf)*rnbs(ntf)
+ ur(ntf,1)= 1.154675d0*tenspr(ntf)/rnbs(ntf) &
+ + (zr(ntf)*sirb(ntf,1)-zi(ntf)*siib(ntf,1))/rnbs2
+
+ ur(ntf,2)= -0.5773d0*tenspr(ntf)/rnbs(ntf) &
+ + (zr(ntf)*sirb(ntf,2)-zi(ntf)*siib(ntf,2))/rnbs2
+ ur(ntf,3)= -0.5773d0*tenspr(ntf)/rnbs(ntf) &
+ + (zr(ntf)*sirb(ntf,3)-zi(ntf)*siib(ntf,3))/rnbs2
+
+ ui(ntf,1)= 0.d0 &
+ + (zi(ntf)*sirb(ntf,1)+zr(ntf)*siib(ntf,1))/rnbs2
+ ui(ntf,2)= -1.d0*tenspr(ntf)/rnbs(ntf) &
+ + (zi(ntf)*sirb(ntf,2)+zr(ntf)*siib(ntf,2))/rnbs2
+ ui(ntf,3)= 1.d0*tenspr(ntf)/rnbs(ntf) &
+ + (zi(ntf)*sirb(ntf,3)+zr(ntf)*siib(ntf,3))/rnbs2
+
+ else
+
+ WRITE(NFECRA,*) 'Matrice sur le Transfo a ecrire'
+ call csexit(1)
+
+ endif
+enddo
+
+! 2.2.3 Intensite de courant totale par transfo
+
+do ntf=1,nbtrf
+ sirt(ntf) = 0.d0
+ if ( ippmod(ieljou) .eq. 4 ) then
+ siit(ntf) = 0.d0
+ endif
+enddo
+
+do i=1,nbelec
+ if ( ielect(i).ne. 0 ) then
+ sirt(ielect(i)) = sirt(ielect(i)) + sir(i)
+ if ( ippmod(ieljou) .eq. 4 ) then
+ siit(ielect(i)) = siit(ielect(i)) + sii(i)
+ endif
+ endif
+enddo
+
+! 2.2.4 Prise en compte des Offset
+
+capaeq = 3.d0
+
+do ntf=1,nbtrf
+ uroff(ntf) = uroff(ntf) + sirt(ntf)/capaeq
+ if ( ippmod(ieljou) .eq. 4 ) then
+ uioff(ntf) = uioff(ntf) + siit(ntf)/capaeq
+ endif
+enddo
+
+! Transfo de reference ===> Offset nul
+
+if ( ntfref .gt. 0 ) then
+ uroff(ntfref) = 0.d0
+ uioff(ntfref) = 0.d0
+endif
+
+do ntf=1,nbtrf
+ do nb=1,nborne(ntf)
+ ur(ntf,nb) = ur(ntf,nb) + uroff(ntf)
+ if ( ippmod(ieljou) .eq. 4 ) then
+ ui(ntf,nb) = ui(ntf,nb) + uioff(ntf)
+ endif
+ enddo
+enddo
+
+! Affichage des UROFF
+
+write(nfecra,1500)
+do ntf=1,nbtrf
+ write(nfecra,2000) ntf,uroff(ntf)
+enddo
+write(nfecra,1501)
+
+! 2.2.5 Prise en compte des CL
+
+
+! Boucle sur les faces de bord selectionnees
+
+iphas = 1
+
+do i=1,nbelec
+
+ CHAIN = ' '
+ write(chain,3000) ielecc(i)
+
+ call getfbr(chain,nlelt,lstelt)
+ !==========
+
+ do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ iel = ifabor(ifac)
+
+ itypfb(ifac,iphas) = iparoi
+
+! - Numero de zone (choix du numero de l'arc)
+ izone = i
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ if ( ielect(i) .ne. 0 ) then
+ icodcl(ifac,isca(ipotr)) = 1
+ rcodcl(ifac,isca(ipotr),1) = ur(ielect(i),ielecb(i))
+
+ if ( ippmod(ieljou).eq.4 ) then
+ icodcl(ifac,isca(ipoti)) = 1
+ rcodcl(ifac,isca(ipoti),1) = ui(ielect(i),ielecb(i))
+ endif
+
+ else
+
+ ii = ipotr
+ icodcl(ifac,isca(ii)) = 3
+ rcodcl(ifac,isca(ii),3) = 0.d0
+
+ if ( ippmod(ieljou).eq. 4 ) then
+ ii = ipoti
+ icodcl(ifac,isca(ii)) = 3
+ rcodcl(ifac,isca(ii),3) = 0.d0
+ endif
+ endif
+
+ enddo
+
+enddo
+
+! 3 - Verification dans le cas ou pas de transfo de referenc qu'il existe
+! une paroi avec potentielle nul
+
+if ( ntfref .eq. 0 ) then
+
+ itrouv = 0
+ do ifac = 1, nfabor
+
+ iphas = 1
+
+ if ( itypfb(ifac,iphas) .eq. iparoi ) then
+
+ if (icodcl(ifac,isca(ipotr)) .eq. 1 ) then
+
+ if ( ippmod(ieljou).eq.3 ) then
+
+ if ( abs(rcodcl(ifac,isca(ipotr),1)).lt.1.e-20 ) then
+ itrouv = 1
+ endif
+
+ else if ( ippmod(ieljou).eq.4 ) then
+
+ if (icodcl(ifac,isca(ipoti)) .eq. 1 ) then
+
+ if (abs(rcodcl(ifac,isca(ipotr),1)).lt.1.e-20 &
+ .and.abs(rcodcl(ifac,isca(ipoti),1)).lt.1.e-20 ) then
+ itrouv = 1
+ endif
+ endif
+ endif
+ endif
+ endif
+ enddo
+
+ if ( itrouv .eq. 0 ) then
+ write(nfecra,1000)
+ call csexit (1)
+ endif
+
+endif
+
+!----
+! FORMATS
+!----
+
+ 1000 format(1X,' ERREUR VERSION JOULE : ',/, &
+ 1X,' ==================== ',/, &
+ 10X,' Vous n''avez pas donne de transfo de r�f�rence',/, &
+ 10X,' et vous n''avez pas de CL a potentiel nul dans le', &
+ ' domaine')
+ 1500 format(/,2X,' ** INFORMATIONS SUR LES DIFFERENTS TRANSFO'/, &
+ 2X,' ---------------------------------------'/,/, &
+ 1X,' ---------------------------------',/, &
+ 1X,' Numero du Transfo UROFF ',/, &
+ 1X,' ---------------------------------')
+ 1501 format(1X,' ---------------------------------')
+ 2000 format(10x,i6,12x,e12.5)
+ 3000 format(i7)
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/fuel/usfucl.f90 b/users/fuel/usfucl.f90
new file mode 100644
index 0000000..798fdac
--- /dev/null
+++ b/users/fuel/usfucl.f90
@@ -0,0 +1,904 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usfucl &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , itrifb , itypfb , izfppp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , rcodcl , &
+ w1 , w2 , w3 , w4 , w5 , w6 , coefu , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! ROUTINE UTILISATEUR POUR PHYSIQUE PARTICULIERE
+! COMBUSTION FUEL
+! REMPLISSAGE DU TABLEAU DE CONDITIONS AUX LIMITES
+! (ICODCL,RCODCL) POUR LES VARIABLES INCONNUES
+! PENDANT DE USCLIM.F
+
+
+
+
+
+! INTRODUCTION
+! ============
+
+! On donne ici les conditions aux limites par face de bord.
+
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.C
+
+
+! TYPE DE CONDITIONS AUX LIMITES
+! ==============================
+
+! On peut affecter les conditions aux limites de deux manieres.
+
+
+! Pour les conditions "standard" :
+! --------------------------------
+
+! (entree, sortie libre, paroi, symetrie), on donne un code
+! stocke dans le tableau ITYPFB (dimensionne au nombre de
+! faces de bord,nombre de phases). Ce code sera ensuite
+! utilise par un sous-programme non utilisateur pour affecter
+! les conditions correspondantes (les scalaires, en
+! particulier, recevront alors les conditions de la phase a
+! laquelle ils sont associes). Ainsi :
+
+! Code | Type de bord
+! -------------------------
+! IENTRE | Entree
+! ISOLIB | Sortie libre
+! ISYMET | Symetrie
+! IPAROI | Paroi (lisse)
+! IPARUG | Paroi rugueuse
+
+! Les entiers IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! sont affectes par ailleurs (include param.h). Leur valeur
+! est superieure ou egale a 1 et
+! inferieure ou egale a NTYPMX (valeur fixee dans paramx.h)
+
+
+
+! En outre, il faut donner certaines valeurs :
+
+
+! - Entree (plus precisement entree/sortie a debit impose, car le debit
+! peut etre impose sortant) :
+
+! -> Conditions de Dirichlet sur les variables
+! autres que la pression obligatoire si le flux est entrant,
+! optionnelle si le flux est sortant (le code affecte flux nul
+! si aucun Dirichlet n'est specifie) ; ainsi
+! en face IFAC, sur la variable IVAR : RCODCL(IFAC,IVAR,1)
+
+
+! - Paroi lisse : (= solide impermeable, avec frottement lisse)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 5
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+
+! - Paroi rugueuse : (= solide impermeable, avec frottement rugueux)
+
+! -> Valeur de la vitesse de paroi defilante s'il y a lieu
+! en face IFAC, RCODCL(IFAC,IU,1)
+! RCODCL(IFAC,IV,1)
+! RCODCL(IFAC,IW,1)
+! -> Valeur de la hauteur de rugosite dynamique a specifier dans
+! RCODCL(IFAC,IU,3) (valeur pour IV et IW non utilisee)
+! -> Code specifique et valeur de la temperature imposee
+! en paroi rugueuse s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 6
+! RCODCL(IFAC,IVAR,1) = Temperature imposee
+! RCODCL(IFAC,IVAR,3) = Hauteur de rugosite thermique
+! -> Code specifique et valeur du flux imposee
+! en paroi s'il y a lieu :
+! en face IFAC, ICODCL(IFAC,IVAR) = 3
+! RCODCL(IFAC,IVAR,3) = Flux impose
+! =
+! Noter que la condition par defaut pour les scalaires
+! (hors k et epsilon) est un Neumann homogene
+
+! - Symetrie (= paroi impermeable avec glissement) :
+
+! -> Rien a preciser
+
+
+! - Sortie libre (plus precisement entree/sortie libre a pression imposee)
+
+! -> Rien a preciser pour la pression et la vitesse
+! Pour les scalaires et grandeurs turbulentes, une valeur de Dirichlet
+! peut etre specifiee de maniere optionnelle. Le comportement est le
+! suivant :
+! * la pression est toujours traitee en Dirichlet
+! * si flux de masse entrant :
+! on retient la vitesse a l'infini
+! condition de Dirichlet pour les scalaires et grandeurs
+! turbulentes (ou flux nul si l'utilisateur n'a pas
+! specifie de Dirichlet)
+! si flux de masse sortant :
+! on impose un flux nul sur la vitesse, les scalaires et
+! les grandeurs turbulentes
+
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie libre trouvee
+
+
+! Pour les conditions "non standard" :
+! ------------------------------------
+
+! Autres que (entree, sortie libre, paroi, symetrie), on donne
+! - d'une part, pour chaque face :
+! -> une valeur de ITYPFB admissible
+! ie superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir sa valeur dans paramx.h).
+! Les valeurs predefinies dans paramx.h
+! IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG sont dans cet
+! intervalle et il est preferable de ne pas affecter
+! inconsidrement et par hasard a ITYPFB la valeur
+! d'un de ces entiers. Pour eviter cela, on peut
+! utiliser IINDEF si l'on souhaite eviter de verifier
+! les valeurs dans paramx.h. IINDEF est une valeur
+! admissible a laquelle n'est attachee aucune condition
+! limite predefinie.
+! Noter que le tableau ITYPFB est
+! reinitialise a chaque pas de temps a la valeur
+! non admissible 0. Si on oublie de modifier ITYPFB pour
+! une face, le code s'arretera.
+
+! - et d'autre part pour chaque face et chaque variable :
+! -> un code ICODCL(IFAC,IVAR)
+! -> trois reels RCODCL(IFAC,IVAR,1)
+! RCODCL(IFAC,IVAR,2)
+! RCODCL(IFAC,IVAR,3)
+! La valeur de ICODCL est prise parmi les suivantes :
+! 1 : Dirichlet (utilisable pour toute variable)
+! 3 : Neumann (utilisable pour toute variable)
+! 4 : Symetrie (utilisable uniquement pour la vitesse et
+! les composantes du tenseur Rij)
+! 5 : Paroi lisse (utilisable pour toute variable sauf la
+! pression)
+! 6 : Paroi rugueuse (utilisable pour toute variable sauf la
+! pression)
+! 9 : Sortie libre (utilisable uniquement pour la vitesse)
+! Les valeurs des 3 reels RCODCL sont les suivantes
+! RCODCL(IFAC,IVAR,1) :
+! Dirichlet sur la variable si ICODCL(IFAC,IVAR)= 1
+! valeur en paroi (defilmnt, temp) si ICODCL(IFAC,IVAR)= 5
+! La dimension de RCODCL(IFAC,IVAR,1) est celle de la
+! variable resolue : ex U (vitesse en m/s),
+! T (temperature en degres)
+! H (enthalpie en J/kg)
+! F (scalaire passif en -)
+! RCODCL(IFAC,IVAR,2) :
+! coefficient d'echange "exterieur" (entre la valeur
+! imposee et la valeur au bord du domaine)
+! RINFIN = infini par defaut
+! Pour les vitesses U, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCL+VISCT) / D
+! Pour la pression P, en s/m :
+! RCODCL(IFAC,IVAR,2) = DT / D
+! Pour les temperatures T, en Watt/(m2 degres) :
+! RCODCL(IFAC,IVAR,2) = CP*(VISCLS+VISCT/SIGMAS) / D
+! Pour les enthalpies H, en kg /(m2 s) :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,2) = (VISCLS+VISCT/SIGMAS) / D
+! (D a la dimension d'une distance en m)
+
+! RCODCL(IFAC,IVAR,3) si ICODCL(IFAC,IVAR)<>6 :
+! Densite de flux (< 0 si gain, n normale orientee vers l'exterieur)
+! si ICODCL(IFAC,IVAR)= 3
+! Pour les vitesses U, en kg/(m s2) = J :
+! RCODCL(IFAC,IVAR,3) = -(VISCL+VISCT) * (GRAD U).n
+! Pour la pression P, en kg/(m2 s) :
+! RCODCL(IFAC,IVAR,3) = -DT * (GRAD P).n
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) =-CP*(VISCLS+VISCT/SIGMAS) * (GRAD T).n
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD H).n
+! Pour les autres scalaires F en :
+! RCODCL(IFAC,IVAR,3) = -(VISCLS+VISCT/SIGMAS) * (GRAD F).n
+
+! RCODCL(IFAC,IVAR,3) SI ICODCL(IFAC,IVAR)=6 :
+! Rugosites de la loi rugueuse
+! Pour les vitesses U, rugosite dynamique
+! RCODCL(IFAC,IVAR,3) = RUGD
+! Pour les autres scalaires, rugosite thermique
+! RCODCL(IFAC,IVAR,3) = RUGT
+
+
+! Noter bien que si l'utilisateur affecte une valeur a ITYPFB
+! parmi IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG
+! et qu'il ne modifie pas ICODCL (valeur nulle par defaut),
+! c'est ITYPFB qui imposera la condition limite.
+
+! Par contre, si l'utilisateur impose
+! ICODCL(IFAC,IVAR) (non nul),
+! ce sont alors les valeurs de RCODCL qu'il aura fournies
+! qui sont retenues pour la face et la variable consideree
+! (s'il ne precise pas RCODCL, ce sont les valeurs
+! par defaut qui sont retenues pour la face et
+! la variable consideree soit :
+! RCODCL(IFAC,IVAR,1) = 0.D0
+! RCODCL(IFAC,IVAR,2) = RINFIN
+! RCODCL(IFAC,IVAR,3) = 0.D0)
+! En particulier, on peut par exemple
+! -> donner ITYPFB(IFAC,IPHAS) = IPAROI
+! qui impose les conditions de paroi par defaut pour toutes
+! les variables sur la face IFAC,
+! -> et preciser EN OUTRE pour la variable IVAR sur cette
+! face IFAC des conditions paarticulieres en imposant
+! ICODCL(IFAC,IVAR) et les 3 RCODCL.
+
+
+! L'utilisateur peut egalement affecter a ITYPFB une valeur
+! non egale a IENTRE, ISOLIB, ISYMET, IPAROI, IPARUG, IINDEF
+! mais superieure ou egale a 1 et inferieure ou egale a
+! NTYPMX (voir les valeurs dans param.h) pour reperer
+! des groupes de couleurs dans d'autres sous programmes
+! qui lui seraient propres et ou ITYPFB serait disponible.
+! Dans ce cas cependant, il faudra
+! imposer les conditions limites en donnant des valeurs a
+! ICODCL et aux trois RCODCL (puisque la valeur de ITYPFB
+! ne sera pas predefinie dans le code).
+
+
+! REGLES DE COHERENCE
+! ===================
+
+! Quelques regles de coherence entre les codes ICODCL
+! des variables pour les conditions non standard :
+
+! Les codes des vitesses doivent etre identiques
+! Les codes des Rij doivent etre identiques
+! Si code (vitesse ou Rij) = 4
+! il faut code (vitesse et Rij) = 4
+! Si code (vitesse ou turbulence) = 5
+! il faut code (vitesse et turbulence) = 5
+! Si code (vitesse ou turbulence) = 6
+! il faut code (vitesse et turbulence) = 6
+! Si code scalaire (hormis pression ou fluctuations) = 5
+! il faut code vitesse = 5
+! Si code scalaire (hormis pression ou fluctuations) = 6
+! il faut code vitesse = 6
+
+
+! REMARQUES
+! ==========
+
+! Attention : pour imposer un flux (non nul) sur les Rij,
+! la viscosite a prendre en compte est VISCL
+! meme si VISCT existe (VISCT=RHO CMU K2/EPSILON)
+
+
+! On dispose du tableau de tri des faces de bord au pas
+! de temps precedent (sauf au premier pas de temps, ou
+! ITRIFB n'a pas ete renseigne).
+! Le tableau du type des faces de bord ITYPFB a ete
+! reinitialise avant d'entrer dans le sous programme.
+
+
+
+! Noter comment acceder a certaines variables :
+
+! Valeurs aux cellules
+! Soit IEL = IFABOR(IFAC)
+
+! * Masse vol phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IROM (IPHAS)))
+! * Viscosite moleculaire dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCL(IPHAS)))
+! * Viscosite turbulente dynamique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISCT(IPHAS)))
+! * Chaleur specifique phase IPHAS, cellule IEL :
+! PROPCE(IEL ,IPPROC(ICP (IPHAS)))
+! * Diffusivite lambda scalaire ISCAL, cellule IEL :
+! PROPCE(IEL ,IPPROC(IVISLS(ISCAL)))
+
+! Valeurs aux faces de bord
+
+! * Masse vol phase IPHAS, face de bord IFAC :
+! PROPFB(IFAC,IPPROB(IROM (IPHAS)))
+! * Flux de masse relatif a la variable IVAR , face de bord IFAC :
+! (i.e. le flux de masse servant a la convection de IVAR)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR )))
+! * Pour les autres grandeurs a la face de bord IFAC :
+! prendre pour approximation la valeur dans la cellule IEL
+! adjacente i.e. comme plus haut avec IEL = IFABOR(IFAC).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! --> ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! --> ! type des faces de bord !
+! nphas ) ! ! ! !
+! izfppp ! te ! --> ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module phys. part. !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! w1,2,3,4,5,6 ! tr ! --- ! tableaux de travail !
+! (ncelet ! ! ! (calcul du gradient de pression) !
+! coefu ! tr ! --- ! tab de trav !
+! (nfabor,3) ! ! ! (calcul du gradient de pression) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "ihmpre.h"
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer icodcl(nfabor,nvar)
+integer itrifb(nfabor,nphas), itypfb(nfabor,nphas)
+integer izfppp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision w1(ncelet),w2(ncelet),w3(ncelet)
+double precision w4(ncelet),w5(ncelet),w6(ncelet)
+double precision coefu(nfabor,ndim)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+
+integer idebia, idebra
+integer ifac, iphas, ii
+integer izone
+integer iclafu
+integer ilelt, nlelt
+
+double precision uref2, d2s3
+double precision xkent, xeent
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+ if(1.eq.1) then
+ write(nfecra,9001)
+ call csexit (1)
+ !==========
+ endif
+
+ 9001 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ FUEL ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uscpcl DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. INITIALISATIONS
+
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. REMPLISSAGE DU TABLEAU DES CONDITIONS LIMITES
+! ON BOUCLE SUR LES FACES DE BORD
+! ON DETERMINE LA FAMILLE ET SES PROPRIETES
+! ON IMPOSE LA CONDITION LIMITE
+
+! IMPOSER ICI LES CONDITIONS LIMITES SUR LES FACES DE BORD
+
+! INTERVENTION UTLISATEUR
+
+!===============================================================================
+
+! Pour chaque type de condition relative aux physiques particulieres
+! on affecte un numero de zone de maniere a pouvoir donner les
+! conditions aux limites par zone physique et non par face de maillage
+! Un numero de zone est un entier arbitraire strictement positif
+! et inferieur ou egal a NOZPPM (dont la valeur est fixee en
+! parametre dans ppppar.h)
+
+iphas = 1
+
+! ELEMENT ADJACENT A LA FACE DE BORD
+
+! ---- Facette de type entree correspondant a une entree d'air
+! Par exemple : Air secondaire ou Air tertiaire
+
+CALL GETFBR('12',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (choix du numero de couleur par exemple)
+ izone = 1
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! ------ Pour ces facettes d'entree , on est a debit impose
+
+ ientat(izone) = 1
+ iqimp(izone) = 1
+! - Debit en kg/s pour l'air
+ qimpat(izone) = 1.46d-03
+! - Temperature en K pour l'air
+ timpat(izone) = 400.d0 + tkelvi
+! - Debit nul de fuel dans l'entree d'air
+ qimpfl(izone) = 0.d0
+
+! ------ On impose en couleur 12 une entree a debit impose
+! L'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 5.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.1d0
+ xintur(izone) = 0.1d0
+
+! Exemple de cas ou ICALKE(IZONE) = 0 : DEBUT
+! Eliminer ces lignes pour la clarte si on a fait le choix ICALKE(IZONE) = 1
+
+ if(icalke(izone).eq.0) then
+
+! Calcul de k et epsilon en entree (XKENT et XEENT) a partir
+! l'intensite turbulente et de lois standards en conduite
+! circulaire (leur initialisation est inutile mais plus
+! propre)
+ uref2 = rcodcl(ifac,iu(iphas),1)**2 &
+ +rcodcl(ifac,iv(iphas),1)**2 &
+ +rcodcl(ifac,iw(iphas),1)**2
+ uref2 = max(uref2,1.d-12)
+ xkent = epzero
+ xeent = epzero
+
+ call keenin &
+ !==========
+ ( uref2, xintur(izone), dh(izone), cmu, xkappa, &
+ xkent, xeent )
+
+! ITYTUR est un indicateur qui vaut ITURB/10
+ if (itytur(iphas).eq.2) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(itytur(iphas).eq.3) then
+
+ rcodcl(ifac,ir11(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir22(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir33(iphas),1) = d2s3*xkent
+ rcodcl(ifac,ir12(iphas),1) = 0.d0
+ rcodcl(ifac,ir13(iphas),1) = 0.d0
+ rcodcl(ifac,ir23(iphas),1) = 0.d0
+ rcodcl(ifac,iep(iphas),1) = xeent
+
+ elseif(iturb(iphas).eq.50) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iep(iphas),1) = xeent
+ rcodcl(ifac,iphi(iphas),1) = d2s3
+ rcodcl(ifac,ifb(iphas),1) = 0.d0
+
+ elseif(iturb(iphas).eq.60) then
+
+ rcodcl(ifac,ik(iphas),1) = xkent
+ rcodcl(ifac,iomg(iphas),1) = xeent/cmu/xkent
+
+ endif
+
+ endif
+
+! Exemple de cas ou ICALKE(IZONE) = 0 : FIN
+
+! ------ Traitement des scalaires physiques particulieres
+! Ils sont traites automatiquement
+
+
+! ------ Traitement des scalaires utilisateurs
+
+! Exemple : On traite les scalaires rattaches a la phase courante : DEBUT
+! Eliminer ces lignes pour la clarte s'il n'y en a pas
+ if ( (nscal-nscapp).gt.0 ) then
+ do ii = 1, (nscal-nscapp)
+ if(iphsca(ii).eq.iphas) then
+ rcodcl(ifac,isca(ii),1) = 1.d0
+ endif
+ enddo
+ endif
+
+enddo
+
+
+! ---- Facette de type entree correspondant a une entree d'air + Fuel
+! (Air Primaire + Fuel)
+
+CALL GETFBR('11',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = ientre
+
+! Numero de zone (choix du numero de couleur par exemple)
+ izone = 2
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+! ------ Pour ces facettes d'entree , on est a debit impose
+
+ ientfl(izone) = 1
+ iqimp(izone) = 1
+! - Debit en kg/s pour l'air
+ qimpat(izone) = 1.46d-03
+! - Temperature en K pour l'air
+ timpat(izone) = 800.d0 + tkelvi
+
+! - Debit en kg/s pour le fuel
+ qimpfl(izone) = 1.46d-04/360.d0
+
+! - Distribution en masse en % pour le fuel
+! relative a la classe ICLAFU (1 < ICLA < NCLAFU )
+ iclafu = 1
+ distfu(izone,iclafu) = 100.d0
+
+! - Temperature en K pour le fuel
+ timpfl(izone) = 100.d0 + tkelvi
+
+! ------ On impose en couleur 11 une entree a debit impose
+! L'utilisateur donne donc ici uniquement
+! la direction du vecteur vitesse
+
+ rcodcl(ifac,iu(iphas),1) = 0.d0
+ rcodcl(ifac,iv(iphas),1) = 0.d0
+ rcodcl(ifac,iw(iphas),1) = 5.d0
+
+! ------ Traitement de la turbulence
+
+! La turbulence est calculee par defaut si ICALKE different de 0
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference adaptes a l'entree courante si ICALKE = 1
+! - soit a partir du diametre hydraulique, d'une vitesse
+! de reference et de l'intensite turvulente
+! adaptes a l'entree courante si ICALKE = 2
+
+! Choix pour le calcul automatique ICALKE = 1 ou 2
+ icalke(izone) = 1
+! Saisie des donnees
+ dh(izone) = 0.1d0
+ xintur(izone) = 0.1d0
+
+enddo
+
+! --- On impose en couleur 15 une paroi laterale
+
+CALL GETFBR('15',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! PAROI : DEBIT NUL (FLUX NUL POUR LA PRESSION)
+! FROTTEMENT POUR LES VITESSES (+GRANDEURS TURB)
+! FLUX NUL SUR LES SCALAIRES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = iparoi
+
+
+! Numero de zone (choix du numero de couleur par exemple)
+ izone = 3
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+! --- On impose en couleur 19 une sortie
+
+CALL GETFBR('19',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SORTIE : FLUX NUL VITESSE ET TEMPERATURE, PRESSION IMPOSEE
+! Noter que la pression sera recalee a P0
+! sur la premiere face de sortie de type 9 (ISOLIB)
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isolib
+
+! Numero de zone (choix du numero de couleur par exemple)
+ izone = 4
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+ enddo
+
+! --- On impose en couleur 14 ou 4 une symetrie
+
+CALL GETFBR('14 or 4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+! SYMETRIES
+
+! Type de condition aux limites pour les variables standard
+ itypfb(ifac,iphas) = isymet
+
+! Numero de zone (choix du numero de couleur par exemple)
+ izone = 5
+
+! - Reperage de la zone a laquelle appartient la face
+ izfppp(ifac) = izone
+
+enddo
+
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/fuel/usfui1.f90 b/users/fuel/usfui1.f90
new file mode 100644
index 0000000..92d0e25
--- /dev/null
+++ b/users/fuel/usfui1.f90
@@ -0,0 +1,366 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usfui1
+!================
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE UTILISATEUR POUR ENTREE DES PARAMETRES DE CALCUL
+! RELATIFS A LA COMBUSTION DU FUEL
+! (COMMONS)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer jpp , icla
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ MODULE COMBUSTION FUEL : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usfui1 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. VARIABLES TRANSPORTEES
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+
+! --> Variables propres a la suspension gaz - particules
+
+! - Enthalpie de la suspension
+jpp = ipprtp(isca(ihm))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1)= -1
+
+! --> Variables propres a la phase dispersee
+
+do icla = 1, nclafu
+! - Fraction massique de Fuel
+ jpp = ipprtp(isca(iyfol(icla)))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1)= -1
+
+! - Nb de particules par kg de melange
+ jpp = ipprtp(isca(ing(icla)))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1)= -1
+
+! - Enthalpie du Fuel
+ jpp = ipprtp(isca(ihlf(icla)))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1)= -1
+enddo
+
+
+! --> Variables propres a la phase continue
+
+! - Moyenne de F1 (vapeur )
+jpp = ipprtp(isca(ifvap))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1)= -1
+
+! - Moyenne du F3 (representatif du C libere sous forme de CO
+! lors de la combustion heterogene)
+jpp = ipprtp(isca(ifhtf))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1)= -1
+
+! - Variance associe au traceur 4 (air)
+jpp = ipprtp(isca(if4p2m))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1)= -1
+
+! - YCO2
+
+if ( ieqco2 .ge. 1 ) then
+ jpp = ipprtp(isca(iyco2))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1)= -1
+endif
+
+! - HCN et NO
+
+if ( ieqnox .eq. 1 ) then
+ jpp = ipprtp(isca(iyhcn))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1)= -1
+ jpp = ipprtp(isca(iyno))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1)= -1
+ jpp = ipprtp(isca(itaire))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1)= -1
+endif
+
+!===============================================================================
+! 2. VARIABLES ALGEBRIQUES OU D'ETAT
+!===============================================================================
+
+! Sortie chrono, suivi listing, sortie histo
+! Si l'on n'affecte pas les tableaux suivants,
+! les valeurs par defaut seront utilisees
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR(.,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+! --> Variables algebriques propres a la suspension gaz - particules
+
+! - Masse molaire du melange gazeux
+jpp = ipppro(ipproc(immel))
+ichrvr(jpp) = 0
+ilisvr(jpp) = 0
+ihisvr(jpp,1) = -1
+
+! --> Variables algebriques propres a la phase dispersee
+
+do icla = 1, nclafu
+! - Temperature des gouttes
+ jpp = ipppro(ipproc(itemp3(icla)))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1) = -1
+
+! - Masse volumique des gouttes
+ jpp = ipppro(ipproc(irom3(icla)))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1) = -1
+
+! - Diametre des gouttes
+ jpp = ipppro(ipproc(idiam3(icla)))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1) = -1
+
+! - Transfert d'energie par convection-diffusion
+ jpp = ipppro(ipproc(ih1hlf(icla)))
+ ichrvr(jpp) = 0
+ ilisvr(jpp) = 0
+ ihisvr(jpp,1) = -1
+
+! - Transfert de masse du a l'evaporation (s-1) < 0
+ jpp = ipppro(ipproc(igmeva(icla)))
+ ichrvr(jpp) = 0
+ ilisvr(jpp) = 0
+ ihisvr(jpp,1) = -1
+
+! - Transfert de masse du a la combustion heterogene
+ jpp = ipppro(ipproc(igmhtf(icla)))
+ ichrvr(jpp) = 0
+ ilisvr(jpp) = 0
+ ihisvr(jpp,1) = -1
+enddo
+
+! --> Variables algebriques propres a la phase continue
+
+! - Temperature du melange gazeux
+jpp = ipppro(ipproc(itemp1))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du FOV
+jpp = ipppro(ipproc(iym1(ifov)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CO
+jpp = ipppro(ipproc(iym1(ico)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du O2
+jpp = ipppro(ipproc(iym1(io2)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du CO2
+jpp = ipppro(ipproc(iym1(ico2)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du H2O
+jpp = ipppro(ipproc(iym1(ih2o)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du N2
+jpp = ipppro(ipproc(iym1(in2)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du H2S
+jpp = ipppro(ipproc(iym1(ih2s)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - Fraction massique (dans le melange gazeux) du SO2
+jpp = ipppro(ipproc(iym1(iso2)))
+ichrvr(jpp) = 1
+ilisvr(jpp) = 1
+ihisvr(jpp,1) = -1
+
+! - MODEL NOX :
+if ( ieqnox .eq. 1 ) then
+ jpp = ipppro(ipproc(ighcn1))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1) = -1
+ jpp = ipppro(ipproc(ighcn2))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1) = -1
+ jpp = ipppro(ipproc(ignoth))
+ ichrvr(jpp) = 1
+ ilisvr(jpp) = 1
+ ihisvr(jpp,1) = -1
+endif
+
+!===============================================================================
+! 3. OPTIONS DE CALCUL
+!===============================================================================
+
+! --- Coefficient de relaxation de la masse volumique
+! RHO(n+1) = SRROM * RHO(n) + (1-SRROM) * RHO(n+1)
+
+srrom = 0.8d0
+
+
+!===============================================================================
+! 4. CONSTANTES PHYSIQUES
+!===============================================================================
+
+! ---> Viscosite laminaire associee au scalaire enthalpie
+! DIFTL0 (diffusivite dynamique en kg/(m s))
+diftl0 = 4.25d-5
+
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/fuel/usfuiv.f90 b/users/fuel/usfuiv.f90
new file mode 100644
index 0000000..0f3d027
--- /dev/null
+++ b/users/fuel/usfuiv.f90
@@ -0,0 +1,395 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usfuiv &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , coefa , coefb , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! INITIALISATION DES VARIABLES DE CALCUL
+! POUR LA PHYSIQUE PARTICULIERE : COMBUSTION FUEL
+! PENDANT DE USINIV.F
+
+! Cette routine est appelee en debut de calcul (suite ou non)
+! avant le debut de la boucle en temps
+
+! Elle permet d'INITIALISER ou de MODIFIER (pour les calculs suite)
+! les variables de calcul (inconnues transportees),
+! la valeur du pas de temps,
+
+! On a repris a titre d'exemple dans cette routine utilisateur
+! l'initialisation choisie par defaut.
+
+
+
+! Les proprietes physiques sont accessibles dans le tableau
+! PROPCE (prop au centre), PROPFA (aux faces internes),
+! PROPFB (prop aux faces de bord)
+! Ainsi,
+! PROPCE(IEL,IPPROC(IROM (IPHAS))) designe ROM (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISCL(IPHAS))) designe VISCL (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(ICP (IPHAS))) designe CP (IEL ,IPHAS)
+! PROPCE(IEL,IPPROC(IVISLS(ISCAL))) designe VISLS (IEL ,ISCAL)
+
+! PROPFA(IFAC,IPPROF(IFLUMA(IVAR ))) designe FLUMAS(IFAC,IVAR)
+
+! PROPFB(IFAC,IPPROB(IROM (IPHAS))) designe ROMB (IFAC,IPHAS)
+! PROPFB(IFAC,IPPROB(IFLUMA(IVAR ))) designe FLUMAB(IFAC,IVAR)
+
+! LA MODIFICATION DES PROPRIETES PHYSIQUES (ROM, VISCL, VISCLS, CP)
+! SE FERA EN STANDARD DANS LE SOUS PROGRAMME PPPHYV
+! ET PAS ICI
+
+! L'identification des cellules concernees peut s'appuyer sur la
+! commande GETCEL.
+
+! GETCEL(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de cellules trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des cellules trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les cellules de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! valeur du pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+
+!===============================================================================
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml), maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel, ige, mode, iphas, icla
+
+double precision t1init, h1init, coefe(ngazem)
+double precision t2init, h2init
+double precision xkent, xeent, d2s3
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. IMPRESSION DE CONTROLE
+!===============================================================================
+
+write(nfecra,9001)
+
+!===============================================================================
+! 1. INITIALISATION VARIABLES LOCALES
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+d2s3 = 2.d0/3.d0
+
+!===============================================================================
+! 2. INITIALISATION DES INCONNUES :
+! UNIQUEMENT SI ON NE FAIT PAS UNE SUITE
+!===============================================================================
+
+if ( isuite.eq.0 ) then
+
+ iphas = 1
+
+! --> Initialisation de k et epsilon (exemple)
+
+ xkent = 1.d-10
+ xeent = 1.d-10
+
+! ---- TURBULENCE
+
+ if (itytur(iphas).eq.2) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (itytur(iphas).eq.3) then
+
+ do iel = 1, ncel
+ rtp(iel,ir11(iphas)) = d2s3*xkent
+ rtp(iel,ir22(iphas)) = d2s3*xkent
+ rtp(iel,ir33(iphas)) = d2s3*xkent
+ rtp(iel,ir12(iphas)) = 0.d0
+ rtp(iel,ir13(iphas)) = 0.d0
+ rtp(iel,ir23(iphas)) = 0.d0
+ rtp(iel,iep(iphas)) = xeent
+ enddo
+
+ elseif (iturb(iphas).eq.50) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iep(iphas)) = xeent
+ rtp(iel,iphi(iphas)) = d2s3
+ rtp(iel,ifb(iphas)) = 0.d0
+ enddo
+
+ elseif (iturb(iphas).eq.60) then
+
+ do iel = 1, ncel
+ rtp(iel,ik(iphas)) = xkent
+ rtp(iel,iomg(iphas)) = xeent/cmu/xkent
+ enddo
+
+ endif
+
+! --> On initialise tout le domaine de calcul avec de l'air a TINITK
+! ================================================
+
+! ---- Calculs de H1INIT et H2INIT
+
+ t1init = t0(iphas)
+ t2init = t0(iphas)
+
+! ------ Variables de transport relatives a la phase solide
+
+ h2init = h02fol + cp2fol*(t2init-trefth)
+
+ do icla = 1, nclafu
+ do iel = 1, ncel
+ rtp(iel,isca(iyfol(icla))) = zero
+ rtp(iel,isca(ing(icla) )) = zero
+ rtp(iel,isca(ihlf(icla))) = h2init
+ enddo
+ enddo
+
+! ------ Variables de transport relatives au melange
+
+ do ige = 1, ngazem
+ coefe(ige) = zero
+ enddo
+ coefe(io2) = wmole(io2) / (wmole(io2)+xsi*wmole(in2))
+ coefe(in2) = 1.d0 - coefe(io2)
+ mode = -1
+ call futhp1 &
+ !==========
+ ( mode , h1init , coefe , t1init )
+
+ do iel = 1, ncel
+ rtp(iel,isca(ihm)) = h1init
+ enddo
+
+! ------ Variables de transport relatives au melange gazeux
+! (scalaires passifs et variances associees)
+
+ do iel = 1, ncel
+ rtp(iel,isca(ifvap )) = zero
+ rtp(iel,isca(ifhtf )) = zero
+ rtp(iel,isca(if4p2m)) = zero
+ if ( ieqco2 .ge. 1 ) then
+ rtp(iel,isca(iyco2)) = zero
+ endif
+ if ( ieqnox .eq. 1 ) then
+ rtp(iel,isca(iyhcn)) = zero
+ rtp(iel,isca(iyno )) = zero
+ rtp(iel,isca(itaire)) = 20.d0+tkelvi
+ endif
+ enddo
+
+endif
+
+
+!----
+! FORMATS
+!----
+
+ 9001 format( &
+' ',/,&
+' usfuiv : Initialisation des variables par l''utilisateur ',/,&
+' ',/)
+
+!----
+! FIN
+!----
+return
+end
diff --git a/users/lagr/uslabo.f90 b/users/lagr/uslabo.f90
new file mode 100644
index 0000000..5a59169
--- /dev/null
+++ b/users/lagr/uslabo.f90
@@ -0,0 +1,1048 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslabo &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ kface , nbpt , isuivi , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , ifrlag , itepa , indep , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , parbor , vitpar , vitflu , auxl , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! SOUS-PROGRAMME UTILISATEUR DE GESTION DU COMPORTEMENT
+! DES PARTICULES A UNE INTERACTION PARTICULE/FRONTIERE
+! ET D'ENREGISTREMENT DES STATISTIQUES AUX FRONTIERES.
+
+! L'UTILISATEUR N'A PAS A MODIFIER LE PRESENT SOUS-PROGRAMME DANS
+! LES CONDITIONS D'UTILISATION STANDARD. DANS LE CAS OU IL
+! SOUHAITE AVOIR DES INTERACTIONS NON PREVU, IL DOIT INTERVENIR
+! DANS LES RUBRIQUES NUMERO 8 et 10.
+
+! Gestion de l'interaction particule/face de frontiere
+! en fonction des informations donnees par l'utilisateur
+! (valeur de IUSCLB par zone) dans la routine USLAG2.
+
+! En fonction du nom stocke dans IUSCLB et affecte
+! a la face de bord KFACE, on donne le type de comportement
+! des particules.
+
+! En standard, on a :
+
+! IUSCLB conditions au bord pour les particules
+! = IENTRL -> zone d'injection de particules
+! = ISORTL -> sortie du domaine
+! = IREBOL -> rebond des particules
+! = IDEPO1 -> deposition definitive
+! = IDEPO2 -> deposition definitive mais la particule reste en
+! memoire (utile si IENSI2 = 1 uniquement)
+! = IDEPO3 -> deposition et remise en suspension possible
+! suivant les condition de l'ecoulement
+! = IENCRL -> encrassement (Charbon uniquement IPHYLA = 2)
+
+
+! De plus, si on souhaite un autre type d'interaction non prevue
+! pour zone de faces de bord, dans USLAG2 on affecte dans
+! IUSCLB(KZONE) un des noms suivants :
+
+! JBORD1, JBORD2, JBORD3, JBORD4, JBORD5
+
+! et dans cette routine on code le comportement
+! des particules pour cette zone frontiere.
+
+! ATTENTION : en debut de routine la variable ISUIVI est
+! initialisee a une valeur aberrante et DOIT etre modifiee
+! avant la fin de la routine.
+! Les vitesses de la particule et du fluide vu doivent etre
+! modifiees en fonction de l'interaction via les tableaux
+! VITPAR et VITFLU, elles NE DOIVENT PAS etre modifiees
+! via ETTP et ETTPA dans ce sous-programme.
+
+! Regle de modification de ISUIVI :
+! =================================
+! 1) Mettre ISUIVI = 0 si la particule ne doit pas etre
+! suivi dans le maillage apres l'interaction de sa trajectoire
+! et de la face de bord (ex : IENTRL, ISORTL, IDEPO1, IDEPO2).
+
+! 2) mettre ISUIVI = 1 pour continuer a suivre la particule
+! dans le maillage apres son interaction (ex : IREBOL, IDEPO3).
+! On peut tres bien avoir ISUIVI = 0 ou ISUIVI = 1 pour un type
+! d'interaction en fonction de comportement de la particule
+! (ex : IENCRL).
+
+! REMARQUE : Lorsqu'il y a interaction, les calculs de la vitesse
+! ^^^^^^^^ de la particule et de la vitesse du fluide vu sont
+! forcement a l'ordre 1 (meme si on est a l'ordre 2
+! par ailleurs).
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndnod ! e ! <-- ! dim. connectivite cellules->faces !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! kface ! e ! <-- ! numero de la face d'interaction !
+! nbpt ! e ! <-- ! numero de la particule traitee !
+! isuivi ! e ! --> ! indicateur de suivi de la particule !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! itrifb(nfabor ! te ! <-- ! tab d'indirection pour tri des faces !
+! nphas) ! ! ! !
+! ifrlag ! te ! <-- ! numero de zone de la face de bord !
+! (nfabor) ! ! ! pour le module lagrangien !
+! itepa ! te ! --> ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! indep ! te ! --> ! pour chaque particule : !
+! (nbpmax) ! ! ! numero de la cellule de depart !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! surfbn(nfabor ! tr ! <-- ! surface des faces de bord !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant et prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! parbor(nfabor ! tr ! <-- ! cumul des statistiques aux frontieres !
+! nvisbr) ! ! ! !
+! vitpar ! tr ! <-- ! vitesse particule pour le traitement !
+! (nbpmax,3) ! ! ! interactions particules/frontieres !
+! vitflu ! tr ! <-- ! vitesse fluide vu pour le traitement !
+! (nbpmax,3) ! ! ! interactions particules/frontieres !
+! auxl(nbpmax,3 ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "cstnum.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer kface , nbpt , isuivi
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer ifrlag(nfabor) , itepa(nbpmax,nivep)
+integer indep(nbpmax)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision surfbn(nfabor)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision parbor(nfabor,nvisbr) , auxl(nbpmax,3)
+double precision vitpar(nbpmax,3) , vitflu(nbpmax,3)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ip , nfin , kzone , n1 , icha, iok
+
+double precision aa
+double precision xp , yp , zp
+double precision xq , yq , zq
+double precision xk , yk , zk
+double precision xpq , ypq , zpq
+double precision xnn , ynn , znn
+double precision vnorl(1) , enc3 , viscp , masse
+double precision dpinit , dp03 , mp0 , trap , vnorm , ang
+double precision energ , energt
+double precision uxn , vyn , wzn
+
+!===============================================================================
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. Traitement en fonction du type de frontiere
+!===============================================================================
+
+iok = 0
+
+!--> numero de la particule traitee
+
+ip = nbpt
+
+!--> Zone de la face de bord a traitee
+
+kzone = ifrlag(kface)
+
+!-->normale normee sortante de la face KFACE
+
+aa = 1.d0 / surfbn(kface)
+xnn = surfbo(1,kface) * aa
+ynn = surfbo(2,kface) * aa
+znn = surfbo(3,kface) * aa
+
+!===============================================================================
+! 2. Recherche du point d'intersection entre la face de bord et
+! le rayon. Les coordonnees sont stockees dans XK YK ZK
+!===============================================================================
+
+! Petit rappel de geometrie 3D :
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+! 1) equation d'un plan de normal (a,b,c) :
+! a*x + b*y + c*z + d = 0
+! 2) equation d'une droite qui passe par P et Q :
+! x = XP + (XQ-XP) * AA
+! y = YP + (YQ-YP) * AA
+! z = ZP + (ZQ-ZP) * AA
+! ou AA est un parametre qui varie dans l'ensemble des reels
+
+!-->on determine le vecteur PQ
+
+xp = ettpa(ip,jxp)
+yp = ettpa(ip,jyp)
+zp = ettpa(ip,jzp)
+
+xq = ettp(ip,jxp)
+yq = ettp(ip,jyp)
+zq = ettp(ip,jzp)
+
+xpq = xq - xp
+ypq = yq - yp
+zpq = zq - zp
+
+!-->si la particule n'a pas bougee ( si elle est deposee
+! sur la face de bord), elle n'est pas traitee.
+
+if (xpq.eq.0.d0 .and. ypq.eq.0.d0 .and. zpq.eq.0.d0) return
+
+!-->a partir de l'equation du plan de la face et de l'equation
+! parametre du rayon, on determine le parametre du point d'intersection
+
+aa = xpq * surfbo(1,kface) &
+ + ypq * surfbo(2,kface) &
+ + zpq * surfbo(3,kface)
+
+if ( aa.eq.0.d0 ) then
+ write (nfecra,9010) ip
+ nbperr = nbperr + 1
+ dnbper = dnbper + tepa(ip,jrpoi)
+ isuivi = 0
+ itepa(ip,jisor) = 0
+ return
+endif
+
+aa = &
+ ( surfbo(1,kface) * cdgfbo(1,kface) &
+ + surfbo(2,kface) * cdgfbo(2,kface) &
+ + surfbo(3,kface) * cdgfbo(3,kface) &
+ - surfbo(1,kface) * xp &
+ - surfbo(2,kface) * yp &
+ - surfbo(3,kface) * zp ) &
+ / aa
+
+!-->on reporte ce parametre dans l'equation de la droite du rayon pour
+! avoir le point d'intersection (XK YK ZK)
+
+xk = xp + xpq * aa
+yk = yp + ypq * aa
+zk = zp + zpq * aa
+
+!===============================================================================
+! 3. Depart de la particule du domaine de calcul,
+! ou deposition de la particule sur la frontiere
+!===============================================================================
+
+if ( iusclb(kzone).eq.isortl .or. &
+ iusclb(kzone).eq.ientrl .or. &
+ iusclb(kzone).eq.idepo1 ) then
+
+ isuivi = 0
+ itepa(ip,jisor) = 0
+
+! mise a jour du debit
+
+ deblag(kzone) = deblag(kzone)-tepa(ip,jrpoi)*ettp(ip,jmp)
+
+!--> La particule sort mais pour la visualisation ensight, on la place
+! correctement au point d'intersection.
+! Possibilite que le numero IP soit reutilise pour une autre
+! particule a entrer.
+
+ ettp(ip,jxp) = xk
+ ettp(ip,jyp) = yk
+ ettp(ip,jzp) = zk
+
+!===============================================================================
+! 4. Deposition de la particule, celle-ci reste en memoire
+!===============================================================================
+
+else if (iusclb(kzone).eq.idepo2) then
+
+!--> La particule ne sort pas, elle n'est plus traitee,
+! mais toujours visualisee. Le numero IP n'est pas reutilisable.
+
+ isuivi = 0
+ itepa(ip,jisor) = -itepa(ip,jisor)
+ ettp(ip,jxp) = xk
+ ettp(ip,jyp) = yk
+ ettp(ip,jzp) = zk
+
+ do n1 = 1,3
+ vitpar(ip,n1) = 0.d0
+ vitflu(ip,n1) = 0.d0
+ enddo
+
+!===============================================================================
+! 5. Deposition de la particule, la remise en suspension est possible
+!===============================================================================
+
+else if (iusclb(kzone).eq.idepo3) then
+
+ isuivi = 0
+ itepa(ip,jisor) = ifabor(kface)
+ ettp(ip,jxp) = xk
+ ettp(ip,jyp) = yk
+ ettp(ip,jzp) = zk
+
+ do n1 = 1,3
+ vitpar(ip,n1) = 0.d0
+ vitflu(ip,n1) = 0.d0
+ enddo
+ do n1 = jup,jwf
+ ettpa(ip,n1) = 0.d0
+ enddo
+
+!===============================================================================
+! 6. Deposition de la particule avec force d'attachement,
+! vitesse conservee et re-entrainement possible
+!===============================================================================
+
+else if (iusclb(kzone).eq.idepfa) then
+
+
+! Calcul du critere
+
+ uxn = ettp(ip,jup)*xnn
+ vyn = ettp(ip,jvp)*ynn
+ wzn = ettp(ip,jwp)*znn
+
+ energ = 0.5d0*ettp(ip,jmp)*(uxn*uxn+vyn*vyn+wzn*wzn)
+
+ energt = 3.34d-12*ettp(ip,jdp)
+
+ if ( energ .ge. energt )then
+
+ isuivi = 0
+ itepa(ip,jisor) = ifabor(kface)
+ ettp(ip,jxp) = xk
+ ettp(ip,jyp) = yk
+ ettp(ip,jzp) = zk
+
+ vitpar(ip,1) = 0.d0
+ vitpar(ip,2) = 0.d0
+ vitpar(ip,3) = 0.d0
+
+ vitflu(ip,1) = 0.d0
+ vitflu(ip,2) = 0.d0
+ vitflu(ip,3) = 0.d0
+
+ else
+
+ isuivi = 0
+ itepa(ip,jisor) = indep(ip)
+ ettp(ip,jxp) = ettpa(ip,jxp)
+ ettp(ip,jyp) = ettpa(ip,jyp)
+ ettp(ip,jzp) = ettpa(ip,jzp)
+
+!-->changement de la vitesse de la particule au point d'arrive
+! (comme pour une rebond elastique)
+
+ aa = abs(( vitpar(ip,1)*xnn &
+ +vitpar(ip,2)*ynn &
+ +vitpar(ip,3)*znn) )*2.d0
+
+ vitpar(ip,1) = vitpar(ip,1) - aa*xnn
+ vitpar(ip,2) = vitpar(ip,2) - aa*ynn
+ vitpar(ip,3) = vitpar(ip,3) - aa*znn
+
+!-->Annule la vitesse du fluide vu au point d'arrive
+! (comme pour une rebond elastique)
+
+ aa = abs( (vitflu(ip,1)*xnn &
+ + vitflu(ip,2)*ynn &
+ + vitflu(ip,3)*znn) ) * 2.d0
+
+ vitflu(ip,1) = 0.d0
+ vitflu(ip,2) = 0.d0
+ vitflu(ip,3) = 0.d0
+ endif
+
+!===============================================================================
+! 7. Rebond elastique de la particule sur la frontiere
+!===============================================================================
+
+else if (iusclb(kzone).eq.irebol) then
+
+ isuivi = 1
+ itepa(ip,jisor) = ifabor(kface)
+
+!-->changement du point de depart
+
+ ettpa(ip,jxp) = xk
+ ettpa(ip,jyp) = yk
+ ettpa(ip,jzp) = zk
+
+ if (iensi1.eq.1) then
+ nfin = 0
+ call enslag &
+ !==========
+ ( idebia, idebra , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , ip , &
+ itepa , &
+ ettpa , tepa , ra)
+ endif
+
+!-->changement du point d'arrive
+! (la valeur absolue est pour eviter les p. scalaires
+! negatifs impossibles qui interviennent avec des erreurs d'arrondi
+! machines)
+
+ aa = 2.d0 * abs( (xq-xk)*xnn + (yq-yk)*ynn + (zq-zk)*znn )
+
+ ettp(ip,jxp) = xq - aa*xnn
+ ettp(ip,jyp) = yq - aa*ynn
+ ettp(ip,jzp) = zq - aa*znn
+
+!-->changement de la vitesse de la particule au point d'arrive
+
+
+ aa = abs( (vitpar(ip,1)*xnn &
+ + vitpar(ip,2)*ynn &
+ + vitpar(ip,3)*znn) ) * 2.d0
+
+ vitpar(ip,1) = vitpar(ip,1) - aa*xnn
+ vitpar(ip,2) = vitpar(ip,2) - aa*ynn
+ vitpar(ip,3) = vitpar(ip,3) - aa*znn
+
+!-->changement de la vitesse du fluide vu au point d'arrive
+
+ aa = abs( (vitflu(ip,1)*xnn &
+ + vitflu(ip,2)*ynn &
+ + vitflu(ip,3)*znn) ) * 2.d0
+
+ vitflu(ip,1) = vitflu(ip,1) - aa*xnn
+ vitflu(ip,2) = vitflu(ip,2) - aa*ynn
+ vitflu(ip,3) = vitflu(ip,3) - aa*znn
+
+!===============================================================================
+! 8. Encrassement des grains de charbon
+!===============================================================================
+
+else if (iusclb(kzone).eq.iencrl) then
+
+!--> Encrassement de la particules si ses proprietes le permettent
+! et en fonction d'une probabilite
+! ICI c'est si Tp > TPENC
+! si VISCP > VISCREF
+
+ icha = itepa(ip,jinch)
+
+ if ( ettp(ip,jhp).gt.tprenc(icha) ) then
+
+ enc3 = ( (1.d+7 * enc1(icha))/((ettp(ip,jhp)-150.d0)**2) ) &
+ + enc2(icha)
+ viscp = exp( log(10.d0)*enc3 ) * 0.1d0
+
+ if ( viscp.gt.visref(icha) ) then
+ n1 = 1
+ call zufall(n1,vnorl(1))
+ trap = 1.d0-visref(icha) / viscp
+ endif
+
+! Si VISCP <= VISREF ===> 100% de chance d'encrasser
+! Si VISCP > VISREF ===> probabilte TRAP = 1-VISREF/VISCP
+! d'encrasser
+! ===> On encrasse si VNORL est compris
+! entre TRAP et 1.
+
+ if ( viscp.le.visref(icha) .or. &
+ (viscp.gt.visref(icha) .and. vnorl(1).ge.trap) ) then
+
+! La calcul de la masse de grains de charbon encrasses est faite plus bas.
+
+ npencr = npencr + 1
+ isuivi = 0
+ itepa(ip,jisor) = 0
+ ettp(ip,jxp) = xk
+ ettp(ip,jyp) = yk
+ ettp(ip,jzp) = zk
+
+ endif
+ endif
+
+!--> Si pas encrassement alors rebond elastique
+
+ if ( itepa(ip,jisor).ne.0 ) then
+
+ isuivi = 1
+ itepa(ip,jisor) = ifabor(kface)
+
+!-->changement du point de depart
+
+ ettpa(ip,jxp) = xk
+ ettpa(ip,jyp) = yk
+ ettpa(ip,jzp) = zk
+
+ if (iensi1.eq.1) then
+ nfin = 0
+ call enslag &
+ !==========
+ ( idebia, idebra , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nfin , ip , &
+ itepa , &
+ ettpa , tepa , ra)
+ endif
+
+!-->changement du point d'arrive
+
+ aa = 2.d0 * abs((xq-xk)*xnn + (yq-yk)*ynn + (zq-zk)*znn)
+
+ ettp(ip,jxp) = xq - aa*xnn
+ ettp(ip,jyp) = yq - aa*ynn
+ ettp(ip,jzp) = zq - aa*znn
+
+ endif
+
+ if (itepa(ip,jisor).gt.0) then
+
+!-->changement de la vitesse de la particule au point d'arrive
+
+
+ aa = abs( (vitpar(ip,1)*xnn &
+ + vitpar(ip,2)*ynn &
+ + vitpar(ip,3)*znn) ) * 2.d0
+
+ vitpar(ip,1) = vitpar(ip,1) - aa*xnn
+ vitpar(ip,2) = vitpar(ip,2) - aa*ynn
+ vitpar(ip,3) = vitpar(ip,3) - aa*znn
+
+!-->changement de la vitesse du fluide vu au point d'arrive
+
+ aa = abs( (vitflu(ip,1)*xnn &
+ + vitflu(ip,2)*ynn &
+ + vitflu(ip,3)*znn) ) * 2.d0
+
+ vitflu(ip,1) = vitflu(ip,1) - aa*xnn
+ vitflu(ip,2) = vitflu(ip,2) - aa*ynn
+ vitflu(ip,3) = vitflu(ip,3) - aa*znn
+
+ endif
+
+!===============================================================================
+! 9. Interaction utilisateur numero 1 : JBORD1
+!===============================================================================
+
+! ON PEUT FAIRE DE MEME AVEC JBORD2, JBORD3, JBORD4 et JBORD5
+! On ne donnne l'exemple que pour JBORD1
+
+! On regarde si on est dans la zone cherchee
+! ELSE IF (IUSCLB(KZONE).EQ.JBORD1) THEN
+
+! si on doit continuer a suivre la particule
+! ISUIVI = 0 OU 1
+
+! l'element de maillage concerne
+! ITEPA(IP,JISOR) =
+
+! on change la localisation de depart de la particule
+! ETTP(IP,JXP) =
+! ETTP(IP,JYP) =
+! ETTP(IP,JZP) =
+
+! la vitesse de la particule au point d'arrivee
+! VITPAR(IP,1) =
+! VITPAR(IP,2) =
+! VITPAR(IP,3) =
+
+! la vitesse du fluide vu au point d'arrivee
+! VITFLU(IP,1) =
+! VITFLU(IP,2) =
+! VITFLU(IP,3) =
+
+
+else if (iusclb(kzone).eq.jbord1 &
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+! en standard, sans intervention de l'utilisateur,
+! on ne souhaite pas passer ici
+! mais on desire
+! que le test IUSCLB(KZONE).EQ.JBORD1 soit dans le us* exemple
+! que le source ci-dessous soit compile pour verifier
+! qu'il n y a pas d'erreur
+ .and.(0.eq.1) &
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+ ) then
+
+! ----------------------------------------------------
+! EXEMPLE 1 : LA PARTICULE A UNE CHANCE SUR DEUX (TRAP)
+! DE SE DEPOSER DEFINITIVEMENT A LA PAROI
+! OU DE REBONDIR VERS L'ECOULEMENT.
+! ----------------------------------------------------
+
+
+ n1 = 1
+ call zufall(n1,vnorl(1))
+ trap = 0.5d0
+
+ if (vnorl(1).ge.trap) then
+
+ isuivi = 0
+ itepa(ip,jisor) = 0
+ ettp(ip,jxp) = xk
+ ettp(ip,jyp) = yk
+ ettp(ip,jzp) = zk
+
+ else
+
+ isuivi = 1
+ itepa(ip,jisor) = ifabor(kface)
+
+!-->changement du point de depart
+
+ ettpa(ip,jxp) = xk
+ ettpa(ip,jyp) = yk
+ ettpa(ip,jzp) = zk
+
+!-->changement du point d'arrive
+
+ aa = 2.d0 * abs((xq-xk)*xnn + (yq-yk)*ynn + (zq-zk)*znn)
+
+ ettp(ip,jxp) = xq - aa*xnn
+ ettp(ip,jyp) = yq - aa*ynn
+ ettp(ip,jzp) = zq - aa*znn
+
+ endif
+
+!-->Inutile de traiter les particule ITEPA(IP,JISOR)=0 car
+! Elle vont etre eliminees de la listes des particules.
+
+ if (itepa(ip,jisor).gt.0) then
+
+!-->changement de la vitesse de la particule au point d'arrive
+
+
+ aa = abs( (vitpar(ip,1)*xnn &
+ + vitpar(ip,2)*ynn &
+ + vitpar(ip,3)*znn) ) * 2.d0
+
+ vitpar(ip,1) = vitpar(ip,1) - aa*xnn
+ vitpar(ip,2) = vitpar(ip,2) - aa*ynn
+ vitpar(ip,3) = vitpar(ip,3) - aa*znn
+
+!-->changement de la vitesse du fluide vu au point d'arrive
+
+ aa = abs( (vitflu(ip,1)*xnn &
+ + vitflu(ip,2)*ynn &
+ + vitflu(ip,3)*znn) ) * 2.d0
+
+ vitflu(ip,1) = vitflu(ip,1) - aa*xnn
+ vitflu(ip,2) = vitflu(ip,2) - aa*ynn
+ vitflu(ip,3) = vitflu(ip,3) - aa*znn
+
+ endif
+
+
+!===============================================================================
+! 10. Verification et sortie si erreur
+!===============================================================================
+
+else
+ write (nfecra,9020) kzone
+ iok = iok + 1
+endif
+
+if (iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+!===============================================================================
+! 11. Enregistrement de l'interaction particule-frontiere s'il y a lieu
+!===============================================================================
+
+! L'enregistrement des statistiques parietales debute des que
+! l'indicateur est a IENSI3 = 1. Cependant tant que le numero
+! de l'iteration Lagrangienne absolue est inferieur a NSTBOR,
+! ou que l'ecoulement est instationnaire (ISTTIO = 0), alors
+! le tableau PARBOR est remis a zero avant d'entrer dans ce
+! sous-programme.
+
+! NPSTF : nombre d'iterations de calcul de stat aux frontieres
+! stationnaires
+
+! NPSTFT : nombre d'iterations total des stats iaux frontieres
+! depuis le du calcul, partie instationnaire comprise
+! (a utiliser que pour les affichages listing)
+
+! TSTATP : Temps physique d'enregistrement des statistiques
+! des interactions particules/frontiere stationnaires,
+! si instatinnaire alors contient DTP le dernier
+! pas de temps Lagrangien
+
+! Avant impression dans le listing, ou sortie pour le
+! post-processing, on applique aux statistiques sur les frontieres
+! une moyenne en fonction des infos fournies dans USLAG1 de la
+! maniere suivante :
+
+
+
+! CES LIGNES NE SONT DONNEES QU'A TITRE INDICATIF
+
+
+! DO IVAR = 1,NVISBR
+
+! IF (IMOYBR(IVAR).EQ.2) THEN
+
+! DO IFAC = 1,NFABOR
+! IF (PARBOR(IFAC,INBR).GT.SEUILF) THEN
+! PARBOR(IFAC,IVAR) = PARBOR(IFAC,IVAR) /PARBOR(IFAC,INBR)
+! ELSE
+! PARBOR(IFAC,IVAR) = 0.D0
+! ENDIF
+! ENDDO
+
+! ELSE IF (IMOYBR(IVAR).EQ.1) THEN
+
+! DO IFAC = 1,NFABOR
+! IF (PARBOR(IFAC,INBR).GT.SEUILF) THEN
+! PARBOR(IFAC,IVAR) = PARBOR(IFAC,IVAR) / TSTATP
+! ELSE
+! PARBOR(IFAC,IVAR) = 0.D0
+! ENDIF
+! ENDDO
+! ENDIF
+! ENDDO
+
+
+
+
+if ( iensi3.eq.1 ) then
+
+!--> exemple de types d'interaction sur lesquels on souhaite
+! enregistrer des informations
+
+ if ( iusclb(kzone).eq.irebol .or. &
+ iusclb(kzone).eq.idepo1 .or. &
+ iusclb(kzone).eq.idepo2 .or. &
+ iusclb(kzone).eq.idepo3 ) then
+
+ if (inbrbd.eq.1) then
+ parbor(kface,inbr) = parbor(kface,inbr) + tepa(ip,jrpoi)
+ endif
+
+ if (iflmbd.eq.1) then
+ parbor(kface,iflm) = parbor(kface,iflm) &
+ + ( tepa(ip,jrpoi) * ettp(ip,jmp) /surfbn(kface) )
+ endif
+
+ if (iangbd.eq.1) then
+ vnorm = ettp(ip,jup) * ettp(ip,jup) &
+ + ettp(ip,jvp) * ettp(ip,jvp) &
+ + ettp(ip,jwp) * ettp(ip,jwp)
+ vnorm = sqrt( vnorm )
+ ang = ettp(ip,jup) * surfbo(1,kface) &
+ + ettp(ip,jvp) * surfbo(2,kface) &
+ + ettp(ip,jwp) * surfbo(3,kface) &
+ / surfbn(kface) &
+ / vnorm
+ ang = acos(ang)
+ parbor(kface,iang) = parbor(kface,iang) + ang*tepa(ip,jrpoi)
+ endif
+
+ if (ivitbd.eq.1) then
+ vnorm = ettp(ip,jup) * ettp(ip,jup) &
+ + ettp(ip,jvp) * ettp(ip,jvp) &
+ + ettp(ip,jwp) * ettp(ip,jwp)
+ vnorm = sqrt( vnorm )
+ parbor(kface,ivit) =parbor(kface,ivit) +vnorm*tepa(ip,jrpoi)
+ endif
+
+ if (nusbor.gt.0) then
+ do n1 = 1,nusbor
+ parbor(kface,iusb(n1)) = 0.d0
+ enddo
+ endif
+
+!--> Cas particulier de la masse de grains de charbon encrasses
+
+ else if ( iusclb(kzone).eq.iencrl .and. isuivi.eq.0 ) then
+
+ parbor(kface,inbr) = parbor(kface,inbr) + tepa(ip,jrpoi)
+
+ if (iencbd.eq.1) then
+
+ icha = itepa(ip,jinch)
+ dpinit = tepa(ip,jrd0p)
+
+ dp03 = dpinit * dpinit * dpinit
+ mp0 = pi * dp03 * rho0ch(icha) / 6.d0
+
+ masse = ettp(ip,jmch) + ettp(ip,jmck) &
+ + xashch(icha) * mp0
+
+ parbor(kface,ienc) = parbor(kface,ienc) &
+ + tepa(ip,jrpoi)*masse
+
+ endif
+
+ endif
+
+endif
+
+
+!===============================================================================
+! Archives. Je laisse cette partie au cas ou...
+! Creation d'un repere local associe a la face frontiere
+!===============================================================================
+
+! Le repere local (T1,T2,N) est construit de facon a ce que N soit
+! la normale normee de la face et que T1 et T2 appartiennent a la face
+
+!-->1. Je connais les vecteurs N et PK, je definis T1 tel que
+! T1 = PK vectoriel N
+
+! XPK = XK - ETTPA(IP,JXP)
+! YPK = YK - ETTPA(IP,JYP)
+! ZPK = ZK - ETTPA(IP,JZP)
+
+! XT1 = YPK*ZNN - ZPK*YNN
+! YT1 = ZPK*XNN - XPK*ZNN
+! ZT1 = XPK*YNN - YPK*XNN
+
+! AA = SQRT(XT1*XT1 + YT1*YT1 + ZT1*ZT1)
+! XT1 = XT1 / AA
+! YT1 = YT1 / AA
+! ZT1 = ZT1 / AA
+
+!-->2. Maintenant je peux construire T2 = - T1 vectoriel N
+
+! XT2 = YT1*ZNN - ZT1*YNN
+! YT2 = ZT1*XNN - XT1*ZNN
+! ZT2 = XT1*YNN - YT1*XNN
+
+! AA = SQRT(XT2*XT2 + YT2*YT2 + ZT2*ZT2)
+! XT2 = -XT2 / AA
+! YT2 = -YT2 / AA
+! ZT2 = -ZT2 / AA
+
+!--------
+! FORMATS
+!--------
+
+ 9010 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (USLABO) ',/,&
+'@ ',/,&
+'@ La normale d''une face de frontiere est perpendiculaire ',/,&
+'@ a un rayon PQ : impossible ',/,&
+'@ ',/,&
+'@ La particle ',I10,' est ELIMINEE ',/,&
+'@ ',/,&
+'@ Contacter l''equipe de developpement. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 9020 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''EXECUTION DU MODULE LAGRANGIEN ',/,&
+'@ ========= (USLABO) ',/,&
+'@ ',/,&
+'@ Le type de condition aux limites IUSCLB ',/,&
+'@ n''est pas renseigne pour la frontiere NB = ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne peut etre execute. ',/,&
+'@ ',/,&
+'@ Verifier USLAG2 et USLABO. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/lagr/usladp.f90 b/users/lagr/usladp.f90
new file mode 100644
index 0000000..d1878b1
--- /dev/null
+++ b/users/lagr/usladp.f90
@@ -0,0 +1,298 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usladp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , &
+ taup , tlag , piil , &
+ vagaus , gradpr , gradvf , &
+ romp , &
+ dppar , dnxpar , dnypar , dnzpar , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! POUR CHAQUE PARTICULE :
+! - CALCUL DE LA DISTANCE A LA PAROI
+! - CALCUL DE LA NORMALE A LA PAROI
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! --> ! si nordre=2, contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! piil(nbpmax,3 ! tr ! <-- ! terme dans l'integration des eds up !
+! tsup(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse des particules !
+! tsuf(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse du fluide vu !
+! bx(nbpmax,3,2 ! tr ! <-- ! caracteristiques de la turbulence !
+! tsfext(nbpmax ! tr ! <-- ! infos pour le couplage retour !
+! vagaus ! tr ! <-- ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! gradpr(ncel,3 ! tr ! <-- ! gradient de pression !
+! gradvf(ncel,3 ! tr ! <-- ! gradient de la vitesse du fluide !
+! romp ! tr ! --- ! masse volumique des particules !
+! fextla ! tr ! --> ! champ de forces exterieur !
+!(ncelet,3) ! ! ! utilisateur (m/s2) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp),ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,*)
+double precision taup(nbpmax) , tlag(nbpmax,3)
+double precision piil(nbpmax,3)
+double precision vagaus(nbpmax,*)
+double precision dppar(nbpart) , dnxpar(nbpart)
+double precision dnypar(nbpart) , dnzpar(nbpart)
+
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision romp(nbpmax)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ip
+
+! VARIABLES LOCALES UTILISATEUR
+
+double precision xnorm
+
+!===============================================================================
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. EXEMPLE
+!===============================================================================
+
+! Cet exemple est desactive
+
+if (1.eq.0) then
+
+ do ip = 1,nbpart
+
+! Comme exemple on prend pour toutes les particules
+! Distance a la paroi : le rayon
+! Nomale : suivant le rayon en supposant
+! la conduite suivant Z
+! Attention on prend la convention Saturne,
+! la normale est oriente du fluide vers l'exterieur
+
+
+ dppar(ip) = 0.00631942286d0 &
+ -sqrt( ettp(ip,jxp)*ettp(ip,jxp) &
+ +ettp(ip,jyp)*ettp(ip,jyp) )
+
+ xnorm = sqrt( ettp(ip,jxp)*ettp(ip,jxp) &
+ +ettp(ip,jyp)*ettp(ip,jyp) )
+ dnxpar(ip) = ettp(ip,jxp)/xnorm
+ dnypar(ip) = ettp(ip,jyp)/xnorm
+ dnzpar(ip) = 0.d0
+
+ enddo
+
+!==============================================================================
+! CONTROLE : NE PAS MODIFIER
+!==============================================================================
+
+ do ip = 1,nbpart
+
+ if ( dppar(ip) .le. dparmn ) then
+ dppar(ip) = dparmn-dparmn/100.d0
+ endif
+
+ enddo
+
+endif
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/lagr/uslaed.f90 b/users/lagr/uslaed.f90
new file mode 100644
index 0000000..cba1eb2
--- /dev/null
+++ b/users/lagr/uslaed.f90
@@ -0,0 +1,337 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslaed &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , tsvar , &
+ auxl1 , auxl2 , auxl3 , w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! INTEGRATION DES EDS POUR LES VARIABLES UTILISATEUR
+! PAR DEFAUT LES VARIABLES SONT CONSTANTES
+
+
+! d T T - PIP
+! LES EDS DOIVENT ETRE DE LA FORME : ----- = - ---------
+! d t Tca
+
+
+! T : IIIIeme VARIABLE UTILISATEUR QUI EST REPEREE POUR LA
+! PARTICULE IP PAR :
+! T = ETTP(IP,JVLS(IIII))
+! T = ETTPA(IP,JVLS(IIII))
+
+! Tca : TEMPS CARACTERISTIQUE DE L'EDS
+! A DONNER DANS LE TABLEAU AUXL1
+
+! PIP : COEFFICIENT DE L'EDS ("PSEUDO SECOND MEMBRE")
+! A DONNER DANS LE TABLEAU AUXL2
+
+! SI LE SCHEMA CHOISI EST D'ORDRE 1 (NORDRE=1)
+! ALORS AU 1ER ET SEUL PASSAGE PIP S'EXPRIME
+! EN FONCTION DE DES GRANDEURS DU PAS DE TEMPS
+! PRECEDENT ETTPA
+
+! SI LE SCHEMA CHOISI EST D'ORDRE 2 (NORDRE=2)
+! ALORS AU 1ER PASSAGE (NOR=1) PIP S'EXPRIME
+! EN FONCTION DE DES GRANDEURS DU PAS DE TEMPS
+! PRECEDENT ETTPA, ET AU 2E PASSAGE (NOR=2)
+! PIP S'EXPRIME EN FONCTION DE DES GRANDEURS
+! DU PAS DE TEMPS COURANT ETTP
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! <-- ! contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique et !
+! (nbpmax,2) ! ! ! ts implicite de couplage retour !
+! tsvar ! tr ! <-- ! prediction 1er sous-pas pour la !
+! (nbpmax,nvp1) ! ! ! variable ivar, utilise pour la !
+! ! ! ! correction au 2eme sous-pas !
+! auxl1(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl2(nbpmax) ! tr ! --- ! tableau de travail !
+! auxl3(nbpmax) ! tr ! --- ! tableau de travail !
+! w1..w3(ncelet ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstphy.h"
+include "cstnum.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision tsvar(nbpmax,nvp1)
+double precision auxl1(nbpmax), auxl2(nbpmax), auxl3(nbpmax)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer npt , iel , iiii , ipl , iphas
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+! On ne rentre en effet dans ce sous programme que si on a defini des
+! variables supplementaires dans uslag1 ; il faut donc necessairement
+! dire comment on les resout (non?).
+
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS LE MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uslaed DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Des variables supplementaires ont ete declarees dans ',/,&
+'@ uslag1 (NVLS=) ',/,&
+'@ Le sous-programme uslaed doit etre complete pour preciser ',/,&
+'@ l''equation differentielle stochastique a resoudre. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+! FIXME : TODO ecrire un exemple utilisateur
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+iphas = ilphas
+
+!===============================================================================
+! 2. TEMPS CARACTERISTIQUE DE L'EDS COURANTE
+!===============================================================================
+
+! Boucle sur les variables supplementaires
+
+do iiii = 1,nvls
+
+! Numero dans ETTP de la variable traitee
+
+ ipl = jvls(iiii)
+
+ do npt = 1,nbpart
+
+ if ( itepa(npt,jisor).gt.0 ) then
+
+ iel = itepa(npt,jisor)
+
+! Temps caracteristique Tca de l'equation differentielle
+! Cet exemple doit etre adapte au cas traite
+
+ auxl1(npt) = 1.d0
+
+! Prediction au premier sous pas
+! Cet exemple doit etre adapte au cas traite
+
+ if (nor.eq.1) then
+ auxl2(npt) = ettpa(npt,ipl)
+ else
+
+! Correction au deuxieme sous pas
+! Cet exemple doit etre adapte au cas traite
+
+ auxl2(npt) = ettp(npt,ipl)
+ endif
+
+ endif
+ enddo
+
+!===============================================================================
+! 3. INTEGRATION DE LA VARIABLE IPL
+!===============================================================================
+
+ call lagitg &
+ !==========
+ ( nbpmax , nvp , nvp1 , nvep , nivep , &
+ ipl , &
+ itepa(1,jisor) , ibord , &
+ ettp , ettpa , auxl1 , auxl2 , tsvar )
+
+enddo
+
+!===============================================================================
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/lagr/uslaen.f90 b/users/lagr/uslaen.f90
new file mode 100644
index 0000000..051fd6b
--- /dev/null
+++ b/users/lagr/uslaen.f90
@@ -0,0 +1,427 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslaen &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivarl , ivarl1 , ivarlm , iflu , ilpd1 , icla , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , stativ , tracel , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! --------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! POUR LES ECRITURES LISTING ET LE POST-PROCESSING :
+! MOYENNE DES VARIABLES STATISTIQUES VOLUMIQUES LAGRANGIENNES
+! INTERVENTIONS UTILISATEUR POSSIBLES
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nvlsta ! e ! <-- ! nombre de variables stat. lagrangien !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ivarl ! e ! <-- ! num de la stat (entre 1 et nvlsta) !
+! ivarl1 ! e ! <-- ! num de la stat globale+groupe !
+! ! ! ! (moyenne ou variance) !
+! ivarlm ! e ! <-- ! num de la moyenne stat globale+groupe !
+! iflu ! e ! <-- ! 0 : moyenne de la stat ivarl/ivarl1 !
+! ! ! ! 1 : variance de la stat ivarl/ivarl1 !
+! ilpd1 ! e ! <-- ! "pointeur" sur le poids stat globale !
+! ! ! ! ou sur le poids stat d'un groupe !
+! icla ! e ! <-- ! 0 : statistique globale !
+ ! ! <-- ! !=0 : statistique pour le groupe icla !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! statis(ncelet ! tr ! <-- ! cumul des statistiques volumiques !
+! nvlsta) ! ! ! !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! tracel(ncelet ! tr ! <-- ! tab reel valeurs cellules post !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! rtuser(nrtuse ! tr ! <-- ! tableau des statistques sur les !
+! ! ! ! particules !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "pointe.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "entsor.h"
+include "cstnum.h"
+include "lagpar.h"
+include "lagran.h"
+include "parall.h"
+include "period.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas , nvlsta
+integer nideve , nrdeve , nituse , nrtuse
+integer ivarl , ivarl1 , ivarlm , iflu , ilpd1 , icla
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision tracel(ncelet)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , iel
+double precision aa
+
+!===============================================================================
+!===============================================================================
+! 0. PAR DEFAUT, ON CONSIDERE QUE LE SOUS PROGRAMME CI-DESSOUS CONVIENT
+! A L'UTILISATEUR, C'EST-A-DIRE QUE LA MISE EN OEUVRE DU LAGRANGIEN
+! DECLENCHE LA PRODUCTION DE STATISTIQUES STANDARD.
+
+! L'UTILISATEUR N'A PAS A MODIFIER LE PRESENT SOUS-PROGRAMME DANS
+! LES CONDITIONS D'UTILISATION STANDARD.
+! DANS LE CAS OU IL SOUHAITE SORTIR DES STATISTIQUES NON PREVUES,
+! IL DOIT INTERVENIR DANS LA RUBRIQUE NUMERO 2.
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1 . ZONE DE STATISTIQUES STANDARD
+!===============================================================================
+
+!--> Cas general :
+! Vitesse X des particules : IVARL=ILVX
+! Vitesse Y des particules : IVARL=ILVY
+! Vitesse Z des particules : IVARL=ILVZ
+! Temperature des particules : IVARL=ILTP
+! Diametre des particules : IVARL=ILDP
+! Masse des particules : IVARL=ILMP
+! Temperature des grains de charbon : IVARL=ILHP
+! Masse de Charbon reactif des grains de charbon : IVARL=ILMCH
+! Masse de Coke des grains de charbon : IVARL=ILMCK
+! Diametre du coeur retrecissant des grains de charbon: IVARL=ILMCK
+! sauf fraction volumique (IVARL = ILFV) et
+! somme des poids statistiques (IVARL = ILPD)
+
+
+if (ivarl.ne.ilfv .and. ivarl.ne.ilpd) then
+
+
+!-----> Moyenne
+
+
+ if (iflu.eq.0) then
+
+ do iel = 1, ncel
+ if (statis(iel,ilpd1).gt.seuil ) then
+ tracel(iel) = statis(iel,ivarl1) / statis(iel,ilpd1)
+ else
+ tracel(iel) = zero
+ endif
+ enddo
+
+!-----> Variance
+
+ else
+
+ do iel = 1, ncel
+ if ( statis(iel,ilpd1).gt.seuil ) then
+ aa = statis(iel,ivarlm)/statis(iel,ilpd1)
+ tracel(iel) = stativ(iel,ivarl1)/statis(iel,ilpd1) &
+ -( aa * aa )
+ tracel(iel) = sqrt( max(zero,tracel(iel)))
+ else
+ tracel(iel) = zero
+ endif
+ enddo
+
+ endif
+
+!--> Fraction volumique (ILFV)
+
+else if (ivarl.eq.ilfv) then
+
+!-----> Moyenne
+
+ if (iflu.eq.0) then
+
+ do iel = 1, ncel
+ if (statis(iel,ilpd1).gt.seuil .and. npst.gt.0) then
+ tracel(iel) = statis(iel,ilfv) &
+ / (dble(npst) * volume(iel))
+ else if (statis(iel,ilpd1).gt.seuil .and. &
+ iplas.ge.idstnt ) then
+ tracel(iel) = statis(iel,ilfv) / volume(iel)
+ else
+ tracel(iel) = zero
+ endif
+ enddo
+
+ else
+
+!-----> Variance
+
+ do iel = 1, ncel
+
+ if (statis(iel,ilpd1).gt.seuil .and. npst.gt.0) then
+
+ aa = statis(iel,ivarlm) / (dble(npst) * volume(iel))
+ tracel(iel) = stativ(iel,ivarl1) &
+ / ( dble(npst) * volume(iel) * volume(iel)) &
+ - aa*aa
+ tracel(iel) = sqrt( max(zero,tracel(iel)) )
+
+ else if ( statis(iel,ilpd1).gt.seuil .and. &
+ iplas.ge.idstnt ) then
+
+ aa = statis(iel,ivarlm) / volume(iel)
+ tracel(iel) = stativ(iel,ivarl1) / volume(iel) &
+ - aa*aa
+ tracel(iel) = sqrt( max(zero,tracel(iel)))
+
+ else
+ tracel(iel) = zero
+ endif
+
+ enddo
+ endif
+
+!--> Somme des poids statistiques
+
+else if (ivarl.eq.ilpd) then
+
+ if (iflu .eq.0) then
+ do iel = 1, ncel
+ tracel(iel) = statis(iel,ivarl1)
+ enddo
+ else
+ write(nfecra,9000) iflu
+ do iel = 1, ncel
+ tracel(iel) = zero
+ enddo
+ endif
+
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ERREUR DANS LE MODULE LAGRANGIEN (USLAEN) ',/,&
+'@ ========= ',/,&
+'@ IL N''EST PAS POSSIBLE DE CALCULER LA VARIANCE DU POIDS ',/,&
+'@ STATISTIQUE ',/,&
+'@ ',/,&
+'@ La variance du poids statistique a ete demande ',/,&
+'@ dans USLAEN (IVARL=', I10,' et IFLU=', I10,'). ',/,&
+'@ ',/,&
+'@ L''appel au sous-programme USLAEN doit etre verifie. ',/,&
+'@ ',/,&
+'@ Le calcul continue. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! 2. ZONE D'INTERVENTION UTILISATEUR
+!===============================================================================
+
+! --------------------------------------------------
+! EXEMPLE 1 : STATISTIQUE CALCULEE DANS USLAST.F ET
+! STOCKEE DANS LE TABLEAU STATIS
+! --------------------------------------------------
+
+ if (nvlsts.gt.0) then
+
+ if (ivarl.eq.ilvu(1)) then
+
+!-----> Moyenne pour la concentration massique
+
+ if (iflu.eq.0) then
+
+ do iel = 1, ncel
+ if ( statis(iel,ilpd1).gt.seuil .and. npst.gt.0 ) then
+ tracel(iel) = statis(iel,ivarl1) &
+ / ( dble(npst) *ro0(ilphas) *volume(iel) )
+ else if ( statis(iel,ilpd1).gt.seuil .and. &
+ iplas.ge.idstnt ) then
+ tracel(iel) = statis(iel,ivarl1) &
+ / ( ro0(ilphas) *volume(iel) )
+ else
+ tracel(iel) = zero
+ endif
+ enddo
+
+ else
+
+!-----> Variance de la concentration massique
+
+ do iel = 1, ncel
+ if (statis(iel,ilpd1).gt.seuil) then
+ aa = statis(iel,ivarlm)/statis(iel,ilpd1)
+ tracel(iel) = stativ(iel,ivarl1)/statis(iel,ilpd1) &
+ -( aa * aa)
+ tracel(iel) = sqrt( max(zero,tracel(iel)))
+ else
+ tracel(iel) = zero
+ endif
+
+ enddo
+
+ endif
+
+ endif
+
+ endif
+
+!===============================================================================
+
+
+end
diff --git a/users/lagr/uslafe.f90 b/users/lagr/uslafe.f90
new file mode 100644
index 0000000..09b7faf
--- /dev/null
+++ b/users/lagr/uslafe.f90
@@ -0,0 +1,279 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslafe &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , ibord , idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , statis , stativ , &
+ taup , tlag , piil , &
+ tsuf , tsup , bx , tsfext , &
+ vagaus , gradpr , gradvf , &
+ romp , fextla , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! PRISE EN COMPTE SUR LES PARTICULES D'UN CHAMP DE FORCES
+! EXTERIEUR
+! IL DOIT ETRE DONNE EN CHAQUE CELLULE ET ETRE HOMOGENE
+! A LA GRAVITE (M/S2)
+
+! PAR DEFAUT LES PARTICULES SONT SOUMISES UNIQUEMENT A LA FORCE
+! DE TRAINEE ET A LA GRAVITE (DE VALEUR GX GY GZ DONNEES DANS
+! USINI1)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! ibord ! te ! --> ! si nordre=2, contient le numero de la !
+! (nbpmax) ! ! ! face d'interaction part/frontiere !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! piil(nbpmax,3 ! tr ! <-- ! terme dans l'integration des eds up !
+! tsup(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse des particules !
+! tsuf(nbpmax,3 ! tr ! <-- ! prediction 1er sous-pas pour !
+! ! ! ! la vitesse du fluide vu !
+! bx(nbpmax,3,2 ! tr ! <-- ! caracteristiques de la turbulence !
+! tsfext(nbpmax ! tr ! <-- ! infos pour le couplage retour !
+! vagaus ! tr ! <-- ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! gradpr(ncel,3 ! tr ! <-- ! gradient de pression !
+! gradvf(ncel,3 ! tr ! <-- ! gradient de la vitesse du fluide !
+! romp ! tr ! --- ! masse volumique des particules !
+! fextla ! tr ! --> ! champ de forces exterieur !
+!(ncelet,3) ! ! ! utilisateur (m/s2) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer itepa(nbpmax,nivep) , ibord(nbpmax)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision statis(ncelet,*),stativ(ncelet,*)
+double precision taup(nbpmax) , tlag(nbpmax,3)
+double precision piil(nbpmax,3) , bx(nbpmax,3,2)
+double precision tsuf(nbpmax,3) , tsup(nbpmax,3)
+double precision tsfext(nbpmax)
+double precision vagaus(nbpmax,*)
+double precision gradpr(ncelet,3) , gradvf(ncelet,9)
+double precision romp(nbpmax)
+double precision fextla(nbpmax,3)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ip
+
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. EXEMPLE
+!===============================================================================
+
+! Cet exemple est desactive
+
+if (1.eq.0) then
+
+
+ do ip = 1,nbpart
+
+ fextla(ip,1) = 0.d0
+ fextla(ip,2) = 0.d0
+ fextla(ip,3) = 0.d0
+
+ enddo
+
+
+endif
+
+!==============================================================================
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/lagr/uslag1.f90 b/users/lagr/uslag1.f90
new file mode 100644
index 0000000..fbd3d21
--- /dev/null
+++ b/users/lagr/uslag1.f90
@@ -0,0 +1,1084 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslag1
+!================
+
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION OBLIGATOIRE)
+
+! ROUTINE UTILISATEUR D'INITIALISATION DE CERTAINS PARAMETRES
+! DU MODULE LAGRANGIEN. ILS CONCERNENT LES MODELES PHYSIQUES,
+! NUMERIQUES, ET LES OPTIONS DE POSTPROCESSING.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "entsor.h"
+include "lagdim.h"
+include "lagpar.h"
+include "lagran.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! VARIABLES LOCALES
+
+integer ii , ipv , icha
+double precision sio2 , al2o3 , fe2o3 , cao
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if (iihmpr.eq.1) then
+ return
+else
+ iilagr = 0
+ return
+endif
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. ENCLENCHEMENT ET TYPE D'UTILISATION MODULE LAGRANGIEN
+!===============================================================================
+
+! IILAGR = 0 : PAS DE CALCUL LAGRANGIEN (PAR DEFAUT)
+
+! = 1 : DIPHASIQUE LAGRANGIEN SANS COUPLAGE RETOUR
+
+! = 2 : DIPHASIQUE LAGRANGIEN AVEC COUPLAGE RETOUR
+! ATTENTION, LE COUPLAGE RETOUR N'EST PRIS EN
+! COMPTE QUE POUR LA PHASE CONTINUE NUMERO 1
+! (on peut choisir de coupler la dynamique,
+! la thermique et la masse independamment)
+
+! = 3 : DIPHASIQUE LAGRANGIEN SUR CHAMPS FIGES
+! (cette option necessite une suite de calcul de la
+! phase continue ISUITE = 1 ; les champs figes sont
+! la totalite des champs euleriens, cette option
+! n'est donc pas redondante avec celle du mot-cle
+! ICCVFG qui permet un calul sur champs de
+! vitesse et turbulents figes ; lorsque IILAGR = 3,
+! on impose automatiquement ICCVFG = 1)
+
+iilagr = 1
+
+!===============================================================================
+! 2. SUITES LAGRANGIENNES
+!===============================================================================
+
+! ISUILA = 0 : PAS DE SUITE LAGRANGIENNE (PAR DEFAUT)
+! = 1 : SUITE LAGRANGIENNE
+! (cette option necessite une suite de calcul de la
+! phase continue ISUITE = 1)
+
+isuila = 0
+
+! SUITE DE CALCUL SUR DES STATISTIQUES VOLUMIQUES ET AUX FRONTIERES,
+! AINSI QUE LES TERMES SOURCES DE COUPLAGE RETOUR
+! (UTILE SI ISUILA = 1)
+! (DEFAUT NON : 0 ; OUI : 1)
+
+if (isuila.eq.1) isuist = 0
+
+!===============================================================================
+! 3. MODELES PHYSIQUES LIES AUX PARTICULES
+!===============================================================================
+
+! IPHYLA = 0 : PUREMENT DYNAMIQUE (PAR DEFAUT)
+! = 1 : EQUATIONS SUR Temperature (en degres Celsius),
+! Diametre et Masse
+! = 2 : CHARBON (Les particules sont des grains de
+! charbon pulverise. Cette option n'est disponible que
+! si la phase porteuse represente une flamme de charbon
+! pulverise.)
+
+iphyla = 0
+
+
+! 3.1 OPTION POUR EQUATION SUR TP, DP et MP (UNIQUEMENT SI IPHYLA = 1)
+
+
+if (iphyla.eq.1) then
+
+! EQUATION SUR LE DIAMETRE
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ idpvar = 0
+
+! EQUATION SUR LA TEMPERATURE
+! (DEFAUT NON : 0 ; OUI : 1)
+! Cette option impose l'existance d'une variable thermique
+! sur la phase continue (physique paticuliere ou non).
+! La variable resolue est la temperature en degres Celsius.
+
+ itpvar = 0
+
+! EQUATION SUR LA MASSE
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ impvar = 0
+
+endif
+
+! * Dans le cas ou une equation sur la temperature des particules
+! est enclenchee entre deux suites de calcul (IPHYLA= 1 et ITPVAR= 1)
+! il faut fournir une temperature (en degres Celsius) et une
+! chaleur massique (J/kg/K) d'initialisation des particules
+! deja presentes dans le domaine de calcul.
+
+if (isuila.eq.1 .and. iphyla.eq.1 .and. itpvar.eq.1) then
+ tpart = 700.d0
+ cppart = 5200.d0
+endif
+
+! 3.2 OPTIONS POUR l'ENCRASSEMENT (CHARBON UNIQUEMENT i.e. IPHYLA = 2)
+
+
+! RAPPORTS EDF/R&D DE REFERENCE : HI-81/00/030/A
+! HI-81/01/033/A
+
+! D'une maniere generale, un calcul d'encrassement est effectue
+! en deux etapes : 1) on realise un calcul "classique" de chaudiere
+! a charbon pulverise par une approche homogene ; 2) on fait un
+! calcul Lagrangien de grains de charbon sur les champs
+! figes du calcul precedent. L'option d'encrassement est donc
+! utilise en "post-processing" sur un calcul charbon pulverise
+! homogene.
+
+
+! On utilise la probabilite qu'une particule a la temperature Tp
+! colle sur sa surface d'impact. Cette probabilite est le rapport
+! d'une viscosite critique sur la viscosite des cendres.
+
+! VISREF
+! P(Tp) = -------- pour VISCEN >= VISREF
+! VISCEN
+
+! = 1 sinon
+
+! Pour evaluer la viscosite des cendres VISCEN, on utilise
+! l'expression de J.D. Watt et T.Fereday (J.Inst.Fuel-Vol42-p99)
+
+! ENC1 * 1.0D+7
+! Log (10*VISCEN) = --------------- + ENC2
+! 10 2
+! (Tp(�C) - 150)
+
+! La viscosite critique VISREF est donn�e par la litterature et
+! peut varier entre 8 Pa.set 1.D7 Pa.s !
+! En general on prend 1.0D+4 Pa.s...
+
+
+
+if (iphyla.eq.2) then
+
+! IENCRA = 0 pas d'encrassement (PAR DEFAUT)
+! = 1 encrassement
+
+! * Il faut preciser les frontieres du domaine sur lesquelles
+! les grains de charbon peuvent s'encrasser (voir USLAG2).
+! * Le traitement de l'encrassement se deroule dans USLABO.
+! * Pour visualiser la cartographie de la masse de particules
+! encrassees, il faut que IENSI3 = 1 et que IENCBD = 1
+! (voir la rubrique 10.2 du present sous-programme).
+
+ iencra = 0
+
+! DEFINITION DES CRITERES D'ENCRASSEMENT POUR LES DIFFERENTS CHARBONS
+! ATTENTION A BIEN LES DEFINIR POUR CHACUN DES NCHARB CHARBONS INJECTES
+! ======
+
+! Premier charbon ICHA = 1
+
+ icha = 1
+
+! TPRENC : TEMPERATURE SEUIL EN DESSOUS DE LAQUELLE LES GRAINS
+! DE CHARBON NE S'ENCRASSENT PAS (en degres Celsius)
+
+ tprenc(icha) = 600.d0
+
+! VISREF : VISCOSITE CRITIQUE (en Pa.s)
+
+ visref(icha) = 10000.d0
+
+! > Exemple de composition de charbon en matieres minerales :
+! (avec SiO2 + Al2O3 + Fe2O3 + CaO + MgO = 100% en masse)
+
+ sio2 = 36.0d0
+ al2o3 = 20.8d0
+ fe2o3 = 4.9d0
+ cao = 13.3d0
+
+! ENC1 et ENC2 : COEFFICIENTS DE L'EXPRESSION DE Watt et Fereday
+
+ enc1(icha) = 0.00835d0 * sio2 + 0.00601d0 * al2o3 - 0.109d0
+
+ enc2(icha) = 0.0415d0 * sio2 + 0.0192d0 * al2o3 &
+ + 0.0276d0 * fe2o3 + 0.016 * cao - 3.92d0
+
+endif
+
+!===============================================================================
+! 4. NOMBRE DE PARTICULES DU DOMAINE
+!===============================================================================
+
+! NOMBRE DE PARTICULES MAXIMAL AUTORISE DANS LE DOMAINE
+! (PAR DEFAUT : NBPMAX = 1000)
+! * Attention, la m�moire est r�serv�e en cons�quence, et le nombre
+! max de particules traitees au cours d'une iteration Lagrangienne
+! est limite a NBPMAX.
+! * L'ordre de grandeur de NBPMAX doit etre evalue au mieux lors
+! d'injection a frequence non nulle en tenant compte :
+! - de la quantite de particules injectees (nombre par classe ou
+! en fonction du debit massique)
+! - de nombre de particules clonees ou detruites par la
+! technique de reduction de variance (IROULE = 1 ou IROULE =2)
+
+nbpmax = 1000
+
+!===============================================================================
+! 5. OPTIONS SUR LE TRAITEMENT DE LA PHASE DISPERSEE
+!===============================================================================
+
+
+! 5.1 VARIABLES SUPPLEMENTAIRES LIEES AUX PARTICULES
+! --------------------------------------------------
+
+! * ces variables supplementaires sont stokees dans les tableaux
+! ETTP et ETTPA,
+! * on renseigne ici le nombre NVLS de variables supplementaires,
+! * la limite superieure de ce nombre est NUSVAR = 10
+! (fixee dans lagpar.h),
+! * on accede aux variables supplementaires dans ETTP et ETTPA
+! en utilisant le pointeur JVLS de la maniere suivante :
+
+! etape courante -> ETTP(NBPT,JVLS(NVUS))
+! etape precedente -> ETTPA(NBPT,JVLS(NVUS))
+
+! NBPT est le numero de la particule traitee
+! (entier compris entre 1 et NBPART),
+! NVUS est le numero de la variable supplementaire
+! (entier compris entre 1 et NVLS),
+! * l'integration des Equations Differentielles Stochastiques
+! associees a ces nouvelles variables necessite une intervention
+! dans le sous-programme utilisateur USLAED.
+
+
+nvls = 0
+
+
+! 5.2 CARACTERE STATIONNAIRE DE L'ECOULEMENT DE LA PHASE CONTINUE
+
+
+! * si calcul stationnaire : ISTTIO = 1
+! * si calcul instationnaire : ISTTIO = 0
+! * Lorsque les champs de la phase porteuse sont figes (IILAGR = 3)
+! l'indicateur est force en stationnaire (ISTTIO = 1), sinon
+! l'utilisateur doit le renseigner en prenant en compte la nature
+! de l'ecoulement de la phase continue.
+
+! REMARQUE : si ISTTIO = 0, les moyennes statistiques calculees
+! sont REMISE A ZERO a chaque iteration Lagrangienne.
+
+if (iilagr.ne.3) isttio = 0
+
+
+! 5.3 COUPLAGE RETOUR : INFLUENCE DE LA PHASE DISPERSEE SUR LA PHASE
+! CONTINUE (UTILE UNIQUEMENT SI IILAGR = 2)
+! ATTENTION : LE COUPLAGE RETOUR N'EST PRIS EN COMPTE QUE POUR
+! LA PHASE CONTINUE NUMERO 1
+
+
+if (iilagr.eq.2) then
+
+! * Nombre d'iterations Lagrangiennes absolues (i.e. suites comprises)
+! a partir duquel une moyenne en temps des termes sources de
+! couplage retour est calculee.
+! * Utile si CALCUL STATIONNAIRE, i.e. si ISTTIO = 1.
+! * Si le nombre d'iterations Lagrangiennes absolues est strictement
+! inferieur a NSTITS, les termes sources transmis sont
+! instationnaires (i.e. ils sont REMIS A ZERO a chaque iteration
+! Lagrangienne).
+! * La valeur minimale admissible pour NSTITS est 1.
+
+ nstits = 1
+
+! COUPLAGE RETOUR SUR LA DYNAMIQUE (Vitesse + Turbulence)
+! (DEFAUT NON : 0 ; OUI : 1)
+! (UTILE UNIQUEMENT SI ICCVFG = 0)
+
+ ltsdyn = 0
+
+! COUPLAGE RETOUR SUR LA MASSE (SI IPHYLA = 1 ET IMPVAR = 1)
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ if(iphyla.eq.1 .and. (impvar.eq.1 .or. idpvar.eq.1)) ltsmas = 0
+
+! COUPLAGE RETOUR SUR LA THERMIQUE (SI IPHYLA = 1 ET ITPVAR = 1) OU
+! LES VARIABLES CHARBON (SI IPHYLA = 2)
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ if((iphyla.eq.1 .and. itpvar.eq.1) .or. iphyla.eq.2) ltsthe = 0
+
+endif
+
+
+! 5.4 CALCUL DES STATISTIQUES VOLUMIQUES
+! --------------------------------------
+
+! 5.4.1 PARAMETRES GENERAUX
+! ~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! CALCUL DES STATISTIQUES VOLUMIQUES
+! (DEFAUT NON : 0 ; OUI : 1)
+
+istala = 0
+
+
+if (istala.eq.1) then
+
+! SEUIL POUR LA PRISE EN COMPTE DES STATISTIQUES VOLUMIQUES
+! * La valeur de SEUIL est un poids statistique.
+! * Chaque cellule du maillage contient une certaine
+! quantite de particules en terme de poids statistique
+! (somme des poids statistiques de toutes les particules
+! contenues dans la cellule) ;
+! SEUIL est la valeur minimale a partir de laquelle la
+! contribution en poids statistique d'une cellule n'est
+! plus prise en compte dans le modele complet de dispersion
+! turbulente, dans la resolution de l'equation de poisson
+! de correction des vitesses moyennes, et dans les sorties
+! listing et post-processing
+! (DEFAUT : SEUIL = 0.D0)
+
+ seuil = 0.d0
+
+! CALCUL DES STATISTIQUES VOLUMIQUES A PARTIR DE L'ITERATION
+! LAGRANGIENNE ABSOLUE
+! * IDSTNT est un nombre d'iterations Lagrangiennes absolues
+! (i.e. suites comprises).
+! (DEFAUT : IDSTNT = 1)
+
+ idstnt = 1
+
+! CALCUL STATIONNAIRE DES STATISTIQUES VOLUMIQUES A PARTIR DE
+! L'ITERATION LAGRANGIENNE ABSOLUE NSTIST
+! * NSTIST est un nombre d'iterations Lagrangiennes absolues
+! (i.e. suites comprises) a partir du quel les statistiques sont
+! moyennees en temps.
+! * Utile si CALCUL STATIONNAIRE, i.e. si ISTTIO = 1.
+! * Si le nombre d'iterations Lagrangiennes absolues est strictement
+! inferieur a NSTIST, les statistiques sont instationnaires
+! (i.e. elles sont REMISES A ZERO a chaque iteration
+! Lagrangienne).
+! (DEFAUT : NSTIST = IDSTNT)
+
+ nstist = idstnt
+
+
+! 5.4.2 NOMBRE DE VARIABLES STATISTIQUES VOLUMIQUES,
+! NOM DES VARIABLES POUR AFFICHAGE
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! NOMLAG : nom de la moyenne
+! NOMLAV : nom de la variance
+! IHSLAG : sortie des enregistrements sur les capteurs definis
+! dans USINI1
+
+! * ATTENTION : respecter l'ordre d'apparition des statistiques.
+
+! * Attention ces noms sont utlises pour retrouver les informations
+! dans le fichier suite de calcul ; donc si un nom est modifie
+! entre deux calculs, la statistique concernee est perdue.
+
+! * A priori, l'utilisateur n'intervient que dans les rubriques 4) et 6)
+
+! 1) Par defaut, statistiques TOUJOURS calculees :
+! Moyenne et variance des composantes de la vitesse
+! Moyenne et variance du taux de presence
+! (i .e. concentration volumique)
+! Moyenne et variance du temps de s�jour
+
+ ipv = 1
+ NOMLAG(IPV) = 'MoVitPtX'
+ NOMLAV(IPV) = 'VaVitPtX'
+ ihslag(ipv) = 2
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoVitPtY'
+ NOMLAV(IPV) = 'VaVitPtY'
+ ihslag(ipv) = 2
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoVitPtZ'
+ NOMLAV(IPV) = 'VaVitPtZ'
+ ihslag(ipv) = 2
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoTauVol'
+ NOMLAV(IPV) = 'VaTauVol'
+ ihslag(ipv) = 2
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoTpsSej'
+ NOMLAV(IPV) = 'VaTpsSej'
+ ihslag(ipv) = 2
+
+! 2) Physiques pariculieres (IPHYLA = 1) suivant les options choisies:
+! Moyenne et variance de la temperature
+! Moyenne et variance du diametre
+! Moyenne et variance de la masse
+
+ if (iphyla.eq.1) then
+
+ if (itpvar.eq.1) then
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoTempPt'
+ NOMLAV(IPV) = 'VaTempPt'
+ ihslag(ipv) = 2
+ endif
+ if (idpvar.eq.1) then
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoDiamPt'
+ NOMLAV(IPV) = 'VaDiamPt'
+ ihslag(ipv) = 2
+ endif
+ if (impvar.eq.1) then
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoMassPt'
+ NOMLAV(IPV) = 'VaMassPt'
+ ihslag(ipv) = 2
+ endif
+
+ else if (iphyla.eq.2) then
+
+! 3) Charbon pulverise (IPHYLA = 2) :
+! Moyenne et variance de la temperature
+! Moyenne et variance de la masse de charbon reactif
+! Moyenne et variance de la masse de coke
+! Moyenne et variance du diametre du coeur retrecissant
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoTempPt'
+ NOMLAV(IPV) = 'VaTempPt'
+ ihslag(ipv) = 2
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoMchPt'
+ NOMLAV(IPV) = 'VaMchPt'
+ ihslag(ipv) = 2
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoMcokPt'
+ NOMLAV(IPV) = 'VaMcokPt'
+ ihslag(ipv) = 2
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'MoDckPt'
+ NOMLAV(IPV) = 'VaDckPt'
+ ihslag(ipv) = 2
+
+ endif
+
+! 4) VARIABLES STATISTIQUES VOLUMIQUES SUPPLEMENTAIRES :
+! * Si l'utilisateur souhaite des calculs de statistiques
+! autres que ceux fournis en standard, il doit
+! 1) donner leur nombre NVLSTS, 2) renseigner leur nom,
+! 3) renseigner IHSLAG
+! et 4) intervenir dans les sous-programmes utilisateur
+! USLAST.F et USLAEN.F pour programmer ses nouvelles
+! statistiques (voir les exemples).
+! * Nombre maximal de statistiques supplementaires : 20
+! (sinon changer le parametre NUSSTA dans l'include lagpar.h)
+
+ nvlsts = 0
+
+ if (nvlsts.gt.0) then
+ do ii = 1,nvlsts
+ ilvu(ii) = ipv + ii
+ WRITE(NOMLAG(ILVU(II)),'(A6,I4.4)') 'MoyLag',II
+ WRITE(NOMLAV(ILVU(II)),'(A6,I4.4)') 'VarLag',II
+ ihslag(ilvu(ii)) = 1
+ enddo
+ ipv = ipv + nvlsts
+ endif
+
+! 5) Par defaut, statistique TOUJOURS calculee :
+! Somme du poids statistiques associ� aux particules
+! (i .e. nombre de particules par cellules)
+
+ ipv = ipv + 1
+ NOMLAG(IPV) = 'SomPoids'
+ ihslag(ipv) = 1
+
+! 6) STATISTIQUES PAR GROUPE :
+! * Si l'utilisateur souhaite des calculs de statistiques
+! par groupe de particule (par defaut aucune statistique par groupe),
+! il doit :
+! 1) donner NBCLST le nombre de groupe (limite a 100)
+! 2) preciser dans USLAG2 le groupe auquel appartient chaque particule
+! a l'aide du tableau IUSLAG
+
+! * ATTENTION : NBCLST ne peut pas etre change lors d'une suite de
+! calcul (ISUILA=1) meme si le calcul des statistiques n'est pas
+! encore enclenche (ISTALA=0)
+
+ nbclst = 0
+
+endif
+
+
+!===============================================================================
+! 6. OPTIONS SUR L'ENTREE DES PARTICULES
+!===============================================================================
+
+! INJECTION EN CONTINUE DES PARTICLES PENDANT LE PAS DE TEMPS
+! (ET PAS UNIQUEMENT AU DEBUT DU PAS DE TEMPS, CETTE OPTION
+! EVITE LES PAQUETS DE PARTICULES EN FACE LES ZONES D'INJECTION)
+! (DEFAUT NON : 0 ; OUI : 1)
+
+injcon = 0
+
+
+!===============================================================================
+! 7. TECHNIQUE DE REDUCTION DE VARIANCE : CLONAGE/FUSION DES PARTICULES
+!===============================================================================
+
+! UTILISATION DE LA ROULETTE RUSSE
+! DEFAUT NON : 0
+! OUI : 1 sans calcul de Y+
+! 2 avec calcul de Y+
+iroule = 0
+
+
+!===============================================================================
+! 8. OPTIONS SUR LE TRAITEMENT NUMERIQUE DE LA PHASE DISPERSEE
+!===============================================================================
+
+! ORDRE D'INTEGRATION DES EQUATIONS DIFFERENTIELLES STOCHASTIQUES
+! PAR DEFAUT 2 (VALEURS ADMISSIBLES : 1 OU 2)
+
+! NORDRE = 1 : INTEGRATION DES EDS PAR UN SCHEMA D'ORDRE 1
+! NORDRE = 2 : INTEGRATION DES EDS PAR UN SCHEMA D'ORDRE 2
+
+nordre = 2
+
+
+! RESOLUTION DE L'EQUATION DE POISSON POUR LES VITESSE MOYENNES
+! DES PARTICULES ET CORRECTION DES VITESSES INSTANTANNEES
+! DES PARTICULES
+! = 0 : pas de correction des vitesses (VALEUR PAR DEFAUT)
+! = 1 : correction des vitesses instantanees
+
+! ATTENTION : OPTION STRICTEMENT DEVELOPPEUR, LAISSEZ LA VALEUR PAR
+! ========= DEFAUT !
+
+ilapoi = 0
+
+
+!===============================================================================
+! 9. OPTIONS SUR LE TRAITEMENT DE LA DISPERSION TURBULENTE
+!===============================================================================
+
+! ATTENTION : DANS CETTE VERSION, LA DISPERSION TURBULENTE NE
+! ^^^^^^^^^^ FONCTIONNE QUE SI LA PHASE CONTINUE EST CALCULEE
+! AVEC UN MODELE k-eps OU Rij-eps
+
+
+!--> PRISE EN COMPTE DE LA DISPERSION TURBULENTE
+! (DEFAUT OUI : 1 ; NON : 0)
+
+idistu = 1
+
+
+!--> DISPERSION TURBULENTE IMPOSEE A CELLE DU FLUIDE
+
+! SI ACTIF, ALORS LA DISPERSION TURBULENTE DES PARTICULES EST CELLE
+! DES PARTICULES FLUIDES. ON SE PLACE DONC DANS UN CAS DE DIFFUSION
+! TURBULENTE (ON SUPRIME LES EFFETS DE CROISEMENT DE
+! TRAJECTOIRES). SI LES PARTICULES SIMULEES ONT LA MASSE
+! VOLUMIQUE DU FLUIDE ALORS, ON SIMULE LE DEPLACEMENT DE
+! PARTICULES FLUIDES LAGRANGIENNES.
+! (DEFAUT NON : 0 ; OUI : 1)
+
+idiffl = 0
+
+! MODCPL :
+! = 0 pour le modele incomplet (VALEUR PAR DEFAUT)
+! > 0 pour le modele complet, est egal au numero de l'iteration
+! Lagrangienne absolue (i.e. suites comprises) a partir de
+! laquelle mise le modele complet est active
+! MODCPL ne doit pas etre inferieur a IDSTNT
+
+modcpl = 0
+
+! IDIRLA =1 ou 2 ou 3 : 1ere, 2eme ou 3eme direction
+! du modele complet. Correspond � la direction principale
+! de l'�coulement. Permet de calculer un echelle de temps
+! Lagrangienne non isotrope.
+! (DEFAUT IDIRLA = 1)
+
+if (modcpl.gt.0) idirla = 1
+
+
+!===============================================================================
+! 10. OPTIONS SUR LE TRAITEMENT DES FORCES PARTICULIERES
+!===============================================================================
+
+!--> ACTIVATION DES FORCES :
+
+! - de Van der Waals
+! - Electrostatiques
+
+! (DEFAUT NON : 0 ; OUI : 1)
+
+! ATTENTION : OPTION DEVELOPPEUR UNIQUEMENT
+! =========
+
+ladlvo = 0
+
+!--> Constante pour les forces de Van der Waals
+
+! Constante d'Hamaker Particule/Eau/substrat :
+
+cstham = 6.d-20
+
+!--> Constante pour les forces Electrostatiques
+
+! Constante de Faradet (C/mol)
+
+cstfar = 9.648d4
+
+! Constante dielectrique du vide :
+
+epsvid = 8.854d-12
+
+! Constante dielectrique de l'eau
+
+epseau = 80.10d0
+
+! Potentiel solide 1 (Volt)
+
+phi1 = 50.d-3
+
+! Potentiel solide 2 (Volt)
+
+phi2 = -50.d-3
+
+! FORCE IONIQUE (mol/l)
+
+fion = 1.d-2
+
+! DISTANCE DE COUPURE
+! dans la litterature elle est egale � : 1.58D-10
+! ou 1.65D-10
+
+dcoup = 1.58d-10
+
+! DENSITE DE CHARGE
+
+sigch = 0.d0
+
+! Distance minimum entre la particule et la paroi
+
+dparmn = 1.d-10
+
+
+!===============================================================================
+! 11. ACTIVATION DU MOUVEMENT BROWNIEN
+!===============================================================================
+
+
+!--> ACTIVATION DU MOUVEMENT BROWNIEN :
+
+! (DEFAUT NON : 0 ; OUI : 1)
+
+! ATTENTION : OPTION DEVELOPPEUR UNIQUEMENT
+! =========
+
+lamvbr = 0
+
+
+!===============================================================================
+! 12. POST-PROCESSING
+!===============================================================================
+
+! 12.1 POST-PROCESSING DES TRAJECTOIRES ET DEPLACEMENTS PARTICULAIRES
+
+
+! ATTENTION : COUTEUX EN TEMPS DE CALCUL
+! ^^^^^^^^^^
+
+! 12.1.1 PARAMETRES GENERAUX
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! MODE TRAJECTOIRES
+! (DEFAUT NON : 0 ; OUI : 1)
+
+iensi1 = 0
+
+! MODE DEPLACEMENTS PARTICULAIRES
+! (DEFAUT NON : 0 ; OUI : 1)
+
+iensi2 = 0
+
+
+! NOMBRE DE PARTICULES A VISUALISER MAXIMUM=NLISTE
+! (PAR DEFAUT NBVIS = NLISTE)
+! ATTENTION : NBVIS NE DOIT NI ETRE SUPERIEUR A NBPMAX
+! NI A NLISTE (parametre fixe a 500 dans lagpar.h)
+
+nbvis = nliste
+
+! PERIODE D'AQUISITION DES DONNEES A VISUALISER
+! (PAR DEFAUT NVISLA = 1)
+
+nvisla = 1
+
+! LISTE contient les numeros des particules que l'on souhaite
+! visualiser
+! (PAR DEFAUT LISTE(...) = -1, AUCUNE PARTICULE A VISUALISER)
+! ATTENTION : si le numero est negatif, il n'y a pas de visualisation.
+
+! > EXEMPLE 1 :
+! je veux voir les NBVIS 1eres
+
+do ii = 1, nbvis
+ liste(ii) = ii
+enddo
+
+! > EXEMPLE 2 :
+! je veux voir la 3 5 67 23 1 76 35 36 ...etc..
+
+! LISTE(1) = 3
+! LISTE(2) = 5
+! LISTE(3) = 67
+! LISTE(4) = 23
+! LISTE(5) = 1
+! LISTE(6) = 76
+! LISTE(7) = 35
+! LISTE(8) = 36
+! ...etc...
+
+! > REMARQUE : les trous, les repetitions dans le tableau LISTE seront
+! suprimes, et les numeros seront ranges par ordre
+! croissant.
+
+! 12.1.2 VARIABLES A VISUALISER SUR LES TRAJECTOIRES OU LES PARTICULES
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! VARIABLE : VITESSE DU FLUIDE VU
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ivisv1 = 0
+
+! VARIABLE : VITESSE DE LA PARTICULE
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ivisv2 = 0
+
+! VARIABLE : TEMPS DE SEJOUR
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ivistp = 0
+
+! VARIABLE : DIAMETRE
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ivisdm = 0
+
+! VARIABLE : TEMPERATURE
+! (DEFAUT NON : 0 ; OUI : 1)
+if (iphyla.eq.1 .and. itpvar.eq.1) iviste = 0
+
+! VARIABLE : MASSE
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ivismp = 0
+
+
+if (iphyla.eq.2) then
+
+! VARIABLE CHARBON : TEMPERATURE EN DEGRES CELSIUS
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ ivishp = 0
+
+! VARIABLE CHARBON : DIAMETRE DU COEUR RETRECISSANT
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ ivisdk = 0
+
+! VARIABLE CHARBON : MASSE DE CHARBON REACTIF
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ ivisch = 0
+
+! VARIABLE CHARBON : MASSE DE COKE
+! (DEFAUT NON : 0 ; OUI : 1)
+
+ ivisck = 0
+
+endif
+
+
+! 12.2 STATISTIQUES AUX FRONTIERES : VISUALISATION DES
+! INTERACTIONS PARTICULES/FRONTIERES
+! ------------------------------------------------
+
+! 12.2.1 PARAMETRES GENERAUX
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! MODE INTERACTION PARTICULES/FRONTIERES
+! (DEFAUT NON : 0 ; OUI : 1)
+
+iensi3 = 0
+
+! CALCUL STATIONNAIRE DES STATISTIQUES AUX FRONTIERES A PARTIR DE
+! L'ITERATION LAGRANGIENNE ABSOLUE NSTBOR
+! * NSTBOR est un nombre d'iterations Lagrangiennes absolues
+! (i.e. suites comprises) a partir duquel les statistiques sont
+! moyennees (en temps ou par nombre d'interactions).
+! * Utile si CALCUL STATIONNAIRE, i.e. si ISTTIO = 1.
+! * Si le nombre d'iterations Lagrangiennes absolues est strictement
+! inferieur a NSTBOR, les statistiques sont instationnaires
+! (i.e. elles sont REMISES A ZERO a chaque iteration
+! Lagrangienne).
+! * La valeur minimale admissible pour NSTBOR est 1.
+! (DEFAUT : NSTBOR = 1)
+
+nstbor = 1
+
+! SEUILF POUR LA PRISE EN COMPTE DES STATISTIQUES AUX FRONTIERES
+! * La valeur de SEUILF est un poids statistique.
+! * Chaque face du maillage a subi un certain nombre d'interactions
+! avec des particules en terme de poids statistique
+! (somme des poids statistiques de toutes les particules
+! qui ont interagi avec la face de bord) ;
+! SEUILF est la valeur minimale a partir de laquelle la
+! contribution en terme statistique d'une face n'est
+! plus prise en compte dans les sorties listing
+! et post-processing.
+! (DEFAUT : SEUILF = 0.D0)
+
+seuilf = 0.d0
+
+
+! 12.2.2 INFORMATIONS A ENREGISTRER
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! * Un certain nombre d'informations succeptibles d'interesser
+! l'utilisateur sont d'ores et deja ecrites dans le sous-programme
+! USLABO. Pour les activer il faut mettre le mot-cle correspondant
+! a 1 ci-dessous.
+! * La selection des types d'interaction (IREBOL, IDEPO1,... voir
+! le sous-programme USLAG2) qu'enclenchent l'enregistrement
+! des informations est faite dans USLABO. La selection par defaut
+! doit etre validee ou modifiee par l'utilisateur.
+! * Par defaut, dans un meme enregistrement, on place les informations
+! demandees pour toutes les interactions particules/frontieres
+! selectionnees. Modifier ce comportement necessite une
+! intervention dans le sous-programme utilisateur USLABO.
+! * La statistique aux frontieres :
+! "NOMBRE D'INTERACTIONS PARTICULES/FRONTIERES" doit etre
+! selectionnee obligatoirement pour utiliser la moyenne
+! particulaire IMOYBR(...) = 2.
+
+
+! NOMBRE D'INTERACTIONS PARTICULES/FRONTIERES
+! (DEFAUT NON : 0 ; OUI : 1)
+inbrbd = 1
+
+! FLUX DE MASSE PARTICULAIRE LIE AUX INTERACTIONS
+! PARTICULES/FRONTIERES
+! (DEFAUT NON : 0 ; OUI : 1)
+iflmbd = 1
+
+! ANGLE ENTRE LA VITESSE DE LA PARTICULE
+! ET LE PLAN DE LA FACE FRONTIERE
+! (DEFAUT NON : 0 ; OUI : 1)
+iangbd = 0
+
+! NORME DE LA VITESSE DE LA PARTICULE AU MOMENT
+! DE SON INTERACTION AVEC LA FACE FRONTIERE
+! (DEFAUT NON : 0 ; OUI : 1)
+ivitbd = 0
+
+! MASSE DE GRAINS DE CHARBON ENCRASSES
+! (DEFAUT NON : 0 ; OUI : 1)
+ if (iphyla.eq.2 .and. iencra.eq.1) iencbd = 0
+
+! INFORMATIONS UTILISATEUR SUPPLEMENTAIRES A ENREGISTREES
+! (PAR EXEMPLE TAUX D'EROSION, TEMPERATURE...)
+! * ces enregistrements supplementaires sont stokees dans
+! le tableau PARBOR,
+! * on renseigne ici le nombre NUSBOR d'enregistrements
+! supplementaires,
+! * la limite supperieure de ce nombre est NUSBRD = 10
+! (fixee dans lagpar.h),
+! * voir un exemple de code d'un enregistrement supplementaire
+! dans le sous-programme USLABO.
+
+nusbor = 0
+
+
+! 12.2.3 NOM DES ENREGISTREMENTS POUR AFFICHAGE,
+! MOYENNE EN TEMPS OU MOYENNE PARTICULAIRE
+! DES STATISTIQUES AUX FRONTIERES
+! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+! * A priori l'utilisateur n'intervient que dans les infos
+! utilisateur supplementaires a enregistrer : il doit
+! donner le nom de l'enregistrement ainsi que le type
+! de moyenne que l'on souhaite lui appliquer pour les affichages
+! listing et en fin de calcul pour le post-processing.
+
+! * ATTENTION ce nom est utilise pour retrouver les informations
+! dans le fichier suite de calcul, si un nom est modifie
+! entre deux calculs, le resultat concerne n'est pas relu
+! (et est donc perdu).
+
+! * La moyenne appliquee est donnee par l'intermediaire du
+! tableau IMOYBR :
+! - si IMOYBR(IUSB(II)) = 0 -> pas de moyenne appliquee
+! - si IMOYBR(IUSB(II)) = 1 -> on applique une moyenne temporelle,
+! c'est a dire que la statistique est divisee par le
+! dernier pas de temps dans le cas d'un enregistrement
+! instationnaire, ou stationnaire mais avec un nombre
+! d'iterations inferieur a NSTBOR ; ou que la statistique
+! est divisee par le temps d'enregistrement
+! stationnaire dans le cas stationnaire.
+! - si IMOYBR(IUSB(II)) = 2 -> on applique une moyenne
+! particulaire, c'est a dire qu'on divise la statistique
+! par le nombre d'interactions particules/frontieres
+! enregistrees (en terme de poids statistique)
+! dans PARBOR(NFABOR,INBR) (cf. USLABO).
+! Pour utiliser cette moyenne il faut que INBRBD=1.
+! * Les sauvegardes dans le fichier suite de calcul sont faites
+! sans application de cette moyenne.
+! * La moyenne est appliquee si le nombre d'interactions (en poids
+! statistique) de la face de bord consideree est strictement
+! superieur a SEUILF, sinon la moyenne est mise a zero.
+
+ipv = 0
+
+if (iensi3.eq.1) then
+
+ if (inbrbd.eq.1) then
+ ipv = ipv + 1
+ inbr = ipv
+ NOMBRD(INBR) = 'nombreImpact'
+ imoybr(inbr) = 0
+ endif
+
+ if (iflmbd.eq.1) then
+ ipv = ipv + 1
+ iflm = ipv
+ NOMBRD(IFLM) = 'fluxDeMasse'
+ imoybr(iflm) = 1
+ endif
+
+ if (iangbd.eq.1) then
+ ipv = ipv + 1
+ iang = ipv
+ NOMBRD(IANG) = 'angleImpact'
+ imoybr(iang) = 1
+ endif
+
+ if (ivitbd.eq.1) then
+ ipv = ipv + 1
+ ivit = ipv
+ NOMBRD(IVIT) = 'normeVitImpact'
+ imoybr(ivit) = 1
+ endif
+
+ if (iencbd.eq.1) then
+ ipv = ipv + 1
+ ienc = ipv
+ NOMBRD(IENC) = 'masseEncras'
+ imoybr(ienc) = 0
+ endif
+
+ if (nusbor.gt.0) then
+ do ii = 1,nusbor
+ ipv = ipv + 1
+ iusb(ii) = ipv
+ WRITE(NOMBRD(IUSB(II)),'(A8,I4.4)') 'enrSupp',II
+ imoybr(iusb(ii)) = 0
+ enddo
+ endif
+
+endif
+
+!===============================================================================
+! 13. LISTING LAGRANGIEN
+!===============================================================================
+! Periode de sortie du listing lagrangien
+
+ntlal = 1
+
+!===============================================================================
+
+return
+
+end
diff --git a/users/lagr/uslag2.f90 b/users/lagr/uslag2.f90
new file mode 100644
index 0000000..12393d3
--- /dev/null
+++ b/users/lagr/uslag2.f90
@@ -0,0 +1,644 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslag2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION OBLIGATOIRE)
+
+! ROUTINE UTILISATEUR POUR LES CONDITIONS AUX LIMITES RELATIVES
+! AUX PARTICULES (ENTREE ET TRAITEMENT AUX AUTRES BORDS)
+
+
+! IDENTIFICATION DES FACES DE BORD
+! ================================
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ! ! ! le module lagrangien !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ifrlag(nfabor ! te ! --> ! type des faces de bord lagrangien !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer itepa(nbpmax,nivep) , ifrlag(nfabor)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ifac , izone, nbclas, iclas
+integer icha
+integer ilelt, nlelt
+
+double precision pis6 , mp0 , temp
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if (iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9000)
+ call csexit (1)
+ !==========
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE LAGRANGIEN : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uslag2 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. INITIALISATION
+!===============================================================================
+
+pis6 = pi / 6.d0
+
+!===============================================================================
+! 3. CONSTRUCTION DES ZONES FRONTIERE
+!===============================================================================
+
+
+! DEFINITION DES ZONES FRONTIERES
+
+! Pour le module Lagrangien, l'utilisateur definit NFRLAG zones
+! frontieres a partir de la couleur des faces de bord, plus
+! generalement de leurs proprietes (couleurs, groupes...),
+! ou des conditions aux limites fixees dans usclim
+! ou meme de leur coordonnees. Pour ce faire, on renseigne
+! le tableau IFRLAG(NFABOR) qui donne pour
+! chaque face de bord IFAC le numero de la zone a laquelle elle
+! appartient IFRLAG(IFAC).
+! Attention : il est indispensable que TOUTES les faces aient ete
+! affectees a une zone.
+! Le numero des zones (donc les valeurs de IFRLAG(IFAC)) est
+! arbitrairement choisi par l'utilisateur, mais doit etre un
+! entier strictement positif et inferieur ou egal a NFLAGM
+! (valeur fixee en parametre dans lagpar.h).
+! On affecte ensuite a chaque zone un type ITYLAG qui sera utilise
+! pour imposer des conditions aux limites globales.
+
+
+izone = -1
+
+! ---> Premiere zone, numerotee IZONE = 1 ( = couleur 10)
+CALL GETFBR('10',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ izone = 1
+ ifrlag(ifac) = izone
+
+enddo
+
+! ---> Deuxieme zone, numerotee IZONE = 2 ( = partie des couleur 4)
+CALL GETFBR('4 and Y < 1.0',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ izone = 2
+ ifrlag(ifac) = izone
+
+enddo
+
+! ---> Troisieme zone, numerotee IZONE = 4 ( = entree phase 1)
+do ifac = 1, nfabor
+ if(itypfb(ifac,1).eq.ientre) then
+ izone = 4
+ ifrlag(ifac) = izone
+ endif
+enddo
+
+! ---> Nieme zone, numerotee IZONE = 5 ( = couleur 3)
+CALL GETFBR('3',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ izone = 5
+ ifrlag(ifac) = izone
+
+enddo
+
+
+!===============================================================================
+! 4. INJECTION PAR CLASSES DE PARTICULES DANS LE DOMAINE DE CALCUL
+!===============================================================================
+
+! POUR DONNER LES INFORMATIONS SUR LES CLASSES DE PARTICULES,
+! ON PROCEDE EN DEUX ETAPES :
+
+! 1) TOUT D'ABORD, ON RENSEIGNE LE NOMBRE DE CLASSES DE PARTICULES
+! PAR ZONE FRONTIERE : IUSNCL (ce nombre est nul par defaut)
+
+! 2) ENSUITE PAR ZONE DE COULEUR ET PAR CLASSE,
+! ON DONNE LES CARACTERISTIQUES D'ENTREE ET
+! LES CARACTERISTIQUE PHYSIQUES DES PARTICULES
+
+
+
+
+! --> Nombre de classes de particules entrantes
+! On renseigne ici le nombre de classes pour toutes les zones
+! identifiees precedemment.
+! Par defaut le nombre de classes de particules est nul.
+! Le nombre max de classes est NCLAGM donne dans lagpar
+
+! ---> Premiere zone, numerotee IZONE = 1 : 1 classe injectee
+izone = 1
+nbclas = 1
+iusncl(izone) = nbclas
+
+! ---> Deuxieme zone, numerotee IZONE = 2 : 0 classe injectee
+izone = 2
+nbclas = 0
+iusncl(izone) = nbclas
+
+! ---> Troisieme zone, numerotee IZONE = 4 : 0 classe injectee
+izone = 4
+nbclas = 0
+iusncl(izone) = nbclas
+
+! ---> Nieme zone, numerotee IZONE = 5 : 0 classe injectee
+izone = 5
+nbclas = 0
+iusncl(izone) = nbclas
+
+
+! --> Pour chaque classe de particules associee a une zone,
+! il faut fournir des informations.
+
+
+! IUSNCL nbr de classes par zones
+! IUSCLB conditions au bord pour les particules
+! = IENTRL -> zone d'injection de particules
+! = ISORTL -> sortie du domaine
+! = IREBOL -> rebond des particules
+! = IDEPO1 -> deposition definitive
+! = IDEPO2 -> deposition definitive mais la particule reste en
+! memoire (utile si IENSI2 = 1 uniquement)
+! = IDEPO3 -> deposition et remise en suspension possible
+! suivant les condition de l'ecoulement
+! = IDEPFA -> deposition de la particule avec force d'attachement,
+! vitesse conservee et re-entrainement possible
+! (Possible si LADLVO = 1 )
+! = IENCRL -> encrassement (Charbon uniquement IPHYLA = 2)
+! = JBORD1 -> interaction part/frontiere utilisateur (cf. USLABO)
+! = JBORD2 -> interaction part/frontiere utilisateur (cf. USLABO)
+! = JBORD3 -> interaction part/frontiere utilisateur (cf. USLABO)
+! = JBORD4 -> interaction part/frontiere utilisateur (cf. USLABO)
+! = JBORD5 -> interaction part/frontiere utilisateur (cf. USLABO)
+
+
+
+! Tableau IUSLAG :
+! ================
+! IJNBP : nbr de part par classe et zones
+! IJFRE : frequence d'injection, si la frequence est nulle alors
+! il y a injection uniquement a la 1ere iteration absolue
+! ICLST : numero de groupe auquel appartient la particule
+! (uniquement si on souhaite des statistiques par groupe)
+! IJUVW : type de condition vitesse
+! = -1 vitesse fluide imposee
+! = 0 vitesse imposee selon la direction normale a la face
+! de bord et de norme RUSLAG(ICLAS,IZONE,IUNO)
+! = 1 vitesse imposee : on donne RUSLAG(ICLAS,IZONE,IUPT)
+! RUSLAG(ICLAS,IZONE,IVPT)
+! RUSLAG(ICLAS,IZONE,IWPT)
+! = 2 profil utilisateur
+! IJPRTP : type de condition temperature
+! = 1 temperature imposee : on donne RUSLAG(ICLAS,IZONE,ITPT)
+! = 2 profil utilisateur
+! IJPRDP : type de condition diametre
+! = 1 vitesse imposee : on donne RUSLAG(ICLAS,IZONE,IDPT)
+! RUSLAG(ICLAS,IZONE,IVDPT)
+! = 2 profil utilisateur
+! INUCHL : numero du charbon de la particule (uniquement si IPHYLA=2)
+
+! Tableau RUSLAG :
+! ================
+! IUNO : norme de la vitesse (m/s)
+! IUPT : U par classe et zones (m/s)
+! IVPT : V par classe et zones (m/s)
+! IWPT : W par classe et zones (m/s)
+! IDEBT : debit massique (kg/s)
+! IPOIT : poids statistique (nombre d'echantillons) associe
+! a la particule (il est calcule automatiquement pour
+! respecter un debit massique ce dernier est fournis)
+
+! En fonction de la physique
+! IDPT : diametre (m)
+! IVDPT : ecart-type du diametre (m)
+! ITPT : temperature en degres Celsius (Pas d'enthalpie)
+! ICPT : chaleur specifique (J/kg/K)
+! IEPSI : emissivite (si =0 alors aucun effet radiatif n'est pris en compte)
+! IROPT : masse volumique (kg/m3)
+
+! Si Charbon (IPHYLA=2)
+! IHPT : temperature en degres Celsius (Pas d'enthalpie)
+! IMCHT : masse de charbon reactif (kg)
+! IMCKT : masse de coke (kg)
+
+
+! ---> Premiere zone, numerotee IZONE = 1 (NBCLAS classes)
+! IUSCLB : adherence de la particule a une face de paroi
+! IJNBP : 10 particules par classe,
+! IJFRE : injection tous les 2 pas de temps
+! IJUVW, IUPT, IVPT, IWPT : vitesse imposee a 1.1D0, 0.0D0, 0.0D0
+! ICPT : cp de 10000
+! ITPT : temperature de 25 degres Celsius
+! IDPT : diametre de 50.E-6 m
+! IEPSI : emissivite a 0.7
+! IVDPT : diametre constant ==> Ecart-type nul
+! IROPT : masse volumique
+! IPOIT : poids statistique (nombre de particules physiques
+! represente par une particule-echantillon statistique)
+! IDEBT : debit massique
+
+
+izone = 1
+nbclas = iusncl(izone)
+iusclb (izone) = ientrl
+do iclas = 1, nbclas
+
+ iuslag (iclas,izone,ijnbp) = 10
+ iuslag (iclas,izone,ijfre) = 2
+
+ if (nbclst.gt.0) then
+ iuslag(iclas,izone,iclst) = 1
+ endif
+
+ iuslag (iclas,izone,ijuvw) = -1
+ ruslag (iclas,izone,iupt) = 1.1d0
+ ruslag (iclas,izone,ivpt) = 0.0d0
+ ruslag (iclas,izone,iwpt) = 0.0d0
+
+ iuslag (iclas,izone,ijprpd)= 1
+ ruslag (iclas,izone,ipoit) = 1.d0
+ ruslag (iclas,izone,idebt) = 0.d0
+
+! Si physique simple
+
+ if ( iphyla.eq.0 .or. iphyla.eq.1 ) then
+
+! Diametre et ecart-type du diametre
+
+ iuslag (iclas,izone,ijprdp)= 1
+ ruslag (iclas,izone,idpt) = 50.d-6
+ ruslag (iclas,izone,ivdpt) = 0.d0
+
+! Masse Volumique
+
+ ruslag(iclas,izone,iropt) = 2500.d0
+
+ if ( iphyla.eq.1 ) then
+
+! Temperature et Cp
+
+ if ( itpvar.eq.1 ) then
+ iuslag (iclas,izone,ijprtp) = 1
+ ruslag(iclas,izone,itpt) = 20.d0
+
+ ruslag(iclas,izone,icpt) = 1400.d0
+ ruslag(iclas,izone,iepsi) = 0.7d0
+ endif
+
+ endif
+
+! Charbon
+
+ else if ( iphyla.eq.2 ) then
+
+! ATTENTION : 1) Pour transporter et bruler des particules de
+! charbon en Lagrangien, une physique particuliere
+! liee au charbon pulverise doit etre active pour
+! la phase porteuse.
+
+! 2) Les proprietes physiques des grains de charbon
+! sont connus a partir du fichier de thermochimie :
+! dp_FCP.
+
+! 3) Pour la classe Lagrangienne courante ICLAS, et pour
+! la zone frontiere NB courante, on donne aux grains
+! de charbon les proprietes du charbon ICHA de classe
+! ICLAS lu dans le fichier dp_FCP.
+
+! 4) ICHA : numero du Charbon compris entre 1 et NCHARB
+! defini dans le fichier dp_FCP par l'utilisateur.
+! (NCHARB = NCHARM = 3 au maximum)
+
+
+ icha = ichcor(iclas)
+ temp = 800.d0
+
+! Numero du charbon
+
+ iuslag(iclas,izone,inuchl) = icha
+
+! Temperature et Cp
+
+ ruslag(iclas,izone,ihpt) = temp
+ ruslag(iclas,izone,icpt) = cp2ch(icha)
+
+! Diametre et son ecart-type (nul)
+
+ ruslag (iclas,izone,idpt) = diam20(iclas)
+ ruslag (iclas,izone,ivdpt) = 0.d0
+
+! Masse Volumique
+
+ ruslag(iclas,izone,iropt) = rho0ch(icha)
+
+! Masse de charbon actif et
+! Masse de Coke (nulle si le charbon n'a jamais brule)
+
+ mp0 = pis6 * ( ruslag(iclas,izone,idpt)**3 ) &
+ * ruslag(iclas,izone,iropt)
+ ruslag(iclas,izone,imcht) = mp0 * (1.d0-xashch(icha))
+ ruslag(iclas,izone,imckt) = 0.d0
+
+ endif
+
+enddo
+
+! ---> Deuxieme zone, numerotee IZONE = 2 (NBCLAS classes)
+! IUSCLB : rebond de la particule
+
+izone = 2
+iusclb (izone) = irebol
+
+
+izone = 4
+iusclb (izone) = irebol
+
+
+! de meme pour les autres zones ...
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/lagr/uslain.f90 b/users/lagr/uslain.f90
new file mode 100644
index 0000000..14de085
--- /dev/null
+++ b/users/lagr/uslain.f90
@@ -0,0 +1,394 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslain &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nptnew , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , injfac , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , vagaus , w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! ROUTINE UTILISATEUR POUR LES CONDITIONS AUX LIMITES RELATIVES
+! AUX PARTICULES (ENTREE ET TRAITEMENT AUX AUTRES BORDS)
+
+! CE SOUS-PROGRAMME EST APPELE
+! APRES INITIALISATION DES TABLEAUX ETTP TEPA ET ITEPA
+! POUR LES NOUVELLES PARTICULES AFIN DE LES MODIFIER POUR
+! INJECTER DES PROFILS DE PARTICULES.
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nptnew ! e ! <-- ! nombre total de nouvelles particules !
+! ! ! ! pour toutes les zones d'injection !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ! ! ! le module lagrangien !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ifrlag(nfabor ! te ! --> ! type des faces de bord lagrangien !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! injfac(nptnew ! te ! <-- ! numero de la face de bord d'injection !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! vagaus ! tr ! --> ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! w1..w3(ncelet ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nptnew
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer itepa(nbpmax,nivep) , ifrlag(nfabor)
+integer injfac(nbpnew)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision vagaus(nbpmax,*)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iclas , izone , ifac
+integer ii , ip , npt , npar1 , npar2, ipnorm
+
+! VARIABLES LOCALES UTILISATEUR
+! (VGAUSS est dimensionne a 3, mais 2 suffirait ici)
+
+double precision vgauss(3)
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+! Par defaut on ne les modifie pas.
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+if (nbpnew.eq.0) return
+
+!===============================================================================
+! 1. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. INITIALISATIONS
+!===============================================================================
+
+
+
+!===============================================================================
+! 3. MODIFICATION DES DONNEES PARTICULAIRES DES NOUVELLES PARTICULES
+! (PROFILS D'INJECTION, REPLACEMENT DU POINT D'INJECTION,
+! MODIFICATION DES POIDS STATISTIQUES, CORRECTION DU DIAMETRE
+! SI OPTION ECART-TYPE ACTIVEE...)
+!===============================================================================
+
+! LES MODIFICATIONS DES DONNEES PARTICULAIRES
+! INTERVIENNENT APRES TOUTES LES INITIALISATIONS LIEES
+! A L'INJECTION DES NOUVELLES PARTICULES, MAIS AVANT LE
+! TRAITEMENT DE L'INJECTION CONTINUE (IL EST DONC POSSIBLE
+! D'IMPOSER UN PROFIL D'INJECTION AVEC OPTION D'INJECTION
+! CONTINUE).
+
+! reinitialisation du compteur de nouvelles particules
+npt = nbpart
+
+! pour chaque zone de bord:
+do ii = 1,nfrlag
+ izone = ilflag(ii)
+
+! pour chaque classe :
+ do iclas = 1, iusncl(izone)
+
+! si de nouvelles particules doivent entrer :
+ if (mod(ntcabs,iuslag(iclas,izone,ijfre)).eq.0) then
+
+ do ip = npt+1 , npt+iuslag(iclas,izone,ijnbp)
+
+! NUMERO DE LA FACE DE BORD D'INJECTION D'ORIGINE
+
+ ifac = injfac(ip)
+
+! EXEMPLE DE MODIFICATION DES VITESSES D'INJECTION
+! EN FONCTION DE LA POSITION D'INJECTION
+
+! Appeler par exemple votre propre sous-programme
+! qui fournirait les trois composantes de la vitesse instantanee
+! ETTP(IP,JUP),ETTP(IP,JVP),ETTP(IP,JWP)
+! en fonction de ETTP(IP,JZP) (interpolation par exemple)
+! Plus simplement on peut aussi imaginer de fournir les trois
+! composantes de la vitesse instantanee, sous la forme d'une
+! valeur moyenne (prise arbitrairement egale a (2,0,0) m/s ici)
+! et d'une valeur fluctuante calculee a partir d'une fluctuation
+! (prise arbitrairement egale a 0,2 m/s ici pour les composantes
+! 1 et 3) :
+ ipnorm = 2
+ call normalen(ipnorm,vgauss)
+ ettp(ip,jup) = 2.d0 + vgauss(1) * 0.2d0
+ ettp(ip,jvp) = 0.d0
+ ettp(ip,jwp) = 0.d0 + vgauss(2) * 0.2d0
+
+ enddo
+
+ npt = npt + iuslag(iclas,izone,ijnbp)
+
+ endif
+
+ enddo
+enddo
+
+!===============================================================================
+! 4. SIMULATION DES VITESSES TURBULENTES FLUIDES INSTANTANNEES VUES
+! PAR LES PARTICULES SOLIDES LE LONG DE LEUR TRAJECTOIRE.
+!===============================================================================
+
+! En entrant dans ce sous-programme, les tableaux :
+! ETTP(IP,JUF)
+! ETTP(IP,JVF)
+! ETTP(IP,JWF)
+! contiennent les composantes de la vitesse instantanee
+! (partie fluctuante + partie moyenne) du fluide vu
+! par les particules.
+
+! Lorsque la vitesse du fluide vu est modifiee ci-dessus,
+! le plus souvent l'utilisateur n'en connait que
+! la partie moyenne. Dans certaines configurations d'ecoulement
+! et d'injection des particules, il peut parfois s'averer
+! necessaire d'en reconstruire la partie turbulente.
+! C'est l'objet de l'appel au sous-programme suivant.
+
+! Attention : il ne faut reconstruire cette composante turbulente
+! que sur les vitesses du fluide vu modifiees.
+
+! La reconstruction est desactivee ici et doit etre adaptee au
+! cas traite.
+
+if ( 1.eq.0 ) then
+
+ npar1 = nbpart+1
+ npar2 = nbpart+nbpnew
+
+ call lagipn &
+ !==========
+ ( idebia , idebra , &
+ ncelet , ncel , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ npar1 , npar2 , &
+ nideve , nrdeve , nituse , nrtuse , &
+ itepa , &
+ idevel , ituser , ia , &
+ rtpa , &
+ ettp , tepa , vagaus , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+endif
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/lagr/uslapr.f90 b/users/lagr/uslapr.f90
new file mode 100644
index 0000000..dc165f8
--- /dev/null
+++ b/users/lagr/uslapr.f90
@@ -0,0 +1,357 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslapr &
+!================
+
+ ( idbia0 , idbra0 , &
+ idvar , iepart , izone , iclass , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , ifrlag , &
+ idevel , ituser , ia , &
+ xxpart , yypart , zzpart , &
+ tvpart , uupart , vvpart , wwpart , ddpart , ttpart , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR
+
+! ROUTINE UTILISATEUR POUR LES CONDITIONS AUX LIMITES RELATIVES
+! AUX PARTICULES (ENTREE ET TRAITEMENT AUX AUTRES BORDS)
+! PERMET D'IMPOSER LES VALEURS DE
+! - VITESSE
+! - DIAMETRE
+! - TEMPERATURE
+! POUR LA PARTICULE TRAITER
+! SI IDVAR = 0 ===> ON RECUPERE LE TAUX DE PRESENCE
+! SI IDVAR = 1 ===> ON RECUPERE LES 3 COMPOSANTES DE LA VITESSE
+! SI IDVAR = 2 ===> ON RECUPERE LE DIAMETRE
+! SI IDVAR = 3 ===> ON RECUPERE LA TEMPERATURE
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! idvar ! e ! <-- ! type de la(es) valeur(s) a calculer !
+! iepart ! e ! <-- ! numero de la cellule de la particule !
+! izone ! e ! <-- ! numero de la zone de la particule !
+! iclass ! e ! <-- ! numero de la classe de la particule !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ! ! ! le module lagrangien !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! itrifb(nfabor ! te ! <-- ! indirection pour tri des faces de brd !
+! nphas ) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ifrlag(nfabor ! te ! --> ! type des faces de bord lagrangien !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xpart ! r ! <-- ! coordonnees x de la particule !
+! ypart ! r ! <-- ! coordonnees y de la particule !
+! zpart ! r ! <-- ! coordonnees z de la particule !
+! tvpart ! r ! <- ! valeur du taux de presence !
+! upart ! r ! <- ! coordonnees x de la vitesse particule !
+! vpart ! r ! <- ! coordonnees y de la vitesse particule !
+! zpart ! r ! <- ! coordonnees z de la vitesse particule !
+! dpart ! r ! <- ! diametre de la particule !
+! dpart ! r ! <- ! temperature de la particule !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstnum.h"
+include "cstphy.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+
+integer idvar , iepart , izone , iclass
+
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer itepa(nbpmax,nivep) , ifrlag(nfabor)
+integer idevel(nideve) , ituser(nituse)
+integer ia(*)
+
+double precision xxpart , yypart , zzpart
+double precision tvpart , uupart , vvpart , wwpart
+double precision ddpart , ttpart
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+
+double precision pis6
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if(1.eq.1) then
+ write(nfecra,9000)
+ call csexit (1)
+ !==========
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET LORS DE L''ENTREE DES COND. LIM. ',/,&
+'@ ========= ',/,&
+'@ MODULE LAGRANGIEN : ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uslapr DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 1. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 2. INITIALISATION
+!===============================================================================
+
+pis6 = pi / 6.d0
+
+!===============================================================================
+! 3. PROFIL POUR LE TAUX DE PRESENCE
+!===============================================================================
+
+if (idvar .eq. 0) then
+
+ tvpart = 0.01
+
+endif
+
+!===============================================================================
+! 4. PROFIL POUR LA VITESSE
+!===============================================================================
+
+if (idvar .eq. 1) then
+
+ uupart = 1.d0
+ vvpart = 0.d0
+ wwpart = 0.d0
+
+endif
+
+!===============================================================================
+! 5. PROFIL POUR LE DIAMETRE
+!===============================================================================
+
+if (idvar .eq. 2) then
+
+ ddpart = 50.d-6
+
+endif
+
+
+!===============================================================================
+! 6. PROFIL POUR LA TEMPERATURE
+!===============================================================================
+
+if (idvar .eq. 3) then
+
+ ttpart = 20.d0
+
+endif
+
+!===============================================================================
+
+!--------
+! FORMATS
+!--------
+
+!----
+! FIN
+!----
+
+return
+
+end
diff --git a/users/lagr/uslaru.f90 b/users/lagr/uslaru.f90
new file mode 100644
index 0000000..8414669
--- /dev/null
+++ b/users/lagr/uslaru.f90
@@ -0,0 +1,307 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslaru &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ itypfb , itrifb , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ surfbn , dt , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , tepa , vagaus , croule , auxl , &
+ distpa , distyp , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! Calcul de la fonction d'importance pour la Roulette Russe
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! (nfml,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas) ! ! ! !
+! itrifb(nfabor ! te ! --> ! tab d'indirection pour tri des faces !
+! nphas) ! ! ! !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! surfbn(nfabor ! tr ! <-- ! surface des faces de bord !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! vagaus ! tr ! <-- ! variables aleatoires gaussiennes !
+!(nbpmax,nvgaus ! ! ! !
+! croule(ncelet ! tr ! --> ! fonction d'importance pour la !
+! ! ! ! roulette russe !
+! auxl(nbpmax,3 ! tr ! --- ! tableau de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+! distpa(ncelet ! tr ! <-- ! tab des distances a la paroi !
+! disty(ncelet) ! tr ! <-- ! distance y+ !
+! w1...w3(ncel) ! tr ! --- ! tableau de travail !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "entsor.h"
+include "cstphy.h"
+include "pointe.h"
+include "period.h"
+include "parall.h"
+include "lagpar.h"
+include "lagran.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer itypfb(nfabor,nphas) , itrifb(nfabor,nphas)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision surfbn(nfabor)
+double precision dt(ncelet), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , tepa(nbpmax,nvep)
+double precision vagaus(nbpmax,*) , croule(ncelet)
+double precision auxl(nbpmax,3)
+double precision distpa(ncelet) , distyp(ncelet)
+double precision w1(ncelet) , w2(ncelet) , w3(ncelet)
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer iel
+double precision zref
+
+!===============================================================================
+
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION PAR DEFAUT
+
+
+! ATTENTION, CROULE N'EST PAS INITIALISE AILLEURS QUE DANS
+
+! LE PRESENT SOUS-PROGRAMME
+
+
+! VEILLER A CE QU'IL SOIT COMPLETE POUR TOUTES LES CELLULES
+
+
+!===============================================================================
+
+do iel = 1,ncel
+ croule(iel) = 1.d0
+enddo
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! -1. SI L'UTILISATEUR N'INTERVIENT PAS, ON LAISSE CROULE = 1 PARTOUT
+!===============================================================================
+
+if(1.eq.1) then
+ return
+endif
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 2. CALCUL DE LA FONCTION D'IMPORTANCE PAR L'UTILISATEUR
+!===============================================================================
+
+! ATTENTION : le tableau CROULE doit contenir
+! ^^^^^^^^^ des reels strictement positifs
+! permettant de ponderer l'importance de zones par
+! rapport a d'autres
+! (plus CROULE est grand, plus l'importance de la zone
+! est grande)
+
+! Par exemple, on peut decider que la zone est
+! d'importance d'autant plus grande qu'elle est
+! proche de z=zref
+! d'importance constante a 1E-3 autour de zref
+! d'importance au moins egale a 1.D-6 (loin de zref)
+
+
+zref = 0
+
+do iel = 1,ncel
+ croule(iel) = 1.d0/(max( abs(xyzcen(3,iel)-zref),1.d-3 ))
+enddo
+
+do iel = 1,ncel
+ croule(iel) = max(croule(iel),1.d-6 )
+enddo
+
+!===============================================================================
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/lagr/uslast.f90 b/users/lagr/uslast.f90
new file mode 100644
index 0000000..c3ccca7
--- /dev/null
+++ b/users/lagr/uslast.f90
@@ -0,0 +1,544 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslast &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ ntersl , nvlsta , nvisbr , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , itepa , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , &
+ ettp , ettpa , tepa , taup , tlag , tempct , &
+ statis , stativ , &
+ w1 , w2 , w3 , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -----------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! MODIFICATIONS UTILSATEUR SUR LES VARIABLES EN FIN D'ITERATION
+! LAGRANGIENNES ET CALCUL DES STATISTIQUES UTILISATEUR
+! SUPPLEMENTAIRES SUR LES PARTICULES
+
+! POUR LES STATISTIQUES UTILISATEUR SUPPLEMENTAIRES,
+! ON RAPPELLE QUE :
+
+! ISTTIO = 0 : calcul instationnaire pour le lagrangien
+! = 1 : calcul stationnaire pour le lagrangien
+
+! ISTALA : calcul statistiques si >= 1 sinon pas de stat
+
+! ISUIST : suite calcul statistiques si >= 1 sinon pas de stat
+
+! IDSTNT : Numero du pas de temps pour debut statistque
+
+! NSTIST : iteration Lagrangienne du debut calcul stationnaire
+
+! NPST : nombre d'iterations de calcul de stat stationnaires
+
+! NPSTT : nombre d'iterations total des stats depuis le debut
+! du calcul, partie instationnaire comprise
+
+! TSTAT : Temps physique d'enregistrement des stats volumiques
+! stationnaires
+! (en instationnaire TSTAT=DTP le pas de temps Lagrangien)
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! ntersl ! e ! <-- ! nbr termes sources de couplage retour !
+! nvlsta ! e ! <-- ! nombre de var statistiques lagrangien !
+! nvisbr ! e ! <-- ! nombre de statistiques aux frontieres !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (nfac+1) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (lndfac) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (nfabor+1) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (lndfbr ) ! ! ! (optionnel) !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume(ncelet ! tr ! <-- ! volume d'un des ncelet elements !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa(nbpmax, ! tr ! <-- ! caracteristiques des particules !
+! nvep) ! ! ! aux particules (poids, ...) !
+! taup(nbpmax) ! tr ! <-- ! temps caracteristique dynamique !
+! tlag(nbpmax) ! tr ! <-- ! temps caracteristique fluide !
+! tempct ! tr ! <-- ! temps caracteristique thermique !
+! (nbpmax,2) ! ! ! !
+! statis ! tr ! <-- ! cumul pour les moyennes des !
+!(ncelet,nvlsta ! ! ! statistiques volumiques !
+! stativ ! tr ! <-- ! cumul pour les variances des !
+!(ncelet, ! ! ! statistiques volumiques !
+! nvlsta-1) ! ! ! !
+! w1..w3(ncelet ! tr ! --- ! tableaux de travail !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "optcal.h"
+include "pointe.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "cstphy.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer ntersl , nvlsta , nvisbr
+integer nideve , nrdeve , nituse , nrtuse
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml)
+integer ipnfac(nfac+1) , nodfac(lndfac)
+integer ipnfbr(nfabor+1) , nodfbr(lndfbr)
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*) , rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision coefa(nfabor,*) , coefb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision taup(nbpmax) , tlag(nbpmax,3) , tempct(nbpmax,2)
+double precision statis(ncelet,nvlsta)
+double precision stativ(ncelet,nvlsta-1)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision rdevel(nrdeve) , rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ifinia, ifinra
+integer npt , iel , iphas
+
+integer ivf , ivff , itabvr , iflu , icla
+
+! VARIABLES LOCALES UTILISATEUR
+
+integer nxlist
+parameter (nxlist=100)
+
+integer iplan
+integer ii, ind, il
+integer inoeud, irang0, indic
+integer ist(6)
+
+double precision zz(4), zzz(8), xlist(nxlist,8), xyzpt(3)
+
+character name(8)*4
+
+double precision debm(4)
+save debm
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+
+if(istala.eq.1 .and. iplas.ge.idstnt .and. nvlsts.gt.0) then
+
+! Si l'on passe ici, il faut que l'utilisateur complete
+! l'exemple ci-dessous et l'adapte...
+
+ if(1.eq.1) then
+ write(nfecra,9000)nvlsts
+ call csexit (1)
+ endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET DANS LE MODULE LAGRANGIEN ',/,&
+'@ ========= ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR uslast DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Des variables statistiques supplementaires ont ete ',/,&
+'@ demandees dans uslag1 (NVLSTS=', I10,') ',/,&
+'@ Le sous-programme uslast doit etre complete pour preciser ',/,&
+'@ le calcul de leur cumul. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+else
+
+! On entre toujours dans ce sous programme en lagrangien,
+! si on ne souhaite rien y faire, on sort immediatement.
+
+ return
+
+endif
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATION
+!===============================================================================
+
+iphas = ilphas
+
+!===============================================================================
+! 2 - CALCUL DES STATISTIQUES PARTICULAIRES UTILISATEURS
+!===============================================================================
+
+! D'une facon generale, dans cette routine on realise les cumuls
+! de la quantite dont on souhaite faire les statistiques.
+! La moyenne et la variance sont calculees dans la routine
+! USLAEN.F. Ce calcul est le plus souvent obtenu par division
+! des cumuls soit par le temps du cumul stationnaire contenu dans
+! la variable TSTAT, soit par le nombre de particules en poids
+! statistiques. Cette division est appliquee pour chaque ecriture
+! dans le listing et pour les sorties post-processing.
+
+! Cet exemple est desactive et doit etre adapte au cas traite
+
+if (1.eq.0) then
+
+ if(istala.eq.1 .and. iplas.ge.idstnt .and. nvlsts.gt.0) then
+
+ do npt = 1,nbpart
+
+ if( itepa(npt,jisor).gt.0 ) then
+
+ iel = itepa(npt,jisor)
+
+! -------------------------------------------------
+! EXEMPLE 1 : Cumul pour la concentration massique
+! -------------------------------------------------
+
+ statis(iel,ilvu(1)) = statis(iel,ilvu(1)) &
+ + tepa(npt,jrpoi) *ettp(npt,jmp)
+
+ stativ(iel,ilvu(1)) = stativ(iel,ilvu(1)) &
+ + tepa(npt,jrpoi) *ettp(npt,jmp) *ettp(npt,jmp)
+
+ endif
+
+ enddo
+
+ endif
+
+endif
+
+!===============================================================================
+! 3 - CALCUL UTILISATEUR DU DEBIT MASSIQUE DE PARTICULES SUR 4 PLANS
+!===============================================================================
+
+! Cet exemple est desactive et doit etre adapte au cas traite
+
+if (1.eq.0) then
+
+ zz(1) = 0.1d0
+ zz(2) = 0.15d0
+ zz(3) = 0.20d0
+ zz(4) = 0.25d0
+
+! Si on est en instationnaire, ou si le debut des stat stationnaires
+! n'est pas encore atteint, toutes les statistiques sont remises a
+! zero a chaque pas de temps avant d'entrer dans ce sous-programme.
+
+ if(isttio.eq.0 .or. npstt.le.nstist) then
+ do iplan = 1,4
+ debm(iplan) = 0.d0
+ enddo
+ endif
+
+ do iplan = 1,4
+
+ do npt = 1,nbpart
+
+ if(itepa(npt,jisor).gt.0) then
+
+ iel = itepa(npt,jisor)
+
+ if( ettp(npt,jxp).gt.zz(iplan) .and. &
+ ettpa(npt,jxp).le.zz(iplan) ) then
+ debm(iplan) = debm(iplan) +tepa(npt,jrpoi)*ettp(npt,jmp)
+ endif
+
+ endif
+
+ enddo
+ enddo
+
+ do iplan = 1,4
+ write(nfecra,1001)iplan,debm(iplan)/tstat
+ enddo
+
+ 1001 format(' Debit massique particulaire en Z(',I10,') : ',E14.5)
+
+endif
+
+
+!===============================================================================
+! 4 - EXTRACTION DE STATISTIQUES VOLUMIQUES EN FIN DE CALCUL
+!===============================================================================
+
+! Cet exemple est desactive et doit etre adapte au cas traite
+
+if (1.eq.0) then
+
+ if(ntcabs.eq.ntmabs) then
+
+ zzz(1) = 0.005d0
+ zzz(2) = 0.025d0
+ zzz(3) = 0.050d0
+ zzz(4) = 0.075d0
+ zzz(5) = 0.100d0
+ zzz(6) = 0.150d0
+ zzz(7) = 0.200d0
+ zzz(8) = 0.250d0
+
+ NAME(1) = 'XB01'
+ NAME(2) = 'XB05'
+ NAME(3) = 'XB10'
+ NAME(4) = 'XB15'
+ NAME(5) = 'XB20'
+ NAME(6) = 'XB30'
+ NAME(7) = 'XB40'
+ NAME(8) = 'XB50'
+
+ ist(1) = ilvx
+ ist(2) = ilvz
+ ist(3) = ilfv
+ ist(4) = ilpd
+
+ npts = nxlist
+
+ ifinia = idebia
+ itabvr = idebra
+ ifinra = itabvr + ncelet
+ CALL RASIZE('USLAST',IFINRA)
+ !==========
+
+ do iplan = 1,8
+
+! Pour le fichier ci-dessous :
+! l'utilisateur verifiera qu'il n'a pas laisse ouverte l'unite
+! IMPUSR(1), dans un autre sous-programme utilisateur
+ OPEN(FILE=NAME(IPLAN),UNIT=IMPUSR(1),FORM='formatted')
+
+ xyzpt(1) = zzz(iplan)
+
+ do ivf = 1,4
+
+ ivff = ist(ivf)
+ icla = 0
+ iflu = 0
+
+ call uslaen &
+ !==========
+ ( ifinia , ifinra , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , nvlsta , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ivff , ivff , ivff , iflu , ilpd , icla , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtpa , rtp , propce , propfa , propfb , &
+ coefa , coefb , statis , stativ , ra(itabvr) , &
+ rdevel , rtuser , ra )
+
+ ind = 0
+ do ii = 1, npts
+
+ xyzpt(2) = 0.d0
+ xyzpt(3) = float(ii-1)/float(npts-1)*150.d-3
+
+ call findpt &
+ !==========
+ (ncelet, ncel, xyzcen, &
+ xyzpt(1), xyzpt(2), xyzpt(3), inoeud, irang0)
+
+ indic = ituser(inoeud)
+ ituser(inoeud) = 1
+ if (indic.eq.1) then
+ ind = ind +1
+ xlist(ind,1) = xyzcen(1,inoeud)
+ xlist(ind,2) = xyzcen(3,inoeud) * (1.d3 / 5.d0)
+ xlist(ind,ivf+2) = ra(itabvr+inoeud-1)
+ endif
+ enddo
+ enddo
+
+ do il = 1, ind
+ WRITE (IMPUSR(1),'(8E13.5)') (XLIST(IL,II), II=1,6)
+ enddo
+
+ close(impusr(1))
+
+ enddo
+
+ endif
+
+endif
+
+
+
+!===============================================================================
+
+!====
+! FIN
+!====
+
+return
+
+end
diff --git a/users/lagr/uslatc.f90 b/users/lagr/uslatc.f90
new file mode 100644
index 0000000..658a5b1
--- /dev/null
+++ b/users/lagr/uslatc.f90
@@ -0,0 +1,304 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslatc &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nideve , nrdeve , nituse , nrtuse , &
+ numpt , itepa , idevel , ituser , ia , &
+ rep , uvwr , romf , romp , xnul , &
+ xcp , xrkl , tauc , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! MODIFICATION DU CALCUL DU TEMPS DE RELAXATION THERMIQUES
+! DES PARTICULES EN FONCTION DE LA FORMULATION CHOISIE
+! LE CALCUL DU NUSSELT
+
+
+! m Cp
+! p p
+! Tau = ---------------
+! c 2
+! PI d h
+! p e
+
+! Tau : TEMPS DE RELAXATION THERMIQUE (VALEUR A CALCULER)
+! c
+
+! m : MASSE DE LA PARTICULE
+! p
+
+! Cp : CHALEUR SPECIFIQUE DE LA PARTICULE
+! p
+
+! d : DIAMETRE DE LA PARTICULE
+! p
+
+! h : COEFFICIENT D'ECHANGE THERMIQUE
+! e
+
+! LE COEFFICIENT D'ECHANGE THERMIQUE EST CALCULE A PARTIR
+! D'UN NOMBRE DE NUSSELT, LUI MEME EVALUE PAR UNE
+! CORRELATION (RANZ-MARSHALL EN STANDARD).
+
+! h d
+! e p
+! Nu = -------- = 2 + 0.55 Re **(0.5) Prt**(0.33)
+! Lambda p
+
+! Lambda : CONDUCTIVITE THERMIQUE DE LA PHASE PORTEUSE
+
+! Re : NOMBRE DE REYNOLDS PARTICULAIRES
+! p
+
+! Prt : NOMBRE DE PRANDTL
+
+
+! CE SOUS PROGRAMME EST APPELE DANS UNE BOUCLE SUR
+! LES PARTICULES : ATTENTION DE NE PAS TROP LE CHARGER
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! numpt ! e ! <-- ! numero de la particule courante !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! rep ! r ! <-- ! nombre de reynolds particulaire !
+! ! ! ! rep = uvwr * ettp(numpt,jdp) / xnul !
+! uvwr ! r ! <-- ! vitesse relative de la particule !
+! ! ! ! uvwr= |vit fluide vu - vit particule| !
+! romf ! r ! <-- ! masse volumique du fluide a la !
+! ! ! ! position de la particule !
+! romp ! r ! <-- ! masse volumique de la particule !
+! xnul ! r ! <-- ! viscosite cinematique du fluide a la !
+! ! ! ! position de la particule !
+! xcp ! r ! <-- ! chaleur specifique du fluide !
+! ! ! ! a la position de la particule !
+! xrkl ! r ! <-- ! coefficient de diffusion du fluide !
+! ! ! ! a la position de la particule !
+! tauc ! r ! --> ! temps de relaxation thermique !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer nideve , nrdeve , nituse , nrtuse
+integer numpt
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision rep , uvwr , romf , romp , xnul
+double precision xcp , xrkl , tauc
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ip
+
+! VARIABLES LOCALES UTILISATEUR
+
+double precision prt, fnus
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+ip = numpt
+
+!===============================================================================
+! 2. TEMPS DE RELAXATION THERMIQUE STANDARD
+!===============================================================================
+
+! Cet exemple est desactive, il donne le temps de relaxation thermique
+! standard a titre indicatif.
+
+if (1.eq.0) then
+
+ prt = xnul / xrkl
+
+ fnus = 2.d0 + 0.55d0 * rep**0.5d0 * prt**(1.d0/3.d0)
+
+ tauc = ettp(ip,jdp) *ettp(ip,jdp) * romp * ettp(ip,jcp) &
+ / ( fnus * 6.d0 * romf * xcp * xrkl )
+
+endif
+
+!==============================================================================
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/lagr/uslatp.f90 b/users/lagr/uslatp.f90
new file mode 100644
index 0000000..0b28c22
--- /dev/null
+++ b/users/lagr/uslatp.f90
@@ -0,0 +1,328 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine uslatp &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , &
+ nprfml , nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , nphas , &
+ nbpmax , nvp , nvp1 , nvep , nivep , &
+ nideve , nrdeve , nituse , nrtuse , &
+ numpt , itepa , idevel , ituser , ia , &
+ rep , uvwr , romf , romp , xnul , taup , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , propce , propfa , propfb , &
+ ettp , ettpa , tepa , &
+ rdevel , rtuser , ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE LAGRANGIEN :
+! -------------------------------------
+
+! SOUS-PROGRAMME UTILISATEUR (INTERVENTION NON OBLIGATOIRE)
+
+! MODIFICATION DU CALCUL DU TEMPS DE RELAXATION DES PARTICULES
+! EN FONCTION DE LA FORMULATION CHOISIE POUR LE COEFFICIENT
+! DE TRAINEE
+
+
+! rho 4 d
+! p p
+! Tau = ---- --------------------------------
+! p
+! rho 3 C | U [X (t),t] - V (t) |
+! f drag f p p
+
+! Tau : TEMPS DE RELAXATION PARTICULAIRE (VALEUR A CALCULER)
+! p
+
+! rho : MASSE VOLUMIQUE DU FLUIDE
+! p
+
+! rho : MASSE VOLUMIQUE DE LA PARTICULE
+! f
+
+! C : COEFFICIENT DE TRAINEE
+! drag
+
+! d : DIAMETRE DE LA PARTICULE
+! p
+
+! U [X (t),t] : VITESSE INSTANTANEE DU FLUIDE VU
+! f p
+
+! V (t) : VITESSE DE LA PARTICULE
+! p
+
+! CE SOUS PROGRAMME EST APPELE DANS UNE BOUCLE SUR
+! LES PARTICULES : ATTENTION DE NE PAS TROP LE CHARGER
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! nphas ! e ! <-- ! nombre de phases !
+! nbpmax ! e ! <-- ! nombre max de particulies autorise !
+! nvp ! e ! <-- ! nombre de variables particulaires !
+! nvp1 ! e ! <-- ! nvp sans position, vfluide, vpart !
+! nvep ! e ! <-- ! nombre info particulaires (reels) !
+! nivep ! e ! <-- ! nombre info particulaires (entiers) !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! numpt ! e ! <-- ! numero de la particule courante !
+! itepa ! te ! <-- ! info particulaires (entiers) !
+! (nbpmax,nivep ! ! ! (cellule de la particule,...) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! te ! --- ! macro tableau entier !
+! rep ! r ! <-- ! nombre de reynolds particulaire !
+! ! ! ! rep = uvwr * ettp(numpt,jdp) / xnul !
+! uvwr ! r ! <-- ! vitesse relative de la particule !
+! ! ! ! uvwr= |vit fluide vu - vit particule| !
+! romf ! r ! <-- ! masse volumique du fluide a la !
+! ! ! ! position de la particule !
+! romp ! r ! <-- ! masse volumique de la particule !
+! xnul ! r ! <-- ! viscosite cinematique du fluide a la !
+! ! ! ! position de la particule !
+! taup ! r ! --> ! temps de relaxation particulaire !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ettp ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape courante !
+! ettpa ! tr ! <-- ! tableaux des variables liees !
+! (nbpmax,nvp) ! ! ! aux particules etape precedente !
+! tepa ! tr ! <-- ! info particulaires (reels) !
+! (nbpmax,nvep) ! ! ! (poids statistiques,...) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "cstnum.h"
+include "cstphy.h"
+include "optcal.h"
+include "entsor.h"
+include "lagpar.h"
+include "lagran.h"
+include "ppppar.h"
+include "ppthch.h"
+include "ppincl.h"
+include "cpincl.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , nphas
+integer nbpmax , nvp , nvp1 , nvep , nivep
+integer nideve , nrdeve , nituse , nrtuse
+integer numpt
+integer itepa(nbpmax,nivep)
+integer idevel(nideve), ituser(nituse)
+integer ia(*)
+
+double precision rep , uvwr , romf , romp , xnul , taup
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac) , surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac) , cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod) , volume(ncelet)
+double precision dt(ncelet) , rtp(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*) , propfb(nfabor,*)
+double precision ettp(nbpmax,nvp) , ettpa(nbpmax,nvp)
+double precision tepa(nbpmax,nvep)
+double precision rdevel(nrdeve), rtuser(nrtuse)
+double precision ra(*)
+
+! VARIABLES LOCALES
+
+integer idebia, idebra
+integer ip
+double precision fdr
+
+! VARIABLES LOCALES UTILISATEUR
+
+double precision cd1 , cd2 , d2
+double precision rec1, rec2, rec3, rec4
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 0. GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. INITIALISATIONS
+!===============================================================================
+
+ip = numpt
+
+!===============================================================================
+! 2. TEMPS DE RELAXATION AVEC LE COEFFICIENT DE TRAINEE STANDARD
+!===============================================================================
+
+! Cet exemple est desactive, il donne le temps de relaxation
+! standard a titre indicatif.
+
+if (1.eq.0) then
+
+ cd1 = 0.15d0
+ cd2 = 0.687d0
+
+ if (rep.le.1000) then
+ d2 = ettp(ip,jdp) * ettp(ip,jdp)
+ fdr = 18.d0 * xnul * (1.d0 + cd1 * rep**cd2) / d2
+ else
+ fdr = (0.44d0 * 3.d0 / 4.d0) * uvwr / ettp(ip,jdp)
+ endif
+
+ taup = romp / romf / fdr
+
+endif
+
+!===============================================================================
+! 3. CALCUL DU TEMPS DE RELAXATION AVEC LE COEFFICIENT DE TRAINEE DE
+! MORSI S.A. et ALEXANDER A.J.,
+! Journal of Fluid Mechanics Vol.55, pp 193-208 (1972)
+!===============================================================================
+
+rec1 = 0.1d0
+rec2 = 1.0d0
+rec3 = 10.d0
+rec4 = 200.d0
+
+d2 = ettp(ip,jdp) * ettp(ip,jdp)
+
+if ( rep.le.rec1 ) then
+ fdr = 18.d0 * xnul / d2
+
+else if ( rep.le.rec2 ) then
+ fdr = 3.d0/4.d0 * xnul / d2 &
+ * (22.73d0 + 0.0903d0/rep + 3.69d0*rep )
+
+else if ( rep.le.rec3 ) then
+ fdr = 3.d0/4.d0 * xnul / d2 &
+ * (29.1667d0 - 3.8889d0/rep + 1.222d0*rep)
+
+else if ( rep.le.rec4 ) then
+ fdr = 18.d0*xnul/d2 *(1.d0 + 0.15d0*rep**0.687d0)
+
+else
+ fdr = (0.44d0 * 3.d0 / 4.d0) * uvwr / ettp(ip,jdp)
+endif
+
+taup = romp / romf / fdr
+
+
+!==============================================================================
+
+!--------
+! FORMATS
+!--------
+
+
+!----
+! FIN
+!----
+
+end
diff --git a/users/pprt/usppmo.f90 b/users/pprt/usppmo.f90
new file mode 100644
index 0000000..73f3b84
--- /dev/null
+++ b/users/pprt/usppmo.f90
@@ -0,0 +1,257 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2009 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usppmo
+!================
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+! ROUTINE UTILISATEUR
+! UTILISATION OU NON D'UNE PHYSIQUE PARTICULIERE
+
+
+! UNE SEULE PHYSIQUE PARTICULIERE A LA FOIS.
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "entsor.h"
+include "pointe.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "coincl.h"
+include "cpincl.h"
+include "fuincl.h"
+include "ppincl.h"
+include "ppcpfu.h"
+include "atincl.h"
+
+!===============================================================================
+
+
+
+!===============================================================================
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) then
+ return
+endif
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+!===============================================================================
+! 1. DECLENCHEMENT DE L UTILISATION D'UNE PHYSIQUE PARTICULIERE
+!===============================================================================
+
+
+! ---- COD3P Flamme de diffusion en chimie complete rapide (3 points)
+! si = -1 modele non utilise
+! si = 0 modele utilise dans les conditions adiabatiques
+! si = 1 modele utilise dans les conditions permeatiques
+
+ippmod(icod3p) = -1
+
+
+!----- CODEQ Flamme de diffusion en chimie rapide vers l'equilibre
+! ATTENTION : la version CODEQ n'EST PAS OPERATIONNELLE
+! ==========
+! si = -1 modele non utilise
+ippmod(icodeq) = -1
+
+
+!----- COEBU Flamme premelangee en Eddy Break Up
+! si = -1 modele non utilise
+! si = 0 modele utilise dans les conditions adiabatiques
+! si = 1 modele utilise dans les conditions permeatiques (H)
+! si = 2 conditions adiabatiques avec transport de f
+! si = 3 conditions permeatique (H) avec transport de f
+
+ippmod(icoebu) = -1
+
+
+!----- COBML premelange avec le modele Bray - Moss - Libby
+! ATTENTION : la version COBML n'EST PAS OPERATIONNELLE
+! ==========
+! si = -1 modele non utilise
+ippmod(icobml) = -1
+
+
+!----- COLWC non parfaitement premelange Libby Williams
+! si = -1 modele non utilise
+! si = 0 modele a 2 pics dans les conditions adiabatiques
+! si = 1 modele a 2 pics dans les conditions permeatiques
+! (suppose rayonnement)
+! si = 2 modele a 3 pics dans les conditions adiabatiques
+! si = 3 modele a 3 pics dans les conditions permeatiques
+! (suppose rayonnement)
+! si = 4 modele a 4 pics dans les conditions adiabatiques
+! si = 5 modele a 4 pics dans les conditions permeatiques
+! (suppose rayonnement)
+
+ippmod(icolwc) = -1
+
+
+!----- Charbon pulverise avec trois combustibles gazeux et
+! granulometrie.
+! CP3PL Combustible moyen local
+! IPPMOD(ICP...) = 0 : Transport d'H2
+! IPPMOD(ICP...) = 1 : Transport d'H2 + sechage
+ippmod(icp3pl) = -1
+
+! Prise en compte de la comb. Heterog par le CO2 : attention il
+! faut activer l'option "Equation sur le CO2"
+
+ihtco2 = 0
+
+
+!----- Charbon pulverise couple lagrangien avec trois combustibles
+! gazeux et granulometrie.
+! IPPMOD(ICPL3C) =-1 : Modele non utilise
+! IPPMOD(ICPL3C) = 0 : Transport d'H2
+! IPPMOD(ICPL3C) = 1 : Transport d'H2 + sechage (non operationnel)
+
+ippmod(icpl3c) = -1
+
+
+!----- Combustion Fuel
+! IPPMOD(ICFUEL) =-1 : modele non utilise
+! IPPMOD(ICFUEL) = 0 : modele active
+
+ippmod(icfuel) = -1
+
+!----- MODEL NOx : pour l'instant on le met ici mais il
+! faudrait le deplacer, mais ou?
+! Valable uniquement pour le Fuel
+
+! IEQNOX = 1 ----> Model NOx
+
+ieqnox = 0
+
+!----- Equation sur YCO2 : pour l'instant on le met ici mais il
+! faudrait le deplacer, mais ou?
+! Valable pour le charbon et pour le Fuel
+
+! IEQCO2 = 1 ----> Transport de CO2
+
+ieqco2 = 0
+
+!----- COMPF compressible sans choc
+! ==========
+! si = -1 modele non utilise
+! si = 0 modele active
+ippmod(icompf) = -1
+
+!----- VERSIONS ELECTRIQUES
+! Equation de l'energie obligatoire --> |IPPMOD(IEL...)| >= 1
+! + Possibilite de constituants
+
+! ELJOU : Effet Joule
+! IPPMOD(IELJOU) = 1 : Potentiel reel
+! IPPMOD(IELJOU) = 2 : Potentiel complexe
+! IPPMOD(IELJOU) = 3 : Potentiel reel + CDL Transfo
+! IPPMOD(IELJOU) = 4 : Potentiel complexe + CDL Transfo
+
+ippmod(ieljou) = -1
+
+! ELARC : Arc electrique
+! IPPMOD(IELARC) = 1 : Potentiel electrique
+! IPPMOD(IELARC) = 2 : Potentiel electrique +
+! Potentiel vecteur (=>3D)
+
+ippmod(ielarc) = -1
+
+! ELION : Mobilite ionique
+! IPPMOD(IELION) = 1 : Potentiel electrique
+
+! ATTENTION : la version ELION n'EST PAS OPERATIONNELLE
+! ==========
+
+ippmod(ielion) = -1
+
+!----- ATMOS ecoulements atmospheriques
+! si = -1 modele non utilise
+! si = 0 modele active
+! si = 1 atmosphere seche
+! si = 2 atmosphere humide (non operationnelle)
+ippmod(iatmos) = -1
+
+!----- Aerorefrigerants (cooling tower)
+! si = -1 non utilise
+! si = 0 active sans modele
+! si = 1 active avec modele de Poppe
+! si = 2 active avec modele de Merkel
+ippmod(iaeros) = -1
+
+!===============================================================================
+! 2. CHOIX DU FICHIER THERMOCHIMIE DANS LE CAS DE LA COMBUSTION GAZ
+!===============================================================================
+
+
+!-----Si INDJON=1 on utilise une tabulation ENTH-TEMP calculee par JANAF
+! sinon, l'utilisateur doit lui m�me fournir sa propre tabulation
+
+indjon = 1
+
+!----
+! FORMATS
+!----
+return
+end
diff --git a/users/rayt/usray1.f90 b/users/rayt/usray1.f90
new file mode 100644
index 0000000..1901c6b
--- /dev/null
+++ b/users/rayt/usray1.f90
@@ -0,0 +1,342 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+subroutine usray1
+!================
+
+
+
+!===============================================================================
+! FONCTION :
+! ---------
+
+
+! ============================================================
+! ROUTINE UTILISATEUR : INITIALISATION DES COMMONS RAYONNEMENT
+! ============================================================
+
+
+
+! CALCUL DES FLUX ET DU TERME SOURCE RADIATIFS
+
+! METHODE DES VOLUMES FINIS.
+
+
+! 1/ DONNEES DES LUMINANCES ENTRANTES AUX LIMITES DU DOMAINE
+! (C .L : REFLEXION ET EMISSION ISOTROPE)
+
+! -> -> ->
+! 2/ CALCUL DE LA LUMINANCE L( X , S ) AU POINT X
+
+! D L
+! PAR RESOLUTION DE L'EQUATION : --- = -TK.L +TS
+! D S
+! -> o
+! OU ENCORE : DIV (L.S ) = -TK.L + TK.L
+
+! -> / -> -> ->
+! 3/ CALCUL DES DENSITES DE FLUX Q = / L( X , S ).S DOMEGA
+! /4.PI
+
+! / -> ->
+! ET DE L'ABSORPTION SA= / L( X , S ). DOMEGA
+! /4.PI
+
+! PAR INTEGRATION DES LUMINANCES SUR LES ANGLES SOLIDES.
+
+! N . B : CA SERT A CALCULER LE TAUX D'ECHAUFFEMENT
+! -----
+! / -> -> -> ->
+! 4/ CALCUL DU FLUX INCIDENT QINCID = / L( X , S ).S . N DOMEGA
+! /->->
+! -> / S.N >0
+! N NORMALE FLUIDE VERS PAROI
+
+
+
+
+!-------------------------------------------------------------------------------
+! Arguments
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "dimens.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "radiat.h"
+
+!===============================================================================
+
+integer iphas, ipp
+character*2 num
+
+integer ipass
+data ipass /0/
+save ipass
+
+!===============================================================================
+
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+if(1.eq.1) return
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+ipass = ipass + 1
+
+if (ipass.eq.1 .or. ipass.eq.2) then
+
+!===============================================================================
+! 1. UTILISATION DU MODULE DE TRANSFERTS RADIATIFS
+!===============================================================================
+
+!--> IIRAYO = 0 : PAS DE TRANSFERTS RADIATIFS (PAR DEFAUT)
+! = 1 : TRANSFERTS RADIATIFS, METHODE DES ORDONNEES DISCRETES
+! = 2 : TRANSFERTS RADIATIFS, APPROXIMATION P-1
+
+ iirayo = 1
+
+endif
+
+!===============================================================================
+! 2. PARAMETRES DU MODULE DE TRANSFERTS RADIATIFS
+!===============================================================================
+
+if (ipass.eq.2) then
+
+!--> INDICATEUR SUITE DE CALCUL (LECTURE DU FICHIER SUITE DE RAYONNEMENT)
+! (0 : PAS DE LECTURE D'UN FICHIER SUITE DE RAYONNEMENT
+! 1 : RELECTURE D'UN FICHIER SUITE DE RAYONNEMENT
+! ISUITE : RELECTURE D'UN FICHIER SUITE DE RAYONNEMENT SI LE CALCUL FLUIDE EST
+! AUSSI UNE SUITE )
+
+ isuird = isuite
+
+!--> FREQUENCE DE PASSAGE DANS LE MODULE DE RAYONNEMENT
+
+ nfreqr = 1
+
+!--> NOMBRE DE DIRECTIONS : 32 OU 128 (UTILE UNIQUEMENT SI IIRAYO=1)
+
+ ndirec = 32
+
+!--> INITIALISATION DU MODE DE CALCUL DU TERME SOURCE RADIATIF EXPLICITE
+! IDIVER = 0 => CALCUL SEMI-ANALYTIQUE
+! IDIVER = 1 => CALCUL CONSERVATIF
+! IDIVER = 2 => CALCUL SEMI-ANALYTIQUE CORRIGE POUR ETRE CONSERVATIF
+! (EN RAYONNEMENT TRANSPARENT, LE CHOIX EST SANS INFLUENCE)
+
+ idiver = 2
+
+!--> NIVEAU D'AFFICHAGE (0,1,2) DES RENSEIGNEMENTS TEMPERATURE DE PAROI
+
+ iimpar = 1
+
+!--> NIVEAU D'AFFICHAGE (0,1,2) DES RENSEIGNEMENTS SOLVEUR
+
+ iimlum = 0
+
+!--> SI COMBUSTION GAZ OU CHARBON : CALCUL AUTOMATIQUE
+! DU COEFFICIENT D'ABSORPTION
+
+! IMODAK = 0 : PAS DE CALCUL AUTOMATIQUE (DEFAUT)
+! = 1 : CALCUL AUTOMATIQUE (MODELE DE MODAK)
+
+ imodak = 0
+
+endif
+
+!===============================================================================
+! 3. RENSEIGNEMENTS POUR LE POST-PROCESSING
+!===============================================================================
+
+if (ipass.eq.3) then
+
+!===============================================================================
+! 3.1 VARIABLE DU MILIEU SEMI-TRANSPARENT
+!===============================================================================
+
+
+! ICHRVR( ) = sortie chono (oui 1/non 0)
+! ILISVR( ) = suivi listing (oui 1/non 0)
+! IHISVR( ) = sortie historique (nombre de sondes et numeros)
+! si IHISVR( .,1) = -1 sortie sur toutes les sondes definies
+! dans usini1
+
+!--> LUMINENCE
+
+ ipp = ipppro(ipproc(ilumin))
+ nomvar(IPP) = 'Lumin'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+!--> VECTEUR DENSITE DE FLUX RADIATIF
+
+! composante x
+ ipp = ipppro(ipproc(iqx))
+ nomvar(IPP) = 'Qxrad'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+! composante y
+ ipp = ipppro(ipproc(iqy))
+ nomvar(IPP) = 'Qyrad'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+! composante z
+ ipp = ipppro(ipproc(iqz))
+ nomvar(IPP) = 'Qzrad'
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+
+ do iphas = 1,nphasc
+
+ write(num,'(I1)') iphas
+
+!--> TERME SOURCE RADIATIF (ANALYTIQUE/CONSERVATIF/SEMI-ANALYTIQUE)
+
+ ipp = ipppro(ipproc(itsre(iphas)))
+ nomvar(IPP) = 'Srad'//num
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+!--> PART DE L'ABSORPTION DANS LE TERME SOURCE RADIATIF
+
+ ipp = ipppro(ipproc(iabs(iphas)))
+ nomvar(IPP) = 'Absorp'//num
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+!--> PART DE L'EMISSION DANS LE TERME SOURCE RADIATIF
+
+ ipp = ipppro(ipproc(iemi(iphas)))
+ nomvar(IPP) = 'Emiss'//num
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+!--> COEFFICIENT D'ABSORPTION DU MILIEU SEMI-TRANSPARENT
+
+ ipp = ipppro(ipproc(icak(iphas)))
+ nomvar(IPP) = 'CoefAb_'//num
+ ichrvr(ipp) = 0
+ ilisvr(ipp) = 0
+ ihisvr(ipp,1) = -1
+
+ enddo
+
+!===============================================================================
+! 3.2 VARIABLE SUR LES FRONTIERES DE TYPE PAROI DU DOMAINE DE CALCUL
+!===============================================================================
+
+!=======================================================================
+! * IL FAUT METTRE LA VALEUR DE IRAYVF A 1 POUR LA VISUALISATION *
+!=======================================================================
+
+!--> TEMPERATURE DES FACES FRONTIERES DE PAROI
+
+ nbrvaf(itparp) = 'Temp_paroi'
+ irayvf(itparp) = 0
+
+!--> FLUX INCIDENT RADIATIF RECU PAR LES FACES FRONTIERES DE PAROI
+
+ nbrvaf(iqincp) = 'Flux_incident'
+ irayvf(iqincp) = 0
+
+!--> CONDUCTIVITE THERMIQUES DES FACES FRONTIERES DE PAROIS
+
+ nbrvaf(ixlamp) = 'Conductivite_th'
+ irayvf(ixlamp) = 0
+
+!--> EPAISSEUR DES FACES FRONTIERES DE PAROIS
+
+ nbrvaf(iepap) = 'Epaisseur'
+ irayvf(iepap) = 0
+
+!--> EMISSIVITE DES FACES FRONTIERES DE PAROIS
+
+ nbrvaf(iepsp) = 'Emissivite'
+ irayvf(iepsp) = 0
+
+!--> FLUX NET RADIATIF AUX FACES FRONTIERES DE PAROIS
+
+ nbrvaf(ifnetp) = 'Flux_net'
+ irayvf(ifnetp) = 0
+
+!--> FLUX CONVECTIF AUX FACES FRONTIERES DE PAROIS
+
+ nbrvaf(ifconp) = 'Flux_convectif'
+ irayvf(ifconp) = 0
+
+!--> COEFFICIENT D'ECHANGE CONVECTIF AUX FACES FRONTIERES DE PAROIS
+
+ nbrvaf(ihconp) = 'Coef_ech_convectif'
+ irayvf(ihconp) = 0
+
+!===============================================================================
+
+endif
+
+return
+
+end
diff --git a/users/rayt/usray2.f90 b/users/rayt/usray2.f90
new file mode 100644
index 0000000..d9a6896
--- /dev/null
+++ b/users/rayt/usray2.f90
@@ -0,0 +1,881 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usray2 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ maxelt , lstelt , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ icodcl , izfrdp , isothp , &
+ tmin , tmax , tx , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , rcodcl , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , &
+ tparop , qincid , hfcnvp , flcnvp , &
+ xlamp , epap , epsp , textp , tintp , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+! CARACTERISTIQUES ET COMPORTEMENT RADIATIF DES FACES DE PAROI
+
+! Ce sous-programme est appele autant de fois qu'il y a de phases
+! pour lesquelles il faut faire un calcul de rayonnement
+! semi-transparent
+
+! IPHAS contient le numero absolu de la phase concernee
+
+
+
+! EXTERIEUR PAROI DOMAINE FLUIDE
+! | |
+! | |
+! | |
+! | EPSP Qincid<--|<----- Qincid [flux incident]
+! | |
+! | [absorption] |
+! | |
+! | |-----> (1-EPSP) Qincid [reflexion]
+! | |
+! | |
+! | | 4
+! | |-----> EPSP sigma Tparop [emission]
+! | |
+! | |
+! | |
+! | [conduction] | .....o Tfluide [convection]
+! | | .
+! | XLAMP | . Hfluide
+! | | .
+! | ...o..
+! | .. | Tparop (temperature en paroi)
+! | . |
+! | .. |
+! | . |
+! | .. |
+! | . |
+! o... |
+! Textp| |
+! | |
+! |<------------->|
+! | EPAP |
+! | |
+
+
+! LE CALCUL DES TEMPERATURES EST REALISEE PAR UN BILAN DE FLUX
+! COMME SUIT :
+
+! Q = Q + (Qrayt - Qrayt )
+! conduction convection absorption emission
+
+! SOIT (flux positif si sortant du domaine de calcul) :
+
+! XLAMP
+! -----(Tparop-Textp) =
+! EPAP
+! 4
+! Hfluide (Tfluide-Tparop) + EPSP (QINCID - SIGMA Tparop )
+
+
+! CORPS EPSP
+! ------------------------------------
+! acier poli 0,06
+! acier oxyd� 0,80
+! aceir rugueux 0,94
+! aluminium poli 0,04
+! aluminium oxyd� (int�rieur) 0,09
+! aluminium oxyd� (air humide) 0,90
+! brique 0,93
+! b�ton 0,93
+! papier 0,8 � 0,9
+! eau 0,96
+
+
+! IDENTIFICATION DES FACES DE PAROI
+! =================================
+! L'identification des faces de bord concernees se fait grace
+! a la commande GETFBR.
+
+! GETFBR(CHAINE,NLELT,LSTELT) :
+! - CHAINE est une chaine de caractere fournie par l'utilisateur
+! qui donne les criteres de selection
+! - NLTELT est renvoye par la commande. C'est un entier qui
+! correspond au nombre de faces de bord trouveees repondant au
+! critere
+! - LSTELT est renvoye par la commande. C'est un tableau d'entiers
+! de taille NLTELT donnant la liste des faces de bord trouvees
+! repondant au critere.
+
+! CHAINE peut etre constitue de :
+! - references de couleurs (ex. : 1, 8, 26, ...
+! - references de groupes (ex. : entrees, groupe1, ...)
+! - criteres geometriques (ex. X<0.1, Y>=0.25, ...)
+! Ces criteres peuvent etre combines par des operateurs logiques
+! (AND et OR) et des parentheses
+! ex. : '1 AND (groupe2 OR groupe3) AND Y<1' permettra de recuperer
+! les faces de bord de couleur 1, appartenant aux groupes 'groupe2'
+! ou 'groupe3' et de coordonnee Y inferieure a 1.
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! maxelt ! e ! <-- ! nb max d'elements (cell,fac,fbr) !
+! lstelt(maxelt) te ! --- ! tableau de travail !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! icodcl ! te ! <-- ! code de condition limites aux faces !
+! (nfabor,nvar ! ! ! de bord !
+! ! ! ! = 1 -> dirichlet !
+! ! ! ! = 3 -> densite de flux !
+! ! ! ! = 4 -> glissemt et u.n=0 (vitesse) !
+! ! ! ! = 5 -> frottemt et u.n=0 (vitesse) !
+! ! ! ! = 6 -> rugosite et u.n=0 (vitesse) !
+! ! ! ! = 9 -> entree/sortie libre (vitesse !
+! ! ! ! entrante eventuelle bloquee !
+! izfrdp(nfabor ! te ! --> ! numero de zone pour les faces de bord !
+! isothp(nfabor ! te ! --> ! liste des frontieres isothermes !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! rcodcl ! tr ! --> ! valeur des conditions aux limites !
+! (nfabor,nvar ! ! ! aux faces de bord !
+! ! ! ! rcodcl(1) = valeur du dirichlet !
+! ! ! ! rcodcl(2) = valeur du coef. d'echange !
+! ! ! ! ext. (infinie si pas d'echange) !
+! ! ! ! rcodcl(3) = valeur de la densite de !
+! ! ! ! flux (negatif si gain) w/m2 ou !
+! ! ! ! hauteur de rugosite (m) si icodcl=6 !
+! ! ! ! pour les vitesses (vistl+visct)*gradu !
+! ! ! ! pour la pression dt*gradp !
+! ! ! ! pour les scalaires !
+! ! ! ! cp*(viscls+visct/sigmas)*gradt !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! tparop(nfabor ! tr ! <-- ! temperature de paroi en kelvin !
+! qincid(nfabor ! tr ! <-- ! densite de flux radiatif aux bords !
+! hfcnvp(nfabor ! tr ! <-- ! coefficient d'echange fluide aux !
+! ! ! ! faces de bord !
+! flcnvp(nfabor ! tr ! <-- ! densite de flux convectif aux faces !
+! ! ! ! de bord !
+! xlamp(nfabor) ! tr ! --> ! coefficient de conductivite thermique !
+! ! ! ! des facettes de paroi (w/m/k) !
+! epap(nfabor) ! tr ! --> ! epaisseur des facettes de paroi (m) !
+! epsp (nfabor) ! tr ! --> ! emissivite des facettes de bord !
+! textp(nfabor) ! tr ! --> ! temperature de bord externe !
+! ! ! ! en kelvin !
+! tintp(nfabor) ! tr ! --> ! temperature de bord interne !
+! ! ! ! en kelvin !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "radiat.h"
+include "ihmpre.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor,*)
+integer maxelt, lstelt(maxelt)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+integer icodcl(nfabor,nvar)
+integer izfrdp(nfabor), isothp(nfabor)
+
+double precision tmin , tmax , tx
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision rcodcl(nfabor,nvar,3)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+
+double precision tparop(nfabor), qincid(nfabor)
+double precision hfcnvp(nfabor),flcnvp(nfabor)
+double precision xlamp(nfabor), epap(nfabor)
+double precision epsp(nfabor)
+double precision textp(nfabor), tintp(nfabor)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer ifac , ivar, iok
+integer ilelt, nlelt
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if (iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9000)
+ call csexit (1)
+ !==========
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usray2 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+!===============================================================================
+! 0. GESTION MEMOIRE
+! Aucune modification requise
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1. NUMERO DE LA VARIABLE THERMIQUE
+
+! Noter que TKELVI, disponible ici, contient 273.16D0
+! Noter que SIG , disponible ici, contient 5.6703D-8
+!===============================================================================
+
+! IVAR est le numero de la variable thermique.
+
+ivar = isca(iscalt(iphas))
+
+
+!===============================================================================
+! 2. VALEURS MIN ET MAX ADMISSIBLES POUR LA TEMPERATURE DE PAROI
+! (clipping)
+
+
+
+! EN KELVIN
+
+
+! (quel que soit le choix fait pour la variable thermique)
+
+
+
+
+! TMIN et TMAX sont respectivement les valeurs minimale et maximale
+! autorisees pour les temperatures de paroi. A chaque nouveau
+! calcul de temperature de paroi, on verifie qu'il n'y a pas
+! depassement, sinon il y a clipping.
+
+! L'exemple ci-dessous correspond a un clipping tres peu contraignant.
+! (valeurs par defaut)
+
+!===============================================================================
+
+tmin = 0.d0
+tmax = grand + tkelvi
+
+!===============================================================================
+! 3. ZONES FRONTIERE ET PROPRIETES DES PAROIS
+!===============================================================================
+
+
+! DEFINITION DES ZONES FRONTIERES
+! ===============================
+
+! On definit des zones de faces de paroi, et on leur affecte un type.
+! Ceci permet d'appliquer les conditions aux limites et de realiser
+! des bilans en traitant separement les differents sous ensembles
+! ainsi constitues (on peut ainsi connaitre par exemple le flux au
+! travers des differentes zones definies par l'utilisateur).
+
+! Pour chaque face de bord IFAC (pas uniquement les faces de paroi),
+! l'utilisateur definit selon son propre choix un numero de zone
+! frontiere IZFRDP(IFAC) a partir
+! de la couleur des faces de bord,
+! ou, plus generalement, de leurs proprietes (couleurs, groupes...),
+! ou des conditions aux limites fixees dans usclim,
+! ou meme de leur coordonnees.
+! Attention : il est indispensable que TOUTES les faces de bord
+! aient ete affectees a une zone.
+! Le numero des zones (la valeur de IZFRDP(IFAC)) est
+! arbitrairement choisi par l'utilisateur, mais doit etre un
+! entier strictement positif et inferieur ou egal a NBZRDM
+! (valeur fixee en parametre dans radiat.h, a ne pas modifier).
+
+
+
+! PROPRIETES DES PAROIS
+! =====================
+
+
+! ATTENTION :
+! ---------
+
+! L'unite des temperatures est le KELVIN
+
+! quel que soit le choix de resolution fait par ailleurs
+
+
+
+! DONNEES OBLIGATOIRES :
+! --------------------
+
+! ISOTHP = ITPIMP
+! repere les facettes de paroi a temperature imposee
+! ("Indicateur Temperature Paroi IMPosee" ou "isotherme")
+! la temperature a imposer est TINTP(Kelvin)
+! = IPGRNO ou IPREFL
+! repere une facette de paroi dont il faut calculer
+! la temperature (un bilan de flux sera fait).
+! IPGRNO : Indicateur de Paroi GRise ou NOire (EPSP > 0)
+! IPREFL : Indicateur de Paroi REFLechissante (EPSP = 0)
+! = IFGRNO ou IFREFL
+! repere une facette de paroi pour laquelle on impose un
+! flux (conductif en paroi ou total sur le fluide)
+! IFGRNO : Indicateur de Flux en paroi GRise ou NOire
+! IFREFL : Indicateur de Flux en paroi REFLechissante
+
+! TINTP = Temperature de peau interne (KELVIN)
+! sert a l'initialisation de TPAROP en debut de calcul
+! (lorsqu'il n'y a pas de fichier suite rayonnement)
+! Si ISOTHP = ITPIMP, la valeur de TPAROP est egale a
+! celle imposee dans TINTP a chaque pas de temps
+! Dans les autres cas, TINTP ne sert qu'a l'initialisation.
+
+
+! RENSEIGNEMENTS COMLEMENTAIRES A FOURNIR SUIVANT ISOTHP (VOIR EXEMPLES)
+! --------------------------------------------------------------------
+
+! RCODCL = valeur de flux (voir USCLIM pour la definition)
+
+! EPSP = Emissivite aux facettes de paroi (dans l'intervalle [0;1])
+
+! XLAMP = Conductivite thermique des parois (W/m/K)
+! > 0 quand il est renseigne
+
+! EPAP = Epaisseur des parois (m)
+! > 0 quand il est renseigne
+
+! TEXTP = Temperature de peau externe en KELVIN
+! > 0 quand il est renseigne
+
+
+
+! EXEMPLE
+! =======
+
+! Attention a la coherence avec USCLIM
+
+! Dans cet EXEMPLE,
+! -------
+
+! Les faces de paroi (IPAROI et IPARUG), sont reparties en
+! 5 sous ensembles (zones) reperes par IFRFAC(IFAC) variant de
+! 51 a 55 (arbitraire) a chacun desquels on applique une
+! condition (ISOTHP) differente.
+! Les autres faces de bord (entree, sortie, sous-ensembles
+! arbitraires sur lesquels on souhaite voir imprimer des
+! informations) sont repartis en zones reperees
+! par IFRFAC(IFAC), dont la valeur peut etre arbitrairement
+! choisie (>0 et <NBZRDM+1).
+
+! Remarque : une maniere simple (mais non generale) d'affecter
+! rapidement des valeurs a IFRFAC est IFRFAC(IFAC) = ICOUL,
+! ou ICOUL est la couleur de la face.
+
+
+
+
+
+
+
+
+
+
+! DANS TOUS LES CAS, IL EST INTERDIT
+! ========
+
+! DE MODIFIER TPAROP ou QINCID ICI.
+
+
+
+
+
+
+
+
+! Indicateur : nombre de faces oubliees.
+iok = 0
+
+! -------------------------------------------------------------------
+!--> Exemple 1 :
+! Pour les faces PAROI de couleur 1 :
+! Profil de temperature imposee
+! ------------------------------------
+
+CALL GETFBR('1',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ if ( itypfb(ifac,iphas).eq.iparoi ) then
+
+! Numero de zone
+ izfrdp(ifac) = 51
+
+! Type de condition : Paroi grise ou noire et
+! Profil de temperature imposee TINTP
+ isothp(ifac) = itpimp
+
+! Donnees complementaires necessaires et suffisantes
+! Emissivite
+ epsp (ifac) = 0.1d0
+! Temperature de paroi imposee ("Profil" simple ici = 473.16 K)
+ tintp (ifac) = 200.d0 + tkelvi
+
+ endif
+
+enddo
+
+! -------------------------------------------------------------------
+!--> Exemple 2 :
+! Pour les faces PAROI RUGUEUSE de couleur 2 :
+! Paroi grise ou noire et
+! Profil de temperature imposee TEXTP
+! ------------------------------------
+
+CALL GETFBR('2',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ if ( itypfb(ifac,iphas).eq.iparug ) then
+
+! Numero de zone
+ izfrdp(ifac) = 52
+
+! Type de condition : Paroi grise ou noire et
+! Profil de temperature imposee TEXTP
+ isothp(ifac) = ipgrno
+
+! Donnees complementaires necessaires et suffisantes
+! Emissivite (>0)
+ epsp (ifac) = 0.9d0
+! Conductivite (W/m/K)
+ xlamp (ifac) = 3.0d0
+! Epaisseur (m)
+ epap (ifac) = 0.1d0
+! Temperature externe imposee : 473.16 K
+ textp (ifac) = 200.d0 + tkelvi
+! Temperature de paroi initiale : 473.16 K
+ tintp (ifac) = 200.d0 + tkelvi
+
+ endif
+
+enddo
+
+! -------------------------------------------------------------------
+!--> Exemple 3 :
+! Pour les faces PAROI de couleur 3 :
+! Paroi reflechissante (EPSP = 0) et
+! Profil de temperature imposee TEXTP
+! ------------------------------------
+
+CALL GETFBR('3',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ if ( itypfb(ifac,iphas).eq.iparoi ) then
+
+! Numero de zone
+ izfrdp(ifac) = 53
+
+! Type de condition : Paroi reflechissante (EPSP = 0) et
+! Profil de temperature imposee TEXTP
+ isothp(ifac) = iprefl
+
+! Donnees complementaires necessaires et suffisantes
+! Conductivite (W/m/K)
+ xlamp (ifac) = 3.0d0
+! Epaisseur (m)
+ epap (ifac) = 0.1d0
+! Temperature externe imposee : 473.16 K
+ textp (ifac) = 200.d0 + tkelvi
+! Temperature de paroi initiale : 473.16 K
+ tintp (ifac) = 200.d0 + tkelvi
+
+ endif
+
+enddo
+
+! -------------------------------------------------------------------
+!--> Exemple 4 :
+! Pour les faces PAROI de couleur 4 :
+! Paroi grise ou noire et
+! Flux de conduction impose dans la paroi
+
+! XLAMP
+! -----(Tparop-Textp) = Flux de conduction impose (W/m2)
+! EPAP
+! = RODCL(IFAC,IVAR,3)
+
+! Si le flux de conduction est nul la paroi est adiabatique
+! Le tableau RCODCL(IFAC,IVAR,3) recoit la valeur du flux.
+! Densite de flux (< 0 si gain pour le fluide)
+! Reprise de USCLIM :
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = CP*(VISCLS+VISCT/SIGMAS) * GRAD T
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = (VISCLS+VISCT/SIGMAS) * GRAD H
+! ------------------------------------
+
+CALL GETFBR('4',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ if ( itypfb(ifac,iphas).eq.iparoi ) then
+
+! Numero de zone
+ izfrdp(ifac) = 54
+
+! Type de condition : Paroi grise ou noire et
+! Flux de conduction impose dans la paroi
+ isothp(ifac) = ifgrno
+
+! Donnees complementaires necessaires et suffisantes
+! Emissivite (>0)
+ epsp (ifac) = 0.9d0
+! Flux de conduction (W/m2)
+ rcodcl(ifac,ivar,3) = 0.d0
+! Temperature de paroi initiale : 473.16 K
+ tintp (ifac) = 200.d0 + tkelvi
+
+ endif
+
+enddo
+
+! -------------------------------------------------------------------
+!--> Exemple 5 :
+! Pour les faces PAROI de couleur 5 :
+! Paroi reflechissante (EPSP = 0) et
+! Flux de conduction impose dans la paroi
+
+! Equivalent a imposer une condition de flux au fluide
+
+! XLAMP
+! -----(Tparop-Textp) = Flux de conduction impose ET EPSP = 0
+! EPAP
+! = RODCL(IFAC,IVAR,3)
+
+! Si le flux de conduction est nul la paroi est adiabatique
+! Le tableau RCODCL(IFAC,IVAR,3) contient la valeur du flux (W/m2)
+! imposee comme condition au limite pour le fluide
+! Densite de flux (< 0 si gain pour le fluide)
+! Reprise de USCLIM :
+! Pour les temperatures T, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = CP*(VISCLS+VISCT/SIGMAS) * GRAD T
+! Pour les enthalpies H, en Watt/m2 :
+! RCODCL(IFAC,IVAR,3) = (VISCLS+VISCT/SIGMAS) * GRAD H
+! ------------------------------------
+
+CALL GETFBR('5',NLELT,LSTELT)
+!==========
+
+do ilelt = 1, nlelt
+
+ ifac = lstelt(ilelt)
+
+ if ( itypfb(ifac,iphas).eq.iparoi ) then
+
+! Numero de zone
+ izfrdp(ifac) = 55
+
+! Type de condition : Paroi reflechissante (EPSP = 0) et
+! Flux de conduction impose dans la paroi
+ isothp(ifac) = ifrefl
+
+! Donnees complementaires necessaires et suffisantes
+! Flux de conduction (W/m2)
+ rcodcl(ifac,ivar,3) = 0.d0
+! Temperature de paroi initiale : 473.16 K
+ tintp (ifac) = 200.d0 + tkelvi
+
+ endif
+
+enddo
+
+
+
+
+
+
+
+! ATTENTION
+
+
+
+
+
+
+
+
+
+
+
+! -------------------------------------------------------------------
+!--> Pour les faces non paroi : reperage obligatoire de la zone
+! Les informations (flux par exemple) seront donnees zone par zone
+! et il est donc conseille de regrouper entre elles les faces
+! de meme nature.
+
+! PAR SECURITE
+! DANS CE SOUS-PROGRAMME
+! ON DEMANDE A L'UTILISATEUR DE REPERER TOUTES LES FACES
+! PAROI OU NON
+
+! (il est indispensable d'affecter une valeur a tous les
+! IZFRDP(IFAC), IFAC = 1, NFABOR)
+
+
+
+
+! ------------------------------------
+
+do ifac = 1, nfabor
+
+ if ( itypfb(ifac,iphas).eq.isolib ) then
+ izfrdp(ifac) = 61
+ elseif ( itypfb(ifac,iphas).eq.ientre.and. &
+ cdgfbo(2,ifac) .gt.0.d0 ) then
+ izfrdp(ifac) = 62
+ elseif ( itypfb(ifac,iphas).eq.ientre.and. &
+ cdgfbo(2,ifac) .le.0.d0 ) then
+ izfrdp(ifac) = 63
+ elseif ( itypfb(ifac,iphas).eq.isymet ) then
+ izfrdp(ifac) = 64
+
+
+
+! -------------------------------------------------------------------
+!--> Exemple 7 :
+! Verification que toutes les faces de paroi ont ete vues
+! Cette precaution est souhaitable dans tous les cas.
+! ------------------------------------
+
+ elseif ( itypfb(ifac,iphas).eq.iparoi .or. &
+ itypfb(ifac,iphas).eq.iparug ) then
+ if (izfrdp(ifac) .eq. -1) then
+ write(nfecra,1000)ifac
+ iok = iok + 1
+ endif
+ endif
+
+
+
+
+! Fin de la boucle sur les faces de bord
+! --------------------------------------
+
+enddo
+
+! Stop si des faces ont ete oubliees
+if(iok.ne.0) then
+ call csexit (1)
+ !==========
+endif
+
+! -------
+! FORMAT
+! -------
+
+
+ 1000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET A L''ENTREE DES DONNEES ',/,&
+'@ ========= ',/,&
+'@ LES DONNEES RAYONNEMENT NE SONT PAS RENSEIGNEES POUR ',/,&
+'@ LA FACE DE PAROI ',I10 ,/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier usray2. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+! ---
+! FIN
+! ---
+
+
+return
+
+end
diff --git a/users/rayt/usray3.f90 b/users/rayt/usray3.f90
new file mode 100644
index 0000000..7013377
--- /dev/null
+++ b/users/rayt/usray3.f90
@@ -0,0 +1,386 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usray3 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , iphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , izfrdp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ ck , w1 , w2 , w3 , w4 , w5 , w6 , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+
+! Coefficient d'absorption
+! -------------------------
+
+! Il est indispensable de renseigner la valeur du coefficient
+! d'absorption du fluide CK.
+
+! Pour un milieu transparent, le coefficient doit etre
+! fixe a 0.D0.
+
+! DANS LE CAS DU MODELE P-1 ON VERIFIE QUE LA LONGUEUR OPTIQUE
+! DU MILIEU EST AU MINIMUM DE L'ORDRE DE L'UNITE
+
+! ATTENTION :
+! =========
+! Pour les physiques particulieres (Combustion, charbon...)
+
+! il est INTERDIT de fournir le COEFFICIENT D'ABSORPTION ici.
+! ========
+
+! Voir le sous-programme PPCABS
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! izfrdp(nfabor ! te ! <-- ! numero de zone pour les faces de bord !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! ck (ncelet) ! tr ! --> ! coefficient d'absorption du milieu !
+! ! ! ! (nul si transparent) !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , iphas , iappel
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr),izfrdp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+
+double precision ck(ncelet)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , iel, ifac, iok
+double precision vv, sf, xlc, xkmin, pp
+
+!===============================================================================
+
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
+!===============================================================================
+
+!===============================================================================
+! 0. CE TEST PERMET A L'UTILISATEUR D'ETRE CERTAIN QUE C'EST
+! SA VERSION DU SOUS PROGRAMME QUI EST UTILISEE
+! ET NON CELLE DE LA BIBLIOTHEQUE
+!===============================================================================
+
+if (iihmpr.eq.1) then
+ return
+else
+ write(nfecra,9000)
+ call csexit (1)
+endif
+
+ 9000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : ARRET RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ LE SOUS-PROGRAMME UTILISATEUR usray3 DOIT ETRE COMPLETE',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+!===============================================================================
+! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
+
+
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! Indicateur d'arret (pour savoir si des faces ont ete oubliees)
+iok = 0
+
+!===============================================================================
+! COEFFICIENT D'ABSORPTION DU MILIEU (m-1)
+
+! DANS LE CAS DES PHYSIQUES PARTICULIERES (COMBUSTION GAZ/CHARBON/ELEC/FIOUL)
+
+! CK NE DOIT PAS ETRE FOURNI
+ !==========
+! (il est determine automatiquement, eventuellement a partir
+! du fichier parametrique)
+
+! DANS LES AUTRES CAS
+! CK DOIT ETRE COMPLETE (IL EST NUL PAR DEFAUT)
+
+
+!===============================================================================
+
+
+
+
+if( ippmod(iphpar).le.1 ) then
+
+ do iel = 1, ncel
+ ck(iel) = 0.d0
+ enddo
+
+!--> MODELE P1 : Controle standard des valeurs du coefficient
+! d'absorption. Ce coefficient doit assurer une
+! longueur optique au minimum de l'ordre de l'unite.
+
+ if (iirayo.eq.2) then
+ sf = 0.d0
+ vv = 0.d0
+
+! Calcul de la longueur caract�ristique du domaine de calcul
+
+ do ifac = 1,nfabor
+ sf = sf + sqrt( &
+ surfbo(1,ifac)**2 + &
+ surfbo(2,ifac)**2 + &
+ surfbo(3,ifac)**2 )
+ enddo
+ if (irangp.ge.0) then
+ call parsom(sf)
+ !==========
+ endif
+
+ do iel = 1,ncel
+ vv = vv + volume(iel)
+ enddo
+ if (irangp.ge.0) then
+ call parsom(vv)
+ !==========
+ endif
+
+ xlc = 3.6d0 * vv / sf
+
+! Clipping pour la variable CK
+
+ xkmin = 1.d0 / xlc
+
+ iok = 0
+
+ do iel = 1,ncel
+ if (ck(iel).lt.xkmin) then
+ iok = iok + 1
+ endif
+ enddo
+
+! Arret en fin de pas de temps si epaisseur optique trop grande
+! (ISTPP1 = 1 permet d'arreter proprement a la fin du pas de temps
+! courant).
+ pp = xnp1mx/100.0d0
+ if (dble(iok).gt.pp*dble(ncel)) then
+ write(nfecra,3000) xkmin, dble(iok)/dble(ncel)*100.d0, &
+ xnp1mx
+ istpp1 = 1
+! CALL CSEXIT (1)
+ !==========
+ endif
+ endif
+
+endif
+! -------
+! FORMATS
+! -------
+
+ 3000 format( &
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT APPROXIMATION P-1 (USRAY3) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ LA LONGUEUR OPTIQUE DU MILIEU SEMI-TRANSPARENT ',/,&
+'@ DOIT AU MOINS ETRE DE L''ORDRE DE L''UNITE POUR ETRE ',/,&
+'@ DANS LE DOMAINE D''APPLICATION DE L''APPROXIMATION P-1',/,&
+'@ CELA NE SEMBLE PAS ETRE LE CAS ICI. ',/,&
+'@ ',/,&
+'@ LE COEFFICIENT D''ABSORPTION MINIMUM POUR ASSURER CETTE ',/,&
+'@ LONGUEUR OPTIQUE EST XKMIN = ',E10.4 ,/,&
+'@ CETTE VALEUR N''EST PAS ATTEINTE POUR ', E10.4,'% ',/,&
+'@ DES CELLULES DU MAILLAGE. ',/,&
+'@ LE POURCENTAGE DE CELLULES DU MAILLAGE POUR LESQUELLES ',/,&
+'@ ON ADMET QUE CETTE CONDITION SOIT VIOLEE EST IMPOSE ',/,&
+'@ PAR DEFAUT OU DANS USINI1 A XNP1MX = ', E10.4,'% ',/,&
+'@ ',/,&
+'@ Le calcul est interrompu. ',/,&
+'@ ',/,&
+'@ Verifier les valeurs du coefficient d''absorption CK ',/,&
+'@ dans PPCABS, USRAY3 ou Fichier thermochimie. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+end
diff --git a/users/rayt/usray4.f90 b/users/rayt/usray4.f90
new file mode 100644
index 0000000..0c78e3b
--- /dev/null
+++ b/users/rayt/usray4.f90
@@ -0,0 +1,299 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usray4 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , iphas , &
+ nideve , nrdeve , nituse , nrtuse , &
+ mode , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ tparop , hparop , tempk , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+
+! SOUS-PROGRAMME D'ACCUEIL DE LA ROUTINE USTHHT
+! POUR LES CONVERSIONS TEMPERATURE <-> ENTHALPIE
+
+
+
+! PRECAUTIONS D'EMPLOI :
+! ======================
+
+! A) L'ENTHALPIE DOIT ETRE CONVERTIE EN TEMPERATURE EN KELVIN
+! IL FAUT ECRIRE UNE LOI DE CONVERSION :
+! ENTHALPIE -> TEMPERATURE (MODE = 1)
+! POUR REMPLIR TEMPK
+
+
+! B) SI DE PLUS ON CALCUL LES TEMPERATURES DE PAROI (ICALPA=1)
+! ALORS IL FAUT FOURNIR UNE LOI DE CONVERSION :
+! TEMPERATURE -> ENTHALPIE (MODE = -1)
+! POUR REMPLIR HPAROP
+
+! ATTENTION : LA BONNE VALEUR DE MODE EST DONNEE EN ARGUMENT
+! ^^^^^^^^^ ELLE NE DOIT PAS ETRE MODIFIEE PAR L'UTILISATEUR
+
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! mode ! e ! <-- ! type de conversion enthal<->tempk !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! cofrua,cofrub ! tr ! --> ! conditions aux limites aux !
+!(nfabor) ! ! ! faces de bord pour la luminances !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! tempk(ncelet) ! tr ! --> ! temperature en kelvin !
+! hparop(nfabor ! tr ! --> ! enthalpie massique de paroi en j/kg !
+! ! ! ! (en degres celsius ou kelvin) !
+! tparop(nfabor ! tr ! <-- ! temperature de paroi en kelvin !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , iphas
+integer nideve , nrdeve , nituse , nrtuse
+
+integer mode
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr)
+integer idevel(nideve), ituser(nituse), ia(*)
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+
+double precision tempk(ncelet)
+double precision tparop(nfabor), hparop(nfabor)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia , idebra
+integer iel , ifac , iscal
+
+!===============================================================================
+
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+!===============================================================================
+! 1 - INITIALISATIONS GENERALES
+!===============================================================================
+
+!---> INITIALISATION DES CONSTANTES
+
+iscal = iscalt(iphas)
+
+!===============================================================================
+! 2.1 - CALCUL DE LA TEMPERATURE EN KELVIN AUX CELLULES
+!===============================================================================
+
+!---> CONVERSION ENTHALPIE -> TEMPERATURE (MODE = 1)
+! AUX CELLULES FLUIDES
+! (UTILE SI NON TRANSPARENT)
+! -----------------------------------------------
+
+
+if (mode.eq.1) then
+
+ do iel = 1,ncel
+ call usthht(mode,rtpa(iel,isca(iscal)),tempk(iel))
+ enddo
+
+endif
+
+
+!===============================================================================
+! 2.2 - CALCUL DE L'ENTHALPIE AU FACES DE BORD
+!===============================================================================
+
+!---> CONVERSION TEMPERATURE -> ENTHALPIE (MODE = -1)
+! AUX FACES DE BORD DE PAROI (ISOTHP.NE.-1) SOIT
+! (ITYPFB(IFAC).EQ.IPAROI OU IPARUG)
+
+
+if (mode.eq.-1) then
+
+ do ifac = 1,nfabor
+
+ if (itypfb(ifac).eq.iparoi .or. &
+ itypfb(ifac).eq.iparug )then
+
+ call usthht(mode,hparop(ifac),tparop(ifac))
+
+ endif
+
+ enddo
+
+endif
+
+!----
+! FIN
+!----
+
+return
+end
diff --git a/users/rayt/usray5.f90 b/users/rayt/usray5.f90
new file mode 100644
index 0000000..f8895ed
--- /dev/null
+++ b/users/rayt/usray5.f90
@@ -0,0 +1,616 @@
+!-------------------------------------------------------------------------------
+
+!VERS
+
+
+! This file is part of the Code_Saturne Kernel, element of the
+! Code_Saturne CFD tool.
+
+! Copyright (C) 1998-2008 EDF S.A., France
+
+! contact: saturne-support at edf.fr
+
+! The Code_Saturne Kernel 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.
+
+! The Code_Saturne Kernel 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 the Code_Saturne Kernel; if not, write to the
+! Free Software Foundation, Inc.,
+! 51 Franklin St, Fifth Floor,
+! Boston, MA 02110-1301 USA
+
+!-------------------------------------------------------------------------------
+
+ subroutine usray5 &
+!================
+
+ ( idbia0 , idbra0 , &
+ ndim , ncelet , ncel , nfac , nfabor , nfml , nprfml , &
+ nnod , lndfac , lndfbr , ncelbr , &
+ nvar , nscal , iphas , iappel , &
+ nideve , nrdeve , nituse , nrtuse , &
+ ifacel , ifabor , ifmfbr , ifmcel , iprfml , itypfb , &
+ ipnfac , nodfac , ipnfbr , nodfbr , izfrdp , &
+ idevel , ituser , ia , &
+ xyzcen , surfac , surfbo , cdgfac , cdgfbo , xyznod , volume , &
+ dt , rtp , rtpa , propce , propfa , propfb , &
+ coefa , coefb , &
+ cofrua , cofrub , &
+ w1 , w2 , w3 , w4 , w5 , w6 , &
+ tparoi , qincid , flunet , xlam , epa , eps , ck , &
+ rdevel , rtuser , &
+ ra )
+
+!===============================================================================
+! FONCTION :
+! ----------
+
+! SOUS-PROGRAMME DU MODULE DE RAYONNEMENT :
+! -----------------------------------------
+
+! Ce sous-programme est appele 2 fois pour chaque phase IPHAS
+! pour laquelle il faut faire un calcul de rayonnement
+! semi-transparent.
+
+
+
+! 1. PREMIER APPEL (IAPPEL = 1)
+! =============================
+
+
+
+! 1.1 Conditions aux limites pour la luminance
+! --------------------------------------------
+
+! Il faut completer COFRUA qui fournit la luminance au bord
+! selon le type de frontiere (condition de Dirichlet).
+! La luminance est la puissance surfacique par unite
+! d'angle solide
+
+
+! Par exemple, on a
+
+
+! 1/ Paroi grise : rayonnement isotrope.
+! 4
+! eps.sig.tparoi (1-eps).qincid
+! cofrua = -------------- + --------------
+! pi pi
+! luminance de bord emission propre flux reflechi.
+
+! (eps=1 : paroi noire ; eps=0 : paroi reflechissante )
+
+! Pour une paroi , la luminance (i.e l'energie rayonnee par la
+! paroi ) comprend son emission propre et l'energie reflechie.
+! (CF LE SOUS-PROGRAMME usray2)
+
+
+! 2/ Milieu libre : luminance rentrante nulle
+
+! cofrua = 0.D0
+
+! (si l'utilisateur a plus d'informations, il peut ameliorer
+! la situation)
+
+
+
+! L'exemple fourni ci-apres represente les conditions "par defaut"
+! et suffit generalement (si l'utilisateur a utilise
+! les types standard de conditions aux limites dans usclim)
+
+
+
+! 1.2 Conditions aux limites pour le modele P-1
+! ---------------------------------------------
+
+
+
+
+! 2. DEUXIEME APPEL (IAPPEL = 2)
+! =============================
+
+! La densite de flux net radiatif doit etre calculee
+! de maniere coherente avec les conditions aux limites
+! de la luminance. La densite de flux net radiatif est
+!DONF le bilan entre le rayonnement qu'une face de bord emet
+! (et non pas le rayonnement qu'elle reflechit) et celui
+! qu'elle absorbe.
+
+! L'exemple fourni est coherent avec l'exemple fourni pour
+! conditions aux limites sur la luminance au premier appel
+! et suffi donc en general.
+
+
+!-------------------------------------------------------------------------------
+!ARGU ARGUMENTS
+!__________________.____._____.________________________________________________.
+! nom !type!mode ! role !
+!__________________!____!_____!________________________________________________!
+! idbia0 ! e ! <-- ! numero de la 1ere case libre dans ia !
+! idbra0 ! e ! <-- ! numero de la 1ere case libre dans ra !
+! ndim ! e ! <-- ! dimension de l'espace !
+! ncelet ! e ! <-- ! nombre d'elements halo compris !
+! ncel ! e ! <-- ! nombre d'elements actifs !
+! nfac ! e ! <-- ! nombre de faces internes !
+! nfabor ! e ! <-- ! nombre de faces de bord !
+! nfml ! e ! <-- ! nombre de familles d entites !
+! nprfml ! e ! <-- ! nombre de proprietese des familles !
+! nnod ! e ! <-- ! nombre de sommets !
+! lndfac ! e ! <-- ! longueur du tableau nodfac (optionnel !
+! lndfbr ! e ! <-- ! longueur du tableau nodfbr (optionnel !
+! ncelbr ! e ! <-- ! nombre d'elements ayant au moins une !
+! ! ! ! face de bord !
+! nvar ! e ! <-- ! nombre total de variables !
+! nscal ! e ! <-- ! nombre total de scalaires !
+! iphas ! e ! <-- ! numero de la phase courante !
+! nideve nrdeve ! e ! <-- ! longueur de idevel rdevel !
+! nituse nrtuse ! e ! <-- ! longueur de ituser rtuser !
+! ifacel ! te ! <-- ! elements voisins d'une face interne !
+! (2, nfac) ! ! ! !
+! ifabor ! te ! <-- ! element voisin d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmfbr ! te ! <-- ! numero de famille d'une face de bord !
+! (nfabor) ! ! ! !
+! ifmcel ! te ! <-- ! numero de famille d'une cellule !
+! (ncelet) ! ! ! !
+! iprfml ! te ! <-- ! proprietes d'une famille !
+! nfml ,nprfml ! ! ! !
+! itypfb(nfabor ! te ! <-- ! type des faces de bord !
+! nphas ) ! ! ! !
+! ipnfac ! te ! <-- ! position du premier noeud de chaque !
+! (lndfac) ! ! ! face interne dans nodfac (optionnel) !
+! nodfac ! te ! <-- ! connectivite faces internes/noeuds !
+! (nfac+1) ! ! ! (optionnel) !
+! ipnfbr ! te ! <-- ! position du premier noeud de chaque !
+! (lndfbr) ! ! ! face de bord dans nodfbr (optionnel) !
+! nodfbr ! te ! <-- ! connectivite faces de bord/noeuds !
+! (nfabor+1) ! ! ! (optionnel) !
+! izfrdp(nfabor ! te ! <-- ! numero de zone pour les faces de bord !
+! idevel(nideve ! te ! <-- ! tab entier complementaire developemt !
+! ituser(nituse ! te ! <-- ! tab entier complementaire utilisateur !
+! ia(*) ! tr ! --- ! macro tableau entier !
+! xyzcen ! tr ! <-- ! point associes aux volumes de control !
+! (ndim,ncelet ! ! ! !
+! surfac ! tr ! <-- ! vecteur surface des faces internes !
+! (ndim,nfac) ! ! ! !
+! surfbo ! tr ! <-- ! vecteur surface des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! cdgfac ! tr ! <-- ! centre de gravite des faces internes !
+! (ndim,nfac) ! ! ! !
+! cdgfbo ! tr ! <-- ! centre de gravite des faces de bord !
+! (ndim,nfabor) ! ! ! !
+! xyznod ! tr ! <-- ! coordonnes des noeuds (optionnel) !
+! (ndim,nnod) ! ! ! !
+! volume ! tr ! <-- ! volume d'un des ncelet elements !
+! (ncelet ! ! ! !
+! dt(ncelet) ! tr ! <-- ! pas de temps !
+! rtp, rtpa ! tr ! <-- ! variables de calcul au centre des !
+! (ncelet,*) ! ! ! cellules (instant courant ou prec) !
+! propce ! tr ! <-- ! proprietes physiques au centre des !
+! (ncelet,*) ! ! ! cellules !
+! propfa ! tr ! <-- ! proprietes physiques au centre des !
+! (nfac,*) ! ! ! faces internes !
+! propfb ! tr ! <-- ! proprietes physiques au centre des !
+! (nfabor,*) ! ! ! faces de bord !
+! coefa, coefb ! tr ! <-- ! conditions aux limites aux !
+! (nfabor,*) ! ! ! faces de bord !
+! cofrua,cofrub ! tr ! --> ! conditions aux limites aux !
+!(nfabor) ! ! ! faces de bord pour la luminances !
+! w1...6(ncelet ! tr ! --- ! tableau de travail !
+! tparoi(nfabor ! tr ! <-- ! temperature de paroi en kelvin !
+! qincid(nfabor ! tr ! <-- ! densite de flux radiatif aux bords !
+! flunet(nfabor ! tr ! --> ! densite de flux net radiatif !
+! ck (ncelet) ! tr ! --> ! coefficient d'absorption du milieu !
+! ! ! ! (nul si transparent) !
+! xlam(nfabor) ! tr ! <-- ! coefficient de conductivite thermique !
+! ! ! ! des facettes de paroi (w/m/k) !
+! epa (nfabor) ! tr ! <-- ! epaisseur des facettes de paroi (m) !
+! eps (nfabor) ! tr ! <-- ! emissivite des facettes de bord !
+! rdevel(nrdeve ! tr ! <-- ! tab reel complementaire developemt !
+! rtuser(nrtuse ! tr ! <-- ! tab reel complementaire utilisateur !
+! ra(*) ! tr ! --- ! macro tableau reel !
+!__________________!____!_____!________________________________________________!
+
+! TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
+! L (LOGIQUE) .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
+! MODE : <-- donnee, --> resultat, <-> Donnee modifiee
+! --- tableau de travail
+!-------------------------------------------------------------------------------
+!===============================================================================
+
+implicit none
+
+!===============================================================================
+! DONNEES EN COMMON
+!===============================================================================
+
+include "paramx.h"
+include "numvar.h"
+include "entsor.h"
+include "optcal.h"
+include "cstphy.h"
+include "cstnum.h"
+include "pointe.h"
+include "parall.h"
+include "period.h"
+include "ppppar.h"
+include "ppthch.h"
+include "cpincl.h"
+include "ppincl.h"
+include "radiat.h"
+include "ihmpre.h"
+
+!===============================================================================
+
+! Arguments
+
+integer idbia0 , idbra0
+integer ndim , ncelet , ncel , nfac , nfabor
+integer nfml , nprfml
+integer nnod , lndfac , lndfbr , ncelbr
+integer nvar , nscal , iphas , iappel
+integer nideve , nrdeve , nituse , nrtuse
+
+integer ifacel(2,nfac) , ifabor(nfabor)
+integer ifmfbr(nfabor) , ifmcel(ncelet)
+integer iprfml(nfml,nprfml) , itypfb(nfabor)
+integer ipnfac(nfac+1), nodfac(lndfac)
+integer ipnfbr(nfabor+1), nodfbr(lndfbr),izfrdp(nfabor)
+integer idevel(nideve), ituser(nituse), ia(*)
+
+double precision xyzcen(ndim,ncelet)
+double precision surfac(ndim,nfac), surfbo(ndim,nfabor)
+double precision cdgfac(ndim,nfac), cdgfbo(ndim,nfabor)
+double precision xyznod(ndim,nnod), volume(ncelet)
+double precision dt(ncelet), rtp(ncelet,*), rtpa(ncelet,*)
+double precision propce(ncelet,*)
+double precision propfa(nfac,*), propfb(nfabor,*)
+double precision coefa(nfabor,*), coefb(nfabor,*)
+
+double precision cofrua(nfabor), cofrub(nfabor)
+
+double precision w1(ncelet), w2(ncelet), w3(ncelet)
+double precision w4(ncelet), w5(ncelet), w6(ncelet)
+
+double precision tparoi(nfabor), qincid(nfabor)
+double precision xlam(nfabor), epa(nfabor)
+double precision eps(nfabor), flunet(nfabor)
+double precision ck(ncelet)
+
+double precision rdevel(nrdeve), rtuser(nrtuse), ra(*)
+
+
+! VARIABLES LOCALES
+
+integer idebia , idebra , ifac, iok
+double precision unspi, xit, distbf
+
+!===============================================================================
+
+!===============================================================================
+! 0 - GESTION MEMOIRE
+!===============================================================================
+
+idebia = idbia0
+idebra = idbra0
+
+! Indicateur d'arret (pour savoir si des faces ont ete oubliees)
+iok = 0
+
+unspi = 1.d0/pi
+
+!===============================================================================
+! 1. PREMIER APPEL
+! ================
+!===============================================================================
+
+if (iappel.eq.1) then
+
+
+!===============================================================================
+! 1.1 - CONDITIONS AUX LIMITES :
+! MODELE DOM : COFRUA CONTIENT LA LUMINANCE
+! MODELE P-1 : COFRUA ET COFRUB SONT A REMPLIR
+! LES EXEMPLES DONNES ICI SONT LES INITIALISATIONS FAITES
+! PAR DEFAUT ET SONT SUFFISANTES EN GENERAL
+!===============================================================================
+
+
+
+
+! A - MODELE DOM
+! ^^^^^^^^^^^^^^
+
+
+
+
+ if (iirayo.eq.1) then
+
+ do ifac = 1,nfabor
+
+! 1.1.1 - SYMETRIE :
+! ----------
+! REFLEXION TOTALE DU RAYONNEMENT ( EPS=0 )
+! -----------------------------------------
+
+ if (itypfb(ifac).eq.isymet) then
+
+ cofrua(ifac) = qincid(ifac) * unspi
+
+
+! 1.1.2 - PAROIS 'FLUIDES' : LUMINANCES RENTRANTES "NULLES"
+! (ATTENTION LOGIQUE DIFFERENTE DU MODELE P-1)
+! -------------------------------------------------
+
+ else if (itypfb(ifac).eq.ientre &
+ .or. itypfb(ifac).eq.isolib) then
+
+ cofrua(ifac) = epzero
+
+
+! 1.1.3. - PAROIS 'SOLIDES' DE TEMPERATURE TPAROI ET D'EMISSIVITE EPS
+! ----------------------------------------------------------
+
+ else if (itypfb(ifac).eq.iparoi &
+ .or. itypfb(ifac).eq.iparug) then
+
+ cofrua(ifac) = eps(ifac)*stephn*(tparoi(ifac)**4)*unspi &
+ + (1.d0-eps(ifac))* qincid(ifac)*unspi
+
+ else
+
+! 1.1.4 - SI DES FACES N'ONT PAS ETE TRAITEES, IL FAUT S'ARRETER
+! ------------------------------------------------------
+
+! ==============================================
+
+! CONSERVER IMPERATIVEMENT LE TEST D'ARRET
+
+! ==============================================
+
+ write (nfecra,1000) ifac,izfrdp(ifac),itypfb(ifac)
+ iok = iok + 1
+ endif
+
+ enddo
+
+
+
+
+! B - MODELE P-1
+! ^^^^^^^^^^^^^^
+
+
+
+
+
+ else if (iirayo.eq.2) then
+
+ do ifac = 1,nfabor
+
+! 1.1.1 - SYMETRIE ET PAROI REFLECHISSANTE (EPS = 0) :
+! CONDITION DE FLUX NUL
+! ------------------------------------------
+
+ if (itypfb(ifac).eq.isymet .or. &
+ ((itypfb(ifac).eq.iparoi.or. &
+ itypfb(ifac).eq.iparug).and.eps(ifac).eq.0d0)) then
+
+ cofrua(ifac) = 0.d0
+ cofrub(ifac) = 1.d0
+
+
+! 1.1.2 - PAROIS 'FLUIDES' : CONDITION DE FLUX NUL
+! (ATTENTION LOGIQUE DIFFERENTE DU MODELE DOM)
+! --------------------------------------------
+
+ else if (itypfb(ifac).eq.ientre &
+ .or. itypfb(ifac).eq.isolib) then
+
+ cofrua(ifac) = 0.d0
+ cofrub(ifac) = 1.d0
+
+
+! 1.1.3 - PAROIS 'SOLIDES' DE TEMPERATURE TPAROI ET D'EMISSIVITE EPS
+! (EPS NON NUL)
+! ----------------------------------------------------------
+
+ else if (itypfb(ifac).eq.iparoi .or. &
+ itypfb(ifac).eq.iparug ) then
+
+ distbf = ra(idistb-1+ifac)
+
+ xit = 1.5d0 *distbf *ck(ifabor(ifac)) &
+ * (2.d0 /(2.d0-eps(ifac)) -1.d0)
+
+ cofrub(ifac) = 1.d0 / (1.d0 + xit)
+ cofrua(ifac) = xit * tparoi(ifac)**4 * cofrub(ifac)
+
+ else
+
+! 1.1.4 - SI DES FACES N'ONT PAS ETE TRAITEES, IL FAUT S'ARRETER
+! ------------------------------------------------------
+
+! ==============================================
+
+! CONSERVER IMPERATIVEMENT LE TEST D'ARRET
+
+! ==============================================
+
+ write (nfecra,1000) ifac,izfrdp(ifac),itypfb(ifac)
+ iok = iok + 1
+ endif
+
+ enddo
+
+ endif
+
+ if (iok.ne.0) then
+ write (nfecra,1100) iphas
+ call csexit (1)
+ !==========
+ endif
+
+!===============================================================================
+! 2 - DEUXIEME APPEL
+! ===================
+!===============================================================================
+
+else if (iappel.eq.2) then
+
+!===============================================================================
+! 2.1 - DENSITE DE FLUNET RADIATIF AUX DIFFERENTES FRONTIERES
+! L'EXEMPLE DONNE ICI EST L'INITIALISATION FAITE PAR DEFAUT
+!===============================================================================
+
+! DANS LE CAS OU LES CONDITIONS A LA LIMITES CI-DESSUS
+! AURAIENT ETE MODIFIEES, IL EST NECESSAIRE DE MODIFIER
+! LA MANIERE DONT EST CALCULE LA DENSITE DE FLUX NET RADIATIF,
+! DE MANIERE COHERENTE.
+! LA REGLE EST LA SUIVANTE :
+! LA DENSITE DE FLUX NET EST UN BILAN ENTRE CE QU'UNE FACE
+! DE BORD EMET COMME RAYONNEMENT (ET NON CE QU'ELLE REFLECHIT)
+! ET CE QU'ELLE ABSORBE (ORIENTATION DE LA NORMALE SORTANTE)
+! AINSI, SI UNE PAROI CHAUFFE LE FLUIDE, FLUNET < 0
+
+
+
+
+ do ifac = 1,nfabor
+
+ if (itypfb(ifac).eq.iparoi .or. &
+ itypfb(ifac).eq.iparug) then
+
+! 2.1.1 - PAROIS 'SOLIDES' DE TEMPERATURE TPAROI ET D'EMISSIVITE EPS
+! ----------------------------------------------------------
+
+ flunet(ifac) = &
+ eps(ifac) *(qincid(ifac) - stephn*tparoi(ifac)**4)
+
+
+! 2.1.2 - SYMETRIE :
+! ----------
+! REFLEXION TOTALE DU RAYONNEMENT ( FLUNET = 0 )
+! ----------------------------------------------
+ else if (itypfb(ifac).eq.isymet) then
+
+ flunet(ifac)= zero
+
+
+! 2.1.3 - PAROIS 'FLUIDES'
+! ----------------
+
+ else if (itypfb(ifac).eq.ientre &
+ .or. itypfb(ifac).eq.isolib) then
+
+ if (iirayo.eq.1) then
+
+ flunet(ifac)= qincid(ifac) -pi*cofrua(ifac)
+
+ else if (iirayo.eq.2) then
+
+ flunet(ifac)= 0.d0
+
+ endif
+
+
+! 2.1.4 - SI DES FACES N'ONT PAS ETE TRAITEES, IL FAUT S'ARRETER
+! ------------------------------------------------------
+ else
+
+! ==============================================
+
+! CONSERVER IMPERATIVEMENT LE TEST D'ARRET
+
+! ==============================================
+
+ write (nfecra,2000) ifac,izfrdp(ifac),itypfb(ifac)
+ iok = iok + 1
+
+ endif
+
+ enddo
+
+
+ if (iok.ne.0) then
+ write (nfecra,2100) iphas
+ call csexit (1)
+ !==========
+ endif
+
+
+endif
+
+! -------
+! FORMATS
+! -------
+
+ 1000 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ CONDITIONS AUX LIMITES NON RENSEIGNEES ',/,&
+'@ ',/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' Type = ',I10 )
+
+ 1100 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ LES CONDITIONS AUX LIMITES NE SONT PAS RENSEIGNEES POUR ',/,&
+'@ CERTAINES FACES DE BORD (Phase ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage de usray3. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+ 2000 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT (FLUNET NON RENSEIGNE) ',/,&
+'@ ========= ',/,&
+'@ ',/,&
+'@ Face = ',I10 ,' Zone = ',I10 ,' Type = ',I10 )
+
+ 2100 format( &
+'@ ',/,&
+'@ ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/,&
+'@ @@ ATTENTION : RAYONNEMENT ',/,&
+'@ ========= ',/,&
+'@ LE FLUNET N''EST PAS RENSEIGNEE POUR CERTAINES ',/,&
+'@ FACES DE BORD (Phase ',I10 ,') ',/,&
+'@ ',/,&
+'@ Le calcul ne sera pas execute. ',/,&
+'@ ',/,&
+'@ Verifier le codage de usray3. ',/,&
+'@ ',/,&
+'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@',/,&
+'@ ',/)
+
+
+
+end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/code-saturne.git
More information about the debian-science-commits
mailing list